From 9bf4aaab3e101692164d49b7ca357651eb691cb6 Mon Sep 17 00:00:00 2001
From: Mark Huang <mlhuang@cs.princeton.edu>
Date: Thu, 16 Sep 2004 18:47:18 +0000
Subject: [PATCH] VServer 1.9.2 (patch-2.6.8.1-vs1.9.2.diff)

---
 CREDITS                                       |    46 +-
 Documentation/DMA-API.txt                     |    14 +
 Documentation/DMA-mapping.txt                 |     4 +-
 Documentation/IPMI.txt                        |     6 +
 Documentation/MSI-HOWTO.txt                   |   409 +-
 Documentation/SubmittingDrivers               |     3 +-
 Documentation/arm/Booting                     |     2 +-
 Documentation/basic_profiling.txt             |    40 +-
 Documentation/binfmt_misc.txt                 |    30 +-
 Documentation/cachetlb.txt                    |    11 +
 Documentation/cdrom/aztcd                     |     4 +-
 Documentation/computone.txt                   |     2 +-
 Documentation/crypto/api-intro.txt            |     8 +
 Documentation/devices.txt                     |    31 +-
 Documentation/digiepca.txt                    |     2 +-
 Documentation/dvb/firmware.txt                |     2 +-
 Documentation/dvb/ttusb-dec.txt               |     2 +-
 Documentation/filesystems/Locking             |     4 +
 Documentation/filesystems/hpfs.txt            |    12 +-
 Documentation/filesystems/ntfs.txt            |     4 +
 Documentation/filesystems/proc.txt            |    29 +-
 Documentation/filesystems/udf.txt             |     2 +-
 Documentation/filesystems/vfat.txt            |    32 +-
 Documentation/hpet.txt                        |     6 +-
 Documentation/i386/boot.txt                   |     2 +-
 Documentation/i386/zero-page.txt              |     7 +-
 Documentation/ioctl-number.txt                |     2 +
 Documentation/kbuild/modules.txt              |     4 +-
 Documentation/kernel-parameters.txt           |     6 +-
 Documentation/laptop-mode.txt                 |   681 +-
 Documentation/locks.txt                       |     2 +-
 Documentation/networking/00-INDEX             |     2 -
 Documentation/networking/Configurable         |     2 +-
 Documentation/networking/comx.txt             |     2 +-
 Documentation/networking/ip-sysctl.txt        |    64 +-
 Documentation/networking/pktgen.txt           |     4 +-
 Documentation/nmi_watchdog.txt                |     3 +
 Documentation/parisc/debugging                |     4 +-
 Documentation/parisc/registers                |     8 +-
 Documentation/pci.txt                         |     5 +-
 Documentation/pnp.txt                         |     1 -
 Documentation/power/pci.txt                   |     8 +-
 Documentation/power/swsusp.txt                |    30 +
 Documentation/power/video.txt                 |     4 -
 Documentation/s390/3270.txt                   |     2 +-
 Documentation/scsi/scsi_mid_low_api.txt       |    29 +-
 Documentation/sh/new-machine.txt              |     8 +-
 .../alsa/DocBook/writing-an-alsa-driver.tmpl  |    15 +-
 Documentation/sound/oss/INSTALL.awe           |     2 +-
 Documentation/sound/oss/Introduction          |     4 +-
 Documentation/sound/oss/PAS16                 |     4 +-
 Documentation/sysctl/README                   |     4 +-
 Documentation/sysctl/vm.txt                   |     5 +-
 Documentation/usb/URB.txt                     |     2 +-
 Documentation/usb/error-codes.txt             |     2 +
 Documentation/usb/philips.txt                 |    87 +-
 Documentation/usb/usb-help.txt                |     2 +-
 Documentation/usb/w9968cf.txt                 |   122 +-
 Documentation/video4linux/Zoran               |     2 +-
 MAINTAINERS                                   |   113 +-
 Makefile                                      |   166 +-
 README                                        |     6 +-
 arch/alpha/Makefile                           |     1 +
 arch/alpha/defconfig                          |     3 +-
 arch/alpha/kernel/core_tsunami.c              |     4 +-
 arch/alpha/kernel/entry.S                     |    18 +
 arch/alpha/kernel/init_task.c                 |     1 +
 arch/alpha/kernel/irq.c                       |    67 +-
 arch/alpha/kernel/osf_sys.c                   |     8 +-
 arch/alpha/kernel/process.c                   |    21 +-
 arch/alpha/kernel/setup.c                     |     6 +-
 arch/alpha/kernel/signal.c                    |     9 +-
 arch/alpha/kernel/smc37c669.c                 |     4 +-
 arch/alpha/kernel/smp.c                       |    41 +-
 arch/alpha/kernel/srm_env.c                   |     2 +-
 arch/alpha/kernel/sys_dp264.c                 |    17 +-
 arch/alpha/kernel/time.c                      |     1 -
 arch/alpha/kernel/traps.c                     |    31 +-
 arch/alpha/mm/fault.c                         |     4 +-
 arch/alpha/mm/init.c                          |     2 +-
 arch/alpha/mm/numa.c                          |     6 +-
 arch/arm/Kconfig                              |    43 +-
 arch/arm/Makefile                             |    28 +-
 arch/arm/boot/Makefile                        |    43 +-
 arch/arm/boot/bootp/Makefile                  |    26 +-
 arch/arm/boot/bootp/bootp.lds                 |     9 +-
 arch/arm/boot/bootp/init.S                    |    32 +-
 arch/arm/boot/compressed/Makefile             |    53 +-
 arch/arm/boot/compressed/head-clps7500.S      |     4 +-
 arch/arm/boot/compressed/head-sa1100.S        |     3 +
 arch/arm/boot/compressed/head-xscale.S        |     3 -
 arch/arm/boot/compressed/head.S               |     2 +-
 arch/arm/boot/compressed/vmlinux.lds.in       |     7 +-
 arch/arm/boot/install.sh                      |    39 +-
 arch/arm/common/Makefile                      |     4 +-
 arch/arm/common/dmabounce.c                   |    10 +-
 arch/arm/common/sa1111.c                      |    19 +-
 arch/arm/configs/a5k_defconfig                |     1 -
 arch/arm/configs/adsbitsy_defconfig           |     1 -
 arch/arm/configs/assabet_defconfig            |     1 -
 arch/arm/configs/badge4_defconfig             |     1 -
 arch/arm/configs/bast_defconfig               |   256 +-
 arch/arm/configs/cerfcube_defconfig           |     1 -
 arch/arm/configs/clps7500_defconfig           |     1 -
 arch/arm/configs/ebsa110_defconfig            |     1 -
 arch/arm/configs/edb7211_defconfig            |     1 -
 arch/arm/configs/empeg_defconfig              |     1 -
 arch/arm/configs/epxa10db_defconfig           |     1 -
 arch/arm/configs/flexanet_defconfig           |     1 -
 arch/arm/configs/footbridge_defconfig         |     1 -
 arch/arm/configs/fortunet_defconfig           |     1 -
 arch/arm/configs/freebird_defconfig           |     1 -
 arch/arm/configs/freebird_new_defconfig       |     1 -
 arch/arm/configs/graphicsclient_defconfig     |     1 -
 arch/arm/configs/graphicsmaster_defconfig     |     1 -
 arch/arm/configs/h3600_defconfig              |     1 -
 arch/arm/configs/hackkit_defconfig            |     1 -
 arch/arm/configs/huw_webpanel_defconfig       |     1 -
 arch/arm/configs/integrator_defconfig         |     1 -
 arch/arm/configs/iq80310_defconfig            |     1 -
 arch/arm/configs/iq80321_defconfig            |     1 -
 arch/arm/configs/ixp4xx_defconfig             |     1 -
 arch/arm/configs/jornada720_defconfig         |     1 -
 arch/arm/configs/lart_defconfig               |     1 -
 arch/arm/configs/lpd7a400_defconfig           |     1 -
 arch/arm/configs/lpd7a404_defconfig           |     1 -
 arch/arm/configs/lubbock_defconfig            |     1 -
 arch/arm/configs/mainstone_defconfig          |    84 +-
 arch/arm/configs/neponset_defconfig           |     1 -
 arch/arm/configs/netwinder_defconfig          |     1 -
 arch/arm/configs/omnimeter_defconfig          |     1 -
 arch/arm/configs/pangolin_defconfig           |     1 -
 arch/arm/configs/pfs168_mqtft_defconfig       |     1 -
 arch/arm/configs/pfs168_mqvga_defconfig       |     1 -
 arch/arm/configs/pfs168_sastn_defconfig       |     1 -
 arch/arm/configs/pfs168_satft_defconfig       |     1 -
 arch/arm/configs/pleb_defconfig               |     1 -
 arch/arm/configs/rpc_defconfig                |     1 -
 arch/arm/configs/s3c2410_defconfig            |   266 +-
 arch/arm/configs/shannon_defconfig            |     1 -
 arch/arm/configs/shark_defconfig              |     1 -
 arch/arm/configs/smdk2410_defconfig           |     1 -
 arch/arm/configs/stork_defconfig              |     1 -
 arch/arm/configs/system3_defconfig            |     1 -
 arch/arm/configs/trizeps_defconfig            |     1 -
 arch/arm/configs/versatile_defconfig          |     1 -
 arch/arm/defconfig                            |     1 -
 arch/arm/kernel/Makefile                      |     3 +-
 arch/arm/kernel/apm.c                         |     2 +-
 arch/arm/kernel/asm-offsets.c                 |     3 +
 arch/arm/kernel/debug.S                       |    29 +-
 arch/arm/kernel/ecard.c                       |     2 +-
 arch/arm/kernel/entry-armv.S                  |    31 +-
 arch/arm/kernel/entry-common.S                |     2 +-
 arch/arm/kernel/entry-header.S                |     6 +-
 arch/arm/kernel/head.S                        |     2 +-
 arch/arm/kernel/init_task.c                   |     1 +
 arch/arm/kernel/io.c                          |    14 +-
 arch/arm/kernel/irq.c                         |     2 +-
 arch/arm/kernel/process.c                     |     6 +
 arch/arm/kernel/ptrace.c                      |     2 +-
 arch/arm/kernel/setup.c                       |     4 +-
 arch/arm/kernel/signal.c                      |     2 +-
 arch/arm/kernel/sys_arm.c                     |     2 +-
 arch/arm/kernel/time.c                        |    35 +-
 arch/arm/kernel/traps.c                       |    16 +-
 arch/arm/lib/ecard.S                          |     2 +-
 arch/arm/mach-clps711x/autcpu12.c             |     2 +
 arch/arm/mach-clps711x/cdb89712.c             |     2 +
 arch/arm/mach-clps711x/ceiva.c                |     2 +
 arch/arm/mach-clps711x/clep7312.c             |     2 +
 arch/arm/mach-clps711x/edb7211-arch.c         |     2 +
 arch/arm/mach-clps711x/fortunet.c             |     2 +
 arch/arm/mach-clps711x/p720t.c                |     2 +
 arch/arm/mach-clps711x/time.c                 |    30 +-
 arch/arm/mach-clps7500/core.c                 |    42 +-
 arch/arm/mach-ebsa110/core.c                  |   101 +
 arch/arm/mach-ebsa110/io.c                    |    99 +-
 arch/arm/mach-epxa10db/arch.c                 |     3 +
 arch/arm/mach-epxa10db/time.c                 |    44 +-
 arch/arm/mach-footbridge/Makefile             |     2 +-
 arch/arm/mach-footbridge/arch.c               |     6 +
 arch/arm/mach-integrator/Makefile             |     2 +-
 arch/arm/mach-integrator/core.c               |   139 +
 arch/arm/mach-integrator/impd1.c              |    41 +-
 arch/arm/mach-integrator/integrator_ap.c      |     8 +-
 arch/arm/mach-integrator/integrator_cp.c      |    71 +-
 arch/arm/mach-iop3xx/arch.c                   |     2 +
 arch/arm/mach-iop3xx/iop321-time.c            |    15 +-
 arch/arm/mach-ixp4xx/common-pci.c             |     2 +
 arch/arm/mach-ixp4xx/common.c                 |    17 +-
 arch/arm/mach-ixp4xx/coyote-setup.c           |     9 +-
 arch/arm/mach-ixp4xx/ixdp425-setup.c          |    13 +-
 arch/arm/mach-ixp4xx/prpmc1100-setup.c        |     9 +-
 arch/arm/mach-lh7a40x/Kconfig                 |    31 +
 arch/arm/mach-lh7a40x/Makefile                |     7 +-
 arch/arm/mach-lh7a40x/arch-kev7a400.c         |     2 +
 arch/arm/mach-lh7a40x/arch-lpd7a40x.c         |     4 +
 arch/arm/mach-omap/Makefile                   |     2 +-
 arch/arm/mach-omap/board-generic.c            |     7 +
 arch/arm/mach-omap/board-innovator.c          |     1 +
 arch/arm/mach-omap/board-osk.c                |     1 +
 arch/arm/mach-omap/board-perseus2.c           |     1 +
 arch/arm/mach-omap/bus.c                      |    39 -
 arch/arm/mach-omap/common.h                   |     1 +
 arch/arm/mach-pxa/Makefile                    |     2 +-
 arch/arm/mach-pxa/generic.c                   |    46 +-
 arch/arm/mach-pxa/generic.h                   |     3 +
 arch/arm/mach-pxa/idp.c                       |     1 +
 arch/arm/mach-pxa/lubbock.c                   |     5 +-
 arch/arm/mach-pxa/mainstone.c                 |    63 +-
 arch/arm/mach-rpc/riscpc.c                    |    29 +
 arch/arm/mach-s3c2410/Kconfig                 |     7 +-
 arch/arm/mach-s3c2410/Makefile                |     2 +-
 arch/arm/mach-s3c2410/mach-bast.c             |     6 +
 arch/arm/mach-s3c2410/mach-h1940.c            |    12 +-
 arch/arm/mach-s3c2410/mach-smdk2410.c         |     6 +
 arch/arm/mach-s3c2410/mach-vr1000.c           |    15 +-
 arch/arm/mach-s3c2410/s3c2410.h               |     2 +
 arch/arm/mach-sa1100/Kconfig                  |     6 +
 arch/arm/mach-sa1100/Makefile                 |     4 +-
 arch/arm/mach-sa1100/adsbitsy.c               |     1 +
 arch/arm/mach-sa1100/assabet.c                |     1 +
 arch/arm/mach-sa1100/badge4.c                 |     1 +
 arch/arm/mach-sa1100/brutus.c                 |     1 +
 arch/arm/mach-sa1100/cerf.c                   |     1 +
 arch/arm/mach-sa1100/collie.c                 |     1 +
 arch/arm/mach-sa1100/empeg.c                  |     1 +
 arch/arm/mach-sa1100/flexanet.c               |     1 +
 arch/arm/mach-sa1100/freebird.c               |     1 +
 arch/arm/mach-sa1100/generic.h                |     1 +
 arch/arm/mach-sa1100/graphicsclient.c         |     1 +
 arch/arm/mach-sa1100/graphicsmaster.c         |     1 +
 arch/arm/mach-sa1100/h3600.c                  |     3 +
 arch/arm/mach-sa1100/hackkit.c                |     1 +
 arch/arm/mach-sa1100/huw_webpanel.c           |     1 +
 arch/arm/mach-sa1100/itsy.c                   |     1 +
 arch/arm/mach-sa1100/jornada720.c             |     1 +
 arch/arm/mach-sa1100/lart.c                   |     1 +
 arch/arm/mach-sa1100/nanoengine.c             |     1 +
 arch/arm/mach-sa1100/omnimeter.c              |     1 +
 arch/arm/mach-sa1100/pangolin.c               |     1 +
 arch/arm/mach-sa1100/pfs168.c                 |     1 +
 arch/arm/mach-sa1100/pleb.c                   |     1 +
 arch/arm/mach-sa1100/shannon.c                |     1 +
 arch/arm/mach-sa1100/sherman.c                |     1 +
 arch/arm/mach-sa1100/simpad.c                 |     1 +
 arch/arm/mach-sa1100/stork.c                  |     1 +
 arch/arm/mach-sa1100/system3.c                |     1 +
 arch/arm/mach-sa1100/trizeps.c                |     1 +
 arch/arm/mach-sa1100/xp860.c                  |     1 +
 arch/arm/mach-sa1100/yopy.c                   |     1 +
 arch/arm/mach-shark/core.c                    |    38 +
 arch/arm/mach-versatile/Makefile              |     2 +-
 arch/arm/mach-versatile/clock.c               |     2 +-
 arch/arm/mach-versatile/core.c                |   151 +-
 arch/arm/mm/Kconfig                           |     2 +-
 arch/arm/mm/blockops.c                        |     5 +-
 arch/arm/mm/consistent.c                      |     2 +-
 arch/arm/mm/fault.c                           |     4 +-
 arch/arm/mm/init.c                            |    15 +-
 arch/arm/mm/proc-sa1100.S                     |     1 -
 arch/arm/nwfpe/fpa11.h                        |     2 +-
 arch/arm/nwfpe/fpa11_cpdt.c                   |    48 +-
 arch/arm/nwfpe/fpmodule.c                     |     2 +-
 arch/arm/nwfpe/fpmodule.inl                   |    33 +-
 arch/arm/tools/mach-types                     |    19 +-
 arch/arm26/kernel/init_task.c                 |     1 +
 arch/arm26/kernel/irq.c                       |     2 +-
 arch/arm26/kernel/setup.c                     |     1 -
 arch/arm26/mm/init.c                          |     2 +-
 arch/cris/arch-v10/defconfig                  |     1 -
 arch/cris/arch-v10/kernel/time.c              |     2 +-
 arch/cris/defconfig                           |     1 -
 arch/cris/kernel/irq.c                        |     2 +-
 arch/cris/kernel/process.c                    |     1 +
 arch/cris/kernel/setup.c                      |     5 +-
 arch/cris/mm/init.c                           |     2 +-
 arch/h8300/Kconfig                            |     2 +-
 arch/h8300/defconfig                          |     1 -
 arch/h8300/kernel/init_task.c                 |     1 +
 arch/h8300/kernel/ptrace.c                    |    28 +-
 arch/h8300/kernel/setup.c                     |     8 +-
 arch/h8300/platform/h8s/entry.S               |     2 +-
 arch/h8300/platform/h8s/ptrace_h8s.c          |     2 +-
 arch/i386/Kconfig                             |     9 +-
 arch/i386/Makefile                            |    16 +-
 arch/i386/boot/compressed/misc.c              |    31 +-
 arch/i386/boot/edd.S                          |    35 +-
 arch/i386/defconfig                           |     2 +-
 arch/i386/kernel/Makefile                     |     1 -
 arch/i386/kernel/acpi/boot.c                  |    40 +-
 arch/i386/kernel/apic.c                       |    12 +-
 arch/i386/kernel/apm.c                        |   318 +-
 arch/i386/kernel/cpu/common.c                 |     8 +-
 arch/i386/kernel/cpu/cpufreq/powernow-k7.c    |    28 +-
 .../kernel/cpu/cpufreq/speedstep-centrino.c   |     2 +-
 arch/i386/kernel/cpu/mtrr/generic.c           |     2 +-
 arch/i386/kernel/cpu/mtrr/if.c                |     5 +-
 arch/i386/kernel/cpu/proc.c                   |     2 +-
 arch/i386/kernel/cpuid.c                      |    73 +-
 arch/i386/kernel/dmi_scan.c                   |   668 +-
 arch/i386/kernel/efi.c                        |     1 -
 arch/i386/kernel/head.S                       |    26 +
 arch/i386/kernel/i386_ksyms.c                 |    12 +-
 arch/i386/kernel/i8259.c                      |    13 +-
 arch/i386/kernel/init_task.c                  |     1 +
 arch/i386/kernel/io_apic.c                    |   142 +-
 arch/i386/kernel/irq.c                        |    13 +-
 arch/i386/kernel/ldt.c                        |     2 +-
 arch/i386/kernel/microcode.c                  |    26 +-
 arch/i386/kernel/module.c                     |     2 +-
 arch/i386/kernel/mpparse.c                    |   162 +-
 arch/i386/kernel/msr.c                        |    71 +-
 arch/i386/kernel/numaq.c                      |    36 -
 arch/i386/kernel/process.c                    |     2 +-
 arch/i386/kernel/reboot.c                     |    88 +-
 arch/i386/kernel/scx200.c                     |     1 -
 arch/i386/kernel/setup.c                      |   245 +-
 arch/i386/kernel/signal.c                     |    26 +-
 arch/i386/kernel/smp.c                        |     5 +-
 arch/i386/kernel/smpboot.c                    |    18 +-
 arch/i386/kernel/srat.c                       |    19 -
 arch/i386/kernel/sys_i386.c                   |     2 +-
 arch/i386/kernel/sysenter.c                   |     2 +-
 arch/i386/kernel/time_hpet.c                  |    45 +
 arch/i386/kernel/timers/timer_none.c          |     2 +-
 arch/i386/kernel/timers/timer_pm.c            |    38 +
 arch/i386/kernel/timers/timer_tsc.c           |   232 +-
 arch/i386/kernel/traps.c                      |    29 +-
 arch/i386/kernel/vm86.c                       |    40 +-
 arch/i386/lib/Makefile                        |     5 +-
 arch/i386/lib/delay.c                         |     7 +-
 arch/i386/lib/memcpy.c                        |    29 +-
 arch/i386/lib/usercopy.c                      |    16 +-
 arch/i386/mach-default/setup.c                |     4 +-
 arch/i386/mach-visws/mpparse.c                |     4 +-
 arch/i386/mach-visws/traps.c                  |     1 -
 arch/i386/mach-voyager/setup.c                |     4 +-
 arch/i386/mach-voyager/voyager_basic.c        |     1 -
 arch/i386/mach-voyager/voyager_smp.c          |    31 +-
 arch/i386/mach-voyager/voyager_thread.c       |     1 -
 arch/i386/math-emu/errors.c                   |    10 +-
 arch/i386/math-emu/fpu_arith.c                |    36 +-
 arch/i386/math-emu/fpu_aux.c                  |    20 +-
 arch/i386/math-emu/fpu_entry.c                |    33 +-
 arch/i386/math-emu/fpu_etc.c                  |     2 +-
 arch/i386/math-emu/fpu_proto.h                |    42 +-
 arch/i386/math-emu/fpu_system.h               |     2 +-
 arch/i386/math-emu/get_address.c              |    30 +-
 arch/i386/math-emu/load_store.c               |    52 +-
 arch/i386/math-emu/reg_compare.c              |    12 +-
 arch/i386/math-emu/reg_ld_str.c               |   150 +-
 arch/i386/math-emu/reg_round.S                |     1 -
 arch/i386/mm/discontig.c                      |    80 +-
 arch/i386/mm/fault.c                          |    50 +-
 arch/i386/mm/hugetlbpage.c                    |    15 +-
 arch/i386/mm/init.c                           |   110 +-
 arch/i386/mm/ioremap.c                        |     1 -
 arch/i386/mm/pageattr.c                       |     2 +-
 arch/i386/mm/pgtable.c                        |     2 +-
 arch/i386/oprofile/op_model_p4.c              |     2 +-
 arch/i386/pci/acpi.c                          |    31 +-
 arch/i386/pci/irq.c                           |    68 +-
 arch/i386/pci/visws.c                         |     2 -
 arch/i386/power/cpu.c                         |   109 +-
 arch/i386/power/swsusp.S                      |    27 +-
 arch/ia64/Kconfig                             |    24 +-
 arch/ia64/Makefile                            |     3 +-
 arch/ia64/configs/generic_defconfig           |   658 +-
 arch/ia64/configs/sim_defconfig               |     1 -
 arch/ia64/configs/sn2_defconfig               |   581 +-
 arch/ia64/configs/zx1_defconfig               |     1 -
 arch/ia64/defconfig                           |   125 +-
 arch/ia64/hp/common/sba_iommu.c               |    10 +
 arch/ia64/hp/sim/hpsim_irq.c                  |     7 +-
 arch/ia64/hp/sim/simeth.c                     |     9 -
 arch/ia64/ia32/binfmt_elf32.c                 |     8 +-
 arch/ia64/ia32/ia32_entry.S                   |    20 +-
 arch/ia64/ia32/ia32_support.c                 |    12 +
 arch/ia64/ia32/ia32priv.h                     |    36 +-
 arch/ia64/ia32/sys_ia32.c                     |   601 +-
 arch/ia64/kernel/acpi.c                       |    61 +-
 arch/ia64/kernel/cyclone.c                    |     3 +-
 arch/ia64/kernel/efi.c                        |    84 +-
 arch/ia64/kernel/efi_stub.S                   |     6 +-
 arch/ia64/kernel/entry.S                      |    73 +-
 arch/ia64/kernel/fsys.S                       |     5 +-
 arch/ia64/kernel/head.S                       |    22 +-
 arch/ia64/kernel/init_task.c                  |     1 +
 arch/ia64/kernel/iosapic.c                    |   248 +-
 arch/ia64/kernel/irq.c                        |    30 +-
 arch/ia64/kernel/ivt.S                        |     7 +-
 arch/ia64/kernel/machvec.c                    |     6 -
 arch/ia64/kernel/mca.c                        |   159 +-
 arch/ia64/kernel/module.c                     |    14 +-
 arch/ia64/kernel/pal.S                        |    25 +-
 arch/ia64/kernel/palinfo.c                    |     4 +-
 arch/ia64/kernel/perfmon.c                    |   167 +-
 arch/ia64/kernel/process.c                    |    18 +-
 arch/ia64/kernel/ptrace.c                     |    38 +-
 arch/ia64/kernel/sal.c                        |    24 +
 arch/ia64/kernel/salinfo.c                    |    15 +-
 arch/ia64/kernel/setup.c                      |    72 +-
 arch/ia64/kernel/smpboot.c                    |     2 +-
 arch/ia64/kernel/unwind.c                     |    35 +-
 arch/ia64/mm/contig.c                         |     2 +-
 arch/ia64/mm/discontig.c                      |     7 +-
 arch/ia64/mm/hugetlbpage.c                    |     4 +-
 arch/ia64/mm/init.c                           |     8 +-
 arch/ia64/pci/pci.c                           |    16 +-
 arch/ia64/sn/fakeprom/fw-emu.c                |     4 +-
 arch/ia64/sn/io/machvec/pci_bus_cvlink.c      |     4 +-
 arch/ia64/sn/io/platform_init/sgi_io_init.c   |     6 +-
 arch/ia64/sn/io/sn2/bte_error.c               |    13 +-
 arch/ia64/sn/io/sn2/klgraph.c                 |     4 +-
 arch/ia64/sn/io/sn2/ml_iograph.c              |    16 +-
 arch/ia64/sn/io/sn2/module.c                  |    14 +-
 arch/ia64/sn/kernel/bte.c                     |   157 +-
 arch/ia64/sn/kernel/irq.c                     |    19 +-
 arch/ia64/sn/kernel/mca.c                     |     3 +-
 arch/ia64/sn/kernel/setup.c                   |    26 +-
 arch/ia64/sn/kernel/sn2/sn2_smp.c             |    15 +
 arch/m68k/Makefile                            |     2 +
 arch/m68k/atari/stram.c                       |     4 +-
 arch/m68k/bvme6000/config.c                   |     2 +-
 arch/m68k/defconfig                           |     1 -
 arch/m68k/ifpsp060/iskeleton.S                |    53 +-
 arch/m68k/kernel/process.c                    |     1 +
 arch/m68k/kernel/setup.c                      |    13 +-
 arch/m68k/kernel/signal.c                     |    42 +-
 arch/m68k/kernel/traps.c                      |    29 +-
 arch/m68k/lib/checksum.c                      |     1 +
 arch/m68k/mac/iop.c                           |     2 +-
 arch/m68k/mac/macints.c                       |     3 +-
 arch/m68k/mm/init.c                           |     2 +-
 arch/m68k/mm/kmap.c                           |     2 +-
 arch/m68k/mm/memory.c                         |     6 +-
 arch/m68k/mvme147/config.c                    |     2 +-
 arch/m68k/mvme16x/config.c                    |     2 +-
 arch/m68k/q40/config.c                        |     7 +-
 arch/m68knommu/defconfig                      |     1 -
 arch/m68knommu/kernel/init_task.c             |     1 +
 arch/m68knommu/kernel/setup.c                 |     8 +-
 arch/mips/Kconfig                             |   102 +-
 arch/mips/Makefile                            |    15 +-
 arch/mips/baget/irq.c                         |     4 +-
 arch/mips/baget/time.c                        |     2 +-
 arch/mips/boot/Makefile                       |     2 +-
 arch/mips/configs/atlas_defconfig             |    18 +-
 arch/mips/configs/bosporus_defconfig          |    13 +-
 arch/mips/configs/capcella_defconfig          |    21 +-
 arch/mips/configs/cobalt_defconfig            |    18 +-
 arch/mips/configs/db1000_defconfig            |    14 +-
 arch/mips/configs/db1100_defconfig            |    13 +-
 arch/mips/configs/db1500_defconfig            |    17 +-
 arch/mips/configs/ddb5476_defconfig           |    18 +-
 arch/mips/configs/ddb5477_defconfig           |    15 +-
 arch/mips/configs/decstation_defconfig        |    10 +-
 arch/mips/configs/e55_defconfig               |    13 +-
 arch/mips/configs/ev64120_defconfig           |    13 +-
 arch/mips/configs/ev96100_defconfig           |     9 +-
 arch/mips/configs/ip22_defconfig              |    20 +-
 arch/mips/configs/ip27_defconfig              |    22 +-
 arch/mips/configs/ip32_defconfig              |    19 +-
 arch/mips/configs/it8172_defconfig            |    13 +-
 arch/mips/configs/ivr_defconfig               |    17 +-
 arch/mips/configs/jaguar-atx_defconfig        |    19 +-
 arch/mips/configs/jmr3927_defconfig           |    15 +-
 arch/mips/configs/lasat200_defconfig          |    16 +-
 arch/mips/configs/malta_defconfig             |    14 +-
 arch/mips/configs/mirage_defconfig            |    13 +-
 arch/mips/configs/mpc30x_defconfig            |    17 +-
 arch/mips/configs/mtx1_defconfig              |    13 +-
 arch/mips/configs/ocelot_c_defconfig          |    58 +-
 arch/mips/configs/ocelot_defconfig            |     9 +-
 arch/mips/configs/ocelot_g_defconfig          |     1 -
 arch/mips/configs/osprey_defconfig            |     9 +-
 arch/mips/configs/pb1000_defconfig            |    13 +-
 arch/mips/configs/pb1100_defconfig            |    13 +-
 arch/mips/configs/pb1500_defconfig            |    22 +-
 arch/mips/configs/pb1550_defconfig            |    22 +-
 arch/mips/configs/rm200_defconfig             |    41 +-
 arch/mips/configs/sb1250-swarm_defconfig      |    42 +-
 arch/mips/configs/sead_defconfig              |     6 +-
 arch/mips/configs/tb0226_defconfig            |    18 +-
 arch/mips/configs/tb0229_defconfig            |    21 +-
 arch/mips/configs/workpad_defconfig           |    12 +-
 arch/mips/configs/xxs1500_defconfig           |    13 +-
 arch/mips/configs/yosemite_defconfig          |   185 +-
 arch/mips/ddb5xxx/ddb5074/irq.c               |     2 +-
 arch/mips/ddb5xxx/ddb5476/irq.c               |     4 +-
 arch/mips/ddb5xxx/ddb5477/irq.c               |     2 +-
 arch/mips/defconfig                           |    20 +-
 arch/mips/gt64120/common/time.c               |     2 +-
 arch/mips/jmr3927/rbhma3100/irq.c             |     8 +-
 arch/mips/kernel/Makefile                     |     5 +-
 arch/mips/kernel/cpu-bugs64.c                 |    40 +-
 arch/mips/kernel/cpu-probe.c                  |    46 +-
 arch/mips/kernel/init_task.c                  |     1 +
 arch/mips/kernel/irq-mv6434x.c                |     4 +-
 arch/mips/kernel/irq.c                        |     2 +-
 arch/mips/kernel/linux32.c                    |     7 +
 arch/mips/kernel/module-elf32.c               |    11 -
 arch/mips/kernel/module-elf64.c               |    11 -
 arch/mips/kernel/scall32-o32.S                |     1 +
 arch/mips/kernel/scall64-64.S                 |     1 +
 arch/mips/kernel/scall64-n32.S                |     1 +
 arch/mips/kernel/scall64-o32.S                |     1 +
 arch/mips/kernel/semaphore.c                  |   328 +-
 arch/mips/kernel/setup.c                      |    18 +-
 arch/mips/kernel/syscall.c                    |     2 +-
 arch/mips/kernel/sysirix.c                    |     2 +-
 arch/mips/kernel/time.c                       |     5 +
 arch/mips/kernel/traps.c                      |    85 +-
 arch/mips/lasat/sysctl.c                      |    24 +-
 arch/mips/lib-32/Makefile                     |    22 +-
 arch/mips/lib-64/Makefile                     |    22 +-
 arch/mips/mips-boards/generic/cmdline.c       |     6 +-
 arch/mips/mips-boards/generic/printf.c        |    34 +-
 arch/mips/mm/Makefile                         |    39 +-
 arch/mips/mm/pgtable.c                        |     2 +-
 arch/mips/mm/sc-rm7k.c                        |    70 +-
 arch/mips/mm/tlb-sb1.c                        |     2 +-
 arch/mips/momentum/jaguar_atx/irq.c           |     2 +-
 arch/mips/momentum/jaguar_atx/prom.c          |    25 +-
 arch/mips/momentum/jaguar_atx/setup.c         |    67 +-
 arch/mips/momentum/ocelot_c/Makefile          |     4 +-
 arch/mips/momentum/ocelot_c/irq.c             |     7 +-
 arch/mips/momentum/ocelot_c/prom.c            |    15 +-
 arch/mips/momentum/ocelot_c/setup.c           |     8 +-
 arch/mips/momentum/ocelot_g/Makefile          |     3 +-
 arch/mips/momentum/ocelot_g/gt-irq.c          |   110 +-
 arch/mips/momentum/ocelot_g/prom.c            |    12 +-
 arch/mips/momentum/ocelot_g/setup.c           |   122 +-
 arch/mips/pci/Makefile                        |    20 +-
 arch/mips/pci/fixup-capcella.c                |    28 +-
 arch/mips/pci/fixup-tb0226.c                  |   117 +-
 arch/mips/pci/fixup-yosemite.c                |    17 +-
 arch/mips/pci/ops-msc.c                       |     6 +-
 arch/mips/pci/ops-titan.c                     |    32 +-
 arch/mips/pci/pci-ocelot-c.c                  |   165 +-
 arch/mips/pci/pci-ocelot-g.c                  |   504 +-
 arch/mips/pci/pci-vr41xx.c                    |   398 +-
 arch/mips/pci/pci-vr41xx.h                    |   283 +-
 arch/mips/pci/pci.c                           |     2 +-
 arch/mips/pmc-sierra/yosemite/Makefile        |     7 +-
 arch/mips/pmc-sierra/yosemite/i2c-yosemite.h  |    52 +-
 arch/mips/pmc-sierra/yosemite/irq-handler.S   |    87 +-
 arch/mips/pmc-sierra/yosemite/irq.c           |   247 +-
 arch/mips/pmc-sierra/yosemite/prom.c          |   144 +-
 arch/mips/pmc-sierra/yosemite/setup.c         |   175 +-
 arch/mips/pmc-sierra/yosemite/setup.h         |    18 +-
 arch/mips/ramdisk/Makefile                    |     2 +-
 arch/mips/sgi-ip22/ip22-setup.c               |     3 +
 arch/mips/sgi-ip32/ip32-irq.c                 |     4 +-
 arch/mips/sibyte/sb1250/irq.c                 |     2 +-
 arch/mips/sibyte/sb1250/irq_handler.S         |     2 +-
 arch/mips/tx4927/common/tx4927_irq.c          |     2 +-
 .../toshiba_rbtx4927/toshiba_rbtx4927_irq.c   |     4 +-
 arch/mips/vr4181/common/irq.c                 |     4 +-
 arch/mips/vr41xx/common/bcu.c                 |    54 +-
 arch/mips/vr41xx/common/cmu.c                 |     6 +-
 arch/mips/vr41xx/common/giu.c                 |   244 +-
 arch/mips/vr41xx/common/icu.c                 |   499 +-
 arch/mips/vr41xx/common/init.c                |    15 -
 arch/mips/vr41xx/common/ksyms.c               |     2 -
 arch/mips/vr41xx/common/pmu.c                 |     8 +-
 arch/mips/vr41xx/common/rtc.c                 |     8 +-
 arch/mips/vr41xx/common/serial.c              |     2 +-
 arch/mips/vr41xx/common/vrc4173.c             |   404 +-
 arch/mips/vr41xx/tanbac-tb0226/setup.c        |    61 +-
 arch/mips/vr41xx/tanbac-tb0229/Makefile       |     2 +-
 arch/mips/vr41xx/tanbac-tb0229/setup.c        |    66 +-
 arch/mips/vr41xx/victor-mpc30x/setup.c        |    61 +-
 arch/mips/vr41xx/zao-capcella/setup.c         |    61 +-
 arch/parisc/Kconfig                           |    32 +
 arch/parisc/configs/a500_defconfig            |   105 +-
 arch/parisc/configs/b180_defconfig            |   107 +-
 arch/parisc/configs/c3000_defconfig           |   101 +-
 arch/parisc/defconfig                         |     3 +-
 arch/parisc/kernel/cache.c                    |   143 +-
 arch/parisc/kernel/entry.S                    |    44 +-
 arch/parisc/kernel/firmware.c                 |    84 +-
 arch/parisc/kernel/hardware.c                 |    27 +-
 arch/parisc/kernel/head.S                     |     7 +-
 arch/parisc/kernel/head64.S                   |    11 +-
 arch/parisc/kernel/init_task.c                |     1 +
 arch/parisc/kernel/inventory.c                |     2 +
 arch/parisc/kernel/irq.c                      |    25 +-
 arch/parisc/kernel/parisc_ksyms.c             |     6 +
 arch/parisc/kernel/pci-dma.c                  |    13 +
 arch/parisc/kernel/pdc_chassis.c              |   180 +-
 arch/parisc/kernel/process.c                  |     6 +-
 arch/parisc/kernel/processor.c                |    13 +
 arch/parisc/kernel/real2.S                    |     4 +
 arch/parisc/kernel/setup.c                    |    12 +-
 arch/parisc/kernel/smp.c                      |   106 +-
 arch/parisc/kernel/sys_parisc32.c             |     7 +-
 arch/parisc/kernel/traps.c                    |    85 +-
 arch/parisc/kernel/unwind.c                   |    63 +-
 arch/parisc/lib/Makefile                      |     2 +
 arch/parisc/lib/bitops.c                      |    12 +-
 arch/parisc/lib/io.c                          |   209 +-
 arch/parisc/mm/init.c                         |   190 +-
 arch/ppc/8260_io/Kconfig                      |    15 +-
 arch/ppc/8260_io/Makefile                     |     4 +-
 arch/ppc/8260_io/enet.c                       |    33 +-
 arch/ppc/8260_io/fcc_enet.c                   |   171 +-
 arch/ppc/8xx_io/commproc.c                    |   137 +-
 arch/ppc/8xx_io/cs4218_tdm.c                  |    16 +-
 arch/ppc/8xx_io/enet.c                        |    13 +-
 arch/ppc/8xx_io/uart.c                        |    36 +-
 arch/ppc/Kconfig                              |   195 +-
 arch/ppc/Makefile                             |    47 +-
 arch/ppc/boot/common/misc-common.c            |    15 +-
 arch/ppc/boot/simple/Makefile                 |    11 +-
 arch/ppc/boot/simple/embed_config.c           |    16 +-
 arch/ppc/boot/simple/head.S                   |     4 +-
 arch/ppc/boot/simple/m8260_tty.c              |    48 +-
 arch/ppc/boot/simple/misc-embedded.c          |     4 +-
 arch/ppc/boot/simple/misc.c                   |     2 +-
 arch/ppc/boot/utils/mktree.c                  |    15 +-
 arch/ppc/configs/FADS_defconfig               |     1 -
 arch/ppc/configs/IVMS8_defconfig              |     1 -
 arch/ppc/configs/SM850_defconfig              |     1 -
 arch/ppc/configs/SPD823TS_defconfig           |     1 -
 arch/ppc/configs/TQM823L_defconfig            |     1 -
 arch/ppc/configs/TQM8260_defconfig            |     1 -
 arch/ppc/configs/TQM850L_defconfig            |     1 -
 arch/ppc/configs/TQM860L_defconfig            |     1 -
 arch/ppc/configs/adir_defconfig               |     1 -
 arch/ppc/configs/ads8272_defconfig            |     1 -
 arch/ppc/configs/apus_defconfig               |     1 -
 arch/ppc/configs/ash_defconfig                |     1 -
 arch/ppc/configs/beech_defconfig              |     1 -
 arch/ppc/configs/bseip_defconfig              |     1 -
 arch/ppc/configs/bubinga_defconfig            |     1 -
 arch/ppc/configs/cedar_defconfig              |     1 -
 arch/ppc/configs/common_defconfig             |     1 -
 arch/ppc/configs/cpci405_defconfig            |     1 -
 arch/ppc/configs/ebony_defconfig              |    25 +-
 arch/ppc/configs/ep405_defconfig              |     1 -
 arch/ppc/configs/est8260_defconfig            |     1 -
 arch/ppc/configs/ev64260_defconfig            |     1 -
 arch/ppc/configs/gemini_defconfig             |     1 -
 arch/ppc/configs/ibmchrp_defconfig            |     1 -
 arch/ppc/configs/k2_defconfig                 |     1 -
 arch/ppc/configs/lopec_defconfig              |     1 -
 arch/ppc/configs/mbx_defconfig                |     1 -
 arch/ppc/configs/menf1_defconfig              |     1 -
 arch/ppc/configs/mvme5100_defconfig           |     1 -
 arch/ppc/configs/oak_defconfig                |     1 -
 arch/ppc/configs/ocotea_defconfig             |    97 +-
 arch/ppc/configs/pcore_defconfig              |     1 -
 arch/ppc/configs/pmac_defconfig               |     1 -
 arch/ppc/configs/power3_defconfig             |     1 -
 arch/ppc/configs/pplus_defconfig              |     1 -
 arch/ppc/configs/prpmc750_defconfig           |     1 -
 arch/ppc/configs/prpmc800_defconfig           |     1 -
 arch/ppc/configs/rainier_defconfig            |     1 -
 arch/ppc/configs/redwood5_defconfig           |     1 -
 arch/ppc/configs/redwood6_defconfig           |     1 -
 arch/ppc/configs/redwood_defconfig            |     1 -
 arch/ppc/configs/rpx8260_defconfig            |     1 -
 arch/ppc/configs/rpxcllf_defconfig            |     1 -
 arch/ppc/configs/rpxlite_defconfig            |     1 -
 arch/ppc/configs/sandpoint_defconfig          |     1 -
 arch/ppc/configs/spruce_defconfig             |     1 -
 arch/ppc/configs/sycamore_defconfig           |     1 -
 arch/ppc/configs/walnut_defconfig             |     1 -
 arch/ppc/defconfig                            |     3 +-
 arch/ppc/kernel/Makefile                      |     8 +-
 arch/ppc/kernel/align.c                       |    10 +-
 arch/ppc/kernel/asm-offsets.c                 |     8 +-
 arch/ppc/kernel/cpu_setup_6xx.S               |     5 +-
 arch/ppc/kernel/cputable.c                    |    64 +-
 arch/ppc/kernel/dma-mapping.c                 |     3 +-
 arch/ppc/kernel/entry.S                       |    36 +-
 arch/ppc/kernel/head.S                        |     6 +-
 arch/ppc/kernel/head_44x.S                    |    14 +-
 arch/ppc/kernel/head_4xx.S                    |     2 +-
 arch/ppc/kernel/head_e500.S                   |     2 +
 arch/ppc/kernel/irq.c                         |    17 +-
 arch/ppc/kernel/misc.S                        |    58 +-
 arch/ppc/kernel/pci.c                         |    12 +-
 arch/ppc/kernel/ppc-stub.c                    |    28 +-
 arch/ppc/kernel/ppc_htab.c                    |    91 +-
 arch/ppc/kernel/ppc_ksyms.c                   |     9 +-
 arch/ppc/kernel/process.c                     |   108 +-
 arch/ppc/kernel/ptrace.c                      |    99 +-
 arch/ppc/kernel/setup.c                       |    62 +-
 arch/ppc/kernel/signal.c                      |    61 +-
 arch/ppc/kernel/syscalls.c                    |    14 +-
 arch/ppc/kernel/time.c                        |    22 +-
 arch/ppc/kernel/traps.c                       |   142 +-
 arch/ppc/kernel/vecemu.c                      |     5 +-
 arch/ppc/kernel/vmlinux.lds.S                 |     2 +-
 arch/ppc/lib/Makefile                         |     2 +
 arch/ppc/lib/rheap.c                          |    22 +-
 arch/ppc/mm/44x_mmu.c                         |    45 +-
 arch/ppc/mm/Makefile                          |     5 +-
 arch/ppc/mm/fault.c                           |    20 +-
 arch/ppc/mm/init.c                            |     8 +-
 arch/ppc/mm/mmu_decl.h                        |     9 +
 arch/ppc/mm/pgtable.c                         |    32 +
 arch/ppc/platforms/4xx/Kconfig                |     9 +
 arch/ppc/platforms/4xx/ebony.h                |     3 +-
 arch/ppc/platforms/4xx/redwood5.c             |    34 +-
 arch/ppc/platforms/4xx/redwood5.h             |     1 +
 arch/ppc/platforms/4xx/redwood6.c             |    34 +
 arch/ppc/platforms/4xx/redwood6.h             |     1 +
 arch/ppc/platforms/85xx/Kconfig               |    35 +-
 arch/ppc/platforms/85xx/Makefile              |     5 +
 arch/ppc/platforms/85xx/mpc8540_ads.c         |     1 +
 arch/ppc/platforms/85xx/mpc8540_ads.h         |     1 -
 arch/ppc/platforms/85xx/sbc8560.c             |     2 +
 arch/ppc/platforms/85xx/sbc8560.h             |     9 +-
 arch/ppc/platforms/85xx/sbc85xx.c             |    64 +-
 arch/ppc/platforms/Makefile                   |    11 +-
 arch/ppc/platforms/est8260.h                  |     2 +-
 arch/ppc/platforms/lopec_setup.c              |    18 +-
 arch/ppc/platforms/pmac_cpufreq.c             |   312 +-
 arch/ppc/platforms/pmac_feature.c             |    32 +
 arch/ppc/platforms/pmac_pci.c                 |    14 +-
 arch/ppc/platforms/pmac_pic.c                 |    50 +-
 arch/ppc/platforms/pmac_setup.c               |     2 -
 arch/ppc/platforms/pmac_smp.c                 |     2 +-
 arch/ppc/platforms/powerpmc250.c              |     2 +-
 arch/ppc/platforms/pplus.c                    |     2 -
 arch/ppc/platforms/prep_pci.c                 |     4 +-
 arch/ppc/platforms/prep_setup.c               |     3 +-
 arch/ppc/platforms/residual.c                 |    12 +-
 arch/ppc/platforms/sandpoint.c                |    12 +-
 arch/ppc/platforms/sbc82xx.c                  |   166 +-
 arch/ppc/platforms/sbc82xx.h                  |    12 +-
 arch/ppc/platforms/sbs8260.h                  |     2 +-
 arch/ppc/platforms/tqm8260.h                  |     2 +-
 arch/ppc/platforms/tqm8260_setup.c            |     8 +-
 arch/ppc/syslib/Makefile                      |    27 +-
 arch/ppc/syslib/cpm2_common.c                 |    53 +-
 arch/ppc/syslib/ibm440gp_common.c             |     6 +-
 arch/ppc/syslib/m8260_pci_erratum9.c          |     5 +-
 arch/ppc/syslib/m8260_setup.c                 |    37 +-
 arch/ppc/syslib/mpc10x_common.c               |    81 +-
 arch/ppc/syslib/open_pic.c                    |   101 +-
 arch/ppc/syslib/ppc4xx_dma.c                  |   934 +-
 arch/ppc/syslib/ppc4xx_pic.c                  |     8 +-
 arch/ppc/syslib/ppc85xx_setup.c               |    32 +-
 arch/ppc/syslib/ppc85xx_setup.h               |     5 +-
 arch/ppc/syslib/prom.c                        |    24 +-
 arch/ppc/syslib/prom_init.c                   |    39 +-
 arch/ppc/xmon/ppc-opc.c                       |    78 +-
 arch/ppc/xmon/start.c                         |     8 +-
 arch/ppc/xmon/xmon.c                          |    22 +-
 arch/ppc64/Kconfig                            |     7 +-
 arch/ppc64/boot/div64.S                       |     1 -
 arch/ppc64/configs/g5_defconfig               |     1 -
 arch/ppc64/configs/iSeries_defconfig          |     1 -
 arch/ppc64/configs/pSeries_defconfig          |     1 -
 arch/ppc64/defconfig                          |     1 -
 arch/ppc64/kernel/ItLpQueue.c                 |     2 +-
 arch/ppc64/kernel/LparData.c                  |     3 +
 arch/ppc64/kernel/Makefile                    |    14 +-
 arch/ppc64/kernel/align.c                     |    13 +-
 arch/ppc64/kernel/asm-offsets.c               |    50 +-
 arch/ppc64/kernel/bitops.c                    |    12 +-
 arch/ppc64/kernel/chrp_setup.c                |    46 +-
 arch/ppc64/kernel/cputable.c                  |     6 +-
 arch/ppc64/kernel/dma.c                       |     2 +-
 arch/ppc64/kernel/eeh.c                       |   195 +-
 arch/ppc64/kernel/entry.S                     |   496 +-
 arch/ppc64/kernel/head.S                      |  2026 +--
 arch/ppc64/kernel/hvconsole.c                 |     7 +-
 arch/ppc64/kernel/iSeries_htab.c              |    57 +-
 arch/ppc64/kernel/iSeries_proc.c              |     2 +-
 arch/ppc64/kernel/iSeries_setup.c             |    17 +-
 arch/ppc64/kernel/idle.c                      |    26 +-
 arch/ppc64/kernel/init_task.c                 |     1 +
 arch/ppc64/kernel/ioctl32.c                   |     2 +-
 arch/ppc64/kernel/irq.c                       |   129 +-
 arch/ppc64/kernel/lparcfg.c                   |   527 +-
 arch/ppc64/kernel/mf_proc.c                   |    37 +-
 arch/ppc64/kernel/misc.S                      |    25 +-
 arch/ppc64/kernel/open_pic.c                  |    18 +-
 arch/ppc64/kernel/open_pic_defs.h             |     2 -
 arch/ppc64/kernel/pSeries_htab.c              |    19 +-
 arch/ppc64/kernel/pSeries_iommu.c             |     4 +-
 arch/ppc64/kernel/pSeries_lpar.c              |     4 +-
 arch/ppc64/kernel/pSeries_nvram.c             |     6 +-
 arch/ppc64/kernel/pSeries_pci.c               |    77 +-
 arch/ppc64/kernel/pacaData.c                  |   296 +-
 arch/ppc64/kernel/pci.h                       |     9 +-
 arch/ppc64/kernel/pci_dn.c                    |   109 +-
 arch/ppc64/kernel/pmac_pci.c                  |     2 +-
 arch/ppc64/kernel/pmac_smp.c                  |     2 +-
 arch/ppc64/kernel/ppc_ksyms.c                 |     5 -
 arch/ppc64/kernel/proc_ppc64.c                |    19 +-
 arch/ppc64/kernel/process.c                   |    93 +-
 arch/ppc64/kernel/prom.c                      |  1144 +-
 arch/ppc64/kernel/ptrace.c                    |    12 +-
 arch/ppc64/kernel/ptrace32.c                  |    22 +-
 arch/ppc64/kernel/ras.c                       |   184 +-
 arch/ppc64/kernel/rtas-proc.c                 |   686 +-
 arch/ppc64/kernel/rtas.c                      |   195 +-
 arch/ppc64/kernel/rtas_flash.c                |    12 +-
 arch/ppc64/kernel/rtasd.c                     |    31 +-
 arch/ppc64/kernel/rtc.c                       |    31 +-
 arch/ppc64/kernel/scanlog.c                   |    14 +-
 arch/ppc64/kernel/setup.c                     |    20 +-
 arch/ppc64/kernel/signal.c                    |    12 +-
 arch/ppc64/kernel/signal32.c                  |    39 +-
 arch/ppc64/kernel/smp.c                       |    78 +-
 arch/ppc64/kernel/stab.c                      |   281 +-
 arch/ppc64/kernel/sys_ppc32.c                 |     8 +-
 arch/ppc64/kernel/syscalls.c                  |    14 +
 arch/ppc64/kernel/sysfs.c                     |    16 +-
 arch/ppc64/kernel/time.c                      |     9 +-
 arch/ppc64/kernel/traps.c                     |    81 +-
 arch/ppc64/kernel/udbg.c                      |   106 +-
 arch/ppc64/kernel/vio.c                       |   191 +-
 arch/ppc64/kernel/viopath.c                   |    81 +-
 arch/ppc64/kernel/xics.c                      |   138 +-
 arch/ppc64/lib/Makefile                       |     8 +-
 arch/ppc64/lib/locks.c                        |    38 +-
 arch/ppc64/lib/string.S                       |    78 +-
 arch/ppc64/mm/Makefile                        |     2 +-
 arch/ppc64/mm/fault.c                         |    85 +-
 arch/ppc64/mm/hash_utils.c                    |     1 -
 arch/ppc64/mm/hugetlbpage.c                   |     5 +-
 arch/ppc64/mm/init.c                          |    22 +-
 arch/ppc64/mm/numa.c                          |     3 +-
 arch/ppc64/mm/tlb.c                           |    40 +-
 arch/ppc64/oprofile/common.c                  |     4 +-
 arch/ppc64/oprofile/op_model_power4.c         |     2 +-
 arch/ppc64/xmon/xmon.c                        |    10 +-
 arch/s390/Kconfig                             |    24 +-
 arch/s390/appldata/appldata_base.c            |   227 +-
 arch/s390/appldata/appldata_os.c              |    23 +-
 arch/s390/defconfig                           |    40 +-
 arch/s390/kernel/Makefile                     |     2 +
 arch/s390/kernel/compat_linux.h               |     3 +
 arch/s390/kernel/compat_signal.c              |    52 +
 arch/s390/kernel/debug.c                      |   120 +-
 arch/s390/kernel/entry.S                      |   297 +-
 arch/s390/kernel/entry64.S                    |   279 +-
 arch/s390/kernel/head.S                       |     4 -
 arch/s390/kernel/head64.S                     |     4 -
 arch/s390/kernel/init_task.c                  |     1 +
 arch/s390/kernel/process.c                    |    51 +-
 arch/s390/kernel/ptrace.c                     |    13 +
 arch/s390/kernel/s390_ksyms.c                 |    18 +-
 arch/s390/kernel/setup.c                      |    26 +-
 arch/s390/kernel/signal.c                     |     5 +
 arch/s390/kernel/smp.c                        |   245 +-
 arch/s390/kernel/time.c                       |   572 +-
 arch/s390/kernel/traps.c                      |    84 +-
 arch/s390/lib/string.c                        |     9 -
 arch/s390/mm/cmm.c                            |    23 +-
 arch/s390/mm/fault.c                          |    40 +-
 arch/s390/mm/init.c                           |     2 +-
 arch/sh/Kconfig                               |   126 +-
 arch/sh/Makefile                              |    28 +-
 arch/sh/boot/compressed/Makefile              |     4 +
 arch/sh/boot/compressed/misc.c                |    34 +-
 arch/sh/cchips/Kconfig                        |    13 +
 arch/sh/cchips/hd6446x/hd64461/setup.c        |     2 +-
 arch/sh/cchips/hd6446x/hd64465/setup.c        |     2 +-
 arch/sh/configs/dreamcast_defconfig           |     1 -
 arch/sh/configs/rts7751r2d_defconfig          |     1 -
 arch/sh/configs/se7751_defconfig              |     1 -
 arch/sh/configs/snapgear_defconfig            |     1 -
 arch/sh/defconfig                             |     2 +-
 arch/sh/drivers/dma/Makefile                  |     1 +
 arch/sh/drivers/dma/dma-api.c                 |   175 +-
 arch/sh/drivers/dma/dma-isa.c                 |    29 +-
 arch/sh/drivers/dma/dma-sh.c                  |   164 +-
 arch/sh/drivers/pci/Makefile                  |     1 +
 arch/sh/drivers/pci/ops-snapgear.c            |     2 +
 arch/sh/drivers/pci/pci-auto.c                |   221 +-
 arch/sh/drivers/pci/pci-sh7751.c              |    37 +-
 arch/sh/drivers/pci/pci-sh7751.h              |     7 +
 arch/sh/drivers/pci/pci.c                     |     2 +-
 arch/sh/kernel/Makefile                       |     1 +
 arch/sh/kernel/cpu/Makefile                   |     3 +-
 arch/sh/kernel/cpu/init.c                     |    54 +-
 arch/sh/kernel/cpu/irq_ipr.c                  |    39 +-
 arch/sh/kernel/cpu/sh3/ex.S                   |    79 +-
 arch/sh/kernel/cpu/sh4/sq.c                   |     2 -
 arch/sh/kernel/entry.S                        |    15 +-
 arch/sh/kernel/init_task.c                    |     1 +
 arch/sh/kernel/io_generic.c                   |    58 +-
 arch/sh/kernel/irq.c                          |    45 +-
 arch/sh/kernel/process.c                      |    35 +-
 arch/sh/kernel/ptrace.c                       |     9 +-
 arch/sh/kernel/setup.c                        |   162 +-
 arch/sh/kernel/sh_ksyms.c                     |     4 +
 arch/sh/kernel/time.c                         |   184 +-
 arch/sh/kernel/traps.c                        |     6 +-
 arch/sh/kernel/vmlinux.lds.S                  |     8 +
 arch/sh/lib/delay.c                           |     6 +
 arch/sh/mm/cache-sh3.c                        |    14 +-
 arch/sh/mm/cache-sh4.c                        |    56 +-
 arch/sh/mm/consistent.c                       |    40 +-
 arch/sh/mm/init.c                             |    64 +-
 arch/sh/mm/pg-sh4.c                           |    27 +-
 arch/sh/mm/tlb-sh3.c                          |     2 +-
 arch/sh/tools/mach-types                      |     3 +
 arch/sh64/configs/cayman_defconfig            |     1 -
 arch/sh64/defconfig                           |     1 -
 arch/sparc/Kconfig                            |     2 +
 arch/sparc/defconfig                          |    75 +-
 arch/sparc/kernel/init_task.c                 |     1 +
 arch/sparc/kernel/ioport.c                    |     6 +-
 arch/sparc/kernel/irq.c                       |     6 +-
 arch/sparc/kernel/process.c                   |     2 +-
 arch/sparc/kernel/setup.c                     |     5 +-
 arch/sparc/kernel/signal.c                    |     6 +-
 arch/sparc/kernel/smp.c                       |    36 +-
 arch/sparc/kernel/sparc_ksyms.c               |     2 +-
 arch/sparc/kernel/sun4c_irq.c                 |     2 +-
 arch/sparc/kernel/sun4d_irq.c                 |     6 +-
 arch/sparc/kernel/sun4d_smp.c                 |    29 +-
 arch/sparc/kernel/sun4m_smp.c                 |    38 +-
 arch/sparc/kernel/sun4setup.c                 |     1 +
 arch/sparc/kernel/sys_sparc.c                 |     2 +-
 arch/sparc/kernel/sys_sunos.c                 |     6 +-
 arch/sparc/kernel/time.c                      |    12 +-
 arch/sparc/kernel/trampoline.S                |     2 -
 arch/sparc/kernel/traps.c                     |    18 +-
 arch/sparc/kernel/unaligned.c                 |     2 +-
 arch/sparc/lib/copy_user.S                    |    76 +-
 arch/sparc/lib/memcpy.S                       |   228 +-
 arch/sparc/mm/fault.c                         |     8 +-
 arch/sparc/mm/init.c                          |     4 +-
 arch/sparc/mm/io-unit.c                       |     1 +
 arch/sparc/mm/iommu.c                         |     1 +
 arch/sparc/mm/nosrmmu.c                       |     7 +-
 arch/sparc/mm/srmmu.c                         |     8 +-
 arch/sparc/mm/sun4c.c                         |    12 +-
 arch/sparc64/Kconfig                          |     9 +-
 arch/sparc64/defconfig                        |   137 +-
 arch/sparc64/kernel/auxio.c                   |     4 +-
 arch/sparc64/kernel/binfmt_aout32.c           |    31 +-
 arch/sparc64/kernel/ebus.c                    |    18 +-
 arch/sparc64/kernel/entry.S                   |    62 +-
 arch/sparc64/kernel/head.S                    |     3 -
 arch/sparc64/kernel/init_task.c               |     1 +
 arch/sparc64/kernel/ioctl32.c                 |   573 +-
 arch/sparc64/kernel/irq.c                     |    72 +-
 arch/sparc64/kernel/itlb_base.S               |     6 +-
 arch/sparc64/kernel/power.c                   |     2 +-
 arch/sparc64/kernel/process.c                 |     7 +-
 arch/sparc64/kernel/rtrap.S                   |     3 +-
 arch/sparc64/kernel/sbus.c                    |    67 +-
 arch/sparc64/kernel/setup.c                   |     4 +-
 arch/sparc64/kernel/signal32.c                |     8 +-
 arch/sparc64/kernel/smp.c                     |   174 +-
 arch/sparc64/kernel/sparc64_ksyms.c           |    16 +-
 arch/sparc64/kernel/sys_sparc.c               |     2 +-
 arch/sparc64/kernel/sys_sparc32.c             |   140 +-
 arch/sparc64/kernel/sys_sunos32.c             |     4 +-
 arch/sparc64/kernel/systbls.S                 |     9 +-
 arch/sparc64/kernel/time.c                    |    56 +-
 arch/sparc64/kernel/traps.c                   |    18 +-
 arch/sparc64/lib/Makefile                     |     2 +-
 arch/sparc64/lib/U3copy_from_user.S           |   635 +-
 arch/sparc64/lib/U3copy_in_user.S             |   543 +-
 arch/sparc64/lib/U3copy_to_user.S             |   618 +-
 arch/sparc64/lib/U3memcpy.S                   |   592 +-
 arch/sparc64/lib/VISbzero.S                   |     4 -
 arch/sparc64/lib/VIScopy.S                    |    49 -
 arch/sparc64/lib/atomic.S                     |     4 -
 arch/sparc64/lib/bitops.S                     |     6 -
 arch/sparc64/lib/find_bit.c                   |     5 +-
 arch/sparc64/lib/rwlock.S                     |     4 -
 arch/sparc64/lib/splock.S                     |    12 +
 arch/sparc64/mm/Makefile                      |     2 +-
 arch/sparc64/mm/fault.c                       |    20 +-
 arch/sparc64/mm/init.c                        |   101 +-
 arch/sparc64/mm/ultra.S                       |   268 +-
 arch/sparc64/solaris/conv.h                   |     2 +-
 arch/sparc64/solaris/fs.c                     |   170 +-
 arch/sparc64/solaris/ioctl.c                  |   123 +-
 arch/sparc64/solaris/ipc.c                    |    44 +-
 arch/sparc64/solaris/misc.c                   |    84 +-
 arch/sparc64/solaris/signal.c                 |    70 +-
 arch/sparc64/solaris/socket.c                 |    52 +-
 arch/sparc64/solaris/timod.c                  |    60 +-
 arch/um/config.release                        |     1 -
 arch/um/defconfig                             |     1 -
 arch/um/drivers/harddog_kern.c                |     6 +-
 arch/um/kernel/init_task.c                    |     1 +
 arch/um/kernel/irq.c                          |     2 +-
 arch/um/kernel/mem.c                          |     2 +-
 arch/um/kernel/sys_call_table.c               |     3 +
 arch/um/kernel/sysrq.c                        |     2 +-
 arch/um/kernel/user_util.c                    |     1 -
 arch/v850/kernel/as85ep1.c                    |    12 +-
 arch/v850/kernel/as85ep1.ld                   |     2 +-
 arch/v850/kernel/fpga85e2c.c                  |     2 +-
 arch/v850/kernel/init_task.c                  |     1 +
 arch/v850/kernel/irq.c                        |    11 +-
 arch/v850/kernel/setup.c                      |     9 +-
 arch/v850/kernel/time.c                       |     2 +-
 arch/v850/kernel/vmlinux.lds.S                |     6 +-
 arch/v850/lib/memset.c                        |    25 +-
 arch/x86_64/Makefile                          |     2 +
 arch/x86_64/defconfig                         |     1 -
 arch/x86_64/ia32/ia32_aout.c                  |    16 +-
 arch/x86_64/ia32/ia32_signal.c                |    18 +-
 arch/x86_64/ia32/sys_ia32.c                   |    24 +-
 arch/x86_64/kernel/e820.c                     |     2 +-
 arch/x86_64/kernel/head64.c                   |     1 +
 arch/x86_64/kernel/i8259.c                    |    28 +-
 arch/x86_64/kernel/init_task.c                |     1 +
 arch/x86_64/kernel/io_apic.c                  |    34 +-
 arch/x86_64/kernel/irq.c                      |     4 +-
 arch/x86_64/kernel/ldt.c                      |     2 +-
 arch/x86_64/kernel/module.c                   |     2 +-
 arch/x86_64/kernel/mpparse.c                  |   132 +-
 arch/x86_64/kernel/pci-gart.c                 |    35 +-
 arch/x86_64/kernel/setup.c                    |    41 +-
 arch/x86_64/kernel/signal.c                   |     2 +-
 arch/x86_64/kernel/smp.c                      |     4 +-
 arch/x86_64/kernel/smpboot.c                  |     7 +-
 arch/x86_64/kernel/suspend.c                  |    76 +-
 arch/x86_64/kernel/time.c                     |     2 +-
 arch/x86_64/kernel/traps.c                    |    20 +-
 arch/x86_64/kernel/x8664_ksyms.c              |     1 -
 arch/x86_64/lib/csum-wrappers.c               |     4 +-
 arch/x86_64/lib/usercopy.c                    |     2 +-
 arch/x86_64/mm/fault.c                        |     4 +-
 arch/x86_64/mm/init.c                         |     2 +-
 arch/x86_64/mm/numa.c                         |     2 +-
 arch/x86_64/mm/pageattr.c                     |     2 +-
 crypto/Kconfig                                |    49 +-
 crypto/Makefile                               |     2 +
 crypto/cipher.c                               |     4 +-
 crypto/deflate.c                              |    77 +-
 crypto/tcrypt.c                               |    30 +-
 crypto/tcrypt.h                               |   286 +
 crypto/twofish.c                              |     3 +
 drivers/Kconfig                               |     2 +
 drivers/Makefile                              |     1 +
 drivers/acpi/Kconfig                          |     2 +-
 drivers/acpi/namespace/nsalloc.c              |     4 +-
 drivers/acpi/namespace/nsdumpdv.c             |     2 +-
 drivers/acpi/namespace/nsload.c               |     6 +-
 drivers/acpi/namespace/nswalk.c               |     6 +-
 drivers/acpi/pci_irq.c                        |   119 +-
 drivers/acpi/pci_link.c                       |    26 +-
 drivers/acpi/pci_root.c                       |    49 +-
 drivers/acpi/scan.c                           |    12 +-
 drivers/acpi/sleep/main.c                     |    29 +-
 drivers/acpi/sleep/proc.c                     |     2 +-
 drivers/acpi/system.c                         |    40 +-
 drivers/acpi/tables.c                         |     8 +-
 drivers/acpi/thermal.c                        |     7 +
 drivers/acpi/toshiba_acpi.c                   |    10 +-
 drivers/atm/ambassador.c                      |     4 +-
 drivers/atm/firestream.c                      |     4 +-
 drivers/atm/fore200e.c                        |     4 +-
 drivers/atm/he.c                              |     2 +-
 drivers/atm/horizon.c                         |    14 +-
 drivers/atm/idt77105.c                        |     2 +-
 drivers/atm/idt77252.c                        |     2 +-
 drivers/atm/iphase.c                          |     2 +-
 drivers/atm/iphase.h                          |     2 -
 drivers/atm/lanai.c                           |     2 +-
 drivers/atm/suni.c                            |     2 +-
 drivers/atm/uPD98402.c                        |     4 +-
 drivers/base/Kconfig                          |    20 +-
 drivers/base/base.h                           |     5 +-
 drivers/base/bus.c                            |   231 +-
 drivers/base/class.c                          |   117 +-
 drivers/base/class_simple.c                   |    12 +-
 drivers/base/core.c                           |    58 +-
 drivers/base/cpu.c                            |     4 +-
 drivers/base/dmapool.c                        |    12 +-
 drivers/base/driver.c                         |    35 +-
 drivers/base/firmware.c                       |     6 +-
 drivers/base/firmware_class.c                 |    10 +-
 drivers/base/init.c                           |     4 +-
 drivers/base/interface.c                      |    18 +-
 drivers/base/node.c                           |    21 +-
 drivers/base/platform.c                       |   218 +-
 drivers/base/power/main.c                     |    14 +-
 drivers/base/power/power.h                    |     8 +-
 drivers/base/power/resume.c                   |    12 +-
 drivers/base/power/runtime.c                  |     8 +-
 drivers/base/power/shutdown.c                 |    18 +-
 drivers/base/power/suspend.c                  |    42 +-
 drivers/base/power/sysfs.c                    |    18 +-
 drivers/base/sys.c                            |   102 +-
 drivers/block/Kconfig                         |    24 +-
 drivers/block/Makefile                        |     2 +-
 drivers/block/ataflop.c                       |    37 +-
 drivers/block/cciss.c                         |   142 +
 drivers/block/cciss_scsi.c                    |     2 +-
 drivers/block/cfq-iosched.c                   |   226 +-
 drivers/block/cryptoloop.c                    |     8 +-
 drivers/block/deadline-iosched.c              |     2 +-
 drivers/block/elevator.c                      |    10 +-
 drivers/block/floppy.c                        |    63 +-
 drivers/block/genhd.c                         |    13 +-
 drivers/block/ll_rw_blk.c                     |   226 +-
 drivers/block/loop.c                          |     2 +-
 drivers/block/nbd.c                           |    12 +-
 drivers/block/paride/bpck6.c                  |     6 +-
 drivers/block/paride/paride.c                 |     2 +-
 drivers/block/paride/pcd.c                    |     4 +-
 drivers/block/paride/pf.c                     |     4 +-
 drivers/block/paride/ppc6lnx.c                |    62 +-
 drivers/block/scsi_ioctl.c                    |   105 +-
 drivers/block/swim3.c                         |     1 +
 drivers/block/viodasd.c                       |    89 +-
 drivers/block/xd.c                            |    22 +-
 drivers/bluetooth/bfusb.c                     |     4 +
 drivers/bluetooth/bluecard_cs.c               |     7 +-
 drivers/bluetooth/bt3c_cs.c                   |    44 +-
 drivers/bluetooth/btuart_cs.c                 |     4 +-
 drivers/bluetooth/dtl1_cs.c                   |     4 +-
 drivers/bluetooth/hci_bcsp.c                  |     3 +-
 drivers/bluetooth/hci_usb.c                   |    31 +-
 drivers/bluetooth/hci_vhci.c                  |     2 +-
 drivers/cdrom/aztcd.c                         |     2 +-
 drivers/cdrom/cdrom.c                         |    70 +-
 drivers/cdrom/cdu31a.c                        |     2 +-
 drivers/cdrom/cm206.c                         |     2 +-
 drivers/cdrom/isp16.c                         |    45 +-
 drivers/cdrom/mcd.c                           |     2 +-
 drivers/cdrom/mcdx.c                          |    14 +-
 drivers/cdrom/optcd.c                         |     2 +-
 drivers/cdrom/sbpcd.c                         |    46 +-
 drivers/cdrom/sbpcd.h                         |     2 +-
 drivers/cdrom/viocd.c                         |   187 +-
 drivers/char/Kconfig                          |   128 +-
 drivers/char/Makefile                         |     8 +-
 drivers/char/README.scc                       |     2 +-
 drivers/char/agp/Kconfig                      |     4 +-
 drivers/char/agp/amd64-agp.c                  |    22 +-
 drivers/char/agp/generic.c                    |    96 +-
 drivers/char/agp/hp-agp.c                     |    11 +-
 drivers/char/agp/intel-agp.c                  |   317 +-
 drivers/char/agp/intel-mch-agp.c              |     2 +-
 drivers/char/agp/sis-agp.c                    |     4 +
 drivers/char/agp/sworks-agp.c                 |    10 +-
 drivers/char/agp/via-agp.c                    |    21 +-
 drivers/char/applicom.c                       |    19 +-
 drivers/char/cyclades.c                       |    73 +-
 drivers/char/defkeymap.c_shipped              |    14 +-
 drivers/char/drm/Kconfig                      |     2 +-
 drivers/char/drm/drm.h                        |    30 +-
 drivers/char/drm/drmP.h                       |    12 +-
 drivers/char/drm/drm_agpsupport.h             |    15 +-
 drivers/char/drm/drm_auth.h                   |     4 +-
 drivers/char/drm/drm_bufs.h                   |    64 +-
 drivers/char/drm/drm_context.h                |    30 +-
 drivers/char/drm/drm_dma.h                    |     4 +-
 drivers/char/drm/drm_drawable.h               |     2 +-
 drivers/char/drm/drm_drv.h                    |    19 +-
 drivers/char/drm/drm_fops.h                   |     2 +-
 drivers/char/drm/drm_ioctl.h                  |    25 +-
 drivers/char/drm/drm_irq.h                    |    20 +-
 drivers/char/drm/drm_lock.h                   |     4 +-
 drivers/char/drm/drm_scatter.h                |    11 +-
 drivers/char/drm/drm_vm.h                     |     2 +-
 drivers/char/drm/ffb_context.c                |    22 +-
 drivers/char/drm/gamma_context.h              |    25 +-
 drivers/char/drm/gamma_dma.c                  |    18 +-
 drivers/char/drm/gamma_lock.h                 |     2 +-
 drivers/char/drm/gamma_old_dma.h              |    41 +-
 drivers/char/drm/i810_dma.c                   |    28 +-
 drivers/char/drm/i830_dma.c                   |    41 +-
 drivers/char/drm/i830_irq.c                   |     6 +-
 drivers/char/drm/mga_dma.c                    |     9 +-
 drivers/char/drm/mga_drm.h                    |     2 +-
 drivers/char/drm/mga_state.c                  |    12 +-
 drivers/char/drm/r128_cce.c                   |     9 +-
 drivers/char/drm/r128_drm.h                   |    12 +-
 drivers/char/drm/r128_state.c                 |    16 +-
 drivers/char/drm/radeon.h                     |     2 +-
 drivers/char/drm/radeon_cp.c                  |     9 +-
 drivers/char/drm/radeon_drm.h                 |    22 +-
 drivers/char/drm/radeon_drv.h                 |     2 +-
 drivers/char/drm/radeon_irq.c                 |     4 +-
 drivers/char/drm/radeon_mem.c                 |    20 +-
 drivers/char/drm/radeon_state.c               |    57 +-
 drivers/char/drm/sis_ds.c                     |     4 +-
 drivers/char/drm/sis_mm.c                     |    22 +-
 drivers/char/ds1620.c                         |    31 +-
 drivers/char/dsp56k.c                         |     8 +-
 drivers/char/dtlk.c                           |    25 +-
 drivers/char/epca.c                           |   122 +-
 drivers/char/esp.c                            |    44 +-
 drivers/char/ftape/compressor/lzrw3.c         |    47 +-
 .../char/ftape/compressor/zftape-compress.c   |     8 +-
 drivers/char/ftape/lowlevel/fdc-io.c          |     5 +-
 drivers/char/ftape/lowlevel/ftape-init.c      |     4 +-
 drivers/char/ftape/lowlevel/ftape-proc.c      |     2 +-
 drivers/char/ftape/zftape/zftape-ctl.c        |     2 +-
 drivers/char/ftape/zftape/zftape-ctl.h        |     2 +-
 drivers/char/ftape/zftape/zftape-init.c       |    11 +-
 drivers/char/ftape/zftape/zftape-init.h       |     4 +-
 drivers/char/ftape/zftape/zftape-read.c       |     6 +-
 drivers/char/ftape/zftape/zftape-read.h       |     2 +-
 drivers/char/ftape/zftape/zftape-write.c      |     6 +-
 drivers/char/ftape/zftape/zftape-write.h      |     2 +-
 drivers/char/generic_serial.c                 |    10 +-
 drivers/char/genrtc.c                         |    19 +-
 drivers/char/hpet.c                           |   144 +-
 drivers/char/ip2main.c                        |    65 +-
 drivers/char/ipmi/ipmi_bt_sm.c                |     2 +-
 drivers/char/ipmi/ipmi_devintf.c              |    47 +-
 drivers/char/ipmi/ipmi_kcs_sm.c               |     2 +-
 drivers/char/ipmi/ipmi_msghandler.c           |    69 +-
 drivers/char/ipmi/ipmi_si_intf.c              |    65 +-
 drivers/char/ipmi/ipmi_smic_sm.c              |     2 +-
 drivers/char/ipmi/ipmi_watchdog.c             |    63 +-
 drivers/char/isicom.c                         |    32 +-
 drivers/char/istallion.c                      |   348 +-
 drivers/char/keyboard.c                       |     7 +-
 drivers/char/lcd.c                            |   686 +-
 drivers/char/mem.c                            |     1 -
 drivers/char/misc.c                           |    17 -
 drivers/char/moxa.c                           |   117 +-
 drivers/char/mwave/3780i.c                    |    20 +-
 drivers/char/mwave/3780i.h                    |    10 +-
 drivers/char/mwave/mwavedd.c                  |    53 +-
 drivers/char/mwave/tp3780i.c                  |    20 +-
 drivers/char/mwave/tp3780i.h                  |     4 +-
 drivers/char/mxser.c                          |    60 +-
 drivers/char/n_hdlc.c                         |    16 +-
 drivers/char/n_r3964.c                        |    14 +-
 drivers/char/n_tty.c                          |    17 +-
 drivers/char/nvram.c                          |     4 +-
 drivers/char/nwbutton.c                       |     2 +-
 drivers/char/nwbutton.h                       |     2 -
 drivers/char/nwflash.c                        |    23 +-
 drivers/char/pcmcia/synclink_cs.c             |    16 +-
 drivers/char/pty.c                            |     4 +-
 drivers/char/random.c                         |    13 +-
 drivers/char/raw.c                            |    26 +-
 drivers/char/riscom8.c                        |    17 +-
 drivers/char/rocket.c                         |    33 +-
 drivers/char/rtc.c                            |    18 +-
 drivers/char/scx200_gpio.c                    |     8 +-
 drivers/char/selection.c                      |     2 +-
 drivers/char/ser_a2232.c                      |    94 +-
 drivers/char/sonypi.c                         |   148 +-
 drivers/char/sonypi.h                         |     4 +-
 drivers/char/specialix.c                      |    36 +-
 drivers/char/stallion.c                       |   259 +-
 drivers/char/sx.c                             |    20 +-
 drivers/char/synclink.c                       |    12 +-
 drivers/char/synclinkmp.c                     |    65 +-
 drivers/char/tipar.c                          |    11 +-
 drivers/char/tpqic02.c                        |     6 +-
 drivers/char/tty_io.c                         |   111 +-
 drivers/char/vc_screen.c                      |    23 +-
 drivers/char/viotape.c                        |   119 +-
 drivers/char/vt.c                             |   246 +-
 drivers/char/vt_ioctl.c                       |     6 +-
 drivers/char/watchdog/Kconfig                 |    22 +-
 drivers/char/watchdog/Makefile                |     1 +
 drivers/char/watchdog/acquirewdt.c            |    18 +-
 drivers/char/watchdog/advantechwdt.c          |    20 +-
 drivers/char/watchdog/alim1535_wdt.c          |    20 +-
 drivers/char/watchdog/alim7101_wdt.c          |    20 +-
 drivers/char/watchdog/cpu5wdt.c               |     9 +-
 drivers/char/watchdog/eurotechwdt.c           |    23 +-
 drivers/char/watchdog/i8xx_tco.c              |    20 +-
 drivers/char/watchdog/ib700wdt.c              |    18 +-
 drivers/char/watchdog/indydog.c               |   121 +-
 drivers/char/watchdog/ixp4xx_wdt.c            |     6 +-
 drivers/char/watchdog/machzwd.c               |    15 +-
 drivers/char/watchdog/mixcomwd.c              |    15 +-
 drivers/char/watchdog/pcwd.c                  |    12 +-
 drivers/char/watchdog/pcwd_pci.c              |    32 +-
 drivers/char/watchdog/pcwd_usb.c              |    32 +-
 drivers/char/watchdog/sa1100_wdt.c            |    13 +-
 drivers/char/watchdog/sbc60xxwdt.c            |    20 +-
 drivers/char/watchdog/sc1200wdt.c             |    21 +-
 drivers/char/watchdog/sc520_wdt.c             |    20 +-
 drivers/char/watchdog/scx200_wdt.c            |    18 +-
 drivers/char/watchdog/shwdt.c                 |     6 +-
 drivers/char/watchdog/softdog.c               |    18 +-
 drivers/char/watchdog/w83627hf_wdt.c          |    20 +-
 drivers/char/watchdog/w83877f_wdt.c           |    20 +-
 drivers/char/watchdog/wafer5823wdt.c          |    21 +-
 drivers/char/watchdog/wdt.c                   |    28 +-
 drivers/char/watchdog/wdt285.c                |     5 +-
 drivers/char/watchdog/wdt977.c                |    27 +-
 drivers/char/watchdog/wdt_pci.c               |    28 +-
 drivers/cpufreq/cpufreq_userspace.c           |     6 +-
 drivers/fc4/fc.c                              |     2 +-
 drivers/fc4/soc.c                             |     2 +-
 drivers/fc4/socal.c                           |     2 +-
 drivers/firmware/Kconfig                      |    19 +
 drivers/firmware/Makefile                     |     1 +
 drivers/firmware/edd.c                        |   113 +-
 drivers/firmware/efivars.c                    |     2 +-
 drivers/firmware/pcdp.c                       |    10 +-
 drivers/firmware/pcdp.h                       |    12 +-
 drivers/i2c/busses/i2c-elektor.c              |     6 +-
 drivers/i2c/busses/i2c-ibm_iic.c              |   132 +-
 drivers/i2c/busses/i2c-piix4.c                |    24 +-
 drivers/i2c/busses/i2c-rpx.c                  |     4 +-
 drivers/i2c/busses/scx200_acb.c               |     1 +
 drivers/i2c/chips/Kconfig                     |    44 +-
 drivers/i2c/chips/Makefile                    |     3 +
 drivers/i2c/chips/asb100.c                    |    66 +-
 drivers/i2c/chips/it87.c                      |    72 +-
 drivers/i2c/chips/lm75.c                      |    37 +-
 drivers/i2c/chips/lm78.c                      |   110 +-
 drivers/i2c/chips/lm85.c                      |    26 +-
 drivers/i2c/chips/lm90.c                      |    69 +-
 drivers/i2c/chips/via686a.c                   |    18 +-
 drivers/i2c/chips/w83627hf.c                  |   200 +-
 drivers/i2c/chips/w83781d.c                   |    41 +-
 drivers/i2c/chips/w83l785ts.c                 |     4 +-
 drivers/i2c/i2c-core.c                        |    10 +-
 drivers/i2c/i2c-dev.c                         |    40 +-
 drivers/ide/Kconfig                           |    40 +-
 drivers/ide/Makefile                          |     1 -
 drivers/ide/ide-cd.c                          |    56 +-
 drivers/ide/ide-cd.h                          |     2 -
 drivers/ide/ide-disk.c                        |    17 +-
 drivers/ide/ide-dma.c                         |     4 +-
 drivers/ide/ide-floppy.c                      |     2 +-
 drivers/ide/ide-proc.c                        |     3 +-
 drivers/ide/ide-tape.c                        |    32 +-
 drivers/ide/ide-taskfile.c                    |   811 +-
 drivers/ide/ide.c                             |     8 +-
 drivers/ide/legacy/hd.c                       |     2 +-
 drivers/ide/legacy/ide-cs.c                   |   135 +-
 drivers/ide/legacy/pdc4030.c                  |     4 +-
 drivers/ide/pci/amd74xx.c                     |    20 +-
 drivers/ide/pci/generic.c                     |     2 +
 drivers/ide/pci/hpt366.c                      |   271 +-
 drivers/ide/pci/hpt366.h                      |     9 +
 drivers/ide/pci/pdc202xx_old.c                |     6 +
 drivers/ide/pci/piix.c                        |     4 +-
 drivers/ide/pci/siimage.c                     |     5 +-
 drivers/ide/pci/trm290.c                      |    14 +-
 drivers/ide/ppc/pmac.c                        |    12 +-
 drivers/ieee1394/Kconfig                      |     3 +-
 drivers/ieee1394/amdtp.c                      |     4 +-
 drivers/ieee1394/dv1394.c                     |    17 +-
 drivers/ieee1394/eth1394.c                    |    34 +-
 drivers/ieee1394/nodemgr.c                    |     2 +-
 drivers/ieee1394/raw1394-private.h            |     4 +-
 drivers/ieee1394/raw1394.c                    |    92 +-
 drivers/ieee1394/raw1394.h                    |    10 +-
 drivers/ieee1394/sbp2.c                       |     2 +-
 drivers/ieee1394/video1394.c                  |    47 +-
 drivers/ieee1394/video1394.h                  |     2 +-
 drivers/input/input.c                         |     4 +-
 drivers/input/joydev.c                        |    41 +-
 drivers/input/joystick/analog.c               |     4 +-
 drivers/input/joystick/grip.c                 |     4 +-
 drivers/input/joystick/grip_mp.c              |     4 +-
 drivers/input/keyboard/Kconfig                |    12 -
 drivers/input/keyboard/atkbd.c                |     2 +-
 drivers/input/keyboard/sunkbd.c               |     4 +-
 drivers/input/misc/Kconfig                    |     4 -
 drivers/input/misc/uinput.c                   |     6 +-
 drivers/input/mouse/Kconfig                   |    11 -
 drivers/input/mouse/Makefile                  |     1 -
 drivers/input/mouse/pc110pad.c                |    10 +-
 drivers/input/serio/Kconfig                   |    10 -
 drivers/input/serio/ambakmi.c                 |    38 +-
 drivers/input/serio/i8042-io.h                |     2 +
 drivers/input/tsdev.c                         |     2 +-
 drivers/isdn/act2000/act2000.h                |     4 +-
 drivers/isdn/act2000/act2000_isa.c            |     8 +-
 drivers/isdn/act2000/act2000_isa.h            |     2 +-
 drivers/isdn/act2000/module.c                 |    23 +-
 drivers/isdn/capi/capi.c                      |    90 +-
 drivers/isdn/capi/capidrv.c                   |   231 +-
 drivers/isdn/capi/capilib.c                   |     8 +-
 drivers/isdn/capi/capiutil.c                  |   262 +-
 drivers/isdn/capi/kcapi.c                     |    37 +-
 drivers/isdn/capi/kcapi_proc.c                |     6 +-
 drivers/isdn/divert/divert_procfs.c           |     4 +-
 drivers/isdn/hardware/avm/b1.c                |     6 +-
 drivers/isdn/hardware/eicon/capifunc.c        |     4 +-
 drivers/isdn/hardware/eicon/capimain.c        |     4 +-
 drivers/isdn/hardware/eicon/dadapter.c        |     4 +-
 drivers/isdn/hardware/eicon/debug.c           |    92 +-
 drivers/isdn/hardware/eicon/di.c              |     6 +-
 drivers/isdn/hardware/eicon/diddfunc.c        |     2 +-
 drivers/isdn/hardware/eicon/diva.c            |    34 +-
 drivers/isdn/hardware/eicon/diva.h            |    10 +-
 drivers/isdn/hardware/eicon/diva_dma.c        |     9 +-
 drivers/isdn/hardware/eicon/divamnt.c         |    33 +-
 drivers/isdn/hardware/eicon/divasfunc.c       |     2 +-
 drivers/isdn/hardware/eicon/divasi.c          |     8 +-
 drivers/isdn/hardware/eicon/divasmain.c       |    12 +-
 drivers/isdn/hardware/eicon/divasproc.c       |    33 +-
 drivers/isdn/hardware/eicon/dqueue.c          |     8 +-
 drivers/isdn/hardware/eicon/idifunc.c         |     2 +-
 drivers/isdn/hardware/eicon/maintidi.c        |     8 +-
 drivers/isdn/hardware/eicon/message.c         |    90 +-
 drivers/isdn/hardware/eicon/mntfunc.c         |    10 +-
 drivers/isdn/hardware/eicon/os_4bri.c         |    26 +-
 drivers/isdn/hardware/eicon/os_bri.c          |    12 +-
 drivers/isdn/hardware/eicon/os_pri.c          |    10 +-
 drivers/isdn/hardware/eicon/platform.h        |     7 +-
 drivers/isdn/hardware/eicon/um_idi.c          |    30 +-
 drivers/isdn/hisax/Kconfig                    |    14 +-
 drivers/isdn/hisax/avm_pci.c                  |     4 +-
 drivers/isdn/hisax/callc.c                    |     2 +-
 drivers/isdn/hisax/config.c                   |    20 +-
 drivers/isdn/hisax/diva.c                     |     4 +-
 drivers/isdn/hisax/elsa.c                     |     2 +-
 drivers/isdn/hisax/elsa_cs.c                  |    17 -
 drivers/isdn/hisax/elsa_ser.c                 |     2 +-
 drivers/isdn/hisax/hfc_2bds0.c                |     4 +-
 drivers/isdn/hisax/hfc_pci.c                  |     2 +-
 drivers/isdn/hisax/hfc_usb.c                  |     4 +-
 drivers/isdn/hisax/isac.c                     |     2 +-
 drivers/isdn/hisax/isar.c                     |     6 +-
 drivers/isdn/hisax/isdnhdlc.c                 |    49 +-
 drivers/isdn/hisax/isdnl1.c                   |     2 +-
 drivers/isdn/hisax/isdnl2.c                   |     2 +-
 drivers/isdn/hisax/isdnl3.c                   |     2 +-
 drivers/isdn/hisax/l3_1tr6.c                  |     2 +-
 drivers/isdn/hisax/l3dss1.c                   |     2 +-
 drivers/isdn/hisax/netjet.c                   |    48 +-
 drivers/isdn/hisax/st5481_d.c                 |     2 +-
 drivers/isdn/hisax/st5481_hdlc.c              |    48 +-
 drivers/isdn/hisax/tei.c                      |     8 +-
 drivers/isdn/hisax/teles_cs.c                 |    17 -
 drivers/isdn/hysdn/Kconfig                    |     2 +-
 drivers/isdn/hysdn/hycapi.c                   |     4 +-
 drivers/isdn/hysdn/hysdn_procconf.c           |    11 +-
 drivers/isdn/hysdn/hysdn_proclog.c            |    11 +-
 drivers/isdn/i4l/isdn_common.c                |   103 +-
 drivers/isdn/i4l/isdn_net.c                   |    46 +-
 drivers/isdn/i4l/isdn_net.h                   |     4 +-
 drivers/isdn/i4l/isdn_ppp.c                   |   183 +-
 drivers/isdn/i4l/isdn_ppp.h                   |     4 +-
 drivers/isdn/i4l/isdn_tty.c                   |    22 +-
 drivers/isdn/i4l/isdn_x25iface.c              |     9 +-
 drivers/isdn/icn/icn.c                        |    45 +-
 drivers/isdn/isdnloop/isdnloop.c              |    17 +-
 drivers/isdn/pcbit/Kconfig                    |     2 +-
 drivers/isdn/pcbit/drv.c                      |    69 +-
 drivers/isdn/pcbit/module.c                   |     6 +-
 drivers/isdn/sc/command.c                     |     4 +-
 drivers/isdn/sc/hardware.h                    |     2 +-
 drivers/isdn/sc/ioctl.c                       |    28 +-
 drivers/isdn/sc/message.c                     |     1 -
 drivers/isdn/sc/packet.c                      |     4 +-
 drivers/isdn/sc/scioc.h                       |     2 +-
 drivers/isdn/sc/shmem.c                       |    33 +-
 drivers/isdn/tpam/Kconfig                     |     1 +
 drivers/isdn/tpam/tpam.h                      |     4 +-
 drivers/isdn/tpam/tpam_commands.c             |     8 +-
 drivers/isdn/tpam/tpam_crcpc.c                |    44 +-
 drivers/isdn/tpam/tpam_memory.c               |     6 +-
 drivers/macintosh/Kconfig                     |     9 +-
 drivers/macintosh/adb.c                       |     9 +-
 drivers/macintosh/adbhid.c                    |     4 +-
 drivers/macintosh/ans-lcd.c                   |    19 +-
 drivers/macintosh/macio-adb.c                 |     4 +-
 drivers/macintosh/macserial.c                 |    20 +-
 drivers/macintosh/mediabay.c                  |    16 +-
 drivers/macintosh/therm_pm72.c                |    21 +
 drivers/macintosh/via-cuda.c                  |     4 +-
 drivers/macintosh/via-pmu.c                   |    35 +-
 drivers/macintosh/via-pmu68k.c                |     8 +-
 drivers/md/Kconfig                            |    20 +
 drivers/md/Makefile                           |     7 +-
 drivers/md/dm-raid1.c                         |     6 +-
 drivers/md/dm-table.c                         |     4 +-
 drivers/md/dm.c                               |   114 +-
 drivers/md/kcopyd.c                           |    18 +-
 drivers/md/multipath.c                        |     9 +-
 drivers/md/raid1.c                            |    13 +-
 drivers/md/raid5.c                            |     2 +-
 drivers/md/raid6main.c                        |     2 +-
 drivers/md/xor.c                              |    39 +-
 drivers/media/common/ir-common.c              |     4 +-
 drivers/media/common/saa7146_fops.c           |     6 +-
 drivers/media/common/saa7146_vbi.c            |     2 +-
 drivers/media/common/saa7146_video.c          |    14 +-
 drivers/media/dvb/b2c2/Kconfig                |     2 +-
 drivers/media/dvb/b2c2/skystar2.c             |    12 +-
 drivers/media/dvb/bt8xx/dvb-bt8xx.c           |     2 +-
 drivers/media/dvb/dvb-core/dmxdev.c           |    46 +-
 drivers/media/dvb/dvb-core/dvb_ca_en50221.c   |     8 +-
 drivers/media/dvb/dvb-core/dvb_demux.c        |    28 +-
 drivers/media/dvb/dvb-core/dvb_functions.c    |    10 +-
 drivers/media/dvb/dvb-core/dvb_i2c.c          |     8 +-
 drivers/media/dvb/dvb-core/dvb_net.c          |    29 +-
 drivers/media/dvb/dvb-core/dvb_ringbuffer.c   |    21 +-
 drivers/media/dvb/dvb-core/dvb_ringbuffer.h   |     7 +-
 drivers/media/dvb/dvb-core/dvbdev.c           |     2 +-
 drivers/media/dvb/dvb-core/dvbdev.h           |     2 +-
 drivers/media/dvb/frontends/alps_tdlb7.c      |    10 +-
 drivers/media/dvb/frontends/sp887x.c          |     9 +-
 drivers/media/dvb/frontends/stv0299.c         |     6 +-
 drivers/media/dvb/frontends/tda1004x.c        |    16 +-
 drivers/media/dvb/ttpci/av7110.c              |     8 +-
 drivers/media/dvb/ttpci/av7110_av.c           |    71 +-
 drivers/media/dvb/ttpci/av7110_ca.c           |    42 +-
 drivers/media/dvb/ttpci/av7110_hw.c           |    25 +-
 drivers/media/dvb/ttpci/av7110_ir.c           |     2 +-
 .../media/dvb/ttusb-budget/dvb-ttusb-budget.c |     4 +-
 drivers/media/dvb/ttusb-dec/ttusb_dec.c       |     8 +-
 drivers/media/radio/Kconfig                   |     2 +-
 drivers/media/radio/miropcm20-radio.c         |     8 +-
 drivers/media/radio/miropcm20-rds.c           |     2 +-
 drivers/media/radio/radio-cadet.c             |     2 +-
 drivers/media/radio/radio-gemtek.c            |     2 +-
 drivers/media/radio/radio-zoltrix.c           |     2 +-
 drivers/media/video/Kconfig                   |    17 +-
 drivers/media/video/Makefile                  |     1 +
 drivers/media/video/bttv-cards.c              |    97 +-
 drivers/media/video/bttv-driver.c             |   137 +-
 drivers/media/video/bttv-risc.c               |    28 +-
 drivers/media/video/bttv-vbi.c                |     5 +-
 drivers/media/video/bttv.h                    |     2 +
 drivers/media/video/bttvp.h                   |    13 +-
 drivers/media/video/bw-qcam.c                 |     6 +-
 drivers/media/video/c-qcam.c                  |     4 +-
 drivers/media/video/cpia.c                    |    10 +-
 drivers/media/video/cx88/cx88-cards.c         |   176 +-
 drivers/media/video/cx88/cx88-i2c.c           |     2 -
 drivers/media/video/cx88/cx88-reg.h           |    10 +
 drivers/media/video/cx88/cx88-tvaudio.c       |   397 +-
 drivers/media/video/cx88/cx88-vbi.c           |    13 +-
 drivers/media/video/cx88/cx88-video.c         |   177 +-
 drivers/media/video/cx88/cx88.h               |    34 +-
 drivers/media/video/dpc7146.c                 |     2 +-
 drivers/media/video/hexium_orion.c            |     2 +-
 drivers/media/video/ir-kbd-gpio.c             |    84 +-
 drivers/media/video/ir-kbd-i2c.c              |   122 +-
 drivers/media/video/meye.c                    |    36 +-
 drivers/media/video/meye.h                    |     2 +-
 drivers/media/video/msp3400.c                 |    62 +-
 drivers/media/video/mxb.c                     |     2 +-
 drivers/media/video/pms.c                     |     4 +-
 drivers/media/video/saa5246a.c                |   116 +-
 drivers/media/video/saa5246a.h                |     6 +-
 drivers/media/video/saa7134/saa6752hs.c       |     1 -
 drivers/media/video/saa7134/saa7134-cards.c   |   122 +-
 drivers/media/video/saa7134/saa7134-core.c    |    24 +-
 drivers/media/video/saa7134/saa7134-input.c   |    68 +-
 drivers/media/video/saa7134/saa7134-oss.c     |    74 +-
 drivers/media/video/saa7134/saa7134-ts.c      |    29 +-
 drivers/media/video/saa7134/saa7134-tvaudio.c |   172 +-
 drivers/media/video/saa7134/saa7134-video.c   |   203 +-
 drivers/media/video/saa7134/saa7134.h         |     6 +-
 drivers/media/video/stradis.c                 |    14 +-
 drivers/media/video/tda9840.c                 |     8 +-
 drivers/media/video/tda9887.c                 |   616 +-
 drivers/media/video/tea6415c.c                |     9 +-
 drivers/media/video/tea6420.c                 |     7 +-
 drivers/media/video/tuner.c                   |   241 +-
 drivers/media/video/tvmixer.c                 |    12 +-
 drivers/media/video/v4l1-compat.c             |     2 +-
 drivers/media/video/video-buf.c               |    67 +-
 drivers/media/video/videocodec.c              |     4 +-
 drivers/media/video/videodev.c                |    10 +-
 drivers/media/video/w9966.c                   |    22 +-
 drivers/media/video/zoran_driver.c            |    20 +-
 drivers/media/video/zoran_procfs.c            |   108 +-
 drivers/message/fusion/isense.c               |     8 -
 drivers/message/fusion/linux_compat.h         |   187 +-
 drivers/message/fusion/lsi/mpi_type.h         |    17 +-
 drivers/message/fusion/mptbase.c              |  1176 +-
 drivers/message/fusion/mptbase.h              |    78 +-
 drivers/message/fusion/mptctl.c               |   393 +-
 drivers/message/fusion/mptctl.h               |    10 +-
 drivers/message/fusion/mptlan.c               |    35 +-
 drivers/message/fusion/mptscsih.c             |   440 +-
 drivers/message/fusion/mptscsih.h             |    71 -
 drivers/message/i2o/i2o_block.c               |    15 +-
 drivers/message/i2o/i2o_config.c              |    59 +-
 drivers/message/i2o/i2o_core.c                |   170 +-
 drivers/message/i2o/i2o_proc.c                |     4 +-
 drivers/message/i2o/i2o_scsi.c                |    97 +-
 drivers/misc/ibmasm/ibmasmfs.c                |    28 +-
 drivers/mtd/Kconfig                           |    22 +-
 drivers/mtd/Makefile                          |    24 +-
 drivers/mtd/afs.c                             |     2 +-
 drivers/mtd/chips/Kconfig                     |    84 +-
 drivers/mtd/chips/Makefile                    |     5 +-
 drivers/mtd/chips/amd_flash.c                 |     8 +-
 drivers/mtd/chips/cfi_cmdset_0001.c           |   702 +-
 drivers/mtd/chips/cfi_cmdset_0002.c           |  1717 +-
 drivers/mtd/chips/cfi_cmdset_0020.c           |   268 +-
 drivers/mtd/chips/cfi_probe.c                 |    97 +-
 drivers/mtd/chips/chipreg.c                   |     2 +-
 drivers/mtd/chips/gen_probe.c                 |   223 +-
 drivers/mtd/chips/jedec.c                     |    19 +-
 drivers/mtd/chips/jedec_probe.c               |   381 +-
 drivers/mtd/chips/map_ram.c                   |    14 +-
 drivers/mtd/chips/map_rom.c                   |     2 +-
 drivers/mtd/chips/sharp.c                     |     5 +-
 drivers/mtd/cmdlinepart.c                     |    21 +-
 drivers/mtd/devices/Kconfig                   |    52 +-
 drivers/mtd/devices/Makefile                  |     6 +-
 drivers/mtd/devices/blkmtd.c                  |    44 +-
 drivers/mtd/devices/doc2000.c                 |   623 +-
 drivers/mtd/devices/doc2001.c                 |    24 +-
 drivers/mtd/devices/doc2001plus.c             |    83 +-
 drivers/mtd/devices/docprobe.c                |    28 +-
 drivers/mtd/devices/lart.c                    |     4 +-
 drivers/mtd/devices/ms02-nv.c                 |    30 +-
 drivers/mtd/devices/ms02-nv.h                 |    82 +-
 drivers/mtd/devices/mtdram.c                  |     5 +-
 drivers/mtd/devices/phram.c                   |     7 +-
 drivers/mtd/devices/pmc551.c                  |    18 +-
 drivers/mtd/devices/slram.c                   |     9 +-
 drivers/mtd/ftl.c                             |    15 +-
 drivers/mtd/inftlcore.c                       |    78 +-
 drivers/mtd/inftlmount.c                      |   179 +-
 drivers/mtd/maps/Kconfig                      |   109 +-
 drivers/mtd/maps/Makefile                     |    11 +-
 drivers/mtd/maps/amd76xrom.c                  |   240 +-
 drivers/mtd/maps/arctic-mtd.c                 |     4 +-
 drivers/mtd/maps/autcpu12-nvram.c             |     4 +-
 drivers/mtd/maps/beech-mtd.c                  |     4 +-
 drivers/mtd/maps/cdb89712.c                   |     8 +-
 drivers/mtd/maps/ceiva.c                      |     4 +-
 drivers/mtd/maps/cfi_flagadm.c                |     4 +-
 drivers/mtd/maps/cstm_mips_ixx.c              |    10 +-
 drivers/mtd/maps/dbox2-flash.c                |    17 +-
 drivers/mtd/maps/dc21285.c                    |   223 +-
 drivers/mtd/maps/dilnetpc.c                   |     4 +-
 drivers/mtd/maps/ebony.c                      |    10 +-
 drivers/mtd/maps/edb7312.c                    |     8 +-
 drivers/mtd/maps/elan-104nc.c                 |    60 +-
 drivers/mtd/maps/epxa10db-flash.c             |     4 +-
 drivers/mtd/maps/fortunet.c                   |    24 +-
 drivers/mtd/maps/h720x-flash.c                |    12 +-
 drivers/mtd/maps/ich2rom.c                    |    10 +-
 drivers/mtd/maps/ichxrom.c                    |     4 +-
 drivers/mtd/maps/impa7.c                      |    12 +-
 drivers/mtd/maps/integrator-flash.c           |     4 +-
 drivers/mtd/maps/iq80310.c                    |     4 +-
 drivers/mtd/maps/ixp4xx.c                     |    28 +-
 drivers/mtd/maps/l440gx.c                     |     4 +-
 drivers/mtd/maps/lasat.c                      |    80 +-
 drivers/mtd/maps/lubbock-flash.c              |    24 +-
 drivers/mtd/maps/map_funcs.c                  |    74 +-
 drivers/mtd/maps/mbx860.c                     |     4 +-
 drivers/mtd/maps/netsc520.c                   |     4 +-
 drivers/mtd/maps/nettel.c                     |     6 +-
 drivers/mtd/maps/ocelot.c                     |     6 +-
 drivers/mtd/maps/octagon-5066.c               |    68 +-
 drivers/mtd/maps/pb1xxx-flash.c               |   160 +-
 drivers/mtd/maps/pci.c                        |   148 +-
 drivers/mtd/maps/pcmciamtd.c                  |   108 +-
 drivers/mtd/maps/physmap.c                    |    71 +-
 drivers/mtd/maps/pnc2000.c                    |     4 +-
 drivers/mtd/maps/redwood.c                    |    15 +-
 drivers/mtd/maps/rpxlite.c                    |     4 +-
 drivers/mtd/maps/sa1100-flash.c               |     8 +-
 drivers/mtd/maps/sbc_gxx.c                    |    58 +-
 drivers/mtd/maps/sc520cdp.c                   |     8 +-
 drivers/mtd/maps/scb2_flash.c                 |     4 +-
 drivers/mtd/maps/scx200_docflash.c            |     6 +-
 drivers/mtd/maps/solutionengine.c             |     8 +-
 drivers/mtd/maps/sun_uflash.c                 |     4 +-
 drivers/mtd/maps/tqm8xxl.c                    |     4 +-
 drivers/mtd/maps/tsunami_flash.c              |    20 +-
 drivers/mtd/maps/uclinux.c                    |     4 +-
 drivers/mtd/maps/vmax301.c                    |    68 +-
 drivers/mtd/maps/wr_sbc82xx_flash.c           |    70 +-
 drivers/mtd/mtd_blkdevs.c                     |     9 +-
 drivers/mtd/mtdblock.c                        |     4 +-
 drivers/mtd/mtdchar.c                         |   164 +-
 drivers/mtd/mtdconcat.c                       |    17 +-
 drivers/mtd/mtdcore.c                         |    51 +-
 drivers/mtd/mtdpart.c                         |    57 +-
 drivers/mtd/nand/Kconfig                      |   107 +-
 drivers/mtd/nand/Makefile                     |    21 +-
 drivers/mtd/nand/autcpu12.c                   |   103 +-
 drivers/mtd/nand/diskonchip.c                 |   600 +-
 drivers/mtd/nand/edb7312.c                    |    26 +-
 drivers/mtd/nand/nand_base.c                  |    20 +-
 drivers/mtd/nand/nand_ecc.c                   |    67 +-
 drivers/mtd/nand/nand_ids.c                   |   113 +-
 drivers/mtd/nand/spia.c                       |    21 +-
 drivers/mtd/nand/tx4925ndfmc.c                |    10 +-
 drivers/mtd/nftlcore.c                        |    42 +-
 drivers/mtd/nftlmount.c                       |    59 +-
 drivers/mtd/redboot.c                         |    53 +-
 drivers/net/3c501.c                           |     2 +-
 drivers/net/3c503.c                           |     6 +-
 drivers/net/3c505.c                           |     3 +-
 drivers/net/3c507.c                           |     4 +-
 drivers/net/3c509.c                           |    45 +-
 drivers/net/3c515.c                           |     8 +-
 drivers/net/3c523.c                           |     4 +-
 drivers/net/3c527.c                           |     4 +-
 drivers/net/3c59x.c                           |    79 +-
 drivers/net/8139too.c                         |     4 +-
 drivers/net/82596.c                           |     9 +-
 drivers/net/Kconfig                           |   167 +-
 drivers/net/Makefile                          |     4 +-
 drivers/net/Space.c                           |     4 +-
 drivers/net/ac3200.c                          |     8 +-
 drivers/net/acenic.c                          |   318 +-
 drivers/net/acenic.h                          |     1 -
 drivers/net/acenic_firmware.h                 |     6 +-
 drivers/net/amd8111e.c                        |     4 +-
 drivers/net/apne.c                            |     6 +-
 drivers/net/appletalk/ltpc.c                  |     4 +-
 drivers/net/arcnet/arcnet.c                   |     4 +-
 drivers/net/arm/Kconfig                       |     1 -
 drivers/net/arm/etherh.c                      |     2 +-
 drivers/net/at1700.c                          |   106 +-
 drivers/net/bonding/bond_main.c               |    10 -
 drivers/net/cs89x0.c                          |    10 +-
 drivers/net/defxx.c                           |     6 +-
 drivers/net/dgrs.c                            |     4 +-
 drivers/net/dgrs.h                            |     2 +-
 drivers/net/dgrs_asstruct.h                   |     2 +-
 drivers/net/dgrs_i82596.h                     |     4 +-
 drivers/net/dl2k.c                            |    10 +-
 drivers/net/dummy.c                           |    11 +-
 drivers/net/e1000/e1000.h                     |     3 +-
 drivers/net/e1000/e1000_ethtool.c             |     5 +-
 drivers/net/e1000/e1000_hw.c                  |    35 +
 drivers/net/e1000/e1000_hw.h                  |     2 +
 drivers/net/e1000/e1000_main.c                |    15 +-
 drivers/net/e1000/e1000_osdep.h               |     2 +-
 drivers/net/e2100.c                           |     6 +-
 drivers/net/eepro.c                           |     6 +-
 drivers/net/eepro100.c                        |    22 +-
 drivers/net/eexpress.c                        |     6 +-
 drivers/net/epic100.c                         |    21 +-
 drivers/net/eql.c                             |    12 +-
 drivers/net/es3210.c                          |     2 +
 drivers/net/eth16i.c                          |    10 +-
 drivers/net/ethertap.c                        |     4 +-
 drivers/net/ewrk3.c                           |     6 +-
 drivers/net/fc/iph5526.c                      |     2 +-
 drivers/net/fealnx.c                          |     5 +
 drivers/net/fmv18x.c                          |     6 +-
 drivers/net/forcedeth.c                       |   849 +-
 drivers/net/hamachi.c                         |    20 +-
 drivers/net/hamradio/6pack.c                  |    12 +-
 drivers/net/hamradio/Kconfig                  |     4 +
 drivers/net/hamradio/baycom_epp.c             |    48 +-
 drivers/net/hamradio/hdlcdrv.c                |    49 +-
 drivers/net/hamradio/mkiss.c                  |    10 +-
 drivers/net/hamradio/scc.c                    |     2 +-
 drivers/net/hp-plus.c                         |    14 +-
 drivers/net/hp.c                              |    10 +-
 drivers/net/hp100.c                           |     2 +
 drivers/net/ibmlana.c                         |     6 +-
 drivers/net/irda/Kconfig                      |     4 +-
 drivers/net/irda/ali-ircc.c                   |    30 +-
 drivers/net/irda/ali-ircc.h                   |     3 +
 drivers/net/irda/donauboe.c                   |     4 +
 drivers/net/irda/irtty-sir.c                  |    12 +-
 drivers/net/irda/nsc-ircc.c                   |    30 +-
 drivers/net/irda/nsc-ircc.h                   |     3 +
 drivers/net/irda/smsc-ircc2.c                 |    31 +-
 drivers/net/irda/via-ircc.c                   |    28 +-
 drivers/net/irda/via-ircc.h                   |     3 +
 drivers/net/irda/vlsi_ir.c                    |     6 +-
 drivers/net/irda/w83977af_ir.c                |    31 +-
 drivers/net/irda/w83977af_ir.h                |     3 +
 drivers/net/isa-skeleton.c                    |     2 +
 drivers/net/iseries_veth.c                    |   104 +-
 drivers/net/iseries_veth.h                    |     2 -
 drivers/net/ixgb/ixgb.h                       |     2 +-
 drivers/net/ixgb/ixgb_hw.c                    |     2 +-
 drivers/net/ixgb/ixgb_main.c                  |     5 +-
 drivers/net/ixgb/ixgb_osdep.h                 |     2 +-
 drivers/net/jazzsonic.c                       |     4 +-
 drivers/net/lance.c                           |     8 +-
 drivers/net/lasi_82596.c                      |   164 +-
 drivers/net/lne390.c                          |    10 +-
 drivers/net/loopback.c                        |    43 +-
 drivers/net/lp486e.c                          |     6 +-
 drivers/net/mace.c                            |     6 +-
 drivers/net/macsonic.c                        |     2 -
 drivers/net/myri_sbus.c                       |     2 +-
 drivers/net/natsemi.c                         |  1079 +-
 drivers/net/ne-h8300.c                        |     6 +-
 drivers/net/ne.c                              |     8 +-
 drivers/net/ne2.c                             |    10 +-
 drivers/net/ne2k-pci.c                        |     2 +-
 drivers/net/ne3210.c                          |    10 +-
 drivers/net/ni52.c                            |     4 +-
 drivers/net/ns83820.c                         |     6 +-
 drivers/net/oaknet.c                          |     2 +-
 drivers/net/pci-skeleton.c                    |    27 +-
 drivers/net/pcmcia/3c574_cs.c                 |    11 +-
 drivers/net/pcmcia/3c589_cs.c                 |     9 +-
 drivers/net/pcmcia/axnet_cs.c                 |    11 +-
 drivers/net/pcmcia/com20020_cs.c              |    32 +-
 drivers/net/pcmcia/fmvj18x_cs.c               |     9 +-
 drivers/net/pcmcia/ibmtr_cs.c                 |     1 -
 drivers/net/pcmcia/nmclan_cs.c                |    11 +-
 drivers/net/pcmcia/pcnet_cs.c                 |     9 +-
 drivers/net/pcmcia/smc91c92_cs.c              |    11 +-
 drivers/net/pcmcia/xirc2ps_cs.c               |    11 +-
 drivers/net/pcnet32.c                         |   130 +-
 drivers/net/ppp_async.c                       |    81 +-
 drivers/net/ppp_generic.c                     |   212 +-
 drivers/net/ppp_synctty.c                     |   202 +-
 drivers/net/pppoe.c                           |    11 +-
 drivers/net/pppox.c                           |     2 +-
 drivers/net/r8169.c                           |     2 +-
 drivers/net/rrunner.c                         |    15 +-
 drivers/net/s2io.c                            |     4 +-
 drivers/net/s2io.h                            |     1 -
 drivers/net/sb1000.c                          |     6 +-
 drivers/net/sb1250-mac.c                      |    10 +-
 drivers/net/seeq8005.c                        |    42 +-
 drivers/net/sgiseeq.c                         |   145 +-
 drivers/net/sis900.c                          |    29 +-
 drivers/net/sk98lin/h/skdrv1st.h              |     7 -
 drivers/net/sk98lin/h/skdrv2nd.h              |     5 +-
 drivers/net/sk98lin/skge.c                    |     1 +
 drivers/net/sk98lin/sktimer.c                 |     6 +-
 drivers/net/sk98lin/skvpd.c                   |     6 +-
 drivers/net/skfp/cfm.c                        |    35 +-
 drivers/net/skfp/drvfbi.c                     |   181 +-
 drivers/net/skfp/ecm.c                        |    33 +-
 drivers/net/skfp/ess.c                        |    62 +-
 drivers/net/skfp/fplustm.c                    |   212 +-
 drivers/net/skfp/h/cmtdef.h                   |   318 +-
 drivers/net/skfp/h/smtstate.h                 |     6 +
 drivers/net/skfp/h/targetos.h                 |     2 +-
 drivers/net/skfp/hwmtm.c                      |   227 +-
 drivers/net/skfp/hwt.c                        |    27 +-
 drivers/net/skfp/lnkstat.c                    |    15 +-
 drivers/net/skfp/pcmplc.c                     |   164 +-
 drivers/net/skfp/pmf.c                        |    92 +-
 drivers/net/skfp/queue.c                      |    24 +-
 drivers/net/skfp/rmt.c                        |    70 +-
 drivers/net/skfp/skfddi.c                     |    20 +-
 drivers/net/skfp/smt.c                        |   485 +-
 drivers/net/skfp/smtdef.c                     |    33 +-
 drivers/net/skfp/smtinit.c                    |    11 +-
 drivers/net/skfp/smtparse.c                   |    28 +-
 drivers/net/skfp/smttimer.c                   |    43 +-
 drivers/net/skfp/srf.c                        |    36 +-
 drivers/net/slip.c                            |     2 +-
 drivers/net/smc-mca.c                         |     4 +-
 drivers/net/smc-ultra.c                       |     6 +-
 drivers/net/smc-ultra32.c                     |     4 +-
 drivers/net/smc9194.c                         |    82 +-
 drivers/net/starfire.c                        |     2 +-
 drivers/net/stnic.c                           |     4 +-
 drivers/net/sun3_82586.c                      |     4 +-
 drivers/net/sun3lance.c                       |     1 -
 drivers/net/sunbmac.c                         |     2 +-
 drivers/net/sundance.c                        |    25 +-
 drivers/net/sungem.c                          |    20 +-
 drivers/net/sungem.h                          |     3 +-
 drivers/net/sunhme.c                          |    13 +-
 drivers/net/sunlance.c                        |    12 +-
 drivers/net/sunqe.c                           |     2 +-
 drivers/net/tc35815.c                         |     2 +-
 drivers/net/tg3.c                             |   357 +-
 drivers/net/tg3.h                             |    49 +-
 drivers/net/tlan.c                            |     4 +-
 drivers/net/tokenring/Kconfig                 |     6 +-
 drivers/net/tokenring/ibmtr.c                 |     3 +-
 drivers/net/tokenring/lanstreamer.c           |     7 +-
 drivers/net/tokenring/olympic.c               |     2 +-
 drivers/net/tokenring/smctr.c                 |    14 +-
 drivers/net/tokenring/tms380tr.c              |     4 +
 drivers/net/tulip/Kconfig                     |    15 +-
 drivers/net/tulip/de4x5.c                     |     8 +-
 drivers/net/tulip/dmfe.c                      |     1 -
 drivers/net/tulip/eeprom.c                    |     4 +-
 drivers/net/tulip/tulip_core.c                |     2 +-
 drivers/net/tulip/winbond-840.c               |    27 +-
 drivers/net/tulip/xircom_cb.c                 |     2 +-
 drivers/net/tulip/xircom_tulip_cb.c           |    14 +-
 drivers/net/typhoon.c                         |     6 -
 drivers/net/via-rhine.c                       |   326 +-
 drivers/net/via-velocity.c                    |     2 +-
 drivers/net/wan/Kconfig                       |     2 +-
 drivers/net/wan/c101.c                        |     3 +-
 drivers/net/wan/cosa.c                        |    51 +-
 drivers/net/wan/cosa.h                        |     2 +-
 drivers/net/wan/dscc4.c                       |     2 +-
 drivers/net/wan/farsync.c                     |     2 +-
 drivers/net/wan/hdlc_cisco.c                  |     2 +-
 drivers/net/wan/hdlc_fr.c                     |     2 +-
 drivers/net/wan/hdlc_raw.c                    |     2 +-
 drivers/net/wan/hdlc_raw_eth.c                |     2 +-
 drivers/net/wan/lmc/lmc_ioctl.h               |     4 +-
 drivers/net/wan/lmc/lmc_main.c                |     8 +-
 drivers/net/wan/lmc/lmc_proto.c               |     2 +-
 drivers/net/wan/n2.c                          |     3 +-
 drivers/net/wan/pc300_tty.c                   |     4 +-
 drivers/net/wan/pci200syn.c                   |     3 +-
 drivers/net/wan/sbni.c                        |     8 +-
 drivers/net/wan/sbni.h                        |     2 +-
 drivers/net/wan/syncppp.c                     |     8 +-
 drivers/net/wan/x25_asy.c                     |     4 +-
 drivers/net/wd.c                              |     6 +-
 drivers/net/wireless/Kconfig                  |     4 +-
 drivers/net/wireless/airo.c                   |    85 +-
 drivers/net/wireless/airo_cs.c                |     2 +-
 drivers/net/wireless/airport.c                |     2 +-
 drivers/net/wireless/arlan-proc.c             |    28 +-
 drivers/net/wireless/arlan.h                  |     1 -
 drivers/net/wireless/atmel.c                  |     8 +-
 drivers/net/wireless/atmel_cs.c               |    22 +-
 drivers/net/wireless/orinoco.c                |     3 +-
 drivers/net/wireless/orinoco_pci.c            |     2 +-
 drivers/net/wireless/orinoco_plx.c            |     4 +-
 drivers/net/wireless/orinoco_tmd.c            |     4 +-
 drivers/net/wireless/prism54/isl_38xx.c       |   136 +-
 drivers/net/wireless/prism54/isl_38xx.h       |    10 -
 drivers/net/wireless/prism54/isl_ioctl.c      |   231 +-
 drivers/net/wireless/prism54/isl_ioctl.h      |     1 -
 drivers/net/wireless/prism54/islpci_dev.c     |   209 +-
 drivers/net/wireless/prism54/islpci_dev.h     |    24 +-
 drivers/net/wireless/prism54/islpci_eth.c     |    79 +-
 drivers/net/wireless/prism54/islpci_hotplug.c |   190 +-
 drivers/net/wireless/prism54/islpci_mgt.c     |   165 +-
 drivers/net/wireless/prism54/islpci_mgt.h     |    23 +-
 drivers/net/wireless/prism54/oid_mgt.c        |   115 +-
 drivers/net/wireless/prism54/oid_mgt.h        |     2 +-
 drivers/net/wireless/ray_cs.c                 |     6 +-
 drivers/net/wireless/strip.c                  |    20 +-
 drivers/net/yellowfin.c                       |    25 +-
 drivers/net/zorro8390.c                       |     6 +-
 drivers/oprofile/buffer_sync.c                |     4 +-
 drivers/oprofile/cpu_buffer.c                 |     4 +-
 drivers/oprofile/oprofile_files.c             |     2 +-
 drivers/oprofile/oprofilefs.c                 |    74 +-
 drivers/parisc/ccio-dma.c                     |     1 -
 drivers/parisc/ccio-rm-dma.c                  |     1 -
 drivers/parisc/dino.c                         |     9 +-
 drivers/parisc/iommu-helpers.h                |     8 +
 drivers/parisc/iosapic.c                      |   123 +-
 drivers/parisc/lba_pci.c                      |   177 +-
 drivers/parisc/led.c                          |     6 +-
 drivers/parisc/sba_iommu.c                    |   351 +-
 drivers/parisc/superio.c                      |     8 +-
 drivers/parport/ChangeLog                     |     4 +
 drivers/parport/parport_pc.c                  |    19 +-
 drivers/parport/parport_serial.c              |    10 +
 drivers/parport/procfs.c                      |    36 +-
 drivers/pci/Kconfig                           |    21 +-
 drivers/pci/Makefile                          |     2 +-
 drivers/pci/hotplug.c                         |     2 +-
 drivers/pci/hotplug/acpiphp_glue.c            |     2 +-
 drivers/pci/hotplug/cpci_hotplug_core.c       |     4 +-
 drivers/pci/hotplug/cpqphp_ctrl.c             |     2 +-
 drivers/pci/hotplug/ibmphp_hpc.c              |     2 +-
 drivers/pci/hotplug/pciehp_ctrl.c             |   149 +-
 drivers/pci/hotplug/pciehp_hpc.c              |    12 +-
 drivers/pci/hotplug/pciehprm_acpi.c           |    22 +-
 drivers/pci/hotplug/pciehprm_nonacpi.c        |    18 +-
 drivers/pci/hotplug/rpadlpar_core.c           |    29 +-
 drivers/pci/hotplug/rpaphp.h                  |    32 +-
 drivers/pci/hotplug/rpaphp_core.c             |   199 +-
 drivers/pci/hotplug/rpaphp_pci.c              |   338 +-
 drivers/pci/hotplug/rpaphp_slot.c             |   137 +-
 drivers/pci/hotplug/rpaphp_vio.c              |    19 +-
 drivers/pci/hotplug/shpchp.h                  |     1 +
 drivers/pci/hotplug/shpchp_ctrl.c             |    62 +-
 drivers/pci/hotplug/shpchp_hpc.c              |     6 +-
 drivers/pci/hotplug/shpchp_pci.c              |     1 +
 drivers/pci/hotplug/shpchprm_acpi.c           |    22 +-
 drivers/pci/hotplug/shpchprm_nonacpi.c        |    18 +-
 drivers/pci/msi.c                             |   878 +-
 drivers/pci/msi.h                             |     3 +-
 drivers/pci/pci-driver.c                      |     1 +
 drivers/pci/pci-sysfs.c                       |    33 +-
 drivers/pci/pci.c                             |     2 +-
 drivers/pci/pci.h                             |     1 +
 drivers/pci/pci.ids                           |     1 +
 drivers/pci/probe.c                           |     5 +-
 drivers/pci/quirks.c                          |    94 +-
 drivers/pcmcia/Kconfig                        |     7 +
 drivers/pcmcia/Makefile                       |     3 +-
 drivers/pcmcia/cardbus.c                      |     2 +-
 drivers/pcmcia/cistpl.c                       |    25 +-
 drivers/pcmcia/cs.c                           |    68 +-
 drivers/pcmcia/cs_internal.h                  |     8 +-
 drivers/pcmcia/ds.c                           |     6 +-
 drivers/pcmcia/i82092.c                       |     4 +-
 drivers/pcmcia/i82365.c                       |    19 +-
 drivers/pcmcia/o2micro.h                      |    26 +
 drivers/pcmcia/pd6729.c                       |    40 +-
 drivers/pcmcia/rsrc_mgr.c                     |    51 +-
 drivers/pcmcia/sa1100_generic.c               |     4 -
 drivers/pcmcia/tcic.c                         |     4 +-
 drivers/pcmcia/yenta_socket.c                 |    14 +-
 drivers/pnp/isapnp/core.c                     |     5 -
 drivers/pnp/pnpbios/bioscalls.c               |    14 +-
 drivers/pnp/pnpbios/core.c                    |    36 +-
 drivers/s390/block/dasd.c                     |   137 +-
 drivers/s390/block/dasd_3990_erp.c            |    43 +-
 drivers/s390/block/dasd_devmap.c              |    14 +-
 drivers/s390/block/dasd_diag.c                |     6 +-
 drivers/s390/block/dasd_eckd.c                |     6 +-
 drivers/s390/block/dasd_erp.c                 |     4 +-
 drivers/s390/block/dasd_fba.c                 |     6 +-
 drivers/s390/block/dasd_genhd.c               |     5 +-
 drivers/s390/block/dasd_int.h                 |     5 +-
 drivers/s390/char/sclp.c                      |    76 +-
 drivers/s390/char/tape_char.c                 |    18 +-
 drivers/s390/cio/Makefile                     |     2 +-
 drivers/s390/cio/chsc.c                       |    71 +-
 drivers/s390/cio/chsc.h                       |    28 +
 drivers/s390/cio/cio.c                        |     6 +-
 drivers/s390/cio/cio.h                        |     5 +
 drivers/s390/cio/cmf.c                        |     6 +-
 drivers/s390/cio/css.c                        |    47 +-
 drivers/s390/cio/device_fsm.c                 |    79 +-
 drivers/s390/cio/device_id.c                  |    13 +-
 drivers/s390/cio/device_ops.c                 |     7 +-
 drivers/s390/cio/device_pgid.c                |    28 +-
 drivers/s390/cio/device_status.c              |    10 +-
 drivers/s390/cio/qdio.c                       |   157 +-
 drivers/s390/cio/qdio.h                       |    58 +-
 drivers/s390/net/Makefile                     |     2 +-
 drivers/s390/net/ctcdbug.c                    |    54 +-
 drivers/s390/net/ctcdbug.h                    |    34 +-
 drivers/s390/net/ctcmain.c                    |    81 +-
 drivers/s390/net/ctctty.c                     |    80 +-
 drivers/s390/net/cu3088.c                     |     4 +-
 drivers/s390/net/iucv.c                       |   183 +-
 drivers/s390/net/iucv.h                       |    88 +
 drivers/s390/net/lcs.c                        |     9 +-
 drivers/s390/net/lcs.h                        |     6 +-
 drivers/s390/net/netiucv.c                    |   476 +-
 drivers/s390/net/qeth.h                       |    16 +-
 drivers/s390/net/qeth_fs.h                    |     4 +-
 drivers/s390/net/qeth_main.c                  |   243 +-
 drivers/s390/net/qeth_mpc.h                   |     4 +-
 drivers/s390/net/qeth_sys.c                   |     6 +-
 drivers/s390/scsi/zfcp_aux.c                  |    36 +-
 drivers/s390/scsi/zfcp_ccw.c                  |    21 +-
 drivers/s390/scsi/zfcp_def.h                  |    52 +-
 drivers/s390/scsi/zfcp_erp.c                  |    98 +-
 drivers/s390/scsi/zfcp_ext.h                  |     4 +-
 drivers/s390/scsi/zfcp_fsf.c                  |    43 +-
 drivers/s390/scsi/zfcp_scsi.c                 |    51 +-
 drivers/s390/scsi/zfcp_sysfs_port.c           |     8 +-
 drivers/sbus/char/Kconfig                     |     4 +-
 drivers/sbus/char/bbc_envctrl.c               |     5 +-
 drivers/sbus/char/bpp.c                       |    12 +-
 drivers/sbus/char/cpwatchdog.c                |    26 +-
 drivers/sbus/char/display7seg.c               |     6 +-
 drivers/sbus/char/envctrl.c                   |    31 +-
 drivers/sbus/char/flash.c                     |     6 +-
 drivers/sbus/char/openprom.c                  |    51 +-
 drivers/sbus/char/riowatchdog.c               |    17 +-
 drivers/sbus/char/rtc.c                       |     5 +-
 drivers/sbus/char/vfc_dev.c                   |    40 +-
 drivers/sbus/dvma.c                           |     3 +-
 drivers/sbus/sbus.c                           |    12 +-
 drivers/scsi/3w-9xxx.c                        |     9 +-
 drivers/scsi/3w-xxxx.c                        |     9 +-
 drivers/scsi/53c700.c                         |   135 +-
 drivers/scsi/53c700.h                         |    23 +-
 drivers/scsi/53c7xx.c                         |     2 +-
 drivers/scsi/BusLogic.c                       |     2 +-
 drivers/scsi/Kconfig                          |    50 +-
 drivers/scsi/Makefile                         |    13 +-
 drivers/scsi/NCR5380.c                        |     4 +-
 drivers/scsi/NCR53C9x.c                       |    13 +-
 drivers/scsi/NCR53c406a.c                     |     2 +-
 drivers/scsi/NCR_D700.c                       |     6 +-
 drivers/scsi/NCR_Q720.c                       |     8 +-
 drivers/scsi/a2091.c                          |     2 +-
 drivers/scsi/a3000.c                          |     2 +-
 drivers/scsi/aacraid/README                   |    18 +-
 drivers/scsi/aacraid/TODO                     |     2 +
 drivers/scsi/aacraid/aachba.c                 |   126 +-
 drivers/scsi/aacraid/aacraid.h                |    81 +-
 drivers/scsi/aacraid/commctrl.c               |   169 +-
 drivers/scsi/aacraid/comminit.c               |    11 +-
 drivers/scsi/aacraid/linit.c                  |    82 +-
 drivers/scsi/aacraid/rkt.c                    |    81 +-
 drivers/scsi/aacraid/rx.c                     |    83 +-
 drivers/scsi/aacraid/sa.c                     |    34 +-
 drivers/scsi/advansys.c                       |   876 +-
 drivers/scsi/advansys.h                       |     8 +-
 drivers/scsi/aha152x.c                        |    76 +-
 drivers/scsi/aha1542.c                        |     6 +-
 drivers/scsi/aha1740.c                        |     2 +-
 drivers/scsi/aic7xxx/aic79xx_core.c           |    14 +-
 drivers/scsi/aic7xxx/aic79xx_osm.h            |     4 +-
 drivers/scsi/aic7xxx/aic7xxx_osm.c            |    13 +-
 drivers/scsi/aic7xxx/aic7xxx_osm.h            |     4 +-
 drivers/scsi/aic7xxx/aic7xxx_osm_pci.c        |     3 +-
 drivers/scsi/aic7xxx/aiclib.c                 |     2 +-
 drivers/scsi/aic7xxx_old.c                    |     8 +-
 drivers/scsi/amiga7xx.c                       |     2 +-
 drivers/scsi/arm/acornscsi.c                  |     2 +-
 drivers/scsi/arm/arxescsi.c                   |     2 +-
 drivers/scsi/arm/cumana_1.c                   |     2 +-
 drivers/scsi/arm/cumana_2.c                   |     2 +-
 drivers/scsi/arm/ecoscsi.c                    |     2 +-
 drivers/scsi/arm/eesox.c                      |     2 +-
 drivers/scsi/arm/fas216.c                     |     2 +-
 drivers/scsi/arm/oak.c                        |     2 +-
 drivers/scsi/arm/powertec.c                   |     2 +-
 drivers/scsi/ata_piix.c                       |    35 +-
 drivers/scsi/atari_scsi.c                     |     2 +-
 drivers/scsi/atp870u.c                        |    82 +-
 drivers/scsi/atp870u.h                        |    23 +-
 drivers/scsi/blz1230.c                        |     2 +-
 drivers/scsi/blz2060.c                        |     2 +-
 drivers/scsi/bvme6000.c                       |     2 +-
 drivers/scsi/constants.c                      |    33 +-
 drivers/scsi/cpqfcTScontrol.c                 |     2 +-
 drivers/scsi/cpqfcTSinit.c                    |     4 +-
 drivers/scsi/cpqfcTSworker.c                  |     2 +-
 drivers/scsi/cyberstorm.c                     |     2 +-
 drivers/scsi/cyberstormII.c                   |     2 +-
 drivers/scsi/dc390.h                          |    15 +-
 drivers/scsi/dc395x.c                         |    55 +-
 drivers/scsi/dec_esp.c                        |     2 +-
 drivers/scsi/dmx3191d.c                       |     2 +-
 drivers/scsi/dpt_i2o.c                        |   102 +-
 drivers/scsi/dpti.h                           |    24 +-
 drivers/scsi/dtc.c                            |     2 +-
 drivers/scsi/eata.c                           |     2 +-
 drivers/scsi/eata_generic.h                   |     2 +-
 drivers/scsi/eata_pio.c                       |   237 +-
 drivers/scsi/fastlane.c                       |    33 +-
 drivers/scsi/fcal.c                           |     2 +-
 drivers/scsi/fd_mcs.c                         |    23 +-
 drivers/scsi/fdomain.c                        |    74 +-
 drivers/scsi/g_NCR5380.c                      |     4 +-
 drivers/scsi/gdth.c                           |     2 +-
 drivers/scsi/gvp11.c                          |     2 +-
 drivers/scsi/hosts.c                          |     4 +-
 drivers/scsi/hosts.h                          |     2 +-
 drivers/scsi/i60uscsi.c                       |     4 +-
 drivers/scsi/ibmmca.c                         |     2 +-
 drivers/scsi/ide-scsi.c                       |     4 +-
 drivers/scsi/imm.c                            |     9 +-
 drivers/scsi/imm.h                            |     2 +-
 drivers/scsi/in2000.c                         |    12 +-
 drivers/scsi/ini9100u.c                       |     2 +-
 drivers/scsi/ipr.c                            |    33 +-
 drivers/scsi/ipr.h                            |     6 +-
 drivers/scsi/ips.c                            |     2 +-
 drivers/scsi/jazz_esp.c                       |     2 +-
 drivers/scsi/lasi700.c                        |     5 +-
 drivers/scsi/libata-core.c                    |   535 +-
 drivers/scsi/libata-scsi.c                    |    32 +-
 drivers/scsi/mac_esp.c                        |     2 +-
 drivers/scsi/mac_scsi.c                       |     2 +-
 drivers/scsi/mca_53c9x.c                      |     2 +-
 drivers/scsi/megaraid.c                       |   421 +-
 drivers/scsi/megaraid.h                       |    24 +-
 drivers/scsi/mvme147.c                        |     2 +-
 drivers/scsi/mvme16x.c                        |     2 +-
 drivers/scsi/ncr53c8xx.c                      |  1488 +-
 drivers/scsi/ncr53c8xx.h                      |    53 +-
 drivers/scsi/nsp32.c                          |    88 +-
 drivers/scsi/oktagon_esp.c                    |     2 +-
 drivers/scsi/osst.c                           |    15 +-
 drivers/scsi/pas16.c                          |     2 +-
 drivers/scsi/pci2000.c                        |     2 +-
 drivers/scsi/pci2220i.c                       |     2 +-
 drivers/scsi/pcmcia/aha152x_stub.c            |     2 +-
 drivers/scsi/pcmcia/fdomain_stub.c            |    14 +-
 drivers/scsi/pcmcia/nsp_cs.c                  |    10 +-
 drivers/scsi/pcmcia/qlogic_stub.c             |     2 +-
 drivers/scsi/pluto.c                          |     2 +-
 drivers/scsi/ppa.c                            |     2 +-
 drivers/scsi/ppa.h                            |     2 +-
 drivers/scsi/psi240i.c                        |     2 +-
 drivers/scsi/qla1280.c                        |    20 +-
 drivers/scsi/qla2xxx/Makefile                 |     2 +-
 drivers/scsi/qla2xxx/ql2100.c                 |     1 -
 drivers/scsi/qla2xxx/ql2200.c                 |     1 -
 drivers/scsi/qla2xxx/ql2300.c                 |     1 -
 drivers/scsi/qla2xxx/ql2300_fw.c              | 14098 +++++++--------
 drivers/scsi/qla2xxx/ql2322.c                 |     1 -
 drivers/scsi/qla2xxx/ql2322_fw.c              | 14646 ++++++++--------
 drivers/scsi/qla2xxx/ql6312.c                 |     1 -
 drivers/scsi/qla2xxx/ql6312_fw.c              | 12858 +++++++-------
 drivers/scsi/qla2xxx/ql6322.c                 |     1 -
 drivers/scsi/qla2xxx/ql6322_fw.c              | 13500 +++++++-------
 drivers/scsi/qla2xxx/qla_dbg.c                |    22 +-
 drivers/scsi/qla2xxx/qla_dbg.h                |     6 +-
 drivers/scsi/qla2xxx/qla_def.h                |    42 +-
 drivers/scsi/qla2xxx/qla_gbl.h                |     7 +-
 drivers/scsi/qla2xxx/qla_gs.c                 |     2 -
 drivers/scsi/qla2xxx/qla_init.c               |   136 +-
 drivers/scsi/qla2xxx/qla_inline.h             |     4 +-
 drivers/scsi/qla2xxx/qla_iocb.c               |   109 +-
 drivers/scsi/qla2xxx/qla_isr.c                |    73 +-
 drivers/scsi/qla2xxx/qla_mbx.c                |    74 +-
 drivers/scsi/qla2xxx/qla_os.c                 |   349 +-
 drivers/scsi/qla2xxx/qla_rscn.c               |     6 +-
 drivers/scsi/qla2xxx/qla_sup.c                |     4 +-
 drivers/scsi/qla2xxx/qla_version.h            |     4 +-
 drivers/scsi/qlogicfas.c                      |     2 +-
 drivers/scsi/qlogicfas408.c                   |     2 +-
 drivers/scsi/qlogicfc.c                       |     5 +-
 drivers/scsi/qlogicisp.c                      |     2 +-
 drivers/scsi/sata_nv.c                        |   314 +-
 drivers/scsi/sata_promise.c                   |    57 +-
 drivers/scsi/sata_sil.c                       |     6 +-
 drivers/scsi/sata_sis.c                       |     4 +-
 drivers/scsi/sata_svw.c                       |     4 +-
 drivers/scsi/sata_sx4.c                       |    22 +-
 drivers/scsi/sata_via.c                       |     5 +-
 drivers/scsi/sata_vsc.c                       |     4 +-
 drivers/scsi/scsi.c                           |    24 +-
 drivers/scsi/scsi.h                           |    63 +-
 drivers/scsi/scsi_debug.c                     |   387 +-
 drivers/scsi/scsi_debug.h                     |     7 +-
 drivers/scsi/scsi_devinfo.c                   |    27 +-
 drivers/scsi/scsi_error.c                     |    49 +-
 drivers/scsi/scsi_ioctl.c                     |    32 +-
 drivers/scsi/scsi_lib.c                       |    13 +-
 drivers/scsi/scsi_module.c                    |     2 +-
 drivers/scsi/scsi_priv.h                      |     1 +
 drivers/scsi/scsi_proc.c                      |    11 +-
 drivers/scsi/scsi_scan.c                      |    12 +-
 drivers/scsi/scsi_syms.c                      |    32 +-
 drivers/scsi/scsi_sysfs.c                     |    19 +-
 drivers/scsi/scsi_transport_spi.c             |    10 +-
 drivers/scsi/scsicam.c                        |     5 +-
 drivers/scsi/scsiiom.c                        |   495 +-
 drivers/scsi/sd.c                             |    30 +-
 drivers/scsi/seagate.c                        |     2 +-
 drivers/scsi/sg.c                             |    75 +-
 drivers/scsi/sgiwd93.c                        |     2 +-
 drivers/scsi/sim710.c                         |     5 +-
 drivers/scsi/sr.c                             |    47 +-
 drivers/scsi/sr.h                             |     6 +-
 drivers/scsi/sr_ioctl.c                       |    41 +-
 drivers/scsi/sr_vendor.c                      |    22 +-
 drivers/scsi/st.c                             |    19 +-
 drivers/scsi/sun3_scsi.c                      |     2 +-
 drivers/scsi/sun3_scsi_vme.c                  |     2 +-
 drivers/scsi/sun3x_esp.c                      |     2 +-
 drivers/scsi/sym53c416.c                      |    85 +-
 drivers/scsi/sym53c8xx_2/sym_fw.c             |     2 +-
 drivers/scsi/sym53c8xx_2/sym_glue.c           |     8 +-
 drivers/scsi/sym53c8xx_2/sym_glue.h           |     2 +-
 drivers/scsi/sym53c8xx_2/sym_hipd.c           |    28 +-
 drivers/scsi/sym53c8xx_2/sym_hipd.h           |     4 +-
 drivers/scsi/sym53c8xx_2/sym_malloc.c         |    18 +-
 drivers/scsi/sym53c8xx_2/sym_misc.h           |     2 +-
 drivers/scsi/sym53c8xx_2/sym_nvram.c          |     4 +-
 drivers/scsi/sym53c8xx_comm.h                 |   717 +-
 drivers/scsi/sym53c8xx_defs.h                 |   714 +-
 drivers/scsi/t128.c                           |     2 +-
 drivers/scsi/tmscsim.c                        |  1050 +-
 drivers/scsi/tmscsim.h                        |   291 +-
 drivers/scsi/u14-34f.c                        |     2 +-
 drivers/scsi/ultrastor.c                      |    16 +-
 drivers/scsi/wd33c93.c                        |   100 +-
 drivers/scsi/wd33c93.h                        |    21 +-
 drivers/scsi/wd7000.c                         |   188 +-
 drivers/scsi/zalon.c                          |    42 +-
 drivers/serial/8250.c                         |    35 +-
 drivers/serial/8250_acorn.c                   |     3 +-
 drivers/serial/8250_acpi.c                    |    24 +-
 drivers/serial/8250_pci.c                     |     7 +-
 drivers/serial/8250_pnp.c                     |     7 +-
 drivers/serial/Kconfig                        |   143 +-
 drivers/serial/Makefile                       |     6 +-
 drivers/serial/amba-pl011.c                   |    81 +-
 drivers/serial/au1x00_uart.c                  |     7 +-
 drivers/serial/bast_sio.c                     |     2 +-
 drivers/serial/cpm_uart/cpm_uart_core.c       |   211 +-
 drivers/serial/cpm_uart/cpm_uart_cpm1.c       |    16 +-
 drivers/serial/cpm_uart/cpm_uart_cpm1.h       |     2 +-
 drivers/serial/cpm_uart/cpm_uart_cpm2.c       |    18 +-
 drivers/serial/cpm_uart/cpm_uart_cpm2.h       |     2 +-
 drivers/serial/pmac_zilog.c                   |    35 +-
 drivers/serial/pxa.c                          |    82 +-
 drivers/serial/serial_core.c                  |     4 +-
 drivers/serial/sh-sci.c                       |   165 +-
 drivers/serial/sh-sci.h                       |    98 +-
 drivers/serial/suncore.c                      |     6 +-
 drivers/serial/sunsu.c                        |     2 +-
 drivers/tc/zs.c                               |     8 +-
 drivers/telephony/ixj.c                       |   107 +-
 drivers/telephony/ixj.h                       |    10 +-
 drivers/telephony/phonedev.c                  |     5 +-
 drivers/usb/Kconfig                           |     2 +-
 drivers/usb/class/audio.c                     |    88 +-
 drivers/usb/class/cdc-acm.c                   |   458 +-
 drivers/usb/class/cdc-acm.h                   |    14 +-
 drivers/usb/class/usb-midi.c                  |    24 +-
 drivers/usb/class/usblp.c                     |    15 +-
 drivers/usb/core/buffer.c                     |     2 +-
 drivers/usb/core/config.c                     |     4 +-
 drivers/usb/core/devices.c                    |     2 +
 drivers/usb/core/devio.c                      |    31 +-
 drivers/usb/core/file.c                       |    19 +-
 drivers/usb/core/hcd-pci.c                    |     6 +-
 drivers/usb/core/hcd.c                        |   206 +-
 drivers/usb/core/hcd.h                        |    27 +-
 drivers/usb/core/hub.c                        |   869 +-
 drivers/usb/core/hub.h                        |    22 +-
 drivers/usb/core/inode.c                      |   108 +-
 drivers/usb/core/message.c                    |   268 +-
 drivers/usb/core/sysfs.c                      |    89 +-
 drivers/usb/core/urb.c                        |    84 +-
 drivers/usb/core/usb.c                        |   259 +-
 drivers/usb/core/usb.h                        |     5 +
 drivers/usb/gadget/Kconfig                    |    10 +
 drivers/usb/gadget/dummy_hcd.c                |    69 +-
 drivers/usb/gadget/epautoconf.c               |     6 +-
 drivers/usb/gadget/ether.c                    |   217 +-
 drivers/usb/gadget/file_storage.c             |     9 +-
 drivers/usb/gadget/inode.c                    |   224 +-
 drivers/usb/gadget/ndis.h                     |    30 +
 drivers/usb/gadget/net2280.c                  |    81 +-
 drivers/usb/gadget/pxa2xx_udc.c               |     6 +-
 drivers/usb/gadget/rndis.c                    |   707 +-
 drivers/usb/gadget/rndis.h                    |    41 +-
 drivers/usb/gadget/serial.c                   |    16 +
 drivers/usb/gadget/zero.c                     |    67 +-
 drivers/usb/host/ehci-dbg.c                   |     2 +-
 drivers/usb/host/ehci-hcd.c                   |    51 +-
 drivers/usb/host/ehci-hub.c                   |     2 +-
 drivers/usb/host/ehci-mem.c                   |    18 +-
 drivers/usb/host/ehci-q.c                     |    30 +-
 drivers/usb/host/ehci-sched.c                 |    42 +-
 drivers/usb/host/hc_simple.c                  |    44 +-
 drivers/usb/host/hc_sl811_rh.c                |    10 +-
 drivers/usb/host/ohci-dbg.c                   |    36 +-
 drivers/usb/host/ohci-hcd.c                   |    65 +-
 drivers/usb/host/ohci-hub.c                   |    52 +-
 drivers/usb/host/ohci-mem.c                   |     7 +-
 drivers/usb/host/ohci-omap.c                  |     9 +-
 drivers/usb/host/ohci-pci.c                   |     6 +-
 drivers/usb/host/ohci-q.c                     |    22 +-
 drivers/usb/host/ohci-sa1111.c                |     8 +-
 drivers/usb/host/ohci.h                       |    19 +
 drivers/usb/host/uhci-debug.c                 |    19 +-
 drivers/usb/host/uhci-hcd.c                   |    77 +-
 drivers/usb/host/uhci-hub.c                   |     4 +-
 drivers/usb/image/hpusbscsi.c                 |     2 +-
 drivers/usb/image/mdc800.c                    |    32 +-
 drivers/usb/image/microtek.c                  |     4 +-
 drivers/usb/input/Kconfig                     |    14 +-
 drivers/usb/input/aiptek.c                    |    10 +-
 drivers/usb/input/ati_remote.c                |    54 +-
 drivers/usb/input/hid-core.c                  |    22 +-
 drivers/usb/input/hid-tmff.c                  |     2 +-
 drivers/usb/input/hiddev.c                    |    52 +-
 drivers/usb/input/powermate.c                 |     2 +-
 drivers/usb/media/Kconfig                     |    40 +-
 drivers/usb/media/Makefile                    |     2 +
 drivers/usb/media/dabusb.c                    |    12 +-
 drivers/usb/media/konicawc.c                  |     2 +-
 drivers/usb/media/ov511.c                     |     6 +-
 drivers/usb/media/ov511.h                     |     2 +-
 drivers/usb/media/pwc-ctrl.c                  |   775 +-
 drivers/usb/media/pwc-if.c                    |   234 +-
 drivers/usb/media/pwc-ioctl.h                 |    88 +-
 drivers/usb/media/pwc-misc.c                  |    50 +-
 drivers/usb/media/pwc-uncompress.c            |    33 +-
 drivers/usb/media/pwc-uncompress.h            |    15 +-
 drivers/usb/media/pwc.h                       |    43 +-
 drivers/usb/media/se401.c                     |     4 +-
 drivers/usb/media/stv680.c                    |     2 +-
 drivers/usb/media/usbvideo.c                  |     4 +-
 drivers/usb/media/vicam.c                     |    32 +-
 drivers/usb/media/w9968cf.c                   |  1035 +-
 drivers/usb/media/w9968cf.h                   |   115 +-
 drivers/usb/misc/auerswald.c                  |    22 +-
 drivers/usb/misc/emi26_fw.h                   |     4 +
 drivers/usb/misc/legousbtower.c               |     9 +-
 drivers/usb/misc/phidgetservo.c               |   115 +-
 drivers/usb/misc/speedtch.c                   |     2 +-
 drivers/usb/misc/tiglusb.c                    |     4 +-
 drivers/usb/misc/usbtest.c                    |    40 +-
 drivers/usb/net/kaweth.c                      |     6 +-
 drivers/usb/net/pegasus.c                     |     4 -
 drivers/usb/net/pegasus.h                     |     3 +
 drivers/usb/net/rtl8150.c                     |    30 +-
 drivers/usb/net/usbnet.c                      |   163 +-
 drivers/usb/serial/Kconfig                    |     7 -
 drivers/usb/serial/Makefile                   |    31 +-
 drivers/usb/serial/belkin_sa.c                |    14 +-
 drivers/usb/serial/bus.c                      |    11 +-
 drivers/usb/serial/cyberjack.c                |    20 +-
 drivers/usb/serial/digi_acceleport.c          |    13 +-
 drivers/usb/serial/empeg.c                    |    16 +-
 drivers/usb/serial/ezusb.c                    |    17 +-
 drivers/usb/serial/ftdi_sio.c                 |    45 +-
 drivers/usb/serial/ftdi_sio.h                 |    27 +-
 drivers/usb/serial/generic.c                  |    50 +-
 drivers/usb/serial/io_edgeport.c              |    51 +-
 drivers/usb/serial/io_ti.c                    |    38 +-
 drivers/usb/serial/ipaq.c                     |    21 +-
 drivers/usb/serial/ipaq.h                     |     3 +
 drivers/usb/serial/ir-usb.c                   |    23 +-
 drivers/usb/serial/keyspan.c                  |    16 +-
 drivers/usb/serial/keyspan_pda.c              |    11 +-
 drivers/usb/serial/kl5kusb105.c               |    36 +-
 drivers/usb/serial/kobil_sct.c                |    27 +-
 drivers/usb/serial/mct_u232.c                 |    18 +-
 drivers/usb/serial/omninet.c                  |    13 +-
 drivers/usb/serial/pl2303.c                   |    68 +-
 drivers/usb/serial/pl2303.h                   |     6 +
 drivers/usb/serial/safe_serial.c              |    31 +-
 drivers/usb/serial/usb-serial.c               |    41 +-
 drivers/usb/serial/usb-serial.h               |    18 +-
 drivers/usb/serial/visor.c                    |    37 +-
 drivers/usb/serial/visor.h                    |     3 +
 drivers/usb/serial/whiteheat.c                |    28 +-
 drivers/usb/storage/Kconfig                   |    22 +
 drivers/usb/storage/jumpshot.c                |     2 +-
 drivers/usb/storage/scsiglue.c                |    55 +-
 drivers/usb/storage/sddr09.c                  |     2 +-
 drivers/usb/storage/transport.c               |    38 +-
 drivers/usb/storage/unusual_devs.h            |    46 +-
 drivers/usb/storage/usb.c                     |   223 +-
 drivers/usb/storage/usb.h                     |     5 +-
 drivers/video/Kconfig                         |    29 +-
 drivers/video/Makefile                        |     2 +-
 drivers/video/acornfb.c                       |     4 +-
 drivers/video/amifb.c                         |     4 +-
 drivers/video/asiliantfb.c                    |     2 +-
 drivers/video/aty/aty128fb.c                  |    12 +-
 drivers/video/aty/atyfb_base.c                |     6 +-
 drivers/video/aty/mach64_cursor.c             |     2 +-
 drivers/video/aty/mach64_gx.c                 |     2 +-
 drivers/video/aty/radeon_accel.c              |    15 +-
 drivers/video/aty/radeon_base.c               |    90 +-
 drivers/video/aty/radeon_pm.c                 |    44 +-
 drivers/video/aty/radeonfb.h                  |     6 -
 drivers/video/cg14.c                          |     6 +-
 drivers/video/chipsfb.c                       |     4 +-
 drivers/video/cirrusfb.c                      |  3316 ++--
 drivers/video/console/Kconfig                 |     5 -
 drivers/video/console/dummycon.c              |     5 +-
 drivers/video/console/fbcon.c                 |   865 +-
 drivers/video/console/fbcon.h                 |    83 +-
 drivers/video/console/mdacon.c                |     6 -
 drivers/video/console/newport_con.c           |    27 +-
 drivers/video/console/promcon.c               |     7 -
 drivers/video/console/sticon.c                |     6 -
 drivers/video/console/sticore.c               |     1 -
 drivers/video/console/vgacon.c                |    53 +-
 drivers/video/dnfb.c                          |    28 +-
 drivers/video/fbcmap.c                        |   169 +-
 drivers/video/fbmem.c                         |   251 +-
 drivers/video/i810/i810_gtf.c                 |     2 +-
 drivers/video/imsttfb.c                       |    23 +-
 drivers/video/kyro/fbdev.c                    |    20 +-
 drivers/video/logo/logo.c                     |     3 +-
 drivers/video/matrox/matroxfb_base.c          |    31 +-
 drivers/video/matrox/matroxfb_base.h          |     8 +-
 drivers/video/matrox/matroxfb_crtc2.c         |    10 +-
 drivers/video/modedb.c                        |    21 +-
 drivers/video/offb.c                          |     2 +-
 drivers/video/pxafb.c                         |   105 +-
 drivers/video/radeonfb.c                      |     6 +-
 drivers/video/riva/Makefile                   |     8 +-
 drivers/video/riva/fbdev.c                    |   588 +-
 drivers/video/riva/riva_hw.c                  |    39 +-
 drivers/video/riva/rivafb.h                   |    34 +-
 drivers/video/sa1100fb.c                      |    24 +-
 drivers/video/sbuslib.c                       |    16 +-
 drivers/video/sis/300vtbl.h                   |   808 +-
 drivers/video/sis/310vtbl.h                   |  1641 +-
 drivers/video/sis/init.c                      |  2021 +--
 drivers/video/sis/init.h                      |   789 +-
 drivers/video/sis/init301.c                   |  7624 ++++----
 drivers/video/sis/init301.h                   |   190 +-
 drivers/video/sis/initdef.h                   |   122 +-
 drivers/video/sis/oem300.h                    |     8 +-
 drivers/video/sis/oem310.h                    |   228 +-
 drivers/video/sis/osdef.h                     |   110 +-
 drivers/video/sis/sis.h                       |   499 +-
 drivers/video/sis/sis_accel.c                 |   375 +-
 drivers/video/sis/sis_accel.h                 |   408 +-
 drivers/video/sis/sis_main.c                  |  6801 +++----
 drivers/video/sis/sis_main.h                  |  1067 +-
 drivers/video/sis/vgatypes.h                  |   163 +-
 drivers/video/sis/vstruct.h                   |   158 +-
 drivers/video/skeletonfb.c                    |     8 +-
 drivers/video/softcursor.c                    |     9 +-
 drivers/video/sstfb.c                         |     8 +-
 drivers/video/tdfxfb.c                        |     4 +-
 drivers/video/valkyriefb.c                    |    15 +-
 drivers/video/vesafb.c                        |     5 +-
 drivers/video/vga16fb.c                       |     3 +-
 drivers/w1/Kconfig                            |     2 +-
 drivers/w1/matrox_w1.c                        |     2 +-
 drivers/w1/w1.c                               |     2 +-
 drivers/w1/w1_int.c                           |     2 +-
 drivers/w1/w1_io.c                            |     2 +-
 fs/Kconfig                                    |   203 +-
 fs/affs/amigaffs.c                            |     3 +-
 fs/affs/bitmap.c                              |    29 +-
 fs/affs/inode.c                               |     2 +-
 fs/affs/super.c                               |    26 +-
 fs/affs/symlink.c                             |     5 +-
 fs/afs/cmservice.c                            |     4 -
 fs/afs/fsclient.c                             |    12 +-
 fs/afs/internal.h                             |     2 -
 fs/afs/mntpt.c                                |    14 +-
 fs/afs/super.c                                |     4 +-
 fs/afs/vlclient.c                             |     8 +-
 fs/afs/vlocation.c                            |     4 +-
 fs/aio.c                                      |    14 +
 fs/attr.c                                     |    31 +-
 fs/autofs/root.c                              |    13 +-
 fs/autofs/symlink.c                           |    11 +-
 fs/autofs/waitq.c                             |     2 +-
 fs/autofs4/symlink.c                          |    13 +-
 fs/autofs4/waitq.c                            |     2 +-
 fs/bad_inode.c                                |     4 +-
 fs/befs/linuxvfs.c                            |    65 +-
 fs/binfmt_aout.c                              |    34 +-
 fs/binfmt_elf.c                               |    19 +-
 fs/binfmt_flat.c                              |     2 +-
 fs/binfmt_misc.c                              |   168 +-
 fs/binfmt_script.c                            |     2 +-
 fs/binfmt_som.c                               |     1 +
 fs/bio.c                                      |   181 +-
 fs/block_dev.c                                |    29 +-
 fs/buffer.c                                   |    38 +-
 fs/cifs/AUTHORS                               |     2 +-
 fs/cifs/CHANGES                               |    42 +-
 fs/cifs/README                                |    78 +-
 fs/cifs/TODO                                  |    40 +-
 fs/cifs/asn1.c                                |     2 +-
 fs/cifs/cifs_debug.c                          |   107 +-
 fs/cifs/cifs_fs_sb.h                          |     4 +
 fs/cifs/cifs_uniupr.h                         |     2 +-
 fs/cifs/cifsfs.c                              |    23 +-
 fs/cifs/cifsfs.h                              |     8 +-
 fs/cifs/cifsglob.h                            |     6 +-
 fs/cifs/cifspdu.h                             |    23 +-
 fs/cifs/cifsproto.h                           |    48 +-
 fs/cifs/cifssmb.c                             |   462 +-
 fs/cifs/connect.c                             |   163 +-
 fs/cifs/dir.c                                 |    84 +-
 fs/cifs/fcntl.c                               |    52 +-
 fs/cifs/file.c                                |    59 +-
 fs/cifs/inode.c                               |    71 +-
 fs/cifs/link.c                                |     4 +-
 fs/cifs/misc.c                                |     2 +-
 fs/cifs/smbencrypt.c                          |     2 -
 fs/cifs/smberr.h                              |     3 +-
 fs/cifs/transport.c                           |    58 +-
 fs/cifs/xattr.c                               |   172 +-
 fs/coda/cnode.c                               |     5 +-
 fs/coda/inode.c                               |     2 +-
 fs/coda/psdev.c                               |     2 +-
 fs/coda/sysctl.c                              |    10 +-
 fs/compat.c                                   |   257 +-
 fs/compat_ioctl.c                             |   248 +-
 fs/dcache.c                                   |    81 +-
 fs/dcookies.c                                 |     2 +-
 fs/devfs/base.c                               |    33 +-
 fs/devpts/inode.c                             |     3 +-
 fs/direct-io.c                                |    16 +-
 fs/dnotify.c                                  |    23 +-
 fs/dquot.c                                    |    70 +-
 fs/eventpoll.c                                |   282 +-
 fs/exec.c                                     |    16 +-
 fs/ext2/acl.c                                 |     2 +-
 fs/ext2/dir.c                                 |    10 +-
 fs/ext2/ialloc.c                              |     5 +
 fs/ext2/inode.c                               |    18 +-
 fs/ext2/symlink.c                             |    18 +-
 fs/ext2/xattr.c                               |     3 +-
 fs/ext3/acl.c                                 |    12 +-
 fs/ext3/balloc.c                              |    63 +-
 fs/ext3/dir.c                                 |    22 +-
 fs/ext3/ialloc.c                              |     9 +-
 fs/ext3/inode.c                               |    69 +-
 fs/ext3/namei.c                               |    43 +-
 fs/ext3/super.c                               |    11 +-
 fs/ext3/symlink.c                             |    20 +-
 fs/ext3/xattr.c                               |    10 +-
 fs/fat/inode.c                                |   105 +-
 fs/fcntl.c                                    |    29 +-
 fs/fifo.c                                     |     3 +
 fs/file.c                                     |     2 +-
 fs/file_table.c                               |     2 +-
 fs/freevxfs/vxfs_immed.c                      |    30 +-
 fs/fs-writeback.c                             |     4 +-
 fs/hfs/btree.c                                |     7 +-
 fs/hfs/super.c                                |     2 +-
 fs/hfsplus/bnode.c                            |    10 +-
 fs/hfsplus/btree.c                            |     6 +-
 fs/hfsplus/inode.c                            |     2 +-
 fs/hfsplus/wrapper.c                          |     2 +-
 fs/hpfs/alloc.c                               |    74 +-
 fs/hpfs/anode.c                               |     3 +-
 fs/hpfs/buffer.c                              |    12 +-
 fs/hpfs/ea.c                                  |     8 +-
 fs/hpfs/hpfs.h                                |     2 +-
 fs/hpfs/hpfs_fn.h                             |     5 +-
 fs/hpfs/inode.c                               |    16 +-
 fs/hpfs/map.c                                 |     6 +-
 fs/hpfs/super.c                               |     1 +
 fs/hugetlbfs/inode.c                          |    12 +-
 fs/inode.c                                    |    85 +-
 fs/ioctl.c                                    |    10 +
 fs/isofs/Makefile                             |     2 +-
 fs/isofs/compress.c                           |     2 +-
 fs/isofs/dir.c                                |    20 +-
 fs/isofs/inode.c                              |   190 +-
 fs/isofs/namei.c                              |    30 +-
 fs/isofs/rock.c                               |    17 +-
 fs/jbd/commit.c                               |     4 +-
 fs/jbd/journal.c                              |    36 +-
 fs/jbd/revoke.c                               |     4 +-
 fs/jbd/transaction.c                          |    24 +-
 fs/jffs/inode-v23.c                           |    28 +-
 fs/jffs/intrep.c                              |    62 +-
 fs/jffs/jffs_fm.c                             |    59 +-
 fs/jffs/jffs_proc.c                           |    12 +-
 fs/jffs2/Makefile                             |    10 +-
 fs/jffs2/background.c                         |    42 +-
 fs/jffs2/build.c                              |   157 +-
 fs/jffs2/compr.c                              |   508 +-
 fs/jffs2/compr.h                              |     6 +-
 fs/jffs2/compr_rtime.c                        |    34 +-
 fs/jffs2/compr_rubin.c                        |    66 +-
 fs/jffs2/compr_zlib.c                         |    58 +-
 fs/jffs2/erase.c                              |   105 +-
 fs/jffs2/file.c                               |    19 +-
 fs/jffs2/fs.c                                 |   186 +-
 fs/jffs2/gc.c                                 |   318 +-
 fs/jffs2/ioctl.c                              |     6 +-
 fs/jffs2/malloc.c                             |     2 +-
 fs/jffs2/nodelist.c                           |    35 +-
 fs/jffs2/nodelist.h                           |   125 +-
 fs/jffs2/nodemgmt.c                           |   127 +-
 fs/jffs2/os-linux.h                           |    46 +-
 fs/jffs2/read.c                               |    13 +-
 fs/jffs2/readinode.c                          |   100 +-
 fs/jffs2/scan.c                               |    78 +-
 fs/jffs2/super.c                              |    19 +-
 fs/jffs2/symlink.c                            |    42 +-
 fs/jffs2/wbuf.c                               |   303 +-
 fs/jffs2/write.c                              |   133 +-
 fs/jffs2/writev.c                             |     6 +-
 fs/jfs/acl.c                                  |     4 +-
 fs/jfs/file.c                                 |     4 +
 fs/jfs/jfs_btree.h                            |     2 +-
 fs/jfs/jfs_dmap.c                             |    37 +-
 fs/jfs/jfs_dtree.c                            |    41 +-
 fs/jfs/jfs_extent.c                           |     4 +-
 fs/jfs/jfs_imap.c                             |    22 +-
 fs/jfs/jfs_incore.h                           |     1 +
 fs/jfs/jfs_logmgr.c                           |     2 +-
 fs/jfs/jfs_metapage.c                         |    16 +-
 fs/jfs/jfs_mount.c                            |     2 +-
 fs/jfs/jfs_txnmgr.c                           |    12 +-
 fs/jfs/jfs_uniupr.c                           |     2 +-
 fs/jfs/jfs_xtree.c                            |    67 +-
 fs/jfs/namei.c                                |    61 +-
 fs/jfs/super.c                                |    17 +-
 fs/jfs/symlink.c                              |    12 +-
 fs/jfs/xattr.c                                |     6 +-
 fs/libfs.c                                    |    18 +
 fs/lockd/host.c                               |     4 +-
 fs/lockd/svclock.c                            |    10 +-
 fs/lockd/svcshare.c                           |     2 +-
 fs/lockd/xdr.c                                |     4 +-
 fs/lockd/xdr4.c                               |     4 +-
 fs/locks.c                                    |     4 +-
 fs/minix/inode.c                              |     9 +-
 fs/mpage.c                                    |    42 +-
 fs/namei.c                                    |   211 +-
 fs/namespace.c                                |   237 +-
 fs/ncpfs/dir.c                                |    10 +-
 fs/ncpfs/inode.c                              |    12 +-
 fs/ncpfs/ioctl.c                              |   383 +-
 fs/ncpfs/ncplib_kernel.c                      |    42 +-
 fs/ncpfs/ncplib_kernel.h                      |     8 +-
 fs/ncpfs/sock.c                               |   218 +-
 fs/nfs/dir.c                                  |     5 +-
 fs/nfs/direct.c                               |     2 +-
 fs/nfs/file.c                                 |    38 +-
 fs/nfs/idmap.c                                |    11 +-
 fs/nfs/inode.c                                |    39 +-
 fs/nfs/nfs2xdr.c                              |     6 +-
 fs/nfs/nfs3xdr.c                              |    33 +-
 fs/nfs/nfs4proc.c                             |     2 +-
 fs/nfs/nfs4xdr.c                              |    12 +-
 fs/nfs/proc.c                                 |     3 -
 fs/nfsctl.c                                   |     1 +
 fs/nfsd/auth.c                                |     8 +-
 fs/nfsd/nfs3xdr.c                             |    36 +-
 fs/nfsd/nfs4proc.c                            |   109 +-
 fs/nfsd/nfs4state.c                           |   400 +-
 fs/nfsd/nfs4xdr.c                             |    90 +-
 fs/nfsd/nfscache.c                            |     8 +-
 fs/nfsd/nfsctl.c                              |    33 +-
 fs/nfsd/nfsxdr.c                              |    19 +-
 fs/nfsd/vfs.c                                 |    25 +-
 fs/nls/Kconfig                                |     8 +
 fs/nls/Makefile                               |     1 +
 fs/ntfs/ChangeLog                             |    70 +-
 fs/ntfs/Makefile                              |     9 +-
 fs/ntfs/aops.c                                |   290 +-
 fs/ntfs/attrib.c                              |    10 +-
 fs/ntfs/compress.c                            |     2 +-
 fs/ntfs/dir.c                                 |   103 +-
 fs/ntfs/inode.c                               |   377 +-
 fs/ntfs/inode.h                               |    12 +-
 fs/ntfs/layout.h                              |    48 +-
 fs/ntfs/logfile.c                             |     2 +-
 fs/ntfs/malloc.h                              |    16 +-
 fs/ntfs/mft.c                                 |    10 +-
 fs/ntfs/namei.c                               |     4 +-
 fs/ntfs/ntfs.h                                |     2 +
 fs/ntfs/super.c                               |   247 +-
 fs/ntfs/volume.h                              |     9 +
 fs/open.c                                     |    25 +-
 fs/openpromfs/inode.c                         |    20 +-
 fs/partitions/Kconfig                         |     7 -
 fs/partitions/check.c                         |    24 +-
 fs/partitions/msdos.c                         |     6 +-
 fs/pipe.c                                     |    12 +-
 fs/proc/array.c                               |    13 +-
 fs/proc/base.c                                |     9 +-
 fs/proc/generic.c                             |    46 +-
 fs/proc/kcore.c                               |     5 +-
 fs/proc/kmsg.c                                |     4 +-
 fs/proc/proc_devtree.c                        |     6 +-
 fs/proc/proc_misc.c                           |    17 -
 fs/proc/proc_tty.c                            |    10 +-
 fs/proc/root.c                                |    20 +-
 fs/qnx4/inode.c                               |     6 +-
 fs/quota.c                                    |     6 +-
 fs/read_write.c                               |    57 +-
 fs/reiserfs/bitmap.c                          |   286 +-
 fs/reiserfs/dir.c                             |     1 +
 fs/reiserfs/do_balan.c                        |    22 +-
 fs/reiserfs/file.c                            |    53 +-
 fs/reiserfs/fix_node.c                        |    12 +-
 fs/reiserfs/ibalance.c                        |     4 +-
 fs/reiserfs/inode.c                           |    90 +-
 fs/reiserfs/ioctl.c                           |     8 +-
 fs/reiserfs/item_ops.c                        |     2 +-
 fs/reiserfs/journal.c                         |    17 +-
 fs/reiserfs/lbalance.c                        |    14 +-
 fs/reiserfs/namei.c                           |    29 +-
 fs/reiserfs/prints.c                          |    14 +-
 fs/reiserfs/procfs.c                          |     4 +-
 fs/reiserfs/stree.c                           |   150 +-
 fs/reiserfs/super.c                           |    62 +-
 fs/reiserfs/tail_conversion.c                 |    43 +-
 fs/seq_file.c                                 |     6 +-
 fs/smbfs/file.c                               |     4 +-
 fs/smbfs/inode.c                              |     1 +
 fs/smbfs/proc.c                               |    68 +-
 fs/smbfs/proto.h                              |     2 -
 fs/smbfs/request.h                            |     2 +-
 fs/smbfs/smbiod.c                             |     2 +-
 fs/smbfs/sock.c                               |   105 +-
 fs/smbfs/symlink.c                            |    49 +-
 fs/super.c                                    |    27 +-
 fs/sysfs/file.c                               |     2 +-
 fs/sysfs/inode.c                              |     7 +-
 fs/sysfs/mount.c                              |     4 +-
 fs/sysv/inode.c                               |     9 +-
 fs/sysv/itree.c                               |     8 +-
 fs/sysv/symlink.c                             |    13 +-
 fs/udf/crc.c                                  |     2 +-
 fs/udf/dir.c                                  |     4 +-
 fs/udf/misc.c                                 |    12 +-
 fs/udf/namei.c                                |    28 +-
 fs/udf/super.c                                |     8 +-
 fs/ufs/balloc.c                               |     1 +
 fs/ufs/symlink.c                              |    12 +-
 fs/xfs/Makefile                               |     1 +
 fs/xfs/linux-2.6/kmem.h                       |   116 +-
 fs/xfs/linux-2.6/xfs_aops.c                   |    57 +-
 fs/xfs/linux-2.6/xfs_buf.c                    |    62 +-
 fs/xfs/linux-2.6/xfs_buf.h                    |    20 +-
 fs/xfs/linux-2.6/xfs_file.c                   |     8 +-
 fs/xfs/linux-2.6/xfs_fs_subr.c                |     6 +-
 fs/xfs/linux-2.6/xfs_iops.c                   |    31 +-
 fs/xfs/linux-2.6/xfs_super.c                  |    40 +-
 fs/xfs/linux-2.6/xfs_super.h                  |     9 +-
 fs/xfs/linux-2.6/xfs_sysctl.c                 |     5 +-
 fs/xfs/xfs.h                                  |     1 +
 fs/xfs/xfs_acl.c                              |     4 -
 fs/xfs/xfs_acl.h                              |    26 +-
 fs/xfs/xfs_arch.h                             |    10 +-
 fs/xfs/xfs_attr.c                             |     6 +-
 fs/xfs/xfs_bit.c                              |    24 +-
 fs/xfs/xfs_dmapi.h                            |    13 +-
 fs/xfs/xfs_inode.c                            |     9 +-
 fs/xfs/xfs_inode.h                            |     4 +-
 fs/xfs/xfs_mount.h                            |     6 +-
 fs/xfs/xfs_rtalloc.c                          |     6 +-
 fs/xfs/xfs_vfsops.c                           |     4 +-
 fs/xfs/xfs_vnodeops.c                         |    16 -
 include/acpi/acpi_drivers.h                   |     2 +-
 include/asm-alpha/bitops.h                    |     4 +-
 include/asm-alpha/checksum.h                  |     1 +
 include/asm-alpha/core_lca.h                  |     2 +-
 include/asm-alpha/fcntl.h                     |     1 +
 include/asm-alpha/fpu.h                       |     2 +-
 include/asm-alpha/pgalloc.h                   |     2 +-
 include/asm-alpha/resource.h                  |    10 +-
 include/asm-alpha/signal.h                    |    12 +-
 include/asm-alpha/smp.h                       |     4 +-
 include/asm-alpha/spinlock.h                  |     4 +-
 include/asm-alpha/system.h                    |     1 -
 include/asm-alpha/topology.h                  |    10 +-
 include/asm-alpha/uaccess.h                   |   107 +-
 include/asm-arm/arch-ebsa110/io.h             |    54 +-
 include/asm-arm/arch-ebsa110/uncompress.h     |     4 +-
 include/asm-arm/arch-integrator/impd1.h       |     1 -
 include/asm-arm/arch-integrator/platform.h    |     4 +
 include/asm-arm/arch-ixp4xx/dma.h             |    26 -
 include/asm-arm/arch-ixp4xx/memory.h          |    34 +
 include/asm-arm/arch-ixp4xx/platform.h        |     1 +
 include/asm-arm/arch-lh7a40x/memory.h         |    69 +-
 include/asm-arm/arch-omap/memory.h            |    24 +-
 include/asm-arm/arch-omap/pm.h                |     3 -
 include/asm-arm/arch-pxa/hardware.h           |     5 +
 include/asm-arm/arch-rpc/uncompress.h         |     7 +-
 include/asm-arm/arch-s3c2410/hardware.h       |    35 +
 include/asm-arm/arch-s3c2410/regs-gpio.h      |   226 +-
 include/asm-arm/arch-s3c2410/regs-serial.h    |    19 +-
 include/asm-arm/arch-sa1100/dma.h             |    17 -
 include/asm-arm/arch-sa1100/irqs.h            |    33 +
 include/asm-arm/arch-sa1100/memory.h          |    24 +
 include/asm-arm/arch-shark/dma.h              |    12 -
 include/asm-arm/arch-shark/memory.h           |    21 +
 include/asm-arm/arch-versatile/uncompress.h   |     2 -
 include/asm-arm/bitops.h                      |     2 +-
 include/asm-arm/cacheflush.h                  |     2 +-
 include/asm-arm/checksum.h                    |     2 +
 include/asm-arm/cpu-multi32.h                 |    17 +-
 include/asm-arm/cpu-single.h                  |    21 +-
 include/asm-arm/dma-mapping.h                 |     8 +-
 include/asm-arm/dma.h                         |     5 -
 include/asm-arm/ecard.h                       |     6 +-
 include/asm-arm/fcntl.h                       |     1 +
 include/asm-arm/fpstate.h                     |    32 +
 include/asm-arm/hardware/clock.h              |     2 +-
 include/asm-arm/ide.h                         |     6 +-
 include/asm-arm/io.h                          |     2 +-
 include/asm-arm/ipc.h                         |     2 +-
 include/asm-arm/mach/arch.h                   |    10 +-
 include/asm-arm/memory.h                      |    25 +-
 include/asm-arm/proc-fns.h                    |    16 +
 include/asm-arm/processor.h                   |     1 -
 include/asm-arm/resource.h                    |     6 +-
 include/asm-arm/scatterlist.h                 |     3 +-
 include/asm-arm/setup.h                       |     2 +-
 include/asm-arm/signal.h                      |    12 +-
 include/asm-arm/thread_info.h                 |     7 +-
 include/asm-arm/uaccess.h                     |     7 +-
 include/asm-arm26/fcntl.h                     |     1 +
 include/asm-arm26/io.h                        |     2 +-
 include/asm-arm26/resource.h                  |     6 +-
 include/asm-arm26/setup.h                     |     2 +-
 include/asm-arm26/tlb.h                       |     1 +
 include/asm-cris/fcntl.h                      |     1 +
 include/asm-cris/resource.h                   |    10 +-
 include/asm-cris/setup.h                      |     3 +
 include/asm-generic/bitops.h                  |     2 +-
 include/asm-generic/pgtable.h                 |     4 +
 include/asm-generic/rtc.h                     |    12 +-
 include/asm-generic/siginfo.h                 |     4 +-
 include/asm-generic/tlb.h                     |     3 +
 include/asm-h8300/fcntl.h                     |     1 +
 include/asm-h8300/io.h                        |    86 +-
 include/asm-h8300/resource.h                  |     8 +-
 include/asm-h8300/setup.h                     |     7 +-
 include/asm-i386/apic.h                       |     2 +
 include/asm-i386/bitops.h                     |   104 +-
 include/asm-i386/checksum.h                   |    12 +-
 include/asm-i386/cpufeature.h                 |     2 +
 include/asm-i386/delay.h                      |     2 +-
 include/asm-i386/desc.h                       |     3 +-
 include/asm-i386/dma-mapping.h                |     3 +
 include/asm-i386/elf.h                        |     8 +-
 include/asm-i386/fcntl.h                      |     1 +
 include/asm-i386/genapic.h                    |     4 +-
 include/asm-i386/hpet.h                       |     3 +
 include/asm-i386/ide.h                        |    34 -
 include/asm-i386/io_apic.h                    |    11 +-
 include/asm-i386/mach-bigsmp/mach_apic.h      |    11 +-
 include/asm-i386/mach-bigsmp/mach_mpspec.h    |     5 -
 .../mach-default/irq_vectors_limits.h         |     2 +-
 include/asm-i386/mach-default/mach_apic.h     |    22 +-
 include/asm-i386/mach-default/mach_mpspec.h   |     5 -
 .../asm-i386/mach-default/setup_arch_post.h   |     2 +-
 include/asm-i386/mach-es7000/mach_apic.h      |    13 +-
 include/asm-i386/mach-es7000/mach_ipi.h       |     5 +-
 include/asm-i386/mach-es7000/mach_mpspec.h    |     5 -
 include/asm-i386/mach-generic/mach_apic.h     |     1 -
 include/asm-i386/mach-generic/mach_mpspec.h   |     5 -
 include/asm-i386/mach-numaq/mach_apic.h       |     6 +-
 include/asm-i386/mach-numaq/mach_mpspec.h     |     5 -
 include/asm-i386/mach-summit/mach_apic.h      |    12 +-
 include/asm-i386/mach-summit/mach_mpspec.h    |     5 -
 include/asm-i386/mach-visws/mach_apic.h       |    10 +-
 include/asm-i386/mach-visws/setup_arch_post.h |     2 +-
 .../asm-i386/mach-voyager/setup_arch_post.h   |     2 +-
 include/asm-i386/mmzone.h                     |     4 +-
 include/asm-i386/mpspec.h                     |     4 +-
 include/asm-i386/mpspec_def.h                 |     1 +
 include/asm-i386/msi.h                        |     2 +-
 include/asm-i386/msr.h                        |     9 +
 include/asm-i386/page.h                       |    12 +-
 include/asm-i386/param.h                      |     1 +
 include/asm-i386/pgtable-2level.h             |    32 +-
 include/asm-i386/pgtable-3level.h             |    53 +-
 include/asm-i386/pgtable.h                    |   122 +-
 include/asm-i386/processor.h                  |    12 +-
 include/asm-i386/resource.h                   |     9 +-
 include/asm-i386/serial.h                     |     7 -
 include/asm-i386/setup.h                      |     3 +-
 include/asm-i386/signal.h                     |    13 +-
 include/asm-i386/spinlock.h                   |    32 +-
 include/asm-i386/string.h                     |    43 +-
 include/asm-i386/suspend.h                    |     3 -
 include/asm-i386/system.h                     |     7 -
 include/asm-i386/timex.h                      |     4 -
 include/asm-i386/uaccess.h                    |     2 +-
 include/asm-i386/unistd.h                     |     8 -
 include/asm-ia64/atomic.h                     |     4 +-
 include/asm-ia64/cyclone.h                    |     4 +-
 include/asm-ia64/dma-mapping.h                |     2 +
 include/asm-ia64/elf.h                        |     6 +-
 include/asm-ia64/fcntl.h                      |     1 +
 include/asm-ia64/gcc_intrin.h                 |    14 +-
 include/asm-ia64/ia32.h                       |    10 +-
 include/asm-ia64/iosapic.h                    |    22 +-
 include/asm-ia64/irq.h                        |     6 +
 include/asm-ia64/machvec.h                    |    24 +-
 include/asm-ia64/machvec_sn2.h                |     2 +
 include/asm-ia64/numnodes.h                   |     3 +
 include/asm-ia64/page.h                       |     2 +-
 include/asm-ia64/pgalloc.h                    |    20 +-
 include/asm-ia64/pgtable.h                    |    16 +-
 include/asm-ia64/processor.h                  |     8 +-
 include/asm-ia64/resource.h                   |     6 +-
 include/asm-ia64/smp.h                        |     4 +
 include/asm-ia64/sn/bte.h                     |    49 +-
 include/asm-ia64/sn/module.h                  |     2 +-
 include/asm-ia64/sn/pda.h                     |     2 -
 include/asm-ia64/sn/sn2/io.h                  |     5 +-
 include/asm-ia64/sn/sn_cpuid.h                |     1 -
 include/asm-ia64/sn/sn_sal.h                  |    38 +-
 include/asm-ia64/system.h                     |     2 +-
 include/asm-ia64/thread_info.h                |     5 +-
 include/asm-ia64/tlb.h                        |     3 +
 include/asm-ia64/unistd.h                     |     3 +-
 include/asm-m68k/atomic.h                     |   116 +-
 include/asm-m68k/bitops.h                     |   149 +-
 include/asm-m68k/fcntl.h                      |     1 +
 include/asm-m68k/hardirq.h                    |     1 +
 include/asm-m68k/io.h                         |    46 +-
 include/asm-m68k/math-emu.h                   |     2 +-
 include/asm-m68k/motorola_pgalloc.h           |     1 +
 include/asm-m68k/page.h                       |    18 +-
 include/asm-m68k/resource.h                   |     8 +-
 include/asm-m68k/semaphore.h                  |    12 +-
 include/asm-m68k/setup.h                      |     1 +
 include/asm-m68k/string.h                     |    17 +-
 include/asm-m68k/sun3_pgalloc.h               |     5 +-
 include/asm-m68k/ucontext.h                   |     6 +-
 include/asm-m68knommu/setup.h                 |     4 +
 include/asm-mips/asmmacro.h                   |     4 +-
 include/asm-mips/atomic.h                     |   130 +-
 include/asm-mips/bootinfo.h                   |     3 +-
 include/asm-mips/cache.h                      |     2 +
 include/asm-mips/checksum.h                   |     3 +-
 include/asm-mips/fcntl.h                      |     1 +
 include/asm-mips/hazards.h                    |   117 +-
 include/asm-mips/mipsregs.h                   |     2 +-
 include/asm-mips/mmu_context.h                |    12 +-
 include/asm-mips/module.h                     |    19 +-
 include/asm-mips/mv64340.h                    |    34 +-
 include/asm-mips/page.h                       |     6 +-
 include/asm-mips/pci.h                        |     3 +
 include/asm-mips/pgtable-32.h                 |    72 +-
 include/asm-mips/pgtable-64.h                 |    33 +-
 include/asm-mips/pgtable-bits.h               |    18 +-
 include/asm-mips/pgtable.h                    |     2 -
 include/asm-mips/pmon.h                       |     3 +
 include/asm-mips/processor.h                  |    13 +-
 include/asm-mips/resource.h                   |     6 +-
 include/asm-mips/semaphore.h                  |   265 +-
 include/asm-mips/serial.h                     |    19 -
 include/asm-mips/smp.h                        |     8 -
 include/asm-mips/stackframe.h                 |     3 +
 include/asm-mips/system.h                     |    21 +-
 include/asm-mips/thread_info.h                |     3 +
 include/asm-mips/titan_dep.h                  |   181 +-
 include/asm-mips/unistd.h                     |    13 +-
 include/asm-mips/vr41xx/capcella.h            |    54 +-
 include/asm-mips/vr41xx/mpc30x.h              |    54 +-
 include/asm-mips/vr41xx/tb0226.h              |    54 +-
 include/asm-mips/vr41xx/vr41xx.h              |   144 +-
 include/asm-mips/vr41xx/vrc4173.h             |    78 +-
 include/asm-parisc/assembly.h                 |    18 +
 include/asm-parisc/bitops.h                   |    54 +-
 include/asm-parisc/cacheflush.h               |    28 +-
 include/asm-parisc/checksum.h                 |     6 +-
 include/asm-parisc/dma-mapping.h              |     1 +
 include/asm-parisc/fcntl.h                    |     1 +
 include/asm-parisc/hardware.h                 |     1 +
 include/asm-parisc/io.h                       |     5 -
 include/asm-parisc/mmzone.h                   |   105 +-
 include/asm-parisc/page.h                     |    24 +-
 include/asm-parisc/pci.h                      |    22 -
 include/asm-parisc/pdc.h                      |   259 +-
 include/asm-parisc/pdcpat.h                   |   162 +-
 include/asm-parisc/pgalloc.h                  |    38 +-
 include/asm-parisc/pgtable.h                  |    83 +-
 include/asm-parisc/resource.h                 |     6 +-
 include/asm-parisc/setup.h                    |    12 +-
 include/asm-parisc/smp.h                      |     9 +-
 include/asm-parisc/spinlock.h                 |    94 +-
 include/asm-parisc/system.h                   |    10 +
 include/asm-parisc/thread_info.h              |     6 +-
 include/asm-parisc/unistd.h                   |     4 +-
 include/asm-parisc/unwind.h                   |     8 +-
 include/asm-ppc/checksum.h                    |     4 +-
 include/asm-ppc/commproc.h                    |    14 +-
 include/asm-ppc/cpm2.h                        |    17 +-
 include/asm-ppc/cputable.h                    |     1 +
 include/asm-ppc/elf.h                         |     1 +
 include/asm-ppc/fcntl.h                       |     1 +
 include/asm-ppc/highmem.h                     |     4 +-
 include/asm-ppc/io.h                          |    20 +-
 include/asm-ppc/irq.h                         |   115 +-
 include/asm-ppc/machdep.h                     |     3 +-
 include/asm-ppc/mmu.h                         |    68 +
 include/asm-ppc/mmu_context.h                 |     5 +
 include/asm-ppc/mpc10x.h                      |     3 +
 include/asm-ppc/mpc8260.h                     |     8 +-
 include/asm-ppc/mpc85xx.h                     |    13 +
 include/asm-ppc/ocp.h                         |     4 +
 include/asm-ppc/ocp_ids.h                     |     4 +-
 include/asm-ppc/open_pic.h                    |     2 +-
 include/asm-ppc/pgtable.h                     |    37 +
 include/asm-ppc/pmac_feature.h                |     6 +
 include/asm-ppc/ppc_asm.h                     |    66 +-
 include/asm-ppc/ppcboot.h                     |    13 +-
 include/asm-ppc/processor.h                   |    27 +-
 include/asm-ppc/ptrace.h                      |     5 +
 include/asm-ppc/reg.h                         |    21 +-
 include/asm-ppc/reg_booke.h                   |   130 +-
 include/asm-ppc/resource.h                    |     6 +-
 include/asm-ppc/serial.h                      |     2 +
 include/asm-ppc/setup.h                       |     3 +
 include/asm-ppc/signal.h                      |    12 +-
 include/asm-ppc/smp.h                         |     2 -
 include/asm-ppc/system.h                      |     3 +-
 include/asm-ppc/tlbflush.h                    |    22 +
 include/asm-ppc/uaccess.h                     |    12 +-
 include/asm-ppc/ucontext.h                    |     4 +-
 include/asm-ppc/uninorth.h                    |     6 +
 include/asm-ppc64/bitops.h                    |     6 +-
 include/asm-ppc64/cputable.h                  |     1 +
 include/asm-ppc64/current.h                   |     4 +-
 include/asm-ppc64/eeh.h                       |    83 +-
 include/asm-ppc64/fcntl.h                     |     1 +
 include/asm-ppc64/hardirq.h                   |     2 +
 include/asm-ppc64/iSeries/HvCall.h            |     2 +-
 include/asm-ppc64/iSeries/HvTypes.h           |     4 +
 include/asm-ppc64/irq.h                       |     4 +-
 include/asm-ppc64/machdep.h                   |     5 +-
 include/asm-ppc64/mmu.h                       |    69 +-
 include/asm-ppc64/mmu_context.h               |     8 +-
 include/asm-ppc64/paca.h                      |   219 +-
 include/asm-ppc64/page.h                      |     5 +-
 include/asm-ppc64/pci-bridge.h                |     1 -
 include/asm-ppc64/pgalloc.h                   |    28 +-
 include/asm-ppc64/pgtable.h                   |     2 +-
 include/asm-ppc64/ppc_asm.h                   |     8 +-
 include/asm-ppc64/processor.h                 |     9 +-
 include/asm-ppc64/prom.h                      |     3 +-
 include/asm-ppc64/ptrace.h                    |    12 +
 include/asm-ppc64/resource.h                  |     6 +-
 include/asm-ppc64/rtas.h                      |    11 +-
 include/asm-ppc64/setup.h                     |     2 +-
 include/asm-ppc64/signal.h                    |    14 +-
 include/asm-ppc64/smp.h                       |    10 +-
 include/asm-ppc64/spinlock.h                  |    14 +-
 include/asm-ppc64/system.h                    |    23 +-
 include/asm-ppc64/systemcfg.h                 |     2 +
 include/asm-ppc64/thread_info.h               |     7 +-
 include/asm-ppc64/time.h                      |     4 +-
 include/asm-ppc64/uaccess.h                   |    35 +-
 include/asm-ppc64/udbg.h                      |     3 -
 include/asm-ppc64/vio.h                       |     8 +-
 include/asm-ppc64/xics.h                      |     3 +
 include/asm-s390/byteorder.h                  |     6 +-
 include/asm-s390/debug.h                      |     1 -
 include/asm-s390/fcntl.h                      |     1 +
 include/asm-s390/percpu.h                     |    68 +-
 include/asm-s390/pgtable.h                    |     6 +-
 include/asm-s390/processor.h                  |    10 +
 include/asm-s390/resource.h                   |     8 +-
 include/asm-s390/setup.h                      |     3 +-
 include/asm-s390/sigp.h                       |    32 +-
 include/asm-s390/smp.h                        |    23 +-
 include/asm-s390/thread_info.h                |     2 +-
 include/asm-s390/vtoc.h                       |     1 -
 include/asm-sh/bugs.h                         |     2 +-
 include/asm-sh/cache.h                        |     3 +-
 include/asm-sh/checksum.h                     |     6 +-
 include/asm-sh/cpu-sh3/dac.h                  |     7 +-
 include/asm-sh/cpu-sh4/dma.h                  |    10 +
 include/asm-sh/dma-mapping.h                  |    32 +
 include/asm-sh/dma.h                          |    71 +-
 include/asm-sh/fcntl.h                        |     1 +
 include/asm-sh/hp6xx/hp6xx.h                  |    18 +-
 include/asm-sh/ide.h                          |    65 +-
 include/asm-sh/irq.h                          |   288 +-
 include/asm-sh/machvec.h                      |     4 +
 include/asm-sh/pgalloc.h                      |    67 +-
 include/asm-sh/pgtable.h                      |    49 +-
 include/asm-sh/processor.h                    |     7 +-
 include/asm-sh/resource.h                     |     6 +-
 include/asm-sh/serial.h                       |     3 -
 include/asm-sh/sigcontext.h                   |    22 +-
 include/asm-sh/ubc.h                          |     3 +-
 include/asm-sh/unistd.h                       |    12 +-
 include/asm-sh64/uaccess.h                    |     3 -
 include/asm-sparc/bitops.h                    |    15 +-
 include/asm-sparc/bpp.h                       |     4 +-
 include/asm-sparc/bug.h                       |     2 +-
 include/asm-sparc/checksum.h                  |     2 +-
 include/asm-sparc/dma.h                       |    43 +
 include/asm-sparc/fcntl.h                     |     1 +
 include/asm-sparc/openpromio.h                |     5 +-
 include/asm-sparc/pci.h                       |     7 +
 include/asm-sparc/pgtable.h                   |    43 -
 include/asm-sparc/pgtsrmmu.h                  |     2 +-
 include/asm-sparc/pgtsun4.h                   |    16 +
 include/asm-sparc/processor.h                 |    16 +-
 include/asm-sparc/resource.h                  |    12 +-
 include/asm-sparc/setup.h                     |     1 +
 include/asm-sparc/sun4prom.h                  |     2 +-
 include/asm-sparc/system.h                    |     2 +-
 include/asm-sparc/vfc_ioctls.h                |     2 +-
 include/asm-sparc64/asi.h                     |   247 +-
 include/asm-sparc64/bitops.h                  |     3 +-
 include/asm-sparc64/bpp.h                     |     4 +-
 include/asm-sparc64/bug.h                     |     2 +
 include/asm-sparc64/byteorder.h               |     6 +-
 include/asm-sparc64/cacheflush.h              |     3 +-
 include/asm-sparc64/checksum.h                |     3 +-
 include/asm-sparc64/fbio.h                    |     8 +-
 include/asm-sparc64/fcntl.h                   |     1 +
 include/asm-sparc64/floppy.h                  |     6 +-
 include/asm-sparc64/io.h                      |     4 +-
 include/asm-sparc64/mmu_context.h             |     2 -
 include/asm-sparc64/openpromio.h              |     5 +-
 include/asm-sparc64/page.h                    |    17 +-
 include/asm-sparc64/pgalloc.h                 |    39 +-
 include/asm-sparc64/pgtable.h                 |   135 +-
 include/asm-sparc64/resource.h                |    12 +-
 include/asm-sparc64/setup.h                   |     1 +
 include/asm-sparc64/siginfo.h                 |     8 +
 include/asm-sparc64/signal.h                  |    22 +-
 include/asm-sparc64/spinlock.h                |    18 +-
 include/asm-sparc64/string.h                  |    26 +-
 include/asm-sparc64/system.h                  |     1 +
 include/asm-sparc64/thread_info.h             |    16 +-
 include/asm-sparc64/tlb.h                     |   136 +-
 include/asm-sparc64/tlbflush.h                |    85 +-
 include/asm-sparc64/ttable.h                  |     4 +
 include/asm-v850/bitops.h                     |   102 +-
 include/asm-v850/fcntl.h                      |     1 +
 include/asm-v850/irq.h                        |     9 +-
 include/asm-v850/resource.h                   |     8 +-
 include/asm-v850/unistd.h                     |     6 +-
 include/asm-x86_64/acpi.h                     |     4 -
 include/asm-x86_64/bootsetup.h                |     4 +-
 include/asm-x86_64/compat.h                   |     2 +-
 include/asm-x86_64/fcntl.h                    |     1 +
 include/asm-x86_64/hw_irq.h                   |     1 +
 include/asm-x86_64/i387.h                     |     2 +-
 include/asm-x86_64/io_apic.h                  |     2 +-
 include/asm-x86_64/irq.h                      |     2 +-
 include/asm-x86_64/mpspec.h                   |     6 +-
 include/asm-x86_64/msi.h                      |     7 +-
 include/asm-x86_64/pgtable.h                  |    21 +-
 include/asm-x86_64/processor.h                |     4 +-
 include/asm-x86_64/resource.h                 |     8 +-
 include/asm-x86_64/setup.h                    |     6 +-
 include/asm-x86_64/signal.h                   |    10 +-
 include/asm-x86_64/smp.h                      |     6 +-
 include/asm-x86_64/string.h                   |     2 -
 include/asm-x86_64/suspend.h                  |     1 -
 include/asm-x86_64/topology.h                 |     6 +-
 include/asm-x86_64/uaccess.h                  |    80 +-
 include/asm-x86_64/vsyscall32.h               |     4 +-
 include/linux/acct.h                          |   149 +-
 include/linux/acpi.h                          |     4 +-
 include/linux/affs_fs.h                       |     3 +-
 include/linux/affs_fs_sb.h                    |     1 -
 include/linux/aio.h                           |     7 +-
 include/linux/ata.h                           |    14 +-
 include/linux/atm.h                           |     1 +
 include/linux/atmdev.h                        |     6 +-
 include/linux/atmlec.h                        |     2 +-
 include/linux/binfmts.h                       |    11 +-
 include/linux/bio.h                           |    23 +-
 include/linux/bitmap.h                        |   258 +-
 include/linux/blkdev.h                        |     5 +-
 include/linux/blockgroup_lock.h               |     4 +-
 include/linux/bootmem.h                       |     8 +
 include/linux/byteorder/swab.h                |     6 +-
 include/linux/capi.h                          |     2 +-
 include/linux/cciss_ioctl.h                   |    28 +
 include/linux/cd1400.h                        |     2 +-
 include/linux/cdk.h                           |     2 +-
 include/linux/cdrom.h                         |     4 +-
 include/linux/coda_proc.h                     |     4 +-
 include/linux/compat_ioctl.h                  |     4 +
 include/linux/compiler-gcc+.h                 |     1 +
 include/linux/compiler-gcc3.h                 |     3 +
 include/linux/compiler.h                      |     4 +
 include/linux/comstats.h                      |     2 +-
 include/linux/console.h                       |     9 +-
 include/linux/console_struct.h                |     2 +-
 include/linux/cpu.h                           |     1 +
 include/linux/cpumask.h                       |   396 +-
 include/linux/dcache.h                        |     2 +
 include/linux/dcookies.h                      |     2 +-
 include/linux/device.h                        |    45 +-
 include/linux/devpts_fs.h                     |     2 +
 include/linux/dma-mapping.h                   |     2 +
 include/linux/dvb/osd.h                       |     4 +-
 include/linux/dvb/video.h                     |     4 +-
 include/linux/edd.h                           |    31 +-
 include/linux/efi.h                           |     6 +-
 include/linux/elf.h                           |     7 +
 include/linux/errqueue.h                      |     4 +
 include/linux/ext3_fs.h                       |     1 +
 include/linux/fb.h                            |   115 +-
 include/linux/fd.h                            |     1 +
 include/linux/filter.h                        |     4 +-
 include/linux/fs.h                            |    72 +-
 include/linux/ftape.h                         |     1 -
 include/linux/generic_serial.h                |     4 +-
 include/linux/genhd.h                         |     3 +-
 include/linux/hpet.h                          |    12 +-
 include/linux/hugetlb.h                       |    14 +-
 include/linux/i2c-id.h                        |    12 +
 include/linux/i2o-dev.h                       |    26 +-
 include/linux/i2o.h                           |    14 +-
 include/linux/icmpv6.h                        |    28 +-
 include/linux/ide.h                           |    60 +-
 include/linux/idr.h                           |    33 +-
 include/linux/if.h                            |    14 +-
 include/linux/if_pppox.h                      |     2 -
 include/linux/if_vlan.h                       |     5 +-
 include/linux/init.h                          |    31 +-
 include/linux/init_task.h                     |     4 +-
 include/linux/interrupt.h                     |     3 +-
 include/linux/ip.h                            |     2 -
 include/linux/ipmi.h                          |    32 +-
 include/linux/ipmi_msgdefs.h                  |     1 +
 include/linux/ipmi_smi.h                      |     4 +
 include/linux/isdn_ppp.h                      |     5 +-
 include/linux/isdnif.h                        |    12 +-
 include/linux/iso_fs.h                        |    72 +-
 include/linux/iso_fs_i.h                      |     5 +-
 include/linux/istallion.h                     |     2 +-
 include/linux/ixjuser.h                       |     2 +-
 include/linux/jbd.h                           |     1 +
 include/linux/jffs2.h                         |    37 +-
 include/linux/jffs2_fs_i.h                    |     4 +-
 include/linux/kallsyms.h                      |     2 +
 include/linux/kd.h                            |     6 +
 include/linux/kernel.h                        |    21 +-
 include/linux/kernelcapi.h                    |     2 +-
 include/linux/libata.h                        |    96 +-
 include/linux/list.h                          |    21 +-
 include/linux/mca.h                           |     2 +
 include/linux/mempolicy.h                     |    11 +
 include/linux/miscdevice.h                    |     9 +-
 include/linux/mm.h                            |     3 +-
 include/linux/mmzone.h                        |    62 +-
 include/linux/module.h                        |    28 +-
 include/linux/mount.h                         |    21 +-
 include/linux/mqueue.h                        |     2 +
 include/linux/mtd/cfi.h                       |   513 +-
 include/linux/mtd/doc2000.h                   |    33 +-
 include/linux/mtd/flashchip.h                 |    15 +-
 include/linux/mtd/ftl.h                       |     2 +-
 include/linux/mtd/gen_probe.h                 |     6 +-
 include/linux/mtd/inftl.h                     |    90 +-
 include/linux/mtd/map.h                       |   364 +-
 include/linux/mtd/mtd.h                       |   145 +-
 include/linux/mtd/nand.h                      |   397 +-
 include/linux/mtd/nand_ecc.h                  |    16 +-
 include/linux/mtd/nftl.h                      |    71 +-
 include/linux/mtd/partitions.h                |     4 +-
 include/linux/mtd/physmap.h                   |     6 +-
 include/linux/mtio.h                          |     2 +-
 include/linux/namei.h                         |    15 +
 include/linux/namespace.h                     |     2 +-
 include/linux/ncp_fs.h                        |     6 +-
 include/linux/net.h                           |     7 +
 include/linux/netdevice.h                     |    18 +-
 include/linux/netfilter.h                     |     1 +
 include/linux/netfilter_arp/arp_tables.h      |     2 +-
 include/linux/netfilter_ipv4/ip_conntrack.h   |     2 +-
 include/linux/netfilter_ipv4/ip_tables.h      |     5 +-
 include/linux/netfilter_ipv6/ip6_tables.h     |     3 +
 include/linux/netlink.h                       |     8 +-
 include/linux/nfs4_mount.h                    |     6 +-
 include/linux/nfsd/cache.h                    |     2 +-
 include/linux/nfsd/nfsd.h                     |    10 +-
 include/linux/nfsd/state.h                    |    33 +-
 include/linux/nfsd/xdr.h                      |     4 +-
 include/linux/nfsd/xdr3.h                     |     4 +-
 include/linux/nfsd/xdr4.h                     |     6 +-
 include/linux/oprofile.h                      |     3 +
 include/linux/page-flags.h                    |    12 +-
 include/linux/pagemap.h                       |     6 +-
 include/linux/pci.h                           |    62 +-
 include/linux/pci_ids.h                       |    62 +-
 include/linux/percpu_counter.h                |     4 +
 include/linux/personality.h                   |     7 +
 include/linux/pkt_cls.h                       |   165 +-
 include/linux/pkt_sched.h                     |    45 +-
 include/linux/pm.h                            |     2 +-
 include/linux/pnpbios.h                       |     1 +
 include/linux/posix-timers.h                  |    22 +-
 include/linux/ppp_defs.h                      |     4 +-
 include/linux/prctl.h                         |     6 +
 include/linux/quotaops.h                      |    19 +-
 include/linux/rcupdate.h                      |    69 +-
 include/linux/reiserfs_fs.h                   |    33 +-
 include/linux/reiserfs_fs_i.h                 |     1 +
 include/linux/route.h                         |     4 +-
 include/linux/rtnetlink.h                     |    24 +-
 include/linux/sc26198.h                       |     2 +-
 include/linux/sched.h                         |    45 +-
 include/linux/security.h                      |    19 +-
 include/linux/serialP.h                       |     7 +
 include/linux/serial_core.h                   |    18 +-
 include/linux/serio.h                         |     1 -
 include/linux/shmem_fs.h                      |     3 +
 include/linux/signal.h                        |     4 +
 include/linux/skbuff.h                        |   115 +-
 include/linux/smb_fs_sb.h                     |     6 +-
 include/linux/stallion.h                      |     2 +-
 include/linux/sunrpc/auth.h                   |     1 +
 include/linux/sunrpc/clnt.h                   |     3 +-
 include/linux/sunrpc/svc.h                    |    10 +-
 include/linux/sunrpc/svcauth.h                |     1 -
 include/linux/sunrpc/xdr.h                    |    14 +-
 include/linux/suspend.h                       |    27 +-
 include/linux/swap.h                          |     6 +-
 include/linux/syscalls.h                      |     2 +-
 include/linux/sysctl.h                        |    19 +-
 include/linux/sysfs.h                         |    23 +
 include/linux/tcp.h                           |     6 +-
 include/linux/uio.h                           |     9 +
 include/linux/usb.h                           |    19 +-
 include/linux/usb_gadget.h                    |   153 +-
 include/linux/usbdevice_fs.h                  |     4 +-
 include/linux/videodev.h                      |     5 +-
 include/linux/videodev2.h                     |    21 +-
 include/linux/videotext.h                     |     2 +-
 include/linux/vmalloc.h                       |     3 +
 include/linux/vs_base.h                       |     9 -
 include/linux/vs_context.h                    |    26 +-
 include/linux/vs_cvirt.h                      |    18 +-
 include/linux/vs_dlimit.h                     |   104 +-
 include/linux/vs_limit.h                      |    72 +-
 include/linux/vs_memory.h                     |    53 +-
 include/linux/vs_network.h                    |    27 +-
 include/linux/vs_socket.h                     |     5 +-
 include/linux/vserver/context.h               |     4 +-
 include/linux/vserver/cvirt.h                 |    23 +-
 include/linux/vserver/dlimit.h                |     4 +-
 include/linux/vserver/inode.h                 |     2 +-
 include/linux/vserver/limit.h                 |    41 +-
 include/linux/vserver/network.h               |     4 +-
 include/linux/vserver/sched.h                 |     4 +-
 include/linux/vserver/switch.h                |     2 +-
 include/linux/vserver/xid.h                   |    75 +-
 include/linux/vt_kern.h                       |    13 +
 include/linux/wait.h                          |    56 +-
 include/linux/writeback.h                     |     2 +-
 include/linux/xfrm.h                          |    63 +-
 include/media/ir-common.h                     |     2 +-
 include/media/saa7146_vv.h                    |     2 +-
 include/media/video-buf.h                     |    16 +-
 include/mtd/mtd-abi.h                         |     2 +-
 include/net/addrconf.h                        |     8 +-
 include/net/bluetooth/bluetooth.h             |     1 +
 include/net/bluetooth/hci.h                   |     2 +-
 include/net/bluetooth/hci_core.h              |     6 +-
 include/net/bluetooth/l2cap.h                 |     8 +
 include/net/checksum.h                        |    70 +-
 include/net/dst.h                             |    17 +-
 include/net/esp.h                             |     5 +
 include/net/icmp.h                            |    12 -
 include/net/inet_common.h                     |    13 -
 include/net/inet_ecn.h                        |    41 +-
 include/net/ip.h                              |    18 +-
 include/net/ip6_route.h                       |     2 -
 include/net/ipv6.h                            |     3 +
 include/net/irda/crc.h                        |    10 +-
 include/net/irda/irda_device.h                |     4 +-
 include/net/irda/irttp.h                      |     2 -
 include/net/ndisc.h                           |     3 +-
 include/net/netrom.h                          |     3 -
 include/net/pkt_cls.h                         |    32 +-
 include/net/pkt_sched.h                       |   288 +-
 include/net/protocol.h                        |    11 +-
 include/net/route.h                           |     5 +-
 include/net/sctp/command.h                    |     3 +
 include/net/sctp/constants.h                  |     4 +
 include/net/sctp/sm.h                         |     3 +
 include/net/snmp.h                            |   363 +-
 include/net/sock.h                            |   233 +-
 include/net/tcp.h                             |   155 +-
 include/net/udp.h                             |     2 -
 include/net/xfrm.h                            |    22 +-
 include/pcmcia/cs_types.h                     |     2 +-
 include/pcmcia/ss.h                           |     3 +-
 include/rxrpc/call.h                          |     2 +-
 include/rxrpc/message.h                       |     4 +-
 include/scsi/scsi.h                           |    26 +-
 include/scsi/scsi_devinfo.h                   |     1 +
 include/scsi/scsi_eh.h                        |     4 +
 include/scsi/scsi_host.h                      |    31 +-
 include/scsi/scsi_ioctl.h                     |     1 -
 include/scsi/sg.h                             |     4 +-
 include/sound/asound.h                        |     6 +-
 include/sound/info.h                          |     6 +-
 include/video/sisfb.h                         |   251 +-
 include/video/sstfb.h                         |     4 -
 include/video/vga.h                           |     9 +-
 init/Kconfig                                  |    49 +-
 init/do_mounts_initrd.c                       |     2 +-
 init/initramfs.c                              |     2 +-
 init/main.c                                   |    68 +-
 ipc/compat.c                                  |   214 +-
 ipc/compat_mq.c                               |   123 +-
 ipc/mqueue.c                                  |    83 +-
 ipc/msg.c                                     |     2 +-
 ipc/sem.c                                     |     2 +-
 ipc/shm.c                                     |     2 +-
 ipc/util.c                                    |    25 +-
 kernel/Makefile                               |    18 +-
 kernel/acct.c                                 |   102 +-
 kernel/auditsc.c                              |     7 +-
 kernel/compat.c                               |     2 +-
 kernel/configs.c                              |    27 +-
 kernel/cpu.c                                  |     8 -
 kernel/dma.c                                  |     9 +-
 kernel/exit.c                                 |    73 +-
 kernel/extable.c                              |    15 +-
 kernel/fork.c                                 |    19 +-
 kernel/futex.c                                |     4 +-
 kernel/itimer.c                               |     2 +-
 kernel/kallsyms.c                             |    50 +-
 kernel/kmod.c                                 |     3 +-
 kernel/kthread.c                              |     3 +-
 kernel/module.c                               |   120 +-
 kernel/posix-timers.c                         |   369 +-
 kernel/power/Makefile                         |     5 +-
 kernel/power/pm.c                             |     2 +-
 kernel/power/pmdisk.c                         |    43 +-
 kernel/power/poweroff.c                       |     2 +-
 kernel/power/process.c                        |     1 -
 kernel/power/swsusp.c                         |    73 +-
 kernel/printk.c                               |    41 +
 kernel/rcupdate.c                             |   252 +-
 kernel/sched.c                                |    54 +-
 kernel/signal.c                               |    64 +-
 kernel/sysctl.c                               |   138 +-
 kernel/timer.c                                |     6 +-
 kernel/uid16.c                                |    12 +-
 kernel/user.c                                 |     7 +-
 kernel/vserver/Kconfig                        |    24 +-
 kernel/vserver/Makefile                       |     4 +-
 kernel/vserver/context.c                      |    66 +-
 kernel/vserver/cvirt.c                        |     7 +-
 kernel/vserver/dlimit.c                       |    34 +-
 kernel/vserver/init.c                         |     4 +
 kernel/vserver/limit.c                        |    13 +
 kernel/vserver/network.c                      |    43 +-
 kernel/vserver/switch.c                       |    11 +-
 kernel/vserver/sysctl.c                       |    59 +-
 lib/Kconfig                                   |     9 +
 lib/Makefile                                  |     1 +
 lib/bitmap.c                                  |   148 +-
 lib/idr.c                                     |    95 +-
 lib/kobject.c                                 |    11 +-
 lib/radix-tree.c                              |     8 +-
 lib/rbtree.c                                  |     4 +-
 lib/rwsem-spinlock.c                          |    97 +-
 lib/rwsem.c                                   |   109 +-
 lib/string.c                                  |    24 +-
 lib/vsprintf.c                                |    33 +-
 lib/zlib_deflate/deflate.c                    |     2 +-
 lib/zlib_inflate/inftrees.c                   |     2 +-
 mm/bootmem.c                                  |    12 +-
 mm/filemap.c                                  |   131 +-
 mm/fremap.c                                   |    38 +-
 mm/highmem.c                                  |    10 +-
 mm/hugetlb.c                                  |    55 +-
 mm/memory.c                                   |    41 +-
 mm/mempolicy.c                                |    53 +-
 mm/mempool.c                                  |     6 -
 mm/mincore.c                                  |     1 -
 mm/mmap.c                                     |    24 +-
 mm/mprotect.c                                 |     8 +-
 mm/mremap.c                                   |     2 +-
 mm/msync.c                                    |     1 -
 mm/nommu.c                                    |     3 +-
 mm/oom_kill.c                                 |    11 +-
 mm/page-writeback.c                           |     4 +-
 mm/page_alloc.c                               |   202 +-
 mm/readahead.c                                |     9 +-
 mm/rmap.c                                     |    27 +-
 mm/shmem.c                                    |   115 +-
 mm/slab.c                                     |   116 +-
 mm/swap.c                                     |     2 +-
 mm/swapfile.c                                 |    49 +-
 mm/truncate.c                                 |    10 +-
 mm/vmalloc.c                                  |    27 +-
 mm/vmscan.c                                   |   208 +-
 net/802/fc.c                                  |     2 +-
 net/802/tr.c                                  |     2 +-
 net/8021q/vlan.c                              |   114 +-
 net/8021q/vlan.h                              |    10 +-
 net/8021q/vlan_dev.c                          |    44 +-
 net/Kconfig                                   |    22 +-
 net/appletalk/ddp.c                           |    10 +-
 net/atm/br2684.c                              |     4 +-
 net/atm/clip.c                                |     4 +-
 net/atm/common.c                              |     2 +-
 net/atm/lec.c                                 |    16 +-
 net/atm/lec.h                                 |     2 +-
 net/atm/lec_arpc.h                            |     2 +-
 net/atm/mpc.c                                 |    13 +-
 net/atm/mpc.h                                 |     3 +-
 net/atm/mpoa_proc.c                           |   311 +-
 net/atm/pppoatm.c                             |     2 +-
 net/atm/resources.c                           |     6 +-
 net/atm/signaling.c                           |     2 +-
 net/atm/svc.c                                 |     2 +-
 net/ax25/ax25_ds_timer.c                      |     2 +-
 net/ax25/ax25_route.c                         |     1 +
 net/bluetooth/Kconfig                         |     3 +
 net/bluetooth/Makefile                        |     1 +
 net/bluetooth/af_bluetooth.c                  |     6 +-
 net/bluetooth/bnep/bnep.h                     |     2 +-
 net/bluetooth/bnep/core.c                     |    58 +-
 net/bluetooth/cmtp/core.c                     |     8 +-
 net/bluetooth/hci_conn.c                      |     2 +-
 net/bluetooth/hci_core.c                      |    10 +-
 net/bluetooth/hci_event.c                     |     6 +-
 net/bluetooth/hci_sysfs.c                     |     2 +-
 net/bluetooth/hidp/core.c                     |     8 +-
 net/bluetooth/l2cap.c                         |    58 +-
 net/bluetooth/rfcomm/core.c                   |    45 +-
 net/bridge/br.c                               |     3 -
 net/bridge/br_device.c                        |    45 +-
 net/bridge/br_fdb.c                           |    86 +-
 net/bridge/br_forward.c                       |    12 +-
 net/bridge/br_if.c                            |    40 +-
 net/bridge/br_input.c                         |     4 +-
 net/bridge/br_ioctl.c                         |     2 +-
 net/bridge/br_netfilter.c                     |     4 +-
 net/bridge/br_notify.c                        |    53 +-
 net/bridge/br_private.h                       |    17 +-
 net/bridge/br_stp.c                           |    30 +-
 net/bridge/br_stp_if.c                        |     2 +-
 net/bridge/br_sysfs_br.c                      |    21 +-
 net/bridge/br_sysfs_if.c                      |     2 +-
 net/core/Makefile                             |     2 +-
 net/core/dev.c                                |   230 +-
 net/core/dst.c                                |    65 +-
 net/core/ethtool.c                            |     2 +-
 net/core/link_watch.c                         |     2 -
 net/core/net-sysfs.c                          |     4 +-
 net/core/netpoll.c                            |    22 +-
 net/core/pktgen.c                             |    13 +-
 net/core/rtnetlink.c                          |    21 +-
 net/core/skbuff.c                             |   166 +
 net/core/sock.c                               |   154 +-
 net/core/stream.c                             |   246 +
 net/core/sysctl_net_core.c                    |    10 -
 net/decnet/dn_dev.c                           |     7 +-
 net/decnet/dn_nsp_in.c                        |     2 +-
 net/decnet/dn_route.c                         |     4 +-
 net/decnet/sysctl_net_decnet.c                |    18 +-
 net/econet/af_econet.c                        |    44 +-
 net/ethernet/eth.c                            |     3 +
 net/ipv4/Kconfig                              |     3 +-
 net/ipv4/Makefile                             |     5 +-
 net/ipv4/af_inet.c                            |   126 +-
 net/ipv4/ah4.c                                |    95 +-
 net/ipv4/arp.c                                |     2 +-
 net/ipv4/devinet.c                            |    22 +-
 net/ipv4/esp4.c                               |   222 +-
 net/ipv4/fib_frontend.c                       |     2 +-
 net/ipv4/icmp.c                               |    99 +-
 net/ipv4/igmp.c                               |    68 +-
 net/ipv4/ip_forward.c                         |     2 +-
 net/ipv4/ip_fragment.c                        |    14 +-
 net/ipv4/ip_gre.c                             |    18 +-
 net/ipv4/ip_input.c                           |    24 +-
 net/ipv4/ip_output.c                          |    57 +-
 net/ipv4/ip_sockglue.c                        |     7 +-
 net/ipv4/ipcomp.c                             |    93 +-
 net/ipv4/ipconfig.c                           |    22 +-
 net/ipv4/ipip.c                               |    16 +-
 net/ipv4/ipmr.c                               |    33 +-
 net/ipv4/ipvs/ip_vs_ctl.c                     |     8 +-
 net/ipv4/ipvs/ip_vs_ftp.c                     |     8 +-
 net/ipv4/ipvs/ip_vs_proto_tcp.c               |     2 +-
 net/ipv4/ipvs/ip_vs_proto_udp.c               |     2 +-
 net/ipv4/ipvs/ip_vs_sync.c                    |    36 +-
 net/ipv4/ipvs/ip_vs_xmit.c                    |     2 +-
 net/ipv4/netfilter/Kconfig                    |    25 +
 net/ipv4/netfilter/Makefile                   |     2 +
 net/ipv4/netfilter/ip_conntrack_amanda.c      |     2 +-
 net/ipv4/netfilter/ip_conntrack_core.c        |    28 +-
 net/ipv4/netfilter/ip_conntrack_ftp.c         |     2 -
 net/ipv4/netfilter/ip_conntrack_irc.c         |     2 -
 net/ipv4/netfilter/ip_conntrack_proto_tcp.c   |     4 +-
 net/ipv4/netfilter/ip_conntrack_standalone.c  |     3 +-
 net/ipv4/netfilter/ip_conntrack_tftp.c        |     2 -
 net/ipv4/netfilter/ip_fw_compat_masq.c        |     1 +
 net/ipv4/netfilter/ip_fw_compat_redir.c       |     1 +
 net/ipv4/netfilter/ip_nat_core.c              |     7 +-
 net/ipv4/netfilter/ip_nat_ftp.c               |     2 -
 net/ipv4/netfilter/ip_nat_irc.c               |     2 -
 net/ipv4/netfilter/ip_nat_snmp_basic.c        |   144 +-
 net/ipv4/netfilter/ip_nat_standalone.c        |     1 +
 net/ipv4/netfilter/ip_nat_tftp.c              |     2 -
 net/ipv4/netfilter/ip_tables.c                |    13 +-
 net/ipv4/netfilter/ipt_CLASSIFY.c             |    12 +-
 net/ipv4/netfilter/ipt_LOG.c                  |     4 +-
 net/ipv4/netfilter/ipt_MASQUERADE.c           |     1 +
 net/ipv4/netfilter/ipt_REJECT.c               |     6 +-
 net/ipv4/netfilter/ipt_ULOG.c                 |     4 +
 net/ipv4/netfilter/ipt_helper.c               |    18 +-
 net/ipv4/netfilter/ipt_owner.c                |    10 +-
 net/ipv4/netfilter/iptable_mangle.c           |     2 +
 net/ipv4/netfilter/iptable_raw.c              |   101 +-
 net/ipv4/proc.c                               |   290 +-
 net/ipv4/protocol.c                           |     6 +-
 net/ipv4/raw.c                                |    14 +-
 net/ipv4/route.c                              |    21 +-
 net/ipv4/syncookies.c                         |     6 +-
 net/ipv4/sysctl_net_ipv4.c                    |     4 +-
 net/ipv4/tcp.c                                |   438 +-
 net/ipv4/tcp_input.c                          |   172 +-
 net/ipv4/tcp_ipv4.c                           |   126 +-
 net/ipv4/tcp_minisocks.c                      |    21 +-
 net/ipv4/tcp_output.c                         |   173 +-
 net/ipv4/tcp_timer.c                          |    36 +-
 net/ipv4/udp.c                                |   151 +-
 net/ipv4/xfrm4_output.c                       |    25 +
 net/ipv4/xfrm4_policy.c                       |     2 +-
 net/ipv4/xfrm4_state.c                        |     9 +-
 net/ipv4/xfrm4_tunnel.c                       |    78 +-
 net/ipv6/Kconfig                              |     2 -
 net/ipv6/Makefile                             |     3 +-
 net/ipv6/addrconf.c                           |     8 +-
 net/ipv6/af_inet6.c                           |    22 +-
 net/ipv6/ah6.c                                |   257 +-
 net/ipv6/anycast.c                            |     8 +-
 net/ipv6/datagram.c                           |   156 +
 net/ipv6/esp6.c                               |   107 +-
 net/ipv6/exthdrs.c                            |    28 +-
 net/ipv6/icmp.c                               |    26 +-
 net/ipv6/ip6_fib.c                            |     2 +-
 net/ipv6/ip6_flowlabel.c                      |     4 +-
 net/ipv6/ip6_input.c                          |    24 +-
 net/ipv6/ip6_output.c                         |    76 +-
 net/ipv6/ip6_tunnel.c                         |    47 +-
 net/ipv6/ipcomp6.c                            |   161 +-
 net/ipv6/mcast.c                              |    96 +-
 net/ipv6/ndisc.c                              |    30 +-
 net/ipv6/netfilter/ip6_tables.c               |    11 +-
 net/ipv6/netfilter/ip6t_LOG.c                 |     9 +-
 net/ipv6/netfilter/ip6t_owner.c               |     9 +-
 net/ipv6/netfilter/ip6table_raw.c             |   103 +-
 net/ipv6/proc.c                               |   138 +-
 net/ipv6/raw.c                                |    13 +-
 net/ipv6/reassembly.c                         |    28 +-
 net/ipv6/route.c                              |    54 +-
 net/ipv6/sit.c                                |    18 +-
 net/ipv6/tcp_ipv6.c                           |   116 +-
 net/ipv6/udp.c                                |   188 +-
 net/ipv6/xfrm6_input.c                        |    11 +-
 net/ipv6/xfrm6_policy.c                       |     4 +-
 net/ipv6/xfrm6_state.c                        |     9 +-
 net/ipv6/xfrm6_tunnel.c                       |    63 +-
 net/irda/Kconfig                              |     1 +
 net/irda/Makefile                             |     2 +-
 net/irda/af_irda.c                            |    14 +-
 net/irda/discovery.c                          |     2 +-
 net/irda/ircomm/ircomm_core.c                 |     2 +-
 net/irda/ircomm/ircomm_tty.c                  |     4 +-
 net/irda/irda_device.c                        |     4 +-
 net/irda/iriap.c                              |     2 +-
 net/irda/irlmp.c                              |     6 +-
 net/irda/irsysctl.c                           |     4 +-
 net/key/af_key.c                              |    19 +-
 net/lapb/lapb_iface.c                         |     2 +-
 net/netlink/af_netlink.c                      |    18 +-
 net/netrom/af_netrom.c                        |     4 +-
 net/rose/af_rose.c                            |     5 +-
 net/rose/rose_route.c                         |     1 -
 net/rxrpc/call.c                              |    10 +-
 net/rxrpc/connection.c                        |    15 +-
 net/rxrpc/transport.c                         |    18 +-
 net/sched/Kconfig                             |   125 +-
 net/sched/Makefile                            |     7 +-
 net/sched/cls_api.c                           |    56 +-
 net/sched/cls_fw.c                            |   180 +-
 net/sched/cls_route.c                         |     9 +-
 net/sched/cls_rsvp.h                          |     9 +-
 net/sched/cls_tcindex.c                       |     4 +-
 net/sched/cls_u32.c                           |   239 +-
 net/sched/estimator.c                         |     8 +-
 net/sched/police.c                            |   339 +-
 net/sched/sch_api.c                           |   130 +-
 net/sched/sch_atm.c                           |     6 +-
 net/sched/sch_cbq.c                           |   127 +-
 net/sched/sch_dsmark.c                        |     3 +-
 net/sched/sch_fifo.c                          |     8 +-
 net/sched/sch_generic.c                       |   135 +-
 net/sched/sch_gred.c                          |    22 +-
 net/sched/sch_hfsc.c                          |   101 +-
 net/sched/sch_htb.c                           |   177 +-
 net/sched/sch_ingress.c                       |    74 +-
 net/sched/sch_netem.c                         |   124 +-
 net/sched/sch_prio.c                          |   111 +-
 net/sched/sch_red.c                           |    21 +-
 net/sched/sch_sfq.c                           |    18 +-
 net/sched/sch_tbf.c                           |    39 +-
 net/sched/sch_teql.c                          |    16 +-
 net/sctp/Kconfig                              |    10 +-
 net/sctp/associola.c                          |     3 +-
 net/sctp/chunk.c                              |     2 +-
 net/sctp/endpointola.c                        |     2 +-
 net/sctp/input.c                              |    14 +-
 net/sctp/inqueue.c                            |     2 +-
 net/sctp/ipv6.c                               |    12 +-
 net/sctp/output.c                             |     8 +-
 net/sctp/outqueue.c                           |    42 +-
 net/sctp/proc.c                               |    45 +-
 net/sctp/protocol.c                           |    16 +-
 net/sctp/sm_make_chunk.c                      |    24 +-
 net/sctp/sm_sideeffect.c                      |    71 +
 net/sctp/sm_statefuns.c                       |   578 +-
 net/sctp/socket.c                             |   167 +-
 net/sctp/ulpevent.c                           |    77 +-
 net/sctp/ulpqueue.c                           |    26 +-
 net/socket.c                                  |    86 +-
 net/sunrpc/auth.c                             |    10 +-
 net/sunrpc/auth_gss/auth_gss.c                |    10 +-
 net/sunrpc/auth_gss/svcauth_gss.c             |    20 +-
 net/sunrpc/auth_unix.c                        |    28 +-
 net/sunrpc/cache.c                            |     8 +-
 net/sunrpc/pmap_clnt.c                        |     2 +-
 net/sunrpc/rpc_pipe.c                         |     1 +
 net/sunrpc/stats.c                            |     2 +-
 net/sunrpc/svc.c                              |     4 +-
 net/sunrpc/svcauth_unix.c                     |     8 +-
 net/sunrpc/svcsock.c                          |    22 +-
 net/sunrpc/sysctl.c                           |     6 +-
 net/sunrpc/xdr.c                              |    70 +-
 net/sunrpc/xprt.c                             |    38 +-
 net/unix/af_unix.c                            |     9 +-
 net/xfrm/Makefile                             |     2 +-
 net/xfrm/xfrm_export.c                        |     3 +-
 net/xfrm/xfrm_policy.c                        |     6 +-
 net/xfrm/xfrm_state.c                         |    33 +-
 net/xfrm/xfrm_user.c                          |    31 +
 scripts/Makefile                              |    21 +-
 scripts/Makefile.modinst                      |    20 +-
 scripts/Makefile.modpost                      |     4 +-
 scripts/checkstack.pl                         |    36 +-
 scripts/extract-ikconfig                      |    87 +-
 scripts/genksyms/parse.c_shipped              |   258 +-
 scripts/kallsyms.c                            |    15 +-
 scripts/kconfig/mconf.c                       |    36 +-
 scripts/kernel-doc                            |     4 +-
 scripts/lxdialog/menubox.c                    |     8 +-
 scripts/package/Makefile                      |    20 +-
 scripts/package/mkspec                        |    19 +
 security/dummy.c                              |     2 +-
 security/root_plug.c                          |     6 +-
 security/selinux/Makefile                     |     2 +-
 security/selinux/avc.c                        |    53 +-
 security/selinux/hooks.c                      |   247 +-
 security/selinux/include/av_inherit.h         |     9 +
 security/selinux/include/av_perm_to_string.h  |   104 +-
 security/selinux/include/av_permissions.h     |   825 +-
 security/selinux/include/avc.h                |    19 -
 security/selinux/include/class_to_string.h    |    21 +
 security/selinux/include/flask.h              |    21 +
 security/selinux/include/security.h           |     9 +-
 security/selinux/netif.c                      |     6 +-
 security/selinux/ss/conditional.c             |     4 +-
 security/selinux/ss/ebitmap.c                 |    12 +-
 security/selinux/ss/mls.c                     |     4 +-
 security/selinux/ss/policydb.c                |    30 +-
 security/selinux/ss/services.c                |    20 +-
 sound/Kconfig                                 |     2 +-
 sound/core/control.c                          |     5 +-
 sound/core/info.c                             |    44 +-
 sound/core/ioctl32/hwdep32.c                  |     6 +-
 sound/core/ioctl32/ioctl32.c                  |    16 +-
 sound/core/ioctl32/ioctl32.h                  |    21 +-
 sound/core/ioctl32/pcm32.c                    |    21 +-
 sound/core/memalloc.c                         |     2 +-
 sound/core/oss/pcm_oss.c                      |    42 +-
 sound/core/oss/pcm_plugin.c                   |     4 +-
 sound/core/oss/route.c                        |     8 +-
 sound/core/pcm.c                              |    12 +-
 sound/core/pcm_lib.c                          |    18 +-
 sound/core/pcm_native.c                       |    24 +-
 sound/core/seq/Makefile                       |     1 -
 sound/core/seq/instr/Makefile                 |     1 -
 sound/core/seq/seq_clientmgr.c                |     2 +-
 sound/drivers/mpu401/mpu401.c                 |    11 -
 sound/drivers/opl3/opl3_lib.c                 |    20 -
 sound/drivers/opl4/opl4_proc.c                |    20 +-
 sound/drivers/serial-u16550.c                 |     2 +-
 sound/drivers/vx/vx_pcm.c                     |    16 +-
 sound/i2c/other/tea575x-tuner.c               |    11 +-
 sound/isa/Kconfig                             |    12 +-
 sound/isa/cs423x/Makefile                     |     2 -
 sound/isa/gus/gus_mem.c                       |     2 +-
 sound/isa/gus/gus_mem_proc.c                  |    10 +-
 sound/isa/gus/interwave.c                     |     2 +
 sound/isa/sb/emu8000_pcm.c                    |     2 +-
 sound/isa/sb/sb8_main.c                       |     4 +-
 sound/isa/wavefront/wavefront_fx.c            |   838 +-
 sound/isa/wavefront/wavefront_synth.c         |    26 +-
 sound/oss/Kconfig                             |     5 +-
 sound/oss/aci.c                               |     6 +-
 sound/oss/ad1816.c                            |     4 +-
 sound/oss/ad1848.c                            |     2 +-
 sound/oss/ad1889.c                            |    13 +-
 sound/oss/ali5455.c                           |    12 +-
 sound/oss/au1000.c                            |     8 +-
 sound/oss/cmpci.c                             |    12 +-
 sound/oss/cs4281/cs4281m.c                    |    14 +-
 sound/oss/cs46xx.c                            |    84 +-
 sound/oss/cs46xxpm-24.h                       |     2 +-
 sound/oss/dmasound/dmasound.h                 |    24 +-
 sound/oss/dmasound/dmasound_atari.c           |     5 +-
 sound/oss/dmasound/dmasound_awacs.c           |    41 +-
 sound/oss/dmasound/dmasound_core.c            |    20 +-
 sound/oss/dmasound/dmasound_paula.c           |     4 +-
 sound/oss/dmasound/dmasound_q40.c             |     4 +-
 sound/oss/dmasound/tas3001c.c                 |    44 +-
 sound/oss/dmasound/tas3001c_tables.c          |    12 +-
 sound/oss/dmasound/tas3004.c                  |    44 +-
 sound/oss/dmasound/trans_16.c                 |    96 +-
 sound/oss/emu10k1/audio.c                     |     8 +-
 sound/oss/emu10k1/main.c                      |     8 +-
 sound/oss/emu10k1/midi.c                      |    10 +-
 sound/oss/es1370.c                            |    18 +-
 sound/oss/es1371.c                            |    18 +-
 sound/oss/esssolo1.c                          |    16 +-
 sound/oss/forte.c                             |    14 +-
 sound/oss/gus_card.c                          |    28 +-
 sound/oss/gus_wave.c                          |    14 +-
 sound/oss/hal2.c                              |  1165 +-
 sound/oss/hal2.h                              |   156 +-
 sound/oss/i810_audio.c                        |   212 +-
 sound/oss/ite8172.c                           |     8 +-
 sound/oss/kahlua.c                            |     1 +
 sound/oss/maestro.c                           |     8 +-
 sound/oss/maestro3.c                          |     8 +-
 sound/oss/msnd_pinnacle.c                     |     6 +-
 sound/oss/nec_vrc5477.c                       |     9 +-
 sound/oss/rme96xx.c                           |     8 +-
 sound/oss/sb_audio.c                          |     3 +-
 sound/oss/sb_card.c                           |     8 +-
 sound/oss/sb_common.c                         |     2 +-
 sound/oss/sonicvibes.c                        |    16 +-
 sound/oss/sscape.c                            |    11 +-
 sound/oss/swarm_cs4297a.c                     |    20 +-
 sound/oss/trident.c                           |     8 +-
 sound/oss/via82cxxx_audio.c                   |    16 +-
 sound/oss/vwsnd.c                             |     2 +-
 sound/oss/wavfront.c                          |    24 +-
 sound/oss/ymfpci.c                            |    11 +-
 sound/pci/au88x0/au88x0.h                     |    10 +-
 sound/pci/au88x0/au88x0_a3d.c                 |    30 +-
 sound/pci/azt3328.c                           |     8 +-
 sound/pci/cs4281.c                            |    20 +-
 sound/pci/cs46xx/cs46xx_lib.c                 |    10 +-
 sound/pci/cs46xx/dsp_spos_scb_lib.c           |     8 +-
 sound/pci/emu10k1/emuproc.c                   |    14 +-
 sound/pci/es1968.c                            |     2 +
 sound/pci/ice1712/ice1712.c                   |     2 +-
 sound/pci/ice1712/ice1724.c                   |     4 +-
 sound/pci/intel8x0.c                          |     2 +-
 sound/pci/intel8x0m.c                         |     2 +-
 sound/pci/maestro3.c                          |     2 +-
 sound/pci/mixart/mixart.c                     |    20 +-
 sound/pci/nm256/nm256.c                       |     6 +-
 sound/pci/rme9652/hdsp.c                      |    14 +-
 sound/pci/sonicvibes.c                        |     2 +-
 sound/ppc/Kconfig                             |     5 +-
 sound/ppc/pmac.c                              |    11 +-
 sound/usb/usbaudio.c                          |     6 +-
 sound/usb/usbmixer.c                          |     4 +-
 3935 files changed, 129765 insertions(+), 111433 deletions(-)

diff --git a/CREDITS b/CREDITS
index 9eb5b8545..cc0cffd96 100644
--- a/CREDITS
+++ b/CREDITS
@@ -1060,6 +1060,12 @@ S: USA
 N: Jeff Garzik
 E: jgarzik@pobox.com
 
+N: Kumar Gala
+E: kumar.gala@freescale.com
+D: Embedded PowerPC 6xx/7xx/74xx/82xx/85xx support
+S: Austin, Texas 78729
+S: USA
+
 N: Jacques Gelinas
 E: jacques@solucorp.qc.ca
 D: Author of the Umsdos file system
@@ -1084,6 +1090,10 @@ E: jbglaw@lug-owl.de
 D: SRM environment driver (for Alpha systems)
 P: 1024D/8399E1BB 250D 3BCF 7127 0D8C A444  A961 1DBD 5E75 8399 E1BB
 
+N: Thomas Gleixner
+E: tglx@linutronix.de
+D: NAND flash hardware support, JFFS2 on NAND flash
+
 N: Richard E. Gooch
 E: rgooch@atnf.csiro.au
 D: parent process death signal to children
@@ -1399,6 +1409,7 @@ W: http://www.holtmann.org
 D: Maintainer of the Linux Bluetooth Subsystem
 D: Author and maintainer of the various Bluetooth HCI drivers
 D: Author and maintainer of the CAPI message transport protocol driver
+D: Author and maintainer of the Bluetooth HID protocol driver
 D: Various other Bluetooth related patches, cleanups and fixes
 S: Germany
 
@@ -2267,8 +2278,8 @@ S: USA
 N: Eberhard Moenkeberg
 E: emoenke@gwdg.de
 D: CDROM driver "sbpcd" (Matsushita/Panasonic/Soundblaster)
-S: Reinholdstrasse 14
-S: D-37083 Goettingen
+S: Ruhstrathoehe 2 b.
+S: D-37085 Goettingen
 S: Germany
 
 N: Thomas Molina
@@ -2571,6 +2582,14 @@ P: 1024D/EDBB6147 7B36 0E07 04BC 11DC A7A0  D3F7 7185 9E7A EDBB 6147
 D: sonypi, meye drivers, mct_u232 usb serial hacks
 S: Paris, France
 
+N: Matt Porter
+E: mporter@kernel.crashing.org
+D: Motorola PowerPC PReP support
+D: cPCI PowerPC support
+D: Embedded PowerPC 4xx/6xx/7xx/74xx support
+S: Chandler, Arizona 85249
+S: USA
+
 N: Frederic Potter 
 E: fpotter@cirpack.com
 D: Some PCI kernel support
@@ -2688,7 +2707,9 @@ S: Finland
 
 N: Luca Risolia
 E: luca.risolia@studio.unibo.it
+P: 1024D/FCE635A4 88E8 F32F 7244 68BA 3958  5D40 99DA 5D2A FCE6 35A4
 D: V4L driver for W996[87]CF JPEG USB Dual Mode Camera Chips
+D: V4L2 driver for SN9C10[12] PC Camera Controllers
 S: Via Liberta' 41/A
 S: Osio Sotto, 24046, Bergamo
 S: Italy
@@ -3109,12 +3130,13 @@ S: Beaverton, Oregon 97005
 S: USA
 
 N: Marcelo W. Tosatti
-E: marcelo@conectiva.com.br
-W: http://bazar.conectiva.com.br/~marcelo/
-D: Miscellaneous kernel hacker (mostly VM/MM work)
-S: Conectiva S.A.
-S: R. Tocantins, 89 - Cristo Rei
-S: 80050-430 - Curitiba - Paraná
+E: marcelo.tosatti@cyclades.com
+D: Miscellaneous kernel hacker
+D: v2.4 kernel maintainer
+D: Current pc300/cyclades maintainer
+S: Cyclades Corporation
+S: Av Cristovao Colombo, 462. Floresta.
+S: Porto Alegre
 S: Brazil
 
 N: Stefan Traby
@@ -3597,6 +3619,14 @@ D: MD driver
 D: EISA/sysfs subsystem
 S: France
 
+N: Luiz Fernando N. Capitulino
+E: lcapitulino@terra.com.br
+E: lcapitulino@prefeitura.sp.gov.br
+W: http://www.telecentros.sp.gov.br
+D: Little fixes and a lot of janitorial work
+S: E-GOV Telecentros SP
+S: Brazil
+
 # Don't add your name here, unless you really _are_ after Marc
 # alphabetically. Leonard used to be very proud of being the 
 # last entry, and he'll get positively pissed if he can't even
diff --git a/Documentation/DMA-API.txt b/Documentation/DMA-API.txt
index 2c1bd6a83..11caa2d64 100644
--- a/Documentation/DMA-API.txt
+++ b/Documentation/DMA-API.txt
@@ -162,6 +162,20 @@ parameters if it is.
 
 Returns: 1 if successful and 0 if not
 
+u64
+dma_get_required_mask(struct device *dev)
+
+After setting the mask with dma_set_mask(), this API returns the
+actual mask (within that already set) that the platform actually
+requires to operate efficiently.  Usually this means the returned mask
+is the minimum required to cover all of memory.  Examining the
+required mask gives drivers with variable descriptor sizes the
+opportunity to use smaller descriptors as necessary.
+
+Requesting the required mask does not alter the current mask.  If you
+wish to take advantage of it, you should issue another dma_set_mask()
+call to lower the mask again.
+
 
 Part Id - Streaming DMA mappings
 --------------------------------
diff --git a/Documentation/DMA-mapping.txt b/Documentation/DMA-mapping.txt
index 13a53cb87..f4ac37f15 100644
--- a/Documentation/DMA-mapping.txt
+++ b/Documentation/DMA-mapping.txt
@@ -222,14 +222,14 @@ Here is pseudo-code showing how this might be done:
 	struct pci_dev *pdev;
 
 	...
-	if (pci_set_dma_mask(pdev, PLAYBACK_ADDRESS_BITS)) {
+	if (!pci_set_dma_mask(pdev, PLAYBACK_ADDRESS_BITS)) {
 		card->playback_enabled = 1;
 	} else {
 		card->playback_enabled = 0;
 		printk(KERN_WARN "%s: Playback disabled due to DMA limitations.\n",
 		       card->name);
 	}
-	if (pci_set_dma_mask(pdev, RECORD_ADDRESS_BITS)) {
+	if (!pci_set_dma_mask(pdev, RECORD_ADDRESS_BITS)) {
 		card->record_enabled = 1;
 	} else {
 		card->record_enabled = 0;
diff --git a/Documentation/IPMI.txt b/Documentation/IPMI.txt
index ec8a6fa2c..583eb0d58 100644
--- a/Documentation/IPMI.txt
+++ b/Documentation/IPMI.txt
@@ -442,6 +442,7 @@ used to control it:
 
   modprobe ipmi_watchdog timeout=<t> pretimeout=<t> action=<action type>
       preaction=<preaction type> preop=<preop type> start_now=x
+      nowayout=x
 
 The timeout is the number of seconds to the action, and the pretimeout
 is the amount of seconds before the reset that the pre-timeout panic will
@@ -472,6 +473,10 @@ the device, as well.
 If start_now is set to 1, the watchdog timer will start running as
 soon as the driver is loaded.
 
+If nowayout is set to 1, the watchdog timer will not stop when the
+watchdog device is closed.  The default value of nowayout is true
+if the CONFIG_WATCHDOG_NOWAYOUT option is enabled, or false if not.
+
 When compiled into the kernel, the kernel command line is available
 for configuring the watchdog:
 
@@ -480,6 +485,7 @@ for configuring the watchdog:
 	ipmi_watchdog.preaction=<preaction type>
 	ipmi_watchdog.preop=<preop type>
 	ipmi_watchdog.start_now=x
+	ipmi_watchdog.nowayout=x
 
 The options are the same as the module parameter options.
 
diff --git a/Documentation/MSI-HOWTO.txt b/Documentation/MSI-HOWTO.txt
index 18526692d..d5032eb48 100644
--- a/Documentation/MSI-HOWTO.txt
+++ b/Documentation/MSI-HOWTO.txt
@@ -3,13 +3,14 @@
 			10/03/2003
 	Revised Feb 12, 2004 by Martine Silbermann
 		email: Martine.Silbermann@hp.com
+	Revised Jun 25, 2004 by Tom L Nguyen
 
 1. About this guide
 
-This guide describes the basics of Message Signaled Interrupts(MSI), the
-advantages of using MSI over traditional interrupt mechanisms, and how
-to enable your driver to use MSI or MSI-X. Also included is a Frequently
-Asked Questions.
+This guide describes the basics of Message Signaled Interrupts (MSI),
+the advantages of using MSI over traditional interrupt mechanisms,
+and how to enable your driver to use MSI or MSI-X. Also included is
+a Frequently Asked Questions.
 
 2. Copyright 2003 Intel Corporation
 
@@ -35,7 +36,7 @@ An MSI capable device function indicates MSI support by implementing
 the MSI/MSI-X capability structure in its PCI capability list. The
 device function may implement both the MSI capability structure and
 the MSI-X capability structure; however, the bus driver should not
-enable both, but instead enable only the MSI-X capability structure.
+enable both.
 
 The MSI capability structure contains Message Control register,
 Message Address register and Message Data register. These registers
@@ -86,35 +87,62 @@ support. As a result, the PCI Express technology requires MSI
 support for better interrupt performance.
 
 Using MSI enables the device functions to support two or more
-vectors, which can be configure to target different CPU's to
+vectors, which can be configured to target different CPU's to
 increase scalability.
 
 5. Configuring a driver to use MSI/MSI-X
 
 By default, the kernel will not enable MSI/MSI-X on all devices that
-support this capability. The CONFIG_PCI_USE_VECTOR kernel option
+support this capability. The CONFIG_PCI_MSI kernel option
 must be selected to enable MSI/MSI-X support.
 
-5.1 Including MSI support into the kernel
+5.1 Including MSI/MSI-X support into the kernel
 
-To allow MSI-Capable device drivers to selectively enable MSI (using
-pci_enable_msi as described below), the VECTOR based scheme needs to
-be enabled by setting CONFIG_PCI_USE_VECTOR.
+To allow MSI/MSI-X capable device drivers to selectively enable
+MSI/MSI-X (using pci_enable_msi()/pci_enable_msix() as described
+below), the VECTOR based scheme needs to be enabled by setting
+CONFIG_PCI_MSI during kernel config.
 
 Since the target of the inbound message is the local APIC, providing
-CONFIG_PCI_USE_VECTOR is dependent on whether CONFIG_X86_LOCAL_APIC
-is enabled or not.
+CONFIG_X86_LOCAL_APIC must be enabled as well as CONFIG_PCI_MSI.
 
-int pci_enable_msi(struct pci_dev *)
+5.2 Configuring for MSI support
+
+Due to the non-contiguous fashion in vector assignment of the
+existing Linux kernel, this version does not support multiple
+messages regardless of a device function is capable of supporting
+more than one vector. To enable MSI on a device function's MSI
+capability structure requires a device driver to call the function
+pci_enable_msi() explicitly.
+
+5.2.1 API pci_enable_msi
+
+int pci_enable_msi(struct pci_dev *dev)
 
 With this new API, any existing device driver, which like to have
-MSI enabled on its device function, must call this explicitly. A
-successful call will initialize the MSI/MSI-X capability structure
-with ONE vector, regardless of whether the device function is
+MSI enabled on its device function, must call this API to enable MSI
+A successful call will initialize the MSI capability structure
+with ONE vector, regardless of whether a device function is
 capable of supporting multiple messages. This vector replaces the
 pre-assigned dev->irq with a new MSI vector. To avoid the conflict
 of new assigned vector with existing pre-assigned vector requires
-the device driver to call this API before calling request_irq(...).
+a device driver to call this API before calling request_irq().
+
+5.2.2 API pci_disable_msi
+
+void pci_disable_msi(struct pci_dev *dev)
+
+This API should always be used to undo the effect of pci_enable_msi()
+when a device driver is unloading. This API restores dev->irq with
+the pre-assigned IOAPIC vector and switches a device's interrupt
+mode to PCI pin-irq assertion/INTx emulation mode.
+
+Note that a device driver should always call free_irq() on MSI vector
+it has done request_irq() on before calling this API. Failure to do
+so results a BUG_ON() and a device will be left with MSI enabled and
+leaks its vector.
+
+5.2.3 MSI mode vs. legacy mode diagram
 
 The below diagram shows the events, which switches the interrupt
 mode on the MSI-capable device function between MSI mode and
@@ -124,121 +152,274 @@ PIN-IRQ assertion mode.
 	|	     | <===============	| 			 |
 	| MSI MODE   |	  	     	| PIN-IRQ ASSERTION MODE |
 	| 	     | ===============>	|			 |
- 	 ------------	free_irq      	 ------------------------
+ 	 ------------	pci_disable_msi  ------------------------
 
-5.2 Configuring for MSI support
 
-Due to the non-contiguous fashion in vector assignment of the
-existing Linux kernel, this version does not support multiple
-messages regardless of the device function is capable of supporting
-more than one vector. The bus driver initializes only entry 0 of
-this capability if pci_enable_msi(...) is called successfully by
-the device driver.
+Figure 1.0 MSI Mode vs. Legacy Mode
+
+In Figure 1.0, a device operates by default in legacy mode. Legacy
+in this context means PCI pin-irq assertion or PCI-Express INTx
+emulation. A successful MSI request (using pci_enable_msi()) switches
+a device's interrupt mode to MSI mode. A pre-assigned IOAPIC vector
+stored in dev->irq will be saved by the PCI subsystem and a new
+assigned MSI vector will replace dev->irq.
+
+To return back to its default mode, a device driver should always call
+pci_disable_msi() to undo the effect of pci_enable_msi(). Note that a
+device driver should always call free_irq() on MSI vector it has done
+request_irq() on before calling pci_disable_msi(). Failure to do so
+results a BUG_ON() and a device will be left with MSI enabled and
+leaks its vector. Otherwise, the PCI subsystem restores a device's
+dev->irq with a pre-assigned IOAPIC vector and marks released
+MSI vector as unused.
+
+Once being marked as unused, there is no guarantee that the PCI
+subsystem will reserve this MSI vector for a device. Depending on
+the availability of current PCI vector resources and the number of
+MSI/MSI-X requests from other drivers, this MSI may be re-assigned.
+
+For the case where the PCI subsystem re-assigned this MSI vector
+another driver, a request to switching back to MSI mode may result
+in being assigned a different MSI vector or a failure if no more
+vectors are available.
 
 5.3 Configuring for MSI-X support
 
-Both the MSI capability structure and the MSI-X capability structure
-share the same above semantics; however, due to the ability of the
-system software to configure each vector of the MSI-X capability
-structure with an independent message address and message data, the
-non-contiguous fashion in vector assignment of the existing Linux
-kernel has no impact on supporting multiple messages on an MSI-X
-capable device functions. By default, as mentioned above, ONE vector
-should be always allocated to the MSI-X capability structure at
-entry 0. The bus driver does not initialize other entries of the
-MSI-X table.
-
-Note that the PCI subsystem should have full control of a MSI-X
-table that resides in Memory Space. The software device driver
-should not access this table.
-
-To request for additional vectors, the device software driver should
-call function msi_alloc_vectors(). It is recommended that the
-software driver should call this function once during the
+Due to the ability of the system software to configure each vector of
+the MSI-X capability structure with an independent message address
+and message data, the non-contiguous fashion in vector assignment of
+the existing Linux kernel has no impact on supporting multiple
+messages on an MSI-X capable device functions. To enable MSI-X on
+a device function's MSI-X capability structure requires its device
+driver to call the function pci_enable_msix() explicitly.
+
+The function pci_enable_msix(), once invoked, enables either
+all or nothing, depending on the current availability of PCI vector
+resources. If the PCI vector resources are available for the number
+of vectors requested by a device driver, this function will configure
+the MSI-X table of the MSI-X capability structure of a device with
+requested messages. To emphasize this reason, for example, a device
+may be capable for supporting the maximum of 32 vectors while its
+software driver usually may request 4 vectors. It is recommended
+that the device driver should call this function once during the
 initialization phase of the device driver.
 
-The function msi_alloc_vectors(), once invoked, enables either
-all or nothing, depending on the current availability of vector
-resources. If no vector resources are available, the device function
-still works with ONE vector. If the vector resources are available
-for the number of vectors requested by the driver, this function
-will reconfigure the MSI-X capability structure of the device with
-additional messages, starting from entry 1. To emphasize this
-reason, for example, the device may be capable for supporting the
-maximum of 32 vectors while its software driver usually may request
-4 vectors.
-
-For each vector, after this successful call, the device driver is
-responsible to call other functions like request_irq(), enable_irq(),
-etc. to enable this vector with its corresponding interrupt service
-handler. It is the device driver's choice to have all vectors shared
-the same interrupt service handler or each vector with a unique
-interrupt service handler.
-
-In addition to the function msi_alloc_vectors(), another function
-msi_free_vectors() is provided to allow the software driver to
-release a number of vectors back to the vector resources. Once
-invoked, the PCI subsystem disables (masks) each vector released.
-These vectors are no longer valid for the hardware device and its
-software driver to use. Like free_irq, it recommends that the
-device driver should also call msi_free_vectors to release all
-additional vectors previously requested.
-
-int msi_alloc_vectors(struct pci_dev *dev, int *vector, int nvec)
-
-This API enables the software driver to request the PCI subsystem
-for additional messages. Depending on the number of vectors
-available, the PCI subsystem enables either all or nothing.
+Unlike the function pci_enable_msi(), the function pci_enable_msix()
+does not replace the pre-assigned IOAPIC dev->irq with a new MSI
+vector because the PCI subsystem writes the 1:1 vector-to-entry mapping
+into the field vector of each element contained in a second argument.
+Note that the pre-assigned IO-APIC dev->irq is valid only if the device
+operates in PIN-IRQ assertion mode. In MSI-X mode, any attempt of
+using dev->irq by the device driver to request for interrupt service
+may result unpredictabe behavior.
+
+For each MSI-X vector granted, a device driver is responsible to call
+other functions like request_irq(), enable_irq(), etc. to enable
+this vector with its corresponding interrupt service handler. It is
+a device driver's choice to assign all vectors with the same
+interrupt service handler or each vector with a unique interrupt
+service handler.
+
+5.3.1 Handling MMIO address space of MSI-X Table
+
+The PCI 3.0 specification has implementation notes that MMIO address
+space for a device's MSI-X structure should be isolated so that the
+software system can set different page for controlling accesses to
+the MSI-X structure. The implementation of MSI patch requires the PCI
+subsystem, not a device driver, to maintain full control of the MSI-X
+table/MSI-X PBA and MMIO address space of the MSI-X table/MSI-X PBA.
+A device driver is prohibited from requesting the MMIO address space
+of the MSI-X table/MSI-X PBA. Otherwise, the PCI subsystem will fail
+enabling MSI-X on its hardware device when it calls the function
+pci_enable_msix().
+
+5.3.2 Handling MSI-X allocation
+
+Determining the number of MSI-X vectors allocated to a function is
+dependent on the number of MSI capable devices and MSI-X capable
+devices populated in the system. The policy of allocating MSI-X
+vectors to a function is defined as the following:
+
+#of MSI-X vectors allocated to a function = (x - y)/z where
+
+x = 	The number of available PCI vector resources by the time
+	the device driver calls pci_enable_msix(). The PCI vector
+	resources is the sum of the number of unassigned vectors
+	(new) and the number of released vectors when any MSI/MSI-X
+	device driver switches its hardware device back to a legacy
+	mode or is hot-removed.	The number of unassigned vectors
+	may exclude some vectors reserved, as defined in parameter
+	NR_HP_RESERVED_VECTORS, for the case where the system is
+	capable of supporting hot-add/hot-remove operations. Users
+	may change the value defined in NR_HR_RESERVED_VECTORS to
+	meet their specific needs.
+
+y =	The number of MSI capable devices populated in the system.
+	This policy ensures that each MSI capable device has its
+	vector reserved to avoid the case where some MSI-X capable
+	drivers may attempt to claim all available vector resources.
+
+z =	The number of MSI-X capable devices pupulated in the system.
+	This policy ensures that maximum (x - y) is distributed
+	evenly among MSI-X capable devices.
+
+Note that the PCI subsystem scans y and z during a bus enumeration.
+When the PCI subsystem completes configuring MSI/MSI-X capability
+structure of a device as requested by its device driver, y/z is
+decremented accordingly.
+
+5.3.3 Handling MSI-X shortages
+
+For the case where fewer MSI-X vectors are allocated to a function
+than requested, the function pci_enable_msix() will return the
+maximum number of MSI-X vectors available to the caller. A device
+driver may re-send its request with fewer or equal vectors indicated
+in a return. For example, if a device driver requests 5 vectors, but
+the number of available vectors is 3 vectors, a value of 3 will be a
+return as a result of pci_enable_msix() call. A function could be
+designed for its driver to use only 3 MSI-X table entries as
+different combinations as ABC--, A-B-C, A--CB, etc. Note that this
+patch does not support multiple entries with the same vector. Such
+attempt by a device driver to use 5 MSI-X table entries with 3 vectors
+as ABBCC, AABCC, BCCBA, etc will result as a failure by the function
+pci_enable_msix(). Below are the reasons why supporting multiple
+entries with the same vector is an undesirable solution.
+
+	- The PCI subsystem can not determine which entry, which
+	  generated the message, to mask/unmask MSI while handling
+	  software driver ISR. Attempting to walk through all MSI-X
+	  table entries (2048 max) to mask/unmask any match vector
+	  is an undesirable solution.
+
+	- Walk through all MSI-X table entries (2048 max) to handle
+	  SMP affinity of any match vector is an undesirable solution.
+
+5.3.4 API pci_enable_msix
+
+int pci_enable_msix(struct pci_dev *dev, u32 *entries, int nvec)
+
+This API enables a device driver to request the PCI subsystem
+for enabling MSI-X messages on its hardware device. Depending on
+the availability of PCI vectors resources, the PCI subsystem enables
+either all or nothing.
 
 Argument dev points to the device (pci_dev) structure.
-Argument vector is a pointer of integer type. The number of
-elements is indicated in argument nvec.
+
+Argument entries is a pointer of unsigned integer type. The number of
+elements is indicated in argument nvec. The content of each element
+will be mapped to the following struct defined in /driver/pci/msi.h.
+
+struct msix_entry {
+	u16 	vector; /* kernel uses to write alloc vector */
+	u16	entry; /* driver uses to specify entry */
+};
+
+A device driver is responsible for initializing the field entry of
+each element with unique entry supported by MSI-X table. Otherwise,
+-EINVAL will be returned as a result. A successful return of zero
+indicates the PCI subsystem completes initializing each of requested
+entries of the MSI-X table with message address and message data.
+Last but not least, the PCI subsystem will write the 1:1
+vector-to-entry mapping into the field vector of each element. A
+device driver is responsible of keeping track of allocated MSI-X
+vectors in its internal data structure.
+
 Argument nvec is an integer indicating the number of messages
 requested.
-A return of zero indicates that the number of allocated vector is
-successfully allocated. Otherwise, indicate resources not
-available.
 
-int msi_free_vectors(struct pci_dev* dev, int *vector, int nvec)
+A return of zero indicates that the number of MSI-X vectors is
+successfully allocated. A return of greater than zero indicates
+MSI-X vector shortage. Or a return of less than zero indicates
+a failure. This failure may be a result of duplicate entries
+specified in second argument, or a result of no available vector,
+or a result of failing to initialize MSI-X table entries.
 
-This API enables the software driver to inform the PCI subsystem
-that it is willing to release a number of vectors back to the
-MSI resource pool. Once invoked, the PCI subsystem disables each
-MSI-X entry associated with each vector stored in the argument 2.
-These vectors are no longer valid for the hardware device and
-its software driver to use.
+5.3.5 API pci_disable_msix
 
-Argument dev points to the device (pci_dev) structure.
-Argument vector is a pointer of integer type. The number of
-elements is indicated in argument nvec.
-Argument nvec is an integer indicating the number of messages
-released.
-A return of zero indicates that the number of allocated vectors
-is successfully released. Otherwise, indicates a failure.
+void pci_disable_msix(struct pci_dev *dev)
 
-5.4 Hardware requirements for MSI support
-MSI support requires support from both system hardware and
+This API should always be used to undo the effect of pci_enable_msix()
+when a device driver is unloading. Note that a device driver should
+always call free_irq() on all MSI-X vectors it has done request_irq()
+on before calling this API. Failure to do so results a BUG_ON() and
+a device will be left with MSI-X enabled and leaks its vectors.
+
+5.3.6 MSI-X mode vs. legacy mode diagram
+
+The below diagram shows the events, which switches the interrupt
+mode on the MSI-X capable device function between MSI-X mode and
+PIN-IRQ assertion mode (legacy).
+
+	 ------------   pci_enable_msix(,,n) ------------------------
+	|	     | <===============	    | 			     |
+	| MSI-X MODE |	  	     	    | PIN-IRQ ASSERTION MODE |
+	| 	     | ===============>	    |			     |
+ 	 ------------	pci_disable_msix     ------------------------
+
+Figure 2.0 MSI-X Mode vs. Legacy Mode
+
+In Figure 2.0, a device operates by default in legacy mode. A
+successful MSI-X request (using pci_enable_msix()) switches a
+device's interrupt mode to MSI-X mode. A pre-assigned IOAPIC vector
+stored in dev->irq will be saved by the PCI subsystem; however,
+unlike MSI mode, the PCI subsystem will not replace dev->irq with
+assigned MSI-X vector because the PCI subsystem already writes the 1:1
+vector-to-entry mapping into the field vector of each element
+specified in second argument.
+
+To return back to its default mode, a device driver should always call
+pci_disable_msix() to undo the effect of pci_enable_msix(). Note that
+a device driver should always call free_irq() on all MSI-X vectors it
+has done request_irq() on before calling pci_disable_msix(). Failure
+to do so results a BUG_ON() and a device will be left with MSI-X
+enabled and leaks its vectors. Otherwise, the PCI subsystem switches a
+device function's interrupt mode from MSI-X mode to legacy mode and
+marks all allocated MSI-X vectors as unused.
+
+Once being marked as unused, there is no guarantee that the PCI
+subsystem will reserve these MSI-X vectors for a device. Depending on
+the availability of current PCI vector resources and the number of
+MSI/MSI-X requests from other drivers, these MSI-X vectors may be
+re-assigned.
+
+For the case where the PCI subsystem re-assigned these MSI-X vectors
+to other driver, a request to switching back to MSI-X mode may result
+being assigned with another set of MSI-X vectors or a failure if no
+more vectors are available.
+
+5.4 Handling function implementng both MSI and MSI-X capabilities
+
+For the case where a function implements both MSI and MSI-X
+capabilities, the PCI subsystem enables a device to run either in MSI
+mode or MSI-X mode but not both. A device driver determines whether it
+wants MSI or MSI-X enabled on its hardware device. Once a device
+driver requests for MSI, for example, it is prohibited to request for
+MSI-X; in other words, a device driver is not permitted to ping-pong
+between MSI mod MSI-X mode during a run-time.
+
+5.5 Hardware requirements for MSI/MSI-X support
+MSI/MSI-X support requires support from both system hardware and
 individual hardware device functions.
 
-5.4.1 System hardware support
+5.5.1 System hardware support
 Since the target of MSI address is the local APIC CPU, enabling
-MSI support in Linux kernel is dependent on whether existing
+MSI/MSI-X support in Linux kernel is dependent on whether existing
 system hardware supports local APIC. Users should verify their
 system whether it runs when CONFIG_X86_LOCAL_APIC=y.
 
 In SMP environment, CONFIG_X86_LOCAL_APIC is automatically set;
 however, in UP environment, users must manually set
 CONFIG_X86_LOCAL_APIC. Once CONFIG_X86_LOCAL_APIC=y, setting
-CONFIG_PCI_USE_VECTOR enables the VECTOR based scheme and
+CONFIG_PCI_MSI enables the VECTOR based scheme and
 the option for MSI-capable device drivers to selectively enable
-MSI (using pci_enable_msi as described below).
+MSI/MSI-X.
 
-Note that CONFIG_X86_IO_APIC setting is irrelevant because MSI
-vector is allocated new during runtime and MSI support does not
-depend on BIOS support. This key independency enables MSI support
-on future IOxAPIC free platform.
+Note that CONFIG_X86_IO_APIC setting is irrelevant because MSI/MSI-X
+vector is allocated new during runtime and MSI/MSI-X support does not
+depend on BIOS support. This key independency enables MSI/MSI-X
+support on future IOxAPIC free platform.
 
-5.4.2 Device hardware support
+5.5.2 Device hardware support
 The hardware device function supports MSI by indicating the
 MSI/MSI-X capability structure on its PCI capability list. By
 default, this capability structure will not be initialized by
@@ -249,17 +430,19 @@ which may result in system hang. The software driver of specific
 MSI-capable hardware is responsible for whether calling
 pci_enable_msi or not. A return of zero indicates the kernel
 successfully initializes the MSI/MSI-X capability structure of the
-device funtion. The device function is now running on MSI mode.
+device funtion. The device function is now running on MSI/MSI-X mode.
 
-5.5 How to tell whether MSI is enabled on device function
+5.6 How to tell whether MSI/MSI-X is enabled on device function
 
-At the driver level, a return of zero from pci_enable_msi(...)
-indicates to the device driver that its device function is
-initialized successfully and ready to run in MSI mode.
+At the driver level, a return of zero from the function call of
+pci_enable_msi()/pci_enable_msix() indicates to a device driver that
+its device function is initialized successfully and ready to run in
+MSI/MSI-X mode.
 
 At the user level, users can use command 'cat /proc/interrupts'
-to display the vector allocated for the device and its interrupt
-mode, as shown below.
+to display the vector allocated for a device and its interrupt
+MSI/MSI-X mode ("PCI MSI"/"PCI MSIX"). Below shows below MSI mode is
+enabled on a SCSI Adaptec 39320D Ultra320.
 
            CPU0       CPU1
   0:     324639          0    IO-APIC-edge  timer
diff --git a/Documentation/SubmittingDrivers b/Documentation/SubmittingDrivers
index 293591a88..2630629d7 100644
--- a/Documentation/SubmittingDrivers
+++ b/Documentation/SubmittingDrivers
@@ -3,7 +3,8 @@ Submitting Drivers For The Linux Kernel
 
 This document is intended to explain how to submit device drivers to the
 various kernel trees. Note that if you are interested in video card drivers
-you should probably talk to XFree86 (http://www.xfree86.org) instead.
+you should probably talk to XFree86 (http://www.xfree86.org/) and/or X.Org
+(http://x.org/) instead.
 
 Also read the Documentation/SubmittingPatches document.
 
diff --git a/Documentation/arm/Booting b/Documentation/arm/Booting
index c9feb2d5c..a851d039a 100644
--- a/Documentation/arm/Booting
+++ b/Documentation/arm/Booting
@@ -50,7 +50,7 @@ As an alternative, the boot loader can pass the relevant 'console='
 option to the kernel via the tagged lists specifying the port, and
 serial format options as described in
 
-       linux/Documentation/kernel-parameters.txt.
+       Documentation/kernel-parameters.txt.
 
 
 3. Detect the machine type
diff --git a/Documentation/basic_profiling.txt b/Documentation/basic_profiling.txt
index cd3b422cc..65e3dc2d4 100644
--- a/Documentation/basic_profiling.txt
+++ b/Documentation/basic_profiling.txt
@@ -5,16 +5,19 @@ Thanks to John Levon, Dave Hansen, et al. for help writing this.
 
 <test> is the thing you're trying to measure.
 Make sure you have the correct System.map / vmlinux referenced!
-IMHO it's easier to use "make install" for linux and hack /sbin/installkernel
-to copy config files, system.map, vmlinux to /boot.
+
+It is probably easiest to use "make install" for linux and hack
+/sbin/installkernel to copy vmlinux to /boot, in addition to vmlinuz,
+config, System.map, which are usually installed by default.
 
 Readprofile
 -----------
-You need a fixed readprofile command for 2.5 ... either get hold of
-a current version from:
+A recent readprofile command is needed for 2.6, such as found in util-linux
+2.12a, which can be downloaded from:
+
 http://www.kernel.org/pub/linux/utils/util-linux/
-or get readprofile binary fixed for 2.5 / akpm's 2.5 patch from 
-ftp://ftp.kernel.org/pub/linux/kernel/people/mbligh/tools/readprofile/
+
+Most distributions will ship it already.
 
 Add "profile=2" to the kernel command line.
 
@@ -24,25 +27,26 @@ dump output	readprofile -m /boot/System.map > captured_profile
 
 Oprofile
 --------
-get source (I use 0.5) from http://oprofile.sourceforge.net/
-add "idle=poll" to the kernel command line 
+Get the source (I use 0.8) from http://oprofile.sourceforge.net/
+and add "idle=poll" to the kernel command line
 Configure with CONFIG_PROFILING=y and CONFIG_OPROFILE=y & reboot on new kernel
 ./configure --with-kernel-support
 make install
 
-One time setup (pick appropriate one for your CPU):
-P3		opcontrol --setup --vmlinux=/boot/vmlinux \
-		--ctr0-event=CPU_CLK_UNHALTED --ctr0-count=100000
-Athlon/x86-64	opcontrol --setup --vmlinux=/boot/vmlinux \
-		--ctr0-event=RETIRED_INSNS --ctr0-count=100000
-P4		opcontrol --setup --vmlinux=/boot/vmlinux \
-		--ctr0-event=GLOBAL_POWER_EVENTS \
-		--ctr0-unit-mask=1 --ctr0-count=100000
+For superior results, be sure to enable the local APIC. If opreport sees
+a 0Hz CPU, APIC was not on. Be aware that idle=poll may mean a performance
+penalty.
+
+One time setup:
+		opcontrol --setup --vmlinux=/boot/vmlinux
 
-start daemon	opcontrol --start-daemon
 clear		opcontrol --reset
 start		opcontrol --start
 		<test>
 stop		opcontrol --stop
-dump output	oprofpp -dl -i /boot/vmlinux  >  output_file
+dump output	opreport >  output_file
+
+To only report on the kernel, run opreport /boot/vmlinux > output_file
+
+A reset is needed to clear old statistics, which survive a reboot.
 
diff --git a/Documentation/binfmt_misc.txt b/Documentation/binfmt_misc.txt
index 3de8edbe6..d097f09ee 100644
--- a/Documentation/binfmt_misc.txt
+++ b/Documentation/binfmt_misc.txt
@@ -15,7 +15,7 @@ First you must mount binfmt_misc:
 	mount binfmt_misc -t binfmt_misc /proc/sys/fs/binfmt_misc 
 
 To actually register a new binary type, you have to set up a string looking like
-:name:type:offset:magic:mask:interpreter: (where you can choose the ':' upon
+:name:type:offset:magic:mask:interpreter:flags (where you can choose the ':' upon
 your needs) and echo it to /proc/sys/fs/binfmt_misc/register.
 Here is what the fields mean:
  - 'name' is an identifier string. A new /proc file will be created with this
@@ -34,6 +34,28 @@ Here is what the fields mean:
    The mask is anded with the byte sequence of the file.
  - 'interpreter' is the program that should be invoked with the binary as first
    argument (specify the full path)
+ - 'flags' is an optional field that controls several aspects of the invocation
+   of the interpreter. It is a string of capital letters, each controls a certain
+   aspect. The following flags are supported -
+      'P' - preserve-argv[0].  Legacy behavior of binfmt_misc is to overwrite the
+            original argv[0] with the full path to the binary.  When this flag is
+            included, binfmt_misc will add an argument to the argument vector for
+            this purpose, thus preserving the original argv[0].
+      'O' - open-binary. Legacy behavior of binfmt_misc is to pass the full path
+            of the binary to the interpreter as an argument. When this flag is
+            included, binfmt_misc will open the file for reading and pass its
+            descriptor as an argument, instead of the full path, thus allowing
+            the interpreter to execute non-readable binaries. This feature should
+            be used with care - the interpreter has to be trusted not to emit
+            the contents of the non-readable binary.
+      'C' - credentials. Currently, the behavior of binfmt_misc is to calculate
+            the credentials and security token of the new process according to
+            the interpreter. When this flag is included, these attributes are
+            calculated according to the binary. It also implies the 'O' flag.
+            This feature should be used with care as the interpreter
+            will run with root permissions when a setuid binary owned by root
+            is run with binfmt_misc.
+
 
 There are some restrictions:
  - the whole register string may not exceed 255 characters
@@ -83,9 +105,9 @@ If you want to pass special arguments to your interpreter, you can
 write a wrapper script for it. See Documentation/java.txt for an
 example.
 
-Your interpreter should NOT look in the PATH for the filename; the
-kernel passes it the full filename to use.  Using the PATH can cause
-unexpected behaviour and be a security hazard.
+Your interpreter should NOT look in the PATH for the filename; the kernel
+passes it the full filename (or the file descriptor) to use.  Using $PATH can
+cause unexpected behaviour and can be a security hazard.
 
 
 There is a web page about binfmt_misc at
diff --git a/Documentation/cachetlb.txt b/Documentation/cachetlb.txt
index 98e4c6c73..26bb2b405 100644
--- a/Documentation/cachetlb.txt
+++ b/Documentation/cachetlb.txt
@@ -132,6 +132,17 @@ changes occur:
 	translations for software managed TLB configurations.
 	The sparc64 port currently does this.
 
+7) void tlb_migrate_finish(struct mm_struct *mm)
+
+	This interface is called at the end of an explicit
+	process migration. This interface provides a hook
+	to allow a platform to update TLB or context-specific
+	information for the address space.
+
+	The ia64 sn2 platform is one example of a platform
+	that uses this interface.
+
+
 Next, we have the cache flushing interfaces.  In general, when Linux
 is changing an existing virtual-->physical mapping to a new value,
 the sequence will be in one of the following forms:
diff --git a/Documentation/cdrom/aztcd b/Documentation/cdrom/aztcd
index cdf46687d..6bf0290ef 100644
--- a/Documentation/cdrom/aztcd
+++ b/Documentation/cdrom/aztcd
@@ -1,5 +1,5 @@
 $Id: README.aztcd,v 2.60 1997/11/29 09:51:25 root Exp root $
-          Readme-File /usr/src/Documentation/cdrom/aztcd
+          Readme-File Documentation/cdrom/aztcd
            			for 
 	     AZTECH CD-ROM CDA268-01A, ORCHID CD-3110,
       OKANO/WEARNES CDD110, CONRAD TXC, CyCDROM CR520, CR540
@@ -524,7 +524,7 @@ should try restoring from a backup copy first)!
 
 A reworked and improved version called 'cdtester.c', which has yet more
 features for testing CDROM-drives can be found in
-/usr/src/linux/Documentation/cdrom/sbpcd, written by E.Moenkeberg.
+Documentation/cdrom/sbpcd, written by E.Moenkeberg.
 
 Werner Zimmermann
 Fachhochschule fuer Technik Esslingen
diff --git a/Documentation/computone.txt b/Documentation/computone.txt
index fb186e04f..ea2b5d3e3 100644
--- a/Documentation/computone.txt
+++ b/Documentation/computone.txt
@@ -302,7 +302,7 @@ shar archive to make it easier to extract the script from the documentation.
 To create the ip2mkdev shell script change to a convenient directory (/tmp
 works just fine) and run the following command:
 
-	unshar /usr/src/linux/Documentation/computone.txt
+	unshar Documentation/computone.txt
 		(This file)
 
 You should now have a file ip2mkdev in your current working directory with
diff --git a/Documentation/crypto/api-intro.txt b/Documentation/crypto/api-intro.txt
index d279875f4..1df474c4e 100644
--- a/Documentation/crypto/api-intro.txt
+++ b/Documentation/crypto/api-intro.txt
@@ -215,10 +215,18 @@ AES algorithm contributors:
   Herbert Valerio Riedel
   Kyle McMartin
   Adam J. Richter
+  Fruhwirth Clemens (i586)
+  Linus Torvalds (i586)
 
 CAST5 algorithm contributors:
   Kartikey Mahendra Bhatt (original developers unknown, FSF copyright).
 
+TEA/XTEA algorithm contributors:
+  Aaron Grothe
+
+Khazad algorithm contributors:
+  Aaron Grothe
+
 Generic scatterwalk code by Adam J. Richter <adam@yggdrasil.com>
 
 Please send any credits updates or corrections to:
diff --git a/Documentation/devices.txt b/Documentation/devices.txt
index d5ee998d6..954e49636 100644
--- a/Documentation/devices.txt
+++ b/Documentation/devices.txt
@@ -434,6 +434,7 @@ Your cooperation is appreciated.
 		225 = /dev/pps		Pulse Per Second driver
 		226 = /dev/systrace	Systrace device
 		227 = /dev/mcelog	X86_64 Machine Check Exception driver
+		228 = /dev/hpet		HPET driver
 		240-254			Reserved for local use
 		255			Reserved for MISC_DYNAMIC_MINOR
 
@@ -2377,16 +2378,16 @@ Your cooperation is appreciated.
 		  1 = /dev/gpib1	Second GPIB bus
 		    ...
 
-160 block       Carmel 8-port SATA Disks on First Controller
-		  0 = /dev/carmel/0     SATA disk 0 whole disk
-		  1 = /dev/carmel/0p1   SATA disk 0 partition 1
+160 block       Promise SX8 8-port SATA Disks on First Controller
+		  0 = /dev/sx8/0     SATA disk 0 whole disk
+		  1 = /dev/sx8/0p1   SATA disk 0 partition 1
 		    ...
-		 31 = /dev/carmel/0p31  SATA disk 0 partition 31
+		 31 = /dev/sx8/0p31  SATA disk 0 partition 31
 
-		 32 = /dev/carmel/1     SATA disk 1 whole disk
-		 64 = /dev/carmel/2     SATA disk 2 whole disk
+		 32 = /dev/sx8/1     SATA disk 1 whole disk
+		 64 = /dev/sx8/2     SATA disk 2 whole disk
 		    ...
-		224 = /dev/carmel/7     SATA disk 7 whole disk
+		224 = /dev/sx8/7     SATA disk 7 whole disk
 
 		Partitions are handled in the same way as for IDE
 		disks (see major number 3) except that the limit on
@@ -2400,16 +2401,16 @@ Your cooperation is appreciated.
 		 17 = /dev/irlpt1	Second IrLPT device
 		    ...
 
-161 block       Carmel 8-port SATA Disks on Second Controller
-		  0 = /dev/carmel/8     SATA disk 8 whole disk
-		  1 = /dev/carmel/8p1   SATA disk 8 partition 1
+161 block       Promise SX8 8-port SATA Disks on Second Controller
+		  0 = /dev/sx8/8     SATA disk 8 whole disk
+		  1 = /dev/sx8/8p1   SATA disk 8 partition 1
 		    ...
-		 31 = /dev/carmel/8p31  SATA disk 8 partition 31
+		 31 = /dev/sx8/8p31  SATA disk 8 partition 31
 
-		 32 = /dev/carmel/9     SATA disk 9 whole disk
-		 64 = /dev/carmel/10    SATA disk 10 whole disk
+		 32 = /dev/sx8/9     SATA disk 9 whole disk
+		 64 = /dev/sx8/10    SATA disk 10 whole disk
 		    ...
-		224 = /dev/carmel/15    SATA disk 15 whole disk
+		224 = /dev/sx8/15    SATA disk 15 whole disk
 
 		Partitions are handled in the same way as for IDE
 		disks (see major number 3) except that the limit on
@@ -2718,6 +2719,7 @@ Your cooperation is appreciated.
 		 32 = /dev/ttyDB0		DataBooster serial port 0
 		    ...
 		 39 = /dev/ttyDB7		DataBooster serial port 7
+		 40 = /dev/ttySG0		SGI Altix console port
 
 205 char	Low-density serial ports (alternate device)
 		  0 = /dev/culu0		Callout device for ttyLU0
@@ -2742,6 +2744,7 @@ Your cooperation is appreciated.
 		 32 = /dev/cudb0		Callout device for ttyDB0
 		    ...
 		 39 = /dev/cudb7		Callout device for ttyDB7
+		 40 = /dev/cusg0		Callout device for ttySG0
 
 206 char	OnStream SC-x0 tape devices
 		  0 = /dev/osst0		First OnStream SCSI tape, mode 0
diff --git a/Documentation/digiepca.txt b/Documentation/digiepca.txt
index 008457263..01c4adc59 100644
--- a/Documentation/digiepca.txt
+++ b/Documentation/digiepca.txt
@@ -60,7 +60,7 @@ Samples:
 Supporting Tools:
 -----------------
 Supporting tools include digiDload, digiConfig, buildPCI, and ditty.  See
-/usr/src/linux/Documentation/README.epca.dir/user.doc for more details.  Note,
+drivers/char/README.epca for more details.  Note,
 this driver REQUIRES that digiDload be executed prior to it being used. 
 Failure to do this will result in an ENODEV error.
 
diff --git a/Documentation/dvb/firmware.txt b/Documentation/dvb/firmware.txt
index 0991c0c1f..37d880794 100644
--- a/Documentation/dvb/firmware.txt
+++ b/Documentation/dvb/firmware.txt
@@ -2,7 +2,7 @@ Some DVB cards and many newer frontends require proprietary,
 binary-only firmware.
 
 The DVB drivers will be converted to use the request_firmware()
-hotplug interface (see linux/Documentation/firmware_class/).
+hotplug interface (see Documentation/firmware_class/).
 (CONFIG_FW_LOADER)
 
 The firmware can be loaded automatically via the hotplug manager
diff --git a/Documentation/dvb/ttusb-dec.txt b/Documentation/dvb/ttusb-dec.txt
index b8e24995c..4a547fba7 100644
--- a/Documentation/dvb/ttusb-dec.txt
+++ b/Documentation/dvb/ttusb-dec.txt
@@ -57,7 +57,7 @@ mv STB_PC_S.bin build-2.4/dvb-ttusb-dec-3000s.fw
 Hotplug Firmware Loading for 2.6 kernels
 ----------------------------------------
 For 2.6 kernels the firmware is loaded at the point that the driver module is
-loaded.  See linux/Documentation/dvb/firmware.txt for more information.
+loaded.  See Documentation/dvb/firmware.txt for more information.
 
 mv STB_PC_T.bin /usr/lib/hotplug/firmware/dvb-ttusb-dec-2000t.fw
 mv STB_PC_X.bin /usr/lib/hotplug/firmware/dvb-ttusb-dec-2540t.fw
diff --git a/Documentation/filesystems/Locking b/Documentation/filesystems/Locking
index e0ef1f80f..1c465edd2 100644
--- a/Documentation/filesystems/Locking
+++ b/Documentation/filesystems/Locking
@@ -349,6 +349,8 @@ prototypes:
 			loff_t *, int);
 	unsigned long (*get_unmapped_area)(struct file *, unsigned long,
 			unsigned long, unsigned long, unsigned long);
+	int (*check_flags)(int);
+	int (*dir_notify)(struct file *, unsigned long);
 };
 
 locking rules:
@@ -375,6 +377,8 @@ writev:			no
 sendfile:		no
 sendpage:		no
 get_unmapped_area:	no
+check_flags:		no
+dir_notify:		no
 
 ->llseek() locking has moved from llseek to the individual llseek
 implementations.  If your fs is not using generic_file_llseek, you
diff --git a/Documentation/filesystems/hpfs.txt b/Documentation/filesystems/hpfs.txt
index be65317bc..33dc360c8 100644
--- a/Documentation/filesystems/hpfs.txt
+++ b/Documentation/filesystems/hpfs.txt
@@ -1,5 +1,5 @@
-Read/Write HPFS 2.05
-1998-2001, Mikulas Patocka
+Read/Write HPFS 2.09
+1998-2004, Mikulas Patocka
 
 email: mikulas@artax.karlin.mff.cuni.cz
 homepage: http://artax.karlin.mff.cuni.cz/~mikulas/vyplody/hpfs/index-e.cgi
@@ -283,6 +283,14 @@ History
 2.05 Fixed crash when got mount parameters without =
      Fixed crash when allocation of anode failed due to full disk
      Fixed some crashes when block io or inode allocation failed
+2.06 Fixed some crash on corrupted disk structures
+     Better allocation strategy
+     Reschedule points added so that it doesn't lock CPU long time
+     It should work in read-only mode on Warp Server
+2.07 More fixes for Warp Server. Now it really works
+2.08 Creating new files is not so slow on large disks
+     An attempt to sync deleted file does not generate filesystem error
+2.09 Fixed error on extremly fragmented files
 
 
  vim: set textwidth=80:
diff --git a/Documentation/filesystems/ntfs.txt b/Documentation/filesystems/ntfs.txt
index 018ec9693..200862dd6 100644
--- a/Documentation/filesystems/ntfs.txt
+++ b/Documentation/filesystems/ntfs.txt
@@ -273,6 +273,10 @@ ChangeLog
 
 Note, a technical ChangeLog aimed at kernel hackers is in fs/ntfs/ChangeLog.
 
+2.1.15:
+	- Invalidate quotas when (re)mounting read-write.
+	  NOTE:  This now only leave user space journalling on the side.  (See
+	  note for version 2.1.13, below.)
 2.1.14:
 	- Fix an NFSd caused deadlock reported by several users.
 2.1.13:
diff --git a/Documentation/filesystems/proc.txt b/Documentation/filesystems/proc.txt
index bc552015b..9d626596d 100644
--- a/Documentation/filesystems/proc.txt
+++ b/Documentation/filesystems/proc.txt
@@ -201,7 +201,7 @@ Table 1-3: Kernel info in /proc
  devices     Available devices (block and character)           
  dma         Used DMS channels                                 
  filesystems Supported filesystems                             
- driver	     Various drivers grouped here, currently rtc	(2.4)
+ driver	     Various drivers grouped here, currently rtc (2.4)
  execdomains Execdomains, related to security			(2.4)
  fb	     Frame Buffer devices				(2.4)
  fs	     File system parameters, currently nfs/exports	(2.4)
@@ -1115,6 +1115,18 @@ program to load modules on demand.
 The files  in  this directory can be used to tune the operation of the virtual
 memory (VM)  subsystem  of  the  Linux  kernel.
 
+vfs_cache_pressure
+------------------
+
+Controls the tendency of the kernel to reclaim the memory which is used for
+caching of directory and inode objects.
+
+At the default value of vfs_cache_pressure=100 the kernel will attempt to
+reclaim dentries and inodes at a "fair" rate with respect to pagecache and
+swapcache reclaim.  Decreasing vfs_cache_pressure causes the kernel to prefer
+to retain dentry and inode caches.  Increasing vfs_cache_pressure beyond 100
+causes the kernel to prefer to reclaim dentries and inodes.
+
 dirty_background_ratio
 ----------------------
 
@@ -1220,6 +1232,18 @@ nr_hugepages configures number of hugetlb page reserved for the system.
 hugetlb_shm_group contains group id that is allowed to create SysV shared
 memory segment using hugetlb page.
 
+laptop_mode
+-----------
+
+laptop_mode is a knob that controls "laptop mode". All the things that are
+controlled by this knob are discussed in Documentation/laptop-mode.txt.
+
+block_dump
+----------
+
+block_dump enables block I/O debugging when set to a nonzero value. More
+information on block I/O debugging is in Documentation/laptop-mode.txt.
+
 2.5 /proc/sys/dev - Device specific parameters
 ----------------------------------------------
 
@@ -1640,7 +1664,8 @@ flush
 
 Writing to this file results in a flush of the routing cache.
 
-gc_elastic, gc_interval, gc_min_interval, gc_tresh, gc_timeout
+gc_elasticity, gc_interval, gc_min_interval, gc_tresh, gc_timeout,
+gc_thresh, gc_thresh1, gc_thresh2, gc_thresh3
 --------------------------------------------------------------
 
 Values to  control  the  frequency  and  behavior  of  the  garbage collection
diff --git a/Documentation/filesystems/udf.txt b/Documentation/filesystems/udf.txt
index a0bb3b230..e5213bc30 100644
--- a/Documentation/filesystems/udf.txt
+++ b/Documentation/filesystems/udf.txt
@@ -1,5 +1,5 @@
 *
-* ./Documentation/filesystems/udf.txt
+* Documentation/filesystems/udf.txt
 *
 UDF Filesystem version 0.9.8.1
 
diff --git a/Documentation/filesystems/vfat.txt b/Documentation/filesystems/vfat.txt
index e41109f88..5ead20c6c 100644
--- a/Documentation/filesystems/vfat.txt
+++ b/Documentation/filesystems/vfat.txt
@@ -10,23 +10,35 @@ VFAT MOUNT OPTIONS
 ----------------------------------------------------------------------
 umask=###     -- The permission mask (for files and directories, see umask(1)).
                  The default is the umask of current process.
+
 dmask=###     -- The permission mask for the directory.
                  The default is the umask of current process.
+
 fmask=###     -- The permission mask for files.
                  The default is the umask of current process.
-codepage=###  -- Sets the codepage for converting to shortname characters
-		 on FAT and VFAT filesystems.  By default, codepage 437
-		 is used.  This is the default for the U.S. and some
-		 European countries.
-iocharset=name -- Character set to use for converting between 8 bit characters
-		 and 16 bit Unicode characters. Long filenames are stored on
-		 disk in Unicode format, but Unix for the most part doesn't
-		 know how to deal with Unicode. There is also an option of
-		 doing UTF8 translations with the utf8 option.
+
+codepage=###  -- Sets the codepage number for converting to shortname
+		 characters on FAT filesystem.
+		 By default, FAT_DEFAULT_CODEPAGE setting is used.
+
+iocharset=name -- Character set to use for converting between the
+		 encoding is used for user visible filename and 16 bit
+		 Unicode characters. Long filenames are stored on disk
+		 in Unicode format, but Unix for the most part doesn't
+		 know how to deal with Unicode.
+		 By default, FAT_DEFAULT_IOCHARSET setting is used.
+
+		 There is also an option of doing UTF8 translations
+		 with the utf8 option.
+
+		 NOTE: "iocharset=utf8" is not recommended. If unsure,
+		 you should consider the following option instead.
+
 utf8=<bool>   -- UTF8 is the filesystem safe version of Unicode that
 		 is used by the console.  It can be be enabled for the
 		 filesystem with this option. If 'uni_xlate' gets set,
 		 UTF8 gets disabled.
+
 uni_xlate=<bool> -- Translate unhandled Unicode characters to special
 		 escaped sequences.  This would let you backup and
 		 restore filenames that are created with any Unicode
@@ -37,6 +49,7 @@ uni_xlate=<bool> -- Translate unhandled Unicode characters to special
 		 illegal on the vfat filesystem.  The escape sequence
 		 that gets used is ':' and the four digits of hexadecimal
 		 unicode.
+
 nonumtail=<bool> -- When creating 8.3 aliases, normally the alias will
                  end in '~1' or tilde followed by some number.  If this
                  option is set, then if the filename is 
@@ -45,6 +58,7 @@ nonumtail=<bool> -- When creating 8.3 aliases, normally the alias will
                  be the short alias instead of 'longfi~1.txt'. 
                   
 quiet         -- Stops printing certain warning messages.
+
 check=s|r|n   -- Case sensitivity checking setting.
                  s: strict, case sensitive
                  r: relaxed, case insensitive
diff --git a/Documentation/hpet.txt b/Documentation/hpet.txt
index 584ebc277..4e7cc8d33 100644
--- a/Documentation/hpet.txt
+++ b/Documentation/hpet.txt
@@ -103,7 +103,7 @@ hpet_open_close(int argc, const char **argv)
 		return;
 	}
 
-	fd = open(argv[0], O_RDWR);
+	fd = open(argv[0], O_RDONLY);
 	if (fd < 0)
 		fprintf(stderr, "hpet_open_close: open failed\n");
 	else
@@ -136,7 +136,7 @@ hpet_poll(int argc, const char **argv)
 	freq = atoi(argv[1]);
 	iterations = atoi(argv[2]);
 
-	fd = open(argv[0], O_RDWR);
+	fd = open(argv[0], O_RDONLY);
 
 	if (fd < 0) {
 		fprintf(stderr, "hpet_poll: open of %s failed\n", argv[0]);
@@ -230,7 +230,7 @@ hpet_fasync(int argc, const char **argv)
 		goto out;
 	}
 
-	fd = open(argv[0], O_RDWR);
+	fd = open(argv[0], O_RDONLY);
 
 	if (fd < 0) {
 		fprintf(stderr, "hpet_fasync: failed to open %s\n", argv[0]);
diff --git a/Documentation/i386/boot.txt b/Documentation/i386/boot.txt
index 6b4ddf9c3..afa6d1299 100644
--- a/Documentation/i386/boot.txt
+++ b/Documentation/i386/boot.txt
@@ -334,7 +334,7 @@ They should normally not be deleted from the kernel command line even
 though not all of them are actually meaningful to the kernel.  Boot
 loader authors who need additional command line options for the boot
 loader itself should get them registered in
-linux/Documentation/kernel-parameters.txt to make sure they will not
+Documentation/kernel-parameters.txt to make sure they will not
 conflict with actual kernel options now or in the future.
 
   vga=<mode>
diff --git a/Documentation/i386/zero-page.txt b/Documentation/i386/zero-page.txt
index 8d2a1f173..bbdf7261e 100644
--- a/Documentation/i386/zero-page.txt
+++ b/Documentation/i386/zero-page.txt
@@ -38,6 +38,7 @@ Offset	Type		Description
 0x1e0	unsigned long	ALT_MEM_K, alternative mem check, in Kb
 0x1e8	char		number of entries in E820MAP (below)
 0x1e9	unsigned char	number of entries in EDDBUF (below)
+0x1ea	unsigned char	number of entries in EDD_MBR_SIG_BUFFER (below)
 0x1f1	char		size of setup.S, number of sectors
 0x1f2	unsigned short	MOUNT_ROOT_RDONLY (if !=0)
 0x1f4	unsigned short	size of compressed kernel-part in the
@@ -72,7 +73,7 @@ Offset	Type		Description
 0x21c	unsigned long	INITRD_SIZE, size in bytes of ramdisk image
 0x220	4 bytes		(setup.S)
 0x224	unsigned short	setup.S heap end pointer
-0x2cc	4 bytes		DISK80_SIG_BUFFER (setup.S)
+0x290 - 0x2cf		EDD_MBR_SIG_BUFFER (edd.S)
 0x2d0 - 0x600		E820MAP
-0x600 - 0x7ff		EDDBUF (setup.S) for disk signature read sector
-0x600 - 0x7eb		EDDBUF (setup.S) for edd data
+0x600 - 0x7ff		EDDBUF (edd.S) for disk signature read sector
+0x600 - 0x7eb		EDDBUF (edd.S) for edd data
diff --git a/Documentation/ioctl-number.txt b/Documentation/ioctl-number.txt
index 1af5712b8..2be1218a6 100644
--- a/Documentation/ioctl-number.txt
+++ b/Documentation/ioctl-number.txt
@@ -189,3 +189,5 @@ Code	Seq#	Include File		Comments
 					<mailto:michael.klein@puffin.lb.shuttle.de>
 0xDD	00-3F	ZFCP device driver	see drivers/s390/scsi/
 					<mailto:aherrman@de.ibm.com>
+0xF3	00-3F	video/sisfb.h		sisfb (in development)
+					<mailto:thomas@winischhofer.net>
diff --git a/Documentation/kbuild/modules.txt b/Documentation/kbuild/modules.txt
index 06d0ce1a0..b8933206f 100644
--- a/Documentation/kbuild/modules.txt
+++ b/Documentation/kbuild/modules.txt
@@ -23,7 +23,7 @@ with changes in the build system the most portable way to compile a
 module outside the kernel is to use the kernel build system,
 kbuild. Use the following command-line:
 
-make -C path/to/kernel/src SUBDIRS=$PWD modules
+make -C path/to/kernel/src M=$PWD modules
 
 This requires that a makefile exits made in accordance to
 Documentation/kbuild/makefiles.txt. Read that file for more details on
@@ -65,4 +65,4 @@ yourmodule-objs := file1.o file2.o file3.o
 # Invokes the kernel build system to come back to the current
 # directory and build yourmodule.ko.
 default:
-	make -C ${KERNEL_SOURCE} SUBDIRS=`pwd` modules
+	make -C ${KERNEL_SOURCE} M=`pwd` modules
diff --git a/Documentation/kernel-parameters.txt b/Documentation/kernel-parameters.txt
index c26a38ac5..13839bd74 100644
--- a/Documentation/kernel-parameters.txt
+++ b/Documentation/kernel-parameters.txt
@@ -170,8 +170,6 @@ running once the system is up.
 	aic79xx=	[HW,SCSI]
 			See Documentation/scsi/aic79xx.txt.
 
-	allowdma0	[ISAPNP]
-
 	AM53C974=	[HW,SCSI]
 			Format: <host-scsi-id>,<target-scsi-id>,<max-rate>,<max-offset>
 			See also header of drivers/scsi/AM53C974.c.
@@ -715,6 +713,10 @@ running once the system is up.
 
 	noexec		[IA-64]
 
+	noexec		[i386]
+			noexec=on: enable non-executable mappings (default)
+			noexec=off: disable nn-executable mappings
+
 	nofxsr		[BUGS=IA-32]
 
 	nohighio	[BUGS=IA-32] Disable highmem block I/O.
diff --git a/Documentation/laptop-mode.txt b/Documentation/laptop-mode.txt
index 423ecefb7..065e59cbb 100644
--- a/Documentation/laptop-mode.txt
+++ b/Documentation/laptop-mode.txt
@@ -3,12 +3,12 @@ How to conserve battery power using laptop-mode
 
 Document Author: Bart Samwel (bart@samwel.tk)
 Date created: January 2, 2004
-Last modified: April 3, 2004
+Last modified: July 10, 2004
 
 Introduction
 ------------
 
-Laptopmode is used to minimize the time that the hard disk needs to be spun up,
+Laptop mode is used to minimize the time that the hard disk needs to be spun up,
 to conserve battery power on laptops. It has been reported to cause significant
 power savings.
 
@@ -16,45 +16,43 @@ Contents
 --------
 
 * Introduction
-* The short story
+* Installation
 * Caveats
-* The details
+* The Details
 * Tips & Tricks
 * Control script
 * ACPI integration
 * Monitoring tool
 
 
-The short story
----------------
-
-If you just want to use it, run the laptop_mode control script (which is included
-at the end of this document) as follows:
-
-# laptop_mode start
+Installation
+------------
 
-Then set your harddisk spindown time to a relatively low value with hdparm:
+To use laptop mode, you don't need to set any kernel configuration options
+or anything. Simply install all the files included in this document, and
+laptop mode will automatically be started when you're on battery. For
+your convenience, a tarball containing an installer can be downloaded at:
 
-hdparm -S 4 /dev/hda
+http://www.xs4all.nl/~bsamwel/laptop_mode/tools
 
-The value -S 4 means 20 seconds idle time before spindown. Your harddisk will
-now only spin up when a disk cache miss occurs, or at least once every 10
-minutes to write back any pending changes.
+To configure laptop mode, you need to edit the configuration file, which is
+located in /etc/default/laptop-mode on Debian-based systems, or in
+/etc/sysconfig/laptop-mode on other systems.
 
-To stop laptop_mode, run "laptop_mode stop".
+Unfortunately, automatic enabling of laptop mode does not work for
+laptops that don't have ACPI. On those laptops, you need to start laptop
+mode manually. To start laptop mode, run "laptop_mode start", and to
+stop it, run "laptop_mode stop". (Note: The laptop mode tools package now
+has experimental support for APM, you might want to try that first.)
 
 
 Caveats
 -------
 
-* The downside of laptop mode is that you have a chance of losing up
-  to 10 minutes of work. If you cannot afford this, don't use it! It's
-  wise to turn OFF laptop mode when you're almost out of battery --
-  although this will make the battery run out faster, at least you'll
-  lose less work when it actually runs out. I'm still looking for someone
-  to submit instructions on how to turn off laptop mode when battery is low,
-  e.g., using ACPI events. I don't have a laptop myself, so if you do and
-  you care to contribute such instructions, please do.
+* The downside of laptop mode is that you have a chance of losing up to 10
+  minutes of work. If you cannot afford this, don't use it! The supplied ACPI
+  scripts automatically turn off laptop mode when the battery almost runs out,
+  so that you won't lose any data at the end of your battery life.
 
 * Most desktop hard drives have a very limited lifetime measured in spindown
   cycles, typically about 50.000 times (it's usually listed on the spec sheet).
@@ -68,22 +66,27 @@ Caveats
 
 * If you have your filesystems listed as type "auto" in fstab, like I did, then
   the control script will not recognize them as filesystems that need remounting.
+  You must list the filesystems with their true type instead.
 
 * It has been reported that some versions of the mutt mail client use file access
   times to determine whether a folder contains new mail. If you use mutt and
-  experience this, you must disable the noatime remounting in the control script
-  by setting DO_REMOUNT_NOATIME=0.
+  experience this, you must disable the noatime remounting by setting the option
+  DO_REMOUNT_NOATIME to 0 in the configuration file.
 
 
-The details
+The Details
 -----------
 
-Laptop-mode is controlled by the flag /proc/sys/vm/laptop_mode. When this
-flag is set, any physical disk read operation (that might have caused the
-hard disk to spin up) causes Linux to flush all dirty blocks. The result
-of this is that after a disk has spun down, it will not be spun up anymore
-to write dirty blocks, because those blocks had already been written
-immediately after the most recent read operation
+Laptop mode is controlled by the knob /proc/sys/vm/laptop_mode. This knob is
+present for all kernels that have the laptop mode patch, regardless of any
+configuration options. When the knob is set, any physical disk I/O (that might
+have caused the hard disk to spin up) causes Linux to flush all dirty blocks. The
+result of this is that after a disk has spun down, it will not be spun up
+anymore to write dirty blocks, because those blocks had already been written
+immediately after the most recent read operation. The value of the laptop_mode
+knob determines the time between the occurrence of disk I/O and when the flush
+is triggered. A sensible value for the knob is 5 seconds. Setting the knob to
+0 disables laptop mode.
 
 To increase the effectiveness of the laptop_mode strategy, the laptop_mode
 control script increases dirty_expire_centisecs and dirty_writeback_centisecs in
@@ -102,32 +105,102 @@ is set, Linux reports all disk read and write operations that take place, and
 all block dirtyings done to files. This makes it possible to debug why a disk
 needs to spin up, and to increase battery life even more. The output of
 block_dump is written to the kernel output, and it can be retrieved using
-"dmesg". When you use block_dump, you may want to turn off klogd, otherwise
+"dmesg". When you use block_dump and your kernel logging level also includes
+kernel debugging messages, you probably want to turn off klogd, otherwise
 the output of block_dump will be logged, causing disk activity that is not
 normally there.
 
-If 10 minutes is too much or too little downtime for you, you can configure
-this downtime as follows. In the control script, set the MAX_AGE value to the
-maximum number of seconds of disk downtime that you would like. You should
-then set your filesystem's commit interval to the same value. The dirty ratio
-is also configurable from the control script.
 
-If you don't like the idea of the control script remounting your filesystems
-for you, you can change DO_REMOUNTS to 0 in the script.
+Configuration
+-------------
+
+The laptop mode configuration file is located in /etc/default/laptop-mode on
+Debian-based systems, or in /etc/sysconfig/laptop-mode on other systems. It
+contains the following options:
+
+MAX_AGE:
+
+Maximum time, in seconds, of hard drive spindown time that you are
+confortable with. Worst case, it's possible that you could lose this
+amount of work if your battery fails while you're in laptop mode.
+
+MINIMUM_BATTERY_MINUTES:
+
+Automatically disable laptop mode if the remaining number of minutes of
+battery power is less than this value. Default is 10 minutes.
+
+AC_HD/BATT_HD:
+
+The idle timeout that should be set on your hard drive when laptop mode
+is active (BATT_HD) and when it is not active (AC_HD). The defaults are
+20 seconds (value 4) for BATT_HD  and 2 hours (value 244) for AC_HD. The
+possible values are those listed in the manual page for "hdparm" for the
+"-S" option.
+
+HD:
+
+The devices for which the spindown timeout should be adjusted by laptop mode.
+Default is /dev/hda. If you specify multiple devices, separate them by a space.
+
+READAHEAD:
+
+Disk readahead, in 512-byte sectors, while laptop mode is active. A large
+readahead can prevent disk accesses for things like executable pages (which are
+loaded on demand while the application executes) and sequentially accessed data
+(MP3s).
+
+DO_REMOUNTS:
+
+The control script automatically remounts any mounted journaled filesystems
+with approriate commit interval options. When this option is set to 0, this
+feature is disabled.
+
+DO_REMOUNT_NOATIME:
+
+When remounting, should the filesystems be remounted with the noatime option?
+Normally, this is set to "1" (enabled), but there may be programs that require
+access time recording.
+
+DIRTY_RATIO:
+
+The percentage of memory that is allowed to contain "dirty" or unsaved data
+before a writeback is forced, while laptop mode is active. Corresponds to
+the /proc/sys/vm/dirty_ratio sysctl.
+
+DIRTY_BACKGROUND_RATIO:
+
+The percentage of memory that is allowed to contain "dirty" or unsaved data
+after a forced writeback is done due to an exceeding of DIRTY_RATIO. Set
+this nice and low. This corresponds to the /proc/sys/vm/dirty_background_ratio
+sysctl.
 
-Thanks to Kiko Piris, the control script can be used to enable laptop mode on
-both the Linux 2.4 and 2.6 series.
+Note that the behaviour of dirty_background_ratio is quite different
+when laptop mode is active and when it isn't. When laptop mode is inactive,
+dirty_background_ratio is the threshold percentage at which background writeouts
+start taking place. When laptop mode is active, however, background writeouts
+are disabled, and the dirty_background_ratio only determines how much writeback
+is done when dirty_ratio is reached.
+
+DO_CPU:
+
+Enable CPU frequency scaling when in laptop mode. (Requires CPUFreq to be setup.
+See Documentation/cpu-freq/user-guide.txt for more info. Disabled by default.)
+
+CPU_MAXFREQ:
+
+When on battery, what is the maximum CPU speed that the system should use? Legal
+values are "slowest" for the slowest speed that your CPU is able to operate at,
+or a value listed in /sys/devices/system/cpu/cpu0/cpufreq/scaling_available_frequencies.
 
 
 Tips & Tricks
 -------------
 
 * Bartek Kania reports getting up to 50 minutes of extra battery life (on top
-  of his regular 3 to 3.5 hours) using very aggressive power management (hdparm
-  -B1) and a spindown time of 5 seconds (hdparm -S1).
+  of his regular 3 to 3.5 hours) using a spindown time of 5 seconds (BATT_HD=1).
 
-* You can spin down the disk while playing MP3, by setting the disk readahead
-  to 8MB (hdparm -a 16384). Effectively, the disk will read a complete MP3 at
+* You can spin down the disk while playing MP3, by setting disk readahead
+  to 8MB (READAHEAD=16384). Effectively, the disk will read a complete MP3 at
   once, and will then spin down while the MP3 is playing. (Thanks to Bartek
   Kania.)
 
@@ -136,18 +209,6 @@ Tips & Tricks
   this on powerbooks too. I hope that this is a piece of information that
   might be useful to the Laptop Mode patch or it's users."
 
-* One thing which will cause disks to spin up is not-present application
-  and dynamic library text pages.  The kernel will load program text off disk
-  on-demand, so each time you invoke an application feature for the first
-  time, the kernel needs to spin the disk up to go and fetch that part of the
-  application.
-
-  So it is useful to increase the disk readahead parameter greatly, so that
-  the kernel will pull all of the executable's pages into memory on the first
-  pagefault.
-
-  The supplied script does this.
-
 * In syslog.conf, you can prefix entries with a dash ``-'' to omit syncing the
   file after every logging. When you're using laptop-mode and your disk doesn't
   spin down, this is a likely culprit.
@@ -156,14 +217,109 @@ Tips & Tricks
   (http://noflushd.sourceforge.net/), it seems that noflushd prevents laptop-mode
   from doing its thing.
 
+* If you're worried about your data, you might want to consider using a USB
+  memory stick or something like that as a "working area". (Be aware though
+  that flash memory can only handle a limited number of writes, and overuse
+  may wear out your memory stick pretty quickly. Do _not_ use journalling
+  filesystems on flash memory sticks.)
+
+
+Configuration file for control and ACPI battery scripts
+-------------------------------------------------------
+
+This allows the tunables to be changed for the scripts via an external
+configuration file
+
+It should be installed as /etc/default/laptop-mode on Debian, and as
+/etc/sysconfig/laptop-mode on Red Hat, SUSE, Mandrake, and other work-alikes.
+
+--------------------CONFIG FILE BEGIN-------------------------------------------
+# Maximum time, in seconds, of hard drive spindown time that you are
+# confortable with. Worst case, it's possible that you could lose this
+# amount of work if your battery fails you while in laptop mode.
+#MAX_AGE=600
+
+# Automatically disable laptop mode when the number of minutes of battery
+# that you have left goes below this threshold.
+MINIMUM_BATTERY_MINUTES=10
+
+# Read-ahead, in 512-byte sectors. You can spin down the disk while playing MP3/OGG
+# by setting the disk readahead to 8MB (READAHEAD=16384). Effectively, the disk
+# will read a complete MP3 at once, and will then spin down while the MP3/OGG is
+# playing.
+#READAHEAD=4096
+
+# Shall we remount journaled fs. with appropiate commit interval? (1=yes)
+#DO_REMOUNTS=1
+
+# And shall we add the "noatime" option to that as well? (1=yes)
+#DO_REMOUNT_NOATIME=1
+
+# Dirty synchronous ratio.  At this percentage of dirty pages the process
+# which
+# calls write() does its own writeback
+#DIRTY_RATIO=40
+
+#
+# Allowed dirty background ratio, in percent.  Once DIRTY_RATIO has been
+# exceeded, the kernel will wake pdflush which will then reduce the amount
+# of dirty memory to dirty_background_ratio.  Set this nice and low, so once
+# some writeout has commenced, we do a lot of it.
+#
+#DIRTY_BACKGROUND_RATIO=5
+
+# kernel default dirty buffer age
+#DEF_AGE=30
+#DEF_UPDATE=5
+#DEF_DIRTY_BACKGROUND_RATIO=10
+#DEF_DIRTY_RATIO=40
+#DEF_XFS_AGE_BUFFER=15
+#DEF_XFS_SYNC_INTERVAL=30
+#DEF_XFS_BUFD_INTERVAL=1
+
+# This must be adjusted manually to the value of HZ in the running kernel
+# on 2.4, until the XFS people change their 2.4 external interfaces to work in
+# centisecs. This can be automated, but it's a work in progress that still
+# needs# some fixes. On 2.6 kernels, XFS uses USER_HZ instead of HZ for
+# external interfaces, and that is currently always set to 100. So you don't
+# need to change this on 2.6.
+#XFS_HZ=100
+
+# Should the maximum CPU frequency be adjusted down while on battery?
+# Requires CPUFreq to be setup.
+# See Documentation/cpu-freq/user-guide.txt for more info
+#DO_CPU=0
+
+# When on battery what is the maximum CPU speed that the system should
+# use? Legal values are "slowest" for the slowest speed that your
+# CPU is able to operate at, or a value listed in:
+# /sys/devices/system/cpu/cpu0/cpufreq/scaling_available_frequencies
+# Only applicable if DO_CPU=1.
+#CPU_MAXFREQ=slowest
+
+# Idle timeout for your hard drive (man hdparm for valid values, -S option)
+# Default is 2 hours on AC (AC_HD=244) and 20 seconds for battery (BATT_HD=4).
+#AC_HD=244
+#BATT_HD=4
+
+# The drives for which to adjust the idle timeout. Separate them by a space,
+# e.g. HD="/dev/hda /dev/hdb".
+#HD="/dev/hda"
+
+# Set the spindown timeout on a hard drive?
+#DO_HD=1
+
+--------------------CONFIG FILE END---------------------------------------------
+
 
 Control script
 --------------
 
-Please note that this control script works for the Linux 2.4 and 2.6 series.
+Please note that this control script works for the Linux 2.4 and 2.6 series (thanks
+to Kiko Piris).
 
---------------------CONTROL SCRIPT BEGIN------------------------------------------
-#! /bin/sh
+--------------------CONTROL SCRIPT BEGIN----------------------------------------
+#!/bin/bash
 
 # start or stop laptop_mode, best run by a power management daemon when
 # ac gets connected/disconnected from a laptop
@@ -174,22 +330,120 @@ Please note that this control script works for the Linux 2.4 and 2.6 series.
 #				 Bart Samwel
 #				 Micha Feigin
 #				 Andrew Morton
+#				 Herve Eychenne
 #				 Dax Kelson
 #
 # Original Linux 2.4 version by: Jens Axboe
 
+#############################################################################
+
+# Source config
+if [ -f /etc/default/laptop-mode ] ; then
+	# Debian
+	. /etc/default/laptop-mode
+elif [ -f /etc/sysconfig/laptop-mode ] ; then
+	# Others
+        . /etc/sysconfig/laptop-mode
+fi
+
+# Don't raise an error if the config file is incomplete
+# set defaults instead:
+
+# Maximum time, in seconds, of hard drive spindown time that you are
+# confortable with. Worst case, it's possible that you could lose this
+# amount of work if your battery fails you while in laptop mode.
+MAX_AGE=${MAX_AGE:-'600'}
+
+# Read-ahead, in kilobytes
+READAHEAD=${READAHEAD:-'4096'}
+
+# Shall we remount journaled fs. with appropiate commit interval? (1=yes)
+DO_REMOUNTS=${DO_REMOUNTS:-'1'}
+
+# And shall we add the "noatime" option to that as well? (1=yes)
+DO_REMOUNT_NOATIME=${DO_REMOUNT_NOATIME:-'1'}
+
+# Shall we adjust the idle timeout on a hard drive?
+DO_HD=${DO_HD:-'1'}
+
+# Adjust idle timeout on which hard drive?
+HD="${HD:-'/dev/hda'}"
+
+# spindown time for HD (hdparm -S values)
+AC_HD=${AC_HD:-'244'}
+BATT_HD=${BATT_HD:-'4'}
+
+# Dirty synchronous ratio.  At this percentage of dirty pages the process which
+# calls write() does its own writeback
+DIRTY_RATIO=${DIRTY_RATIO:-'40'}
+
+# cpu frequency scaling
+# See Documentation/cpu-freq/user-guide.txt for more info
+DO_CPU=${CPU_MANAGE:-'0'}
+CPU_MAXFREQ=${CPU_MAXFREQ:-'slowest'}
+
+#
+# Allowed dirty background ratio, in percent.  Once DIRTY_RATIO has been
+# exceeded, the kernel will wake pdflush which will then reduce the amount
+# of dirty memory to dirty_background_ratio.  Set this nice and low, so once
+# some writeout has commenced, we do a lot of it.
+#
+DIRTY_BACKGROUND_RATIO=${DIRTY_BACKGROUND_RATIO:-'5'}
+
+# kernel default dirty buffer age
+DEF_AGE=${DEF_AGE:-'30'}
+DEF_UPDATE=${DEF_UPDATE:-'5'}
+DEF_DIRTY_BACKGROUND_RATIO=${DEF_DIRTY_BACKGROUND_RATIO:-'10'}
+DEF_DIRTY_RATIO=${DEF_DIRTY_RATIO:-'40'}
+DEF_XFS_AGE_BUFFER=${DEF_XFS_AGE_BUFFER:-'15'}
+DEF_XFS_SYNC_INTERVAL=${DEF_XFS_SYNC_INTERVAL:-'30'}
+DEF_XFS_BUFD_INTERVAL=${DEF_XFS_BUFD_INTERVAL:-'1'}
+
+# This must be adjusted manually to the value of HZ in the running kernel
+# on 2.4, until the XFS people change their 2.4 external interfaces to work in
+# centisecs. This can be automated, but it's a work in progress that still needs
+# some fixes. On 2.6 kernels, XFS uses USER_HZ instead of HZ for external
+# interfaces, and that is currently always set to 100. So you don't need to
+# change this on 2.6.
+XFS_HZ=${XFS_HZ:-'100'}
+
+#############################################################################
+
+KLEVEL="$(uname -r |
+             {
+	       IFS='.' read a b c
+	       echo $a.$b
+	     }
+)"
+case "$KLEVEL" in
+	"2.4"|"2.6")
+		;;
+	*)
+		echo "Unhandled kernel version: $KLEVEL ('uname -r' = '$(uname -r)')" >&2
+		exit 1
+		;;
+esac
+
+if [ ! -e /proc/sys/vm/laptop_mode ] ; then
+	echo "Kernel is not patched with laptop_mode patch." >&2
+	exit 1
+fi
+
+if [ ! -w /proc/sys/vm/laptop_mode ] ; then
+	echo "You do not have enough privileges to enable laptop_mode." >&2
+	exit 1
+fi
+
 # Remove an option (the first parameter) of the form option=<number> from
 # a mount options string (the rest of the parameters).
 parse_mount_opts () {
 	OPT="$1"
 	shift
-	echo "$*"			| \
-	sed 's/.*/,&,/'			| \
-	sed 's/,'"$OPT"'=[0-9]*,/,/g'	| \
-	sed 's/,,*/,/g'			| \
-	sed 's/^,//'			| \
-	sed 's/,$//'			| \
-	cat -
+	echo ",$*," | sed		\
+	 -e 's/,'"$OPT"'=[0-9]*,/,/g'	\
+	 -e 's/,,*/,/g'			\
+	 -e 's/^,//'			\
+	 -e 's/,$//'
 }
 
 # Remove an option (the first parameter) without any arguments from
@@ -197,13 +451,11 @@ parse_mount_opts () {
 parse_nonumber_mount_opts () {
 	OPT="$1"
 	shift
-	echo "$*" 			| \
-	sed 's/.*/,&,/'			| \
-	sed 's/,'"$OPT"',/,/g'		| \
-	sed 's/,,*/,/g'			| \
-	sed 's/^,//'			| \
-	sed 's/,$//'			| \
-	cat -
+	echo ",$*," | sed		\
+	 -e 's/,'"$OPT"',/,/g'		\
+	 -e 's/,,*/,/g'			\
+	 -e 's/^,//'			\
+	 -e 's/,$//'
 }
 
 # Find out the state of a yes/no option (e.g. "atime"/"noatime") in
@@ -218,28 +470,26 @@ parse_nonumber_mount_opts () {
 # If fstab contains, say, "rw" for this filesystem, then the result
 # will be "defaults,atime".
 parse_yesno_opts_wfstab () {
-	L_DEV=$1
-	shift
-	OPT=$1
-	shift
-	DEF_OPT=$1
-	shift
+	L_DEV="$1"
+	OPT="$2"
+	DEF_OPT="$3"
+	shift 3
 	L_OPTS="$*"
 	PARSEDOPTS1="$(parse_nonumber_mount_opts $OPT $L_OPTS)"
 	PARSEDOPTS1="$(parse_nonumber_mount_opts no$OPT $PARSEDOPTS1)"
 	# Watch for a default atime in fstab
-	FSTAB_OPTS="$(cat /etc/fstab | sed 's/  / /g' | grep ^\ *"$L_DEV " | awk '{ print $4 }')"
-	if [ -z "$(echo "$FSTAB_OPTS" | grep "$OPT")" ] ; then
-		# option not specified in fstab -- choose the default.
-		echo "$PARSEDOPTS1,$DEF_OPT"
-	else
+	FSTAB_OPTS="$(awk '$1 == "'$L_DEV'" { print $4 }' /etc/fstab)"
+	if echo "$FSTAB_OPTS" | grep "$OPT" > /dev/null ; then
 		# option specified in fstab: extract the value and use it
-		if [ -z "$(echo "$FSTAB_OPTS" | grep "no$OPT")" ] ; then
+		if echo "$FSTAB_OPTS" | grep "no$OPT" > /dev/null ; then
+			echo "$PARSEDOPTS1,no$OPT"
+		else
 			# no$OPT not found -- so we must have $OPT.
 			echo "$PARSEDOPTS1,$OPT"
-		else
-			echo "$PARSEDOPTS1,no$OPT"
 		fi
+	else
+		# option not specified in fstab -- choose the default.
+		echo "$PARSEDOPTS1,$DEF_OPT"
 	fi
 }
 
@@ -256,97 +506,41 @@ parse_yesno_opts_wfstab () {
 # If fstab contains, say, "commit=3,rw" for this filesystem, then the
 # result will be "rw,commit=3".
 parse_mount_opts_wfstab () {
-	L_DEV=$1
-	shift
-	OPT=$1
-	shift
+	L_DEV="$1"
+	OPT="$2"
+	shift 2
 	L_OPTS="$*"
-
 	PARSEDOPTS1="$(parse_mount_opts $OPT $L_OPTS)"
 	# Watch for a default commit in fstab
-	FSTAB_OPTS="$(cat /etc/fstab | sed 's/	/ /g' | grep ^\ *"$L_DEV " | awk '{ print $4 }')"
-	if [ -z "$(echo "$FSTAB_OPTS" | grep "$OPT=")" ] ; then
-		# option not specified in fstab: set it to 0
-		echo "$PARSEDOPTS1,$OPT=0"
-	else
+	FSTAB_OPTS="$(awk '$1 == "'$L_DEV'" { print $4 }' /etc/fstab)"
+	if echo "$FSTAB_OPTS" | grep "$OPT=" > /dev/null ; then
 		# option specified in fstab: extract the value, and use it
 		echo -n "$PARSEDOPTS1,$OPT="
-		echo "$FSTAB_OPTS"	| \
-		sed 's/.*/,&,/'		| \
-		sed 's/.*,'"$OPT"'=//'	| \
-		sed 's/,.*//'		| \
-		cat -
+		echo ",$FSTAB_OPTS," | sed \
+		 -e 's/.*,'"$OPT"'=//'	\
+		 -e 's/,.*//'
+	else
+		# option not specified in fstab: set it to 0
+		echo "$PARSEDOPTS1,$OPT=0"
 	fi
 }
 
-KLEVEL=$(
-           uname -r |
-             (
-	       IFS="." read a b c
-	       echo $a.$b
-	     )
-	 )
-case "$KLEVEL" in
-	"2.4"|"2.6")
-		true
-		;;
-	*)
-		echo "Unhandled kernel version: $KLEVEL ('uname -r' = '$(uname -r)')"
-		exit 1
-		;;
-esac
-
-# Shall we remount journaled fs. with appropiate commit interval? (1=yes)
-DO_REMOUNTS=1
-
-# And shall we add the "noatime" option to that as well? (1=yes)
-DO_REMOUNT_NOATIME=1
-
-# age time, in seconds. should be put into a sysconfig file
-MAX_AGE=600
-
-# Dirty synchronous ratio.  At this percentage of dirty pages the process which
-# calls write() does its own writeback
-DIRTY_RATIO=40
-
-#
-# Allowed dirty background ratio, in percent.  Once DIRTY_RATIO has been
-# exceeded, the kernel will wake pdflush which will then reduce the amount
-# of dirty memory to dirty_background_ratio.  Set this nice and low, so once
-# some writeout has commenced, we do a lot of it.
-#
-DIRTY_BACKGROUND_RATIO=5
-
-READAHEAD=4096		# kilobytes
-
-# kernel default dirty buffer age
-DEF_AGE=30
-DEF_UPDATE=5
-DEF_DIRTY_BACKGROUND_RATIO=10
-DEF_DIRTY_RATIO=40
-DEF_XFS_AGE_BUFFER=15
-DEF_XFS_SYNC_INTERVAL=30
-DEF_XFS_BUFD_INTERVAL=1
-
-# This must be adjusted manually to the value of HZ in the running kernel
-# on 2.4, until the XFS people change their 2.4 external interfaces to work in
-# centisecs. This can be automated, but it's a work in progress that still needs
-# some fixes. On 2.6 kernels, XFS uses USER_HZ instead of HZ for external
-# interfaces, and that is currently always set to 100. So you don't need to
-# change this on 2.6.
-XFS_HZ=100
-
-if [ ! -e /proc/sys/vm/laptop_mode ]; then
-	echo "Kernel is not patched with laptop_mode patch."
-	exit 1
-fi
-
-if [ ! -w /proc/sys/vm/laptop_mode ]; then
-	echo "You do not have enough privileges to enable laptop_mode."
-	exit 1
-fi
+deduce_fstype () {
+	MP="$1"
+	# My root filesystem unfortunately has
+	# type "unknown" in /etc/mtab. If we encounter
+	# "unknown", we try to get the type from fstab.
+	cat /etc/fstab |
+	grep -v '^#' |
+	while read FSTAB_DEV FSTAB_MP FSTAB_FST FSTAB_OPTS FSTAB_DUMP FSTAB_DUMP ; do
+		if [ "$FSTAB_MP" = "$MP" ]; then
+			echo $FSTAB_FST
+			exit 0
+		fi
+	done
+}
 
-if [ $DO_REMOUNT_NOATIME -eq 1 ]; then
+if [ $DO_REMOUNT_NOATIME -eq 1 ] ; then
 	NOATIME_OPT=",noatime"
 fi
 
@@ -384,11 +578,11 @@ case "$1" in
 
 		case "$KLEVEL" in
 			"2.4")
-				echo "1"				> /proc/sys/vm/laptop_mode
+				echo 1					> /proc/sys/vm/laptop_mode
 				echo "30 500 0 0 $AGE $AGE 60 20 0"	> /proc/sys/vm/bdflush
 				;;
 			"2.6")
-				echo "5"				> /proc/sys/vm/laptop_mode
+				echo 5					> /proc/sys/vm/laptop_mode
 				echo "$AGE"				> /proc/sys/vm/dirty_writeback_centisecs
 				echo "$AGE"				> /proc/sys/vm/dirty_expire_centisecs
 				echo "$DIRTY_RATIO"			> /proc/sys/vm/dirty_ratio
@@ -398,6 +592,9 @@ case "$1" in
 		if [ $DO_REMOUNTS -eq 1 ]; then
 			cat /etc/mtab | while read DEV MP FST OPTS DUMP PASS ; do
 				PARSEDOPTS="$(parse_mount_opts "$OPTS")"
+				if [ "$FST" = 'unknown' ]; then
+					FST=$(deduce_fstype $MP)
+				fi
 				case "$FST" in
 					"ext3"|"reiserfs")
 						PARSEDOPTS="$(parse_mount_opts commit "$OPTS")"
@@ -412,22 +609,34 @@ case "$1" in
 				fi
 			done
 		fi
+		if [ $DO_HD -eq 1 ] ; then
+			for THISHD in $HD ; do
+				/sbin/hdparm -S $BATT_HD $THISHD > /dev/null 2>&1
+				/sbin/hdparm -B 1 $THISHD > /dev/null 2>&1
+			done
+		fi
+		if [ $DO_CPU -eq 1 -a -e /sys/devices/system/cpu/cpu0/cpufreq/cpuinfo_min_freq ]; then
+			if [ $CPU_MAXFREQ = 'slowest' ]; then
+				CPU_MAXFREQ=`cat /sys/devices/system/cpu/cpu0/cpufreq/cpuinfo_min_freq`
+			fi
+			echo $CPU_MAXFREQ > /sys/devices/system/cpu/cpu0/cpufreq/scaling_max_freq
+		fi
 		echo "."
 		;;
 	stop)
 		U_AGE=$((100*$DEF_UPDATE))
 		B_AGE=$((100*$DEF_AGE))
 		echo -n "Stopping laptop_mode"
-		echo "0" > /proc/sys/vm/laptop_mode
-		if [ -f /proc/sys/fs/xfs/age_buffer ] && [ ! -f /proc/sys/fs/xfs/lm_age_buffer ] ; then
+		echo 0 > /proc/sys/vm/laptop_mode
+		if [ -f /proc/sys/fs/xfs/age_buffer -a ! -f /proc/sys/fs/xfs/lm_age_buffer ] ; then
 			# These need to be restored, if there are no lm_*.
-			echo "$(($XFS_HZ*$DEF_XFS_AGE_BUFFER))" 	> /proc/sys/fs/xfs/age_buffer
-			echo "$(($XFS_HZ*$DEF_XFS_SYNC_INTERVAL))" 	> /proc/sys/fs/xfs/sync_interval
+			echo $(($XFS_HZ*$DEF_XFS_AGE_BUFFER))	 	> /proc/sys/fs/xfs/age_buffer
+			echo $(($XFS_HZ*$DEF_XFS_SYNC_INTERVAL)) 	> /proc/sys/fs/xfs/sync_interval
 		elif [ -f /proc/sys/fs/xfs/age_buffer_centisecs ] ; then
 			# These need to be restored as well.
-			echo "$((100*$DEF_XFS_AGE_BUFFER))" > /proc/sys/fs/xfs/age_buffer_centisecs
-			echo "$((100*$DEF_XFS_SYNC_INTERVAL))" > /proc/sys/fs/xfs/xfssyncd_centisecs
-			echo "$((100*$DEF_XFS_BUFD_INTERVAL))" > /proc/sys/fs/xfs/xfsbufd_centisecs
+			echo $((100*$DEF_XFS_AGE_BUFFER))	> /proc/sys/fs/xfs/age_buffer_centisecs
+			echo $((100*$DEF_XFS_SYNC_INTERVAL))	> /proc/sys/fs/xfs/xfssyncd_centisecs
+			echo $((100*$DEF_XFS_BUFD_INTERVAL))	> /proc/sys/fs/xfs/xfsbufd_centisecs
 		fi
 		case "$KLEVEL" in
 			"2.4")
@@ -440,9 +649,12 @@ case "$1" in
 				echo "$DEF_DIRTY_BACKGROUND_RATIO"	> /proc/sys/vm/dirty_background_ratio
 				;;
 		esac
-		if [ $DO_REMOUNTS -eq 1 ]; then
+		if [ $DO_REMOUNTS -eq 1 ] ; then
 			cat /etc/mtab | while read DEV MP FST OPTS DUMP PASS ; do
 				# Reset commit and atime options to defaults.
+				if [ "$FST" = 'unknown' ]; then
+					FST=$(deduce_fstype $MP)
+				fi
 				case "$FST" in
 					"ext3"|"reiserfs")
 						PARSEDOPTS="$(parse_mount_opts_wfstab $DEV commit $OPTS)"
@@ -459,66 +671,109 @@ case "$1" in
 				fi
 			done
 		fi
+		if [ $DO_HD -eq 1 ] ; then
+			for THISHD in $HD ; do
+				/sbin/hdparm -S $AC_HD $THISHD > /dev/null 2>&1
+				/sbin/hdparm -B 255 $THISHD > /dev/null 2>&1
+			done
+		fi
+		if [ $DO_CPU -eq 1 -a -e /sys/devices/system/cpu/cpu0/cpufreq/cpuinfo_min_freq ]; then
+			echo `cat /sys/devices/system/cpu/cpu0/cpufreq/cpuinfo_max_freq` > /sys/devices/system/cpu/cpu0/cpufreq/scaling_max_freq
+		fi
 		echo "."
 		;;
 	*)
-		echo "Usage: $0 {start|stop}"
+		echo "Usage: $0 {start|stop}" 2>&1
+		exit 1
 		;;
 
 esac
 
 exit 0
-
---------------------CONTROL SCRIPT END--------------------------------------------
+--------------------CONTROL SCRIPT END------------------------------------------
 
 
 ACPI integration
 ----------------
 
 Dax Kelson submitted this so that the ACPI acpid daemon will
-kick off the laptop_mode script and run hdparm.
+kick off the laptop_mode script and run hdparm. The part that
+automatically disables laptop mode when the battery is low was
+writen by Jan Topinski.
 
----------------------------/etc/acpi/events/ac_adapter BEGIN-------------------------------------------
+-----------------/etc/acpi/events/ac_adapter BEGIN------------------------------
 event=ac_adapter
-action=/etc/acpi/actions/battery.sh
----------------------------/etc/acpi/events/ac_adapter END-------------------------------------------
+action=/etc/acpi/actions/ac.sh %e
+----------------/etc/acpi/events/ac_adapter END---------------------------------
+
 
----------------------------/etc/acpi/actions/battery.sh BEGIN-------------------------------------------
-#!/bin/sh
+-----------------/etc/acpi/events/battery BEGIN---------------------------------
+event=battery.*
+action=/etc/acpi/actions/battery.sh %e
+----------------/etc/acpi/events/battery END------------------------------------
 
-# cpu throttling
-# cat /proc/acpi/processor/CPU0/throttling for more info
-ACAD_THR=0
-BATT_THR=2
 
-# spindown time for HD (man hdparm for valid values)
-# I prefer 2 hours for acad and 20 seconds for batt
-ACAD_HD=244
-BATT_HD=4
+----------------/etc/acpi/actions/ac.sh BEGIN-----------------------------------
+#!/bin/bash
 
-# ac/battery event handler
+# ac on/offline event handler
 
-status=`awk '/^state: / { print $2 }' /proc/acpi/ac_adapter/AC/state`
+status=`awk '/^state: / { print $2 }' /proc/acpi/ac_adapter/$2/state`
 
 case $status in
         "on-line")
-                echo "Setting HD spindown for AC mode."
                 /sbin/laptop_mode stop
-                /sbin/hdparm -S $ACAD_HD /dev/hda > /dev/null 2>&1
-                /sbin/hdparm -B 255 /dev/hda > /dev/null 2>&1
-                #echo -n $ACAD_CPU:$ACAD_THR > /proc/acpi/processor/CPU0/limit
                 exit 0
         ;;
         "off-line")
-                echo "Setting HD spindown for battery mode."
                 /sbin/laptop_mode start
-                /sbin/hdparm -S $BATT_HD /dev/hda > /dev/null 2>&1
-                /sbin/hdparm -B 1 /dev/hda > /dev/null 2>&1
-                #echo -n $BATT_CPU:$BATT_THR > /proc/acpi/processor/CPU0/limit
                 exit 0
         ;;
 esac
----------------------------/etc/acpi/actions/battery.sh END-------------------------------------------
+---------------------------/etc/acpi/actions/ac.sh END--------------------------
+
+
+---------------------------/etc/acpi/actions/battery.sh BEGIN-------------------
+#! /bin/bash
+
+# Automatically disable laptop mode when the battery almost runs out.
+
+BATT_INFO=/proc/acpi/battery/$2/state
+
+if [[ -f /proc/sys/vm/laptop_mode ]]
+then
+   LM=`cat /proc/sys/vm/laptop_mode`
+   if [[ $LM -gt 0 ]]
+   then
+     if [[ -f $BATT_INFO ]]
+     then
+        # Source the config file only now that we know we need
+        if [ -f /etc/default/laptop-mode ] ; then
+                # Debian
+                . /etc/default/laptop-mode
+        elif [ -f /etc/sysconfig/laptop-mode ] ; then
+                # Others
+                . /etc/sysconfig/laptop-mode
+        fi
+        MINIMUM_BATTERY_MINUTES=${MINIMUM_BATTERY_MINUTES:-'10'}
+
+        ACTION="`cat $BATT_INFO | grep charging | cut -c 26-`"
+        if [[ ACTION -eq "discharging" ]]
+        then
+           PRESENT_RATE=`cat $BATT_INFO | grep "present rate:" | sed  "s/.* \([0-9][0-9]* \).*/\1/" `
+           REMAINING=`cat $BATT_INFO | grep "remaining capacity:" | sed  "s/.* \([0-9][0-9]* \).*/\1/" `
+        fi
+        if (($REMAINING * 60 / $PRESENT_RATE < $MINIMUM_BATTERY_MINUTES))
+        then
+           /sbin/laptop_mode stop
+        fi
+     else
+       logger -p daemon.warning "You are using laptop mode and your battery interface $BATT_INFO is missing. This may lead to loss of data when the battery runs out. Check kernel ACPI support and /proc/acpi/battery folder, and edit /etc/acpi/battery.sh to set BATT_INFO to the correct path."
+     fi
+   fi
+fi
+---------------------------/etc/acpi/actions/battery.sh END--------------------
+
 
 Monitoring tool
 ---------------
@@ -526,7 +781,7 @@ Monitoring tool
 Bartek Kania submitted this, it can be used to measure how much time your disk
 spends spun up/down.
 
----------------------------dslm.c BEGIN-------------------------------------------
+---------------------------dslm.c BEGIN-----------------------------------------
 /*
  * Simple Disk Sleep Monitor
  *  by Bartek Kania
@@ -692,4 +947,4 @@ int main(int ac, char **av)
 
     return 0;
 }
----------------------------dslm.c END---------------------------------------------
+---------------------------dslm.c END-------------------------------------------
diff --git a/Documentation/locks.txt b/Documentation/locks.txt
index d2a797e0b..ce1be79ed 100644
--- a/Documentation/locks.txt
+++ b/Documentation/locks.txt
@@ -19,7 +19,7 @@ forever.
 
 This should not cause problems for anybody, since everybody using a
 2.1.x kernel should have updated their C library to a suitable version
-anyway (see the file "linux/Documentation/Changes".)
+anyway (see the file "Documentation/Changes".)
 
 1.2 Allow Mixed Locks Again
 ---------------------------
diff --git a/Documentation/networking/00-INDEX b/Documentation/networking/00-INDEX
index 029e9c71e..834993d26 100644
--- a/Documentation/networking/00-INDEX
+++ b/Documentation/networking/00-INDEX
@@ -4,8 +4,6 @@
 	- information on the 3Com EtherLink Plus (3c505) driver.
 6pack.txt
 	- info on the 6pack protocol, an alternative to KISS for AX.25
-8139too.txt
-	- info on the 8139too driver for RTL-8139 based network cards.
 Configurable
 	- info on some of the configurable network parameters
 DLINK.txt
diff --git a/Documentation/networking/Configurable b/Documentation/networking/Configurable
index a941ca30f..69c0dd466 100644
--- a/Documentation/networking/Configurable
+++ b/Documentation/networking/Configurable
@@ -7,7 +7,7 @@ you should be aware they do exist and can be changed.
 The current list of parameters can be found in the files:
 
 	linux/net/TUNABLE
-	linux/Documentation/networking/ip-sysctl.txt
+	Documentation/networking/ip-sysctl.txt
 
 Some of these are accessible via the sysctl interface, and many more are
 scheduled to be added in this way. For example, some parameters related 
diff --git a/Documentation/networking/comx.txt b/Documentation/networking/comx.txt
index 85ce5e586..d1526eba2 100644
--- a/Documentation/networking/comx.txt
+++ b/Documentation/networking/comx.txt
@@ -148,7 +148,7 @@ THE SLICECOM DRIVER
 The SliceCOM board doesn't require firmware. You can have 4 of these cards
 in one machine. The driver doesn't (yet) support shared interrupts, so
 you will need a separate IRQ line for every board.
-Read linux/Documentation/networking/slicecom.txt for help on configuring
+Read Documentation/networking/slicecom.txt for help on configuring
 this adapter.
 
 THE HDLC/PPP LINE PROTOCOL DRIVER
diff --git a/Documentation/networking/ip-sysctl.txt b/Documentation/networking/ip-sysctl.txt
index 708e12a20..10304b436 100644
--- a/Documentation/networking/ip-sysctl.txt
+++ b/Documentation/networking/ip-sysctl.txt
@@ -17,6 +17,16 @@ ip_no_pmtu_disc - BOOLEAN
 	Disable Path MTU Discovery.
 	default FALSE
 
+min_pmtu - INTEGER
+	default 562 - minimum discovered Path MTU
+
+mtu_expires - INTEGER
+	Time, in seconds, that cached PMTU information is kept.
+
+min_adv_mss - INTEGER
+	The advertised MSS depends on the first hop route MTU, but will
+	never be lower than this setting.
+
 IP Fragmentation:
 
 ipfrag_high_thresh - INTEGER
@@ -345,6 +355,20 @@ tcp_default_win_scale - INTEGER
 	conections.
 	Default: 7
 
+
+tcp_frto - BOOLEAN
+	Enables F-RTO, an enhanced recovery algorithm for TCP retransmission
+	timeouts.  It is particularly beneficial in wireless environments
+	where packet loss is typically due to random radio interference
+	rather than intermediate router congestion.
+
+somaxconn - INTEGER
+	Limit of socket listen() backlog, known in userspace as SOMAXCONN.
+	Defaults to 128.  See also tcp_max_syn_backlog for additional tuning
+	for TCP sockets.
+
+IP Variables:
+
 ip_local_port_range - 2 INTEGERS
 	Defines the local port range that is used by TCP and UDP to
 	choose the local port. The first number is the first, the 
@@ -586,6 +610,19 @@ arp_ignore - INTEGER
 	The max value from conf/{all,interface}/arp_ignore is used
 	when ARP request is received on the {interface}
 
+app_solicit - INTEGER
+	The maximum number of probes to send to the user space ARP daemon
+	via netlink before dropping back to multicast probes (see
+	mcast_solicit).  Defaults to 0.
+
+disable_policy - BOOLEAN
+	Disable IPSEC policy (SPD) for this interface
+
+disable_xfrm - BOOLEAN
+	Disable IPSEC encryption on this interface, whatever the policy
+
+
+
 tag - INTEGER
 	Allows you to write a number, which can be used as required.
 	Default value is 0.
@@ -678,9 +715,11 @@ accept_redirects - BOOLEAN
 			    disabled if local forwarding is enabled.
 
 autoconf - BOOLEAN
-	Configure link-local addresses using L2 hardware addresses.
+	Autoconfigure addresses using Prefix Information in Router 
+	Advertisements.
 
-	Default: TRUE
+	Functional default: enabled if accept_ra is enabled.
+			    disabled if accept_ra is disabled.
 
 dad_transmits - INTEGER
 	The amount of Duplicate Address Detection probes to send.
@@ -804,4 +843,25 @@ bridge-nf-filter-vlan-tagged - BOOLEAN
 	Default: 1
 
 
+UNDOCUMENTED:
+
+dev_weight FIXME
+discovery_slots FIXME
+discovery_timeout FIXME
+fast_poll_increase FIXME
+ip6_queue_maxlen FIXME
+lap_keepalive_time FIXME
+lo_cong FIXME
+max_baud_rate FIXME
+max_dgram_qlen FIXME
+max_noreply_time FIXME
+max_tx_data_size FIXME
+max_tx_window FIXME
+min_tx_turn_time FIXME
+mod_cong FIXME
+no_cong FIXME
+no_cong_thresh FIXME
+slot_timeout FIXME
+warn_noreply_time FIXME
+
 $Id: ip-sysctl.txt,v 1.20 2001/12/13 09:00:18 davem Exp $
diff --git a/Documentation/networking/pktgen.txt b/Documentation/networking/pktgen.txt
index 776210590..99c1485d7 100644
--- a/Documentation/networking/pktgen.txt
+++ b/Documentation/networking/pktgen.txt
@@ -11,13 +11,13 @@ How to use the Linux packet generator module.
 5. After this two commands are defined:
    A. "pg" to start generator and to get results.
    B. "pgset" to change generator parameters. F.e.
-      pgset "clone_skb 100"   sets the number of coppies of the same packet 
+      pgset "clone_skb 100"   sets the number of copies of the same packet 
                               will be sent before a new packet is allocated
       pgset "clone_skb 0"     use multiple SKBs for packet generation
       pgset "pkt_size 9014"   sets packet size to 9014
       pgset "frags 5"         packet will consist of 5 fragments
       pgset "count 200000"    sets number of packets to send, set to zero
-                              for continious sends untill explicitly
+                              for continuous sends until explicitly
                               stopped.
       pgset "ipg 5000"        sets artificial gap inserted between packets
                               to 5000 nanoseconds
diff --git a/Documentation/nmi_watchdog.txt b/Documentation/nmi_watchdog.txt
index c1ba4e6f1..6cad46e8a 100644
--- a/Documentation/nmi_watchdog.txt
+++ b/Documentation/nmi_watchdog.txt
@@ -58,6 +58,9 @@ 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.
 
+On x86-64 the NMI oopser is on by default. On 64bit Intel CPUs
+it uses IO-APIC by default and on AMD it uses local APIC.
+
 [ feel free to send bug reports, suggestions and patches to
   Ingo Molnar <mingo@redhat.com> or the Linux SMP mailing
   list at <linux-smp@vger.kernel.org> ]
diff --git a/Documentation/parisc/debugging b/Documentation/parisc/debugging
index 5e060917a..d72859405 100644
--- a/Documentation/parisc/debugging
+++ b/Documentation/parisc/debugging
@@ -7,7 +7,7 @@ linux/parisc.
 A lot of the assembly code currently runs in real mode, which means
 absolute addresses are used instead of virtual addresses as in the
 rest of the kernel.  To translate an absolute address to a virtual
-address you can lookup in System.map, add __PAGE_OFFSET (0xc0000000
+address you can lookup in System.map, add __PAGE_OFFSET (0x10000000
 currently).
 
 
@@ -21,7 +21,7 @@ the I/O range); the System Responder address is the address real-mode
 code tried to access.
 
 Typical values for the System Responder address are addresses larger
-than __PAGE_OFFSET (0xc0000000) which mean a virtual address didn't
+than __PAGE_OFFSET (0x10000000) which mean a virtual address didn't
 get translated to a physical address before real-mode code tried to
 access it.
 
diff --git a/Documentation/parisc/registers b/Documentation/parisc/registers
index ad7edd91c..08b9f558d 100644
--- a/Documentation/parisc/registers
+++ b/Documentation/parisc/registers
@@ -4,8 +4,6 @@ Register Usage for Linux/PA-RISC
 
 	General Registers as specified by ABI
 
-	FPU Registers must not be used in kernel mode
-
 	Control Registers
 
 CR 0 (Recovery Counter)		used for ptrace
@@ -13,11 +11,15 @@ CR 1-CR 7(undefined)		unused
 CR 8 (Protection ID)		per-process value*
 CR 9, 12, 13 (PIDS)		unused
 CR10 (CCR)			lazy FPU saving*
-CR11				as specified by ABI
+CR11				as specified by ABI (SAR)
 CR14 (interruption vector)	initialized to fault_vector
 CR15 (EIEM)			initialized to all ones*
 CR16 (Interval Timer)		read for cycle count/write starts Interval Tmr
 CR17-CR22			interruption parameters
+CR19				Interrupt Instruction Register
+CR20				Interrupt Space Register
+CR21				Interrupt Offset Register
+CR22				Interrupt PSW
 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
diff --git a/Documentation/pci.txt b/Documentation/pci.txt
index d30dc107a..411947638 100644
--- a/Documentation/pci.txt
+++ b/Documentation/pci.txt
@@ -166,8 +166,9 @@ count on these devices by calling pci_dev_put().
 ~~~~~~~~~~~~~~~~~~~
    Before you do anything with the device you've found, you need to enable
 it by calling pci_enable_device() which enables I/O and memory regions of
-the device, assigns missing resources if needed and wakes up the device
-if it was in suspended state. Please note that this function can fail.
+the device, allocates an IRQ if necessary, assigns missing resources if
+needed and wakes up the device if it was in suspended state. Please note
+that this function can fail.
 
    If you want to use the device in bus mastering mode, call pci_set_master()
 which enables the bus master bit in PCI_COMMAND register and also fixes
diff --git a/Documentation/pnp.txt b/Documentation/pnp.txt
index 0a321e722..af0f6eabf 100644
--- a/Documentation/pnp.txt
+++ b/Documentation/pnp.txt
@@ -83,7 +83,6 @@ irq 6
 dma 2
 
 also there are a series of kernel parameters:
-allowdma0
 pnp_reserve_irq=irq1[,irq2] ....
 pnp_reserve_dma=dma1[,dma2] ....
 pnp_reserve_io=io1,size1[,io2,size2] ....
diff --git a/Documentation/power/pci.txt b/Documentation/power/pci.txt
index 4a15f20ce..972c7c74b 100644
--- a/Documentation/power/pci.txt
+++ b/Documentation/power/pci.txt
@@ -286,11 +286,11 @@ wake event from:
 +------------------+
 |  Bit  |  State   |
 +------------------+
-|  15   |   D0     |
-|  14   |   D1     |
+|  11   |   D0     |
+|  12   |   D1     |
 |  13   |   D2     |
-|  12   |   D3hot  |
-|  11   |   D3cold |
+|  14   |   D3hot  |
+|  15   |   D3cold |
 +------------------+
 
 A device can use this to enable wake events:
diff --git a/Documentation/power/swsusp.txt b/Documentation/power/swsusp.txt
index 8bc308d03..5cdab4c55 100644
--- a/Documentation/power/swsusp.txt
+++ b/Documentation/power/swsusp.txt
@@ -12,6 +12,9 @@ From kernel/suspend.c:
  *				...you'd better find out how to get along
  *				   without your data.
  *
+ * If you change kernel command line between suspend and resume...
+ *			        ...prepare for nasty fsck or worse.
+ *
  * (*) pm interface support is needed to make it safe.
 
 You need to append resume=/dev/your_swap_partition to kernel command
@@ -199,3 +202,30 @@ or an NFS share[Work In Progress]). Questions regarding suspend2
 should be sent to the mailing list available through the suspend2
 website, and not to the Linux Kernel Mailing List. We are working
 toward merging suspend2 into the mainline kernel.
+
+Q: Kernel thread must voluntarily freeze itself (call 'refrigerator'). But
+I found some kernel threads don't do it, and they don't freeze, and
+so the system can't sleep. Is this a known behavior?
+
+A: All such kernel threads need to be fixed, one by one. Select place
+where it is safe to be frozen (no kernel semaphores should be held at
+that point and it must be safe to sleep there), and add:
+
+            if (current->flags & PF_FREEZE)
+                    refrigerator(PF_FREEZE);
+
+Q: What is the difference between between "platform", "shutdown" and
+"firmware" in /sys/power/disk?
+
+A:
+
+shutdown: save state in linux, then tell bios to powerdown
+
+platform: save state in linux, then tell bios to powerdown and blink
+          "suspended led"
+
+firmware: tell bios to save state itself [needs BIOS-specific suspend
+	  partition, and has very little to do with swsusp]
+
+"platform" is actually right thing to do, but "shutdown" is most
+reliable.
diff --git a/Documentation/power/video.txt b/Documentation/power/video.txt
index 652657307..cd9e2075b 100644
--- a/Documentation/power/video.txt
+++ b/Documentation/power/video.txt
@@ -30,10 +30,6 @@ There are three types of systems where video works after S3 resume:
   patched X, and plain text console (no vesafb or radeonfb), see
   http://www.doesi.gmxhome.de/linux/tm800s3/s3.html. (Acer TM 800)
 
-* radeon systems, where X can soft-boot your video card. You'll need
-  patched X, and plain text console (no vesafb or radeonfb), see
-  http://www.doesi.gmxhome.de/linux/tm800s3/s3.html. (Acer TM 800)
-
 Now, if you pass acpi_sleep=something, and it does not work with your
 bios, you'll get hard crash during resume. Be carefull.
 
diff --git a/Documentation/s390/3270.txt b/Documentation/s390/3270.txt
index 38615b07f..0a044e647 100644
--- a/Documentation/s390/3270.txt
+++ b/Documentation/s390/3270.txt
@@ -117,7 +117,7 @@ Here are the installation steps in detail:
 
 	Then notify /sbin/init that /etc/inittab has changed, by issuing
 	the telinit command with the q operand:
-		cd /usr/src/linux/Documentation/s390
+		cd Documentation/s390
 		sh config3270.sh
 		sh /tmp/mkdev3270
 		telinit q
diff --git a/Documentation/scsi/scsi_mid_low_api.txt b/Documentation/scsi/scsi_mid_low_api.txt
index eda7ce53d..463dfc72f 100644
--- a/Documentation/scsi/scsi_mid_low_api.txt
+++ b/Documentation/scsi/scsi_mid_low_api.txt
@@ -40,7 +40,7 @@ This version of the document roughly matches linux kernel version 2.6.0-test4.
 Documentation
 =============
 There is a SCSI documentation directory within the kernel source tree, 
-typically /usr/src/linux/Documentation/scsi . Most documents are in plain
+typically Documentation/scsi . Most documents are in plain
 (i.e. ASCII) text. This file is named scsi_mid_low_api.txt and can be 
 found in that directory. A more recent copy of this document may be found
 at http://www.torque.net/scsi/scsi_mid_low_api.txt.gz . 
@@ -827,6 +827,7 @@ The interface functions are listed below in alphabetical order.
 Summary:
    bios_param - fetch head, sector, cylinder info for a disk
    detect - detects HBAs this driver wants to control
+   eh_timed_out - notify the host that a command timer expired
    eh_abort_handler - abort given command
    eh_bus_reset_handler - issue SCSI bus reset
    eh_device_reset_handler - issue SCSI device reset
@@ -894,6 +895,32 @@ Details:
     int detect(struct scsi_host_template * shtp)
 
 
+/**
+ *      eh_timed_out - The timer for the command has just fired
+ *      @scp: identifies command timing out
+ *
+ *      Returns:
+ *
+ *	EH_HANDLED:		I fixed the error, please complete the command
+ *	EH_RESET_TIMER:		I need more time, reset the timer and
+ *				begin counting again
+ *	EH_NOT_HANDLED		Begin normal error recovery
+
+ *
+ *      Locks: None held
+ *
+ *      Calling context: interrupt
+ *
+ *	Notes: This is to give the LLD an opportunity to do local recovery.
+ *	This recovery is limited to determining if the outstanding command
+ *	will ever complete.  You may not abort and restart the command from
+ *	this callback.
+ *
+ *      Optionally defined in: LLD
+ **/
+     int eh_timed_out(struct scsi_cmnd * scp)
+
+
 /**
  *      eh_abort_handler - abort command associated with scp
  *      @scp: identifies command to be aborted
diff --git a/Documentation/sh/new-machine.txt b/Documentation/sh/new-machine.txt
index 8bc5f21f8..eb2dd2e69 100644
--- a/Documentation/sh/new-machine.txt
+++ b/Documentation/sh/new-machine.txt
@@ -188,13 +188,7 @@ adding a machine called vapor):
  - add a new file include/asm-sh/vapor/io.h which contains prototypes for
    any machine specific IO functions prefixed with the machine name, for
    example vapor_inb. These will be needed when filling out the machine
-   vector. In addition, a section is required which defines what to do when
-   building a machine specific version. For example:
-
-     #ifdef __WANT_IO_DEF
-     #define inb  vapor_inb
-     ...
-     #endif
+   vector.
 
    This is the minimum that is required, however there are ample
    opportunities to optimise this. In particular, by making the prototypes
diff --git a/Documentation/sound/alsa/DocBook/writing-an-alsa-driver.tmpl b/Documentation/sound/alsa/DocBook/writing-an-alsa-driver.tmpl
index 934a49a59..fae0c98cf 100644
--- a/Documentation/sound/alsa/DocBook/writing-an-alsa-driver.tmpl
+++ b/Documentation/sound/alsa/DocBook/writing-an-alsa-driver.tmpl
@@ -3641,7 +3641,7 @@ struct _snd_pcm_runtime {
 
         <para>
           More precise information can be found in
-        <filename>alsa-kernel/Documentation/sound/alsa/ControlNames.txt</filename>.
+        <filename>Documentation/sound/alsa/ControlNames.txt</filename>.
         </para>
       </section>
     </section>
@@ -5182,7 +5182,7 @@ struct _snd_pcm_runtime {
       The callback is much more complicated than the text-file
       version. You need to use a low-level i/o functions such as
       <function>copy_from/to_user()</function> to transfer the
-      data. Also, you have to keep tracking the file position, too. 
+      data.
 
       <informalexample>
         <programlisting>
@@ -5190,14 +5190,15 @@ struct _snd_pcm_runtime {
   static long my_file_io_read(snd_info_entry_t *entry,
                               void *file_private_data,
                               struct file *file,
-                              char *buf, long count)
+                              char *buf,
+                              unsigned long count,
+                              unsigned long pos)
   {
           long size = count;
-          if (file->f_pos + size > local_max_size)
-                  size = local_max_size - file->f_pos;
-          if (copy_to_user(buf, local_data + file->f_pos, size))
+          if (pos + size > local_max_size)
+                  size = local_max_size - pos;
+          if (copy_to_user(buf, local_data + pos, size))
                   return -EFAULT;
-          file->f_pos += size;
           return size;
   }
 ]]>
diff --git a/Documentation/sound/oss/INSTALL.awe b/Documentation/sound/oss/INSTALL.awe
index 3bf7861ac..310f42ca1 100644
--- a/Documentation/sound/oss/INSTALL.awe
+++ b/Documentation/sound/oss/INSTALL.awe
@@ -114,7 +114,7 @@ See INSTALL.RH for more details.
 		# insmod awe_wave
 		(Be sure to load awe_wave after sb!)
 
-		See /usr/src/linux/Documentation/sound/oss/AWE32 for
+		See Documentation/sound/oss/AWE32 for
 		more details.
 
   9. (only for obsolete systems) If you don't have /dev/sequencer
diff --git a/Documentation/sound/oss/Introduction b/Documentation/sound/oss/Introduction
index caffe54e7..15d4fb975 100644
--- a/Documentation/sound/oss/Introduction
+++ b/Documentation/sound/oss/Introduction
@@ -24,7 +24,7 @@ History:
 ========
 0.1.0  11/20/1998  First version, draft
 1.0.0  11/1998     Alan Cox changes, incorporation in 2.2.0
-                   as /usr/src/linux/Documentation/sound/oss/Introduction
+                   as Documentation/sound/oss/Introduction
 1.1.0  6/30/1999   Second version, added notes on making the drivers,
                    added info on multiple sound cards of similar types,]
                    added more diagnostics info, added info about esd.
@@ -439,7 +439,7 @@ For More Information (RTFM):
 
 4)  OSS's WWW site at http://www.opensound.com.
 
-5)  All the files in linux/Documentation/sound.
+5)  All the files in Documentation/sound.
 
 6)  The comments and code in linux/drivers/sound.
 
diff --git a/Documentation/sound/oss/PAS16 b/Documentation/sound/oss/PAS16
index 3a6375139..951b3dce5 100644
--- a/Documentation/sound/oss/PAS16
+++ b/Documentation/sound/oss/PAS16
@@ -9,7 +9,7 @@ and others whose names I could not find.
 This documentation is relevant for the PAS16 driver (pas2_card.c and
 friends) under kernel version 2.3.99 and later.  If you are
 unfamiliar with configuring sound under Linux, please read the
-Sound-HOWTO, linux/Documentation/sound/oss/Introduction and other
+Sound-HOWTO, Documentation/sound/oss/Introduction and other
 relevant docs first.
 
 The following information is relevant information from README.OSS
@@ -60,7 +60,7 @@ With PAS16 you can use two audio device files at the same time. /dev/dsp (and
 
 The new stuff for 2.3.99 and later
 ============================================================================
-The following configuration options from linux/Documentation/Configure.help
+The following configuration options from Documentation/Configure.help
 are relevant to configuring the PAS16:
 
 Sound card support
diff --git a/Documentation/sysctl/README b/Documentation/sysctl/README
index 5afb48b68..8c3306e01 100644
--- a/Documentation/sysctl/README
+++ b/Documentation/sysctl/README
@@ -60,11 +60,11 @@ debug/		<empty>
 dev/		device specific information (eg dev/cdrom/info)
 fs/		specific filesystems
 		filehandle, inode, dentry and quota tuning
-		binfmt_misc <linux/Documentation/binfmt_misc.txt>
+		binfmt_misc <Documentation/binfmt_misc.txt>
 kernel/		global kernel info / tuning
 		miscellaneous stuff
 net/		networking stuff, for documentation look in:
-		<linux/Documentation/networking/>
+		<Documentation/networking/>
 proc/		<empty>
 sunrpc/		SUN Remote Procedure Call (NFS)
 vm/		memory management tuning
diff --git a/Documentation/sysctl/vm.txt b/Documentation/sysctl/vm.txt
index fc3e413c3..b0349d8aa 100644
--- a/Documentation/sysctl/vm.txt
+++ b/Documentation/sysctl/vm.txt
@@ -24,11 +24,14 @@ Currently, these files are in /proc/sys/vm:
 - dirty_writeback_centisecs
 - max_map_count
 - min_free_kbytes
+- laptop_mode
+- block_dump
 
 ==============================================================
 
 dirty_ratio, dirty_background_ratio, dirty_expire_centisecs,
-dirty_writeback_centisecs:
+dirty_writeback_centisecs, vfs_cache_pressure, laptop_mode,
+block_dump:
 
 See Documentation/filesystems/proc.txt
 
diff --git a/Documentation/usb/URB.txt b/Documentation/usb/URB.txt
index 6c508f192..d59b95cc6 100644
--- a/Documentation/usb/URB.txt
+++ b/Documentation/usb/URB.txt
@@ -4,7 +4,7 @@ Again:   2002-Jul-06
     NOTE:
 
     The USB subsystem now has a substantial section in "The Linux Kernel API"
-    guide (in linux/Documentation/DocBook), generated from the current source
+    guide (in Documentation/DocBook), generated from the current source
     code.  This particular documentation file isn't particularly current or
     complete; don't rely on it except for a quick overview.
 
diff --git a/Documentation/usb/error-codes.txt b/Documentation/usb/error-codes.txt
index 7fb11c33d..64ade120d 100644
--- a/Documentation/usb/error-codes.txt
+++ b/Documentation/usb/error-codes.txt
@@ -47,6 +47,8 @@ USB-specific:
 -ESHUTDOWN	The host controller has been disabled due to some
 		problem that could not be worked around.
 
+-EPERM		Submission failed because urb->reject was set.
+
 
 **************************************************************************
 *                   Error codes returned by in urb->status               *
diff --git a/Documentation/usb/philips.txt b/Documentation/usb/philips.txt
index 5cb2089e8..04a640d72 100644
--- a/Documentation/usb/philips.txt
+++ b/Documentation/usb/philips.txt
@@ -1,13 +1,40 @@
-This file contains some additional information for the Philips webcams.
-E-mail: webcam@smcc.demon.nl                        Last updated: 2001-09-24
-
-The main webpage for the Philips driver is http://www.smcc.demon.nl/webcam/.
-It contains a lot of extra information, a FAQ, and the binary plugin
-'PWCX'. This plugin contains decompression routines that allow you to
-use higher image sizes and framerates; in addition the webcam uses less
-bandwidth on the USB bus (handy if you want to run more than 1 camera
-simultaneously). These routines fall under an NDA, and may therefor not be
-distributed as source; however, its use is completely optional.
+This file contains some additional information for the Philips and OEM webcams.
+E-mail: webcam@smcc.demon.nl                        Last updated: 2004-01-19
+Site: http://www.smcc.demon.nl/webcam/
+
+As of this moment, the following cameras are supported:
+ * Philips PCA645
+ * Philips PCA646
+ * Philips PCVC675
+ * Philips PCVC680
+ * Philips PCVC690
+ * Philips PCVC720/40
+ * Philips PCVC730
+ * Philips PCVC740
+ * Philips PCVC750
+ * Askey VC010
+ * Creative Labs Webcam 5
+ * Creative Labs Webcam Pro Ex
+ * Logitech QuickCam 3000 Pro
+ * Logitech QuickCam 4000 Pro
+ * Logitech QuickCam Notebook Pro
+ * Logitech QuickCam Zoom
+ * Logitech QuickCam Orbit
+ * Logitech QuickCam Sphere
+ * Samsung MPC-C10
+ * Samsung MPC-C30
+ * Sotec Afina Eye
+ * AME CU-001
+ * Visionite VCS-UM100
+ * Visionite VCS-UC300
+
+The main webpage for the Philips driver is at the address above. It contains
+a lot of extra information, a FAQ, and the binary plugin 'PWCX'. This plugin
+contains decompression routines that allow you to use higher image sizes and
+framerates; in addition the webcam uses less bandwidth on the USB bus (handy
+if you want to run more than 1 camera simultaneously). These routines fall
+under a NDA, and may therefor not be distributed as source; however, its use
+is completely optional.
 
 You can build this code either into your kernel, or as a module. I recommend
 the latter, since it makes troubleshooting a lot easier. The built-in
@@ -27,14 +54,14 @@ fps
    Specifies the desired framerate. Is an integer in the range of 4-30.
 
 fbufs
-   This parameter specifies the number of internal buffers to use for storing 
+   This paramter specifies the number of internal buffers to use for storing 
    frames from the cam. This will help if the process that reads images from 
-   the cam is a bit slow or momentarily busy. However, on slow machines it
+   the cam is a bit slow or momentarely busy. However, on slow machines it 
    only introduces lag, so choose carefully. The default is 3, which is 
    reasonable. You can set it between 2 and 5.
 
 mbufs
-   This is an integer between 1 and 4. It will tell the module the number of
+   This is an integer between 1 and 10. It will tell the module the number of
    buffers to reserve for mmap(), VIDIOCCGMBUF, VIDIOCMCAPTURE and friends.
    The default is 2, which is adequate for most applications (double
    buffering).
@@ -45,9 +72,9 @@ mbufs
    slack when your program is behind. But you need a multi-threaded or
    forked program to really take advantage of these buffers.
 
-   The absolute maximum is 4, but don't set it too high!  Every buffer takes
-   up 1.22 MB of RAM, so unless you have a lot of memory setting this to
-   something more than 2 is an absolute waste.  This memory is only
+   The absolute maximum is 10, but don't set it too high!  Every buffer takes
+   up 460 KB of RAM, so unless you have a lot of memory setting this to
+   something more than 4 is an absolute waste.  This memory is only
    allocated during open(), so nothing is wasted when the camera is not in
    use.
 
@@ -74,9 +101,10 @@ compression (only useful with the plugin)
    introduce some unwanted artefacts. The default is 2, medium compression.
    See the FAQ on the website for an overview of which modes require
    compression.
-      
-   The compression parameter only applies to the Vesta & ToUCam cameras.
-   The 645 and 646 have fixed compression parameters.      
+
+   The compression parameter does not apply to the 645 and 646 cameras
+   and OEM models derived from those (only a few). Most cams honour this
+   parameter.
 
 leds
    This settings takes 2 integers, that define the on/off time for the LED
@@ -89,14 +117,17 @@ leds
 
      leds=0,0
 
-   the LED never goes on, making it suitable for silent survaillance.
+   the LED never goes on, making it suitable for silent surveillance.
 
    By default the camera's LED is on solid while in use, and turned off
    when the camera is not used anymore.
 
-   This parameter works only with the ToUCam range of cameras (730, 740,
-   750). For other cameras this command is silently ignored, and the LED
-   cannot be controlled.
+   This parameter works only with the ToUCam range of cameras (720, 730, 740,
+   750) and OEMs. For other cameras this command is silently ignored, and 
+   the LED cannot be controlled.
+
+   Finally: this parameters does not take effect UNTIL the first time you
+   open the camera device. Until then, the LED remains on.
 
 dev_hint
    A long standing problem with USB devices is their dynamic nature: you
@@ -126,7 +157,7 @@ dev_hint
                                other cameras will get the first free 
                                available slot (see below).
 
-     dev_hint=645:1,680=2      The PCA645 camera will get /dev/video1,
+     dev_hint=645:1,680:2      The PCA645 camera will get /dev/video1,
                                and a PCVC680 /dev/video2.
                                
      dev_hint=645.0123:3,645.4567:0	The PCA645 camera with serialnumber 
@@ -176,13 +207,16 @@ trace
 
       64   0x40   Show viewport and image sizes                       Off
 
+     128   0x80   PWCX debugging                                      Off
 
    For example, to trace the open() & read() fuctions, sum 8 + 4 = 12,
    so you would supply trace=12 during insmod or modprobe. If
    you want to turn the initialization and probing tracing off, set trace=0.
    The default value for trace is 35 (0x23).
 
-   Example:
+
+
+Example:
      
      # modprobe pwc size=cif fps=15 power_save=1
 
@@ -192,7 +226,7 @@ cameras. Each camera has its own set of buffers.
 size and fps only specify defaults when you open() the device; this is to
 accommodate some tools that don't set the size. You can change these
 settings after open() with the Video4Linux ioctl() calls. The default of
-defaults is QCIF size at 10 fps, BGR order.
+defaults is QCIF size at 10 fps.
 
 The compression parameter is semiglobal; it sets the initial compression
 preference for all camera's, but this parameter can be set per camera with
@@ -200,4 +234,3 @@ the VIDIOCPWCSCQUAL ioctl() call.
 
 All parameters are optional.
 
-
diff --git a/Documentation/usb/usb-help.txt b/Documentation/usb/usb-help.txt
index 98ade189e..b7c324973 100644
--- a/Documentation/usb/usb-help.txt
+++ b/Documentation/usb/usb-help.txt
@@ -2,7 +2,7 @@ usb-help.txt
 2000-July-12
 
 For USB help other than the readme files that are located in
-linux/Documentation/usb/*, see the following:
+Documentation/usb/*, see the following:
 
 Linux-USB project:  http://www.linux-usb.org
   mirrors at        http://www.suse.cz/development/linux-usb/
diff --git a/Documentation/usb/w9968cf.txt b/Documentation/usb/w9968cf.txt
index 65775f067..f52d65e55 100644
--- a/Documentation/usb/w9968cf.txt
+++ b/Documentation/usb/w9968cf.txt
@@ -23,6 +23,9 @@ Index
 ============
 Copyright (C) 2002-2004 by Luca Risolia <luca.risolia@studio.unibo.it>
 
+Winbond is a trademark of Winbond Electronics Corporation.
+This driver is not sponsored or developed by Winbond.
+
 
 2. License
 ==========
@@ -44,8 +47,8 @@ Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
 3. Overview
 ===========
 This driver supports the video streaming capabilities of the devices mounting
-Winbond W9967CF and Winbond W9968CF JPEG USB Dual Mode Camera Chips, when they
-are being commanded by USB. OV681 based cameras should be supported as well.
+Winbond W9967CF and Winbond W9968CF JPEG USB Dual Mode Camera Chips. OV681
+based cameras should be supported as well.
 
 The driver is divided into two modules: the basic one, "w9968cf", is needed for
 the supported devices to work; the second one, "w9968cf-vpp", is an optional
@@ -58,7 +61,8 @@ Please keep in mind that official kernels do NOT include the second module for
 performance purposes. However it is always recommended to download and install
 the latest and complete release of the driver, replacing the existing one, if
 present: it will be still even possible not to load the "w9968cf-vpp" module at
-all, if you ever want to.
+all, if you ever want to. Another important missing feature of the version in
+the official Linux 2.4 kernels is the writeable /proc filesystem interface.
 
 The latest and full-featured version of the W996[87]CF driver can be found at:
 http://go.lamarinapunto.com/ . Please refer to the documentation included in
@@ -68,38 +72,37 @@ Up to 32 cameras can be handled at the same time. They can be connected and
 disconnected from the host many times without turning off the computer, if
 your system supports the hotplug facility.
 
-To change the default settings for each camera, many paramaters can be passed
+To change the default settings for each camera, many parameters can be passed
 through command line when the module is loaded into memory.
 
-The driver relies on the Video4Linux, USB and I2C core modules of the official
-Linux kernels. It has been designed to run properly on SMP systems as well.
-At the moment, an additional module, "ovcamchip", is mandatory; it provides
-support for some OmniVision CMOS sensors connected to the W996[87]CF chips.
-
-The "ovcamchip" module is part of the OV511 driver, version 2.27, which can be
-downloaded from internet:
-http://alpha.dyndns.org/ov511/
-To know how to compile it, read the documentation included in the OV511 
-package.
+The driver relies on the Video4Linux, USB and I2C core modules. It has been
+designed to run properly on SMP systems as well. An additional module,
+"ovcamchip", is mandatory; it provides support for some OmniVision image
+sensors connected to the W996[87]CF chips; if found in the system, the module
+will be automatically loaded by default (provided that the kernel has been
+compiled with the automatic module loading option).
 
 
 4. Supported devices
 ====================
 At the moment, known W996[87]CF and OV681 based devices are:
-- Aroma Digi Pen ADG-5000 Refurbished
-- AVerTV USB
-- Creative Labs Video Blaster WebCam Go
-- Creative Labs Video Blaster WebCam Go Plus
-- Die Lebon LDC-D35A Digital Kamera
-- Ezonics EZ-802 EZMega Cam
-- OPCOM Digi Pen VGA Dual Mode Pen Camera
+- Aroma Digi Pen VGA Dual Mode ADG-5000 (unknown image sensor)
+- AVerMedia AVerTV USB (SAA7111A, Philips FI1216Mk2 tuner, PT2313L audio chip)
+- Creative Labs Video Blaster WebCam Go (OmniVision OV7610 sensor)
+- Creative Labs Video Blaster WebCam Go Plus (OmniVision OV7620 sensor)
+- Lebon LDC-035A (unknown image sensor)
+- Ezonics EZ-802 EZMega Cam (OmniVision OV8610C sensor)
+- OmniVision OV8610-EDE (OmniVision OV8610 sensor)
+- OPCOM Digi Pen VGA Dual Mode Pen Camera (unknown image sensor)
+- Pretec Digi Pen-II (OmniVision OV7620 sensor)
+- Pretec DigiPen-480 (OmniVision OV8610 sensor)
 
 If you know any other W996[87]CF or OV681 based cameras, please contact me.
 
 The list above does NOT imply that all those devices work with this driver: up
-until now only webcams that have a CMOS sensor supported by the "ovcamchip"
+until now only webcams that have an image sensor supported by the "ovcamchip"
 module work. 
-For a list of supported CMOS sensors, please visit the author's homepage on
+For a list of supported image sensors, please visit the author's homepage on
 this module: http://alpha.dyndns.org/ov511/
 
 Possible external microcontrollers of those webcams are not supported: this
@@ -112,8 +115,10 @@ additional testing and full support, would be much appreciated.
 
 5. Module dependencies
 ======================
-For it to work properly, the driver needs kernel support for Video4Linux, 
-USB and I2C, and a third-party module for the CMOS sensor.
+For it to work properly, the driver needs kernel support for Video4Linux, USB
+and I2C, and the "ovcamchip" module for the image sensor. Make sure you are not
+actually using any external "ovcamchip" module, given that the W996[87]CF 
+driver depends on the version of the module present in the official kernels.
 
 The following options of the kernel configuration file must be enabled and
 corresponding modules must be compiled:
@@ -128,6 +133,10 @@ corresponding modules must be compiled:
 
 The I2C core module can be compiled statically in the kernel as well.
 
+	# OmniVision Camera Chip support
+	#
+	CONFIG_VIDEO_OVCAMCHIP=m
+
 	# USB support
 	#
 	CONFIG_USB=m
@@ -141,19 +150,12 @@ below is necessary:
 	CONFIG_USB_UHCI_HCD=m
 	CONFIG_USB_OHCI_HCD=m
 
-Also, make sure "Enforce bandwidth allocation" is NOT enabled.
-
 And finally:
 
 	# USB Multimedia devices
 	#
 	CONFIG_USB_W9968CF=m
 
-The last module we need is "ovcamchip.o". To obtain it, you have to download
-the OV511 package, version 2.27 - don't use other versions - and compile it
-according to its documentation. 
-The package is available at http://alpha.dyndns.org/ov511/ .
-
 
 6. Module loading
 =================
@@ -164,11 +166,10 @@ Loading can be done this way, from root:
 
 	[root@localhost home]# modprobe usbcore
 	[root@localhost home]# modprobe i2c-core
-	[root@localhost ov511-x.xx]# insmod ./ovcamchip.ko
 	[root@localhost home]# modprobe w9968cf
 
-At this point the devices should be recognized: "dmesg" can be used to analyze
-kernel messages:
+At this point the pertinent devices should be recognized: "dmesg" can be used
+to analyze kernel messages:
 
 	[user@localhost home]$ dmesg
 
@@ -180,9 +181,22 @@ explanation about them and which syntax to use, it is recommended to run the
 	[root@locahost home]# modinfo w9968cf
 
 
-7. Module paramaters
+7. Module parameters
 ====================
-Module paramaters are listed below:
+Module parameters are listed below:
+-------------------------------------------------------------------------------
+Name:            ovmod_load
+Type:            bool
+Syntax:          <0|1>
+Description:     Automatic 'ovcamchip' module loading: 0 disabled, 1 enabled.
+                 If enabled, 'insmod' searches for the required 'ovcamchip'
+                 module in the system, according to its configuration, and
+                 loads that module automatically. This action is performed as
+                 once soon as the 'w9968cf' module is loaded into memory.
+Default:         1
+Note:            The kernel must be compiled with the CONFIG_KMOD option
+                 enabled for the 'ovcamchip' module to be loaded and for
+                 this parameter to be present.
 -------------------------------------------------------------------------------
 Name:           vppmod_load
 Type:           bool
@@ -191,10 +205,14 @@ Description:    Automatic 'w9968cf-vpp' module loading: 0 disabled, 1 enabled.
                 If enabled, every time an application attempts to open a
                 camera, 'insmod' searches for the video post-processing module
                 in the system and loads it automatically (if present).
-                The 'w9968cf-vpp' module adds extra image manipulation 
+                The optional 'w9968cf-vpp' module adds extra image manipulation
                 capabilities to the 'w9968cf' module,like software up-scaling,
-                colour conversions and video decoding.
+                colour conversions and video decompression for very high frame
+                rates.
 Default:        1
+Note:           The kernel must be compiled with the CONFIG_KMOD option
+                enabled for the 'w9968cf-vpp' module to be loaded and for
+                this parameter to be present.
 -------------------------------------------------------------------------------
 Name:           simcams 
 Type:           int 
@@ -237,7 +255,7 @@ Syntax:         <0|1[,...]>
 Description:    Hardware double buffering: 0 disabled, 1 enabled.
                 It should be enabled if you want smooth video output: if you
                 obtain out of sync. video, disable it, or try to
-                decrease the 'clockdiv' module paramater value.
+                decrease the 'clockdiv' module parameter value.
 Default:        1 for every device.
 -------------------------------------------------------------------------------
 Name:           clamping
@@ -252,7 +270,7 @@ Syntax:         <0|1|2[,...]>
 Description:    Video filter type.
                 0 none, 1 (1-2-1) 3-tap filter, 2 (2-3-6-3-2) 5-tap filter.
                 The filter is used to reduce noise and aliasing artifacts
-                produced by the CCD or CMOS sensor.
+                produced by the CCD or CMOS image sensor.
 Default:        0 for every device.
 -------------------------------------------------------------------------------
 Name:           largeview
@@ -269,7 +287,7 @@ Description:    Software scaling (for non-compressed video only):
                 Disable it if you have a slow CPU or you don't have enough
                 memory.
 Default:        0 for every device.
-Note:           If 'w9968cf-vpp' is not loaded, this paramater is set to 0.
+Note:           If 'w9968cf-vpp' is not present, this parameter is set to 0.
 -------------------------------------------------------------------------------
 Name:           decompression
 Type:           int array (min = 0, max = 32)
@@ -284,8 +302,8 @@ Description:    Software video decompression:
                 YUV420P/YUV420 in any resolutions where width and height are
                 multiples of 16.
 Default:        2 for every device.
-Note:           If 'w9968cf-vpp' is not loaded, forcing decompression is not
-                allowed; in this case this paramater is set to 2.
+Note:           If 'w9968cf-vpp' is not present, forcing decompression is not
+                allowed; in this case this parameter is set to 2.
 -------------------------------------------------------------------------------
 Name:           force_palette
 Type:           int array (min = 0, max = 32)
@@ -304,9 +322,9 @@ Description:    Force picture palette.
                  3 = RGB565  16 bpp - Software conversion from UYVY
                  4 = RGB24   24 bpp - Software conversion from UYVY
                  5 = RGB32   32 bpp - Software conversion from UYVY
-                When not 0, this paramater will override 'decompression'.
+                When not 0, this parameter will override 'decompression'.
 Default:        0 for every device. Initial palette is 9 (UYVY).
-Note:           If 'w9968cf-vpp' is not loaded, this paramater is set to 9.
+Note:           If 'w9968cf-vpp' is not present, this parameter is set to 9.
 -------------------------------------------------------------------------------
 Name:           force_rgb
 Type:           bool array (min = 0, max = 32)
@@ -320,14 +338,14 @@ Default:        0 for every device.
 Name:           autobright
 Type:           bool array (min = 0, max = 32)
 Syntax:         <0|1[,...]>
-Description:    CMOS sensor automatically changes brightness:
+Description:    Image sensor automatically changes brightness:
                 0 = no, 1 = yes
 Default:        0 for every device.
 -------------------------------------------------------------------------------
 Name:           autoexp
 Type:           bool array (min = 0, max = 32)
 Syntax:         <0|1[,...]>
-Description:    CMOS sensor automatically changes exposure:
+Description:    Image sensor automatically changes exposure:
                 0 = no, 1 = yes
 Default:        1 for every device.
 -------------------------------------------------------------------------------
@@ -354,7 +372,7 @@ Syntax:         <-1|n[,...]>
 Description:    Force pixel clock divisor to a specific value (for experts):
                 n may vary from 0 to 127.
                 -1 for automatic value.
-                See also the 'double_buffer' module paramater.
+                See also the 'double_buffer' module parameter.
 Default:        -1 for every device.
 -------------------------------------------------------------------------------
 Name:           backlight
@@ -374,7 +392,7 @@ Default:        0 for every device.
 Name:           monochrome
 Type:           bool array (min = 0, max = 32)
 Syntax:         <0|1[,...]> 
-Description:    The CMOS sensor is monochrome:
+Description:    The image sensor is monochrome:
                 0 = no, 1 = yes
 Default:        0 for every device.
 -------------------------------------------------------------------------------
@@ -420,7 +438,7 @@ Description:    Debugging information level, from 0 to 6:
                 4 = warnings
                 5 = called functions
                 6 = function internals
-                Level 5 and 6 are useful for testing only, when just one
+                Level 5 and 6 are useful for testing only, when only one
                 device is used.
 Default:        2
 -------------------------------------------------------------------------------
@@ -449,7 +467,7 @@ The development would not have proceed much further without having looked at
 the source code of other drivers and without the help of several persons; in
 particular:
 
-- the I2C interface to kernel and high-level CMOS sensor control routines have
+- the I2C interface to kernel and high-level image sensor control routines have
   been taken from the OV511 driver by Mark McClelland;
 
 - memory management code has been copied from the bttv driver by Ralph Metzler,
diff --git a/Documentation/video4linux/Zoran b/Documentation/video4linux/Zoran
index db46ba263..01425c219 100644
--- a/Documentation/video4linux/Zoran
+++ b/Documentation/video4linux/Zoran
@@ -308,7 +308,7 @@ details (structs/ioctls).
 
 Information - video4linux:
 http://roadrunner.swansea.linux.org.uk/v4lapi.shtml
-/usr/src/linux/Documentation/video4linux/API.html
+Documentation/video4linux/API.html
 /usr/include/linux/videodev.h
 
 Information - video4linux/mjpeg extensions:
diff --git a/MAINTAINERS b/MAINTAINERS
index 553945d52..c8c25df43 100644
--- a/MAINTAINERS
+++ b/MAINTAINERS
@@ -90,6 +90,20 @@ M:	dave@thedillows.org
 L:	linux-net@vger.kernel.org
 S:	Maintained
 
+3W-XXXX ATA-RAID CONTROLLER DRIVER
+P:	Adam Radford
+M:	linuxraid@amcc.com
+L:	linux-scsi@vger.kernel.org
+W:	http://www.amcc.com
+S:	Supported
+
+3W-9XXX SATA-RAID CONTROLLER DRIVER
+P:	Adam Radford
+M:	linuxraid@amcc.com
+L:	linux-scsi@vger.kernel.org
+W:	http://www.amcc.com
+S:	Supported
+
 53C700 AND 53C700-66 SCSI DRIVER
 P:	James E.J. Bottomley
 M:	James.Bottomley@HansenPartnership.com
@@ -230,10 +244,10 @@ S:	Maintained
 ALPHA PORT
 P:	Richard Henderson
 M:	rth@twiddle.net
-S:	Odd Fixes for 2.4; Maintained for 2.5.
+S:	Odd Fixes for 2.4; Maintained for 2.6.
 P:	Ivan Kokshaysky
 M:	ink@jurassic.park.msu.ru
-S:	Maintained for 2.4; PCI support for 2.5.
+S:	Maintained for 2.4; PCI support for 2.6.
 
 APM DRIVER
 P:	Stephen Rothwell
@@ -382,6 +396,11 @@ P:	Marcel Holtmann
 M:	marcel@holtmann.org
 S:	Maintained
 
+BLUETOOTH HIDP LAYER
+P:	Marcel Holtmann
+M:	marcel@holtmann.org
+S:	Maintained
+
 BLUETOOTH HCI UART DRIVER
 P:	Marcel Holtmann
 M:	marcel@holtmann.org
@@ -613,7 +632,7 @@ S:	Maintained
 
 DEFXX FDDI NETWORK DRIVER
 P:	Maciej W. Rozycki
-M:	macro@ds2.pg.gda.pl
+M:	macro@linux-mips.org
 S:	Maintained
 
 DELL LAPTOP SMM DRIVER
@@ -689,6 +708,12 @@ M:	jrv@vanzandt.mv.com
 L:	blinux-list@redhat.com
 S:	Maintained
 
+DRIVER CORE, KOBJECTS, AND SYSFS
+P:	Greg Kroah-Hartman
+M:	greg@kroah.com
+L:	linux-kernel@vger.kernel.org
+S:	Supported
+
 DRM DRIVERS
 L:	dri-devel@lists.sourceforge.net
 S:	Supported
@@ -1090,7 +1115,7 @@ S:	Maintained
 
 IOC3 DRIVER
 P:	Ralf Baechle
-M:	ralf@oss.sgi.com
+M:	ralf@linux-mips.org
 L:	linux-mips@linux-mips.org
 S:	Maintained
 
@@ -1251,6 +1276,27 @@ W:	http://www.linuxppc.org/
 L:	linuxppc-dev@lists.linuxppc.org
 S:	Maintained
 
+LINUX FOR POWERPC EMBEDDED PPC4XX
+P:	Matt Porter
+M:	mporter@kernel.crashing.org
+W:	http://www.penguinppc.org/
+L:	linuxppc-embedded@lists.linuxppc.org
+S:	Maintained
+
+LINUX FOR POWERPC EMBEDDED PPC8XX AND BOOT CODE
+P:	Tom Rini
+M:	trini@kernel.crashing.org
+W:	http://www.penguinppc.org/
+L:	linuxppc-embedded@lists.linuxppc.org
+S:	Maintained
+
+LINUX FOR POWERPC EMBEDDED PPC85XX
+P:     Kumar Gala
+M:     kumar.gala@freescale.com
+W:     http://www.penguinppc.org/
+L:     linuxppc-embedded@lists.linuxppc.org
+S:     Maintained
+
 LLC (802.2)
 P:	Arnaldo Carvalho de Melo
 M:	acme@conectiva.com.br
@@ -1285,11 +1331,14 @@ M:	matthew@wil.cx
 L:	linux-scsi@vger.kernel.org
 S:	Maintained
 
-M68K
-P:	Jes Sorensen
-M:	jes@trained-monkey.org
-W:	http://www.clark.net/pub/lawrencc/linux/index.html
+M68K ARCHITECTURE
+P:	Geert Uytterhoeven
+M:	geert@linux-m68k.org
+P:	Roman Zippel
+M:	zippel@linux-m68k.org
 L:	linux-m68k@lists.linux-m68k.org
+W:	http://www.linux-m68k.org/
+W:	http://linux-m68k-cvs.ubb.ca/
 S:	Maintained
 
 M68K ON APPLE MACINTOSH
@@ -1318,6 +1367,13 @@ P:	Zach Brown
 M:	zab@zabbo.net
 S:	Odd Fixes
 
+MARVELL MV64340 ETHERNET DRIVER
+P:	Manish Lachwani
+M:	Manish_Lachwani@pmc-sierra.com
+L:	linux-mips@linux-mips.org
+L:	netdev@oss.sgi.com
+S:	Supported
+
 MATROX FRAMEBUFFER DRIVER
 P:	Petr Vandrovec
 M:	vandrove@vc.cvut.cz
@@ -1328,7 +1384,7 @@ MEMORY TECHNOLOGY DEVICES
 P:	David Woodhouse
 M:	dwmw2@redhat.com
 W:	http://www.linux-mtd.infradead.org/
-L:	mtd@infradead.org
+L:	linux-mtd@lists.infradead.org
 S:	Maintained
 
 MICROTEK X6 SCANNER
@@ -1338,7 +1394,7 @@ S:	Maintained
 
 MIPS
 P:	Ralf Baechle
-M:	ralf@gnu.org
+M:	ralf@linux-mips.org
 W:	http://oss.sgi.com/mips/mips-howto.html
 L:	linux-mips@linux-mips.org
 S:	Maintained
@@ -1448,6 +1504,8 @@ P:	James Morris
 M:	jmorris@redhat.com
 P:	Hideaki YOSHIFUJI
 M:	yoshfuji@linux-ipv6.org
+P:	Patrick McHardy
+M:	kaber@coreworks.de
 L:	netdev@oss.sgi.com
 S:	Maintained
 
@@ -1511,7 +1569,7 @@ S:	Maintained
 ONSTREAM SCSI TAPE DRIVER
 P:	Willem Riede
 M:	osst@riede.org
-L:	osst@linux1.onstream.nl
+L:	osst-users@lists.sourceforge.net
 L:	linux-scsi@vger.kernel.org
 S:	Maintained
 
@@ -1816,7 +1874,7 @@ P:	Andrey Panin
 M:	pazke@donpac.ru
 L:	linux-visws-devel@lists.sf.net
 W:	http://linux-visws.sf.net
-S:	Maintained for 2.5.
+S:	Maintained for 2.6.
 
 SIS 5513 IDE CONTROLLER DRIVER
 P:	Lionel Bouton
@@ -1899,8 +1957,8 @@ L:	ultralinux@vger.kernel.org
 S:	Maintained
 
 SPARC (sparc32):
-P:	Keith M. Wesolowski
-M:	wesolows@foobazco.org
+P:	William L. Irwin
+M:	wli@holomorphy.com
 L:	sparclinux@vger.kernel.org
 S:	Maintained
 
@@ -1923,11 +1981,6 @@ M:	jbglaw@lug-owl.de
 L:	linux-kernel@vger.kernel.org
 S:	Maintained
 
-STALLION TECHNOLOGIES MULTIPORT SERIAL BOARDS
-M:	support@stallion.oz.au
-W:	http://www.stallion.com
-S:	Supported
-
 STARFIRE/DURALAN NETWORK DRIVER
 P:	Ion Badulescu
 M:	ionut@cs.columbia.edu
@@ -1944,16 +1997,26 @@ W:	http://mpeg.openprojects.net/
 W:	http://www.stradis.com/
 S:	Maintained
 
-SUPERH
-P:	Niibe Yutaka
-M:	gniibe@m17n.org
+SUPERH (sh)
+P:	Paul Mundt
+M:	lethal@linux-sh.org
 P:	Kazumoto Kojima
 M:	kkojima@rr.iij4u.or.jp
 L:	linux-sh@m17n.org
+W:	http://www.linux-sh.org
 W:	http://www.m17n.org/linux-sh/
 W:	http://www.rr.iij4u.or.jp/~kkojima/linux-sh4.html
 S:	Maintained
 
+SUPERH64 (sh64)
+P:	Paul Mundt
+M:	lethal@linux-sh.org
+P:	Richard Curnow
+M:	richard.curnow@superh.com
+L:	linuxsh-shmedia-dev@lists.sourceforge.net
+W:	http://www.linux-sh.org
+S:	Maintained
+
 SUN3/3X
 P:	Sam Creasey
 M:	sammy@sammy.net
@@ -2323,6 +2386,12 @@ P:	Gerd Knorr
 M:	kraxel@bytesex.org
 S:	Maintained
 
+W1 DALLAS'S 1-WIRE BUS
+P:	Evgeniy Polyakov
+M:	johnpol@2ka.mipt.ru
+L:	sensors@stimpy.netroedge.com
+S:	Maintained
+
 WAN ROUTER & SANGOMA WANPIPE DRIVERS & API (X.25, FRAME RELAY, PPP, CISCO HDLC)
 P:	Nenad Corbic
 M:	ncorbic@sangoma.com
diff --git a/Makefile b/Makefile
index 47f2c2f3e..c52759dd3 100644
--- a/Makefile
+++ b/Makefile
@@ -1,7 +1,7 @@
 VERSION = 2
 PATCHLEVEL = 6
-SUBLEVEL = 7
-EXTRAVERSION = -vs1.9.1.12
+SUBLEVEL = 8
+EXTRAVERSION =
 NAME=Zonked Quokka
 
 # *DOCUMENTATION*
@@ -53,7 +53,7 @@ ifndef KBUILD_CHECKSRC
   KBUILD_CHECKSRC = 0
 endif
 
-# Use make M=dir to specify direcotry of external module to build
+# Use make M=dir to specify directory of external module to build
 # Old syntax make ... SUBDIRS=$PWD is still supported
 # Setting the environment variable KBUILD_EXTMOD take precedence
 ifdef SUBDIRS
@@ -130,16 +130,6 @@ else
 _all: modules
 endif
 
-# Make sure we're not wasting cpu-cycles doing locale handling, yet do make
-# sure error messages appear in the user-desired language
-ifdef LC_ALL
-LANG := $(LC_ALL)
-LC_ALL :=
-endif
-LC_COLLATE := C
-LC_CTYPE := C
-export LANG LC_ALL LC_COLLATE LC_CTYPE
-
 srctree		:= $(if $(KBUILD_SRC),$(KBUILD_SRC),$(CURDIR))
 TOPDIR		:= $(srctree)
 # FIXME - TOPDIR is obsolete, use srctree/objtree
@@ -290,8 +280,6 @@ STRIP		= $(CROSS_COMPILE)strip
 OBJCOPY		= $(CROSS_COMPILE)objcopy
 OBJDUMP		= $(CROSS_COMPILE)objdump
 AWK		= awk
-RPM 		:= $(shell if [ -x "/usr/bin/rpmbuild" ]; then echo rpmbuild; \
-		    	else echo rpm; fi)
 GENKSYMS	= scripts/genksyms/genksyms
 DEPMOD		= /sbin/depmod
 KALLSYMS	= scripts/kallsyms
@@ -334,8 +322,8 @@ depfile = $(subst $(comma),_,$(@D)/.$(@F).d)
 
 # Files to ignore in find ... statements
 
-RCS_FIND_IGNORE := \( -name SCCS -o -name BitKeeper -o -name .svn -o -name CVS \) -prune -o
-RCS_TAR_IGNORE := --exclude SCCS --exclude BitKeeper --exclude .svn --exclude CVS
+RCS_FIND_IGNORE := \( -name SCCS -o -name BitKeeper -o -name .svn -o -name CVS -o -name .pc \) -prune -o
+RCS_TAR_IGNORE := --exclude SCCS --exclude BitKeeper --exclude .svn --exclude CVS --exclude .pc
 
 # ===========================================================================
 # Rules shared between *config targets and build targets
@@ -409,13 +397,6 @@ scripts: scripts_basic include/config/MARKER
 
 scripts_basic: include/linux/autoconf.h
 
-
-# That's our default target when none is given on the command line
-# Note that 'modules' will be added as a prerequisite as well, 
-# in the CONFIG_MODULES part below
-
-all:	vmlinux
-
 # Objects we will link into vmlinux / subdirs we need to visit
 init-y		:= init/
 drivers-y	:= drivers/ sound/
@@ -449,6 +430,19 @@ endif
 
 include $(srctree)/arch/$(ARCH)/Makefile
 
+# Default kernel image to build when no specific target is given.
+# KBUILD_IMAGE may be overruled on the commandline or
+# set in the environment
+# Also any assingments in arch/$(ARCH)/Makefiel take precedence over
+# this default value
+export KBUILD_IMAGE ?= vmlinux
+
+# The all: target is the default when no target is given on the
+# command line.
+# This allow a user to issue only 'make' to build a kernel including modules
+# Defaults vmlinux but it is usually overriden in the arch makefile
+all: vmlinux
+
 ifdef CONFIG_CC_OPTIMIZE_FOR_SIZE
 CFLAGS		+= -Os
 else
@@ -544,10 +538,7 @@ define rule_vmlinux__
 	echo 'cmd_$@ := $(cmd_vmlinux__)' > $(@D)/.$(@F).cmd
 endef
 
-define rule_vmlinux
-	$(rule_vmlinux__); \
-	$(NM) $@ | grep -v '\(compiled\)\|\(\.o$$\)\|\( [aUw] \)\|\(\.\.ng$$\)\|\(LASH[RL]DI\)' | sort > System.map
-endef
+do_system_map = $(NM) $(1) | grep -v '\(compiled\)\|\(\.o$$\)\|\( [aUw] \)\|\(\.\.ng$$\)\|\(LASH[RL]DI\)' | sort > $(2)
 
 LDFLAGS_vmlinux += -T arch/$(ARCH)/kernel/vmlinux.lds.s
 
@@ -561,30 +552,57 @@ LDFLAGS_vmlinux += -T arch/$(ARCH)/kernel/vmlinux.lds.s
 #	  but due to the added section, some addresses have shifted
 #	  From here, we generate a correct .tmp_kallsyms2.o
 #	o The correct .tmp_kallsyms2.o is linked into the final vmlinux.
+#	o Verify that the System.map from vmlinux matches the map from
+#	  .tmp_vmlinux2, just in case we did not generate kallsyms correctly.
+#	o If CONFIG_KALLSYMS_EXTRA_PASS is set, do an extra pass using
+#	  .tmp_vmlinux3 and .tmp_kallsyms3.o.  This is only meant as a
+#	  temporary bypass to allow the kernel to be built while the
+#	  maintainers work out what went wrong with kallsyms.
 
 ifdef CONFIG_KALLSYMS
 
-kallsyms.o := .tmp_kallsyms2.o
+ifdef CONFIG_KALLSYMS_EXTRA_PASS
+last_kallsyms := 3
+else
+last_kallsyms := 2
+endif
+
+kallsyms.o := .tmp_kallsyms$(last_kallsyms).o
+
+define rule_verify_kallsyms
+	@$(call do_system_map, .tmp_vmlinux$(last_kallsyms), .tmp_System.map)
+	@cmp -s System.map .tmp_System.map || \
+		(echo Inconsistent kallsyms data, try setting CONFIG_KALLSYMS_EXTRA_PASS ; rm .tmp_kallsyms* ; false)
+endef
 
 quiet_cmd_kallsyms = KSYM    $@
 cmd_kallsyms = $(NM) -n $< | $(KALLSYMS) $(foreach x,$(CONFIG_KALLSYMS_ALL),--all-symbols) > $@
 
-.tmp_kallsyms1.o .tmp_kallsyms2.o: %.o: %.S scripts FORCE
+.tmp_kallsyms1.o .tmp_kallsyms2.o .tmp_kallsyms3.o: %.o: %.S scripts FORCE
 	$(call if_changed_dep,as_o_S)
 
 .tmp_kallsyms%.S: .tmp_vmlinux%
 	$(call cmd,kallsyms)
 
 .tmp_vmlinux1: $(vmlinux-objs) arch/$(ARCH)/kernel/vmlinux.lds.s FORCE
-	+$(call if_changed_rule,vmlinux__)
+	$(call if_changed_rule,vmlinux__)
 
 .tmp_vmlinux2: $(vmlinux-objs) .tmp_kallsyms1.o arch/$(ARCH)/kernel/vmlinux.lds.s FORCE
 	$(call if_changed_rule,vmlinux__)
 
+.tmp_vmlinux3: $(vmlinux-objs) .tmp_kallsyms2.o arch/$(ARCH)/kernel/vmlinux.lds.s FORCE
+	$(call if_changed_rule,vmlinux__)
+
 endif
 
 #	Finally the vmlinux rule
 
+define rule_vmlinux
+	$(rule_vmlinux__); \
+	$(call do_system_map, $@, System.map)
+	$(rule_verify_kallsyms)
+endef
+
 vmlinux: $(vmlinux-objs) $(kallsyms.o) arch/$(ARCH)/kernel/vmlinux.lds.s FORCE
 	$(call if_changed_rule,vmlinux)
 
@@ -593,7 +611,11 @@ vmlinux: $(vmlinux-objs) $(kallsyms.o) arch/$(ARCH)/kernel/vmlinux.lds.s FORCE
 
 $(sort $(vmlinux-objs)) arch/$(ARCH)/kernel/vmlinux.lds.s: $(vmlinux-dirs) ;
 
-# 	Handle descending into subdirectories listed in $(vmlinux-dirs)
+# Handle descending into subdirectories listed in $(vmlinux-dirs)
+# Preset locale variables to speed up the build process. Limit locale
+# tweaks to this spot to avoid wrong language settings when running
+# make menuconfig etc.
+# Error messages still appears in the original language
 
 .PHONY: $(vmlinux-dirs)
 $(vmlinux-dirs): prepare-all scripts
@@ -604,14 +626,24 @@ $(vmlinux-dirs): prepare-all scripts
 # A multi level approach is used. prepare1 is updated first, then prepare0.
 # prepare-all is the collection point for the prepare targets.
 
-.PHONY: prepare-all prepare prepare0 prepare1
+.PHONY: prepare-all prepare prepare0 prepare1 prepare2
+
+# prepare 2 generate Makefile to be placed in output directory, if
+# using a seperate output directory. This allows convinient use
+# of make in output directory
+prepare2:
+	$(Q)if [ ! $(srctree) -ef $(objtree) ]; then       \
+	$(CONFIG_SHELL) $(srctree)/scripts/mkmakefile      \
+	    $(srctree) $(objtree) $(VERSION) $(PATCHLEVEL) \
+	    > $(objtree)/Makefile;                         \
+	fi
 
 # prepare1 is used to check if we are building in a separate output directory,
 # and if so do:
 # 1) Check that make has not been executed in the kernel src $(srctree)
 # 2) Create the include2 directory, used for the second asm symlink
 
-prepare1:
+prepare1: prepare2
 ifneq ($(KBUILD_SRC),)
 	@echo '  Using $(srctree) as source for kernel'
 	$(Q)if [ -h $(srctree)/include/asm -o -f $(srctree)/.config ]; then \
@@ -732,9 +764,13 @@ _modinst_:
 		sleep 1; \
 	fi
 	@rm -rf $(MODLIB)/kernel
-	@rm -f $(MODLIB)/build
+	@rm -f $(MODLIB)/source
 	@mkdir -p $(MODLIB)/kernel
-	@ln -s $(TOPDIR) $(MODLIB)/build
+	@ln -s $(srctree) $(MODLIB)/source
+	@if [ ! $(objtree) -ef  $(MODLIB)/build ]; then \
+		rm -f $(MODLIB)/build ; \
+		ln -s $(objtree) $(MODLIB)/build ; \
+	fi
 	$(Q)$(MAKE) -rR -f $(srctree)/scripts/Makefile.modinst
 
 # If System.map exists, run depmod.  This deliberately does not have a
@@ -795,8 +831,8 @@ endef
 
 # Directories & files removed with 'make clean'
 CLEAN_DIRS  += $(MODVERDIR)
-CLEAN_FILES +=	vmlinux System.map kernel.spec \
-                .tmp_kallsyms* .tmp_version .tmp_vmlinux*
+CLEAN_FILES +=	vmlinux System.map \
+                .tmp_kallsyms* .tmp_version .tmp_vmlinux* .tmp_System.map
 
 # Directories & files removed with 'make mrproper'
 MRPROPER_DIRS  += include/config include2
@@ -841,44 +877,26 @@ mrproper: clean archmrproper $(mrproper-dirs)
 .PHONY: distclean
 
 distclean: mrproper
-	@find . $(RCS_FIND_IGNORE) \
+	@find $(srctree) $(RCS_FIND_IGNORE) \
 	 	\( -name '*.orig' -o -name '*.rej' -o -name '*~' \
 		-o -name '*.bak' -o -name '#*#' -o -name '.*.orig' \
 	 	-o -name '.*.rej' -o -size 0 \
 		-o -name '*%' -o -name '.*.cmd' -o -name 'core' \) \
 		-type f -print | xargs rm -f
 
-# RPM target
-# ---------------------------------------------------------------------------
-
-.PHONY: rpm
 
-# Remove hyphens since they have special meaning in RPM filenames
-KERNELPATH=kernel-$(subst -,,$(KERNELRELEASE))
-
-#	If you do a make spec before packing the tarball you can rpm -ta it
-
-spec:
-	$(CONFIG_SHELL) $(srctree)/scripts/mkspec > $(objtree)/kernel.spec
-
-#	a) Build a tar ball
-#	b) generate an rpm from it
-#	c) and pack the result
-#	- Use /. to avoid tar packing just the symlink
+# Packaging of the kernel to various formats
+# ---------------------------------------------------------------------------
+# rpm target kept for backward compatibility
+package-dir	:= $(srctree)/scripts/package
 
-rpm:	clean spec
-	set -e; \
-	cd .. ; \
-	ln -sf $(srctree) $(KERNELPATH) ; \
-	tar -cvz $(RCS_TAR_IGNORE) -f $(KERNELPATH).tar.gz $(KERNELPATH)/. ; \
-	rm $(KERNELPATH)
+.PHONY: %-pkg rpm
 
-	set -e; \
-	$(CONFIG_SHELL) $(srctree)/scripts/mkversion > $(objtree)/.tmp_version;\
-	mv -f $(objtree)/.tmp_version $(objtree)/.version;
+%pkg: FORCE
+	$(Q)$(MAKE) -f $(package-dir)/Makefile $@
+rpm: FORCE
+	$(Q)$(MAKE) -f $(package-dir)/Makefile $@
 
-	$(RPM) --target $(UTS_MACHINE) -ta ../$(KERNELPATH).tar.gz
-	rm ../$(KERNELPATH).tar.gz
 
 # Brief documentation of the typical targets used
 # ---------------------------------------------------------------------------
@@ -905,6 +923,8 @@ help:
 	@echo  '  tags/TAGS	  - Generate tags file for editors'
 	@echo  '  cscope	  - Generate cscope index'
 	@echo  '  checkstack      - Generate a list of stack hogs'
+	@echo  'Kernel packaging:'
+	@$(MAKE) -f $(package-dir)/Makefile help
 	@echo  ''
 	@echo  'Documentation targets:'
 	@$(MAKE) -f $(srctree)/Documentation/DocBook/Makefile dochelp
@@ -997,19 +1017,19 @@ endif # KBUILD_EXTMOD
 # ---------------------------------------------------------------------------
 
 define all-sources
-	( find . $(RCS_FIND_IGNORE) \
+	( find $(srctree) $(RCS_FIND_IGNORE) \
 	       \( -name include -o -name arch \) -prune -o \
 	       -name '*.[chS]' -print; \
-	  find arch/$(ARCH) $(RCS_FIND_IGNORE) \
+	  find $(srctree)/arch/$(ARCH) $(RCS_FIND_IGNORE) \
 	       -name '*.[chS]' -print; \
-	  find security/selinux/include $(RCS_FIND_IGNORE) \
+	  find $(srctree)/security/selinux/include $(RCS_FIND_IGNORE) \
 	       -name '*.[chS]' -print; \
-	  find include $(RCS_FIND_IGNORE) \
+	  find $(srctree)/include $(RCS_FIND_IGNORE) \
 	       \( -name config -o -name 'asm-*' \) -prune \
 	       -o -name '*.[chS]' -print; \
-	  find include/asm-$(ARCH) $(RCS_FIND_IGNORE) \
+	  find $(srctree)/include/asm-$(ARCH) $(RCS_FIND_IGNORE) \
 	       -name '*.[chS]' -print; \
-	  find include/asm-generic $(RCS_FIND_IGNORE) \
+	  find $(srctree)/include/asm-generic $(RCS_FIND_IGNORE) \
 	       -name '*.[chS]' -print )
 endef
 
@@ -1070,7 +1090,7 @@ endif #ifeq ($(mixed-targets),1)
 .PHONY: checkstack
 checkstack:
 	$(OBJDUMP) -d vmlinux $$(find . -name '*.ko') | \
-	$(PERL) scripts/checkstack.pl $(ARCH)
+	$(PERL) $(src)/scripts/checkstack.pl $(ARCH)
 
 # FIXME Should go into a make.lib or something 
 # ===========================================================================
diff --git a/README b/README
index 504e800cf..0df20f072 100644
--- a/README
+++ b/README
@@ -35,7 +35,7 @@ DOCUMENTATION:
 
  - There are various README files in the Documentation/ subdirectory:
    these typically contain kernel-specific installation notes for some 
-   drivers for example. See ./Documentation/00-INDEX for a list of what
+   drivers for example. See Documentation/00-INDEX for a list of what
    is contained in each file.  Please read the Changes file, as it
    contains information about the problems, which may result by upgrading
    your kernel.
@@ -98,7 +98,7 @@ SOFTWARE REQUIREMENTS
 
    Compiling and running the 2.6.xx kernels requires up-to-date
    versions of various software packages.  Consult
-   ./Documentation/Changes for the minimum version numbers required
+   Documentation/Changes for the minimum version numbers required
    and how to get updates for these packages.  Beware that using
    excessively old versions of these packages can cause indirect
    errors that are very difficult to track down, so don't assume that
@@ -168,7 +168,7 @@ COMPILING the kernel:
    gcc 2.91.66 (egcs-1.1.2), and gcc 2.7.2.3 are known to miscompile
    some parts of the kernel, and are *no longer supported*.
    Also remember to upgrade your binutils package (for as/ld/nm and company)
-   if necessary. For more information, refer to ./Documentation/Changes.
+   if necessary. For more information, refer to Documentation/Changes.
 
    Please note that you can still run a.out user programs with this kernel.
 
diff --git a/arch/alpha/Makefile b/arch/alpha/Makefile
index 4854ca379..0337f5f0d 100644
--- a/arch/alpha/Makefile
+++ b/arch/alpha/Makefile
@@ -11,6 +11,7 @@
 NM := $(NM) -B
 
 LDFLAGS_vmlinux	:= -static -N #-relax
+CHECK		:= $(CHECK) -D__alpha__=1
 cflags-y	:= -pipe -mno-fp-regs -ffixed-8
 
 # Determine if we can use the BWX instructions with GAS.
diff --git a/arch/alpha/defconfig b/arch/alpha/defconfig
index 3632f72ed..da929a2ae 100644
--- a/arch/alpha/defconfig
+++ b/arch/alpha/defconfig
@@ -422,7 +422,6 @@ CONFIG_VLAN_8021Q=m
 # 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
 
 #
@@ -791,7 +790,7 @@ CONFIG_NFS_V3=y
 CONFIG_NFSD=m
 CONFIG_NFSD_V3=y
 # CONFIG_NFSD_V4 is not set
-# CONFIG_NFSD_TCP is not set
+CONFIG_NFSD_TCP=y
 CONFIG_LOCKD=m
 CONFIG_LOCKD_V4=y
 CONFIG_EXPORTFS=m
diff --git a/arch/alpha/kernel/core_tsunami.c b/arch/alpha/kernel/core_tsunami.c
index 215a8611b..8aa305bd6 100644
--- a/arch/alpha/kernel/core_tsunami.c
+++ b/arch/alpha/kernel/core_tsunami.c
@@ -263,9 +263,9 @@ tsunami_init_one_pchip(tsunami_pchip *pchip, int index)
 	hose->sparse_mem_base = 0;
 	hose->sparse_io_base = 0;
 	hose->dense_mem_base
-	  = (TSUNAMI_MEM(index) & 0xffffffffff) | 0x80000000000;
+	  = (TSUNAMI_MEM(index) & 0xffffffffffL) | 0x80000000000L;
 	hose->dense_io_base
-	  = (TSUNAMI_IO(index) & 0xffffffffff) | 0x80000000000;
+	  = (TSUNAMI_IO(index) & 0xffffffffffL) | 0x80000000000L;
 
 	hose->config_space_base = TSUNAMI_CONF(index);
 	hose->index = index;
diff --git a/arch/alpha/kernel/entry.S b/arch/alpha/kernel/entry.S
index be1731104..f0927ee53 100644
--- a/arch/alpha/kernel/entry.S
+++ b/arch/alpha/kernel/entry.S
@@ -924,6 +924,24 @@ sys_ptrace:
 	jmp	$31, do_sys_ptrace
 .end sys_ptrace
 
+	.align	4
+	.globl	sys_execve
+	.ent	sys_execve
+sys_execve:
+	.prologue 0
+	mov	$sp, $19
+	jmp	$31, do_sys_execve
+.end sys_execve
+
+	.align	4
+	.globl	osf_sigprocmask
+	.ent	osf_sigprocmask
+osf_sigprocmask:
+	.prologue 0
+	mov	$sp, $18
+	jmp	$31, do_osf_sigprocmask
+.end osf_sigprocmask
+
 	.align	4
 	.globl	alpha_ni_syscall
 	.ent	alpha_ni_syscall
diff --git a/arch/alpha/kernel/init_task.c b/arch/alpha/kernel/init_task.c
index 60722f035..835d09a7b 100644
--- a/arch/alpha/kernel/init_task.c
+++ b/arch/alpha/kernel/init_task.c
@@ -4,6 +4,7 @@
 #include <linux/init.h>
 #include <linux/init_task.h>
 #include <linux/fs.h>
+#include <linux/mqueue.h>
 #include <asm/uaccess.h>
 
 
diff --git a/arch/alpha/kernel/irq.c b/arch/alpha/kernel/irq.c
index 9e8eab6dc..ee987528a 100644
--- a/arch/alpha/kernel/irq.c
+++ b/arch/alpha/kernel/irq.c
@@ -227,7 +227,7 @@ static struct proc_dir_entry * irq_dir[NR_IRQS];
 #ifdef CONFIG_SMP 
 static struct proc_dir_entry * smp_affinity_entry[NR_IRQS];
 static char irq_user_affinity[NR_IRQS];
-static unsigned long irq_affinity[NR_IRQS] = { [0 ... NR_IRQS-1] = ~0UL };
+static cpumask_t irq_affinity[NR_IRQS] = { [0 ... NR_IRQS-1] = CPU_MASK_ALL };
 
 static void
 select_smp_affinity(int irq)
@@ -238,16 +238,14 @@ select_smp_affinity(int irq)
 	if (! irq_desc[irq].handler->set_affinity || irq_user_affinity[irq])
 		return;
 
-	while (((cpu_present_mask >> cpu) & 1) == 0)
+	while (!cpu_possible(cpu))
 		cpu = (cpu < (NR_CPUS-1) ? cpu + 1 : 0);
 	last_cpu = cpu;
 
-	irq_affinity[irq] = 1UL << cpu;
-	irq_desc[irq].handler->set_affinity(irq, 1UL << cpu);
+	irq_affinity[irq] = cpumask_of_cpu(cpu);
+	irq_desc[irq].handler->set_affinity(irq, cpumask_of_cpu(cpu));
 }
 
-#define HEX_DIGITS 16
-
 static int
 irq_affinity_read_proc (char *page, char **start, off_t off,
 			int count, int *eof, void *data)
@@ -259,67 +257,28 @@ irq_affinity_read_proc (char *page, char **start, off_t off,
 	return len;
 }
 
-static unsigned int
-parse_hex_value (const char __user *buffer,
-		 unsigned long count, unsigned long *ret)
-{
-	unsigned char hexnum [HEX_DIGITS];
-	unsigned long value;
-	unsigned long i;
-
-	if (!count)
-		return -EINVAL;
-	if (count > HEX_DIGITS)
-		count = HEX_DIGITS;
-	if (copy_from_user(hexnum, buffer, count))
-		return -EFAULT;
-
-	/*
-	 * Parse the first 8 characters as a hex string, any non-hex char
-	 * is end-of-string. '00e1', 'e1', '00E1', 'E1' are all the same.
-	 */
-	value = 0;
-
-	for (i = 0; i < count; i++) {
-		unsigned int c = hexnum[i];
-
-		switch (c) {
-			case '0' ... '9': c -= '0'; break;
-			case 'a' ... 'f': c -= 'a'-10; break;
-			case 'A' ... 'F': c -= 'A'-10; break;
-		default:
-			goto out;
-		}
-		value = (value << 4) | c;
-	}
-out:
-	*ret = value;
-	return 0;
-}
-
 static int
 irq_affinity_write_proc(struct file *file, const char __user *buffer,
 			unsigned long count, void *data)
 {
 	int irq = (long) data, full_count = count, err;
-	unsigned long new_value;
+	cpumask_t new_value;
 
 	if (!irq_desc[irq].handler->set_affinity)
 		return -EIO;
 
-	err = parse_hex_value(buffer, count, &new_value);
+	err = cpumask_parse(buffer, count, new_value);
 
 	/* The special value 0 means release control of the
 	   affinity to kernel.  */
-	if (new_value == 0) {
+	cpus_and(new_value, new_value, cpu_online_map);
+	if (cpus_empty(new_value)) {
 		irq_user_affinity[irq] = 0;
 		select_smp_affinity(irq);
 	}
 	/* Do not allow disabling IRQs completely - it's a too easy
 	   way to make the system unusable accidentally :-) At least
 	   one online CPU still has to be targeted.  */
-	else if (!(new_value & cpu_present_mask))
-		return -EINVAL;
 	else {
 		irq_affinity[irq] = new_value;
 		irq_user_affinity[irq] = 1;
@@ -344,10 +303,10 @@ static int
 prof_cpu_mask_write_proc(struct file *file, const char __user *buffer,
 			 unsigned long count, void *data)
 {
-	unsigned long *mask = (unsigned long *) data, full_count = count, err;
-	unsigned long new_value;
+	unsigned long full_count = count, err;
+	cpumask_t new_value, *mask = (cpumask_t *)data;
 
-	err = parse_hex_value(buffer, count, &new_value);
+	err = cpumask_parse(buffer, count, new_value);
 	if (err)
 		return err;
 
@@ -402,7 +361,7 @@ init_irq_proc (void)
 	int i;
 
 	/* create /proc/irq */
-	root_irq_dir = proc_mkdir("irq", 0);
+	root_irq_dir = proc_mkdir("irq", NULL);
 
 #ifdef CONFIG_SMP 
 	/* create /proc/irq/prof_cpu_mask */
@@ -457,7 +416,7 @@ request_irq(unsigned int irq, irqreturn_t (*handler)(int, void *, struct pt_regs
 
 	action->handler = handler;
 	action->flags = irqflags;
-	action->mask = 0;
+	cpus_clear(action->mask);
 	action->name = devname;
 	action->next = NULL;
 	action->dev_id = dev_id;
diff --git a/arch/alpha/kernel/osf_sys.c b/arch/alpha/kernel/osf_sys.c
index 3f1721f28..4761ed9a4 100644
--- a/arch/alpha/kernel/osf_sys.c
+++ b/arch/alpha/kernel/osf_sys.c
@@ -588,7 +588,7 @@ osf_sigstack(struct sigstack __user *uss, struct sigstack __user *uoss)
 	int error;
 
 	if (uss) {
-		void *ss_sp;
+		void __user *ss_sp;
 
 		error = -EFAULT;
 		if (get_user(ss_sp, &uss->ss_sp))
@@ -762,7 +762,7 @@ osf_setsysinfo(unsigned long op, void __user *buffer, unsigned long nbytes,
 			info.si_signo = SIGFPE;
 			info.si_errno = 0;
 			info.si_code = si_code;
-			info.si_addr = 0;  /* FIXME */
+			info.si_addr = NULL;  /* FIXME */
  			send_sig_info(SIGFPE, &info, current);
  		}
 
@@ -956,7 +956,7 @@ osf_utimes(char __user *filename, struct timeval32 __user *tvs)
 			return -EFAULT;
 	}
 
-	return do_utimes(filename, tvs ? ktvs : 0);
+	return do_utimes(filename, tvs ? ktvs : NULL);
 }
 
 #define MAX_SELECT_SECONDS \
@@ -1303,7 +1303,7 @@ osf_fix_iov_len(const struct iovec __user *iov, unsigned long count)
 	unsigned long i;
 
 	for (i = 0 ; i < count ; i++) {
-		int *iov_len_high = (int __user *)&iov[i].iov_len + 1;
+		int __user *iov_len_high = (int __user *)&iov[i].iov_len + 1;
 
 		if (put_user(0, iov_len_high))
 			return -EFAULT;
diff --git a/arch/alpha/kernel/process.c b/arch/alpha/kernel/process.c
index f5c5969b7..6fd854655 100644
--- a/arch/alpha/kernel/process.c
+++ b/arch/alpha/kernel/process.c
@@ -119,8 +119,8 @@ common_shutdown_1(void *generic_ptr)
 
 #ifdef CONFIG_SMP
 	/* Wait for the secondaries to halt. */
-	clear_bit(boot_cpuid, &cpu_present_mask);
-	while (cpu_present_mask)
+	cpu_clear(boot_cpuid, cpu_possible_map);
+	while (cpus_weight(cpu_possible_map))
 		barrier();
 #endif
 
@@ -189,7 +189,7 @@ EXPORT_SYMBOL(machine_power_off);
 void
 show_regs(struct pt_regs *regs)
 {
-	dik_show_regs(regs, 0);
+	dik_show_regs(regs, NULL);
 }
 
 /*
@@ -456,19 +456,10 @@ dump_elf_task_fp(elf_fpreg_t *dest, struct task_struct *task)
 
 /*
  * sys_execve() executes a new program.
- *
- * This works due to the alpha calling sequence: the first 6 args
- * are gotten from registers, while the rest is on the stack, so
- * we get a0-a5 for free, and then magically find "struct pt_regs"
- * on the stack for us..
- *
- * Don't do this at home.
  */
 asmlinkage int
-sys_execve(char __user *ufilename, char __user * __user *argv,
-	   char __user * __user *envp,
-	   unsigned long a3, unsigned long a4, unsigned long a5,
-	   struct pt_regs regs)
+do_sys_execve(char __user *ufilename, char __user * __user *argv,
+	      char __user * __user *envp, struct pt_regs *regs)
 {
 	int error;
 	char *filename;
@@ -477,7 +468,7 @@ sys_execve(char __user *ufilename, char __user * __user *argv,
 	error = PTR_ERR(filename);
 	if (IS_ERR(filename))
 		goto out;
-	error = do_execve(filename, argv, envp, &regs);
+	error = do_execve(filename, argv, envp, regs);
 	putname(filename);
 out:
 	return error;
diff --git a/arch/alpha/kernel/setup.c b/arch/alpha/kernel/setup.c
index 1dff8e6c9..71d2205aa 100644
--- a/arch/alpha/kernel/setup.c
+++ b/arch/alpha/kernel/setup.c
@@ -39,6 +39,7 @@
 #include <linux/reboot.h>
 #endif
 #include <linux/notifier.h>
+#include <asm/setup.h>
 #include <asm/io.h>
 
 extern struct notifier_block *panic_notifier_list;
@@ -122,7 +123,6 @@ static void get_sysnames(unsigned long, unsigned long, unsigned long,
 static void determine_cpu_caches (unsigned int);
 
 static char command_line[COMMAND_LINE_SIZE];
-char saved_command_line[COMMAND_LINE_SIZE];
 
 /*
  * The format of "screen_info" is strange, and due to early
@@ -1246,9 +1246,9 @@ show_cpuinfo(struct seq_file *f, void *slot)
 		       platform_string(), nr_processors);
 
 #ifdef CONFIG_SMP
-	seq_printf(f, "cpus active\t\t: %ld\n"
+	seq_printf(f, "cpus active\t\t: %d\n"
 		      "cpu active mask\t\t: %016lx\n",
-		       num_online_cpus(), cpu_present_mask);
+		       num_online_cpus(), cpus_addr(cpu_possible_map)[0]);
 #endif
 
 	show_cache_size (f, "L1 Icache", alpha_l1i_cacheshape);
diff --git a/arch/alpha/kernel/signal.c b/arch/alpha/kernel/signal.c
index d908d7760..dd1d9195c 100644
--- a/arch/alpha/kernel/signal.c
+++ b/arch/alpha/kernel/signal.c
@@ -53,8 +53,7 @@ static int do_signal(sigset_t *, struct pt_regs *, struct switch_stack *,
  * operation, as all of this is local to this thread.
  */
 asmlinkage unsigned long
-osf_sigprocmask(int how, unsigned long newmask, long a2, long a3,
-		long a4, long a5, struct pt_regs regs)
+do_osf_sigprocmask(int how, unsigned long newmask, struct pt_regs *regs)
 {
 	unsigned long oldmask = -EINVAL;
 
@@ -78,7 +77,7 @@ osf_sigprocmask(int how, unsigned long newmask, long a2, long a3,
 		recalc_sigpending();
 		spin_unlock_irq(&current->sighand->siglock);
 
-		(&regs)->r0 = 0;		/* special no error return */
+		regs->r0 = 0;		/* special no error return */
 	}
 	return oldmask;
 }
@@ -304,7 +303,7 @@ do_sigreturn(struct sigcontext __user *sc, struct pt_regs *regs,
 		info.si_signo = SIGTRAP;
 		info.si_errno = 0;
 		info.si_code = TRAP_BRKPT;
-		info.si_addr = (void *) regs->pc;
+		info.si_addr = (void __user *) regs->pc;
 		info.si_trapno = 0;
 		send_sig_info(SIGTRAP, &info, current);
 	}
@@ -342,7 +341,7 @@ do_rt_sigreturn(struct rt_sigframe __user *frame, struct pt_regs *regs,
 		info.si_signo = SIGTRAP;
 		info.si_errno = 0;
 		info.si_code = TRAP_BRKPT;
-		info.si_addr = (void *) regs->pc;
+		info.si_addr = (void __user *) regs->pc;
 		info.si_trapno = 0;
 		send_sig_info(SIGTRAP, &info, current);
 	}
diff --git a/arch/alpha/kernel/smc37c669.c b/arch/alpha/kernel/smc37c669.c
index 69e4ae65e..363267242 100644
--- a/arch/alpha/kernel/smc37c669.c
+++ b/arch/alpha/kernel/smc37c669.c
@@ -996,7 +996,7 @@ static SMC37c669_CONFIG_REGS *SMC37c669 __initdata = NULL;
 ** and standard ISA IRQs.
 **
 */
-static SMC37c669_IRQ_TRANSLATION_ENTRY *SMC37c669_irq_table __initdata = 0; 
+static SMC37c669_IRQ_TRANSLATION_ENTRY *SMC37c669_irq_table __initdata; 
 
 /*
 ** The following definition is for the default IRQ 
@@ -1045,7 +1045,7 @@ static SMC37c669_IRQ_TRANSLATION_ENTRY *SMC37c669_irq_tables[] __initdata =
 ** ISA DMA channels.
 **
 */
-static SMC37c669_DRQ_TRANSLATION_ENTRY *SMC37c669_drq_table __initdata = 0;
+static SMC37c669_DRQ_TRANSLATION_ENTRY *SMC37c669_drq_table __initdata;
 
 /*
 ** The following definition is the default DRQ
diff --git a/arch/alpha/kernel/smp.c b/arch/alpha/kernel/smp.c
index 9f4aed859..3a4c9d6e2 100644
--- a/arch/alpha/kernel/smp.c
+++ b/arch/alpha/kernel/smp.c
@@ -68,7 +68,7 @@ enum ipi_message_type {
 static int smp_secondary_alive __initdata = 0;
 
 /* Which cpus ids came online.  */
-unsigned long cpu_present_mask;
+cpumask_t cpu_present_mask;
 cpumask_t cpu_online_map;
 
 EXPORT_SYMBOL(cpu_online_map);
@@ -522,7 +522,7 @@ setup_smp(void)
 		smp_num_probed = 1;
 		hwrpb_cpu_present_mask = (1UL << boot_cpuid);
 	}
-	cpu_present_mask = 1UL << boot_cpuid;
+	cpu_present_mask = cpumask_of_cpu(boot_cpuid);
 
 	printk(KERN_INFO "SMP: %d CPUs probed -- cpu_present_mask = %lx\n",
 	       smp_num_probed, hwrpb_cpu_present_mask);
@@ -547,7 +547,7 @@ smp_prepare_cpus(unsigned int max_cpus)
 
 	/* Nothing to do on a UP box, or when told not to.  */
 	if (smp_num_probed == 1 || max_cpus == 0) {
-		cpu_present_mask = 1UL << boot_cpuid;
+		cpu_present_mask = cpumask_of_cpu(boot_cpuid);
 		printk(KERN_INFO "SMP mode deactivated.\n");
 		return;
 	}
@@ -562,7 +562,7 @@ smp_prepare_cpus(unsigned int max_cpus)
 		if (((hwrpb_cpu_present_mask >> i) & 1) == 0)
 			continue;
 
-		cpu_present_mask |= 1UL << i;
+		cpu_set(i, cpu_possible_map);
 		cpu_count++;
 	}
 
@@ -597,7 +597,7 @@ smp_cpus_done(unsigned int max_cpus)
 		if (cpu_online(cpu))
 			bogosum += cpu_data[cpu].loops_per_jiffy;
 	
-	printk(KERN_INFO "SMP: Total of %ld processors activated "
+	printk(KERN_INFO "SMP: Total of %d processors activated "
 	       "(%lu.%02lu BogoMIPS).\n",
 	       num_online_cpus(), 
 	       (bogosum + 2500) / (500000/HZ),
@@ -638,23 +638,17 @@ setup_profiling_timer(unsigned int multiplier)
 
 
 static void
-send_ipi_message(unsigned long to_whom, enum ipi_message_type operation)
+send_ipi_message(cpumask_t to_whom, enum ipi_message_type operation)
 {
-	unsigned long i, set, n;
+	int i;
 
 	mb();
-	for (i = to_whom; i ; i &= ~set) {
-		set = i & -i;
-		n = __ffs(set);
-		set_bit(operation, &ipi_data[n].bits);
-	}
+	for_each_cpu_mask(i, to_whom)
+		set_bit(operation, &ipi_data[i].bits);
 
 	mb();
-	for (i = to_whom; i ; i &= ~set) {
-		set = i & -i;
-		n = __ffs(set);
-		wripir(n);
-	}
+	for_each_cpu_mask(i, to_whom)
+		wripir(i);
 }
 
 /* Structure and data for smp_call_function.  This is designed to 
@@ -784,13 +778,14 @@ smp_send_reschedule(int cpu)
 		printk(KERN_WARNING
 		       "smp_send_reschedule: Sending IPI to self.\n");
 #endif
-	send_ipi_message(1UL << cpu, IPI_RESCHEDULE);
+	send_ipi_message(cpumask_of_cpu(cpu), IPI_RESCHEDULE);
 }
 
 void
 smp_send_stop(void)
 {
-	unsigned long to_whom = cpu_present_mask & ~(1UL << smp_processor_id());
+	cpumask_t to_whom = cpu_possible_map;
+	cpu_clear(smp_processor_id(), to_whom);
 #ifdef DEBUG_IPI_MSG
 	if (hard_smp_processor_id() != boot_cpu_id)
 		printk(KERN_WARNING "smp_send_stop: Not on boot cpu.\n");
@@ -814,7 +809,7 @@ smp_send_stop(void)
 
 int
 smp_call_function_on_cpu (void (*func) (void *info), void *info, int retry,
-			  int wait, unsigned long to_whom)
+			  int wait, cpumask_t to_whom)
 {
 	struct smp_call_struct data;
 	unsigned long timeout;
@@ -827,8 +822,8 @@ smp_call_function_on_cpu (void (*func) (void *info), void *info, int retry,
 	data.info = info;
 	data.wait = wait;
 
-	to_whom &= ~(1L << smp_processor_id());
-	num_cpus_to_call = hweight64(to_whom);
+	cpu_clear(smp_processor_id(), to_whom);
+	num_cpus_to_call = cpus_weight(to_whom);
 
 	atomic_set(&data.unstarted_count, num_cpus_to_call);
 	atomic_set(&data.unfinished_count, num_cpus_to_call);
@@ -869,7 +864,7 @@ smp_call_function_on_cpu (void (*func) (void *info), void *info, int retry,
 
 	/* We either got one or timed out -- clear the lock. */
 	mb();
-	smp_call_function_data = 0;
+	smp_call_function_data = NULL;
 
 	/* 
 	 * If after both the initial and long timeout periods we still don't
diff --git a/arch/alpha/kernel/srm_env.c b/arch/alpha/kernel/srm_env.c
index e98b02c27..5c98fc83e 100644
--- a/arch/alpha/kernel/srm_env.c
+++ b/arch/alpha/kernel/srm_env.c
@@ -5,7 +5,7 @@
  * Copyright (C) 2001-2002 Jan-Benedict Glaw <jbglaw@lug-owl.de>
  *
  * This driver is at all a modified version of Erik Mouw's
- * ./linux/Documentation/DocBook/procfs_example.c, so: thank
+ * Documentation/DocBook/procfs_example.c, so: thank
  * you, Erik! He can be reached via email at
  * <J.A.K.Mouw@its.tudelft.nl>. It is based on an idea
  * provided by DEC^WCompaq^WIntel's "Jumpstart" CD. They
diff --git a/arch/alpha/kernel/sys_dp264.c b/arch/alpha/kernel/sys_dp264.c
index 307ce54ac..119501849 100644
--- a/arch/alpha/kernel/sys_dp264.c
+++ b/arch/alpha/kernel/sys_dp264.c
@@ -53,7 +53,6 @@ tsunami_update_irq_hw(unsigned long mask)
 	register int bcpu = boot_cpuid;
 
 #ifdef CONFIG_SMP
-	register unsigned long cpm = cpu_present_mask;
 	volatile unsigned long *dim0, *dim1, *dim2, *dim3;
 	unsigned long mask0, mask1, mask2, mask3, dummy;
 
@@ -72,10 +71,10 @@ tsunami_update_irq_hw(unsigned long mask)
 	dim1 = &cchip->dim1.csr;
 	dim2 = &cchip->dim2.csr;
 	dim3 = &cchip->dim3.csr;
-	if ((cpm & 1) == 0) dim0 = &dummy;
-	if ((cpm & 2) == 0) dim1 = &dummy;
-	if ((cpm & 4) == 0) dim2 = &dummy;
-	if ((cpm & 8) == 0) dim3 = &dummy;
+	if (cpu_possible(0)) dim0 = &dummy;
+	if (cpu_possible(1)) dim1 = &dummy;
+	if (cpu_possible(2)) dim2 = &dummy;
+	if (cpu_possible(3)) dim3 = &dummy;
 
 	*dim0 = mask0;
 	*dim1 = mask1;
@@ -164,13 +163,13 @@ clipper_end_irq(unsigned int irq)
 }
 
 static void
-cpu_set_irq_affinity(unsigned int irq, unsigned long affinity)
+cpu_set_irq_affinity(unsigned int irq, cpumask_t affinity)
 {
 	int cpu;
 
 	for (cpu = 0; cpu < 4; cpu++) {
 		unsigned long aff = cpu_irq_affinity[cpu];
-		if (affinity & (1UL << cpu))
+		if (cpu_isset(cpu, affinity))
 			aff |= 1UL << irq;
 		else
 			aff &= ~(1UL << irq);
@@ -179,7 +178,7 @@ cpu_set_irq_affinity(unsigned int irq, unsigned long affinity)
 }
 
 static void
-dp264_set_affinity(unsigned int irq, unsigned long affinity)
+dp264_set_affinity(unsigned int irq, cpumask_t affinity)
 { 
 	spin_lock(&dp264_irq_lock);
 	cpu_set_irq_affinity(irq, affinity);
@@ -188,7 +187,7 @@ dp264_set_affinity(unsigned int irq, unsigned long affinity)
 }
 
 static void
-clipper_set_affinity(unsigned int irq, unsigned long affinity)
+clipper_set_affinity(unsigned int irq, cpumask_t affinity)
 { 
 	spin_lock(&dp264_irq_lock);
 	cpu_set_irq_affinity(irq - 16, affinity);
diff --git a/arch/alpha/kernel/time.c b/arch/alpha/kernel/time.c
index 35b9761ec..711124368 100644
--- a/arch/alpha/kernel/time.c
+++ b/arch/alpha/kernel/time.c
@@ -523,7 +523,6 @@ EXPORT_SYMBOL(do_settimeofday);
  *      sets the minutes. Usually you won't notice until after reboot!
  */
 
-extern int abs(int);
 
 static int
 set_rtc_mmss(unsigned long nowtime)
diff --git a/arch/alpha/kernel/traps.c b/arch/alpha/kernel/traps.c
index 52348791c..2248735b8 100644
--- a/arch/alpha/kernel/traps.c
+++ b/arch/alpha/kernel/traps.c
@@ -16,6 +16,7 @@
 #include <linux/smp_lock.h>
 #include <linux/module.h>
 #include <linux/init.h>
+#include <linux/kallsyms.h>
 
 #include <asm/gentrap.h>
 #include <asm/uaccess.h>
@@ -119,7 +120,7 @@ static void
 dik_show_trace(unsigned long *sp)
 {
 	long i = 0;
-	printk("Trace:");
+	printk("Trace:\n");
 	while (0x1ff8 & (unsigned long) sp) {
 		extern char _stext[], _etext[];
 		unsigned long tmp = *sp;
@@ -128,7 +129,9 @@ dik_show_trace(unsigned long *sp)
 			continue;
 		if (tmp >= (unsigned long) &_etext)
 			continue;
-		printk("%lx%c", tmp, ' ');
+		printk("[<%lx>]", tmp);
+		print_symbol(" %s", tmp);
+		printk("\n");
 		if (i > 40) {
 			printk(" ...");
 			break;
@@ -220,12 +223,12 @@ do_entArith(unsigned long summary, unsigned long write_mask,
 		if (si_code == 0)
 			return;
 	}
-	die_if_kernel("Arithmetic fault", regs, 0, 0);
+	die_if_kernel("Arithmetic fault", regs, 0, NULL);
 
 	info.si_signo = SIGFPE;
 	info.si_errno = 0;
 	info.si_code = si_code;
-	info.si_addr = (void *) regs->pc;
+	info.si_addr = (void __user *) regs->pc;
 	send_sig_info(SIGFPE, &info, current);
 }
 
@@ -244,7 +247,7 @@ do_entIF(unsigned long type, struct pt_regs *regs)
 			       data[0]);
 		}
 		die_if_kernel((type == 1 ? "Kernel Bug" : "Instruction fault"),
-			      regs, type, 0);
+			      regs, type, NULL);
 	}
 
 	switch (type) {
@@ -253,7 +256,7 @@ do_entIF(unsigned long type, struct pt_regs *regs)
 		info.si_errno = 0;
 		info.si_code = TRAP_BRKPT;
 		info.si_trapno = 0;
-		info.si_addr = (void *) regs->pc;
+		info.si_addr = (void __user *) regs->pc;
 
 		if (ptrace_cancel_bpt(current)) {
 			regs->pc -= 4;	/* make pc point to former bpt */
@@ -266,13 +269,13 @@ do_entIF(unsigned long type, struct pt_regs *regs)
 		info.si_signo = SIGTRAP;
 		info.si_errno = 0;
 		info.si_code = __SI_FAULT;
-		info.si_addr = (void *) regs->pc;
+		info.si_addr = (void __user *) regs->pc;
 		info.si_trapno = 0;
 		send_sig_info(SIGTRAP, &info, current);
 		return;
 		
 	      case 2: /* gentrap */
-		info.si_addr = (void *) regs->pc;
+		info.si_addr = (void __user *) regs->pc;
 		info.si_trapno = regs->r16;
 		switch ((long) regs->r16) {
 		case GEN_INTOVF:
@@ -334,7 +337,7 @@ do_entIF(unsigned long type, struct pt_regs *regs)
 		info.si_signo = signo;
 		info.si_errno = 0;
 		info.si_code = code;
-		info.si_addr = (void *) regs->pc;
+		info.si_addr = (void __user *) regs->pc;
 		send_sig_info(signo, &info, current);
 		return;
 
@@ -362,7 +365,7 @@ do_entIF(unsigned long type, struct pt_regs *regs)
 				info.si_signo = SIGFPE;
 				info.si_errno = 0;
 				info.si_code = si_code;
-				info.si_addr = (void *) regs->pc;
+				info.si_addr = (void __user *) regs->pc;
 				send_sig_info(SIGFPE, &info, current);
 				return;
 			}
@@ -391,7 +394,7 @@ do_entIF(unsigned long type, struct pt_regs *regs)
 	info.si_signo = SIGILL;
 	info.si_errno = 0;
 	info.si_code = ILL_ILLOPC;
-	info.si_addr = (void *) regs->pc;
+	info.si_addr = (void __user *) regs->pc;
 	send_sig_info(SIGILL, &info, current);
 }
 
@@ -407,12 +410,12 @@ do_entDbg(struct pt_regs *regs)
 {
 	siginfo_t info;
 
-	die_if_kernel("Instruction fault", regs, 0, 0);
+	die_if_kernel("Instruction fault", regs, 0, NULL);
 
 	info.si_signo = SIGILL;
 	info.si_errno = 0;
 	info.si_code = ILL_ILLOPC;
-	info.si_addr = (void *) regs->pc;
+	info.si_addr = (void __user *) regs->pc;
 	force_sig_info(SIGILL, &info, current);
 }
 
@@ -762,7 +765,7 @@ static int unauser_reg_offsets[32] = {
 #undef R
 
 asmlinkage void
-do_entUnaUser(void * va, unsigned long opcode,
+do_entUnaUser(void __user * va, unsigned long opcode,
 	      unsigned long reg, struct pt_regs *regs)
 {
 	static int cnt = 0;
diff --git a/arch/alpha/mm/fault.c b/arch/alpha/mm/fault.c
index 242317d15..a0b969ddf 100644
--- a/arch/alpha/mm/fault.c
+++ b/arch/alpha/mm/fault.c
@@ -211,7 +211,7 @@ do_page_fault(unsigned long address, unsigned long mmcsr,
 	info.si_signo = SIGBUS;
 	info.si_errno = 0;
 	info.si_code = BUS_ADRERR;
-	info.si_addr = (void *) address;
+	info.si_addr = (void __user *) address;
 	force_sig_info(SIGBUS, &info, current);
 	if (!user_mode(regs))
 		goto no_context;
@@ -221,7 +221,7 @@ do_page_fault(unsigned long address, unsigned long mmcsr,
 	info.si_signo = SIGSEGV;
 	info.si_errno = 0;
 	info.si_code = si_code;
-	info.si_addr = (void *) address;
+	info.si_addr = (void __user *) address;
 	force_sig_info(SIGSEGV, &info, current);
 	return;
 
diff --git a/arch/alpha/mm/init.c b/arch/alpha/mm/init.c
index 0a5873f7e..3ea81ca1c 100644
--- a/arch/alpha/mm/init.c
+++ b/arch/alpha/mm/init.c
@@ -106,7 +106,7 @@ show_mem(void)
 
 	printk("\nMem-info:\n");
 	show_free_areas();
-	printk("Free swap:       %6dkB\n",nr_swap_pages<<(PAGE_SHIFT-10));
+	printk("Free swap:       %6ldkB\n", nr_swap_pages<<(PAGE_SHIFT-10));
 	i = max_mapnr;
 	while (i-- > 0) {
 		total++;
diff --git a/arch/alpha/mm/numa.c b/arch/alpha/mm/numa.c
index 2cb8fa4eb..31a3f6343 100644
--- a/arch/alpha/mm/numa.c
+++ b/arch/alpha/mm/numa.c
@@ -279,8 +279,8 @@ setup_memory(void *kernel_end)
 				       initrd_end,
 				       phys_to_virt(PFN_PHYS(max_low_pfn)));
 		} else {
-			nid = NODE_DATA(kvaddr_to_nid(initrd_start));
-			reserve_bootmem_node(nid,
+			nid = kvaddr_to_nid(initrd_start);
+			reserve_bootmem_node(NODE_DATA(nid),
 					     virt_to_phys((void *)initrd_start),
 					     INITRD_SIZE);
 		}
@@ -371,7 +371,7 @@ show_mem(void)
 
 	printk("\nMem-info:\n");
 	show_free_areas();
-	printk("Free swap:       %6dkB\n",nr_swap_pages<<(PAGE_SHIFT-10));
+	printk("Free swap:       %6ldkB\n", nr_swap_pages<<(PAGE_SHIFT-10));
 	for (nid = 0; nid < numnodes; nid++) {
 		struct page * lmem_map = node_mem_map(nid);
 		i = node_spanned_pages(nid);
diff --git a/arch/arm/Kconfig b/arch/arm/Kconfig
index 2de01ba68..e4435a443 100644
--- a/arch/arm/Kconfig
+++ b/arch/arm/Kconfig
@@ -72,9 +72,6 @@ choice
 	prompt "ARM system type"
 	default ARCH_RPC
 
-config ARCH_ADIFCC
-	bool "ADIFCC-based"
-
 config ARCH_CLPS7500
 	bool "Cirrus-CL-PS7500FE"
 
@@ -191,6 +188,11 @@ config ARCH_ACORN
 	depends on ARCH_RPC
 	default y
 
+config TIMER_ACORN
+	bool
+	depends on ARCH_ACORN || ARCH_CLPS7500
+	default y
+
 #####################################################################
 # Footbridge support
 config FOOTBRIDGE
@@ -220,6 +222,11 @@ config SA1111
 	depends on ASSABET_NEPONSET || SA1100_ADSBITSY || SA1100_BADGE4 || SA1100_CONSUS || SA1100_GRAPHICSMASTER || SA1100_JORNADA720 || ARCH_LUBBOCK || SA1100_PFS168 || SA1100_PT_SYSTEM3 || SA1100_XP860
 	default y
 
+config SHARP_LOCOMO
+	bool
+	depends on SA1100_COLLIE
+	default y
+
 config FORCE_MAX_ZONEORDER
 	int
 	depends on SA1111
@@ -246,10 +253,10 @@ menu "General setup"
 # Select various configuration options depending on the machine type
 config DISCONTIGMEM
 	bool
-	depends on ARCH_EDB7211 || ARCH_SA1100 || ARCH_LH7A40X
+	depends on ARCH_EDB7211 || ARCH_SA1100 || (ARCH_LH7A40X && !LH7A40X_CONTIGMEM)
 	default y
 	help
-	  Say Y to upport efficient handling of discontiguous physical memory,
+	  Say Y to support efficient handling of discontiguous physical memory,
 	  for architectures which are either NUMA (Non-Uniform Memory Access)
 	  or have huge holes in the physical address space for other reasons.
 	  See <file:Documentation/vm/numa> for more.
@@ -257,7 +264,7 @@ config DISCONTIGMEM
 # Now handle the bus types
 config PCI
 	bool "PCI support" if ARCH_INTEGRATOR_AP
-	default y if ARCH_FTVPCI || ARCH_SHARK || FOOTBRIDGE_HOST || ARCH_IOP3XX || ARCH_IXP4XX
+	default y if ARCH_SHARK || FOOTBRIDGE_HOST || ARCH_IOP3XX || ARCH_IXP4XX
 	help
 	  Find out whether you have a PCI motherboard. PCI is the name of a
 	  bus system, i.e. the way the CPU talks to the other stuff inside
@@ -270,11 +277,6 @@ config PCI
 	  doesn't.
 
 # Select the host bridge type
-config PCI_HOST_PLX90X0
-	bool
-	depends on PCI && ARCH_FTVPCI
-	default y
-
 config PCI_HOST_VIA82C505
 	bool
 	depends on PCI && ARCH_SHARK
@@ -368,7 +370,7 @@ config CPU_FREQ_INTEGRATOR
 	help
 	  This enables the CPUfreq driver for ARM Integrator CPUs.
 
-	  For details, take a look at linux/Documentation/cpu-freq.
+	  For details, take a look at <file:Documentation/cpu-freq>.
 
 	  If in doubt, say Y.
 
@@ -421,6 +423,17 @@ config FPE_FASTFPE
 	  If you do not feel you need a faster FP emulation you should better
 	  choose NWFPE.
 
+config VFP
+	bool "VFP-format floating point maths"
+	help
+	  Say Y to include VFP support code in the kernel. This is needed
+	  if your hardware includes a VFP unit.
+
+	  Please see <file:Documentation/arm/VFP/release-notes.txt> for
+	  release notes and additional status information.
+
+	  Say N if your target does not have VFP hardware.
+
 source "fs/Kconfig.binfmt"
 
 source "drivers/base/Kconfig"
@@ -539,7 +552,7 @@ config CMDLINE
 
 config LEDS
 	bool "Timer and CPU usage LEDs"
-	depends on ARCH_NETWINDER || ARCH_EBSA110 || ARCH_EBSA285 || ARCH_FTVPCI || ARCH_SHARK || ARCH_CO285 || ARCH_SA1100 || ARCH_LUBBOCK || MACH_MAINSTONE || ARCH_PXA_IDP || ARCH_INTEGRATOR || ARCH_CDB89712 || ARCH_P720T || ARCH_OMAP || ARCH_VERSATILE_PB
+	depends on ARCH_NETWINDER || ARCH_EBSA110 || ARCH_EBSA285 || ARCH_SHARK || ARCH_CO285 || ARCH_SA1100 || ARCH_LUBBOCK || MACH_MAINSTONE || ARCH_PXA_IDP || ARCH_INTEGRATOR || ARCH_CDB89712 || ARCH_P720T || ARCH_OMAP || ARCH_VERSATILE_PB
 	help
 	  If you say Y here, the LEDs on your machine will be used
 	  to provide useful information about your current system status.
@@ -553,7 +566,7 @@ config LEDS
 
 config LEDS_TIMER
 	bool "Timer LED" if LEDS && (ARCH_NETWINDER || ARCH_EBSA285 || ARCH_SHARK || MACH_MAINSTONE || ARCH_CO285 || ARCH_SA1100 || ARCH_LUBBOCK || ARCH_PXA_IDP || ARCH_INTEGRATOR || ARCH_P720T || ARCH_VERSATILE_PB)
-	depends on ARCH_NETWINDER || ARCH_EBSA110 || ARCH_EBSA285 || ARCH_FTVPCI || ARCH_SHARK || ARCH_CO285 || ARCH_SA1100 || ARCH_LUBBOCK || MACH_MAINSTONE || ARCH_PXA_IDP || ARCH_INTEGRATOR || ARCH_CDB89712 || ARCH_P720T || ARCH_OMAP || ARCH_VERSATILE_PB
+	depends on ARCH_NETWINDER || ARCH_EBSA110 || ARCH_EBSA285 || ARCH_SHARK || ARCH_CO285 || ARCH_SA1100 || ARCH_LUBBOCK || MACH_MAINSTONE || ARCH_PXA_IDP || ARCH_INTEGRATOR || ARCH_CDB89712 || ARCH_P720T || ARCH_OMAP || ARCH_VERSATILE_PB
 	default y if ARCH_EBSA110
 	help
 	  If you say Y here, one of the system LEDs (the green one on the
@@ -609,7 +622,7 @@ source "drivers/acorn/block/Kconfig"
 
 source "net/Kconfig"
 
-if ARCH_CLPS7500 || ARCH_IOP3XX || ARCH_IXP4XX || ARCH_L7200 || ARCH_LH7A40X || ARCH_FTVPCI || ARCH_PXA || ARCH_RPC || ARCH_S3C2410 || ARCH_SA1100 || ARCH_SHARK || FOOTBRIDGE
+if ARCH_CLPS7500 || ARCH_IOP3XX || ARCH_IXP4XX || ARCH_L7200 || ARCH_LH7A40X || ARCH_PXA || ARCH_RPC || ARCH_S3C2410 || ARCH_SA1100 || ARCH_SHARK || FOOTBRIDGE
 source "drivers/ide/Kconfig"
 endif
 
diff --git a/arch/arm/Makefile b/arch/arm/Makefile
index 85eeb2b1e..8b34b0d8a 100644
--- a/arch/arm/Makefile
+++ b/arch/arm/Makefile
@@ -55,16 +55,17 @@ tune-$(CONFIG_CPU_XSCALE)	:=$(call check_gcc,-mtune=xscale,-mtune=strongarm110)
 tune-$(CONFIG_CPU_V6)		:=-mtune=strongarm
 
 # Need -Uarm for gcc < 3.x
-CFLAGS		+=-mapcs-32 $(arch-y) $(tune-y) -mshort-load-bytes -msoft-float -Wa,-mno-fpu -Uarm
+CFLAGS		+=-mapcs-32 $(arch-y) $(tune-y) $(call check_gcc,-malignment-traps,-mshort-load-bytes) -msoft-float -Wa,-mno-fpu -Uarm
 AFLAGS		+=-mapcs-32 $(arch-y) $(tune-y) -msoft-float -Wa,-mno-fpu
 
+CHECK		:= $(CHECK) -D__arm__=1
+
 #Default value
 DATAADDR	:= .
 
 head-y		:= arch/arm/kernel/head.o arch/arm/kernel/init_task.o
 textaddr-y	:= 0xC0008000
 
- machine-$(CONFIG_ARCH_ARCA5K)	   := arc
  machine-$(CONFIG_ARCH_RPC)	   := rpc
  machine-$(CONFIG_ARCH_EBSA110)	   := ebsa110
  machine-$(CONFIG_ARCH_CLPS7500)   := clps7500
@@ -74,9 +75,6 @@ textaddr-y	:= 0xC0008000
 textaddr-$(CONFIG_ARCH_CO285)	   := 0x60008000
  machine-$(CONFIG_ARCH_CO285)	   := footbridge
   incdir-$(CONFIG_ARCH_CO285)	   := ebsa285
- machine-$(CONFIG_ARCH_FTVPCI)	   := ftvpci
-  incdir-$(CONFIG_ARCH_FTVPCI)	   := nexuspci
- machine-$(CONFIG_ARCH_TBOX)	   := tbox
  machine-$(CONFIG_ARCH_SHARK)	   := shark
  machine-$(CONFIG_ARCH_SA1100)	   := sa1100
 ifeq ($(CONFIG_ARCH_SA1100),y)
@@ -91,13 +89,19 @@ textaddr-$(CONFIG_ARCH_CLPS711X)   := 0xc0028000
  machine-$(CONFIG_ARCH_CLPS711X)   := clps711x
 textaddr-$(CONFIG_ARCH_FORTUNET)   := 0xc0008000
  machine-$(CONFIG_ARCH_IOP3XX)	   := iop3xx
- machine-$(CONFIG_ARCH_ADIFCC)	   := adifcc
  machine-$(CONFIG_ARCH_IXP4XX)	   := ixp4xx
  machine-$(CONFIG_ARCH_OMAP)	   := omap
  machine-$(CONFIG_ARCH_S3C2410)	   := s3c2410
  machine-$(CONFIG_ARCH_LH7A40X)	   := lh7a40x
  machine-$(CONFIG_ARCH_VERSATILE_PB) := versatile
 
+ifeq ($(CONFIG_ARCH_EBSA110),y)
+# This is what happens if you forget the IOCS16 line.
+# PCMCIA cards stop working.
+CFLAGS_3c589_cs.o :=-DISA_SIXTEEN_BIT_PERIPHERAL
+export CFLAGS_3c589_cs.o
+endif
+
 TEXTADDR := $(textaddr-y)
 ifeq ($(incdir-y),)
 incdir-y := $(machine-y)
@@ -119,6 +123,7 @@ core-y				+= arch/arm/mach-$(machine-y)/
 endif
 core-$(CONFIG_FPE_NWFPE)	+= arch/arm/nwfpe/
 core-$(CONFIG_FPE_FASTFPE)	+= $(FASTFPE_OBJ)
+core-$(CONFIG_VFP)		+= arch/arm/vfp/
 
 drivers-$(CONFIG_OPROFILE)      += arch/arm/oprofile/
 drivers-$(CONFIG_ARCH_CLPS7500)	+= drivers/acorn/char/
@@ -152,8 +157,7 @@ maketools: include/asm-arm/constants.h include/linux/version.h FORCE
 	$(Q)$(MAKE) $(build)=arch/arm/tools include/asm-arm/mach-types.h
 
 # Convert bzImage to zImage
-bzImage: vmlinux
-	$(Q)$(MAKE) $(build)=$(boot) $(boot)/zImage
+bzImage: zImage
 
 zImage Image bootpImage uImage: vmlinux
 	$(Q)$(MAKE) $(build)=$(boot) $(boot)/$@
@@ -168,12 +172,9 @@ CLEAN_FILES += include/asm-arm/constants.h* include/asm-arm/mach-types.h \
 archclean:
 	$(Q)$(MAKE) $(clean)=$(boot)
 
-# My testing targets (that short circuit a few dependencies)
-zImg:;	$(Q)$(MAKE) $(build)=$(boot) $(boot)/zImage
-Img:;	$(Q)$(MAKE) $(build)=$(boot) $(boot)/Image
+# My testing targets (bypasses dependencies)
 bp:;	$(Q)$(MAKE) $(build)=$(boot) $(boot)/bootpImage
-i:;	$(Q)$(MAKE) $(build)=$(boot) install
-zi:;	$(Q)$(MAKE) $(build)=$(boot) zinstall
+i zi:;	$(Q)$(MAKE) $(build)=$(boot) $@
 
 arch/$(ARCH)/kernel/asm-offsets.s: include/asm include/linux/version.h \
 				   include/asm-arm/.arch
@@ -185,6 +186,7 @@ define archhelp
   echo  '* zImage        - Compressed kernel image (arch/$(ARCH)/boot/zImage)'
   echo  '  Image         - Uncompressed kernel image (arch/$(ARCH)/boot/Image)'
   echo  '  bootpImage    - Combined zImage and initial RAM disk' 
+  echo  '                  (supply initrd image via make variable INITRD=<path>)'
   echo  '  install       - Install uncompressed kernel'
   echo  '  zinstall      - Install compressed kernel'
   echo  '                  Install using (your) ~/bin/installkernel or'
diff --git a/arch/arm/boot/Makefile b/arch/arm/boot/Makefile
index 72be85c54..c247afdd7 100644
--- a/arch/arm/boot/Makefile
+++ b/arch/arm/boot/Makefile
@@ -49,8 +49,6 @@ initrd_phys-$(CONFIG_ARCH_SA1100)	:= 0xc0800000
    zreladdr-$(CONFIG_ARCH_PXA)		:= 0xa0008000
    zreladdr-$(CONFIG_ARCH_IOP3XX)	:= 0xa0008000
 params_phys-$(CONFIG_ARCH_IOP3XX)	:= 0xa0000100
-   zreladdr-$(CONFIG_ARCH_ADIFCC)	:= 0xc0008000
-params_phys-$(CONFIG_ARCH_ADIFCC)	:= 0xc0000100
    zreladdr-$(CONFIG_ARCH_IXP4XX)	:= 0x00008000
 params-phys-$(CONFIG_ARCH_IXP4XX)	:= 0x00000100
    zreladdr-$(CONFIG_ARCH_OMAP)		:= 0x10008000
@@ -66,30 +64,20 @@ params_phys-$(CONFIG_ARCH_VERSATILE_PB)	:= 0x00000100
 initrd_phys-$(CONFIG_ARCH_VERSATILE_PB)	:= 0x00800000
 
 ZRELADDR    := $(zreladdr-y)
-ZTEXTADDR   := $(ztextaddr-y)
 PARAMS_PHYS := $(params_phys-y)
 INITRD_PHYS := $(initrd_phys-y)
-#
-# We now have a PIC decompressor implementation.  Decompressors running
-# from RAM should not define ZTEXTADDR.  Decompressors running directly
-# from ROM or Flash must define ZTEXTADDR (preferably via the config)
-# FIXME: Previous assignment to ztextaddr-y is lost here. See SHARK
-ifeq ($(CONFIG_ZBOOT_ROM),y)
-ZTEXTADDR	:= $(CONFIG_ZBOOT_ROM_TEXT)
-ZBSSADDR	:= $(CONFIG_ZBOOT_ROM_BSS)
-else
-ZTEXTADDR	:= 0
-ZBSSADDR	:= ALIGN(4)
-endif
 
-export	ZTEXTADDR ZBSSADDR ZRELADDR INITRD_PHYS PARAMS_PHYS
+export ZRELADDR INITRD_PHYS PARAMS_PHYS
 
-targets := Image zImage bootpImage
+targets := Image zImage bootpImage uImage
 
 $(obj)/Image: vmlinux FORCE
 	$(call if_changed,objcopy)
 	@echo '  Kernel: $@ is ready'
 
+$(obj)/compressed/vmlinux: $(obj)/Image FORCE
+	$(Q)$(MAKE) $(build)=$(obj)/compressed $@
+
 $(obj)/zImage:	$(obj)/compressed/vmlinux FORCE
 	$(call if_changed,objcopy)
 	@echo '  Kernel: $@ is ready'
@@ -99,22 +87,19 @@ quiet_cmd_uimage = UIMAGE  $@
 		   -C none -a $(ZRELADDR) -e $(ZRELADDR) \
 		   -n 'Linux-$(KERNELRELEASE)' -d $< $@
 
-targets += uImage
-$(obj)/uImage:	$(obj)/zImage
+$(obj)/uImage:	$(obj)/zImage FORCE
 	$(call if_changed,uimage)
 	@echo '  Image $@ is ready'
 
+$(obj)/bootp/bootp: $(obj)/zImage initrd FORCE
+	$(Q)$(MAKE) $(build)=$(obj)/bootp $@
+	@:
+
 $(obj)/bootpImage: $(obj)/bootp/bootp FORCE
 	$(call if_changed,objcopy)
 	@echo '  Kernel: $@ is ready'
 
-$(obj)/compressed/vmlinux: vmlinux FORCE
-	$(Q)$(MAKE) $(build)=$(obj)/compressed $@
-
-$(obj)/bootp/bootp: $(obj)/zImage initrd FORCE
-	$(Q)$(MAKE) $(build)=$(obj)/bootp $@
-
-.PHONY: initrd
+.PHONY: initrd FORCE
 initrd:
 	@test "$(INITRD_PHYS)" != "" || \
 	(echo This machine does not support INITRD; exit -1)
@@ -122,13 +107,11 @@ initrd:
 	(echo You must specify INITRD; exit -1)
 
 install: $(obj)/Image
-	$(CONFIG_SHELL) $(obj)/install.sh \
-	$(VERSION).$(PATCHLEVEL).$(SUBLEVEL)$(EXTRAVERSION) \
+	$(CONFIG_SHELL) $(srctree)/$(src)/install.sh $(KERNELRELEASE) \
 	$(obj)/Image System.map "$(INSTALL_PATH)"
 
 zinstall: $(obj)/zImage
-	$(CONFIG_SHELL) $(obj)/install.sh \
-	$(VERSION).$(PATCHLEVEL).$(SUBLEVEL)$(EXTRAVERSION) \
+	$(CONFIG_SHELL) $(srctree)/$(src)/install.sh $(KERNELRELEASE) \
 	$(obj)/zImage System.map "$(INSTALL_PATH)"
 
 subdir-	    := bootp compressed
diff --git a/arch/arm/boot/bootp/Makefile b/arch/arm/boot/bootp/Makefile
index 401443670..8e8879b6b 100644
--- a/arch/arm/boot/bootp/Makefile
+++ b/arch/arm/boot/bootp/Makefile
@@ -2,21 +2,23 @@
 # linux/arch/arm/boot/bootp/Makefile
 #
 
-ZSYSTEM		= arch/arm/boot/zImage
-ZLDFLAGS	=-p -X -T $(obj)/bootp.lds \
-		 --defsym initrd_addr=$(INITRD_PHYS) \
-		 --defsym params=$(PARAMS_PHYS)
+LDFLAGS_bootp	:=-p --no-undefined -X \
+		 --defsym initrd_phys=$(INITRD_PHYS) \
+		 --defsym params_phys=$(PARAMS_PHYS) -T
+AFLAGS_initrd.o :=-DINITRD=\"$(INITRD)\"
 
-extra-y := bootp
+targets	:= bootp init.o kernel.o initrd.o
 
 # Note that bootp.lds picks up kernel.o and initrd.o
-$(obj)/bootp:	$(addprefix $(obj)/,init.o kernel.o initrd.o bootp.lds)
-		$(LD) $(ZLDFLAGS) -o $@ $(obj)/init.o
+$(obj)/bootp:	$(src)/bootp.lds $(addprefix $(obj)/,init.o kernel.o initrd.o) FORCE
+	$(call if_changed,ld)
+	@:
 
-$(obj)/kernel.o: $(ZSYSTEM)
-		$(LD) -r -s -o $@ -b binary $(ZSYSTEM)
+# kernel.o and initrd.o includes a binary image using
+# .incbin, a dependency which is not tracked automatically
 
-$(obj)/initrd.o: $(INITRD)
-		$(LD) -r -s -o $@ -b binary $(INITRD)
+$(obj)/kernel.o: arch/arm/boot/zImage FORCE
 
-.PHONY:		$(INITRD) $(ZSYSTEM)
+$(obj)/initrd.o: $(INITRD) FORCE
+
+.PHONY:	$(INITRD) FORCE
diff --git a/arch/arm/boot/bootp/bootp.lds b/arch/arm/boot/bootp/bootp.lds
index 52e375e7e..8e3d81ce6 100644
--- a/arch/arm/boot/bootp/bootp.lds
+++ b/arch/arm/boot/bootp/bootp.lds
@@ -12,16 +12,11 @@ ENTRY(_start)
 SECTIONS
 {
   . = 0;
-  _text = .;
   .text : {
    _stext = .;
    *(.start)
-   arch/arm/boot/bootp/kernel.o
-   . = ALIGN(32);
-   initrd_start = .;
-   arch/arm/boot/bootp/initrd.o
-   initrd_len = . - initrd_start;
-   . = ALIGN(32);
+   *(.text)
+   initrd_size = initrd_end - initrd_start;
    _etext = .;
   }
   
diff --git a/arch/arm/boot/bootp/init.S b/arch/arm/boot/bootp/init.S
index 192ec8da6..df7bc7068 100644
--- a/arch/arm/boot/bootp/init.S
+++ b/arch/arm/boot/bootp/init.S
@@ -20,11 +20,10 @@
 		.type	_start, #function
 		.globl	_start
 
-_start:		adr	r12, kernel_start	@ offset of kernel zImage
-		ldr	r4, [r12, #0x2c]	@ length of zImage
+_start:		add	lr, pc, #-0x8		@ lr = current load addr
 		adr	r13, data
-		add	r4, r4, r12		@ end of zImage, start of initrd
-		ldmia	r13!, {r5-r6}		@ r5 = dest, r6 = length
+		ldmia	r13!, {r4-r6}		@ r5 = dest, r6 = length
+		add	r4, r4, lr		@ r4 = initrd_start + load addr
 		bl	move			@ move the initrd
 
 /*
@@ -45,7 +44,7 @@ _start:		adr	r12, kernel_start	@ offset of kernel zImage
  */
 		movne	r10, #0			@ terminator
 		movne	r4, #2			@ Size of this entry (2 words)
-		stmneia	r8, {r4, r5, r10}	@ Size, ATAG_CORE, terminator
+		stmneia	r9, {r4, r5, r10}	@ Size, ATAG_CORE, terminator
 
 /*
  * find the end of the tag list, and then add an INITRD tag on the end.
@@ -59,7 +58,7 @@ taglist:	ldr	r10, [r9, #0]		@ tag length
 
 		mov	r5, #4			@ Size of initrd tag (4 words)
 		stmia	r9, {r5, r6, r7, r8, r10}
-		mov	pc, r12			@ call kernel
+		b	kernel_start		@ call kernel
 
 /*
  * Move the block of memory length r6 from address r4 to address r5
@@ -75,16 +74,13 @@ move:		ldmia	r4!, {r7 - r10}		@ move 32-bytes at a time
 		.size	_start, . - _start
 
 		.type	data,#object
-data:		.word	initrd_addr		@ destination initrd address
-		.word	initrd_len		@ initrd size
+data:		.word	initrd_start		@ source initrd address
+		.word	initrd_phys		@ destination initrd address
+		.word	initrd_size		@ initrd size
 
-		.word	0x54410001		@ r4 = ATAG_CORE
-		.word	0x54420005		@ r5 = ATAG_INITRD2
-		.word	initrd_addr		@ r6
-		.word	initrd_len		@ r7
-		.word	params			@ r8
-		.size	data, . - _data
-
-		.type	initrd_start,#object
-
-kernel_start:
+		.word	0x54410001		@ r5 = ATAG_CORE
+		.word	0x54420005		@ r6 = ATAG_INITRD2
+		.word	initrd_phys		@ r7
+		.word	initrd_size		@ r8
+		.word	params_phys		@ r9
+		.size	data, . - data
diff --git a/arch/arm/boot/compressed/Makefile b/arch/arm/boot/compressed/Makefile
index dc06c210e..951fbf6e8 100644
--- a/arch/arm/boot/compressed/Makefile
+++ b/arch/arm/boot/compressed/Makefile
@@ -3,9 +3,6 @@
 #
 # create a compressed vmlinuz image from the original vmlinux
 #
-# Note! ZTEXTADDR, ZBSSADDR and ZRELADDR are now exported
-# from arch/arm/boot/Makefile
-#
 
 HEAD	= head.o
 OBJS	= misc.o
@@ -16,7 +13,6 @@ FONTC	= drivers/video/console/font_acorn_8x8.c
 #
 ifeq ($(CONFIG_ARCH_ACORN),y)
 OBJS		+= ll_char_wr.o font.o
-CFLAGS_misc.o	:= -DPARAMS_PHYS=$(PARAMS_PHYS)
 endif
 
 ifeq ($(CONFIG_ARCH_SHARK),y)
@@ -27,10 +23,6 @@ ifeq ($(CONFIG_ARCH_CAMELOT),y)
 OBJS		+= head-epxa10db.o
 endif
 
-ifeq ($(CONFIG_ARCH_FTVPCI),y)
-OBJS		+= head-ftvpci.o
-endif
-
 ifeq ($(CONFIG_ARCH_L7200),y)
 OBJS		+= head-l7200.o
 endif
@@ -59,36 +51,57 @@ ifeq ($(CONFIG_DEBUG_ICEDCC),y)
 OBJS            += ice-dcc.o
 endif
 
-SEDFLAGS	= s/TEXT_START/$(ZTEXTADDR)/;s/LOAD_ADDR/$(ZRELADDR)/;s/BSS_START/$(ZBSSADDR)/
+#
+# We now have a PIC decompressor implementation.  Decompressors running
+# from RAM should not define ZTEXTADDR.  Decompressors running directly
+# from ROM or Flash must define ZTEXTADDR (preferably via the config)
+# FIXME: Previous assignment to ztextaddr-y is lost here. See SHARK
+ifeq ($(CONFIG_ZBOOT_ROM),y)
+ZTEXTADDR	:= $(CONFIG_ZBOOT_ROM_TEXT)
+ZBSSADDR	:= $(CONFIG_ZBOOT_ROM_BSS)
+else
+ZTEXTADDR	:= 0
+ZBSSADDR	:= ALIGN(4)
+endif
+
+SEDFLAGS	= s/TEXT_START/$(ZTEXTADDR)/;s/BSS_START/$(ZBSSADDR)/
 
-targets       := vmlinux vmlinux.lds piggy piggy.gz piggy.o \
-                 font.o head.o $(OBJS)
+targets       := vmlinux vmlinux.lds piggy.gz piggy.o font.o \
+		 head.o misc.o $(OBJS)
 EXTRA_CFLAGS  := -fpic
 EXTRA_AFLAGS  :=
 
-LDFLAGS_vmlinux := -p --no-undefined -X \
+# Supply ZRELADDR, INITRD_PHYS and PARAMS_PHYS to the decompressor via
+# linker symbols.  We only define initrd_phys and params_phys if the
+# machine class defined the corresponding makefile variable.
+LDFLAGS_vmlinux := --defsym zreladdr=$(ZRELADDR)
+ifneq ($(INITRD_PHYS),)
+LDFLAGS_vmlinux += --defsym initrd_phys=$(INITRD_PHYS)
+endif
+ifneq ($(PARAMS_PHYS),)
+LDFLAGS_vmlinux += --defsym params_phys=$(PARAMS_PHYS)
+endif
+LDFLAGS_vmlinux += -p --no-undefined -X \
 	$(shell $(CC) $(CFLAGS) --print-libgcc-file-name) -T
 
+# Don't allow any static data in misc.o, which
+# would otherwise mess up our GOT table
+CFLAGS_misc.o := -Dstatic=
+
 $(obj)/vmlinux: $(obj)/vmlinux.lds $(obj)/$(HEAD) $(obj)/piggy.o \
 	 	$(addprefix $(obj)/, $(OBJS)) FORCE
 	$(call if_changed,ld)
 	@:
 
-
-$(obj)/piggy: vmlinux FORCE
-	$(call if_changed,objcopy)
-
-$(obj)/piggy.gz: $(obj)/piggy FORCE
+$(obj)/piggy.gz: $(obj)/../Image FORCE
 	$(call if_changed,gzip)
 
-LDFLAGS_piggy.o := -r -b binary
 $(obj)/piggy.o:  $(obj)/piggy.gz FORCE
-	$(call if_changed,ld)
 
 CFLAGS_font.o := -Dstatic=
 $(obj)/font.o: $(FONTC)
 
-$(obj)/vmlinux.lds: $(obj)/vmlinux.lds.in Makefile arch/arm/boot/Makefile .config
+$(obj)/vmlinux.lds: $(obj)/vmlinux.lds.in arch/arm/boot/Makefile .config
 	@sed "$(SEDFLAGS)" < $< > $@
 
 $(obj)/misc.o: $(obj)/misc.c include/asm/arch/uncompress.h lib/inflate.c
diff --git a/arch/arm/boot/compressed/head-clps7500.S b/arch/arm/boot/compressed/head-clps7500.S
index a1a0c847d..4a8a689d1 100644
--- a/arch/arm/boot/compressed/head-clps7500.S
+++ b/arch/arm/boot/compressed/head-clps7500.S
@@ -34,7 +34,7 @@
 		mov	r0, #0x30
 		mcr	p15, 0, r0, c1, c0, 0
 		mov	r0, #0x13
-		msr	cpsr, r0
+		msr	cpsr_cxsf, r0
 		mov	r12, #0x03000000	@ point to LEDs
 		orr	r12, r12, #0x00020000
 		orr	r12, r12, #0xba00
@@ -71,7 +71,7 @@
 		/* Ensure all interrupts are off and MMU disabled */
 		mrs	r0, cpsr
 		orr	r0, r0, #0xc0
-		msr	cpsr, r0
+		msr	cpsr_cxsf, r0
 
 		adr	lr, 1b
 		orr	lr, lr, #0x10000000
diff --git a/arch/arm/boot/compressed/head-sa1100.S b/arch/arm/boot/compressed/head-sa1100.S
index 19ac7bb11..26f7f77cb 100644
--- a/arch/arm/boot/compressed/head-sa1100.S
+++ b/arch/arm/boot/compressed/head-sa1100.S
@@ -30,6 +30,9 @@ __SA1100_start:
 		mov	r8, #0
 #endif
 
+#ifdef CONFIG_SA1100_COLLIE
+		mov	r7, #MACH_TYPE_COLLIE
+#endif
 #ifdef CONFIG_SA1100_PFS168
 		@ REVISIT_PFS168: Temporary until firmware updated to use assigned machine number
 		mov	r7, #MACH_TYPE_PFS168
diff --git a/arch/arm/boot/compressed/head-xscale.S b/arch/arm/boot/compressed/head-xscale.S
index e6656d4ef..f9194499e 100644
--- a/arch/arm/boot/compressed/head-xscale.S
+++ b/arch/arm/boot/compressed/head-xscale.S
@@ -66,7 +66,4 @@ __XScale_start:
 		mov	r7, #MACH_TYPE_IQ80310
 #endif
 
-#ifdef CONFIG_ARCH_ADI_EVB
-		mov	r7, #MACH_TYPE_ADI_EVB
-#endif
 
diff --git a/arch/arm/boot/compressed/head.S b/arch/arm/boot/compressed/head.S
index 480344606..b47032c2d 100644
--- a/arch/arm/boot/compressed/head.S
+++ b/arch/arm/boot/compressed/head.S
@@ -324,7 +324,7 @@ wont_overwrite:	mov	r0, r4
 LC0:		.word	LC0			@ r1
 		.word	__bss_start		@ r2
 		.word	_end			@ r3
-		.word	_load_addr		@ r4
+		.word	zreladdr		@ r4
 		.word	_start			@ r5
 		.word	_got_start		@ r6
 		.word	_got_end		@ ip
diff --git a/arch/arm/boot/compressed/vmlinux.lds.in b/arch/arm/boot/compressed/vmlinux.lds.in
index c0c62fd0a..eed616113 100644
--- a/arch/arm/boot/compressed/vmlinux.lds.in
+++ b/arch/arm/boot/compressed/vmlinux.lds.in
@@ -11,9 +11,6 @@ OUTPUT_ARCH(arm)
 ENTRY(_start)
 SECTIONS
 {
-  . = LOAD_ADDR;
-  _load_addr = .;
-
   . = TEXT_START;
   _text = .;
 
@@ -27,9 +24,7 @@ SECTIONS
     *(.rodata.*)
     *(.glue_7)
     *(.glue_7t)
-    input_data = .;
-    arch/arm/boot/compressed/piggy.o
-    input_data_end = .;
+    *(.piggydata)
     . = ALIGN(4);
   }
 
diff --git a/arch/arm/boot/install.sh b/arch/arm/boot/install.sh
index 133eae430..935bb2736 100644
--- a/arch/arm/boot/install.sh
+++ b/arch/arm/boot/install.sh
@@ -21,41 +21,32 @@
 #
 
 # 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
 
-if [ -x /sbin/installkernel ]; then
-  exec /sbin/installkernel "$@"
-fi
-
-if [ "$2" = "zImage" ]; then
+if [ "$(basename $2)" = "zImage" ]; then
 # Compressed install
   echo "Installing compressed kernel"
-  if [ -f $4/vmlinuz-$1 ]; then
-    mv $4/vmlinuz-$1 $4/vmlinuz.old
-  fi
-
-  if [ -f $4/System.map-$1 ]; then
-    mv $4/System.map-$1 $4/System.old
-  fi
-
-  cat $2 > $4/vmlinuz-$1
-  cp $3 $4/System.map-$1
+  base=vmlinuz
 else
 # Normal install
   echo "Installing normal kernel"
-  if [ -f $4/vmlinux-$1 ]; then
-    mv $4/vmlinux-$1 $4/vmlinux.old
-  fi
+  base=vmlinux
+fi
 
-  if [ -f $4/System.map ]; then
-    mv $4/System.map $4/System.old
-  fi
+if [ -f $4/$base-$1 ]; then
+  mv $4/$base-$1 $4/$base-$1.old
+fi
+cat $2 > $4/$base-$1
 
-  cat $2 > $4/vmlinux-$1
-  cp $3 $4/System.map
+# Install system map file
+if [ -f $4/System.map-$1 ]; then
+  mv $4/System.map-$1 $4/System.map-$1.old
 fi
+cp $3 $4/System.map-$1
 
 if [ -x /sbin/loadmap ]; then
-  /sbin/loadmap --rdev /dev/ima
+  /sbin/loadmap
 else
   echo "You have to install it yourself"
 fi
diff --git a/arch/arm/common/Makefile b/arch/arm/common/Makefile
index f326bac69..50808a4e0 100644
--- a/arch/arm/common/Makefile
+++ b/arch/arm/common/Makefile
@@ -2,10 +2,10 @@
 # Makefile for the linux kernel.
 #
 
-obj-y				+= platform.o
 obj-$(CONFIG_ARM_AMBA)		+= amba.o
 obj-$(CONFIG_ICST525)		+= icst525.o
 obj-$(CONFIG_SA1111)		+= sa1111.o
-obj-$(CONFIG_PCI_HOST_PLX90X0)	+= plx90x0.o
 obj-$(CONFIG_PCI_HOST_VIA82C505) += via82c505.o
 obj-$(CONFIG_DMABOUNCE)		+= dmabounce.o
+obj-$(CONFIG_TIMER_ACORN)	+= time-acorn.o
+obj-$(CONFIG_SHARP_LOCOMO)	+= locomo.o
diff --git a/arch/arm/common/dmabounce.c b/arch/arm/common/dmabounce.c
index 0d0d8e882..c3a87663b 100644
--- a/arch/arm/common/dmabounce.c
+++ b/arch/arm/common/dmabounce.c
@@ -234,7 +234,7 @@ map_single(struct device *dev, void *ptr, size_t size,
 		}
 	}
 
-	dma_addr = virt_to_bus(ptr);
+	dma_addr = virt_to_dma(dev, ptr);
 
 	if (device_info && dma_needs_bounce(dev, dma_addr, size)) {
 		struct safe_buffer *buf;
@@ -248,7 +248,7 @@ map_single(struct device *dev, void *ptr, size_t size,
 
 		dev_dbg(dev,
 			"%s: unsafe buffer %p (phy=%p) mapped to %p (phy=%p)\n",
-			__func__, buf->ptr, (void *) virt_to_bus(buf->ptr),
+			__func__, buf->ptr, (void *) virt_to_dma(dev, buf->ptr),
 			buf->safe, (void *) buf->safe_dma_addr);
 
 		if ((dir == DMA_TO_DEVICE) ||
@@ -290,7 +290,7 @@ unmap_single(struct device *dev, dma_addr_t dma_addr, size_t size,
 
 		dev_dbg(dev,
 			"%s: unsafe buffer %p (phy=%p) mapped to %p (phy=%p)\n",
-			__func__, buf->ptr, (void *) virt_to_bus(buf->ptr),
+			__func__, buf->ptr, (void *) virt_to_dma(dev, buf->ptr),
 			buf->safe, (void *) buf->safe_dma_addr);
 
 
@@ -342,7 +342,7 @@ sync_single(struct device *dev, dma_addr_t dma_addr, size_t size,
 
 		dev_dbg(dev,
 			"%s: unsafe buffer %p (phy=%p) mapped to %p (phy=%p)\n",
-			__func__, buf->ptr, (void *) virt_to_bus(buf->ptr),
+			__func__, buf->ptr, (void *) virt_to_dma(dev, buf->ptr),
 			buf->safe, (void *) buf->safe_dma_addr);
 
 		DO_STATS ( device_info->bounce_count++ );
@@ -367,7 +367,7 @@ sync_single(struct device *dev, dma_addr_t dma_addr, size_t size,
 		}
 		consistent_sync(buf->safe, size, dir);
 	} else {
-		consistent_sync(bus_to_virt(dma_addr), size, dir);
+		consistent_sync(dma_to_virt(dev, dma_addr), size, dir);
 	}
 }
 
diff --git a/arch/arm/common/sa1111.c b/arch/arm/common/sa1111.c
index ee4b692e1..18ba42e69 100644
--- a/arch/arm/common/sa1111.c
+++ b/arch/arm/common/sa1111.c
@@ -610,7 +610,7 @@ out:
  *	%-EBUSY		physical address already marked in-use.
  *	%0		successful.
  */
-static int __init
+static int
 __sa1111_probe(struct device *me, struct resource *mem, int irq)
 {
 	struct sa1111 *sachip;
@@ -929,16 +929,15 @@ static int sa1111_resume(struct device *dev, u32 level)
 static int sa1111_probe(struct device *dev)
 {
 	struct platform_device *pdev = to_platform_device(dev);
-	struct resource *mem = NULL, *irq = NULL;
-	int i;
+	struct resource *mem;
+	int irq;
 
-	for (i = 0; i < pdev->num_resources; i++) {
-		if (pdev->resource[i].flags & IORESOURCE_MEM)
-			mem = &pdev->resource[i];
-		if (pdev->resource[i].flags & IORESOURCE_IRQ)
-			irq = &pdev->resource[i];
-	}
-	return __sa1111_probe(dev, mem, irq ? irq->start : NO_IRQ);
+	mem = platform_get_resource(pdev, IORESOURCE_MEM, 0);
+	if (!mem)
+		return -EINVAL;
+	irq = platform_get_irq(pdev, 0);
+
+	return __sa1111_probe(dev, mem, irq);
 }
 
 static int sa1111_remove(struct device *dev)
diff --git a/arch/arm/configs/a5k_defconfig b/arch/arm/configs/a5k_defconfig
index 200cef5e6..ec03535a7 100644
--- a/arch/arm/configs/a5k_defconfig
+++ b/arch/arm/configs/a5k_defconfig
@@ -160,7 +160,6 @@ CONFIG_INET=y
 # CONFIG_LLC 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
 
 #
diff --git a/arch/arm/configs/adsbitsy_defconfig b/arch/arm/configs/adsbitsy_defconfig
index 0d8dece3a..2cae14550 100644
--- a/arch/arm/configs/adsbitsy_defconfig
+++ b/arch/arm/configs/adsbitsy_defconfig
@@ -218,7 +218,6 @@ CONFIG_IP_PNP_BOOTP=y
 # 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
 
 #
diff --git a/arch/arm/configs/assabet_defconfig b/arch/arm/configs/assabet_defconfig
index 8601ece6b..3e4682945 100644
--- a/arch/arm/configs/assabet_defconfig
+++ b/arch/arm/configs/assabet_defconfig
@@ -354,7 +354,6 @@ CONFIG_INET=y
 # 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
 
 #
diff --git a/arch/arm/configs/badge4_defconfig b/arch/arm/configs/badge4_defconfig
index 0be7cce0e..3f8bb2e0e 100644
--- a/arch/arm/configs/badge4_defconfig
+++ b/arch/arm/configs/badge4_defconfig
@@ -350,7 +350,6 @@ CONFIG_INET=y
 # 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
 
 #
diff --git a/arch/arm/configs/bast_defconfig b/arch/arm/configs/bast_defconfig
index 32be42cf2..45deb459d 100644
--- a/arch/arm/configs/bast_defconfig
+++ b/arch/arm/configs/bast_defconfig
@@ -20,17 +20,24 @@ CONFIG_BROKEN_ON_SMP=y
 #
 CONFIG_SWAP=y
 CONFIG_SYSVIPC=y
+# CONFIG_POSIX_MQUEUE is not set
 # CONFIG_BSD_PROCESS_ACCT is not set
 CONFIG_SYSCTL=y
-CONFIG_LOG_BUF_SHIFT=16
+# CONFIG_AUDIT is not set
+CONFIG_LOG_BUF_SHIFT=17
+# CONFIG_HOTPLUG is not set
 # CONFIG_IKCONFIG is not set
 # CONFIG_EMBEDDED is not set
 CONFIG_KALLSYMS=y
+# CONFIG_KALLSYMS_ALL is not set
+# CONFIG_KALLSYMS_EXTRA_PASS is not set
 CONFIG_FUTEX=y
 CONFIG_EPOLL=y
 CONFIG_IOSCHED_NOOP=y
 CONFIG_IOSCHED_AS=y
 CONFIG_IOSCHED_DEADLINE=y
+CONFIG_IOSCHED_CFQ=y
+CONFIG_CC_OPTIMIZE_FOR_SIZE=y
 
 #
 # Loadable module support
@@ -44,57 +51,32 @@ CONFIG_KMOD=y
 #
 # System Type
 #
-# CONFIG_ARCH_ADIFCC is not set
-# CONFIG_ARCH_ANAKIN is not set
 # CONFIG_ARCH_CLPS7500 is not set
 # CONFIG_ARCH_CLPS711X is not set
 # CONFIG_ARCH_CO285 is not set
-# CONFIG_ARCH_PXA is not set
 # CONFIG_ARCH_EBSA110 is not set
 # CONFIG_ARCH_CAMELOT is not set
 # CONFIG_ARCH_FOOTBRIDGE is not set
 # CONFIG_ARCH_INTEGRATOR is not set
 # CONFIG_ARCH_IOP3XX is not set
+# CONFIG_ARCH_IXP4XX is not set
 # CONFIG_ARCH_L7200 is not set
+# CONFIG_ARCH_PXA is not set
 # CONFIG_ARCH_RPC is not set
 # CONFIG_ARCH_SA1100 is not set
-# CONFIG_ARCH_SHARK is not set
 CONFIG_ARCH_S3C2410=y
-
-#
-# CLPS711X/EP721X Implementations
-#
-
-#
-# Epxa10db
-#
-
-#
-# Footbridge Implementations
-#
-
-#
-# IOP3xx Implementation Options
-#
-# CONFIG_ARCH_IOP310 is not set
-# CONFIG_ARCH_IOP321 is not set
-
-#
-# IOP3xx Chipset Features
-#
-
-#
-# Intel PXA250/210 Implementations
-#
-
-#
-# SA11x0 Implementations
-#
+# CONFIG_ARCH_SHARK is not set
+# CONFIG_ARCH_LH7A40X is not set
+# CONFIG_ARCH_OMAP is not set
+# CONFIG_ARCH_VERSATILE_PB is not set
 
 #
 # S3C2410 Implementations
 #
 CONFIG_ARCH_BAST=y
+# CONFIG_ARCH_H1940 is not set
+# CONFIG_ARCH_SMDK2410 is not set
+CONFIG_MACH_VR1000=y
 
 #
 # Processor Type
@@ -119,9 +101,8 @@ CONFIG_CPU_TLB_V4WBI=y
 # General setup
 #
 # CONFIG_ZBOOT_ROM is not set
-CONFIG_ZBOOT_ROM_TEXT=0
-CONFIG_ZBOOT_ROM_BSS=0
-# CONFIG_HOTPLUG is not set
+CONFIG_ZBOOT_ROM_TEXT=0x0
+CONFIG_ZBOOT_ROM_BSS=0x0
 
 #
 # At least one math emulation must be selected
@@ -129,6 +110,7 @@ CONFIG_ZBOOT_ROM_BSS=0
 CONFIG_FPE_NWFPE=y
 CONFIG_FPE_NWFPE_XP=y
 # CONFIG_FPE_FASTFPE is not set
+# CONFIG_VFP is not set
 CONFIG_BINFMT_ELF=y
 CONFIG_BINFMT_AOUT=y
 # CONFIG_BINFMT_MISC is not set
@@ -136,9 +118,13 @@ CONFIG_BINFMT_AOUT=y
 #
 # Generic Driver Options
 #
+CONFIG_PREVENT_FIRMWARE_BUILD=y
+# CONFIG_DEBUG_DRIVER is not set
 # CONFIG_PM is not set
 # CONFIG_PREEMPT is not set
 # CONFIG_ARTHUR is not set
+CONFIG_S3C2410_DMA=y
+# CONFIG_S3C2410_DMA_DEBUG is not set
 CONFIG_CMDLINE="root=/dev/hda1 ro init=/bin/bash console=ttySAC0"
 CONFIG_ALIGNMENT_TRAP=y
 
@@ -148,7 +134,6 @@ CONFIG_ALIGNMENT_TRAP=y
 CONFIG_PARPORT=y
 CONFIG_PARPORT_PC=y
 CONFIG_PARPORT_PC_CML1=y
-# CONFIG_PARPORT_SERIAL is not set
 CONFIG_PARPORT_PC_FIFO=y
 CONFIG_PARPORT_PC_SUPERIO=y
 # CONFIG_PARPORT_ARC is not set
@@ -217,7 +202,6 @@ CONFIG_MTD_CFI_INTELEXT=y
 #
 # Plug and Play support
 #
-# CONFIG_PNP is not set
 
 #
 # Block devices
@@ -258,23 +242,21 @@ CONFIG_IP_PNP_BOOTP=y
 # CONFIG_NET_IPIP is not set
 # CONFIG_NET_IPGRE is not set
 # CONFIG_ARPD is not set
-# CONFIG_INET_ECN is not set
 # CONFIG_SYN_COOKIES is not set
 # CONFIG_INET_AH is not set
 # CONFIG_INET_ESP is not set
 # CONFIG_INET_IPCOMP is not set
 # CONFIG_IPV6 is not set
-# CONFIG_DECNET is not set
-# CONFIG_BRIDGE is not set
 # CONFIG_NETFILTER is not set
 
 #
 # SCTP Configuration (EXPERIMENTAL)
 #
-CONFIG_IPV6_SCTP__=y
 # CONFIG_IP_SCTP is not set
 # CONFIG_ATM is not set
+# CONFIG_BRIDGE is not set
 # CONFIG_VLAN_8021Q is not set
+# CONFIG_DECNET is not set
 # CONFIG_LLC2 is not set
 # CONFIG_IPX is not set
 # CONFIG_ATALK is not set
@@ -283,18 +265,23 @@ CONFIG_IPV6_SCTP__=y
 # 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
+# CONFIG_NET_CLS_ROUTE is not set
 
 #
 # Network testing
 #
 # CONFIG_NET_PKTGEN is not set
+# CONFIG_NETPOLL is not set
+# CONFIG_NET_POLL_CONTROLLER is not set
+# CONFIG_HAMRADIO is not set
+# CONFIG_IRDA is not set
+# CONFIG_BT is not set
 CONFIG_NETDEVICES=y
 # CONFIG_DUMMY is not set
 # CONFIG_BONDING is not set
@@ -315,40 +302,25 @@ CONFIG_NET_ETHERNET=y
 #
 # Ethernet (10000 Mbit)
 #
-# CONFIG_PLIP is not set
-# CONFIG_PPP is not set
-# CONFIG_SLIP is not set
 
 #
-# Wireless LAN (non-hamradio)
+# Token Ring devices
 #
-# CONFIG_NET_RADIO is not set
-# CONFIG_HOSTAP is not set
 
 #
-# Token Ring devices
+# Wireless LAN (non-hamradio)
 #
-# CONFIG_SHAPER is not set
+# CONFIG_NET_RADIO is not set
 
 #
 # Wan interfaces
 #
 # CONFIG_WAN is not set
-
-#
-# Amateur Radio support
-#
-# CONFIG_HAMRADIO is not set
-
-#
-# IrDA (infrared) support
-#
-# CONFIG_IRDA is not set
-
-#
-# Bluetooth support
-#
-# CONFIG_BT is not set
+# CONFIG_PLIP is not set
+# CONFIG_PPP is not set
+# CONFIG_SLIP is not set
+# CONFIG_SHAPER is not set
+# CONFIG_NETCONSOLE is not set
 
 #
 # ATA/ATAPI/MFM/RLL support
@@ -359,9 +331,9 @@ CONFIG_BLK_DEV_IDE=y
 #
 # Please see Documentation/ide.txt for help/info on IDE drives
 #
+# CONFIG_BLK_DEV_IDE_SATA is not set
 CONFIG_BLK_DEV_IDEDISK=y
 # CONFIG_IDEDISK_MULTI_MODE is not set
-# CONFIG_IDEDISK_STROKE is not set
 CONFIG_BLK_DEV_IDECD=y
 CONFIG_BLK_DEV_IDETAPE=m
 CONFIG_BLK_DEV_IDEFLOPPY=m
@@ -371,10 +343,10 @@ CONFIG_BLK_DEV_IDEFLOPPY=m
 #
 # IDE chipset support/bugfixes
 #
-CONFIG_BLK_DEV_IDE_BAST=y
+CONFIG_IDE_GENERIC=y
+# CONFIG_IDE_ARM is not set
 # CONFIG_BLK_DEV_IDEDMA is not set
 # CONFIG_IDEDMA_AUTO is not set
-# CONFIG_DMA_NONPCI is not set
 # CONFIG_BLK_DEV_HD is not set
 
 #
@@ -382,6 +354,15 @@ CONFIG_BLK_DEV_IDE_BAST=y
 #
 # CONFIG_SCSI is not set
 
+#
+# Fusion MPT device support
+#
+
+#
+# IEEE 1394 (FireWire) support
+#
+# CONFIG_IEEE1394 is not set
+
 #
 # I2O device support
 #
@@ -389,7 +370,7 @@ CONFIG_BLK_DEV_IDE_BAST=y
 #
 # ISDN subsystem
 #
-# CONFIG_ISDN_BOOL is not set
+# CONFIG_ISDN is not set
 
 #
 # Input device support
@@ -405,7 +386,6 @@ CONFIG_INPUT_MOUSEDEV_SCREEN_X=1024
 CONFIG_INPUT_MOUSEDEV_SCREEN_Y=768
 # CONFIG_INPUT_JOYDEV is not set
 # CONFIG_INPUT_TSDEV is not set
-# CONFIG_INPUT_TSLIBDEV is not set
 # CONFIG_INPUT_EVDEV is not set
 # CONFIG_INPUT_EVBUG is not set
 
@@ -415,7 +395,7 @@ CONFIG_INPUT_MOUSEDEV_SCREEN_Y=768
 # CONFIG_GAMEPORT is not set
 CONFIG_SOUND_GAMEPORT=y
 CONFIG_SERIO=y
-CONFIG_SERIO_I8042=y
+# CONFIG_SERIO_I8042 is not set
 CONFIG_SERIO_SERPORT=y
 # CONFIG_SERIO_CT82C710 is not set
 # CONFIG_SERIO_PARKBD is not set
@@ -424,14 +404,15 @@ CONFIG_SERIO_SERPORT=y
 # Input Device Drivers
 #
 CONFIG_INPUT_KEYBOARD=y
-CONFIG_KEYBOARD_ATKBD=y
+# CONFIG_KEYBOARD_ATKBD is not set
 # CONFIG_KEYBOARD_SUNKBD is not set
+# CONFIG_KEYBOARD_LKKBD is not set
 # CONFIG_KEYBOARD_XTKBD is not set
 # CONFIG_KEYBOARD_NEWTON is not set
 CONFIG_INPUT_MOUSE=y
 CONFIG_MOUSE_PS2=y
-# CONFIG_MOUSE_PS2_SYNAPTICS is not set
 # CONFIG_MOUSE_SERIAL is not set
+# CONFIG_MOUSE_VSXXXAA is not set
 # CONFIG_INPUT_JOYSTICK is not set
 # CONFIG_INPUT_TOUCHSCREEN is not set
 # CONFIG_INPUT_MISC is not set
@@ -478,15 +459,40 @@ CONFIG_SERIAL_8250_SHARE_IRQ=y
 #
 CONFIG_SERIAL_S3C2410=y
 CONFIG_SERIAL_S3C2410_CONSOLE=y
-# CONFIG_SERIAL_DZ is not set
+# CONFIG_SERIAL_BAST_SIO is not set
 CONFIG_SERIAL_CORE=y
 CONFIG_SERIAL_CORE_CONSOLE=y
 CONFIG_UNIX98_PTYS=y
-CONFIG_UNIX98_PTY_COUNT=256
+CONFIG_LEGACY_PTYS=y
+CONFIG_LEGACY_PTY_COUNT=256
 CONFIG_PRINTER=y
 # CONFIG_LP_CONSOLE is not set
 CONFIG_PPDEV=y
 # CONFIG_TIPAR is not set
+# CONFIG_QIC02_TAPE is not set
+
+#
+# IPMI
+#
+# CONFIG_IPMI_HANDLER is not set
+
+#
+# Watchdog Cards
+#
+# CONFIG_WATCHDOG 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
+# CONFIG_RAW_DRIVER is not set
 
 #
 # I2C support
@@ -505,55 +511,44 @@ CONFIG_I2C_ALGOBIT=m
 #
 # CONFIG_I2C_AMD756 is not set
 # CONFIG_I2C_AMD8111 is not set
-# CONFIG_I2C_PHILIPSPAR is not set
+# CONFIG_I2C_ISA is not set
+# CONFIG_I2C_PARPORT is not set
+# CONFIG_I2C_PARPORT_LIGHT is not set
 # CONFIG_SCx200_ACB is not set
 
 #
-# I2C Hardware Sensors Chip support
+# Hardware Sensors Chip support
 #
 CONFIG_I2C_SENSOR=m
 # CONFIG_SENSORS_ADM1021 is not set
-CONFIG_SENSORS_EEPROM=m
+# CONFIG_SENSORS_ASB100 is not set
+# CONFIG_SENSORS_DS1621 is not set
+# CONFIG_SENSORS_FSCHER is not set
+# CONFIG_SENSORS_GL518SM is not set
 # CONFIG_SENSORS_IT87 is not set
 CONFIG_SENSORS_LM75=m
 CONFIG_SENSORS_LM78=m
+# CONFIG_SENSORS_LM80 is not set
+# CONFIG_SENSORS_LM83 is not set
 CONFIG_SENSORS_LM85=m
+# CONFIG_SENSORS_LM90 is not set
+# CONFIG_SENSORS_MAX1619 is not set
 # CONFIG_SENSORS_VIA686A is not set
 # CONFIG_SENSORS_W83781D is not set
+# CONFIG_SENSORS_W83L785TS is not set
+# CONFIG_SENSORS_W83627HF is not set
 
 #
-# L3 serial bus support
-#
-# CONFIG_L3 is not set
-
-#
-# Mice
-#
-# CONFIG_BUSMOUSE is not set
-# CONFIG_QIC02_TAPE is not set
-
-#
-# IPMI
+# Other I2C Chip support
 #
-# CONFIG_IPMI_HANDLER is not set
-
-#
-# Watchdog Cards
-#
-# CONFIG_WATCHDOG 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
-# CONFIG_RAW_DRIVER is not set
+CONFIG_SENSORS_EEPROM=m
+# CONFIG_SENSORS_PCF8574 is not set
+# CONFIG_SENSORS_PCF8591 is not set
+# CONFIG_SENSORS_RTC8564 is not set
+# CONFIG_I2C_DEBUG_CORE is not set
+# CONFIG_I2C_DEBUG_ALGO is not set
+# CONFIG_I2C_DEBUG_BUS is not set
+# CONFIG_I2C_DEBUG_CHIP is not set
 
 #
 # Multimedia devices
@@ -565,11 +560,6 @@ CONFIG_RTC=y
 #
 # CONFIG_DVB is not set
 
-#
-# MMC/SD Card support
-#
-# CONFIG_MMC is not set
-
 #
 # File systems
 #
@@ -603,14 +593,16 @@ CONFIG_ROMFS_FS=y
 CONFIG_FAT_FS=y
 CONFIG_MSDOS_FS=y
 CONFIG_VFAT_FS=y
+CONFIG_FAT_DEFAULT_CODEPAGE=437
+CONFIG_FAT_DEFAULT_IOCHARSET="iso8859-1"
 # CONFIG_NTFS_FS is not set
 
 #
 # Pseudo filesystems
 #
 CONFIG_PROC_FS=y
+CONFIG_SYSFS=y
 # CONFIG_DEVFS_FS is not set
-CONFIG_DEVPTS_FS=y
 # CONFIG_DEVPTS_FS_XATTR is not set
 # CONFIG_TMPFS is not set
 # CONFIG_HUGETLBFS is not set
@@ -623,6 +615,7 @@ CONFIG_RAMFS=y
 # CONFIG_ADFS_FS is not set
 # CONFIG_AFFS_FS is not set
 # CONFIG_HFS_FS is not set
+# CONFIG_HFSPLUS_FS is not set
 # CONFIG_BEFS_FS is not set
 # CONFIG_BFS_FS is not set
 # CONFIG_EFS_FS is not set
@@ -650,12 +643,11 @@ CONFIG_ROOT_NFS=y
 CONFIG_LOCKD=y
 # CONFIG_EXPORTFS is not set
 CONFIG_SUNRPC=y
-# CONFIG_SUNRPC_GSS is not set
+# CONFIG_RPCSEC_GSS_KRB5 is not set
 # CONFIG_SMB_FS is not set
 # CONFIG_CIFS is not set
 # CONFIG_NCP_FS is not set
 # CONFIG_CODA_FS is not set
-# CONFIG_INTERMEZZO_FS is not set
 # CONFIG_AFS_FS is not set
 
 #
@@ -679,16 +671,15 @@ CONFIG_BSD_DISKLABEL=y
 CONFIG_SOLARIS_X86_PARTITION=y
 # CONFIG_UNIXWARE_DISKLABEL is not set
 # CONFIG_LDM_PARTITION is not set
-# CONFIG_NEC98_PARTITION is not set
 # CONFIG_SGI_PARTITION is not set
 # CONFIG_ULTRIX_PARTITION is not set
 # CONFIG_SUN_PARTITION is not set
 # CONFIG_EFI_PARTITION is not set
-CONFIG_NLS=y
 
 #
 # Native Language Support
 #
+CONFIG_NLS=y
 CONFIG_NLS_DEFAULT="iso8859-1"
 # CONFIG_NLS_CODEPAGE_437 is not set
 # CONFIG_NLS_CODEPAGE_737 is not set
@@ -713,6 +704,7 @@ CONFIG_NLS_DEFAULT="iso8859-1"
 # CONFIG_NLS_ISO8859_8 is not set
 # CONFIG_NLS_CODEPAGE_1250 is not set
 # CONFIG_NLS_CODEPAGE_1251 is not set
+# CONFIG_NLS_ASCII is not set
 # CONFIG_NLS_ISO8859_1 is not set
 # CONFIG_NLS_ISO8859_2 is not set
 # CONFIG_NLS_ISO8859_3 is not set
@@ -728,6 +720,11 @@ CONFIG_NLS_DEFAULT="iso8859-1"
 # CONFIG_NLS_KOI8_U is not set
 # CONFIG_NLS_UTF8 is not set
 
+#
+# Profiling support
+#
+# CONFIG_PROFILING is not set
+
 #
 # Graphics support
 #
@@ -748,21 +745,20 @@ CONFIG_DUMMY_CONSOLE=y
 # CONFIG_LOGO is not set
 
 #
-# Misc devices
+# Sound
 #
+# CONFIG_SOUND is not set
 
 #
-# Multimedia Capabilities Port drivers
+# Misc devices
 #
-# CONFIG_MCP is not set
 
 #
-# Console Switches
+# USB support
 #
-# CONFIG_SWITCHES is not set
 
 #
-# USB support
+# USB Gadget Support
 #
 # CONFIG_USB_GADGET is not set
 
@@ -780,7 +776,7 @@ CONFIG_DEBUG_KERNEL=y
 # CONFIG_DEBUG_BUGVERBOSE is not set
 # CONFIG_DEBUG_ERRORS is not set
 CONFIG_DEBUG_LL=y
-CONFIG_DEBUG_LL_PRINTK=y
+# CONFIG_DEBUG_ICEDCC is not set
 CONFIG_DEBUG_S3C2410_PORT=y
 CONFIG_DEBUG_S3C2410_UART=0
 
@@ -797,6 +793,8 @@ CONFIG_DEBUG_S3C2410_UART=0
 #
 # Library routines
 #
+# CONFIG_CRC_CCITT is not set
 CONFIG_CRC32=y
+# CONFIG_LIBCRC32C is not set
 CONFIG_ZLIB_INFLATE=y
 CONFIG_ZLIB_DEFLATE=y
diff --git a/arch/arm/configs/cerfcube_defconfig b/arch/arm/configs/cerfcube_defconfig
index 1701c6ff7..3f64361ab 100644
--- a/arch/arm/configs/cerfcube_defconfig
+++ b/arch/arm/configs/cerfcube_defconfig
@@ -332,7 +332,6 @@ CONFIG_IPV6_SCTP__=y
 # 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
 
 #
diff --git a/arch/arm/configs/clps7500_defconfig b/arch/arm/configs/clps7500_defconfig
index d1414031b..7444861d4 100644
--- a/arch/arm/configs/clps7500_defconfig
+++ b/arch/arm/configs/clps7500_defconfig
@@ -204,7 +204,6 @@ CONFIG_IP_PNP_BOOTP=y
 # 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
 
 #
diff --git a/arch/arm/configs/ebsa110_defconfig b/arch/arm/configs/ebsa110_defconfig
index 6f1dac2e1..2b1f60fdb 100644
--- a/arch/arm/configs/ebsa110_defconfig
+++ b/arch/arm/configs/ebsa110_defconfig
@@ -296,7 +296,6 @@ CONFIG_IP6_NF_TARGET_MARK=y
 # 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
 
 #
diff --git a/arch/arm/configs/edb7211_defconfig b/arch/arm/configs/edb7211_defconfig
index b3fad54ad..4a5542336 100644
--- a/arch/arm/configs/edb7211_defconfig
+++ b/arch/arm/configs/edb7211_defconfig
@@ -153,7 +153,6 @@ CONFIG_INET=y
 # 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
 
 #
diff --git a/arch/arm/configs/empeg_defconfig b/arch/arm/configs/empeg_defconfig
index cdd8a29cc..5df1a6136 100644
--- a/arch/arm/configs/empeg_defconfig
+++ b/arch/arm/configs/empeg_defconfig
@@ -162,7 +162,6 @@ CONFIG_INET=y
 # CONFIG_LLC 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
 # CONFIG_CPU_IS_SLOW is not set
 
diff --git a/arch/arm/configs/epxa10db_defconfig b/arch/arm/configs/epxa10db_defconfig
index afdb2cf50..d649de590 100644
--- a/arch/arm/configs/epxa10db_defconfig
+++ b/arch/arm/configs/epxa10db_defconfig
@@ -222,7 +222,6 @@ CONFIG_IPV6_SCTP__=y
 # 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
 
 #
diff --git a/arch/arm/configs/flexanet_defconfig b/arch/arm/configs/flexanet_defconfig
index 4bb20d909..300f79574 100644
--- a/arch/arm/configs/flexanet_defconfig
+++ b/arch/arm/configs/flexanet_defconfig
@@ -314,7 +314,6 @@ CONFIG_IP_PNP_DHCP=y
 # 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
 
 #
diff --git a/arch/arm/configs/footbridge_defconfig b/arch/arm/configs/footbridge_defconfig
index 388ab2e05..04c4485e1 100644
--- a/arch/arm/configs/footbridge_defconfig
+++ b/arch/arm/configs/footbridge_defconfig
@@ -203,7 +203,6 @@ CONFIG_ATM=y
 # 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
 
 #
diff --git a/arch/arm/configs/fortunet_defconfig b/arch/arm/configs/fortunet_defconfig
index 0cd43d312..621e9f5c6 100644
--- a/arch/arm/configs/fortunet_defconfig
+++ b/arch/arm/configs/fortunet_defconfig
@@ -267,7 +267,6 @@ CONFIG_UNIX=y
 # 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
 
 #
diff --git a/arch/arm/configs/freebird_defconfig b/arch/arm/configs/freebird_defconfig
index 0a2f65e2b..d6aa465b6 100644
--- a/arch/arm/configs/freebird_defconfig
+++ b/arch/arm/configs/freebird_defconfig
@@ -245,7 +245,6 @@ CONFIG_INET=y
 # 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
 
 #
diff --git a/arch/arm/configs/freebird_new_defconfig b/arch/arm/configs/freebird_new_defconfig
index 8879826ce..f2da8f920 100644
--- a/arch/arm/configs/freebird_new_defconfig
+++ b/arch/arm/configs/freebird_new_defconfig
@@ -258,7 +258,6 @@ CONFIG_INET=y
 # 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
 
 #
diff --git a/arch/arm/configs/graphicsclient_defconfig b/arch/arm/configs/graphicsclient_defconfig
index 35ccce6b8..c0a774d54 100644
--- a/arch/arm/configs/graphicsclient_defconfig
+++ b/arch/arm/configs/graphicsclient_defconfig
@@ -311,7 +311,6 @@ CONFIG_IP_PNP_BOOTP=y
 # 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
 
 #
diff --git a/arch/arm/configs/graphicsmaster_defconfig b/arch/arm/configs/graphicsmaster_defconfig
index 851f49e92..c09e20a6c 100644
--- a/arch/arm/configs/graphicsmaster_defconfig
+++ b/arch/arm/configs/graphicsmaster_defconfig
@@ -292,7 +292,6 @@ CONFIG_IP_PNP_BOOTP=y
 # 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
 
 #
diff --git a/arch/arm/configs/h3600_defconfig b/arch/arm/configs/h3600_defconfig
index a33ff62c8..5a32ac233 100644
--- a/arch/arm/configs/h3600_defconfig
+++ b/arch/arm/configs/h3600_defconfig
@@ -311,7 +311,6 @@ CONFIG_INET=y
 # 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
 
 #
diff --git a/arch/arm/configs/hackkit_defconfig b/arch/arm/configs/hackkit_defconfig
index 2be3db52b..a07c70279 100644
--- a/arch/arm/configs/hackkit_defconfig
+++ b/arch/arm/configs/hackkit_defconfig
@@ -281,7 +281,6 @@ CONFIG_IPV6_SCTP__=y
 # 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
 
 #
diff --git a/arch/arm/configs/huw_webpanel_defconfig b/arch/arm/configs/huw_webpanel_defconfig
index 87f6d7728..68329d444 100644
--- a/arch/arm/configs/huw_webpanel_defconfig
+++ b/arch/arm/configs/huw_webpanel_defconfig
@@ -200,7 +200,6 @@ CONFIG_INET=y
 # 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
 
 #
diff --git a/arch/arm/configs/integrator_defconfig b/arch/arm/configs/integrator_defconfig
index 89ec58a6f..8e2413266 100644
--- a/arch/arm/configs/integrator_defconfig
+++ b/arch/arm/configs/integrator_defconfig
@@ -299,7 +299,6 @@ CONFIG_INET_ECN=y
 # 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
 
 #
diff --git a/arch/arm/configs/iq80310_defconfig b/arch/arm/configs/iq80310_defconfig
index 9678ce094..e67d114f1 100644
--- a/arch/arm/configs/iq80310_defconfig
+++ b/arch/arm/configs/iq80310_defconfig
@@ -299,7 +299,6 @@ CONFIG_IPV6_SCTP__=y
 # 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
 
 #
diff --git a/arch/arm/configs/iq80321_defconfig b/arch/arm/configs/iq80321_defconfig
index c91325f4a..c9afe2458 100644
--- a/arch/arm/configs/iq80321_defconfig
+++ b/arch/arm/configs/iq80321_defconfig
@@ -297,7 +297,6 @@ CONFIG_IPV6_SCTP__=y
 # 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
 
 #
diff --git a/arch/arm/configs/ixp4xx_defconfig b/arch/arm/configs/ixp4xx_defconfig
index fd95f39bc..1933c7027 100644
--- a/arch/arm/configs/ixp4xx_defconfig
+++ b/arch/arm/configs/ixp4xx_defconfig
@@ -457,7 +457,6 @@ CONFIG_ECONET=m
 CONFIG_ECONET_AUNUDP=y
 CONFIG_ECONET_NATIVE=y
 CONFIG_WAN_ROUTER=m
-# CONFIG_NET_FASTROUTE is not set
 # CONFIG_NET_HW_FLOWCONTROL is not set
 
 #
diff --git a/arch/arm/configs/jornada720_defconfig b/arch/arm/configs/jornada720_defconfig
index ce5b62b58..b601e918a 100644
--- a/arch/arm/configs/jornada720_defconfig
+++ b/arch/arm/configs/jornada720_defconfig
@@ -314,7 +314,6 @@ CONFIG_IP_MULTICAST=y
 # 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
 
 #
diff --git a/arch/arm/configs/lart_defconfig b/arch/arm/configs/lart_defconfig
index c1f0b6871..64fd2a761 100644
--- a/arch/arm/configs/lart_defconfig
+++ b/arch/arm/configs/lart_defconfig
@@ -307,7 +307,6 @@ CONFIG_IPV6_SCTP__=y
 # 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
 
 #
diff --git a/arch/arm/configs/lpd7a400_defconfig b/arch/arm/configs/lpd7a400_defconfig
index 7bbb7181d..89936684e 100644
--- a/arch/arm/configs/lpd7a400_defconfig
+++ b/arch/arm/configs/lpd7a400_defconfig
@@ -316,7 +316,6 @@ CONFIG_IP_PNP_RARP=y
 # 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
 
 #
diff --git a/arch/arm/configs/lpd7a404_defconfig b/arch/arm/configs/lpd7a404_defconfig
index 517f486d9..23de2aaaa 100644
--- a/arch/arm/configs/lpd7a404_defconfig
+++ b/arch/arm/configs/lpd7a404_defconfig
@@ -315,7 +315,6 @@ CONFIG_IP_PNP_RARP=y
 # 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
 
 #
diff --git a/arch/arm/configs/lubbock_defconfig b/arch/arm/configs/lubbock_defconfig
index 6a4e8081c..b49f40438 100644
--- a/arch/arm/configs/lubbock_defconfig
+++ b/arch/arm/configs/lubbock_defconfig
@@ -312,7 +312,6 @@ CONFIG_IP_PNP_BOOTP=y
 # 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
 
 #
diff --git a/arch/arm/configs/mainstone_defconfig b/arch/arm/configs/mainstone_defconfig
index 925b2777f..4ab6e265a 100644
--- a/arch/arm/configs/mainstone_defconfig
+++ b/arch/arm/configs/mainstone_defconfig
@@ -28,6 +28,7 @@ CONFIG_HOTPLUG=y
 # CONFIG_IKCONFIG is not set
 # CONFIG_EMBEDDED is not set
 CONFIG_KALLSYMS=y
+# CONFIG_KALLSYMS_ALL is not set
 CONFIG_FUTEX=y
 CONFIG_EPOLL=y
 CONFIG_IOSCHED_NOOP=y
@@ -52,43 +53,22 @@ CONFIG_OBSOLETE_MODPARM=y
 # CONFIG_ARCH_CLPS7500 is not set
 # CONFIG_ARCH_CLPS711X is not set
 # CONFIG_ARCH_CO285 is not set
-CONFIG_ARCH_PXA=y
 # CONFIG_ARCH_EBSA110 is not set
 # CONFIG_ARCH_CAMELOT is not set
 # CONFIG_ARCH_FOOTBRIDGE is not set
 # CONFIG_ARCH_INTEGRATOR is not set
 # CONFIG_ARCH_IOP3XX is not set
+# CONFIG_ARCH_IXP4XX is not set
 # CONFIG_ARCH_L7200 is not set
+CONFIG_ARCH_PXA=y
 # CONFIG_ARCH_RPC is not set
 # CONFIG_ARCH_SA1100 is not set
-# CONFIG_ARCH_SHARK is not set
 # CONFIG_ARCH_S3C2410 is not set
-# CONFIG_ARCH_OMAP is not set
+# CONFIG_ARCH_SHARK is not set
 # CONFIG_ARCH_LH7A40X is not set
+# CONFIG_ARCH_OMAP is not set
 # CONFIG_ARCH_VERSATILE_PB is not set
 
-#
-# CLPS711X/EP721X Implementations
-#
-
-#
-# Epxa10db
-#
-
-#
-# Footbridge Implementations
-#
-
-#
-# IOP3xx Implementation Options
-#
-# CONFIG_ARCH_IOP310 is not set
-# CONFIG_ARCH_IOP321 is not set
-
-#
-# IOP3xx Chipset Features
-#
-
 #
 # Intel PXA2xx Implementations
 #
@@ -98,34 +78,6 @@ CONFIG_MACH_MAINSTONE=y
 CONFIG_PXA27x=y
 CONFIG_IWMMXT=y
 
-#
-# SA11x0 Implementations
-#
-
-#
-# TI OMAP Implementations
-#
-
-#
-# OMAP Core Type
-#
-
-#
-# OMAP Board Type
-#
-
-#
-# OMAP Feature Selections
-#
-
-#
-# S3C2410 Implementations
-#
-
-#
-# LH7A40X Implementations
-#
-
 #
 # Processor Type
 #
@@ -163,6 +115,7 @@ CONFIG_PCMCIA_PXA2XX=y
 CONFIG_FPE_NWFPE=y
 # CONFIG_FPE_NWFPE_XP is not set
 # CONFIG_FPE_FASTFPE is not set
+# CONFIG_VFP is not set
 CONFIG_BINFMT_ELF=y
 # CONFIG_BINFMT_AOUT is not set
 # CONFIG_BINFMT_MISC is not set
@@ -170,6 +123,7 @@ CONFIG_BINFMT_ELF=y
 #
 # Generic Driver Options
 #
+CONFIG_PREVENT_FIRMWARE_BUILD=y
 # CONFIG_FW_LOADER is not set
 # CONFIG_DEBUG_DRIVER is not set
 # CONFIG_PM is not set
@@ -322,7 +276,6 @@ CONFIG_IP_PNP_BOOTP=y
 # 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
 
 #
@@ -394,7 +347,6 @@ CONFIG_BLK_DEV_IDE=y
 #
 CONFIG_BLK_DEV_IDEDISK=y
 # CONFIG_IDEDISK_MULTI_MODE is not set
-# CONFIG_IDEDISK_STROKE is not set
 CONFIG_BLK_DEV_IDECS=y
 # CONFIG_BLK_DEV_IDECD is not set
 # CONFIG_BLK_DEV_IDETAPE is not set
@@ -406,6 +358,7 @@ CONFIG_BLK_DEV_IDECS=y
 # IDE chipset support/bugfixes
 #
 # CONFIG_IDE_GENERIC is not set
+# CONFIG_IDE_ARM is not set
 # CONFIG_BLK_DEV_IDEDMA is not set
 # CONFIG_IDEDMA_AUTO is not set
 # CONFIG_BLK_DEV_HD is not set
@@ -571,6 +524,7 @@ CONFIG_EXT2_FS=y
 CONFIG_FAT_FS=y
 CONFIG_MSDOS_FS=y
 # CONFIG_VFAT_FS is not set
+CONFIG_FAT_DEFAULT_CODEPAGE=437
 # CONFIG_NTFS_FS is not set
 
 #
@@ -622,7 +576,6 @@ CONFIG_SUNRPC=y
 # CONFIG_CIFS is not set
 # CONFIG_NCP_FS is not set
 # CONFIG_CODA_FS is not set
-# CONFIG_INTERMEZZO_FS is not set
 # CONFIG_AFS_FS is not set
 
 #
@@ -658,6 +611,7 @@ CONFIG_NLS_DEFAULT="iso8859-1"
 # CONFIG_NLS_ISO8859_8 is not set
 # CONFIG_NLS_CODEPAGE_1250 is not set
 # CONFIG_NLS_CODEPAGE_1251 is not set
+# CONFIG_NLS_ASCII is not set
 CONFIG_NLS_ISO8859_1=y
 # CONFIG_NLS_ISO8859_2 is not set
 # CONFIG_NLS_ISO8859_3 is not set
@@ -681,7 +635,10 @@ CONFIG_NLS_ISO8859_1=y
 #
 # Graphics support
 #
-# CONFIG_FB is not set
+CONFIG_FB=y
+CONFIG_FB_PXA=y
+# CONFIG_FB_PXA_PARAMETERS is not set
+# CONFIG_FB_VIRTUAL is not set
 
 #
 # Console display driver support
@@ -689,6 +646,19 @@ CONFIG_NLS_ISO8859_1=y
 # CONFIG_VGA_CONSOLE is not set
 # CONFIG_MDA_CONSOLE is not set
 CONFIG_DUMMY_CONSOLE=y
+CONFIG_FRAMEBUFFER_CONSOLE=y
+CONFIG_PCI_CONSOLE=y
+# CONFIG_FONTS is not set
+CONFIG_FONT_8x8=y
+CONFIG_FONT_8x16=y
+
+#
+# Logo configuration
+#
+CONFIG_LOGO=y
+CONFIG_LOGO_LINUX_MONO=y
+CONFIG_LOGO_LINUX_VGA16=y
+CONFIG_LOGO_LINUX_CLUT224=y
 
 #
 # Sound
diff --git a/arch/arm/configs/neponset_defconfig b/arch/arm/configs/neponset_defconfig
index 804faea09..1a955e1ca 100644
--- a/arch/arm/configs/neponset_defconfig
+++ b/arch/arm/configs/neponset_defconfig
@@ -299,7 +299,6 @@ CONFIG_IPV6_SCTP__=y
 # 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
 
 #
diff --git a/arch/arm/configs/netwinder_defconfig b/arch/arm/configs/netwinder_defconfig
index 4ec413887..1ed01995f 100644
--- a/arch/arm/configs/netwinder_defconfig
+++ b/arch/arm/configs/netwinder_defconfig
@@ -275,7 +275,6 @@ CONFIG_IPV6_SCTP__=y
 # 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
 
 #
diff --git a/arch/arm/configs/omnimeter_defconfig b/arch/arm/configs/omnimeter_defconfig
index 0e4e3c6fe..fd3849e96 100644
--- a/arch/arm/configs/omnimeter_defconfig
+++ b/arch/arm/configs/omnimeter_defconfig
@@ -179,7 +179,6 @@ CONFIG_IP_MULTICAST=y
 # 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
 
 #
diff --git a/arch/arm/configs/pangolin_defconfig b/arch/arm/configs/pangolin_defconfig
index 85743b7f7..35abb500d 100644
--- a/arch/arm/configs/pangolin_defconfig
+++ b/arch/arm/configs/pangolin_defconfig
@@ -292,7 +292,6 @@ CONFIG_INET=y
 # 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
 
 #
diff --git a/arch/arm/configs/pfs168_mqtft_defconfig b/arch/arm/configs/pfs168_mqtft_defconfig
index d9ffafd99..c09d6f31a 100644
--- a/arch/arm/configs/pfs168_mqtft_defconfig
+++ b/arch/arm/configs/pfs168_mqtft_defconfig
@@ -281,7 +281,6 @@ CONFIG_IP_PNP_BOOTP=y
 # 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
 
 #
diff --git a/arch/arm/configs/pfs168_mqvga_defconfig b/arch/arm/configs/pfs168_mqvga_defconfig
index bb8c97700..9cb30607a 100644
--- a/arch/arm/configs/pfs168_mqvga_defconfig
+++ b/arch/arm/configs/pfs168_mqvga_defconfig
@@ -281,7 +281,6 @@ CONFIG_IP_PNP_BOOTP=y
 # 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
 
 #
diff --git a/arch/arm/configs/pfs168_sastn_defconfig b/arch/arm/configs/pfs168_sastn_defconfig
index 109bcf3e8..e2a6b158a 100644
--- a/arch/arm/configs/pfs168_sastn_defconfig
+++ b/arch/arm/configs/pfs168_sastn_defconfig
@@ -282,7 +282,6 @@ CONFIG_IP_PNP_BOOTP=y
 # 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
 
 #
diff --git a/arch/arm/configs/pfs168_satft_defconfig b/arch/arm/configs/pfs168_satft_defconfig
index 1e4defd7b..ae1d313e3 100644
--- a/arch/arm/configs/pfs168_satft_defconfig
+++ b/arch/arm/configs/pfs168_satft_defconfig
@@ -281,7 +281,6 @@ CONFIG_IP_PNP_BOOTP=y
 # 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
 
 #
diff --git a/arch/arm/configs/pleb_defconfig b/arch/arm/configs/pleb_defconfig
index d1f60f4a9..d9389a2a5 100644
--- a/arch/arm/configs/pleb_defconfig
+++ b/arch/arm/configs/pleb_defconfig
@@ -256,7 +256,6 @@ CONFIG_SYN_COOKIES=y
 # 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
 
 #
diff --git a/arch/arm/configs/rpc_defconfig b/arch/arm/configs/rpc_defconfig
index 410ffd2ae..8097cdc4f 100644
--- a/arch/arm/configs/rpc_defconfig
+++ b/arch/arm/configs/rpc_defconfig
@@ -198,7 +198,6 @@ CONFIG_IPV6_SCTP__=y
 # 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
 
 #
diff --git a/arch/arm/configs/s3c2410_defconfig b/arch/arm/configs/s3c2410_defconfig
index 052cef493..d9e45878f 100644
--- a/arch/arm/configs/s3c2410_defconfig
+++ b/arch/arm/configs/s3c2410_defconfig
@@ -11,7 +11,6 @@ CONFIG_RWSEM_GENERIC_SPINLOCK=y
 #
 CONFIG_EXPERIMENTAL=y
 # CONFIG_CLEAN_COMPILE is not set
-CONFIG_STANDALONE=y
 CONFIG_BROKEN=y
 CONFIG_BROKEN_ON_SMP=y
 
@@ -20,17 +19,24 @@ CONFIG_BROKEN_ON_SMP=y
 #
 CONFIG_SWAP=y
 CONFIG_SYSVIPC=y
+# CONFIG_POSIX_MQUEUE is not set
 # CONFIG_BSD_PROCESS_ACCT is not set
 CONFIG_SYSCTL=y
+# CONFIG_AUDIT is not set
 CONFIG_LOG_BUF_SHIFT=16
+# CONFIG_HOTPLUG is not set
 # CONFIG_IKCONFIG is not set
 # CONFIG_EMBEDDED is not set
 CONFIG_KALLSYMS=y
+# CONFIG_KALLSYMS_ALL is not set
+# CONFIG_KALLSYMS_EXTRA_PASS is not set
 CONFIG_FUTEX=y
 CONFIG_EPOLL=y
 CONFIG_IOSCHED_NOOP=y
 CONFIG_IOSCHED_AS=y
 CONFIG_IOSCHED_DEADLINE=y
+CONFIG_IOSCHED_CFQ=y
+CONFIG_CC_OPTIMIZE_FOR_SIZE=y
 
 #
 # Loadable module support
@@ -44,58 +50,32 @@ CONFIG_KMOD=y
 #
 # System Type
 #
-# CONFIG_ARCH_ADIFCC is not set
-# CONFIG_ARCH_ANAKIN is not set
 # CONFIG_ARCH_CLPS7500 is not set
 # CONFIG_ARCH_CLPS711X is not set
 # CONFIG_ARCH_CO285 is not set
-# CONFIG_ARCH_PXA is not set
 # CONFIG_ARCH_EBSA110 is not set
 # CONFIG_ARCH_CAMELOT is not set
 # CONFIG_ARCH_FOOTBRIDGE is not set
 # CONFIG_ARCH_INTEGRATOR is not set
 # CONFIG_ARCH_IOP3XX is not set
+# CONFIG_ARCH_IXP4XX is not set
 # CONFIG_ARCH_L7200 is not set
+# CONFIG_ARCH_PXA is not set
 # CONFIG_ARCH_RPC is not set
 # CONFIG_ARCH_SA1100 is not set
-# CONFIG_ARCH_SHARK is not set
 CONFIG_ARCH_S3C2410=y
-
-#
-# CLPS711X/EP721X Implementations
-#
-
-#
-# Epxa10db
-#
-
-#
-# Footbridge Implementations
-#
-
-#
-# IOP3xx Implementation Options
-#
-# CONFIG_ARCH_IOP310 is not set
-# CONFIG_ARCH_IOP321 is not set
-
-#
-# IOP3xx Chipset Features
-#
-
-#
-# Intel PXA250/210 Implementations
-#
-
-#
-# SA11x0 Implementations
-#
+# CONFIG_ARCH_SHARK is not set
+# CONFIG_ARCH_LH7A40X is not set
+# CONFIG_ARCH_OMAP is not set
+# CONFIG_ARCH_VERSATILE_PB is not set
 
 #
 # S3C2410 Implementations
 #
 CONFIG_ARCH_BAST=y
 CONFIG_ARCH_H1940=y
+CONFIG_ARCH_SMDK2410=y
+CONFIG_MACH_VR1000=y
 
 #
 # Processor Type
@@ -120,9 +100,8 @@ CONFIG_CPU_TLB_V4WBI=y
 # General setup
 #
 # CONFIG_ZBOOT_ROM is not set
-CONFIG_ZBOOT_ROM_TEXT=0
-CONFIG_ZBOOT_ROM_BSS=0
-# CONFIG_HOTPLUG is not set
+CONFIG_ZBOOT_ROM_TEXT=0x0
+CONFIG_ZBOOT_ROM_BSS=0x0
 
 #
 # At least one math emulation must be selected
@@ -130,6 +109,7 @@ CONFIG_ZBOOT_ROM_BSS=0
 CONFIG_FPE_NWFPE=y
 CONFIG_FPE_NWFPE_XP=y
 # CONFIG_FPE_FASTFPE is not set
+# CONFIG_VFP is not set
 CONFIG_BINFMT_ELF=y
 CONFIG_BINFMT_AOUT=y
 # CONFIG_BINFMT_MISC is not set
@@ -137,6 +117,9 @@ CONFIG_BINFMT_AOUT=y
 #
 # Generic Driver Options
 #
+CONFIG_STANDALONE=y
+CONFIG_PREVENT_FIRMWARE_BUILD=y
+# CONFIG_DEBUG_DRIVER is not set
 # CONFIG_PM is not set
 # CONFIG_PREEMPT is not set
 # CONFIG_ARTHUR is not set
@@ -149,7 +132,6 @@ CONFIG_ALIGNMENT_TRAP=y
 CONFIG_PARPORT=y
 CONFIG_PARPORT_PC=y
 CONFIG_PARPORT_PC_CML1=y
-# CONFIG_PARPORT_SERIAL is not set
 CONFIG_PARPORT_PC_FIFO=y
 CONFIG_PARPORT_PC_SUPERIO=y
 # CONFIG_PARPORT_ARC is not set
@@ -180,9 +162,20 @@ CONFIG_MTD_CFI=y
 # CONFIG_MTD_JEDECPROBE is not set
 CONFIG_MTD_GEN_PROBE=y
 # CONFIG_MTD_CFI_ADV_OPTIONS is not set
+CONFIG_MTD_MAP_BANK_WIDTH_1=y
+CONFIG_MTD_MAP_BANK_WIDTH_2=y
+CONFIG_MTD_MAP_BANK_WIDTH_4=y
+# CONFIG_MTD_MAP_BANK_WIDTH_8 is not set
+# CONFIG_MTD_MAP_BANK_WIDTH_16 is not set
+# CONFIG_MTD_MAP_BANK_WIDTH_32 is not set
+CONFIG_MTD_CFI_I1=y
+CONFIG_MTD_CFI_I2=y
+# CONFIG_MTD_CFI_I4 is not set
+# CONFIG_MTD_CFI_I8 is not set
 CONFIG_MTD_CFI_INTELEXT=y
 # CONFIG_MTD_CFI_AMDSTD is not set
 # CONFIG_MTD_CFI_STAA is not set
+CONFIG_MTD_CFI_UTIL=y
 # CONFIG_MTD_RAM is not set
 # CONFIG_MTD_ROM is not set
 # CONFIG_MTD_ABSENT is not set
@@ -200,6 +193,7 @@ CONFIG_MTD_CFI_INTELEXT=y
 # Self-contained MTD device drivers
 #
 # CONFIG_MTD_SLRAM is not set
+# CONFIG_MTD_PHRAM is not set
 # CONFIG_MTD_MTDRAM is not set
 # CONFIG_MTD_BLKMTD is not set
 
@@ -218,7 +212,6 @@ CONFIG_MTD_CFI_INTELEXT=y
 #
 # Plug and Play support
 #
-# CONFIG_PNP is not set
 
 #
 # Block devices
@@ -259,23 +252,21 @@ CONFIG_IP_PNP_BOOTP=y
 # CONFIG_NET_IPIP is not set
 # CONFIG_NET_IPGRE is not set
 # CONFIG_ARPD is not set
-# CONFIG_INET_ECN is not set
 # CONFIG_SYN_COOKIES is not set
 # CONFIG_INET_AH is not set
 # CONFIG_INET_ESP is not set
 # CONFIG_INET_IPCOMP is not set
 # CONFIG_IPV6 is not set
-# CONFIG_DECNET is not set
-# CONFIG_BRIDGE is not set
 # CONFIG_NETFILTER is not set
 
 #
 # SCTP Configuration (EXPERIMENTAL)
 #
-CONFIG_IPV6_SCTP__=y
 # CONFIG_IP_SCTP is not set
 # CONFIG_ATM is not set
+# CONFIG_BRIDGE is not set
 # CONFIG_VLAN_8021Q is not set
+# CONFIG_DECNET is not set
 # CONFIG_LLC2 is not set
 # CONFIG_IPX is not set
 # CONFIG_ATALK is not set
@@ -284,18 +275,23 @@ CONFIG_IPV6_SCTP__=y
 # 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
+# CONFIG_NET_CLS_ROUTE is not set
 
 #
 # Network testing
 #
 # CONFIG_NET_PKTGEN is not set
+# CONFIG_NETPOLL is not set
+# CONFIG_NET_POLL_CONTROLLER is not set
+# CONFIG_HAMRADIO is not set
+# CONFIG_IRDA is not set
+# CONFIG_BT is not set
 CONFIG_NETDEVICES=y
 # CONFIG_DUMMY is not set
 # CONFIG_BONDING is not set
@@ -316,40 +312,25 @@ CONFIG_NET_ETHERNET=y
 #
 # Ethernet (10000 Mbit)
 #
-# CONFIG_PLIP is not set
-# CONFIG_PPP is not set
-# CONFIG_SLIP is not set
 
 #
-# Wireless LAN (non-hamradio)
+# Token Ring devices
 #
-# CONFIG_NET_RADIO is not set
-# CONFIG_HOSTAP is not set
 
 #
-# Token Ring devices
+# Wireless LAN (non-hamradio)
 #
-# CONFIG_SHAPER is not set
+# CONFIG_NET_RADIO is not set
 
 #
 # Wan interfaces
 #
 # CONFIG_WAN is not set
-
-#
-# Amateur Radio support
-#
-# CONFIG_HAMRADIO is not set
-
-#
-# IrDA (infrared) support
-#
-# CONFIG_IRDA is not set
-
-#
-# Bluetooth support
-#
-# CONFIG_BT is not set
+# CONFIG_PLIP is not set
+# CONFIG_PPP is not set
+# CONFIG_SLIP is not set
+# CONFIG_SHAPER is not set
+# CONFIG_NETCONSOLE is not set
 
 #
 # ATA/ATAPI/MFM/RLL support
@@ -360,9 +341,9 @@ CONFIG_BLK_DEV_IDE=y
 #
 # Please see Documentation/ide.txt for help/info on IDE drives
 #
+# CONFIG_BLK_DEV_IDE_SATA is not set
 CONFIG_BLK_DEV_IDEDISK=y
 # CONFIG_IDEDISK_MULTI_MODE is not set
-# CONFIG_IDEDISK_STROKE is not set
 CONFIG_BLK_DEV_IDECD=y
 CONFIG_BLK_DEV_IDETAPE=m
 CONFIG_BLK_DEV_IDEFLOPPY=m
@@ -372,10 +353,10 @@ CONFIG_BLK_DEV_IDEFLOPPY=m
 #
 # IDE chipset support/bugfixes
 #
-CONFIG_BLK_DEV_IDE_BAST=y
+CONFIG_IDE_GENERIC=y
+# CONFIG_IDE_ARM is not set
 # CONFIG_BLK_DEV_IDEDMA is not set
 # CONFIG_IDEDMA_AUTO is not set
-# CONFIG_DMA_NONPCI is not set
 # CONFIG_BLK_DEV_HD is not set
 
 #
@@ -383,6 +364,15 @@ CONFIG_BLK_DEV_IDE_BAST=y
 #
 # CONFIG_SCSI is not set
 
+#
+# Fusion MPT device support
+#
+
+#
+# IEEE 1394 (FireWire) support
+#
+# CONFIG_IEEE1394 is not set
+
 #
 # I2O device support
 #
@@ -390,7 +380,7 @@ CONFIG_BLK_DEV_IDE_BAST=y
 #
 # ISDN subsystem
 #
-# CONFIG_ISDN_BOOL is not set
+# CONFIG_ISDN is not set
 
 #
 # Input device support
@@ -406,7 +396,6 @@ CONFIG_INPUT_MOUSEDEV_SCREEN_X=1024
 CONFIG_INPUT_MOUSEDEV_SCREEN_Y=768
 # CONFIG_INPUT_JOYDEV is not set
 # CONFIG_INPUT_TSDEV is not set
-# CONFIG_INPUT_TSLIBDEV is not set
 # CONFIG_INPUT_EVDEV is not set
 # CONFIG_INPUT_EVBUG is not set
 
@@ -427,12 +416,13 @@ CONFIG_SERIO_SERPORT=y
 CONFIG_INPUT_KEYBOARD=y
 CONFIG_KEYBOARD_ATKBD=y
 # CONFIG_KEYBOARD_SUNKBD is not set
+# CONFIG_KEYBOARD_LKKBD is not set
 # CONFIG_KEYBOARD_XTKBD is not set
 # CONFIG_KEYBOARD_NEWTON is not set
 CONFIG_INPUT_MOUSE=y
 CONFIG_MOUSE_PS2=y
-# CONFIG_MOUSE_PS2_SYNAPTICS is not set
 # CONFIG_MOUSE_SERIAL is not set
+# CONFIG_MOUSE_VSXXXAA is not set
 # CONFIG_INPUT_JOYSTICK is not set
 # CONFIG_INPUT_TOUCHSCREEN is not set
 # CONFIG_INPUT_MISC is not set
@@ -451,8 +441,6 @@ CONFIG_SERIAL_NONSTANDARD=y
 # CONFIG_DIGI 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_SYNCLINKMP is not set
 # CONFIG_N_HDLC is not set
 # CONFIG_RISCOM8 is not set
@@ -480,15 +468,37 @@ CONFIG_SERIAL_8250_SHARE_IRQ=y
 CONFIG_SERIAL_S3C2410=y
 CONFIG_SERIAL_S3C2410_CONSOLE=y
 CONFIG_SERIAL_BAST_SIO=y
-# CONFIG_SERIAL_DZ is not set
 CONFIG_SERIAL_CORE=y
 CONFIG_SERIAL_CORE_CONSOLE=y
 CONFIG_UNIX98_PTYS=y
-CONFIG_UNIX98_PTY_COUNT=256
+CONFIG_LEGACY_PTYS=y
+CONFIG_LEGACY_PTY_COUNT=256
 CONFIG_PRINTER=y
 # CONFIG_LP_CONSOLE is not set
 CONFIG_PPDEV=y
 # CONFIG_TIPAR is not set
+# CONFIG_QIC02_TAPE is not set
+
+#
+# IPMI
+#
+# CONFIG_IPMI_HANDLER is not set
+
+#
+# Watchdog Cards
+#
+# CONFIG_WATCHDOG is not set
+# CONFIG_NVRAM is not set
+CONFIG_RTC=y
+# CONFIG_DTLK is not set
+# CONFIG_R3964 is not set
+
+#
+# Ftape, the floppy tape device driver
+#
+# CONFIG_AGP is not set
+# CONFIG_DRM is not set
+# CONFIG_RAW_DRIVER is not set
 
 #
 # I2C support
@@ -507,55 +517,46 @@ CONFIG_I2C_ALGOBIT=m
 #
 # CONFIG_I2C_AMD756 is not set
 # CONFIG_I2C_AMD8111 is not set
-# CONFIG_I2C_PHILIPSPAR is not set
+# CONFIG_I2C_ISA is not set
+# CONFIG_I2C_PARPORT is not set
+# CONFIG_I2C_PARPORT_LIGHT is not set
 # CONFIG_SCx200_ACB is not set
 
 #
-# I2C Hardware Sensors Chip support
+# Hardware Sensors Chip support
 #
 CONFIG_I2C_SENSOR=m
 # CONFIG_SENSORS_ADM1021 is not set
-CONFIG_SENSORS_EEPROM=m
+# CONFIG_SENSORS_ADM1025 is not set
+# CONFIG_SENSORS_ADM1031 is not set
+# CONFIG_SENSORS_ASB100 is not set
+# CONFIG_SENSORS_DS1621 is not set
+# CONFIG_SENSORS_FSCHER is not set
+# CONFIG_SENSORS_GL518SM is not set
 # CONFIG_SENSORS_IT87 is not set
 CONFIG_SENSORS_LM75=m
+# CONFIG_SENSORS_LM77 is not set
 CONFIG_SENSORS_LM78=m
+# CONFIG_SENSORS_LM80 is not set
+# CONFIG_SENSORS_LM83 is not set
 CONFIG_SENSORS_LM85=m
-# CONFIG_SENSORS_VIA686A is not set
+# CONFIG_SENSORS_LM90 is not set
+# CONFIG_SENSORS_MAX1619 is not set
 # CONFIG_SENSORS_W83781D is not set
+# CONFIG_SENSORS_W83L785TS is not set
+# CONFIG_SENSORS_W83627HF is not set
 
 #
-# L3 serial bus support
-#
-# CONFIG_L3 is not set
-
-#
-# Mice
-#
-# CONFIG_BUSMOUSE is not set
-# CONFIG_QIC02_TAPE is not set
-
-#
-# IPMI
-#
-# CONFIG_IPMI_HANDLER is not set
-
-#
-# Watchdog Cards
-#
-# CONFIG_WATCHDOG is not set
-# CONFIG_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
+# Other I2C Chip support
 #
-# CONFIG_FTAPE is not set
-# CONFIG_AGP is not set
-# CONFIG_DRM is not set
-# CONFIG_RAW_DRIVER is not set
+CONFIG_SENSORS_EEPROM=m
+# CONFIG_SENSORS_PCF8574 is not set
+# CONFIG_SENSORS_PCF8591 is not set
+# CONFIG_SENSORS_RTC8564 is not set
+# CONFIG_I2C_DEBUG_CORE is not set
+# CONFIG_I2C_DEBUG_ALGO is not set
+# CONFIG_I2C_DEBUG_BUS is not set
+# CONFIG_I2C_DEBUG_CHIP is not set
 
 #
 # Multimedia devices
@@ -567,11 +568,6 @@ CONFIG_RTC=y
 #
 # CONFIG_DVB is not set
 
-#
-# MMC/SD Card support
-#
-# CONFIG_MMC is not set
-
 #
 # File systems
 #
@@ -611,8 +607,8 @@ CONFIG_VFAT_FS=y
 # Pseudo filesystems
 #
 CONFIG_PROC_FS=y
+CONFIG_SYSFS=y
 # CONFIG_DEVFS_FS is not set
-CONFIG_DEVPTS_FS=y
 # CONFIG_DEVPTS_FS_XATTR is not set
 # CONFIG_TMPFS is not set
 # CONFIG_HUGETLBFS is not set
@@ -625,14 +621,20 @@ CONFIG_RAMFS=y
 # CONFIG_ADFS_FS is not set
 # CONFIG_AFFS_FS is not set
 # CONFIG_HFS_FS is not set
+# CONFIG_HFSPLUS_FS is not set
 # CONFIG_BEFS_FS is not set
 # CONFIG_BFS_FS is not set
 # CONFIG_EFS_FS is not set
 CONFIG_JFFS_FS=y
 CONFIG_JFFS_FS_VERBOSE=0
+# CONFIG_JFFS_PROC_FS is not set
 CONFIG_JFFS2_FS=y
 CONFIG_JFFS2_FS_DEBUG=0
 # CONFIG_JFFS2_FS_NAND is not set
+# CONFIG_JFFS2_COMPRESSION_OPTIONS is not set
+CONFIG_JFFS2_ZLIB=y
+CONFIG_JFFS2_RTIME=y
+# CONFIG_JFFS2_RUBIN is not set
 # CONFIG_CRAMFS is not set
 # CONFIG_VXFS_FS is not set
 # CONFIG_HPFS_FS is not set
@@ -652,12 +654,11 @@ CONFIG_ROOT_NFS=y
 CONFIG_LOCKD=y
 # CONFIG_EXPORTFS is not set
 CONFIG_SUNRPC=y
-# CONFIG_SUNRPC_GSS is not set
+# CONFIG_RPCSEC_GSS_KRB5 is not set
 # CONFIG_SMB_FS is not set
 # CONFIG_CIFS is not set
 # CONFIG_NCP_FS is not set
 # CONFIG_CODA_FS is not set
-# CONFIG_INTERMEZZO_FS is not set
 # CONFIG_AFS_FS is not set
 
 #
@@ -675,16 +676,15 @@ CONFIG_BSD_DISKLABEL=y
 CONFIG_SOLARIS_X86_PARTITION=y
 # CONFIG_UNIXWARE_DISKLABEL is not set
 # CONFIG_LDM_PARTITION is not set
-# CONFIG_NEC98_PARTITION is not set
 # CONFIG_SGI_PARTITION is not set
 # CONFIG_ULTRIX_PARTITION is not set
 # CONFIG_SUN_PARTITION is not set
 # CONFIG_EFI_PARTITION is not set
-CONFIG_NLS=y
 
 #
 # Native Language Support
 #
+CONFIG_NLS=y
 CONFIG_NLS_DEFAULT="iso8859-1"
 # CONFIG_NLS_CODEPAGE_437 is not set
 # CONFIG_NLS_CODEPAGE_737 is not set
@@ -709,6 +709,7 @@ CONFIG_NLS_DEFAULT="iso8859-1"
 # CONFIG_NLS_ISO8859_8 is not set
 # CONFIG_NLS_CODEPAGE_1250 is not set
 # CONFIG_NLS_CODEPAGE_1251 is not set
+# CONFIG_NLS_ASCII is not set
 # CONFIG_NLS_ISO8859_1 is not set
 # CONFIG_NLS_ISO8859_2 is not set
 # CONFIG_NLS_ISO8859_3 is not set
@@ -724,6 +725,11 @@ CONFIG_NLS_DEFAULT="iso8859-1"
 # CONFIG_NLS_KOI8_U is not set
 # CONFIG_NLS_UTF8 is not set
 
+#
+# Profiling support
+#
+# CONFIG_PROFILING is not set
+
 #
 # Graphics support
 #
@@ -744,21 +750,20 @@ CONFIG_DUMMY_CONSOLE=y
 # CONFIG_LOGO is not set
 
 #
-# Misc devices
+# Sound
 #
+# CONFIG_SOUND is not set
 
 #
-# Multimedia Capabilities Port drivers
+# Misc devices
 #
-# CONFIG_MCP is not set
 
 #
-# Console Switches
+# USB support
 #
-# CONFIG_SWITCHES is not set
 
 #
-# USB support
+# USB Gadget Support
 #
 # CONFIG_USB_GADGET is not set
 
@@ -776,7 +781,6 @@ CONFIG_DEBUG_KERNEL=y
 # CONFIG_DEBUG_BUGVERBOSE is not set
 # CONFIG_DEBUG_ERRORS is not set
 CONFIG_DEBUG_LL=y
-CONFIG_DEBUG_LL_PRINTK=y
 # CONFIG_DEBUG_ICEDCC is not set
 CONFIG_DEBUG_S3C2410_PORT=y
 CONFIG_DEBUG_S3C2410_UART=0
@@ -794,6 +798,8 @@ CONFIG_DEBUG_S3C2410_UART=0
 #
 # Library routines
 #
+# CONFIG_CRC_CCITT is not set
 CONFIG_CRC32=y
+# CONFIG_LIBCRC32C is not set
 CONFIG_ZLIB_INFLATE=y
 CONFIG_ZLIB_DEFLATE=y
diff --git a/arch/arm/configs/shannon_defconfig b/arch/arm/configs/shannon_defconfig
index 326c57981..393731f70 100644
--- a/arch/arm/configs/shannon_defconfig
+++ b/arch/arm/configs/shannon_defconfig
@@ -270,7 +270,6 @@ CONFIG_INET=y
 # 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
 
 #
diff --git a/arch/arm/configs/shark_defconfig b/arch/arm/configs/shark_defconfig
index 9d90fede9..f455e3b41 100644
--- a/arch/arm/configs/shark_defconfig
+++ b/arch/arm/configs/shark_defconfig
@@ -230,7 +230,6 @@ CONFIG_IPV6_SCTP__=y
 # 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
 
 #
diff --git a/arch/arm/configs/smdk2410_defconfig b/arch/arm/configs/smdk2410_defconfig
index a88724f26..1309997f7 100644
--- a/arch/arm/configs/smdk2410_defconfig
+++ b/arch/arm/configs/smdk2410_defconfig
@@ -294,7 +294,6 @@ CONFIG_IP_PNP_BOOTP=y
 # 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
 
 #
diff --git a/arch/arm/configs/stork_defconfig b/arch/arm/configs/stork_defconfig
index b363af6c2..869b0ee64 100644
--- a/arch/arm/configs/stork_defconfig
+++ b/arch/arm/configs/stork_defconfig
@@ -327,7 +327,6 @@ CONFIG_INET=y
 # 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
 
 #
diff --git a/arch/arm/configs/system3_defconfig b/arch/arm/configs/system3_defconfig
index 4d2982750..ec31f6fef 100644
--- a/arch/arm/configs/system3_defconfig
+++ b/arch/arm/configs/system3_defconfig
@@ -310,7 +310,6 @@ CONFIG_INET=y
 # 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
 
 #
diff --git a/arch/arm/configs/trizeps_defconfig b/arch/arm/configs/trizeps_defconfig
index c2415315f..9c23654e6 100644
--- a/arch/arm/configs/trizeps_defconfig
+++ b/arch/arm/configs/trizeps_defconfig
@@ -351,7 +351,6 @@ CONFIG_IPV6_SCTP__=y
 # 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
 
 #
diff --git a/arch/arm/configs/versatile_defconfig b/arch/arm/configs/versatile_defconfig
index 04a10ffcf..b5e260236 100644
--- a/arch/arm/configs/versatile_defconfig
+++ b/arch/arm/configs/versatile_defconfig
@@ -302,7 +302,6 @@ CONFIG_IP_PNP_BOOTP=y
 # 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
 
 #
diff --git a/arch/arm/defconfig b/arch/arm/defconfig
index 10024456a..ddb89f813 100644
--- a/arch/arm/defconfig
+++ b/arch/arm/defconfig
@@ -197,7 +197,6 @@ CONFIG_IP_PNP_BOOTP=y
 # 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
 
 #
diff --git a/arch/arm/kernel/Makefile b/arch/arm/kernel/Makefile
index 991c219b3..1a85e39d7 100644
--- a/arch/arm/kernel/Makefile
+++ b/arch/arm/kernel/Makefile
@@ -11,8 +11,7 @@ obj-y		:= arch.o compat.o dma.o entry-armv.o entry-common.o irq.o   \
 		   time.o traps.o
 
 obj-$(CONFIG_APM)		+= apm.o
-obj-$(CONFIG_ARCH_ACORN)	+= ecard.o time-acorn.o
-obj-$(CONFIG_ARCH_CLPS7500)	+= time-acorn.o
+obj-$(CONFIG_ARCH_ACORN)	+= ecard.o 
 obj-$(CONFIG_FOOTBRIDGE)	+= isa.o
 obj-$(CONFIG_FIQ)		+= fiq.o
 obj-$(CONFIG_MODULES)		+= armksyms.o module.o
diff --git a/arch/arm/kernel/apm.c b/arch/arm/kernel/apm.c
index 7849b28fc..a64f78def 100644
--- a/arch/arm/kernel/apm.c
+++ b/arch/arm/kernel/apm.c
@@ -206,7 +206,7 @@ static int apm_suspend(void)
 	return err;
 }
 
-static ssize_t apm_read(struct file *fp, char *buf, size_t count, loff_t *ppos)
+static ssize_t apm_read(struct file *fp, char __user *buf, size_t count, loff_t *ppos)
 {
 	struct apm_user *as = fp->private_data;
 	apm_event_t event;
diff --git a/arch/arm/kernel/asm-offsets.c b/arch/arm/kernel/asm-offsets.c
index 2f251d1f6..c54132421 100644
--- a/arch/arm/kernel/asm-offsets.c
+++ b/arch/arm/kernel/asm-offsets.c
@@ -12,6 +12,7 @@
  */
 #include <linux/sched.h>
 #include <linux/mm.h>
+#include <asm/mach/arch.h>
 
 /*
  * Make sure that the compiler and target are compatible.
@@ -59,5 +60,7 @@ int main(void)
   DEFINE(PAGE_SZ,	       	PAGE_SIZE);
   BLANK();
   DEFINE(SYS_ERROR0,		0x9f0000);
+  BLANK();
+  DEFINE(SIZEOF_MACHINE_DESC,	sizeof(struct machine_desc));
   return 0; 
 }
diff --git a/arch/arm/kernel/debug.S b/arch/arm/kernel/debug.S
index 2ae6eae42..822dbde5a 100644
--- a/arch/arm/kernel/debug.S
+++ b/arch/arm/kernel/debug.S
@@ -439,32 +439,6 @@
 #endif
 		.endm
 
-#elif defined(CONFIG_ARCH_ADI_EVB)
-
-		.macro	addruart,rx
-		mrc	p15, 0, \rx, c1, c0
-		tst	\rx, #1			@ MMU enabled?
-		mov	\rx, #0x00400000	@ physical base address
-		orrne	\rx, \rx, #0xff000000	@ virtual base
-		.endm
-
-		.macro	senduart,rd,rx
-		strb	\rd, [\rx]
-		.endm
-
-		.macro	busyuart,rd,rx
-1002:		ldrb	\rd, [\rx, #0x5]
-		and	\rd, \rd, #0x60
-		teq	\rd, #0x60
-		bne	1002b
-		.endm
-
-		.macro	waituart,rd,rx
-1001:		ldrb	\rd, [\rx, #0x6]
-		tst	\rd, #0x10
-		beq	1001b
-		.endm
-
 #elif defined(CONFIG_ARCH_IXP4XX)
 
                 .macro  addruart,rx
@@ -591,7 +565,8 @@
 		.macro  addruart,rx
 		mrc     p15, 0, \rx, c1, c0
 		tst     \rx, #1                 @ MMU enabled?
-		ldr     \rx, =0x80000700        @ physical base address
+		mov     \rx, #0x00000700        @ offset from base
+		orreq   \rx, \rx, #0x80000000   @ physical base
 		orrne   \rx, \rx, #0xf8000000   @ virtual base
 		.endm
 
diff --git a/arch/arm/kernel/ecard.c b/arch/arm/kernel/ecard.c
index e47084d86..d3dafbf4f 100644
--- a/arch/arm/kernel/ecard.c
+++ b/arch/arm/kernel/ecard.c
@@ -841,7 +841,7 @@ static void __init ecard_init_resources(struct expansion_card *ec)
 	} else
 #endif
 
-	for (i = 0; i < ECARD_RES_IOCSYNC - ECARD_RES_IOCSLOW; i++) {
+	for (i = 0; i <= ECARD_RES_IOCSYNC - ECARD_RES_IOCSLOW; i++) {
 		ec_set_resource(ec, i + ECARD_RES_IOCSLOW,
 				base + (slot << 14) + (i << 19),
 				PODSLOT_IOC_SIZE, IORESOURCE_MEM);
diff --git a/arch/arm/kernel/entry-armv.S b/arch/arm/kernel/entry-armv.S
index 8af6251f3..7fe5c2d39 100644
--- a/arch/arm/kernel/entry-armv.S
+++ b/arch/arm/kernel/entry-armv.S
@@ -19,6 +19,7 @@
 #include <asm/thread_info.h>
 #include <asm/glue.h>
 #include <asm/ptrace.h>
+#include <asm/vfpmacros.h>
 
 #include "entry-header.S"
 
@@ -561,7 +562,7 @@ ENTRY(soft_irq_mask)
 		.macro	irq_prio_table
 		.endm
 
-#elif defined(CONFIG_ARCH_IOP310) || defined(CONFIG_ARCH_ADIFCC)
+#elif defined(CONFIG_ARCH_IOP310)
 
 		.macro	disable_fiq
 		.endm
@@ -951,7 +952,7 @@ __dabt_svc:	sub	sp, sp, #S_FRAME_SIZE
 		bl	do_DataAbort
 		disable_irq r0
 		ldr	r0, [sp, #S_PSR]
-		msr	spsr, r0
+		msr	spsr_cxsf, r0
 		ldmia	sp, {r0 - pc}^			@ load r0 - pc, cpsr
 
 		.align	5
@@ -987,7 +988,7 @@ preempt_return:
 		strne	r0, [r0, -r0]			@ bug()
 #endif
 		ldr	r0, [sp, #S_PSR]		@ irqs are already disabled
-		msr	spsr, r0
+		msr	spsr_cxsf, r0
 		ldmia	sp, {r0 - pc}^			@ load r0 - pc, cpsr
 
 		.ltorg
@@ -1030,7 +1031,7 @@ __und_svc:	sub	sp, sp, #S_FRAME_SIZE
 
 1:		disable_irq r0
 		ldr	lr, [sp, #S_PSR]		@ Get SVC cpsr
-		msr	spsr, lr
+		msr	spsr_cxsf, lr
 		ldmia	sp, {r0 - pc}^			@ Restore SVC registers
 
 		.align	5
@@ -1051,7 +1052,7 @@ __pabt_svc:	sub	sp, sp, #S_FRAME_SIZE
 		bl	do_PrefetchAbort		@ call abort handler
 		disable_irq r0
 		ldr	r0, [sp, #S_PSR]
-		msr	spsr, r0
+		msr	spsr_cxsf, r0
 		ldmia	sp, {r0 - pc}^			@ load r0 - pc, cpsr
 
 		.align	5
@@ -1198,8 +1199,13 @@ call_fpe:	enable_irq r10				@ Enable interrupts
 		mov	pc, lr				@ CP#7
 		mov	pc, lr				@ CP#8
 		mov	pc, lr				@ CP#9
+#ifdef CONFIG_VFP
+		b	do_vfp				@ CP#10 (VFP)
+		b	do_vfp				@ CP#11 (VFP)
+#else
 		mov	pc, lr				@ CP#10 (VFP)
 		mov	pc, lr				@ CP#11 (VFP)
+#endif
 		mov	pc, lr				@ CP#12
 		mov	pc, lr				@ CP#13
 		mov	pc, lr				@ CP#14 (Debug)
@@ -1260,6 +1266,13 @@ ENTRY(__switch_to)
 		ldr	r3, [r2, #TI_CPU_DOMAIN]!
 		stmia	ip, {r4 - sl, fp, sp, lr}	@ Store most regs on stack
 		mcr	p15, 0, r3, c3, c0, 0		@ Set domain register
+#ifdef CONFIG_VFP
+		@ Always disable VFP so we can lazily save/restore the old
+		@ state. This occurs in the context of the previous thread.
+		VFPFMRX	r4, FPEXC
+		bic	r4, r4, #FPEXC_ENABLE
+		VFPFMXR	FPEXC, r4
+#endif
 		ldmib	r2, {r4 - sl, fp, sp, pc}	@ Load all regs saved previously
 
 		__INIT
@@ -1290,7 +1303,7 @@ vector_IRQ:	@
 		mrs	r13, cpsr
 		bic	r13, r13, #MODE_MASK
 		orr	r13, r13, #MODE_SVC
-		msr	spsr, r13			@ switch to SVC_32 mode
+		msr	spsr_cxsf, r13			@ switch to SVC_32 mode
 
 		and	lr, lr, #15
 		ldr	lr, [pc, lr, lsl #2]
@@ -1333,7 +1346,7 @@ vector_data:	@
 		mrs	r13, cpsr
 		bic	r13, r13, #MODE_MASK
 		orr	r13, r13, #MODE_SVC
-		msr	spsr, r13			@ switch to SVC_32 mode
+		msr	spsr_cxsf, r13			@ switch to SVC_32 mode
 
 		and	lr, lr, #15
 		ldr	lr, [pc, lr, lsl #2]
@@ -1377,7 +1390,7 @@ vector_prefetch:
 		mrs	r13, cpsr
 		bic	r13, r13, #MODE_MASK
 		orr	r13, r13, #MODE_SVC
-		msr	spsr, r13			@ switch to SVC_32 mode
+		msr	spsr_cxsf, r13			@ switch to SVC_32 mode
 
 		ands	lr, lr, #15
 		ldr	lr, [pc, lr, lsl #2]
@@ -1420,7 +1433,7 @@ vector_undefinstr:
 		mrs	r13, cpsr
 		bic	r13, r13, #MODE_MASK
 		orr	r13, r13, #MODE_SVC
-		msr	spsr, r13			@ switch to SVC_32 mode
+		msr	spsr_cxsf, r13			@ switch to SVC_32 mode
 
 		and	lr, lr, #15
 		ldr	lr, [pc, lr, lsl #2]
diff --git a/arch/arm/kernel/entry-common.S b/arch/arm/kernel/entry-common.S
index 8686a90c1..3314274b7 100644
--- a/arch/arm/kernel/entry-common.S
+++ b/arch/arm/kernel/entry-common.S
@@ -102,7 +102,7 @@ ENTRY(ret_from_fork)
 	ldr	r0, [sp, #S_PSR]		@ Get calling cpsr
 	sub	lr, lr, #4
 	str	lr, [r8]
-	msr	spsr, r0
+	msr	spsr_cxsf, r0
 	ldmia	sp, {r0 - lr}^			@ Get calling r0 - lr
 	mov	r0, r0
 	ldr	lr, [sp, #S_PC]			@ Get PC
diff --git a/arch/arm/kernel/entry-header.S b/arch/arm/kernel/entry-header.S
index 0af6f53e2..ef152e3b5 100644
--- a/arch/arm/kernel/entry-header.S
+++ b/arch/arm/kernel/entry-header.S
@@ -99,7 +99,7 @@
 	ldr	r1, [sp, #S_PSR]		@ Get calling cpsr
 	disable_irq ip				@ disable IRQs
 	ldr	lr, [sp, #S_PC]!		@ Get PC
-	msr	spsr, r1			@ save in spsr_svc
+	msr	spsr_cxsf, r1			@ save in spsr_svc
 	ldmdb	sp, {r0 - lr}^			@ Get calling r0 - lr
 	mov	r0, r0
 	add	sp, sp, #S_FRAME_SIZE - S_PC
@@ -112,7 +112,7 @@
 	.macro	fast_restore_user_regs
 	ldr	r1, [sp, #S_OFF + S_PSR]	@ get calling cpsr
 	ldr	lr, [sp, #S_OFF + S_PC]!	@ get pc
-	msr	spsr, r1			@ save in spsr_svc
+	msr	spsr_cxsf, r1			@ save in spsr_svc
 	ldmdb	sp, {r1 - lr}^			@ get calling r1 - lr
 	mov	r0, r0
 	add	sp, sp, #S_FRAME_SIZE - S_PC
@@ -125,7 +125,7 @@
 	.macro	slow_restore_user_regs
 	ldr	r1, [sp, #S_PSR]		@ get calling cpsr
 	ldr	lr, [sp, #S_PC]!		@ get pc
-	msr	spsr, r1			@ save in spsr_svc
+	msr	spsr_cxsf, r1			@ save in spsr_svc
 	ldmdb	sp, {r0 - lr}^			@ get calling r1 - lr
 	mov	r0, r0
 	add	sp, sp, #S_FRAME_SIZE - S_PC
diff --git a/arch/arm/kernel/head.S b/arch/arm/kernel/head.S
index 4de9941c5..6958a8b3f 100644
--- a/arch/arm/kernel/head.S
+++ b/arch/arm/kernel/head.S
@@ -17,7 +17,7 @@
 #include <asm/mach-types.h>
 #include <asm/procinfo.h>
 #include <asm/ptrace.h>
-#include <asm/mach/arch.h>
+#include <asm/constants.h>
 
 /*
  * We place the page tables 16K below TEXTADDR.  Therefore, we must make sure
diff --git a/arch/arm/kernel/init_task.c b/arch/arm/kernel/init_task.c
index d7c3f2667..a00cca000 100644
--- a/arch/arm/kernel/init_task.c
+++ b/arch/arm/kernel/init_task.c
@@ -7,6 +7,7 @@
 #include <linux/sched.h>
 #include <linux/init.h>
 #include <linux/init_task.h>
+#include <linux/mqueue.h>
 
 #include <asm/uaccess.h>
 #include <asm/pgtable.h>
diff --git a/arch/arm/kernel/io.c b/arch/arm/kernel/io.c
index 34d6a867e..9e8868bc5 100644
--- a/arch/arm/kernel/io.c
+++ b/arch/arm/kernel/io.c
@@ -7,12 +7,13 @@
  * Copy data from IO memory space to "real" memory space.
  * This needs to be optimized.
  */
-void _memcpy_fromio(void * to, unsigned long from, size_t count)
+void _memcpy_fromio(void *to, unsigned long from, size_t count)
 {
+	unsigned char *t = to;
 	while (count) {
 		count--;
-		*(char *) to = readb(from);
-		((char *) to)++;
+		*t = readb(from);
+		t++;
 		from++;
 	}
 }
@@ -21,12 +22,13 @@ void _memcpy_fromio(void * to, unsigned long from, size_t count)
  * Copy data from "real" memory space to IO memory space.
  * This needs to be optimized.
  */
-void _memcpy_toio(unsigned long to, const void * from, size_t count)
+void _memcpy_toio(unsigned long to, const void *from, size_t count)
 {
+	const unsigned char *f = from;
 	while (count) {
 		count--;
-		writeb(*(char *) from, to);
-		((char *) from)++;
+		writeb(*f, to);
+		f++;
 		to++;
 	}
 }
diff --git a/arch/arm/kernel/irq.c b/arch/arm/kernel/irq.c
index 5777a8c2f..68636bd7c 100644
--- a/arch/arm/kernel/irq.c
+++ b/arch/arm/kernel/irq.c
@@ -674,7 +674,7 @@ int request_irq(unsigned int irq, irqreturn_t (*handler)(int, void *, struct pt_
 
 	action->handler = handler;
 	action->flags = irq_flags;
-	action->mask = 0;
+	cpus_clear(action->mask);
 	action->name = devname;
 	action->next = NULL;
 	action->dev_id = dev_id;
diff --git a/arch/arm/kernel/process.c b/arch/arm/kernel/process.c
index 8d9db749e..56498dbf7 100644
--- a/arch/arm/kernel/process.c
+++ b/arch/arm/kernel/process.c
@@ -314,10 +314,16 @@ void flush_thread(void)
 	memset(thread->used_cp, 0, sizeof(thread->used_cp));
 	memset(&tsk->thread.debug, 0, sizeof(struct debug_info));
 	fp_init(&thread->fpstate);
+#if defined(CONFIG_VFP)
+	vfp_flush_thread(&thread->vfpstate);
+#endif
 }
 
 void release_thread(struct task_struct *dead_task)
 {
+#if defined(CONFIG_VFP)
+	vfp_release_thread(&dead_task->thread_info->vfpstate);
+#endif
 }
 
 asmlinkage void ret_from_fork(void) __asm__("ret_from_fork");
diff --git a/arch/arm/kernel/ptrace.c b/arch/arm/kernel/ptrace.c
index 4bcf7f6a4..d99255a8b 100644
--- a/arch/arm/kernel/ptrace.c
+++ b/arch/arm/kernel/ptrace.c
@@ -485,7 +485,7 @@ void ptrace_break(struct task_struct *tsk, struct pt_regs *regs)
 	info.si_signo = SIGTRAP;
 	info.si_errno = 0;
 	info.si_code  = TRAP_BRKPT;
-	info.si_addr  = (void *)instruction_pointer(regs);
+	info.si_addr  = (void __user *)instruction_pointer(regs);
 
 	force_sig_info(SIGTRAP, &info, tsk);
 }
diff --git a/arch/arm/kernel/setup.c b/arch/arm/kernel/setup.c
index 1cff09a55..835010c55 100644
--- a/arch/arm/kernel/setup.c
+++ b/arch/arm/kernel/setup.c
@@ -22,6 +22,7 @@
 #include <linux/init.h>
 #include <linux/root_dev.h>
 #include <linux/cpu.h>
+#include <linux/interrupt.h>
 
 #include <asm/elf.h>
 #include <asm/hardware.h>
@@ -34,6 +35,7 @@
 
 #include <asm/mach/arch.h>
 #include <asm/mach/irq.h>
+#include <asm/mach/time.h>
 
 #ifndef MEM_SIZE
 #define MEM_SIZE	(16*1024*1024)
@@ -95,7 +97,6 @@ unsigned char aux_device_present;
 char elf_platform[ELF_PLATFORM_SIZE];
 EXPORT_SYMBOL(elf_platform);
 
-char saved_command_line[COMMAND_LINE_SIZE];
 unsigned long phys_initrd_start __initdata = 0;
 unsigned long phys_initrd_size __initdata = 0;
 
@@ -727,6 +728,7 @@ void __init setup_arch(char **cmdline_p)
 	 * Set up various architecture-specific pointers
 	 */
 	init_arch_irq = mdesc->init_irq;
+	init_arch_time = mdesc->init_time;
 	init_machine = mdesc->init_machine;
 
 #ifdef CONFIG_VT
diff --git a/arch/arm/kernel/signal.c b/arch/arm/kernel/signal.c
index 4aef80895..d214e8d49 100644
--- a/arch/arm/kernel/signal.c
+++ b/arch/arm/kernel/signal.c
@@ -419,7 +419,7 @@ setup_rt_frame(int usig, struct k_sigaction *ka, siginfo_t *info,
 	__put_user_error(NULL, &frame->uc.uc_link, err);
 
 	memset(&stack, 0, sizeof(stack));
-	stack.ss_sp = (void *)current->sas_ss_sp;
+	stack.ss_sp = (void __user *)current->sas_ss_sp;
 	stack.ss_flags = sas_ss_flags(regs->ARM_sp);
 	stack.ss_size = current->sas_ss_size;
 	err |= __copy_to_user(&frame->uc.uc_stack, &stack, sizeof(stack));
diff --git a/arch/arm/kernel/sys_arm.c b/arch/arm/kernel/sys_arm.c
index 79acdd17f..fb26b3bf9 100644
--- a/arch/arm/kernel/sys_arm.c
+++ b/arch/arm/kernel/sys_arm.c
@@ -178,7 +178,7 @@ asmlinkage int sys_ipc(uint call, int first, int second, int third,
 		union semun fourth;
 		if (!ptr)
 			return -EINVAL;
-		if (get_user(fourth.__pad, (void __user **) ptr))
+		if (get_user(fourth.__pad, (void __user * __user *) ptr))
 			return -EFAULT;
 		return sys_semctl (first, second, third, fourth);
 	}
diff --git a/arch/arm/kernel/time.c b/arch/arm/kernel/time.c
index bfed0f453..efcb44a9e 100644
--- a/arch/arm/kernel/time.c
+++ b/arch/arm/kernel/time.c
@@ -27,12 +27,15 @@
 #include <linux/errno.h>
 #include <linux/profile.h>
 #include <linux/sysdev.h>
+#include <linux/timer.h>
 
 #include <asm/hardware.h>
 #include <asm/io.h>
 #include <asm/irq.h>
 #include <asm/leds.h>
 
+#include <asm/mach/time.h>
+
 u64 jiffies_64 = INITIAL_JIFFIES;
 
 EXPORT_SYMBOL(jiffies_64);
@@ -49,15 +52,11 @@ EXPORT_SYMBOL(rtc_lock);
 /* change this if you have some constant time drift */
 #define USECS_PER_JIFFY	(1000000/HZ)
 
-static int dummy_set_rtc(void)
-{
-	return 0;
-}
 
 /*
  * hook for setting the RTC's idea of the current time.
  */
-int (*set_rtc)(void) = dummy_set_rtc;
+int (*set_rtc)(void);
 
 static unsigned long dummy_gettimeoffset(void)
 {
@@ -238,7 +237,7 @@ EXPORT_SYMBOL(leds_event);
 #endif
 
 #ifdef CONFIG_LEDS_TIMER
-static void do_leds(void)
+static inline void do_leds(void)
 {
 	static unsigned int count = 50;
 
@@ -248,7 +247,7 @@ static void do_leds(void)
 	}
 }
 #else
-#define do_leds()
+#define	do_leds()
 #endif
 
 void do_gettimeofday(struct timeval *tv)
@@ -316,12 +315,18 @@ int do_settimeofday(struct timespec *tv)
 
 EXPORT_SYMBOL(do_settimeofday);
 
-static struct irqaction timer_irq = {
-	.name	= "timer",
-	.flags	= SA_INTERRUPT,
-};
+void timer_tick(struct pt_regs *regs)
+{
+	do_profile(regs);
+	do_leds();
+	do_set_rtc();
+	do_timer(regs);
+}
+
+void (*init_arch_time)(void);
+
+void __init time_init(void)
+{
+	init_arch_time();
+}
 
-/*
- * Include architecture specific code
- */
-#include <asm/arch/time.h>
diff --git a/arch/arm/kernel/traps.c b/arch/arm/kernel/traps.c
index 3f2816793..e5c7f285b 100644
--- a/arch/arm/kernel/traps.c
+++ b/arch/arm/kernel/traps.c
@@ -263,7 +263,7 @@ asmlinkage void do_undefinstr(struct pt_regs *regs)
 	unsigned int instr;
 	struct undef_hook *hook;
 	siginfo_t info;
-	void *pc;
+	void __user *pc;
 
 	/*
 	 * According to the ARM ARM, PC is 2 or 4 bytes ahead,
@@ -272,11 +272,11 @@ asmlinkage void do_undefinstr(struct pt_regs *regs)
 	 */
 	regs->ARM_pc -= correction;
 
-	pc = (void *)instruction_pointer(regs);
+	pc = (void __user *)instruction_pointer(regs);
 	if (thumb_mode(regs)) {
-		get_user(instr, (u16 *)pc);
+		get_user(instr, (u16 __user *)pc);
 	} else {
-		get_user(instr, (u32 *)pc);
+		get_user(instr, (u32 __user *)pc);
 	}
 
 	spin_lock_irq(&undef_lock);
@@ -368,7 +368,7 @@ static int bad_syscall(int n, struct pt_regs *regs)
 	info.si_signo = SIGILL;
 	info.si_errno = 0;
 	info.si_code  = ILL_ILLTRP;
-	info.si_addr  = (void *)instruction_pointer(regs) -
+	info.si_addr  = (void __user *)instruction_pointer(regs) -
 			 (thumb_mode(regs) ? 2 : 4);
 
 	force_sig_info(SIGILL, &info, current);
@@ -426,7 +426,7 @@ asmlinkage int arm_syscall(int no, struct pt_regs *regs)
 
 	/*
 	 * Flush a region from virtual address 'r0' to virtual address 'r1'
-	 * _inclusive_.  There is no alignment requirement on either address;
+	 * _exclusive_.  There is no alignment requirement on either address;
 	 * user space does not need to know the hardware cache layout.
 	 *
 	 * r2 contains flags.  It should ALWAYS be passed as ZERO until it
@@ -481,7 +481,7 @@ asmlinkage int arm_syscall(int no, struct pt_regs *regs)
 	info.si_signo = SIGILL;
 	info.si_errno = 0;
 	info.si_code  = ILL_ILLTRP;
-	info.si_addr  = (void *)instruction_pointer(regs) -
+	info.si_addr  = (void __user *)instruction_pointer(regs) -
 			 (thumb_mode(regs) ? 2 : 4);
 
 	force_sig_info(SIGILL, &info, current);
@@ -519,7 +519,7 @@ baddataabort(int code, unsigned long instr, struct pt_regs *regs)
 	info.si_signo = SIGILL;
 	info.si_errno = 0;
 	info.si_code  = ILL_ILLOPC;
-	info.si_addr  = (void *)addr;
+	info.si_addr  = (void __user *)addr;
 
 	force_sig_info(SIGILL, &info, current);
 	die_if_kernel("unknown data abort code", regs, instr);
diff --git a/arch/arm/lib/ecard.S b/arch/arm/lib/ecard.S
index f71a44a90..fb7b602a6 100644
--- a/arch/arm/lib/ecard.S
+++ b/arch/arm/lib/ecard.S
@@ -16,7 +16,7 @@
 
 #define CPSR2SPSR(rt) \
 		mrs	rt, cpsr; \
-		msr	spsr, rt
+		msr	spsr_cxsf, rt
 
 @ Purpose: call an expansion card loader to read bytes.
 @ Proto  : char read_loader(int offset, char *card_base, char *loader);
diff --git a/arch/arm/mach-clps711x/autcpu12.c b/arch/arm/mach-clps711x/autcpu12.c
index e05549a1b..e8a4d998b 100644
--- a/arch/arm/mach-clps711x/autcpu12.c
+++ b/arch/arm/mach-clps711x/autcpu12.c
@@ -37,6 +37,7 @@
 
 extern void clps711x_map_io(void);
 extern void clps711x_init_irq(void);
+extern void clps711x_init_time(void);
 
 /*
  * The on-chip registers are given a size of 1MB so that a section can
@@ -65,5 +66,6 @@ MACHINE_START(AUTCPU12, "autronix autcpu12")
 	BOOT_PARAMS(0xc0020000)
 	MAPIO(autcpu12_map_io)
 	INITIRQ(clps711x_init_irq)
+	INITTIME(clps711x_init_time)
 MACHINE_END
 
diff --git a/arch/arm/mach-clps711x/cdb89712.c b/arch/arm/mach-clps711x/cdb89712.c
index d51668d26..870d4e4e8 100644
--- a/arch/arm/mach-clps711x/cdb89712.c
+++ b/arch/arm/mach-clps711x/cdb89712.c
@@ -34,6 +34,7 @@
 
 extern void clps711x_init_irq(void);
 extern void clps711x_map_io(void);
+extern void clps711x_init_time(void);
 
 /*
  * Map the CS89712 Ethernet port.  That should be moved to the
@@ -55,6 +56,7 @@ MACHINE_START(CDB89712, "Cirrus-CDB89712")
 	BOOT_PARAMS(0xc0000100)
 	MAPIO(cdb89712_map_io)
 	INITIRQ(clps711x_init_irq)
+	INITTIME(clps711x_init_time)
 MACHINE_END
 
 static int cdb89712_hw_init(void)
diff --git a/arch/arm/mach-clps711x/ceiva.c b/arch/arm/mach-clps711x/ceiva.c
index e9ef76e18..44d4e5b8d 100644
--- a/arch/arm/mach-clps711x/ceiva.c
+++ b/arch/arm/mach-clps711x/ceiva.c
@@ -35,6 +35,7 @@
 #include <asm/mach/map.h>
 
 extern void clps711x_init_irq(void);
+extern void clps711x_init_time(void);
 
 static struct map_desc ceiva_io_desc[] __initdata = {
  /* virtual, physical, length, type */
@@ -58,4 +59,5 @@ MACHINE_START(CEIVA, "CEIVA/Polaroid Photo MAX Digital Picture Frame")
 	BOOT_PARAMS(0xc0000100)
 	MAPIO(ceiva_map_io)
 	INITIRQ(clps711x_init_irq)
+	INITTIME(clps711x_init_time)
 MACHINE_END
diff --git a/arch/arm/mach-clps711x/clep7312.c b/arch/arm/mach-clps711x/clep7312.c
index f74f43583..14fb9788c 100644
--- a/arch/arm/mach-clps711x/clep7312.c
+++ b/arch/arm/mach-clps711x/clep7312.c
@@ -25,6 +25,7 @@
 
 extern void clps711x_init_irq(void);
 extern void clps711x_map_io(void); 
+extern void clps711x_init_time(void);
 
 static void __init
 fixup_clep7312(struct machine_desc *desc, struct tag *tags,
@@ -44,5 +45,6 @@ MACHINE_START(CLEP7212, "Cirrus Logic 7212/7312")
 	FIXUP(fixup_clep7312)
 	MAPIO(clps711x_map_io)
 	INITIRQ(clps711x_init_irq)
+	INITTIME(clps711x_init_time)
 MACHINE_END
 
diff --git a/arch/arm/mach-clps711x/edb7211-arch.c b/arch/arm/mach-clps711x/edb7211-arch.c
index 1402447a8..11aa05c24 100644
--- a/arch/arm/mach-clps711x/edb7211-arch.c
+++ b/arch/arm/mach-clps711x/edb7211-arch.c
@@ -27,6 +27,7 @@
 
 extern void clps711x_init_irq(void);
 extern void edb7211_map_io(void);
+extern void clps711x_init_time(void);
 
 static void __init
 fixup_edb7211(struct machine_desc *desc, struct tag *tags,
@@ -56,4 +57,5 @@ MACHINE_START(EDB7211, "CL-EDB7211 (EP7211 eval board)")
 	FIXUP(fixup_edb7211)
 	MAPIO(edb7211_map_io)
 	INITIRQ(clps711x_init_irq)
+	INITTIME(clps711x_init_time)
 MACHINE_END
diff --git a/arch/arm/mach-clps711x/fortunet.c b/arch/arm/mach-clps711x/fortunet.c
index 268e42baa..7a4ba27df 100644
--- a/arch/arm/mach-clps711x/fortunet.c
+++ b/arch/arm/mach-clps711x/fortunet.c
@@ -33,6 +33,7 @@
 
 extern void clps711x_map_io(void);
 extern void clps711x_init_irq(void);
+extern void clps711x_init_time(void);
 
 struct meminfo memmap = {
 	.nr_banks	= 1,
@@ -82,4 +83,5 @@ MACHINE_START(FORTUNET, "ARM-FortuNet")
 	FIXUP(fortunet_fixup)
 	MAPIO(clps711x_map_io)
 	INITIRQ(clps711x_init_irq)
+	INITTIME(clps711x_init_time)
 MACHINE_END
diff --git a/arch/arm/mach-clps711x/p720t.c b/arch/arm/mach-clps711x/p720t.c
index b99cccfb7..eb75ae667 100644
--- a/arch/arm/mach-clps711x/p720t.c
+++ b/arch/arm/mach-clps711x/p720t.c
@@ -36,6 +36,7 @@
 
 extern void clps711x_init_irq(void);
 extern void clps711x_map_io(void);
+extern void clps711x_init_time(void);
 
 /*
  * Map the P720T system PLD.  It occupies two address spaces:
@@ -86,6 +87,7 @@ MACHINE_START(P720T, "ARM-Prospector720T")
 	FIXUP(fixup_p720t)
 	MAPIO(p720t_map_io)
 	INITIRQ(clps711x_init_irq)
+	INITTIME(clps711x_init_time)
 MACHINE_END
 
 static int p720t_hw_init(void)
diff --git a/arch/arm/mach-clps711x/time.c b/arch/arm/mach-clps711x/time.c
index 8a02e18a8..58da84eff 100644
--- a/arch/arm/mach-clps711x/time.c
+++ b/arch/arm/mach-clps711x/time.c
@@ -18,12 +18,17 @@
  */
 #include <linux/timex.h>
 #include <linux/init.h>
+#include <linux/interrupt.h>
+#include <linux/sched.h>
 
 #include <asm/hardware.h>
+#include <asm/irq.h>
+#include <asm/leds.h>
 #include <asm/io.h>
 #include <asm/hardware/clps7111.h>
 
-extern unsigned long (*gettimeoffset)(void);
+#include <asm/mach/time.h>
+
 
 /*
  * gettimeoffset() returns time since last timer tick, in usecs.
@@ -38,19 +43,36 @@ static unsigned long clps711x_gettimeoffset(void)
 	return (hwticks * (tick_nsec / 1000)) / LATCH;
 }
 
-void __init clps711x_setup_timer(void)
+/*
+ * IRQ handler for the timer
+ */
+static irqreturn_t
+p720t_timer_interrupt(int irq, void *dev_id, struct pt_regs *regs)
+{
+	timer_tick(regs);
+	return IRQ_HANDLED;
+}
+
+static struct irqaction clps711x_timer_irq = {
+	.name		= "CLPS711x Timer Tick",
+	.flags		= SA_INTERRUPT,
+	.handler	= p720t_timer_interrupt
+};
+
+void __init clps711x_init_time(void)
 {
 	struct timespec tv;
 	unsigned int syscon;
 
-	gettimeoffset = clps711x_gettimeoffset;
-
 	syscon = clps_readl(SYSCON1);
 	syscon |= SYSCON1_TC2S | SYSCON1_TC2M;
 	clps_writel(syscon, SYSCON1);
 
 	clps_writel(LATCH-1, TC2D); /* 512kHz / 100Hz - 1 */
 
+	setup_irq(IRQ_TC2OI, &clps711x_timer_irq);
+	gettimeoffset = clps711x_gettimeoffset;
+
 	tv.tv_nsec = 0;
 	tv.tv_sec = clps_readl(RTCDR);
 	do_settimeofday(&tv);
diff --git a/arch/arm/mach-clps7500/core.c b/arch/arm/mach-clps7500/core.c
index 628264bf5..11fa530af 100644
--- a/arch/arm/mach-clps7500/core.c
+++ b/arch/arm/mach-clps7500/core.c
@@ -10,12 +10,13 @@
 #include <linux/types.h>
 #include <linux/interrupt.h>
 #include <linux/list.h>
-#include <linux/timer.h>
+#include <linux/sched.h>
 #include <linux/init.h>
 
 #include <asm/mach/arch.h>
 #include <asm/mach/map.h>
 #include <asm/mach/irq.h>
+#include <asm/mach/time.h>
 
 #include <asm/hardware.h>
 #include <asm/hardware/iomd.h>
@@ -187,7 +188,7 @@ static struct irqchip clps7500_no_chip = {
 	.unmask	= cl7500_no_action,
 };
 
-static struct irqaction irq_isa = { no_action, 0, 0, "isa", NULL, NULL };
+static struct irqaction irq_isa = { no_action, 0, CPU_MASK_NONE, "isa", NULL, NULL };
 
 static void __init clps7500_init_irq(void)
 {
@@ -265,10 +266,47 @@ static void __init clps7500_map_io(void)
 	iotable_init(cl7500_io_desc, ARRAY_SIZE(cl7500_io_desc));
 }
 
+extern void ioctime_init(void);
+
+static irqreturn_t
+clps7500_timer_interrupt(int irq, void *dev_id, struct pt_regs *regs)
+{
+	timer_tick(regs);
+
+	/* Why not using do_leds interface?? */
+	{
+		/* Twinkle the lights. */
+		static int count, state = 0xff00;
+		if (count-- == 0) {
+			state ^= 0x100;
+			count = 25;
+			*((volatile unsigned int *)LED_ADDRESS) = state;
+		}
+	}
+	return IRQ_HANDLED;
+}
+
+static struct irqaction clps7500_timer_irq = {
+	.name		= "CLPS7500 Timer Tick",
+	.flags		= SA_INTERRUPT,
+	.handler	= clps7500_timer_interrupt
+};
+
+/*
+ * Set up timer interrupt.
+ */
+void __init clps7500_init_time(void)
+{
+	ioctime_init();
+
+	setup_irq(IRQ_TIMER, &clps7500_timer_irq);
+}
+
 MACHINE_START(CLPS7500, "CL-PS7500")
 	MAINTAINER("Philip Blundell")
 	BOOT_MEM(0x10000000, 0x03000000, 0xe0000000)
 	MAPIO(clps7500_map_io)
 	INITIRQ(clps7500_init_irq)
+	INITTIME(clps7500_init_time)
 MACHINE_END
 
diff --git a/arch/arm/mach-ebsa110/core.c b/arch/arm/mach-ebsa110/core.c
index 5c14e04ea..07c556392 100644
--- a/arch/arm/mach-ebsa110/core.c
+++ b/arch/arm/mach-ebsa110/core.c
@@ -11,6 +11,7 @@
  */
 #include <linux/kernel.h>
 #include <linux/mm.h>
+#include <linux/interrupt.h>
 #include <linux/init.h>
 
 #include <asm/hardware.h>
@@ -26,6 +27,8 @@
 #include <asm/mach/irq.h>
 #include <asm/mach/map.h>
 
+#include <asm/mach/time.h>
+
 #define IRQ_MASK		0xfe000000	/* read */
 #define IRQ_MSET		0xfe000000	/* write */
 #define IRQ_STAT		0xff000000	/* read */
@@ -89,6 +92,103 @@ static void __init ebsa110_map_io(void)
 	iotable_init(ebsa110_io_desc, ARRAY_SIZE(ebsa110_io_desc));
 }
 
+
+#define PIT_CTRL		(PIT_BASE + 0x0d)
+#define PIT_T2			(PIT_BASE + 0x09)
+#define PIT_T1			(PIT_BASE + 0x05)
+#define PIT_T0			(PIT_BASE + 0x01)
+
+/*
+ * This is the rate at which your MCLK signal toggles (in Hz)
+ * This was measured on a 10 digit frequency counter sampling
+ * over 1 second.
+ */
+#define MCLK	47894000
+
+/*
+ * This is the rate at which the PIT timers get clocked
+ */
+#define CLKBY7	(MCLK / 7)
+
+/*
+ * This is the counter value.  We tick at 200Hz on this platform.
+ */
+#define COUNT	((CLKBY7 + (HZ / 2)) / HZ)
+
+/*
+ * Get the time offset from the system PIT.  Note that if we have missed an
+ * interrupt, then the PIT counter will roll over (ie, be negative).
+ * This actually works out to be convenient.
+ */
+static unsigned long ebsa110_gettimeoffset(void)
+{
+	unsigned long offset, count;
+
+	__raw_writeb(0x40, PIT_CTRL);
+	count = __raw_readb(PIT_T1);
+	count |= __raw_readb(PIT_T1) << 8;
+
+	/*
+	 * If count > COUNT, make the number negative.
+	 */
+	if (count > COUNT)
+		count |= 0xffff0000;
+
+	offset = COUNT;
+	offset -= count;
+
+	/*
+	 * `offset' is in units of timer counts.  Convert
+	 * offset to units of microseconds.
+	 */
+	offset = offset * (1000000 / HZ) / COUNT;
+
+	return offset;
+}
+
+static irqreturn_t
+ebsa110_timer_interrupt(int irq, void *dev_id, struct pt_regs *regs)
+{
+	u32 count;
+
+	/* latch and read timer 1 */
+	__raw_writeb(0x40, PIT_CTRL);
+	count = __raw_readb(PIT_T1);
+	count |= __raw_readb(PIT_T1) << 8;
+
+	count += COUNT;
+
+	__raw_writeb(count & 0xff, PIT_T1);
+	__raw_writeb(count >> 8, PIT_T1);
+
+	timer_tick(regs);
+
+	return IRQ_HANDLED;
+}
+
+static struct irqaction ebsa110_timer_irq = {
+	.name		= "EBSA110 Timer Tick",
+	.flags		= SA_INTERRUPT,
+	.handler	= ebsa110_timer_interrupt
+};
+
+/*
+ * Set up timer interrupt.
+ */
+static void __init ebsa110_init_time(void)
+{
+	/*
+	 * Timer 1, mode 2, LSB/MSB
+	 */
+	__raw_writeb(0x70, PIT_CTRL);
+	__raw_writeb(COUNT & 0xff, PIT_T1);
+	__raw_writeb(COUNT >> 8, PIT_T1);
+
+	gettimeoffset = ebsa110_gettimeoffset;
+
+	setup_irq(IRQ_EBSA110_TIMER0, &ebsa110_timer_irq);
+}
+
 MACHINE_START(EBSA110, "EBSA110")
 	MAINTAINER("Russell King")
 	BOOT_MEM(0x00000000, 0xe0000000, 0xe0000000)
@@ -98,4 +198,5 @@ MACHINE_START(EBSA110, "EBSA110")
 	SOFT_REBOOT
 	MAPIO(ebsa110_map_io)
 	INITIRQ(ebsa110_init_irq)
+	INITTIME(ebsa110_init_time)
 MACHINE_END
diff --git a/arch/arm/mach-ebsa110/io.c b/arch/arm/mach-ebsa110/io.c
index 6556818e4..9205e65fe 100644
--- a/arch/arm/mach-ebsa110/io.c
+++ b/arch/arm/mach-ebsa110/io.c
@@ -139,7 +139,11 @@ EXPORT_SYMBOL(__writel);
 	 ((p) >> 3) == (0x2f8 >> 3) || \
 	 ((p) >> 3) == (0x378 >> 3))
 
-u8 __inb(int port)
+/*
+ * We're addressing an 8 or 16-bit peripheral which tranfers
+ * odd addresses on the low ISA byte lane.
+ */
+u8 __inb8(unsigned int port)
 {
 	u32 ret;
 
@@ -162,7 +166,31 @@ u8 __inb(int port)
 	return ret;
 }
 
-u16 __inw(int port)
+/*
+ * We're addressing a 16-bit peripheral which transfers odd
+ * addresses on the high ISA byte lane.
+ */
+u8 __inb16(unsigned int port)
+{
+	u32 ret;
+
+	/*
+	 * The SuperIO registers use sane addressing techniques...
+	 */
+	if (SUPERIO_PORT(port))
+		ret = __raw_readb(ISAIO_BASE + (port << 2));
+	else {
+		u32 a = ISAIO_BASE + ((port & ~1) << 1);
+
+		/*
+		 * Shame nothing else does
+		 */
+		ret = __raw_readb(a + (port & 1));
+	}
+	return ret;
+}
+
+u16 __inw(unsigned int port)
 {
 	u32 ret;
 
@@ -185,17 +213,27 @@ u16 __inw(int port)
 	return ret;
 }
 
-u32 __inl(int port)
+/*
+ * Fake a 32-bit read with two 16-bit reads.  Needed for 3c589.
+ */
+u32 __inl(unsigned int port)
 {
-	BUG();
-	return 0;
+	u32 a;
+
+	if (SUPERIO_PORT(port) || port & 3)
+		BUG();
+
+	a = ISAIO_BASE + (port << 1);
+
+	return __raw_readw(a) | __raw_readw(a + 4) << 16;
 }
 
-EXPORT_SYMBOL(__inb);
+EXPORT_SYMBOL(__inb8);
+EXPORT_SYMBOL(__inb16);
 EXPORT_SYMBOL(__inw);
 EXPORT_SYMBOL(__inl);
 
-void __outb(u8 val, int port)
+void __outb8(u8 val, unsigned int port)
 {
 	/*
 	 * The SuperIO registers use sane addressing techniques...
@@ -215,7 +253,24 @@ void __outb(u8 val, int port)
 	}
 }
 
-void __outw(u16 val, int port)
+void __outb16(u8 val, unsigned int port)
+{
+	/*
+	 * The SuperIO registers use sane addressing techniques...
+	 */
+	if (SUPERIO_PORT(port))
+		__raw_writeb(val, ISAIO_BASE + (port << 2));
+	else {
+		u32 a = ISAIO_BASE + ((port & ~1) << 1);
+
+		/*
+		 * Shame nothing else does
+		 */
+		__raw_writeb(val, a + (port & 1));
+	}
+}
+
+void __outw(u16 val, unsigned int port)
 {
 	u32 off;
 
@@ -225,7 +280,7 @@ void __outw(u16 val, int port)
 	if (SUPERIO_PORT(port))
 		off = port << 2;
 	else {
-		off = (port & ~1) << 1;
+		off = port << 1;
 		if (port & 1)
 			BUG();
 
@@ -233,12 +288,13 @@ void __outw(u16 val, int port)
 	__raw_writew(val, ISAIO_BASE + off);
 }
 
-void __outl(u32 val, int port)
+void __outl(u32 val, unsigned int port)
 {
 	BUG();
 }
 
-EXPORT_SYMBOL(__outb);
+EXPORT_SYMBOL(__outb8);
+EXPORT_SYMBOL(__outb16);
 EXPORT_SYMBOL(__outw);
 EXPORT_SYMBOL(__outl);
 
@@ -315,12 +371,29 @@ void insw(unsigned int port, void *from, int len)
 EXPORT_SYMBOL(outsw);
 EXPORT_SYMBOL(insw);
 
+/*
+ * We implement these as 16-bit insw/outsw, mainly for
+ * 3c589 cards.
+ */
 void outsl(unsigned int port, const void *from, int len)
 {
-	panic("outsl not supported on this architecture");
+	u32 off = port << 1;
+
+	if (SUPERIO_PORT(port) || port & 3)
+		BUG();
+
+	__raw_writesw(ISAIO_BASE + off, from, len << 1);
 }
 
 void insl(unsigned int port, void *from, int len)
 {
-	panic("insl not supported on this architecture");
+	u32 off = port << 1;
+
+	if (SUPERIO_PORT(port) || port & 3)
+		BUG();
+
+	__raw_readsw(ISAIO_BASE + off, from, len << 1);
 }
+
+EXPORT_SYMBOL(outsl);
+EXPORT_SYMBOL(insl);
diff --git a/arch/arm/mach-epxa10db/arch.c b/arch/arm/mach-epxa10db/arch.c
index 71c2257df..ae9f7c864 100644
--- a/arch/arm/mach-epxa10db/arch.c
+++ b/arch/arm/mach-epxa10db/arch.c
@@ -29,10 +29,13 @@
 
 extern void epxa10db_map_io(void);
 extern void epxa10db_init_irq(void);
+extern void epxa10db_init_time(void);
 
 MACHINE_START(CAMELOT, "Altera Epxa10db")
 	MAINTAINER("Altera Corporation")
 	BOOT_MEM(0x00000000, 0x7fffc000, 0xffffc000)
 	MAPIO(epxa10db_map_io)
 	INITIRQ(epxa10db_init_irq)
+	INITTIME(epxa10db_init_time)
 MACHINE_END
+
diff --git a/arch/arm/mach-epxa10db/time.c b/arch/arm/mach-epxa10db/time.c
index 0c8b9cf7c..7d72a433d 100644
--- a/arch/arm/mach-epxa10db/time.c
+++ b/arch/arm/mach-epxa10db/time.c
@@ -10,11 +10,17 @@
  */
 #include <linux/kernel.h>
 #include <linux/init.h>
+#include <linux/interrupt.h>
+#include <linux/sched.h>
 
 #include <asm/hardware.h>
+#include <asm/system.h>
+#include <asm/leds.h>
 
+#include <asm/mach/time.h>
 
-extern int (*set_rtc)(void);
+#define TIMER00_TYPE (volatile unsigned int*)
+#include <asm/arch/timer00.h>
 
 static int epxa10db_set_rtc(void)
 {
@@ -29,3 +35,39 @@ static int epxa10db_rtc_init(void)
 }
 
 __initcall(epxa10db_rtc_init);
+
+
+/*
+ * IRQ handler for the timer
+ */
+static irqreturn_t
+epxa10db_timer_interrupt(int irq, void *dev_id, struct pt_regs *regs)
+{
+
+	// ...clear the interrupt
+	*TIMER0_CR(IO_ADDRESS(EXC_TIMER00_BASE))|=TIMER0_CR_CI_MSK;
+
+	timer_tick(regs);
+
+	return IRQ_HANDLED;
+}
+
+static struct irqaction epxa10db_timer_irq = {
+	.name		= "Excalibur Timer Tick",
+	.flags		= SA_INTERRUPT,
+	.handler	= epxa10db_timer_interrupt
+};
+
+/*
+ * Set up timer interrupt, and return the current time in seconds.
+ */
+void __init epxa10db_init_time(void)
+{
+	/* Start the timer */
+	*TIMER0_LIMIT(IO_ADDRESS(EXC_TIMER00_BASE))=(unsigned int)(EXC_AHB2_CLK_FREQUENCY/200);
+	*TIMER0_PRESCALE(IO_ADDRESS(EXC_TIMER00_BASE))=1;
+	*TIMER0_CR(IO_ADDRESS(EXC_TIMER00_BASE))=TIMER0_CR_IE_MSK | TIMER0_CR_S_MSK;
+
+	setup_irq(IRQ_TIMER0, &epxa10db_timer_irq);
+}
+
diff --git a/arch/arm/mach-footbridge/Makefile b/arch/arm/mach-footbridge/Makefile
index d011b2df2..e0a289052 100644
--- a/arch/arm/mach-footbridge/Makefile
+++ b/arch/arm/mach-footbridge/Makefile
@@ -4,7 +4,7 @@
 
 # Object file lists.
 
-obj-y			:= arch.o dc21285.o dma.o irq.o isa-irq.o mm.o
+obj-y			:= arch.o dc21285.o dma.o irq.o isa-irq.o mm.o time.o
 obj-m			:=
 obj-n			:=
 obj-			:=
diff --git a/arch/arm/mach-footbridge/arch.c b/arch/arm/mach-footbridge/arch.c
index 91e34a844..761198836 100644
--- a/arch/arm/mach-footbridge/arch.c
+++ b/arch/arm/mach-footbridge/arch.c
@@ -22,6 +22,7 @@
 
 extern void footbridge_map_io(void);
 extern void footbridge_init_irq(void);
+extern void footbridge_init_time(void);
 
 unsigned int mem_fclk_21285 = 50000000;
 
@@ -43,6 +44,7 @@ MACHINE_START(EBSA285, "EBSA285")
 	VIDEO(0x000a0000, 0x000bffff)
 	MAPIO(footbridge_map_io)
 	INITIRQ(footbridge_init_irq)
+	INITTIME(footbridge_init_time)
 MACHINE_END
 #endif
 
@@ -78,6 +80,7 @@ MACHINE_START(NETWINDER, "Rebel-NetWinder")
 	FIXUP(fixup_netwinder)
 	MAPIO(footbridge_map_io)
 	INITIRQ(footbridge_init_irq)
+	INITTIME(footbridge_init_time)
 MACHINE_END
 #endif
 
@@ -103,6 +106,7 @@ MACHINE_START(CATS, "Chalice-CATS")
 	FIXUP(fixup_cats)
 	MAPIO(footbridge_map_io)
 	INITIRQ(footbridge_init_irq)
+	INITTIME(footbridge_init_time)
 MACHINE_END
 #endif
 
@@ -129,6 +133,7 @@ MACHINE_START(CO285, "co-EBSA285")
 	FIXUP(fixup_coebsa285)
 	MAPIO(footbridge_map_io)
 	INITIRQ(footbridge_init_irq)
+	INITTIME(footbridge_init_time)
 MACHINE_END
 #endif
 
@@ -139,5 +144,6 @@ MACHINE_START(PERSONAL_SERVER, "Compaq-PersonalServer")
 	BOOT_PARAMS(0x00000100)
 	MAPIO(footbridge_map_io)
 	INITIRQ(footbridge_init_irq)
+	INITTIME(footbridge_init_time)
 MACHINE_END
 #endif
diff --git a/arch/arm/mach-integrator/Makefile b/arch/arm/mach-integrator/Makefile
index 34726a4da..158daaf9e 100644
--- a/arch/arm/mach-integrator/Makefile
+++ b/arch/arm/mach-integrator/Makefile
@@ -4,7 +4,7 @@
 
 # Object file lists.
 
-obj-y					:= core.o lm.o time.o
+obj-y					:= clock.o core.o lm.o time.o
 obj-$(CONFIG_ARCH_INTEGRATOR_AP)	+= integrator_ap.o
 obj-$(CONFIG_ARCH_INTEGRATOR_CP)	+= integrator_cp.o
 
diff --git a/arch/arm/mach-integrator/core.c b/arch/arm/mach-integrator/core.c
index 01ce14d70..7f6df02cf 100644
--- a/arch/arm/mach-integrator/core.c
+++ b/arch/arm/mach-integrator/core.c
@@ -12,12 +12,17 @@
 #include <linux/init.h>
 #include <linux/device.h>
 #include <linux/spinlock.h>
+#include <linux/interrupt.h>
+#include <linux/sched.h>
 
 #include <asm/hardware.h>
 #include <asm/irq.h>
 #include <asm/io.h>
 #include <asm/hardware/amba.h>
 #include <asm/arch/cm.h>
+#include <asm/system.h>
+#include <asm/leds.h>
+#include <asm/mach/time.h>
 
 static struct amba_device rtc_device = {
 	.dev		= {
@@ -127,3 +132,137 @@ void cm_control(u32 mask, u32 set)
 }
 
 EXPORT_SYMBOL(cm_control);
+
+/*
+ * Where is the timer (VA)?
+ */
+#define TIMER0_VA_BASE (IO_ADDRESS(INTEGRATOR_CT_BASE)+0x00000000)
+#define TIMER1_VA_BASE (IO_ADDRESS(INTEGRATOR_CT_BASE)+0x00000100)
+#define TIMER2_VA_BASE (IO_ADDRESS(INTEGRATOR_CT_BASE)+0x00000200)
+#define VA_IC_BASE     IO_ADDRESS(INTEGRATOR_IC_BASE) 
+
+/*
+ * How long is the timer interval?
+ */
+#define TIMER_INTERVAL	(TICKS_PER_uSEC * mSEC_10)
+#if TIMER_INTERVAL >= 0x100000
+#define TICKS2USECS(x)	(256 * (x) / TICKS_PER_uSEC)
+#elif TIMER_INTERVAL >= 0x10000
+#define TICKS2USECS(x)	(16 * (x) / TICKS_PER_uSEC)
+#else
+#define TICKS2USECS(x)	((x) / TICKS_PER_uSEC)
+#endif
+
+/*
+ * What does it look like?
+ */
+typedef struct TimerStruct {
+	unsigned long TimerLoad;
+	unsigned long TimerValue;
+	unsigned long TimerControl;
+	unsigned long TimerClear;
+} TimerStruct_t;
+
+extern unsigned long (*gettimeoffset)(void);
+
+static unsigned long timer_reload;
+
+/*
+ * Returns number of ms since last clock interrupt.  Note that interrupts
+ * will have been disabled by do_gettimeoffset()
+ */
+static unsigned long integrator_gettimeoffset(void)
+{
+	volatile TimerStruct_t *timer1 = (TimerStruct_t *)TIMER1_VA_BASE;
+	unsigned long ticks1, ticks2, status;
+
+	/*
+	 * Get the current number of ticks.  Note that there is a race
+	 * condition between us reading the timer and checking for
+	 * an interrupt.  We get around this by ensuring that the
+	 * counter has not reloaded between our two reads.
+	 */
+	ticks2 = timer1->TimerValue & 0xffff;
+	do {
+		ticks1 = ticks2;
+		status = __raw_readl(VA_IC_BASE + IRQ_RAW_STATUS);
+		ticks2 = timer1->TimerValue & 0xffff;
+	} while (ticks2 > ticks1);
+
+	/*
+	 * Number of ticks since last interrupt.
+	 */
+	ticks1 = timer_reload - ticks2;
+
+	/*
+	 * Interrupt pending?  If so, we've reloaded once already.
+	 */
+	if (status & (1 << IRQ_TIMERINT1))
+		ticks1 += timer_reload;
+
+	/*
+	 * Convert the ticks to usecs
+	 */
+	return TICKS2USECS(ticks1);
+}
+
+/*
+ * IRQ handler for the timer
+ */
+static irqreturn_t
+integrator_timer_interrupt(int irq, void *dev_id, struct pt_regs *regs)
+{
+	volatile TimerStruct_t *timer1 = (volatile TimerStruct_t *)TIMER1_VA_BASE;
+
+	// ...clear the interrupt
+	timer1->TimerClear = 1;
+
+	timer_tick(regs);
+
+	return IRQ_HANDLED;
+}
+
+static struct irqaction integrator_timer_irq = {
+	.name		= "Integrator Timer Tick",
+	.flags		= SA_INTERRUPT,
+	.handler	= integrator_timer_interrupt
+};
+
+/*
+ * Set up timer interrupt, and return the current time in seconds.
+ */
+void __init integrator_time_init(unsigned long reload, unsigned int ctrl)
+{
+	volatile TimerStruct_t *timer0 = (volatile TimerStruct_t *)TIMER0_VA_BASE;
+	volatile TimerStruct_t *timer1 = (volatile TimerStruct_t *)TIMER1_VA_BASE;
+	volatile TimerStruct_t *timer2 = (volatile TimerStruct_t *)TIMER2_VA_BASE;
+	unsigned int timer_ctrl = 0x80 | 0x40;	/* periodic */
+
+	timer_reload = reload;
+	timer_ctrl |= ctrl;
+
+	if (timer_reload > 0x100000) {
+		timer_reload >>= 8;
+		timer_ctrl |= 0x08; /* /256 */
+	} else if (timer_reload > 0x010000) {
+		timer_reload >>= 4;
+		timer_ctrl |= 0x04; /* /16 */
+	}
+
+	/*
+	 * Initialise to a known state (all timers off)
+	 */
+	timer0->TimerControl = 0;
+	timer1->TimerControl = 0;
+	timer2->TimerControl = 0;
+
+	timer1->TimerLoad    = timer_reload;
+	timer1->TimerValue   = timer_reload;
+	timer1->TimerControl = timer_ctrl;
+
+	/* 
+	 * Make irqs happen for the system timer
+	 */
+	setup_irq(IRQ_TIMERINT1, &integrator_timer_irq);
+	gettimeoffset = integrator_gettimeoffset;
+}
diff --git a/arch/arm/mach-integrator/impd1.c b/arch/arm/mach-integrator/impd1.c
index dfdd5ecdf..e776e8a8d 100644
--- a/arch/arm/mach-integrator/impd1.c
+++ b/arch/arm/mach-integrator/impd1.c
@@ -25,13 +25,16 @@
 #include <asm/arch/impd1.h>
 #include <asm/sizes.h>
 
+#include "clock.h"
+
 static int module_id;
 
 module_param_named(lmid, module_id, int, 0444);
 MODULE_PARM_DESC(lmid, "logic module stack position");
 
 struct impd1_module {
-	void	*base;
+	void		*base;
+	struct clk	vcos[2];
 };
 
 static const struct icst525_params impd1_vco_params = {
@@ -43,25 +46,20 @@ static const struct icst525_params impd1_vco_params = {
 	.rd_max		= 120,
 };
 
-void impd1_set_vco(struct device *dev, int vconr, unsigned long period)
+static void impd1_setvco(struct clk *clk, struct icst525_vco vco)
 {
-	struct impd1_module *impd1 = dev_get_drvdata(dev);
-	struct icst525_vco vco;
+	struct impd1_module *impd1 = clk->data;
+	int vconr = clk - impd1->vcos;
 	u32 val;
 
-	vco = icst525_ps_to_vco(&impd1_vco_params, period);
-
-	pr_debug("Guessed VCO reg params: S=%d R=%d V=%d\n",
-		vco.s, vco.r, vco.v);
-
 	val = vco.v | (vco.r << 9) | (vco.s << 16);
 
 	writel(0xa05f, impd1->base + IMPD1_LOCK);
 	switch (vconr) {
-	case 1:
+	case 0:
 		writel(val, impd1->base + IMPD1_OSC1);
 		break;
-	case 2:
+	case 1:
 		writel(val, impd1->base + IMPD1_OSC2);
 		break;
 	}
@@ -77,8 +75,6 @@ void impd1_set_vco(struct device *dev, int vconr, unsigned long period)
 #endif
 }
 
-EXPORT_SYMBOL(impd1_set_vco);
-
 void impd1_tweak_control(struct device *dev, u32 mask, u32 val)
 {
 	struct impd1_module *impd1 = dev_get_drvdata(dev);
@@ -140,6 +136,11 @@ static struct impd1_device impd1_devs[] = {
 	}
 };
 
+static const char *impd1_vconames[2] = {
+	"CLCDCLK",
+	"AUXVCO2",
+};
+
 static int impd1_probe(struct lm_device *dev)
 {
 	struct impd1_module *impd1;
@@ -168,6 +169,16 @@ static int impd1_probe(struct lm_device *dev)
 
 	printk("IM-PD1 found at 0x%08lx\n", dev->resource.start);
 
+	for (i = 0; i < ARRAY_SIZE(impd1->vcos); i++) {
+		impd1->vcos[i].owner = THIS_MODULE,
+		impd1->vcos[i].name = impd1_vconames[i],
+		impd1->vcos[i].params = &impd1_vco_params,
+		impd1->vcos[i].data = impd1,
+		impd1->vcos[i].setvco = impd1_setvco;
+
+		clk_register(&impd1->vcos[i]);
+	}
+
 	for (i = 0; i < ARRAY_SIZE(impd1_devs); i++) {
 		struct impd1_device *idev = impd1_devs + i;
 		struct amba_device *d;
@@ -216,6 +227,7 @@ static void impd1_remove(struct lm_device *dev)
 {
 	struct impd1_module *impd1 = lm_get_drvdata(dev);
 	struct list_head *l, *n;
+	int i;
 
 	list_for_each_safe(l, n, &dev->dev.children) {
 		struct device *d = list_to_dev(l);
@@ -223,6 +235,9 @@ static void impd1_remove(struct lm_device *dev)
 		device_unregister(d);
 	}
 
+	for (i = 0; i < ARRAY_SIZE(impd1->vcos); i++)
+		clk_unregister(&impd1->vcos[i]);
+
 	lm_set_drvdata(dev, NULL);
 
 	iounmap(impd1->base);
diff --git a/arch/arm/mach-integrator/integrator_ap.c b/arch/arm/mach-integrator/integrator_ap.c
index 1d5976665..b07e39d21 100644
--- a/arch/arm/mach-integrator/integrator_ap.c
+++ b/arch/arm/mach-integrator/integrator_ap.c
@@ -256,7 +256,7 @@ static void __init ap_init(void)
 	unsigned long sc_dec;
 	int i;
 
-	platform_add_device(&cfi_flash_device);
+	platform_device_register(&cfi_flash_device);
 
 	sc_dec = readl(VA_SC_BASE + INTEGRATOR_SC_DEC_OFFSET);
 	for (i = 0; i < 4; i++) {
@@ -281,11 +281,17 @@ static void __init ap_init(void)
 	}
 }
 
+static void ap_time_init(void)
+{
+	integrator_time_init(1000000 * TICKS_PER_uSEC / HZ, 0);
+}
+
 MACHINE_START(INTEGRATOR, "ARM-Integrator")
 	MAINTAINER("ARM Ltd/Deep Blue Solutions Ltd")
 	BOOT_MEM(0x00000000, 0x16000000, 0xf1600000)
 	BOOT_PARAMS(0x00000100)
 	MAPIO(ap_map_io)
 	INITIRQ(ap_init_irq)
+	INITTIME(ap_time_init)
 	INIT_MACHINE(ap_init)
 MACHINE_END
diff --git a/arch/arm/mach-integrator/integrator_cp.c b/arch/arm/mach-integrator/integrator_cp.c
index 751941059..e56fcb1ea 100644
--- a/arch/arm/mach-integrator/integrator_cp.c
+++ b/arch/arm/mach-integrator/integrator_cp.c
@@ -23,6 +23,7 @@
 #include <asm/mach-types.h>
 #include <asm/hardware/amba.h>
 #include <asm/hardware/amba_kmi.h>
+#include <asm/hardware/icst525.h>
 
 #include <asm/arch/lm.h>
 
@@ -32,12 +33,16 @@
 #include <asm/mach/mmc.h>
 #include <asm/mach/map.h>
 
+#include "clock.h"
+
 #define INTCP_PA_MMC_BASE		0x1c000000
 #define INTCP_PA_AACI_BASE		0x1d000000
 
 #define INTCP_PA_FLASH_BASE		0x24000000
 #define INTCP_FLASH_SIZE		SZ_32M
 
+#define INTCP_PA_CLCD_BASE		0xc0000000
+
 #define INTCP_VA_CIC_BASE		0xf1000040
 #define INTCP_VA_PIC_BASE		0xf1400000
 #define INTCP_VA_SIC_BASE		0xfca00000
@@ -209,6 +214,44 @@ static void __init intcp_init_irq(void)
 	pic_unmask_irq(IRQ_CP_CPPLDINT);
 }
 
+/*
+ * Clock handling
+ */
+#define CM_LOCK (IO_ADDRESS(INTEGRATOR_HDR_BASE)+INTEGRATOR_HDR_LOCK_OFFSET)
+#define CM_AUXOSC (IO_ADDRESS(INTEGRATOR_HDR_BASE)+0x1c)
+
+static const struct icst525_params cp_auxvco_params = {
+	.ref		= 24000,
+	.vco_max	= 320000,
+	.vd_min 	= 8,
+	.vd_max 	= 263,
+	.rd_min 	= 3,
+	.rd_max 	= 65,
+};
+
+static void cp_auxvco_set(struct clk *clk, struct icst525_vco vco)
+{
+	u32 val;
+
+	val = readl(CM_AUXOSC) & ~0x7ffff;
+	val |= vco.v | (vco.r << 9) | (vco.s << 16);
+
+	writel(0xa05f, CM_LOCK);
+	writel(val, CM_AUXOSC);
+	writel(0, CM_LOCK);
+}
+
+static struct clk cp_clcd_clk = {
+	.name	= "CLCDCLK",
+	.params	= &cp_auxvco_params,
+	.setvco = cp_auxvco_set,
+};
+
+static struct clk cp_mmci_clk = {
+	.name	= "MCLK",
+	.rate	= 14745600,
+};
+
 /*
  * Flash handling.
  */
@@ -308,7 +351,6 @@ static unsigned int mmc_status(struct device *dev)
 }
 
 static struct mmc_platform_data mmc_data = {
-	.mclk		= 33000000,
 	.ocr_mask	= MMC_VDD_32_33|MMC_VDD_33_34,
 	.status		= mmc_status,
 };
@@ -340,15 +382,34 @@ static struct amba_device aaci_device = {
 	.periphid	= 0,
 };
 
+static struct amba_device clcd_device = {
+	.dev		= {
+		.bus_id	= "mb:c0",
+		.coherent_dma_mask = ~0,
+	},
+	.res		= {
+		.start	= INTCP_PA_CLCD_BASE,
+		.end	= INTCP_PA_CLCD_BASE + SZ_4K - 1,
+		.flags	= IORESOURCE_MEM,
+	},
+	.dma_mask	= ~0,
+	.irq		= { IRQ_CP_CLCDCINT, NO_IRQ },
+	.periphid	= 0,
+};
+
 static struct amba_device *amba_devs[] __initdata = {
 	&mmc_device,
 	&aaci_device,
+	&clcd_device,
 };
 
 static void __init intcp_init(void)
 {
 	int i;
 
+	clk_register(&cp_clcd_clk);
+	clk_register(&cp_mmci_clk);
+
 	platform_add_devices(intcp_devs, ARRAY_SIZE(intcp_devs));
 
 	for (i = 0; i < ARRAY_SIZE(amba_devs); i++) {
@@ -357,11 +418,19 @@ static void __init intcp_init(void)
 	}
 }
 
+#define TIMER_CTRL_IE	(1 << 5)			/* Interrupt Enable */
+
+static void __init intcp_init_time(void)
+{
+	integrator_time_init(1000000 / HZ, TIMER_CTRL_IE);
+}
+
 MACHINE_START(CINTEGRATOR, "ARM-IntegratorCP")
 	MAINTAINER("ARM Ltd/Deep Blue Solutions Ltd")
 	BOOT_MEM(0x00000000, 0x16000000, 0xf1600000)
 	BOOT_PARAMS(0x00000100)
 	MAPIO(intcp_map_io)
 	INITIRQ(intcp_init_irq)
+	INITTIME(intcp_init_time)
 	INIT_MACHINE(intcp_init)
 MACHINE_END
diff --git a/arch/arm/mach-iop3xx/arch.c b/arch/arm/mach-iop3xx/arch.c
index eb3bab2db..3df5e454c 100644
--- a/arch/arm/mach-iop3xx/arch.c
+++ b/arch/arm/mach-iop3xx/arch.c
@@ -29,6 +29,7 @@ extern void iq80310_init_irq(void);
 #ifdef CONFIG_ARCH_IQ80321
 extern void iq80321_map_io(void);
 extern void iop321_init_irq(void);
+extern void iop321_init_time(void);
 #endif
 
 #ifdef CONFIG_ARCH_IQ80310
@@ -67,6 +68,7 @@ MACHINE_START(IQ80321, "Intel IQ80321")
 	FIXUP(fixup_iop321)
 	MAPIO(iq80321_map_io)
 	INITIRQ(iop321_init_irq)
+	INITTIME(iop321_init_time)
 MACHINE_END
 
 #else
diff --git a/arch/arm/mach-iop3xx/iop321-time.c b/arch/arm/mach-iop3xx/iop321-time.c
index a10a9b953..be36c7069 100644
--- a/arch/arm/mach-iop3xx/iop321-time.c
+++ b/arch/arm/mach-iop3xx/iop321-time.c
@@ -23,7 +23,9 @@
 #include <asm/io.h>
 #include <asm/irq.h>
 #include <asm/uaccess.h>
+
 #include <asm/mach/irq.h>
+#include <asm/mach/time.h>
 
 static unsigned long iop321_gettimeoffset(void)
 {
@@ -61,27 +63,26 @@ iop321_timer_interrupt(int irq, void *dev_id, struct pt_regs *regs)
 
 	asm volatile("mcr p6, 0, %0, c6, c1, 0" : : "r" (tisr));
 
-	do_timer(regs);
+	timer_tick(regs);
 
 	return IRQ_HANDLED;
 }
 
-extern unsigned long (*gettimeoffset)(void);
-
-static struct irqaction timer_irq = {
-	.name		= "timer",
+static struct irqaction iop321_timer_irq = {
+	.name		= "IOP321 Timer Tick",
 	.handler	= iop321_timer_interrupt,
+	.flags		= SA_INTERRUPT
 };
 
 extern int setup_arm_irq(int, struct irqaction*);
 
-void __init time_init(void)
+void __init iop321_init_time(void)
 {
 	u32 timer_ctl;
 	u32 latch = LATCH;
 
 	gettimeoffset = iop321_gettimeoffset;
-	setup_irq(IRQ_IOP321_TIMER0, &timer_irq);
+	setup_irq(IRQ_IOP321_TIMER0, &iop321_timer_irq);
 
 	timer_ctl = IOP321_TMR_EN | IOP321_TMR_PRIVILEGED | IOP321_TMR_RELOAD |
 			IOP321_TMR_RATIO_1_1;
diff --git a/arch/arm/mach-ixp4xx/common-pci.c b/arch/arm/mach-ixp4xx/common-pci.c
index c20dc3226..664521892 100644
--- a/arch/arm/mach-ixp4xx/common-pci.c
+++ b/arch/arm/mach-ixp4xx/common-pci.c
@@ -540,4 +540,6 @@ pci_set_consistent_dma_mask(struct pci_dev *dev, u64 mask)
 EXPORT_SYMBOL(pci_set_dma_mask);
 EXPORT_SYMBOL(pci_dac_set_dma_mask);
 EXPORT_SYMBOL(pci_set_consistent_dma_mask);
+EXPORT_SYMBOL(ixp4xx_pci_read);
+EXPORT_SYMBOL(ixp4xx_pci_write);
 
diff --git a/arch/arm/mach-ixp4xx/common.c b/arch/arm/mach-ixp4xx/common.c
index f0166508d..a4edbe0eb 100644
--- a/arch/arm/mach-ixp4xx/common.c
+++ b/arch/arm/mach-ixp4xx/common.c
@@ -36,6 +36,7 @@
 
 #include <asm/mach/map.h>
 #include <asm/mach/irq.h>
+#include <asm/mach/time.h>
 
 
 /*************************************************************************
@@ -227,24 +228,22 @@ static irqreturn_t ixp4xx_timer_interrupt(int irq, void *dev_id, struct pt_regs
 	 * Catch up with the real idea of time
 	 */
 	do {	
-		do_timer(regs);
+		timer_tick(regs);
 		last_jiffy_time += LATCH;
 	} while((*IXP4XX_OSTS - last_jiffy_time) > LATCH);
 
 	return IRQ_HANDLED;
 }
 
-extern unsigned long (*gettimeoffset)(void);
-
-static struct irqaction timer_irq = {
-	.name	= "IXP4xx Timer Tick",
-	.flags	= SA_INTERRUPT
+static struct irqaction ixp4xx_timer_irq = {
+	.name		= "IXP4xx Timer Tick",
+	.flags		= SA_INTERRUPT,
+	.handler	= ixp4xx_timer_interrupt
 };
 
-void __init time_init(void)
+void __init ixp4xx_init_time(void)
 {
 	gettimeoffset = ixp4xx_gettimeoffset;
-	timer_irq.handler = ixp4xx_timer_interrupt;
 
 	/* Clear Pending Interrupt by writing '1' to it */
 	*IXP4XX_OSST = IXP4XX_OSST_TIMER_1_PEND;
@@ -257,7 +256,7 @@ void __init time_init(void)
 	last_jiffy_time = 0;
 
 	/* Connect the interrupt handler and enable the interrupt */
-	setup_irq(IRQ_IXP4XX_TIMER1, &timer_irq);
+	setup_irq(IRQ_IXP4XX_TIMER1, &ixp4xx_timer_irq);
 }
 
 
diff --git a/arch/arm/mach-ixp4xx/coyote-setup.c b/arch/arm/mach-ixp4xx/coyote-setup.c
index bc6e0d042..03ad0b718 100644
--- a/arch/arm/mach-ixp4xx/coyote-setup.c
+++ b/arch/arm/mach-ixp4xx/coyote-setup.c
@@ -63,7 +63,7 @@ static struct resource coyote_flash_resource = {
 	.flags		= IORESOURCE_MEM,
 };
 
-static struct platform_device coyote_flash_device = {
+static struct platform_device coyote_flash = {
 	.name		= "IXP4XX-Flash",
 	.id		= 0,
 	.dev		= {
@@ -73,9 +73,13 @@ static struct platform_device coyote_flash_device = {
 	.resource	= &coyote_flash_resource,
 };
 
+static struct platform_device *coyote_devices[] __initdata = {
+	&coyote_flash
+};
+
 static void __init coyote_init(void)
 {
-	platform_add_device(&coyote_flash_device);
+	platform_add_devices(&coyote_devices, ARRAY_SIZE(coyote_devices));
 }
 
 MACHINE_START(ADI_COYOTE, "ADI Engineering IXP4XX Coyote Development Platform")
@@ -84,6 +88,7 @@ MACHINE_START(ADI_COYOTE, "ADI Engineering IXP4XX Coyote Development Platform")
                 IXP4XX_PERIPHERAL_BASE_VIRT)
         MAPIO(coyote_map_io)
         INITIRQ(ixp4xx_init_irq)
+	INITTIME(ixp4xx_init_time)
         BOOT_PARAMS(0x0100)
 	INIT_MACHINE(coyote_init)
 MACHINE_END
diff --git a/arch/arm/mach-ixp4xx/ixdp425-setup.c b/arch/arm/mach-ixp4xx/ixdp425-setup.c
index 160117c67..dbcaa464b 100644
--- a/arch/arm/mach-ixp4xx/ixdp425-setup.c
+++ b/arch/arm/mach-ixp4xx/ixdp425-setup.c
@@ -77,7 +77,7 @@ static struct resource ixdp425_flash_resource = {
 	.flags		= IORESOURCE_MEM,
 };
 
-static struct platform_device ixdp425_flash_device = {
+static struct platform_device ixdp425_flash = {
 	.name		= "IXP4XX-Flash",
 	.id		= 0,
 	.dev		= {
@@ -101,10 +101,14 @@ static struct platform_device ixdp425_i2c_controller = {
 	.num_resources	= 0
 };
 
+static struct platform_device *ixdp425_devices[] __initdata = {
+	&ixdp425_i2c_controller,
+	&ixdp425_flash
+};
+
 static void __init ixdp425_init(void)
 {
-	platform_add_device(&ixdp425_flash_device);
-	platform_add_device(&ixdp425_i2c_controller);
+	platform_add_devices(&ixdp425_devices, ARRAY_SIZE(ixdp425_devices));
 }
 
 MACHINE_START(IXDP425, "Intel IXDP425 Development Platform")
@@ -113,6 +117,7 @@ MACHINE_START(IXDP425, "Intel IXDP425 Development Platform")
 		IXP4XX_PERIPHERAL_BASE_VIRT)
 	MAPIO(ixdp425_map_io)
 	INITIRQ(ixp4xx_init_irq)
+	INITTIME(ixp4xx_init_time)
 	BOOT_PARAMS(0x0100)
 	INIT_MACHINE(ixdp425_init)
 MACHINE_END
@@ -123,6 +128,7 @@ MACHINE_START(IXCDP1100, "Intel IXCDP1100 Development Platform")
 		IXP4XX_PERIPHERAL_BASE_VIRT)
 	MAPIO(ixdp425_map_io)
 	INITIRQ(ixp4xx_init_irq)
+	INITTIME(ixp4xx_init_time)
 	BOOT_PARAMS(0x0100)
 	INIT_MACHINE(ixdp425_init)
 MACHINE_END
@@ -140,6 +146,7 @@ MACHINE_START(AVILA, "Gateworks Avila Network Platform")
 		IXP4XX_PERIPHERAL_BASE_VIRT)
 	MAPIO(ixdp425_map_io)
 	INITIRQ(ixp4xx_init_irq)
+	INITTIME(ixp4xx_init_time)
 	BOOT_PARAMS(0x0100)
 	INIT_MACHINE(ixdp425_init)
 MACHINE_END
diff --git a/arch/arm/mach-ixp4xx/prpmc1100-setup.c b/arch/arm/mach-ixp4xx/prpmc1100-setup.c
index b0603205d..01e98fda0 100644
--- a/arch/arm/mach-ixp4xx/prpmc1100-setup.c
+++ b/arch/arm/mach-ixp4xx/prpmc1100-setup.c
@@ -63,7 +63,7 @@ static struct resource prpmc1100_flash_resource = {
 	.flags		= IORESOURCE_MEM,
 };
 
-static struct platform_device prpmc1100_flash_device = {
+static struct platform_device prpmc1100_flash = {
 	.name		= "IXP4XX-Flash",
 	.id		= 0,
 	.dev		= {
@@ -73,9 +73,13 @@ static struct platform_device prpmc1100_flash_device = {
 	.resource	= &prpmc1100_flash_resource,
 };
 
+static struct platform_device *prpmc1100_devices[] __initdata = {
+	&prpmc1100_flash
+};
+
 static void __init prpmc1100_init(void)
 {
-	platform_add_device(&prpmc1100_flash_device);
+	platform_add_devices(&prpmc1100_devices, ARRAY_SIZE(prpmc1100_devices));
 }
 
 MACHINE_START(PRPMC1100, "Motorola PrPMC1100")
@@ -84,6 +88,7 @@ MACHINE_START(PRPMC1100, "Motorola PrPMC1100")
                 IXP4XX_PERIPHERAL_BASE_VIRT)
         MAPIO(prpmc1100_map_io)
         INITIRQ(ixp4xx_init_irq)
+	INITTIME(ixp4xx_init_time)
         BOOT_PARAMS(0x0100)
 	INIT_MACHINE(prpmc1100_init)
 MACHINE_END
diff --git a/arch/arm/mach-lh7a40x/Kconfig b/arch/arm/mach-lh7a40x/Kconfig
index b1934bfa4..8a17867a6 100644
--- a/arch/arm/mach-lh7a40x/Kconfig
+++ b/arch/arm/mach-lh7a40x/Kconfig
@@ -34,6 +34,37 @@ config ARCH_LH7A400
 config ARCH_LH7A404
 	bool
 
+config LH7A40X_CONTIGMEM
+	bool "Disable NUMA Support"
+	depends on ARCH_LH7A40X
+	help
+	  Say Y here if your bootloader sets the SROMLL bit(s) in
+	  the SDRAM controller, organizing memory as a contiguous
+	  array.  This option will disable CONFIG_DISCONTIGMEM and
+          force the kernel to manage all memory in one node.
+
+	  Setting this option incorrectly may prevent the kernel from
+	  booting.  It is OK to leave it N.
+
+	  For more information, consult
+	    <file:Documentation/arm/Sharp-LH/SDRAM>.
+
+config LH7A40X_ONE_BANK_PER_NODE
+	bool "Optimize NUMA Node Tables for Size"
+	depends on ARCH_LH7A40X && !LH7A40X_CONTIGMEM
+	help
+	  Say Y here to produce compact memory node tables.  By
+	  default pairs of adjacent physical RAM banks are managed
+	  together in a single node, incurring some wasted overhead
+	  in the node tables, however also maintaining compatibility
+	  with systems where physical memory is truly contiguous.
+
+	  Setting this option incorrectly may prevent the kernel from
+	  booting.  It is OK to leave it N.
+
+	  For more information, consult
+	    <file:Documentation/arm/Sharp-LH/SDRAM>.
+
 endmenu
 
 endif
diff --git a/arch/arm/mach-lh7a40x/Makefile b/arch/arm/mach-lh7a40x/Makefile
index db3be5a23..e90512dbc 100644
--- a/arch/arm/mach-lh7a40x/Makefile
+++ b/arch/arm/mach-lh7a40x/Makefile
@@ -4,11 +4,10 @@
 
 # Object file lists.
 
-obj-y			:= fiq.o
-# generic.o
+obj-y			:= time.o
 obj-$(CONFIG_MACH_KEV7A400) += arch-kev7a400.o irq-lh7a400.o
-obj-$(CONFIG_MACH_LPD7A400) += arch-lpd7a40x.o ide-lpd7a40x.o irq-lh7a400.o
-obj-$(CONFIG_MACH_LPD7A404) += arch-lpd7a40x.o ide-lpd7a40x.o irq-lh7a404.o
+obj-$(CONFIG_MACH_LPD7A400) += arch-lpd7a40x.o irq-lh7a400.o
+obj-$(CONFIG_MACH_LPD7A404) += arch-lpd7a40x.o irq-lh7a404.o
 
 obj-m			:=
 obj-n			:=
diff --git a/arch/arm/mach-lh7a40x/arch-kev7a400.c b/arch/arm/mach-lh7a40x/arch-kev7a400.c
index 73d8b6b56..6fa2a981e 100644
--- a/arch/arm/mach-lh7a40x/arch-kev7a400.c
+++ b/arch/arm/mach-lh7a40x/arch-kev7a400.c
@@ -25,6 +25,7 @@
 
       /* This function calls the board specific IRQ initialization function. */
 extern void lh7a400_init_irq (void);
+extern void lh7a40x_init_time (void);
 
 static struct map_desc kev7a400_io_desc[] __initdata = {
 	{ IO_VIRT,    IO_PHYS,    IO_SIZE,    MT_DEVICE },
@@ -108,4 +109,5 @@ MACHINE_START (KEV7A400, "Sharp KEV7a400")
 	BOOT_PARAMS (0xc0000100)
 	MAPIO (kev7a400_map_io)
 	INITIRQ (lh7a400_init_irq)
+	INITTIME (lh7a40x_init_time)
 MACHINE_END
diff --git a/arch/arm/mach-lh7a40x/arch-lpd7a40x.c b/arch/arm/mach-lh7a40x/arch-lpd7a40x.c
index 75dba9836..9e0bf6c18 100644
--- a/arch/arm/mach-lh7a40x/arch-lpd7a40x.c
+++ b/arch/arm/mach-lh7a40x/arch-lpd7a40x.c
@@ -265,6 +265,7 @@ lpd7a400_map_io(void)
 #ifdef CONFIG_MACH_LPD7A400
 
 extern void lh7a400_init_irq (void);
+extern void lh7a40x_init_time (void);
 
 MACHINE_START (LPD7A400, "Logic Product Development LPD7A400-10")
 	MAINTAINER ("Marc Singer")
@@ -272,6 +273,7 @@ MACHINE_START (LPD7A400, "Logic Product Development LPD7A400-10")
 	BOOT_PARAMS (0xc0000100)
 	MAPIO (lpd7a400_map_io)
 	INITIRQ (lh7a400_init_irq)
+	INITTIME (lh7a40x_init_time)
 	INIT_MACHINE (lpd7a40x_init)
 MACHINE_END
 
@@ -280,6 +282,7 @@ MACHINE_END
 #ifdef CONFIG_MACH_LPD7A404
 
 extern void lh7a404_init_irq (void);
+extern void lh7a40x_init_time (void);
 
 MACHINE_START (LPD7A404, "Logic Product Development LPD7A404-10")
 	MAINTAINER ("Marc Singer")
@@ -287,6 +290,7 @@ MACHINE_START (LPD7A404, "Logic Product Development LPD7A404-10")
 	BOOT_PARAMS (0xc0000100)
 	MAPIO (lpd7a400_map_io)
 	INITIRQ (lh7a404_init_irq)
+	INITTIME (lh7a40x_init_time)
 	INIT_MACHINE (lpd7a40x_init)
 MACHINE_END
 
diff --git a/arch/arm/mach-omap/Makefile b/arch/arm/mach-omap/Makefile
index 272535091..5fcb1e5c7 100644
--- a/arch/arm/mach-omap/Makefile
+++ b/arch/arm/mach-omap/Makefile
@@ -3,7 +3,7 @@
 #
 
 # Common support
-obj-y := common.o irq.o dma.o clocks.o mux.o bus.o gpio.o
+obj-y := common.o irq.o dma.o clocks.o mux.o bus.o gpio.o time.o
 obj-m :=
 obj-n :=
 obj-  :=
diff --git a/arch/arm/mach-omap/board-generic.c b/arch/arm/mach-omap/board-generic.c
index e0b09f86a..447046b24 100644
--- a/arch/arm/mach-omap/board-generic.c
+++ b/arch/arm/mach-omap/board-generic.c
@@ -65,6 +65,11 @@ static void __init omap_generic_map_io(void)
 	omap_map_io();
 }
 
+static void __init omap_generic_init_time(void)
+{
+	omap_init_time();
+}
+
 MACHINE_START(OMAP_GENERIC, "Generic OMAP-1510/1610/1710")
 	MAINTAINER("Tony Lindgren <tony@atomide.com>")
 	BOOT_MEM(0x10000000, 0xfff00000, 0xfef00000)
@@ -72,4 +77,6 @@ MACHINE_START(OMAP_GENERIC, "Generic OMAP-1510/1610/1710")
 	MAPIO(omap_generic_map_io)
 	INITIRQ(omap_generic_init_irq)
 	INIT_MACHINE(omap_generic_init)
+	INITTIME(omap_generic_init_time)
 MACHINE_END
+
diff --git a/arch/arm/mach-omap/board-innovator.c b/arch/arm/mach-omap/board-innovator.c
index c65f38f58..6ef4d8dcf 100644
--- a/arch/arm/mach-omap/board-innovator.c
+++ b/arch/arm/mach-omap/board-innovator.c
@@ -156,5 +156,6 @@ MACHINE_START(OMAP_INNOVATOR, "TI-Innovator")
 	BOOT_PARAMS(0x10000100)
 	MAPIO(innovator_map_io)
 	INITIRQ(innovator_init_irq)
+	INITTIME(omap_init_time)
 	INIT_MACHINE(innovator_init)
 MACHINE_END
diff --git a/arch/arm/mach-omap/board-osk.c b/arch/arm/mach-omap/board-osk.c
index 8044dd190..16ecd6be5 100644
--- a/arch/arm/mach-omap/board-osk.c
+++ b/arch/arm/mach-omap/board-osk.c
@@ -94,5 +94,6 @@ MACHINE_START(OMAP_OSK, "TI-OSK")
 	BOOT_PARAMS(0x10000100)
 	MAPIO(osk_map_io)
 	INITIRQ(osk_init_irq)
+	INITTIME(omap_init_time)
 	INIT_MACHINE(osk_init)
 MACHINE_END
diff --git a/arch/arm/mach-omap/board-perseus2.c b/arch/arm/mach-omap/board-perseus2.c
index e938ea4b6..8015d10fc 100644
--- a/arch/arm/mach-omap/board-perseus2.c
+++ b/arch/arm/mach-omap/board-perseus2.c
@@ -111,5 +111,6 @@ MACHINE_START(OMAP_PERSEUS2, "OMAP730 Perseus2")
 	BOOT_PARAMS(0x10000100)
 	MAPIO(omap_perseus2_map_io)
 	INITIRQ(omap_perseus2_init_irq)
+	INITTIME(omap_init_time)
 	INIT_MACHINE(omap_perseus2_init)
 MACHINE_END
diff --git a/arch/arm/mach-omap/bus.c b/arch/arm/mach-omap/bus.c
index 07da30d52..24a57f2a8 100644
--- a/arch/arm/mach-omap/bus.c
+++ b/arch/arm/mach-omap/bus.c
@@ -81,40 +81,6 @@ static struct bus_type omap_bus_types[OMAP_NR_BUSES] = {
 	},
 };
 
-#ifdef CONFIG_ARCH_OMAP1510
-/*
- * NOTE: This code _should_ go somewhere else. But let's wait for the
- *	 dma-mapping code to settle down first.
- */
-
-/*
- * Test for Local Bus device in order to do address translation between
- * dma_handle and Local Bus address.
- */
-inline int dmadev_uses_omap_lbus(struct device * dev)
-{
-	if (dev == NULL || !cpu_is_omap1510())
-		return 0;
-	return dev->bus == &omap_bus_types[OMAP_BUS_LBUS] ? 1 : 0;
-}
-
-/*
- * Translate bus address to Local Bus address for dma-mapping
- */
-inline int dmadev_to_lbus(dma_addr_t addr)
-{
-	return bus_to_lbus(addr);
-}
-
-/*
- * Translate Local Bus address to bus address for dma-mapping
- */
-inline int lbus_to_dmadev(dma_addr_t addr)
-{
-	return lbus_to_bus(addr);
-}
-#endif
-
 static int omap_bus_match(struct device *dev, struct device_driver *drv)
 {
 	struct omap_dev *omapdev = OMAP_DEV(dev);
@@ -278,8 +244,3 @@ EXPORT_SYMBOL(omap_driver_unregister);
 EXPORT_SYMBOL(omap_device_register);
 EXPORT_SYMBOL(omap_device_unregister);
 
-#ifdef CONFIG_ARCH_OMAP1510
-EXPORT_SYMBOL(dmadev_uses_omap_lbus);
-EXPORT_SYMBOL(dmadev_to_lbus);
-EXPORT_SYMBOL(lbus_to_dmadev);
-#endif
diff --git a/arch/arm/mach-omap/common.h b/arch/arm/mach-omap/common.h
index 1cc559dd2..96dcb3c53 100644
--- a/arch/arm/mach-omap/common.h
+++ b/arch/arm/mach-omap/common.h
@@ -28,6 +28,7 @@
 #define __ARCH_ARM_MACH_OMAP_COMMON_H
 
 extern void omap_map_io(void);
+extern void omap_init_time(void);
 
 #endif /* __ARCH_ARM_MACH_OMAP_COMMON_H */
 
diff --git a/arch/arm/mach-pxa/Makefile b/arch/arm/mach-pxa/Makefile
index cc33a4767..23c51e388 100644
--- a/arch/arm/mach-pxa/Makefile
+++ b/arch/arm/mach-pxa/Makefile
@@ -3,7 +3,7 @@
 #
 
 # Common support (must be linked before board specific support)
-obj-y += generic.o irq.o dma.o
+obj-y += generic.o irq.o dma.o time.o
 obj-$(CONFIG_PXA25x) += pxa25x.o
 obj-$(CONFIG_PXA27x) += pxa27x.o
 
diff --git a/arch/arm/mach-pxa/generic.c b/arch/arm/mach-pxa/generic.c
index 24f3da29d..80f3535e0 100644
--- a/arch/arm/mach-pxa/generic.c
+++ b/arch/arm/mach-pxa/generic.c
@@ -58,6 +58,24 @@ void pxa_gpio_mode(int gpio_mode)
 
 EXPORT_SYMBOL(pxa_gpio_mode);
 
+/*
+ * Routine to safely enable or disable a clock in the CKEN
+ */
+void pxa_set_cken(int clock, int enable)
+{
+	unsigned long flags;
+	local_irq_save(flags);
+
+	if (enable)
+		CKEN |= clock;
+	else
+		CKEN &= ~clock;
+
+	local_irq_restore(flags);
+}
+
+EXPORT_SYMBOL(pxa_set_cken);
+
 /*
  * Intel PXA2xx internal register mapping.
  *
@@ -100,8 +118,8 @@ static struct resource pxamci_resources[] = {
 static u64 pxamci_dmamask = 0xffffffffUL;
 
 static struct platform_device pxamci_device = {
-	.name		= "pxamci",
-	.id		= 0,
+	.name		= "pxa2xx-mci",
+	.id		= -1,
 	.dev		= {
 		.dma_mask = &pxamci_dmamask,
 		.coherent_dma_mask = 0xffffffff,
@@ -135,8 +153,8 @@ static struct resource pxa2xx_udc_resources[] = {
 static u64 udc_dma_mask = ~(u32)0;
 
 static struct platform_device udc_device = {
-	.name		= "pxa2xx_udc",
-	.id		= 0,
+	.name		= "pxa2xx-udc",
+	.id		= -1,
 	.resource	= pxa2xx_udc_resources,
 	.num_resources	= ARRAY_SIZE(pxa2xx_udc_resources),
 	.dev		=  {
@@ -169,8 +187,8 @@ static struct resource pxafb_resources[] = {
 static u64 fb_dma_mask = ~(u64)0;
 
 static struct platform_device pxafb_device = {
-	.name		= "pxafb",
-	.id		= 0,
+	.name		= "pxa2xx-fb",
+	.id		= -1,
 	.dev		= {
  		.platform_data	= &pxa_fb_info,
 		.dma_mask	= &fb_dma_mask,
@@ -180,10 +198,26 @@ static struct platform_device pxafb_device = {
 	.resource	= pxafb_resources,
 };
 
+static struct platform_device ffuart_device = {
+	.name		= "pxa2xx-uart",
+	.id		= 0,
+};
+static struct platform_device btuart_device = {
+	.name		= "pxa2xx-uart",
+	.id		= 1,
+};
+static struct platform_device stuart_device = {
+	.name		= "pxa2xx-uart",
+	.id		= 2,
+};
+
 static struct platform_device *devices[] __initdata = {
 	&pxamci_device,
 	&udc_device,
 	&pxafb_device,
+	&ffuart_device,
+	&btuart_device,
+	&stuart_device,
 };
 
 static int __init pxa_init(void)
diff --git a/arch/arm/mach-pxa/generic.h b/arch/arm/mach-pxa/generic.h
index 6b33fb03c..f542ef4e7 100644
--- a/arch/arm/mach-pxa/generic.h
+++ b/arch/arm/mach-pxa/generic.h
@@ -11,6 +11,9 @@
 
 extern void __init pxa_map_io(void);
 extern void __init pxa_init_irq(void);
+extern void __init pxa_init_time(void);
+
+extern unsigned int get_clk_frequency_khz(int info);
 
 #define SET_BANK(__nr,__start,__size) \
 	mi->bank[__nr].start = (__start), \
diff --git a/arch/arm/mach-pxa/idp.c b/arch/arm/mach-pxa/idp.c
index 706858ea2..db53cd571 100644
--- a/arch/arm/mach-pxa/idp.c
+++ b/arch/arm/mach-pxa/idp.c
@@ -118,5 +118,6 @@ MACHINE_START(PXA_IDP, "Accelent Xscale IDP")
 	BOOT_MEM(0xa0000000, 0x40000000, io_p2v(0x40000000))
 	MAPIO(idp_map_io)
 	INITIRQ(idp_init_irq)
+	INITTIME(pxa_init_time)
 	INIT_MACHINE(idp_init)
 MACHINE_END
diff --git a/arch/arm/mach-pxa/lubbock.c b/arch/arm/mach-pxa/lubbock.c
index 023c5e9f3..28c9677a9 100644
--- a/arch/arm/mach-pxa/lubbock.c
+++ b/arch/arm/mach-pxa/lubbock.c
@@ -126,7 +126,7 @@ static struct resource sa1111_resources[] = {
 
 static struct platform_device sa1111_device = {
 	.name		= "sa1111",
-	.id		= 0,
+	.id		= -1,
 	.num_resources	= ARRAY_SIZE(sa1111_resources),
 	.resource	= sa1111_resources,
 };
@@ -151,7 +151,7 @@ static struct resource smc91x_resources[] = {
 
 static struct platform_device smc91x_device = {
 	.name		= "smc91x",
-	.id		= 0,
+	.id		= -1,
 	.num_resources	= ARRAY_SIZE(smc91x_resources),
 	.resource	= smc91x_resources,
 };
@@ -220,5 +220,6 @@ MACHINE_START(LUBBOCK, "Intel DBPXA250 Development Platform (aka Lubbock)")
 	BOOT_MEM(0xa0000000, 0x40000000, io_p2v(0x40000000))
 	MAPIO(lubbock_map_io)
 	INITIRQ(lubbock_init_irq)
+	INITTIME(pxa_init_time)
 	INIT_MACHINE(lubbock_init)
 MACHINE_END
diff --git a/arch/arm/mach-pxa/mainstone.c b/arch/arm/mach-pxa/mainstone.c
index 663c1eef8..155b5950e 100644
--- a/arch/arm/mach-pxa/mainstone.c
+++ b/arch/arm/mach-pxa/mainstone.c
@@ -18,6 +18,7 @@
 #include <linux/interrupt.h>
 #include <linux/sched.h>
 #include <linux/bitops.h>
+#include <linux/fb.h>
 
 #include <asm/types.h>
 #include <asm/setup.h>
@@ -31,6 +32,7 @@
 #include <asm/mach/irq.h>
 
 #include <asm/arch/mainstone.h>
+#include <asm/arch/pxafb.h>
 
 #include "generic.h"
 
@@ -116,9 +118,67 @@ static struct platform_device smc91x_device = {
 	.resource	= smc91x_resources,
 };
 
+
+static void mainstone_backlight_power(int on)
+{
+	if (on) {
+		pxa_gpio_mode(GPIO16_PWM0_MD);
+		pxa_set_cken(CKEN0_PWM0, 1);
+		PWM_CTRL0 = 0;
+		PWM_PWDUTY0 = 0x3ff;
+		PWM_PERVAL0 = 0x3ff;
+	} else {
+		PWM_CTRL0 = 0;
+		PWM_PWDUTY0 = 0x0;
+		PWM_PERVAL0 = 0x3FF;
+		pxa_set_cken(CKEN0_PWM0, 0);
+	}
+}
+
+static struct pxafb_mach_info toshiba_ltm04c380k __initdata = {
+	.pixclock		= 50000,
+	.xres			= 640,
+	.yres			= 480,
+	.bpp			= 16,
+	.hsync_len		= 1,
+	.left_margin		= 0x9f,
+	.right_margin		= 1,
+	.vsync_len		= 44,
+	.upper_margin		= 0,
+	.lower_margin		= 0,
+	.sync			= FB_SYNC_HOR_HIGH_ACT|FB_SYNC_VERT_HIGH_ACT,
+	.lccr0			= LCCR0_Act,
+	.lccr3			= LCCR3_PCP,
+	.pxafb_backlight_power	= mainstone_backlight_power,
+};
+
+static struct pxafb_mach_info toshiba_ltm035a776c __initdata = {
+	.pixclock		= 110000,
+	.xres			= 240,
+	.yres			= 320,
+	.bpp			= 16,
+	.hsync_len		= 4,
+	.left_margin		= 8,
+	.right_margin		= 20,
+	.vsync_len		= 3,
+	.upper_margin		= 1,
+	.lower_margin		= 10,
+	.sync			= FB_SYNC_HOR_HIGH_ACT|FB_SYNC_VERT_HIGH_ACT,
+	.lccr0			= LCCR0_Act,
+	.lccr3			= LCCR3_PCP,
+	.pxafb_backlight_power	= mainstone_backlight_power,
+};
+
 static void __init mainstone_init(void)
 {
-	platform_add_device(&smc91x_device);
+	platform_device_register(&smc91x_device);
+
+	/* reading Mainstone's "Virtual Configuration Register"
+	   might be handy to select LCD type here */
+	if (0)
+		set_pxa_fb_info(&toshiba_ltm04c380k);
+	else
+		set_pxa_fb_info(&toshiba_ltm035a776c);
 }
 
 
@@ -137,5 +197,6 @@ MACHINE_START(MAINSTONE, "Intel HCDDBBVA0 Development Platform (aka Mainstone)")
 	BOOT_MEM(0xa0000000, 0x40000000, io_p2v(0x40000000))
 	MAPIO(mainstone_map_io)
 	INITIRQ(mainstone_init_irq)
+	INITTIME(pxa_init_time)
 	INIT_MACHINE(mainstone_init)
 MACHINE_END
diff --git a/arch/arm/mach-rpc/riscpc.c b/arch/arm/mach-rpc/riscpc.c
index f45e28116..d5a1a3af2 100644
--- a/arch/arm/mach-rpc/riscpc.c
+++ b/arch/arm/mach-rpc/riscpc.c
@@ -14,6 +14,8 @@
 #include <linux/delay.h>
 #include <linux/pm.h>
 #include <linux/init.h>
+#include <linux/sched.h>
+#include <linux/interrupt.h>
 
 #include <asm/elf.h>
 #include <asm/io.h>
@@ -25,6 +27,7 @@
 
 #include <asm/mach/map.h>
 #include <asm/mach/arch.h>
+#include <asm/mach/time.h>
 
 extern void rpc_init_irq(void);
 
@@ -82,6 +85,31 @@ void __init rpc_map_io(void)
 	elf_hwcap &= ~HWCAP_HALF;
 }
 
+static irqreturn_t
+rpc_timer_interrupt(int irq, void *dev_id, struct pt_regs *regs)
+{
+	timer_tick(regs);
+
+	return IRQ_HANDLED;
+}
+
+static struct irqaction rpc_timer_irq = {
+	.name		= "RiscPC Timer Tick",
+	.flags		= SA_INTERRUPT,
+	.handler	= rpc_timer_interrupt
+};
+
+/*
+ * Set up timer interrupt.
+ */
+void __init rpc_init_time(void)
+{
+	extern void ioctime_init(void);
+	ioctime_init();
+
+	setup_irq(IRQ_TIMER, &rpc_timer_irq);
+}
+
 MACHINE_START(RISCPC, "Acorn-RiscPC")
 	MAINTAINER("Russell King")
 	BOOT_MEM(0x10000000, 0x03000000, 0xe0000000)
@@ -90,4 +118,5 @@ MACHINE_START(RISCPC, "Acorn-RiscPC")
 	DISABLE_PARPORT(1)
 	MAPIO(rpc_map_io)
 	INITIRQ(rpc_init_irq)
+	INITTIME(rpc_init_time)
 MACHINE_END
diff --git a/arch/arm/mach-s3c2410/Kconfig b/arch/arm/mach-s3c2410/Kconfig
index b71f89e11..40e78bc44 100644
--- a/arch/arm/mach-s3c2410/Kconfig
+++ b/arch/arm/mach-s3c2410/Kconfig
@@ -23,9 +23,12 @@ config ARCH_SMDK2410
            <http://www.fsforth.de>
 
 config MACH_VR1000
-	bool "Simtec VR1000"
+	bool "Thorcom VR1000"
 	help
-	  Say Y here if you are using the Simtec VR1000 board.
+	  Say Y here if you are using the Thorcom VR1000 board.
+
+	  This linux port is currently being maintained by Simtec, on behalf
+	  of Thorcom. Any queries, please contact Thorcom first.
 
 endmenu
 
diff --git a/arch/arm/mach-s3c2410/Makefile b/arch/arm/mach-s3c2410/Makefile
index d36316999..476c6ca78 100644
--- a/arch/arm/mach-s3c2410/Makefile
+++ b/arch/arm/mach-s3c2410/Makefile
@@ -4,7 +4,7 @@
 
 # Object file lists.
 
-obj-y			:= s3c2410.o irq.o
+obj-y			:= s3c2410.o irq.o time.o gpio.o
 obj-m			:=
 obj-n			:=
 obj-			:=
diff --git a/arch/arm/mach-s3c2410/mach-bast.c b/arch/arm/mach-s3c2410/mach-bast.c
index c1f566f31..2268ab3c7 100644
--- a/arch/arm/mach-s3c2410/mach-bast.c
+++ b/arch/arm/mach-s3c2410/mach-bast.c
@@ -185,10 +185,16 @@ void __init bast_init_irq(void)
 
 }
 
+void __init bast_init_time(void)
+{
+	s3c2410_init_time();
+}
+
 MACHINE_START(BAST, "Simtec-BAST")
      MAINTAINER("Ben Dooks <ben@simtec.co.uk>")
      BOOT_MEM(S3C2410_SDRAM_PA, S3C2410_PA_UART, S3C2410_VA_UART)
      BOOT_PARAMS(S3C2410_SDRAM_PA + 0x100)
      MAPIO(bast_map_io)
      INITIRQ(bast_init_irq)
+     INITTIME(bast_init_time)
 MACHINE_END
diff --git a/arch/arm/mach-s3c2410/mach-h1940.c b/arch/arm/mach-s3c2410/mach-h1940.c
index a66b451ec..0a9ba135b 100644
--- a/arch/arm/mach-s3c2410/mach-h1940.c
+++ b/arch/arm/mach-s3c2410/mach-h1940.c
@@ -52,7 +52,7 @@ static struct s3c2410_uartcfg ipaq_uartcfgs[] = {
 	[0] = {
 		.hwport	     = 0,
 		.flags	     = 0,
-		.clock	     = &s3c2410_hclk,
+		.clock	     = &s3c2410_pclk,
 		.ucon	     = 0x3c5,
 		.ulcon	     = 0x03,
 		.ufcon	     = 0x51,
@@ -60,7 +60,7 @@ static struct s3c2410_uartcfg ipaq_uartcfgs[] = {
 	[1] = {
 		.hwport	     = 1,
 		.flags	     = 0,
-		.clock	     = &s3c2410_hclk,
+		.clock	     = &s3c2410_pclk,
 		.ucon	     = 0x245,
 		.ulcon	     = 0x03,
 		.ufcon	     = 0x00,
@@ -69,7 +69,7 @@ static struct s3c2410_uartcfg ipaq_uartcfgs[] = {
 	[2] = {
 		.hwport	     = 2,
 		.flags	     = 0,
-		.clock	     = &s3c2410_hclk,
+		.clock	     = &s3c2410_pclk,
 		.ucon	     = 0x3c5,
 		.ulcon	     = 0x43,
 		.ufcon	     = 0x51,
@@ -91,10 +91,16 @@ void __init ipaq_init_irq(void)
 
 }
 
+void __init ipaq_init_time(void)
+{
+	s3c2410_init_time();
+}
+
 MACHINE_START(H1940, "IPAQ-H1940")
      MAINTAINER("Ben Dooks <ben@fluff.org>")
      BOOT_MEM(S3C2410_SDRAM_PA, S3C2410_PA_UART, S3C2410_VA_UART)
      BOOT_PARAMS(S3C2410_SDRAM_PA + 0x100)
      MAPIO(ipaq_map_io)
      INITIRQ(ipaq_init_irq)
+     INITTIME(ipaq_init_time)
 MACHINE_END
diff --git a/arch/arm/mach-s3c2410/mach-smdk2410.c b/arch/arm/mach-s3c2410/mach-smdk2410.c
index 4e0282b12..bfadbd425 100644
--- a/arch/arm/mach-s3c2410/mach-smdk2410.c
+++ b/arch/arm/mach-s3c2410/mach-smdk2410.c
@@ -99,6 +99,11 @@ void __init smdk2410_init_irq(void)
 	s3c2410_init_irq();
 }
 
+void __init smdk2410_init_time(void)
+{
+	s3c2410_init_time();
+}
+
 MACHINE_START(SMDK2410, "SMDK2410") /* @TODO: request a new identifier and switch
 				    * to SMDK2410 */
      MAINTAINER("Jonas Dietsche")
@@ -106,4 +111,5 @@ MACHINE_START(SMDK2410, "SMDK2410") /* @TODO: request a new identifier and switc
      BOOT_PARAMS(S3C2410_SDRAM_PA + 0x100)
      MAPIO(smdk2410_map_io)
      INITIRQ(smdk2410_init_irq)
+     INITTIME(smdk2410_init_time)
 MACHINE_END
diff --git a/arch/arm/mach-s3c2410/mach-vr1000.c b/arch/arm/mach-s3c2410/mach-vr1000.c
index 1758422da..aae341c69 100644
--- a/arch/arm/mach-s3c2410/mach-vr1000.c
+++ b/arch/arm/mach-s3c2410/mach-vr1000.c
@@ -1,15 +1,18 @@
 /* linux/arch/arm/mach-s3c2410/mach-vr1000.c
  *
- * Copyright (c) 2003 Simtec Electronics
+ * Copyright (c) 2003,2004 Simtec Electronics
  *   Ben Dooks <ben@simtec.co.uk>
  *
- * http://www.simtec.co.uk/
+ * Machine support for Thorcom VR1000 board. Designed for Thorcom by
+ * Simtec Electronics, http://www.simtec.co.uk/
  *
  * 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.
  *
  * Modifications:
+ *     06-Aug-2004 BJD  Fixed call to time initialisation
+ *     12-Jul-2004 BJD  Renamed machine
  *     16-May-2003 BJD  Created initial version
  *     16-Aug-2003 BJD  Fixed header files and copyright, added URL
  *     05-Sep-2003 BJD  Moved to v2.6 kernel
@@ -155,10 +158,16 @@ void __init vr1000_init_irq(void)
 
 }
 
-MACHINE_START(VR1000, "Simtec-VR1000")
+void __init vr1000_init_time(void)
+{
+	s3c2410_init_time();
+}
+
+MACHINE_START(VR1000, "Thorcom-VR1000")
      MAINTAINER("Ben Dooks <ben@simtec.co.uk>")
      BOOT_MEM(S3C2410_SDRAM_PA, S3C2410_PA_UART, S3C2410_VA_UART)
      BOOT_PARAMS(S3C2410_SDRAM_PA + 0x100)
      MAPIO(vr1000_map_io)
      INITIRQ(vr1000_init_irq)
+     INITTIME(vr1000_init_time)
 MACHINE_END
diff --git a/arch/arm/mach-s3c2410/s3c2410.h b/arch/arm/mach-s3c2410/s3c2410.h
index 80c336caa..862a7c86d 100644
--- a/arch/arm/mach-s3c2410/s3c2410.h
+++ b/arch/arm/mach-s3c2410/s3c2410.h
@@ -4,3 +4,5 @@ extern void s3c2410_map_io(struct map_desc *, int count);
 
 extern void s3c2410_init_irq(void);
 
+extern void s3c2410_init_time(void);
+
diff --git a/arch/arm/mach-sa1100/Kconfig b/arch/arm/mach-sa1100/Kconfig
index ce21b9838..b586220d7 100644
--- a/arch/arm/mach-sa1100/Kconfig
+++ b/arch/arm/mach-sa1100/Kconfig
@@ -57,6 +57,12 @@ config SA1100_CERF_FLASH_32MB
 
 endchoice
 
+config SA1100_COLLIE
+	bool "Sharp Zaurus SL5500"
+	depends on ARCH_SA1100
+	help
+	  Say Y here to support the Sharp Zaurus SL5500 PDAs.
+
 config SA1100_H3100
 	bool "Compaq iPAQ H3100"
 	help
diff --git a/arch/arm/mach-sa1100/Makefile b/arch/arm/mach-sa1100/Makefile
index 0193b4bd3..898f27891 100644
--- a/arch/arm/mach-sa1100/Makefile
+++ b/arch/arm/mach-sa1100/Makefile
@@ -3,7 +3,7 @@
 #
 
 # Common support
-obj-y := generic.o irq.o dma.o
+obj-y := generic.o irq.o dma.o time.o
 obj-m :=
 obj-n :=
 obj-  :=
@@ -29,6 +29,8 @@ led-$(CONFIG_SA1100_BRUTUS)		+= leds-brutus.o
 obj-$(CONFIG_SA1100_CERF)		+= cerf.o
 led-$(CONFIG_SA1100_CERF)		+= leds-cerf.o
 
+obj-$(CONFIG_SA1100_COLLIE)		+= collie.o
+
 obj-$(CONFIG_SA1100_EMPEG)		+= empeg.o
 
 obj-$(CONFIG_SA1100_FLEXANET)		+= flexanet.o
diff --git a/arch/arm/mach-sa1100/adsbitsy.c b/arch/arm/mach-sa1100/adsbitsy.c
index d028a87ce..53f990e7d 100644
--- a/arch/arm/mach-sa1100/adsbitsy.c
+++ b/arch/arm/mach-sa1100/adsbitsy.c
@@ -147,4 +147,5 @@ MACHINE_START(ADSBITSY, "ADS Bitsy")
 	BOOT_MEM(0xc0000000, 0x80000000, 0xf8000000)
 	MAPIO(adsbitsy_map_io)
 	INITIRQ(adsbitsy_init_irq)
+	INITTIME(sa1100_init_time)
 MACHINE_END
diff --git a/arch/arm/mach-sa1100/assabet.c b/arch/arm/mach-sa1100/assabet.c
index dcd32454e..e5098cf9c 100644
--- a/arch/arm/mach-sa1100/assabet.c
+++ b/arch/arm/mach-sa1100/assabet.c
@@ -324,5 +324,6 @@ MACHINE_START(ASSABET, "Intel-Assabet")
 	FIXUP(fixup_assabet)
 	MAPIO(assabet_map_io)
 	INITIRQ(sa1100_init_irq)
+	INITTIME(sa1100_init_time)
 	INIT_MACHINE(assabet_init)
 MACHINE_END
diff --git a/arch/arm/mach-sa1100/badge4.c b/arch/arm/mach-sa1100/badge4.c
index 71d9e165a..cef71047c 100644
--- a/arch/arm/mach-sa1100/badge4.c
+++ b/arch/arm/mach-sa1100/badge4.c
@@ -245,4 +245,5 @@ MACHINE_START(BADGE4, "Hewlett-Packard Laboratories BadgePAD 4")
 	BOOT_PARAMS(0xc0000100)
 	MAPIO(badge4_map_io)
 	INITIRQ(sa1100_init_irq)
+	INITTIME(sa1100_init_time)
 MACHINE_END
diff --git a/arch/arm/mach-sa1100/brutus.c b/arch/arm/mach-sa1100/brutus.c
index fdfe024b1..925bf0e59 100644
--- a/arch/arm/mach-sa1100/brutus.c
+++ b/arch/arm/mach-sa1100/brutus.c
@@ -37,4 +37,5 @@ MACHINE_START(BRUTUS, "Intel Brutus (SA1100 eval board)")
 	BOOT_MEM(0xc0000000, 0x80000000, 0xf8000000)
 	MAPIO(brutus_map_io)
 	INITIRQ(sa1100_init_irq)
+	INITTIME(sa1100_init_time)
 MACHINE_END
diff --git a/arch/arm/mach-sa1100/cerf.c b/arch/arm/mach-sa1100/cerf.c
index 00af122c4..2c4c05013 100644
--- a/arch/arm/mach-sa1100/cerf.c
+++ b/arch/arm/mach-sa1100/cerf.c
@@ -92,4 +92,5 @@ MACHINE_START(CERF, "Intrinsyc CerfBoard/CerfCube")
 	BOOT_MEM(0xc0000000, 0x80000000, 0xf8000000)
 	MAPIO(cerf_map_io)
 	INITIRQ(cerf_init_irq)
+	INITTIME(sa1100_init_time)
 MACHINE_END
diff --git a/arch/arm/mach-sa1100/collie.c b/arch/arm/mach-sa1100/collie.c
index dcbb3c751..23bf73ef8 100644
--- a/arch/arm/mach-sa1100/collie.c
+++ b/arch/arm/mach-sa1100/collie.c
@@ -141,4 +141,5 @@ MACHINE_START(COLLIE, "Sharp-Collie")
 	MAPIO(collie_map_io)
 	INITIRQ(sa1100_init_irq)
 	INIT_MACHINE(collie_init)
+	INITTIME(sa1100_init_time)
 MACHINE_END
diff --git a/arch/arm/mach-sa1100/empeg.c b/arch/arm/mach-sa1100/empeg.c
index b1faaa92f..6ab57cdb0 100644
--- a/arch/arm/mach-sa1100/empeg.c
+++ b/arch/arm/mach-sa1100/empeg.c
@@ -35,4 +35,5 @@ MACHINE_START(EMPEG, "empeg MP3 Car Audio Player")
 	BOOT_MEM(0xc0000000, 0x80000000, 0xf8000000)
 	MAPIO(empeg_map_io)
 	INITIRQ(sa1100_init_irq)
+	INITTIME(sa1100_init_time)
 MACHINE_END
diff --git a/arch/arm/mach-sa1100/flexanet.c b/arch/arm/mach-sa1100/flexanet.c
index 0a40c7831..370df9f77 100644
--- a/arch/arm/mach-sa1100/flexanet.c
+++ b/arch/arm/mach-sa1100/flexanet.c
@@ -183,5 +183,6 @@ MACHINE_START(FLEXANET, "FlexaNet")
 	BOOT_PARAMS(0xc0000100)
 	MAPIO(flexanet_map_io)
 	INITIRQ(sa1100_init_irq)
+	INITTIME(sa1100_init_time)
 MACHINE_END
 
diff --git a/arch/arm/mach-sa1100/freebird.c b/arch/arm/mach-sa1100/freebird.c
index 5363d02ee..abd27aef7 100644
--- a/arch/arm/mach-sa1100/freebird.c
+++ b/arch/arm/mach-sa1100/freebird.c
@@ -77,4 +77,5 @@ MACHINE_START(FREEBIRD, "Freebird-HPC-1.1")
 #endif
 	MAPIO(freebird_map_io)
 	INITIRQ(sa1100_init_irq)
+	INITTIME(sa1100_init_time)
 MACHINE_END
diff --git a/arch/arm/mach-sa1100/generic.h b/arch/arm/mach-sa1100/generic.h
index 4649fc5c5..04bcfeb3b 100644
--- a/arch/arm/mach-sa1100/generic.h
+++ b/arch/arm/mach-sa1100/generic.h
@@ -6,6 +6,7 @@
 
 extern void __init sa1100_map_io(void);
 extern void __init sa1100_init_irq(void);
+extern void __init sa1100_init_time(void);
 
 #define SET_BANK(__nr,__start,__size) \
 	mi->bank[__nr].start = (__start), \
diff --git a/arch/arm/mach-sa1100/graphicsclient.c b/arch/arm/mach-sa1100/graphicsclient.c
index eb420d53a..2f628adbd 100644
--- a/arch/arm/mach-sa1100/graphicsclient.c
+++ b/arch/arm/mach-sa1100/graphicsclient.c
@@ -198,4 +198,5 @@ MACHINE_START(GRAPHICSCLIENT, "ADS GraphicsClient")
 	BOOT_MEM(0xc0000000, 0x80000000, 0xf8000000)
 	MAPIO(graphicsclient_map_io)
 	INITIRQ(graphicsclient_init_irq)
+	INITTIME(sa1100_init_time)
 MACHINE_END
diff --git a/arch/arm/mach-sa1100/graphicsmaster.c b/arch/arm/mach-sa1100/graphicsmaster.c
index 77d84368d..7f1cfd18e 100644
--- a/arch/arm/mach-sa1100/graphicsmaster.c
+++ b/arch/arm/mach-sa1100/graphicsmaster.c
@@ -287,4 +287,5 @@ MACHINE_START(GRAPHICSMASTER, "ADS GraphicsMaster")
 	BOOT_MEM(0xc0000000, 0x80000000, 0xf8000000)
 	MAPIO(graphicsmaster_map_io)
 	INITIRQ(graphicsmaster_init_irq)
+	INITTIME(sa1100_init_time)
 MACHINE_END
diff --git a/arch/arm/mach-sa1100/h3600.c b/arch/arm/mach-sa1100/h3600.c
index 9868d4129..54ab44452 100644
--- a/arch/arm/mach-sa1100/h3600.c
+++ b/arch/arm/mach-sa1100/h3600.c
@@ -286,6 +286,7 @@ MACHINE_START(H3100, "Compaq iPAQ H3100")
 	BOOT_PARAMS(0xc0000100)
 	MAPIO(h3100_map_io)
 	INITIRQ(sa1100_init_irq)
+	INITTIME(sa1100_init_time)
 MACHINE_END
 
 #endif /* CONFIG_SA1100_H3100 */
@@ -400,6 +401,7 @@ MACHINE_START(H3600, "Compaq iPAQ H3600")
 	BOOT_PARAMS(0xc0000100)
 	MAPIO(h3600_map_io)
 	INITIRQ(sa1100_init_irq)
+	INITTIME(sa1100_init_time)
 MACHINE_END
 
 #endif /* CONFIG_SA1100_H3600 */
@@ -783,6 +785,7 @@ MACHINE_START(H3800, "Compaq iPAQ H3800")
 	BOOT_PARAMS(0xc0000100)
 	MAPIO(h3800_map_io)
 	INITIRQ(h3800_init_irq)
+	INITTIME(sa1100_init_time)
 MACHINE_END
 
 #endif /* CONFIG_SA1100_H3800 */
diff --git a/arch/arm/mach-sa1100/hackkit.c b/arch/arm/mach-sa1100/hackkit.c
index e79bb441c..e24be9716 100644
--- a/arch/arm/mach-sa1100/hackkit.c
+++ b/arch/arm/mach-sa1100/hackkit.c
@@ -174,4 +174,5 @@ MACHINE_START(HACKKIT, "HackKit Cpu Board")
 	BOOT_PARAMS(0xc0000100)
 	MAPIO(hackkit_map_io)
 	INITIRQ(sa1100_init_irq)
+	INITTIME(sa1100_init_time)
 MACHINE_END
diff --git a/arch/arm/mach-sa1100/huw_webpanel.c b/arch/arm/mach-sa1100/huw_webpanel.c
index 1ed5f365c..771b10620 100644
--- a/arch/arm/mach-sa1100/huw_webpanel.c
+++ b/arch/arm/mach-sa1100/huw_webpanel.c
@@ -81,4 +81,5 @@ MACHINE_START(HUW_WEBPANEL, "HuW-Webpanel")
 	BOOT_MEM(0xc0000000, 0x80000000, 0xf8000000)
 	MAPIO(huw_webpanel_map_io)
 	INITIRQ(sa1100_init_irq)
+	INITTIME(sa1100_init_time)
 MACHINE_END
diff --git a/arch/arm/mach-sa1100/itsy.c b/arch/arm/mach-sa1100/itsy.c
index 2d23c99c6..a4af8d588 100644
--- a/arch/arm/mach-sa1100/itsy.c
+++ b/arch/arm/mach-sa1100/itsy.c
@@ -37,4 +37,5 @@ MACHINE_START(ITSY, "Compaq Itsy")
 	BOOT_PARAMS(0xc0000100)
 	MAPIO(itsy_map_io)
 	INITIRQ(sa1100_init_irq)
+	INITTIME(sa1100_init_time)
 MACHINE_END
diff --git a/arch/arm/mach-sa1100/jornada720.c b/arch/arm/mach-sa1100/jornada720.c
index c71e51283..8943e816a 100644
--- a/arch/arm/mach-sa1100/jornada720.c
+++ b/arch/arm/mach-sa1100/jornada720.c
@@ -101,4 +101,5 @@ MACHINE_START(JORNADA720, "HP Jornada 720")
 	BOOT_PARAMS(0xc0000100)
 	MAPIO(jornada720_map_io)
 	INITIRQ(sa1100_init_irq)
+	INITTIME(sa1100_init_time)
 MACHINE_END
diff --git a/arch/arm/mach-sa1100/lart.c b/arch/arm/mach-sa1100/lart.c
index 728612961..34ab20118 100644
--- a/arch/arm/mach-sa1100/lart.c
+++ b/arch/arm/mach-sa1100/lart.c
@@ -43,4 +43,5 @@ MACHINE_START(LART, "LART")
 	BOOT_PARAMS(0xc0000100)
 	MAPIO(lart_map_io)
 	INITIRQ(sa1100_init_irq)
+	INITTIME(sa1100_init_time)
 MACHINE_END
diff --git a/arch/arm/mach-sa1100/nanoengine.c b/arch/arm/mach-sa1100/nanoengine.c
index 20b6d9a43..84c870c3d 100644
--- a/arch/arm/mach-sa1100/nanoengine.c
+++ b/arch/arm/mach-sa1100/nanoengine.c
@@ -49,4 +49,5 @@ MACHINE_START(NANOENGINE, "BSE nanoEngine")
 	FIXUP(fixup_nanoengine)
 	MAPIO(nanoengine_map_io)
 	INITIRQ(sa1100_init_irq)
+	INITTIME(sa1100_init_time)
 MACHINE_END
diff --git a/arch/arm/mach-sa1100/omnimeter.c b/arch/arm/mach-sa1100/omnimeter.c
index baa3a0313..1533fc0ff 100644
--- a/arch/arm/mach-sa1100/omnimeter.c
+++ b/arch/arm/mach-sa1100/omnimeter.c
@@ -59,4 +59,5 @@ MACHINE_START(OMNIMETER, "OmniMeter")
 	BOOT_MEM(0xc0000000, 0x80000000, 0xf8000000)
 	MAPIO(omnimeter_map_io)
 	INITIRQ(sa1100_init_irq)
+	INITTIME(sa1100_init_time)
 MACHINE_END
diff --git a/arch/arm/mach-sa1100/pangolin.c b/arch/arm/mach-sa1100/pangolin.c
index f7102f438..29922dd70 100644
--- a/arch/arm/mach-sa1100/pangolin.c
+++ b/arch/arm/mach-sa1100/pangolin.c
@@ -40,4 +40,5 @@ MACHINE_START(PANGOLIN, "Dialogue-Pangolin")
 	BOOT_MEM(0xc0000000, 0x80000000, 0xf8000000)
 	MAPIO(pangolin_map_io)
 	INITIRQ(sa1100_init_irq)
+	INITTIME(sa1100_init_time)
 MACHINE_END
diff --git a/arch/arm/mach-sa1100/pfs168.c b/arch/arm/mach-sa1100/pfs168.c
index 43b89fcc8..04088629f 100644
--- a/arch/arm/mach-sa1100/pfs168.c
+++ b/arch/arm/mach-sa1100/pfs168.c
@@ -112,4 +112,5 @@ MACHINE_START(PFS168, "Tulsa")
 	BOOT_PARAMS(0xc0000100)
 	MAPIO(pfs168_map_io)
 	INITIRQ(pfs168_init_irq)
+	INITTIME(sa1100_init_time)
 MACHINE_END
diff --git a/arch/arm/mach-sa1100/pleb.c b/arch/arm/mach-sa1100/pleb.c
index b0284ff1c..2cdfef622 100644
--- a/arch/arm/mach-sa1100/pleb.c
+++ b/arch/arm/mach-sa1100/pleb.c
@@ -31,4 +31,5 @@ MACHINE_START(PLEB, "PLEB")
 	BOOT_MEM(0xc0000000, 0x80000000, 0xf8000000)
 	MAPIO(pleb_map_io)
 	INITIRQ(sa1100_init_irq)
+	INITTIME(sa1100_init_time)
 MACHINE_END
diff --git a/arch/arm/mach-sa1100/shannon.c b/arch/arm/mach-sa1100/shannon.c
index 0dbe474c7..8bec82676 100644
--- a/arch/arm/mach-sa1100/shannon.c
+++ b/arch/arm/mach-sa1100/shannon.c
@@ -41,4 +41,5 @@ MACHINE_START(SHANNON, "Shannon (AKA: Tuxscreen)")
 	BOOT_PARAMS(0xc0000100)
 	MAPIO(shannon_map_io)
 	INITIRQ(sa1100_init_irq)
+	INITTIME(sa1100_init_time)
 MACHINE_END
diff --git a/arch/arm/mach-sa1100/sherman.c b/arch/arm/mach-sa1100/sherman.c
index c36f46017..2e66fbadf 100644
--- a/arch/arm/mach-sa1100/sherman.c
+++ b/arch/arm/mach-sa1100/sherman.c
@@ -27,4 +27,5 @@ MACHINE_START(SHERMAN, "Blazie Engineering Sherman")
         BOOT_MEM(0xc0000000, 0x80000000, 0xf8000000)
         MAPIO(sherman_map_io)
 	INITIRQ(sa1100_init_irq)
+	INITTIME(sa1100_init_time)
 MACHINE_END
diff --git a/arch/arm/mach-sa1100/simpad.c b/arch/arm/mach-sa1100/simpad.c
index 472174365..b73ec2e18 100644
--- a/arch/arm/mach-sa1100/simpad.c
+++ b/arch/arm/mach-sa1100/simpad.c
@@ -231,4 +231,5 @@ MACHINE_START(SIMPAD, "Simpad")
         BOOT_PARAMS(0xc0000100)
 	MAPIO(simpad_map_io)
 	INITIRQ(sa1100_init_irq)
+	INITTIME(sa1100_init_time)
 MACHINE_END
diff --git a/arch/arm/mach-sa1100/stork.c b/arch/arm/mach-sa1100/stork.c
index 5aeb087c4..f3b3a6eb8 100644
--- a/arch/arm/mach-sa1100/stork.c
+++ b/arch/arm/mach-sa1100/stork.c
@@ -331,6 +331,7 @@ MACHINE_START(STORK, "Stork Technologies prototype")
 	BOOT_PARAMS(0xc0000100)
 	MAPIO(stork_map_io)
 	INITIRQ(sa1100_init_irq)
+	INITTIME(sa1100_init_time)
 MACHINE_END
 
 
diff --git a/arch/arm/mach-sa1100/system3.c b/arch/arm/mach-sa1100/system3.c
index 09f679e4e..76e7d36e7 100644
--- a/arch/arm/mach-sa1100/system3.c
+++ b/arch/arm/mach-sa1100/system3.c
@@ -470,4 +470,5 @@ MACHINE_START(PT_SYSTEM3, "PT System 3")
 	BOOT_PARAMS(0xc0000100)
 	MAPIO(system3_map_io)
 	INITIRQ(sa1100_init_irq)
+	INITTIME(sa1100_init_time)
 MACHINE_END
diff --git a/arch/arm/mach-sa1100/trizeps.c b/arch/arm/mach-sa1100/trizeps.c
index 199d9cfc5..f3f1682ec 100644
--- a/arch/arm/mach-sa1100/trizeps.c
+++ b/arch/arm/mach-sa1100/trizeps.c
@@ -228,4 +228,5 @@ MACHINE_START(TRIZEPS, "TRIZEPS")
 	BOOT_MEM(0xc0000000, 0x80000000, 0xf8000000)
 	MAPIO(trizeps_map_io)
 	INITIRQ(sa1100_init_irq)
+	INITTIME(sa1100_init_time)
 MACHINE_END
diff --git a/arch/arm/mach-sa1100/xp860.c b/arch/arm/mach-sa1100/xp860.c
index 501b1bfe8..ab2a523c3 100644
--- a/arch/arm/mach-sa1100/xp860.c
+++ b/arch/arm/mach-sa1100/xp860.c
@@ -89,4 +89,5 @@ MACHINE_START(XP860, "XP860")
 	BOOT_MEM(0xc0000000, 0x80000000, 0xf8000000)
 	MAPIO(xp860_map_io)
 	INITIRQ(sa1100_init_irq)
+	INITTIME(sa1100_init_time)
 MACHINE_END
diff --git a/arch/arm/mach-sa1100/yopy.c b/arch/arm/mach-sa1100/yopy.c
index fd9df1bc9..46e447fc8 100644
--- a/arch/arm/mach-sa1100/yopy.c
+++ b/arch/arm/mach-sa1100/yopy.c
@@ -91,4 +91,5 @@ MACHINE_START(YOPY, "Yopy")
 	BOOT_PARAMS(0xc0000100)
 	MAPIO(yopy_map_io)
 	INITIRQ(sa1100_init_irq)
+	INITTIME(sa1100_init_time)
 MACHINE_END
diff --git a/arch/arm/mach-shark/core.c b/arch/arm/mach-shark/core.c
index fed8a03dd..e4ae68889 100644
--- a/arch/arm/mach-shark/core.c
+++ b/arch/arm/mach-shark/core.c
@@ -5,13 +5,18 @@
  */
 #include <linux/kernel.h>
 #include <linux/init.h>
+#include <linux/interrupt.h>
+#include <linux/sched.h>
 
 #include <asm/setup.h>
 #include <asm/mach-types.h>
 #include <asm/io.h>
+#include <asm/leds.h>
+#include <asm/param.h>
 
 #include <asm/mach/map.h>
 #include <asm/mach/arch.h>
+#include <asm/mach/time.h>
 
 extern void shark_init_irq(void);
 
@@ -24,10 +29,43 @@ static void __init shark_map_io(void)
 	iotable_init(shark_io_desc, ARRAY_SIZE(shark_io_desc));
 }
 
+#define IRQ_TIMER 0
+#define HZ_TIME ((1193180 + HZ/2) / HZ)
+
+static irqreturn_t
+shark_timer_interrupt(int irq, void *dev_id, struct pt_regs *regs)
+{
+	timer_tick(regs);
+
+	return IRQ_HANDLED;
+}
+
+static struct irqaction shark_timer_irq = {
+	.name		= "Shark Timer Tick",
+	.flags		= SA_INTERRUPT,
+	.handler	= shark_timer_interrupt
+};
+
+/*
+ * Set up timer interrupt, and return the current time in seconds.
+ */
+void __init shark_init_time(void)
+{
+        unsigned long flags;
+
+	outb(0x34, 0x43);               /* binary, mode 0, LSB/MSB, Ch 0 */
+	outb(HZ_TIME & 0xff, 0x40);     /* LSB of count */
+	outb(HZ_TIME >> 8, 0x40);
+
+	setup_irq(IRQ_TIMER, &shark_timer_irq);
+}
+
+
 MACHINE_START(SHARK, "Shark")
 	MAINTAINER("Alexander Schulz")
 	BOOT_MEM(0x08000000, 0x40000000, 0xe0000000)
 	BOOT_PARAMS(0x08003000)
 	MAPIO(shark_map_io)
 	INITIRQ(shark_init_irq)
+	INITTIME(shark_init_time)
 MACHINE_END
diff --git a/arch/arm/mach-versatile/Makefile b/arch/arm/mach-versatile/Makefile
index fbf6db8a2..ff886e33e 100644
--- a/arch/arm/mach-versatile/Makefile
+++ b/arch/arm/mach-versatile/Makefile
@@ -2,4 +2,4 @@
 # Makefile for the linux kernel.
 #
 
-obj-y					:= core.o
+obj-y					:= core.o clock.o
diff --git a/arch/arm/mach-versatile/clock.c b/arch/arm/mach-versatile/clock.c
index c1f91fad8..a13253692 100644
--- a/arch/arm/mach-versatile/clock.c
+++ b/arch/arm/mach-versatile/clock.c
@@ -97,7 +97,7 @@ int clk_set_rate(struct clk *clk, unsigned long rate)
 		ret = 0;
 	}
 #endif
-	return 0;
+	return ret;
 }
 EXPORT_SYMBOL(clk_set_rate);
 
diff --git a/arch/arm/mach-versatile/core.c b/arch/arm/mach-versatile/core.c
index 4c8646c62..285ca9abb 100644
--- a/arch/arm/mach-versatile/core.c
+++ b/arch/arm/mach-versatile/core.c
@@ -22,7 +22,9 @@
 #include <linux/init.h>
 #include <linux/device.h>
 #include <linux/sysdev.h>
+#include <linux/interrupt.h>
 
+#include <asm/system.h>
 #include <asm/hardware.h>
 #include <asm/io.h>
 #include <asm/irq.h>
@@ -33,6 +35,7 @@
 #include <asm/mach/arch.h>
 #include <asm/mach/flash.h>
 #include <asm/mach/irq.h>
+#include <asm/mach/time.h>
 #include <asm/mach/map.h>
 #ifdef CONFIG_MMC
 #include <asm/mach/mmc.h>
@@ -312,13 +315,11 @@ static unsigned int mmc_status(struct device *dev)
 }
 
 static struct mmc_platform_data mmc0_plat_data = {
-	.mclk		= 33000000,
 	.ocr_mask	= MMC_VDD_32_33|MMC_VDD_33_34,
 	.status		= mmc_status,
 };
 
 static struct mmc_platform_data mmc1_plat_data = {
-	.mclk		= 33000000,
 	.ocr_mask	= MMC_VDD_32_33|MMC_VDD_33_34,
 	.status		= mmc_status,
 };
@@ -500,8 +501,8 @@ static void __init versatile_init(void)
 {
 	int i;
 
-	platform_add_device(&versatile_flash_device);
-	platform_add_device(&smc91x_device);
+	platform_device_register(&versatile_flash_device);
+	platform_device_register(&smc91x_device);
 
 	for (i = 0; i < ARRAY_SIZE(amba_devs); i++) {
 		struct amba_device *d = amba_devs[i];
@@ -511,11 +512,153 @@ static void __init versatile_init(void)
 	leds_event = versatile_leds_event;
 }
 
+/*
+ * Where is the timer (VA)?
+ */
+#define TIMER0_VA_BASE		 IO_ADDRESS(VERSATILE_TIMER0_1_BASE)
+#define TIMER1_VA_BASE		(IO_ADDRESS(VERSATILE_TIMER0_1_BASE) + 0x20)
+#define TIMER2_VA_BASE		 IO_ADDRESS(VERSATILE_TIMER2_3_BASE)
+#define TIMER3_VA_BASE		(IO_ADDRESS(VERSATILE_TIMER2_3_BASE) + 0x20)
+#define VA_IC_BASE		 IO_ADDRESS(VERSATILE_VIC_BASE) 
+
+/*
+ * How long is the timer interval?
+ */
+#define TIMER_INTERVAL	(TICKS_PER_uSEC * mSEC_10)
+#if TIMER_INTERVAL >= 0x100000
+#define TIMER_RELOAD	(TIMER_INTERVAL >> 8)		/* Divide by 256 */
+#define TIMER_CTRL	0x88				/* Enable, Clock / 256 */
+#define TICKS2USECS(x)	(256 * (x) / TICKS_PER_uSEC)
+#elif TIMER_INTERVAL >= 0x10000
+#define TIMER_RELOAD	(TIMER_INTERVAL >> 4)		/* Divide by 16 */
+#define TIMER_CTRL	0x84				/* Enable, Clock / 16 */
+#define TICKS2USECS(x)	(16 * (x) / TICKS_PER_uSEC)
+#else
+#define TIMER_RELOAD	(TIMER_INTERVAL)
+#define TIMER_CTRL	0x80				/* Enable */
+#define TICKS2USECS(x)	((x) / TICKS_PER_uSEC)
+#endif
+
+#define TIMER_CTRL_IE	(1 << 5)	/* Interrupt Enable */
+
+/*
+ * What does it look like?
+ */
+typedef struct TimerStruct {
+	unsigned long TimerLoad;
+	unsigned long TimerValue;
+	unsigned long TimerControl;
+	unsigned long TimerClear;
+} TimerStruct_t;
+
+extern unsigned long (*gettimeoffset)(void);
+
+/*
+ * Returns number of ms since last clock interrupt.  Note that interrupts
+ * will have been disabled by do_gettimeoffset()
+ */
+static unsigned long versatile_gettimeoffset(void)
+{
+	volatile TimerStruct_t *timer0 = (TimerStruct_t *)TIMER0_VA_BASE;
+	unsigned long ticks1, ticks2, status;
+
+	/*
+	 * Get the current number of ticks.  Note that there is a race
+	 * condition between us reading the timer and checking for
+	 * an interrupt.  We get around this by ensuring that the
+	 * counter has not reloaded between our two reads.
+	 */
+	ticks2 = timer0->TimerValue & 0xffff;
+	do {
+		ticks1 = ticks2;
+		status = __raw_readl(VA_IC_BASE + VIC_IRQ_RAW_STATUS);
+		ticks2 = timer0->TimerValue & 0xffff;
+	} while (ticks2 > ticks1);
+
+	/*
+	 * Number of ticks since last interrupt.
+	 */
+	ticks1 = TIMER_RELOAD - ticks2;
+
+	/*
+	 * Interrupt pending?  If so, we've reloaded once already.
+	 *
+	 * FIXME: Need to check this is effectively timer 0 that expires
+	 */
+	if (status & IRQMASK_TIMERINT0_1)
+		ticks1 += TIMER_RELOAD;
+
+	/*
+	 * Convert the ticks to usecs
+	 */
+	return TICKS2USECS(ticks1);
+}
+
+/*
+ * IRQ handler for the timer
+ */
+static irqreturn_t versatile_timer_interrupt(int irq, void *dev_id, struct pt_regs *regs)
+{
+	volatile TimerStruct_t *timer0 = (volatile TimerStruct_t *)TIMER0_VA_BASE;
+
+	// ...clear the interrupt
+	timer0->TimerClear = 1;
+
+	timer_tick(regs);
+
+	return IRQ_HANDLED;
+}
+
+static struct irqaction versatile_timer_irq = {
+	.name		= "Versatile Timer Tick",
+	.flags		= SA_INTERRUPT,
+	.handler	= versatile_timer_interrupt
+};
+
+/*
+ * Set up timer interrupt, and return the current time in seconds.
+ */
+void __init versatile_init_time(void)
+{
+	volatile TimerStruct_t *timer0 = (volatile TimerStruct_t *)TIMER0_VA_BASE;
+	volatile TimerStruct_t *timer1 = (volatile TimerStruct_t *)TIMER1_VA_BASE;
+	volatile TimerStruct_t *timer2 = (volatile TimerStruct_t *)TIMER2_VA_BASE;
+	volatile TimerStruct_t *timer3 = (volatile TimerStruct_t *)TIMER3_VA_BASE;
+
+	/* 
+	 * set clock frequency: 
+	 *	VERSATILE_REFCLK is 32KHz
+	 *	VERSATILE_TIMCLK is 1MHz
+	 */
+	*(volatile unsigned int *)IO_ADDRESS(VERSATILE_SCTL_BASE) |= 
+	  ((VERSATILE_TIMCLK << VERSATILE_TIMER1_EnSel) | (VERSATILE_TIMCLK << VERSATILE_TIMER2_EnSel) | 
+	   (VERSATILE_TIMCLK << VERSATILE_TIMER3_EnSel) | (VERSATILE_TIMCLK << VERSATILE_TIMER4_EnSel));
+
+	/*
+	 * Initialise to a known state (all timers off)
+	 */
+	timer0->TimerControl = 0;
+	timer1->TimerControl = 0;
+	timer2->TimerControl = 0;
+	timer3->TimerControl = 0;
+
+	timer0->TimerLoad    = TIMER_RELOAD;
+	timer0->TimerValue   = TIMER_RELOAD;
+	timer0->TimerControl = TIMER_CTRL | 0x40 | TIMER_CTRL_IE;  /* periodic + IE */
+
+	/* 
+	 * Make irqs happen for the system timer
+	 */
+	setup_irq(IRQ_TIMERINT0_1, &versatile_timer_irq);
+	gettimeoffset = versatile_gettimeoffset;
+}
+
 MACHINE_START(VERSATILE_PB, "ARM-Versatile PB")
 	MAINTAINER("ARM Ltd/Deep Blue Solutions Ltd")
 	BOOT_MEM(0x00000000, 0x101f1000, 0xf11f1000)
 	BOOT_PARAMS(0x00000100)
 	MAPIO(versatile_map_io)
 	INITIRQ(versatile_init_irq)
+	INITTIME(versatile_init_time)
 	INIT_MACHINE(versatile_init)
 MACHINE_END
diff --git a/arch/arm/mm/Kconfig b/arch/arm/mm/Kconfig
index ba32817ad..545a548b1 100644
--- a/arch/arm/mm/Kconfig
+++ b/arch/arm/mm/Kconfig
@@ -220,7 +220,7 @@ config CPU_SA1100
 # XScale
 config CPU_XSCALE
 	bool
-	depends on ARCH_IOP3XX || ARCH_ADIFCC || ARCH_PXA || ARCH_IXP4XX
+	depends on ARCH_IOP3XX || ARCH_PXA || ARCH_IXP4XX
 	default y
 	select CPU_32v5
 	select CPU_ABRT_EV5T
diff --git a/arch/arm/mm/blockops.c b/arch/arm/mm/blockops.c
index 9982c4c8c..806c6eeb1 100644
--- a/arch/arm/mm/blockops.c
+++ b/arch/arm/mm/blockops.c
@@ -130,6 +130,7 @@ static struct undef_hook blockops_hook __initdata = {
 static int __init blockops_check(void)
 {
 	register unsigned int err asm("r4") = 0;
+	unsigned int err_pos = 1;
 	unsigned int cache_type;
 	int i;
 
@@ -156,8 +157,8 @@ static int __init blockops_check(void)
 
 	unregister_undef_hook(&blockops_hook);
 
-	for (i = 0; i < ARRAY_SIZE(func); i++, err >>= 1)
-		printk("%30s: %ssupported\n", func[i], err & 1 ? "not " : "");
+	for (i = 0; i < ARRAY_SIZE(func); i++, err_pos <<= 1)
+		printk("%30s: %ssupported\n", func[i], err & err_pos ? "not " : "");
 
 	if ((err & 8) == 0) {
 		printk(" --> Using %s block cache invalidate\n",
diff --git a/arch/arm/mm/consistent.c b/arch/arm/mm/consistent.c
index 7d3fb20ea..f9b8fe2c7 100644
--- a/arch/arm/mm/consistent.c
+++ b/arch/arm/mm/consistent.c
@@ -194,7 +194,7 @@ __dma_alloc(struct device *dev, size_t size, dma_addr_t *handle, int gfp,
 		/*
 		 * Set the "dma handle"
 		 */
-		*handle = page_to_bus(page);
+		*handle = page_to_dma(dev, page);
 
 		do {
 			BUG_ON(!pte_none(*pte));
diff --git a/arch/arm/mm/fault.c b/arch/arm/mm/fault.c
index c00061769..29be1c018 100644
--- a/arch/arm/mm/fault.c
+++ b/arch/arm/mm/fault.c
@@ -66,9 +66,7 @@ void show_pte(struct mm_struct *mm, unsigned long addr)
 		/* We must not map this if we have highmem enabled */
 		pte = pte_offset_map(pmd, addr);
 		printk(", *pte=%08lx", pte_val(*pte));
-#ifdef CONFIG_CPU_32
 		printk(", *ppte=%08lx", pte_val(pte[-PTRS_PER_PTE]));
-#endif
 		pte_unmap(pte);
 #endif
 	} while(0);
@@ -129,7 +127,7 @@ __do_user_fault(struct task_struct *tsk, unsigned long addr,
 	si.si_signo = SIGSEGV;
 	si.si_errno = 0;
 	si.si_code = code;
-	si.si_addr = (void *)addr;
+	si.si_addr = (void __user *)addr;
 	force_sig_info(SIGSEGV, &si, tsk);
 }
 
diff --git a/arch/arm/mm/init.c b/arch/arm/mm/init.c
index 07ddce798..060fea2e1 100644
--- a/arch/arm/mm/init.c
+++ b/arch/arm/mm/init.c
@@ -24,13 +24,7 @@
 #include <asm/mach/arch.h>
 #include <asm/mach/map.h>
 
-#ifdef CONFIG_CPU_32
-#define TABLE_OFFSET	(PTRS_PER_PTE)
-#else
-#define TABLE_OFFSET	0
-#endif
-
-#define TABLE_SIZE	((TABLE_OFFSET + PTRS_PER_PTE) * sizeof(pte_t))
+#define TABLE_SIZE	(2 * PTRS_PER_PTE * sizeof(pte_t))
 
 DEFINE_PER_CPU(struct mmu_gather, mmu_gathers);
 
@@ -58,7 +52,7 @@ void show_mem(void)
 
 	printk("Mem-info:\n");
 	show_free_areas();
-	printk("Free swap:       %6dkB\n",nr_swap_pages<<(PAGE_SHIFT-10));
+	printk("Free swap:       %6ldkB\n", nr_swap_pages<<(PAGE_SHIFT-10));
 
 	for (node = 0; node < numnodes; node++) {
 		struct page *page, *end;
@@ -289,14 +283,13 @@ static __init void reserve_node_zero(unsigned int bootmap_pfn, unsigned int boot
 	 */
 	reserve_bootmem_node(pgdat, __pa(&_stext), &_end - &_stext);
 
-#ifdef CONFIG_CPU_32
 	/*
 	 * Reserve the page tables.  These are already in use,
 	 * and can only be in node 0.
 	 */
 	reserve_bootmem_node(pgdat, __pa(swapper_pg_dir),
 			     PTRS_PER_PGD * sizeof(pgd_t));
-#endif
+
 	/*
 	 * And don't forget to reserve the allocator bitmap,
 	 * which will be freed later.
@@ -502,7 +495,7 @@ void __init paging_init(struct meminfo *mi, struct machine_desc *mdesc)
 		 */
 		arch_adjust_zones(node, zone_size, zhole_size);
 
-		free_area_init_node(node, pgdat, 0, zone_size,
+		free_area_init_node(node, pgdat, NULL, zone_size,
 				bdata->node_boot_start >> PAGE_SHIFT, zhole_size);
 	}
 
diff --git a/arch/arm/mm/proc-sa1100.S b/arch/arm/mm/proc-sa1100.S
index 586f7d16e..5d444e49b 100644
--- a/arch/arm/mm/proc-sa1100.S
+++ b/arch/arm/mm/proc-sa1100.S
@@ -24,7 +24,6 @@
 #include <asm/procinfo.h>
 #include <asm/hardware.h>
 #include <asm/pgtable.h>
-#include <asm/ptrace.h>
 
 /*
  * the cache line size of the I and D cache
diff --git a/arch/arm/nwfpe/fpa11.h b/arch/arm/nwfpe/fpa11.h
index c3f14c7aa..45cc65426 100644
--- a/arch/arm/nwfpe/fpa11.h
+++ b/arch/arm/nwfpe/fpa11.h
@@ -29,7 +29,7 @@
  * stack+task struct.  Use the same method as 'current' uses to
  * reach them.
  */
-register unsigned int *user_registers asm("sl");
+register unsigned long *user_registers asm("sl");
 
 #define GET_USERREG() (user_registers)
 
diff --git a/arch/arm/nwfpe/fpa11_cpdt.c b/arch/arm/nwfpe/fpa11_cpdt.c
index 59e3197d6..2ad457558 100644
--- a/arch/arm/nwfpe/fpa11_cpdt.c
+++ b/arch/arm/nwfpe/fpa11_cpdt.c
@@ -29,14 +29,14 @@
 
 #include <asm/uaccess.h>
 
-static inline void loadSingle(const unsigned int Fn, const unsigned int *pMem)
+static inline void loadSingle(const unsigned int Fn, const unsigned int __user *pMem)
 {
 	FPA11 *fpa11 = GET_FPA11();
 	fpa11->fType[Fn] = typeSingle;
 	get_user(fpa11->fpreg[Fn].fSingle, pMem);
 }
 
-static inline void loadDouble(const unsigned int Fn, const unsigned int *pMem)
+static inline void loadDouble(const unsigned int Fn, const unsigned int __user *pMem)
 {
 	FPA11 *fpa11 = GET_FPA11();
 	unsigned int *p;
@@ -47,7 +47,7 @@ static inline void loadDouble(const unsigned int Fn, const unsigned int *pMem)
 }
 
 #ifdef CONFIG_FPE_NWFPE_XP
-static inline void loadExtended(const unsigned int Fn, const unsigned int *pMem)
+static inline void loadExtended(const unsigned int Fn, const unsigned int __user *pMem)
 {
 	FPA11 *fpa11 = GET_FPA11();
 	unsigned int *p;
@@ -59,7 +59,7 @@ static inline void loadExtended(const unsigned int Fn, const unsigned int *pMem)
 }
 #endif
 
-static inline void loadMultiple(const unsigned int Fn, const unsigned int *pMem)
+static inline void loadMultiple(const unsigned int Fn, const unsigned int __user *pMem)
 {
 	FPA11 *fpa11 = GET_FPA11();
 	register unsigned int *p;
@@ -91,7 +91,7 @@ static inline void loadMultiple(const unsigned int Fn, const unsigned int *pMem)
 	}
 }
 
-static inline void storeSingle(const unsigned int Fn, unsigned int *pMem)
+static inline void storeSingle(const unsigned int Fn, unsigned int __user *pMem)
 {
 	FPA11 *fpa11 = GET_FPA11();
 	union {
@@ -117,7 +117,7 @@ static inline void storeSingle(const unsigned int Fn, unsigned int *pMem)
 	put_user(val.i[0], pMem);
 }
 
-static inline void storeDouble(const unsigned int Fn, unsigned int *pMem)
+static inline void storeDouble(const unsigned int Fn, unsigned int __user *pMem)
 {
 	FPA11 *fpa11 = GET_FPA11();
 	union {
@@ -145,7 +145,7 @@ static inline void storeDouble(const unsigned int Fn, unsigned int *pMem)
 }
 
 #ifdef CONFIG_FPE_NWFPE_XP
-static inline void storeExtended(const unsigned int Fn, unsigned int *pMem)
+static inline void storeExtended(const unsigned int Fn, unsigned int __user *pMem)
 {
 	FPA11 *fpa11 = GET_FPA11();
 	union {
@@ -172,7 +172,7 @@ static inline void storeExtended(const unsigned int Fn, unsigned int *pMem)
 }
 #endif
 
-static inline void storeMultiple(const unsigned int Fn, unsigned int *pMem)
+static inline void storeMultiple(const unsigned int Fn, unsigned int __user *pMem)
 {
 	FPA11 *fpa11 = GET_FPA11();
 	register unsigned int nType, *p;
@@ -204,10 +204,10 @@ static inline void storeMultiple(const unsigned int Fn, unsigned int *pMem)
 
 unsigned int PerformLDF(const unsigned int opcode)
 {
-	unsigned int *pBase, *pAddress, *pFinal, nRc = 1,
-	    write_back = WRITE_BACK(opcode);
+	unsigned int __user *pBase, *pAddress, *pFinal;
+	unsigned int nRc = 1, write_back = WRITE_BACK(opcode);
 
-	pBase = (unsigned int *) readRegister(getRn(opcode));
+	pBase = (unsigned int __user *) readRegister(getRn(opcode));
 	if (REG_PC == getRn(opcode)) {
 		pBase += 2;
 		write_back = 0;
@@ -241,18 +241,18 @@ unsigned int PerformLDF(const unsigned int opcode)
 	}
 
 	if (write_back)
-		writeRegister(getRn(opcode), (unsigned int) pFinal);
+		writeRegister(getRn(opcode), (unsigned long) pFinal);
 	return nRc;
 }
 
 unsigned int PerformSTF(const unsigned int opcode)
 {
-	unsigned int *pBase, *pAddress, *pFinal, nRc = 1,
-	    write_back = WRITE_BACK(opcode);
+	unsigned int __user *pBase, *pAddress, *pFinal;
+	unsigned int nRc = 1, write_back = WRITE_BACK(opcode);
 
 	SetRoundingMode(ROUND_TO_NEAREST);
 
-	pBase = (unsigned int *) readRegister(getRn(opcode));
+	pBase = (unsigned int __user *) readRegister(getRn(opcode));
 	if (REG_PC == getRn(opcode)) {
 		pBase += 2;
 		write_back = 0;
@@ -286,16 +286,16 @@ unsigned int PerformSTF(const unsigned int opcode)
 	}
 
 	if (write_back)
-		writeRegister(getRn(opcode), (unsigned int) pFinal);
+		writeRegister(getRn(opcode), (unsigned long) pFinal);
 	return nRc;
 }
 
 unsigned int PerformLFM(const unsigned int opcode)
 {
-	unsigned int i, Fd, *pBase, *pAddress, *pFinal,
-	    write_back = WRITE_BACK(opcode);
+	unsigned int __user *pBase, *pAddress, *pFinal;
+	unsigned int i, Fd, write_back = WRITE_BACK(opcode);
 
-	pBase = (unsigned int *) readRegister(getRn(opcode));
+	pBase = (unsigned int __user *) readRegister(getRn(opcode));
 	if (REG_PC == getRn(opcode)) {
 		pBase += 2;
 		write_back = 0;
@@ -322,16 +322,16 @@ unsigned int PerformLFM(const unsigned int opcode)
 	}
 
 	if (write_back)
-		writeRegister(getRn(opcode), (unsigned int) pFinal);
+		writeRegister(getRn(opcode), (unsigned long) pFinal);
 	return 1;
 }
 
 unsigned int PerformSFM(const unsigned int opcode)
 {
-	unsigned int i, Fd, *pBase, *pAddress, *pFinal,
-	    write_back = WRITE_BACK(opcode);
+	unsigned int __user *pBase, *pAddress, *pFinal;
+	unsigned int i, Fd, write_back = WRITE_BACK(opcode);
 
-	pBase = (unsigned int *) readRegister(getRn(opcode));
+	pBase = (unsigned int __user *) readRegister(getRn(opcode));
 	if (REG_PC == getRn(opcode)) {
 		pBase += 2;
 		write_back = 0;
@@ -358,7 +358,7 @@ unsigned int PerformSFM(const unsigned int opcode)
 	}
 
 	if (write_back)
-		writeRegister(getRn(opcode), (unsigned int) pFinal);
+		writeRegister(getRn(opcode), (unsigned long) pFinal);
 	return 1;
 }
 
diff --git a/arch/arm/nwfpe/fpmodule.c b/arch/arm/nwfpe/fpmodule.c
index 7c417158d..a806fea5c 100644
--- a/arch/arm/nwfpe/fpmodule.c
+++ b/arch/arm/nwfpe/fpmodule.c
@@ -131,7 +131,7 @@ void float_raise(signed char flags)
 
 #ifdef CONFIG_DEBUG_USER
 	printk(KERN_DEBUG
-	       "NWFPE: %s[%d] takes exception %08x at %p from %08x\n",
+	       "NWFPE: %s[%d] takes exception %08x at %p from %08lx\n",
 	       current->comm, current->pid, flags,
 	       __builtin_return_address(0), GET_USERREG()[15]);
 #endif
diff --git a/arch/arm/nwfpe/fpmodule.inl b/arch/arm/nwfpe/fpmodule.inl
index 119fb3f48..e5f59e9a3 100644
--- a/arch/arm/nwfpe/fpmodule.inl
+++ b/arch/arm/nwfpe/fpmodule.inl
@@ -19,8 +19,7 @@
     Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
 */
 
-extern __inline__
-unsigned int readRegister(const unsigned int nReg)
+static inline unsigned long readRegister(const unsigned int nReg)
 {
 	/* Note: The CPU thinks it has dealt with the current instruction.
 	   As a result the program counter has been advanced to the next
@@ -29,34 +28,31 @@ unsigned int readRegister(const unsigned int nReg)
 	   for this in this routine.  LDF/STF instructions with Rn = PC
 	   depend on the PC being correct, as they use PC+8 in their
 	   address calculations. */
-	unsigned int *userRegisters = GET_USERREG();
+	unsigned long *userRegisters = GET_USERREG();
 	unsigned int val = userRegisters[nReg];
 	if (REG_PC == nReg)
 		val -= 4;
 	return val;
 }
 
-extern __inline__
-void writeRegister(const unsigned int nReg, const unsigned int val)
+static inline void
+writeRegister(const unsigned int nReg, const unsigned long val)
 {
-	unsigned int *userRegisters = GET_USERREG();
+	unsigned long *userRegisters = GET_USERREG();
 	userRegisters[nReg] = val;
 }
 
-extern __inline__
-unsigned int readCPSR(void)
+static inline unsigned long readCPSR(void)
 {
 	return (readRegister(REG_CPSR));
 }
 
-extern __inline__
-void writeCPSR(const unsigned int val)
+static inline void writeCPSR(const unsigned long val)
 {
 	writeRegister(REG_CPSR, val);
 }
 
-extern __inline__
-unsigned int readConditionCodes(void)
+static inline unsigned long readConditionCodes(void)
 {
 #ifdef __FPEM_TEST__
 	return (0);
@@ -65,11 +61,10 @@ unsigned int readConditionCodes(void)
 #endif
 }
 
-extern __inline__
-void writeConditionCodes(const unsigned int val)
+static inline void writeConditionCodes(const unsigned long val)
 {
-	unsigned int *userRegisters = GET_USERREG();
-	unsigned int rval;
+	unsigned long *userRegisters = GET_USERREG();
+	unsigned long rval;
 	/*
 	 * Operate directly on userRegisters since
 	 * the CPSR may be the PC register itself.
@@ -77,9 +72,3 @@ void writeConditionCodes(const unsigned int val)
 	rval = userRegisters[REG_CPSR] & ~CC_MASK;
 	userRegisters[REG_CPSR] = rval | (val & CC_MASK);
 }
-
-extern __inline__
-unsigned int readMemoryInt(unsigned int *pMem)
-{
-	return *pMem;
-}
diff --git a/arch/arm/tools/mach-types b/arch/arm/tools/mach-types
index 2ecfdfd61..d2ce22372 100644
--- a/arch/arm/tools/mach-types
+++ b/arch/arm/tools/mach-types
@@ -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: Fri May 28 13:17:46 2004
+# Last update: Fri Jul 2 11:58:36 2004
 #
 # machine_is_xxx	CONFIG_xxxx		MACH_TYPE_xxx		number
 #
@@ -250,8 +250,8 @@ pxa_eagle250		ARCH_PXA_EAGLE250	PXA_EAGLE250		238
 pdb			ARCH_PDB		PDB			239
 blue_2g			SA1100_BLUE_2G		BLUE_2G			240
 bluearch		SA1100_BLUEARCH		BLUEARCH		241
-ixdp2400		ARCH_IXMB2400		IXMB2400		242
-ixdp2800		ARCH_IXMB2800		IXMB2800		243
+ixdp2400		ARCH_IXDB2400		IXDB2400		242
+ixdp2800		ARCH_IXDB2800		IXDB2800		243
 explorer		SA1100_EXPLORER		EXPLORER		244
 ixdp425			ARCH_IXDP425		IXDP425			245
 chimp			ARCH_CHIMP		CHIMP			246
@@ -546,3 +546,16 @@ ddi_blueridge		MACH_DDI_BLUERIDGE	DDI_BLUERIDGE		535
 skyminder		MACH_SKYMINDER		SKYMINDER		536
 lpd79520		MACH_LPD79520		LPD79520		537
 edb9302			MACH_EDB9302		EDB9302			538
+hw90340			MACH_HW90340		HW90340			539
+cip_box			MACH_CIP_BOX		CIP_BOX			540
+ivpn			MACH_IVPN		IVPN			541
+rsoc2			MACH_RSOC2		RSOC2			542
+husky			MACH_HUSKY		HUSKY			543
+boxer			MACH_BOXER		BOXER			544
+shepherd		MACH_SHEPHERD		SHEPHERD		545
+aml42800aa		MACH_AML42800AA		AML42800AA		546
+ml674001		MACH_MACH_TYPE_ML674001	MACH_TYPE_ML674001	547
+lpc2294			MACH_LPC2294		LPC2294			548
+switchgrass		MACH_SWITCHGRASS	SWITCHGRASS		549
+ens_cmu			MACH_ENS_CMU		ENS_CMU			550
+mm6_sdb			MACH_MM6_SDB		MM6_SDB			551
diff --git a/arch/arm26/kernel/init_task.c b/arch/arm26/kernel/init_task.c
index d40e768bd..5b510232a 100644
--- a/arch/arm26/kernel/init_task.c
+++ b/arch/arm26/kernel/init_task.c
@@ -10,6 +10,7 @@
 #include <linux/sched.h>
 #include <linux/init.h>
 #include <linux/init_task.h>
+#include <linux/mqueue.h>
 
 #include <asm/uaccess.h>
 #include <asm/pgtable.h>
diff --git a/arch/arm26/kernel/irq.c b/arch/arm26/kernel/irq.c
index d627cedab..7869d1b22 100644
--- a/arch/arm26/kernel/irq.c
+++ b/arch/arm26/kernel/irq.c
@@ -549,7 +549,7 @@ int request_irq(unsigned int irq, irqreturn_t (*handler)(int, void *, struct pt_
 
 	action->handler = handler;
 	action->flags = irq_flags;
-	action->mask = 0;
+	cpus_clear(action->mask);
 	action->name = devname;
 	action->next = NULL;
 	action->dev_id = dev_id;
diff --git a/arch/arm26/kernel/setup.c b/arch/arm26/kernel/setup.c
index afb7db526..e02d41867 100644
--- a/arch/arm26/kernel/setup.c
+++ b/arch/arm26/kernel/setup.c
@@ -76,7 +76,6 @@ struct processor processor;
 
 unsigned char aux_device_present;
 char elf_platform[ELF_PLATFORM_SIZE];
-char saved_command_line[COMMAND_LINE_SIZE];
 
 unsigned long phys_initrd_start __initdata = 0;
 unsigned long phys_initrd_size __initdata = 0;
diff --git a/arch/arm26/mm/init.c b/arch/arm26/mm/init.c
index a4f56b2b4..ad41cebe2 100644
--- a/arch/arm26/mm/init.c
+++ b/arch/arm26/mm/init.c
@@ -67,7 +67,7 @@ void show_mem(void)
 
 	printk("Mem-info:\n");
 	show_free_areas();
-	printk("Free swap:       %6dkB\n",nr_swap_pages<<(PAGE_SHIFT-10));
+	printk("Free swap:       %6ldkB\n", nr_swap_pages<<(PAGE_SHIFT-10));
 
 
 	page = NODE_MEM_MAP(0);
diff --git a/arch/cris/arch-v10/defconfig b/arch/cris/arch-v10/defconfig
index 9d40dd316..2a3411eaa 100644
--- a/arch/cris/arch-v10/defconfig
+++ b/arch/cris/arch-v10/defconfig
@@ -230,7 +230,6 @@ CONFIG_INET=y
 # 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
 
 #
diff --git a/arch/cris/arch-v10/kernel/time.c b/arch/cris/arch-v10/kernel/time.c
index c4d78d52f..298e86a01 100644
--- a/arch/cris/arch-v10/kernel/time.c
+++ b/arch/cris/arch-v10/kernel/time.c
@@ -253,7 +253,7 @@ timer_interrupt(int irq, void *dev_id, struct pt_regs *regs)
  */
 
 static struct irqaction irq2  = { timer_interrupt, SA_SHIRQ | SA_INTERRUPT,
-				  0, "timer", NULL, NULL};
+				  CPU_MASK_NONE, "timer", NULL, NULL};
 
 void __init
 time_init(void)
diff --git a/arch/cris/defconfig b/arch/cris/defconfig
index 0cef3f998..32c9c987d 100644
--- a/arch/cris/defconfig
+++ b/arch/cris/defconfig
@@ -323,7 +323,6 @@ CONFIG_NETFILTER=y
 # 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
 
 #
diff --git a/arch/cris/kernel/irq.c b/arch/cris/kernel/irq.c
index a963dda74..94d702790 100644
--- a/arch/cris/kernel/irq.c
+++ b/arch/cris/kernel/irq.c
@@ -240,7 +240,7 @@ int request_irq(unsigned int irq,
 
 	action->handler = handler;
 	action->flags = irqflags;
-	action->mask = 0;
+	cpus_clear(action->mask);
 	action->name = devname;
 	action->next = NULL;
 	action->dev_id = dev_id;
diff --git a/arch/cris/kernel/process.c b/arch/cris/kernel/process.c
index c4992bf89..9f7cad7c7 100644
--- a/arch/cris/kernel/process.c
+++ b/arch/cris/kernel/process.c
@@ -112,6 +112,7 @@
 #include <linux/fs.h>
 #include <linux/user.h>
 #include <linux/elfcore.h>
+#include <linux/mqueue.h>
 
 //#define DEBUG
 
diff --git a/arch/cris/kernel/setup.c b/arch/cris/kernel/setup.c
index 95a9f4408..02f62310a 100644
--- a/arch/cris/kernel/setup.c
+++ b/arch/cris/kernel/setup.c
@@ -18,6 +18,8 @@
 #include <linux/seq_file.h>
 #include <linux/tty.h>
 
+#include <asm/setup.h>
+
 /*
  * Setup options
  */
@@ -29,10 +31,7 @@ unsigned char aux_device_present;
 extern int root_mountflags;
 extern char _etext, _edata, _end;
 
-#define COMMAND_LINE_SIZE 256
-
 static char command_line[COMMAND_LINE_SIZE] = { 0, };
-       char saved_command_line[COMMAND_LINE_SIZE];
 
 extern const unsigned long text_start, edata; /* set by the linker script */
 extern unsigned long dram_start, dram_end;
diff --git a/arch/cris/mm/init.c b/arch/cris/mm/init.c
index d0bd0c957..31a0018b5 100644
--- a/arch/cris/mm/init.c
+++ b/arch/cris/mm/init.c
@@ -138,7 +138,7 @@ show_mem(void)
 
 	printk("\nMem-info:\n");
 	show_free_areas();
-	printk("Free swap:       %6dkB\n",nr_swap_pages<<(PAGE_SHIFT-10));
+	printk("Free swap:       %6ldkB\n", nr_swap_pages<<(PAGE_SHIFT-10));
 	i = max_mapnr;
 	while (i-- > 0) {
 		total++;
diff --git a/arch/h8300/Kconfig b/arch/h8300/Kconfig
index 093f3e64c..47356589a 100644
--- a/arch/h8300/Kconfig
+++ b/arch/h8300/Kconfig
@@ -223,7 +223,7 @@ config GDB_DEBUG
 
 config CONFIG_SH_STANDARD_BIOS
 	bool "Use gdb protocol serial console"
-	depends on (!H8300H_SIM && H8S_SIM)
+	depends on (!H8300H_SIM && !H8S_SIM)
 	help
 	  serial console output using GDB protocol.
 	  Require eCos/RedBoot
diff --git a/arch/h8300/defconfig b/arch/h8300/defconfig
index 1257ce7c1..49cb366a8 100644
--- a/arch/h8300/defconfig
+++ b/arch/h8300/defconfig
@@ -171,7 +171,6 @@ CONFIG_NET=y
 # CONFIG_LAPB is not set
 # CONFIG_NET_DIVERT is not set
 # CONFIG_WAN_ROUTER is not set
-# CONFIG_NET_FASTROUTE is not set
 # CONFIG_NET_HW_FLOWCONTROL is not set
 
 #
diff --git a/arch/h8300/kernel/init_task.c b/arch/h8300/kernel/init_task.c
index 6a8e7475b..19272c2ac 100644
--- a/arch/h8300/kernel/init_task.c
+++ b/arch/h8300/kernel/init_task.c
@@ -7,6 +7,7 @@
 #include <linux/init.h>
 #include <linux/init_task.h>
 #include <linux/fs.h>
+#include <linux/mqueue.h>
 
 #include <asm/uaccess.h>
 #include <asm/pgtable.h>
diff --git a/arch/h8300/kernel/ptrace.c b/arch/h8300/kernel/ptrace.c
index cdbfe9e5c..51777001a 100644
--- a/arch/h8300/kernel/ptrace.c
+++ b/arch/h8300/kernel/ptrace.c
@@ -118,18 +118,36 @@ asmlinkage int sys_ptrace(long request, long pid, long addr, long data)
 		case PTRACE_PEEKUSR: {
 			unsigned long tmp;
 			
-			if ((addr & 3) || addr < 0 || addr >= sizeof(struct user))
+			if ((addr & 3) || addr < 0 || addr >= sizeof(struct user)) {
 				ret = -EIO;
+				break ;
+			}
 			
-			tmp = 0;  /* Default return condition */
+		        ret = 0;  /* Default return condition */
 			addr = addr >> 2; /* temporary hack. */
+
 			if (addr < H8300_REGS_NO)
 				tmp = h8300_get_reg(child, addr);
 			else {
-				ret = -EIO;
-				break ;
+				switch(addr) {
+				case 49:
+					tmp = child->mm->start_code;
+					break ;
+				case 50:
+					tmp = child->mm->start_data;
+					break ;
+				case 51:
+					tmp = child->mm->end_code;
+					break ;
+				case 52:
+					tmp = child->mm->end_data;
+					break ;
+				default:
+					ret = -EIO;
+				}
 			}
-			ret = put_user(tmp,(unsigned long *) data);
+			if (!ret)
+				ret = put_user(tmp,(unsigned long *) data);
 			break ;
 		}
 
diff --git a/arch/h8300/kernel/setup.c b/arch/h8300/kernel/setup.c
index bf5822c56..2742e5389 100644
--- a/arch/h8300/kernel/setup.c
+++ b/arch/h8300/kernel/setup.c
@@ -30,6 +30,7 @@
 #include <linux/major.h>
 #include <linux/bootmem.h>
 #include <linux/seq_file.h>
+#include <linux/init.h>
 
 #include <asm/setup.h>
 #include <asm/irq.h>
@@ -54,8 +55,7 @@ unsigned long rom_length;
 unsigned long memory_start;
 unsigned long memory_end;
 
-char command_line[512];
-char saved_command_line[512];
+char command_line[COMMAND_LINE_SIZE];
 
 extern int _stext, _etext, _sdata, _edata, _sbss, _ebss, _end;
 extern int _ramstart, _ramend;
@@ -155,8 +155,8 @@ void __init setup_arch(char **cmdline_p)
 #endif
 	/* Keep a copy of command line */
 	*cmdline_p = &command_line[0];
-	memcpy(saved_command_line, command_line, sizeof(saved_command_line));
-	saved_command_line[sizeof(saved_command_line)-1] = 0;
+	memcpy(saved_command_line, command_line, COMMAND_LINE_SIZE);
+	saved_command_line[COMMAND_LINE_SIZE-1] = 0;
 
 #ifdef DEBUG
 	if (strlen(*cmdline_p)) 
diff --git a/arch/h8300/platform/h8s/entry.S b/arch/h8300/platform/h8s/entry.S
index 9df1201a1..68e5cae80 100644
--- a/arch/h8300/platform/h8s/entry.S
+++ b/arch/h8300/platform/h8s/entry.S
@@ -83,6 +83,7 @@
 	mov.l	@(LER0-LER1:16,sp),er1		/* restore ER0 */
 	mov.l	er1,@er0
 	mov.w	@(LEXR-LER1:16,sp),r1		/* restore EXR */
+	mov.b	r1l,r1h
 	mov.w	r1,@(8:16,er0)
 	mov.w	@(LCCR-LER1:16,sp),r1		/* restore the RET addr */
 	mov.b	r1l,r1h
@@ -214,7 +215,6 @@ SYMBOL_NAME_LABEL(system_call)
 	jsr	@SYMBOL_NAME(syscall_trace)
 	bra	SYMBOL_NAME(ret_from_exception):8
 
-
 SYMBOL_NAME_LABEL(ret_from_fork)
 	mov.l	er2,er0
 	jsr	@SYMBOL_NAME(schedule_tail)
diff --git a/arch/h8300/platform/h8s/ptrace_h8s.c b/arch/h8300/platform/h8s/ptrace_h8s.c
index dc0495404..e8cd46f92 100644
--- a/arch/h8300/platform/h8s/ptrace_h8s.c
+++ b/arch/h8300/platform/h8s/ptrace_h8s.c
@@ -23,7 +23,7 @@
 static const int h8300_register_offset[] = {
 	PT_REG(er1), PT_REG(er2), PT_REG(er3), PT_REG(er4),
 	PT_REG(er5), PT_REG(er6), PT_REG(er0), PT_REG(orig_er0),
-	PT_REG(ccr), PT_REG(pc), PT_REG(exr)
+	PT_REG(ccr), PT_REG(pc),  0,           PT_REG(exr)
 };
 
 /* read register */
diff --git a/arch/i386/Kconfig b/arch/i386/Kconfig
index b44faa282..51f5417a6 100644
--- a/arch/i386/Kconfig
+++ b/arch/i386/Kconfig
@@ -436,7 +436,8 @@ config HPET_TIMER
 	  Choose N to continue using the legacy 8254 timer.
 
 config HPET_EMULATE_RTC
-	def_bool HPET_TIMER && RTC=y
+	bool "Provide RTC interrupt"
+	depends on HPET_TIMER && RTC=y
 
 config SMP
 	bool "Symmetric multi-processing support"
@@ -1337,12 +1338,6 @@ config X86_TRAMPOLINE
 	depends on X86_SMP || (X86_VOYAGER && SMP)
 	default y
 
-# std_resources is overridden for pc9800, but that's not
-# a currently selectable arch choice
-config X86_STD_RESOURCES
-	bool
-	default y
-
 config PC
 	bool
 	depends on X86 && !EMBEDDED
diff --git a/arch/i386/Makefile b/arch/i386/Makefile
index 299b5f2bb..1e446b234 100644
--- a/arch/i386/Makefile
+++ b/arch/i386/Makefile
@@ -104,7 +104,8 @@ head-y := arch/i386/kernel/head.o arch/i386/kernel/init_task.o
 libs-y 					+= arch/i386/lib/
 core-y					+= arch/i386/kernel/ \
 					   arch/i386/mm/ \
-					   arch/i386/$(mcore-y)/
+					   arch/i386/$(mcore-y)/ \
+					   arch/i386/crypto/
 drivers-$(CONFIG_MATH_EMULATION)	+= arch/i386/math-emu/
 drivers-$(CONFIG_PCI)			+= arch/i386/pci/
 # must be linked after kernel/
@@ -121,22 +122,23 @@ boot := arch/i386/boot
 
 all: bzImage
 
-BOOTIMAGE=arch/i386/boot/bzImage
-zImage zlilo zdisk: BOOTIMAGE=arch/i386/boot/zImage
+# KBUILD_IMAGE specify target image being built
+                    KBUILD_IMAGE := $(boot)/bzImage
+zImage zlilo zdisk: KBUILD_IMAGE := arch/i386/boot/zImage
 
 zImage bzImage: vmlinux
-	$(Q)$(MAKE) $(build)=$(boot) $(BOOTIMAGE)
+	$(Q)$(MAKE) $(build)=$(boot) $(KBUILD_IMAGE)
 
 compressed: zImage
 
 zlilo bzlilo: vmlinux
-	$(Q)$(MAKE) $(build)=$(boot) BOOTIMAGE=$(BOOTIMAGE) zlilo
+	$(Q)$(MAKE) $(build)=$(boot) BOOTIMAGE=$(KBUILD_IMAGE) zlilo
 
 zdisk bzdisk: vmlinux
-	$(Q)$(MAKE) $(build)=$(boot) BOOTIMAGE=$(BOOTIMAGE) zdisk
+	$(Q)$(MAKE) $(build)=$(boot) BOOTIMAGE=$(KBUILD_IMAGE) zdisk
 
 install fdimage fdimage144 fdimage288: vmlinux
-	$(Q)$(MAKE) $(build)=$(boot) BOOTIMAGE=$(BOOTIMAGE) $@
+	$(Q)$(MAKE) $(build)=$(boot) BOOTIMAGE=$(KBUILD_IMAGE) $@
 
 prepare: include/asm-$(ARCH)/asm_offsets.h
 CLEAN_FILES += include/asm-$(ARCH)/asm_offsets.h
diff --git a/arch/i386/boot/compressed/misc.c b/arch/i386/boot/compressed/misc.c
index 200ac3efd..fa6704523 100644
--- a/arch/i386/boot/compressed/misc.c
+++ b/arch/i386/boot/compressed/misc.c
@@ -87,12 +87,11 @@ static void gzip_release(void **);
  */
 static unsigned char *real_mode; /* Pointer to real-mode data */
 
-#define EXT_MEM_K   (*(unsigned short *)(real_mode + 0x2))
+#define RM_EXT_MEM_K   (*(unsigned short *)(real_mode + 0x2))
 #ifndef STANDARD_MEMORY_BIOS_CALL
-#define ALT_MEM_K   (*(unsigned long *)(real_mode + 0x1e0))
+#define RM_ALT_MEM_K   (*(unsigned long *)(real_mode + 0x1e0))
 #endif
-#define SCREEN_INFO (*(struct screen_info *)(real_mode+0))
-#define EDID_INFO   (*(struct edid_info *)(real_mode+0x440))
+#define RM_SCREEN_INFO (*(struct screen_info *)(real_mode+0))
 
 extern char input_data[];
 extern int input_len;
@@ -174,8 +173,8 @@ static void putstr(const char *s)
 	int x,y,pos;
 	char c;
 
-	x = SCREEN_INFO.orig_x;
-	y = SCREEN_INFO.orig_y;
+	x = RM_SCREEN_INFO.orig_x;
+	y = RM_SCREEN_INFO.orig_y;
 
 	while ( ( c = *s++ ) != '\0' ) {
 		if ( c == '\n' ) {
@@ -196,8 +195,8 @@ static void putstr(const char *s)
 		}
 	}
 
-	SCREEN_INFO.orig_x = x;
-	SCREEN_INFO.orig_y = y;
+	RM_SCREEN_INFO.orig_x = x;
+	RM_SCREEN_INFO.orig_y = y;
 
 	pos = (x + cols * y) * 2;	/* Update cursor position */
 	outb_p(14, vidport);
@@ -306,9 +305,9 @@ struct {
 static void setup_normal_output_buffer(void)
 {
 #ifdef STANDARD_MEMORY_BIOS_CALL
-	if (EXT_MEM_K < 1024) error("Less than 2MB of memory");
+	if (RM_EXT_MEM_K < 1024) error("Less than 2MB of memory");
 #else
-	if ((ALT_MEM_K > EXT_MEM_K ? ALT_MEM_K : EXT_MEM_K) < 1024) error("Less than 2MB of memory");
+	if ((RM_ALT_MEM_K > RM_EXT_MEM_K ? RM_ALT_MEM_K : RM_EXT_MEM_K) < 1024) error("Less than 2MB of memory");
 #endif
 	output_data = (char *)0x100000; /* Points to 1M */
 	free_mem_end_ptr = (long)real_mode;
@@ -323,9 +322,11 @@ static void setup_output_buffer_if_we_run_high(struct moveparams *mv)
 {
 	high_buffer_start = (uch *)(((ulg)&end) + HEAP_SIZE);
 #ifdef STANDARD_MEMORY_BIOS_CALL
-	if (EXT_MEM_K < (3*1024)) error("Less than 4MB of memory");
+	if (RM_EXT_MEM_K < (3*1024)) error("Less than 4MB of memory");
 #else
-	if ((ALT_MEM_K > EXT_MEM_K ? ALT_MEM_K : EXT_MEM_K) < (3*1024)) error("Less than 4MB of memory");
+	if ((RM_ALT_MEM_K > RM_EXT_MEM_K ? RM_ALT_MEM_K : RM_EXT_MEM_K) <
+			(3*1024))
+		error("Less than 4MB of memory");
 #endif	
 	mv->low_buffer_start = output_data = (char *)LOW_BUFFER_START;
 	low_buffer_end = ((unsigned int)real_mode > LOW_BUFFER_MAX
@@ -358,7 +359,7 @@ asmlinkage int decompress_kernel(struct moveparams *mv, void *rmode)
 {
 	real_mode = rmode;
 
-	if (SCREEN_INFO.orig_video_mode == 7) {
+	if (RM_SCREEN_INFO.orig_video_mode == 7) {
 		vidmem = (char *) 0xb0000;
 		vidport = 0x3b4;
 	} else {
@@ -366,8 +367,8 @@ asmlinkage int decompress_kernel(struct moveparams *mv, void *rmode)
 		vidport = 0x3d4;
 	}
 
-	lines = SCREEN_INFO.orig_video_lines;
-	cols = SCREEN_INFO.orig_video_cols;
+	lines = RM_SCREEN_INFO.orig_video_lines;
+	cols = RM_SCREEN_INFO.orig_video_cols;
 
 	if (free_mem_ptr < 0x100000) setup_normal_output_buffer();
 	else setup_output_buffer_if_we_run_high(mv);
diff --git a/arch/i386/boot/edd.S b/arch/i386/boot/edd.S
index faaa555bb..889790693 100644
--- a/arch/i386/boot/edd.S
+++ b/arch/i386/boot/edd.S
@@ -4,7 +4,7 @@
  * conformant to T13 Committee www.t13.org
  *   projects 1572D, 1484D, 1386D, 1226DT
  * disk signature read by Matt Domsch <Matt_Domsch@dell.com>
- *	and Andrew Wilks <Andrew_Wilks@dell.com> September 2003
+ *	and Andrew Wilks <Andrew_Wilks@dell.com> September 2003, June 2004
  * legacy CHS retreival by Patrick J. LoPresti <patl@users.sourceforge.net>
  *      March 2004
  */
@@ -12,28 +12,39 @@
 #include <linux/edd.h>
 
 #if defined(CONFIG_EDD) || defined(CONFIG_EDD_MODULE)
-# Read the first sector of device 80h and store the 4-byte signature
+# Read the first sector of each BIOS disk device and store the 4-byte signature
+edd_mbr_sig_start:
+	movb	$0, (EDD_MBR_SIG_NR_BUF)	# zero value at EDD_MBR_SIG_NR_BUF
+	movb	$0x80, %dl			# from device 80
+	movw	$EDD_MBR_SIG_BUF, %bx		# store buffer ptr in bx
+edd_mbr_sig_read:
 	movl	$0xFFFFFFFF, %eax
-	movl	%eax, (DISK80_SIG_BUFFER)	# assume failure
+	movl	%eax, (%bx)			# assume failure
+	pushw	%bx
 	movb	$READ_SECTORS, %ah
 	movb	$1, %al				# read 1 sector
-	movb	$0x80, %dl			# from device 80
 	movb	$0, %dh				# at head 0
 	movw	$1, %cx				# cylinder 0, sector 0
 	pushw	%es
 	pushw	%ds
 	popw	%es
-	movw	$EDDBUF, %bx
-	pushw   %dx             # work around buggy BIOSes
+    	movw	$EDDBUF, %bx			# disk's data goes into EDDBUF
+	pushw	%dx             # work around buggy BIOSes
 	stc                     # work around buggy BIOSes
-	int     $0x13
+	int	$0x13
 	sti                     # work around buggy BIOSes
-	popw    %dx
-	jc	disk_sig_done
-	movl	(EDDBUF+MBR_SIG_OFFSET), %eax
-	movl	%eax, (DISK80_SIG_BUFFER)	# store success
-disk_sig_done:
+	popw	%dx
 	popw	%es
+	popw	%bx
+	jc	edd_mbr_sig_done		# on failure, we're done.
+	movl	(EDDBUF+EDD_MBR_SIG_OFFSET), %eax # read sig out of the MBR
+	movl	%eax, (%bx)			# store success
+	incb	(EDD_MBR_SIG_NR_BUF)		# note that we stored something
+	incb	%dl				# increment to next device
+	addw	$4, %bx				# increment sig buffer ptr
+	cmpb	$EDD_MBR_SIG_MAX, (EDD_MBR_SIG_NR_BUF)	# Out of space?
+	jb	edd_mbr_sig_read		# keep looping
+edd_mbr_sig_done:
 
 # Do the BIOS Enhanced Disk Drive calls
 # This consists of two calls:
diff --git a/arch/i386/defconfig b/arch/i386/defconfig
index 7257696c7..aed3bc298 100644
--- a/arch/i386/defconfig
+++ b/arch/i386/defconfig
@@ -1148,7 +1148,7 @@ CONFIG_NFS_FS=y
 # CONFIG_NFS_DIRECTIO is not set
 CONFIG_NFSD=y
 # CONFIG_NFSD_V3 is not set
-# CONFIG_NFSD_TCP is not set
+CONFIG_NFSD_TCP=y
 CONFIG_LOCKD=y
 CONFIG_EXPORTFS=y
 CONFIG_SUNRPC=y
diff --git a/arch/i386/kernel/Makefile b/arch/i386/kernel/Makefile
index 70b4604da..00cc32e33 100644
--- a/arch/i386/kernel/Makefile
+++ b/arch/i386/kernel/Makefile
@@ -31,7 +31,6 @@ obj-$(CONFIG_ACPI_SRAT) 	+= srat.o
 obj-$(CONFIG_HPET_TIMER) 	+= time_hpet.o
 obj-$(CONFIG_EFI) 		+= efi.o efi_stub.o
 obj-$(CONFIG_EARLY_PRINTK)	+= early_printk.o
-obj-$(CONFIG_X86_STD_RESOURCES)	+= std_resources.o
 
 EXTRA_AFLAGS   := -traditional
 
diff --git a/arch/i386/kernel/acpi/boot.c b/arch/i386/kernel/acpi/boot.c
index 2c53ca535..e54aefaa8 100644
--- a/arch/i386/kernel/acpi/boot.c
+++ b/arch/i386/kernel/acpi/boot.c
@@ -28,7 +28,9 @@
 #include <linux/acpi.h>
 #include <linux/efi.h>
 #include <linux/irq.h>
-#include <asm/pgalloc.h>
+#include <linux/module.h>
+
+#include <asm/pgtable.h>
 #include <asm/io_apic.h>
 #include <asm/apic.h>
 #include <asm/io.h>
@@ -139,7 +141,7 @@ char *__acpi_map_table(unsigned long phys, unsigned long size)
 	idx = FIX_ACPI_END;
 	while (mapped_size < size) {
 		if (--idx < FIX_ACPI_BEGIN)
-			return 0;	/* cannot handle this */
+			return NULL;	/* cannot handle this */
 		phys += PAGE_SIZE;
 		set_fixmap(idx, phys);
 		mapped_size += PAGE_SIZE;
@@ -437,6 +439,38 @@ int acpi_gsi_to_irq(u32 gsi, unsigned int *irq)
 	return 0;
 }
 
+unsigned int acpi_register_gsi(u32 gsi, int edge_level, int active_high_low)
+{
+	unsigned int irq;
+
+#ifdef CONFIG_PCI
+	/*
+	 * Make sure all (legacy) PCI IRQs are set as level-triggered.
+	 */
+	if (acpi_irq_model == ACPI_IRQ_MODEL_PIC) {
+		static u16 irq_mask;
+		extern void eisa_set_level_irq(unsigned int irq);
+
+		if (edge_level == ACPI_LEVEL_SENSITIVE) {
+			if ((gsi < 16) && !((1 << gsi) & irq_mask)) {
+				Dprintk(KERN_DEBUG PREFIX "Setting GSI %u as level-triggered\n", gsi);
+				irq_mask |= (1 << gsi);
+				eisa_set_level_irq(gsi);
+			}
+		}
+	}
+#endif
+
+#ifdef CONFIG_X86_IO_APIC
+	if (acpi_irq_model == ACPI_IRQ_MODEL_IOAPIC) {
+		mp_register_gsi(gsi, edge_level, active_high_low);
+	}
+#endif
+	acpi_gsi_to_irq(gsi, &irq);
+	return irq;
+}
+EXPORT_SYMBOL(acpi_register_gsi);
+
 static unsigned long __init
 acpi_scan_rsdp (
 	unsigned long		start,
@@ -526,7 +560,7 @@ extern u32 pmtmr_ioport;
 
 static int __init acpi_parse_fadt(unsigned long phys, unsigned long size)
 {
-	struct fadt_descriptor_rev2 *fadt =0;
+	struct fadt_descriptor_rev2 *fadt = NULL;
 
 	fadt = (struct fadt_descriptor_rev2*) __acpi_map_table(phys,size);
 	if(!fadt) {
diff --git a/arch/i386/kernel/apic.c b/arch/i386/kernel/apic.c
index 1df49f709..ecf2b632f 100644
--- a/arch/i386/kernel/apic.c
+++ b/arch/i386/kernel/apic.c
@@ -31,7 +31,6 @@
 #include <asm/smp.h>
 #include <asm/mtrr.h>
 #include <asm/mpspec.h>
-#include <asm/pgalloc.h>
 #include <asm/desc.h>
 #include <asm/arch_hooks.h>
 #include <asm/hpet.h>
@@ -81,6 +80,17 @@ void enable_NMI_through_LVT0 (void * dummy)
 	apic_write_around(APIC_LVT0, v);
 }
 
+int get_physical_broadcast(void)
+{
+	unsigned int lvr, version;
+	lvr = apic_read(APIC_LVR);
+	version = GET_APIC_VERSION(lvr);
+	if (version >= 0x14)
+		return 0xff;
+	else
+		return 0xf;
+}
+
 int get_maxlvt(void)
 {
 	unsigned int v, ver, maxlvt;
diff --git a/arch/i386/kernel/apm.c b/arch/i386/kernel/apm.c
index 01b05016e..3b1ef4bcb 100644
--- a/arch/i386/kernel/apm.c
+++ b/arch/i386/kernel/apm.c
@@ -222,11 +222,12 @@
 #include <linux/kernel.h>
 #include <linux/smp.h>
 #include <linux/smp_lock.h>
+#include <linux/dmi.h>
+#include <linux/suspend.h>
 
 #include <asm/system.h>
 #include <asm/uaccess.h>
 #include <asm/desc.h>
-#include <asm/suspend.h>
 
 #include "io_ports.h"
 
@@ -1884,6 +1885,319 @@ static struct miscdevice apm_device = {
 	&apm_bios_fops
 };
 
+
+/* Simple "print if true" callback */
+static int __init print_if_true(struct dmi_system_id *d)
+{
+	printk("%s\n", d->ident);
+	return 0;
+}
+
+/*
+ * Some Bioses enable the PS/2 mouse (touchpad) at resume, even if it was
+ * disabled before the suspend. Linux used to get terribly confused by that.
+ */
+static int __init broken_ps2_resume(struct dmi_system_id *d)
+{
+	printk(KERN_INFO "%s machine detected. Mousepad Resume Bug workaround hopefully not needed.\n", d->ident);
+	return 0;
+}
+
+/* Some bioses have a broken protected mode poweroff and need to use realmode */
+static int __init set_realmode_power_off(struct dmi_system_id *d)
+{
+	if (apm_info.realmode_power_off == 0) {
+		apm_info.realmode_power_off = 1;
+		printk(KERN_INFO "%s bios detected. Using realmode poweroff only.\n", d->ident);
+	}
+	return 0;
+}
+
+/* Some laptops require interrupts to be enabled during APM calls */
+static int __init set_apm_ints(struct dmi_system_id *d)
+{
+	if (apm_info.allow_ints == 0) {
+		apm_info.allow_ints = 1;
+		printk(KERN_INFO "%s machine detected. Enabling interrupts during APM calls.\n", d->ident);
+	}
+	return 0;
+}
+
+/* Some APM bioses corrupt memory or just plain do not work */
+static int __init apm_is_horked(struct dmi_system_id *d)
+{
+	if (apm_info.disabled == 0) {
+		apm_info.disabled = 1;
+		printk(KERN_INFO "%s machine detected. Disabling APM.\n", d->ident);
+	}
+	return 0;
+}
+
+static int __init apm_is_horked_d850md(struct dmi_system_id *d)
+{
+	if (apm_info.disabled == 0) {
+		apm_info.disabled = 1;
+		printk(KERN_INFO "%s machine detected. Disabling APM.\n", d->ident);
+		printk(KERN_INFO "This bug is fixed in bios P15 which is available for \n");
+		printk(KERN_INFO "download from support.intel.com \n");
+	}
+	return 0;
+}
+
+/* Some APM bioses hang on APM idle calls */
+static int __init apm_likes_to_melt(struct dmi_system_id *d)
+{
+	if (apm_info.forbid_idle == 0) {
+		apm_info.forbid_idle = 1;
+		printk(KERN_INFO "%s machine detected. Disabling APM idle calls.\n", d->ident);
+	}
+	return 0;
+}
+
+/*
+ *  Check for clue free BIOS implementations who use
+ *  the following QA technique
+ *
+ *      [ Write BIOS Code ]<------
+ *               |                ^
+ *      < Does it Compile >----N--
+ *               |Y               ^
+ *	< Does it Boot Win98 >-N--
+ *               |Y
+ *           [Ship It]
+ *
+ *	Phoenix A04  08/24/2000 is known bad (Dell Inspiron 5000e)
+ *	Phoenix A07  09/29/2000 is known good (Dell Inspiron 5000)
+ */
+static int __init broken_apm_power(struct dmi_system_id *d)
+{
+	apm_info.get_power_status_broken = 1;
+	printk(KERN_WARNING "BIOS strings suggest APM bugs, disabling power status reporting.\n");
+	return 0;
+}
+
+/*
+ * This bios swaps the APM minute reporting bytes over (Many sony laptops
+ * have this problem).
+ */
+static int __init swab_apm_power_in_minutes(struct dmi_system_id *d)
+{
+	apm_info.get_power_status_swabinminutes = 1;
+	printk(KERN_WARNING "BIOS strings suggest APM reports battery life in minutes and wrong byte order.\n");
+	return 0;
+}
+
+static struct dmi_system_id __initdata apm_dmi_table[] = {
+	{
+		print_if_true,
+		KERN_WARNING "IBM T23 - BIOS 1.03b+ and controller firmware 1.02+ may be needed for Linux APM.",
+		{	DMI_MATCH(DMI_SYS_VENDOR, "IBM"),
+			DMI_MATCH(DMI_BIOS_VERSION, "1AET38WW (1.01b)"), },
+	},
+	{	/* Handle problems with APM on the C600 */
+		broken_ps2_resume, "Dell Latitude C600",
+		{	DMI_MATCH(DMI_SYS_VENDOR, "Dell"),
+			DMI_MATCH(DMI_PRODUCT_NAME, "Latitude C600"), },
+	},
+	{	/* Allow interrupts during suspend on Dell Latitude laptops*/
+		set_apm_ints, "Dell Latitude",
+		{	DMI_MATCH(DMI_SYS_VENDOR, "Dell Computer Corporation"),
+			DMI_MATCH(DMI_PRODUCT_NAME, "Latitude C510"), }
+	},
+	{	/* APM crashes */
+		apm_is_horked, "Dell Inspiron 2500",
+		{	DMI_MATCH(DMI_SYS_VENDOR, "Dell Computer Corporation"),
+			DMI_MATCH(DMI_PRODUCT_NAME, "Inspiron 2500"),
+			DMI_MATCH(DMI_BIOS_VENDOR,"Phoenix Technologies LTD"),
+			DMI_MATCH(DMI_BIOS_VERSION,"A11"), },
+	},
+	{	/* Allow interrupts during suspend on Dell Inspiron laptops*/
+		set_apm_ints, "Dell Inspiron", {
+			DMI_MATCH(DMI_SYS_VENDOR, "Dell Computer Corporation"),
+			DMI_MATCH(DMI_PRODUCT_NAME, "Inspiron 4000"), },
+	},
+	{	/* Handle problems with APM on Inspiron 5000e */
+		broken_apm_power, "Dell Inspiron 5000e",
+		{	DMI_MATCH(DMI_BIOS_VENDOR, "Phoenix Technologies LTD"),
+			DMI_MATCH(DMI_BIOS_VERSION, "A04"),
+			DMI_MATCH(DMI_BIOS_DATE, "08/24/2000"), },
+	},
+	{	/* Handle problems with APM on Inspiron 2500 */
+		broken_apm_power, "Dell Inspiron 2500",
+		{	DMI_MATCH(DMI_BIOS_VENDOR, "Phoenix Technologies LTD"),
+			DMI_MATCH(DMI_BIOS_VERSION, "A12"),
+			DMI_MATCH(DMI_BIOS_DATE, "02/04/2002"), },
+	},
+	{	/* APM crashes */
+		apm_is_horked, "Dell Dimension 4100",
+		{	DMI_MATCH(DMI_SYS_VENDOR, "Dell Computer Corporation"),
+			DMI_MATCH(DMI_PRODUCT_NAME, "XPS-Z"),
+			DMI_MATCH(DMI_BIOS_VENDOR,"Intel Corp."),
+			DMI_MATCH(DMI_BIOS_VERSION,"A11"), },
+	},
+	{	/* Allow interrupts during suspend on Compaq Laptops*/
+		set_apm_ints, "Compaq 12XL125",
+		{	DMI_MATCH(DMI_SYS_VENDOR, "Compaq"),
+			DMI_MATCH(DMI_PRODUCT_NAME, "Compaq PC"),
+			DMI_MATCH(DMI_BIOS_VENDOR, "Phoenix Technologies LTD"),
+			DMI_MATCH(DMI_BIOS_VERSION,"4.06"), },
+	},
+	{	/* Allow interrupts during APM or the clock goes slow */
+		set_apm_ints, "ASUSTeK",
+		{	DMI_MATCH(DMI_SYS_VENDOR, "ASUSTeK Computer Inc."),
+			DMI_MATCH(DMI_PRODUCT_NAME, "L8400K series Notebook PC"), },
+	},
+	{	/* APM blows on shutdown */
+		apm_is_horked, "ABIT KX7-333[R]",
+		{	DMI_MATCH(DMI_BOARD_VENDOR, "ABIT"),
+			DMI_MATCH(DMI_BOARD_NAME, "VT8367-8233A (KX7-333[R])"), },
+	},
+	{	/* APM crashes */
+		apm_is_horked, "Trigem Delhi3",
+		{	DMI_MATCH(DMI_SYS_VENDOR, "TriGem Computer, Inc"),
+			DMI_MATCH(DMI_PRODUCT_NAME, "Delhi3"), },
+	},
+	{	/* APM crashes */
+		apm_is_horked, "Fujitsu-Siemens",
+		{	DMI_MATCH(DMI_BIOS_VENDOR, "hoenix/FUJITSU SIEMENS"),
+			DMI_MATCH(DMI_BIOS_VERSION, "Version1.01"), },
+	},
+	{	/* APM crashes */
+		apm_is_horked_d850md, "Intel D850MD",
+		{	DMI_MATCH(DMI_BIOS_VENDOR, "Intel Corp."),
+			DMI_MATCH(DMI_BIOS_VERSION, "MV85010A.86A.0016.P07.0201251536"), },
+	},
+	{	/* APM crashes */
+		apm_is_horked, "Intel D810EMO",
+		{	DMI_MATCH(DMI_BIOS_VENDOR, "Intel Corp."),
+			DMI_MATCH(DMI_BIOS_VERSION, "MO81010A.86A.0008.P04.0004170800"), },
+	},
+	{	/* APM crashes */
+		apm_is_horked, "Dell XPS-Z",
+		{	DMI_MATCH(DMI_BIOS_VENDOR, "Intel Corp."),
+			DMI_MATCH(DMI_BIOS_VERSION, "A11"),
+			DMI_MATCH(DMI_PRODUCT_NAME, "XPS-Z"), },
+	},
+	{	/* APM crashes */
+		apm_is_horked, "Sharp PC-PJ/AX",
+		{	DMI_MATCH(DMI_SYS_VENDOR, "SHARP"),
+			DMI_MATCH(DMI_PRODUCT_NAME, "PC-PJ/AX"),
+			DMI_MATCH(DMI_BIOS_VENDOR,"SystemSoft"),
+			DMI_MATCH(DMI_BIOS_VERSION,"Version R2.08"), },
+	},
+	{	/* APM crashes */
+		apm_is_horked, "Dell Inspiron 2500",
+		{	DMI_MATCH(DMI_SYS_VENDOR, "Dell Computer Corporation"),
+			DMI_MATCH(DMI_PRODUCT_NAME, "Inspiron 2500"),
+			DMI_MATCH(DMI_BIOS_VENDOR,"Phoenix Technologies LTD"),
+			DMI_MATCH(DMI_BIOS_VERSION,"A11"), },
+	},
+	{	/* APM idle hangs */
+		apm_likes_to_melt, "Jabil AMD",
+		{	DMI_MATCH(DMI_BIOS_VENDOR, "American Megatrends Inc."),
+			DMI_MATCH(DMI_BIOS_VERSION, "0AASNP06"), },
+	},
+	{	/* APM idle hangs */
+		apm_likes_to_melt, "AMI Bios",
+		{	DMI_MATCH(DMI_BIOS_VENDOR, "American Megatrends Inc."),
+			DMI_MATCH(DMI_BIOS_VERSION, "0AASNP05"), },
+	},
+	{	/* Handle problems with APM on Sony Vaio PCG-N505X(DE) */
+		swab_apm_power_in_minutes, "Sony VAIO",
+		{	DMI_MATCH(DMI_BIOS_VENDOR, "Phoenix Technologies LTD"),
+			DMI_MATCH(DMI_BIOS_VERSION, "R0206H"),
+			DMI_MATCH(DMI_BIOS_DATE, "08/23/99"), },
+	},
+	{	/* Handle problems with APM on Sony Vaio PCG-N505VX */
+		swab_apm_power_in_minutes, "Sony VAIO",
+		{	DMI_MATCH(DMI_BIOS_VENDOR, "Phoenix Technologies LTD"),
+			DMI_MATCH(DMI_BIOS_VERSION, "W2K06H0"),
+			DMI_MATCH(DMI_BIOS_DATE, "02/03/00"), },
+	},
+	{	/* Handle problems with APM on Sony Vaio PCG-XG29 */
+		swab_apm_power_in_minutes, "Sony VAIO",
+		{	DMI_MATCH(DMI_BIOS_VENDOR, "Phoenix Technologies LTD"),
+			DMI_MATCH(DMI_BIOS_VERSION, "R0117A0"),
+			DMI_MATCH(DMI_BIOS_DATE, "04/25/00"), },
+	},
+	{	/* Handle problems with APM on Sony Vaio PCG-Z600NE */
+		swab_apm_power_in_minutes, "Sony VAIO",
+		{	DMI_MATCH(DMI_BIOS_VENDOR, "Phoenix Technologies LTD"),
+			DMI_MATCH(DMI_BIOS_VERSION, "R0121Z1"),
+			DMI_MATCH(DMI_BIOS_DATE, "05/11/00"), },
+	},
+	{	/* Handle problems with APM on Sony Vaio PCG-Z600NE */
+		swab_apm_power_in_minutes, "Sony VAIO",
+		{	DMI_MATCH(DMI_BIOS_VENDOR, "Phoenix Technologies LTD"),
+			DMI_MATCH(DMI_BIOS_VERSION, "WME01Z1"),
+			DMI_MATCH(DMI_BIOS_DATE, "08/11/00"), },
+	},
+	{	/* Handle problems with APM on Sony Vaio PCG-Z600LEK(DE) */
+		swab_apm_power_in_minutes, "Sony VAIO",
+		{	DMI_MATCH(DMI_BIOS_VENDOR, "Phoenix Technologies LTD"),
+			DMI_MATCH(DMI_BIOS_VERSION, "R0206Z3"),
+			DMI_MATCH(DMI_BIOS_DATE, "12/25/00"), },
+	},
+	{	/* Handle problems with APM on Sony Vaio PCG-Z505LS */
+		swab_apm_power_in_minutes, "Sony VAIO",
+		{	DMI_MATCH(DMI_BIOS_VENDOR, "Phoenix Technologies LTD"),
+			DMI_MATCH(DMI_BIOS_VERSION, "R0203D0"),
+			DMI_MATCH(DMI_BIOS_DATE, "05/12/00"), },
+	},
+	{	/* Handle problems with APM on Sony Vaio PCG-Z505LS */
+		swab_apm_power_in_minutes, "Sony VAIO",
+		{	DMI_MATCH(DMI_BIOS_VENDOR, "Phoenix Technologies LTD"),
+			DMI_MATCH(DMI_BIOS_VERSION, "R0203Z3"),
+			DMI_MATCH(DMI_BIOS_DATE, "08/25/00"), },
+	},
+	{	/* Handle problems with APM on Sony Vaio PCG-Z505LS (with updated BIOS) */
+		swab_apm_power_in_minutes, "Sony VAIO",
+		{	DMI_MATCH(DMI_BIOS_VENDOR, "Phoenix Technologies LTD"),
+			DMI_MATCH(DMI_BIOS_VERSION, "R0209Z3"),
+			DMI_MATCH(DMI_BIOS_DATE, "05/12/01"), },
+	},
+	{	/* Handle problems with APM on Sony Vaio PCG-F104K */
+		swab_apm_power_in_minutes, "Sony VAIO",
+		{	DMI_MATCH(DMI_BIOS_VENDOR, "Phoenix Technologies LTD"),
+			DMI_MATCH(DMI_BIOS_VERSION, "R0204K2"),
+			DMI_MATCH(DMI_BIOS_DATE, "08/28/00"), },
+	},
+
+	{	/* Handle problems with APM on Sony Vaio PCG-C1VN/C1VE */
+		swab_apm_power_in_minutes, "Sony VAIO",
+		{	DMI_MATCH(DMI_BIOS_VENDOR, "Phoenix Technologies LTD"),
+			DMI_MATCH(DMI_BIOS_VERSION, "R0208P1"),
+			DMI_MATCH(DMI_BIOS_DATE, "11/09/00"), },
+	},
+	{	/* Handle problems with APM on Sony Vaio PCG-C1VE */
+		swab_apm_power_in_minutes, "Sony VAIO",
+		{	DMI_MATCH(DMI_BIOS_VENDOR, "Phoenix Technologies LTD"),
+			DMI_MATCH(DMI_BIOS_VERSION, "R0204P1"),
+			DMI_MATCH(DMI_BIOS_DATE, "09/12/00"), },
+	},
+	{	/* Handle problems with APM on Sony Vaio PCG-C1VE */
+		swab_apm_power_in_minutes, "Sony VAIO",
+		{	DMI_MATCH(DMI_BIOS_VENDOR, "Phoenix Technologies LTD"),
+			DMI_MATCH(DMI_BIOS_VERSION, "WXPO1Z3"),
+			DMI_MATCH(DMI_BIOS_DATE, "10/26/01"), },
+	},
+	{	/* broken PM poweroff bios */
+		set_realmode_power_off, "Award Software v4.60 PGMA",
+		{	DMI_MATCH(DMI_BIOS_VENDOR, "Award Software International, Inc."),
+			DMI_MATCH(DMI_BIOS_VERSION, "4.60 PGMA"),
+			DMI_MATCH(DMI_BIOS_DATE, "134526184"), },
+	},
+
+	/* Generic per vendor APM settings  */
+
+	{	/* Allow interrupts during suspend on IBM laptops */
+		set_apm_ints, "IBM",
+		{	DMI_MATCH(DMI_SYS_VENDOR, "IBM"), },
+	},
+
+	{ }
+};
+
 /*
  * Just start the APM thread. We do NOT want to do APM BIOS
  * calls from anything but the APM thread, if for no other reason
@@ -1900,6 +2214,8 @@ static int __init apm_init(void)
 	int ret;
 	int i;
 
+	dmi_check_system(apm_dmi_table);
+
 	if (apm_info.bios.version == 0) {
 		printk(KERN_INFO "apm: BIOS not found.\n");
 		return -ENODEV;
diff --git a/arch/i386/kernel/cpu/common.c b/arch/i386/kernel/cpu/common.c
index fbb6a591c..30e25e357 100644
--- a/arch/i386/kernel/cpu/common.c
+++ b/arch/i386/kernel/cpu/common.c
@@ -329,7 +329,7 @@ void __init identify_cpu(struct cpuinfo_x86 *c)
 
 	generic_identify(c);
 
-	printk(KERN_DEBUG "CPU:     After generic identify, caps: %08lx %08lx %08lx %08lx\n",
+	printk(KERN_DEBUG "CPU: After generic identify, caps: %08lx %08lx %08lx %08lx\n",
 		c->x86_capability[0],
 		c->x86_capability[1],
 		c->x86_capability[2],
@@ -338,7 +338,7 @@ void __init identify_cpu(struct cpuinfo_x86 *c)
 	if (this_cpu->c_identify) {
 		this_cpu->c_identify(c);
 
-	printk(KERN_DEBUG "CPU:     After vendor identify, caps: %08lx %08lx %08lx %08lx\n",
+	printk(KERN_DEBUG "CPU: After vendor identify, caps:  %08lx %08lx %08lx %08lx\n",
 		c->x86_capability[0],
 		c->x86_capability[1],
 		c->x86_capability[2],
@@ -393,7 +393,7 @@ void __init identify_cpu(struct cpuinfo_x86 *c)
 
 	/* Now the feature flags better reflect actual CPU features! */
 
-	printk(KERN_DEBUG "CPU:     After all inits, caps: %08lx %08lx %08lx %08lx\n",
+	printk(KERN_DEBUG "CPU: After all inits, caps:        %08lx %08lx %08lx %08lx\n",
 	       c->x86_capability[0],
 	       c->x86_capability[1],
 	       c->x86_capability[2],
@@ -473,7 +473,6 @@ void early_cpu_detect(void);
 
 void __init early_cpu_init(void)
 {
-	early_cpu_detect();
 	intel_cpu_init();
 	cyrix_init_cpu();
 	nsc_init_cpu();
@@ -483,6 +482,7 @@ void __init early_cpu_init(void)
 	rise_init_cpu();
 	nexgen_init_cpu();
 	umc_init_cpu();
+	early_cpu_detect();
 
 #ifdef CONFIG_DEBUG_PAGEALLOC
 	/* pse is not compatible with on-the-fly unmapping,
diff --git a/arch/i386/kernel/cpu/cpufreq/powernow-k7.c b/arch/i386/kernel/cpu/cpufreq/powernow-k7.c
index 7aefc6764..18d30ab9a 100644
--- a/arch/i386/kernel/cpu/cpufreq/powernow-k7.c
+++ b/arch/i386/kernel/cpu/cpufreq/powernow-k7.c
@@ -22,6 +22,7 @@
 #include <linux/cpufreq.h>
 #include <linux/slab.h>
 #include <linux/string.h>
+#include <linux/dmi.h>
 
 #include <asm/msr.h>
 #include <asm/timex.h>
@@ -554,6 +555,31 @@ static unsigned int powernow_get(unsigned int cpu)
 }
 
 
+static int __init acer_cpufreq_pst(struct dmi_system_id *d)
+{
+	printk(KERN_WARNING "%s laptop with broken PST tables in BIOS detected.\n", d->ident);
+	printk(KERN_WARNING "You need to downgrade to 3A21 (09/09/2002), or try a newer BIOS than 3A71 (01/20/2003)\n");
+	printk(KERN_WARNING "cpufreq scaling has been disabled as a result of this.\n");
+	return 0;
+}
+
+/*
+ * Some Athlon laptops have really fucked PST tables.
+ * A BIOS update is all that can save them.
+ * Mention this, and disable cpufreq.
+ */
+static struct dmi_system_id __initdata powernow_dmi_table[] = {
+	{
+		.callback = acer_cpufreq_pst,
+		.ident = "Acer Aspire",
+		.matches = {
+			DMI_MATCH(DMI_SYS_VENDOR, "Insyde Software"),
+			DMI_MATCH(DMI_BIOS_VERSION, "3A71"),
+		},
+	},
+	{ }
+};
+
 static int __init powernow_cpu_init (struct cpufreq_policy *policy)
 {
 	union msr_fidvidstatus fidvidstatus;
@@ -572,7 +598,7 @@ static int __init powernow_cpu_init (struct cpufreq_policy *policy)
 	}
 	dprintk(KERN_INFO PFX "FSB: %3d.%03d MHz\n", fsb/1000, fsb%1000);
 
-	if ((dmi_broken & BROKEN_CPUFREQ) || acpi_force) {
+ 	if (dmi_check_system(powernow_dmi_table) || acpi_force) {
 		printk (KERN_INFO PFX "PSB/PST known to be broken.  Trying ACPI instead\n");
 		result = powernow_acpi_init();
 	} else {
diff --git a/arch/i386/kernel/cpu/cpufreq/speedstep-centrino.c b/arch/i386/kernel/cpu/cpufreq/speedstep-centrino.c
index f84f9af7a..ea9173812 100644
--- a/arch/i386/kernel/cpu/cpufreq/speedstep-centrino.c
+++ b/arch/i386/kernel/cpu/cpufreq/speedstep-centrino.c
@@ -214,7 +214,7 @@ static struct cpu_model models[] =
 	BANIAS(1500),
 	BANIAS(1600),
 	BANIAS(1700),
-	{ 0, }
+	{ NULL, }
 };
 #undef _BANIAS
 #undef BANIAS
diff --git a/arch/i386/kernel/cpu/mtrr/generic.c b/arch/i386/kernel/cpu/mtrr/generic.c
index 3877f78f3..f37977fdb 100644
--- a/arch/i386/kernel/cpu/mtrr/generic.c
+++ b/arch/i386/kernel/cpu/mtrr/generic.c
@@ -18,7 +18,7 @@ struct mtrr_state {
 	mtrr_type def_type;
 };
 
-static unsigned long smp_changes_mask __initdata = 0;
+static unsigned long smp_changes_mask;
 struct mtrr_state mtrr_state = {};
 
 
diff --git a/arch/i386/kernel/cpu/mtrr/if.c b/arch/i386/kernel/cpu/mtrr/if.c
index c63550557..094684421 100644
--- a/arch/i386/kernel/cpu/mtrr/if.c
+++ b/arch/i386/kernel/cpu/mtrr/if.c
@@ -101,9 +101,6 @@ mtrr_write(struct file *file, const char __user *buf, size_t len, loff_t * ppos)
 
 	if (!capable(CAP_SYS_ADMIN))
 		return -EPERM;
-	/*  Can't seek (pwrite) on this device  */
-	if (ppos != &file->f_pos)
-		return -ESPIPE;
 	memset(line, 0, LINE_SIZE);
 	if (len > LINE_SIZE)
 		len = LINE_SIZE;
@@ -160,7 +157,7 @@ mtrr_ioctl(struct inode *inode, struct file *file,
 
 	switch (cmd) {
 	default:
-		return -ENOIOCTLCMD;
+		return -ENOTTY;
 	case MTRRIOC_ADD_ENTRY:
 		if (!capable(CAP_SYS_ADMIN))
 			return -EPERM;
diff --git a/arch/i386/kernel/cpu/proc.c b/arch/i386/kernel/cpu/proc.c
index 99b8d1116..423429491 100644
--- a/arch/i386/kernel/cpu/proc.c
+++ b/arch/i386/kernel/cpu/proc.c
@@ -27,7 +27,7 @@ static int show_cpuinfo(struct seq_file *m, void *v)
 		/* AMD-defined */
 		NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL,
 		NULL, NULL, NULL, "syscall", NULL, NULL, NULL, NULL,
-		NULL, NULL, NULL, "mp", NULL, NULL, "mmxext", NULL,
+		NULL, NULL, NULL, "mp", "nx", NULL, "mmxext", NULL,
 		NULL, NULL, NULL, NULL, NULL, "lm", "3dnowext", "3dnow",
 
 		/* Transmeta-defined */
diff --git a/arch/i386/kernel/cpuid.c b/arch/i386/kernel/cpuid.c
index 5a997a371..32a098431 100644
--- a/arch/i386/kernel/cpuid.c
+++ b/arch/i386/kernel/cpuid.c
@@ -36,12 +36,17 @@
 #include <linux/fs.h>
 #include <linux/smp_lock.h>
 #include <linux/fs.h>
+#include <linux/device.h>
+#include <linux/cpu.h>
+#include <linux/notifier.h>
 
 #include <asm/processor.h>
 #include <asm/msr.h>
 #include <asm/uaccess.h>
 #include <asm/system.h>
 
+static struct class_simple *cpuid_class;
+
 #ifdef CONFIG_SMP
 
 struct cpuid_command {
@@ -153,20 +158,84 @@ static struct file_operations cpuid_fops = {
 	.open = cpuid_open,
 };
 
+static int cpuid_class_simple_device_add(int i) 
+{
+	int err = 0;
+	struct class_device *class_err;
+
+	class_err = class_simple_device_add(cpuid_class, MKDEV(CPUID_MAJOR, i), NULL, "cpu%d",i);
+	if (IS_ERR(class_err))
+		err = PTR_ERR(class_err);
+	return err;
+}
+
+static int __devinit cpuid_class_cpu_callback(struct notifier_block *nfb, unsigned long action, void *hcpu)
+{
+	unsigned int cpu = (unsigned long)hcpu;
+
+	switch (action) {
+	case CPU_ONLINE:
+		cpuid_class_simple_device_add(cpu);
+		break;
+	case CPU_DEAD:
+		class_simple_device_remove(MKDEV(CPUID_MAJOR, cpu));
+		break;
+	}
+	return NOTIFY_OK;
+}
+
+static struct notifier_block cpuid_class_cpu_notifier =
+{
+	.notifier_call = cpuid_class_cpu_callback,
+};
+
 int __init cpuid_init(void)
 {
+	int i, err = 0;
+	i = 0;
+
 	if (register_chrdev(CPUID_MAJOR, "cpu/cpuid", &cpuid_fops)) {
 		printk(KERN_ERR "cpuid: unable to get major %d for cpuid\n",
 		       CPUID_MAJOR);
-		return -EBUSY;
+		err = -EBUSY;
+		goto out;
+	}
+	cpuid_class = class_simple_create(THIS_MODULE, "cpuid");
+	if (IS_ERR(cpuid_class)) {
+		err = PTR_ERR(cpuid_class);
+		goto out_chrdev;
 	}
+	for_each_online_cpu(i) {
+		err = cpuid_class_simple_device_add(i);
+		if (err != 0) 
+			goto out_class;
+	}
+	register_cpu_notifier(&cpuid_class_cpu_notifier);
 
-	return 0;
+	err = 0;
+	goto out;
+
+out_class:
+	i = 0;
+	for_each_online_cpu(i) {
+		class_simple_device_remove(MKDEV(CPUID_MAJOR, i));
+	}
+	class_simple_destroy(cpuid_class);
+out_chrdev:
+	unregister_chrdev(CPUID_MAJOR, "cpu/cpuid");	
+out:
+	return err;
 }
 
 void __exit cpuid_exit(void)
 {
+	int cpu = 0;
+
+	for_each_online_cpu(cpu)
+		class_simple_device_remove(MKDEV(CPUID_MAJOR, cpu));
+	class_simple_destroy(cpuid_class);
 	unregister_chrdev(CPUID_MAJOR, "cpu/cpuid");
+	unregister_cpu_notifier(&cpuid_class_cpu_notifier);
 }
 
 module_init(cpuid_init);
diff --git a/arch/i386/kernel/dmi_scan.c b/arch/i386/kernel/dmi_scan.c
index d9c97dae4..d2d2610f2 100644
--- a/arch/i386/kernel/dmi_scan.c
+++ b/arch/i386/kernel/dmi_scan.c
@@ -1,22 +1,17 @@
-#include <linux/config.h>
 #include <linux/types.h>
 #include <linux/kernel.h>
 #include <linux/string.h>
 #include <linux/init.h>
 #include <linux/module.h>
-#include <linux/apm_bios.h>
 #include <linux/slab.h>
 #include <asm/acpi.h>
 #include <asm/io.h>
 #include <linux/pm.h>
 #include <asm/system.h>
+#include <linux/dmi.h>
 #include <linux/bootmem.h>
 
-unsigned long dmi_broken;
-EXPORT_SYMBOL(dmi_broken);
 
-int is_sony_vaio_laptop;
-int is_unsafe_smbus;
 int es7000_plat = 0;
 
 struct dmi_header
@@ -139,21 +134,6 @@ static int __init dmi_iterate(void (*decode)(struct dmi_header *))
 	return -1;
 }
 
-
-enum
-{
-	DMI_BIOS_VENDOR,
-	DMI_BIOS_VERSION,
-	DMI_BIOS_DATE,
-	DMI_SYS_VENDOR,
-	DMI_PRODUCT_NAME,
-	DMI_PRODUCT_VERSION,
-	DMI_BOARD_VENDOR,
-	DMI_BOARD_NAME,
-	DMI_BOARD_VERSION,
-	DMI_STRING_MAX
-};
-
 static char *dmi_ident[DMI_STRING_MAX];
 
 /*
@@ -176,138 +156,11 @@ static void __init dmi_save_ident(struct dmi_header *dm, int slot, int string)
 }
 
 /*
- *	DMI callbacks for problem boards
- */
-
-struct dmi_strmatch
-{
-	u8 slot;
-	char *substr;
-};
-
-#define NONE	255
-
-struct dmi_blacklist
-{
-	int (*callback)(struct dmi_blacklist *);
-	char *ident;
-	struct dmi_strmatch matches[4];
-};
-
-#define NO_MATCH	{ NONE, NULL}
-#define MATCH(a,b)	{ a, b }
-
-/* 
- * Reboot options and system auto-detection code provided by
- * Dell Inc. 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)
-{
-	extern int reboot_thru_bios;
-	if (reboot_thru_bios == 0)
-	{
-		reboot_thru_bios = 1;
-		printk(KERN_INFO "%s series board detected. Selecting BIOS-method for reboots.\n", d->ident);
-	}
-	return 0;
-}
-
-/*
- * 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.
+ * Ugly compatibility crap.
  */
-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
- */
-
-static __init int set_realmode_power_off(struct dmi_blacklist *d)
-{
-       if (apm_info.realmode_power_off == 0)
-       {
-               apm_info.realmode_power_off = 1;
-               printk(KERN_INFO "%s bios detected. Using realmode poweroff only.\n", d->ident);
-       }
-       return 0;
-}
-
-
-/* 
- * Some laptops require interrupts to be enabled during APM calls 
- */
-
-static __init int set_apm_ints(struct dmi_blacklist *d)
-{
-	if (apm_info.allow_ints == 0)
-	{
-		apm_info.allow_ints = 1;
-		printk(KERN_INFO "%s machine detected. Enabling interrupts during APM calls.\n", d->ident);
-	}
-	return 0;
-}
-
-/* 
- * Some APM bioses corrupt memory or just plain do not work
- */
-
-static __init int apm_is_horked(struct dmi_blacklist *d)
-{
-	if (apm_info.disabled == 0)
-	{
-		apm_info.disabled = 1;
-		printk(KERN_INFO "%s machine detected. Disabling APM.\n", d->ident);
-	}
-	return 0;
-}
-
-static __init int apm_is_horked_d850md(struct dmi_blacklist *d)
-{
-	if (apm_info.disabled == 0) {
-		apm_info.disabled = 1;
-		printk(KERN_INFO "%s machine detected. Disabling APM.\n", d->ident);
-		printk(KERN_INFO "This bug is fixed in bios P15 which is available for \n");
-		printk(KERN_INFO "download from support.intel.com \n");
-	}
-	return 0;
-}
-
-/* 
- * Some APM bioses hang on APM idle calls
- */
-
-static __init int apm_likes_to_melt(struct dmi_blacklist *d)
-{
-	if (apm_info.forbid_idle == 0) {
-		apm_info.forbid_idle = 1;
-		printk(KERN_INFO "%s machine detected. Disabling APM idle calls.\n", d->ident);
-	}
-	return 0;
-}
+#define dmi_blacklist	dmi_system_id
+#define NO_MATCH	{ DMI_NONE, NULL}
+#define MATCH		DMI_MATCH
 
 /*
  * Some machines, usually laptops, can't handle an enabled local APIC.
@@ -329,99 +182,6 @@ static int __init local_apic_kills_bios(struct dmi_blacklist *d)
 	return 0;
 }
 
-/* 
- * Don't access SMBus on IBM systems which get corrupted eeproms 
- */
-
-static __init int disable_smbus(struct dmi_blacklist *d)
-{   
-	if (is_unsafe_smbus == 0) {
-		is_unsafe_smbus = 1;
-		printk(KERN_INFO "%s machine detected. Disabling SMBus accesses.\n", d->ident);
-	}
-	return 0;
-}
-
-/*
- * Work around broken HP Pavilion Notebooks which assign USB to
- * IRQ 9 even though it is actually wired to IRQ 11
- */
-static __init int fix_broken_hp_bios_irq9(struct dmi_blacklist *d)
-{
-#ifdef CONFIG_PCI
-	extern int broken_hp_bios_irq9;
-	if (broken_hp_bios_irq9 == 0)
-	{
-		broken_hp_bios_irq9 = 1;
-		printk(KERN_INFO "%s detected - fixing broken IRQ routing\n", d->ident);
-	}
-#endif
-	return 0;
-}
-
-/*
- *  Check for clue free BIOS implementations who use
- *  the following QA technique
- *
- *      [ Write BIOS Code ]<------
- *               |                ^
- *      < Does it Compile >----N--
- *               |Y               ^
- *	< Does it Boot Win98 >-N--
- *               |Y
- *           [Ship It]
- *
- *	Phoenix A04  08/24/2000 is known bad (Dell Inspiron 5000e)
- *	Phoenix A07  09/29/2000 is known good (Dell Inspiron 5000)
- */
-
-static __init int broken_apm_power(struct dmi_blacklist *d)
-{
-	apm_info.get_power_status_broken = 1;
-	printk(KERN_WARNING "BIOS strings suggest APM bugs, disabling power status reporting.\n");
-	return 0;
-}		
-
-/*
- * Check for a Sony Vaio system
- *
- * On a Sony system we want to enable the use of the sonypi
- * driver for Sony-specific goodies like the camera and jogdial.
- * We also want to avoid using certain functions of the PnP BIOS.
- */
-
-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;
-}
-
-/*
- * This bios swaps the APM minute reporting bytes over (Many sony laptops
- * have this problem).
- */
- 
-static __init int swab_apm_power_in_minutes(struct dmi_blacklist *d)
-{
-	apm_info.get_power_status_swabinminutes = 1;
-	printk(KERN_WARNING "BIOS strings suggest APM reports battery life in minutes and wrong byte order.\n");
-	return 0;
-}
-
-/*
- * ASUS K7V-RM has broken ACPI table defining sleep modes
- */
-
-static __init int broken_acpi_Sx(struct dmi_blacklist *d)
-{
-	printk(KERN_WARNING "Detected ASUS mainboard with broken ACPI sleep table\n");
-	dmi_broken |= BROKEN_ACPI_Sx;
-	return 0;
-}
 
 /*
  * Toshiba keyboard likes to repeat keys when they are not repeated.
@@ -433,16 +193,6 @@ static __init int broken_toshiba_keyboard(struct dmi_blacklist *d)
 	return 0;
 }
 
-/*
- * Toshiba fails to preserve interrupts over S1
- */
-
-static __init int init_ints_after_s1(struct dmi_blacklist *d)
-{
-	printk(KERN_WARNING "Toshiba with broken S1 detected.\n");
-	dmi_broken |= BROKEN_INIT_AFTER_S1;
-	return 0;
-}
 
 #ifdef CONFIG_ACPI_SLEEP
 static __init int reset_videomode_after_s3(struct dmi_blacklist *d)
@@ -454,49 +204,6 @@ static __init int reset_videomode_after_s3(struct dmi_blacklist *d)
 }
 #endif
 
-/*
- * Some Bioses enable the PS/2 mouse (touchpad) at resume, even if it was
- * disabled before the suspend. Linux used to get terribly confused by that.
- */
-
-static __init int broken_ps2_resume(struct dmi_blacklist *d)
-{
-	printk(KERN_INFO "%s machine detected. Mousepad Resume Bug workaround hopefully not needed.\n", d->ident);
-	return 0;
-}
-
-/*
- *	Exploding PnPBIOS. Don't yet know if its the BIOS or us for
- *	some entries
- */
-
-static __init int exploding_pnp_bios(struct dmi_blacklist *d)
-{
-	printk(KERN_WARNING "%s detected. Disabling PnPBIOS\n", d->ident);
-	dmi_broken |= BROKEN_PNP_BIOS;
-	return 0;
-}
-
-static __init int acer_cpufreq_pst(struct dmi_blacklist *d)
-{
-	printk(KERN_WARNING "%s laptop with broken PST tables in BIOS detected.\n", d->ident);
-	printk(KERN_WARNING "You need to downgrade to 3A21 (09/09/2002), or try a newer BIOS than 3A71 (01/20/2003)\n");
-	printk(KERN_WARNING "cpufreq scaling has been disabled as a result of this.\n");
-	dmi_broken |= BROKEN_CPUFREQ;
-	return 0;
-}
-
-
-/*
- *	Simple "print if true" callback
- */
- 
-static __init int print_if_true(struct dmi_blacklist *d)
-{
-	printk("%s\n", d->ident);
-	return 0;
-}
-
 
 #ifdef	CONFIG_ACPI_BOOT
 extern int acpi_force;
@@ -546,15 +253,21 @@ static __init int ignore_timer_override(struct dmi_blacklist *d)
 
 #ifdef	CONFIG_ACPI_PCI
 static __init int disable_acpi_irq(struct dmi_blacklist *d) 
-{ 
-	printk(KERN_NOTICE "%s detected: force use of acpi=noirq\n", d->ident); 	
-	acpi_noirq_set();
+{
+	if (!acpi_force) {
+		printk(KERN_NOTICE "%s detected: force use of acpi=noirq\n",
+		       d->ident); 	
+		acpi_noirq_set();
+	}
 	return 0;
 }
 static __init int disable_acpi_pci(struct dmi_blacklist *d) 
-{ 
-	printk(KERN_NOTICE "%s detected: force use of pci=noacpi\n", d->ident); 	
-	acpi_disable_pci();
+{
+	if (!acpi_force) {
+		printk(KERN_NOTICE "%s detected: force use of pci=noacpi\n",
+		       d->ident); 	
+		acpi_disable_pci();
+	}
 	return 0;
 }  
 #endif
@@ -570,221 +283,6 @@ static __init int disable_acpi_pci(struct dmi_blacklist *d)
  */
  
 static __initdata struct dmi_blacklist dmi_blacklist[]={
-	{ 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
-			} },
-	{ set_apm_ints, "Dell Latitude", {  /* Allow interrupts during suspend on Dell Latitude laptops*/
-			MATCH(DMI_SYS_VENDOR, "Dell Computer Corporation"),
-			MATCH(DMI_PRODUCT_NAME, "Latitude C510"),
-			NO_MATCH, NO_MATCH
-			} },
-	{ apm_is_horked, "Dell Inspiron 2500", { /* APM crashes */
-			MATCH(DMI_SYS_VENDOR, "Dell Computer Corporation"),
-			MATCH(DMI_PRODUCT_NAME, "Inspiron 2500"),
-			MATCH(DMI_BIOS_VENDOR,"Phoenix Technologies LTD"),
-			MATCH(DMI_BIOS_VERSION,"A11")
-			} },
-	{ set_apm_ints, "Dell Inspiron", {	/* Allow interrupts during suspend on Dell Inspiron laptops*/
-			MATCH(DMI_SYS_VENDOR, "Dell Computer Corporation"),
-			MATCH(DMI_PRODUCT_NAME, "Inspiron 4000"),
-			NO_MATCH, NO_MATCH
-			} },
-	{ broken_apm_power, "Dell Inspiron 5000e", {	/* Handle problems with APM on Inspiron 5000e */
-			MATCH(DMI_BIOS_VENDOR, "Phoenix Technologies LTD"),
-			MATCH(DMI_BIOS_VERSION, "A04"),
-			MATCH(DMI_BIOS_DATE, "08/24/2000"), NO_MATCH
-			} },
-	{ broken_apm_power, "Dell Inspiron 2500", {	/* Handle problems with APM on Inspiron 2500 */
-			MATCH(DMI_BIOS_VENDOR, "Phoenix Technologies LTD"),
-			MATCH(DMI_BIOS_VERSION, "A12"),
-			MATCH(DMI_BIOS_DATE, "02/04/2002"), NO_MATCH
-			} },
-	{ apm_is_horked, "Dell Dimension 4100", { /* APM crashes */
-			MATCH(DMI_SYS_VENDOR, "Dell Computer Corporation"),
-			MATCH(DMI_PRODUCT_NAME, "XPS-Z"),
-			MATCH(DMI_BIOS_VENDOR,"Intel Corp."),
-			MATCH(DMI_BIOS_VERSION,"A11")
-			} },
-	{ set_realmode_power_off, "Award Software v4.60 PGMA", {	/* broken PM poweroff bios */
-			MATCH(DMI_BIOS_VENDOR, "Award Software International, Inc."),
-			MATCH(DMI_BIOS_VERSION, "4.60 PGMA"),
-			MATCH(DMI_BIOS_DATE, "134526184"), NO_MATCH
-			} },
-	{ 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/"),
-			NO_MATCH, NO_MATCH
-			} },
-	{ set_bios_reboot, "Dell PowerEdge 300", {	/* Handle problems with rebooting on Dell 300's */
-			MATCH(DMI_SYS_VENDOR, "Dell Computer Corporation"),
-			MATCH(DMI_PRODUCT_NAME, "PowerEdge 300/"),
-			NO_MATCH, NO_MATCH
-			} },
-	{ set_bios_reboot, "Dell PowerEdge 2400", {  /* Handle problems with rebooting on Dell 2400's */
-			MATCH(DMI_SYS_VENDOR, "Dell Computer Corporation"),
-			MATCH(DMI_PRODUCT_NAME, "PowerEdge 2400"),
-			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"),
-			NO_MATCH, NO_MATCH
-			} },					
-	{ apm_is_horked, "ABIT KX7-333[R]", { /* APM blows on shutdown */
-			MATCH(DMI_BOARD_VENDOR, "ABIT"),
-			MATCH(DMI_BOARD_NAME, "VT8367-8233A (KX7-333[R])"),
-			NO_MATCH, NO_MATCH,
-			} },
-	{ apm_is_horked, "Trigem Delhi3", { /* APM crashes */
-			MATCH(DMI_SYS_VENDOR, "TriGem Computer, Inc"),
-			MATCH(DMI_PRODUCT_NAME, "Delhi3"),
-			NO_MATCH, NO_MATCH,
-			} },
-	{ apm_is_horked, "Fujitsu-Siemens", { /* APM crashes */
-			MATCH(DMI_BIOS_VENDOR, "hoenix/FUJITSU SIEMENS"),
-			MATCH(DMI_BIOS_VERSION, "Version1.01"),
-			NO_MATCH, NO_MATCH,
-			} },
-	{ apm_is_horked_d850md, "Intel D850MD", { /* APM crashes */
-			MATCH(DMI_BIOS_VENDOR, "Intel Corp."),
-			MATCH(DMI_BIOS_VERSION, "MV85010A.86A.0016.P07.0201251536"),
-			NO_MATCH, NO_MATCH,
-			} },
-	{ apm_is_horked, "Intel D810EMO", { /* APM crashes */
-			MATCH(DMI_BIOS_VENDOR, "Intel Corp."),
-			MATCH(DMI_BIOS_VERSION, "MO81010A.86A.0008.P04.0004170800"),
-			NO_MATCH, NO_MATCH,
-			} },
-	{ apm_is_horked, "Dell XPS-Z", { /* APM crashes */
-			MATCH(DMI_BIOS_VENDOR, "Intel Corp."),
-			MATCH(DMI_BIOS_VERSION, "A11"),
-			MATCH(DMI_PRODUCT_NAME, "XPS-Z"),
-			NO_MATCH,
-			} },
-	{ 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")
-			} },
-	{ apm_is_horked, "Dell Inspiron 2500", { /* APM crashes */
-			MATCH(DMI_SYS_VENDOR, "Dell Computer Corporation"),
-			MATCH(DMI_PRODUCT_NAME, "Inspiron 2500"),
-			MATCH(DMI_BIOS_VENDOR,"Phoenix Technologies LTD"),
-			MATCH(DMI_BIOS_VERSION,"A11")
-			} },
-	{ apm_likes_to_melt, "Jabil AMD", { /* APM idle hangs */
-			MATCH(DMI_BIOS_VENDOR, "American Megatrends Inc."),
-			MATCH(DMI_BIOS_VERSION, "0AASNP06"),
-			NO_MATCH, NO_MATCH,
-			} },
-	{ apm_likes_to_melt, "AMI Bios", { /* APM idle hangs */
-			MATCH(DMI_BIOS_VENDOR, "American Megatrends Inc."),
-			MATCH(DMI_BIOS_VERSION, "0AASNP05"), 
-			NO_MATCH, NO_MATCH,
-			} },
-	{ sony_vaio_laptop, "Sony Vaio", { /* This is a Sony Vaio laptop */
-			MATCH(DMI_SYS_VENDOR, "Sony Corporation"),
-			MATCH(DMI_PRODUCT_NAME, "PCG-"),
-			NO_MATCH, NO_MATCH,
-			} },
-	{ 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, "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-XG29 */
-			MATCH(DMI_BIOS_VENDOR, "Phoenix Technologies LTD"),
-			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-Z600NE */
-			MATCH(DMI_BIOS_VENDOR, "Phoenix Technologies LTD"),
-			MATCH(DMI_BIOS_VERSION, "WME01Z1"),
-			MATCH(DMI_BIOS_DATE, "08/11/00"), NO_MATCH
-			} },
-
-	{ swab_apm_power_in_minutes, "Sony VAIO", {	/* Handle problems with APM on Sony Vaio PCG-Z600LEK(DE) */
-			MATCH(DMI_BIOS_VENDOR, "Phoenix Technologies LTD"),
-			MATCH(DMI_BIOS_VERSION, "R0206Z3"),
-			MATCH(DMI_BIOS_DATE, "12/25/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-Z505LS (with updated BIOS) */
-			MATCH(DMI_BIOS_VENDOR, "Phoenix Technologies LTD"),
-			MATCH(DMI_BIOS_VERSION, "R0209Z3"),
-			MATCH(DMI_BIOS_DATE, "05/12/01"), 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
-			} },
-
-	{ 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, "WXPO1Z3"),
-			MATCH(DMI_BIOS_DATE, "10/26/01"), NO_MATCH
-			} },
-			
-	{ exploding_pnp_bios, "Higraded P14H", {	/* PnPBIOS GPF on boot */
-			MATCH(DMI_BIOS_VENDOR, "American Megatrends Inc."),
-			MATCH(DMI_BIOS_VERSION, "07.00T"),
-			MATCH(DMI_SYS_VENDOR, "Higraded"),
-			MATCH(DMI_PRODUCT_NAME, "P14H")
-			} },
-	{ exploding_pnp_bios, "ASUS P4P800", {	/* PnPBIOS GPF on boot */
-			MATCH(DMI_BOARD_VENDOR, "ASUSTeK Computer Inc."),
-			MATCH(DMI_BOARD_NAME, "P4P800"),
-			NO_MATCH, NO_MATCH
-			} },
 
 	/* Machines which have problems handling enabled local APICs */
 
@@ -812,20 +310,10 @@ static __initdata struct dmi_blacklist dmi_blacklist[]={
 			NO_MATCH, NO_MATCH
 			} },
 
-	{ broken_acpi_Sx, "ASUS K7V-RM", {		/* Bad ACPI Sx table */
-			MATCH(DMI_BIOS_VERSION,"ASUS K7V-RM ACPI BIOS Revision 1003A"),
-			MATCH(DMI_BOARD_NAME, "<K7V-RM>"),
-			NO_MATCH, NO_MATCH
-			} },
-
 	{ broken_toshiba_keyboard, "Toshiba Satellite 4030cdt", { /* Keyboard generates spurious repeats */
 			MATCH(DMI_PRODUCT_NAME, "S4030CDT/4.3"),
 			NO_MATCH, NO_MATCH, NO_MATCH
 			} },
-	{ init_ints_after_s1, "Toshiba Satellite 4030cdt", { /* Reinitialization of 8259 is needed after S1 resume */
-			MATCH(DMI_PRODUCT_NAME, "S4030CDT/4.3"),
-			NO_MATCH, NO_MATCH, NO_MATCH
-			} },
 #ifdef CONFIG_ACPI_SLEEP
 	{ reset_videomode_after_s3, "Toshiba Satellite 4030cdt", { /* Reset video mode after returning from ACPI S3 sleep */
 			MATCH(DMI_PRODUCT_NAME, "S4030CDT/4.3"),
@@ -833,49 +321,6 @@ static __initdata struct dmi_blacklist dmi_blacklist[]={
 			} },
 #endif
 
-	{ print_if_true, KERN_WARNING "IBM T23 - BIOS 1.03b+ and controller firmware 1.02+ may be needed for Linux APM.", {
-			MATCH(DMI_SYS_VENDOR, "IBM"),
-			MATCH(DMI_BIOS_VERSION, "1AET38WW (1.01b)"),
-			NO_MATCH, NO_MATCH
-			} },
-	 
-	{ fix_broken_hp_bios_irq9, "HP Pavilion N5400 Series Laptop", {
-			MATCH(DMI_SYS_VENDOR, "Hewlett-Packard"),
-			MATCH(DMI_BIOS_VERSION, "GE.M1.03"),
-			MATCH(DMI_PRODUCT_VERSION, "HP Pavilion Notebook Model GE"),
-			MATCH(DMI_BOARD_VERSION, "OmniBook N32N-736")
-			} },
- 
-
-	/*
-	 *	Generic per vendor APM settings
-	 */
-	 
-	{ set_apm_ints, "IBM", {	/* Allow interrupts during suspend on IBM laptops */
-			MATCH(DMI_SYS_VENDOR, "IBM"),
-			NO_MATCH, NO_MATCH, NO_MATCH
-			} },
-
-	/*
-	 *	SMBus / sensors settings
-	 */
-	 
-	{ disable_smbus, "IBM", {
-			MATCH(DMI_SYS_VENDOR, "IBM"),
-			NO_MATCH, NO_MATCH, NO_MATCH
-			} },
-
-	/*
-	 * Some Athlon laptops have really fucked PST tables.
-	 * A BIOS update is all that can save them.
-	 * Mention this, and disable cpufreq.
-	 */
-	{ acer_cpufreq_pst, "Acer Aspire", {
-			MATCH(DMI_SYS_VENDOR, "Insyde Software"),
-			MATCH(DMI_BIOS_VERSION, "3A71"),
-			NO_MATCH, NO_MATCH,
-			} },
-
 #ifdef	CONFIG_ACPI_BOOT
 	/*
 	 * If your system is blacklisted here, but you find that acpi=force
@@ -1034,6 +479,13 @@ static __initdata struct dmi_blacklist dmi_blacklist[]={
 			MATCH(DMI_BOARD_NAME, "PR-DLS"),
 			MATCH(DMI_BIOS_VERSION, "ASUS PR-DLS ACPI BIOS Revision 1010"),
 			MATCH(DMI_BIOS_DATE, "03/21/2003") }},
+
+ 	{ disable_acpi_pci, "Acer TravelMate 36x Laptop", {
+ 			MATCH(DMI_SYS_VENDOR, "Acer"),
+ 			MATCH(DMI_PRODUCT_NAME, "TravelMate 360"),
+ 			NO_MATCH, NO_MATCH
+ 			} },
+
 #endif
 
 	{ NULL, }
@@ -1048,9 +500,6 @@ static __initdata struct dmi_blacklist dmi_blacklist[]={
 
 static __init void dmi_check_blacklist(void)
 {
-	struct dmi_blacklist *d;
-	int i;
-		
 #ifdef	CONFIG_ACPI_BOOT
 #define	ACPI_BLACKLIST_CUTOFF_YEAR	2001
 
@@ -1072,25 +521,7 @@ static __init void dmi_check_blacklist(void)
 		}
 	}
 #endif
-
-	d=&dmi_blacklist[0];
-	while(d->callback)
-	{
-		for(i=0;i<4;i++)
-		{
-			int s = d->matches[i].slot;
-			if(s==NONE)
-				continue;
-			if(dmi_ident[s] && strstr(dmi_ident[s], d->matches[i].substr))
-				continue;
-			/* No match */
-			goto fail;
-		}
-		if(d->callback(d))
-			return;
-fail:			
-		d++;
-	}
+ 	dmi_check_system(dmi_blacklist);
 }
 
 	
@@ -1156,4 +587,51 @@ void __init dmi_scan_machine(void)
 		printk(KERN_INFO "DMI not present.\n");
 }
 
-EXPORT_SYMBOL(is_unsafe_smbus);
+
+/**
+ *	dmi_check_system - check system DMI data
+ *	@list: array of dmi_system_id structures to match against
+ *
+ *	Walk the blacklist table running matching functions until someone
+ *	returns non zero or we hit the end. Callback function is called for
+ *	each successfull match. Returns the number of matches.
+ */
+int dmi_check_system(struct dmi_system_id *list)
+{
+	int i, count = 0;
+	struct dmi_system_id *d = list;
+
+	while (d->ident) {
+		for (i = 0; i < ARRAY_SIZE(d->matches); i++) {
+			int s = d->matches[i].slot;
+			if (s == DMI_NONE)
+				continue;
+			if (dmi_ident[s] && strstr(dmi_ident[s], d->matches[i].substr))
+				continue;
+			/* No match */
+			goto fail;
+		}
+		if (d->callback && d->callback(d))
+			break;
+		count++;
+fail:		d++;
+	}
+
+	return count;
+}
+
+EXPORT_SYMBOL(dmi_check_system);
+
+/**
+ *	dmi_get_system_info - return DMI data value
+ *	@field: data index (see enum dmi_filed)
+ *
+ *	Returns one DMI data value, can be used to perform
+ *	complex DMI data checks.
+ */
+char * dmi_get_system_info(int field)
+{
+	return dmi_ident[field];
+}
+
+EXPORT_SYMBOL(dmi_get_system_info);
diff --git a/arch/i386/kernel/efi.c b/arch/i386/kernel/efi.c
index 33bd6a351..fd4988dcc 100644
--- a/arch/i386/kernel/efi.c
+++ b/arch/i386/kernel/efi.c
@@ -37,7 +37,6 @@
 #include <asm/pgtable.h>
 #include <asm/processor.h>
 #include <asm/desc.h>
-#include <asm/pgalloc.h>
 #include <asm/tlbflush.h>
 
 #define EFI_DEBUG	0
diff --git a/arch/i386/kernel/head.S b/arch/i386/kernel/head.S
index 3f868ea50..69bad9bd0 100644
--- a/arch/i386/kernel/head.S
+++ b/arch/i386/kernel/head.S
@@ -153,6 +153,32 @@ ENTRY(startup_32_smp)
 	orl %edx,%eax
 	movl %eax,%cr4
 
+	btl $5, %eax		# check if PAE is enabled
+	jnc 6f
+
+	/* Check if extended functions are implemented */
+	movl $0x80000000, %eax
+	cpuid
+	cmpl $0x80000000, %eax
+	jbe 6f
+	mov $0x80000001, %eax
+	cpuid
+	/* Execute Disable bit supported? */
+	btl $20, %edx
+	jnc 6f
+
+	/* Setup EFER (Extended Feature Enable Register) */
+	movl $0xc0000080, %ecx
+	rdmsr
+
+	btsl $11, %eax
+	/* Make changes effective */
+	wrmsr
+
+6:
+	/* cpuid clobbered ebx, set it up again: */
+	xorl %ebx,%ebx
+	incl %ebx
 3:
 #endif /* CONFIG_SMP */
 
diff --git a/arch/i386/kernel/i386_ksyms.c b/arch/i386/kernel/i386_ksyms.c
index 582f093ad..064d6fb8a 100644
--- a/arch/i386/kernel/i386_ksyms.c
+++ b/arch/i386/kernel/i386_ksyms.c
@@ -29,7 +29,6 @@
 #include <asm/mmx.h>
 #include <asm/desc.h>
 #include <asm/pgtable.h>
-#include <asm/pgalloc.h>
 #include <asm/tlbflush.h>
 #include <asm/nmi.h>
 #include <asm/ist.h>
@@ -173,24 +172,15 @@ EXPORT_SYMBOL(rtc_lock);
 
 EXPORT_SYMBOL_GPL(set_nmi_callback);
 EXPORT_SYMBOL_GPL(unset_nmi_callback);
- 
-#undef memcpy
-#undef memset
+
 #undef memcmp
-extern void * memset(void *,int,__kernel_size_t);
-extern void * memcpy(void *,const void *,__kernel_size_t);
 extern int memcmp(const void *,const void *,__kernel_size_t);
-EXPORT_SYMBOL_NOVERS(memcpy);
-EXPORT_SYMBOL_NOVERS(memset);
 EXPORT_SYMBOL_NOVERS(memcmp);
 
 #ifdef CONFIG_HAVE_DEC_LOCK
 EXPORT_SYMBOL(atomic_dec_and_lock);
 #endif
 
-extern int is_sony_vaio_laptop;
-EXPORT_SYMBOL(is_sony_vaio_laptop);
-
 EXPORT_SYMBOL(__PAGE_KERNEL);
 
 #ifdef CONFIG_HIGHMEM
diff --git a/arch/i386/kernel/i8259.c b/arch/i386/kernel/i8259.c
index 0be8d6b87..97653d20f 100644
--- a/arch/i386/kernel/i8259.c
+++ b/arch/i386/kernel/i8259.c
@@ -317,19 +317,14 @@ void init_8259A(int auto_eoi)
  * be shot.
  */
  
-/*
- * =PC9800NOTE= In NEC PC-9800, we use irq8 instead of irq13!
- */
 
 static irqreturn_t math_error_irq(int cpl, void *dev_id, struct pt_regs *regs)
 {
-	extern void math_error(void *);
-#ifndef CONFIG_X86_PC9800
+	extern void math_error(void __user *);
 	outb(0,0xF0);
-#endif
 	if (ignore_fpu_irq || !boot_cpu_data.hard_math)
 		return IRQ_NONE;
-	math_error((void *)regs->eip);
+	math_error((void __user *)regs->eip);
 	return IRQ_HANDLED;
 }
 
@@ -337,7 +332,7 @@ static irqreturn_t math_error_irq(int cpl, void *dev_id, struct pt_regs *regs)
  * New motherboards sometimes make IRQ 13 be a PCI interrupt,
  * so allow interrupt sharing.
  */
-static struct irqaction fpu_irq = { math_error_irq, 0, 0, "fpu", NULL, NULL };
+static struct irqaction fpu_irq = { math_error_irq, 0, CPU_MASK_NONE, "fpu", NULL, NULL };
 
 void __init init_ISA_irqs (void)
 {
@@ -350,7 +345,7 @@ void __init init_ISA_irqs (void)
 
 	for (i = 0; i < NR_IRQS; i++) {
 		irq_desc[i].status = IRQ_DISABLED;
-		irq_desc[i].action = 0;
+		irq_desc[i].action = NULL;
 		irq_desc[i].depth = 1;
 
 		if (i < 16) {
diff --git a/arch/i386/kernel/init_task.c b/arch/i386/kernel/init_task.c
index 976e6bc16..5e1897649 100644
--- a/arch/i386/kernel/init_task.c
+++ b/arch/i386/kernel/init_task.c
@@ -4,6 +4,7 @@
 #include <linux/init.h>
 #include <linux/init_task.h>
 #include <linux/fs.h>
+#include <linux/mqueue.h>
 
 #include <asm/uaccess.h>
 #include <asm/pgtable.h>
diff --git a/arch/i386/kernel/io_apic.c b/arch/i386/kernel/io_apic.c
index 3ea997f30..a40687e7c 100644
--- a/arch/i386/kernel/io_apic.c
+++ b/arch/i386/kernel/io_apic.c
@@ -41,10 +41,6 @@
 
 #include "io_ports.h"
 
-#undef APIC_LOCKUP_DEBUG
-
-#define APIC_LOCKUP_DEBUG
-
 static spinlock_t ioapic_lock = SPIN_LOCK_UNLOCKED;
 
 /*
@@ -77,7 +73,7 @@ static struct irq_pin_list {
 } irq_2_pin[PIN_MAP_SIZE];
 
 int vector_irq[NR_VECTORS] = { [0 ... NR_VECTORS - 1] = -1};
-#ifdef CONFIG_PCI_USE_VECTOR
+#ifdef CONFIG_PCI_MSI
 #define vector_to_irq(vector) 	\
 	(platform_legacy_irq(vector) ? vector : vector_irq[vector])
 #else
@@ -127,83 +123,47 @@ static void __init replace_pin_at_irq(unsigned int irq,
 	}
 }
 
-/* mask = 1 */
-static void __mask_IO_APIC_irq (unsigned int irq)
+static void __modify_IO_APIC_irq (unsigned int irq, unsigned long enable, unsigned long disable)
 {
-	int pin;
 	struct irq_pin_list *entry = irq_2_pin + irq;
+	unsigned int pin, reg;
 
 	for (;;) {
-		unsigned int reg;
 		pin = entry->pin;
 		if (pin == -1)
 			break;
 		reg = io_apic_read(entry->apic, 0x10 + pin*2);
-		io_apic_modify(entry->apic, 0x10 + pin*2, reg |= 0x00010000);
+		reg &= ~disable;
+		reg |= enable;
+		io_apic_modify(entry->apic, 0x10 + pin*2, reg);
 		if (!entry->next)
 			break;
 		entry = irq_2_pin + entry->next;
 	}
-	io_apic_sync(entry->apic);
+}
+
+/* mask = 1 */
+static void __mask_IO_APIC_irq (unsigned int irq)
+{
+	__modify_IO_APIC_irq(irq, 0x00010000, 0);
 }
 
 /* mask = 0 */
 static void __unmask_IO_APIC_irq (unsigned int irq)
 {
-	int pin;
-	struct irq_pin_list *entry = irq_2_pin + irq;
-
-	for (;;) {
-		unsigned int reg;
-		pin = entry->pin;
-		if (pin == -1)
-			break;
-		reg = io_apic_read(entry->apic, 0x10 + pin*2);
-		io_apic_modify(entry->apic, 0x10 + pin*2, reg &= 0xfffeffff);
-		if (!entry->next)
-			break;
-		entry = irq_2_pin + entry->next;
-	}
+	__modify_IO_APIC_irq(irq, 0, 0x00010000);
 }
 
 /* mask = 1, trigger = 0 */
 static void __mask_and_edge_IO_APIC_irq (unsigned int irq)
 {
-	int pin;
-	struct irq_pin_list *entry = irq_2_pin + irq;
-
-	for (;;) {
-		unsigned int reg;
-		pin = entry->pin;
-		if (pin == -1)
-			break;
-		reg = io_apic_read(entry->apic, 0x10 + pin*2);
-		reg = (reg & 0xffff7fff) | 0x00010000;
-		io_apic_modify(entry->apic, 0x10 + pin*2, reg);
-		if (!entry->next)
-			break;
-		entry = irq_2_pin + entry->next;
-	}
+	__modify_IO_APIC_irq(irq, 0x00010000, 0x00008000);
 }
 
 /* mask = 0, trigger = 1 */
 static void __unmask_and_level_IO_APIC_irq (unsigned int irq)
 {
-	int pin;
-	struct irq_pin_list *entry = irq_2_pin + irq;
-
-	for (;;) {
-		unsigned int reg;
-		pin = entry->pin;
-		if (pin == -1)
-			break;
-		reg = io_apic_read(entry->apic, 0x10 + pin*2);
-		reg = (reg & 0xfffeffff) | 0x00008000;
-		io_apic_modify(entry->apic, 0x10 + pin*2, reg);
-		if (!entry->next)
-			break;
-		entry = irq_2_pin + entry->next;
-	}
+	__modify_IO_APIC_irq(irq, 0x00008000, 0x00010000);
 }
 
 static void mask_IO_APIC_irq (unsigned int irq)
@@ -264,7 +224,7 @@ static void set_ioapic_affinity_irq(unsigned int irq, cpumask_t cpumask)
 	struct irq_pin_list *entry = irq_2_pin + irq;
 	unsigned int apicid_value;
 	
-	apicid_value = cpu_mask_to_apicid(mk_cpumask_const(cpumask));
+	apicid_value = cpu_mask_to_apicid(cpumask);
 	/* Prepare to do the io_apic_write */
 	apicid_value = apicid_value << 24;
 	spin_lock_irqsave(&ioapic_lock, flags);
@@ -595,7 +555,7 @@ not_worth_the_effort:
 	return;
 }
 
-int balanced_irq(void *unused)
+static int balanced_irq(void *unused)
 {
 	int i;
 	unsigned long prev_balance_time = jiffies;
@@ -608,17 +568,17 @@ int balanced_irq(void *unused)
 		pending_irq_balance_cpumask[i] = cpumask_of_cpu(0);
 	}
 
-repeat:
-	set_current_state(TASK_INTERRUPTIBLE);
-	time_remaining = schedule_timeout(time_remaining);
-	if (time_after(jiffies, prev_balance_time+balanced_irq_interval)) {
-		Dprintk("balanced_irq: calling do_irq_balance() %lu\n",
-					jiffies);
-		do_irq_balance();
-		prev_balance_time = jiffies;
-		time_remaining = balanced_irq_interval;
+	for ( ; ; ) {
+		set_current_state(TASK_INTERRUPTIBLE);
+		time_remaining = schedule_timeout(time_remaining);
+		if (time_after(jiffies,
+				prev_balance_time+balanced_irq_interval)) {
+			do_irq_balance();
+			prev_balance_time = jiffies;
+			time_remaining = balanced_irq_interval;
+		}
 	}
-	goto repeat;
+	return 0;
 }
 
 static int __init balanced_irq_init(void)
@@ -1154,7 +1114,7 @@ static inline int IO_APIC_irq_trigger(int irq)
 /* irq_vectors is indexed by the sum of all RTEs in all I/O APICs. */
 u8 irq_vector[NR_IRQ_VECTORS] = { FIRST_DEVICE_VECTOR , 0 };
 
-#ifdef CONFIG_PCI_USE_VECTOR
+#ifdef CONFIG_PCI_MSI
 int assign_irq_vector(int irq)
 #else
 int __init assign_irq_vector(int irq)
@@ -1366,7 +1326,7 @@ void __init print_IO_APIC(void)
 	printk(KERN_DEBUG ".......    : physical APIC id: %02X\n", reg_00.bits.ID);
 	printk(KERN_DEBUG ".......    : Delivery Type: %X\n", reg_00.bits.delivery_type);
 	printk(KERN_DEBUG ".......    : LTS          : %X\n", reg_00.bits.LTS);
-	if (reg_00.bits.ID >= APIC_BROADCAST_ID)
+	if (reg_00.bits.ID >= get_physical_broadcast())
 		UNEXPECTED_IO_APIC();
 	if (reg_00.bits.__reserved_1 || reg_00.bits.__reserved_2)
 		UNEXPECTED_IO_APIC();
@@ -1451,12 +1411,17 @@ void __init print_IO_APIC(void)
 		);
 	}
 	}
+	if (use_pci_vector())
+		printk(KERN_INFO "Using vector-based indexing\n");
 	printk(KERN_DEBUG "IRQ to pin mappings:\n");
 	for (i = 0; i < NR_IRQS; i++) {
 		struct irq_pin_list *entry = irq_2_pin + i;
 		if (entry->pin < 0)
 			continue;
-		printk(KERN_DEBUG "IRQ%d ", i);
+ 		if (use_pci_vector() && !platform_legacy_irq(i))
+			printk(KERN_DEBUG "IRQ%d ", IO_APIC_VECTOR(i));
+		else
+			printk(KERN_DEBUG "IRQ%d ", i);
 		for (;;) {
 			printk("-> %d:%d", entry->apic, entry->pin);
 			if (!entry->next)
@@ -1682,7 +1647,7 @@ static void __init setup_ioapic_ids_from_mpc(void)
 		
 		old_id = mp_ioapics[apic].mpc_apicid;
 
-		if (mp_ioapics[apic].mpc_apicid >= APIC_BROADCAST_ID) {
+		if (mp_ioapics[apic].mpc_apicid >= get_physical_broadcast()) {
 			printk(KERN_ERR "BIOS bug, IO-APIC#%d ID is %d in the MPC table!...\n",
 				apic, mp_ioapics[apic].mpc_apicid);
 			printk(KERN_ERR "... fixing up to %d. (tell your hw vendor)\n",
@@ -1703,10 +1668,10 @@ static void __init setup_ioapic_ids_from_mpc(void)
 					mp_ioapics[apic].mpc_apicid)) {
 			printk(KERN_ERR "BIOS bug, IO-APIC#%d ID %d is already used!...\n",
 				apic, mp_ioapics[apic].mpc_apicid);
-			for (i = 0; i < APIC_BROADCAST_ID; i++)
+			for (i = 0; i < get_physical_broadcast(); i++)
 				if (!physid_isset(i, phys_id_present_map))
 					break;
-			if (i >= APIC_BROADCAST_ID)
+			if (i >= get_physical_broadcast())
 				panic("Max APIC ID exceeded!\n");
 			printk(KERN_ERR "... fixing up to %d. (tell your hw vendor)\n",
 				i);
@@ -1893,36 +1858,17 @@ static void end_level_ioapic_irq (unsigned int irq)
 	ack_APIC_irq();
 
 	if (!(v & (1 << (i & 0x1f)))) {
-#ifdef APIC_LOCKUP_DEBUG
-		struct irq_pin_list *entry;
-#endif
-
 #ifdef APIC_MISMATCH_DEBUG
 		atomic_inc(&irq_mis_count);
 #endif
 		spin_lock(&ioapic_lock);
 		__mask_and_edge_IO_APIC_irq(irq);
-#ifdef APIC_LOCKUP_DEBUG
-		for (entry = irq_2_pin + irq;;) {
-			unsigned int reg;
-
-			if (entry->pin == -1)
-				break;
-			reg = io_apic_read(entry->apic, 0x10 + entry->pin * 2);
-			if (reg & 0x00004000)
-				printk(KERN_CRIT "Aieee!!!  Remote IRR"
-					" still set after unlock!\n");
-			if (!entry->next)
-				break;
-			entry = irq_2_pin + entry->next;
-		}
-#endif
 		__unmask_and_level_IO_APIC_irq(irq);
 		spin_unlock(&ioapic_lock);
 	}
 }
 
-#ifdef CONFIG_PCI_USE_VECTOR
+#ifdef CONFIG_PCI_MSI
 static unsigned int startup_edge_ioapic_vector(unsigned int vector)
 {
 	int irq = vector_to_irq(vector);
@@ -2266,7 +2212,7 @@ static inline void check_timer(void)
 		return;
 	}
 	printk(" failed :(.\n");
-	panic("IO-APIC + timer doesn't work! pester mingo@redhat.com");
+	panic("IO-APIC + timer doesn't work! Try using the 'noapic' kernel parameter\n");
 }
 
 /*
@@ -2322,8 +2268,6 @@ late_initcall(io_apic_bug_finalize);
 
 #ifdef CONFIG_ACPI_BOOT
 
-#define IO_APIC_MAX_ID APIC_BROADCAST_ID
-
 int __init io_apic_get_unique_id (int ioapic, int apic_id)
 {
 	union IO_APIC_reg_00 reg_00;
@@ -2348,7 +2292,7 @@ int __init io_apic_get_unique_id (int ioapic, int apic_id)
 	reg_00.raw = io_apic_read(ioapic, 0);
 	spin_unlock_irqrestore(&ioapic_lock, flags);
 
-	if (apic_id >= IO_APIC_MAX_ID) {
+	if (apic_id >= get_physical_broadcast()) {
 		printk(KERN_WARNING "IOAPIC[%d]: Invalid apic_id %d, trying "
 			"%d\n", ioapic, apic_id, reg_00.bits.ID);
 		apic_id = reg_00.bits.ID;
@@ -2360,12 +2304,12 @@ int __init io_apic_get_unique_id (int ioapic, int apic_id)
 	 */
 	if (check_apicid_used(apic_id_map, apic_id)) {
 
-		for (i = 0; i < IO_APIC_MAX_ID; i++) {
+		for (i = 0; i < get_physical_broadcast(); i++) {
 			if (!check_apicid_used(apic_id_map, i))
 				break;
 		}
 
-		if (i == IO_APIC_MAX_ID)
+		if (i == get_physical_broadcast())
 			panic("Max apic_id exceeded!\n");
 
 		printk(KERN_WARNING "IOAPIC[%d]: apic_id %d already used, "
diff --git a/arch/i386/kernel/irq.c b/arch/i386/kernel/irq.c
index 579b3282e..355dc0eca 100644
--- a/arch/i386/kernel/irq.c
+++ b/arch/i386/kernel/irq.c
@@ -41,7 +41,6 @@
 #include <asm/system.h>
 #include <asm/bitops.h>
 #include <asm/uaccess.h>
-#include <asm/pgalloc.h>
 #include <asm/delay.h>
 #include <asm/desc.h>
 #include <asm/irq.h>
@@ -653,7 +652,7 @@ int request_irq(unsigned int irq,
 
 	action->handler = handler;
 	action->flags = irqflags;
-	action->mask = 0;
+	cpus_clear(action->mask);
 	action->name = devname;
 	action->next = NULL;
 	action->dev_id = dev_id;
@@ -1095,7 +1094,7 @@ void init_irq_proc (void)
 	int i;
 
 	/* create /proc/irq */
-	root_irq_dir = proc_mkdir("irq", 0);
+	root_irq_dir = proc_mkdir("irq", NULL);
 
 	/* create /proc/irq/prof_cpu_mask */
 	entry = create_proc_entry("prof_cpu_mask", 0600, root_irq_dir);
@@ -1117,8 +1116,12 @@ void init_irq_proc (void)
 
 
 #ifdef CONFIG_4KSTACKS
-static char softirq_stack[NR_CPUS * THREAD_SIZE]  __attribute__((__aligned__(THREAD_SIZE), __section__(".bss.page_aligned")));
-static char hardirq_stack[NR_CPUS * THREAD_SIZE]  __attribute__((__aligned__(THREAD_SIZE), __section__(".bss.page_aligned")));
+/*
+ * These should really be __section__(".bss.page_aligned") as well, but
+ * gcc's 3.0 and earlier don't handle that correctly.
+ */
+static char softirq_stack[NR_CPUS * THREAD_SIZE]  __attribute__((__aligned__(THREAD_SIZE)));
+static char hardirq_stack[NR_CPUS * THREAD_SIZE]  __attribute__((__aligned__(THREAD_SIZE)));
 
 /*
  * allocate per-cpu stacks for hardirq and for softirq processing
diff --git a/arch/i386/kernel/ldt.c b/arch/i386/kernel/ldt.c
index c07c21df7..038d30034 100644
--- a/arch/i386/kernel/ldt.c
+++ b/arch/i386/kernel/ldt.c
@@ -61,7 +61,7 @@ static int alloc_ldt(mm_context_t *pc, int mincount, int reload)
 		load_LDT(pc);
 		mask = cpumask_of_cpu(smp_processor_id());
 		if (!cpus_equal(current->mm->cpu_vm_mask, mask))
-			smp_call_function(flush_ldt, 0, 1, 1);
+			smp_call_function(flush_ldt, NULL, 1, 1);
 		preempt_enable();
 #else
 		load_LDT(pc);
diff --git a/arch/i386/kernel/microcode.c b/arch/i386/kernel/microcode.c
index 198b17c7e..12ccd65bd 100644
--- a/arch/i386/kernel/microcode.c
+++ b/arch/i386/kernel/microcode.c
@@ -1,7 +1,7 @@
 /*
- *	Intel CPU Microcode Update driver for Linux
+ *	Intel CPU Microcode Update Driver for Linux
  *
- *	Copyright (C) 2000 Tigran Aivazian
+ *	Copyright (C) 2000-2004 Tigran Aivazian
  *
  *	This driver allows to upgrade microcode on Intel processors
  *	belonging to IA-32 family - PentiumPro, Pentium II, 
@@ -32,7 +32,7 @@
  *		Added misc device support (now uses both devfs and misc).
  *		Added MICROCODE_IOCFREE ioctl to clear memory.
  *	1.05	09 Jun 2000, Simon Trimmer <simon@veritas.com>
- *		Messages for error cases (non intel & no suitable microcode).
+ *		Messages for error cases (non Intel & no suitable microcode).
  *	1.06	03 Aug 2000, Tigran Aivazian <tigran@veritas.com>
  *		Removed ->release(). Removed exclusive open and status bitmap.
  *		Added microcode_rwsem to serialize read()/write()/ioctl().
@@ -64,6 +64,9 @@
  *		Removed ->read() method and obsoleted MICROCODE_IOCFREE ioctl
  *		because we no longer hold a copy of applied microcode 
  *		in kernel memory.
+ *	1.14	25 Jun 2004 Tigran Aivazian <tigran@veritas.com>
+ *		Fix sigmatch() macro to handle old CPUs with pf == 0.
+ *		Thanks to Stuart Swales for pointing out this bug.
  */
 
 
@@ -80,11 +83,11 @@
 #include <asm/uaccess.h>
 #include <asm/processor.h>
 
-MODULE_DESCRIPTION("Intel CPU (IA-32) microcode update driver");
+MODULE_DESCRIPTION("Intel CPU (IA-32) Microcode Update Driver");
 MODULE_AUTHOR("Tigran Aivazian <tigran@veritas.com>");
 MODULE_LICENSE("GPL");
 
-#define MICROCODE_VERSION 	"1.13"
+#define MICROCODE_VERSION 	"1.14"
 #define MICRO_DEBUG 		0
 #if MICRO_DEBUG
 #define dprintk(x...) printk(KERN_INFO x)
@@ -104,7 +107,10 @@ MODULE_LICENSE("GPL");
 #define get_datasize(mc) \
 	(((microcode_t *)mc)->hdr.datasize ? \
 	 ((microcode_t *)mc)->hdr.datasize : DEFAULT_UCODE_DATASIZE)
-#define sigmatch(s1, s2, p1, p2) (((s1) == (s2)) && ((p1) & (p2)))
+
+#define sigmatch(s1, s2, p1, p2) \
+	(((s1) == (s2)) && (((p1) & (p2)) || (((p1) == 0) && ((p2) == 0))))
+
 #define exttable_size(et) ((et)->count * EXT_SIGNATURE_SIZE + EXT_HEADER_SIZE)
 
 /* serialize access to the physical write to MSR 0x79 */
@@ -363,7 +369,7 @@ static void do_update_one (void * unused)
 	struct ucode_cpu_info *uci = ucode_cpu_info + cpu_num;
 
 	if (uci->mc == NULL) {
-		printk(KERN_INFO "microcode: No suitable data for cpu %d\n", cpu_num);
+		printk(KERN_INFO "microcode: No suitable data for CPU%d\n", cpu_num);
 		return;
 	}
 
@@ -495,16 +501,14 @@ static int __init microcode_init (void)
 	}
 
 	printk(KERN_INFO 
-		"IA-32 Microcode Update Driver: v%s <tigran@veritas.com>\n", 
-		MICROCODE_VERSION);
+		"IA-32 Microcode Update Driver: v" MICROCODE_VERSION " <tigran@veritas.com>\n");
 	return 0;
 }
 
 static void __exit microcode_exit (void)
 {
 	misc_deregister(&microcode_dev);
-	printk(KERN_INFO "IA-32 Microcode Update Driver v%s unregistered\n", 
-			MICROCODE_VERSION);
+	printk(KERN_INFO "IA-32 Microcode Update Driver v" MICROCODE_VERSION " unregistered\n");
 }
 
 module_init(microcode_init)
diff --git a/arch/i386/kernel/module.c b/arch/i386/kernel/module.c
index e8258ad35..5149c8a62 100644
--- a/arch/i386/kernel/module.c
+++ b/arch/i386/kernel/module.c
@@ -32,7 +32,7 @@ void *module_alloc(unsigned long size)
 {
 	if (size == 0)
 		return NULL;
-	return vmalloc(size);
+	return vmalloc_exec(size);
 }
 
 
diff --git a/arch/i386/kernel/mpparse.c b/arch/i386/kernel/mpparse.c
index e8ed286c8..41cb82604 100644
--- a/arch/i386/kernel/mpparse.c
+++ b/arch/i386/kernel/mpparse.c
@@ -23,12 +23,12 @@
 #include <linux/smp_lock.h>
 #include <linux/kernel_stat.h>
 #include <linux/mc146818rtc.h>
+#include <linux/bitops.h>
 
 #include <asm/smp.h>
 #include <asm/acpi.h>
 #include <asm/mtrr.h>
 #include <asm/mpspec.h>
-#include <asm/pgalloc.h>
 #include <asm/io_apic.h>
 
 #include <mach_apic.h>
@@ -104,6 +104,21 @@ static int __init mpf_checksum(unsigned char *mp, int len)
 static int mpc_record; 
 static struct mpc_config_translation *translation_table[MAX_MPC_ENTRY] __initdata;
 
+#ifdef CONFIG_X86_NUMAQ
+static int MP_valid_apicid(int apicid, int version)
+{
+	return hweight_long(apicid & 0xf) == 1 && (apicid >> 4) != 0xf;
+}
+#else
+static int MP_valid_apicid(int apicid, int version)
+{
+	if (version >= 0x14)
+		return apicid < 0xff;
+	else
+		return apicid < 0xf;
+}
+#endif
+
 void __init MP_processor_info (struct mpc_config_processor *m)
 {
  	int ver, apicid;
@@ -180,14 +195,14 @@ void __init MP_processor_info (struct mpc_config_processor *m)
 		return;
 	}
 	num_processors++;
+	ver = m->mpc_apicver;
 
-	if (MAX_APICS - m->mpc_apicid <= 0) {
+	if (!MP_valid_apicid(apicid, ver)) {
 		printk(KERN_WARNING "Processor #%d INVALID. (Max ID: %d).\n",
 			m->mpc_apicid, MAX_APICS);
 		--num_processors;
 		return;
 	}
-	ver = m->mpc_apicver;
 
 	tmp = apicid_to_cpu_present(apicid);
 	physids_or(phys_cpu_present_map, phys_cpu_present_map, tmp);
@@ -844,7 +859,7 @@ void __init mp_register_lapic (
 	MP_processor_info(&processor);
 }
 
-#if defined(CONFIG_X86_IO_APIC) && defined(CONFIG_ACPI_INTERPRETER)
+#if defined(CONFIG_X86_IO_APIC) && (defined(CONFIG_ACPI_INTERPRETER) || defined(CONFIG_ACPI_BOOT))
 
 #define MP_ISA_BUS		0
 #define MP_MAX_IOAPIC_PIN	127
@@ -857,7 +872,7 @@ struct mp_ioapic_routing {
 } mp_ioapic_routing[MAX_IO_APICS];
 
 
-static int __init mp_find_ioapic (
+static int mp_find_ioapic (
 	int			gsi)
 {
 	int			i = 0;
@@ -1000,14 +1015,23 @@ void __init mp_config_acpi_legacy_irqs (void)
 	for (i = 0; i < 16; i++) {
 		int idx;
 
-		for (idx = 0; idx < mp_irq_entries; idx++)
-			if (mp_irqs[idx].mpc_srcbus == MP_ISA_BUS &&
-				(mp_irqs[idx].mpc_srcbusirq == i ||
-				mp_irqs[idx].mpc_dstirq == i))
-					break;
+		for (idx = 0; idx < mp_irq_entries; idx++) {
+			struct mpc_config_intsrc *irq = mp_irqs + idx;
 
-		if (idx != mp_irq_entries)
-			continue;			  /* IRQ already used */
+			/* Do we already have a mapping for this ISA IRQ? */
+			if (irq->mpc_srcbus == MP_ISA_BUS && irq->mpc_srcbusirq == i)
+				break;
+
+			/* Do we already have a mapping for this IOAPIC pin */
+			if ((irq->mpc_dstapic == intsrc.mpc_dstapic) &&
+				(irq->mpc_dstirq == i))
+				break;
+		}
+
+		if (idx != mp_irq_entries) {
+			printk(KERN_DEBUG "ACPI: IRQ%d used by override.\n", i);
+			continue;			/* IRQ already used */
+		}
 
 		intsrc.mpc_irqtype = mp_INT;
 		intsrc.mpc_srcbusirq = i;		   /* Identity mapped */
@@ -1025,96 +1049,56 @@ void __init mp_config_acpi_legacy_irqs (void)
 	}
 }
 
-extern FADT_DESCRIPTOR acpi_fadt;
-
-#ifdef CONFIG_ACPI_PCI
-
 int (*platform_rename_gsi)(int ioapic, int gsi);
 
-void __init mp_parse_prt (void)
+void mp_register_gsi (u32 gsi, int edge_level, int active_high_low)
 {
-	struct list_head	*node = NULL;
-	struct acpi_prt_entry	*entry = NULL;
 	int			ioapic = -1;
 	int			ioapic_pin = 0;
-	int			gsi = 0;
 	int			idx, bit = 0;
-	int			edge_level = 0;
-	int			active_high_low = 0;
 
-	/*
-	 * Parsing through the PCI Interrupt Routing Table (PRT) and program
-	 * routing for all entries.
-	 */
-	list_for_each(node, &acpi_prt.entries) {
-		entry = list_entry(node, struct acpi_prt_entry, node);
-
-		/* Need to get gsi for dynamic entry */
-		if (entry->link.handle) {
-			gsi = acpi_pci_link_get_irq(entry->link.handle, entry->link.index, &edge_level, &active_high_low);
-			if (!gsi)
-				continue;
-		}
-		else {
-			/* Hardwired GSI. Assume PCI standard settings */
-			gsi = entry->link.index;
-			edge_level = 1;
-			active_high_low = 1;
-		}
+#ifdef CONFIG_ACPI_BUS
+	/* Don't set up the ACPI SCI because it's already set up */
+	if (acpi_fadt.sci_int == gsi)
+		return;
+#endif
 
-		/* Don't set up the ACPI SCI because it's already set up */
-                if (acpi_fadt.sci_int == gsi) {
-			/* we still need to set entry's irq */
-			acpi_gsi_to_irq(gsi, &entry->irq);
-			continue;
-                }
-	
-		ioapic = mp_find_ioapic(gsi);
-		if (ioapic < 0)
-			continue;
-		ioapic_pin = gsi - mp_ioapic_routing[ioapic].gsi_base;
-
-		if (platform_rename_gsi)
-			gsi = platform_rename_gsi(ioapic, gsi);
-
-		/* 
-		 * Avoid pin reprogramming.  PRTs typically include entries  
-		 * with redundant pin->gsi mappings (but unique PCI devices);
-		 * we only only program the IOAPIC on the first.
-		 */
-		bit = ioapic_pin % 32;
-		idx = (ioapic_pin < 32) ? 0 : (ioapic_pin / 32);
-		if (idx > 3) {
-			printk(KERN_ERR "Invalid reference to IOAPIC pin "
-				"%d-%d\n", mp_ioapic_routing[ioapic].apic_id, 
-				ioapic_pin);
-			continue;
-		}
-		if ((1<<bit) & mp_ioapic_routing[ioapic].pin_programmed[idx]) {
-			Dprintk(KERN_DEBUG "Pin %d-%d already programmed\n",
-				mp_ioapic_routing[ioapic].apic_id, ioapic_pin);
-			acpi_gsi_to_irq(gsi, &entry->irq);
-			continue;
-		}
+	ioapic = mp_find_ioapic(gsi);
+	if (ioapic < 0) {
+		printk(KERN_WARNING "No IOAPIC for GSI %u\n", gsi);
+		return;
+	}
 
-		mp_ioapic_routing[ioapic].pin_programmed[idx] |= (1<<bit);
+	ioapic_pin = gsi - mp_ioapic_routing[ioapic].gsi_base;
 
-		if (!io_apic_set_pci_routing(ioapic, ioapic_pin, gsi, edge_level, active_high_low)) {
-			acpi_gsi_to_irq(gsi, &entry->irq);
-		}
-		printk(KERN_DEBUG "%02x:%02x:%02x[%c] -> %d-%d -> IRQ %d %s %s\n",
-			entry->id.segment, entry->id.bus,
-			entry->id.device, ('A' + entry->pin),
-			mp_ioapic_routing[ioapic].apic_id, ioapic_pin,
-			entry->irq, edge_level ? "level" : "edge",
-			active_high_low ? "low" : "high");
+	if (platform_rename_gsi)
+		gsi = platform_rename_gsi(ioapic, gsi);
+
+	/* 
+	 * Avoid pin reprogramming.  PRTs typically include entries  
+	 * with redundant pin->gsi mappings (but unique PCI devices);
+	 * we only program the IOAPIC on the first.
+	 */
+	bit = ioapic_pin % 32;
+	idx = (ioapic_pin < 32) ? 0 : (ioapic_pin / 32);
+	if (idx > 3) {
+		printk(KERN_ERR "Invalid reference to IOAPIC pin "
+			"%d-%d\n", mp_ioapic_routing[ioapic].apic_id, 
+			ioapic_pin);
+		return;
+	}
+	if ((1<<bit) & mp_ioapic_routing[ioapic].pin_programmed[idx]) {
+		Dprintk(KERN_DEBUG "Pin %d-%d already programmed\n",
+			mp_ioapic_routing[ioapic].apic_id, ioapic_pin);
+		return;
 	}
 
-	print_IO_APIC();
+	mp_ioapic_routing[ioapic].pin_programmed[idx] |= (1<<bit);
 
-	return;
+	io_apic_set_pci_routing(ioapic, ioapic_pin, gsi,
+		    edge_level == ACPI_EDGE_SENSITIVE ? 0 : 1,
+		    active_high_low == ACPI_ACTIVE_HIGH ? 0 : 1);
 }
 
-#endif /*CONFIG_ACPI_PCI*/
-#endif /*CONFIG_X86_IO_APIC && CONFIG_ACPI_INTERPRETER*/
+#endif /*CONFIG_X86_IO_APIC && (CONFIG_ACPI_INTERPRETER || CONFIG_ACPI_BOOT)*/
 #endif /*CONFIG_ACPI_BOOT*/
diff --git a/arch/i386/kernel/msr.c b/arch/i386/kernel/msr.c
index 1a1093e4a..670a71efa 100644
--- a/arch/i386/kernel/msr.c
+++ b/arch/i386/kernel/msr.c
@@ -35,12 +35,17 @@
 #include <linux/smp_lock.h>
 #include <linux/major.h>
 #include <linux/fs.h>
+#include <linux/device.h>
+#include <linux/cpu.h>
+#include <linux/notifier.h>
 
 #include <asm/processor.h>
 #include <asm/msr.h>
 #include <asm/uaccess.h>
 #include <asm/system.h>
 
+static struct class_simple *msr_class;
+
 /* Note: "err" is handled in a funny way below.  Otherwise one version
    of gcc or another breaks. */
 
@@ -255,20 +260,82 @@ static struct file_operations msr_fops = {
 	.open = msr_open,
 };
 
+static int msr_class_simple_device_add(int i)
+{
+	int err = 0;
+	struct class_device *class_err;
+
+	class_err = class_simple_device_add(msr_class, MKDEV(MSR_MAJOR, i), NULL, "msr%d",i);
+	if (IS_ERR(class_err)) 
+		err = PTR_ERR(class_err);
+	return err;
+}
+
+static int __devinit msr_class_cpu_callback(struct notifier_block *nfb, unsigned long action, void *hcpu)
+{
+	unsigned int cpu = (unsigned long)hcpu;
+
+	switch (action) {
+	case CPU_ONLINE:
+		msr_class_simple_device_add(cpu);
+		break;
+	case CPU_DEAD:
+		class_simple_device_remove(MKDEV(MSR_MAJOR, cpu));	
+		break;
+	}
+	return NOTIFY_OK;
+}
+
+static struct notifier_block msr_class_cpu_notifier =
+{
+	.notifier_call = msr_class_cpu_callback,
+};
+
 int __init msr_init(void)
 {
+	int i, err = 0;
+	i = 0;
+
 	if (register_chrdev(MSR_MAJOR, "cpu/msr", &msr_fops)) {
 		printk(KERN_ERR "msr: unable to get major %d for msr\n",
 		       MSR_MAJOR);
-		return -EBUSY;
+		err = -EBUSY;
+		goto out;
+	}
+	msr_class = class_simple_create(THIS_MODULE, "msr");
+	if (IS_ERR(msr_class)) {
+		err = PTR_ERR(msr_class);
+		goto out_chrdev;
 	}
+	for_each_online_cpu(i) {
+		err = msr_class_simple_device_add(i);
+		if (err != 0)
+			goto out_class;
+	}
+	register_cpu_notifier(&msr_class_cpu_notifier);
 
-	return 0;
+	err = 0;
+	goto out;
+
+out_class:
+	i = 0;
+	for_each_online_cpu(i)
+		class_simple_device_remove(MKDEV(MSR_MAJOR, i));
+	class_simple_destroy(msr_class);
+out_chrdev:
+	unregister_chrdev(MSR_MAJOR, "cpu/msr");
+out:
+	return err;
 }
 
 void __exit msr_exit(void)
 {
+	int cpu = 0;
+	for_each_online_cpu(cpu)
+		class_simple_device_remove(MKDEV(MSR_MAJOR, cpu));
+	class_simple_destroy(msr_class);
 	unregister_chrdev(MSR_MAJOR, "cpu/msr");
+	unregister_cpu_notifier(&msr_class_cpu_notifier);
 }
 
 module_init(msr_init);
diff --git a/arch/i386/kernel/numaq.c b/arch/i386/kernel/numaq.c
index a3e650b71..ed41eebf0 100644
--- a/arch/i386/kernel/numaq.c
+++ b/arch/i386/kernel/numaq.c
@@ -64,41 +64,6 @@ static void __init smp_dump_qct(void)
 	}
 }
 
-/*
- * for each node mark the regions
- *        TOPOFMEM = hi_shrd_mem_start + hi_shrd_mem_size
- *
- * need to be very careful to not mark 1024+ as belonging
- * to node 0. will want 1027 to show as belonging to node 1
- * example:
- *  TOPOFMEM = 1024
- * 1024 >> 8 = 4 (subtract 1 for starting at 0]
- * tmpvar = TOPOFMEM - 256 = 768
- * 1024 >> 8 = 4 (subtract 1 for starting at 0]
- * 
- */
-static void __init initialize_physnode_map(void)
-{
-	int nid;
-	unsigned int topofmem, cur;
-	struct eachquadmem *eq;
- 	struct sys_cfg_data *scd =
-		(struct sys_cfg_data *)__va(SYS_CFG_DATA_PRIV_ADDR);
-
-	
-	for(nid = 0; nid < numnodes; nid++) {
-		if(scd->quads_present31_0 & (1 << nid)) {
-			eq = &scd->eq[nid];
-			cur = eq->hi_shrd_mem_start;
-			topofmem = eq->hi_shrd_mem_start + eq->hi_shrd_mem_size;
-			while (cur < topofmem) {
-				physnode_map[cur >> 8] = nid;
-				cur ++;
-			}
-		}
-	}
-}
-
 /*
  * Unlike Summit, we don't really care to let the NUMA-Q
  * fall back to flat mode.  Don't compile for NUMA-Q
@@ -107,6 +72,5 @@ static void __init initialize_physnode_map(void)
 int __init get_memcfg_numaq(void)
 {
 	smp_dump_qct();
-	initialize_physnode_map();
 	return 1;
 }
diff --git a/arch/i386/kernel/process.c b/arch/i386/kernel/process.c
index de22204a7..75b200985 100644
--- a/arch/i386/kernel/process.c
+++ b/arch/i386/kernel/process.c
@@ -353,7 +353,7 @@ int copy_thread(int nr, unsigned long clone_flags, unsigned long esp,
 	int err;
 
 	childregs = ((struct pt_regs *) (THREAD_SIZE + (unsigned long) p->thread_info)) - 1;
-	struct_cpy(childregs, regs);
+	*childregs = *regs;
 	childregs->eax = 0;
 	childregs->esp = esp;
 	p->set_child_tid = p->clear_child_tid = NULL;
diff --git a/arch/i386/kernel/reboot.c b/arch/i386/kernel/reboot.c
index c8936c4e5..06974254c 100644
--- a/arch/i386/kernel/reboot.c
+++ b/arch/i386/kernel/reboot.c
@@ -9,6 +9,7 @@
 #include <linux/interrupt.h>
 #include <linux/mc146818rtc.h>
 #include <linux/efi.h>
+#include <linux/dmi.h>
 #include <asm/uaccess.h>
 #include <asm/apic.h>
 #include "mach_reboot.h"
@@ -67,6 +68,83 @@ static int __init reboot_setup(char *str)
 
 __setup("reboot=", reboot_setup);
 
+/*
+ * Reboot options and system auto-detection code provided by
+ * Dell Inc. so their systems "just work". :-)
+ */
+
+/*
+ * Some machines require the "reboot=b"  commandline option, this quirk makes that automatic.
+ */
+static int __init set_bios_reboot(struct dmi_system_id *d)
+{
+	if (!reboot_thru_bios) {
+		reboot_thru_bios = 1;
+		printk(KERN_INFO "%s series board detected. Selecting BIOS-method for reboots.\n", d->ident);
+	}
+	return 0;
+}
+
+/*
+ * Some machines require the "reboot=s"  commandline option, this quirk makes that automatic.
+ */
+static int __init set_smp_reboot(struct dmi_system_id *d)
+{
+#ifdef CONFIG_SMP
+	if (!reboot_smp) {
+		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 int __init set_smp_bios_reboot(struct dmi_system_id *d)
+{
+	set_smp_reboot(d);
+	set_bios_reboot(d);
+	return 0;
+}
+
+static struct dmi_system_id __initdata reboot_dmi_table[] = {
+	{	/* Handle problems with rebooting on Dell 1300's */
+		.callback = set_smp_bios_reboot,
+		.ident = "Dell PowerEdge 1300",
+		.matches = {
+			DMI_MATCH(DMI_SYS_VENDOR, "Dell Computer Corporation"),
+			DMI_MATCH(DMI_PRODUCT_NAME, "PowerEdge 1300/"),
+		},
+	},
+	{	/* Handle problems with rebooting on Dell 300's */
+		.callback = set_bios_reboot,
+		.ident = "Dell PowerEdge 300",
+		.matches = {
+			DMI_MATCH(DMI_SYS_VENDOR, "Dell Computer Corporation"),
+			DMI_MATCH(DMI_PRODUCT_NAME, "PowerEdge 300/"),
+		},
+	},
+	{	/* Handle problems with rebooting on Dell 2400's */
+		.callback = set_bios_reboot,
+		.ident = "Dell PowerEdge 2400",
+		.matches = {
+			DMI_MATCH(DMI_SYS_VENDOR, "Dell Computer Corporation"),
+			DMI_MATCH(DMI_PRODUCT_NAME, "PowerEdge 2400"),
+		},
+	},
+	{ }
+};
+
+static int reboot_init(void)
+{
+	dmi_check_system(reboot_dmi_table);
+	return 0;
+}
+
+core_initcall(reboot_init);
+
 /* The following code and data reboots the machine by switching to real
    mode and jumping to the BIOS reset entry point, as if the CPU has
    really been reset.  The previous version asked the keyboard
@@ -88,8 +166,8 @@ static struct
 	unsigned long long * base __attribute__ ((packed));
 }
 real_mode_gdt = { sizeof (real_mode_gdt_entries) - 1, real_mode_gdt_entries },
-real_mode_idt = { 0x3ff, 0 },
-no_idt = { 0, 0 };
+real_mode_idt = { 0x3ff, NULL },
+no_idt = { 0, NULL };
 
 
 /* This is 16-bit protected mode code to disable paging and the cache,
@@ -266,7 +344,7 @@ void machine_restart(char * __unused)
 
 	if (!reboot_thru_bios) {
 		if (efi_enabled) {
-			efi.reset_system(EFI_RESET_COLD, EFI_SUCCESS, 0, 0);
+			efi.reset_system(EFI_RESET_COLD, EFI_SUCCESS, 0, NULL);
 			__asm__ __volatile__("lidt %0": :"m" (no_idt));
 			__asm__ __volatile__("int3");
 		}
@@ -280,7 +358,7 @@ void machine_restart(char * __unused)
 		}
 	}
 	if (efi_enabled)
-		efi.reset_system(EFI_RESET_WARM, EFI_SUCCESS, 0, 0);
+		efi.reset_system(EFI_RESET_WARM, EFI_SUCCESS, 0, NULL);
 
 	machine_real_restart(jump_to_bios, sizeof(jump_to_bios));
 }
@@ -296,7 +374,7 @@ EXPORT_SYMBOL(machine_halt);
 void machine_power_off(void)
 {
 	if (efi_enabled)
-		efi.reset_system(EFI_RESET_SHUTDOWN, EFI_SUCCESS, 0, 0);
+		efi.reset_system(EFI_RESET_SHUTDOWN, EFI_SUCCESS, 0, NULL);
 	if (pm_power_off)
 		pm_power_off();
 }
diff --git a/arch/i386/kernel/scx200.c b/arch/i386/kernel/scx200.c
index 22a2fe2f8..1cde4145c 100644
--- a/arch/i386/kernel/scx200.c
+++ b/arch/i386/kernel/scx200.c
@@ -11,7 +11,6 @@
 #include <linux/init.h>
 #include <linux/pci.h>
 
-#include <linux/scx200.h>
 #include <linux/scx200.h>
 
 #define NAME "scx200"
diff --git a/arch/i386/kernel/setup.c b/arch/i386/kernel/setup.c
index 76f34d082..375fd0761 100644
--- a/arch/i386/kernel/setup.c
+++ b/arch/i386/kernel/setup.c
@@ -47,7 +47,7 @@
 #include <asm/sections.h>
 #include <asm/io_apic.h>
 #include <asm/ist.h>
-#include <asm/std_resources.h>
+#include <asm/io.h>
 #include "setup_arch_pre.h"
 
 /* This value is set up by the early boot code to point to the value
@@ -57,8 +57,6 @@ unsigned long init_pg_tables_end __initdata = ~0UL;
 
 int disable_pse __initdata = 0;
 
-static inline char * __init machine_specific_memory_setup(void);
-
 /*
  * Machine setup..
  */
@@ -129,12 +127,206 @@ unsigned long saved_videomode;
 #define RAMDISK_LOAD_FLAG		0x4000	
 
 static char command_line[COMMAND_LINE_SIZE];
-       char saved_command_line[COMMAND_LINE_SIZE];
 
 unsigned char __initdata boot_params[PARAM_SIZE];
 
-static struct resource code_resource = { "Kernel code", 0x100000, 0 };
-static struct resource data_resource = { "Kernel data", 0, 0 };
+static struct resource data_resource = {
+	.name	= "Kernel data",
+	.start	= 0,
+	.end	= 0,
+	.flags	= IORESOURCE_BUSY | IORESOURCE_MEM
+};
+
+static struct resource code_resource = {
+	.name	= "Kernel code",
+	.start	= 0,
+	.end	= 0,
+	.flags	= IORESOURCE_BUSY | IORESOURCE_MEM
+};
+
+static struct resource system_rom_resource = {
+	.name	= "System ROM",
+	.start	= 0xf0000,
+	.end	= 0xfffff,
+	.flags	= IORESOURCE_BUSY | IORESOURCE_READONLY | IORESOURCE_MEM
+};
+
+static struct resource extension_rom_resource = {
+	.name	= "Extension ROM",
+	.start	= 0xe0000,
+	.end	= 0xeffff,
+	.flags	= IORESOURCE_BUSY | IORESOURCE_READONLY | IORESOURCE_MEM
+};
+
+static struct resource adapter_rom_resources[] = { {
+	.name 	= "Adapter ROM",
+	.start	= 0xc8000,
+	.end	= 0,
+	.flags	= IORESOURCE_BUSY | IORESOURCE_READONLY | IORESOURCE_MEM
+}, {
+	.name 	= "Adapter ROM",
+	.start	= 0,
+	.end	= 0,
+	.flags	= IORESOURCE_BUSY | IORESOURCE_READONLY | IORESOURCE_MEM
+}, {
+	.name 	= "Adapter ROM",
+	.start	= 0,
+	.end	= 0,
+	.flags	= IORESOURCE_BUSY | IORESOURCE_READONLY | IORESOURCE_MEM
+}, {
+	.name 	= "Adapter ROM",
+	.start	= 0,
+	.end	= 0,
+	.flags	= IORESOURCE_BUSY | IORESOURCE_READONLY | IORESOURCE_MEM
+}, {
+	.name 	= "Adapter ROM",
+	.start	= 0,
+	.end	= 0,
+	.flags	= IORESOURCE_BUSY | IORESOURCE_READONLY | IORESOURCE_MEM
+}, {
+	.name 	= "Adapter ROM",
+	.start	= 0,
+	.end	= 0,
+	.flags	= IORESOURCE_BUSY | IORESOURCE_READONLY | IORESOURCE_MEM
+} };
+
+#define ADAPTER_ROM_RESOURCES \
+	(sizeof adapter_rom_resources / sizeof adapter_rom_resources[0])
+
+static struct resource video_rom_resource = {
+	.name 	= "Video ROM",
+	.start	= 0xc0000,
+	.end	= 0xc7fff,
+	.flags	= IORESOURCE_BUSY | IORESOURCE_READONLY | IORESOURCE_MEM
+};
+
+static struct resource video_ram_resource = {
+	.name	= "Video RAM area",
+	.start	= 0xa0000,
+	.end	= 0xbffff,
+	.flags	= IORESOURCE_BUSY | IORESOURCE_MEM
+};
+
+static struct resource standard_io_resources[] = { {
+	.name	= "dma1",
+	.start	= 0x0000,
+	.end	= 0x001f,
+	.flags	= IORESOURCE_BUSY | IORESOURCE_IO
+}, {
+	.name	= "pic1",
+	.start	= 0x0020,
+	.end	= 0x0021,
+	.flags	= IORESOURCE_BUSY | IORESOURCE_IO
+}, {
+	.name	= "timer",
+	.start	= 0x0040,
+	.end	= 0x005f,
+	.flags	= IORESOURCE_BUSY | IORESOURCE_IO
+}, {
+	.name	= "keyboard",
+	.start	= 0x0060,
+	.end	= 0x006f,
+	.flags	= IORESOURCE_BUSY | IORESOURCE_IO
+}, {
+	.name	= "dma page reg",
+	.start	= 0x0080,
+	.end	= 0x008f,
+	.flags	= IORESOURCE_BUSY | IORESOURCE_IO
+}, {
+	.name	= "pic2",
+	.start	= 0x00a0,
+	.end	= 0x00a1,
+	.flags	= IORESOURCE_BUSY | IORESOURCE_IO
+}, {
+	.name	= "dma2",
+	.start	= 0x00c0,
+	.end	= 0x00df,
+	.flags	= IORESOURCE_BUSY | IORESOURCE_IO
+}, {
+	.name	= "fpu",
+	.start	= 0x00f0,
+	.end	= 0x00ff,
+	.flags	= IORESOURCE_BUSY | IORESOURCE_IO
+} };
+
+#define STANDARD_IO_RESOURCES \
+	(sizeof standard_io_resources / sizeof standard_io_resources[0])
+
+#define romsignature(x) (*(unsigned short *)(x) == 0xaa55)
+
+static int __init romchecksum(unsigned char *rom, unsigned long length)
+{
+	unsigned char *p, sum = 0;
+
+	for (p = rom; p < rom + length; p++)
+		sum += *p;
+	return sum == 0;
+}
+
+static void __init probe_roms(void)
+{
+	unsigned long start, length, upper;
+	unsigned char *rom;
+	int	      i;
+
+	/* video rom */
+	upper = adapter_rom_resources[0].start;
+	for (start = video_rom_resource.start; start < upper; start += 2048) {
+		rom = isa_bus_to_virt(start);
+		if (!romsignature(rom))
+			continue;
+
+		video_rom_resource.start = start;
+
+		/* 0 < length <= 0x7f * 512, historically */
+		length = rom[2] * 512;
+
+		/* if checksum okay, trust length byte */
+		if (length && romchecksum(rom, length))
+			video_rom_resource.end = start + length - 1;
+
+		request_resource(&iomem_resource, &video_rom_resource);
+		break;
+	}
+
+	start = (video_rom_resource.end + 1 + 2047) & ~2047UL;
+	if (start < upper)
+		start = upper;
+
+	/* system rom */
+	request_resource(&iomem_resource, &system_rom_resource);
+	upper = system_rom_resource.start;
+
+	/* check for extension rom (ignore length byte!) */
+	rom = isa_bus_to_virt(extension_rom_resource.start);
+	if (romsignature(rom)) {
+		length = extension_rom_resource.end - extension_rom_resource.start + 1;
+		if (romchecksum(rom, length)) {
+			request_resource(&iomem_resource, &extension_rom_resource);
+			upper = extension_rom_resource.start;
+		}
+	}
+
+	/* check for adapter roms on 2k boundaries */
+	for (i = 0; i < ADAPTER_ROM_RESOURCES && start < upper; start += 2048) {
+		rom = isa_bus_to_virt(start);
+		if (!romsignature(rom))
+			continue;
+
+		/* 0 < length <= 0x7f * 512, historically */
+		length = rom[2] * 512;
+
+		/* but accept any length that fits if checksum okay */
+		if (!length || start + length > upper || !romchecksum(rom, length))
+			continue;
+
+		adapter_rom_resources[i].start = start;
+		adapter_rom_resources[i].end = start + length - 1;
+		request_resource(&iomem_resource, &adapter_rom_resources[i]);
+
+		start = adapter_rom_resources[i++].end & ~2047UL;
+	}
+}
 
 static void __init limit_regions(unsigned long long size)
 {
@@ -436,13 +628,9 @@ static int __init copy_e820_map(struct e820entry * biosmap, int nr_map)
 }
 
 #if defined(CONFIG_EDD) || defined(CONFIG_EDD_MODULE)
-unsigned char eddnr;
-struct edd_info edd[EDDMAXNR];
-unsigned int edd_disk80_sig;
+struct edd edd;
 #ifdef CONFIG_EDD_MODULE
-EXPORT_SYMBOL(eddnr);
 EXPORT_SYMBOL(edd);
-EXPORT_SYMBOL(edd_disk80_sig);
 #endif
 /**
  * copy_edd() - Copy the BIOS EDD information
@@ -451,12 +639,15 @@ EXPORT_SYMBOL(edd_disk80_sig);
  */
 static inline void copy_edd(void)
 {
-     eddnr = EDD_NR;
-     memcpy(edd, EDD_BUF, sizeof(edd));
-     edd_disk80_sig = DISK80_SIGNATURE;
+     memcpy(edd.mbr_signature, EDD_MBR_SIGNATURE, sizeof(edd.mbr_signature));
+     memcpy(edd.edd_info, EDD_BUF, sizeof(edd.edd_info));
+     edd.mbr_signature_nr = EDD_MBR_SIG_NR;
+     edd.edd_info_nr = EDD_NR;
 }
 #else
-#define copy_edd() do {} while (0)
+static inline void copy_edd(void)
+{
+}
 #endif
 
 /*
@@ -465,14 +656,6 @@ static inline void copy_edd(void)
  */
 #define LOWMEMSIZE()	(0x9f000)
 
-static void __init setup_memory_region(void)
-{
-	char *who = machine_specific_memory_setup();
-	printk(KERN_INFO "BIOS-provided physical RAM map:\n");
-	print_memory_map(who);
-} /* setup_memory_region */
-
-
 static void __init parse_cmdline_early (char ** cmdline_p)
 {
 	char c = ' ', *to = command_line, *from = saved_command_line;
@@ -948,6 +1131,7 @@ legacy_init_iomem_resources(struct resource *code_resource, struct resource *dat
 static void __init register_memory(unsigned long max_low_pfn)
 {
 	unsigned long low_mem_size;
+	int	      i;
 
 	if (efi_enabled)
 		efi_initialize_iomem_resources(&code_resource, &data_resource);
@@ -955,10 +1139,11 @@ static void __init register_memory(unsigned long max_low_pfn)
 		legacy_init_iomem_resources(&code_resource, &data_resource);
 
 	/* EFI systems may still have VGA */
-	request_graphics_resource();
+	request_resource(&iomem_resource, &video_ram_resource);
 
 	/* request I/O space for devices used on all i[345]86 PCs */
-	request_standard_io_resources();
+	for (i = 0; i < STANDARD_IO_RESOURCES; i++)
+		request_resource(&ioport_resource, &standard_io_resources[i]);
 
 	/* Tell the PCI layer not to allocate too close to the RAM area.. */
 	low_mem_size = ((max_low_pfn << PAGE_SHIFT) + 0xfffff) & ~0xfffff;
@@ -1019,7 +1204,7 @@ static struct nop {
 } noptypes[] = { 
      { X86_FEATURE_K8, k8_nops }, 
      { X86_FEATURE_K7, k7_nops }, 
-     { -1, 0 }
+     { -1, NULL }
 }; 
 
 /* Replace instructions with better alternatives for this CPU type.
@@ -1073,6 +1258,8 @@ static int __init noreplacement_setup(char *s)
 
 __setup("noreplacement", noreplacement_setup); 
 
+static char * __init machine_specific_memory_setup(void);
+
 /*
  * Determine if we were loaded by an EFI loader.  If so, then we have also been
  * passed the efi memmap, systab, etc., so we should use these data structures
@@ -1123,8 +1310,10 @@ void __init setup_arch(char **cmdline_p)
 	ARCH_SETUP
 	if (efi_enabled)
 		efi_init();
-	else
-		setup_memory_region();
+	else {
+		printk(KERN_INFO "BIOS-provided physical RAM map:\n");
+		print_memory_map(machine_specific_memory_setup());
+	}
 
 	copy_edd();
 
diff --git a/arch/i386/kernel/signal.c b/arch/i386/kernel/signal.c
index c23188191..57e88b625 100644
--- a/arch/i386/kernel/signal.c
+++ b/arch/i386/kernel/signal.c
@@ -56,16 +56,15 @@ sys_sigsuspend(int history0, int history1, old_sigset_t mask)
 }
 
 asmlinkage int
-sys_rt_sigsuspend(sigset_t __user *unewset, size_t sigsetsize)
+sys_rt_sigsuspend(struct pt_regs regs)
 {
-	struct pt_regs * regs = (struct pt_regs *) &unewset;
 	sigset_t saveset, newset;
 
 	/* XXX: Don't preclude handling different sized sigset_t's.  */
-	if (sigsetsize != sizeof(sigset_t))
+	if (regs.ecx != sizeof(sigset_t))
 		return -EINVAL;
 
-	if (copy_from_user(&newset, unewset, sizeof(newset)))
+	if (copy_from_user(&newset, (sigset_t __user *)regs.ebx, sizeof(newset)))
 		return -EFAULT;
 	sigdelsetmask(&newset, ~_BLOCKABLE);
 
@@ -75,11 +74,11 @@ sys_rt_sigsuspend(sigset_t __user *unewset, size_t sigsetsize)
 	recalc_sigpending();
 	spin_unlock_irq(&current->sighand->siglock);
 
-	regs->eax = -EINTR;
+	regs.eax = -EINTR;
 	while (1) {
 		current->state = TASK_INTERRUPTIBLE;
 		schedule();
-		if (do_signal(regs, &saveset))
+		if (do_signal(&regs, &saveset))
 			return -EINTR;
 	}
 }
@@ -117,9 +116,13 @@ sys_sigaction(int sig, const struct old_sigaction __user *act,
 }
 
 asmlinkage int
-sys_sigaltstack(const stack_t __user *uss, stack_t __user *uoss)
+sys_sigaltstack(unsigned long ebx)
 {
-	struct pt_regs *regs = (struct pt_regs *) &uss;
+	/* This is needed to make gcc realize it doesn't own the "struct pt_regs" */
+	struct pt_regs *regs = (struct pt_regs *)&ebx;
+	const stack_t __user *uss = (const stack_t __user *)ebx;
+	stack_t __user *uoss = (stack_t __user *)regs->ecx;
+
 	return do_sigaltstack(uss, uoss, regs->esp);
 }
 
@@ -333,12 +336,13 @@ get_sigframe(struct k_sigaction *ka, struct pt_regs * regs, size_t frame_size)
 
 /* These symbols are defined with the addresses in the vsyscall page.
    See vsyscall-sigreturn.S.  */
-extern void __kernel_sigreturn, __kernel_rt_sigreturn;
+extern void __user __kernel_sigreturn;
+extern void __user __kernel_rt_sigreturn;
 
 static void setup_frame(int sig, struct k_sigaction *ka,
 			sigset_t *set, struct pt_regs * regs)
 {
-	void *restorer;
+	void __user *restorer;
 	struct sigframe __user *frame;
 	int err = 0;
 
@@ -415,7 +419,7 @@ give_sigsegv:
 static void setup_rt_frame(int sig, struct k_sigaction *ka, siginfo_t *info,
 			   sigset_t *set, struct pt_regs * regs)
 {
-	void *restorer;
+	void __user *restorer;
 	struct rt_sigframe __user *frame;
 	int err = 0;
 
diff --git a/arch/i386/kernel/smp.c b/arch/i386/kernel/smp.c
index 7c64adbf1..bb5960134 100644
--- a/arch/i386/kernel/smp.c
+++ b/arch/i386/kernel/smp.c
@@ -21,7 +21,6 @@
 #include <linux/interrupt.h>
 
 #include <asm/mtrr.h>
-#include <asm/pgalloc.h>
 #include <asm/tlbflush.h>
 #include <mach_ipi.h>
 #include <mach_apic.h>
@@ -160,7 +159,7 @@ void fastcall send_IPI_self(int vector)
  */
 inline void send_IPI_mask_bitmask(cpumask_t cpumask, int vector)
 {
-	unsigned long mask = cpus_coerce(cpumask);
+	unsigned long mask = cpus_addr(cpumask)[0];
 	unsigned long cfg;
 	unsigned long flags;
 
@@ -464,7 +463,7 @@ static void do_flush_tlb_all(void* info)
 
 void flush_tlb_all(void)
 {
-	on_each_cpu(do_flush_tlb_all, 0, 1, 1);
+	on_each_cpu(do_flush_tlb_all, NULL, 1, 1);
 }
 
 /*
diff --git a/arch/i386/kernel/smpboot.c b/arch/i386/kernel/smpboot.c
index 45e8fbab3..1a9b08190 100644
--- a/arch/i386/kernel/smpboot.c
+++ b/arch/i386/kernel/smpboot.c
@@ -47,7 +47,6 @@
 
 #include <linux/delay.h>
 #include <linux/mc146818rtc.h>
-#include <asm/pgalloc.h>
 #include <asm/tlbflush.h>
 #include <asm/desc.h>
 #include <asm/arch_hooks.h>
@@ -83,6 +82,7 @@ int smp_threads_ready;
 extern unsigned char trampoline_data [];
 extern unsigned char trampoline_end  [];
 static unsigned char *trampoline_base;
+static int trampoline_exec;
 
 /*
  * Currently trivial. Write the real->protected mode
@@ -109,6 +109,10 @@ void __init smp_alloc_memory(void)
 	 */
 	if (__pa(trampoline_base) >= 0x9F000)
 		BUG();
+	/*
+	 * Make the SMP trampoline executable:
+	 */
+	trampoline_exec = set_kernel_exec((unsigned long)trampoline_base, 1);
 }
 
 /*
@@ -1193,7 +1197,9 @@ __init void arch_init_sched_domains(void)
 		int j;
 		cpumask_t nodemask;
 		struct sched_group *node = &sched_group_nodes[i];
-		cpus_and(nodemask, node_to_cpumask(i), cpu_possible_map);
+		cpumask_t node_cpumask = node_to_cpumask(i);
+
+		cpus_and(nodemask, node_cpumask, cpu_possible_map);
 
 		if (cpus_empty(nodemask))
 			continue;
@@ -1229,7 +1235,9 @@ __init void arch_init_sched_domains(void)
 	for (i = 0; i < MAX_NUMNODES; i++) {
 		struct sched_group *cpu = &sched_group_nodes[i];
 		cpumask_t nodemask;
-		cpus_and(nodemask, node_to_cpumask(i), cpu_possible_map);
+		cpumask_t node_cpumask = node_to_cpumask(i);
+
+		cpus_and(nodemask, node_cpumask, cpu_possible_map);
 
 		if (cpus_empty(nodemask))
 			continue;
@@ -1372,6 +1380,10 @@ void __init smp_cpus_done(unsigned int max_cpus)
 	setup_ioapic_dest();
 #endif
 	zap_low_mappings();
+	/*
+	 * Disable executability of the SMP trampoline:
+	 */
+	set_kernel_exec((unsigned long)trampoline_base, trampoline_exec);
 }
 
 void __init smp_intr_init(void)
diff --git a/arch/i386/kernel/srat.c b/arch/i386/kernel/srat.c
index 8c0bd561f..e80cd8e41 100644
--- a/arch/i386/kernel/srat.c
+++ b/arch/i386/kernel/srat.c
@@ -181,23 +181,6 @@ static __init void chunk_to_zones(unsigned long cstart, unsigned long cend,
 	}
 }
 
-static void __init initialize_physnode_map(void)
-{
-	int i;
-	unsigned long pfn;
-	struct node_memory_chunk_s *nmcp;
-
-	/* Run the list of memory chunks and fill in the phymap. */
-	nmcp = node_memory_chunk;
-	for (i = num_memory_chunks; --i >= 0; nmcp++) {
-		for (pfn = nmcp->start_pfn; pfn <= nmcp->end_pfn;
-						pfn += PAGES_PER_ELEMENT)
-		{
-			physnode_map[pfn / PAGES_PER_ELEMENT] = (int)nmcp->nid;
-		}
-	}
-}
-
 /* Parse the ACPI Static Resource Affinity Table */
 static int __init acpi20_parse_srat(struct acpi_table_srat *sratp)
 {
@@ -265,8 +248,6 @@ static int __init acpi20_parse_srat(struct acpi_table_srat *sratp)
 	for (i = 0; i < num_memory_chunks; i++)
 		node_memory_chunk[i].nid = pxm_to_nid_map[node_memory_chunk[i].pxm];
 
-	initialize_physnode_map();
-	
 	printk("pxm bitmap: ");
 	for (i = 0; i < sizeof(pxm_bitmap); i++) {
 		printk("%02X ", pxm_bitmap[i]);
diff --git a/arch/i386/kernel/sys_i386.c b/arch/i386/kernel/sys_i386.c
index ae8822b15..e68b2ba12 100644
--- a/arch/i386/kernel/sys_i386.c
+++ b/arch/i386/kernel/sys_i386.c
@@ -150,7 +150,7 @@ asmlinkage int sys_ipc (uint call, int first, int second,
 		union semun fourth;
 		if (!ptr)
 			return -EINVAL;
-		if (get_user(fourth.__pad, (void * __user *) ptr))
+		if (get_user(fourth.__pad, (void __user * __user *) ptr))
 			return -EFAULT;
 		return sys_semctl (first, second, third, fourth);
 	}
diff --git a/arch/i386/kernel/sysenter.c b/arch/i386/kernel/sysenter.c
index c9194e33f..0daa404f5 100644
--- a/arch/i386/kernel/sysenter.c
+++ b/arch/i386/kernel/sysenter.c
@@ -45,7 +45,7 @@ static int __init sysenter_setup(void)
 {
 	unsigned long page = get_zeroed_page(GFP_ATOMIC);
 
-	__set_fixmap(FIX_VSYSCALL, __pa(page), PAGE_READONLY);
+	__set_fixmap(FIX_VSYSCALL, __pa(page), PAGE_READONLY_EXEC);
 
 	if (!boot_cpu_has(X86_FEATURE_SEP)) {
 		memcpy((void *) page,
diff --git a/arch/i386/kernel/time_hpet.c b/arch/i386/kernel/time_hpet.c
index a281711ec..0ec677d9e 100644
--- a/arch/i386/kernel/time_hpet.c
+++ b/arch/i386/kernel/time_hpet.c
@@ -21,6 +21,7 @@
 #include <linux/config.h>
 
 #include <asm/hpet.h>
+#include <linux/hpet.h>
 
 unsigned long hpet_period;	/* fsecs / HPET clock */
 unsigned long hpet_tick;	/* hpet clks count per tick */
@@ -135,6 +136,50 @@ int __init hpet_enable(void)
 	hpet_writel(cfg, HPET_CFG);
 
 	use_hpet = 1;
+
+#ifdef	CONFIG_HPET
+	{
+		struct hpet_data	hd;
+		unsigned int 		ntimer;
+
+		memset(&hd, 0, sizeof (hd));
+
+		ntimer = hpet_readl(HPET_ID);
+		ntimer = (ntimer & HPET_ID_NUMBER) >> HPET_ID_NUMBER_SHIFT;
+		ntimer++;
+
+		/*
+		 * Register with driver.
+		 * Timer0 and Timer1 is used by platform.
+		 */
+		hd.hd_address = hpet_virt_address;
+		hd.hd_nirqs = ntimer;
+		hd.hd_flags = HPET_DATA_PLATFORM;
+		hpet_reserve_timer(&hd, 0);
+#ifdef	CONFIG_HPET_EMULATE_RTC
+		hpet_reserve_timer(&hd, 1);
+#endif
+		hd.hd_irq[0] = HPET_LEGACY_8254;
+		hd.hd_irq[1] = HPET_LEGACY_RTC;
+		if (ntimer > 2) {
+			struct hpet		*hpet;
+			struct hpet_timer	*timer;
+			int			i;
+
+			hpet = (struct hpet *) hpet_virt_address;
+
+			for (i = 2, timer = &hpet->hpet_timers[2]; i < ntimer;
+				timer++, i++)
+				hd.hd_irq[i] = (timer->hpet_config &
+					Tn_INT_ROUTE_CNF_MASK) >>
+					Tn_INT_ROUTE_CNF_SHIFT;
+
+		}
+
+		hpet_alloc(&hd);
+	}
+#endif
+
 #ifdef CONFIG_X86_LOCAL_APIC
 	wait_timer_tick = wait_hpet_tick;
 #endif
diff --git a/arch/i386/kernel/timers/timer_none.c b/arch/i386/kernel/timers/timer_none.c
index de744f7bc..394a75250 100644
--- a/arch/i386/kernel/timers/timer_none.c
+++ b/arch/i386/kernel/timers/timer_none.c
@@ -34,7 +34,7 @@ static void delay_none(unsigned long loops)
 		:"0" (loops));
 }
 
-/* tsc timer_opts struct */
+/* none timer_opts struct */
 struct timer_opts timer_none = {
 	.name = 	"none",
 	.init =		init_none, 
diff --git a/arch/i386/kernel/timers/timer_pm.c b/arch/i386/kernel/timers/timer_pm.c
index 7aa63c9b8..737a0219d 100644
--- a/arch/i386/kernel/timers/timer_pm.c
+++ b/arch/i386/kernel/timers/timer_pm.c
@@ -21,6 +21,14 @@
 #include <asm/io.h>
 #include <asm/arch_hooks.h>
 
+#include <linux/timex.h>
+#include "mach_timer.h"
+
+/* Number of PMTMR ticks expected during calibration run */
+#define PMTMR_TICKS_PER_SEC 3579545
+#define PMTMR_EXPECTED_RATE \
+  ((CALIBRATE_LATCH * (PMTMR_TICKS_PER_SEC >> 10)) / (CLOCK_TICK_RATE>>10))
+
 
 /* The I/O port the PMTMR resides at.
  * The location is detected during setup_arch(),
@@ -57,6 +65,33 @@ static inline u32 read_pmtmr(void)
 	return v2 & ACPI_PM_MASK;
 }
 
+
+/*
+ * Some boards have the PMTMR running way too fast. We check
+ * the PMTMR rate against PIT channel 2 to catch these cases.
+ */
+static int verify_pmtmr_rate(void)
+{
+	u32 value1, value2;
+	unsigned long count, delta;
+
+	mach_prepare_counter();
+	value1 = read_pmtmr();
+	mach_countup(&count);
+	value2 = read_pmtmr();
+	delta = (value2 - value1) & ACPI_PM_MASK;
+
+	/* Check that the PMTMR delta is within 5% of what we expect */
+	if (delta < (PMTMR_EXPECTED_RATE * 19) / 20 ||
+	    delta > (PMTMR_EXPECTED_RATE * 21) / 20) {
+		printk(KERN_INFO "PM-Timer running at invalid rate: %lu%% of normal - aborting.\n", 100UL * delta / PMTMR_EXPECTED_RATE);
+		return -1;
+	}
+
+	return 0;
+}
+
+
 static int init_pmtmr(char* override)
 {
 	u32 value1, value2;
@@ -89,6 +124,9 @@ static int init_pmtmr(char* override)
 	return -ENODEV;
 
 pm_good:
+	if (verify_pmtmr_rate() != 0)
+		return -ENODEV;
+
 	init_cpu_khz();
 	return 0;
 }
diff --git a/arch/i386/kernel/timers/timer_tsc.c b/arch/i386/kernel/timers/timer_tsc.c
index b20fe4dc1..a1e3f6f96 100644
--- a/arch/i386/kernel/timers/timer_tsc.c
+++ b/arch/i386/kernel/timers/timer_tsc.c
@@ -1,6 +1,10 @@
 /*
  * This code largely moved from arch/i386/kernel/time.c.
  * See comments there for proper credits.
+ *
+ * 2004-06-25    Jesper Juhl
+ *      moved mark_offset_tsc below cpufreq_delayed_get to avoid gcc 3.4
+ *      failing to inline.
  */
 
 #include <linux/spinlock.h>
@@ -70,7 +74,6 @@ static inline unsigned long long cycles_2_ns(unsigned long long cyc)
 	return (cyc * cyc2ns_scale) >> CYC2NS_SCALE_FACTOR;
 }
 
-
 static int count2; /* counter for mark_offset_tsc() */
 
 /* Cached *multiplier* to convert TSC counts to microseconds.
@@ -152,119 +155,6 @@ unsigned long long sched_clock(void)
 	return cycles_2_ns(this_offset);
 }
 
-
-static void mark_offset_tsc(void)
-{
-	unsigned long lost,delay;
-	unsigned long delta = last_tsc_low;
-	int count;
-	int countmp;
-	static int count1 = 0;
-	unsigned long long this_offset, last_offset;
-	static int lost_count = 0;
-	
-	write_seqlock(&monotonic_lock);
-	last_offset = ((unsigned long long)last_tsc_high<<32)|last_tsc_low;
-	/*
-	 * It is important that these two operations happen almost at
-	 * the same time. We do the RDTSC stuff first, since it's
-	 * faster. To avoid any inconsistencies, we need interrupts
-	 * disabled locally.
-	 */
-
-	/*
-	 * Interrupts are just disabled locally since the timer irq
-	 * has the SA_INTERRUPT flag set. -arca
-	 */
-	
-	/* read Pentium cycle counter */
-
-	rdtsc(last_tsc_low, last_tsc_high);
-
-	spin_lock(&i8253_lock);
-	outb_p(0x00, PIT_MODE);     /* latch the count ASAP */
-
-	count = inb_p(PIT_CH0);    /* read the latched count */
-	count |= inb(PIT_CH0) << 8;
-
-	/*
-	 * VIA686a test code... reset the latch if count > max + 1
-	 * from timer_pit.c - cjb
-	 */
-	if (count > LATCH) {
-		outb_p(0x34, PIT_MODE);
-		outb_p(LATCH & 0xff, PIT_CH0);
-		outb(LATCH >> 8, PIT_CH0);
-		count = LATCH - 1;
-	}
-
-	spin_unlock(&i8253_lock);
-
-	if (pit_latch_buggy) {
-		/* get center value of last 3 time lutch */
-		if ((count2 >= count && count >= count1)
-		    || (count1 >= count && count >= count2)) {
-			count2 = count1; count1 = count;
-		} else if ((count1 >= count2 && count2 >= count)
-			   || (count >= count2 && count2 >= count1)) {
-			countmp = count;count = count2;
-			count2 = count1;count1 = countmp;
-		} else {
-			count2 = count1; count1 = count; count = count1;
-		}
-	}
-
-	/* lost tick compensation */
-	delta = last_tsc_low - delta;
-	{
-		register unsigned long eax, edx;
-		eax = delta;
-		__asm__("mull %2"
-		:"=a" (eax), "=d" (edx)
-		:"rm" (fast_gettimeoffset_quotient),
-		 "0" (eax));
-		delta = edx;
-	}
-	delta += delay_at_last_interrupt;
-	lost = delta/(1000000/HZ);
-	delay = delta%(1000000/HZ);
-	if (lost >= 2) {
-		jiffies_64 += lost-1;
-
-		/* sanity check to ensure we're not always losing ticks */
-		if (lost_count++ > 100) {
-			printk(KERN_WARNING "Losing too many ticks!\n");
-			printk(KERN_WARNING "TSC cannot be used as a timesource.  \n");
-			printk(KERN_WARNING "Possible reasons for this are:\n");
-			printk(KERN_WARNING "  You're running with Speedstep,\n");
-			printk(KERN_WARNING "  You don't have DMA enabled for your hard disk (see hdparm),\n");
-			printk(KERN_WARNING "  Incorrect TSC synchronization on an SMP system (see dmesg).\n");
-			printk(KERN_WARNING "Falling back to a sane timesource now.\n");
-
-			clock_fallback();
-		}
-		/* ... but give the TSC a fair chance */
-		if (lost_count > 25)
-			cpufreq_delayed_get();
-	} else
-		lost_count = 0;
-	/* update the monotonic base value */
-	this_offset = ((unsigned long long)last_tsc_high<<32)|last_tsc_low;
-	monotonic_base += cycles_2_ns(this_offset - last_offset);
-	write_sequnlock(&monotonic_lock);
-
-	/* calculate delay_at_last_interrupt */
-	count = ((LATCH-1) - count) * TICK_SIZE;
-	delay_at_last_interrupt = (count + LATCH/2) / LATCH;
-
-	/* catch corner case where tick rollover occured 
-	 * between tsc and pit reads (as noted when 
-	 * usec delta is > 90% # of usecs/tick)
-	 */
-	if (lost && abs(delay - delay_at_last_interrupt) > (900000/HZ))
-		jiffies_64++;
-}
-
 static void delay_tsc(unsigned long loops)
 {
 	unsigned long bclock, now;
@@ -415,7 +305,8 @@ static int __init cpufreq_tsc(void)
 {
 	int ret;
 	INIT_WORK(&cpufreq_delayed_get_work, handle_cpufreq_delayed_get, NULL);
-	ret = cpufreq_register_notifier(&time_cpufreq_notifier_block, CPUFREQ_TRANSITION_NOTIFIER);
+	ret = cpufreq_register_notifier(&time_cpufreq_notifier_block,
+					CPUFREQ_TRANSITION_NOTIFIER);
 	if (!ret)
 		cpufreq_init = 1;
 	return ret;
@@ -426,6 +317,117 @@ core_initcall(cpufreq_tsc);
 static inline void cpufreq_delayed_get(void) { return; }
 #endif 
 
+static void mark_offset_tsc(void)
+{
+	unsigned long lost,delay;
+	unsigned long delta = last_tsc_low;
+	int count;
+	int countmp;
+	static int count1 = 0;
+	unsigned long long this_offset, last_offset;
+	static int lost_count = 0;
+
+	write_seqlock(&monotonic_lock);
+	last_offset = ((unsigned long long)last_tsc_high<<32)|last_tsc_low;
+	/*
+	 * It is important that these two operations happen almost at
+	 * the same time. We do the RDTSC stuff first, since it's
+	 * faster. To avoid any inconsistencies, we need interrupts
+	 * disabled locally.
+	 */
+
+	/*
+	 * Interrupts are just disabled locally since the timer irq
+	 * has the SA_INTERRUPT flag set. -arca
+	 */
+
+	/* read Pentium cycle counter */
+
+	rdtsc(last_tsc_low, last_tsc_high);
+
+	spin_lock(&i8253_lock);
+	outb_p(0x00, PIT_MODE);     /* latch the count ASAP */
+
+	count = inb_p(PIT_CH0);    /* read the latched count */
+	count |= inb(PIT_CH0) << 8;
+
+	/*
+	 * VIA686a test code... reset the latch if count > max + 1
+	 * from timer_pit.c - cjb
+	 */
+	if (count > LATCH) {
+		outb_p(0x34, PIT_MODE);
+		outb_p(LATCH & 0xff, PIT_CH0);
+		outb(LATCH >> 8, PIT_CH0);
+		count = LATCH - 1;
+	}
+
+	spin_unlock(&i8253_lock);
+
+	if (pit_latch_buggy) {
+		/* get center value of last 3 time lutch */
+		if ((count2 >= count && count >= count1)
+		    || (count1 >= count && count >= count2)) {
+			count2 = count1; count1 = count;
+		} else if ((count1 >= count2 && count2 >= count)
+			   || (count >= count2 && count2 >= count1)) {
+			countmp = count;count = count2;
+			count2 = count1;count1 = countmp;
+		} else {
+			count2 = count1; count1 = count; count = count1;
+		}
+	}
+
+	/* lost tick compensation */
+	delta = last_tsc_low - delta;
+	{
+		register unsigned long eax, edx;
+		eax = delta;
+		__asm__("mull %2"
+		:"=a" (eax), "=d" (edx)
+		:"rm" (fast_gettimeoffset_quotient),
+		 "0" (eax));
+		delta = edx;
+	}
+	delta += delay_at_last_interrupt;
+	lost = delta/(1000000/HZ);
+	delay = delta%(1000000/HZ);
+	if (lost >= 2) {
+		jiffies_64 += lost-1;
+
+		/* sanity check to ensure we're not always losing ticks */
+		if (lost_count++ > 100) {
+			printk(KERN_WARNING "Losing too many ticks!\n");
+			printk(KERN_WARNING "TSC cannot be used as a timesource.  \n");
+			printk(KERN_WARNING "Possible reasons for this are:\n");
+			printk(KERN_WARNING "  You're running with Speedstep,\n");
+			printk(KERN_WARNING "  You don't have DMA enabled for your hard disk (see hdparm),\n");
+			printk(KERN_WARNING "  Incorrect TSC synchronization on an SMP system (see dmesg).\n");
+			printk(KERN_WARNING "Falling back to a sane timesource now.\n");
+
+			clock_fallback();
+		}
+		/* ... but give the TSC a fair chance */
+		if (lost_count > 25)
+			cpufreq_delayed_get();
+	} else
+		lost_count = 0;
+	/* update the monotonic base value */
+	this_offset = ((unsigned long long)last_tsc_high<<32)|last_tsc_low;
+	monotonic_base += cycles_2_ns(this_offset - last_offset);
+	write_sequnlock(&monotonic_lock);
+
+	/* calculate delay_at_last_interrupt */
+	count = ((LATCH-1) - count) * TICK_SIZE;
+	delay_at_last_interrupt = (count + LATCH/2) / LATCH;
+
+	/* catch corner case where tick rollover occured
+	 * between tsc and pit reads (as noted when
+	 * usec delta is > 90% # of usecs/tick)
+	 */
+	if (lost && abs(delay - delay_at_last_interrupt) > (900000/HZ))
+		jiffies_64++;
+}
 
 static int __init init_tsc(char* override)
 {
diff --git a/arch/i386/kernel/traps.c b/arch/i386/kernel/traps.c
index f031de058..a3daea013 100644
--- a/arch/i386/kernel/traps.c
+++ b/arch/i386/kernel/traps.c
@@ -47,7 +47,6 @@
 #include <asm/nmi.h>
 
 #include <asm/smp.h>
-#include <asm/pgalloc.h>
 #include <asm/arch_hooks.h>
 
 #include <linux/irq.h>
@@ -104,7 +103,7 @@ static int valid_stack_ptr(struct task_struct *task, void *p)
 }
 
 #ifdef CONFIG_FRAME_POINTER
-void print_context_stack(struct task_struct *task, unsigned long *stack,
+static void print_context_stack(struct task_struct *task, unsigned long *stack,
 			 unsigned long ebp)
 {
 	unsigned long addr;
@@ -118,16 +117,17 @@ void print_context_stack(struct task_struct *task, unsigned long *stack,
 	}
 }
 #else
-void print_context_stack(struct task_struct *task, unsigned long *stack,
+static void print_context_stack(struct task_struct *task, unsigned long *stack,
 			 unsigned long ebp)
 {
 	unsigned long addr;
 
 	while (!kstack_end(stack)) {
 		addr = *stack++;
-		if (kernel_text_address(addr)) {
-			printk(" [<%08lx>] ", addr);
-			print_symbol("%s\n", addr);
+		if (__kernel_text_address(addr)) {
+			printk(" [<%08lx>]", addr);
+			print_symbol(" %s", addr);
+			printk("\n");
 		}
 	}
 }
@@ -163,7 +163,6 @@ void show_trace(struct task_struct *task, unsigned long * stack)
 			break;
 		printk(" =======================\n");
 	}
-	printk("\n");
 }
 
 void show_stack(struct task_struct *task, unsigned long *esp)
@@ -398,7 +397,7 @@ asmlinkage void do_##name(struct pt_regs * regs, long error_code) \
 	info.si_signo = signr; \
 	info.si_errno = 0; \
 	info.si_code = sicode; \
-	info.si_addr = (void *)siaddr; \
+	info.si_addr = (void __user *)siaddr; \
 	do_trap(trapnr, signr, str, 0, regs, error_code, &info); \
 }
 
@@ -415,7 +414,7 @@ asmlinkage void do_##name(struct pt_regs * regs, long error_code) \
 	info.si_signo = signr; \
 	info.si_errno = 0; \
 	info.si_code = sicode; \
-	info.si_addr = (void *)siaddr; \
+	info.si_addr = (void __user *)siaddr; \
 	do_trap(trapnr, signr, str, 1, regs, error_code, &info); \
 }
 
@@ -631,8 +630,8 @@ asmlinkage void do_debug(struct pt_regs * regs, long error_code)
 	/* If this is a kernel mode trap, save the user PC on entry to 
 	 * the kernel, that's what the debugger can make sense of.
 	 */
-	info.si_addr = ((regs->xcs & 3) == 0) ? (void *)tsk->thread.eip : 
-	                                        (void *)regs->eip;
+	info.si_addr = ((regs->xcs & 3) == 0) ? (void __user *)tsk->thread.eip
+	                                      : (void __user *)regs->eip;
 	force_sig_info(SIGTRAP, &info, tsk);
 
 	/* Disable additional traps. They'll be re-enabled when
@@ -660,7 +659,7 @@ clear_TF:
  * the correct behaviour even in the presence of the asynchronous
  * IRQ13 behaviour
  */
-void math_error(void *eip)
+void math_error(void __user *eip)
 {
 	struct task_struct * task;
 	siginfo_t info;
@@ -719,10 +718,10 @@ void math_error(void *eip)
 asmlinkage void do_coprocessor_error(struct pt_regs * regs, long error_code)
 {
 	ignore_fpu_irq = 1;
-	math_error((void *)regs->eip);
+	math_error((void __user *)regs->eip);
 }
 
-void simd_math_error(void *eip)
+void simd_math_error(void __user *eip)
 {
 	struct task_struct * task;
 	siginfo_t info;
@@ -776,7 +775,7 @@ asmlinkage void do_simd_coprocessor_error(struct pt_regs * regs,
 	if (cpu_has_xmm) {
 		/* Handle SIMD FPU exceptions on PIII+ processors. */
 		ignore_fpu_irq = 1;
-		simd_math_error((void *)regs->eip);
+		simd_math_error((void __user *)regs->eip);
 	} else {
 		/*
 		 * Handle strange cache flush from user space exception
diff --git a/arch/i386/kernel/vm86.c b/arch/i386/kernel/vm86.c
index a5af5ec33..4484e47a7 100644
--- a/arch/i386/kernel/vm86.c
+++ b/arch/i386/kernel/vm86.c
@@ -44,7 +44,6 @@
 #include <linux/ptrace.h>
 
 #include <asm/uaccess.h>
-#include <asm/pgalloc.h>
 #include <asm/io.h>
 #include <asm/tlbflush.h>
 #include <asm/irq.h>
@@ -178,8 +177,9 @@ out:
 static int do_vm86_irq_handling(int subfunction, int irqnumber);
 static void do_sys_vm86(struct kernel_vm86_struct *info, struct task_struct *tsk);
 
-asmlinkage int sys_vm86old(struct vm86_struct __user * v86)
+asmlinkage int sys_vm86old(struct pt_regs regs)
 {
+	struct vm86_struct __user *v86 = (struct vm86_struct __user *)regs.ebx;
 	struct kernel_vm86_struct info; /* declare this _on top_,
 					 * this avoids wasting of stack space.
 					 * This remains on the stack until we
@@ -198,7 +198,7 @@ asmlinkage int sys_vm86old(struct vm86_struct __user * v86)
 	if (tmp)
 		goto out;
 	memset(&info.vm86plus, 0, (int)&info.regs32 - (int)&info.vm86plus);
-	info.regs32 = (struct pt_regs *) &v86;
+	info.regs32 = &regs;
 	tsk->thread.vm86_info = v86;
 	do_sys_vm86(&info, tsk);
 	ret = 0;	/* we never return here */
@@ -207,7 +207,7 @@ out:
 }
 
 
-asmlinkage int sys_vm86(unsigned long subfunction, struct vm86plus_struct __user * v86)
+asmlinkage int sys_vm86(struct pt_regs regs)
 {
 	struct kernel_vm86_struct info; /* declare this _on top_,
 					 * this avoids wasting of stack space.
@@ -216,14 +216,15 @@ asmlinkage int sys_vm86(unsigned long subfunction, struct vm86plus_struct __user
 					 */
 	struct task_struct *tsk;
 	int tmp, ret;
+	struct vm86plus_struct __user *v86;
 
 	tsk = current;
-	switch (subfunction) {
+	switch (regs.ebx) {
 		case VM86_REQUEST_IRQ:
 		case VM86_FREE_IRQ:
 		case VM86_GET_IRQ_BITS:
 		case VM86_GET_AND_RESET_IRQ:
-			ret = do_vm86_irq_handling(subfunction,(int)v86);
+			ret = do_vm86_irq_handling(regs.ebx, (int)regs.ecx);
 			goto out;
 		case VM86_PLUS_INSTALL_CHECK:
 			/* NOTE: on old vm86 stuff this will return the error
@@ -239,13 +240,14 @@ asmlinkage int sys_vm86(unsigned long subfunction, struct vm86plus_struct __user
 	ret = -EPERM;
 	if (tsk->thread.saved_esp0)
 		goto out;
+	v86 = (struct vm86plus_struct __user *)regs.ecx;
 	tmp  = copy_from_user(&info, v86, VM86_REGS_SIZE1);
 	tmp += copy_from_user(&info.regs.VM86_REGS_PART2, &v86->regs.VM86_REGS_PART2,
 		(long)&info.regs32 - (long)&info.regs.VM86_REGS_PART2);
 	ret = -EFAULT;
 	if (tmp)
 		goto out;
-	info.regs32 = (struct pt_regs *) &subfunction;
+	info.regs32 = &regs;
 	info.vm86plus.is_vm86pus = 1;
 	tsk->thread.vm86_info = (struct vm86_struct __user *)v86;
 	do_sys_vm86(&info, tsk);
@@ -392,6 +394,7 @@ static inline unsigned long get_vflags(struct kernel_vm86_regs * regs)
 
 	if (VEFLAGS & VIF_MASK)
 		flags |= IF_MASK;
+	flags |= IOPL_MASK;
 	return flags | (VEFLAGS & current->thread.v86mask);
 }
 
@@ -486,9 +489,10 @@ static inline int is_revectored(int nr, struct revectored_struct * bitmap)
  * in userspace is always better than an Oops anyway.) [KD]
  */
 static void do_int(struct kernel_vm86_regs *regs, int i,
-    unsigned char * ssp, unsigned short sp)
+    unsigned char __user * ssp, unsigned short sp)
 {
-	unsigned long *intr_ptr, segoffs;
+	unsigned long __user *intr_ptr;
+	unsigned long segoffs;
 
 	if (regs->cs == BIOSSEG)
 		goto cannot_handle;
@@ -496,7 +500,7 @@ static void do_int(struct kernel_vm86_regs *regs, int i,
 		goto cannot_handle;
 	if (i==0x21 && is_revectored(AH(regs),&KVM86->int21_revectored))
 		goto cannot_handle;
-	intr_ptr = (unsigned long *) (i << 2);
+	intr_ptr = (unsigned long __user *) (i << 2);
 	if (get_user(segoffs, intr_ptr))
 		goto cannot_handle;
 	if ((segoffs >> 16) == BIOSSEG)
@@ -521,7 +525,7 @@ int handle_vm86_trap(struct kernel_vm86_regs * regs, long error_code, int trapno
 	if (VMPI.is_vm86pus) {
 		if ( (trapno==3) || (trapno==1) )
 			return_to_32bit(regs, VM86_TRAP + (trapno << 8));
-		do_int(regs, trapno, (unsigned char *) (regs->ss << 4), SP(regs));
+		do_int(regs, trapno, (unsigned char __user *) (regs->ss << 4), SP(regs));
 		return 0;
 	}
 	if (trapno !=1)
@@ -541,7 +545,9 @@ int handle_vm86_trap(struct kernel_vm86_regs * regs, long error_code, int trapno
 
 void handle_vm86_fault(struct kernel_vm86_regs * regs, long error_code)
 {
-	unsigned char *csp, *ssp, opcode;
+	unsigned char opcode;
+	unsigned char __user *csp;
+	unsigned char __user *ssp;
 	unsigned short ip, sp;
 	int data32, pref_done;
 
@@ -553,8 +559,8 @@ void handle_vm86_fault(struct kernel_vm86_regs * regs, long error_code)
 		return_to_32bit(regs, VM86_PICRETURN); \
 	return; } while (0)
 
-	csp = (unsigned char *) (regs->cs << 4);
-	ssp = (unsigned char *) (regs->ss << 4);
+	csp = (unsigned char __user *) (regs->cs << 4);
+	ssp = (unsigned char __user *) (regs->ss << 4);
 	sp = SP(regs);
 	ip = IP(regs);
 
@@ -727,8 +733,8 @@ static inline void free_vm86_irq(int irqnumber)
 {
 	unsigned long flags;
 
-	free_irq(irqnumber,0);
-	vm86_irqs[irqnumber].tsk = 0;
+	free_irq(irqnumber, NULL);
+	vm86_irqs[irqnumber].tsk = NULL;
 
 	spin_lock_irqsave(&irqbits_lock, flags);	
 	irqbits &= ~(1 << irqnumber);
@@ -778,7 +784,7 @@ static int do_vm86_irq_handling(int subfunction, int irqnumber)
 			if (!((1 << sig) & ALLOWED_SIGS)) return -EPERM;
 			if (invalid_vm86_irq(irq)) return -EPERM;
 			if (vm86_irqs[irq].tsk) return -EPERM;
-			ret = request_irq(irq, &irq_handler, 0, VM86_IRQNAME, 0);
+			ret = request_irq(irq, &irq_handler, 0, VM86_IRQNAME, NULL);
 			if (ret) return ret;
 			vm86_irqs[irq].sig = sig;
 			vm86_irqs[irq].tsk = current;
diff --git a/arch/i386/lib/Makefile b/arch/i386/lib/Makefile
index 518cebc21..135484329 100644
--- a/arch/i386/lib/Makefile
+++ b/arch/i386/lib/Makefile
@@ -3,9 +3,8 @@
 #
 
 
-lib-y = checksum.o delay.o \
-	usercopy.o getuser.o \
-	memcpy.o strstr.o
+lib-y = checksum.o delay.o usercopy.o getuser.o memcpy.o strstr.o \
+	bitops.o
 
 lib-$(CONFIG_X86_USE_3DNOW) += mmx.o
 lib-$(CONFIG_HAVE_DEC_LOCK) += dec_and_lock.o
diff --git a/arch/i386/lib/delay.c b/arch/i386/lib/delay.c
index 028dd9bbd..97b97af9c 100644
--- a/arch/i386/lib/delay.c
+++ b/arch/i386/lib/delay.c
@@ -31,15 +31,16 @@ void __delay(unsigned long loops)
 inline void __const_udelay(unsigned long xloops)
 {
 	int d0;
+	xloops *= 4;
 	__asm__("mull %0"
 		:"=d" (xloops), "=&a" (d0)
-		:"1" (xloops),"0" (current_cpu_data.loops_per_jiffy));
-        __delay(xloops * HZ);
+		:"1" (xloops),"0" (current_cpu_data.loops_per_jiffy * (HZ/4)));
+        __delay(++xloops);
 }
 
 void __udelay(unsigned long usecs)
 {
-	__const_udelay(usecs * 0x000010c6);  /* 2**32 / 1000000 */
+	__const_udelay(usecs * 0x000010c7);  /* 2**32 / 1000000 (rounded up) */
 }
 
 void __ndelay(unsigned long nsecs)
diff --git a/arch/i386/lib/memcpy.c b/arch/i386/lib/memcpy.c
index 4cb37b6e5..ad16efa52 100644
--- a/arch/i386/lib/memcpy.c
+++ b/arch/i386/lib/memcpy.c
@@ -1,10 +1,11 @@
 #include <linux/config.h>
 #include <linux/string.h>
+#include <linux/module.h>
 
 #undef memcpy
 #undef memset
 
-void * memcpy(void * to, const void * from, size_t n)
+void *memcpy(void *to, const void *from, size_t n)
 {
 #ifdef CONFIG_X86_USE_3DNOW
 	return __memcpy3d(to, from, n);
@@ -12,8 +13,32 @@ void * memcpy(void * to, const void * from, size_t n)
 	return __memcpy(to, from, n);
 #endif
 }
+EXPORT_SYMBOL_NOVERS(memcpy);
 
-void * memset(void * s, int c, size_t count)
+void *memset(void *s, int c, size_t count)
 {
 	return __memset(s, c, count);
 }
+EXPORT_SYMBOL_NOVERS(memset);
+
+void *memmove(void *dest, const void *src, size_t n)
+{
+	int d0, d1, d2;
+
+	if (dest < src) {
+		memcpy(dest,src,n);
+	} else {
+		__asm__ __volatile__(
+			"std\n\t"
+			"rep\n\t"
+			"movsb\n\t"
+			"cld"
+			: "=&c" (d0), "=&S" (d1), "=&D" (d2)
+			:"0" (n),
+			 "1" (n-1+(const char *)src),
+			 "2" (n-1+(char *)dest)
+			:"memory");
+	}
+	return dest;
+}
+EXPORT_SYMBOL_NOVERS(memmove);
diff --git a/arch/i386/lib/usercopy.c b/arch/i386/lib/usercopy.c
index 416a4d10f..e1bcec2b5 100644
--- a/arch/i386/lib/usercopy.c
+++ b/arch/i386/lib/usercopy.c
@@ -219,7 +219,7 @@ long strnlen_user(const char __user *s, long n)
 
 #ifdef CONFIG_X86_INTEL_USERCOPY
 static unsigned long
-__copy_user_intel(void *to, const void *from,unsigned long size)
+__copy_user_intel(void __user *to, const void *from, unsigned long size)
 {
 	int d0, d1;
 	__asm__ __volatile__(
@@ -326,7 +326,7 @@ __copy_user_intel(void *to, const void *from,unsigned long size)
 }
 
 static unsigned long
-__copy_user_zeroing_intel(void *to, const void *from, unsigned long size)
+__copy_user_zeroing_intel(void *to, const void __user *from, unsigned long size)
 {
 	int d0, d1;
 	__asm__ __volatile__(
@@ -425,9 +425,9 @@ __copy_user_zeroing_intel(void *to, const void *from, unsigned long size)
  * them
  */
 unsigned long
-__copy_user_zeroing_intel(void *to, const void *from, unsigned long size);
+__copy_user_zeroing_intel(void *to, const void __user *from, unsigned long size);
 unsigned long
-__copy_user_intel(void *to, const void *from,unsigned long size);
+__copy_user_intel(void __user *to, const void *from, unsigned long size);
 #endif /* CONFIG_X86_INTEL_USERCOPY */
 
 /* Generic arbitrary sized copy.  */
@@ -562,9 +562,9 @@ survive:
 	}
 #endif
 	if (movsl_is_ok(to, from, n))
-		__copy_user((void *)to, from, n);
+		__copy_user(to, from, n);
 	else
-		n = __copy_user_intel((void *)to, from, n);
+		n = __copy_user_intel(to, from, n);
 	return n;
 }
 
@@ -572,9 +572,9 @@ unsigned long
 __copy_from_user_ll(void *to, const void __user *from, unsigned long n)
 {
 	if (movsl_is_ok(to, from, n))
-		__copy_user_zeroing(to, (const void *) from, n);
+		__copy_user_zeroing(to, from, n);
 	else
-		n = __copy_user_zeroing_intel(to, (const void *) from, n);
+		n = __copy_user_zeroing_intel(to, from, n);
 	return n;
 }
 
diff --git a/arch/i386/mach-default/setup.c b/arch/i386/mach-default/setup.c
index 718f718d0..0aa08eaa8 100644
--- a/arch/i386/mach-default/setup.c
+++ b/arch/i386/mach-default/setup.c
@@ -27,7 +27,7 @@ void __init pre_intr_init_hook(void)
 /*
  * IRQ2 is cascade interrupt to second interrupt controller
  */
-static struct irqaction irq2 = { no_action, 0, 0, "cascade", NULL, NULL};
+static struct irqaction irq2 = { no_action, 0, CPU_MASK_NONE, "cascade", NULL, NULL};
 
 /**
  * intr_init_hook - post gate setup interrupt initialisation
@@ -71,7 +71,7 @@ void __init trap_init_hook(void)
 {
 }
 
-static struct irqaction irq0  = { timer_interrupt, SA_INTERRUPT, 0, "timer", NULL, NULL};
+static struct irqaction irq0  = { timer_interrupt, SA_INTERRUPT, CPU_MASK_NONE, "timer", NULL, NULL};
 
 /**
  * time_init_hook - do any specific initialisations for the system timer.
diff --git a/arch/i386/mach-visws/mpparse.c b/arch/i386/mach-visws/mpparse.c
index dd1525aa5..fa800641a 100644
--- a/arch/i386/mach-visws/mpparse.c
+++ b/arch/i386/mach-visws/mpparse.c
@@ -57,12 +57,12 @@ void __init MP_processor_info (struct mpc_config_processor *m)
 		boot_cpu_logical_apicid = logical_apicid;
 	}
 
-	if (m->mpc_apicid > MAX_APICS) {
+	ver = m->mpc_apicver;
+	if ((ver >= 0x14 && m->mpc_apicid >= 0xff) || m->mpc_apicid >= 0xf) {
 		printk(KERN_ERR "Processor #%d INVALID. (Max ID: %d).\n",
 			m->mpc_apicid, MAX_APICS);
 		return;
 	}
-	ver = m->mpc_apicver;
 
 	apic_cpus = apicid_to_cpu_present(m->mpc_apicid);
 	physids_or(phys_cpu_present_map, phys_cpu_present_map, apic_cpus);
diff --git a/arch/i386/mach-visws/traps.c b/arch/i386/mach-visws/traps.c
index a3c22c093..964353992 100644
--- a/arch/i386/mach-visws/traps.c
+++ b/arch/i386/mach-visws/traps.c
@@ -8,7 +8,6 @@
 #include <linux/pci_ids.h>
 
 #include <asm/io.h>
-#include <asm/pgalloc.h>
 #include <asm/arch_hooks.h>
 #include <asm/apic.h>
 #include "cobalt.h"
diff --git a/arch/i386/mach-voyager/setup.c b/arch/i386/mach-voyager/setup.c
index 9bbf8953f..df123fc48 100644
--- a/arch/i386/mach-voyager/setup.c
+++ b/arch/i386/mach-voyager/setup.c
@@ -17,7 +17,7 @@ void __init pre_intr_init_hook(void)
 /*
  * IRQ2 is cascade interrupt to second interrupt controller
  */
-static struct irqaction irq2 = { no_action, 0, 0, "cascade", NULL, NULL};
+static struct irqaction irq2 = { no_action, 0, CPU_MASK_NONE, "cascade", NULL, NULL};
 
 void __init intr_init_hook(void)
 {
@@ -40,7 +40,7 @@ void __init trap_init_hook(void)
 {
 }
 
-static struct irqaction irq0  = { timer_interrupt, SA_INTERRUPT, 0, "timer", NULL, NULL};
+static struct irqaction irq0  = { timer_interrupt, SA_INTERRUPT, CPU_MASK_NONE, "timer", NULL, NULL};
 
 void __init time_init_hook(void)
 {
diff --git a/arch/i386/mach-voyager/voyager_basic.c b/arch/i386/mach-voyager/voyager_basic.c
index 528bc8f8d..61a481423 100644
--- a/arch/i386/mach-voyager/voyager_basic.c
+++ b/arch/i386/mach-voyager/voyager_basic.c
@@ -24,7 +24,6 @@
 #include <linux/reboot.h>
 #include <linux/sysrq.h>
 #include <asm/io.h>
-#include <asm/pgalloc.h>
 #include <asm/voyager.h>
 #include <asm/vic.h>
 #include <linux/pm.h>
diff --git a/arch/i386/mach-voyager/voyager_smp.c b/arch/i386/mach-voyager/voyager_smp.c
index 2bdc18fff..90c918f11 100644
--- a/arch/i386/mach-voyager/voyager_smp.c
+++ b/arch/i386/mach-voyager/voyager_smp.c
@@ -24,7 +24,6 @@
 #include <asm/desc.h>
 #include <asm/voyager.h>
 #include <asm/vic.h>
-#include <asm/pgalloc.h>
 #include <asm/mtrr.h>
 #include <asm/pgalloc.h>
 #include <asm/tlbflush.h>
@@ -154,7 +153,7 @@ static inline void
 send_CPI_allbutself(__u8 cpi)
 {
 	__u8 cpu = smp_processor_id();
-	__u32 mask = cpus_coerce(cpu_online_map) & ~(1 << cpu);
+	__u32 mask = cpus_addr(cpu_online_map)[0] & ~(1 << cpu);
 	send_CPI(mask, cpi);
 }
 
@@ -403,11 +402,11 @@ find_smp_config(void)
 	/* set up everything for just this CPU, we can alter
 	 * this as we start the other CPUs later */
 	/* now get the CPU disposition from the extended CMOS */
-	phys_cpu_present_map = cpus_promote(voyager_extended_cmos_read(VOYAGER_PROCESSOR_PRESENT_MASK));
-	cpus_coerce(phys_cpu_present_map) |= voyager_extended_cmos_read(VOYAGER_PROCESSOR_PRESENT_MASK + 1) << 8;
-	cpus_coerce(phys_cpu_present_map) |= voyager_extended_cmos_read(VOYAGER_PROCESSOR_PRESENT_MASK + 2) << 16;
-	cpus_coerce(phys_cpu_present_map) |= voyager_extended_cmos_read(VOYAGER_PROCESSOR_PRESENT_MASK + 3) << 24;
-	printk("VOYAGER SMP: phys_cpu_present_map = 0x%lx\n", cpus_coerce(phys_cpu_present_map));
+	cpus_addr(phys_cpu_present_map)[0] = voyager_extended_cmos_read(VOYAGER_PROCESSOR_PRESENT_MASK);
+	cpus_addr(phys_cpu_present_map)[0] |= voyager_extended_cmos_read(VOYAGER_PROCESSOR_PRESENT_MASK + 1) << 8;
+	cpus_addr(phys_cpu_present_map)[0] |= voyager_extended_cmos_read(VOYAGER_PROCESSOR_PRESENT_MASK + 2) << 16;
+	cpus_addr(phys_cpu_present_map)[0] |= voyager_extended_cmos_read(VOYAGER_PROCESSOR_PRESENT_MASK + 3) << 24;
+	printk("VOYAGER SMP: phys_cpu_present_map = 0x%lx\n", cpus_addr(phys_cpu_present_map)[0]);
 	/* Here we set up the VIC to enable SMP */
 	/* enable the CPIs by writing the base vector to their register */
 	outb(VIC_DEFAULT_CPI_BASE, VIC_CPI_BASE_REGISTER);
@@ -707,12 +706,12 @@ smp_boot_cpus(void)
 		/* now that the cat has probed the Voyager System Bus, sanity
 		 * check the cpu map */
 		if( ((voyager_quad_processors | voyager_extended_vic_processors)
-		     & cpus_coerce(phys_cpu_present_map)) != cpus_coerce(phys_cpu_present_map)) {
+		     & cpus_addr(phys_cpu_present_map)[0]) != cpus_addr(phys_cpu_present_map)[0]) {
 			/* should panic */
 			printk("\n\n***WARNING*** Sanity check of CPU present map FAILED\n");
 		}
 	} else if(voyager_level == 4)
-		voyager_extended_vic_processors = cpus_coerce(phys_cpu_present_map);
+		voyager_extended_vic_processors = cpus_addr(phys_cpu_present_map)[0];
 
 	/* this sets up the idle task to run on the current cpu */
 	voyager_extended_cpus = 1;
@@ -910,7 +909,7 @@ flush_tlb_others (unsigned long cpumask, struct mm_struct *mm,
 
 	if (!cpumask)
 		BUG();
-	if ((cpumask & cpus_coerce(cpu_online_map)) != cpumask)
+	if ((cpumask & cpus_addr(cpu_online_map)[0]) != cpumask)
 		BUG();
 	if (cpumask & (1 << smp_processor_id()))
 		BUG();
@@ -953,7 +952,7 @@ flush_tlb_current_task(void)
 
 	preempt_disable();
 
-	cpu_mask = cpus_coerce(mm->cpu_vm_mask) & ~(1 << smp_processor_id());
+	cpu_mask = cpus_addr(mm->cpu_vm_mask)[0] & ~(1 << smp_processor_id());
 	local_flush_tlb();
 	if (cpu_mask)
 		flush_tlb_others(cpu_mask, mm, FLUSH_ALL);
@@ -969,7 +968,7 @@ flush_tlb_mm (struct mm_struct * mm)
 
 	preempt_disable();
 
-	cpu_mask = cpus_coerce(mm->cpu_vm_mask) & ~(1 << smp_processor_id());
+	cpu_mask = cpus_addr(mm->cpu_vm_mask)[0] & ~(1 << smp_processor_id());
 
 	if (current->active_mm == mm) {
 		if (current->mm)
@@ -990,7 +989,7 @@ void flush_tlb_page(struct vm_area_struct * vma, unsigned long va)
 
 	preempt_disable();
 
-	cpu_mask = cpus_coerce(mm->cpu_vm_mask) & ~(1 << smp_processor_id());
+	cpu_mask = cpus_addr(mm->cpu_vm_mask)[0] & ~(1 << smp_processor_id());
 	if (current->active_mm == mm) {
 		if(current->mm)
 			__flush_tlb_one(va);
@@ -1099,7 +1098,7 @@ smp_call_function (void (*func) (void *info), void *info, int retry,
 		   int wait)
 {
 	struct call_data_struct data;
-	__u32 mask = cpus_coerce(cpu_online_map);
+	__u32 mask = cpus_addr(cpu_online_map)[0];
 
 	mask &= ~(1<<smp_processor_id());
 
@@ -1790,9 +1789,9 @@ set_vic_irq_affinity(unsigned int irq, cpumask_t mask)
 	unsigned long irq_mask = 1 << irq;
 	int cpu;
 
-	real_mask = cpus_coerce(mask) & voyager_extended_vic_processors;
+	real_mask = cpus_addr(mask)[0] & voyager_extended_vic_processors;
 	
-	if(cpus_coerce(mask) == 0)
+	if(cpus_addr(mask)[0] == 0)
 		/* can't have no cpu's to accept the interrupt -- extremely
 		 * bad things will happen */
 		return;
diff --git a/arch/i386/mach-voyager/voyager_thread.c b/arch/i386/mach-voyager/voyager_thread.c
index b091fcf01..9980eef31 100644
--- a/arch/i386/mach-voyager/voyager_thread.c
+++ b/arch/i386/mach-voyager/voyager_thread.c
@@ -28,7 +28,6 @@
 #include <asm/desc.h>
 #include <asm/voyager.h>
 #include <asm/vic.h>
-#include <asm/pgalloc.h>
 #include <asm/mtrr.h>
 #include <asm/msr.h>
 
diff --git a/arch/i386/math-emu/errors.c b/arch/i386/math-emu/errors.c
index 486154541..f755641cf 100644
--- a/arch/i386/math-emu/errors.c
+++ b/arch/i386/math-emu/errors.c
@@ -41,18 +41,18 @@ void Un_impl(void)
 
   RE_ENTRANT_CHECK_OFF;
   /* No need to verify_area(), we have previously fetched these bytes. */
-  printk("Unimplemented FPU Opcode at eip=%p : ", (void *) address);
+  printk("Unimplemented FPU Opcode at eip=%p : ", (void __user *) address);
   if ( FPU_CS == __USER_CS )
     {
       while ( 1 )
 	{
-	  FPU_get_user(byte1, (u_char *) address);
+	  FPU_get_user(byte1, (u_char __user *) address);
 	  if ( (byte1 & 0xf8) == 0xd8 ) break;
 	  printk("[%02x]", byte1);
 	  address++;
 	}
       printk("%02x ", byte1);
-      FPU_get_user(FPU_modrm, 1 + (u_char *) address);
+      FPU_get_user(FPU_modrm, 1 + (u_char __user *) address);
       
       if (FPU_modrm >= 0300)
 	printk("%02x (%02x+%d)\n", FPU_modrm, FPU_modrm & 0xf8, FPU_modrm & 7);
@@ -98,7 +98,7 @@ void FPU_printall(void)
 #define MAX_PRINTED_BYTES 20
       for ( i = 0; i < MAX_PRINTED_BYTES; i++ )
 	{
-	  FPU_get_user(byte1, (u_char *) address);
+	  FPU_get_user(byte1, (u_char __user *) address);
 	  if ( (byte1 & 0xf8) == 0xd8 )
 	    {
 	      printk(" %02x", byte1);
@@ -111,7 +111,7 @@ void FPU_printall(void)
 	printk(" [more..]\n");
       else
 	{
-	  FPU_get_user(FPU_modrm, 1 + (u_char *) address);
+	  FPU_get_user(FPU_modrm, 1 + (u_char __user *) address);
 	  
 	  if (FPU_modrm >= 0300)
 	    printk(" %02x (%02x+%d)\n", FPU_modrm, FPU_modrm & 0xf8, FPU_modrm & 7);
diff --git a/arch/i386/math-emu/fpu_arith.c b/arch/i386/math-emu/fpu_arith.c
index fcad7ec08..6972dec01 100644
--- a/arch/i386/math-emu/fpu_arith.c
+++ b/arch/i386/math-emu/fpu_arith.c
@@ -16,7 +16,7 @@
 #include "status_w.h"
 
 
-void fadd__()
+void fadd__(void)
 {
   /* fadd st,st(i) */
   int i = FPU_rm;
@@ -25,7 +25,7 @@ void fadd__()
 }
 
 
-void fmul__()
+void fmul__(void)
 {
   /* fmul st,st(i) */
   int i = FPU_rm;
@@ -35,7 +35,7 @@ void fmul__()
 
 
 
-void fsub__()
+void fsub__(void)
 {
   /* fsub st,st(i) */
   clear_C1();
@@ -43,7 +43,7 @@ void fsub__()
 }
 
 
-void fsubr_()
+void fsubr_(void)
 {
   /* fsubr st,st(i) */
   clear_C1();
@@ -51,7 +51,7 @@ void fsubr_()
 }
 
 
-void fdiv__()
+void fdiv__(void)
 {
   /* fdiv st,st(i) */
   clear_C1();
@@ -59,7 +59,7 @@ void fdiv__()
 }
 
 
-void fdivr_()
+void fdivr_(void)
 {
   /* fdivr st,st(i) */
   clear_C1();
@@ -68,7 +68,7 @@ void fdivr_()
 
 
 
-void fadd_i()
+void fadd_i(void)
 {
   /* fadd st(i),st */
   int i = FPU_rm;
@@ -77,7 +77,7 @@ void fadd_i()
 }
 
 
-void fmul_i()
+void fmul_i(void)
 {
   /* fmul st(i),st */
   clear_C1();
@@ -85,7 +85,7 @@ void fmul_i()
 }
 
 
-void fsubri()
+void fsubri(void)
 {
   /* fsubr st(i),st */
   clear_C1();
@@ -93,7 +93,7 @@ void fsubri()
 }
 
 
-void fsub_i()
+void fsub_i(void)
 {
   /* fsub st(i),st */
   clear_C1();
@@ -101,7 +101,7 @@ void fsub_i()
 }
 
 
-void fdivri()
+void fdivri(void)
 {
   /* fdivr st(i),st */
   clear_C1();
@@ -109,7 +109,7 @@ void fdivri()
 }
 
 
-void fdiv_i()
+void fdiv_i(void)
 {
   /* fdiv st(i),st */
   clear_C1();
@@ -118,7 +118,7 @@ void fdiv_i()
 
 
 
-void faddp_()
+void faddp_(void)
 {
   /* faddp st(i),st */
   int i = FPU_rm;
@@ -128,7 +128,7 @@ void faddp_()
 }
 
 
-void fmulp_()
+void fmulp_(void)
 {
   /* fmulp st(i),st */
   clear_C1();
@@ -138,7 +138,7 @@ void fmulp_()
 
 
 
-void fsubrp()
+void fsubrp(void)
 {
   /* fsubrp st(i),st */
   clear_C1();
@@ -147,7 +147,7 @@ void fsubrp()
 }
 
 
-void fsubp_()
+void fsubp_(void)
 {
   /* fsubp st(i),st */
   clear_C1();
@@ -156,7 +156,7 @@ void fsubp_()
 }
 
 
-void fdivrp()
+void fdivrp(void)
 {
   /* fdivrp st(i),st */
   clear_C1();
@@ -165,7 +165,7 @@ void fdivrp()
 }
 
 
-void fdivp_()
+void fdivp_(void)
 {
   /* fdivp st(i),st */
   clear_C1();
diff --git a/arch/i386/math-emu/fpu_aux.c b/arch/i386/math-emu/fpu_aux.c
index 112c173f2..0251b2c6b 100644
--- a/arch/i386/math-emu/fpu_aux.c
+++ b/arch/i386/math-emu/fpu_aux.c
@@ -30,7 +30,7 @@ void fclex(void)
 }
 
 /* Needs to be externally visible */
-void finit()
+void finit(void)
 {
   control_word = 0x037f;
   partial_status = 0;
@@ -58,7 +58,7 @@ static FUNC const finit_table[] = {
   fsetpm, FPU_illegal, FPU_illegal, FPU_illegal
 };
 
-void finit_()
+void finit_(void)
 {
   (finit_table[FPU_rm])();
 }
@@ -75,7 +75,7 @@ static FUNC const fstsw_table[] = {
   FPU_illegal, FPU_illegal, FPU_illegal, FPU_illegal
 };
 
-void fstsw_()
+void fstsw_(void)
 {
   (fstsw_table[FPU_rm])();
 }
@@ -86,13 +86,13 @@ static FUNC const fp_nop_table[] = {
   FPU_illegal, FPU_illegal, FPU_illegal, FPU_illegal
 };
 
-void fp_nop()
+void fp_nop(void)
 {
   (fp_nop_table[FPU_rm])();
 }
 
 
-void fld_i_()
+void fld_i_(void)
 {
   FPU_REG *st_new_ptr;
   int i;
@@ -124,7 +124,7 @@ void fld_i_()
 }
 
 
-void fxch_i()
+void fxch_i(void)
 {
   /* fxch st(i) */
   FPU_REG t;
@@ -173,14 +173,14 @@ void fxch_i()
 }
 
 
-void ffree_()
+void ffree_(void)
 {
   /* ffree st(i) */
   FPU_settagi(FPU_rm, TAG_Empty);
 }
 
 
-void ffreep()
+void ffreep(void)
 {
   /* ffree st(i) + pop - unofficial code */
   FPU_settagi(FPU_rm, TAG_Empty);
@@ -188,14 +188,14 @@ void ffreep()
 }
 
 
-void fst_i_()
+void fst_i_(void)
 {
   /* fst st(i) */
   FPU_copy_to_regi(&st(0), FPU_gettag0(), FPU_rm);
 }
 
 
-void fstp_i()
+void fstp_i(void)
 {
   /* fstp st(i) */
   FPU_copy_to_regi(&st(0), FPU_gettag0(), FPU_rm);
diff --git a/arch/i386/math-emu/fpu_entry.c b/arch/i386/math-emu/fpu_entry.c
index baebe5c08..633f954c3 100644
--- a/arch/i386/math-emu/fpu_entry.c
+++ b/arch/i386/math-emu/fpu_entry.c
@@ -128,7 +128,7 @@ static u_char const type_table[64] = {
 u_char emulating=0;
 #endif /* RE_ENTRANT_CHECKING */
 
-static int valid_prefix(u_char *Byte, u_char **fpu_eip,
+static int valid_prefix(u_char *Byte, u_char __user **fpu_eip,
 			overrides *override);
 
 asmlinkage void math_emulate(long arg)
@@ -140,7 +140,7 @@ asmlinkage void math_emulate(long arg)
   FPU_REG loaded_data;
   FPU_REG *st0_ptr;
   u_char	  loaded_tag, st0_tag;
-  void *data_address;
+  void __user *data_address;
   struct address data_sel_off;
   struct address entry_sel_off;
   unsigned long code_base = 0;
@@ -192,7 +192,8 @@ asmlinkage void math_emulate(long arg)
 	  math_abort(FPU_info, SIGILL);
 	}
 
-      if ( SEG_D_SIZE(code_descriptor = LDT_DESCRIPTOR(FPU_CS)) )
+      code_descriptor = LDT_DESCRIPTOR(FPU_CS);
+      if ( SEG_D_SIZE(code_descriptor) )
 	{
 	  /* The above test may be wrong, the book is not clear */
 	  /* Segmented 32 bit protected mode */
@@ -214,7 +215,7 @@ asmlinkage void math_emulate(long arg)
   if (current->ptrace & PT_PTRACED)
     FPU_lookahead = 0;
 
-  if ( !valid_prefix(&byte1, (u_char **)&FPU_EIP,
+  if ( !valid_prefix(&byte1, (u_char __user **)&FPU_EIP,
 		     &addr_modes.override) )
     {
       RE_ENTRANT_CHECK_OFF;
@@ -257,7 +258,7 @@ do_another_FPU_instruction:
 
   RE_ENTRANT_CHECK_OFF;
   FPU_code_verify_area(1);
-  FPU_get_user(FPU_modrm, (u_char *) FPU_EIP);
+  FPU_get_user(FPU_modrm, (u_char __user *) FPU_EIP);
   RE_ENTRANT_CHECK_ON;
   FPU_EIP++;
 
@@ -336,23 +337,23 @@ do_another_FPU_instruction:
 	      switch ( (byte1 >> 1) & 3 )
 		{
 		case 0:
-		  unmasked = FPU_load_single((float *)data_address,
+		  unmasked = FPU_load_single((float __user *)data_address,
 					     &loaded_data);
 		  loaded_tag = unmasked & 0xff;
 		  unmasked &= ~0xff;
 		  break;
 		case 1:
-		  loaded_tag = FPU_load_int32((long *)data_address, &loaded_data);
+		  loaded_tag = FPU_load_int32((long __user *)data_address, &loaded_data);
 		  break;
 		case 2:
-		  unmasked = FPU_load_double((double *)data_address,
+		  unmasked = FPU_load_double((double __user *)data_address,
 					     &loaded_data);
 		  loaded_tag = unmasked & 0xff;
 		  unmasked &= ~0xff;
 		  break;
 		case 3:
 		default:  /* Used here to suppress gcc warnings. */
-		  loaded_tag = FPU_load_int16((short *)data_address, &loaded_data);
+		  loaded_tag = FPU_load_int16((short __user *)data_address, &loaded_data);
 		  break;
 		}
 
@@ -563,7 +564,7 @@ FPU_fwait_done:
   if (FPU_lookahead && !need_resched())
     {
       FPU_ORIG_EIP = FPU_EIP - code_base;
-      if ( valid_prefix(&byte1, (u_char **)&FPU_EIP,
+      if ( valid_prefix(&byte1, (u_char __user **)&FPU_EIP,
 			&addr_modes.override) )
 	goto do_another_FPU_instruction;
     }
@@ -579,11 +580,11 @@ FPU_fwait_done:
    all prefix bytes, further changes are needed in the emulator code
    which accesses user address space. Access to separate segments is
    important for msdos emulation. */
-static int valid_prefix(u_char *Byte, u_char **fpu_eip,
+static int valid_prefix(u_char *Byte, u_char __user **fpu_eip,
 			overrides *override)
 {
   u_char byte;
-  u_char *ip = *fpu_eip;
+  u_char __user *ip = *fpu_eip;
 
   *override = (overrides) { 0, 0, PREFIX_DEFAULT };       /* defaults */
 
@@ -679,9 +680,9 @@ void math_abort(struct info * info, unsigned int signal)
 #define sstatus_word() \
   ((S387->swd & ~SW_Top & 0xffff) | ((S387->ftop << SW_Top_Shift) & SW_Top))
 
-int restore_i387_soft(void *s387, struct _fpstate *buf)
+int restore_i387_soft(void *s387, struct _fpstate __user *buf)
 {
-  u_char *d = (u_char *)buf;
+  u_char __user *d = (u_char __user *)buf;
   int offset, other, i, tags, regnr, tag, newtop;
 
   RE_ENTRANT_CHECK_OFF;
@@ -725,9 +726,9 @@ int restore_i387_soft(void *s387, struct _fpstate *buf)
 }
 
 
-int save_i387_soft(void *s387, struct _fpstate * buf)
+int save_i387_soft(void *s387, struct _fpstate __user * buf)
 {
-  u_char *d = (u_char *)buf;
+  u_char __user *d = (u_char __user *)buf;
   int offset = (S387->ftop & 7) * 10, other = 80 - offset;
 
   RE_ENTRANT_CHECK_OFF;
diff --git a/arch/i386/math-emu/fpu_etc.c b/arch/i386/math-emu/fpu_etc.c
index ba562d129..e3b5d4655 100644
--- a/arch/i386/math-emu/fpu_etc.c
+++ b/arch/i386/math-emu/fpu_etc.c
@@ -137,7 +137,7 @@ static FUNC_ST0 const fp_etc_table[] = {
   ftst_, fxam, (FUNC_ST0)FPU_illegal, (FUNC_ST0)FPU_illegal
 };
 
-void FPU_etc()
+void FPU_etc(void)
 {
   (fp_etc_table[FPU_rm])(&st(0), FPU_gettag0());
 }
diff --git a/arch/i386/math-emu/fpu_proto.h b/arch/i386/math-emu/fpu_proto.h
index fb6116382..a8618dfd6 100644
--- a/arch/i386/math-emu/fpu_proto.h
+++ b/arch/i386/math-emu/fpu_proto.h
@@ -77,13 +77,13 @@ extern void FPU_copy_to_reg0(FPU_REG const *r, u_char tag);
 extern void FPU_triga(void);
 extern void FPU_trigb(void);
 /* get_address.c */
-extern void *FPU_get_address(u_char FPU_modrm, unsigned long *fpu_eip,
+extern void __user *FPU_get_address(u_char FPU_modrm, unsigned long *fpu_eip,
 			 struct address *addr, fpu_addr_modes addr_modes);
-extern void *FPU_get_address_16(u_char FPU_modrm, unsigned long *fpu_eip,
+extern void __user *FPU_get_address_16(u_char FPU_modrm, unsigned long *fpu_eip,
 			    struct address *addr, fpu_addr_modes addr_modes);
 /* load_store.c */
 extern int FPU_load_store(u_char type, fpu_addr_modes addr_modes,
-			    void *data_address);
+			    void __user *data_address);
 /* poly_2xm1.c */
 extern int poly_2xm1(u_char sign, FPU_REG *arg, FPU_REG *result);
 /* poly_atan.c */
@@ -112,26 +112,26 @@ extern void fucompp(void);
 /* reg_constant.c */
 extern void fconst(void);
 /* reg_ld_str.c */
-extern int FPU_load_extended(long double *s, int stnr);
-extern int FPU_load_double(double *dfloat, FPU_REG *loaded_data);
-extern int FPU_load_single(float *single, FPU_REG *loaded_data);
-extern int FPU_load_int64(long long *_s);
-extern int FPU_load_int32(long *_s, FPU_REG *loaded_data);
-extern int FPU_load_int16(short *_s, FPU_REG *loaded_data);
-extern int FPU_load_bcd(u_char *s);
+extern int FPU_load_extended(long double __user *s, int stnr);
+extern int FPU_load_double(double __user *dfloat, FPU_REG *loaded_data);
+extern int FPU_load_single(float __user *single, FPU_REG *loaded_data);
+extern int FPU_load_int64(long long __user *_s);
+extern int FPU_load_int32(long __user *_s, FPU_REG *loaded_data);
+extern int FPU_load_int16(short __user *_s, FPU_REG *loaded_data);
+extern int FPU_load_bcd(u_char __user *s);
 extern int FPU_store_extended(FPU_REG *st0_ptr, u_char st0_tag,
-			      long double *d);
-extern int FPU_store_double(FPU_REG *st0_ptr, u_char st0_tag, double *dfloat);
-extern int FPU_store_single(FPU_REG *st0_ptr, u_char st0_tag, float *single);
-extern int FPU_store_int64(FPU_REG *st0_ptr, u_char st0_tag, long long *d);
-extern int FPU_store_int32(FPU_REG *st0_ptr, u_char st0_tag, long *d);
-extern int FPU_store_int16(FPU_REG *st0_ptr, u_char st0_tag, short *d);
-extern int FPU_store_bcd(FPU_REG *st0_ptr, u_char st0_tag, u_char *d);
+			      long double __user *d);
+extern int FPU_store_double(FPU_REG *st0_ptr, u_char st0_tag, double __user *dfloat);
+extern int FPU_store_single(FPU_REG *st0_ptr, u_char st0_tag, float __user *single);
+extern int FPU_store_int64(FPU_REG *st0_ptr, u_char st0_tag, long long __user *d);
+extern int FPU_store_int32(FPU_REG *st0_ptr, u_char st0_tag, long __user *d);
+extern int FPU_store_int16(FPU_REG *st0_ptr, u_char st0_tag, short __user *d);
+extern int FPU_store_bcd(FPU_REG *st0_ptr, u_char st0_tag, u_char __user *d);
 extern int FPU_round_to_int(FPU_REG *r, u_char tag);
-extern u_char *fldenv(fpu_addr_modes addr_modes, u_char *s);
-extern void frstor(fpu_addr_modes addr_modes, u_char *data_address);
-extern u_char *fstenv(fpu_addr_modes addr_modes, u_char *d);
-extern void fsave(fpu_addr_modes addr_modes, u_char *data_address);
+extern u_char __user *fldenv(fpu_addr_modes addr_modes, u_char __user *s);
+extern void frstor(fpu_addr_modes addr_modes, u_char __user *data_address);
+extern u_char __user *fstenv(fpu_addr_modes addr_modes, u_char __user *d);
+extern void fsave(fpu_addr_modes addr_modes, u_char __user *data_address);
 extern int FPU_tagof(FPU_REG *ptr);
 /* reg_mul.c */
 extern int FPU_mul(FPU_REG const *b, u_char tagb, int deststnr, int control_w);
diff --git a/arch/i386/math-emu/fpu_system.h b/arch/i386/math-emu/fpu_system.h
index fd5fc6d78..2ddfe120b 100644
--- a/arch/i386/math-emu/fpu_system.h
+++ b/arch/i386/math-emu/fpu_system.h
@@ -80,7 +80,7 @@
 /* A simpler test than verify_area() can probably be done for
    FPU_code_verify_area() because the only possible error is to step
    past the upper boundary of a legal code area. */
-#define	FPU_code_verify_area(z) FPU_verify_area(VERIFY_READ,(void *)FPU_EIP,z)
+#define	FPU_code_verify_area(z) FPU_verify_area(VERIFY_READ,(void __user *)FPU_EIP,z)
 #endif
 
 #define FPU_get_user(x,y)       get_user((x),(y))
diff --git a/arch/i386/math-emu/get_address.c b/arch/i386/math-emu/get_address.c
index dd568ade9..59eee7218 100644
--- a/arch/i386/math-emu/get_address.c
+++ b/arch/i386/math-emu/get_address.c
@@ -82,7 +82,7 @@ static int sib(int mod, unsigned long *fpu_eip)
 
   RE_ENTRANT_CHECK_OFF;
   FPU_code_verify_area(1);
-  FPU_get_user(base, (u_char *) (*fpu_eip));   /* The SIB byte */
+  FPU_get_user(base, (u_char __user *) (*fpu_eip));   /* The SIB byte */
   RE_ENTRANT_CHECK_ON;
   (*fpu_eip)++;
   ss = base >> 6;
@@ -112,7 +112,7 @@ static int sib(int mod, unsigned long *fpu_eip)
       long displacement;
       RE_ENTRANT_CHECK_OFF;
       FPU_code_verify_area(1);
-      FPU_get_user(displacement, (signed char *) (*fpu_eip));
+      FPU_get_user(displacement, (signed char __user *) (*fpu_eip));
       offset += displacement;
       RE_ENTRANT_CHECK_ON;
       (*fpu_eip)++;
@@ -123,7 +123,7 @@ static int sib(int mod, unsigned long *fpu_eip)
       long displacement;
       RE_ENTRANT_CHECK_OFF;
       FPU_code_verify_area(4);
-      FPU_get_user(displacement, (long *) (*fpu_eip));
+      FPU_get_user(displacement, (long __user *) (*fpu_eip));
       offset += displacement;
       RE_ENTRANT_CHECK_ON;
       (*fpu_eip) += 4;
@@ -241,7 +241,7 @@ static long pm_address(u_char FPU_modrm, u_char segment,
 
 */
 
-void *FPU_get_address(u_char FPU_modrm, unsigned long *fpu_eip,
+void __user *FPU_get_address(u_char FPU_modrm, unsigned long *fpu_eip,
 		  struct address *addr,
 		  fpu_addr_modes addr_modes)
 {
@@ -277,24 +277,24 @@ void *FPU_get_address(u_char FPU_modrm, unsigned long *fpu_eip,
 	      /* Special case: disp32 */
 	      RE_ENTRANT_CHECK_OFF;
 	      FPU_code_verify_area(4);
-	      FPU_get_user(address, (unsigned long *) (*fpu_eip));
+	      FPU_get_user(address, (unsigned long __user *) (*fpu_eip));
 	      (*fpu_eip) += 4;
 	      RE_ENTRANT_CHECK_ON;
 	      addr->offset = address;
-	      return (void *) address;
+	      return (void __user *) address;
 	    }
 	  else
 	    {
 	      address = *cpu_reg_ptr;  /* Just return the contents
 					  of the cpu register */
 	      addr->offset = address;
-	      return (void *) address;
+	      return (void __user *) address;
 	    }
 	case 1:
 	  /* 8 bit signed displacement */
 	  RE_ENTRANT_CHECK_OFF;
 	  FPU_code_verify_area(1);
-	  FPU_get_user(address, (signed char *) (*fpu_eip));
+	  FPU_get_user(address, (signed char __user *) (*fpu_eip));
 	  RE_ENTRANT_CHECK_ON;
 	  (*fpu_eip)++;
 	  break;
@@ -302,7 +302,7 @@ void *FPU_get_address(u_char FPU_modrm, unsigned long *fpu_eip,
 	  /* 32 bit displacement */
 	  RE_ENTRANT_CHECK_OFF;
 	  FPU_code_verify_area(4);
-	  FPU_get_user(address, (long *) (*fpu_eip));
+	  FPU_get_user(address, (long __user *) (*fpu_eip));
 	  (*fpu_eip) += 4;
 	  RE_ENTRANT_CHECK_ON;
 	  break;
@@ -331,11 +331,11 @@ void *FPU_get_address(u_char FPU_modrm, unsigned long *fpu_eip,
       EXCEPTION(EX_INTERNAL|0x133);
     }
 
-  return (void *)address;
+  return (void __user *)address;
 }
 
 
-void *FPU_get_address_16(u_char FPU_modrm, unsigned long *fpu_eip,
+void __user *FPU_get_address_16(u_char FPU_modrm, unsigned long *fpu_eip,
 		     struct address *addr,
 		     fpu_addr_modes addr_modes)
 {
@@ -363,7 +363,7 @@ void *FPU_get_address_16(u_char FPU_modrm, unsigned long *fpu_eip,
 	  /* Special case: disp16 */
 	  RE_ENTRANT_CHECK_OFF;
 	  FPU_code_verify_area(2);
-	  FPU_get_user(address, (unsigned short *) (*fpu_eip));
+	  FPU_get_user(address, (unsigned short __user *) (*fpu_eip));
 	  (*fpu_eip) += 2;
 	  RE_ENTRANT_CHECK_ON;
 	  goto add_segment;
@@ -373,7 +373,7 @@ void *FPU_get_address_16(u_char FPU_modrm, unsigned long *fpu_eip,
       /* 8 bit signed displacement */
       RE_ENTRANT_CHECK_OFF;
       FPU_code_verify_area(1);
-      FPU_get_user(address, (signed char *) (*fpu_eip));
+      FPU_get_user(address, (signed char __user *) (*fpu_eip));
       RE_ENTRANT_CHECK_ON;
       (*fpu_eip)++;
       break;
@@ -381,7 +381,7 @@ void *FPU_get_address_16(u_char FPU_modrm, unsigned long *fpu_eip,
       /* 16 bit displacement */
       RE_ENTRANT_CHECK_OFF;
       FPU_code_verify_area(2);
-      FPU_get_user(address, (unsigned short *) (*fpu_eip));
+      FPU_get_user(address, (unsigned short __user *) (*fpu_eip));
       (*fpu_eip) += 2;
       RE_ENTRANT_CHECK_ON;
       break;
@@ -445,5 +445,5 @@ void *FPU_get_address_16(u_char FPU_modrm, unsigned long *fpu_eip,
       EXCEPTION(EX_INTERNAL|0x131);
     }
 
-  return (void *)address ;
+  return (void __user *)address ;
 }
diff --git a/arch/i386/math-emu/load_store.c b/arch/i386/math-emu/load_store.c
index 27d2f4032..ff3a61766 100644
--- a/arch/i386/math-emu/load_store.c
+++ b/arch/i386/math-emu/load_store.c
@@ -61,7 +61,7 @@ u_char const data_sizes_32[32] = {
 };
 
 int FPU_load_store(u_char type, fpu_addr_modes addr_modes,
-		     void *data_address)
+		     void __user *data_address)
 {
   FPU_REG loaded_data;
   FPU_REG *st0_ptr;
@@ -119,7 +119,7 @@ int FPU_load_store(u_char type, fpu_addr_modes addr_modes,
     {
     case 000:       /* fld m32real */
       clear_C1();
-      loaded_tag = FPU_load_single((float *)data_address, &loaded_data);
+      loaded_tag = FPU_load_single((float __user *)data_address, &loaded_data);
       if ( (loaded_tag == TAG_Special)
 	   && isNaN(&loaded_data)
 	   && (real_1op_NaN(&loaded_data) < 0) )
@@ -131,12 +131,12 @@ int FPU_load_store(u_char type, fpu_addr_modes addr_modes,
       break;
     case 001:      /* fild m32int */
       clear_C1();
-      loaded_tag = FPU_load_int32((long *)data_address, &loaded_data);
+      loaded_tag = FPU_load_int32((long __user *)data_address, &loaded_data);
       FPU_copy_to_reg0(&loaded_data, loaded_tag);
       break;
     case 002:      /* fld m64real */
       clear_C1();
-      loaded_tag = FPU_load_double((double *)data_address, &loaded_data);
+      loaded_tag = FPU_load_double((double __user *)data_address, &loaded_data);
       if ( (loaded_tag == TAG_Special)
 	   && isNaN(&loaded_data)
 	   && (real_1op_NaN(&loaded_data) < 0) )
@@ -148,68 +148,68 @@ int FPU_load_store(u_char type, fpu_addr_modes addr_modes,
       break;
     case 003:      /* fild m16int */
       clear_C1();
-      loaded_tag = FPU_load_int16((short *)data_address, &loaded_data);
+      loaded_tag = FPU_load_int16((short __user *)data_address, &loaded_data);
       FPU_copy_to_reg0(&loaded_data, loaded_tag);
       break;
     case 010:      /* fst m32real */
       clear_C1();
-      FPU_store_single(st0_ptr, st0_tag, (float *)data_address);
+      FPU_store_single(st0_ptr, st0_tag, (float __user *)data_address);
       break;
     case 011:      /* fist m32int */
       clear_C1();
-      FPU_store_int32(st0_ptr, st0_tag, (long *)data_address);
+      FPU_store_int32(st0_ptr, st0_tag, (long __user *)data_address);
       break;
     case 012:     /* fst m64real */
       clear_C1();
-      FPU_store_double(st0_ptr, st0_tag, (double *)data_address);
+      FPU_store_double(st0_ptr, st0_tag, (double __user *)data_address);
       break;
     case 013:     /* fist m16int */
       clear_C1();
-      FPU_store_int16(st0_ptr, st0_tag, (short *)data_address);
+      FPU_store_int16(st0_ptr, st0_tag, (short __user *)data_address);
       break;
     case 014:     /* fstp m32real */
       clear_C1();
-      if ( FPU_store_single(st0_ptr, st0_tag, (float *)data_address) )
+      if ( FPU_store_single(st0_ptr, st0_tag, (float __user *)data_address) )
 	pop_0();  /* pop only if the number was actually stored
 		     (see the 80486 manual p16-28) */
       break;
     case 015:     /* fistp m32int */
       clear_C1();
-      if ( FPU_store_int32(st0_ptr, st0_tag, (long *)data_address) )
+      if ( FPU_store_int32(st0_ptr, st0_tag, (long __user *)data_address) )
 	pop_0();  /* pop only if the number was actually stored
 		     (see the 80486 manual p16-28) */
       break;
     case 016:     /* fstp m64real */
       clear_C1();
-      if ( FPU_store_double(st0_ptr, st0_tag, (double *)data_address) )
+      if ( FPU_store_double(st0_ptr, st0_tag, (double __user *)data_address) )
 	pop_0();  /* pop only if the number was actually stored
 		     (see the 80486 manual p16-28) */
       break;
     case 017:     /* fistp m16int */
       clear_C1();
-      if ( FPU_store_int16(st0_ptr, st0_tag, (short *)data_address) )
+      if ( FPU_store_int16(st0_ptr, st0_tag, (short __user *)data_address) )
 	pop_0();  /* pop only if the number was actually stored
 		     (see the 80486 manual p16-28) */
       break;
     case 020:     /* fldenv  m14/28byte */
-      fldenv(addr_modes, (u_char *)data_address);
+      fldenv(addr_modes, (u_char __user *)data_address);
       /* Ensure that the values just loaded are not changed by
 	 fix-up operations. */
       return 1;
     case 022:     /* frstor m94/108byte */
-      frstor(addr_modes, (u_char *)data_address);
+      frstor(addr_modes, (u_char __user *)data_address);
       /* Ensure that the values just loaded are not changed by
 	 fix-up operations. */
       return 1;
     case 023:     /* fbld m80dec */
       clear_C1();
-      loaded_tag = FPU_load_bcd((u_char *)data_address);
+      loaded_tag = FPU_load_bcd((u_char __user *)data_address);
       FPU_settag0(loaded_tag);
       break;
     case 024:     /* fldcw */
       RE_ENTRANT_CHECK_OFF;
       FPU_verify_area(VERIFY_READ, data_address, 2);
-      FPU_get_user(control_word, (unsigned short *) data_address);
+      FPU_get_user(control_word, (unsigned short __user *) data_address);
       RE_ENTRANT_CHECK_ON;
       if ( partial_status & ~control_word & CW_Exceptions )
 	partial_status |= (SW_Summary | SW_Backward);
@@ -221,47 +221,47 @@ int FPU_load_store(u_char type, fpu_addr_modes addr_modes,
       return 1;
     case 025:      /* fld m80real */
       clear_C1();
-      loaded_tag = FPU_load_extended((long double *)data_address, 0);
+      loaded_tag = FPU_load_extended((long double __user *)data_address, 0);
       FPU_settag0(loaded_tag);
       break;
     case 027:      /* fild m64int */
       clear_C1();
-      loaded_tag = FPU_load_int64((long long *)data_address);
+      loaded_tag = FPU_load_int64((long long __user *)data_address);
       FPU_settag0(loaded_tag);
       break;
     case 030:     /* fstenv  m14/28byte */
-      fstenv(addr_modes, (u_char *)data_address);
+      fstenv(addr_modes, (u_char __user *)data_address);
       return 1;
     case 032:      /* fsave */
-      fsave(addr_modes, (u_char *)data_address);
+      fsave(addr_modes, (u_char __user *)data_address);
       return 1;
     case 033:      /* fbstp m80dec */
       clear_C1();
-      if ( FPU_store_bcd(st0_ptr, st0_tag, (u_char *)data_address) )
+      if ( FPU_store_bcd(st0_ptr, st0_tag, (u_char __user *)data_address) )
 	pop_0();  /* pop only if the number was actually stored
 		     (see the 80486 manual p16-28) */
       break;
     case 034:      /* fstcw m16int */
       RE_ENTRANT_CHECK_OFF;
       FPU_verify_area(VERIFY_WRITE,data_address,2);
-      FPU_put_user(control_word, (unsigned short *) data_address);
+      FPU_put_user(control_word, (unsigned short __user *) data_address);
       RE_ENTRANT_CHECK_ON;
       return 1;
     case 035:      /* fstp m80real */
       clear_C1();
-      if ( FPU_store_extended(st0_ptr, st0_tag, (long double *)data_address) )
+      if ( FPU_store_extended(st0_ptr, st0_tag, (long double __user *)data_address) )
 	pop_0();  /* pop only if the number was actually stored
 		     (see the 80486 manual p16-28) */
       break;
     case 036:      /* fstsw m2byte */
       RE_ENTRANT_CHECK_OFF;
       FPU_verify_area(VERIFY_WRITE,data_address,2);
-      FPU_put_user(status_word(),(unsigned short *) data_address);
+      FPU_put_user(status_word(),(unsigned short __user *) data_address);
       RE_ENTRANT_CHECK_ON;
       return 1;
     case 037:      /* fistp m64int */
       clear_C1();
-      if ( FPU_store_int64(st0_ptr, st0_tag, (long long *)data_address) )
+      if ( FPU_store_int64(st0_ptr, st0_tag, (long long __user *)data_address) )
 	pop_0();  /* pop only if the number was actually stored
 		     (see the 80486 manual p16-28) */
       break;
diff --git a/arch/i386/math-emu/reg_compare.c b/arch/i386/math-emu/reg_compare.c
index afd222cb6..f37c5b5a3 100644
--- a/arch/i386/math-emu/reg_compare.c
+++ b/arch/i386/math-emu/reg_compare.c
@@ -324,14 +324,14 @@ static int compare_u_st_st(int nr)
 
 /*---------------------------------------------------------------------------*/
 
-void fcom_st()
+void fcom_st(void)
 {
   /* fcom st(i) */
   compare_st_st(FPU_rm);
 }
 
 
-void fcompst()
+void fcompst(void)
 {
   /* fcomp st(i) */
   if ( !compare_st_st(FPU_rm) )
@@ -339,7 +339,7 @@ void fcompst()
 }
 
 
-void fcompp()
+void fcompp(void)
 {
   /* fcompp */
   if (FPU_rm != 1)
@@ -352,7 +352,7 @@ void fcompp()
 }
 
 
-void fucom_()
+void fucom_(void)
 {
   /* fucom st(i) */
   compare_u_st_st(FPU_rm);
@@ -360,7 +360,7 @@ void fucom_()
 }
 
 
-void fucomp()
+void fucomp(void)
 {
   /* fucomp st(i) */
   if ( !compare_u_st_st(FPU_rm) )
@@ -368,7 +368,7 @@ void fucomp()
 }
 
 
-void fucompp()
+void fucompp(void)
 {
   /* fucompp */
   if (FPU_rm == 1)
diff --git a/arch/i386/math-emu/reg_ld_str.c b/arch/i386/math-emu/reg_ld_str.c
index cdd3746e6..699fe331c 100644
--- a/arch/i386/math-emu/reg_ld_str.c
+++ b/arch/i386/math-emu/reg_ld_str.c
@@ -86,7 +86,7 @@ int FPU_tagof(FPU_REG *ptr)
 
 
 /* Get a long double from user memory */
-int FPU_load_extended(long double *s, int stnr)
+int FPU_load_extended(long double __user *s, int stnr)
 {
   FPU_REG *sti_ptr = &st(stnr);
 
@@ -100,15 +100,15 @@ int FPU_load_extended(long double *s, int stnr)
 
 
 /* Get a double from user memory */
-int FPU_load_double(double *dfloat, FPU_REG *loaded_data)
+int FPU_load_double(double __user *dfloat, FPU_REG *loaded_data)
 {
   int exp, tag, negative;
   unsigned m64, l64;
 
   RE_ENTRANT_CHECK_OFF;
   FPU_verify_area(VERIFY_READ, dfloat, 8);
-  FPU_get_user(m64, 1 + (unsigned long *) dfloat);
-  FPU_get_user(l64, (unsigned long *) dfloat);
+  FPU_get_user(m64, 1 + (unsigned long __user *) dfloat);
+  FPU_get_user(l64, (unsigned long __user *) dfloat);
   RE_ENTRANT_CHECK_ON;
 
   negative = (m64 & 0x80000000) ? SIGN_Negative : SIGN_Positive;
@@ -172,14 +172,14 @@ int FPU_load_double(double *dfloat, FPU_REG *loaded_data)
 
 
 /* Get a float from user memory */
-int FPU_load_single(float *single, FPU_REG *loaded_data)
+int FPU_load_single(float __user *single, FPU_REG *loaded_data)
 {
   unsigned m32;
   int exp, tag, negative;
 
   RE_ENTRANT_CHECK_OFF;
   FPU_verify_area(VERIFY_READ, single, 4);
-  FPU_get_user(m32, (unsigned long *) single);
+  FPU_get_user(m32, (unsigned long __user *) single);
   RE_ENTRANT_CHECK_ON;
 
   negative = (m32 & 0x80000000) ? SIGN_Negative : SIGN_Positive;
@@ -236,7 +236,7 @@ int FPU_load_single(float *single, FPU_REG *loaded_data)
 
 
 /* Get a long long from user memory */
-int FPU_load_int64(long long *_s)
+int FPU_load_int64(long long __user *_s)
 {
   long long s;
   int sign;
@@ -268,7 +268,7 @@ int FPU_load_int64(long long *_s)
 
 
 /* Get a long from user memory */
-int FPU_load_int32(long *_s, FPU_REG *loaded_data)
+int FPU_load_int32(long __user *_s, FPU_REG *loaded_data)
 {
   long s;
   int negative;
@@ -297,7 +297,7 @@ int FPU_load_int32(long *_s, FPU_REG *loaded_data)
 
 
 /* Get a short from user memory */
-int FPU_load_int16(short *_s, FPU_REG *loaded_data)
+int FPU_load_int16(short __user *_s, FPU_REG *loaded_data)
 {
   int s, negative;
 
@@ -326,7 +326,7 @@ int FPU_load_int16(short *_s, FPU_REG *loaded_data)
 
 
 /* Get a packed bcd array from user memory */
-int FPU_load_bcd(u_char *s)
+int FPU_load_bcd(u_char __user *s)
 {
   FPU_REG *st0_ptr = &st(0);
   int pos;
@@ -341,7 +341,7 @@ int FPU_load_bcd(u_char *s)
     {
       l *= 10;
       RE_ENTRANT_CHECK_OFF;
-      FPU_get_user(bcd, (u_char *) s+pos);
+      FPU_get_user(bcd, s+pos);
       RE_ENTRANT_CHECK_ON;
       l += bcd >> 4;
       l *= 10;
@@ -349,7 +349,7 @@ int FPU_load_bcd(u_char *s)
     }
  
   RE_ENTRANT_CHECK_OFF;
-  FPU_get_user(sign, (u_char *) s+9);
+  FPU_get_user(sign, s+9);
   sign = sign & 0x80 ? SIGN_Negative : SIGN_Positive;
   RE_ENTRANT_CHECK_ON;
 
@@ -369,7 +369,7 @@ int FPU_load_bcd(u_char *s)
 /*===========================================================================*/
 
 /* Put a long double into user memory */
-int FPU_store_extended(FPU_REG *st0_ptr, u_char st0_tag, long double *d)
+int FPU_store_extended(FPU_REG *st0_ptr, u_char st0_tag, long double __user *d)
 {
   /*
     The only exception raised by an attempt to store to an
@@ -382,9 +382,9 @@ int FPU_store_extended(FPU_REG *st0_ptr, u_char st0_tag, long double *d)
       RE_ENTRANT_CHECK_OFF;
       FPU_verify_area(VERIFY_WRITE, d, 10);
 
-      FPU_put_user(st0_ptr->sigl, (unsigned long *) d);
-      FPU_put_user(st0_ptr->sigh, (unsigned long *) ((u_char *)d + 4));
-      FPU_put_user(exponent16(st0_ptr), (unsigned short *) ((u_char *)d + 8));
+      FPU_put_user(st0_ptr->sigl, (unsigned long __user *) d);
+      FPU_put_user(st0_ptr->sigh, (unsigned long __user *) ((u_char __user *)d + 4));
+      FPU_put_user(exponent16(st0_ptr), (unsigned short __user *) ((u_char __user *)d + 8));
       RE_ENTRANT_CHECK_ON;
 
       return 1;
@@ -398,9 +398,9 @@ int FPU_store_extended(FPU_REG *st0_ptr, u_char st0_tag, long double *d)
       /* Put out the QNaN indefinite */
       RE_ENTRANT_CHECK_OFF;
       FPU_verify_area(VERIFY_WRITE,d,10);
-      FPU_put_user(0, (unsigned long *) d);
-      FPU_put_user(0xc0000000, 1 + (unsigned long *) d);
-      FPU_put_user(0xffff, 4 + (short *) d);
+      FPU_put_user(0, (unsigned long __user *) d);
+      FPU_put_user(0xc0000000, 1 + (unsigned long __user *) d);
+      FPU_put_user(0xffff, 4 + (short __user *) d);
       RE_ENTRANT_CHECK_ON;
       return 1;
     }
@@ -411,7 +411,7 @@ int FPU_store_extended(FPU_REG *st0_ptr, u_char st0_tag, long double *d)
 
 
 /* Put a double into user memory */
-int FPU_store_double(FPU_REG *st0_ptr, u_char st0_tag, double *dfloat)
+int FPU_store_double(FPU_REG *st0_ptr, u_char st0_tag, double __user *dfloat)
 {
   unsigned long l[2];
   unsigned long increment = 0;	/* avoid gcc warnings */
@@ -607,9 +607,9 @@ int FPU_store_double(FPU_REG *st0_ptr, u_char st0_tag, double *dfloat)
 	  /* The masked response */
 	  /* Put out the QNaN indefinite */
 	  RE_ENTRANT_CHECK_OFF;
-	  FPU_verify_area(VERIFY_WRITE,(void *)dfloat,8);
-	  FPU_put_user(0, (unsigned long *) dfloat);
-	  FPU_put_user(0xfff80000, 1 + (unsigned long *) dfloat);
+	  FPU_verify_area(VERIFY_WRITE,dfloat,8);
+	  FPU_put_user(0, (unsigned long __user *) dfloat);
+	  FPU_put_user(0xfff80000, 1 + (unsigned long __user *) dfloat);
 	  RE_ENTRANT_CHECK_ON;
 	  return 1;
 	}
@@ -620,9 +620,9 @@ int FPU_store_double(FPU_REG *st0_ptr, u_char st0_tag, double *dfloat)
     l[1] |= 0x80000000;
 
   RE_ENTRANT_CHECK_OFF;
-  FPU_verify_area(VERIFY_WRITE,(void *)dfloat,8);
-  FPU_put_user(l[0], (unsigned long *)dfloat);
-  FPU_put_user(l[1], 1 + (unsigned long *)dfloat);
+  FPU_verify_area(VERIFY_WRITE,dfloat,8);
+  FPU_put_user(l[0], (unsigned long __user *)dfloat);
+  FPU_put_user(l[1], 1 + (unsigned long __user *)dfloat);
   RE_ENTRANT_CHECK_ON;
 
   return 1;
@@ -630,7 +630,7 @@ int FPU_store_double(FPU_REG *st0_ptr, u_char st0_tag, double *dfloat)
 
 
 /* Put a float into user memory */
-int FPU_store_single(FPU_REG *st0_ptr, u_char st0_tag, float *single)
+int FPU_store_single(FPU_REG *st0_ptr, u_char st0_tag, float __user *single)
 {
   long templ = 0;
   unsigned long increment = 0;     	/* avoid gcc warnings */
@@ -826,8 +826,8 @@ int FPU_store_single(FPU_REG *st0_ptr, u_char st0_tag, float *single)
 	  /* The masked response */
 	  /* Put out the QNaN indefinite */
 	  RE_ENTRANT_CHECK_OFF;
-	  FPU_verify_area(VERIFY_WRITE,(void *)single,4);
-	  FPU_put_user(0xffc00000, (unsigned long *) single);
+	  FPU_verify_area(VERIFY_WRITE,single,4);
+	  FPU_put_user(0xffc00000, (unsigned long __user *) single);
 	  RE_ENTRANT_CHECK_ON;
 	  return 1;
 	}
@@ -845,8 +845,8 @@ int FPU_store_single(FPU_REG *st0_ptr, u_char st0_tag, float *single)
     templ |= 0x80000000;
 
   RE_ENTRANT_CHECK_OFF;
-  FPU_verify_area(VERIFY_WRITE,(void *)single,4);
-  FPU_put_user(templ,(unsigned long *) single);
+  FPU_verify_area(VERIFY_WRITE,single,4);
+  FPU_put_user(templ,(unsigned long __user *) single);
   RE_ENTRANT_CHECK_ON;
 
   return 1;
@@ -854,7 +854,7 @@ int FPU_store_single(FPU_REG *st0_ptr, u_char st0_tag, float *single)
 
 
 /* Put a long long into user memory */
-int FPU_store_int64(FPU_REG *st0_ptr, u_char st0_tag, long long *d)
+int FPU_store_int64(FPU_REG *st0_ptr, u_char st0_tag, long long __user *d)
 {
   FPU_REG t;
   long long tll;
@@ -906,7 +906,7 @@ int FPU_store_int64(FPU_REG *st0_ptr, u_char st0_tag, long long *d)
     }
 
   RE_ENTRANT_CHECK_OFF;
-  FPU_verify_area(VERIFY_WRITE,(void *)d,8);
+  FPU_verify_area(VERIFY_WRITE,d,8);
   copy_to_user(d, &tll, 8);
   RE_ENTRANT_CHECK_ON;
 
@@ -915,7 +915,7 @@ int FPU_store_int64(FPU_REG *st0_ptr, u_char st0_tag, long long *d)
 
 
 /* Put a long into user memory */
-int FPU_store_int32(FPU_REG *st0_ptr, u_char st0_tag, long *d)
+int FPU_store_int32(FPU_REG *st0_ptr, u_char st0_tag, long __user *d)
 {
   FPU_REG t;
   int precision_loss;
@@ -964,7 +964,7 @@ int FPU_store_int32(FPU_REG *st0_ptr, u_char st0_tag, long *d)
 
   RE_ENTRANT_CHECK_OFF;
   FPU_verify_area(VERIFY_WRITE,d,4);
-  FPU_put_user(t.sigl, (unsigned long *) d);
+  FPU_put_user(t.sigl, (unsigned long __user *) d);
   RE_ENTRANT_CHECK_ON;
 
   return 1;
@@ -972,7 +972,7 @@ int FPU_store_int32(FPU_REG *st0_ptr, u_char st0_tag, long *d)
 
 
 /* Put a short into user memory */
-int FPU_store_int16(FPU_REG *st0_ptr, u_char st0_tag, short *d)
+int FPU_store_int16(FPU_REG *st0_ptr, u_char st0_tag, short __user *d)
 {
   FPU_REG t;
   int precision_loss;
@@ -1021,7 +1021,7 @@ int FPU_store_int16(FPU_REG *st0_ptr, u_char st0_tag, short *d)
 
   RE_ENTRANT_CHECK_OFF;
   FPU_verify_area(VERIFY_WRITE,d,2);
-  FPU_put_user((short)t.sigl,(short *) d);
+  FPU_put_user((short)t.sigl, d);
   RE_ENTRANT_CHECK_ON;
 
   return 1;
@@ -1029,7 +1029,7 @@ int FPU_store_int16(FPU_REG *st0_ptr, u_char st0_tag, short *d)
 
 
 /* Put a packed bcd array into user memory */
-int FPU_store_bcd(FPU_REG *st0_ptr, u_char st0_tag, u_char *d)
+int FPU_store_bcd(FPU_REG *st0_ptr, u_char st0_tag, u_char __user *d)
 {
   FPU_REG t;
   unsigned long long ll;
@@ -1071,10 +1071,10 @@ int FPU_store_bcd(FPU_REG *st0_ptr, u_char st0_tag, u_char *d)
 	  RE_ENTRANT_CHECK_OFF;
 	  FPU_verify_area(VERIFY_WRITE,d,10);
 	  for ( i = 0; i < 7; i++)
-	    FPU_put_user(0, (u_char *) d+i); /* These bytes "undefined" */
-	  FPU_put_user(0xc0, (u_char *) d+7); /* This byte "undefined" */
-	  FPU_put_user(0xff, (u_char *) d+8);
-	  FPU_put_user(0xff, (u_char *) d+9);
+	    FPU_put_user(0, d+i); /* These bytes "undefined" */
+	  FPU_put_user(0xc0, d+7); /* This byte "undefined" */
+	  FPU_put_user(0xff, d+8);
+	  FPU_put_user(0xff, d+9);
 	  RE_ENTRANT_CHECK_ON;
 	  return 1;
 	}
@@ -1095,11 +1095,11 @@ int FPU_store_bcd(FPU_REG *st0_ptr, u_char st0_tag, u_char *d)
       b = FPU_div_small(&ll, 10);
       b |= (FPU_div_small(&ll, 10)) << 4;
       RE_ENTRANT_CHECK_OFF;
-      FPU_put_user(b,(u_char *) d+i);
+      FPU_put_user(b, d+i);
       RE_ENTRANT_CHECK_ON;
     }
   RE_ENTRANT_CHECK_OFF;
-  FPU_put_user(sign,(u_char *) d+9);
+  FPU_put_user(sign, d+9);
   RE_ENTRANT_CHECK_ON;
 
   return 1;
@@ -1175,7 +1175,7 @@ int FPU_round_to_int(FPU_REG *r, u_char tag)
 
 /*===========================================================================*/
 
-u_char *fldenv(fpu_addr_modes addr_modes, u_char *s)
+u_char __user *fldenv(fpu_addr_modes addr_modes, u_char __user *s)
 {
   unsigned short tag_word = 0;
   u_char tag;
@@ -1187,13 +1187,13 @@ u_char *fldenv(fpu_addr_modes addr_modes, u_char *s)
     {
       RE_ENTRANT_CHECK_OFF;
       FPU_verify_area(VERIFY_READ, s, 0x0e);
-      FPU_get_user(control_word, (unsigned short *) s);
-      FPU_get_user(partial_status, (unsigned short *) (s+2));
-      FPU_get_user(tag_word, (unsigned short *) (s+4));
-      FPU_get_user(instruction_address.offset, (unsigned short *) (s+6));
-      FPU_get_user(instruction_address.selector, (unsigned short *) (s+8));
-      FPU_get_user(operand_address.offset, (unsigned short *) (s+0x0a));
-      FPU_get_user(operand_address.selector, (unsigned short *) (s+0x0c));
+      FPU_get_user(control_word, (unsigned short __user *) s);
+      FPU_get_user(partial_status, (unsigned short __user *) (s+2));
+      FPU_get_user(tag_word, (unsigned short __user *) (s+4));
+      FPU_get_user(instruction_address.offset, (unsigned short __user *) (s+6));
+      FPU_get_user(instruction_address.selector, (unsigned short __user *) (s+8));
+      FPU_get_user(operand_address.offset, (unsigned short __user *) (s+0x0a));
+      FPU_get_user(operand_address.selector, (unsigned short __user *) (s+0x0c));
       RE_ENTRANT_CHECK_ON;
       s += 0x0e;
       if ( addr_modes.default_mode == VM86 )
@@ -1207,14 +1207,14 @@ u_char *fldenv(fpu_addr_modes addr_modes, u_char *s)
     {
       RE_ENTRANT_CHECK_OFF;
       FPU_verify_area(VERIFY_READ, s, 0x1c);
-      FPU_get_user(control_word, (unsigned short *) s);
-      FPU_get_user(partial_status, (unsigned short *) (s+4));
-      FPU_get_user(tag_word, (unsigned short *) (s+8));
-      FPU_get_user(instruction_address.offset, (unsigned long *) (s+0x0c));
-      FPU_get_user(instruction_address.selector, (unsigned short *) (s+0x10));
-      FPU_get_user(instruction_address.opcode, (unsigned short *) (s+0x12));
-      FPU_get_user(operand_address.offset, (unsigned long *) (s+0x14));
-      FPU_get_user(operand_address.selector, (unsigned long *) (s+0x18));
+      FPU_get_user(control_word, (unsigned short __user *) s);
+      FPU_get_user(partial_status, (unsigned short __user *) (s+4));
+      FPU_get_user(tag_word, (unsigned short __user *) (s+8));
+      FPU_get_user(instruction_address.offset, (unsigned long __user *) (s+0x0c));
+      FPU_get_user(instruction_address.selector, (unsigned short __user *) (s+0x10));
+      FPU_get_user(instruction_address.opcode, (unsigned short __user *) (s+0x12));
+      FPU_get_user(operand_address.offset, (unsigned long __user *) (s+0x14));
+      FPU_get_user(operand_address.selector, (unsigned long __user *) (s+0x18));
       RE_ENTRANT_CHECK_ON;
       s += 0x1c;
     }
@@ -1266,10 +1266,10 @@ u_char *fldenv(fpu_addr_modes addr_modes, u_char *s)
 }
 
 
-void frstor(fpu_addr_modes addr_modes, u_char *data_address)
+void frstor(fpu_addr_modes addr_modes, u_char __user *data_address)
 {
   int i, regnr;
-  u_char *s = fldenv(addr_modes, data_address);
+  u_char __user *s = fldenv(addr_modes, data_address);
   int offset = (top & 7) * 10, other = 80 - offset;
 
   /* Copy all registers in stack order. */
@@ -1291,7 +1291,7 @@ void frstor(fpu_addr_modes addr_modes, u_char *data_address)
 }
 
 
-u_char *fstenv(fpu_addr_modes addr_modes, u_char *d)
+u_char __user *fstenv(fpu_addr_modes addr_modes, u_char __user *d)
 {
   if ( (addr_modes.default_mode == VM86) ||
       ((addr_modes.default_mode == PM16)
@@ -1300,25 +1300,25 @@ u_char *fstenv(fpu_addr_modes addr_modes, u_char *d)
       RE_ENTRANT_CHECK_OFF;
       FPU_verify_area(VERIFY_WRITE,d,14);
 #ifdef PECULIAR_486
-      FPU_put_user(control_word & ~0xe080, (unsigned long *) d);
+      FPU_put_user(control_word & ~0xe080, (unsigned long __user *) d);
 #else
-      FPU_put_user(control_word, (unsigned short *) d);
+      FPU_put_user(control_word, (unsigned short __user *) d);
 #endif /* PECULIAR_486 */
-      FPU_put_user(status_word(), (unsigned short *) (d+2));
-      FPU_put_user(fpu_tag_word, (unsigned short *) (d+4));
-      FPU_put_user(instruction_address.offset, (unsigned short *) (d+6));
-      FPU_put_user(operand_address.offset, (unsigned short *) (d+0x0a));
+      FPU_put_user(status_word(), (unsigned short __user *) (d+2));
+      FPU_put_user(fpu_tag_word, (unsigned short __user *) (d+4));
+      FPU_put_user(instruction_address.offset, (unsigned short __user *) (d+6));
+      FPU_put_user(operand_address.offset, (unsigned short __user *) (d+0x0a));
       if ( addr_modes.default_mode == VM86 )
 	{
 	  FPU_put_user((instruction_address.offset & 0xf0000) >> 4,
-		      (unsigned short *) (d+8));
+		      (unsigned short __user *) (d+8));
 	  FPU_put_user((operand_address.offset & 0xf0000) >> 4,
-		      (unsigned short *) (d+0x0c));
+		      (unsigned short __user *) (d+0x0c));
 	}
       else
 	{
-	  FPU_put_user(instruction_address.selector, (unsigned short *) (d+8));
-	  FPU_put_user(operand_address.selector, (unsigned short *) (d+0x0c));
+	  FPU_put_user(instruction_address.selector, (unsigned short __user *) (d+8));
+	  FPU_put_user(operand_address.selector, (unsigned short __user *) (d+0x0c));
 	}
       RE_ENTRANT_CHECK_ON;
       d += 0x0e;
@@ -1348,9 +1348,9 @@ u_char *fstenv(fpu_addr_modes addr_modes, u_char *d)
 }
 
 
-void fsave(fpu_addr_modes addr_modes, u_char *data_address)
+void fsave(fpu_addr_modes addr_modes, u_char __user *data_address)
 {
-  u_char *d;
+  u_char __user *d;
   int offset = (top & 7) * 10, other = 80 - offset;
 
   d = fstenv(addr_modes, data_address);
diff --git a/arch/i386/math-emu/reg_round.S b/arch/i386/math-emu/reg_round.S
index 4ac0821fc..d1d4e48b4 100644
--- a/arch/i386/math-emu/reg_round.S
+++ b/arch/i386/math-emu/reg_round.S
@@ -105,7 +105,6 @@ FPU_denormal:
 
 .text
 .globl fpu_reg_round
-.globl fpu_reg_round_sqrt
 .globl fpu_Arith_exit
 
 /* Entry point when called from C */
diff --git a/arch/i386/mm/discontig.c b/arch/i386/mm/discontig.c
index c1de0903d..569e08e5b 100644
--- a/arch/i386/mm/discontig.c
+++ b/arch/i386/mm/discontig.c
@@ -56,7 +56,7 @@ bootmem_data_t node0_bdata;
  *     physnode_map[4-7] = 1;
  *     physnode_map[8- ] = -1;
  */
-u8 physnode_map[MAX_ELEMENTS] = { [0 ... (MAX_ELEMENTS - 1)] = -1};
+s8 physnode_map[MAX_ELEMENTS] = { [0 ... (MAX_ELEMENTS - 1)] = -1};
 
 unsigned long node_start_pfn[MAX_NUMNODES];
 unsigned long node_end_pfn[MAX_NUMNODES];
@@ -87,8 +87,6 @@ void set_pmd_pfn(unsigned long vaddr, unsigned long pfn, pgprot_t flags);
  */
 int __init get_memcfg_numa_flat(void)
 {
-	int pfn;
-
 	printk("NUMA - single node, flat memory mode\n");
 
 	/* Run the memory configuration and find the top of memory. */
@@ -96,16 +94,7 @@ int __init get_memcfg_numa_flat(void)
 	node_start_pfn[0]  = 0;
 	node_end_pfn[0]	  = max_pfn;
 
-	/* Fill in the physnode_map with our simplistic memory model,
-	* all memory is in node 0.
-	*/
-	for (pfn = node_start_pfn[0]; pfn <= node_end_pfn[0];
-	       pfn += PAGES_PER_ELEMENT)
-	{
-		physnode_map[pfn / PAGES_PER_ELEMENT] = 0;
-	}
-
-         /* Indicate there is one node available. */
+        /* Indicate there is one node available. */
 	node_set_online(0);
 	numnodes = 1;
 	return 1;
@@ -129,8 +118,11 @@ static void __init find_max_pfn_node(int nid)
 }
 
 /* 
- * Allocate memory for the pg_data_t via a crude pre-bootmem method
- * We ought to relocate these onto their own node later on during boot.
+ * Allocate memory for the pg_data_t for this node via a crude pre-bootmem
+ * method.  For node zero take this from the bottom of memory, for
+ * subsequent nodes place them at node_remap_start_vaddr which contains
+ * node local data in physically node local memory.  See setup_memory()
+ * for details.
  */
 static void __init allocate_pgdat(int nid)
 {
@@ -231,16 +223,41 @@ unsigned long __init setup_memory(void)
 {
 	int nid;
 	unsigned long bootmap_size, system_start_pfn, system_max_low_pfn;
-	unsigned long reserve_pages;
+	unsigned long reserve_pages, pfn;
 
+	/*
+	 * When mapping a NUMA machine we allocate the node_mem_map arrays
+	 * from node local memory.  They are then mapped directly into KVA
+	 * between zone normal and vmalloc space.  Calculate the size of
+	 * this space and use it to adjust the boundry between ZONE_NORMAL
+	 * and ZONE_HIGHMEM.
+	 */
 	get_memcfg_numa();
+
+	/* Fill in the physnode_map */
+	for (nid = 0; nid < numnodes; nid++) {
+		printk("Node: %d, start_pfn: %ld, end_pfn: %ld\n",
+				nid, node_start_pfn[nid], node_end_pfn[nid]);
+		printk("  Setting physnode_map array to node %d for pfns:\n  ",
+				nid);
+		for (pfn = node_start_pfn[nid]; pfn < node_end_pfn[nid];
+	       				pfn += PAGES_PER_ELEMENT) {
+			physnode_map[pfn / PAGES_PER_ELEMENT] = nid;
+			printk("%ld ", pfn);
+		}
+		printk("\n");
+	}
+
 	reserve_pages = calculate_numa_remap_pages();
 
 	/* partially used pages are not usable - thus round upwards */
 	system_start_pfn = min_low_pfn = PFN_UP(init_pg_tables_end);
 
 	find_max_pfn();
-	system_max_low_pfn = max_low_pfn = find_max_low_pfn();
+	system_max_low_pfn = max_low_pfn = find_max_low_pfn() - reserve_pages;
+	printk("reserve_pages = %ld find_max_low_pfn() ~ %ld\n",
+			reserve_pages, max_low_pfn + reserve_pages);
+	printk("max_pfn = %ld\n", max_pfn);
 #ifdef CONFIG_HIGHMEM
 	highstart_pfn = highend_pfn = max_pfn;
 	if (max_pfn > system_max_low_pfn)
@@ -248,7 +265,6 @@ unsigned long __init setup_memory(void)
 	printk(KERN_NOTICE "%ldMB HIGHMEM available.\n",
 	       pages_to_mb(highend_pfn - highstart_pfn));
 #endif
-	system_max_low_pfn = max_low_pfn = max_low_pfn - reserve_pages;
 	printk(KERN_NOTICE "%ldMB LOWMEM available.\n",
 			pages_to_mb(system_max_low_pfn));
 	printk("min_low_pfn = %ld, max_low_pfn = %ld, highstart_pfn = %ld\n", 
@@ -258,15 +274,16 @@ unsigned long __init setup_memory(void)
 			(ulong) pfn_to_kaddr(max_low_pfn));
 	for (nid = 0; nid < numnodes; nid++) {
 		node_remap_start_vaddr[nid] = pfn_to_kaddr(
-			highstart_pfn - node_remap_offset[nid]);
+			(highstart_pfn + reserve_pages) - node_remap_offset[nid]);
 		allocate_pgdat(nid);
 		printk ("node %d will remap to vaddr %08lx - %08lx\n", nid,
 			(ulong) node_remap_start_vaddr[nid],
-			(ulong) pfn_to_kaddr(highstart_pfn
+			(ulong) pfn_to_kaddr(highstart_pfn + reserve_pages
 			    - node_remap_offset[nid] + node_remap_size[nid]));
 	}
 	printk("High memory starts at vaddr %08lx\n",
 			(ulong) pfn_to_kaddr(highstart_pfn));
+	vmalloc_earlyreserve = reserve_pages * PAGE_SIZE;
 	for (nid = 0; nid < numnodes; nid++)
 		find_max_pfn_node(nid);
 
@@ -403,17 +420,22 @@ void __init zone_sizes_init(void)
 void __init set_highmem_pages_init(int bad_ppro) 
 {
 #ifdef CONFIG_HIGHMEM
-	int nid;
+	struct zone *zone;
 
-	for (nid = 0; nid < numnodes; nid++) {
+	for_each_zone(zone) {
 		unsigned long node_pfn, node_high_size, zone_start_pfn;
 		struct page * zone_mem_map;
 		
-		node_high_size = NODE_DATA(nid)->node_zones[ZONE_HIGHMEM].spanned_pages;
-		zone_mem_map = NODE_DATA(nid)->node_zones[ZONE_HIGHMEM].zone_mem_map;
-		zone_start_pfn = NODE_DATA(nid)->node_zones[ZONE_HIGHMEM].zone_start_pfn;
+		if (!is_highmem(zone))
+			continue;
+
+		printk("Initializing %s for node %d\n", zone->name,
+			zone->zone_pgdat->node_id);
+
+		node_high_size = zone->spanned_pages;
+		zone_mem_map = zone->zone_mem_map;
+		zone_start_pfn = zone->zone_start_pfn;
 
-		printk("Initializing highpages for node %d\n", nid);
 		for (node_pfn = 0; node_pfn < node_high_size; node_pfn++) {
 			one_highpage_init((struct page *)(zone_mem_map + node_pfn),
 					  zone_start_pfn + node_pfn, bad_ppro);
@@ -426,7 +448,11 @@ void __init set_highmem_pages_init(int bad_ppro)
 void __init set_max_mapnr_init(void)
 {
 #ifdef CONFIG_HIGHMEM
-	highmem_start_page = NODE_DATA(0)->node_zones[ZONE_HIGHMEM].zone_mem_map;
+	struct zone *high0 = &NODE_DATA(0)->node_zones[ZONE_HIGHMEM];
+	if (high0->spanned_pages > 0)
+	      	highmem_start_page = high0->zone_mem_map;
+	else
+		highmem_start_page = pfn_to_page(max_low_pfn+1); 
 	num_physpages = highend_pfn;
 #else
 	num_physpages = max_low_pfn;
diff --git a/arch/i386/mm/fault.c b/arch/i386/mm/fault.c
index 0c77e0b07..debed4754 100644
--- a/arch/i386/mm/fault.c
+++ b/arch/i386/mm/fault.c
@@ -24,7 +24,6 @@
 
 #include <asm/system.h>
 #include <asm/uaccess.h>
-#include <asm/pgalloc.h>
 #include <asm/hardirq.h>
 #include <asm/desc.h>
 
@@ -189,11 +188,16 @@ static int __is_prefetch(struct pt_regs *regs, unsigned long addr)
 	return prefetch;
 }
 
-static inline int is_prefetch(struct pt_regs *regs, unsigned long addr)
+static inline int is_prefetch(struct pt_regs *regs, unsigned long addr,
+			      unsigned long error_code)
 {
 	if (unlikely(boot_cpu_data.x86_vendor == X86_VENDOR_AMD &&
-		     boot_cpu_data.x86 >= 6))
+		     boot_cpu_data.x86 >= 6)) {
+		/* Catch an obscure case of prefetch inside an NX page. */
+		if (nx_enabled && (error_code & 16))
+			return 0;
 		return __is_prefetch(regs, addr);
+	}
 	return 0;
 } 
 
@@ -262,7 +266,27 @@ asmlinkage void do_page_fault(struct pt_regs *regs, unsigned long error_code)
 	if (in_atomic() || !mm)
 		goto bad_area_nosemaphore;
 
-	down_read(&mm->mmap_sem);
+	/* When running in the kernel we expect faults to occur only to
+	 * addresses in user space.  All other faults represent errors in the
+	 * kernel and should generate an OOPS.  Unfortunatly, in the case of an
+	 * erroneous fault occuring in a code path which already holds mmap_sem
+	 * we will deadlock attempting to validate the fault against the
+	 * address space.  Luckily the kernel only validly references user
+	 * space from well defined areas of code, which are listed in the
+	 * exceptions table.
+	 *
+	 * As the vast majority of faults will be valid we will only perform
+	 * the source reference check when there is a possibilty of a deadlock.
+	 * Attempt to lock the address space, if we cannot we then validate the
+	 * source.  If this is invalid we can skip the address space check,
+	 * thus avoiding the deadlock.
+	 */
+	if (!down_read_trylock(&mm->mmap_sem)) {
+		if ((error_code & 4) == 0 &&
+		    !search_exception_tables(regs->eip))
+			goto bad_area_nosemaphore;
+		down_read(&mm->mmap_sem);
+	}
 
 	vma = find_vma(mm, address);
 	if (!vma)
@@ -355,7 +379,7 @@ bad_area_nosemaphore:
 		 * Valid to do another page fault here because this one came 
 		 * from user space.
 		 */
-		if (is_prefetch(regs, address))
+		if (is_prefetch(regs, address, error_code))
 			return;
 
 		tsk->thread.cr2 = address;
@@ -365,7 +389,7 @@ bad_area_nosemaphore:
 		info.si_signo = SIGSEGV;
 		info.si_errno = 0;
 		/* info.si_code has been set above */
-		info.si_addr = (void *)address;
+		info.si_addr = (void __user *)address;
 		force_sig_info(SIGSEGV, &info, tsk);
 		return;
 	}
@@ -396,7 +420,7 @@ no_context:
 	 * had been triggered by is_prefetch fixup_exception would have 
 	 * handled it.
 	 */
- 	if (is_prefetch(regs, address))
+ 	if (is_prefetch(regs, address, error_code))
  		return;
 
 /*
@@ -406,6 +430,14 @@ no_context:
 
 	bust_spinlocks(1);
 
+#ifdef CONFIG_X86_PAE
+	if (error_code & 16) {
+		pte_t *pte = lookup_address(address);
+
+		if (pte && pte_present(*pte) && !pte_exec_kernel(*pte))
+			printk(KERN_CRIT "kernel tried to execute NX-protected page - exploit attempt? (uid: %d)\n", current->uid);
+	}
+#endif
 	if (address < PAGE_SIZE)
 		printk(KERN_ALERT "Unable to handle kernel NULL pointer dereference");
 	else
@@ -458,7 +490,7 @@ do_sigbus:
 		goto no_context;
 
 	/* User space => ok to do another page fault */
-	if (is_prefetch(regs, address))
+	if (is_prefetch(regs, address, error_code))
 		return;
 
 	tsk->thread.cr2 = address;
@@ -467,7 +499,7 @@ do_sigbus:
 	info.si_signo = SIGBUS;
 	info.si_errno = 0;
 	info.si_code = BUS_ADRERR;
-	info.si_addr = (void *)address;
+	info.si_addr = (void __user *)address;
 	force_sig_info(SIGBUS, &info, tsk);
 	return;
 
diff --git a/arch/i386/mm/hugetlbpage.c b/arch/i386/mm/hugetlbpage.c
index a8dbbc57b..a0eab6715 100644
--- a/arch/i386/mm/hugetlbpage.c
+++ b/arch/i386/mm/hugetlbpage.c
@@ -15,7 +15,6 @@
 #include <linux/err.h>
 #include <linux/sysctl.h>
 #include <asm/mman.h>
-#include <asm/pgalloc.h>
 #include <asm/tlb.h>
 #include <asm/tlbflush.h>
 
@@ -149,9 +148,6 @@ follow_huge_addr(struct mm_struct *mm, unsigned long address, int write)
 	struct page *page;
 	struct vm_area_struct *vma;
 
-	if (! mm->used_hugetlb)
-		return ERR_PTR(-EINVAL);
-
 	vma = find_vma(mm, addr);
 	if (!vma || !is_vm_hugetlb_page(vma))
 		return ERR_PTR(-EINVAL);
@@ -248,8 +244,15 @@ int hugetlb_prefault(struct address_space *mapping, struct vm_area_struct *vma)
 			ret = -ENOMEM;
 			goto out;
 		}
-		if (!pte_none(*pte))
-			continue;
+
+		if (!pte_none(*pte)) {
+			pmd_t *pmd = (pmd_t *) pte;
+
+			page = pmd_page(*pmd);
+			pmd_clear(pmd);
+			dec_page_state(nr_page_table_pages);
+			page_cache_release(page);
+		}
 
 		idx = ((addr - vma->vm_start) >> HPAGE_SHIFT)
 			+ (vma->vm_pgoff >> (HPAGE_SHIFT - PAGE_SHIFT));
diff --git a/arch/i386/mm/init.c b/arch/i386/mm/init.c
index 19ba96e64..a8bd0544a 100644
--- a/arch/i386/mm/init.c
+++ b/arch/i386/mm/init.c
@@ -32,7 +32,6 @@
 #include <asm/system.h>
 #include <asm/uaccess.h>
 #include <asm/pgtable.h>
-#include <asm/pgalloc.h>
 #include <asm/dma.h>
 #include <asm/fixmap.h>
 #include <asm/e820.h>
@@ -123,6 +122,13 @@ static void __init page_table_range_init (unsigned long start, unsigned long end
 	}
 }
 
+static inline int is_kernel_text(unsigned long addr)
+{
+	if (addr >= (unsigned long)_stext && addr <= (unsigned long)__init_end)
+		return 1;
+	return 0;
+}
+
 /*
  * This maps the physical memory to kernel virtual address space, a total 
  * of max_low_pfn pages, by creating page tables starting from address 
@@ -145,18 +151,29 @@ static void __init kernel_physical_mapping_init(pgd_t *pgd_base)
 		if (pfn >= max_low_pfn)
 			continue;
 		for (pmd_idx = 0; pmd_idx < PTRS_PER_PMD && pfn < max_low_pfn; pmd++, pmd_idx++) {
+			unsigned int address = pfn * PAGE_SIZE + PAGE_OFFSET;
+
 			/* Map with big pages if possible, otherwise create normal page tables. */
 			if (cpu_has_pse) {
-				set_pmd(pmd, pfn_pmd(pfn, PAGE_KERNEL_LARGE));
+				unsigned int address2 = (pfn + PTRS_PER_PTE - 1) * PAGE_SIZE + PAGE_OFFSET + PAGE_SIZE-1;
+
+				if (is_kernel_text(address) || is_kernel_text(address2))
+					set_pmd(pmd, pfn_pmd(pfn, PAGE_KERNEL_LARGE_EXEC));
+				else
+					set_pmd(pmd, pfn_pmd(pfn, PAGE_KERNEL_LARGE));
 				pfn += PTRS_PER_PTE;
 			} else {
 				pte = one_page_table_init(pmd);
 
-				for (pte_ofs = 0; pte_ofs < PTRS_PER_PTE && pfn < max_low_pfn; pte++, pfn++, pte_ofs++)
-					set_pte(pte, pfn_pte(pfn, PAGE_KERNEL));
+				for (pte_ofs = 0; pte_ofs < PTRS_PER_PTE && pfn < max_low_pfn; pte++, pfn++, pte_ofs++) {
+						if (is_kernel_text(address))
+							set_pte(pte, pfn_pte(pfn, PAGE_KERNEL_EXEC));
+						else
+							set_pte(pte, pfn_pte(pfn, PAGE_KERNEL));
+				}
 			}
 		}
-	}	
+	}
 }
 
 static inline int page_kills_ppro(unsigned long pagenr)
@@ -273,7 +290,8 @@ extern void set_highmem_pages_init(int);
 #define set_highmem_pages_init(bad_ppro) do { } while (0)
 #endif /* CONFIG_HIGHMEM */
 
-unsigned long __PAGE_KERNEL = _PAGE_KERNEL;
+unsigned long long __PAGE_KERNEL = _PAGE_KERNEL;
+unsigned long long __PAGE_KERNEL_EXEC = _PAGE_KERNEL_EXEC;
 
 #ifndef CONFIG_DISCONTIGMEM
 #define remap_numa_kva() do {} while (0)
@@ -302,6 +320,7 @@ static void __init pagetable_init (void)
 	if (cpu_has_pge) {
 		set_in_cr4(X86_CR4_PGE);
 		__PAGE_KERNEL |= _PAGE_GLOBAL;
+		__PAGE_KERNEL_EXEC |= _PAGE_GLOBAL;
 	}
 
 	kernel_physical_mapping_init(pgd_base);
@@ -392,6 +411,79 @@ void __init zone_sizes_init(void)
 extern void zone_sizes_init(void);
 #endif /* !CONFIG_DISCONTIGMEM */
 
+static int disable_nx __initdata = 0;
+u64 __supported_pte_mask = ~_PAGE_NX;
+
+/*
+ * noexec = on|off
+ *
+ * Control non executable mappings.
+ *
+ * on      Enable
+ * off     Disable
+ */
+static int __init noexec_setup(char *str)
+{
+	if (!strncmp(str, "on",2) && cpu_has_nx) {
+		__supported_pte_mask |= _PAGE_NX;
+		disable_nx = 0;
+	} else if (!strncmp(str,"off",3)) {
+		disable_nx = 1;
+		__supported_pte_mask &= ~_PAGE_NX;
+	}
+	return 1;
+}
+
+__setup("noexec=", noexec_setup);
+
+#ifdef CONFIG_X86_PAE
+int nx_enabled = 0;
+
+static void __init set_nx(void)
+{
+	unsigned int v[4], l, h;
+
+	if (cpu_has_pae && (cpuid_eax(0x80000000) > 0x80000001)) {
+		cpuid(0x80000001, &v[0], &v[1], &v[2], &v[3]);
+		if ((v[3] & (1 << 20)) && !disable_nx) {
+			rdmsr(MSR_EFER, l, h);
+			l |= EFER_NX;
+			wrmsr(MSR_EFER, l, h);
+			nx_enabled = 1;
+			__supported_pte_mask |= _PAGE_NX;
+		}
+	}
+}
+
+/*
+ * Enables/disables executability of a given kernel page and
+ * returns the previous setting.
+ */
+int __init set_kernel_exec(unsigned long vaddr, int enable)
+{
+	pte_t *pte;
+	int ret = 1;
+
+	if (!nx_enabled)
+		goto out;
+
+	pte = lookup_address(vaddr);
+	BUG_ON(!pte);
+
+	if (!pte_exec_kernel(*pte))
+		ret = 0;
+
+	if (enable)
+		pte->pte_high &= ~(1 << (_PAGE_BIT_NX - 32));
+	else
+		pte->pte_high |= 1 << (_PAGE_BIT_NX - 32);
+	__flush_tlb_all();
+out:
+	return ret;
+}
+
+#endif
+
 /*
  * paging_init() sets up the page tables - note that the first 8MB are
  * already mapped by head.S.
@@ -401,6 +493,12 @@ extern void zone_sizes_init(void);
  */
 void __init paging_init(void)
 {
+#ifdef CONFIG_X86_PAE
+	set_nx();
+	if (nx_enabled)
+		printk("NX (Execute Disable) protection: active\n");
+#endif
+
 	pagetable_init();
 
 	load_cr3(swapper_pg_dir);
diff --git a/arch/i386/mm/ioremap.c b/arch/i386/mm/ioremap.c
index 8c1593278..7b11be028 100644
--- a/arch/i386/mm/ioremap.c
+++ b/arch/i386/mm/ioremap.c
@@ -12,7 +12,6 @@
 #include <linux/init.h>
 #include <linux/slab.h>
 #include <asm/io.h>
-#include <asm/pgalloc.h>
 #include <asm/fixmap.h>
 #include <asm/cacheflush.h>
 #include <asm/tlbflush.h>
diff --git a/arch/i386/mm/pageattr.c b/arch/i386/mm/pageattr.c
index af7c60285..8eb95be7d 100644
--- a/arch/i386/mm/pageattr.c
+++ b/arch/i386/mm/pageattr.c
@@ -17,7 +17,7 @@ static spinlock_t cpa_lock = SPIN_LOCK_UNLOCKED;
 static struct list_head df_list = LIST_HEAD_INIT(df_list);
 
 
-static inline pte_t *lookup_address(unsigned long address) 
+pte_t *lookup_address(unsigned long address) 
 { 
 	pgd_t *pgd = pgd_offset_k(address); 
 	pmd_t *pmd;
diff --git a/arch/i386/mm/pgtable.c b/arch/i386/mm/pgtable.c
index 49561339c..137d18db7 100644
--- a/arch/i386/mm/pgtable.c
+++ b/arch/i386/mm/pgtable.c
@@ -33,7 +33,7 @@ void show_mem(void)
 
 	printk("Mem-info:\n");
 	show_free_areas();
-	printk("Free swap:       %6dkB\n",nr_swap_pages<<(PAGE_SHIFT-10));
+	printk("Free swap:       %6ldkB\n", nr_swap_pages<<(PAGE_SHIFT-10));
 	for_each_pgdat(pgdat) {
 		for (i = 0; i < pgdat->node_spanned_pages; ++i) {
 			page = pgdat->node_mem_map + i;
diff --git a/arch/i386/oprofile/op_model_p4.c b/arch/i386/oprofile/op_model_p4.c
index 8b932b1b3..e92eaed25 100644
--- a/arch/i386/oprofile/op_model_p4.c
+++ b/arch/i386/oprofile/op_model_p4.c
@@ -464,7 +464,7 @@ static void pmc_setup_one_p4_counter(unsigned int ctr)
 	unsigned int escr = 0;
 	unsigned int high = 0;
 	unsigned int counter_bit;
-	struct p4_event_binding * ev = 0;
+	struct p4_event_binding *ev = NULL;
 	unsigned int stag;
 
 	stag = get_stagger();
diff --git a/arch/i386/pci/acpi.c b/arch/i386/pci/acpi.c
index d0a5b7904..86ce01655 100644
--- a/arch/i386/pci/acpi.c
+++ b/arch/i386/pci/acpi.c
@@ -1,6 +1,8 @@
 #include <linux/pci.h>
 #include <linux/acpi.h>
 #include <linux/init.h>
+#include <linux/irq.h>
+#include <asm/hw_irq.h>
 #include "pci.h"
 
 struct pci_bus * __devinit pci_acpi_scan_root(struct acpi_device *device, int domain, int busnum)
@@ -15,18 +17,31 @@ struct pci_bus * __devinit pci_acpi_scan_root(struct acpi_device *device, int do
 
 static int __init pci_acpi_init(void)
 {
+	struct pci_dev *dev = NULL;
+
 	if (pcibios_scanned)
 		return 0;
 
-	if (!acpi_noirq) {
-		if (!acpi_pci_irq_init()) {
-			printk(KERN_INFO "PCI: Using ACPI for IRQ routing\n");
-			pcibios_scanned++;
-			pcibios_enable_irq = acpi_pci_irq_enable;
-		} else
-			printk(KERN_WARNING "PCI: Invalid ACPI-PCI IRQ routing table\n");
+	if (acpi_noirq)
+		return 0;
 
-	}
+	printk(KERN_INFO "PCI: Using ACPI for IRQ routing\n");
+	acpi_irq_penalty_init();
+	pcibios_scanned++;
+	pcibios_enable_irq = acpi_pci_irq_enable;
+
+	/*
+	 * PCI IRQ routing is set up by pci_enable_device(), but we
+	 * also do it here in case there are still broken drivers that
+	 * don't use pci_enable_device().
+	 */
+	while ((dev = pci_find_device(PCI_ANY_ID, PCI_ANY_ID, dev)) != NULL)
+		acpi_pci_irq_enable(dev);
+
+#ifdef CONFIG_X86_IO_APIC
+	if (acpi_ioapic)
+		print_IO_APIC();
+#endif
 
 	return 0;
 }
diff --git a/arch/i386/pci/irq.c b/arch/i386/pci/irq.c
index e29b67b9c..6aa9e5fcf 100644
--- a/arch/i386/pci/irq.c
+++ b/arch/i386/pci/irq.c
@@ -12,6 +12,7 @@
 #include <linux/slab.h>
 #include <linux/interrupt.h>
 #include <linux/irq.h>
+#include <linux/dmi.h>
 #include <asm/io.h>
 #include <asm/smp.h>
 #include <asm/io_apic.h>
@@ -22,7 +23,8 @@
 #define PIRQ_SIGNATURE	(('$' << 0) + ('P' << 8) + ('I' << 16) + ('R' << 24))
 #define PIRQ_VERSION 0x0100
 
-int broken_hp_bios_irq9;
+static int broken_hp_bios_irq9;
+static int acer_tm360_irqrouting;
 
 static struct irq_routing_table *pirq_table;
 
@@ -745,6 +747,14 @@ static int pcibios_lookup_irq(struct pci_dev *dev, int assign)
 		r->set(pirq_router_dev, dev, pirq, 11);
 	}
 
+	/* same for Acer Travelmate 360, but with CB and irq 11 -> 10 */
+	if (acer_tm360_irqrouting && dev->irq == 11 && dev->vendor == PCI_VENDOR_ID_O2) {
+		pirq = 0x68;
+		mask = 0x400;
+		dev->irq = r->get(pirq_router_dev, dev, pirq);
+		pci_write_config_byte(dev, PCI_INTERRUPT_LINE, dev->irq);
+	}
+
 	/*
 	 * Find the best IRQ to assign: use the one
 	 * reported by the device if possible.
@@ -807,7 +817,7 @@ static int pcibios_lookup_irq(struct pci_dev *dev, int assign)
 		    	if ( dev2->irq && dev2->irq != irq && \
 			(!(pci_probe & PCI_USE_PIRQ_MASK) || \
 			((1 << dev2->irq) & mask)) ) {
-#ifndef CONFIG_PCI_USE_VECTOR
+#ifndef CONFIG_PCI_MSI
 		    		printk(KERN_INFO "IRQ routing conflict for %s, have irq %d, want irq %d\n",
 				       pci_name(dev2), dev2->irq, irq);
 #endif
@@ -893,6 +903,54 @@ static void __init pcibios_fixup_irqs(void)
 	}
 }
 
+/*
+ * Work around broken HP Pavilion Notebooks which assign USB to
+ * IRQ 9 even though it is actually wired to IRQ 11
+ */
+static int __init fix_broken_hp_bios_irq9(struct dmi_system_id *d)
+{
+	if (!broken_hp_bios_irq9) {
+		broken_hp_bios_irq9 = 1;
+		printk(KERN_INFO "%s detected - fixing broken IRQ routing\n", d->ident);
+	}
+	return 0;
+}
+
+/*
+ * Work around broken Acer TravelMate 360 Notebooks which assign
+ * Cardbus to IRQ 11 even though it is actually wired to IRQ 10
+ */
+static int __init fix_acer_tm360_irqrouting(struct dmi_system_id *d)
+{
+	if (!acer_tm360_irqrouting) {
+		acer_tm360_irqrouting = 1;
+		printk(KERN_INFO "%s detected - fixing broken IRQ routing\n", d->ident);
+	}
+	return 0;
+}
+
+static struct dmi_system_id __initdata pciirq_dmi_table[] = {
+	{
+		.callback = fix_broken_hp_bios_irq9,
+		.ident = "HP Pavilion N5400 Series Laptop",
+		.matches = {
+			DMI_MATCH(DMI_SYS_VENDOR, "Hewlett-Packard"),
+			DMI_MATCH(DMI_BIOS_VERSION, "GE.M1.03"),
+			DMI_MATCH(DMI_PRODUCT_VERSION, "HP Pavilion Notebook Model GE"),
+			DMI_MATCH(DMI_BOARD_VERSION, "OmniBook N32N-736"),
+		},
+	},
+	{
+		.callback = fix_acer_tm360_irqrouting,
+		.ident = "Acer TravelMate 36x Laptop",
+		.matches = {
+			DMI_MATCH(DMI_SYS_VENDOR, "Acer"),
+			DMI_MATCH(DMI_PRODUCT_NAME, "TravelMate 360"),
+		},
+	},
+	{ }
+};
+
 static int __init pcibios_irq_init(void)
 {
 	DBG("PCI: IRQ init\n");
@@ -900,6 +958,8 @@ static int __init pcibios_irq_init(void)
 	if (pcibios_enable_irq || raw_pci_ops == NULL)
 		return 0;
 
+	dmi_check_system(pciirq_dmi_table);
+
 	pirq_table = pirq_find_routing_table();
 
 #ifdef CONFIG_PCI_BIOS
@@ -974,7 +1034,7 @@ int pirq_enable_irq(struct pci_dev *dev)
 				}
 				dev = temp_dev;
 				if (irq >= 0) {
-#ifdef CONFIG_PCI_USE_VECTOR
+#ifdef CONFIG_PCI_MSI
 					if (!platform_legacy_irq(irq))
 						irq = IO_APIC_VECTOR(irq);
 #endif
@@ -1000,7 +1060,7 @@ int pirq_enable_irq(struct pci_dev *dev)
 	/* VIA bridges use interrupt line for apic/pci steering across
 	   the V-Link */
 	else if (interrupt_line_quirk)
-		pci_write_config_byte(dev, PCI_INTERRUPT_LINE, dev->irq);
+		pci_write_config_byte(dev, PCI_INTERRUPT_LINE, dev->irq & 15);
 	return 0;
 }
 
diff --git a/arch/i386/pci/visws.c b/arch/i386/pci/visws.c
index 3a359a7c4..6a9248784 100644
--- a/arch/i386/pci/visws.c
+++ b/arch/i386/pci/visws.c
@@ -15,8 +15,6 @@
 #include "pci.h"
 
 
-int broken_hp_bios_irq9;
-
 extern struct pci_raw_ops pci_direct_conf1;
 
 static int pci_visws_enable_irq(struct pci_dev *dev) { return 0; }
diff --git a/arch/i386/power/cpu.c b/arch/i386/power/cpu.c
index 98bea6d85..d58d30777 100644
--- a/arch/i386/power/cpu.c
+++ b/arch/i386/power/cpu.c
@@ -27,7 +27,6 @@
 #include <asm/tlbflush.h>
 
 static struct saved_context saved_context;
-static void fix_processor_context(void);
 
 unsigned long saved_context_eax, saved_context_ebx;
 unsigned long saved_context_ecx, saved_context_edx;
@@ -37,33 +36,38 @@ unsigned long saved_context_eflags;
 
 extern void enable_sep_cpu(void *);
 
-void save_processor_state(void)
+void __save_processor_state(struct saved_context *ctxt)
 {
 	kernel_fpu_begin();
 
 	/*
 	 * descriptor tables
 	 */
-	asm volatile ("sgdt %0" : "=m" (saved_context.gdt_limit));
-	asm volatile ("sidt %0" : "=m" (saved_context.idt_limit));
-	asm volatile ("sldt %0" : "=m" (saved_context.ldt));
-	asm volatile ("str %0"  : "=m" (saved_context.tr));
+	asm volatile ("sgdt %0" : "=m" (ctxt->gdt_limit));
+	asm volatile ("sidt %0" : "=m" (ctxt->idt_limit));
+	asm volatile ("sldt %0" : "=m" (ctxt->ldt));
+	asm volatile ("str %0"  : "=m" (ctxt->tr));
 
 	/*
 	 * segment registers
 	 */
-	asm volatile ("movw %%es, %0" : "=m" (saved_context.es));
-	asm volatile ("movw %%fs, %0" : "=m" (saved_context.fs));
-	asm volatile ("movw %%gs, %0" : "=m" (saved_context.gs));
-	asm volatile ("movw %%ss, %0" : "=m" (saved_context.ss));
+	asm volatile ("movw %%es, %0" : "=m" (ctxt->es));
+	asm volatile ("movw %%fs, %0" : "=m" (ctxt->fs));
+	asm volatile ("movw %%gs, %0" : "=m" (ctxt->gs));
+	asm volatile ("movw %%ss, %0" : "=m" (ctxt->ss));
 
 	/*
 	 * control registers 
 	 */
-	asm volatile ("movl %%cr0, %0" : "=r" (saved_context.cr0));
-	asm volatile ("movl %%cr2, %0" : "=r" (saved_context.cr2));
-	asm volatile ("movl %%cr3, %0" : "=r" (saved_context.cr3));
-	asm volatile ("movl %%cr4, %0" : "=r" (saved_context.cr4));
+	asm volatile ("movl %%cr0, %0" : "=r" (ctxt->cr0));
+	asm volatile ("movl %%cr2, %0" : "=r" (ctxt->cr2));
+	asm volatile ("movl %%cr3, %0" : "=r" (ctxt->cr3));
+	asm volatile ("movl %%cr4, %0" : "=r" (ctxt->cr4));
+}
+
+void save_processor_state(void)
+{
+	__save_processor_state(&saved_context);
 }
 
 static void
@@ -75,32 +79,59 @@ do_fpu_end(void)
 	mxcsr_feature_mask_init();
 }
 
-void restore_processor_state(void)
+
+static void fix_processor_context(void)
+{
+	int cpu = smp_processor_id();
+	struct tss_struct * t = init_tss + cpu;
+
+	set_tss_desc(cpu,t);	/* This just modifies memory; should not be necessary. But... This is necessary, because 386 hardware has concept of busy TSS or some similar stupidity. */
+        cpu_gdt_table[cpu][GDT_ENTRY_TSS].b &= 0xfffffdff;
+
+	load_TR_desc();				/* This does ltr */
+	load_LDT(&current->active_mm->context);	/* This does lldt */
+
+	/*
+	 * Now maybe reload the debug registers
+	 */
+	if (current->thread.debugreg[7]){
+                loaddebug(&current->thread, 0);
+                loaddebug(&current->thread, 1);
+                loaddebug(&current->thread, 2);
+                loaddebug(&current->thread, 3);
+                /* no 4 and 5 */
+                loaddebug(&current->thread, 6);
+                loaddebug(&current->thread, 7);
+	}
+
+}
+
+void __restore_processor_state(struct saved_context *ctxt)
 {
 
 	/*
 	 * control registers
 	 */
-	asm volatile ("movl %0, %%cr4" :: "r" (saved_context.cr4));
-	asm volatile ("movl %0, %%cr3" :: "r" (saved_context.cr3));
-	asm volatile ("movl %0, %%cr2" :: "r" (saved_context.cr2));
-	asm volatile ("movl %0, %%cr0" :: "r" (saved_context.cr0));
+	asm volatile ("movl %0, %%cr4" :: "r" (ctxt->cr4));
+	asm volatile ("movl %0, %%cr3" :: "r" (ctxt->cr3));
+	asm volatile ("movl %0, %%cr2" :: "r" (ctxt->cr2));
+	asm volatile ("movl %0, %%cr0" :: "r" (ctxt->cr0));
 
 	/*
 	 * segment registers
 	 */
-	asm volatile ("movw %0, %%es" :: "r" (saved_context.es));
-	asm volatile ("movw %0, %%fs" :: "r" (saved_context.fs));
-	asm volatile ("movw %0, %%gs" :: "r" (saved_context.gs));
-	asm volatile ("movw %0, %%ss" :: "r" (saved_context.ss));
+	asm volatile ("movw %0, %%es" :: "r" (ctxt->es));
+	asm volatile ("movw %0, %%fs" :: "r" (ctxt->fs));
+	asm volatile ("movw %0, %%gs" :: "r" (ctxt->gs));
+	asm volatile ("movw %0, %%ss" :: "r" (ctxt->ss));
 
 	/*
 	 * now restore the descriptor tables to their proper values
 	 * ltr is done i fix_processor_context().
 	 */
-	asm volatile ("lgdt %0" :: "m" (saved_context.gdt_limit));
-	asm volatile ("lidt %0" :: "m" (saved_context.idt_limit));
-	asm volatile ("lldt %0" :: "m" (saved_context.ldt));
+	asm volatile ("lgdt %0" :: "m" (ctxt->gdt_limit));
+	asm volatile ("lidt %0" :: "m" (ctxt->idt_limit));
+	asm volatile ("lldt %0" :: "m" (ctxt->ldt));
 
 	/*
 	 * sysenter MSRs
@@ -112,31 +143,11 @@ void restore_processor_state(void)
 	do_fpu_end();
 }
 
-static void fix_processor_context(void)
+void restore_processor_state(void)
 {
-	int cpu = smp_processor_id();
-	struct tss_struct * t = init_tss + cpu;
-
-	set_tss_desc(cpu,t);	/* This just modifies memory; should not be necessary. But... This is necessary, because 386 hardware has concept of busy TSS or some similar stupidity. */
-        cpu_gdt_table[cpu][GDT_ENTRY_TSS].b &= 0xfffffdff;
-
-	load_TR_desc();				/* This does ltr */
-	load_LDT(&current->active_mm->context);	/* This does lldt */
-
-	/*
-	 * Now maybe reload the debug registers
-	 */
-	if (current->thread.debugreg[7]){
-                loaddebug(&current->thread, 0);
-                loaddebug(&current->thread, 1);
-                loaddebug(&current->thread, 2);
-                loaddebug(&current->thread, 3);
-                /* no 4 and 5 */
-                loaddebug(&current->thread, 6);
-                loaddebug(&current->thread, 7);
-	}
-
+	__restore_processor_state(&saved_context);
 }
 
+
 EXPORT_SYMBOL(save_processor_state);
 EXPORT_SYMBOL(restore_processor_state);
diff --git a/arch/i386/power/swsusp.S b/arch/i386/power/swsusp.S
index bdf03dd1e..8e4a7baca 100644
--- a/arch/i386/power/swsusp.S
+++ b/arch/i386/power/swsusp.S
@@ -18,7 +18,7 @@
 ENTRY(do_magic)
 	pushl %ebx
 	cmpl $0,8(%esp)
-	jne .L1450
+	jne resume
 	call do_magic_suspend_1
 	call save_processor_state
 
@@ -33,21 +33,21 @@ ENTRY(do_magic)
 	pushfl ; popl saved_context_eflags
 
 	call do_magic_suspend_2
-	jmp .L1449
-	.p2align 4,,7
-.L1450:
+	popl %ebx
+	ret
+
+resume:
 	movl $swsusp_pg_dir-__PAGE_OFFSET,%ecx
 	movl %ecx,%cr3
 
 	call do_magic_resume_1
 	movl $0,loop
 	cmpl $0,nr_copy_pages
-	je .L1453
-	.p2align 4,,7
-.L1455:
+	je copy_done
+copy_loop:
 	movl $0,loop2
 	.p2align 4,,7
-.L1459:
+copy_one_page:
 	movl pagedir_nosave,%ecx
 	movl loop,%eax
 	movl loop2,%edx
@@ -56,23 +56,21 @@ ENTRY(do_magic)
 	movl (%ecx,%eax),%eax
 	movb (%edx,%eax),%al
 	movb %al,(%edx,%ebx)
-	movl %cr3, %eax;              
-	movl %eax, %cr3;  # flush TLB 
 
 	movl loop2,%eax
 	leal 1(%eax),%edx
 	movl %edx,loop2
 	movl %edx,%eax
 	cmpl $4095,%eax
-	jbe .L1459
+	jbe copy_one_page
 	movl loop,%eax
 	leal 1(%eax),%edx
 	movl %edx,loop
 	movl %edx,%eax
 	cmpl nr_copy_pages,%eax
-	jb .L1455
-	.p2align 4,,7
-.L1453:
+	jb copy_loop
+
+copy_done:
 	movl $__USER_DS,%eax
 
 	movw %ax, %ds
@@ -88,7 +86,6 @@ ENTRY(do_magic)
 	call restore_processor_state
 	pushl saved_context_eflags ; popfl
 	call do_magic_resume_2
-.L1449:
 	popl %ebx
 	ret
 
diff --git a/arch/ia64/Kconfig b/arch/ia64/Kconfig
index 5bc74ca44..8295d4bc4 100644
--- a/arch/ia64/Kconfig
+++ b/arch/ia64/Kconfig
@@ -149,20 +149,6 @@ config IA64_L1_CACHE_SHIFT
 	default "6" if ITANIUM
 
 # align cache-sensitive data to 64 bytes
-config MCKINLEY_ASTEP_SPECIFIC
-	bool "McKinley A-step specific code"
-	depends on MCKINLEY
-	help
-	  Select this option to build a kernel for an IA-64 McKinley prototype
-	  system with any A-stepping CPU.
-
-config MCKINLEY_A0_SPECIFIC
-	bool "McKinley A0/A1-step specific code"
-	depends on MCKINLEY_ASTEP_SPECIFIC
-	help
-	  Select this option to build a kernel for an IA-64 McKinley prototype
-	  system with an A0 or A1 stepping CPU.
-
 config NUMA
 	bool "NUMA support"
 	depends on !IA64_HP_SIM
@@ -184,7 +170,7 @@ config VIRTUAL_MEM_MAP
 
 config DISCONTIGMEM
 	bool "Discontiguous memory support"
-	depends on (IA64_DIG || IA64_SGI_SN2 || IA64_GENERIC) && NUMA && VIRTUAL_MEM_MAP
+	depends on (IA64_DIG || IA64_SGI_SN2 || IA64_GENERIC || IA64_HP_ZX1) && NUMA && VIRTUAL_MEM_MAP
 	default y if (IA64_SGI_SN2 || IA64_GENERIC) && NUMA
 	help
 	  Say Y to support efficient handling of discontiguous physical memory,
@@ -193,10 +179,10 @@ config DISCONTIGMEM
 	  See <file:Documentation/vm/numa> for more.
 
 config IA64_CYCLONE
-	bool "Support Cyclone(EXA) Time Source"
+	bool "Cyclone (EXA) Time Source support"
 	help
-		Say Y here to enable support for IBM EXA Cyclone time source.
-		If you're unsure, answer N.
+	  Say Y here to enable support for IBM EXA Cyclone time source.
+	  If you're unsure, answer N.
 
 config IOSAPIC
 	bool
@@ -402,7 +388,7 @@ config IA64_GRANULE_16MB
 
 config IA64_GRANULE_64MB
 	bool "64MB"
-	depends on !(IA64_GENERIC || IA64_HP_ZX1)
+	depends on !(IA64_GENERIC || IA64_HP_ZX1 || IA64_SGI_SN2)
 
 endchoice
 
diff --git a/arch/ia64/Makefile b/arch/ia64/Makefile
index 2675ab3fb..f2ca1e231 100644
--- a/arch/ia64/Makefile
+++ b/arch/ia64/Makefile
@@ -43,7 +43,8 @@ endif
 
 ifeq ($(GCC_VERSION),3)
  ifeq ($(GCC_MINOR_VERSION),4)
-	cflags-$(CONFIG_ITANIUM)	+= -mtune=merced
+# Workaround Itanium 1 bugs in gcc 3.4.
+#	cflags-$(CONFIG_ITANIUM)	+= -mtune=merced
 	cflags-$(CONFIG_MCKINLEY)	+= -mtune=mckinley
  endif
 endif
diff --git a/arch/ia64/configs/generic_defconfig b/arch/ia64/configs/generic_defconfig
index 285d7017a..e64003e02 100644
--- a/arch/ia64/configs/generic_defconfig
+++ b/arch/ia64/configs/generic_defconfig
@@ -7,25 +7,30 @@
 #
 CONFIG_EXPERIMENTAL=y
 CONFIG_CLEAN_COMPILE=y
-CONFIG_STANDALONE=y
 
 #
 # General setup
 #
 CONFIG_SWAP=y
 CONFIG_SYSVIPC=y
+CONFIG_POSIX_MQUEUE=y
 # CONFIG_BSD_PROCESS_ACCT is not set
 CONFIG_SYSCTL=y
+# CONFIG_AUDIT is not set
 CONFIG_LOG_BUF_SHIFT=20
+CONFIG_HOTPLUG=y
 CONFIG_IKCONFIG=y
 CONFIG_IKCONFIG_PROC=y
 # CONFIG_EMBEDDED is not set
 CONFIG_KALLSYMS=y
+CONFIG_KALLSYMS_ALL=y
+# CONFIG_KALLSYMS_EXTRA_PASS is not set
 CONFIG_FUTEX=y
 CONFIG_EPOLL=y
 CONFIG_IOSCHED_NOOP=y
 CONFIG_IOSCHED_AS=y
 CONFIG_IOSCHED_DEADLINE=y
+CONFIG_IOSCHED_CFQ=y
 # CONFIG_CC_OPTIMIZE_FOR_SIZE is not set
 
 #
@@ -37,6 +42,7 @@ CONFIG_MODULE_UNLOAD=y
 CONFIG_OBSOLETE_MODPARM=y
 CONFIG_MODVERSIONS=y
 CONFIG_KMOD=y
+CONFIG_STOP_MACHINE=y
 
 #
 # Processor type and features
@@ -46,55 +52,54 @@ CONFIG_64BIT=y
 CONFIG_MMU=y
 CONFIG_RWSEM_XCHGADD_ALGORITHM=y
 CONFIG_TIME_INTERPOLATION=y
-# CONFIG_ITANIUM is not set
-CONFIG_MCKINLEY=y
+CONFIG_EFI=y
 CONFIG_IA64_GENERIC=y
 # CONFIG_IA64_DIG is not set
-# CONFIG_IA64_HP_SIM is not set
 # CONFIG_IA64_HP_ZX1 is not set
 # CONFIG_IA64_SGI_SN2 is not set
+# CONFIG_IA64_HP_SIM is not set
+# CONFIG_ITANIUM is not set
+CONFIG_MCKINLEY=y
 # CONFIG_IA64_PAGE_SIZE_4KB is not set
 # CONFIG_IA64_PAGE_SIZE_8KB is not set
 CONFIG_IA64_PAGE_SIZE_16KB=y
 # CONFIG_IA64_PAGE_SIZE_64KB is not set
-CONFIG_ACPI=y
-CONFIG_ACPI_INTERPRETER=y
-CONFIG_ACPI_KERNEL_CONFIG=y
 CONFIG_IA64_L1_CACHE_SHIFT=7
-# CONFIG_MCKINLEY_ASTEP_SPECIFIC is not set
 CONFIG_NUMA=y
-CONFIG_DISCONTIGMEM=y
 CONFIG_VIRTUAL_MEM_MAP=y
-CONFIG_IA64_MCA=y
-CONFIG_PM=y
+CONFIG_DISCONTIGMEM=y
+CONFIG_IA64_CYCLONE=y
 CONFIG_IOSAPIC=y
 CONFIG_FORCE_MAX_ZONEORDER=18
-# CONFIG_HUGETLB_PAGE_SIZE_4GB is not set
-# CONFIG_HUGETLB_PAGE_SIZE_1GB is not set
-# CONFIG_HUGETLB_PAGE_SIZE_256MB is not set
-# CONFIG_HUGETLB_PAGE_SIZE_64MB is not set
-CONFIG_HUGETLB_PAGE_SIZE_16MB=y
-# CONFIG_HUGETLB_PAGE_SIZE_4MB is not set
-# CONFIG_HUGETLB_PAGE_SIZE_1MB is not set
-# CONFIG_HUGETLB_PAGE_SIZE_256KB is not set
-# CONFIG_IA64_PAL_IDLE is not set
 CONFIG_SMP=y
+CONFIG_NR_CPUS=512
+CONFIG_HOTPLUG_CPU=y
 # CONFIG_PREEMPT is not set
+CONFIG_HAVE_DEC_LOCK=y
 CONFIG_IA32_SUPPORT=y
 CONFIG_COMPAT=y
-CONFIG_HAVE_DEC_LOCK=y
 CONFIG_PERFMON=y
 CONFIG_IA64_PALINFO=y
-CONFIG_EFI=y
+
+#
+# Firmware Drivers
+#
 CONFIG_EFI_VARS=y
-CONFIG_NR_CPUS=512
+CONFIG_EFI_PCDP=y
 CONFIG_BINFMT_ELF=y
 CONFIG_BINFMT_MISC=m
 
+#
+# Power management and ACPI
+#
+CONFIG_PM=y
+CONFIG_ACPI=y
+
 #
 # ACPI (Advanced Configuration and Power Interface) Support
 #
 CONFIG_ACPI_BOOT=y
+CONFIG_ACPI_INTERPRETER=y
 CONFIG_ACPI_BUTTON=m
 CONFIG_ACPI_FAN=m
 CONFIG_ACPI_PROCESSOR=m
@@ -105,11 +110,15 @@ CONFIG_ACPI_BUS=y
 CONFIG_ACPI_POWER=y
 CONFIG_ACPI_PCI=y
 CONFIG_ACPI_SYSTEM=y
+
+#
+# Bus options (PCI, PCMCIA)
+#
 CONFIG_PCI=y
 CONFIG_PCI_DOMAINS=y
+# CONFIG_PCI_MSI is not set
 CONFIG_PCI_LEGACY_PROC=y
 CONFIG_PCI_NAMES=y
-CONFIG_HOTPLUG=y
 
 #
 # PCI Hotplug Support
@@ -118,6 +127,8 @@ CONFIG_HOTPLUG_PCI=m
 # CONFIG_HOTPLUG_PCI_FAKE is not set
 CONFIG_HOTPLUG_PCI_ACPI=m
 # CONFIG_HOTPLUG_PCI_CPCI is not set
+# CONFIG_HOTPLUG_PCI_PCIE is not set
+# CONFIG_HOTPLUG_PCI_SHPC is not set
 
 #
 # PCMCIA/CardBus support
@@ -125,29 +136,34 @@ CONFIG_HOTPLUG_PCI_ACPI=m
 # CONFIG_PCMCIA is not set
 
 #
-# Parallel port support
+# Device Drivers
 #
-# CONFIG_PARPORT is not set
 
 #
 # Generic Driver Options
 #
+CONFIG_STANDALONE=y
+CONFIG_PREVENT_FIRMWARE_BUILD=y
 # CONFIG_FW_LOADER is not set
+# CONFIG_DEBUG_DRIVER is not set
 
 #
 # Memory Technology Devices (MTD)
 #
 # CONFIG_MTD is not set
 
+#
+# Parallel port support
+#
+# CONFIG_PARPORT is not set
+
 #
 # Plug and Play support
 #
-# CONFIG_PNP is not set
 
 #
 # Block devices
 #
-# CONFIG_BLK_DEV_FD is not set
 # CONFIG_BLK_CPQ_DA is not set
 # CONFIG_BLK_CPQ_CISS_DA is not set
 # CONFIG_BLK_DEV_DAC960 is not set
@@ -155,9 +171,9 @@ CONFIG_HOTPLUG_PCI_ACPI=m
 CONFIG_BLK_DEV_LOOP=m
 CONFIG_BLK_DEV_CRYPTOLOOP=m
 CONFIG_BLK_DEV_NBD=m
+# CONFIG_BLK_DEV_SX8 is not set
 CONFIG_BLK_DEV_RAM=m
 CONFIG_BLK_DEV_RAM_SIZE=4096
-# CONFIG_BLK_DEV_INITRD is not set
 
 #
 # ATA/ATAPI/MFM/RLL support
@@ -168,9 +184,9 @@ CONFIG_BLK_DEV_IDE=y
 #
 # Please see Documentation/ide.txt for help/info on IDE drives
 #
+# CONFIG_BLK_DEV_IDE_SATA is not set
 CONFIG_BLK_DEV_IDEDISK=y
 # CONFIG_IDEDISK_MULTI_MODE is not set
-# CONFIG_IDEDISK_STROKE is not set
 CONFIG_BLK_DEV_IDECD=y
 # CONFIG_BLK_DEV_IDETAPE is not set
 CONFIG_BLK_DEV_IDEFLOPPY=y
@@ -181,6 +197,7 @@ CONFIG_BLK_DEV_IDESCSI=m
 #
 # IDE chipset support/bugfixes
 #
+CONFIG_IDE_GENERIC=y
 CONFIG_BLK_DEV_IDEPCI=y
 # CONFIG_IDEPCI_SHARE_IRQ is not set
 # CONFIG_BLK_DEV_OFFBOARD is not set
@@ -207,46 +224,17 @@ CONFIG_BLK_DEV_PIIX=y
 # CONFIG_BLK_DEV_PDC202XX_OLD is not set
 # CONFIG_BLK_DEV_PDC202XX_NEW is not set
 # CONFIG_BLK_DEV_SVWKS is not set
+CONFIG_BLK_DEV_SGIIOC4=y
 # CONFIG_BLK_DEV_SIIMAGE is not set
 # CONFIG_BLK_DEV_SLC90E66 is not set
 # CONFIG_BLK_DEV_TRM290 is not set
 # CONFIG_BLK_DEV_VIA82CXXX is not set
+# CONFIG_IDE_ARM is not set
 CONFIG_BLK_DEV_IDEDMA=y
 # CONFIG_IDEDMA_IVB is not set
 CONFIG_IDEDMA_AUTO=y
 # CONFIG_BLK_DEV_HD is not set
 
-#
-# IEEE 1394 (FireWire) support (EXPERIMENTAL)
-#
-# CONFIG_IEEE1394 is not set
-
-#
-# I2O device support
-#
-# CONFIG_I2O is not set
-
-#
-# Multi-device support (RAID and LVM)
-#
-CONFIG_MD=y
-CONFIG_BLK_DEV_MD=m
-CONFIG_MD_LINEAR=m
-CONFIG_MD_RAID0=m
-CONFIG_MD_RAID1=m
-CONFIG_MD_RAID5=m
-CONFIG_MD_MULTIPATH=m
-CONFIG_BLK_DEV_DM=m
-
-#
-# Fusion MPT device support
-#
-CONFIG_FUSION=y
-CONFIG_FUSION_BOOT=y
-CONFIG_FUSION_MAX_SGE=40
-# CONFIG_FUSION_ISENSE is not set
-# CONFIG_FUSION_CTL is not set
-
 #
 # SCSI device support
 #
@@ -267,24 +255,28 @@ CONFIG_CHR_DEV_SG=m
 # Some SCSI devices (e.g. CD jukebox) support multiple LUNs
 #
 # CONFIG_SCSI_MULTI_LUN is not set
-CONFIG_SCSI_REPORT_LUNS=y
 # CONFIG_SCSI_CONSTANTS is not set
 # CONFIG_SCSI_LOGGING is not set
 
+#
+# SCSI Transport Attributes
+#
+CONFIG_SCSI_SPI_ATTRS=y
+CONFIG_SCSI_FC_ATTRS=y
+
 #
 # SCSI low-level drivers
 #
 # CONFIG_BLK_DEV_3W_XXXX_RAID is not set
+# CONFIG_SCSI_3W_9XXX is not set
 # CONFIG_SCSI_ACARD is not set
 # CONFIG_SCSI_AACRAID is not set
 # CONFIG_SCSI_AIC7XXX is not set
 # CONFIG_SCSI_AIC7XXX_OLD is not set
 # CONFIG_SCSI_AIC79XX is not set
-# CONFIG_SCSI_ADVANSYS is not set
 # CONFIG_SCSI_MEGARAID is not set
 # CONFIG_SCSI_SATA is not set
 # CONFIG_SCSI_BUSLOGIC is not set
-# CONFIG_SCSI_CPQFCTS is not set
 # CONFIG_SCSI_DMX3191D is not set
 # CONFIG_SCSI_EATA is not set
 # CONFIG_SCSI_EATA_PIO is not set
@@ -297,15 +289,57 @@ CONFIG_SCSI_SYM53C8XX_DMA_ADDRESSING_MODE=1
 CONFIG_SCSI_SYM53C8XX_DEFAULT_TAGS=16
 CONFIG_SCSI_SYM53C8XX_MAX_TAGS=64
 # CONFIG_SCSI_SYM53C8XX_IOMAPPED is not set
+# CONFIG_SCSI_IPR is not set
 # CONFIG_SCSI_QLOGIC_ISP is not set
 CONFIG_SCSI_QLOGIC_FC=y
 # CONFIG_SCSI_QLOGIC_FC_FIRMWARE is not set
 CONFIG_SCSI_QLOGIC_1280=y
+CONFIG_SCSI_QLA2XXX=y
+CONFIG_SCSI_QLA21XX=m
+CONFIG_SCSI_QLA22XX=m
+CONFIG_SCSI_QLA2300=m
+CONFIG_SCSI_QLA2322=m
+# CONFIG_SCSI_QLA6312 is not set
+# CONFIG_SCSI_QLA6322 is not set
 # CONFIG_SCSI_DC395x is not set
 # CONFIG_SCSI_DC390T is not set
-# CONFIG_SCSI_NSP32 is not set
 # CONFIG_SCSI_DEBUG is not set
 
+#
+# Multi-device support (RAID and LVM)
+#
+CONFIG_MD=y
+CONFIG_BLK_DEV_MD=m
+CONFIG_MD_LINEAR=m
+CONFIG_MD_RAID0=m
+CONFIG_MD_RAID1=m
+CONFIG_MD_RAID5=m
+CONFIG_MD_RAID6=m
+CONFIG_MD_MULTIPATH=m
+CONFIG_BLK_DEV_DM=m
+CONFIG_DM_CRYPT=m
+CONFIG_DM_SNAPSHOT=m
+CONFIG_DM_MIRROR=m
+CONFIG_DM_ZERO=m
+
+#
+# Fusion MPT device support
+#
+CONFIG_FUSION=y
+CONFIG_FUSION_MAX_SGE=40
+# CONFIG_FUSION_ISENSE is not set
+# CONFIG_FUSION_CTL is not set
+
+#
+# IEEE 1394 (FireWire) support
+#
+# CONFIG_IEEE1394 is not set
+
+#
+# I2O device support
+#
+# CONFIG_I2O is not set
+
 #
 # Networking support
 #
@@ -327,23 +361,21 @@ CONFIG_IP_MULTICAST=y
 # CONFIG_NET_IPGRE is not set
 # CONFIG_IP_MROUTE is not set
 CONFIG_ARPD=y
-# CONFIG_INET_ECN is not set
 CONFIG_SYN_COOKIES=y
 # CONFIG_INET_AH is not set
 # CONFIG_INET_ESP is not set
 # CONFIG_INET_IPCOMP is not set
 # CONFIG_IPV6 is not set
-# CONFIG_DECNET is not set
-# CONFIG_BRIDGE is not set
 # CONFIG_NETFILTER is not set
 
 #
 # SCTP Configuration (EXPERIMENTAL)
 #
-CONFIG_IPV6_SCTP__=y
 # CONFIG_IP_SCTP is not set
 # CONFIG_ATM is not set
+# CONFIG_BRIDGE is not set
 # CONFIG_VLAN_8021Q is not set
+# CONFIG_DECNET is not set
 # CONFIG_LLC2 is not set
 # CONFIG_IPX is not set
 # CONFIG_ATALK is not set
@@ -352,30 +384,37 @@ CONFIG_IPV6_SCTP__=y
 # 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
+# CONFIG_NET_CLS_ROUTE is not set
 
 #
 # Network testing
 #
 # CONFIG_NET_PKTGEN is not set
+CONFIG_NETPOLL=y
+# CONFIG_NETPOLL_RX is not set
+# CONFIG_NETPOLL_TRAP is not set
+CONFIG_NET_POLL_CONTROLLER=y
+# CONFIG_HAMRADIO is not set
+# CONFIG_IRDA is not set
+# CONFIG_BT is not set
 CONFIG_NETDEVICES=y
-
-#
-# ARCnet devices
-#
-# CONFIG_ARCNET is not set
 CONFIG_DUMMY=m
 # CONFIG_BONDING is not set
 # CONFIG_EQUALIZER is not set
 # CONFIG_TUN is not set
 # CONFIG_ETHERTAP is not set
 
+#
+# ARCnet devices
+#
+# CONFIG_ARCNET is not set
+
 #
 # Ethernet (10 or 100Mbit)
 #
@@ -393,6 +432,7 @@ CONFIG_NET_TULIP=y
 CONFIG_TULIP=m
 # CONFIG_TULIP_MWI is not set
 # CONFIG_TULIP_MMIO is not set
+# CONFIG_TULIP_NAPI is not set
 # CONFIG_DE4X5 is not set
 # CONFIG_WINBOND_840 is not set
 # CONFIG_DM9102 is not set
@@ -402,10 +442,12 @@ CONFIG_NET_PCI=y
 # CONFIG_AMD8111_ETH is not set
 # CONFIG_ADAPTEC_STARFIRE is not set
 # CONFIG_B44 is not set
+# CONFIG_FORCEDETH is not set
 # CONFIG_DGRS is not set
 CONFIG_EEPRO100=m
 # CONFIG_EEPRO100_PIO is not set
 CONFIG_E100=m
+# CONFIG_E100_NAPI is not set
 # CONFIG_FEALNX is not set
 # CONFIG_NATSEMI is not set
 # CONFIG_NE2K_PCI is not set
@@ -415,6 +457,7 @@ CONFIG_E100=m
 # CONFIG_EPIC100 is not set
 # CONFIG_SUNDANCE is not set
 # CONFIG_VIA_RHINE is not set
+# CONFIG_VIA_VELOCITY is not set
 
 #
 # Ethernet (1000 Mbit)
@@ -427,7 +470,6 @@ CONFIG_E1000=m
 # CONFIG_HAMACHI is not set
 # CONFIG_YELLOWFIN is not set
 # CONFIG_R8169 is not set
-# CONFIG_SIS190 is not set
 # CONFIG_SK98LIN is not set
 CONFIG_TIGON3=y
 
@@ -435,47 +477,39 @@ CONFIG_TIGON3=y
 # Ethernet (10000 Mbit)
 #
 # CONFIG_IXGB is not set
-# CONFIG_FDDI is not set
-# CONFIG_HIPPI is not set
-# CONFIG_PPP is not set
-# CONFIG_SLIP is not set
-
-#
-# Wireless LAN (non-hamradio)
-#
-# CONFIG_NET_RADIO is not set
+# CONFIG_S2IO is not set
 
 #
 # Token Ring devices
 #
 # CONFIG_TR is not set
-# CONFIG_NET_FC is not set
-# CONFIG_SHAPER is not set
-
-#
-# Wan interfaces
-#
-# CONFIG_WAN is not set
 
 #
-# Amateur Radio support
+# Wireless LAN (non-hamradio)
 #
-# CONFIG_HAMRADIO is not set
+# CONFIG_NET_RADIO is not set
 
 #
-# IrDA (infrared) support
+# Wan interfaces
 #
-# CONFIG_IRDA is not set
+# CONFIG_WAN is not set
+# CONFIG_FDDI is not set
+# CONFIG_HIPPI is not set
+# CONFIG_PPP is not set
+# CONFIG_SLIP is not set
+# CONFIG_NET_FC is not set
+# CONFIG_SHAPER is not set
+CONFIG_NETCONSOLE=y
 
 #
-# Bluetooth support
+# ISDN subsystem
 #
-# CONFIG_BT is not set
+# CONFIG_ISDN is not set
 
 #
-# ISDN subsystem
+# Telephony Support
 #
-# CONFIG_ISDN_BOOL is not set
+# CONFIG_PHONE is not set
 
 #
 # Input device support
@@ -517,11 +551,13 @@ CONFIG_SERIO_I8042=y
 CONFIG_INPUT_KEYBOARD=y
 CONFIG_KEYBOARD_ATKBD=y
 # CONFIG_KEYBOARD_SUNKBD is not set
+# CONFIG_KEYBOARD_LKKBD is not set
 # CONFIG_KEYBOARD_XTKBD is not set
 # CONFIG_KEYBOARD_NEWTON is not set
 CONFIG_INPUT_MOUSE=y
 CONFIG_MOUSE_PS2=y
 # CONFIG_MOUSE_SERIAL is not set
+# CONFIG_MOUSE_VSXXXAA is not set
 # CONFIG_INPUT_JOYSTICK is not set
 # CONFIG_INPUT_TOUCHSCREEN is not set
 # CONFIG_INPUT_MISC is not set
@@ -534,12 +570,11 @@ CONFIG_VT_CONSOLE=y
 CONFIG_HW_CONSOLE=y
 CONFIG_SERIAL_NONSTANDARD=y
 # CONFIG_ROCKETPORT is not set
+# CONFIG_CYCLADES is not set
 # CONFIG_SYNCLINK is not set
 # CONFIG_SYNCLINKMP is not set
 # CONFIG_N_HDLC is not set
 # CONFIG_STALDRV is not set
-CONFIG_SGI_L1_SERIAL=y
-CONFIG_SGI_L1_SERIAL_CONSOLE=y
 
 #
 # Serial drivers
@@ -547,7 +582,6 @@ CONFIG_SGI_L1_SERIAL_CONSOLE=y
 CONFIG_SERIAL_8250=y
 CONFIG_SERIAL_8250_CONSOLE=y
 CONFIG_SERIAL_8250_ACPI=y
-CONFIG_SERIAL_8250_HCDP=y
 CONFIG_SERIAL_8250_NR_UARTS=6
 CONFIG_SERIAL_8250_EXTENDED=y
 CONFIG_SERIAL_8250_SHARE_IRQ=y
@@ -560,31 +594,10 @@ CONFIG_SERIAL_8250_SHARE_IRQ=y
 #
 CONFIG_SERIAL_CORE=y
 CONFIG_SERIAL_CORE_CONSOLE=y
+CONFIG_SERIAL_SGI_L1_CONSOLE=y
 CONFIG_UNIX98_PTYS=y
-CONFIG_UNIX98_PTY_COUNT=256
-
-#
-# I2C support
-#
-# CONFIG_I2C is not set
-
-#
-# I2C Algorithms
-#
-
-#
-# I2C Hardware Bus support
-#
-
-#
-# I2C Hardware Sensors Chip support
-#
-# CONFIG_I2C_SENSOR is not set
-
-#
-# Mice
-#
-# CONFIG_BUSMOUSE is not set
+CONFIG_LEGACY_PTYS=y
+CONFIG_LEGACY_PTY_COUNT=256
 # CONFIG_QIC02_TAPE is not set
 
 #
@@ -597,8 +610,6 @@ CONFIG_UNIX98_PTY_COUNT=256
 #
 # CONFIG_WATCHDOG is not set
 # CONFIG_HW_RANDOM is not set
-# CONFIG_NVRAM is not set
-# CONFIG_GEN_RTC is not set
 CONFIG_EFI_RTC=y
 # CONFIG_DTLK is not set
 # CONFIG_R3964 is not set
@@ -618,182 +629,34 @@ CONFIG_DRM_RADEON=m
 CONFIG_DRM_MGA=m
 CONFIG_DRM_SIS=m
 CONFIG_RAW_DRIVER=m
+CONFIG_HPET=y
+# CONFIG_HPET_RTC_IRQ is not set
+CONFIG_HPET_MMAP=y
 CONFIG_MAX_RAW_DEVS=256
 
 #
-# Multimedia devices
-#
-# CONFIG_VIDEO_DEV is not set
-
-#
-# Digital Video Broadcasting Devices
-#
-# CONFIG_DVB is not set
-
-#
-# File systems
-#
-CONFIG_EXT2_FS=y
-CONFIG_EXT2_FS_XATTR=y
-CONFIG_EXT2_FS_POSIX_ACL=y
-CONFIG_EXT2_FS_SECURITY=y
-CONFIG_EXT3_FS=y
-CONFIG_EXT3_FS_XATTR=y
-CONFIG_EXT3_FS_POSIX_ACL=y
-CONFIG_EXT3_FS_SECURITY=y
-CONFIG_JBD=y
-# CONFIG_JBD_DEBUG is not set
-CONFIG_FS_MBCACHE=y
-CONFIG_REISERFS_FS=m
-# CONFIG_REISERFS_CHECK is not set
-# CONFIG_REISERFS_PROC_INFO is not set
-# CONFIG_JFS_FS is not set
-CONFIG_FS_POSIX_ACL=y
-CONFIG_XFS_FS=y
-# CONFIG_XFS_RT is not set
-# CONFIG_XFS_QUOTA is not set
-# CONFIG_XFS_POSIX_ACL is not set
-# CONFIG_MINIX_FS is not set
-# CONFIG_ROMFS_FS is not set
-# CONFIG_QUOTA is not set
-CONFIG_AUTOFS_FS=y
-CONFIG_AUTOFS4_FS=y
-
-#
-# CD-ROM/DVD Filesystems
-#
-CONFIG_ISO9660_FS=m
-CONFIG_JOLIET=y
-# CONFIG_ZISOFS is not set
-CONFIG_UDF_FS=m
-
-#
-# DOS/FAT/NT Filesystems
-#
-CONFIG_FAT_FS=y
-# CONFIG_MSDOS_FS is not set
-CONFIG_VFAT_FS=y
-CONFIG_NTFS_FS=m
-# CONFIG_NTFS_DEBUG is not set
-# CONFIG_NTFS_RW is not set
-
-#
-# Pseudo filesystems
+# I2C support
 #
-CONFIG_PROC_FS=y
-CONFIG_PROC_KCORE=y
-# CONFIG_DEVFS_FS is not set
-CONFIG_DEVPTS_FS=y
-# CONFIG_DEVPTS_FS_XATTR is not set
-CONFIG_TMPFS=y
-CONFIG_HUGETLBFS=y
-CONFIG_HUGETLB_PAGE=y
-CONFIG_RAMFS=y
+# CONFIG_I2C is not set
 
 #
-# Miscellaneous filesystems
+# Dallas's 1-wire bus
 #
-# CONFIG_ADFS_FS is not set
-# CONFIG_AFFS_FS is not set
-# CONFIG_HFS_FS is not set
-# CONFIG_BEFS_FS is not set
-# CONFIG_BFS_FS is not set
-# CONFIG_EFS_FS is not set
-# CONFIG_CRAMFS is not set
-# CONFIG_VXFS_FS is not set
-# CONFIG_HPFS_FS is not set
-# CONFIG_QNX4FS_FS is not set
-# CONFIG_SYSV_FS is not set
-# CONFIG_UFS_FS is not set
+# CONFIG_W1 is not set
 
 #
-# Network File Systems
+# Misc devices
 #
-CONFIG_NFS_FS=m
-CONFIG_NFS_V3=y
-CONFIG_NFS_V4=y
-CONFIG_NFS_DIRECTIO=y
-CONFIG_NFSD=m
-CONFIG_NFSD_V3=y
-CONFIG_NFSD_V4=y
-CONFIG_NFSD_TCP=y
-CONFIG_LOCKD=m
-CONFIG_LOCKD_V4=y
-CONFIG_EXPORTFS=m
-CONFIG_SUNRPC=m
-# CONFIG_SUNRPC_GSS is not set
-CONFIG_SMB_FS=m
-CONFIG_SMB_NLS_DEFAULT=y
-CONFIG_SMB_NLS_REMOTE="cp437"
-CONFIG_CIFS=m
-# CONFIG_NCP_FS is not set
-# CONFIG_CODA_FS is not set
-# CONFIG_INTERMEZZO_FS is not set
-# CONFIG_AFS_FS is not set
 
 #
-# Partition Types
+# Multimedia devices
 #
-CONFIG_PARTITION_ADVANCED=y
-# CONFIG_ACORN_PARTITION is not set
-# CONFIG_OSF_PARTITION is not set
-# CONFIG_AMIGA_PARTITION is not set
-# CONFIG_ATARI_PARTITION is not set
-# CONFIG_MAC_PARTITION is not set
-CONFIG_MSDOS_PARTITION=y
-# CONFIG_BSD_DISKLABEL is not set
-# CONFIG_MINIX_SUBPARTITION is not set
-# CONFIG_SOLARIS_X86_PARTITION is not set
-# CONFIG_UNIXWARE_DISKLABEL is not set
-# CONFIG_LDM_PARTITION is not set
-# CONFIG_NEC98_PARTITION is not set
-CONFIG_SGI_PARTITION=y
-# CONFIG_ULTRIX_PARTITION is not set
-# CONFIG_SUN_PARTITION is not set
-CONFIG_EFI_PARTITION=y
+# CONFIG_VIDEO_DEV is not set
 
 #
-# Native Language Support
+# Digital Video Broadcasting Devices
 #
-CONFIG_NLS=y
-CONFIG_NLS_DEFAULT="iso8859-1"
-CONFIG_NLS_CODEPAGE_437=m
-CONFIG_NLS_CODEPAGE_737=m
-CONFIG_NLS_CODEPAGE_775=m
-CONFIG_NLS_CODEPAGE_850=m
-CONFIG_NLS_CODEPAGE_852=m
-CONFIG_NLS_CODEPAGE_855=m
-CONFIG_NLS_CODEPAGE_857=m
-CONFIG_NLS_CODEPAGE_860=m
-CONFIG_NLS_CODEPAGE_861=m
-CONFIG_NLS_CODEPAGE_862=m
-CONFIG_NLS_CODEPAGE_863=m
-CONFIG_NLS_CODEPAGE_864=m
-CONFIG_NLS_CODEPAGE_865=m
-CONFIG_NLS_CODEPAGE_866=m
-CONFIG_NLS_CODEPAGE_869=m
-CONFIG_NLS_CODEPAGE_936=m
-CONFIG_NLS_CODEPAGE_950=m
-CONFIG_NLS_CODEPAGE_932=m
-CONFIG_NLS_CODEPAGE_949=m
-CONFIG_NLS_CODEPAGE_874=m
-CONFIG_NLS_ISO8859_8=m
-CONFIG_NLS_CODEPAGE_1250=m
-CONFIG_NLS_CODEPAGE_1251=m
-CONFIG_NLS_ISO8859_1=m
-CONFIG_NLS_ISO8859_2=m
-CONFIG_NLS_ISO8859_3=m
-CONFIG_NLS_ISO8859_4=m
-CONFIG_NLS_ISO8859_5=m
-CONFIG_NLS_ISO8859_6=m
-CONFIG_NLS_ISO8859_7=m
-CONFIG_NLS_ISO8859_9=m
-CONFIG_NLS_ISO8859_13=m
-CONFIG_NLS_ISO8859_14=m
-CONFIG_NLS_ISO8859_15=m
-CONFIG_NLS_KOI8_R=m
-CONFIG_NLS_KOI8_U=m
-CONFIG_NLS_UTF8=m
+# CONFIG_DVB is not set
 
 #
 # Graphics support
@@ -816,6 +679,10 @@ CONFIG_SOUND=m
 # Advanced Linux Sound Architecture
 #
 CONFIG_SND=m
+CONFIG_SND_TIMER=m
+CONFIG_SND_PCM=m
+CONFIG_SND_HWDEP=m
+CONFIG_SND_RAWMIDI=m
 CONFIG_SND_SEQUENCER=m
 CONFIG_SND_SEQ_DUMMY=m
 CONFIG_SND_OSSEMUL=y
@@ -828,6 +695,8 @@ CONFIG_SND_VERBOSE_PRINTK=y
 #
 # Generic devices
 #
+CONFIG_SND_MPU401_UART=m
+CONFIG_SND_OPL3_LIB=m
 CONFIG_SND_DUMMY=m
 CONFIG_SND_VIRMIDI=m
 CONFIG_SND_MTPAV=m
@@ -837,13 +706,20 @@ CONFIG_SND_MPU401=m
 #
 # PCI devices
 #
+CONFIG_SND_AC97_CODEC=m
 # CONFIG_SND_ALI5451 is not set
+# CONFIG_SND_ATIIXP is not set
+# CONFIG_SND_AU8810 is not set
+# CONFIG_SND_AU8820 is not set
+# CONFIG_SND_AU8830 is not set
 # CONFIG_SND_AZT3328 is not set
+# CONFIG_SND_BT87X is not set
 CONFIG_SND_CS46XX=m
 CONFIG_SND_CS46XX_NEW_DSP=y
 CONFIG_SND_CS4281=m
 CONFIG_SND_EMU10K1=m
 # CONFIG_SND_KORG1212 is not set
+# CONFIG_SND_MIXART is not set
 # CONFIG_SND_NM256 is not set
 # CONFIG_SND_RME32 is not set
 # CONFIG_SND_RME96 is not set
@@ -859,9 +735,11 @@ CONFIG_SND_EMU10K1=m
 # CONFIG_SND_ES1968 is not set
 # CONFIG_SND_MAESTRO3 is not set
 CONFIG_SND_FM801=m
+# CONFIG_SND_FM801_TEA575X is not set
 # CONFIG_SND_ICE1712 is not set
 # CONFIG_SND_ICE1724 is not set
 # CONFIG_SND_INTEL8X0 is not set
+# CONFIG_SND_INTEL8X0M is not set
 # CONFIG_SND_SONICVIBES is not set
 # CONFIG_SND_VIA82XX is not set
 # CONFIG_SND_VX222 is not set
@@ -893,6 +771,8 @@ CONFIG_USB_DEVICEFS=y
 # USB Host Controller Drivers
 #
 CONFIG_USB_EHCI_HCD=m
+# CONFIG_USB_EHCI_SPLIT_ISO is not set
+# CONFIG_USB_EHCI_ROOT_HUB_TT is not set
 CONFIG_USB_OHCI_HCD=m
 CONFIG_USB_UHCI_HCD=m
 
@@ -906,6 +786,7 @@ CONFIG_USB_UHCI_HCD=m
 # CONFIG_USB_PRINTER is not set
 CONFIG_USB_STORAGE=m
 # CONFIG_USB_STORAGE_DEBUG is not set
+# CONFIG_USB_STORAGE_RW_DETECT is not set
 # CONFIG_USB_STORAGE_DATAFAB is not set
 # CONFIG_USB_STORAGE_FREECOM is not set
 # CONFIG_USB_STORAGE_ISD200 is not set
@@ -932,13 +813,15 @@ CONFIG_USB_HIDINPUT=y
 # CONFIG_USB_WACOM is not set
 # CONFIG_USB_KBTAB is not set
 # CONFIG_USB_POWERMATE is not set
+# CONFIG_USB_MTOUCH is not set
+# CONFIG_USB_EGALAX is not set
 # CONFIG_USB_XPAD is not set
+# CONFIG_USB_ATI_REMOTE is not set
 
 #
 # USB Imaging devices
 #
 # CONFIG_USB_MDC800 is not set
-# CONFIG_USB_SCANNER is not set
 # CONFIG_USB_MICROTEK is not set
 # CONFIG_USB_HPUSBSCSI is not set
 
@@ -972,18 +855,202 @@ CONFIG_USB_HIDINPUT=y
 #
 # USB Miscellaneous drivers
 #
+# CONFIG_USB_EMI62 is not set
+# CONFIG_USB_EMI26 is not set
 # CONFIG_USB_TIGL is not set
 # CONFIG_USB_AUERSWALD is not set
 # CONFIG_USB_RIO500 is not set
 # CONFIG_USB_LEGOTOWER is not set
 # CONFIG_USB_LCD is not set
+# CONFIG_USB_LED is not set
+# CONFIG_USB_CYTHERM is not set
+# CONFIG_USB_PHIDGETSERVO is not set
 # CONFIG_USB_TEST is not set
+
+#
+# USB Gadget Support
+#
 # CONFIG_USB_GADGET is not set
 
+#
+# File systems
+#
+CONFIG_EXT2_FS=y
+CONFIG_EXT2_FS_XATTR=y
+CONFIG_EXT2_FS_POSIX_ACL=y
+CONFIG_EXT2_FS_SECURITY=y
+CONFIG_EXT3_FS=y
+CONFIG_EXT3_FS_XATTR=y
+CONFIG_EXT3_FS_POSIX_ACL=y
+CONFIG_EXT3_FS_SECURITY=y
+CONFIG_JBD=y
+# CONFIG_JBD_DEBUG is not set
+CONFIG_FS_MBCACHE=y
+CONFIG_REISERFS_FS=m
+# CONFIG_REISERFS_CHECK is not set
+# CONFIG_REISERFS_PROC_INFO is not set
+# CONFIG_REISERFS_FS_XATTR is not set
+# CONFIG_JFS_FS is not set
+CONFIG_FS_POSIX_ACL=y
+CONFIG_XFS_FS=y
+# CONFIG_XFS_RT is not set
+# CONFIG_XFS_QUOTA is not set
+# CONFIG_XFS_SECURITY is not set
+# CONFIG_XFS_POSIX_ACL is not set
+# CONFIG_MINIX_FS is not set
+# CONFIG_ROMFS_FS is not set
+# CONFIG_QUOTA is not set
+CONFIG_AUTOFS_FS=y
+CONFIG_AUTOFS4_FS=y
+
+#
+# CD-ROM/DVD Filesystems
+#
+CONFIG_ISO9660_FS=m
+CONFIG_JOLIET=y
+# CONFIG_ZISOFS is not set
+CONFIG_UDF_FS=m
+CONFIG_UDF_NLS=y
+
+#
+# DOS/FAT/NT Filesystems
+#
+CONFIG_FAT_FS=y
+# CONFIG_MSDOS_FS is not set
+CONFIG_VFAT_FS=y
+CONFIG_NTFS_FS=m
+# CONFIG_NTFS_DEBUG is not set
+# CONFIG_NTFS_RW is not set
+
+#
+# Pseudo filesystems
+#
+CONFIG_PROC_FS=y
+CONFIG_PROC_KCORE=y
+CONFIG_SYSFS=y
+# CONFIG_DEVFS_FS is not set
+# CONFIG_DEVPTS_FS_XATTR is not set
+CONFIG_TMPFS=y
+CONFIG_HUGETLBFS=y
+CONFIG_HUGETLB_PAGE=y
+CONFIG_RAMFS=y
+
+#
+# Miscellaneous filesystems
+#
+# CONFIG_ADFS_FS is not set
+# CONFIG_AFFS_FS is not set
+# CONFIG_HFS_FS is not set
+# CONFIG_HFSPLUS_FS is not set
+# CONFIG_BEFS_FS is not set
+# CONFIG_BFS_FS is not set
+# CONFIG_EFS_FS is not set
+# CONFIG_JFFS2_COMPRESSION_OPTIONS is not set
+# CONFIG_CRAMFS is not set
+# CONFIG_VXFS_FS is not set
+# CONFIG_HPFS_FS is not set
+# CONFIG_QNX4FS_FS is not set
+# CONFIG_SYSV_FS is not set
+# CONFIG_UFS_FS is not set
+
+#
+# Network File Systems
+#
+CONFIG_NFS_FS=m
+CONFIG_NFS_V3=y
+CONFIG_NFS_V4=y
+CONFIG_NFS_DIRECTIO=y
+CONFIG_NFSD=m
+CONFIG_NFSD_V3=y
+CONFIG_NFSD_V4=y
+CONFIG_NFSD_TCP=y
+CONFIG_LOCKD=m
+CONFIG_LOCKD_V4=y
+CONFIG_EXPORTFS=m
+CONFIG_SUNRPC=m
+CONFIG_SUNRPC_GSS=m
+CONFIG_RPCSEC_GSS_KRB5=m
+CONFIG_SMB_FS=m
+CONFIG_SMB_NLS_DEFAULT=y
+CONFIG_SMB_NLS_REMOTE="cp437"
+CONFIG_CIFS=m
+# CONFIG_CIFS_STATS is not set
+# CONFIG_CIFS_XATTR is not set
+# CONFIG_CIFS_POSIX is not set
+# CONFIG_NCP_FS is not set
+# CONFIG_CODA_FS is not set
+# CONFIG_AFS_FS is not set
+
+#
+# Partition Types
+#
+CONFIG_PARTITION_ADVANCED=y
+# CONFIG_ACORN_PARTITION is not set
+# CONFIG_OSF_PARTITION is not set
+# CONFIG_AMIGA_PARTITION is not set
+# CONFIG_ATARI_PARTITION is not set
+# CONFIG_MAC_PARTITION is not set
+CONFIG_MSDOS_PARTITION=y
+# CONFIG_BSD_DISKLABEL is not set
+# CONFIG_MINIX_SUBPARTITION is not set
+# CONFIG_SOLARIS_X86_PARTITION is not set
+# CONFIG_UNIXWARE_DISKLABEL is not set
+# CONFIG_LDM_PARTITION is not set
+CONFIG_SGI_PARTITION=y
+# CONFIG_ULTRIX_PARTITION is not set
+# CONFIG_SUN_PARTITION is not set
+CONFIG_EFI_PARTITION=y
+
+#
+# Native Language Support
+#
+CONFIG_NLS=y
+CONFIG_NLS_DEFAULT="iso8859-1"
+CONFIG_NLS_CODEPAGE_437=m
+CONFIG_NLS_CODEPAGE_737=m
+CONFIG_NLS_CODEPAGE_775=m
+CONFIG_NLS_CODEPAGE_850=m
+CONFIG_NLS_CODEPAGE_852=m
+CONFIG_NLS_CODEPAGE_855=m
+CONFIG_NLS_CODEPAGE_857=m
+CONFIG_NLS_CODEPAGE_860=m
+CONFIG_NLS_CODEPAGE_861=m
+CONFIG_NLS_CODEPAGE_862=m
+CONFIG_NLS_CODEPAGE_863=m
+CONFIG_NLS_CODEPAGE_864=m
+CONFIG_NLS_CODEPAGE_865=m
+CONFIG_NLS_CODEPAGE_866=m
+CONFIG_NLS_CODEPAGE_869=m
+CONFIG_NLS_CODEPAGE_936=m
+CONFIG_NLS_CODEPAGE_950=m
+CONFIG_NLS_CODEPAGE_932=m
+CONFIG_NLS_CODEPAGE_949=m
+CONFIG_NLS_CODEPAGE_874=m
+CONFIG_NLS_ISO8859_8=m
+CONFIG_NLS_CODEPAGE_1250=m
+CONFIG_NLS_CODEPAGE_1251=m
+# CONFIG_NLS_ASCII is not set
+CONFIG_NLS_ISO8859_1=m
+CONFIG_NLS_ISO8859_2=m
+CONFIG_NLS_ISO8859_3=m
+CONFIG_NLS_ISO8859_4=m
+CONFIG_NLS_ISO8859_5=m
+CONFIG_NLS_ISO8859_6=m
+CONFIG_NLS_ISO8859_7=m
+CONFIG_NLS_ISO8859_9=m
+CONFIG_NLS_ISO8859_13=m
+CONFIG_NLS_ISO8859_14=m
+CONFIG_NLS_ISO8859_15=m
+CONFIG_NLS_KOI8_R=m
+CONFIG_NLS_KOI8_U=m
+CONFIG_NLS_UTF8=m
+
 #
 # Library routines
 #
+# CONFIG_CRC_CCITT is not set
 CONFIG_CRC32=y
+# CONFIG_LIBCRC32C is not set
 
 #
 # HP Simulator drivers
@@ -1012,6 +1079,7 @@ CONFIG_MAGIC_SYSRQ=y
 # CONFIG_IA64_DEBUG_CMPXCHG is not set
 # CONFIG_IA64_DEBUG_IRQ is not set
 # CONFIG_DEBUG_INFO is not set
+CONFIG_SYSVIPC_COMPAT=y
 
 #
 # Security options
@@ -1025,16 +1093,20 @@ CONFIG_CRYPTO=y
 # CONFIG_CRYPTO_HMAC is not set
 # CONFIG_CRYPTO_NULL is not set
 # CONFIG_CRYPTO_MD4 is not set
-# CONFIG_CRYPTO_MD5 is not set
+CONFIG_CRYPTO_MD5=m
 # CONFIG_CRYPTO_SHA1 is not set
 # CONFIG_CRYPTO_SHA256 is not set
 # CONFIG_CRYPTO_SHA512 is not set
-# CONFIG_CRYPTO_DES is not set
+CONFIG_CRYPTO_DES=m
 # CONFIG_CRYPTO_BLOWFISH is not set
 # CONFIG_CRYPTO_TWOFISH is not set
 # CONFIG_CRYPTO_SERPENT is not set
-# CONFIG_CRYPTO_AES is not set
+# CONFIG_CRYPTO_AES_GENERIC is not set
 # CONFIG_CRYPTO_CAST5 is not set
 # CONFIG_CRYPTO_CAST6 is not set
+# CONFIG_CRYPTO_TEA is not set
+# CONFIG_CRYPTO_ARC4 is not set
 # CONFIG_CRYPTO_DEFLATE is not set
+# CONFIG_CRYPTO_MICHAEL_MIC is not set
+# CONFIG_CRYPTO_CRC32C is not set
 # CONFIG_CRYPTO_TEST is not set
diff --git a/arch/ia64/configs/sim_defconfig b/arch/ia64/configs/sim_defconfig
index 5744b59f1..a26781cfe 100644
--- a/arch/ia64/configs/sim_defconfig
+++ b/arch/ia64/configs/sim_defconfig
@@ -228,7 +228,6 @@ CONFIG_IP_MULTICAST=y
 # 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
 
 #
diff --git a/arch/ia64/configs/sn2_defconfig b/arch/ia64/configs/sn2_defconfig
index 8e790347d..2797cb4eb 100644
--- a/arch/ia64/configs/sn2_defconfig
+++ b/arch/ia64/configs/sn2_defconfig
@@ -14,18 +14,23 @@ CONFIG_STANDALONE=y
 #
 CONFIG_SWAP=y
 CONFIG_SYSVIPC=y
+CONFIG_POSIX_MQUEUE=y
 # CONFIG_BSD_PROCESS_ACCT is not set
 CONFIG_SYSCTL=y
+# CONFIG_AUDIT is not set
 CONFIG_LOG_BUF_SHIFT=20
 CONFIG_HOTPLUG=y
 # CONFIG_IKCONFIG is not set
 # CONFIG_EMBEDDED is not set
 CONFIG_KALLSYMS=y
+CONFIG_KALLSYMS_ALL=y
+# CONFIG_KALLSYMS_EXTRA_PASS is not set
 CONFIG_FUTEX=y
 CONFIG_EPOLL=y
 CONFIG_IOSCHED_NOOP=y
 CONFIG_IOSCHED_AS=y
 CONFIG_IOSCHED_DEADLINE=y
+CONFIG_IOSCHED_CFQ=y
 # CONFIG_CC_OPTIMIZE_FOR_SIZE is not set
 
 #
@@ -60,7 +65,6 @@ CONFIG_MCKINLEY=y
 CONFIG_IA64_PAGE_SIZE_16KB=y
 # CONFIG_IA64_PAGE_SIZE_64KB is not set
 CONFIG_IA64_L1_CACHE_SHIFT=7
-# CONFIG_MCKINLEY_ASTEP_SPECIFIC is not set
 CONFIG_NUMA=y
 CONFIG_VIRTUAL_MEM_MAP=y
 CONFIG_DISCONTIGMEM=y
@@ -70,13 +74,19 @@ CONFIG_IA64_SGI_SN_SIM=y
 CONFIG_FORCE_MAX_ZONEORDER=18
 CONFIG_SMP=y
 CONFIG_NR_CPUS=512
+# CONFIG_HOTPLUG_CPU is not set
 # CONFIG_PREEMPT is not set
 CONFIG_HAVE_DEC_LOCK=y
 CONFIG_IA32_SUPPORT=y
 CONFIG_COMPAT=y
 CONFIG_PERFMON=y
 CONFIG_IA64_PALINFO=y
+
+#
+# Firmware Drivers
+#
 CONFIG_EFI_VARS=y
+# CONFIG_EFI_PCDP is not set
 CONFIG_BINFMT_ELF=y
 # CONFIG_BINFMT_MISC is not set
 
@@ -105,6 +115,7 @@ CONFIG_ACPI_SYSTEM=y
 #
 CONFIG_PCI=y
 CONFIG_PCI_DOMAINS=y
+# CONFIG_PCI_USE_VECTOR is not set
 CONFIG_PCI_LEGACY_PROC=y
 CONFIG_PCI_NAMES=y
 
@@ -131,6 +142,7 @@ CONFIG_HOTPLUG_PCI_SGI=y
 #
 # Generic Driver Options
 #
+CONFIG_PREVENT_FIRMWARE_BUILD=y
 CONFIG_FW_LOADER=m
 # CONFIG_DEBUG_DRIVER is not set
 
@@ -153,12 +165,12 @@ CONFIG_FW_LOADER=m
 #
 # CONFIG_BLK_CPQ_DA is not set
 # CONFIG_BLK_CPQ_CISS_DA is not set
-CONFIG_BLK_DEV_DAC960=m
-CONFIG_BLK_DEV_UMEM=m
+# CONFIG_BLK_DEV_DAC960 is not set
+# CONFIG_BLK_DEV_UMEM is not set
 CONFIG_BLK_DEV_LOOP=y
 CONFIG_BLK_DEV_CRYPTOLOOP=m
 CONFIG_BLK_DEV_NBD=m
-# CONFIG_BLK_DEV_CARMEL is not set
+# CONFIG_BLK_DEV_SX8 is not set
 CONFIG_BLK_DEV_RAM=y
 CONFIG_BLK_DEV_RAM_SIZE=4096
 CONFIG_BLK_DEV_INITRD=y
@@ -172,13 +184,12 @@ CONFIG_BLK_DEV_IDE=y
 #
 # Please see Documentation/ide.txt for help/info on IDE drives
 #
-CONFIG_BLK_DEV_IDEDISK=y
-# CONFIG_IDEDISK_MULTI_MODE is not set
-# CONFIG_IDEDISK_STROKE is not set
-CONFIG_BLK_DEV_IDECD=m
-CONFIG_BLK_DEV_IDETAPE=m
-CONFIG_BLK_DEV_IDEFLOPPY=y
-CONFIG_BLK_DEV_IDESCSI=m
+# CONFIG_BLK_DEV_IDE_SATA is not set
+# CONFIG_BLK_DEV_IDEDISK is not set
+CONFIG_BLK_DEV_IDECD=y
+# CONFIG_BLK_DEV_IDETAPE is not set
+# CONFIG_BLK_DEV_IDEFLOPPY is not set
+# CONFIG_BLK_DEV_IDESCSI is not set
 # CONFIG_IDE_TASK_IOCTL is not set
 # CONFIG_IDE_TASKFILE_IO is not set
 
@@ -187,9 +198,9 @@ CONFIG_BLK_DEV_IDESCSI=m
 #
 CONFIG_IDE_GENERIC=y
 CONFIG_BLK_DEV_IDEPCI=y
-CONFIG_IDEPCI_SHARE_IRQ=y
+# CONFIG_IDEPCI_SHARE_IRQ is not set
 # CONFIG_BLK_DEV_OFFBOARD is not set
-CONFIG_BLK_DEV_GENERIC=y
+# CONFIG_BLK_DEV_GENERIC is not set
 # CONFIG_BLK_DEV_OPTI621 is not set
 CONFIG_BLK_DEV_IDEDMA_PCI=y
 # CONFIG_BLK_DEV_IDEDMA_FORCED is not set
@@ -199,25 +210,25 @@ CONFIG_BLK_DEV_ADMA=y
 # CONFIG_BLK_DEV_AEC62XX is not set
 # CONFIG_BLK_DEV_ALI15X3 is not set
 # CONFIG_BLK_DEV_AMD74XX is not set
-CONFIG_BLK_DEV_CMD64X=m
+# CONFIG_BLK_DEV_CMD64X is not set
 # CONFIG_BLK_DEV_TRIFLEX is not set
 # CONFIG_BLK_DEV_CY82C693 is not set
 # CONFIG_BLK_DEV_CS5520 is not set
 # CONFIG_BLK_DEV_CS5530 is not set
-CONFIG_BLK_DEV_HPT34X=m
-CONFIG_HPT34X_AUTODMA=y
-CONFIG_BLK_DEV_HPT366=m
+# CONFIG_BLK_DEV_HPT34X is not set
+# CONFIG_BLK_DEV_HPT366 is not set
 # CONFIG_BLK_DEV_SC1200 is not set
 # CONFIG_BLK_DEV_PIIX is not set
 # CONFIG_BLK_DEV_NS87415 is not set
 # CONFIG_BLK_DEV_PDC202XX_OLD is not set
 # CONFIG_BLK_DEV_PDC202XX_NEW is not set
-CONFIG_BLK_DEV_SVWKS=m
+# CONFIG_BLK_DEV_SVWKS is not set
 CONFIG_BLK_DEV_SGIIOC4=y
 # CONFIG_BLK_DEV_SIIMAGE is not set
 # CONFIG_BLK_DEV_SLC90E66 is not set
 # CONFIG_BLK_DEV_TRM290 is not set
 # CONFIG_BLK_DEV_VIA82CXXX is not set
+# CONFIG_IDE_ARM is not set
 CONFIG_BLK_DEV_IDEDMA=y
 # CONFIG_IDEDMA_IVB is not set
 CONFIG_IDEDMA_AUTO=y
@@ -234,8 +245,8 @@ CONFIG_SCSI_PROC_FS=y
 #
 CONFIG_BLK_DEV_SD=y
 CONFIG_CHR_DEV_ST=m
-CONFIG_CHR_DEV_OSST=m
-CONFIG_BLK_DEV_SR=y
+# CONFIG_CHR_DEV_OSST is not set
+CONFIG_BLK_DEV_SR=m
 # CONFIG_BLK_DEV_SR_VENDOR is not set
 CONFIG_CHR_DEV_SG=m
 
@@ -243,7 +254,6 @@ CONFIG_CHR_DEV_SG=m
 # Some SCSI devices (e.g. CD jukebox) support multiple LUNs
 #
 # CONFIG_SCSI_MULTI_LUN is not set
-CONFIG_SCSI_REPORT_LUNS=y
 CONFIG_SCSI_CONSTANTS=y
 # CONFIG_SCSI_LOGGING is not set
 
@@ -257,35 +267,24 @@ CONFIG_SCSI_FC_ATTRS=y
 # SCSI low-level drivers
 #
 # CONFIG_BLK_DEV_3W_XXXX_RAID is not set
+# CONFIG_SCSI_3W_9XXX is not set
 # CONFIG_SCSI_ACARD is not set
 # CONFIG_SCSI_AACRAID is not set
-CONFIG_SCSI_AIC7XXX=m
-CONFIG_AIC7XXX_CMDS_PER_DEVICE=32
-CONFIG_AIC7XXX_RESET_DELAY_MS=15000
-# CONFIG_AIC7XXX_BUILD_FIRMWARE is not set
-CONFIG_AIC7XXX_DEBUG_ENABLE=y
-CONFIG_AIC7XXX_DEBUG_MASK=0
-CONFIG_AIC7XXX_REG_PRETTY_PRINT=y
-CONFIG_SCSI_AIC7XXX_OLD=m
-CONFIG_SCSI_AIC79XX=m
-CONFIG_AIC79XX_CMDS_PER_DEVICE=32
-CONFIG_AIC79XX_RESET_DELAY_MS=15000
-# CONFIG_AIC79XX_BUILD_FIRMWARE is not set
-# CONFIG_AIC79XX_ENABLE_RD_STRM is not set
-CONFIG_AIC79XX_DEBUG_ENABLE=y
-CONFIG_AIC79XX_DEBUG_MASK=0
-CONFIG_AIC79XX_REG_PRETTY_PRINT=y
-# CONFIG_SCSI_ADVANSYS is not set
-CONFIG_SCSI_MEGARAID=m
+# CONFIG_SCSI_AIC7XXX is not set
+# CONFIG_SCSI_AIC7XXX_OLD is not set
+# CONFIG_SCSI_AIC79XX is not set
+# CONFIG_SCSI_MEGARAID is not set
 CONFIG_SCSI_SATA=y
-CONFIG_SCSI_SATA_SVW=m
-CONFIG_SCSI_ATA_PIIX=m
-CONFIG_SCSI_SATA_PROMISE=m
+# CONFIG_SCSI_SATA_SVW is not set
+# CONFIG_SCSI_ATA_PIIX is not set
+# CONFIG_SCSI_SATA_NV is not set
+# CONFIG_SCSI_SATA_PROMISE is not set
+# CONFIG_SCSI_SATA_SX4 is not set
 # CONFIG_SCSI_SATA_SIL is not set
-CONFIG_SCSI_SATA_VIA=m
+# CONFIG_SCSI_SATA_SIS is not set
+# CONFIG_SCSI_SATA_VIA is not set
 CONFIG_SCSI_SATA_VITESSE=y
 # CONFIG_SCSI_BUSLOGIC is not set
-# CONFIG_SCSI_CPQFCTS is not set
 # CONFIG_SCSI_DMX3191D is not set
 # CONFIG_SCSI_EATA is not set
 # CONFIG_SCSI_EATA_PIO is not set
@@ -293,11 +292,8 @@ CONFIG_SCSI_SATA_VITESSE=y
 # CONFIG_SCSI_GDTH is not set
 # CONFIG_SCSI_IPS is not set
 # CONFIG_SCSI_INIA100 is not set
-CONFIG_SCSI_SYM53C8XX_2=m
-CONFIG_SCSI_SYM53C8XX_DMA_ADDRESSING_MODE=1
-CONFIG_SCSI_SYM53C8XX_DEFAULT_TAGS=16
-CONFIG_SCSI_SYM53C8XX_MAX_TAGS=64
-# CONFIG_SCSI_SYM53C8XX_IOMAPPED is not set
+# CONFIG_SCSI_SYM53C8XX_2 is not set
+# CONFIG_SCSI_IPR is not set
 # CONFIG_SCSI_QLOGIC_ISP is not set
 # CONFIG_SCSI_QLOGIC_FC is not set
 CONFIG_SCSI_QLOGIC_1280=y
@@ -306,8 +302,8 @@ CONFIG_SCSI_QLA2XXX=y
 CONFIG_SCSI_QLA22XX=y
 CONFIG_SCSI_QLA2300=y
 CONFIG_SCSI_QLA2322=y
-CONFIG_SCSI_QLA6312=y
-CONFIG_SCSI_QLA6322=y
+# CONFIG_SCSI_QLA6312 is not set
+# CONFIG_SCSI_QLA6322 is not set
 # CONFIG_SCSI_DC395x is not set
 # CONFIG_SCSI_DC390T is not set
 # CONFIG_SCSI_DEBUG is not set
@@ -325,6 +321,9 @@ CONFIG_MD_RAID5=y
 CONFIG_MD_MULTIPATH=y
 CONFIG_BLK_DEV_DM=y
 CONFIG_DM_CRYPT=m
+CONFIG_DM_SNAPSHOT=m
+CONFIG_DM_MIRROR=m
+CONFIG_DM_ZERO=m
 
 #
 # Fusion MPT device support
@@ -333,7 +332,6 @@ CONFIG_FUSION=y
 CONFIG_FUSION_MAX_SGE=40
 CONFIG_FUSION_ISENSE=m
 CONFIG_FUSION_CTL=m
-# CONFIG_FUSION_LAN is not set
 
 #
 # IEEE 1394 (FireWire) support
@@ -343,6 +341,7 @@ CONFIG_FUSION_CTL=m
 #
 # I2O device support
 #
+# CONFIG_I2O is not set
 
 #
 # Networking support
@@ -359,286 +358,117 @@ CONFIG_UNIX=y
 # CONFIG_NET_KEY is not set
 CONFIG_INET=y
 CONFIG_IP_MULTICAST=y
-CONFIG_IP_ADVANCED_ROUTER=y
-CONFIG_IP_MULTIPLE_TABLES=y
-# CONFIG_IP_ROUTE_FWMARK is not set
-CONFIG_IP_ROUTE_NAT=y
-CONFIG_IP_ROUTE_MULTIPATH=y
-CONFIG_IP_ROUTE_TOS=y
-CONFIG_IP_ROUTE_VERBOSE=y
+# CONFIG_IP_ADVANCED_ROUTER is not set
 # CONFIG_IP_PNP is not set
-CONFIG_NET_IPIP=m
-CONFIG_NET_IPGRE=m
-# CONFIG_NET_IPGRE_BROADCAST is not set
-CONFIG_IP_MROUTE=y
-CONFIG_IP_PIMSM_V1=y
-CONFIG_IP_PIMSM_V2=y
-CONFIG_ARPD=y
+# CONFIG_NET_IPIP is not set
+# CONFIG_NET_IPGRE is not set
+# CONFIG_IP_MROUTE is not set
+# CONFIG_ARPD is not set
 CONFIG_SYN_COOKIES=y
-CONFIG_INET_AH=m
-CONFIG_INET_ESP=m
-CONFIG_INET_IPCOMP=m
-
-#
-# IP: Virtual Server Configuration
-#
-# CONFIG_IP_VS is not set
+# CONFIG_INET_AH is not set
+# CONFIG_INET_ESP is not set
+# CONFIG_INET_IPCOMP is not set
 CONFIG_IPV6=m
-CONFIG_IPV6_PRIVACY=y
-CONFIG_INET6_AH=m
-CONFIG_INET6_ESP=m
-CONFIG_INET6_IPCOMP=m
-CONFIG_IPV6_TUNNEL=m
-# CONFIG_DECNET is not set
-CONFIG_BRIDGE=m
-CONFIG_NETFILTER=y
-# CONFIG_NETFILTER_DEBUG is not set
-CONFIG_BRIDGE_NETFILTER=y
-
-#
-# IP: Netfilter Configuration
-#
-CONFIG_IP_NF_CONNTRACK=m
-CONFIG_IP_NF_FTP=m
-CONFIG_IP_NF_IRC=m
-CONFIG_IP_NF_TFTP=m
-CONFIG_IP_NF_AMANDA=m
-CONFIG_IP_NF_QUEUE=m
-CONFIG_IP_NF_IPTABLES=m
-CONFIG_IP_NF_MATCH_LIMIT=m
-CONFIG_IP_NF_MATCH_IPRANGE=m
-CONFIG_IP_NF_MATCH_MAC=m
-CONFIG_IP_NF_MATCH_PKTTYPE=m
-CONFIG_IP_NF_MATCH_MARK=m
-CONFIG_IP_NF_MATCH_MULTIPORT=m
-CONFIG_IP_NF_MATCH_TOS=m
-CONFIG_IP_NF_MATCH_RECENT=m
-CONFIG_IP_NF_MATCH_ECN=m
-CONFIG_IP_NF_MATCH_DSCP=m
-CONFIG_IP_NF_MATCH_AH_ESP=m
-CONFIG_IP_NF_MATCH_LENGTH=m
-CONFIG_IP_NF_MATCH_TTL=m
-CONFIG_IP_NF_MATCH_TCPMSS=m
-CONFIG_IP_NF_MATCH_HELPER=m
-CONFIG_IP_NF_MATCH_STATE=m
-CONFIG_IP_NF_MATCH_CONNTRACK=m
-CONFIG_IP_NF_MATCH_OWNER=m
-CONFIG_IP_NF_MATCH_PHYSDEV=m
-CONFIG_IP_NF_FILTER=m
-CONFIG_IP_NF_TARGET_REJECT=m
-CONFIG_IP_NF_NAT=m
-CONFIG_IP_NF_NAT_NEEDED=y
-CONFIG_IP_NF_TARGET_MASQUERADE=m
-CONFIG_IP_NF_TARGET_REDIRECT=m
-CONFIG_IP_NF_TARGET_NETMAP=m
-CONFIG_IP_NF_TARGET_SAME=m
-# CONFIG_IP_NF_NAT_LOCAL is not set
-CONFIG_IP_NF_NAT_SNMP_BASIC=m
-CONFIG_IP_NF_NAT_IRC=m
-CONFIG_IP_NF_NAT_FTP=m
-CONFIG_IP_NF_NAT_TFTP=m
-CONFIG_IP_NF_NAT_AMANDA=m
-CONFIG_IP_NF_MANGLE=m
-CONFIG_IP_NF_TARGET_TOS=m
-CONFIG_IP_NF_TARGET_ECN=m
-CONFIG_IP_NF_TARGET_DSCP=m
-CONFIG_IP_NF_TARGET_MARK=m
-CONFIG_IP_NF_TARGET_CLASSIFY=m
-CONFIG_IP_NF_TARGET_LOG=m
-CONFIG_IP_NF_TARGET_ULOG=m
-CONFIG_IP_NF_TARGET_TCPMSS=m
-CONFIG_IP_NF_ARPTABLES=m
-CONFIG_IP_NF_ARPFILTER=m
-CONFIG_IP_NF_ARP_MANGLE=m
-# CONFIG_IP_NF_COMPAT_IPCHAINS is not set
-# CONFIG_IP_NF_COMPAT_IPFWADM is not set
-
-#
-# IPv6: Netfilter Configuration
-#
-# CONFIG_IP6_NF_QUEUE is not set
-# CONFIG_IP6_NF_IPTABLES is not set
-
-#
-# Bridge: Netfilter Configuration
-#
-# CONFIG_BRIDGE_NF_EBTABLES is not set
-CONFIG_XFRM=y
-CONFIG_XFRM_USER=m
+# CONFIG_IPV6_PRIVACY is not set
+# CONFIG_INET6_AH is not set
+# CONFIG_INET6_ESP is not set
+# CONFIG_INET6_IPCOMP is not set
+# CONFIG_IPV6_TUNNEL is not set
+# CONFIG_NETFILTER is not set
 
 #
 # SCTP Configuration (EXPERIMENTAL)
 #
 # CONFIG_IP_SCTP is not set
 # CONFIG_ATM is not set
-CONFIG_VLAN_8021Q=m
+# CONFIG_BRIDGE is not set
+# CONFIG_VLAN_8021Q is not set
+# CONFIG_DECNET is not set
 # CONFIG_LLC2 is not set
 # CONFIG_IPX is not set
 # CONFIG_ATALK is not set
 # CONFIG_X25 is not set
 # CONFIG_LAPB is not set
-CONFIG_NET_DIVERT=y
+# 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=y
-CONFIG_NET_SCH_CBQ=m
-CONFIG_NET_SCH_HTB=m
-CONFIG_NET_SCH_HFSC=m
-CONFIG_NET_SCH_CSZ=m
-CONFIG_NET_SCH_PRIO=m
-CONFIG_NET_SCH_RED=m
-CONFIG_NET_SCH_SFQ=m
-CONFIG_NET_SCH_TEQL=m
-CONFIG_NET_SCH_TBF=m
-CONFIG_NET_SCH_GRED=m
-CONFIG_NET_SCH_DSMARK=m
-# CONFIG_NET_SCH_DELAY is not set
-# CONFIG_NET_SCH_INGRESS is not set
-CONFIG_NET_QOS=y
-CONFIG_NET_ESTIMATOR=y
-CONFIG_NET_CLS=y
-CONFIG_NET_CLS_TCINDEX=m
-CONFIG_NET_CLS_ROUTE4=m
-CONFIG_NET_CLS_ROUTE=y
-CONFIG_NET_CLS_FW=m
-CONFIG_NET_CLS_U32=m
-CONFIG_NET_CLS_RSVP=m
-CONFIG_NET_CLS_RSVP6=m
-CONFIG_NET_CLS_POLICE=y
+# CONFIG_NET_SCHED is not set
+# CONFIG_NET_CLS_ROUTE is not set
 
 #
 # Network testing
 #
 # CONFIG_NET_PKTGEN is not set
+CONFIG_NETPOLL=y
+# CONFIG_NETPOLL_RX is not set
+# CONFIG_NETPOLL_TRAP is not set
+CONFIG_NET_POLL_CONTROLLER=y
+# CONFIG_HAMRADIO is not set
+# CONFIG_IRDA is not set
+# CONFIG_BT is not set
 CONFIG_NETDEVICES=y
+# CONFIG_DUMMY is not set
+# CONFIG_BONDING is not set
+# CONFIG_EQUALIZER is not set
+# CONFIG_TUN is not set
+# CONFIG_ETHERTAP is not set
 
 #
 # ARCnet devices
 #
 # CONFIG_ARCNET is not set
-CONFIG_DUMMY=m
-CONFIG_BONDING=m
-CONFIG_EQUALIZER=m
-CONFIG_TUN=m
-# CONFIG_ETHERTAP is not set
 
 #
 # Ethernet (10 or 100Mbit)
 #
-CONFIG_NET_ETHERNET=y
-CONFIG_MII=m
-# CONFIG_HAPPYMEAL is not set
-# CONFIG_SUNGEM is not set
-# CONFIG_NET_VENDOR_3COM is not set
-
-#
-# Tulip family network device support
-#
-CONFIG_NET_TULIP=y
-# CONFIG_DE2104X is not set
-CONFIG_TULIP=m
-# CONFIG_TULIP_MWI is not set
-# CONFIG_TULIP_MMIO is not set
-# CONFIG_TULIP_NAPI is not set
-# CONFIG_DE4X5 is not set
-# CONFIG_WINBOND_840 is not set
-# CONFIG_DM9102 is not set
-# CONFIG_HP100 is not set
-CONFIG_NET_PCI=y
-# CONFIG_PCNET32 is not set
-# CONFIG_AMD8111_ETH is not set
-# CONFIG_ADAPTEC_STARFIRE is not set
-# CONFIG_B44 is not set
-# CONFIG_FORCEDETH is not set
-# CONFIG_DGRS is not set
-CONFIG_EEPRO100=m
-# CONFIG_EEPRO100_PIO is not set
-# CONFIG_E100 is not set
-# CONFIG_FEALNX is not set
-# CONFIG_NATSEMI is not set
-# CONFIG_NE2K_PCI is not set
-# CONFIG_8139CP is not set
-# CONFIG_8139TOO is not set
-# CONFIG_SIS900 is not set
-# CONFIG_EPIC100 is not set
-# CONFIG_SUNDANCE is not set
-# CONFIG_VIA_RHINE is not set
+# CONFIG_NET_ETHERNET is not set
 
 #
 # Ethernet (1000 Mbit)
 #
-CONFIG_ACENIC=m
-# CONFIG_ACENIC_OMIT_TIGON_I is not set
-CONFIG_DL2K=m
-CONFIG_E1000=y
-# CONFIG_E1000_NAPI is not set
-CONFIG_NS83820=m
-CONFIG_HAMACHI=m
-CONFIG_YELLOWFIN=m
-CONFIG_R8169=m
-CONFIG_SIS190=m
-CONFIG_SK98LIN=m
+# CONFIG_ACENIC is not set
+# CONFIG_DL2K is not set
+# CONFIG_E1000 is not set
+# CONFIG_NS83820 is not set
+# CONFIG_HAMACHI is not set
+# CONFIG_YELLOWFIN is not set
+# CONFIG_R8169 is not set
+# CONFIG_SK98LIN is not set
 CONFIG_TIGON3=y
 
 #
 # Ethernet (10000 Mbit)
 #
-CONFIG_IXGB=m
-# CONFIG_IXGB_NAPI is not set
-# CONFIG_FDDI is not set
-# CONFIG_HIPPI is not set
-CONFIG_PPP=m
-CONFIG_PPP_MULTILINK=y
-CONFIG_PPP_FILTER=y
-CONFIG_PPP_ASYNC=m
-CONFIG_PPP_SYNC_TTY=m
-CONFIG_PPP_DEFLATE=m
-# CONFIG_PPP_BSDCOMP is not set
-# CONFIG_PPPOE is not set
-# CONFIG_SLIP is not set
-
-#
-# Wireless LAN (non-hamradio)
-#
-# CONFIG_NET_RADIO is not set
+# CONFIG_IXGB is not set
+CONFIG_S2IO=m
+# CONFIG_S2IO_NAPI is not set
 
 #
 # Token Ring devices
 #
 # CONFIG_TR is not set
-CONFIG_NET_FC=y
-# CONFIG_SHAPER is not set
-CONFIG_NETCONSOLE=y
-
-#
-# Wan interfaces
-#
-# CONFIG_WAN is not set
-
-#
-# Amateur Radio support
-#
-# CONFIG_HAMRADIO is not set
 
 #
-# IrDA (infrared) support
+# Wireless LAN (non-hamradio)
 #
-# CONFIG_IRDA is not set
+# CONFIG_NET_RADIO is not set
 
 #
-# Bluetooth support
+# Wan interfaces
 #
-# CONFIG_BT is not set
-CONFIG_NETPOLL=y
-# CONFIG_NETPOLL_RX is not set
-# CONFIG_NETPOLL_TRAP is not set
-CONFIG_NET_POLL_CONTROLLER=y
+# CONFIG_WAN is not set
+# CONFIG_FDDI is not set
+# CONFIG_HIPPI is not set
+# CONFIG_PPP is not set
+# CONFIG_SLIP is not set
+# CONFIG_NET_FC is not set
+# CONFIG_SHAPER is not set
+CONFIG_NETCONSOLE=y
 
 #
 # ISDN subsystem
@@ -659,7 +489,7 @@ CONFIG_INPUT=y
 # Userland interfaces
 #
 CONFIG_INPUT_MOUSEDEV=y
-CONFIG_INPUT_MOUSEDEV_PSAUX=y
+# CONFIG_INPUT_MOUSEDEV_PSAUX is not set
 CONFIG_INPUT_MOUSEDEV_SCREEN_X=1024
 CONFIG_INPUT_MOUSEDEV_SCREEN_Y=768
 # CONFIG_INPUT_JOYDEV is not set
@@ -672,25 +502,14 @@ CONFIG_INPUT_MOUSEDEV_SCREEN_Y=768
 #
 # CONFIG_GAMEPORT is not set
 CONFIG_SOUND_GAMEPORT=y
-CONFIG_SERIO=y
-CONFIG_SERIO_I8042=y
-# CONFIG_SERIO_SERPORT is not set
-# CONFIG_SERIO_CT82C710 is not set
-# CONFIG_SERIO_PCIPS2 is not set
+# CONFIG_SERIO is not set
+# CONFIG_SERIO_I8042 is not set
 
 #
 # Input Device Drivers
 #
-CONFIG_INPUT_KEYBOARD=y
-CONFIG_KEYBOARD_ATKBD=y
-# CONFIG_KEYBOARD_SUNKBD is not set
-# CONFIG_KEYBOARD_LKKBD is not set
-# CONFIG_KEYBOARD_XTKBD is not set
-# CONFIG_KEYBOARD_NEWTON is not set
-CONFIG_INPUT_MOUSE=y
-CONFIG_MOUSE_PS2=y
-# CONFIG_MOUSE_SERIAL is not set
-# CONFIG_MOUSE_VSXXXAA is not set
+# CONFIG_INPUT_KEYBOARD is not set
+# CONFIG_INPUT_MOUSE is not set
 # CONFIG_INPUT_JOYSTICK is not set
 # CONFIG_INPUT_TOUCHSCREEN is not set
 # CONFIG_INPUT_MISC is not set
@@ -703,28 +522,22 @@ CONFIG_VT_CONSOLE=y
 CONFIG_HW_CONSOLE=y
 CONFIG_SERIAL_NONSTANDARD=y
 # CONFIG_ROCKETPORT is not set
+# CONFIG_CYCLADES is not set
 # CONFIG_SYNCLINK is not set
 # CONFIG_SYNCLINKMP is not set
 # CONFIG_N_HDLC is not set
 # CONFIG_STALDRV is not set
-CONFIG_SGI_L1_SERIAL=y
-CONFIG_SGI_L1_SERIAL_CONSOLE=y
 
 #
 # Serial drivers
 #
-CONFIG_SERIAL_8250=y
-CONFIG_SERIAL_8250_CONSOLE=y
-CONFIG_SERIAL_8250_HCDP=y
-CONFIG_SERIAL_8250_ACPI=y
-CONFIG_SERIAL_8250_NR_UARTS=4
-# CONFIG_SERIAL_8250_EXTENDED is not set
+# CONFIG_SERIAL_8250 is not set
 
 #
 # Non-8250 serial port support
 #
 CONFIG_SERIAL_CORE=y
-CONFIG_SERIAL_CORE_CONSOLE=y
+CONFIG_SERIAL_SGI_L1_CONSOLE=y
 CONFIG_UNIX98_PTYS=y
 CONFIG_LEGACY_PTYS=y
 CONFIG_LEGACY_PTY_COUNT=256
@@ -740,7 +553,6 @@ CONFIG_LEGACY_PTY_COUNT=256
 #
 # CONFIG_WATCHDOG is not set
 # CONFIG_HW_RANDOM is not set
-# CONFIG_GEN_RTC is not set
 CONFIG_EFI_RTC=y
 # CONFIG_DTLK is not set
 # CONFIG_R3964 is not set
@@ -752,6 +564,7 @@ CONFIG_EFI_RTC=y
 # CONFIG_AGP is not set
 # CONFIG_DRM is not set
 CONFIG_RAW_DRIVER=m
+# CONFIG_HPET is not set
 CONFIG_MAX_RAW_DEVS=256
 
 #
@@ -759,6 +572,11 @@ CONFIG_MAX_RAW_DEVS=256
 #
 # CONFIG_I2C is not set
 
+#
+# Dallas's 1-wire bus
+#
+# CONFIG_W1 is not set
+
 #
 # Misc devices
 #
@@ -793,7 +611,102 @@ CONFIG_DUMMY_CONSOLE=y
 #
 # USB support
 #
-# CONFIG_USB is not set
+CONFIG_USB=m
+# CONFIG_USB_DEBUG is not set
+
+#
+# Miscellaneous USB options
+#
+# CONFIG_USB_DEVICEFS is not set
+# CONFIG_USB_BANDWIDTH is not set
+# CONFIG_USB_DYNAMIC_MINORS is not set
+
+#
+# USB Host Controller Drivers
+#
+CONFIG_USB_EHCI_HCD=m
+# CONFIG_USB_EHCI_SPLIT_ISO is not set
+# CONFIG_USB_EHCI_ROOT_HUB_TT is not set
+CONFIG_USB_OHCI_HCD=m
+CONFIG_USB_UHCI_HCD=m
+
+#
+# USB Device Class drivers
+#
+# CONFIG_USB_BLUETOOTH_TTY is not set
+# CONFIG_USB_ACM is not set
+# CONFIG_USB_PRINTER is not set
+# CONFIG_USB_STORAGE is not set
+
+#
+# USB Human Interface Devices (HID)
+#
+CONFIG_USB_HID=m
+CONFIG_USB_HIDINPUT=y
+# CONFIG_HID_FF is not set
+# CONFIG_USB_HIDDEV is not set
+
+#
+# USB HID Boot Protocol drivers
+#
+# CONFIG_USB_KBD is not set
+# CONFIG_USB_MOUSE is not set
+# CONFIG_USB_AIPTEK is not set
+# CONFIG_USB_WACOM is not set
+# CONFIG_USB_KBTAB is not set
+# CONFIG_USB_POWERMATE is not set
+# CONFIG_USB_MTOUCH is not set
+# CONFIG_USB_EGALAX is not set
+# CONFIG_USB_XPAD is not set
+# CONFIG_USB_ATI_REMOTE is not set
+
+#
+# USB Imaging devices
+#
+# CONFIG_USB_MDC800 is not set
+# CONFIG_USB_MICROTEK is not set
+# CONFIG_USB_HPUSBSCSI is not set
+
+#
+# USB Multimedia devices
+#
+# CONFIG_USB_DABUSB is not set
+
+#
+# Video4Linux support is needed for USB Multimedia device support
+#
+
+#
+# USB Network adaptors
+#
+# CONFIG_USB_CATC is not set
+# CONFIG_USB_KAWETH is not set
+# CONFIG_USB_PEGASUS is not set
+# CONFIG_USB_RTL8150 is not set
+# CONFIG_USB_USBNET is not set
+
+#
+# USB port drivers
+#
+
+#
+# USB Serial Converter support
+#
+# CONFIG_USB_SERIAL is not set
+
+#
+# USB Miscellaneous drivers
+#
+# CONFIG_USB_EMI62 is not set
+# CONFIG_USB_EMI26 is not set
+# CONFIG_USB_TIGL is not set
+# CONFIG_USB_AUERSWALD is not set
+# CONFIG_USB_RIO500 is not set
+# CONFIG_USB_LEGOTOWER is not set
+# CONFIG_USB_LCD is not set
+# CONFIG_USB_LED is not set
+# CONFIG_USB_CYTHERM is not set
+# CONFIG_USB_PHIDGETSERVO is not set
 
 #
 # USB Gadget Support
@@ -803,18 +716,23 @@ CONFIG_DUMMY_CONSOLE=y
 #
 # File systems
 #
-CONFIG_EXT2_FS=y
+CONFIG_EXT2_FS=m
 CONFIG_EXT2_FS_XATTR=y
 CONFIG_EXT2_FS_POSIX_ACL=y
-# CONFIG_EXT2_FS_SECURITY is not set
+CONFIG_EXT2_FS_SECURITY=y
 CONFIG_EXT3_FS=y
 CONFIG_EXT3_FS_XATTR=y
 CONFIG_EXT3_FS_POSIX_ACL=y
-# CONFIG_EXT3_FS_SECURITY is not set
+CONFIG_EXT3_FS_SECURITY=y
 CONFIG_JBD=y
 # CONFIG_JBD_DEBUG is not set
 CONFIG_FS_MBCACHE=y
-# CONFIG_REISERFS_FS is not set
+CONFIG_REISERFS_FS=y
+# CONFIG_REISERFS_CHECK is not set
+# CONFIG_REISERFS_PROC_INFO is not set
+CONFIG_REISERFS_FS_XATTR=y
+CONFIG_REISERFS_FS_POSIX_ACL=y
+CONFIG_REISERFS_FS_SECURITY=y
 # CONFIG_JFS_FS is not set
 CONFIG_FS_POSIX_ACL=y
 CONFIG_XFS_FS=y
@@ -828,8 +746,8 @@ CONFIG_QUOTA=y
 # CONFIG_QFMT_V1 is not set
 # CONFIG_QFMT_V2 is not set
 CONFIG_QUOTACTL=y
-CONFIG_AUTOFS_FS=y
-CONFIG_AUTOFS4_FS=y
+CONFIG_AUTOFS_FS=m
+CONFIG_AUTOFS4_FS=m
 
 #
 # CD-ROM/DVD Filesystems
@@ -838,6 +756,7 @@ CONFIG_ISO9660_FS=y
 CONFIG_JOLIET=y
 # CONFIG_ZISOFS is not set
 CONFIG_UDF_FS=m
+CONFIG_UDF_NLS=y
 
 #
 # DOS/FAT/NT Filesystems
@@ -845,6 +764,8 @@ CONFIG_UDF_FS=m
 CONFIG_FAT_FS=y
 # CONFIG_MSDOS_FS is not set
 CONFIG_VFAT_FS=y
+CONFIG_FAT_DEFAULT_CODEPAGE=437
+CONFIG_FAT_DEFAULT_IOCHARSET="iso8859-1"
 # CONFIG_NTFS_FS is not set
 
 #
@@ -852,6 +773,7 @@ CONFIG_VFAT_FS=y
 #
 CONFIG_PROC_FS=y
 CONFIG_PROC_KCORE=y
+CONFIG_SYSFS=y
 # CONFIG_DEVFS_FS is not set
 # CONFIG_DEVPTS_FS_XATTR is not set
 CONFIG_TMPFS=y
@@ -869,6 +791,7 @@ CONFIG_RAMFS=y
 # CONFIG_BEFS_FS is not set
 # CONFIG_BFS_FS is not set
 # CONFIG_EFS_FS is not set
+# CONFIG_JFFS2_COMPRESSION_OPTIONS is not set
 # CONFIG_CRAMFS is not set
 # CONFIG_VXFS_FS is not set
 # CONFIG_HPFS_FS is not set
@@ -879,25 +802,27 @@ CONFIG_RAMFS=y
 #
 # Network File Systems
 #
-CONFIG_NFS_FS=y
+CONFIG_NFS_FS=m
 CONFIG_NFS_V3=y
-# CONFIG_NFS_V4 is not set
-# CONFIG_NFS_DIRECTIO is not set
-CONFIG_NFSD=y
+CONFIG_NFS_V4=y
+CONFIG_NFS_DIRECTIO=y
+CONFIG_NFSD=m
 CONFIG_NFSD_V3=y
-# CONFIG_NFSD_V4 is not set
-# CONFIG_NFSD_TCP is not set
-CONFIG_LOCKD=y
+CONFIG_NFSD_V4=y
+CONFIG_NFSD_TCP=y
+CONFIG_LOCKD=m
 CONFIG_LOCKD_V4=y
-CONFIG_EXPORTFS=y
-CONFIG_SUNRPC=y
-# CONFIG_RPCSEC_GSS_KRB5 is not set
+CONFIG_EXPORTFS=m
+CONFIG_SUNRPC=m
+CONFIG_SUNRPC_GSS=m
+CONFIG_RPCSEC_GSS_KRB5=m
 CONFIG_SMB_FS=m
 # CONFIG_SMB_NLS_DEFAULT is not set
-# CONFIG_CIFS is not set
+CONFIG_CIFS=m
+# CONFIG_CIFS_STATS is not set
+# CONFIG_CIFS_POSIX is not set
 # CONFIG_NCP_FS is not set
 # CONFIG_CODA_FS is not set
-# CONFIG_INTERMEZZO_FS is not set
 # CONFIG_AFS_FS is not set
 
 #
@@ -915,7 +840,6 @@ CONFIG_MSDOS_PARTITION=y
 # CONFIG_SOLARIS_X86_PARTITION is not set
 # CONFIG_UNIXWARE_DISKLABEL is not set
 # CONFIG_LDM_PARTITION is not set
-# CONFIG_NEC98_PARTITION is not set
 CONFIG_SGI_PARTITION=y
 # CONFIG_ULTRIX_PARTITION is not set
 # CONFIG_SUN_PARTITION is not set
@@ -926,7 +850,7 @@ CONFIG_EFI_PARTITION=y
 #
 CONFIG_NLS=y
 CONFIG_NLS_DEFAULT="iso8859-1"
-# CONFIG_NLS_CODEPAGE_437 is not set
+CONFIG_NLS_CODEPAGE_437=y
 # CONFIG_NLS_CODEPAGE_737 is not set
 # CONFIG_NLS_CODEPAGE_775 is not set
 # CONFIG_NLS_CODEPAGE_850 is not set
@@ -949,7 +873,8 @@ CONFIG_NLS_DEFAULT="iso8859-1"
 # CONFIG_NLS_ISO8859_8 is not set
 # CONFIG_NLS_CODEPAGE_1250 is not set
 # CONFIG_NLS_CODEPAGE_1251 is not set
-# CONFIG_NLS_ISO8859_1 is not set
+# CONFIG_NLS_ASCII is not set
+CONFIG_NLS_ISO8859_1=y
 # CONFIG_NLS_ISO8859_2 is not set
 # CONFIG_NLS_ISO8859_3 is not set
 # CONFIG_NLS_ISO8859_4 is not set
@@ -962,12 +887,14 @@ CONFIG_NLS_DEFAULT="iso8859-1"
 # CONFIG_NLS_ISO8859_15 is not set
 # CONFIG_NLS_KOI8_R is not set
 # CONFIG_NLS_KOI8_U is not set
-# CONFIG_NLS_UTF8 is not set
+CONFIG_NLS_UTF8=y
 
 #
 # Library routines
 #
+# CONFIG_CRC_CCITT is not set
 CONFIG_CRC32=y
+# CONFIG_LIBCRC32C is not set
 CONFIG_ZLIB_INFLATE=m
 CONFIG_ZLIB_DEFLATE=m
 
@@ -990,7 +917,7 @@ CONFIG_MAGIC_SYSRQ=y
 # CONFIG_DEBUG_SPINLOCK_SLEEP is not set
 # CONFIG_IA64_DEBUG_CMPXCHG is not set
 # CONFIG_IA64_DEBUG_IRQ is not set
-# CONFIG_DEBUG_INFO is not set
+CONFIG_DEBUG_INFO=y
 CONFIG_SYSVIPC_COMPAT=y
 
 #
@@ -1016,7 +943,9 @@ CONFIG_CRYPTO_DES=m
 # CONFIG_CRYPTO_AES is not set
 # CONFIG_CRYPTO_CAST5 is not set
 # CONFIG_CRYPTO_CAST6 is not set
+# CONFIG_CRYPTO_TEA is not set
 # CONFIG_CRYPTO_ARC4 is not set
 CONFIG_CRYPTO_DEFLATE=m
 # CONFIG_CRYPTO_MICHAEL_MIC is not set
+# CONFIG_CRYPTO_CRC32C is not set
 # CONFIG_CRYPTO_TEST is not set
diff --git a/arch/ia64/configs/zx1_defconfig b/arch/ia64/configs/zx1_defconfig
index c66bb7f4b..e9eda7323 100644
--- a/arch/ia64/configs/zx1_defconfig
+++ b/arch/ia64/configs/zx1_defconfig
@@ -365,7 +365,6 @@ CONFIG_IPV6_SCTP__=y
 # 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
 
 #
diff --git a/arch/ia64/defconfig b/arch/ia64/defconfig
index 6f718fb8e..b63441d85 100644
--- a/arch/ia64/defconfig
+++ b/arch/ia64/defconfig
@@ -18,6 +18,7 @@ CONFIG_SWAP=y
 CONFIG_SYSVIPC=y
 CONFIG_POSIX_MQUEUE=y
 CONFIG_BSD_PROCESS_ACCT=y
+# CONFIG_BSD_PROCESS_ACCT_V3 is not set
 CONFIG_SYSCTL=y
 # CONFIG_AUDIT is not set
 CONFIG_LOG_BUF_SHIFT=16
@@ -26,6 +27,8 @@ CONFIG_IKCONFIG=y
 CONFIG_IKCONFIG_PROC=y
 # CONFIG_EMBEDDED is not set
 CONFIG_KALLSYMS=y
+# CONFIG_KALLSYMS_ALL is not set
+# CONFIG_KALLSYMS_EXTRA_PASS is not set
 CONFIG_FUTEX=y
 CONFIG_EPOLL=y
 CONFIG_IOSCHED_NOOP=y
@@ -66,7 +69,6 @@ CONFIG_MCKINLEY=y
 CONFIG_IA64_PAGE_SIZE_16KB=y
 # CONFIG_IA64_PAGE_SIZE_64KB is not set
 CONFIG_IA64_L1_CACHE_SHIFT=7
-# CONFIG_MCKINLEY_ASTEP_SPECIFIC is not set
 # CONFIG_NUMA is not set
 CONFIG_VIRTUAL_MEM_MAP=y
 # CONFIG_IA64_CYCLONE is not set
@@ -74,6 +76,7 @@ CONFIG_IOSAPIC=y
 CONFIG_FORCE_MAX_ZONEORDER=18
 CONFIG_SMP=y
 CONFIG_NR_CPUS=16
+# CONFIG_HOTPLUG_CPU is not set
 # CONFIG_PREEMPT is not set
 CONFIG_HAVE_DEC_LOCK=y
 CONFIG_IA32_SUPPORT=y
@@ -85,6 +88,7 @@ CONFIG_IA64_PALINFO=y
 # Firmware Drivers
 #
 CONFIG_EFI_VARS=y
+CONFIG_EFI_PCDP=y
 CONFIG_BINFMT_ELF=y
 CONFIG_BINFMT_MISC=y
 
@@ -135,6 +139,7 @@ CONFIG_PCI_NAMES=y
 #
 # Generic Driver Options
 #
+CONFIG_PREVENT_FIRMWARE_BUILD=y
 # CONFIG_FW_LOADER is not set
 # CONFIG_DEBUG_DRIVER is not set
 
@@ -162,7 +167,7 @@ CONFIG_PCI_NAMES=y
 CONFIG_BLK_DEV_LOOP=y
 # CONFIG_BLK_DEV_CRYPTOLOOP is not set
 # CONFIG_BLK_DEV_NBD is not set
-# CONFIG_BLK_DEV_CARMEL is not set
+# CONFIG_BLK_DEV_SX8 is not set
 CONFIG_BLK_DEV_RAM=y
 CONFIG_BLK_DEV_RAM_SIZE=4096
 CONFIG_BLK_DEV_INITRD=y
@@ -176,9 +181,9 @@ CONFIG_BLK_DEV_IDE=y
 #
 # Please see Documentation/ide.txt for help/info on IDE drives
 #
+# CONFIG_BLK_DEV_IDE_SATA is not set
 CONFIG_BLK_DEV_IDEDISK=y
 CONFIG_IDEDISK_MULTI_MODE=y
-# CONFIG_IDEDISK_STROKE is not set
 CONFIG_BLK_DEV_IDECD=y
 # CONFIG_BLK_DEV_IDETAPE is not set
 CONFIG_BLK_DEV_IDEFLOPPY=m
@@ -220,6 +225,7 @@ CONFIG_BLK_DEV_SIIMAGE=y
 # CONFIG_BLK_DEV_SLC90E66 is not set
 # CONFIG_BLK_DEV_TRM290 is not set
 # CONFIG_BLK_DEV_VIA82CXXX is not set
+# CONFIG_IDE_ARM is not set
 CONFIG_BLK_DEV_IDEDMA=y
 # CONFIG_IDEDMA_IVB is not set
 CONFIG_IDEDMA_AUTO=y
@@ -245,7 +251,6 @@ CONFIG_CHR_DEV_SG=y
 # Some SCSI devices (e.g. CD jukebox) support multiple LUNs
 #
 CONFIG_SCSI_MULTI_LUN=y
-CONFIG_SCSI_REPORT_LUNS=y
 CONFIG_SCSI_CONSTANTS=y
 CONFIG_SCSI_LOGGING=y
 
@@ -259,6 +264,7 @@ CONFIG_SCSI_SPI_ATTRS=y
 # SCSI low-level drivers
 #
 # CONFIG_BLK_DEV_3W_XXXX_RAID is not set
+# CONFIG_SCSI_3W_9XXX is not set
 # CONFIG_SCSI_ACARD is not set
 # CONFIG_SCSI_AACRAID is not set
 # CONFIG_SCSI_AIC7XXX is not set
@@ -282,6 +288,7 @@ CONFIG_SCSI_SYM53C8XX_DMA_ADDRESSING_MODE=1
 CONFIG_SCSI_SYM53C8XX_DEFAULT_TAGS=16
 CONFIG_SCSI_SYM53C8XX_MAX_TAGS=64
 # CONFIG_SCSI_SYM53C8XX_IOMAPPED is not set
+# CONFIG_SCSI_IPR is not set
 # CONFIG_SCSI_PCI2000 is not set
 # CONFIG_SCSI_PCI2220I is not set
 # CONFIG_SCSI_QLOGIC_ISP is not set
@@ -311,6 +318,9 @@ CONFIG_MD_RAID5=m
 CONFIG_MD_MULTIPATH=m
 CONFIG_BLK_DEV_DM=m
 # CONFIG_DM_CRYPT is not set
+# CONFIG_DM_SNAPSHOT is not set
+# CONFIG_DM_MIRROR is not set
+# CONFIG_DM_ZERO is not set
 
 #
 # Fusion MPT device support
@@ -328,6 +338,7 @@ CONFIG_FUSION_MAX_SGE=40
 #
 # I2O device support
 #
+# CONFIG_I2O is not set
 
 #
 # Networking support
@@ -391,13 +402,13 @@ CONFIG_IP_NF_ARPTABLES=y
 # 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
+# CONFIG_NET_CLS_ROUTE is not set
 
 #
 # Network testing
@@ -452,6 +463,7 @@ CONFIG_EEPRO100=y
 # CONFIG_EPIC100 is not set
 # CONFIG_SUNDANCE is not set
 # CONFIG_VIA_RHINE is not set
+# CONFIG_VIA_VELOCITY is not set
 
 #
 # Ethernet (1000 Mbit)
@@ -555,7 +567,6 @@ CONFIG_HW_CONSOLE=y
 #
 CONFIG_SERIAL_8250=y
 CONFIG_SERIAL_8250_CONSOLE=y
-CONFIG_SERIAL_8250_HCDP=y
 CONFIG_SERIAL_8250_ACPI=y
 CONFIG_SERIAL_8250_NR_UARTS=4
 # CONFIG_SERIAL_8250_EXTENDED is not set
@@ -573,7 +584,12 @@ CONFIG_LEGACY_PTY_COUNT=256
 #
 # IPMI
 #
-# CONFIG_IPMI_HANDLER is not set
+CONFIG_IPMI_HANDLER=m
+CONFIG_IPMI_PANIC_EVENT=y
+CONFIG_IPMI_PANIC_STRING=y
+CONFIG_IPMI_DEVICE_INTERFACE=m
+CONFIG_IPMI_SI=m
+CONFIG_IPMI_WATCHDOG=m
 
 #
 # Watchdog Cards
@@ -599,6 +615,7 @@ CONFIG_DRM_RADEON=m
 # CONFIG_DRM_MGA is not set
 # CONFIG_DRM_SIS is not set
 # CONFIG_RAW_DRIVER is not set
+# CONFIG_HPET is not set
 
 #
 # I2C support
@@ -640,17 +657,21 @@ CONFIG_I2C_ALGOBIT=y
 #
 # CONFIG_I2C_SENSOR is not set
 # CONFIG_SENSORS_ADM1021 is not set
+# CONFIG_SENSORS_ADM1025 is not set
+# CONFIG_SENSORS_ADM1031 is not set
 # CONFIG_SENSORS_ASB100 is not set
 # CONFIG_SENSORS_DS1621 is not set
 # CONFIG_SENSORS_FSCHER is not set
 # CONFIG_SENSORS_GL518SM is not set
 # CONFIG_SENSORS_IT87 is not set
 # CONFIG_SENSORS_LM75 is not set
+# CONFIG_SENSORS_LM77 is not set
 # CONFIG_SENSORS_LM78 is not set
 # CONFIG_SENSORS_LM80 is not set
 # CONFIG_SENSORS_LM83 is not set
 # CONFIG_SENSORS_LM85 is not set
 # CONFIG_SENSORS_LM90 is not set
+# CONFIG_SENSORS_MAX1619 is not set
 # CONFIG_SENSORS_VIA686A is not set
 # CONFIG_SENSORS_W83781D is not set
 # CONFIG_SENSORS_W83L785TS is not set
@@ -662,11 +683,17 @@ CONFIG_I2C_ALGOBIT=y
 # CONFIG_SENSORS_EEPROM is not set
 # CONFIG_SENSORS_PCF8574 is not set
 # CONFIG_SENSORS_PCF8591 is not set
+# CONFIG_SENSORS_RTC8564 is not set
 # CONFIG_I2C_DEBUG_CORE is not set
 # CONFIG_I2C_DEBUG_ALGO is not set
 # CONFIG_I2C_DEBUG_BUS is not set
 # CONFIG_I2C_DEBUG_CHIP is not set
 
+#
+# Dallas's 1-wire bus
+#
+# CONFIG_W1 is not set
+
 #
 # Misc devices
 #
@@ -688,8 +715,10 @@ CONFIG_FB=y
 # CONFIG_FB_CIRRUS is not set
 # CONFIG_FB_PM2 is not set
 # CONFIG_FB_CYBER2000 is not set
+# CONFIG_FB_ASILIANT is not set
 # CONFIG_FB_IMSTT is not set
 CONFIG_FB_RIVA=m
+CONFIG_FB_RIVA_I2C=y
 # CONFIG_FB_MATROX is not set
 # CONFIG_FB_RADEON_OLD is not set
 CONFIG_FB_RADEON=m
@@ -713,7 +742,6 @@ CONFIG_VGA_CONSOLE=y
 # CONFIG_MDA_CONSOLE is not set
 CONFIG_DUMMY_CONSOLE=y
 CONFIG_FRAMEBUFFER_CONSOLE=y
-CONFIG_PCI_CONSOLE=y
 # CONFIG_FONTS is not set
 CONFIG_FONT_8x8=y
 CONFIG_FONT_8x16=y
@@ -852,6 +880,7 @@ CONFIG_USB_HIDDEV=y
 # CONFIG_USB_KBTAB is not set
 # CONFIG_USB_POWERMATE is not set
 # CONFIG_USB_MTOUCH is not set
+# CONFIG_USB_EGALAX is not set
 # CONFIG_USB_XPAD is not set
 # CONFIG_USB_ATI_REMOTE is not set
 
@@ -901,6 +930,7 @@ CONFIG_USB_HIDDEV=y
 # CONFIG_USB_LCD is not set
 # CONFIG_USB_LED is not set
 # CONFIG_USB_CYTHERM is not set
+# CONFIG_USB_PHIDGETSERVO is not set
 # CONFIG_USB_TEST is not set
 
 #
@@ -938,6 +968,7 @@ CONFIG_ISO9660_FS=y
 CONFIG_JOLIET=y
 # CONFIG_ZISOFS is not set
 CONFIG_UDF_FS=y
+CONFIG_UDF_NLS=y
 
 #
 # DOS/FAT/NT Filesystems
@@ -945,6 +976,8 @@ CONFIG_UDF_FS=y
 CONFIG_FAT_FS=y
 CONFIG_MSDOS_FS=y
 CONFIG_VFAT_FS=y
+CONFIG_FAT_DEFAULT_CODEPAGE=437
+CONFIG_FAT_DEFAULT_IOCHARSET="iso8859-1"
 # CONFIG_NTFS_FS is not set
 
 #
@@ -970,6 +1003,7 @@ CONFIG_RAMFS=y
 # CONFIG_BEFS_FS is not set
 # CONFIG_BFS_FS is not set
 # CONFIG_EFS_FS is not set
+# CONFIG_JFFS2_COMPRESSION_OPTIONS is not set
 # CONFIG_CRAMFS is not set
 # CONFIG_VXFS_FS is not set
 # CONFIG_HPFS_FS is not set
@@ -998,7 +1032,6 @@ CONFIG_RPCSEC_GSS_KRB5=y
 # CONFIG_CIFS is not set
 # CONFIG_NCP_FS is not set
 # CONFIG_CODA_FS is not set
-# CONFIG_INTERMEZZO_FS is not set
 # CONFIG_AFS_FS is not set
 
 #
@@ -1016,7 +1049,6 @@ CONFIG_MSDOS_PARTITION=y
 # CONFIG_SOLARIS_X86_PARTITION is not set
 # CONFIG_UNIXWARE_DISKLABEL is not set
 # CONFIG_LDM_PARTITION is not set
-# CONFIG_NEC98_PARTITION is not set
 # CONFIG_SGI_PARTITION is not set
 # CONFIG_ULTRIX_PARTITION is not set
 # CONFIG_SUN_PARTITION is not set
@@ -1028,46 +1060,48 @@ CONFIG_EFI_PARTITION=y
 CONFIG_NLS=y
 CONFIG_NLS_DEFAULT="iso8859-1"
 CONFIG_NLS_CODEPAGE_437=y
-CONFIG_NLS_CODEPAGE_737=y
-CONFIG_NLS_CODEPAGE_775=y
-CONFIG_NLS_CODEPAGE_850=y
-CONFIG_NLS_CODEPAGE_852=y
-CONFIG_NLS_CODEPAGE_855=y
-CONFIG_NLS_CODEPAGE_857=y
-CONFIG_NLS_CODEPAGE_860=y
-CONFIG_NLS_CODEPAGE_861=y
-CONFIG_NLS_CODEPAGE_862=y
-CONFIG_NLS_CODEPAGE_863=y
-CONFIG_NLS_CODEPAGE_864=y
-CONFIG_NLS_CODEPAGE_865=y
-CONFIG_NLS_CODEPAGE_866=y
-CONFIG_NLS_CODEPAGE_869=y
-CONFIG_NLS_CODEPAGE_936=y
-CONFIG_NLS_CODEPAGE_950=y
-CONFIG_NLS_CODEPAGE_932=y
-CONFIG_NLS_CODEPAGE_949=y
-CONFIG_NLS_CODEPAGE_874=y
-CONFIG_NLS_ISO8859_8=y
+# CONFIG_NLS_CODEPAGE_737 is not set
+# CONFIG_NLS_CODEPAGE_775 is not set
+# CONFIG_NLS_CODEPAGE_850 is not set
+# CONFIG_NLS_CODEPAGE_852 is not set
+# CONFIG_NLS_CODEPAGE_855 is not set
+# CONFIG_NLS_CODEPAGE_857 is not set
+# CONFIG_NLS_CODEPAGE_860 is not set
+# CONFIG_NLS_CODEPAGE_861 is not set
+# CONFIG_NLS_CODEPAGE_862 is not set
+# CONFIG_NLS_CODEPAGE_863 is not set
+# CONFIG_NLS_CODEPAGE_864 is not set
+# CONFIG_NLS_CODEPAGE_865 is not set
+# CONFIG_NLS_CODEPAGE_866 is not set
+# CONFIG_NLS_CODEPAGE_869 is not set
+# CONFIG_NLS_CODEPAGE_936 is not set
+# CONFIG_NLS_CODEPAGE_950 is not set
+# CONFIG_NLS_CODEPAGE_932 is not set
+# CONFIG_NLS_CODEPAGE_949 is not set
+# CONFIG_NLS_CODEPAGE_874 is not set
+# CONFIG_NLS_ISO8859_8 is not set
 # CONFIG_NLS_CODEPAGE_1250 is not set
-CONFIG_NLS_CODEPAGE_1251=y
+# CONFIG_NLS_CODEPAGE_1251 is not set
+CONFIG_NLS_ASCII=y
 CONFIG_NLS_ISO8859_1=y
-CONFIG_NLS_ISO8859_2=y
-CONFIG_NLS_ISO8859_3=y
-CONFIG_NLS_ISO8859_4=y
-CONFIG_NLS_ISO8859_5=y
-CONFIG_NLS_ISO8859_6=y
-CONFIG_NLS_ISO8859_7=y
-CONFIG_NLS_ISO8859_9=y
-CONFIG_NLS_ISO8859_13=y
-CONFIG_NLS_ISO8859_14=y
-CONFIG_NLS_ISO8859_15=y
-CONFIG_NLS_KOI8_R=y
-CONFIG_NLS_KOI8_U=y
-CONFIG_NLS_UTF8=y
+# CONFIG_NLS_ISO8859_2 is not set
+# CONFIG_NLS_ISO8859_3 is not set
+# CONFIG_NLS_ISO8859_4 is not set
+# CONFIG_NLS_ISO8859_5 is not set
+# CONFIG_NLS_ISO8859_6 is not set
+# CONFIG_NLS_ISO8859_7 is not set
+# CONFIG_NLS_ISO8859_9 is not set
+# CONFIG_NLS_ISO8859_13 is not set
+# CONFIG_NLS_ISO8859_14 is not set
+# CONFIG_NLS_ISO8859_15 is not set
+# CONFIG_NLS_KOI8_R is not set
+# CONFIG_NLS_KOI8_U is not set
+# CONFIG_NLS_UTF8 is not set
 
 #
 # Library routines
 #
+# CONFIG_CRC_CCITT is not set
 CONFIG_CRC32=y
 # CONFIG_LIBCRC32C is not set
 
@@ -1083,7 +1117,7 @@ CONFIG_IA64_GRANULE_16MB=y
 # CONFIG_IA64_GRANULE_64MB is not set
 CONFIG_DEBUG_KERNEL=y
 CONFIG_IA64_PRINT_HAZARDS=y
-CONFIG_DISABLE_VHPT=y
+# CONFIG_DISABLE_VHPT is not set
 CONFIG_MAGIC_SYSRQ=y
 # CONFIG_IA64_EARLY_PRINTK_VGA is not set
 # CONFIG_DEBUG_SLAB is not set
@@ -1117,6 +1151,7 @@ CONFIG_CRYPTO_DES=y
 # CONFIG_CRYPTO_AES is not set
 # CONFIG_CRYPTO_CAST5 is not set
 # CONFIG_CRYPTO_CAST6 is not set
+# CONFIG_CRYPTO_TEA is not set
 # CONFIG_CRYPTO_ARC4 is not set
 # CONFIG_CRYPTO_DEFLATE is not set
 # CONFIG_CRYPTO_MICHAEL_MIC is not set
diff --git a/arch/ia64/hp/common/sba_iommu.c b/arch/ia64/hp/common/sba_iommu.c
index 3badcdf8e..5333e6190 100644
--- a/arch/ia64/hp/common/sba_iommu.c
+++ b/arch/ia64/hp/common/sba_iommu.c
@@ -469,6 +469,14 @@ sba_search_bitmap(struct ioc *ioc, unsigned long bits_wanted)
 	ASSERT(((unsigned long) ioc->res_hint & (sizeof(unsigned long) - 1UL)) == 0);
 	ASSERT(res_ptr < res_end);
 
+	/*
+	 * N.B.  REO/Grande defect AR2305 can cause TLB fetch timeouts
+	 * if a TLB entry is purged while in use.  sba_mark_invalid()
+	 * purges IOTLB entries in power-of-two sizes, so we also
+	 * allocate IOVA space in power-of-two sizes.
+	 */
+	bits_wanted = 1UL << get_iovp_order(bits_wanted << PAGE_SHIFT);
+
 	if (likely(bits_wanted == 1)) {
 		unsigned int bitshiftcnt;
 		for(; res_ptr < res_end ; res_ptr++) {
@@ -675,6 +683,8 @@ sba_free_range(struct ioc *ioc, dma_addr_t iova, size_t size)
 	int bits_not_wanted = size >> iovp_shift;
 	unsigned long m;
 
+	/* Round up to power-of-two size: see AR2305 note above */
+	bits_not_wanted = 1UL << get_iovp_order(bits_not_wanted << PAGE_SHIFT);
 	for (; bits_not_wanted > 0 ; res_ptr++) {
 		
 		if (unlikely(bits_not_wanted > BITS_PER_LONG)) {
diff --git a/arch/ia64/hp/sim/hpsim_irq.c b/arch/ia64/hp/sim/hpsim_irq.c
index 77dd1302f..c0d25a2a3 100644
--- a/arch/ia64/hp/sim/hpsim_irq.c
+++ b/arch/ia64/hp/sim/hpsim_irq.c
@@ -21,6 +21,11 @@ hpsim_irq_noop (unsigned int irq)
 {
 }
 
+static void
+hpsim_set_affinity_noop (unsigned int a, cpumask_t b)
+{
+}
+
 static struct hw_interrupt_type irq_type_hp_sim = {
 	.typename =	"hpsim",
 	.startup =	hpsim_irq_startup,
@@ -29,7 +34,7 @@ static struct hw_interrupt_type irq_type_hp_sim = {
 	.disable =	hpsim_irq_noop,
 	.ack =		hpsim_irq_noop,
 	.end =		hpsim_irq_noop,
-	.set_affinity =	(void (*)(unsigned int, unsigned long)) hpsim_irq_noop,
+	.set_affinity =	hpsim_set_affinity_noop,
 };
 
 void __init
diff --git a/arch/ia64/hp/sim/simeth.c b/arch/ia64/hp/sim/simeth.c
index 93f4d190c..3c9c3072b 100644
--- a/arch/ia64/hp/sim/simeth.c
+++ b/arch/ia64/hp/sim/simeth.c
@@ -527,13 +527,4 @@ set_multicast_list(struct net_device *dev)
 	printk(KERN_WARNING "%s: set_multicast_list called\n", dev->name);
 }
 
-#ifdef CONFIG_NET_FASTROUTE
-static int
-simeth_accept_fastpath(struct net_device *dev, struct dst_entry *dst)
-{
-	printk(KERN_WARNING "%s: simeth_accept_fastpath called\n", dev->name);
-	return -1;
-}
-#endif
-
 __initcall(simeth_probe);
diff --git a/arch/ia64/ia32/binfmt_elf32.c b/arch/ia64/ia32/binfmt_elf32.c
index fcd84c5af..a6bc522b8 100644
--- a/arch/ia64/ia32/binfmt_elf32.c
+++ b/arch/ia64/ia32/binfmt_elf32.c
@@ -14,6 +14,7 @@
 #include <linux/types.h>
 #include <linux/mm.h>
 #include <linux/security.h>
+#include <linux/vs_memory.h>
 
 #include <asm/param.h>
 #include <asm/signal.h>
@@ -41,6 +42,8 @@ static void elf32_set_personality (void);
 #undef SET_PERSONALITY
 #define SET_PERSONALITY(ex, ibcs2)	elf32_set_personality()
 
+#define elf_read_implies_exec(ex, have_pt_gnu_stack)	(!(have_pt_gnu_stack))
+
 /* Ugly but avoids duplication */
 #include "../../../fs/binfmt_elf.c"
 
@@ -202,6 +205,10 @@ ia32_setup_arg_pages (struct linux_binprm *bprm, int executable_stack)
 	}
 	up_write(&current->mm->mmap_sem);
 
+	/* Can't do it in ia64_elf32_init(). Needs to be done before calls to
+	   elf32_map() */
+	current->thread.ppl = ia32_init_pp_list();
+
 	return 0;
 }
 
@@ -211,7 +218,6 @@ elf32_set_personality (void)
 	set_personality(PER_LINUX32);
 	current->thread.map_base  = IA32_PAGE_OFFSET/3;
 	current->thread.task_size = IA32_PAGE_OFFSET;	/* use what Linux/x86 uses... */
-	current->thread.flags |= IA64_THREAD_XSTACK;	/* data must be executable */
 	set_fs(USER_DS);				/* set addr limit for new TASK_SIZE */
 }
 
diff --git a/arch/ia64/ia32/ia32_entry.S b/arch/ia64/ia32/ia32_entry.S
index 4ee1e551f..fa3ac962a 100644
--- a/arch/ia64/ia32/ia32_entry.S
+++ b/arch/ia64/ia32/ia32_entry.S
@@ -32,7 +32,7 @@ ENTRY(ia32_execve)
 END(ia32_execve)
 
 ENTRY(ia32_clone)
-	.prologue ASM_UNW_PRLG_RP|ASM_UNW_PRLG_PFS, ASM_UNW_PRLG_GRSAVE(2)
+	.prologue ASM_UNW_PRLG_RP|ASM_UNW_PRLG_PFS, ASM_UNW_PRLG_GRSAVE(5)
 	alloc r16=ar.pfs,5,2,6,0
 	DO_SAVE_SWITCH_STACK
 	mov loc0=rp
@@ -110,7 +110,9 @@ GLOBAL_ENTRY(ia32_ret_from_clone)
 	ld4 r2=[r2]
 	;;
 	mov r8=0
-	tbit.nz p6,p0=r2,TIF_SYSCALL_TRACE
+	and r2=_TIF_SYSCALL_TRACEAUDIT,r2
+	;;
+	cmp.ne p6,p0=r2,r0
 (p6)	br.cond.spnt .ia32_strace_check_retval
 	;;					// prevent RAW on r8
 END(ia32_ret_from_clone)
@@ -142,7 +144,7 @@ GLOBAL_ENTRY(ia32_trace_syscall)
 	adds r2=IA64_PT_REGS_R8_OFFSET+16,sp
 	;;
 	st8 [r2]=r3				// initialize return code to -ENOSYS
-	br.call.sptk.few rp=syscall_trace	// give parent a chance to catch syscall args
+	br.call.sptk.few rp=syscall_trace_enter	// give parent a chance to catch syscall args
 .ret2:	// Need to reload arguments (they may be changed by the tracing process)
 	adds r2=IA64_PT_REGS_R1_OFFSET+16,sp	// r2 = &pt_regs.r1
 	adds r3=IA64_PT_REGS_R13_OFFSET+16,sp	// r3 = &pt_regs.r13
@@ -170,7 +172,7 @@ GLOBAL_ENTRY(ia32_trace_syscall)
 	adds r2=IA64_PT_REGS_R8_OFFSET+16,sp	// r2 = &pt_regs.r8
 	;;
 	st8.spill [r2]=r8			// store return value in slot for r8
-	br.call.sptk.few rp=syscall_trace	// give parent a chance to catch return value
+	br.call.sptk.few rp=syscall_trace_leave	// give parent a chance to catch return value
 .ret4:	alloc r2=ar.pfs,0,0,0,0			// drop the syscall argument frame
 	br.cond.sptk.many ia64_leave_kernel
 END(ia32_trace_syscall)
@@ -349,7 +351,7 @@ ia32_syscall_table:
 	data8 sys_setfsuid	/* 16-bit version */
 	data8 sys_setfsgid	/* 16-bit version */
 	data8 sys_llseek	  /* 140 */
-	data8 sys32_getdents
+	data8 compat_sys_getdents
 	data8 compat_sys_select
 	data8 sys_flock
 	data8 sys32_msync
@@ -371,7 +373,7 @@ ia32_syscall_table:
 	data8 sys_sched_get_priority_min	 /* 160 */
 	data8 sys32_sched_rr_get_interval
 	data8 compat_sys_nanosleep
-	data8 sys_mremap
+	data8 sys32_mremap
 	data8 sys_setresuid	/* 16-bit version */
 	data8 sys32_getresuid16	/* 16-bit version */	  /* 165 */
 	data8 sys_ni_syscall	/* vm86 */
@@ -428,7 +430,7 @@ ia32_syscall_table:
 	data8 sys_pivot_root
 	data8 sys_mincore
 	data8 sys_madvise
-	data8 sys_getdents64	  /* 220 */
+	data8 compat_sys_getdents64	  /* 220 */
 	data8 compat_sys_fcntl64
 	data8 sys_ni_syscall		/* reserved for TUX */
 	data8 sys_ni_syscall		/* reserved for Security */
@@ -476,8 +478,8 @@ ia32_syscall_table:
  	data8 compat_clock_gettime /* 265 */
  	data8 compat_clock_getres
  	data8 compat_clock_nanosleep
-	data8 sys_statfs64
-	data8 sys_fstatfs64
+	data8 compat_statfs64
+	data8 compat_fstatfs64
  	data8 sys_tgkill	/* 270 */
  	data8 compat_sys_utimes
  	data8 sys32_fadvise64_64
diff --git a/arch/ia64/ia32/ia32_support.c b/arch/ia64/ia32/ia32_support.c
index c56fd9f3c..4b43f1753 100644
--- a/arch/ia64/ia32/ia32_support.c
+++ b/arch/ia64/ia32/ia32_support.c
@@ -218,6 +218,18 @@ ia32_init (void)
 	ia32_exec_domain.signal_map = default_exec_domain.signal_map;
 	ia32_exec_domain.signal_invmap = default_exec_domain.signal_invmap;
 	register_exec_domain(&ia32_exec_domain);
+
+#if PAGE_SHIFT > IA32_PAGE_SHIFT
+	{
+		extern kmem_cache_t *partial_page_cachep;
+
+		partial_page_cachep = kmem_cache_create("partial_page_cache",
+							sizeof(struct partial_page), 0, 0,
+							NULL, NULL);
+		if (!partial_page_cachep)
+			panic("Cannot create partial page SLAB cache");
+	}
+#endif
 	return 0;
 }
 
diff --git a/arch/ia64/ia32/ia32priv.h b/arch/ia64/ia32/ia32priv.h
index e6f95af15..ba875e0bb 100644
--- a/arch/ia64/ia32/ia32priv.h
+++ b/arch/ia64/ia32/ia32priv.h
@@ -1,5 +1,5 @@
-#ifndef _ASM_IA64_IA32_H
-#define _ASM_IA64_IA32_H
+#ifndef _ASM_IA64_IA32_PRIV_H
+#define _ASM_IA64_IA32_PRIV_H
 
 #include <linux/config.h>
 
@@ -9,6 +9,7 @@
 
 #include <linux/binfmts.h>
 #include <linux/compat.h>
+#include <linux/rbtree.h>
 
 #include <asm/processor.h>
 
@@ -16,12 +17,39 @@
  * 32 bit structures for IA32 support.
  */
 
-#define IA32_PAGE_SHIFT		12	/* 4KB pages */
 #define IA32_PAGE_SIZE		(1UL << IA32_PAGE_SHIFT)
 #define IA32_PAGE_MASK		(~(IA32_PAGE_SIZE - 1))
 #define IA32_PAGE_ALIGN(addr)	(((addr) + IA32_PAGE_SIZE - 1) & IA32_PAGE_MASK)
 #define IA32_CLOCKS_PER_SEC	100	/* Cast in stone for IA32 Linux */
 
+/*
+ * partially mapped pages provide precise accounting of which 4k sub pages
+ * are mapped and which ones are not, thereby improving IA-32 compatibility.
+ */
+struct partial_page {
+	struct partial_page	*next; /* linked list, sorted by address */
+	struct rb_node		pp_rb;
+	/* 64K is the largest "normal" page supported by ia64 ABI. So 4K*32
+	 * should suffice.*/
+	unsigned int		bitmap;
+	unsigned int		base;
+};
+
+struct partial_page_list {
+	struct partial_page	*pp_head; /* list head, points to the lowest
+					   * addressed partial page */
+	struct rb_root		ppl_rb;
+	struct partial_page	*pp_hint; /* pp_hint->next is the last
+					   * accessed partial page */
+	atomic_t		pp_count; /* reference count */
+};
+
+#if PAGE_SHIFT > IA32_PAGE_SHIFT
+struct partial_page_list* ia32_init_pp_list (void);
+#else
+# define ia32_init_pp_list()	0
+#endif
+
 /* sigcontext.h */
 /*
  * As documented in the iBCS2 standard..
@@ -528,4 +556,4 @@ extern int save_ia32_fpxstate (struct task_struct *tsk, struct ia32_user_fxsr_st
 
 #endif /* !CONFIG_IA32_SUPPORT */
 
-#endif /* _ASM_IA64_IA32_H */
+#endif /* _ASM_IA64_IA32_PRIV_H */
diff --git a/arch/ia64/ia32/sys_ia32.c b/arch/ia64/ia32/sys_ia32.c
index 8994c9d11..a97402c01 100644
--- a/arch/ia64/ia32/sys_ia32.c
+++ b/arch/ia64/ia32/sys_ia32.c
@@ -8,6 +8,7 @@
  * Copyright (C) 1997		David S. Miller (davem@caip.rutgers.edu)
  * Copyright (C) 2000-2003 Hewlett-Packard Co
  *	David Mosberger-Tang <davidm@hpl.hp.com>
+ * Copyright (C) 2004		Gordon Jin <gordon.jin@intel.com>
  *
  * These routines maintain argument size conversion between 32bit and 64bit
  * environment.
@@ -48,6 +49,7 @@
 #include <linux/ipc.h>
 #include <linux/compat.h>
 #include <linux/vfs.h>
+#include <linux/mman.h>
 
 #include <asm/intrinsics.h>
 #include <asm/semaphore.h>
@@ -250,6 +252,508 @@ mmap_subpage (struct file *file, unsigned long start, unsigned long end, int pro
 	return ret;
 }
 
+/* SLAB cache for partial_page structures */
+kmem_cache_t *partial_page_cachep;
+
+/*
+ * init partial_page_list.
+ * return 0 means kmalloc fail.
+ */
+struct partial_page_list*
+ia32_init_pp_list(void)
+{
+	struct partial_page_list *p;
+
+	if ((p = kmalloc(sizeof(*p), GFP_KERNEL)) == NULL)
+		return p;
+	p->pp_head = 0;
+	p->ppl_rb = RB_ROOT;
+	p->pp_hint = 0;
+	atomic_set(&p->pp_count, 1);
+	return p;
+}
+
+/*
+ * Search for the partial page with @start in partial page list @ppl.
+ * If finds the partial page, return the found partial page.
+ * Else, return 0 and provide @pprev, @rb_link, @rb_parent to
+ * be used by later __ia32_insert_pp().
+ */
+static struct partial_page *
+__ia32_find_pp(struct partial_page_list *ppl, unsigned int start,
+	struct partial_page **pprev, struct rb_node ***rb_link,
+	struct rb_node **rb_parent)
+{
+	struct partial_page *pp;
+	struct rb_node **__rb_link, *__rb_parent, *rb_prev;
+
+	pp = ppl->pp_hint;
+	if (pp && pp->base == start)
+		return pp;
+
+	__rb_link = &ppl->ppl_rb.rb_node;
+	rb_prev = __rb_parent = NULL;
+
+	while (*__rb_link) {
+		__rb_parent = *__rb_link;
+		pp = rb_entry(__rb_parent, struct partial_page, pp_rb);
+
+		if (pp->base == start) {
+			ppl->pp_hint = pp;
+			return pp;
+		} else if (pp->base < start) {
+			rb_prev = __rb_parent;
+			__rb_link = &__rb_parent->rb_right;
+		} else {
+			__rb_link = &__rb_parent->rb_left;
+		}
+	}
+
+	*rb_link = __rb_link;
+	*rb_parent = __rb_parent;
+	*pprev = NULL;
+	if (rb_prev)
+		*pprev = rb_entry(rb_prev, struct partial_page, pp_rb);
+	return NULL;
+}
+
+/*
+ * insert @pp into @ppl.
+ */
+static void
+__ia32_insert_pp(struct partial_page_list *ppl, struct partial_page *pp,
+	 struct partial_page *prev, struct rb_node **rb_link,
+	struct rb_node *rb_parent)
+{
+	/* link list */
+	if (prev) {
+		pp->next = prev->next;
+		prev->next = pp;
+	} else {
+		ppl->pp_head = pp;
+		if (rb_parent)
+			pp->next = rb_entry(rb_parent,
+				struct partial_page, pp_rb);
+		else
+			pp->next = NULL;
+	}
+
+	/* link rb */
+	rb_link_node(&pp->pp_rb, rb_parent, rb_link);
+	rb_insert_color(&pp->pp_rb, &ppl->ppl_rb);
+
+	ppl->pp_hint = pp;
+}
+
+/*
+ * delete @pp from partial page list @ppl.
+ */
+static void
+__ia32_delete_pp(struct partial_page_list *ppl, struct partial_page *pp,
+	struct partial_page *prev)
+{
+	if (prev) {
+		prev->next = pp->next;
+		if (ppl->pp_hint == pp)
+			ppl->pp_hint = prev;
+	} else {
+		ppl->pp_head = pp->next;
+		if (ppl->pp_hint == pp)
+			ppl->pp_hint = pp->next;
+	}
+	rb_erase(&pp->pp_rb, &ppl->ppl_rb);
+	kmem_cache_free(partial_page_cachep, pp);
+}
+
+static struct partial_page *
+__pp_prev(struct partial_page *pp)
+{
+	struct rb_node *prev = rb_prev(&pp->pp_rb);
+	if (prev)
+		return rb_entry(prev, struct partial_page, pp_rb);
+	else
+		return NULL;
+}
+
+/*
+ * Delete partial pages with address between @start and @end.
+ * @start and @end are page aligned.
+ */
+static void
+__ia32_delete_pp_range(unsigned int start, unsigned int end)
+{
+	struct partial_page *pp, *prev;
+	struct rb_node **rb_link, *rb_parent;
+
+	if (start >= end)
+		return;
+
+	pp = __ia32_find_pp(current->thread.ppl, start, &prev,
+					&rb_link, &rb_parent);
+	if (pp)
+		prev = __pp_prev(pp);
+	else {
+		if (prev)
+			pp = prev->next;
+		else
+			pp = current->thread.ppl->pp_head;
+	}
+
+	while (pp && pp->base < end) {
+		struct partial_page *tmp = pp->next;
+		__ia32_delete_pp(current->thread.ppl, pp, prev);
+		pp = tmp;
+	}
+}
+
+/*
+ * Set the range between @start and @end in bitmap.
+ * @start and @end should be IA32 page aligned and in the same IA64 page.
+ */
+static int
+__ia32_set_pp(unsigned int start, unsigned int end, int flags)
+{
+	struct partial_page *pp, *prev;
+	struct rb_node ** rb_link, *rb_parent;
+	unsigned int pstart, start_bit, end_bit, i;
+
+	pstart = PAGE_START(start);
+	start_bit = (start % PAGE_SIZE) / IA32_PAGE_SIZE;
+	end_bit = (end % PAGE_SIZE) / IA32_PAGE_SIZE;
+	if (end_bit == 0)
+		end_bit = PAGE_SIZE / IA32_PAGE_SIZE;
+	pp = __ia32_find_pp(current->thread.ppl, pstart, &prev,
+					&rb_link, &rb_parent);
+	if (pp) {
+		for (i = start_bit; i < end_bit; i++)
+			set_bit(i, &pp->bitmap);
+		/*
+		 * Check: if this partial page has been set to a full page,
+		 * then delete it.
+		 */
+		if (find_first_zero_bit(&pp->bitmap, sizeof(pp->bitmap)*8) >=
+				PAGE_SIZE/IA32_PAGE_SIZE) {
+			__ia32_delete_pp(current->thread.ppl, pp, __pp_prev(pp));
+		}
+		return 0;
+	}
+
+	/*
+	 * MAP_FIXED may lead to overlapping mmap.
+	 * In this case, the requested mmap area may already mmaped as a full
+	 * page. So check vma before adding a new partial page.
+	 */
+	if (flags & MAP_FIXED) {
+		struct vm_area_struct *vma = find_vma(current->mm, pstart);
+		if (vma && vma->vm_start <= pstart)
+			return 0;
+	}
+
+	/* new a partial_page */
+	pp = kmem_cache_alloc(partial_page_cachep, GFP_KERNEL);
+	if (!pp)
+		return -ENOMEM;
+	pp->base = pstart;
+	pp->bitmap = 0;
+	for (i=start_bit; i<end_bit; i++)
+		set_bit(i, &(pp->bitmap));
+	pp->next = NULL;
+	__ia32_insert_pp(current->thread.ppl, pp, prev, rb_link, rb_parent);
+	return 0;
+}
+
+/*
+ * @start and @end should be IA32 page aligned, but don't need to be in the
+ * same IA64 page. Split @start and @end to make sure they're in the same IA64
+ * page, then call __ia32_set_pp().
+ */
+static void
+ia32_set_pp(unsigned int start, unsigned int end, int flags)
+{
+	down_write(&current->mm->mmap_sem);
+	if (flags & MAP_FIXED) {
+		/*
+		 * MAP_FIXED may lead to overlapping mmap. When this happens,
+		 * a series of complete IA64 pages results in deletion of
+		 * old partial pages in that range.
+		 */
+		__ia32_delete_pp_range(PAGE_ALIGN(start), PAGE_START(end));
+	}
+
+	if (end < PAGE_ALIGN(start)) {
+		__ia32_set_pp(start, end, flags);
+	} else {
+		if (offset_in_page(start))
+			__ia32_set_pp(start, PAGE_ALIGN(start), flags);
+		if (offset_in_page(end))
+			__ia32_set_pp(PAGE_START(end), end, flags);
+	}
+	up_write(&current->mm->mmap_sem);
+}
+
+/*
+ * Unset the range between @start and @end in bitmap.
+ * @start and @end should be IA32 page aligned and in the same IA64 page.
+ * After doing that, if the bitmap is 0, then free the page and return 1,
+ * 	else return 0;
+ * If not find the partial page in the list, then
+ * 	If the vma exists, then the full page is set to a partial page;
+ *	Else return -ENOMEM.
+ */
+static int
+__ia32_unset_pp(unsigned int start, unsigned int end)
+{
+	struct partial_page *pp, *prev;
+	struct rb_node ** rb_link, *rb_parent;
+	unsigned int pstart, start_bit, end_bit, i;
+	struct vm_area_struct *vma;
+
+	pstart = PAGE_START(start);
+	start_bit = (start % PAGE_SIZE) / IA32_PAGE_SIZE;
+	end_bit = (end % PAGE_SIZE) / IA32_PAGE_SIZE;
+	if (end_bit == 0)
+		end_bit = PAGE_SIZE / IA32_PAGE_SIZE;
+
+	pp = __ia32_find_pp(current->thread.ppl, pstart, &prev,
+					&rb_link, &rb_parent);
+	if (pp) {
+		for (i = start_bit; i < end_bit; i++)
+			clear_bit(i, &pp->bitmap);
+		if (pp->bitmap == 0) {
+			__ia32_delete_pp(current->thread.ppl, pp, __pp_prev(pp));
+			return 1;
+		}
+		return 0;
+	}
+
+	vma = find_vma(current->mm, pstart);
+	if (!vma || vma->vm_start > pstart) {
+		return -ENOMEM;
+	}
+
+	/* new a partial_page */
+	pp = kmem_cache_alloc(partial_page_cachep, GFP_KERNEL);
+	if (!pp)
+		return -ENOMEM;
+	pp->base = pstart;
+	pp->bitmap = 0;
+	for (i = 0; i < start_bit; i++)
+		set_bit(i, &(pp->bitmap));
+	for (i = end_bit; i < PAGE_SIZE / IA32_PAGE_SIZE; i++)
+		set_bit(i, &(pp->bitmap));
+	pp->next = NULL;
+	__ia32_insert_pp(current->thread.ppl, pp, prev, rb_link, rb_parent);
+	return 0;
+}
+
+/*
+ * Delete pp between PAGE_ALIGN(start) and PAGE_START(end) by calling
+ * __ia32_delete_pp_range(). Unset possible partial pages by calling
+ * __ia32_unset_pp().
+ * The returned value see __ia32_unset_pp().
+ */
+static int
+ia32_unset_pp(unsigned int *startp, unsigned int *endp)
+{
+	unsigned int start = *startp, end = *endp;
+	int ret = 0;
+
+	down_write(&current->mm->mmap_sem);
+
+	__ia32_delete_pp_range(PAGE_ALIGN(start), PAGE_START(end));
+
+	if (end < PAGE_ALIGN(start)) {
+		ret = __ia32_unset_pp(start, end);
+		if (ret == 1) {
+			*startp = PAGE_START(start);
+			*endp = PAGE_ALIGN(end);
+		}
+		if (ret == 0) {
+			/* to shortcut sys_munmap() in sys32_munmap() */
+			*startp = PAGE_START(start);
+			*endp = PAGE_START(end);
+		}
+	} else {
+		if (offset_in_page(start)) {
+			ret = __ia32_unset_pp(start, PAGE_ALIGN(start));
+			if (ret == 1)
+				*startp = PAGE_START(start);
+			if (ret == 0)
+				*startp = PAGE_ALIGN(start);
+			if (ret < 0)
+				goto out;
+		}
+		if (offset_in_page(end)) {
+			ret = __ia32_unset_pp(PAGE_START(end), end);
+			if (ret == 1)
+				*endp = PAGE_ALIGN(end);
+			if (ret == 0)
+				*endp = PAGE_START(end);
+		}
+	}
+
+ out:
+	up_write(&current->mm->mmap_sem);
+	return ret;
+}
+
+/*
+ * Compare the range between @start and @end with bitmap in partial page.
+ * @start and @end should be IA32 page aligned and in the same IA64 page.
+ */
+static int
+__ia32_compare_pp(unsigned int start, unsigned int end)
+{
+	struct partial_page *pp, *prev;
+	struct rb_node ** rb_link, *rb_parent;
+	unsigned int pstart, start_bit, end_bit, size;
+	unsigned int first_bit, next_zero_bit;	/* the first range in bitmap */
+
+	pstart = PAGE_START(start);
+
+	pp = __ia32_find_pp(current->thread.ppl, pstart, &prev,
+					&rb_link, &rb_parent);
+	if (!pp)
+		return 1;
+
+	start_bit = (start % PAGE_SIZE) / IA32_PAGE_SIZE;
+	end_bit = (end % PAGE_SIZE) / IA32_PAGE_SIZE;
+	size = sizeof(pp->bitmap) * 8;
+	first_bit = find_first_bit(&pp->bitmap, size);
+	next_zero_bit = find_next_zero_bit(&pp->bitmap, size, first_bit);
+	if ((start_bit < first_bit) || (end_bit > next_zero_bit)) {
+		/* exceeds the first range in bitmap */
+		return -ENOMEM;
+	} else if ((start_bit == first_bit) && (end_bit == next_zero_bit)) {
+		first_bit = find_next_bit(&pp->bitmap, size, next_zero_bit);
+		if ((next_zero_bit < first_bit) && (first_bit < size))
+			return 1;	/* has next range */
+		else
+			return 0; 	/* no next range */
+	} else
+		return 1;
+}
+
+/*
+ * @start and @end should be IA32 page aligned, but don't need to be in the
+ * same IA64 page. Split @start and @end to make sure they're in the same IA64
+ * page, then call __ia32_compare_pp().
+ *
+ * Take this as example: the range is the 1st and 2nd 4K page.
+ * Return 0 if they fit bitmap exactly, i.e. bitmap = 00000011;
+ * Return 1 if the range doesn't cover whole bitmap, e.g. bitmap = 00001111;
+ * Return -ENOMEM if the range exceeds the bitmap, e.g. bitmap = 00000001 or
+ * 	bitmap = 00000101.
+ */
+static int
+ia32_compare_pp(unsigned int *startp, unsigned int *endp)
+{
+	unsigned int start = *startp, end = *endp;
+	int retval = 0;
+
+	down_write(&current->mm->mmap_sem);
+
+	if (end < PAGE_ALIGN(start)) {
+		retval = __ia32_compare_pp(start, end);
+		if (retval == 0) {
+			*startp = PAGE_START(start);
+			*endp = PAGE_ALIGN(end);
+		}
+	} else {
+		if (offset_in_page(start)) {
+			retval = __ia32_compare_pp(start,
+						   PAGE_ALIGN(start));
+			if (retval == 0)
+				*startp = PAGE_START(start);
+			if (retval < 0)
+				goto out;
+		}
+		if (offset_in_page(end)) {
+			retval = __ia32_compare_pp(PAGE_START(end), end);
+			if (retval == 0)
+				*endp = PAGE_ALIGN(end);
+		}
+	}
+
+ out:
+	up_write(&current->mm->mmap_sem);
+	return retval;
+}
+
+static void
+__ia32_drop_pp_list(struct partial_page_list *ppl)
+{
+	struct partial_page *pp = ppl->pp_head;
+
+	while (pp) {
+		struct partial_page *next = pp->next;
+		kmem_cache_free(partial_page_cachep, pp);
+		pp = next;
+	}
+
+	kfree(ppl);
+}
+
+void
+ia32_drop_partial_page_list(struct task_struct *task)
+{
+	struct partial_page_list* ppl = task->thread.ppl;
+
+	if (ppl && atomic_dec_and_test(&ppl->pp_count))
+		__ia32_drop_pp_list(ppl);
+}
+
+/*
+ * Copy current->thread.ppl to ppl (already initialized).
+ */
+static int
+__ia32_copy_pp_list(struct partial_page_list *ppl)
+{
+	struct partial_page *pp, *tmp, *prev;
+	struct rb_node **rb_link, *rb_parent;
+
+	ppl->pp_head = NULL;
+	ppl->pp_hint = NULL;
+	ppl->ppl_rb = RB_ROOT;
+	rb_link = &ppl->ppl_rb.rb_node;
+	rb_parent = NULL;
+	prev = NULL;
+
+	for (pp = current->thread.ppl->pp_head; pp; pp = pp->next) {
+		tmp = kmem_cache_alloc(partial_page_cachep, GFP_KERNEL);
+		if (!tmp)
+			return -ENOMEM;
+		*tmp = *pp;
+		__ia32_insert_pp(ppl, tmp, prev, rb_link, rb_parent);
+		prev = tmp;
+		rb_link = &tmp->pp_rb.rb_right;
+		rb_parent = &tmp->pp_rb;
+	}
+	return 0;
+}
+
+int
+ia32_copy_partial_page_list(struct task_struct *p, unsigned long clone_flags)
+{
+	int retval = 0;
+
+	if (clone_flags & CLONE_VM) {
+		atomic_inc(&current->thread.ppl->pp_count);
+		p->thread.ppl = current->thread.ppl;
+	} else {
+		p->thread.ppl = ia32_init_pp_list();
+		if (!p->thread.ppl)
+			return -ENOMEM;
+		down_write(&current->mm->mmap_sem);
+		{
+			retval = __ia32_copy_pp_list(p->thread.ppl);
+		}
+		up_write(&current->mm->mmap_sem);
+	}
+
+	return retval;
+}
+
 static unsigned long
 emulate_mmap (struct file *file, unsigned long start, unsigned long len, int prot, int flags,
 	      loff_t off)
@@ -263,6 +767,7 @@ emulate_mmap (struct file *file, unsigned long start, unsigned long len, int pro
 	pend = PAGE_ALIGN(end);
 
 	if (flags & MAP_FIXED) {
+		ia32_set_pp((unsigned int)start, (unsigned int)end, flags);
 		if (start > pstart) {
 			if (flags & MAP_SHARED)
 				printk(KERN_INFO
@@ -274,7 +779,7 @@ emulate_mmap (struct file *file, unsigned long start, unsigned long len, int pro
 				return ret;
 			pstart += PAGE_SIZE;
 			if (pstart >= pend)
-				return start;	/* done */
+				goto out;	/* done */
 		}
 		if (end < pend) {
 			if (flags & MAP_SHARED)
@@ -287,7 +792,7 @@ emulate_mmap (struct file *file, unsigned long start, unsigned long len, int pro
 				return ret;
 			pend -= PAGE_SIZE;
 			if (pstart >= pend)
-				return start;	/* done */
+				goto out;	/* done */
 		}
 	} else {
 		/*
@@ -341,6 +846,10 @@ emulate_mmap (struct file *file, unsigned long start, unsigned long len, int pro
 		if (!(prot & PROT_WRITE) && sys_mprotect(pstart, pend - pstart, prot) < 0)
 			return -EINVAL;
 	}
+
+	if (!(flags & MAP_FIXED))
+		ia32_set_pp((unsigned int)start, (unsigned int)end, flags);
+out:
 	return start;
 }
 
@@ -478,11 +987,16 @@ sys32_munmap (unsigned int start, unsigned int len)
 #if PAGE_SHIFT <= IA32_PAGE_SHIFT
 	ret = sys_munmap(start, end - start);
 #else
+	if (OFFSET4K(start))
+		return -EINVAL;
+
+	end = IA32_PAGE_ALIGN(end);
 	if (start >= end)
 		return -EINVAL;
 
-	start = PAGE_ALIGN(start);
-	end = PAGE_START(end);
+	ret = ia32_unset_pp(&start, &end);
+	if (ret < 0)
+		return ret;
 
 	if (start >= end)
 		return 0;
@@ -521,7 +1035,7 @@ mprotect_subpage (unsigned long address, int new_prot)
 asmlinkage long
 sys32_mprotect (unsigned int start, unsigned int len, int prot)
 {
-	unsigned long end = start + len;
+	unsigned int end = start + len;
 #if PAGE_SHIFT > IA32_PAGE_SHIFT
 	long retval = 0;
 #endif
@@ -538,6 +1052,11 @@ sys32_mprotect (unsigned int start, unsigned int len, int prot)
 	if (end < start)
 		return -EINVAL;
 
+	retval = ia32_compare_pp(&start, &end);
+
+	if (retval < 0)
+		return retval;
+
 	down(&ia32_mmap_sem);
 	{
 		if (offset_in_page(start)) {
@@ -567,6 +1086,59 @@ sys32_mprotect (unsigned int start, unsigned int len, int prot)
 #endif
 }
 
+asmlinkage long
+sys32_mremap (unsigned int addr, unsigned int old_len, unsigned int new_len,
+		unsigned int flags, unsigned int new_addr)
+{
+	long ret;
+
+#if PAGE_SHIFT <= IA32_PAGE_SHIFT
+	ret = sys_mremap(addr, old_len, new_len, flags, new_addr);
+#else
+	unsigned int old_end, new_end;
+
+	if (OFFSET4K(addr))
+		return -EINVAL;
+
+	old_len = IA32_PAGE_ALIGN(old_len);
+	new_len = IA32_PAGE_ALIGN(new_len);
+	old_end = addr + old_len;
+	new_end = addr + new_len;
+
+	if (!new_len)
+		return -EINVAL;
+
+	if ((flags & MREMAP_FIXED) && (OFFSET4K(new_addr)))
+		return -EINVAL;
+
+	if (old_len >= new_len) {
+		ret = sys32_munmap(addr + new_len, old_len - new_len);
+		if (ret && old_len != new_len)
+			return ret;
+		ret = addr;
+		if (!(flags & MREMAP_FIXED) || (new_addr == addr))
+			return ret;
+		old_len = new_len;
+	}
+
+	addr = PAGE_START(addr);
+	old_len = PAGE_ALIGN(old_end) - addr;
+	new_len = PAGE_ALIGN(new_end) - addr;
+
+	down(&ia32_mmap_sem);
+	{
+		ret = sys_mremap(addr, old_len, new_len, flags, new_addr);
+	}
+	up(&ia32_mmap_sem);
+
+	if ((ret >= 0) && (old_len < new_len)) {
+		/* mremap expanded successfully */
+		ia32_set_pp(old_end, new_end, flags);
+	}
+#endif
+	return ret;
+}
+
 asmlinkage long
 sys32_pipe (int *fd)
 {
@@ -1424,18 +1996,19 @@ sys32_sigaltstack (ia32_stack_t *uss32, ia32_stack_t *uoss32,
 	int ret;
 	mm_segment_t old_fs = get_fs();
 
-	if (uss32)
+	if (uss32) {
 		if (copy_from_user(&buf32, uss32, sizeof(ia32_stack_t)))
 			return -EFAULT;
-	uss.ss_sp = (void *) (long) buf32.ss_sp;
-	uss.ss_flags = buf32.ss_flags;
-	/* MINSIGSTKSZ is different for ia32 vs ia64. We lie here to pass the 
-           check and set it to the user requested value later */
-	if ((buf32.ss_flags != SS_DISABLE) && (buf32.ss_size < MINSIGSTKSZ_IA32)) {
-		ret = -ENOMEM;
-		goto out;
+		uss.ss_sp = (void *) (long) buf32.ss_sp;
+		uss.ss_flags = buf32.ss_flags;
+		/* MINSIGSTKSZ is different for ia32 vs ia64. We lie here to pass the 
+	           check and set it to the user requested value later */
+		if ((buf32.ss_flags != SS_DISABLE) && (buf32.ss_size < MINSIGSTKSZ_IA32)) {
+			ret = -ENOMEM;
+			goto out;
+		}
+		uss.ss_size = MINSIGSTKSZ;
 	}
-	uss.ss_size = MINSIGSTKSZ;
 	set_fs(KERNEL_DS);
 	ret = do_sigaltstack(uss32 ? &uss : NULL, &uoss, pt->r12);
  	current->sas_ss_size = buf32.ss_size;	
diff --git a/arch/ia64/kernel/acpi.c b/arch/ia64/kernel/acpi.c
index 10f2c7cd7..cf61f3e2a 100644
--- a/arch/ia64/kernel/acpi.c
+++ b/arch/ia64/kernel/acpi.c
@@ -171,8 +171,6 @@ acpi_parse_lapic_addr_ovr (
 	if (BAD_MADT_ENTRY(lapic, end))
 		return -EINVAL;
 
-	acpi_table_print_madt_entry(header);
-
 	if (lapic->address) {
 		iounmap((void *) ipi_base_addr);
 		ipi_base_addr = (unsigned long) ioremap(lapic->address, 0);
@@ -191,25 +189,13 @@ acpi_parse_lsapic (acpi_table_entry_header *header, const unsigned long end)
 	if (BAD_MADT_ENTRY(lsapic, end))
 		return -EINVAL;
 
-	acpi_table_print_madt_entry(header);
-
-	printk(KERN_INFO "CPU %d (0x%04x)", total_cpus, (lsapic->id << 8) | lsapic->eid);
-
-	if (!lsapic->flags.enabled)
-		printk(" disabled");
-	else {
-		printk(" enabled");
+	if (lsapic->flags.enabled) {
 #ifdef CONFIG_SMP
 		smp_boot_data.cpu_phys_id[available_cpus] = (lsapic->id << 8) | lsapic->eid;
-		if (hard_smp_processor_id()
-		    == (unsigned int) smp_boot_data.cpu_phys_id[available_cpus])
-			printk(" (BSP)");
 #endif
 		++available_cpus;
 	}
 
-	printk("\n");
-
 	total_cpus++;
 	return 0;
 }
@@ -225,8 +211,6 @@ acpi_parse_lapic_nmi (acpi_table_entry_header *header, const unsigned long end)
 	if (BAD_MADT_ENTRY(lacpi_nmi, end))
 		return -EINVAL;
 
-	acpi_table_print_madt_entry(header);
-
 	/* TBD: Support lapic_nmi entries */
 	return 0;
 }
@@ -242,8 +226,6 @@ acpi_parse_iosapic (acpi_table_entry_header *header, const unsigned long end)
 	if (BAD_MADT_ENTRY(iosapic, end))
 		return -EINVAL;
 
-	acpi_table_print_madt_entry(header);
-
 	iosapic_init(iosapic->address, iosapic->global_irq_base);
 
 	return 0;
@@ -262,8 +244,6 @@ acpi_parse_plat_int_src (
 	if (BAD_MADT_ENTRY(plintsrc, end))
 		return -EINVAL;
 
-	acpi_table_print_madt_entry(header);
-
 	/*
 	 * Get vector assignment for this interrupt, set attributes,
 	 * and program the IOSAPIC routing table.
@@ -292,8 +272,6 @@ acpi_parse_int_src_ovr (
 	if (BAD_MADT_ENTRY(p, end))
 		return -EINVAL;
 
-	acpi_table_print_madt_entry(header);
-
 	iosapic_override_isa_irq(p->bus_irq, p->global_irq,
 				 (p->flags.polarity == 1) ? IOSAPIC_POL_HIGH : IOSAPIC_POL_LOW,
 				 (p->flags.trigger == 1) ? IOSAPIC_EDGE : IOSAPIC_LEVEL);
@@ -311,26 +289,24 @@ acpi_parse_nmi_src (acpi_table_entry_header *header, const unsigned long end)
 	if (BAD_MADT_ENTRY(nmi_src, end))
 		return -EINVAL;
 
-	acpi_table_print_madt_entry(header);
-
 	/* TBD: Support nimsrc entries */
 	return 0;
 }
 
-/* Hook from generic ACPI tables.c */
-void __init acpi_madt_oem_check(char *oem_id, char *oem_table_id)
+static void __init
+acpi_madt_oem_check (char *oem_id, char *oem_table_id)
 {
 	if (!strncmp(oem_id, "IBM", 3) &&
-	    (!strncmp(oem_table_id, "SERMOW", 6))){
+	    (!strncmp(oem_table_id, "SERMOW", 6))) {
 
-		/* Unfortunatly ITC_DRIFT is not yet part of the
+		/*
+		 * Unfortunately ITC_DRIFT is not yet part of the
 		 * official SAL spec, so the ITC_DRIFT bit is not
 		 * set by the BIOS on this hardware.
 		 */
 		sal_platform_features |= IA64_SAL_PLATFORM_FEATURE_ITC_DRIFT;
 
-		/*Start cyclone clock*/
-		cyclone_setup(0);
+		cyclone_setup();
 	}
 }
 
@@ -521,9 +497,14 @@ acpi_numa_arch_fixup (void)
 #endif /* CONFIG_ACPI_NUMA */
 
 unsigned int
-acpi_register_gsi (u32 gsi, int polarity, int trigger)
+acpi_register_gsi (u32 gsi, int edge_level, int active_high_low)
 {
-	return acpi_register_irq(gsi, polarity, trigger);
+	if (has_8259 && gsi < 16)
+		return isa_irq_to_vector(gsi);
+
+	return iosapic_register_intr(gsi,
+			(active_high_low == ACPI_ACTIVE_HIGH) ? IOSAPIC_POL_HIGH : IOSAPIC_POL_LOW,
+			(edge_level == ACPI_EDGE_SENSITIVE) ? IOSAPIC_EDGE : IOSAPIC_LEVEL);
 }
 EXPORT_SYMBOL(acpi_register_gsi);
 
@@ -548,7 +529,7 @@ acpi_parse_fadt (unsigned long phys_addr, unsigned long size)
 	if (fadt->iapc_boot_arch & BAF_LEGACY_DEVICES)
 		acpi_legacy_devices = 1;
 
-	acpi_register_gsi(fadt->sci_int, ACPI_ACTIVE_LOW, ACPI_LEVEL_SENSITIVE);
+	acpi_register_gsi(fadt->sci_int, ACPI_LEVEL_SENSITIVE, ACPI_ACTIVE_LOW);
 	return 0;
 }
 
@@ -662,16 +643,4 @@ acpi_gsi_to_irq (u32 gsi, unsigned int *irq)
 	return 0;
 }
 
-int
-acpi_register_irq (u32 gsi, u32 polarity, u32 trigger)
-{
-	if (has_8259 && gsi < 16)
-		return isa_irq_to_vector(gsi);
-
-	return iosapic_register_intr(gsi,
-			(polarity == ACPI_ACTIVE_HIGH) ? IOSAPIC_POL_HIGH : IOSAPIC_POL_LOW,
-			(trigger == ACPI_EDGE_SENSITIVE) ? IOSAPIC_EDGE : IOSAPIC_LEVEL);
-}
-EXPORT_SYMBOL(acpi_register_irq);
-
 #endif /* CONFIG_ACPI_BOOT */
diff --git a/arch/ia64/kernel/cyclone.c b/arch/ia64/kernel/cyclone.c
index 05ec3ca72..19300e958 100644
--- a/arch/ia64/kernel/cyclone.c
+++ b/arch/ia64/kernel/cyclone.c
@@ -10,10 +10,9 @@
 #define CYCLONE_TIMER_FREQ 100000000
 
 int use_cyclone;
-int __init cyclone_setup(char *str)
+void __init cyclone_setup(void)
 {
 	use_cyclone = 1;
-	return 1;
 }
 
 static u32* volatile cyclone_timer;	/* Cyclone MPMC0 register */
diff --git a/arch/ia64/kernel/efi.c b/arch/ia64/kernel/efi.c
index 3789a515a..e1e7d91c9 100644
--- a/arch/ia64/kernel/efi.c
+++ b/arch/ia64/kernel/efi.c
@@ -43,18 +43,20 @@ static unsigned long mem_limit = ~0UL, max_addr = ~0UL;
 
 #define efi_call_virt(f, args...)	(*(f))(args)
 
-#define STUB_GET_TIME(prefix, adjust_arg)							\
-static efi_status_t										\
-prefix##_get_time (efi_time_t *tm, efi_time_cap_t *tc)						\
-{												\
-	struct ia64_fpreg fr[6];								\
-	efi_status_t ret;									\
-												\
-	ia64_save_scratch_fpregs(fr);								\
-	ret = efi_call_##prefix((efi_get_time_t *) __va(runtime->get_time), adjust_arg(tm),	\
-				adjust_arg(tc));						\
-	ia64_load_scratch_fpregs(fr);								\
-	return ret;										\
+#define STUB_GET_TIME(prefix, adjust_arg)							  \
+static efi_status_t										  \
+prefix##_get_time (efi_time_t *tm, efi_time_cap_t *tc)						  \
+{												  \
+	struct ia64_fpreg fr[6];								  \
+	efi_time_cap_t *atc = 0;								  \
+	efi_status_t ret;									  \
+												  \
+	if (tc)											  \
+		atc = adjust_arg(tc);								  \
+	ia64_save_scratch_fpregs(fr);								  \
+	ret = efi_call_##prefix((efi_get_time_t *) __va(runtime->get_time), adjust_arg(tm), atc); \
+	ia64_load_scratch_fpregs(fr);								  \
+	return ret;										  \
 }
 
 #define STUB_SET_TIME(prefix, adjust_arg)							\
@@ -89,11 +91,14 @@ static efi_status_t										\
 prefix##_set_wakeup_time (efi_bool_t enabled, efi_time_t *tm)					\
 {												\
 	struct ia64_fpreg fr[6];								\
+	efi_time_t *atm = 0;									\
 	efi_status_t ret;									\
 												\
+	if (tm)											\
+		atm = adjust_arg(tm);								\
 	ia64_save_scratch_fpregs(fr);								\
 	ret = efi_call_##prefix((efi_set_wakeup_time_t *) __va(runtime->set_wakeup_time),	\
-				enabled, adjust_arg(tm));					\
+				enabled, atm);							\
 	ia64_load_scratch_fpregs(fr);								\
 	return ret;										\
 }
@@ -104,11 +109,14 @@ prefix##_get_variable (efi_char16_t *name, efi_guid_t *vendor, u32 *attr,		\
 		       unsigned long *data_size, void *data)				\
 {											\
 	struct ia64_fpreg fr[6];							\
+	u32 *aattr = 0;									\
 	efi_status_t ret;								\
 											\
+	if (attr)									\
+		aattr = adjust_arg(attr);						\
 	ia64_save_scratch_fpregs(fr);							\
 	ret = efi_call_##prefix((efi_get_variable_t *) __va(runtime->get_variable),	\
-				adjust_arg(name), adjust_arg(vendor), adjust_arg(attr),	\
+				adjust_arg(name), adjust_arg(vendor), aattr,		\
 				adjust_arg(data_size), adjust_arg(data));		\
 	ia64_load_scratch_fpregs(fr);							\
 	return ret;									\
@@ -164,33 +172,41 @@ prefix##_reset_system (int reset_type, efi_status_t status,			\
 		       unsigned long data_size, efi_char16_t *data)		\
 {										\
 	struct ia64_fpreg fr[6];						\
+	efi_char16_t *adata = 0;						\
+										\
+	if (data)								\
+		adata = adjust_arg(data);					\
 										\
 	ia64_save_scratch_fpregs(fr);						\
 	efi_call_##prefix((efi_reset_system_t *) __va(runtime->reset_system),	\
-			  reset_type, status, data_size, adjust_arg(data));	\
+			  reset_type, status, data_size, adata);		\
 	/* should not return, but just in case... */				\
 	ia64_load_scratch_fpregs(fr);						\
 }
 
-STUB_GET_TIME(phys, __pa)
-STUB_SET_TIME(phys, __pa)
-STUB_GET_WAKEUP_TIME(phys, __pa)
-STUB_SET_WAKEUP_TIME(phys, __pa)
-STUB_GET_VARIABLE(phys, __pa)
-STUB_GET_NEXT_VARIABLE(phys, __pa)
-STUB_SET_VARIABLE(phys, __pa)
-STUB_GET_NEXT_HIGH_MONO_COUNT(phys, __pa)
-STUB_RESET_SYSTEM(phys, __pa)
-
-STUB_GET_TIME(virt, )
-STUB_SET_TIME(virt, )
-STUB_GET_WAKEUP_TIME(virt, )
-STUB_SET_WAKEUP_TIME(virt, )
-STUB_GET_VARIABLE(virt, )
-STUB_GET_NEXT_VARIABLE(virt, )
-STUB_SET_VARIABLE(virt, )
-STUB_GET_NEXT_HIGH_MONO_COUNT(virt, )
-STUB_RESET_SYSTEM(virt, )
+#define phys_ptr(arg)	((__typeof__(arg)) ia64_tpa(arg))
+
+STUB_GET_TIME(phys, phys_ptr)
+STUB_SET_TIME(phys, phys_ptr)
+STUB_GET_WAKEUP_TIME(phys, phys_ptr)
+STUB_SET_WAKEUP_TIME(phys, phys_ptr)
+STUB_GET_VARIABLE(phys, phys_ptr)
+STUB_GET_NEXT_VARIABLE(phys, phys_ptr)
+STUB_SET_VARIABLE(phys, phys_ptr)
+STUB_GET_NEXT_HIGH_MONO_COUNT(phys, phys_ptr)
+STUB_RESET_SYSTEM(phys, phys_ptr)
+
+#define id(arg)	arg
+
+STUB_GET_TIME(virt, id)
+STUB_SET_TIME(virt, id)
+STUB_GET_WAKEUP_TIME(virt, id)
+STUB_SET_WAKEUP_TIME(virt, id)
+STUB_GET_VARIABLE(virt, id)
+STUB_GET_NEXT_VARIABLE(virt, id)
+STUB_SET_VARIABLE(virt, id)
+STUB_GET_NEXT_HIGH_MONO_COUNT(virt, id)
+STUB_RESET_SYSTEM(virt, id)
 
 void
 efi_gettimeofday (struct timespec *ts)
diff --git a/arch/ia64/kernel/efi_stub.S b/arch/ia64/kernel/efi_stub.S
index 6e8a8c1b9..5a7fe7021 100644
--- a/arch/ia64/kernel/efi_stub.S
+++ b/arch/ia64/kernel/efi_stub.S
@@ -44,7 +44,7 @@
 
 GLOBAL_ENTRY(efi_call_phys)
 	.prologue ASM_UNW_PRLG_RP|ASM_UNW_PRLG_PFS, ASM_UNW_PRLG_GRSAVE(8)
-	alloc loc1=ar.pfs,8,5,7,0
+	alloc loc1=ar.pfs,8,7,7,0
 	ld8 r2=[in0],8			// load EFI function's entry point
 	mov loc0=rp
 	.body
@@ -70,9 +70,13 @@ GLOBAL_ENTRY(efi_call_phys)
 	mov out3=in4
 	mov out5=in6
 	mov out6=in7
+	mov loc5=r19
+	mov loc6=r20
 	br.call.sptk.many rp=b6		// call the EFI function
 .ret1:	mov ar.rsc=0			// put RSE in enforced lazy, LE mode
 	mov r16=loc3
+	mov r19=loc5
+	mov r20=loc6
 	br.call.sptk.many rp=ia64_switch_mode_virt // return to virtual mode
 .ret2:	mov ar.rsc=loc4			// restore RSE configuration
 	mov ar.pfs=loc1
diff --git a/arch/ia64/kernel/entry.S b/arch/ia64/kernel/entry.S
index 6703e7f21..0b24641ad 100644
--- a/arch/ia64/kernel/entry.S
+++ b/arch/ia64/kernel/entry.S
@@ -179,21 +179,23 @@ GLOBAL_ENTRY(ia64_switch_to)
 	.body
 
 	adds r22=IA64_TASK_THREAD_KSP_OFFSET,r13
+	movl r25=init_task
 	mov r27=IA64_KR(CURRENT_STACK)
-	dep r20=0,in0,61,3		// physical address of "current"
+	adds r21=IA64_TASK_THREAD_KSP_OFFSET,in0
+	dep r20=0,in0,61,3		// physical address of "next"
 	;;
 	st8 [r22]=sp			// save kernel stack pointer of old task
 	shr.u r26=r20,IA64_GRANULE_SHIFT
-	adds r21=IA64_TASK_THREAD_KSP_OFFSET,in0
+	cmp.eq p7,p6=r25,in0
 	;;
 	/*
 	 * If we've already mapped this task's page, we can skip doing it again.
 	 */
-	cmp.eq p7,p6=r26,r27
+(p6)	cmp.eq p7,p6=r26,r27
 (p6)	br.cond.dpnt .map
 	;;
 .done:
-(p6)	ssm psr.ic			// if we we had to map, renable the psr.ic bit FIRST!!!
+(p6)	ssm psr.ic			// if we had to map, reenable the psr.ic bit FIRST!!!
 	;;
 (p6)	srlz.d
 	ld8 sp=[r21]			// load kernel stack pointer of new task
@@ -506,7 +508,7 @@ GLOBAL_ENTRY(ia64_trace_syscall)
 	;;
  	stf.spill [r16]=f10
  	stf.spill [r17]=f11
-	br.call.sptk.many rp=syscall_trace // give parent a chance to catch syscall args
+	br.call.sptk.many rp=syscall_trace_enter // give parent a chance to catch syscall args
 	adds r16=PT(F6)+16,sp
 	adds r17=PT(F7)+16,sp
 	;;
@@ -546,7 +548,7 @@ GLOBAL_ENTRY(ia64_trace_syscall)
 .strace_save_retval:
 .mem.offset 0,0; st8.spill [r2]=r8		// store return value in slot for r8
 .mem.offset 8,0; st8.spill [r3]=r10		// clear error indication in slot for r10
-	br.call.sptk.many rp=syscall_trace // give parent a chance to catch return value
+	br.call.sptk.many rp=syscall_trace_leave // give parent a chance to catch return value
 .ret3:	br.cond.sptk ia64_leave_syscall
 
 strace_error:
@@ -573,7 +575,7 @@ GLOBAL_ENTRY(ia64_strace_leave_kernel)
 	 */
 	nop.m 0
 	nop.i 0
-	br.call.sptk.many rp=syscall_trace // give parent a chance to catch return value
+	br.call.sptk.many rp=syscall_trace_leave // give parent a chance to catch return value
 }
 .ret4:	br.cond.sptk ia64_leave_kernel
 END(ia64_strace_leave_kernel)
@@ -599,7 +601,9 @@ GLOBAL_ENTRY(ia64_ret_from_clone)
 	ld4 r2=[r2]
 	;;
 	mov r8=0
-	tbit.nz p6,p0=r2,TIF_SYSCALL_TRACE
+	and r2=_TIF_SYSCALL_TRACEAUDIT,r2
+	;;
+	cmp.ne p6,p0=r2,r0
 (p6)	br.cond.spnt .strace_check_retval
 	;;					// added stop bits to prevent r8 dependency
 END(ia64_ret_from_clone)
@@ -661,25 +665,31 @@ GLOBAL_ENTRY(ia64_leave_syscall)
 	PT_REGS_UNWIND_INFO(0)
 	/*
 	 * work.need_resched etc. mustn't get changed by this CPU before it returns to
-	 * user- or fsys-mode, hence we disable interrupts early on:
+	 * user- or fsys-mode, hence we disable interrupts early on.
+	 *
+	 * p6 controls whether current_thread_info()->flags needs to be check for
+	 * extra work.  We always check for extra work when returning to user-level.
+	 * With CONFIG_PREEMPT, we also check for extra work when the preempt_count
+	 * is 0.  After extra work processing has been completed, execution
+	 * resumes at .work_processed_syscall with p6 set to 1 if the extra-work-check
+	 * needs to be redone.
 	 */
 #ifdef CONFIG_PREEMPT
 	rsm psr.i				// disable interrupts
-#else
-(pUStk)	rsm psr.i
-#endif
 	cmp.eq pLvSys,p0=r0,r0			// pLvSys=1: leave from syscall
-(pUStk)	cmp.eq.unc p6,p0=r0,r0			// p6 <- pUStk
-.work_processed_syscall:
-#ifdef CONFIG_PREEMPT
 (pKStk) adds r20=TI_PRE_COUNT+IA64_TASK_SIZE,r13
 	;;
 	.pred.rel.mutex pUStk,pKStk
 (pKStk) ld4 r21=[r20]			// r21 <- preempt_count
 (pUStk)	mov r21=0			// r21 <- 0
 	;;
-(p6)	cmp.eq.unc p6,p0=r21,r0		// p6 <- p6 && (r21 == 0)
-#endif /* CONFIG_PREEMPT */
+	cmp.eq p6,p0=r21,r0		// p6 <- pUStk || (preempt_count == 0)
+#else /* !CONFIG_PREEMPT */
+(pUStk)	rsm psr.i
+	cmp.eq pLvSys,p0=r0,r0		// pLvSys=1: leave from syscall
+(pUStk)	cmp.eq.unc p6,p0=r0,r0		// p6 <- pUStk
+#endif
+.work_processed_syscall:
 	adds r16=PT(LOADRS)+16,r12
 	adds r17=PT(AR_BSPSTORE)+16,r12
 	adds r18=TI_FLAGS+IA64_TASK_SIZE,r13
@@ -774,26 +784,31 @@ GLOBAL_ENTRY(ia64_leave_kernel)
 	PT_REGS_UNWIND_INFO(0)
 	/*
 	 * work.need_resched etc. mustn't get changed by this CPU before it returns to
-	 * user- or fsys-mode, hence we disable interrupts early on:
+	 * user- or fsys-mode, hence we disable interrupts early on.
+	 *
+	 * p6 controls whether current_thread_info()->flags needs to be check for
+	 * extra work.  We always check for extra work when returning to user-level.
+	 * With CONFIG_PREEMPT, we also check for extra work when the preempt_count
+	 * is 0.  After extra work processing has been completed, execution
+	 * resumes at .work_processed_syscall with p6 set to 1 if the extra-work-check
+	 * needs to be redone.
 	 */
 #ifdef CONFIG_PREEMPT
 	rsm psr.i				// disable interrupts
-#else
-(pUStk)	rsm psr.i
-#endif
 	cmp.eq p0,pLvSys=r0,r0			// pLvSys=0: leave from kernel
-(pUStk)	cmp.eq.unc p6,p0=r0,r0			// p6 <- pUStk
-	;;
-.work_processed_kernel:
-#ifdef CONFIG_PREEMPT
-	adds r20=TI_PRE_COUNT+IA64_TASK_SIZE,r13
+(pKStk)	adds r20=TI_PRE_COUNT+IA64_TASK_SIZE,r13
 	;;
 	.pred.rel.mutex pUStk,pKStk
 (pKStk)	ld4 r21=[r20]			// r21 <- preempt_count
 (pUStk)	mov r21=0			// r21 <- 0
 	;;
-(p6)	cmp.eq.unc p6,p0=r21,r0		// p6 <- p6 && (r21 == 0)
-#endif /* CONFIG_PREEMPT */
+	cmp.eq p6,p0=r21,r0		// p6 <- pUStk || (preempt_count == 0)
+#else
+(pUStk)	rsm psr.i
+	cmp.eq p0,pLvSys=r0,r0		// pLvSys=0: leave from kernel
+(pUStk)	cmp.eq.unc p6,p0=r0,r0		// p6 <- pUStk
+#endif
+.work_processed_kernel:
 	adds r17=TI_FLAGS+IA64_TASK_SIZE,r13
 	;;
 (p6)	ld4 r31=[r17]				// load current_thread_info()->flags
@@ -1063,7 +1078,7 @@ skip_rbs_switch:
 	br.cond.sptk.many .work_processed_kernel	// re-check
 
 .notify:
-	br.call.spnt.many rp=notify_resume_user
+(pUStk)	br.call.spnt.many rp=notify_resume_user
 .ret10:	cmp.ne p6,p0=r0,r0				// p6 <- 0
 (pLvSys)br.cond.sptk.many .work_processed_syscall	// don't re-check
 	br.cond.sptk.many .work_processed_kernel	// don't re-check
diff --git a/arch/ia64/kernel/fsys.S b/arch/ia64/kernel/fsys.S
index 874bb10b7..0f8e5b5fd 100644
--- a/arch/ia64/kernel/fsys.S
+++ b/arch/ia64/kernel/fsys.S
@@ -165,7 +165,6 @@ ENTRY(fsys_gettimeofday)
 	add r9=TI_FLAGS+IA64_TASK_SIZE,r16
 	addl r3=THIS_CPU(cpu_info),r0
 
-	mov.m r31=ar.itc		// put time stamp into r31 (ITC) == now		(35 cyc)
 #ifdef CONFIG_SMP
 	movl r10=__per_cpu_offset
 	movl r2=sal_platform_features
@@ -240,12 +239,13 @@ EX(.fail_efault, probe.w.fault r10, 3)		// this must come _after_ NaT-check
 	;;
 
 	ldf8 f8=[r21]			// f8 now contains itm_next
+	mov.m r31=ar.itc		// put time stamp into r31 (ITC) == now
 	sub r28=r29, r28, 1		// r28 now contains "-(lost + 1)"
-	tbit.nz p9, p10=r23, 0		// p9 <- is_odd(r23), p10 <- is_even(r23)
 	;;
 
 	ld8 r2=[r19]			// r2 = sec = xtime.tv_sec
 	ld8 r29=[r20]			// r29 = nsec = xtime.tv_nsec
+	tbit.nz p9, p10=r23, 0		// p9 <- is_odd(r23), p10 <- is_even(r23)
 
 	setf.sig f6=r28			// f6 <- -(lost + 1)				(6 cyc)
 	;;
@@ -260,7 +260,6 @@ EX(.fail_efault, probe.w.fault r10, 3)		// this must come _after_ NaT-check
 	nop 0
 	;;
 
-	mov r31=ar.itc			// re-read ITC in case we .retry		(35 cyc)
 	xma.l f8=f11, f8, f12	// f8 (elapsed_cycles) <- (-1*last_tick + now) = (now - last_tick)
 	nop 0
 	;;
diff --git a/arch/ia64/kernel/head.S b/arch/ia64/kernel/head.S
index 0a5eb48d5..032defb0f 100644
--- a/arch/ia64/kernel/head.S
+++ b/arch/ia64/kernel/head.S
@@ -67,7 +67,7 @@ start_ap:
 	 * Initialize kernel region registers:
 	 *	rr[5]: VHPT enabled, page size = PAGE_SHIFT
 	 *	rr[6]: VHPT disabled, page size = IA64_GRANULE_SHIFT
-	 *	rr[5]: VHPT disabled, page size = IA64_GRANULE_SHIFT
+	 *	rr[7]: VHPT disabled, page size = IA64_GRANULE_SHIFT
 	 */
 	mov r16=((ia64_rid(IA64_REGION_ID_KERNEL, (5<<61)) << 8) | (PAGE_SHIFT << 2) | 1)
 	movl r17=(5<<61)
@@ -154,6 +154,9 @@ start_ap:
 #endif
 	;;
 	tpa r3=r2		// r3 == phys addr of task struct
+	mov r16=-1
+(isBP)	br.cond.dpnt .load_current // BP stack is on region 5 --- no need to map it
+
 	// load mapping for stack (virtaddr in r2, physaddr in r3)
 	rsm psr.ic
 	movl r17=PAGE_KERNEL
@@ -180,6 +183,7 @@ start_ap:
 	srlz.d
   	;;
 
+.load_current:
 	// load the "current" pointer (r13) and ar.k6 with the current task
 	mov IA64_KR(CURRENT)=r2		// virtual address
 	mov IA64_KR(CURRENT_STACK)=r16
@@ -702,6 +706,9 @@ END(__ia64_init_fpu)
  *
  * Inputs:
  *	r16 = new psr to establish
+ * Output:
+ *	r19 = old virtual address of ar.bsp
+ *	r20 = old virtual address of sp
  *
  * Note: RSE must already be in enforced lazy mode
  */
@@ -720,12 +727,13 @@ GLOBAL_ENTRY(ia64_switch_mode_phys)
 	mov cr.ipsr=r16			// set new PSR
 	add r3=1f-ia64_switch_mode_phys,r15
 
-	mov r17=ar.bsp
+	mov r19=ar.bsp
+	mov r20=sp
 	mov r14=rp			// get return address into a general register
 	;;
 
 	// going to physical mode, use tpa to translate virt->phys
-	tpa r17=r17
+	tpa r17=r19
 	tpa r3=r3
 	tpa sp=sp
 	tpa r14=r14
@@ -748,6 +756,8 @@ END(ia64_switch_mode_phys)
  *
  * Inputs:
  *	r16 = new psr to establish
+ *	r19 = new bspstore to establish
+ *	r20 = new sp to establish
  *
  * Note: RSE must already be in enforced lazy mode
  */
@@ -766,7 +776,6 @@ GLOBAL_ENTRY(ia64_switch_mode_virt)
 	mov cr.ipsr=r16			// set new PSR
 	add r3=1f-ia64_switch_mode_virt,r15
 
-	mov r17=ar.bsp
 	mov r14=rp			// get return address into a general register
 	;;
 
@@ -777,15 +786,14 @@ GLOBAL_ENTRY(ia64_switch_mode_virt)
 	movl r18=KERNEL_START
 	dep r3=0,r3,KERNEL_TR_PAGE_SHIFT,64-KERNEL_TR_PAGE_SHIFT
 	dep r14=0,r14,KERNEL_TR_PAGE_SHIFT,64-KERNEL_TR_PAGE_SHIFT
-	dep r17=-1,r17,61,3
-	dep sp=-1,sp,61,3
+	mov sp=r20
 	;;
 	or r3=r3,r18
 	or r14=r14,r18
 	;;
 
 	mov r18=ar.rnat			// save ar.rnat
-	mov ar.bspstore=r17		// this steps on ar.rnat
+	mov ar.bspstore=r19		// this steps on ar.rnat
 	mov cr.iip=r3
 	mov cr.ifs=r0
 	;;
diff --git a/arch/ia64/kernel/init_task.c b/arch/ia64/kernel/init_task.c
index 46cf054d3..b69c397ed 100644
--- a/arch/ia64/kernel/init_task.c
+++ b/arch/ia64/kernel/init_task.c
@@ -11,6 +11,7 @@
 #include <linux/module.h>
 #include <linux/sched.h>
 #include <linux/init_task.h>
+#include <linux/mqueue.h>
 
 #include <asm/uaccess.h>
 #include <asm/pgtable.h>
diff --git a/arch/ia64/kernel/iosapic.c b/arch/ia64/kernel/iosapic.c
index 9ef5f3ef9..f032ea1b3 100644
--- a/arch/ia64/kernel/iosapic.c
+++ b/arch/ia64/kernel/iosapic.c
@@ -100,7 +100,6 @@
 #endif
 
 static spinlock_t iosapic_lock = SPIN_LOCK_UNLOCKED;
-extern cpumask_t	__cacheline_aligned pending_irq_cpumask[NR_IRQS];
 
 /* These tables map IA-64 vectors to the IOSAPIC pin that generates this vector. */
 
@@ -218,10 +217,8 @@ set_rte (unsigned int vector, unsigned int dest, int mask)
 
 	spin_lock_irqsave(&iosapic_lock, flags);
 	{
-		writel(IOSAPIC_RTE_HIGH(rte_index), addr + IOSAPIC_REG_SELECT);
-		writel(high32, addr + IOSAPIC_WINDOW);
-		writel(IOSAPIC_RTE_LOW(rte_index), addr + IOSAPIC_REG_SELECT);
-		writel(low32, addr + IOSAPIC_WINDOW);
+		iosapic_write(addr, IOSAPIC_RTE_HIGH(rte_index), high32);
+		iosapic_write(addr, IOSAPIC_RTE_LOW(rte_index), low32);
 		iosapic_intr_info[vector].low32 = low32;
 	}
 	spin_unlock_irqrestore(&iosapic_lock, flags);
@@ -250,12 +247,9 @@ mask_irq (unsigned int irq)
 
 	spin_lock_irqsave(&iosapic_lock, flags);
 	{
-		writel(IOSAPIC_RTE_LOW(rte_index), addr + IOSAPIC_REG_SELECT);
-
 		/* set only the mask bit */
 		low32 = iosapic_intr_info[vec].low32 |= IOSAPIC_MASK;
-
-		writel(low32, addr + IOSAPIC_WINDOW);
+		iosapic_write(addr, IOSAPIC_RTE_LOW(rte_index), low32);
 	}
 	spin_unlock_irqrestore(&iosapic_lock, flags);
 }
@@ -276,9 +270,8 @@ unmask_irq (unsigned int irq)
 
 	spin_lock_irqsave(&iosapic_lock, flags);
 	{
-		writel(IOSAPIC_RTE_LOW(rte_index), addr + IOSAPIC_REG_SELECT);
 		low32 = iosapic_intr_info[vec].low32 &= ~IOSAPIC_MASK;
-		writel(low32, addr + IOSAPIC_WINDOW);
+		iosapic_write(addr, IOSAPIC_RTE_LOW(rte_index), low32);
 	}
 	spin_unlock_irqrestore(&iosapic_lock, flags);
 }
@@ -326,30 +319,13 @@ iosapic_set_affinity (unsigned int irq, cpumask_t mask)
 			low32 |= (IOSAPIC_FIXED << IOSAPIC_DELIVERY_SHIFT);
 
 		iosapic_intr_info[vec].low32 = low32;
-		writel(IOSAPIC_RTE_HIGH(rte_index), addr + IOSAPIC_REG_SELECT);
-		writel(high32, addr + IOSAPIC_WINDOW);
-		writel(IOSAPIC_RTE_LOW(rte_index), addr + IOSAPIC_REG_SELECT);
-		writel(low32, addr + IOSAPIC_WINDOW);
+		iosapic_write(addr, IOSAPIC_RTE_HIGH(rte_index), high32);
+		iosapic_write(addr, IOSAPIC_RTE_LOW(rte_index), low32);
 	}
 	spin_unlock_irqrestore(&iosapic_lock, flags);
 #endif
 }
 
-static inline void move_irq(int irq)
-{
-	/* note - we hold desc->lock */
-	cpumask_t tmp;
-	irq_desc_t *desc = irq_descp(irq);
-
-	if (!cpus_empty(pending_irq_cpumask[irq])) {
-		cpus_and(tmp, pending_irq_cpumask[irq], cpu_online_map);
-		if (unlikely(!cpus_empty(tmp))) {
-			desc->handler->set_affinity(irq, pending_irq_cpumask[irq]);
-		}
-		cpus_clear(pending_irq_cpumask[irq]);
-	}
-}
-
 /*
  * Handlers for level-triggered interrupts.
  */
@@ -367,7 +343,7 @@ iosapic_end_level_irq (unsigned int irq)
 	ia64_vector vec = irq_to_vector(irq);
 
 	move_irq(irq);
-	writel(vec, iosapic_intr_info[vec].addr + IOSAPIC_EOI);
+	iosapic_eoi(iosapic_intr_info[vec].addr, vec);
 }
 
 #define iosapic_shutdown_level_irq	mask_irq
@@ -444,8 +420,7 @@ iosapic_version (char *addr)
 	 *	unsigned int reserved2 : 8;
 	 * }
 	 */
-	writel(IOSAPIC_VERSION, addr + IOSAPIC_REG_SELECT);
-	return readl(IOSAPIC_WINDOW + addr);
+	return iosapic_read(addr, IOSAPIC_VERSION);
 }
 
 /*
@@ -483,7 +458,7 @@ register_intr (unsigned int gsi, int vector, unsigned char delivery,
 
 	index = find_iosapic(gsi);
 	if (index < 0) {
-		printk(KERN_WARNING "%s: No IOSAPIC for GSI 0x%x\n", __FUNCTION__, gsi);
+		printk(KERN_WARNING "%s: No IOSAPIC for GSI %u\n", __FUNCTION__, gsi);
 		return;
 	}
 
@@ -512,6 +487,42 @@ register_intr (unsigned int gsi, int vector, unsigned char delivery,
 	}
 }
 
+static unsigned int
+get_target_cpu (void)
+{
+#ifdef CONFIG_SMP
+	static int cpu = -1;
+
+	/*
+	 * If the platform supports redirection via XTP, let it
+	 * distribute interrupts.
+	 */
+	if (smp_int_redirect & SMP_IRQ_REDIRECTION)
+		return hard_smp_processor_id();
+
+	/*
+	 * Some interrupts (ACPI SCI, for instance) are registered
+	 * before the BSP is marked as online.
+	 */
+	if (!cpu_online(smp_processor_id()))
+		return hard_smp_processor_id();
+
+	/*
+	 * Otherwise, round-robin interrupt vectors across all the
+	 * processors.  (It'd be nice if we could be smarter in the
+	 * case of NUMA.)
+	 */
+	do {
+		if (++cpu >= NR_CPUS)
+			cpu = 0;
+	} while (!cpu_online(cpu));
+
+	return cpu_physical_id(cpu);
+#else
+	return hard_smp_processor_id();
+#endif
+}
+
 /*
  * ACPI can describe IOSAPIC interrupts via static tables and namespace
  * methods.  This provides an interface to register those interrupts and
@@ -522,21 +533,35 @@ iosapic_register_intr (unsigned int gsi,
 		       unsigned long polarity, unsigned long trigger)
 {
 	int vector;
-	unsigned int dest = (ia64_getreg(_IA64_REG_CR_LID) >> 16) & 0xffff;
+	unsigned int dest;
+	unsigned long flags;
 
-	vector = gsi_to_vector(gsi);
-	if (vector < 0)
-		vector = assign_irq_vector(AUTO_ASSIGN);
+	/*
+	 * If this GSI has already been registered (i.e., it's a
+	 * shared interrupt, or we lost a race to register it),
+	 * don't touch the RTE.
+	 */
+	spin_lock_irqsave(&iosapic_lock, flags);
+	{
+		vector = gsi_to_vector(gsi);
+		if (vector > 0) {
+			spin_unlock_irqrestore(&iosapic_lock, flags);
+			return vector;
+		}
 
-	register_intr(gsi, vector, IOSAPIC_LOWEST_PRIORITY,
-		      polarity, trigger);
+		vector = assign_irq_vector(AUTO_ASSIGN);
+		dest = get_target_cpu();
+		register_intr(gsi, vector, IOSAPIC_LOWEST_PRIORITY,
+			polarity, trigger);
+	}
+	spin_unlock_irqrestore(&iosapic_lock, flags);
 
-	printk(KERN_INFO "GSI 0x%x(%s,%s) -> CPU 0x%04x vector %d\n",
-	       gsi, (polarity == IOSAPIC_POL_HIGH ? "high" : "low"),
-	       (trigger == IOSAPIC_EDGE ? "edge" : "level"), dest, vector);
+	printk(KERN_INFO "GSI %u (%s, %s) -> CPU %d (0x%04x) vector %d\n",
+	       gsi, (trigger == IOSAPIC_EDGE ? "edge" : "level"),
+	       (polarity == IOSAPIC_POL_HIGH ? "high" : "low"),
+	       cpu_logical_id(dest), dest, vector);
 
-	/* program the IOSAPIC routing table */
-	set_rte(vector, dest, 0);
+	set_rte(vector, dest, 1);
 	return vector;
 }
 
@@ -549,8 +574,9 @@ iosapic_register_platform_intr (u32 int_type, unsigned int gsi,
 				int iosapic_vector, u16 eid, u16 id,
 				unsigned long polarity, unsigned long trigger)
 {
+	static const char * const name[] = {"unknown", "PMI", "INIT", "CPEI"};
 	unsigned char delivery;
-	int vector;
+	int vector, mask = 0;
 	unsigned int dest = ((id << 8) | eid) & 0xffff;
 
 	switch (int_type) {
@@ -570,21 +596,22 @@ iosapic_register_platform_intr (u32 int_type, unsigned int gsi,
 	      case ACPI_INTERRUPT_CPEI:
 		vector = IA64_CPE_VECTOR;
 		delivery = IOSAPIC_LOWEST_PRIORITY;
+		mask = 1;
 		break;
 	      default:
-		printk(KERN_ERR "iosapic_register_platform_irq(): invalid int type\n");
+		printk(KERN_ERR "iosapic_register_platform_irq(): invalid int type 0x%x\n", int_type);
 		return -1;
 	}
 
-	register_intr(gsi, vector, delivery, polarity,
-		      trigger);
+	register_intr(gsi, vector, delivery, polarity, trigger);
 
-	printk(KERN_INFO "PLATFORM int 0x%x: GSI 0x%x(%s,%s) -> CPU 0x%04x vector %d\n",
-	       int_type, gsi, (polarity == IOSAPIC_POL_HIGH ? "high" : "low"),
-	       (trigger == IOSAPIC_EDGE ? "edge" : "level"), dest, vector);
+	printk(KERN_INFO "PLATFORM int %s (0x%x): GSI %u (%s, %s) -> CPU %d (0x%04x) vector %d\n",
+	       int_type < ARRAY_SIZE(name) ? name[int_type] : "unknown",
+	       int_type, gsi, (trigger == IOSAPIC_EDGE ? "edge" : "level"),
+	       (polarity == IOSAPIC_POL_HIGH ? "high" : "low"),
+	       cpu_logical_id(dest), dest, vector);
 
-	/* program the IOSAPIC routing table */
-	set_rte(vector, dest, 0);
+	set_rte(vector, dest, mask);
 	return vector;
 }
 
@@ -599,18 +626,18 @@ iosapic_override_isa_irq (unsigned int isa_irq, unsigned int gsi,
 			  unsigned long trigger)
 {
 	int vector;
-	unsigned int dest = (ia64_getreg(_IA64_REG_CR_LID) >> 16) & 0xffff;
+	unsigned int dest = hard_smp_processor_id();
 
 	vector = isa_irq_to_vector(isa_irq);
 
 	register_intr(gsi, vector, IOSAPIC_LOWEST_PRIORITY, polarity, trigger);
 
-	DBG("ISA: IRQ %u -> GSI 0x%x (%s,%s) -> CPU 0x%04x vector %d\n",
-	    isa_irq, gsi, polarity == IOSAPIC_POL_HIGH ? "high" : "low",
-	    trigger == IOSAPIC_EDGE ? "edge" : "level", dest, vector);
+	DBG("ISA: IRQ %u -> GSI %u (%s,%s) -> CPU %d (0x%04x) vector %d\n",
+	    isa_irq, gsi, trigger == IOSAPIC_EDGE ? "edge" : "level",
+	    polarity == IOSAPIC_POL_HIGH ? "high" : "low",
+	    cpu_logical_id(dest), dest, vector);
 
-	/* program the IOSAPIC routing table */
-	set_rte(vector, dest, 0);
+	set_rte(vector, dest, 1);
 }
 
 void __init
@@ -665,104 +692,3 @@ iosapic_init (unsigned long phys_addr, unsigned int gsi_base)
 			iosapic_override_isa_irq(isa_irq, isa_irq, IOSAPIC_POL_HIGH, IOSAPIC_EDGE);
 	}
 }
-
-void
-iosapic_enable_intr (unsigned int vector)
-{
-	unsigned int dest;
-	irq_desc_t *desc;
-
-	/*
-	 * In the case of a shared interrupt, do not re-route the vector, and
-	 * especially do not mask a running interrupt (startup will not get
-	 * called for a shared interrupt).
-	 */
-	desc = irq_descp(vector);
-	if (desc->action)
-		return;
-
-#ifdef CONFIG_SMP
-	/*
-	 * For platforms that do not support interrupt redirect via the XTP interface, we
-	 * can round-robin the PCI device interrupts to the processors
-	 */
-	if (!(smp_int_redirect & SMP_IRQ_REDIRECTION)) {
-		static int cpu_index = -1;
-
-		do
-			if (++cpu_index >= NR_CPUS)
-				cpu_index = 0;
-		while (!cpu_online(cpu_index));
-
-		dest = cpu_physical_id(cpu_index) & 0xffff;
-	} else {
-		/*
-		 * Direct the interrupt vector to the current cpu, platform redirection
-		 * will distribute them.
-		 */
-		dest = (ia64_getreg(_IA64_REG_CR_LID) >> 16) & 0xffff;
-	}
-#else
-	/* direct the interrupt vector to the running cpu id */
-	dest = (ia64_getreg(_IA64_REG_CR_LID) >> 16) & 0xffff;
-#endif
-	set_rte(vector, dest, 1);
-
-	printk(KERN_INFO "IOSAPIC: vector %d -> CPU 0x%04x, enabled\n",
-	       vector, dest);
-}
-
-#ifdef CONFIG_ACPI_PCI
-
-void __init
-iosapic_parse_prt (void)
-{
-	struct acpi_prt_entry *entry;
-	struct list_head *node;
-	unsigned int gsi;
-	int vector;
-	char pci_id[16];
-	struct hw_interrupt_type *irq_type = &irq_type_iosapic_level;
-	irq_desc_t *idesc;
-
-	list_for_each(node, &acpi_prt.entries) {
-		entry = list_entry(node, struct acpi_prt_entry, node);
-
-		/* We're only interested in static (non-link) entries.  */
-		if (entry->link.handle)
-			continue;
-
-		gsi = entry->link.index;
-
-		vector = gsi_to_vector(gsi);
-		if (vector < 0) {
-			if (find_iosapic(gsi) < 0)
-				continue;
-
-			/* allocate a vector for this interrupt line */
-			if (pcat_compat && (gsi < 16))
-				vector = isa_irq_to_vector(gsi);
-			else
-				/* new GSI; allocate a vector for it */
-				vector = assign_irq_vector(AUTO_ASSIGN);
-
-			register_intr(gsi, vector, IOSAPIC_LOWEST_PRIORITY, IOSAPIC_POL_LOW,
-				      IOSAPIC_LEVEL);
-		}
-		entry->irq = vector;
-		snprintf(pci_id, sizeof(pci_id), "%02x:%02x:%02x[%c]",
-			 entry->id.segment, entry->id.bus, entry->id.device, 'A' + entry->pin);
-
-		/*
-		 * If vector was previously initialized to a different
-		 * handler, re-initialize.
-		 */
-		idesc = irq_descp(vector);
-		if (idesc->handler != irq_type)
-			register_intr(gsi, vector, IOSAPIC_LOWEST_PRIORITY, IOSAPIC_POL_LOW,
-				      IOSAPIC_LEVEL);
-
-	}
-}
-
-#endif /* CONFIG_ACPI */
diff --git a/arch/ia64/kernel/irq.c b/arch/ia64/kernel/irq.c
index 42056fbaa..9ec161c63 100644
--- a/arch/ia64/kernel/irq.c
+++ b/arch/ia64/kernel/irq.c
@@ -87,7 +87,8 @@ irq_desc_t _irq_desc[NR_IRQS] __cacheline_aligned = {
 /*
  * This is updated when the user sets irq affinity via /proc
  */
-cpumask_t    __cacheline_aligned pending_irq_cpumask[NR_IRQS];
+cpumask_t __cacheline_aligned pending_irq_cpumask[NR_IRQS];
+static unsigned long pending_irq_redir[BITS_TO_LONGS(NR_IRQS)];
 
 #ifdef CONFIG_IA64_GENERIC
 irq_desc_t * __ia64_irq_desc (unsigned int irq)
@@ -607,7 +608,7 @@ int request_irq(unsigned int irq,
 
 	action->handler = handler;
 	action->flags = irqflags;
-	action->mask = 0;
+	cpus_clear(action->mask);
 	action->name = devname;
 	action->next = NULL;
 	action->dev_id = dev_id;
@@ -973,6 +974,7 @@ static int irq_affinity_write_proc (struct file *file, const char *buffer,
 	int prelen;
 	irq_desc_t *desc = irq_descp(irq);
 	unsigned long flags;
+	int redir = 0;
 
 	if (!desc->handler->set_affinity)
 		return -EIO;
@@ -995,7 +997,7 @@ static int irq_affinity_write_proc (struct file *file, const char *buffer,
 	prelen = 0;
 	if (tolower(*rbuf) == 'r') {
 		prelen = strspn(rbuf, "Rr ");
-		irq |= IA64_IRQ_REDIRECTED;
+		redir++;
 	}
 
 	err = cpumask_parse(buffer+prelen, count-prelen, new_value);
@@ -1013,11 +1015,33 @@ static int irq_affinity_write_proc (struct file *file, const char *buffer,
 
 	spin_lock_irqsave(&desc->lock, flags);
 	pending_irq_cpumask[irq] = new_value;
+	if (redir)
+		set_bit(irq, pending_irq_redir);
+	else
+		clear_bit(irq, pending_irq_redir);
 	spin_unlock_irqrestore(&desc->lock, flags);
 
 	return full_count;
 }
 
+void move_irq(int irq)
+{
+	/* note - we hold desc->lock */
+	cpumask_t tmp;
+	irq_desc_t *desc = irq_descp(irq);
+	int redir = test_bit(irq, pending_irq_redir);
+
+	if (!cpus_empty(pending_irq_cpumask[irq])) {
+		cpus_and(tmp, pending_irq_cpumask[irq], cpu_online_map);
+		if (unlikely(!cpus_empty(tmp))) {
+			desc->handler->set_affinity(irq | (redir ? IA64_IRQ_REDIRECTED : 0),
+						    pending_irq_cpumask[irq]);
+		}
+		cpus_clear(pending_irq_cpumask[irq]);
+	}
+}
+
+
 #endif /* CONFIG_SMP */
 
 #ifdef CONFIG_HOTPLUG_CPU
diff --git a/arch/ia64/kernel/ivt.S b/arch/ia64/kernel/ivt.S
index 1269d2c0f..0834c7bcb 100644
--- a/arch/ia64/kernel/ivt.S
+++ b/arch/ia64/kernel/ivt.S
@@ -752,7 +752,9 @@ ENTRY(break_fault)
 	;;
 	ld4 r2=[r2]				// r2 = current_thread_info()->flags
 	;;
-	tbit.z p8,p0=r2,TIF_SYSCALL_TRACE
+	and r2=_TIF_SYSCALL_TRACEAUDIT,r2	// mask trace or audit
+	;;
+	cmp.eq p8,p0=r2,r0
 	mov b6=r20
 	;;
 (p8)	br.call.sptk.many b6=b6			// ignore this return addr
@@ -1573,10 +1575,11 @@ ENTRY(dispatch_to_ia32_handler)
 	ld4 r2=[r2]		// r2 = current_thread_info()->flags
 	;;
 	ld8 r16=[r16]
-	tbit.z p8,p0=r2,TIF_SYSCALL_TRACE
+	and r2=_TIF_SYSCALL_TRACEAUDIT,r2	// mask trace or audit
 	;;
 	mov b6=r16
 	movl r15=ia32_ret_from_syscall
+	cmp.eq p8,p0=r2,r0
 	;;
 	mov rp=r15
 (p8)	br.call.sptk.many b6=b6
diff --git a/arch/ia64/kernel/machvec.c b/arch/ia64/kernel/machvec.c
index cd70ff190..c3a04ee7f 100644
--- a/arch/ia64/kernel/machvec.c
+++ b/arch/ia64/kernel/machvec.c
@@ -43,12 +43,6 @@ machvec_init (const char *name)
 
 #endif /* CONFIG_IA64_GENERIC */
 
-void
-machvec_noop (void)
-{
-}
-EXPORT_SYMBOL(machvec_noop);
-
 void
 machvec_setup (char **arg)
 {
diff --git a/arch/ia64/kernel/mca.c b/arch/ia64/kernel/mca.c
index 3f2e929a2..9c5104cc5 100644
--- a/arch/ia64/kernel/mca.c
+++ b/arch/ia64/kernel/mca.c
@@ -108,6 +108,7 @@ struct ia64_mca_tlb_info ia64_mca_tlb_list[NR_CPUS];
 #define MAX_CPE_POLL_INTERVAL (15*60*HZ) /* 15 minutes */
 #define MIN_CPE_POLL_INTERVAL (2*60*HZ)  /* 2 minutes */
 #define CMC_POLL_INTERVAL     (1*60*HZ)  /* 1 minute */
+#define CPE_HISTORY_LENGTH    5
 #define CMC_HISTORY_LENGTH    5
 
 static struct timer_list cpe_poll_timer;
@@ -129,6 +130,8 @@ static int cpe_poll_enabled = 1;
 
 extern void salinfo_log_wakeup(int type, u8 *buffer, u64 size, int irqsafe);
 
+static int mca_init;
+
 /*
  * IA64_MCA log support
  */
@@ -244,7 +247,9 @@ ia64_mca_log_sal_error_record(int sal_info_type)
 	u8 *buffer;
 	u64 size;
 	int irq_safe = sal_info_type != SAL_INFO_TYPE_MCA && sal_info_type != SAL_INFO_TYPE_INIT;
+#ifdef IA64_MCA_DEBUG_INFO
 	static const char * const rec_name[] = { "MCA", "INIT", "CMC", "CPE" };
+#endif
 
 	size = ia64_log_get(sal_info_type, &buffer, irq_safe);
 	if (!size)
@@ -253,7 +258,7 @@ ia64_mca_log_sal_error_record(int sal_info_type)
 	salinfo_log_wakeup(sal_info_type, buffer, size, irq_safe);
 
 	if (irq_safe)
-		printk(KERN_INFO "CPU %d: SAL log contains %s error record\n",
+		IA64_MCA_DEBUG("CPU %d: SAL log contains %s error record\n",
 			smp_processor_id(),
 			sal_info_type < ARRAY_SIZE(rec_name) ? rec_name[sal_info_type] : "UNKNOWN");
 
@@ -267,20 +272,67 @@ ia64_mca_log_sal_error_record(int sal_info_type)
  */
 #ifndef PLATFORM_MCA_HANDLERS
 
+#ifdef CONFIG_ACPI
+
+static int cpe_vector = -1;
+
 static irqreturn_t
 ia64_mca_cpe_int_handler (int cpe_irq, void *arg, struct pt_regs *ptregs)
 {
-	IA64_MCA_DEBUG("%s: received interrupt. CPU:%d vector = %#x\n",
-		       __FUNCTION__, smp_processor_id(), cpe_irq);
+	static unsigned long	cpe_history[CPE_HISTORY_LENGTH];
+	static int		index;
+	static spinlock_t	cpe_history_lock = SPIN_LOCK_UNLOCKED;
+
+	IA64_MCA_DEBUG("%s: received interrupt vector = %#x on CPU %d\n",
+		       __FUNCTION__, cpe_irq, smp_processor_id());
 
 	/* SAL spec states this should run w/ interrupts enabled */
 	local_irq_enable();
 
-	/* Get the CMC error record and log it */
+	/* Get the CPE error record and log it */
 	ia64_mca_log_sal_error_record(SAL_INFO_TYPE_CPE);
+
+	spin_lock(&cpe_history_lock);
+	if (!cpe_poll_enabled && cpe_vector >= 0) {
+
+		int i, count = 1; /* we know 1 happened now */
+		unsigned long now = jiffies;
+
+		for (i = 0; i < CPE_HISTORY_LENGTH; i++) {
+			if (now - cpe_history[i] <= HZ)
+				count++;
+		}
+
+		IA64_MCA_DEBUG(KERN_INFO "CPE threshold %d/%d\n", count, CPE_HISTORY_LENGTH);
+		if (count >= CPE_HISTORY_LENGTH) {
+
+			cpe_poll_enabled = 1;
+			spin_unlock(&cpe_history_lock);
+			disable_irq_nosync(local_vector_to_irq(IA64_CPE_VECTOR));
+
+			/*
+			 * Corrected errors will still be corrected, but
+			 * make sure there's a log somewhere that indicates
+			 * something is generating more than we can handle.
+			 */
+			printk(KERN_WARNING "WARNING: Switching to polling CPE handler; error records may be lost\n");
+
+			mod_timer(&cpe_poll_timer, jiffies + MIN_CPE_POLL_INTERVAL);
+
+			/* lock already released, get out now */
+			return IRQ_HANDLED;
+		} else {
+			cpe_history[index++] = now;
+			if (index == CPE_HISTORY_LENGTH)
+				index = 0;
+		}
+	}
+	spin_unlock(&cpe_history_lock);
 	return IRQ_HANDLED;
 }
 
+#endif /* CONFIG_ACPI */
+
 static void
 show_min_state (pal_min_state_area_t *minstate)
 {
@@ -492,7 +544,7 @@ ia64_mca_register_cpev (int cpev)
 	}
 
 	IA64_MCA_DEBUG("%s: corrected platform error "
-		       "vector %#x setup and enabled\n", __FUNCTION__, cpev);
+		       "vector %#x registered\n", __FUNCTION__, cpev);
 }
 #endif /* CONFIG_ACPI */
 
@@ -501,8 +553,9 @@ ia64_mca_register_cpev (int cpev)
 /*
  * ia64_mca_cmc_vector_setup
  *
- *  Setup the corrected machine check vector register in the processor and
- *  unmask interrupt.  This function is invoked on a per-processor basis.
+ *  Setup the corrected machine check vector register in the processor.
+ *  (The interrupt is masked on boot. ia64_mca_late_init unmask this.)
+ *  This function is invoked on a per-processor basis.
  *
  * Inputs
  *      None
@@ -516,12 +569,12 @@ ia64_mca_cmc_vector_setup (void)
 	cmcv_reg_t	cmcv;
 
 	cmcv.cmcv_regval	= 0;
-	cmcv.cmcv_mask		= 0;        /* Unmask/enable interrupt */
+	cmcv.cmcv_mask		= 1;        /* Mask/disable interrupt at first */
 	cmcv.cmcv_vector	= IA64_CMC_VECTOR;
 	ia64_setreg(_IA64_REG_CR_CMCV, cmcv.cmcv_regval);
 
 	IA64_MCA_DEBUG("%s: CPU %d corrected "
-		       "machine check vector %#x setup and enabled.\n",
+		       "machine check vector %#x registered.\n",
 		       __FUNCTION__, smp_processor_id(), IA64_CMC_VECTOR);
 
 	IA64_MCA_DEBUG("%s: CPU %d CMCV = %#016lx\n",
@@ -548,7 +601,7 @@ ia64_mca_cmc_vector_disable (void *dummy)
 	cmcv = (cmcv_reg_t)ia64_getreg(_IA64_REG_CR_CMCV);
 
 	cmcv.cmcv_mask = 1; /* Mask/disable interrupt */
-	ia64_setreg(_IA64_REG_CR_CMCV, cmcv.cmcv_regval)
+	ia64_setreg(_IA64_REG_CR_CMCV, cmcv.cmcv_regval);
 
 	IA64_MCA_DEBUG("%s: CPU %d corrected "
 		       "machine check vector %#x disabled.\n",
@@ -575,7 +628,7 @@ ia64_mca_cmc_vector_enable (void *dummy)
 	cmcv = (cmcv_reg_t)ia64_getreg(_IA64_REG_CR_CMCV);
 
 	cmcv.cmcv_mask = 0; /* Unmask/enable interrupt */
-	ia64_setreg(_IA64_REG_CR_CMCV, cmcv.cmcv_regval)
+	ia64_setreg(_IA64_REG_CR_CMCV, cmcv.cmcv_regval);
 
 	IA64_MCA_DEBUG("%s: CPU %d corrected "
 		       "machine check vector %#x enabled.\n",
@@ -901,7 +954,7 @@ ia64_mca_cmc_int_handler(int cmc_irq, void *arg, struct pt_regs *ptregs)
  * 	handled
  */
 static irqreturn_t
-ia64_mca_cmc_int_caller(int cpe_irq, void *arg, struct pt_regs *ptregs)
+ia64_mca_cmc_int_caller(int cmc_irq, void *arg, struct pt_regs *ptregs)
 {
 	static int start_count = -1;
 	unsigned int cpuid;
@@ -912,7 +965,7 @@ ia64_mca_cmc_int_caller(int cpe_irq, void *arg, struct pt_regs *ptregs)
 	if (start_count == -1)
 		start_count = IA64_LOG_COUNT(SAL_INFO_TYPE_CMC);
 
-	ia64_mca_cmc_int_handler(cpe_irq, arg, ptregs);
+	ia64_mca_cmc_int_handler(cmc_irq, arg, ptregs);
 
 	for (++cpuid ; cpuid < NR_CPUS && !cpu_online(cpuid) ; cpuid++);
 
@@ -967,11 +1020,13 @@ ia64_mca_cmc_poll (unsigned long dummy)
  * Outputs
  * 	handled
  */
+#ifdef CONFIG_ACPI
+
 static irqreturn_t
 ia64_mca_cpe_int_caller(int cpe_irq, void *arg, struct pt_regs *ptregs)
 {
 	static int start_count = -1;
-	static int poll_time = MAX_CPE_POLL_INTERVAL;
+	static int poll_time = MIN_CPE_POLL_INTERVAL;
 	unsigned int cpuid;
 
 	cpuid = smp_processor_id();
@@ -989,20 +1044,30 @@ ia64_mca_cpe_int_caller(int cpe_irq, void *arg, struct pt_regs *ptregs)
 	} else {
 		/*
 		 * If a log was recorded, increase our polling frequency,
-		 * otherwise, backoff.
+		 * otherwise, backoff or return to interrupt mode.
 		 */
 		if (start_count != IA64_LOG_COUNT(SAL_INFO_TYPE_CPE)) {
 			poll_time = max(MIN_CPE_POLL_INTERVAL, poll_time / 2);
-		} else {
+		} else if (cpe_vector < 0) {
 			poll_time = min(MAX_CPE_POLL_INTERVAL, poll_time * 2);
+		} else {
+			poll_time = MIN_CPE_POLL_INTERVAL;
+
+			printk(KERN_WARNING "Returning to interrupt driven CPE handler\n");
+			enable_irq(local_vector_to_irq(IA64_CPE_VECTOR));
+			cpe_poll_enabled = 0;
 		}
+
+		if (cpe_poll_enabled)
+			mod_timer(&cpe_poll_timer, jiffies + poll_time);
 		start_count = -1;
-		mod_timer(&cpe_poll_timer, jiffies + poll_time);
 	}
 
 	return IRQ_HANDLED;
 }
 
+#endif /* CONFIG_ACPI */
+
 /*
  *  ia64_mca_cpe_poll
  *
@@ -1231,7 +1296,7 @@ ia64_mca_init(void)
 	 */
 	register_percpu_irq(IA64_CMC_VECTOR, &cmci_irqaction);
 	register_percpu_irq(IA64_CMCP_VECTOR, &cmcp_irqaction);
-	ia64_mca_cmc_vector_setup();       /* Setup vector on BSP & enable */
+	ia64_mca_cmc_vector_setup();       /* Setup vector on BSP */
 
 	/* Setup the MCA rendezvous interrupt vector */
 	register_percpu_irq(IA64_MCA_RENDEZ_VECTOR, &mca_rdzv_irqaction);
@@ -1240,22 +1305,9 @@ ia64_mca_init(void)
 	register_percpu_irq(IA64_MCA_WAKEUP_VECTOR, &mca_wkup_irqaction);
 
 #ifdef CONFIG_ACPI
-	/* Setup the CPE interrupt vector */
-	{
-		irq_desc_t *desc;
-		unsigned int irq;
-		int cpev = acpi_request_vector(ACPI_INTERRUPT_CPEI);
-
-		if (cpev >= 0) {
-			for (irq = 0; irq < NR_IRQS; ++irq)
-				if (irq_to_vector(irq) == cpev) {
-					desc = irq_descp(irq);
-					desc->status |= IRQ_PER_CPU;
-					setup_irq(irq, &mca_cpe_irqaction);
-				}
-			ia64_mca_register_cpev(cpev);
-		}
-	}
+	/* Setup the CPEI/P vector and handler */
+	cpe_vector = acpi_request_vector(ACPI_INTERRUPT_CPEI);
+	register_percpu_irq(IA64_CPEP_VECTOR, &mca_cpep_irqaction);
 #endif
 
 	/* Initialize the areas set aside by the OS to buffer the
@@ -1267,6 +1319,7 @@ ia64_mca_init(void)
 	ia64_log_init(SAL_INFO_TYPE_CMC);
 	ia64_log_init(SAL_INFO_TYPE_CPE);
 
+	mca_init = 1;
 	printk(KERN_INFO "MCA related initialization done\n");
 }
 
@@ -1283,20 +1336,46 @@ ia64_mca_init(void)
 static int __init
 ia64_mca_late_init(void)
 {
+	if (!mca_init)
+		return 0;
+
+	/* Setup the CMCI/P vector and handler */
 	init_timer(&cmc_poll_timer);
 	cmc_poll_timer.function = ia64_mca_cmc_poll;
 
-	/* Reset to the correct state */
+	/* Unmask/enable the vector */
 	cmc_polling_enabled = 0;
+	schedule_work(&cmc_enable_work);
+
+	IA64_MCA_DEBUG("%s: CMCI/P setup and enabled.\n", __FUNCTION__);
 
+#ifdef CONFIG_ACPI
+	/* Setup the CPEI/P vector and handler */
 	init_timer(&cpe_poll_timer);
 	cpe_poll_timer.function = ia64_mca_cpe_poll;
 
-#ifdef CONFIG_ACPI
-	/* If platform doesn't support CPEI, get the timer going. */
-	if (acpi_request_vector(ACPI_INTERRUPT_CPEI) < 0 && cpe_poll_enabled) {
-		register_percpu_irq(IA64_CPEP_VECTOR, &mca_cpep_irqaction);
-		ia64_mca_cpe_poll(0UL);
+	{
+		irq_desc_t *desc;
+		unsigned int irq;
+
+		if (cpe_vector >= 0) {
+			/* If platform supports CPEI, enable the irq. */
+			cpe_poll_enabled = 0;
+			for (irq = 0; irq < NR_IRQS; ++irq)
+				if (irq_to_vector(irq) == cpe_vector) {
+					desc = irq_descp(irq);
+					desc->status |= IRQ_PER_CPU;
+					setup_irq(irq, &mca_cpe_irqaction);
+				}
+			ia64_mca_register_cpev(cpe_vector);
+			IA64_MCA_DEBUG("%s: CPEI/P setup and enabled.\n", __FUNCTION__);
+		} else {
+			/* If platform doesn't support CPEI, get the timer going. */
+			if (cpe_poll_enabled) {
+				ia64_mca_cpe_poll(0UL);
+				IA64_MCA_DEBUG("%s: CPEP setup and enabled.\n", __FUNCTION__);
+			}
+		}
 	}
 #endif
 
diff --git a/arch/ia64/kernel/module.c b/arch/ia64/kernel/module.c
index e8ea942fa..2ee61a213 100644
--- a/arch/ia64/kernel/module.c
+++ b/arch/ia64/kernel/module.c
@@ -656,8 +656,18 @@ do_reloc (struct module *mod, uint8_t r_type, Elf64_Sym *sym, uint64_t addend,
 	      case RV_PCREL:
 		switch (r_type) {
 		      case R_IA64_PCREL21B:
-			/* special because it can cross into other module/kernel-core.  */
-			if (!is_internal(mod, val))
+			if ((in_init(mod, val) && in_core(mod, (uint64_t)location)) ||
+			    (in_core(mod, val) && in_init(mod, (uint64_t)location))) {
+				/*
+				 * Init section may have been allocated far away from core,
+				 * if the branch won't reach, then allocate a plt for it.
+				 */
+				uint64_t delta = ((int64_t)val - (int64_t)location) / 16;
+				if (delta + (1 << 20) >= (1 << 21)) {
+					val = get_fdesc(mod, val, &ok);
+					val = get_plt(mod, location, val, &ok);
+				}
+			} else if (!is_internal(mod, val))
 				val = get_plt(mod, location, val, &ok);
 			/* FALL THROUGH */
 		      default:
diff --git a/arch/ia64/kernel/pal.S b/arch/ia64/kernel/pal.S
index 530d63d49..5018c7f2e 100644
--- a/arch/ia64/kernel/pal.S
+++ b/arch/ia64/kernel/pal.S
@@ -54,8 +54,8 @@ END(ia64_pal_default_handler)
  *
  */
 GLOBAL_ENTRY(ia64_pal_call_static)
-	.prologue ASM_UNW_PRLG_RP|ASM_UNW_PRLG_PFS, ASM_UNW_PRLG_GRSAVE(6)
-	alloc loc1 = ar.pfs,6,90,0,0
+	.prologue ASM_UNW_PRLG_RP|ASM_UNW_PRLG_PFS, ASM_UNW_PRLG_GRSAVE(5)
+	alloc loc1 = ar.pfs,5,5,0,0
 	movl loc2 = pal_entry_point
 1:	{
 	  mov r28 = in0
@@ -66,7 +66,9 @@ GLOBAL_ENTRY(ia64_pal_call_static)
 	ld8 loc2 = [loc2]		// loc2 <- entry point
 	tbit.nz p6,p7 = in4, 0
 	adds r8 = 1f-1b,r8
+	mov loc4=ar.rsc			// save RSE configuration
 	;;
+	mov ar.rsc=0			// put RSE in enforced lazy, LE mode
 	mov loc3 = psr
 	mov loc0 = rp
 	.body
@@ -82,6 +84,7 @@ GLOBAL_ENTRY(ia64_pal_call_static)
 	mov rp = r8
 	br.cond.sptk.many b7
 1:	mov psr.l = loc3
+	mov ar.rsc = loc4		// restore RSE configuration
 	mov ar.pfs = loc1
 	mov rp = loc0
 	;;
@@ -97,8 +100,8 @@ END(ia64_pal_call_static)
  * 	in2 - in3   Remaning PAL arguments
  */
 GLOBAL_ENTRY(ia64_pal_call_stacked)
-	.prologue ASM_UNW_PRLG_RP|ASM_UNW_PRLG_PFS, ASM_UNW_PRLG_GRSAVE(5)
-	alloc loc1 = ar.pfs,5,4,87,0
+	.prologue ASM_UNW_PRLG_RP|ASM_UNW_PRLG_PFS, ASM_UNW_PRLG_GRSAVE(4)
+	alloc loc1 = ar.pfs,4,4,4,0
 	movl loc2 = pal_entry_point
 
 	mov r28  = in0			// Index MUST be copied to r28
@@ -144,8 +147,8 @@ END(ia64_pal_call_stacked)
 
 
 GLOBAL_ENTRY(ia64_pal_call_phys_static)
-	.prologue ASM_UNW_PRLG_RP|ASM_UNW_PRLG_PFS, ASM_UNW_PRLG_GRSAVE(6)
-	alloc loc1 = ar.pfs,6,90,0,0
+	.prologue ASM_UNW_PRLG_RP|ASM_UNW_PRLG_PFS, ASM_UNW_PRLG_GRSAVE(4)
+	alloc loc1 = ar.pfs,4,7,0,0
 	movl loc2 = pal_entry_point
 1:	{
 	  mov r28  = in0		// copy procedure index
@@ -176,10 +179,14 @@ GLOBAL_ENTRY(ia64_pal_call_phys_static)
 	andcm r16=loc3,r16		// removes bits to clear from psr
 	br.call.sptk.many rp=ia64_switch_mode_phys
 .ret1:	mov rp = r8			// install return address (physical)
+	mov loc5 = r19
+	mov loc6 = r20
 	br.cond.sptk.many b7
 1:
 	mov ar.rsc=0			// put RSE in enforced lazy, LE mode
 	mov r16=loc3			// r16= original psr
+	mov r19=loc5
+	mov r20=loc6
 	br.call.sptk.many rp=ia64_switch_mode_virt // return to virtual mode
 .ret2:
 	mov psr.l = loc3		// restore init PSR
@@ -201,7 +208,7 @@ END(ia64_pal_call_phys_static)
  */
 GLOBAL_ENTRY(ia64_pal_call_phys_stacked)
 	.prologue ASM_UNW_PRLG_RP|ASM_UNW_PRLG_PFS, ASM_UNW_PRLG_GRSAVE(5)
-	alloc	loc1 = ar.pfs,5,5,86,0
+	alloc	loc1 = ar.pfs,5,7,4,0
 	movl	loc2 = pal_entry_point
 1:	{
 	  mov r28  = in0		// copy procedure index
@@ -230,10 +237,14 @@ GLOBAL_ENTRY(ia64_pal_call_phys_stacked)
 	andcm r16=loc3,r16		// removes bits to clear from psr
 	br.call.sptk.many rp=ia64_switch_mode_phys
 .ret6:
+	mov loc5 = r19
+	mov loc6 = r20
 	br.call.sptk.many rp=b7		// now make the call
 .ret7:
 	mov ar.rsc=0			// put RSE in enforced lazy, LE mode
 	mov r16=loc3			// r16= original psr
+	mov r19=loc5
+	mov r20=loc6
 	br.call.sptk.many rp=ia64_switch_mode_virt	// return to virtual mode
 
 .ret8:	mov psr.l  = loc3		// restore init PSR
diff --git a/arch/ia64/kernel/palinfo.c b/arch/ia64/kernel/palinfo.c
index fab4296e2..3cbe961ed 100644
--- a/arch/ia64/kernel/palinfo.c
+++ b/arch/ia64/kernel/palinfo.c
@@ -515,10 +515,10 @@ static const char *bus_features[]={
 	NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL,
 	NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL,
 	NULL, NULL, NULL, NULL,
-	"Enable Cache Line Repl. Exclusive",
 	"Enable Cache Line Repl. Shared",
+	"Enable Cache Line Repl. Exclusive",
 	"Disable Transaction Queuing",
-	"Disable Reponse Error Checking",
+	"Disable Response Error Checking",
 	"Disable Bus Error Checking",
 	"Disable Bus Requester Internal Error Signalling",
 	"Disable Bus Requester Error Signalling",
diff --git a/arch/ia64/kernel/perfmon.c b/arch/ia64/kernel/perfmon.c
index 6ea20f2c1..2f71b39ea 100644
--- a/arch/ia64/kernel/perfmon.c
+++ b/arch/ia64/kernel/perfmon.c
@@ -311,6 +311,7 @@ typedef struct pfm_context {
 	unsigned int		ctx_cpu;		/* cpu to which perfmon is applied (system wide) */
 
 	int			ctx_fd;			/* file descriptor used my this context */
+	pfm_ovfl_arg_t		ctx_ovfl_arg;		/* argument to custom buffer format handler */
 
 	pfm_buffer_fmt_t	*ctx_buf_fmt;		/* buffer format callbacks */
 	void			*ctx_smpl_hdr;		/* points to sampling buffer header kernel vaddr */
@@ -1511,13 +1512,6 @@ exit_pfm_fs(void)
 	mntput(pfmfs_mnt);
 }
 
-static loff_t
-pfm_lseek(struct file *file, loff_t offset, int whence)
-{
-	DPRINT(("pfm_lseek called\n"));
-	return -ESPIPE;
-}
-
 static ssize_t
 pfm_read(struct file *filp, char *buf, size_t size, loff_t *ppos)
 {
@@ -1544,10 +1538,6 @@ pfm_read(struct file *filp, char *buf, size_t size, loff_t *ppos)
 		DPRINT(("message is too small ctx=%p (>=%ld)\n", ctx, sizeof(pfm_msg_t)));
 		return -EINVAL;
 	}
-	/*
-	 * seeks are not allowed on message queues
-	 */
-	if (ppos != &filp->f_pos) return -ESPIPE;
 
 	PROTECT_CTX(ctx, flags);
 
@@ -2140,7 +2130,7 @@ pfm_no_open(struct inode *irrelevant, struct file *dontcare)
 
 
 static struct file_operations pfm_file_ops = {
-	.llseek   = pfm_lseek,
+	.llseek   = no_llseek,
 	.read     = pfm_read,
 	.write    = pfm_write,
 	.poll     = pfm_poll,
@@ -4585,31 +4575,6 @@ pfm_context_unload(pfm_context_t *ctx, void *arg, int count, struct pt_regs *reg
 	return 0;
 }
 
-static void
-pfm_force_cleanup(pfm_context_t *ctx, struct pt_regs *regs)
-{
-	struct task_struct *task = ctx->ctx_task;
-
-	ia64_psr(regs)->up = 0;
-	ia64_psr(regs)->sp = 1;
-
-	if (GET_PMU_OWNER() == task) {
-		DPRINT(("cleared ownership for [%d]\n", ctx->ctx_task->pid));
-		SET_PMU_OWNER(NULL, NULL);
-	}
-
-	/*
-	 * disconnect the task from the context and vice-versa
-	 */
-	PFM_SET_WORK_PENDING(task, 0);
-
-	task->thread.pfm_context  = NULL;
-	task->thread.flags       &= ~IA64_THREAD_PM_VALID;
-
-	DPRINT(("force cleanupf for [%d]\n",  task->pid));
-}
-
-
 
 /*
  * called only from exit_thread(): task == current
@@ -4727,21 +4692,22 @@ static int
 pfm_check_task_state(pfm_context_t *ctx, int cmd, unsigned long flags)
 {
 	struct task_struct *task;
-	int state;
+	int state, old_state;
 
+recheck:
 	state = ctx->ctx_state;
+	task  = ctx->ctx_task;
 
-	task = PFM_CTX_TASK(ctx);
 	if (task == NULL) {
 		DPRINT(("context %d no task, state=%d\n", ctx->ctx_fd, state));
 		return 0;
 	}
 
 	DPRINT(("context %d state=%d [%d] task_state=%ld must_stop=%d\n",
-				ctx->ctx_fd,
-				state,
-				task->pid,
-				task->state, PFM_CMD_STOPPED(cmd)));
+		ctx->ctx_fd,
+		state,
+		task->pid,
+		task->state, PFM_CMD_STOPPED(cmd)));
 
 	/*
 	 * self-monitoring always ok.
@@ -4753,31 +4719,63 @@ pfm_check_task_state(pfm_context_t *ctx, int cmd, unsigned long flags)
 	if (task == current || ctx->ctx_fl_system) return 0;
 
 	/*
-	 * context is UNLOADED, MASKED we are safe to go
+	 * if context is UNLOADED we are safe to go
 	 */
-	if (state != PFM_CTX_LOADED) return 0;
+	if (state == PFM_CTX_UNLOADED) return 0;
 
-	if (state == PFM_CTX_ZOMBIE) return -EINVAL;
+	/*
+	 * no command can operate on a zombie context
+	 */
+	if (state == PFM_CTX_ZOMBIE) {
+		DPRINT(("cmd %d state zombie cannot operate on context\n", cmd));
+		return -EINVAL;
+	}
 
 	/*
-	 * context is loaded, we must make sure the task is stopped
+	 * context is LOADED or MASKED. Some commands may need to have 
+	 * the task stopped.
+	 *
 	 * We could lift this restriction for UP but it would mean that
 	 * the user has no guarantee the task would not run between
 	 * two successive calls to perfmonctl(). That's probably OK.
 	 * If this user wants to ensure the task does not run, then
 	 * the task must be stopped.
 	 */
-	if (PFM_CMD_STOPPED(cmd) && task->state != TASK_STOPPED) {
-		DPRINT(("[%d] task not in stopped state\n", task->pid));
-		return -EBUSY;
-	}
+	if (PFM_CMD_STOPPED(cmd)) {
+		if (task->state != TASK_STOPPED) {
+			DPRINT(("[%d] task not in stopped state\n", task->pid));
+			return -EBUSY;
+		}
+		/*
+		 * task is now stopped, wait for ctxsw out
+		 *
+		 * This is an interesting point in the code.
+		 * We need to unprotect the context because
+		 * the pfm_save_regs() routines needs to grab
+		 * the same lock. There are danger in doing
+		 * this because it leaves a window open for
+		 * another task to get access to the context
+		 * and possibly change its state. The one thing
+		 * that is not possible is for the context to disappear
+		 * because we are protected by the VFS layer, i.e.,
+		 * get_fd()/put_fd().
+		 */
+		old_state = state;
 
-	UNPROTECT_CTX(ctx, flags);
+		UNPROTECT_CTX(ctx, flags);
 
-	wait_task_inactive(task);
+		wait_task_inactive(task);
 
-	PROTECT_CTX(ctx, flags);
+		PROTECT_CTX(ctx, flags);
 
+		/*
+		 * we must recheck to verify if state has changed
+		 */
+		if (ctx->ctx_state != old_state) {
+			DPRINT(("old_state=%d new_state=%d\n", old_state, ctx->ctx_state));
+			goto recheck;
+		}
+	}
 	return 0;
 }
 
@@ -5186,7 +5184,7 @@ pfm_end_notify_user(pfm_context_t *ctx)
 static void
 pfm_overflow_handler(struct task_struct *task, pfm_context_t *ctx, u64 pmc0, struct pt_regs *regs)
 {
-	pfm_ovfl_arg_t ovfl_arg;
+	pfm_ovfl_arg_t *ovfl_arg;
 	unsigned long mask;
 	unsigned long old_val, ovfl_val, new_val;
 	unsigned long ovfl_notify = 0UL, ovfl_pmds = 0UL, smpl_pmds = 0UL, reset_pmds;
@@ -5273,7 +5271,8 @@ pfm_overflow_handler(struct task_struct *task, pfm_context_t *ctx, u64 pmc0, str
 		int j, k, ret = 0;
 		int this_cpu = smp_processor_id();
 
-		pmd_mask   = ovfl_pmds >> PMU_FIRST_COUNTER;
+		pmd_mask = ovfl_pmds >> PMU_FIRST_COUNTER;
+		ovfl_arg = &ctx->ctx_ovfl_arg;
 
 		prefetch(ctx->ctx_smpl_hdr);
 
@@ -5283,15 +5282,15 @@ pfm_overflow_handler(struct task_struct *task, pfm_context_t *ctx, u64 pmc0, str
 
 			if ((pmd_mask & 0x1) == 0) continue;
 
-			ovfl_arg.ovfl_pmd      = (unsigned char )i;
-			ovfl_arg.ovfl_notify   = ovfl_notify & mask ? 1 : 0;
-			ovfl_arg.active_set    = 0;
-			ovfl_arg.ovfl_ctrl.val = 0; /* module must fill in all fields */
-			ovfl_arg.smpl_pmds[0]  = smpl_pmds = ctx->ctx_pmds[i].smpl_pmds[0];
+			ovfl_arg->ovfl_pmd      = (unsigned char )i;
+			ovfl_arg->ovfl_notify   = ovfl_notify & mask ? 1 : 0;
+			ovfl_arg->active_set    = 0;
+			ovfl_arg->ovfl_ctrl.val = 0; /* module must fill in all fields */
+			ovfl_arg->smpl_pmds[0]  = smpl_pmds = ctx->ctx_pmds[i].smpl_pmds[0];
 
-			ovfl_arg.pmd_value      = ctx->ctx_pmds[i].val;
-			ovfl_arg.pmd_last_reset = ctx->ctx_pmds[i].lval;
-			ovfl_arg.pmd_eventid    = ctx->ctx_pmds[i].eventid;
+			ovfl_arg->pmd_value      = ctx->ctx_pmds[i].val;
+			ovfl_arg->pmd_last_reset = ctx->ctx_pmds[i].lval;
+			ovfl_arg->pmd_eventid    = ctx->ctx_pmds[i].eventid;
 
 			/*
 		 	 * copy values of pmds of interest. Sampling format may copy them
@@ -5300,8 +5299,8 @@ pfm_overflow_handler(struct task_struct *task, pfm_context_t *ctx, u64 pmc0, str
 			if (smpl_pmds) {
 				for(j=0, k=0; smpl_pmds; j++, smpl_pmds >>=1) {
 					if ((smpl_pmds & 0x1) == 0) continue;
-					ovfl_arg.smpl_pmds_values[k++] = PMD_IS_COUNTING(j) ?  pfm_read_soft_counter(ctx, j) : ia64_get_pmd(j);
-					DPRINT_ovfl(("smpl_pmd[%d]=pmd%u=0x%lx\n", k-1, j, ovfl_arg.smpl_pmds_values[k-1]));
+					ovfl_arg->smpl_pmds_values[k++] = PMD_IS_COUNTING(j) ?  pfm_read_soft_counter(ctx, j) : ia64_get_pmd(j);
+					DPRINT_ovfl(("smpl_pmd[%d]=pmd%u=0x%lx\n", k-1, j, ovfl_arg->smpl_pmds_values[k-1]));
 				}
 			}
 
@@ -5312,7 +5311,7 @@ pfm_overflow_handler(struct task_struct *task, pfm_context_t *ctx, u64 pmc0, str
 			/*
 		 	 * call custom buffer format record (handler) routine
 		 	 */
-			ret = (*ctx->ctx_buf_fmt->fmt_handler)(task, ctx->ctx_smpl_hdr, &ovfl_arg, regs, tstamp);
+			ret = (*ctx->ctx_buf_fmt->fmt_handler)(task, ctx->ctx_smpl_hdr, ovfl_arg, regs, tstamp);
 
 			end_cycles = ia64_get_itc();
 
@@ -5320,13 +5319,13 @@ pfm_overflow_handler(struct task_struct *task, pfm_context_t *ctx, u64 pmc0, str
 			 * For those controls, we take the union because they have
 			 * an all or nothing behavior.
 			 */
-			ovfl_ctrl.bits.notify_user     |= ovfl_arg.ovfl_ctrl.bits.notify_user;
-			ovfl_ctrl.bits.block_task      |= ovfl_arg.ovfl_ctrl.bits.block_task;
-			ovfl_ctrl.bits.mask_monitoring |= ovfl_arg.ovfl_ctrl.bits.mask_monitoring;
+			ovfl_ctrl.bits.notify_user     |= ovfl_arg->ovfl_ctrl.bits.notify_user;
+			ovfl_ctrl.bits.block_task      |= ovfl_arg->ovfl_ctrl.bits.block_task;
+			ovfl_ctrl.bits.mask_monitoring |= ovfl_arg->ovfl_ctrl.bits.mask_monitoring;
 			/*
 			 * build the bitmask of pmds to reset now
 			 */
-			if (ovfl_arg.ovfl_ctrl.bits.reset_ovfl_pmds) reset_pmds |= mask;
+			if (ovfl_arg->ovfl_ctrl.bits.reset_ovfl_pmds) reset_pmds |= mask;
 
 			pfm_stats[this_cpu].pfm_smpl_handler_cycles += end_cycles - start_cycles;
 		}
@@ -5794,6 +5793,32 @@ pfm_syst_wide_update_task(struct task_struct *task, unsigned long info, int is_c
 }
 
 #ifdef CONFIG_SMP
+
+static void
+pfm_force_cleanup(pfm_context_t *ctx, struct pt_regs *regs)
+{
+	struct task_struct *task = ctx->ctx_task;
+
+	ia64_psr(regs)->up = 0;
+	ia64_psr(regs)->sp = 1;
+
+	if (GET_PMU_OWNER() == task) {
+		DPRINT(("cleared ownership for [%d]\n", ctx->ctx_task->pid));
+		SET_PMU_OWNER(NULL, NULL);
+	}
+
+	/*
+	 * disconnect the task from the context and vice-versa
+	 */
+	PFM_SET_WORK_PENDING(task, 0);
+
+	task->thread.pfm_context  = NULL;
+	task->thread.flags       &= ~IA64_THREAD_PM_VALID;
+
+	DPRINT(("force cleanup for [%d]\n",  task->pid));
+}
+
+
 /*
  * in 2.6, interrupts are masked when we come here and the runqueue lock is held
  */
diff --git a/arch/ia64/kernel/process.c b/arch/ia64/kernel/process.c
index 7455e4894..842c95b8a 100644
--- a/arch/ia64/kernel/process.c
+++ b/arch/ia64/kernel/process.c
@@ -439,6 +439,10 @@ copy_thread (int nr, unsigned long clone_flags,
 		ia32_save_state(p);
 		if (clone_flags & CLONE_SETTLS)
 			retval = ia32_clone_tls(p, child_ptregs);
+
+		/* Copy partially mapped page list */
+		if (!retval)
+			retval = ia32_copy_partial_page_list(p, clone_flags);
 	}
 #endif
 
@@ -612,16 +616,6 @@ out:
 	return error;
 }
 
-void
-ia64_set_personality (struct elf64_hdr *elf_ex, int ibcs2_interpreter)
-{
-	set_personality(PER_LINUX);
-	if (elf_ex->e_flags & EF_IA_64_LINUX_EXECUTABLE_STACK)
-		current->thread.flags |= IA64_THREAD_XSTACK;
-	else
-		current->thread.flags &= ~IA64_THREAD_XSTACK;
-}
-
 pid_t
 kernel_thread (int (*fn)(void *), void *arg, unsigned long flags)
 {
@@ -672,6 +666,8 @@ flush_thread (void)
 	/* drop floating-point and debug-register state if it exists: */
 	current->thread.flags &= ~(IA64_THREAD_FPH_VALID | IA64_THREAD_DBG_VALID);
 	ia64_drop_fpu(current);
+	if (IS_IA32_PROCESS(ia64_task_regs(current)))
+		ia32_drop_partial_page_list(current);
 }
 
 /*
@@ -691,6 +687,8 @@ exit_thread (void)
 	if (current->thread.flags & IA64_THREAD_DBG_VALID)
 		pfm_release_debug_registers(current);
 #endif
+	if (IS_IA32_PROCESS(ia64_task_regs(current)))
+		ia32_drop_partial_page_list(current);
 }
 
 unsigned long
diff --git a/arch/ia64/kernel/ptrace.c b/arch/ia64/kernel/ptrace.c
index eace1b77c..4ca33dfb8 100644
--- a/arch/ia64/kernel/ptrace.c
+++ b/arch/ia64/kernel/ptrace.c
@@ -1450,9 +1450,8 @@ sys_ptrace (long request, pid_t pid, unsigned long addr, unsigned long data,
 	return ret;
 }
 
-/* "asmlinkage" so the input arguments are preserved... */
 
-asmlinkage void
+void
 syscall_trace (void)
 {
 	if (!test_thread_flag(TIF_SYSCALL_TRACE))
@@ -1475,3 +1474,38 @@ syscall_trace (void)
 		current->exit_code = 0;
 	}
 }
+
+/* "asmlinkage" so the input arguments are preserved... */
+
+asmlinkage void
+syscall_trace_enter (long arg0, long arg1, long arg2, long arg3,
+		     long arg4, long arg5, long arg6, long arg7, long stack)
+{
+	struct pt_regs *regs = (struct pt_regs *) &stack;
+	long syscall;
+
+	if (unlikely(current->audit_context)) {
+		if (IS_IA32_PROCESS(regs))
+			syscall = regs->r1;
+		else
+			syscall = regs->r15;
+
+		audit_syscall_entry(current, syscall, arg0, arg1, arg2, arg3);
+	}
+
+	if (test_thread_flag(TIF_SYSCALL_TRACE) && (current->ptrace & PT_PTRACED))
+		syscall_trace();
+}
+
+/* "asmlinkage" so the input arguments are preserved... */
+
+asmlinkage void
+syscall_trace_leave (long arg0, long arg1, long arg2, long arg3,
+		     long arg4, long arg5, long arg6, long arg7, long stack)
+{
+	if (unlikely(current->audit_context))
+		audit_syscall_exit(current, ((struct pt_regs *) &stack)->r8);
+
+	if (test_thread_flag(TIF_SYSCALL_TRACE) && (current->ptrace & PT_PTRACED))
+		syscall_trace();
+}
diff --git a/arch/ia64/kernel/sal.c b/arch/ia64/kernel/sal.c
index 82a9b8930..dcbc07ec3 100644
--- a/arch/ia64/kernel/sal.c
+++ b/arch/ia64/kernel/sal.c
@@ -188,6 +188,27 @@ sal_desc_ap_wakeup (void *p)
 		break;
 	}
 }
+
+static void __init
+chk_nointroute_opt(void)
+{
+	char *cp;
+	extern char saved_command_line[];
+
+	for (cp = saved_command_line; *cp; ) {
+		if (memcmp(cp, "nointroute", 10) == 0) {
+			no_int_routing = 1;
+			printk ("no_int_routing on\n");
+			break;
+		} else {
+			while (*cp != ' ' && *cp)
+				++cp;
+			while (*cp == ' ')
+				++cp;
+		}
+	}
+}
+
 #else
 static void __init sal_desc_ap_wakeup(void *p) { }
 #endif
@@ -207,6 +228,9 @@ ia64_sal_init (struct ia64_sal_systab *systab)
 		printk(KERN_ERR "bad signature in system table!");
 
 	check_versions(systab);
+#ifdef CONFIG_SMP
+	chk_nointroute_opt();
+#endif
 
 	/* revisions are coded in BCD, so %x does the job for us */
 	printk(KERN_INFO "SAL %x.%x: %.32s %.32s%sversion %x.%x\n",
diff --git a/arch/ia64/kernel/salinfo.c b/arch/ia64/kernel/salinfo.c
index 696b3ba7e..a0420ae4d 100644
--- a/arch/ia64/kernel/salinfo.c
+++ b/arch/ia64/kernel/salinfo.c
@@ -426,8 +426,6 @@ salinfo_log_read(struct file *file, char *buffer, size_t count, loff_t *ppos)
 	struct inode *inode = file->f_dentry->d_inode;
 	struct proc_dir_entry *entry = PDE(inode);
 	struct salinfo_data *data = entry->data;
-	void *saldata;
-	size_t size;
 	u8 *buf;
 	u64 bufsize;
 
@@ -441,18 +439,7 @@ salinfo_log_read(struct file *file, char *buffer, size_t count, loff_t *ppos)
 		buf = NULL;
 		bufsize = 0;
 	}
-	if (*ppos >= bufsize)
-		return 0;
-
-	saldata = buf + file->f_pos;
-	size = bufsize - file->f_pos;
-	if (size > count)
-		size = count;
-	if (copy_to_user(buffer, saldata, size))
-		return -EFAULT;
-
-	*ppos += size;
-	return size;
+	return simple_read_from_buffer(buffer, count, ppos, buf, bufsize);
 }
 
 static void
diff --git a/arch/ia64/kernel/setup.c b/arch/ia64/kernel/setup.c
index aa2cb4fc3..8aff39de1 100644
--- a/arch/ia64/kernel/setup.c
+++ b/arch/ia64/kernel/setup.c
@@ -47,6 +47,7 @@
 #include <asm/sal.h>
 #include <asm/sections.h>
 #include <asm/serial.h>
+#include <asm/setup.h>
 #include <asm/smp.h>
 #include <asm/system.h>
 #include <asm/unistd.h>
@@ -88,10 +89,6 @@ unsigned char aux_device_present = 0xaa;        /* XXX remove this when legacy I
 unsigned long ia64_max_iommu_merge_mask = ~0UL;
 EXPORT_SYMBOL(ia64_max_iommu_merge_mask);
 
-#define COMMAND_LINE_SIZE	512
-
-char saved_command_line[COMMAND_LINE_SIZE]; /* used in proc filesystem */
-
 /*
  * We use a special marker for the end of memory and it uses the extra (+1) slot
  */
@@ -280,6 +277,29 @@ setup_serial_legacy (void)
 }
 #endif
 
+/**
+ * early_console_setup - setup debugging console
+ *
+ * Consoles started here require little enough setup that we can start using
+ * them very early in the boot process, either right after the machine
+ * vector initialization, or even before if the drivers can detect their hw.
+ *
+ * Returns non-zero if a console couldn't be setup.
+ */
+static inline int __init
+early_console_setup (void)
+{
+#ifdef CONFIG_SERIAL_SGI_L1_CONSOLE
+	{
+		extern int sn_serial_console_early_setup(void);
+		if(!sn_serial_console_early_setup())
+			return 0;
+	}
+#endif
+
+	return -1;
+}
+
 void __init
 setup_arch (char **cmdline_p)
 {
@@ -288,7 +308,7 @@ setup_arch (char **cmdline_p)
 	ia64_patch_vtop((u64) __start___vtop_patchlist, (u64) __end___vtop_patchlist);
 
 	*cmdline_p = __va(ia64_boot_param->command_line);
-	strlcpy(saved_command_line, *cmdline_p, sizeof(saved_command_line));
+	strlcpy(saved_command_line, *cmdline_p, COMMAND_LINE_SIZE);
 
 	efi_init();
 	io_port_init();
@@ -297,6 +317,12 @@ setup_arch (char **cmdline_p)
 	machvec_init(acpi_get_sysname());
 #endif
 
+#ifdef CONFIG_SMP
+	/* If we register an early console, allow CPU 0 to printk */
+	if (!early_console_setup())
+		cpu_set(smp_processor_id(), cpu_online_map);
+#endif
+
 #ifdef CONFIG_ACPI_BOOT
 	/* Initialize the ACPI boot-time table parser */
 	acpi_table_init();
@@ -323,36 +349,36 @@ setup_arch (char **cmdline_p)
 #ifdef CONFIG_ACPI_BOOT
 	acpi_boot_init();
 #endif
-#ifdef CONFIG_SERIAL_8250_CONSOLE
-#ifdef CONFIG_SERIAL_8250_HCDP
-	if (efi.hcdp) {
-		void setup_serial_hcdp(void *);
-		setup_serial_hcdp(efi.hcdp);
-	}
+#ifdef CONFIG_EFI_PCDP
+	efi_setup_pcdp_console(*cmdline_p);
 #endif
+#ifdef CONFIG_SERIAL_8250_CONSOLE
 	if (!efi.hcdp)
 		setup_serial_legacy();
 #endif
 
 #ifdef CONFIG_VT
+	if (!conswitchp) {
 # if defined(CONFIG_DUMMY_CONSOLE)
-	conswitchp = &dummy_con;
+		conswitchp = &dummy_con;
 # endif
 # if defined(CONFIG_VGA_CONSOLE)
-	/*
-	 * Non-legacy systems may route legacy VGA MMIO range to system
-	 * memory.  vga_con probes the MMIO hole, so memory looks like
-	 * a VGA device to it.  The EFI memory map can tell us if it's
-	 * memory so we can avoid this problem.
-	 */
-	if (efi_mem_type(0xA0000) != EFI_CONVENTIONAL_MEMORY)
-		conswitchp = &vga_con;
+		/*
+		 * Non-legacy systems may route legacy VGA MMIO range to system
+		 * memory.  vga_con probes the MMIO hole, so memory looks like
+		 * a VGA device to it.  The EFI memory map can tell us if it's
+		 * memory so we can avoid this problem.
+		 */
+		if (efi_mem_type(0xA0000) != EFI_CONVENTIONAL_MEMORY)
+			conswitchp = &vga_con;
 # endif
+	}
 #endif
 
-	/* enable IA-64 Machine Check Abort Handling */
-	ia64_mca_init();
-
+	/* enable IA-64 Machine Check Abort Handling unless disabled */
+	if (!strstr(saved_command_line, "nomca"))
+		ia64_mca_init();
+	
 	platform_setup(cmdline_p);
 	paging_init();
 }
diff --git a/arch/ia64/kernel/smpboot.c b/arch/ia64/kernel/smpboot.c
index 8cef119ac..9a0f79233 100644
--- a/arch/ia64/kernel/smpboot.c
+++ b/arch/ia64/kernel/smpboot.c
@@ -299,7 +299,7 @@ smp_callin (void)
 
 	smp_setup_percpu_timer();
 
-	ia64_mca_cmc_vector_setup();	/* Setup vector on AP & enable */
+	ia64_mca_cmc_vector_setup();	/* Setup vector on AP */
 
 #ifdef CONFIG_PERFMON
 	pfm_init_percpu();
diff --git a/arch/ia64/kernel/unwind.c b/arch/ia64/kernel/unwind.c
index e8be97229..769d880df 100644
--- a/arch/ia64/kernel/unwind.c
+++ b/arch/ia64/kernel/unwind.c
@@ -385,9 +385,10 @@ unw_access_gr (struct unw_frame_info *info, int regnum, unsigned long *val, char
 	}
 
 	if (write) {
-		if (read_only(addr))
-			UNW_DPRINT(0, "unwind.%s: ignoring attempt to write read-only location\n");
-		else {
+		if (read_only(addr)) {
+			UNW_DPRINT(0, "unwind.%s: ignoring attempt to write read-only location\n",
+				__FUNCTION__);
+		} else {
 			*addr = *val;
 			if (*nat)
 				*nat_addr |= nat_mask;
@@ -432,9 +433,10 @@ unw_access_br (struct unw_frame_info *info, int regnum, unsigned long *val, int
 		return -1;
 	}
 	if (write)
-		if (read_only(addr))
-			UNW_DPRINT(0, "unwind.%s: ignoring attempt to write read-only location\n");
-		else
+		if (read_only(addr)) {
+			UNW_DPRINT(0, "unwind.%s: ignoring attempt to write read-only location\n",
+				__FUNCTION__);
+		} else
 			*addr = *val;
 	else
 		*val = *addr;
@@ -480,9 +482,10 @@ unw_access_fr (struct unw_frame_info *info, int regnum, struct ia64_fpreg *val,
 	}
 
 	if (write)
-		if (read_only(addr))
-			UNW_DPRINT(0, "unwind.%s: ignoring attempt to write read-only location\n");
-		else
+		if (read_only(addr)) {
+			UNW_DPRINT(0, "unwind.%s: ignoring attempt to write read-only location\n",
+				__FUNCTION__);
+		} else
 			*addr = *val;
 	else
 		*val = *addr;
@@ -576,9 +579,10 @@ unw_access_ar (struct unw_frame_info *info, int regnum, unsigned long *val, int
 	}
 
 	if (write) {
-		if (read_only(addr))
-			UNW_DPRINT(0, "unwind.%s: ignoring attempt to write read-only location\n");
-		else
+		if (read_only(addr)) {
+			UNW_DPRINT(0, "unwind.%s: ignoring attempt to write read-only location\n",
+				__FUNCTION__);
+		} else
 			*addr = *val;
 	} else
 		*val = *addr;
@@ -596,9 +600,10 @@ unw_access_pr (struct unw_frame_info *info, unsigned long *val, int write)
 		addr = &info->sw->pr;
 
 	if (write) {
-		if (read_only(addr))
-			UNW_DPRINT(0, "unwind.%s: ignoring attempt to write read-only location\n");
-		else
+		if (read_only(addr)) {
+			UNW_DPRINT(0, "unwind.%s: ignoring attempt to write read-only location\n",
+				__FUNCTION__);
+		} else
 			*addr = *val;
 	} else
 		*val = *addr;
diff --git a/arch/ia64/mm/contig.c b/arch/ia64/mm/contig.c
index 183533a62..c0f8f4a3e 100644
--- a/arch/ia64/mm/contig.c
+++ b/arch/ia64/mm/contig.c
@@ -43,7 +43,7 @@ show_mem (void)
 	printk("Mem-info:\n");
 	show_free_areas();
 
-	printk("Free swap:       %6dkB\n", nr_swap_pages<<(PAGE_SHIFT-10));
+	printk("Free swap:       %6ldkB\n", nr_swap_pages<<(PAGE_SHIFT-10));
 	i = max_mapnr;
 	while (i-- > 0) {
 		if (!pfn_valid(i))
diff --git a/arch/ia64/mm/discontig.c b/arch/ia64/mm/discontig.c
index 751af133c..23a9490fc 100644
--- a/arch/ia64/mm/discontig.c
+++ b/arch/ia64/mm/discontig.c
@@ -154,6 +154,9 @@ static void __init reassign_cpu_only_nodes(void)
 
 	memcpy(numa_slit, numa_slit_fix, sizeof (numa_slit));
 
+	for (i = nnode; i < numnodes; i++)
+		node_set_offline(i);
+
 	numnodes = nnode;
 
 	return;
@@ -495,7 +498,7 @@ void show_mem(void)
 
 	printk("Mem-info:\n");
 	show_free_areas();
-	printk("Free swap:       %6dkB\n", nr_swap_pages<<(PAGE_SHIFT-10));
+	printk("Free swap:       %6ldkB\n", nr_swap_pages<<(PAGE_SHIFT-10));
 	for_each_pgdat(pgdat) {
 		printk("Node ID: %d\n", pgdat->node_id);
 		for(i = 0; i < pgdat->node_spanned_pages; i++) {
@@ -546,7 +549,7 @@ void call_pernode_memory(unsigned long start, unsigned long len, void *arg)
 	if (!num_node_memblks) {
 		/* No SRAT table, so assume one node (node 0) */
 		if (start < end)
-			(*func)(start, len, 0);
+			(*func)(start, end - start, 0);
 		return;
 	}
 
diff --git a/arch/ia64/mm/hugetlbpage.c b/arch/ia64/mm/hugetlbpage.c
index c72435812..fbd24a074 100644
--- a/arch/ia64/mm/hugetlbpage.c
+++ b/arch/ia64/mm/hugetlbpage.c
@@ -160,8 +160,6 @@ struct page *follow_huge_addr(struct mm_struct *mm, unsigned long addr, int writ
 	struct page *page;
 	pte_t *ptep;
 
-	if (! mm->used_hugetlb)
-		return ERR_PTR(-EINVAL);
 	if (REGION_NUMBER(addr) != REGION_HPAGE)
 		return ERR_PTR(-EINVAL);
 
@@ -300,7 +298,7 @@ int hugetlb_prefault(struct address_space *mapping, struct vm_area_struct *vma)
 				unlock_page(page);
 			} else {
 				hugetlb_put_quota(mapping);
-				free_huge_page(page);
+				page_cache_release(page);
 				goto out;
 			}
 		}
diff --git a/arch/ia64/mm/init.c b/arch/ia64/mm/init.c
index c03b3980d..3ab0b37e0 100644
--- a/arch/ia64/mm/init.c
+++ b/arch/ia64/mm/init.c
@@ -63,6 +63,7 @@ check_pgt_cache (void)
 	low = pgt_cache_water[0];
 	high = pgt_cache_water[1];
 
+	preempt_disable();
 	if (pgtable_cache_size > (u64) high) {
 		do {
 			if (pgd_quicklist)
@@ -71,6 +72,7 @@ check_pgt_cache (void)
 				free_page((unsigned long)pmd_alloc_one_fast(0, 0));
 		} while (pgtable_cache_size > (u64) low);
 	}
+	preempt_enable();
 }
 
 void
@@ -128,7 +130,7 @@ ia64_init_addr_space (void)
 		vma->vm_start = current->thread.rbs_bot & PAGE_MASK;
 		vma->vm_end = vma->vm_start + PAGE_SIZE;
 		vma->vm_page_prot = protection_map[VM_DATA_DEFAULT_FLAGS & 0x7];
-		vma->vm_flags = VM_READ|VM_WRITE|VM_MAYREAD|VM_MAYWRITE|VM_GROWSUP;
+		vma->vm_flags = VM_DATA_DEFAULT_FLAGS | VM_GROWSUP;
 		insert_vm_struct(current->mm, vma);
 	}
 
@@ -169,7 +171,7 @@ free_initrd_mem (unsigned long start, unsigned long end)
 {
 	struct page *page;
 	/*
-	 * EFI uses 4KB pages while the kernel can use 4KB  or bigger.
+	 * EFI uses 4KB pages while the kernel can use 4KB or bigger.
 	 * Thus EFI and the kernel may have different page sizes. It is
 	 * therefore possible to have the initrd share the same page as
 	 * the end of the kernel (given current setup).
@@ -580,7 +582,7 @@ mem_init (void)
 		if (!fsyscall_table[i] || nolwsys)
 			fsyscall_table[i] = sys_call_table[i] | 1;
 	}
-	setup_gate();	/* setup gate pages before we free up boot memory... */
+	setup_gate();
 
 #ifdef CONFIG_IA32_SUPPORT
 	ia32_boot_gdt_init();
diff --git a/arch/ia64/pci/pci.c b/arch/ia64/pci/pci.c
index fdcc71a09..82204f1bd 100644
--- a/arch/ia64/pci/pci.c
+++ b/arch/ia64/pci/pci.c
@@ -134,10 +134,18 @@ static struct pci_ops pci_root_ops = {
 static int __init
 pci_acpi_init (void)
 {
-	if (!acpi_pci_irq_init())
-		printk(KERN_INFO "PCI: Using ACPI for IRQ routing\n");
-	else
-		printk(KERN_WARNING "PCI: Invalid ACPI-PCI IRQ routing table\n");
+	struct pci_dev *dev = NULL;
+
+	printk(KERN_INFO "PCI: Using ACPI for IRQ routing\n");
+
+	/*
+	 * PCI IRQ routing is set up by pci_enable_device(), but we
+	 * also do it here in case there are still broken drivers that
+	 * don't use pci_enable_device().
+	 */
+	while ((dev = pci_find_device(PCI_ANY_ID, PCI_ANY_ID, dev)) != NULL)
+		acpi_pci_irq_enable(dev);
+
 	return 0;
 }
 
diff --git a/arch/ia64/sn/fakeprom/fw-emu.c b/arch/ia64/sn/fakeprom/fw-emu.c
index 7832af4d6..7e6a7eae6 100644
--- a/arch/ia64/sn/fakeprom/fw-emu.c
+++ b/arch/ia64/sn/fakeprom/fw-emu.c
@@ -37,6 +37,7 @@
  */
 #include <linux/config.h>
 #include <linux/efi.h>
+#include <linux/kernel.h>
 #include <asm/pal.h>
 #include <asm/sal.h>
 #include <asm/sn/sn_sal.h>
@@ -78,7 +79,6 @@
 #define BOOT_PARAM_ADDR 0x40000
 #define MAX(i,j)		((i) > (j) ? (i) : (j))
 #define MIN(i,j)		((i) < (j) ? (i) : (j))
-#define ABS(i)			((i) > 0   ? (i) : -(i))
 #define ALIGN8(p)		(((long)(p) +7) & ~7)
 
 #define FPROM_BUG()		do {while (1);} while (0)
@@ -670,7 +670,7 @@ sys_fw_init (const char *args, int arglen, int bsp)
 	for (i=0; i<=max_nasid; i++)
 		for (j=0; j<=max_nasid; j++)
 			if (nasid_present(i) && nasid_present(j))
-				*(cp+PROXIMITY_DOMAIN(i)*acpi_slit->localities+PROXIMITY_DOMAIN(j)) = 10 + MIN(254, 5*ABS(i-j));
+				*(cp+PROXIMITY_DOMAIN(i)*acpi_slit->localities+PROXIMITY_DOMAIN(j)) = 10 + MIN(254, 5*abs(i-j));
 
 	cp = acpi_slit->entry + acpi_slit->localities*acpi_slit->localities;
 	acpi_checksum(&acpi_slit->header, cp - (char*)acpi_slit);
diff --git a/arch/ia64/sn/io/machvec/pci_bus_cvlink.c b/arch/ia64/sn/io/machvec/pci_bus_cvlink.c
index 1cb5beae5..ba9e42c12 100644
--- a/arch/ia64/sn/io/machvec/pci_bus_cvlink.c
+++ b/arch/ia64/sn/io/machvec/pci_bus_cvlink.c
@@ -741,7 +741,7 @@ pci_bus_to_hcl_cvlink(void)
 			/* Is this PCI bus associated with this moduleid? */
 			moduleid = NODE_MODULEID(
 				nasid_to_cnodeid(pcibr_soft->bs_nasid));
-			if (modules[i]->id == moduleid) {
+			if (sn_modules[i]->id == moduleid) {
 				struct pcibr_list_s *new_element;
 
 				new_element = kmalloc(sizeof (struct pcibr_soft_s), GFP_KERNEL);
@@ -781,7 +781,7 @@ pci_bus_to_hcl_cvlink(void)
 				
 		/*
 		 * We now have a list of all the pci bridges associated with
-		 * the module_id, modules[i].  Call pci_bus_map_create() for
+		 * the module_id, sn_modules[i].  Call pci_bus_map_create() for
 		 * each pci bridge
 		 */
 		softlistp = first_in_list;
diff --git a/arch/ia64/sn/io/platform_init/sgi_io_init.c b/arch/ia64/sn/io/platform_init/sgi_io_init.c
index 8e410fcc8..4833cfb3b 100644
--- a/arch/ia64/sn/io/platform_init/sgi_io_init.c
+++ b/arch/ia64/sn/io/platform_init/sgi_io_init.c
@@ -37,7 +37,7 @@ nasid_t master_nasid = INVALID_NASID;	/* This is the partition master nasid */
  *
  * 	This code is executed once for each Hub chip.
  */
-static void
+static void __init
 per_hub_init(cnodeid_t cnode)
 {
 	nasid_t nasid;
@@ -130,10 +130,8 @@ sgi_master_io_infr_init(void)
 	klhwg_add_all_modules(hwgraph_root);
 	klhwg_add_all_nodes(hwgraph_root);
 
-	for (cnode = 0; cnode < numionodes; cnode++) {
-		extern void per_hub_init(cnodeid_t);
+	for (cnode = 0; cnode < numionodes; cnode++)
 		per_hub_init(cnode);
-	}
 
 	/*
 	 *
diff --git a/arch/ia64/sn/io/sn2/bte_error.c b/arch/ia64/sn/io/sn2/bte_error.c
index 799532f77..b77e9e2df 100644
--- a/arch/ia64/sn/io/sn2/bte_error.c
+++ b/arch/ia64/sn/io/sn2/bte_error.c
@@ -3,7 +3,7 @@
  * License.  See the file "COPYING" in the main directory of this archive
  * for more details.
  *
- * Copyright (c) 2000-2003 Silicon Graphics, Inc.  All Rights Reserved.
+ * Copyright (c) 2000-2004 Silicon Graphics, Inc.  All Rights Reserved.
  */
 
 
@@ -90,6 +90,7 @@ bte_error_handler(unsigned long _nodepda)
 	ii_icrb0_d_u_t icrbd;	/* II CRB Register D */
 	ii_ibcr_u_t ibcr;
 	ii_icmr_u_t icmr;
+	ii_ieclr_u_t ieclr;
 
 
 	BTE_PRINTK(("bte_error_handler(%p) - %d\n", err_nodepda,
@@ -177,6 +178,14 @@ bte_error_handler(unsigned long _nodepda)
 	imem.ii_imem_fld_s.i_b0_esd = imem.ii_imem_fld_s.i_b1_esd = 1;
 	REMOTE_HUB_S(nasid, IIO_IMEM, imem.ii_imem_regval);
 
+	/* Clear IBLS0/1 error bits */
+	ieclr.ii_ieclr_regval = 0;
+	if (err_nodepda->bte_if[0].bh_error != BTE_SUCCESS)
+		ieclr.ii_ieclr_fld_s.i_e_bte_0 = 1;
+	if (err_nodepda->bte_if[1].bh_error != BTE_SUCCESS)
+                ieclr.ii_ieclr_fld_s.i_e_bte_1 = 1;
+	REMOTE_HUB_S(nasid, IIO_IECLR, ieclr.ii_ieclr_regval);
+
 	/* Reinitialize both BTE state machines. */
 	ibcr.ii_ibcr_regval = REMOTE_HUB_L(nasid, IIO_IBCR);
 	ibcr.ii_ibcr_fld_s.i_soft_reset = 1;
@@ -199,7 +208,7 @@ bte_error_handler(unsigned long _nodepda)
 		err_nodepda->bte_if[i].cleanup_active = 0;
 		BTE_PRINTK(("eh:%p:%d Unlocked %d\n", err_nodepda,
 			    smp_processor_id(), i));
-		spin_unlock(&pda->cpu_bte_if[i]->spinlock);
+		spin_unlock(&err_nodepda->bte_if[i].spinlock);
 	}
 
 	del_timer(recovery_timer);
diff --git a/arch/ia64/sn/io/sn2/klgraph.c b/arch/ia64/sn/io/sn2/klgraph.c
index ca342b712..4fdffb877 100644
--- a/arch/ia64/sn/io/sn2/klgraph.c
+++ b/arch/ia64/sn/io/sn2/klgraph.c
@@ -527,7 +527,7 @@ klhwg_add_all_modules(vertex_hdl_t hwgraph_root)
 		/* Use module as module vertex fastinfo */
 
 		memset(buffer, 0, 16);
-		format_module_id(buffer, modules[cm]->id, MODULE_FORMAT_BRIEF);
+		format_module_id(buffer, sn_modules[cm]->id, MODULE_FORMAT_BRIEF);
 		sprintf(name, EDGE_LBL_MODULE "/%s", buffer);
 
 		rc = hwgraph_path_add(hwgraph_root, name, &module_vhdl);
@@ -535,7 +535,7 @@ klhwg_add_all_modules(vertex_hdl_t hwgraph_root)
 		rc = rc;
 		HWGRAPH_DEBUG(__FILE__, __FUNCTION__, __LINE__, module_vhdl, NULL, "Created module path.\n");
 
-		hwgraph_fastinfo_set(module_vhdl, (arbitrary_info_t) modules[cm]);
+		hwgraph_fastinfo_set(module_vhdl, (arbitrary_info_t) sn_modules[cm]);
 
 		/* Add system controller */
 		sprintf(name,
diff --git a/arch/ia64/sn/io/sn2/ml_iograph.c b/arch/ia64/sn/io/sn2/ml_iograph.c
index d0b0a5b58..9bb04c904 100644
--- a/arch/ia64/sn/io/sn2/ml_iograph.c
+++ b/arch/ia64/sn/io/sn2/ml_iograph.c
@@ -517,6 +517,14 @@ io_init_node(cnodeid_t cnodeid)
 
 	ASSERT(hubv != GRAPH_VERTEX_NONE);
 
+	/* 
+	 * attach our hub_provider information to hubv,
+	 * so we can use it as a crosstalk provider "master"
+	 * vertex.
+	 */
+	xtalk_provider_register(hubv, &hub_provider);
+	xtalk_provider_startup(hubv);
+
 	/* 
 	 * If nothing connected to this hub's xtalk port, we're done.
 	 */
@@ -527,14 +535,6 @@ io_init_node(cnodeid_t cnodeid)
 		/* NOTREACHED */
 	}
 
-	/* 
-	 * attach our hub_provider information to hubv,
-	 * so we can use it as a crosstalk provider "master"
-	 * vertex.
-	 */
-	xtalk_provider_register(hubv, &hub_provider);
-	xtalk_provider_startup(hubv);
-
 	/*
 	 * Create a vertex to represent the crosstalk bus
 	 * attached to this hub, and a vertex to be used
diff --git a/arch/ia64/sn/io/sn2/module.c b/arch/ia64/sn/io/sn2/module.c
index 0bba7843e..56e318875 100644
--- a/arch/ia64/sn/io/sn2/module.c
+++ b/arch/ia64/sn/io/sn2/module.c
@@ -33,7 +33,7 @@
 #define DPRINTF(x...)
 #endif
 
-module_t	       *modules[MODULE_MAX];
+module_t	       *sn_modules[MODULE_MAX];
 int			nummodules;
 
 #define SN00_SERIAL_FUDGE	0x3b1af409d513c2
@@ -59,9 +59,9 @@ module_lookup(moduleid_t id)
     int			i;
 
     for (i = 0; i < nummodules; i++)
-	if (modules[i]->id == id) {
-	    DPRINTF("module_lookup: found m=0x%p\n", modules[i]);
-	    return modules[i];
+	if (sn_modules[i]->id == id) {
+	    DPRINTF("module_lookup: found m=0x%p\n", sn_modules[i]);
+	    return sn_modules[i];
 	}
 
     return NULL;
@@ -104,10 +104,10 @@ module_add_node(geoid_t geoid, cnodeid_t cnodeid)
 
 	/* Insert in sorted order by module number */
 
-	for (i = nummodules; i > 0 && modules[i - 1]->id > moduleid; i--)
-	    modules[i] = modules[i - 1];
+	for (i = nummodules; i > 0 && sn_modules[i - 1]->id > moduleid; i--)
+	    sn_modules[i] = sn_modules[i - 1];
 
-	modules[i] = m;
+	sn_modules[i] = m;
 	nummodules++;
     }
 
diff --git a/arch/ia64/sn/kernel/bte.c b/arch/ia64/sn/kernel/bte.c
index 8380b5741..e040fc3c4 100644
--- a/arch/ia64/sn/kernel/bte.c
+++ b/arch/ia64/sn/kernel/bte.c
@@ -7,6 +7,7 @@
  */
 
 #include <linux/config.h>
+#include <linux/module.h>
 #include <asm/sn/sgi.h>
 #include <asm/sn/nodepda.h>
 #include <asm/sn/addrs.h>
@@ -15,7 +16,6 @@
 #include <asm/sn/pda.h>
 #include <asm/sn/sn2/shubio.h>
 #include <asm/nodedata.h>
-#include <asm/delay.h>
 
 #include <linux/bootmem.h>
 #include <linux/string.h>
@@ -27,10 +27,18 @@
 #define L1_CACHE_MASK (L1_CACHE_BYTES - 1)
 #endif
 
-/*
- * The base address of for each set of bte registers.
- */
-static int bte_offsets[] = { IIO_IBLS0, IIO_IBLS1 };
+/* two interfaces on two btes */
+#define MAX_INTERFACES_TO_TRY		4
+
+static struct bteinfo_s *
+bte_if_on_node(nasid_t nasid, int interface)
+{
+	nodepda_t *tmp_nodepda;
+
+	tmp_nodepda = NODEPDA(nasid_to_cnodeid(nasid));
+	return &tmp_nodepda->bte_if[interface];
+
+}
 
 
 /************************************************************************
@@ -61,11 +69,13 @@ static int bte_offsets[] = { IIO_IBLS0, IIO_IBLS1 };
 bte_result_t
 bte_copy(u64 src, u64 dest, u64 len, u64 mode, void *notification)
 {
-	int bte_to_use;
 	u64 transfer_size;
+	u64 transfer_stat;
 	struct bteinfo_s *bte;
 	bte_result_t bte_status;
 	unsigned long irq_flags;
+	struct bteinfo_s *btes_to_try[MAX_INTERFACES_TO_TRY];
+	int bte_if_index;
 
 
 	BTE_PRINTK(("bte_copy(0x%lx, 0x%lx, 0x%lx, 0x%lx, 0x%p)\n",
@@ -79,17 +89,57 @@ bte_copy(u64 src, u64 dest, u64 len, u64 mode, void *notification)
 		 (src & L1_CACHE_MASK) || (dest & L1_CACHE_MASK)));
 	ASSERT(len < ((BTE_LEN_MASK + 1) << L1_CACHE_SHIFT));
 
+	if (mode & BTE_USE_DEST) {
+		/* try remote then local */
+		btes_to_try[0] = bte_if_on_node(NASID_GET(dest), 0);
+		btes_to_try[1] = bte_if_on_node(NASID_GET(dest), 1);
+		if (mode & BTE_USE_ANY) {
+			btes_to_try[2] = bte_if_on_node(get_nasid(), 0);
+			btes_to_try[3] = bte_if_on_node(get_nasid(), 1);
+		} else {
+			btes_to_try[2] = NULL;
+			btes_to_try[3] = NULL;
+		}
+	} else {
+		/* try local then remote */
+		btes_to_try[0] = bte_if_on_node(get_nasid(), 0);
+		btes_to_try[1] = bte_if_on_node(get_nasid(), 1);
+		if (mode & BTE_USE_ANY) {
+			btes_to_try[2] = bte_if_on_node(NASID_GET(dest), 0);
+			btes_to_try[3] = bte_if_on_node(NASID_GET(dest), 1);
+		} else {
+			btes_to_try[2] = NULL;
+			btes_to_try[3] = NULL;
+		}
+	}
+
 	do {
 		local_irq_save(irq_flags);
 
-		bte_to_use = 0;
+		bte_if_index = 0;
+
 		/* Attempt to lock one of the BTE interfaces. */
-		while ((bte_to_use < BTES_PER_NODE) &&
-		       BTE_LOCK_IF_AVAIL(bte_to_use)) {
-			bte_to_use++;
+		while (bte_if_index < MAX_INTERFACES_TO_TRY) {
+			bte = btes_to_try[bte_if_index++];
+
+			if (bte == NULL) {
+				continue;
+			}
+
+			if (spin_trylock(&bte->spinlock)) {
+				if ((*bte->most_rcnt_na & BTE_ACTIVE) ||
+				    (BTE_LNSTAT_LOAD(bte) & BTE_ACTIVE)) {
+					/* Got the lock but BTE still busy */
+					spin_unlock(&bte->spinlock);
+					bte = NULL;
+				} else {
+					/* we got the lock and it's not busy */
+					break;
+				}
+			}
 		}
 
-		if (bte_to_use < BTES_PER_NODE) {
+		if (bte != NULL) {
 			break;
 		}
 
@@ -98,14 +148,8 @@ bte_copy(u64 src, u64 dest, u64 len, u64 mode, void *notification)
 		if (!(mode & BTE_WACQUIRE)) {
 			return BTEFAIL_NOTAVAIL;
 		}
-
-		/* Wait until a bte is available. */
-		udelay(10);
 	} while (1);
 
-	bte = pda->cpu_bte_if[bte_to_use];
-	BTE_PRINTKV(("Got a lock on bte %d\n", bte_to_use));
-
 
 	if (notification == NULL) {
 		/* User does not want to be notified. */
@@ -121,28 +165,24 @@ bte_copy(u64 src, u64 dest, u64 len, u64 mode, void *notification)
 	*bte->most_rcnt_na = -1L;
 
 	/* Set the status reg busy bit and transfer length */
-	BTE_PRINTKV(("IBLS - HUB_S(0x%p, 0x%lx)\n",
-		     BTEREG_LNSTAT_ADDR, IBLS_BUSY | transfer_size));
-	HUB_S(BTEREG_LNSTAT_ADDR, (IBLS_BUSY | transfer_size));
+	BTE_PRINTKV(("IBLS = 0x%lx\n", IBLS_BUSY | transfer_size));
+	BTE_LNSTAT_STORE(bte, IBLS_BUSY | transfer_size);
 
 	/* Set the source and destination registers */
-	BTE_PRINTKV(("IBSA - HUB_S(0x%p, 0x%lx)\n", BTEREG_SRC_ADDR,
-		     (TO_PHYS(src))));
-	HUB_S(BTEREG_SRC_ADDR, (TO_PHYS(src)));
-	BTE_PRINTKV(("IBDA - HUB_S(0x%p, 0x%lx)\n", BTEREG_DEST_ADDR,
-		     (TO_PHYS(dest))));
-	HUB_S(BTEREG_DEST_ADDR, (TO_PHYS(dest)));
+	BTE_PRINTKV(("IBSA = 0x%lx)\n", (TO_PHYS(src))));
+	BTE_SRC_STORE(bte, TO_PHYS(src));
+	BTE_PRINTKV(("IBDA = 0x%lx)\n", (TO_PHYS(dest))));
+	BTE_DEST_STORE(bte, TO_PHYS(dest));
 
 	/* Set the notification register */
-	BTE_PRINTKV(("IBNA - HUB_S(0x%p, 0x%lx)\n", BTEREG_NOTIF_ADDR,
-		     (TO_PHYS(ia64_tpa((unsigned long)bte->most_rcnt_na)))));
-	HUB_S(BTEREG_NOTIF_ADDR, (TO_PHYS(ia64_tpa((unsigned long)bte->most_rcnt_na))));
+	BTE_PRINTKV(("IBNA = 0x%lx)\n", 
+		     TO_PHYS(ia64_tpa((unsigned long)bte->most_rcnt_na))));
+	BTE_NOTIF_STORE(bte, TO_PHYS(ia64_tpa((unsigned long)bte->most_rcnt_na)));
 
 
 	/* Initiate the transfer */
-	BTE_PRINTK(("IBCT - HUB_S(0x%p, 0x%lx)\n", BTEREG_CTRL_ADDR,
-		     BTE_VALID_MODE(mode)));
-	HUB_S(BTEREG_CTRL_ADDR, BTE_VALID_MODE(mode));
+	BTE_PRINTK(("IBCT = 0x%lx)\n", BTE_VALID_MODE(mode)));
+	BTE_CTRL_STORE(bte, BTE_VALID_MODE(mode));
 
 	spin_unlock_irqrestore(&bte->spinlock, irq_flags);
 
@@ -151,24 +191,25 @@ bte_copy(u64 src, u64 dest, u64 len, u64 mode, void *notification)
 		return BTE_SUCCESS;
 	}
 
-	while (*bte->most_rcnt_na == -1UL) {
+	while ((transfer_stat = *bte->most_rcnt_na) == -1UL) {
 	}
 
 
 	BTE_PRINTKV((" Delay Done.  IBLS = 0x%lx, most_rcnt_na = 0x%lx\n",
-				HUB_L(BTEREG_LNSTAT_ADDR), *bte->most_rcnt_na));
+				BTE_LNSTAT_LOAD(bte), *bte->most_rcnt_na));
 
-	if (*bte->most_rcnt_na & IBLS_ERROR) {
-		bte_status = *bte->most_rcnt_na & ~IBLS_ERROR;
+	if (transfer_stat & IBLS_ERROR) {
+		bte_status = transfer_stat & ~IBLS_ERROR;
 		*bte->most_rcnt_na = 0L;
 	} else {
 		bte_status = BTE_SUCCESS;
 	}
 	BTE_PRINTK(("Returning status is 0x%lx and most_rcnt_na is 0x%lx\n",
-				HUB_L(BTEREG_LNSTAT_ADDR), *bte->most_rcnt_na));
+				BTE_LNSTAT_LOAD(bte), *bte->most_rcnt_na));
 
 	return bte_status;
 }
+EXPORT_SYMBOL(bte_copy);
 
 
 /*
@@ -201,14 +242,19 @@ bte_unaligned_copy(u64 src, u64 dest, u64 len, u64 mode)
 	u64 footBcopyDest;
 	u64 footBcopyLen;
 	bte_result_t rv;
-	char *bteBlock;
+	char *bteBlock, *bteBlock_unaligned;
 
 	if (len == 0) {
 		return BTE_SUCCESS;
 	}
 
 	/* temporary buffer used during unaligned transfers */
-	bteBlock = pda->cpu_bte_if[0]->scratch_buf;
+	bteBlock_unaligned = kmalloc(len + 3 * L1_CACHE_BYTES,
+				     GFP_KERNEL | GFP_DMA);
+	if (bteBlock_unaligned == NULL) {
+		return BTEFAIL_NOTAVAIL;
+	}
+	bteBlock = (char *) L1_CACHE_ALIGN((u64) bteBlock_unaligned);
 
 	headBcopySrcOffset = src & L1_CACHE_MASK;
 	destFirstCacheOffset = dest & L1_CACHE_MASK;
@@ -276,6 +322,7 @@ bte_unaligned_copy(u64 src, u64 dest, u64 len, u64 mode)
 					      ia64_tpa((unsigned long)bteBlock),
 					      footBteLen, mode, NULL);
 				if (rv != BTE_SUCCESS) {
+					kfree(bteBlock_unaligned);
 					return rv;
 				}
 
@@ -296,6 +343,7 @@ bte_unaligned_copy(u64 src, u64 dest, u64 len, u64 mode)
 				      (len - headBcopyLen -
 				       footBcopyLen), mode, NULL);
 			if (rv != BTE_SUCCESS) {
+				kfree(bteBlock_unaligned);
 				return rv;
 			}
 
@@ -325,6 +373,7 @@ bte_unaligned_copy(u64 src, u64 dest, u64 len, u64 mode)
 		rv = bte_copy(headBteSource,
 			      ia64_tpa((unsigned long)bteBlock), headBteLen, mode, NULL);
 		if (rv != BTE_SUCCESS) {
+			kfree(bteBlock_unaligned);
 			return rv;
 		}
 
@@ -332,8 +381,10 @@ bte_unaligned_copy(u64 src, u64 dest, u64 len, u64 mode)
 					     headBcopySrcOffset),
 		       headBcopyLen);
 	}
+	kfree(bteBlock_unaligned);
 	return BTE_SUCCESS;
 }
+EXPORT_SYMBOL(bte_unaligned_copy);
 
 
 /************************************************************************
@@ -370,9 +421,9 @@ bte_init_node(nodepda_t * mynodepda, cnodeid_t cnode)
 	mynodepda->bte_recovery_timer.data = (unsigned long) mynodepda;
 
 	for (i = 0; i < BTES_PER_NODE; i++) {
-		/* >>> Don't know why the 0x1800000L is here.  Robin */
-		mynodepda->bte_if[i].bte_base_addr =
-		    (char *) LOCAL_MMR_ADDR(bte_offsets[i] | 0x1800000L);
+		(u64) mynodepda->bte_if[i].bte_base_addr =
+		    REMOTE_HUB_ADDR(cnodeid_to_nasid(cnode),
+			(i == 0 ? IIO_IBLS0 : IIO_IBLS1));
 
 		/*
 		 * Initialize the notification and spinlock
@@ -383,8 +434,6 @@ bte_init_node(nodepda_t * mynodepda, cnodeid_t cnode)
 		mynodepda->bte_if[i].notify = 0L;
 		spin_lock_init(&mynodepda->bte_if[i].spinlock);
 
-		mynodepda->bte_if[i].scratch_buf =
-		    alloc_bootmem_node(NODE_DATA(cnode), BTE_MAX_XFER);
 		mynodepda->bte_if[i].bte_cnode = cnode;
 		mynodepda->bte_if[i].bte_error_count = 0;
 		mynodepda->bte_if[i].bte_num = i;
@@ -393,23 +442,3 @@ bte_init_node(nodepda_t * mynodepda, cnodeid_t cnode)
 	}
 
 }
-
-/*
- * bte_init_cpu()
- *
- * Initialize the cpupda structure with pointers to the
- * nodepda bte blocks.
- *
- */
-void
-bte_init_cpu(void)
-{
-	/* Called by setup.c as each cpu is being added to the nodepda */
-	if (local_node_data->active_cpu_count & 0x1) {
-		pda->cpu_bte_if[0] = &(nodepda->bte_if[0]);
-		pda->cpu_bte_if[1] = &(nodepda->bte_if[1]);
-	} else {
-		pda->cpu_bte_if[0] = &(nodepda->bte_if[1]);
-		pda->cpu_bte_if[1] = &(nodepda->bte_if[0]);
-	}
-}
diff --git a/arch/ia64/sn/kernel/irq.c b/arch/ia64/sn/kernel/irq.c
index 88f0bbaed..6bcf70ea1 100644
--- a/arch/ia64/sn/kernel/irq.c
+++ b/arch/ia64/sn/kernel/irq.c
@@ -41,6 +41,7 @@ static void force_interrupt(int irq);
 extern void pcibr_force_interrupt(pcibr_intr_t intr);
 extern int sn_force_interrupt_flag;
 struct irq_desc * sn_irq_desc(unsigned int irq);
+extern cpumask_t    __cacheline_aligned pending_irq_cpumask[NR_IRQS];
 
 struct sn_intr_list_t {
 	struct sn_intr_list_t *next;
@@ -71,6 +72,21 @@ sn_enable_irq(unsigned int irq)
 {
 }
 
+static inline void sn_move_irq(int irq)
+{
+	/* note - we hold desc->lock */
+	cpumask_t tmp;
+	irq_desc_t *desc = irq_descp(irq);
+
+	if (!cpus_empty(pending_irq_cpumask[irq])) {
+		cpus_and(tmp, pending_irq_cpumask[irq], cpu_online_map);
+		if (unlikely(!cpus_empty(tmp))) {
+			desc->handler->set_affinity(irq, pending_irq_cpumask[irq]);
+		}
+		cpus_clear(pending_irq_cpumask[irq]);
+	}
+}
+
 static void
 sn_ack_irq(unsigned int irq)
 {
@@ -94,6 +110,7 @@ sn_ack_irq(unsigned int irq)
 	}
 	HUB_S((unsigned long *)GLOBAL_MMR_ADDR(nasid, SH_EVENT_OCCURRED_ALIAS), mask );
 	__set_bit(irq, (volatile void *)pda->sn_in_service_ivecs);
+	sn_move_irq(irq);
 }
 
 static void
@@ -171,7 +188,7 @@ sn_irq_desc(unsigned int irq)
 }
 
 u8
-sn_irq_to_vector(u8 irq)
+sn_irq_to_vector(unsigned int irq)
 {
 	return(irq);
 }
diff --git a/arch/ia64/sn/kernel/mca.c b/arch/ia64/sn/kernel/mca.c
index 58d39a670..3b313e0a3 100644
--- a/arch/ia64/sn/kernel/mca.c
+++ b/arch/ia64/sn/kernel/mca.c
@@ -123,7 +123,8 @@ int sn_salinfo_platform_oemdata(const u8 *sect_header, u8 **oemdata, u64 *oemdat
 	*oemdata_size = 0;
 	vfree(*oemdata);
 	*oemdata = NULL;
-	if (efi_guidcmp(guid, SAL_PLAT_SPECIFIC_ERR_SECT_GUID) == 0)
+	if (efi_guidcmp(guid, SAL_PLAT_SPECIFIC_ERR_SECT_GUID) == 0 ||
+	    efi_guidcmp(guid, SAL_PLAT_MEM_DEV_ERR_SECT_GUID) == 0)
 		return sn_platform_plat_specific_err_print(sect_header, oemdata, oemdata_size);
 	return 0;
 }
diff --git a/arch/ia64/sn/kernel/setup.c b/arch/ia64/sn/kernel/setup.c
index 9644e5805..d3830e338 100644
--- a/arch/ia64/sn/kernel/setup.c
+++ b/arch/ia64/sn/kernel/setup.c
@@ -54,7 +54,6 @@ DEFINE_PER_CPU(struct pda_s, pda_percpu);
 #define MAX_PHYS_MEMORY		(1UL << 49)     /* 1 TB */
 
 extern void bte_init_node (nodepda_t *, cnodeid_t);
-extern void bte_init_cpu (void);
 extern void sn_timer_init(void);
 extern unsigned long last_time_offset;
 extern void init_platform_hubinfo(nodepda_t **nodepdaindr);
@@ -226,7 +225,25 @@ sn_check_for_wars(void)
 			shub_1_1_found = 1;
 }
 
-
+/**
+ * sn_set_error_handling_features - Tell the SN prom how to handle certain
+ * error types.
+ */
+static void __init
+sn_set_error_handling_features(void)
+{
+	u64 ret;
+	u64 sn_ehf_bits[7];	/* see ia64_sn_set_error_handling_features */
+	memset(sn_ehf_bits, 0, sizeof(sn_ehf_bits));
+#define EHF(x) __set_bit(SN_SAL_EHF_ ## x, sn_ehf_bits)
+	EHF(MCA_SLV_TO_OS_INIT_SLV);
+	EHF(NO_RZ_TLBC);
+	// Uncomment once Jesse's code goes in - EHF(NO_RZ_IO_READ); 
+#undef	EHF
+	ret = ia64_sn_set_error_handling_features(sn_ehf_bits);
+	if (ret)
+		printk(KERN_ERR "%s: failed, return code %ld\n", __FUNCTION__, ret);
+}
 
 /**
  * sn_setup - SN platform setup routine
@@ -318,6 +335,9 @@ sn_setup(char **cmdline_p)
 		       master_node_bedrock_address);
 	}
 
+	/* Tell the prom how to handle certain error types */
+	sn_set_error_handling_features();
+
 	/*
 	 * we set the default root device to /dev/hda
 	 * to make simulation easy
@@ -475,8 +495,6 @@ sn_cpu_init(void)
 		buddy_nasid = cnodeid_to_nasid(numa_node_id() == numnodes-1 ? 0 : numa_node_id()+ 1);
 		pda->pio_shub_war_cam_addr = (volatile unsigned long*)GLOBAL_MMR_ADDR(nasid, SH_PI_CAM_CONTROL);
 	}
-
-	bte_init_cpu();
 }
 
 /*
diff --git a/arch/ia64/sn/kernel/sn2/sn2_smp.c b/arch/ia64/sn/kernel/sn2/sn2_smp.c
index e8bc389ed..3ee7c10af 100644
--- a/arch/ia64/sn/kernel/sn2/sn2_smp.c
+++ b/arch/ia64/sn/kernel/sn2/sn2_smp.c
@@ -27,6 +27,7 @@
 #include <asm/delay.h>
 #include <asm/io.h>
 #include <asm/smp.h>
+#include <asm/tlb.h>
 #include <asm/numa.h>
 #include <asm/bitops.h>
 #include <asm/hw_irq.h>
@@ -60,6 +61,13 @@ wait_piowc(void)
 }
 
 
+void
+sn_tlb_migrate_finish(struct mm_struct *mm)
+{
+	if (mm == current->mm)
+		flush_tlb_mm(mm);
+}
+
 
 /**
  * sn2_global_tlb_purge - globally purge translation cache of virtual address range
@@ -114,6 +122,13 @@ sn2_global_tlb_purge (unsigned long start, unsigned long end, unsigned long nbit
 		return;
 	}
 
+	if (atomic_read(&mm->mm_users) == 1) {
+		flush_tlb_mm(mm);
+		preempt_enable();
+		return;
+	}
+
+
 	nix = 0;
 	for (cnode=find_first_bit(&nodes_flushed, NR_NODES); cnode < NR_NODES; 
 			cnode=find_next_bit(&nodes_flushed, NR_NODES, ++cnode))
diff --git a/arch/m68k/Makefile b/arch/m68k/Makefile
index 6a8736ecd..bc79771e8 100644
--- a/arch/m68k/Makefile
+++ b/arch/m68k/Makefile
@@ -28,6 +28,8 @@ ifdef CONFIG_SUN3
 LDFLAGS_vmlinux = -N
 endif
 
+CHECK := $(CHECK) -D__mc68000__=1 -I$(shell $(CC) -print-file-name=include)
+
 # without -fno-strength-reduce the 53c7xx.c driver fails ;-(
 CFLAGS += -pipe -fno-strength-reduce -ffixed-a2
 
diff --git a/arch/m68k/atari/stram.c b/arch/m68k/atari/stram.c
index 65b1b9c7e..9ab7d81b5 100644
--- a/arch/m68k/atari/stram.c
+++ b/arch/m68k/atari/stram.c
@@ -744,7 +744,7 @@ static int unswap_by_read(unsigned short *map, unsigned long max,
 
 		if (map[i]) {
 			entry = swp_entry(stram_swap_type, i);
-			DPRINTK("unswap: map[i=%lu]=%u nr_swap=%u\n",
+			DPRINTK("unswap: map[i=%lu]=%u nr_swap=%ld\n",
 				i, map[i], nr_swap_pages);
 
 			swap_device_lock(stram_swap_info);
@@ -773,7 +773,7 @@ static int unswap_by_read(unsigned short *map, unsigned long max,
 	#endif
 		}
 
-		DPRINTK( "unswap: map[i=%lu]=%u nr_swap=%u\n",
+		DPRINTK( "unswap: map[i=%lu]=%u nr_swap=%ld\n",
 				 i, map[i], nr_swap_pages );
 		swap_list_lock();
 		swap_device_lock(stram_swap_info);
diff --git a/arch/m68k/bvme6000/config.c b/arch/m68k/bvme6000/config.c
index 78c34da58..3ffc84f9c 100644
--- a/arch/m68k/bvme6000/config.c
+++ b/arch/m68k/bvme6000/config.c
@@ -70,7 +70,7 @@ int bvme6000_parse_bootinfo(const struct bi_record *bi)
 		return 1;
 }
 
-void bvme6000_reset()
+void bvme6000_reset(void)
 {
 	volatile PitRegsPtr pit = (PitRegsPtr)BVME_PIT_BASE;
 
diff --git a/arch/m68k/defconfig b/arch/m68k/defconfig
index 5ea3db600..367125a02 100644
--- a/arch/m68k/defconfig
+++ b/arch/m68k/defconfig
@@ -112,7 +112,6 @@ CONFIG_INET=y
 # CONFIG_LLC 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
 
 #
diff --git a/arch/m68k/ifpsp060/iskeleton.S b/arch/m68k/ifpsp060/iskeleton.S
index fc25c5fde..803a6ecdd 100644
--- a/arch/m68k/ifpsp060/iskeleton.S
+++ b/arch/m68k/ifpsp060/iskeleton.S
@@ -196,14 +196,58 @@ _060_real_cas2:
 | Expected outputs:
 |	d0 = 0 -> success; non-zero -> failure
 |
-| Linux/68k: As long as ints are disabled, no swapping out should
-| occur (hopefully...)
+| Linux/m68k: Make sure the page is properly paged in, so we use
+| plpaw and handle any exception here. The kernel must not be
+| preempted until _060_unlock_page(), so that the page stays mapped.
 |
 	.global		_060_real_lock_page
 _060_real_lock_page:
-	clr.l		%d0
+	move.l	%d2,-(%sp)
+	| load sfc/dfc
+	tst.b	%d0
+	jne	1f
+	moveq	#1,%d0
+	jra	2f
+1:	moveq	#5,%d0
+2:	movec.l	%dfc,%d2
+	movec.l	%d0,%dfc
+	movec.l	%d0,%sfc
+
+	clr.l	%d0
+	| prefetch address
+	.chip	68060
+	move.l	%a0,%a1
+1:	plpaw	(%a1)
+	addq.w	#1,%a0
+	tst.b	%d1
+	jeq	2f
+	addq.w	#2,%a0
+2:	plpaw	(%a0)
+3:	.chip	68k
+
+	| restore sfc/dfc
+	movec.l	%d2,%dfc
+	movec.l	%d2,%sfc
+	move.l	(%sp)+,%d2
 	rts
 
+.section __ex_table,"a"
+	.align	4
+	.long	1b,11f
+	.long	2b,21f
+.previous
+.section .fixup,"ax"
+	.even
+11:	move.l	#0x020003c0,%d0
+	or.l	%d2,%d0
+	swap	%d0
+	jra	3b
+21:	move.l	#0x02000bc0,%d0
+	or.l	%d2,%d0
+	swap	%d0
+	jra	3b
+.previous
+
 |
 | _060_unlock_page():
 |
@@ -216,8 +260,7 @@ _060_real_lock_page:
 |	d0 = `xxxxxxff -> supervisor; `xxxxxx00 -> user
 |	d1 = `xxxxxxff -> longword; `xxxxxx00 -> word
 |
-| Linux/68k: As we do no special locking operation, also no unlocking
-| is needed...
+| Linux/m68k: perhaps reenable preemption here...
 
 	.global		_060_real_unlock_page
 _060_real_unlock_page:
diff --git a/arch/m68k/kernel/process.c b/arch/m68k/kernel/process.c
index 552bd2ff1..b426ab55a 100644
--- a/arch/m68k/kernel/process.c
+++ b/arch/m68k/kernel/process.c
@@ -26,6 +26,7 @@
 #include <linux/a.out.h>
 #include <linux/reboot.h>
 #include <linux/init_task.h>
+#include <linux/mqueue.h>
 
 #include <asm/uaccess.h>
 #include <asm/system.h>
diff --git a/arch/m68k/kernel/setup.c b/arch/m68k/kernel/setup.c
index 2ede4125b..1d2563e11 100644
--- a/arch/m68k/kernel/setup.c
+++ b/arch/m68k/kernel/setup.c
@@ -62,7 +62,6 @@ struct mem_info m68k_memory[NUM_MEMINFO];
 static struct mem_info m68k_ramdisk;
 
 static char m68k_command_line[CL_SIZE];
-char saved_command_line[CL_SIZE];
 
 char m68k_debug_device[6] = "";
 
@@ -238,6 +237,18 @@ void __init setup_arch(char **cmdline_p)
 	}
 #endif
 
+	if (CPU_IS_060) {
+		u32 pcr;
+
+		asm (".chip 68060; movec %%pcr,%0; .chip 68k"
+		     : "=d" (pcr));
+		if (((pcr >> 8) & 0xff) <= 5) {
+			printk("Enabling workaround for errata I14\n");
+			asm (".chip 68060; movec %0,%%pcr; .chip 68k"
+			     : : "d" (pcr | 0x20));
+		}
+	}
+
 	init_mm.start_code = PAGE_OFFSET;
 	init_mm.end_code = (unsigned long) &_etext;
 	init_mm.end_data = (unsigned long) &_edata;
diff --git a/arch/m68k/kernel/signal.c b/arch/m68k/kernel/signal.c
index 0fd62ab0f..c37c4dbb8 100644
--- a/arch/m68k/kernel/signal.c
+++ b/arch/m68k/kernel/signal.c
@@ -228,8 +228,8 @@ static inline int restore_fpu_state(struct sigcontext *sc)
 		goto out;
 
 	    __asm__ volatile (".chip 68k/68881\n\t"
-			      "fmovemx %0,%/fp0-%/fp1\n\t"
-			      "fmoveml %1,%/fpcr/%/fpsr/%/fpiar\n\t"
+			      "fmovemx %0,%%fp0-%%fp1\n\t"
+			      "fmoveml %1,%%fpcr/%%fpsr/%%fpiar\n\t"
 			      ".chip 68k"
 			      : /* no outputs */
 			      : "m" (*sc->sc_fpregs), "m" (*sc->sc_fpcntl));
@@ -258,7 +258,7 @@ static inline int rt_restore_fpu_state(struct ucontext *uc)
 	if (FPU_IS_EMU) {
 		/* restore fpu control register */
 		if (__copy_from_user(current->thread.fpcntl,
-				&uc->uc_mcontext.fpregs.f_pcr, 12))
+				uc->uc_mcontext.fpregs.f_fpcntl, 12))
 			goto out;
 		/* restore all other fpu register */
 		if (__copy_from_user(current->thread.fp,
@@ -298,12 +298,12 @@ static inline int rt_restore_fpu_state(struct ucontext *uc)
 				     sizeof(fpregs)))
 			goto out;
 		__asm__ volatile (".chip 68k/68881\n\t"
-				  "fmovemx %0,%/fp0-%/fp7\n\t"
-				  "fmoveml %1,%/fpcr/%/fpsr/%/fpiar\n\t"
+				  "fmovemx %0,%%fp0-%%fp7\n\t"
+				  "fmoveml %1,%%fpcr/%%fpsr/%%fpiar\n\t"
 				  ".chip 68k"
 				  : /* no outputs */
 				  : "m" (*fpregs.f_fpregs),
-				    "m" (fpregs.f_pcr));
+				    "m" (*fpregs.f_fpcntl));
 	}
 	if (context_size &&
 	    __copy_from_user(fpstate + 4, (long *)&uc->uc_fpstate + 1,
@@ -349,7 +349,7 @@ restore_sigcontext(struct pt_regs *regs, struct sigcontext *usc, void *fp,
 		/*
 		 * user process trying to return with weird frame format
 		 */
-#if DEBUG
+#ifdef DEBUG
 		printk("user process returning with weird frame format\n");
 #endif
 		goto badframe;
@@ -450,7 +450,7 @@ rt_restore_ucontext(struct pt_regs *regs, struct switch_stack *sw,
 		/*
 		 * user process trying to return with weird frame format
 		 */
-#if DEBUG
+#ifdef DEBUG
 		printk("user process returning with weird frame format\n");
 #endif
 		goto badframe;
@@ -586,12 +586,12 @@ static inline void save_fpu_state(struct sigcontext *sc, struct pt_regs *regs)
 				sc->sc_fpstate[0x38] |= 1 << 3;
 		}
 		__asm__ volatile (".chip 68k/68881\n\t"
-				  "fmovemx %/fp0-%/fp1,%0\n\t"
-				  "fmoveml %/fpcr/%/fpsr/%/fpiar,%1\n\t"
+				  "fmovemx %%fp0-%%fp1,%0\n\t"
+				  "fmoveml %%fpcr/%%fpsr/%%fpiar,%1\n\t"
 				  ".chip 68k"
-				  : /* no outputs */
-				  : "m" (*sc->sc_fpregs),
-				    "m" (*sc->sc_fpcntl)
+				  : "=m" (*sc->sc_fpregs),
+				    "=m" (*sc->sc_fpcntl)
+				  : /* no inputs */
 				  : "memory");
 	}
 }
@@ -604,7 +604,7 @@ static inline int rt_save_fpu_state(struct ucontext *uc, struct pt_regs *regs)
 
 	if (FPU_IS_EMU) {
 		/* save fpu control register */
-		err |= copy_to_user(&uc->uc_mcontext.fpregs.f_pcr,
+		err |= copy_to_user(uc->uc_mcontext.fpregs.f_fpcntl,
 				current->thread.fpcntl, 12);
 		/* save all other fpu register */
 		err |= copy_to_user(uc->uc_mcontext.fpregs.f_fpregs,
@@ -631,12 +631,12 @@ static inline int rt_save_fpu_state(struct ucontext *uc, struct pt_regs *regs)
 				fpstate[0x38] |= 1 << 3;
 		}
 		__asm__ volatile (".chip 68k/68881\n\t"
-				  "fmovemx %/fp0-%/fp7,%0\n\t"
-				  "fmoveml %/fpcr/%/fpsr/%/fpiar,%1\n\t"
+				  "fmovemx %%fp0-%%fp7,%0\n\t"
+				  "fmoveml %%fpcr/%%fpsr/%%fpiar,%1\n\t"
 				  ".chip 68k"
-				  : /* no outputs */
-				  : "m" (*fpregs.f_fpregs),
-				    "m" (fpregs.f_pcr)
+				  : "=m" (*fpregs.f_fpregs),
+				    "=m" (*fpregs.f_fpcntl)
+				  : /* no inputs */
 				  : "memory");
 		err |= copy_to_user(&uc->uc_mcontext.fpregs, &fpregs,
 				    sizeof(fpregs));
@@ -829,7 +829,7 @@ adjust_stack:
 	if (regs->stkadj) {
 		struct pt_regs *tregs =
 			(struct pt_regs *)((ulong)regs + regs->stkadj);
-#if DEBUG
+#ifdef DEBUG
 		printk("Performing stackadjust=%04x\n", regs->stkadj);
 #endif
 		/* This must be copied with decreasing addresses to
@@ -912,7 +912,7 @@ adjust_stack:
 	if (regs->stkadj) {
 		struct pt_regs *tregs =
 			(struct pt_regs *)((ulong)regs + regs->stkadj);
-#if DEBUG
+#ifdef DEBUG
 		printk("Performing stackadjust=%04x\n", regs->stkadj);
 #endif
 		/* This must be copied with decreasing addresses to
diff --git a/arch/m68k/kernel/traps.c b/arch/m68k/kernel/traps.c
index fdf8e0ae9..deb36e8b0 100644
--- a/arch/m68k/kernel/traps.c
+++ b/arch/m68k/kernel/traps.c
@@ -329,7 +329,8 @@ static inline void access_error060 (struct frame *fp)
 		 * fault during mem_read/mem_write in ifpsp060/os.S
 		 */
 		send_fault_sig(&fp->ptregs);
-	} else {
+	} else if (!(fslw & (MMU060_RE|MMU060_WE)) ||
+		   send_fault_sig(&fp->ptregs) > 0) {
 		printk("pc=%#lx, fa=%#lx\n", fp->ptregs.pc, fp->un.fmt4.effaddr);
 		printk( "68060 access error, fslw=%lx\n", fslw );
 		trap_c( fp );
@@ -517,7 +518,7 @@ static inline void access_error040(struct frame *fp)
 			if (fp->un.fmt7.wb2a == fp->un.fmt7.faddr)
 				fp->un.fmt7.wb2s &= ~WBV_040;
 		}
-	} else {
+	} else if (send_fault_sig(&fp->ptregs) > 0) {
 		printk("68040 access error, ssw=%x\n", ssw);
 		trap_c(fp);
 	}
@@ -540,7 +541,7 @@ static inline void bus_error030 (struct frame *fp)
 	unsigned short ssw = fp->un.fmtb.ssw;
 	extern unsigned long _sun3_map_test_start, _sun3_map_test_end;
 
-#if DEBUG
+#ifdef DEBUG
 	if (ssw & (FC | FB))
 		printk ("Instruction fault at %#010lx\n",
 			ssw & FC ?
@@ -669,7 +670,7 @@ static inline void bus_error030 (struct frame *fp)
 	unsigned short mmusr;
 	unsigned long addr, errorcode;
 	unsigned short ssw = fp->un.fmtb.ssw;
-#if DEBUG
+#ifdef DEBUG
 	unsigned long desc;
 
 	printk ("pid = %x  ", current->pid);
@@ -695,7 +696,7 @@ static inline void bus_error030 (struct frame *fp)
 	if (ssw & DF) {
 		addr = fp->un.fmtb.daddr;
 
-#if DEBUG
+#ifdef DEBUG
 		asm volatile ("ptestr %3,%2@,#7,%0\n\t"
 			      "pmove %%psr,%1@"
 			      : "=a&" (desc)
@@ -707,7 +708,7 @@ static inline void bus_error030 (struct frame *fp)
 #endif
 		mmusr = temp;
 
-#if DEBUG
+#ifdef DEBUG
 		printk("mmusr is %#x for addr %#lx in task %p\n",
 		       mmusr, addr, current);
 		printk("descriptor address is %#lx, contents %#lx\n",
@@ -732,7 +733,7 @@ static inline void bus_error030 (struct frame *fp)
 				return;
 		} else if (!(mmusr & MMU_I)) {
 			/* probably a 020 cas fault */
-			if (!(ssw & RM))
+			if (!(ssw & RM) && send_fault_sig(&fp->ptregs) > 0)
 				printk("unexpected bus error (%#x,%#x)\n", ssw, mmusr);
 		} else if (mmusr & (MMU_B|MMU_L|MMU_S)) {
 			printk("invalid %s access at %#lx from pc %#lx\n",
@@ -766,7 +767,7 @@ static inline void bus_error030 (struct frame *fp)
 				      : "a" (&tlong));
 			printk("tt1 is %#lx\n", tlong);
 #endif
-#if DEBUG
+#ifdef DEBUG
 			printk("Unknown SIGSEGV - 1\n");
 #endif
 			die_if_kernel("Oops",&fp->ptregs,mmusr);
@@ -811,7 +812,7 @@ static inline void bus_error030 (struct frame *fp)
 		   should still create the ATC entry.  */
 		goto create_atc_entry;
 
-#if DEBUG
+#ifdef DEBUG
 	asm volatile ("ptestr #1,%2@,#7,%0\n\t"
 		      "pmove %%psr,%1@"
 		      : "=a&" (desc)
@@ -835,7 +836,7 @@ static inline void bus_error030 (struct frame *fp)
 	else if (mmusr & (MMU_B|MMU_L|MMU_S)) {
 		printk ("invalid insn access at %#lx from pc %#lx\n",
 			addr, fp->ptregs.pc);
-#if DEBUG
+#ifdef DEBUG
 		printk("Unknown SIGSEGV - 2\n");
 #endif
 		die_if_kernel("Oops",&fp->ptregs,mmusr);
@@ -857,7 +858,7 @@ asmlinkage void buserr_c(struct frame *fp)
 	if (user_mode(&fp->ptregs))
 		current->thread.esp0 = (unsigned long) fp;
 
-#if DEBUG
+#ifdef DEBUG
 	printk ("*** Bus Error *** Format is %x\n", fp->ptregs.format);
 #endif
 
@@ -880,7 +881,7 @@ asmlinkage void buserr_c(struct frame *fp)
 #endif
 	default:
 	  die_if_kernel("bad frame format",&fp->ptregs,0);
-#if DEBUG
+#ifdef DEBUG
 	  printk("Unknown SIGSEGV - 4\n");
 #endif
 	  force_sig(SIGSEGV, current);
@@ -910,7 +911,7 @@ void show_trace(unsigned long *stack)
 		 * down the cause of the crash will be able to figure
 		 * out the call path that was taken.
 		 */
-		if (kernel_text_address(addr)) {
+		if (__kernel_text_address(addr)) {
 #ifndef CONFIG_KALLSYMS
 			if (i % 5 == 0)
 				printk("\n       ");
@@ -989,7 +990,7 @@ void show_registers(struct pt_regs *regs)
 	printk ("\n");
 }
 
-extern void show_stack(struct task_struct *task, unsigned long *stack)
+void show_stack(struct task_struct *task, unsigned long *stack)
 {
 	unsigned long *endstack;
 	int i;
diff --git a/arch/m68k/lib/checksum.c b/arch/m68k/lib/checksum.c
index 4e0e312fc..484ba8b50 100644
--- a/arch/m68k/lib/checksum.c
+++ b/arch/m68k/lib/checksum.c
@@ -32,6 +32,7 @@
  *		csum_partial_copy_from_user.
  */
 
+#include <linux/module.h>
 #include <net/checksum.h>
 
 /*
diff --git a/arch/m68k/mac/iop.c b/arch/m68k/mac/iop.c
index 59442d091..d889ba80c 100644
--- a/arch/m68k/mac/iop.c
+++ b/arch/m68k/mac/iop.c
@@ -261,7 +261,7 @@ void __init iop_preinit(void)
 		} else {
 			iop_base[IOP_NUM_ISM] = (struct mac_iop *) ISM_IOP_BASE_QUADRA;
 		}
-		iop_base[IOP_NUM_SCC]->status_ctrl = 0;
+		iop_base[IOP_NUM_ISM]->status_ctrl = 0;
 		iop_ism_present = 1;
 	} else {
 		iop_base[IOP_NUM_ISM] = NULL;
diff --git a/arch/m68k/mac/macints.c b/arch/m68k/mac/macints.c
index c50cdb6f6..1809601ad 100644
--- a/arch/m68k/mac/macints.c
+++ b/arch/m68k/mac/macints.c
@@ -545,7 +545,8 @@ void mac_free_irq(unsigned int irq, void *dev_id)
 #endif
 
 	if (irq < VIA1_SOURCE_BASE) {
-		return cpu_free_irq(irq, dev_id);
+		cpu_free_irq(irq, dev_id);
+		return;
 	}
 
 	if (irq >= NUM_MAC_SOURCES) {
diff --git a/arch/m68k/mm/init.c b/arch/m68k/mm/init.c
index d79dbfae6..c45beb955 100644
--- a/arch/m68k/mm/init.c
+++ b/arch/m68k/mm/init.c
@@ -47,7 +47,7 @@ void show_mem(void)
 
     printk("\nMem-info:\n");
     show_free_areas();
-    printk("Free swap:       %6dkB\n",nr_swap_pages<<(PAGE_SHIFT-10));
+    printk("Free swap:       %6ldkB\n", nr_swap_pages<<(PAGE_SHIFT-10));
     i = max_mapnr;
     while (i-- > 0) {
 	total++;
diff --git a/arch/m68k/mm/kmap.c b/arch/m68k/mm/kmap.c
index dceda2ecc..5dcb3fa35 100644
--- a/arch/m68k/mm/kmap.c
+++ b/arch/m68k/mm/kmap.c
@@ -45,7 +45,7 @@ static inline struct vm_struct *get_io_area(unsigned long size)
 
 static inline void free_io_area(void *addr)
 {
-	return vfree((void *)(PAGE_MASK & (unsigned long)addr));
+	vfree((void *)(PAGE_MASK & (unsigned long)addr));
 }
 
 #else
diff --git a/arch/m68k/mm/memory.c b/arch/m68k/mm/memory.c
index d9616bebb..09985ae7f 100644
--- a/arch/m68k/mm/memory.c
+++ b/arch/m68k/mm/memory.c
@@ -54,7 +54,7 @@ void __init init_pointer_table(unsigned long ptable)
 
 	/* unreserve the page so it's possible to free that page */
 	PD_PAGE(dp)->flags &= ~(1 << PG_reserved);
-	atomic_set(&PD_PAGE(dp)->count, 1);
+	set_page_count(PD_PAGE(dp), 1);
 
 	return;
 }
@@ -129,7 +129,7 @@ int free_pointer_table (pmd_t *ptable)
 	return 0;
 }
 
-#if DEBUG_INVALID_PTOV
+#ifdef DEBUG_INVALID_PTOV
 int mm_inv_cnt = 5;
 #endif
 
@@ -179,7 +179,7 @@ unsigned long mm_ptov (unsigned long paddr)
 		voff += m68k_memory[i].size;
 	} while (++i < m68k_num_memory);
 
-#if DEBUG_INVALID_PTOV
+#ifdef DEBUG_INVALID_PTOV
 	if (mm_inv_cnt > 0) {
 		mm_inv_cnt--;
 		printk("Invalid use of phys_to_virt(0x%lx) at 0x%p!\n",
diff --git a/arch/m68k/mvme147/config.c b/arch/m68k/mvme147/config.c
index 58c3b9db9..0fcf9720c 100644
--- a/arch/m68k/mvme147/config.c
+++ b/arch/m68k/mvme147/config.c
@@ -69,7 +69,7 @@ int mvme147_parse_bootinfo(const struct bi_record *bi)
 		return 1;
 }
 
-void mvme147_reset()
+void mvme147_reset(void)
 {
 	printk ("\r\n\nCalled mvme147_reset\r\n");
 	m147_pcc->watchdog = 0x0a;	/* Clear timer */
diff --git a/arch/m68k/mvme16x/config.c b/arch/m68k/mvme16x/config.c
index 79182f1c8..26ce81c13 100644
--- a/arch/m68k/mvme16x/config.c
+++ b/arch/m68k/mvme16x/config.c
@@ -75,7 +75,7 @@ int mvme16x_parse_bootinfo(const struct bi_record *bi)
 		return 1;
 }
 
-void mvme16x_reset()
+void mvme16x_reset(void)
 {
 	printk ("\r\n\nCalled mvme16x_reset\r\n"
 			"\r\r\r\r\r\r\r\r\r\r\r\r\r\r\r\r\r\r");
diff --git a/arch/m68k/q40/config.c b/arch/m68k/q40/config.c
index 1f8977e79..0b5730cd9 100644
--- a/arch/m68k/q40/config.c
+++ b/arch/m68k/q40/config.c
@@ -64,7 +64,6 @@ void q40_set_vectors (void);
 
 extern void q40_mksound(unsigned int /*freq*/, unsigned int /*ticks*/ );
 
-extern char *saved_command_line;
 extern char m68k_debug_device[];
 static void q40_mem_console_write(struct console *co, const char *b,
 				    unsigned int count);
@@ -123,7 +122,7 @@ static void q40_heartbeat(int on)
 }
 #endif
 
-void q40_reset()
+void q40_reset(void)
 {
         halted=1;
         printk ("\n\n*******************************************\n"
@@ -132,7 +131,7 @@ void q40_reset()
 	Q40_LED_ON();
 	while(1) ;
 }
-void q40_halt()
+void q40_halt(void)
 {
         halted=1;
         printk ("\n\n*******************\n"
@@ -296,7 +295,7 @@ int q40_hwclk(int op, struct rtc_time *t)
 	return 0;
 }
 
-unsigned int q40_get_ss()
+unsigned int q40_get_ss(void)
 {
 	return bcd2bin(Q40_RTC_SECS);
 }
diff --git a/arch/m68knommu/defconfig b/arch/m68knommu/defconfig
index 153bbfecc..b101057f0 100644
--- a/arch/m68knommu/defconfig
+++ b/arch/m68knommu/defconfig
@@ -235,7 +235,6 @@ CONFIG_IPV6_SCTP__=y
 # 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
 
 #
diff --git a/arch/m68knommu/kernel/init_task.c b/arch/m68knommu/kernel/init_task.c
index 51ee0a032..3897043a1 100644
--- a/arch/m68knommu/kernel/init_task.c
+++ b/arch/m68knommu/kernel/init_task.c
@@ -7,6 +7,7 @@
 #include <linux/init.h>
 #include <linux/init_task.h>
 #include <linux/fs.h>
+#include <linux/mqueue.h>
 
 #include <asm/uaccess.h>
 #include <asm/pgtable.h>
diff --git a/arch/m68knommu/kernel/setup.c b/arch/m68knommu/kernel/setup.c
index bd6a4a89f..edcecd4d0 100644
--- a/arch/m68knommu/kernel/setup.c
+++ b/arch/m68knommu/kernel/setup.c
@@ -31,6 +31,7 @@
 #include <linux/bootmem.h>
 #include <linux/seq_file.h>
 #include <linux/root_dev.h>
+#include <linux/init.h>
 
 #include <asm/setup.h>
 #include <asm/irq.h>
@@ -44,8 +45,7 @@ unsigned long rom_length;
 unsigned long memory_start;
 unsigned long memory_end;
 
-char command_line[512];
-char saved_command_line[512];
+char command_line[COMMAND_LINE_SIZE];
 
 /* setup some dummy routines */
 static void dummy_waitbut(void)
@@ -216,8 +216,8 @@ void setup_arch(char **cmdline_p)
 
 	/* Keep a copy of command line */
 	*cmdline_p = &command_line[0];
-	memcpy(saved_command_line, command_line, sizeof(saved_command_line));
-	saved_command_line[sizeof(saved_command_line)-1] = 0;
+	memcpy(saved_command_line, command_line, COMMAND_LINE_SIZE);
+	saved_command_line[COMMAND_LINE_SIZE-1] = 0;
 
 #ifdef DEBUG
 	if (strlen(*cmdline_p)) 
diff --git a/arch/mips/Kconfig b/arch/mips/Kconfig
index 8d6d86c07..6c1c24b69 100644
--- a/arch/mips/Kconfig
+++ b/arch/mips/Kconfig
@@ -91,16 +91,11 @@ config IBM_WORKPAD
 	select IRQ_CPU
 	select ISA
 
-config NEC_EAGLE
-	bool "Support for NEC Eagle/Hawk board"
-	select DMA_NONCOHERENT
-	select IRQ_CPU
-	depends on MACH_VR41XX
-
 config TANBAC_TB0226
 	bool "Support for TANBAC TB0226 (Mbase)"
 	depends on MACH_VR41XX
 	select DMA_NONCOHERENT
+	select HW_HAS_PCI
 	select IRQ_CPU
 	help
 	  The TANBAC TB0226 (Mbase) is a MIPS-based platform manufactured by TANBAC.
@@ -110,6 +105,7 @@ config TANBAC_TB0229
 	bool "Support for TANBAC TB0229 (VR4131DIMM)"
 	depends on MACH_VR41XX
 	select DMA_NONCOHERENT
+	select HW_HAS_PCI
 	select IRQ_CPU
 	help
 	  The TANBAC TB0229 (VR4131DIMM) is a MIPS-based platform manufactured by TANBAC.
@@ -118,6 +114,7 @@ config TANBAC_TB0229
 config VICTOR_MPC30X
 	bool "Support for Victor MP-C303/304"
 	select DMA_NONCOHERENT
+	select HW_HAS_PCI
 	select IRQ_CPU
 	depends on MACH_VR41XX
 
@@ -125,17 +122,22 @@ config ZAO_CAPCELLA
 	bool "Support for ZAO Networks Capcella"
 	depends on MACH_VR41XX
 	select DMA_NONCOHERENT
+	select HW_HAS_PCI
 	select IRQ_CPU
 
+config PCI_VR41XX
+	bool "Add PCI control unit support of NEC VR4100 series"
+	depends on MACH_VR41XX && PCI
+
 config VRC4171
-	tristate "add NEC VRC4171 companion chip support"
+	tristate "Add NEC VRC4171 companion chip support"
 	depends on MACH_VR41XX && ISA
 	---help---
 	  The NEC VRC4171/4171A is a companion chip for NEC VR4111/VR4121.
 
 config VRC4173
-	tristate "add NEC VRC4173 companion chip support"
-	depends on MACH_VR41XX && PCI
+	tristate "Add NEC VRC4173 companion chip support"
+	depends on MACH_VR41XX && PCI_VR41XX
 	---help---
 	  The NEC VRC4173 is a companion chip for NEC VR4122/VR4131.
 
@@ -143,11 +145,13 @@ config TOSHIBA_JMR3927
 	bool "Support for Toshiba JMR-TX3927 board"
 	depends on MIPS32
 	select DMA_NONCOHERENT
+	select HW_HAS_PCI
 
 config MIPS_COBALT
 	bool "Support for Cobalt Server (EXPERIMENTAL)"
 	depends on EXPERIMENTAL
 	select DMA_NONCOHERENT
+	select HW_HAS_PCI
 	select IRQ_CPU
 
 config MACH_DECSTATION
@@ -174,6 +178,7 @@ config MIPS_EV64120
 	bool "Support for Galileo EV64120 Evaluation board (EXPERIMENTAL)"
 	depends on EXPERIMENTAL
 	select DMA_NONCOHERENT
+	select HW_HAS_PCI
 	help
 	  This is an evaluation board based on the Galileo GT-64120
 	  single-chip system controller that contains a MIPS R5000 compatible
@@ -189,6 +194,7 @@ config MIPS_EV96100
 	bool "Support for Galileo EV96100 Evaluation board (EXPERIMENTAL)"
 	depends on EXPERIMENTAL
 	select DMA_NONCOHERENT
+	select HW_HAS_PCI
 	select IRQ_CPU
 	select MIPS_GT96100
 	select RM7000_CPU_SCACHE
@@ -201,6 +207,7 @@ config MIPS_EV96100
 config MIPS_IVR
 	bool "Support for Globespan IVR board"
 	select DMA_NONCOHERENT
+	select HW_HAS_PCI
 	help
 	  This is an evaluation board built by Globespan to showcase thir
 	  iVR (Internet Video Recorder) design. It utilizes a QED RM5231
@@ -211,6 +218,7 @@ config MIPS_IVR
 config LASAT
 	bool "Support for LASAT Networks platforms"
 	select DMA_NONCOHERENT
+	select HW_HAS_PCI
 	select R5000_CPU_SCACHE
 
 config PICVUE
@@ -233,11 +241,13 @@ config HP_LASERJET
 	bool "Support for Hewlett Packard LaserJet board"
 	depends on BROKEN
 	select DMA_NONCOHERENT
+	select HW_HAS_PCI
 	select IRQ_CPU
 
 config MIPS_ITE8172
 	bool "Support for ITE 8172G board"
 	select DMA_NONCOHERENT
+	select HW_HAS_PCI
 	help
 	  Ths is an evaluation board made by ITE <http://www.ite.com.tw/>
 	  with ATX form factor that utilizes a MIPS R5000 to work with its
@@ -257,6 +267,7 @@ config IT8172_REVC
 config MIPS_ATLAS
 	bool "Support for MIPS Atlas board"
 	select DMA_NONCOHERENT
+	select HW_HAS_PCI
 	help
 	  This enables support for the QED R5231-based MIPS Atlas evaluation
 	  board.
@@ -265,6 +276,7 @@ config MIPS_MALTA
 	bool "Support for MIPS Malta board"
 	select HAVE_STD_PC_SERIAL_PORT
 	select DMA_NONCOHERENT
+	select HW_HAS_PCI
 	help
 	  This enables support for the VR5000-based MIPS Malta evaluation
 	  board.
@@ -278,6 +290,7 @@ config MIPS_SEAD
 config MOMENCO_OCELOT
 	bool "Support for Momentum Ocelot board"
 	select DMA_NONCOHERENT
+	select HW_HAS_PCI
 	select IRQ_CPU
 	select IRQ_CPU_RM7K
 	select RM7000_CPU_SCACHE
@@ -288,8 +301,10 @@ config MOMENCO_OCELOT
 config MOMENCO_OCELOT_G
 	bool "Support for Momentum Ocelot-G board"
 	select DMA_NONCOHERENT
+	select HW_HAS_PCI
 	select IRQ_CPU
 	select IRQ_CPU_RM7K
+	select PCI_MARVELL
 	select RM7000_CPU_SCACHE
 	help
 	  The Ocelot is a MIPS-based Single Board Computer (SBC) made by
@@ -298,7 +313,10 @@ config MOMENCO_OCELOT_G
 config MOMENCO_OCELOT_C
 	bool "Support for Momentum Ocelot-C board"
 	select DMA_NONCOHERENT
+	select HW_HAS_PCI
 	select IRQ_CPU
+	select IRQ_MV64340
+	select PCI_MARVELL
 	select RM7000_CPU_SCACHE
 	help
 	  The Ocelot is a MIPS-based Single Board Computer (SBC) made by
@@ -307,9 +325,12 @@ config MOMENCO_OCELOT_C
 config MOMENCO_JAGUAR_ATX
 	bool "Support for Momentum Jaguar board"
 	select DMA_NONCOHERENT
+	select HW_HAS_PCI
 	select IRQ_CPU
 	select IRQ_CPU_RM7K
+	select IRQ_MV64340
 	select LIMITED_DMA
+	select PCI_MARVELL
 	select RM7000_CPU_SCACHE
 	help
 	  The Jaguar ATX is a MIPS-based Single Board Computer (SBC) made by
@@ -324,7 +345,10 @@ config JAGUAR_DMALOW
 
 config PMC_YOSEMITE
 	bool "Support for PMC-Sierra Yosemite eval board"
-	select DMA_NONCOHERENT
+	select DMA_COHERENT
+	select HW_HAS_PCI
+	select IRQ_CPU
+	select IRQ_CPU_RM7K
 	help
 	  Yosemite is an evaluation board for the RM9000x2 processor
 	  manufactured by PMC-Sierra
@@ -338,6 +362,7 @@ config DDB5074
 	depends on EXPERIMENTAL
 	select DMA_NONCOHERENT
 	select HAVE_STD_PC_SERIAL_PORT
+	select HW_HAS_PCI
 	select IRQ_CPU
 	select ISA
 	help
@@ -348,6 +373,7 @@ config DDB5476
 	bool "Support for NEC DDB Vrc-5476"
 	select DMA_NONCOHERENT
 	select HAVE_STD_PC_SERIAL_PORT
+	select HW_HAS_PCI
 	select IRQ_CPU
 	select ISA
 	help
@@ -361,6 +387,7 @@ config DDB5476
 config DDB5477
 	bool "Support for NEC DDB Vrc-5477"
 	select DMA_NONCOHERENT
+	select HW_HAS_PCI
 	select IRQ_CPU
 	help
 	  This enables support for the R5432-based NEC DDB Vrc-5477,
@@ -393,6 +420,7 @@ config SGI_IP27
 	bool "Support for SGI IP27 (Origin200/2000)"
 	depends on MIPS64
 	select DMA_IP27
+	select HW_HAS_PCI
 	help
 	  This are the SGI Origin 200, Origin 2000 and Onyx 2 Graphics
 	  workstations.  To compile a Linux kernel that runs on these, say Y
@@ -457,6 +485,7 @@ config SGI_IP32
 	bool "Support for SGI IP32 (O2) (EXPERIMENTAL)"
 	depends on EXPERIMENTAL
 	select DMA_NONCOHERENT
+	select HW_HAS_PCI
 	select R5000_CPU_SCACHE
 	select RM7000_CPU_SCACHE
 	help
@@ -499,26 +528,31 @@ config MIPS_PB1000
 	bool "PB1000 board"
 	depends on SOC_AU1000
 	select DMA_NONCOHERENT
+	select HW_HAS_PCI
 
 config MIPS_PB1100
 	bool "PB1100 board"
 	depends on SOC_AU1100
 	select DMA_NONCOHERENT
+	select HW_HAS_PCI
 
 config MIPS_PB1500
 	bool "PB1500 board"
 	depends on SOC_AU1500
 	select DMA_NONCOHERENT
+	select HW_HAS_PCI
 
 config MIPS_PB1550
 	bool "PB1550 board"
 	depends on SOC_AU1550
 	select DMA_NONCOHERENT
+	select HW_HAS_PCI
 
 config MIPS_DB1000
 	bool "DB1000 board"
 	depends on SOC_AU1000
 	select DMA_NONCOHERENT
+	select HW_HAS_PCI
 
 config MIPS_DB1100
 	bool "DB1100 board"
@@ -529,10 +563,12 @@ config MIPS_DB1500
 	bool "DB1500 board"
 	depends on SOC_AU1500
 	select DMA_NONCOHERENT
+	select HW_HAS_PCI
 
 config MIPS_DB1550
 	bool "DB1550 board"
 	depends on SOC_AU1550
+	select HW_HAS_PCI
 
 config MIPS_BOSPORUS
 	bool "Bosporus board"
@@ -642,6 +678,7 @@ endchoice
 
 config SIBYTE_SB1250
 	bool
+	select HW_HAS_PCI
 
 config SIBYTE_BCM1120
 	bool
@@ -649,10 +686,12 @@ config SIBYTE_BCM1120
 
 config SIBYTE_BCM1125
 	bool
+	select HW_HAS_PCI
 	select SIBYTE_BCM112X
 
 config SIBYTE_BCM1125H
 	bool
+	select HW_HAS_PCI
 	select SIBYTE_BCM112X
 
 config SIBYTE_BCM112X
@@ -699,11 +738,6 @@ endchoice
 config CPU_SB1_PASS_2
 	bool
 
-config SIBYTE_HAS_PCI
-	bool
-	depends on SIBYTE_SB1250 || SIBYTE_BCM1125 || SIBYTE_BCM1125H
-	default y
-
 config SIBYTE_HAS_LDT
 	bool
 	depends on PCI && (SIBYTE_SB1250 || SIBYTE_BCM1125H)
@@ -770,6 +804,7 @@ config SNI_RM200_PCI
 	bool "Support for SNI RM200 PCI"
 	select DMA_NONCOHERENT
 	select HAVE_STD_PC_SERIAL_PORT
+	select HW_HAS_PCI
 	select ISA
 	help
 	  The SNI RM200 PCI was a MIPS-based platform manufactured by Siemens
@@ -781,6 +816,7 @@ config TOSHIBA_RBTX4927
 	bool "Support for Toshiba TBTX49[23]7 board"
 	depends on MIPS32
 	select DMA_NONCOHERENT
+	select HW_HAS_PCI
 	select ISA
 
 config RWSEM_GENERIC_SPINLOCK
@@ -847,7 +883,7 @@ config MIPS_NILE4
 
 config CPU_LITTLE_ENDIAN
 	bool "Generate little endian code"
-	default y if ACER_PICA_61 || CASIO_E55 || DDB5074 || DDB5476 || DDB5477 || MACH_DECSTATION || HP_LASERJET || IBM_WORKPAD || LASAT || MIPS_COBALT || MIPS_ITE8172 || MIPS_IVR || SOC_AU1X00 || NEC_OSPREY || NEC_EAGLE || OLIVETTI_M700 || SNI_RM200_PCI || VICTOR_MPC30X || ZAO_CAPCELLA
+	default y if ACER_PICA_61 || CASIO_E55 || DDB5074 || DDB5476 || DDB5477 || MACH_DECSTATION || HP_LASERJET || IBM_WORKPAD || LASAT || MIPS_COBALT || MIPS_ITE8172 || MIPS_IVR || SOC_AU1X00 || NEC_OSPREY || OLIVETTI_M700 || SNI_RM200_PCI || VICTOR_MPC30X || ZAO_CAPCELLA
 	default n if BAGET_MIPS || MIPS_EV64120 || MIPS_EV96100 || MOMENCO_OCELOT || MOMENCO_OCELOT_G || SGI_IP22 || SGI_IP27 || SGI_IP32 || TOSHIBA_JMR3927
 	help
 	  Some MIPS machines can be configured for either little or big endian
@@ -860,10 +896,8 @@ config IRQ_CPU
 config IRQ_CPU_RM7K
 	bool
 
-config DUMMY_KEYB
+config IRQ_MV64340
 	bool
-	depends on ZAO_CAPCELLA || VICTOR_MPC30X || SIBYTE_SB1xxx_SOC || NEC_EAGLE || NEC_OSPREY || DDB5477 || CASIO_E55 || TANBAC_TB0226 || TANBAC_TB0229
-	default y
 
 config DDB5XXX_COMMON
 	bool
@@ -885,16 +919,14 @@ config MIPS_GT64120
 	depends on MIPS_EV64120 || MIPS_EV96100 || LASAT || MIPS_ATLAS || MIPS_MALTA || MOMENCO_OCELOT
 	default y
 
-config MIPS_MV64340
-	bool
-	depends on MOMENCO_JAGUAR_ATX || MOMENCO_OCELOT_C
-	default y
-
 config MIPS_TX3927
 	bool
 	depends on TOSHIBA_JMR3927
 	default y
 
+config PCI_MARVELL
+	bool
+
 config ITE_BOARD_GEN
 	bool
 	depends on MIPS_IVR || MIPS_ITE8172
@@ -932,11 +964,6 @@ config AU1000_USB_DEVICE
 	depends on MIPS_PB1500 || MIPS_PB1100 || MIPS_PB1000
 	default n
 
-config COBALT_LCD
-	bool
-	depends on MIPS_COBALT
-	default y
-
 config MIPS_GT96100
 	bool
 	depends on MIPS_EV96100
@@ -1169,6 +1196,16 @@ config PAGE_SIZE_4KB
 	 4kB page size will minimize memory consumption and is therefore
 	 recommended for low memory systems. 
 
+config PAGE_SIZE_8KB
+	bool "8kB"
+	depends on EXPERIMENTAL && CPU_R8000
+	help
+	  Using 8kB page size will result in higher performance kernel at
+	  the price of higher memory consumption.  This option is available
+	  only on the R8000 processor.  Not that at the time of this writing
+	  this option is still high experimental; there are also issues with
+	  compatibility of user applications.
+
 config PAGE_SIZE_16KB
 	bool "16kB"
 	depends on EXPERIMENTAL && !CPU_R3000 && !CPU_TX39XX
@@ -1382,9 +1419,12 @@ endmenu
 
 menu "Bus options (PCI, PCMCIA, EISA, ISA, TC)"
 
+config HW_HAS_PCI
+	bool
+
 config PCI
 	bool "Support for PCI controller"
-	depends on MIPS_DB1000 || DDB5074 || DDB5476 || DDB5477 || HP_LASERJET || LASAT || MIPS_IVR || MIPS_ATLAS || MIPS_COBALT || MIPS_EV64120 || MIPS_EV96100 || MIPS_ITE8172 || MIPS_MALTA || MOMENCO_OCELOT || MOMENCO_OCELOT_C || MOMENCO_OCELOT_G || MOMENCO_JAGUAR_ATX || MIPS_PB1000 || MIPS_PB1100 || SOC_AU1500 || SOC_AU1550 || NEC_EAGLE || SGI_IP27 || SGI_IP32 || SIBYTE_HAS_PCI || SNI_RM200_PCI || TANBAC_TB0226 || TANBAC_TB0229 || TOSHIBA_JMR3927 || TOSHIBA_RBTX4927 || VICTOR_MPC30X || ZAO_CAPCELLA
+	depends on HW_HAS_PCI
 	help
 	  Find out whether you have a PCI motherboard. PCI is the name of a
 	  bus system, i.e. the way the CPU talks to the other stuff inside
@@ -1564,7 +1604,7 @@ config DEBUG_STACK_USAGE
 
 config DEBUG_SLAB
 	bool "Debug memory allocations"
-	depends on DEBUG_KERNEL && !CPU_HAS_LLDSCD
+	depends on DEBUG_KERNEL
 	help
 	  Say Y here to have the kernel do limited verification on memory
 	  allocation as well as poisoning memory on free to catch use of freed
diff --git a/arch/mips/Makefile b/arch/mips/Makefile
index 8c4fb4b1d..371558708 100644
--- a/arch/mips/Makefile
+++ b/arch/mips/Makefile
@@ -405,6 +405,13 @@ load-$(CONFIG_MOMENCO_OCELOT_G)	+= 0x80100000
 core-$(CONFIG_MOMENCO_OCELOT_C)	+= arch/mips/momentum/ocelot_c/
 load-$(CONFIG_MOMENCO_OCELOT_C)	+= 0x80100000
 
+#
+# PMC-Sierra Yosemite
+#
+core-$(CONFIG_PMC_YOSEMITE)	+= arch/mips/pmc-sierra/yosemite/
+cflags-$(CONFIG_PMC_YOSEMITE)	+= -Iinclude/asm-mips/mach-yosemite
+load-$(CONFIG_PMC_YOSEMITE)	+= 0x80100000
+
 #
 # Momentum Jaguar ATX
 #
@@ -456,12 +463,6 @@ load-$(CONFIG_NEC_OSPREY)	+= 0x80002000
 core-$(CONFIG_MACH_VR41XX)	+= arch/mips/vr41xx/common/
 cflags-$(CONFIG_MACH_VR41XX)	+= -Iinclude/asm-mips/mach-vr41xx
 
-#
-# NEC Eagle/Hawk (VR4122/VR4131) board
-#
-core-$(CONFIG_NEC_EAGLE)	+= arch/mips/vr41xx/nec-eagle/
-load-$(CONFIG_NEC_EAGLE)	+= 0x80000000
-
 #
 # ZAO Networks Capcella (VR4131)
 #
@@ -659,8 +660,6 @@ libs-$(CONFIG_MIPS32)	+= arch/mips/lib-32/
 libs-$(CONFIG_MIPS64)	+= arch/mips/lib-64/
 
 core-y			+= arch/mips/kernel/ arch/mips/mm/ arch/mips/math-emu/
-core-$(CONFIG_MIPS32)	+= arch/mips/mm-32/
-core-$(CONFIG_MIPS64)	+= arch/mips/mm-64/
 
 ifdef CONFIG_BAGET_MIPS
 
diff --git a/arch/mips/baget/irq.c b/arch/mips/baget/irq.c
index fe158acf8..d2067c037 100644
--- a/arch/mips/baget/irq.c
+++ b/arch/mips/baget/irq.c
@@ -325,7 +325,7 @@ int request_irq(unsigned int irq,
 
 	action->handler = handler;
 	action->flags = irqflags;
-	action->mask = 0;
+	cpus_clear(action->mask);
 	action->name = devname;
 	action->next = NULL;
 	action->dev_id = dev_id;
@@ -389,7 +389,7 @@ static void write_err_interrupt(int irq, void *dev_id, struct pt_regs * regs)
 }
 
 static struct irqaction irq0  =
-{ write_err_interrupt, SA_INTERRUPT, 0, "bus write error", NULL, NULL};
+{ write_err_interrupt, SA_INTERRUPT, CPU_MASK_NONE, "bus write error", NULL, NULL};
 
 void __init init_IRQ(void)
 {
diff --git a/arch/mips/baget/time.c b/arch/mips/baget/time.c
index 205bde312..ed82c62df 100644
--- a/arch/mips/baget/time.c
+++ b/arch/mips/baget/time.c
@@ -67,7 +67,7 @@ static void __init timer_enable(void)
 }
 
 static struct irqaction timer_irq  =
-{ timer_interrupt, SA_INTERRUPT, 0, "timer", NULL, NULL};
+{ timer_interrupt, SA_INTERRUPT, CPU_MASK_NONE, "timer", NULL, NULL};
 
 void __init time_init(void)
 {
diff --git a/arch/mips/boot/Makefile b/arch/mips/boot/Makefile
index a6e88d318..c010290e5 100644
--- a/arch/mips/boot/Makefile
+++ b/arch/mips/boot/Makefile
@@ -39,7 +39,7 @@ $(obj)/addinitrd: $(obj)/addinitrd.c
 archhelp:
 	@echo	'* vmlinux.ecoff	- ECOFF boot image'
 
-CLEAN_FILES += addinitrd \
+clean-files += addinitrd \
 	       elf2ecoff \
 	       vmlinux.ecoff \
 	       vmlinux.srec \
diff --git a/arch/mips/configs/atlas_defconfig b/arch/mips/configs/atlas_defconfig
index 9814c8e6d..9e0a5bc52 100644
--- a/arch/mips/configs/atlas_defconfig
+++ b/arch/mips/configs/atlas_defconfig
@@ -28,6 +28,7 @@ CONFIG_LOG_BUF_SHIFT=14
 # CONFIG_IKCONFIG is not set
 CONFIG_EMBEDDED=y
 CONFIG_KALLSYMS=y
+# CONFIG_KALLSYMS_EXTRA_PASS is not set
 CONFIG_FUTEX=y
 CONFIG_EPOLL=y
 CONFIG_IOSCHED_NOOP=y
@@ -107,6 +108,7 @@ CONFIG_CPU_MIPS32=y
 # CONFIG_CPU_RM9000 is not set
 # CONFIG_CPU_SB1 is not set
 CONFIG_PAGE_SIZE_4KB=y
+# CONFIG_PAGE_SIZE_8KB is not set
 # CONFIG_PAGE_SIZE_16KB is not set
 # CONFIG_PAGE_SIZE_64KB is not set
 CONFIG_CPU_HAS_PREFETCH=y
@@ -121,6 +123,7 @@ CONFIG_CPU_HAS_SYNC=y
 #
 # Bus options (PCI, PCMCIA, EISA, ISA, TC)
 #
+CONFIG_HW_HAS_PCI=y
 CONFIG_PCI=y
 CONFIG_PCI_LEGACY_PROC=y
 CONFIG_PCI_NAMES=y
@@ -141,6 +144,7 @@ CONFIG_TRAD_SIGNALS=y
 #
 # Generic Driver Options
 #
+CONFIG_PREVENT_FIRMWARE_BUILD=y
 
 #
 # Memory Technology Devices (MTD)
@@ -167,7 +171,7 @@ CONFIG_TRAD_SIGNALS=y
 CONFIG_BLK_DEV_LOOP=y
 # CONFIG_BLK_DEV_CRYPTOLOOP is not set
 # CONFIG_BLK_DEV_NBD is not set
-# CONFIG_BLK_DEV_CARMEL is not set
+# CONFIG_BLK_DEV_SX8 is not set
 CONFIG_BLK_DEV_RAM=y
 CONFIG_BLK_DEV_RAM_SIZE=4096
 # CONFIG_BLK_DEV_INITRD is not set
@@ -197,7 +201,6 @@ CONFIG_BLK_DEV_SD=y
 # Some SCSI devices (e.g. CD jukebox) support multiple LUNs
 #
 # CONFIG_SCSI_MULTI_LUN is not set
-# CONFIG_SCSI_REPORT_LUNS is not set
 # CONFIG_SCSI_CONSTANTS is not set
 # CONFIG_SCSI_LOGGING is not set
 
@@ -211,16 +214,16 @@ CONFIG_BLK_DEV_SD=y
 # SCSI low-level drivers
 #
 # CONFIG_BLK_DEV_3W_XXXX_RAID is not set
+# CONFIG_SCSI_3W_9XXX is not set
 # CONFIG_SCSI_ACARD is not set
 # CONFIG_SCSI_AACRAID is not set
 # CONFIG_SCSI_AIC7XXX is not set
 # CONFIG_SCSI_AIC7XXX_OLD is not set
 # CONFIG_SCSI_AIC79XX is not set
-# CONFIG_SCSI_ADVANSYS is not set
+# CONFIG_SCSI_DPT_I2O is not set
 # CONFIG_SCSI_MEGARAID is not set
 # CONFIG_SCSI_SATA is not set
 # CONFIG_SCSI_BUSLOGIC is not set
-# CONFIG_SCSI_CPQFCTS is not set
 # CONFIG_SCSI_DMX3191D is not set
 # CONFIG_SCSI_EATA is not set
 # CONFIG_SCSI_EATA_PIO is not set
@@ -229,6 +232,7 @@ CONFIG_BLK_DEV_SD=y
 # CONFIG_SCSI_IPS is not set
 # CONFIG_SCSI_INIA100 is not set
 # CONFIG_SCSI_SYM53C8XX_2 is not set
+# CONFIG_SCSI_IPR is not set
 # CONFIG_SCSI_QLOGIC_ISP is not set
 # CONFIG_SCSI_QLOGIC_FC is not set
 # CONFIG_SCSI_QLOGIC_1280 is not set
@@ -312,13 +316,13 @@ CONFIG_XFRM=y
 # 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
+# CONFIG_NET_CLS_ROUTE is not set
 
 #
 # Network testing
@@ -395,7 +399,6 @@ CONFIG_NET_ETHERNET=y
 # CONFIG_PPP is not set
 # CONFIG_SLIP is not set
 # CONFIG_NET_FC is not set
-# CONFIG_RCPCI is not set
 # CONFIG_SHAPER is not set
 # CONFIG_NETCONSOLE is not set
 
@@ -616,7 +619,6 @@ CONFIG_SUNRPC=y
 # CONFIG_CIFS is not set
 # CONFIG_NCP_FS is not set
 # CONFIG_CODA_FS is not set
-# CONFIG_INTERMEZZO_FS is not set
 # CONFIG_AFS_FS is not set
 
 #
@@ -650,4 +652,6 @@ CONFIG_CMDLINE=""
 #
 # Library routines
 #
+CONFIG_CRC16=y
 # CONFIG_CRC32 is not set
+# CONFIG_LIBCRC32C is not set
diff --git a/arch/mips/configs/bosporus_defconfig b/arch/mips/configs/bosporus_defconfig
index edf9ced7a..5bc312a3c 100644
--- a/arch/mips/configs/bosporus_defconfig
+++ b/arch/mips/configs/bosporus_defconfig
@@ -28,6 +28,7 @@ CONFIG_HOTPLUG=y
 # CONFIG_IKCONFIG is not set
 CONFIG_EMBEDDED=y
 CONFIG_KALLSYMS=y
+# CONFIG_KALLSYMS_EXTRA_PASS is not set
 CONFIG_FUTEX=y
 CONFIG_EPOLL=y
 CONFIG_IOSCHED_NOOP=y
@@ -105,6 +106,7 @@ CONFIG_CPU_MIPS32=y
 # CONFIG_CPU_RM9000 is not set
 # CONFIG_CPU_SB1 is not set
 CONFIG_PAGE_SIZE_4KB=y
+# CONFIG_PAGE_SIZE_8KB is not set
 # CONFIG_PAGE_SIZE_16KB is not set
 # CONFIG_PAGE_SIZE_64KB is not set
 CONFIG_CPU_HAS_PREFETCH=y
@@ -146,6 +148,7 @@ CONFIG_TRAD_SIGNALS=y
 #
 # Generic Driver Options
 #
+CONFIG_PREVENT_FIRMWARE_BUILD=y
 # CONFIG_FW_LOADER is not set
 
 #
@@ -265,13 +268,13 @@ CONFIG_XFRM=y
 # 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
+# CONFIG_NET_CLS_ROUTE is not set
 
 #
 # Network testing
@@ -496,6 +499,9 @@ CONFIG_FS_MBCACHE=y
 CONFIG_REISERFS_FS=m
 # CONFIG_REISERFS_CHECK is not set
 # CONFIG_REISERFS_PROC_INFO is not set
+CONFIG_REISERFS_FS_XATTR=y
+CONFIG_REISERFS_FS_POSIX_ACL=y
+CONFIG_REISERFS_FS_SECURITY=y
 # CONFIG_JFS_FS is not set
 CONFIG_FS_POSIX_ACL=y
 # CONFIG_XFS_FS is not set
@@ -567,7 +573,6 @@ CONFIG_SMB_FS=m
 # CONFIG_CIFS is not set
 # CONFIG_NCP_FS is not set
 # CONFIG_CODA_FS is not set
-# CONFIG_INTERMEZZO_FS is not set
 # CONFIG_AFS_FS is not set
 
 #
@@ -604,6 +609,7 @@ CONFIG_NLS_DEFAULT="iso8859-1"
 # CONFIG_NLS_ISO8859_8 is not set
 # CONFIG_NLS_CODEPAGE_1250 is not set
 # CONFIG_NLS_CODEPAGE_1251 is not set
+# CONFIG_NLS_ASCII is not set
 # CONFIG_NLS_ISO8859_1 is not set
 # CONFIG_NLS_ISO8859_2 is not set
 # CONFIG_NLS_ISO8859_3 is not set
@@ -652,11 +658,14 @@ CONFIG_CRYPTO_AES=y
 # CONFIG_CRYPTO_ARC4 is not set
 CONFIG_CRYPTO_DEFLATE=y
 CONFIG_CRYPTO_MICHAEL_MIC=y
+CONFIG_CRYPTO_CRC32C=m
 # CONFIG_CRYPTO_TEST is not set
 
 #
 # Library routines
 #
+CONFIG_CRC16=m
 CONFIG_CRC32=y
+CONFIG_LIBCRC32C=m
 CONFIG_ZLIB_INFLATE=y
 CONFIG_ZLIB_DEFLATE=y
diff --git a/arch/mips/configs/capcella_defconfig b/arch/mips/configs/capcella_defconfig
index 910a796df..b59e45387 100644
--- a/arch/mips/configs/capcella_defconfig
+++ b/arch/mips/configs/capcella_defconfig
@@ -28,6 +28,7 @@ CONFIG_LOG_BUF_SHIFT=14
 # CONFIG_IKCONFIG is not set
 CONFIG_EMBEDDED=y
 CONFIG_KALLSYMS=y
+# CONFIG_KALLSYMS_EXTRA_PASS is not set
 CONFIG_FUTEX=y
 CONFIG_EPOLL=y
 CONFIG_IOSCHED_NOOP=y
@@ -54,12 +55,12 @@ CONFIG_KMOD=y
 CONFIG_MACH_VR41XX=y
 # CONFIG_CASIO_E55 is not set
 # CONFIG_IBM_WORKPAD is not set
-# CONFIG_NEC_EAGLE is not set
 # CONFIG_TANBAC_TB0226 is not set
 # CONFIG_TANBAC_TB0229 is not set
 # CONFIG_VICTOR_MPC30X is not set
 CONFIG_ZAO_CAPCELLA=y
-# CONFIG_VRC4173 is not set
+CONFIG_PCI_VR41XX=y
+CONFIG_VRC4173=y
 # CONFIG_TOSHIBA_JMR3927 is not set
 # CONFIG_MIPS_COBALT is not set
 # CONFIG_MACH_DECSTATION is not set
@@ -91,7 +92,6 @@ CONFIG_HAVE_DEC_LOCK=y
 CONFIG_DMA_NONCOHERENT=y
 CONFIG_CPU_LITTLE_ENDIAN=y
 CONFIG_IRQ_CPU=y
-CONFIG_DUMMY_KEYB=y
 CONFIG_MIPS_L1_CACHE_SHIFT=5
 # CONFIG_FB is not set
 
@@ -116,6 +116,7 @@ CONFIG_CPU_VR41XX=y
 # CONFIG_CPU_RM9000 is not set
 # CONFIG_CPU_SB1 is not set
 CONFIG_PAGE_SIZE_4KB=y
+# CONFIG_PAGE_SIZE_8KB is not set
 # CONFIG_PAGE_SIZE_16KB is not set
 # CONFIG_PAGE_SIZE_64KB is not set
 # CONFIG_CPU_ADVANCED is not set
@@ -126,6 +127,7 @@ CONFIG_CPU_HAS_SYNC=y
 #
 # Bus options (PCI, PCMCIA, EISA, ISA, TC)
 #
+CONFIG_HW_HAS_PCI=y
 CONFIG_PCI=y
 CONFIG_PCI_LEGACY_PROC=y
 CONFIG_PCI_NAMES=y
@@ -145,6 +147,7 @@ CONFIG_TRAD_SIGNALS=y
 #
 # Generic Driver Options
 #
+CONFIG_PREVENT_FIRMWARE_BUILD=y
 
 #
 # Memory Technology Devices (MTD)
@@ -170,7 +173,7 @@ CONFIG_TRAD_SIGNALS=y
 # CONFIG_BLK_DEV_UMEM is not set
 # CONFIG_BLK_DEV_LOOP is not set
 # CONFIG_BLK_DEV_NBD is not set
-# CONFIG_BLK_DEV_CARMEL is not set
+# CONFIG_BLK_DEV_SX8 is not set
 # CONFIG_BLK_DEV_RAM is not set
 # CONFIG_LBD is not set
 
@@ -183,9 +186,9 @@ CONFIG_BLK_DEV_IDE=y
 #
 # Please see Documentation/ide.txt for help/info on IDE drives
 #
+# CONFIG_BLK_DEV_IDE_SATA is not set
 CONFIG_BLK_DEV_IDEDISK=y
 # CONFIG_IDEDISK_MULTI_MODE is not set
-# CONFIG_IDEDISK_STROKE is not set
 # CONFIG_BLK_DEV_IDECD is not set
 # CONFIG_BLK_DEV_IDETAPE is not set
 # CONFIG_BLK_DEV_IDEFLOPPY is not set
@@ -197,6 +200,7 @@ CONFIG_IDE_TASKFILE_IO=y
 #
 CONFIG_IDE_GENERIC=y
 # CONFIG_BLK_DEV_IDEPCI is not set
+# CONFIG_IDE_ARM is not set
 # CONFIG_BLK_DEV_IDEDMA is not set
 # CONFIG_IDEDMA_AUTO is not set
 # CONFIG_BLK_DEV_HD is not set
@@ -214,7 +218,6 @@ CONFIG_IDE_GENERIC=y
 #
 # Fusion MPT device support
 #
-# CONFIG_FUSION is not set
 
 #
 # IEEE 1394 (FireWire) support
@@ -275,13 +278,13 @@ CONFIG_XFRM=y
 # 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
+# CONFIG_NET_CLS_ROUTE is not set
 
 #
 # Network testing
@@ -357,7 +360,6 @@ CONFIG_NET_ETHERNET=y
 # CONFIG_HIPPI is not set
 # CONFIG_PPP is not set
 # CONFIG_SLIP is not set
-# CONFIG_RCPCI is not set
 # CONFIG_SHAPER is not set
 # CONFIG_NETCONSOLE is not set
 
@@ -591,7 +593,6 @@ CONFIG_SUNRPC=y
 # CONFIG_CIFS is not set
 # CONFIG_NCP_FS is not set
 # CONFIG_CODA_FS is not set
-# CONFIG_INTERMEZZO_FS is not set
 # CONFIG_AFS_FS is not set
 
 #
@@ -625,4 +626,6 @@ CONFIG_CMDLINE=""
 #
 # Library routines
 #
+CONFIG_CRC16=m
 # CONFIG_CRC32 is not set
+CONFIG_LIBCRC32C=m
diff --git a/arch/mips/configs/cobalt_defconfig b/arch/mips/configs/cobalt_defconfig
index a653f0297..d47f67bb5 100644
--- a/arch/mips/configs/cobalt_defconfig
+++ b/arch/mips/configs/cobalt_defconfig
@@ -28,6 +28,7 @@ CONFIG_LOG_BUF_SHIFT=14
 # CONFIG_IKCONFIG is not set
 CONFIG_EMBEDDED=y
 CONFIG_KALLSYMS=y
+# CONFIG_KALLSYMS_EXTRA_PASS is not set
 CONFIG_FUTEX=y
 CONFIG_EPOLL=y
 CONFIG_IOSCHED_NOOP=y
@@ -80,7 +81,6 @@ CONFIG_I8259=y
 CONFIG_CPU_LITTLE_ENDIAN=y
 CONFIG_IRQ_CPU=y
 CONFIG_MIPS_GT64111=y
-CONFIG_COBALT_LCD=y
 CONFIG_MIPS_L1_CACHE_SHIFT=5
 # CONFIG_FB is not set
 
@@ -105,6 +105,7 @@ CONFIG_CPU_NEVADA=y
 # CONFIG_CPU_RM9000 is not set
 # CONFIG_CPU_SB1 is not set
 CONFIG_PAGE_SIZE_4KB=y
+# CONFIG_PAGE_SIZE_8KB is not set
 # CONFIG_PAGE_SIZE_16KB is not set
 # CONFIG_PAGE_SIZE_64KB is not set
 # CONFIG_CPU_ADVANCED is not set
@@ -117,6 +118,7 @@ CONFIG_CPU_HAS_SYNC=y
 #
 # Bus options (PCI, PCMCIA, EISA, ISA, TC)
 #
+CONFIG_HW_HAS_PCI=y
 CONFIG_PCI=y
 CONFIG_PCI_LEGACY_PROC=y
 CONFIG_PCI_NAMES=y
@@ -136,6 +138,7 @@ CONFIG_TRAD_SIGNALS=y
 #
 # Generic Driver Options
 #
+CONFIG_PREVENT_FIRMWARE_BUILD=y
 
 #
 # Memory Technology Devices (MTD)
@@ -162,7 +165,7 @@ CONFIG_TRAD_SIGNALS=y
 CONFIG_BLK_DEV_LOOP=y
 # CONFIG_BLK_DEV_CRYPTOLOOP is not set
 # CONFIG_BLK_DEV_NBD is not set
-# CONFIG_BLK_DEV_CARMEL is not set
+# CONFIG_BLK_DEV_SX8 is not set
 # CONFIG_BLK_DEV_RAM is not set
 # CONFIG_LBD is not set
 
@@ -175,9 +178,9 @@ CONFIG_BLK_DEV_IDE=y
 #
 # Please see Documentation/ide.txt for help/info on IDE drives
 #
+# CONFIG_BLK_DEV_IDE_SATA is not set
 CONFIG_BLK_DEV_IDEDISK=y
 # CONFIG_IDEDISK_MULTI_MODE is not set
-# CONFIG_IDEDISK_STROKE is not set
 # CONFIG_BLK_DEV_IDECD is not set
 # CONFIG_BLK_DEV_IDETAPE is not set
 # CONFIG_BLK_DEV_IDEFLOPPY is not set
@@ -189,6 +192,7 @@ CONFIG_IDE_TASKFILE_IO=y
 #
 CONFIG_IDE_GENERIC=y
 # CONFIG_BLK_DEV_IDEPCI is not set
+# CONFIG_IDE_ARM is not set
 # CONFIG_BLK_DEV_IDEDMA is not set
 # CONFIG_IDEDMA_AUTO is not set
 # CONFIG_BLK_DEV_HD is not set
@@ -206,7 +210,6 @@ CONFIG_IDE_GENERIC=y
 #
 # Fusion MPT device support
 #
-# CONFIG_FUSION is not set
 
 #
 # IEEE 1394 (FireWire) support
@@ -263,13 +266,13 @@ CONFIG_XFRM=y
 # 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
+# CONFIG_NET_CLS_ROUTE is not set
 
 #
 # Network testing
@@ -345,7 +348,6 @@ CONFIG_NET_ETHERNET=y
 # CONFIG_HIPPI is not set
 # CONFIG_PPP is not set
 # CONFIG_SLIP is not set
-# CONFIG_RCPCI is not set
 # CONFIG_SHAPER is not set
 # CONFIG_NETCONSOLE is not set
 
@@ -432,6 +434,7 @@ CONFIG_LEGACY_PTY_COUNT=256
 #
 # CONFIG_WATCHDOG is not set
 CONFIG_RTC=y
+CONFIG_COBALT_LCD=y
 # CONFIG_DTLK is not set
 # CONFIG_R3964 is not set
 # CONFIG_APPLICOM is not set
@@ -567,7 +570,6 @@ CONFIG_SUNRPC=y
 # CONFIG_CIFS is not set
 # CONFIG_NCP_FS is not set
 # CONFIG_CODA_FS is not set
-# CONFIG_INTERMEZZO_FS is not set
 # CONFIG_AFS_FS is not set
 
 #
@@ -601,4 +603,6 @@ CONFIG_CMDLINE=""
 #
 # Library routines
 #
+CONFIG_CRC16=y
 # CONFIG_CRC32 is not set
+# CONFIG_LIBCRC32C is not set
diff --git a/arch/mips/configs/db1000_defconfig b/arch/mips/configs/db1000_defconfig
index fbb3ecda0..62e748bfd 100644
--- a/arch/mips/configs/db1000_defconfig
+++ b/arch/mips/configs/db1000_defconfig
@@ -28,6 +28,7 @@ CONFIG_HOTPLUG=y
 # CONFIG_IKCONFIG is not set
 CONFIG_EMBEDDED=y
 CONFIG_KALLSYMS=y
+# CONFIG_KALLSYMS_EXTRA_PASS is not set
 CONFIG_FUTEX=y
 CONFIG_EPOLL=y
 CONFIG_IOSCHED_NOOP=y
@@ -122,6 +123,7 @@ CONFIG_CPU_MIPS32=y
 # CONFIG_CPU_RM9000 is not set
 # CONFIG_CPU_SB1 is not set
 CONFIG_PAGE_SIZE_4KB=y
+# CONFIG_PAGE_SIZE_8KB is not set
 # CONFIG_PAGE_SIZE_16KB is not set
 # CONFIG_PAGE_SIZE_64KB is not set
 CONFIG_CPU_HAS_PREFETCH=y
@@ -136,6 +138,7 @@ CONFIG_CPU_HAS_SYNC=y
 #
 # Bus options (PCI, PCMCIA, EISA, ISA, TC)
 #
+CONFIG_HW_HAS_PCI=y
 # CONFIG_PCI is not set
 CONFIG_MMU=y
 
@@ -165,6 +168,7 @@ CONFIG_TRAD_SIGNALS=y
 #
 # Generic Driver Options
 #
+CONFIG_PREVENT_FIRMWARE_BUILD=y
 # CONFIG_FW_LOADER is not set
 
 #
@@ -284,13 +288,13 @@ CONFIG_XFRM=y
 # 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
+# CONFIG_NET_CLS_ROUTE is not set
 
 #
 # Network testing
@@ -522,6 +526,9 @@ CONFIG_FS_MBCACHE=y
 CONFIG_REISERFS_FS=m
 # CONFIG_REISERFS_CHECK is not set
 # CONFIG_REISERFS_PROC_INFO is not set
+CONFIG_REISERFS_FS_XATTR=y
+CONFIG_REISERFS_FS_POSIX_ACL=y
+CONFIG_REISERFS_FS_SECURITY=y
 # CONFIG_JFS_FS is not set
 CONFIG_FS_POSIX_ACL=y
 # CONFIG_XFS_FS is not set
@@ -593,7 +600,6 @@ CONFIG_SMB_FS=m
 # CONFIG_CIFS is not set
 # CONFIG_NCP_FS is not set
 # CONFIG_CODA_FS is not set
-# CONFIG_INTERMEZZO_FS is not set
 # CONFIG_AFS_FS is not set
 
 #
@@ -630,6 +636,7 @@ CONFIG_NLS_DEFAULT="iso8859-1"
 # CONFIG_NLS_ISO8859_8 is not set
 # CONFIG_NLS_CODEPAGE_1250 is not set
 # CONFIG_NLS_CODEPAGE_1251 is not set
+# CONFIG_NLS_ASCII is not set
 # CONFIG_NLS_ISO8859_1 is not set
 # CONFIG_NLS_ISO8859_2 is not set
 # CONFIG_NLS_ISO8859_3 is not set
@@ -678,11 +685,14 @@ CONFIG_CRYPTO_AES=y
 # CONFIG_CRYPTO_ARC4 is not set
 CONFIG_CRYPTO_DEFLATE=y
 CONFIG_CRYPTO_MICHAEL_MIC=y
+CONFIG_CRYPTO_CRC32C=m
 # CONFIG_CRYPTO_TEST is not set
 
 #
 # Library routines
 #
+CONFIG_CRC16=m
 CONFIG_CRC32=y
+CONFIG_LIBCRC32C=m
 CONFIG_ZLIB_INFLATE=y
 CONFIG_ZLIB_DEFLATE=y
diff --git a/arch/mips/configs/db1100_defconfig b/arch/mips/configs/db1100_defconfig
index 088b3a106..d6b544edb 100644
--- a/arch/mips/configs/db1100_defconfig
+++ b/arch/mips/configs/db1100_defconfig
@@ -28,6 +28,7 @@ CONFIG_HOTPLUG=y
 # CONFIG_IKCONFIG is not set
 CONFIG_EMBEDDED=y
 CONFIG_KALLSYMS=y
+# CONFIG_KALLSYMS_EXTRA_PASS is not set
 CONFIG_FUTEX=y
 CONFIG_EPOLL=y
 CONFIG_IOSCHED_NOOP=y
@@ -122,6 +123,7 @@ CONFIG_CPU_MIPS32=y
 # CONFIG_CPU_RM9000 is not set
 # CONFIG_CPU_SB1 is not set
 CONFIG_PAGE_SIZE_4KB=y
+# CONFIG_PAGE_SIZE_8KB is not set
 # CONFIG_PAGE_SIZE_16KB is not set
 # CONFIG_PAGE_SIZE_64KB is not set
 CONFIG_CPU_HAS_PREFETCH=y
@@ -164,6 +166,7 @@ CONFIG_TRAD_SIGNALS=y
 #
 # Generic Driver Options
 #
+CONFIG_PREVENT_FIRMWARE_BUILD=y
 # CONFIG_FW_LOADER is not set
 
 #
@@ -283,13 +286,13 @@ CONFIG_XFRM=y
 # 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
+# CONFIG_NET_CLS_ROUTE is not set
 
 #
 # Network testing
@@ -518,6 +521,9 @@ CONFIG_FS_MBCACHE=y
 CONFIG_REISERFS_FS=m
 # CONFIG_REISERFS_CHECK is not set
 # CONFIG_REISERFS_PROC_INFO is not set
+CONFIG_REISERFS_FS_XATTR=y
+CONFIG_REISERFS_FS_POSIX_ACL=y
+CONFIG_REISERFS_FS_SECURITY=y
 # CONFIG_JFS_FS is not set
 CONFIG_FS_POSIX_ACL=y
 # CONFIG_XFS_FS is not set
@@ -589,7 +595,6 @@ CONFIG_SMB_FS=m
 # CONFIG_CIFS is not set
 # CONFIG_NCP_FS is not set
 # CONFIG_CODA_FS is not set
-# CONFIG_INTERMEZZO_FS is not set
 # CONFIG_AFS_FS is not set
 
 #
@@ -626,6 +631,7 @@ CONFIG_NLS_DEFAULT="iso8859-1"
 # CONFIG_NLS_ISO8859_8 is not set
 # CONFIG_NLS_CODEPAGE_1250 is not set
 # CONFIG_NLS_CODEPAGE_1251 is not set
+# CONFIG_NLS_ASCII is not set
 # CONFIG_NLS_ISO8859_1 is not set
 # CONFIG_NLS_ISO8859_2 is not set
 # CONFIG_NLS_ISO8859_3 is not set
@@ -674,11 +680,14 @@ CONFIG_CRYPTO_AES=y
 # CONFIG_CRYPTO_ARC4 is not set
 CONFIG_CRYPTO_DEFLATE=y
 CONFIG_CRYPTO_MICHAEL_MIC=y
+CONFIG_CRYPTO_CRC32C=m
 # CONFIG_CRYPTO_TEST is not set
 
 #
 # Library routines
 #
+CONFIG_CRC16=m
 CONFIG_CRC32=y
+CONFIG_LIBCRC32C=m
 CONFIG_ZLIB_INFLATE=y
 CONFIG_ZLIB_DEFLATE=y
diff --git a/arch/mips/configs/db1500_defconfig b/arch/mips/configs/db1500_defconfig
index 86ecbe185..97a22cb43 100644
--- a/arch/mips/configs/db1500_defconfig
+++ b/arch/mips/configs/db1500_defconfig
@@ -28,6 +28,7 @@ CONFIG_HOTPLUG=y
 # CONFIG_IKCONFIG is not set
 CONFIG_EMBEDDED=y
 CONFIG_KALLSYMS=y
+# CONFIG_KALLSYMS_EXTRA_PASS is not set
 CONFIG_FUTEX=y
 CONFIG_EPOLL=y
 CONFIG_IOSCHED_NOOP=y
@@ -122,6 +123,7 @@ CONFIG_CPU_MIPS32=y
 # CONFIG_CPU_RM9000 is not set
 # CONFIG_CPU_SB1 is not set
 CONFIG_PAGE_SIZE_4KB=y
+# CONFIG_PAGE_SIZE_8KB is not set
 # CONFIG_PAGE_SIZE_16KB is not set
 # CONFIG_PAGE_SIZE_64KB is not set
 CONFIG_CPU_HAS_PREFETCH=y
@@ -136,6 +138,7 @@ CONFIG_CPU_HAS_SYNC=y
 #
 # Bus options (PCI, PCMCIA, EISA, ISA, TC)
 #
+CONFIG_HW_HAS_PCI=y
 # CONFIG_PCI is not set
 CONFIG_MMU=y
 
@@ -165,6 +168,7 @@ CONFIG_TRAD_SIGNALS=y
 #
 # Generic Driver Options
 #
+CONFIG_PREVENT_FIRMWARE_BUILD=y
 # CONFIG_FW_LOADER is not set
 
 #
@@ -257,9 +261,9 @@ CONFIG_BLK_DEV_IDE=y
 #
 # Please see Documentation/ide.txt for help/info on IDE drives
 #
+# CONFIG_BLK_DEV_IDE_SATA is not set
 CONFIG_BLK_DEV_IDEDISK=y
 # CONFIG_IDEDISK_MULTI_MODE is not set
-# CONFIG_IDEDISK_STROKE is not set
 CONFIG_BLK_DEV_IDECS=m
 # CONFIG_BLK_DEV_IDECD is not set
 # CONFIG_BLK_DEV_IDETAPE is not set
@@ -271,6 +275,7 @@ CONFIG_BLK_DEV_IDECS=m
 # IDE chipset support/bugfixes
 #
 CONFIG_IDE_GENERIC=y
+# CONFIG_IDE_ARM is not set
 # CONFIG_BLK_DEV_IDEDMA is not set
 # CONFIG_IDEDMA_AUTO is not set
 # CONFIG_BLK_DEV_HD is not set
@@ -363,13 +368,13 @@ CONFIG_XFRM=y
 # 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
+# CONFIG_NET_CLS_ROUTE is not set
 
 #
 # Network testing
@@ -592,6 +597,9 @@ CONFIG_FS_MBCACHE=y
 CONFIG_REISERFS_FS=m
 # CONFIG_REISERFS_CHECK is not set
 # CONFIG_REISERFS_PROC_INFO is not set
+CONFIG_REISERFS_FS_XATTR=y
+CONFIG_REISERFS_FS_POSIX_ACL=y
+CONFIG_REISERFS_FS_SECURITY=y
 # CONFIG_JFS_FS is not set
 CONFIG_FS_POSIX_ACL=y
 # CONFIG_XFS_FS is not set
@@ -665,7 +673,6 @@ CONFIG_SMB_FS=m
 # CONFIG_CIFS is not set
 # CONFIG_NCP_FS is not set
 # CONFIG_CODA_FS is not set
-# CONFIG_INTERMEZZO_FS is not set
 # CONFIG_AFS_FS is not set
 
 #
@@ -702,6 +709,7 @@ CONFIG_NLS_DEFAULT="iso8859-1"
 # CONFIG_NLS_ISO8859_8 is not set
 # CONFIG_NLS_CODEPAGE_1250 is not set
 # CONFIG_NLS_CODEPAGE_1251 is not set
+# CONFIG_NLS_ASCII is not set
 # CONFIG_NLS_ISO8859_1 is not set
 # CONFIG_NLS_ISO8859_2 is not set
 # CONFIG_NLS_ISO8859_3 is not set
@@ -750,11 +758,14 @@ CONFIG_CRYPTO_AES=y
 # CONFIG_CRYPTO_ARC4 is not set
 CONFIG_CRYPTO_DEFLATE=y
 CONFIG_CRYPTO_MICHAEL_MIC=y
+CONFIG_CRYPTO_CRC32C=m
 # CONFIG_CRYPTO_TEST is not set
 
 #
 # Library routines
 #
+CONFIG_CRC16=m
 CONFIG_CRC32=y
+CONFIG_LIBCRC32C=m
 CONFIG_ZLIB_INFLATE=y
 CONFIG_ZLIB_DEFLATE=y
diff --git a/arch/mips/configs/ddb5476_defconfig b/arch/mips/configs/ddb5476_defconfig
index 5f74857ae..07803efb6 100644
--- a/arch/mips/configs/ddb5476_defconfig
+++ b/arch/mips/configs/ddb5476_defconfig
@@ -28,6 +28,7 @@ CONFIG_LOG_BUF_SHIFT=14
 # CONFIG_IKCONFIG is not set
 CONFIG_EMBEDDED=y
 CONFIG_KALLSYMS=y
+# CONFIG_KALLSYMS_EXTRA_PASS is not set
 CONFIG_FUTEX=y
 CONFIG_EPOLL=y
 CONFIG_IOSCHED_NOOP=y
@@ -105,6 +106,7 @@ CONFIG_CPU_R5432=y
 # CONFIG_CPU_RM9000 is not set
 # CONFIG_CPU_SB1 is not set
 CONFIG_PAGE_SIZE_4KB=y
+# CONFIG_PAGE_SIZE_8KB is not set
 # CONFIG_PAGE_SIZE_16KB is not set
 # CONFIG_PAGE_SIZE_64KB is not set
 # CONFIG_CPU_ADVANCED is not set
@@ -117,6 +119,7 @@ CONFIG_CPU_HAS_SYNC=y
 #
 # Bus options (PCI, PCMCIA, EISA, ISA, TC)
 #
+CONFIG_HW_HAS_PCI=y
 CONFIG_PCI=y
 CONFIG_PCI_LEGACY_PROC=y
 CONFIG_PCI_NAMES=y
@@ -137,6 +140,7 @@ CONFIG_TRAD_SIGNALS=y
 #
 # Generic Driver Options
 #
+CONFIG_PREVENT_FIRMWARE_BUILD=y
 
 #
 # Memory Technology Devices (MTD)
@@ -164,7 +168,7 @@ CONFIG_TRAD_SIGNALS=y
 # CONFIG_BLK_DEV_UMEM is not set
 # CONFIG_BLK_DEV_LOOP is not set
 # CONFIG_BLK_DEV_NBD is not set
-# CONFIG_BLK_DEV_CARMEL is not set
+# CONFIG_BLK_DEV_SX8 is not set
 # CONFIG_BLK_DEV_RAM is not set
 # CONFIG_LBD is not set
 
@@ -177,9 +181,9 @@ CONFIG_BLK_DEV_IDE=y
 #
 # Please see Documentation/ide.txt for help/info on IDE drives
 #
+# CONFIG_BLK_DEV_IDE_SATA is not set
 CONFIG_BLK_DEV_IDEDISK=y
 # CONFIG_IDEDISK_MULTI_MODE is not set
-# CONFIG_IDEDISK_STROKE is not set
 # CONFIG_BLK_DEV_IDECD is not set
 # CONFIG_BLK_DEV_IDETAPE is not set
 # CONFIG_BLK_DEV_IDEFLOPPY is not set
@@ -191,6 +195,7 @@ CONFIG_IDE_TASKFILE_IO=y
 #
 CONFIG_IDE_GENERIC=y
 # CONFIG_BLK_DEV_IDEPCI is not set
+# CONFIG_IDE_ARM is not set
 # CONFIG_IDE_CHIPSETS is not set
 # CONFIG_BLK_DEV_IDEDMA is not set
 # CONFIG_IDEDMA_AUTO is not set
@@ -214,7 +219,6 @@ CONFIG_IDE_GENERIC=y
 #
 # Fusion MPT device support
 #
-# CONFIG_FUSION is not set
 
 #
 # IEEE 1394 (FireWire) support
@@ -274,13 +278,13 @@ CONFIG_XFRM=y
 # 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
+# CONFIG_NET_CLS_ROUTE is not set
 
 #
 # Network testing
@@ -363,7 +367,6 @@ CONFIG_NET_ETHERNET=y
 # CONFIG_HIPPI is not set
 # CONFIG_PPP is not set
 # CONFIG_SLIP is not set
-# CONFIG_RCPCI is not set
 # CONFIG_SHAPER is not set
 # CONFIG_NETCONSOLE is not set
 
@@ -485,8 +488,10 @@ CONFIG_LEGACY_PTY_COUNT=256
 #
 # Graphics support
 #
+# CONFIG_FB_CIRRUS is not set
 # CONFIG_FB_PM2 is not set
 # CONFIG_FB_CYBER2000 is not set
+# CONFIG_FB_ASILIANT is not set
 # CONFIG_FB_IMSTT is not set
 # CONFIG_FB_RIVA is not set
 # CONFIG_FB_MATROX is not set
@@ -606,7 +611,6 @@ CONFIG_SUNRPC=y
 # CONFIG_CIFS is not set
 # CONFIG_NCP_FS is not set
 # CONFIG_CODA_FS is not set
-# CONFIG_INTERMEZZO_FS is not set
 # CONFIG_AFS_FS is not set
 
 #
@@ -640,4 +644,6 @@ CONFIG_CMDLINE="ip=any"
 #
 # Library routines
 #
+CONFIG_CRC16=y
 # CONFIG_CRC32 is not set
+# CONFIG_LIBCRC32C is not set
diff --git a/arch/mips/configs/ddb5477_defconfig b/arch/mips/configs/ddb5477_defconfig
index 13222c363..c09e58c63 100644
--- a/arch/mips/configs/ddb5477_defconfig
+++ b/arch/mips/configs/ddb5477_defconfig
@@ -28,6 +28,7 @@ CONFIG_LOG_BUF_SHIFT=14
 # CONFIG_IKCONFIG is not set
 CONFIG_EMBEDDED=y
 CONFIG_KALLSYMS=y
+# CONFIG_KALLSYMS_EXTRA_PASS is not set
 CONFIG_FUTEX=y
 CONFIG_EPOLL=y
 CONFIG_IOSCHED_NOOP=y
@@ -80,7 +81,6 @@ CONFIG_DMA_NONCOHERENT=y
 CONFIG_I8259=y
 CONFIG_CPU_LITTLE_ENDIAN=y
 CONFIG_IRQ_CPU=y
-CONFIG_DUMMY_KEYB=y
 CONFIG_DDB5XXX_COMMON=y
 CONFIG_MIPS_L1_CACHE_SHIFT=5
 # CONFIG_FB is not set
@@ -106,6 +106,7 @@ CONFIG_CPU_R5432=y
 # CONFIG_CPU_RM9000 is not set
 # CONFIG_CPU_SB1 is not set
 CONFIG_PAGE_SIZE_4KB=y
+# CONFIG_PAGE_SIZE_8KB is not set
 # CONFIG_PAGE_SIZE_16KB is not set
 # CONFIG_PAGE_SIZE_64KB is not set
 # CONFIG_CPU_ADVANCED is not set
@@ -118,6 +119,7 @@ CONFIG_CPU_HAS_SYNC=y
 #
 # Bus options (PCI, PCMCIA, EISA, ISA, TC)
 #
+CONFIG_HW_HAS_PCI=y
 CONFIG_PCI=y
 CONFIG_PCI_LEGACY_PROC=y
 CONFIG_PCI_NAMES=y
@@ -137,6 +139,7 @@ CONFIG_TRAD_SIGNALS=y
 #
 # Generic Driver Options
 #
+CONFIG_PREVENT_FIRMWARE_BUILD=y
 
 #
 # Memory Technology Devices (MTD)
@@ -162,7 +165,7 @@ CONFIG_TRAD_SIGNALS=y
 # CONFIG_BLK_DEV_UMEM is not set
 # CONFIG_BLK_DEV_LOOP is not set
 # CONFIG_BLK_DEV_NBD is not set
-# CONFIG_BLK_DEV_CARMEL is not set
+# CONFIG_BLK_DEV_SX8 is not set
 # CONFIG_BLK_DEV_RAM is not set
 # CONFIG_LBD is not set
 
@@ -184,7 +187,6 @@ CONFIG_TRAD_SIGNALS=y
 #
 # Fusion MPT device support
 #
-# CONFIG_FUSION is not set
 
 #
 # IEEE 1394 (FireWire) support
@@ -244,13 +246,13 @@ CONFIG_XFRM=y
 # 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
+# CONFIG_NET_CLS_ROUTE is not set
 
 #
 # Network testing
@@ -306,6 +308,7 @@ CONFIG_PCNET32=y
 # CONFIG_SUNDANCE is not set
 # CONFIG_TLAN is not set
 # CONFIG_VIA_RHINE is not set
+# CONFIG_VIA_VELOCITY is not set
 # CONFIG_LAN_SAA9730 is not set
 
 #
@@ -345,7 +348,6 @@ CONFIG_PCNET32=y
 # CONFIG_HIPPI is not set
 # CONFIG_PPP is not set
 # CONFIG_SLIP is not set
-# CONFIG_RCPCI is not set
 # CONFIG_SHAPER is not set
 # CONFIG_NETCONSOLE is not set
 
@@ -567,7 +569,6 @@ CONFIG_SUNRPC=y
 # CONFIG_CIFS is not set
 # CONFIG_NCP_FS is not set
 # CONFIG_CODA_FS is not set
-# CONFIG_INTERMEZZO_FS is not set
 # CONFIG_AFS_FS is not set
 
 #
@@ -601,4 +602,6 @@ CONFIG_CMDLINE="ip=any"
 #
 # Library routines
 #
+CONFIG_CRC16=y
 CONFIG_CRC32=y
+# CONFIG_LIBCRC32C is not set
diff --git a/arch/mips/configs/decstation_defconfig b/arch/mips/configs/decstation_defconfig
index 9f41a3d0f..e7dc8efb0 100644
--- a/arch/mips/configs/decstation_defconfig
+++ b/arch/mips/configs/decstation_defconfig
@@ -28,6 +28,7 @@ CONFIG_LOG_BUF_SHIFT=14
 # CONFIG_IKCONFIG is not set
 CONFIG_EMBEDDED=y
 CONFIG_KALLSYMS=y
+# CONFIG_KALLSYMS_EXTRA_PASS is not set
 CONFIG_FUTEX=y
 CONFIG_EPOLL=y
 CONFIG_IOSCHED_NOOP=y
@@ -109,6 +110,7 @@ CONFIG_CPU_R3000=y
 # CONFIG_CPU_RM9000 is not set
 # CONFIG_CPU_SB1 is not set
 CONFIG_PAGE_SIZE_4KB=y
+# CONFIG_PAGE_SIZE_8KB is not set
 # CONFIG_PAGE_SIZE_16KB is not set
 # CONFIG_PAGE_SIZE_64KB is not set
 # CONFIG_CPU_ADVANCED is not set
@@ -136,6 +138,7 @@ CONFIG_TRAD_SIGNALS=y
 #
 # Generic Driver Options
 #
+CONFIG_PREVENT_FIRMWARE_BUILD=y
 
 #
 # Memory Technology Devices (MTD)
@@ -184,7 +187,6 @@ CONFIG_BLK_DEV_SD=y
 # Some SCSI devices (e.g. CD jukebox) support multiple LUNs
 #
 # CONFIG_SCSI_MULTI_LUN is not set
-# CONFIG_SCSI_REPORT_LUNS is not set
 CONFIG_SCSI_CONSTANTS=y
 # CONFIG_SCSI_LOGGING is not set
 
@@ -270,13 +272,13 @@ CONFIG_XFRM=y
 # 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
+# CONFIG_NET_CLS_ROUTE is not set
 
 #
 # Network testing
@@ -537,7 +539,6 @@ CONFIG_RAMFS=y
 # CONFIG_CIFS is not set
 # CONFIG_NCP_FS is not set
 # CONFIG_CODA_FS is not set
-# CONFIG_INTERMEZZO_FS is not set
 # CONFIG_AFS_FS is not set
 
 #
@@ -555,7 +556,6 @@ CONFIG_MSDOS_PARTITION=y
 # CONFIG_SOLARIS_X86_PARTITION is not set
 # CONFIG_UNIXWARE_DISKLABEL is not set
 # CONFIG_LDM_PARTITION is not set
-# CONFIG_NEC98_PARTITION is not set
 # CONFIG_SGI_PARTITION is not set
 CONFIG_ULTRIX_PARTITION=y
 # CONFIG_SUN_PARTITION is not set
@@ -586,4 +586,6 @@ CONFIG_CMDLINE=""
 #
 # Library routines
 #
+CONFIG_CRC16=m
 CONFIG_CRC32=y
+CONFIG_LIBCRC32C=m
diff --git a/arch/mips/configs/e55_defconfig b/arch/mips/configs/e55_defconfig
index b0154fa60..b771f906f 100644
--- a/arch/mips/configs/e55_defconfig
+++ b/arch/mips/configs/e55_defconfig
@@ -28,6 +28,7 @@ CONFIG_LOG_BUF_SHIFT=14
 # CONFIG_IKCONFIG is not set
 CONFIG_EMBEDDED=y
 CONFIG_KALLSYMS=y
+# CONFIG_KALLSYMS_EXTRA_PASS is not set
 CONFIG_FUTEX=y
 CONFIG_EPOLL=y
 CONFIG_IOSCHED_NOOP=y
@@ -54,7 +55,6 @@ CONFIG_KMOD=y
 CONFIG_MACH_VR41XX=y
 CONFIG_CASIO_E55=y
 # CONFIG_IBM_WORKPAD is not set
-# CONFIG_NEC_EAGLE is not set
 # CONFIG_TANBAC_TB0226 is not set
 # CONFIG_TANBAC_TB0229 is not set
 # CONFIG_VICTOR_MPC30X is not set
@@ -91,7 +91,6 @@ CONFIG_HAVE_DEC_LOCK=y
 CONFIG_DMA_NONCOHERENT=y
 CONFIG_CPU_LITTLE_ENDIAN=y
 CONFIG_IRQ_CPU=y
-CONFIG_DUMMY_KEYB=y
 CONFIG_MIPS_L1_CACHE_SHIFT=5
 # CONFIG_FB is not set
 
@@ -116,6 +115,7 @@ CONFIG_CPU_VR41XX=y
 # CONFIG_CPU_RM9000 is not set
 # CONFIG_CPU_SB1 is not set
 CONFIG_PAGE_SIZE_4KB=y
+# CONFIG_PAGE_SIZE_8KB is not set
 # CONFIG_PAGE_SIZE_16KB is not set
 # CONFIG_PAGE_SIZE_64KB is not set
 # CONFIG_CPU_ADVANCED is not set
@@ -143,6 +143,7 @@ CONFIG_TRAD_SIGNALS=y
 #
 # Generic Driver Options
 #
+CONFIG_PREVENT_FIRMWARE_BUILD=y
 
 #
 # Memory Technology Devices (MTD)
@@ -178,9 +179,9 @@ CONFIG_BLK_DEV_IDE=y
 #
 # Please see Documentation/ide.txt for help/info on IDE drives
 #
+# CONFIG_BLK_DEV_IDE_SATA is not set
 CONFIG_BLK_DEV_IDEDISK=y
 # CONFIG_IDEDISK_MULTI_MODE is not set
-# CONFIG_IDEDISK_STROKE is not set
 # CONFIG_BLK_DEV_IDECD is not set
 # CONFIG_BLK_DEV_IDETAPE is not set
 # CONFIG_BLK_DEV_IDEFLOPPY is not set
@@ -191,6 +192,7 @@ CONFIG_IDE_TASKFILE_IO=y
 # IDE chipset support/bugfixes
 #
 CONFIG_IDE_GENERIC=y
+# CONFIG_IDE_ARM is not set
 # CONFIG_IDE_CHIPSETS is not set
 # CONFIG_BLK_DEV_IDEDMA is not set
 # CONFIG_IDEDMA_AUTO is not set
@@ -270,13 +272,13 @@ CONFIG_XFRM=y
 # 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
+# CONFIG_NET_CLS_ROUTE is not set
 
 #
 # Network testing
@@ -570,7 +572,6 @@ CONFIG_SUNRPC=y
 # CONFIG_CIFS is not set
 # CONFIG_NCP_FS is not set
 # CONFIG_CODA_FS is not set
-# CONFIG_INTERMEZZO_FS is not set
 # CONFIG_AFS_FS is not set
 
 #
@@ -604,4 +605,6 @@ CONFIG_CMDLINE=""
 #
 # Library routines
 #
+CONFIG_CRC16=m
 # CONFIG_CRC32 is not set
+CONFIG_LIBCRC32C=m
diff --git a/arch/mips/configs/ev64120_defconfig b/arch/mips/configs/ev64120_defconfig
index 2cbeb69b9..541629004 100644
--- a/arch/mips/configs/ev64120_defconfig
+++ b/arch/mips/configs/ev64120_defconfig
@@ -28,6 +28,7 @@ CONFIG_LOG_BUF_SHIFT=14
 # CONFIG_IKCONFIG is not set
 CONFIG_EMBEDDED=y
 CONFIG_KALLSYMS=y
+# CONFIG_KALLSYMS_EXTRA_PASS is not set
 CONFIG_FUTEX=y
 CONFIG_EPOLL=y
 CONFIG_IOSCHED_NOOP=y
@@ -111,6 +112,7 @@ CONFIG_CPU_R5000=y
 # CONFIG_CPU_RM9000 is not set
 # CONFIG_CPU_SB1 is not set
 CONFIG_PAGE_SIZE_4KB=y
+# CONFIG_PAGE_SIZE_8KB is not set
 # CONFIG_PAGE_SIZE_16KB is not set
 # CONFIG_PAGE_SIZE_64KB is not set
 # CONFIG_64BIT_PHYS_ADDR is not set
@@ -124,6 +126,7 @@ CONFIG_CPU_HAS_SYNC=y
 #
 # Bus options (PCI, PCMCIA, EISA, ISA, TC)
 #
+CONFIG_HW_HAS_PCI=y
 CONFIG_PCI=y
 CONFIG_PCI_LEGACY_PROC=y
 CONFIG_PCI_NAMES=y
@@ -144,6 +147,7 @@ CONFIG_TRAD_SIGNALS=y
 #
 # Generic Driver Options
 #
+CONFIG_PREVENT_FIRMWARE_BUILD=y
 
 #
 # Memory Technology Devices (MTD)
@@ -169,7 +173,7 @@ CONFIG_TRAD_SIGNALS=y
 # CONFIG_BLK_DEV_UMEM is not set
 # CONFIG_BLK_DEV_LOOP is not set
 # CONFIG_BLK_DEV_NBD is not set
-# CONFIG_BLK_DEV_CARMEL is not set
+# CONFIG_BLK_DEV_SX8 is not set
 # CONFIG_BLK_DEV_RAM is not set
 # CONFIG_LBD is not set
 
@@ -191,7 +195,6 @@ CONFIG_TRAD_SIGNALS=y
 #
 # Fusion MPT device support
 #
-# CONFIG_FUSION is not set
 
 #
 # IEEE 1394 (FireWire) support
@@ -250,13 +253,13 @@ CONFIG_XFRM=y
 # 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
+# CONFIG_NET_CLS_ROUTE is not set
 
 #
 # Network testing
@@ -339,7 +342,6 @@ CONFIG_PPP_ASYNC=y
 # CONFIG_PPP_BSDCOMP is not set
 # CONFIG_PPPOE is not set
 # CONFIG_SLIP is not set
-# CONFIG_RCPCI is not set
 # CONFIG_SHAPER is not set
 # CONFIG_NETCONSOLE is not set
 
@@ -559,7 +561,6 @@ CONFIG_SUNRPC=y
 # CONFIG_CIFS is not set
 # CONFIG_NCP_FS is not set
 # CONFIG_CODA_FS is not set
-# CONFIG_INTERMEZZO_FS is not set
 # CONFIG_AFS_FS is not set
 
 #
@@ -593,4 +594,6 @@ CONFIG_CMDLINE="console=ttyS0,115200 root=/dev/nfs rw nfsroot=192.168.1.1:/mnt/d
 #
 # Library routines
 #
+CONFIG_CRC16=y
 # CONFIG_CRC32 is not set
+CONFIG_LIBCRC32C=m
diff --git a/arch/mips/configs/ev96100_defconfig b/arch/mips/configs/ev96100_defconfig
index 4d6bd5352..eb13fd96d 100644
--- a/arch/mips/configs/ev96100_defconfig
+++ b/arch/mips/configs/ev96100_defconfig
@@ -28,6 +28,7 @@ CONFIG_LOG_BUF_SHIFT=14
 # CONFIG_IKCONFIG is not set
 CONFIG_EMBEDDED=y
 CONFIG_KALLSYMS=y
+# CONFIG_KALLSYMS_EXTRA_PASS is not set
 CONFIG_FUTEX=y
 CONFIG_EPOLL=y
 CONFIG_IOSCHED_NOOP=y
@@ -110,6 +111,7 @@ CONFIG_CPU_RM7000=y
 # CONFIG_CPU_RM9000 is not set
 # CONFIG_CPU_SB1 is not set
 CONFIG_PAGE_SIZE_4KB=y
+# CONFIG_PAGE_SIZE_8KB is not set
 # CONFIG_PAGE_SIZE_16KB is not set
 # CONFIG_PAGE_SIZE_64KB is not set
 CONFIG_BOARD_SCACHE=y
@@ -126,6 +128,7 @@ CONFIG_CPU_HAS_SYNC=y
 #
 # Bus options (PCI, PCMCIA, EISA, ISA, TC)
 #
+CONFIG_HW_HAS_PCI=y
 # CONFIG_PCI is not set
 CONFIG_MMU=y
 
@@ -144,6 +147,7 @@ CONFIG_TRAD_SIGNALS=y
 #
 # Generic Driver Options
 #
+CONFIG_PREVENT_FIRMWARE_BUILD=y
 
 #
 # Memory Technology Devices (MTD)
@@ -243,13 +247,13 @@ CONFIG_XFRM=y
 # 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
+# CONFIG_NET_CLS_ROUTE is not set
 
 #
 # Network testing
@@ -514,7 +518,6 @@ CONFIG_SUNRPC=y
 # CONFIG_CIFS is not set
 # CONFIG_NCP_FS is not set
 # CONFIG_CODA_FS is not set
-# CONFIG_INTERMEZZO_FS is not set
 # CONFIG_AFS_FS is not set
 
 #
@@ -548,4 +551,6 @@ CONFIG_CMDLINE=""
 #
 # Library routines
 #
+CONFIG_CRC16=m
 # CONFIG_CRC32 is not set
+CONFIG_LIBCRC32C=m
diff --git a/arch/mips/configs/ip22_defconfig b/arch/mips/configs/ip22_defconfig
index bbd6215cc..8bc7792d6 100644
--- a/arch/mips/configs/ip22_defconfig
+++ b/arch/mips/configs/ip22_defconfig
@@ -29,6 +29,7 @@ CONFIG_IKCONFIG=y
 CONFIG_IKCONFIG_PROC=y
 CONFIG_EMBEDDED=y
 CONFIG_KALLSYMS=y
+# CONFIG_KALLSYMS_EXTRA_PASS is not set
 CONFIG_FUTEX=y
 CONFIG_EPOLL=y
 CONFIG_IOSCHED_NOOP=y
@@ -114,6 +115,7 @@ CONFIG_CPU_R5000=y
 # CONFIG_CPU_RM9000 is not set
 # CONFIG_CPU_SB1 is not set
 CONFIG_PAGE_SIZE_4KB=y
+# CONFIG_PAGE_SIZE_8KB is not set
 # CONFIG_PAGE_SIZE_16KB is not set
 # CONFIG_PAGE_SIZE_64KB is not set
 CONFIG_BOARD_SCACHE=y
@@ -147,6 +149,7 @@ CONFIG_BINFMT_IRIX=y
 #
 # Generic Driver Options
 #
+CONFIG_PREVENT_FIRMWARE_BUILD=y
 
 #
 # Memory Technology Devices (MTD)
@@ -196,7 +199,6 @@ CONFIG_BLK_DEV_SR=y
 # Some SCSI devices (e.g. CD jukebox) support multiple LUNs
 #
 # CONFIG_SCSI_MULTI_LUN is not set
-# CONFIG_SCSI_REPORT_LUNS is not set
 CONFIG_SCSI_CONSTANTS=y
 # CONFIG_SCSI_LOGGING is not set
 
@@ -362,6 +364,8 @@ CONFIG_IP_NF_COMPAT_IPCHAINS=m
 CONFIG_IP_NF_COMPAT_IPFWADM=m
 CONFIG_IP_NF_TARGET_NOTRACK=m
 CONFIG_IP_NF_RAW=m
+CONFIG_IP_NF_MATCH_ADDRTYPE=m
+CONFIG_IP_NF_MATCH_REALM=m
 
 #
 # IPv6: Netfilter Configuration
@@ -410,7 +414,6 @@ CONFIG_SCTP_HMAC_MD5=y
 CONFIG_NET_DIVERT=y
 # CONFIG_ECONET is not set
 # CONFIG_WAN_ROUTER is not set
-# CONFIG_NET_FASTROUTE is not set
 # CONFIG_NET_HW_FLOWCONTROL is not set
 
 #
@@ -438,8 +441,11 @@ CONFIG_NET_CLS_ROUTE4=m
 CONFIG_NET_CLS_ROUTE=y
 CONFIG_NET_CLS_FW=m
 CONFIG_NET_CLS_U32=m
+# CONFIG_CLS_U32_PERF is not set
+# CONFIG_NET_CLS_IND is not set
 CONFIG_NET_CLS_RSVP=m
 CONFIG_NET_CLS_RSVP6=m
+# CONFIG_NET_CLS_ACT is not set
 CONFIG_NET_CLS_POLICE=y
 
 #
@@ -583,7 +589,7 @@ CONFIG_WATCHDOG=y
 CONFIG_INDYDOG=m
 # CONFIG_RTC is not set
 # CONFIG_GEN_RTC is not set
-CONFIG_SGI_DS1286=y
+CONFIG_SGI_DS1286=m
 # CONFIG_DTLK is not set
 # CONFIG_R3964 is not set
 # CONFIG_APPLICOM is not set
@@ -696,6 +702,8 @@ CONFIG_UDF_FS=m
 CONFIG_FAT_FS=m
 CONFIG_MSDOS_FS=m
 CONFIG_VFAT_FS=m
+CONFIG_FAT_DEFAULT_CODEPAGE=437
+CONFIG_FAT_DEFAULT_IOCHARSET="iso8859-1"
 # CONFIG_NTFS_FS is not set
 
 #
@@ -750,7 +758,6 @@ CONFIG_RPCSEC_GSS_KRB5=m
 # CONFIG_CIFS is not set
 # CONFIG_NCP_FS is not set
 # CONFIG_CODA_FS is not set
-# CONFIG_INTERMEZZO_FS is not set
 # CONFIG_AFS_FS is not set
 
 #
@@ -768,7 +775,6 @@ CONFIG_MSDOS_PARTITION=y
 # CONFIG_SOLARIS_X86_PARTITION is not set
 # CONFIG_UNIXWARE_DISKLABEL is not set
 # CONFIG_LDM_PARTITION is not set
-# CONFIG_NEC98_PARTITION is not set
 CONFIG_SGI_PARTITION=y
 # CONFIG_ULTRIX_PARTITION is not set
 # CONFIG_SUN_PARTITION is not set
@@ -802,6 +808,7 @@ CONFIG_NLS_CODEPAGE_874=m
 CONFIG_NLS_ISO8859_8=m
 CONFIG_NLS_CODEPAGE_1250=m
 CONFIG_NLS_CODEPAGE_1251=m
+CONFIG_NLS_ASCII=m
 CONFIG_NLS_ISO8859_1=m
 CONFIG_NLS_ISO8859_2=m
 CONFIG_NLS_ISO8859_3=m
@@ -850,11 +857,14 @@ CONFIG_CRYPTO_CAST6=m
 CONFIG_CRYPTO_ARC4=m
 CONFIG_CRYPTO_DEFLATE=y
 CONFIG_CRYPTO_MICHAEL_MIC=m
+CONFIG_CRYPTO_CRC32C=m
 # CONFIG_CRYPTO_TEST is not set
 
 #
 # Library routines
 #
+CONFIG_CRC16=m
 # CONFIG_CRC32 is not set
+CONFIG_LIBCRC32C=m
 CONFIG_ZLIB_INFLATE=y
 CONFIG_ZLIB_DEFLATE=y
diff --git a/arch/mips/configs/ip27_defconfig b/arch/mips/configs/ip27_defconfig
index c7cff248c..2962c1db7 100644
--- a/arch/mips/configs/ip27_defconfig
+++ b/arch/mips/configs/ip27_defconfig
@@ -27,6 +27,7 @@ CONFIG_IKCONFIG=y
 CONFIG_IKCONFIG_PROC=y
 CONFIG_EMBEDDED=y
 CONFIG_KALLSYMS=y
+# CONFIG_KALLSYMS_EXTRA_PASS is not set
 CONFIG_FUTEX=y
 CONFIG_EPOLL=y
 CONFIG_IOSCHED_NOOP=y
@@ -113,6 +114,7 @@ CONFIG_CPU_R10000=y
 # CONFIG_CPU_RM9000 is not set
 # CONFIG_CPU_SB1 is not set
 CONFIG_PAGE_SIZE_4KB=y
+# CONFIG_PAGE_SIZE_8KB is not set
 # CONFIG_PAGE_SIZE_16KB is not set
 # CONFIG_PAGE_SIZE_64KB is not set
 CONFIG_CPU_HAS_PREFETCH=y
@@ -128,6 +130,7 @@ CONFIG_NR_CPUS=64
 #
 # Bus options (PCI, PCMCIA, EISA, ISA, TC)
 #
+CONFIG_HW_HAS_PCI=y
 CONFIG_PCI=y
 CONFIG_PCI_LEGACY_PROC=y
 CONFIG_PCI_NAMES=y
@@ -151,6 +154,7 @@ CONFIG_BINFMT_ELF32=y
 #
 # Generic Driver Options
 #
+CONFIG_PREVENT_FIRMWARE_BUILD=y
 
 #
 # Memory Technology Devices (MTD)
@@ -176,7 +180,7 @@ CONFIG_BINFMT_ELF32=y
 # CONFIG_BLK_DEV_UMEM is not set
 # CONFIG_BLK_DEV_LOOP is not set
 # CONFIG_BLK_DEV_NBD is not set
-# CONFIG_BLK_DEV_CARMEL is not set
+# CONFIG_BLK_DEV_SX8 is not set
 # CONFIG_BLK_DEV_RAM is not set
 
 #
@@ -203,7 +207,6 @@ CONFIG_CHR_DEV_ST=y
 # Some SCSI devices (e.g. CD jukebox) support multiple LUNs
 #
 # CONFIG_SCSI_MULTI_LUN is not set
-# CONFIG_SCSI_REPORT_LUNS is not set
 CONFIG_SCSI_CONSTANTS=y
 CONFIG_SCSI_LOGGING=y
 
@@ -217,16 +220,15 @@ CONFIG_SCSI_SPI_ATTRS=y
 # SCSI low-level drivers
 #
 # CONFIG_BLK_DEV_3W_XXXX_RAID is not set
+# CONFIG_SCSI_3W_9XXX is not set
 # CONFIG_SCSI_ACARD is not set
 # CONFIG_SCSI_AACRAID is not set
 # CONFIG_SCSI_AIC7XXX is not set
 # CONFIG_SCSI_AIC7XXX_OLD is not set
 # CONFIG_SCSI_AIC79XX is not set
-# CONFIG_SCSI_ADVANSYS is not set
 # CONFIG_SCSI_MEGARAID is not set
 # CONFIG_SCSI_SATA is not set
 # CONFIG_SCSI_BUSLOGIC is not set
-# CONFIG_SCSI_CPQFCTS is not set
 # CONFIG_SCSI_DMX3191D is not set
 # CONFIG_SCSI_EATA is not set
 # CONFIG_SCSI_EATA_PIO is not set
@@ -235,6 +237,7 @@ CONFIG_SCSI_SPI_ATTRS=y
 # CONFIG_SCSI_IPS is not set
 # CONFIG_SCSI_INIA100 is not set
 # CONFIG_SCSI_SYM53C8XX_2 is not set
+# CONFIG_SCSI_IPR is not set
 CONFIG_SCSI_QLOGIC_ISP=y
 # CONFIG_SCSI_QLOGIC_FC is not set
 # CONFIG_SCSI_QLOGIC_1280 is not set
@@ -267,6 +270,7 @@ CONFIG_SCSI_QLA2XXX=y
 #
 # I2O device support
 #
+# CONFIG_I2O is not set
 
 #
 # Networking support
@@ -317,7 +321,6 @@ CONFIG_XFRM=y
 # 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
 
 #
@@ -336,6 +339,7 @@ CONFIG_NET_SCH_TBF=y
 CONFIG_NET_SCH_GRED=y
 CONFIG_NET_SCH_DSMARK=y
 CONFIG_NET_SCH_DELAY=y
+# CONFIG_NET_SCH_INGRESS is not set
 CONFIG_NET_QOS=y
 CONFIG_NET_ESTIMATOR=y
 CONFIG_NET_CLS=y
@@ -344,8 +348,11 @@ CONFIG_NET_CLS_ROUTE4=y
 CONFIG_NET_CLS_ROUTE=y
 CONFIG_NET_CLS_FW=y
 CONFIG_NET_CLS_U32=y
+# CONFIG_CLS_U32_PERF is not set
+# CONFIG_NET_CLS_IND is not set
 CONFIG_NET_CLS_RSVP=y
 CONFIG_NET_CLS_RSVP6=y
+# CONFIG_NET_CLS_ACT is not set
 CONFIG_NET_CLS_POLICE=y
 
 #
@@ -638,7 +645,6 @@ CONFIG_RPCSEC_GSS_KRB5=y
 # CONFIG_CIFS is not set
 # CONFIG_NCP_FS is not set
 # CONFIG_CODA_FS is not set
-# CONFIG_INTERMEZZO_FS is not set
 # CONFIG_AFS_FS is not set
 
 #
@@ -656,7 +662,6 @@ CONFIG_MSDOS_PARTITION=y
 # CONFIG_SOLARIS_X86_PARTITION is not set
 # CONFIG_UNIXWARE_DISKLABEL is not set
 # CONFIG_LDM_PARTITION is not set
-# CONFIG_NEC98_PARTITION is not set
 CONFIG_SGI_PARTITION=y
 # CONFIG_ULTRIX_PARTITION is not set
 # CONFIG_SUN_PARTITION is not set
@@ -700,11 +705,14 @@ CONFIG_CRYPTO_CAST6=y
 CONFIG_CRYPTO_ARC4=y
 CONFIG_CRYPTO_DEFLATE=y
 CONFIG_CRYPTO_MICHAEL_MIC=y
+CONFIG_CRYPTO_CRC32C=m
 # CONFIG_CRYPTO_TEST is not set
 
 #
 # Library routines
 #
+CONFIG_CRC16=m
 CONFIG_CRC32=y
+CONFIG_LIBCRC32C=m
 CONFIG_ZLIB_INFLATE=y
 CONFIG_ZLIB_DEFLATE=y
diff --git a/arch/mips/configs/ip32_defconfig b/arch/mips/configs/ip32_defconfig
index 7dcbf62c9..7cfe80b94 100644
--- a/arch/mips/configs/ip32_defconfig
+++ b/arch/mips/configs/ip32_defconfig
@@ -20,6 +20,7 @@ CONFIG_SWAP=y
 CONFIG_SYSVIPC=y
 # CONFIG_POSIX_MQUEUE is not set
 CONFIG_BSD_PROCESS_ACCT=y
+# CONFIG_BSD_PROCESS_ACCT_V3 is not set
 CONFIG_SYSCTL=y
 # CONFIG_AUDIT is not set
 CONFIG_LOG_BUF_SHIFT=14
@@ -27,6 +28,7 @@ CONFIG_LOG_BUF_SHIFT=14
 # CONFIG_IKCONFIG is not set
 CONFIG_EMBEDDED=y
 CONFIG_KALLSYMS=y
+# CONFIG_KALLSYMS_EXTRA_PASS is not set
 CONFIG_FUTEX=y
 CONFIG_EPOLL=y
 CONFIG_IOSCHED_NOOP=y
@@ -102,6 +104,7 @@ CONFIG_CPU_R5000=y
 # CONFIG_CPU_RM9000 is not set
 # CONFIG_CPU_SB1 is not set
 CONFIG_PAGE_SIZE_4KB=y
+# CONFIG_PAGE_SIZE_8KB is not set
 # CONFIG_PAGE_SIZE_16KB is not set
 # CONFIG_PAGE_SIZE_64KB is not set
 CONFIG_BOARD_SCACHE=y
@@ -116,6 +119,7 @@ CONFIG_CPU_HAS_SYNC=y
 #
 # Bus options (PCI, PCMCIA, EISA, ISA, TC)
 #
+CONFIG_HW_HAS_PCI=y
 CONFIG_PCI=y
 CONFIG_PCI_LEGACY_PROC=y
 CONFIG_PCI_NAMES=y
@@ -139,6 +143,7 @@ CONFIG_BINFMT_ELF32=y
 #
 # Generic Driver Options
 #
+CONFIG_PREVENT_FIRMWARE_BUILD=y
 
 #
 # Memory Technology Devices (MTD)
@@ -165,7 +170,7 @@ CONFIG_BINFMT_ELF32=y
 CONFIG_BLK_DEV_LOOP=y
 # CONFIG_BLK_DEV_CRYPTOLOOP is not set
 # CONFIG_BLK_DEV_NBD is not set
-# CONFIG_BLK_DEV_CARMEL is not set
+# CONFIG_BLK_DEV_SX8 is not set
 # CONFIG_BLK_DEV_RAM is not set
 
 #
@@ -193,7 +198,6 @@ CONFIG_CHR_DEV_SG=y
 # Some SCSI devices (e.g. CD jukebox) support multiple LUNs
 #
 CONFIG_SCSI_MULTI_LUN=y
-# CONFIG_SCSI_REPORT_LUNS is not set
 CONFIG_SCSI_CONSTANTS=y
 CONFIG_SCSI_LOGGING=y
 
@@ -207,6 +211,7 @@ CONFIG_SCSI_LOGGING=y
 # SCSI low-level drivers
 #
 # CONFIG_BLK_DEV_3W_XXXX_RAID is not set
+# CONFIG_SCSI_3W_9XXX is not set
 # CONFIG_SCSI_ACARD is not set
 # CONFIG_SCSI_AACRAID is not set
 CONFIG_SCSI_AIC7XXX=y
@@ -218,11 +223,9 @@ CONFIG_AIC7XXX_DEBUG_MASK=0
 CONFIG_AIC7XXX_REG_PRETTY_PRINT=y
 # CONFIG_SCSI_AIC7XXX_OLD is not set
 # CONFIG_SCSI_AIC79XX is not set
-# CONFIG_SCSI_ADVANSYS is not set
 # CONFIG_SCSI_MEGARAID is not set
 # CONFIG_SCSI_SATA is not set
 # CONFIG_SCSI_BUSLOGIC is not set
-# CONFIG_SCSI_CPQFCTS is not set
 # CONFIG_SCSI_DMX3191D is not set
 # CONFIG_SCSI_EATA is not set
 # CONFIG_SCSI_EATA_PIO is not set
@@ -231,6 +234,7 @@ CONFIG_AIC7XXX_REG_PRETTY_PRINT=y
 # CONFIG_SCSI_IPS is not set
 # CONFIG_SCSI_INIA100 is not set
 # CONFIG_SCSI_SYM53C8XX_2 is not set
+# CONFIG_SCSI_IPR is not set
 # CONFIG_SCSI_QLOGIC_ISP is not set
 # CONFIG_SCSI_QLOGIC_FC is not set
 # CONFIG_SCSI_QLOGIC_1280 is not set
@@ -263,6 +267,7 @@ CONFIG_SCSI_QLA2XXX=y
 #
 # I2O device support
 #
+# CONFIG_I2O is not set
 
 #
 # Networking support
@@ -312,13 +317,13 @@ CONFIG_XFRM=y
 # 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
+# CONFIG_NET_CLS_ROUTE is not set
 
 #
 # Network testing
@@ -617,7 +622,6 @@ CONFIG_SUNRPC=y
 # CONFIG_CIFS is not set
 # CONFIG_NCP_FS is not set
 # CONFIG_CODA_FS is not set
-# CONFIG_INTERMEZZO_FS is not set
 # CONFIG_AFS_FS is not set
 
 #
@@ -631,7 +635,6 @@ CONFIG_PARTITION_ADVANCED=y
 # CONFIG_MAC_PARTITION is not set
 # CONFIG_MSDOS_PARTITION is not set
 # CONFIG_LDM_PARTITION is not set
-# CONFIG_NEC98_PARTITION is not set
 CONFIG_SGI_PARTITION=y
 # CONFIG_ULTRIX_PARTITION is not set
 # CONFIG_SUN_PARTITION is not set
@@ -662,4 +665,6 @@ CONFIG_CMDLINE=""
 #
 # Library routines
 #
+CONFIG_CRC16=y
 # CONFIG_CRC32 is not set
+# CONFIG_LIBCRC32C is not set
diff --git a/arch/mips/configs/it8172_defconfig b/arch/mips/configs/it8172_defconfig
index d7f83618a..520acac13 100644
--- a/arch/mips/configs/it8172_defconfig
+++ b/arch/mips/configs/it8172_defconfig
@@ -21,6 +21,7 @@ CONFIG_SWAP=y
 CONFIG_SYSVIPC=y
 # CONFIG_POSIX_MQUEUE is not set
 CONFIG_BSD_PROCESS_ACCT=y
+# CONFIG_BSD_PROCESS_ACCT_V3 is not set
 CONFIG_SYSCTL=y
 # CONFIG_AUDIT is not set
 CONFIG_LOG_BUF_SHIFT=14
@@ -28,6 +29,7 @@ CONFIG_LOG_BUF_SHIFT=14
 # CONFIG_IKCONFIG is not set
 CONFIG_EMBEDDED=y
 CONFIG_KALLSYMS=y
+# CONFIG_KALLSYMS_EXTRA_PASS is not set
 CONFIG_FUTEX=y
 CONFIG_EPOLL=y
 CONFIG_IOSCHED_NOOP=y
@@ -110,6 +112,7 @@ CONFIG_CPU_NEVADA=y
 # CONFIG_CPU_RM9000 is not set
 # CONFIG_CPU_SB1 is not set
 CONFIG_PAGE_SIZE_4KB=y
+# CONFIG_PAGE_SIZE_8KB is not set
 # CONFIG_PAGE_SIZE_16KB is not set
 # CONFIG_PAGE_SIZE_64KB is not set
 # CONFIG_CPU_ADVANCED is not set
@@ -122,6 +125,7 @@ CONFIG_CPU_HAS_SYNC=y
 #
 # Bus options (PCI, PCMCIA, EISA, ISA, TC)
 #
+CONFIG_HW_HAS_PCI=y
 # CONFIG_PCI is not set
 CONFIG_MMU=y
 
@@ -139,6 +143,7 @@ CONFIG_TRAD_SIGNALS=y
 #
 # Generic Driver Options
 #
+CONFIG_PREVENT_FIRMWARE_BUILD=y
 
 #
 # Memory Technology Devices (MTD)
@@ -229,9 +234,9 @@ CONFIG_BLK_DEV_IDE=y
 #
 # Please see Documentation/ide.txt for help/info on IDE drives
 #
+# CONFIG_BLK_DEV_IDE_SATA is not set
 CONFIG_BLK_DEV_IDEDISK=y
 # CONFIG_IDEDISK_MULTI_MODE is not set
-# CONFIG_IDEDISK_STROKE is not set
 # CONFIG_BLK_DEV_IDECD is not set
 # CONFIG_BLK_DEV_IDETAPE is not set
 # CONFIG_BLK_DEV_IDEFLOPPY is not set
@@ -242,6 +247,7 @@ CONFIG_IDE_TASKFILE_IO=y
 # IDE chipset support/bugfixes
 #
 CONFIG_IDE_GENERIC=y
+# CONFIG_IDE_ARM is not set
 # CONFIG_BLK_DEV_IDEDMA is not set
 # CONFIG_IDEDMA_AUTO is not set
 # CONFIG_BLK_DEV_HD is not set
@@ -317,13 +323,13 @@ CONFIG_XFRM=y
 # 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
+# CONFIG_NET_CLS_ROUTE is not set
 
 #
 # Network testing
@@ -615,7 +621,6 @@ CONFIG_SUNRPC=y
 # CONFIG_CIFS is not set
 # CONFIG_NCP_FS is not set
 # CONFIG_CODA_FS is not set
-# CONFIG_INTERMEZZO_FS is not set
 # CONFIG_AFS_FS is not set
 
 #
@@ -649,4 +654,6 @@ CONFIG_CMDLINE=""
 #
 # Library routines
 #
+CONFIG_CRC16=m
 # CONFIG_CRC32 is not set
+CONFIG_LIBCRC32C=m
diff --git a/arch/mips/configs/ivr_defconfig b/arch/mips/configs/ivr_defconfig
index 58a83eece..8eace13a3 100644
--- a/arch/mips/configs/ivr_defconfig
+++ b/arch/mips/configs/ivr_defconfig
@@ -21,6 +21,7 @@ CONFIG_SWAP=y
 CONFIG_SYSVIPC=y
 # CONFIG_POSIX_MQUEUE is not set
 CONFIG_BSD_PROCESS_ACCT=y
+# CONFIG_BSD_PROCESS_ACCT_V3 is not set
 CONFIG_SYSCTL=y
 # CONFIG_AUDIT is not set
 CONFIG_LOG_BUF_SHIFT=14
@@ -28,6 +29,7 @@ CONFIG_LOG_BUF_SHIFT=14
 # CONFIG_IKCONFIG is not set
 CONFIG_EMBEDDED=y
 CONFIG_KALLSYMS=y
+# CONFIG_KALLSYMS_EXTRA_PASS is not set
 CONFIG_FUTEX=y
 CONFIG_EPOLL=y
 CONFIG_IOSCHED_NOOP=y
@@ -108,6 +110,7 @@ CONFIG_CPU_NEVADA=y
 # CONFIG_CPU_RM9000 is not set
 # CONFIG_CPU_SB1 is not set
 CONFIG_PAGE_SIZE_4KB=y
+# CONFIG_PAGE_SIZE_8KB is not set
 # CONFIG_PAGE_SIZE_16KB is not set
 # CONFIG_PAGE_SIZE_64KB is not set
 # CONFIG_CPU_ADVANCED is not set
@@ -120,6 +123,7 @@ CONFIG_CPU_HAS_SYNC=y
 #
 # Bus options (PCI, PCMCIA, EISA, ISA, TC)
 #
+CONFIG_HW_HAS_PCI=y
 CONFIG_PCI=y
 CONFIG_PCI_LEGACY_PROC=y
 CONFIG_PCI_NAMES=y
@@ -139,6 +143,7 @@ CONFIG_TRAD_SIGNALS=y
 #
 # Generic Driver Options
 #
+CONFIG_PREVENT_FIRMWARE_BUILD=y
 
 #
 # Memory Technology Devices (MTD)
@@ -164,7 +169,7 @@ CONFIG_TRAD_SIGNALS=y
 # CONFIG_BLK_DEV_UMEM is not set
 # CONFIG_BLK_DEV_LOOP is not set
 # CONFIG_BLK_DEV_NBD is not set
-# CONFIG_BLK_DEV_CARMEL is not set
+# CONFIG_BLK_DEV_SX8 is not set
 # CONFIG_BLK_DEV_RAM is not set
 # CONFIG_LBD is not set
 
@@ -177,9 +182,9 @@ CONFIG_BLK_DEV_IDE=y
 #
 # Please see Documentation/ide.txt for help/info on IDE drives
 #
+# CONFIG_BLK_DEV_IDE_SATA is not set
 CONFIG_BLK_DEV_IDEDISK=y
 # CONFIG_IDEDISK_MULTI_MODE is not set
-# CONFIG_IDEDISK_STROKE is not set
 # CONFIG_BLK_DEV_IDECD is not set
 # CONFIG_BLK_DEV_IDETAPE is not set
 # CONFIG_BLK_DEV_IDEFLOPPY is not set
@@ -191,6 +196,7 @@ CONFIG_IDE_TASKFILE_IO=y
 #
 CONFIG_IDE_GENERIC=y
 # CONFIG_BLK_DEV_IDEPCI is not set
+# CONFIG_IDE_ARM is not set
 # CONFIG_BLK_DEV_IDEDMA is not set
 # CONFIG_IDEDMA_AUTO is not set
 # CONFIG_BLK_DEV_HD is not set
@@ -208,7 +214,6 @@ CONFIG_IDE_GENERIC=y
 #
 # Fusion MPT device support
 #
-# CONFIG_FUSION is not set
 
 #
 # IEEE 1394 (FireWire) support
@@ -268,13 +273,13 @@ CONFIG_XFRM=y
 # 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
+# CONFIG_NET_CLS_ROUTE is not set
 
 #
 # Network testing
@@ -350,7 +355,6 @@ CONFIG_NET_ETHERNET=y
 # CONFIG_HIPPI is not set
 # CONFIG_PPP is not set
 # CONFIG_SLIP is not set
-# CONFIG_RCPCI is not set
 # CONFIG_SHAPER is not set
 # CONFIG_NETCONSOLE is not set
 
@@ -571,7 +575,6 @@ CONFIG_SUNRPC=y
 # CONFIG_CIFS is not set
 # CONFIG_NCP_FS is not set
 # CONFIG_CODA_FS is not set
-# CONFIG_INTERMEZZO_FS is not set
 # CONFIG_AFS_FS is not set
 
 #
@@ -605,4 +608,6 @@ CONFIG_CMDLINE=""
 #
 # Library routines
 #
+CONFIG_CRC16=m
 # CONFIG_CRC32 is not set
+CONFIG_LIBCRC32C=m
diff --git a/arch/mips/configs/jaguar-atx_defconfig b/arch/mips/configs/jaguar-atx_defconfig
index 99cda767b..b6f70da71 100644
--- a/arch/mips/configs/jaguar-atx_defconfig
+++ b/arch/mips/configs/jaguar-atx_defconfig
@@ -28,6 +28,7 @@ CONFIG_IKCONFIG=y
 CONFIG_IKCONFIG_PROC=y
 CONFIG_EMBEDDED=y
 CONFIG_KALLSYMS=y
+# CONFIG_KALLSYMS_EXTRA_PASS is not set
 CONFIG_FUTEX=y
 CONFIG_EPOLL=y
 CONFIG_IOSCHED_NOOP=y
@@ -39,7 +40,10 @@ CONFIG_IOSCHED_CFQ=y
 #
 # Loadable module support
 #
-# CONFIG_MODULES is not set
+CONFIG_MODULES=y
+CONFIG_MODULE_UNLOAD=y
+CONFIG_OBSOLETE_MODPARM=y
+CONFIG_KMOD=y
 
 #
 # Machine selection
@@ -73,7 +77,8 @@ CONFIG_LIMITED_DMA=y
 # CONFIG_CPU_LITTLE_ENDIAN is not set
 CONFIG_IRQ_CPU=y
 CONFIG_IRQ_CPU_RM7K=y
-CONFIG_MIPS_MV64340=y
+CONFIG_IRQ_MV64340=y
+CONFIG_PCI_MARVELL=y
 CONFIG_SWAP_IO_SPACE=y
 CONFIG_BOOT_ELF32=y
 CONFIG_MIPS_L1_CACHE_SHIFT=5
@@ -100,6 +105,7 @@ CONFIG_MIPS_L1_CACHE_SHIFT=5
 CONFIG_CPU_RM9000=y
 # CONFIG_CPU_SB1 is not set
 CONFIG_PAGE_SIZE_4KB=y
+# CONFIG_PAGE_SIZE_8KB is not set
 # CONFIG_PAGE_SIZE_16KB is not set
 # CONFIG_PAGE_SIZE_64KB is not set
 CONFIG_BOARD_SCACHE=y
@@ -118,6 +124,7 @@ CONFIG_HIGHMEM=y
 #
 # Bus options (PCI, PCMCIA, EISA, ISA, TC)
 #
+CONFIG_HW_HAS_PCI=y
 CONFIG_PCI=y
 CONFIG_PCI_LEGACY_PROC=y
 CONFIG_PCI_NAMES=y
@@ -138,6 +145,7 @@ CONFIG_TRAD_SIGNALS=y
 #
 # Generic Driver Options
 #
+CONFIG_PREVENT_FIRMWARE_BUILD=y
 
 #
 # Memory Technology Devices (MTD)
@@ -162,7 +170,7 @@ CONFIG_TRAD_SIGNALS=y
 # CONFIG_BLK_DEV_DAC960 is not set
 # CONFIG_BLK_DEV_LOOP is not set
 # CONFIG_BLK_DEV_NBD is not set
-# CONFIG_BLK_DEV_CARMEL is not set
+# CONFIG_BLK_DEV_SX8 is not set
 # CONFIG_BLK_DEV_RAM is not set
 # CONFIG_LBD is not set
 
@@ -184,7 +192,6 @@ CONFIG_TRAD_SIGNALS=y
 #
 # Fusion MPT device support
 #
-# CONFIG_FUSION is not set
 
 #
 # IEEE 1394 (FireWire) support
@@ -233,6 +240,7 @@ CONFIG_IP_PNP_BOOTP=y
 # QoS and/or fair queueing
 #
 # CONFIG_NET_SCHED is not set
+# CONFIG_NET_CLS_ROUTE is not set
 
 #
 # Network testing
@@ -285,6 +293,7 @@ CONFIG_EEPRO100=y
 # CONFIG_SUNDANCE is not set
 # CONFIG_TLAN is not set
 # CONFIG_VIA_RHINE is not set
+# CONFIG_VIA_VELOCITY is not set
 
 #
 # Ethernet (1000 Mbit)
@@ -537,4 +546,6 @@ CONFIG_CMDLINE=""
 #
 # Library routines
 #
+CONFIG_CRC16=m
 # CONFIG_CRC32 is not set
+# CONFIG_LIBCRC32C is not set
diff --git a/arch/mips/configs/jmr3927_defconfig b/arch/mips/configs/jmr3927_defconfig
index 95e463724..4580138f2 100644
--- a/arch/mips/configs/jmr3927_defconfig
+++ b/arch/mips/configs/jmr3927_defconfig
@@ -28,6 +28,7 @@ CONFIG_LOG_BUF_SHIFT=14
 # CONFIG_IKCONFIG is not set
 CONFIG_EMBEDDED=y
 CONFIG_KALLSYMS=y
+# CONFIG_KALLSYMS_EXTRA_PASS is not set
 CONFIG_FUTEX=y
 CONFIG_EPOLL=y
 CONFIG_IOSCHED_NOOP=y
@@ -104,6 +105,7 @@ CONFIG_CPU_TX39XX=y
 # CONFIG_CPU_RM9000 is not set
 # CONFIG_CPU_SB1 is not set
 CONFIG_PAGE_SIZE_4KB=y
+# CONFIG_PAGE_SIZE_8KB is not set
 # CONFIG_PAGE_SIZE_16KB is not set
 # CONFIG_PAGE_SIZE_64KB is not set
 # CONFIG_CPU_ADVANCED is not set
@@ -115,6 +117,7 @@ CONFIG_RTC_DS1742=y
 #
 # Bus options (PCI, PCMCIA, EISA, ISA, TC)
 #
+CONFIG_HW_HAS_PCI=y
 CONFIG_PCI=y
 CONFIG_PCI_LEGACY_PROC=y
 CONFIG_PCI_NAMES=y
@@ -135,6 +138,7 @@ CONFIG_TRAD_SIGNALS=y
 #
 # Generic Driver Options
 #
+CONFIG_PREVENT_FIRMWARE_BUILD=y
 
 #
 # Memory Technology Devices (MTD)
@@ -160,7 +164,7 @@ CONFIG_TRAD_SIGNALS=y
 # CONFIG_BLK_DEV_UMEM is not set
 # CONFIG_BLK_DEV_LOOP is not set
 # CONFIG_BLK_DEV_NBD is not set
-# CONFIG_BLK_DEV_CARMEL is not set
+# CONFIG_BLK_DEV_SX8 is not set
 # CONFIG_BLK_DEV_RAM is not set
 # CONFIG_LBD is not set
 
@@ -182,7 +186,6 @@ CONFIG_TRAD_SIGNALS=y
 #
 # Fusion MPT device support
 #
-# CONFIG_FUSION is not set
 
 #
 # IEEE 1394 (FireWire) support
@@ -242,13 +245,13 @@ CONFIG_XFRM=y
 # 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
+# CONFIG_NET_CLS_ROUTE is not set
 
 #
 # Network testing
@@ -324,7 +327,6 @@ CONFIG_NET_ETHERNET=y
 # CONFIG_HIPPI is not set
 # CONFIG_PPP is not set
 # CONFIG_SLIP is not set
-# CONFIG_RCPCI is not set
 # CONFIG_SHAPER is not set
 # CONFIG_NETCONSOLE is not set
 
@@ -460,8 +462,10 @@ CONFIG_LEGACY_PTY_COUNT=256
 #
 # Graphics support
 #
+# CONFIG_FB_CIRRUS is not set
 # CONFIG_FB_PM2 is not set
 # CONFIG_FB_CYBER2000 is not set
+# CONFIG_FB_ASILIANT is not set
 # CONFIG_FB_IMSTT is not set
 # CONFIG_FB_RIVA is not set
 # CONFIG_FB_MATROX is not set
@@ -578,7 +582,6 @@ CONFIG_SUNRPC=y
 # CONFIG_CIFS is not set
 # CONFIG_NCP_FS is not set
 # CONFIG_CODA_FS is not set
-# CONFIG_INTERMEZZO_FS is not set
 # CONFIG_AFS_FS is not set
 
 #
@@ -612,4 +615,6 @@ CONFIG_CMDLINE=""
 #
 # Library routines
 #
+CONFIG_CRC16=y
 # CONFIG_CRC32 is not set
+# CONFIG_LIBCRC32C is not set
diff --git a/arch/mips/configs/lasat200_defconfig b/arch/mips/configs/lasat200_defconfig
index f7208748c..3f9fb458b 100644
--- a/arch/mips/configs/lasat200_defconfig
+++ b/arch/mips/configs/lasat200_defconfig
@@ -28,6 +28,7 @@ CONFIG_LOG_BUF_SHIFT=14
 # CONFIG_IKCONFIG is not set
 CONFIG_EMBEDDED=y
 CONFIG_KALLSYMS=y
+# CONFIG_KALLSYMS_EXTRA_PASS is not set
 CONFIG_FUTEX=y
 CONFIG_EPOLL=y
 CONFIG_IOSCHED_NOOP=y
@@ -112,6 +113,7 @@ CONFIG_CPU_R5000=y
 # CONFIG_CPU_RM9000 is not set
 # CONFIG_CPU_SB1 is not set
 CONFIG_PAGE_SIZE_4KB=y
+# CONFIG_PAGE_SIZE_8KB is not set
 # CONFIG_PAGE_SIZE_16KB is not set
 # CONFIG_PAGE_SIZE_64KB is not set
 CONFIG_BOARD_SCACHE=y
@@ -127,6 +129,7 @@ CONFIG_CPU_HAS_SYNC=y
 #
 # Bus options (PCI, PCMCIA, EISA, ISA, TC)
 #
+CONFIG_HW_HAS_PCI=y
 CONFIG_PCI=y
 CONFIG_PCI_LEGACY_PROC=y
 # CONFIG_PCI_NAMES is not set
@@ -146,6 +149,7 @@ CONFIG_TRAD_SIGNALS=y
 #
 # Generic Driver Options
 #
+CONFIG_PREVENT_FIRMWARE_BUILD=y
 
 #
 # Memory Technology Devices (MTD)
@@ -227,7 +231,7 @@ CONFIG_MTD_LASAT=y
 # CONFIG_BLK_DEV_UMEM is not set
 # CONFIG_BLK_DEV_LOOP is not set
 # CONFIG_BLK_DEV_NBD is not set
-# CONFIG_BLK_DEV_CARMEL is not set
+# CONFIG_BLK_DEV_SX8 is not set
 # CONFIG_BLK_DEV_RAM is not set
 # CONFIG_LBD is not set
 
@@ -240,9 +244,9 @@ CONFIG_BLK_DEV_IDE=y
 #
 # Please see Documentation/ide.txt for help/info on IDE drives
 #
+# CONFIG_BLK_DEV_IDE_SATA is not set
 CONFIG_BLK_DEV_IDEDISK=y
 CONFIG_IDEDISK_MULTI_MODE=y
-# CONFIG_IDEDISK_STROKE is not set
 # CONFIG_BLK_DEV_IDECD is not set
 # CONFIG_BLK_DEV_IDETAPE is not set
 # CONFIG_BLK_DEV_IDEFLOPPY is not set
@@ -283,6 +287,7 @@ CONFIG_BLK_DEV_CMD64X=y
 # CONFIG_BLK_DEV_SLC90E66 is not set
 # CONFIG_BLK_DEV_TRM290 is not set
 # CONFIG_BLK_DEV_VIA82CXXX is not set
+# CONFIG_IDE_ARM is not set
 CONFIG_BLK_DEV_IDEDMA=y
 # CONFIG_IDEDMA_IVB is not set
 CONFIG_IDEDMA_AUTO=y
@@ -301,7 +306,6 @@ CONFIG_IDEDMA_AUTO=y
 #
 # Fusion MPT device support
 #
-# CONFIG_FUSION is not set
 
 #
 # IEEE 1394 (FireWire) support
@@ -357,13 +361,13 @@ CONFIG_XFRM=y
 # 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
+# CONFIG_NET_CLS_ROUTE is not set
 
 #
 # Network testing
@@ -438,7 +442,6 @@ CONFIG_NET_ETHERNET=y
 # CONFIG_HIPPI is not set
 # CONFIG_PPP is not set
 # CONFIG_SLIP is not set
-# CONFIG_RCPCI is not set
 # CONFIG_SHAPER is not set
 # CONFIG_NETCONSOLE is not set
 
@@ -665,7 +668,6 @@ CONFIG_SUNRPC=y
 # CONFIG_CIFS is not set
 # CONFIG_NCP_FS is not set
 # CONFIG_CODA_FS is not set
-# CONFIG_INTERMEZZO_FS is not set
 # CONFIG_AFS_FS is not set
 
 #
@@ -699,4 +701,6 @@ CONFIG_CMDLINE=""
 #
 # Library routines
 #
+CONFIG_CRC16=m
 CONFIG_CRC32=y
+CONFIG_LIBCRC32C=m
diff --git a/arch/mips/configs/malta_defconfig b/arch/mips/configs/malta_defconfig
index 67a995528..3259148a2 100644
--- a/arch/mips/configs/malta_defconfig
+++ b/arch/mips/configs/malta_defconfig
@@ -28,6 +28,7 @@ CONFIG_LOG_BUF_SHIFT=14
 # CONFIG_IKCONFIG is not set
 CONFIG_EMBEDDED=y
 CONFIG_KALLSYMS=y
+# CONFIG_KALLSYMS_EXTRA_PASS is not set
 CONFIG_FUTEX=y
 CONFIG_EPOLL=y
 CONFIG_IOSCHED_NOOP=y
@@ -115,6 +116,7 @@ CONFIG_CPU_MIPS32=y
 # CONFIG_CPU_RM9000 is not set
 # CONFIG_CPU_SB1 is not set
 CONFIG_PAGE_SIZE_4KB=y
+# CONFIG_PAGE_SIZE_8KB is not set
 # CONFIG_PAGE_SIZE_16KB is not set
 # CONFIG_PAGE_SIZE_64KB is not set
 CONFIG_CPU_HAS_PREFETCH=y
@@ -129,6 +131,7 @@ CONFIG_CPU_HAS_SYNC=y
 #
 # Bus options (PCI, PCMCIA, EISA, ISA, TC)
 #
+CONFIG_HW_HAS_PCI=y
 CONFIG_PCI=y
 CONFIG_PCI_LEGACY_PROC=y
 CONFIG_PCI_NAMES=y
@@ -148,6 +151,7 @@ CONFIG_TRAD_SIGNALS=y
 #
 # Generic Driver Options
 #
+CONFIG_PREVENT_FIRMWARE_BUILD=y
 
 #
 # Memory Technology Devices (MTD)
@@ -173,7 +177,7 @@ CONFIG_TRAD_SIGNALS=y
 # CONFIG_BLK_DEV_UMEM is not set
 # CONFIG_BLK_DEV_LOOP is not set
 # CONFIG_BLK_DEV_NBD is not set
-# CONFIG_BLK_DEV_CARMEL is not set
+# CONFIG_BLK_DEV_SX8 is not set
 CONFIG_BLK_DEV_RAM=y
 CONFIG_BLK_DEV_RAM_SIZE=4096
 # CONFIG_BLK_DEV_INITRD is not set
@@ -197,7 +201,6 @@ CONFIG_BLK_DEV_RAM_SIZE=4096
 #
 # Fusion MPT device support
 #
-# CONFIG_FUSION is not set
 
 #
 # IEEE 1394 (FireWire) support
@@ -256,13 +259,13 @@ CONFIG_XFRM=y
 # 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
+# CONFIG_NET_CLS_ROUTE is not set
 
 #
 # Network testing
@@ -318,6 +321,7 @@ CONFIG_PCNET32=y
 # CONFIG_SUNDANCE is not set
 # CONFIG_TLAN is not set
 # CONFIG_VIA_RHINE is not set
+# CONFIG_VIA_VELOCITY is not set
 # CONFIG_LAN_SAA9730 is not set
 
 #
@@ -357,7 +361,6 @@ CONFIG_PCNET32=y
 # CONFIG_HIPPI is not set
 # CONFIG_PPP is not set
 # CONFIG_SLIP is not set
-# CONFIG_RCPCI is not set
 # CONFIG_SHAPER is not set
 # CONFIG_NETCONSOLE is not set
 
@@ -580,7 +583,6 @@ CONFIG_SUNRPC=y
 # CONFIG_CIFS is not set
 # CONFIG_NCP_FS is not set
 # CONFIG_CODA_FS is not set
-# CONFIG_INTERMEZZO_FS is not set
 # CONFIG_AFS_FS is not set
 
 #
@@ -614,4 +616,6 @@ CONFIG_CMDLINE=""
 #
 # Library routines
 #
+CONFIG_CRC16=m
 CONFIG_CRC32=y
+CONFIG_LIBCRC32C=m
diff --git a/arch/mips/configs/mirage_defconfig b/arch/mips/configs/mirage_defconfig
index edf9ced7a..5bc312a3c 100644
--- a/arch/mips/configs/mirage_defconfig
+++ b/arch/mips/configs/mirage_defconfig
@@ -28,6 +28,7 @@ CONFIG_HOTPLUG=y
 # CONFIG_IKCONFIG is not set
 CONFIG_EMBEDDED=y
 CONFIG_KALLSYMS=y
+# CONFIG_KALLSYMS_EXTRA_PASS is not set
 CONFIG_FUTEX=y
 CONFIG_EPOLL=y
 CONFIG_IOSCHED_NOOP=y
@@ -105,6 +106,7 @@ CONFIG_CPU_MIPS32=y
 # CONFIG_CPU_RM9000 is not set
 # CONFIG_CPU_SB1 is not set
 CONFIG_PAGE_SIZE_4KB=y
+# CONFIG_PAGE_SIZE_8KB is not set
 # CONFIG_PAGE_SIZE_16KB is not set
 # CONFIG_PAGE_SIZE_64KB is not set
 CONFIG_CPU_HAS_PREFETCH=y
@@ -146,6 +148,7 @@ CONFIG_TRAD_SIGNALS=y
 #
 # Generic Driver Options
 #
+CONFIG_PREVENT_FIRMWARE_BUILD=y
 # CONFIG_FW_LOADER is not set
 
 #
@@ -265,13 +268,13 @@ CONFIG_XFRM=y
 # 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
+# CONFIG_NET_CLS_ROUTE is not set
 
 #
 # Network testing
@@ -496,6 +499,9 @@ CONFIG_FS_MBCACHE=y
 CONFIG_REISERFS_FS=m
 # CONFIG_REISERFS_CHECK is not set
 # CONFIG_REISERFS_PROC_INFO is not set
+CONFIG_REISERFS_FS_XATTR=y
+CONFIG_REISERFS_FS_POSIX_ACL=y
+CONFIG_REISERFS_FS_SECURITY=y
 # CONFIG_JFS_FS is not set
 CONFIG_FS_POSIX_ACL=y
 # CONFIG_XFS_FS is not set
@@ -567,7 +573,6 @@ CONFIG_SMB_FS=m
 # CONFIG_CIFS is not set
 # CONFIG_NCP_FS is not set
 # CONFIG_CODA_FS is not set
-# CONFIG_INTERMEZZO_FS is not set
 # CONFIG_AFS_FS is not set
 
 #
@@ -604,6 +609,7 @@ CONFIG_NLS_DEFAULT="iso8859-1"
 # CONFIG_NLS_ISO8859_8 is not set
 # CONFIG_NLS_CODEPAGE_1250 is not set
 # CONFIG_NLS_CODEPAGE_1251 is not set
+# CONFIG_NLS_ASCII is not set
 # CONFIG_NLS_ISO8859_1 is not set
 # CONFIG_NLS_ISO8859_2 is not set
 # CONFIG_NLS_ISO8859_3 is not set
@@ -652,11 +658,14 @@ CONFIG_CRYPTO_AES=y
 # CONFIG_CRYPTO_ARC4 is not set
 CONFIG_CRYPTO_DEFLATE=y
 CONFIG_CRYPTO_MICHAEL_MIC=y
+CONFIG_CRYPTO_CRC32C=m
 # CONFIG_CRYPTO_TEST is not set
 
 #
 # Library routines
 #
+CONFIG_CRC16=m
 CONFIG_CRC32=y
+CONFIG_LIBCRC32C=m
 CONFIG_ZLIB_INFLATE=y
 CONFIG_ZLIB_DEFLATE=y
diff --git a/arch/mips/configs/mpc30x_defconfig b/arch/mips/configs/mpc30x_defconfig
index 3ccf5a617..2c3c1f0a1 100644
--- a/arch/mips/configs/mpc30x_defconfig
+++ b/arch/mips/configs/mpc30x_defconfig
@@ -28,6 +28,7 @@ CONFIG_LOG_BUF_SHIFT=14
 # CONFIG_IKCONFIG is not set
 CONFIG_EMBEDDED=y
 CONFIG_KALLSYMS=y
+# CONFIG_KALLSYMS_EXTRA_PASS is not set
 CONFIG_FUTEX=y
 CONFIG_EPOLL=y
 CONFIG_IOSCHED_NOOP=y
@@ -54,11 +55,11 @@ CONFIG_KMOD=y
 CONFIG_MACH_VR41XX=y
 # CONFIG_CASIO_E55 is not set
 # CONFIG_IBM_WORKPAD is not set
-# CONFIG_NEC_EAGLE is not set
 # CONFIG_TANBAC_TB0226 is not set
 # CONFIG_TANBAC_TB0229 is not set
 CONFIG_VICTOR_MPC30X=y
 # CONFIG_ZAO_CAPCELLA is not set
+CONFIG_PCI_VR41XX=y
 CONFIG_VRC4173=y
 # CONFIG_TOSHIBA_JMR3927 is not set
 # CONFIG_MIPS_COBALT is not set
@@ -91,7 +92,6 @@ CONFIG_HAVE_DEC_LOCK=y
 CONFIG_DMA_NONCOHERENT=y
 CONFIG_CPU_LITTLE_ENDIAN=y
 CONFIG_IRQ_CPU=y
-CONFIG_DUMMY_KEYB=y
 CONFIG_MIPS_L1_CACHE_SHIFT=5
 # CONFIG_FB is not set
 
@@ -116,6 +116,7 @@ CONFIG_CPU_VR41XX=y
 # CONFIG_CPU_RM9000 is not set
 # CONFIG_CPU_SB1 is not set
 CONFIG_PAGE_SIZE_4KB=y
+# CONFIG_PAGE_SIZE_8KB is not set
 # CONFIG_PAGE_SIZE_16KB is not set
 # CONFIG_PAGE_SIZE_64KB is not set
 # CONFIG_CPU_ADVANCED is not set
@@ -126,6 +127,7 @@ CONFIG_CPU_HAS_SYNC=y
 #
 # Bus options (PCI, PCMCIA, EISA, ISA, TC)
 #
+CONFIG_HW_HAS_PCI=y
 CONFIG_PCI=y
 CONFIG_PCI_LEGACY_PROC=y
 CONFIG_PCI_NAMES=y
@@ -145,6 +147,7 @@ CONFIG_TRAD_SIGNALS=y
 #
 # Generic Driver Options
 #
+CONFIG_PREVENT_FIRMWARE_BUILD=y
 
 #
 # Memory Technology Devices (MTD)
@@ -170,7 +173,7 @@ CONFIG_TRAD_SIGNALS=y
 # CONFIG_BLK_DEV_UMEM is not set
 # CONFIG_BLK_DEV_LOOP is not set
 # CONFIG_BLK_DEV_NBD is not set
-# CONFIG_BLK_DEV_CARMEL is not set
+# CONFIG_BLK_DEV_SX8 is not set
 # CONFIG_BLK_DEV_RAM is not set
 # CONFIG_LBD is not set
 
@@ -192,7 +195,6 @@ CONFIG_TRAD_SIGNALS=y
 #
 # Fusion MPT device support
 #
-# CONFIG_FUSION is not set
 
 #
 # IEEE 1394 (FireWire) support
@@ -253,13 +255,13 @@ CONFIG_XFRM=y
 # 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
+# CONFIG_NET_CLS_ROUTE is not set
 
 #
 # Network testing
@@ -335,7 +337,6 @@ CONFIG_NET_ETHERNET=y
 # CONFIG_HIPPI is not set
 # CONFIG_PPP is not set
 # CONFIG_SLIP is not set
-# CONFIG_RCPCI is not set
 # CONFIG_SHAPER is not set
 # CONFIG_NETCONSOLE is not set
 
@@ -555,7 +556,6 @@ CONFIG_SUNRPC=y
 # CONFIG_CIFS is not set
 # CONFIG_NCP_FS is not set
 # CONFIG_CODA_FS is not set
-# CONFIG_INTERMEZZO_FS is not set
 # CONFIG_AFS_FS is not set
 
 #
@@ -602,11 +602,14 @@ CONFIG_CRYPTO_AES=y
 # CONFIG_CRYPTO_ARC4 is not set
 CONFIG_CRYPTO_DEFLATE=y
 CONFIG_CRYPTO_MICHAEL_MIC=y
+CONFIG_CRYPTO_CRC32C=m
 # CONFIG_CRYPTO_TEST is not set
 
 #
 # Library routines
 #
+CONFIG_CRC16=m
 # CONFIG_CRC32 is not set
+CONFIG_LIBCRC32C=m
 CONFIG_ZLIB_INFLATE=y
 CONFIG_ZLIB_DEFLATE=y
diff --git a/arch/mips/configs/mtx1_defconfig b/arch/mips/configs/mtx1_defconfig
index edf9ced7a..5bc312a3c 100644
--- a/arch/mips/configs/mtx1_defconfig
+++ b/arch/mips/configs/mtx1_defconfig
@@ -28,6 +28,7 @@ CONFIG_HOTPLUG=y
 # CONFIG_IKCONFIG is not set
 CONFIG_EMBEDDED=y
 CONFIG_KALLSYMS=y
+# CONFIG_KALLSYMS_EXTRA_PASS is not set
 CONFIG_FUTEX=y
 CONFIG_EPOLL=y
 CONFIG_IOSCHED_NOOP=y
@@ -105,6 +106,7 @@ CONFIG_CPU_MIPS32=y
 # CONFIG_CPU_RM9000 is not set
 # CONFIG_CPU_SB1 is not set
 CONFIG_PAGE_SIZE_4KB=y
+# CONFIG_PAGE_SIZE_8KB is not set
 # CONFIG_PAGE_SIZE_16KB is not set
 # CONFIG_PAGE_SIZE_64KB is not set
 CONFIG_CPU_HAS_PREFETCH=y
@@ -146,6 +148,7 @@ CONFIG_TRAD_SIGNALS=y
 #
 # Generic Driver Options
 #
+CONFIG_PREVENT_FIRMWARE_BUILD=y
 # CONFIG_FW_LOADER is not set
 
 #
@@ -265,13 +268,13 @@ CONFIG_XFRM=y
 # 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
+# CONFIG_NET_CLS_ROUTE is not set
 
 #
 # Network testing
@@ -496,6 +499,9 @@ CONFIG_FS_MBCACHE=y
 CONFIG_REISERFS_FS=m
 # CONFIG_REISERFS_CHECK is not set
 # CONFIG_REISERFS_PROC_INFO is not set
+CONFIG_REISERFS_FS_XATTR=y
+CONFIG_REISERFS_FS_POSIX_ACL=y
+CONFIG_REISERFS_FS_SECURITY=y
 # CONFIG_JFS_FS is not set
 CONFIG_FS_POSIX_ACL=y
 # CONFIG_XFS_FS is not set
@@ -567,7 +573,6 @@ CONFIG_SMB_FS=m
 # CONFIG_CIFS is not set
 # CONFIG_NCP_FS is not set
 # CONFIG_CODA_FS is not set
-# CONFIG_INTERMEZZO_FS is not set
 # CONFIG_AFS_FS is not set
 
 #
@@ -604,6 +609,7 @@ CONFIG_NLS_DEFAULT="iso8859-1"
 # CONFIG_NLS_ISO8859_8 is not set
 # CONFIG_NLS_CODEPAGE_1250 is not set
 # CONFIG_NLS_CODEPAGE_1251 is not set
+# CONFIG_NLS_ASCII is not set
 # CONFIG_NLS_ISO8859_1 is not set
 # CONFIG_NLS_ISO8859_2 is not set
 # CONFIG_NLS_ISO8859_3 is not set
@@ -652,11 +658,14 @@ CONFIG_CRYPTO_AES=y
 # CONFIG_CRYPTO_ARC4 is not set
 CONFIG_CRYPTO_DEFLATE=y
 CONFIG_CRYPTO_MICHAEL_MIC=y
+CONFIG_CRYPTO_CRC32C=m
 # CONFIG_CRYPTO_TEST is not set
 
 #
 # Library routines
 #
+CONFIG_CRC16=m
 CONFIG_CRC32=y
+CONFIG_LIBCRC32C=m
 CONFIG_ZLIB_INFLATE=y
 CONFIG_ZLIB_DEFLATE=y
diff --git a/arch/mips/configs/ocelot_c_defconfig b/arch/mips/configs/ocelot_c_defconfig
index f33d867cc..3eafe9ae7 100644
--- a/arch/mips/configs/ocelot_c_defconfig
+++ b/arch/mips/configs/ocelot_c_defconfig
@@ -27,6 +27,7 @@ CONFIG_LOG_BUF_SHIFT=14
 # CONFIG_IKCONFIG is not set
 CONFIG_EMBEDDED=y
 CONFIG_KALLSYMS=y
+# CONFIG_KALLSYMS_EXTRA_PASS is not set
 CONFIG_FUTEX=y
 CONFIG_EPOLL=y
 CONFIG_IOSCHED_NOOP=y
@@ -74,7 +75,8 @@ CONFIG_HAVE_DEC_LOCK=y
 CONFIG_DMA_NONCOHERENT=y
 # CONFIG_CPU_LITTLE_ENDIAN is not set
 CONFIG_IRQ_CPU=y
-CONFIG_MIPS_MV64340=y
+CONFIG_IRQ_MV64340=y
+CONFIG_PCI_MARVELL=y
 CONFIG_SWAP_IO_SPACE=y
 CONFIG_MIPS_L1_CACHE_SHIFT=5
 # CONFIG_FB is not set
@@ -100,6 +102,7 @@ CONFIG_CPU_RM7000=y
 # CONFIG_CPU_RM9000 is not set
 # CONFIG_CPU_SB1 is not set
 CONFIG_PAGE_SIZE_4KB=y
+# CONFIG_PAGE_SIZE_8KB is not set
 # CONFIG_PAGE_SIZE_16KB is not set
 # CONFIG_PAGE_SIZE_64KB is not set
 CONFIG_BOARD_SCACHE=y
@@ -114,7 +117,10 @@ CONFIG_CPU_HAS_SYNC=y
 #
 # Bus options (PCI, PCMCIA, EISA, ISA, TC)
 #
-# CONFIG_PCI is not set
+CONFIG_HW_HAS_PCI=y
+CONFIG_PCI=y
+CONFIG_PCI_LEGACY_PROC=y
+CONFIG_PCI_NAMES=y
 CONFIG_MMU=y
 
 #
@@ -135,6 +141,7 @@ CONFIG_BINFMT_ELF32=y
 #
 # Generic Driver Options
 #
+CONFIG_PREVENT_FIRMWARE_BUILD=y
 
 #
 # Memory Technology Devices (MTD)
@@ -154,8 +161,13 @@ CONFIG_BINFMT_ELF32=y
 # Block devices
 #
 # CONFIG_BLK_DEV_FD is not set
+# CONFIG_BLK_CPQ_DA is not set
+# CONFIG_BLK_CPQ_CISS_DA is not set
+# CONFIG_BLK_DEV_DAC960 is not set
+# CONFIG_BLK_DEV_UMEM is not set
 # CONFIG_BLK_DEV_LOOP is not set
 # CONFIG_BLK_DEV_NBD is not set
+# CONFIG_BLK_DEV_SX8 is not set
 # CONFIG_BLK_DEV_RAM is not set
 
 #
@@ -185,6 +197,7 @@ CONFIG_BINFMT_ELF32=y
 #
 # I2O device support
 #
+# CONFIG_I2O is not set
 
 #
 # Networking support
@@ -233,13 +246,13 @@ CONFIG_XFRM=y
 # 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
+# CONFIG_NET_CLS_ROUTE is not set
 
 #
 # Network testing
@@ -257,27 +270,51 @@ CONFIG_NETDEVICES=y
 # CONFIG_TUN is not set
 # CONFIG_ETHERTAP is not set
 
+#
+# ARCnet devices
+#
+# CONFIG_ARCNET is not set
+
 #
 # Ethernet (10 or 100Mbit)
 #
 CONFIG_NET_ETHERNET=y
 # CONFIG_MII is not set
+# CONFIG_HAPPYMEAL is not set
+# CONFIG_SUNGEM is not set
+# CONFIG_NET_VENDOR_3COM is not set
+
+#
+# Tulip family network device support
+#
+# CONFIG_NET_TULIP is not set
+# CONFIG_HP100 is not set
+# CONFIG_NET_PCI is not set
 
 #
 # Ethernet (1000 Mbit)
 #
-CONFIG_MV64340_ETH=y
-CONFIG_MV64340_ETH_0=y
-# CONFIG_MV64340_ETH_1 is not set
-# CONFIG_MV64340_ETH_2 is not set
+# CONFIG_ACENIC is not set
+# CONFIG_DL2K is not set
+# CONFIG_E1000 is not set
+# CONFIG_NS83820 is not set
+# CONFIG_HAMACHI is not set
+# CONFIG_YELLOWFIN is not set
+# CONFIG_R8169 is not set
+# CONFIG_SK98LIN is not set
+# CONFIG_TIGON3 is not set
+# CONFIG_MV64340_ETH is not set
 
 #
 # Ethernet (10000 Mbit)
 #
+# CONFIG_IXGB is not set
+# CONFIG_S2IO is not set
 
 #
 # Token Ring devices
 #
+# CONFIG_TR is not set
 
 #
 # Wireless LAN (non-hamradio)
@@ -288,6 +325,8 @@ CONFIG_MV64340_ETH_0=y
 # Wan interfaces
 #
 # CONFIG_WAN is not set
+# CONFIG_FDDI is not set
+# CONFIG_HIPPI is not set
 # CONFIG_PPP is not set
 # CONFIG_SLIP is not set
 # CONFIG_SHAPER is not set
@@ -329,6 +368,7 @@ CONFIG_SERIO=y
 # CONFIG_SERIO_I8042 is not set
 CONFIG_SERIO_SERPORT=y
 # CONFIG_SERIO_CT82C710 is not set
+# CONFIG_SERIO_PCIPS2 is not set
 
 #
 # Input Device Drivers
@@ -426,6 +466,7 @@ CONFIG_DUMMY_CONSOLE=y
 #
 # USB support
 #
+# CONFIG_USB is not set
 
 #
 # USB Gadget Support
@@ -509,7 +550,6 @@ CONFIG_SUNRPC=y
 # CONFIG_CIFS is not set
 # CONFIG_NCP_FS is not set
 # CONFIG_CODA_FS is not set
-# CONFIG_INTERMEZZO_FS is not set
 # CONFIG_AFS_FS is not set
 
 #
@@ -543,4 +583,6 @@ CONFIG_CMDLINE=""
 #
 # Library routines
 #
+CONFIG_CRC16=y
 # CONFIG_CRC32 is not set
+# CONFIG_LIBCRC32C is not set
diff --git a/arch/mips/configs/ocelot_defconfig b/arch/mips/configs/ocelot_defconfig
index c3d713ac4..2f5c2d2f7 100644
--- a/arch/mips/configs/ocelot_defconfig
+++ b/arch/mips/configs/ocelot_defconfig
@@ -28,6 +28,7 @@ CONFIG_LOG_BUF_SHIFT=14
 # CONFIG_IKCONFIG is not set
 CONFIG_EMBEDDED=y
 CONFIG_KALLSYMS=y
+# CONFIG_KALLSYMS_EXTRA_PASS is not set
 CONFIG_FUTEX=y
 CONFIG_EPOLL=y
 CONFIG_IOSCHED_NOOP=y
@@ -108,6 +109,7 @@ CONFIG_CPU_RM7000=y
 # CONFIG_CPU_RM9000 is not set
 # CONFIG_CPU_SB1 is not set
 CONFIG_PAGE_SIZE_4KB=y
+# CONFIG_PAGE_SIZE_8KB is not set
 # CONFIG_PAGE_SIZE_16KB is not set
 # CONFIG_PAGE_SIZE_64KB is not set
 CONFIG_BOARD_SCACHE=y
@@ -124,6 +126,7 @@ CONFIG_CPU_HAS_SYNC=y
 #
 # Bus options (PCI, PCMCIA, EISA, ISA, TC)
 #
+CONFIG_HW_HAS_PCI=y
 # CONFIG_PCI is not set
 CONFIG_MMU=y
 
@@ -142,6 +145,7 @@ CONFIG_TRAD_SIGNALS=y
 #
 # Generic Driver Options
 #
+CONFIG_PREVENT_FIRMWARE_BUILD=y
 
 #
 # Memory Technology Devices (MTD)
@@ -241,13 +245,13 @@ CONFIG_XFRM=y
 # 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
+# CONFIG_NET_CLS_ROUTE is not set
 
 #
 # Network testing
@@ -513,7 +517,6 @@ CONFIG_SUNRPC=y
 # CONFIG_CIFS is not set
 # CONFIG_NCP_FS is not set
 # CONFIG_CODA_FS is not set
-# CONFIG_INTERMEZZO_FS is not set
 # CONFIG_AFS_FS is not set
 
 #
@@ -547,4 +550,6 @@ CONFIG_CMDLINE=""
 #
 # Library routines
 #
+CONFIG_CRC16=y
 # CONFIG_CRC32 is not set
+# CONFIG_LIBCRC32C is not set
diff --git a/arch/mips/configs/ocelot_g_defconfig b/arch/mips/configs/ocelot_g_defconfig
index fa2584125..a6e93370f 100644
--- a/arch/mips/configs/ocelot_g_defconfig
+++ b/arch/mips/configs/ocelot_g_defconfig
@@ -249,7 +249,6 @@ CONFIG_XFRM=y
 # 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
 
 #
diff --git a/arch/mips/configs/osprey_defconfig b/arch/mips/configs/osprey_defconfig
index 6d6e26201..11564910e 100644
--- a/arch/mips/configs/osprey_defconfig
+++ b/arch/mips/configs/osprey_defconfig
@@ -28,6 +28,7 @@ CONFIG_LOG_BUF_SHIFT=14
 # CONFIG_IKCONFIG is not set
 CONFIG_EMBEDDED=y
 CONFIG_KALLSYMS=y
+# CONFIG_KALLSYMS_EXTRA_PASS is not set
 CONFIG_FUTEX=y
 CONFIG_EPOLL=y
 CONFIG_IOSCHED_NOOP=y
@@ -83,7 +84,6 @@ CONFIG_HAVE_DEC_LOCK=y
 CONFIG_DMA_NONCOHERENT=y
 CONFIG_CPU_LITTLE_ENDIAN=y
 CONFIG_IRQ_CPU=y
-CONFIG_DUMMY_KEYB=y
 CONFIG_MIPS_L1_CACHE_SHIFT=5
 # CONFIG_FB is not set
 CONFIG_VR4181=y
@@ -109,6 +109,7 @@ CONFIG_CPU_VR41XX=y
 # CONFIG_CPU_RM9000 is not set
 # CONFIG_CPU_SB1 is not set
 CONFIG_PAGE_SIZE_4KB=y
+# CONFIG_PAGE_SIZE_8KB is not set
 # CONFIG_PAGE_SIZE_16KB is not set
 # CONFIG_PAGE_SIZE_64KB is not set
 # CONFIG_CPU_ADVANCED is not set
@@ -135,6 +136,7 @@ CONFIG_TRAD_SIGNALS=y
 #
 # Generic Driver Options
 #
+CONFIG_PREVENT_FIRMWARE_BUILD=y
 
 #
 # Memory Technology Devices (MTD)
@@ -235,13 +237,13 @@ CONFIG_XFRM=y
 # 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
+# CONFIG_NET_CLS_ROUTE is not set
 
 #
 # Network testing
@@ -507,7 +509,6 @@ CONFIG_SUNRPC=y
 # CONFIG_CIFS is not set
 # CONFIG_NCP_FS is not set
 # CONFIG_CODA_FS is not set
-# CONFIG_INTERMEZZO_FS is not set
 # CONFIG_AFS_FS is not set
 
 #
@@ -541,4 +542,6 @@ CONFIG_CMDLINE="ip=bootp ether=46,0x03fe0300,eth0"
 #
 # Library routines
 #
+CONFIG_CRC16=m
 # CONFIG_CRC32 is not set
+CONFIG_LIBCRC32C=m
diff --git a/arch/mips/configs/pb1000_defconfig b/arch/mips/configs/pb1000_defconfig
index edf9ced7a..5bc312a3c 100644
--- a/arch/mips/configs/pb1000_defconfig
+++ b/arch/mips/configs/pb1000_defconfig
@@ -28,6 +28,7 @@ CONFIG_HOTPLUG=y
 # CONFIG_IKCONFIG is not set
 CONFIG_EMBEDDED=y
 CONFIG_KALLSYMS=y
+# CONFIG_KALLSYMS_EXTRA_PASS is not set
 CONFIG_FUTEX=y
 CONFIG_EPOLL=y
 CONFIG_IOSCHED_NOOP=y
@@ -105,6 +106,7 @@ CONFIG_CPU_MIPS32=y
 # CONFIG_CPU_RM9000 is not set
 # CONFIG_CPU_SB1 is not set
 CONFIG_PAGE_SIZE_4KB=y
+# CONFIG_PAGE_SIZE_8KB is not set
 # CONFIG_PAGE_SIZE_16KB is not set
 # CONFIG_PAGE_SIZE_64KB is not set
 CONFIG_CPU_HAS_PREFETCH=y
@@ -146,6 +148,7 @@ CONFIG_TRAD_SIGNALS=y
 #
 # Generic Driver Options
 #
+CONFIG_PREVENT_FIRMWARE_BUILD=y
 # CONFIG_FW_LOADER is not set
 
 #
@@ -265,13 +268,13 @@ CONFIG_XFRM=y
 # 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
+# CONFIG_NET_CLS_ROUTE is not set
 
 #
 # Network testing
@@ -496,6 +499,9 @@ CONFIG_FS_MBCACHE=y
 CONFIG_REISERFS_FS=m
 # CONFIG_REISERFS_CHECK is not set
 # CONFIG_REISERFS_PROC_INFO is not set
+CONFIG_REISERFS_FS_XATTR=y
+CONFIG_REISERFS_FS_POSIX_ACL=y
+CONFIG_REISERFS_FS_SECURITY=y
 # CONFIG_JFS_FS is not set
 CONFIG_FS_POSIX_ACL=y
 # CONFIG_XFS_FS is not set
@@ -567,7 +573,6 @@ CONFIG_SMB_FS=m
 # CONFIG_CIFS is not set
 # CONFIG_NCP_FS is not set
 # CONFIG_CODA_FS is not set
-# CONFIG_INTERMEZZO_FS is not set
 # CONFIG_AFS_FS is not set
 
 #
@@ -604,6 +609,7 @@ CONFIG_NLS_DEFAULT="iso8859-1"
 # CONFIG_NLS_ISO8859_8 is not set
 # CONFIG_NLS_CODEPAGE_1250 is not set
 # CONFIG_NLS_CODEPAGE_1251 is not set
+# CONFIG_NLS_ASCII is not set
 # CONFIG_NLS_ISO8859_1 is not set
 # CONFIG_NLS_ISO8859_2 is not set
 # CONFIG_NLS_ISO8859_3 is not set
@@ -652,11 +658,14 @@ CONFIG_CRYPTO_AES=y
 # CONFIG_CRYPTO_ARC4 is not set
 CONFIG_CRYPTO_DEFLATE=y
 CONFIG_CRYPTO_MICHAEL_MIC=y
+CONFIG_CRYPTO_CRC32C=m
 # CONFIG_CRYPTO_TEST is not set
 
 #
 # Library routines
 #
+CONFIG_CRC16=m
 CONFIG_CRC32=y
+CONFIG_LIBCRC32C=m
 CONFIG_ZLIB_INFLATE=y
 CONFIG_ZLIB_DEFLATE=y
diff --git a/arch/mips/configs/pb1100_defconfig b/arch/mips/configs/pb1100_defconfig
index edf9ced7a..5bc312a3c 100644
--- a/arch/mips/configs/pb1100_defconfig
+++ b/arch/mips/configs/pb1100_defconfig
@@ -28,6 +28,7 @@ CONFIG_HOTPLUG=y
 # CONFIG_IKCONFIG is not set
 CONFIG_EMBEDDED=y
 CONFIG_KALLSYMS=y
+# CONFIG_KALLSYMS_EXTRA_PASS is not set
 CONFIG_FUTEX=y
 CONFIG_EPOLL=y
 CONFIG_IOSCHED_NOOP=y
@@ -105,6 +106,7 @@ CONFIG_CPU_MIPS32=y
 # CONFIG_CPU_RM9000 is not set
 # CONFIG_CPU_SB1 is not set
 CONFIG_PAGE_SIZE_4KB=y
+# CONFIG_PAGE_SIZE_8KB is not set
 # CONFIG_PAGE_SIZE_16KB is not set
 # CONFIG_PAGE_SIZE_64KB is not set
 CONFIG_CPU_HAS_PREFETCH=y
@@ -146,6 +148,7 @@ CONFIG_TRAD_SIGNALS=y
 #
 # Generic Driver Options
 #
+CONFIG_PREVENT_FIRMWARE_BUILD=y
 # CONFIG_FW_LOADER is not set
 
 #
@@ -265,13 +268,13 @@ CONFIG_XFRM=y
 # 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
+# CONFIG_NET_CLS_ROUTE is not set
 
 #
 # Network testing
@@ -496,6 +499,9 @@ CONFIG_FS_MBCACHE=y
 CONFIG_REISERFS_FS=m
 # CONFIG_REISERFS_CHECK is not set
 # CONFIG_REISERFS_PROC_INFO is not set
+CONFIG_REISERFS_FS_XATTR=y
+CONFIG_REISERFS_FS_POSIX_ACL=y
+CONFIG_REISERFS_FS_SECURITY=y
 # CONFIG_JFS_FS is not set
 CONFIG_FS_POSIX_ACL=y
 # CONFIG_XFS_FS is not set
@@ -567,7 +573,6 @@ CONFIG_SMB_FS=m
 # CONFIG_CIFS is not set
 # CONFIG_NCP_FS is not set
 # CONFIG_CODA_FS is not set
-# CONFIG_INTERMEZZO_FS is not set
 # CONFIG_AFS_FS is not set
 
 #
@@ -604,6 +609,7 @@ CONFIG_NLS_DEFAULT="iso8859-1"
 # CONFIG_NLS_ISO8859_8 is not set
 # CONFIG_NLS_CODEPAGE_1250 is not set
 # CONFIG_NLS_CODEPAGE_1251 is not set
+# CONFIG_NLS_ASCII is not set
 # CONFIG_NLS_ISO8859_1 is not set
 # CONFIG_NLS_ISO8859_2 is not set
 # CONFIG_NLS_ISO8859_3 is not set
@@ -652,11 +658,14 @@ CONFIG_CRYPTO_AES=y
 # CONFIG_CRYPTO_ARC4 is not set
 CONFIG_CRYPTO_DEFLATE=y
 CONFIG_CRYPTO_MICHAEL_MIC=y
+CONFIG_CRYPTO_CRC32C=m
 # CONFIG_CRYPTO_TEST is not set
 
 #
 # Library routines
 #
+CONFIG_CRC16=m
 CONFIG_CRC32=y
+CONFIG_LIBCRC32C=m
 CONFIG_ZLIB_INFLATE=y
 CONFIG_ZLIB_DEFLATE=y
diff --git a/arch/mips/configs/pb1500_defconfig b/arch/mips/configs/pb1500_defconfig
index 533dc53ae..aeecf8550 100644
--- a/arch/mips/configs/pb1500_defconfig
+++ b/arch/mips/configs/pb1500_defconfig
@@ -28,6 +28,7 @@ CONFIG_HOTPLUG=y
 # CONFIG_IKCONFIG is not set
 CONFIG_EMBEDDED=y
 CONFIG_KALLSYMS=y
+# CONFIG_KALLSYMS_EXTRA_PASS is not set
 CONFIG_FUTEX=y
 CONFIG_EPOLL=y
 CONFIG_IOSCHED_NOOP=y
@@ -123,6 +124,7 @@ CONFIG_CPU_MIPS32=y
 # CONFIG_CPU_RM9000 is not set
 # CONFIG_CPU_SB1 is not set
 CONFIG_PAGE_SIZE_4KB=y
+# CONFIG_PAGE_SIZE_8KB is not set
 # CONFIG_PAGE_SIZE_16KB is not set
 # CONFIG_PAGE_SIZE_64KB is not set
 CONFIG_CPU_HAS_PREFETCH=y
@@ -137,6 +139,7 @@ CONFIG_CPU_HAS_SYNC=y
 #
 # Bus options (PCI, PCMCIA, EISA, ISA, TC)
 #
+CONFIG_HW_HAS_PCI=y
 CONFIG_PCI=y
 CONFIG_PCI_LEGACY_PROC=y
 CONFIG_PCI_NAMES=y
@@ -148,6 +151,7 @@ CONFIG_MMU=y
 CONFIG_PCMCIA=m
 # CONFIG_PCMCIA_DEBUG is not set
 # CONFIG_YENTA is not set
+CONFIG_PD6729=m
 # CONFIG_I82092 is not set
 # CONFIG_TCIC is not set
 # CONFIG_PCMCIA_AU1X00 is not set
@@ -171,6 +175,7 @@ CONFIG_TRAD_SIGNALS=y
 #
 # Generic Driver Options
 #
+CONFIG_PREVENT_FIRMWARE_BUILD=y
 # CONFIG_FW_LOADER is not set
 
 #
@@ -198,7 +203,7 @@ CONFIG_TRAD_SIGNALS=y
 CONFIG_BLK_DEV_LOOP=y
 # CONFIG_BLK_DEV_CRYPTOLOOP is not set
 # CONFIG_BLK_DEV_NBD is not set
-# CONFIG_BLK_DEV_CARMEL is not set
+# CONFIG_BLK_DEV_SX8 is not set
 # CONFIG_BLK_DEV_RAM is not set
 # CONFIG_LBD is not set
 
@@ -211,9 +216,9 @@ CONFIG_BLK_DEV_IDE=y
 #
 # Please see Documentation/ide.txt for help/info on IDE drives
 #
+# CONFIG_BLK_DEV_IDE_SATA is not set
 CONFIG_BLK_DEV_IDEDISK=y
 # CONFIG_IDEDISK_MULTI_MODE is not set
-# CONFIG_IDEDISK_STROKE is not set
 # CONFIG_BLK_DEV_IDECS is not set
 # CONFIG_BLK_DEV_IDECD is not set
 # CONFIG_BLK_DEV_IDETAPE is not set
@@ -254,6 +259,7 @@ CONFIG_BLK_DEV_HPT366=y
 # CONFIG_BLK_DEV_SLC90E66 is not set
 # CONFIG_BLK_DEV_TRM290 is not set
 # CONFIG_BLK_DEV_VIA82CXXX is not set
+# CONFIG_IDE_ARM is not set
 CONFIG_BLK_DEV_IDEDMA=y
 # CONFIG_IDEDMA_IVB is not set
 # CONFIG_IDEDMA_AUTO is not set
@@ -272,7 +278,6 @@ CONFIG_BLK_DEV_IDEDMA=y
 #
 # Fusion MPT device support
 #
-# CONFIG_FUSION is not set
 
 #
 # IEEE 1394 (FireWire) support
@@ -349,13 +354,13 @@ CONFIG_XFRM=y
 # 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
+# CONFIG_NET_CLS_ROUTE is not set
 
 #
 # Network testing
@@ -452,7 +457,6 @@ CONFIG_PPP_DEFLATE=m
 # CONFIG_PPP_BSDCOMP is not set
 CONFIG_PPPOE=m
 # CONFIG_SLIP is not set
-# CONFIG_RCPCI is not set
 # CONFIG_SHAPER is not set
 # CONFIG_NETCONSOLE is not set
 
@@ -611,6 +615,9 @@ CONFIG_FS_MBCACHE=y
 CONFIG_REISERFS_FS=m
 # CONFIG_REISERFS_CHECK is not set
 # CONFIG_REISERFS_PROC_INFO is not set
+CONFIG_REISERFS_FS_XATTR=y
+CONFIG_REISERFS_FS_POSIX_ACL=y
+CONFIG_REISERFS_FS_SECURITY=y
 # CONFIG_JFS_FS is not set
 CONFIG_FS_POSIX_ACL=y
 # CONFIG_XFS_FS is not set
@@ -682,7 +689,6 @@ CONFIG_SMB_FS=m
 # CONFIG_CIFS is not set
 # CONFIG_NCP_FS is not set
 # CONFIG_CODA_FS is not set
-# CONFIG_INTERMEZZO_FS is not set
 # CONFIG_AFS_FS is not set
 
 #
@@ -719,6 +725,7 @@ CONFIG_NLS_DEFAULT="iso8859-1"
 # CONFIG_NLS_ISO8859_8 is not set
 # CONFIG_NLS_CODEPAGE_1250 is not set
 # CONFIG_NLS_CODEPAGE_1251 is not set
+# CONFIG_NLS_ASCII is not set
 # CONFIG_NLS_ISO8859_1 is not set
 # CONFIG_NLS_ISO8859_2 is not set
 # CONFIG_NLS_ISO8859_3 is not set
@@ -767,11 +774,14 @@ CONFIG_CRYPTO_AES=y
 # CONFIG_CRYPTO_ARC4 is not set
 CONFIG_CRYPTO_DEFLATE=y
 CONFIG_CRYPTO_MICHAEL_MIC=y
+# CONFIG_CRYPTO_CRC32C is not set
 # CONFIG_CRYPTO_TEST is not set
 
 #
 # Library routines
 #
+CONFIG_CRC16=m
 CONFIG_CRC32=y
+# CONFIG_LIBCRC32C is not set
 CONFIG_ZLIB_INFLATE=y
 CONFIG_ZLIB_DEFLATE=y
diff --git a/arch/mips/configs/pb1550_defconfig b/arch/mips/configs/pb1550_defconfig
index ad953c3a9..519cd8f26 100644
--- a/arch/mips/configs/pb1550_defconfig
+++ b/arch/mips/configs/pb1550_defconfig
@@ -28,6 +28,7 @@ CONFIG_HOTPLUG=y
 # CONFIG_IKCONFIG is not set
 CONFIG_EMBEDDED=y
 CONFIG_KALLSYMS=y
+# CONFIG_KALLSYMS_EXTRA_PASS is not set
 CONFIG_FUTEX=y
 CONFIG_EPOLL=y
 CONFIG_IOSCHED_NOOP=y
@@ -122,6 +123,7 @@ CONFIG_CPU_MIPS32=y
 # CONFIG_CPU_RM9000 is not set
 # CONFIG_CPU_SB1 is not set
 CONFIG_PAGE_SIZE_4KB=y
+# CONFIG_PAGE_SIZE_8KB is not set
 # CONFIG_PAGE_SIZE_16KB is not set
 # CONFIG_PAGE_SIZE_64KB is not set
 CONFIG_CPU_HAS_PREFETCH=y
@@ -136,6 +138,7 @@ CONFIG_CPU_HAS_SYNC=y
 #
 # Bus options (PCI, PCMCIA, EISA, ISA, TC)
 #
+CONFIG_HW_HAS_PCI=y
 CONFIG_PCI=y
 CONFIG_PCI_LEGACY_PROC=y
 CONFIG_PCI_NAMES=y
@@ -147,6 +150,7 @@ CONFIG_MMU=y
 CONFIG_PCMCIA=m
 # CONFIG_PCMCIA_DEBUG is not set
 # CONFIG_YENTA is not set
+CONFIG_PD6729=m
 # CONFIG_I82092 is not set
 # CONFIG_TCIC is not set
 CONFIG_PCMCIA_AU1X00=m
@@ -170,6 +174,7 @@ CONFIG_TRAD_SIGNALS=y
 #
 # Generic Driver Options
 #
+CONFIG_PREVENT_FIRMWARE_BUILD=y
 # CONFIG_FW_LOADER is not set
 
 #
@@ -197,7 +202,7 @@ CONFIG_TRAD_SIGNALS=y
 CONFIG_BLK_DEV_LOOP=y
 # CONFIG_BLK_DEV_CRYPTOLOOP is not set
 # CONFIG_BLK_DEV_NBD is not set
-# CONFIG_BLK_DEV_CARMEL is not set
+# CONFIG_BLK_DEV_SX8 is not set
 # CONFIG_BLK_DEV_RAM is not set
 # CONFIG_LBD is not set
 
@@ -210,9 +215,9 @@ CONFIG_BLK_DEV_IDE=y
 #
 # Please see Documentation/ide.txt for help/info on IDE drives
 #
+# CONFIG_BLK_DEV_IDE_SATA is not set
 CONFIG_BLK_DEV_IDEDISK=y
 # CONFIG_IDEDISK_MULTI_MODE is not set
-# CONFIG_IDEDISK_STROKE is not set
 # CONFIG_BLK_DEV_IDECS is not set
 # CONFIG_BLK_DEV_IDECD is not set
 # CONFIG_BLK_DEV_IDETAPE is not set
@@ -253,6 +258,7 @@ CONFIG_BLK_DEV_HPT366=y
 # CONFIG_BLK_DEV_SLC90E66 is not set
 # CONFIG_BLK_DEV_TRM290 is not set
 # CONFIG_BLK_DEV_VIA82CXXX is not set
+# CONFIG_IDE_ARM is not set
 CONFIG_BLK_DEV_IDEDMA=y
 # CONFIG_IDEDMA_IVB is not set
 # CONFIG_IDEDMA_AUTO is not set
@@ -271,7 +277,6 @@ CONFIG_BLK_DEV_IDEDMA=y
 #
 # Fusion MPT device support
 #
-# CONFIG_FUSION is not set
 
 #
 # IEEE 1394 (FireWire) support
@@ -348,13 +353,13 @@ CONFIG_XFRM=y
 # 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
+# CONFIG_NET_CLS_ROUTE is not set
 
 #
 # Network testing
@@ -451,7 +456,6 @@ CONFIG_PPP_DEFLATE=m
 # CONFIG_PPP_BSDCOMP is not set
 CONFIG_PPPOE=m
 # CONFIG_SLIP is not set
-# CONFIG_RCPCI is not set
 # CONFIG_SHAPER is not set
 # CONFIG_NETCONSOLE is not set
 
@@ -610,6 +614,9 @@ CONFIG_FS_MBCACHE=y
 CONFIG_REISERFS_FS=m
 # CONFIG_REISERFS_CHECK is not set
 # CONFIG_REISERFS_PROC_INFO is not set
+CONFIG_REISERFS_FS_XATTR=y
+CONFIG_REISERFS_FS_POSIX_ACL=y
+CONFIG_REISERFS_FS_SECURITY=y
 # CONFIG_JFS_FS is not set
 CONFIG_FS_POSIX_ACL=y
 # CONFIG_XFS_FS is not set
@@ -681,7 +688,6 @@ CONFIG_SMB_FS=m
 # CONFIG_CIFS is not set
 # CONFIG_NCP_FS is not set
 # CONFIG_CODA_FS is not set
-# CONFIG_INTERMEZZO_FS is not set
 # CONFIG_AFS_FS is not set
 
 #
@@ -718,6 +724,7 @@ CONFIG_NLS_DEFAULT="iso8859-1"
 # CONFIG_NLS_ISO8859_8 is not set
 # CONFIG_NLS_CODEPAGE_1250 is not set
 # CONFIG_NLS_CODEPAGE_1251 is not set
+# CONFIG_NLS_ASCII is not set
 # CONFIG_NLS_ISO8859_1 is not set
 # CONFIG_NLS_ISO8859_2 is not set
 # CONFIG_NLS_ISO8859_3 is not set
@@ -766,11 +773,14 @@ CONFIG_CRYPTO_AES=y
 # CONFIG_CRYPTO_ARC4 is not set
 CONFIG_CRYPTO_DEFLATE=y
 CONFIG_CRYPTO_MICHAEL_MIC=y
+CONFIG_CRYPTO_CRC32C=m
 # CONFIG_CRYPTO_TEST is not set
 
 #
 # Library routines
 #
+CONFIG_CRC16=m
 CONFIG_CRC32=y
+CONFIG_LIBCRC32C=m
 CONFIG_ZLIB_INFLATE=y
 CONFIG_ZLIB_DEFLATE=y
diff --git a/arch/mips/configs/rm200_defconfig b/arch/mips/configs/rm200_defconfig
index 2317b23ed..2ec393280 100644
--- a/arch/mips/configs/rm200_defconfig
+++ b/arch/mips/configs/rm200_defconfig
@@ -21,6 +21,7 @@ CONFIG_SWAP=y
 CONFIG_SYSVIPC=y
 CONFIG_POSIX_MQUEUE=y
 CONFIG_BSD_PROCESS_ACCT=y
+# CONFIG_BSD_PROCESS_ACCT_V3 is not set
 CONFIG_SYSCTL=y
 # CONFIG_AUDIT is not set
 CONFIG_LOG_BUF_SHIFT=14
@@ -29,6 +30,7 @@ CONFIG_IKCONFIG=y
 CONFIG_IKCONFIG_PROC=y
 CONFIG_EMBEDDED=y
 CONFIG_KALLSYMS=y
+# CONFIG_KALLSYMS_EXTRA_PASS is not set
 CONFIG_FUTEX=y
 CONFIG_EPOLL=y
 CONFIG_IOSCHED_NOOP=y
@@ -116,6 +118,7 @@ CONFIG_CPU_R4X00=y
 # CONFIG_CPU_RM9000 is not set
 # CONFIG_CPU_SB1 is not set
 CONFIG_PAGE_SIZE_4KB=y
+# CONFIG_PAGE_SIZE_8KB is not set
 # CONFIG_PAGE_SIZE_16KB is not set
 # CONFIG_PAGE_SIZE_64KB is not set
 # CONFIG_64BIT_PHYS_ADDR is not set
@@ -129,6 +132,7 @@ CONFIG_CPU_HAS_SYNC=y
 #
 # Bus options (PCI, PCMCIA, EISA, ISA, TC)
 #
+CONFIG_HW_HAS_PCI=y
 CONFIG_PCI=y
 CONFIG_PCI_LEGACY_PROC=y
 # CONFIG_PCI_NAMES is not set
@@ -150,6 +154,7 @@ CONFIG_TRAD_SIGNALS=y
 #
 # Generic Driver Options
 #
+CONFIG_PREVENT_FIRMWARE_BUILD=y
 
 #
 # Memory Technology Devices (MTD)
@@ -216,7 +221,7 @@ CONFIG_PARIDE_ON26=m
 CONFIG_BLK_DEV_LOOP=m
 CONFIG_BLK_DEV_CRYPTOLOOP=m
 CONFIG_BLK_DEV_NBD=m
-# CONFIG_BLK_DEV_CARMEL is not set
+# CONFIG_BLK_DEV_SX8 is not set
 CONFIG_BLK_DEV_RAM=m
 CONFIG_BLK_DEV_RAM_SIZE=4096
 # CONFIG_LBD is not set
@@ -246,7 +251,6 @@ CONFIG_BLK_DEV_SR_VENDOR=y
 # Some SCSI devices (e.g. CD jukebox) support multiple LUNs
 #
 # CONFIG_SCSI_MULTI_LUN is not set
-# CONFIG_SCSI_REPORT_LUNS is not set
 CONFIG_SCSI_CONSTANTS=y
 # CONFIG_SCSI_LOGGING is not set
 
@@ -260,6 +264,7 @@ CONFIG_SCSI_SPI_ATTRS=y
 # SCSI low-level drivers
 #
 # CONFIG_BLK_DEV_3W_XXXX_RAID is not set
+# CONFIG_SCSI_3W_9XXX is not set
 # CONFIG_SCSI_7000FASST is not set
 # CONFIG_SCSI_ACARD is not set
 # CONFIG_SCSI_AHA152X is not set
@@ -268,12 +273,11 @@ CONFIG_SCSI_SPI_ATTRS=y
 # CONFIG_SCSI_AIC7XXX is not set
 # CONFIG_SCSI_AIC7XXX_OLD is not set
 # CONFIG_SCSI_AIC79XX is not set
-# CONFIG_SCSI_ADVANSYS is not set
+# CONFIG_SCSI_DPT_I2O is not set
 # CONFIG_SCSI_IN2000 is not set
 # CONFIG_SCSI_MEGARAID is not set
 # CONFIG_SCSI_SATA is not set
 # CONFIG_SCSI_BUSLOGIC is not set
-# CONFIG_SCSI_CPQFCTS is not set
 # CONFIG_SCSI_DMX3191D is not set
 # CONFIG_SCSI_DTC3280 is not set
 # CONFIG_SCSI_EATA is not set
@@ -294,6 +298,7 @@ CONFIG_SCSI_SYM53C8XX_DMA_ADDRESSING_MODE=1
 CONFIG_SCSI_SYM53C8XX_DEFAULT_TAGS=16
 CONFIG_SCSI_SYM53C8XX_MAX_TAGS=64
 # CONFIG_SCSI_SYM53C8XX_IOMAPPED is not set
+# CONFIG_SCSI_IPR is not set
 # CONFIG_SCSI_PAS16 is not set
 # CONFIG_SCSI_PSI240I is not set
 # CONFIG_SCSI_QLOGIC_FAS is not set
@@ -333,6 +338,9 @@ CONFIG_MD_RAID5=m
 CONFIG_MD_MULTIPATH=m
 CONFIG_BLK_DEV_DM=m
 # CONFIG_DM_CRYPT is not set
+# CONFIG_DM_SNAPSHOT is not set
+# CONFIG_DM_MIRROR is not set
+# CONFIG_DM_ZERO is not set
 
 #
 # Fusion MPT device support
@@ -451,6 +459,8 @@ CONFIG_IP_NF_COMPAT_IPCHAINS=m
 CONFIG_IP_NF_COMPAT_IPFWADM=m
 CONFIG_IP_NF_TARGET_NOTRACK=m
 CONFIG_IP_NF_RAW=m
+# CONFIG_IP_NF_MATCH_ADDRTYPE is not set
+# CONFIG_IP_NF_MATCH_REALM is not set
 
 #
 # IPv6: Netfilter Configuration
@@ -524,7 +534,6 @@ CONFIG_DECNET=m
 # 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
 
 #
@@ -552,8 +561,11 @@ CONFIG_NET_CLS_ROUTE4=m
 CONFIG_NET_CLS_ROUTE=y
 CONFIG_NET_CLS_FW=m
 CONFIG_NET_CLS_U32=m
+# CONFIG_CLS_U32_PERF is not set
+# CONFIG_NET_CLS_IND is not set
 CONFIG_NET_CLS_RSVP=m
 CONFIG_NET_CLS_RSVP6=m
+# CONFIG_NET_CLS_ACT is not set
 CONFIG_NET_CLS_POLICE=y
 
 #
@@ -653,6 +665,7 @@ CONFIG_EEPRO100=m
 # CONFIG_SUNDANCE is not set
 # CONFIG_TLAN is not set
 # CONFIG_VIA_RHINE is not set
+# CONFIG_VIA_VELOCITY is not set
 # CONFIG_LAN_SAA9730 is not set
 # CONFIG_NET_POCKET is not set
 
@@ -695,7 +708,6 @@ CONFIG_PLIP=m
 # CONFIG_PPP is not set
 # CONFIG_SLIP is not set
 # CONFIG_NET_FC is not set
-# CONFIG_RCPCI is not set
 # CONFIG_SHAPER is not set
 # CONFIG_NETCONSOLE is not set
 
@@ -879,6 +891,7 @@ CONFIG_USB_ACM=m
 CONFIG_USB_PRINTER=m
 CONFIG_USB_STORAGE=m
 # CONFIG_USB_STORAGE_DEBUG is not set
+# CONFIG_USB_STORAGE_RW_DETECT is not set
 CONFIG_USB_STORAGE_DATAFAB=y
 CONFIG_USB_STORAGE_FREECOM=y
 CONFIG_USB_STORAGE_DPCM=y
@@ -908,6 +921,7 @@ CONFIG_USB_WACOM=m
 CONFIG_USB_KBTAB=m
 CONFIG_USB_POWERMATE=m
 # CONFIG_USB_MTOUCH is not set
+CONFIG_USB_EGALAX=m
 CONFIG_USB_XPAD=m
 # CONFIG_USB_ATI_REMOTE is not set
 
@@ -1016,6 +1030,7 @@ CONFIG_USB_LEGOTOWER=m
 CONFIG_USB_LCD=m
 CONFIG_USB_LED=m
 CONFIG_USB_CYTHERM=m
+CONFIG_USB_PHIDGETSERVO=m
 CONFIG_USB_TEST=m
 
 #
@@ -1051,10 +1066,14 @@ CONFIG_FS_MBCACHE=y
 CONFIG_REISERFS_FS=m
 # CONFIG_REISERFS_CHECK is not set
 # CONFIG_REISERFS_PROC_INFO is not set
+CONFIG_REISERFS_FS_XATTR=y
+CONFIG_REISERFS_FS_POSIX_ACL=y
+CONFIG_REISERFS_FS_SECURITY=y
 CONFIG_JFS_FS=m
 # CONFIG_JFS_POSIX_ACL is not set
 # CONFIG_JFS_DEBUG is not set
 # CONFIG_JFS_STATISTICS is not set
+CONFIG_FS_POSIX_ACL=y
 CONFIG_XFS_FS=m
 # CONFIG_XFS_RT is not set
 CONFIG_XFS_QUOTA=y
@@ -1082,6 +1101,8 @@ CONFIG_UDF_FS=m
 CONFIG_FAT_FS=m
 CONFIG_MSDOS_FS=m
 CONFIG_VFAT_FS=m
+CONFIG_FAT_DEFAULT_CODEPAGE=437
+CONFIG_FAT_DEFAULT_IOCHARSET="iso8859-1"
 CONFIG_NTFS_FS=m
 # CONFIG_NTFS_DEBUG is not set
 # CONFIG_NTFS_RW is not set
@@ -1140,6 +1161,8 @@ CONFIG_RPCSEC_GSS_KRB5=m
 CONFIG_SMB_FS=m
 # CONFIG_SMB_NLS_DEFAULT is not set
 CONFIG_CIFS=m
+# CONFIG_CIFS_STATS is not set
+# CONFIG_CIFS_POSIX is not set
 CONFIG_NCP_FS=m
 CONFIG_NCPFS_PACKET_SIGNING=y
 CONFIG_NCPFS_IOCTL_LOCKING=y
@@ -1151,7 +1174,6 @@ CONFIG_NCPFS_NLS=y
 CONFIG_NCPFS_EXTRAS=y
 CONFIG_CODA_FS=m
 CONFIG_CODA_FS_OLD_API=y
-CONFIG_INTERMEZZO_FS=m
 CONFIG_AFS_FS=m
 CONFIG_RXRPC=m
 
@@ -1170,7 +1192,6 @@ CONFIG_MSDOS_PARTITION=y
 # CONFIG_SOLARIS_X86_PARTITION is not set
 # CONFIG_UNIXWARE_DISKLABEL is not set
 # CONFIG_LDM_PARTITION is not set
-# CONFIG_NEC98_PARTITION is not set
 # CONFIG_SGI_PARTITION is not set
 # CONFIG_ULTRIX_PARTITION is not set
 # CONFIG_SUN_PARTITION is not set
@@ -1204,6 +1225,7 @@ CONFIG_NLS_CODEPAGE_874=m
 CONFIG_NLS_ISO8859_8=m
 CONFIG_NLS_CODEPAGE_1250=m
 CONFIG_NLS_CODEPAGE_1251=m
+# CONFIG_NLS_ASCII is not set
 CONFIG_NLS_ISO8859_1=m
 CONFIG_NLS_ISO8859_2=m
 CONFIG_NLS_ISO8859_3=m
@@ -1252,11 +1274,14 @@ CONFIG_CRYPTO_CAST6=m
 # CONFIG_CRYPTO_ARC4 is not set
 CONFIG_CRYPTO_DEFLATE=m
 CONFIG_CRYPTO_MICHAEL_MIC=m
+# CONFIG_CRYPTO_CRC32C is not set
 CONFIG_CRYPTO_TEST=m
 
 #
 # Library routines
 #
+CONFIG_CRC16=m
 CONFIG_CRC32=y
+# CONFIG_LIBCRC32C is not set
 CONFIG_ZLIB_INFLATE=m
 CONFIG_ZLIB_DEFLATE=m
diff --git a/arch/mips/configs/sb1250-swarm_defconfig b/arch/mips/configs/sb1250-swarm_defconfig
index 593f119b4..41d73cf45 100644
--- a/arch/mips/configs/sb1250-swarm_defconfig
+++ b/arch/mips/configs/sb1250-swarm_defconfig
@@ -27,6 +27,7 @@ CONFIG_LOG_BUF_SHIFT=15
 # CONFIG_IKCONFIG is not set
 CONFIG_EMBEDDED=y
 CONFIG_KALLSYMS=y
+# CONFIG_KALLSYMS_EXTRA_PASS is not set
 CONFIG_FUTEX=y
 CONFIG_EPOLL=y
 CONFIG_IOSCHED_NOOP=y
@@ -93,7 +94,6 @@ CONFIG_CPU_SB1_PASS_1=y
 # CONFIG_CPU_SB1_PASS_4 is not set
 # CONFIG_CPU_SB1_PASS_2_112x is not set
 # CONFIG_CPU_SB1_PASS_3 is not set
-CONFIG_SIBYTE_HAS_PCI=y
 CONFIG_SIBYTE_HAS_LDT=y
 # CONFIG_SIMULATION is not set
 CONFIG_SIBYTE_CFE=y
@@ -107,7 +107,6 @@ CONFIG_RWSEM_GENERIC_SPINLOCK=y
 CONFIG_HAVE_DEC_LOCK=y
 CONFIG_DMA_COHERENT=y
 # CONFIG_CPU_LITTLE_ENDIAN is not set
-CONFIG_DUMMY_KEYB=y
 CONFIG_SWAP_IO_SPACE=y
 CONFIG_BOOT_ELF32=y
 CONFIG_MIPS_L1_CACHE_SHIFT=5
@@ -134,6 +133,7 @@ CONFIG_MIPS_L1_CACHE_SHIFT=5
 # CONFIG_CPU_RM9000 is not set
 CONFIG_CPU_SB1=y
 CONFIG_PAGE_SIZE_4KB=y
+# CONFIG_PAGE_SIZE_8KB is not set
 # CONFIG_PAGE_SIZE_16KB is not set
 # CONFIG_PAGE_SIZE_64KB is not set
 # CONFIG_SIBYTE_DMA_PAGEOPS is not set
@@ -154,6 +154,7 @@ CONFIG_NR_CPUS=2
 #
 # Bus options (PCI, PCMCIA, EISA, ISA, TC)
 #
+CONFIG_HW_HAS_PCI=y
 CONFIG_PCI=y
 CONFIG_PCI_LEGACY_PROC=y
 CONFIG_PCI_NAMES=y
@@ -179,6 +180,7 @@ CONFIG_TRAD_SIGNALS=y
 #
 # Generic Driver Options
 #
+CONFIG_PREVENT_FIRMWARE_BUILD=y
 
 #
 # Memory Technology Devices (MTD)
@@ -204,7 +206,7 @@ CONFIG_TRAD_SIGNALS=y
 # CONFIG_BLK_DEV_UMEM is not set
 # CONFIG_BLK_DEV_LOOP is not set
 # CONFIG_BLK_DEV_NBD is not set
-# CONFIG_BLK_DEV_CARMEL is not set
+# CONFIG_BLK_DEV_SX8 is not set
 CONFIG_BLK_DEV_RAM=y
 CONFIG_BLK_DEV_RAM_SIZE=9220
 CONFIG_BLK_DEV_INITRD=y
@@ -213,7 +215,31 @@ CONFIG_BLK_DEV_INITRD=y
 #
 # ATA/ATAPI/MFM/RLL support
 #
-# CONFIG_IDE is not set
+CONFIG_IDE=y
+CONFIG_BLK_DEV_IDE=y
+
+#
+# Please see Documentation/ide.txt for help/info on IDE drives
+#
+# CONFIG_BLK_DEV_IDE_SATA is not set
+CONFIG_BLK_DEV_IDEDISK=y
+# CONFIG_IDEDISK_MULTI_MODE is not set
+CONFIG_BLK_DEV_IDECD=y
+CONFIG_BLK_DEV_IDETAPE=y
+CONFIG_BLK_DEV_IDEFLOPPY=y
+# CONFIG_IDE_TASK_IOCTL is not set
+# CONFIG_IDE_TASKFILE_IO is not set
+
+#
+# IDE chipset support/bugfixes
+#
+CONFIG_IDE_GENERIC=y
+# CONFIG_BLK_DEV_IDEPCI is not set
+CONFIG_BLK_DEV_IDE_SWARM=y
+# CONFIG_IDE_ARM is not set
+# CONFIG_BLK_DEV_IDEDMA is not set
+# CONFIG_IDEDMA_AUTO is not set
+# CONFIG_BLK_DEV_HD is not set
 
 #
 # SCSI device support
@@ -228,7 +254,6 @@ CONFIG_BLK_DEV_INITRD=y
 #
 # Fusion MPT device support
 #
-# CONFIG_FUSION is not set
 
 #
 # IEEE 1394 (FireWire) support
@@ -288,13 +313,13 @@ CONFIG_XFRM=y
 # 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
+# CONFIG_NET_CLS_ROUTE is not set
 
 #
 # Network testing
@@ -371,7 +396,6 @@ CONFIG_NET_SB1250_MAC=y
 # CONFIG_HIPPI is not set
 # CONFIG_PPP is not set
 # CONFIG_SLIP is not set
-# CONFIG_RCPCI is not set
 # CONFIG_SHAPER is not set
 # CONFIG_NETCONSOLE is not set
 
@@ -575,7 +599,6 @@ CONFIG_SUNRPC=y
 # CONFIG_CIFS is not set
 # CONFIG_NCP_FS is not set
 # CONFIG_CODA_FS is not set
-# CONFIG_INTERMEZZO_FS is not set
 # CONFIG_AFS_FS is not set
 
 #
@@ -623,11 +646,14 @@ CONFIG_CRYPTO_AES=y
 # CONFIG_CRYPTO_ARC4 is not set
 CONFIG_CRYPTO_DEFLATE=y
 CONFIG_CRYPTO_MICHAEL_MIC=y
+# CONFIG_CRYPTO_CRC32C is not set
 # CONFIG_CRYPTO_TEST is not set
 
 #
 # Library routines
 #
+CONFIG_CRC16=m
 CONFIG_CRC32=y
+# CONFIG_LIBCRC32C is not set
 CONFIG_ZLIB_INFLATE=y
 CONFIG_ZLIB_DEFLATE=y
diff --git a/arch/mips/configs/sead_defconfig b/arch/mips/configs/sead_defconfig
index ba93024bf..b641d81e4 100644
--- a/arch/mips/configs/sead_defconfig
+++ b/arch/mips/configs/sead_defconfig
@@ -19,7 +19,6 @@ CONFIG_BROKEN_ON_SMP=y
 #
 CONFIG_SWAP=y
 # CONFIG_SYSVIPC is not set
-# CONFIG_POSIX_MQUEUE is not set
 # CONFIG_BSD_PROCESS_ACCT is not set
 CONFIG_SYSCTL=y
 # CONFIG_AUDIT is not set
@@ -28,6 +27,7 @@ CONFIG_LOG_BUF_SHIFT=14
 # CONFIG_IKCONFIG is not set
 CONFIG_EMBEDDED=y
 CONFIG_KALLSYMS=y
+# CONFIG_KALLSYMS_EXTRA_PASS is not set
 CONFIG_FUTEX=y
 CONFIG_EPOLL=y
 CONFIG_IOSCHED_NOOP=y
@@ -103,6 +103,7 @@ CONFIG_CPU_MIPS32=y
 # CONFIG_CPU_RM9000 is not set
 # CONFIG_CPU_SB1 is not set
 CONFIG_PAGE_SIZE_4KB=y
+# CONFIG_PAGE_SIZE_8KB is not set
 # CONFIG_PAGE_SIZE_16KB is not set
 # CONFIG_PAGE_SIZE_64KB is not set
 CONFIG_CPU_HAS_PREFETCH=y
@@ -139,6 +140,7 @@ CONFIG_EMBEDDED_RAMDISK_IMAGE="ramdisk.gz"
 #
 # Generic Driver Options
 #
+CONFIG_PREVENT_FIRMWARE_BUILD=y
 
 #
 # Memory Technology Devices (MTD)
@@ -428,4 +430,6 @@ CONFIG_CMDLINE=""
 #
 # Library routines
 #
+CONFIG_CRC16=y
 # CONFIG_CRC32 is not set
+# CONFIG_LIBCRC32C is not set
diff --git a/arch/mips/configs/tb0226_defconfig b/arch/mips/configs/tb0226_defconfig
index f32841b80..d942862ad 100644
--- a/arch/mips/configs/tb0226_defconfig
+++ b/arch/mips/configs/tb0226_defconfig
@@ -28,6 +28,7 @@ CONFIG_LOG_BUF_SHIFT=14
 # CONFIG_IKCONFIG is not set
 CONFIG_EMBEDDED=y
 CONFIG_KALLSYMS=y
+# CONFIG_KALLSYMS_EXTRA_PASS is not set
 CONFIG_FUTEX=y
 CONFIG_EPOLL=y
 CONFIG_IOSCHED_NOOP=y
@@ -54,7 +55,6 @@ CONFIG_KMOD=y
 CONFIG_MACH_VR41XX=y
 # CONFIG_CASIO_E55 is not set
 # CONFIG_IBM_WORKPAD is not set
-# CONFIG_NEC_EAGLE is not set
 CONFIG_TANBAC_TB0226=y
 # CONFIG_TANBAC_TB0229 is not set
 # CONFIG_VICTOR_MPC30X is not set
@@ -90,7 +90,6 @@ CONFIG_HAVE_DEC_LOCK=y
 CONFIG_DMA_NONCOHERENT=y
 CONFIG_CPU_LITTLE_ENDIAN=y
 CONFIG_IRQ_CPU=y
-CONFIG_DUMMY_KEYB=y
 CONFIG_MIPS_L1_CACHE_SHIFT=5
 CONFIG_FB=y
 
@@ -115,6 +114,7 @@ CONFIG_CPU_VR41XX=y
 # CONFIG_CPU_RM9000 is not set
 # CONFIG_CPU_SB1 is not set
 CONFIG_PAGE_SIZE_4KB=y
+# CONFIG_PAGE_SIZE_8KB is not set
 # CONFIG_PAGE_SIZE_16KB is not set
 # CONFIG_PAGE_SIZE_64KB is not set
 # CONFIG_CPU_ADVANCED is not set
@@ -125,6 +125,7 @@ CONFIG_CPU_HAS_SYNC=y
 #
 # Bus options (PCI, PCMCIA, EISA, ISA, TC)
 #
+CONFIG_HW_HAS_PCI=y
 # CONFIG_PCI is not set
 CONFIG_MMU=y
 
@@ -142,6 +143,7 @@ CONFIG_TRAD_SIGNALS=y
 #
 # Generic Driver Options
 #
+CONFIG_PREVENT_FIRMWARE_BUILD=y
 
 #
 # Memory Technology Devices (MTD)
@@ -177,9 +179,9 @@ CONFIG_BLK_DEV_IDE=y
 #
 # Please see Documentation/ide.txt for help/info on IDE drives
 #
+# CONFIG_BLK_DEV_IDE_SATA is not set
 CONFIG_BLK_DEV_IDEDISK=y
 CONFIG_IDEDISK_MULTI_MODE=y
-# CONFIG_IDEDISK_STROKE is not set
 # CONFIG_BLK_DEV_IDECD is not set
 # CONFIG_BLK_DEV_IDETAPE is not set
 # CONFIG_BLK_DEV_IDEFLOPPY is not set
@@ -191,6 +193,7 @@ CONFIG_IDE_TASKFILE_IO=y
 # IDE chipset support/bugfixes
 #
 CONFIG_IDE_GENERIC=y
+# CONFIG_IDE_ARM is not set
 # CONFIG_BLK_DEV_IDEDMA is not set
 # CONFIG_IDEDMA_AUTO is not set
 # CONFIG_BLK_DEV_HD is not set
@@ -215,7 +218,6 @@ CONFIG_CHR_DEV_SG=y
 # Some SCSI devices (e.g. CD jukebox) support multiple LUNs
 #
 CONFIG_SCSI_MULTI_LUN=y
-# CONFIG_SCSI_REPORT_LUNS is not set
 CONFIG_SCSI_CONSTANTS=y
 # CONFIG_SCSI_LOGGING is not set
 
@@ -303,13 +305,13 @@ CONFIG_SYN_COOKIES=y
 # 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
+# CONFIG_NET_CLS_ROUTE is not set
 
 #
 # Network testing
@@ -553,6 +555,8 @@ CONFIG_ZISOFS_FS=y
 CONFIG_FAT_FS=m
 CONFIG_MSDOS_FS=m
 CONFIG_VFAT_FS=m
+CONFIG_FAT_DEFAULT_CODEPAGE=437
+CONFIG_FAT_DEFAULT_IOCHARSET="iso8859-1"
 # CONFIG_NTFS_FS is not set
 
 #
@@ -608,7 +612,6 @@ CONFIG_SMB_NLS_REMOTE="cp932"
 # CONFIG_CIFS is not set
 # CONFIG_NCP_FS is not set
 # CONFIG_CODA_FS is not set
-# CONFIG_INTERMEZZO_FS is not set
 # CONFIG_AFS_FS is not set
 
 #
@@ -645,6 +648,7 @@ CONFIG_NLS_CODEPAGE_932=m
 # CONFIG_NLS_ISO8859_8 is not set
 # CONFIG_NLS_CODEPAGE_1250 is not set
 # CONFIG_NLS_CODEPAGE_1251 is not set
+# CONFIG_NLS_ASCII is not set
 CONFIG_NLS_ISO8859_1=m
 # CONFIG_NLS_ISO8859_2 is not set
 # CONFIG_NLS_ISO8859_3 is not set
@@ -680,6 +684,8 @@ CONFIG_CMDLINE=""
 #
 # Library routines
 #
+CONFIG_CRC16=m
 # CONFIG_CRC32 is not set
+# CONFIG_LIBCRC32C is not set
 CONFIG_ZLIB_INFLATE=y
 CONFIG_ZLIB_DEFLATE=m
diff --git a/arch/mips/configs/tb0229_defconfig b/arch/mips/configs/tb0229_defconfig
index 730a994ab..cd08e3c03 100644
--- a/arch/mips/configs/tb0229_defconfig
+++ b/arch/mips/configs/tb0229_defconfig
@@ -28,6 +28,7 @@ CONFIG_LOG_BUF_SHIFT=14
 # CONFIG_IKCONFIG is not set
 CONFIG_EMBEDDED=y
 CONFIG_KALLSYMS=y
+# CONFIG_KALLSYMS_EXTRA_PASS is not set
 CONFIG_FUTEX=y
 CONFIG_EPOLL=y
 CONFIG_IOSCHED_NOOP=y
@@ -54,12 +55,12 @@ CONFIG_KMOD=y
 CONFIG_MACH_VR41XX=y
 # CONFIG_CASIO_E55 is not set
 # CONFIG_IBM_WORKPAD is not set
-# CONFIG_NEC_EAGLE is not set
 # CONFIG_TANBAC_TB0226 is not set
 CONFIG_TANBAC_TB0229=y
 # CONFIG_VICTOR_MPC30X is not set
 # CONFIG_ZAO_CAPCELLA is not set
-# CONFIG_VRC4173 is not set
+CONFIG_PCI_VR41XX=y
+CONFIG_VRC4173=y
 # CONFIG_TOSHIBA_JMR3927 is not set
 # CONFIG_MIPS_COBALT is not set
 # CONFIG_MACH_DECSTATION is not set
@@ -91,7 +92,6 @@ CONFIG_HAVE_DEC_LOCK=y
 CONFIG_DMA_NONCOHERENT=y
 CONFIG_CPU_LITTLE_ENDIAN=y
 CONFIG_IRQ_CPU=y
-CONFIG_DUMMY_KEYB=y
 CONFIG_MIPS_L1_CACHE_SHIFT=5
 # CONFIG_FB is not set
 CONFIG_TANBAC_TB0219=y
@@ -117,6 +117,7 @@ CONFIG_CPU_VR41XX=y
 # CONFIG_CPU_RM9000 is not set
 # CONFIG_CPU_SB1 is not set
 CONFIG_PAGE_SIZE_4KB=y
+# CONFIG_PAGE_SIZE_8KB is not set
 # CONFIG_PAGE_SIZE_16KB is not set
 # CONFIG_PAGE_SIZE_64KB is not set
 # CONFIG_CPU_ADVANCED is not set
@@ -127,6 +128,7 @@ CONFIG_CPU_HAS_SYNC=y
 #
 # Bus options (PCI, PCMCIA, EISA, ISA, TC)
 #
+CONFIG_HW_HAS_PCI=y
 CONFIG_PCI=y
 CONFIG_PCI_LEGACY_PROC=y
 CONFIG_PCI_NAMES=y
@@ -146,6 +148,7 @@ CONFIG_TRAD_SIGNALS=y
 #
 # Generic Driver Options
 #
+CONFIG_PREVENT_FIRMWARE_BUILD=y
 
 #
 # Memory Technology Devices (MTD)
@@ -172,7 +175,7 @@ CONFIG_TRAD_SIGNALS=y
 CONFIG_BLK_DEV_LOOP=m
 # CONFIG_BLK_DEV_CRYPTOLOOP is not set
 CONFIG_BLK_DEV_NBD=m
-# CONFIG_BLK_DEV_CARMEL is not set
+# CONFIG_BLK_DEV_SX8 is not set
 CONFIG_BLK_DEV_RAM=y
 CONFIG_BLK_DEV_RAM_SIZE=4096
 # CONFIG_BLK_DEV_INITRD is not set
@@ -196,7 +199,6 @@ CONFIG_BLK_DEV_RAM_SIZE=4096
 #
 # Fusion MPT device support
 #
-# CONFIG_FUSION is not set
 
 #
 # IEEE 1394 (FireWire) support
@@ -263,13 +265,13 @@ CONFIG_XFRM=y
 # 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
+# CONFIG_NET_CLS_ROUTE is not set
 
 #
 # Network testing
@@ -355,7 +357,6 @@ CONFIG_SLIP=m
 CONFIG_SLIP_COMPRESSED=y
 CONFIG_SLIP_SMART=y
 CONFIG_SLIP_MODE_SLIP6=y
-# CONFIG_RCPCI is not set
 # CONFIG_SHAPER is not set
 # CONFIG_NETCONSOLE is not set
 
@@ -544,6 +545,8 @@ CONFIG_ZISOFS_FS=y
 CONFIG_FAT_FS=m
 CONFIG_MSDOS_FS=m
 CONFIG_VFAT_FS=m
+CONFIG_FAT_DEFAULT_CODEPAGE=437
+CONFIG_FAT_DEFAULT_IOCHARSET="iso8859-1"
 # CONFIG_NTFS_FS is not set
 
 #
@@ -599,7 +602,6 @@ CONFIG_SMB_NLS_REMOTE="cp932"
 # CONFIG_CIFS is not set
 # CONFIG_NCP_FS is not set
 # CONFIG_CODA_FS is not set
-# CONFIG_INTERMEZZO_FS is not set
 # CONFIG_AFS_FS is not set
 
 #
@@ -636,6 +638,7 @@ CONFIG_NLS_CODEPAGE_932=m
 # CONFIG_NLS_ISO8859_8 is not set
 # CONFIG_NLS_CODEPAGE_1250 is not set
 # CONFIG_NLS_CODEPAGE_1251 is not set
+# CONFIG_NLS_ASCII is not set
 CONFIG_NLS_ISO8859_1=m
 # CONFIG_NLS_ISO8859_2 is not set
 # CONFIG_NLS_ISO8859_3 is not set
@@ -671,6 +674,8 @@ CONFIG_CMDLINE=""
 #
 # Library routines
 #
+CONFIG_CRC16=m
 # CONFIG_CRC32 is not set
+# CONFIG_LIBCRC32C is not set
 CONFIG_ZLIB_INFLATE=y
 CONFIG_ZLIB_DEFLATE=m
diff --git a/arch/mips/configs/workpad_defconfig b/arch/mips/configs/workpad_defconfig
index cfe12d1c4..e0bc0d0b2 100644
--- a/arch/mips/configs/workpad_defconfig
+++ b/arch/mips/configs/workpad_defconfig
@@ -28,6 +28,7 @@ CONFIG_LOG_BUF_SHIFT=14
 # CONFIG_IKCONFIG is not set
 CONFIG_EMBEDDED=y
 CONFIG_KALLSYMS=y
+# CONFIG_KALLSYMS_EXTRA_PASS is not set
 CONFIG_FUTEX=y
 CONFIG_EPOLL=y
 CONFIG_IOSCHED_NOOP=y
@@ -54,7 +55,6 @@ CONFIG_KMOD=y
 CONFIG_MACH_VR41XX=y
 # CONFIG_CASIO_E55 is not set
 CONFIG_IBM_WORKPAD=y
-# CONFIG_NEC_EAGLE is not set
 # CONFIG_TANBAC_TB0226 is not set
 # CONFIG_TANBAC_TB0229 is not set
 # CONFIG_VICTOR_MPC30X is not set
@@ -115,6 +115,7 @@ CONFIG_CPU_VR41XX=y
 # CONFIG_CPU_RM9000 is not set
 # CONFIG_CPU_SB1 is not set
 CONFIG_PAGE_SIZE_4KB=y
+# CONFIG_PAGE_SIZE_8KB is not set
 # CONFIG_PAGE_SIZE_16KB is not set
 # CONFIG_PAGE_SIZE_64KB is not set
 # CONFIG_CPU_ADVANCED is not set
@@ -142,6 +143,7 @@ CONFIG_TRAD_SIGNALS=y
 #
 # Generic Driver Options
 #
+CONFIG_PREVENT_FIRMWARE_BUILD=y
 
 #
 # Memory Technology Devices (MTD)
@@ -177,9 +179,9 @@ CONFIG_BLK_DEV_IDE=y
 #
 # Please see Documentation/ide.txt for help/info on IDE drives
 #
+# CONFIG_BLK_DEV_IDE_SATA is not set
 CONFIG_BLK_DEV_IDEDISK=y
 # CONFIG_IDEDISK_MULTI_MODE is not set
-# CONFIG_IDEDISK_STROKE is not set
 # CONFIG_BLK_DEV_IDECD is not set
 # CONFIG_BLK_DEV_IDETAPE is not set
 # CONFIG_BLK_DEV_IDEFLOPPY is not set
@@ -190,6 +192,7 @@ CONFIG_IDE_TASKFILE_IO=y
 # IDE chipset support/bugfixes
 #
 CONFIG_IDE_GENERIC=y
+# CONFIG_IDE_ARM is not set
 # CONFIG_IDE_CHIPSETS is not set
 # CONFIG_BLK_DEV_IDEDMA is not set
 # CONFIG_IDEDMA_AUTO is not set
@@ -269,13 +272,13 @@ CONFIG_XFRM=y
 # 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
+# CONFIG_NET_CLS_ROUTE is not set
 
 #
 # Network testing
@@ -573,7 +576,6 @@ CONFIG_SUNRPC=y
 # CONFIG_CIFS is not set
 # CONFIG_NCP_FS is not set
 # CONFIG_CODA_FS is not set
-# CONFIG_INTERMEZZO_FS is not set
 # CONFIG_AFS_FS is not set
 
 #
@@ -607,4 +609,6 @@ CONFIG_CMDLINE=""
 #
 # Library routines
 #
+CONFIG_CRC16=m
 # CONFIG_CRC32 is not set
+# CONFIG_LIBCRC32C is not set
diff --git a/arch/mips/configs/xxs1500_defconfig b/arch/mips/configs/xxs1500_defconfig
index edf9ced7a..37fef7b60 100644
--- a/arch/mips/configs/xxs1500_defconfig
+++ b/arch/mips/configs/xxs1500_defconfig
@@ -28,6 +28,7 @@ CONFIG_HOTPLUG=y
 # CONFIG_IKCONFIG is not set
 CONFIG_EMBEDDED=y
 CONFIG_KALLSYMS=y
+# CONFIG_KALLSYMS_EXTRA_PASS is not set
 CONFIG_FUTEX=y
 CONFIG_EPOLL=y
 CONFIG_IOSCHED_NOOP=y
@@ -105,6 +106,7 @@ CONFIG_CPU_MIPS32=y
 # CONFIG_CPU_RM9000 is not set
 # CONFIG_CPU_SB1 is not set
 CONFIG_PAGE_SIZE_4KB=y
+# CONFIG_PAGE_SIZE_8KB is not set
 # CONFIG_PAGE_SIZE_16KB is not set
 # CONFIG_PAGE_SIZE_64KB is not set
 CONFIG_CPU_HAS_PREFETCH=y
@@ -146,6 +148,7 @@ CONFIG_TRAD_SIGNALS=y
 #
 # Generic Driver Options
 #
+CONFIG_PREVENT_FIRMWARE_BUILD=y
 # CONFIG_FW_LOADER is not set
 
 #
@@ -265,13 +268,13 @@ CONFIG_XFRM=y
 # 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
+# CONFIG_NET_CLS_ROUTE is not set
 
 #
 # Network testing
@@ -496,6 +499,9 @@ CONFIG_FS_MBCACHE=y
 CONFIG_REISERFS_FS=m
 # CONFIG_REISERFS_CHECK is not set
 # CONFIG_REISERFS_PROC_INFO is not set
+CONFIG_REISERFS_FS_XATTR=y
+CONFIG_REISERFS_FS_POSIX_ACL=y
+CONFIG_REISERFS_FS_SECURITY=y
 # CONFIG_JFS_FS is not set
 CONFIG_FS_POSIX_ACL=y
 # CONFIG_XFS_FS is not set
@@ -567,7 +573,6 @@ CONFIG_SMB_FS=m
 # CONFIG_CIFS is not set
 # CONFIG_NCP_FS is not set
 # CONFIG_CODA_FS is not set
-# CONFIG_INTERMEZZO_FS is not set
 # CONFIG_AFS_FS is not set
 
 #
@@ -604,6 +609,7 @@ CONFIG_NLS_DEFAULT="iso8859-1"
 # CONFIG_NLS_ISO8859_8 is not set
 # CONFIG_NLS_CODEPAGE_1250 is not set
 # CONFIG_NLS_CODEPAGE_1251 is not set
+# CONFIG_NLS_ASCII is not set
 # CONFIG_NLS_ISO8859_1 is not set
 # CONFIG_NLS_ISO8859_2 is not set
 # CONFIG_NLS_ISO8859_3 is not set
@@ -652,11 +658,14 @@ CONFIG_CRYPTO_AES=y
 # CONFIG_CRYPTO_ARC4 is not set
 CONFIG_CRYPTO_DEFLATE=y
 CONFIG_CRYPTO_MICHAEL_MIC=y
+# CONFIG_CRYPTO_CRC32C is not set
 # CONFIG_CRYPTO_TEST is not set
 
 #
 # Library routines
 #
+CONFIG_CRC16=m
 CONFIG_CRC32=y
+# CONFIG_LIBCRC32C is not set
 CONFIG_ZLIB_INFLATE=y
 CONFIG_ZLIB_DEFLATE=y
diff --git a/arch/mips/configs/yosemite_defconfig b/arch/mips/configs/yosemite_defconfig
index fc1eddbbd..bf259d809 100644
--- a/arch/mips/configs/yosemite_defconfig
+++ b/arch/mips/configs/yosemite_defconfig
@@ -9,25 +9,26 @@ CONFIG_MIPS32=y
 #
 # Code maturity level options
 #
-CONFIG_EXPERIMENTAL=y
+# CONFIG_EXPERIMENTAL is not set
 CONFIG_CLEAN_COMPILE=y
 CONFIG_STANDALONE=y
+CONFIG_BROKEN_ON_SMP=y
 
 #
 # General setup
 #
 CONFIG_SWAP=y
 CONFIG_SYSVIPC=y
-# CONFIG_POSIX_MQUEUE is not set
 # CONFIG_BSD_PROCESS_ACCT is not set
 CONFIG_SYSCTL=y
 # CONFIG_AUDIT is not set
-CONFIG_LOG_BUF_SHIFT=15
+CONFIG_LOG_BUF_SHIFT=14
 # CONFIG_HOTPLUG is not set
 CONFIG_IKCONFIG=y
 CONFIG_IKCONFIG_PROC=y
 CONFIG_EMBEDDED=y
 CONFIG_KALLSYMS=y
+# CONFIG_KALLSYMS_EXTRA_PASS is not set
 CONFIG_FUTEX=y
 CONFIG_EPOLL=y
 CONFIG_IOSCHED_NOOP=y
@@ -41,47 +42,40 @@ CONFIG_IOSCHED_CFQ=y
 #
 CONFIG_MODULES=y
 CONFIG_MODULE_UNLOAD=y
-# CONFIG_MODULE_FORCE_UNLOAD is not set
 CONFIG_OBSOLETE_MODPARM=y
-CONFIG_MODVERSIONS=y
 CONFIG_KMOD=y
-CONFIG_STOP_MACHINE=y
 
 #
 # Machine selection
 #
 # CONFIG_MACH_JAZZ is not set
-# CONFIG_BAGET_MIPS is not set
 # CONFIG_MACH_VR41XX is not set
 # CONFIG_TOSHIBA_JMR3927 is not set
-# CONFIG_MIPS_COBALT is not set
 # CONFIG_MACH_DECSTATION is not set
-# CONFIG_MIPS_EV64120 is not set
-# CONFIG_MIPS_EV96100 is not set
 # CONFIG_MIPS_IVR is not set
 # CONFIG_LASAT is not set
 # CONFIG_MIPS_ITE8172 is not set
 # CONFIG_MIPS_ATLAS is not set
 # CONFIG_MIPS_MALTA is not set
-# CONFIG_MIPS_SEAD is not set
 # CONFIG_MOMENCO_OCELOT is not set
 # CONFIG_MOMENCO_OCELOT_G is not set
 # CONFIG_MOMENCO_OCELOT_C is not set
 # CONFIG_MOMENCO_JAGUAR_ATX is not set
-# CONFIG_PMC_YOSEMITE is not set
-# CONFIG_DDB5074 is not set
+CONFIG_PMC_YOSEMITE=y
+# CONFIG_HYPERTRANSPORT is not set
 # CONFIG_DDB5476 is not set
 # CONFIG_DDB5477 is not set
 # CONFIG_NEC_OSPREY is not set
 # CONFIG_SGI_IP22 is not set
-# CONFIG_SGI_IP32 is not set
 # CONFIG_SOC_AU1X00 is not set
-# CONFIG_SIBYTE_SB1xxx_SOC is not set
 # CONFIG_SNI_RM200_PCI is not set
 # CONFIG_TOSHIBA_RBTX4927 is not set
 CONFIG_RWSEM_GENERIC_SPINLOCK=y
 CONFIG_HAVE_DEC_LOCK=y
+CONFIG_DMA_COHERENT=y
 # CONFIG_CPU_LITTLE_ENDIAN is not set
+CONFIG_IRQ_CPU=y
+CONFIG_IRQ_CPU_RM7K=y
 CONFIG_MIPS_L1_CACHE_SHIFT=5
 # CONFIG_FB is not set
 
@@ -106,6 +100,7 @@ CONFIG_MIPS_L1_CACHE_SHIFT=5
 CONFIG_CPU_RM9000=y
 # CONFIG_CPU_SB1 is not set
 CONFIG_PAGE_SIZE_4KB=y
+# CONFIG_PAGE_SIZE_8KB is not set
 # CONFIG_PAGE_SIZE_16KB is not set
 # CONFIG_PAGE_SIZE_64KB is not set
 CONFIG_CPU_HAS_PREFETCH=y
@@ -114,15 +109,18 @@ CONFIG_CPU_HAS_PREFETCH=y
 CONFIG_CPU_HAS_LLSC=y
 CONFIG_CPU_HAS_LLDSCD=y
 CONFIG_CPU_HAS_SYNC=y
-# CONFIG_HIGHMEM is not set
-CONFIG_SMP=y
-CONFIG_NR_CPUS=2
+CONFIG_HIGHMEM=y
+# CONFIG_SMP is not set
 # CONFIG_PREEMPT is not set
 # CONFIG_DEBUG_SPINLOCK_SLEEP is not set
 
 #
 # Bus options (PCI, PCMCIA, EISA, ISA, TC)
 #
+CONFIG_HW_HAS_PCI=y
+CONFIG_PCI=y
+CONFIG_PCI_LEGACY_PROC=y
+CONFIG_PCI_NAMES=y
 CONFIG_MMU=y
 
 #
@@ -140,6 +138,7 @@ CONFIG_TRAD_SIGNALS=y
 #
 # Generic Driver Options
 #
+CONFIG_PREVENT_FIRMWARE_BUILD=y
 
 #
 # Memory Technology Devices (MTD)
@@ -159,11 +158,14 @@ CONFIG_TRAD_SIGNALS=y
 # Block devices
 #
 # CONFIG_BLK_DEV_FD is not set
-CONFIG_BLK_DEV_LOOP=y
-# CONFIG_BLK_DEV_CRYPTOLOOP 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_SX8 is not set
 # CONFIG_BLK_DEV_RAM is not set
-CONFIG_LBD=y
+# CONFIG_LBD is not set
 
 #
 # ATA/ATAPI/MFM/RLL support
@@ -173,40 +175,7 @@ CONFIG_LBD=y
 #
 # SCSI device support
 #
-CONFIG_SCSI=y
-CONFIG_SCSI_PROC_FS=y
-
-#
-# SCSI support type (disk, tape, CD-ROM)
-#
-CONFIG_BLK_DEV_SD=y
-# CONFIG_CHR_DEV_ST is not set
-# CONFIG_CHR_DEV_OSST is not set
-CONFIG_BLK_DEV_SR=y
-# CONFIG_BLK_DEV_SR_VENDOR is not set
-CONFIG_CHR_DEV_SG=y
-
-#
-# Some SCSI devices (e.g. CD jukebox) support multiple LUNs
-#
-# CONFIG_SCSI_MULTI_LUN is not set
-CONFIG_SCSI_REPORT_LUNS=y
-# CONFIG_SCSI_CONSTANTS is not set
-# CONFIG_SCSI_LOGGING is not set
-
-#
-# SCSI Transport Attributes
-#
-# CONFIG_SCSI_SPI_ATTRS is not set
-# CONFIG_SCSI_FC_ATTRS is not set
-
-#
-# SCSI low-level drivers
-#
-# CONFIG_SCSI_AIC7XXX_OLD is not set
-# CONFIG_SCSI_SATA is not set
-# CONFIG_SCSI_EATA_PIO is not set
-# CONFIG_SCSI_DEBUG is not set
+# CONFIG_SCSI is not set
 
 #
 # Multi-device support (RAID and LVM)
@@ -225,6 +194,7 @@ CONFIG_SCSI_REPORT_LUNS=y
 #
 # I2O device support
 #
+# CONFIG_I2O is not set
 
 #
 # Networking support
@@ -234,51 +204,37 @@ CONFIG_NET=y
 #
 # Networking options
 #
-CONFIG_PACKET=y
+CONFIG_PACKET=m
 CONFIG_PACKET_MMAP=y
-# CONFIG_NETLINK_DEV is not set
+CONFIG_NETLINK_DEV=m
 CONFIG_UNIX=y
 # CONFIG_NET_KEY is not set
 CONFIG_INET=y
 # CONFIG_IP_MULTICAST is not set
 # CONFIG_IP_ADVANCED_ROUTER is not set
 CONFIG_IP_PNP=y
-CONFIG_IP_PNP_DHCP=y
-# CONFIG_IP_PNP_BOOTP is not set
+# 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_ARPD is not set
 # CONFIG_SYN_COOKIES is not set
 # CONFIG_INET_AH is not set
 # CONFIG_INET_ESP is not set
 # CONFIG_INET_IPCOMP is not set
-# CONFIG_IPV6 is not set
 # CONFIG_NETFILTER is not set
-
-#
-# SCTP Configuration (EXPERIMENTAL)
-#
-# CONFIG_IP_SCTP is not set
-# CONFIG_ATM is not set
 # CONFIG_BRIDGE is not set
 # CONFIG_VLAN_8021Q is not set
 # CONFIG_DECNET is not set
 # CONFIG_LLC2 is not set
 # CONFIG_IPX is not set
 # CONFIG_ATALK is not set
-# CONFIG_X25 is not set
-# CONFIG_LAPB is not set
-# CONFIG_NET_DIVERT is not set
-# CONFIG_ECONET is not set
-# CONFIG_WAN_ROUTER is not set
-# CONFIG_NET_FASTROUTE is not set
-# CONFIG_NET_HW_FLOWCONTROL is not set
 
 #
 # QoS and/or fair queueing
 #
 # CONFIG_NET_SCHED is not set
+# CONFIG_NET_CLS_ROUTE is not set
 
 #
 # Network testing
@@ -295,23 +251,50 @@ CONFIG_NETDEVICES=y
 # CONFIG_EQUALIZER is not set
 # CONFIG_TUN is not set
 
+#
+# ARCnet devices
+#
+# CONFIG_ARCNET is not set
+
 #
 # Ethernet (10 or 100Mbit)
 #
 CONFIG_NET_ETHERNET=y
-# CONFIG_MII is not set
+CONFIG_MII=y
+# CONFIG_HAPPYMEAL is not set
+# CONFIG_SUNGEM is not set
+# CONFIG_NET_VENDOR_3COM is not set
+
+#
+# Tulip family network device support
+#
+# CONFIG_NET_TULIP is not set
+# CONFIG_HP100 is not set
+# CONFIG_NET_PCI is not set
 
 #
 # Ethernet (1000 Mbit)
 #
+# CONFIG_ACENIC is not set
+# CONFIG_DL2K is not set
+# CONFIG_E1000 is not set
+# CONFIG_NS83820 is not set
+# CONFIG_HAMACHI is not set
+# CONFIG_R8169 is not set
+# CONFIG_SK98LIN is not set
+# CONFIG_TIGON3 is not set
+CONFIG_TITAN_GE=y
 
 #
 # Ethernet (10000 Mbit)
 #
+# CONFIG_IXGB is not set
+# CONFIG_S2IO is not set
 
 #
 # Token Ring devices
 #
+# CONFIG_TR is not set
 
 #
 # Wireless LAN (non-hamradio)
@@ -322,10 +305,9 @@ CONFIG_NET_ETHERNET=y
 # Wan interfaces
 #
 # CONFIG_WAN is not set
+# CONFIG_FDDI is not set
 # CONFIG_PPP is not set
 # CONFIG_SLIP is not set
-# CONFIG_SHAPER is not set
-# CONFIG_NETCONSOLE is not set
 
 #
 # ISDN subsystem
@@ -351,10 +333,8 @@ CONFIG_NET_ETHERNET=y
 #
 # CONFIG_GAMEPORT is not set
 CONFIG_SOUND_GAMEPORT=y
-CONFIG_SERIO=y
-CONFIG_SERIO_I8042=y
-CONFIG_SERIO_SERPORT=y
-# CONFIG_SERIO_CT82C710 is not set
+# CONFIG_SERIO is not set
+# CONFIG_SERIO_I8042 is not set
 
 #
 # Input Device Drivers
@@ -364,22 +344,21 @@ CONFIG_SERIO_SERPORT=y
 # Character devices
 #
 # CONFIG_VT is not set
-CONFIG_SERIAL_NONSTANDARD=y
-# CONFIG_ROCKETPORT is not set
-# CONFIG_CYCLADES is not set
-# CONFIG_SYNCLINK is not set
-# CONFIG_SYNCLINKMP is not set
-# CONFIG_N_HDLC is not set
-# CONFIG_STALDRV is not set
+# CONFIG_SERIAL_NONSTANDARD is not set
 
 #
 # Serial drivers
 #
-# CONFIG_SERIAL_8250 is not set
+CONFIG_SERIAL_8250=y
+CONFIG_SERIAL_8250_CONSOLE=y
+CONFIG_SERIAL_8250_NR_UARTS=4
+# CONFIG_SERIAL_8250_EXTENDED is not set
 
 #
 # Non-8250 serial port support
 #
+CONFIG_SERIAL_CORE=y
+CONFIG_SERIAL_CORE_CONSOLE=y
 CONFIG_UNIX98_PTYS=y
 CONFIG_LEGACY_PTYS=y
 CONFIG_LEGACY_PTY_COUNT=256
@@ -403,6 +382,7 @@ CONFIG_LEGACY_PTY_COUNT=256
 #
 # Ftape, the floppy tape device driver
 #
+# CONFIG_FTAPE is not set
 # CONFIG_AGP is not set
 # CONFIG_DRM is not set
 # CONFIG_RAW_DRIVER is not set
@@ -438,6 +418,7 @@ CONFIG_LEGACY_PTY_COUNT=256
 #
 # USB support
 #
+# CONFIG_USB is not set
 
 #
 # USB Gadget Support
@@ -448,13 +429,8 @@ CONFIG_LEGACY_PTY_COUNT=256
 # File systems
 #
 # CONFIG_EXT2_FS is not set
-CONFIG_EXT3_FS=y
-CONFIG_EXT3_FS_XATTR=y
-# CONFIG_EXT3_FS_POSIX_ACL is not set
-# CONFIG_EXT3_FS_SECURITY is not set
-CONFIG_JBD=y
-# CONFIG_JBD_DEBUG is not set
-CONFIG_FS_MBCACHE=y
+# CONFIG_EXT3_FS is not set
+# CONFIG_JBD is not set
 # CONFIG_REISERFS_FS is not set
 # CONFIG_JFS_FS is not set
 # CONFIG_XFS_FS is not set
@@ -482,7 +458,6 @@ CONFIG_FS_MBCACHE=y
 CONFIG_PROC_FS=y
 CONFIG_PROC_KCORE=y
 CONFIG_SYSFS=y
-# CONFIG_DEVFS_FS is not set
 # CONFIG_DEVPTS_FS_XATTR is not set
 CONFIG_TMPFS=y
 # CONFIG_HUGETLB_PAGE is not set
@@ -491,13 +466,7 @@ CONFIG_RAMFS=y
 #
 # Miscellaneous filesystems
 #
-# CONFIG_ADFS_FS is not set
-# CONFIG_AFFS_FS is not set
-# CONFIG_HFS_FS is not set
 # CONFIG_HFSPLUS_FS is not set
-# CONFIG_BEFS_FS is not set
-# CONFIG_BFS_FS is not set
-# CONFIG_EFS_FS is not set
 # CONFIG_CRAMFS is not set
 # CONFIG_VXFS_FS is not set
 # CONFIG_HPFS_FS is not set
@@ -509,22 +478,16 @@ CONFIG_RAMFS=y
 # Network File Systems
 #
 CONFIG_NFS_FS=y
-CONFIG_NFS_V3=y
-# CONFIG_NFS_V4 is not set
-# CONFIG_NFS_DIRECTIO is not set
+# CONFIG_NFS_V3 is not set
 # CONFIG_NFSD is not set
 CONFIG_ROOT_NFS=y
 CONFIG_LOCKD=y
-CONFIG_LOCKD_V4=y
 # CONFIG_EXPORTFS is not set
 CONFIG_SUNRPC=y
-# CONFIG_RPCSEC_GSS_KRB5 is not set
 # CONFIG_SMB_FS is not set
 # CONFIG_CIFS is not set
 # CONFIG_NCP_FS is not set
 # CONFIG_CODA_FS is not set
-# CONFIG_INTERMEZZO_FS is not set
-# CONFIG_AFS_FS is not set
 
 #
 # Partition Types
@@ -557,4 +520,6 @@ CONFIG_CMDLINE=""
 #
 # Library routines
 #
+CONFIG_CRC16=m
 # CONFIG_CRC32 is not set
+# CONFIG_LIBCRC32C is not set
diff --git a/arch/mips/ddb5xxx/ddb5074/irq.c b/arch/mips/ddb5xxx/ddb5074/irq.c
index dc4e64349..547386de4 100644
--- a/arch/mips/ddb5xxx/ddb5074/irq.c
+++ b/arch/mips/ddb5xxx/ddb5074/irq.c
@@ -24,7 +24,7 @@
 
 extern asmlinkage void ddbIRQ(void);
 
-static struct irqaction irq_cascade = { no_action, 0, 0, "cascade", NULL, NULL };
+static struct irqaction irq_cascade = { no_action, 0, CPU_MASK_NONE, "cascade", NULL, NULL };
 
 #define M1543_PNP_CONFIG	0x03f0	/* PnP Config Port */
 #define M1543_PNP_INDEX		0x03f0	/* PnP Index Port */
diff --git a/arch/mips/ddb5xxx/ddb5476/irq.c b/arch/mips/ddb5xxx/ddb5476/irq.c
index 58e794f01..6a1202aec 100644
--- a/arch/mips/ddb5xxx/ddb5476/irq.c
+++ b/arch/mips/ddb5xxx/ddb5476/irq.c
@@ -107,8 +107,8 @@ static void nile4_irq_setup(void)
 	/* memory resource acquire in ddb_setup */
 }
 
-static struct irqaction irq_cascade = { no_action, 0, 0, "cascade", NULL, NULL };
-static struct irqaction irq_error = { no_action, 0, 0, "error", NULL, NULL };
+static struct irqaction irq_cascade = { no_action, 0, CPU_MASK_NONE, "cascade", NULL, NULL };
+static struct irqaction irq_error = { no_action, 0, CPU_MASK_NONE, "error", NULL, NULL };
 
 extern asmlinkage void ddb5476_handle_int(void);
 extern int setup_irq(unsigned int irq, struct irqaction *irqaction);
diff --git a/arch/mips/ddb5xxx/ddb5477/irq.c b/arch/mips/ddb5xxx/ddb5477/irq.c
index 0ae83365f..dfc2559aa 100644
--- a/arch/mips/ddb5xxx/ddb5477/irq.c
+++ b/arch/mips/ddb5xxx/ddb5477/irq.c
@@ -77,7 +77,7 @@ extern void vrc5477_irq_init(u32 base);
 extern void mips_cpu_irq_init(u32 base);
 extern asmlinkage void ddb5477_handle_int(void);
 extern int setup_irq(unsigned int irq, struct irqaction *irqaction);  
-static struct irqaction irq_cascade = { no_action, 0, 0, "cascade", NULL, NULL };
+static struct irqaction irq_cascade = { no_action, 0, CPU_MASK_NONE, "cascade", NULL, NULL };
 
 void
 ddb5477_irq_setup(void)
diff --git a/arch/mips/defconfig b/arch/mips/defconfig
index bbd6215cc..8bc7792d6 100644
--- a/arch/mips/defconfig
+++ b/arch/mips/defconfig
@@ -29,6 +29,7 @@ CONFIG_IKCONFIG=y
 CONFIG_IKCONFIG_PROC=y
 CONFIG_EMBEDDED=y
 CONFIG_KALLSYMS=y
+# CONFIG_KALLSYMS_EXTRA_PASS is not set
 CONFIG_FUTEX=y
 CONFIG_EPOLL=y
 CONFIG_IOSCHED_NOOP=y
@@ -114,6 +115,7 @@ CONFIG_CPU_R5000=y
 # CONFIG_CPU_RM9000 is not set
 # CONFIG_CPU_SB1 is not set
 CONFIG_PAGE_SIZE_4KB=y
+# CONFIG_PAGE_SIZE_8KB is not set
 # CONFIG_PAGE_SIZE_16KB is not set
 # CONFIG_PAGE_SIZE_64KB is not set
 CONFIG_BOARD_SCACHE=y
@@ -147,6 +149,7 @@ CONFIG_BINFMT_IRIX=y
 #
 # Generic Driver Options
 #
+CONFIG_PREVENT_FIRMWARE_BUILD=y
 
 #
 # Memory Technology Devices (MTD)
@@ -196,7 +199,6 @@ CONFIG_BLK_DEV_SR=y
 # Some SCSI devices (e.g. CD jukebox) support multiple LUNs
 #
 # CONFIG_SCSI_MULTI_LUN is not set
-# CONFIG_SCSI_REPORT_LUNS is not set
 CONFIG_SCSI_CONSTANTS=y
 # CONFIG_SCSI_LOGGING is not set
 
@@ -362,6 +364,8 @@ CONFIG_IP_NF_COMPAT_IPCHAINS=m
 CONFIG_IP_NF_COMPAT_IPFWADM=m
 CONFIG_IP_NF_TARGET_NOTRACK=m
 CONFIG_IP_NF_RAW=m
+CONFIG_IP_NF_MATCH_ADDRTYPE=m
+CONFIG_IP_NF_MATCH_REALM=m
 
 #
 # IPv6: Netfilter Configuration
@@ -410,7 +414,6 @@ CONFIG_SCTP_HMAC_MD5=y
 CONFIG_NET_DIVERT=y
 # CONFIG_ECONET is not set
 # CONFIG_WAN_ROUTER is not set
-# CONFIG_NET_FASTROUTE is not set
 # CONFIG_NET_HW_FLOWCONTROL is not set
 
 #
@@ -438,8 +441,11 @@ CONFIG_NET_CLS_ROUTE4=m
 CONFIG_NET_CLS_ROUTE=y
 CONFIG_NET_CLS_FW=m
 CONFIG_NET_CLS_U32=m
+# CONFIG_CLS_U32_PERF is not set
+# CONFIG_NET_CLS_IND is not set
 CONFIG_NET_CLS_RSVP=m
 CONFIG_NET_CLS_RSVP6=m
+# CONFIG_NET_CLS_ACT is not set
 CONFIG_NET_CLS_POLICE=y
 
 #
@@ -583,7 +589,7 @@ CONFIG_WATCHDOG=y
 CONFIG_INDYDOG=m
 # CONFIG_RTC is not set
 # CONFIG_GEN_RTC is not set
-CONFIG_SGI_DS1286=y
+CONFIG_SGI_DS1286=m
 # CONFIG_DTLK is not set
 # CONFIG_R3964 is not set
 # CONFIG_APPLICOM is not set
@@ -696,6 +702,8 @@ CONFIG_UDF_FS=m
 CONFIG_FAT_FS=m
 CONFIG_MSDOS_FS=m
 CONFIG_VFAT_FS=m
+CONFIG_FAT_DEFAULT_CODEPAGE=437
+CONFIG_FAT_DEFAULT_IOCHARSET="iso8859-1"
 # CONFIG_NTFS_FS is not set
 
 #
@@ -750,7 +758,6 @@ CONFIG_RPCSEC_GSS_KRB5=m
 # CONFIG_CIFS is not set
 # CONFIG_NCP_FS is not set
 # CONFIG_CODA_FS is not set
-# CONFIG_INTERMEZZO_FS is not set
 # CONFIG_AFS_FS is not set
 
 #
@@ -768,7 +775,6 @@ CONFIG_MSDOS_PARTITION=y
 # CONFIG_SOLARIS_X86_PARTITION is not set
 # CONFIG_UNIXWARE_DISKLABEL is not set
 # CONFIG_LDM_PARTITION is not set
-# CONFIG_NEC98_PARTITION is not set
 CONFIG_SGI_PARTITION=y
 # CONFIG_ULTRIX_PARTITION is not set
 # CONFIG_SUN_PARTITION is not set
@@ -802,6 +808,7 @@ CONFIG_NLS_CODEPAGE_874=m
 CONFIG_NLS_ISO8859_8=m
 CONFIG_NLS_CODEPAGE_1250=m
 CONFIG_NLS_CODEPAGE_1251=m
+CONFIG_NLS_ASCII=m
 CONFIG_NLS_ISO8859_1=m
 CONFIG_NLS_ISO8859_2=m
 CONFIG_NLS_ISO8859_3=m
@@ -850,11 +857,14 @@ CONFIG_CRYPTO_CAST6=m
 CONFIG_CRYPTO_ARC4=m
 CONFIG_CRYPTO_DEFLATE=y
 CONFIG_CRYPTO_MICHAEL_MIC=m
+CONFIG_CRYPTO_CRC32C=m
 # CONFIG_CRYPTO_TEST is not set
 
 #
 # Library routines
 #
+CONFIG_CRC16=m
 # CONFIG_CRC32 is not set
+CONFIG_LIBCRC32C=m
 CONFIG_ZLIB_INFLATE=y
 CONFIG_ZLIB_DEFLATE=y
diff --git a/arch/mips/gt64120/common/time.c b/arch/mips/gt64120/common/time.c
index 86a2100db..44f33caf2 100644
--- a/arch/mips/gt64120/common/time.c
+++ b/arch/mips/gt64120/common/time.c
@@ -80,7 +80,7 @@ void gt64120_time_init(void)
 	timer.name = "timer";
 	timer.dev_id = NULL;
 	timer.next = NULL;
-	timer.mask = 0;
+	timer.mask = CPU_MASK_NONE;
 	irq_desc[GT_TIMER].action = &timer;
 
 	enable_irq(GT_TIMER);
diff --git a/arch/mips/jmr3927/rbhma3100/irq.c b/arch/mips/jmr3927/rbhma3100/irq.c
index 442dc6df4..4ab85b5b2 100644
--- a/arch/mips/jmr3927/rbhma3100/irq.c
+++ b/arch/mips/jmr3927/rbhma3100/irq.c
@@ -301,7 +301,7 @@ static void jmr3927_ioc_interrupt(int irq, void *dev_id, struct pt_regs *regs)
 }
 
 static struct irqaction ioc_action = {
-	jmr3927_ioc_interrupt, 0, 0, "IOC", NULL, NULL,
+	jmr3927_ioc_interrupt, 0, CPU_MASK_NONE, "IOC", NULL, NULL,
 };
 
 static void jmr3927_isac_interrupt(int irq, void *dev_id, struct pt_regs *regs)
@@ -318,7 +318,7 @@ static void jmr3927_isac_interrupt(int irq, void *dev_id, struct pt_regs *regs)
 }
 
 static struct irqaction isac_action = {
-	jmr3927_isac_interrupt, 0, 0, "ISAC", NULL, NULL,
+	jmr3927_isac_interrupt, 0, CPU_MASK_NONE, "ISAC", NULL, NULL,
 };
 
 
@@ -327,7 +327,7 @@ static void jmr3927_isaerr_interrupt(int irq, void * dev_id, struct pt_regs * re
 	printk(KERN_WARNING "ISA error interrupt (irq 0x%x).\n", irq);
 }
 static struct irqaction isaerr_action = {
-	jmr3927_isaerr_interrupt, 0, 0, "ISA error", NULL, NULL,
+	jmr3927_isaerr_interrupt, 0, CPU_MASK_NONE, "ISA error", NULL, NULL,
 };
 
 static void jmr3927_pcierr_interrupt(int irq, void * dev_id, struct pt_regs * regs)
@@ -337,7 +337,7 @@ static void jmr3927_pcierr_interrupt(int irq, void * dev_id, struct pt_regs * re
 	       tx3927_pcicptr->pcistat, tx3927_pcicptr->lbstat);
 }
 static struct irqaction pcierr_action = {
-	jmr3927_pcierr_interrupt, 0, 0, "PCI error", NULL, NULL,
+	jmr3927_pcierr_interrupt, 0, CPU_MASK_NONE, "PCI error", NULL, NULL,
 };
 
 int jmr3927_ether1_irq = 0;
diff --git a/arch/mips/kernel/Makefile b/arch/mips/kernel/Makefile
index 9ce8090ef..3fd457737 100644
--- a/arch/mips/kernel/Makefile
+++ b/arch/mips/kernel/Makefile
@@ -9,7 +9,7 @@ obj-y		+= cpu-probe.o branch.o entry.o genex.o irq.o process.o \
 		   time.o traps.o unaligned.o
 
 ifdef CONFIG_MODULES
-obj-y				+= mips_ksyms.o
+obj-y				+= mips_ksyms.o module.o
 obj-$(CONFIG_MIPS32)		+= module-elf32.o
 obj-$(CONFIG_MIPS64)		+= module-elf64.o
 endif
@@ -23,6 +23,7 @@ obj-$(CONFIG_CPU_R4300)		+= r4k_fpu.o r4k_switch.o
 obj-$(CONFIG_CPU_R4X00)		+= r4k_fpu.o r4k_switch.o
 obj-$(CONFIG_CPU_R5000)		+= r4k_fpu.o r4k_switch.o
 obj-$(CONFIG_CPU_R5432)		+= r4k_fpu.o r4k_switch.o
+obj-$(CONFIG_CPU_R8000)		+= r4k_fpu.o r4k_switch.o
 obj-$(CONFIG_CPU_RM7000)	+= r4k_fpu.o r4k_switch.o
 obj-$(CONFIG_CPU_RM9000)	+= r4k_fpu.o r4k_switch.o
 obj-$(CONFIG_CPU_NEVADA)	+= r4k_fpu.o r4k_switch.o
@@ -37,7 +38,7 @@ obj-$(CONFIG_SMP)		+= smp.o
 obj-$(CONFIG_I8259)		+= i8259.o
 obj-$(CONFIG_IRQ_CPU)		+= irq_cpu.o
 obj-$(CONFIG_IRQ_CPU_RM7K)	+= irq-rm7000.o
-obj-$(CONFIG_MIPS_MV64340)	+= irq-mv6434x.o
+obj-$(CONFIG_IRQ_MV64340)	+= irq-mv6434x.o
 
 obj-$(CONFIG_MIPS32)		+= scall32-o32.o
 obj-$(CONFIG_MIPS64)		+= scall64-64.o
diff --git a/arch/mips/kernel/cpu-bugs64.c b/arch/mips/kernel/cpu-bugs64.c
index 31c17ced8..1375d4483 100644
--- a/arch/mips/kernel/cpu-bugs64.c
+++ b/arch/mips/kernel/cpu-bugs64.c
@@ -177,7 +177,7 @@ static inline void check_daddi(void)
 	extern asmlinkage void handle_daddi_ov(void);
 	unsigned long flags;
 	void *handler;
-	long v;
+	long v, tmp;
 
 	printk("Checking for the daddi bug... ");
 
@@ -197,13 +197,15 @@ static inline void check_daddi(void)
 		".set	noat\n\t"
 		".set	noreorder\n\t"
 		".set	nomacro\n\t"
+		"addiu	%1, $0, %2\n\t"
+		"dsrl	%1, %1, 1\n\t"
 #ifdef HAVE_AS_SET_DADDI
 		".set	daddi\n\t"
 #endif
-		"daddi	%0, %1, %2\n\t"
+		"daddi	%0, %1, %3\n\t"
 		".set	pop"
-		: "=r" (v)
-		: "r" (0x7fffffffffffedcd), "I" (0x1234));
+		: "=r" (v), "=&r" (tmp)
+		: "I" (0xffffffffffffdb9a), "I" (0x1234));
 	set_except_vector(12, handler);
 	local_irq_restore(flags);
 
@@ -217,9 +219,11 @@ static inline void check_daddi(void)
 	local_irq_save(flags);
 	handler = set_except_vector(12, handle_daddi_ov);
 	asm volatile(
-		"daddi	%0, %1, %2"
-		: "=r" (v)
-		: "r" (0x7fffffffffffedcd), "I" (0x1234));
+		"addiu	%1, $0, %2\n\t"
+		"dsrl	%1, %1, 1\n\t"
+		"daddi	%0, %1, %3"
+		: "=r" (v), "=&r" (tmp)
+		: "I" (0xffffffffffffdb9a), "I" (0x1234));
 	set_except_vector(12, handler);
 	local_irq_restore(flags);
 
@@ -240,7 +244,7 @@ static inline void check_daddi(void)
 
 static inline void check_daddiu(void)
 {
-	long v, w;
+	long v, w, tmp;
 
 	printk("Checking for the daddiu bug... ");
 
@@ -265,15 +269,17 @@ static inline void check_daddiu(void)
 		".set	noat\n\t"
 		".set	noreorder\n\t"
 		".set	nomacro\n\t"
+		"addiu	%2, $0, %3\n\t"
+		"dsrl	%2, %2, 1\n\t"
 #ifdef HAVE_AS_SET_DADDI
 		".set	daddi\n\t"
 #endif
-		"daddiu	%0, %2, %3\n\t"
-		"addiu	%1, $0, %3\n\t"
+		"daddiu	%0, %2, %4\n\t"
+		"addiu	%1, $0, %4\n\t"
 		"daddu	%1, %2\n\t"
 		".set	pop"
-		: "=&r" (v), "=&r" (w)
-		: "r" (0x7fffffffffffedcd), "I" (0x1234));
+		: "=&r" (v), "=&r" (w), "=&r" (tmp)
+		: "I" (0xffffffffffffdb9a), "I" (0x1234));
 
 	if (v == w) {
 		printk("no.\n");
@@ -283,11 +289,13 @@ static inline void check_daddiu(void)
 	printk("yes, workaround... ");
 
 	asm volatile(
-		"daddiu	%0, %2, %3\n\t"
-		"addiu	%1, $0, %3\n\t"
+		"addiu	%2, $0, %3\n\t"
+		"dsrl	%2, %2, 1\n\t"
+		"daddiu	%0, %2, %4\n\t"
+		"addiu	%1, $0, %4\n\t"
 		"daddu	%1, %2"
-		: "=&r" (v), "=&r" (w)
-		: "r" (0x7fffffffffffedcd), "I" (0x1234));
+		: "=&r" (v), "=&r" (w), "=&r" (tmp)
+		: "I" (0xffffffffffffdb9a), "I" (0x1234));
 
 	if (v == w) {
 		printk("yes.\n");
diff --git a/arch/mips/kernel/cpu-probe.c b/arch/mips/kernel/cpu-probe.c
index 501359934..36777476d 100644
--- a/arch/mips/kernel/cpu-probe.c
+++ b/arch/mips/kernel/cpu-probe.c
@@ -1,6 +1,8 @@
 /*
  * Processor capabilities determination functions.
  *
+ * Copyright (C) xxxx  the Anonymous
+ * Copyright (C) 2003  Maciej W. Rozycki
  * Copyright (C) 1994 - 2003 Ralf Baechle
  * Copyright (C) 2001 MIPS Inc.
  *
@@ -49,6 +51,14 @@ static void r4k_wait(void)
 		".set\tmips0");
 }
 
+/*
+ * The Au1xxx wait is available only if we run CONFIG_PM and
+ * the timer setup found we had a 32KHz counter available.
+ * There are still problems with functions that may call au1k_wait
+ * directly, but that will be discovered pretty quickly.
+ */
+extern void (*au1k_wait_ptr)(void);
+
 void au1k_wait(void)
 {
 #ifdef CONFIG_PM
@@ -90,7 +100,6 @@ static inline void check_wait(void)
 	case CPU_R5000:
 	case CPU_NEVADA:
 	case CPU_RM7000:
-/*	case CPU_RM9000: */
 	case CPU_TX49XX:
 	case CPU_4KC:
 	case CPU_4KEC:
@@ -102,12 +111,19 @@ static inline void check_wait(void)
 		cpu_wait = r4k_wait;
 		printk(" available.\n");
 		break;
+#ifdef CONFIG_PM
 	case CPU_AU1000:
 	case CPU_AU1100:
 	case CPU_AU1500:
-		cpu_wait = au1k_wait;
-		printk(" available.\n");
+		if (au1k_wait_ptr != NULL) {
+			cpu_wait = au1k_wait_ptr;
+			printk(" available.\n");
+		}
+		else {
+			printk(" unavailable.\n");
+		}
 		break;
+#endif
 	default:
 		printk(" unavailable.\n");
 		break;
@@ -238,8 +254,8 @@ static inline void cpu_probe_legacy(struct cpuinfo_mips *c)
 			break;
 		default:
 			printk(KERN_INFO "Unexpected CPU of NEC VR4100 series\n");
-				c->cputype = CPU_VR41XX;
-				break;
+			c->cputype = CPU_VR41XX;
+			break;
 		}
 		c->isa_level = MIPS_CPU_ISA_III;
 		c->options = R4K_OPTS;
@@ -371,7 +387,7 @@ static inline void cpu_probe_legacy(struct cpuinfo_mips *c)
 		c->cputype = CPU_RM9000;
 		c->isa_level = MIPS_CPU_ISA_IV;
 		c->options = R4K_OPTS | MIPS_CPU_FPU | MIPS_CPU_32FPR |
-			     MIPS_CPU_LLSC;
+		             MIPS_CPU_LLSC;
 		/*
 		 * Bit 29 in the info register of the RM9000
 		 * indicates if the TLB has 48 or 64 entries.
@@ -407,9 +423,6 @@ static inline void cpu_probe_legacy(struct cpuinfo_mips *c)
 		             MIPS_CPU_LLSC;
 		c->tlbsize = 64;
 		break;
-	default:
-		c->cputype = CPU_UNKNOWN;
-		break;
 	}
 }
 
@@ -475,9 +488,6 @@ static inline void cpu_probe_mips(struct cpuinfo_mips *c)
 		/* Probe for L2 cache */
 		c->scache.flags &= ~MIPS_CACHE_NOT_PRESENT;
 		break;
-	default:
-		c->cputype = CPU_UNKNOWN;
-		break;
 	}
 }
 
@@ -505,9 +515,6 @@ static inline void cpu_probe_alchemy(struct cpuinfo_mips *c)
 			break;
 		}
 		c->isa_level = MIPS_CPU_ISA_M32;
- 		break;
-	default:
-		c->cputype = CPU_UNKNOWN;
 		break;
 	}
 }
@@ -528,9 +535,6 @@ static inline void cpu_probe_sibyte(struct cpuinfo_mips *c)
 		c->options |= MIPS_CPU_FPU | MIPS_CPU_32FPR;
 #endif
 		break;
-	default:
-		c->cputype = CPU_UNKNOWN;
-		break;
 	}
 }
 
@@ -542,14 +546,11 @@ static inline void cpu_probe_sandcraft(struct cpuinfo_mips *c)
 		c->cputype = CPU_SR71000;
 		c->isa_level = MIPS_CPU_ISA_M64;
 		c->options = MIPS_CPU_TLB | MIPS_CPU_4KEX |
-                                    MIPS_CPU_4KTLB | MIPS_CPU_FPU |
+		             MIPS_CPU_4KTLB | MIPS_CPU_FPU |
 		             MIPS_CPU_COUNTER | MIPS_CPU_MCHECK;
 		c->scache.ways = 8;
 		c->tlbsize = 64;
 		break;
-	default:
-		c->cputype = CPU_UNKNOWN;
-		break;
 	}
 }
 
@@ -563,7 +564,6 @@ __init void cpu_probe(void)
 
 	c->processor_id = read_c0_prid();
 	switch (c->processor_id & 0xff0000) {
-
 	case PRID_COMP_LEGACY:
 		cpu_probe_legacy(c);
 		break;
diff --git a/arch/mips/kernel/init_task.c b/arch/mips/kernel/init_task.c
index 945606b2e..aeda7f583 100644
--- a/arch/mips/kernel/init_task.c
+++ b/arch/mips/kernel/init_task.c
@@ -3,6 +3,7 @@
 #include <linux/sched.h>
 #include <linux/init_task.h>
 #include <linux/fs.h>
+#include <linux/mqueue.h>
 
 #include <asm/thread_info.h>
 #include <asm/uaccess.h>
diff --git a/arch/mips/kernel/irq-mv6434x.c b/arch/mips/kernel/irq-mv6434x.c
index 1ed5ae591..cb9d2fe59 100644
--- a/arch/mips/kernel/irq-mv6434x.c
+++ b/arch/mips/kernel/irq-mv6434x.c
@@ -44,7 +44,7 @@ static inline void mask_mv64340_irq(unsigned int irq)
 		MV_WRITE(MV64340_INTERRUPT0_MASK_0_LOW, value);
 	} else {
 		value = MV_READ(MV64340_INTERRUPT0_MASK_0_HIGH);
-		value &= ~(1 << (irq - (irq_base - 32)));
+		value &= ~(1 << (irq - irq_base - 32));
 		MV_WRITE(MV64340_INTERRUPT0_MASK_0_HIGH, value);
 	}
 }
@@ -60,7 +60,7 @@ static inline void unmask_mv64340_irq(unsigned int irq)
 		MV_WRITE(MV64340_INTERRUPT0_MASK_0_LOW, value);
 	} else {
 		value = MV_READ(MV64340_INTERRUPT0_MASK_0_HIGH);
-		value |= 1 << (irq - (irq_base - 32));
+		value |= 1 << (irq - irq_base - 32);
 		MV_WRITE(MV64340_INTERRUPT0_MASK_0_HIGH, value);
 	}
 }
diff --git a/arch/mips/kernel/irq.c b/arch/mips/kernel/irq.c
index 845e0914f..13acf876b 100644
--- a/arch/mips/kernel/irq.c
+++ b/arch/mips/kernel/irq.c
@@ -487,7 +487,7 @@ int request_irq(unsigned int irq,
 
 	action->handler = handler;
 	action->flags = irqflags;
-	action->mask = 0;
+	cpus_clear(action->mask);
 	action->name = devname;
 	action->next = NULL;
 	action->dev_id = dev_id;
diff --git a/arch/mips/kernel/linux32.c b/arch/mips/kernel/linux32.c
index 836474423..a53f31587 100644
--- a/arch/mips/kernel/linux32.c
+++ b/arch/mips/kernel/linux32.c
@@ -477,6 +477,9 @@ asmlinkage ssize_t sys32_pread(unsigned int fd, char * buf,
 		goto out;
 	if (pos < 0)
 		goto out;
+	ret = -ESPIPE;
+	if (!(file->f_mode & FMODE_PREAD))
+		goto out;
 	ret = read(file, buf, count, &pos);
 	if (ret > 0)
 		dnotify_parent(file->f_dentry, DN_ACCESS);
@@ -511,6 +514,10 @@ asmlinkage ssize_t sys32_pwrite(unsigned int fd, const char * buf,
 	if (pos < 0)
 		goto out;
 
+	ret = -ESPIPE;
+	if (!(file->f_mode & FMODE_PWRITE))
+		goto out;
+
 	ret = write(file, buf, count, &pos);
 	if (ret > 0)
 		dnotify_parent(file->f_dentry, DN_MODIFY);
diff --git a/arch/mips/kernel/module-elf32.c b/arch/mips/kernel/module-elf32.c
index 35818bb1a..ffd216d6d 100644
--- a/arch/mips/kernel/module-elf32.c
+++ b/arch/mips/kernel/module-elf32.c
@@ -248,14 +248,3 @@ int apply_relocate_add(Elf32_Shdr *sechdrs,
 	       me->name);
 	return -ENOEXEC;
 }
-
-int module_finalize(const Elf_Ehdr *hdr,
-		    const Elf_Shdr *sechdrs,
-		    struct module *me)
-{
-	return 0;
-}
-
-void module_arch_cleanup(struct module *mod)
-{
-}
diff --git a/arch/mips/kernel/module-elf64.c b/arch/mips/kernel/module-elf64.c
index da7295d53..e804792ee 100644
--- a/arch/mips/kernel/module-elf64.c
+++ b/arch/mips/kernel/module-elf64.c
@@ -272,14 +272,3 @@ int apply_relocate_add(Elf64_Shdr *sechdrs,
 
 	return 0;
 }
-
-int module_finalize(const Elf_Ehdr *hdr,
-		    const Elf_Shdr *sechdrs,
-		    struct module *me)
-{
-	return 0;
-}
-
-void module_arch_cleanup(struct module *mod)
-{
-}
diff --git a/arch/mips/kernel/scall32-o32.S b/arch/mips/kernel/scall32-o32.S
index 09477c1e3..24eab2f9d 100644
--- a/arch/mips/kernel/scall32-o32.S
+++ b/arch/mips/kernel/scall32-o32.S
@@ -627,6 +627,7 @@ out:	jr	ra
 	sys	sys_mq_timedreceive	5
 	sys	sys_mq_notify		2	/* 4275 */
 	sys	sys_mq_getsetattr	3
+	sys	sys_ni_syscall		0	/* sys_vserver */
 
 	.endm
 
diff --git a/arch/mips/kernel/scall64-64.S b/arch/mips/kernel/scall64-64.S
index 19e430d62..3125b634f 100644
--- a/arch/mips/kernel/scall64-64.S
+++ b/arch/mips/kernel/scall64-64.S
@@ -447,3 +447,4 @@ sys_call_table:
 	PTR	sys_mq_timedreceive
 	PTR	sys_mq_notify
 	PTR	sys_mq_getsetattr		/* 5235 */
+	PTR	sys_ni_syscall			/* sys_vserver */
diff --git a/arch/mips/kernel/scall64-n32.S b/arch/mips/kernel/scall64-n32.S
index 9993a8a15..c00459f8f 100644
--- a/arch/mips/kernel/scall64-n32.S
+++ b/arch/mips/kernel/scall64-n32.S
@@ -357,3 +357,4 @@ EXPORT(sysn32_call_table)
 	PTR	compat_sys_mq_timedreceive
 	PTR	compat_sys_mq_notify
 	PTR	compat_sys_mq_getsetattr	/* 6239 */
+	PTR	sys_ni_syscall			/* sys_vserver */
diff --git a/arch/mips/kernel/scall64-o32.S b/arch/mips/kernel/scall64-o32.S
index b35165686..3a89bf425 100644
--- a/arch/mips/kernel/scall64-o32.S
+++ b/arch/mips/kernel/scall64-o32.S
@@ -535,6 +535,7 @@ out:	jr	ra
 	sys	compat_sys_mq_timedreceive 5
 	sys	compat_sys_mq_notify	2	/* 4275 */
 	sys	compat_sys_mq_getsetattr 3
+	sys	sys_ni_syscall		0	/* sys_vserver */
 
 	.endm
 
diff --git a/arch/mips/kernel/semaphore.c b/arch/mips/kernel/semaphore.c
index 51c3e772c..4197b4109 100644
--- a/arch/mips/kernel/semaphore.c
+++ b/arch/mips/kernel/semaphore.c
@@ -1,273 +1,165 @@
 /*
- * Copyright (C) 1999, 2001, 02, 03 Ralf Baechle
+ * MIPS-specific semaphore code.
  *
- * Heavily inspired by the Alpha implementation
+ * Copyright (C) 1999 Cort Dougan <cort@cs.nmt.edu>
+ * Copyright (C) 2004 Ralf Baechle <ralf@linux-mips.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.
+ *
+ * April 2001 - Reworked by Paul Mackerras <paulus@samba.org>
+ * to eliminate the SMP races in the old version between the updates
+ * of `count' and `waking'.  Now we use negative `count' values to
+ * indicate that some process(es) are waiting for the semaphore.
  */
+
 #include <linux/config.h>
-#include <linux/errno.h>
 #include <linux/module.h>
-#include <linux/init.h>
 #include <linux/sched.h>
+#include <linux/init.h>
+#include <asm/atomic.h>
+#include <asm/semaphore.h>
+#include <asm/errno.h>
 
-#ifdef CONFIG_CPU_HAS_LLDSCD
-/*
- * On machines without lld/scd we need a spinlock to make the manipulation of
- * sem->count and sem->waking atomic.  Scalability isn't an issue because
- * this lock is used on UP only so it's just an empty variable.
- */
-spinlock_t semaphore_lock = SPIN_LOCK_UNLOCKED;
-
-EXPORT_SYMBOL(semaphore_lock);
-#endif
+#ifdef CONFIG_CPU_HAS_LLSC
 
 /*
- * Semaphores are implemented using a two-way counter: The "count" variable is
- * decremented for each process that tries to sleep, while the "waking" variable
- * is incremented when the "up()" code goes to wake up waiting processes.
- *
- * Notably, the inline "up()" and "down()" functions can efficiently test if
- * they need to do any extra work (up needs to do something only if count was
- * negative before the increment operation.
- *
- * waking_non_zero() must execute atomically.
+ * Atomically update sem->count.
+ * This does the equivalent of the following:
  *
- * When __up() is called, the count was negative before incrementing it, and we
- * need to wake up somebody.
- *
- * This routine adds one to the count of processes that need to wake up and
- * exit.  ALL waiting processes actually wake up but only the one that gets to
- * the "waking" field first will gate through and acquire the semaphore.  The
- * others will go back to sleep.
- *
- * Note that these functions are only called when there is contention on the
- * lock, and as such all this is the "non-critical" part of the whole semaphore
- * business. The critical part is the inline stuff in <asm/semaphore.h> where
- * we want to avoid any extra jumps and calls.
+ *	old_count = sem->count;
+ *	tmp = MAX(old_count, 0) + incr;
+ *	sem->count = tmp;
+ *	return old_count;
  */
-void __up_wakeup(struct semaphore *sem)
+static inline int __sem_update_count(struct semaphore *sem, int incr)
 {
-	wake_up(&sem->wait);
-}
-
-EXPORT_SYMBOL(__up_wakeup);
-
-#ifdef CONFIG_CPU_HAS_LLSC
-
-static inline int waking_non_zero(struct semaphore *sem)
-{
-	int ret, tmp;
+	int old_count, tmp;
 
 	__asm__ __volatile__(
-	"1:	ll	%1, %2			# waking_non_zero	\n"
-	"	blez	%1, 2f						\n"
-	"	subu	%0, %1, 1					\n"
-	"	sc	%0, %2						\n"
-	"	beqz	%0, 1b						\n"
-	"2:								\n"
-	: "=r" (ret), "=r" (tmp), "+m" (sem->waking)
-	: "0" (0));
-
-	return ret;
+	"1:	ll	%0, %2					\n"
+	"	sra	%1, %0, 31				\n"
+	"	not	%1					\n"
+	"	and	%1, %0, %1				\n"
+	"	add	%1, %1, %3				\n"
+	"	sc	%1, %2					\n"
+	"	beqz	%1, 1b					\n"
+	: "=&r" (old_count), "=&r" (tmp), "=m" (sem->count)
+	: "r" (incr), "m" (sem->count));
+
+	return old_count;
 }
 
-#else /* !CONFIG_CPU_HAS_LLSC */
+#else
 
-static inline int waking_non_zero(struct semaphore *sem)
+/*
+ * On machines without lld/scd we need a spinlock to make the manipulation of
+ * sem->count and sem->waking atomic.  Scalability isn't an issue because
+ * this lock is used on UP only so it's just an empty variable.
+ */
+static spinlock_t semaphore_lock = SPIN_LOCK_UNLOCKED;
+
+static inline int __sem_update_count(struct semaphore *sem, int incr)
 {
 	unsigned long flags;
-	int waking, ret = 0;
+	int old_count, tmp;
 
 	spin_lock_irqsave(&semaphore_lock, flags);
-	waking = atomic_read(&sem->waking);
-	if (waking > 0) {
-		atomic_set(&sem->waking, waking - 1);
-		ret = 1;
-	}
+	old_count = atomic_read(&sem->count);
+	tmp = max_t(int, old_count, 0) + incr;
+	atomic_set(&sem->count, tmp);
 	spin_unlock_irqrestore(&semaphore_lock, flags);
 
-	return ret;
+	return old_count;
 }
 
-#endif /* !CONFIG_CPU_HAS_LLSC */
-
-/*
- * Perform the "down" function.  Return zero for semaphore acquired, return
- * negative for signalled out of the function.
- *
- * If called from down, the return is ignored and the wait loop is not
- * interruptible.  This means that a task waiting on a semaphore using "down()"
- * cannot be killed until someone does an "up()" on the semaphore.
- *
- * If called from down_interruptible, the return value gets checked upon return.
- * If the return value is negative then the task continues with the negative
- * value in the return register (it can be tested by the caller).
- *
- * Either form may be used in conjunction with "up()".
- */
+#endif
 
-void __sched __down_failed(struct semaphore * sem)
+void __up(struct semaphore *sem)
 {
-	struct task_struct *tsk = current;
-	wait_queue_t wait;
-
-	init_waitqueue_entry(&wait, tsk);
-	__set_current_state(TASK_UNINTERRUPTIBLE);
-	add_wait_queue_exclusive(&sem->wait, &wait);
-
 	/*
-	 * Ok, we're set up.  sem->count is known to be less than zero
-	 * so we must wait.
-	 *
-	 * We can let go the lock for purposes of waiting.
-	 * We re-acquire it after awaking so as to protect
-	 * all semaphore operations.
-	 *
-	 * If "up()" is called before we call waking_non_zero() then
-	 * we will catch it right away.  If it is called later then
-	 * we will have to go through a wakeup cycle to catch it.
-	 *
-	 * Multiple waiters contend for the semaphore lock to see
-	 * who gets to gate through and who has to wait some more.
+	 * Note that we incremented count in up() before we came here,
+	 * but that was ineffective since the result was <= 0, and
+	 * any negative value of count is equivalent to 0.
+	 * This ends up setting count to 1, unless count is now > 0
+	 * (i.e. because some other cpu has called up() in the meantime),
+	 * in which case we just increment count.
 	 */
-	for (;;) {
-		if (waking_non_zero(sem))
-			break;
-		schedule();
-		__set_current_state(TASK_UNINTERRUPTIBLE);
-	}
-	__set_current_state(TASK_RUNNING);
-	remove_wait_queue(&sem->wait, &wait);
+	__sem_update_count(sem, 1);
+	wake_up(&sem->wait);
 }
 
-EXPORT_SYMBOL(__down_failed);
-
-#ifdef CONFIG_CPU_HAS_LLDSCD
+EXPORT_SYMBOL(__up);
 
 /*
- * waking_non_zero_interruptible:
- *	1	got the lock
- *	0	go to sleep
- *	-EINTR	interrupted
- *
- * We must undo the sem->count down_interruptible decrement
- * simultaneously and atomically with the sem->waking adjustment,
- * otherwise we can race with wake_one_more.
- *
- * This is accomplished by doing a 64-bit lld/scd on the 2 32-bit words.
- *
- * This is crazy.  Normally it's strictly forbidden to use 64-bit operations
- * in the 32-bit MIPS kernel.  In this case it's however ok because if an
- * interrupt has destroyed the upper half of registers sc will fail.
- * Note also that this will not work for MIPS32 CPUs!
- *
- * Pseudocode:
- *
- * If(sem->waking > 0) {
- *	Decrement(sem->waking)
- *	Return(SUCCESS)
- * } else If(signal_pending(tsk)) {
- *	Increment(sem->count)
- *	Return(-EINTR)
- * } else {
- *	Return(SLEEP)
- * }
+ * Note that when we come in to __down or __down_interruptible,
+ * we have already decremented count, but that decrement was
+ * ineffective since the result was < 0, and any negative value
+ * of count is equivalent to 0.
+ * Thus it is only when we decrement count from some value > 0
+ * that we have actually got the semaphore.
  */
-
-static inline int
-waking_non_zero_interruptible(struct semaphore *sem, struct task_struct *tsk)
-{
-	long ret, tmp;
-
-	__asm__ __volatile__(
-	"	.set	push		# waking_non_zero_interruptible	\n"
-	"	.set	mips3						\n"
-	"	.set	noat						\n"
-	"0:	lld	%1, %2						\n"
-	"	li	%0, 0						\n"
-	"	sll	$1, %1, 0					\n"
-	"	blez	$1, 1f						\n"
-	"	daddiu	%1, %1, -1					\n"
-	"	li	%0, 1						\n"
-	"	b	2f						\n"
-	"1:	beqz	%3, 2f						\n"
-	"	li	%0, %4						\n"
-	"	dli	$1, 0x0000000100000000				\n"
-	"	daddu	%1, %1, $1					\n"
-	"2:	scd	%1, %2						\n"
-	"	beqz	%1, 0b						\n"
-	"	.set	pop						\n"
-	: "=&r" (ret), "=&r" (tmp), "=m" (*sem)
-	: "r" (signal_pending(tsk)), "i" (-EINTR));
-
-	return ret;
-}
-
-#else /* !CONFIG_CPU_HAS_LLDSCD */
-
-static inline int waking_non_zero_interruptible(struct semaphore *sem,
-						struct task_struct *tsk)
+void __sched __down(struct semaphore *sem)
 {
-	int waking, pending, ret = 0;
-	unsigned long flags;
+	struct task_struct *tsk = current;
+	DECLARE_WAITQUEUE(wait, tsk);
 
-	pending = signal_pending(tsk);
+	__set_task_state(tsk, TASK_UNINTERRUPTIBLE);
+	add_wait_queue_exclusive(&sem->wait, &wait);
 
-	spin_lock_irqsave(&semaphore_lock, flags);
-	waking = atomic_read(&sem->waking);
-	if (waking > 0) {
-		atomic_set(&sem->waking, waking - 1);
-		ret = 1;
-	} else if (pending) {
-		atomic_set(&sem->count, atomic_read(&sem->count) + 1);
-		ret = -EINTR;
+	/*
+	 * Try to get the semaphore.  If the count is > 0, then we've
+	 * got the semaphore; we decrement count and exit the loop.
+	 * If the count is 0 or negative, we set it to -1, indicating
+	 * that we are asleep, and then sleep.
+	 */
+	while (__sem_update_count(sem, -1) <= 0) {
+		schedule();
+		set_task_state(tsk, TASK_UNINTERRUPTIBLE);
 	}
-	spin_unlock_irqrestore(&semaphore_lock, flags);
+	remove_wait_queue(&sem->wait, &wait);
+	__set_task_state(tsk, TASK_RUNNING);
 
-	return ret;
+	/*
+	 * If there are any more sleepers, wake one of them up so
+	 * that it can either get the semaphore, or set count to -1
+	 * indicating that there are still processes sleeping.
+	 */
+	wake_up(&sem->wait);
 }
 
-#endif /* !CONFIG_CPU_HAS_LLDSCD */
+EXPORT_SYMBOL(__down);
 
-int __sched __down_failed_interruptible(struct semaphore * sem)
+int __sched __down_interruptible(struct semaphore * sem)
 {
+	int retval = 0;
 	struct task_struct *tsk = current;
-	wait_queue_t wait;
-	int ret = 0;
+	DECLARE_WAITQUEUE(wait, tsk);
 
-	init_waitqueue_entry(&wait, tsk);
-	__set_current_state(TASK_INTERRUPTIBLE);
+	__set_task_state(tsk, TASK_INTERRUPTIBLE);
 	add_wait_queue_exclusive(&sem->wait, &wait);
 
-	/*
-	 * Ok, we're set up.  sem->count is known to be less than zero
-	 * so we must wait.
-	 *
-	 * We can let go the lock for purposes of waiting.
-	 * We re-acquire it after awaking so as to protect
-	 * all semaphore operations.
-	 *
-	 * If "up()" is called before we call waking_non_zero() then
-	 * we will catch it right away.  If it is called later then
-	 * we will have to go through a wakeup cycle to catch it.
-	 *
-	 * Multiple waiters contend for the semaphore lock to see
-	 * who gets to gate through and who has to wait some more.
-	 */
-	for (;;) {
-		ret = waking_non_zero_interruptible(sem, tsk);
-		if (ret) {
-			if (ret == 1)
-				/* ret != 0 only if we get interrupted -arca */
-				ret = 0;
+	while (__sem_update_count(sem, -1) <= 0) {
+		if (signal_pending(current)) {
+			/*
+			 * A signal is pending - give up trying.
+			 * Set sem->count to 0 if it is negative,
+			 * since we are no longer sleeping.
+			 */
+			__sem_update_count(sem, 0);
+			retval = -EINTR;
 			break;
 		}
 		schedule();
-		__set_current_state(TASK_INTERRUPTIBLE);
+		set_task_state(tsk, TASK_INTERRUPTIBLE);
 	}
-	__set_current_state(TASK_RUNNING);
 	remove_wait_queue(&sem->wait, &wait);
+	__set_task_state(tsk, TASK_RUNNING);
 
-	return ret;
+	wake_up(&sem->wait);
+	return retval;
 }
 
-EXPORT_SYMBOL(__down_failed_interruptible);
+EXPORT_SYMBOL(__down_interruptible);
diff --git a/arch/mips/kernel/setup.c b/arch/mips/kernel/setup.c
index a1336d16c..711ad59d6 100644
--- a/arch/mips/kernel/setup.c
+++ b/arch/mips/kernel/setup.c
@@ -38,6 +38,7 @@
 #include <asm/bootinfo.h>
 #include <asm/cpu.h>
 #include <asm/sections.h>
+#include <asm/setup.h>
 #include <asm/system.h>
 
 struct cpuinfo_mips cpu_data[NR_CPUS];
@@ -71,7 +72,6 @@ EXPORT_SYMBOL(mips_machgroup);
 struct boot_mem_map boot_mem_map;
 
 static char command_line[CL_SIZE];
-       char saved_command_line[CL_SIZE];
        char arcs_cmdline[CL_SIZE]=CONFIG_CMDLINE;
 
 /*
@@ -453,14 +453,18 @@ static void __init do_earlyinitcalls(void)
 
 void __init setup_arch(char **cmdline_p)
 {
+	unsigned int status;
+
 	cpu_probe();
 	prom_init();
 	cpu_report();
 
 #ifdef CONFIG_MIPS32
 	/* Disable coprocessors and set FPU for 16/32 FPR register model */
-	clear_c0_status(ST0_CU1|ST0_CU2|ST0_CU3|ST0_KX|ST0_SX|ST0_FR);
-	set_c0_status(ST0_CU0);
+	status = read_c0_status();
+	status &= ~(ST0_CU1|ST0_CU2|ST0_CU3|ST0_KX|ST0_SX|ST0_FR);
+	status |= ST0_CU0;
+	write_c0_status(status);
 #endif
 #ifdef CONFIG_MIPS64
 	/*
@@ -468,8 +472,10 @@ void __init setup_arch(char **cmdline_p)
 	 * Maybe because the kernel is in ckseg0 and not xkphys? Clear it
 	 * anyway ...
 	 */
-	clear_c0_status(ST0_BEV|ST0_TS|ST0_CU1|ST0_CU2|ST0_CU3);
-	set_c0_status(ST0_CU0|ST0_KX|ST0_SX|ST0_FR);
+	status = read_c0_status();
+	status &= ~(ST0_BEV|ST0_TS|ST0_CU1|ST0_CU2|ST0_CU3);
+	status |= (ST0_CU0|ST0_KX|ST0_SX|ST0_FR);
+	write_c0_status(status);
 #endif
 
 #if defined(CONFIG_VT)
@@ -484,7 +490,7 @@ void __init setup_arch(char **cmdline_p)
 	do_earlyinitcalls();
 
 	strlcpy(command_line, arcs_cmdline, sizeof(command_line));
-	strlcpy(saved_command_line, command_line, sizeof(saved_command_line));
+	strlcpy(saved_command_line, command_line, COMMAND_LINE_SIZE);
 
 	*cmdline_p = command_line;
 
diff --git a/arch/mips/kernel/syscall.c b/arch/mips/kernel/syscall.c
index c45bf3948..8cc462dc3 100644
--- a/arch/mips/kernel/syscall.c
+++ b/arch/mips/kernel/syscall.c
@@ -37,7 +37,7 @@
 #include <asm/sysmips.h>
 #include <asm/uaccess.h>
 
-asmlinkage int sys_pipe(nabi_no_regargs struct pt_regs regs)
+asmlinkage int sys_pipe(nabi_no_regargs volatile struct pt_regs regs)
 {
 	int fd[2];
 	int error, res;
diff --git a/arch/mips/kernel/sysirix.c b/arch/mips/kernel/sysirix.c
index a3747a141..e82b61fbe 100644
--- a/arch/mips/kernel/sysirix.c
+++ b/arch/mips/kernel/sysirix.c
@@ -1641,7 +1641,7 @@ asmlinkage int irix_statvfs64(char *fname, struct irix_statvfs64 *buf)
 
 	printk("[%s:%d] Wheee.. irix_statvfs(%s,%p)\n",
 	       current->comm, current->pid, fname, buf);
-	error = verify_area(VERIFY_WRITE, buf, sizeof(struct irix_statvfs));
+	error = verify_area(VERIFY_WRITE, buf, sizeof(struct irix_statvfs64));
 	if(error)
 		goto out;
 	error = user_path_walk(fname, &nd);
diff --git a/arch/mips/kernel/time.c b/arch/mips/kernel/time.c
index d0c980a9b..0199485a4 100644
--- a/arch/mips/kernel/time.c
+++ b/arch/mips/kernel/time.c
@@ -789,3 +789,8 @@ EXPORT_SYMBOL(rtc_lock);
 EXPORT_SYMBOL(to_tm);
 EXPORT_SYMBOL(rtc_set_time);
 EXPORT_SYMBOL(rtc_get_time);
+
+unsigned long long sched_clock(void)
+{
+	return (unsigned long long)jiffies*(1000000000/HZ);
+}
diff --git a/arch/mips/kernel/traps.c b/arch/mips/kernel/traps.c
index 752dbd3e9..af1b42b58 100644
--- a/arch/mips/kernel/traps.c
+++ b/arch/mips/kernel/traps.c
@@ -9,7 +9,7 @@
  * Copyright (C) 1999 Silicon Graphics, Inc.
  * Kevin D. Kissell, kevink@mips.com and Carsten Langgaard, carstenl@mips.com
  * Copyright (C) 2000, 01 MIPS Technologies, Inc.
- * Copyright (C) 2002, 2003  Maciej W. Rozycki
+ * Copyright (C) 2002, 2003, 2004  Maciej W. Rozycki
  */
 #include <linux/config.h>
 #include <linux/init.h>
@@ -23,6 +23,7 @@
 
 #include <asm/bootinfo.h>
 #include <asm/branch.h>
+#include <asm/break.h>
 #include <asm/cpu.h>
 #include <asm/fpu.h>
 #include <asm/module.h>
@@ -118,7 +119,7 @@ void show_trace(struct task_struct *task, unsigned long *stack)
 #endif
 	while (!kstack_end(stack)) {
 		addr = *stack++;
-		if (kernel_text_address(addr)) {
+		if (__kernel_text_address(addr)) {
 			printk(" [<%0*lx>] ", field, addr);
 			print_symbol("%s\n", addr);
 		}
@@ -234,6 +235,7 @@ void show_regs(struct pt_regs *regs)
 void show_registers(struct pt_regs *regs)
 {
 	show_regs(regs);
+	print_modules();
 	printk("Process %s (pid: %d, threadinfo=%p, task=%p)\n",
 	        current->comm, current->pid, current_thread_info(), current);
 	show_stack(current, (long *) regs->regs[29]);
@@ -278,47 +280,8 @@ void __declare_dbe_table(void)
 	);
 }
 
-#ifdef CONFIG_MDULES
-
-/* Given an address, look for it in the module exception tables. */
-const struct exception_table_entry *search_module_dbetables(unsigned long addr)
-{
-	unsigned long flags;
-	const struct exception_table_entry *e = NULL;
-	struct module *mod;
-
-	spin_lock_irqsave(&modlist_lock, flags);
-	list_for_each_entry(mod, &modules, list) {
-		if (mod->arch.num_dbeentries == 0)
-			continue;
-				
-		e = search_extable(mod->arch.dbe_table_start,
-				   mod->arch.dbe_table_end +
-		                   mod->arch.num_dbeentries - 1,
-				   addr);
-		if (e)
-			break;
-	}
-	spin_unlock_irqrestore(&modlist_lock, flags);
-
-	/* Now, if we found one, we are running inside it now, hence
-           we cannot unload the module, hence no refcnt needed. */
-	return e;
-}
-
-#else
-
 /* Given an address, look for it in the exception tables. */
-static inline const struct exception_table_entry *
-search_module_dbetables(unsigned long addr)
-{
-	return NULL;
-}
-
-#endif
-
-/* Given an address, look for it in the exception tables. */
-const struct exception_table_entry *search_dbe_tables(unsigned long addr)
+static const struct exception_table_entry *search_dbe_tables(unsigned long addr)
 {
 	const struct exception_table_entry *e;
 
@@ -579,9 +542,12 @@ asmlinkage void do_bp(struct pt_regs *regs)
 	/*
 	 * 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 ...
+	 * Gas is bug-compatible, but not always, grrr...
+	 * We handle both cases with a simple heuristics.  --macro
 	 */
-	bcode = ((opcode >> 16) & ((1 << 20) - 1));
+	bcode = ((opcode >> 6) & ((1 << 20) - 1));
+	if (bcode < (1 << 10))
+		bcode <<= 10;
 
 	/*
 	 * (A short test says that IRIX 5.3 sends SIGTRAP for all break
@@ -590,9 +556,9 @@ asmlinkage void do_bp(struct pt_regs *regs)
 	 * But should we continue the brokenness???  --macro
 	 */
 	switch (bcode) {
-	case 6:
-	case 7:
-		if (bcode == 7)
+	case BRK_OVERFLOW << 10:
+	case BRK_DIVZERO << 10:
+		if (bcode == (BRK_DIVZERO << 10))
 			info.si_code = FPE_INTDIV;
 		else
 			info.si_code = FPE_INTOVF;
@@ -618,7 +584,7 @@ asmlinkage void do_tr(struct pt_regs *regs)
 
 	/* Immediate versions don't provide a code.  */
 	if (!(opcode & OPCODE))
-		tcode = ((opcode >> 6) & ((1 << 20) - 1));
+		tcode = ((opcode >> 6) & ((1 << 10) - 1));
 
 	/*
 	 * (A short test says that IRIX 5.3 sends SIGTRAP for all trap
@@ -627,9 +593,9 @@ asmlinkage void do_tr(struct pt_regs *regs)
 	 * But should we continue the brokenness???  --macro
 	 */
 	switch (tcode) {
-	case 6:
-	case 7:
-		if (tcode == 7)
+	case BRK_OVERFLOW:
+	case BRK_DIVZERO:
+		if (tcode == BRK_DIVZERO)
 			info.si_code = FPE_INTDIV;
 		else
 			info.si_code = FPE_INTOVF;
@@ -745,12 +711,25 @@ asmlinkage void do_reserved(struct pt_regs *regs)
 static inline void parity_protection_init(void)
 {
 	switch (current_cpu_data.cputype) {
+	case CPU_24K:
+		/* 24K cache parity not currently implemented in FPGA */
+		printk(KERN_INFO "Disable cache parity protection for "
+		       "MIPS 24K CPU.\n");
+		write_c0_ecc(read_c0_ecc() & ~0x80000000);
+		break;
 	case CPU_5KC:
 		/* Set the PE bit (bit 31) in the c0_ecc register. */
-		printk(KERN_INFO "Enable the cache parity protection for "
-		       "MIPS 5KC CPUs.\n");
+		printk(KERN_INFO "Enable cache parity protection for "
+		       "MIPS 5KC/24K CPUs.\n");
 		write_c0_ecc(read_c0_ecc() | 0x80000000);
 		break;
+	case CPU_20KC:
+	case CPU_25KF:
+		/* Clear the DE bit (bit 16) in the c0_status register. */
+		printk(KERN_INFO "Enable cache parity protection for "
+		       "MIPS 20KC/25KF CPUs.\n");
+		clear_c0_status(ST0_DE);
+		break;
 	default:
 		break;
 	}
diff --git a/arch/mips/lasat/sysctl.c b/arch/mips/lasat/sysctl.c
index dcae0c489..1c0cc620a 100644
--- a/arch/mips/lasat/sysctl.c
+++ b/arch/mips/lasat/sysctl.c
@@ -60,11 +60,11 @@ int sysctl_lasatstring(ctl_table *table, int *name, int nlen,
 
 /* And the same for proc */
 int proc_dolasatstring(ctl_table *table, int write, struct file *filp,
-		       void *buffer, size_t *lenp)
+		       void *buffer, size_t *lenp, loff_t *ppos)
 {
 	int r;
 	down(&lasat_info_sem);
-	r = proc_dostring(table, write, filp, buffer, lenp);
+	r = proc_dostring(table, write, filp, buffer, lenp, ppos);
 	if ( (!write) || r) {
 		up(&lasat_info_sem);
 		return r;
@@ -76,11 +76,11 @@ int proc_dolasatstring(ctl_table *table, int write, struct file *filp,
 
 /* proc function to write EEPROM after changing int entry */ 
 int proc_dolasatint(ctl_table *table, int write, struct file *filp,
-		       void *buffer, size_t *lenp)
+		       void *buffer, size_t *lenp, loff_t *ppos)
 {
 	int r;
 	down(&lasat_info_sem);
-	r = proc_dointvec(table, write, filp, buffer, lenp);
+	r = proc_dointvec(table, write, filp, buffer, lenp, ppos);
 	if ( (!write) || r) {
 		up(&lasat_info_sem);
 		return r;
@@ -95,7 +95,7 @@ static int rtctmp;
 #ifdef CONFIG_DS1603
 /* proc function to read/write RealTime Clock */ 
 int proc_dolasatrtc(ctl_table *table, int write, struct file *filp,
-		       void *buffer, size_t *lenp)
+		       void *buffer, size_t *lenp, loff_t *ppos)
 {
 	int r;
 	down(&lasat_info_sem);
@@ -105,7 +105,7 @@ int proc_dolasatrtc(ctl_table *table, int write, struct file *filp,
 		if (rtctmp < 0)
 			rtctmp = 0;
 	}
-	r = proc_dointvec(table, write, filp, buffer, lenp);
+	r = proc_dointvec(table, write, filp, buffer, lenp, ppos);
 	if ( (!write) || r) {
 		up(&lasat_info_sem);
 		return r;
@@ -180,14 +180,14 @@ void update_bcastaddr(void)
 static char proc_lasat_ipbuf[32];
 /* Parsing of IP address */
 int proc_lasat_ip(ctl_table *table, int write, struct file *filp,
-		       void *buffer, size_t *lenp)
+		       void *buffer, size_t *lenp, loff_t *ppos)
 {
 	int len;
         unsigned int ip;
 	char *p, c;
 
 	if (!table->data || !table->maxlen || !*lenp ||
-	    (filp->f_pos && !write)) {
+	    (*ppos && !write)) {
 		*lenp = 0;
 		return 0;
 	}
@@ -213,7 +213,7 @@ int proc_lasat_ip(ctl_table *table, int write, struct file *filp,
 			return -EFAULT;
 		}
 		proc_lasat_ipbuf[len] = 0;
-		filp->f_pos += *lenp;
+		*ppos += *lenp;
 		/* Now see if we can convert it to a valid IP */
 		ip = in_aton(proc_lasat_ipbuf);
 		*(unsigned int *)(table->data) = ip;
@@ -241,7 +241,7 @@ int proc_lasat_ip(ctl_table *table, int write, struct file *filp,
 			len++;
 		}
 		*lenp = len;
-		filp->f_pos += len;
+		*ppos += len;
 	}
 	update_bcastaddr();
 	up(&lasat_info_sem);
@@ -277,11 +277,11 @@ static int sysctl_lasat_eeprom_value(ctl_table *table, int *name, int nlen,
 }
 
 int proc_lasat_eeprom_value(ctl_table *table, int write, struct file *filp,
-		       void *buffer, size_t *lenp)
+		       void *buffer, size_t *lenp, loff_t *ppos)
 {
 	int r;
 	down(&lasat_info_sem);
-	r = proc_dointvec(table, write, filp, buffer, lenp);
+	r = proc_dointvec(table, write, filp, buffer, lenp, ppos);
 	if ( (!write) || r) {
 		up(&lasat_info_sem);
 		return r;
diff --git a/arch/mips/lib-32/Makefile b/arch/mips/lib-32/Makefile
index 1bde2a003..fd6a2bafd 100644
--- a/arch/mips/lib-32/Makefile
+++ b/arch/mips/lib-32/Makefile
@@ -4,10 +4,22 @@
 
 lib-y	+= csum_partial.o memset.o watch.o 
 
-ifeq ($(CONFIG_CPU_R3000)$(CONFIG_CPU_TX39XX),y)
-  lib-y	+= r3k_dump_tlb.o
-else
-  lib-y	+= dump_tlb.o
-endif
+obj-$(CONFIG_CPU_MIPS32)	+= dump_tlb.o
+obj-$(CONFIG_CPU_MIPS64)	+= dump_tlb.o
+obj-$(CONFIG_CPU_NEVADA)	+= dump_tlb.o
+obj-$(CONFIG_CPU_R10000)	+= dump_tlb.o
+obj-$(CONFIG_CPU_R3000)		+= r3k_dump_tlb.o
+obj-$(CONFIG_CPU_R4300)		+= dump_tlb.o
+obj-$(CONFIG_CPU_R4X00)		+= dump_tlb.o
+obj-$(CONFIG_CPU_R5000)		+= dump_tlb.o
+obj-$(CONFIG_CPU_R5432)		+= dump_tlb.o
+obj-$(CONFIG_CPU_R6000)		+=
+obj-$(CONFIG_CPU_R8000)		+=
+obj-$(CONFIG_CPU_RM7000)	+= dump_tlb.o
+obj-$(CONFIG_CPU_RM9000)	+= dump_tlb.o
+obj-$(CONFIG_CPU_SB1)		+= dump_tlb.o
+obj-$(CONFIG_CPU_TX39XX)	+= r3k_dump_tlb.o
+obj-$(CONFIG_CPU_TX49XX)	+= dump_tlb.o
+obj-$(CONFIG_CPU_VR41XX)	+= dump_tlb.o
 
 EXTRA_AFLAGS := $(CFLAGS)
diff --git a/arch/mips/lib-64/Makefile b/arch/mips/lib-64/Makefile
index 1bde2a003..fd6a2bafd 100644
--- a/arch/mips/lib-64/Makefile
+++ b/arch/mips/lib-64/Makefile
@@ -4,10 +4,22 @@
 
 lib-y	+= csum_partial.o memset.o watch.o 
 
-ifeq ($(CONFIG_CPU_R3000)$(CONFIG_CPU_TX39XX),y)
-  lib-y	+= r3k_dump_tlb.o
-else
-  lib-y	+= dump_tlb.o
-endif
+obj-$(CONFIG_CPU_MIPS32)	+= dump_tlb.o
+obj-$(CONFIG_CPU_MIPS64)	+= dump_tlb.o
+obj-$(CONFIG_CPU_NEVADA)	+= dump_tlb.o
+obj-$(CONFIG_CPU_R10000)	+= dump_tlb.o
+obj-$(CONFIG_CPU_R3000)		+= r3k_dump_tlb.o
+obj-$(CONFIG_CPU_R4300)		+= dump_tlb.o
+obj-$(CONFIG_CPU_R4X00)		+= dump_tlb.o
+obj-$(CONFIG_CPU_R5000)		+= dump_tlb.o
+obj-$(CONFIG_CPU_R5432)		+= dump_tlb.o
+obj-$(CONFIG_CPU_R6000)		+=
+obj-$(CONFIG_CPU_R8000)		+=
+obj-$(CONFIG_CPU_RM7000)	+= dump_tlb.o
+obj-$(CONFIG_CPU_RM9000)	+= dump_tlb.o
+obj-$(CONFIG_CPU_SB1)		+= dump_tlb.o
+obj-$(CONFIG_CPU_TX39XX)	+= r3k_dump_tlb.o
+obj-$(CONFIG_CPU_TX49XX)	+= dump_tlb.o
+obj-$(CONFIG_CPU_VR41XX)	+= dump_tlb.o
 
 EXTRA_AFLAGS := $(CFLAGS)
diff --git a/arch/mips/mips-boards/generic/cmdline.c b/arch/mips/mips-boards/generic/cmdline.c
index c1b46edc6..1871c30ed 100644
--- a/arch/mips/mips-boards/generic/cmdline.c
+++ b/arch/mips/mips-boards/generic/cmdline.c
@@ -51,7 +51,9 @@ void  __init prom_init_cmdline(void)
 		*cp++ = ' ';
 		actr++;
 	}
-	if (cp != &(arcs_cmdline[0])) /* get rid of trailing space */
+	if (cp != &(arcs_cmdline[0])) {
+		/* get rid of trailing space */
 		--cp;
-	*cp = '\0';
+		*cp = '\0';
+	}
 }
diff --git a/arch/mips/mips-boards/generic/printf.c b/arch/mips/mips-boards/generic/printf.c
index b1edd90b9..2c1ab1f19 100644
--- a/arch/mips/mips-boards/generic/printf.c
+++ b/arch/mips/mips-boards/generic/printf.c
@@ -59,7 +59,7 @@ static inline void serial_out(int offset, int value)
 	outb(value, PORT(offset));
 }
 
-int putPromChar(char c)
+int prom_putchar(char c)
 {
 	while ((serial_in(UART_LSR) & UART_LSR_THRE) == 0)
 		;
@@ -69,7 +69,7 @@ int putPromChar(char c)
 	return 1;
 }
 
-char getPromChar(void)
+char prom_getchar(void)
 {
 	while (!(serial_in(UART_LSR) & UART_LSR_DR))
 		;
@@ -77,33 +77,3 @@ char getPromChar(void)
 	return serial_in(UART_RX);
 }
 
-static spinlock_t con_lock = SPIN_LOCK_UNLOCKED;
-
-static char buf[1024];
-
-void __init prom_printf(char *fmt, ...)
-{
-	va_list args;
-	int l;
-	char *p, *buf_end;
-	long flags;
-
-	spin_lock_irqsave(con_lock, 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);
-	}
-	/* wait for output to drain */
-	while ((serial_in(UART_LSR) & UART_LSR_TEMT) == 0)
-		;
-	spin_unlock_irqrestore(con_lock, flags);
-}
diff --git a/arch/mips/mm/Makefile b/arch/mips/mm/Makefile
index 2fdae0a87..04c393f26 100644
--- a/arch/mips/mm/Makefile
+++ b/arch/mips/mm/Makefile
@@ -12,19 +12,54 @@ obj-$(CONFIG_CPU_MIPS32)	+= c-r4k.o cex-gen.o pg-r4k.o tlb-r4k.o
 obj-$(CONFIG_CPU_MIPS64)	+= c-r4k.o cex-gen.o pg-r4k.o tlb-r4k.o
 obj-$(CONFIG_CPU_NEVADA)	+= c-r4k.o cex-gen.o pg-r4k.o tlb-r4k.o
 obj-$(CONFIG_CPU_R10000)	+= c-r4k.o cex-gen.o pg-r4k.o tlb-andes.o
-obj-$(CONFIG_CPU_R3000)		+= c-r3k.o tlb-r3k.o pg-r4k.o tlbex-r3k.o
+obj-$(CONFIG_CPU_R3000)		+= c-r3k.o tlb-r3k.o pg-r4k.o
 obj-$(CONFIG_CPU_R4300)		+= c-r4k.o cex-gen.o pg-r4k.o tlb-r4k.o
 obj-$(CONFIG_CPU_R4X00)		+= c-r4k.o cex-gen.o pg-r4k.o tlb-r4k.o
 obj-$(CONFIG_CPU_R5000)		+= c-r4k.o cex-gen.o pg-r4k.o tlb-r4k.o
 obj-$(CONFIG_CPU_R5432)		+= c-r4k.o cex-gen.o pg-r4k.o tlb-r4k.o
+obj-$(CONFIG_CPU_R8000)		+= c-r4k.o cex-gen.o pg-r4k.o tlb-r8k.o
 obj-$(CONFIG_CPU_RM7000)	+= c-r4k.o cex-gen.o pg-r4k.o tlb-r4k.o
 obj-$(CONFIG_CPU_RM9000)	+= c-r4k.o cex-gen.o pg-r4k.o tlb-r4k.o
 obj-$(CONFIG_CPU_SB1)		+= c-sb1.o cerr-sb1.o cex-sb1.o pg-sb1.o \
 				   tlb-sb1.o
-obj-$(CONFIG_CPU_TX39XX)	+= c-tx39.o pg-r4k.o tlb-r3k.o tlbex-r3k.o
+obj-$(CONFIG_CPU_TX39XX)	+= c-tx39.o pg-r4k.o tlb-r3k.o
 obj-$(CONFIG_CPU_TX49XX)	+= c-r4k.o cex-gen.o pg-r4k.o tlb-r4k.o
 obj-$(CONFIG_CPU_VR41XX)	+= c-r4k.o cex-gen.o pg-r4k.o tlb-r4k.o
 
+#
+# TLB exception handling code differs between 32-bit and 64-bit kernels.
+#
+ifdef CONFIG_MIPS32
+obj-$(CONFIG_CPU_R3000)		+= tlbex32-r3k.o
+obj-$(CONFIG_CPU_TX49XX)	+= tlbex32-r4k.o
+obj-$(CONFIG_CPU_R4300)		+= tlbex32-r4k.o
+obj-$(CONFIG_CPU_R4X00)		+= tlbex32-r4k.o
+obj-$(CONFIG_CPU_VR41XX)	+= tlbex32-r4k.o
+obj-$(CONFIG_CPU_R5000)		+= tlbex32-r4k.o
+obj-$(CONFIG_CPU_NEVADA)	+= tlbex32-r4k.o
+obj-$(CONFIG_CPU_R5432)		+= tlbex32-r4k.o
+obj-$(CONFIG_CPU_RM7000)	+= tlbex32-r4k.o
+obj-$(CONFIG_CPU_RM9000)	+= tlbex32-r4k.o
+obj-$(CONFIG_CPU_R10000)	+= tlbex32-r4k.o
+obj-$(CONFIG_CPU_MIPS32)	+= tlbex32-r4k.o
+obj-$(CONFIG_CPU_MIPS64)	+= tlbex32-r4k.o
+obj-$(CONFIG_CPU_SB1)		+= tlbex32-r4k.o
+obj-$(CONFIG_CPU_TX39XX)	+= tlbex32-r3k.o
+endif
+ifdef CONFIG_MIPS64
+obj-$(CONFIG_CPU_R4300)		+= tlb64-glue-r4k.o tlbex64-r4k.o
+obj-$(CONFIG_CPU_R4X00)		+= tlb64-glue-r4k.o tlbex64-r4k.o
+obj-$(CONFIG_CPU_R5000)		+= tlb64-glue-r4k.o tlbex64-r4k.o
+obj-$(CONFIG_CPU_NEVADA)	+= tlb64-glue-r4k.o tlbex64-r4k.o
+obj-$(CONFIG_CPU_R5432)		+= tlb64-glue-r4k.o tlbex64-r4k.o
+obj-$(CONFIG_CPU_RM7000)	+= tlb64-glue-r4k.o tlbex64-r4k.o
+obj-$(CONFIG_CPU_RM9000)	+= tlb64-glue-r4k.o tlbex64-r4k.o
+obj-$(CONFIG_CPU_R10000)	+= tlb64-glue-r4k.o tlbex64-r4k.o
+obj-$(CONFIG_CPU_SB1)		+= tlb64-glue-sb1.o tlbex64-r4k.o
+obj-$(CONFIG_CPU_MIPS64)	+= tlb64-glue-r4k.o tlbex64-r4k.o
+endif
+
+
 obj-$(CONFIG_IP22_CPU_SCACHE)	+= sc-ip22.o
 obj-$(CONFIG_R5000_CPU_SCACHE)  += sc-r5k.o
 obj-$(CONFIG_RM7000_CPU_SCACHE)	+= sc-rm7k.o
diff --git a/arch/mips/mm/pgtable.c b/arch/mips/mm/pgtable.c
index b1722b8f6..8c30f32a6 100644
--- a/arch/mips/mm/pgtable.c
+++ b/arch/mips/mm/pgtable.c
@@ -12,7 +12,7 @@ void show_mem(void)
 
 	printk("Mem-info:\n");
 	show_free_areas();
-	printk("Free swap:       %6dkB\n",nr_swap_pages<<(PAGE_SHIFT-10));
+	printk("Free swap:       %6ldkB\n", nr_swap_pages<<(PAGE_SHIFT-10));
 	pfn = max_mapnr;
 	while (pfn-- > 0) {
 		page = pfn_to_page(pfn);
diff --git a/arch/mips/mm/sc-rm7k.c b/arch/mips/mm/sc-rm7k.c
index ec3ec9e90..9796a2279 100644
--- a/arch/mips/mm/sc-rm7k.c
+++ b/arch/mips/mm/sc-rm7k.c
@@ -147,55 +147,47 @@ static void rm7k_sc_disable(void)
 	clear_c0_config(1<<3);				/* CONF_SE */
 }
 
-static inline int __init rm7k_sc_probe(void)
+struct bcache_ops rm7k_sc_ops = {
+	.bc_enable = rm7k_sc_enable,
+	.bc_disable = rm7k_sc_disable,
+	.bc_wback_inv = rm7k_sc_wback_inv,
+	.bc_inv = rm7k_sc_inv
+};
+
+void __init rm7k_sc_init(void)
 {
 	unsigned int config = read_c0_config();
 
-	if ((config >> 31) & 1)
-		return 0;
+	if ((config >> 31) & 1)		/* Bit 31 set -> no S-Cache */
+		return;
 
 	printk(KERN_INFO "Secondary cache size %dK, linesize %d bytes.\n",
 	       (scache_size >> 10), sc_lsize);
 
-	if ((config >> 3) & 1)                          /* CONF_SE */
-		return 1;
+	if (!((config >> 3) & 1))	/* CONF_SE */
+		rm7k_sc_enable();
 
 	/*
 	 * While we're at it let's deal with the tertiary cache.
 	 */
-	if ((config >> 17) & 1)
-		return 1;
-
-	/*
-	 * We can't enable the L3 cache yet. There may be board-specific
-	 * magic necessary to turn it on, and blindly asking the CPU to
-	 * start using it would may give cache errors.
-	 *
-	 * Also, board-specific knowledge may allow us to use the
-	 * CACHE Flash_Invalidate_T instruction if the tag RAM supports
-	 * it, and may specify the size of the L3 cache so we don't have
-	 * to probe it.
-	 */
-	printk(KERN_INFO "Tertiary cache present, %s enabled\n",
-	       config&(1<<12) ? "already" : "not (yet)");
-
-	if ((config >> 12) & 1)
-		rm7k_tcache_enabled = 1;
-
-	return 1;
-}
-
-struct bcache_ops rm7k_sc_ops = {
-	.bc_enable = rm7k_sc_enable,
-	.bc_disable = rm7k_sc_disable,
-	.bc_wback_inv = rm7k_sc_wback_inv,
-	.bc_inv = rm7k_sc_inv
-};
-
-void __init rm7k_sc_init(void)
-{
-	if (rm7k_sc_probe()) {
-		rm7k_sc_enable();
-		bcops = &rm7k_sc_ops;
+	if (!((config >> 17) & 1)) {
+
+		/*
+		 * We can't enable the L3 cache yet. There may be board-specific
+		 * magic necessary to turn it on, and blindly asking the CPU to
+		 * start using it would may give cache errors.
+		 *
+		 * Also, board-specific knowledge may allow us to use the
+		 * CACHE Flash_Invalidate_T instruction if the tag RAM supports
+		 * it, and may specify the size of the L3 cache so we don't have
+		 * to probe it.
+		 */
+		printk(KERN_INFO "Tertiary cache present, %s enabled\n",
+		       config&(1<<12) ? "already" : "not (yet)");
+
+		if ((config >> 12) & 1)
+			rm7k_tcache_enabled = 1;
 	}
+
+	bcops = &rm7k_sc_ops;
 }
diff --git a/arch/mips/mm/tlb-sb1.c b/arch/mips/mm/tlb-sb1.c
index e2096dc21..33c177e65 100644
--- a/arch/mips/mm/tlb-sb1.c
+++ b/arch/mips/mm/tlb-sb1.c
@@ -125,7 +125,7 @@ void local_flush_tlb_all(void)
  * with the firmware, go back and give all the entries invalid addresses with
  * the normal flush routine.  Wired entries will be killed as well!
  */
-void sb1_sanitize_tlb(void)
+static void __init sb1_sanitize_tlb(void)
 {
 	int entry;
 	long addr = 0;
diff --git a/arch/mips/momentum/jaguar_atx/irq.c b/arch/mips/momentum/jaguar_atx/irq.c
index f13f85606..cc25cbcb4 100644
--- a/arch/mips/momentum/jaguar_atx/irq.c
+++ b/arch/mips/momentum/jaguar_atx/irq.c
@@ -42,7 +42,7 @@
 extern asmlinkage void jaguar_handle_int(void);
 
 static struct irqaction cascade_mv64340 = {
-	no_action, SA_INTERRUPT, 0, "MV64340-Cascade", NULL, NULL
+	no_action, SA_INTERRUPT, CPU_MASK_NONE, "MV64340-Cascade", NULL, NULL
 };
 
 void __init init_IRQ(void)
diff --git a/arch/mips/momentum/jaguar_atx/prom.c b/arch/mips/momentum/jaguar_atx/prom.c
index 10acbe9b0..df52d2adf 100644
--- a/arch/mips/momentum/jaguar_atx/prom.c
+++ b/arch/mips/momentum/jaguar_atx/prom.c
@@ -33,7 +33,6 @@ extern void ja_setup_console(void);
 
 struct callvectors *debug_vectors;
 
-extern unsigned long mv64340_base;
 extern unsigned long cpu_clock;
 
 const char *get_system_type(void)
@@ -185,13 +184,13 @@ void __init prom_init(void)
 			break;
 
 		if (strncmp("gtbase", ptr, strlen("gtbase")) == 0) {
-			mv64340_base = simple_strtol(ptr + strlen("gtbase="),
+			marvell_base = simple_strtol(ptr + strlen("gtbase="),
 							NULL, 16);
 
-			if ((mv64340_base & 0xffffffff00000000) == 0)
-				mv64340_base |= 0xffffffff00000000;
+			if ((marvell_base & 0xffffffff00000000) == 0)
+				marvell_base |= 0xffffffff00000000;
 
-			printk("mv64340_base set to 0x%016lx\n", mv64340_base);
+			printk("marvell_base set to 0x%016lx\n", marvell_base);
 		}
 		if (strncmp("cpuclock", ptr, strlen("cpuclock")) == 0) {
 			cpu_clock = simple_strtol(ptr + strlen("cpuclock="),
@@ -218,7 +217,7 @@ void __init prom_init(void)
 
 	while (*env) {
 		if (strncmp("gtbase", *env, strlen("gtbase")) == 0) {
-			mv64340_base = simple_strtol(*env + strlen("gtbase="),
+			marvell_base = simple_strtol(*env + strlen("gtbase="),
 							NULL, 16);
 		}
 		if (strncmp("cpuclock", *env, strlen("cpuclock")) == 0) {
@@ -245,20 +244,6 @@ void __init prom_fixup_mem_map(unsigned long start, unsigned long end)
 {
 }
 
-/*
- * SMP support
- */
-int prom_setup_smp(void)
-{
-	int	num_cpus = 2;
-
-	/*
-	 * We know that the RM9000 on the Jaguar ATX board has 2 cores.
-	 * Hence, this can be hardcoded for now.
-	 */
-	return num_cpus;
-}
-
 int prom_boot_secondary(int cpu, unsigned long sp, unsigned long gp)
 {
 	/* Clear the semaphore */
diff --git a/arch/mips/momentum/jaguar_atx/setup.c b/arch/mips/momentum/jaguar_atx/setup.c
index 7c2f25ffc..a849215b5 100644
--- a/arch/mips/momentum/jaguar_atx/setup.c
+++ b/arch/mips/momentum/jaguar_atx/setup.c
@@ -46,6 +46,8 @@
 #include <linux/types.h>
 #include <linux/mm.h>
 #include <linux/bootmem.h>
+#include <linux/module.h>
+#include <linux/pci.h>
 #include <linux/swap.h>
 #include <linux/ioport.h>
 #include <linux/sched.h>
@@ -57,7 +59,6 @@
 #include <asm/page.h>
 #include <asm/io.h>
 #include <asm/irq.h>
-#include <asm/pci.h>
 #include <asm/pci_channel.h>
 #include <asm/processor.h>
 #include <asm/ptrace.h>
@@ -119,19 +120,21 @@ static __init void wire_stupidity_into_tlb(void)
 //	add_wired_entry(ENTRYLO(0xfe000000), ENTRYLO(0xff000000),
 //	                0xfe000000UL, PM_16M);
 
-	mv64340_base = 0xf4000000;
+	marvell_base = 0xf4000000;
 	//mv64340_sram_base = 0xfe000000;	/* Currently unused */
 #endif
 }
 
-unsigned long mv64340_base	= 0xf4000000L;
+unsigned long marvell_base	= 0xf4000000L;
 unsigned long ja_fpga_base	= JAGUAR_ATX_CS0_ADDR;
 unsigned long uart_base		= 0xfd000000L;
 static unsigned char *rtc_base	= (unsigned char*) 0xfc800000L;
 
+EXPORT_SYMBOL(marvell_base);
+
 static __init int per_cpu_mappings(void)
 {
-	mv64340_base	= (unsigned long) ioremap(0xf4000000, 0x10000);
+	marvell_base	= (unsigned long) ioremap(0xf4000000, 0x10000);
 	ja_fpga_base	= (unsigned long) ioremap(JAGUAR_ATX_CS0_ADDR,  0x1000);
 	uart_base	= (unsigned long) ioremap(0xfd000000UL, 0x1000);
 	rtc_base	= ioremap(0xfc000000UL, 0x8000);
@@ -233,12 +236,14 @@ static struct resource mv_pci_mem0_resource = {
 	.flags	= IORESOURCE_MEM
 };
 
-extern struct pci_ops mv64340_bus0_pci_ops;
-
-static struct pci_controller mv_bus0_controller = {
-	.pci_ops	= &mv64340_bus0_pci_ops,
-	.mem_resource	= &mv_pci_mem0_resource,
-	.io_resource	= &mv_pci_io_mem0_resource,
+static struct mv_pci_controller mv_bus0_controller = {
+	.pcic = {
+		.pci_ops	= &mv_pci_ops,
+		.mem_resource	= &mv_pci_mem0_resource,
+		.io_resource	= &mv_pci_io_mem0_resource,
+	},
+	.config_addr	= MV64340_PCI_0_CONFIG_ADDR,
+	.config_vreg	= MV64340_PCI_0_CONFIG_DATA_VIRTUAL_REG,
 };
 
 static uint32_t mv_io_base, mv_io_size;
@@ -253,16 +258,16 @@ static void ja_pci0_init(void)
 	mem0_base = MV_READ(MV64340_PCI_0_MEMORY0_BASE_ADDR) << 16;
 	mem0_size = (MV_READ(MV64340_PCI_0_MEMORY0_SIZE) + 1) << 16;
 
-	mv_pci_io_mem0_resource.start	= 0;
-	mv_pci_io_mem0_resource.end	= io_size - 1;
-	mv_pci_mem0_resource.start	= mem0_base;
-	mv_pci_mem0_resource.end	= mem0_base + mem0_size - 1;
-	mv_bus0_controller.mem_offset	= mem0_base;
-	mv_bus0_controller.io_offset	= 0;
+	mv_pci_io_mem0_resource.start		= 0;
+	mv_pci_io_mem0_resource.end		= io_size - 1;
+	mv_pci_mem0_resource.start		= mem0_base;
+	mv_pci_mem0_resource.end		= mem0_base + mem0_size - 1;
+	mv_bus0_controller.pcic.mem_offset	= mem0_base;
+	mv_bus0_controller.pcic.io_offset	= 0;
 
 	ioport_resource.end		= io_size - 1;
 
-	register_pci_controller(&mv_bus0_controller);
+	register_pci_controller(&mv_bus0_controller.pcic);
 
 	mv_io_base = io_base;
 	mv_io_size = io_size;
@@ -278,12 +283,14 @@ static struct resource mv_pci_mem1_resource = {
 	.flags	= IORESOURCE_MEM
 };
 
-extern struct pci_ops mv64340_bus1_pci_ops;
-
-static struct pci_controller mv_bus1_controller = {
-	.pci_ops	= &mv64340_bus1_pci_ops,
-	.mem_resource	= &mv_pci_mem1_resource,
-	.io_resource	= &mv_pci_io_mem1_resource,
+static struct mv_pci_controller mv_bus1_controller = {
+	.pcic = {
+		.pci_ops	= &mv_pci_ops,
+		.mem_resource	= &mv_pci_mem1_resource,
+		.io_resource	= &mv_pci_io_mem1_resource,
+	},
+	.config_addr	= MV64340_PCI_1_CONFIG_ADDR,
+	.config_vreg	= MV64340_PCI_1_CONFIG_DATA_VIRTUAL_REG,
 };
 
 static __init void ja_pci1_init(void)
@@ -301,16 +308,16 @@ static __init void ja_pci1_init(void)
 	 * the first.  A gap is no problem but would waste address space for
 	 * remapping the port space.
 	 */
-	mv_pci_io_mem1_resource.start	= mv_io_size;
-	mv_pci_io_mem1_resource.end	= mv_io_size + io_size - 1;
-	mv_pci_mem1_resource.start	= mem0_base;
-	mv_pci_mem1_resource.end	= mem0_base + mem0_size - 1;
-	mv_bus1_controller.mem_offset	= mem0_base;
-	mv_bus1_controller.io_offset	= 0;
+	mv_pci_io_mem1_resource.start		= mv_io_size;
+	mv_pci_io_mem1_resource.end		= mv_io_size + io_size - 1;
+	mv_pci_mem1_resource.start		= mem0_base;
+	mv_pci_mem1_resource.end		= mem0_base + mem0_size - 1;
+	mv_bus1_controller.pcic.mem_offset	= mem0_base;
+	mv_bus1_controller.pcic.io_offset	= 0;
 
 	ioport_resource.end		= io_base + io_size -mv_io_base - 1;
 
-	register_pci_controller(&mv_bus1_controller);
+	register_pci_controller(&mv_bus1_controller.pcic);
 
 	mv_io_size = io_base + io_size - mv_io_base;
 }
diff --git a/arch/mips/momentum/ocelot_c/Makefile b/arch/mips/momentum/ocelot_c/Makefile
index 6efdd145e..91240777f 100644
--- a/arch/mips/momentum/ocelot_c/Makefile
+++ b/arch/mips/momentum/ocelot_c/Makefile
@@ -2,7 +2,7 @@
 # Makefile for Momentum Computer's Ocelot-C and -CS boards.
 #
 
-obj-y	 		+= cpci-irq.o uart-irq.o int-handler.o irq.o pci-irq.o \
-			   prom.o reset.o setup.o
+obj-y	 		+= cpci-irq.o int-handler.o irq.o prom.o reset.o \
+			   setup.o uart-irq.o
 
 obj-$(CONFIG_KGDB)	+= dbg_io.o
diff --git a/arch/mips/momentum/ocelot_c/irq.c b/arch/mips/momentum/ocelot_c/irq.c
index d12f5befd..13dd8bd74 100644
--- a/arch/mips/momentum/ocelot_c/irq.c
+++ b/arch/mips/momentum/ocelot_c/irq.c
@@ -44,8 +44,9 @@
 #include <asm/bitops.h>
 #include <asm/bootinfo.h>
 #include <asm/io.h>
-#include <asm/irq.h>
+#include <asm/irq_cpu.h>
 #include <asm/mipsregs.h>
+#include <asm/mv64340.h>
 #include <asm/system.h>
 
 extern asmlinkage void ocelot_handle_int(void);
@@ -53,11 +54,11 @@ extern void uart_irq_init(void);
 extern void cpci_irq_init(void);
 
 static struct irqaction cascade_fpga = {
-	no_action, SA_INTERRUPT, 0, "cascade via FPGA", NULL, NULL
+	no_action, SA_INTERRUPT, CPU_MASK_NONE, "cascade via FPGA", NULL, NULL
 };
 
 static struct irqaction cascade_mv64340 = {
-	no_action, SA_INTERRUPT, 0, "cascade via MV64340", NULL, NULL
+	no_action, SA_INTERRUPT, CPU_MASK_NONE, "cascade via MV64340", NULL, NULL
 };
 
 void __init init_IRQ(void)
diff --git a/arch/mips/momentum/ocelot_c/prom.c b/arch/mips/momentum/ocelot_c/prom.c
index 0387b562b..762112965 100644
--- a/arch/mips/momentum/ocelot_c/prom.c
+++ b/arch/mips/momentum/ocelot_c/prom.c
@@ -29,7 +29,7 @@
 
 struct callvectors* debug_vectors;
 
-extern unsigned long mv64340_base;
+extern unsigned long marvell_base;
 extern unsigned long cpu_clock;
 
 #ifdef CONFIG_MV64340_ETH
@@ -147,13 +147,14 @@ char *arg64(unsigned long addrin, int arg_index)
 #endif  /* CONFIG_MIPS64 */
 
 
-/* [jsun@junsun.net] PMON passes arguments in C main() style */
 void __init prom_init(void)
 {
 	int argc = fw_arg0;
 	char **arg = (char **) fw_arg1;
 	char **env = (char **) fw_arg2;
+	struct callvectors *cv = (struct callvectors *) fw_arg3;
 	int i;
+
 #ifdef CONFIG_MIPS64
 	char *ptr;
 
@@ -179,13 +180,13 @@ void __init prom_init(void)
 			break;
 
 		if (strncmp("gtbase", ptr, strlen("gtbase")) == 0) {
-			mv64340_base = simple_strtol(ptr + strlen("gtbase="),
+			marvell_base = simple_strtol(ptr + strlen("gtbase="),
 							NULL, 16);
 
-			if ((mv64340_base & 0xffffffff00000000) == 0)
-				mv64340_base |= 0xffffffff00000000;
+			if ((marvell_base & 0xffffffff00000000) == 0)
+				marvell_base |= 0xffffffff00000000;
 
-			printk("mv64340_base set to 0x%016lx\n", mv64340_base);
+			printk("marvell_base set to 0x%016lx\n", marvell_base);
 		}
 		if (strncmp("cpuclock", ptr, strlen("cpuclock")) == 0) {
 			cpu_clock = simple_strtol(ptr + strlen("cpuclock="),
@@ -212,7 +213,7 @@ void __init prom_init(void)
 
 	while (*env) {
 		if (strncmp("gtbase", *env, strlen("gtbase")) == 0) {
-			mv64340_base = simple_strtol(*env + strlen("gtbase="),
+			marvell_base = simple_strtol(*env + strlen("gtbase="),
 							NULL, 16);
 		}
 		if (strncmp("cpuclock", *env, strlen("cpuclock")) == 0) {
diff --git a/arch/mips/momentum/ocelot_c/setup.c b/arch/mips/momentum/ocelot_c/setup.c
index 1079858bf..021c00e3c 100644
--- a/arch/mips/momentum/ocelot_c/setup.c
+++ b/arch/mips/momentum/ocelot_c/setup.c
@@ -67,7 +67,7 @@
 #include <asm/mv64340.h>
 #include "ocelot_c_fpga.h"
 
-unsigned long mv64340_base;
+unsigned long marvell_base;
 extern unsigned long mv64340_sram_base;
 unsigned long cpu_clock;
 
@@ -117,7 +117,7 @@ void PMON_v2_setup(void)
 	/* m-sys and internal SRAM */
 	add_wired_entry(ENTRYLO(0xfe000000), ENTRYLO(0xff000000), 0xfffffffffe000000, PM_16M);
 
-	mv64340_base = 0xfffffffff4000000;
+	marvell_base = 0xfffffffff4000000;
 	mv64340_sram_base = 0xfffffffffe000000;
 #else
 	/* marvell and extra space */
@@ -127,7 +127,7 @@ void PMON_v2_setup(void)
 	/* m-sys and internal SRAM */
 	add_wired_entry(ENTRYLO(0xfe000000), ENTRYLO(0xff000000), 0xfe000000, PM_16M);
 
-	mv64340_base = 0xf4000000;
+	marvell_base = 0xf4000000;
 	mv64340_sram_base = 0xfe000000;
 #endif
 }
@@ -193,7 +193,7 @@ int m48t37y_set_time(unsigned long sec)
 	rtc_base[0x7ff9] = BIN2BCD(tm.tm_sec);
 
 	/* day of week -- not really used, but let's keep it up-to-date */
-	rtc_base[0x7ffc] = CONV_BIN2BCD(tm.tm_wday + 1);
+	rtc_base[0x7ffc] = BIN2BCD(tm.tm_wday + 1);
 
 	/* disable writing */
 	rtc_base[0x7ff8] = 0x00;
diff --git a/arch/mips/momentum/ocelot_g/Makefile b/arch/mips/momentum/ocelot_g/Makefile
index bdd8d3292..e5f1cb086 100644
--- a/arch/mips/momentum/ocelot_g/Makefile
+++ b/arch/mips/momentum/ocelot_g/Makefile
@@ -2,8 +2,7 @@
 # Makefile for Momentum Computer's Ocelot-G board.
 #
 
-obj-y	 		+= gt-irq.o pci-irq.o int-handler.o irq.o prom.o \
-			   reset.o setup.o
+obj-y	 		+= int-handler.o irq.o gt-irq.o prom.o reset.o setup.o
 obj-$(CONFIG_KGDB)	+= dbg_io.o
 
 EXTRA_AFLAGS := $(CFLAGS)
diff --git a/arch/mips/momentum/ocelot_g/gt-irq.c b/arch/mips/momentum/ocelot_g/gt-irq.c
index 3afe32739..93708965b 100644
--- a/arch/mips/momentum/ocelot_g/gt-irq.c
+++ b/arch/mips/momentum/ocelot_g/gt-irq.c
@@ -17,8 +17,8 @@
 #include <asm/ptrace.h>
 #include <linux/sched.h>
 #include <linux/kernel_stat.h>
+#include <asm/gt64240.h>
 #include <asm/io.h>
-#include "gt64240.h"
 
 unsigned long bus_clock;
 
@@ -108,29 +108,29 @@ int disable_galileo_irq(int int_cause, int bit_num)
  * we keep this particular structure in the function.
  */
 
-static void gt64240_p0int_irq(int irq, void *dev_id, struct pt_regs *regs)
+static irqreturn_t gt64240_p0int_irq(int irq, void *dev, struct pt_regs *regs)
 {
 	uint32_t irq_src, irq_src_mask;
 	int handled;
 
 	/* get the low interrupt cause register */
-	GT_READ(LOW_INTERRUPT_CAUSE_REGISTER, &irq_src);
+	irq_src = MV_READ(LOW_INTERRUPT_CAUSE_REGISTER);
 
 	/* get the mask register for this pin */
-	GT_READ(PCI_0INTERRUPT_CAUSE_MASK_REGISTER_LOW, &irq_src_mask);
+	irq_src_mask = MV_READ(PCI_0INTERRUPT_CAUSE_MASK_REGISTER_LOW);
 
 	/* mask off only the interrupts we're interested in */
 	irq_src = irq_src & irq_src_mask;
 
-	handled = 0;
+	handled = IRQ_NONE;
 
 	/* Check for timer interrupt */
 	if (irq_src & 0x00000100) {
-		handled = 1;
+		handled = IRQ_HANDLED;
 		irq_src &= ~0x00000100;
 
 		/* Clear any pending cause bits */
-		GT_WRITE(TIMER_COUNTER_0_3_INTERRUPT_CAUSE, 0x0);
+		MV_WRITE(TIMER_COUNTER_0_3_INTERRUPT_CAUSE, 0x0);
 
 		/* handle the timer call */
 		do_timer(regs);
@@ -141,90 +141,8 @@ static void gt64240_p0int_irq(int irq, void *dev_id, struct pt_regs *regs)
 		       "UNKNOWN P0_INT# interrupt received, irq_src=0x%x\n",
 		       irq_src);
 	}
-}
-
-/*
- * Interrupt handler for interrupts coming from the Galileo chip.
- * It could be built in ethernet ports etc...
- */
-static void gt64240_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;
-
-#if 0
-	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);
-#endif
-	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  */
-	}
-#if 0
-	GT_WRITE(GT_INTRCAUSE_OFS, 0);
-	GT_WRITE(GT_HINTRCAUSE_OFS, 0);
-#endif
 
-#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
+	return handled;
 }
 
 /*
@@ -242,10 +160,10 @@ void gt64240_time_init(void)
 	static struct irqaction timer;
 
 	/* Stop the timer -- we'll use timer #0 */
-	GT_WRITE(TIMER_COUNTER_0_3_CONTROL, 0x0);
+	MV_WRITE(TIMER_COUNTER_0_3_CONTROL, 0x0);
 
 	/* Load timer value for 100 Hz */
-	GT_WRITE(TIMER_COUNTER0, bus_clock / 100);
+	MV_WRITE(TIMER_COUNTER0, bus_clock / 100);
 
 	/*
 	 * Create the IRQ structure entry for the timer.  Since we're too early
@@ -263,16 +181,16 @@ void gt64240_time_init(void)
 	enable_irq(6);
 
 	/* Clear any pending cause bits */
-	GT_WRITE(TIMER_COUNTER_0_3_INTERRUPT_CAUSE, 0x0);
+	MV_WRITE(TIMER_COUNTER_0_3_INTERRUPT_CAUSE, 0x0);
 
 	/* Enable the interrupt for timer 0 */
-	GT_WRITE(TIMER_COUNTER_0_3_INTERRUPT_MASK, 0x1);
+	MV_WRITE(TIMER_COUNTER_0_3_INTERRUPT_MASK, 0x1);
 
 	/* Enable the timer interrupt for GT-64240 pin P0_INT# */
-	GT_WRITE (PCI_0INTERRUPT_CAUSE_MASK_REGISTER_LOW, 0x100);
+	MV_WRITE (PCI_0INTERRUPT_CAUSE_MASK_REGISTER_LOW, 0x100);
 
 	/* Configure and start the timer */
-	GT_WRITE(TIMER_COUNTER_0_3_CONTROL, 0x3);
+	MV_WRITE(TIMER_COUNTER_0_3_CONTROL, 0x3);
 }
 
 void gt64240_irq_init(void)
diff --git a/arch/mips/momentum/ocelot_g/prom.c b/arch/mips/momentum/ocelot_g/prom.c
index 2b480b2ef..6b4f577c2 100644
--- a/arch/mips/momentum/ocelot_g/prom.c
+++ b/arch/mips/momentum/ocelot_g/prom.c
@@ -20,13 +20,13 @@
 #include <asm/addrspace.h>
 #include <asm/bootinfo.h>
 #include <asm/pmon.h>
+#include <asm/gt64240.h>
 
-#include "gt64240.h"
 #include "ocelot_pld.h"
 
 struct callvectors* debug_vectors;
 
-extern unsigned long gt64240_base;
+extern unsigned long marvell_base;
 extern unsigned long bus_clock;
 
 #ifdef CONFIG_GALILLEO_GT64240_ETH
@@ -38,10 +38,8 @@ const char *get_system_type(void)
 	return "Momentum Ocelot";
 }
 
-/* [jsun@junsun.net] PMON passes arguments in C main() style */
 void __init prom_init(void)
 {
-	uint32_t tmp;
 	int argc = fw_arg0;
 	char **arg = (char **) fw_arg1;
 	char **env = (char **) fw_arg2;
@@ -71,17 +69,15 @@ void __init prom_init(void)
 
 	while (*env) {
 		if (strncmp("gtbase", *env, strlen("gtbase")) == 0) {
-			gt64240_base = simple_strtol(*env + strlen("gtbase="),
+			marvell_base = simple_strtol(*env + strlen("gtbase="),
 							NULL, 16);
 		}
 		if (strncmp("busclock", *env, strlen("busclock")) == 0) {
 			bus_clock = simple_strtol(*env + strlen("busclock="),
 							NULL, 10);
 		}
-		*env++;
+		env++;
 	}
-
-	debug_vectors->printf("Booting Linux kernel...\n");
 }
 
 unsigned long __init prom_free_prom_memory(void)
diff --git a/arch/mips/momentum/ocelot_g/setup.c b/arch/mips/momentum/ocelot_g/setup.c
index 9a3010dae..38a78ab8c 100644
--- a/arch/mips/momentum/ocelot_g/setup.c
+++ b/arch/mips/momentum/ocelot_g/setup.c
@@ -1,6 +1,4 @@
 /*
- * setup.c
- *
  * BRIEF MODULE DESCRIPTION
  * Momentum Computer Ocelot-G (CP7000G) - board dependent boot routines
  *
@@ -55,21 +53,21 @@
 #include <asm/bootinfo.h>
 #include <asm/page.h>
 #include <asm/io.h>
+#include <asm/gt64240.h>
 #include <asm/irq.h>
 #include <asm/pci.h>
 #include <asm/processor.h>
 #include <asm/ptrace.h>
 #include <asm/reboot.h>
 #include <linux/bootmem.h>
-#include <linux/blkdev.h>
-#include "gt64240.h"
+
 #include "ocelot_pld.h"
 
 #ifdef CONFIG_GALILLEO_GT64240_ETH
 extern unsigned char prom_mac_addr_base[6];
 #endif
 
-unsigned long gt64240_base;
+unsigned long marvell_base;
 
 /* These functions are used for rebooting or halting the machine*/
 extern void momenco_ocelot_restart(char *command);
@@ -88,8 +86,6 @@ static unsigned long ENTRYLO(unsigned long paddr)
 		_CACHE_UNCACHED)) >> 6;
 }
 
-static void __init setup_l3cache(unsigned long size);
-
 /* setup code for a handoff from a version 2 PMON 2000 PROM */
 void PMON_v2_setup(void)
 {
@@ -104,8 +100,10 @@ void PMON_v2_setup(void)
 		GT64240 Internal Regs	0xf4000000	0xe0000000
 		UARTs (CS2)		0xfd000000	0xe0001000
 	*/
-	add_wired_entry(ENTRYLO(0xf4000000), ENTRYLO(0xf4010000), 0xf4000000, PM_64K);
-	add_wired_entry(ENTRYLO(0xfd000000), ENTRYLO(0xfd001000), 0xfd000000, PM_4K);
+	add_wired_entry(ENTRYLO(0xf4000000), ENTRYLO(0xf4010000),
+	                0xf4000000, PM_64K);
+	add_wired_entry(ENTRYLO(0xfd000000), ENTRYLO(0xfd001000),
+	                0xfd000000, 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
@@ -114,15 +112,57 @@ void PMON_v2_setup(void)
 		Ocelot PLD (CS0)	0xfc000000	0xe0020000
 		NVRAM (CS1)		0xfc800000	0xe0030000
 	*/
-	add_temporary_entry(ENTRYLO(0xfc000000), ENTRYLO(0xfc010000), 0xfc000000, PM_64K);
-	add_temporary_entry(ENTRYLO(0xfc800000), ENTRYLO(0xfc810000), 0xfc800000, PM_64K);
+	add_temporary_entry(ENTRYLO(0xfc000000), ENTRYLO(0xfc010000),
+	                    0xfc000000, PM_64K);
+	add_temporary_entry(ENTRYLO(0xfc800000), ENTRYLO(0xfc810000),
+	                    0xfc800000, PM_64K);
 
-	gt64240_base = 0xf4000000;
+	marvell_base = 0xf4000000;
 }
 
-static void __init momenco_ocelot_g_setup(void)
+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)
 {
-	void (*l3func)(unsigned long)=KSEG1ADDR(&setup_l3cache);
+	int register i;
+
+	printk("Enabling L3 cache...");
+
+	/* Enable the L3 cache in the GT64120A's CPU Configuration register */
+	MV_WRITE(0, MV_READ(0) | (1<<14));
+
+	/* Enable the L3 cache in the CPU */
+	set_c0_config(1<<12 /* CONF_TE */);
+
+	/* Clear the cache */
+	write_c0_taglo(0);
+	write_c0_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");
+}
+
+static int  __init momenco_ocelot_g_setup(void)
+{
+	void (*l3func)(unsigned long) = (void *) KSEG1ADDR(setup_l3cache);
 	unsigned int tmpword;
 
 	board_time_init = gt64240_time_init;
@@ -199,52 +239,12 @@ static void __init momenco_ocelot_g_setup(void)
 	}
 
 	/* FIXME: Fix up the DiskOnChip mapping */
-	GT_WRITE(0x468, 0xfef73);
-}
+	MV_WRITE(0x468, 0xfef73);
 
-early_initcall(momenco_ocelot_g_setup);
-
-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_c0_config(1<<12 /* CONF_TE */);
-
-	/* Clear the cache */
-	write_c0_taglo(0);
-	write_c0_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");
+	return 0;
 }
 
+early_initcall(momenco_ocelot_g_setup);
 
 /* This needs to be one of the first initcalls, because no I/O port access
    can work before this */
@@ -252,12 +252,12 @@ static void __init setup_l3cache(unsigned long size)
 static int io_base_ioremap(void)
 {
 	/* we're mapping PCI accesses from 0xc0000000 to 0xf0000000 */
-	void *io_remap_range = ioremap(0xc0000000, 0x30000000);
+	unsigned long io_remap_range;
 
-	if (!io_remap_range) {
+	io_remap_range = (unsigned long) ioremap(0xc0000000, 0x30000000);
+	if (!io_remap_range)
 		panic("Could not ioremap I/O port range");
-	}
-	printk("io_remap_range set at 0x%08x\n", (uint32_t)io_remap_range);
+
 	set_io_port_base(io_remap_range - 0xc0000000);
 
 	return 0;
diff --git a/arch/mips/pci/Makefile b/arch/mips/pci/Makefile
index a380308ef..5ed03fa90 100644
--- a/arch/mips/pci/Makefile
+++ b/arch/mips/pci/Makefile
@@ -12,10 +12,11 @@ obj-$(CONFIG_MIPS_BONITO64)	+= ops-bonito64.o
 obj-$(CONFIG_MIPS_GT64111)	+= ops-gt64111.o
 obj-$(CONFIG_MIPS_GT64120)	+= ops-gt64120.o
 obj-$(CONFIG_MIPS_GT96100)	+= ops-gt96100.o
-obj-$(CONFIG_MIPS_MV64340)	+= ops-mv64340.o
+obj-$(CONFIG_PCI_MARVELL)	+= ops-marvell.o
 obj-$(CONFIG_MIPS_MSC)		+= ops-msc.o
 obj-$(CONFIG_MIPS_NILE4)	+= ops-nile4.o
 obj-$(CONFIG_MIPS_TX3927)	+= ops-jmr3927.o
+obj-$(CONFIG_PCI_VR41XX)	+= ops-vr41xx.o pci-vr41xx.o
 
 #
 # These are still pretty much in the old state, watch, go blind.
@@ -34,20 +35,19 @@ obj-$(CONFIG_MIPS_IVR)		+= fixup-ivr.o
 obj-$(CONFIG_SOC_AU1500)	+= fixup-au1000.o ops-au1000.o
 obj-$(CONFIG_SOC_AU1550)	+= fixup-au1000.o ops-au1000.o
 obj-$(CONFIG_MIPS_MALTA)	+= fixup-malta.o
-obj-$(CONFIG_MIPS_MV64340)	+= fixup-mv64340.o
+obj-$(CONFIG_MOMENCO_JAGUAR_ATX)+= fixup-jaguar.o
 obj-$(CONFIG_MOMENCO_OCELOT)	+= fixup-ocelot.o pci-ocelot.o
-obj-$(CONFIG_MOMENCO_OCELOT_C)	+= pci-ocelot-c.o
-obj-$(CONFIG_MOMENCO_OCELOT_G)	+= pci-ocelot-g.o
-obj-$(CONFIG_NEC_EAGLE)		+= fixup-eagle.o ops-vrc4173.o
-obj-$(CONFIG_PMC_YOSEMITE)	+= fixup-yosemite.o ops-titan.o
+obj-$(CONFIG_MOMENCO_OCELOT_C)	+= fixup-ocelot-c.o pci-ocelot-c.o
+obj-$(CONFIG_MOMENCO_OCELOT_G)	+= fixup-ocelot-g.o pci-ocelot-g.o
+obj-$(CONFIG_PMC_YOSEMITE)	+= fixup-yosemite.o ops-titan.o ops-titan-ht.o \
+				   pci-yosemite.o
 obj-$(CONFIG_SGI_IP27)		+= pci-ip27.o
 obj-$(CONFIG_SGI_IP32)		+= fixup-ip32.o ops-mace.o pci-ip32.o
 obj-$(CONFIG_SIBYTE_SB1250)	+= pci-sb1250.o
 obj-$(CONFIG_SNI_RM200_PCI)	+= fixup-sni.o ops-sni.o
+obj-$(CONFIG_TANBAC_TB0219)	+= fixup-tb0219.o
 obj-$(CONFIG_TANBAC_TB0226)	+= fixup-tb0226.o
-obj-$(CONFIG_TANBAC_TB0229)	+= fixup-tb0229.o
 obj-$(CONFIG_TOSHIBA_JMR3927)	+= fixup-jmr3927.o pci-jmr3927.o
 obj-$(CONFIG_TOSHIBA_RBTX4927)	+= fixup-rbtx4927.o ops-tx4927.o
-obj-$(CONFIG_VICTOR_MPC30X)	+= fixup-capcella.o
-obj-$(CONFIG_MACH_VR41XX)	+= pci-vr41xx.o
-obj-$(CONFIG_ZAO_CAPCELLA)	+= fixup-victor-mpc30x.o
+obj-$(CONFIG_VICTOR_MPC30X)	+= fixup-mpc30x.o
+obj-$(CONFIG_ZAO_CAPCELLA)	+= fixup-capcella.o
diff --git a/arch/mips/pci/fixup-capcella.c b/arch/mips/pci/fixup-capcella.c
index 167ed4367..9a0d68ed6 100644
--- a/arch/mips/pci/fixup-capcella.c
+++ b/arch/mips/pci/fixup-capcella.c
@@ -1,17 +1,21 @@
 /*
- * FILE NAME
- *	arch/mips/vr41xx/zao-capcella/pci_fixup.c
+ *  fixup-cappcela.c, The ZAO Networks Capcella specific PCI fixups.
  *
- * BRIEF MODULE DESCRIPTION
- *	The ZAO Networks Capcella specific PCI fixups.
+ *  Copyright (C) 2002,2004  Yoichi Yuasa <yuasa@hh.iij4u.or.jp>
  *
- * Copyright 2002 Yoichi Yuasa
- *                yuasa@hh.iij4u.or.jp
+ *  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 free software; you can redistribute it and/or modify it
- *  under the terms of the GNU General Public License as published by the
- *  Free Software Foundation; either version 2 of the License, or (at your
- *  option) any later version.
+ *  This program is distributed in the hope that it will be useful,
+ *  but WITHOUT ANY WARRANTY; without even the implied warranty of
+ *  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ *  GNU General Public License for more details.
+ *
+ *  You should have received a copy of the GNU General Public License
+ *  along with this program; if not, write to the Free Software
+ *  Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA
  */
 #include <linux/init.h>
 #include <linux/pci.h>
@@ -38,3 +42,7 @@ int __init pcibios_map_irq(struct pci_dev *dev, u8 slot, u8 pin)
 {
 	return irq_tab_capcella[slot][pin];
 }
+
+struct pci_fixup pcibios_fixups[] __initdata = {
+	{	.pass = 0,	},
+};
diff --git a/arch/mips/pci/fixup-tb0226.c b/arch/mips/pci/fixup-tb0226.c
index 17c300c8a..50e639e04 100644
--- a/arch/mips/pci/fixup-tb0226.c
+++ b/arch/mips/pci/fixup-tb0226.c
@@ -1,78 +1,83 @@
 /*
- * FILE NAME
- *	arch/mips/vr41xx/tanbac-tb0226/pci_fixup.c
+ *  fixup-tb0226.c, The TANBAC TB0226 specific PCI fixups.
  *
- * BRIEF MODULE DESCRIPTION
- *	The TANBAC TB0226 specific PCI fixups.
+ *  Copyright (C) 2002-2004  Yoichi Yuasa <yuasa@hh.iij4u.or.jp>
  *
- * Copyright 2002,2003 Yoichi Yuasa
- *                yuasa@hh.iij4u.or.jp
+ *  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 free software; you can redistribute it and/or modify it
- *  under the terms of the GNU General Public License as published by the
- *  Free Software Foundation; either version 2 of the License, or (at your
- *  option) any later version.
+ *  This program is distributed in the hope that it will be useful,
+ *  but WITHOUT ANY WARRANTY; without even the implied warranty of
+ *  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ *  GNU General Public License for more details.
+ *
+ *  You should have received a copy of the GNU General Public License
+ *  along with this program; if not, write to the Free Software
+ *  Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA
  */
 #include <linux/init.h>
 #include <linux/pci.h>
 
 #include <asm/vr41xx/tb0226.h>
 
-void __init pcibios_fixup_irqs(void)
+int __init pcibios_map_irq(struct pci_dev *dev, u8 slot, u8 pin)
 {
-	struct pci_dev *dev = NULL;
-	u8 slot, pin;
-
-	while ((dev = pci_find_device(PCI_ANY_ID, PCI_ANY_ID, dev)) != NULL) {
-		slot = PCI_SLOT(dev->devfn);
-		dev->irq = 0;
+	int irq = -1;
 
-		switch (slot) {
-		case 12:
-			vr41xx_set_irq_trigger(GD82559_1_PIN,
+	switch (slot) {
+	case 12:
+		vr41xx_set_irq_trigger(GD82559_1_PIN,
+				       TRIGGER_LEVEL,
+				       SIGNAL_THROUGH);
+		vr41xx_set_irq_level(GD82559_1_PIN, LEVEL_LOW);
+		irq = GD82559_1_IRQ;
+		break;
+	case 13:
+		vr41xx_set_irq_trigger(GD82559_2_PIN,
+				       TRIGGER_LEVEL,
+				       SIGNAL_THROUGH);
+		vr41xx_set_irq_level(GD82559_2_PIN, LEVEL_LOW);
+		irq = GD82559_2_IRQ;
+		break;
+	case 14:
+		switch (pin) {
+		case 1:
+			vr41xx_set_irq_trigger(UPD720100_INTA_PIN,
+					       TRIGGER_LEVEL,
+					       SIGNAL_THROUGH);
+			vr41xx_set_irq_level(UPD720100_INTA_PIN,
+					     LEVEL_LOW);
+			irq = UPD720100_INTA_IRQ;
+			break;
+		case 2:
+			vr41xx_set_irq_trigger(UPD720100_INTB_PIN,
 					       TRIGGER_LEVEL,
 					       SIGNAL_THROUGH);
-			vr41xx_set_irq_level(GD82559_1_PIN, LEVEL_LOW);
-			dev->irq = GD82559_1_IRQ;
+			vr41xx_set_irq_level(UPD720100_INTB_PIN,
+					     LEVEL_LOW);
+			irq = UPD720100_INTB_IRQ;
 			break;
-		case 13:
-			vr41xx_set_irq_trigger(GD82559_2_PIN,
+		case 3:
+			vr41xx_set_irq_trigger(UPD720100_INTC_PIN,
 					       TRIGGER_LEVEL,
 					       SIGNAL_THROUGH);
-			vr41xx_set_irq_level(GD82559_2_PIN, LEVEL_LOW);
-			dev->irq = GD82559_2_IRQ;
+			vr41xx_set_irq_level(UPD720100_INTC_PIN,
+					     LEVEL_LOW);
+			irq = UPD720100_INTC_IRQ;
 			break;
-		case 14:
-			pci_read_config_byte(dev, PCI_INTERRUPT_PIN, &pin);
-			switch (pin) {
-			case 1:
-				vr41xx_set_irq_trigger(UPD720100_INTA_PIN,
-						       TRIGGER_LEVEL,
-						       SIGNAL_THROUGH);
-				vr41xx_set_irq_level(UPD720100_INTA_PIN,
-						     LEVEL_LOW);
-				dev->irq = UPD720100_INTA_IRQ;
-				break;
-			case 2:
-				vr41xx_set_irq_trigger(UPD720100_INTB_PIN,
-						       TRIGGER_LEVEL,
-						       SIGNAL_THROUGH);
-				vr41xx_set_irq_level(UPD720100_INTB_PIN,
-						     LEVEL_LOW);
-				dev->irq = UPD720100_INTB_IRQ;
-				break;
-			case 3:
-				vr41xx_set_irq_trigger(UPD720100_INTC_PIN,
-						       TRIGGER_LEVEL,
-						       SIGNAL_THROUGH);
-				vr41xx_set_irq_level(UPD720100_INTC_PIN,
-						     LEVEL_LOW);
-				dev->irq = UPD720100_INTC_IRQ;
-				break;
-			}
+		default:
 			break;
 		}
-
-		pci_write_config_byte(dev, PCI_INTERRUPT_LINE, dev->irq);
+		break;
+	default:
+		break;
 	}
+
+	return irq;
 }
+
+struct pci_fixup pcibios_fixups[] __initdata = {
+	{	.pass = 0,	},
+};
diff --git a/arch/mips/pci/fixup-yosemite.c b/arch/mips/pci/fixup-yosemite.c
index 72b809685..92e40b091 100644
--- a/arch/mips/pci/fixup-yosemite.c
+++ b/arch/mips/pci/fixup-yosemite.c
@@ -26,21 +26,12 @@
 #include <linux/init.h>
 #include <linux/pci.h>
 
-static char irq_tab_yosemite[8][5] __initdata = {
-	/*       INTA  INTB  INTC  INTD */
-	{    -1,   -1,   -1,   -1,   -1 },
-	{    -1,    3,    3,    3,    3 },
-	{    -1,    4,    4,    4,    4 },
-	{    -1,   -1,   -1,   -1,   -1 },
-	{    -1,   -1,   -1,   -1,   -1 },
-	{    -1,   -1,   -1,   -1,   -1 },
-	{    -1,   -1,   -1,   -1,   -1 },
-	{    -1,   -1,   -1,   -1,   -1 },
-};
-
 int __init pcibios_map_irq(struct pci_dev *dev, u8 slot, u8 pin)
 {
-	return irq_tab_yosemite[slot][pin];
+	if (pin == 0)
+		return -1;
+
+	return 3;			/* Everything goes to one irq bit */
 }
 
 struct pci_fixup pcibios_fixups[] = {
diff --git a/arch/mips/pci/ops-msc.c b/arch/mips/pci/ops-msc.c
index 51b16d48d..11184fa64 100644
--- a/arch/mips/pci/ops-msc.c
+++ b/arch/mips/pci/ops-msc.c
@@ -48,8 +48,12 @@ static int msc_pcibios_config_access(unsigned char access_type,
 	unsigned char type;
 	u32 intr;
 
-	if ((busnum == 0) && (PCI_SLOT(devfn) == 0))
+#ifdef CONFIG_MIPS_BOARDS_GEN
+	if ((busnum == 0) && (PCI_SLOT(devfn) == 17)) {
+		/* MIPS Core boards have SOCit connected as device 17 */
 		return -1;
+	}
+#endif
 
 	/* Clear status register bits. */
 	MSC_WRITE(MSC01_PCI_INTSTAT,
diff --git a/arch/mips/pci/ops-titan.c b/arch/mips/pci/ops-titan.c
index 12e79346f..1ac7880dd 100644
--- a/arch/mips/pci/ops-titan.c
+++ b/arch/mips/pci/ops-titan.c
@@ -39,30 +39,30 @@
 static int titan_read_config(struct pci_bus *bus, unsigned int devfn, int reg,
 	int size, u32 * val)
 {
-	int dev, bus, func;
+	int dev, busno, func;
 	uint32_t address_reg, data_reg;
 	uint32_t address;
 
-	bus = device->bus->number;
-	dev = PCI_SLOT(device->devfn);
-	func = PCI_FUNC(device->devfn);
+	busno = bus->number;
+	dev = PCI_SLOT(devfn);
+	func = PCI_FUNC(devfn);
 
 	address_reg = TITAN_PCI_0_CONFIG_ADDRESS;
 	data_reg = TITAN_PCI_0_CONFIG_DATA;
 
-	address = (bus << 16) | (dev << 11) | (func << 8) |
-		(offset & 0xfc) | 0x80000000;
+	address = (busno << 16) | (dev << 11) | (func << 8) |
+	          (reg & 0xfc) | 0x80000000;
 
 	/* start the configuration cycle */
 	TITAN_WRITE(address_reg, address);
 
 	switch (size) {
 	case 1:
-		TITAN_READ_8(data_reg + (offset & 0x3), val);
+		TITAN_READ_8(data_reg + (reg & 0x3), val);
 		break;
 
 	case 2:
-		TITAN_READ_16(data_reg + (offset & 0x2), val);
+		TITAN_READ_16(data_reg + (reg & 0x2), val);
 		break;
 
 	case 4:
@@ -80,17 +80,17 @@ static int titan_write_config(struct pci_bus *bus, unsigned int devfn, int reg,
 	int size, u32 val)
 {
 	uint32_t address_reg, data_reg, address;
-	int dev, bus, func;
+	int dev, busno, func;
 
-	bus = device->bus->number;
-	dev = PCI_SLOT(device->devfn);
-	func = PCI_FUNC(device->devfn);
+	busno = bus->number;
+	dev = PCI_SLOT(devfn);
+	func = PCI_FUNC(devfn);
 
 	address_reg = TITAN_PCI_0_CONFIG_ADDRESS;
 	data_reg = TITAN_PCI_0_CONFIG_DATA;
 
-	address = (bus << 16) | (dev << 11) | (func << 8) |
-		(offset & 0xfc) | 0x80000000;
+	address = (busno << 16) | (dev << 11) | (func << 8) |
+		(reg & 0xfc) | 0x80000000;
 
 	/* start the configuration cycle */
 	TITAN_WRITE(address_reg, address);
@@ -98,11 +98,11 @@ static int titan_write_config(struct pci_bus *bus, unsigned int devfn, int reg,
 	/* write the data */
 	switch (size) {
 	case 1:
-		TITAN_WRITE_8(data_reg + (offset & 0x3), val);
+		TITAN_WRITE_8(data_reg + (reg & 0x3), val);
 		break;
 
 	case 2:
-		TITAN_WRITE_16(data_reg + (offset & 0x2), val);
+		TITAN_WRITE_16(data_reg + (reg & 0x2), val);
 		break;
 
 	case 4:
diff --git a/arch/mips/pci/pci-ocelot-c.c b/arch/mips/pci/pci-ocelot-c.c
index 29b52757a..8b2227277 100644
--- a/arch/mips/pci/pci-ocelot-c.c
+++ b/arch/mips/pci/pci-ocelot-c.c
@@ -1,61 +1,144 @@
 /*
- * Copyright 2002 Momentum Computer
- * Author: Matthew Dharm <mdharm@momenco.com>
+ * This file is subject to the terms and conditions of the GNU General Public
+ * License.  See the file "COPYING" in the main directory of this archive
+ * for more details.
  *
- *  This 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.
+ * Copyright (C) 2004 by Ralf Baechle
  */
+
 #include <linux/types.h>
 #include <linux/pci.h>
-#include <linux/kernel.h>
-#include <linux/slab.h>
-#include <asm/pci.h>
-#include <asm/io.h>
 #include <asm/mv64340.h>
+#include <asm/pci_channel.h>
 
 #include <linux/init.h>
 
 /*
- * These functions and structures provide the BIOS scan and mapping of the PCI
- * devices.
+ * We assume the address ranges have already been setup appropriately by
+ * the firmware.  PMON in case of the Ocelot C does that.
  */
+static struct resource mv_pci_io_mem0_resource = {
+	.name	= "MV64340 PCI0 IO MEM",
+	.flags	= IORESOURCE_IO
+};
+
+static struct resource mv_pci_mem0_resource = {
+	.name	= "MV64340 PCI0 MEM",
+	.flags	= IORESOURCE_MEM
+};
+
+static struct mv_pci_controller mv_bus0_controller = {
+	.pcic = {
+		.pci_ops	= &mv_pci_ops,
+		.mem_resource	= &mv_pci_mem0_resource,
+		.io_resource	= &mv_pci_io_mem0_resource,
+	},
+	.config_addr	= MV64340_PCI_0_CONFIG_ADDR,
+	.config_vreg	= MV64340_PCI_0_CONFIG_DATA_VIRTUAL_REG,
+};
+
+static uint32_t mv_io_base, mv_io_size;
+
+static void mv64340_pci0_init(void)
+{
+	uint32_t mem0_base, mem0_size;
+	uint32_t io_base, io_size;
+
+	io_base = MV_READ(MV64340_PCI_0_IO_BASE_ADDR) << 16;
+	io_size = (MV_READ(MV64340_PCI_0_IO_SIZE) + 1) << 16;
+	mem0_base = MV_READ(MV64340_PCI_0_MEMORY0_BASE_ADDR) << 16;
+	mem0_size = (MV_READ(MV64340_PCI_0_MEMORY0_SIZE) + 1) << 16;
+
+	mv_pci_io_mem0_resource.start		= 0;
+	mv_pci_io_mem0_resource.end		= io_size - 1;
+	mv_pci_mem0_resource.start		= mem0_base;
+	mv_pci_mem0_resource.end		= mem0_base + mem0_size - 1;
+	mv_bus0_controller.pcic.mem_offset	= mem0_base;
+	mv_bus0_controller.pcic.io_offset	= 0;
+
+	ioport_resource.end		= io_size - 1;
+
+	register_pci_controller(&mv_bus0_controller.pcic);
+
+	mv_io_base = io_base;
+	mv_io_size = io_size;
+}
+
+static struct resource mv_pci_io_mem1_resource = {
+	.name	= "MV64340 PCI1 IO MEM",
+	.flags	= IORESOURCE_IO
+};
 
-void mv64340_board_pcibios_fixup_bus(struct pci_bus *c);
+static struct resource mv_pci_mem1_resource = {
+	.name	= "MV64340 PCI1 MEM",
+	.flags	= IORESOURCE_MEM
+};
 
-struct pci_fixup pcibios_fixups[] = {
-	{0}
+static struct mv_pci_controller mv_bus1_controller = {
+	.pcic = {
+		.pci_ops	= &mv_pci_ops,
+		.mem_resource	= &mv_pci_mem1_resource,
+		.io_resource	= &mv_pci_io_mem1_resource,
+	},
+	.config_addr	= MV64340_PCI_1_CONFIG_ADDR,
+	.config_vreg	= MV64340_PCI_1_CONFIG_DATA_VIRTUAL_REG,
 };
 
-void __init pcibios_fixup_bus(struct pci_bus *c)
+static __init void mv64340_pci1_init(void)
 {
-	mv64340_board_pcibios_fixup_bus(c);
+	uint32_t mem0_base, mem0_size;
+	uint32_t io_base, io_size;
+
+	io_base = MV_READ(MV64340_PCI_1_IO_BASE_ADDR) << 16;
+	io_size = (MV_READ(MV64340_PCI_1_IO_SIZE) + 1) << 16;
+	mem0_base = MV_READ(MV64340_PCI_1_MEMORY0_BASE_ADDR) << 16;
+	mem0_size = (MV_READ(MV64340_PCI_1_MEMORY0_SIZE) + 1) << 16;
+
+	/*
+	 * Here we assume the I/O window of second bus to be contiguous with
+	 * the first.  A gap is no problem but would waste address space for
+	 * remapping the port space.
+	 */
+	mv_pci_io_mem1_resource.start		= mv_io_size;
+	mv_pci_io_mem1_resource.end		= mv_io_size + io_size - 1;
+	mv_pci_mem1_resource.start		= mem0_base;
+	mv_pci_mem1_resource.end		= mem0_base + mem0_size - 1;
+	mv_bus1_controller.pcic.mem_offset	= mem0_base;
+	mv_bus1_controller.pcic.io_offset	= 0;
+
+	ioport_resource.end		= io_base + io_size -mv_io_base - 1;
+
+	register_pci_controller(&mv_bus1_controller.pcic);
+
+	mv_io_size = io_base + io_size - mv_io_base;
 }
 
-void __init pcibios_init(void)
+static __init int __init ocelot_c_pci_init(void)
 {
-	/* Reset PCI I/O and PCI MEM values */
-	ioport_resource.start = 0xe0000000;
-	ioport_resource.end = 0xe0000000 + 0x20000000 - 1;
-	iomem_resource.start = 0xc0000000;
-	iomem_resource.end = 0xc0000000 + 0x20000000 - 1;
-
-	pci_scan_bus(0, &mv64340_bus0_pci_ops, NULL);
-	pci_scan_bus(1, &mv64340_bus1_pci_ops, NULL);
+	unsigned long io_v_base;
+	uint32_t enable;
+
+	enable = ~MV_READ(MV64340_BASE_ADDR_ENABLE);
+
+	/*
+	 * We require at least one enabled I/O or PCI memory window or we
+	 * will ignore this PCI bus.  We ignore PCI windows 1, 2 and 3.
+	 */
+	if (enable & (0x01 <<  9) || enable & (0x01 << 10))
+		mv64340_pci0_init();
+
+	if (enable & (0x01 << 14) || enable & (0x01 << 15))
+		mv64340_pci1_init();
+
+	if (mv_io_size) {
+		io_v_base = (unsigned long) ioremap(mv_io_base, mv_io_size);
+		if (!io_v_base)
+			panic("Could not ioremap I/O port range");
+
+		set_io_port_base(io_v_base);
+	}
+
+	return 0;
 }
+
+arch_initcall(ocelot_c_pci_init);
diff --git a/arch/mips/pci/pci-ocelot-g.c b/arch/mips/pci/pci-ocelot-g.c
index 34c3ec8d1..239b81fba 100644
--- a/arch/mips/pci/pci-ocelot-g.c
+++ b/arch/mips/pci/pci-ocelot-g.c
@@ -1,460 +1,98 @@
 /*
- * Copyright 2002 Momentum Computer
- * Author: Matthew Dharm <mdharm@momenco.com>
+ * This file is subject to the terms and conditions of the GNU General Public
+ * License.  See the file "COPYING" in the main directory of this archive
+ * for more details.
  *
- *  This 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) 2004 by Ralf Baechle
  *
- *  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.
+ * This doesn't really fly - but I don't have a GT64240 system for testing.
  */
+#include <linux/init.h>
+#include <linux/kernel.h>
 #include <linux/types.h>
 #include <linux/pci.h>
-#include <linux/kernel.h>
-#include <linux/slab.h>
-#include <asm/pci.h>
-#include <asm/io.h>
-#include "gt64240.h"
-
-#include <linux/init.h>
-
-#define SELF 0
-#define MASTER_ABORT_BIT 0x100
+#include <asm/gt64240.h>
+#include <asm/pci_channel.h>
 
 /*
- * These functions and structures provide the BIOS scan and mapping of the PCI
- * devices.
- */
-
-void gt64240_board_pcibios_fixup_bus(struct pci_bus *c);
-
-/*  Functions to implement "pci ops"  */
-static int galileo_pcibios_read_config_word(int bus, int devfn,
-					    int offset, u16 * val);
-static int galileo_pcibios_read_config_byte(int bus, int devfn,
-					    int offset, u8 * val);
-static int galileo_pcibios_read_config_dword(int bus, int devfn,
-					     int offset, u32 * val);
-static int galileo_pcibios_write_config_byte(int bus, int devfn,
-					     int offset, u8 val);
-static int galileo_pcibios_write_config_word(int bus, int devfn,
-					     int offset, u16 val);
-static int galileo_pcibios_write_config_dword(int bus, int devfn,
-					      int offset, u32 val);
-
-static int pci_read(struct pci_bus *bus, unsigned int devfs, int where,
-		    int size, u32 * val);
-static int pci_write(struct pci_bus *bus, unsigned int devfs, int where,
-		     int size, u32 val);
-
-/*
- *  General-purpose PCI functions.
- */
-
-
-/*
- * 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)
-{
-	/* Accessing device 31 crashes the GT-64240. */
-	if (dev < 5)
-		return 0;
-	return -1;
-}
-
-/*
- * galileo_pcibios_(read/write)_config_(dword/word/byte) -
- *
- * reads/write a dword/word/byte register from the configuration space
- * of a device.
- *
- * Note that bus 0 and bus 1 are local, and we assume all other busses are
- * bridged from bus 1.  This is a safe assumption, since any other
- * configuration will require major modifications to the CP7000G
- *
- * 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
+ * We assume these address ranges have been programmed into the GT-64240 by
+ * the firmware.  PMON in case of the Ocelot G does that.  Note the size of
+ * the I/O range is completly stupid; I/O mappings are limited to at most
+ * 256 bytes by the PCI spec and deprecated; and just to make things worse
+ * apparently many devices don't decode more than 64k of I/O space.
  */
 
-static int galileo_pcibios_read_config_dword(int bus, int devfn,
-					     int offset, u32 * val)
-{
-	int dev, func;
-	uint32_t address_reg, data_reg;
-	uint32_t address;
-
-	dev = PCI_SLOT(devfn);
-	func = PCI_FUNC(devfn);
-
-	/* verify the range */
-	if (pci_range_ck(bus, dev))
-		return PCIBIOS_DEVICE_NOT_FOUND;
-
-	/* select the GT-64240 registers to communicate with the PCI bus */
-	if (bus == 0) {
-		address_reg = PCI_0CONFIGURATION_ADDRESS;
-		data_reg = PCI_0CONFIGURATION_DATA_VIRTUAL_REGISTER;
-		GT_WRITE(PCI_0ERROR_CAUSE, ~MASTER_ABORT_BIT);
-	} else {
-		address_reg = PCI_1CONFIGURATION_ADDRESS;
-		data_reg = PCI_1CONFIGURATION_DATA_VIRTUAL_REGISTER;
-		GT_WRITE(PCI_1ERROR_CAUSE, ~MASTER_ABORT_BIT);
-		if (bus == 1)
-			bus = 0;
-	}
-
-	address = (bus << 16) | (dev << 11) | (func << 8) |
-	    (offset & 0xfc) | 0x80000000;
-
-	/* start the configuration cycle */
-	GT_WRITE(address_reg, address);
-
-	/* read the data */
-	GT_READ(data_reg, val);
-
-	return PCIBIOS_SUCCESSFUL;
-}
-
-
-static int galileo_pcibios_read_config_word(int bus, int devfn,
-					    int offset, u16 * val)
-{
-	int dev, func;
-	uint32_t address_reg, data_reg;
-	uint32_t address;
-
-	dev = PCI_SLOT(devfn);
-	func = PCI_FUNC(devfn);
-
-	/* verify the range */
-	if (pci_range_ck(bus, dev))
-		return PCIBIOS_DEVICE_NOT_FOUND;
-
-	/* select the GT-64240 registers to communicate with the PCI bus */
-	if (bus == 0) {
-		address_reg = PCI_0CONFIGURATION_ADDRESS;
-		data_reg = PCI_0CONFIGURATION_DATA_VIRTUAL_REGISTER;
-		GT_WRITE(PCI_0ERROR_CAUSE, ~MASTER_ABORT_BIT);
-	} else {
-		address_reg = PCI_1CONFIGURATION_ADDRESS;
-		data_reg = PCI_1CONFIGURATION_DATA_VIRTUAL_REGISTER;
-		GT_WRITE(PCI_1ERROR_CAUSE, ~MASTER_ABORT_BIT);
-		if (bus == 1)
-			bus = 0;
-	}
-
-	address = (bus << 16) | (dev << 11) | (func << 8) |
-	    (offset & 0xfc) | 0x80000000;
-
-	/* start the configuration cycle */
-	GT_WRITE(address_reg, address);
-
-	/* read the data */
-	GT_READ_16(data_reg + (offset & 0x3), val);
-
-	return PCIBIOS_SUCCESSFUL;
-}
-
-static int galileo_pcibios_read_config_byte(int bus, int devfn,
-					    int offset, u8 * val)
-{
-	int dev, func;
-	uint32_t address_reg, data_reg;
-	uint32_t address;
-
-	dev = PCI_SLOT(devfn);
-	func = PCI_FUNC(devfn);
-
-	/* verify the range */
-	if (pci_range_ck(bus, dev))
-		return PCIBIOS_DEVICE_NOT_FOUND;
-
-	/* select the GT-64240 registers to communicate with the PCI bus */
-	if (bus == 0) {
-		address_reg = PCI_0CONFIGURATION_ADDRESS;
-		data_reg = PCI_0CONFIGURATION_DATA_VIRTUAL_REGISTER;
-	} else {
-		address_reg = PCI_1CONFIGURATION_ADDRESS;
-		data_reg = PCI_1CONFIGURATION_DATA_VIRTUAL_REGISTER;
-		if (bus == 1)
-			bus = 0;
-	}
-
-	address = (bus << 16) | (dev << 11) | (func << 8) |
-	    (offset & 0xfc) | 0x80000000;
+#define gt_io_size	0x20000000UL
+#define gt_io_base	0xe0000000UL
 
-	/* start the configuration cycle */
-	GT_WRITE(address_reg, address);
-
-	/* write the data */
-	GT_READ_8(data_reg + (offset & 0x3), val);
-
-	return PCIBIOS_SUCCESSFUL;
-}
-
-static int galileo_pcibios_write_config_dword(int bus, int devfn,
-					      int offset, u32 val)
-{
-	int dev, func;
-	uint32_t address_reg, data_reg;
-	uint32_t address;
-
-	dev = PCI_SLOT(devfn);
-	func = PCI_FUNC(devfn);
-
-	/* verify the range */
-	if (pci_range_ck(bus, dev))
-		return PCIBIOS_DEVICE_NOT_FOUND;
-
-	/* select the GT-64240 registers to communicate with the PCI bus */
-	if (bus == 0) {
-		address_reg = PCI_0CONFIGURATION_ADDRESS;
-		data_reg = PCI_0CONFIGURATION_DATA_VIRTUAL_REGISTER;
-	} else {
-		address_reg = PCI_1CONFIGURATION_ADDRESS;
-		data_reg = PCI_1CONFIGURATION_DATA_VIRTUAL_REGISTER;
-		if (bus == 1)
-			bus = 0;
-	}
-
-	address = (bus << 16) | (dev << 11) | (func << 8) |
-	    (offset & 0xfc) | 0x80000000;
-
-	/* start the configuration cycle */
-	GT_WRITE(address_reg, address);
-
-	/* write the data */
-	GT_WRITE(data_reg, val);
-
-	return PCIBIOS_SUCCESSFUL;
-}
-
-
-static int galileo_pcibios_write_config_word(int bus, int devfn,
-					     int offset, u16 val)
-{
-	int dev, func;
-	uint32_t address_reg, data_reg;
-	uint32_t address;
-
-	dev = PCI_SLOT(devfn);
-	func = PCI_FUNC(devfn);
-
-	/* verify the range */
-	if (pci_range_ck(bus, dev))
-		return PCIBIOS_DEVICE_NOT_FOUND;
-
-	/* select the GT-64240 registers to communicate with the PCI bus */
-	if (bus == 0) {
-		address_reg = PCI_0CONFIGURATION_ADDRESS;
-		data_reg = PCI_0CONFIGURATION_DATA_VIRTUAL_REGISTER;
-	} else {
-		address_reg = PCI_1CONFIGURATION_ADDRESS;
-		data_reg = PCI_1CONFIGURATION_DATA_VIRTUAL_REGISTER;
-		if (bus == 1)
-			bus = 0;
-	}
-
-	address = (bus << 16) | (dev << 11) | (func << 8) |
-	    (offset & 0xfc) | 0x80000000;
-
-	/* start the configuration cycle */
-	GT_WRITE(address_reg, address);
-
-	/* write the data */
-	GT_WRITE_16(data_reg + (offset & 0x3), val);
-
-	return PCIBIOS_SUCCESSFUL;
-}
-
-static int galileo_pcibios_write_config_byte(int bus, int devfn,
-					     int offset, u8 val)
-{
-	int dev, func;
-	uint32_t address_reg, data_reg;
-	uint32_t address;
-
-	dev = PCI_SLOT(devfn);
-	func = PCI_FUNC(devfn);
-
-	/* verify the range */
-	if (pci_range_ck(bus, dev))
-		return PCIBIOS_DEVICE_NOT_FOUND;
-
-	/* select the GT-64240 registers to communicate with the PCI bus */
-	if (bus == 0) {
-		address_reg = PCI_0CONFIGURATION_ADDRESS;
-		data_reg = PCI_0CONFIGURATION_DATA_VIRTUAL_REGISTER;
-	} else {
-		address_reg = PCI_1CONFIGURATION_ADDRESS;
-		data_reg = PCI_1CONFIGURATION_DATA_VIRTUAL_REGISTER;
-		if (bus == 1)
-			bus = 0;
-	}
-
-	address = (bus << 16) | (dev << 11) | (func << 8) |
-	    (offset & 0xfc) | 0x80000000;
-
-	/* start the configuration cycle */
-	GT_WRITE(address_reg, address);
-
-	/* write the data */
-	GT_WRITE_8(data_reg + (offset & 0x3), val);
-
-	return PCIBIOS_SUCCESSFUL;
-}
-
-struct pci_ops galileo_pci_ops = {
-	.read = pci_read,
-	.write = pci_write
+static struct resource gt_pci_mem0_resource = {
+	.name	= "MV64240 PCI0 MEM",
+	.start	= 0xc0000000UL,
+	.end	= 0xcfffffffUL,
+	.flags	= IORESOURCE_MEM
 };
 
-static int pci_read(struct pci_bus *bus, unsigned int devfn, int where,
-		    int size, u32 * val)
-{
-	switch (size) {
-	case 1:
-		return galileo_pcibios_read_config_byte(bus->number,
-							devfn, where,
-							(u8 *) val);
-	case 2:
-		return galileo_pcibios_read_config_word(bus->number,
-							devfn, where,
-							(u16 *) val);
-	case 4:
-		return galileo_pcibios_read_config_dword(bus->number,
-							 devfn, where,
-							 (u32 *) val);
-	}
-	return PCIBIOS_FUNC_NOT_SUPPORTED;
-}
-
-static int pci_write(struct pci_bus *bus, unsigned int devfn, int where,
-		     int size, u32 val)
-{
-	switch (size) {
-	case 1:
-		return galileo_pcibios_write_config_byte(bus->number,
-							 devfn, where,
-							 val);
-	case 2:
-		return galileo_pcibios_write_config_word(bus->number,
-							 devfn, where,
-							 val);
-	case 4:
-		return galileo_pcibios_write_config_dword(bus->number,
-							  devfn, where,
-							  val);
-	}
-	return PCIBIOS_FUNC_NOT_SUPPORTED;
-}
-
-struct pci_fixup pcibios_fixups[] = {
-	{0}
+static struct resource gt_pci_io_mem0_resource = {
+	.name	= "MV64240 PCI0 IO MEM",
+	.start	= 0xe0000000UL,
+	.end	= 0xefffffffUL,
+	.flags	= IORESOURCE_IO
 };
 
-void __devinit pcibios_fixup_bus(struct pci_bus *c)
-{
-	gt64240_board_pcibios_fixup_bus(c);
-}
+static struct mv_pci_controller gt_bus0_controller = {
+	.pcic = {
+		.pci_ops	= &mv_pci_ops,
+		.mem_resource	= &gt_pci_mem0_resource,
+		.mem_offset	= 0xc0000000UL,
+		.io_resource	= &gt_pci_io_mem0_resource,
+		.io_offset	= 0x00000000UL
+	},
+	.config_addr	= PCI_0CONFIGURATION_ADDRESS,
+	.config_vreg	= PCI_0CONFIGURATION_DATA_VIRTUAL_REGISTER,
+};
 
+static struct resource gt_pci_mem1_resource = {
+	.name	= "MV64240 PCI1 MEM",
+	.start	= 0xd0000000UL,
+	.end	= 0xdfffffffUL,
+	.flags	= IORESOURCE_MEM
+};
 
-/********************************************************************
-* pci0P2PConfig - This function set the PCI_0 P2P configurate.
-*                 For more information on the P2P read PCI spec.
-*
-* Inputs:  unsigned int SecondBusLow - Secondery PCI interface Bus Range Lower
-*                                      Boundry.
-*          unsigned int SecondBusHigh - Secondry PCI interface Bus Range upper
-*                                      Boundry.
-*          unsigned int busNum - The CPI bus number to which the PCI interface
-*                                      is connected.
-*          unsigned int devNum - The PCI interface's device number.
-*
-* Returns:  true.
-*/
-void pci0P2PConfig(unsigned int SecondBusLow, unsigned int SecondBusHigh,
-		   unsigned int busNum, unsigned int devNum)
-{
-	uint32_t regData;
+static struct resource gt_pci_io_mem1_resource = {
+	.name	= "MV64240 PCI1 IO MEM",
+	.start	= 0xf0000000UL,
+	.end	= 0xffffffffUL,
+	.flags	= IORESOURCE_IO
+};
 
-	regData = (SecondBusLow & 0xff) | ((SecondBusHigh & 0xff) << 8) |
-	    ((busNum & 0xff) << 16) | ((devNum & 0x1f) << 24);
-	GT_WRITE(PCI_0P2P_CONFIGURATION, regData);
-}
+static struct mv_pci_controller gt_bus1_controller = {
+	.pcic = {
+		.pci_ops	= &mv_pci_ops,
+		.mem_resource	= &gt_pci_mem1_resource,
+		.mem_offset	= 0xd0000000UL,
+		.io_resource	= &gt_pci_io_mem1_resource,
+		.io_offset	= 0x10000000UL
+	},
+	.config_addr	= PCI_1CONFIGURATION_ADDRESS,
+	.config_vreg	= PCI_1CONFIGURATION_DATA_VIRTUAL_REGISTER,
+};
 
-/********************************************************************
-* pci1P2PConfig - This function set the PCI_1 P2P configurate.
-*                 For more information on the P2P read PCI spec.
-*
-* Inputs:  unsigned int SecondBusLow - Secondery PCI interface Bus Range Lower
-*               Boundry.
-*          unsigned int SecondBusHigh - Secondry PCI interface Bus Range upper
-*               Boundry.
-*          unsigned int busNum - The CPI bus number to which the PCI interface
-*               is connected.
-*          unsigned int devNum - The PCI interface's device number.
-*
-* Returns:  true.
-*/
-void pci1P2PConfig(unsigned int SecondBusLow, unsigned int SecondBusHigh,
-		   unsigned int busNum, unsigned int devNum)
+static __init int __init ocelot_g_pci_init(void)
 {
-	uint32_t regData;
+	unsigned long io_v_base;
 
-	regData = (SecondBusLow & 0xff) | ((SecondBusHigh & 0xff) << 8) |
-	    ((busNum & 0xff) << 16) | ((devNum & 0x1f) << 24);
-	GT_WRITE(PCI_1P2P_CONFIGURATION, regData);
-}
+	if (gt_io_size) {
+		io_v_base = (unsigned long) ioremap(gt_io_base, gt_io_size);
+		if (!io_v_base)
+			panic("Could not ioremap I/O port range");
 
-#define PCI0_STATUS_COMMAND_REG                 0x4
-#define PCI1_STATUS_COMMAND_REG                 0x84
-
-static int __init pcibios_init(void)
-{
-	/* Reset PCI I/O and PCI MEM values */
-	ioport_resource.start = 0xe0000000;
-	ioport_resource.end = 0xe0000000 + 0x20000000 - 1;
-	iomem_resource.start = 0xc0000000;
-	iomem_resource.end = 0xc0000000 + 0x20000000 - 1;
+		set_io_port_base(io_v_base);
+	}
 
-	pci_scan_bus(0, &galileo_pci_ops, NULL);
-	pci_scan_bus(1, &galileo_pci_ops, NULL);
+	register_pci_controller(&gt_bus0_controller.pcic);
+	register_pci_controller(&gt_bus1_controller.pcic);
 
 	return 0;
 }
 
-subsys_initcall(pcibios_init);
+arch_initcall(ocelot_g_pci_init);
diff --git a/arch/mips/pci/pci-vr41xx.c b/arch/mips/pci/pci-vr41xx.c
index 8068b0171..a6db6f028 100644
--- a/arch/mips/pci/pci-vr41xx.c
+++ b/arch/mips/pci/pci-vr41xx.c
@@ -1,48 +1,32 @@
 /*
- * FILE NAME
- *	arch/mips/vr41xx/common/pciu.c
+ *  pci-vr41xx.c, PCI Control Unit routines for the NEC VR4100 series.
  *
- * BRIEF MODULE DESCRIPTION
- *	PCI Control Unit routines for the NEC VR4100 series.
+ *  Copyright (C) 2001-2003 MontaVista Software Inc.
+ *    Author: Yoichi Yuasa <yyuasa@mvista.com or source@mvista.com>
+ *  Copyright (C) 2004  Yoichi Yuasa <yuasa@hh.iij4u.or.jp>
  *
- * Author: Yoichi Yuasa
- *         yyuasa@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.
  *
- * Copyright 2001-2003 MontaVista Software Inc.
+ *  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.
  *
- *  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.
+ *  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
  */
 /*
  * Changes:
- *  Paul Mundt <lethal@chaoticdreams.org>
- *  - Fix deadlock-causing PCIU access race for VR4131.
- *
  *  MontaVista Software Inc. <yyuasa@mvista.com> or <source@mvista.com>
  *  - New creation, NEC VR4122 and VR4131 are supported.
  */
-#include <linux/config.h>
 #include <linux/init.h>
 #include <linux/pci.h>
 #include <linux/types.h>
-#include <linux/delay.h>
 
 #include <asm/cpu.h>
 #include <asm/io.h>
@@ -51,183 +35,257 @@
 
 #include "pci-vr41xx.h"
 
-static inline int vr41xx_pci_config_access(unsigned char bus,
-					   unsigned int devfn, int where)
-{
-	if (bus == 0) {
-		/*
-		 * Type 0 configuration
-		 */
-		if (PCI_SLOT(devfn) < 11 || where > 255)
-			return -1;
-
-		writel((1UL << PCI_SLOT(devfn)) |
-		       (PCI_FUNC(devfn) << 8) |
-		       (where & 0xfc), PCICONFAREG);
-	} else {
-		/*
-		 * Type 1 configuration
-		 */
-		if (where > 255)
-			return -1;
-
-		writel((bus << 16) |
-		       (devfn << 8) | (where & 0xfc) | 1UL, PCICONFAREG);
-	}
-
-	return 0;
-}
+extern struct pci_ops vr41xx_pci_ops;
 
-static int vr41xx_pci_config_read(struct pci_bus *bus, unsigned int devfn,
-				  int where, int size, u32 * val)
-{
-	u32 data;
-
-	*val = 0xffffffffUL;
-	if (vr41xx_pci_config_access(bus->number, devfn, where) < 0)
-		return PCIBIOS_DEVICE_NOT_FOUND;
+static struct pci_master_address_conversion pci_master_memory1 = {
+	.bus_base_address	= PCI_MASTER_MEM1_BUS_BASE_ADDRESS,
+	.address_mask		= PCI_MASTER_MEM1_ADDRESS_MASK,
+	.pci_base_address	= PCI_MASTER_MEM1_PCI_BASE_ADDRESS,
+};
 
-	data = readl(PCICONFDREG);
+static struct pci_target_address_conversion pci_target_memory1 = {
+	.address_mask		= PCI_TARGET_MEM1_ADDRESS_MASK,
+	.bus_base_address	= PCI_TARGET_MEM1_BUS_BASE_ADDRESS,
+};
 
-	switch (size) {
-	case 1:
-		*val = (data >> ((where & 3) << 3)) & 0xffUL;
-		break;
-	case 2:
-		*val = (data >> ((where & 2) << 3)) & 0xffffUL;
-		break;
-	case 4:
-		*val = data;
-		break;
-	default:
-		return PCIBIOS_FUNC_NOT_SUPPORTED;
-	}
+static struct pci_master_address_conversion pci_master_io = {
+	.bus_base_address	= PCI_MASTER_IO_BUS_BASE_ADDRESS,
+	.address_mask		= PCI_MASTER_IO_ADDRESS_MASK,
+	.pci_base_address	= PCI_MASTER_IO_PCI_BASE_ADDRESS,
+};
 
-	return PCIBIOS_SUCCESSFUL;
-}
+static struct pci_mailbox_address pci_mailbox = {
+	.base_address		= PCI_MAILBOX_BASE_ADDRESS,
+};
 
-static int vr41xx_pci_config_write(struct pci_bus *bus, unsigned int devfn,
-				   int where, int size, u32 val)
-{
-	u32 data;
-	int shift;
+static struct pci_target_address_window pci_target_window1 = {
+	.base_address		= PCI_TARGET_WINDOW1_BASE_ADDRESS,
+};
 
-	if (vr41xx_pci_config_access(bus->number, devfn, where) < 0)
-		return PCIBIOS_DEVICE_NOT_FOUND;
+static struct resource pci_mem_resource = {
+	.name   = "PCI Memory resources",
+	.start  = PCI_MEM_RESOURCE_START,
+	.end    = PCI_MEM_RESOURCE_END,
+	.flags  = IORESOURCE_MEM,
+};
 
-	data = readl(PCICONFDREG);
+static struct resource pci_io_resource = {
+	.name   = "PCI I/O resources",
+	.start  = PCI_IO_RESOURCE_START,
+	.end    = PCI_IO_RESOURCE_END,
+	.flags  = IORESOURCE_IO,
+};
 
-	switch (size) {
-	case 1:
-		shift = (where & 3) << 3;
-		data &= ~(0xff << shift);
-		data |= ((val & 0xff) << shift);
-		break;
-	case 2:
-		shift = (where & 2) << 3;
-		data &= ~(0xffff << shift);
-		data |= ((val & 0xffff) << shift);
-		break;
-	case 4:
-		data = val;
-		break;
-	default:
-		return PCIBIOS_FUNC_NOT_SUPPORTED;
-	}
+static struct pci_controller_unit_setup vr41xx_pci_controller_unit_setup = {
+	.master_memory1				= &pci_master_memory1,
+	.target_memory1				= &pci_target_memory1,
+	.master_io				= &pci_master_io,
+	.exclusive_access			= CANNOT_LOCK_FROM_DEVICE,
+	.wait_time_limit_from_irdy_to_trdy	= 0,
+	.mailbox				= &pci_mailbox,
+	.target_window1				= &pci_target_window1,
+	.master_latency_timer			= 0x80,
+	.retry_limit				= 0,
+	.arbiter_priority_control		= PCI_ARBITRATION_MODE_FAIR,
+	.take_away_gnt_mode			= PCI_TAKE_AWAY_GNT_DISABLE,
+};
 
-	writel(data, PCICONFDREG);
+static struct pci_controller vr41xx_pci_controller = {
+	.pci_ops        = &vr41xx_pci_ops,
+	.mem_resource	= &pci_mem_resource,
+	.io_resource	= &pci_io_resource,
+};
 
-	return PCIBIOS_SUCCESSFUL;
+void __init vr41xx_pciu_setup(struct pci_controller_unit_setup *setup)
+{
+	vr41xx_pci_controller_unit_setup = *setup;
 }
 
-struct pci_ops vr41xx_pci_ops = {
-	.read = vr41xx_pci_config_read,
-	.write = vr41xx_pci_config_write,
-};
-
-void __init vr41xx_pciu_init(struct vr41xx_pci_address_map *map)
+static int __init vr41xx_pciu_init(void)
 {
-	struct vr41xx_pci_address_space *s;
-	unsigned long vtclock;
-	u32 config;
-	int n;
+	struct pci_controller_unit_setup *setup;
+	struct pci_master_address_conversion *master;
+	struct pci_target_address_conversion *target;
+	struct pci_mailbox_address *mailbox;
+	struct pci_target_address_window *window;
+	unsigned long vtclock, pci_clock_max;
+	uint32_t val;
 
-	if (!map)
-		return;
+	setup = &vr41xx_pci_controller_unit_setup;
 
 	/* Disable PCI interrupt */
-	writew(0, MPCIINTREG);
+	vr41xx_disable_pciint();
 
 	/* Supply VTClock to PCIU */
 	vr41xx_supply_clock(PCIU_CLOCK);
 
-	/*
-	 * Sleep for 1us after setting MSKPPCIU bit in CMUCLKMSK
-	 * before doing any PCIU access to avoid deadlock on VR4131.
-	 */
-	udelay(1);
+	/* Dummy write, waiting for supply of VTClock. */
+	vr41xx_disable_pciint();
 
 	/* Select PCI clock */
+	if (setup->pci_clock_max != 0)
+		pci_clock_max = setup->pci_clock_max;
+	else
+		pci_clock_max = PCI_CLOCK_MAX;
 	vtclock = vr41xx_get_vtclock_frequency();
-	if (vtclock < MAX_PCI_CLOCK)
+	if (vtclock < pci_clock_max)
 		writel(EQUAL_VTCLOCK, PCICLKSELREG);
-	else if ((vtclock / 2) < MAX_PCI_CLOCK)
+	else if ((vtclock / 2) < pci_clock_max)
 		writel(HALF_VTCLOCK, PCICLKSELREG);
-	else if ((vtclock / 4) < MAX_PCI_CLOCK)
+	else if (current_cpu_data.processor_id >= PRID_VR4131_REV2_1 &&
+	         (vtclock / 3) < pci_clock_max)
+		writel(ONE_THIRD_VTCLOCK, PCICLKSELREG);
+	else if ((vtclock / 4) < pci_clock_max)
 		writel(QUARTER_VTCLOCK, PCICLKSELREG);
-	else
-		printk(KERN_INFO "Warning: PCI Clock is over 33MHz.\n");
+	else {
+		printk(KERN_ERR "PCI Clock is over 33MHz.\n");
+		return -EINVAL;
+	}
 
 	/* Supply PCI clock by PCI bus */
 	vr41xx_supply_clock(PCI_CLOCK);
 
-	/*
-	 * Set PCI memory & I/O space address conversion registers
-	 * for master transaction.
-	 */
-	if (map->mem1 != NULL) {
-		s = map->mem1;
-		config = (s->internal_base & 0xff000000) |
-		    ((s->address_mask & 0x7f000000) >> 11) | (1UL << 12) |
-		    ((s->pci_base & 0xff000000) >> 24);
-		writel(config, PCIMMAW1REG);
+	if (setup->master_memory1 != NULL) {
+		master = setup->master_memory1;
+		val = IBA(master->bus_base_address) |
+		      MASTER_MSK(master->address_mask) |
+		      WINEN |
+		      PCIA(master->pci_base_address);
+		writel(val, PCIMMAW1REG);
+	} else {
+		val = readl(PCIMMAW1REG);
+		val &= ~WINEN;
+		writel(val, PCIMMAW1REG);
+	}
+
+	if (setup->master_memory2 != NULL) {
+		master = setup->master_memory2;
+		val = IBA(master->bus_base_address) |
+		      MASTER_MSK(master->address_mask) |
+		      WINEN |
+		      PCIA(master->pci_base_address);
+		writel(val, PCIMMAW2REG);
+	} else {
+		val = readl(PCIMMAW2REG);
+		val &= ~WINEN;
+		writel(val, PCIMMAW2REG);
+	}
+
+	if (setup->target_memory1 != NULL) {
+		target = setup->target_memory1;
+		val = TARGET_MSK(target->address_mask) |
+		      WINEN |
+		      ITA(target->bus_base_address);
+		writel(val, PCITAW1REG);
+	} else {
+		val = readl(PCITAW1REG);
+		val &= ~WINEN;
+		writel(val, PCITAW1REG);
+	}
+
+	if (setup->target_memory2 != NULL) {
+		target = setup->target_memory2;
+		val = TARGET_MSK(target->address_mask) |
+		      WINEN |
+		      ITA(target->bus_base_address);
+		writel(val, PCITAW2REG);
+	} else {
+		val = readl(PCITAW2REG);
+		val &= ~WINEN;
+		writel(val, PCITAW2REG);
+	}
+
+	if (setup->master_io != NULL) {
+		master = setup->master_io;
+		val = IBA(master->bus_base_address) |
+		      MASTER_MSK(master->address_mask) |
+		      WINEN |
+		      PCIIA(master->pci_base_address);
+		writel(val, PCIMIOAWREG);
+	} else {
+		val = readl(PCIMIOAWREG);
+		val &= ~WINEN;
+		writel(val, PCIMIOAWREG);
+	}
+
+	if (setup->exclusive_access == CANNOT_LOCK_FROM_DEVICE)
+		writel(UNLOCK, PCIEXACCREG);
+	else
+		writel(0, PCIEXACCREG);
+
+	if (current_cpu_data.cputype == CPU_VR4122)
+		writel(TRDYV(setup->wait_time_limit_from_irdy_to_trdy), PCITRDYVREG);
+
+	writel(MLTIM(setup->master_latency_timer), LATTIMEREG);
+
+	if (setup->mailbox != NULL) {
+		mailbox = setup->mailbox;
+		val = MBADD(mailbox->base_address) | TYPE_32BITSPACE |
+		      MSI_MEMORY | PREF_APPROVAL;
+		writel(val, MAILBAREG);
 	}
-	if (map->mem2 != NULL) {
-		s = map->mem2;
-		config = (s->internal_base & 0xff000000) |
-		    ((s->address_mask & 0x7f000000) >> 11) | (1UL << 12) |
-		    ((s->pci_base & 0xff000000) >> 24);
-		writel(config, PCIMMAW2REG);
+
+	if (setup->target_window1) {
+		window = setup->target_window1;
+		val = PMBA(window->base_address) | TYPE_32BITSPACE |
+		      MSI_MEMORY | PREF_APPROVAL;
+		writel(val, PCIMBA1REG);
+	}
+
+	if (setup->target_window2) {
+		window = setup->target_window2;
+		val = PMBA(window->base_address) | TYPE_32BITSPACE |
+		      MSI_MEMORY | PREF_APPROVAL;
+		writel(val, PCIMBA2REG);
 	}
-	if (map->io != NULL) {
-		s = map->io;
-		config = (s->internal_base & 0xff000000) |
-		    ((s->address_mask & 0x7f000000) >> 11) | (1UL << 12) |
-		    ((s->pci_base & 0xff000000) >> 24);
-		writel(config, PCIMIOAWREG);
+
+	val = readl(RETVALREG);
+	val &= ~RTYVAL_MASK;
+	val |= RTYVAL(setup->retry_limit);
+	writel(val, RETVALREG);
+
+	val = readl(PCIAPCNTREG);
+	val &= ~(TKYGNT | PAPC);
+
+	switch (setup->arbiter_priority_control) {
+	case PCI_ARBITRATION_MODE_ALTERNATE_0:
+		val |= PAPC_ALTERNATE_0;
+		break;
+	case PCI_ARBITRATION_MODE_ALTERNATE_B:
+		val |= PAPC_ALTERNATE_B;
+		break;
+	default:
+		val |= PAPC_FAIR;
+		break;
 	}
 
-	/* Set target memory windows */
-	writel(0x00081000, PCITAW1REG);
-	writel(0UL, PCITAW2REG);
-	pciu_write_config_dword(PCI_BASE_ADDRESS_0, 0UL);
-	pciu_write_config_dword(PCI_BASE_ADDRESS_1, 0UL);
+	if (setup->take_away_gnt_mode == PCI_TAKE_AWAY_GNT_ENABLE)
+		val |= TKYGNT_ENABLE;
+
+	writel(val, PCIAPCNTREG);
+
+	writel(PCI_COMMAND_IO | PCI_COMMAND_MEMORY | PCI_COMMAND_MASTER |
+	       PCI_COMMAND_PARITY | PCI_COMMAND_SERR, COMMANDREG);
 
 	/* Clear bus error */
-	n = readl(BUSERRADREG);
+	readl(BUSERRADREG);
+
+	writel(CONFIG_DONE, PCIENREG);
+
+	if (setup->mem_resource != NULL)
+		vr41xx_pci_controller.mem_resource = setup->mem_resource;
 
-	if (current_cpu_data.cputype == CPU_VR4122) {
-		writel(0UL, PCITRDYVREG);
-		pciu_write_config_dword(PCI_CACHE_LINE_SIZE, 0x0000f804);
+	if (setup->io_resource != NULL) {
+		vr41xx_pci_controller.io_resource = setup->io_resource;
 	} else {
-		writel(100UL, PCITRDYVREG);
-		pciu_write_config_dword(PCI_CACHE_LINE_SIZE, 0x00008004);
+		set_io_port_base(IO_PORT_BASE);
+		ioport_resource.start = IO_PORT_RESOURCE_START;
+		ioport_resource.end = IO_PORT_RESOURCE_END;
 	}
 
-	writel(CONFIG_DONE, PCIENREG);
-	pciu_write_config_dword(PCI_COMMAND,
-				PCI_COMMAND_IO |
-				PCI_COMMAND_MEMORY |
-				PCI_COMMAND_MASTER |
-				PCI_COMMAND_PARITY | PCI_COMMAND_SERR);
+	register_pci_controller(&vr41xx_pci_controller);
+
+	return 0;
 }
+
+early_initcall(vr41xx_pciu_init);
diff --git a/arch/mips/pci/pci-vr41xx.h b/arch/mips/pci/pci-vr41xx.h
index f0fca0c78..3a5f69bfb 100644
--- a/arch/mips/pci/pci-vr41xx.h
+++ b/arch/mips/pci/pci-vr41xx.h
@@ -1,164 +1,151 @@
 /*
- * FILE NAME
- *	arch/mips/vr41xx/common/pciu.h
+ *  pci-vr41xx.h, Include file for PCI Control Unit of the NEC VR4100 series.
  *
- * BRIEF MODULE DESCRIPTION
- *	Include file for PCI Control Unit of the NEC VR4100 series.
+ *  Copyright (C) 2002  MontaVista Software Inc.
+ *    Author: Yoichi Yuasa <yyuasa@mvista.com or source@mvista.com>
+ *  Copyright (C) 2004  Yoichi Yuasa <yuasa@hh.iij4u.or.jp>
  *
- * Author: Yoichi Yuasa
- *         yyuasa@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.
  *
- * Copyright 2002 MontaVista Software Inc.
+ *  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.
  *
- *  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.
+ *  You should have received a copy of the GNU General Public License
+ *  along with this program; if not, write to the Free Software
+ *  Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA
  */
+#ifndef __PCI_VR41XX_H
+#define __PCI_VR41XX_H
+
+#define PCIMMAW1REG		KSEG1ADDR(0x0f000c00)
+#define PCIMMAW2REG		KSEG1ADDR(0x0f000c04)
+#define PCITAW1REG		KSEG1ADDR(0x0f000c08)
+#define PCITAW2REG		KSEG1ADDR(0x0f000c0c)
+#define PCIMIOAWREG		KSEG1ADDR(0x0f000c10)
+ #define IBA(addr)		((addr) & 0xff000000U)
+ #define MASTER_MSK(mask)	(((mask) >> 11) & 0x000fe000U)
+ #define PCIA(addr)		(((addr) >> 24) & 0x000000ffU)
+ #define TARGET_MSK(mask)	(((mask) >> 8) & 0x000fe000U)
+ #define ITA(addr)		(((addr) >> 24) & 0x000000ffU)
+ #define PCIIA(addr)		(((addr) >> 24) & 0x000000ffU)
+ #define WINEN			0x1000U
+#define PCICONFDREG		KSEG1ADDR(0x0f000c14)
+#define PCICONFAREG		KSEG1ADDR(0x0f000c18)
+#define PCIMAILREG		KSEG1ADDR(0x0f000c1c)
+#define BUSERRADREG		KSEG1ADDR(0x0f000c24)
+ #define EA(reg)		((reg) &0xfffffffc)
+
+#define INTCNTSTAREG		KSEG1ADDR(0x0f000c28)
+ #define MABTCLR		0x80000000U
+ #define TRDYCLR		0x40000000U
+ #define PARCLR			0x20000000U
+ #define MBCLR			0x10000000U
+ #define SERRCLR		0x08000000U
+ #define RTYCLR			0x04000000U
+ #define MABCLR			0x02000000U
+ #define TABCLR			0x01000000U
+ /* RFU */
+ #define MABTMSK		0x00008000U
+ #define TRDYMSK		0x00004000U
+ #define PARMSK			0x00002000U
+ #define MBMSK			0x00001000U
+ #define SERRMSK		0x00000800U
+ #define RTYMSK			0x00000400U
+ #define MABMSK			0x00000200U
+ #define TABMSK			0x00000100U
+ #define IBAMABT		0x00000080U
+ #define TRDYRCH		0x00000040U
+ #define PAR			0x00000020U
+ #define MB			0x00000010U
+ #define PCISERR		0x00000008U
+ #define RTYRCH			0x00000004U
+ #define MABORT			0x00000002U
+ #define TABORT			0x00000001U
+
+#define PCIEXACCREG		KSEG1ADDR(0x0f000c2c)
+ #define UNLOCK			0x2U
+ #define EAREQ			0x1U
+#define PCIRECONTREG		KSEG1ADDR(0x0f000c30)
+ #define RTRYCNT(reg)		((reg) & 0x000000ffU)
+#define PCIENREG		KSEG1ADDR(0x0f000c34)
+ #define CONFIG_DONE		0x4U
+#define PCICLKSELREG		KSEG1ADDR(0x0f000c38)
+ #define EQUAL_VTCLOCK		0x2U
+ #define HALF_VTCLOCK		0x0U
+ #define ONE_THIRD_VTCLOCK	0x3U
+ #define QUARTER_VTCLOCK	0x1U
+#define PCITRDYVREG		KSEG1ADDR(0x0f000c3c)
+ #define TRDYV(val)		((uint32_t)(val) & 0xffU)
+#define PCICLKRUNREG		KSEG1ADDR(0x0f000c60)
+
+#define VENDORIDREG		KSEG1ADDR(0x0f000d00)
+#define DEVICEIDREG		KSEG1ADDR(0x0f000d00)
+#define COMMANDREG		KSEG1ADDR(0x0f000d04)
+#define STATUSREG		KSEG1ADDR(0x0f000d04)
+#define REVIDREG		KSEG1ADDR(0x0f000d08)
+#define CLASSREG		KSEG1ADDR(0x0f000d08)
+#define CACHELSREG		KSEG1ADDR(0x0f000d0c)
+#define LATTIMEREG		KSEG1ADDR(0x0f000d0c)
+ #define MLTIM(val)		(((uint32_t)(val) << 7) & 0xff00U)
+#define MAILBAREG		KSEG1ADDR(0x0f000d10)
+#define PCIMBA1REG		KSEG1ADDR(0x0f000d14)
+#define PCIMBA2REG		KSEG1ADDR(0x0f000d18)
+ #define MBADD(base)		((base) & 0xfffff800U)
+ #define PMBA(base)		((base) & 0xffe00000U)
+ #define PREF			0x8U
+ #define PREF_APPROVAL		0x8U
+ #define PREF_DISAPPROVAL	0x0U
+ #define TYPE			0x6U
+ #define TYPE_32BITSPACE	0x0U
+ #define MSI			0x1U
+ #define MSI_MEMORY		0x0U
+#define INTLINEREG		KSEG1ADDR(0x0f000d3c)
+#define INTPINREG		KSEG1ADDR(0x0f000d3c)
+#define RETVALREG		KSEG1ADDR(0x0f000d40)
+#define PCIAPCNTREG		KSEG1ADDR(0x0f000d40)
+ #define TKYGNT			0x04000000U
+ #define TKYGNT_ENABLE		0x04000000U
+ #define TKYGNT_DISABLE		0x00000000U
+ #define PAPC			0x03000000U
+ #define PAPC_ALTERNATE_B	0x02000000U
+ #define PAPC_ALTERNATE_0	0x01000000U
+ #define PAPC_FAIR		0x00000000U
+ #define RTYVAL(val)		(((uint32_t)(val) << 7) & 0xff00U)
+ #define RTYVAL_MASK		0xff00U
+
+#define PCI_CLOCK_MAX		33333333U
+
 /*
- * Changes:
- *  MontaVista Software Inc. <yyuasa@mvista.com> or <source@mvista.com>
- *  - New creation, NEC VR4122 and VR4131 are supported.
+ * Default setup
  */
-#ifndef __VR41XX_PCIU_H
-#define __VR41XX_PCIU_H
-
-#include <linux/config.h>
-#include <asm/addrspace.h>
-
-#define BIT(x)	(1 << (x))
-
-#define PCIMMAW1REG			KSEG1ADDR(0x0f000c00)
-#define PCIMMAW2REG			KSEG1ADDR(0x0f000c04)
-#define PCITAW1REG			KSEG1ADDR(0x0f000c08)
-#define PCITAW2REG			KSEG1ADDR(0x0f000c0c)
-#define PCIMIOAWREG			KSEG1ADDR(0x0f000c10)
-#define INTERNAL_BUS_BASE_ADDRESS	0xff000000
-#define ADDRESS_MASK			0x000fe000
-#define PCI_ACCESS_ENABLE		BIT(12)
-#define PCI_ADDRESS_SETTING		0x000000ff
-
-#define PCICONFDREG			KSEG1ADDR(0x0f000c14)
-#define PCICONFAREG			KSEG1ADDR(0x0f000c18)
-#define PCIMAILREG			KSEG1ADDR(0x0f000c1c)
-
-#define BUSERRADREG			KSEG1ADDR(0x0f000c24)
-#define ERROR_ADDRESS			0xfffffffc
-
-#define INTCNTSTAREG			KSEG1ADDR(0x0f000c28)
-#define MABTCLR				BIT(31)
-#define TRDYCLR				BIT(30)
-#define PARCLR				BIT(29)
-#define MBCLR				BIT(28)
-#define SERRCLR				BIT(27)
-
-#define PCIEXACCREG			KSEG1ADDR(0x0f000c2c)
-#define UNLOCK				BIT(1)
-#define EAREQ				BIT(0)
-
-#define PCIRECONTREG			KSEG1ADDR(0x0f000c30)
-#define RTRYCNT				0x000000ff
-
-#define PCIENREG			KSEG1ADDR(0x0f000c34)
-#define CONFIG_DONE			BIT(2)
-
-#define PCICLKSELREG			KSEG1ADDR(0x0f000c38)
-#define EQUAL_VTCLOCK			0x00000002
-#define HALF_VTCLOCK			0x00000000
-#define QUARTER_VTCLOCK			0x00000001
-
-#define PCITRDYVREG			KSEG1ADDR(0x0f000c3c)
-
-#define PCICLKRUNREG			KSEG1ADDR(0x0f000c60)
-
-#define PCIU_CONFIGREGS_BASE		KSEG1ADDR(0x0f000d00)
-#define VENDORIDREG			KSEG1ADDR(0x0f000d00)
-#define DEVICEIDREG			KSEG1ADDR(0x0f000d00)
-#define COMMANDREG			KSEG1ADDR(0x0f000d04)
-#define STATUSREG			KSEG1ADDR(0x0f000d04)
-#define REVIDREG			KSEG1ADDR(0x0f000d08)
-#define CLASSREG			KSEG1ADDR(0x0f000d08)
-#define CACHELSREG			KSEG1ADDR(0x0f000d0c)
-#define LATTIMEREG			KSEG1ADDR(0x0f000d0c)
-#define MAILBAREG			KSEG1ADDR(0x0f000d10)
-#define PCIMBA1REG			KSEG1ADDR(0x0f000d14)
-#define PCIMBA2REG			KSEG1ADDR(0x0f000d18)
-#define INTLINEREG			KSEG1ADDR(0x0f000d3c)
-#define INTPINREG			KSEG1ADDR(0x0f000d3c)
-#define RETVALREG			KSEG1ADDR(0x0f000d40)
-#define PCIAPCNTREG			KSEG1ADDR(0x0f000d40)
-
-#define MPCIINTREG			KSEG1ADDR(0x0f0000b2)
-
-#define MAX_PCI_CLOCK			33333333
-
-static inline int pciu_read_config_byte(int where, u8 * val)
-{
-	u32 data;
-
-	data = readl(PCIU_CONFIGREGS_BASE + where);
-	*val = (u8) (data >> ((where & 3) << 3));
-
-	return PCIBIOS_SUCCESSFUL;
-}
-
-static inline int pciu_read_config_word(int where, u16 * val)
-{
-	u32 data;
-
-	if (where & 1)
-		return PCIBIOS_BAD_REGISTER_NUMBER;
-
-	data = readl(PCIU_CONFIGREGS_BASE + where);
-	*val = (u16) (data >> ((where & 2) << 3));
-
-	return PCIBIOS_SUCCESSFUL;
-}
-
-static inline int pciu_read_config_dword(int where, u32 * val)
-{
-	if (where & 3)
-		return PCIBIOS_BAD_REGISTER_NUMBER;
-
-	*val = readl(PCIU_CONFIGREGS_BASE + where);
+#define PCI_MASTER_MEM1_BUS_BASE_ADDRESS	0x10000000U
+#define PCI_MASTER_MEM1_ADDRESS_MASK		0x7c000000U
+#define PCI_MASTER_MEM1_PCI_BASE_ADDRESS	0x10000000U
 
-	return PCIBIOS_SUCCESSFUL;
-}
+#define PCI_TARGET_MEM1_ADDRESS_MASK		0x08000000U
+#define PCI_TARGET_MEM1_BUS_BASE_ADDRESS	0x00000000U
 
-static inline int pciu_write_config_byte(int where, u8 val)
-{
-	writel(val, PCIU_CONFIGREGS_BASE + where);
+#define PCI_MASTER_IO_BUS_BASE_ADDRESS		0x16000000U
+#define PCI_MASTER_IO_ADDRESS_MASK		0x7e000000U
+#define PCI_MASTER_IO_PCI_BASE_ADDRESS		0x00000000U
 
-	return 0;
-}
+#define PCI_MAILBOX_BASE_ADDRESS		0x00000000U
 
-static inline int pciu_write_config_word(int where, u16 val)
-{
-	writel(val, PCIU_CONFIGREGS_BASE + where);
+#define PCI_TARGET_WINDOW1_BASE_ADDRESS		0x00000000U
 
-	return 0;
-}
+#define IO_PORT_BASE		KSEG1ADDR(PCI_MASTER_IO_BUS_BASE_ADDRESS)
+#define IO_PORT_RESOURCE_START	PCI_MASTER_IO_PCI_BASE_ADDRESS
+#define IO_PORT_RESOURCE_END	(~PCI_MASTER_IO_ADDRESS_MASK & PCI_MASTER_ADDRESS_MASK)
 
-static inline int pciu_write_config_dword(int where, u32 val)
-{
-	writel(val, PCIU_CONFIGREGS_BASE + where);
+#define PCI_IO_RESOURCE_START	0x01000000UL
+#define PCI_IO_RESOURCE_END	0x01ffffffUL
 
-	return 0;
-}
+#define PCI_MEM_RESOURCE_START	0x11000000UL
+#define PCI_MEM_RESOURCE_END	0x13ffffffUL
 
-#endif				/* __VR41XX_PCIU_H */
+#endif /* __PCI_VR41XX_H */
diff --git a/arch/mips/pci/pci.c b/arch/mips/pci/pci.c
index eacfcda3d..9bee1e937 100644
--- a/arch/mips/pci/pci.c
+++ b/arch/mips/pci/pci.c
@@ -231,7 +231,7 @@ static void __init pcibios_fixup_device_resources(struct pci_dev *dev,
 {
 	/* Update device resources.  */
 	struct pci_controller *hose = (struct pci_controller *)bus->sysdata;
-	unsigned long offset;
+	unsigned long offset = 0;
 	int i;
 
 	for (i = 0; i < PCI_NUM_RESOURCES; i++) {
diff --git a/arch/mips/pmc-sierra/yosemite/Makefile b/arch/mips/pmc-sierra/yosemite/Makefile
index 1537b6d36..bc1758623 100644
--- a/arch/mips/pmc-sierra/yosemite/Makefile
+++ b/arch/mips/pmc-sierra/yosemite/Makefile
@@ -1,8 +1,7 @@
 #
-# Makefile for the PMC-Sierra Titan 
+# Makefile for the PMC-Sierra Titan
 #
 
-obj-y    += irq-handler.o irq.o prom.o setup.o
+obj-y    += irq-handler.o irq.o i2c-yosemite.o prom.o py-console.o setup.o
 
-obj-$(CONFIG_SMP)          	+= smp.o
-obj-$(CONFIG_HYPERTRANSPORT)	+= ht-irq.o ht.o
+obj-$(CONFIG_KGDB)		+= dbg_io.o
diff --git a/arch/mips/pmc-sierra/yosemite/i2c-yosemite.h b/arch/mips/pmc-sierra/yosemite/i2c-yosemite.h
index 8b6e49c63..31c552327 100644
--- a/arch/mips/pmc-sierra/yosemite/i2c-yosemite.h
+++ b/arch/mips/pmc-sierra/yosemite/i2c-yosemite.h
@@ -31,7 +31,7 @@
 /* Read and Write operations to the chip */
 
 #define TITAN_I2C_BASE			0xbb000000	/* XXX Needs to change */
-	
+
 #define	TITAN_I2C_WRITE(offset, data)	\
 					*(volatile unsigned long *)(TITAN_I2C_BASE + offset) = data
 
@@ -48,14 +48,14 @@
 #define TITAN_I2C_MAX_POLL		100
 
 /* Registers used for I2C work */
-#define TITAN_I2C_SCMB_CONTROL		0x0180  /* SCMB Control */
-#define TITAN_I2C_SCMB_CLOCK_A		0x0184  /* SCMB Clock A */
-#define TITAN_I2C_SCMB_CLOCK_B		0x0188  /* SCMB Clock B */
-#define	TITAN_I2C_CONFIG		0x01A0  /* I2C Config */
-#define TITAN_I2C_COMMAND		0x01A4  /* I2C Command */
+#define TITAN_I2C_SCMB_CONTROL		0x0180	/* SCMB Control */
+#define TITAN_I2C_SCMB_CLOCK_A		0x0184	/* SCMB Clock A */
+#define TITAN_I2C_SCMB_CLOCK_B		0x0188	/* SCMB Clock B */
+#define	TITAN_I2C_CONFIG		0x01A0	/* I2C Config */
+#define TITAN_I2C_COMMAND		0x01A4	/* I2C Command */
 #define	TITAN_I2C_SLAVE_ADDRESS		0x01A8	/* I2C Slave Address */
-#define TITAN_I2C_DATA			0x01AC  /* I2C Data [15:0] */
-#define TITAN_I2C_INTERRUPTS		0x01BC  /* I2C Interrupts */
+#define TITAN_I2C_DATA			0x01AC	/* I2C Data [15:0] */
+#define TITAN_I2C_INTERRUPTS		0x01BC	/* I2C Interrupts */
 
 /* Error */
 #define	TITAN_I2C_ERR_ARB_LOST		(-9220)
@@ -66,31 +66,31 @@
 
 /* I2C Command Type */
 typedef enum {
-	TITAN_I2C_CMD_WRITE		= 0,
-	TITAN_I2C_CMD_READ		= 1,
-	TITAN_I2C_CMD_READ_WRITE	= 2
+	TITAN_I2C_CMD_WRITE = 0,
+	TITAN_I2C_CMD_READ = 1,
+	TITAN_I2C_CMD_READ_WRITE = 2
 } titan_i2c_cmd_type;
 
 /* I2C structures */
 typedef struct {
-	int	filtera; 		/* Register 0x0184, bits 15 - 12*/
-	int	clka;			/* Register 0x0184, bits 9 - 0 */
-	int	filterb;		/* Register 0x0188, bits 15 - 12 */
-	int	clkb;			/* Register 0x0188, bits 9 - 0 */
+	int filtera;		/* Register 0x0184, bits 15 - 12 */
+	int clka;		/* Register 0x0184, bits 9 - 0 */
+	int filterb;		/* Register 0x0188, bits 15 - 12 */
+	int clkb;		/* Register 0x0188, bits 9 - 0 */
 } titan_i2c_config;
 
 /* I2C command type */
 typedef struct {
-	titan_i2c_cmd_type	type;		/* Type of command */
-	int			num_arb;	/* Register 0x01a0, bits 15 - 12 */
-	int			num_nak;	/* Register 0x01a0, bits 11 - 8 */
-	int			addr_size;	/* Register 0x01a0, bit 7 */
-	int			mst_code;	/* Register 0x01a0, bits 6 - 4 */
-	int			arb_en;		/* Register 0x01a0, bit 1 */
-	int			speed;		/* Register 0x01a0, bit 0 */
-	int			slave_addr;	/* Register 0x01a8 */
-	int			write_size;	/* Register 0x01a4, bits 10 - 8 */
-	unsigned int		*data;		/* Register 0x01ac */
+	titan_i2c_cmd_type type;	/* Type of command */
+	int num_arb;		/* Register 0x01a0, bits 15 - 12 */
+	int num_nak;		/* Register 0x01a0, bits 11 - 8 */
+	int addr_size;		/* Register 0x01a0, bit 7 */
+	int mst_code;		/* Register 0x01a0, bits 6 - 4 */
+	int arb_en;		/* Register 0x01a0, bit 1 */
+	int speed;		/* Register 0x01a0, bit 0 */
+	int slave_addr;		/* Register 0x01a8 */
+	int write_size;		/* Register 0x01a4, bits 10 - 8 */
+	unsigned int *data;	/* Register 0x01ac */
 } titan_i2c_command;
 
-#endif /* __I2C_YOSEMITE_H */ 
+#endif				/* __I2C_YOSEMITE_H */
diff --git a/arch/mips/pmc-sierra/yosemite/irq-handler.S b/arch/mips/pmc-sierra/yosemite/irq-handler.S
index a7caeec63..ebe2e64e2 100644
--- a/arch/mips/pmc-sierra/yosemite/irq-handler.S
+++ b/arch/mips/pmc-sierra/yosemite/irq-handler.S
@@ -8,6 +8,10 @@
  * 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.
+ *
+ * Titan supports Hypertransport or PCI but not both. Hence, one interrupt
+ * line is shared between the PCI slot A and Hypertransport. This is the
+ * Processor INTB #0.
  */
 
 #include <linux/config.h>
@@ -17,109 +21,90 @@
 #include <asm/regdef.h>
 #include <asm/stackframe.h>
 
-/*
- * IRQ router for the Titan board
- */
-
 		.align	5
 		NESTED(titan_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_IP0	/* INTB0 hardware line */
+
+		andi	t1, t0, STATUSF_IP2	/* INTB0 hardware line */
 		bnez	t1, ll_pcia_irq		/* 64-bit PCI */
-		andi	t1, t0, STATUSF_IP1	/* INTB1 hardware line */
+		andi	t1, t0, STATUSF_IP3	/* INTB1 hardware line */
 		bnez	t1, ll_pcib_irq		/* second 64-bit PCI slot */
-		andi	t1, t0, STATUSF_IP2	/* INTB2 hardware line */
+		andi	t1, t0, STATUSF_IP4	/* INTB2 hardware line */
 		bnez	t1, ll_duart_irq	/* UART	*/
-		andi	t1, t0, STATUSF_IP3	/* INTB3 hardware line*/
-		bnez	t1, ll_ht_smp_irq		/* Hypertransport */
-		andi	t1, t0, STATUSF_IP5	/* INTB5 hardware line */
+		andi    t1, t0, STATUSF_IP5	/* SMP inter-core interrupts */
+		bnez    t1, ll_smp_irq
+		andi	t1, t0, STATUSF_IP6
+		bnez	t1, ll_ht_irq		/* Hypertransport */
+		andi	t1, t0, STATUSF_IP7	/* INTB5 hardware line */
 		bnez	t1, ll_timer_irq	/* Timer */
 
 		nop
 		nop
 
 		/* Extended interrupts */
-		mfc0	t0, CPU_CAUSE
-		cfc0	t1, CP0_S1_INTCONTROL
+                mfc0    t0, CP0_CAUSE
+                cfc0    t1, CP0_S1_INTCONTROL
 
-		sll	t2, t1, 8
-		
-		and	t0, t2
-		srl	t0, t0, 16
+                sll     t2, t1, 8
 
-		
-		andi	t1, t0, STATUSF_IP6	/* INTB6 hardware line */
-		bnez	t1, ll_phy0_irq		/* Ethernet port 0 */
-		andi	t1, t0, STATUSF_IP7	/* INTB7 hardware line */
-		bnez	t1, ll_phy1_irq		/* Ethernet port 1 */
-		andi	t1, t0, STATUSF_IP8	/* INTB8 hardware line */
-		bnez	t1, ll_phy2_irq		/* Ethernet Port 2 */
-
-		nop
-		nop
+                and     t0, t2
+                srl     t0, t0, 16
 
 		.set	reorder
 
-		/* No handler */
 		j	spurious_interrupt
 		nop
 		END(titan_handle_int)
 
 		.align	5
 
-/* Individual Handlers */
-
 ll_pcia_irq:
-		li	a0, 1
-		move	a2, sp
+		li	a0, 2
+		move	a1, sp
+#ifdef CONFIG_HYPERTRANSPORT
+		jal	ll_ht_smp_irq_handler
+#else
 		jal	do_IRQ
+#endif
 		j	ret_from_irq
 
 ll_pcib_irq:
-		li      a0, 2
-                move    a1, sp
-                jal     do_IRQ
-                j       ret_from_irq
-
-ll_duart_irq:
 		li	a0, 3
 		move	a1, sp
 		jal	do_IRQ
 		j	ret_from_irq
 
-ll_ht_irq:
+ll_duart_irq:
 		li	a0, 4
 		move	a1, sp
-		jal	ll_ht_smp_irq_handler 	/* Detailed HT & SMP IRQ handling */
+		jal	do_IRQ
 		j	ret_from_irq
 
-ll_timer_irq:
+ll_smp_irq:
 		li	a0, 5
 		move	a1, sp
+#ifdef CONFIG_SMP
+		jal	jaguar_mailbox_irq
+#else
 		jal	do_IRQ
+#endif
 		j	ret_from_irq
 
-ll_phy0_irq:
+ll_ht_irq:
 		li	a0, 6
 		move	a1, sp
-		jal	do_IRQ
-		j	ret_from_irq	
-
-ll_phy1_irq:
-		li	a0, 7
-		move	a1, sp
-		jal	do_IRQ
+		jal	ll_ht_smp_irq_handler
 		j	ret_from_irq
 
-ll_phy2_irq:
-		li	a0, 8
+ll_timer_irq:
+		li	a0, 7
 		move	a1, sp
 		jal	do_IRQ
 		j	ret_from_irq
diff --git a/arch/mips/pmc-sierra/yosemite/irq.c b/arch/mips/pmc-sierra/yosemite/irq.c
index 294290f8a..e8b7ed63e 100644
--- a/arch/mips/pmc-sierra/yosemite/irq.c
+++ b/arch/mips/pmc-sierra/yosemite/irq.c
@@ -41,207 +41,116 @@
 #include <asm/bootinfo.h>
 #include <asm/io.h>
 #include <asm/irq.h>
+#include <asm/irq_cpu.h>
 #include <asm/mipsregs.h>
 #include <asm/system.h>
+#include <asm/titan_dep.h>
 
 /* Hypertransport specific */
-#define IRQ_STATUS_REG_CPU0     0xbb001b30 	/* INT# 3 status register on CPU 0*/
-#define	IRQ_STATUS_REG_CPU1	0xbb002b30	/* INT# 3 status register on CPU 1*/
-#define IRQ_ACK_BITS            0x00000000 	/* Ack bits */
-#define IRQ_CLEAR_REG_CPU0      0xbb002b3c 	/* IRQ clear register on CPU 0*/
-#define IRQ_CLEAR_REG_CPU0      0xbb002b3c      /* IRQ clear register on CPU 1*/
+#define IRQ_ACK_BITS            0x00000000	/* Ack bits */
 
-#define HYPERTRANSPORT_EOI      0xbb0006E0 	/* End of Interrupt */
-#define HYPERTRANSPORT_INTA     0x78    	/* INTA# */
-#define HYPERTRANSPORT_INTB     0x79    	/* INTB# */
-#define HYPERTRANSPORT_INTC     0x7a    	/* INTC# */
-#define HYPERTRANSPORT_INTD     0x7b    	/* INTD# */
-
-#define read_32bit_cp0_set1_register(source)                    \
-({ int __res;                                                   \
-        __asm__ __volatile__(                                   \
-        ".set\tpush\n\t"                                        \
-        ".set\treorder\n\t"                                     \
-        "cfc0\t%0,"STR(source)"\n\t"                            \
-        ".set\tpop"                                             \
-        : "=r" (__res));                                        \
-        __res;})
-
-#define write_32bit_cp0_set1_register(register,value)           \
-        __asm__ __volatile__(                                   \
-        "ctc0\t%0,"STR(register)"\n\t"                          \
-        "nop"                                                   \
-        : : "r" (value));
-
-static spinlock_t 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_c0_status();
-        status &= ~((clr_mask & 0xFF) << 8);
-        status |= (set_mask & 0xFF) << 8 | 0x0000FF00;
-        write_c0_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_rm9000_irq(unsigned int irq)
-{
-        unsigned long flags;
-
-        spin_lock_irqsave(&irq_lock, flags);
-        unmask_irq(1 << (irq-1));
-        spin_unlock_irqrestore(&irq_lock, flags);
-}
-
-static unsigned int startup_rm9000_irq(unsigned int irq)
-{
-        enable_rm9000_irq(irq);
-
-        return 0;                               /* never anything pending */
-}
-
-static void disable_rm9000_irq(unsigned int irq)
-{
-        unsigned long flags;
-
-        spin_lock_irqsave(&irq_lock, flags);
-        mask_irq(1 << (irq-1));
-        spin_unlock_irqrestore(&irq_lock, flags);
-}
-
-#define shutdown_rm9000_irq disable_rm9000_irq
-
-static void mask_and_ack_rm9000_irq(unsigned int irq)
-{
-        mask_irq(1 << (irq-1));
-}
-
-static void end_rm9000_irq(unsigned int irq)
-{
-        if (!(irq_desc[irq].status & (IRQ_DISABLED|IRQ_INPROGRESS)))
-                unmask_irq(1 << (irq-1));
-}
-
-static struct hw_interrupt_type rm9000_hpcdma_irq_type = {
-        "RM9000",
-        startup_rm9000_irq,
-        shutdown_rm9000_irq,
-        enable_rm9000_irq,
-        disable_rm9000_irq,
-        mask_and_ack_rm9000_irq,
-        end_rm9000_irq,
-        NULL
-};
+#define HYPERTRANSPORT_INTA     0x78		/* INTA# */
+#define HYPERTRANSPORT_INTB     0x79		/* INTB# */
+#define HYPERTRANSPORT_INTC     0x7a		/* INTC# */
+#define HYPERTRANSPORT_INTD     0x7b		/* INTD# */
 
 extern asmlinkage void titan_handle_int(void);
 extern void jaguar_mailbox_irq(struct pt_regs *);
 
 /* 
- * Handle hypertransport & SMP interrupts. The interrupt lines are scarce. For interprocessor
- * interrupts, the best thing to do is to use the INTMSG register. We use the same external
- * interrupt line, i.e. INTB3 and monitor another status bit
+ * Handle hypertransport & SMP interrupts. The interrupt lines are scarce.
+ * For interprocessor interrupts, the best thing to do is to use the INTMSG
+ * register. We use the same external interrupt line, i.e. INTB3 and monitor
+ * another status bit
  */
 asmlinkage void ll_ht_smp_irq_handler(int irq, struct pt_regs *regs)
 {
-        u32 status;
-        status = *(volatile uint32_t *)(IRQ_STATUS_REG_CPU0);
+        u32 status = OCD_READ(RM9000x2_OCD_INTP0STATUS4);
 
 	/* Ack all the bits that correspond to the interrupt sources */
 	if (status != 0)
-	        *(volatile uint32_t *)(IRQ_STATUS_REG_CPU0) = IRQ_ACK_BITS;
+	        OCD_WRITE(RM9000x2_OCD_INTP0STATUS4, IRQ_ACK_BITS);
 
-	status = *(volatile uint32_t *)(IRQ_STATUS_REG_CPU1);
+	status = OCD_READ(RM9000x2_OCD_INTP1STATUS4);
 	if (status != 0)
-                *(volatile uint32_t *)(IRQ_STATUS_REG_CPU1) = IRQ_ACK_BITS;
+                OCD_WRITE(RM9000x2_OCD_INTP1STATUS4, IRQ_ACK_BITS);
 
-#ifdef CONFIG_SMP
-	if (status == 0x2) {
-		/* This is an SMP IPI sent from one core to another */
-		jaguar_mailbox_irq(regs);
-		goto done;
-	}
-#endif
-	
 #ifdef CONFIG_HT_LEVEL_TRIGGER
-        /*
-         * Level Trigger Mode only. Send the HT EOI message back to the source.
-         */
-        switch (status) {
-                case 0x1000000:
-                        *(volatile uint32_t *)(HYPERTRANSPORT_EOI) = HYPERTRANSPORT_INTA;
-                        break;
-                case 0x2000000:
-                        *(volatile uint32_t *)(HYPERTRANSPORT_EOI) = HYPERTRANSPORT_INTB;
-                        break;
-                case 0x4000000:
-                        *(volatile uint32_t *)(HYPERTRANSPORT_EOI) = HYPERTRANSPORT_INTC;
-                        break;
-                case 0x8000000:
-                        *(volatile uint32_t *)(HYPERTRANSPORT_EOI) = HYPERTRANSPORT_INTD;
-                        break;
-                case 0x0000001:
-                        /* PLX */
-                        *(volatile uint32_t *)(HYPERTRANSPORT_EOI) = 0x20;
-                        *(volatile uint32_t *)(IRQ_CLEAR_REG) = IRQ_ACK_BITS;
-                        break;
-                case 0xf000000:
-                        *(volatile uint32_t *)(HYPERTRANSPORT_EOI) = HYPERTRANSPORT_INTA;
-                        *(volatile uint32_t *)(HYPERTRANSPORT_EOI) = HYPERTRANSPORT_INTB;
-                        *(volatile uint32_t *)(HYPERTRANSPORT_EOI) = HYPERTRANSPORT_INTC;
-                        *(volatile uint32_t *)(HYPERTRANSPORT_EOI) = HYPERTRANSPORT_INTD;
-                        break;
-        }
+	/*
+	 * Level Trigger Mode only. Send the HT EOI message back to the source.
+	 */
+	switch (status) {
+	case 0x1000000:
+		OCD_WRITE(RM9000x2_OCD_HTEOI, HYPERTRANSPORT_INTA);
+		break;
+	case 0x2000000:
+		OCD_WRITE(RM9000x2_OCD_HTEOI, HYPERTRANSPORT_INTB);
+		break;
+	case 0x4000000:
+		OCD_WRITE(RM9000x2_OCD_HTEOI, HYPERTRANSPORT_INTC);
+		break;
+	case 0x8000000:
+		OCD_WRITE(RM9000x2_OCD_HTEOI, HYPERTRANSPORT_INTD);
+		break;
+	case 0x0000001:
+		/* PLX */
+		OCD_WRITE(RM9000x2_OCD_HTEOI, 0x20);
+		OCD_WRITE(IRQ_CLEAR_REG, IRQ_ACK_BITS);
+		break;
+	case 0xf000000:
+		OCD_WRITE(RM9000x2_OCD_HTEOI, HYPERTRANSPORT_INTA);
+		OCD_WRITE(RM9000x2_OCD_HTEOI, HYPERTRANSPORT_INTB);
+		OCD_WRITE(RM9000x2_OCD_HTEOI, HYPERTRANSPORT_INTC);
+		OCD_WRITE(RM9000x2_OCD_HTEOI, HYPERTRANSPORT_INTD);
+		break;
+	}
 #endif /* CONFIG_HT_LEVEL_TRIGGER */
 
-done:
-	if (status != 0x2)
-		/* Not for SMP */
-		do_IRQ(irq, regs);	
+	do_IRQ(irq, regs);
 }
 
+#ifdef CONFIG_KGDB
+extern void init_second_port(void);
+extern void breakpoint(void);
+extern void set_debug_traps(void);
+#endif
+
 /*
  * Initialize the next level interrupt handler
  */
 void __init init_IRQ(void)
 {
-	int	i;
-
-	clear_c0_status(ST0_IM | ST0_BEV);
-	__cli();
+	clear_c0_status(ST0_IM);
 
 	set_except_vector(0, titan_handle_int);
 	init_generic_irq();
+	mips_cpu_irq_init(0);
+	rm7k_cpu_irq_init(8);
+
+#ifdef CONFIG_KGDB
+	/* At this point, initialize the second serial port */
+	init_second_port();
+	printk("Start kgdb ... \n");
+	set_debug_traps();
+	breakpoint();
+#endif
 
-	for (i = 0; i < 13; i++) {
-                irq_desc[i].status      = IRQ_DISABLED;
-                irq_desc[i].action      = 0;
-                irq_desc[i].depth       = 1;
-                irq_desc[i].handler     = &rm9000_hpcdma_irq_type;
-        }
+#ifdef CONFIG_GDB_CONSOLE
+	register_gdb_console();
+#endif
 }
 
+#ifdef CONFIG_KGDB
+/*
+ * The 16550 DUART has two ports, but is allocated one IRQ
+ * for the serial console. Hence, a generic framework for
+ * serial IRQ routing in place. Currently, just calls the
+ * do_IRQ fuction. But, going in the future, need to check
+ * DUART registers for channel A and B, then decide the
+ * appropriate action
+ */
+asmlinkage void yosemite_kgdb_irq(int irq, struct pt_regs *regs)
+{
+	do_IRQ(irq, regs);
+}
+#endif
diff --git a/arch/mips/pmc-sierra/yosemite/prom.c b/arch/mips/pmc-sierra/yosemite/prom.c
index 70f68b7c0..5b4ef33ac 100644
--- a/arch/mips/pmc-sierra/yosemite/prom.c
+++ b/arch/mips/pmc-sierra/yosemite/prom.c
@@ -7,55 +7,44 @@
  * Copyright (C) 2003 PMC-Sierra Inc.
  * Author: Manish Lachwani (lachwani@pmc-sierra.com)
  */
-
+#include <linux/init.h>
 #include <linux/sched.h>
 #include <linux/mm.h>
+#include <linux/delay.h>
+#include <linux/smp.h>
+
 #include <asm/io.h>
 #include <asm/pgtable.h>
 #include <asm/processor.h>
 #include <asm/reboot.h>
 #include <asm/system.h>
-#include <linux/delay.h>
-#include <linux/smp.h>
 #include <asm/bootinfo.h>
+#include <asm/pmon.h>
 
 #include "setup.h"
 
-/* Call Vectors */
-struct callvectors {
-        int     (*open) (char*, int, int);
-        int     (*close) (int);
-        int     (*read) (int, void*, int);
-        int     (*write) (int, void*, int);
-        off_t   (*lseek) (int, off_t, int);
-        int     (*printf) (const char*, ...);
-        void    (*cacheflush) (void);
-        char*   (*gets) (char*);
-};
-
-struct callvectors* debug_vectors;
+struct callvectors *debug_vectors;
 
 extern unsigned long yosemite_base;
 extern unsigned long cpu_clock;
-unsigned char titan_ge_mac_addr_base[6];
 
 const char *get_system_type(void)
 {
-        return "PMC-Sierra Yosemite";
+	return "PMC-Sierra Yosemite";
 }
 
-static void prom_cpu0_exit(void)
+static void prom_cpu0_exit(void *arg)
 {
-	void	*nvram = YOSEMITE_NVRAM_BASE_ADDR;
-	
+	void *nvram = (void *) YOSEMITE_NVRAM_BASE_ADDR;
+
 	/* Ask the NVRAM/RTC/watchdog chip to assert reset in 1/16 second */
-        writeb(0x84, nvram + 0xff7);
+	writeb(0x84, nvram + 0xff7);
 
-        /* wait for the watchdog to go off */
-        mdelay(100+(1000/16));
+	/* wait for the watchdog to go off */
+	mdelay(100 + (1000 / 16));
 
-        /* if the watchdog fails for some reason, let people know */
-        printk(KERN_NOTICE "Watchdog reset failed\n");
+	/* if the watchdog fails for some reason, let people know */
+	printk(KERN_NOTICE "Watchdog reset failed\n");
 }
 
 /*
@@ -68,78 +57,73 @@ static void prom_exit(void)
 		/* CPU 1 */
 		smp_call_function(prom_cpu0_exit, NULL, 1, 1);
 #endif
-	prom_cpu0_exit;
-}
-
-/*
- * Get the MAC address from the EEPROM using the I2C protocol
- */
-void get_mac_address(char dest[6])
-{
-	/* Use the I2C command code in the i2c-yosemite */
+	prom_cpu0_exit(NULL);
 }
 
 /*
- * Halt the system 
+ * Halt the system
  */
 static void prom_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");
+		__asm__(".set\tmips3\n\t" "wait\n\t" ".set\tmips0");
 }
 
 /*
  * Init routine which accepts the variables from PMON
  */
-__init prom_init(int argc, char **arg, char **env, struct callvectors *cv)
+void __init prom_init(void)
 {
-	int	i = 0;
+	int argc = fw_arg0;
+	char **arg = (char **) fw_arg1;
+	char **env = (char **) fw_arg2;
+	struct callvectors *cv = (struct callvectors *) fw_arg3;
+	int i = 0;
 
 	/* Callbacks for halt, restart */
-	_machine_restart = (void (*)(char *))prom_exit;	
+	_machine_restart = (void (*)(char *)) prom_exit;
 	_machine_halt = prom_halt;
 	_machine_power_off = prom_halt;
 
-#ifdef CONFIG_MIPS64
-
-	/* Do nothing for the 64-bit for now. Just implement for the 32-bit */
-
-#else /* CONFIG_MIPS64 */
+#ifdef CONFIG_MIPS32
 
 	debug_vectors = cv;
 	arcs_cmdline[0] = '\0';
 
 	/* Get the boot parameters */
 	for (i = 1; i < argc; i++) {
-                if (strlen(arcs_cmdline) + strlen(arg[i] + 1) >= sizeof(arcs_cmdline))
-                        break;
+		if (strlen(arcs_cmdline) + strlen(arg[i] + 1) >=
+		    sizeof(arcs_cmdline))
+			break;
 
 		strcat(arcs_cmdline, arg[i]);
 		strcat(arcs_cmdline, " ");
 	}
 
 	while (*env) {
-		if (strncmp("ocd_base", *env, strlen("ocd_base")) == 0) 
-			yosemite_base = simple_strtol(*env + strlen("ocd_base="),
-							NULL, 16);
-
-		if (strncmp("cpuclock", *env, strlen("cpuclock")) == 0) 
-			cpu_clock = simple_strtol(*env + strlen("cpuclock="),
-							NULL, 10);
-		
+		if (strncmp("ocd_base", *env, strlen("ocd_base")) == 0)
+			yosemite_base =
+			    simple_strtol(*env + strlen("ocd_base="), NULL,
+					  16);
+
+		if (strncmp("cpuclock", *env, strlen("cpuclock")) == 0)
+			cpu_clock =
+			    simple_strtol(*env + strlen("cpuclock="), NULL,
+					  10);
+
 		env++;
 	}
+#endif /* CONFIG_MIPS32 */
+
+#ifdef CONFIG_MIPS64
+
+	/* Do nothing for the 64-bit for now. Just implement for the 32-bit */
+
 #endif /* CONFIG_MIPS64 */
 
 	mips_machgroup = MACH_GROUP_TITAN;
 	mips_machtype = MACH_TITAN_YOSEMITE;
-
-	get_mac_address(titan_ge_mac_addr_base);
-
-	debug_vectors->printf("Booting Linux kernel...\n");
 }
 
 void __init prom_free_prom_memory(void)
@@ -149,41 +133,3 @@ void __init prom_free_prom_memory(void)
 void __init prom_fixup_mem_map(unsigned long start, unsigned long end)
 {
 }
-
-extern void asmlinkage smp_bootstrap(void);
-
-/*
- * SMP support
- */
-int prom_setup_smp(void)
-{
-        int     num_cpus = 2;
-
-        /*
-         * We know that the RM9000 on the Jaguar ATX board has 2 cores. Hence, this
-         * can be hardcoded for now.
-         */
-        return num_cpus;
-}
-
-int prom_boot_secondary(int cpu, unsigned long sp, unsigned long gp)
-{
-        /* Clear the semaphore */
-        *(volatile uint32_t *)(0xbb000a68) = 0x80000000;
-
-        return 1;
-}
-
-void prom_init_secondary(void)
-{
-        clear_c0_config(CONF_CM_CMASK);
-        set_c0_config(0x2);
-
-        clear_c0_status(ST0_IM);
-        set_c0_status(0x1ffff);
-}
-
-void prom_smp_finish(void)
-{
-}
-	
diff --git a/arch/mips/pmc-sierra/yosemite/setup.c b/arch/mips/pmc-sierra/yosemite/setup.c
index 43795a841..dfa9cd0ed 100644
--- a/arch/mips/pmc-sierra/yosemite/setup.c
+++ b/arch/mips/pmc-sierra/yosemite/setup.c
@@ -1,6 +1,4 @@
 /*
- *  arch/mips/pmc-sierra/yosemite/setup.c
- *
  *  Copyright (C) 2003 PMC-Sierra Inc.
  *  Author: Manish Lachwani (lachwani@pmc-sierra.com)
  *
@@ -24,19 +22,18 @@
  *  with this program; if not, write  to the Free Software Foundation, Inc.,
  *  675 Mass Ave, Cambridge, MA 02139, USA.
  */
-
+#include <linux/bcd.h>
 #include <linux/init.h>
 #include <linux/kernel.h>
 #include <linux/types.h>
-#include <linux/mc146818rtc.h>
 #include <linux/mm.h>
+#include <linux/bootmem.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>
@@ -46,36 +43,46 @@
 #include <asm/processor.h>
 #include <asm/ptrace.h>
 #include <asm/reboot.h>
-#include <linux/version.h>
-#include <linux/bootmem.h>
-#include <linux/blk.h>
+#include <asm/pci_channel.h>
+#include <asm/serial.h>
+#include <linux/termios.h>
+#include <linux/tty.h>
+#include <linux/serial.h>
+#include <linux/serial_core.h>
+#include <asm/titan_dep.h>
 
 #include "setup.h"
 
+unsigned char titan_ge_mac_addr_base[6] = {
+	0x00, 0x03, 0xcc, 0x1d, 0x22, 0x00
+};
+
 unsigned long cpu_clock;
 unsigned long yosemite_base;
 
-void __init bus_error_init(void) 
-{ 
-	/* Do nothing */ 
+void __init bus_error_init(void)
+{
+	/* Do nothing */
 }
 
 unsigned long m48t37y_get_time(void)
 {
-	unsigned char	*rtc_base = YOSEMITE_RTC_BASE;
-	unsigned int	year, month, day, hour, min, sec;
+	//unsigned char *rtc_base = (unsigned char *) YOSEMITE_RTC_BASE;
+	unsigned char *rtc_base = (unsigned char *) 0xfc000000UL;
+	unsigned int year, month, day, hour, min, sec;
+return;
 
 	/* Stop the update to the time */
 	rtc_base[0x7ff8] = 0x40;
 
-	year = CONV_BCD_TO_BIN(rtc_base[0x7fff]);
-	year += CONV_BCD_TO_BIN(rtc_base[0x7fff1]) * 100;
+	year = BCD2BIN(rtc_base[0x7fff]);
+	year += BCD2BIN(rtc_base[0x7fff1]) * 100;
 
-	month = CONV_BCD_TO_BIN(rtc_base[0x7ffe]);
-	day = CONV_BCD_TO_BIN(rtc_base[0x7ffd]);
-	hour = CONV_BCD_TO_BIN(rtc_base[0x7ffb]);
-	min = CONV_BCD_TO_BIN(rtc_base[0x7ffa]);
-	sec = CONV_BCD_TO_BIN(rtc_base[0x7ff9]);
+	month = BCD2BIN(rtc_base[0x7ffe]);
+	day = BCD2BIN(rtc_base[0x7ffd]);
+	hour = BCD2BIN(rtc_base[0x7ffb]);
+	min = BCD2BIN(rtc_base[0x7ffa]);
+	sec = BCD2BIN(rtc_base[0x7ff9]);
 
 	/* Start the update to the time again */
 	rtc_base[0x7ff8] = 0x00;
@@ -85,83 +92,119 @@ unsigned long m48t37y_get_time(void)
 
 int m48t37y_set_time(unsigned long sec)
 {
-	unsigned char   *rtc_base = YOSEMITE_RTC_BASE;
-        unsigned int    year, month, day, hour, min, sec;
-
-        struct rtc_time tm;
+	unsigned char *rtc_base = (unsigned char *) YOSEMITE_RTC_BASE;
+	struct rtc_time tm;
+return;
 
-        /* convert to a more useful format -- note months count from 0 */
-        to_tm(sec, &tm);
-        tm.tm_mon += 1;
+	/* convert to a more useful format -- note months count from 0 */
+	to_tm(sec, &tm);
+	tm.tm_mon += 1;
 
-        /* enable writing */
-        rtc_base[0x7ff8] = 0x80;
+	/* enable writing */
+	rtc_base[0x7ff8] = 0x80;
 
-        /* year */
-        rtc_base[0x7fff] = CONV_BIN_TO_BCD(tm.tm_year % 100);
-        rtc_base[0x7ff1] = CONV_BIN_TO_BCD(tm.tm_year / 100);
+	/* year */
+	rtc_base[0x7fff] = BIN2BCD(tm.tm_year % 100);
+	rtc_base[0x7ff1] = BIN2BCD(tm.tm_year / 100);
 
-        /* month */
-        rtc_base[0x7ffe] = CONV_BIN_TO_BCD(tm.tm_mon);
+	/* month */
+	rtc_base[0x7ffe] = BIN2BCD(tm.tm_mon);
 
-        /* day */
-        rtc_base[0x7ffd] = CONV_BIN_TO_BCD(tm.tm_mday);
+	/* day */
+	rtc_base[0x7ffd] = BIN2BCD(tm.tm_mday);
 
-        /* hour/min/sec */
-        rtc_base[0x7ffb] = CONV_BIN_TO_BCD(tm.tm_hour);
-        rtc_base[0x7ffa] = CONV_BIN_TO_BCD(tm.tm_min);
-        rtc_base[0x7ff9] = CONV_BIN_TO_BCD(tm.tm_sec);
+	/* hour/min/sec */
+	rtc_base[0x7ffb] = BIN2BCD(tm.tm_hour);
+	rtc_base[0x7ffa] = BIN2BCD(tm.tm_min);
+	rtc_base[0x7ff9] = BIN2BCD(tm.tm_sec);
 
-        /* day of week -- not really used, but let's keep it up-to-date */
-        rtc_base[0x7ffc] = CONV_BIN_TO_BCD(tm.tm_wday + 1);
+	/* day of week -- not really used, but let's keep it up-to-date */
+	rtc_base[0x7ffc] = BIN2BCD(tm.tm_wday + 1);
 
-        /* disable writing */
-        rtc_base[0x7ff8] = 0x00;
+	/* disable writing */
+	rtc_base[0x7ff8] = 0x00;
 
-        return 0;
+	return 0;
 }
 
 void yosemite_timer_setup(struct irqaction *irq)
 {
-	setup_irq(6, irq);
+	setup_irq(7, irq);
 }
 
 void yosemite_time_init(void)
 {
-	mips_counter_frequency = cpu_clock / 2;
 	board_timer_setup = yosemite_timer_setup;
+	mips_hpt_frequency = cpu_clock / 2;
 
 	rtc_get_time = m48t37y_get_time;
 	rtc_set_time = m48t37y_set_time;
 }
 
+unsigned long uart_base = 0xfd000000L;
+
+/* No other usable initialization hook than this ...  */
+extern void (*late_time_init)(void);
+
+unsigned long ocd_base;
+
+EXPORT_SYMBOL(ocd_base);
+
+/*
+ * Common setup before any secondaries are started
+ */
+
+#define TITAN_UART_CLK		3686400
+#define TITAN_SERIAL_BASE_BAUD	(TITAN_UART_CLK / 16)
+#define TITAN_SERIAL_IRQ	4
+#define TITAN_SERIAL_BASE	0xfd000008UL
+
+static void __init py_map_ocd(void)
+{
+        struct uart_port up;
+
+	/*
+	 * Not specifically interrupt stuff but in case of SMP core_send_ipi
+	 * needs this first so I'm mapping it here ...
+	 */
+	ocd_base = (unsigned long) ioremap(OCD_BASE, OCD_SIZE);
+	if (!ocd_base)
+		panic("Mapping OCD failed - game over.  Your score is 0.");
+
+	/*
+	 * Register to interrupt zero because we share the interrupt with
+	 * the serial driver which we don't properly support yet.
+	 */
+	memset(&up, 0, sizeof(up));
+	up.membase      = (unsigned char *) ioremap(TITAN_SERIAL_BASE, 8);
+	up.irq          = TITAN_SERIAL_IRQ;
+	up.uartclk      = TITAN_UART_CLK;
+	up.regshift     = 0;
+	up.iotype       = UPIO_MEM;
+	up.flags        = ASYNC_BOOT_AUTOCONF | ASYNC_SKIP_TEST;
+	up.line         = 0;
+
+	if (early_serial_setup(&up))
+		printk(KERN_ERR "Early serial init of port 0 failed\n");
+}
+
 static int __init pmc_yosemite_setup(void)
 {
-	unsigned long	val = 0;
+	extern void pmon_smp_bootstrap(void);
 
-	printk("PMC-Sierra Yosemite Board Setup  \n");
 	board_time_init = yosemite_time_init;
+	late_time_init = py_map_ocd;
 
 	/* Add memory regions */
 	add_memory_region(0x00000000, 0x10000000, BOOT_MEM_RAM);
-	add_memory_region(0x10000000, 0x10000000, BOOT_MEM_RAM);
-
-	/* Setup the HT controller */
-	val = *(volatile uint32_t *)(HYPERTRANSPORT_CONFIG_REG);
-	val |= HYPERTRANSPORT_ENABLE;
-        *(volatile uint32_t *)(HYPERTRANSPORT_CONFIG_REG) = val;
-
-        /* Set the BAR. Shifted mode */
-        *(volatile uint32_t *)(HYPERTRANSPORT_BAR0_REG) = HYPERTRANSPORT_BAR0_ADDR;
-        *(volatile uint32_t *)(HYPERTRANSPORT_SIZE0_REG) = HYPERTRANSPORT_SIZE0;
 
-#ifdef CONFIG_PCI
-	ioport_resource.start = 0xe0000000;
-	ioport_resource.end   = 0xe0000000 + 0x20000000 - 1;
-	iomem_resource.start  = 0xc0000000;
-	iomem_resource.end    = 0xc0000000 + 0x20000000 - 1;
+#if 0 /* XXX Crash ...  */
+	OCD_WRITE(RM9000x2_OCD_HTSC,
+	          OCD_READ(RM9000x2_OCD_HTSC) | HYPERTRANSPORT_ENABLE);
 
-	pci_scan_bus(0, &titan_pci_ops, NULL);
+	/* Set the BAR. Shifted mode */
+	OCD_WRITE(RM9000x2_OCD_HTBAR0, HYPERTRANSPORT_BAR0_ADDR);
+	OCD_WRITE(RM9000x2_OCD_HTMASK0, HYPERTRANSPORT_SIZE0);
 #endif
 
 	return 0;
diff --git a/arch/mips/pmc-sierra/yosemite/setup.h b/arch/mips/pmc-sierra/yosemite/setup.h
index d8193e11b..b3e24b4e6 100644
--- a/arch/mips/pmc-sierra/yosemite/setup.h
+++ b/arch/mips/pmc-sierra/yosemite/setup.h
@@ -9,27 +9,13 @@
  * Free Software Foundation;  either version 2 of the  License, or (at your
  * option) any later version.
  */
-
 #ifndef __SETUP_H__
 #define __SETUP_H__
 
-/* Real Time Clock base */
-#define	YOSEMITE_RTC_BASE
-#define CONV_BCD_TO_BIN(val)    (((val) & 0xf) + (((val) >> 4) * 10))
-#define CONV_BIN_TO_BCD(val)    (((val) % 10) + (((val) / 10) << 4))
-
 /* NVRAM Base */
 #define	YOSEMITE_NVRAM_BASE_ADDR	0xbb000678	/* XXX Need change */
 #define	YOSEMITE_RTC_BASE		0xbb000679	/* XXX Need change */
 
-/*
- * Hypertransport Specific 
- */
-#define HYPERTRANSPORT_CONFIG_REG       0xbb000604
-#define HYPERTRANSPORT_BAR0_REG         0xbb000610
-#define HYPERTRANSPORT_SIZE0_REG        0xbb000688
-#define HYPERTRANSPORT_BAR0_ATTR_REG    0xbb000680
-
 #define HYPERTRANSPORT_BAR0_ADDR        0x00000006
 #define HYPERTRANSPORT_SIZE0            0x0fffffff
 #define HYPERTRANSPORT_BAR0_ATTR        0x00002000
@@ -37,11 +23,9 @@
 #define HYPERTRANSPORT_ENABLE           0x6
 
 /*
- * EEPROM Size 
+ * EEPROM Size
  */
 #define	TITAN_ATMEL_24C32_SIZE		32768
 #define	TITAN_ATMEL_24C64_SIZE		65536
 
-
 #endif /* __SETUP_H__ */
-
diff --git a/arch/mips/ramdisk/Makefile b/arch/mips/ramdisk/Makefile
index 5c7596827..66cce75c5 100644
--- a/arch/mips/ramdisk/Makefile
+++ b/arch/mips/ramdisk/Makefile
@@ -12,7 +12,7 @@ img := $(subst $(src)//,/,$(src)/$(img))
 
 quiet_cmd_ramdisk = LD      $@
 define cmd_ramdisk
-	$(LD) -T $(src)/ld.script -b binary --oformat $(O_FORMAT) -o $@ $(img)
+	$(LD) $(LDFLAGS) -T $(src)/ld.script -b binary --oformat $(O_FORMAT) -o $@ $(img)
 endef
 
 $(obj)/ramdisk.o: $(img) $(src)/ld.script
diff --git a/arch/mips/sgi-ip22/ip22-setup.c b/arch/mips/sgi-ip22/ip22-setup.c
index 352a8495c..fe7f546d3 100644
--- a/arch/mips/sgi-ip22/ip22-setup.c
+++ b/arch/mips/sgi-ip22/ip22-setup.c
@@ -10,6 +10,7 @@
 #include <linux/kernel.h>
 #include <linux/kdev_t.h>
 #include <linux/types.h>
+#include <linux/module.h>
 #include <linux/console.h>
 #include <linux/sched.h>
 #include <linux/tty.h>
@@ -54,6 +55,8 @@ void ip22_do_break(void)
 	ArcEnterInteractiveMode();
 }
 
+EXPORT_SYMBOL(ip22_do_break);
+
 extern void ip22_be_init(void) __init;
 extern void ip22_time_init(void) __init;
 
diff --git a/arch/mips/sgi-ip32/ip32-irq.c b/arch/mips/sgi-ip32/ip32-irq.c
index 5091454ca..75846d6e8 100644
--- a/arch/mips/sgi-ip32/ip32-irq.c
+++ b/arch/mips/sgi-ip32/ip32-irq.c
@@ -123,9 +123,9 @@ extern irqreturn_t crime_cpuerr_intr (int irq, void *dev_id,
 				      struct pt_regs *regs);
 
 struct irqaction memerr_irq = { crime_memerr_intr, SA_INTERRUPT,
-				0, "CRIME memory error", NULL, NULL };
+			CPU_MASK_NONE, "CRIME memory error", NULL, NULL };
 struct irqaction cpuerr_irq = { crime_cpuerr_intr, SA_INTERRUPT,
-				0, "CRIME CPU error", NULL, NULL };
+			CPU_MASK_NONE, "CRIME CPU error", NULL, NULL };
 
 extern void ip32_handle_int(void);
 
diff --git a/arch/mips/sibyte/sb1250/irq.c b/arch/mips/sibyte/sb1250/irq.c
index e2216ee9b..ddbe64b2d 100644
--- a/arch/mips/sibyte/sb1250/irq.c
+++ b/arch/mips/sibyte/sb1250/irq.c
@@ -279,7 +279,7 @@ static irqreturn_t  sb1250_dummy_handler(int irq, void *dev_id,
 static struct irqaction sb1250_dummy_action = {
 	.handler = sb1250_dummy_handler,
 	.flags   = 0,
-	.mask    = 0,
+	.mask    = CPU_MASK_NONE,
 	.name    = "sb1250-private",
 	.next    = NULL,
 	.dev_id  = 0
diff --git a/arch/mips/sibyte/sb1250/irq_handler.S b/arch/mips/sibyte/sb1250/irq_handler.S
index 08c6070c5..ad6c6b055 100644
--- a/arch/mips/sibyte/sb1250/irq_handler.S
+++ b/arch/mips/sibyte/sb1250/irq_handler.S
@@ -123,7 +123,7 @@
 	 * check the 1250 interrupt registers to figure out what to do
 	 * Need to detect which CPU we're on, now that smp_affinity is supported.
 	 */
-	la	v0, KSEG1 + A_IMR_CPU0_BASE
+	PTR_LA	v0, KSEG1 + A_IMR_CPU0_BASE
 #ifdef CONFIG_SMP
 	lw	t1, TI_CPU($28)
 	sll	t1, IMR_REGISTER_SPACING_SHIFT
diff --git a/arch/mips/tx4927/common/tx4927_irq.c b/arch/mips/tx4927/common/tx4927_irq.c
index 14591d16e..bf59409ee 100644
--- a/arch/mips/tx4927/common/tx4927_irq.c
+++ b/arch/mips/tx4927/common/tx4927_irq.c
@@ -172,7 +172,7 @@ static struct hw_interrupt_type tx4927_irq_pic_type = {
 	.set_affinity	= NULL
 };
 
-#define TX4927_PIC_ACTION(s) { no_action, 0, 0, s, NULL, NULL }
+#define TX4927_PIC_ACTION(s) { no_action, 0, CPU_MASK_NONE, s, NULL, NULL }
 static struct irqaction tx4927_irq_pic_action =
 TX4927_PIC_ACTION(TX4927_PIC_NAME);
 
diff --git a/arch/mips/tx4927/toshiba_rbtx4927/toshiba_rbtx4927_irq.c b/arch/mips/tx4927/toshiba_rbtx4927/toshiba_rbtx4927_irq.c
index f4fe81eb7..930304585 100644
--- a/arch/mips/tx4927/toshiba_rbtx4927/toshiba_rbtx4927_irq.c
+++ b/arch/mips/tx4927/toshiba_rbtx4927/toshiba_rbtx4927_irq.c
@@ -337,8 +337,8 @@ int toshiba_rbtx4927_irq_nested(int sw_irq)
 	return (sw_irq);
 }
 
-//#define TOSHIBA_RBTX4927_PIC_ACTION(s) { no_action, 0, 0, s, NULL, NULL }
-#define TOSHIBA_RBTX4927_PIC_ACTION(s) { no_action, SA_SHIRQ, 0, s, NULL, NULL }
+//#define TOSHIBA_RBTX4927_PIC_ACTION(s) { no_action, 0, CPU_MASK_NONE, s, NULL, NULL }
+#define TOSHIBA_RBTX4927_PIC_ACTION(s) { no_action, SA_SHIRQ, CPU_MASK_NONE, s, NULL, NULL }
 static struct irqaction toshiba_rbtx4927_irq_ioc_action =
 TOSHIBA_RBTX4927_PIC_ACTION(TOSHIBA_RBTX4927_IOC_NAME);
 #ifdef CONFIG_TOSHIBA_FPCIB0
diff --git a/arch/mips/vr4181/common/irq.c b/arch/mips/vr4181/common/irq.c
index 7b5a1a4f3..4a2458f8b 100644
--- a/arch/mips/vr4181/common/irq.c
+++ b/arch/mips/vr4181/common/irq.c
@@ -180,9 +180,9 @@ extern int setup_irq(unsigned int irq, struct irqaction *irqaction);
 extern void mips_cpu_irq_init(u32 irq_base);
 
 static struct irqaction cascade =
-	{ no_action, SA_INTERRUPT, 0, "cascade", NULL, NULL };
+	{ no_action, SA_INTERRUPT, CPU_MASK_NONE, "cascade", NULL, NULL };
 static struct irqaction reserved =
-	{ no_action, SA_INTERRUPT, 0, "cascade", NULL, NULL };
+	{ no_action, SA_INTERRUPT, CPU_MASK_NONE, "cascade", NULL, NULL };
 
 void __init init_IRQ(void)
 {
diff --git a/arch/mips/vr41xx/common/bcu.c b/arch/mips/vr41xx/common/bcu.c
index 2601296e2..3613999a1 100644
--- a/arch/mips/vr41xx/common/bcu.c
+++ b/arch/mips/vr41xx/common/bcu.c
@@ -1,34 +1,23 @@
 /*
- * FILE NAME
- *	arch/mips/vr41xx/common/bcu.c
+ *  bcu.c, Bus Control Unit routines for the NEC VR4100 series.
  *
- * BRIEF MODULE DESCRIPTION
- *	Bus Control Unit routines for the NEC VR4100 series.
+ *  Copyright (C) 2002  MontaVista Software Inc.
+ *    Author: Yoichi Yuasa <yyuasa@mvista.com, or source@mvista.com>
+ *  Copyright (C) 2003-2004  Yoichi Yuasa <yuasa@hh.iij4u.or.jp>
  *
- * Author: Yoichi Yuasa
- *         yyuasa@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.
  *
- * Copyright 2002 MontaVista Software Inc.
+ *  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.
  *
- *  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.
+ *  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
  */
 /*
  * Changes:
@@ -40,12 +29,16 @@
  *  - Added support for NEC VR4133.
  */
 #include <linux/init.h>
+#include <linux/ioport.h>
 #include <linux/smp.h>
 #include <linux/types.h>
 
 #include <asm/cpu.h>
 #include <asm/io.h>
 
+#define IO_MEM_RESOURCE_START	0UL
+#define IO_MEM_RESOURCE_END	0x1fffffffUL
+
 #define CLKSPEEDREG_TYPE1	KSEG1ADDR(0x0b000014)
 #define CLKSPEEDREG_TYPE2	KSEG1ADDR(0x0f000014)
  #define CLKSP(x)		((x) & 0x001f)
@@ -213,7 +206,7 @@ static inline unsigned long calculate_tclock(uint16_t clkspeed, unsigned long pc
 	return tclock;
 }
 
-void __init vr41xx_bcu_init(void)
+static int __init vr41xx_bcu_init(void)
 {
 	unsigned long pclock;
 	uint16_t clkspeed;
@@ -223,4 +216,11 @@ void __init vr41xx_bcu_init(void)
 	pclock = calculate_pclock(clkspeed);
 	vr41xx_vtclock = calculate_vtclock(clkspeed, pclock);
 	vr41xx_tclock = calculate_tclock(clkspeed, pclock, vr41xx_vtclock);
+
+	iomem_resource.start = IO_MEM_RESOURCE_START;
+	iomem_resource.end = IO_MEM_RESOURCE_END;
+
+	return 0;
 }
+
+early_initcall(vr41xx_bcu_init);
diff --git a/arch/mips/vr41xx/common/cmu.c b/arch/mips/vr41xx/common/cmu.c
index f3665b404..fd33d005f 100644
--- a/arch/mips/vr41xx/common/cmu.c
+++ b/arch/mips/vr41xx/common/cmu.c
@@ -200,7 +200,7 @@ void vr41xx_mask_clock(vr41xx_clock_t clock)
 	spin_unlock_irq(&cmu_lock);
 }
 
-void __init vr41xx_cmu_init(void)
+static int __init vr41xx_cmu_init(void)
 {
 	switch (current_cpu_data.cputype) {
         case CPU_VR4111:
@@ -223,4 +223,8 @@ void __init vr41xx_cmu_init(void)
 	cmuclkmsk = read_cmuclkmsk();
 
 	spin_lock_init(&cmu_lock);
+
+	return 0;
 }
+
+early_initcall(vr41xx_cmu_init);
diff --git a/arch/mips/vr41xx/common/giu.c b/arch/mips/vr41xx/common/giu.c
index 6fe6a73ff..bd2978fd5 100644
--- a/arch/mips/vr41xx/common/giu.c
+++ b/arch/mips/vr41xx/common/giu.c
@@ -28,10 +28,12 @@
  *  - Added support for NEC VR4133.
  *  - Removed board_irq_init.
  */
+#include <linux/config.h>
 #include <linux/errno.h>
 #include <linux/init.h>
 #include <linux/irq.h>
 #include <linux/kernel.h>
+#include <linux/module.h>
 #include <linux/smp.h>
 #include <linux/types.h>
 
@@ -64,6 +66,8 @@ static uint32_t giu_base;
 #define read_giuint(offset)		readw(giu_base + (offset))
 #define write_giuint(val, offset)	writew((val), giu_base + (offset))
 
+#define GIUINT_HIGH_OFFSET	16
+
 static inline uint16_t set_giuint(uint8_t offset, uint16_t set)
 {
 	uint16_t res;
@@ -86,35 +90,121 @@ static inline uint16_t clear_giuint(uint8_t offset, uint16_t clear)
 	return res;
 }
 
-void vr41xx_enable_giuint(int pin)
+static unsigned int startup_giuint_low_irq(unsigned int irq)
 {
-	if (pin < 16)
-		set_giuint(GIUINTENL, (uint16_t)1 << pin);
-	else
-		set_giuint(GIUINTENH, (uint16_t)1 << (pin - 16));
+	unsigned int pin;
+
+	pin = GIU_IRQ_TO_PIN(irq);
+	write_giuint((uint16_t)1 << pin, GIUINTSTATL);
+	set_giuint(GIUINTENL, (uint16_t)1 << pin);
+
+	return 0;
 }
 
-void vr41xx_disable_giuint(int pin)
+static void shutdown_giuint_low_irq(unsigned int irq)
 {
-	if (pin < 16)
-		clear_giuint(GIUINTENL, (uint16_t)1 << pin);
-	else
-		clear_giuint(GIUINTENH, (uint16_t)1 << (pin - 16));
+	clear_giuint(GIUINTENL, (uint16_t)1 << GIU_IRQ_TO_PIN(irq));
 }
 
-void vr41xx_clear_giuint(int pin)
+static void enable_giuint_low_irq(unsigned int irq)
 {
-	if (pin < 16)
-		write_giuint((uint16_t)1 << pin, GIUINTSTATL);
-	else
-		write_giuint((uint16_t)1 << (pin - 16), GIUINTSTATH);
+	set_giuint(GIUINTENL, (uint16_t)1 << GIU_IRQ_TO_PIN(irq));
+}
+
+#define disable_giuint_low_irq	shutdown_giuint_low_irq
+
+static void ack_giuint_low_irq(unsigned int irq)
+{
+	unsigned int pin;
+
+	pin = GIU_IRQ_TO_PIN(irq);
+	clear_giuint(GIUINTENL, (uint16_t)1 << pin);
+	write_giuint((uint16_t)1 << pin, GIUINTSTATL);
+}
+
+static void end_giuint_low_irq(unsigned int irq)
+{
+	if (!(irq_desc[irq].status & (IRQ_DISABLED | IRQ_INPROGRESS)))
+		set_giuint(GIUINTENL, (uint16_t)1 << GIU_IRQ_TO_PIN(irq));
+}
+
+static struct hw_interrupt_type giuint_low_irq_type = {
+	.typename	= "GIUINTL",
+	.startup	= startup_giuint_low_irq,
+	.shutdown	= shutdown_giuint_low_irq,
+	.enable		= enable_giuint_low_irq,
+	.disable	= disable_giuint_low_irq,
+	.ack		= ack_giuint_low_irq,
+	.end		= end_giuint_low_irq,
+};
+
+static unsigned int startup_giuint_high_irq(unsigned int irq)
+{
+	unsigned int pin;
+
+	pin = GIU_IRQ_TO_PIN(irq - GIUINT_HIGH_OFFSET);
+	write_giuint((uint16_t)1 << pin, GIUINTSTATH);
+	set_giuint(GIUINTENH, (uint16_t)1 << pin);
+
+	return 0;
+}
+
+static void shutdown_giuint_high_irq(unsigned int irq)
+{
+	clear_giuint(GIUINTENH, (uint16_t)1 << GIU_IRQ_TO_PIN(irq - GIUINT_HIGH_OFFSET));
+}
+
+static void enable_giuint_high_irq(unsigned int irq)
+{
+	set_giuint(GIUINTENH, (uint16_t)1 << GIU_IRQ_TO_PIN(irq - GIUINT_HIGH_OFFSET));
+}
+
+#define disable_giuint_high_irq	shutdown_giuint_high_irq
+
+static void ack_giuint_high_irq(unsigned int irq)
+{
+	unsigned int pin;
+
+	pin = GIU_IRQ_TO_PIN(irq - GIUINT_HIGH_OFFSET);
+	clear_giuint(GIUINTENH, (uint16_t)1 << pin);
+	write_giuint((uint16_t)1 << pin, GIUINTSTATH);
+}
+
+static void end_giuint_high_irq(unsigned int irq)
+{
+	if (!(irq_desc[irq].status & (IRQ_DISABLED | IRQ_INPROGRESS)))
+		set_giuint(GIUINTENH, (uint16_t)1 << GIU_IRQ_TO_PIN(irq - GIUINT_HIGH_OFFSET));
+}
+
+static struct hw_interrupt_type giuint_high_irq_type = {
+	.typename	= "GIUINTH",
+	.startup	= startup_giuint_high_irq,
+	.shutdown	= shutdown_giuint_high_irq,
+	.enable		= enable_giuint_high_irq,
+	.disable	= disable_giuint_high_irq,
+	.ack		= ack_giuint_high_irq,
+	.end		= end_giuint_high_irq,
+};
+
+void __init init_vr41xx_giuint_irq(void)
+{
+	int i;
+
+	for (i = GIU_IRQ_BASE; i <= GIU_IRQ_LAST; i++) {
+		if (i < (GIU_IRQ_BASE + GIUINT_HIGH_OFFSET))
+			irq_desc[i].handler = &giuint_low_irq_type;
+		else
+			irq_desc[i].handler = &giuint_high_irq_type;
+	}
+
+	setup_irq(GIUINT_CASCADE_IRQ, &giu_cascade);
 }
 
 void vr41xx_set_irq_trigger(int pin, int trigger, int hold)
 {
 	uint16_t mask;
 
-	if (pin < 16) {
+	if (pin < GIUINT_HIGH_OFFSET) {
 		mask = (uint16_t)1 << pin;
 		if (trigger != TRIGGER_LEVEL) {
         		set_giuint(GIUINTTYPL, mask);
@@ -142,8 +232,9 @@ void vr41xx_set_irq_trigger(int pin, int trigger, int hold)
 			clear_giuint(GIUINTTYPL, mask);
 			clear_giuint(GIUINTHTSELL, mask);
 		}
+		write_giuint(mask, GIUINTSTATL);
 	} else {
-		mask = (uint16_t)1 << (pin - 16);
+		mask = (uint16_t)1 << (pin - GIUINT_HIGH_OFFSET);
 		if (trigger != TRIGGER_LEVEL) {
 			set_giuint(GIUINTTYPH, mask);
 			if (hold == SIGNAL_HOLD)
@@ -170,32 +261,35 @@ void vr41xx_set_irq_trigger(int pin, int trigger, int hold)
 			clear_giuint(GIUINTTYPH, mask);
 			clear_giuint(GIUINTHTSELH, mask);
 		}
+		write_giuint(mask, GIUINTSTATH);
 	}
-
-	vr41xx_clear_giuint(pin);
 }
 
+EXPORT_SYMBOL(vr41xx_set_irq_trigger);
+
 void vr41xx_set_irq_level(int pin, int level)
 {
 	uint16_t mask;
 
-	if (pin < 16) {
+	if (pin < GIUINT_HIGH_OFFSET) {
 		mask = (uint16_t)1 << pin;
 		if (level == LEVEL_HIGH)
 			set_giuint(GIUINTALSELL, mask);
 		else
 			clear_giuint(GIUINTALSELL, mask);
+		write_giuint(mask, GIUINTSTATL);
 	} else {
-		mask = (uint16_t)1 << (pin - 16);
+		mask = (uint16_t)1 << (pin - GIUINT_HIGH_OFFSET);
 		if (level == LEVEL_HIGH)
 			set_giuint(GIUINTALSELH, mask);
 		else
 			clear_giuint(GIUINTALSELH, mask);
+		write_giuint(mask, GIUINTSTATH);
 	}
-
-	vr41xx_clear_giuint(pin);
 }
 
+EXPORT_SYMBOL(vr41xx_set_irq_level);
+
 #define GIUINT_NR_IRQS		32
 
 enum {
@@ -209,7 +303,7 @@ struct vr41xx_giuint_cascade {
 };
 
 static struct vr41xx_giuint_cascade giuint_cascade[GIUINT_NR_IRQS];
-static struct irqaction giu_cascade = {no_action, 0, 0, "cascade", NULL, NULL};
+static struct irqaction giu_cascade = {no_action, 0, CPU_MASK_NONE, "cascade", NULL, NULL};
 
 static int no_irq_number(int irq)
 {
@@ -232,7 +326,7 @@ int vr41xx_cascade_irq(unsigned int irq, int (*get_irq_number)(int irq))
 	giuint_cascade[pin].get_irq_number = get_irq_number;
 
 	retval = setup_irq(irq, &giu_cascade);
-	if (retval) {
+	if (retval != 0) {
 		giuint_cascade[pin].flag = GIUINT_NO_CASCADE;
 		giuint_cascade[pin].get_irq_number = no_irq_number;
 	}
@@ -240,29 +334,89 @@ int vr41xx_cascade_irq(unsigned int irq, int (*get_irq_number)(int irq))
 	return retval;
 }
 
-unsigned int giuint_do_IRQ(int pin, struct pt_regs *regs)
+EXPORT_SYMBOL(vr41xx_cascade_irq);
+
+static inline int get_irq_pin_number(void)
+{
+	uint16_t pendl, pendh, maskl, maskh;
+	int i;
+
+	pendl = read_giuint(GIUINTSTATL);
+	pendh = read_giuint(GIUINTSTATH);
+	maskl = read_giuint(GIUINTENL);
+	maskh = read_giuint(GIUINTENH);
+
+	maskl &= pendl;
+	maskh &= pendh;
+
+	if (maskl) {
+		for (i = 0; i < 16; i++) {
+			if (maskl & ((uint16_t)1 << i))
+				return i;
+		}
+	} else if (maskh) {
+		for (i = 0; i < 16; i++) {
+			if (maskh & ((uint16_t)1 << i))
+				return i + GIUINT_HIGH_OFFSET;
+		}
+	}
+
+	printk(KERN_ERR "spurious GIU interrupt: %04x(%04x),%04x(%04x)\n",
+	       maskl, pendl, maskh, pendh);
+
+	atomic_inc(&irq_err_count);
+
+	return -1;
+}
+
+static inline void ack_giuint_irq(int pin)
+{
+	if (pin < GIUINT_HIGH_OFFSET) {
+		clear_giuint(GIUINTENL, (uint16_t)1 << pin);
+		write_giuint((uint16_t)1 << pin, GIUINTSTATL);
+	} else {
+		pin -= GIUINT_HIGH_OFFSET;
+		clear_giuint(GIUINTENH, (uint16_t)1 << pin);
+		write_giuint((uint16_t)1 << pin, GIUINTSTATH);
+	}
+}
+
+static inline void end_giuint_irq(int pin)
+{
+	if (pin < GIUINT_HIGH_OFFSET)
+		set_giuint(GIUINTENL, (uint16_t)1 << pin);
+	else
+		set_giuint(GIUINTENH, (uint16_t)1 << (pin - GIUINT_HIGH_OFFSET));
+}
+
+void giuint_irq_dispatch(struct pt_regs *regs)
 {
 	struct vr41xx_giuint_cascade *cascade;
-	unsigned int retval = 0;
-	int giuint_irq, cascade_irq;
+	unsigned int giuint_irq;
+	int pin;
+
+	pin = get_irq_pin_number();
+	if (pin < 0)
+		return;
 
 	disable_irq(GIUINT_CASCADE_IRQ);
+
 	cascade = &giuint_cascade[pin];
 	giuint_irq = GIU_IRQ(pin);
 	if (cascade->flag == GIUINT_CASCADE) {
-		cascade_irq = cascade->get_irq_number(giuint_irq);
-		disable_irq(giuint_irq);
-		if (cascade_irq > 0)
-			retval = do_IRQ(cascade_irq, regs);
-		enable_irq(giuint_irq);
-	} else
-		retval = do_IRQ(giuint_irq, regs);
-	enable_irq(GIUINT_CASCADE_IRQ);
+		int irq = cascade->get_irq_number(giuint_irq);
+		ack_giuint_irq(pin);
+		if (irq >= 0)
+			do_IRQ(irq, regs);
+		end_giuint_irq(pin);
+	} else {
+		do_IRQ(giuint_irq, regs);
+	}
 
-	return retval;
+	enable_irq(GIUINT_CASCADE_IRQ);
 }
 
-void __init vr41xx_giuint_init(void)
+static int __init vr41xx_giu_init(void)
 {
 	int i;
 
@@ -277,16 +431,20 @@ void __init vr41xx_giuint_init(void)
 		giu_base = GIUIOSELL_TYPE2;
 		break;
 	default:
-		panic("GIU: Unexpected CPU of NEC VR4100 series");
-		break;
+		printk(KERN_ERR "GIU: Unexpected CPU of NEC VR4100 series\n");
+		return -EINVAL;
 	}
 
 	for (i = 0; i < GIUINT_NR_IRQS; i++) {
-                vr41xx_disable_giuint(i);
+		if (i < GIUINT_HIGH_OFFSET)
+			clear_giuint(GIUINTENL, (uint16_t)1 << i);
+		else
+			clear_giuint(GIUINTENH, (uint16_t)1 << (i - GIUINT_HIGH_OFFSET));
 		giuint_cascade[i].flag = GIUINT_NO_CASCADE;
 		giuint_cascade[i].get_irq_number = no_irq_number;
 	}
 
-	if (setup_irq(GIUINT_CASCADE_IRQ, &giu_cascade))
-		printk("GIUINT: Can not cascade IRQ %d.\n", GIUINT_CASCADE_IRQ);
+	return 0;
 }
+
+early_initcall(vr41xx_giu_init);
diff --git a/arch/mips/vr41xx/common/icu.c b/arch/mips/vr41xx/common/icu.c
index bd67058e4..4fd195bc9 100644
--- a/arch/mips/vr41xx/common/icu.c
+++ b/arch/mips/vr41xx/common/icu.c
@@ -28,10 +28,12 @@
  *  Yoichi Yuasa <yuasa@hh.iij4u.or.jp>
  *  - Coped with INTASSIGN of NEC VR4133.
  */
+#include <linux/config.h>
 #include <linux/errno.h>
 #include <linux/init.h>
 #include <linux/interrupt.h>
 #include <linux/irq.h>
+#include <linux/module.h>
 #include <linux/smp.h>
 #include <linux/types.h>
 
@@ -43,11 +45,8 @@
 
 extern asmlinkage void vr41xx_handle_interrupt(void);
 
-extern void vr41xx_giuint_init(void);
-extern void vr41xx_enable_giuint(int pin);
-extern void vr41xx_disable_giuint(int pin);
-extern void vr41xx_clear_giuint(int pin);
-extern unsigned int giuint_do_IRQ(int pin, struct pt_regs *regs);
+extern void init_vr41xx_giuint_irq(void);
+extern void giuint_irq_dispatch(struct pt_regs *regs);
 
 static uint32_t icu1_base;
 static uint32_t icu2_base;
@@ -64,11 +63,17 @@ static unsigned char sysint2_assign[16] = {
 #define SYSINT2REG_TYPE2	KSEG1ADDR(0x0f0000a0)
 
 #define SYSINT1REG	0x00
+#define PIUINTREG	0x02
 #define INTASSIGN0	0x04
 #define INTASSIGN1	0x06
 #define GIUINTLREG	0x08
+#define DSIUINTREG	0x0a
 #define MSYSINT1REG	0x0c
+#define MPIUINTREG	0x0e
+#define MAIUINTREG	0x10
+#define MKIUINTREG	0x12
 #define MGIUINTLREG	0x14
+#define MDSIUINTREG	0x16
 #define NMIREG		0x18
 #define SOFTREG		0x1a
 #define INTASSIGN2	0x1c
@@ -76,11 +81,21 @@ static unsigned char sysint2_assign[16] = {
 
 #define SYSINT2REG	0x00
 #define GIUINTHREG	0x02
+#define FIRINTREG	0x04
 #define MSYSINT2REG	0x06
 #define MGIUINTHREG	0x08
-
-#define MDSIUINTREG	KSEG1ADDR(0x0f000096)
- #define INTDSIU	0x0800
+#define MFIRINTREG	0x0a
+#define PCIINTREG	0x0c
+ #define PCIINT0	0x0001
+#define SCUINTREG	0x0e
+ #define SCUINT0	0x0001
+#define CSIINTREG	0x10
+#define MPCIINTREG	0x12
+#define MSCUINTREG	0x14
+#define MCSIINTREG	0x16
+#define BCUINTREG	0x18
+ #define BCUINTR	0x0001
+#define MBCUINTREG	0x1a
 
 #define SYSINT1_IRQ_TO_PIN(x)	((x) - SYSINT1_IRQ_BASE)	/* Pin 0-15 */
 #define SYSINT2_IRQ_TO_PIN(x)	((x) - SYSINT2_IRQ_BASE)	/* Pin 0-15 */
@@ -140,212 +155,298 @@ static inline uint16_t clear_icu2(uint8_t offset, uint16_t clear)
 
 /*=======================================================================*/
 
-void vr41xx_enable_dsiuint(void)
+void vr41xx_enable_piuint(uint16_t mask)
 {
-	writew(INTDSIU, MDSIUINTREG);
+	irq_desc_t *desc = irq_desc + PIU_IRQ;
+	unsigned long flags;
+	uint16_t val;
+
+	spin_lock_irqsave(&desc->lock, flags);
+	val = read_icu1(MPIUINTREG);
+	val |= mask;
+	write_icu1(val, MPIUINTREG);
+	spin_unlock_irqrestore(&desc->lock, flags);
 }
 
-void vr41xx_disable_dsiuint(void)
+void vr41xx_disable_piuint(uint16_t mask)
 {
-	writew(0, MDSIUINTREG);
+	irq_desc_t *desc = irq_desc + PIU_IRQ;
+	unsigned long flags;
+	uint16_t val;
+
+	spin_lock_irqsave(&desc->lock, flags);
+	val = read_icu1(MPIUINTREG);
+	val &= ~mask;
+	write_icu1(val, MPIUINTREG);
+	spin_unlock_irqrestore(&desc->lock, flags);
 }
 
-/*=======================================================================*/
-
-static void enable_sysint1_irq(unsigned int irq)
+void vr41xx_enable_aiuint(uint16_t mask)
 {
-	set_icu1(MSYSINT1REG, (uint16_t)1 << SYSINT1_IRQ_TO_PIN(irq));
+	irq_desc_t *desc = irq_desc + AIU_IRQ;
+	unsigned long flags;
+	uint16_t val;
+
+	spin_lock_irqsave(&desc->lock, flags);
+	val = read_icu1(MAIUINTREG);
+	val |= mask;
+	write_icu1(val, MAIUINTREG);
+	spin_unlock_irqrestore(&desc->lock, flags);
 }
 
-static void disable_sysint1_irq(unsigned int irq)
+void vr41xx_disable_aiuint(uint16_t mask)
 {
-	clear_icu1(MSYSINT1REG, (uint16_t)1 << SYSINT1_IRQ_TO_PIN(irq));
+	irq_desc_t *desc = irq_desc + AIU_IRQ;
+	unsigned long flags;
+	uint16_t val;
+
+	spin_lock_irqsave(&desc->lock, flags);
+	val = read_icu1(MAIUINTREG);
+	val &= ~mask;
+	write_icu1(val, MAIUINTREG);
+	spin_unlock_irqrestore(&desc->lock, flags);
 }
 
-static unsigned int startup_sysint1_irq(unsigned int irq)
+void vr41xx_enable_kiuint(uint16_t mask)
 {
-	set_icu1(MSYSINT1REG, (uint16_t)1 << SYSINT1_IRQ_TO_PIN(irq));
-
-	return 0; /* never anything pending */
+	irq_desc_t *desc = irq_desc + KIU_IRQ;
+	unsigned long flags;
+	uint16_t val;
+
+	spin_lock_irqsave(&desc->lock, flags);
+	val = read_icu1(MKIUINTREG);
+	val |= mask;
+	write_icu1(val, MKIUINTREG);
+	spin_unlock_irqrestore(&desc->lock, flags);
 }
 
-#define shutdown_sysint1_irq	disable_sysint1_irq
-#define ack_sysint1_irq		disable_sysint1_irq
-
-static void end_sysint1_irq(unsigned int irq)
+void vr41xx_disable_kiuint(uint16_t mask)
 {
-	if (!(irq_desc[irq].status & (IRQ_DISABLED | IRQ_INPROGRESS)))
-		set_icu1(MSYSINT1REG, (uint16_t)1 << SYSINT1_IRQ_TO_PIN(irq));
+	irq_desc_t *desc = irq_desc + KIU_IRQ;
+	unsigned long flags;
+	uint16_t val;
+
+	spin_lock_irqsave(&desc->lock, flags);
+	val = read_icu1(MKIUINTREG);
+	val &= ~mask;
+	write_icu1(val, MKIUINTREG);
+	spin_unlock_irqrestore(&desc->lock, flags);
 }
 
-static struct hw_interrupt_type sysint1_irq_type = {
-	.typename	= "SYSINT1",
-	.startup	= startup_sysint1_irq,
-	.shutdown	= shutdown_sysint1_irq,
-	.enable		= enable_sysint1_irq,
-	.disable	= disable_sysint1_irq,
-	.ack		= ack_sysint1_irq,
-	.end		= end_sysint1_irq,
-};
+void vr41xx_enable_dsiuint(uint16_t mask)
+{
+	irq_desc_t *desc = irq_desc + DSIU_IRQ;
+	unsigned long flags;
+	uint16_t val;
+
+	spin_lock_irqsave(&desc->lock, flags);
+	val = read_icu1(MDSIUINTREG);
+	val |= mask;
+	write_icu1(val, MDSIUINTREG);
+	spin_unlock_irqrestore(&desc->lock, flags);
+}
 
-/*=======================================================================*/
+void vr41xx_disable_dsiuint(uint16_t mask)
+{
+	irq_desc_t *desc = irq_desc + DSIU_IRQ;
+	unsigned long flags;
+	uint16_t val;
+
+	spin_lock_irqsave(&desc->lock, flags);
+	val = read_icu1(MDSIUINTREG);
+	val &= ~mask;
+	write_icu1(val, MDSIUINTREG);
+	spin_unlock_irqrestore(&desc->lock, flags);
+}
 
-static void enable_sysint2_irq(unsigned int irq)
+void vr41xx_enable_firint(uint16_t mask)
 {
-	set_icu2(MSYSINT2REG, (uint16_t)1 << SYSINT2_IRQ_TO_PIN(irq));
+	irq_desc_t *desc = irq_desc + FIR_IRQ;
+	unsigned long flags;
+	uint16_t val;
+
+	spin_lock_irqsave(&desc->lock, flags);
+	val = read_icu2(MFIRINTREG);
+	val |= mask;
+	write_icu2(val, MFIRINTREG);
+	spin_unlock_irqrestore(&desc->lock, flags);
 }
 
-static void disable_sysint2_irq(unsigned int irq)
+void vr41xx_disable_firint(uint16_t mask)
 {
-	clear_icu2(MSYSINT2REG, (uint16_t)1 << SYSINT2_IRQ_TO_PIN(irq));
+	irq_desc_t *desc = irq_desc + FIR_IRQ;
+	unsigned long flags;
+	uint16_t val;
+
+	spin_lock_irqsave(&desc->lock, flags);
+	val = read_icu2(MFIRINTREG);
+	val &= ~mask;
+	write_icu2(val, MFIRINTREG);
+	spin_unlock_irqrestore(&desc->lock, flags);
 }
 
-static unsigned int startup_sysint2_irq(unsigned int irq)
+void vr41xx_enable_pciint(void)
 {
-	set_icu2(MSYSINT2REG, (uint16_t)1 << SYSINT2_IRQ_TO_PIN(irq));
+	irq_desc_t *desc = irq_desc + PCI_IRQ;
+	unsigned long flags;
 
-	return 0; /* never anything pending */
+	spin_lock_irqsave(&desc->lock, flags);
+	write_icu2(PCIINT0, MPCIINTREG);
+	spin_unlock_irqrestore(&desc->lock, flags);
 }
 
-#define shutdown_sysint2_irq	disable_sysint2_irq
-#define ack_sysint2_irq		disable_sysint2_irq
+void vr41xx_disable_pciint(void)
+{
+	irq_desc_t *desc = irq_desc + PCI_IRQ;
+	unsigned long flags;
 
-static void end_sysint2_irq(unsigned int irq)
+	spin_lock_irqsave(&desc->lock, flags);
+	write_icu2(0, MPCIINTREG);
+	spin_unlock_irqrestore(&desc->lock, flags);
+}
+
+void vr41xx_enable_scuint(void)
 {
-	if (!(irq_desc[irq].status & (IRQ_DISABLED | IRQ_INPROGRESS)))
-		set_icu2(MSYSINT2REG, (uint16_t)1 << SYSINT2_IRQ_TO_PIN(irq));
+	irq_desc_t *desc = irq_desc + SCU_IRQ;
+	unsigned long flags;
+
+	spin_lock_irqsave(&desc->lock, flags);
+	write_icu2(SCUINT0, MSCUINTREG);
+	spin_unlock_irqrestore(&desc->lock, flags);
 }
 
-static struct hw_interrupt_type sysint2_irq_type = {
-	.typename	= "SYSINT2",
-	.startup	= startup_sysint2_irq,
-	.shutdown	= shutdown_sysint2_irq,
-	.enable		= enable_sysint2_irq,
-	.disable	= disable_sysint2_irq,
-	.ack		= ack_sysint2_irq,
-	.end		= end_sysint2_irq,
-};
+void vr41xx_disable_scuint(void)
+{
+	irq_desc_t *desc = irq_desc + SCU_IRQ;
+	unsigned long flags;
 
-/*=======================================================================*/
+	spin_lock_irqsave(&desc->lock, flags);
+	write_icu2(0, MSCUINTREG);
+	spin_unlock_irqrestore(&desc->lock, flags);
+}
 
-static void enable_giuint_irq(unsigned int irq)
+void vr41xx_enable_csiint(uint16_t mask)
 {
-	int pin;
+	irq_desc_t *desc = irq_desc + CSI_IRQ;
+	unsigned long flags;
+	uint16_t val;
+
+	spin_lock_irqsave(&desc->lock, flags);
+	val = read_icu2(MCSIINTREG);
+	val |= mask;
+	write_icu2(val, MCSIINTREG);
+	spin_unlock_irqrestore(&desc->lock, flags);
+}
 
-	pin = GIU_IRQ_TO_PIN(irq);
-	if (pin < 16)
-		set_icu1(MGIUINTLREG, (uint16_t)1 << pin);
-	else
-		set_icu2(MGIUINTHREG, (uint16_t)1 << (pin - 16));
-	vr41xx_enable_giuint(pin);
+void vr41xx_disable_csiint(uint16_t mask)
+{
+	irq_desc_t *desc = irq_desc + CSI_IRQ;
+	unsigned long flags;
+	uint16_t val;
+
+	spin_lock_irqsave(&desc->lock, flags);
+	val = read_icu2(MCSIINTREG);
+	val &= ~mask;
+	write_icu2(val, MCSIINTREG);
+	spin_unlock_irqrestore(&desc->lock, flags);
 }
 
-static void disable_giuint_irq(unsigned int irq)
+void vr41xx_enable_bcuint(void)
 {
-	int pin;
+	irq_desc_t *desc = irq_desc + BCU_IRQ;
+	unsigned long flags;
 
-	pin = GIU_IRQ_TO_PIN(irq);
-	vr41xx_disable_giuint(pin);
-	if (pin < 16)
-		clear_icu1(MGIUINTLREG, (uint16_t)1 << pin);
-	else
-		clear_icu2(MGIUINTHREG, (uint16_t)1 << (pin - 16));
+	spin_lock_irqsave(&desc->lock, flags);
+	write_icu2(BCUINTR, MBCUINTREG);
+	spin_unlock_irqrestore(&desc->lock, flags);
 }
 
-static unsigned int startup_giuint_irq(unsigned int irq)
+void vr41xx_disable_bcuint(void)
 {
-	vr41xx_clear_giuint(GIU_IRQ_TO_PIN(irq));
+	irq_desc_t *desc = irq_desc + BCU_IRQ;
+	unsigned long flags;
 
-	enable_giuint_irq(irq);
+	spin_lock_irqsave(&desc->lock, flags);
+	write_icu2(0, MBCUINTREG);
+	spin_unlock_irqrestore(&desc->lock, flags);
+}
+
+/*=======================================================================*/
+
+static unsigned int startup_sysint1_irq(unsigned int irq)
+{
+	set_icu1(MSYSINT1REG, (uint16_t)1 << SYSINT1_IRQ_TO_PIN(irq));
 
 	return 0; /* never anything pending */
 }
 
-#define shutdown_giuint_irq	disable_giuint_irq
-
-static void ack_giuint_irq(unsigned int irq)
+static void shutdown_sysint1_irq(unsigned int irq)
 {
-	disable_giuint_irq(irq);
+	clear_icu1(MSYSINT1REG, (uint16_t)1 << SYSINT1_IRQ_TO_PIN(irq));
+}
 
-	vr41xx_clear_giuint(GIU_IRQ_TO_PIN(irq));
+static void enable_sysint1_irq(unsigned int irq)
+{
+	set_icu1(MSYSINT1REG, (uint16_t)1 << SYSINT1_IRQ_TO_PIN(irq));
 }
 
-static void end_giuint_irq(unsigned int irq)
+#define disable_sysint1_irq	shutdown_sysint1_irq
+#define ack_sysint1_irq		shutdown_sysint1_irq
+
+static void end_sysint1_irq(unsigned int irq)
 {
 	if (!(irq_desc[irq].status & (IRQ_DISABLED | IRQ_INPROGRESS)))
-		enable_giuint_irq(irq);
+		set_icu1(MSYSINT1REG, (uint16_t)1 << SYSINT1_IRQ_TO_PIN(irq));
 }
 
-static struct hw_interrupt_type giuint_irq_type = {
-	.typename	= "GIUINT",
-	.startup	= startup_giuint_irq,
-	.shutdown	= shutdown_giuint_irq,
-	.enable		= enable_giuint_irq,
-	.disable	= disable_giuint_irq,
-	.ack		= ack_giuint_irq,
-	.end		= end_giuint_irq,
+static struct hw_interrupt_type sysint1_irq_type = {
+	.typename	= "SYSINT1",
+	.startup	= startup_sysint1_irq,
+	.shutdown	= shutdown_sysint1_irq,
+	.enable		= enable_sysint1_irq,
+	.disable	= disable_sysint1_irq,
+	.ack		= ack_sysint1_irq,
+	.end		= end_sysint1_irq,
 };
 
 /*=======================================================================*/
 
-static struct irqaction icu_cascade = {no_action, 0, 0, "cascade", NULL, NULL};
-
-static void __init vr41xx_icu_init(void)
+static unsigned int startup_sysint2_irq(unsigned int irq)
 {
-	int i;
-
-	switch (current_cpu_data.cputype) {
-	case CPU_VR4111:
-	case CPU_VR4121:
-		icu1_base = SYSINT1REG_TYPE1;
-		icu2_base = SYSINT2REG_TYPE1;
-		break;
-	case CPU_VR4122:
-	case CPU_VR4131:
-	case CPU_VR4133:
-		icu1_base = SYSINT1REG_TYPE2;
-		icu2_base = SYSINT2REG_TYPE2;
-		break;
-	default:
-		panic("Unexpected CPU of NEC VR4100 series");
-		break;
-	}
-
-	write_icu1(0, MSYSINT1REG);
-	write_icu1(0, MGIUINTLREG);
-
-	write_icu2(0, MSYSINT2REG);
-	write_icu2(0, MGIUINTHREG);
-
-	for (i = SYSINT1_IRQ_BASE; i <= GIU_IRQ_LAST; i++) {
-		if (i >= SYSINT1_IRQ_BASE && i <= SYSINT1_IRQ_LAST)
-			irq_desc[i].handler = &sysint1_irq_type;
-		else if (i >= SYSINT2_IRQ_BASE && i <= SYSINT2_IRQ_LAST)
-			irq_desc[i].handler = &sysint2_irq_type;
-		else if (i >= GIU_IRQ_BASE && i <= GIU_IRQ_LAST)
-			irq_desc[i].handler = &giuint_irq_type;
-	}
+	set_icu2(MSYSINT2REG, (uint16_t)1 << SYSINT2_IRQ_TO_PIN(irq));
 
-	setup_irq(INT0_CASCADE_IRQ, &icu_cascade);
-	setup_irq(INT1_CASCADE_IRQ, &icu_cascade);
-	setup_irq(INT2_CASCADE_IRQ, &icu_cascade);
-	setup_irq(INT3_CASCADE_IRQ, &icu_cascade);
-	setup_irq(INT4_CASCADE_IRQ, &icu_cascade);
+	return 0; /* never anything pending */
 }
 
-void __init init_IRQ(void)
+static void shutdown_sysint2_irq(unsigned int irq)
 {
-	memset(irq_desc, 0, sizeof(irq_desc));
+	clear_icu2(MSYSINT2REG, (uint16_t)1 << SYSINT2_IRQ_TO_PIN(irq));
+}
 
-	init_generic_irq();
-	mips_cpu_irq_init(MIPS_CPU_IRQ_BASE);
-	vr41xx_icu_init();
+static void enable_sysint2_irq(unsigned int irq)
+{
+	set_icu2(MSYSINT2REG, (uint16_t)1 << SYSINT2_IRQ_TO_PIN(irq));
+}
 
-	vr41xx_giuint_init();
+#define disable_sysint2_irq	shutdown_sysint2_irq
+#define ack_sysint2_irq		shutdown_sysint2_irq
 
-	set_except_vector(0, vr41xx_handle_interrupt);
+static void end_sysint2_irq(unsigned int irq)
+{
+	if (!(irq_desc[irq].status & (IRQ_DISABLED | IRQ_INPROGRESS)))
+		set_icu2(MSYSINT2REG, (uint16_t)1 << SYSINT2_IRQ_TO_PIN(irq));
 }
 
+static struct hw_interrupt_type sysint2_irq_type = {
+	.typename	= "SYSINT2",
+	.startup	= startup_sysint2_irq,
+	.shutdown	= shutdown_sysint2_irq,
+	.enable		= enable_sysint2_irq,
+	.disable	= disable_sysint2_irq,
+	.ack		= ack_sysint2_irq,
+	.end		= end_sysint2_irq,
+};
+
 /*=======================================================================*/
 
 static inline int set_sysint1_assign(unsigned int irq, unsigned char assign)
@@ -492,34 +593,14 @@ int vr41xx_set_intassign(unsigned int irq, unsigned char intassign)
 	return retval;
 }
 
-/*=======================================================================*/
+EXPORT_SYMBOL(vr41xx_set_intassign);
 
-static inline void giuint_irq_dispatch(uint16_t pendl, uint16_t pendh,
-                                       struct pt_regs *regs)
-{
-	int i;
-
-	if (pendl) {
-		for (i = 0; i < 16; i++) {
-			if (pendl & ((uint16_t)1 << i)) {
-				giuint_do_IRQ(i, regs);
-				return;
-			}
-		}
-	} else {
-		for (i = 0; i < 16; i++) {
-			if (pendh & ((uint16_t)1 << i)) {
-				giuint_do_IRQ(i + 16, regs);
-				return;
-			}
-		}
-	}
-}
+/*=======================================================================*/
 
 asmlinkage void irq_dispatch(unsigned char intnum, struct pt_regs *regs)
 {
-	uint16_t pend1, pend2, pendl, pendh;
-	uint16_t mask1, mask2, maskl, maskh;
+	uint16_t pend1, pend2;
+	uint16_t mask1, mask2;
 	int i;
 
 	pend1 = read_icu1(SYSINT1REG);
@@ -528,28 +609,18 @@ asmlinkage void irq_dispatch(unsigned char intnum, struct pt_regs *regs)
 	pend2 = read_icu2(SYSINT2REG);
 	mask2 = read_icu2(MSYSINT2REG);
 
-	pendl = read_icu1(GIUINTLREG);
-	maskl = read_icu1(MGIUINTLREG);
-
-	pendh = read_icu2(GIUINTHREG);
-	maskh = read_icu2(MGIUINTHREG);
-
 	mask1 &= pend1;
 	mask2 &= pend2;
-	maskl &= pendl;
-	maskh &= pendh;
 
 	if (mask1) {
 		for (i = 0; i < 16; i++) {
 			if (intnum == sysint1_assign[i] &&
 			    (mask1 & ((uint16_t)1 << i))) {
-				if (i == 8 && (maskl | maskh)) {
-					giuint_irq_dispatch(maskl, maskh, regs);
-					return;
-				} else {
+				if (i == 8)
+					giuint_irq_dispatch(regs);
+				else
 					do_IRQ(SYSINT1_IRQ(i), regs);
-					return;
-				}
+				return;
 			}
 		}
 	}
@@ -564,6 +635,72 @@ asmlinkage void irq_dispatch(unsigned char intnum, struct pt_regs *regs)
 		}
 	}
 
-	printk(KERN_ERR "spurious interrupt: %04x,%04x,%04x,%04x\n", pend1, pend2, pendl, pendh);
+	printk(KERN_ERR "spurious ICU interrupt: %04x,%04x\n", pend1, pend2);
+
 	atomic_inc(&irq_err_count);
 }
+
+/*=======================================================================*/
+
+static int __init vr41xx_icu_init(void)
+{
+	switch (current_cpu_data.cputype) {
+	case CPU_VR4111:
+	case CPU_VR4121:
+		icu1_base = SYSINT1REG_TYPE1;
+		icu2_base = SYSINT2REG_TYPE1;
+		break;
+	case CPU_VR4122:
+	case CPU_VR4131:
+	case CPU_VR4133:
+		icu1_base = SYSINT1REG_TYPE2;
+		icu2_base = SYSINT2REG_TYPE2;
+		break;
+	default:
+		printk(KERN_ERR "ICU: Unexpected CPU of NEC VR4100 series\n");
+		return -EINVAL;
+	}
+
+	write_icu1(0, MSYSINT1REG);
+	write_icu1(0xffff, MGIUINTLREG);
+
+	write_icu2(0, MSYSINT2REG);
+	write_icu2(0xffff, MGIUINTHREG);
+
+	return 0;
+}
+
+early_initcall(vr41xx_icu_init);
+
+/*=======================================================================*/
+
+static struct irqaction icu_cascade = {no_action, 0, 0, "cascade", NULL, NULL};
+
+static inline void init_vr41xx_icu_irq(void)
+{
+	int i;
+
+	for (i = SYSINT1_IRQ_BASE; i <= SYSINT1_IRQ_LAST; i++)
+		irq_desc[i].handler = &sysint1_irq_type;
+
+	for (i = SYSINT2_IRQ_BASE; i <= SYSINT2_IRQ_LAST; i++)
+		irq_desc[i].handler = &sysint2_irq_type;
+
+	setup_irq(INT0_CASCADE_IRQ, &icu_cascade);
+	setup_irq(INT1_CASCADE_IRQ, &icu_cascade);
+	setup_irq(INT2_CASCADE_IRQ, &icu_cascade);
+	setup_irq(INT3_CASCADE_IRQ, &icu_cascade);
+	setup_irq(INT4_CASCADE_IRQ, &icu_cascade);
+}
+
+void __init init_IRQ(void)
+{
+	memset(irq_desc, 0, sizeof(irq_desc));
+
+	init_generic_irq();
+	mips_cpu_irq_init(MIPS_CPU_IRQ_BASE);
+	init_vr41xx_icu_irq();
+	init_vr41xx_giuint_irq();
+
+	set_except_vector(0, vr41xx_handle_interrupt);
+}
diff --git a/arch/mips/vr41xx/common/init.c b/arch/mips/vr41xx/common/init.c
index 6590850b3..ffc8e1c36 100644
--- a/arch/mips/vr41xx/common/init.c
+++ b/arch/mips/vr41xx/common/init.c
@@ -18,16 +18,9 @@
  *  Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA
  */
 #include <linux/init.h>
-#include <linux/ioport.h>
 #include <linux/string.h>
 
 #include <asm/bootinfo.h>
-#include <asm/vr41xx/vr41xx.h>
-
-extern void vr41xx_bcu_init(void);
-extern void vr41xx_cmu_init(void);
-extern void vr41xx_pmu_init(void);
-extern void vr41xx_rtc_init(void);
 
 void __init prom_init(void)
 {
@@ -42,14 +35,6 @@ void __init prom_init(void)
 		if (i < (argc - 1))
 			strcat(arcs_cmdline, " ");
 	}
-
-	iomem_resource.start = IO_MEM_RESOURCE_START;
-	iomem_resource.end = IO_MEM_RESOURCE_END;
-
-	vr41xx_bcu_init();
-	vr41xx_cmu_init();
-	vr41xx_pmu_init();
-	vr41xx_rtc_init();
 }
 
 unsigned long __init prom_free_prom_memory (void)
diff --git a/arch/mips/vr41xx/common/ksyms.c b/arch/mips/vr41xx/common/ksyms.c
index ea5231de0..cfaa0ecd1 100644
--- a/arch/mips/vr41xx/common/ksyms.c
+++ b/arch/mips/vr41xx/common/ksyms.c
@@ -25,8 +25,6 @@
 EXPORT_SYMBOL(vr41xx_get_vtclock_frequency);
 EXPORT_SYMBOL(vr41xx_get_tclock_frequency);
 
-EXPORT_SYMBOL(vr41xx_set_intassign);
-
 EXPORT_SYMBOL(vr41xx_set_rtclong1_cycle);
 EXPORT_SYMBOL(vr41xx_read_rtclong1_counter);
 EXPORT_SYMBOL(vr41xx_set_rtclong2_cycle);
diff --git a/arch/mips/vr41xx/common/pmu.c b/arch/mips/vr41xx/common/pmu.c
index 9b5a82e63..3e1079dfb 100644
--- a/arch/mips/vr41xx/common/pmu.c
+++ b/arch/mips/vr41xx/common/pmu.c
@@ -1,7 +1,7 @@
 /*
  *  pmu.c, Power Management Unit routines for NEC VR4100 series.
  *
- *  Copyright (C) 2003  Yoichi Yuasa <yuasa@hh.iij4u.or.jp>
+ *  Copyright (C) 2003-2004  Yoichi Yuasa <yuasa@hh.iij4u.or.jp>
  *
  *  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
@@ -68,9 +68,13 @@ static void vr41xx_power_off(void)
 	while (1) ;
 }
 
-void __init vr41xx_pmu_init(void)
+static int __init vr41xx_pmu_init(void)
 {
 	_machine_restart = vr41xx_restart;
 	_machine_halt = vr41xx_halt;
 	_machine_power_off = vr41xx_power_off;
+
+	return 0;
 }
+
+early_initcall(vr41xx_pmu_init);
diff --git a/arch/mips/vr41xx/common/rtc.c b/arch/mips/vr41xx/common/rtc.c
index 6fa5fdc28..07173afe1 100644
--- a/arch/mips/vr41xx/common/rtc.c
+++ b/arch/mips/vr41xx/common/rtc.c
@@ -1,7 +1,7 @@
 /*
  *  rtc.c, RTC(has only timer function) routines for NEC VR4100 series.
  *
- *  Copyright (C) 2003  Yoichi Yuasa <yuasa@hh.iij4u.or.jp>
+ *  Copyright (C) 2003-2004  Yoichi Yuasa <yuasa@hh.iij4u.or.jp>
  *
  *  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
@@ -310,8 +310,12 @@ static void __init vr41xx_timer_setup(struct irqaction *irq)
 	setup_irq(ELAPSEDTIME_IRQ, irq);
 }
 
-void __init vr41xx_rtc_init(void)
+static int __init vr41xx_rtc_init(void)
 {
 	board_time_init = vr41xx_time_init;
 	board_timer_setup = vr41xx_timer_setup;
+
+	return 0;
 }
+
+early_initcall(vr41xx_rtc_init);
diff --git a/arch/mips/vr41xx/common/serial.c b/arch/mips/vr41xx/common/serial.c
index b052a9548..cc445eeff 100644
--- a/arch/mips/vr41xx/common/serial.c
+++ b/arch/mips/vr41xx/common/serial.c
@@ -168,7 +168,7 @@ void __init vr41xx_dsiu_init(void)
 	if (port.membase != NULL) {
 		if (early_serial_setup(&port) == 0) {
 			vr41xx_supply_clock(DSIU_CLOCK);
-			vr41xx_enable_dsiuint();
+			vr41xx_enable_dsiuint(DSIUINT_ALL);
 			vr41xx_serial_ports++;
 			return;
 		}
diff --git a/arch/mips/vr41xx/common/vrc4173.c b/arch/mips/vr41xx/common/vrc4173.c
index cce22c159..3b006358c 100644
--- a/arch/mips/vr41xx/common/vrc4173.c
+++ b/arch/mips/vr41xx/common/vrc4173.c
@@ -1,143 +1,336 @@
 /*
- * FILE NAME
- *	drivers/char/vrc4173.c
- * 
- * BRIEF MODULE DESCRIPTION
- *	NEC VRC4173 driver for NEC VR4122/VR4131.
+ *  vrc4173.c, NEC VRC4173 base driver for NEC VR4122/VR4131.
  *
- * Author: Yoichi Yuasa
- *         yyuasa@mvista.com or source@mvista.com
+ *  Copyright (C) 2001-2003  MontaVista Software Inc.
+ *    Author: Yoichi Yuasa <yyuasa@mvista.com, or source@mvista.com>
+ *  Copyright (C) 2004  Yoichi Yuasa <yuasa@hh.iij4u.or.jp>
  *
- * Copyright 2001,2002 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.
  *
- *  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.
  *
- *  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.
+ *  You should have received a copy of the GNU General Public License
+ *  along with this program; if not, write to the Free Software
+ *  Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA
  */
+#include <linux/config.h>
 #include <linux/init.h>
 #include <linux/module.h>
 #include <linux/interrupt.h>
 #include <linux/irq.h>
 #include <linux/pci.h>
+#include <linux/spinlock.h>
 #include <linux/types.h>
 
 #include <asm/vr41xx/vr41xx.h>
 #include <asm/vr41xx/vrc4173.h>
 
-MODULE_DESCRIPTION("NEC VRC4173 driver for NEC VR4122/4131");
+MODULE_DESCRIPTION("NEC VRC4173 base driver for NEC VR4122/4131");
 MODULE_AUTHOR("Yoichi Yuasa <yyuasa@mvista.com>");
 MODULE_LICENSE("GPL");
 
 #define VRC4173_CMUCLKMSK	0x040
+ #define MSKPIU			0x0001
+ #define MSKKIU			0x0002
+ #define MSKAIU			0x0004
+ #define MSKPS2CH1		0x0008
+ #define MSKPS2CH2		0x0010
+ #define MSKUSB			0x0020
+ #define MSKCARD1		0x0040
+ #define MSKCARD2		0x0080
+ #define MSKAC97		0x0100
+ #define MSK48MUSB		0x0400
+ #define MSK48MPIN		0x0800
+ #define MSK48MOSC		0x1000
 #define VRC4173_CMUSRST		0x042
-
-#define VRC4173_SELECTREG	0x09e
+ #define USBRST			0x0001
+ #define CARD1RST		0x0002
+ #define CARD2RST		0x0004
+ #define AC97RST		0x0008
 
 #define VRC4173_SYSINT1REG	0x060
 #define VRC4173_MSYSINT1REG	0x06c
 
-static struct pci_device_id vrc4173_table[] = {
-	{PCI_VENDOR_ID_NEC, PCI_DEVICE_ID_NEC_VRC4173, PCI_ANY_ID, PCI_ANY_ID, 0, 0, 0},
-	{0, }
+#define VRC4173_SELECTREG	0x09e
+ #define SEL3			0x0008
+ #define SEL2			0x0004
+ #define SEL1			0x0002
+ #define SEL0			0x0001
+
+static struct pci_device_id vrc4173_id_table[] __devinitdata = {
+	{	.vendor		= PCI_VENDOR_ID_NEC,
+		.device		= PCI_DEVICE_ID_NEC_VRC4173,
+		.subvendor	= PCI_ANY_ID,
+		.subdevice	= PCI_ANY_ID,			},
+	{	.vendor		= 0,				},
 };
 
 unsigned long vrc4173_io_offset = 0;
 
 EXPORT_SYMBOL(vrc4173_io_offset);
 
-static u16 vrc4173_cmuclkmsk;
 static int vrc4173_initialized;
+static uint16_t vrc4173_cmuclkmsk;
+static uint16_t vrc4173_selectreg;
+static spinlock_t vrc4173_cmu_lock;
+static spinlock_t vrc4173_giu_lock;
 
-void vrc4173_clock_supply(u16 mask)
+static inline void set_cmusrst(uint16_t val)
+{
+	uint16_t cmusrst;
+
+	cmusrst = vrc4173_inw(VRC4173_CMUSRST);
+	cmusrst |= val;
+	vrc4173_outw(cmusrst, VRC4173_CMUSRST);
+}
+
+static inline void clear_cmusrst(uint16_t val)
+{
+	uint16_t cmusrst;
+
+	cmusrst = vrc4173_inw(VRC4173_CMUSRST);
+	cmusrst &= ~val;
+	vrc4173_outw(cmusrst, VRC4173_CMUSRST);
+}
+
+void vrc4173_supply_clock(vrc4173_clock_t clock)
 {
 	if (vrc4173_initialized) {
-		vrc4173_cmuclkmsk |= mask;
+		spin_lock_irq(&vrc4173_cmu_lock);
+
+		switch (clock) {
+		case VRC4173_PIU_CLOCK:
+			vrc4173_cmuclkmsk |= MSKPIU;
+			break;
+		case VRC4173_KIU_CLOCK:
+			vrc4173_cmuclkmsk |= MSKKIU;
+			break;
+		case VRC4173_AIU_CLOCK:
+			vrc4173_cmuclkmsk |= MSKAIU;
+			break;
+		case VRC4173_PS2_CH1_CLOCK:
+			vrc4173_cmuclkmsk |= MSKPS2CH1;
+			break;
+		case VRC4173_PS2_CH2_CLOCK:
+			vrc4173_cmuclkmsk |= MSKPS2CH2;
+			break;
+		case VRC4173_USBU_PCI_CLOCK:
+			set_cmusrst(USBRST);
+			vrc4173_cmuclkmsk |= MSKUSB;
+			break;
+		case VRC4173_CARDU1_PCI_CLOCK:
+			set_cmusrst(CARD1RST);
+			vrc4173_cmuclkmsk |= MSKCARD1;
+			break;
+		case VRC4173_CARDU2_PCI_CLOCK:
+			set_cmusrst(CARD2RST);
+			vrc4173_cmuclkmsk |= MSKCARD2;
+			break;
+		case VRC4173_AC97U_PCI_CLOCK:
+			set_cmusrst(AC97RST);
+			vrc4173_cmuclkmsk |= MSKAC97;
+			break;
+		case VRC4173_USBU_48MHz_CLOCK:
+			set_cmusrst(USBRST);
+			vrc4173_cmuclkmsk |= MSK48MUSB;
+			break;
+		case VRC4173_EXT_48MHz_CLOCK:
+			if (vrc4173_cmuclkmsk & MSK48MOSC)
+				vrc4173_cmuclkmsk |= MSK48MPIN;
+			else
+				printk(KERN_WARNING
+				       "vrc4173_supply_clock: "
+				       "Please supply VRC4173_48MHz_CLOCK first "
+				       "rather than VRC4173_EXT_48MHz_CLOCK.\n");
+			break;
+		case VRC4173_48MHz_CLOCK:
+			vrc4173_cmuclkmsk |= MSK48MOSC;
+			break;
+		default:
+			printk(KERN_WARNING
+			       "vrc4173_supply_clock: Invalid CLOCK value %u\n", clock);
+			break;
+		}
+
 		vrc4173_outw(vrc4173_cmuclkmsk, VRC4173_CMUCLKMSK);
+
+		switch (clock) {
+		case VRC4173_USBU_PCI_CLOCK:
+		case VRC4173_USBU_48MHz_CLOCK:
+			clear_cmusrst(USBRST);
+			break;
+		case VRC4173_CARDU1_PCI_CLOCK:
+			clear_cmusrst(CARD1RST);
+			break;
+		case VRC4173_CARDU2_PCI_CLOCK:
+			clear_cmusrst(CARD2RST);
+			break;
+		case VRC4173_AC97U_PCI_CLOCK:
+			clear_cmusrst(AC97RST);
+			break;
+		default:
+			break;
+		}
+
+		spin_unlock_irq(&vrc4173_cmu_lock);
 	}
 }
 
-void vrc4173_clock_mask(u16 mask)
+EXPORT_SYMBOL(vrc4173_supply_clock);
+
+void vrc4173_mask_clock(vrc4173_clock_t clock)
 {
 	if (vrc4173_initialized) {
-		vrc4173_cmuclkmsk &= ~mask;
+		spin_lock_irq(&vrc4173_cmu_lock);
+
+		switch (clock) {
+		case VRC4173_PIU_CLOCK:
+			vrc4173_cmuclkmsk &= ~MSKPIU;
+			break;
+		case VRC4173_KIU_CLOCK:
+			vrc4173_cmuclkmsk &= ~MSKKIU;
+			break;
+		case VRC4173_AIU_CLOCK:
+			vrc4173_cmuclkmsk &= ~MSKAIU;
+			break;
+		case VRC4173_PS2_CH1_CLOCK:
+			vrc4173_cmuclkmsk &= ~MSKPS2CH1;
+			break;
+		case VRC4173_PS2_CH2_CLOCK:
+			vrc4173_cmuclkmsk &= ~MSKPS2CH2;
+			break;
+		case VRC4173_USBU_PCI_CLOCK:
+			set_cmusrst(USBRST);
+			vrc4173_cmuclkmsk &= ~MSKUSB;
+			break;
+		case VRC4173_CARDU1_PCI_CLOCK:
+			set_cmusrst(CARD1RST);
+			vrc4173_cmuclkmsk &= ~MSKCARD1;
+			break;
+		case VRC4173_CARDU2_PCI_CLOCK:
+			set_cmusrst(CARD2RST);
+			vrc4173_cmuclkmsk &= ~MSKCARD2;
+			break;
+		case VRC4173_AC97U_PCI_CLOCK:
+			set_cmusrst(AC97RST);
+			vrc4173_cmuclkmsk &= ~MSKAC97;
+			break;
+		case VRC4173_USBU_48MHz_CLOCK:
+			set_cmusrst(USBRST);
+			vrc4173_cmuclkmsk &= ~MSK48MUSB;
+			break;
+		case VRC4173_EXT_48MHz_CLOCK:
+			vrc4173_cmuclkmsk &= ~MSK48MPIN;
+			break;
+		case VRC4173_48MHz_CLOCK:
+			vrc4173_cmuclkmsk &= ~MSK48MOSC;
+			break;
+		default:
+			printk(KERN_WARNING "vrc4173_mask_clock: Invalid CLOCK value %u\n", clock);
+			break;
+		}
+
 		vrc4173_outw(vrc4173_cmuclkmsk, VRC4173_CMUCLKMSK);
+
+		switch (clock) {
+		case VRC4173_USBU_PCI_CLOCK:
+		case VRC4173_USBU_48MHz_CLOCK:
+			clear_cmusrst(USBRST);
+			break;
+		case VRC4173_CARDU1_PCI_CLOCK:
+			clear_cmusrst(CARD1RST);
+			break;
+		case VRC4173_CARDU2_PCI_CLOCK:
+			clear_cmusrst(CARD2RST);
+			break;
+		case VRC4173_AC97U_PCI_CLOCK:
+			clear_cmusrst(AC97RST);
+			break;
+		default:
+			break;
+		}
+
+		spin_unlock_irq(&vrc4173_cmu_lock);
 	}
 }
 
+EXPORT_SYMBOL(vrc4173_mask_clock);
+
 static inline void vrc4173_cmu_init(void)
 {
 	vrc4173_cmuclkmsk = vrc4173_inw(VRC4173_CMUCLKMSK);
-}
 
-EXPORT_SYMBOL(vrc4173_clock_supply);
-EXPORT_SYMBOL(vrc4173_clock_mask);
+	spin_lock_init(&vrc4173_cmu_lock);
+}
 
-void vrc4173_select_function(int func)
+void vrc4173_select_function(vrc4173_function_t function)
 {
-	u16 val;
-
 	if (vrc4173_initialized) {
-		val = vrc4173_inw(VRC4173_SELECTREG);
-		switch(func) {
-		case PS2CH1_SELECT:
-			val |= 0x0004;
+		spin_lock_irq(&vrc4173_giu_lock);
+
+		switch(function) {
+		case PS2_CHANNEL1:
+			vrc4173_selectreg |= SEL2;
 			break;
-		case PS2CH2_SELECT:
-			val |= 0x0002;
+		case PS2_CHANNEL2:
+			vrc4173_selectreg |= SEL1;
 			break;
-		case TOUCHPANEL_SELECT:
-			val &= 0x0007;
+		case TOUCHPANEL:
+			vrc4173_selectreg &= SEL2 | SEL1 | SEL0;
 			break;
-		case KIU8_SELECT:
-			val &= 0x000e;
+		case KEYBOARD_8SCANLINES:
+			vrc4173_selectreg &= SEL3 | SEL2 | SEL1;
 			break;
-		case KIU10_SELECT:
-			val &= 0x000c;
+		case KEYBOARD_10SCANLINES:
+			vrc4173_selectreg &= SEL3 | SEL2;
 			break;
-		case KIU12_SELECT:
-			val &= 0x0008;
+		case KEYBOARD_12SCANLINES:
+			vrc4173_selectreg &= SEL3;
 			break;
-		case GPIO_SELECT:
-			val |= 0x0008;
+		case GPIO_0_15PINS:
+			vrc4173_selectreg |= SEL0;
+			break;
+		case GPIO_16_20PINS:
+			vrc4173_selectreg |= SEL3;
 			break;
 		}
-		vrc4173_outw(val, VRC4173_SELECTREG);
+
+		vrc4173_outw(vrc4173_selectreg, VRC4173_SELECTREG);
+
+		spin_unlock_irq(&vrc4173_giu_lock);
 	}
 }
 
 EXPORT_SYMBOL(vrc4173_select_function);
 
+static inline void vrc4173_giu_init(void)
+{
+	vrc4173_selectreg = vrc4173_inw(VRC4173_SELECTREG);
+
+	spin_lock_init(&vrc4173_giu_lock);
+}
+
 static void enable_vrc4173_irq(unsigned int irq)
 {
-	u16 val;
+	uint16_t val;
 
 	val = vrc4173_inw(VRC4173_MSYSINT1REG);
-	val |= (u16)1 << (irq - VRC4173_IRQ_BASE);
+	val |= (uint16_t)1 << (irq - VRC4173_IRQ_BASE);
 	vrc4173_outw(val, VRC4173_MSYSINT1REG);
 }
 
 static void disable_vrc4173_irq(unsigned int irq)
 {
-	u16 val;
+	uint16_t val;
 
 	val = vrc4173_inw(VRC4173_MSYSINT1REG);
-	val &= ~((u16)1 << (irq - VRC4173_IRQ_BASE));
+	val &= ~((uint16_t)1 << (irq - VRC4173_IRQ_BASE));
 	vrc4173_outw(val, VRC4173_MSYSINT1REG);
 }
 
@@ -157,19 +350,18 @@ static void end_vrc4173_irq(unsigned int irq)
 }
 
 static struct hw_interrupt_type vrc4173_irq_type = {
-	"VRC4173",
-	startup_vrc4173_irq,
-	shutdown_vrc4173_irq,
-	enable_vrc4173_irq,
-	disable_vrc4173_irq,
-	ack_vrc4173_irq,
-	end_vrc4173_irq,
-	NULL
+	.typename	= "VRC4173",
+	.startup	= startup_vrc4173_irq,
+	.shutdown	= shutdown_vrc4173_irq,
+	.enable		= enable_vrc4173_irq,
+	.disable	= disable_vrc4173_irq,
+	.ack		= ack_vrc4173_irq,
+	.end		= end_vrc4173_irq,
 };
 
 static int vrc4173_get_irq_number(int irq)
 {
-	u16 status, mask;
+	uint16_t status, mask;
 	int i;
 
         status = vrc4173_inw(VRC4173_SYSINT1REG);
@@ -179,18 +371,18 @@ static int vrc4173_get_irq_number(int irq)
 	if (status) {
 		for (i = 0; i < 16; i++)
 			if (status & (0x0001 << i))
-				return VRC4173_IRQ_BASE + i;
+				return VRC4173_IRQ(i);
 	}
 
 	return -EINVAL;
 }
 
-static inline void vrc4173_icu_init(int cascade_irq)
+static inline int vrc4173_icu_init(int cascade_irq)
 {
 	int i;
 
 	if (cascade_irq < GIU_IRQ(0) || cascade_irq > GIU_IRQ(15))
-		return;
+		return -EINVAL;
 	
 	vrc4173_outw(0, VRC4173_MSYSINT1REG);
 
@@ -199,33 +391,38 @@ static inline void vrc4173_icu_init(int cascade_irq)
 
 	for (i = VRC4173_IRQ_BASE; i <= VRC4173_IRQ_LAST; i++)
                 irq_desc[i].handler = &vrc4173_irq_type;
+
+	return 0;
 }
 
-static int __devinit vrc4173_probe(struct pci_dev *pdev,
-                                   const struct pci_device_id *ent)
+static int __devinit vrc4173_probe(struct pci_dev *dev,
+                                   const struct pci_device_id *id)
 {
 	unsigned long start, flags;
 	int err;
 
-	if ((err = pci_enable_device(pdev)) < 0) {
-		printk(KERN_ERR "vrc4173: failed to enable device -- err=%d\n", err);
+	err = pci_enable_device(dev);
+	if (err < 0) {
+		printk(KERN_ERR "vrc4173: Failed to enable PCI device, aborting\n");
 		return err;
 	}
 
-	pci_set_master(pdev);
+	pci_set_master(dev);
 
-	start = pci_resource_start(pdev, 0);
-	if (!start) {
-		printk(KERN_ERR "vrc4173:No PCI I/O resources, aborting\n");
-		return -ENODEV;
+	start = pci_resource_start(dev, 0);
+	if (start == 0) {
+		printk(KERN_ERR "vrc4173:No such PCI I/O resource, aborting\n");
+		return -ENXIO;
 	}
 
-	if (!start || (((flags = pci_resource_flags(pdev, 0)) & IORESOURCE_IO) == 0)) {
-		printk(KERN_ERR "vrc4173: No PCI I/O resources, aborting\n");
-		return -ENODEV;
+	flags = pci_resource_flags(dev, 0);
+	if ((flags & IORESOURCE_IO) == 0) {
+		printk(KERN_ERR "vrc4173: No such PCI I/O resource, aborting\n");
+		return -ENXIO;
 	}
 
-	if ((err = pci_request_regions(pdev, "NEC VRC4173")) < 0) {
+	err = pci_request_regions(dev, "NEC VRC4173");
+	if (err < 0) {
 		printk(KERN_ERR "vrc4173: PCI resources are busy, aborting\n");
 		return err;
 	}
@@ -233,33 +430,46 @@ static int __devinit vrc4173_probe(struct pci_dev *pdev,
 	set_vrc4173_io_offset(start);
 
 	vrc4173_cmu_init();
+	vrc4173_giu_init();
 
-	vrc4173_icu_init(pdev->irq);
+	err = vrc4173_icu_init(dev->irq);
+	if (err < 0) {
+		printk(KERN_ERR "vrc4173: Invalid IRQ %d, aborting\n", dev->irq);
+		return err;
+	}
 
-	if ((err = vr41xx_cascade_irq(pdev->irq, vrc4173_get_irq_number)) < 0) {
-		printk(KERN_ERR
-		       "vrc4173: IRQ resource %d is busy, aborting\n", pdev->irq);
+	err = vr41xx_cascade_irq(dev->irq, vrc4173_get_irq_number);
+	if (err < 0) {
+		printk(KERN_ERR "vrc4173: IRQ resource %d is busy, aborting\n", dev->irq);
 		return err;
 	}
 
 	printk(KERN_INFO
-	       "NEC VRC4173 at 0x%#08lx, IRQ is cascaded to %d\n", start, pdev->irq);
+	       "NEC VRC4173 at 0x%#08lx, IRQ is cascaded to %d\n", start, dev->irq);
 
 	return 0;
 }
 
+static void vrc4173_remove(struct pci_dev *dev)
+{
+	free_irq(dev->irq, NULL);
+
+	pci_release_regions(dev);
+}
+
 static struct pci_driver vrc4173_driver = {
 	.name		= "NEC VRC4173",
 	.probe		= vrc4173_probe,
-	.remove		= NULL,
-	.id_table	= vrc4173_table,
+	.remove		= vrc4173_remove,
+	.id_table	= vrc4173_id_table,
 };
 
 static int __devinit vrc4173_init(void)
 {
 	int err;
 
-	if ((err = pci_module_init(&vrc4173_driver)) < 0)
+	err = pci_module_init(&vrc4173_driver);
+	if (err < 0)
 		return err;
 
 	vrc4173_initialized = 1;
diff --git a/arch/mips/vr41xx/tanbac-tb0226/setup.c b/arch/mips/vr41xx/tanbac-tb0226/setup.c
index 995a578e2..752c0e736 100644
--- a/arch/mips/vr41xx/tanbac-tb0226/setup.c
+++ b/arch/mips/vr41xx/tanbac-tb0226/setup.c
@@ -18,59 +18,8 @@
  *  Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA
  */
 #include <linux/config.h>
-#include <linux/ioport.h>
 
-#include <asm/io.h>
-#include <asm/pci_channel.h>
-#include <asm/vr41xx/tb0226.h>
-
-#ifdef CONFIG_PCI
-static struct resource vr41xx_pci_io_resource = {
-	.name	= "PCI I/O space",
-	.start	= VR41XX_PCI_IO_START,
-	.end	= VR41XX_PCI_IO_END,
-	.flags	= IORESOURCE_IO,
-};
-
-static struct resource vr41xx_pci_mem_resource = {
-	.name	= "PCI memory space",
-	.start	= VR41XX_PCI_MEM_START,
-	.end	= VR41XX_PCI_MEM_END,
-	.flags	= IORESOURCE_MEM,
-};
-
-extern struct pci_ops vr41xx_pci_ops;
-
-struct pci_controller vr41xx_controller[] = {
-	.pci_ops	= &vr41xx_pci_ops,
-	.io_resource	= &vr41xx_pci_io_resource,
-	.mem_resource	= &vr41xx_pci_mem_resource,
-};
-
-struct vr41xx_pci_address_space vr41xx_pci_mem1 = {
-	.internal_base	= VR41XX_PCI_MEM1_BASE,
-	.address_mask	= VR41XX_PCI_MEM1_MASK,
-	.pci_base	= IO_MEM1_RESOURCE_START,
-};
-
-struct vr41xx_pci_address_space vr41xx_pci_mem2 = {
-	.internal_base	= VR41XX_PCI_MEM2_BASE,
-	.address_mask	= VR41XX_PCI_MEM2_MASK,
-	.pci_base	= IO_MEM2_RESOURCE_START,
-};
-
-struct vr41xx_pci_address_space vr41xx_pci_io = {
-	.internal_base	= VR41XX_PCI_IO_BASE,
-	.address_mask	= VR41XX_PCI_IO_MASK,
-	.pci_base	= IO_PORT_RESOURCE_START,
-};
-
-static struct vr41xx_pci_address_map pci_address_map = {
-	.mem1	= &vr41xx_pci_mem1,
-	.mem2	= &vr41xx_pci_mem2,
-	.io	= &vr41xx_pci_io,
-};
-#endif
+#include <asm/vr41xx/vr41xx.h>
 
 const char *get_system_type(void)
 {
@@ -79,19 +28,11 @@ const char *get_system_type(void)
 
 static int tanbac_tb0226_setup(void)
 {
-	set_io_port_base(IO_PORT_BASE);
-	ioport_resource.start = IO_PORT_RESOURCE_START;
-	ioport_resource.end = IO_PORT_RESOURCE_END;
-
 #ifdef CONFIG_SERIAL_8250
 	vr41xx_select_siu_interface(SIU_RS232C, IRDA_NONE);
 	vr41xx_siu_init();
 #endif
 
-#ifdef CONFIG_PCI
-	vr41xx_pciu_init(&pci_address_map);
-#endif
-
 	return 0;
 }
 
diff --git a/arch/mips/vr41xx/tanbac-tb0229/Makefile b/arch/mips/vr41xx/tanbac-tb0229/Makefile
index ff7429e81..dd085394a 100644
--- a/arch/mips/vr41xx/tanbac-tb0229/Makefile
+++ b/arch/mips/vr41xx/tanbac-tb0229/Makefile
@@ -4,4 +4,4 @@
 
 obj-y				:= setup.o
 
-obj-$(CONFIG_TANBAC_TB0219)	+= reboot.o
+obj-$(CONFIG_TANBAC_TB0219)	+= tb0219.o
diff --git a/arch/mips/vr41xx/tanbac-tb0229/setup.c b/arch/mips/vr41xx/tanbac-tb0229/setup.c
index 971473e61..9209e3dc6 100644
--- a/arch/mips/vr41xx/tanbac-tb0229/setup.c
+++ b/arch/mips/vr41xx/tanbac-tb0229/setup.c
@@ -21,60 +21,8 @@
  *  Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA
  */
 #include <linux/config.h>
-#include <linux/ioport.h>
 
-#include <asm/io.h>
-#include <asm/pci_channel.h>
-#include <asm/reboot.h>
-#include <asm/vr41xx/tb0229.h>
-
-#ifdef CONFIG_PCI
-static struct resource vr41xx_pci_io_resource = {
-	.name	= "PCI I/O space",
-	.start	= VR41XX_PCI_IO_START,
-	.end	= VR41XX_PCI_IO_END,
-	.flags	= IORESOURCE_IO,
-};
-
-static struct resource vr41xx_pci_mem_resource = {
-	.name	= "PCI memory space",
-	.start	= VR41XX_PCI_MEM_START,
-	.end	= VR41XX_PCI_MEM_END,
-	.flags	= IORESOURCE_MEM,
-};
-
-extern struct pci_ops vr41xx_pci_ops;
-
-struct pci_controller vr41xx_controller = {
-	.pci_ops	= &vr41xx_pci_ops,
-	.io_resource	= &vr41xx_pci_io_resource,
-	.mem_resource	= &vr41xx_pci_mem_resource,
-};
-
-struct vr41xx_pci_address_space vr41xx_pci_mem1 = {
-	.internal_base	= VR41XX_PCI_MEM1_BASE,
-	.address_mask	= VR41XX_PCI_MEM1_MASK,
-	.pci_base	= IO_MEM1_RESOURCE_START,
-};
-
-struct vr41xx_pci_address_space vr41xx_pci_mem2 = {
-	.internal_base	= VR41XX_PCI_MEM2_BASE,
-	.address_mask	= VR41XX_PCI_MEM2_MASK,
-	.pci_base	= IO_MEM2_RESOURCE_START,
-};
-
-struct vr41xx_pci_address_space vr41xx_pci_io = {
-	.internal_base	= VR41XX_PCI_IO_BASE,
-	.address_mask	= VR41XX_PCI_IO_MASK,
-	.pci_base	= IO_PORT_RESOURCE_START
-};
-
-static struct vr41xx_pci_address_map pci_address_map = {
-	.mem1	= &vr41xx_pci_mem1,
-	.mem2	= &vr41xx_pci_mem2,
-	.io	= &vr41xx_pci_io,
-};
-#endif
+#include <asm/vr41xx/vr41xx.h>
 
 const char *get_system_type(void)
 {
@@ -83,24 +31,12 @@ const char *get_system_type(void)
 
 static int tanbac_tb0229_setup(void)
 {
-	set_io_port_base(IO_PORT_BASE);
-	ioport_resource.start = IO_PORT_RESOURCE_START;
-	ioport_resource.end = IO_PORT_RESOURCE_END;
-
 #ifdef CONFIG_SERIAL_8250
 	vr41xx_select_siu_interface(SIU_RS232C, IRDA_NONE);
 	vr41xx_siu_init();
 	vr41xx_dsiu_init();
 #endif
 
-#ifdef CONFIG_PCI
-	vr41xx_pciu_init(&pci_address_map);
-#endif
-
-#ifdef CONFIG_TANBAC_TB0219
-	_machine_restart = tanbac_tb0229_restart;
-#endif
-
 	return 0;
 }
 
diff --git a/arch/mips/vr41xx/victor-mpc30x/setup.c b/arch/mips/vr41xx/victor-mpc30x/setup.c
index 5fc208496..169ac00a1 100644
--- a/arch/mips/vr41xx/victor-mpc30x/setup.c
+++ b/arch/mips/vr41xx/victor-mpc30x/setup.c
@@ -18,59 +18,8 @@
  *  Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA
  */
 #include <linux/config.h>
-#include <linux/ioport.h>
 
-#include <asm/io.h>
-#include <asm/pci_channel.h>
-#include <asm/vr41xx/mpc30x.h>
-
-#ifdef CONFIG_PCI
-static struct resource vr41xx_pci_io_resource = {
-	"PCI I/O space",
-	VR41XX_PCI_IO_START,
-	VR41XX_PCI_IO_END,
-	IORESOURCE_IO
-};
-
-static struct resource vr41xx_pci_mem_resource = {
-	"PCI memory space",
-	VR41XX_PCI_MEM_START,
-	VR41XX_PCI_MEM_END,
-	IORESOURCE_MEM
-};
-
-extern struct pci_ops vr41xx_pci_ops;
-
-struct pci_controller vr41xx_controller[] = {
-	.pci_ops	= &vr41xx_pci_ops,
-	.io_resource	= &vr41xx_pci_io_resource,
-	.mem_resource	= &vr41xx_pci_mem_resource,
-};
-
-struct vr41xx_pci_address_space vr41xx_pci_mem1 = {
-	VR41XX_PCI_MEM1_BASE,
-	VR41XX_PCI_MEM1_MASK,
-	IO_MEM1_RESOURCE_START
-};
-
-struct vr41xx_pci_address_space vr41xx_pci_mem2 = {
-	VR41XX_PCI_MEM2_BASE,
-	VR41XX_PCI_MEM2_MASK,
-	IO_MEM2_RESOURCE_START
-};
-
-struct vr41xx_pci_address_space vr41xx_pci_io = {
-	VR41XX_PCI_IO_BASE,
-	VR41XX_PCI_IO_MASK,
-	IO_PORT_RESOURCE_START
-};
-
-static struct vr41xx_pci_address_map pci_address_map = {
-	&vr41xx_pci_mem1,
-	&vr41xx_pci_mem2,
-	&vr41xx_pci_io
-};
-#endif
+#include <asm/vr41xx/vr41xx.h>
 
 const char *get_system_type(void)
 {
@@ -79,19 +28,11 @@ const char *get_system_type(void)
 
 static int victor_mpc30x_setup(void)
 {
-	set_io_port_base(IO_PORT_BASE);
-	ioport_resource.start = IO_PORT_RESOURCE_START;
-	ioport_resource.end = IO_PORT_RESOURCE_END;
-
 #ifdef CONFIG_SERIAL_8250
 	vr41xx_select_siu_interface(SIU_RS232C, IRDA_NONE);
 	vr41xx_siu_init();
 #endif
 
-#ifdef CONFIG_PCI
-	vr41xx_pciu_init(&pci_address_map);
-#endif
-
 	return 0;
 }
 
diff --git a/arch/mips/vr41xx/zao-capcella/setup.c b/arch/mips/vr41xx/zao-capcella/setup.c
index 8b1e178ae..35b3a0a92 100644
--- a/arch/mips/vr41xx/zao-capcella/setup.c
+++ b/arch/mips/vr41xx/zao-capcella/setup.c
@@ -18,59 +18,8 @@
  *  Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA
  */
 #include <linux/config.h>
-#include <linux/ioport.h>
 
-#include <asm/io.h>
-#include <asm/pci_channel.h>
-#include <asm/vr41xx/capcella.h>
-
-#ifdef CONFIG_PCI
-static struct resource vr41xx_pci_io_resource = {
-	"PCI I/O space",
-	VR41XX_PCI_IO_START,
-	VR41XX_PCI_IO_END,
-	IORESOURCE_IO
-};
-
-static struct resource vr41xx_pci_mem_resource = {
-	"PCI memory space",
-	VR41XX_PCI_MEM_START,
-	VR41XX_PCI_MEM_END,
-	IORESOURCE_MEM
-};
-
-extern struct pci_ops vr41xx_pci_ops;
-
-struct pci_controller vr41xx_controller = {
-	.pci_ops	= &vr41xx_pci_ops,
-	.io_resource	= &vr41xx_pci_io_resource,
-	.mem_resource	= &vr41xx_pci_mem_resource,
-};
-
-struct vr41xx_pci_address_space vr41xx_pci_mem1 = {
-	VR41XX_PCI_MEM1_BASE,
-	VR41XX_PCI_MEM1_MASK,
-	IO_MEM1_RESOURCE_START
-};
-
-struct vr41xx_pci_address_space vr41xx_pci_mem2 = {
-	VR41XX_PCI_MEM2_BASE,
-	VR41XX_PCI_MEM2_MASK,
-	IO_MEM2_RESOURCE_START
-};
-
-struct vr41xx_pci_address_space vr41xx_pci_io = {
-	VR41XX_PCI_IO_BASE,
-	VR41XX_PCI_IO_MASK,
-	IO_PORT_RESOURCE_START
-};
-
-static struct vr41xx_pci_address_map pci_address_map = {
-	&vr41xx_pci_mem1,
-	&vr41xx_pci_mem2,
-	&vr41xx_pci_io
-};
-#endif
+#include <asm/vr41xx/vr41xx.h>
 
 const char *get_system_type(void)
 {
@@ -79,20 +28,12 @@ const char *get_system_type(void)
 
 static int zao_capcella_setup(void)
 {
-	set_io_port_base(IO_PORT_BASE);
-	ioport_resource.start = IO_PORT_RESOURCE_START;
-	ioport_resource.end = IO_PORT_RESOURCE_END;
-
 #ifdef CONFIG_SERIAL_8250
 	vr41xx_select_siu_interface(SIU_RS232C, IRDA_NONE);
 	vr41xx_siu_init();
 	vr41xx_dsiu_init();
 #endif
 
-#ifdef CONFIG_PCI
-	vr41xx_pciu_init(&pci_address_map);
-#endif
-
 	return 0;
 }
 
diff --git a/arch/parisc/Kconfig b/arch/parisc/Kconfig
index 4f195174a..1c018a72a 100644
--- a/arch/parisc/Kconfig
+++ b/arch/parisc/Kconfig
@@ -136,6 +136,20 @@ config SMP
 
 	  If you don't know what to do here, say N.
 
+config HOTPLUG_CPU
+	bool
+	default y if SMP
+	select HOTPLUG
+
+config DISCONTIGMEM
+	bool "Discontiguous memory support (EXPERIMENTAL)"
+	depends on EXPERIMENTAL
+	help
+	  Say Y to support efficient handling of discontiguous physical memory,
+	  for architectures which are either NUMA (Non-Uniform Memory Access)
+	  or have huge holes in the physical address space for other reasons.
+	  See <file:Documentation/vm/numa> for more.
+
 config PREEMPT
 	bool
 #	bool "Preemptible Kernel"
@@ -204,6 +218,24 @@ config MAGIC_SYSRQ
 	  keys are documented in <file:Documentation/sysrq.txt>. Don't say Y
 	  unless you really know what this hack does.
 
+config DEBUG_SPINLOCK
+        bool "Spinlock debugging"
+        depends on DEBUG_KERNEL
+        help
+          Say Y here and build SMP to catch missing spinlock initialization
+          and certain other kinds of spinlock errors commonly made.  This is
+          best used in conjunction with the NMI watchdog so that spinlock
+          deadlocks are also debuggable.
+
+config DEBUG_RWLOCK
+        bool "Read-write spinlock debugging"
+        depends on DEBUG_KERNEL && SMP
+        help
+          If you say Y here then read-write lock processing will count how many
+          times it has tried to get the lock and issue an error message after
+          too many attempts.  If you suspect a rwlock problem or a kernel
+          hacker asks for this option then say Y.  Otherwise say N.
+
 config FRAME_POINTER
 	bool "Compile the kernel with frame pointers"
 	help
diff --git a/arch/parisc/configs/a500_defconfig b/arch/parisc/configs/a500_defconfig
index 7fe97811b..276fc0d17 100644
--- a/arch/parisc/configs/a500_defconfig
+++ b/arch/parisc/configs/a500_defconfig
@@ -20,19 +20,23 @@ CONFIG_BROKEN_ON_SMP=y
 #
 CONFIG_SWAP=y
 CONFIG_SYSVIPC=y
+CONFIG_POSIX_MQUEUE=y
 # CONFIG_BSD_PROCESS_ACCT is not set
 CONFIG_SYSCTL=y
+# CONFIG_AUDIT is not set
 CONFIG_LOG_BUF_SHIFT=16
 CONFIG_HOTPLUG=y
 CONFIG_IKCONFIG=y
 CONFIG_IKCONFIG_PROC=y
 CONFIG_EMBEDDED=y
 CONFIG_KALLSYMS=y
+CONFIG_KALLSYMS_ALL=y
 CONFIG_FUTEX=y
 CONFIG_EPOLL=y
 CONFIG_IOSCHED_NOOP=y
 CONFIG_IOSCHED_AS=y
 CONFIG_IOSCHED_DEADLINE=y
+CONFIG_IOSCHED_CFQ=y
 # CONFIG_CC_OPTIMIZE_FOR_SIZE is not set
 
 #
@@ -51,11 +55,12 @@ CONFIG_KMOD=y
 # CONFIG_PA7000 is not set
 # CONFIG_PA7100LC is not set
 # CONFIG_PA7200 is not set
+# CONFIG_PA7300LC is not set
 CONFIG_PA8X00=y
 CONFIG_PA20=y
+CONFIG_PREFETCH=y
 CONFIG_PARISC64=y
 CONFIG_64BIT=y
-# CONFIG_PDC_NARROW is not set
 # CONFIG_SMP is not set
 # CONFIG_PREEMPT is not set
 CONFIG_COMPAT=y
@@ -71,8 +76,8 @@ CONFIG_PCI_LBA=y
 CONFIG_IOSAPIC=y
 CONFIG_IOMMU_SBA=y
 # CONFIG_SUPERIO is not set
-CONFIG_CHASSIS_LCD_LED=y
-# CONFIG_PDC_CHASSIS is not set
+# CONFIG_CHASSIS_LCD_LED is not set
+CONFIG_PDC_CHASSIS=y
 
 #
 # PCMCIA/CardBus support
@@ -168,7 +173,7 @@ CONFIG_SCSI_REPORT_LUNS=y
 # SCSI Transport Attributes
 #
 CONFIG_SCSI_SPI_ATTRS=y
-# CONFIG_SCSI_FC_ATTRS is not set
+CONFIG_SCSI_FC_ATTRS=m
 
 #
 # SCSI low-level drivers
@@ -197,6 +202,7 @@ CONFIG_SCSI_SYM53C8XX_DMA_ADDRESSING_MODE=0
 CONFIG_SCSI_SYM53C8XX_DEFAULT_TAGS=16
 CONFIG_SCSI_SYM53C8XX_MAX_TAGS=64
 CONFIG_SCSI_SYM53C8XX_IOMAPPED=y
+# CONFIG_SCSI_IPR is not set
 # CONFIG_SCSI_PCI2000 is not set
 # CONFIG_SCSI_PCI2220I is not set
 # CONFIG_SCSI_QLOGIC_ISP is not set
@@ -219,6 +225,7 @@ CONFIG_SCSI_DEBUG=m
 #
 # CONFIG_PCMCIA_FDOMAIN is not set
 # CONFIG_PCMCIA_QLOGIC is not set
+# CONFIG_PCMCIA_SYM53C500 is not set
 
 #
 # Multi-device support (RAID and LVM)
@@ -249,6 +256,7 @@ CONFIG_FUSION_CTL=m
 #
 # I2O device support
 #
+# CONFIG_I2O is not set
 
 #
 # Networking support
@@ -284,8 +292,6 @@ CONFIG_INET_ESP=m
 #
 # CONFIG_IP_VS is not set
 # CONFIG_IPV6 is not set
-# CONFIG_DECNET is not set
-# CONFIG_BRIDGE is not set
 CONFIG_NETFILTER=y
 # CONFIG_NETFILTER_DEBUG is not set
 
@@ -345,6 +351,8 @@ CONFIG_IP_NF_ARPFILTER=m
 CONFIG_IP_NF_ARP_MANGLE=m
 # CONFIG_IP_NF_COMPAT_IPCHAINS is not set
 # CONFIG_IP_NF_COMPAT_IPFWADM is not set
+CONFIG_IP_NF_TARGET_NOTRACK=m
+CONFIG_IP_NF_RAW=m
 CONFIG_XFRM=y
 CONFIG_XFRM_USER=m
 
@@ -353,7 +361,9 @@ CONFIG_XFRM_USER=m
 #
 # CONFIG_IP_SCTP is not set
 # CONFIG_ATM is not set
+# CONFIG_BRIDGE is not set
 # CONFIG_VLAN_8021Q is not set
+# CONFIG_DECNET is not set
 CONFIG_LLC=m
 CONFIG_LLC2=m
 # CONFIG_IPX is not set
@@ -363,7 +373,6 @@ CONFIG_LLC2=m
 # 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
 
 #
@@ -375,18 +384,23 @@ CONFIG_LLC2=m
 # Network testing
 #
 CONFIG_NET_PKTGEN=m
+# CONFIG_NETPOLL is not set
+# CONFIG_NET_POLL_CONTROLLER is not set
+# CONFIG_HAMRADIO is not set
+# CONFIG_IRDA is not set
+# CONFIG_BT is not set
 CONFIG_NETDEVICES=y
-
-#
-# ARCnet devices
-#
-# CONFIG_ARCNET is not set
 CONFIG_DUMMY=m
 CONFIG_BONDING=m
 # CONFIG_EQUALIZER is not set
 CONFIG_TUN=m
 # CONFIG_ETHERTAP is not set
 
+#
+# ARCnet devices
+#
+# CONFIG_ARCNET is not set
+
 #
 # Ethernet (10 or 100Mbit)
 #
@@ -433,7 +447,6 @@ CONFIG_8139TOO=m
 # CONFIG_8139TOO_TUNE_TWISTER is not set
 # CONFIG_8139TOO_8129 is not set
 # CONFIG_8139_OLD_RX_RESET is not set
-CONFIG_8139_RXBUF_IDX=1
 # CONFIG_SIS900 is not set
 CONFIG_EPIC100=m
 # CONFIG_SUNDANCE is not set
@@ -452,7 +465,6 @@ CONFIG_E1000_NAPI=y
 # CONFIG_HAMACHI is not set
 # CONFIG_YELLOWFIN is not set
 # CONFIG_R8169 is not set
-# CONFIG_SIS190 is not set
 # CONFIG_SK98LIN is not set
 CONFIG_TIGON3=m
 
@@ -461,17 +473,13 @@ CONFIG_TIGON3=m
 #
 CONFIG_IXGB=m
 CONFIG_IXGB_NAPI=y
-# CONFIG_FDDI is not set
-# CONFIG_HIPPI is not set
-CONFIG_PPP=m
-# CONFIG_PPP_MULTILINK is not set
-# CONFIG_PPP_FILTER is not set
-CONFIG_PPP_ASYNC=m
-CONFIG_PPP_SYNC_TTY=m
-CONFIG_PPP_DEFLATE=m
-CONFIG_PPP_BSDCOMP=m
-# CONFIG_PPPOE is not set
-# CONFIG_SLIP is not set
+CONFIG_S2IO=m
+CONFIG_S2IO_NAPI=y
+
+#
+# Token Ring devices
+#
+# CONFIG_TR is not set
 
 #
 # Wireless LAN (non-hamradio)
@@ -513,19 +521,6 @@ CONFIG_AIRO_CS=m
 # CONFIG_PRISM54 is not set
 CONFIG_NET_WIRELESS=y
 
-#
-# Token Ring devices
-#
-# CONFIG_TR is not set
-# CONFIG_NET_FC is not set
-# CONFIG_SHAPER is not set
-# CONFIG_NETCONSOLE is not set
-
-#
-# Wan interfaces
-#
-# CONFIG_WAN is not set
-
 #
 # PCMCIA network device support
 #
@@ -540,21 +535,23 @@ CONFIG_PCMCIA_XIRC2PS=m
 # CONFIG_PCMCIA_AXNET is not set
 
 #
-# Amateur Radio support
-#
-# CONFIG_HAMRADIO is not set
-
-#
-# IrDA (infrared) support
-#
-# CONFIG_IRDA is not set
-
-#
-# Bluetooth support
+# Wan interfaces
 #
-# CONFIG_BT is not set
-# CONFIG_NETPOLL is not set
-# CONFIG_NET_POLL_CONTROLLER is not set
+# CONFIG_WAN is not set
+# CONFIG_FDDI is not set
+# CONFIG_HIPPI is not set
+CONFIG_PPP=m
+# CONFIG_PPP_MULTILINK is not set
+# CONFIG_PPP_FILTER is not set
+CONFIG_PPP_ASYNC=m
+CONFIG_PPP_SYNC_TTY=m
+CONFIG_PPP_DEFLATE=m
+CONFIG_PPP_BSDCOMP=m
+# CONFIG_PPPOE is not set
+# CONFIG_SLIP is not set
+# CONFIG_NET_FC is not set
+# CONFIG_SHAPER is not set
+# CONFIG_NETCONSOLE is not set
 
 #
 # ISDN subsystem
@@ -751,6 +748,7 @@ CONFIG_VFAT_FS=m
 #
 CONFIG_PROC_FS=y
 CONFIG_PROC_KCORE=y
+CONFIG_SYSFS=y
 # CONFIG_DEVFS_FS is not set
 # CONFIG_DEVPTS_FS_XATTR is not set
 # CONFIG_TMPFS is not set
@@ -799,7 +797,6 @@ CONFIG_SMB_NLS_REMOTE="cp437"
 CONFIG_CIFS=m
 # CONFIG_NCP_FS is not set
 # CONFIG_CODA_FS is not set
-# CONFIG_INTERMEZZO_FS is not set
 # CONFIG_AFS_FS is not set
 
 #
@@ -892,11 +889,13 @@ CONFIG_CRYPTO_CAST6=m
 # CONFIG_CRYPTO_ARC4 is not set
 CONFIG_CRYPTO_DEFLATE=m
 # CONFIG_CRYPTO_MICHAEL_MIC is not set
+CONFIG_CRYPTO_CRC32C=m
 CONFIG_CRYPTO_TEST=m
 
 #
 # Library routines
 #
 CONFIG_CRC32=y
+CONFIG_LIBCRC32C=m
 CONFIG_ZLIB_INFLATE=m
 CONFIG_ZLIB_DEFLATE=m
diff --git a/arch/parisc/configs/b180_defconfig b/arch/parisc/configs/b180_defconfig
index 65f186377..b67d80140 100644
--- a/arch/parisc/configs/b180_defconfig
+++ b/arch/parisc/configs/b180_defconfig
@@ -21,16 +21,20 @@ CONFIG_SWAP=y
 CONFIG_SYSVIPC=y
 # CONFIG_BSD_PROCESS_ACCT is not set
 CONFIG_SYSCTL=y
+# CONFIG_AUDIT is not set
 CONFIG_LOG_BUF_SHIFT=15
 # CONFIG_HOTPLUG is not set
 # CONFIG_IKCONFIG is not set
 # CONFIG_EMBEDDED is not set
 CONFIG_KALLSYMS=y
+# CONFIG_KALLSYMS_ALL is not set
+# CONFIG_KALLSYMS_EXTRA_PASS is not set
 CONFIG_FUTEX=y
 CONFIG_EPOLL=y
 CONFIG_IOSCHED_NOOP=y
 CONFIG_IOSCHED_AS=y
 CONFIG_IOSCHED_DEADLINE=y
+CONFIG_IOSCHED_CFQ=y
 # CONFIG_CC_OPTIMIZE_FOR_SIZE is not set
 
 #
@@ -45,8 +49,9 @@ CONFIG_OBSOLETE_MODPARM=y
 # Processor type and features
 #
 # CONFIG_PA7000 is not set
-# CONFIG_PA7100LC is not set
-CONFIG_PA7200=y
+CONFIG_PA7100LC=y
+# CONFIG_PA7200 is not set
+# CONFIG_PA7300LC is not set
 # CONFIG_PA8X00 is not set
 CONFIG_PA11=y
 # CONFIG_64BIT is not set
@@ -70,7 +75,7 @@ CONFIG_PCI_LEGACY_PROC=y
 CONFIG_PCI_NAMES=y
 CONFIG_GSC_DINO=y
 # CONFIG_PCI_LBA is not set
-# CONFIG_CHASSIS_LCD_LED is not set
+CONFIG_CHASSIS_LCD_LED=y
 # CONFIG_PDC_CHASSIS is not set
 
 #
@@ -86,6 +91,7 @@ CONFIG_BINFMT_ELF=y
 #
 # Generic Driver Options
 #
+CONFIG_PREVENT_FIRMWARE_BUILD=y
 CONFIG_DEBUG_DRIVER=y
 
 #
@@ -121,7 +127,7 @@ CONFIG_PARPORT_GSC=y
 CONFIG_BLK_DEV_LOOP=y
 CONFIG_BLK_DEV_CRYPTOLOOP=y
 # CONFIG_BLK_DEV_NBD is not set
-CONFIG_BLK_DEV_CARMEL=y
+# CONFIG_BLK_DEV_SX8 is not set
 # CONFIG_BLK_DEV_RAM is not set
 
 #
@@ -149,7 +155,6 @@ CONFIG_CHR_DEV_SG=y
 # Some SCSI devices (e.g. CD jukebox) support multiple LUNs
 #
 # CONFIG_SCSI_MULTI_LUN is not set
-# CONFIG_SCSI_REPORT_LUNS is not set
 # CONFIG_SCSI_CONSTANTS is not set
 # CONFIG_SCSI_LOGGING is not set
 
@@ -163,6 +168,7 @@ CONFIG_SCSI_SPI_ATTRS=y
 # SCSI low-level drivers
 #
 # CONFIG_BLK_DEV_3W_XXXX_RAID is not set
+# CONFIG_SCSI_3W_9XXX is not set
 # CONFIG_SCSI_7000FASST is not set
 # CONFIG_SCSI_ACARD is not set
 # CONFIG_SCSI_AHA152X is not set
@@ -171,11 +177,10 @@ CONFIG_SCSI_SPI_ATTRS=y
 # CONFIG_SCSI_AIC7XXX is not set
 # CONFIG_SCSI_AIC7XXX_OLD is not set
 # CONFIG_SCSI_AIC79XX is not set
-# CONFIG_SCSI_ADVANSYS is not set
+# CONFIG_SCSI_DPT_I2O is not set
 # CONFIG_SCSI_IN2000 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
@@ -197,6 +202,7 @@ CONFIG_SCSI_SYM53C8XX_DMA_ADDRESSING_MODE=0
 CONFIG_SCSI_SYM53C8XX_DEFAULT_TAGS=16
 CONFIG_SCSI_SYM53C8XX_MAX_TAGS=64
 # CONFIG_SCSI_SYM53C8XX_IOMAPPED is not set
+# CONFIG_SCSI_IPR is not set
 # CONFIG_SCSI_ZALON is not set
 # CONFIG_SCSI_PAS16 is not set
 # CONFIG_SCSI_PSI240I is not set
@@ -278,10 +284,10 @@ CONFIG_IP_PNP_BOOTP=y
 # CONFIG_INET_AH is not set
 # CONFIG_INET_ESP is not set
 # CONFIG_INET_IPCOMP is not set
-# CONFIG_DECNET is not set
-# CONFIG_BRIDGE is not set
 # CONFIG_NETFILTER is not set
+# CONFIG_BRIDGE is not set
 # CONFIG_VLAN_8021Q is not set
+# CONFIG_DECNET is not set
 # CONFIG_LLC2 is not set
 # CONFIG_IPX is not set
 # CONFIG_ATALK is not set
@@ -290,21 +296,27 @@ CONFIG_IP_PNP_BOOTP=y
 # QoS and/or fair queueing
 #
 # CONFIG_NET_SCHED is not set
+# CONFIG_NET_CLS_ROUTE is not set
 
 #
 # Network testing
 #
 # CONFIG_NET_PKTGEN is not set
+# CONFIG_NETPOLL is not set
+# CONFIG_NET_POLL_CONTROLLER is not set
+# CONFIG_HAMRADIO is not set
+# CONFIG_IRDA is not set
+# CONFIG_BT is not set
 CONFIG_NETDEVICES=y
+# CONFIG_DUMMY is not set
+# CONFIG_BONDING is not set
+# CONFIG_EQUALIZER is not set
+# CONFIG_TUN is not set
 
 #
 # 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)
@@ -351,15 +363,12 @@ CONFIG_TULIP=y
 # Ethernet (10000 Mbit)
 #
 # CONFIG_IXGB is not set
-# CONFIG_FDDI is not set
-# CONFIG_PLIP is not set
-CONFIG_PPP=y
-# CONFIG_PPP_FILTER is not set
-# CONFIG_PPP_ASYNC is not set
-# CONFIG_PPP_SYNC_TTY is not set
-# CONFIG_PPP_DEFLATE is not set
-# CONFIG_PPP_BSDCOMP is not set
-# CONFIG_SLIP is not set
+# CONFIG_S2IO is not set
+
+#
+# Token Ring devices
+#
+# CONFIG_TR is not set
 
 #
 # Wireless LAN (non-hamradio)
@@ -384,33 +393,20 @@ CONFIG_NET_RADIO=y
 #
 CONFIG_NET_WIRELESS=y
 
-#
-# Token Ring devices
-#
-# CONFIG_TR is not set
-# CONFIG_NET_FC is not set
-
 #
 # Wan interfaces
 #
 # CONFIG_WAN is not set
-
-#
-# Amateur Radio support
-#
-# CONFIG_HAMRADIO is not set
-
-#
-# IrDA (infrared) support
-#
-# CONFIG_IRDA is not set
-
-#
-# Bluetooth support
-#
-# CONFIG_BT is not set
-# CONFIG_NETPOLL is not set
-# CONFIG_NET_POLL_CONTROLLER is not set
+# CONFIG_FDDI is not set
+# CONFIG_PLIP is not set
+CONFIG_PPP=y
+# CONFIG_PPP_FILTER is not set
+# CONFIG_PPP_ASYNC is not set
+# CONFIG_PPP_SYNC_TTY is not set
+# CONFIG_PPP_DEFLATE is not set
+# CONFIG_PPP_BSDCOMP is not set
+# CONFIG_SLIP is not set
+# CONFIG_NET_FC is not set
 
 #
 # ISDN subsystem
@@ -473,7 +469,6 @@ CONFIG_INPUT_MOUSE=y
 # CONFIG_INPUT_JOYSTICK is not set
 # CONFIG_INPUT_TOUCHSCREEN is not set
 CONFIG_INPUT_MISC=y
-# CONFIG_INPUT_PCSPKR is not set
 # CONFIG_INPUT_UINPUT is not set
 # CONFIG_HP_SDC_RTC is not set
 
@@ -542,6 +537,11 @@ CONFIG_GEN_RTC=y
 #
 # CONFIG_I2C is not set
 
+#
+# Dallas's 1-wire bus
+#
+# CONFIG_W1 is not set
+
 #
 # Misc devices
 #
@@ -560,8 +560,10 @@ CONFIG_GEN_RTC=y
 # Graphics support
 #
 CONFIG_FB=y
+# CONFIG_FB_CIRRUS is not set
 # CONFIG_FB_PM2 is not set
 # CONFIG_FB_CYBER2000 is not set
+# CONFIG_FB_ASILIANT is not set
 # CONFIG_FB_IMSTT is not set
 CONFIG_FB_STI=y
 # CONFIG_FB_RIVA is not set
@@ -587,7 +589,6 @@ CONFIG_DUMMY_CONSOLE_COLUMNS=160
 CONFIG_DUMMY_CONSOLE_ROWS=64
 CONFIG_DUMMY_CONSOLE=y
 CONFIG_FRAMEBUFFER_CONSOLE=y
-CONFIG_PCI_CONSOLE=y
 # CONFIG_FONTS is not set
 CONFIG_FONT_8x8=y
 CONFIG_FONT_8x16=y
@@ -645,7 +646,8 @@ CONFIG_JOLIET=y
 #
 # DOS/FAT/NT Filesystems
 #
-# CONFIG_FAT_FS is not set
+# CONFIG_MSDOS_FS is not set
+# CONFIG_VFAT_FS is not set
 # CONFIG_NTFS_FS is not set
 
 #
@@ -653,6 +655,7 @@ CONFIG_JOLIET=y
 #
 CONFIG_PROC_FS=y
 CONFIG_PROC_KCORE=y
+CONFIG_SYSFS=y
 # CONFIG_DEVPTS_FS_XATTR is not set
 CONFIG_TMPFS=y
 # CONFIG_HUGETLB_PAGE is not set
@@ -662,6 +665,7 @@ CONFIG_RAMFS=y
 # Miscellaneous filesystems
 #
 # CONFIG_HFSPLUS_FS is not set
+# CONFIG_JFFS2_COMPRESSION_OPTIONS is not set
 # CONFIG_CRAMFS is not set
 # CONFIG_VXFS_FS is not set
 # CONFIG_HPFS_FS is not set
@@ -676,6 +680,7 @@ CONFIG_NFS_FS=y
 CONFIG_NFS_V3=y
 CONFIG_NFSD=y
 CONFIG_NFSD_V3=y
+CONFIG_NFSD_TCP=y
 CONFIG_ROOT_NFS=y
 CONFIG_LOCKD=y
 CONFIG_LOCKD_V4=y
@@ -720,6 +725,7 @@ CONFIG_NLS_DEFAULT="iso8859-1"
 # CONFIG_NLS_ISO8859_8 is not set
 # CONFIG_NLS_CODEPAGE_1250 is not set
 # CONFIG_NLS_CODEPAGE_1251 is not set
+# CONFIG_NLS_ASCII is not set
 # CONFIG_NLS_ISO8859_1 is not set
 # CONFIG_NLS_ISO8859_2 is not set
 # CONFIG_NLS_ISO8859_3 is not set
@@ -741,6 +747,7 @@ CONFIG_NLS_DEFAULT="iso8859-1"
 CONFIG_DEBUG_KERNEL=y
 # CONFIG_DEBUG_SLAB is not set
 CONFIG_MAGIC_SYSRQ=y
+# CONFIG_DEBUG_SPINLOCK is not set
 CONFIG_FRAME_POINTER=y
 # CONFIG_DEBUG_INFO is not set
 
@@ -770,12 +777,16 @@ CONFIG_CRYPTO=y
 # CONFIG_CRYPTO_AES is not set
 # CONFIG_CRYPTO_CAST5 is not set
 # CONFIG_CRYPTO_CAST6 is not set
+# CONFIG_CRYPTO_TEA is not set
 # CONFIG_CRYPTO_ARC4 is not set
 # CONFIG_CRYPTO_DEFLATE is not set
 # CONFIG_CRYPTO_MICHAEL_MIC is not set
+# CONFIG_CRYPTO_CRC32C is not set
 # CONFIG_CRYPTO_TEST is not set
 
 #
 # Library routines
 #
+# CONFIG_CRC_CCITT is not set
 CONFIG_CRC32=y
+# CONFIG_LIBCRC32C is not set
diff --git a/arch/parisc/configs/c3000_defconfig b/arch/parisc/configs/c3000_defconfig
index a0252de6d..087dfcd1d 100644
--- a/arch/parisc/configs/c3000_defconfig
+++ b/arch/parisc/configs/c3000_defconfig
@@ -20,19 +20,23 @@ CONFIG_BROKEN_ON_SMP=y
 #
 CONFIG_SWAP=y
 CONFIG_SYSVIPC=y
+# CONFIG_POSIX_MQUEUE is not set
 # CONFIG_BSD_PROCESS_ACCT is not set
 CONFIG_SYSCTL=y
+# CONFIG_AUDIT is not set
 CONFIG_LOG_BUF_SHIFT=16
 CONFIG_HOTPLUG=y
 CONFIG_IKCONFIG=y
 CONFIG_IKCONFIG_PROC=y
 CONFIG_EMBEDDED=y
 CONFIG_KALLSYMS=y
+CONFIG_KALLSYMS_ALL=y
 CONFIG_FUTEX=y
 CONFIG_EPOLL=y
 CONFIG_IOSCHED_NOOP=y
 CONFIG_IOSCHED_AS=y
 CONFIG_IOSCHED_DEADLINE=y
+CONFIG_IOSCHED_CFQ=y
 # CONFIG_CC_OPTIMIZE_FOR_SIZE is not set
 
 #
@@ -51,8 +55,10 @@ CONFIG_KMOD=y
 # CONFIG_PA7000 is not set
 # CONFIG_PA7100LC is not set
 # CONFIG_PA7200 is not set
+# CONFIG_PA7300LC is not set
 CONFIG_PA8X00=y
 CONFIG_PA20=y
+CONFIG_PREFETCH=y
 # CONFIG_PARISC64 is not set
 # CONFIG_64BIT is not set
 # CONFIG_SMP is not set
@@ -70,7 +76,7 @@ CONFIG_PCI_LBA=y
 CONFIG_IOSAPIC=y
 CONFIG_IOMMU_SBA=y
 CONFIG_SUPERIO=y
-# CONFIG_CHASSIS_LCD_LED is not set
+CONFIG_CHASSIS_LCD_LED=y
 # CONFIG_PDC_CHASSIS is not set
 
 #
@@ -185,6 +191,7 @@ CONFIG_BLK_DEV_SIIMAGE=m
 # CONFIG_BLK_DEV_SLC90E66 is not set
 # CONFIG_BLK_DEV_TRM290 is not set
 # CONFIG_BLK_DEV_VIA82CXXX is not set
+# CONFIG_IDE_ARM is not set
 CONFIG_BLK_DEV_IDEDMA=y
 # CONFIG_IDEDMA_IVB is not set
 # CONFIG_IDEDMA_AUTO is not set
@@ -218,7 +225,7 @@ CONFIG_SCSI_REPORT_LUNS=y
 # SCSI Transport Attributes
 #
 CONFIG_SCSI_SPI_ATTRS=y
-# CONFIG_SCSI_FC_ATTRS is not set
+CONFIG_SCSI_FC_ATTRS=m
 
 #
 # SCSI low-level drivers
@@ -236,7 +243,9 @@ CONFIG_SCSI_SATA=y
 # CONFIG_SCSI_SATA_SVW is not set
 CONFIG_SCSI_ATA_PIIX=m
 CONFIG_SCSI_SATA_PROMISE=m
+# CONFIG_SCSI_SATA_SX4 is not set
 CONFIG_SCSI_SATA_SIL=m
+# CONFIG_SCSI_SATA_SIS is not set
 CONFIG_SCSI_SATA_VIA=m
 # CONFIG_SCSI_SATA_VITESSE is not set
 # CONFIG_SCSI_BUSLOGIC is not set
@@ -254,6 +263,7 @@ CONFIG_SCSI_SYM53C8XX_DMA_ADDRESSING_MODE=0
 CONFIG_SCSI_SYM53C8XX_DEFAULT_TAGS=16
 CONFIG_SCSI_SYM53C8XX_MAX_TAGS=64
 # CONFIG_SCSI_SYM53C8XX_IOMAPPED is not set
+# CONFIG_SCSI_IPR is not set
 # CONFIG_SCSI_PCI2000 is not set
 # CONFIG_SCSI_PCI2220I is not set
 # CONFIG_SCSI_QLOGIC_ISP is not set
@@ -279,6 +289,7 @@ CONFIG_SCSI_DEBUG=m
 # CONFIG_PCMCIA_FDOMAIN is not set
 # CONFIG_PCMCIA_NINJA_SCSI is not set
 CONFIG_PCMCIA_QLOGIC=m
+# CONFIG_PCMCIA_SYM53C500 is not set
 
 #
 # Multi-device support (RAID and LVM)
@@ -346,8 +357,6 @@ CONFIG_INET_ESP=m
 #
 # CONFIG_IP_VS is not set
 # CONFIG_IPV6 is not set
-# CONFIG_DECNET is not set
-# CONFIG_BRIDGE is not set
 CONFIG_NETFILTER=y
 CONFIG_NETFILTER_DEBUG=y
 
@@ -407,6 +416,7 @@ CONFIG_IP_NF_ARPFILTER=m
 CONFIG_IP_NF_ARP_MANGLE=m
 CONFIG_IP_NF_COMPAT_IPCHAINS=m
 CONFIG_IP_NF_COMPAT_IPFWADM=m
+# CONFIG_IP_NF_RAW is not set
 CONFIG_XFRM=y
 CONFIG_XFRM_USER=m
 
@@ -415,7 +425,9 @@ CONFIG_XFRM_USER=m
 #
 # CONFIG_IP_SCTP is not set
 # CONFIG_ATM is not set
+# CONFIG_BRIDGE is not set
 # CONFIG_VLAN_8021Q is not set
+# CONFIG_DECNET is not set
 CONFIG_LLC=m
 CONFIG_LLC2=m
 # CONFIG_IPX is not set
@@ -425,7 +437,6 @@ CONFIG_LLC2=m
 # 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
 
 #
@@ -437,18 +448,23 @@ CONFIG_LLC2=m
 # Network testing
 #
 # CONFIG_NET_PKTGEN is not set
+# CONFIG_NETPOLL is not set
+# CONFIG_NET_POLL_CONTROLLER is not set
+# CONFIG_HAMRADIO is not set
+# CONFIG_IRDA is not set
+# CONFIG_BT is not set
 CONFIG_NETDEVICES=y
-
-#
-# ARCnet devices
-#
-# CONFIG_ARCNET is not set
 CONFIG_DUMMY=m
 CONFIG_BONDING=m
 # CONFIG_EQUALIZER is not set
 CONFIG_TUN=m
 # CONFIG_ETHERTAP is not set
 
+#
+# ARCnet devices
+#
+# CONFIG_ARCNET is not set
+
 #
 # Ethernet (10 or 100Mbit)
 #
@@ -494,7 +510,6 @@ CONFIG_8139TOO=m
 # CONFIG_8139TOO_TUNE_TWISTER is not set
 # CONFIG_8139TOO_8129 is not set
 # CONFIG_8139_OLD_RX_RESET is not set
-CONFIG_8139_RXBUF_IDX=1
 # CONFIG_SIS900 is not set
 # CONFIG_EPIC100 is not set
 # CONFIG_SUNDANCE is not set
@@ -513,7 +528,6 @@ CONFIG_E1000=m
 # CONFIG_HAMACHI is not set
 # CONFIG_YELLOWFIN is not set
 # CONFIG_R8169 is not set
-# CONFIG_SIS190 is not set
 # CONFIG_SK98LIN is not set
 CONFIG_TIGON3=m
 
@@ -522,36 +536,17 @@ CONFIG_TIGON3=m
 #
 CONFIG_IXGB=y
 CONFIG_IXGB_NAPI=y
-# CONFIG_FDDI is not set
-# CONFIG_HIPPI is not set
-CONFIG_PPP=m
-# CONFIG_PPP_MULTILINK is not set
-# CONFIG_PPP_FILTER is not set
-CONFIG_PPP_ASYNC=m
-CONFIG_PPP_SYNC_TTY=m
-CONFIG_PPP_DEFLATE=m
-CONFIG_PPP_BSDCOMP=m
-CONFIG_PPPOE=m
-# CONFIG_SLIP is not set
-
-#
-# Wireless LAN (non-hamradio)
-#
-# CONFIG_NET_RADIO is not set
+# CONFIG_S2IO 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
-# CONFIG_NETCONSOLE is not set
 
 #
-# Wan interfaces
+# Wireless LAN (non-hamradio)
 #
-# CONFIG_WAN is not set
+# CONFIG_NET_RADIO is not set
 
 #
 # PCMCIA network device support
@@ -567,21 +562,23 @@ CONFIG_PCMCIA_XIRC2PS=m
 CONFIG_PCMCIA_AXNET=m
 
 #
-# Amateur Radio support
-#
-# CONFIG_HAMRADIO is not set
-
-#
-# IrDA (infrared) support
-#
-# CONFIG_IRDA is not set
-
-#
-# Bluetooth support
+# Wan interfaces
 #
-# CONFIG_BT is not set
-# CONFIG_NETPOLL is not set
-# CONFIG_NET_POLL_CONTROLLER is not set
+# CONFIG_WAN is not set
+# CONFIG_FDDI is not set
+# CONFIG_HIPPI is not set
+CONFIG_PPP=m
+# CONFIG_PPP_MULTILINK is not set
+# CONFIG_PPP_FILTER is not set
+CONFIG_PPP_ASYNC=m
+CONFIG_PPP_SYNC_TTY=m
+CONFIG_PPP_DEFLATE=m
+CONFIG_PPP_BSDCOMP=m
+CONFIG_PPPOE=m
+# CONFIG_SLIP is not set
+# CONFIG_NET_FC is not set
+# CONFIG_SHAPER is not set
+# CONFIG_NETCONSOLE is not set
 
 #
 # ISDN subsystem
@@ -728,6 +725,7 @@ CONFIG_FB=y
 # CONFIG_FB_CIRRUS is not set
 # CONFIG_FB_PM2 is not set
 # CONFIG_FB_CYBER2000 is not set
+# CONFIG_FB_ASILIANT is not set
 # CONFIG_FB_IMSTT is not set
 CONFIG_FB_STI=y
 # CONFIG_FB_RIVA is not set
@@ -834,6 +832,7 @@ CONFIG_USB_WACOM=m
 CONFIG_USB_KBTAB=m
 # CONFIG_USB_POWERMATE is not set
 # CONFIG_USB_MTOUCH is not set
+# CONFIG_USB_EGALAX is not set
 # CONFIG_USB_XPAD is not set
 # CONFIG_USB_ATI_REMOTE is not set
 
@@ -882,6 +881,8 @@ CONFIG_USB_HPUSBSCSI=m
 CONFIG_USB_LEGOTOWER=m
 # CONFIG_USB_LCD is not set
 # CONFIG_USB_LED is not set
+# CONFIG_USB_CYTHERM is not set
+# CONFIG_USB_PHIDGETSERVO is not set
 # CONFIG_USB_TEST is not set
 
 #
@@ -932,6 +933,7 @@ CONFIG_VFAT_FS=m
 #
 CONFIG_PROC_FS=y
 CONFIG_PROC_KCORE=y
+CONFIG_SYSFS=y
 # CONFIG_DEVFS_FS is not set
 # CONFIG_DEVPTS_FS_XATTR is not set
 CONFIG_TMPFS=y
@@ -977,7 +979,6 @@ CONFIG_SUNRPC=y
 # CONFIG_CIFS is not set
 # CONFIG_NCP_FS is not set
 # CONFIG_CODA_FS is not set
-# CONFIG_INTERMEZZO_FS is not set
 # CONFIG_AFS_FS is not set
 
 #
@@ -1070,11 +1071,13 @@ CONFIG_CRYPTO_CAST6=m
 # CONFIG_CRYPTO_ARC4 is not set
 CONFIG_CRYPTO_DEFLATE=m
 # CONFIG_CRYPTO_MICHAEL_MIC is not set
+CONFIG_CRYPTO_CRC32C=m
 CONFIG_CRYPTO_TEST=m
 
 #
 # Library routines
 #
 CONFIG_CRC32=y
+CONFIG_LIBCRC32C=m
 CONFIG_ZLIB_INFLATE=m
 CONFIG_ZLIB_DEFLATE=m
diff --git a/arch/parisc/defconfig b/arch/parisc/defconfig
index 07c13f7c0..ebd6301aa 100644
--- a/arch/parisc/defconfig
+++ b/arch/parisc/defconfig
@@ -290,7 +290,6 @@ CONFIG_IPV6_SCTP__=y
 # 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
 
 #
@@ -889,6 +888,8 @@ CONFIG_OPROFILE=y
 CONFIG_DEBUG_KERNEL=y
 # CONFIG_DEBUG_SLAB is not set
 CONFIG_MAGIC_SYSRQ=y
+# CONFIG_DEBUG_SPINLOCK is not set
+# CONFIG_DEBUG_RWLOCK is not set
 CONFIG_FRAME_POINTER=y
 # CONFIG_DEBUG_INFO is not set
 
diff --git a/arch/parisc/kernel/cache.c b/arch/parisc/kernel/cache.c
index 9fc061440..eadc88c5a 100644
--- a/arch/parisc/kernel/cache.c
+++ b/arch/parisc/kernel/cache.c
@@ -69,7 +69,7 @@ update_mmu_cache(struct vm_area_struct *vma, unsigned long address, pte_t pte)
 {
 	struct page *page = pte_page(pte);
 
-	if (VALID_PAGE(page) && page_mapping(page) &&
+	if (pfn_valid(page_to_pfn(page)) && page_mapping(page) &&
 	    test_bit(PG_dcache_dirty, &page->flags)) {
 
 		flush_kernel_dcache_page(page_address(page));
@@ -82,10 +82,11 @@ show_cache_info(struct seq_file *m)
 {
 	seq_printf(m, "I-cache\t\t: %ld KB\n", 
 		cache_info.ic_size/1024 );
-	seq_printf(m, "D-cache\t\t: %ld KB (%s)%s\n", 
+	seq_printf(m, "D-cache\t\t: %ld KB (%s%s, %d-way associative)\n", 
 		cache_info.dc_size/1024,
 		(cache_info.dc_conf.cc_wt ? "WT":"WB"),
-		(cache_info.dc_conf.cc_sh ? " - shared I/D":"")
+		(cache_info.dc_conf.cc_sh ? ", shared I/D":""),
+		(cache_info.dc_conf.cc_assoc)
 	);
 
 	seq_printf(m, "ITLB entries\t: %ld\n" "DTLB entries\t: %ld%s\n",
@@ -123,51 +124,60 @@ parisc_cache_init(void)
 		panic("parisc_cache_init: pdc_cache_info failed");
 
 #if 0
-	printk(KERN_DEBUG "ic_size %lx dc_size %lx it_size %lx pdc_cache_info %d*long pdc_cache_cf %d\n",
-	    cache_info.ic_size,
-	    cache_info.dc_size,
-	    cache_info.it_size,
-	    sizeof (struct pdc_cache_info) / sizeof (long),
-	    sizeof (struct pdc_cache_cf)
-	);
-
-	printk(KERN_DEBUG "dc base %x dc stride %x dc count %x dc loop %d\n",
-	    cache_info.dc_base,
-	    cache_info.dc_stride,
-	    cache_info.dc_count,
-	    cache_info.dc_loop);
-
-	printk(KERN_DEBUG "dc conf: alias %d block %d line %d wt %d sh %d cst %d assoc %d\n",
-	    cache_info.dc_conf.cc_alias,
-	    cache_info.dc_conf.cc_block,
-	    cache_info.dc_conf.cc_line,
-	    cache_info.dc_conf.cc_wt,
-	    cache_info.dc_conf.cc_sh,
-	    cache_info.dc_conf.cc_cst,
-	    cache_info.dc_conf.cc_assoc);
-
-	printk(KERN_DEBUG "ic conf: alias %d block %d line %d wt %d sh %d cst %d assoc %d\n",
-	    cache_info.ic_conf.cc_alias,
-	    cache_info.ic_conf.cc_block,
-	    cache_info.ic_conf.cc_line,
-	    cache_info.ic_conf.cc_wt,
-	    cache_info.ic_conf.cc_sh,
-	    cache_info.ic_conf.cc_cst,
-	    cache_info.ic_conf.cc_assoc);
-
-	printk(KERN_DEBUG "dt conf: sh %d page %d cst %d aid %d pad1 %d \n",
-	    cache_info.dt_conf.tc_sh,
-	    cache_info.dt_conf.tc_page,
-	    cache_info.dt_conf.tc_cst,
-	    cache_info.dt_conf.tc_aid,
-	    cache_info.dt_conf.tc_pad1);
-
-	printk(KERN_DEBUG "it conf: sh %d page %d cst %d aid %d pad1 %d \n",
-	    cache_info.it_conf.tc_sh,
-	    cache_info.it_conf.tc_page,
-	    cache_info.it_conf.tc_cst,
-	    cache_info.it_conf.tc_aid,
-	    cache_info.it_conf.tc_pad1);
+	printk("ic_size %lx dc_size %lx it_size %lx\n",
+		cache_info.ic_size,
+		cache_info.dc_size,
+		cache_info.it_size);
+
+	printk("DC  base 0x%lx stride 0x%lx count 0x%lx loop 0x%lx\n",
+		cache_info.dc_base,
+		cache_info.dc_stride,
+		cache_info.dc_count,
+		cache_info.dc_loop);
+
+	printk("dc_conf = 0x%lx  alias %d blk %d line %d shift %d\n",
+		*(unsigned long *) (&cache_info.dc_conf),
+		cache_info.dc_conf.cc_alias,
+		cache_info.dc_conf.cc_block,
+		cache_info.dc_conf.cc_line,
+		cache_info.dc_conf.cc_shift);
+	printk("	wt %d sh %d cst %d assoc %d\n",
+		cache_info.dc_conf.cc_wt,
+		cache_info.dc_conf.cc_sh,
+		cache_info.dc_conf.cc_cst,
+		cache_info.dc_conf.cc_assoc);
+
+	printk("IC  base 0x%lx stride 0x%lx count 0x%lx loop 0x%lx\n",
+		cache_info.ic_base,
+		cache_info.ic_stride,
+		cache_info.ic_count,
+		cache_info.ic_loop);
+
+	printk("ic_conf = 0x%lx  alias %d blk %d line %d shift %d\n",
+		*(unsigned long *) (&cache_info.ic_conf),
+		cache_info.ic_conf.cc_alias,
+		cache_info.ic_conf.cc_block,
+		cache_info.ic_conf.cc_line,
+		cache_info.ic_conf.cc_shift);
+	printk("	wt %d sh %d cst %d assoc %d\n",
+		cache_info.ic_conf.cc_wt,
+		cache_info.ic_conf.cc_sh,
+		cache_info.ic_conf.cc_cst,
+		cache_info.ic_conf.cc_assoc);
+
+	printk("D-TLB conf: sh %d page %d cst %d aid %d pad1 %d \n",
+		cache_info.dt_conf.tc_sh,
+		cache_info.dt_conf.tc_page,
+		cache_info.dt_conf.tc_cst,
+		cache_info.dt_conf.tc_aid,
+		cache_info.dt_conf.tc_pad1);
+
+	printk("I-TLB conf: sh %d page %d cst %d aid %d pad1 %d \n",
+		cache_info.it_conf.tc_sh,
+		cache_info.it_conf.tc_page,
+		cache_info.it_conf.tc_cst,
+		cache_info.it_conf.tc_aid,
+		cache_info.it_conf.tc_pad1);
 #endif
 
 	split_tlb = 0;
@@ -179,10 +189,14 @@ parisc_cache_init(void)
 		split_tlb = 1;
 	}
 
-	dcache_stride = (1 << (cache_info.dc_conf.cc_block + 3)) *
-						cache_info.dc_conf.cc_line;
-	icache_stride = (1 << (cache_info.ic_conf.cc_block + 3)) *
-						cache_info.ic_conf.cc_line;
+	/* "New and Improved" version from Jim Hull 
+	 *	(1 << (cc_block-1)) * (cc_line << (4 + cnf.cc_shift))
+	 */
+#define CAFL_STRIDE(cnf) (cnf.cc_line << (3 + cnf.cc_block + cnf.cc_shift))
+	dcache_stride = CAFL_STRIDE(cache_info.dc_conf);
+	icache_stride = CAFL_STRIDE(cache_info.ic_conf);
+#undef CAFL_STRIDE
+
 #ifndef CONFIG_PA20
 	if (pdc_btlb_info(&btlb_info) < 0) {
 		memset(&btlb_info, 0, sizeof btlb_info);
@@ -191,8 +205,8 @@ parisc_cache_init(void)
 
 	if ((boot_cpu_data.pdc.capabilities & PDC_MODEL_NVA_MASK) ==
 						PDC_MODEL_NVA_UNSUPPORTED) {
-		printk(KERN_WARNING "Only equivalent aliasing supported\n");
-#ifndef CONFIG_SMP
+		printk(KERN_WARNING "parisc_cache_init: Only equivalent aliasing supported!\n");
+#if 0
 		panic("SMP kernel required to avoid non-equivalent aliasing");
 #endif
 	}
@@ -228,7 +242,7 @@ void disable_sr_hashing(void)
 	disable_sr_hashing_asm(srhash_type);
 }
 
-void __flush_dcache_page(struct page *page)
+void flush_dcache_page(struct page *page)
 {
 	struct address_space *mapping = page_mapping(page);
 	struct vm_area_struct *mpnt = NULL;
@@ -236,6 +250,14 @@ void __flush_dcache_page(struct page *page)
 	unsigned long offset;
 	unsigned long addr;
 	pgoff_t pgoff;
+	pte_t *pte;
+	unsigned long pfn = page_to_pfn(page);
+
+
+	if (mapping && !mapping_mapped(mapping)) {
+		set_bit(PG_dcache_dirty, &page->flags);
+		return;
+	}
 
 	flush_kernel_dcache_page(page_address(page));
 
@@ -262,16 +284,23 @@ void __flush_dcache_page(struct page *page)
 		 * isn't there, there's no point exciting the
 		 * nadtlb handler into a nullification frenzy */
 
-		if (!translation_exists(mpnt, addr))
+
+  		if(!(pte = translation_exists(mpnt, addr)))
 			continue;
 
+		/* make sure we really have this page: the private
+		 * mappings may cover this area but have COW'd this
+		 * particular page */
+		if(pte_pfn(*pte) != pfn)
+  			continue;
+
 		__flush_cache_page(mpnt, addr);
 
 		break;
 	}
 	flush_dcache_mmap_unlock(mapping);
 }
-EXPORT_SYMBOL(__flush_dcache_page);
+EXPORT_SYMBOL(flush_dcache_page);
 
 /* Defined in arch/parisc/kernel/pacache.S */
 EXPORT_SYMBOL(flush_kernel_dcache_range_asm);
diff --git a/arch/parisc/kernel/entry.S b/arch/parisc/kernel/entry.S
index 9c284947d..baee63278 100644
--- a/arch/parisc/kernel/entry.S
+++ b/arch/parisc/kernel/entry.S
@@ -455,20 +455,28 @@
 	/* Look up a PTE in a 2-Level scheme (faulting at each
 	 * level if the entry isn't present 
 	 *
-	 * NOTE: we use ldw even for LP64 because our pte
-	 * and pmd are allocated <4GB */
+	 * NOTE: we use ldw even for LP64, since the short pointers
+	 * can address up to 1TB
+	 */
 	.macro		L2_ptep	pmd,pte,index,va,fault
 #if PT_NLEVELS == 3
 	EXTR		\va,31-ASM_PMD_SHIFT,ASM_BITS_PER_PMD,\index
 #else
 	EXTR		\va,31-ASM_PGDIR_SHIFT,ASM_BITS_PER_PGD,\index
 #endif
-	DEP		%r0,31,PAGE_SHIFT,\pmd	/* clear offset */
+	DEP             %r0,31,PAGE_SHIFT,\pmd  /* clear offset */
 	copy		%r0,\pte
 	ldw,s		\index(\pmd),\pmd
+	bb,>=,n		\pmd,_PxD_PRESENT_BIT,\fault
+	DEP		%r0,31,PxD_FLAG_SHIFT,\pmd /* clear flags */
+	copy		\pmd,%r9
+#ifdef __LP64__
+	shld		%r9,PxD_VALUE_SHIFT,\pmd
+#else
+	shlw		%r9,PxD_VALUE_SHIFT,\pmd
+#endif
 	EXTR		\va,31-PAGE_SHIFT,ASM_BITS_PER_PTE,\index
-	bb,>=,n		\pmd,_PAGE_PRESENT_BIT,\fault
-	DEP		%r0,31,PAGE_SHIFT,\pmd	/* clear offset */
+	DEP		%r0,31,PAGE_SHIFT,\pmd  /* clear offset */
 	shladd		\index,BITS_PER_PTE_ENTRY,\pmd,\pmd
 	LDREG		%r0(\pmd),\pte		/* pmd is now pte */
 	bb,>=,n		\pte,_PAGE_PRESENT_BIT,\fault
@@ -489,10 +497,14 @@
 	copy		%r0,\pte
 	extrd,u,*=	\va,31,32,%r0
 	ldw,s		\index(\pgd),\pgd
+	extrd,u,*=	\va,31,32,%r0
+	bb,>=,n		\pgd,_PxD_PRESENT_BIT,\fault
+	extrd,u,*=	\va,31,32,%r0
+	shld		\pgd,PxD_VALUE_SHIFT,\index
+	extrd,u,*=	\va,31,32,%r0
+	copy		\index,\pgd
 	extrd,u,*<>	\va,31,32,%r0
 	ldo		ASM_PGD_PMD_OFFSET(\pgd),\pgd
-	extrd,u,*=	\va,31,32,%r0
-	bb,>=,n		\pgd,_PAGE_PRESENT_BIT,\fault
 	L2_ptep		\pgd,\pte,\index,\va,\fault
 	.endm
 
@@ -507,7 +519,7 @@
 
 	/* Set the dirty bit (and accessed bit).  No need to be
 	 * clever, this is only used from the dirty fault */
-	.macro		update_dirty	ptep,pte,tmp,tmp1
+	.macro		update_dirty	ptep,pte,tmp
 	ldi		_PAGE_ACCESSED|_PAGE_DIRTY,\tmp
 	or		\tmp,\pte,\pte
 	STREG		\pte,0(\ptep)
@@ -783,7 +795,7 @@ __kernel_thread:
 ret_from_kernel_thread:
 
 	/* Call schedule_tail first though */
-	bl	schedule_tail, %r2
+	BL	schedule_tail, %r2
 	nop
 
 	LDREG	TI_TASK-THREAD_SZ_ALGN(%r30), %r1
@@ -1441,14 +1453,14 @@ nadtlb_emulate:
 	and             %r9,%r16,%r17
 	cmpb,<>,n       %r16,%r17,nadtlb_fault /* Not fdc,fic,pdc */
 	bb,>=,n         %r9,26,nadtlb_nullify  /* m bit not set, just nullify */
-	b,l             get_register,%r25
+	BL		get_register,%r25
 	extrw,u         %r9,15,5,%r8           /* Get index register # */
 	CMPIB=,n        -1,%r1,nadtlb_fault    /* have to use slow path */
 	copy            %r1,%r24
-	b,l             get_register,%r25
+	BL		get_register,%r25
 	extrw,u         %r9,10,5,%r8           /* Get base register # */
 	CMPIB=,n        -1,%r1,nadtlb_fault    /* have to use slow path */
-	b,l             set_register,%r25
+	BL		set_register,%r25
 	add,l           %r1,%r24,%r1           /* doesn't affect c/b bits */
 
 nadtlb_nullify:
@@ -1548,7 +1560,7 @@ dbit_spin_20w:
 
 dbit_nolock_20w:
 #endif
-	update_dirty	ptp,pte,t0,t1
+	update_dirty	ptp,pte,t1
 
 	make_insert_tlb	spc,pte,prot
 		
@@ -1585,7 +1597,7 @@ dbit_spin_11:
 
 dbit_nolock_11:
 #endif
-	update_dirty	ptp,pte,t0,t1
+	update_dirty	ptp,pte,t1
 
 	make_insert_tlb_11	spc,pte,prot
 
@@ -1626,11 +1638,11 @@ dbit_spin_20:
 
 dbit_nolock_20:
 #endif
-	update_dirty	ptp,pte,t0,t1
+	update_dirty	ptp,pte,t1
 
 	make_insert_tlb	spc,pte,prot
 
-	f_extend	pte,t0
+	f_extend	pte,t1
 	
         idtlbt          pte,prot
 
diff --git a/arch/parisc/kernel/firmware.c b/arch/parisc/kernel/firmware.c
index 8127a7098..6ab67aadd 100644
--- a/arch/parisc/kernel/firmware.c
+++ b/arch/parisc/kernel/firmware.c
@@ -65,6 +65,7 @@
 
 #include <asm/page.h>
 #include <asm/pdc.h>
+#include <asm/pdcpat.h>
 #include <asm/system.h>
 #include <asm/processor.h>	/* for boot_cpu_data */
 
@@ -176,7 +177,9 @@ void __init set_firmware_width(void)
  */
 void pdc_emergency_unlock(void)
 {
-        spin_unlock(&pdc_lock);
+ 	/* Spinlock DEBUG code freaks out if we unconditionally unlock */
+        if (spin_is_locked(&pdc_lock))
+		spin_unlock(&pdc_lock);
 }
 
 
@@ -234,11 +237,11 @@ int __init pdc_chassis_info(struct pdc_chassis_info *chassis_info, void *led_inf
 #ifdef __LP64__
 int pdc_pat_chassis_send_log(unsigned long state, unsigned long data)
 {
+	int retval = 0;
+        
 	if (!is_pdc_pat())
 		return -1;
 
-	int retval = 0;
-
 	spin_lock_irq(&pdc_lock);
 	retval = mem_pdc_call(PDC_PAT_CHASSIS_LOG, PDC_PAT_CHASSIS_WRITE_LOG, __pa(&state), __pa(&data));
 	spin_unlock_irq(&pdc_lock);
@@ -1146,6 +1149,49 @@ int pdc_pat_pd_get_addr_map(unsigned long *actual_len, void *mem_addr,
 
 	return retval;
 }
+
+/**
+ * pdc_pat_io_pci_cfg_read - Read PCI configuration space.
+ * @pci_addr: PCI configuration space address for which the read request is being made.
+ * @pci_size: Size of read in bytes. Valid values are 1, 2, and 4. 
+ * @mem_addr: Pointer to return memory buffer.
+ *
+ */
+int pdc_pat_io_pci_cfg_read(unsigned long pci_addr, int pci_size, u32 *mem_addr)
+{
+	int retval;
+	spin_lock_irq(&pdc_lock);
+	retval = mem_pdc_call(PDC_PAT_IO, PDC_PAT_IO_PCI_CONFIG_READ,
+					__pa(pdc_result), pci_addr, pci_size);
+	switch(pci_size) {
+		case 1: *(u8 *) mem_addr =  (u8)  pdc_result[0];
+		case 2: *(u16 *)mem_addr =  (u16) pdc_result[0];
+		case 4: *(u32 *)mem_addr =  (u32) pdc_result[0];
+	}
+	spin_unlock_irq(&pdc_lock);
+
+	return retval;
+}
+
+/**
+ * pdc_pat_io_pci_cfg_write - Retrieve information about memory address ranges.
+ * @pci_addr: PCI configuration space address for which the write  request is being made.
+ * @pci_size: Size of write in bytes. Valid values are 1, 2, and 4. 
+ * @value: Pointer to 1, 2, or 4 byte value in low order end of argument to be 
+ *         written to PCI Config space.
+ *
+ */
+int pdc_pat_io_pci_cfg_write(unsigned long pci_addr, int pci_size, u32 val)
+{
+	int retval;
+
+	spin_lock_irq(&pdc_lock);
+	retval = mem_pdc_call(PDC_PAT_IO, PDC_PAT_IO_PCI_CONFIG_WRITE,
+				pci_addr, pci_size, val);
+	spin_unlock_irq(&pdc_lock);
+
+	return retval;
+}
 #endif /* __LP64__ */
 
 
@@ -1230,29 +1276,29 @@ struct wide_stack {
 long real64_call(unsigned long fn, ...)
 {
 	va_list args;
-	extern struct wide_stack real_stack;
+	extern struct wide_stack real64_stack __attribute__ ((alias ("real_stack")));
 	extern unsigned long real64_call_asm(unsigned long *,
 					     unsigned long *, 
 					     unsigned long);
     
 	va_start(args, fn);
-	real_stack.arg0 = va_arg(args, unsigned long);
-	real_stack.arg1 = va_arg(args, unsigned long);
-	real_stack.arg2 = va_arg(args, unsigned long);
-	real_stack.arg3 = va_arg(args, unsigned long);
-	real_stack.arg4 = va_arg(args, unsigned long);
-	real_stack.arg5 = va_arg(args, unsigned long);
-	real_stack.arg6 = va_arg(args, unsigned long);
-	real_stack.arg7 = va_arg(args, unsigned long);
-	real_stack.arg8 = va_arg(args, unsigned long);
-	real_stack.arg9 = va_arg(args, unsigned long);
-	real_stack.arg10 = va_arg(args, unsigned long);
-	real_stack.arg11 = va_arg(args, unsigned long);
-	real_stack.arg12 = va_arg(args, unsigned long);
-	real_stack.arg13 = va_arg(args, unsigned long);
+	real64_stack.arg0 = va_arg(args, unsigned long);
+	real64_stack.arg1 = va_arg(args, unsigned long);
+	real64_stack.arg2 = va_arg(args, unsigned long);
+	real64_stack.arg3 = va_arg(args, unsigned long);
+	real64_stack.arg4 = va_arg(args, unsigned long);
+	real64_stack.arg5 = va_arg(args, unsigned long);
+	real64_stack.arg6 = va_arg(args, unsigned long);
+	real64_stack.arg7 = va_arg(args, unsigned long);
+	real64_stack.arg8 = va_arg(args, unsigned long);
+	real64_stack.arg9 = va_arg(args, unsigned long);
+	real64_stack.arg10 = va_arg(args, unsigned long);
+	real64_stack.arg11 = va_arg(args, unsigned long);
+	real64_stack.arg12 = va_arg(args, unsigned long);
+	real64_stack.arg13 = va_arg(args, unsigned long);
 	va_end(args);
 	
-	return real64_call_asm(&real_stack.sp, &real_stack.arg0, fn);
+	return real64_call_asm(&real64_stack.sp, &real64_stack.arg0, fn);
 }
 
 #endif /* __LP64__ */
diff --git a/arch/parisc/kernel/hardware.c b/arch/parisc/kernel/hardware.c
index b423e7d79..6b65bf468 100644
--- a/arch/parisc/kernel/hardware.c
+++ b/arch/parisc/kernel/hardware.c
@@ -263,6 +263,17 @@ static struct hp_hardware hp_hardware_list[] __initdata = {
 	{HPHW_NPROC,0x67E,0x4,0x81,"Hitachi Tiny 80"},
 	{HPHW_NPROC,0x67F,0x4,0x81,"Hitachi Tiny 64"},
 	{HPHW_NPROC,0x700,0x4,0x91,"NEC Aska Processor"},
+	{HPHW_NPROC,0x880,0x4,0x91,"Orca Mako"},
+	{HPHW_NPROC,0x881,0x4,0x91,"Everest Mako"},
+	{HPHW_NPROC,0x882,0x4,0x91,"Rainier/Medel Mako Slow"},
+	{HPHW_NPROC,0x883,0x4,0x91,"Rainier/Medel Mako Fast"},
+	{HPHW_NPROC,0x884,0x4,0x91,"Mt. Hamilton"},
+	{HPHW_NPROC,0x885,0x4,0x91,"Mt. Hamilton DC-"},
+	{HPHW_NPROC,0x886,0x4,0x91,"Storm Peak Slow DC-"},
+	{HPHW_NPROC,0x887,0x4,0x91,"Storm Peak Slow"},
+	{HPHW_NPROC,0x888,0x4,0x91,"Storm Peak Fast DC-"},
+	{HPHW_NPROC,0x889,0x4,0x91,"Storm Peak Fast"},
+	{HPHW_NPROC,0x88A,0x4,0x91,"Crestone Peak"},
 	{HPHW_A_DIRECT, 0x004, 0x0000D, 0x00, "Arrakis MUX"}, 
 	{HPHW_A_DIRECT, 0x005, 0x0000D, 0x00, "Dyun Kiuh MUX"}, 
 	{HPHW_A_DIRECT, 0x006, 0x0000D, 0x00, "Baat Kiuh AP/MUX (40299B)"}, 
@@ -535,14 +546,17 @@ static struct hp_hardware hp_hardware_list[] __initdata = {
 	{HPHW_BCPORT, 0x800, 0x0000C, 0x10, "DEW BC Merced Port"}, 
 	{HPHW_BCPORT, 0x801, 0x0000C, 0x10, "SMC Bus Interface Merced Bus0"}, 
 	{HPHW_BCPORT, 0x802, 0x0000C, 0x10, "SMC Bus INterface Merced Bus1"}, 
-	{HPHW_BCPORT, 0x803, 0x0000C, 0x10, "IKE I/O Bus Converter Merced Port"}, 
-	{HPHW_BCPORT, 0x781, 0x0000C, 0x00, "IKE I/O Bus Converter Ropes Port"}, 
-	{HPHW_BCPORT, 0x804, 0x0000C, 0x10, "REO I/O Bus Converter Merced Port"}, 
-	{HPHW_BCPORT, 0x782, 0x0000C, 0x00, "REO I/O Bus Converter Ropes Port"}, 
+	{HPHW_BCPORT, 0x803, 0x0000C, 0x10, "IKE I/O BC Merced Port"}, 
+	{HPHW_BCPORT, 0x781, 0x0000C, 0x00, "IKE I/O BC Ropes Port"}, 
+	{HPHW_BCPORT, 0x804, 0x0000C, 0x10, "REO I/O BC Merced Port"}, 
+	{HPHW_BCPORT, 0x782, 0x0000C, 0x00, "REO I/O BC Ropes Port"}, 
+	{HPHW_BCPORT, 0x784, 0x0000C, 0x00, "Pluto I/O BC Ropes Port"}, 
 	{HPHW_BRIDGE, 0x680, 0x0000A, 0x00, "Dino PCI Bridge"}, 
 	{HPHW_BRIDGE, 0x682, 0x0000A, 0x00, "Cujo PCI Bridge"}, 
 	{HPHW_BRIDGE, 0x782, 0x0000A, 0x00, "Elroy PCI Bridge"}, 
 	{HPHW_BRIDGE, 0x583, 0x000A5, 0x00, "Saga PCI Bridge"}, 
+	{HPHW_BRIDGE, 0x783, 0x0000A, 0x00, "Mercury PCI Bridge"}, 
+	{HPHW_BRIDGE, 0x784, 0x0000A, 0x00, "Quicksilver AGP Bridge"}, 
 	{HPHW_B_DMA, 0x004, 0x00018, 0x00, "Parallel I/O"}, 
 	{HPHW_B_DMA, 0x004, 0x00019, 0x00, "Parallel RDB"}, 
 	{HPHW_B_DMA, 0x004, 0x00020, 0x80, "MID_BUS PSI"}, 
@@ -1181,15 +1195,18 @@ static struct hp_hardware hp_hardware_list[] __initdata = {
 	{HPHW_IOA, 0x581, 0x0000B, 0x10, "Uturn-IOA BC Runway Port"},
 	{HPHW_IOA, 0x582, 0x0000B, 0x10, "Astro BC Runway Port"},
 	{HPHW_IOA, 0x700, 0x0000B, 0x00, "NEC-IOS BC System Bus Port"},
+	{HPHW_IOA, 0x880, 0x0000C, 0x10, "Pluto BC McKinley Port"},
 	{HPHW_MEMORY, 0x002, 0x00008, 0x00, "MID_BUS"}, 
 	{HPHW_MEMORY, 0x063, 0x00009, 0x00, "712/132 L2 Upgrade"}, 
 	{HPHW_MEMORY, 0x064, 0x00009, 0x00, "712/160 L2 Upgrade"}, 
 	{HPHW_MEMORY, 0x065, 0x00009, 0x00, "715/132 L2 Upgrade"}, 
 	{HPHW_MEMORY, 0x066, 0x00009, 0x00, "715/160 L2 Upgrade"},
+	{HPHW_MEMORY, 0x0AF, 0x00009, 0x00, "Everest Mako Memory"},
 	{HPHW_OTHER, 0x004, 0x00030, 0x00, "Master"}, 
 	{HPHW_OTHER, 0x004, 0x00034, 0x00, "Slave"}, 
 	{HPHW_OTHER, 0x004, 0x00038, 0x00, "EDU"}, 
 	{HPHW_OTHER, 0x004, 0x00049, 0x00, "LGB Control"}, 
+	{HPHW_MC, 0x004, 0x000C0, 0x00, "BMC IPMI Mgmt Ctlr"}, 
 	{HPHW_FAULTY, 0, }  /* Special Marker for last entry */
 };
 
@@ -1290,7 +1307,7 @@ char *cpu_name_version[][2] = {
 	[pcxw]	{ "PA8500 (PCX-W)",	"2.0" },
 	[pcxw_]	{ "PA8600 (PCX-W+)",	"2.0" },
 	[pcxw2]	{ "PA8700 (PCX-W2)",	"2.0" },
-	[mako]	{ "PA8800 (MAKO)",	"2.0" }
+	[mako]	{ "PA8800 (Mako)",	"2.0" }
 };
 
 const char * __init
diff --git a/arch/parisc/kernel/head.S b/arch/parisc/kernel/head.S
index 0297d4164..a3525f1e5 100644
--- a/arch/parisc/kernel/head.S
+++ b/arch/parisc/kernel/head.S
@@ -76,7 +76,8 @@ $bss_loop:
 	/* Initialize startup VM. Just map first 8 MB of memory */
 	ldil		L%PA(pg0),%r1
 	ldo		R%PA(pg0)(%r1),%r1
-	ldo		_PAGE_TABLE(%r1),%r3
+	shr		%r1,PxD_VALUE_SHIFT,%r3
+	ldo		(PxD_FLAG_PRESENT+PxD_FLAG_VALID)(%r3),%r3
 
 	ldil		L%PA(swapper_pg_dir),%r4
 	ldo		R%PA(swapper_pg_dir)(%r4),%r4
@@ -86,7 +87,7 @@ $bss_loop:
 	ldo		ASM_PGD_ENTRY*ASM_PGD_ENTRY_SIZE(%r4),%r4
 1:
 	stw             %r3,0(%r4)
-	ldo		ASM_PAGE_SIZE(%r3),%r3
+	ldo		(ASM_PAGE_SIZE >> PxD_VALUE_SHIFT)(%r3),%r3
 	addib,>		-1,%r1,1b
 	ldo		ASM_PGD_ENTRY_SIZE(%r4),%r4
 
@@ -266,6 +267,8 @@ smp_slave_stext:
 	ldil		L%PA(smp_init_current_idle_task),%sp
 	ldo		R%PA(smp_init_current_idle_task)(%sp),%sp
 	ldw		0(%sp),%sp	/* load task address */
+	tophys_r1	%sp
+	ldw		TASK_THREAD_INFO(%sp), %sp
 	mtctl           %sp,%cr30       /* store in cr30 */
 	addil		L%THREAD_SZ_ALGN,%sp	/* stack is above task */
 	ldo		R%THREAD_SZ_ALGN(%r1),%sp
diff --git a/arch/parisc/kernel/head64.S b/arch/parisc/kernel/head64.S
index 78d8bad2e..587a339a2 100644
--- a/arch/parisc/kernel/head64.S
+++ b/arch/parisc/kernel/head64.S
@@ -80,7 +80,8 @@ $bss_loop:
 
 	ldil		L%PA(pmd0),%r5
 	ldo		R%PA(pmd0)(%r5),%r5
-	ldo		_PAGE_TABLE(%r5),%r3
+	shrd		%r5,PxD_VALUE_SHIFT,%r3
+	ldo		(PxD_FLAG_PRESENT+PxD_FLAG_VALID)(%r3),%r3
 
 	ldil		L%PA(swapper_pg_dir),%r4
 	ldo		R%PA(swapper_pg_dir)(%r4),%r4
@@ -90,16 +91,17 @@ $bss_loop:
 
 	stw             %r3,ASM_PGD_ENTRY*ASM_PGD_ENTRY_SIZE(%r4)
 
-	ldo		_PAGE_TABLE(%r1),%r3
+	shrd		%r1,PxD_VALUE_SHIFT,%r3
+	ldo		(PxD_FLAG_PRESENT+PxD_FLAG_VALID)(%r3),%r3
 	ldo		ASM_PMD_ENTRY*ASM_PMD_ENTRY_SIZE(%r5),%r5
 	ldi		ASM_PT_INITIAL,%r1
 1:
 	stw		%r3,0(%r5)
-	ldo		ASM_PAGE_SIZE(%r3),%r3
+	ldo		(ASM_PAGE_SIZE >> PxD_VALUE_SHIFT)(%r3),%r3
 	addib,>		-1,%r1,1b
 	ldo		ASM_PMD_ENTRY_SIZE(%r5),%r5
 
-	ldo		_PAGE_KERNEL(%r0),%r3 /* Hardwired 0 phys addr start */
+	ldo             _PAGE_KERNEL(%r0),%r3 /* Hardwired 0 phys addr start */
 	ldil		L%PA(pg0),%r1
 	ldo		R%PA(pg0)(%r1),%r1
 
@@ -299,6 +301,7 @@ smp_slave_stext:
 	/*  Initialize the SP - monarch sets up smp_init_current_idle_task */
 	load32		PA(smp_init_current_idle_task),%sp
 	ldd		0(%sp),%sp	/* load task address */
+	tophys_r1	%sp
 	ldd		TASK_THREAD_INFO(%sp), %sp
 	mtctl           %sp,%cr30       /* store in cr30 */
 	ldo             THREAD_SZ_ALGN(%sp),%sp
diff --git a/arch/parisc/kernel/init_task.c b/arch/parisc/kernel/init_task.c
index ed4fb5858..c71b9462b 100644
--- a/arch/parisc/kernel/init_task.c
+++ b/arch/parisc/kernel/init_task.c
@@ -27,6 +27,7 @@
 #include <linux/sched.h>
 #include <linux/init.h>
 #include <linux/init_task.h>
+#include <linux/mqueue.h>
 
 #include <asm/uaccess.h>
 #include <asm/pgtable.h>
diff --git a/arch/parisc/kernel/inventory.c b/arch/parisc/kernel/inventory.c
index ff3b9fe47..48ba5093e 100644
--- a/arch/parisc/kernel/inventory.c
+++ b/arch/parisc/kernel/inventory.c
@@ -25,7 +25,9 @@
 #include <linux/mm.h>
 #include <asm/hardware.h>
 #include <asm/io.h>
+#include <asm/mmzone.h>
 #include <asm/pdc.h>
+#include <asm/pdcpat.h>
 #include <asm/processor.h>
 #include <asm/page.h>
 #include <asm/parisc-device.h>
diff --git a/arch/parisc/kernel/irq.c b/arch/parisc/kernel/irq.c
index 72f748905..00739749a 100644
--- a/arch/parisc/kernel/irq.c
+++ b/arch/parisc/kernel/irq.c
@@ -121,12 +121,6 @@ struct irqaction cpu_irq_actions[IRQ_PER_REGION] = {
 #endif
 };
 
-struct irq_region_ops cpu_irq_ops = {
-	.disable_irq	= disable_cpu_irq,
-	.enable_irq	= enable_cpu_irq,
-	.mask_irq	= unmask_cpu_irq,
-	.unmask_irq	= unmask_cpu_irq
-};
 
 struct irq_region cpu0_irq_region = {
 	.ops	= {
@@ -200,8 +194,8 @@ void enable_irq(int irq)
 {
 	struct irq_region *region;
 
-	DBG_IRQ(irq, ("enable_irq(%d) %d+%d eiem 0x%lx\n", irq,
-				IRQ_REGION(irq), IRQ_OFFSET(irq), cpu_eiem));
+	DBG_IRQ(irq, ("enable_irq(%d) %d+%d EIRR 0x%lx EIEM 0x%lx\n", irq,
+				IRQ_REGION(irq), IRQ_OFFSET(irq), mfctl(23), mfctl(15)));
 	irq = irq_canonicalize(irq);
 	region = irq_region[IRQ_REGION(irq)];
 
@@ -221,8 +215,9 @@ int show_interrupts(struct seq_file *p, void *v)
 		seq_puts(p, "     ");
 #ifdef CONFIG_SMP
 		for (i = 0; i < NR_CPUS; i++)
+			if (cpu_online(i))
 #endif
-			seq_printf(p, "      CPU%02d ", i);
+				seq_printf(p, "      CPU%02d ", i);
 
 #ifdef PARISC_IRQ_CR16_COUNTS
 		seq_printf(p, "[min/avg/max] (CPU cycle counts)");
@@ -250,6 +245,7 @@ int show_interrupts(struct seq_file *p, void *v)
 		seq_printf(p, "%3d: ", irq_no);
 #ifdef CONFIG_SMP
 		for (; j < NR_CPUS; j++)
+			if (cpu_online(j))
 #endif
 		  seq_printf(p, "%10u ", kstat_cpu(j).irqs[irq_no]);
 
@@ -338,7 +334,8 @@ txn_alloc_addr(int virt_irq)
 	next_cpu++; /* assign to "next" CPU we want this bugger on */
 
 	/* validate entry */
-	while ((next_cpu < NR_CPUS) && !cpu_data[next_cpu].txn_addr)
+	while ((next_cpu < NR_CPUS) && (!cpu_data[next_cpu].txn_addr || 
+		!cpu_online(next_cpu)))
 		next_cpu++;
 
 	if (next_cpu >= NR_CPUS) 
@@ -390,7 +387,7 @@ void do_irq(struct irqaction *action, int irq, struct pt_regs * regs)
 	irq_enter();
 	++kstat_cpu(cpu).irqs[irq];
 
-	DBG_IRQ(irq, ("do_irq(%d) %d+%d\n", irq, IRQ_REGION(irq), IRQ_OFFSET(irq)));
+	DBG_IRQ(irq, ("do_irq(%d) %d+%d eiem 0x%lx\n", irq, IRQ_REGION(irq), IRQ_OFFSET(irq), cpu_eiem));
 
 	for (; action; action = action->next) {
 #ifdef PARISC_IRQ_CR16_COUNTS
@@ -460,7 +457,7 @@ void do_cpu_irq_mask(struct pt_regs *regs)
 
 #ifdef DEBUG_IRQ
 		if (eirr_val != (1UL << MAX_CPU_IRQ))
-			printk(KERN_DEBUG "do_cpu_irq_mask  %x\n", eirr_val);
+			printk(KERN_DEBUG "do_cpu_irq_mask  0x%x & 0x%x\n", eirr_val, cpu_eiem);
 #endif
 
 		/* Work our way from MSb to LSb...same order we alloc EIRs */
@@ -644,7 +641,7 @@ int request_irq(unsigned int irq,
 
 	action->handler = handler;
 	action->flags = irqflags;
-	action->mask = 0;
+	cpus_clear(action->mask);
 	action->name = devname;
 	action->next = NULL;
 	action->dev_id = dev_id;
@@ -865,7 +862,7 @@ EXPORT_SYMBOL(probe_irq_mask);
 void __init init_IRQ(void)
 {
 	local_irq_disable();	/* PARANOID - should already be disabled */
-	mtctl(-1L, 23);		/* EIRR : clear all pending external intr */
+	mtctl(~0UL, 23);	/* EIRR : clear all pending external intr */
 #ifdef CONFIG_SMP
 	if (!cpu_eiem)
 		cpu_eiem = EIEM_MASK(IPI_IRQ) | EIEM_MASK(TIMER_IRQ);
diff --git a/arch/parisc/kernel/parisc_ksyms.c b/arch/parisc/kernel/parisc_ksyms.c
index 516d52a15..dadcf1359 100644
--- a/arch/parisc/kernel/parisc_ksyms.c
+++ b/arch/parisc/kernel/parisc_ksyms.c
@@ -173,3 +173,9 @@ EXPORT_SYMBOL(__moddi3);
 extern void $$dyncall(void);
 EXPORT_SYMBOL($$dyncall);
 #endif
+
+#ifdef CONFIG_DISCONTIGMEM
+#include <asm/mmzone.h>
+EXPORT_SYMBOL(node_data);
+EXPORT_SYMBOL(pfnnid_map);
+#endif
diff --git a/arch/parisc/kernel/pci-dma.c b/arch/parisc/kernel/pci-dma.c
index 5595f3bad..ebbcbf295 100644
--- a/arch/parisc/kernel/pci-dma.c
+++ b/arch/parisc/kernel/pci-dma.c
@@ -32,6 +32,19 @@
 #include <asm/pgalloc.h>
 #include <asm/uaccess.h>
 
+#ifdef DEBUG_PCI
+#undef ASSERT
+#define ASSERT(expr) \
+	if(!(expr)) { \
+		printk("\n%s:%d: Assertion " #expr " failed!\n", \
+				__FILE__, __LINE__); \
+		panic(#expr); \
+	}
+#else
+#define ASSERT(expr)
+#endif
+
+
 static struct proc_dir_entry * proc_gsc_root = NULL;
 static int pcxl_proc_info(char *buffer, char **start, off_t offset, int length);
 static unsigned long pcxl_used_bytes = 0;
diff --git a/arch/parisc/kernel/pdc_chassis.c b/arch/parisc/kernel/pdc_chassis.c
index d79c0a499..7268abfcd 100644
--- a/arch/parisc/kernel/pdc_chassis.c
+++ b/arch/parisc/kernel/pdc_chassis.c
@@ -2,7 +2,7 @@
  *    interfaces to log Chassis Codes via PDC (firmware)
  *
  *    Copyright (C) 2002 Laurent Canet <canetl@esiee.fr>
- *    Copyright (C) 2002-2003 Thibaut Varene <varenet@esiee.fr>
+ *    Copyright (C) 2002-2004 Thibaut VARENE <varenet@esiee.fr>
  *
  *    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
@@ -33,10 +33,28 @@
 
 #include <asm/pdc_chassis.h>
 #include <asm/processor.h>
+#include <asm/pdc.h>
+#include <asm/pdcpat.h>
 
 
 #ifdef CONFIG_PDC_CHASSIS
 static int pdc_chassis_old = 0;	
+static unsigned int pdc_chassis_enabled = 1;
+
+
+/**
+ * pdc_chassis_setup() - Enable/disable pdc_chassis code at boot time.
+ * @str configuration param: 0 to disable chassis log
+ * @return 1
+ */
+ 
+static int __init pdc_chassis_setup(char *str)
+{
+	/*panic_timeout = simple_strtoul(str, NULL, 0);*/
+	get_option(&str, &pdc_chassis_enabled);
+	return 1;
+}
+__setup("pdcchassis=", pdc_chassis_setup);
 
 
 /** 
@@ -114,29 +132,28 @@ void __init parisc_pdc_chassis_init(void)
 {
 #ifdef CONFIG_PDC_CHASSIS
 	int handle = 0;
+	if (pdc_chassis_enabled) {
+		DPRINTK(KERN_DEBUG "%s: parisc_pdc_chassis_init()\n", __FILE__);
+
+		/* Let see if we have something to handle... */
+		/* Check for PDC_PAT or old LED Panel */
+		pdc_chassis_checkold();
+		if (is_pdc_pat()) {
+			printk(KERN_INFO "Enabling PDC_PAT chassis codes support.\n");
+			handle = 1;
+		}
+		else if (pdc_chassis_old) {
+			printk(KERN_INFO "Enabling old style chassis LED panel support.\n");
+			handle = 1;
+		}
 
-	DPRINTK(KERN_DEBUG "%s: parisc_pdc_chassis_init()\n", __FILE__);
-
-	/* Let see if we have something to handle... */
-	/* Check for PDC_PAT or old LED Panel */
-	pdc_chassis_checkold();
-	if (is_pdc_pat()) {
-#ifdef __LP64__	/* see pdc_chassis_send_status() */
-		printk(KERN_INFO "Enabling PDC_PAT chassis codes support.\n");
-		handle = 1;
-#endif /* __LP64__ */
-	}
-	else if (pdc_chassis_old) {
-		printk(KERN_INFO "Enabling old style chassis LED panel support.\n");
-		handle = 1;
-	}
-	
-	if (handle) {
-		/* initialize panic notifier chain */
-		notifier_chain_register(&panic_notifier_list, &pdc_chassis_panic_block);
+		if (handle) {
+			/* initialize panic notifier chain */
+			notifier_chain_register(&panic_notifier_list, &pdc_chassis_panic_block);
 
-		/* initialize reboot notifier chain */
-		register_reboot_notifier(&pdc_chassis_reboot_block);
+			/* initialize reboot notifier chain */
+			register_reboot_notifier(&pdc_chassis_reboot_block);
+		}
 	}
 #endif /* CONFIG_PDC_CHASSIS */
 }
@@ -161,65 +178,68 @@ int pdc_chassis_send_status(int message)
 	/* Maybe we should do that in an other way ? */
 	int retval = 0;
 #ifdef CONFIG_PDC_CHASSIS
-	DPRINTK(KERN_DEBUG "%s: pdc_chassis_send_status(%d)\n", __FILE__, message);
-
-#ifdef __LP64__	/* pdc_pat_chassis_send_log is defined only when #ifdef __LP64__ */
-	if (is_pdc_pat()) {
-		switch(message) {
-			case PDC_CHASSIS_DIRECT_BSTART:
-				retval = pdc_pat_chassis_send_log(PDC_CHASSIS_PMSG_BSTART, PDC_CHASSIS_LSTATE_RUN_NORMAL);
-				break;
-			
-			case PDC_CHASSIS_DIRECT_BCOMPLETE:
-				retval = pdc_pat_chassis_send_log(PDC_CHASSIS_PMSG_BCOMPLETE, PDC_CHASSIS_LSTATE_RUN_NORMAL);
-				break;
-			
-			case PDC_CHASSIS_DIRECT_SHUTDOWN:
-				retval = pdc_pat_chassis_send_log(PDC_CHASSIS_PMSG_SHUTDOWN, PDC_CHASSIS_LSTATE_NONOS);
-				break;
-			
-			case PDC_CHASSIS_DIRECT_PANIC:
-				retval = pdc_pat_chassis_send_log(PDC_CHASSIS_PMSG_PANIC, PDC_CHASSIS_LSTATE_RUN_CRASHREC);
-				break;
-		
-			case PDC_CHASSIS_DIRECT_LPMC:
-				retval = pdc_pat_chassis_send_log(PDC_CHASSIS_PMSG_LPMC, PDC_CHASSIS_LSTATE_RUN_SYSINT);
-				break;
-
-			case PDC_CHASSIS_DIRECT_HPMC:
-				retval = pdc_pat_chassis_send_log(PDC_CHASSIS_PMSG_HPMC, PDC_CHASSIS_LSTATE_RUN_NCRIT);
-				break;
-
-			default:
-				retval = -1;
-		}
-	} else retval = -1;
+	if (pdc_chassis_enabled) {
+
+		DPRINTK(KERN_DEBUG "%s: pdc_chassis_send_status(%d)\n", __FILE__, message);
+
+#ifdef CONFIG_PARISC64
+		if (is_pdc_pat()) {
+			switch(message) {
+				case PDC_CHASSIS_DIRECT_BSTART:
+					retval = pdc_pat_chassis_send_log(PDC_CHASSIS_PMSG_BSTART, PDC_CHASSIS_LSTATE_RUN_NORMAL);
+					break;
+
+				case PDC_CHASSIS_DIRECT_BCOMPLETE:
+					retval = pdc_pat_chassis_send_log(PDC_CHASSIS_PMSG_BCOMPLETE, PDC_CHASSIS_LSTATE_RUN_NORMAL);
+					break;
+
+				case PDC_CHASSIS_DIRECT_SHUTDOWN:
+					retval = pdc_pat_chassis_send_log(PDC_CHASSIS_PMSG_SHUTDOWN, PDC_CHASSIS_LSTATE_NONOS);
+					break;
+
+				case PDC_CHASSIS_DIRECT_PANIC:
+					retval = pdc_pat_chassis_send_log(PDC_CHASSIS_PMSG_PANIC, PDC_CHASSIS_LSTATE_RUN_CRASHREC);
+					break;
+
+				case PDC_CHASSIS_DIRECT_LPMC:
+					retval = pdc_pat_chassis_send_log(PDC_CHASSIS_PMSG_LPMC, PDC_CHASSIS_LSTATE_RUN_SYSINT);
+					break;
+
+				case PDC_CHASSIS_DIRECT_HPMC:
+					retval = pdc_pat_chassis_send_log(PDC_CHASSIS_PMSG_HPMC, PDC_CHASSIS_LSTATE_RUN_NCRIT);
+					break;
+
+				default:
+					retval = -1;
+			}
+		} else retval = -1;
 #else
-	if (pdc_chassis_old) {
-		switch (message) {
-			case PDC_CHASSIS_DIRECT_BSTART:
-			case PDC_CHASSIS_DIRECT_BCOMPLETE:
-				retval = pdc_chassis_disp(PDC_CHASSIS_DISP_DATA(OSTAT_RUN));
-				break;
-							
-			case PDC_CHASSIS_DIRECT_SHUTDOWN:
-				retval = pdc_chassis_disp(PDC_CHASSIS_DISP_DATA(OSTAT_SHUT));
-				break;
-			
-			case PDC_CHASSIS_DIRECT_HPMC:
-			case PDC_CHASSIS_DIRECT_PANIC:
-				retval = pdc_chassis_disp(PDC_CHASSIS_DISP_DATA(OSTAT_FLT));
-				break;
-		
-			case PDC_CHASSIS_DIRECT_LPMC:
-				retval = pdc_chassis_disp(PDC_CHASSIS_DISP_DATA(OSTAT_WARN));
-				break;
-
-			default:
-				retval = -1;
-		}
-	} else retval = -1;
-#endif /* __LP64__ */
+		if (pdc_chassis_old) {
+			switch (message) {
+				case PDC_CHASSIS_DIRECT_BSTART:
+				case PDC_CHASSIS_DIRECT_BCOMPLETE:
+					retval = pdc_chassis_disp(PDC_CHASSIS_DISP_DATA(OSTAT_RUN));
+					break;
+
+				case PDC_CHASSIS_DIRECT_SHUTDOWN:
+					retval = pdc_chassis_disp(PDC_CHASSIS_DISP_DATA(OSTAT_SHUT));
+					break;
+
+				case PDC_CHASSIS_DIRECT_HPMC:
+				case PDC_CHASSIS_DIRECT_PANIC:
+					retval = pdc_chassis_disp(PDC_CHASSIS_DISP_DATA(OSTAT_FLT));
+					break;
+
+				case PDC_CHASSIS_DIRECT_LPMC:
+					retval = pdc_chassis_disp(PDC_CHASSIS_DISP_DATA(OSTAT_WARN));
+					break;
+
+				default:
+					retval = -1;
+			}
+		} else retval = -1;
+#endif /* CONFIG_PARISC64 */
+	}	/* if (pdc_chassis_enabled) */
 #endif /* CONFIG_PDC_CHASSIS */
 	return retval;
 }
diff --git a/arch/parisc/kernel/process.c b/arch/parisc/kernel/process.c
index f04dea6a7..dd938ef77 100644
--- a/arch/parisc/kernel/process.c
+++ b/arch/parisc/kernel/process.c
@@ -380,18 +380,14 @@ get_wchan(struct task_struct *p)
 	/*
 	 * These bracket the sleeping functions..
 	 */
-#	define first_sched	((unsigned long) scheduling_functions_start_here)
-#	define last_sched	((unsigned long) scheduling_functions_end_here)
 
 	unwind_frame_init_from_blocked_task(&info, p);
 	do {
 		if (unwind_once(&info) < 0)
 			return 0;
 		ip = info.ip;
-		if (ip < first_sched || ip >= last_sched)
+		if (!in_sched_functions(ip))
 			return ip;
 	} while (count++ < 16);
 	return 0;
-#	undef first_sched
-#	undef last_sched
 }
diff --git a/arch/parisc/kernel/processor.c b/arch/parisc/kernel/processor.c
index dd7f239aa..b4931ade4 100644
--- a/arch/parisc/kernel/processor.c
+++ b/arch/parisc/kernel/processor.c
@@ -33,12 +33,14 @@
 #include <linux/module.h>
 #include <linux/seq_file.h>
 #include <linux/slab.h>
+#include <linux/cpu.h>
 
 #include <asm/cache.h>
 #include <asm/hardware.h>	/* for register_parisc_driver() stuff */
 #include <asm/processor.h>
 #include <asm/page.h>
 #include <asm/pdc.h>
+#include <asm/pdcpat.h>
 #include <asm/irq.h>		/* for struct irq_region */
 #include <asm/parisc-device.h>
 
@@ -187,6 +189,17 @@ static int __init processor_probe(struct parisc_device *dev)
 		cpu_irq_actions[cpuid] = actions;
 	}
 #endif
+
+	/* 
+	 * Bring this CPU up now! (ignore bootstrap cpuid == 0)
+	 */
+#ifdef CONFIG_SMP
+	if (cpuid) {
+		cpu_set(cpuid, cpu_present_map);
+		cpu_up(cpuid);
+	}
+#endif
+
 	return 0;
 }
 
diff --git a/arch/parisc/kernel/real2.S b/arch/parisc/kernel/real2.S
index 899fd7356..3637b0a98 100644
--- a/arch/parisc/kernel/real2.S
+++ b/arch/parisc/kernel/real2.S
@@ -12,8 +12,12 @@
 
 	.section	.bss
 	.export real_stack
+	.export real32_stack
+	.export real64_stack
 	.align	64
 real_stack:
+real32_stack:
+real64_stack:
 	.block	8192
 
 #ifdef __LP64__
diff --git a/arch/parisc/kernel/setup.c b/arch/parisc/kernel/setup.c
index 820adb178..37bd6a607 100644
--- a/arch/parisc/kernel/setup.c
+++ b/arch/parisc/kernel/setup.c
@@ -44,14 +44,15 @@
 #include <asm/machdep.h>	/* for pa7300lc_init() proto */
 #include <asm/pdc_chassis.h>
 #include <asm/io.h>
+#include <asm/setup.h>
 
-#define COMMAND_LINE_SIZE 1024
-char	saved_command_line[COMMAND_LINE_SIZE];
 char	command_line[COMMAND_LINE_SIZE];
 
 /* Intended for ccio/sba/cpu statistics under /proc/bus/{runway|gsc} */
 struct proc_dir_entry * proc_runway_root = NULL;
 struct proc_dir_entry * proc_gsc_root = NULL;
+struct proc_dir_entry * proc_mckinley_root = NULL;
+
 
 void __init setup_cmdline(char **cmdline_p)
 {
@@ -207,12 +208,17 @@ static void __init parisc_proc_mkdir(void)
         case pcxw:
         case pcxw_:
         case pcxw2:
-	case mako:	/* XXX : this is really mckinley bus */
                 if (NULL == proc_runway_root)
                 {
                         proc_runway_root = proc_mkdir("bus/runway", 0);
                 }
                 break;
+	case mako:
+                if (NULL == proc_mckinley_root)
+                {
+                        proc_mckinley_root = proc_mkdir("bus/mckinley", 0);
+                }
+                break;
 	default:
 		/* FIXME: this was added to prevent the compiler 
 		 * complaining about missing pcx, pcxs and pcxt
diff --git a/arch/parisc/kernel/smp.c b/arch/parisc/kernel/smp.c
index 77be8d41e..0f1daa584 100644
--- a/arch/parisc/kernel/smp.c
+++ b/arch/parisc/kernel/smp.c
@@ -54,18 +54,27 @@
 
 #define kDEBUG 0
 
-spinlock_t pa_dbit_lock = SPIN_LOCK_UNLOCKED;
-
 spinlock_t smp_lock = SPIN_LOCK_UNLOCKED;
 
 volatile struct task_struct *smp_init_current_idle_task;
 
 static volatile int cpu_now_booting = 0;	/* track which CPU is booting */
-static int parisc_max_cpus = -1;		/* Command line */
 
 unsigned long cache_decay_ticks;	/* declared by include/linux/sched.h */
+
+static int parisc_max_cpus = 1;
+
+/* online cpus are ones that we've managed to bring up completely
+ * possible cpus are all valid cpu 
+ * present cpus are all detected cpu
+ *
+ * On startup we bring up the "possible" cpus. Since we discover
+ * CPUs later, we add them as hotplug, so the possible cpu mask is
+ * empty in the beginning.
+ */
+
 cpumask_t cpu_online_map = CPU_MASK_NONE;	/* Bitmap of online CPUs */
-cpumask_t cpu_possible_map = CPU_MASK_NONE;	/* Bitmap of Present CPUs */
+cpumask_t cpu_possible_map = CPU_MASK_ALL;	/* Bitmap of Present CPUs */
 
 EXPORT_SYMBOL(cpu_online_map);
 EXPORT_SYMBOL(cpu_possible_map);
@@ -289,7 +298,7 @@ send_IPI_allbutself(enum ipi_message_type op)
 {
 	int i;
 	
-	for (i = 0; i < parisc_max_cpus; i++) {
+	for (i = 0; i < NR_CPUS; i++) {
 		if (cpu_online(i) && i != smp_processor_id())
 			send_IPI_single(i, op);
 	}
@@ -325,6 +334,9 @@ smp_call_function (void (*func) (void *info), void *info, int retry, int wait)
 	unsigned long timeout;
 	static spinlock_t lock = SPIN_LOCK_UNLOCKED;
 
+	if (num_online_cpus() < 2)
+		return 0;
+
 	/* Can deadlock when called with interrupts disabled */
 	WARN_ON(irqs_disabled());
 	
@@ -377,35 +389,6 @@ smp_call_function (void (*func) (void *info), void *info, int retry, int wait)
 
 EXPORT_SYMBOL(smp_call_function);
 
-
-
-/*
- *	Setup routine for controlling SMP activation
- *
- *	Command-line option of "nosmp" or "maxcpus=0" will disable SMP
- *	activation entirely (the MPS table probe still happens, though).
- *
- *	Command-line option of "maxcpus=<NUM>", where <NUM> is an integer
- *	greater than 0, limits the maximum number of CPUs activated in
- *	SMP mode to <NUM>.
- */
-
-static int __init nosmp(char *str)
-{
-	parisc_max_cpus = 0;
-	return 1;
-}
-
-__setup("nosmp", nosmp);
-
-static int __init maxcpus(char *str)
-{
-	get_option(&str, &parisc_max_cpus);
-	return 1;
-}
-
-__setup("maxcpus=", maxcpus);
-
 /*
  * Flush all other CPU's tlb and then mine.  Do this with on_each_cpu()
  * as we want to ensure all TLB's flushed before proceeding.
@@ -502,7 +485,6 @@ void __init smp_callin(void)
 	panic("smp_callin() AAAAaaaaahhhh....\n");
 }
 
-#if 0
 /*
  * Create the idle task for a new Slave CPU.  DO NOT use kernel_thread()
  * because that could end up calling schedule(). If it did, the new idle
@@ -524,7 +506,7 @@ static struct task_struct *fork_by_hand(void)
 /*
  * Bring one cpu online.
  */
-int __init smp_boot_one_cpu(int cpuid, int cpunum)
+int __init smp_boot_one_cpu(int cpuid)
 {
 	struct task_struct *idle;
 	long timeout;
@@ -544,14 +526,14 @@ int __init smp_boot_one_cpu(int cpuid, int cpunum)
 		panic("SMP: fork failed for CPU:%d", cpuid);
 
 	wake_up_forked_process(idle);
-	init_idle(idle, cpunum);
+	init_idle(idle, cpuid);
 	unhash_process(idle);
-	idle->thread_info->cpu = cpunum;
+	idle->thread_info->cpu = cpuid;
 
 	/* Let _start know what logical CPU we're booting
 	** (offset into init_tasks[],cpu_data[])
 	*/
-	cpu_now_booting = cpunum;
+	cpu_now_booting = cpuid;
 
 	/* 
 	** boot strap code needs to know the task address since
@@ -560,11 +542,18 @@ int __init smp_boot_one_cpu(int cpuid, int cpunum)
 	smp_init_current_idle_task = idle ;
 	mb();
 
+	printk("Releasing cpu %d now, hpa=%lx\n", cpuid, cpu_data[cpuid].hpa);
+
 	/*
 	** This gets PDC to release the CPU from a very tight loop.
-	** See MEM_RENDEZ comments in head.S.
+	**
+	** From the PA-RISC 2.0 Firmware Architecture Reference Specification:
+	** "The MEM_RENDEZ vector specifies the location of OS_RENDEZ which 
+	** is executed after receiving the rendezvous signal (an interrupt to 
+	** EIR{0}). MEM_RENDEZ is valid only when it is nonzero and the 
+	** contents of memory are valid."
 	*/
-	__raw_writel(IRQ_OFFSET(TIMER_IRQ), cpu_data[cpunum].hpa);
+	__raw_writel(IRQ_OFFSET(TIMER_IRQ), cpu_data[cpuid].hpa);
 	mb();
 
 	/* 
@@ -573,7 +562,7 @@ int __init smp_boot_one_cpu(int cpuid, int cpunum)
 	 * Once the "monarch CPU" sees the bit change, it can move on.
 	 */
 	for (timeout = 0; timeout < 10000; timeout++) {
-		if(cpu_online(cpunum)) {
+		if(cpu_online(cpuid)) {
 			/* Which implies Slave has started up */
 			cpu_now_booting = 0;
 			smp_init_current_idle_task = NULL;
@@ -592,16 +581,14 @@ int __init smp_boot_one_cpu(int cpuid, int cpunum)
 alive:
 	/* Remember the Slave data */
 #if (kDEBUG>=100)
-	printk(KERN_DEBUG "SMP: CPU:%d (num %d) came alive after %ld _us\n",
-		cpuid,  cpunum, timeout * 100);
+	printk(KERN_DEBUG "SMP: CPU:%d came alive after %ld _us\n",
+		cpuid, timeout * 100);
 #endif /* kDEBUG */
 #ifdef ENTRY_SYS_CPUS
-	cpu_data[cpunum].state = STATE_RUNNING;
+	cpu_data[cpuid].state = STATE_RUNNING;
 #endif
 	return 0;
 }
-#endif
-
 
 void __devinit smp_prepare_boot_cpu(void)
 {
@@ -612,15 +599,10 @@ void __devinit smp_prepare_boot_cpu(void)
 #endif
 
 	/* Setup BSP mappings */
-	printk(KERN_DEBUG "SMP: bootstrap CPU ID is %d\n",bootstrap_processor);
-	init_task.thread_info->cpu = bootstrap_processor; 
-	current->thread_info->cpu = bootstrap_processor;
+	printk("SMP: bootstrap CPU ID is %d\n",bootstrap_processor);
 
 	cpu_set(bootstrap_processor, cpu_online_map);
-	cpu_set(bootstrap_processor, cpu_possible_map);
-
-	/* Mark Boostrap processor as present */
-	current->active_mm = &init_mm;
+	cpu_set(bootstrap_processor, cpu_present_map);
 
 	cache_decay_ticks = HZ/100;	/* FIXME very rough.  */
 }
@@ -633,15 +615,12 @@ void __devinit smp_prepare_boot_cpu(void)
 */
 void __init smp_prepare_cpus(unsigned int max_cpus)
 {
+	cpus_clear(cpu_present_map);
+	cpu_set(0, cpu_present_map);
 
-	if (max_cpus != -1) 
-		printk(KERN_INFO "SMP: Limited to %d CPUs\n", max_cpus);
-
-	printk(KERN_INFO "SMP: Monarch CPU activated (%lu.%02lu BogoMIPS)\n",
-	       (cpu_data[0].loops_per_jiffy + 25) / 5000,
-	       ((cpu_data[0].loops_per_jiffy + 25) / 50) % 100);
-
-	return;
+	parisc_max_cpus = max_cpus;
+	if (!max_cpus)
+		printk(KERN_INFO "SMP mode deactivated.\n");
 }
 
 
@@ -653,6 +632,9 @@ void smp_cpus_done(unsigned int cpu_max)
 
 int __devinit __cpu_up(unsigned int cpu)
 {
+	if (cpu != 0 && cpu < parisc_max_cpus)
+		smp_boot_one_cpu(cpu);
+
 	return cpu_online(cpu) ? 0 : -ENOSYS;
 }
 
diff --git a/arch/parisc/kernel/sys_parisc32.c b/arch/parisc/kernel/sys_parisc32.c
index cd320b20c..74db7f6b8 100644
--- a/arch/parisc/kernel/sys_parisc32.c
+++ b/arch/parisc/kernel/sys_parisc32.c
@@ -205,10 +205,11 @@ static inline long get_ts32(struct timespec *o, struct compat_timeval *i)
 
 asmlinkage long sys32_time(compat_time_t *tloc)
 {
-    struct timeval tv;
+	struct timeval tv;
+	compat_time_t now32;
 
 	do_gettimeofday(&tv);
-	compat_time_t now32 = tv.tv_sec;
+	now32 = tv.tv_sec;
 
 	if (tloc)
 		if (put_user(now32, tloc))
@@ -344,7 +345,7 @@ filldir32 (void *__buf, const char *name, int namlen, loff_t offset, ino_t ino,
 	put_user(reclen, &dirent->d_reclen);
 	copy_to_user(dirent->d_name, name, namlen);
 	put_user(0, dirent->d_name + namlen);
-	((char *) dirent) += reclen;
+	dirent = (struct linux32_dirent *)((char *)dirent + reclen);
 	buf->current_dir = dirent;
 	buf->count -= reclen;
 	return 0;
diff --git a/arch/parisc/kernel/traps.c b/arch/parisc/kernel/traps.c
index 6f1f6f738..ff80b3c1f 100644
--- a/arch/parisc/kernel/traps.c
+++ b/arch/parisc/kernel/traps.c
@@ -38,12 +38,17 @@
 #include <asm/smp.h>
 #include <asm/pdc.h>
 #include <asm/pdc_chassis.h>
+#include <asm/unwind.h>
 
 #include "../math-emu/math-emu.h"	/* for handle_fpe() */
 
 #define PRINT_USER_FAULTS /* (turn this on if you want user faults to be */
 			  /*  dumped to the console via printk)          */
 
+#if defined(CONFIG_SMP) || defined(CONFIG_DEBUG_SPINLOCK)
+spinlock_t pa_dbit_lock = SPIN_LOCK_UNLOCKED;
+#endif
+
 int printbinary(char *buf, unsigned long x, int nbits)
 {
 	unsigned long mask = 1UL << (nbits - 1);
@@ -125,73 +130,37 @@ void show_regs(struct pt_regs *regs)
 
 void dump_stack(void)
 {
-	unsigned long stack;
-	show_trace(current, &stack);
+	show_stack(NULL, NULL);
 }
 
 EXPORT_SYMBOL(dump_stack);
 
-#ifndef __LP64__
-static int kstack_depth_to_print = 64 * 4;
-#else
-static int kstack_depth_to_print = 128 * 4;
-#endif
-
-void show_stack(struct task_struct *task, unsigned long *sp)
+void show_stack(struct task_struct *task, unsigned long *s)
 {
-	unsigned long *stack;
-	int i;
-
-	/*
-	 * debugging aid: "show_stack(NULL);" prints the
-	 * back trace for this cpu.
-	 */
-	if (task==NULL)
-		sp = (unsigned long*)&sp;
-	else if(sp == NULL)
-		sp = (unsigned long*)task->thread.regs.ksp;
-
-	stack = sp;
-	printk("\n" KERN_CRIT "Stack Dump:\n");
-	printk(KERN_CRIT " " RFMT ":  ", (unsigned long) stack);
-	for (i=0; i < kstack_depth_to_print; i++) {
-		if (((long) stack & (THREAD_SIZE-1)) == 0)
-			break;
-		if (i && ((i & 0x03) == 0))
-			printk("\n" KERN_CRIT " " RFMT ":  ",
-				(unsigned long) stack);
-		printk(RFMT " ", *stack--);
+	int i = 1;
+	struct unwind_frame_info info;
+
+	if (!task) {
+		unsigned long sp, ip, rp;
+
+HERE:
+		asm volatile ("copy %%r30, %0" : "=r"(sp));
+		ip = (unsigned long)&&HERE;
+		rp = (unsigned long)__builtin_return_address(0);
+		unwind_frame_init(&info, current, sp, ip, rp);
+	} else {
+		unwind_frame_init_from_blocked_task(&info, task);
 	}
-	printk("\n" KERN_CRIT "\n");
-	show_trace(task, sp);
-}
 
+	printk("Backtrace:\n");
+	while (i <= 16) {
+		if (unwind_once(&info) < 0 || info.ip == 0)
+			break;
 
-void show_trace(struct task_struct *task, unsigned long *stack)
-{
-	unsigned long *startstack;
-	unsigned long addr;
-	int i;
-
-	startstack = (unsigned long *)((unsigned long)stack & ~(THREAD_SIZE - 1));
-	i = 1;
-	stack = (long *)((long)(stack + 32) &~ (FRAME_SIZE-1)); /* Align */
-	printk("Kernel addresses on the stack:\n");
-	while (stack > startstack) {
-		stack -= 16;	/* Stack frames are a multiple of 16 words */
-		addr = stack[16 - RP_OFFSET / sizeof(long)];
-		/*
-		 * If the address is either in the text segment of the
-		 * kernel, or in the region which contains vmalloc'ed
-		 * memory, it *may* be the address of a calling
-		 * routine; if so, print it so that someone tracing
-		 * down the cause of the crash will be able to figure
-		 * out the call path that was taken.
-		 */
-		if (kernel_text_address(addr)) {
-			printk(" [<" RFMT ">] ", addr);
+		if (__kernel_text_address(info.ip)) {
+			printk(" [<" RFMT ">] ", info.ip);
 #ifdef CONFIG_KALLSYMS
-			print_symbol("%s\n", addr);
+			print_symbol("%s\n", info.ip);
 #else
 			if ((i & 0x03) == 0)
 				printk("\n");
diff --git a/arch/parisc/kernel/unwind.c b/arch/parisc/kernel/unwind.c
index ccfd5fe5a..abd749074 100644
--- a/arch/parisc/kernel/unwind.c
+++ b/arch/parisc/kernel/unwind.c
@@ -8,18 +8,6 @@
  * understand what is happening here
  */
 
-/*
- * J. David Anglin writes:
- *
- * "You have to adjust the current sp to that at the begining of the function.
- * There can be up to two stack additions to allocate the frame in the
- * prologue.  Similar things happen in the epilogue.  In the presence of
- * interrupts, you have to be concerned about where you are in the function
- * and what stack adjustments have taken place."
- *
- * For now these cases are not handled, but they should be!
- */
-
 #include <linux/config.h>
 #include <linux/kernel.h>
 #include <linux/init.h>
@@ -36,8 +24,8 @@
 #define dbg(x...)
 #endif
 
-extern const struct unwind_table_entry __start___unwind[];
-extern const struct unwind_table_entry __stop___unwind[];
+extern struct unwind_table_entry __start___unwind[];
+extern struct unwind_table_entry __stop___unwind[];
 
 static spinlock_t unwind_lock;
 /*
@@ -55,8 +43,6 @@ find_unwind_entry_in_table(const struct unwind_table *table, unsigned long addr)
 	const struct unwind_table_entry *e = 0;
 	unsigned long lo, hi, mid;
 
-	addr -= table->base_addr;
-
 	for (lo = 0, hi = table->length; lo < hi; )
 	{
 		mid = (lo + hi) / 2;
@@ -97,10 +83,11 @@ find_unwind_entry(unsigned long addr)
 static void
 unwind_table_init(struct unwind_table *table, const char *name,
 		  unsigned long base_addr, unsigned long gp,
-		  const void *table_start, const void *table_end)
+		  void *table_start, void *table_end)
 {
-	const struct unwind_table_entry *start = table_start;
-	const struct unwind_table_entry *end = table_end - 1;
+	struct unwind_table_entry *start = table_start;
+	struct unwind_table_entry *end = 
+		(struct unwind_table_entry *)table_end - 1;
 
 	table->name = name;
 	table->base_addr = base_addr;
@@ -108,14 +95,19 @@ unwind_table_init(struct unwind_table *table, const char *name,
 	table->start = base_addr + start->region_start;
 	table->end = base_addr + end->region_end;
 	table->table = (struct unwind_table_entry *)table_start;
-	table->length = end - start;
+	table->length = end - start + 1;
 	table->next = NULL;
+
+	for (; start <= end; start++) {
+		start->region_start += base_addr;
+		start->region_end += base_addr;
+	}
 }
 
 void *
 unwind_table_add(const char *name, unsigned long base_addr, 
 		 unsigned long gp,
-                 const void *start, const void *end)
+                 void *start, void *end)
 {
 	struct unwind_table *table;
 	unsigned long flags;
@@ -206,6 +198,8 @@ static void unwind_frame_regs(struct unwind_frame_info *info)
 			sp = info->prev_sp;
 		} while (info->prev_ip < (unsigned long)_stext ||
 			 info->prev_ip > (unsigned long)_etext);
+
+		dbg("analyzing func @ %lx with no unwind info, setting prev_sp=%lx prev_ip=%lx\n", info->ip, info->prev_sp, info->prev_ip);
 	} else {
 
 		dbg("e->start = 0x%x, e->end = 0x%x, Save_SP = %d, Save_RP = %d size = %u\n",
@@ -225,42 +219,57 @@ static void unwind_frame_regs(struct unwind_frame_info *info)
 				/* ldo X(sp), sp, or stwm X,D(sp) */
 				frame_size += (insn & 0x1 ? -1 << 13 : 0) | 
 					((insn & 0x3fff) >> 1);
+				dbg("analyzing func @ %lx, insn=%08x @ %lx, frame_size = %ld\n", info->ip, insn, npc, frame_size);
 			} else if ((insn & 0xffe00008) == 0x7ec00008) {
 				/* std,ma X,D(sp) */
 				frame_size += (insn & 0x1 ? -1 << 13 : 0) | 
 					(((insn >> 4) & 0x3ff) << 3);
+				dbg("analyzing func @ %lx, insn=%08x @ %lx, frame_size = %ld\n", info->ip, insn, npc, frame_size);
 			} else if (insn == 0x6bc23fd9) { 
 				/* stw rp,-20(sp) */
 				rpoffset = 20;
 				looking_for_rp = 0;
+				dbg("analyzing func @ %lx, insn=stw rp,-20(sp) @ %lx\n", info->ip, npc);
 			} else if (insn == 0x0fc212c1) {
 				/* std rp,-16(sr0,sp) */
 				rpoffset = 16;
 				looking_for_rp = 0;
+				dbg("analyzing func @ %lx, insn=std rp,-16(sp) @ %lx\n", info->ip, npc);
 			}
 		}
 
 		info->prev_sp = info->sp - frame_size;
 		if (rpoffset)
-			info->prev_ip = *(unsigned long *)(info->prev_sp - rpoffset);
+			info->rp = *(unsigned long *)(info->prev_sp - rpoffset);
+		info->prev_ip = info->rp;
+		info->rp = 0;
+
+		dbg("analyzing func @ %lx, setting prev_sp=%lx prev_ip=%lx\n", info->ip, info->prev_sp, info->prev_ip);
 	}
 }
 
 void unwind_frame_init(struct unwind_frame_info *info, struct task_struct *t, 
-		       struct pt_regs *regs)
+		       unsigned long sp, unsigned long ip, unsigned long rp)
 {
 	memset(info, 0, sizeof(struct unwind_frame_info));
 	info->t = t;
-	info->sp = regs->ksp;
-	info->ip = regs->kpc;
+	info->sp = sp;
+	info->ip = ip;
+	info->rp = rp;
 
-	dbg("(%d) Start unwind from sp=%08lx ip=%08lx\n", (int)t->pid, info->sp, info->ip);
+	dbg("(%d) Start unwind from sp=%08lx ip=%08lx\n", t ? (int)t->pid : 0, info->sp, info->ip);
 }
 
 void unwind_frame_init_from_blocked_task(struct unwind_frame_info *info, struct task_struct *t)
 {
 	struct pt_regs *regs = &t->thread.regs;
-	unwind_frame_init(info, t, regs);
+	unwind_frame_init(info, t, regs->ksp, regs->kpc, 0);
+}
+
+void unwind_frame_init_running(struct unwind_frame_info *info, struct pt_regs *regs)
+{
+	unwind_frame_init(info, current, regs->gr[30], regs->iaoq[0],
+			  regs->gr[2]);
 }
 
 int unwind_once(struct unwind_frame_info *next_frame)
diff --git a/arch/parisc/lib/Makefile b/arch/parisc/lib/Makefile
index f088c6372..7322c7e63 100644
--- a/arch/parisc/lib/Makefile
+++ b/arch/parisc/lib/Makefile
@@ -3,3 +3,5 @@
 #
 
 lib-y	:= lusercopy.o bitops.o checksum.o io.o memset.o
+
+lib-$(CONFIG_SMP) += debuglocks.o
diff --git a/arch/parisc/lib/bitops.c b/arch/parisc/lib/bitops.c
index b7e171abd..4c077fc4c 100644
--- a/arch/parisc/lib/bitops.c
+++ b/arch/parisc/lib/bitops.c
@@ -34,26 +34,26 @@ unsigned long __xchg64(unsigned long x, unsigned long *ptr)
 unsigned long __xchg32(int x, int *ptr)
 {
 	unsigned long flags;
-	unsigned long temp;
+	long temp;
 
 	atomic_spin_lock_irqsave(ATOMIC_HASH(ptr), flags);
-	(long) temp = (long) *ptr;	/* XXX - sign extension wanted? */
+	temp = (long) *ptr;	/* XXX - sign extension wanted? */
 	*ptr = x;
 	atomic_spin_unlock_irqrestore(ATOMIC_HASH(ptr), flags);
-	return temp;
+	return (unsigned long)temp;
 }
 
 
 unsigned long __xchg8(char x, char *ptr)
 {
 	unsigned long flags;
-	unsigned long temp;
+	long temp;
 
 	atomic_spin_lock_irqsave(ATOMIC_HASH(ptr), flags);
-	(long) temp = (long) *ptr;	/* XXX - sign extension wanted? */
+	temp = (long) *ptr;	/* XXX - sign extension wanted? */
 	*ptr = x;
 	atomic_spin_unlock_irqrestore(ATOMIC_HASH(ptr), flags);
-	return temp;
+	return (unsigned long)temp;
 }
 
 
diff --git a/arch/parisc/lib/io.c b/arch/parisc/lib/io.c
index 27f635086..86fb6b017 100644
--- a/arch/parisc/lib/io.c
+++ b/arch/parisc/lib/io.c
@@ -21,7 +21,7 @@ void __memcpy_toio(unsigned long dest, unsigned long src, int count)
 		goto bytecopy;
 	while (dest & 3) {
 		writeb(*(char *)src, dest++);
-		((char *)src)++;
+		src++;
 		count--;
 	}
 	while (count > 3) {
@@ -33,7 +33,7 @@ void __memcpy_toio(unsigned long dest, unsigned long src, int count)
  bytecopy:
 	while (count--) {
 		writeb(*(char *)src, dest++);
-		((char *)src)++;
+		src++;
 	}
 }
 
@@ -62,17 +62,17 @@ void __memcpy_fromio(unsigned long dest, unsigned long src, int count)
 	/* Then check for misaligned start address */
 	if (src & 1) {
 		*(u8 *)dest = readb(src);
-		((u8 *)src)++;
-		((u8 *)dest)++;
+		src++;
+		dest++;
 		count--;
 		if (count < 2) goto bytecopy;
 	}
 
 	if (src & 2) {
 		*(u16 *)dest = __raw_readw(src);
-		((u16 *)src)++;
-		((u16 *)dest)++;
-		count-=2;
+		src += 2;
+		dest += 2;
+		count -= 2;
 	}
 
 	while (count > 3) {
@@ -85,16 +85,16 @@ void __memcpy_fromio(unsigned long dest, unsigned long src, int count)
  shortcopy:
 	while (count > 1) {
 		*(u16 *)dest = __raw_readw(src);
-		((u16 *)src)++;
-		((u16 *)dest)++;
-		count-=2;
+		src += 2;
+		dest += 2;
+		count -= 2;
 	}
 
  bytecopy:
 	while (count--) {
 		*(char *)dest = readb(src);
-		((char *)src)++;
-		((char *)dest)++;
+		src++;
+		dest++;
 	}
 }
 
@@ -125,12 +125,16 @@ void __memset_io(unsigned long dest, char fill, int count)
  */
 void insb (unsigned long port, void *dst, unsigned long count)
 {
-	while (((unsigned long)dst) & 0x3) {
+	unsigned char *p;
+
+	p = (unsigned char *)dst;
+
+	while (((unsigned long)p) & 0x3) {
 		if (!count)
 			return;
 		count--;
-		*(unsigned char *) dst = inb(port);
-		((unsigned char *) dst)++;
+		*p = inb(port);
+		p++;
 	}
 
 	while (count >= 4) {
@@ -140,14 +144,14 @@ void insb (unsigned long port, void *dst, unsigned long count)
 		w |= inb(port) << 16;
 		w |= inb(port) << 8;
 		w |= inb(port);
-		*(unsigned int *) dst = w;
-		((unsigned int *) dst)++;
+		*(unsigned int *) p = w;
+		p += 4;
 	}
 
 	while (count) {
 		--count;
-		*(unsigned char *) dst = inb(port);
-		((unsigned char *) dst)++;
+		*p = inb(port);
+		p++;
 	}
 }
 
@@ -162,11 +166,14 @@ void insb (unsigned long port, void *dst, unsigned long count)
 void insw (unsigned long port, void *dst, unsigned long count)
 {
 	unsigned int l = 0, l2;
+	unsigned char *p;
+
+	p = (unsigned char *)dst;
 	
 	if (!count)
 		return;
 	
-	switch (((unsigned long) dst) & 0x3)
+	switch (((unsigned long)p) & 0x3)
 	{
 	 case 0x00:			/* Buffer 32-bit aligned */
 		while (count>=2) {
@@ -174,28 +181,28 @@ void insw (unsigned long port, void *dst, unsigned long count)
 			count -= 2;
 			l = cpu_to_le16(inw(port)) << 16;
 			l |= cpu_to_le16(inw(port));
-			*(unsigned int *) dst = l;
-			((unsigned int *) dst)++;
+			*(unsigned int *)p = l;
+			p += 4;
 		}
 		if (count) {
-			*(unsigned short *) dst = cpu_to_le16(inw(port));
+			*(unsigned short *)p = cpu_to_le16(inw(port));
 		}
 		break;
 	
 	 case 0x02:			/* Buffer 16-bit aligned */
-		*(unsigned short *) dst = cpu_to_le16(inw(port));
-		((unsigned short *) dst)++;
+		*(unsigned short *)p = cpu_to_le16(inw(port));
+		p += 2;
 		count--;
 		while (count>=2) {
 			
 			count -= 2;
 			l = cpu_to_le16(inw(port)) << 16;
 			l |= cpu_to_le16(inw(port));
-			*(unsigned int *) dst = l;
-			((unsigned int *) dst)++;
+			*(unsigned int *)p = l;
+			p += 4;
 		}
 		if (count) {
-			*(unsigned short *) dst = cpu_to_le16(inw(port));
+			*(unsigned short *)p = cpu_to_le16(inw(port));
 		}
 		break;
 		
@@ -206,16 +213,16 @@ void insw (unsigned long port, void *dst, unsigned long count)
 		--count;
 		
 		l = cpu_to_le16(inw(port));
-		*(unsigned char *) dst = l >> 8;
-		((unsigned char *) dst)++;
+		*p = l >> 8;
+		p++;
 		while (count--)
 		{
 			l2 = cpu_to_le16(inw(port));
-			*(unsigned short *) dst = (l & 0xff) << 8 | (l2 >> 8);
-			((unsigned short *) dst)++;
+			*(unsigned short *)p = (l & 0xff) << 8 | (l2 >> 8);
+			p += 2;
 			l = l2;
 		}
-		*(unsigned char *) dst = l & 0xff;
+		*p = l & 0xff;
 		break;
 	}
 }
@@ -231,6 +238,9 @@ void insw (unsigned long port, void *dst, unsigned long count)
 void insl (unsigned long port, void *dst, unsigned long count)
 {
 	unsigned int l = 0, l2;
+	unsigned char *p;
+
+	p = (unsigned char *)dst;
 	
 	if (!count)
 		return;
@@ -240,8 +250,8 @@ void insl (unsigned long port, void *dst, unsigned long count)
 	 case 0x00:			/* Buffer 32-bit aligned */
 		while (count--)
 		{
-			*(unsigned int *) dst = cpu_to_le32(inl(port));
-			((unsigned int *) dst)++;
+			*(unsigned int *)p = cpu_to_le32(inl(port));
+			p += 4;
 		}
 		break;
 	
@@ -249,51 +259,51 @@ void insl (unsigned long port, void *dst, unsigned long count)
 		--count;
 		
 		l = cpu_to_le32(inl(port));
-		*(unsigned short *) dst = l >> 16;
-		((unsigned short *) dst)++;
+		*(unsigned short *)p = l >> 16;
+		p += 2;
 		
 		while (count--)
 		{
 			l2 = cpu_to_le32(inl(port));
-			*(unsigned int *) dst = (l & 0xffff) << 16 | (l2 >> 16);
-			((unsigned int *) dst)++;
+			*(unsigned int *)p = (l & 0xffff) << 16 | (l2 >> 16);
+			p += 4;
 			l = l2;
 		}
-		*(unsigned short *) dst = l & 0xffff;
+		*(unsigned short *)p = l & 0xffff;
 		break;
 	 case 0x01:			/* Buffer 8-bit aligned */
 		--count;
 		
 		l = cpu_to_le32(inl(port));
-		*(unsigned char *) dst = l >> 24;
-		((unsigned char *) dst)++;
-		*(unsigned short *) dst = (l >> 8) & 0xffff;
-		((unsigned short *) dst)++;
+		*(unsigned char *)p = l >> 24;
+		p++;
+		*(unsigned short *)p = (l >> 8) & 0xffff;
+		p += 2;
 		while (count--)
 		{
 			l2 = cpu_to_le32(inl(port));
-			*(unsigned int *) dst = (l & 0xff) << 24 | (l2 >> 8);
-			((unsigned int *) dst)++;
+			*(unsigned int *)p = (l & 0xff) << 24 | (l2 >> 8);
+			p += 4;
 			l = l2;
 		}
-		*(unsigned char *) dst = l & 0xff;
+		*p = l & 0xff;
 		break;
 	 case 0x03:			/* Buffer 8-bit aligned */
 		--count;
 		
 		l = cpu_to_le32(inl(port));
-		*(unsigned char *) dst = l >> 24;
-		((unsigned char *) dst)++;
+		*p = l >> 24;
+		p++;
 		while (count--)
 		{
 			l2 = cpu_to_le32(inl(port));
-			*(unsigned int *) dst = (l & 0xffffff) << 8 | l2 >> 24;
-			((unsigned int *) dst)++;
+			*(unsigned int *)p = (l & 0xffffff) << 8 | l2 >> 24;
+			p += 4;
 			l = l2;
 		}
-		*(unsigned short *) dst = (l >> 8) & 0xffff;
-		((unsigned short *) dst)++;
-		*(unsigned char *) dst = l & 0xff;
+		*(unsigned short *)p = (l >> 8) & 0xffff;
+		p += 2;
+		*p = l & 0xff;
 		break;
 	}
 }
@@ -307,10 +317,13 @@ void insl (unsigned long port, void *dst, unsigned long count)
  */
 void outsb(unsigned long port, const void * src, unsigned long count)
 {
+	const unsigned char *p;
+
+	p = (const unsigned char *)src;
 	while (count) {
 		count--;
-		outb(*(char *)src, port);
-		((char *) src)++;
+		outb(*p, port);
+		p++;
 	}
 }
 
@@ -323,40 +336,43 @@ void outsb(unsigned long port, const void * src, unsigned long count)
 void outsw (unsigned long port, const void *src, unsigned long count)
 {
 	unsigned int l = 0, l2;
+	const unsigned char *p;
+
+	p = (const unsigned char *)src;
 	
 	if (!count)
 		return;
 	
-	switch (((unsigned long) src) & 0x3)
+	switch (((unsigned long)p) & 0x3)
 	{
 	 case 0x00:			/* Buffer 32-bit aligned */
 		while (count>=2) {
 			count -= 2;
-			l = *(unsigned int *) src;
-			((unsigned int *) src)++;
+			l = *(unsigned int *)p;
+			p += 4;
 			outw(le16_to_cpu(l >> 16), port);
 			outw(le16_to_cpu(l & 0xffff), port);
 		}
 		if (count) {
-			outw(le16_to_cpu(*(unsigned short*)src), port);
+			outw(le16_to_cpu(*(unsigned short*)p), port);
 		}
 		break;
 	
 	 case 0x02:			/* Buffer 16-bit aligned */
 		
-		outw(le16_to_cpu(*(unsigned short*)src), port);
-		((unsigned short *) src)++;
+		outw(le16_to_cpu(*(unsigned short*)p), port);
+		p += 2;
 		count--;
 		
 		while (count>=2) {
 			count -= 2;
-			l = *(unsigned int *) src;
-			((unsigned int *) src)++;
+			l = *(unsigned int *)p;
+			p += 4;
 			outw(le16_to_cpu(l >> 16), port);
 			outw(le16_to_cpu(l & 0xffff), port);
 		}
 		if (count) {
-			outw(le16_to_cpu(*(unsigned short*)src), port);
+			outw(le16_to_cpu(*(unsigned short *)p), port);
 		}
 		break;
 		
@@ -364,18 +380,18 @@ void outsw (unsigned long port, const void *src, unsigned long count)
 		/* I don't bother with 32bit transfers
 		 * in this case, 16bit will have to do -- DE */
 		
-		l  = *(unsigned char *) src << 8;
-		((unsigned char *) src)++;
+		l  = *p << 8;
+		p++;
 		count--;
 		while (count)
 		{
 			count--;
-			l2 = *(unsigned short *) src;
-			((unsigned short *) src)++;
+			l2 = *(unsigned short *)p;
+			p += 2;
 			outw(le16_to_cpu(l | l2 >> 8), port);
 		        l = l2 << 8;
 		}
-		l2 = *(unsigned char *) src;
+		l2 = *(unsigned char *)p;
 		outw (le16_to_cpu(l | l2>>8), port);
 		break;
 	
@@ -392,68 +408,73 @@ void outsw (unsigned long port, const void *src, unsigned long count)
 void outsl (unsigned long port, const void *src, unsigned long count)
 {
 	unsigned int l = 0, l2;
+	const unsigned char *p;
+
+	p = (const unsigned char *)src;
 	
 	if (!count)
 		return;
 	
-	switch (((unsigned long) src) & 0x3)
+	switch (((unsigned long)p) & 0x3)
 	{
 	 case 0x00:			/* Buffer 32-bit aligned */
 		while (count--)
 		{
-			outl(le32_to_cpu(*(unsigned int *) src), port);
-			((unsigned int *) src)++;
+			outl(le32_to_cpu(*(unsigned int *)p), port);
+			p += 4;
 		}
 		break;
 	
 	 case 0x02:			/* Buffer 16-bit aligned */
 		--count;
 		
-		l = *(unsigned short *) src;
-		((unsigned short *) src)++;
+		l = *(unsigned short *)p;
+		p += 2;
 		
 		while (count--)
 		{
-			l2 = *(unsigned int *) src;
-			((unsigned int *) src)++;
+			l2 = *(unsigned int *)p;
+			p += 4;
 			outl (le32_to_cpu(l << 16 | l2 >> 16), port);
 			l = l2;
 		}
-		l2 = *(unsigned short *) src;
+		l2 = *(unsigned short *)p;
 		outl (le32_to_cpu(l << 16 | l2), port);
 		break;
 	 case 0x01:			/* Buffer 8-bit aligned */
 		--count;
-		
-		l  = *(unsigned char *) src << 24;
-		((unsigned char *) src)++;
-		l |= *(unsigned short *) src << 8;
-		((unsigned short *) src)++;
+
+		l = *p << 24;
+		p++;
+		l |= *(unsigned short *)p << 8;
+		p += 2;
+
 		while (count--)
 		{
-			l2 = *(unsigned int *) src;
-			((unsigned int *) src)++;
+			l2 = *(unsigned int *)p;
+			p += 4;
 			outl (le32_to_cpu(l | l2 >> 24), port);
 			l = l2 << 8;
 		}
-		l2 = *(unsigned char *) src;
-		      outl (le32_to_cpu(l | l2), port);
+		l2 = *p;
+		outl (le32_to_cpu(l | l2), port);
 		break;
 	 case 0x03:			/* Buffer 8-bit aligned */
 		--count;
 		
-		l  = *(unsigned char *) src << 24;
-		((unsigned char *) src)++;
+		l = *p << 24;
+		p++;
+
 		while (count--)
 		{
-			l2 = *(unsigned int *) src;
-			((unsigned int *) src)++;
+			l2 = *(unsigned int *)p;
+			p += 4;
 			outl (le32_to_cpu(l | l2 >> 8), port);
 			l = l2 << 24;
 		}
-		l2  = *(unsigned short *) src << 16;
-		((unsigned short *) src)++;
-		l2 |= *(unsigned char *) src;
+		l2 = *(unsigned short *)p << 16;
+		p += 2;
+		l2 |= *p;
 		outl (le32_to_cpu(l | l2), port);
 		break;
 	}
diff --git a/arch/parisc/mm/init.c b/arch/parisc/mm/init.c
index e7a8b1bc9..871d7df27 100644
--- a/arch/parisc/mm/init.c
+++ b/arch/parisc/mm/init.c
@@ -5,6 +5,7 @@
  *  Copyright 1999 SuSE GmbH
  *    changed by Philipp Rumpf
  *  Copyright 1999 Philipp Rumpf (prumpf@tux.org)
+ *  Copyright 2004 Randolph Chung (tausq@debian.org)
  *
  */
 
@@ -23,6 +24,7 @@
 #include <asm/pgalloc.h>
 #include <asm/tlb.h>
 #include <asm/pdc_chassis.h>
+#include <asm/mmzone.h>
 
 DEFINE_PER_CPU(struct mmu_gather, mmu_gathers);
 
@@ -32,10 +34,9 @@ extern char _end;	/* end of BSS, defined by linker */
 extern char __init_begin, __init_end;
 
 #ifdef CONFIG_DISCONTIGMEM
-struct node_map_data node_data[MAX_PHYSMEM_RANGES];
-bootmem_data_t bmem_data[MAX_PHYSMEM_RANGES];
-unsigned char *chunkmap;
-unsigned int maxchunkmap;
+struct node_map_data node_data[MAX_NUMNODES];
+bootmem_data_t bmem_data[MAX_NUMNODES];
+unsigned char pfnnid_map[PFNNID_MAP_MAX];
 #endif
 
 static struct resource data_resource = {
@@ -119,21 +120,6 @@ static void __init setup_bootmem(void)
 
 	disable_sr_hashing(); /* Turn off space register hashing */
 
-#ifdef CONFIG_DISCONTIGMEM
-	/*
-	 * The below is still true as of 2.4.2. If this is ever fixed,
-	 * we can remove this warning!
-	 */
-
-	printk(KERN_WARNING "\n\n");
-	printk(KERN_WARNING "CONFIG_DISCONTIGMEM is enabled, which is probably a mistake. This\n");
-	printk(KERN_WARNING "option can lead to heavy swapping, even when there are gigabytes\n");
-	printk(KERN_WARNING "of free memory.\n\n");
-#endif
-
-#ifdef __LP64__
-
-#ifndef CONFIG_DISCONTIGMEM
 	/*
 	 * Sort the ranges. Since the number of ranges is typically
 	 * small, and performance is not an issue here, just do
@@ -160,11 +146,10 @@ static void __init setup_bootmem(void)
 		}
 	}
 
+#ifndef CONFIG_DISCONTIGMEM
 	/*
 	 * Throw out ranges that are too far apart (controlled by
-	 * MAX_GAP). If CONFIG_DISCONTIGMEM wasn't implemented so
-	 * poorly, we would recommend enabling that option, but,
-	 * until it is fixed, this is the best way to go.
+	 * MAX_GAP).
 	 */
 
 	for (i = 1; i < npmem_ranges; i++) {
@@ -172,6 +157,11 @@ static void __init setup_bootmem(void)
 			(pmem_ranges[i-1].start_pfn +
 			 pmem_ranges[i-1].pages) > MAX_GAP) {
 			npmem_ranges = i;
+			printk("Large gap in memory detected (%ld pages). "
+			       "Consider turning on CONFIG_DISCONTIGMEM\n",
+			       pmem_ranges[i].start_pfn -
+			       (pmem_ranges[i-1].start_pfn +
+			        pmem_ranges[i-1].pages));
 			break;
 		}
 	}
@@ -194,8 +184,6 @@ static void __init setup_bootmem(void)
 		}
 	}
 
-#endif /* __LP64__ */
-
 	sysram_resource_count = npmem_ranges;
 	for (i = 0; i < sysram_resource_count; i++) {
 		struct resource *res = &sysram_resources[i];
@@ -218,6 +206,7 @@ static void __init setup_bootmem(void)
 	mem_limit_func();       /* check for "mem=" argument */
 
 	mem_max = 0;
+	num_physpages = 0;
 	for (i = 0; i < npmem_ranges; i++) {
 		unsigned long rsize;
 
@@ -232,15 +221,16 @@ static void __init setup_bootmem(void)
 				npmem_ranges = i + 1;
 				mem_max = mem_limit;
 			}
+	        num_physpages += pmem_ranges[i].pages;
 			break;
 		}
+	    num_physpages += pmem_ranges[i].pages;
 		mem_max += rsize;
 	}
 
 	printk(KERN_INFO "Total Memory: %ld Mb\n",mem_max >> 20);
 
 #ifndef CONFIG_DISCONTIGMEM
-
 	/* Merge the ranges, keeping track of the holes */
 
 	{
@@ -272,9 +262,18 @@ static void __init setup_bootmem(void)
 	bootmap_start_pfn = PAGE_ALIGN(__pa((unsigned long) &_end)) >> PAGE_SHIFT;
 
 #ifdef CONFIG_DISCONTIGMEM
+	for (i = 0; i < MAX_PHYSMEM_RANGES; i++) {
+		memset(NODE_DATA(i), 0, sizeof(pg_data_t));
+		NODE_DATA(i)->bdata = &bmem_data[i];
+	}
+	memset(pfnnid_map, 0xff, sizeof(pfnnid_map));
+
+	numnodes = npmem_ranges;
+
 	for (i = 0; i < npmem_ranges; i++)
-		node_data[i].pg_data.bdata = &bmem_data[i];
+		node_set_online(i);
 #endif
+
 	/*
 	 * Initialize and free the full range of memory in each range.
 	 * Note that the only writing these routines do are to the bootmap,
@@ -443,16 +442,20 @@ unsigned long pcxl_dma_start;
 
 void __init mem_init(void)
 {
-	int i;
-
 	high_memory = __va((max_pfn << PAGE_SHIFT));
-	max_mapnr = (virt_to_page(high_memory - 1) - mem_map) + 1;
 
-	num_physpages = 0;
-	mem_map = zone_table[0]->zone_mem_map;
-	for (i = 0; i < npmem_ranges; i++)
-		num_physpages += free_all_bootmem_node(NODE_DATA(i));
-	totalram_pages = num_physpages;
+#ifndef CONFIG_DISCONTIGMEM
+	max_mapnr = page_to_pfn(virt_to_page(high_memory - 1)) + 1;
+	mem_map = zone_table[ZONE_DMA]->zone_mem_map;
+	totalram_pages += free_all_bootmem();
+#else
+	{
+		int i;
+
+		for (i = 0; i < npmem_ranges; i++)
+			totalram_pages += free_all_bootmem_node(NODE_DATA(i));
+	}
+#endif
 
 	printk(KERN_INFO "Memory: %luk available\n", num_physpages << (PAGE_SHIFT-10));
 
@@ -484,7 +487,9 @@ void show_mem(void)
 
 	printk(KERN_INFO "Mem-info:\n");
 	show_free_areas();
-	printk(KERN_INFO "Free swap:	 %6dkB\n",nr_swap_pages<<(PAGE_SHIFT-10));
+	printk(KERN_INFO "Free swap:	 %6ldkB\n",
+				nr_swap_pages<<(PAGE_SHIFT-10));
+#ifndef CONFIG_DISCONTIGMEM
 	i = max_mapnr;
 	while (i-- > 0) {
 		total++;
@@ -492,15 +497,55 @@ void show_mem(void)
 			reserved++;
 		else if (PageSwapCache(mem_map+i))
 			cached++;
-		else if (!atomic_read(&mem_map[i].count))
+		else if (!page_count(&mem_map[i]))
 			free++;
 		else
-			shared += atomic_read(&mem_map[i].count) - 1;
+			shared += page_count(&mem_map[i]) - 1;
+	}
+#else
+	for (i = 0; i < npmem_ranges; i++) {
+		int j;
+
+		for (j = node_start_pfn(i); j < node_end_pfn(i); j++) {
+			struct page *p;
+
+			p = node_mem_map(i) + j - node_start_pfn(i);
+
+			total++;
+			if (PageReserved(p))
+				reserved++;
+			else if (PageSwapCache(p))
+				cached++;
+			else if (!page_count(p))
+				free++;
+			else
+				shared += page_count(p) - 1;
+        	}
 	}
+#endif
 	printk(KERN_INFO "%d pages of RAM\n", total);
 	printk(KERN_INFO "%d reserved pages\n", reserved);
 	printk(KERN_INFO "%d pages shared\n", shared);
 	printk(KERN_INFO "%d pages swap cached\n", cached);
+
+
+#ifdef CONFIG_DISCONTIGMEM
+	{
+		struct zonelist *zl;
+		int i, j, k;
+
+		for (i = 0; i < npmem_ranges; i++) {
+			for (j = 0; j < MAX_NR_ZONES; j++) {
+				zl = NODE_DATA(i)->node_zonelists + j;
+
+				printk("Zone list for zone %d on node %d: ", j, i);
+				for (k = 0; zl->zones[k] != NULL; k++) 
+					printk("[%d/%s] ", zl->zones[k]->zone_pgdat->node_id, zl->zones[k]->name);
+				printk("\n");
+			}
+		}
+	}
+#endif
 }
 
 
@@ -543,7 +588,7 @@ static void __init map_pages(unsigned long start_vaddr, unsigned long start_padd
 #if PTRS_PER_PMD == 1
 		pmd = (pmd_t *)__pa(pg_dir);
 #else
-		pmd = (pmd_t *) (PAGE_MASK & pgd_val(*pg_dir));
+		pmd = (pmd_t *)pgd_address(*pg_dir);
 
 		/*
 		 * pmd is physical at this point
@@ -554,7 +599,7 @@ static void __init map_pages(unsigned long start_vaddr, unsigned long start_padd
 			pmd = (pmd_t *) __pa(pmd);
 		}
 
-		pgd_val(*pg_dir) = _PAGE_TABLE | (unsigned long) pmd;
+		pgd_populate(NULL, pg_dir, __va(pmd));
 #endif
 		pg_dir++;
 
@@ -567,15 +612,14 @@ static void __init map_pages(unsigned long start_vaddr, unsigned long start_padd
 			 * pg_table is physical at this point
 			 */
 
-			pg_table = (pte_t *) (PAGE_MASK & pmd_val(*pmd));
+			pg_table = (pte_t *)pmd_address(*pmd);
 			if (!pg_table) {
 				pg_table = (pte_t *)
 					alloc_bootmem_low_pages_node(NODE_DATA(0),PAGE_SIZE);
 				pg_table = (pte_t *) __pa(pg_table);
 			}
 
-			pmd_val(*pmd) = _PAGE_TABLE |
-					   (unsigned long) pg_table;
+			pmd_populate_kernel(NULL, pmd, __va(pg_table));
 
 			/* now change pg_table to kernel virtual addresses */
 
@@ -583,8 +627,6 @@ static void __init map_pages(unsigned long start_vaddr, unsigned long start_padd
 			for (tmp2 = start_pte; tmp2 < PTRS_PER_PTE; tmp2++,pg_table++) {
 				pte_t pte;
 
-#if !defined(CONFIG_STI_CONSOLE)
-#warning STI console should explicitly allocate executable pages but does not
 				/*
 				 * Map the fault vector writable so we can
 				 * write the HPMC checksum.
@@ -594,7 +636,6 @@ static void __init map_pages(unsigned long start_vaddr, unsigned long start_padd
 							&& address != gw_addr)
 				    pte = __mk_pte(address, PAGE_KERNEL_RO);
 				else
-#endif
 				    pte = __mk_pte(address, pgprot);
 
 				if (address >= end_paddr)
@@ -757,61 +798,26 @@ void __init paging_init(void)
 	flush_tlb_all_local();
 
 	for (i = 0; i < npmem_ranges; i++) {
-		unsigned long zones_size[MAX_NR_ZONES] = { 0, 0, 0, };
+		unsigned long zones_size[MAX_NR_ZONES] = { 0, 0, 0 };
 
+		/* We have an IOMMU, so all memory can go into a single
+		   ZONE_DMA zone. */
 		zones_size[ZONE_DMA] = pmem_ranges[i].pages;
+
 		free_area_init_node(i,NODE_DATA(i),NULL,zones_size,
-				(pmem_ranges[i].start_pfn << PAGE_SHIFT),0);
-	}
+				pmem_ranges[i].start_pfn, 0);
 
 #ifdef CONFIG_DISCONTIGMEM
-	/*
-	 * Initialize support for virt_to_page() macro.
-	 *
-	 * Note that MAX_ADDRESS is the largest virtual address that
-	 * we can map. However, since we map all physical memory into
-	 * the kernel address space, it also has an effect on the maximum
-	 * physical address we can map (MAX_ADDRESS - PAGE_OFFSET).
-	 */
-
-	maxchunkmap = MAX_ADDRESS >> CHUNKSHIFT;
-	chunkmap = (unsigned char *)alloc_bootmem(maxchunkmap);
-
-	for (i = 0; i < maxchunkmap; i++)
-	    chunkmap[i] = BADCHUNK;
-
-	for (i = 0; i < npmem_ranges; i++) {
-
-		ADJ_NODE_MEM_MAP(i) = NODE_MEM_MAP(i) - pmem_ranges[i].start_pfn;
 		{
-			unsigned long chunk_paddr;
-			unsigned long end_paddr;
-			int chunknum;
-
-			chunk_paddr = (pmem_ranges[i].start_pfn << PAGE_SHIFT);
-			end_paddr = chunk_paddr + (pmem_ranges[i].pages << PAGE_SHIFT);
-			chunk_paddr &= CHUNKMASK;
-
-			chunknum = (int)CHUNKNUM(chunk_paddr);
-			while (chunk_paddr < end_paddr) {
-				if (chunknum >= maxchunkmap)
-					goto badchunkmap1;
-				if (chunkmap[chunknum] != BADCHUNK)
-					goto badchunkmap2;
-				chunkmap[chunknum] = (unsigned char)i;
-				chunk_paddr += CHUNKSZ;
-				chunknum++;
-			}
+		    int j;
+		    for (j = (node_start_pfn(i) >> PFNNID_SHIFT);
+			 j <= (node_end_pfn(i) >> PFNNID_SHIFT);
+			 j++) {
+			pfnnid_map[j] = i;
+		    }
 		}
-	}
-
-	return;
-
-badchunkmap1:
-	panic("paging_init: Physical address exceeds maximum address space!\n");
-badchunkmap2:
-	panic("paging_init: Collision in chunk map array. CHUNKSZ needs to be smaller\n");
 #endif
+	}
 }
 
 #ifdef CONFIG_PA20
diff --git a/arch/ppc/8260_io/Kconfig b/arch/ppc/8260_io/Kconfig
index a613c5c1b..391e8541f 100644
--- a/arch/ppc/8260_io/Kconfig
+++ b/arch/ppc/8260_io/Kconfig
@@ -1,12 +1,9 @@
 #
-# MPC8260 Communication options
+# CPM2 Communication options
 #
 
-menu "MPC8260 CPM Options"
-	depends on 8260
-
-config SCC_CONSOLE
-	bool "Enable SCC Console"
+menu "CPM2 Options"
+	depends on CPM2
 
 config SCC_ENET
 	bool "CPM SCC Ethernet"
@@ -24,19 +21,19 @@ config FCC1_ENET
 	bool "Ethernet on FCC1"
 	depends on FEC_ENET
 	help
-	  Use MPC8260 fast Ethernet controller 1 to drive Ethernet (default).
+	  Use CPM2 fast Ethernet controller 1 to drive Ethernet (default).
 
 config FCC2_ENET
 	bool "Ethernet on FCC2"
 	depends on FEC_ENET
 	help
-	  Use MPC8260 fast Ethernet controller 2 to drive Ethernet.
+	  Use CPM2 fast Ethernet controller 2 to drive Ethernet.
 
 config FCC3_ENET
 	bool "Ethernet on FCC3"
 	depends on FEC_ENET
 	help
-	  Use MPC8260 fast Ethernet controller 3 to drive Ethernet.
+	  Use CPM2 fast Ethernet controller 3 to drive Ethernet.
 
 config USE_MDIO
 	bool "Use MDIO for PHY configuration"
diff --git a/arch/ppc/8260_io/Makefile b/arch/ppc/8260_io/Makefile
index 0114d933e..971f292c5 100644
--- a/arch/ppc/8260_io/Makefile
+++ b/arch/ppc/8260_io/Makefile
@@ -1,8 +1,6 @@
 #
-# Makefile for the linux MPC8xx ppc-specific parts of comm processor
+# Makefile for the linux ppc-specific parts of comm processor (v2)
 #
 
-obj-y			:= commproc.o uart.o
-
 obj-$(CONFIG_FEC_ENET)	+= fcc_enet.o
 obj-$(CONFIG_SCC_ENET)	+= enet.o
diff --git a/arch/ppc/8260_io/enet.c b/arch/ppc/8260_io/enet.c
index 7a9a7bf31..3f8aa4197 100644
--- a/arch/ppc/8260_io/enet.c
+++ b/arch/ppc/8260_io/enet.c
@@ -40,12 +40,12 @@
 #include <linux/skbuff.h>
 #include <linux/spinlock.h>
 
-#include <asm/immap_8260.h>
+#include <asm/immap_cpm2.h>
 #include <asm/pgtable.h>
 #include <asm/mpc8260.h>
 #include <asm/bitops.h>
 #include <asm/uaccess.h>
-#include <asm/cpm_8260.h>
+#include <asm/cpm2.h>
 #include <asm/irq.h>
 
 /*
@@ -376,7 +376,7 @@ scc_enet_interrupt(int irq, void * dev_id, struct pt_regs * regs)
 	    }
 
 	    if (must_restart) {
-		volatile cpm8260_t *cp;
+		volatile cpm_cpm2_t *cp;
 
 		/* Some transmit errors cause the transmitter to shut
 		 * down.  We now issue a restart transmit.  Since the
@@ -552,10 +552,10 @@ static void set_multicast_list(struct net_device *dev)
 	
 		/* Log any net taps. */
 		printk("%s: Promiscuous mode enabled.\n", dev->name);
-		cep->sccp->scc_pmsr |= SCC_PSMR_PRO;
+		cep->sccp->scc_psmr |= SCC_PSMR_PRO;
 	} else {
 
-		cep->sccp->scc_pmsr &= ~SCC_PSMR_PRO;
+		cep->sccp->scc_psmr &= ~SCC_PSMR_PRO;
 
 		if (dev->flags & IFF_ALLMULTI) {
 			/* Catch all multicast addresses, so set the
@@ -613,19 +613,20 @@ static int __init scc_enet_init(void)
 	struct net_device *dev;
 	struct scc_enet_private *cep;
 	int i, j, err;
+	uint dp_offset;
 	unsigned char	*eap;
 	unsigned long	mem_addr;
 	bd_t		*bd;
 	volatile	cbd_t		*bdp;
-	volatile	cpm8260_t	*cp;
+	volatile	cpm_cpm2_t	*cp;
 	volatile	scc_t		*sccp;
 	volatile	scc_enet_t	*ep;
-	volatile	immap_t		*immap;
-	volatile	iop8260_t	*io;
+	volatile	cpm2_map_t		*immap;
+	volatile	iop_cpm2_t	*io;
 
 	cp = cpmp;	/* Get pointer to Communication Processor */
 
-	immap = (immap_t *)IMAP_ADDR;	/* and to internal registers */
+	immap = (cpm2_map_t *)CPM_MAP_ADDR;	/* and to internal registers */
 	io = &immap->im_ioport;
 
 	bd = (bd_t *)__res;
@@ -680,13 +681,13 @@ static int __init scc_enet_init(void)
 	 * These are relative offsets in the DP ram address space.
 	 * Initialize base addresses for the buffer descriptors.
 	 */
-	i = m8260_cpm_dpalloc(sizeof(cbd_t) * RX_RING_SIZE, 8);
-	ep->sen_genscc.scc_rbase = i;
-	cep->rx_bd_base = (cbd_t *)&immap->im_dprambase[i];
+	dp_offset = cpm_dpalloc(sizeof(cbd_t) * RX_RING_SIZE, 8);
+	ep->sen_genscc.scc_rbase = dp_offset;
+	cep->rx_bd_base = (cbd_t *)cpm_dpram_addr(dp_offset);
 
-	i = m8260_cpm_dpalloc(sizeof(cbd_t) * TX_RING_SIZE, 8);
-	ep->sen_genscc.scc_tbase = i;
-	cep->tx_bd_base = (cbd_t *)&immap->im_dprambase[i];
+	dp_offset = cpm_dpalloc(sizeof(cbd_t) * TX_RING_SIZE, 8);
+	ep->sen_genscc.scc_tbase = dp_offset;
+	cep->tx_bd_base = (cbd_t *)cpm_dpram_addr(dp_offset);
 
 	cep->dirty_tx = cep->cur_tx = cep->tx_bd_base;
 	cep->cur_rx = cep->rx_bd_base;
@@ -820,7 +821,7 @@ static int __init scc_enet_init(void)
 	/* Set processing mode.  Use Ethernet CRC, catch broadcast, and
 	 * start frame search 22 bit times after RENA.
 	 */
-	sccp->scc_pmsr = (SCC_PSMR_ENCRC | SCC_PSMR_NIB22);
+	sccp->scc_psmr = (SCC_PSMR_ENCRC | SCC_PSMR_NIB22);
 
 	/* It is now OK to enable the Ethernet transmitter.
 	 * Unfortunately, there are board implementation differences here.
diff --git a/arch/ppc/8260_io/fcc_enet.c b/arch/ppc/8260_io/fcc_enet.c
index d9df49ceb..d56a031e6 100644
--- a/arch/ppc/8260_io/fcc_enet.c
+++ b/arch/ppc/8260_io/fcc_enet.c
@@ -35,13 +35,13 @@
 #include <linux/skbuff.h>
 #include <linux/spinlock.h>
 
-#include <asm/immap_8260.h>
+#include <asm/immap_cpm2.h>
 #include <asm/pgtable.h>
 #include <asm/mpc8260.h>
 #include <asm/irq.h>
 #include <asm/bitops.h>
 #include <asm/uaccess.h>
-#include <asm/cpm_8260.h>
+#include <asm/cpm2.h>
 
 /* The transmitter timeout
  */
@@ -159,20 +159,23 @@ static int fcc_enet_set_mac_address(struct net_device *dev, void *addr);
 #define PA1_DIRA1	(PA1_TXDAT | PA1_TXEN | PA1_TXER)
 
 #ifdef CONFIG_SBC82xx
-/* rx is clk9, tx is clk10
- */
+/* rx is clk9, tx is clk10 */
 #define PC_F1RXCLK     ((uint)0x00000100)
 #define PC_F1TXCLK     ((uint)0x00000200)
 #define CMX1_CLK_ROUTE ((uint)0x25000000)
 #define CMX1_CLK_MASK  ((uint)0xff000000)
-#else
-/* CLK12 is receive, CLK11 is transmit.  These are board specific.
-*/
+#elif defined(CONFIG_ADS8272)
+#define PC_F1RXCLK	((uint)0x00000400)
+#define PC_F1TXCLK	((uint)0x00000200)
+#define CMX1_CLK_ROUTE	((uint)0x36000000)
+#define CMX1_CLK_MASK	((uint)0xff000000)
+#else /* other boards */
+/* CLK12 is receive, CLK11 is transmit.  These are board specific. */
 #define PC_F1RXCLK	((uint)0x00000800)
 #define PC_F1TXCLK	((uint)0x00000400)
 #define CMX1_CLK_ROUTE	((uint)0x3e000000)
 #define CMX1_CLK_MASK	((uint)0xff000000)
-#endif /* !CONFIG_SBC82xx */
+#endif
 
 /* I/O Pin assignment for FCC2.  I don't yet know the best way to do this,
  * but there is little variation among the choices.
@@ -193,10 +196,17 @@ static int fcc_enet_set_mac_address(struct net_device *dev, void *addr);
 
 /* CLK13 is receive, CLK14 is transmit.  These are board dependent.
 */
+#ifdef CONFIG_ADS8272
+#define PC_F2RXCLK	((uint)0x00004000)
+#define PC_F2TXCLK	((uint)0x00008000)
+#define CMX2_CLK_ROUTE	((uint)0x00370000)
+#define CMX2_CLK_MASK	((uint)0x00ff0000)
+#else
 #define PC_F2RXCLK	((uint)0x00001000)
 #define PC_F2TXCLK	((uint)0x00002000)
 #define CMX2_CLK_ROUTE	((uint)0x00250000)
 #define CMX2_CLK_MASK	((uint)0x00ff0000)
+#endif
 
 /* I/O Pin assignment for FCC3.  I don't yet know the best way to do this,
  * but there is little variation among the choices.
@@ -228,6 +238,9 @@ static int fcc_enet_set_mac_address(struct net_device *dev, void *addr);
 /* TQM8260 has MDIO and MDCK on PC30 and PC31 respectively */
 #define PC_MDIO		((uint)0x00000002)
 #define PC_MDCK		((uint)0x00000001)
+#elif defined(CONFIG_ADS8272)
+#define PC_MDIO		((uint)0x00002000)
+#define PC_MDCK		((uint)0x00001000)
 #else
 #define PC_MDIO		((uint)0x00000004)
 #define PC_MDCK		((uint)0x00000020)
@@ -255,7 +268,7 @@ static fcc_info_t fcc_ports[] = {
 #ifdef CONFIG_FCC1_ENET
 	{ 0, CPM_CR_FCC1_SBLOCK, CPM_CR_FCC1_PAGE, PROFF_FCC1, SIU_INT_FCC1,
 		(PC_F1RXCLK | PC_F1TXCLK), CMX1_CLK_ROUTE, CMX1_CLK_MASK,
-# if defined(CONFIG_TQM8260)
+# if defined(CONFIG_TQM8260) || defined(CONFIG_ADS8272)
 		PC_MDIO, PC_MDCK },
 # else
 		0x00000004, 0x00000100 },
@@ -264,7 +277,7 @@ static fcc_info_t fcc_ports[] = {
 #ifdef CONFIG_FCC2_ENET
 	{ 1, CPM_CR_FCC2_SBLOCK, CPM_CR_FCC2_PAGE, PROFF_FCC2, SIU_INT_FCC2,
 		(PC_F2RXCLK | PC_F2TXCLK), CMX2_CLK_ROUTE, CMX2_CLK_MASK,
-# if defined(CONFIG_TQM8260)
+# if defined(CONFIG_TQM8260) || defined(CONFIG_ADS8272)
 		PC_MDIO, PC_MDCK },
 # elif defined(CONFIG_EST8260) || defined(CONFIG_ADS8260)
 		0x00400000, 0x00200000 },
@@ -275,7 +288,7 @@ static fcc_info_t fcc_ports[] = {
 #ifdef CONFIG_FCC3_ENET
 	{ 2, CPM_CR_FCC3_SBLOCK, CPM_CR_FCC3_PAGE, PROFF_FCC3, SIU_INT_FCC3,
 		(PC_F3RXCLK | PC_F3TXCLK), CMX3_CLK_ROUTE, CMX3_CLK_MASK,
-# if defined(CONFIG_TQM8260)
+# if defined(CONFIG_TQM8260) || defined(CONFIG_ADS8272)
 		PC_MDIO, PC_MDCK },
 # else
 		0x00000001, 0x00000040 },
@@ -331,12 +344,12 @@ struct fcc_enet_private {
 };
 
 static void init_fcc_shutdown(fcc_info_t *fip, struct fcc_enet_private *cep,
-	volatile immap_t *immap);
+	volatile cpm2_map_t *immap);
 static void init_fcc_startup(fcc_info_t *fip, struct net_device *dev);
-static void init_fcc_ioports(fcc_info_t *fip, volatile iop8260_t *io,
-	volatile immap_t *immap);
+static void init_fcc_ioports(fcc_info_t *fip, volatile iop_cpm2_t *io,
+	volatile cpm2_map_t *immap);
 static void init_fcc_param(fcc_info_t *fip, struct net_device *dev,
-	volatile immap_t *immap);
+	volatile cpm2_map_t *immap);
 
 #ifdef	CONFIG_USE_MDIO
 static int	mii_queue(struct net_device *dev, int request, void (*func)(uint, struct net_device *));
@@ -586,7 +599,7 @@ fcc_enet_interrupt(int irq, void * dev_id, struct pt_regs * regs)
 	    }
 
 	    if (must_restart) {
-		volatile cpm8260_t *cp;
+		volatile cpm_cpm2_t *cp;
 
 		/* Some transmit errors cause the transmitter to shut
 		 * down.  We now issue a restart transmit.  Since the
@@ -1052,6 +1065,75 @@ static phy_info_t phy_info_qs6612 = {
 #endif /* CONFIG_FEC_QS6612 */
 
 
+/* ------------------------------------------------------------------------- */
+/* The Davicom DM9131 is used on the HYMOD board			     */
+
+#ifdef CONFIG_FCC_DM9131
+
+/* register definitions */
+
+#define MII_DM9131_ACR		16	/* Aux. Config Register		*/
+#define MII_DM9131_ACSR		17	/* Aux. Config/Status Register	*/
+#define MII_DM9131_10TCSR	18	/* 10BaseT Config/Status Reg.	*/
+#define MII_DM9131_INTR		21	/* Interrupt Register		*/
+#define MII_DM9131_RECR		22	/* Receive Error Counter Reg.	*/
+#define MII_DM9131_DISCR	23	/* Disconnect Counter Register	*/
+
+static void mii_parse_dm9131_acsr(uint mii_reg, struct net_device *dev)
+{
+	volatile struct fcc_enet_private *fep = dev->priv;
+	uint s = fep->phy_status;
+
+	s &= ~(PHY_STAT_SPMASK);
+
+	switch ((mii_reg >> 12) & 0xf) {
+	case 1: s |= PHY_STAT_10HDX;  break;
+	case 2: s |= PHY_STAT_10FDX;  break;
+	case 4: s |= PHY_STAT_100HDX; break;
+	case 8: s |= PHY_STAT_100FDX; break;
+	}
+
+	fep->phy_status = s;
+}
+
+static phy_info_t phy_info_dm9131 = {
+	0x00181b80,
+	"DM9131",
+
+	(const phy_cmd_t []) {  /* config */
+		/* parse cr and anar to get some info */
+		{ mk_mii_read(MII_REG_CR), mii_parse_cr },
+		{ mk_mii_read(MII_REG_ANAR), mii_parse_anar },
+		{ mk_mii_end, }
+	},
+	(const phy_cmd_t []) {  /* startup - enable interrupts */
+		{ mk_mii_write(MII_DM9131_INTR, 0x0002), NULL },
+		{ mk_mii_write(MII_REG_CR, 0x1200), NULL }, /* autonegotiate */
+		{ mk_mii_end, }
+	},
+	(const phy_cmd_t []) { /* ack_int */
+
+		/* we need to read INTR, SR and ANER to acknowledge */
+
+		{ mk_mii_read(MII_DM9131_INTR), NULL },
+		{ mk_mii_read(MII_REG_SR), mii_parse_sr },
+		{ mk_mii_read(MII_REG_ANER), NULL },
+
+		/* read acsr to get info */
+
+		{ mk_mii_read(MII_DM9131_ACSR), mii_parse_dm9131_acsr },
+		{ mk_mii_end, }
+	},
+	(const phy_cmd_t []) {  /* shutdown - disable interrupts */
+		{ mk_mii_write(MII_DM9131_INTR, 0x0f00), NULL },
+		{ mk_mii_end, }
+	},
+};
+
+
+#endif /* CONFIG_FEC_DM9131 */
+
+
 static phy_info_t *phy_info[] = {
 
 #ifdef CONFIG_FCC_LXT970
@@ -1064,7 +1146,11 @@ static phy_info_t *phy_info[] = {
 
 #ifdef CONFIG_FCC_QS6612
 	&phy_info_qs6612,
-#endif /* CONFIG_FEC_LXT971 */
+#endif /* CONFIG_FEC_QS6612 */
+
+#ifdef CONFIG_FCC_DM9131
+	&phy_info_dm9131,
+#endif /* CONFIG_FEC_DM9131 */
 
 	NULL
 };
@@ -1361,10 +1447,10 @@ static int __init fec_enet_init(void)
 	struct fcc_enet_private *cep;
 	fcc_info_t	*fip;
 	int	i, np, err;
-	volatile	immap_t		*immap;
-	volatile	iop8260_t	*io;
+	volatile	cpm2_map_t		*immap;
+	volatile	iop_cpm2_t	*io;
 
-	immap = (immap_t *)IMAP_ADDR;	/* and to internal registers */
+	immap = (cpm2_map_t *)CPM_MAP_ADDR;	/* and to internal registers */
 	io = &immap->im_ioport;
 
 	np = sizeof(fcc_ports) / sizeof(fcc_info_t);
@@ -1431,7 +1517,7 @@ module_init(fec_enet_init);
 */
 static void __init
 init_fcc_shutdown(fcc_info_t *fip, struct fcc_enet_private *cep,
-						volatile immap_t *immap)
+						volatile cpm2_map_t *immap)
 {
 	volatile	fcc_enet_t	*ep;
 	volatile	fcc_t		*fccp;
@@ -1454,8 +1540,8 @@ init_fcc_shutdown(fcc_info_t *fip, struct fcc_enet_private *cep,
 /* Initialize the I/O pins for the FCC Ethernet.
 */
 static void __init
-init_fcc_ioports(fcc_info_t *fip, volatile iop8260_t *io,
-						volatile immap_t *immap)
+init_fcc_ioports(fcc_info_t *fip, volatile iop_cpm2_t *io,
+						volatile cpm2_map_t *immap)
 {
 
 	/* FCC1 pins are on port A/C.  FCC2/3 are port B/C.
@@ -1513,7 +1599,7 @@ init_fcc_ioports(fcc_info_t *fip, volatile iop8260_t *io,
 
 static void __init
 init_fcc_param(fcc_info_t *fip, struct net_device *dev,
-						volatile immap_t *immap)
+						volatile cpm2_map_t *immap)
 {
 	unsigned char	*eap;
 	unsigned long	mem_addr;
@@ -1522,7 +1608,7 @@ init_fcc_param(fcc_info_t *fip, struct net_device *dev,
 	struct		fcc_enet_private *cep;
 	volatile	fcc_enet_t	*ep;
 	volatile	cbd_t		*bdp;
-	volatile	cpm8260_t	*cp;
+	volatile	cpm_cpm2_t	*cp;
 
 	cep = (struct fcc_enet_private *)(dev->priv);
 	ep = cep->ep;
@@ -1535,28 +1621,15 @@ init_fcc_param(fcc_info_t *fip, struct net_device *dev,
 	 */
 	memset((char *)ep, 0, sizeof(fcc_enet_t));
 
-	/* Allocate space for the buffer descriptors in the DP ram.
-	 * These are relative offsets in the DP ram address space.
+	/* Allocate space for the buffer descriptors from regular memory.
 	 * Initialize base addresses for the buffer descriptors.
 	 */
-#if 0
-	/* I really want to do this, but for some reason it doesn't
-	 * work with the data cache enabled, so I allocate from the
-	 * main memory instead.
-	 */
-	i = m8260_cpm_dpalloc(sizeof(cbd_t) * RX_RING_SIZE, 8);
-	ep->fen_genfcc.fcc_rbase = (uint)&immap->im_dprambase[i];
-	cep->rx_bd_base = (cbd_t *)&immap->im_dprambase[i];
-
-	i = m8260_cpm_dpalloc(sizeof(cbd_t) * TX_RING_SIZE, 8);
-	ep->fen_genfcc.fcc_tbase = (uint)&immap->im_dprambase[i];
-	cep->tx_bd_base = (cbd_t *)&immap->im_dprambase[i];
-#else
-	cep->rx_bd_base = (cbd_t *)m8260_cpm_hostalloc(sizeof(cbd_t) * RX_RING_SIZE, 8);
+	cep->rx_bd_base = (cbd_t *)kmalloc(sizeof(cbd_t) * RX_RING_SIZE,
+			GFP_KERNEL | GFP_DMA);
 	ep->fen_genfcc.fcc_rbase = __pa(cep->rx_bd_base);
-	cep->tx_bd_base = (cbd_t *)m8260_cpm_hostalloc(sizeof(cbd_t) * TX_RING_SIZE, 8);
+	cep->tx_bd_base = (cbd_t *)kmalloc(sizeof(cbd_t) * TX_RING_SIZE,
+			GFP_KERNEL | GFP_DMA);
 	ep->fen_genfcc.fcc_tbase = __pa(cep->tx_bd_base);
-#endif
 
 	cep->dirty_tx = cep->cur_tx = cep->tx_bd_base;
 	cep->cur_rx = cep->rx_bd_base;
@@ -1773,11 +1846,11 @@ init_fcc_startup(fcc_info_t *fip, struct net_device *dev)
 	 */
 	fccp->fcc_fpsmr = FCC_PSMR_ENCRC;
 
-#ifdef CONFIG_ADS8260
+#ifdef CONFIG_PQ2ADS
 	/* Enable the PHY.
 	*/
-	ads_csr_addr[1] |= BCSR1_FETH_RST;	/* Remove reset */
-	ads_csr_addr[1] &= ~BCSR1_FETHIEN;	/* Enable */
+        *(volatile uint *)(BCSR_ADDR + 4) &= ~BCSR1_FETHIEN;
+        *(volatile uint *)(BCSR_ADDR + 4) |=  BCSR1_FETH_RST;
 #endif
 
 #if defined(CONFIG_USE_MDIO) || defined(CONFIG_TQM8260)
@@ -1817,10 +1890,10 @@ mii_send_receive(fcc_info_t *fip, uint cmd)
 {
 	uint		retval;
 	int		read_op, i, off;
-	volatile	immap_t		*immap;
-	volatile	iop8260_t	*io;
+	volatile	cpm2_map_t		*immap;
+	volatile	iop_cpm2_t	*io;
 
-	immap = (immap_t *)IMAP_ADDR;
+	immap = (cpm2_map_t *)CPM_MAP_ADDR;
 	io = &immap->im_ioport;
 
 	io->iop_pdirc |= (fip->fc_mdio | fip->fc_mdck);
diff --git a/arch/ppc/8xx_io/commproc.c b/arch/ppc/8xx_io/commproc.c
index ec637ed48..2688504d6 100644
--- a/arch/ppc/8xx_io/commproc.c
+++ b/arch/ppc/8xx_io/commproc.c
@@ -27,6 +27,7 @@
 #include <linux/string.h>
 #include <linux/mm.h>
 #include <linux/interrupt.h>
+#include <linux/module.h>
 #include <asm/irq.h>
 #include <asm/mpc8xx.h>
 #include <asm/page.h>
@@ -34,11 +35,11 @@
 #include <asm/8xx_immap.h>
 #include <asm/commproc.h>
 #include <asm/io.h>
+#include <asm/rheap.h>
 
 extern int get_pteptr(struct mm_struct *mm, unsigned long addr, pte_t **ptep);
 
-static	uint	dp_alloc_base;	/* Starting offset in DP ram */
-static	uint	dp_alloc_top;	/* Max offset + 1 */
+static void m8xx_cpm_dpinit(void);
 static	uint	host_buffer;	/* One page of host buffer */
 static	uint	host_end;	/* end + 1 */
 cpm8xx_t	*cpmp;		/* Pointer to comm processor space */
@@ -84,10 +85,8 @@ m8xx_cpm_reset(void)
 	 */
 	imp->im_siu_conf.sc_sdcr = 1;
 
-	/* Reclaim the DP memory for our use.
-	*/
-	dp_alloc_base = CPM_DATAONLY_BASE;
-	dp_alloc_top = dp_alloc_base + CPM_DATAONLY_SIZE;
+	/* Reclaim the DP memory for our use. */
+	m8xx_cpm_dpinit();
 
 	/* Tell everyone where the comm processor resides.
 	*/
@@ -138,10 +137,8 @@ m8xx_cpm_reset(uint host_page_addr)
 	*/
 	imp->im_siu_conf.sc_sdcr = 1;
 
-	/* Reclaim the DP memory for our use.
-	*/
-	dp_alloc_base = CPM_DATAONLY_BASE;
-	dp_alloc_top = dp_alloc_base + CPM_DATAONLY_SIZE;
+	/* Reclaim the DP memory for our use. */
+	m8xx_cpm_dpinit();
 
 	/* Set the host page for allocation.
 	*/
@@ -257,30 +254,6 @@ cpm_free_handler(int vec)
 	((immap_t *)IMAP_ADDR)->im_cpic.cpic_cimr &= ~(1 << vec);
 }
 
-/* Allocate some memory from the dual ported ram.  We may want to
- * enforce alignment restrictions, but right now everyone is a good
- * citizen.
- */
-uint
-m8xx_cpm_dpalloc(uint size)
-{
-	uint	retloc;
-
-	if ((dp_alloc_base + size) >= dp_alloc_top)
-		return(CPM_DP_NOSPACE);
-
-	retloc = dp_alloc_base;
-	dp_alloc_base += size;
-
-	return(retloc);
-}
-
-uint
-m8xx_cpm_dpalloc_index(void)
-{
-	return dp_alloc_base;
-}
-
 /* We also own one page of host buffer space for the allocation of
  * UART "fifos" and the like.
  */
@@ -313,7 +286,7 @@ m8xx_cpm_hostalloc(uint size)
 #define BRG_UART_CLK_DIV16	(BRG_UART_CLK/16)
 
 void
-m8xx_cpm_setbrg(uint brg, uint rate)
+cpm_setbrg(uint brg, uint rate)
 {
 	volatile uint	*bp;
 
@@ -330,3 +303,97 @@ m8xx_cpm_setbrg(uint brg, uint rate)
 		*bp = (((BRG_UART_CLK_DIV16 / rate) - 1) << 1) |
 						CPM_BRG_EN | CPM_BRG_DIV16;
 }
+
+/*
+ * dpalloc / dpfree bits.
+ */
+static spinlock_t cpm_dpmem_lock;
+/*
+ * 16 blocks should be enough to satisfy all requests
+ * until the memory subsystem goes up...
+ */
+static rh_block_t cpm_boot_dpmem_rh_block[16];
+static rh_info_t cpm_dpmem_info;
+
+#define CPM_DPMEM_ALIGNMENT	8
+
+void m8xx_cpm_dpinit(void)
+{
+	cpm8xx_t *cp = &((immap_t *)IMAP_ADDR)->im_cpm;
+
+	spin_lock_init(&cpm_dpmem_lock);
+
+	/* Initialize the info header */
+	rh_init(&cpm_dpmem_info, CPM_DPMEM_ALIGNMENT,
+			sizeof(cpm_boot_dpmem_rh_block) /
+			sizeof(cpm_boot_dpmem_rh_block[0]),
+			cpm_boot_dpmem_rh_block);
+
+	/*
+	 * Attach the usable dpmem area.
+	 * XXX: This is actually crap.  CPM_DATAONLY_BASE and
+	 * CPM_DATAONLY_SIZE are a subset of the available dparm.  It varies
+	 * with the processor and the microcode patches applied / activated.
+	 * But the following should be at least safe.
+	 */
+	rh_attach_region(&cpm_dpmem_info, (void *)CPM_DATAONLY_BASE, CPM_DATAONLY_SIZE);
+}
+
+/*
+ * Allocate the requested size worth of DP memory.
+ * This function used to return an index into the DPRAM area.
+ * Now it returns the actuall physical address of that area.
+ * use m8xx_cpm_dpram_offset() to get the index
+ */
+uint cpm_dpalloc(uint size, uint align)
+{
+	void *start;
+	unsigned long flags;
+
+	spin_lock_irqsave(&cpm_dpmem_lock, flags);
+	cpm_dpmem_info.alignment = align;
+	start = rh_alloc(&cpm_dpmem_info, size, "commproc");
+	spin_unlock_irqrestore(&cpm_dpmem_lock, flags);
+
+	return (uint)start;
+}
+EXPORT_SYMBOL(cpm_dpalloc);
+
+int cpm_dpfree(uint offset)
+{
+	int ret;
+	unsigned long flags;
+
+	spin_lock_irqsave(&cpm_dpmem_lock, flags);
+	ret = rh_free(&cpm_dpmem_info, (void *)offset);
+	spin_unlock_irqrestore(&cpm_dpmem_lock, flags);
+
+	return ret;
+}
+EXPORT_SYMBOL(cpm_dpfree);
+
+uint cpm_dpalloc_fixed(uint offset, uint size, uint align)
+{
+	void *start;
+	unsigned long flags;
+
+	spin_lock_irqsave(&cpm_dpmem_lock, flags);
+	cpm_dpmem_info.alignment = align;
+	start = rh_alloc_fixed(&cpm_dpmem_info, (void *)offset, size, "commproc");
+	spin_unlock_irqrestore(&cpm_dpmem_lock, flags);
+
+	return (uint)start;
+}
+EXPORT_SYMBOL(cpm_dpalloc_fixed);
+
+void cpm_dpdump(void)
+{
+	rh_dump(&cpm_dpmem_info);
+}
+EXPORT_SYMBOL(cpm_dpdump);
+
+void *cpm_dpram_addr(uint offset)
+{
+	return ((immap_t *)IMAP_ADDR)->im_cpm.cp_dpmem + offset;
+}
+EXPORT_SYMBOL(cpm_dpram_addr);
diff --git a/arch/ppc/8xx_io/cs4218_tdm.c b/arch/ppc/8xx_io/cs4218_tdm.c
index 99dfab887..514e7de40 100644
--- a/arch/ppc/8xx_io/cs4218_tdm.c
+++ b/arch/ppc/8xx_io/cs4218_tdm.c
@@ -1619,7 +1619,7 @@ static ssize_t sound_copy_translate_read(const u_char *userPtr,
 static int mixer_open(struct inode *inode, struct file *file)
 {
 	mixer.busy = 1;
-	return 0;
+	return nonseekable_open(inode, file);
 }
 
 
@@ -2105,7 +2105,7 @@ static int sq_open(struct inode *inode, struct file *file)
 		sound_set_format(AFMT_MU_LAW);
 	}
 
-	return 0;
+	return nonseekable_open(inode, file);
 
 err_out_nobusy:
 	if (file->f_mode & FMODE_WRITE) {
@@ -2404,7 +2404,7 @@ static int state_open(struct inode *inode, struct file *file)
 	len += sprintf(buffer+len, "\tsq.active = %d sq.syncing = %d\n",
 		       sq.active, sq.syncing);
 	state.len = len;
-	return 0;
+	return nonseekable_open(inode, file);
 }
 
 
@@ -2463,7 +2463,7 @@ static long long sound_lseek(struct file *file, long long offset, int orig)
 int __init tdm8xx_sound_init(void)
 {
 	int i, has_sound;
-	uint			dp_addr;
+	uint			dp_offset;
 	volatile uint		*sirp;
 	volatile cbd_t		*bdp;
 	volatile cpm8xx_t	*cp;
@@ -2525,14 +2525,14 @@ int __init tdm8xx_sound_init(void)
 	/* We need to allocate a transmit and receive buffer
 	 * descriptors from dual port ram.
 	 */
-	dp_addr = m8xx_cpm_dpalloc(sizeof(cbd_t) * numReadBufs);
+	dp_addr = cpm_dpalloc(sizeof(cbd_t) * numReadBufs, 8);
 
 	/* Set the physical address of the host memory
 	 * buffers in the buffer descriptors, and the
 	 * virtual address for us to work with.
 	 */
 	bdp = (cbd_t *)&cp->cp_dpmem[dp_addr];
-	up->smc_rbase = dp_addr;
+	up->smc_rbase = dp_offset;
 	rx_cur = rx_base = (cbd_t *)bdp;
 
 	for (i=0; i<(numReadBufs-1); i++) {
@@ -2547,10 +2547,10 @@ int __init tdm8xx_sound_init(void)
 
 	/* Now, do the same for the transmit buffers.
 	*/
-	dp_addr = m8xx_cpm_dpalloc(sizeof(cbd_t) * numBufs);
+	dp_offset = cpm_dpalloc(sizeof(cbd_t) * numBufs, 8);
 
 	bdp = (cbd_t *)&cp->cp_dpmem[dp_addr];
-	up->smc_tbase = dp_addr;
+	up->smc_tbase = dp_offset;
 	tx_cur = tx_base = (cbd_t *)bdp;
 
 	for (i=0; i<(numBufs-1); i++) {
diff --git a/arch/ppc/8xx_io/enet.c b/arch/ppc/8xx_io/enet.c
index 2f45f3456..8ddef1c5c 100644
--- a/arch/ppc/8xx_io/enet.c
+++ b/arch/ppc/8xx_io/enet.c
@@ -644,6 +644,7 @@ static int __init scc_enet_init(void)
 	struct net_device *dev;
 	struct scc_enet_private *cep;
 	int i, j, k, err;
+	uint dp_offset;
 	unsigned char	*eap, *ba;
 	dma_addr_t	mem_addr;
 	bd_t		*bd;
@@ -738,13 +739,13 @@ static int __init scc_enet_init(void)
 	 * These are relative offsets in the DP ram address space.
 	 * Initialize base addresses for the buffer descriptors.
 	 */
-	i = m8xx_cpm_dpalloc(sizeof(cbd_t) * RX_RING_SIZE);
-	ep->sen_genscc.scc_rbase = i;
-	cep->rx_bd_base = (cbd_t *)&cp->cp_dpmem[i];
+	dp_offset = cpm_dpalloc(sizeof(cbd_t) * RX_RING_SIZE, 8);
+	ep->sen_genscc.scc_rbase = dp_offset;
+	cep->rx_bd_base = cpm_dpram_addr(dp_offset);
 
-	i = m8xx_cpm_dpalloc(sizeof(cbd_t) * TX_RING_SIZE);
-	ep->sen_genscc.scc_tbase = i;
-	cep->tx_bd_base = (cbd_t *)&cp->cp_dpmem[i];
+	dp_offset = cpm_dpalloc(sizeof(cbd_t) * TX_RING_SIZE, 8);
+	ep->sen_genscc.scc_tbase = dp_offset;
+	cep->tx_bd_base = cpm_dpram_addr(dp_offset);
 
 	cep->dirty_tx = cep->cur_tx = cep->tx_bd_base;
 	cep->cur_rx = cep->rx_bd_base;
diff --git a/arch/ppc/8xx_io/uart.c b/arch/ppc/8xx_io/uart.c
index 7acc703d4..171e5e900 100644
--- a/arch/ppc/8xx_io/uart.c
+++ b/arch/ppc/8xx_io/uart.c
@@ -2491,7 +2491,7 @@ static int __init rs_8xx_init(void)
 {
 	struct serial_state * state;
 	ser_info_t	*info;
-	uint		mem_addr, dp_addr, iobits;
+	uint		mem_addr, iobits, dp_offset;
 	int		i, j, idx;
 	ushort		chan;
 	volatile	cbd_t		*bdp;
@@ -2623,7 +2623,7 @@ static int __init rs_8xx_init(void)
 			 * descriptors from dual port ram, and a character
 			 * buffer area from host mem.
 			 */
-			dp_addr = m8xx_cpm_dpalloc(sizeof(cbd_t) * RX_NUM_FIFO);
+			dp_offset = cpm_dpalloc(sizeof(cbd_t) * RX_NUM_FIFO, 8);
 
 			/* Allocate space for FIFOs in the host memory.
 			*/
@@ -2634,7 +2634,7 @@ static int __init rs_8xx_init(void)
 			 * buffers in the buffer descriptors, and the
 			 * virtual address for us to work with.
 			 */
-			bdp = (cbd_t *)&cp->cp_dpmem[dp_addr];
+			bdp = (cbd_t *)&cp->cp_dpmem[dp_offset];
 			info->rx_cur = info->rx_bd_base = (cbd_t *)bdp;
 
 			for (j=0; j<(RX_NUM_FIFO-1); j++) {
@@ -2650,15 +2650,15 @@ static int __init rs_8xx_init(void)
 			if (info->state->smc_scc_num & NUM_IS_SCC) {
 				scp = &cp->cp_scc[idx];
 				sup = (scc_uart_t *)&cp->cp_dparam[state->port];
-				sup->scc_genscc.scc_rbase = dp_addr;
+				sup->scc_genscc.scc_rbase = dp_offset;
 			}
 			else {
 				sp = &cp->cp_smc[idx];
 				up = (smc_uart_t *)&cp->cp_dparam[state->port];
-				up->smc_rbase = dp_addr;
+				up->smc_rbase = dp_offset;
 			}
 
-			dp_addr = m8xx_cpm_dpalloc(sizeof(cbd_t) * TX_NUM_FIFO);
+			dp_offset = cpm_dpalloc(sizeof(cbd_t) * TX_NUM_FIFO, 8);
 
 			/* Allocate space for FIFOs in the host memory.
 			*/
@@ -2669,7 +2669,7 @@ static int __init rs_8xx_init(void)
 			 * buffers in the buffer descriptors, and the
 			 * virtual address for us to work with.
 			 */
-			bdp = (cbd_t *)&cp->cp_dpmem[dp_addr];
+			bdp = (cbd_t *)&cp->cp_dpmem[dp_offset];
 			info->tx_cur = info->tx_bd_base = (cbd_t *)bdp;
 
 			for (j=0; j<(TX_NUM_FIFO-1); j++) {
@@ -2682,7 +2682,7 @@ static int __init rs_8xx_init(void)
 			bdp->cbd_sc = (BD_SC_WRAP | BD_SC_INTRPT);
 
 			if (info->state->smc_scc_num & NUM_IS_SCC) {
-				sup->scc_genscc.scc_tbase = dp_addr;
+				sup->scc_genscc.scc_tbase = dp_offset;
 
 				/* Set up the uart parameters in the
 				 * parameter ram.
@@ -2779,7 +2779,7 @@ static int __init rs_8xx_init(void)
 				cp->cp_simode &= ~(0xffff << (idx * 16));
 				cp->cp_simode |= (i << ((idx * 16) + 12));
 
-				up->smc_tbase = dp_addr;
+				up->smc_tbase = dp_offset;
 
 				/* Set up the uart parameters in the
 				 * parameter ram.
@@ -2843,7 +2843,7 @@ module_init(rs_8xx_init);
 static int __init serial_console_setup(struct console *co, char *options)
 {
 	struct		serial_state *ser;
-	uint		mem_addr, dp_addr, bidx, idx;
+	uint		mem_addr, bidx, idx, dp_offset;
 	ushort		chan;
 	volatile	cbd_t		*bdp;
 	volatile	cpm8xx_t	*cp;
@@ -2889,17 +2889,17 @@ static int __init serial_console_setup(struct console *co, char *options)
 	 * memory yet because vm allocator isn't initialized
 	 * during this early console init.
 	 */
-	dp_addr = m8xx_cpm_dpalloc(8);
-	mem_addr = (uint)(&cpmp->cp_dpmem[dp_addr]);
+	dp_offset = cpm_dpalloc(8, 8);
+	mem_addr = (uint)(&cpmp->cp_dpmem[dp_offset]);
 
 	/* Allocate space for two buffer descriptors in the DP ram.
 	*/
-	dp_addr = m8xx_cpm_dpalloc(sizeof(cbd_t) * 2);
+	dp_offset = cpm_dpalloc(sizeof(cbd_t) * 2, 8);
 
 	/* Set the physical address of the host memory buffers in
 	 * the buffer descriptors.
 	 */
-	bdp = (cbd_t *)&cp->cp_dpmem[dp_addr];
+	bdp = (cbd_t *)&cp->cp_dpmem[dp_offset];
 	bdp->cbd_bufaddr = iopa(mem_addr);
 	(bdp+1)->cbd_bufaddr = iopa(mem_addr+4);
 
@@ -2918,8 +2918,8 @@ static int __init serial_console_setup(struct console *co, char *options)
 	*/
 	if (ser->smc_scc_num & NUM_IS_SCC) {
 
-		sup->scc_genscc.scc_rbase = dp_addr;
-		sup->scc_genscc.scc_tbase = dp_addr + sizeof(cbd_t);
+		sup->scc_genscc.scc_rbase = dp_offset;
+		sup->scc_genscc.scc_tbase = dp_offset + sizeof(cbd_t);
 
 		/* Set up the uart parameters in the
 		 * parameter ram.
@@ -2977,8 +2977,8 @@ static int __init serial_console_setup(struct console *co, char *options)
 
 	}
 	else {
-		up->smc_rbase = dp_addr;	/* Base of receive buffer desc. */
-		up->smc_tbase = dp_addr+sizeof(cbd_t);	/* Base of xmt buffer desc. */
+		up->smc_rbase = dp_offset;	/* Base of receive buffer desc. */
+		up->smc_tbase = dp_offset+sizeof(cbd_t);	/* Base of xmt buffer desc. */
 		up->smc_rfcr = SMC_EB;
 		up->smc_tfcr = SMC_EB;
 
diff --git a/arch/ppc/Kconfig b/arch/ppc/Kconfig
index 1635a6f6e..051832b2e 100644
--- a/arch/ppc/Kconfig
+++ b/arch/ppc/Kconfig
@@ -44,18 +44,18 @@ choice
 	default 6xx
 
 config 6xx
-	bool "6xx/7xx/74xx/8260"
+	bool "6xx/7xx/74xx/52xx/8260"
 	help
 	  There are four types of PowerPC chips supported.  The more common
 	  types (601, 603, 604, 740, 750, 7400), the Motorola embedded
-	  versions (821, 823, 850, 855, 860, 8260), the IBM embedded versions
-	  (403 and 405) and the high end 64 bit Power processors (POWER 3,
-	  POWER4, and IBM 970 also known as G5)
+	  versions (821, 823, 850, 855, 860, 52xx, 8260), the IBM embedded
+	  versions (403 and 405) and the high end 64 bit Power processors 
+	  (POWER 3, POWER4, and IBM 970 also known as G5)
 	  Unless you are building a kernel for one of the embedded processor
 	  systems, 64 bit IBM RS/6000 or an Apple G5, choose 6xx.
 	  Note that the kernel runs in 32-bit mode even on 64-bit chips.
-	  Also note that because the 82xx family has a 603e core, specific
-	  support for that chipset is asked later on.
+	  Also note that because the 52xx & 82xx family has a 603e core,
+	  specific support for that chipset is asked later on.
 
 config 40x
 	bool "40x"
@@ -72,8 +72,21 @@ config POWER4
 config 8xx
 	bool "8xx"
 
+config E500
+	bool "e500"
+
 endchoice
 
+config BOOKE
+	bool
+	depends on E500
+	default y
+
+config FSL_BOOKE
+	bool
+	depends on E500
+	default y
+
 config PTE_64BIT
 	bool
 	depends on 44x
@@ -96,6 +109,21 @@ config ALTIVEC
 
 	  If in doubt, say Y here.
 
+config SPE
+	bool "SPE Support"
+	depends on E500
+	---help---
+	  This option enables kernel support for the Signal Processing
+	  Extensions (SPE) to the PowerPC processor. The kernel currently
+	  supports saving and restoring SPE registers, and turning on the
+	  'spe enable' bit so user processes can execute SPE instructions.
+
+	  This option is only usefully if you have a processor that supports
+	  SPE (e500, otherwise known as 85xx series), but does not have any
+	  affect on a non-spe cpu (it does, however add code to the kernel).
+
+	  If in doubt, say Y here.
+
 config TAU
 	bool "Thermal Management Support"
 	depends on 6xx && !8260
@@ -142,7 +170,7 @@ config TAU_AVERAGE
 
 config MATH_EMULATION
 	bool "Math emulation"
-	depends on 4xx || 8xx
+	depends on 4xx || 8xx || E500
 	---help---
 	  Some PowerPC chips designed for embedded applications do not have
 	  a floating-point unit and therefore do not implement the
@@ -163,7 +191,7 @@ config CPU_FREQ
 	  fly. This is a nice method to save battery power on notebooks,
 	  because the lower the clock speed, the less power the CPU consumes.
 
-	  For more information, take a look at linux/Documentation/cpu-freq or
+	  For more information, take a look at <file:Documentation/cpu-freq> or
 	  at <http://www.brodo.de/cpufreq/>
 
 	  If in doubt, say N.
@@ -198,6 +226,7 @@ config PPC601_SYNC_FIX
 	  If in doubt, say Y here.
 
 source arch/ppc/platforms/4xx/Kconfig
+source arch/ppc/platforms/85xx/Kconfig
 
 config PPC64BRIDGE
 	bool
@@ -295,7 +324,7 @@ config RPXLITE
 
 	  HERMES:
 	  Hermes-Pro ISDN/LAN router with integrated 8 x hub
-	  Manufacturer: Multidata Gesellschaft für Datentechnik und Informatik
+	  Manufacturer: Multidata Gesellschaft für Datentechnik und Informatik
 	  <http://www.multidata.de/>
 	  Date of Release: 2000 (?)
 	  End of life: -
@@ -554,7 +583,7 @@ config SBC82xx
 config SBS8260
 	bool "SBS8260"
 
-config RPX6
+config RPX8260
 	bool "RPXSUPER"
 
 config TQM8260
@@ -569,8 +598,25 @@ config TQM8260
 	  End of Life: not yet :-)
 	  URL: <http://www.denx.de/PDF/TQM82xx_SPEC_Rev005.pdf>
 
+config ADS8272
+	bool "ADS8272"
+
+config LITE5200
+	bool "Freescale LITE5200 / (IceCube)"
+	select PPC_MPC52xx
+	help
+	  Support for the LITE5200 dev board for the MPC5200 from Freescale.
+	  This is for the LITE5200 version 2.0 board. Don't know if it changes
+	  much but it's only been tested on this board version. I think this
+	  board is also known as IceCube.
+
 endchoice
 
+config PQ2ADS
+	bool
+	depends on ADS8272
+	default y
+
 config TQM8xxL
 	bool
 	depends on 8xx && (TQM823L || TQM850L || FPS850L || TQM855L || TQM860L || SM850)
@@ -580,16 +626,37 @@ config EMBEDDEDBOOT
 	bool
 	depends on 8xx || 8260
 	default y
+	
+config PPC_MPC52xx
+	bool
 
 config 8260
-	bool "MPC8260 CPM Support" if WILLOW
+	bool "CPM2 Support" if WILLOW
 	depends on 6xx
-	default y if TQM8260 || RPXSUPER || EST8260 || SBS8260 || SBC82xx
+	default y if TQM8260 || RPX8260 || EST8260 || SBS8260 || SBC82xx
 	help
-	  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.
+	  The MPC8260 is a typical embedded CPU made by Motorola.  Selecting
+	  this option means that you wish to build a kernel for a machine with
+	  an 8260 class CPU.
+
+config 8272
+	bool
+	depends on 6xx
+	default y if ADS8272
+	select 8260
+	help
+	  The MPC8272 CPM has a different internal dpram setup than other CPM2
+	  devices
+
+config CPM2
+	bool
+	depends on 8260 || MPC8560
+	default y
+	help
+	  The CPM2 (Communications Processor Module) is a coprocessor on
+	  embedded CPUs made by Motorola.  Selecting this option means that
+	  you wish to build a kernel for a machine with a CPM2 coprocessor
+	  on it (826x, 827x, 8560).
 
 config PPC_CHRP
 	bool
@@ -650,6 +717,16 @@ config MPC10X_BRIDGE
 	depends on PCORE || POWERPMC250 || LOPEC || SANDPOINT
 	default y
 
+config FSL_OCP
+	bool
+	depends on MPC10X_BRIDGE || PPC_MPC52xx
+	default y
+
+config MPC10X_OPENPIC
+	bool
+	depends on POWERPMC250 || LOPEC || SANDPOINT
+	default y
+
 config MPC10X_STORE_GATHERING
 	bool "Enable MPC10x store gathering"
 	depends on MPC10X_BRIDGE
@@ -672,11 +749,11 @@ config SPRUCE_BAUD_33M
 
 config PC_KEYBOARD
 	bool "PC PS/2 style Keyboard"
-	depends on 4xx || 8260
+	depends on 4xx || CPM2
 
 config SERIAL_CONSOLE
 	bool
-	depends on 8xx || 8260
+	depends on 8xx
 	default y
 
 config SERIAL_CONSOLE_BAUD
@@ -748,39 +825,6 @@ config PROC_DEVICETREE
 	  an image of the device tree that the kernel copies from Open
 	  Firmware. If unsure, say Y here.
 
-config PPC_RTAS
-	bool "Support for RTAS (RunTime Abstraction Services) in /proc"
-	depends on PPC_OF && PROC_FS
-	---help---
-	  When you use this option, you will be able to use RTAS from
-	  userspace.
-
-	  RTAS stands for RunTime Abstraction Services and should
-	  provide a portable way to access and set system information. This is
-	  commonly used on RS/6000 (pSeries) computers.
-
-	  You can access RTAS via the special proc file system entry rtas.
-	  Don't confuse this rtas entry with the one in /proc/device-tree/rtas
-	  which is readonly.
-
-	  If you don't know if you can use RTAS look into
-	  /proc/device-tree/rtas. If there are some entries, it is very likely
-	  that you will be able to use RTAS.
-
-	  You can do cool things with rtas. To print out information about
-	  various sensors in the system, just do a
-
-	  $ cat /proc/rtas/sensors
-
-	  or if you power off your machine at night but want it running when
-	  you enter your office at 7:45 am, do a
-
-	  # date -d 'tomorrow 7:30' +%s > /proc/rtas/poweron
-
-	  and shutdown.
-
-	  If unsure, say Y.
-
 config PREP_RESIDUAL
 	bool "Support for PReP Residual Data"
 	depends on PPC_PREP
@@ -957,7 +1001,7 @@ config ISA
 
 config GENERIC_ISA_DMA
 	bool
-	depends on POWER3 || POWER4 || 6xx && !8260
+	depends on POWER3 || POWER4 || 6xx && !CPM2
 	default y
 
 config EISA
@@ -974,10 +1018,10 @@ config MCA
 	bool
 
 config PCI
-	bool "PCI support" if 40x || 8260
-	default y if !40x && !8260 && !8xx && !APUS
-	default PCI_PERMEDIA if !4xx && !8260 && !8xx && APUS
-	default PCI_QSPAN if !4xx && !8260 && 8xx
+	bool "PCI support" if 40x || CPM2 || 85xx
+	default y if !40x && !CPM2 && !8xx && !APUS && !85xx
+	default PCI_PERMEDIA if !4xx && !CPM2 && !8xx && APUS
+	default PCI_QSPAN if !4xx && !CPM2 && 8xx
 	help
 	  Find out whether your system includes a PCI bus. PCI is the name of
 	  a bus system, i.e. the way the CPU talks to the other stuff inside
@@ -990,11 +1034,39 @@ config PCI_DOMAINS
 
 config PCI_QSPAN
 	bool "QSpan PCI"
-	depends on !4xx && !8260 && 8xx
+	depends on !4xx && !CPM2 && 8xx
 	help
 	  Say Y here if you have a system based on a Motorola 8xx-series
 	  embedded processor with a QSPAN PCI interface, otherwise say N.
 
+config PCI_8260
+	bool
+	depends on PCI && 8260 && !8272
+	default y
+	
+config 8260_PCI9
+	bool "  Enable workaround for MPC826x erratum PCI 9"
+	depends on PCI_8260
+	default y
+
+choice 
+	prompt "  IDMA channel for PCI 9 workaround"
+	depends on 8260_PCI9
+
+config 8260_PCI9_IDMA1
+	bool "IDMA1"
+
+config 8260_PCI9_IDMA2
+	bool "IDMA2"
+
+config 8260_PCI9_IDMA3
+	bool "IDMA3"
+
+config 8260_PCI9_IDMA4
+	bool "IDMA4"
+
+endchoice
+
 config PCI_PERMEDIA
 	bool "PCI for Permedia2"
 	depends on !4xx && !8xx && APUS
@@ -1154,6 +1226,7 @@ endmenu
 
 source "lib/Kconfig"
 
+source "arch/ppc/oprofile/Kconfig"
 
 menu "Kernel hacking"
 
@@ -1201,7 +1274,7 @@ config DEBUG_SPINLOCK_SLEEP
 
 config KGDB
 	bool "Include kgdb kernel debugger"
-	depends on DEBUG_KERNEL
+	depends on DEBUG_KERNEL && (BROKEN || PPC_GEN550 || 4xx)
 	select DEBUG_INFO
 	help
 	  Include in-kernel hooks for kgdb, the Linux kernel source level
@@ -1229,7 +1302,7 @@ endchoice
 
 config KGDB_CONSOLE
 	bool "Enable serial console thru kgdb port"
-	depends on KGDB && 8xx || 8260
+	depends on KGDB && 8xx || CPM2
 	help
 	  If you enable this, all serial console messages will be sent
 	  over the gdb stub.
@@ -1269,11 +1342,11 @@ config BOOTX_TEXT
 
 config SERIAL_TEXT_DEBUG
 	bool "Support for early boot texts over serial port"
-	depends on 4xx || GT64260 || LOPEC || PPLUS || PRPMC800 || PPC_GEN550
+	depends on 4xx || GT64260 || LOPEC || PPLUS || PRPMC800 || PPC_GEN550 || PPC_MPC52xx
 
 config PPC_OCP
 	bool
-	depends on IBM_OCP
+	depends on IBM_OCP || FSL_OCP
 	default y
 
 endmenu
diff --git a/arch/ppc/Makefile b/arch/ppc/Makefile
index 54e9a9e6d..e15c6919a 100644
--- a/arch/ppc/Makefile
+++ b/arch/ppc/Makefile
@@ -13,23 +13,40 @@
 # This must match PAGE_OFFSET in include/asm-ppc/page.h.
 KERNELLOAD	:= $(CONFIG_KERNEL_START)
 
+HAS_BIARCH	:= $(shell if $(CC) -m32 -S -o /dev/null -xc /dev/null > /dev/null 2>&1; then echo y; else echo n; fi;)
+ifeq ($(HAS_BIARCH),y)
+AS		:= $(AS) -a32
+LD		:= $(LD) -m elf32ppc
+CC		:= $(CC) -m32
+endif
+
 LDFLAGS_vmlinux	:= -Ttext $(KERNELLOAD) -Bstatic
 CPPFLAGS	+= -Iarch/$(ARCH)
 AFLAGS		+= -Iarch/$(ARCH)
-cflags-y	+= -Iarch/$(ARCH) -msoft-float -pipe \
-		-ffixed-r2 -Wno-uninitialized -mmultiple -mstring
+CFLAGS		+= -Iarch/$(ARCH) -msoft-float -pipe \
+		-ffixed-r2 -Wno-uninitialized -mmultiple
 CPP		= $(CC) -E $(CFLAGS)
 
-cflags-$(CONFIG_4xx)		+= -Wa,-m405
-cflags-$(CONFIG_PPC64BRIDGE)	+= -Wa,-mppc64bridge
+CHECK		:= $(CHECK) -D__powerpc__=1
+
+ifndef CONFIG_E500
+CFLAGS		+= -mstring
+endif
 
-CFLAGS += $(cflags-y)
+cpu-as-$(CONFIG_PPC64BRIDGE)	+= -Wa,-mppc64bridge
+cpu-as-$(CONFIG_4xx)		+= -Wa,-m405
+cpu-as-$(CONFIG_6xx)		+= -Wa,-maltivec
+cpu-as-$(CONFIG_POWER4)		+= -Wa,-maltivec
+cpu-as-$(CONFIG_E500)		+= -Wa,-me500
 
+AFLAGS += $(cpu-as-y)
+CFLAGS += $(cpu-as-y)
 
 head-y				:= arch/ppc/kernel/head.o
 head-$(CONFIG_8xx)		:= arch/ppc/kernel/head_8xx.o
 head-$(CONFIG_4xx)		:= arch/ppc/kernel/head_4xx.o
 head-$(CONFIG_44x)		:= arch/ppc/kernel/head_44x.o
+head-$(CONFIG_E500)		:= arch/ppc/kernel/head_e500.o
 
 head-$(CONFIG_6xx)		+= arch/ppc/kernel/idle_6xx.o
 head-$(CONFIG_POWER4)		+= arch/ppc/kernel/idle_power4.o
@@ -37,12 +54,15 @@ head-$(CONFIG_POWER4)		+= arch/ppc/kernel/idle_power4.o
 core-y				+= arch/ppc/kernel/ arch/ppc/platforms/ \
 				   arch/ppc/mm/ arch/ppc/lib/ arch/ppc/syslib/
 core-$(CONFIG_4xx)		+= arch/ppc/platforms/4xx/
+core-$(CONFIG_85xx)		+= arch/ppc/platforms/85xx/
 core-$(CONFIG_MATH_EMULATION)	+= arch/ppc/math-emu/
 core-$(CONFIG_XMON)		+= arch/ppc/xmon/
 core-$(CONFIG_APUS)		+= arch/ppc/amiga/
 drivers-$(CONFIG_8xx)		+= arch/ppc/8xx_io/
 drivers-$(CONFIG_4xx)		+= arch/ppc/4xx_io/
-drivers-$(CONFIG_8260)		+= arch/ppc/8260_io/
+drivers-$(CONFIG_CPM2)		+= arch/ppc/8260_io/
+
+drivers-$(CONFIG_OPROFILE)	+= arch/ppc/oprofile/
 
 BOOT_TARGETS = zImage zImage.initrd znetboot znetboot.initrd vmlinux.sm
 
@@ -91,17 +111,24 @@ GOODVER	:= 2.12.1
 else
 NEW_AS	:= 0
 endif
+# gcc-3.4 and binutils-2.14 are a fatal combination.
+GCC_VERSION	:= $(shell $(CONFIG_SHELL) $(srctree)/scripts/gcc-version.sh $(CC))
+BAD_GCC_AS	:= $(shell echo mftb 5 | $(AS) -mppc -many -o /dev/null >/dev/null 2>&1 && echo 0 || echo 1)
 
-ifneq ($(NEW_AS),0)
 checkbin:
+ifeq ($(GCC_VERSION)$(BAD_GCC_AS),03041)
+	@echo -n '*** ${VERSION}.${PATCHLEVEL} kernels no longer build '
+	@echo 'correctly with gcc-3.4 and your version of binutils.'
+	@echo '*** Please upgrade your binutils or downgrade your gcc'
+	@false
+endif
+ifneq ($(NEW_AS),0)
 	@echo -n '*** ${VERSION}.${PATCHLEVEL} kernels no longer build '
 	@echo 'correctly with old versions of binutils.'
 	@echo '*** Please upgrade your binutils to ${GOODVER} or newer'
 	@false
-else
-checkbin:
-	@true
 endif
+	@true
 
 CLEAN_FILES +=	include/asm-$(ARCH)/offsets.h \
 		arch/$(ARCH)/kernel/asm-offsets.s
diff --git a/arch/ppc/boot/common/misc-common.c b/arch/ppc/boot/common/misc-common.c
index fadc77100..868fa81b7 100644
--- a/arch/ppc/boot/common/misc-common.c
+++ b/arch/ppc/boot/common/misc-common.c
@@ -59,7 +59,8 @@ static int _cvt(unsigned long val, char *buf, long radix, char *digits);
 void _vprintk(void(*putc)(const char), const char *fmt0, va_list ap);
 unsigned char *ISA_io = NULL;
 
-#if defined(CONFIG_SERIAL_CONSOLE) || defined(CONFIG_SERIAL_8250_CONSOLE)
+#if defined(CONFIG_SERIAL_CPM_CONSOLE) || defined(CONFIG_SERIAL_8250_CONSOLE) \
+	|| defined(CONFIG_SERIAL_MPC52xx_CONSOLE)
 extern unsigned long com_port;
 
 extern int serial_tstc(unsigned long com_port);
@@ -80,7 +81,8 @@ void exit(void)
 
 int tstc(void)
 {
-#if defined(CONFIG_SERIAL_CONSOLE) || defined(CONFIG_SERIAL_8250_CONSOLE)
+#if defined(CONFIG_SERIAL_CPM_CONSOLE) || defined(CONFIG_SERIAL_8250_CONSOLE) \
+	|| defined(CONFIG_SERIAL_MPC52xx_CONSOLE)
 	if(keyb_present)
 		return (CRT_tstc() || serial_tstc(com_port));
 	else
@@ -93,7 +95,8 @@ int tstc(void)
 int getc(void)
 {
 	while (1) {
-#if defined(CONFIG_SERIAL_CONSOLE) || defined(CONFIG_SERIAL_8250_CONSOLE)
+#if defined(CONFIG_SERIAL_CPM_CONSOLE) || defined(CONFIG_SERIAL_8250_CONSOLE) \
+	|| defined(CONFIG_SERIAL_MPC52xx_CONSOLE)
 		if (serial_tstc(com_port))
 			return (serial_getc(com_port));
 #endif /* serial console */
@@ -108,7 +111,8 @@ putc(const char c)
 {
 	int x,y;
 
-#if defined(CONFIG_SERIAL_CONSOLE) || defined(CONFIG_SERIAL_8250_CONSOLE)
+#if defined(CONFIG_SERIAL_CPM_CONSOLE) || defined(CONFIG_SERIAL_8250_CONSOLE) \
+	|| defined(CONFIG_SERIAL_MPC52xx_CONSOLE)
 	serial_putc(com_port, c);
 	if ( c == '\n' )
 		serial_putc(com_port, '\r');
@@ -155,7 +159,8 @@ void puts(const char *s)
 	y = orig_y;
 
 	while ( ( c = *s++ ) != '\0' ) {
-#if defined(CONFIG_SERIAL_CONSOLE) || defined(CONFIG_SERIAL_8250_CONSOLE)
+#if defined(CONFIG_SERIAL_CPM_CONSOLE) || defined(CONFIG_SERIAL_8250_CONSOLE) \
+	|| defined(CONFIG_SERIAL_MPC52xx_CONSOLE)
 	        serial_putc(com_port, c);
 	        if ( c == '\n' ) serial_putc(com_port, '\r');
 #endif /* serial console */
diff --git a/arch/ppc/boot/simple/Makefile b/arch/ppc/boot/simple/Makefile
index d497a9366..e31b7e499 100644
--- a/arch/ppc/boot/simple/Makefile
+++ b/arch/ppc/boot/simple/Makefile
@@ -113,6 +113,12 @@ zimageinitrd-$(CONFIG_SPRUCE)		:= zImage.initrd-TREE
   entrypoint-$(CONFIG_SPRUCE)		:= 0x00800000
         misc-$(CONFIG_SPRUCE)		+= misc-spruce.o
 
+      zimage-$(CONFIG_LITE5200)		:= zImage-STRIPELF
+zimageinitrd-$(CONFIG_LITE5200)		:= zImage.initrd-STRIPELF
+         end-$(CONFIG_LITE5200)		:= lite5200
+   cacheflag-$(CONFIG_LITE5200)		:= -include $(clear_L2_L3)
+
+
 # SMP images should have a '.smp' suffix.
          end-$(CONFIG_SMP)             := $(end-y).smp
 
@@ -139,11 +145,12 @@ boot-$(CONFIG_MBX)		+= iic.o pci.o qspan_pci.o
 boot-$(CONFIG_RPXCLASSIC)	+= iic.o pci.o qspan_pci.o
 boot-$(CONFIG_RPXLITE)		+= iic.o
 # Different boards need different serial implementations.
-ifeq ($(CONFIG_SERIAL_CONSOLE),y)
+ifeq ($(CONFIG_SERIAL_CPM_CONSOLE),y)
 boot-$(CONFIG_8xx)		+= m8xx_tty.o
 boot-$(CONFIG_8260)		+= m8260_tty.o
-boot-$(CONFIG_GT64260_CONSOLE)	+= gt64260_tty.o
 endif
+boot-$(CONFIG_SERIAL_MPC52xx_CONSOLE) += mpc52xx_tty.o
+boot-$(CONFIG_GT64260_CONSOLE)	+= gt64260_tty.o
 
 LIBS				:= $(common)/lib.a $(bootlib)/lib.a
 ifeq ($(CONFIG_PPC_PREP),y)
diff --git a/arch/ppc/boot/simple/embed_config.c b/arch/ppc/boot/simple/embed_config.c
index 4dc12e6ab..be0b6ca24 100644
--- a/arch/ppc/boot/simple/embed_config.c
+++ b/arch/ppc/boot/simple/embed_config.c
@@ -16,7 +16,7 @@
 #endif
 #ifdef CONFIG_8260
 #include <asm/mpc8260.h>
-#include <asm/immap_8260.h>
+#include <asm/immap_cpm2.h>
 #endif
 #ifdef CONFIG_40x
 #include <asm/io.h>
@@ -97,7 +97,7 @@ embed_config(bd_t **bdp)
 #endif /* CONFIG_MBX */
 
 #if defined(CONFIG_RPXLITE) || defined(CONFIG_RPXCLASSIC) || \
-	defined(CONFIG_RPX6) || defined(CONFIG_EP405)
+	defined(CONFIG_RPX8260) || defined(CONFIG_EP405)
 /* Helper functions for Embedded Planet boards.
 */
 /* Because I didn't find anything that would do this.......
@@ -147,7 +147,7 @@ rpx_eth(bd_t *bd, u_char *cp)
 	}
 }
 
-#ifdef CONFIG_RPX6
+#ifdef CONFIG_RPX8260
 static uint
 rpx_baseten(u_char *cp)
 {
@@ -415,9 +415,9 @@ clk_8260(bd_t *bd)
 {
 	uint	scmr, vco_out, clkin;
 	uint	plldf, pllmf, corecnf;
-	volatile immap_t	*ip;
+	volatile cpm2_map_t	*ip;
 
-	ip = (immap_t *)IMAP_ADDR;
+	ip = (cpm2_map_t *)CPM_MAP_ADDR;
 	scmr = ip->im_clkrst.car_scmr;
 
 	/* The clkin is always bus frequency.
@@ -457,9 +457,9 @@ clk_8280(bd_t *bd)
 {
 	uint	scmr, main_clk, clkin;
 	uint	pllmf, corecnf;
-	volatile immap_t	*ip;
+	volatile cpm2_map_t	*ip;
 
-	ip = (immap_t *)IMAP_ADDR;
+	ip = (cpm2_map_t *)CPM_MAP_ADDR;
 	scmr = ip->im_clkrst.car_scmr;
 
 	/* The clkin is always bus frequency.
@@ -588,7 +588,7 @@ embed_config(bd_t **bdp)
 }
 #endif /* SBS8260 */
 
-#ifdef CONFIG_RPX6
+#ifdef CONFIG_RPX8260
 void
 embed_config(bd_t **bdp)
 {
diff --git a/arch/ppc/boot/simple/head.S b/arch/ppc/boot/simple/head.S
index cb95484fe..fb58d4e4a 100644
--- a/arch/ppc/boot/simple/head.S
+++ b/arch/ppc/boot/simple/head.S
@@ -57,7 +57,7 @@ start_:
 	isync
 #endif
 
-#if defined(CONFIG_MBX) || defined(CONFIG_RPX6) || defined(CONFIG_PPC_PREP)
+#if defined(CONFIG_MBX) || defined(CONFIG_RPX8260) || defined(CONFIG_PPC_PREP)
 	mr	r29,r3	/* On the MBX860, r3 is the board info pointer.
 			 * On the RPXSUPER, r3 points to the NVRAM
 			 * configuration keys.
@@ -129,7 +129,7 @@ haveOF:
 	mr	r3, r29
 #endif
 
-#if defined(CONFIG_MBX) || defined(CONFIG_RPX6) || defined(CONFIG_PPC_PREP)
+#if defined(CONFIG_MBX) || defined(CONFIG_RPX8260) || defined(CONFIG_PPC_PREP)
 	mr	r4,r29	/* put the board info pointer where the relocate
 			 * routine will find it
 			 */
diff --git a/arch/ppc/boot/simple/m8260_tty.c b/arch/ppc/boot/simple/m8260_tty.c
index 9d1d54a5e..c3e2c3942 100644
--- a/arch/ppc/boot/simple/m8260_tty.c
+++ b/arch/ppc/boot/simple/m8260_tty.c
@@ -3,7 +3,8 @@
  */
 #include <linux/types.h>
 #include <asm/mpc8260.h>
-#include <asm/cpm_8260.h>
+#include <asm/cpm2.h>
+#include <asm/immap_cpm2.h>
 
 uint	no_print;
 extern char	*params[];
@@ -14,27 +15,30 @@ static		int	cons_hold_cnt;
 /* If defined, enables serial console.  The value (1 through 4)
  * should designate which SCC is used, but this isn't complete.  Only
  * SCC1 is known to work at this time.
+ * We're only linked if SERIAL_CPM_CONSOLE=y, so we only need to test
+ * SERIAL_CPM_SCC1.
  */
-#ifdef CONFIG_SCC_CONSOLE
+#ifdef CONFIG_SERIAL_CPM_SCC1
 #define SCC_CONSOLE 1
 #endif
 
 unsigned long
 serial_init(int ignored, bd_t *bd)
 {
-	volatile smc_t		*sp;
-	volatile smc_uart_t	*up;
 #ifdef SCC_CONSOLE
 	volatile scc_t		*sccp;
 	volatile scc_uart_t	*sup;
+#else
+	volatile smc_t		*sp;
+	volatile smc_uart_t	*up;
 #endif
 	volatile cbd_t	*tbdf, *rbdf;
-	volatile immap_t	*ip;
-	volatile iop8260_t	*io;
-	volatile cpm8260_t	*cp;
+	volatile cpm2_map_t	*ip;
+	volatile iop_cpm2_t	*io;
+	volatile cpm_cpm2_t	*cp;
 	uint	dpaddr, memaddr;
 
-	ip = (immap_t *)IMAP_ADDR;
+	ip = (cpm2_map_t *)CPM_MAP_ADDR;
 	cp = &ip->im_cpm;
 	io = &ip->im_ioport;
 
@@ -221,12 +225,15 @@ serial_readbuf(u_char *cbuf)
 {
 	volatile cbd_t		*rbdf;
 	volatile char		*buf;
-	volatile smc_uart_t	*up;
+#ifdef SCC_CONSOLE
 	volatile scc_uart_t	*sup;
-	volatile immap_t	*ip;
+#else
+	volatile smc_uart_t	*up;
+#endif
+	volatile cpm2_map_t	*ip;
 	int	i, nc;
 
-	ip = (immap_t *)IMAP_ADDR;
+	ip = (cpm2_map_t *)CPM_MAP_ADDR;
 
 #ifdef SCC_CONSOLE
 	sup = (scc_uart_t *)&ip->im_dprambase[PROFF_SCC1 + ((SCC_CONSOLE-1) << 8)];
@@ -253,12 +260,14 @@ serial_putc(void *ignored, const char c)
 {
 	volatile cbd_t		*tbdf;
 	volatile char		*buf;
-	volatile smc_uart_t	*up;
+#ifdef SCC_CONSOLE
 	volatile scc_uart_t	*sup;
-	volatile immap_t	*ip;
-	extern bd_t		*board_info;
+#else
+	volatile smc_uart_t	*up;
+#endif
+	volatile cpm2_map_t	*ip;
 
-	ip = (immap_t *)IMAP_ADDR;
+	ip = (cpm2_map_t *)CPM_MAP_ADDR;
 #ifdef SCC_CONSOLE
 	sup = (scc_uart_t *)&ip->im_dprambase[PROFF_SCC1 + ((SCC_CONSOLE-1) << 8)];
 	tbdf = (cbd_t *)&ip->im_dprambase[sup->scc_genscc.scc_tbase];
@@ -296,11 +305,14 @@ int
 serial_tstc(void *ignored)
 {
 	volatile cbd_t		*rbdf;
-	volatile smc_uart_t	*up;
+#ifdef SCC_CONSOLE
 	volatile scc_uart_t	*sup;
-	volatile immap_t	*ip;
+#else
+	volatile smc_uart_t	*up;
+#endif
+	volatile cpm2_map_t	*ip;
 
-	ip = (immap_t *)IMAP_ADDR;
+	ip = (cpm2_map_t *)CPM_MAP_ADDR;
 #ifdef SCC_CONSOLE
 	sup = (scc_uart_t *)&ip->im_dprambase[PROFF_SCC1 + ((SCC_CONSOLE-1) << 8)];
 	rbdf = (cbd_t *)&ip->im_dprambase[sup->scc_genscc.scc_rbase];
diff --git a/arch/ppc/boot/simple/misc-embedded.c b/arch/ppc/boot/simple/misc-embedded.c
index e13e7e400..58e2a92e8 100644
--- a/arch/ppc/boot/simple/misc-embedded.c
+++ b/arch/ppc/boot/simple/misc-embedded.c
@@ -83,7 +83,7 @@ load_kernel(unsigned long load_addr, int num_words, unsigned long cksum, bd_t *b
 	 * initialize the serial console port.
 	 */
 	embed_config(&bp);
-#if defined(CONFIG_SERIAL_CONSOLE) || defined(CONFIG_SERIAL_8250_CONSOLE)
+#if defined(CONFIG_SERIAL_CPM_CONSOLE) || defined(CONFIG_SERIAL_8250_CONSOLE)
 	com_port = serial_init(0, bp);
 #endif
 
@@ -260,7 +260,9 @@ load_kernel(unsigned long load_addr, int num_words, unsigned long cksum, bd_t *b
 		rec = (struct bi_record *)((unsigned long)rec + rec->size);
 	}
 	puts("Now booting the kernel\n");
+#if defined(CONFIG_SERIAL_CPM_CONSOLE) || defined(CONFIG_SERIAL_8250_CONSOLE)
 	serial_close(com_port);
+#endif
 
 	return (unsigned long)hold_residual;
 }
diff --git a/arch/ppc/boot/simple/misc.c b/arch/ppc/boot/simple/misc.c
index dd4bdde71..f09af4f28 100644
--- a/arch/ppc/boot/simple/misc.c
+++ b/arch/ppc/boot/simple/misc.c
@@ -221,7 +221,7 @@ decompress_kernel(unsigned long load_addr, int num_words, unsigned long cksum)
 	puts("\n");
 
 	puts("Uncompressing Linux...");
-	gunzip(0, 0x400000, zimage_start, &zimage_size);
+	gunzip(NULL, 0x400000, zimage_start, &zimage_size);
 	puts("done.\n");
 
 	/* get the bi_rec address */
diff --git a/arch/ppc/boot/utils/mktree.c b/arch/ppc/boot/utils/mktree.c
index b5bf82b9d..7ef98c077 100644
--- a/arch/ppc/boot/utils/mktree.c
+++ b/arch/ppc/boot/utils/mktree.c
@@ -15,19 +15,20 @@
 #include <sys/stat.h>
 #include <unistd.h>
 #include <netinet/in.h>
+#include <stdint.h>
 
 /* This gets tacked on the front of the image.  There are also a few
  * bytes allocated after the _start label used by the boot rom (see
  * head.S for details).
  */
 typedef struct boot_block {
-	unsigned long bb_magic;		/* 0x0052504F */
-	unsigned long bb_dest;		/* Target address of the image */
-	unsigned long bb_num_512blocks;	/* Size, rounded-up, in 512 byte blks */
-	unsigned long bb_debug_flag;	/* Run debugger or image after load */
-	unsigned long bb_entry_point;	/* The image address to start */
-	unsigned long bb_checksum;	/* 32 bit checksum including header */
-	unsigned long reserved[2];
+	uint32_t bb_magic;		/* 0x0052504F */
+	uint32_t bb_dest;		/* Target address of the image */
+	uint32_t bb_num_512blocks;	/* Size, rounded-up, in 512 byte blks */
+	uint32_t bb_debug_flag;	/* Run debugger or image after load */
+	uint32_t bb_entry_point;	/* The image address to start */
+	uint32_t bb_checksum;	/* 32 bit checksum including header */
+	uint32_t reserved[2];
 } boot_block_t;
 
 #define IMGBLK	512
diff --git a/arch/ppc/configs/FADS_defconfig b/arch/ppc/configs/FADS_defconfig
index cec100f66..aba7bd86e 100644
--- a/arch/ppc/configs/FADS_defconfig
+++ b/arch/ppc/configs/FADS_defconfig
@@ -196,7 +196,6 @@ CONFIG_IPV6_SCTP__=y
 # 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
 
 #
diff --git a/arch/ppc/configs/IVMS8_defconfig b/arch/ppc/configs/IVMS8_defconfig
index 0d45ef365..3f5eb23c5 100644
--- a/arch/ppc/configs/IVMS8_defconfig
+++ b/arch/ppc/configs/IVMS8_defconfig
@@ -220,7 +220,6 @@ CONFIG_IPV6_SCTP__=y
 # 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
 
 #
diff --git a/arch/ppc/configs/SM850_defconfig b/arch/ppc/configs/SM850_defconfig
index 55093fff6..9553f567c 100644
--- a/arch/ppc/configs/SM850_defconfig
+++ b/arch/ppc/configs/SM850_defconfig
@@ -197,7 +197,6 @@ CONFIG_IPV6_SCTP__=y
 # 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
 
 #
diff --git a/arch/ppc/configs/SPD823TS_defconfig b/arch/ppc/configs/SPD823TS_defconfig
index b94bbfa8e..bc3458b7e 100644
--- a/arch/ppc/configs/SPD823TS_defconfig
+++ b/arch/ppc/configs/SPD823TS_defconfig
@@ -196,7 +196,6 @@ CONFIG_IPV6_SCTP__=y
 # 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
 
 #
diff --git a/arch/ppc/configs/TQM823L_defconfig b/arch/ppc/configs/TQM823L_defconfig
index a60de84ff..073a99a2c 100644
--- a/arch/ppc/configs/TQM823L_defconfig
+++ b/arch/ppc/configs/TQM823L_defconfig
@@ -197,7 +197,6 @@ CONFIG_IPV6_SCTP__=y
 # 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
 
 #
diff --git a/arch/ppc/configs/TQM8260_defconfig b/arch/ppc/configs/TQM8260_defconfig
index 904fce982..57cfa83d1 100644
--- a/arch/ppc/configs/TQM8260_defconfig
+++ b/arch/ppc/configs/TQM8260_defconfig
@@ -182,7 +182,6 @@ CONFIG_IPV6_SCTP__=y
 # 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
 
 #
diff --git a/arch/ppc/configs/TQM850L_defconfig b/arch/ppc/configs/TQM850L_defconfig
index 9132c4d32..5aec1d86f 100644
--- a/arch/ppc/configs/TQM850L_defconfig
+++ b/arch/ppc/configs/TQM850L_defconfig
@@ -197,7 +197,6 @@ CONFIG_IPV6_SCTP__=y
 # 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
 
 #
diff --git a/arch/ppc/configs/TQM860L_defconfig b/arch/ppc/configs/TQM860L_defconfig
index 9cb05d3b4..469fcb48b 100644
--- a/arch/ppc/configs/TQM860L_defconfig
+++ b/arch/ppc/configs/TQM860L_defconfig
@@ -221,7 +221,6 @@ CONFIG_IPV6_SCTP__=y
 # 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
 
 #
diff --git a/arch/ppc/configs/adir_defconfig b/arch/ppc/configs/adir_defconfig
index ea661d02f..3c40aaaec 100644
--- a/arch/ppc/configs/adir_defconfig
+++ b/arch/ppc/configs/adir_defconfig
@@ -334,7 +334,6 @@ CONFIG_IPV6_SCTP__=y
 # 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
 
 #
diff --git a/arch/ppc/configs/ads8272_defconfig b/arch/ppc/configs/ads8272_defconfig
index 709a18066..d1db7d147 100644
--- a/arch/ppc/configs/ads8272_defconfig
+++ b/arch/ppc/configs/ads8272_defconfig
@@ -238,7 +238,6 @@ CONFIG_SYN_COOKIES=y
 # 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
 
 #
diff --git a/arch/ppc/configs/apus_defconfig b/arch/ppc/configs/apus_defconfig
index 21396ffeb..53fb29358 100644
--- a/arch/ppc/configs/apus_defconfig
+++ b/arch/ppc/configs/apus_defconfig
@@ -390,7 +390,6 @@ CONFIG_IPV6_SCTP__=y
 # 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
 
 #
diff --git a/arch/ppc/configs/ash_defconfig b/arch/ppc/configs/ash_defconfig
index b2d8e1c00..c4a73cc16 100644
--- a/arch/ppc/configs/ash_defconfig
+++ b/arch/ppc/configs/ash_defconfig
@@ -235,7 +235,6 @@ CONFIG_SYN_COOKIES=y
 # 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
 
 #
diff --git a/arch/ppc/configs/beech_defconfig b/arch/ppc/configs/beech_defconfig
index 756d07926..0bd671bdc 100644
--- a/arch/ppc/configs/beech_defconfig
+++ b/arch/ppc/configs/beech_defconfig
@@ -269,7 +269,6 @@ CONFIG_IPV6_SCTP__=y
 # 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
 
 #
diff --git a/arch/ppc/configs/bseip_defconfig b/arch/ppc/configs/bseip_defconfig
index 4f84a24c1..227fd153a 100644
--- a/arch/ppc/configs/bseip_defconfig
+++ b/arch/ppc/configs/bseip_defconfig
@@ -193,7 +193,6 @@ CONFIG_IPV6_SCTP__=y
 # 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
 
 #
diff --git a/arch/ppc/configs/bubinga_defconfig b/arch/ppc/configs/bubinga_defconfig
index ea60105b2..ebec80131 100644
--- a/arch/ppc/configs/bubinga_defconfig
+++ b/arch/ppc/configs/bubinga_defconfig
@@ -234,7 +234,6 @@ CONFIG_SYN_COOKIES=y
 # 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
 
 #
diff --git a/arch/ppc/configs/cedar_defconfig b/arch/ppc/configs/cedar_defconfig
index 363138dad..5de8288a0 100644
--- a/arch/ppc/configs/cedar_defconfig
+++ b/arch/ppc/configs/cedar_defconfig
@@ -197,7 +197,6 @@ CONFIG_IPV6_SCTP__=y
 # 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
 
 #
diff --git a/arch/ppc/configs/common_defconfig b/arch/ppc/configs/common_defconfig
index 15ecefd47..1e331f735 100644
--- a/arch/ppc/configs/common_defconfig
+++ b/arch/ppc/configs/common_defconfig
@@ -489,7 +489,6 @@ CONFIG_IP_NF_RAW=m
 # 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
 
 #
diff --git a/arch/ppc/configs/cpci405_defconfig b/arch/ppc/configs/cpci405_defconfig
index 1fc50f5fe..a336ffa8f 100644
--- a/arch/ppc/configs/cpci405_defconfig
+++ b/arch/ppc/configs/cpci405_defconfig
@@ -255,7 +255,6 @@ CONFIG_SYN_COOKIES=y
 # 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
 
 #
diff --git a/arch/ppc/configs/ebony_defconfig b/arch/ppc/configs/ebony_defconfig
index 7dca4c6e1..c8deca3b4 100644
--- a/arch/ppc/configs/ebony_defconfig
+++ b/arch/ppc/configs/ebony_defconfig
@@ -30,6 +30,7 @@ CONFIG_LOG_BUF_SHIFT=14
 # CONFIG_IKCONFIG is not set
 CONFIG_EMBEDDED=y
 CONFIG_KALLSYMS=y
+# CONFIG_KALLSYMS_ALL is not set
 CONFIG_FUTEX=y
 CONFIG_EPOLL=y
 CONFIG_IOSCHED_NOOP=y
@@ -56,6 +57,8 @@ CONFIG_44x=y
 # CONFIG_POWER3 is not set
 # CONFIG_POWER4 is not set
 # CONFIG_8xx is not set
+# CONFIG_E500 is not set
+CONFIG_BOOKE=y
 CONFIG_PTE_64BIT=y
 # CONFIG_MATH_EMULATION is not set
 # CONFIG_CPU_FREQ is not set
@@ -68,7 +71,6 @@ CONFIG_EBONY=y
 # CONFIG_OCOTEA is not set
 CONFIG_440GP=y
 CONFIG_440=y
-CONFIG_BOOKE=y
 CONFIG_IBM_OCP=y
 # CONFIG_PM is not set
 CONFIG_NOT_COHERENT_CACHE=y
@@ -106,6 +108,8 @@ CONFIG_HIGHMEM_START=0xfe000000
 CONFIG_LOWMEM_SIZE=0x30000000
 CONFIG_KERNEL_START=0xc0000000
 CONFIG_TASK_SIZE=0x80000000
+CONFIG_CONSISTENT_START=0xff100000
+CONFIG_CONSISTENT_SIZE=0x00200000
 CONFIG_BOOT_LOAD=0x01000000
 
 #
@@ -115,6 +119,7 @@ CONFIG_BOOT_LOAD=0x01000000
 #
 # Generic Driver Options
 #
+CONFIG_PREVENT_FIRMWARE_BUILD=y
 # CONFIG_DEBUG_DRIVER is not set
 
 #
@@ -141,7 +146,7 @@ CONFIG_BOOT_LOAD=0x01000000
 # CONFIG_BLK_DEV_UMEM is not set
 # CONFIG_BLK_DEV_LOOP is not set
 # CONFIG_BLK_DEV_NBD is not set
-# CONFIG_BLK_DEV_CARMEL is not set
+# CONFIG_BLK_DEV_SX8 is not set
 # CONFIG_BLK_DEV_RAM is not set
 CONFIG_LBD=y
 
@@ -240,13 +245,13 @@ CONFIG_NETFILTER=y
 # 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
+# CONFIG_NET_CLS_ROUTE is not set
 
 #
 # Network testing
@@ -272,6 +277,12 @@ CONFIG_NETDEVICES=y
 # Ethernet (10 or 100Mbit)
 #
 # CONFIG_NET_ETHERNET is not set
+CONFIG_IBM_EMAC=y
+# CONFIG_IBM_EMAC_ERRMSG is not set
+CONFIG_IBM_EMAC_RXB=64
+CONFIG_IBM_EMAC_TXB=8
+CONFIG_IBM_EMAC_FGAP=8
+CONFIG_IBM_EMAC_SKBRES=0
 
 #
 # Ethernet (1000 Mbit)
@@ -310,7 +321,6 @@ CONFIG_NETDEVICES=y
 # CONFIG_HIPPI is not set
 # CONFIG_PPP is not set
 # CONFIG_SLIP is not set
-# CONFIG_RCPCI is not set
 # CONFIG_SHAPER is not set
 # CONFIG_NETCONSOLE is not set
 
@@ -374,7 +384,7 @@ CONFIG_SERIAL_8250=y
 CONFIG_SERIAL_8250_CONSOLE=y
 CONFIG_SERIAL_8250_NR_UARTS=4
 CONFIG_SERIAL_8250_EXTENDED=y
-CONFIG_SERIAL_8250_MANY_PORTS=y
+# CONFIG_SERIAL_8250_MANY_PORTS is not set
 CONFIG_SERIAL_8250_SHARE_IRQ=y
 # CONFIG_SERIAL_8250_DETECT_IRQ is not set
 # CONFIG_SERIAL_8250_MULTIPORT is not set
@@ -544,6 +554,11 @@ CONFIG_MSDOS_PARTITION=y
 CONFIG_CRC32=y
 # CONFIG_LIBCRC32C is not set
 
+#
+# Profiling support
+#
+# CONFIG_PROFILING is not set
+
 #
 # Kernel hacking
 #
diff --git a/arch/ppc/configs/ep405_defconfig b/arch/ppc/configs/ep405_defconfig
index 6f8b1e7ff..880b5f8d3 100644
--- a/arch/ppc/configs/ep405_defconfig
+++ b/arch/ppc/configs/ep405_defconfig
@@ -238,7 +238,6 @@ CONFIG_SYN_COOKIES=y
 # 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
 
 #
diff --git a/arch/ppc/configs/est8260_defconfig b/arch/ppc/configs/est8260_defconfig
index 6da966275..b3f6446bb 100644
--- a/arch/ppc/configs/est8260_defconfig
+++ b/arch/ppc/configs/est8260_defconfig
@@ -178,7 +178,6 @@ CONFIG_IPV6_SCTP__=y
 # 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
 
 #
diff --git a/arch/ppc/configs/ev64260_defconfig b/arch/ppc/configs/ev64260_defconfig
index c5bfc64d7..aa6b0ca08 100644
--- a/arch/ppc/configs/ev64260_defconfig
+++ b/arch/ppc/configs/ev64260_defconfig
@@ -224,7 +224,6 @@ CONFIG_IPV6_SCTP__=y
 # 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
 
 #
diff --git a/arch/ppc/configs/gemini_defconfig b/arch/ppc/configs/gemini_defconfig
index 324f8a7ae..ebcd17b09 100644
--- a/arch/ppc/configs/gemini_defconfig
+++ b/arch/ppc/configs/gemini_defconfig
@@ -278,7 +278,6 @@ CONFIG_IPV6_SCTP__=y
 # 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
 
 #
diff --git a/arch/ppc/configs/ibmchrp_defconfig b/arch/ppc/configs/ibmchrp_defconfig
index 1661b995a..a3b6ec0d5 100644
--- a/arch/ppc/configs/ibmchrp_defconfig
+++ b/arch/ppc/configs/ibmchrp_defconfig
@@ -401,7 +401,6 @@ CONFIG_IP_NF_RAW=m
 # 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
 
 #
diff --git a/arch/ppc/configs/k2_defconfig b/arch/ppc/configs/k2_defconfig
index 9c13d73cc..edf52030f 100644
--- a/arch/ppc/configs/k2_defconfig
+++ b/arch/ppc/configs/k2_defconfig
@@ -349,7 +349,6 @@ CONFIG_IP_NF_COMPAT_IPCHAINS=m
 # 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
 
 #
diff --git a/arch/ppc/configs/lopec_defconfig b/arch/ppc/configs/lopec_defconfig
index 09f1baee9..85ea06b3b 100644
--- a/arch/ppc/configs/lopec_defconfig
+++ b/arch/ppc/configs/lopec_defconfig
@@ -368,7 +368,6 @@ CONFIG_SYN_COOKIES=y
 # 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
 
 #
diff --git a/arch/ppc/configs/mbx_defconfig b/arch/ppc/configs/mbx_defconfig
index d0e818e14..213e69d12 100644
--- a/arch/ppc/configs/mbx_defconfig
+++ b/arch/ppc/configs/mbx_defconfig
@@ -190,7 +190,6 @@ CONFIG_IPV6_SCTP__=y
 # 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
 
 #
diff --git a/arch/ppc/configs/menf1_defconfig b/arch/ppc/configs/menf1_defconfig
index 64eece52a..e84d06af2 100644
--- a/arch/ppc/configs/menf1_defconfig
+++ b/arch/ppc/configs/menf1_defconfig
@@ -279,7 +279,6 @@ CONFIG_IPV6_SCTP__=y
 # 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
 
 #
diff --git a/arch/ppc/configs/mvme5100_defconfig b/arch/ppc/configs/mvme5100_defconfig
index 67a31c66c..6e1a38d72 100644
--- a/arch/ppc/configs/mvme5100_defconfig
+++ b/arch/ppc/configs/mvme5100_defconfig
@@ -346,7 +346,6 @@ CONFIG_IPV6_SCTP__=y
 # 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
 
 #
diff --git a/arch/ppc/configs/oak_defconfig b/arch/ppc/configs/oak_defconfig
index f5764dd84..366cc480c 100644
--- a/arch/ppc/configs/oak_defconfig
+++ b/arch/ppc/configs/oak_defconfig
@@ -193,7 +193,6 @@ CONFIG_IPV6_SCTP__=y
 # 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
 
 #
diff --git a/arch/ppc/configs/ocotea_defconfig b/arch/ppc/configs/ocotea_defconfig
index 292d04b0b..9dcf575c7 100644
--- a/arch/ppc/configs/ocotea_defconfig
+++ b/arch/ppc/configs/ocotea_defconfig
@@ -21,18 +21,22 @@ CONFIG_BROKEN_ON_SMP=y
 #
 CONFIG_SWAP=y
 CONFIG_SYSVIPC=y
+# CONFIG_POSIX_MQUEUE is not set
 # CONFIG_BSD_PROCESS_ACCT is not set
 CONFIG_SYSCTL=y
+# CONFIG_AUDIT is not set
 CONFIG_LOG_BUF_SHIFT=14
 # CONFIG_HOTPLUG is not set
 # CONFIG_IKCONFIG is not set
 CONFIG_EMBEDDED=y
 CONFIG_KALLSYMS=y
+# CONFIG_KALLSYMS_ALL is not set
 CONFIG_FUTEX=y
 CONFIG_EPOLL=y
 CONFIG_IOSCHED_NOOP=y
 CONFIG_IOSCHED_AS=y
 CONFIG_IOSCHED_DEADLINE=y
+CONFIG_IOSCHED_CFQ=y
 # CONFIG_CC_OPTIMIZE_FOR_SIZE is not set
 
 #
@@ -54,6 +58,8 @@ CONFIG_44x=y
 # CONFIG_POWER3 is not set
 # CONFIG_POWER4 is not set
 # CONFIG_8xx is not set
+# CONFIG_E500 is not set
+CONFIG_BOOKE=y
 CONFIG_PTE_64BIT=y
 # CONFIG_MATH_EMULATION is not set
 # CONFIG_CPU_FREQ is not set
@@ -66,9 +72,7 @@ CONFIG_4xx=y
 CONFIG_OCOTEA=y
 CONFIG_440GX=y
 CONFIG_440A=y
-CONFIG_BOOKE=y
 CONFIG_IBM_OCP=y
-CONFIG_PPC_OCP=y
 CONFIG_IBM_EMAC4=y
 # CONFIG_PM is not set
 CONFIG_NOT_COHERENT_CACHE=y
@@ -106,6 +110,8 @@ CONFIG_HIGHMEM_START=0xfe000000
 CONFIG_LOWMEM_SIZE=0x30000000
 CONFIG_KERNEL_START=0xc0000000
 CONFIG_TASK_SIZE=0x80000000
+CONFIG_CONSISTENT_START=0xff100000
+CONFIG_CONSISTENT_SIZE=0x00200000
 CONFIG_BOOT_LOAD=0x01000000
 
 #
@@ -115,6 +121,7 @@ CONFIG_BOOT_LOAD=0x01000000
 #
 # Generic Driver Options
 #
+CONFIG_PREVENT_FIRMWARE_BUILD=y
 # CONFIG_DEBUG_DRIVER is not set
 
 #
@@ -141,7 +148,7 @@ CONFIG_BOOT_LOAD=0x01000000
 # CONFIG_BLK_DEV_UMEM is not set
 # CONFIG_BLK_DEV_LOOP is not set
 # CONFIG_BLK_DEV_NBD is not set
-# CONFIG_BLK_DEV_CARMEL is not set
+# CONFIG_BLK_DEV_SX8 is not set
 # CONFIG_BLK_DEV_RAM is not set
 # CONFIG_LBD is not set
 
@@ -163,7 +170,6 @@ CONFIG_BOOT_LOAD=0x01000000
 #
 # Fusion MPT device support
 #
-# CONFIG_FUSION is not set
 
 #
 # IEEE 1394 (FireWire) support
@@ -212,8 +218,6 @@ CONFIG_IP_PNP_BOOTP=y
 #
 # CONFIG_IP_VS is not set
 # CONFIG_IPV6 is not set
-# CONFIG_DECNET is not set
-# CONFIG_BRIDGE is not set
 CONFIG_NETFILTER=y
 # CONFIG_NETFILTER_DEBUG is not set
 
@@ -232,7 +236,9 @@ CONFIG_NETFILTER=y
 #
 # CONFIG_IP_SCTP is not set
 # CONFIG_ATM is not set
+# CONFIG_BRIDGE is not set
 # CONFIG_VLAN_8021Q is not set
+# CONFIG_DECNET is not set
 # CONFIG_LLC2 is not set
 # CONFIG_IPX is not set
 # CONFIG_ATALK is not set
@@ -241,28 +247,33 @@ CONFIG_NETFILTER=y
 # 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
+# CONFIG_NET_CLS_ROUTE is not set
 
 #
 # Network testing
 #
 # CONFIG_NET_PKTGEN is not set
+# CONFIG_NETPOLL is not set
+# CONFIG_NET_POLL_CONTROLLER is not set
+# CONFIG_HAMRADIO is not set
+# CONFIG_IRDA is not set
+# CONFIG_BT is not set
 CONFIG_NETDEVICES=y
+# CONFIG_DUMMY is not set
+# CONFIG_BONDING is not set
+# CONFIG_EQUALIZER is not set
+# CONFIG_TUN is not set
 
 #
 # 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)
@@ -279,6 +290,12 @@ CONFIG_NET_ETHERNET=y
 #
 # CONFIG_NET_TULIP is not set
 # CONFIG_HP100 is not set
+CONFIG_IBM_EMAC=y
+# CONFIG_IBM_EMAC_ERRMSG is not set
+CONFIG_IBM_EMAC_RXB=128
+CONFIG_IBM_EMAC_TXB=128
+CONFIG_IBM_EMAC_FGAP=8
+CONFIG_IBM_EMAC_SKBRES=0
 # CONFIG_NET_PCI is not set
 
 #
@@ -291,7 +308,6 @@ CONFIG_NET_ETHERNET=y
 # CONFIG_HAMACHI is not set
 # CONFIG_YELLOWFIN is not set
 # CONFIG_R8169 is not set
-# CONFIG_SIS190 is not set
 # CONFIG_SK98LIN is not set
 # CONFIG_TIGON3 is not set
 
@@ -299,51 +315,28 @@ CONFIG_NET_ETHERNET=y
 # Ethernet (10000 Mbit)
 #
 # CONFIG_IXGB is not set
-CONFIG_IBM_EMAC=y
-# CONFIG_IBM_EMAC_ERRMSG is not set
-CONFIG_IBM_EMAC_RXB=128
-CONFIG_IBM_EMAC_TXB=128
-CONFIG_IBM_EMAC_FGAP=8
-CONFIG_IBM_EMAC_SKBRES=0
-# 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
+# CONFIG_S2IO is not set
 
 #
 # Token Ring devices
 #
 # CONFIG_TR is not set
-# CONFIG_RCPCI is not set
-# CONFIG_SHAPER is not set
-# CONFIG_NETCONSOLE is not set
-
-#
-# Wan interfaces
-#
-# CONFIG_WAN is not set
 
 #
-# Amateur Radio support
-#
-# CONFIG_HAMRADIO is not set
-
-#
-# IrDA (infrared) support
+# Wireless LAN (non-hamradio)
 #
-# CONFIG_IRDA is not set
+# CONFIG_NET_RADIO is not set
 
 #
-# Bluetooth support
+# Wan interfaces
 #
-# CONFIG_BT is not set
-# CONFIG_NETPOLL is not set
-# CONFIG_NET_POLL_CONTROLLER is not set
+# CONFIG_WAN is not set
+# CONFIG_FDDI is not set
+# CONFIG_HIPPI is not set
+# CONFIG_PPP is not set
+# CONFIG_SLIP is not set
+# CONFIG_SHAPER is not set
+# CONFIG_NETCONSOLE is not set
 
 #
 # ISDN subsystem
@@ -405,7 +398,7 @@ CONFIG_SERIAL_8250=y
 CONFIG_SERIAL_8250_CONSOLE=y
 CONFIG_SERIAL_8250_NR_UARTS=4
 CONFIG_SERIAL_8250_EXTENDED=y
-CONFIG_SERIAL_8250_MANY_PORTS=y
+# CONFIG_SERIAL_8250_MANY_PORTS is not set
 CONFIG_SERIAL_8250_SHARE_IRQ=y
 # CONFIG_SERIAL_8250_DETECT_IRQ is not set
 # CONFIG_SERIAL_8250_MULTIPORT is not set
@@ -515,6 +508,7 @@ CONFIG_LEGACY_PTY_COUNT=256
 #
 CONFIG_PROC_FS=y
 CONFIG_PROC_KCORE=y
+CONFIG_SYSFS=y
 # CONFIG_DEVFS_FS is not set
 # CONFIG_DEVPTS_FS_XATTR is not set
 # CONFIG_TMPFS is not set
@@ -555,7 +549,6 @@ CONFIG_SUNRPC=y
 # CONFIG_CIFS is not set
 # CONFIG_NCP_FS is not set
 # CONFIG_CODA_FS is not set
-# CONFIG_INTERMEZZO_FS is not set
 # CONFIG_AFS_FS is not set
 
 #
@@ -573,6 +566,12 @@ CONFIG_MSDOS_PARTITION=y
 # Library routines
 #
 CONFIG_CRC32=y
+# CONFIG_LIBCRC32C is not set
+
+#
+# Profiling support
+#
+# CONFIG_PROFILING is not set
 
 #
 # Kernel hacking
@@ -587,7 +586,7 @@ CONFIG_DEBUG_KERNEL=y
 CONFIG_BDI_SWITCH=y
 CONFIG_DEBUG_INFO=y
 # CONFIG_SERIAL_TEXT_DEBUG is not set
-CONFIG_OCP=y
+CONFIG_PPC_OCP=y
 
 #
 # Security options
diff --git a/arch/ppc/configs/pcore_defconfig b/arch/ppc/configs/pcore_defconfig
index ebe4d89c8..ba09d840d 100644
--- a/arch/ppc/configs/pcore_defconfig
+++ b/arch/ppc/configs/pcore_defconfig
@@ -360,7 +360,6 @@ CONFIG_IP_NF_COMPAT_IPCHAINS=m
 # 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
 
 #
diff --git a/arch/ppc/configs/pmac_defconfig b/arch/ppc/configs/pmac_defconfig
index 05842e761..ce480563b 100644
--- a/arch/ppc/configs/pmac_defconfig
+++ b/arch/ppc/configs/pmac_defconfig
@@ -513,7 +513,6 @@ CONFIG_IP_NF_RAW=m
 # 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
 
 #
diff --git a/arch/ppc/configs/power3_defconfig b/arch/ppc/configs/power3_defconfig
index bd7beebda..93da595a4 100644
--- a/arch/ppc/configs/power3_defconfig
+++ b/arch/ppc/configs/power3_defconfig
@@ -360,7 +360,6 @@ CONFIG_SYN_COOKIES=y
 # 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
 
 #
diff --git a/arch/ppc/configs/pplus_defconfig b/arch/ppc/configs/pplus_defconfig
index b26d50857..f1153f58a 100644
--- a/arch/ppc/configs/pplus_defconfig
+++ b/arch/ppc/configs/pplus_defconfig
@@ -371,7 +371,6 @@ CONFIG_IPV6_SCTP__=y
 # 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
 
 #
diff --git a/arch/ppc/configs/prpmc750_defconfig b/arch/ppc/configs/prpmc750_defconfig
index 42a938315..82d52f66b 100644
--- a/arch/ppc/configs/prpmc750_defconfig
+++ b/arch/ppc/configs/prpmc750_defconfig
@@ -239,7 +239,6 @@ CONFIG_IP_PNP_DHCP=y
 # 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
 
 #
diff --git a/arch/ppc/configs/prpmc800_defconfig b/arch/ppc/configs/prpmc800_defconfig
index 82d99d5f1..613c2664d 100644
--- a/arch/ppc/configs/prpmc800_defconfig
+++ b/arch/ppc/configs/prpmc800_defconfig
@@ -308,7 +308,6 @@ CONFIG_IP_PNP_DHCP=y
 # 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
 
 #
diff --git a/arch/ppc/configs/rainier_defconfig b/arch/ppc/configs/rainier_defconfig
index 271ad3eb1..4d4fcdc61 100644
--- a/arch/ppc/configs/rainier_defconfig
+++ b/arch/ppc/configs/rainier_defconfig
@@ -209,7 +209,6 @@ CONFIG_IPV6_SCTP__=y
 # 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
 
 #
diff --git a/arch/ppc/configs/redwood5_defconfig b/arch/ppc/configs/redwood5_defconfig
index 4af5a3ccf..4c5486da4 100644
--- a/arch/ppc/configs/redwood5_defconfig
+++ b/arch/ppc/configs/redwood5_defconfig
@@ -247,7 +247,6 @@ CONFIG_SYN_COOKIES=y
 # 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
 
 #
diff --git a/arch/ppc/configs/redwood6_defconfig b/arch/ppc/configs/redwood6_defconfig
index cc3f76c6b..5752845c2 100644
--- a/arch/ppc/configs/redwood6_defconfig
+++ b/arch/ppc/configs/redwood6_defconfig
@@ -225,7 +225,6 @@ CONFIG_SYN_COOKIES=y
 # 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
 
 #
diff --git a/arch/ppc/configs/redwood_defconfig b/arch/ppc/configs/redwood_defconfig
index 8adb4519f..4aa348dcf 100644
--- a/arch/ppc/configs/redwood_defconfig
+++ b/arch/ppc/configs/redwood_defconfig
@@ -215,7 +215,6 @@ CONFIG_IPV6_SCTP__=y
 # 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
 
 #
diff --git a/arch/ppc/configs/rpx8260_defconfig b/arch/ppc/configs/rpx8260_defconfig
index a69e0b485..a9c4544ae 100644
--- a/arch/ppc/configs/rpx8260_defconfig
+++ b/arch/ppc/configs/rpx8260_defconfig
@@ -229,7 +229,6 @@ CONFIG_SYN_COOKIES=y
 # 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
 
 #
diff --git a/arch/ppc/configs/rpxcllf_defconfig b/arch/ppc/configs/rpxcllf_defconfig
index 4e6aa0835..be4538031 100644
--- a/arch/ppc/configs/rpxcllf_defconfig
+++ b/arch/ppc/configs/rpxcllf_defconfig
@@ -193,7 +193,6 @@ CONFIG_IPV6_SCTP__=y
 # 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
 
 #
diff --git a/arch/ppc/configs/rpxlite_defconfig b/arch/ppc/configs/rpxlite_defconfig
index 01ed243a5..06e818a1f 100644
--- a/arch/ppc/configs/rpxlite_defconfig
+++ b/arch/ppc/configs/rpxlite_defconfig
@@ -193,7 +193,6 @@ CONFIG_IPV6_SCTP__=y
 # 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
 
 #
diff --git a/arch/ppc/configs/sandpoint_defconfig b/arch/ppc/configs/sandpoint_defconfig
index 739b09581..0f4393a07 100644
--- a/arch/ppc/configs/sandpoint_defconfig
+++ b/arch/ppc/configs/sandpoint_defconfig
@@ -270,7 +270,6 @@ CONFIG_IP_PNP_BOOTP=y
 # 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
 
 #
diff --git a/arch/ppc/configs/spruce_defconfig b/arch/ppc/configs/spruce_defconfig
index ce3417ba9..430dd9c59 100644
--- a/arch/ppc/configs/spruce_defconfig
+++ b/arch/ppc/configs/spruce_defconfig
@@ -236,7 +236,6 @@ CONFIG_IP_PNP_DHCP=y
 # 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
 
 #
diff --git a/arch/ppc/configs/sycamore_defconfig b/arch/ppc/configs/sycamore_defconfig
index 246bb2c21..758114cfe 100644
--- a/arch/ppc/configs/sycamore_defconfig
+++ b/arch/ppc/configs/sycamore_defconfig
@@ -234,7 +234,6 @@ CONFIG_SYN_COOKIES=y
 # 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
 
 #
diff --git a/arch/ppc/configs/walnut_defconfig b/arch/ppc/configs/walnut_defconfig
index 4641fd77b..bf9721a7a 100644
--- a/arch/ppc/configs/walnut_defconfig
+++ b/arch/ppc/configs/walnut_defconfig
@@ -237,7 +237,6 @@ CONFIG_SYN_COOKIES=y
 # 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
 
 #
diff --git a/arch/ppc/defconfig b/arch/ppc/defconfig
index 9cf908e2f..86b216430 100644
--- a/arch/ppc/defconfig
+++ b/arch/ppc/defconfig
@@ -498,7 +498,6 @@ CONFIG_IP_NF_RAW=m
 # 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
 
 #
@@ -1230,7 +1229,7 @@ CONFIG_NFS_V3=y
 CONFIG_NFSD=y
 CONFIG_NFSD_V3=y
 # CONFIG_NFSD_V4 is not set
-# CONFIG_NFSD_TCP is not set
+CONFIG_NFSD_TCP=y
 CONFIG_LOCKD=y
 CONFIG_LOCKD_V4=y
 CONFIG_EXPORTFS=y
diff --git a/arch/ppc/kernel/Makefile b/arch/ppc/kernel/Makefile
index 1934cd3f8..2531070a6 100644
--- a/arch/ppc/kernel/Makefile
+++ b/arch/ppc/kernel/Makefile
@@ -2,16 +2,10 @@
 # Makefile for the linux kernel.
 #
 
-ifdef CONFIG_PPC64BRIDGE
-EXTRA_AFLAGS		:= -Wa,-mppc64bridge
-endif
-ifdef CONFIG_4xx
-EXTRA_AFLAGS		:= -Wa,-m405
-endif
-
 extra-$(CONFIG_PPC_STD_MMU)	:= head.o
 extra-$(CONFIG_40x)		:= head_4xx.o
 extra-$(CONFIG_44x)		:= head_44x.o
+extra-$(CONFIG_E500)		:= head_e500.o
 extra-$(CONFIG_8xx)		:= head_8xx.o
 extra-$(CONFIG_6xx)		+= idle_6xx.o
 extra-$(CONFIG_POWER4)		+= idle_power4.o
diff --git a/arch/ppc/kernel/align.c b/arch/ppc/kernel/align.c
index 59a20f388..39f51985e 100644
--- a/arch/ppc/kernel/align.c
+++ b/arch/ppc/kernel/align.c
@@ -21,7 +21,7 @@ struct aligninfo {
 	unsigned char flags;
 };
 
-#if defined(CONFIG_4xx) || defined(CONFIG_POWER4)
+#if defined(CONFIG_4xx) || defined(CONFIG_POWER4) || defined(CONFIG_BOOKE)
 #define	OPCD(inst)	(((inst) & 0xFC000000) >> 26)
 #define	RS(inst)	(((inst) & 0x03E00000) >> 21)
 #define	RA(inst)	(((inst) & 0x001F0000) >> 16)
@@ -184,7 +184,7 @@ int
 fix_alignment(struct pt_regs *regs)
 {
 	int instr, nb, flags;
-#if defined(CONFIG_4xx) || defined(CONFIG_POWER4)
+#if defined(CONFIG_4xx) || defined(CONFIG_POWER4) || defined(CONFIG_BOOKE)
 	int opcode, f1, f2, f3;
 #endif
 	int i, t;
@@ -199,8 +199,8 @@ fix_alignment(struct pt_regs *regs)
 
 	CHECK_FULL_REGS(regs);
 
-#if defined(CONFIG_4xx) || defined(CONFIG_POWER4)
-	/* The 4xx-family processors have no DSISR register,
+#if defined(CONFIG_4xx) || defined(CONFIG_POWER4) || defined(CONFIG_BOOKE)
+	/* The 4xx-family & Book-E processors have no DSISR register,
 	 * so we emulate it.
 	 * The POWER4 has a DSISR register but doesn't set it on
 	 * an alignment fault.  -- paulus
@@ -250,7 +250,7 @@ fix_alignment(struct pt_regs *regs)
 
 	flags = aligninfo[instr].flags;
 
-	/* For the 4xx-family processors, the 'dar' field of the
+	/* For the 4xx-family & Book-E processors, the 'dar' field of the
 	 * pt_regs structure is overloaded and is really from the DEAR.
 	 */
 
diff --git a/arch/ppc/kernel/asm-offsets.c b/arch/ppc/kernel/asm-offsets.c
index e41af4ff4..1999a42d8 100644
--- a/arch/ppc/kernel/asm-offsets.c
+++ b/arch/ppc/kernel/asm-offsets.c
@@ -44,7 +44,7 @@ main(void)
 	DEFINE(THREAD_FPEXC_MODE, offsetof(struct thread_struct, fpexc_mode));
 	DEFINE(THREAD_FPR0, offsetof(struct thread_struct, fpr[0]));
 	DEFINE(THREAD_FPSCR, offsetof(struct thread_struct, fpscr));
-#ifdef CONFIG_4xx
+#if defined(CONFIG_4xx) || defined(CONFIG_BOOKE)
 	DEFINE(THREAD_DBCR0, offsetof(struct thread_struct, dbcr0));
 	DEFINE(PT_PTRACED, PT_PTRACED);
 #endif
@@ -54,6 +54,12 @@ main(void)
 	DEFINE(THREAD_VSCR, offsetof(struct thread_struct, vscr));
 	DEFINE(THREAD_USED_VR, offsetof(struct thread_struct, used_vr));
 #endif /* CONFIG_ALTIVEC */
+#ifdef CONFIG_SPE
+	DEFINE(THREAD_EVR0, offsetof(struct thread_struct, evr[0]));
+	DEFINE(THREAD_ACC, offsetof(struct thread_struct, acc));
+	DEFINE(THREAD_SPEFSCR, offsetof(struct thread_struct, spefscr));
+	DEFINE(THREAD_USED_SPE, offsetof(struct thread_struct, used_spe));
+#endif /* CONFIG_SPE */
 	/* Interrupt register frame */
 	DEFINE(STACK_FRAME_OVERHEAD, STACK_FRAME_OVERHEAD);
 	DEFINE(INT_FRAME_SIZE, STACK_FRAME_OVERHEAD + sizeof(struct pt_regs));
diff --git a/arch/ppc/kernel/cpu_setup_6xx.S b/arch/ppc/kernel/cpu_setup_6xx.S
index 9e4e48ffb..ee0705c6e 100644
--- a/arch/ppc/kernel/cpu_setup_6xx.S
+++ b/arch/ppc/kernel/cpu_setup_6xx.S
@@ -218,7 +218,10 @@ setup_745x_specifics:
 
 	/* All of the bits we have to set.....
 	 */
-	ori	r11,r11,HID0_SGE | HID0_FOLD | HID0_BHTE | HID0_BTIC | HID0_LRSTK
+	ori	r11,r11,HID0_SGE | HID0_FOLD | HID0_BHTE | HID0_LRSTK
+BEGIN_FTR_SECTION
+	ori	r11,r11,HID0_BTIC
+END_FTR_SECTION_IFCLR(CPU_FTR_NO_BTIC)
 BEGIN_FTR_SECTION
 	oris	r11,r11,HID0_DPM@h	/* enable dynamic power mgmt */
 END_FTR_SECTION_IFCLR(CPU_FTR_NO_DPM)
diff --git a/arch/ppc/kernel/cputable.c b/arch/ppc/kernel/cputable.c
index 78f85e675..b60fa998b 100644
--- a/arch/ppc/kernel/cputable.c
+++ b/arch/ppc/kernel/cputable.c
@@ -34,7 +34,8 @@ extern void __setup_cpu_8xx(unsigned long offset, int cpu_nr, struct cpu_spec* s
 extern void __setup_cpu_generic(unsigned long offset, int cpu_nr, struct cpu_spec* spec);
 
 #define CLASSIC_PPC (!defined(CONFIG_8xx) && !defined(CONFIG_4xx) && \
-		     !defined(CONFIG_POWER3) && !defined(CONFIG_POWER4))
+		     !defined(CONFIG_POWER3) && !defined(CONFIG_POWER4) && \
+		     !defined(CONFIG_BOOKE))
 
 /* This table only contains "desktop" CPUs, it need to be filled with embedded
  * ones as well...
@@ -54,7 +55,8 @@ extern void __setup_cpu_generic(unsigned long offset, int cpu_nr, struct cpu_spe
 #endif
 
 /* We need to mark all pages as being coherent if we're SMP or we
- * have a 754x and an MPC107 host bridge. */
+ * have a 754x and an MPC107 host bridge.
+ */
 #if defined(CONFIG_SMP) || defined(CONFIG_MPC10X_BRIDGE)
 #define CPU_FTR_COMMON                  CPU_FTR_NEED_COHERENT
 #else
@@ -262,7 +264,7 @@ struct cpu_spec	cpu_specs[] = {
 	CPU_FTR_COMMON |
     	CPU_FTR_SPLIT_ID_CACHE | CPU_FTR_USE_TB |
 	CPU_FTR_L2CR | CPU_FTR_ALTIVEC_COMP | CPU_FTR_L3CR |
-	CPU_FTR_HPTE_TABLE | CPU_FTR_SPEC7450,
+	CPU_FTR_HPTE_TABLE | CPU_FTR_SPEC7450 | CPU_FTR_NEED_COHERENT,
 	COMMON_PPC | PPC_FEATURE_ALTIVEC_COMP,
 	32, 32,
 	__setup_cpu_745x
@@ -273,7 +275,7 @@ struct cpu_spec	cpu_specs[] = {
     	CPU_FTR_SPLIT_ID_CACHE | CPU_FTR_USE_TB | CPU_FTR_CAN_NAP |
 	CPU_FTR_L2CR | CPU_FTR_ALTIVEC_COMP | CPU_FTR_L3CR |
 	CPU_FTR_HPTE_TABLE | CPU_FTR_SPEC7450 | CPU_FTR_NAP_DISABLE_L2_PR |
-	CPU_FTR_L3_DISABLE_NAP,
+	CPU_FTR_L3_DISABLE_NAP | CPU_FTR_NEED_COHERENT,
 	COMMON_PPC | PPC_FEATURE_ALTIVEC_COMP,
 	32, 32,
 	__setup_cpu_745x
@@ -283,7 +285,8 @@ struct cpu_spec	cpu_specs[] = {
 	CPU_FTR_COMMON |
     	CPU_FTR_SPLIT_ID_CACHE | CPU_FTR_USE_TB | CPU_FTR_CAN_NAP |
 	CPU_FTR_L2CR | CPU_FTR_ALTIVEC_COMP | CPU_FTR_L3CR |
-	CPU_FTR_HPTE_TABLE | CPU_FTR_SPEC7450 | CPU_FTR_NAP_DISABLE_L2_PR,
+	CPU_FTR_HPTE_TABLE | CPU_FTR_SPEC7450 | CPU_FTR_NAP_DISABLE_L2_PR |
+	CPU_FTR_NEED_COHERENT,
 	COMMON_PPC | PPC_FEATURE_ALTIVEC_COMP,
 	32, 32,
 	__setup_cpu_745x
@@ -293,7 +296,8 @@ struct cpu_spec	cpu_specs[] = {
 	CPU_FTR_COMMON |
     	CPU_FTR_SPLIT_ID_CACHE | CPU_FTR_USE_TB |
 	CPU_FTR_L2CR | CPU_FTR_ALTIVEC_COMP | CPU_FTR_L3CR |
-	CPU_FTR_HPTE_TABLE | CPU_FTR_SPEC7450 | CPU_FTR_HAS_HIGH_BATS,
+	CPU_FTR_HPTE_TABLE | CPU_FTR_SPEC7450 | CPU_FTR_HAS_HIGH_BATS |
+	CPU_FTR_NEED_COHERENT,
 	COMMON_PPC | PPC_FEATURE_ALTIVEC_COMP,
 	32, 32,
 	__setup_cpu_745x
@@ -304,7 +308,7 @@ struct cpu_spec	cpu_specs[] = {
     	CPU_FTR_SPLIT_ID_CACHE | CPU_FTR_USE_TB | CPU_FTR_CAN_NAP |
 	CPU_FTR_L2CR | CPU_FTR_ALTIVEC_COMP | CPU_FTR_L3CR |
 	CPU_FTR_HPTE_TABLE | CPU_FTR_SPEC7450 | CPU_FTR_NAP_DISABLE_L2_PR |
-	CPU_FTR_L3_DISABLE_NAP | CPU_FTR_HAS_HIGH_BATS,
+	CPU_FTR_L3_DISABLE_NAP | CPU_FTR_NEED_COHERENT | CPU_FTR_HAS_HIGH_BATS,
 	COMMON_PPC | PPC_FEATURE_ALTIVEC_COMP,
 	32, 32,
 	__setup_cpu_745x
@@ -315,18 +319,40 @@ struct cpu_spec	cpu_specs[] = {
     	CPU_FTR_SPLIT_ID_CACHE | CPU_FTR_USE_TB | CPU_FTR_CAN_NAP |
 	CPU_FTR_L2CR | CPU_FTR_ALTIVEC_COMP | CPU_FTR_L3CR |
 	CPU_FTR_HPTE_TABLE | CPU_FTR_SPEC7450 | CPU_FTR_NAP_DISABLE_L2_PR |
-	CPU_FTR_HAS_HIGH_BATS,
+	CPU_FTR_HAS_HIGH_BATS | CPU_FTR_NEED_COHERENT,
+	COMMON_PPC | PPC_FEATURE_ALTIVEC_COMP,
+	32, 32,
+	__setup_cpu_745x
+    },
+    {	/* 7447/7457 Rev 1.0 */
+    	0xffffffff, 0x80020100, "7447/7457",
+	CPU_FTR_COMMON |
+    	CPU_FTR_SPLIT_ID_CACHE | CPU_FTR_USE_TB | CPU_FTR_CAN_NAP |
+	CPU_FTR_L2CR | CPU_FTR_ALTIVEC_COMP | CPU_FTR_L3CR |
+	CPU_FTR_HPTE_TABLE | CPU_FTR_SPEC7450 | CPU_FTR_NAP_DISABLE_L2_PR |
+	CPU_FTR_HAS_HIGH_BATS | CPU_FTR_NEED_COHERENT | CPU_FTR_NO_BTIC,
 	COMMON_PPC | PPC_FEATURE_ALTIVEC_COMP,
 	32, 32,
 	__setup_cpu_745x
     },
-    {	/* 7457 */
-    	0xffff0000, 0x80020000, "7457",
+    {	/* 7447/7457 Rev 1.1 */
+    	0xffffffff, 0x80020101, "7447/7457",
 	CPU_FTR_COMMON |
     	CPU_FTR_SPLIT_ID_CACHE | CPU_FTR_USE_TB | CPU_FTR_CAN_NAP |
 	CPU_FTR_L2CR | CPU_FTR_ALTIVEC_COMP | CPU_FTR_L3CR |
 	CPU_FTR_HPTE_TABLE | CPU_FTR_SPEC7450 | CPU_FTR_NAP_DISABLE_L2_PR |
-	CPU_FTR_HAS_HIGH_BATS,
+	CPU_FTR_HAS_HIGH_BATS | CPU_FTR_NEED_COHERENT | CPU_FTR_NO_BTIC,
+	COMMON_PPC | PPC_FEATURE_ALTIVEC_COMP,
+	32, 32,
+	__setup_cpu_745x
+    },
+    {	/* 7447/7457 Rev 1.2 and later */
+    	0xffff0000, 0x80020000, "7447/7457",
+	CPU_FTR_COMMON |
+    	CPU_FTR_SPLIT_ID_CACHE | CPU_FTR_USE_TB | CPU_FTR_CAN_NAP |
+	CPU_FTR_L2CR | CPU_FTR_ALTIVEC_COMP | CPU_FTR_L3CR |
+	CPU_FTR_HPTE_TABLE | CPU_FTR_SPEC7450 | CPU_FTR_NAP_DISABLE_L2_PR |
+	CPU_FTR_HAS_HIGH_BATS | CPU_FTR_NEED_COHERENT,
 	COMMON_PPC | PPC_FEATURE_ALTIVEC_COMP,
 	32, 32,
 	__setup_cpu_745x
@@ -337,7 +363,7 @@ struct cpu_spec	cpu_specs[] = {
     	CPU_FTR_SPLIT_ID_CACHE | CPU_FTR_USE_TB | CPU_FTR_CAN_NAP |
 	CPU_FTR_L2CR | CPU_FTR_ALTIVEC_COMP |
 	CPU_FTR_HPTE_TABLE | CPU_FTR_SPEC7450 | CPU_FTR_NAP_DISABLE_L2_PR |
-	CPU_FTR_HAS_HIGH_BATS,
+	CPU_FTR_HAS_HIGH_BATS | CPU_FTR_NEED_COHERENT,
 	COMMON_PPC | PPC_FEATURE_ALTIVEC_COMP,
 	32, 32,
 	__setup_cpu_745x
@@ -350,8 +376,8 @@ struct cpu_spec	cpu_specs[] = {
 	32, 32,
 	__setup_cpu_603
     },
-    {	/* 8280 is a G2_LE (603e core, plus some) */
-	0x7fff0000, 0x00820000, "8280",
+    {	/* All G2_LE (603e core, plus some) have the same pvr */
+	0x7fff0000, 0x00820000, "G2_LE",
 	CPU_FTR_SPLIT_ID_CACHE | CPU_FTR_CAN_DOZE | CPU_FTR_USE_TB |
 	CPU_FTR_CAN_NAP | CPU_FTR_HAS_HIGH_BATS,
 	COMMON_PPC,
@@ -561,6 +587,16 @@ struct cpu_spec	cpu_specs[] = {
         0, /*__setup_cpu_440 */
     },
 #endif /* CONFIG_44x */
+#ifdef CONFIG_E500
+    { /* e500 */
+        0xffff0000, 0x80200000, "e500",
+	/* xxx - galak: add CPU_FTR_CAN_DOZE */
+        CPU_FTR_SPLIT_ID_CACHE | CPU_FTR_USE_TB,
+        PPC_FEATURE_32 | PPC_FEATURE_HAS_MMU,
+        32, 32,
+        0, /*__setup_cpu_e500 */
+    },
+#endif
 #if !CLASSIC_PPC
     {	/* default match */
     	0x00000000, 0x00000000, "(generic PPC)",
diff --git a/arch/ppc/kernel/dma-mapping.c b/arch/ppc/kernel/dma-mapping.c
index c859f1127..54f9a3e75 100644
--- a/arch/ppc/kernel/dma-mapping.c
+++ b/arch/ppc/kernel/dma-mapping.c
@@ -254,6 +254,7 @@ __dma_alloc_coherent(size_t size, dma_addr_t *handle, int gfp)
  no_page:
 	return NULL;
 }
+EXPORT_SYMBOL(__dma_alloc_coherent);
 
 /*
  * free a page as defined by the above mapping.
@@ -317,7 +318,7 @@ void __dma_free_coherent(size_t size, void *vaddr)
 	       __func__, vaddr);
 	dump_stack();
 }
-EXPORT_SYMBOL(dma_free_coherent);
+EXPORT_SYMBOL(__dma_free_coherent);
 
 /*
  * Initialise the consistent memory allocation.
diff --git a/arch/ppc/kernel/entry.S b/arch/ppc/kernel/entry.S
index 8108917ea..4963b79c7 100644
--- a/arch/ppc/kernel/entry.S
+++ b/arch/ppc/kernel/entry.S
@@ -36,7 +36,7 @@
 #undef SHOW_SYSCALLS_TASK
 
 /*
- * MSR_KERNEL is > 0x10000 on 4xx since it include MSR_CE.
+ * MSR_KERNEL is > 0x10000 on 4xx/Book-E since it include MSR_CE.
  */
 #if MSR_KERNEL >= 0x10000
 #define LOAD_MSR_KERNEL(r, x)	lis r,(x)@h; ori r,r,(x)@l
@@ -45,7 +45,7 @@
 #endif
 
 #ifdef CONFIG_BOOKE
-#define	COR	r8
+#define	COR	r8	/* Critical Offset Register (COR) */
 #define BOOKE_LOAD_COR	lis COR,crit_save@ha
 #define BOOKE_REST_COR	mfspr COR,SPRG2
 #define BOOKE_SAVE_COR	mtspr SPRG2,COR
@@ -241,11 +241,11 @@ ret_from_syscall:
 	andi.	r0,r9,(_TIF_SYSCALL_TRACE|_TIF_SIGPENDING|_TIF_NEED_RESCHED)
 	bne-	syscall_exit_work
 syscall_exit_cont:
-#ifdef CONFIG_4xx
+#if defined(CONFIG_4xx) || defined(CONFIG_BOOKE)
 	/* If the process has its own DBCR0 value, load it up */
 	lwz	r0,PTRACE(r2)
 	andi.	r0,r0,PT_PTRACED
-	bnel-	load_4xx_dbcr0
+	bnel-	load_dbcr0
 #endif
 	stwcx.	r0,0,r1			/* to clear the reservation */
 	lwz	r4,_LINK(r1)
@@ -510,7 +510,12 @@ BEGIN_FTR_SECTION
 	stw	r12,THREAD+THREAD_VRSAVE(r2)
 END_FTR_SECTION_IFSET(CPU_FTR_ALTIVEC)
 #endif /* CONFIG_ALTIVEC */
-	and.	r0,r0,r11	/* FP or altivec enabled? */
+#ifdef CONFIG_SPE
+	oris	r0,r0,MSR_SPE@h	 /* Disable SPE */
+	mfspr	r12,SPRN_SPEFSCR /* save spefscr register value */
+	stw	r12,THREAD+THREAD_SPEFSCR(r2)
+#endif /* CONFIG_SPE */
+	and.	r0,r0,r11	/* FP or altivec or SPE enabled? */
 	beq+	1f
 	andc	r11,r11,r0
 	MTMSRD(r11)
@@ -543,6 +548,10 @@ BEGIN_FTR_SECTION
 	mtspr	SPRN_VRSAVE,r0		/* if G4, restore VRSAVE reg */
 END_FTR_SECTION_IFSET(CPU_FTR_ALTIVEC)
 #endif /* CONFIG_ALTIVEC */
+#ifdef CONFIG_SPE
+	lwz	r0,THREAD+THREAD_SPEFSCR(r2)
+	mtspr	SPRN_SPEFSCR,r0		/* restore SPEFSCR reg */
+#endif /* CONFIG_SPE */
 
 	lwz	r0,_CCR(r1)
 	mtcrf	0xFF,r0
@@ -589,11 +598,11 @@ user_exc_return:		/* r10 contains MSR_KERNEL here */
 	bne	do_work
 
 restore_user:
-#ifdef CONFIG_4xx
+#if defined(CONFIG_4xx) || defined(CONFIG_BOOKE)
 	/* Check whether this process has its own DBCR0 value */
 	lwz	r0,PTRACE(r2)
 	andi.	r0,r0,PT_PTRACED
-	bnel-	load_4xx_dbcr0
+	bnel-	load_dbcr0
 #endif
 
 #ifdef CONFIG_PREEMPT
@@ -645,7 +654,7 @@ restore:
 	PPC405_ERR77(0,r1)
 	stwcx.	r0,0,r1			/* to clear the reservation */
 
-#ifndef CONFIG_4xx
+#if !(defined(CONFIG_4xx) || defined(CONFIG_BOOKE))
 	lwz	r9,_MSR(r1)
 	andi.	r10,r9,MSR_RI		/* check if this exception occurred */
 	beql	nonrecoverable		/* at a bad place (MSR:RI = 0) */
@@ -681,9 +690,9 @@ exc_exit_restart_end:
 	SYNC
 	RFI
 
-#else /* CONFIG_4xx */
+#else /* !(CONFIG_4xx || CONFIG_BOOKE) */
 	/*
-	 * This is a bit different on 4xx because 4xx doesn't have
+	 * This is a bit different on 4xx/Book-E because it doesn't have
 	 * the RI bit in the MSR.
 	 * The TLB miss handler checks if we have interrupted
 	 * the exception exit path and restarts it if so
@@ -720,6 +729,9 @@ exc_exit_restart_end:
  * give the wrong answer).
  * We have to restore various SPRs that may have been in use at the
  * time of the critical interrupt.
+ *
+ * Note that SPRG6 is used for machine check on CONFIG_BOOKE parts and
+ * thus not saved in the critical handler
  */
 	.globl	ret_from_crit_exc
 ret_from_crit_exc:
@@ -866,7 +878,7 @@ ret_from_mcheck_exc:
  * Load the DBCR0 value for a task that is being ptraced,
  * having first saved away the global DBCR0.
  */
-load_4xx_dbcr0:
+load_dbcr0:
 	mfmsr	r0		/* first disable debug exceptions */
 	rlwinm	r0,r0,0,~MSR_DE
 	mtmsr	r0
@@ -885,7 +897,7 @@ load_4xx_dbcr0:
 	blr
 
 	.comm	global_dbcr0,8
-#endif /* CONFIG_4xx */
+#endif /* !(CONFIG_4xx || CONFIG_BOOKE) */
 
 do_work:			/* r10 contains MSR_KERNEL here */
 	andi.	r0,r9,_TIF_NEED_RESCHED
diff --git a/arch/ppc/kernel/head.S b/arch/ppc/kernel/head.S
index a7bb50232..121978c19 100644
--- a/arch/ppc/kernel/head.S
+++ b/arch/ppc/kernel/head.S
@@ -552,7 +552,7 @@ InstructionTLBMiss:
 	rlwimi	r3,r3,32-1,31,31	/* _PAGE_USER -> PP lsb */
 	ori	r1,r1,0xe14		/* clear out reserved bits and M */
 	andc	r1,r3,r1		/* PP = user? (rw&dirty? 2: 3): 0 */
-	mtspr	RPA,r1
+	mtspr	SPRN_RPA,r1
 	mfspr	r3,IMISS
 	tlbli	r3
 	mfspr	r3,SRR1		/* Need to restore CR0 */
@@ -626,7 +626,7 @@ DataLoadTLBMiss:
 	rlwimi	r3,r3,32-1,31,31	/* _PAGE_USER -> PP lsb */
 	ori	r1,r1,0xe14		/* clear out reserved bits and M */
 	andc	r1,r3,r1		/* PP = user? (rw&dirty? 2: 3): 0 */
-	mtspr	RPA,r1
+	mtspr	SPRN_RPA,r1
 	mfspr	r3,DMISS
 	tlbld	r3
 	mfspr	r3,SRR1		/* Need to restore CR0 */
@@ -694,7 +694,7 @@ DataStoreTLBMiss:
 	rlwimi	r3,r3,32-1,30,30	/* _PAGE_USER -> PP msb */
 	li	r1,0xe15		/* clear out reserved bits and M */
 	andc	r1,r3,r1		/* PP = user? 2: 0 */
-	mtspr	RPA,r1
+	mtspr	SPRN_RPA,r1
 	mfspr	r3,DMISS
 	tlbld	r3
 	mfspr	r3,SRR1		/* Need to restore CR0 */
diff --git a/arch/ppc/kernel/head_44x.S b/arch/ppc/kernel/head_44x.S
index f38298cbb..f883dc239 100644
--- a/arch/ppc/kernel/head_44x.S
+++ b/arch/ppc/kernel/head_44x.S
@@ -177,11 +177,11 @@ skpinv:	addi	r4,r4,1				/* Increment */
 	rfi
 
 	/* If necessary, invalidate original entry we used */
-3:	cmpwi	r23,62
+3:	cmpwi	r23,63
 	beq	4f
 	li	r6,0
 	tlbwe   r6,r23,PPC44x_TLB_PAGEID
-	sync
+	isync
 
 4:
 #ifdef CONFIG_SERIAL_TEXT_DEBUG
@@ -209,14 +209,6 @@ skpinv:	addi	r4,r4,1				/* Increment */
 	tlbwe	r4,r0,PPC44x_TLB_XLAT	/* Load the translation fields */
 	tlbwe	r5,r0,PPC44x_TLB_ATTRIB	/* Load the attrib/access fields */
 
-	ori	r3,r3,PPC44x_TLB_TS	/* Translation state 1 */
-
-        li      r0,1			/* TLB slot 1 */
-
-	tlbwe	r3,r0,PPC44x_TLB_PAGEID	/* Load the pageid fields */
-	tlbwe	r4,r0,PPC44x_TLB_XLAT	/* Load the translation fields */
-	tlbwe	r5,r0,PPC44x_TLB_ATTRIB	/* Load the attrib/access fields */
-
 	/* Force context change */
 	isync
 #endif /* CONFIG_SERIAL_TEXT_DEBUG */
@@ -680,7 +672,7 @@ interrupt_base:
 	mfspr	r4,SPRN_ESR		/* Grab the ESR and save it */
 	stw	r4,_ESR(r11)
 	addi	r3,r1,STACK_FRAME_OVERHEAD
-	EXC_XFER_EE(0x700, ProgramCheckException)
+	EXC_XFER_STD(0x700, ProgramCheckException)
 
 	/* Floating Point Unavailable Interrupt */
 	EXCEPTION(0x2010, FloatingPointUnavailable, UnknownException, EXC_XFER_EE)
diff --git a/arch/ppc/kernel/head_4xx.S b/arch/ppc/kernel/head_4xx.S
index 54de9b5bb..5a8933688 100644
--- a/arch/ppc/kernel/head_4xx.S
+++ b/arch/ppc/kernel/head_4xx.S
@@ -451,7 +451,7 @@ label:
 	mfspr	r4,SPRN_ESR		/* Grab the ESR and save it */
 	stw	r4,_ESR(r11)
 	addi	r3,r1,STACK_FRAME_OVERHEAD
-	EXC_XFER_EE(0x700, ProgramCheckException)
+	EXC_XFER_STD(0x700, ProgramCheckException)
 
 	EXCEPTION(0x0800, Trap_08, UnknownException, EXC_XFER_EE)
 	EXCEPTION(0x0900, Trap_09, UnknownException, EXC_XFER_EE)
diff --git a/arch/ppc/kernel/head_e500.S b/arch/ppc/kernel/head_e500.S
index 8f0c590f1..ceb51d343 100644
--- a/arch/ppc/kernel/head_e500.S
+++ b/arch/ppc/kernel/head_e500.S
@@ -1177,6 +1177,8 @@ _GLOBAL(giveup_spe)
 	evmwumiaa evr6, evr6, evr6	/* evr6 <- ACC = 0 * 0 + ACC */
 	li	r4,THREAD_ACC
    	evstddx	evr6, r4, r3		/* save off accumulator */
+	mfspr	r6,SPRN_SPEFSCR
+	stw	r6,THREAD_SPEFSCR(r3)	/* save spefscr register value */
 	beq	1f
 	lwz	r4,_MSR-STACK_FRAME_OVERHEAD(r5)
 	lis	r3,MSR_SPE@h
diff --git a/arch/ppc/kernel/irq.c b/arch/ppc/kernel/irq.c
index cc3b36c0d..2ac2e4b55 100644
--- a/arch/ppc/kernel/irq.c
+++ b/arch/ppc/kernel/irq.c
@@ -106,7 +106,7 @@ void *irq_kmalloc(size_t size, int pri)
 			cache_bitmask |= (1<<i);
 			return (void *)(&malloc_cache[i]);
 		}
-	return 0;
+	return NULL;
 }
 
 void irq_kfree(void *ptr)
@@ -171,7 +171,12 @@ setup_irq(unsigned int irq, struct irqaction * new)
 	if (!shared) {
 		desc->depth = 0;
 		desc->status &= ~(IRQ_DISABLED | IRQ_AUTODETECT | IRQ_WAITING);
-		unmask_irq(irq);
+		if (desc->handler) {
+			if (desc->handler->startup)
+				desc->handler->startup(irq);
+			else if (desc->handler->enable)
+				desc->handler->enable(irq);
+		}
 	}
 	spin_unlock_irqrestore(&desc->lock,flags);
 
@@ -241,7 +246,7 @@ int request_irq(unsigned int irq,
 
 	action->handler = handler;
 	action->flags = irqflags;			
-	action->mask = 0;
+	cpus_clear(action->mask);
 	action->name = devname;
 	action->dev_id = dev_id;
 	action->next = NULL;
@@ -628,7 +633,9 @@ static int prof_cpu_mask_read_proc (char *page, char **start, off_t off,
 static int prof_cpu_mask_write_proc (struct file *file, const char __user *buffer,
 					unsigned long count, void *data)
 {
-	cpumask_t *mask = (cpumask_t *)data, full_count = count, err;
+	int err;
+	int full_count = count;
+	cpumask_t *mask = (cpumask_t *)data;
 	cpumask_t new_value;
 
 	err = cpumask_parse(buffer, count, new_value);
@@ -674,7 +681,7 @@ void init_irq_proc (void)
 	int i;
 
 	/* create /proc/irq */
-	root_irq_dir = proc_mkdir("irq", 0);
+	root_irq_dir = proc_mkdir("irq", NULL);
 
 	/* create /proc/irq/prof_cpu_mask */
 	entry = create_proc_entry("prof_cpu_mask", 0600, root_irq_dir);
diff --git a/arch/ppc/kernel/misc.S b/arch/ppc/kernel/misc.S
index bd006ca95..017da4476 100644
--- a/arch/ppc/kernel/misc.S
+++ b/arch/ppc/kernel/misc.S
@@ -253,6 +253,24 @@ _GLOBAL(low_choose_750fx_pll)
 	mtmsr	r7
 	blr
 
+_GLOBAL(low_choose_7447a_dfs)
+	/* Clear MSR:EE */
+	mfmsr	r7
+	rlwinm	r0,r7,0,17,15
+	mtmsr	r0
+	
+	/* Calc new HID1 value */
+	mfspr	r4,SPRN_HID1
+	insrwi	r4,r3,1,9	/* insert parameter into bit 9 */
+	sync
+	mtspr	SPRN_HID1,r4
+	sync
+	isync
+
+	/* Return */
+	mtmsr	r7
+	blr
+
 #endif /* CONFIG_CPU_FREQ_PMAC && CONFIG_6xx */
 
 /* void local_save_flags_ptr(unsigned long *flags) */
@@ -419,7 +437,24 @@ _GLOBAL(_tlbia)
 	ble	1b
 
 	isync
-#else /* !(CONFIG_40x || CONFIG_44x) */
+#elif defined(CONFIG_FSL_BOOKE)
+	/* Invalidate all entries in TLB0 */
+	li	r3, 0x04
+	tlbivax	0,3
+	/* Invalidate all entries in TLB1 */
+	li	r3, 0x0c
+	tlbivax	0,3
+	/* Invalidate all entries in TLB2 */
+	li	r3, 0x14
+	tlbivax	0,3
+	/* Invalidate all entries in TLB3 */
+	li	r3, 0x1c
+	tlbivax	0,3
+	msync
+#ifdef CONFIG_SMP
+	tlbsync
+#endif /* CONFIG_SMP */
+#else /* !(CONFIG_40x || CONFIG_44x || CONFIG_FSL_BOOKE) */
 #if defined(CONFIG_SMP)
 	rlwinm	r8,r1,0,0,18
 	lwz	r8,TI_CPU(r8)
@@ -487,7 +522,20 @@ _GLOBAL(_tlbie)
 	tlbwe	r3, r3, PPC44x_TLB_PAGEID
 	isync
 10:
-#else /* !(CONFIG_40x || CONFIG_44x) */
+#elif defined(CONFIG_FSL_BOOKE)
+	rlwinm	r4, r3, 0, 0, 19
+	ori	r5, r4, 0x08	/* TLBSEL = 1 */
+	ori	r6, r4, 0x10	/* TLBSEL = 2 */
+	ori	r7, r4, 0x18	/* TLBSEL = 3 */
+	tlbivax	0, r4
+	tlbivax	0, r5
+	tlbivax	0, r6
+	tlbivax	0, r7
+	msync
+#if defined(CONFIG_SMP)
+	tlbsync
+#endif /* CONFIG_SMP */
+#else /* !(CONFIG_40x || CONFIG_44x || CONFIG_FSL_BOOKE) */
 #if defined(CONFIG_SMP)
 	rlwinm	r8,r1,0,0,18
 	lwz	r8,TI_CPU(r8)
@@ -544,6 +592,10 @@ _GLOBAL(flush_instruction_cache)
 	lis	r3, KERNELBASE@h
 	iccci	0,r3
 #endif
+#elif CONFIG_FSL_BOOKE
+	mfspr	r3,SPRN_L1CSR1
+	ori	r3,r3,L1CSR1_ICFI|L1CSR1_ICLFR
+	mtspr	SPRN_L1CSR1,r3
 #else
 	mfspr	r3,PVR
 	rlwinm	r3,r3,16,16,31
@@ -1047,7 +1099,7 @@ _GLOBAL(_get_SP)
  * and exceptions as if the cpu had performed the load or store.
  */
 
-#if defined(CONFIG_4xx)
+#if defined(CONFIG_4xx) || defined(CONFIG_E500)
 _GLOBAL(cvt_fd)
 	lfs	0,0(r3)
 	stfd	0,0(r4)
diff --git a/arch/ppc/kernel/pci.c b/arch/ppc/kernel/pci.c
index f095fcd74..4145ff7bf 100644
--- a/arch/ppc/kernel/pci.c
+++ b/arch/ppc/kernel/pci.c
@@ -671,11 +671,11 @@ make_one_node_map(struct device_node* node, u8 pci_bus)
 		struct pci_dev* dev;
 		unsigned int *class_code, *reg;
 	
-		class_code = (unsigned int *) get_property(node, "class-code", 0);
+		class_code = (unsigned int *) get_property(node, "class-code", NULL);
 		if (!class_code || ((*class_code >> 8) != PCI_CLASS_BRIDGE_PCI &&
 			(*class_code >> 8) != PCI_CLASS_BRIDGE_CARDBUS))
 			continue;
-		reg = (unsigned int *)get_property(node, "reg", 0);
+		reg = (unsigned int *)get_property(node, "reg", NULL);
 		if (!reg)
 			continue;
 		dev = pci_find_slot(pci_bus, ((reg[0] >> 8) & 0xff));
@@ -712,7 +712,7 @@ pcibios_make_OF_bus_map(void)
 			continue;
 		make_one_node_map(node, hose->first_busno);
 	}
-	of_prop_map = get_property(find_path_device("/"), "pci-OF-bus-map", 0);
+	of_prop_map = get_property(find_path_device("/"), "pci-OF-bus-map", NULL);
 	if (of_prop_map)
 		memcpy(of_prop_map, pci_to_OF_bus_map, pci_bus_count);
 #ifdef DEBUG
@@ -743,7 +743,7 @@ scan_OF_pci_childs(struct device_node* node, pci_OF_scan_iterator filter, void*
 		 * a fake root for all functions of a multi-function device,
 		 * we go down them as well.
 		 */
-		class_code = (unsigned int *) get_property(node, "class-code", 0);
+		class_code = (unsigned int *) get_property(node, "class-code", NULL);
 		if ((!class_code || ((*class_code >> 8) != PCI_CLASS_BRIDGE_PCI &&
 			(*class_code >> 8) != PCI_CLASS_BRIDGE_CARDBUS)) &&
 			strcmp(node->name, "multifunc-device"))
@@ -761,7 +761,7 @@ scan_OF_pci_childs_iterator(struct device_node* node, void* data)
 	unsigned int *reg;
 	u8* fdata = (u8*)data;
 	
-	reg = (unsigned int *) get_property(node, "reg", 0);
+	reg = (unsigned int *) get_property(node, "reg", NULL);
 	if (reg && ((reg[0] >> 8) & 0xff) == fdata[1]
 		&& ((reg[0] >> 16) & 0xff) == fdata[0])
 		return 1;
@@ -874,7 +874,7 @@ pci_device_from_OF_node(struct device_node* node, u8* bus, u8* devfn)
 	if (!scan_OF_pci_childs(((struct device_node*)hose->arch_data)->child,
 			find_OF_pci_device_filter, (void *)node))
 		return -ENODEV;
-	reg = (unsigned int *) get_property(node, "reg", 0);
+	reg = (unsigned int *) get_property(node, "reg", NULL);
 	if (!reg)
 		return -ENODEV;
 	*bus = (reg[0] >> 16) & 0xff;
diff --git a/arch/ppc/kernel/ppc-stub.c b/arch/ppc/kernel/ppc-stub.c
index 37c9c8b2c..a86975032 100644
--- a/arch/ppc/kernel/ppc-stub.c
+++ b/arch/ppc/kernel/ppc-stub.c
@@ -105,6 +105,8 @@
 #include <linux/mm.h>
 #include <linux/smp.h>
 #include <linux/smp_lock.h>
+#include <linux/init.h>
+#include <linux/sysrq.h>
 
 #include <asm/cacheflush.h>
 #include <asm/system.h>
@@ -232,7 +234,7 @@ mem2hex(const char *mem, char *buf, int count)
 	} else {
 		/* error condition */
 	}
-	debugger_fault_handler = 0;
+	debugger_fault_handler = NULL;
 	*buf = 0;
 	return buf;
 }
@@ -298,7 +300,7 @@ hex2mem(char *buf, char *mem, int count)
 	} else {
 		/* error condition */
 	}
-	debugger_fault_handler = 0;
+	debugger_fault_handler = NULL;
 	return mem;
 }
 
@@ -329,7 +331,7 @@ hexToInt(char **ptr, int *intValue)
 	} else {
 		/* error condition */
 	}
-	debugger_fault_handler = 0;
+	debugger_fault_handler = NULL;
 
 	return (numChars);
 }
@@ -855,3 +857,23 @@ kgdb_output_string (const char* s, unsigned int count)
 	return 1;
 }
 #endif
+
+static void sysrq_handle_gdb(int key, struct pt_regs *pt_regs,
+			     struct tty_struct *tty)
+{
+	printk("Entering GDB stub\n");
+	breakpoint();
+}
+static struct sysrq_key_op sysrq_gdb_op = {
+        .handler        = sysrq_handle_gdb,
+        .help_msg       = "Gdb",
+        .action_msg     = "GDB",
+};
+
+static int gdb_register_sysrq(void)
+{
+	printk("Registering GDB sysrq handler\n");
+	register_sysrq_key('g', &sysrq_gdb_op);
+	return 0;
+}
+module_init(gdb_register_sysrq);
diff --git a/arch/ppc/kernel/ppc_htab.c b/arch/ppc/kernel/ppc_htab.c
index ad7808fa6..91592c03e 100644
--- a/arch/ppc/kernel/ppc_htab.c
+++ b/arch/ppc/kernel/ppc_htab.c
@@ -19,6 +19,7 @@
 #include <linux/ctype.h>
 #include <linux/threads.h>
 #include <linux/smp_lock.h>
+#include <linux/seq_file.h>
 
 #include <asm/uaccess.h>
 #include <asm/bitops.h>
@@ -30,13 +31,11 @@
 #include <asm/system.h>
 #include <asm/reg.h>
 
-static ssize_t ppc_htab_read(struct file * file, char __user * buf,
-			     size_t count, loff_t *ppos);
+static int ppc_htab_show(struct seq_file *m, void *v);
 static ssize_t ppc_htab_write(struct file * file, const char __user * buffer,
 			      size_t count, loff_t *ppos);
-static long long ppc_htab_lseek(struct file * file, loff_t offset, int orig);
 int proc_dol2crvec(ctl_table *table, int write, struct file *filp,
-		  void __user *buffer, size_t *lenp);
+		  void __user *buffer, size_t *lenp, loff_t *ppos);
 
 extern PTE *Hash, *Hash_end;
 extern unsigned long Hash_size, Hash_mask;
@@ -49,10 +48,17 @@ extern unsigned long pte_errors;
 extern unsigned int primary_pteg_full;
 extern unsigned int htab_hash_searches;
 
+static int ppc_htab_open(struct inode *inode, struct file *file)
+{
+	return single_open(file, ppc_htab_show, NULL);
+}
+
 struct file_operations ppc_htab_operations = {
-        .llseek =       ppc_htab_lseek,
-        .read =         ppc_htab_read,
-        .write =        ppc_htab_write,
+	.open		= ppc_htab_open,
+	.read		= seq_read,
+	.llseek		= seq_lseek,
+	.write		= ppc_htab_write,
+	.release	= single_release,
 };
 
 static char *pmc1_lookup(unsigned long mmcr0)
@@ -96,31 +102,25 @@ static char *pmc2_lookup(unsigned long mmcr0)
  * is _REALLY_ slow (see the nested for loops below) but nothing
  * in here should be really timing critical. -- Cort
  */
-static ssize_t ppc_htab_read(struct file * file, char __user * buf,
-			     size_t count, loff_t *ppos)
+static int ppc_htab_show(struct seq_file *m, void *v)
 {
 	unsigned long mmcr0 = 0, pmc1 = 0, pmc2 = 0;
-	int n = 0;
 #if defined(CONFIG_PPC_STD_MMU) && !defined(CONFIG_PPC64BRIDGE)
 	unsigned int kptes = 0, uptes = 0;
 	PTE *ptr;
 #endif /* CONFIG_PPC_STD_MMU */
-	char buffer[512];
-
-	if (count < 0)
-		return -EINVAL;
 
 	if (cur_cpu_spec[0]->cpu_features & CPU_FTR_604_PERF_MON) {
 		mmcr0 = mfspr(SPRN_MMCR0);
 		pmc1 = mfspr(SPRN_PMC1);
 		pmc2 = mfspr(SPRN_PMC2);
-		n += sprintf( buffer + n,
+		seq_printf(m,
 			      "604 Performance Monitoring\n"
 			      "MMCR0\t\t: %08lx %s%s ",
 			      mmcr0,
 			      ( mmcr0>>28 & 0x2 ) ? "(user mode counted)" : "",
 			      ( mmcr0>>28 & 0x4 ) ? "(kernel mode counted)" : "");
-		n += sprintf( buffer + n,
+		seq_printf(m,
 			      "\nPMC1\t\t: %08lx (%s)\n"
 			      "PMC2\t\t: %08lx (%s)\n",
 			      pmc1, pmc1_lookup(mmcr0),
@@ -129,10 +129,9 @@ static ssize_t ppc_htab_read(struct file * file, char __user * buf,
 
 #ifdef CONFIG_PPC_STD_MMU
 	/* if we don't have a htab */
-	if ( Hash_size == 0 )
-	{
-		n += sprintf( buffer + n, "No Hash Table used\n");
-		goto return_string;
+	if ( Hash_size == 0 ) {
+		seq_printf(m, "No Hash Table used\n");
+		return 0;
 	}
 
 #ifndef CONFIG_PPC64BRIDGE
@@ -151,7 +150,7 @@ static ssize_t ppc_htab_read(struct file * file, char __user * buf,
 	}
 #endif
 
-	n += sprintf( buffer + n,
+	seq_printf(m,
 		      "PTE Hash Table Information\n"
 		      "Size\t\t: %luKb\n"
 		      "Buckets\t\t: %lu\n"
@@ -173,7 +172,7 @@ static ssize_t ppc_htab_read(struct file * file, char __user * buf,
 #endif
 		);
 
-	n += sprintf( buffer + n,
+	seq_printf(m,
 		      "Reloads\t\t: %lu\n"
 		      "Preloads\t: %lu\n"
 		      "Searches\t: %u\n"
@@ -181,23 +180,13 @@ static ssize_t ppc_htab_read(struct file * file, char __user * buf,
 		      "Evicts\t\t: %lu\n",
 		      htab_reloads, htab_preloads, htab_hash_searches,
 		      primary_pteg_full, htab_evicts);
-return_string:
 #endif /* CONFIG_PPC_STD_MMU */
 
-	n += sprintf( buffer + n,
+	seq_printf(m,
 		      "Non-error misses: %lu\n"
 		      "Error misses\t: %lu\n",
 		      pte_misses, pte_errors);
-	if (*ppos >= strlen(buffer))
-		return 0;
-	if (n > strlen(buffer) - *ppos)
-		n = strlen(buffer) - *ppos;
-	if (n > count)
-		n = count;
-	if (copy_to_user(buf, buffer + *ppos, n))
-		return -EFAULT;
-	*ppos += n;
-	return n;
+	return 0;
 }
 
 /*
@@ -210,7 +199,7 @@ static ssize_t ppc_htab_write(struct file * file, const char __user * ubuffer,
 	unsigned long tmp;
 	char buffer[16];
 
-	if ( current->uid != 0 )
+	if (!capable(CAP_SYS_ADMIN))
 		return -EACCES;
 	if (strncpy_from_user(buffer, ubuffer, 15))
 		return -EFAULT;
@@ -330,28 +319,8 @@ static ssize_t ppc_htab_write(struct file * file, const char __user * ubuffer,
 #endif /* CONFIG_PPC_STD_MMU */
 }
 
-
-static long long
-ppc_htab_lseek(struct file * file, loff_t offset, int orig)
-{
-    long long ret = -EINVAL;
-
-    lock_kernel();
-    switch (orig) {
-    case 0:
-	file->f_pos = offset;
-	ret = file->f_pos;
-	break;
-    case 1:
-	file->f_pos += offset;
-	ret = file->f_pos;
-    }
-    unlock_kernel();
-    return ret;
-}
-
 int proc_dol2crvec(ctl_table *table, int write, struct file *filp,
-		  void __user *buffer_arg, size_t *lenp)
+		  void __user *buffer_arg, size_t *lenp, loff_t *ppos)
 {
 	int vleft, first=1, len, left, val;
 	char __user *buffer = (char __user *) buffer_arg;
@@ -375,7 +344,7 @@ int proc_dol2crvec(ctl_table *table, int write, struct file *filp,
 	if (!(cur_cpu_spec[0]->cpu_features & CPU_FTR_L2CR))
 		return -EFAULT;
 
-	if ( /*!table->maxlen ||*/ (filp->f_pos && !write)) {
+	if ( /*!table->maxlen ||*/ (*ppos && !write)) {
 		*lenp = 0;
 		return 0;
 	}
@@ -448,15 +417,15 @@ int proc_dol2crvec(ctl_table *table, int write, struct file *filp,
 	}
 
 	if (!write && !first && left) {
-		if(put_user('\n', (char *) buffer))
+		if(put_user('\n', (char __user *) buffer))
 			return -EFAULT;
 		left--, buffer++;
 	}
 	if (write) {
-		p = (char *) buffer;
+		char __user *s = (char __user *) buffer;
 		while (left) {
 			char c;
-			if(get_user(c, p++))
+			if(get_user(c, s++))
 				return -EFAULT;
 			if (!isspace(c))
 				break;
@@ -466,6 +435,6 @@ int proc_dol2crvec(ctl_table *table, int write, struct file *filp,
 	if (write && first)
 		return -EINVAL;
 	*lenp -= left;
-	filp->f_pos += *lenp;
+	*ppos += *lenp;
 	return 0;
 }
diff --git a/arch/ppc/kernel/ppc_ksyms.c b/arch/ppc/kernel/ppc_ksyms.c
index eaeb6eb1e..2d3e630a7 100644
--- a/arch/ppc/kernel/ppc_ksyms.c
+++ b/arch/ppc/kernel/ppc_ksyms.c
@@ -68,7 +68,6 @@ extern int sys_sigreturn(struct pt_regs *regs);
 long long __ashrdi3(long long, int);
 long long __ashldi3(long long, int);
 long long __lshrdi3(long long, int);
-int abs(int);
 
 extern unsigned long mm_ptov (unsigned long paddr);
 
@@ -199,6 +198,10 @@ EXPORT_SYMBOL(flush_tlb_page);
 EXPORT_SYMBOL(last_task_used_altivec);
 EXPORT_SYMBOL(giveup_altivec);
 #endif /* CONFIG_ALTIVEC */
+#ifdef CONFIG_SPE
+EXPORT_SYMBOL(last_task_used_spe);
+EXPORT_SYMBOL(giveup_spe);
+#endif /* CONFIG_SPE */
 #ifdef CONFIG_SMP
 EXPORT_SYMBOL(smp_call_function);
 EXPORT_SYMBOL(smp_hw_index);
@@ -272,8 +275,6 @@ EXPORT_SYMBOL(memscan);
 EXPORT_SYMBOL(memcmp);
 EXPORT_SYMBOL(memchr);
 
-EXPORT_SYMBOL(abs);
-
 #if defined(CONFIG_FB_VGA16_MODULE)
 EXPORT_SYMBOL(screen_info);
 #endif
@@ -324,7 +325,7 @@ EXPORT_SYMBOL(debugger_fault_handler);
 EXPORT_SYMBOL(cpm_install_handler);
 EXPORT_SYMBOL(cpm_free_handler);
 #endif /* CONFIG_8xx */
-#if defined(CONFIG_8xx) || defined(CONFIG_40x)
+#if defined(CONFIG_8xx) || defined(CONFIG_40x) || defined(CONFIG_85xx)
 EXPORT_SYMBOL(__res);
 #endif
 #if defined(CONFIG_8xx)
diff --git a/arch/ppc/kernel/process.c b/arch/ppc/kernel/process.c
index b82a2009e..2ea505381 100644
--- a/arch/ppc/kernel/process.c
+++ b/arch/ppc/kernel/process.c
@@ -35,6 +35,7 @@
 #include <linux/init_task.h>
 #include <linux/module.h>
 #include <linux/kallsyms.h>
+#include <linux/mqueue.h>
 
 #include <asm/pgtable.h>
 #include <asm/uaccess.h>
@@ -49,6 +50,7 @@ extern unsigned long _get_SP(void);
 
 struct task_struct *last_task_used_math = NULL;
 struct task_struct *last_task_used_altivec = NULL;
+struct task_struct *last_task_used_spe = NULL;
 
 static struct fs_struct init_fs = INIT_FS;
 static struct files_struct init_files = INIT_FILES;
@@ -177,6 +179,34 @@ enable_kernel_altivec(void)
 EXPORT_SYMBOL(enable_kernel_altivec);
 #endif /* CONFIG_ALTIVEC */
 
+#ifdef CONFIG_SPE
+int
+dump_spe(struct pt_regs *regs, elf_vrregset_t *evrregs)
+{
+	if (regs->msr & MSR_SPE)
+		giveup_spe(current);
+	/* We copy u32 evr[32] + u64 acc + u32 spefscr -> 35 */
+	memcpy(evrregs, &current->thread.evr[0], sizeof(u32) * 35);
+	return 1;
+}
+
+void
+enable_kernel_spe(void)
+{
+	WARN_ON(preemptible());
+
+#ifdef CONFIG_SMP
+	if (current->thread.regs && (current->thread.regs->msr & MSR_SPE))
+		giveup_spe(current);
+	else
+		giveup_spe(NULL);	/* just enable SPE for kernel - force */
+#else
+	giveup_spe(last_task_used_spe);
+#endif /* __SMP __ */
+}
+EXPORT_SYMBOL(enable_kernel_spe);
+#endif /* CONFIG_SPE */
+
 void
 enable_kernel_fp(void)
 {
@@ -244,6 +274,17 @@ struct task_struct *__switch_to(struct task_struct *prev,
 	if ((prev->thread.regs && (prev->thread.regs->msr & MSR_VEC)))
 		giveup_altivec(prev);
 #endif /* CONFIG_ALTIVEC */
+#ifdef CONFIG_SPE
+	/*
+	 * If the previous thread used spe in the last quantum
+	 * (thus changing spe regs) then save them.
+	 *
+	 * On SMP we always save/restore spe regs just to avoid the
+	 * complexity of changing processors.
+	 */
+	if ((prev->thread.regs && (prev->thread.regs->msr & MSR_SPE)))
+		giveup_spe(prev);
+#endif /* CONFIG_SPE */
 #endif /* CONFIG_SMP */
 
 	/* Avoid the trap.  On smp this this never happens since
@@ -251,6 +292,13 @@ struct task_struct *__switch_to(struct task_struct *prev,
 	 */
 	if (new->thread.regs && last_task_used_altivec == new)
 		new->thread.regs->msr |= MSR_VEC;
+#ifdef CONFIG_SPE
+	/* Avoid the trap.  On smp this this never happens since
+	 * we don't set last_task_used_spe
+	 */
+	if (new->thread.regs && last_task_used_spe == new)
+		new->thread.regs->msr |= MSR_SPE;
+#endif /* CONFIG_SPE */
 	new_thread = &new->thread;
 	old_thread = &current->thread;
 	last = _switch(old_thread, new_thread);
@@ -354,6 +402,10 @@ void prepare_to_copy(struct task_struct *tsk)
 	if (regs->msr & MSR_VEC)
 		giveup_altivec(current);
 #endif /* CONFIG_ALTIVEC */
+#ifdef CONFIG_SPE
+	if (regs->msr & MSR_SPE)
+		giveup_spe(current);
+#endif /* CONFIG_SPE */
 	preempt_enable();
 }
 
@@ -427,9 +479,9 @@ void start_thread(struct pt_regs *regs, unsigned long nip, unsigned long sp)
 	regs->gpr[1] = sp;
 	regs->msr = MSR_USER;
 	if (last_task_used_math == current)
-		last_task_used_math = 0;
+		last_task_used_math = NULL;
 	if (last_task_used_altivec == current)
-		last_task_used_altivec = 0;
+		last_task_used_altivec = NULL;
 	memset(current->thread.fpr, 0, sizeof(current->thread.fpr));
 	current->thread.fpscr = 0;
 #ifdef CONFIG_ALTIVEC
@@ -438,18 +490,45 @@ void start_thread(struct pt_regs *regs, unsigned long nip, unsigned long sp)
 	current->thread.vrsave = 0;
 	current->thread.used_vr = 0;
 #endif /* CONFIG_ALTIVEC */
+#ifdef CONFIG_SPE
+	memset(current->thread.evr, 0, sizeof(current->thread.evr));
+	current->thread.acc = 0;
+	current->thread.spefscr = 0;
+	current->thread.used_spe = 0;
+#endif /* CONFIG_SPE */
 }
 
+#define PR_FP_ALL_EXCEPT (PR_FP_EXC_DIV | PR_FP_EXC_OVF | PR_FP_EXC_UND \
+		| PR_FP_EXC_RES | PR_FP_EXC_INV)
+
 int set_fpexc_mode(struct task_struct *tsk, unsigned int val)
 {
 	struct pt_regs *regs = tsk->thread.regs;
 
-	if (val > PR_FP_EXC_PRECISE)
+	/* This is a bit hairy.  If we are an SPE enabled  processor
+	 * (have embedded fp) we store the IEEE exception enable flags in
+	 * fpexc_mode.  fpexc_mode is also used for setting FP exception
+	 * mode (asyn, precise, disabled) for 'Classic' FP. */
+	if (val & PR_FP_EXC_SW_ENABLE) {
+#ifdef CONFIG_SPE
+		tsk->thread.fpexc_mode = val &
+			(PR_FP_EXC_SW_ENABLE | PR_FP_ALL_EXCEPT);
+#else
 		return -EINVAL;
-	tsk->thread.fpexc_mode = __pack_fe01(val);
-	if (regs != NULL && (regs->msr & MSR_FP) != 0)
-		regs->msr = (regs->msr & ~(MSR_FE0|MSR_FE1))
-			| tsk->thread.fpexc_mode;
+#endif
+	} else {
+		/* on a CONFIG_SPE this does not hurt us.  The bits that
+		 * __pack_fe01 use do not overlap with bits used for
+		 * PR_FP_EXC_SW_ENABLE.  Additionally, the MSR[FE0,FE1] bits
+		 * on CONFIG_SPE implementations are reserved so writing to
+		 * them does not change anything */
+		if (val > PR_FP_EXC_PRECISE)
+			return -EINVAL;
+		tsk->thread.fpexc_mode = __pack_fe01(val);
+		if (regs != NULL && (regs->msr & MSR_FP) != 0)
+			regs->msr = (regs->msr & ~(MSR_FE0|MSR_FE1))
+				| tsk->thread.fpexc_mode;
+	}
 	return 0;
 }
 
@@ -457,8 +536,15 @@ int get_fpexc_mode(struct task_struct *tsk, unsigned long adr)
 {
 	unsigned int val;
 
-	val = __unpack_fe01(tsk->thread.fpexc_mode);
-	return put_user(val, (unsigned int *) adr);
+	if (tsk->thread.fpexc_mode & PR_FP_EXC_SW_ENABLE)
+#ifdef CONFIG_SPE
+		val = tsk->thread.fpexc_mode;
+#else
+		return -EINVAL;
+#endif
+	else
+		val = __unpack_fe01(tsk->thread.fpexc_mode);
+	return put_user(val, (unsigned int __user *) adr);
 }
 
 int sys_clone(unsigned long clone_flags, unsigned long usp,
@@ -506,6 +592,10 @@ int sys_execve(unsigned long a0, unsigned long a1, unsigned long a2,
 	if (regs->msr & MSR_VEC)
 		giveup_altivec(current);
 #endif /* CONFIG_ALTIVEC */
+#ifdef CONFIG_SPE
+	if (regs->msr & MSR_SPE)
+		giveup_spe(current);
+#endif /* CONFIG_SPE */
 	preempt_enable();
 	error = do_execve(filename, (char __user *__user *) a1,
 			  (char __user *__user *) a2, regs);
diff --git a/arch/ppc/kernel/ptrace.c b/arch/ppc/kernel/ptrace.c
index f9120785b..c24367432 100644
--- a/arch/ppc/kernel/ptrace.c
+++ b/arch/ppc/kernel/ptrace.c
@@ -35,7 +35,7 @@
 /*
  * Set of msr bits that gdb can change on behalf of a process.
  */
-#ifdef CONFIG_4xx
+#if defined(CONFIG_4xx) || defined(CONFIG_BOOKE)
 #define MSR_DEBUGCHANGE	0
 #else
 #define MSR_DEBUGCHANGE	(MSR_SE | MSR_BE)
@@ -77,7 +77,7 @@ static inline int put_reg(struct task_struct *task, int regno,
 /*
  * Get contents of AltiVec register state in task TASK
  */
-static inline int get_vrregs(unsigned long *data, struct task_struct *task)
+static inline int get_vrregs(unsigned long __user *data, struct task_struct *task)
 {
 	int i, j;
 
@@ -105,7 +105,7 @@ static inline int get_vrregs(unsigned long *data, struct task_struct *task)
 /*
  * Write contents of AltiVec register state into task TASK.
  */
-static inline int set_vrregs(struct task_struct *task, unsigned long *data)
+static inline int set_vrregs(struct task_struct *task, unsigned long __user *data)
 {
 	int i, j;
 
@@ -131,13 +131,77 @@ static inline int set_vrregs(struct task_struct *task, unsigned long *data)
 }
 #endif
 
+#ifdef CONFIG_SPE
+
+/*
+ * For get_evrregs/set_evrregs functions 'data' has the following layout:
+ *
+ * struct {
+ *   u32 evr[32];
+ *   u64 acc;
+ *   u32 spefscr;
+ * }
+ */
+
+/*
+ * Get contents of SPE register state in task TASK.
+ */
+static inline int get_evrregs(unsigned long *data, struct task_struct *task)
+{
+	int i;
+
+	if (!access_ok(VERIFY_WRITE, data, 35 * sizeof(unsigned long)))
+		return -EFAULT;
+
+	/* copy SPEFSCR */
+	if (__put_user(task->thread.spefscr, &data[34]))
+		return -EFAULT;
+
+	/* copy SPE registers EVR[0] .. EVR[31] */
+	for (i = 0; i < 32; i++, data++)
+		if (__put_user(task->thread.evr[i], data))
+			return -EFAULT;
+
+	/* copy ACC */
+	if (__put_user64(task->thread.acc, (unsigned long long *)data))
+		return -EFAULT;
+
+	return 0;
+}
+
+/*
+ * Write contents of SPE register state into task TASK.
+ */
+static inline int set_evrregs(struct task_struct *task, unsigned long *data)
+{
+	int i;
+
+	if (!access_ok(VERIFY_READ, data, 35 * sizeof(unsigned long)))
+		return -EFAULT;
+
+	/* copy SPEFSCR */
+	if (__get_user(task->thread.spefscr, &data[34]))
+		return -EFAULT;
+
+	/* copy SPE registers EVR[0] .. EVR[31] */
+	for (i = 0; i < 32; i++, data++)
+		if (__get_user(task->thread.evr[i], data))
+			return -EFAULT;
+	/* copy ACC */
+	if (__get_user64(task->thread.acc, (unsigned long long*)data))
+		return -EFAULT;
+
+	return 0;
+}
+#endif /* CONFIG_SPE */
+
 static inline void
 set_single_step(struct task_struct *task)
 {
 	struct pt_regs *regs = task->thread.regs;
 
 	if (regs != NULL) {
-#ifdef CONFIG_4xx
+#if defined(CONFIG_4xx) || defined(CONFIG_BOOKE)
 		task->thread.dbcr0 = DBCR0_IDM | DBCR0_IC;
 		/* MSR.DE should already be set */
 #else
@@ -152,7 +216,7 @@ clear_single_step(struct task_struct *task)
 	struct pt_regs *regs = task->thread.regs;
 
 	if (regs != NULL) {
-#ifdef CONFIG_4xx
+#if defined(CONFIG_4xx) || defined(CONFIG_BOOKE)
 		task->thread.dbcr0 = 0;
 #else
 		regs->msr &= ~MSR_SE;
@@ -224,7 +288,7 @@ int sys_ptrace(long request, long pid, long addr, long data)
 		ret = -EIO;
 		if (copied != sizeof(tmp))
 			break;
-		ret = put_user(tmp,(unsigned long *) data);
+		ret = put_user(tmp,(unsigned long __user *) data);
 		break;
 	}
 
@@ -250,7 +314,7 @@ int sys_ptrace(long request, long pid, long addr, long data)
 			preempt_enable();
 			tmp = ((unsigned long *)child->thread.fpr)[index - PT_FPR0];
 		}
-		ret = put_user(tmp,(unsigned long *) data);
+		ret = put_user(tmp,(unsigned long __user *) data);
 		break;
 	}
 
@@ -348,7 +412,7 @@ int sys_ptrace(long request, long pid, long addr, long data)
 		if (child->thread.regs->msr & MSR_VEC)
 			giveup_altivec(child);
 		preempt_enable();
-		ret = get_vrregs((unsigned long *)data, child);
+		ret = get_vrregs((unsigned long __user *)data, child);
 		break;
 
 	case PTRACE_SETVRREGS:
@@ -359,7 +423,24 @@ int sys_ptrace(long request, long pid, long addr, long data)
 		if (child->thread.regs->msr & MSR_VEC)
 			giveup_altivec(child);
 		preempt_enable();
-		ret = set_vrregs(child, (unsigned long *)data);
+		ret = set_vrregs(child, (unsigned long __user *)data);
+		break;
+#endif
+#ifdef CONFIG_SPE
+	case PTRACE_GETEVRREGS:
+		/* Get the child spe register state. */
+		if (child->thread.regs->msr & MSR_SPE)
+			giveup_spe(child);
+		ret = get_evrregs((unsigned long __user *)data, child);
+		break;
+
+	case PTRACE_SETEVRREGS:
+		/* Set the child spe register state. */
+		/* this is to clear the MSR_SPE bit to force a reload
+		 * of register state from memory */
+		if (child->thread.regs->msr & MSR_SPE)
+			giveup_spe(child);
+		ret = set_evrregs(child, (unsigned long __user *)data);
 		break;
 #endif
 
diff --git a/arch/ppc/kernel/setup.c b/arch/ppc/kernel/setup.c
index 18a2f147d..376f7369c 100644
--- a/arch/ppc/kernel/setup.c
+++ b/arch/ppc/kernel/setup.c
@@ -16,6 +16,7 @@
 #include <linux/seq_file.h>
 #include <linux/root_dev.h>
 #include <linux/cpu.h>
+#include <linux/console.h>
 
 #include <asm/residual.h>
 #include <asm/io.h>
@@ -54,7 +55,6 @@ extern void ppc6xx_idle(void);
 extern void power4_idle(void);
 
 extern boot_infos_t *boot_infos;
-char saved_command_line[COMMAND_LINE_SIZE];
 unsigned char aux_device_present;
 struct ide_machdep_calls ppc_ide_md;
 char *sysmap;
@@ -474,6 +474,60 @@ platform_init(unsigned long r3, unsigned long r4, unsigned long r5,
 		break;
 	}
 }
+
+#ifdef CONFIG_SERIAL_CORE_CONSOLE
+extern char *of_stdout_device;
+
+static int __init set_preferred_console(void)
+{
+	struct device_node *prom_stdout;
+	char *name;
+	int offset;
+
+	/* The user has requested a console so this is already set up. */
+	if (strstr(saved_command_line, "console="))
+		return -EBUSY;
+
+	prom_stdout = find_path_device(of_stdout_device);
+	if (!prom_stdout)
+		return -ENODEV;
+
+	name = (char *)get_property(prom_stdout, "name", NULL);
+	if (!name)
+		return -ENODEV;
+
+	if (strcmp(name, "serial") == 0) {
+		int i;
+		u32 *reg = (u32 *)get_property(prom_stdout, "reg", &i);
+		if (i > 8) {
+			switch (reg[1]) {
+				case 0x3f8:
+					offset = 0;
+					break;
+				case 0x2f8:
+					offset = 1;
+					break;
+				case 0x898:
+					offset = 2;
+					break;
+				case 0x890:
+					offset = 3;
+					break;
+				default:
+					/* We dont recognise the serial port */
+					return -ENODEV;
+			}
+		}
+	} else if (strcmp(name, "ch-a") == 0)
+		offset = 0;
+	else if (strcmp(name, "ch-b") == 0)
+		offset = 1;
+	else
+		return -ENODEV;
+	return add_preferred_console("ttyS", offset, NULL);
+}
+console_initcall(set_preferred_console);
+#endif /* CONFIG_SERIAL_CORE_CONSOLE */
 #endif /* CONFIG_PPC_MULTIPLATFORM */
 
 struct bi_record *find_bootinfo(void)
@@ -568,7 +622,7 @@ int __init ppc_setup_l2cr(char *str)
 }
 __setup("l2cr=", ppc_setup_l2cr);
 
-#ifdef CONFIG_NVRAM
+#ifdef CONFIG_GENERIC_NVRAM
 
 /* Generic nvram hooks used by drivers/char/gen_nvram.c */
 unsigned char nvram_read_byte(int addr)
@@ -639,7 +693,7 @@ void __init setup_arch(char **cmdline_p)
 #ifdef CONFIG_XMON
 	xmon_map_scc();
 	if (strstr(cmd_line, "xmon"))
-		xmon(0);
+		xmon(NULL);
 #endif /* CONFIG_XMON */
 	if ( ppc_md.progress ) ppc_md.progress("setup_arch: enter", 0x3eab);
 
@@ -677,7 +731,7 @@ void __init setup_arch(char **cmdline_p)
 	init_mm.brk = (unsigned long) klimit;
 
 	/* Save unparsed command line copy for /proc/cmdline */
-	strlcpy(saved_command_line, cmd_line, sizeof(saved_command_line));
+	strlcpy(saved_command_line, cmd_line, COMMAND_LINE_SIZE);
 	*cmdline_p = cmd_line;
 
 	/* set up the bootmem stuff with available memory */
diff --git a/arch/ppc/kernel/signal.c b/arch/ppc/kernel/signal.c
index e4f23902c..20b6446c0 100644
--- a/arch/ppc/kernel/signal.c
+++ b/arch/ppc/kernel/signal.c
@@ -183,11 +183,11 @@ struct rt_sigframe
 
 /*
  * Save the current user registers on the user stack.
- * We only save the altivec registers if the process has used
- * altivec instructions at some point.
+ * We only save the altivec/spe registers if the process has used
+ * altivec/spe instructions at some point.
  */
 static int
-save_user_regs(struct pt_regs *regs, struct mcontext *frame, int sigret)
+save_user_regs(struct pt_regs *regs, struct mcontext __user *frame, int sigret)
 {
 	/* save general and floating-point registers */
 	CHECK_FULL_REGS(regs);
@@ -197,6 +197,10 @@ save_user_regs(struct pt_regs *regs, struct mcontext *frame, int sigret)
 #ifdef CONFIG_ALTIVEC
 	if (current->thread.used_vr && (regs->msr & MSR_VEC))
 		giveup_altivec(current);
+#endif /* CONFIG_ALTIVEC */
+#ifdef CONFIG_SPE
+	if (current->thread.used_spe && (regs->msr & MSR_SPE))
+		giveup_spe(current);
 #endif /* CONFIG_ALTIVEC */
 	preempt_enable();
 
@@ -225,10 +229,28 @@ save_user_regs(struct pt_regs *regs, struct mcontext *frame, int sigret)
 	 * significant bits of a vector, we "cheat" and stuff VRSAVE in the
 	 * most significant bits of that same vector. --BenH
 	 */
-	if (__put_user(current->thread.vrsave, (u32 *)&frame->mc_vregs[32]))
+	if (__put_user(current->thread.vrsave, (u32 __user *)&frame->mc_vregs[32]))
 		return 1;
 #endif /* CONFIG_ALTIVEC */
 
+#ifdef CONFIG_SPE
+	/* save spe registers */
+	if (current->thread.used_spe) {
+		if (__copy_to_user(&frame->mc_vregs, current->thread.evr,
+				   ELF_NEVRREG * sizeof(u32)))
+			return 1;
+		/* set MSR_SPE in the saved MSR value to indicate that
+		   frame->mc_vregs contains valid data */
+		if (__put_user(regs->msr | MSR_SPE, &frame->mc_gregs[PT_MSR]))
+			return 1;
+	}
+	/* else assert((regs->msr & MSR_SPE) == 0) */
+
+	/* We always copy to/from spefscr */
+	if (__put_user(current->thread.spefscr, (u32 *)&frame->mc_vregs + ELF_NEVRREG))
+		return 1;
+#endif /* CONFIG_SPE */
+
 	if (sigret) {
 		/* Set up the sigreturn trampoline: li r0,sigret; sc */
 		if (__put_user(0x38000000UL + sigret, &frame->tramp[0])
@@ -249,7 +271,7 @@ static int
 restore_user_regs(struct pt_regs *regs, struct mcontext __user *sr, int sig)
 {
 	unsigned long save_r2;
-#ifdef CONFIG_ALTIVEC
+#if defined(CONFIG_ALTIVEC) || defined(CONFIG_SPE)
 	unsigned long msr;
 #endif
 
@@ -286,10 +308,27 @@ restore_user_regs(struct pt_regs *regs, struct mcontext __user *sr, int sig)
 		memset(&current->thread.vr, 0, ELF_NVRREG * sizeof(vector128));
 
 	/* Always get VRSAVE back */
-	if (__get_user(current->thread.vrsave, (u32 *)&sr->mc_vregs[32]))
+	if (__get_user(current->thread.vrsave, (u32 __user *)&sr->mc_vregs[32]))
 		return 1;
 #endif /* CONFIG_ALTIVEC */
 
+#ifdef CONFIG_SPE
+	/* force the process to reload the spe registers from
+	   current->thread when it next does spe instructions */
+	regs->msr &= ~MSR_SPE;
+	if (!__get_user(msr, &sr->mc_gregs[PT_MSR]) && (msr & MSR_SPE) != 0) {
+		/* restore spe registers from the stack */
+		if (__copy_from_user(current->thread.evr, &sr->mc_vregs,
+				     sizeof(sr->mc_vregs)))
+			return 1;
+	} else if (current->thread.used_spe)
+		memset(&current->thread.evr, 0, ELF_NEVRREG * sizeof(u32));
+
+	/* Always get SPEFSCR back */
+	if (__get_user(current->thread.spefscr, (u32 *)&sr->mc_vregs + ELF_NEVRREG))
+		return 1;
+#endif /* CONFIG_SPE */
+
 	return 0;
 }
 
@@ -373,7 +412,7 @@ badframe:
 static int do_setcontext(struct ucontext __user *ucp, struct pt_regs *regs, int sig)
 {
 	sigset_t set;
-	struct mcontext *mcp;
+	struct mcontext __user *mcp;
 
 	if (__copy_from_user(&set, &ucp->uc_sigmask, sizeof(set))
 	    || __get_user(mcp, &ucp->uc_regs))
@@ -408,8 +447,8 @@ int sys_swapcontext(struct ucontext __user *old_ctx,
 	if (new_ctx == NULL)
 		return 0;
 	if (verify_area(VERIFY_READ, new_ctx, sizeof(*new_ctx))
-	    || __get_user(tmp, (u8 *) new_ctx)
-	    || __get_user(tmp, (u8 *) (new_ctx + 1) - 1))
+	    || __get_user(tmp, (u8 __user *) new_ctx)
+	    || __get_user(tmp, (u8 __user *) (new_ctx + 1) - 1))
 		return -EFAULT;
 
 	/*
@@ -485,7 +524,7 @@ handle_signal(unsigned long sig, struct k_sigaction *ka,
 	/* create a stack frame for the caller of the handler */
 	newsp -= __SIGNAL_FRAMESIZE;
 
-	if (verify_area(VERIFY_WRITE, (void *) newsp, origsp - newsp))
+	if (verify_area(VERIFY_WRITE, (void __user *) newsp, origsp - newsp))
 		goto badframe;
 
 #if _NSIG != 64
@@ -544,7 +583,7 @@ int sys_sigreturn(int r3, int r4, int r5, int r6, int r7, int r8,
 	set.sig[1] = sigctx._unused[3];
 	restore_sigmask(&set);
 
-	sr = (struct mcontext *) sigctx.regs;
+	sr = (struct mcontext __user *) sigctx.regs;
 	if (verify_area(VERIFY_READ, sr, sizeof(*sr))
 	    || restore_user_regs(regs, sr, 1))
 		goto badframe;
diff --git a/arch/ppc/kernel/syscalls.c b/arch/ppc/kernel/syscalls.c
index cbc9596b4..7e1dad422 100644
--- a/arch/ppc/kernel/syscalls.c
+++ b/arch/ppc/kernel/syscalls.c
@@ -68,7 +68,7 @@ sys_ipc (uint call, int first, int second, int third, void __user *ptr, long fif
 		break;
 	case SEMTIMEDOP:
 		ret = sys_semtimedop (first, (struct sembuf __user *)ptr,
-				      second, (const struct timespec *) fifth);
+				      second, (const struct timespec __user *) fifth);
 		break;
 	case SEMGET:
 		ret = sys_semget (first, second, third);
@@ -79,7 +79,7 @@ sys_ipc (uint call, int first, int second, int third, void __user *ptr, long fif
 		if (!ptr)
 			break;
 		if ((ret = verify_area (VERIFY_READ, ptr, sizeof(long)))
-		    || (ret = get_user(fourth.__pad, (void *__user *)ptr)))
+		    || (ret = get_user(fourth.__pad, (void __user *__user *)ptr)))
 			break;
 		ret = sys_semctl (first, second, third, fourth);
 		break;
@@ -209,17 +209,17 @@ out:
  * sys_select() with the appropriate args. -- Cort
  */
 int
-ppc_select(int n, fd_set *inp, fd_set *outp, fd_set *exp, struct timeval *tvp)
+ppc_select(int n, fd_set __user *inp, fd_set __user *outp, fd_set __user *exp, struct timeval __user *tvp)
 {
 	if ( (unsigned long)n >= 4096 )
 	{
 		unsigned long __user *buffer = (unsigned long __user *)n;
 		if (verify_area(VERIFY_READ, buffer, 5*sizeof(unsigned long))
 		    || __get_user(n, buffer)
-		    || __get_user(inp, ((fd_set **)(buffer+1)))
-		    || __get_user(outp, ((fd_set **)(buffer+2)))
-		    || __get_user(exp, ((fd_set **)(buffer+3)))
-		    || __get_user(tvp, ((struct timeval **)(buffer+4))))
+		    || __get_user(inp, ((fd_set __user * __user *)(buffer+1)))
+		    || __get_user(outp, ((fd_set  __user * __user *)(buffer+2)))
+		    || __get_user(exp, ((fd_set  __user * __user *)(buffer+3)))
+		    || __get_user(tvp, ((struct timeval  __user * __user *)(buffer+4))))
 			return -EFAULT;
 	}
 	return sys_select(n, inp, outp, exp, tvp);
diff --git a/arch/ppc/kernel/time.c b/arch/ppc/kernel/time.c
index 96a6138e4..cfeff0479 100644
--- a/arch/ppc/kernel/time.c
+++ b/arch/ppc/kernel/time.c
@@ -56,6 +56,7 @@
 #include <linux/mc146818rtc.h>
 #include <linux/time.h>
 #include <linux/init.h>
+#include <linux/profile.h>
 
 #include <asm/segment.h>
 #include <asm/io.h>
@@ -107,17 +108,23 @@ static inline int tb_delta(unsigned *jiffy_stamp) {
 	return delta;
 }
 
-extern unsigned long prof_cpu_mask;
-extern unsigned int * prof_buffer;
-extern unsigned long prof_len;
-extern unsigned long prof_shift;
 extern char _stext;
 
-static inline void ppc_do_profile (unsigned long nip)
+static inline void ppc_do_profile (struct pt_regs *regs)
 {
+	unsigned long nip;
+	extern unsigned long prof_cpu_mask;
+
+	profile_hook(regs);
+
+	if (user_mode(regs))
+		return;
+
 	if (!prof_buffer)
 		return;
 
+	nip = instruction_pointer(regs);
+
 	/*
 	 * Only measure the CPUs specified by /proc/irq/prof_cpu_mask.
 	 * (default is all CPUs.)
@@ -156,8 +163,9 @@ void timer_interrupt(struct pt_regs * regs)
 
 	while ((next_dec = tb_ticks_per_jiffy - tb_delta(&jiffy_stamp)) < 0) {
 		jiffy_stamp += tb_ticks_per_jiffy;
-		if (!user_mode(regs))
-			ppc_do_profile(instruction_pointer(regs));
+		
+		ppc_do_profile(regs);
+
 	  	if (smp_processor_id())
 			continue;
 
diff --git a/arch/ppc/kernel/traps.c b/arch/ppc/kernel/traps.c
index cc500228e..544ea9fb5 100644
--- a/arch/ppc/kernel/traps.c
+++ b/arch/ppc/kernel/traps.c
@@ -30,6 +30,7 @@
 #include <linux/config.h>
 #include <linux/init.h>
 #include <linux/module.h>
+#include <linux/prctl.h>
 
 #include <asm/pgtable.h>
 #include <asm/uaccess.h>
@@ -102,8 +103,7 @@ void die(const char * str, struct pt_regs * fp, long err)
 	do_exit(err);
 }
 
-void
-_exception(int signr, struct pt_regs *regs, int code, unsigned long addr)
+void _exception(int signr, struct pt_regs *regs, int code, unsigned long addr)
 {
 	siginfo_t info;
 
@@ -114,7 +114,7 @@ _exception(int signr, struct pt_regs *regs, int code, unsigned long addr)
 	info.si_signo = signr;
 	info.si_errno = 0;
 	info.si_code = code;
-	info.si_addr = (void *) addr;
+	info.si_addr = (void __user *) addr;
 	force_sig_info(signr, &info, current);
 }
 
@@ -171,6 +171,11 @@ static inline int check_io_access(struct pt_regs *regs)
 /* On 4xx, the reason for the machine check or program exception
    is in the ESR. */
 #define get_reason(regs)	((regs)->dsisr)
+#ifndef CONFIG_E500
+#define get_mc_reason(regs)	((regs)->dsisr)
+#else
+#define get_mc_reason(regs)	(mfspr(SPRN_MCSR))
+#endif
 #define REASON_FP		0
 #define REASON_ILLEGAL		ESR_PIL
 #define REASON_PRIVILEGED	ESR_PPR
@@ -184,6 +189,7 @@ static inline int check_io_access(struct pt_regs *regs)
 /* On non-4xx, the reason for the machine check or program
    exception is in the MSR. */
 #define get_reason(regs)	((regs)->msr)
+#define get_mc_reason(regs)	((regs)->msr)
 #define REASON_FP		0x100000
 #define REASON_ILLEGAL		0x80000
 #define REASON_PRIVILEGED	0x40000
@@ -193,10 +199,9 @@ static inline int check_io_access(struct pt_regs *regs)
 #define clear_single_step(regs)	((regs)->msr &= ~MSR_SE)
 #endif
 
-void
-MachineCheckException(struct pt_regs *regs)
+void MachineCheckException(struct pt_regs *regs)
 {
-	unsigned long reason = get_reason(regs);
+	unsigned long reason = get_mc_reason(regs);
 
 	if (user_mode(regs)) {
 		regs->msr |= MSR_RI;
@@ -256,7 +261,37 @@ MachineCheckException(struct pt_regs *regs)
 		/* Clear MCSR */
 		mtspr(SPRN_MCSR, mcsr);
 	}
-#else /* !CONFIG_4xx */
+#elif defined (CONFIG_E500)
+	printk("Machine check in kernel mode.\n");
+	printk("Caused by (from MCSR=%lx): ", reason);
+
+	if (reason & MCSR_MCP)
+		printk("Machine Check Signal\n");
+	if (reason & MCSR_ICPERR)
+		printk("Instruction Cache Parity Error\n");
+	if (reason & MCSR_DCP_PERR)
+		printk("Data Cache Push Parity Error\n");
+	if (reason & MCSR_DCPERR)
+		printk("Data Cache Parity Error\n");
+	if (reason & MCSR_GL_CI)
+		printk("Guarded Load or Cache-Inhibited stwcx.\n");
+	if (reason & MCSR_BUS_IAERR)
+		printk("Bus - Instruction Address Error\n");
+	if (reason & MCSR_BUS_RAERR)
+		printk("Bus - Read Address Error\n");
+	if (reason & MCSR_BUS_WAERR)
+		printk("Bus - Write Address Error\n");
+	if (reason & MCSR_BUS_IBERR)
+		printk("Bus - Instruction Data Error\n");
+	if (reason & MCSR_BUS_RBERR)
+		printk("Bus - Read Data Bus Error\n");
+	if (reason & MCSR_BUS_WBERR)
+		printk("Bus - Read Data Bus Error\n");
+	if (reason & MCSR_BUS_IPERR)
+		printk("Bus - Instruction Parity Error\n");
+	if (reason & MCSR_BUS_RPERR)
+		printk("Bus - Read Parity Error\n");
+#else /* !CONFIG_4xx && !CONFIG_E500 */
 	printk("Machine check in kernel mode.\n");
 	printk("Caused by (from SRR1=%lx): ", reason);
 	switch (reason & 0x601F0000) {
@@ -292,8 +327,7 @@ MachineCheckException(struct pt_regs *regs)
 	die("machine check", regs, SIGBUS);
 }
 
-void
-SMIException(struct pt_regs *regs)
+void SMIException(struct pt_regs *regs)
 {
 	debugger(regs);
 #if !(defined(CONFIG_XMON) || defined(CONFIG_KGDB))
@@ -302,24 +336,21 @@ SMIException(struct pt_regs *regs)
 #endif
 }
 
-void
-UnknownException(struct pt_regs *regs)
+void UnknownException(struct pt_regs *regs)
 {
 	printk("Bad trap at PC: %lx, MSR: %lx, vector=%lx    %s\n",
 	       regs->nip, regs->msr, regs->trap, print_tainted());
 	_exception(SIGTRAP, regs, 0, 0);
 }
 
-void
-InstructionBreakpoint(struct pt_regs *regs)
+void InstructionBreakpoint(struct pt_regs *regs)
 {
 	if (debugger_iabr_match(regs))
 		return;
 	_exception(SIGTRAP, regs, TRAP_BRKPT, 0);
 }
 
-void
-RunModeException(struct pt_regs *regs)
+void RunModeException(struct pt_regs *regs)
 {
 	_exception(SIGTRAP, regs, 0, 0);
 }
@@ -337,8 +368,7 @@ RunModeException(struct pt_regs *regs)
 #define INST_MFSPR_PVR		0x7c1f42a6
 #define INST_MFSPR_PVR_MASK	0xfc1fffff
 
-static int
-emulate_instruction(struct pt_regs *regs)
+static int emulate_instruction(struct pt_regs *regs)
 {
 	u32 instword;
 	u32 rd;
@@ -401,8 +431,7 @@ static struct bug_entry *find_bug(unsigned long bugaddr)
 	return module_find_bug(bugaddr);
 }
 
-int
-check_bug_trap(struct pt_regs *regs)
+int check_bug_trap(struct pt_regs *regs)
 {
 	struct bug_entry *bug;
 	unsigned long addr;
@@ -439,8 +468,7 @@ check_bug_trap(struct pt_regs *regs)
 	return 0;
 }
 
-void
-ProgramCheckException(struct pt_regs *regs)
+void ProgramCheckException(struct pt_regs *regs)
 {
 	unsigned int reason = get_reason(regs);
 	extern int do_mathemu(struct pt_regs *regs);
@@ -513,8 +541,7 @@ ProgramCheckException(struct pt_regs *regs)
 	_exception(SIGILL, regs, ILL_ILLOPC, regs->nip);
 }
 
-void
-SingleStepException(struct pt_regs *regs)
+void SingleStepException(struct pt_regs *regs)
 {
 	regs->msr &= ~MSR_SE;  /* Turn off 'trace' bit */
 	if (debugger_sstep(regs))
@@ -522,8 +549,7 @@ SingleStepException(struct pt_regs *regs)
 	_exception(SIGTRAP, regs, TRAP_TRACE, 0);
 }
 
-void
-AlignmentException(struct pt_regs *regs)
+void AlignmentException(struct pt_regs *regs)
 {
 	int fixed;
 
@@ -543,8 +569,7 @@ AlignmentException(struct pt_regs *regs)
 	_exception(SIGBUS, regs, BUS_ADRALN, regs->dar);
 }
 
-void
-StackOverflow(struct pt_regs *regs)
+void StackOverflow(struct pt_regs *regs)
 {
 	printk(KERN_CRIT "Kernel stack overflow in process %p, r1=%lx\n",
 	       current, regs->gpr[1]);
@@ -561,8 +586,7 @@ void nonrecoverable_exception(struct pt_regs *regs)
 	die("nonrecoverable exception", regs, SIGKILL);
 }
 
-void
-trace_syscall(struct pt_regs *regs)
+void trace_syscall(struct pt_regs *regs)
 {
 	printk("Task: %p(%d), PC: %08lX/%08lX, Syscall: %3ld, Result: %s%ld    %s\n",
 	       current, current->pid, regs->nip, regs->link, regs->gpr[0],
@@ -570,8 +594,7 @@ trace_syscall(struct pt_regs *regs)
 }
 
 #ifdef CONFIG_8xx
-void
-SoftwareEmulation(struct pt_regs *regs)
+void SoftwareEmulation(struct pt_regs *regs)
 {
 	extern int do_mathemu(struct pt_regs *);
 	extern int Soft_emulate_8xx(struct pt_regs *);
@@ -623,8 +646,7 @@ void DebugException(struct pt_regs *regs, unsigned long debug_status)
 #endif /* CONFIG_4xx || CONFIG_BOOKE */
 
 #if !defined(CONFIG_TAU_INT)
-void
-TAUException(struct pt_regs *regs)
+void TAUException(struct pt_regs *regs)
 {
 	printk("TAU trap at PC: %lx, MSR: %lx, vector=%lx    %s\n",
 	       regs->nip, regs->msr, regs->trap, print_tainted());
@@ -646,14 +668,13 @@ void AltivecUnavailException(struct pt_regs *regs)
 	/* The kernel has executed an altivec instruction without
 	   first enabling altivec.  Whinge but let it do it. */
 	if (++kernel_altivec_count < 10)
-		printk(KERN_ERR "AltiVec used in kernel (task=%p, pc=%x)\n",
+		printk(KERN_ERR "AltiVec used in kernel (task=%p, pc=%lx)\n",
 		       current, regs->nip);
 	regs->msr |= MSR_VEC;
 }
 
 #ifdef CONFIG_ALTIVEC
-void
-AltivecAssistException(struct pt_regs *regs)
+void AltivecAssistException(struct pt_regs *regs)
 {
 	int err;
 
@@ -682,6 +703,55 @@ AltivecAssistException(struct pt_regs *regs)
 }
 #endif /* CONFIG_ALTIVEC */
 
+#ifdef CONFIG_FSL_BOOKE
+void CacheLockingException(struct pt_regs *regs, unsigned long address,
+			   unsigned long error_code)
+{
+	/* We treat cache locking instructions from the user
+	 * as priv ops, in the future we could try to do
+	 * something smarter
+	 */
+	if (error_code & (ESR_DLK|ESR_ILK))
+		_exception(SIGILL, regs, ILL_PRVOPC, regs->nip);
+	return;
+}
+#endif /* CONFIG_FSL_BOOKE */
+
+#ifdef CONFIG_SPE
+void SPEFloatingPointException(struct pt_regs *regs)
+{
+	unsigned long spefscr;
+	int fpexc_mode;
+	int code = 0;
+
+	spefscr = current->thread.spefscr;
+	fpexc_mode = current->thread.fpexc_mode;
+
+	/* Hardware does not neccessarily set sticky
+	 * underflow/overflow/invalid flags */
+	if ((spefscr & SPEFSCR_FOVF) && (fpexc_mode & PR_FP_EXC_OVF)) {
+		code = FPE_FLTOVF;
+		spefscr |= SPEFSCR_FOVFS;
+	}
+	else if ((spefscr & SPEFSCR_FUNF) && (fpexc_mode & PR_FP_EXC_UND)) {
+		code = FPE_FLTUND;
+		spefscr |= SPEFSCR_FUNFS;
+	}
+	else if ((spefscr & SPEFSCR_FDBZ) && (fpexc_mode & PR_FP_EXC_DIV))
+		code = FPE_FLTDIV;
+	else if ((spefscr & SPEFSCR_FINV) && (fpexc_mode & PR_FP_EXC_INV)) {
+		code = FPE_FLTINV;
+		spefscr |= SPEFSCR_FINVS;
+	}
+	else if ((spefscr & (SPEFSCR_FG | SPEFSCR_FX)) && (fpexc_mode & PR_FP_EXC_RES))
+		code = FPE_FLTRES;
+
+	current->thread.spefscr = spefscr;
+
+	_exception(SIGFPE, regs, code, regs->nip);
+	return;
+}
+#endif
 
 void __init trap_init(void)
 {
diff --git a/arch/ppc/kernel/vecemu.c b/arch/ppc/kernel/vecemu.c
index 1430ef592..604d0947c 100644
--- a/arch/ppc/kernel/vecemu.c
+++ b/arch/ppc/kernel/vecemu.c
@@ -256,14 +256,13 @@ static unsigned int rfin(unsigned int x)
 	return (x + half) & ~(0x7fffff >> exp);
 }
 
-int
-emulate_altivec(struct pt_regs *regs)
+int emulate_altivec(struct pt_regs *regs)
 {
 	unsigned int instr, i;
 	unsigned int va, vb, vc, vd;
 	vector128 *vrs;
 
-	if (get_user(instr, (unsigned int *) regs->nip))
+	if (get_user(instr, (unsigned int __user *) regs->nip))
 		return -EFAULT;
 	if ((instr >> 26) != 4)
 		return -EINVAL;		/* not an altivec instruction */
diff --git a/arch/ppc/kernel/vmlinux.lds.S b/arch/ppc/kernel/vmlinux.lds.S
index b710d55c5..342848fe5 100644
--- a/arch/ppc/kernel/vmlinux.lds.S
+++ b/arch/ppc/kernel/vmlinux.lds.S
@@ -1,6 +1,6 @@
 #include <asm-generic/vmlinux.lds.h>
 
-OUTPUT_ARCH(powerpc)
+OUTPUT_ARCH(powerpc:common)
 jiffies = jiffies_64 + 4;
 SECTIONS
 {
diff --git a/arch/ppc/lib/Makefile b/arch/ppc/lib/Makefile
index e88e3cfe6..1c380e67d 100644
--- a/arch/ppc/lib/Makefile
+++ b/arch/ppc/lib/Makefile
@@ -5,3 +5,5 @@
 obj-y			:= checksum.o string.o strcase.o dec_and_lock.o div64.o
 
 obj-$(CONFIG_SMP)	+= locks.o
+obj-$(CONFIG_8xx)	+= rheap.o
+obj-$(CONFIG_CPM2)	+= rheap.o
diff --git a/arch/ppc/lib/rheap.c b/arch/ppc/lib/rheap.c
index 4d938a062..103765660 100644
--- a/arch/ppc/lib/rheap.c
+++ b/arch/ppc/lib/rheap.c
@@ -254,11 +254,11 @@ rh_info_t *rh_create(unsigned int alignment)
 
 	/* Alignment must be a power of two */
 	if ((alignment & (alignment - 1)) != 0)
-		return NULL;
+		return ERR_PTR(-EINVAL);
 
 	info = kmalloc(sizeof(*info), GFP_KERNEL);
 	if (info == NULL)
-		return NULL;
+		return ERR_PTR(-ENOMEM);
 
 	info->alignment = alignment;
 
@@ -366,7 +366,7 @@ void *rh_detach_region(rh_info_t * info, void *start, int size)
 
 	/* Validate size */
 	if (size <= 0)
-		return NULL;
+		return ERR_PTR(-EINVAL);
 
 	/* The region must be aligned */
 	s = (unsigned long)start;
@@ -380,7 +380,7 @@ void *rh_detach_region(rh_info_t * info, void *start, int size)
 	e = e & ~m;
 
 	if (assure_empty(info, 1) < 0)
-		return NULL;
+		return ERR_PTR(-ENOMEM);
 
 	blk = NULL;
 	list_for_each(l, &info->free_list) {
@@ -394,7 +394,7 @@ void *rh_detach_region(rh_info_t * info, void *start, int size)
 	}
 
 	if (blk == NULL)
-		return NULL;
+		return ERR_PTR(-ENOMEM);
 
 	/* Perfect fit */
 	if (bs == s && be == e) {
@@ -434,13 +434,13 @@ void *rh_alloc(rh_info_t * info, int size, const char *owner)
 
 	/* Validate size */
 	if (size <= 0)
-		return NULL;
+		return ERR_PTR(-EINVAL);
 
 	/* Align to configured alignment */
 	size = (size + (info->alignment - 1)) & ~(info->alignment - 1);
 
 	if (assure_empty(info, 1) < 0)
-		return NULL;
+		return ERR_PTR(-ENOMEM);
 
 	blk = NULL;
 	list_for_each(l, &info->free_list) {
@@ -451,7 +451,7 @@ void *rh_alloc(rh_info_t * info, int size, const char *owner)
 	}
 
 	if (blk == NULL)
-		return NULL;
+		return ERR_PTR(-ENOMEM);
 
 	/* Just fits */
 	if (blk->size == size) {
@@ -490,7 +490,7 @@ void *rh_alloc_fixed(rh_info_t * info, void *start, int size, const char *owner)
 
 	/* Validate size */
 	if (size <= 0)
-		return NULL;
+		return ERR_PTR(-EINVAL);
 
 	/* The region must be aligned */
 	s = (unsigned long)start;
@@ -504,7 +504,7 @@ void *rh_alloc_fixed(rh_info_t * info, void *start, int size, const char *owner)
 	e = e & ~m;
 
 	if (assure_empty(info, 2) < 0)
-		return NULL;
+		return ERR_PTR(-ENOMEM);
 
 	blk = NULL;
 	list_for_each(l, &info->free_list) {
@@ -517,7 +517,7 @@ void *rh_alloc_fixed(rh_info_t * info, void *start, int size, const char *owner)
 	}
 
 	if (blk == NULL)
-		return NULL;
+		return ERR_PTR(-ENOMEM);
 
 	/* Perfect fit */
 	if (bs == s && be == e) {
diff --git a/arch/ppc/mm/44x_mmu.c b/arch/ppc/mm/44x_mmu.c
index b970dd51d..1d79838d9 100644
--- a/arch/ppc/mm/44x_mmu.c
+++ b/arch/ppc/mm/44x_mmu.c
@@ -93,10 +93,14 @@ ppc44x_pin_tlb(int slot, unsigned int virt, unsigned int phys)
 }
 
 /*
- * Configure PPC44x TLB for AS0 exception processing.
+ * MMU_init_hw does the chip-specific initialization of the MMU hardware.
  */
-static void __init
-ppc44x_tlb_config(void)
+void __init MMU_init_hw(void)
+{
+	flush_instruction_cache();
+}
+
+unsigned long __init mmu_mapin_ram(void)
 {
 	unsigned int pinned_tlbs = 1;
 	int i;
@@ -124,39 +128,6 @@ ppc44x_tlb_config(void)
 			unsigned int phys_addr = (PPC44x_LOW_SLOT-i) * PPC44x_PIN_SIZE;
 			ppc44x_pin_tlb(i, phys_addr+PAGE_OFFSET, phys_addr);
 		}
-}
-
-/*
- * MMU_init_hw does the chip-specific initialization of the MMU hardware.
- */
-void __init MMU_init_hw(void)
-{
-	flush_instruction_cache();
-
-	ppc44x_tlb_config();
-}
-
-/* TODO: Add large page lowmem mapping support */
-unsigned long __init mmu_mapin_ram(void)
-{
-	unsigned long v, s, f = _PAGE_GUARDED;
-	phys_addr_t p;
-
-	v = KERNELBASE;
-	p = PPC_MEMSTART;
-
-	for (s = 0; s < total_lowmem; s += PAGE_SIZE) {
-		if ((char *) v >= _stext && (char *) v < etext)
-			f |= _PAGE_RAM_TEXT;
-		else
-			f |= _PAGE_RAM;
-		map_page(v, p, f);
-		v += PAGE_SIZE;
-		p += PAGE_SIZE;
-	}
-
-	if (ppc_md.progress)
-		ppc_md.progress("MMU:mmu_mapin_ram done", 0x401);
 
-	return s;
+	return total_lowmem;
 }
diff --git a/arch/ppc/mm/Makefile b/arch/ppc/mm/Makefile
index 038260878..cd3eae147 100644
--- a/arch/ppc/mm/Makefile
+++ b/arch/ppc/mm/Makefile
@@ -2,13 +2,10 @@
 # Makefile for the linux ppc-specific parts of the memory manager.
 #
 
-ifdef CONFIG_PPC64BRIDGE
-EXTRA_AFLAGS		:= -Wa,-mppc64bridge
-endif
-
 obj-y				:= fault.o init.o mem_pieces.o \
 					mmu_context.o pgtable.o
 
 obj-$(CONFIG_PPC_STD_MMU)	+= hashtable.o ppc_mmu.o tlb.o
 obj-$(CONFIG_40x)		+= 4xx_mmu.o
 obj-$(CONFIG_44x)		+= 44x_mmu.o
+obj-$(CONFIG_FSL_BOOKE)		+= fsl_booke_mmu.o
diff --git a/arch/ppc/mm/fault.c b/arch/ppc/mm/fault.c
index 7a280f9da..57d993084 100644
--- a/arch/ppc/mm/fault.c
+++ b/arch/ppc/mm/fault.c
@@ -59,7 +59,7 @@ static int store_updates_sp(struct pt_regs *regs)
 {
 	unsigned int inst;
 
-	if (get_user(inst, (unsigned int *)regs->nip))
+	if (get_user(inst, (unsigned int __user *)regs->nip))
 		return 0;
 	/* check for 1 in the rA field */
 	if (((inst >> 16) & 0x1f) != 1)
@@ -99,7 +99,7 @@ int do_page_fault(struct pt_regs *regs, unsigned long address,
 	struct mm_struct *mm = current->mm;
 	siginfo_t info;
 	int code = SEGV_MAPERR;
-#if defined(CONFIG_4xx)
+#if defined(CONFIG_4xx) || defined (CONFIG_BOOKE)
 	int is_write = error_code & ESR_DST;
 #else
 	int is_write = 0;
@@ -114,20 +114,20 @@ int do_page_fault(struct pt_regs *regs, unsigned long address,
 		error_code &= 0x48200000;
 	else
 		is_write = error_code & 0x02000000;
-#endif /* CONFIG_4xx */
+#endif /* CONFIG_4xx || CONFIG_BOOKE */
 
 #if defined(CONFIG_XMON) || defined(CONFIG_KGDB)
 	if (debugger_fault_handler && TRAP(regs) == 0x300) {
 		debugger_fault_handler(regs);
 		return 0;
 	}
-#if !defined(CONFIG_4xx)
+#if !(defined(CONFIG_4xx) || defined(CONFIG_BOOKE))
 	if (error_code & 0x00400000) {
 		/* DABR match */
 		if (debugger_dabr_match(regs))
 			return 0;
 	}
-#endif /* !CONFIG_4xx */
+#endif /* !(CONFIG_4xx || CONFIG_BOOKE)*/
 #endif /* CONFIG_XMON || CONFIG_KGDB */
 
 	if (in_atomic() || mm == NULL)
@@ -200,8 +200,8 @@ good_area:
 	if (is_write) {
 		if (!(vma->vm_flags & VM_WRITE))
 			goto bad_area;
-#if defined(CONFIG_4xx)
-	/* an exec  - 4xx allows for per-page execute permission */
+#if defined(CONFIG_4xx) || defined(CONFIG_BOOKE)
+	/* an exec  - 4xx/Book-E allows for per-page execute permission */
 	} else if (TRAP(regs) == 0x400) {
 		pte_t *ptep;
 
@@ -214,7 +214,7 @@ good_area:
 			goto bad_area;
 #endif
 
-		/* Since 4xx supports per-page execute permission,
+		/* Since 4xx/Book-E supports per-page execute permission,
 		 * we lazily flush dcache to icache. */
 		ptep = NULL;
 		if (get_pteptr(mm, address, &ptep) && pte_present(*ptep)) {
@@ -281,7 +281,7 @@ bad_area:
 		info.si_signo = SIGSEGV;
 		info.si_errno = 0;
 		info.si_code = code;
-		info.si_addr = (void *) address;
+		info.si_addr = (void __user *) address;
 		force_sig_info(SIGSEGV, &info, current);
 		return 0;
 	}
@@ -309,7 +309,7 @@ do_sigbus:
 	info.si_signo = SIGBUS;
 	info.si_errno = 0;
 	info.si_code = BUS_ADRERR;
-	info.si_addr = (void *)address;
+	info.si_addr = (void __user *)address;
 	force_sig_info (SIGBUS, &info, current);
 	if (!user_mode(regs))
 		return SIGBUS;
diff --git a/arch/ppc/mm/init.c b/arch/ppc/mm/init.c
index 4628e26ab..448e80c11 100644
--- a/arch/ppc/mm/init.c
+++ b/arch/ppc/mm/init.c
@@ -118,7 +118,7 @@ void show_mem(void)
 
 	printk("Mem-info:\n");
 	show_free_areas();
-	printk("Free swap:       %6dkB\n",nr_swap_pages<<(PAGE_SHIFT-10));
+	printk("Free swap:       %6ldkB\n", nr_swap_pages<<(PAGE_SHIFT-10));
 	i = max_mapnr;
 	while (i-- > 0) {
 		total++;
@@ -253,6 +253,12 @@ void __init MMU_init(void)
 	if (__max_memory && total_memory > __max_memory)
 		total_memory = __max_memory;
 	total_lowmem = total_memory;
+#ifdef CONFIG_FSL_BOOKE
+	/* Freescale Book-E parts expect lowmem to be mapped by fixed TLB
+	 * entries, so we need to adjust lowmem to match the amount we can map
+	 * in the fixed entries */
+	adjust_total_lowmem();
+#endif /* CONFIG_FSL_BOOKE */
 	if (total_lowmem > __max_low_memory) {
 		total_lowmem = __max_low_memory;
 #ifndef CONFIG_HIGHMEM
diff --git a/arch/ppc/mm/mmu_decl.h b/arch/ppc/mm/mmu_decl.h
index 5f8b04538..4699d6f64 100644
--- a/arch/ppc/mm/mmu_decl.h
+++ b/arch/ppc/mm/mmu_decl.h
@@ -27,6 +27,9 @@ extern int map_page(unsigned long va, phys_addr_t 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 void settlbcam(int index, unsigned long virt, phys_addr_t phys,
+		      unsigned int size, int flags, unsigned int pid);
+extern void invalidate_tlbcam_entry(int index);
 
 extern int __map_without_bats;
 extern unsigned long ioremap_base;
@@ -53,6 +56,12 @@ extern unsigned long Hash_size, Hash_mask;
 extern void MMU_init_hw(void);
 extern unsigned long mmu_mapin_ram(void);
 
+#elif defined(CONFIG_FSL_BOOKE)
+#define flush_HPTE(X, va, pg)	_tlbie(va)
+extern void MMU_init_hw(void);
+extern unsigned long mmu_mapin_ram(void);
+extern void adjust_total_lowmem(void);
+
 #else
 /* anything except 4xx or 8xx */
 extern void MMU_init_hw(void);
diff --git a/arch/ppc/mm/pgtable.c b/arch/ppc/mm/pgtable.c
index 04c148127..c16d4cce4 100644
--- a/arch/ppc/mm/pgtable.c
+++ b/arch/ppc/mm/pgtable.c
@@ -42,6 +42,10 @@ int io_bat_index;
 #define HAVE_BATS	1
 #endif
 
+#if defined(CONFIG_FSL_BOOKE)
+#define HAVE_TLBCAM	1
+#endif
+
 extern char etext[], _stext[];
 
 #ifdef CONFIG_SMP
@@ -59,6 +63,16 @@ void setbat(int index, unsigned long virt, unsigned long phys,
 #define p_mapped_by_bats(x)	(0UL)
 #endif /* HAVE_BATS */
 
+#ifdef HAVE_TLBCAM
+extern unsigned int tlbcam_index;
+extern unsigned int num_tlbcam_entries;
+extern unsigned long v_mapped_by_tlbcam(unsigned long va);
+extern unsigned long p_mapped_by_tlbcam(unsigned long pa);
+#else /* !HAVE_TLBCAM */
+#define v_mapped_by_tlbcam(x)	(0UL)
+#define p_mapped_by_tlbcam(x)	(0UL)
+#endif /* HAVE_TLBCAM */
+
 #ifdef CONFIG_44x
 /* 44x uses an 8kB pgdir because it has 8-byte Linux PTEs. */
 #define PGDIR_ORDER	1
@@ -210,6 +224,9 @@ __ioremap(phys_addr_t addr, unsigned long size, unsigned long flags)
 	if ((v = p_mapped_by_bats(p)) /*&& p_mapped_by_bats(p+size-1)*/ )
 		goto out;
 
+	if ((v = p_mapped_by_tlbcam(p)))
+		goto out;
+
 	if (mem_init_done) {
 		struct vm_struct *area;
 		area = get_vm_area(size, VM_IOREMAP);
@@ -300,6 +317,9 @@ void __init mapin_ram(void)
 /* is x a power of 2? */
 #define is_power_of_2(x)	((x) != 0 && (((x) & ((x) - 1)) == 0))
 
+/* is x a power of 4? */
+#define is_power_of_4(x)	((x) != 0 && (((x) & (x-1)) == 0) && (ffs(x) & 1))
+
 /*
  * Set up a mapping for a block of I/O.
  * virt, phys, size must all be page-aligned.
@@ -325,6 +345,18 @@ void __init io_block_mapping(unsigned long virt, phys_addr_t phys,
 	}
 #endif /* HAVE_BATS */
 
+#ifdef HAVE_TLBCAM
+	/*
+	 * Use a CAM for this if possible...
+	 */
+	if (tlbcam_index < num_tlbcam_entries && is_power_of_4(size)
+	    && (virt & (size - 1)) == 0 && (phys & (size - 1)) == 0) {
+		settlbcam(tlbcam_index, virt, phys, size, flags, 0);
+		++tlbcam_index;
+		return;
+	}
+#endif /* HAVE_TLBCAM */
+
 	/* No BATs available, put it in the page tables. */
 	for (i = 0; i < size; i += PAGE_SIZE)
 		map_page(virt + i, phys + i, flags);
diff --git a/arch/ppc/platforms/4xx/Kconfig b/arch/ppc/platforms/4xx/Kconfig
index b439b155c..578b0ac9c 100644
--- a/arch/ppc/platforms/4xx/Kconfig
+++ b/arch/ppc/platforms/4xx/Kconfig
@@ -175,6 +175,15 @@ config IBM_OPENBIOS
 	depends on ASH || BUBINGA || REDWOOD_5 || REDWOOD_6 || SYCAMORE || WALNUT
 	default y
 
+config PPC4xx_DMA
+	bool "PPC4xx DMA controller support"
+	depends on 4xx
+
+config PPC4xx_EDMA
+	bool
+	depends on !STB03xxx && PPC4xx_DMA
+	default y
+
 config PM
 	bool "Power Management support (EXPERIMENTAL)"
 	depends on 4xx && EXPERIMENTAL
diff --git a/arch/ppc/platforms/4xx/ebony.h b/arch/ppc/platforms/4xx/ebony.h
index 749fff956..c4352e6bb 100755
--- a/arch/ppc/platforms/4xx/ebony.h
+++ b/arch/ppc/platforms/4xx/ebony.h
@@ -64,7 +64,8 @@
 #define UART0_IO_BASE	(u8 *) 0xE0000200
 #define UART1_IO_BASE	(u8 *) 0xE0000300
 
-#define BASE_BAUD	33000000/3/16
+/* external Epson SG-615P */
+#define BASE_BAUD	691200
 
 #define STD_UART_OP(num)					\
 	{ 0, BASE_BAUD, 0, UART##num##_INT,			\
diff --git a/arch/ppc/platforms/4xx/redwood5.c b/arch/ppc/platforms/4xx/redwood5.c
index 85f0a0f82..2f5e410af 100644
--- a/arch/ppc/platforms/4xx/redwood5.c
+++ b/arch/ppc/platforms/4xx/redwood5.c
@@ -14,9 +14,41 @@
 #include <linux/config.h>
 #include <linux/init.h>
 #include <linux/pagemap.h>
+#include <linux/device.h>
+#include <linux/ioport.h>
 #include <asm/io.h>
 #include <asm/machdep.h>
 
+static struct resource smc91x_resources[] = {
+	[0] = {
+		.start	= SMC91111_BASE_ADDR,
+		.end	= SMC91111_BASE_ADDR + SMC91111_REG_SIZE - 1,
+		.flags	= IORESOURCE_MEM,
+	},
+	[1] = {
+		.start	= SMC91111_IRQ,
+		.end	= SMC91111_IRQ,
+		.flags	= IORESOURCE_IRQ,
+	},
+};
+
+static struct platform_device smc91x_device = {
+	.name		= "smc91x",
+	.id		= 0,
+	.num_resources	= ARRAY_SIZE(smc91x_resources),
+	.resource	= smc91x_resources,
+};
+
+static struct platform_device *redwood5_devs[] __initdata = {
+	&smc91x_device,
+};
+
+static int __init
+redwood5_platform_add_devices(void)
+{
+	return platform_add_devices(redwood5_devs, ARRAY_SIZE(redwood5_devs));
+}
+
 void __init
 redwood5_setup_arch(void)
 {
@@ -44,7 +76,7 @@ redwood5_setup_arch(void)
 
 	printk("\n");
 #endif
-
+	device_initcall(redwood5_platform_add_devices);
 }
 
 void __init
diff --git a/arch/ppc/platforms/4xx/redwood5.h b/arch/ppc/platforms/4xx/redwood5.h
index 91b761635..264e34fb3 100644
--- a/arch/ppc/platforms/4xx/redwood5.h
+++ b/arch/ppc/platforms/4xx/redwood5.h
@@ -34,6 +34,7 @@ typedef struct board_info {
 
 
 #define SMC91111_BASE_ADDR	0xf2000300
+#define SMC91111_REG_SIZE	16
 #define SMC91111_IRQ		28
 
 #ifdef MAX_HWIFS
diff --git a/arch/ppc/platforms/4xx/redwood6.c b/arch/ppc/platforms/4xx/redwood6.c
index 02a8b80d8..b8a5d541f 100644
--- a/arch/ppc/platforms/4xx/redwood6.c
+++ b/arch/ppc/platforms/4xx/redwood6.c
@@ -12,6 +12,8 @@
 #include <linux/config.h>
 #include <linux/init.h>
 #include <linux/pagemap.h>
+#include <linux/device.h>
+#include <linux/ioport.h>
 #include <asm/io.h>
 #include <asm/ppc4xx_pic.h>
 #include <linux/delay.h>
@@ -57,6 +59,36 @@ static u_char redwood6_IRQ_initsenses[] __initdata = {
 	(IRQ_SENSE_LEVEL | IRQ_POLARITY_NEGATIVE),	/* 31: Ext Int 6 */
 };
 
+static struct resource smc91x_resources[] = {
+	[0] = {
+		.start	= SMC91111_BASE_ADDR,
+		.end	= SMC91111_BASE_ADDR + SMC91111_REG_SIZE - 1,
+		.flags	= IORESOURCE_MEM,
+	},
+	[1] = {
+		.start	= SMC91111_IRQ,
+		.end	= SMC91111_IRQ,
+		.flags	= IORESOURCE_IRQ,
+	},
+};
+
+static struct platform_device smc91x_device = {
+	.name		= "smc91x",
+	.id		= 0,
+	.num_resources	= ARRAY_SIZE(smc91x_resources),
+	.resource	= smc91x_resources,
+};
+
+static struct platform_device *redwood6_devs[] __initdata = {
+	&smc91x_device,
+};
+
+static int __init
+redwood6_platform_add_devices(void)
+{
+	return platform_add_devices(redwood6_devs, ARRAY_SIZE(redwood6_devs));
+}
+
 
 void __init
 redwood6_setup_arch(void)
@@ -119,6 +151,8 @@ redwood6_setup_arch(void)
 	printk(KERN_INFO "IBM Redwood6 (STBx25XX) Platform\n");
 	printk(KERN_INFO
 	       "Port by MontaVista Software, Inc. (source@mvista.com)\n");
+
+	device_initcall(redwood6_platform_add_devices);
 }
 
 void __init
diff --git a/arch/ppc/platforms/4xx/redwood6.h b/arch/ppc/platforms/4xx/redwood6.h
index bbb611224..1814b9f5f 100755
--- a/arch/ppc/platforms/4xx/redwood6.h
+++ b/arch/ppc/platforms/4xx/redwood6.h
@@ -33,6 +33,7 @@ typedef struct board_info {
 #endif				/* !__ASSEMBLY__ */
 
 #define SMC91111_BASE_ADDR	0xf2030300
+#define SMC91111_REG_SIZE	16
 #define SMC91111_IRQ		27
 #define IDE_XLINUX_MUX_BASE        0xf2040000
 #define IDE_DMA_ADDR	0xfce00000
diff --git a/arch/ppc/platforms/85xx/Kconfig b/arch/ppc/platforms/85xx/Kconfig
index cfe29eb04..e4666df37 100644
--- a/arch/ppc/platforms/85xx/Kconfig
+++ b/arch/ppc/platforms/85xx/Kconfig
@@ -17,10 +17,26 @@ choice
 	default MPC8540_ADS
 
 config MPC8540_ADS
-	bool "MPC8540ADS"
+	bool "Freescale MPC8540 ADS"
 	help
 	  This option enables support for the MPC 8540 ADS evaluation board.
 
+config MPC8555_CDS
+	bool "Freescale MPC8555 CDS"
+	help
+	  This option enablese support for the MPC8555 CDS evaluation board.
+
+config MPC8560_ADS
+	bool "Freescale MPC8560 ADS"
+	help
+	  This option enables support for the MPC 8560 ADS evaluation board.
+
+config SBC8560
+	bool "WindRiver PowerQUICC III SBC8560"
+	help
+	  This option enables support for the WindRiver PowerQUICC III 
+	  SBC8560 board.
+
 endchoice
 
 # It's often necessary to know the specific 85xx processor type.
@@ -31,6 +47,21 @@ config MPC8540
 	depends on MPC8540_ADS
 	default y
 
+config MPC8555
+	bool
+	depends on MPC8555_CDS
+	default y
+
+config MPC8560
+	bool
+	depends on SBC8560 || MPC8560_ADS
+	default y
+
+config 85xx_PCI2
+	bool "Supprt for 2nd PCI host controller"
+	depends on MPC8555_CDS
+	default y
+
 config FSL_OCP
 	bool
 	depends on 85xx
@@ -38,7 +69,7 @@ config FSL_OCP
 
 config PPC_GEN550
 	bool
-	depends on MPC8540
+	depends on MPC8540 || SBC8560 || MPC8555
 	default y
 
 endmenu
diff --git a/arch/ppc/platforms/85xx/Makefile b/arch/ppc/platforms/85xx/Makefile
index 92a88233f..673b970f1 100644
--- a/arch/ppc/platforms/85xx/Makefile
+++ b/arch/ppc/platforms/85xx/Makefile
@@ -3,5 +3,10 @@
 #
 
 obj-$(CONFIG_MPC8540_ADS)	+= mpc85xx_ads_common.o mpc8540_ads.o
+obj-$(CONFIG_MPC8555_CDS)	+= mpc85xx_cds_common.o
+obj-$(CONFIG_MPC8560_ADS)	+= mpc85xx_ads_common.o mpc8560_ads.o
+obj-$(CONFIG_SBC8560)		+= sbc85xx.o sbc8560.o
 
 obj-$(CONFIG_MPC8540)		+= mpc8540.o
+obj-$(CONFIG_MPC8555)		+= mpc8555.o
+obj-$(CONFIG_MPC8560)		+= mpc8560.o
diff --git a/arch/ppc/platforms/85xx/mpc8540_ads.c b/arch/ppc/platforms/85xx/mpc8540_ads.c
index aada593a6..aada7e456 100644
--- a/arch/ppc/platforms/85xx/mpc8540_ads.c
+++ b/arch/ppc/platforms/85xx/mpc8540_ads.c
@@ -30,6 +30,7 @@
 #include <linux/serial.h>
 #include <linux/tty.h>	/* for linux/serial_core.h */
 #include <linux/serial_core.h>
+#include <linux/initrd.h>
 #include <linux/module.h>
 
 #include <asm/system.h>
diff --git a/arch/ppc/platforms/85xx/mpc8540_ads.h b/arch/ppc/platforms/85xx/mpc8540_ads.h
index 9056361f7..0d602fc1f 100644
--- a/arch/ppc/platforms/85xx/mpc8540_ads.h
+++ b/arch/ppc/platforms/85xx/mpc8540_ads.h
@@ -18,7 +18,6 @@
 #define __MACH_MPC8540ADS_H__
 
 #include <linux/config.h>
-#include <linux/serial.h>
 #include <linux/initrd.h>
 #include <syslib/ppc85xx_setup.h>
 #include <platforms/85xx/mpc85xx_ads_common.h>
diff --git a/arch/ppc/platforms/85xx/sbc8560.c b/arch/ppc/platforms/85xx/sbc8560.c
index c32d662fe..a4a91aa6a 100644
--- a/arch/ppc/platforms/85xx/sbc8560.c
+++ b/arch/ppc/platforms/85xx/sbc8560.c
@@ -30,6 +30,7 @@
 #include <linux/serial.h>
 #include <linux/tty.h>	/* for linux/serial_core.h */
 #include <linux/serial_core.h>
+#include <linux/initrd.h>
 #include <linux/module.h>
 
 #include <asm/system.h>
@@ -92,6 +93,7 @@ sbc8560_early_serial_map(void)
         uart_req.iotype = SERIAL_IO_MEM;
         uart_req.mapbase = UARTA_ADDR;
         uart_req.membase = ioremap(uart_req.mapbase, MPC85xx_UART0_SIZE);
+	uart_req.type = PORT_16650;
 
 #if defined(CONFIG_SERIAL_TEXT_DEBUG) || defined(CONFIG_KGDB)
         gen550_init(0, &uart_req);
diff --git a/arch/ppc/platforms/85xx/sbc8560.h b/arch/ppc/platforms/85xx/sbc8560.h
index 5c86187f8..5e1b00c77 100644
--- a/arch/ppc/platforms/85xx/sbc8560.h
+++ b/arch/ppc/platforms/85xx/sbc8560.h
@@ -16,8 +16,9 @@
 #define __MACH_SBC8560_H__
  
 #include <linux/config.h>
-#include <linux/serial.h>
 #include <platforms/85xx/sbc85xx.h>
+
+#define CPM_MAP_ADDR    (CCSRBAR + MPC85xx_CPM_OFFSET)
  
 #ifdef CONFIG_SERIAL_MANY_PORTS
 #define RS_TABLE_SIZE  64
@@ -29,11 +30,11 @@
 #define BASE_BAUD ( 1843200 / 16 )
  
 #ifdef CONFIG_SERIAL_DETECT_IRQ
-#define STD_COM_FLAGS (ASYNC_BOOT_AUTOCONF|ASYNC_SKIP_TEST|ASYNC_AUTO_IRQ)
+#define STD_COM_FLAGS (ASYNC_SKIP_TEST|ASYNC_AUTO_IRQ)
 #else
-#define STD_COM_FLAGS (ASYNC_BOOT_AUTOCONF|ASYNC_SKIP_TEST)
+#define STD_COM_FLAGS (ASYNC_SKIP_TEST)
 #endif
- 
+
 #define STD_SERIAL_PORT_DFNS \
         { 0, BASE_BAUD, UARTA_ADDR, MPC85xx_IRQ_EXT9, STD_COM_FLAGS, /* ttyS0 */ \
                 iomem_base: (u8 *)UARTA_ADDR,                       \
diff --git a/arch/ppc/platforms/85xx/sbc85xx.c b/arch/ppc/platforms/85xx/sbc85xx.c
index a7a33fdff..8cc3323a6 100644
--- a/arch/ppc/platforms/85xx/sbc85xx.c
+++ b/arch/ppc/platforms/85xx/sbc85xx.c
@@ -61,38 +61,38 @@ extern unsigned long total_memory;	/* in mm/init */
 /* Internal interrupts are all Level Sensitive, and Positive Polarity */
 
 static u_char sbc8560_openpic_initsenses[] __initdata = {
-	(IRQ_POLARITY_POSITIVE),	/* Internal  0: L2 Cache */
-	(IRQ_POLARITY_POSITIVE),	/* Internal  1: ECM */
-	(IRQ_POLARITY_POSITIVE),	/* Internal  2: DDR DRAM */
-	(IRQ_POLARITY_POSITIVE),	/* Internal  3: LBIU */
-	(IRQ_POLARITY_POSITIVE),	/* Internal  4: DMA 0 */
-	(IRQ_POLARITY_POSITIVE),	/* Internal  5: DMA 1 */
-	(IRQ_POLARITY_POSITIVE),	/* Internal  6: DMA 2 */
-	(IRQ_POLARITY_POSITIVE),	/* Internal  7: DMA 3 */
-	(IRQ_POLARITY_POSITIVE),	/* Internal  8: PCI/PCI-X */
-	(IRQ_POLARITY_POSITIVE),	/* Internal  9: RIO Inbound Port Write Error */
-	(IRQ_POLARITY_POSITIVE),	/* Internal 10: RIO Doorbell Inbound */
-	(IRQ_POLARITY_POSITIVE),	/* Internal 11: RIO Outbound Message */
-	(IRQ_POLARITY_POSITIVE),	/* Internal 12: RIO Inbound Message */
-	(IRQ_POLARITY_POSITIVE),	/* Internal 13: TSEC 0 Transmit */
-	(IRQ_POLARITY_POSITIVE),	/* Internal 14: TSEC 0 Receive */
-	(IRQ_POLARITY_POSITIVE),	/* Internal 15: Unused */
-	(IRQ_POLARITY_POSITIVE),	/* Internal 16: Unused */
-	(IRQ_POLARITY_POSITIVE),	/* Internal 17: Unused */
-	(IRQ_POLARITY_POSITIVE),	/* Internal 18: TSEC 0 Receive/Transmit Error */
-	(IRQ_POLARITY_POSITIVE),	/* Internal 19: TSEC 1 Transmit */
-	(IRQ_POLARITY_POSITIVE),	/* Internal 20: TSEC 1 Receive */
-	(IRQ_POLARITY_POSITIVE),	/* Internal 21: Unused */
-	(IRQ_POLARITY_POSITIVE),	/* Internal 22: Unused */
-	(IRQ_POLARITY_POSITIVE),	/* Internal 23: Unused */
-	(IRQ_POLARITY_POSITIVE),	/* Internal 24: TSEC 1 Receive/Transmit Error */
-	(IRQ_POLARITY_POSITIVE),	/* Internal 25: Fast Ethernet */
-	(IRQ_POLARITY_POSITIVE),	/* Internal 26: DUART */
-	(IRQ_POLARITY_POSITIVE),	/* Internal 27: I2C */
-	(IRQ_POLARITY_POSITIVE),	/* Internal 28: Performance Monitor */
-	(IRQ_POLARITY_POSITIVE),	/* Internal 29: Unused */
-	(IRQ_POLARITY_POSITIVE),	/* Internal 30: CPM */
-	(IRQ_POLARITY_POSITIVE),	/* Internal 31: Unused */
+	(IRQ_SENSE_LEVEL | IRQ_POLARITY_POSITIVE),	/* Internal  0: L2 Cache */
+	(IRQ_SENSE_LEVEL | IRQ_POLARITY_POSITIVE),	/* Internal  1: ECM */
+	(IRQ_SENSE_LEVEL | IRQ_POLARITY_POSITIVE),	/* Internal  2: DDR DRAM */
+	(IRQ_SENSE_LEVEL | IRQ_POLARITY_POSITIVE),	/* Internal  3: LBIU */
+	(IRQ_SENSE_LEVEL | IRQ_POLARITY_POSITIVE),	/* Internal  4: DMA 0 */
+	(IRQ_SENSE_LEVEL | IRQ_POLARITY_POSITIVE),	/* Internal  5: DMA 1 */
+	(IRQ_SENSE_LEVEL | IRQ_POLARITY_POSITIVE),	/* Internal  6: DMA 2 */
+	(IRQ_SENSE_LEVEL | IRQ_POLARITY_POSITIVE),	/* Internal  7: DMA 3 */
+	(IRQ_SENSE_LEVEL | IRQ_POLARITY_POSITIVE),	/* Internal  8: PCI/PCI-X */
+	(IRQ_SENSE_LEVEL | IRQ_POLARITY_POSITIVE),	/* Internal  9: RIO Inbound Port Write Error */
+	(IRQ_SENSE_LEVEL | IRQ_POLARITY_POSITIVE),	/* Internal 10: RIO Doorbell Inbound */
+	(IRQ_SENSE_LEVEL | IRQ_POLARITY_POSITIVE),	/* Internal 11: RIO Outbound Message */
+	(IRQ_SENSE_LEVEL | IRQ_POLARITY_POSITIVE),	/* Internal 12: RIO Inbound Message */
+	(IRQ_SENSE_LEVEL | IRQ_POLARITY_POSITIVE),	/* Internal 13: TSEC 0 Transmit */
+	(IRQ_SENSE_LEVEL | IRQ_POLARITY_POSITIVE),	/* Internal 14: TSEC 0 Receive */
+	(IRQ_SENSE_LEVEL | IRQ_POLARITY_POSITIVE),	/* Internal 15: Unused */
+	(IRQ_SENSE_LEVEL | IRQ_POLARITY_POSITIVE),	/* Internal 16: Unused */
+	(IRQ_SENSE_LEVEL | IRQ_POLARITY_POSITIVE),	/* Internal 17: Unused */
+	(IRQ_SENSE_LEVEL | IRQ_POLARITY_POSITIVE),	/* Internal 18: TSEC 0 Receive/Transmit Error */
+	(IRQ_SENSE_LEVEL | IRQ_POLARITY_POSITIVE),	/* Internal 19: TSEC 1 Transmit */
+	(IRQ_SENSE_LEVEL | IRQ_POLARITY_POSITIVE),	/* Internal 20: TSEC 1 Receive */
+	(IRQ_SENSE_LEVEL | IRQ_POLARITY_POSITIVE),	/* Internal 21: Unused */
+	(IRQ_SENSE_LEVEL | IRQ_POLARITY_POSITIVE),	/* Internal 22: Unused */
+	(IRQ_SENSE_LEVEL | IRQ_POLARITY_POSITIVE),	/* Internal 23: Unused */
+	(IRQ_SENSE_LEVEL | IRQ_POLARITY_POSITIVE),	/* Internal 24: TSEC 1 Receive/Transmit Error */
+	(IRQ_SENSE_LEVEL | IRQ_POLARITY_POSITIVE),	/* Internal 25: Fast Ethernet */
+	(IRQ_SENSE_LEVEL | IRQ_POLARITY_POSITIVE),	/* Internal 26: DUART */
+	(IRQ_SENSE_LEVEL | IRQ_POLARITY_POSITIVE),	/* Internal 27: I2C */
+	(IRQ_SENSE_LEVEL | IRQ_POLARITY_POSITIVE),	/* Internal 28: Performance Monitor */
+	(IRQ_SENSE_LEVEL | IRQ_POLARITY_POSITIVE),	/* Internal 29: Unused */
+	(IRQ_SENSE_LEVEL | IRQ_POLARITY_POSITIVE),	/* Internal 30: CPM */
+	(IRQ_SENSE_LEVEL | IRQ_POLARITY_POSITIVE),	/* Internal 31: Unused */
 	0x0,				/* External  0: */
 	0x0,				/* External  1: */
 #if defined(CONFIG_PCI)
diff --git a/arch/ppc/platforms/Makefile b/arch/ppc/platforms/Makefile
index 6f0c42645..c59d4871d 100644
--- a/arch/ppc/platforms/Makefile
+++ b/arch/ppc/platforms/Makefile
@@ -2,13 +2,6 @@
 # Makefile for the linux kernel.
 #
 
-ifdef CONFIG_PPC64BRIDGE
-EXTRA_AFLAGS		:= -Wa,-mppc64bridge
-endif
-ifdef CONFIG_40x
-EXTRA_AFLAGS		:= -Wa,-m405
-endif
-
 # Extra CFLAGS so we don't have to do relative includes
 CFLAGS_pmac_setup.o	+= -Iarch/$(ARCH)/mm
 
@@ -26,10 +19,10 @@ obj-$(CONFIG_NVRAM)		+= pmac_nvram.o
 obj-$(CONFIG_CPU_FREQ_PMAC)	+= pmac_cpufreq.o
 endif
 obj-$(CONFIG_PMAC_BACKLIGHT)	+= pmac_backlight.o
-obj-$(CONFIG_PPC_RTAS)		+= error_log.o proc_rtas.o
 obj-$(CONFIG_PREP_RESIDUAL)	+= residual.o
 obj-$(CONFIG_ADIR)		+= adir_setup.o adir_pic.o adir_pci.o
 obj-$(CONFIG_EST8260)		+= est8260_setup.o
+obj-$(CONFIG_PQ2ADS)		+= pq2ads_setup.o
 obj-$(CONFIG_TQM8260)		+= tqm8260_setup.o
 obj-$(CONFIG_EV64260)		+= ev64260_setup.o
 obj-$(CONFIG_GEMINI)		+= gemini_pci.o gemini_setup.o gemini_prom.o
@@ -44,9 +37,11 @@ obj-$(CONFIG_POWERPMC250)	+= powerpmc250.o
 obj-$(CONFIG_PPLUS)		+= pplus.o
 obj-$(CONFIG_PRPMC750)		+= prpmc750.o
 obj-$(CONFIG_PRPMC800)		+= prpmc800.o
+obj-$(CONFIG_RPX8260)		+= rpx8260.o
 obj-$(CONFIG_SANDPOINT)		+= sandpoint.o
 obj-$(CONFIG_SBC82xx)		+= sbc82xx.o
 obj-$(CONFIG_SPRUCE)		+= spruce.o
+obj-$(CONFIG_LITE5200)		+= lite5200.o mpc5200.o
 
 ifeq ($(CONFIG_SMP),y)
 obj-$(CONFIG_PPC_PMAC)		+= pmac_smp.o
diff --git a/arch/ppc/platforms/est8260.h b/arch/ppc/platforms/est8260.h
index 14a9c0256..bc51f072a 100644
--- a/arch/ppc/platforms/est8260.h
+++ b/arch/ppc/platforms/est8260.h
@@ -6,7 +6,7 @@
 #ifndef __EST8260_PLATFORM
 #define __EST8260_PLATFORM
 
-#define IMAP_ADDR		((uint)0xf0000000)
+#define CPM_MAP_ADDR		((uint)0xf0000000)
 
 #define BOOTROM_RESTART_ADDR	((uint)0xff000104)
 
diff --git a/arch/ppc/platforms/lopec_setup.c b/arch/ppc/platforms/lopec_setup.c
index c231f67d7..8e98f2607 100644
--- a/arch/ppc/platforms/lopec_setup.c
+++ b/arch/ppc/platforms/lopec_setup.c
@@ -33,7 +33,6 @@
 #include <asm/hw_irq.h>
 #include <asm/prep_nvram.h>
 
-extern char saved_command_line[];
 extern void lopec_find_bridges(void);
 
 /*
@@ -193,21 +192,8 @@ lopec_init_IRQ(void)
 	OpenPIC_InitSenses = lopec_openpic_initsenses;
 	OpenPIC_NumInitSenses = sizeof(lopec_openpic_initsenses);
 
-	/*
-	 * We need to tell openpic_set_sources where things actually are.
-	 * mpc10x_common will setup OpenPIC_Addr at ioremap(EUMB phys base +
-	 * EPIC offset (0x40000));  The EPIC IRQ Register Address Map -
-	 * Interrupt Source Configuration Registers gives these numbers
-	 * as offsets starting at 0x50200, we need to adjust occordinly.
-	 */
-	/* Map serial interrupts 0-15 */
-	openpic_set_sources(0, 16, OpenPIC_Addr + 0x10200);
-	/* Skip reserved space and map i2c and DMA Ch[01] */
-	openpic_set_sources(16, 3, OpenPIC_Addr + 0x11020);
-	/* Skip reserved space and map Message Unit Interrupt (I2O) */
-	openpic_set_sources(19, 1, OpenPIC_Addr + 0x110C0);
-
-	openpic_init(NUM_8259_INTERRUPTS);
+	mpc10x_set_openpic();
+
 	/* We have a cascade on OpenPIC IRQ 0, Linux IRQ 16 */
 	openpic_hookup_cascade(NUM_8259_INTERRUPTS, "82c59 cascade",
 			&i8259_irq);
diff --git a/arch/ppc/platforms/pmac_cpufreq.c b/arch/ppc/platforms/pmac_cpufreq.c
index 2c8cec272..5b2221a14 100644
--- a/arch/ppc/platforms/pmac_cpufreq.c
+++ b/arch/ppc/platforms/pmac_cpufreq.c
@@ -1,7 +1,8 @@
 /*
  *  arch/ppc/platforms/pmac_cpufreq.c
  *
- *  Copyright (C) 2002 - 2003 Benjamin Herrenschmidt <benh@kernel.crashing.org>
+ *  Copyright (C) 2002 - 2004 Benjamin Herrenschmidt <benh@kernel.crashing.org>
+ *  Copyright (C) 2004        John Steele Scott <toojays@toojays.net>
  *
  * 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
@@ -47,6 +48,7 @@
 #warning "WARNING, CPUFREQ not recommended on SMP kernels"
 #endif
 
+extern void low_choose_7447a_dfs(int dfs);
 extern void low_choose_750fx_pll(int pll);
 extern void low_sleep_handler(void);
 extern void openpic_suspend(struct sys_device *sysdev, u32 state);
@@ -54,18 +56,27 @@ extern void openpic_resume(struct sys_device *sysdev);
 extern void enable_kernel_altivec(void);
 extern void enable_kernel_fp(void);
 
+/*
+ * Currently, PowerMac cpufreq supports only high & low frequencies
+ * that are set by the firmware
+ */
 static unsigned int low_freq;
 static unsigned int hi_freq;
 static unsigned int cur_freq;
 
-/* Clean that up some day ... use a func ptr or at least an enum... */
-static int cpufreq_uses_pmu;
-static int cpufreq_uses_gpios;
+/*
+ * Different models uses different mecanisms to switch the frequency
+ */
+static int (*set_speed_proc)(int low_speed);
 
+/*
+ * Some definitions used by the various speedprocs
+ */
 static u32 voltage_gpio;
 static u32 frequency_gpio;
 static u32 slew_done_gpio;
 
+
 #define PMAC_CPU_LOW_SPEED	1
 #define PMAC_CPU_HIGH_SPEED	0
 
@@ -123,9 +134,39 @@ static int __pmac cpu_750fx_cpu_speed(int low_speed)
 	return 0;
 }
 
+/* Switch CPU speed using DFS */
+static int __pmac dfs_set_cpu_speed(int low_speed)
+{
+	if (low_speed == 0) {
+		/* ramping up, set voltage first */
+		pmac_call_feature(PMAC_FTR_WRITE_GPIO, NULL, voltage_gpio, 0x05);
+		set_current_state(TASK_UNINTERRUPTIBLE);
+		schedule_timeout(HZ/1000);
+	} else {
+		/* ramping down, enable aack delay first */
+		pmac_call_feature(PMAC_FTR_AACK_DELAY_ENABLE, NULL, 1, 0);
+	}
+
+	/* set frequency */
+	low_choose_7447a_dfs(low_speed);
+
+	if (low_speed == 1) {
+		/* ramping down, set voltage last */
+		pmac_call_feature(PMAC_FTR_WRITE_GPIO, NULL, voltage_gpio, 0x04);
+		set_current_state(TASK_UNINTERRUPTIBLE);
+		schedule_timeout(HZ/1000);
+	} else {
+		/* ramping up, disable aack delay last */
+		pmac_call_feature(PMAC_FTR_AACK_DELAY_ENABLE, NULL, 0, 0);
+	}
+
+	return 0;
+}
+
+
 /* Switch CPU speed using slewing GPIOs
  */
-static int __pmac gpios_set_cpu_speed(unsigned int low_speed)
+static int __pmac gpios_set_cpu_speed(int low_speed)
 {
 	int gpio;
 
@@ -138,7 +179,8 @@ static int __pmac gpios_set_cpu_speed(unsigned int low_speed)
 	}
 
 	/* Set frequency */
-	pmac_call_feature(PMAC_FTR_WRITE_GPIO, NULL, frequency_gpio, low_speed ? 0x04 : 0x05);
+	pmac_call_feature(PMAC_FTR_WRITE_GPIO, NULL, frequency_gpio,
+			  low_speed ? 0x04 : 0x05);
 	udelay(200);
 	do {
 		set_current_state(TASK_UNINTERRUPTIBLE);
@@ -163,7 +205,7 @@ static int __pmac gpios_set_cpu_speed(unsigned int low_speed)
 
 /* Switch CPU speed under PMU control
  */
-static int __pmac pmu_set_cpu_speed(unsigned int low_speed)
+static int __pmac pmu_set_cpu_speed(int low_speed)
 {
 	struct adb_request req;
 	unsigned long save_l2cr;
@@ -269,12 +311,7 @@ static int __pmac do_set_cpu_speed(int speed_mode)
 		return 0;
 
 	cpufreq_notify_transition(&freqs, CPUFREQ_PRECHANGE);
-	if (cpufreq_uses_pmu)
-		rc = pmu_set_cpu_speed(speed_mode);
-	else if (cpufreq_uses_gpios)
-		rc = gpios_set_cpu_speed(speed_mode);
-	else
-		rc = cpu_750fx_cpu_speed(speed_mode);
+	set_speed_proc(speed_mode == PMAC_CPU_LOW_SPEED);
 	cpufreq_notify_transition(&freqs, CPUFREQ_POSTCHANGE);
 	cur_freq = (speed_mode == PMAC_CPU_HIGH_SPEED) ? hi_freq : low_freq;
 
@@ -338,20 +375,138 @@ static struct cpufreq_driver pmac_cpufreq_driver = {
 };
 
 
+static int __pmac pmac_cpufreq_init_MacRISC3(struct device_node *cpunode)
+{
+	struct device_node *volt_gpio_np = of_find_node_by_name(NULL,
+								"voltage-gpio");
+	struct device_node *freq_gpio_np = of_find_node_by_name(NULL,
+								"frequency-gpio");
+	struct device_node *slew_done_gpio_np = of_find_node_by_name(NULL,
+								     "slewing-done");
+	u32 *value;
+
+	/*
+	 * Check to see if it's GPIO driven or PMU only
+	 *
+	 * The way we extract the GPIO address is slightly hackish, but it
+	 * works well enough for now. We need to abstract the whole GPIO
+	 * stuff sooner or later anyway
+	 */
+
+	if (volt_gpio_np)
+		voltage_gpio = read_gpio(volt_gpio_np);
+	if (freq_gpio_np)
+		frequency_gpio = read_gpio(freq_gpio_np);
+	if (slew_done_gpio_np)
+		slew_done_gpio = read_gpio(slew_done_gpio_np);
+
+	/* If we use the frequency GPIOs, calculate the min/max speeds based
+	 * on the bus frequencies
+	 */
+	if (frequency_gpio && slew_done_gpio) {
+		int lenp, rc;
+		u32 *freqs, *ratio;
+
+		freqs = (u32 *)get_property(cpunode, "bus-frequencies", &lenp);
+		lenp /= sizeof(u32);
+		if (freqs == NULL || lenp != 2) {
+			printk(KERN_ERR "cpufreq: bus-frequencies incorrect or missing\n");
+			return 1;
+		}
+		ratio = (u32 *)get_property(cpunode, "processor-to-bus-ratio*2", NULL);
+		if (ratio == NULL) {
+			printk(KERN_ERR "cpufreq: processor-to-bus-ratio*2 missing\n");
+			return 1;
+		}
+
+		/* Get the min/max bus frequencies */
+		low_freq = min(freqs[0], freqs[1]);
+		hi_freq = max(freqs[0], freqs[1]);
+
+		/* Grrrr.. It _seems_ that the device-tree is lying on the low bus
+		 * frequency, it claims it to be around 84Mhz on some models while
+		 * it appears to be approx. 101Mhz on all. Let's hack around here...
+		 * fortunately, we don't need to be too precise
+		 */
+		if (low_freq < 98000000)
+			low_freq = 101000000;
+			
+		/* Convert those to CPU core clocks */
+		low_freq = (low_freq * (*ratio)) / 2000;
+		hi_freq = (hi_freq * (*ratio)) / 2000;
+
+		/* Now we get the frequencies, we read the GPIO to see what is out current
+		 * speed
+		 */
+		rc = pmac_call_feature(PMAC_FTR_READ_GPIO, NULL, frequency_gpio, 0);
+		cur_freq = (rc & 0x01) ? hi_freq : low_freq;
+
+		set_speed_proc = gpios_set_cpu_speed;
+		return 1;
+	}
+
+	/* If we use the PMU, look for the min & max frequencies in the
+	 * device-tree
+	 */
+	value = (u32 *)get_property(cpunode, "min-clock-frequency", NULL);
+	if (!value)
+		return 1;
+	low_freq = (*value) / 1000;
+	/* The PowerBook G4 12" (PowerBook6,1) has an error in the device-tree
+	 * here */
+	if (low_freq < 100000)
+		low_freq *= 10;
+
+	value = (u32 *)get_property(cpunode, "max-clock-frequency", NULL);
+	if (!value)
+		return 1;
+	hi_freq = (*value) / 1000;
+	set_speed_proc = pmu_set_cpu_speed;
+
+	return 0;
+}
+
+static int __pmac pmac_cpufreq_init_7447A(struct device_node *cpunode)
+{
+	struct device_node *volt_gpio_np;
+	u32 *reg;
+
+	/* OF only reports the high frequency */
+	hi_freq = cur_freq;
+	low_freq = cur_freq/2;
+	if (mfspr(HID1) & HID1_DFS)
+		cur_freq = low_freq;
+	else
+		cur_freq = hi_freq;
+
+	volt_gpio_np = of_find_node_by_name(NULL, "cpu-vcore-select");
+	if (!volt_gpio_np){
+		printk(KERN_ERR "cpufreq: missing cpu-vcore-select gpio\n");
+		return 1;
+	}
+
+	reg = (u32 *)get_property(volt_gpio_np, "reg", NULL);
+	voltage_gpio = *reg;
+	set_speed_proc = dfs_set_cpu_speed;
+
+	return 0;
+}
+
 /* Currently, we support the following machines:
  *
  *  - Titanium PowerBook 1Ghz (PMU based, 667Mhz & 1Ghz)
  *  - Titanium PowerBook 800 (PMU based, 667Mhz & 800Mhz)
+ *  - Titanium PowerBook 400 (PMU based, 300Mhz & 400Mhz)
  *  - Titanium PowerBook 500 (PMU based, 300Mhz & 500Mhz)
  *  - iBook2 500 (PMU based, 400Mhz & 500Mhz)
  *  - iBook2 700 (CPU based, 400Mhz & 700Mhz, support low voltage)
- *  - Recent MacRISC3 machines
+ *  - Recent MacRISC3 laptops
+ *  - iBook G4s and PowerBook G4s with 7447A CPUs
  */
 static int __init pmac_cpufreq_setup(void)
 {
 	struct device_node	*cpunode;
 	u32			*value;
-	int			has_freq_ctl = 0;
 
 	if (strstr(cmd_line, "nocpufreq"))
 		return 0;
@@ -367,113 +522,36 @@ static int __init pmac_cpufreq_setup(void)
 		goto out;
 	cur_freq = (*value) / 1000;
 
-	/* Check for newer machines */
-	if (machine_is_compatible("PowerBook3,4") ||
-	    machine_is_compatible("PowerBook3,5") ||
-	    machine_is_compatible("MacRISC3")) {
-		struct device_node *volt_gpio_np = of_find_node_by_name(NULL, "voltage-gpio");
-		struct device_node *freq_gpio_np = of_find_node_by_name(NULL, "frequency-gpio");
-		struct device_node *slew_done_gpio_np = of_find_node_by_name(NULL, "slewing-done");
-
-		/*
-		 * Check to see if it's GPIO driven or PMU only
-		 *
-		 * The way we extract the GPIO address is slightly hackish, but it
-		 * works well enough for now. We need to abstract the whole GPIO
-		 * stuff sooner or later anyway
-		 */
-
-		if (volt_gpio_np)
-			voltage_gpio = read_gpio(volt_gpio_np);
-		if (freq_gpio_np)
-			frequency_gpio = read_gpio(freq_gpio_np);
-		if (slew_done_gpio_np)
-			slew_done_gpio = read_gpio(slew_done_gpio_np);
-
-		/* If we use the frequency GPIOs, calculate the min/max speeds based
-		 * on the bus frequencies
-		 */
-		if (frequency_gpio && slew_done_gpio) {
-			int lenp, rc;
-			u32 *freqs, *ratio;
-
-			freqs = (u32 *)get_property(cpunode, "bus-frequencies", &lenp);
-			lenp /= sizeof(u32);
-			if (freqs == NULL || lenp != 2) {
-				printk(KERN_ERR "cpufreq: bus-frequencies incorrect or missing\n");
-				goto out;
-			}
-			ratio = (u32 *)get_property(cpunode, "processor-to-bus-ratio*2", NULL);
-			if (ratio == NULL) {
-				printk(KERN_ERR "cpufreq: processor-to-bus-ratio*2 missing\n");
-				goto out;
-			}
-
-			/* Get the min/max bus frequencies */
-			low_freq = min(freqs[0], freqs[1]);
-			hi_freq = max(freqs[0], freqs[1]);
-
-			/* Grrrr.. It _seems_ that the device-tree is lying on the low bus
-			 * frequency, it claims it to be around 84Mhz on some models while
-			 * it appears to be approx. 101Mhz on all. Let's hack around here...
-			 * fortunately, we don't need to be too precise
-			 */
-			if (low_freq < 98000000)
-				low_freq = 101000000;
-			
-			/* Convert those to CPU core clocks */
-			low_freq = (low_freq * (*ratio)) / 2000;
-			hi_freq = (hi_freq * (*ratio)) / 2000;
-
-			/* Now we get the frequencies, we read the GPIO to see what is out current
-			 * speed
-			 */
-			rc = pmac_call_feature(PMAC_FTR_READ_GPIO, NULL, frequency_gpio, 0);
-			cur_freq = (rc & 0x01) ? hi_freq : low_freq;
-
-			has_freq_ctl = 1;
-			cpufreq_uses_gpios = 1;
-			goto out;
-		}
-
-		/* If we use the PMU, look for the min & max frequencies in the
-		 * device-tree
-		 */
-		value = (u32 *)get_property(cpunode, "min-clock-frequency", NULL);
-		if (!value)
-			goto out;
-		low_freq = (*value) / 1000;
-		/* The PowerBook G4 12" (PowerBook6,1) has an error in the device-tree
-		 * here */
-		if (low_freq < 100000)
-			low_freq *= 10;
-
-		value = (u32 *)get_property(cpunode, "max-clock-frequency", NULL);
-		if (!value)
-			goto out;
-		hi_freq = (*value) / 1000;
-		has_freq_ctl = 1;
-		cpufreq_uses_pmu = 1;
-	}
+	/*  Check for 7447A based iBook G4 or PowerBook */
+	if (machine_is_compatible("PowerBook6,5") ||
+	    machine_is_compatible("PowerBook6,4") ||
+	    machine_is_compatible("PowerBook5,5") ||
+	    machine_is_compatible("PowerBook5,4")) {
+		pmac_cpufreq_init_7447A(cpunode);
+	/* Check for other MacRISC3 machines */
+	} else if (machine_is_compatible("PowerBook3,4") ||
+		   machine_is_compatible("PowerBook3,5") ||
+		   machine_is_compatible("MacRISC3")) {
+		pmac_cpufreq_init_MacRISC3(cpunode);
 	/* Else check for iBook2 500 */
-	else if (machine_is_compatible("PowerBook4,1")) {
+	} else if (machine_is_compatible("PowerBook4,1")) {
 		/* We only know about 500Mhz model */
 		if (cur_freq < 450000 || cur_freq > 550000)
 			goto out;
 		hi_freq = cur_freq;
 		low_freq = 400000;
-		has_freq_ctl = 1;
-		cpufreq_uses_pmu = 1;
+		set_speed_proc = pmu_set_cpu_speed;
 	}
-	/* Else check for TiPb 500 */
+	/* Else check for TiPb 400 & 500 */
 	else if (machine_is_compatible("PowerBook3,2")) {
-		/* We only know about 500Mhz model */
-		if (cur_freq < 450000 || cur_freq > 550000)
+		/* We only know about the 400 MHz and the 500Mhz model
+		 * they both have 300 MHz as low frequency
+		 */
+		if (cur_freq < 350000 || cur_freq > 550000)
 			goto out;
 		hi_freq = cur_freq;
 		low_freq = 300000;
-		has_freq_ctl = 1;
-		cpufreq_uses_pmu = 1;
+		set_speed_proc = pmu_set_cpu_speed;
 	}
 	/* Else check for 750FX */
 	else if (PVR_VER(mfspr(PVR)) == 0x7000) {
@@ -483,21 +561,19 @@ static int __init pmac_cpufreq_setup(void)
 		value = (u32 *)get_property(cpunode, "reduced-clock-frequency", NULL);
 		if (!value)
 			goto out;
-		low_freq = (*value) / 1000;
-		cpufreq_uses_pmu = 0;
-		has_freq_ctl = 1;
+		low_freq = (*value) / 1000;		
+		set_speed_proc = cpu_750fx_cpu_speed;
 	}
 out:
-	if (!has_freq_ctl)
+	if (set_speed_proc == NULL)
 		return -ENODEV;
 
 	pmac_cpu_freqs[CPUFREQ_LOW].frequency = low_freq;
 	pmac_cpu_freqs[CPUFREQ_HIGH].frequency = hi_freq;
 
 	printk(KERN_INFO "Registering PowerMac CPU frequency driver\n");
-	printk(KERN_INFO "Low: %d Mhz, High: %d Mhz, Boot: %d Mhz, switch method: %s\n",
-	       low_freq/1000, hi_freq/1000, cur_freq/1000,
-	       cpufreq_uses_pmu ? "PMU" : (cpufreq_uses_gpios ? "GPIOs" : "CPU"));
+	printk(KERN_INFO "Low: %d Mhz, High: %d Mhz, Boot: %d Mhz\n",
+	       low_freq/1000, hi_freq/1000, cur_freq/1000);
 
 	return cpufreq_register_driver(&pmac_cpufreq_driver);
 }
diff --git a/arch/ppc/platforms/pmac_feature.c b/arch/ppc/platforms/pmac_feature.c
index abd06fc82..35714de24 100644
--- a/arch/ppc/platforms/pmac_feature.c
+++ b/arch/ppc/platforms/pmac_feature.c
@@ -1282,6 +1282,25 @@ core99_firewire_cable_power(struct device_node* node, long param, long value)
 	return 0;
 }
 
+static long __pmac
+intrepid_aack_delay_enable(struct device_node* node, long param, long value)
+{
+	unsigned long flags;
+
+    	if (uninorth_rev < 0xd2)
+		return -ENODEV;
+
+	LOCK(flags);
+	if (param)
+		UN_BIS(UNI_N_AACK_DELAY, UNI_N_AACK_DELAY_ENABLE);
+	else
+		UN_BIC(UNI_N_AACK_DELAY, UNI_N_AACK_DELAY_ENABLE);
+	UNLOCK(flags);
+
+    	return 0;
+}
+
+
 #endif /* CONFIG_POWER4 */
 
 static long __pmac
@@ -1914,6 +1933,7 @@ static struct feature_table_entry intrepid_features[]  __pmacdata = {
 	{ PMAC_FTR_SLEEP_STATE,		core99_sleep_state },
 	{ PMAC_FTR_READ_GPIO,		core99_read_gpio },
 	{ PMAC_FTR_WRITE_GPIO,		core99_write_gpio },
+	{ PMAC_FTR_AACK_DELAY_ENABLE,	intrepid_aack_delay_enable },
 	{ 0, NULL }
 };
 
@@ -2116,6 +2136,14 @@ static struct pmac_mb_def pmac_mb_defs[] __pmacdata = {
 		PMAC_TYPE_UNKNOWN_INTREPID,	intrepid_features,
 		PMAC_MB_HAS_FW_POWER | PMAC_MB_MOBILE,
 	},
+	{	"PowerBook5,4",			"PowerBook G4 15\"",
+		PMAC_TYPE_UNKNOWN_INTREPID,	intrepid_features,
+		PMAC_MB_HAS_FW_POWER | PMAC_MB_MOBILE,
+	},
+	{	"PowerBook5,5",			"PowerBook G4 17\"",
+		PMAC_TYPE_UNKNOWN_INTREPID,	intrepid_features,
+		PMAC_MB_HAS_FW_POWER | PMAC_MB_MOBILE,
+	},
 	{	"PowerBook6,1",			"PowerBook G4 12\"",
 		PMAC_TYPE_UNKNOWN_INTREPID,	intrepid_features,
 		PMAC_MB_HAS_FW_POWER | PMAC_MB_MOBILE,
@@ -2128,6 +2156,10 @@ static struct pmac_mb_def pmac_mb_defs[] __pmacdata = {
 		PMAC_TYPE_UNKNOWN_INTREPID,	intrepid_features,
 		PMAC_MB_HAS_FW_POWER | PMAC_MB_MOBILE,
 	},
+	{	"PowerBook6,4",			"PowerBook G4 12\"",
+		PMAC_TYPE_UNKNOWN_INTREPID,	intrepid_features,
+		PMAC_MB_HAS_FW_POWER | PMAC_MB_MOBILE,
+	},
 	{	"PowerBook6,5",			"iBook G4",
 		PMAC_TYPE_UNKNOWN_INTREPID,	intrepid_features,
 		PMAC_MB_HAS_FW_POWER | PMAC_MB_MOBILE,
diff --git a/arch/ppc/platforms/pmac_pci.c b/arch/ppc/platforms/pmac_pci.c
index ec44b4a34..9dcc4e2e5 100644
--- a/arch/ppc/platforms/pmac_pci.c
+++ b/arch/ppc/platforms/pmac_pci.c
@@ -72,7 +72,7 @@ fixup_one_level_bus_range(struct device_node *node, int higher)
 		int len;
 
 		/* For PCI<->PCI bridges or CardBus bridges, we go down */
-		class_code = (unsigned int *) get_property(node, "class-code", 0);
+		class_code = (unsigned int *) get_property(node, "class-code", NULL);
 		if (!class_code || ((*class_code >> 8) != PCI_CLASS_BRIDGE_PCI &&
 			(*class_code >> 8) != PCI_CLASS_BRIDGE_CARDBUS))
 			continue;
@@ -124,9 +124,9 @@ fixup_bus_range(struct device_node *bridge)
  * (iBook, G4, new IMacs, and all the recent Apple machines).
  * It contains 3 controllers in one ASIC.
  *
- * The U3 is the bridge used on G5 machines. It contains on
+ * The U3 is the bridge used on G5 machines. It contains an
  * AGP bus which is dealt with the old UniNorth access routines
- * and an HyperTransport bus which uses its own set of access
+ * and a HyperTransport bus which uses its own set of access
  * functions.
  */
 
@@ -509,7 +509,7 @@ fixup_nec_usb2(void)
 			continue;
 		if (0x0035 != *prop)
 			continue;
-		prop = (u32 *)get_property(nec, "reg", 0);
+		prop = (u32 *)get_property(nec, "reg", NULL);
 		if (prop == NULL)
 			continue;
 		devfn = (prop[0] >> 8) & 0xff;
@@ -705,7 +705,7 @@ setup_u3_ht(struct pci_controller* hose, struct reg_property *addr)
 	 * any of the 0xfxxxxxxx "fine" memory regions to /ht.
 	 * We need to fix that sooner or later by either parsing all child "ranges"
 	 * properties or figuring out the U3 address space decoding logic and
-	 * then read it's configuration register (if any).
+	 * then read its configuration register (if any).
 	 */
 	hose->io_base_phys = 0xf4000000 + 0x00400000;
 	hose->io_base_virt = ioremap(hose->io_base_phys, 0x00400000);
@@ -939,8 +939,8 @@ pmac_pci_enable_device_hook(struct pci_dev *dev, int initial)
 		 * 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.
+		 * Should be replaced by 2.4 new PCI mechanisms and really
+		 * register the device.
 		 */
 		pci_read_config_word(dev, PCI_COMMAND, &cmd);
 		cmd |= PCI_COMMAND_MEMORY | PCI_COMMAND_MASTER | PCI_COMMAND_INVALIDATE;
diff --git a/arch/ppc/platforms/pmac_pic.c b/arch/ppc/platforms/pmac_pic.c
index fd46bb98d..bebba8793 100644
--- a/arch/ppc/platforms/pmac_pic.c
+++ b/arch/ppc/platforms/pmac_pic.c
@@ -144,6 +144,22 @@ static void __pmac pmac_set_irq_mask(unsigned int irq_nr, int nokicklost)
 	spin_unlock_irqrestore(&pmac_pic_lock, flags);
 }
 
+/* When an irq gets requested for the first client, if it's an
+ * edge interrupt, we clear any previous one on the controller
+ */
+static unsigned int __pmac pmac_startup_irq(unsigned int irq_nr)
+{
+        unsigned long bit = 1UL << (irq_nr & 0x1f);
+        int i = irq_nr >> 5;
+
+	if ((irq_desc[irq_nr].status & IRQ_LEVEL) == 0)
+		out_le32(&pmac_irq_hw[i]->ack, bit);
+        set_bit(irq_nr, ppc_cached_irq_mask);
+        pmac_set_irq_mask(irq_nr, 0);
+
+	return 0;
+}
+
 static void __pmac pmac_mask_irq(unsigned int irq_nr)
 {
         clear_bit(irq_nr, ppc_cached_irq_mask);
@@ -168,25 +184,21 @@ static void __pmac pmac_end_irq(unsigned int irq_nr)
 
 
 struct hw_interrupt_type pmac_pic = {
-        " PMAC-PIC ",
-        NULL,
-        NULL,
-        pmac_unmask_irq,
-        pmac_mask_irq,
-        pmac_mask_and_ack_irq,
-        pmac_end_irq,
-        NULL
+	.typename	= " PMAC-PIC ",
+	.startup	= pmac_startup_irq,
+	.enable		= pmac_unmask_irq,
+	.disable	= pmac_mask_irq,
+	.ack		= pmac_mask_and_ack_irq,
+	.end		= pmac_end_irq,
 };
 
 struct hw_interrupt_type gatwick_pic = {
-	" GATWICK  ",
-	NULL,
-	NULL,
-	pmac_unmask_irq,
-	pmac_mask_irq,
-	pmac_mask_and_ack_irq,
-	pmac_end_irq,
-	NULL
+	.typename	= " GATWICK  ",
+	.startup	= pmac_startup_irq,
+	.enable		= pmac_unmask_irq,
+	.disable	= pmac_mask_irq,
+	.ack		= pmac_mask_and_ack_irq,
+	.end		= pmac_end_irq,
 };
 
 static irqreturn_t gatwick_action(int cpl, void *dev_id, struct pt_regs *regs)
@@ -444,7 +456,7 @@ void __init pmac_pic_init(void)
 					nmi_irq = pswitch->intrs[0].line;
 					openpic_init_nmi_irq(nmi_irq);
 					request_irq(nmi_irq, xmon_irq, 0,
-						    "NMI - XMON", 0);
+						    "NMI - XMON", NULL);
 				}
 			}
 #endif	/* CONFIG_XMON */
@@ -542,7 +554,7 @@ void __init pmac_pic_init(void)
 		for ( i = max_real_irqs ; i < max_irqs ; i++ )
 			irq_desc[i].handler = &gatwick_pic;
 		request_irq( irq_cascade, gatwick_action, SA_INTERRUPT,
-			     "cascade", 0 );
+			     "cascade", NULL );
 	}
 	printk("System has %d possible interrupts\n", max_irqs);
 	if (max_irqs != max_real_irqs)
@@ -550,7 +562,7 @@ void __init pmac_pic_init(void)
 			max_real_irqs);
 
 #ifdef CONFIG_XMON
-	request_irq(20, xmon_irq, 0, "NMI - XMON", 0);
+	request_irq(20, xmon_irq, 0, "NMI - XMON", NULL);
 #endif	/* CONFIG_XMON */
 }
 
diff --git a/arch/ppc/platforms/pmac_setup.c b/arch/ppc/platforms/pmac_setup.c
index d89cfe2ae..b05cee1f7 100644
--- a/arch/ppc/platforms/pmac_setup.c
+++ b/arch/ppc/platforms/pmac_setup.c
@@ -103,8 +103,6 @@ int has_l2cache = 0;
 
 static int current_root_goodness = -1;
 
-extern char saved_command_line[];
-
 extern int pmac_newworld;
 
 #define DEFAULT_ROOT_DEVICE Root_SDA1	/* sda1 - slightly silly choice */
diff --git a/arch/ppc/platforms/pmac_smp.c b/arch/ppc/platforms/pmac_smp.c
index ff80725cb..704742257 100644
--- a/arch/ppc/platforms/pmac_smp.c
+++ b/arch/ppc/platforms/pmac_smp.c
@@ -421,7 +421,7 @@ static void __init smp_psurge_setup_cpu(int cpu_nr)
 		/* 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, SA_INTERRUPT, "primary IPI", 0))
+		if (request_irq(30, psurge_primary_intr, SA_INTERRUPT, "primary IPI", NULL))
 			printk(KERN_ERR "Couldn't get primary IPI interrupt");
 	}
 
diff --git a/arch/ppc/platforms/powerpmc250.c b/arch/ppc/platforms/powerpmc250.c
index 39677320c..0abe15159 100644
--- a/arch/ppc/platforms/powerpmc250.c
+++ b/arch/ppc/platforms/powerpmc250.c
@@ -197,7 +197,7 @@ powerpmc250_init_IRQ(void)
 
 	OpenPIC_InitSenses = powerpmc250_openpic_initsenses;
 	OpenPIC_NumInitSenses = sizeof(powerpmc250_openpic_initsenses);
-	openpic_init(1, 0, 0, -1);
+	mpc10x_set_openpic();
 }
 
 /*
diff --git a/arch/ppc/platforms/pplus.c b/arch/ppc/platforms/pplus.c
index 6fc3ca978..673641ff4 100644
--- a/arch/ppc/platforms/pplus.c
+++ b/arch/ppc/platforms/pplus.c
@@ -48,8 +48,6 @@
 
 TODC_ALLOC();
 
-extern char saved_command_line[];
-
 extern void pplus_setup_hose(void);
 extern void pplus_set_VIA_IDE_native(void);
 
diff --git a/arch/ppc/platforms/prep_pci.c b/arch/ppc/platforms/prep_pci.c
index f227137e1..58775fc7f 100644
--- a/arch/ppc/platforms/prep_pci.c
+++ b/arch/ppc/platforms/prep_pci.c
@@ -741,7 +741,7 @@ raven_init(void)
 	}
 
 	/* Check the first PCI device to see if it is a Raven. */
-	early_read_config_dword(0, 0, 0, PCI_VENDOR_ID, &devid);
+	early_read_config_dword(NULL, 0, 0, PCI_VENDOR_ID, &devid);
 
 	switch (devid & 0xffff0000) {
 	case MPIC_RAVEN_ID:
@@ -757,7 +757,7 @@ raven_init(void)
 
 
 	/* Read the memory base register. */
-	early_read_config_dword(0, 0, 0, PCI_BASE_ADDRESS_1, &pci_membase);
+	early_read_config_dword(NULL, 0, 0, PCI_BASE_ADDRESS_1, &pci_membase);
 
 	if (pci_membase == 0) {
 		OpenPIC_Addr = NULL;
diff --git a/arch/ppc/platforms/prep_setup.c b/arch/ppc/platforms/prep_setup.c
index 7c3623bcc..99acd5170 100644
--- a/arch/ppc/platforms/prep_setup.c
+++ b/arch/ppc/platforms/prep_setup.c
@@ -76,7 +76,6 @@ extern void rs_nvram_write_val(int addr,
 extern void ibm_prep_init(void);
 
 extern void prep_find_bridges(void);
-extern char saved_command_line[];
 
 int _prep_type;
 
@@ -866,7 +865,7 @@ prep_init_IRQ(void)
 		irq_desc[i].handler = &i8259_pic;
 	/* If we have a Raven PCI bridge or a Hawk PCI bridge / Memory
 	 * controller, we poll (as they have a different int-ack address). */
-	early_read_config_dword(0, 0, 0, PCI_VENDOR_ID, &pci_viddid);
+	early_read_config_dword(NULL, 0, 0, PCI_VENDOR_ID, &pci_viddid);
 	pci_did = (pci_viddid & 0xffff0000) >> 16;
 	if (((pci_viddid & 0xffff) == PCI_VENDOR_ID_MOTOROLA)
 			&& ((pci_did == PCI_DEVICE_ID_MOTOROLA_RAVEN)
diff --git a/arch/ppc/platforms/residual.c b/arch/ppc/platforms/residual.c
index 329c1c6f7..b094e2715 100644
--- a/arch/ppc/platforms/residual.c
+++ b/arch/ppc/platforms/residual.c
@@ -802,7 +802,7 @@ PPC_DEVICE __init *residual_find_device(unsigned long BusMask,
 		     !(n--) ) return res->Devices+i;
 #undef Dev
 	}
-	return 0;
+	return NULL;
 }
 
 PPC_DEVICE __init *residual_find_device_id(unsigned long BusMask,
@@ -824,7 +824,7 @@ PPC_DEVICE __init *residual_find_device_id(unsigned long BusMask,
 		     !(n--) ) return res->Devices+i;
 #undef Dev
 	}
-	return 0;
+	return NULL;
 }
 
 PnP_TAG_PACKET *PnP_find_packet(unsigned char *p,
@@ -832,7 +832,7 @@ PnP_TAG_PACKET *PnP_find_packet(unsigned char *p,
 				int n)
 {
 	unsigned mask, masked_tag, size;
-	if(!p) return 0;
+	if(!p) return NULL;
 	if (tag_type(packet_tag)) mask=0xff; else mask=0xF8;
 	masked_tag = packet_tag&mask;
 	for(; *p != END_TAG; p+=size) {
@@ -843,7 +843,7 @@ PnP_TAG_PACKET *PnP_find_packet(unsigned char *p,
 		else
 			size=tag_small_count(*p)+1;
 	}
-	return 0; /* not found */
+	return NULL; /* not found */
 }
 
 PnP_TAG_PACKET __init *PnP_find_small_vendor_packet(unsigned char *p,
@@ -857,7 +857,7 @@ PnP_TAG_PACKET __init *PnP_find_small_vendor_packet(unsigned char *p,
 			return (PnP_TAG_PACKET *) p;
 		next = 1;
 	};
-	return 0; /* not found */
+	return NULL; /* not found */
 }
 
 PnP_TAG_PACKET __init *PnP_find_large_vendor_packet(unsigned char *p,
@@ -871,7 +871,7 @@ PnP_TAG_PACKET __init *PnP_find_large_vendor_packet(unsigned char *p,
 			return (PnP_TAG_PACKET *) p;
 		next = 1;
 	};
-	return 0; /* not found */
+	return NULL; /* not found */
 }
 
 #ifdef CONFIG_PROC_PREPRESIDUAL
diff --git a/arch/ppc/platforms/sandpoint.c b/arch/ppc/platforms/sandpoint.c
index ab682fa5d..fdcbcf240 100644
--- a/arch/ppc/platforms/sandpoint.c
+++ b/arch/ppc/platforms/sandpoint.c
@@ -433,17 +433,7 @@ sandpoint_init_IRQ(void)
 	OpenPIC_InitSenses = sandpoint_openpic_initsenses;
 	OpenPIC_NumInitSenses = sizeof(sandpoint_openpic_initsenses);
 
-	/*
-	 * We need to tell openpic_set_sources where things actually are.
-	 * mpc10x_common will setup OpenPIC_Addr at ioremap(EUMB phys base +
-	 * EPIC offset (0x40000));  The EPIC IRQ Register Address Map -
-	 * Interrupt Source Configuration Registers gives these numbers
-	 * as offsets starting at 0x50200, we need to adjust occordinly.
-	 */
-	/* Map serial interrupts 0-15 */
-	openpic_set_sources(0, 16, OpenPIC_Addr + 0x10200);
-
-	openpic_init(NUM_8259_INTERRUPTS);
+	mpc10x_set_openpic();
 	openpic_hookup_cascade(NUM_8259_INTERRUPTS, "82c59 cascade",
 			i8259_irq);
 
diff --git a/arch/ppc/platforms/sbc82xx.c b/arch/ppc/platforms/sbc82xx.c
index 0da699d3b..28a77dba3 100644
--- a/arch/ppc/platforms/sbc82xx.c
+++ b/arch/ppc/platforms/sbc82xx.c
@@ -18,14 +18,18 @@
 #include <linux/config.h>
 #include <linux/seq_file.h>
 #include <linux/stddef.h>
+#include <linux/interrupt.h>
+#include <linux/irq.h>
 
 #include <asm/mpc8260.h>
 #include <asm/machdep.h>
 #include <asm/io.h>
 #include <asm/todc.h>
-#include <asm/immap_8260.h>
+#include <asm/immap_cpm2.h>
+#include <asm/pci.h>
 
 static void (*callback_setup_arch)(void);
+static void (*callback_init_IRQ)(void);
 
 extern unsigned char __res[sizeof(bd_t)];
 
@@ -57,6 +61,7 @@ sbc82xx_setup_arch(void)
 	callback_setup_arch();
 }
 
+#ifdef CONFIG_GEN_RTC
 TODC_ALLOC();
 
 /*
@@ -64,16 +69,17 @@ TODC_ALLOC();
  * directly use ioremap() at that time.
  * late_time_init() is call after paging init.
  */
-#ifdef CONFIG_GEN_RTC
+
 static void sbc82xx_time_init(void)
 {
-	volatile memctl8260_t *mc = &immr->im_memctl;
-	TODC_INIT(TODC_TYPE_MK48T59, 0, 0, SBC82xx_TODC_NVRAM_ADDR, 0);
+	volatile memctl_cpm2_t *mc = &cpm2_immr->im_memctl;
 
 	/* Set up CS11 for RTC chip */
 	mc->memc_br11=0;
 	mc->memc_or11=0xffff0836;
-	mc->memc_br11=0x80000801;
+	mc->memc_br11=SBC82xx_TODC_NVRAM_ADDR | 0x0801;
+
+	TODC_INIT(TODC_TYPE_MK48T59, 0, 0, SBC82xx_TODC_NVRAM_ADDR, 0);
 
 	todc_info->nvram_data =
 		(unsigned int)ioremap(todc_info->nvram_data, 0x2000);
@@ -86,6 +92,152 @@ static void sbc82xx_time_init(void)
 }
 #endif /* CONFIG_GEN_RTC */
 
+static volatile char *sbc82xx_i8259_map;
+static char sbc82xx_i8259_mask = 0xff;
+static spinlock_t sbc82xx_i8259_lock = SPIN_LOCK_UNLOCKED;
+
+static void sbc82xx_i8259_mask_and_ack_irq(unsigned int irq_nr)
+{
+	unsigned long flags;
+
+	irq_nr -= NR_SIU_INTS;
+
+	spin_lock_irqsave(&sbc82xx_i8259_lock, flags);
+	sbc82xx_i8259_mask |= 1 << irq_nr;
+	(void) sbc82xx_i8259_map[1];	/* Dummy read */
+	sbc82xx_i8259_map[1] = sbc82xx_i8259_mask;
+	sbc82xx_i8259_map[0] = 0x20;	/* OCW2: Non-specific EOI */
+	spin_unlock_irqrestore(&sbc82xx_i8259_lock, flags);
+}
+
+static void sbc82xx_i8259_mask_irq(unsigned int irq_nr)
+{
+	unsigned long flags;
+
+	irq_nr -= NR_SIU_INTS;
+
+	spin_lock_irqsave(&sbc82xx_i8259_lock, flags);
+	sbc82xx_i8259_mask |= 1 << irq_nr;
+	sbc82xx_i8259_map[1] = sbc82xx_i8259_mask;
+	spin_unlock_irqrestore(&sbc82xx_i8259_lock, flags);
+}
+
+static void sbc82xx_i8259_unmask_irq(unsigned int irq_nr)
+{
+	unsigned long flags;
+
+	irq_nr -= NR_SIU_INTS;
+
+	spin_lock_irqsave(&sbc82xx_i8259_lock, flags);
+	sbc82xx_i8259_mask &= ~(1 << irq_nr);
+	sbc82xx_i8259_map[1] = sbc82xx_i8259_mask;
+	spin_unlock_irqrestore(&sbc82xx_i8259_lock, flags);
+}
+
+static void sbc82xx_i8259_end_irq(unsigned int irq)
+{
+	if (!(irq_desc[irq].status & (IRQ_DISABLED|IRQ_INPROGRESS))
+	    && irq_desc[irq].action)
+		sbc82xx_i8259_unmask_irq(irq);
+}
+
+
+struct hw_interrupt_type sbc82xx_i8259_ic = {
+	.typename = " i8259     ",
+	.enable = sbc82xx_i8259_unmask_irq,
+	.disable = sbc82xx_i8259_mask_irq,
+	.ack = sbc82xx_i8259_mask_and_ack_irq,
+	.end = sbc82xx_i8259_end_irq,
+};
+
+static irqreturn_t sbc82xx_i8259_demux(int irq, void *dev_id, struct pt_regs *regs)
+{
+	spin_lock(&sbc82xx_i8259_lock);
+
+	sbc82xx_i8259_map[0] = 0x0c;	/* OCW3: Read IR register on RD# pulse */
+	irq = sbc82xx_i8259_map[0] & 7;	/* Read IRR */
+
+	if (irq == 7) {
+		/* Possible spurious interrupt */
+		int isr;
+		sbc82xx_i8259_map[0] = 0x0b;	/* OCW3: Read IS register on RD# pulse */
+		isr = sbc82xx_i8259_map[0];	/* Read ISR */
+
+		if (!(isr & 0x80)) {
+			printk(KERN_INFO "Spurious i8259 interrupt\n");
+			return IRQ_HANDLED;
+		}
+	}
+	ppc_irq_dispatch_handler(regs, NR_SIU_INTS + irq);
+	return IRQ_HANDLED;
+}
+
+void __init sbc82xx_init_IRQ(void)
+{
+	volatile memctl_cpm2_t *mc = &cpm2_immr->im_memctl;
+	volatile intctl_cpm2_t *ic = &cpm2_immr->im_intctl;
+	int i;
+
+	callback_init_IRQ();
+
+	/* u-boot doesn't always set the board up correctly */
+	mc->memc_br5 = 0;
+	mc->memc_or5 = 0xfff00856;
+	mc->memc_br5 = 0x22000801;
+
+	sbc82xx_i8259_map = ioremap(0x22008000, 2);
+	if (!sbc82xx_i8259_map) {
+		printk(KERN_CRIT "Mapping i8259 interrupt controller failed\n");
+		return;
+	}
+	
+	/* Set up the interrupt handlers for the i8259 IRQs */
+	for (i = NR_SIU_INTS; i < NR_SIU_INTS + 8; i++) {
+                irq_desc[i].handler = &sbc82xx_i8259_ic;
+		irq_desc[i].status |= IRQ_LEVEL;
+	}
+
+	/* make IRQ6 level sensitive */
+	ic->ic_siexr &= ~(1 << (14 - (SIU_INT_IRQ6 - SIU_INT_IRQ1)));
+	irq_desc[SIU_INT_IRQ6].status |= IRQ_LEVEL;
+
+	/* Initialise the i8259 */
+	sbc82xx_i8259_map[0] = 0x1b;	/* ICW1: Level, no cascade, ICW4 */
+	sbc82xx_i8259_map[1] = 0x00;	/* ICW2: vector base */
+					/* No ICW3 (no cascade) */
+	sbc82xx_i8259_map[1] = 0x01;	/* ICW4: 8086 mode, normal EOI */
+
+	sbc82xx_i8259_map[0] = 0x0b;	/* OCW3: Read IS register on RD# pulse */
+
+	sbc82xx_i8259_map[1] = sbc82xx_i8259_mask; /* Set interrupt mask */
+
+	/* Request cascade IRQ */
+	if (request_irq(SIU_INT_IRQ6, sbc82xx_i8259_demux, SA_INTERRUPT,
+			"i8259 demux", 0)) {
+		printk("Installation of i8259 IRQ demultiplexer failed.\n");
+	}
+}
+
+static int sbc82xx_pci_map_irq(struct pci_dev *dev, unsigned char idsel,
+			       unsigned char pin)
+{
+	static char pci_irq_table[][4] = {
+		/*
+		 * PCI IDSEL/INTPIN->INTLINE
+		 *  A      B      C      D
+		 */
+		{ SBC82xx_PIRQA, SBC82xx_PIRQB, SBC82xx_PIRQC, SBC82xx_PIRQD },	/* IDSEL 16 - PMC slot */
+		{ SBC82xx_PC_IRQA, SBC82xx_PC_IRQB, -1,  -1  },			/* IDSEL 17 - CardBus */
+		{ SBC82xx_PIRQA, SBC82xx_PIRQB, SBC82xx_PIRQC, SBC82xx_PIRQD }, /* IDSEL 18 - PCI-X bridge */
+	};
+
+	const long min_idsel = 16, max_idsel = 18, irqs_per_slot = 4;
+
+	return PCI_IRQ_TABLE_LOOKUP;
+}
+
+
+
 void __init
 platform_init(unsigned long r3, unsigned long r4, unsigned long r5,
 	      unsigned long r6, unsigned long r7)
@@ -101,7 +253,11 @@ platform_init(unsigned long r3, unsigned long r4, unsigned long r5,
 	ppc_md.show_cpuinfo	= sbc82xx_show_cpuinfo;
 
 	callback_setup_arch	= ppc_md.setup_arch;
+	callback_init_IRQ	= ppc_md.init_IRQ;
+
 	ppc_md.setup_arch	= sbc82xx_setup_arch;
+	ppc_md.init_IRQ		= sbc82xx_init_IRQ;
+	ppc_md.pci_map_irq	= sbc82xx_pci_map_irq;
 #ifdef CONFIG_GEN_RTC
 	ppc_md.time_init        = NULL;
 	ppc_md.get_rtc_time     = NULL;
diff --git a/arch/ppc/platforms/sbc82xx.h b/arch/ppc/platforms/sbc82xx.h
index b9d1c8ddb..adafd49be 100644
--- a/arch/ppc/platforms/sbc82xx.h
+++ b/arch/ppc/platforms/sbc82xx.h
@@ -9,10 +9,9 @@
 
 #include <asm/ppcboot.h>
 
-#define IMAP_ADDR			0xf0000000
 #define CPM_MAP_ADDR			0xf0000000
 
-#define SBC82xx_TODC_NVRAM_ADDR		0x80000000
+#define SBC82xx_TODC_NVRAM_ADDR		0xd0000000
 
 #define SBC82xx_MACADDR_NVRAM_FCC1	0x220000c9	/* JP6B */
 #define SBC82xx_MACADDR_NVRAM_SCC1	0x220000cf	/* JP6A */
@@ -21,4 +20,13 @@
 
 #define BOOTROM_RESTART_ADDR      ((uint)0x40000104)
 
+#define SBC82xx_PC_IRQA (NR_SIU_INTS+0)
+#define SBC82xx_PC_IRQB (NR_SIU_INTS+1)
+#define SBC82xx_MPC185_IRQ (NR_SIU_INTS+2)
+#define SBC82xx_ATM_IRQ (NR_SIU_INTS+3)
+#define SBC82xx_PIRQA (NR_SIU_INTS+4)
+#define SBC82xx_PIRQB (NR_SIU_INTS+5)
+#define SBC82xx_PIRQC (NR_SIU_INTS+6)
+#define SBC82xx_PIRQD (NR_SIU_INTS+7)
+
 #endif /* __PPC_SBC82xx_H__ */
diff --git a/arch/ppc/platforms/sbs8260.h b/arch/ppc/platforms/sbs8260.h
index 76632d0c0..d51427a0f 100644
--- a/arch/ppc/platforms/sbs8260.h
+++ b/arch/ppc/platforms/sbs8260.h
@@ -5,7 +5,7 @@
  * the configuration SCMR and the Power-On-Reset word.
  */
 
-#define IMAP_ADDR	((uint)0xfe000000)
+#define CPM_MAP_ADDR	((uint)0xfe000000)
 
 
 /* A Board Information structure that is given to a program when
diff --git a/arch/ppc/platforms/tqm8260.h b/arch/ppc/platforms/tqm8260.h
index 1d30d64a6..3366cbded 100644
--- a/arch/ppc/platforms/tqm8260.h
+++ b/arch/ppc/platforms/tqm8260.h
@@ -11,7 +11,7 @@
 
 #include <asm/ppcboot.h>
 
-#define IMAP_ADDR		((uint)0xFFF00000)
+#define CPM_MAP_ADDR		((uint)0xFFF00000)
 #define PHY_INTERRUPT		25
 
 #define BOOTROM_RESTART_ADDR	((uint)0x40000104)
diff --git a/arch/ppc/platforms/tqm8260_setup.c b/arch/ppc/platforms/tqm8260_setup.c
index 891665219..1241ed5d4 100644
--- a/arch/ppc/platforms/tqm8260_setup.c
+++ b/arch/ppc/platforms/tqm8260_setup.c
@@ -17,7 +17,7 @@
 #include <linux/config.h>
 #include <linux/seq_file.h>
 
-#include <asm/immap_8260.h>
+#include <asm/immap_cpm2.h>
 #include <asm/mpc8260.h>
 #include <asm/machdep.h>
 
@@ -44,8 +44,8 @@ tqm8260_show_cpuinfo(struct seq_file *m)
 static int
 tqm8260_set_rtc_time(unsigned long time)
 {
-	((immap_t *)IMAP_ADDR)->im_sit.sit_tmcnt = time;
-	((immap_t *)IMAP_ADDR)->im_sit.sit_tmcntsc = 0x3;
+	((cpm2_map_t *)CPM_MAP_ADDR)->im_sit.sit_tmcnt = time;
+	((cpm2_map_t *)CPM_MAP_ADDR)->im_sit.sit_tmcntsc = 0x3;
 
 	return(0);
 }
@@ -53,7 +53,7 @@ tqm8260_set_rtc_time(unsigned long time)
 static unsigned long
 tqm8260_get_rtc_time(void)
 {
-	return ((immap_t *)IMAP_ADDR)->im_sit.sit_tmcnt;
+	return ((cpm2_map_t *)CPM_MAP_ADDR)->im_sit.sit_tmcnt;
 }
 
 static void __init
diff --git a/arch/ppc/syslib/Makefile b/arch/ppc/syslib/Makefile
index f77cdf1d0..4de92f498 100644
--- a/arch/ppc/syslib/Makefile
+++ b/arch/ppc/syslib/Makefile
@@ -2,13 +2,6 @@
 # Makefile for the linux kernel.
 #
 
-ifdef CONFIG_PPC64BRIDGE
-EXTRA_AFLAGS		:= -Wa,-mppc64bridge
-endif
-ifdef CONFIG_4xx
-EXTRA_AFLAGS		:= -Wa,-m405
-endif
-
 CFLAGS_prom_init.o      += -fPIC
 CFLAGS_btext.o          += -fPIC
 
@@ -22,7 +15,8 @@ ifeq ($(CONFIG_4xx),y)
 obj-$(CONFIG_4xx)		+= ppc4xx_pic.o
 obj-$(CONFIG_40x)		+= ppc4xx_setup.o
 obj-$(CONFIG_GEN_RTC)		+= todc_time.o
-obj-$(CONFIG_KGDB)		+= ppc4xx_kgdb.o
+obj-$(CONFIG_PPC4xx_DMA)	+= ppc4xx_dma.o
+obj-$(CONFIG_PPC4xx_EDMA)	+= ppc4xx_sgdma.o
 ifeq ($(CONFIG_40x),y)
 obj-$(CONFIG_KGDB)		+= ppc4xx_kgdb.o
 obj-$(CONFIG_PCI)		+= indirect_pci.o pci_auto.o ppc405_pci.o
@@ -45,7 +39,7 @@ obj-$(CONFIG_EV64260)		+= gt64260_common.o gt64260_pic.o \
 obj-$(CONFIG_GEMINI)		+= open_pic.o indirect_pci.o
 obj-$(CONFIG_K2)		+= i8259.o indirect_pci.o todc_time.o \
 					pci_auto.o
-obj-$(CONFIG_LOPEC)		+= pci_auto.o open_pic.o i8259.o todc_time.o
+obj-$(CONFIG_LOPEC)		+= i8259.o pci_auto.o todc_time.o
 obj-$(CONFIG_MCPN765)		+= todc_time.o indirect_pci.o pci_auto.o \
 					open_pic.o i8259.o hawk_common.o
 obj-$(CONFIG_MENF1)		+= todc_time.o i8259.o mpc10x_common.o \
@@ -55,23 +49,32 @@ obj-$(CONFIG_MVME5100)		+= open_pic.o todc_time.o indirect_pci.o \
 obj-$(CONFIG_OCOTEA)		+= indirect_pci.o pci_auto.o todc_time.o
 obj-$(CONFIG_PAL4)		+= cpc700_pic.o
 obj-$(CONFIG_PCORE)		+= todc_time.o i8259.o pci_auto.o
-obj-$(CONFIG_POWERPMC250)	+= open_pic.o pci_auto.o
+obj-$(CONFIG_POWERPMC250)	+= pci_auto.o
 obj-$(CONFIG_PPLUS)		+= hawk_common.o open_pic.o i8259.o \
 				   indirect_pci.o todc_time.o pci_auto.o
 obj-$(CONFIG_PRPMC750)		+= open_pic.o indirect_pci.o pci_auto.o \
 					hawk_common.o
 obj-$(CONFIG_HARRIER)		+= harrier.o
 obj-$(CONFIG_PRPMC800)		+= open_pic.o indirect_pci.o pci_auto.o
-obj-$(CONFIG_SANDPOINT)		+= i8259.o open_pic.o pci_auto.o todc_time.o
+obj-$(CONFIG_SANDPOINT)		+= i8259.o pci_auto.o todc_time.o
 obj-$(CONFIG_SBC82xx)		+= todc_time.o
 obj-$(CONFIG_SPRUCE)		+= cpc700_pic.o indirect_pci.o pci_auto.o \
 				   todc_time.o
-obj-$(CONFIG_8260)		+= m8260_setup.o ppc8260_pic.o
+obj-$(CONFIG_8260)		+= m8260_setup.o
+obj-$(CONFIG_PCI_8260)		+= m8260_pci.o indirect_pci.o
+obj-$(CONFIG_8260_PCI9)		+= m8260_pci_erratum9.o
+obj-$(CONFIG_CPM2)		+= cpm2_common.o cpm2_pic.o
 ifeq ($(CONFIG_PPC_GEN550),y)
 obj-$(CONFIG_KGDB)		+= gen550_kgdb.o gen550_dbg.o
 obj-$(CONFIG_SERIAL_TEXT_DEBUG)	+= gen550_dbg.o
 endif
 obj-$(CONFIG_BOOTX_TEXT)	+= btext.o
 obj-$(CONFIG_MPC10X_BRIDGE)     += mpc10x_common.o indirect_pci.o
+obj-$(CONFIG_MPC10X_OPENPIC)	+= open_pic.o
 obj-$(CONFIG_40x)		+= dcr.o
 obj-$(CONFIG_BOOKE)		+= dcr.o
+obj-$(CONFIG_85xx)		+= open_pic.o ppc85xx_common.o ppc85xx_setup.o
+ifeq ($(CONFIG_85xx),y)
+obj-$(CONFIG_PCI)		+= indirect_pci.o pci_auto.o
+endif
+obj-$(CONFIG_PPC_MPC52xx)	+= mpc52xx_setup.o mpc52xx_pic.o
diff --git a/arch/ppc/syslib/cpm2_common.c b/arch/ppc/syslib/cpm2_common.c
index 5ca6d4cf3..ea5e77080 100644
--- a/arch/ppc/syslib/cpm2_common.c
+++ b/arch/ppc/syslib/cpm2_common.c
@@ -39,10 +39,14 @@ cpm_cpm2_t	*cpmp;		/* Pointer to comm processor space */
  */
 cpm2_map_t *cpm2_immr;
 
+#define CPM_MAP_SIZE	(0x40000)	/* 256k - the PQ3 reserve this amount
+					   of space for CPM as it is larger
+					   than on PQ2 */
+
 void
 cpm2_reset(void)
 {
-	cpm2_immr = (cpm2_map_t *)CPM_MAP_ADDR;
+	cpm2_immr = (cpm2_map_t *)ioremap(CPM_MAP_ADDR, CPM_MAP_SIZE);
 
 	/* Reclaim the DP memory for our use.
 	 */
@@ -70,7 +74,7 @@ cpm2_reset(void)
  * oversampled clock.
  */
 void
-cpm2_setbrg(uint brg, uint rate)
+cpm_setbrg(uint brg, uint rate)
 {
 	volatile uint	*bp;
 
@@ -119,8 +123,6 @@ static rh_info_t cpm_dpmem_info;
 
 static void cpm2_dpinit(void)
 {
-	void *dprambase = &((cpm2_map_t *)CPM_MAP_ADDR)->im_dprambase;
-
 	spin_lock_init(&cpm_dpmem_lock);
 
 	/* initialize the info header */
@@ -135,15 +137,13 @@ static void cpm2_dpinit(void)
 	 * varies with the processor and the microcode patches activated.
 	 * But the following should be at least safe.
 	 */
-	rh_attach_region(&cpm_dpmem_info, dprambase + CPM_DATAONLY_BASE,
+	rh_attach_region(&cpm_dpmem_info, (void *)CPM_DATAONLY_BASE,
 			CPM_DATAONLY_SIZE);
 }
 
-/* This function used to return an index into the DPRAM area.
- * Now it returns the actuall physical address of that area.
- * use cpm2_dpram_offset() to get the index
+/* This function returns an index into the DPRAM area.
  */
-void *cpm2_dpalloc(uint size, uint align)
+uint cpm_dpalloc(uint size, uint align)
 {
 	void *start;
 	unsigned long flags;
@@ -153,53 +153,46 @@ void *cpm2_dpalloc(uint size, uint align)
 	start = rh_alloc(&cpm_dpmem_info, size, "commproc");
 	spin_unlock_irqrestore(&cpm_dpmem_lock, flags);
 
-	return start;
+	return (uint)start;
 }
-EXPORT_SYMBOL(cpm2_dpalloc);
+EXPORT_SYMBOL(cpm_dpalloc);
 
-int cpm2_dpfree(void *addr)
+int cpm_dpfree(uint offset)
 {
 	int ret;
 	unsigned long flags;
 
 	spin_lock_irqsave(&cpm_dpmem_lock, flags);
-	ret = rh_free(&cpm_dpmem_info, addr);
+	ret = rh_free(&cpm_dpmem_info, (void *)offset);
 	spin_unlock_irqrestore(&cpm_dpmem_lock, flags);
 
 	return ret;
 }
-EXPORT_SYMBOL(cpm2_dpfree);
+EXPORT_SYMBOL(cpm_dpfree);
 
 /* not sure if this is ever needed */
-void *cpm2_dpalloc_fixed(void *addr, uint size, uint align)
+uint cpm_dpalloc_fixed(uint offset, uint size, uint align)
 {
 	void *start;
 	unsigned long flags;
 
 	spin_lock_irqsave(&cpm_dpmem_lock, flags);
 	cpm_dpmem_info.alignment = align;
-	start = rh_alloc_fixed(&cpm_dpmem_info, addr, size, "commproc");
+	start = rh_alloc_fixed(&cpm_dpmem_info, (void *)offset, size, "commproc");
 	spin_unlock_irqrestore(&cpm_dpmem_lock, flags);
 
-	return start;
+	return (uint)start;
 }
-EXPORT_SYMBOL(cpm2_dpalloc_fixed);
+EXPORT_SYMBOL(cpm_dpalloc_fixed);
 
-void cpm2_dpdump(void)
+void cpm_dpdump(void)
 {
 	rh_dump(&cpm_dpmem_info);
 }
-EXPORT_SYMBOL(cpm2_dpdump);
-
-uint cpm2_dpram_offset(void *addr)
-{
-	return (uint)((u_char *)addr -
-			((uint)((cpm2_map_t *)CPM_MAP_ADDR)->im_dprambase));
-}
-EXPORT_SYMBOL(cpm2_dpram_offset);
+EXPORT_SYMBOL(cpm_dpdump);
 
-void *cpm2_dpram_addr(int offset)
+void *cpm_dpram_addr(uint offset)
 {
-	return (void *)&((cpm2_map_t *)CPM_MAP_ADDR)->im_dprambase[offset];
+	return (void *)&cpm2_immr->im_dprambase[offset];
 }
-EXPORT_SYMBOL(cpm2_dpram_addr);
+EXPORT_SYMBOL(cpm_dpram_addr);
diff --git a/arch/ppc/syslib/ibm440gp_common.c b/arch/ppc/syslib/ibm440gp_common.c
index d1ce1435f..0d6be2d6d 100644
--- a/arch/ppc/syslib/ibm440gp_common.c
+++ b/arch/ppc/syslib/ibm440gp_common.c
@@ -30,7 +30,8 @@ void __init ibm440gp_get_clocks(struct ibm44x_clocks* p,
 {
 	u32 cpc0_sys0 = mfdcr(DCRN_CPC0_SYS0);
 	u32 cpc0_cr0 = mfdcr(DCRN_CPC0_CR0);
-	u32 opdv, epdv;
+	u32 opdv = ((cpc0_sys0 >> 10) & 0x3) + 1;
+	u32 epdv = ((cpc0_sys0 >> 8) & 0x3) + 1;
 
 	if (cpc0_sys0 & 0x2){
 		/* Bypass system PLL */
@@ -60,9 +61,6 @@ void __init ibm440gp_get_clocks(struct ibm44x_clocks* p,
 		p->plb = vco / fwdvb;
 	}
 
-	opdv = ((cpc0_sys0 >> 10) & 0x3) + 1;
-	epdv = ((cpc0_sys0 >> 8) & 0x3) + 1;
-
 	p->opb = p->plb / opdv;
 	p->ebc = p->opb / epdv;
 
diff --git a/arch/ppc/syslib/m8260_pci_erratum9.c b/arch/ppc/syslib/m8260_pci_erratum9.c
index ae76a1b52..9c0582d63 100644
--- a/arch/ppc/syslib/m8260_pci_erratum9.c
+++ b/arch/ppc/syslib/m8260_pci_erratum9.c
@@ -89,9 +89,8 @@ void idma_pci9_init(void)
 	volatile cpm2_map_t *immap = cpm2_immr;
 
 	/* allocate IDMA dpram */
-	dpram_offset = cpm2_dpalloc(sizeof(idma_dpram_t), 64);
-	idma_dpram = 
-		(volatile idma_dpram_t *)&immap->im_dprambase[dpram_offset];
+	dpram_offset = cpm_dpalloc(sizeof(idma_dpram_t), 64);
+	idma_dpram = cpm_dpram_addr(dpram_offset); 
 
 	/* initialize the IDMA parameter RAM */
 	memset((void *)idma_dpram, 0, sizeof(idma_dpram_t));
diff --git a/arch/ppc/syslib/m8260_setup.c b/arch/ppc/syslib/m8260_setup.c
index e2c1baaf7..24e1494c1 100644
--- a/arch/ppc/syslib/m8260_setup.c
+++ b/arch/ppc/syslib/m8260_setup.c
@@ -39,12 +39,12 @@
 #include <asm/pgtable.h>
 #include <asm/ide.h>
 #include <asm/mpc8260.h>
-#include <asm/immap_8260.h>
+#include <asm/immap_cpm2.h>
 #include <asm/machdep.h>
 #include <asm/bootinfo.h>
 #include <asm/time.h>
 
-#include "ppc8260_pic.h"
+#include "cpm2_pic.h"
 
 static int m8260_set_rtc_time(unsigned long time);
 static unsigned long m8260_get_rtc_time(void);
@@ -52,14 +52,23 @@ static void m8260_calibrate_decr(void);
 
 unsigned char __res[sizeof(bd_t)];
 
-extern void m8260_cpm_reset(void);
+extern void cpm2_reset(void);
+extern void m8260_find_bridges(void);
+extern void idma_pci9_init(void);
 
 static void __init
 m8260_setup_arch(void)
 {
 	/* Reset the Communication Processor Module.
 	*/
-	m8260_cpm_reset();
+	cpm2_reset();
+#ifdef CONFIG_8260_PCI9
+	/* Initialise IDMA for PCI erratum workaround */
+	idma_pci9_init();
+#endif
+#ifdef CONFIG_PCI_8260
+	m8260_find_bridges();
+#endif
 }
 
 /* The decrementer counts at the system (internal) clock frequency
@@ -142,9 +151,9 @@ m8260_show_percpuinfo(struct seq_file *m, int i)
 
 	bp = (bd_t *)__res;
 
-	seq_printf(m, "core clock\t: %d MHz\n"
-		   "CPM  clock\t: %d MHz\n"
-		   "bus  clock\t: %d MHz\n",
+	seq_printf(m, "core clock\t: %ld MHz\n"
+		   "CPM  clock\t: %ld MHz\n"
+		   "bus  clock\t: %ld MHz\n",
 		   bp->bi_intfreq / 1000000,
 		   bp->bi_cpmfreq / 1000000,
 		   bp->bi_busfreq / 1000000);
@@ -164,15 +173,15 @@ m8260_init_IRQ(void)
 	void cpm_interrupt_init(void);
 
         for ( i = 0 ; i < NR_SIU_INTS ; i++ )
-                irq_desc[i].handler = &ppc8260_pic;
+                irq_desc[i].handler = &cpm2_pic;
 
 	/* Initialize the default interrupt mapping priorities,
 	 * in case the boot rom changed something on us.
 	 */
-	immr->im_intctl.ic_sicr = 0;
-	immr->im_intctl.ic_siprr = 0x05309770;
-	immr->im_intctl.ic_scprrh = 0x05309770;
-	immr->im_intctl.ic_scprrl = 0x05309770;
+	cpm2_immr->im_intctl.ic_sicr = 0;
+	cpm2_immr->im_intctl.ic_siprr = 0x05309770;
+	cpm2_immr->im_intctl.ic_scprrh = 0x05309770;
+	cpm2_immr->im_intctl.ic_scprrl = 0x05309770;
 }
 
 /*
@@ -200,7 +209,7 @@ m8260_map_io(void)
 	uint addr;
 
 	/* Map IMMR region to a 256MB BAT */
-	addr = (immr != NULL) ? (uint)immr : IMAP_ADDR;
+	addr = (cpm2_immr != NULL) ? (uint)cpm2_immr : CPM_MAP_ADDR;
 	io_block_mapping(addr, addr, 0x10000000, _PAGE_IO);
 
 	/* Map I/O region to a 256MB BAT */
@@ -244,7 +253,7 @@ m8260_init(unsigned long r3, unsigned long r4, unsigned long r5,
 	ppc_md.show_percpuinfo		= m8260_show_percpuinfo;
 	ppc_md.irq_canonicalize	= NULL;
 	ppc_md.init_IRQ			= m8260_init_IRQ;
-	ppc_md.get_irq			= m8260_get_irq;
+	ppc_md.get_irq			= cpm2_get_irq;
 	ppc_md.init			= NULL;
 
 	ppc_md.restart			= m8260_restart;
diff --git a/arch/ppc/syslib/mpc10x_common.c b/arch/ppc/syslib/mpc10x_common.c
index 80c71501b..153c811b1 100644
--- a/arch/ppc/syslib/mpc10x_common.c
+++ b/arch/ppc/syslib/mpc10x_common.c
@@ -30,7 +30,60 @@
 #include <asm/pci-bridge.h>
 #include <asm/open_pic.h>
 #include <asm/mpc10x.h>
+#include <asm/ocp.h>
+
+/* The OCP structure is fixed by code below, before OCP initialises.
+   paddr depends on where the board places the EUMB.
+    - fixed in mpc10x_bridge_init().
+   irq depends on two things:
+    > does the board use the EPIC at all? (PCORE does not).
+    > is the EPIC in serial or parallel mode?
+    - fixed in mpc10x_set_openpic().
+*/
+
+#ifdef CONFIG_MPC10X_OPENPIC
+#ifdef CONFIG_EPIC_SERIAL_MODE
+#define EPIC_IRQ_BASE 16
+#else
+#define EPIC_IRQ_BASE 5
+#endif
+#define MPC10X_I2C_IRQ (EPIC_IRQ_BASE + NUM_8259_INTERRUPTS)
+#define MPC10X_DMA0_IRQ (EPIC_IRQ_BASE + 1 + NUM_8259_INTERRUPTS)
+#define MPC10X_DMA1_IRQ (EPIC_IRQ_BASE + 2 + NUM_8259_INTERRUPTS)
+#else
+#define MPC10X_I2C_IRQ OCP_IRQ_NA
+#define MPC10X_DMA0_IRQ OCP_IRQ_NA
+#define MPC10X_DMA1_IRQ OCP_IRQ_NA
+#endif
+
 
+struct ocp_def core_ocp[] = {
+	{ .vendor	= OCP_VENDOR_INVALID
+	}
+};
+
+static struct ocp_fs_i2c_data mpc10x_i2c_data = {
+	.flags		= 0
+};
+static struct ocp_def mpc10x_i2c_ocp = {
+	.vendor		= OCP_VENDOR_MOTOROLA,
+	.function	= OCP_FUNC_IIC,
+	.index		= 0,
+	.irq		= MPC10X_I2C_IRQ,
+	.additions	= &mpc10x_i2c_data
+};
+
+static struct ocp_def mpc10x_dma_ocp[2] = {
+{	.vendor		= OCP_VENDOR_MOTOROLA,
+	.function	= OCP_FUNC_DMA,
+	.index		= 0,
+	.irq		= MPC10X_DMA0_IRQ
+},
+{	.vendor		= OCP_VENDOR_MOTOROLA,
+	.function	= OCP_FUNC_DMA,
+	.index		= 1,
+	.irq		= MPC10X_DMA1_IRQ }
+};
 
 /* Set resources to match bridge memory map */
 void __init
@@ -231,11 +284,21 @@ mpc10x_bridge_init(struct pci_controller *hose,
 					 PCI_DEVFN(0,0),
 					 MPC10X_CFG_EUMBBAR,
 					 phys_eumb_base);
-
-		/* Map EPIC register part of EUMB into vitual memory */
+#ifdef CONFIG_MPC10X_OPENPIC
+		/* Map EPIC register part of EUMB into vitual memory  - PCORE
+		   uses an i8259 instead of EPIC. */
 		OpenPIC_Addr =
 			ioremap(phys_eumb_base + MPC10X_EUMB_EPIC_OFFSET,
 				MPC10X_EUMB_EPIC_SIZE);
+#endif
+		mpc10x_i2c_ocp.paddr = phys_eumb_base + MPC10X_EUMB_I2C_OFFSET;
+		ocp_add_one_device(&mpc10x_i2c_ocp);
+		mpc10x_dma_ocp[0].paddr = phys_eumb_base +
+					MPC10X_EUMB_DMA_OFFSET + 0x100;
+		ocp_add_one_device(&mpc10x_dma_ocp[0]);
+		mpc10x_dma_ocp[1].paddr = phys_eumb_base +
+					MPC10X_EUMB_DMA_OFFSET + 0x200;
+		ocp_add_one_device(&mpc10x_dma_ocp[1]);
 	}
 
 #ifdef CONFIG_MPC10X_STORE_GATHERING
@@ -397,3 +460,17 @@ mpc10x_disable_store_gathering(struct pci_controller *hose)
 
 	return 0;
 }
+
+#ifdef CONFIG_MPC10X_OPENPIC
+void __init mpc10x_set_openpic(void)
+{
+	/* Map external IRQs */
+	openpic_set_sources(0, EPIC_IRQ_BASE, OpenPIC_Addr + 0x10200);
+	/* Skip reserved space and map i2c and DMA Ch[01] */
+	openpic_set_sources(EPIC_IRQ_BASE, 3, OpenPIC_Addr + 0x11020);
+	/* Skip reserved space and map Message Unit Interrupt (I2O) */
+	openpic_set_sources(EPIC_IRQ_BASE + 3, 1, OpenPIC_Addr + 0x110C0);
+
+	openpic_init(NUM_8259_INTERRUPTS);
+}
+#endif
diff --git a/arch/ppc/syslib/open_pic.c b/arch/ppc/syslib/open_pic.c
index 42e71af3e..a19f8c2d9 100644
--- a/arch/ppc/syslib/open_pic.c
+++ b/arch/ppc/syslib/open_pic.c
@@ -28,7 +28,7 @@
 
 #include "open_pic_defs.h"
 
-#ifdef CONFIG_PRPMC800
+#if defined(CONFIG_PRPMC800) || defined(CONFIG_85xx)
 #define OPENPIC_BIG_ENDIAN
 #endif
 
@@ -64,14 +64,14 @@ static irqreturn_t openpic_ipi_action(int cpl, void *dev_id, struct pt_regs *);
 
 /* Timer Interrupts */
 static void openpic_inittimer(u_int timer, u_int pri, u_int vector);
-static void openpic_maptimer(u_int timer, u_int cpumask);
+static void openpic_maptimer(u_int timer, cpumask_t cpumask);
 
 /* Interrupt Sources */
 static void openpic_enable_irq(u_int irq);
 static void openpic_disable_irq(u_int irq);
 static void openpic_initirq(u_int irq, u_int pri, u_int vector, int polarity,
 			    int is_level);
-static void openpic_mapirq(u_int irq, u_int cpumask, u_int keepmask);
+static void openpic_mapirq(u_int irq, cpumask_t cpumask, cpumask_t keepmask);
 
 /*
  * These functions are not used but the code is kept here
@@ -89,17 +89,15 @@ static void openpic_set_sense(u_int irq, int sense);
  */
 static void openpic_end_irq(unsigned int irq_nr);
 static void openpic_ack_irq(unsigned int irq_nr);
-static void openpic_set_affinity(unsigned int irq_nr, unsigned long cpumask);
+static void openpic_set_affinity(unsigned int irq_nr, cpumask_t cpumask);
 
 struct hw_interrupt_type open_pic = {
-	" OpenPIC  ",
-	NULL,
-	NULL,
-	openpic_enable_irq,
-	openpic_disable_irq,
-	openpic_ack_irq,
-	openpic_end_irq,
-	openpic_set_affinity
+	.typename	= " OpenPIC  ",
+	.enable		= openpic_enable_irq,
+	.disable	= openpic_disable_irq,
+	.ack		= openpic_ack_irq,
+	.end		= openpic_end_irq,
+	.set_affinity	= openpic_set_affinity,
 };
 
 #ifdef CONFIG_SMP
@@ -109,14 +107,11 @@ static void openpic_enable_ipi(unsigned int irq_nr);
 static void openpic_disable_ipi(unsigned int irq_nr);
 
 struct hw_interrupt_type open_pic_ipi = {
-	" OpenPIC  ",
-	NULL,
-	NULL,
-	openpic_enable_ipi,
-	openpic_disable_ipi,
-	openpic_ack_ipi,
-	openpic_end_ipi,
-	0
+	.typename	= " OpenPIC  ",
+	.enable		= openpic_enable_ipi,
+	.disable	= openpic_disable_ipi,
+	.ack		= openpic_ack_ipi,
+	.end		= openpic_end_ipi,
 };
 #endif /* CONFIG_SMP */
 
@@ -368,7 +363,7 @@ void __init openpic_init(int offset)
 		/* Disabled, Priority 0 */
 		openpic_inittimer(i, 0, OPENPIC_VEC_TIMER+i+offset);
 		/* No processor */
-		openpic_maptimer(i, 0);
+		openpic_maptimer(i, CPU_MASK_NONE);
 	}
 
 #ifdef CONFIG_SMP
@@ -408,7 +403,7 @@ void __init openpic_init(int offset)
 		openpic_initirq(i, 8, i+offset, (sense & IRQ_POLARITY_MASK),
 				(sense & IRQ_SENSE_MASK));
 		/* Processor 0 */
-		openpic_mapirq(i, 1<<0, 0);
+		openpic_mapirq(i, CPU_MASK_CPU0, CPU_MASK_NONE);
 	}
 
 	/* Init descriptors */
@@ -509,14 +504,17 @@ static void openpic_set_spurious(u_int vec)
 /*
  * Convert a cpu mask from logical to physical cpu numbers.
  */
-static inline u32 physmask(u32 cpumask)
+static inline cpumask_t physmask(cpumask_t cpumask)
 {
 	int i;
-	u32 mask = 0;
+	cpumask_t mask = CPU_MASK_NONE;
+
+	cpus_and(cpumask, cpu_online_map, cpumask);
+
+	for (i = 0; i < NR_CPUS; i++)
+		if (cpu_isset(i, cpumask))
+			cpu_set(smp_hw_index[i], mask);
 
-	for (i = 0; i < NR_CPUS; ++i, cpumask >>= 1)
-		if (cpu_online(i))
-			mask |= (cpumask & 1) << smp_hw_index[i];
 	return mask;
 }
 #else
@@ -556,14 +554,16 @@ static void __init openpic_initipi(u_int ipi, u_int pri, u_int vec)
  *  Externally called, however, it takes an IPI number (0...OPENPIC_NUM_IPI)
  *  and not a system-wide interrupt number
  */
-void openpic_cause_IPI(u_int ipi, u_int cpumask)
+void openpic_cause_IPI(u_int ipi, cpumask_t cpumask)
 {
+	cpumask_t phys;
 	DECL_THIS_CPU;
 
 	CHECK_THIS_CPU;
 	check_arg_ipi(ipi);
+	phys = physmask(cpumask);
 	openpic_write(&OpenPIC->THIS_CPU.IPI_Dispatch(ipi),
-		      physmask(cpumask));
+		      cpus_addr(physmask(cpumask))[0]);
 }
 
 void openpic_request_IPIs(void)
@@ -581,16 +581,16 @@ void openpic_request_IPIs(void)
 	/* IPIs are marked SA_INTERRUPT as they must run with irqs disabled */
 	request_irq(OPENPIC_VEC_IPI+open_pic_irq_offset,
 		    openpic_ipi_action, SA_INTERRUPT,
-		    "IPI0 (call function)", 0);
+		    "IPI0 (call function)", NULL);
 	request_irq(OPENPIC_VEC_IPI+open_pic_irq_offset+1,
 		    openpic_ipi_action, SA_INTERRUPT,
-		    "IPI1 (reschedule)", 0);
+		    "IPI1 (reschedule)", NULL);
 	request_irq(OPENPIC_VEC_IPI+open_pic_irq_offset+2,
 		    openpic_ipi_action, SA_INTERRUPT,
-		    "IPI2 (invalidate tlb)", 0);
+		    "IPI2 (invalidate tlb)", NULL);
 	request_irq(OPENPIC_VEC_IPI+open_pic_irq_offset+3,
 		    openpic_ipi_action, SA_INTERRUPT,
-		    "IPI3 (xmon break)", 0);
+		    "IPI3 (xmon break)", NULL);
 
 	for ( i = 0; i < OPENPIC_NUM_IPI ; i++ )
 		openpic_enable_ipi(OPENPIC_VEC_IPI+open_pic_irq_offset+i);
@@ -607,12 +607,12 @@ void __devinit do_openpic_setup_cpu(void)
 {
 #ifdef CONFIG_IRQ_ALL_CPUS
  	int i;
-	u32 msk;
+	cpumask_t msk = CPU_MASK_NONE;
 #endif
 	spin_lock(&openpic_setup_lock);
 
 #ifdef CONFIG_IRQ_ALL_CPUS
-	msk = 1 << smp_hw_index[smp_processor_id()];
+	cpu_set(smp_hw_index[smp_processor_id()], msk);
 
  	/* let the openpic know we want intrs. default affinity
  	 * is 0xffffffff until changed via /proc
@@ -621,7 +621,7 @@ void __devinit do_openpic_setup_cpu(void)
  	 * in irq.c.
  	 */
  	for (i = 0; i < NumSources; i++)
-		openpic_mapirq(i, msk, ~0U);
+		openpic_mapirq(i, msk, CPU_MASK_ALL);
 #endif /* CONFIG_IRQ_ALL_CPUS */
  	openpic_set_priority(0);
 
@@ -649,11 +649,12 @@ static void __init openpic_inittimer(u_int timer, u_int pri, u_int vec)
 /*
  *  Map a timer interrupt to one or more CPUs
  */
-static void __init openpic_maptimer(u_int timer, u_int cpumask)
+static void __init openpic_maptimer(u_int timer, cpumask_t cpumask)
 {
+	cpumask_t phys = physmask(cpumask);
 	check_arg_timer(timer);
 	openpic_write(&OpenPIC->Global.Timer[timer].Destination,
-		      physmask(cpumask));
+		      cpus_addr(phys)[0]);
 }
 
 /*
@@ -770,13 +771,16 @@ openpic_initirq(u_int irq, u_int pri, u_int vec, int pol, int sense)
 /*
  *  Map an interrupt source to one or more CPUs
  */
-static void openpic_mapirq(u_int irq, u_int physmask, u_int keepmask)
+static void openpic_mapirq(u_int irq, cpumask_t physmask, cpumask_t keepmask)
 {
 	if (ISR[irq] == 0)
 		return;
-	if (keepmask != 0)
-		physmask |= openpic_read(&ISR[irq]->Destination) & keepmask;
-	openpic_write(&ISR[irq]->Destination, physmask);
+	if (!cpus_empty(keepmask)) {
+		cpumask_t irqdest = { .bits[0] = openpic_read(&ISR[irq]->Destination) };
+		cpus_and(irqdest, irqdest, keepmask);
+		cpus_or(physmask, physmask, irqdest);
+	}
+	openpic_write(&ISR[irq]->Destination, cpus_addr(physmask)[0]);
 }
 
 #ifdef notused
@@ -820,9 +824,9 @@ static void openpic_end_irq(unsigned int irq_nr)
 #endif
 }
 
-static void openpic_set_affinity(unsigned int irq_nr, unsigned long cpumask)
+static void openpic_set_affinity(unsigned int irq_nr, cpumask_t cpumask)
 {
-	openpic_mapirq(irq_nr - open_pic_irq_offset, physmask(cpumask), 0);
+	openpic_mapirq(irq_nr - open_pic_irq_offset, physmask(cpumask), CPU_MASK_NONE);
 }
 
 #ifdef CONFIG_SMP
@@ -870,6 +874,7 @@ openpic_get_irq(struct pt_regs *regs)
 void
 smp_openpic_message_pass(int target, int msg, unsigned long data, int wait)
 {
+	cpumask_t mask = CPU_MASK_ALL;
 	/* make sure we're sending something that translates to an IPI */
 	if (msg > 0x3) {
 		printk("SMP %d: smp_message_pass: unknown msg %d\n",
@@ -878,14 +883,14 @@ smp_openpic_message_pass(int target, int msg, unsigned long data, int wait)
 	}
 	switch (target) {
 	case MSG_ALL:
-		openpic_cause_IPI(msg, 0xffffffff);
+		openpic_cause_IPI(msg, mask);
 		break;
 	case MSG_ALL_BUT_SELF:
-		openpic_cause_IPI(msg,
-				  0xffffffff & ~(1 << smp_processor_id()));
+		cpu_clear(smp_processor_id(), mask);
+		openpic_cause_IPI(msg, mask);
 		break;
 	default:
-		openpic_cause_IPI(msg, 1<<target);
+		openpic_cause_IPI(msg, cpumask_of_cpu(target));
 		break;
 	}
 }
diff --git a/arch/ppc/syslib/ppc4xx_dma.c b/arch/ppc/syslib/ppc4xx_dma.c
index 050e12bc5..b2f3d8505 100644
--- a/arch/ppc/syslib/ppc4xx_dma.c
+++ b/arch/ppc/syslib/ppc4xx_dma.c
@@ -1,42 +1,427 @@
 /*
- * Author: Pete Popov <ppopov@mvista.com> or source@mvista.com
+ * arch/ppc/kernel/ppc4xx_dma.c
  *
- * arch/ppc/kernel/ppc405_dma.c
+ * IBM PPC4xx DMA engine core library
  *
- * 2000 (c) MontaVista, Software, Inc.  This file is licensed under
- * the terms of the GNU General Public License version 2.  This program
- * is licensed "as is" without any warranty of any kind, whether express
- * or implied.
+ * Copyright 2000-2004 MontaVista Software Inc.
  *
- * IBM 405 DMA Controller Functions
+ * Cleaned up and converted to new DCR access
+ * Matt Porter <mporter@kernel.crashing.org>
+ *
+ * Original code by Armin Kuster <akuster@mvista.com>
+ * and Pete Popov <ppopov@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.
+ *
+ * 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 <asm/system.h>
-#include <asm/io.h>
 #include <linux/mm.h>
 #include <linux/miscdevice.h>
 #include <linux/init.h>
 #include <linux/module.h>
 
-#include <asm/ppc405_dma.h>
+#include <asm/system.h>
+#include <asm/io.h>
+#include <asm/ppc4xx_dma.h>
+
+ppc_dma_ch_t dma_channels[MAX_PPC4xx_DMA_CHANNELS];
+
+int
+ppc4xx_get_dma_status(void)
+{
+	return (mfdcr(DCRN_DMASR));
+}
+
+void
+ppc4xx_set_src_addr(int dmanr, phys_addr_t src_addr)
+{
+	if (dmanr >= MAX_PPC4xx_DMA_CHANNELS) {
+		printk("set_src_addr: bad channel: %d\n", dmanr);
+		return;
+	}
+
+#ifdef PPC4xx_DMA64BIT
+	mtdcr(DCRN_DMASAH0 + dmanr*2, (u32)(src_addr >> 32));
+#else
+	mtdcr(DCRN_DMASA0 + dmanr*2, (u32)src_addr);
+#endif
+}
+
+void
+ppc4xx_set_dst_addr(int dmanr, phys_addr_t dst_addr)
+{
+	if (dmanr >= MAX_PPC4xx_DMA_CHANNELS) {
+		printk("set_dst_addr: bad channel: %d\n", dmanr);
+		return;
+	}
+
+#ifdef PPC4xx_DMA64BIT
+	mtdcr(DCRN_DMADAH0 + dmanr*2, (u32)(dst_addr >> 32));
+#else
+	mtdcr(DCRN_DMADA0 + dmanr*2, (u32)dst_addr);
+#endif
+}
+
+void
+ppc4xx_enable_dma(unsigned int dmanr)
+{
+	unsigned int control;
+	ppc_dma_ch_t *p_dma_ch = &dma_channels[dmanr];
+	unsigned int status_bits[] = { DMA_CS0 | DMA_TS0 | DMA_CH0_ERR,
+				       DMA_CS1 | DMA_TS1 | DMA_CH1_ERR,
+				       DMA_CS2 | DMA_TS2 | DMA_CH2_ERR,
+				       DMA_CS3 | DMA_TS3 | DMA_CH3_ERR};
+
+	if (p_dma_ch->in_use) {
+		printk("enable_dma: channel %d in use\n", dmanr);
+		return;
+	}
+
+	if (dmanr >= MAX_PPC4xx_DMA_CHANNELS) {
+		printk("enable_dma: bad channel: %d\n", dmanr);
+		return;
+	}
+
+	if (p_dma_ch->mode == DMA_MODE_READ) {
+		/* peripheral to memory */
+		ppc4xx_set_src_addr(dmanr, 0);
+		ppc4xx_set_dst_addr(dmanr, p_dma_ch->addr);
+	} else if (p_dma_ch->mode == DMA_MODE_WRITE) {
+		/* memory to peripheral */
+		ppc4xx_set_src_addr(dmanr, p_dma_ch->addr);
+		ppc4xx_set_dst_addr(dmanr, 0);
+	}
+
+	/* for other xfer modes, the addresses are already set */
+	control = mfdcr(DCRN_DMACR0 + (dmanr * 0x8));
+
+	control &= ~(DMA_TM_MASK | DMA_TD);	/* clear all mode bits */
+	if (p_dma_ch->mode == DMA_MODE_MM) {
+		/* software initiated memory to memory */
+		control |= DMA_ETD_OUTPUT | DMA_TCE_ENABLE;
+	}
+
+	mtdcr(DCRN_DMACR0 + (dmanr * 0x8), control);
+
+	/*
+	 * Clear the CS, TS, RI bits for the channel from DMASR.  This
+	 * has been observed to happen correctly only after the mode and
+	 * ETD/DCE bits in DMACRx are set above.  Must do this before
+	 * enabling the channel.
+	 */
+
+	mtdcr(DCRN_DMASR, status_bits[dmanr]);
+
+	/*
+	 * For device-paced transfers, Terminal Count Enable apparently
+	 * must be on, and this must be turned on after the mode, etc.
+	 * bits are cleared above (at least on Redwood-6).
+	 */
+
+	if ((p_dma_ch->mode == DMA_MODE_MM_DEVATDST) ||
+	    (p_dma_ch->mode == DMA_MODE_MM_DEVATSRC))
+		control |= DMA_TCE_ENABLE;
+
+	/*
+	 * Now enable the channel.
+	 */
+
+	control |= (p_dma_ch->mode | DMA_CE_ENABLE);
+
+	mtdcr(DCRN_DMACR0 + (dmanr * 0x8), control);
+
+	p_dma_ch->in_use = 1;
+}
+
+void
+ppc4xx_disable_dma(unsigned int dmanr)
+{
+	unsigned int control;
+	ppc_dma_ch_t *p_dma_ch = &dma_channels[dmanr];
+
+	if (!p_dma_ch->in_use) {
+		printk("disable_dma: channel %d not in use\n", dmanr);
+		return;
+	}
+
+	if (dmanr >= MAX_PPC4xx_DMA_CHANNELS) {
+		printk("disable_dma: bad channel: %d\n", dmanr);
+		return;
+	}
+
+	control = mfdcr(DCRN_DMACR0 + (dmanr * 0x8));
+	control &= ~DMA_CE_ENABLE;
+	mtdcr(DCRN_DMACR0 + (dmanr * 0x8), control);
+
+	p_dma_ch->in_use = 0;
+}
+
+/*
+ * Sets the dma mode for single DMA transfers only.
+ * For scatter/gather transfers, the mode is passed to the
+ * alloc_dma_handle() function as one of the parameters.
+ *
+ * The mode is simply saved and used later.  This allows
+ * the driver to call set_dma_mode() and set_dma_addr() in
+ * any order.
+ *
+ * Valid mode values are:
+ *
+ * DMA_MODE_READ          peripheral to memory
+ * DMA_MODE_WRITE         memory to peripheral
+ * DMA_MODE_MM            memory to memory
+ * DMA_MODE_MM_DEVATSRC   device-paced memory to memory, device at src
+ * DMA_MODE_MM_DEVATDST   device-paced memory to memory, device at dst
+ */
+int
+ppc4xx_set_dma_mode(unsigned int dmanr, unsigned int mode)
+{
+	ppc_dma_ch_t *p_dma_ch = &dma_channels[dmanr];
+
+	if (dmanr >= MAX_PPC4xx_DMA_CHANNELS) {
+		printk("set_dma_mode: bad channel 0x%x\n", dmanr);
+		return DMA_STATUS_BAD_CHANNEL;
+	}
+
+	p_dma_ch->mode = mode;
+
+	return DMA_STATUS_GOOD;
+}
+
+/*
+ * Sets the DMA Count register. Note that 'count' is in bytes.
+ * However, the DMA Count register counts the number of "transfers",
+ * where each transfer is equal to the bus width.  Thus, count
+ * MUST be a multiple of the bus width.
+ */
+void
+ppc4xx_set_dma_count(unsigned int dmanr, unsigned int count)
+{
+	ppc_dma_ch_t *p_dma_ch = &dma_channels[dmanr];
+
+#ifdef DEBUG_4xxDMA
+	{
+		int error = 0;
+		switch (p_dma_ch->pwidth) {
+		case PW_8:
+			break;
+		case PW_16:
+			if (count & 0x1)
+				error = 1;
+			break;
+		case PW_32:
+			if (count & 0x3)
+				error = 1;
+			break;
+		case PW_64:
+			if (count & 0x7)
+				error = 1;
+			break;
+		default:
+			printk("set_dma_count: invalid bus width: 0x%x\n",
+			       p_dma_ch->pwidth);
+			return;
+		}
+		if (error)
+			printk
+			    ("Warning: set_dma_count count 0x%x bus width %d\n",
+			     count, p_dma_ch->pwidth);
+	}
+#endif
 
+	count = count >> p_dma_ch->shift;
+
+	mtdcr(DCRN_DMACT0 + (dmanr * 0x8), count);
+}
 
 /*
- * Function prototypes
+ *   Returns the number of bytes left to be transfered.
+ *   After a DMA transfer, this should return zero.
+ *   Reading this while a DMA transfer is still in progress will return
+ *   unpredictable results.
  */
+int
+ppc4xx_get_dma_residue(unsigned int dmanr)
+{
+	unsigned int count;
+	ppc_dma_ch_t *p_dma_ch = &dma_channels[dmanr];
 
-int hw_init_dma_channel(unsigned int,  ppc_dma_ch_t *);
-int init_dma_channel(unsigned int);
-int get_channel_config(unsigned int, ppc_dma_ch_t *);
-int set_channel_priority(unsigned int, unsigned int);
-unsigned int get_peripheral_width(unsigned int);
-int alloc_dma_handle(sgl_handle_t *, unsigned int, unsigned int);
-void free_dma_handle(sgl_handle_t);
+	if (dmanr >= MAX_PPC4xx_DMA_CHANNELS) {
+		printk("ppc4xx_get_dma_residue: bad channel 0x%x\n", dmanr);
+		return DMA_STATUS_BAD_CHANNEL;
+	}
 
+	count = mfdcr(DCRN_DMACT0 + (dmanr * 0x8));
 
-ppc_dma_ch_t dma_channels[MAX_405GP_DMA_CHANNELS];
+	return (count << p_dma_ch->shift);
+}
+
+/*
+ * Sets the DMA address for a memory to peripheral or peripheral
+ * to memory transfer.  The address is just saved in the channel
+ * structure for now and used later in enable_dma().
+ */
+void
+ppc4xx_set_dma_addr(unsigned int dmanr, phys_addr_t addr)
+{
+	ppc_dma_ch_t *p_dma_ch = &dma_channels[dmanr];
+
+	if (dmanr >= MAX_PPC4xx_DMA_CHANNELS) {
+		printk("ppc4xx_set_dma_addr: bad channel: %d\n", dmanr);
+		return;
+	}
+
+#ifdef DEBUG_4xxDMA
+	{
+		int error = 0;
+		switch (p_dma_ch->pwidth) {
+		case PW_8:
+			break;
+		case PW_16:
+			if ((unsigned) addr & 0x1)
+				error = 1;
+			break;
+		case PW_32:
+			if ((unsigned) addr & 0x3)
+				error = 1;
+			break;
+		case PW_64:
+			if ((unsigned) addr & 0x7)
+				error = 1;
+			break;
+		default:
+			printk("ppc4xx_set_dma_addr: invalid bus width: 0x%x\n",
+			       p_dma_ch->pwidth);
+			return;
+		}
+		if (error)
+			printk("Warning: ppc4xx_set_dma_addr addr 0x%x bus width %d\n",
+			       addr, p_dma_ch->pwidth);
+	}
+#endif
+
+	/* save dma address and program it later after we know the xfer mode */
+	p_dma_ch->addr = addr;
+}
+
+/*
+ * Sets both DMA addresses for a memory to memory transfer.
+ * For memory to peripheral or peripheral to memory transfers
+ * the function set_dma_addr() should be used instead.
+ */
+void
+ppc4xx_set_dma_addr2(unsigned int dmanr, phys_addr_t src_dma_addr,
+		     phys_addr_t dst_dma_addr)
+{
+	if (dmanr >= MAX_PPC4xx_DMA_CHANNELS) {
+		printk("ppc4xx_set_dma_addr2: bad channel: %d\n", dmanr);
+		return;
+	}
+
+#ifdef DEBUG_4xxDMA
+	{
+		ppc_dma_ch_t *p_dma_ch = &dma_channels[dmanr];
+		int error = 0;
+		switch (p_dma_ch->pwidth) {
+			case PW_8:
+				break;
+			case PW_16:
+				if (((unsigned) src_dma_addr & 0x1) ||
+						((unsigned) dst_dma_addr & 0x1)
+				   )
+					error = 1;
+				break;
+			case PW_32:
+				if (((unsigned) src_dma_addr & 0x3) ||
+						((unsigned) dst_dma_addr & 0x3)
+				   )
+					error = 1;
+				break;
+			case PW_64:
+				if (((unsigned) src_dma_addr & 0x7) ||
+						((unsigned) dst_dma_addr & 0x7)
+				   )
+					error = 1;
+				break;
+			default:
+				printk("ppc4xx_set_dma_addr2: invalid bus width: 0x%x\n",
+						p_dma_ch->pwidth);
+				return;
+		}
+		if (error)
+			printk
+				("Warning: ppc4xx_set_dma_addr2 src 0x%x dst 0x%x bus width %d\n",
+				 src_dma_addr, dst_dma_addr, p_dma_ch->pwidth);
+	}
+#endif
+
+	ppc4xx_set_src_addr(dmanr, src_dma_addr);
+	ppc4xx_set_dst_addr(dmanr, dst_dma_addr);
+}
+
+/*
+ * Enables the channel interrupt.
+ *
+ * If performing a scatter/gatter transfer, this function
+ * MUST be called before calling alloc_dma_handle() and building
+ * the sgl list.  Otherwise, interrupts will not be enabled, if
+ * they were previously disabled.
+ */
+int
+ppc4xx_enable_dma_interrupt(unsigned int dmanr)
+{
+	unsigned int control;
+	ppc_dma_ch_t *p_dma_ch = &dma_channels[dmanr];
+
+	if (dmanr >= MAX_PPC4xx_DMA_CHANNELS) {
+		printk("ppc4xx_enable_dma_interrupt: bad channel: %d\n", dmanr);
+		return DMA_STATUS_BAD_CHANNEL;
+	}
+
+	p_dma_ch->int_enable = 1;
+
+	control = mfdcr(DCRN_DMACR0 + (dmanr * 0x8));
+	control |= DMA_CIE_ENABLE;	/* Channel Interrupt Enable */
+	mtdcr(DCRN_DMACR0 + (dmanr * 0x8), control);
+
+	return DMA_STATUS_GOOD;
+}
+
+/*
+ * Disables the channel interrupt.
+ *
+ * If performing a scatter/gatter transfer, this function
+ * MUST be called before calling alloc_dma_handle() and building
+ * the sgl list.  Otherwise, interrupts will not be disabled, if
+ * they were previously enabled.
+ */
+int
+ppc4xx_disable_dma_interrupt(unsigned int dmanr)
+{
+	unsigned int control;
+	ppc_dma_ch_t *p_dma_ch = &dma_channels[dmanr];
+
+	if (dmanr >= MAX_PPC4xx_DMA_CHANNELS) {
+		printk("ppc4xx_disable_dma_interrupt: bad channel: %d\n", dmanr);
+		return DMA_STATUS_BAD_CHANNEL;
+	}
+
+	p_dma_ch->int_enable = 0;
+
+	control = mfdcr(DCRN_DMACR0 + (dmanr * 0x8));
+	control &= ~DMA_CIE_ENABLE;	/* Channel Interrupt Enable */
+	mtdcr(DCRN_DMACR0 + (dmanr * 0x8), control);
+
+	return DMA_STATUS_GOOD;
+}
 
 /*
  * Configures a DMA channel, including the peripheral bus width, if a
@@ -47,166 +432,112 @@ ppc_dma_ch_t dma_channels[MAX_405GP_DMA_CHANNELS];
  * called from platform specific init code.  The driver should not need to
  * call this function.
  */
-int hw_init_dma_channel(unsigned int dmanr,  ppc_dma_ch_t *p_init)
+int
+ppc4xx_init_dma_channel(unsigned int dmanr, ppc_dma_ch_t * p_init)
 {
-    unsigned int polarity;
-    uint32_t control = 0;
-    ppc_dma_ch_t *p_dma_ch = &dma_channels[dmanr];
-
-#ifdef DEBUG_405DMA
-    if (!p_init) {
-        printk("hw_init_dma_channel: NULL p_init\n");
-        return DMA_STATUS_NULL_POINTER;
-    }
-    if (dmanr >= MAX_405GP_DMA_CHANNELS) {
-        printk("hw_init_dma_channel: bad channel %d\n", dmanr);
-        return DMA_STATUS_BAD_CHANNEL;
-    }
-#endif
+	unsigned int polarity;
+	uint32_t control = 0;
+	ppc_dma_ch_t *p_dma_ch = &dma_channels[dmanr];
+
+	DMA_MODE_READ = (unsigned long) DMA_TD;	/* Peripheral to Memory */
+	DMA_MODE_WRITE = 0;	/* Memory to Peripheral */
+
+	if (!p_init) {
+		printk("ppc4xx_init_dma_channel: NULL p_init\n");
+		return DMA_STATUS_NULL_POINTER;
+	}
+
+	if (dmanr >= MAX_PPC4xx_DMA_CHANNELS) {
+		printk("ppc4xx_init_dma_channel: bad channel %d\n", dmanr);
+		return DMA_STATUS_BAD_CHANNEL;
+	}
 
 #if DCRN_POL > 0
-    polarity = mfdcr(DCRN_POL);
+	polarity = mfdcr(DCRN_POL);
 #else
-    polarity = 0;
+	polarity = 0;
 #endif
 
-    /* Setup the control register based on the values passed to
-     * us in p_init.  Then, over-write the control register with this
-     * new value.
-     */
-
-    control |= (
-                SET_DMA_CIE_ENABLE(p_init->int_enable) | /* interrupt enable         */
-                SET_DMA_BEN(p_init->buffer_enable)     | /* buffer enable            */
-                SET_DMA_ETD(p_init->etd_output)        | /* end of transfer pin      */
-                SET_DMA_TCE(p_init->tce_enable)        | /* terminal count enable    */
-                SET_DMA_PL(p_init->pl)                 | /* peripheral location      */
-                SET_DMA_DAI(p_init->dai)               | /* dest addr increment      */
-                SET_DMA_SAI(p_init->sai)               | /* src addr increment       */
-                SET_DMA_PRIORITY(p_init->cp)           |  /* channel priority        */
-                SET_DMA_PW(p_init->pwidth)             |  /* peripheral/bus width    */
-                SET_DMA_PSC(p_init->psc)               |  /* peripheral setup cycles */
-                SET_DMA_PWC(p_init->pwc)               |  /* peripheral wait cycles  */
-                SET_DMA_PHC(p_init->phc)               |  /* peripheral hold cycles  */
-                SET_DMA_PREFETCH(p_init->pf)              /* read prefetch           */
-                );
-
-    switch (dmanr) {
-        case 0:
-            /* clear all polarity signals and then "or" in new signal levels */
-            polarity &= ~(DMAReq0_ActiveLow | DMAAck0_ActiveLow | EOT0_ActiveLow);
-            polarity |= p_dma_ch->polarity;
-#if DCRN_POL > 0
-            mtdcr(DCRN_POL, polarity);
-#endif
-            mtdcr(DCRN_DMACR0, control);
-            break;
-        case 1:
-            polarity &= ~(DMAReq1_ActiveLow | DMAAck1_ActiveLow | EOT1_ActiveLow);
-            polarity |= p_dma_ch->polarity;
-#if DCRN_POL > 0
-            mtdcr(DCRN_POL, polarity);
-#endif
-            mtdcr(DCRN_DMACR1, control);
-            break;
-        case 2:
-            polarity &= ~(DMAReq2_ActiveLow | DMAAck2_ActiveLow | EOT2_ActiveLow);
-            polarity |= p_dma_ch->polarity;
-#if DCRN_POL > 0
-            mtdcr(DCRN_POL, polarity);
-#endif
-            mtdcr(DCRN_DMACR2, control);
-            break;
-        case 3:
-            polarity &= ~(DMAReq3_ActiveLow | DMAAck3_ActiveLow | EOT3_ActiveLow);
-            polarity |= p_dma_ch->polarity;
+	/* Setup the control register based on the values passed to
+	 * us in p_init.  Then, over-write the control register with this
+	 * new value.
+	 */
+	control |= SET_DMA_CONTROL;
+
+	/* clear all polarity signals and then "or" in new signal levels */
+	polarity &= ~GET_DMA_POLARITY(dmanr);
+	polarity |= p_dma_ch->polarity;
 #if DCRN_POL > 0
-            mtdcr(DCRN_POL, polarity);
+	mtdcr(DCRN_POL, polarity);
 #endif
-            mtdcr(DCRN_DMACR3, control);
-            break;
-        default:
-            return DMA_STATUS_BAD_CHANNEL;
-    }
-
-    /* save these values in our dma channel structure */
-    memcpy(p_dma_ch, p_init, sizeof(ppc_dma_ch_t));
-
-    /*
-     * The peripheral width values written in the control register are:
-     *   PW_8                 0
-     *   PW_16                1
-     *   PW_32                2
-     *   PW_64                3
-     *
-     *   Since the DMA count register takes the number of "transfers",
-     *   we need to divide the count sent to us in certain
-     *   functions by the appropriate number.  It so happens that our
-     *   right shift value is equal to the peripheral width value.
-     */
-    p_dma_ch->shift = p_init->pwidth;
-
-    /*
-     * Save the control word for easy access.
-     */
-    p_dma_ch->control = control;
-
-    mtdcr(DCRN_DMASR, 0xffffffff); /* clear status register */
-    return DMA_STATUS_GOOD;
+	mtdcr(DCRN_DMACR0 + (dmanr * 0x8), control);
+
+	/* save these values in our dma channel structure */
+	memcpy(p_dma_ch, p_init, sizeof (ppc_dma_ch_t));
+
+	/*
+	 * The peripheral width values written in the control register are:
+	 *   PW_8                 0
+	 *   PW_16                1
+	 *   PW_32                2
+	 *   PW_64                3
+	 *
+	 *   Since the DMA count register takes the number of "transfers",
+	 *   we need to divide the count sent to us in certain
+	 *   functions by the appropriate number.  It so happens that our
+	 *   right shift value is equal to the peripheral width value.
+	 */
+	p_dma_ch->shift = p_init->pwidth;
+
+	/*
+	 * Save the control word for easy access.
+	 */
+	p_dma_ch->control = control;
+
+	mtdcr(DCRN_DMASR, 0xffffffff);	/* clear status register */
+	return DMA_STATUS_GOOD;
 }
 
-
-
-
 /*
  * This function returns the channel configuration.
  */
-int get_channel_config(unsigned int dmanr, ppc_dma_ch_t *p_dma_ch)
+int
+ppc4xx_get_channel_config(unsigned int dmanr, ppc_dma_ch_t * p_dma_ch)
 {
-    unsigned int polarity;
-    unsigned int control;
+	unsigned int polarity;
+	unsigned int control;
+
+	if (dmanr >= MAX_PPC4xx_DMA_CHANNELS) {
+		printk("ppc4xx_get_channel_config: bad channel %d\n", dmanr);
+		return DMA_STATUS_BAD_CHANNEL;
+	}
 
 #if DCRN_POL > 0
-    polarity = mfdcr(DCRN_POL);
+	polarity = mfdcr(DCRN_POL);
 #else
-    polarity = 0;
+	polarity = 0;
 #endif
 
-    switch (dmanr) {
-        case 0:
-            p_dma_ch->polarity =
-                polarity & (DMAReq0_ActiveLow | DMAAck0_ActiveLow | EOT0_ActiveLow);
-            control = mfdcr(DCRN_DMACR0);
-            break;
-        case 1:
-            p_dma_ch->polarity =
-                polarity & (DMAReq1_ActiveLow | DMAAck1_ActiveLow | EOT1_ActiveLow);
-            control = mfdcr(DCRN_DMACR1);
-            break;
-        case 2:
-            p_dma_ch->polarity =
-                polarity & (DMAReq2_ActiveLow | DMAAck2_ActiveLow | EOT2_ActiveLow);
-            control = mfdcr(DCRN_DMACR2);
-            break;
-        case 3:
-            p_dma_ch->polarity =
-                polarity & (DMAReq3_ActiveLow | DMAAck3_ActiveLow | EOT3_ActiveLow);
-            control = mfdcr(DCRN_DMACR3);
-            break;
-        default:
-            return DMA_STATUS_BAD_CHANNEL;
-    }
-
-    p_dma_ch->cp = GET_DMA_PRIORITY(control);
-    p_dma_ch->pwidth = GET_DMA_PW(control);
-    p_dma_ch->psc = GET_DMA_PSC(control);
-    p_dma_ch->pwc = GET_DMA_PWC(control);
-    p_dma_ch->phc = GET_DMA_PHC(control);
-    p_dma_ch->pf = GET_DMA_PREFETCH(control);
-    p_dma_ch->int_enable = GET_DMA_CIE_ENABLE(control);
-    p_dma_ch->shift = GET_DMA_PW(control);
-
-    return DMA_STATUS_GOOD;
+	p_dma_ch->polarity = polarity & GET_DMA_POLARITY(dmanr);
+	control = mfdcr(DCRN_DMACR0 + (dmanr * 0x8));
+
+	p_dma_ch->cp = GET_DMA_PRIORITY(control);
+	p_dma_ch->pwidth = GET_DMA_PW(control);
+	p_dma_ch->psc = GET_DMA_PSC(control);
+	p_dma_ch->pwc = GET_DMA_PWC(control);
+	p_dma_ch->phc = GET_DMA_PHC(control);
+	p_dma_ch->ce = GET_DMA_CE_ENABLE(control);
+	p_dma_ch->int_enable = GET_DMA_CIE_ENABLE(control);
+	p_dma_ch->shift = GET_DMA_PW(control);
+
+#ifdef CONFIG_PPC4xx_EDMA
+	p_dma_ch->pf = GET_DMA_PREFETCH(control);
+#else
+	p_dma_ch->ch_enable = GET_DMA_CH(control);
+	p_dma_ch->ece_enable = GET_DMA_ECE(control);
+	p_dma_ch->tcd_disable = GET_DMA_TCD(control);
+#endif
+	return DMA_STATUS_GOOD;
 }
 
 /*
@@ -222,50 +553,28 @@ int get_channel_config(unsigned int dmanr, ppc_dma_ch_t *p_dma_ch)
  * PRIORITY_HIGH
  *
  */
-int set_channel_priority(unsigned int dmanr, unsigned int priority)
+int
+ppc4xx_set_channel_priority(unsigned int dmanr, unsigned int priority)
 {
-    unsigned int control;
-
-#ifdef DEBUG_405DMA
-    if ( (priority != PRIORITY_LOW) &&
-            (priority != PRIORITY_MID_LOW) &&
-            (priority != PRIORITY_MID_HIGH) &&
-            (priority != PRIORITY_HIGH)) {
-        printk("set_channel_priority: bad priority: 0x%x\n", priority);
-    }
-#endif
+	unsigned int control;
 
-    switch (dmanr) {
-        case 0:
-            control = mfdcr(DCRN_DMACR0);
-            control|= SET_DMA_PRIORITY(priority);
-            mtdcr(DCRN_DMACR0, control);
-            break;
-        case 1:
-            control = mfdcr(DCRN_DMACR1);
-            control|= SET_DMA_PRIORITY(priority);
-            mtdcr(DCRN_DMACR1, control);
-            break;
-        case 2:
-            control = mfdcr(DCRN_DMACR2);
-            control|= SET_DMA_PRIORITY(priority);
-            mtdcr(DCRN_DMACR2, control);
-            break;
-        case 3:
-            control = mfdcr(DCRN_DMACR3);
-            control|= SET_DMA_PRIORITY(priority);
-            mtdcr(DCRN_DMACR3, control);
-            break;
-        default:
-#ifdef DEBUG_405DMA
-            printk("set_channel_priority: bad channel: %d\n", dmanr);
-#endif
-            return DMA_STATUS_BAD_CHANNEL;
-    }
-    return DMA_STATUS_GOOD;
-}
+	if (dmanr >= MAX_PPC4xx_DMA_CHANNELS) {
+		printk("ppc4xx_set_channel_priority: bad channel %d\n", dmanr);
+		return DMA_STATUS_BAD_CHANNEL;
+	}
+
+	if ((priority != PRIORITY_LOW) &&
+	    (priority != PRIORITY_MID_LOW) &&
+	    (priority != PRIORITY_MID_HIGH) && (priority != PRIORITY_HIGH)) {
+		printk("ppc4xx_set_channel_priority: bad priority: 0x%x\n", priority);
+	}
 
+	control = mfdcr(DCRN_DMACR0 + (dmanr * 0x8));
+	control |= SET_DMA_PRIORITY(priority);
+	mtdcr(DCRN_DMACR0 + (dmanr * 0x8), control);
 
+	return DMA_STATUS_GOOD;
+}
 
 /*
  * Returns the width of the peripheral attached to this channel. This assumes
@@ -280,213 +589,36 @@ int set_channel_priority(unsigned int dmanr, unsigned int priority)
  *
  *   The function returns 0 on error.
  */
-unsigned int get_peripheral_width(unsigned int dmanr)
+unsigned int
+ppc4xx_get_peripheral_width(unsigned int dmanr)
 {
-    unsigned int control;
-
-    switch (dmanr) {
-        case 0:
-            control = mfdcr(DCRN_DMACR0);
-            break;
-        case 1:
-            control = mfdcr(DCRN_DMACR1);
-            break;
-        case 2:
-            control = mfdcr(DCRN_DMACR2);
-            break;
-        case 3:
-            control = mfdcr(DCRN_DMACR3);
-            break;
-        default:
-#ifdef DEBUG_405DMA
-            printk("get_peripheral_width: bad channel: %d\n", dmanr);
-#endif
-            return 0;
-    }
-    return(GET_DMA_PW(control));
-}
-
-
-
-
-/*
- *   Create a scatter/gather list handle.  This is simply a structure which
- *   describes a scatter/gather list.
- *
- *   A handle is returned in "handle" which the driver should save in order to
- *   be able to access this list later.  A chunk of memory will be allocated
- *   to be used by the API for internal management purposes, including managing
- *   the sg list and allocating memory for the sgl descriptors.  One page should
- *   be more than enough for that purpose.  Perhaps it's a bit wasteful to use
- *   a whole page for a single sg list, but most likely there will be only one
- *   sg list per channel.
- *
- *   Interrupt notes:
- *   Each sgl descriptor has a copy of the DMA control word which the DMA engine
- *   loads in the control register.  The control word has a "global" interrupt
- *   enable bit for that channel. Interrupts are further qualified by a few bits
- *   in the sgl descriptor count register.  In order to setup an sgl, we have to
- *   know ahead of time whether or not interrupts will be enabled at the completion
- *   of the transfers.  Thus, enable_dma_interrupt()/disable_dma_interrupt() MUST
- *   be called before calling alloc_dma_handle().  If the interrupt mode will never
- *   change after powerup, then enable_dma_interrupt()/disable_dma_interrupt()
- *   do not have to be called -- interrupts will be enabled or disabled based
- *   on how the channel was configured after powerup by the hw_init_dma_channel()
- *   function.  Each sgl descriptor will be setup to interrupt if an error occurs;
- *   however, only the last descriptor will be setup to interrupt. Thus, an
- *   interrupt will occur (if interrupts are enabled) only after the complete
- *   sgl transfer is done.
- */
-int alloc_dma_handle(sgl_handle_t *phandle, unsigned int mode, unsigned int dmanr)
-{
-    sgl_list_info_t *psgl;
-    dma_addr_t dma_addr;
-    ppc_dma_ch_t *p_dma_ch = &dma_channels[dmanr];
-    uint32_t sg_command;
-    void *ret;
-
-#ifdef DEBUG_405DMA
-    if (!phandle) {
-            printk("alloc_dma_handle: null handle pointer\n");
-            return DMA_STATUS_NULL_POINTER;
-    }
-    switch (mode) {
-        case DMA_MODE_READ:
-        case DMA_MODE_WRITE:
-        case DMA_MODE_MM:
-        case DMA_MODE_MM_DEVATSRC:
-        case DMA_MODE_MM_DEVATDST:
-            break;
-        default:
-            printk("alloc_dma_handle: bad mode 0x%x\n", mode);
-            return DMA_STATUS_BAD_MODE;
-    }
-    if (dmanr >= MAX_405GP_DMA_CHANNELS) {
-        printk("alloc_dma_handle: invalid channel 0x%x\n", dmanr);
-        return DMA_STATUS_BAD_CHANNEL;
-    }
-#endif
+	unsigned int control;
 
-    /* Get a page of memory, which is zeroed out by pci_alloc_consistent() */
-
-/* wrong not a pci device - armin */
-    /* psgl = (sgl_list_info_t *) pci_alloc_consistent(NULL, SGL_LIST_SIZE, &dma_addr);
-*/
-
-	ret = consistent_alloc(GFP_ATOMIC |GFP_DMA, SGL_LIST_SIZE, &dma_addr);
-	if (ret != NULL) {
-		memset(ret, 0,SGL_LIST_SIZE );
-		psgl = (sgl_list_info_t *) ret;
+	if (dmanr >= MAX_PPC4xx_DMA_CHANNELS) {
+		printk("ppc4xx_get_peripheral_width: bad channel %d\n", dmanr);
+		return DMA_STATUS_BAD_CHANNEL;
 	}
 
+	control = mfdcr(DCRN_DMACR0 + (dmanr * 0x8));
 
-    if (psgl == NULL) {
-        *phandle = (sgl_handle_t)NULL;
-        return DMA_STATUS_OUT_OF_MEMORY;
-    }
-
-    psgl->dma_addr = dma_addr;
-    psgl->dmanr = dmanr;
-
-    /*
-     * Modify and save the control word. These word will get written to each sgl
-     * descriptor.  The DMA engine then loads this control word into the control
-     * register every time it reads a new descriptor.
-     */
-    psgl->control = p_dma_ch->control;
-    psgl->control &= ~(DMA_TM_MASK | DMA_TD);  /* clear all "mode" bits first               */
-    psgl->control |= (mode | DMA_CH_ENABLE);   /* save the control word along with the mode */
-
-    if (p_dma_ch->int_enable) {
-        psgl->control |= DMA_CIE_ENABLE;       /* channel interrupt enabled                 */
-    }
-    else {
-        psgl->control &= ~DMA_CIE_ENABLE;
-    }
-
-#if DCRN_ASGC > 0
-    sg_command = mfdcr(DCRN_ASGC);
-    switch (dmanr) {
-        case 0:
-            sg_command |= SSG0_MASK_ENABLE;
-            break;
-        case 1:
-            sg_command |= SSG1_MASK_ENABLE;
-            break;
-        case 2:
-            sg_command |= SSG2_MASK_ENABLE;
-            break;
-        case 3:
-            sg_command |= SSG3_MASK_ENABLE;
-            break;
-        default:
-#ifdef DEBUG_405DMA
-            printk("alloc_dma_handle: bad channel: %d\n", dmanr);
-#endif
-            free_dma_handle((sgl_handle_t)psgl);
-            *phandle = (sgl_handle_t)NULL;
-            return DMA_STATUS_BAD_CHANNEL;
-    }
-
-    mtdcr(DCRN_ASGC, sg_command);  /* enable writing to this channel's sgl control bits */
-#else
-   (void)sg_command;
-#endif
-    psgl->sgl_control = SG_ERI_ENABLE | SG_LINK;   /* sgl descriptor control bits */
-
-    if (p_dma_ch->int_enable) {
-        if (p_dma_ch->tce_enable)
-            psgl->sgl_control |= SG_TCI_ENABLE;
-        else
-            psgl->sgl_control |= SG_ETI_ENABLE;
-    }
-
-    *phandle = (sgl_handle_t)psgl;
-    return DMA_STATUS_GOOD;
-}
-
-
-
-/*
- * Destroy a scatter/gather list handle that was created by alloc_dma_handle().
- * The list must be empty (contain no elements).
- */
-void free_dma_handle(sgl_handle_t handle)
-{
-    sgl_list_info_t *psgl = (sgl_list_info_t *)handle;
-
-    if (!handle) {
-#ifdef DEBUG_405DMA
-        printk("free_dma_handle: got NULL\n");
-#endif
-        return;
-    }
-    else if (psgl->phead) {
-#ifdef DEBUG_405DMA
-        printk("free_dma_handle: list not empty\n");
-#endif
-        return;
-    }
-    else if (!psgl->dma_addr) { /* should never happen */
-#ifdef DEBUG_405DMA
-        printk("free_dma_handle: no dma address\n");
-#endif
-        return;
-    }
-
-  /* wrong not a PCI device -armin */
-  /*  pci_free_consistent(NULL, SGL_LIST_SIZE, (void *)psgl, psgl->dma_addr); */
-	//	free_pages((unsigned long)psgl, get_order(SGL_LIST_SIZE));
-    	consistent_free((void *)psgl);
-
-
+	return (GET_DMA_PW(control));
 }
 
 
-EXPORT_SYMBOL(hw_init_dma_channel);
-EXPORT_SYMBOL(get_channel_config);
-EXPORT_SYMBOL(set_channel_priority);
-EXPORT_SYMBOL(get_peripheral_width);
-EXPORT_SYMBOL(alloc_dma_handle);
-EXPORT_SYMBOL(free_dma_handle);
+EXPORT_SYMBOL(ppc4xx_init_dma_channel);
+EXPORT_SYMBOL(ppc4xx_get_channel_config);
+EXPORT_SYMBOL(ppc4xx_set_channel_priority);
+EXPORT_SYMBOL(ppc4xx_get_peripheral_width);
 EXPORT_SYMBOL(dma_channels);
+EXPORT_SYMBOL(ppc4xx_set_src_addr);
+EXPORT_SYMBOL(ppc4xx_set_dst_addr);
+EXPORT_SYMBOL(ppc4xx_set_dma_addr);
+EXPORT_SYMBOL(ppc4xx_set_dma_addr2);
+EXPORT_SYMBOL(ppc4xx_enable_dma);
+EXPORT_SYMBOL(ppc4xx_disable_dma);
+EXPORT_SYMBOL(ppc4xx_set_dma_mode);
+EXPORT_SYMBOL(ppc4xx_set_dma_count);
+EXPORT_SYMBOL(ppc4xx_get_dma_residue);
+EXPORT_SYMBOL(ppc4xx_enable_dma_interrupt);
+EXPORT_SYMBOL(ppc4xx_disable_dma_interrupt);
+EXPORT_SYMBOL(ppc4xx_get_dma_status);
diff --git a/arch/ppc/syslib/ppc4xx_pic.c b/arch/ppc/syslib/ppc4xx_pic.c
index 22c9010e5..e6da0a20d 100644
--- a/arch/ppc/syslib/ppc4xx_pic.c
+++ b/arch/ppc/syslib/ppc4xx_pic.c
@@ -234,6 +234,9 @@ ppc4xx_uic_disable_and_ack(unsigned int irq)
 	case 1:
 		mtdcr(DCRN_UIC_ER(UIC1), ppc_cached_irq_mask[word]);
 		mtdcr(DCRN_UIC_SR(UIC1), (1 << (31 - bit)));
+#if (NR_UICS == 2)
+		mtdcr(DCRN_UIC_SR(UIC0), (1 << (31 - UIC0_UIC1NC)));
+#endif
 #if (NR_UICS > 2)
 		mtdcr(DCRN_UIC_SR(UICB), UICB_UIC1NC);
 #endif
@@ -285,6 +288,9 @@ ppc4xx_uic_end(unsigned int irq)
 			break;
 		case 1:
 			mtdcr(DCRN_UIC_SR(UIC1), 1 << (31 - bit));
+#if (NR_UICS == 2)
+			mtdcr(DCRN_UIC_SR(UIC0), (1 << (31 - UIC0_UIC1NC)));
+#endif
 #if (NR_UICS > 2)
 			mtdcr(DCRN_UIC_SR(UICB),  UICB_UIC1NC);
 #endif
@@ -423,7 +429,7 @@ ppc4xx_extpic_init(void)
 		       bit, sense);
 #endif
 		ppc_cached_sense_mask[word] |=
-		    (sense & IRQ_SENSE_MASK) << (31 - bit);
+		    (~sense & IRQ_SENSE_MASK) << (31 - bit);
 		ppc_cached_pol_mask[word] |=
 		    ((sense & IRQ_POLARITY_MASK) >> 1) << (31 - bit);
 		switch (word) {
diff --git a/arch/ppc/syslib/ppc85xx_setup.c b/arch/ppc/syslib/ppc85xx_setup.c
index 33aa1dc93..6ceea97f4 100644
--- a/arch/ppc/syslib/ppc85xx_setup.c
+++ b/arch/ppc/syslib/ppc85xx_setup.c
@@ -30,6 +30,8 @@
 #include <asm/ocp.h>
 #include <asm/kgdb.h>
 
+#include <syslib/ppc85xx_setup.h>
+
 /* Return the amount of memory */
 unsigned long __init
 mpc85xx_find_end_of_memory(void)
@@ -167,17 +169,20 @@ mpc85xx_setup_pci1(struct pci_controller *hose)
 	pci->piwar2 = 0;
 	pci->piwar3 = 0;
 
-	/* Setup 512M Phys:PCI 1:1 outbound mem window @ 0x80000000 */
+	/* Setup Phys:PCI 1:1 outbound mem window @ MPC85XX_PCI1_LOWER_MEM */
 	pci->potar1 = (MPC85XX_PCI1_LOWER_MEM >> 12) & 0x000fffff;
 	pci->potear1 = 0x00000000;
 	pci->powbar1 = (MPC85XX_PCI1_LOWER_MEM >> 12) & 0x000fffff;
-	pci->powar1 = 0x8004401c;	/* Enable, Mem R/W, 512M */
+	/* Enable, Mem R/W */
+	pci->powar1 = 0x80044000 |
+	   (__ilog2(MPC85XX_PCI1_UPPER_MEM - MPC85XX_PCI1_LOWER_MEM + 1) - 1);
 
-	/* Setup 16M outboud IO windows @ 0xe2000000 */
+	/* Setup outboud IO windows @ MPC85XX_PCI1_IO_BASE */
 	pci->potar2 = 0x00000000;
 	pci->potear2 = 0x00000000;
 	pci->powbar2 = (MPC85XX_PCI1_IO_BASE >> 12) & 0x000fffff;
-	pci->powar2 = 0x80088017;	/* Enable, IO R/W, 16M */
+	/* Enable, IO R/W */
+	pci->powar2 = 0x80088000 | (__ilog2(MPC85XX_PCI1_IO_SIZE) - 1);
 
 	/* Setup 2G inbound Memory Window @ 0 */
 	pci->pitar1 = 0x00000000;
@@ -190,7 +195,7 @@ mpc85xx_setup_pci1(struct pci_controller *hose)
 extern int mpc85xx_map_irq(struct pci_dev *dev, unsigned char idsel, unsigned char pin);
 extern int mpc85xx_exclude_device(u_char bus, u_char devfn);
 
-#if CONFIG_85xx_PCI2
+#ifdef CONFIG_85xx_PCI2
 static void __init
 mpc85xx_setup_pci2(struct pci_controller *hose)
 {
@@ -201,10 +206,10 @@ mpc85xx_setup_pci2(struct pci_controller *hose)
 	pci = ioremap(binfo->bi_immr_base + MPC85xx_PCI2_OFFSET,
 		    MPC85xx_PCI2_SIZE);
 
-	early_read_config_word(hose, 0, 0, PCI_COMMAND, &temps);
+	early_read_config_word(hose, hose->bus_offset, 0, PCI_COMMAND, &temps);
 	temps |= PCI_COMMAND_SERR | PCI_COMMAND_MASTER | PCI_COMMAND_MEMORY;
-	early_write_config_word(hose, 0, 0, PCI_COMMAND, temps);
-	early_write_config_byte(hose, 0, 0, PCI_LATENCY_TIMER, 0x80);
+	early_write_config_word(hose, hose->bus_offset, 0, PCI_COMMAND, temps);
+	early_write_config_byte(hose, hose->bus_offset, 0, PCI_LATENCY_TIMER, 0x80);
 
 	/* Disable all windows (except powar0 since its ignored) */
 	pci->powar1 = 0;
@@ -215,17 +220,20 @@ mpc85xx_setup_pci2(struct pci_controller *hose)
 	pci->piwar2 = 0;
 	pci->piwar3 = 0;
 
-	/* Setup 512M Phys:PCI 1:1 outbound mem window @ 0xa0000000 */
+	/* Setup Phys:PCI 1:1 outbound mem window @ MPC85XX_PCI2_LOWER_MEM */
 	pci->potar1 = (MPC85XX_PCI2_LOWER_MEM >> 12) & 0x000fffff;
 	pci->potear1 = 0x00000000;
 	pci->powbar1 = (MPC85XX_PCI2_LOWER_MEM >> 12) & 0x000fffff;
-	pci->powar1 = 0x8004401c;	/* Enable, Mem R/W, 512M */
+	/* Enable, Mem R/W */
+	pci->powar1 = 0x80044000 |
+	   (__ilog2(MPC85XX_PCI1_UPPER_MEM - MPC85XX_PCI1_LOWER_MEM + 1) - 1);
 
-	/* Setup 16M outboud IO windows @ 0xe3000000 */
+	/* Setup outboud IO windows @ MPC85XX_PCI2_IO_BASE */
 	pci->potar2 = 0x00000000;
 	pci->potear2 = 0x00000000;
 	pci->powbar2 = (MPC85XX_PCI2_IO_BASE >> 12) & 0x000fffff;
-	pci->powar2 = 0x80088017;	/* Enable, IO R/W, 16M */
+	/* Enable, IO R/W */
+	pci->powar2 = 0x80088000 | (__ilog2(MPC85XX_PCI1_IO_SIZE) - 1);
 
 	/* Setup 2G inbound Memory Window @ 0 */
 	pci->pitar1 = 0x00000000;
diff --git a/arch/ppc/syslib/ppc85xx_setup.h b/arch/ppc/syslib/ppc85xx_setup.h
index 311b8a418..678325989 100644
--- a/arch/ppc/syslib/ppc85xx_setup.h
+++ b/arch/ppc/syslib/ppc85xx_setup.h
@@ -18,7 +18,6 @@
 #define __PPC_SYSLIB_PPC85XX_SETUP_H
 
 #include <linux/config.h>
-#include <linux/serial.h>
 #include <linux/init.h>
 #include <asm/ppcboot.h>
 
@@ -53,7 +52,9 @@ extern void mpc85xx_setup_hose(void) __init;
 #define RS_TABLE_SIZE  2
 #endif
 
-#define BASE_BAUD 0
+#ifndef BASE_BAUD
+#define BASE_BAUD 115200
+#endif
 
 #define STD_UART_OP(num)					\
 	{ 0, BASE_BAUD, num, MPC85xx_IRQ_DUART,			\
diff --git a/arch/ppc/syslib/prom.c b/arch/ppc/syslib/prom.c
index af9815054..1ddb0c0eb 100644
--- a/arch/ppc/syslib/prom.c
+++ b/arch/ppc/syslib/prom.c
@@ -126,7 +126,7 @@ finish_device_tree(void)
 
 	/* All newworld pmac machines and CHRPs now use the interrupt tree */
 	for (np = allnodes; np != NULL; np = np->allnext) {
-		if (get_property(np, "interrupt-parent", 0)) {
+		if (get_property(np, "interrupt-parent", NULL)) {
 			use_of_interrupt_tree = 1;
 			break;
 		}
@@ -181,8 +181,8 @@ finish_node(struct device_node *np, unsigned long mem_start,
 	struct device_node *child;
 	int *ip;
 
-	np->name = get_property(np, "name", 0);
-	np->type = get_property(np, "device_type", 0);
+	np->name = get_property(np, "name", NULL);
+	np->type = get_property(np, "device_type", NULL);
 
 	if (!np->name)
 		np->name = "<NULL>";
@@ -197,10 +197,10 @@ finish_node(struct device_node *np, unsigned long mem_start,
 		mem_start = finish_node_interrupts(np, mem_start);
 
 	/* Look for #address-cells and #size-cells properties. */
-	ip = (int *) get_property(np, "#address-cells", 0);
+	ip = (int *) get_property(np, "#address-cells", NULL);
 	if (ip != NULL)
 		naddrc = *ip;
-	ip = (int *) get_property(np, "#size-cells", 0);
+	ip = (int *) get_property(np, "#size-cells", NULL);
 	if (ip != NULL)
 		nsizec = *ip;
 
@@ -501,7 +501,7 @@ prom_n_addr_cells(struct device_node* np)
 	do {
 		if (np->parent)
 			np = np->parent;
-		ip = (int *) get_property(np, "#address-cells", 0);
+		ip = (int *) get_property(np, "#address-cells", NULL);
 		if (ip != NULL)
 			return *ip;
 	} while (np->parent);
@@ -516,7 +516,7 @@ prom_n_size_cells(struct device_node* np)
 	do {
 		if (np->parent)
 			np = np->parent;
-		ip = (int *) get_property(np, "#size-cells", 0);
+		ip = (int *) get_property(np, "#size-cells", NULL);
 		if (ip != NULL)
 			return *ip;
 	} while (np->parent);
@@ -836,7 +836,7 @@ find_devices(const char *name)
 			prevp = &np->next;
 		}
 	}
-	*prevp = 0;
+	*prevp = NULL;
 	return head;
 }
 
@@ -855,7 +855,7 @@ find_type_devices(const char *type)
 			prevp = &np->next;
 		}
 	}
-	*prevp = 0;
+	*prevp = NULL;
 	return head;
 }
 
@@ -872,7 +872,7 @@ find_all_nodes(void)
 		*prevp = np;
 		prevp = &np->next;
 	}
-	*prevp = 0;
+	*prevp = NULL;
 	return head;
 }
 
@@ -934,7 +934,7 @@ find_compatible_devices(const char *type, const char *compat)
 			prevp = &np->next;
 		}
 	}
-	*prevp = 0;
+	*prevp = NULL;
 	return head;
 }
 
@@ -1159,7 +1159,7 @@ get_property(struct device_node *np, const char *name, int *lenp)
 				*lenp = pp->length;
 			return pp->value;
 		}
-	return 0;
+	return NULL;
 }
 
 /*
diff --git a/arch/ppc/syslib/prom_init.c b/arch/ppc/syslib/prom_init.c
index 932608875..c9701d5ba 100644
--- a/arch/ppc/syslib/prom_init.c
+++ b/arch/ppc/syslib/prom_init.c
@@ -111,15 +111,15 @@ static void prom_instantiate_rtas(void);
 static void * early_get_property(unsigned long base, unsigned long node,
 				char *prop);
 
-prom_entry prom __initdata = 0;
-ihandle prom_chosen __initdata = 0;
-ihandle prom_stdout __initdata = 0;
+prom_entry prom __initdata;
+ihandle prom_chosen __initdata;
+ihandle prom_stdout __initdata;
 
-char *prom_display_paths[FB_MAX] __initdata = { 0, };
+char *prom_display_paths[FB_MAX] __initdata;
 phandle prom_display_nodes[FB_MAX] __initdata;
-unsigned int prom_num_displays __initdata = 0;
-static char *of_stdout_device __initdata = 0;
-static ihandle prom_disp_node __initdata = 0;
+unsigned int prom_num_displays __initdata;
+char *of_stdout_device __initdata;
+static ihandle prom_disp_node __initdata;
 
 unsigned int rtas_data;   /* physical pointer */
 unsigned int rtas_entry;  /* physical pointer */
@@ -161,7 +161,7 @@ call_prom(const char *service, int nargs, int nret, ...)
 		prom_args.args[i] = va_arg(list, void *);
 	va_end(list);
 	for (i = 0; i < nret; ++i)
-		prom_args.args[i + nargs] = 0;
+		prom_args.args[i + nargs] = NULL;
 	prom(&prom_args);
 	return prom_args.args[nargs];
 }
@@ -181,7 +181,7 @@ call_prom_ret(const char *service, int nargs, int nret, void **rets, ...)
 		prom_args.args[i] = va_arg(list, void *);
 	va_end(list);
 	for (i = 0; i < nret; ++i)
-		prom_args.args[i + nargs] = 0;
+		prom_args.args[i + nargs] = NULL;
 	prom(&prom_args);
 	for (i = 1; i < nret; ++i)
 		rets[i-1] = prom_args.args[nargs + i];
@@ -363,9 +363,9 @@ check_display(unsigned long mem)
 	};
 	const unsigned char *clut;
 
-	prom_disp_node = 0;
+	prom_disp_node = NULL;
 
-	for (node = 0; prom_next_node(&node); ) {
+	for (node = NULL; prom_next_node(&node); ) {
 		type[0] = 0;
 		call_prom("getprop", 4, 1, node, "device_type",
 			  type, sizeof(type));
@@ -546,8 +546,8 @@ copy_device_tree(unsigned long mem_start, unsigned long mem_end)
 	}
 	allnextp = &allnodes;
 	mem_start = ALIGNUL(mem_start);
-	new_start = inspect_node(root, 0, mem_start, mem_end, &allnextp);
-	*allnextp = 0;
+	new_start = inspect_node(root, NULL, mem_start, mem_end, &allnextp);
+	*allnextp = NULL;
 	return new_start;
 }
 
@@ -695,7 +695,7 @@ prom_hold_cpus(unsigned long mem)
 	/* look for cpus */
 	*(unsigned long *)(0x0) = 0;
 	asm volatile("dcbf 0,%0": : "r" (0) : "memory");
-	for (node = 0; prom_next_node(&node); ) {
+	for (node = NULL; prom_next_node(&node); ) {
 		type[0] = 0;
 		call_prom("getprop", 4, 1, node, "device_type",
 			  type, sizeof(type));
@@ -880,10 +880,15 @@ prom_init(int r3, int r4, prom_entry pp)
 	for (i = 0; i < prom_num_displays; ++i)
 		prom_display_paths[i] = PTRUNRELOC(prom_display_paths[i]);
 
+#ifdef CONFIG_SERIAL_CORE_CONSOLE
+	/* Relocate the of stdout for console autodetection */
+	of_stdout_device = PTRUNRELOC(of_stdout_device);
+#endif
+
 	prom_print("returning 0x");
 	prom_print_hex(phys);
 	prom_print("from prom_init\n");
-	prom_stdout = 0;
+	prom_stdout = NULL;
 
 	return phys;
 }
@@ -905,7 +910,7 @@ early_get_property(unsigned long base, unsigned long node, char *prop)
 			return (void *)((unsigned long)pp->value + base);
 		}
 	}
-	return 0;
+	return NULL;
 }
 
 /* Is boot-info compatible ? */
@@ -923,7 +928,7 @@ bootx_init(unsigned long r4, unsigned long phys)
 
 	boot_infos = PTRUNRELOC(bi);
 	if (!BOOT_INFO_IS_V2_COMPATIBLE(bi))
-		bi->logicalDisplayBase = 0;
+		bi->logicalDisplayBase = NULL;
 
 #ifdef CONFIG_BOOTX_TEXT
 	btext_init(bi);
diff --git a/arch/ppc/xmon/ppc-opc.c b/arch/ppc/xmon/ppc-opc.c
index 52d8bacf8..533a6c997 100644
--- a/arch/ppc/xmon/ppc-opc.c
+++ b/arch/ppc/xmon/ppc-opc.c
@@ -82,12 +82,12 @@ const struct powerpc_operand powerpc_operands[] =
   /* The zero index is used to indicate the end of the list of
      operands.  */
 #define UNUSED (0)
-  { 0, 0, 0, 0, 0 },
+  { 0, 0, NULL, NULL, 0 },
 
   /* The BA field in an XL form instruction.  */
 #define BA (1)
 #define BA_MASK (0x1f << 16)
-  { 5, 16, 0, 0, PPC_OPERAND_CR },
+  { 5, 16, NULL, NULL, PPC_OPERAND_CR },
 
   /* The BA field in an XL form instruction when it must be the same
      as the BT field in the same instruction.  */
@@ -97,7 +97,7 @@ const struct powerpc_operand powerpc_operands[] =
   /* The BB field in an XL form instruction.  */
 #define BB (3)
 #define BB_MASK (0x1f << 11)
-  { 5, 11, 0, 0, PPC_OPERAND_CR },
+  { 5, 11, NULL, NULL, PPC_OPERAND_CR },
 
   /* The BB field in an XL form instruction when it must be the same
      as the BA field in the same instruction.  */
@@ -140,21 +140,21 @@ const struct powerpc_operand powerpc_operands[] =
 
   /* The BF field in an X or XL form instruction.  */
 #define BF (11)
-  { 3, 23, 0, 0, PPC_OPERAND_CR },
+  { 3, 23, NULL, NULL, PPC_OPERAND_CR },
 
   /* An optional BF field.  This is used for comparison instructions,
      in which an omitted BF field is taken as zero.  */
 #define OBF (12)
-  { 3, 23, 0, 0, PPC_OPERAND_CR | PPC_OPERAND_OPTIONAL },
+  { 3, 23, NULL, NULL, PPC_OPERAND_CR | PPC_OPERAND_OPTIONAL },
 
   /* The BFA field in an X or XL form instruction.  */
 #define BFA (13)
-  { 3, 18, 0, 0, PPC_OPERAND_CR },
+  { 3, 18, NULL, NULL, PPC_OPERAND_CR },
 
   /* The BI field in a B form or XL form instruction.  */
 #define BI (14)
 #define BI_MASK (0x1f << 16)
-  { 5, 16, 0, 0, PPC_OPERAND_CR },
+  { 5, 16, NULL, NULL, PPC_OPERAND_CR },
 
   /* The BO field in a B form instruction.  Certain values are
      illegal.  */
@@ -169,20 +169,20 @@ const struct powerpc_operand powerpc_operands[] =
 
   /* The BT field in an X or XL form instruction.  */
 #define BT (17)
-  { 5, 21, 0, 0, PPC_OPERAND_CR },
+  { 5, 21, NULL, NULL, PPC_OPERAND_CR },
 
   /* The condition register number portion of the BI field in a B form
      or XL form instruction.  This is used for the extended
      conditional branch mnemonics, which set the lower two bits of the
      BI field.  This field is optional.  */
 #define CR (18)
-  { 3, 18, 0, 0, PPC_OPERAND_CR | PPC_OPERAND_OPTIONAL },
+  { 3, 18, NULL, NULL, PPC_OPERAND_CR | PPC_OPERAND_OPTIONAL },
 
   /* The D field in a D form instruction.  This is a displacement off
      a register, and implies that the next operand is a register in
      parentheses.  */
 #define D (19)
-  { 16, 0, 0, 0, PPC_OPERAND_PARENS | PPC_OPERAND_SIGNED },
+  { 16, 0, NULL, NULL, PPC_OPERAND_PARENS | PPC_OPERAND_SIGNED },
 
   /* The DS field in a DS form instruction.  This is like D, but the
      lower two bits are forced to zero.  */
@@ -191,49 +191,49 @@ const struct powerpc_operand powerpc_operands[] =
 
   /* The FL1 field in a POWER SC form instruction.  */
 #define FL1 (21)
-  { 4, 12, 0, 0, 0 },
+  { 4, 12, NULL, NULL, 0 },
 
   /* The FL2 field in a POWER SC form instruction.  */
 #define FL2 (22)
-  { 3, 2, 0, 0, 0 },
+  { 3, 2, NULL, NULL, 0 },
 
   /* The FLM field in an XFL form instruction.  */
 #define FLM (23)
-  { 8, 17, 0, 0, 0 },
+  { 8, 17, NULL, NULL, 0 },
 
   /* The FRA field in an X or A form instruction.  */
 #define FRA (24)
 #define FRA_MASK (0x1f << 16)
-  { 5, 16, 0, 0, PPC_OPERAND_FPR },
+  { 5, 16, NULL, NULL, PPC_OPERAND_FPR },
 
   /* The FRB field in an X or A form instruction.  */
 #define FRB (25)
 #define FRB_MASK (0x1f << 11)
-  { 5, 11, 0, 0, PPC_OPERAND_FPR },
+  { 5, 11, NULL, NULL, PPC_OPERAND_FPR },
 
   /* The FRC field in an A form instruction.  */
 #define FRC (26)
 #define FRC_MASK (0x1f << 6)
-  { 5, 6, 0, 0, PPC_OPERAND_FPR },
+  { 5, 6, NULL, NULL, PPC_OPERAND_FPR },
 
   /* The FRS field in an X form instruction or the FRT field in a D, X
      or A form instruction.  */
 #define FRS (27)
 #define FRT (FRS)
-  { 5, 21, 0, 0, PPC_OPERAND_FPR },
+  { 5, 21, NULL, NULL, PPC_OPERAND_FPR },
 
   /* The FXM field in an XFX instruction.  */
 #define FXM (28)
 #define FXM_MASK (0xff << 12)
-  { 8, 12, 0, 0, 0 },
+  { 8, 12, NULL, NULL, 0 },
 
   /* The L field in a D or X form instruction.  */
 #define L (29)
-  { 1, 21, 0, 0, PPC_OPERAND_OPTIONAL },
+  { 1, 21, NULL, NULL, PPC_OPERAND_OPTIONAL },
 
   /* The LEV field in a POWER SC form instruction.  */
 #define LEV (30)
-  { 7, 5, 0, 0, 0 },
+  { 7, 5, NULL, NULL, 0 },
 
   /* The LI field in an I form instruction.  The lower two bits are
      forced to zero.  */
@@ -248,19 +248,19 @@ const struct powerpc_operand powerpc_operands[] =
   /* The MB field in an M form instruction.  */
 #define MB (33)
 #define MB_MASK (0x1f << 6)
-  { 5, 6, 0, 0, 0 },
+  { 5, 6, NULL, NULL, 0 },
 
   /* The ME field in an M form instruction.  */
 #define ME (34)
 #define ME_MASK (0x1f << 1)
-  { 5, 1, 0, 0, 0 },
+  { 5, 1, NULL, NULL, 0 },
 
   /* The MB and ME fields in an M form instruction expressed a single
      operand which is a bitmask indicating which bits to select.  This
      is a two operand form using PPC_OPERAND_NEXT.  See the
      description in opcode/ppc.h for what this means.  */
 #define MBE (35)
-  { 5, 6, 0, 0, PPC_OPERAND_OPTIONAL | PPC_OPERAND_NEXT },
+  { 5, 6, NULL, NULL, PPC_OPERAND_OPTIONAL | PPC_OPERAND_NEXT },
   { 32, 0, insert_mbe, extract_mbe, 0 },
 
   /* The MB or ME field in an MD or MDS form instruction.  The high
@@ -284,29 +284,29 @@ const struct powerpc_operand powerpc_operands[] =
   /* The RA field in an D, DS, X, XO, M, or MDS form instruction.  */
 #define RA (40)
 #define RA_MASK (0x1f << 16)
-  { 5, 16, 0, 0, PPC_OPERAND_GPR },
+  { 5, 16, NULL, NULL, PPC_OPERAND_GPR },
 
   /* The RA field in a D or X form instruction which is an updating
      load, which means that the RA field may not be zero and may not
      equal the RT field.  */
 #define RAL (41)
-  { 5, 16, insert_ral, 0, PPC_OPERAND_GPR },
+  { 5, 16, insert_ral, NULL, PPC_OPERAND_GPR },
 
   /* The RA field in an lmw instruction, which has special value
      restrictions.  */
 #define RAM (42)
-  { 5, 16, insert_ram, 0, PPC_OPERAND_GPR },
+  { 5, 16, insert_ram, NULL, PPC_OPERAND_GPR },
 
   /* The RA field in a D or X form instruction which is an updating
      store or an updating floating point load, which means that the RA
      field may not be zero.  */
 #define RAS (43)
-  { 5, 16, insert_ras, 0, PPC_OPERAND_GPR },
+  { 5, 16, insert_ras, NULL, PPC_OPERAND_GPR },
 
   /* The RB field in an X, XO, M, or MDS form instruction.  */
 #define RB (44)
 #define RB_MASK (0x1f << 11)
-  { 5, 11, 0, 0, PPC_OPERAND_GPR },
+  { 5, 11, NULL, NULL, PPC_OPERAND_GPR },
 
   /* The RB field in an X form instruction when it must be the same as
      the RS field in the instruction.  This is used for extended
@@ -320,12 +320,12 @@ const struct powerpc_operand powerpc_operands[] =
 #define RS (46)
 #define RT (RS)
 #define RT_MASK (0x1f << 21)
-  { 5, 21, 0, 0, PPC_OPERAND_GPR },
+  { 5, 21, NULL, NULL, PPC_OPERAND_GPR },
 
   /* The SH field in an X or M form instruction.  */
 #define SH (47)
 #define SH_MASK (0x1f << 11)
-  { 5, 11, 0, 0, 0 },
+  { 5, 11, NULL, NULL, 0 },
 
   /* The SH field in an MD form instruction.  This is split.  */
 #define SH6 (48)
@@ -334,12 +334,12 @@ const struct powerpc_operand powerpc_operands[] =
 
   /* The SI field in a D form instruction.  */
 #define SI (49)
-  { 16, 0, 0, 0, PPC_OPERAND_SIGNED },
+  { 16, 0, NULL, NULL, PPC_OPERAND_SIGNED },
 
   /* The SI field in a D form instruction when we accept a wide range
      of positive values.  */
 #define SISIGNOPT (50)
-  { 16, 0, 0, 0, PPC_OPERAND_SIGNED | PPC_OPERAND_SIGNOPT },
+  { 16, 0, NULL, NULL, PPC_OPERAND_SIGNED | PPC_OPERAND_SIGNOPT },
 
   /* The SPR field in an XFX form instruction.  This is flipped--the
      lower 5 bits are stored in the upper 5 and vice- versa.  */
@@ -350,20 +350,20 @@ const struct powerpc_operand powerpc_operands[] =
   /* The BAT index number in an XFX form m[ft]ibat[lu] instruction.  */
 #define SPRBAT (52)
 #define SPRBAT_MASK (0x3 << 17)
-  { 2, 17, 0, 0, 0 },
+  { 2, 17, NULL, NULL, 0 },
 
   /* The SPRG register number in an XFX form m[ft]sprg instruction.  */
 #define SPRG (53)
 #define SPRG_MASK (0x3 << 16)
-  { 2, 16, 0, 0, 0 },
+  { 2, 16, NULL, NULL, 0 },
 
   /* The SR field in an X form instruction.  */
 #define SR (54)
-  { 4, 16, 0, 0, 0 },
+  { 4, 16, NULL, NULL, 0 },
 
   /* The SV field in a POWER SC form instruction.  */
 #define SV (55)
-  { 14, 2, 0, 0, 0 },
+  { 14, 2, NULL, NULL, 0 },
 
   /* The TBR field in an XFX form instruction.  This is like the SPR
      field, but it is optional.  */
@@ -373,15 +373,15 @@ const struct powerpc_operand powerpc_operands[] =
   /* The TO field in a D or X form instruction.  */
 #define TO (57)
 #define TO_MASK (0x1f << 21)
-  { 5, 21, 0, 0, 0 },
+  { 5, 21, NULL, NULL, 0 },
 
   /* The U field in an X form instruction.  */
 #define U (58)
-  { 4, 12, 0, 0, 0 },
+  { 4, 12, NULL, NULL, 0 },
 
   /* The UI field in a D form instruction.  */
 #define UI (59)
-  { 16, 0, 0, 0, 0 },
+  { 16, 0, NULL, NULL, 0 },
 };
 
 /* The functions used to insert and extract complicated operands.  */
diff --git a/arch/ppc/xmon/start.c b/arch/ppc/xmon/start.c
index 802775f01..d88096739 100644
--- a/arch/ppc/xmon/start.c
+++ b/arch/ppc/xmon/start.c
@@ -448,13 +448,13 @@ xmon_init_scc(void)
 	scc_initialized = 1;
 	if (via_modem) {
 		for (;;) {
-			xmon_write(0, "ATE1V1\r", 7);
+			xmon_write(NULL, "ATE1V1\r", 7);
 			if (xmon_expect("OK", 5)) {
-				xmon_write(0, "ATA\r", 4);
+				xmon_write(NULL, "ATA\r", 4);
 				if (xmon_expect("CONNECT", 40))
 					break;
 			}
-			xmon_write(0, "+++", 3);
+			xmon_write(NULL, "+++", 3);
 			xmon_expect("OK", 3);
 		}
 	}
@@ -618,7 +618,7 @@ xmon_fgets(char *str, int nb, void *f)
 	c = xmon_getchar();
 	if (c == -1) {
 	    if (p == str)
-		return 0;
+		return NULL;
 	    break;
 	}
 	*p++ = c;
diff --git a/arch/ppc/xmon/xmon.c b/arch/ppc/xmon/xmon.c
index 191bf2673..e7fe8d4c2 100644
--- a/arch/ppc/xmon/xmon.c
+++ b/arch/ppc/xmon/xmon.c
@@ -239,7 +239,7 @@ xmon(struct pt_regs *excp)
 		set_backlight_level(BACKLIGHT_MAX);
 		sync();
 	}
-	debugger_fault_handler = 0;
+	debugger_fault_handler = NULL;
 #endif	/* CONFIG_PMAC_BACKLIGHT */
 	cmd = cmds(excp);
 	if (cmd == 's') {
@@ -253,7 +253,7 @@ xmon(struct pt_regs *excp)
 		insert_bpts();
 	}
 	xmon_leave();
-	xmon_regs[smp_processor_id()] = 0;
+	xmon_regs[smp_processor_id()] = NULL;
 #ifdef CONFIG_SMP
 	clear_bit(0, &got_xmon);
 	clear_bit(smp_processor_id(), &cpus_in_xmon);
@@ -352,7 +352,7 @@ at_breakpoint(unsigned pc)
 	for (i = 0; i < NBPTS; ++i, ++bp)
 		if (bp->enabled && pc == bp->address)
 			return bp;
-	return 0;
+	return NULL;
 }
 
 static void
@@ -962,7 +962,7 @@ print_sysmap(void)
 			xmon_puts(sysmap);
 			sync();
 		}
-		debugger_fault_handler = 0;
+		debugger_fault_handler = NULL;
 	}
 	else
 		printf("No System.map\n");
@@ -1203,7 +1203,7 @@ mread(unsigned adrs, void *buf, int size)
 		__delay(200);
 		n = size;
 	}
-	debugger_fault_handler = 0;
+	debugger_fault_handler = NULL;
 	return n;
 }
 
@@ -1233,7 +1233,7 @@ mwrite(unsigned adrs, void *buf, int size)
 	} else {
 		printf("*** Error writing address %x\n", adrs + n);
 	}
-	debugger_fault_handler = 0;
+	debugger_fault_handler = NULL;
 	return n;
 }
 
@@ -1673,7 +1673,7 @@ void proccall(void)
 	} else {
 		printf("*** %x exception occurred\n", fault_except);
 	}
-	debugger_fault_handler = 0;
+	debugger_fault_handler = NULL;
 }
 
 /* Input scanning routines */
@@ -1886,7 +1886,7 @@ sysmap_lookup(void)
 				} while (cur);
 				sync();
 			}
-			debugger_fault_handler = 0;
+			debugger_fault_handler = NULL;
 			termch = 0;
 			break;
 	}
@@ -1939,7 +1939,7 @@ xmon_find_symbol(unsigned long addr, unsigned long* saddr)
 				*(ep++) = 0;
 				if (saddr)
 					*saddr = prev;
-				debugger_fault_handler = 0;
+				debugger_fault_handler = NULL;
 				return rbuffer;
 			}
 			prev = next;
@@ -1951,7 +1951,7 @@ xmon_find_symbol(unsigned long addr, unsigned long* saddr)
 bail:
 		sync();
 	}
-	debugger_fault_handler = 0;
+	debugger_fault_handler = NULL;
 	return NULL;
 }
 
@@ -2003,6 +2003,6 @@ xmon_symbol_to_addr(char* symbol)
 		}
 		sync();
 	}
-	debugger_fault_handler = 0;
+	debugger_fault_handler = NULL;
 	return result;
 }		
diff --git a/arch/ppc64/Kconfig b/arch/ppc64/Kconfig
index 8d5e077fd..e9431d81a 100644
--- a/arch/ppc64/Kconfig
+++ b/arch/ppc64/Kconfig
@@ -198,7 +198,6 @@ config SCHED_SMT
 
 config PREEMPT
 	bool "Preemptible Kernel"
-	depends on BROKEN
 	help
 	  This option reduces the latency of the kernel when reacting to
 	  real-time or interactive events by allowing a low priority process to
@@ -226,7 +225,7 @@ config SCANLOG
 	depends on PPC_RTAS
 
 config LPARCFG
-	bool "LPAR Configuration Data"
+	tristate "LPAR Configuration Data"
 	help
 	Provide system capacity information via human readable 
 	<key word>=<value> pairs through a /proc/ppc64/lparcfg interface.
@@ -425,8 +424,6 @@ config IRQSTACKS
 	  for handling hard and soft interrupts.  This can help avoid
 	  overflowing the process kernel stacks.
 	  
-endmenu
-
 config SPINLINE
 	bool "Inline spinlock code at each call site"
 	depends on SMP && !PPC_SPLPAR && !PPC_ISERIES
@@ -437,6 +434,8 @@ config SPINLINE
 
 	  If in doubt, say N.
 
+endmenu
+
 source "kernel/vserver/Kconfig"
 
 source "security/Kconfig"
diff --git a/arch/ppc64/boot/div64.S b/arch/ppc64/boot/div64.S
index f3224d2d6..38f7e466d 100644
--- a/arch/ppc64/boot/div64.S
+++ b/arch/ppc64/boot/div64.S
@@ -14,7 +14,6 @@
  * 2 of the License, or (at your option) any later version.
  */
 #include <asm/ppc_asm.h>
-#include <asm/processor.h>
 
 	.globl __div64_32
 __div64_32:
diff --git a/arch/ppc64/configs/g5_defconfig b/arch/ppc64/configs/g5_defconfig
index 5b4e8f7f5..0485eed76 100644
--- a/arch/ppc64/configs/g5_defconfig
+++ b/arch/ppc64/configs/g5_defconfig
@@ -448,7 +448,6 @@ CONFIG_LLC=y
 # 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
 
 #
diff --git a/arch/ppc64/configs/iSeries_defconfig b/arch/ppc64/configs/iSeries_defconfig
index fdb3606aa..63ec73f75 100644
--- a/arch/ppc64/configs/iSeries_defconfig
+++ b/arch/ppc64/configs/iSeries_defconfig
@@ -345,7 +345,6 @@ CONFIG_LLC=y
 # 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
 
 #
diff --git a/arch/ppc64/configs/pSeries_defconfig b/arch/ppc64/configs/pSeries_defconfig
index 0c4abb1d0..f5503873a 100644
--- a/arch/ppc64/configs/pSeries_defconfig
+++ b/arch/ppc64/configs/pSeries_defconfig
@@ -413,7 +413,6 @@ CONFIG_LLC=y
 # 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
 
 #
diff --git a/arch/ppc64/defconfig b/arch/ppc64/defconfig
index 0c4abb1d0..f5503873a 100644
--- a/arch/ppc64/defconfig
+++ b/arch/ppc64/defconfig
@@ -413,7 +413,6 @@ CONFIG_LLC=y
 # 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
 
 #
diff --git a/arch/ppc64/kernel/ItLpQueue.c b/arch/ppc64/kernel/ItLpQueue.c
index 71ce7d6b2..6f21bde21 100644
--- a/arch/ppc64/kernel/ItLpQueue.c
+++ b/arch/ppc64/kernel/ItLpQueue.c
@@ -161,7 +161,7 @@ unsigned ItLpQueue_process( struct ItLpQueue * lpQueue, struct pt_regs *regs )
 	mb();
 	clear_inUse( lpQueue );
 
-	get_paca()->lpEvent_count += numIntsProcessed;
+	get_paca()->lpevent_count += numIntsProcessed;
 
 	return numIntsProcessed;
 }
diff --git a/arch/ppc64/kernel/LparData.c b/arch/ppc64/kernel/LparData.c
index 08f72c5aa..73d919bf8 100644
--- a/arch/ppc64/kernel/LparData.c
+++ b/arch/ppc64/kernel/LparData.c
@@ -10,6 +10,7 @@
 #include <asm/page.h>
 #include <stddef.h>
 #include <linux/threads.h>
+#include <linux/module.h>
 #include <asm/processor.h>
 #include <asm/ptrace.h>
 #include <asm/naca.h>
@@ -123,12 +124,14 @@ struct ItLpNaca itLpNaca = {
 		(u64)InstructionAccessSLB_Iseries /* 0x480 I-SLB */
 	}
 };
+EXPORT_SYMBOL(itLpNaca);
 
 /* May be filled in by the hypervisor so cannot end up in the BSS */
 struct ItIplParmsReal xItIplParmsReal __attribute__((__section__(".data"))); 
 
 /* May be filled in by the hypervisor so cannot end up in the BSS */
 struct ItExtVpdPanel xItExtVpdPanel __attribute__((__section__(".data")));
+EXPORT_SYMBOL(xItExtVpdPanel);
 
 #define maxPhysicalProcessors 32
 
diff --git a/arch/ppc64/kernel/Makefile b/arch/ppc64/kernel/Makefile
index c36dd89a4..c5dd7e13b 100644
--- a/arch/ppc64/kernel/Makefile
+++ b/arch/ppc64/kernel/Makefile
@@ -15,14 +15,11 @@ obj-y               :=	setup.o entry.o traps.o irq.o idle.o dma.o \
 
 obj-$(CONFIG_PPC_OF) +=	of_device.o
 
-obj-$(CONFIG_PCI)	+= pci.o pci_dn.o pci_iommu.o
+pci-obj-$(CONFIG_PPC_ISERIES)	+= iSeries_pci.o iSeries_pci_reset.o \
+				     iSeries_IoMmTable.o
+pci-obj-$(CONFIG_PPC_PSERIES)	+= pci_dn.o pci_dma_direct.o
 
-ifdef CONFIG_PPC_ISERIES
-obj-$(CONFIG_PCI)	+= iSeries_pci.o iSeries_pci_reset.o \
-			     iSeries_IoMmTable.o 
-else
-obj-$(CONFIG_PCI)	+= pci_dma_direct.o
-endif
+obj-$(CONFIG_PCI)	+= pci.o pci_iommu.o $(pci-obj-y)
 
 obj-$(CONFIG_PPC_ISERIES) += iSeries_irq.o \
 			     iSeries_VpdInfo.o XmPciLpEvent.o \
@@ -46,6 +43,7 @@ obj-$(CONFIG_VIOPATH)		+= viopath.o
 obj-$(CONFIG_LPARCFG)		+= lparcfg.o
 obj-$(CONFIG_HVC_CONSOLE)	+= hvconsole.o
 obj-$(CONFIG_BOOTX_TEXT)	+= btext.o
+obj-$(CONFIG_HVCS)		+= hvcserver.o
 
 obj-$(CONFIG_PPC_PMAC)		+= pmac_setup.o pmac_feature.o pmac_pci.o \
 				   pmac_time.o pmac_nvram.o pmac_low_i2c.o \
@@ -56,4 +54,6 @@ ifdef CONFIG_SMP
 obj-$(CONFIG_PPC_PMAC)		+= pmac_smp.o smp-tbsync.o
 endif
 
+obj-$(CONFIG_ALTIVEC)		+= vecemu.o vector.o
+
 CFLAGS_ioctl32.o += -Ifs/
diff --git a/arch/ppc64/kernel/align.c b/arch/ppc64/kernel/align.c
index 58a5eb9e3..853b3ae74 100644
--- a/arch/ppc64/kernel/align.c
+++ b/arch/ppc64/kernel/align.c
@@ -22,8 +22,6 @@
 #include <asm/cache.h>
 #include <asm/cputable.h>
 
-void disable_kernel_fp(void); /* asm function from head.S */
-
 struct aligninfo {
 	unsigned char len;
 	unsigned char flags;
@@ -280,8 +278,11 @@ fix_alignment(struct pt_regs *regs)
 	}
 
 	/* Force the fprs into the save area so we can reference them */
-	if ((flags & F) && (regs->msr & MSR_FP))
-		giveup_fpu(current);
+	if (flags & F) {
+		if (!user_mode(regs))
+			return 0;
+		flush_fp_to_thread(current);
+	}
 	
 	/* If we are loading, get the data from user space */
 	if (flags & LD) {
@@ -310,9 +311,11 @@ fix_alignment(struct pt_regs *regs)
 		if (flags & F) {
 			if (nb == 4) {
 				/* Doing stfs, have to convert to single */
+				preempt_disable();
 				enable_kernel_fp();
 				cvt_df(&current->thread.fpr[reg], (float *)&data.v[4], &current->thread.fpscr);
 				disable_kernel_fp();
+				preempt_enable();
 			}
 			else
 				data.dd = current->thread.fpr[reg];
@@ -344,9 +347,11 @@ fix_alignment(struct pt_regs *regs)
 		if (flags & F) {
 			if (nb == 4) {
 				/* Doing lfs, have to convert to double */
+				preempt_disable();
 				enable_kernel_fp();
 				cvt_fd((float *)&data.v[4], &current->thread.fpr[reg], &current->thread.fpscr);
 				disable_kernel_fp();
+				preempt_enable();
 			}
 			else
 				current->thread.fpr[reg] = data.dd;
diff --git a/arch/ppc64/kernel/asm-offsets.c b/arch/ppc64/kernel/asm-offsets.c
index 9368fb0ff..f19f76379 100644
--- a/arch/ppc64/kernel/asm-offsets.c
+++ b/arch/ppc64/kernel/asm-offsets.c
@@ -48,6 +48,8 @@ int main(void)
 	DEFINE(THREAD_SHIFT, THREAD_SHIFT);
 	DEFINE(THREAD_SIZE, THREAD_SIZE);
 	DEFINE(TI_FLAGS, offsetof(struct thread_info, flags));
+	DEFINE(TI_PREEMPT, offsetof(struct thread_info, preempt_count));
+	DEFINE(TI_SC_NOERR, offsetof(struct thread_info, syscall_noerror));
 
 	/* task_struct->thread */
 	DEFINE(THREAD, offsetof(struct task_struct, thread));
@@ -77,30 +79,36 @@ int main(void)
 
 	/* paca */
         DEFINE(PACA_SIZE, sizeof(struct paca_struct));
-        DEFINE(PACAPACAINDEX, offsetof(struct paca_struct, xPacaIndex));
-        DEFINE(PACAPROCSTART, offsetof(struct paca_struct, xProcStart));
-        DEFINE(PACAKSAVE, offsetof(struct paca_struct, xKsave));
-	DEFINE(PACACURRENT, offsetof(struct paca_struct, xCurrent));
-        DEFINE(PACASAVEDMSR, offsetof(struct paca_struct, xSavedMsr));
-        DEFINE(PACASTABREAL, offsetof(struct paca_struct, xStab_data.real));
-        DEFINE(PACASTABVIRT, offsetof(struct paca_struct, xStab_data.virt));
-	DEFINE(PACASTABRR, offsetof(struct paca_struct, xStab_data.next_round_robin));
-        DEFINE(PACAR1, offsetof(struct paca_struct, xR1));
-        DEFINE(PACALPQUEUE, offsetof(struct paca_struct, lpQueuePtr));
-	DEFINE(PACATOC, offsetof(struct paca_struct, xTOC));
-	DEFINE(PACAEXCSP, offsetof(struct paca_struct, exception_sp));
-	DEFINE(PACAPROCENABLED, offsetof(struct paca_struct, xProcEnabled));
+        DEFINE(PACAPACAINDEX, offsetof(struct paca_struct, paca_index));
+        DEFINE(PACAPROCSTART, offsetof(struct paca_struct, cpu_start));
+        DEFINE(PACAKSAVE, offsetof(struct paca_struct, kstack));
+	DEFINE(PACACURRENT, offsetof(struct paca_struct, __current));
+        DEFINE(PACASAVEDMSR, offsetof(struct paca_struct, saved_msr));
+        DEFINE(PACASTABREAL, offsetof(struct paca_struct, stab_real));
+        DEFINE(PACASTABVIRT, offsetof(struct paca_struct, stab_addr));
+	DEFINE(PACASTABRR, offsetof(struct paca_struct, stab_rr));
+        DEFINE(PACAR1, offsetof(struct paca_struct, saved_r1));
+	DEFINE(PACATOC, offsetof(struct paca_struct, kernel_toc));
+	DEFINE(PACAPROCENABLED, offsetof(struct paca_struct, proc_enabled));
+	DEFINE(PACASLBCACHE, offsetof(struct paca_struct, slb_cache));
+	DEFINE(PACASLBCACHEPTR, offsetof(struct paca_struct, slb_cache_ptr));
+	DEFINE(PACACONTEXTID, offsetof(struct paca_struct, context.id));
+	DEFINE(PACASLBR3, offsetof(struct paca_struct, slb_r3));
+#ifdef CONFIG_HUGETLB_PAGE
+	DEFINE(PACAHTLBSEGS, offsetof(struct paca_struct, context.htlb_segs));
+#endif /* CONFIG_HUGETLB_PAGE */
 	DEFINE(PACADEFAULTDECR, offsetof(struct paca_struct, default_decr));
 	DEFINE(PACAPROFENABLED, offsetof(struct paca_struct, prof_enabled));
 	DEFINE(PACAPROFLEN, offsetof(struct paca_struct, prof_len));
 	DEFINE(PACAPROFSHIFT, offsetof(struct paca_struct, prof_shift));
 	DEFINE(PACAPROFBUFFER, offsetof(struct paca_struct, prof_buffer));
 	DEFINE(PACAPROFSTEXT, offsetof(struct paca_struct, prof_stext));
-	DEFINE(PACALPPACA, offsetof(struct paca_struct, xLpPaca));
-        DEFINE(LPPACA, offsetof(struct paca_struct, xLpPaca));
-        DEFINE(PACAREGSAV, offsetof(struct paca_struct, xRegSav));
-        DEFINE(PACAEXC, offsetof(struct paca_struct, exception_stack));
-        DEFINE(PACAGUARD, offsetof(struct paca_struct, guard));
+        DEFINE(PACA_EXGEN, offsetof(struct paca_struct, exgen));
+        DEFINE(PACA_EXMC, offsetof(struct paca_struct, exmc));
+        DEFINE(PACA_EXSLB, offsetof(struct paca_struct, exslb));
+        DEFINE(PACA_EXDSI, offsetof(struct paca_struct, exdsi));
+        DEFINE(PACAEMERGSP, offsetof(struct paca_struct, emergency_sp));
+	DEFINE(PACALPPACA, offsetof(struct paca_struct, lppaca));
         DEFINE(LPPACASRR0, offsetof(struct ItLpPaca, xSavedSrr0));
         DEFINE(LPPACASRR1, offsetof(struct ItLpPaca, xSavedSrr1));
 	DEFINE(LPPACAANYINT, offsetof(struct ItLpPaca, xIntDword.xAnyInt));
@@ -136,6 +144,10 @@ int main(void)
 	DEFINE(GPR7, STACK_FRAME_OVERHEAD+offsetof(struct pt_regs, gpr[7]));
 	DEFINE(GPR8, STACK_FRAME_OVERHEAD+offsetof(struct pt_regs, gpr[8]));
 	DEFINE(GPR9, STACK_FRAME_OVERHEAD+offsetof(struct pt_regs, gpr[9]));
+	DEFINE(GPR10, STACK_FRAME_OVERHEAD+offsetof(struct pt_regs, gpr[10]));
+	DEFINE(GPR11, STACK_FRAME_OVERHEAD+offsetof(struct pt_regs, gpr[11]));
+	DEFINE(GPR12, STACK_FRAME_OVERHEAD+offsetof(struct pt_regs, gpr[12]));
+	DEFINE(GPR13, STACK_FRAME_OVERHEAD+offsetof(struct pt_regs, gpr[13]));
 	DEFINE(GPR20, STACK_FRAME_OVERHEAD+offsetof(struct pt_regs, gpr[20]));
 	DEFINE(GPR21, STACK_FRAME_OVERHEAD+offsetof(struct pt_regs, gpr[21]));
 	DEFINE(GPR22, STACK_FRAME_OVERHEAD+offsetof(struct pt_regs, gpr[22]));
@@ -154,7 +166,7 @@ int main(void)
 	DEFINE(_DSISR, STACK_FRAME_OVERHEAD+offsetof(struct pt_regs, dsisr));
 	DEFINE(ORIG_GPR3, STACK_FRAME_OVERHEAD+offsetof(struct pt_regs, orig_gpr3));
 	DEFINE(RESULT, STACK_FRAME_OVERHEAD+offsetof(struct pt_regs, result));
-	DEFINE(TRAP, STACK_FRAME_OVERHEAD+offsetof(struct pt_regs, trap));
+	DEFINE(_TRAP, STACK_FRAME_OVERHEAD+offsetof(struct pt_regs, trap));
 	DEFINE(SOFTE, STACK_FRAME_OVERHEAD+offsetof(struct pt_regs, softe));
 
 	/* These _only_ to be used with {PROM,RTAS}_FRAME_SIZE!!! */
diff --git a/arch/ppc64/kernel/bitops.c b/arch/ppc64/kernel/bitops.c
index 941a3c9bc..6b24b0219 100644
--- a/arch/ppc64/kernel/bitops.c
+++ b/arch/ppc64/kernel/bitops.c
@@ -7,10 +7,10 @@
 #include <asm/bitops.h>
 #include <asm/byteorder.h>
 
-unsigned long find_next_zero_bit(unsigned long *addr, unsigned long size,
+unsigned long find_next_zero_bit(const unsigned long *addr, unsigned long size,
 				 unsigned long offset)
 {
-	unsigned long *p = addr + (offset >> 6);
+	const unsigned long *p = addr + (offset >> 6);
 	unsigned long result = offset & ~63UL;
 	unsigned long tmp;
 
@@ -48,10 +48,10 @@ found_middle:
 
 EXPORT_SYMBOL(find_next_zero_bit);
 
-unsigned long find_next_bit(unsigned long *addr, unsigned long size,
+unsigned long find_next_bit(const unsigned long *addr, unsigned long size,
 			    unsigned long offset)
 {
-	unsigned long *p = addr + (offset >> 6);
+	const unsigned long *p = addr + (offset >> 6);
 	unsigned long result = offset & ~63UL;
 	unsigned long tmp;
 
@@ -106,10 +106,10 @@ static inline unsigned int ext2_ffz(unsigned int x)
 	return rc;
 }
 
-unsigned long find_next_zero_le_bit(unsigned long *addr, unsigned long size,
+unsigned long find_next_zero_le_bit(const unsigned long *addr, unsigned long size,
 				    unsigned long offset)
 {
-	unsigned int *p = ((unsigned int *)addr) + (offset >> 5);
+	const unsigned int *p = ((const unsigned int *)addr) + (offset >> 5);
 	unsigned int result = offset & ~31;
 	unsigned int tmp;
 
diff --git a/arch/ppc64/kernel/chrp_setup.c b/arch/ppc64/kernel/chrp_setup.c
index 123c889aa..d2a7377ad 100644
--- a/arch/ppc64/kernel/chrp_setup.c
+++ b/arch/ppc64/kernel/chrp_setup.c
@@ -189,7 +189,7 @@ chrp_init2(void)
  */
 void __init fwnmi_init(void)
 {
-	long ret;
+	int ret;
 	int ibm_nmi_register = rtas_token("ibm,nmi-register");
 	if (ibm_nmi_register == RTAS_UNKNOWN_SERVICE)
 		return;
@@ -243,6 +243,8 @@ chrp_init(unsigned long r3, unsigned long r4, unsigned long r5,
 		ppc_md.get_irq        = xics_get_irq;
 	}
 
+	ppc_md.log_error      = pSeries_log_error;
+
 	ppc_md.init           = chrp_init2;
 
 	ppc_md.pcibios_fixup  = pSeries_final_fixup;
@@ -296,8 +298,7 @@ chrp_init(unsigned long r3, unsigned long r4, unsigned long r5,
 	       cur_cpu_spec->firmware_features);
 }
 
-void
-chrp_progress(char *s, unsigned short hex)
+void chrp_progress(char *s, unsigned short hex)
 {
 	struct device_node *root;
 	int width, *p;
@@ -311,60 +312,55 @@ chrp_progress(char *s, unsigned short hex)
 		return;
 
 	if (max_width == 0) {
-		if ( (root = find_path_device("/rtas")) &&
+		if ((root = find_path_device("/rtas")) &&
 		     (p = (unsigned int *)get_property(root,
 						       "ibm,display-line-length",
-						       NULL)) )
+						       NULL)))
 			max_width = *p;
 		else
 			max_width = 0x10;
 		display_character = rtas_token("display-character");
 		set_indicator = rtas_token("set-indicator");
 	}
-	if (display_character == RTAS_UNKNOWN_SERVICE) {
-		/* use hex display */
-		if (set_indicator == RTAS_UNKNOWN_SERVICE)
-			return;
-		rtas_call(set_indicator, 3, 1, NULL, 6, 0, hex);
-		return;
-	}
 
-	if(display_character == RTAS_UNKNOWN_SERVICE) {
+	if (display_character == RTAS_UNKNOWN_SERVICE) {
 		/* use hex display if available */
-		if(set_indicator != RTAS_UNKNOWN_SERVICE)
+		if (set_indicator != RTAS_UNKNOWN_SERVICE)
 			rtas_call(set_indicator, 3, 1, NULL, 6, 0, hex);
 		return;
 	}
 
 	spin_lock(&progress_lock);
 
-	/* Last write ended with newline, but we didn't print it since
+	/*
+	 * Last write ended with newline, but we didn't print it since
 	 * it would just clear the bottom line of output. Print it now
 	 * instead.
 	 *
 	 * If no newline is pending, print a CR to start output at the
 	 * beginning of the line.
 	 */
-	if(pending_newline) {
+	if (pending_newline) {
 		rtas_call(display_character, 1, 1, NULL, '\r');
 		rtas_call(display_character, 1, 1, NULL, '\n');
 		pending_newline = 0;
-	} else
+	} else {
 		rtas_call(display_character, 1, 1, NULL, '\r');
+	}
  
 	width = max_width;
 	os = s;
 	while (*os) {
-		if(*os == '\n' || *os == '\r') {
+		if (*os == '\n' || *os == '\r') {
 			/* Blank to end of line. */
-			while(width-- > 0)
+			while (width-- > 0)
 				rtas_call(display_character, 1, 1, NULL, ' ');
  
 			/* If newline is the last character, save it
 			 * until next call to avoid bumping up the
 			 * display output.
 			 */
-			if(*os == '\n' && !os[1]) {
+			if (*os == '\n' && !os[1]) {
 				pending_newline = 1;
 				spin_unlock(&progress_lock);
 				return;
@@ -372,7 +368,7 @@ chrp_progress(char *s, unsigned short hex)
  
 			/* RTAS wants CR-LF, not just LF */
  
-			if(*os == '\n') {
+			if (*os == '\n') {
 				rtas_call(display_character, 1, 1, NULL, '\r');
 				rtas_call(display_character, 1, 1, NULL, '\n');
 			} else {
@@ -391,14 +387,14 @@ chrp_progress(char *s, unsigned short hex)
 		os++;
  
 		/* if we overwrite the screen length */
-		if ( width <= 0 )
-			while ( (*os != 0) && (*os != '\n') && (*os != '\r') )
+		if (width <= 0)
+			while ((*os != 0) && (*os != '\n') && (*os != '\r'))
 				os++;
 	}
  
 	/* Blank to end of line. */
-	while ( width-- > 0 )
-		rtas_call(display_character, 1, 1, NULL, ' ' );
+	while (width-- > 0)
+		rtas_call(display_character, 1, 1, NULL, ' ');
 
 	spin_unlock(&progress_lock);
 }
diff --git a/arch/ppc64/kernel/cputable.c b/arch/ppc64/kernel/cputable.c
index df13c89ff..44fa14e4f 100644
--- a/arch/ppc64/kernel/cputable.c
+++ b/arch/ppc64/kernel/cputable.c
@@ -141,7 +141,8 @@ struct cpu_spec	cpu_specs[] = {
 	    0xffff0000, 0x003a0000, "POWER5 (gr)",
 	    CPU_FTR_SPLIT_ID_CACHE | CPU_FTR_USE_TB | CPU_FTR_HPTE_TABLE |
 		    CPU_FTR_PPCAS_ARCH_V2 | CPU_FTR_MMCRA | CPU_FTR_SMT |
-		    CPU_FTR_COHERENT_ICACHE | CPU_FTR_LOCKLESS_TLBIE,
+		    CPU_FTR_COHERENT_ICACHE | CPU_FTR_LOCKLESS_TLBIE |
+		    CPU_FTR_MMCRA_SIHV,
 	    COMMON_USER_PPC64,
 	    128, 128,
 	    __setup_cpu_power4,
@@ -151,7 +152,8 @@ struct cpu_spec	cpu_specs[] = {
 	    0xffff0000, 0x003b0000, "POWER5 (gs)",
 	    CPU_FTR_SPLIT_ID_CACHE | CPU_FTR_USE_TB | CPU_FTR_HPTE_TABLE |
 		    CPU_FTR_PPCAS_ARCH_V2 | CPU_FTR_MMCRA | CPU_FTR_SMT |
-		    CPU_FTR_COHERENT_ICACHE | CPU_FTR_LOCKLESS_TLBIE,
+		    CPU_FTR_COHERENT_ICACHE | CPU_FTR_LOCKLESS_TLBIE |
+		    CPU_FTR_MMCRA_SIHV,
 	    COMMON_USER_PPC64,
 	    128, 128,
 	    __setup_cpu_power4,
diff --git a/arch/ppc64/kernel/dma.c b/arch/ppc64/kernel/dma.c
index dec55efcc..68d517fa4 100644
--- a/arch/ppc64/kernel/dma.c
+++ b/arch/ppc64/kernel/dma.c
@@ -43,7 +43,7 @@ void *dma_alloc_coherent(struct device *dev, size_t size,
 	if (dev->bus == &vio_bus_type)
 		return vio_alloc_consistent(to_vio_dev(dev), size, dma_handle);
 	BUG();
-	return 0;
+	return NULL;
 }
 EXPORT_SYMBOL(dma_alloc_coherent);
 
diff --git a/arch/ppc64/kernel/eeh.c b/arch/ppc64/kernel/eeh.c
index dc83803db..5fdcce2db 100644
--- a/arch/ppc64/kernel/eeh.c
+++ b/arch/ppc64/kernel/eeh.c
@@ -31,6 +31,7 @@
 #include <asm/io.h>
 #include <asm/machdep.h>
 #include <asm/pgtable.h>
+#include <asm/rtas.h>
 #include "pci.h"
 
 #undef DEBUG
@@ -44,12 +45,18 @@
 static int ibm_set_eeh_option;
 static int ibm_set_slot_reset;
 static int ibm_read_slot_reset_state;
+static int ibm_slot_error_detail;
 
 static int eeh_subsystem_enabled;
 #define EEH_MAX_OPTS 4096
 static char *eeh_opts;
 static int eeh_opts_last;
 
+/* Buffer for reporting slot-error-detail rtas calls */
+static unsigned char slot_errbuf[RTAS_ERROR_LOG_MAX];
+static spinlock_t slot_errbuf_lock = SPIN_LOCK_UNLOCKED;
+static int eeh_error_buf_size;
+
 /* System monitoring statistics */
 static DEFINE_PER_CPU(unsigned long, total_mmio_ffs);
 static DEFINE_PER_CPU(unsigned long, false_positives);
@@ -207,7 +214,6 @@ static void __pci_addr_cache_insert_device(struct pci_dev *dev)
 	if (!dn) {
 		printk(KERN_WARNING "PCI: no pci dn found for dev=%s %s\n",
 			pci_name(dev), pci_pretty_name(dev));
-		pci_dev_put(dev);
 		return;
 	}
 
@@ -218,10 +224,12 @@ static void __pci_addr_cache_insert_device(struct pci_dev *dev)
 		printk(KERN_INFO "PCI: skip building address cache for=%s %s\n",
 		       pci_name(dev), pci_pretty_name(dev));
 #endif
-		pci_dev_put(dev);
 		return;
 	}
 
+	/* The cache holds a reference to the device... */
+	pci_dev_get(dev);
+
 	/* Walk resources on this device, poke them into the tree */
 	for (i = 0; i < DEVICE_COUNT_RESOURCE; i++) {
 		unsigned long start = pci_resource_start(dev,i);
@@ -271,6 +279,8 @@ restart:
 		}
 		n = rb_next(n);
 	}
+
+	/* The cache no longer holds its reference to this device... */
 	pci_dev_put(dev);
 }
 
@@ -310,7 +320,6 @@ void __init pci_addr_cache_build(void)
 	while ((dev = pci_get_device(PCI_ANY_ID, PCI_ANY_ID, dev)) != NULL) {
 		/* Ignore PCI bridges ( XXX why ??) */
 		if ((dev->class >> 16) == PCI_BASE_CLASS_BRIDGE) {
-			pci_dev_put(dev);
 			continue;
 		}
 		pci_addr_cache_insert_device(dev);
@@ -365,10 +374,8 @@ unsigned long eeh_check_failure(void *token, unsigned long val)
 	unsigned long addr;
 	struct pci_dev *dev;
 	struct device_node *dn;
-	unsigned long ret, rets[2];
-	static spinlock_t lock = SPIN_LOCK_UNLOCKED;
-	/* dont want this on the stack */
-	static unsigned char slot_err_buf[RTAS_ERROR_LOG_MAX];
+	int ret;
+	int rets[2];
 	unsigned long flags;
 
 	__get_cpu_var(total_mmio_ffs)++;
@@ -395,12 +402,6 @@ unsigned long eeh_check_failure(void *token, unsigned long val)
 		return val;
 	}
 
-        /* Make sure we aren't ISA */
-        if (!strcmp(dn->type, "isa")) {
-                pci_dev_put(dev);
-                return val;
-        }
-
 	if (!dn->eeh_config_addr) {
 		pci_dev_put(dev);
 		return val;
@@ -418,23 +419,24 @@ unsigned long eeh_check_failure(void *token, unsigned long val)
 			BUID_LO(dn->phb->buid));
 
 	if (ret == 0 && rets[1] == 1 && rets[0] >= 2) {
-		unsigned long slot_err_ret;
-
-		spin_lock_irqsave(&lock, flags);
-		memset(slot_err_buf, 0, RTAS_ERROR_LOG_MAX);
-		slot_err_ret = rtas_call(rtas_token("ibm,slot-error-detail"),
-					 8, 1, NULL, dn->eeh_config_addr,
-					 BUID_HI(dn->phb->buid),
-					 BUID_LO(dn->phb->buid), NULL, 0,
-					 __pa(slot_err_buf),
-					 RTAS_ERROR_LOG_MAX,
-					 2 /* Permanent Error */);
-
-		if (slot_err_ret == 0)
-			log_error(slot_err_buf, ERR_TYPE_RTAS_LOG,
+		int log_event;
+
+		spin_lock_irqsave(&slot_errbuf_lock, flags);
+		memset(slot_errbuf, 0, eeh_error_buf_size);
+
+		log_event = rtas_call(ibm_slot_error_detail,
+		                      8, 1, NULL, dn->eeh_config_addr,
+		                      BUID_HI(dn->phb->buid),
+		                      BUID_LO(dn->phb->buid), NULL, 0,
+		                      virt_to_phys(slot_errbuf),
+		                      eeh_error_buf_size,
+		                      2 /* Permanent Error */);
+
+		if (log_event == 0)
+			log_error(slot_errbuf, ERR_TYPE_RTAS_LOG,
 				  1 /* Fatal */);
 
-		spin_unlock_irqrestore(&lock, flags);
+		spin_unlock_irqrestore(&slot_errbuf_lock, flags);
 
 		/*
 		 * XXX We should create a separate sysctl for this.
@@ -444,11 +446,11 @@ unsigned long eeh_check_failure(void *token, unsigned long val)
 		 * can use it here.
 		 */
 		if (panic_on_oops) {
-			panic("EEH: MMIO failure (%ld) on device:%s %s\n",
+			panic("EEH: MMIO failure (%d) on device:%s %s\n",
 			      rets[0], pci_name(dev), pci_pretty_name(dev));
 		} else {
 			__get_cpu_var(ignored_failures)++;
-			printk(KERN_INFO "EEH: MMIO failure (%ld) on device:%s %s\n",
+			printk(KERN_INFO "EEH: MMIO failure (%d) on device:%s %s\n",
 			       rets[0], pci_name(dev), pci_pretty_name(dev));
 		}
 	} else {
@@ -463,32 +465,35 @@ EXPORT_SYMBOL(eeh_check_failure);
 struct eeh_early_enable_info {
 	unsigned int buid_hi;
 	unsigned int buid_lo;
+	int force_off;
 };
 
 /* Enable eeh for the given device node. */
 static void *early_enable_eeh(struct device_node *dn, void *data)
 {
 	struct eeh_early_enable_info *info = data;
-	long ret;
-	char *status = get_property(dn, "status", 0);
-	u32 *class_code = (u32 *)get_property(dn, "class-code", 0);
-	u32 *vendor_id = (u32 *)get_property(dn, "vendor-id", 0);
-	u32 *device_id = (u32 *)get_property(dn, "device-id", 0);
+	int ret;
+	char *status = get_property(dn, "status", NULL);
+	u32 *class_code = (u32 *)get_property(dn, "class-code", NULL);
+	u32 *vendor_id = (u32 *)get_property(dn, "vendor-id", NULL);
+	u32 *device_id = (u32 *)get_property(dn, "device-id", NULL);
 	u32 *regs;
 	int enable;
 
+	dn->eeh_mode = 0;
+
 	if (status && strcmp(status, "ok") != 0)
 		return NULL;	/* ignore devices with bad status */
 
-	/* Weed out PHBs or other bad nodes. */
+	/* Ignore bad nodes. */
 	if (!class_code || !vendor_id || !device_id)
 		return NULL;
 
-	/* Ignore known PHBs and EADs bridges */
-	if (*vendor_id == PCI_VENDOR_ID_IBM &&
-	    (*device_id == 0x0102 || *device_id == 0x008b ||
-	     *device_id == 0x0188 || *device_id == 0x0302))
+	/* There is nothing to check on PCI to ISA bridges */
+	if (dn->type && !strcmp(dn->type, "isa")) {
+		dn->eeh_mode |= EEH_MODE_NOCHECK;
 		return NULL;
+	}
 
 	/*
 	 * Now decide if we are going to "Disable" EEH checking
@@ -506,26 +511,18 @@ static void *early_enable_eeh(struct device_node *dn, void *data)
 				   enable)) {
 		if (enable) {
 			printk(KERN_WARNING "EEH: %s user requested to run "
-			       "without EEH.\n", dn->full_name);
+			       "without EEH checking.\n", dn->full_name);
 			enable = 0;
 		}
 	}
 
-	if (!enable) {
-		dn->eeh_mode = EEH_MODE_NOCHECK;
-		return NULL;
-	}
-
-	/* This device may already have an EEH parent. */
-	if (dn->parent && (dn->parent->eeh_mode & EEH_MODE_SUPPORTED)) {
-		/* Parent supports EEH. */
-		dn->eeh_mode |= EEH_MODE_SUPPORTED;
-		dn->eeh_config_addr = dn->parent->eeh_config_addr;
-		return NULL;
+	if (!enable || info->force_off) {
+		dn->eeh_mode |= EEH_MODE_NOCHECK;
 	}
 
-	/* Ok... see if this device supports EEH. */
-	regs = (u32 *)get_property(dn, "reg", 0);
+	/* Ok... see if this device supports EEH.  Some do, some don't,
+	 * and the only way to find out is to check each and every one. */
+	regs = (u32 *)get_property(dn, "reg", NULL);
 	if (regs) {
 		/* First register entry is addr (00BBSS00)  */
 		/* Try to enable eeh */
@@ -537,12 +534,18 @@ static void *early_enable_eeh(struct device_node *dn, void *data)
 			dn->eeh_mode |= EEH_MODE_SUPPORTED;
 			dn->eeh_config_addr = regs[0];
 #ifdef DEBUG
-			printk(KERN_DEBUG "EEH: %s: eeh enabled\n",
-			       dn->full_name);
+			printk(KERN_DEBUG "EEH: %s: eeh enabled\n", dn->full_name);
 #endif
 		} else {
-			printk(KERN_WARNING "EEH: %s: rtas_call failed.\n",
-			       dn->full_name);
+
+			/* This device doesn't support EEH, but it may have an
+			 * EEH parent, in which case we mark it as supported. */
+			if (dn->parent && (dn->parent->eeh_mode & EEH_MODE_SUPPORTED)) {
+				/* Parent supports EEH. */
+				dn->eeh_mode |= EEH_MODE_SUPPORTED;
+				dn->eeh_config_addr = dn->parent->eeh_config_addr;
+				return NULL;
+			}
 		}
 	} else {
 		printk(KERN_WARNING "EEH: %s: unable to get reg property.\n",
@@ -557,58 +560,72 @@ static void *early_enable_eeh(struct device_node *dn, void *data)
  * As a side effect we can determine here if eeh is supported at all.
  * Note that we leave EEH on so failed config cycles won't cause a machine
  * check.  If a user turns off EEH for a particular adapter they are really
- * telling Linux to ignore errors.
+ * telling Linux to ignore errors.  Some hardware (e.g. POWER5) won't
+ * grant access to a slot if EEH isn't enabled, and so we always enable
+ * EEH for all slots/all devices.
  *
- * We should probably distinguish between "ignore errors" and "turn EEH off"
- * but for now disabling EEH for adapters is mostly to work around drivers that
- * directly access mmio space (without using the macros).
- *
- * The eeh-force-off option does literally what it says, so if Linux must
- * avoid enabling EEH this must be done.
+ * The eeh-force-off option disables EEH checking globally, for all slots.
+ * Even if force-off is set, the EEH hardware is still enabled, so that
+ * newer systems can boot.
  */
 void __init eeh_init(void)
 {
-	struct device_node *phb;
+	struct device_node *phb, *np;
 	struct eeh_early_enable_info info;
 	char *eeh_force_off = strstr(saved_command_line, "eeh-force-off");
 
+	init_pci_config_tokens();
+
+	np = of_find_node_by_path("/rtas");
+	if (np == NULL) {
+		printk(KERN_WARNING "EEH: RTAS not found !\n");
+		return;
+	}
+
 	ibm_set_eeh_option = rtas_token("ibm,set-eeh-option");
 	ibm_set_slot_reset = rtas_token("ibm,set-slot-reset");
 	ibm_read_slot_reset_state = rtas_token("ibm,read-slot-reset-state");
+	ibm_slot_error_detail = rtas_token("ibm,slot-error-detail");
 
 	if (ibm_set_eeh_option == RTAS_UNKNOWN_SERVICE)
 		return;
 
+	eeh_error_buf_size = rtas_token("rtas-error-log-max");
+	if (eeh_error_buf_size == RTAS_UNKNOWN_SERVICE) {
+		eeh_error_buf_size = 1024;
+	}
+	if (eeh_error_buf_size > RTAS_ERROR_LOG_MAX) {
+		printk(KERN_WARNING "EEH: rtas-error-log-max is bigger than allocated "
+		      "buffer ! (%d vs %d)", eeh_error_buf_size, RTAS_ERROR_LOG_MAX);
+		eeh_error_buf_size = RTAS_ERROR_LOG_MAX;
+	}
+
+	info.force_off = 0;
 	if (eeh_force_off) {
 		printk(KERN_WARNING "EEH: WARNING: PCI Enhanced I/O Error "
 		       "Handling is user disabled\n");
-		return;
+		info.force_off = 1;
 	}
 
 	/* Enable EEH for all adapters.  Note that eeh requires buid's */
 	for (phb = of_find_node_by_name(NULL, "pci"); phb;
 	     phb = of_find_node_by_name(phb, "pci")) {
-		int len;
-		int *buid_vals;
+		unsigned long buid;
 
-		buid_vals = (int *)get_property(phb, "ibm,fw-phb-id", &len);
-		if (!buid_vals)
-			continue;
-		if (len == sizeof(int)) {
-			info.buid_lo = buid_vals[0];
-			info.buid_hi = 0;
-		} else if (len == sizeof(int)*2) {
-			info.buid_hi = buid_vals[0];
-			info.buid_lo = buid_vals[1];
-		} else {
-			printk(KERN_INFO "EEH: odd ibm,fw-phb-id len returned: %d\n", len);
+		buid = get_phb_buid(phb);
+		if (buid == 0)
 			continue;
-		}
-		traverse_pci_devices(phb, early_enable_eeh, NULL, &info);
+
+		info.buid_lo = BUID_LO(buid);
+		info.buid_hi = BUID_HI(buid);
+		traverse_pci_devices(phb, early_enable_eeh, &info);
 	}
 
-	if (eeh_subsystem_enabled)
+	if (eeh_subsystem_enabled) {
 		printk(KERN_INFO "EEH: PCI Enhanced I/O Error Handling Enabled\n");
+	} else {
+		printk(KERN_WARNING "EEH: disabled PCI Enhanced I/O Error Handling\n");
+	}
 }
 
 /**
@@ -748,10 +765,10 @@ static int proc_eeh_open(struct inode *inode, struct file *file)
 }
 
 static struct file_operations proc_eeh_operations = {
-	.open		= proc_eeh_open,
-	.read		= seq_read,
-	.llseek		= seq_lseek,
-	.release	= single_release,
+	.open      = proc_eeh_open,
+	.read      = seq_read,
+	.llseek    = seq_lseek,
+	.release   = single_release,
 };
 
 static int __init eeh_init_proc(void)
@@ -764,7 +781,7 @@ static int __init eeh_init_proc(void)
 			e->proc_fops = &proc_eeh_operations;
 	}
 
-        return 0;
+	return 0;
 }
 __initcall(eeh_init_proc);
 
@@ -785,7 +802,7 @@ static int eeh_check_opts_config(struct device_node *dn,
 
 	/* Build list of strings to match */
 	nstrs = 0;
-	s = (char *)get_property(dn, "ibm,loc-code", 0);
+	s = (char *)get_property(dn, "ibm,loc-code", NULL);
 	if (s)
 		strs[nstrs++] = s;
 	sprintf(devname, "dev%04x:%04x", vendor_id, device_id);
diff --git a/arch/ppc64/kernel/entry.S b/arch/ppc64/kernel/entry.S
index 9f08385a8..2d48d24e7 100644
--- a/arch/ppc64/kernel/entry.S
+++ b/arch/ppc64/kernel/entry.S
@@ -35,15 +35,9 @@
 #define DO_SOFT_DISABLE
 #endif
 
-#undef SHOW_SYSCALLS
-#undef SHOW_SYSCALLS_TASK
-
-#ifdef SHOW_SYSCALLS_TASK
-	.data
-show_syscalls_task:
-	.long	-1
-#endif
-
+/*
+ * System calls.
+ */
 	.section	".toc","aw"
 .SYS_CALL_TABLE:
 	.tc .sys_call_table[TC],.sys_call_table
@@ -51,107 +45,176 @@ show_syscalls_task:
 .SYS_CALL_TABLE32:
 	.tc .sys_call_table32[TC],.sys_call_table32
 
+/* This value is used to mark exception frames on the stack. */
+exception_marker:
+	.tc	ID_72656773_68657265[TC],0x7265677368657265
+
 	.section	".text"
-	.align 3
+	.align 7
 
-/*
- * Handle a system call.
- */
-_GLOBAL(DoSyscall)
+#undef SHOW_SYSCALLS
+
+	.globl SystemCall_common
+SystemCall_common:
+	andi.	r10,r12,MSR_PR
+	mr	r10,r1
+	addi	r1,r1,-INT_FRAME_SIZE
+	beq-	1f
+	ld	r1,PACAKSAVE(r13)
+1:	std	r10,0(r1)
+	std	r11,_NIP(r1)
+	std	r12,_MSR(r1)
+	std	r0,GPR0(r1)
+	std	r10,GPR1(r1)
+	std	r2,GPR2(r1)
+	std	r3,GPR3(r1)
+	std	r4,GPR4(r1)
+	std	r5,GPR5(r1)
+	std	r6,GPR6(r1)
+	std	r7,GPR7(r1)
+	std	r8,GPR8(r1)
+	li	r11,0
+	std	r11,GPR9(r1)
+	std	r11,GPR10(r1)
+	std	r11,GPR11(r1)
+	std	r11,GPR12(r1)
+	std	r9,GPR13(r1)
+	crclr	so
+	mfcr	r9
+	mflr	r10
+	li	r11,0xc01
+	std	r9,_CCR(r1)
+	std	r10,_LINK(r1)
+	std	r11,_TRAP(r1)
+	mfxer	r9
+	mfctr	r10
+	std	r9,_XER(r1)
+	std	r10,_CTR(r1)
 	std	r3,ORIG_GPR3(r1)
-	ld	r11,_CCR(r1)	/* Clear SO bit in CR */
-	lis	r10,0x1000
-	andc	r11,r11,r10
-	std	r11,_CCR(r1)
+	ld	r2,PACATOC(r13)
+	addi	r9,r1,STACK_FRAME_OVERHEAD
+	ld	r11,exception_marker@toc(r2)
+	std	r11,-16(r9)		/* "regshere" marker */
+#ifdef CONFIG_PPC_ISERIES
+	/* Hack for handling interrupts when soft-enabling on iSeries */
+	cmpdi	cr1,r0,0x5555		/* syscall 0x5555 */
+	andi.	r10,r12,MSR_PR		/* from kernel */
+	crand	4*cr0+eq,4*cr1+eq,4*cr0+eq
+	beq	HardwareInterrupt_entry
+	lbz	r10,PACAPROCENABLED(r13)
+	std	r10,SOFTE(r1)
+#endif
+	mfmsr	r11
+	ori	r11,r11,MSR_EE
+	mtmsrd	r11,1
+
 #ifdef SHOW_SYSCALLS
-#ifdef SHOW_SYSCALLS_TASK
-	LOADBASE(r31,show_syscalls_task)
-	ld	r31,show_syscalls_task@l(r31)
-	ld	r10,PACACURRENT(r13)
-	cmp	0,r10,r31
-	bne	1f
+	bl	.do_show_syscall
+	REST_GPR(0,r1)
+	REST_4GPRS(3,r1)
+	REST_2GPRS(7,r1)
+	addi	r9,r1,STACK_FRAME_OVERHEAD
 #endif
-	LOADADDR(r3,7f)
-	ld	r4,GPR0(r1)
-	ld	r5,GPR3(r1)
-	ld	r6,GPR4(r1)
-	ld	r7,GPR5(r1)
-	ld	r8,GPR6(r1)
-	ld	r9,GPR7(r1)
-	bl	.printk
-	LOADADDR(r3,77f)
-	ld	r4,GPR8(r1)
-	ld	r5,GPR9(r1)
-	ld	r6, PACACURRENT(r13)
-	bl	.printk
-	ld	r0,GPR0(r1)
-	ld	r3,GPR3(r1)
-	ld	r4,GPR4(r1)
-	ld	r5,GPR5(r1)
-	ld	r6,GPR6(r1)
-	ld	r7,GPR7(r1)
-	ld	r8,GPR8(r1)
-1:
-#endif /* SHOW_SYSCALLS */
-	clrrdi	r10,r1,THREAD_SHIFT
-	ld	r10,TI_FLAGS(r10)
+	clrrdi	r11,r1,THREAD_SHIFT
+	li	r12,0
+	ld	r10,TI_FLAGS(r11)
+	stb	r12,TI_SC_NOERR(r11)
 	andi.	r11,r10,_TIF_SYSCALL_T_OR_A
-	bne-	50f
+	bne-	syscall_dotrace
+syscall_dotrace_cont:
 	cmpli	0,r0,NR_syscalls
-	bge-	66f
+	bge-	syscall_enosys
+
+system_call:			/* label this so stack traces look sane */
 /*
  * Need to vector to 32 Bit or default sys_call_table here,
  * based on caller's run-mode / personality.
  */
-	andi.	r11,r10,_TIF_32BIT
-	beq-	15f
-	ld	r10,.SYS_CALL_TABLE32@toc(2)
-/*
- * We now zero extend all six arguments (r3 - r8), the compatibility
- * layer assumes this.
- */
+	ld	r11,.SYS_CALL_TABLE@toc(2)
+	andi.	r10,r10,_TIF_32BIT
+	beq	15f
+	ld	r11,.SYS_CALL_TABLE32@toc(2)
 	clrldi	r3,r3,32
 	clrldi	r4,r4,32
 	clrldi	r5,r5,32
 	clrldi	r6,r6,32
 	clrldi	r7,r7,32
 	clrldi	r8,r8,32
-	b	17f
 15:
-	ld	r10,.SYS_CALL_TABLE@toc(2)
-17:	slwi	r0,r0,3
-	ldx	r10,r10,r0	/* Fetch system call handler [ptr] */
-	mtlr	r10
-	addi	r9,r1,STACK_FRAME_OVERHEAD
-	blrl			/* Call handler */
-_GLOBAL(ret_from_syscall_1)
-	std	r3,RESULT(r1)	/* Save result */
+	slwi	r0,r0,3
+	ldx	r10,r11,r0	/* Fetch system call handler [ptr] */
+	mtctr   r10
+	bctrl			/* Call handler */
+
+syscall_exit:
 #ifdef SHOW_SYSCALLS
-#ifdef SHOW_SYSCALLS_TASK
-	ld	r10, PACACURRENT(13)
-	cmp	0,r10,r31
-	bne	91f
-#endif
-	mr	r4,r3
-	LOADADDR(r3,79f)
-	bl	.printk
-	ld	r3,RESULT(r1)
-91:
+	std	r3,GPR3(r1)
+	bl	.do_show_syscall_exit
+	ld	r3,GPR3(r1)
 #endif
+	std	r3,RESULT(r1)
+	ld	r5,_CCR(r1)
 	li	r10,-_LAST_ERRNO
-	cmpld	0,r3,r10
-	blt	30f
+	cmpld	r3,r10
+	clrrdi	r12,r1,THREAD_SHIFT
+	bge-	syscall_error
+syscall_error_cont:
+
+	/* check for syscall tracing or audit */
+	ld	r9,TI_FLAGS(r12)
+	andi.	r0,r9,_TIF_SYSCALL_T_OR_A
+	bne-	syscall_exit_trace
+syscall_exit_trace_cont:
+
+	/* disable interrupts so current_thread_info()->flags can't change,
+	   and so that we don't get interrupted after loading SRR0/1. */
+	ld	r8,_MSR(r1)
+	andi.	r10,r8,MSR_RI
+	beq-	unrecov_restore
+	mfmsr	r10
+	rldicl	r10,r10,48,1
+	rotldi	r10,r10,16
+	mtmsrd	r10,1
+	ld	r9,TI_FLAGS(r12)
+	andi.	r0,r9,(_TIF_SYSCALL_T_OR_A|_TIF_SIGPENDING|_TIF_NEED_RESCHED)
+	bne-	syscall_exit_work
+	ld	r7,_NIP(r1)
+	stdcx.	r0,0,r1			/* to clear the reservation */
+	andi.	r6,r8,MSR_PR
+	ld	r4,_LINK(r1)
+	beq-	1f			/* only restore r13 if */
+	ld	r13,GPR13(r1)		/* returning to usermode */
+1:	ld	r2,GPR2(r1)
+	ld	r1,GPR1(r1)
+	li	r12,MSR_RI
+	andc	r10,r10,r12
+	mtmsrd	r10,1			/* clear MSR.RI */
+	mtlr	r4
+	mtcr	r5
+	mtspr	SRR0,r7
+	mtspr	SRR1,r8
+	rfid
+	b	.	/* prevent speculative execution */
+
+syscall_enosys:
+	li	r3,-ENOSYS
+	std	r3,RESULT(r1)
+	clrrdi	r12,r1,THREAD_SHIFT
+	ld	r5,_CCR(r1)
+
+syscall_error:
+	lbz	r11,TI_SC_NOERR(r12)
+	cmpi	0,r11,0
+	bne-	syscall_error_cont
 	neg	r3,r3
-22:	ld	r10,_CCR(r1)	/* Set SO bit in CR */
-	oris	r10,r10,0x1000
-	std	r10,_CCR(r1)
-30:	std	r3,GPR3(r1)	/* Update return value */
-	b	.ret_from_except
-66:	li	r3,ENOSYS
-	b	22b
+	oris	r5,r5,0x1000	/* Set SO bit in CR */
+	std	r5,_CCR(r1)
+	b	syscall_error_cont
         
 /* Traced system call support */
-50:	addi	r3,r1,STACK_FRAME_OVERHEAD
+syscall_dotrace:
+	bl	.save_nvgprs
+	addi	r3,r1,STACK_FRAME_OVERHEAD
 	bl	.do_syscall_trace_enter
 	ld	r0,GPR0(r1)	/* Restore original registers */
 	ld	r3,GPR3(r1)
@@ -160,65 +223,82 @@ _GLOBAL(ret_from_syscall_1)
 	ld	r6,GPR6(r1)
 	ld	r7,GPR7(r1)
 	ld	r8,GPR8(r1)
-	/* XXX check this - Anton */
-	ld	r9,GPR9(r1)
-	cmpli	0,r0,NR_syscalls
-	bge-	66f
-/*
- * Need to vector to 32 Bit or default sys_call_table here,
- * based on caller's run-mode / personality.
- */
+	addi	r9,r1,STACK_FRAME_OVERHEAD
 	clrrdi	r10,r1,THREAD_SHIFT
 	ld	r10,TI_FLAGS(r10)
-	andi.	r11,r10,_TIF_32BIT
-	beq-	55f
-	ld	r10,.SYS_CALL_TABLE32@toc(2)
+	b	syscall_dotrace_cont
+
+syscall_exit_trace:
+	std	r3,GPR3(r1)
+	bl	.save_nvgprs
+	bl	.do_syscall_trace_leave
+	REST_NVGPRS(r1)
+	ld	r3,GPR3(r1)
+	ld	r5,_CCR(r1)
+	clrrdi	r12,r1,THREAD_SHIFT
+	b	syscall_exit_trace_cont
+
+/* Stuff to do on exit from a system call. */
+syscall_exit_work:
+	std	r3,GPR3(r1)
+	std	r5,_CCR(r1)
+	b	.ret_from_except_lite
+
+/* Save non-volatile GPRs, if not already saved. */
+_GLOBAL(save_nvgprs)
+	ld	r11,_TRAP(r1)
+	andi.	r0,r11,1
+	beqlr-
+	SAVE_NVGPRS(r1)
+	clrrdi	r0,r11,1
+	std	r0,_TRAP(r1)
+	blr
+
 /*
- * We now zero extend all six arguments (r3 - r8), the compatibility
- * layer assumes this.
+ * The sigsuspend and rt_sigsuspend system calls can call do_signal
+ * and thus put the process into the stopped state where we might
+ * want to examine its user state with ptrace.  Therefore we need
+ * to save all the nonvolatile registers (r14 - r31) before calling
+ * the C code.  Similarly, fork, vfork and clone need the full
+ * register state on the stack so that it can be copied to the child.
  */
-	clrldi	r3,r3,32
-	clrldi	r4,r4,32
-	clrldi	r5,r5,32
-	clrldi	r6,r6,32
-	clrldi	r7,r7,32
-	clrldi	r8,r8,32
-	b	57f
-55:
-	ld	r10,.SYS_CALL_TABLE@toc(2)
-57:
-	slwi	r0,r0,3
-	ldx	r10,r10,r0	/* Fetch system call handler [ptr] */
-	mtlr	r10
-	addi	r9,r1,STACK_FRAME_OVERHEAD
-	blrl			/* Call handler */
-_GLOBAL(ret_from_syscall_2)
-	std	r3,RESULT(r1)	/* Save result */	
-	li	r10,-_LAST_ERRNO
-	cmpld	0,r3,r10
-	blt	60f
-	neg	r3,r3
-57:	ld	r10,_CCR(r1)	/* Set SO bit in CR */
-	oris	r10,r10,0x1000
-	std	r10,_CCR(r1)
-60:	std	r3,GPR3(r1)	/* Update return value */
-	bl	.do_syscall_trace_leave
-	b	.ret_from_except
-66:	li	r3,ENOSYS
-	b	57b
-#ifdef SHOW_SYSCALLS
-7:	.string	"syscall %d(%x, %x, %x, %x, %x, "
-77:	.string	"%x, %x), current=%p\n"
-79:	.string	" -> %x\n"
-	.align	2,0
-#endif
+_GLOBAL(ppc32_sigsuspend)
+	bl	.save_nvgprs
+	bl	.sys32_sigsuspend
+	b	syscall_exit
+
+_GLOBAL(ppc64_rt_sigsuspend)
+	bl	.save_nvgprs
+	bl	.sys_rt_sigsuspend
+	b	syscall_exit
+
+_GLOBAL(ppc32_rt_sigsuspend)
+	bl	.save_nvgprs
+	bl	.sys32_rt_sigsuspend
+	b	syscall_exit
+
+_GLOBAL(ppc_fork)
+	bl	.save_nvgprs
+	bl	.sys_fork
+	b	syscall_exit
+
+_GLOBAL(ppc_vfork)
+	bl	.save_nvgprs
+	bl	.sys_vfork
+	b	syscall_exit
+
+_GLOBAL(ppc_clone)
+	bl	.save_nvgprs
+	bl	.sys_clone
+	b	syscall_exit
 
-	
 _GLOBAL(ppc32_swapcontext)
+	bl	.save_nvgprs
 	bl	.sys32_swapcontext
 	b	80f
 	
 _GLOBAL(ppc64_swapcontext)
+	bl	.save_nvgprs
 	bl	.sys_swapcontext
 	b	80f
 
@@ -233,17 +313,20 @@ _GLOBAL(ppc32_rt_sigreturn)
 _GLOBAL(ppc64_rt_sigreturn)
 	bl	.sys_rt_sigreturn
 
-80:	clrrdi	r4,r1,THREAD_SHIFT
+80:	cmpdi	0,r3,0
+	blt	syscall_exit
+	clrrdi	r4,r1,THREAD_SHIFT
 	ld	r4,TI_FLAGS(r4)
 	andi.	r4,r4,_TIF_SYSCALL_T_OR_A
-	bne-	81f
-	cmpi	0,r3,0
-	bge	.ret_from_except
-	b	.ret_from_syscall_1
-81:	cmpi	0,r3,0
-	blt	.ret_from_syscall_2
+	beq+	81f
 	bl	.do_syscall_trace_leave
-	b	.ret_from_except
+81:	b	.ret_from_except
+
+_GLOBAL(ret_from_fork)
+	bl	.schedule_tail
+	REST_NVGPRS(r1)
+	li	r3,0
+	b	syscall_exit
 
 /*
  * This routine switches between two different tasks.  The process
@@ -263,6 +346,7 @@ _GLOBAL(ppc64_rt_sigreturn)
  * The code which creates the new task context is in 'copy_thread'
  * in arch/ppc64/kernel/process.c
  */
+	.align	7
 _GLOBAL(_switch)
 	mflr	r0
 	std	r0,16(r1)
@@ -315,7 +399,10 @@ BEGIN_FTR_SECTION
 2:
 END_FTR_SECTION_IFSET(CPU_FTR_SLB)
 	clrrdi	r7,r8,THREAD_SHIFT	/* base of new stack */
-	addi	r7,r7,THREAD_SIZE-INT_FRAME_SIZE
+	/* Note: this uses SWITCH_FRAME_SIZE rather than INT_FRAME_SIZE
+	   because we don't need to leave the 288-byte ABI gap at the
+	   top of the kernel stack. */
+	addi	r7,r7,THREAD_SIZE-SWITCH_FRAME_SIZE
 
 	mr	r1,r8		/* start using new stack pointer */
 	std	r7,PACAKSAVE(r13)
@@ -350,60 +437,56 @@ END_FTR_SECTION_IFSET(CPU_FTR_ALTIVEC)
 	addi	r1,r1,SWITCH_FRAME_SIZE
 	blr
 
-_GLOBAL(ret_from_fork)
-	bl	.schedule_tail
-	clrrdi	r4,r1,THREAD_SHIFT
-	ld	r4,TI_FLAGS(r4)
-	andi.	r4,r4,_TIF_SYSCALL_T_OR_A
-	beq+	.ret_from_except
-	bl	.do_syscall_trace_leave
-	b	.ret_from_except
-
+	.align	7
 _GLOBAL(ret_from_except)
+	ld	r11,_TRAP(r1)
+	andi.	r0,r11,1
+	bne	.ret_from_except_lite
+	REST_NVGPRS(r1)
+
+_GLOBAL(ret_from_except_lite)
 	/*
 	 * Disable interrupts so that current_thread_info()->flags
 	 * can't change between when we test it and when we return
 	 * from the interrupt.
 	 */
 	mfmsr	r10		/* Get current interrupt state */
-	li	r4,0
-	ori	r4,r4,MSR_EE
-	andc	r9,r10,r4	/* clear MSR_EE */
+	rldicl	r9,r10,48,1	/* clear MSR_EE */
+	rotldi	r9,r9,16
 	mtmsrd	r9,1		/* Update machine state */
 
+#ifdef CONFIG_PREEMPT
+	clrrdi	r9,r1,THREAD_SHIFT	/* current_thread_info() */
+	li	r0,_TIF_NEED_RESCHED	/* bits to check */
+	ld	r3,_MSR(r1)
+	ld	r4,TI_FLAGS(r9)
+	/* Move MSR_PR bit in r3 to _TIF_SIGPENDING position in r0 */
+	rlwimi	r0,r3,32+TIF_SIGPENDING-MSR_PR_LG,_TIF_SIGPENDING
+	and.	r0,r4,r0	/* check NEED_RESCHED and maybe SIGPENDING */
+	bne	do_work
+
+#else /* !CONFIG_PREEMPT */
 	ld	r3,_MSR(r1)	/* Returning to user mode? */
 	andi.	r3,r3,MSR_PR
 	beq	restore		/* if not, just restore regs and return */
 
 	/* Check current_thread_info()->flags */
-	clrrdi	r3,r1,THREAD_SHIFT
-	ld	r3,TI_FLAGS(r3)
-	andi.	r0,r3,_TIF_USER_WORK_MASK
+	clrrdi	r9,r1,THREAD_SHIFT
+	ld	r4,TI_FLAGS(r9)
+	andi.	r0,r4,_TIF_USER_WORK_MASK
 	bne	do_work
-
-	addi	r0,r1,INT_FRAME_SIZE	/* size of frame */
-	ld	r4,PACACURRENT(r13)
-	std	r0,THREAD+KSP(r4)	/* save kernel stack pointer */
-
-	/*
-	 * r13 is our per cpu area, only restore it if we are returning to
-	 * userspace
-	 */
-	REST_GPR(13,r1)
+#endif
 
 restore:
 #ifdef CONFIG_PPC_ISERIES
 	ld	r5,SOFTE(r1)
-	mfspr	r4,SPRG3		/* get paca address */
 	cmpdi	0,r5,0
 	beq	4f
 	/* Check for pending interrupts (iSeries) */
-	/* this is CHECKANYINT except that we already have the paca address */
-	ld	r3,PACALPPACA+LPPACAANYINT(r4)
+	ld	r3,PACALPPACA+LPPACAANYINT(r13)
 	cmpdi	r3,0
 	beq+	4f			/* skip do_IRQ if no interrupts */
 
-	mfspr	r13,SPRG3		/* get paca pointer back */
 	li	r3,0
 	stb	r3,PACAPROCENABLED(r13)	/* ensure we are soft-disabled */
 	mtmsrd	r10			/* hard-enable again */
@@ -411,13 +494,22 @@ restore:
 	bl	.do_IRQ
 	b	.ret_from_except		/* loop back and handle more */
 
-4:	stb	r5,PACAPROCENABLED(r4)
+4:	stb	r5,PACAPROCENABLED(r13)
 #endif
 
 	ld	r3,_MSR(r1)
-	andi.	r3,r3,MSR_RI
+	andi.	r0,r3,MSR_RI
 	beq-	unrecov_restore
 
+	andi.	r0,r3,MSR_PR
+
+	/*
+	 * r13 is our per cpu area, only restore it if we are returning to
+	 * userspace
+	 */
+	beq	1f
+	REST_GPR(13, r1)
+1:
 	ld	r3,_CTR(r1)
 	ld	r0,_LINK(r1)
 	mtctr	r3
@@ -426,8 +518,6 @@ restore:
 	mtspr	XER,r3
 
 	REST_8GPRS(5, r1)
-	REST_10GPRS(14, r1)
-	REST_8GPRS(24, r1)
 
 	stdcx.	r0,0,r1		/* to clear the reservation */
 
@@ -451,26 +541,62 @@ restore:
 	ld	r1,GPR1(r1)
 
 	rfid
+	b	.	/* prevent speculative execution */
 
-/* Note: this must change if we start using the  TIF_NOTIFY_RESUME bit */
+/* Note: this must change if we start using the TIF_NOTIFY_RESUME bit */
 do_work:
+#ifdef CONFIG_PREEMPT
+	andi.	r0,r3,MSR_PR	/* Returning to user mode? */
+	bne	user_work
+	/* Check that preempt_count() == 0 and interrupts are enabled */
+	lwz	r8,TI_PREEMPT(r9)
+	cmpwi	cr1,r8,0
+#ifdef CONFIG_PPC_ISERIES
+	ld	r0,SOFTE(r1)
+	cmpdi	r0,0
+#else
+	andi.	r0,r3,MSR_EE
+#endif
+	crandc	eq,cr1*4+eq,eq
+	bne	restore
+	/* here we are preempting the current task */
+1:	lis	r0,PREEMPT_ACTIVE@h
+	stw	r0,TI_PREEMPT(r9)
+#ifdef CONFIG_PPC_ISERIES
+	li	r0,1
+	stb	r0,PACAPROCENABLED(r13)
+#endif
+	mtmsrd	r10,1		/* reenable interrupts */
+	bl	.schedule
+	mfmsr	r10
+	clrrdi	r9,r1,THREAD_SHIFT
+	rldicl	r10,r10,48,1	/* disable interrupts again */
+	li	r0,0
+	rotldi	r10,r10,16
+	mtmsrd	r10,1
+	ld	r4,TI_FLAGS(r9)
+	andi.	r0,r4,_TIF_NEED_RESCHED
+	bne	1b
+	stw	r0,TI_PREEMPT(r9)
+	b	restore
+
+user_work:
+#endif
 	/* Enable interrupts */
 	mtmsrd	r10,1
 
-	andi.	r0,r3,_TIF_NEED_RESCHED
+	andi.	r0,r4,_TIF_NEED_RESCHED
 	beq	1f
 	bl	.schedule
-	b	.ret_from_except
+	b	.ret_from_except_lite
 
-1:	andi.	r0,r3,_TIF_SIGPENDING
-	beq	.ret_from_except
+1:	bl	.save_nvgprs
 	li	r3,0
 	addi	r4,r1,STACK_FRAME_OVERHEAD
 	bl	.do_signal
 	b	.ret_from_except
 
 unrecov_restore:
-	mfspr   r13,SPRG3
 	addi	r3,r1,STACK_FRAME_OVERHEAD
 	bl	.unrecoverable_exception
 	b	unrecov_restore
@@ -488,7 +614,7 @@ _GLOBAL(enter_rtas)
 	mflr	r0
 	std	r0,16(r1)
         stdu	r1,-RTAS_FRAME_SIZE(r1)	/* Save SP and create stack space. */
-	
+
 	/* Because RTAS is running in 32b mode, it clobbers the high order half
 	 * of all registers that it saves.  We therefore save those registers
 	 * RTAS might touch to the stack.  (r0, r3-r13 are caller saved)
@@ -559,6 +685,7 @@ _GLOBAL(enter_rtas)
 	mtspr	SRR0,r5
 	mtspr	SRR1,r6
 	rfid
+	b	.	/* prevent speculative execution */
 
 _STATIC(rtas_return_loc)
 	/* relocation is off at this point */
@@ -579,6 +706,7 @@ _STATIC(rtas_return_loc)
 	mtspr	SRR0,r3
 	mtspr	SRR1,r4
 	rfid
+	b	.	/* prevent speculative execution */
 
 _STATIC(rtas_restore_regs)
 	/* relocation is on at this point */
diff --git a/arch/ppc64/kernel/head.S b/arch/ppc64/kernel/head.S
index e868fe7b8..a5d67f599 100644
--- a/arch/ppc64/kernel/head.S
+++ b/arch/ppc64/kernel/head.S
@@ -35,25 +35,17 @@
 #include <asm/offsets.h>
 #include <asm/bug.h>
 #include <asm/cputable.h>
+#include <asm/setup.h>
 
 #ifdef CONFIG_PPC_ISERIES
 #define DO_SOFT_DISABLE
 #endif
 
-/* copy saved SOFTE bit or EE bit from saved MSR depending
- * if we are doing soft-disable or not
- */
-#ifdef DO_SOFT_DISABLE
-#define DO_COPY_EE()	ld	r20,SOFTE(r1)
-#else
-#define DO_COPY_EE()	rldicl	r20,r23,49,63
-#endif
-
 /*
  * hcall interface to pSeries LPAR
  */
-#define HVSC .long 0x44000022
-#define H_SET_ASR		0x30
+#define HVSC		.long 0x44000022
+#define H_SET_ASR	0x30
 
 /*
  * We layout physical memory as follows:
@@ -62,19 +54,19 @@
  * 0x3000 - 0x3fff : Interrupt support
  * 0x4000 - 0x4fff : NACA
  * 0x5000 - 0x5fff : SystemCfg
- * 0x6000          : iSeries and common interrupt prologs
+ * 0x6000	   : iSeries and common interrupt prologs
  * 0x9000 - 0x9fff : Initial segment table
  */
 
 /*
  *   SPRG Usage
  *
- *   Register          Definition
+ *   Register	Definition
  *
- *   SPRG0             reserved for hypervisor
- *   SPRG1             temp - used to save gpr
- *   SPRG2             temp - used to save gpr
- *   SPRG3             virt addr of paca
+ *   SPRG0	reserved for hypervisor
+ *   SPRG1	temp - used to save gpr
+ *   SPRG2	temp - used to save gpr
+ *   SPRG3	virt addr of paca
  */
 
 /*
@@ -115,7 +107,7 @@ END_FTR_SECTION(0, 1)
 	 * to the pidhash table (also used by the debugger)
 	 */
 	.llong msChunks-KERNELBASE
-	.llong 0 /* pidhash-KERNELBASE SFRXXX */
+	.llong 0	/* pidhash-KERNELBASE SFRXXX */
 
 	/* Offset 0x38 - Pointer to start of embedded System.map */
 	.globl	embedded_sysmap_start
@@ -130,13 +122,13 @@ embedded_sysmap_end:
 	/* Secondary processors spin on this value until it goes to 1. */
 	.globl  __secondary_hold_spinloop
 __secondary_hold_spinloop:
-	.llong  0x0
+	.llong	0x0
 
 	/* Secondary processors write this value with their cpu # */
-	/* after they enter the spin loop immediately below.       */
-	.globl  __secondary_hold_acknowledge
+	/* after they enter the spin loop immediately below.	  */
+	.globl	__secondary_hold_acknowledge
 __secondary_hold_acknowledge:
-	.llong  0x0
+	.llong	0x0
 
 	. = 0x60
 /*
@@ -152,36 +144,43 @@ _GLOBAL(__secondary_hold)
 	mtmsrd	r24			/* RI on */
 
 	/* Grab our linux cpu number */
-	mr      r24,r3
+	mr	r24,r3
 
 	/* Tell the master cpu we're here */
 	/* Relocation is off & we are located at an address less */
 	/* than 0x100, so only need to grab low order offset.    */
-	std     r24,__secondary_hold_acknowledge@l(0)
+	std	r24,__secondary_hold_acknowledge@l(0)
 	sync
 
 	/* All secondary cpu's wait here until told to start. */
-100:    ld      r4,__secondary_hold_spinloop@l(0)
-	cmpdi   0,r4,1
-	bne     100b
+100:	ld	r4,__secondary_hold_spinloop@l(0)
+	cmpdi	0,r4,1
+	bne	100b
 
 #ifdef CONFIG_HMT
 	b	.hmt_init
 #else
 #ifdef CONFIG_SMP
-	mr      r3,r24
-	b       .pseries_secondary_smp_init
+	mr	r3,r24
+	b	.pseries_secondary_smp_init
 #else
 	BUG_OPCODE
 #endif
 #endif
 #endif
 
+/* This value is used to mark exception frames on the stack. */
+	.section ".toc","aw"
+exception_marker:
+	.tc	ID_72656773_68657265[TC],0x7265677368657265
+	.text
+
 /*
  * The following macros define the code that appears as
  * the prologue to each of the exception handlers.  They
  * are split into two parts to allow a single kernel binary
- * to be used for pSeries, and iSeries.
+ * to be used for pSeries and iSeries.
+ * LOL.  One day... - paulus
  */
 
 /*
@@ -194,81 +193,57 @@ _GLOBAL(__secondary_hold)
  * This is the start of the interrupt handlers for pSeries
  * This code runs with relocation off.
  */
-#define EX_SRR0		0
-#define EX_SRR1		8
-#define EX_R20		16
-#define EX_R21		24
-#define EX_R22		32
-#define EX_R23		40
+#define EX_R9		0
+#define EX_R10		8
+#define EX_R11		16
+#define EX_R12		24
+#define EX_R13		32
+#define EX_SRR0		40
 #define EX_DAR		48
+#define EX_LR		48	/* SLB miss saves LR, but not DAR */
 #define EX_DSISR	56
-#define EX_CCR   	60
-#define EX_TRAP   	60
-
-#define EXCEPTION_PROLOG_PSERIES(n,label)                                \
-	mtspr   SPRG2,r20;              /* use SPRG2 as scratch reg   */ \
-	mtspr   SPRG1,r21;              /* save r21                   */ \
-	mfspr   r20,SPRG3;              /* get paca virt addr         */ \
-	ld      r21,PACAEXCSP(r20);     /* get exception stack ptr    */ \
-	addi    r21,r21,EXC_FRAME_SIZE; /* make exception frame       */ \
-	std	r22,EX_R22(r21);	/* Save r22 in exc. frame     */ \
-	li	r22,n;                  /* Save the ex # in exc. frame*/ \
-	stw	r22,EX_TRAP(r21);	/*                            */ \
-	std	r23,EX_R23(r21);	/* Save r23 in exc. frame     */ \
-	mfspr   r22,SRR0;               /* EA of interrupted instr    */ \
-	std	r22,EX_SRR0(r21);	/* Save SRR0 in exc. frame    */ \
-	mfspr   r23,SRR1;               /* machine state at interrupt */ \
-	std	r23,EX_SRR1(r21);	/* Save SRR1 in exc. frame    */ \
-                                                                         \
-	mfspr   r23,DAR;                /* Save DAR in exc. frame      */ \
-	std	r23,EX_DAR(r21);	                                  \
-	mfspr	r23,DSISR;		/* Save DSISR in exc. frame    */ \
-	stw	r23,EX_DSISR(r21);	                                  \
-	mfspr	r23,SPRG2;		/* Save r20 in exc. frame      */ \
-	std	r23,EX_R20(r21);	                                  \
-                                                                         \
-	clrrdi  r22,r20,60;             /* Get 0xc part of the vaddr  */ \
-	ori	r22,r22,(label)@l;      /* add in the vaddr offset    */ \
-		                        /*   assumes *_common < 16b   */ \
-	mfmsr   r23;                                                     \
-	rotldi  r23,r23,4;                                               \
-	ori     r23,r23,0x32B;          /* Set IR, DR, RI, SF, ISF, HV*/ \
-	rotldi  r23,r23,60;             /* for generic handlers       */ \
-	mtspr   SRR0,r22;                                                \
-	mtspr   SRR1,r23;                                                \
-	mfcr    r23;                    /* save CR in r23             */ \
-	rfid
+#define EX_CCR		60
+
+#define EXCEPTION_PROLOG_PSERIES(area, label)				\
+	mfspr	r13,SPRG3;		/* get paca address into r13 */	\
+	std	r9,area+EX_R9(r13);	/* save r9 - r12 */		\
+	std	r10,area+EX_R10(r13);					\
+	std	r11,area+EX_R11(r13);					\
+	std	r12,area+EX_R12(r13);					\
+	mfspr	r9,SPRG1;						\
+	std	r9,area+EX_R13(r13);					\
+	mfcr	r9;							\
+	clrrdi	r12,r13,32;		/* get high part of &label */	\
+	mfmsr	r10;							\
+	mfspr	r11,SRR0;		/* save SRR0 */			\
+	ori	r12,r12,(label)@l;	/* virt addr of handler */	\
+	ori	r10,r10,MSR_IR|MSR_DR|MSR_RI;				\
+	mtspr	SRR0,r12;						\
+	mfspr	r12,SRR1;		/* and SRR1 */			\
+	mtspr	SRR1,r10;						\
+	rfid;								\
+	b	.	/* prevent speculative execution */
 
 /*
  * This is the start of the interrupt handlers for iSeries
  * This code runs with relocation on.
  */
-#define EXCEPTION_PROLOG_ISERIES(n)	                                      \
-	mtspr	SPRG2,r20;		    /* use SPRG2 as scratch reg    */ \
-	mtspr   SPRG1,r21;                  /* save r21                    */ \
-	mfspr	r20,SPRG3;		    /* get paca                    */ \
-	ld      r21,PACAEXCSP(r20);         /* get exception stack ptr     */ \
-	addi    r21,r21,EXC_FRAME_SIZE;     /* make exception frame        */ \
-	std	r22,EX_R22(r21);	    /* save r22 on exception frame */ \
-	li	r22,n;                      /* Save the ex # in exc. frame */ \
-	stw	r22,EX_TRAP(r21);	    /*                             */ \
-	std	r23,EX_R23(r21);	    /* Save r23 in exc. frame      */ \
-	ld      r22,LPPACA+LPPACASRR0(r20); /* Get SRR0 from ItLpPaca      */ \
-	std	r22,EX_SRR0(r21);	    /* save SRR0 in exc. frame     */ \
-	ld      r23,LPPACA+LPPACASRR1(r20); /* Get SRR1 from ItLpPaca      */ \
-	std	r23,EX_SRR1(r21);	    /* save SRR1 in exc. frame     */ \
-                                                                         \
-	mfspr   r23,DAR;                /* Save DAR in exc. frame      */ \
-	std	r23,EX_DAR(r21);	                                  \
-	mfspr	r23,DSISR;		/* Save DSISR in exc. frame    */ \
-	stw	r23,EX_DSISR(r21);	                                  \
-	mfspr	r23,SPRG2;		/* Save r20 in exc. frame      */ \
-	std	r23,EX_R20(r21);	                                  \
-                                                                         \
-	mfmsr	r22;			    /* set MSR.RI		   */ \
-	ori	r22,r22,MSR_RI;						      \
-	mtmsrd	r22,1;							      \
-	mfcr    r23;                        /* save CR in r23              */
+#define EXCEPTION_PROLOG_ISERIES_1(area)				\
+	mfspr	r13,SPRG3;		/* get paca address into r13 */	\
+	std	r9,area+EX_R9(r13);	/* save r9 - r12 */		\
+	std	r10,area+EX_R10(r13);					\
+	std	r11,area+EX_R11(r13);					\
+	std	r12,area+EX_R12(r13);					\
+	mfspr	r9,SPRG1;						\
+	std	r9,area+EX_R13(r13);					\
+	mfcr	r9
+
+#define EXCEPTION_PROLOG_ISERIES_2					\
+	mfmsr	r10;							\
+	ld	r11,PACALPPACA+LPPACASRR0(r13);				\
+	ld	r12,PACALPPACA+LPPACASRR1(r13);				\
+	ori	r10,r10,MSR_RI;						\
+	mtmsrd	r10,1
 
 /*
  * The common exception prolog is used for all except a few exceptions
@@ -276,106 +251,156 @@ _GLOBAL(__secondary_hold)
  * to take another exception from the point where we first touch the
  * kernel stack onwards.
  *
- * On entry r20 points to the paca and r21 points to the exception
- * frame on entry, r23 contains the saved CR, and relocation is on.
- */
-#define EXCEPTION_PROLOG_COMMON                                           \
-	mfspr	r22,SPRG1;		/* Save r21 in exc. frame      */ \
-	std	r22,EX_R21(r21);	                                  \
-	std     r21,PACAEXCSP(r20);     /* update exception stack ptr  */ \
-	ld	r22,EX_SRR1(r21);	/* Get SRR1 from exc. frame    */ \
-	andi.   r22,r22,MSR_PR;         /* Set CR for later branch     */ \
-	mr      r22,r1;                 /* Save r1                     */ \
-	subi    r1,r1,INT_FRAME_SIZE;   /* alloc frame on kernel stack */ \
-	beq-    1f;                                                       \
-	ld      r1,PACAKSAVE(r20);      /* kernel stack to use         */ \
-1:      cmpdi	cr1,r1,0;		/* check if r1 is in userspace */ \
-	bge	cr1,bad_stack;		/* abort if it is	       */ \
-	std     r22,GPR1(r1);           /* save r1 in stackframe       */ \
-	std     r22,0(r1);              /* make stack chain pointer    */ \
-	std     r23,_CCR(r1);           /* save CR in stackframe       */ \
-	ld	r22,EX_R20(r21);	/* move r20 to stackframe      */ \
-	std	r22,GPR20(r1);		                                  \
-	ld	r23,EX_R21(r21);	/* move r21 to stackframe      */ \
-	std	r23,GPR21(r1);		                                  \
-	ld	r22,EX_R22(r21);	/* move r22 to stackframe      */ \
-	std	r22,GPR22(r1);		                                  \
-	ld	r23,EX_R23(r21);	/* move r23 to stackframe      */ \
-	std	r23,GPR23(r1);		                                  \
-	mflr    r22;                    /* save LR in stackframe       */ \
-	std     r22,_LINK(r1);                                            \
-	mfctr   r23;                    /* save CTR in stackframe      */ \
-	std     r23,_CTR(r1);                                             \
-	mfspr   r22,XER;                /* save XER in stackframe      */ \
-	std     r22,_XER(r1);                                             \
-	ld	r23,EX_DAR(r21);	/* move DAR to stackframe      */ \
-	std	r23,_DAR(r1);		                                  \
-	lwz     r22,EX_DSISR(r21);	/* move DSISR to stackframe    */ \
-	std	r22,_DSISR(r1);		                                  \
-	lbz	r22,PACAPROCENABLED(r20);                                 \
-	std	r22,SOFTE(r1);		                                  \
-	ld	r22,EX_SRR0(r21);	/* get SRR0 from exc. frame    */ \
-	ld	r23,EX_SRR1(r21);	/* get SRR1 from exc. frame    */ \
-	addi    r21,r21,-EXC_FRAME_SIZE;/* pop off exception frame     */ \
-	std     r21,PACAEXCSP(r20);                                       \
-	SAVE_GPR(0, r1);                /* save r0 in stackframe       */ \
-	SAVE_8GPRS(2, r1);              /* save r2 - r13 in stackframe */ \
-	SAVE_4GPRS(10, r1);                                               \
-	ld      r2,PACATOC(r20);	                                  \
-	mr	r13,r20
-
-/*
- * Note: code which follows this uses cr0.eq (set if from kernel),
- * r1, r22 (SRR0), and r23 (SRR1).
+ * On entry r13 points to the paca, r9-r13 are saved in the paca,
+ * r9 contains the saved CR, r11 and r12 contain the saved SRR0 and
+ * SRR1, and relocation is on.
  */
+#define EXCEPTION_PROLOG_COMMON(n, area)				   \
+	andi.	r10,r12,MSR_PR;		/* See if coming from user	*/ \
+	mr	r10,r1;			/* Save r1			*/ \
+	subi	r1,r1,INT_FRAME_SIZE;	/* alloc frame on kernel stack	*/ \
+	beq-	1f;							   \
+	ld	r1,PACAKSAVE(r13);	/* kernel stack to use		*/ \
+1:	cmpdi	cr1,r1,0;		/* check if r1 is in userspace	*/ \
+	bge-	cr1,bad_stack;		/* abort if it is		*/ \
+	std	r9,_CCR(r1);		/* save CR in stackframe	*/ \
+	std	r11,_NIP(r1);		/* save SRR0 in stackframe	*/ \
+	std	r12,_MSR(r1);		/* save SRR1 in stackframe	*/ \
+	std	r10,0(r1);		/* make stack chain pointer	*/ \
+	std	r0,GPR0(r1);		/* save r0 in stackframe	*/ \
+	std	r10,GPR1(r1);		/* save r1 in stackframe	*/ \
+	std	r2,GPR2(r1);		/* save r2 in stackframe	*/ \
+	SAVE_4GPRS(3, r1);		/* save r3 - r6 in stackframe	*/ \
+	SAVE_2GPRS(7, r1);		/* save r7, r8 in stackframe	*/ \
+	ld	r9,area+EX_R9(r13);	/* move r9, r10 to stackframe	*/ \
+	ld	r10,area+EX_R10(r13);					   \
+	std	r9,GPR9(r1);						   \
+	std	r10,GPR10(r1);						   \
+	ld	r9,area+EX_R11(r13);	/* move r11 - r13 to stackframe	*/ \
+	ld	r10,area+EX_R12(r13);					   \
+	ld	r11,area+EX_R13(r13);					   \
+	std	r9,GPR11(r1);						   \
+	std	r10,GPR12(r1);						   \
+	std	r11,GPR13(r1);						   \
+	ld	r2,PACATOC(r13);	/* get kernel TOC into r2	*/ \
+	mflr	r9;			/* save LR in stackframe	*/ \
+	std	r9,_LINK(r1);						   \
+	mfctr	r10;			/* save CTR in stackframe	*/ \
+	std	r10,_CTR(r1);						   \
+	mfspr	r11,XER;		/* save XER in stackframe	*/ \
+	std	r11,_XER(r1);						   \
+	li	r9,(n)+1;						   \
+	std	r9,_TRAP(r1);		/* set trap number		*/ \
+	li	r10,0;							   \
+	ld	r11,exception_marker@toc(r2);				   \
+	std	r10,RESULT(r1);		/* clear regs->result		*/ \
+	std	r11,STACK_FRAME_OVERHEAD-16(r1); /* mark the frame	*/
 
 /*
  * Exception vectors.
  */
-#define STD_EXCEPTION_PSERIES(n, label )	\
-	. = n;					\
-	.globl label##_Pseries;			\
-label##_Pseries:				\
-	EXCEPTION_PROLOG_PSERIES( n, label##_common )
-
-#define STD_EXCEPTION_ISERIES( n, label )	\
-	.globl label##_Iseries;			\
-label##_Iseries:				\
-	EXCEPTION_PROLOG_ISERIES( n );          \
+#define STD_EXCEPTION_PSERIES(n, label)			\
+	. = n;						\
+	.globl label##_Pseries;				\
+label##_Pseries:					\
+	HMT_MEDIUM;					\
+	mtspr	SPRG1,r13;		/* save r13 */	\
+	EXCEPTION_PROLOG_PSERIES(PACA_EXGEN, label##_common)
+
+#define STD_EXCEPTION_ISERIES(n, label, area)		\
+	.globl label##_Iseries;				\
+label##_Iseries:					\
+	HMT_MEDIUM;					\
+	mtspr	SPRG1,r13;		/* save r13 */	\
+	EXCEPTION_PROLOG_ISERIES_1(area);		\
+	EXCEPTION_PROLOG_ISERIES_2;			\
 	b	label##_common
 
-#define MASKABLE_EXCEPTION_ISERIES( n, label )	\
-	.globl label##_Iseries;			\
-label##_Iseries:				\
-	EXCEPTION_PROLOG_ISERIES( n );		\
-	lbz	r22,PACAPROFENABLED(r20);	\
-	cmpi	0,r22,0;			\
-	bne-	label##_Iseries_profile;	\
-label##_Iseries_prof_ret:			\
-	lbz	r22,PACAPROCENABLED(r20);	\
-	cmpi	0,r22,0;			\
-	beq-	label##_Iseries_masked;		\
-	b	label##_common;			\
-label##_Iseries_profile:			\
-	std	r24,48(r21);			\
-	std	r25,56(r21);			\
-	mflr	r24;				\
-	bl	do_profile;			\
-	mtlr	r24;				\
-	ld	r24,48(r21);			\
-	ld	r25,56(r21);			\
+#define MASKABLE_EXCEPTION_ISERIES(n, label)				\
+	.globl label##_Iseries;						\
+label##_Iseries:							\
+	HMT_MEDIUM;							\
+	mtspr	SPRG1,r13;		/* save r13 */			\
+	EXCEPTION_PROLOG_ISERIES_1(PACA_EXGEN);				\
+	lbz	r10,PACAPROFENABLED(r13);				\
+	cmpwi	r10,0;							\
+	bne-	label##_Iseries_profile;				\
+label##_Iseries_prof_ret:						\
+	lbz	r10,PACAPROCENABLED(r13);				\
+	cmpwi	0,r10,0;						\
+	beq-	label##_Iseries_masked;					\
+	EXCEPTION_PROLOG_ISERIES_2;					\
+	b	label##_common;						\
+label##_Iseries_profile:						\
+	ld	r12,PACALPPACA+LPPACASRR1(r13);				\
+	andi.	r12,r12,MSR_PR;		/* Test if in kernel */		\
+	bne	label##_Iseries_prof_ret;				\
+	ld	r11,PACALPPACA+LPPACASRR0(r13);				\
+	ld	r12,PACAPROFSTEXT(r13);	/* _stext */			\
+	subf	r11,r12,r11;		/* offset into kernel */	\
+	lwz	r12,PACAPROFSHIFT(r13);					\
+	srd	r11,r11,r12;						\
+	lwz	r12,PACAPROFLEN(r13);	/* profile table length - 1 */	\
+	cmpd	r11,r12;		/* off end? */			\
+	ble	1f;							\
+	mr	r11,r12;		/* force into last entry */	\
+1:	sldi	r11,r11,2;		/* convert to offset */		\
+	ld	r12,PACAPROFBUFFER(r13);/* profile buffer */		\
+	add	r12,r12,r11;						\
+2:	lwarx	r11,0,r12;		/* atomically increment */	\
+	addi	r11,r11,1;						\
+	stwcx.	r11,0,r12;						\
+	bne-	2b;							\
 	b	label##_Iseries_prof_ret
 
-#define STD_EXCEPTION_COMMON( trap, label, hdlr )	\
-	.globl label##_common;			\
-label##_common:					\
-	EXCEPTION_PROLOG_COMMON;		\
-	addi	r3,r1,STACK_FRAME_OVERHEAD;	\
-	li	r20,0;				\
-	li	r6,trap;			\
-	bl      .save_remaining_regs;           \
-	bl      hdlr;                           \
-	b       .ret_from_except
+#ifdef DO_SOFT_DISABLE
+#define DISABLE_INTS				\
+	lbz	r10,PACAPROCENABLED(r13);	\
+	li	r11,0;				\
+	std	r10,SOFTE(r1);			\
+	mfmsr	r10;				\
+	stb	r11,PACAPROCENABLED(r13);	\
+	ori	r10,r10,MSR_EE;			\
+	mtmsrd	r10,1
+
+#define ENABLE_INTS				\
+	lbz	r10,PACAPROCENABLED(r13);	\
+	mfmsr	r11;				\
+	std	r10,SOFTE(r1);			\
+	ori	r11,r11,MSR_EE;			\
+	mtmsrd	r11,1
+
+#else	/* hard enable/disable interrupts */
+#define DISABLE_INTS
+
+#define ENABLE_INTS				\
+	ld	r12,_MSR(r1);			\
+	mfmsr	r11;				\
+	rlwimi	r11,r12,0,MSR_EE;		\
+	mtmsrd	r11,1
+
+#endif
+
+#define STD_EXCEPTION_COMMON(trap, label, hdlr)		\
+	.align	7;					\
+	.globl label##_common;				\
+label##_common:						\
+	EXCEPTION_PROLOG_COMMON(trap, PACA_EXGEN);	\
+	DISABLE_INTS;					\
+	bl	.save_nvgprs;				\
+	addi	r3,r1,STACK_FRAME_OVERHEAD;		\
+	bl	hdlr;					\
+	b	.ret_from_except
+
+#define STD_EXCEPTION_COMMON_LITE(trap, label, hdlr)	\
+	.align	7;					\
+	.globl label##_common;				\
+label##_common:						\
+	EXCEPTION_PROLOG_COMMON(trap, PACA_EXGEN);	\
+	DISABLE_INTS;					\
+	addi	r3,r1,STACK_FRAME_OVERHEAD;		\
+	bl	hdlr;					\
+	b	.ret_from_except_lite
 
 /*
  * Start of pSeries system interrupt routines
@@ -384,22 +409,115 @@ label##_common:					\
 	.globl __start_interrupts
 __start_interrupts:
 
-	STD_EXCEPTION_PSERIES( 0x100, SystemReset )
-	STD_EXCEPTION_PSERIES( 0x200, MachineCheck )
-	STD_EXCEPTION_PSERIES( 0x300, DataAccess )
-	STD_EXCEPTION_PSERIES( 0x380, DataAccessSLB )
-	STD_EXCEPTION_PSERIES( 0x400, InstructionAccess )
-	STD_EXCEPTION_PSERIES( 0x480, InstructionAccessSLB )
-	STD_EXCEPTION_PSERIES( 0x500, HardwareInterrupt )
-	STD_EXCEPTION_PSERIES( 0x600, Alignment )
-	STD_EXCEPTION_PSERIES( 0x700, ProgramCheck )
-	STD_EXCEPTION_PSERIES( 0x800, FPUnavailable )
-	STD_EXCEPTION_PSERIES( 0x900, Decrementer )
-	STD_EXCEPTION_PSERIES( 0xa00, Trap_0a )
-	STD_EXCEPTION_PSERIES( 0xb00, Trap_0b )
-	STD_EXCEPTION_PSERIES( 0xc00, SystemCall )
-	STD_EXCEPTION_PSERIES( 0xd00, SingleStep )
-	STD_EXCEPTION_PSERIES( 0xe00, Trap_0e )
+	STD_EXCEPTION_PSERIES(0x100, SystemReset)
+
+	. = 0x200
+_MachineCheckPseries:
+	HMT_MEDIUM
+	mtspr	SPRG1,r13		/* save r13 */
+	EXCEPTION_PROLOG_PSERIES(PACA_EXMC, MachineCheck_common)
+
+	. = 0x300
+	.globl DataAccess_Pseries
+DataAccess_Pseries:
+	HMT_MEDIUM
+	mtspr	SPRG1,r13
+BEGIN_FTR_SECTION
+	mtspr	SPRG2,r12
+	mfspr	r13,DAR
+	mfspr	r12,DSISR
+	srdi	r13,r13,60
+	rlwimi	r13,r12,16,0x20
+	mfcr	r12
+	cmpwi	r13,0x2c
+	beq	.do_stab_bolted_Pseries
+	mtcrf	0x80,r12
+	mfspr	r12,SPRG2
+END_FTR_SECTION_IFCLR(CPU_FTR_SLB)
+	EXCEPTION_PROLOG_PSERIES(PACA_EXGEN, DataAccess_common)
+
+	. = 0x380
+	.globl DataAccessSLB_Pseries
+DataAccessSLB_Pseries:
+	HMT_MEDIUM
+	mtspr	SPRG1,r13
+	mfspr	r13,SPRG3		/* get paca address into r13 */
+	std	r9,PACA_EXSLB+EX_R9(r13)	/* save r9 - r12 */
+	std	r10,PACA_EXSLB+EX_R10(r13)
+	std	r11,PACA_EXSLB+EX_R11(r13)
+	std	r12,PACA_EXSLB+EX_R12(r13)
+	std	r3,PACASLBR3(r13)
+	mfspr	r9,SPRG1
+	std	r9,PACA_EXSLB+EX_R13(r13)
+	mfcr	r9
+	clrrdi	r12,r13,32		/* get high part of &label */
+	mfmsr	r10
+	mfspr	r11,SRR0		/* save SRR0 */
+	ori	r12,r12,(.do_slb_miss)@l
+	ori	r10,r10,MSR_IR|MSR_DR	/* DON'T set RI for SLB miss */
+	mtspr	SRR0,r12
+	mfspr	r12,SRR1		/* and SRR1 */
+	mtspr	SRR1,r10
+	mfspr	r3,DAR
+	rfid
+	b	.	/* prevent speculative execution */
+
+	STD_EXCEPTION_PSERIES(0x400, InstructionAccess)
+
+	. = 0x480
+	.globl InstructionAccessSLB_Pseries
+InstructionAccessSLB_Pseries:
+	HMT_MEDIUM
+	mtspr	SPRG1,r13
+	mfspr	r13,SPRG3		/* get paca address into r13 */
+	std	r9,PACA_EXSLB+EX_R9(r13)	/* save r9 - r12 */
+	std	r10,PACA_EXSLB+EX_R10(r13)
+	std	r11,PACA_EXSLB+EX_R11(r13)
+	std	r12,PACA_EXSLB+EX_R12(r13)
+	std	r3,PACASLBR3(r13)
+	mfspr	r9,SPRG1
+	std	r9,PACA_EXSLB+EX_R13(r13)
+	mfcr	r9
+	clrrdi	r12,r13,32		/* get high part of &label */
+	mfmsr	r10
+	mfspr	r11,SRR0		/* save SRR0 */
+	ori	r12,r12,(.do_slb_miss)@l
+	ori	r10,r10,MSR_IR|MSR_DR	/* DON'T set RI for SLB miss */
+	mtspr	SRR0,r12
+	mfspr	r12,SRR1		/* and SRR1 */
+	mtspr	SRR1,r10
+	mr	r3,r11			/* SRR0 is faulting address */
+	rfid
+	b	.	/* prevent speculative execution */
+
+	STD_EXCEPTION_PSERIES(0x500, HardwareInterrupt)
+	STD_EXCEPTION_PSERIES(0x600, Alignment)
+	STD_EXCEPTION_PSERIES(0x700, ProgramCheck)
+	STD_EXCEPTION_PSERIES(0x800, FPUnavailable)
+	STD_EXCEPTION_PSERIES(0x900, Decrementer)
+	STD_EXCEPTION_PSERIES(0xa00, Trap_0a)
+	STD_EXCEPTION_PSERIES(0xb00, Trap_0b)
+
+	. = 0xc00
+	.globl	SystemCall_Pseries
+SystemCall_Pseries:
+	HMT_MEDIUM
+	mr	r9,r13
+	mfmsr	r10
+	mfspr	r13,SPRG3
+	mfspr	r11,SRR0
+	clrrdi	r12,r13,32
+	oris	r12,r12,SystemCall_common@h
+	ori	r12,r12,SystemCall_common@l
+	mtspr	SRR0,r12
+	ori	r10,r10,MSR_IR|MSR_DR|MSR_RI
+	mfspr	r12,SRR1
+	mtspr	SRR1,r10
+	rfid
+	b	.	/* prevent speculative execution */
+
+	STD_EXCEPTION_PSERIES(0xd00, SingleStep)
+	STD_EXCEPTION_PSERIES(0xe00, Trap_0e)
 
 	/* We need to deal with the Altivec unavailable exception
 	 * here which is at 0xf20, thus in the middle of the
@@ -407,27 +525,23 @@ __start_interrupts:
 	 * trickery is thus necessary
 	 */
 	. = 0xf00
-	b	.PerformanceMonitor_Pseries
-	. = 0xf20
-	b	.AltivecUnavailable_Pseries
+	b	PerformanceMonitor_Pseries
 
-	STD_EXCEPTION_PSERIES( 0x1300, InstructionBreakpoint )
-	STD_EXCEPTION_PSERIES( 0x1700, AltivecAssist )
+	STD_EXCEPTION_PSERIES(0xf20, AltivecUnavailable)
+
+	STD_EXCEPTION_PSERIES(0x1300, InstructionBreakpoint)
+	STD_EXCEPTION_PSERIES(0x1700, AltivecAssist)
+
+	/* moved from 0xf00 */
+	STD_EXCEPTION_PSERIES(0x3000, PerformanceMonitor)
 
-	/* Here are the "moved" performance monitor and
-	 * altivec unavailable exceptions
-	 */
-	. = 0x3000
-	.globl PerformanceMonitor_Pseries;
-.PerformanceMonitor_Pseries:
-	EXCEPTION_PROLOG_PSERIES(0xf00, PerformanceMonitor_common)
-	
 	. = 0x3100
-	.globl AltivecUnavailable_Pseries;
-.AltivecUnavailable_Pseries:
-	EXCEPTION_PROLOG_PSERIES(0xf20, AltivecUnavailable_common)
+_GLOBAL(do_stab_bolted_Pseries)
+	mtcrf	0x80,r12
+	mfspr	r12,SPRG2
+	EXCEPTION_PROLOG_PSERIES(PACA_EXSLB, .do_stab_bolted)
+
 	
-		
 	/* Space for the naca.  Architected to be located at real address
 	 * NACA_PHYS_ADDR.  Various tools rely on this location being fixed.
 	 * The first dword of the naca is required by iSeries LPAR to
@@ -466,16 +580,16 @@ __end_systemcfg:
 	 * VSID generation algorithm.  See include/asm/mmu_context.h.
 	 */
 
-	.llong	1		/* # ESIDs to be mapped by hypervisor         */
+	.llong	1		/* # ESIDs to be mapped by hypervisor	 */
 	.llong	1		/* # memory ranges to be mapped by hypervisor */
-	.llong	STAB0_PAGE	/* Page # of segment table within load area   */
+	.llong	STAB0_PAGE	/* Page # of segment table within load area	*/
+	.llong	0		/* Reserved */
+	.llong	0		/* Reserved */
 	.llong	0		/* Reserved */
-	.llong  0		/* Reserved */
-	.llong  0		/* Reserved */
 	.llong	0		/* Reserved */
 	.llong	0		/* Reserved */
 	.llong	0x0c00000000	/* ESID to map (Kernel at EA = 0xC000000000000000) */
-	.llong	0x06a99b4b14    /* VSID to map (Kernel at VA = 0x6a99b4b140000000) */
+	.llong	0x06a99b4b14	/* VSID to map (Kernel at VA = 0x6a99b4b140000000) */
 	.llong	8192		/* # pages to map (32 MB) */
 	.llong	0		/* Offset from start of loadarea to start of map */
 	.llong	0x0006a99b4b140000	/* VPN of first page to map */
@@ -484,22 +598,74 @@ __end_systemcfg:
 
 /***  ISeries-LPAR interrupt handlers ***/
 
-	STD_EXCEPTION_ISERIES( 0x200, MachineCheck )
-	STD_EXCEPTION_ISERIES( 0x300, DataAccess )
-	STD_EXCEPTION_ISERIES( 0x380, DataAccessSLB )
-	STD_EXCEPTION_ISERIES( 0x400, InstructionAccess )
-	STD_EXCEPTION_ISERIES( 0x480, InstructionAccessSLB )
-	MASKABLE_EXCEPTION_ISERIES( 0x500, HardwareInterrupt )
-	STD_EXCEPTION_ISERIES( 0x600, Alignment )
-	STD_EXCEPTION_ISERIES( 0x700, ProgramCheck )
-	STD_EXCEPTION_ISERIES( 0x800, FPUnavailable )
-	MASKABLE_EXCEPTION_ISERIES( 0x900, Decrementer )
-	STD_EXCEPTION_ISERIES( 0xa00, Trap_0a )
-	STD_EXCEPTION_ISERIES( 0xb00, Trap_0b )
-	STD_EXCEPTION_ISERIES( 0xc00, SystemCall )
-	STD_EXCEPTION_ISERIES( 0xd00, SingleStep )
-	STD_EXCEPTION_ISERIES( 0xe00, Trap_0e )
-	STD_EXCEPTION_ISERIES( 0xf00, PerformanceMonitor )
+	STD_EXCEPTION_ISERIES(0x200, MachineCheck, PACA_EXMC)
+
+	.globl DataAccess_Iseries
+DataAccess_Iseries:
+	mtspr	SPRG1,r13
+BEGIN_FTR_SECTION
+	mtspr	SPRG2,r12
+	mfspr	r13,DAR
+	mfspr	r12,DSISR
+	srdi	r13,r13,60
+	rlwimi	r13,r12,16,0x20
+	mfcr	r12
+	cmpwi	r13,0x2c
+	beq	.do_stab_bolted_Iseries
+	mtcrf	0x80,r12
+	mfspr	r12,SPRG2
+END_FTR_SECTION_IFCLR(CPU_FTR_SLB)
+	EXCEPTION_PROLOG_ISERIES_1(PACA_EXGEN)
+	EXCEPTION_PROLOG_ISERIES_2
+	b	DataAccess_common
+
+.do_stab_bolted_Iseries:
+	mtcrf	0x80,r12
+	mfspr	r12,SPRG2
+	EXCEPTION_PROLOG_ISERIES_1(PACA_EXSLB)
+	EXCEPTION_PROLOG_ISERIES_2
+	b	.do_stab_bolted
+
+	.globl	DataAccessSLB_Iseries
+DataAccessSLB_Iseries:
+	mtspr	SPRG1,r13		/* save r13 */
+	EXCEPTION_PROLOG_ISERIES_1(PACA_EXSLB)
+	std	r3,PACASLBR3(r13)
+	ld	r11,PACALPPACA+LPPACASRR0(r13)
+	ld	r12,PACALPPACA+LPPACASRR1(r13)
+	mfspr	r3,DAR
+	b	.do_slb_miss
+
+	STD_EXCEPTION_ISERIES(0x400, InstructionAccess, PACA_EXGEN)
+
+	.globl	InstructionAccessSLB_Iseries
+InstructionAccessSLB_Iseries:
+	mtspr	SPRG1,r13		/* save r13 */
+	EXCEPTION_PROLOG_ISERIES_1(PACA_EXSLB)
+	std	r3,PACASLBR3(r13)
+	ld	r11,PACALPPACA+LPPACASRR0(r13)
+	ld	r12,PACALPPACA+LPPACASRR1(r13)
+	mr	r3,r11
+	b	.do_slb_miss
+
+	MASKABLE_EXCEPTION_ISERIES(0x500, HardwareInterrupt)
+	STD_EXCEPTION_ISERIES(0x600, Alignment, PACA_EXGEN)
+	STD_EXCEPTION_ISERIES(0x700, ProgramCheck, PACA_EXGEN)
+	STD_EXCEPTION_ISERIES(0x800, FPUnavailable, PACA_EXGEN)
+	MASKABLE_EXCEPTION_ISERIES(0x900, Decrementer)
+	STD_EXCEPTION_ISERIES(0xa00, Trap_0a, PACA_EXGEN)
+	STD_EXCEPTION_ISERIES(0xb00, Trap_0b, PACA_EXGEN)
+
+	.globl	SystemCall_Iseries
+SystemCall_Iseries:
+	mr	r9,r13
+	mfspr	r13,SPRG3
+	EXCEPTION_PROLOG_ISERIES_2
+	b	SystemCall_common
+
+	STD_EXCEPTION_ISERIES( 0xd00, SingleStep, PACA_EXGEN)
+	STD_EXCEPTION_ISERIES( 0xe00, Trap_0e, PACA_EXGEN)
+	STD_EXCEPTION_ISERIES( 0xf00, PerformanceMonitor, PACA_EXGEN)
 
 	.globl SystemReset_Iseries
 SystemReset_Iseries:
@@ -508,7 +674,7 @@ SystemReset_Iseries:
 	ori	r24,r24,MSR_RI
 	mtmsrd	r24			/* RI on */
 	lhz	r24,PACAPACAINDEX(r13)	/* Get processor # */
-	cmpi	0,r24,0			/* Are we processor 0? */
+	cmpwi	0,r24,0			/* Are we processor 0? */
 	beq	.__start_initialization_iSeries	/* Start up the first processor */
 	mfspr	r4,CTRLF
 	li	r5,RUNLATCH		/* Turn off the run light */
@@ -527,7 +693,7 @@ SystemReset_Iseries:
 	addi	r1,r3,THREAD_SIZE
 	subi	r1,r1,STACK_FRAME_OVERHEAD
 
-	cmpi	0,r23,0
+	cmpwi	0,r23,0
 	beq	iseries_secondary_smp_loop	/* Loop until told to go */
 #ifdef SECONDARY_PROCESSORS
 	bne	.__secondary_start		/* Loop until told to go */
@@ -539,7 +705,7 @@ iseries_secondary_smp_loop:
 	rldicr	r3,r3,32,15		/* r0 = (r3 << 32) & 0xffff000000000000 */
 #else /* CONFIG_SMP */
 	/* Yield the processor.  This is required for non-SMP kernels
-	   which are running on multi-threaded machines. */
+		which are running on multi-threaded machines. */
 	lis	r3,0x8000
 	rldicr	r3,r3,32,15		/* r3 = (r3 << 32) & 0xffff000000000000 */
 	addi	r3,r3,18		/* r3 = 0x8000000000000012 which is "yield" */
@@ -552,32 +718,34 @@ iseries_secondary_smp_loop:
 	b	1b			/* If SMP not configured, secondaries
 					 * loop forever */
 
-	.globl HardwareInterrupt_Iseries_masked
-HardwareInterrupt_Iseries_masked:
-	b	maskable_exception_exit
-
 	.globl Decrementer_Iseries_masked
 Decrementer_Iseries_masked:
-	li	r22,1
-	stb	r22,PACALPPACA+LPPACADECRINT(r20)
-	lwz	r22,PACADEFAULTDECR(r20)
-	mtspr	DEC,r22
-maskable_exception_exit:
-	mtcrf	0xff,r23		/* Restore regs and free exception frame */
-	ld	r22,EX_SRR0(r21)
-	ld	r23,EX_SRR1(r21)
-	mtspr	SRR0,r22
-	mtspr	SRR1,r23
-	ld	r22,EX_R22(r21)
-	ld	r23,EX_R23(r21)
-	mfspr	r21,SPRG1
-	mfspr	r20,SPRG2
+	li	r11,1
+	stb	r11,PACALPPACA+LPPACADECRINT(r13)
+	lwz	r12,PACADEFAULTDECR(r13)
+	mtspr	SPRN_DEC,r12
+	/* fall through */
+
+	.globl HardwareInterrupt_Iseries_masked
+HardwareInterrupt_Iseries_masked:
+	mtcrf	0x80,r9		/* Restore regs */
+	ld	r11,PACALPPACA+LPPACASRR0(r13)
+	ld	r12,PACALPPACA+LPPACASRR1(r13)
+	mtspr	SRR0,r11
+	mtspr	SRR1,r12
+	ld	r9,PACA_EXGEN+EX_R9(r13)
+	ld	r10,PACA_EXGEN+EX_R10(r13)
+	ld	r11,PACA_EXGEN+EX_R11(r13)
+	ld	r12,PACA_EXGEN+EX_R12(r13)
+	ld	r13,PACA_EXGEN+EX_R13(r13)
 	rfid
+	b	.	/* prevent speculative execution */
 #endif
+
 /*
  * Data area reserved for FWNMI option.
  */
-        .= 0x7000
+	.= 0x7000
 	.globl fwnmi_data_area
 fwnmi_data_area:
 
@@ -587,10 +755,14 @@ fwnmi_data_area:
 	. = 0x8000
 	.globl SystemReset_FWNMI
 SystemReset_FWNMI:
-	EXCEPTION_PROLOG_PSERIES(0x100, SystemReset_common)
+	HMT_MEDIUM
+	mtspr	SPRG1,r13		/* save r13 */
+	EXCEPTION_PROLOG_PSERIES(PACA_EXGEN, SystemReset_common)
 	.globl MachineCheck_FWNMI
 MachineCheck_FWNMI:
-	EXCEPTION_PROLOG_PSERIES(0x200, MachineCheck_common)
+	HMT_MEDIUM
+	mtspr	SPRG1,r13		/* save r13 */
+	EXCEPTION_PROLOG_PSERIES(PACA_EXMC, MachineCheck_common)
 
 	/*
 	 * Space for the initial segment table
@@ -608,327 +780,238 @@ __end_stab:
 
 /*** Common interrupt handlers ***/
 
-	STD_EXCEPTION_COMMON( 0x100, SystemReset, .SystemResetException )
-	STD_EXCEPTION_COMMON( 0x200, MachineCheck, .MachineCheckException )
-	STD_EXCEPTION_COMMON( 0x900, Decrementer, .timer_interrupt )
-	STD_EXCEPTION_COMMON( 0xa00, Trap_0a, .UnknownException )
-	STD_EXCEPTION_COMMON( 0xb00, Trap_0b, .UnknownException )
-	STD_EXCEPTION_COMMON( 0xd00, SingleStep, .SingleStepException )
-	STD_EXCEPTION_COMMON( 0xe00, Trap_0e, .UnknownException )
-	STD_EXCEPTION_COMMON( 0xf00, PerformanceMonitor, .PerformanceMonitorException )
-	STD_EXCEPTION_COMMON(0x1300, InstructionBreakpoint, .InstructionBreakpointException )
+	STD_EXCEPTION_COMMON(0x100, SystemReset, .SystemResetException)
+
+	/*
+	 * Machine check is different because we use a different
+	 * save area: PACA_EXMC instead of PACA_EXGEN.
+	 */
+	.align	7
+	.globl MachineCheck_common
+MachineCheck_common:
+	EXCEPTION_PROLOG_COMMON(0x200, PACA_EXMC)
+	DISABLE_INTS
+	bl	.save_nvgprs
+	addi	r3,r1,STACK_FRAME_OVERHEAD
+	bl	.MachineCheckException
+	b	.ret_from_except
+
+	STD_EXCEPTION_COMMON_LITE(0x900, Decrementer, .timer_interrupt)
+	STD_EXCEPTION_COMMON(0xa00, Trap_0a, .UnknownException)
+	STD_EXCEPTION_COMMON(0xb00, Trap_0b, .UnknownException)
+	STD_EXCEPTION_COMMON(0xd00, SingleStep, .SingleStepException)
+	STD_EXCEPTION_COMMON(0xe00, Trap_0e, .UnknownException)
+	STD_EXCEPTION_COMMON(0xf00, PerformanceMonitor, .PerformanceMonitorException)
+	STD_EXCEPTION_COMMON(0x1300, InstructionBreakpoint, .InstructionBreakpointException)
 #ifdef CONFIG_ALTIVEC
-	STD_EXCEPTION_COMMON(0x1700, AltivecAssist, .AltivecAssistException )
+	STD_EXCEPTION_COMMON(0x1700, AltivecAssist, .AltivecAssistException)
 #else
-	STD_EXCEPTION_COMMON(0x1700, AltivecAssist, .UnknownException )
+	STD_EXCEPTION_COMMON(0x1700, AltivecAssist, .UnknownException)
 #endif
 
 /*
- * Here the exception frame is filled out and we have detected that
- * the kernel stack pointer is bad.  R23 contains the saved CR, r20
- * points to the paca, r21 points to the exception frame, and r22
- * contains the (bad) kernel stack pointer.
+ * Here we have detected that the kernel stack pointer is bad.
+ * R9 contains the saved CR, r13 points to the paca,
+ * r10 contains the (bad) kernel stack pointer,
+ * r11 and r12 contain the saved SRR0 and SRR1.
  * We switch to using the paca guard page as an emergency stack,
- * save the registers on there, and call kernel_bad_stack(),
- * which panics.
+ * save the registers there, and call kernel_bad_stack(), which panics.
  */
 bad_stack:
-	addi	r1,r20,8192-64-INT_FRAME_SIZE
-	std	r22,GPR1(r1)
-	std	r23,_CCR(r1)
-	ld	r22,EX_R20(r21)
-	std	r22,GPR20(r1)
-	ld	r23,EX_R21(r21)
-	std	r23,GPR21(r1)
-	ld	r22,EX_R22(r21)
-	std	r22,GPR22(r1)
-	ld	r23,EX_R23(r21)
-	std	r23,GPR23(r1)
-	ld	r23,EX_DAR(r21)
-	std	r23,_DAR(r1)
-	lwz     r22,EX_DSISR(r21)
-	std	r22,_DSISR(r1)
-	lwz	r23,EX_TRAP(r21)
-	std	r23,TRAP(r1)
-	ld	r22,EX_SRR0(r21)
-	ld	r23,EX_SRR1(r21)
-	std	r22,_NIP(r1)
-	std	r23,_MSR(r1)
-	addi	r21,r21,-EXC_FRAME_SIZE
-	std	r21,PACAEXCSP(r20)
-	mflr	r22
-	std	r22,_LINK(r1)
-	mfctr	r23
-	std	r23,_CTR(r1)
-	mfspr	r22,XER
-	std	r22,_XER(r1)
-	SAVE_GPR(0, r1)
-	SAVE_10GPRS(2, r1)
-	SAVE_8GPRS(12, r1)
-	SAVE_8GPRS(24, r1)
-	addi	r21,r1,INT_FRAME_SIZE
-	std	r21,0(r1)
-	li	r22,0
-	std	r22,0(r21)
-	ld	r2,PACATOC(r20)
-	mr	r13,r20
+	ld	r1,PACAEMERGSP(r13)
+	subi	r1,r1,64+INT_FRAME_SIZE
+	std	r9,_CCR(r1)
+	std	r10,GPR1(r1)
+	std	r11,_NIP(r1)
+	std	r12,_MSR(r1)
+	mfspr	r11,DAR
+	mfspr	r12,DSISR
+	std	r11,_DAR(r1)
+	std	r12,_DSISR(r1)
+	mflr	r10
+	mfctr	r11
+	mfxer	r12
+	std	r10,_LINK(r1)
+	std	r11,_CTR(r1)
+	std	r12,_XER(r1)
+	SAVE_GPR(0,r1)
+	SAVE_GPR(2,r1)
+	SAVE_4GPRS(3,r1)
+	SAVE_2GPRS(7,r1)
+	SAVE_10GPRS(12,r1)
+	SAVE_10GPRS(22,r1)
+	addi	r11,r1,INT_FRAME_SIZE
+	std	r11,0(r1)
+	li	r12,0
+	std	r12,0(r11)
+	ld	r2,PACATOC(r13)
 1:	addi	r3,r1,STACK_FRAME_OVERHEAD
 	bl	.kernel_bad_stack
 	b	1b
 
 /*
- * Return from an exception which is handled without calling
- * save_remaining_regs.  The caller is assumed to have done
- * EXCEPTION_PROLOG_COMMON.
+ * Return from an exception with minimal checks.
+ * The caller is assumed to have done EXCEPTION_PROLOG_COMMON.
+ * If interrupts have been enabled, or anything has been
+ * done that might have changed the scheduling status of
+ * any task or sent any task a signal, you should use
+ * ret_from_except or ret_from_except_lite instead of this.
  */
 fast_exception_return:
-	andi.	r3,r23,MSR_RI		/* check if RI is set */
+	ld	r12,_MSR(r1)
+	ld	r11,_NIP(r1)
+	andi.	r3,r12,MSR_RI		/* check if RI is set */
 	beq-	unrecov_fer
-	ld      r3,_CCR(r1)
-	ld      r4,_LINK(r1)
-	ld      r5,_CTR(r1)
-	ld      r6,_XER(r1)
-	mtcr    r3
-	mtlr    r4
-	mtctr   r5
-	mtspr   XER,r6
+	ld	r3,_CCR(r1)
+	ld	r4,_LINK(r1)
+	ld	r5,_CTR(r1)
+	ld	r6,_XER(r1)
+	mtcr	r3
+	mtlr	r4
+	mtctr	r5
+	mtxer	r6
 	REST_GPR(0, r1)
 	REST_8GPRS(2, r1)
-	REST_4GPRS(10, r1)
 
-	mfmsr	r20
-	li	r21, MSR_RI
-	andc	r20,r20,r21
-	mtmsrd	r20,1
+	mfmsr	r10
+	clrrdi	r10,r10,2		/* clear RI (LE is 0 already) */
+	mtmsrd	r10,1
 
-	mtspr   SRR1,r23
-	mtspr   SRR0,r22
-	REST_4GPRS(20, r1)
-	ld      r1,GPR1(r1)
+	mtspr	SRR1,r12
+	mtspr	SRR0,r11
+	REST_4GPRS(10, r1)
+	ld	r1,GPR1(r1)
 	rfid
+	b	.	/* prevent speculative execution */
 
 unrecov_fer:
-	li	r6,0x4000
-	li	r20,0
-	bl	.save_remaining_regs
+	bl	.save_nvgprs
 1:	addi	r3,r1,STACK_FRAME_OVERHEAD
 	bl	.unrecoverable_exception
 	b	1b
 
 /*
- * Here r20 points to the PACA, r21 to the exception frame,
- * r23 contains the saved CR.
- * r20 - r23, SRR0 and SRR1 are saved in the exception frame.
+ * Here r13 points to the paca, r9 contains the saved CR,
+ * SRR0 and SRR1 are saved in r11 and r12,
+ * r9 - r13 are saved in paca->exgen.
  */
+	.align	7
 	.globl DataAccess_common
 DataAccess_common:
-BEGIN_FTR_SECTION
-	mfspr   r22,DAR
-	srdi    r22,r22,60
-	cmpi    0,r22,0xc
-
-	/* Segment fault on a bolted segment. Go off and map that segment. */
-	beq-	.do_stab_bolted
-END_FTR_SECTION_IFCLR(CPU_FTR_SLB)
-stab_bolted_user_return:
-	EXCEPTION_PROLOG_COMMON
-	ld      r3,_DSISR(r1)
-	andis.	r0,r3,0xa450		/* weird error? */
-	bne	1f			/* if not, try to put a PTE */
-	andis.	r0,r3,0x0020		/* Is it a page table fault? */
-	rlwinm	r4,r3,32-23,29,29	/* DSISR_STORE -> _PAGE_RW */
-	ld      r3,_DAR(r1)             /* into the hash table */
-
-BEGIN_FTR_SECTION
-	beq+	2f			/* If so handle it */
-	li	r4,0x300                /* Trap number */
-	bl	.do_stab_SI
-	b	1f
-END_FTR_SECTION_IFCLR(CPU_FTR_SLB)
-
-2:	li	r5,0x300
-	bl	.do_hash_page_DSI 	/* Try to handle as hpte fault */
-1:
-	ld      r4,_DAR(r1)
-	ld      r5,_DSISR(r1)
-	addi	r3,r1,STACK_FRAME_OVERHEAD
-	DO_COPY_EE()
-	li	r6,0x300
-	bl      .save_remaining_regs
-	bl      .do_page_fault
-	b       .ret_from_except
-
-	.globl DataAccessSLB_common
-DataAccessSLB_common:
-	mfspr   r22,DAR
-	srdi    r22,r22,60
-	cmpi    0,r22,0xc
-
-	/* Segment fault on a bolted segment. Go off and map that segment. */
-	beq     .do_slb_bolted
-
-	EXCEPTION_PROLOG_COMMON
-	ld      r3,_DAR(r1)
-	li      r4,0x380                /* Exception vector  */
-	bl	.slb_allocate
-	or.	r3,r3,r3		/* Check return code */
-	beq     fast_exception_return   /* Return if we succeeded */
-	addi	r3,r1,STACK_FRAME_OVERHEAD
-	DO_COPY_EE()
-	ld      r4,_DAR(r1)
-	li	r6,0x380
-	li	r5,0
-	bl      .save_remaining_regs
-	bl      .do_page_fault
-	b       .ret_from_except
-
+	mfspr	r10,DAR
+	std	r10,PACA_EXGEN+EX_DAR(r13)
+	mfspr	r10,DSISR
+	stw	r10,PACA_EXGEN+EX_DSISR(r13)
+	EXCEPTION_PROLOG_COMMON(0x300, PACA_EXGEN)
+	ld	r3,PACA_EXGEN+EX_DAR(r13)
+	lwz	r4,PACA_EXGEN+EX_DSISR(r13)
+	li	r5,0x300
+	b	.do_hash_page	 	/* Try to handle as hpte fault */
+
+	.align	7
 	.globl InstructionAccess_common
 InstructionAccess_common:
-	EXCEPTION_PROLOG_COMMON
-
-BEGIN_FTR_SECTION
-	andis.	r0,r23,0x0020		/* no ste found? */
-	beq+	2f
-	mr	r3,r22			/* SRR0 at interrupt */
-	li	r4,0x400		/* Trap number       */
-	bl	.do_stab_SI
-	b	1f
-END_FTR_SECTION_IFCLR(CPU_FTR_SLB)
-
-2:	mr	r3,r22
+	EXCEPTION_PROLOG_COMMON(0x400, PACA_EXGEN)
+	ld	r3,_NIP(r1)
+	andis.	r4,r12,0x5820
 	li	r5,0x400
-	bl	.do_hash_page_ISI	/* Try to handle as hpte fault */
-1:
-	mr	r4,r22
-	rlwinm	r5,r23,0,4,4		/* We only care about PR in error_code */
-	addi	r3,r1,STACK_FRAME_OVERHEAD
-	DO_COPY_EE()
-	li	r6,0x400
-	bl      .save_remaining_regs
-	bl      .do_page_fault
-	b       .ret_from_except
-
-	.globl InstructionAccessSLB_common
-InstructionAccessSLB_common:
-	EXCEPTION_PROLOG_COMMON
-	mr      r3,r22                  /* SRR0 = NIA        */
-	li	r4,0x480                /* Exception vector  */
-	bl	.slb_allocate
-	or.	r3,r3,r3		/* Check return code */
-	beq+	fast_exception_return   /* Return if we succeeded */
-
-	addi	r3,r1,STACK_FRAME_OVERHEAD
-	DO_COPY_EE()
-	mr      r4,r22                  /* SRR0 = NIA        */
-	li	r6,0x480
-	li	r5,0
-	bl      .save_remaining_regs
-	bl      .do_page_fault
-	b       .ret_from_except
+	b	.do_hash_page		/* Try to handle as hpte fault */
 
+	.align	7
 	.globl HardwareInterrupt_common
+	.globl HardwareInterrupt_entry
 HardwareInterrupt_common:
-	EXCEPTION_PROLOG_COMMON
+	EXCEPTION_PROLOG_COMMON(0x500, PACA_EXGEN)
 HardwareInterrupt_entry:
+	DISABLE_INTS
 	addi	r3,r1,STACK_FRAME_OVERHEAD
-	li	r20,0
-	li	r6,0x500
-	bl      .save_remaining_regs
-	bl      .do_IRQ
-	b       .ret_from_except
+	bl	.do_IRQ
+	b	.ret_from_except_lite
 
+	.align	7
 	.globl Alignment_common
 Alignment_common:
-	EXCEPTION_PROLOG_COMMON
+	mfspr	r10,DAR
+	std	r10,PACA_EXGEN+EX_DAR(r13)
+	mfspr	r10,DSISR
+	stw	r10,PACA_EXGEN+EX_DSISR(r13)
+	EXCEPTION_PROLOG_COMMON(0x600, PACA_EXGEN)
+	ld	r3,PACA_EXGEN+EX_DAR(r13)
+	lwz	r4,PACA_EXGEN+EX_DSISR(r13)
+	std	r3,_DAR(r1)
+	std	r4,_DSISR(r1)
+	bl	.save_nvgprs
 	addi	r3,r1,STACK_FRAME_OVERHEAD
-	DO_COPY_EE()
-	li	r6,0x600
-	bl      .save_remaining_regs
-	bl      .AlignmentException
-	b       .ret_from_except
+	ENABLE_INTS
+	bl	.AlignmentException
+	b	.ret_from_except
 
+	.align	7
 	.globl ProgramCheck_common
 ProgramCheck_common:
-	EXCEPTION_PROLOG_COMMON
+	EXCEPTION_PROLOG_COMMON(0x700, PACA_EXGEN)
+	bl	.save_nvgprs
 	addi	r3,r1,STACK_FRAME_OVERHEAD
-	DO_COPY_EE()
-	li	r6,0x700
-	bl      .save_remaining_regs
-	bl      .ProgramCheckException
-	b       .ret_from_except
+	ENABLE_INTS
+	bl	.ProgramCheckException
+	b	.ret_from_except
 
+	.align	7
 	.globl FPUnavailable_common
 FPUnavailable_common:
-	EXCEPTION_PROLOG_COMMON
+	EXCEPTION_PROLOG_COMMON(0x800, PACA_EXGEN)
 	bne	.load_up_fpu		/* if from user, just load it up */
+	bl	.save_nvgprs
 	addi	r3,r1,STACK_FRAME_OVERHEAD
-	DO_COPY_EE()
-	li	r6,0x800
-	bl      .save_remaining_regs
-	bl      .KernelFPUnavailableException
+	ENABLE_INTS
+	bl	.KernelFPUnavailableException
 	BUG_OPCODE
 
+	.align	7
 	.globl AltivecUnavailable_common
 AltivecUnavailable_common:
-	EXCEPTION_PROLOG_COMMON
+	EXCEPTION_PROLOG_COMMON(0xf20, PACA_EXGEN)
 #ifdef CONFIG_ALTIVEC
-	bne	.load_up_altivec		/* if from user, just load it up */
+	bne	.load_up_altivec	/* if from user, just load it up */
 #endif
+	bl	.save_nvgprs
 	addi	r3,r1,STACK_FRAME_OVERHEAD
-	DO_COPY_EE()
-	li	r6,0xf20
-	bl      .save_remaining_regs
-#ifdef CONFIG_ALTIVEC
-	bl	.KernelAltivecUnavailableException
-#else
-	bl      .UnknownException
-#endif
-	BUG_OPCODE
-		
-	.globl SystemCall_common
-SystemCall_common:
-	EXCEPTION_PROLOG_COMMON
-#ifdef CONFIG_PPC_ISERIES
-	cmpi	0,r0,0x5555		/* Special syscall to handle pending */
-	bne+	1f			/* interrupts */
-	andi.	r6,r23,MSR_PR		/* Only allowed from kernel */
-	beq+	HardwareInterrupt_entry
-1:
-#endif
-	DO_COPY_EE()
-	li	r6,0xC00
-	bl      .save_remaining_regs
-	bl      .DoSyscall
-	b       .ret_from_except
-
-_GLOBAL(do_hash_page_ISI)
-	li	r4,0
-_GLOBAL(do_hash_page_DSI)
+	ENABLE_INTS
+	bl	.AltivecUnavailableException
+	b	.ret_from_except
+
+/*
+ * Hash table stuff
+ */
+	.align	7
+_GLOBAL(do_hash_page)
+	std	r3,_DAR(r1)
+	std	r4,_DSISR(r1)
+
+	andis.	r0,r4,0xa450		/* weird error? */
+	bne-	.handle_page_fault	/* if not, try to insert a HPTE */
+BEGIN_FTR_SECTION
+	andis.	r0,r4,0x0020		/* Is it a segment table fault? */
+	bne-	.do_ste_alloc		/* If so handle it */
+END_FTR_SECTION_IFCLR(CPU_FTR_SLB)
+
 	/*
 	 * We need to set the _PAGE_USER bit if MSR_PR is set or if we are
 	 * accessing a userspace segment (even from the kernel). We assume
 	 * kernel addresses always have the high bit set.
 	 */
-	rotldi	r0,r3,15		/* Move high bit into MSR_PR position */
-	orc	r0,r23,r0
-	rlwimi	r4,r0,32-13,30,30	/* Insert into _PAGE_USER */
+	rlwinm	r4,r4,32-23,29,29	/* DSISR_STORE -> _PAGE_RW */
+	rotldi	r0,r3,15		/* Move high bit into MSR_PR posn */
+	orc	r0,r12,r0		/* MSR_PR | ~high_bit */
+	rlwimi	r4,r0,32-13,30,30	/* becomes _PAGE_USER access bit */
 	ori	r4,r4,1			/* add _PAGE_PRESENT */
 
-	mflr	r21			/* Save LR in r21 */
-
-#ifdef DO_SOFT_DISABLE
 	/*
-	 * We hard enable here (but first soft disable) so that the hash_page
-	 * code can spin on the hash_table_lock with problem on a shared
-	 * processor.
+	 * On iSeries, we soft-disable interrupts here, then
+	 * hard-enable interrupts so that the hash_page code can spin on
+	 * the hash_table_lock without problems on a shared processor.
 	 */
-	li	r0,0
-	stb	r0,PACAPROCENABLED(r20)	/* Soft Disabled */
-
-	mfmsr	r0
-	ori	r0,r0,MSR_EE
-	mtmsrd	r0,1			/* Hard Enable */
-#endif
+	DISABLE_INTS
 
 	/*
 	 * r3 contains the faulting address
@@ -937,413 +1020,202 @@ _GLOBAL(do_hash_page_DSI)
 	 *
 	 * at return r3 = 0 for success
 	 */
-
 	bl	.hash_page		/* build HPTE if possible */
+	cmpdi	r3,0			/* see if hash_page succeeded */
 
 #ifdef DO_SOFT_DISABLE
 	/*
-	 * Now go back to hard disabled.
+	 * If we had interrupts soft-enabled at the point where the
+	 * DSI/ISI occurred, and an interrupt came in during hash_page,
+	 * handle it now.
+	 * We jump to ret_from_except_lite rather than fast_exception_return
+	 * because ret_from_except_lite will check for and handle pending
+	 * interrupts if necessary.
 	 */
-	mfmsr	r0
-	li	r4,0
-	ori	r4,r4,MSR_EE
-	andc	r0,r0,r4
-	mtmsrd	r0,1			/* Hard Disable */
-
-	ld	r0,SOFTE(r1)
-	cmpdi	0,r0,0			/* See if we will soft enable in */
-					/* save_remaining_regs */
-	beq	5f
-	CHECKANYINT(r4,r5)
-	bne-	HardwareInterrupt_entry	/* Convert this DSI into an External */
-					/* to process interrupts which occurred */
-					/* during hash_page */
-5:
-	stb	r0,PACAPROCENABLED(r20)	/* Restore soft enable/disable status */
+	beq	.ret_from_except_lite
+	/*
+	 * hash_page couldn't handle it, set soft interrupt enable back
+	 * to what it was before the trap.  Note that .local_irq_restore
+	 * handles any interrupts pending at this point.
+	 */
+	ld	r3,SOFTE(r1)
+	bl	.local_irq_restore
+	b	11f
+#else
+	beq	fast_exception_return   /* Return from exception on success */
+	/* fall through */
 #endif
-	or.	r3,r3,r3		/* Check return code */
-	beq     fast_exception_return   /* Return from exception on success */
 
-	mtlr    r21                     /* restore LR */
-	blr                             /* Return to DSI or ISI on failure */
+/* Here we have a page fault that hash_page can't handle. */
+_GLOBAL(handle_page_fault)
+	ENABLE_INTS
+11:	ld	r4,_DAR(r1)
+	ld	r5,_DSISR(r1)
+	addi	r3,r1,STACK_FRAME_OVERHEAD
+	bl	.do_page_fault
+	cmpdi	r3,0
+	beq+	.ret_from_except_lite
+	bl	.save_nvgprs
+	mr	r5,r3
+	addi	r3,r1,STACK_FRAME_OVERHEAD
+	lwz	r4,_DAR(r1)
+	bl	.bad_page_fault
+	b	.ret_from_except
+
+	/* here we have a segment miss */
+_GLOBAL(do_ste_alloc)
+	bl	.ste_allocate		/* try to insert stab entry */
+	cmpdi	r3,0
+	beq+	fast_exception_return
+	b	.handle_page_fault
 
 /*
- * r20 points to the PACA, r21 to the exception frame,
- * r23 contains the saved CR.
- * r20 - r23, SRR0 and SRR1 are saved in the exception frame.
+ * r13 points to the PACA, r9 contains the saved CR,
+ * r11 and r12 contain the saved SRR0 and SRR1.
+ * r9 - r13 are saved in paca->exslb.
  * We assume we aren't going to take any exceptions during this procedure.
+ * We assume (DAR >> 60) == 0xc.
  */
+	.align	7
 _GLOBAL(do_stab_bolted)
-	stw	r23,EX_CCR(r21)	/* save CR in exc. frame */
+	stw	r9,PACA_EXSLB+EX_CCR(r13)	/* save CR in exc. frame */
+	std	r11,PACA_EXSLB+EX_SRR0(r13)	/* save SRR0 in exc. frame */
 
-	mfspr   r22,DSISR
-	andis.  r22,r22,0x0020
-	beq-	stab_bolted_user_return
+	/* Hash to the primary group */
+	ld	r10,PACASTABVIRT(r13)
+	mfspr	r11,DAR
+	srdi	r11,r11,28
+	rldimi	r10,r11,7,52	/* r10 = first ste of the group */
 
+	/* Calculate VSID */
 	/* (((ea >> 28) & 0x1fff) << 15) | (ea >> 60) */
-	mfspr	r21,DAR
-	rldicl	r20,r21,36,51
-	sldi	r20,r20,15
-	srdi	r21,r21,60
-	or	r20,r20,r21
+	rldic	r11,r11,15,36
+	ori	r11,r11,0xc
 
 	/* VSID_RANDOMIZER */
-	li      r21,9
-	sldi    r21,r21,32
-	oris    r21,r21,58231
-	ori     r21,r21,39831
-
-	mulld   r20,r20,r21
-	clrldi  r20,r20,28      /* r20 = vsid */
+	li	r9,9
+	sldi	r9,r9,32
+	oris	r9,r9,58231
+	ori	r9,r9,39831
 
-	mfsprg  r21,3
-	ld      r21,PACASTABVIRT(r21)
-
-	/* Hash to the primary group */
-	mfspr	r22,DAR
-	rldicl  r22,r22,36,59
-	rldicr  r22,r22,7,56
-	or      r21,r21,r22     /* r21 = first ste of the group */
+	mulld	r9,r11,r9
+	rldic	r9,r9,12,16	/* r9 = vsid << 12 */
 
 	/* Search the primary group for a free entry */
-	li      r22,0
-1:
-	ld      r23,0(r21)      /* Test valid bit of the current ste   */
-	rldicl  r23,r23,57,63
-	cmpwi   r23,0
-	bne     2f
-	li	r23,0
-	rldimi  r23,r20,12,0    /* Insert the new vsid value            */
-	std     r23,8(r21)      /* Put new entry back into the stab     */
-	eieio                  /* Order vsid update                    */
-	li	r23,0
-	mfspr	r20,DAR        /* Get the new esid                     */
-	rldicl  r20,r20,36,28  /* Permits a full 36b of ESID           */
-	rldimi  r23,r20,28,0    /* Insert the new esid value            */
-	ori     r23,r23,144      /* Turn on valid and kp                 */
-	std     r23,0(r21)      /* Put new entry back into the stab     */
-	sync                   /* Order the update                     */
-	b       3f
-2:
-	addi    r22,r22,1
-	addi    r21,r21,16
-	cmpldi  r22,7
-	ble     1b
-
-	/* Stick for only searching the primary group for now.          */
+1:	ld	r11,0(r10)	/* Test valid bit of the current ste	*/
+	andi.	r11,r11,0x80
+	beq	2f
+	addi	r10,r10,16
+	andi.	r11,r10,0x70
+	bne	1b
+
+	/* Stick for only searching the primary group for now.		*/
 	/* At least for now, we use a very simple random castout scheme */
-	/* Use the TB as a random number ;  OR in 1 to avoid entry 0    */
-	mftb    r22
-	andi.   r22,r22,7
-	ori	r22,r22,1
-	sldi	r22,r22,4
-
-	/* r21 currently points to and ste one past the group of interest */
-	/* make it point to the randomly selected entry                   */
-	subi	r21,r21,128
-	or 	r21,r21,r22      /* r21 is the entry to invalidate        */
-
-	isync                    /* mark the entry invalid                */
-	ld      r23,0(r21)
-	li      r22,-129
-	and     r23,r23,r22
-	std     r23,0(r21)
+	/* Use the TB as a random number ;  OR in 1 to avoid entry 0	*/
+	mftb	r11
+	rldic	r11,r11,4,57	/* r11 = (r11 << 4) & 0x70 */
+	ori	r11,r11,0x10
+
+	/* r10 currently points to an ste one past the group of interest */
+	/* make it point to the randomly selected entry			*/
+	subi	r10,r10,128
+	or 	r10,r10,r11	/* r10 is the entry to invalidate	*/
+
+	isync			/* mark the entry invalid		*/
+	ld	r11,0(r10)
+	rldicl	r11,r11,56,1	/* clear the valid bit */
+	rotldi	r11,r11,8
+	std	r11,0(r10)
 	sync
 
-	li	r23,0
-	rldimi  r23,r20,12,0
-	std     r23,8(r21)
+	clrrdi	r11,r11,28	/* Get the esid part of the ste		*/
+	slbie	r11
+
+2:	std	r9,8(r10)	/* Store the vsid part of the ste	*/
 	eieio
 
-	ld	r22,0(r21)	/* Get the esid part of the ste         */
-	li	r23,0
-	mfspr	r20,DAR         /* Get the new esid                     */
-	rldicl  r20,r20,36,28   /* Permits a full 32b of ESID           */
-	rldimi  r23,r20,28,0    /* Insert the new esid value            */
-	ori     r23,r23,144     /* Turn on valid and kp                 */
-	std     r23,0(r21)      /* Put new entry back into the stab     */
-
-	rldicl  r22,r22,36,28
-	rldicr  r22,r22,28,35
-	slbie   r22
+	mfspr	r11,DAR		/* Get the new esid			*/
+	clrrdi	r11,r11,28	/* Permits a full 32b of ESID		*/
+	ori	r11,r11,0x90	/* Turn on valid and kp			*/
+	std	r11,0(r10)	/* Put new entry back into the stab	*/
+
 	sync
 
-3:
 	/* All done -- return from exception. */
-	mfsprg  r20,3                   /* Load the PACA pointer  */
-	ld      r21,PACAEXCSP(r20)      /* Get the exception frame pointer */
-	addi    r21,r21,EXC_FRAME_SIZE
-	lwz	r23,EX_CCR(r21)		/* get saved CR */
-
-	ld	r22,EX_SRR1(r21)
-	andi.	r22,r22,MSR_RI
-	beq-	unrecov_stab
-
-	/* note that this is almost identical to maskable_exception_exit */
-	mtcr    r23                     /* restore CR */
-
-	mfmsr	r22
-	li	r23, MSR_RI
-	andc	r22,r22,r23
-	mtmsrd	r22,1
-
-	ld	r22,EX_SRR0(r21)	/* Get SRR0 from exc. frame */
-	ld	r23,EX_SRR1(r21)	/* Get SRR1 from exc. frame */
-	mtspr	SRR0,r22
-	mtspr   SRR1,r23
-	ld	r22,EX_R22(r21)		/* restore r22 and r23 */
-	ld	r23,EX_R23(r21)
-	mfspr	r20,SPRG2
-	mfspr	r21,SPRG1
-	rfid
-
-unrecov_stab:
-	EXCEPTION_PROLOG_COMMON
-	li	r6,0x4100
-	li	r20,0
-	bl	.save_remaining_regs
-1:	addi	r3,r1,STACK_FRAME_OVERHEAD
-	bl	.unrecoverable_exception
-	b	1b
-
-/*
- * r20 points to the PACA, r21 to the exception frame,
- * r23 contains the saved CR.
- * r20 - r23, SRR0 and SRR1 are saved in the exception frame.
- * We assume we aren't going to take any exceptions during this procedure.
- */
-/* XXX note fix masking in get_kernel_vsid to match */
-_GLOBAL(do_slb_bolted)
-	stw	r23,EX_CCR(r21)		/* save CR in exc. frame */
-
-	/*
-	 * We take the next entry, round robin. Previously we tried
-	 * to find a free slot first but that took too long. Unfortunately
-	 * we dont have any LRU information to help us choose a slot.
-	 */
-
-	/* r20 = paca */
-1:	ld	r22,PACASTABRR(r20)
-	addi	r21,r22,1
-	cmpdi	r21,SLB_NUM_ENTRIES
-	blt+	2f
-	li	r21,2			/* dont touch slot 0 or 1 */
-2:	std	r21,PACASTABRR(r20)
-
-	/* r20 = paca, r22 = entry */
-
-	/* 
-	 * Never cast out the segment for our kernel stack. Since we
-	 * dont invalidate the ERAT we could have a valid translation
-	 * for the kernel stack during the first part of exception exit 
-	 * which gets invalidated due to a tlbie from another cpu at a
-	 * non recoverable point (after setting srr0/1) - Anton
-	 */
-	slbmfee	r21,r22
-	srdi	r21,r21,27
-	/*
-	 * Use paca->ksave as the value of the kernel stack pointer,
-	 * because this is valid at all times.
-	 * The >> 27 (rather than >> 28) is so that the LSB is the
-	 * valid bit - this way we check valid and ESID in one compare.
-	 * In order to completely close the tiny race in the context
-	 * switch (between updating r1 and updating paca->ksave),
-	 * we check against both r1 and paca->ksave.
-	 */
-	srdi	r23,r1,27
-	ori	r23,r23,1
-	cmpd	r23,r21
-	beq-	1b
-	ld	r23,PACAKSAVE(r20)
-	srdi	r23,r23,27
- 	ori	r23,r23,1
- 	cmpd	r23,r21
- 	beq-	1b
-
-	/* r20 = paca, r22 = entry */
-
-	/* (((ea >> 28) & 0x1fff) << 15) | (ea >> 60) */
-	mfspr	r21,DAR
-	rldicl	r23,r21,36,51
-	sldi	r23,r23,15
-	srdi	r21,r21,60
-	or	r23,r23,r21
-
-	/* VSID_RANDOMIZER */
-	li	r21,9
-	sldi	r21,r21,32
-	oris	r21,r21,58231
-	ori	r21,r21,39831
-
-	/* vsid = (ordinal * VSID_RANDOMIZER) & VSID_MASK */
-	mulld	r23,r23,r21
-	clrldi	r23,r23,28
+	lwz	r9,PACA_EXSLB+EX_CCR(r13)	/* get saved CR */
+	ld	r11,PACA_EXSLB+EX_SRR0(r13)	/* get saved SRR0 */
 
-	/* r20 = paca, r22 = entry, r23 = vsid */
+	andi.	r10,r12,MSR_RI
+	beq-	unrecov_slb
 
-	/* Put together slb word1 */
-	sldi	r23,r23,12
+	mtcrf	0x80,r9			/* restore CR */
 
-BEGIN_FTR_SECTION
-	/* set kp and c bits */
-	ori	r23,r23,0x480
-END_FTR_SECTION_IFCLR(CPU_FTR_16M_PAGE)
-BEGIN_FTR_SECTION
-	/* set kp, l and c bits */
-	ori	r23,r23,0x580
-END_FTR_SECTION_IFSET(CPU_FTR_16M_PAGE)
-
-	/* r20 = paca, r22 = entry, r23 = slb word1 */
-
-	/* Put together slb word0 */
-	mfspr	r21,DAR
-	rldicr	r21,r21,0,35	/* get the new esid */
-	oris	r21,r21,2048	/* set valid bit */
-	rldimi	r21,r22,0,52	/* insert entry */
-
-	/* r20 = paca, r21 = slb word0, r23 = slb word1 */
-
-	/* 
-	 * No need for an isync before or after this slbmte. The exception
-	 * we enter with and the rfid we exit with are context synchronizing .
-	 */
-	slbmte	r23,r21
+	mfmsr	r10
+	clrrdi	r10,r10,2
+	mtmsrd	r10,1
 
-	/* All done -- return from exception. */
-	ld	r21,PACAEXCSP(r20)	/* Get the exception frame pointer */
-	addi	r21,r21,EXC_FRAME_SIZE
-	lwz	r23,EX_CCR(r21)		/* get saved CR */
-	/* note that this is almost identical to maskable_exception_exit */
-
-	ld	r22,EX_SRR1(r21)
-	andi.	r22,r22,MSR_RI
-	beq-	unrecov_stab
-
-	/*
-	 * Until everyone updates binutils hardwire the POWER4 optimised
-	 * single field mtcrf
-	 */
-#if 0
-	.machine	push
-	.machine	"power4"
-	mtcrf	0x80,r23
-	.machine	pop
-#else
-	.long 0x7ef80120
-#endif
-
-	mfmsr	r22
-	li	r23, MSR_RI
-	andc	r22,r22,r23
-	mtmsrd	r22,1
-
-	ld	r22,EX_SRR0(r21)	/* Get SRR0 from exc. frame */
-	ld	r23,EX_SRR1(r21)	/* Get SRR1 from exc. frame */
-	mtspr	SRR0,r22
-	mtspr	SRR1,r23
-	ld	r22,EX_R22(r21)		/* restore r22 and r23 */
-	ld	r23,EX_R23(r21)
-	ld	r20,EX_R20(r21)
-	mfspr	r21,SPRG1
+	mtspr	SRR0,r11
+	mtspr	SRR1,r12
+	ld	r9,PACA_EXSLB+EX_R9(r13)
+	ld	r10,PACA_EXSLB+EX_R10(r13)
+	ld	r11,PACA_EXSLB+EX_R11(r13)
+	ld	r12,PACA_EXSLB+EX_R12(r13)
+	ld	r13,PACA_EXSLB+EX_R13(r13)
 	rfid
-
-_GLOBAL(do_stab_SI)
-	mflr	r21			/* Save LR in r21 */
-
-	/*
-	 * r3 contains the faulting address
-	 * r4 contains the required access permissions
-	 *
-	 * at return r3 = 0 for success
-	 */
-
-	bl	.ste_allocate		/* build STE if possible */
-	or.	r3,r3,r3		/* Check return code */
-	beq     fast_exception_return   /* Return from exception on success */
-	mtlr    r21                     /* restore LR */
-	blr                             /* Return to DSI or ISI on failure */
+	b	.	/* prevent speculative execution */
 
 /*
- * This code finishes saving the registers to the exception frame.
- * Address translation is already on.
+ * r13 points to the PACA, r9 contains the saved CR,
+ * r11 and r12 contain the saved SRR0 and SRR1.
+ * r3 has the faulting address
+ * r9 - r13 are saved in paca->exslb.
+ * r3 is saved in paca->slb_r3
+ * We assume we aren't going to take any exceptions during this procedure.
  */
-_GLOBAL(save_remaining_regs)
-	/*
-	 * Save the rest of the registers into the pt_regs structure
-	 */
-	std     r22,_NIP(r1)
-	std     r23,_MSR(r1)
-	std     r6,TRAP(r1)
-	ld      r6,GPR6(r1)
-	SAVE_2GPRS(14, r1)
-	SAVE_4GPRS(16, r1)
-	SAVE_8GPRS(24, r1)
-
-	/* Set the marker value "regshere" just before the reg values */
-	SET_REG_TO_CONST(r22, 0x7265677368657265)
-	std	r22,STACK_FRAME_OVERHEAD-16(r1)
+_GLOBAL(do_slb_miss)
+	mflr	r10
 
-	/*
-	 * Clear the RESULT field
-	 */
-	li	r22,0
-	std	r22,RESULT(r1)
+	stw	r9,PACA_EXSLB+EX_CCR(r13)	/* save CR in exc. frame */
+	std	r11,PACA_EXSLB+EX_SRR0(r13)	/* save SRR0 in exc. frame */
+	std	r10,PACA_EXSLB+EX_LR(r13)	/* save LR */
 
-	/*
-	 * Test if from user state; result will be tested later
-	 */
-	andi.	r23,r23,MSR_PR		/* Set CR for later branch */
+	bl	.slb_allocate			/* handle it */
 
-	/*
-	 * Indicate that r1 contains the kernel stack and
-	 * get the Kernel TOC pointer from the paca
-	 */
-	ld	r2,PACATOC(r13)		/* Get Kernel TOC pointer */
-
-	/*
-	 * If from user state, update THREAD.regs
-	 */
-	beq	2f			/* Modify THREAD.regs if from user */
-	addi	r23,r1,STACK_FRAME_OVERHEAD
-	ld	r22, PACACURRENT(r13)
-	std	r23,THREAD+PT_REGS(r22)
-2:
-	SET_REG_TO_CONST(r22, MSR_KERNEL)
-
-#ifdef DO_SOFT_DISABLE
-	stb	r20,PACAPROCENABLED(r13) /* possibly soft enable */
-	ori	r22,r22,MSR_EE		/* always hard enable */
-#else
-	rldimi	r22,r20,15,48		/* Insert desired EE value */
-#endif
+	/* All done -- return from exception. */
 
-	mtmsrd  r22,1
-	blr
+	ld	r10,PACA_EXSLB+EX_LR(r13)
+	ld	r3,PACASLBR3(r13)
+	lwz	r9,PACA_EXSLB+EX_CCR(r13)	/* get saved CR */
+	ld	r11,PACA_EXSLB+EX_SRR0(r13)	/* get saved SRR0 */
+
+	mtlr	r10
+
+	andi.	r10,r12,MSR_RI	/* check for unrecoverable exception */
+	beq-	unrecov_slb
+
+.machine	push
+.machine	"power4"
+	mtcrf	0x80,r9
+	mtcrf	0x01,r9		/* slb_allocate uses cr0 and cr7 */
+.machine	pop
+
+	mtspr	SRR0,r11
+	mtspr	SRR1,r12
+	ld	r9,PACA_EXSLB+EX_R9(r13)
+	ld	r10,PACA_EXSLB+EX_R10(r13)
+	ld	r11,PACA_EXSLB+EX_R11(r13)
+	ld	r12,PACA_EXSLB+EX_R12(r13)
+	ld	r13,PACA_EXSLB+EX_R13(r13)
+	rfid
+	b	.	/* prevent speculative execution */
 
-/*
- * Kernel profiling with soft disable on iSeries
- */
-do_profile:
-	ld	r22,8(r21)		/* Get SRR1 */
-	andi.	r22,r22,MSR_PR		/* Test if in kernel */
-	bnelr				/* return if not in kernel */
-	ld	r22,0(r21)		/* Get SRR0 */
-	ld	r25,PACAPROFSTEXT(r20)	/* _stext */
-	subf	r22,r25,r22		/* offset into kernel */
-	lwz	r25,PACAPROFSHIFT(r20)
-	srd	r22,r22,r25
-	lwz	r25,PACAPROFLEN(r20)	/* length of profile table (-1) */
-	cmp	0,r22,r25		/* off end? */
-	ble	1f
-	mr	r22,r25			/* force into last entry */
-1:	sldi	r22,r22,2		/* convert to offset into buffer */
-	ld	r25,PACAPROFBUFFER(r20)	/* profile buffer */
-	add	r25,r25,r22
-2:	lwarx	r22,0,r25		/* atomically increment */
-	addi	r22,r22,1
-	stwcx.	r22,0,r25
-	bne-	2b
-	blr
+unrecov_slb:
+	EXCEPTION_PROLOG_COMMON(0x4100, PACA_EXSLB)
+	DISABLE_INTS
+	bl	.save_nvgprs
+1:	addi	r3,r1,STACK_FRAME_OVERHEAD
+	bl	.unrecoverable_exception
+	b	1b
 
 
 /*
@@ -1356,32 +1228,30 @@ _GLOBAL(pseries_secondary_smp_init)
 	isync
 
 	/* Set up a paca value for this processor. */
-	LOADADDR(r24, paca) 		 /* Get base vaddr of paca array  */
-	mulli	r13,r3,PACA_SIZE	 /* Calculate vaddr of right paca */
-	add	r13,r13,r24              /* for this processor.           */
+	LOADADDR(r24, paca) 		/* Get base vaddr of paca array	 */
+	mulli	r13,r3,PACA_SIZE	/* Calculate vaddr of right paca */
+	add	r13,r13,r24		/* for this processor.		 */
 
-	mtspr	SPRG3,r13		 /* Save vaddr of paca in SPRG3   */
-	mr	r24,r3			 /* __secondary_start needs cpu#  */
+	mtspr	SPRG3,r13		/* Save vaddr of paca in SPRG3	 */
+	mr	r24,r3			/* __secondary_start needs cpu#	 */
 
 1:
 	HMT_LOW
-	lbz	r23,PACAPROCSTART(r13)	 /* Test if this processor should */
-					 /* start.                        */
+	lbz	r23,PACAPROCSTART(r13)	/* Test if this processor should */
+					/* start.			 */
 	sync
 
-        /* Create a temp kernel stack for use before relocation is on.    */
-        mr      r1,r13
-        addi    r1,r1,PACAGUARD
-        addi    r1,r1,0x1000
-        subi    r1,r1,STACK_FRAME_OVERHEAD
+	/* Create a temp kernel stack for use before relocation is on.	*/
+	ld	r1,PACAEMERGSP(r13)
+	subi	r1,r1,STACK_FRAME_OVERHEAD
 
-	cmpi	0,r23,0
+	cmpwi	0,r23,0
 #ifdef CONFIG_SMP
 #ifdef SECONDARY_PROCESSORS
 	bne	.__secondary_start
 #endif
 #endif
-	b 	1b			 /* Loop until told to go         */
+	b 	1b			/* Loop until told to go	 */
 #ifdef CONFIG_PPC_ISERIES
 _GLOBAL(__start_initialization_iSeries)
 	/* Clear out the BSS */
@@ -1389,13 +1259,13 @@ _GLOBAL(__start_initialization_iSeries)
 
 	LOADADDR(r8,__bss_start)
 
-	sub	r11,r11,r8        /* bss size                        */
-	addi	r11,r11,7         /* round up to an even double word */
-	rldicl. r11,r11,61,3      /* shift right by 3                */
+	sub	r11,r11,r8		/* bss size			*/
+	addi	r11,r11,7		/* round up to an even double word */
+	rldicl. r11,r11,61,3		/* shift right by 3		*/
 	beq	4f
 	addi	r8,r8,-8
 	li	r0,0
-	mtctr	r11		  /* zero this many doublewords      */
+	mtctr	r11			/* zero this many doublewords	*/
 3:	stdu	r0,8(r8)
 	bdnz	3b
 4:
@@ -1422,10 +1292,10 @@ _GLOBAL(__start_initialization_iSeries)
 	std	r4,0(r9)		/* set the naca pointer */
 
 	/* Get the pointer to the segment table */
-	ld	r6,PACA(r4)             /* Get the base paca pointer       */
+	ld	r6,PACA(r4)		/* Get the base paca pointer	*/
 	ld	r4,PACASTABVIRT(r6)
 
-	bl      .iSeries_fixup_klimit
+	bl	.iSeries_fixup_klimit
 
 	/* relocation is on at this point */
 
@@ -1443,6 +1313,7 @@ _STATIC(mmu_off)
 	mtspr	SRR1,r3
 	sync
 	rfid
+	b	.	/* prevent speculative execution */
 _GLOBAL(__start_initialization_pSeries)
 	mr	r31,r3			/* save parameters */
 	mr	r30,r4
@@ -1456,8 +1327,8 @@ _GLOBAL(__start_initialization_pSeries)
 	bl	.reloc_offset
 
 	LOADADDR(r2,__toc_start)
-	addi    r2,r2,0x4000
-	addi    r2,r2,0x4000
+	addi	r2,r2,0x4000
+	addi	r2,r2,0x4000
 
 	/* Relocate the TOC from a virt addr to a real addr */
 	sub	r2,r2,r3
@@ -1498,33 +1369,33 @@ _STATIC(__after_prom_start)
  * unknown exception placeholders.
  *
  * Note: This process overwrites the OF exception vectors.
- *       r26 == relocation offset
- *       r27 == KERNELBASE
+ *	r26 == relocation offset
+ *	r27 == KERNELBASE
  */
 	bl	.reloc_offset
 	mr	r26,r3
 	SET_REG_TO_CONST(r27,KERNELBASE)
 
-	li	r3,0                    /* target addr */
+	li	r3,0			/* target addr */
 
 	// XXX FIXME: Use phys returned by OF (r23)
-	sub	r4,r27,r26 		/* source addr */
-					/* current address of _start   */
-			                /*   i.e. where we are running */
-			                /*        the source addr      */
+	sub	r4,r27,r26 		/* source addr			 */
+					/* current address of _start	 */
+					/*   i.e. where we are running	 */
+					/*	the source addr		 */
 
-	LOADADDR(r5,copy_to_here)	/* # bytes of memory to copy      */
+	LOADADDR(r5,copy_to_here)	/* # bytes of memory to copy	 */
 	sub	r5,r5,r27
 
-	li	r6,0x100		/* Start offset, the first 0x100  */
-					/* bytes were copied earlier.	  */
+	li	r6,0x100		/* Start offset, the first 0x100 */
+					/* bytes were copied earlier.	 */
 
-	bl	.copy_and_flush		/* copy the first n bytes         */
-					/* this includes the code being   */
-					/* executed here.                 */
+	bl	.copy_and_flush		/* copy the first n bytes	 */
+					/* this includes the code being	 */
+					/* executed here.		 */
 
-        LOADADDR(r0, 4f)                /* Jump to the copy of this code  */
-	mtctr	r0			/* that we just made/relocated    */
+	LOADADDR(r0, 4f)		/* Jump to the copy of this code */
+	mtctr	r0			/* that we just made/relocated	 */
 	bctr
 
 4:	LOADADDR(r5,klimit)
@@ -1546,23 +1417,23 @@ _STATIC(__after_prom_start)
 _GLOBAL(copy_and_flush)
 	addi	r5,r5,-8
 	addi	r6,r6,-8
-4:	li	r0,16                   /* Use the least common      */
-					/* denominator cache line    */
-			                /* size.  This results in    */
-					/* extra cache line flushes  */
-					/* but operation is correct. */
-					/* Can't get cache line size */
-					/* from NACA as it is being  */
-					/* moved too.                */
-
-	mtctr	r0			/* put # words/line in ctr */
-3:	addi	r6,r6,8			/* copy a cache line */
+4:	li	r0,16			/* Use the least common		*/
+					/* denominator cache line	*/
+					/* size.  This results in	*/
+					/* extra cache line flushes	*/
+					/* but operation is correct.	*/
+					/* Can't get cache line size	*/
+					/* from NACA as it is being	*/
+					/* moved too.			*/
+
+	mtctr	r0			/* put # words/line in ctr	*/
+3:	addi	r6,r6,8			/* copy a cache line		*/
 	ldx	r0,r6,r4
 	stdx	r0,r6,r3
 	bdnz	3b
-	dcbst	r6,r3			/* write it to memory */
+	dcbst	r6,r3			/* write it to memory		*/
 	sync
-	icbi	r6,r3			/* flush the icache line */
+	icbi	r6,r3			/* flush the icache line	*/
 	cmpld	0,r6,r5
 	blt	4b
 	sync
@@ -1583,9 +1454,9 @@ copy_to_here:
  * On entry: r13 == 'current' && last_task_used_math != 'current'
  */
 _STATIC(load_up_fpu)
-	mfmsr	r5                      /* grab the current MSR */
+	mfmsr	r5			/* grab the current MSR */
 	ori	r5,r5,MSR_FP
-	mtmsrd  r5			/* enable use of fpu now */
+	mtmsrd	r5			/* enable use of fpu now */
 	isync
 /*
  * For SMP, we don't do lazy FPU switching because it just gets too
@@ -1594,9 +1465,9 @@ _STATIC(load_up_fpu)
  *
  */
 #ifndef CONFIG_SMP
-	LOADBASE(r3,last_task_used_math)
-	ld	r4,last_task_used_math@l(r3)
-	cmpi	0,r4,0
+	ld	r3,last_task_used_math@got(r2)
+	ld	r4,0(r3)
+	cmpdi	0,r4,0
 	beq	1f
 	/* Save FP state to last_task_used_math's THREAD struct */
 	addi	r4,r4,THREAD
@@ -1606,8 +1477,8 @@ _STATIC(load_up_fpu)
 	/* Disable FP for last_task_used_math */
 	ld	r5,PT_REGS(r4)
 	ld	r4,_MSR-STACK_FRAME_OVERHEAD(r5)
-	li	r20,MSR_FP|MSR_FE0|MSR_FE1
-	andc	r4,r4,r20
+	li	r6,MSR_FP|MSR_FE0|MSR_FE1
+	andc	r4,r4,r6
 	std	r4,_MSR-STACK_FRAME_OVERHEAD(r5)
 1:
 #endif /* CONFIG_SMP */
@@ -1615,15 +1486,16 @@ _STATIC(load_up_fpu)
 	ld	r4,PACACURRENT(r13)
 	addi	r5,r4,THREAD		/* Get THREAD */
 	ld	r4,THREAD_FPEXC_MODE(r5)
-	ori	r23,r23,MSR_FP
-	or	r23,r23,r4
+	ori	r12,r12,MSR_FP
+	or	r12,r12,r4
+	std	r12,_MSR(r1)
 	lfd	fr0,THREAD_FPSCR(r5)
 	mtfsf	0xff,fr0
 	REST_32FPRS(0, r5)
 #ifndef CONFIG_SMP
 	/* Update last_task_used_math to 'current' */
 	subi	r4,r5,THREAD		/* Back to 'current' */
-	std	r4,last_task_used_math@l(r3)
+	std	r4,0(r3)
 #endif /* CONFIG_SMP */
 	/* restore registers and return */
 	b	fast_exception_return
@@ -1633,10 +1505,10 @@ _STATIC(load_up_fpu)
  * Disable the FPU.
  */
 _GLOBAL(disable_kernel_fp)
-	mfmsr   r3
-	rldicl  r0,r3,(63-MSR_FP_LG),1
-	rldicl  r3,r0,(MSR_FP_LG+1),0
-	mtmsrd  r3			/* disable use of fpu now */
+	mfmsr	r3
+	rldicl	r0,r3,(63-MSR_FP_LG),1
+	rldicl	r3,r0,(MSR_FP_LG+1),0
+	mtmsrd	r3			/* disable use of fpu now */
 	isync
 	blr
 
@@ -1651,11 +1523,11 @@ _GLOBAL(giveup_fpu)
 	ori	r5,r5,MSR_FP
 	mtmsrd	r5			/* enable use of fpu now */
 	isync
-	cmpi	0,r3,0
+	cmpdi	0,r3,0
 	beqlr-				/* if no previous owner, done */
 	addi	r3,r3,THREAD		/* want THREAD of task */
 	ld	r5,PT_REGS(r3)
-	cmpi	0,r5,0
+	cmpdi	0,r5,0
 	SAVE_32FPRS(0, r3)
 	mffs	fr0
 	stfd	fr0,THREAD_FPSCR(r3)
@@ -1667,8 +1539,8 @@ _GLOBAL(giveup_fpu)
 1:
 #ifndef CONFIG_SMP
 	li	r5,0
-	LOADBASE(r4,last_task_used_math)
-	std	r5,last_task_used_math@l(r4)
+	ld	r4,last_task_used_math@got(r2)
+	std	r5,0(r4)
 #endif /* CONFIG_SMP */
 	blr
 
@@ -1685,9 +1557,9 @@ _GLOBAL(giveup_fpu)
  * On entry: r13 == 'current' && last_task_used_altivec != 'current'
  */
 _STATIC(load_up_altivec)
-	mfmsr	r5                      /* grab the current MSR */
+	mfmsr	r5			/* grab the current MSR */
 	oris	r5,r5,MSR_VEC@h
-	mtmsrd  r5			/* enable use of VMX now */
+	mtmsrd	r5			/* enable use of VMX now */
 	isync
 	
 /*
@@ -1699,9 +1571,9 @@ _STATIC(load_up_altivec)
  * avoid saving all of the VREGs here...
  */
 #ifndef CONFIG_SMP
-	LOADBASE(r3,last_task_used_altivec)
-	ld	r4,last_task_used_altivec@l(r3)
-	cmpi	0,r4,0
+	ld	r3,last_task_used_altivec@got(r2)
+	ld	r4,0(r3)
+	cmpdi	0,r4,0
 	beq	1f
 	/* Save VMX state to last_task_used_altivec's THREAD struct */
 	addi	r4,r4,THREAD
@@ -1712,8 +1584,8 @@ _STATIC(load_up_altivec)
 	/* Disable VMX for last_task_used_altivec */
 	ld	r5,PT_REGS(r4)
 	ld	r4,_MSR-STACK_FRAME_OVERHEAD(r5)
-	lis	r20,MSR_VEC@h
-	andc	r4,r4,r20
+	lis	r6,MSR_VEC@h
+	andc	r4,r4,r6
 	std	r4,_MSR-STACK_FRAME_OVERHEAD(r5)
 1:
 #endif /* CONFIG_SMP */
@@ -1723,7 +1595,7 @@ _STATIC(load_up_altivec)
 	 * all 1's
 	 */
 	mfspr	r4,SPRN_VRSAVE
-	cmpi	0,r4,0
+	cmpdi	0,r4,0
 	bne+	1f
 	li	r4,-1
 	mtspr	SPRN_VRSAVE,r4
@@ -1731,7 +1603,8 @@ _STATIC(load_up_altivec)
 	/* enable use of VMX after return */
 	ld	r4,PACACURRENT(r13)
 	addi	r5,r4,THREAD		/* Get THREAD */
-	oris	r23,r23,MSR_VEC@h
+	oris	r12,r12,MSR_VEC@h
+	std	r12,_MSR(r1)
 	li	r4,1
 	li	r10,THREAD_VSCR
 	stw	r4,THREAD_USED_VR(r5)
@@ -1740,7 +1613,7 @@ _STATIC(load_up_altivec)
 #ifndef CONFIG_SMP
 	/* Update last_task_used_math to 'current' */
 	subi	r4,r5,THREAD		/* Back to 'current' */
-	std	r4,last_task_used_altivec@l(r3)
+	std	r4,0(r3)
 #endif /* CONFIG_SMP */
 	/* restore registers and return */
 	b	fast_exception_return
@@ -1750,10 +1623,10 @@ _STATIC(load_up_altivec)
  * Disable the VMX.
  */
 _GLOBAL(disable_kernel_altivec)
-	mfmsr   r3
-	rldicl  r0,r3,(63-MSR_VEC_LG),1
-	rldicl  r3,r0,(MSR_VEC_LG+1),0
-	mtmsrd  r3			/* disable use of VMX now */
+	mfmsr	r3
+	rldicl	r0,r3,(63-MSR_VEC_LG),1
+	rldicl	r3,r0,(MSR_VEC_LG+1),0
+	mtmsrd	r3			/* disable use of VMX now */
 	isync
 	blr
 
@@ -1768,11 +1641,11 @@ _GLOBAL(giveup_altivec)
 	oris	r5,r5,MSR_VEC@h
 	mtmsrd	r5			/* enable use of VMX now */
 	isync
-	cmpi	0,r3,0
+	cmpdi	0,r3,0
 	beqlr-				/* if no previous owner, done */
 	addi	r3,r3,THREAD		/* want THREAD of task */
 	ld	r5,PT_REGS(r3)
-	cmpi	0,r5,0
+	cmpdi	0,r5,0
 	SAVE_32VRS(0,r4,r3)
 	mfvscr	vr0
 	li	r4,THREAD_VSCR
@@ -1785,8 +1658,8 @@ _GLOBAL(giveup_altivec)
 1:
 #ifndef CONFIG_SMP
 	li	r5,0
-	LOADBASE(r4,last_task_used_altivec)
-	std	r5,last_task_used_altivec@l(r4)
+	ld	r4,last_task_used_altivec@got(r2)
+	std	r5,0(r4)
 #endif /* CONFIG_SMP */
 	blr
 
@@ -1830,16 +1703,14 @@ _GLOBAL(pmac_secondary_start)
 	mtmsrd	r3			/* RI on */
 
 	/* Set up a paca value for this processor. */
-	LOADADDR(r4, paca) 		 /* Get base vaddr of paca array  */
+	LOADADDR(r4, paca) 		 /* Get base vaddr of paca array	*/
 	mulli	r13,r24,PACA_SIZE	 /* Calculate vaddr of right paca */
-	add	r13,r13,r4               /* for this processor.           */
-	mtspr	SPRG3,r13		 /* Save vaddr of paca in SPRG3   */
+	add	r13,r13,r4		/* for this processor.		*/
+	mtspr	SPRG3,r13		 /* Save vaddr of paca in SPRG3	*/
 
-        /* Create a temp kernel stack for use before relocation is on.    */
-        mr      r1,r13
-        addi    r1,r1,PACAGUARD
-        addi    r1,r1,0x1000
-        subi    r1,r1,STACK_FRAME_OVERHEAD
+	/* Create a temp kernel stack for use before relocation is on.	*/
+	ld	r1,PACAEMERGSP(r13)
+	subi	r1,r1,STACK_FRAME_OVERHEAD
 
 	b	.__secondary_start
 
@@ -1853,7 +1724,7 @@ _GLOBAL(pmac_secondary_start)
  *   1. Processor number
  *   2. Segment table pointer (virtual address)
  * On entry the following are set:
- *   r1    = stack pointer.  vaddr for iSeries, raddr (temp stack) for pSeries
+ *   r1	= stack pointer.  vaddr for iSeries, raddr (temp stack) for pSeries
  *   r24   = cpu# (in Linux terms)
  *   r13   = paca virtual address
  *   SPRG3 = paca virtual address
@@ -1862,35 +1733,29 @@ _GLOBAL(__secondary_start)
 
 	HMT_MEDIUM			/* Set thread priority to MEDIUM */
 
-	/* set up the TOC (virtual address) */
-	LOADADDR(r2,__toc_start)
-	addi    r2,r2,0x4000
-	addi    r2,r2,0x4000
-
-	std	r2,PACATOC(r13)
+	ld	r2,PACATOC(r13)
 	li	r6,0
 	stb	r6,PACAPROCENABLED(r13)
 
 #ifndef CONFIG_PPC_ISERIES
 	/* Initialize the page table pointer register. */
 	LOADADDR(r6,_SDR1)
-	ld	r6,0(r6)		/* get the value of _SDR1 */
-	mtspr	SDR1,r6			/* set the htab location  */
+	ld	r6,0(r6)		/* get the value of _SDR1	 */
+	mtspr	SDR1,r6			/* set the htab location	 */
 #endif
-	/* Initialize the first segment table (or SLB) entry                */
-	ld	r3,PACASTABVIRT(r13)    /* get addr of segment table        */
+	/* Initialize the first segment table (or SLB) entry		 */
+	ld	r3,PACASTABVIRT(r13)	/* get addr of segment table	 */
 	bl	.stab_initialize
 
-	/* Initialize the kernel stack.  Just a repeat for iSeries.         */
+	/* Initialize the kernel stack.  Just a repeat for iSeries.	 */
 	LOADADDR(r3,current_set)
-	sldi	r28,r24,3		/* get current_set[cpu#] */
+	sldi	r28,r24,3		/* get current_set[cpu#]	 */
 	ldx	r1,r3,r28
-	addi	r1,r1,THREAD_SIZE
-	subi	r1,r1,STACK_FRAME_OVERHEAD
+	addi	r1,r1,THREAD_SIZE-STACK_FRAME_OVERHEAD
 	std	r1,PACAKSAVE(r13)
 
-	ld	r3,PACASTABREAL(r13)    /* get raddr of segment table       */
-	ori	r4,r3,1			/* turn on valid bit                */
+	ld	r3,PACASTABREAL(r13)	/* get raddr of segment table	 */
+	ori	r4,r3,1			/* turn on valid bit		 */
 
 #ifdef CONFIG_PPC_ISERIES
 	li	r0,-1			/* hypervisor call */
@@ -1900,23 +1765,23 @@ _GLOBAL(__secondary_start)
 	sc				/* HvCall_setASR */
 #else
 	/* set the ASR */
-	li	r3,SYSTEMCFG_PHYS_ADDR	/* r3 = ptr to systemcfg  */
-	lwz   	r3,PLATFORM(r3)		/* r3 = platform flags */
+	li	r3,SYSTEMCFG_PHYS_ADDR	/* r3 = ptr to systemcfg	 */
+	lwz	r3,PLATFORM(r3)		/* r3 = platform flags		 */
 	cmpldi 	r3,PLATFORM_PSERIES_LPAR
-	bne   	98f
+	bne	98f
 	mfspr	r3,PVR
 	srwi	r3,r3,16
-	cmpwi	r3,0x37         /* SStar  */
+	cmpwi	r3,0x37			/* SStar  */
 	beq	97f
-	cmpwi	r3,0x36         /* IStar  */
+	cmpwi	r3,0x36			/* IStar  */
 	beq	97f
-	cmpwi	r3,0x34         /* Pulsar */
+	cmpwi	r3,0x34			/* Pulsar */
 	bne	98f
-97:	li	r3,H_SET_ASR    /* hcall = H_SET_ASR */
-	HVSC     		/* Invoking hcall */
+97:	li	r3,H_SET_ASR		/* hcall = H_SET_ASR */
+	HVSC				/* Invoking hcall */
 	b	99f
-98:                             /* !(rpa hypervisor) || !(star)  */
-	mtasr	r4	        /* set the stab location         */
+98:					/* !(rpa hypervisor) || !(star)  */
+	mtasr	r4			/* set the stab location	 */
 99:
 #endif
 	li	r7,0
@@ -1931,6 +1796,7 @@ _GLOBAL(__secondary_start)
 	mtspr	SRR0,r3
 	mtspr	SRR1,r4
 	rfid
+	b	.	/* prevent speculative execution */
 
 /* 
  * Running with relocation on at this point.  All we want to do is
@@ -1938,22 +1804,22 @@ _GLOBAL(__secondary_start)
  */
 _GLOBAL(start_secondary_prolog)
 	li	r3,0
-	std	r3,0(r1)                /* Zero the stack frame pointer     */
+	std	r3,0(r1)		/* Zero the stack frame pointer	*/
 	bl	.start_secondary
 #endif
 
 /*
- * This subroutine clobbers r11, r12 and the LR
+ * This subroutine clobbers r11 and r12
  */
 _GLOBAL(enable_64b_mode)
-	mfmsr   r11                      /* grab the current MSR */
-	li      r12,1
-	rldicr  r12,r12,MSR_SF_LG,(63-MSR_SF_LG)
-	or      r11,r11,r12
-	li      r12,1
-	rldicr  r12,r12,MSR_ISF_LG,(63-MSR_ISF_LG)
-	or      r11,r11,r12
-	mtmsrd  r11
+	mfmsr	r11			/* grab the current MSR */
+	li	r12,1
+	rldicr	r12,r12,MSR_SF_LG,(63-MSR_SF_LG)
+	or	r11,r11,r12
+	li	r12,1
+	rldicr	r12,r12,MSR_ISF_LG,(63-MSR_ISF_LG)
+	or	r11,r11,r12
+	mtmsrd	r11
 	isync
 	blr
 
@@ -1970,30 +1836,30 @@ _STATIC(start_here_pSeries)
 	ori	r6,r6,MSR_RI
 	mtmsrd	r6			/* RI on */
 
-	/* setup the systemcfg pointer which is needed by *tab_initialize  */
+	/* setup the systemcfg pointer which is needed by *tab_initialize	*/
 	LOADADDR(r6,systemcfg)
-	sub	r6,r6,r26                /* addr of the variable systemcfg */
+	sub	r6,r6,r26		/* addr of the variable systemcfg */
 	li	r27,SYSTEMCFG_PHYS_ADDR
-	std	r27,0(r6)	 	 /* set the value of systemcfg     */
+	std	r27,0(r6)	 	/* set the value of systemcfg	*/
 
-	/* setup the naca pointer which is needed by *tab_initialize       */
+	/* setup the naca pointer which is needed by *tab_initialize	*/
 	LOADADDR(r6,naca)
-	sub	r6,r6,r26                /* addr of the variable naca      */
+	sub	r6,r6,r26		/* addr of the variable naca	*/
 	li	r27,NACA_PHYS_ADDR
-	std	r27,0(r6)	 	 /* set the value of naca          */
+	std	r27,0(r6)	 	/* set the value of naca	*/
 
 #ifdef CONFIG_HMT
 	/* Start up the second thread on cpu 0 */
 	mfspr	r3,PVR
 	srwi	r3,r3,16
-	cmpwi	r3,0x34                 /* Pulsar  */
+	cmpwi	r3,0x34			/* Pulsar  */
 	beq	90f
-	cmpwi	r3,0x36                 /* Icestar */
+	cmpwi	r3,0x36			/* Icestar */
 	beq	90f
-	cmpwi	r3,0x37                 /* SStar   */
+	cmpwi	r3,0x37			/* SStar   */
 	beq	90f
-	b	91f                     /* HMT not supported */
-90:	li      r3,0
+	b	91f			/* HMT not supported */
+90:	li	r3,0
 	bl	.hmt_start_secondary
 91:
 #endif
@@ -2008,7 +1874,7 @@ _STATIC(start_here_pSeries)
 	li	r3,1
 	LOADADDR(r5,__secondary_hold_spinloop)
 	tophys(r4,r5)
-	std     r3,0(r4)
+	std	r3,0(r4)
 #endif
 
 	/* The following gets the stack and TOC set up with the regs */
@@ -2027,8 +1893,8 @@ _STATIC(start_here_pSeries)
 
 		/* set up the TOC (physical address) */
 	LOADADDR(r2,__toc_start)
-	addi    r2,r2,0x4000
-	addi    r2,r2,0x4000
+	addi	r2,r2,0x4000
+	addi	r2,r2,0x4000
 	sub	r2,r2,r26
 
 	LOADADDR(r3,cpu_specs)
@@ -2038,44 +1904,44 @@ _STATIC(start_here_pSeries)
 	mr	r5,r26
 	bl	.identify_cpu
 
-	/* Get the pointer to the segment table which is used by           */
-	/* stab_initialize                                                 */
+	/* Get the pointer to the segment table which is used by		*/
+	/* stab_initialize						 */
 	LOADADDR(r27, boot_cpuid)
 	sub	r27,r27,r26
 	lwz	r27,0(r27)
 
-	LOADADDR(r24, paca) 		 /* Get base vaddr of paca array  */
-	mulli	r13,r27,PACA_SIZE	 /* Calculate vaddr of right paca */
-	add	r13,r13,r24              /* for this processor.           */
-	sub	r13,r13,r26		/* convert to physical addr         */
+	LOADADDR(r24, paca) 		/* Get base vaddr of paca array	 */
+	mulli	r13,r27,PACA_SIZE	/* Calculate vaddr of right paca */
+	add	r13,r13,r24		/* for this processor.		 */
+	sub	r13,r13,r26		/* convert to physical addr	 */
 
 	mtspr	SPRG3,r13		/* PPPBBB: Temp... -Peter */
 	ld	r3,PACASTABREAL(r13)
-	ori	r4,r3,1			/* turn on valid bit                */
+	ori	r4,r3,1			/* turn on valid bit		 */
 	
 	/* set the ASR */
 	li	r3,SYSTEMCFG_PHYS_ADDR	/* r3 = ptr to systemcfg */
-	lwz   	r3,PLATFORM(r3)		/* r3 = platform flags */
+	lwz	r3,PLATFORM(r3)		/* r3 = platform flags */
 	cmpldi 	r3,PLATFORM_PSERIES_LPAR
-	bne   	98f
+	bne	98f
 	mfspr	r3,PVR
 	srwi	r3,r3,16
-	cmpwi	r3,0x37         /* SStar */
+	cmpwi	r3,0x37			/* SStar */
 	beq	97f
-	cmpwi	r3,0x36         /* IStar  */
+	cmpwi	r3,0x36			/* IStar  */
 	beq	97f
-	cmpwi	r3,0x34         /* Pulsar */
+	cmpwi	r3,0x34			/* Pulsar */
 	bne	98f
-97:	li	r3,H_SET_ASR    /* hcall = H_SET_ASR */
-	HVSC     	        /* Invoking hcall */
-	b     	99f
-98:                             /* !(rpa hypervisor) || !(star) */
-	mtasr	r4	        /* set the stab location         */
+97:	li	r3,H_SET_ASR		/* hcall = H_SET_ASR */
+	HVSC				/* Invoking hcall */
+	b	99f
+98:					/* !(rpa hypervisor) || !(star) */
+	mtasr	r4			/* set the stab location	*/
 99:
 	mfspr	r6,SPRG3
-	ld	r3,PACASTABREAL(r6)     /* restore r3 for stab_initialize */
+	ld	r3,PACASTABREAL(r6)	/* restore r3 for stab_initialize */
 
-	/* Initialize an initial memory mapping and turn on relocation.   */
+	/* Initialize an initial memory mapping and turn on relocation.	*/
 	bl	.stab_initialize
 	bl	.htab_initialize
 
@@ -2083,7 +1949,7 @@ _STATIC(start_here_pSeries)
 	lwz	r3,PLATFORM(r3)		/* r3 = platform flags */
 	/* Test if bit 0 is set (LPAR bit) */
 	andi.	r3,r3,0x1
-	bne    98f
+	bne	98f
 	LOADADDR(r6,_SDR1)		/* Only if NOT LPAR */
 	sub	r6,r6,r26
 	ld	r6,0(r6)		/* get the value of _SDR1 */
@@ -2094,6 +1960,7 @@ _STATIC(start_here_pSeries)
 	mtspr	SRR0,r3
 	mtspr	SRR1,r4
 	rfid
+	b	.	/* prevent speculative execution */
 #endif /* CONFIG_PPC_PSERIES */
 	
 	/* This is where all platforms converge execution */
@@ -2110,11 +1977,6 @@ _STATIC(start_here_common)
 	li	r0,0
 	stdu	r0,-STACK_FRAME_OVERHEAD(r1)
 
-	/* set up the TOC */
-	LOADADDR(r2,__toc_start)
-	addi    r2,r2,0x4000
-	addi    r2,r2,0x4000
-
 	/* Apply the CPUs-specific fixups (nop out sections not relevant
 	 * to this CPU
 	 */
@@ -2129,22 +1991,22 @@ _STATIC(start_here_common)
 	/* setup the naca pointer */
 	LOADADDR(r9,naca)
 	SET_REG_TO_CONST(r8, NACA_VIRT_ADDR)
-	std	r8,0(r9)		/* set the value of the naca ptr  */
+	std	r8,0(r9)		/* set the value of the naca ptr */
 
 	LOADADDR(r26, boot_cpuid)
 	lwz	r26,0(r26)
 
-	LOADADDR(r24, paca) 		 /* Get base vaddr of paca array  */
-	mulli	r13,r26,PACA_SIZE	 /* Calculate vaddr of right paca */
-	add	r13,r13,r24              /* for this processor.           */
+	LOADADDR(r24, paca) 		/* Get base vaddr of paca array  */
+	mulli	r13,r26,PACA_SIZE	/* Calculate vaddr of right paca */
+	add	r13,r13,r24		/* for this processor.		 */
 	mtspr	SPRG3,r13
 
 	/* ptr to current */
 	LOADADDR(r4,init_task)
 	std	r4,PACACURRENT(r13)
 
-	std	r2,PACATOC(r13)
-	li	r5,0
+	/* Load the TOC */
+	ld	r2,PACATOC(r13)
 	std	r1,PACAKSAVE(r13)
 
 	/* Restore the parms passed in from the bootloader. */
@@ -2176,11 +2038,11 @@ _GLOBAL(hmt_init)
 	LOADADDR(r5, hmt_thread_data)
 	mfspr	r7,PVR
 	srwi	r7,r7,16
-	cmpwi	r7,0x34                 /* Pulsar  */
+	cmpwi	r7,0x34			/* Pulsar  */
 	beq	90f
-	cmpwi	r7,0x36                 /* Icestar */
+	cmpwi	r7,0x36			/* Icestar */
 	beq	91f
-	cmpwi	r7,0x37                 /* SStar   */
+	cmpwi	r7,0x37			/* SStar   */
 	beq	91f
 	b	101f
 90:	mfspr	r6,PIR
@@ -2214,32 +2076,32 @@ __hmt_secondary_hold:
 
 104:	addi	r7,r7,4
 	lwzx	r9,r5,r7
-	mr      r24,r9
+	mr	r24,r9
 101:
 #endif
-	mr      r3,r24
-	b       .pseries_secondary_smp_init
+	mr	r3,r24
+	b	.pseries_secondary_smp_init
 
 #ifdef CONFIG_HMT
 _GLOBAL(hmt_start_secondary)
 	LOADADDR(r4,__hmt_secondary_hold)
 	clrldi	r4,r4,4
-	mtspr   NIADORM, r4
-	mfspr   r4, MSRDORM
-	li      r5, -65
-	and     r4, r4, r5
-	mtspr   MSRDORM, r4
+	mtspr	NIADORM, r4
+	mfspr	r4, MSRDORM
+	li	r5, -65
+	and	r4, r4, r5
+	mtspr	MSRDORM, r4
 	lis	r4,0xffef
 	ori	r4,r4,0x7403
 	mtspr	TSC, r4
 	li	r4,0x1f4
 	mtspr	TST, r4
-	mfspr   r4, HID0
-	ori     r4, r4, 0x1
-	mtspr   HID0, r4
-	mfspr   r4, CTRLF
-	oris    r4, r4, 0x40
-	mtspr   CTRLT, r4
+	mfspr	r4, HID0
+	ori	r4, r4, 0x1
+	mtspr	HID0, r4
+	mfspr	r4, CTRLF
+	oris	r4, r4, 0x40
+	mtspr	CTRLT, r4
 	blr
 #endif
 
@@ -2249,7 +2111,7 @@ _GLOBAL(hmt_start_secondary)
  * which is page-aligned.
  */
 	.data
-	.align  12
+	.align	12
 	.globl	sdata
 sdata:
 	.globl	empty_zero_page
@@ -2267,7 +2129,7 @@ ioremap_dir:
 /* 1 page segment table per cpu (max 48, cpu0 allocated at STAB0_PHYS_ADDR) */
 	.globl	stab_array
 stab_array:
-        .space	4096 * 48
+	.space	4096 * 48
 	
 /*
  * This space gets a copy of optional info passed to us by the bootstrap
@@ -2275,4 +2137,4 @@ stab_array:
  */
 	.globl	cmd_line
 cmd_line:
-	.space	512	/* COMMAND_LINE_SIZE */
+	.space	COMMAND_LINE_SIZE
diff --git a/arch/ppc64/kernel/hvconsole.c b/arch/ppc64/kernel/hvconsole.c
index 101e0799c..dedefb305 100644
--- a/arch/ppc64/kernel/hvconsole.c
+++ b/arch/ppc64/kernel/hvconsole.c
@@ -20,6 +20,7 @@
  */
 
 #include <linux/kernel.h>
+#include <linux/module.h>
 #include <asm/hvcall.h>
 #include <asm/prom.h>
 #include <asm/hvconsole.h>
@@ -50,6 +51,8 @@ int hvc_get_chars(int index, char *buf, int count)
 	return 0;
 }
 
+EXPORT_SYMBOL(hvc_get_chars);
+
 int hvc_put_chars(int index, const char *buf, int count)
 {
 	unsigned long *lbuf = (unsigned long *) buf;
@@ -64,6 +67,8 @@ int hvc_put_chars(int index, const char *buf, int count)
 	return -1;
 }
 
+EXPORT_SYMBOL(hvc_put_chars);
+
 /* return the number of client vterms present */
 /* XXX this requires an interface change to handle multiple discontiguous
  * vterms */
@@ -76,7 +81,7 @@ int hvc_count(int *start_termno)
 	 * we should _always_ be able to find one. */
 	vty = of_find_node_by_name(NULL, "vty");
 	if (vty && device_is_compatible(vty, "hvterm1")) {
-		u32 *termno = (u32 *)get_property(vty, "reg", 0);
+		u32 *termno = (u32 *)get_property(vty, "reg", NULL);
 
 		if (termno && start_termno)
 			*start_termno = *termno;
diff --git a/arch/ppc64/kernel/iSeries_htab.c b/arch/ppc64/kernel/iSeries_htab.c
index 05e41ee26..2456227b4 100644
--- a/arch/ppc64/kernel/iSeries_htab.c
+++ b/arch/ppc64/kernel/iSeries_htab.c
@@ -16,17 +16,26 @@
 #include <asm/mmu_context.h>
 #include <asm/iSeries/HvCallHpt.h>
 #include <asm/abs_addr.h>
-
-#if 0
 #include <linux/spinlock.h>
-#include <linux/bitops.h>
-#include <linux/threads.h>
-#include <linux/smp.h>
 
-#include <asm/tlbflush.h>
-#include <asm/tlb.h>
-#include <asm/cputable.h>
-#endif
+static spinlock_t iSeries_hlocks[64] __cacheline_aligned_in_smp = { [0 ... 63] = SPIN_LOCK_UNLOCKED};
+
+/*
+ * Very primitive algorithm for picking up a lock
+ */
+static inline void iSeries_hlock(unsigned long slot)
+{
+	if (slot & 0x8)
+		slot = ~slot;
+	spin_lock(&iSeries_hlocks[(slot >> 4) & 0x3f]);
+}
+
+static inline void iSeries_hunlock(unsigned long slot)
+{
+	if (slot & 0x8)
+		slot = ~slot;
+	spin_unlock(&iSeries_hlocks[(slot >> 4) & 0x3f]);
+}
 
 static long iSeries_hpte_insert(unsigned long hpte_group, unsigned long va,
 			 unsigned long prpn, int secondary,
@@ -44,12 +53,15 @@ static long iSeries_hpte_insert(unsigned long hpte_group, unsigned long va,
 	if (secondary)
 		return -1;
 
+	iSeries_hlock(hpte_group);
+
 	slot = HvCallHpt_findValid(&lhpte, va >> PAGE_SHIFT);
-	if (lhpte.dw0.dw0.v)
-		panic("select_hpte_slot found entry already valid\n");
+	BUG_ON(lhpte.dw0.dw0.v);
 
-	if (slot == -1)	/* No available entry found in either group */
+	if (slot == -1)	{ /* No available entry found in either group */
+		iSeries_hunlock(hpte_group);
 		return -1;
+	}
 
 	if (slot < 0) {		/* MSB set means secondary group */
 		secondary = 1;
@@ -69,6 +81,8 @@ static long iSeries_hpte_insert(unsigned long hpte_group, unsigned long va,
 	/* Now fill in the actual HPTE */
 	HvCallHpt_addValidate(slot, secondary, &lhpte);
 
+	iSeries_hunlock(hpte_group);
+
 	return (secondary << 3) | (slot & 7);
 }
 
@@ -92,6 +106,8 @@ static long iSeries_hpte_remove(unsigned long hpte_group)
 	/* Pick a random slot to start at */
 	slot_offset = mftb() & 0x7;
 
+	iSeries_hlock(hpte_group);
+
 	for (i = 0; i < HPTES_PER_GROUP; i++) {
 		lhpte.dw0.dword0 = 
 			iSeries_hpte_getword0(hpte_group + slot_offset);
@@ -99,6 +115,7 @@ static long iSeries_hpte_remove(unsigned long hpte_group)
 		if (!lhpte.dw0.dw0.bolted) {
 			HvCallHpt_invalidateSetSwBitsGet(hpte_group + 
 							 slot_offset, 0, 0);
+			iSeries_hunlock(hpte_group);
 			return i;
 		}
 
@@ -106,6 +123,8 @@ static long iSeries_hpte_remove(unsigned long hpte_group)
 		slot_offset &= 0x7;
 	}
 
+	iSeries_hunlock(hpte_group);
+
 	return -1;
 }
 
@@ -121,11 +140,16 @@ static long iSeries_hpte_updatepp(unsigned long slot, unsigned long newpp,
 	HPTE hpte;
 	unsigned long avpn = va >> 23;
 
+	iSeries_hlock(slot);
+
 	HvCallHpt_get(&hpte, slot);
 	if ((hpte.dw0.dw0.avpn == avpn) && (hpte.dw0.dw0.v)) {
 		HvCallHpt_setPp(slot, (newpp & 0x3) | ((newpp & 0x4) << 1));
+		iSeries_hunlock(slot);
 		return 0;
 	}
+	iSeries_hunlock(slot);
+
 	return -1;
 }
 
@@ -186,11 +210,20 @@ static void iSeries_hpte_invalidate(unsigned long slot, unsigned long va,
 {
 	HPTE lhpte;
 	unsigned long avpn = va >> 23;
+	unsigned long flags;
+
+	local_irq_save(flags);
+
+	iSeries_hlock(slot);
 
 	lhpte.dw0.dword0 = iSeries_hpte_getword0(slot);
 	
 	if ((lhpte.dw0.dw0.avpn == avpn) && lhpte.dw0.dw0.v)
 		HvCallHpt_invalidateSetSwBitsGet(slot, 0, 0);
+
+	iSeries_hunlock(slot);
+
+	local_irq_restore(flags);
 }
 
 void hpte_init_iSeries(void)
diff --git a/arch/ppc64/kernel/iSeries_proc.c b/arch/ppc64/kernel/iSeries_proc.c
index 3ba18deaf..1babbb6b9 100644
--- a/arch/ppc64/kernel/iSeries_proc.c
+++ b/arch/ppc64/kernel/iSeries_proc.c
@@ -68,7 +68,7 @@ static int proc_lpevents_show(struct seq_file *m, void *v)
 	seq_printf(m, "\n  events processed by processor:\n");
 
 	for_each_online_cpu(i)
-		seq_printf(m, "    CPU%02d  %10u\n", i, paca[i].lpEvent_count);
+		seq_printf(m, "    CPU%02d  %10u\n", i, paca[i].lpevent_count);
 
 	return 0;
 }
diff --git a/arch/ppc64/kernel/iSeries_setup.c b/arch/ppc64/kernel/iSeries_setup.c
index 3f17d5e25..e12b50f8c 100644
--- a/arch/ppc64/kernel/iSeries_setup.c
+++ b/arch/ppc64/kernel/iSeries_setup.c
@@ -357,15 +357,14 @@ void __init iSeries_init(unsigned long r3, unsigned long r4, unsigned long r5,
 	HvCallEvent_dmaToSp(cmd_line, 2 * 64* 1024, 256,
 			HvLpDma_Direction_RemoteToLocal);
 
-	p = q = cmd_line + 255;
-	while (p > cmd_line) {
-		if ((*p == 0) || (*p == ' ') || (*p == '\n'))
-			--p;
-		else
+	p = cmd_line;
+	q = cmd_line + 255;
+	while( p < q ) {
+		if (!*p || *p == '\n')
 			break;
+		++p;
 	}
-	if (p < q)
-		*(p + 1) = 0;
+	*p = 0;
 
         if (strstr(cmd_line, "dprofile=")) {
                 for (q = cmd_line; (p = strstr(q, "dprofile=")) != 0; ) {
@@ -572,7 +571,7 @@ static void __init build_iSeries_Memory_Map(void)
 static void __init setup_iSeries_cache_sizes(void)
 {
 	unsigned int i, n;
-	unsigned int procIx = get_paca()->xLpPaca.xDynHvPhysicalProcIndex;
+	unsigned int procIx = get_paca()->lppaca.xDynHvPhysicalProcIndex;
 
 	systemcfg->iCacheL1Size =
 		xIoHriProcessorVpd[procIx].xInstCacheSize * 1024;
@@ -666,7 +665,7 @@ extern unsigned long ppc_tb_freq;
 void __init iSeries_setup_arch(void)
 {
 	void *eventStack;
-	unsigned procIx = get_paca()->xLpPaca.xDynHvPhysicalProcIndex;
+	unsigned procIx = get_paca()->lppaca.xDynHvPhysicalProcIndex;
 
 	/* Add an eye catcher and the systemcfg layout version number */
 	strcpy(systemcfg->eye_catcher, "SYSTEMCFG:PPC64");
diff --git a/arch/ppc64/kernel/idle.c b/arch/ppc64/kernel/idle.c
index a9a501df3..bc7dbbd2d 100644
--- a/arch/ppc64/kernel/idle.c
+++ b/arch/ppc64/kernel/idle.c
@@ -76,7 +76,7 @@ static void yield_shared_processor(void)
 	 * The decrementer stops during the yield.  Force a fake decrementer
 	 * here and let the timer_interrupt code sort out the actual time.
 	 */
-	get_paca()->xLpPaca.xIntDword.xFields.xDecrInt = 1;
+	get_paca()->lppaca.xIntDword.xFields.xDecrInt = 1;
 	process_iSeries_events();
 }
 
@@ -98,8 +98,8 @@ int iSeries_idle(void)
 	lpaca = get_paca();
 
 	for (;;) {
-		if (lpaca->xLpPaca.xSharedProc) {
-			if (ItLpQueue_isLpIntPending(lpaca->lpQueuePtr))
+		if (lpaca->lppaca.xSharedProc) {
+			if (ItLpQueue_isLpIntPending(lpaca->lpqueue_ptr))
 				process_iSeries_events();
 			if (!need_resched())
 				yield_shared_processor();
@@ -111,7 +111,7 @@ int iSeries_idle(void)
 
 				while (!need_resched()) {
 					HMT_medium();
-					if (ItLpQueue_isLpIntPending(lpaca->lpQueuePtr))
+					if (ItLpQueue_isLpIntPending(lpaca->lpqueue_ptr))
 						process_iSeries_events();
 					HMT_low();
 				}
@@ -175,7 +175,7 @@ int dedicated_idle(void)
 	while (1) {
 		/* Indicate to the HV that we are idle.  Now would be
 		 * a good time to find other work to dispatch. */
-		lpaca->xLpPaca.xIdle = 1;
+		lpaca->lppaca.xIdle = 1;
 
 		oldval = test_and_clear_thread_flag(TIF_NEED_RESCHED);
 		if (!oldval) {
@@ -201,7 +201,7 @@ int dedicated_idle(void)
 				 * ST mode.
 				 */
 				if((naca->smt_state == SMT_DYNAMIC) &&
-				   (!(ppaca->xLpPaca.xIdle))) {
+				   (!(ppaca->lppaca.xIdle))) {
 					/* Indicate we are no longer polling for
 					 * work, and then clear need_resched.  If
 					 * need_resched was 1, set it back to 1
@@ -216,7 +216,6 @@ int dedicated_idle(void)
 
 					/* DRENG: Go HMT_medium here ? */
 					local_irq_disable(); 
-					lpaca->yielded = 1;
 
 					/* SMT dynamic mode.  Cede will result 
 					 * in this thread going dormant, if the
@@ -227,8 +226,6 @@ int dedicated_idle(void)
 					 * enables external interrupts.
 					 */
 					cede_processor();
-
-					lpaca->yielded = 0;
 				} else {
 					/* Give the HV an opportunity at the
 					 * processor, since we are not doing
@@ -242,7 +239,7 @@ int dedicated_idle(void)
 		}
 
 		HMT_medium();
-		lpaca->xLpPaca.xIdle = 0;
+		lpaca->lppaca.xIdle = 0;
 		schedule();
 		if (cpu_is_offline(smp_processor_id()) &&
 				system_state == SYSTEM_RUNNING)
@@ -262,11 +259,10 @@ int shared_idle(void)
 
 		/* Indicate to the HV that we are idle.  Now would be
 		 * a good time to find other work to dispatch. */
-		lpaca->xLpPaca.xIdle = 1;
+		lpaca->lppaca.xIdle = 1;
 
 		if (!need_resched()) {
 			local_irq_disable(); 
-			lpaca->yielded = 1;
 			
 			/* 
 			 * Yield the processor to the hypervisor.  We return if
@@ -276,12 +272,10 @@ int shared_idle(void)
 			 * are enabled.
 			 */
 			cede_processor();
-			
-			lpaca->yielded = 0;
 		}
 
 		HMT_medium();
-		lpaca->xLpPaca.xIdle = 0;
+		lpaca->lppaca.xIdle = 0;
 		schedule();
 	}
 
@@ -313,7 +307,7 @@ int idle_setup(void)
 #else
 	if (systemcfg->platform & PLATFORM_PSERIES) {
 		if (cur_cpu_spec->firmware_features & FW_FEATURE_SPLPAR) {
-			if(get_paca()->xLpPaca.xSharedProc) {
+			if (get_paca()->lppaca.xSharedProc) {
 				printk("idle = shared_idle\n");
 				idle_loop = shared_idle;
 			} else {
diff --git a/arch/ppc64/kernel/init_task.c b/arch/ppc64/kernel/init_task.c
index 38cb7aeb1..941043ae0 100644
--- a/arch/ppc64/kernel/init_task.c
+++ b/arch/ppc64/kernel/init_task.c
@@ -4,6 +4,7 @@
 #include <linux/init.h>
 #include <linux/init_task.h>
 #include <linux/fs.h>
+#include <linux/mqueue.h>
 #include <asm/uaccess.h>
 
 static struct fs_struct init_fs = INIT_FS;
diff --git a/arch/ppc64/kernel/ioctl32.c b/arch/ppc64/kernel/ioctl32.c
index 1027c84c7..40ba4c17e 100644
--- a/arch/ppc64/kernel/ioctl32.c
+++ b/arch/ppc64/kernel/ioctl32.c
@@ -29,7 +29,7 @@
 #define CODE
 #include "compat_ioctl.c"
 
-#define HANDLE_IOCTL(cmd,handler) { cmd, (ioctl_trans_handler_t)handler, 0 },
+#define HANDLE_IOCTL(cmd,handler) { cmd, (ioctl_trans_handler_t)handler, NULL },
 #define COMPATIBLE_IOCTL(cmd) HANDLE_IOCTL(cmd,sys_ioctl)
 
 #define IOCTL_TABLE_START \
diff --git a/arch/ppc64/kernel/irq.c b/arch/ppc64/kernel/irq.c
index 7335442e4..846168746 100644
--- a/arch/ppc64/kernel/irq.c
+++ b/arch/ppc64/kernel/irq.c
@@ -68,8 +68,8 @@ irq_desc_t irq_desc[NR_IRQS] __cacheline_aligned = {
 };
 
 int __irq_offset_value;
-int ppc_spurious_interrupts = 0;
-unsigned long lpEvent_count = 0;
+int ppc_spurious_interrupts;
+unsigned long lpevent_count;
 
 int
 setup_irq(unsigned int irq, struct irqaction * new)
@@ -143,47 +143,6 @@ EXPORT_SYMBOL(synchronize_irq);
 
 #endif /* CONFIG_SMP */
 
-/* XXX Make this into free_irq() - Anton */
-
-/* This could be promoted to a real free_irq() ... */
-static int
-do_free_irq(int irq, void* dev_id)
-{
-	irq_desc_t *desc = get_irq_desc(irq);
-	struct irqaction **p;
-	unsigned long flags;
-
-	spin_lock_irqsave(&desc->lock,flags);
-	p = &desc->action;
-	for (;;) {
-		struct irqaction * action = *p;
-		if (action) {
-			struct irqaction **pp = p;
-			p = &action->next;
-			if (action->dev_id != dev_id)
-				continue;
-
-			/* Found it - now remove it from the list of entries */
-			*pp = action->next;
-			if (!desc->action) {
-				desc->status |= IRQ_DISABLED;
-				mask_irq(irq);
-			}
-			spin_unlock_irqrestore(&desc->lock,flags);
-
-			/* Wait to make sure it's not being used on another CPU */
-			synchronize_irq(irq);
-			kfree(action);
-			return 0;
-		}
-		printk("Trying to free free IRQ%d\n",irq);
-		spin_unlock_irqrestore(&desc->lock,flags);
-		break;
-	}
-	return -ENOENT;
-}
-
-
 int request_irq(unsigned int irq,
 	irqreturn_t (*handler)(int, void *, struct pt_regs *),
 	unsigned long irqflags, const char * devname, void *dev_id)
@@ -194,8 +153,7 @@ int request_irq(unsigned int irq,
 	if (irq >= NR_IRQS)
 		return -EINVAL;
 	if (!handler)
-		/* We could implement really free_irq() instead of that... */
-		return do_free_irq(irq, dev_id);
+		return -EINVAL;
 
 	action = (struct irqaction *)
 		kmalloc(sizeof(struct irqaction), GFP_KERNEL);
@@ -206,7 +164,7 @@ int request_irq(unsigned int irq,
 
 	action->handler = handler;
 	action->flags = irqflags;
-	action->mask = 0;
+	cpus_clear(action->mask);
 	action->name = devname;
 	action->dev_id = dev_id;
 	action->next = NULL;
@@ -222,7 +180,38 @@ EXPORT_SYMBOL(request_irq);
 
 void free_irq(unsigned int irq, void *dev_id)
 {
-	request_irq(irq, NULL, 0, NULL, dev_id);
+	irq_desc_t *desc = get_irq_desc(irq);
+	struct irqaction **p;
+	unsigned long flags;
+
+	spin_lock_irqsave(&desc->lock,flags);
+	p = &desc->action;
+	for (;;) {
+		struct irqaction * action = *p;
+		if (action) {
+			struct irqaction **pp = p;
+			p = &action->next;
+			if (action->dev_id != dev_id)
+				continue;
+
+			/* Found it - now remove it from the list of entries */
+			*pp = action->next;
+			if (!desc->action) {
+				desc->status |= IRQ_DISABLED;
+				mask_irq(irq);
+			}
+			spin_unlock_irqrestore(&desc->lock,flags);
+
+			/* Wait to make sure it's not being used on another CPU */
+			synchronize_irq(irq);
+			kfree(action);
+			return;
+		}
+		printk("Trying to free free IRQ%d\n",irq);
+		spin_unlock_irqrestore(&desc->lock,flags);
+		break;
+	}
+	return;
 }
 
 EXPORT_SYMBOL(free_irq);
@@ -589,7 +578,7 @@ out:
 }
 
 #ifdef CONFIG_PPC_ISERIES
-int do_IRQ(struct pt_regs *regs)
+void do_IRQ(struct pt_regs *regs)
 {
 	struct paca_struct *lpaca;
 	struct ItLpQueue *lpq;
@@ -613,31 +602,29 @@ int do_IRQ(struct pt_regs *regs)
 
 	lpaca = get_paca();
 #ifdef CONFIG_SMP
-	if (lpaca->xLpPaca.xIntDword.xFields.xIpiCnt) {
-		lpaca->xLpPaca.xIntDword.xFields.xIpiCnt = 0;
+	if (lpaca->lppaca.xIntDword.xFields.xIpiCnt) {
+		lpaca->lppaca.xIntDword.xFields.xIpiCnt = 0;
 		iSeries_smp_message_recv(regs);
 	}
 #endif /* CONFIG_SMP */
-	lpq = lpaca->lpQueuePtr;
+	lpq = lpaca->lpqueue_ptr;
 	if (lpq && ItLpQueue_isLpIntPending(lpq))
-		lpEvent_count += ItLpQueue_process(lpq, regs);
+		lpevent_count += ItLpQueue_process(lpq, regs);
 
 	irq_exit();
 
-	if (lpaca->xLpPaca.xIntDword.xFields.xDecrInt) {
-		lpaca->xLpPaca.xIntDword.xFields.xDecrInt = 0;
+	if (lpaca->lppaca.xIntDword.xFields.xDecrInt) {
+		lpaca->lppaca.xIntDword.xFields.xDecrInt = 0;
 		/* Signal a fake decrementer interrupt */
 		timer_interrupt(regs);
 	}
-
-	return 1; /* lets ret_from_int know we can do checks */
 }
 
 #else	/* CONFIG_PPC_ISERIES */
 
-int do_IRQ(struct pt_regs *regs)
+void do_IRQ(struct pt_regs *regs)
 {
-	int irq, first = 1;
+	int irq;
 
 	irq_enter();
 
@@ -656,25 +643,15 @@ int do_IRQ(struct pt_regs *regs)
 	}
 #endif
 
-	/*
-	 * Every arch is required to implement ppc_md.get_irq.
-	 * This function will either return an irq number or -1 to
-	 * indicate there are no more pending.  But the first time
-	 * through the loop this means there wasn't an IRQ pending.
-	 * The value -2 is for buggy hardware and means that this IRQ
-	 * has already been handled. -- Tom
-	 */
-	while ((irq = ppc_md.get_irq(regs)) >= 0) {
+	irq = ppc_md.get_irq(regs);
+
+	if (irq >= 0)
 		ppc_irq_dispatch_handler(regs, irq);
-		first = 0;
-	}
-	if (irq != -2 && first)
+	else
 		/* That's not SMP safe ... but who cares ? */
 		ppc_spurious_interrupts++;
 
 	irq_exit();
-
-	return 1; /* lets ret_from_int know we can do checks */
 }
 #endif	/* CONFIG_PPC_ISERIES */
 
@@ -738,7 +715,6 @@ static int irq_affinity_write_proc (struct file *file, const char __user *buffer
 	irq_desc_t *desc = get_irq_desc(irq);
 	int ret;
 	cpumask_t new_value, tmp;
-	cpumask_t allcpus = CPU_MASK_ALL;
 
 	if (!desc->handler->set_affinity)
 		return -EIO;
@@ -753,7 +729,7 @@ static int irq_affinity_write_proc (struct file *file, const char __user *buffer
 	 * NR_CPUS == 32 and cpumask is a long), so we mask it here to
 	 * be consistent.
 	 */
-	cpus_and(new_value, new_value, allcpus);
+	cpus_and(new_value, new_value, CPU_MASK_ALL);
 
 	/*
 	 * Grab lock here so cpu_online_map can't change, and also
@@ -808,11 +784,10 @@ static int prof_cpu_mask_write_proc (struct file *file, const char __user *buffe
 	{
 		unsigned i;
 		for (i=0; i<NR_CPUS; ++i) {
-			if ( paca[i].prof_buffer && (new_value & 1) )
+			if ( paca[i].prof_buffer && cpu_isset(i, new_value) )
 				paca[i].prof_enabled = 1;
 			else
 				paca[i].prof_enabled = 0;
-			new_value >>= 1;
 		}
 	}
 #endif
@@ -857,7 +832,7 @@ void init_irq_proc (void)
 	int i;
 
 	/* create /proc/irq */
-	root_irq_dir = proc_mkdir("irq", 0);
+	root_irq_dir = proc_mkdir("irq", NULL);
 
 	/* create /proc/irq/prof_cpu_mask */
 	entry = create_proc_entry("prof_cpu_mask", 0600, root_irq_dir);
diff --git a/arch/ppc64/kernel/lparcfg.c b/arch/ppc64/kernel/lparcfg.c
index 860f07e8c..d729105e5 100644
--- a/arch/ppc64/kernel/lparcfg.c
+++ b/arch/ppc64/kernel/lparcfg.c
@@ -5,6 +5,7 @@
  *    Copyright (c) 2003 Dave Engebretsen
  * Will Schmidt willschm@us.ibm.com
  *    SPLPAR updates, Copyright (c) 2003 Will Schmidt IBM Corporation.
+ *    seq_file updates, Copyright (c) 2004 Will Schmidt IBM Corporation.
  * Nathan Lynch nathanl@austin.ibm.com
  *    Added lparcfg_write, Copyright (C) 2004 Nathan Lynch IBM Corporation.
  *
@@ -23,15 +24,41 @@
 #include <linux/errno.h>
 #include <linux/proc_fs.h>
 #include <linux/init.h>
+#include <linux/seq_file.h>
 #include <asm/uaccess.h>
 #include <asm/iSeries/HvLpConfig.h>
 #include <asm/iSeries/ItLpPaca.h>
+#include <asm/iSeries/LparData.h>
 #include <asm/hvcall.h>
 #include <asm/cputable.h>
+#include <asm/rtas.h>
+#include <asm/system.h>
 
-#define MODULE_VERS "1.0"
+#define MODULE_VERS "1.3"
 #define MODULE_NAME "lparcfg"
 
+/* #define LPARCFG_DEBUG */
+
+/* find a better place for this function... */
+void log_plpar_hcall_return(unsigned long rc,char * tag)
+{
+	if (rc ==0 ) /* success, return */
+		return;
+/* check for null tag ? */
+	if (rc == H_Hardware)
+		printk(KERN_INFO "plpar-hcall (%s) failed with hardware fault\n",tag);
+	else if (rc == H_Function)
+		printk(KERN_INFO "plpar-hcall (%s) failed; function not allowed\n",tag);
+	else if (rc == H_Authority)
+		printk(KERN_INFO "plpar-hcall (%s) failed; not authorized to this function\n",tag);
+	else if (rc == H_Parameter)
+		printk(KERN_INFO "plpar-hcall (%s) failed; Bad parameter(s)\n",tag);
+	else
+		printk(KERN_INFO "plpar-hcall (%s) failed with unexpected rc(0x%lx)\n",tag,rc);
+
+}
+
+
 static struct proc_dir_entry *proc_ppc64_lparcfg;
 #define LPARCFG_BUFF_SIZE 4096
 
@@ -39,103 +66,18 @@ static struct proc_dir_entry *proc_ppc64_lparcfg;
 
 #define lparcfg_write NULL
 
-static unsigned char e2a(unsigned char x)
-{
-        switch (x) {
-        case 0xF0:
-                return '0';
-        case 0xF1:
-                return '1';
-        case 0xF2:
-                return '2';
-        case 0xF3:
-                return '3';
-        case 0xF4:
-                return '4';
-        case 0xF5:
-                return '5';
-        case 0xF6:
-                return '6';
-        case 0xF7:
-                return '7';
-        case 0xF8:
-                return '8';
-        case 0xF9:
-                return '9';
-        case 0xC1:
-                return 'A';
-        case 0xC2:
-                return 'B';
-        case 0xC3:
-                return 'C';
-        case 0xC4:
-                return 'D';
-        case 0xC5:
-                return 'E';
-        case 0xC6:
-                return 'F';
-        case 0xC7:
-                return 'G';
-        case 0xC8:
-                return 'H';
-        case 0xC9:
-                return 'I';
-        case 0xD1:
-                return 'J';
-        case 0xD2:
-                return 'K';
-        case 0xD3:
-                return 'L';
-        case 0xD4:
-                return 'M';
-        case 0xD5:
-                return 'N';
-        case 0xD6:
-                return 'O';
-        case 0xD7:
-                return 'P';
-        case 0xD8:
-                return 'Q';
-        case 0xD9:
-                return 'R';
-        case 0xE2:
-                return 'S';
-        case 0xE3:
-                return 'T';
-        case 0xE4:
-                return 'U';
-        case 0xE5:
-                return 'V';
-        case 0xE6:
-                return 'W';
-        case 0xE7:
-                return 'X';
-        case 0xE8:
-                return 'Y';
-        case 0xE9:
-                return 'Z';
-        }
-        return ' ';
-}
-
 /* 
  * Methods used to fetch LPAR data when running on an iSeries platform.
  */
-static int lparcfg_data(unsigned char *buf, unsigned long size)
+static int lparcfg_data(struct seq_file *m, void *v)
 {
-	unsigned long n = 0, pool_id, lp_index; 
+	unsigned long pool_id, lp_index;
 	int shared, entitled_capacity, max_entitled_capacity;
 	int processors, max_processors;
 	struct paca_struct *lpaca = get_paca();
 
-	if((buf == NULL) || (size > LPARCFG_BUFF_SIZE)) {
-		return -EFAULT;
-	}
-	memset(buf, 0, size); 
-
-	shared = (int)(lpaca->xLpPacaPtr->xSharedProc);
-	n += scnprintf(buf, LPARCFG_BUFF_SIZE - n,
-		      "serial_number=%c%c%c%c%c%c%c\n", 
+	shared = (int)(lpaca->lppaca_ptr->xSharedProc);
+	seq_printf(m, "serial_number=%c%c%c%c%c%c%c\n",
 		      e2a(xItExtVpdPanel.mfgID[2]),
 		      e2a(xItExtVpdPanel.mfgID[3]),
 		      e2a(xItExtVpdPanel.systemSerial[1]),
@@ -144,32 +86,26 @@ static int lparcfg_data(unsigned char *buf, unsigned long size)
 		      e2a(xItExtVpdPanel.systemSerial[4]),
 		      e2a(xItExtVpdPanel.systemSerial[5])); 
 
-	n += scnprintf(buf+n, LPARCFG_BUFF_SIZE - n,
-		      "system_type=%c%c%c%c\n",
+	seq_printf(m, "system_type=%c%c%c%c\n",
 		      e2a(xItExtVpdPanel.machineType[0]),
 		      e2a(xItExtVpdPanel.machineType[1]),
 		      e2a(xItExtVpdPanel.machineType[2]),
 		      e2a(xItExtVpdPanel.machineType[3])); 
 
 	lp_index = HvLpConfig_getLpIndex(); 
-	n += scnprintf(buf+n, LPARCFG_BUFF_SIZE - n,
-		      "partition_id=%d\n", (int)lp_index); 
+	seq_printf(m, "partition_id=%d\n", (int)lp_index);
 
-	n += scnprintf(buf+n, LPARCFG_BUFF_SIZE - n,
-		      "system_active_processors=%d\n", 
+	seq_printf(m, "system_active_processors=%d\n",
 		      (int)HvLpConfig_getSystemPhysicalProcessors()); 
 
-	n += scnprintf(buf+n, LPARCFG_BUFF_SIZE - n,
-		      "system_potential_processors=%d\n", 
+	seq_printf(m, "system_potential_processors=%d\n",
 		      (int)HvLpConfig_getSystemPhysicalProcessors()); 
 
 	processors = (int)HvLpConfig_getPhysicalProcessors(); 
-	n += scnprintf(buf+n, LPARCFG_BUFF_SIZE - n,
-		      "partition_active_processors=%d\n", processors);  
+	seq_printf(m, "partition_active_processors=%d\n", processors);
 
 	max_processors = (int)HvLpConfig_getMaxPhysicalProcessors(); 
-	n += scnprintf(buf+n, LPARCFG_BUFF_SIZE - n,
-		      "partition_potential_processors=%d\n", max_processors);  
+	seq_printf(m, "partition_potential_processors=%d\n", max_processors);
 
 	if(shared) {
 		entitled_capacity = HvLpConfig_getSharedProcUnits(); 
@@ -178,23 +114,19 @@ static int lparcfg_data(unsigned char *buf, unsigned long size)
 		entitled_capacity = processors * 100; 
 		max_entitled_capacity = max_processors * 100; 
 	}
-	n += scnprintf(buf+n, LPARCFG_BUFF_SIZE - n,
-		      "partition_entitled_capacity=%d\n", entitled_capacity);
+	seq_printf(m, "partition_entitled_capacity=%d\n", entitled_capacity);
 
-	n += scnprintf(buf+n, LPARCFG_BUFF_SIZE - n,
-		      "partition_max_entitled_capacity=%d\n", 
+	seq_printf(m, "partition_max_entitled_capacity=%d\n",
 		      max_entitled_capacity);
 
 	if(shared) {
 		pool_id = HvLpConfig_getSharedPoolIndex(); 
-		n += scnprintf(buf+n, LPARCFG_BUFF_SIZE - n, "pool=%d\n",
-			      (int)pool_id); 
-		n += scnprintf(buf+n, LPARCFG_BUFF_SIZE - n,
-			      "pool_capacity=%d\n", (int)(HvLpConfig_getNumProcsInSharedPool(pool_id)*100)); 
+		seq_printf(m, "pool=%d\n", (int)pool_id);
+		seq_printf(m, "pool_capacity=%d\n",
+		    (int)(HvLpConfig_getNumProcsInSharedPool(pool_id)*100));
 	}
 
-	n += scnprintf(buf+n, LPARCFG_BUFF_SIZE - n,
-		      "shared_processor_mode=%d\n", shared);
+	seq_printf(m, "shared_processor_mode=%d\n", shared);
 
 	return 0;
 }
@@ -217,7 +149,7 @@ static int lparcfg_data(unsigned char *buf, unsigned long size)
  *          XXXX - reserved (0)
  *              XXXX - Group Number
  *                  XXXX - Pool Number.
- *  R7 (PPOONNMMLLKKJJII)
+ *  R7 (IIJJKKLLMMNNOOPP).
  *      XX - reserved. (0)
  *        XX - bit 0-6 reserved (0).   bit 7 is Capped indicator.
  *          XX - variable processor Capacity Weight
@@ -225,168 +157,257 @@ static int lparcfg_data(unsigned char *buf, unsigned long size)
  *              XXXX - Active processors in Physical Processor Pool.
  *                  XXXX  - Processors active on platform. 
  */
-unsigned int h_get_ppp(unsigned long *entitled,unsigned long  *unallocated,unsigned long *aggregation,unsigned long *resource)
+static unsigned int h_get_ppp(unsigned long *entitled,
+		unsigned long  *unallocated, unsigned long *aggregation,
+		unsigned long *resource)
 {
 	unsigned long rc;
 	rc = plpar_hcall_4out(H_GET_PPP,0,0,0,0,entitled,unallocated,aggregation,resource);
-	return 0;
+
+	log_plpar_hcall_return(rc, "H_GET_PPP");
+
+	return rc;
 }
 
-/*
- * get_splpar_potential_characteristics().
- * Retrieve the potential_processors and max_entitled_capacity values
- * through the get-system-parameter rtas call.
+static void h_pic(unsigned long *pool_idle_time, unsigned long *num_procs)
+{
+	unsigned long rc;
+	unsigned long dummy;
+	rc = plpar_hcall(H_PIC, 0, 0, 0, 0, pool_idle_time, num_procs, &dummy);
+
+	log_plpar_hcall_return(rc, "H_PIC");
+}
+
+static unsigned long get_purr(void);
+/* ToDo:  get sum of purr across all processors.  The purr collection code
+ * is coming, but at this time is still problematic, so for now this
+ * function will return 0.
  */
+static unsigned long get_purr()
+{
+	unsigned long sum_purr=0;
+	return sum_purr;
+}
+
 #define SPLPAR_CHARACTERISTICS_TOKEN 20
 #define SPLPAR_MAXLENGTH 1026*(sizeof(char))
-unsigned int get_splpar_potential_characteristics(void)
-{
-	/* return 0 for now.  Underlying rtas functionality is not yet complete. 12/01/2003*/
-	return 0; 
-#if 0 
-	long call_status;
-	unsigned long ret[2];
 
-	char * buffer = kmalloc(SPLPAR_MAXLENGTH, GFP_KERNEL);
+/*
+ * parse_system_parameter_string()
+ * Retrieve the potential_processors, max_entitled_capacity and friends
+ * through the get-system-parameter rtas call.  Replace keyword strings as
+ * necessary.
+ */
+static void parse_system_parameter_string(struct seq_file *m)
+{
+	int call_status;
 
-	printk("token for ibm,get-system-parameter (0x%x)\n",rtas_token("ibm,get-system-parameter"));
+	char * local_buffer = kmalloc(SPLPAR_MAXLENGTH, GFP_KERNEL);
+	if (!local_buffer) {
+		printk(KERN_ERR "%s %s kmalloc failure at line %d \n",
+		       __FILE__, __FUNCTION__, __LINE__);
+		return;
+	}
 
+	spin_lock(&rtas_data_buf_lock);
+	memset(rtas_data_buf, 0, SPLPAR_MAXLENGTH);
 	call_status = rtas_call(rtas_token("ibm,get-system-parameter"), 3, 1,
 				NULL,
 				SPLPAR_CHARACTERISTICS_TOKEN,
-				&buffer,
-				SPLPAR_MAXLENGTH,
-				(void *)&ret);
-
-	if (call_status!=0) {
-		printk("Error calling get-system-parameter (0x%lx)\n",call_status);
-		kfree(buffer);
-		return -1;
+				__pa(rtas_data_buf));
+	memcpy(local_buffer, rtas_data_buf, SPLPAR_MAXLENGTH);
+	spin_unlock(&rtas_data_buf_lock);
+
+	if (call_status != 0) {
+		printk(KERN_INFO "%s %s Error calling get-system-parameter (0x%x)\n",
+		       __FILE__, __FUNCTION__, call_status);
 	} else {
-		printk("get-system-parameter (%s)\n",buffer);
-		kfree(buffer);
-		/* TODO: Add code here to parse out value for system_potential_processors and partition_max_entitled_capacity */
-		return 1;
+		int splpar_strlen;
+		int idx, w_idx;
+		char * workbuffer = kmalloc(SPLPAR_MAXLENGTH, GFP_KERNEL);
+		if (!workbuffer) {
+			printk(KERN_ERR "%s %s kmalloc failure at line %d \n",__FILE__,__FUNCTION__,__LINE__);
+			return;
+		}
+
+#ifdef LPARCFG_DEBUG
+		printk(KERN_INFO "success calling get-system-parameter \n");
+#endif
+		splpar_strlen = local_buffer[0] * 16 + local_buffer[1];
+		local_buffer += 2; /* step over strlen value */
+
+		memset(workbuffer, 0, SPLPAR_MAXLENGTH);
+		w_idx = 0;
+		idx = 0;
+		while ((*local_buffer) && (idx < splpar_strlen)) {
+			workbuffer[w_idx++] = local_buffer[idx++];
+			if ((local_buffer[idx] == ',')
+			    || (local_buffer[idx] == '\0')) {
+				workbuffer[w_idx] = '\0';
+				if (w_idx) {
+					/* avoid the empty string */
+					seq_printf(m, "%s\n", workbuffer);
+				}
+				memset(workbuffer, 0, SPLPAR_MAXLENGTH);
+				idx++;	/* skip the comma */
+				w_idx = 0;
+			} else if (local_buffer[idx] == '=') {
+				/* code here to replace workbuffer contents
+				 with different keyword strings */
+				if (0 == strcmp(workbuffer,"MaxEntCap")) {
+					strcpy(workbuffer, "partition_max_entitled_capacity");
+					w_idx = strlen(workbuffer);
+				}
+				if (0 == strcmp(workbuffer,"MaxPlatProcs")) {
+					strcpy(workbuffer, "system_potential_processors");
+					w_idx = strlen(workbuffer);
+				}
+			}
+		}
+		kfree(workbuffer);
+		local_buffer -= 2;	/* back up over strlen value */
 	}
+	kfree(local_buffer);
+}
+
+static int lparcfg_count_active_processors(void);
+
+/* Return the number of processors in the system.
+ * This function reads through the device tree and counts
+ * the virtual processors, this does not include threads.
+ */
+static int lparcfg_count_active_processors(void)
+{
+	struct device_node *cpus_dn = NULL;
+	int count = 0;
+
+	while ((cpus_dn = of_find_node_by_type(cpus_dn, "cpu"))) {
+#ifdef LPARCFG_DEBUG
+		printk(KERN_ERR "cpus_dn %p \n",cpus_dn);
 #endif
+		count++;
+	}
+	return count;
 }
 
-static int lparcfg_data(unsigned char *buf, unsigned long size)
+static int lparcfg_data(struct seq_file *m, void *v)
 {
-	unsigned long n = 0;
-	int shared, max_entitled_capacity;
-	int processors, system_active_processors, system_potential_processors;
-	struct device_node *root;
+	int system_active_processors;
+	struct device_node *rootdn;
 	const char *model = "";
 	const char *system_id = "";
 	unsigned int *lp_index_ptr, lp_index = 0;
 	struct device_node *rtas_node;
-	int *ip;
-	unsigned long h_entitled,h_unallocated,h_aggregation,h_resource;
-
-	if((buf == NULL) || (size > LPARCFG_BUFF_SIZE)) {
-		return -EFAULT;
-	}
-	memset(buf, 0, size); 
-
-	root = find_path_device("/");
-	if (root) {
-		model = get_property(root, "model", NULL);
-		system_id = get_property(root, "system-id", NULL);
-		lp_index_ptr = (unsigned int *)get_property(root, "ibm,partition-no", NULL);
-		if(lp_index_ptr) lp_index = *lp_index_ptr;
+	int *lrdrp;
+
+	rootdn = find_path_device("/");
+	if (rootdn) {
+		model = get_property(rootdn, "model", NULL);
+		system_id = get_property(rootdn, "system-id", NULL);
+		lp_index_ptr = (unsigned int *)
+			get_property(rootdn, "ibm,partition-no", NULL);
+		if (lp_index_ptr)
+			lp_index = *lp_index_ptr;
 	}
 
-	n  = scnprintf(buf, LPARCFG_BUFF_SIZE - n,
-		      "serial_number=%s\n", system_id); 
 
-	n += scnprintf(buf+n, LPARCFG_BUFF_SIZE - n,
-		      "system_type=%s\n", model); 
+	seq_printf(m, "%s %s \n", MODULE_NAME, MODULE_VERS);
+
+	seq_printf(m, "serial_number=%s\n", system_id);
+
+	seq_printf(m, "system_type=%s\n", model);
 
-	n += scnprintf(buf+n, LPARCFG_BUFF_SIZE - n,
-		      "partition_id=%d\n", (int)lp_index); 
+	seq_printf(m, "partition_id=%d\n", (int)lp_index);
 
 	rtas_node = find_path_device("/rtas");
-	ip = (int *)get_property(rtas_node, "ibm,lrdr-capacity", NULL);
-	if (ip == NULL) {
-		system_active_processors = systemcfg->processorCount; 
+	lrdrp = (int *)get_property(rtas_node, "ibm,lrdr-capacity", NULL);
+
+	if (lrdrp == NULL) {
+		system_active_processors = systemcfg->processorCount;
 	} else {
-		system_active_processors = *(ip + 4);
+		system_active_processors = *(lrdrp + 4);
 	}
 
 	if (cur_cpu_spec->firmware_features & FW_FEATURE_SPLPAR) {
-		h_get_ppp(&h_entitled,&h_unallocated,&h_aggregation,&h_resource);
-#ifdef DEBUG
-		n += scnprintf(buf+n, LPARCFG_BUFF_SIZE - n,
-			      "R4=0x%lx\n", h_entitled);
-		n += scnprintf(buf+n, LPARCFG_BUFF_SIZE - n,
-			      "R5=0x%lx\n", h_unallocated);
-		n += scnprintf(buf+n, LPARCFG_BUFF_SIZE - n,
-			      "R6=0x%lx\n", h_aggregation);
-		n += scnprintf(buf+n, LPARCFG_BUFF_SIZE - n,
-			      "R7=0x%lx\n", h_resource);
-#endif /* DEBUG */
-	}
+		unsigned long h_entitled, h_unallocated;
+		unsigned long h_aggregation, h_resource;
+		unsigned long pool_idle_time, pool_procs;
+		unsigned long purr;
 
-	if (cur_cpu_spec->firmware_features & FW_FEATURE_SPLPAR) {
-		system_potential_processors =  get_splpar_potential_characteristics();
-		n += scnprintf(buf+n, LPARCFG_BUFF_SIZE - n,
-			      "system_active_processors=%ld\n", 
+		h_get_ppp(&h_entitled, &h_unallocated, &h_aggregation,
+			  &h_resource);
+
+		seq_printf(m, "R4=0x%lx\n", h_entitled);
+		seq_printf(m, "R5=0x%lx\n", h_unallocated);
+		seq_printf(m, "R6=0x%lx\n", h_aggregation);
+		seq_printf(m, "R7=0x%lx\n", h_resource);
+
+		h_pic(&pool_idle_time, &pool_procs);
+
+		purr = get_purr();
+
+		/* this call handles the ibm,get-system-parameter contents */
+		parse_system_parameter_string(m);
+
+		seq_printf(m, "partition_entitled_capacity=%ld\n",
+			      h_entitled);
+
+		seq_printf(m, "pool=%ld\n",
+			      (h_aggregation >> 0*8) & 0xffff);
+
+		seq_printf(m, "group=%ld\n",
+			      (h_aggregation >> 2*8) & 0xffff);
+
+		seq_printf(m, "system_active_processors=%ld\n",
+			      (h_resource >> 0*8) & 0xffff);
+
+		seq_printf(m, "pool_capacity=%ld\n",
 			      (h_resource >> 2*8) & 0xffff);
-		n += scnprintf(buf+n, LPARCFG_BUFF_SIZE - n,
-			      "system_potential_processors=%d\n", 
-			      system_potential_processors);
-	} else {
-		system_potential_processors = system_active_processors;
-		n += scnprintf(buf+n, LPARCFG_BUFF_SIZE - n,
-			      "system_active_processors=%d\n", 
-			      system_active_processors);
-		n += scnprintf(buf+n, LPARCFG_BUFF_SIZE - n,
-			      "system_potential_processors=%d\n", 
-			      system_potential_processors);
-	}
 
-	processors = systemcfg->processorCount;
-	n += scnprintf(buf+n, LPARCFG_BUFF_SIZE - n,
-		      "partition_active_processors=%d\n", processors);  
-	n += scnprintf(buf+n, LPARCFG_BUFF_SIZE - n,
-		      "partition_potential_processors=%d\n",
-		      system_active_processors);
+		seq_printf(m, "unallocated_capacity_weight=%ld\n",
+			      (h_resource >> 4*8) & 0xFF);
 
-	/* max_entitled_capacity will come out of get_splpar_potential_characteristics() when that function is complete */
-	max_entitled_capacity = system_active_processors * 100; 
-	if (cur_cpu_spec->firmware_features & FW_FEATURE_SPLPAR) {
-		n += scnprintf(buf+n, LPARCFG_BUFF_SIZE - n,
-			      "partition_entitled_capacity=%ld\n", h_entitled);
-	} else {
-		n += scnprintf(buf+n, LPARCFG_BUFF_SIZE - n,
-			      "partition_entitled_capacity=%d\n", system_active_processors*100);
-	}
+		seq_printf(m, "capacity_weight=%ld\n",
+			      (h_resource >> 5*8) & 0xFF);
 
-	n += scnprintf(buf+n, LPARCFG_BUFF_SIZE - n,
-		      "partition_max_entitled_capacity=%d\n", 
-		      max_entitled_capacity);
+		seq_printf(m, "capped=%ld\n",
+			      (h_resource >> 6*8) & 0x01);
 
-	shared = 0;
-	n += scnprintf(buf+n, LPARCFG_BUFF_SIZE - n,
-		      "shared_processor_mode=%d\n", shared);
+		seq_printf(m, "unallocated_capacity=%ld\n",
+			      h_unallocated);
 
-	if (cur_cpu_spec->firmware_features & FW_FEATURE_SPLPAR) {
-		n += scnprintf(buf+n, LPARCFG_BUFF_SIZE - n,
-			      "pool=%ld\n", (h_aggregation >> 0*8)&0xffff);
+		seq_printf(m, "pool_idle_time=%ld\n",
+			      pool_idle_time);
 
-		n += scnprintf(buf+n, LPARCFG_BUFF_SIZE - n,
-			      "pool_capacity=%ld\n", (h_resource >> 3*8) &0xffff);
+		seq_printf(m, "pool_num_procs=%ld\n",
+			      pool_procs);
 
-		n += scnprintf(buf+n, LPARCFG_BUFF_SIZE - n,
-			      "group=%ld\n", (h_aggregation >> 2*8)&0xffff);
+		seq_printf(m, "purr=%ld\n",
+			      purr);
 
-		n += scnprintf(buf+n, LPARCFG_BUFF_SIZE - n,
-			      "capped=%ld\n", (h_resource >> 6*8)&0x40);
+	} else /* non SPLPAR case */ {
+		seq_printf(m, "system_active_processors=%d\n",
+			      system_active_processors);
+
+		seq_printf(m, "system_potential_processors=%d\n",
+			      system_active_processors);
 
-		n += scnprintf(buf+n, LPARCFG_BUFF_SIZE - n,
-			      "capacity_weight=%d\n", (int)(h_resource>>5*8)&0xFF);
+		seq_printf(m, "partition_max_entitled_capacity=%d\n",
+			      100*system_active_processors);
+
+		seq_printf(m, "partition_entitled_capacity=%d\n",
+			      system_active_processors*100);
 	}
+
+	seq_printf(m, "partition_active_processors=%d\n",
+			(int) lparcfg_count_active_processors());
+
+	seq_printf(m, "partition_potential_processors=%d\n",
+			system_active_processors);
+
+	seq_printf(m, "shared_processor_mode=%d\n",
+			paca[0].lppaca.xSharedProc);
+
 	return 0;
 }
 
@@ -484,58 +505,16 @@ out:
 
 #endif /* CONFIG_PPC_PSERIES */
 
-
-static ssize_t lparcfg_read(struct file *file, char *buf,
-			    size_t count, loff_t *ppos)
-{
-	struct proc_dir_entry *dp = PDE(file->f_dentry->d_inode);
-	unsigned long *data = (unsigned long *)dp->data;
-	unsigned long p;
-	ssize_t read;
-	char * pnt;
-
-	if (!data) {
-		printk(KERN_ERR "lparcfg: read failed no data\n");
-		return -EIO;
-	}
-
-	if(ppos) {
-		p = *ppos;
-	} else {
-		return -EFAULT;
-	}
-
-	if (p >= LPARCFG_BUFF_SIZE) return 0;
-
-	lparcfg_data((unsigned char *)data, LPARCFG_BUFF_SIZE); 
-	if (count > (strlen((char *)data) - p))
-		count = (strlen((char *)data)) - p;
-	read = 0;
-
-	pnt = (char *)(data) + p;
-	copy_to_user(buf, (void *)pnt, count);
-	read += count;
-	*ppos += read;
-	return read;
-}
-
 static int lparcfg_open(struct inode * inode, struct file * file)
 {
-	struct proc_dir_entry *dp = PDE(file->f_dentry->d_inode);
-	unsigned int *data = (unsigned int *)dp->data;
-
-	if (!data) {
-		printk(KERN_ERR "lparcfg: open failed no data\n");
-		return -EIO;
-	}
-
-	return 0;
+	return single_open(file,lparcfg_data,NULL);
 }
 
 struct file_operations lparcfg_fops = {
 	owner:		THIS_MODULE,
-	read:		lparcfg_read,
+	read:		seq_read,
 	open:		lparcfg_open,
+	release:	single_release,
 };
 
 int __init lparcfg_init(void)
diff --git a/arch/ppc64/kernel/mf_proc.c b/arch/ppc64/kernel/mf_proc.c
index 5d48ce84a..3ac36a5b9 100644
--- a/arch/ppc64/kernel/mf_proc.c
+++ b/arch/ppc64/kernel/mf_proc.c
@@ -25,33 +25,26 @@ static int proc_mf_dump_cmdline(char *page, char **start, off_t off,
 {
 	int len = count;
 	char *p;
-    
+
+	if (off) {
+		*eof = 1;
+		return 0;
+	}
+
 	len = mf_getCmdLine(page, &len, (u64)data);
    
-	p = page + len - 1;
-	while (p > page) {
-		if ((*p == 0) || (*p == ' '))
-			--p;
-		else
+	p = page;
+	while (len < (count - 1)) {
+		if (!*p || *p == '\n')
 			break;
+		p++;
+		len++;
 	}
-	if (*p != '\n') {
-		++p;
-		*p = '\n';
-	}
-	++p;
+	*p = '\n';
+	p++;
 	*p = 0;
-	len = p - page;
-    
-	len -= off;			
-	if (len < count) {		
-		*eof = 1;		
-		if (len <= 0)		
-			return 0;	
-	} else				
-		len = count;		
-	*start = page + off;		
-	return len;			
+
+	return p - page;
 }
 
 #if 0
diff --git a/arch/ppc64/kernel/misc.S b/arch/ppc64/kernel/misc.S
index a3c6c6a2b..e0857d90d 100644
--- a/arch/ppc64/kernel/misc.S
+++ b/arch/ppc64/kernel/misc.S
@@ -85,16 +85,17 @@ _GLOBAL(local_irq_restore)
 	cmpw	0,r3,r5
 	beqlr
 	/* are we enabling interrupts? */
-	cmpi	0,r3,0
+	cmpdi	0,r3,0
 	stb	r3,PACAPROCENABLED(r13)
 	beqlr
 	/* Check pending interrupts */
 	/*   A decrementer, IPI or PMC interrupt may have occurred
 	 *   while we were in the hypervisor (which enables) */
-	CHECKANYINT(r4,r5)
+	ld	r4,PACALPPACA+LPPACAANYINT(r13)
+	cmpdi	r4,0
 	beqlr
 
-	/* 
+	/*
 	 * Handle pending interrupts in interrupt context
 	 */
 	li	r0,0x5555
@@ -608,7 +609,7 @@ _GLOBAL(kernel_thread)
 _GLOBAL(sys_call_table32)
 	.llong .sys_restart_syscall	/* 0 */
 	.llong .sys_exit
-	.llong .sys_fork
+	.llong .ppc_fork
 	.llong .sys_read
 	.llong .sys_write
 	.llong .sys32_open		/* 5 */
@@ -678,7 +679,7 @@ _GLOBAL(sys_call_table32)
 	.llong .sys32_ssetmask
 	.llong .sys_setreuid	        /* 70 */
 	.llong .sys_setregid
-	.llong .sys32_sigsuspend
+	.llong .ppc32_sigsuspend
 	.llong .compat_sys_sigpending
 	.llong .sys32_sethostname
 	.llong .compat_sys_setrlimit	        /* 75 */
@@ -726,7 +727,7 @@ _GLOBAL(sys_call_table32)
 	.llong .sys32_ipc
 	.llong .sys_fsync
 	.llong .ppc32_sigreturn
-	.llong .sys_clone		/* 120 */
+	.llong .ppc_clone		/* 120 */
 	.llong .sys32_setdomainname
 	.llong .ppc64_newuname
 	.llong .sys_ni_syscall		/* old modify_ldt syscall */
@@ -784,7 +785,7 @@ _GLOBAL(sys_call_table32)
 	.llong .sys32_rt_sigpending     /* 175 */
 	.llong .sys32_rt_sigtimedwait
 	.llong .sys32_rt_sigqueueinfo
-	.llong .sys32_rt_sigsuspend
+	.llong .ppc32_rt_sigsuspend
 	.llong .sys32_pread64
 	.llong .sys32_pwrite64	        /* 180 */
 	.llong .sys_chown
@@ -795,7 +796,7 @@ _GLOBAL(sys_call_table32)
 	.llong .sys32_sendfile
 	.llong .sys_ni_syscall		/* reserved for streams1 */
 	.llong .sys_ni_syscall		/* reserved for streams2 */
-	.llong .sys_vfork
+	.llong .ppc_vfork
 	.llong .compat_sys_getrlimit	        /* 190 */
 	.llong .sys32_readahead
 	.llong .sys32_mmap2
@@ -880,7 +881,7 @@ _GLOBAL(sys_call_table32)
 _GLOBAL(sys_call_table)
 	.llong .sys_restart_syscall	/* 0 */
 	.llong .sys_exit
-	.llong .sys_fork
+	.llong .ppc_fork
 	.llong .sys_read
 	.llong .sys_write
 	.llong .sys_open		/* 5 */
@@ -998,7 +999,7 @@ _GLOBAL(sys_call_table)
 	.llong .sys_ipc
 	.llong .sys_fsync
 	.llong .sys_ni_syscall
-	.llong .sys_clone		/* 120 */
+	.llong .ppc_clone		/* 120 */
 	.llong .sys_setdomainname
 	.llong .ppc64_newuname
 	.llong .sys_ni_syscall		/* old modify_ldt syscall */
@@ -1056,7 +1057,7 @@ _GLOBAL(sys_call_table)
 	.llong .sys_rt_sigpending	/* 175 */
 	.llong .sys_rt_sigtimedwait
 	.llong .sys_rt_sigqueueinfo
-	.llong .sys_rt_sigsuspend
+	.llong .ppc64_rt_sigsuspend
 	.llong .sys_pread64
 	.llong .sys_pwrite64	        /* 180 */
 	.llong .sys_chown
@@ -1067,7 +1068,7 @@ _GLOBAL(sys_call_table)
 	.llong .sys_sendfile64
 	.llong .sys_ni_syscall		/* reserved for streams1 */
 	.llong .sys_ni_syscall		/* reserved for streams2 */
-	.llong .sys_vfork
+	.llong .ppc_vfork
 	.llong .sys_getrlimit	        /* 190 */
 	.llong .sys_readahead
 	.llong .sys_ni_syscall		/* 32bit only mmap2 */
diff --git a/arch/ppc64/kernel/open_pic.c b/arch/ppc64/kernel/open_pic.c
index 0eed791f3..f0afedd20 100644
--- a/arch/ppc64/kernel/open_pic.c
+++ b/arch/ppc64/kernel/open_pic.c
@@ -168,7 +168,7 @@ void __init pSeries_init_openpic(void)
         struct device_node *np;
         int i;
         unsigned int *addrp;
-        unsigned char* chrp_int_ack_special = 0;
+        unsigned char* chrp_int_ack_special = NULL;
         unsigned char init_senses[NR_IRQS - NUM_ISA_INTERRUPTS];
         int nmi_irq = -1;
 #if defined(CONFIG_VT) && defined(CONFIG_ADB_KEYBOARD) && defined(XMON)
@@ -591,7 +591,7 @@ static inline u32 physmask(u32 cpumask)
 void openpic_init_processor(u_int cpumask)
 {
 	openpic_write(&OpenPIC->Global.Processor_Initialization,
-		      physmask(cpumask & cpus_coerce(cpu_online_map)));
+		      physmask(cpumask & cpus_addr(cpu_online_map)[0]));
 }
 
 #ifdef CONFIG_SMP
@@ -625,7 +625,7 @@ void openpic_cause_IPI(u_int ipi, u_int cpumask)
 	CHECK_THIS_CPU;
 	check_arg_ipi(ipi);
 	openpic_write(&OpenPIC->THIS_CPU.IPI_Dispatch(ipi),
-		      physmask(cpumask & cpus_coerce(cpu_online_map)));
+		      physmask(cpumask & cpus_addr(cpu_online_map)[0]));
 }
 
 void openpic_request_IPIs(void)
@@ -642,13 +642,13 @@ void openpic_request_IPIs(void)
 
 	/* IPIs are marked SA_INTERRUPT as they must run with irqs disabled */
 	request_irq(openpic_vec_ipi, openpic_ipi_action, SA_INTERRUPT,
-		    "IPI0 (call function)", 0);
+		    "IPI0 (call function)", NULL);
 	request_irq(openpic_vec_ipi+1, openpic_ipi_action, SA_INTERRUPT,
-		   "IPI1 (reschedule)", 0);
+		   "IPI1 (reschedule)", NULL);
 	request_irq(openpic_vec_ipi+2, openpic_ipi_action, SA_INTERRUPT,
-		   "IPI2 (unused)", 0);
+		   "IPI2 (unused)", NULL);
 	request_irq(openpic_vec_ipi+3, openpic_ipi_action, SA_INTERRUPT,
-		   "IPI3 (debugger break)", 0);
+		   "IPI3 (debugger break)", NULL);
 
 	for ( i = 0; i < OPENPIC_NUM_IPI ; i++ )
 		openpic_enable_ipi(openpic_vec_ipi+i);
@@ -711,7 +711,7 @@ static void __init openpic_maptimer(u_int timer, u_int cpumask)
 {
 	check_arg_timer(timer);
 	openpic_write(&OpenPIC->Global.Timer[timer].Destination,
-		      physmask(cpumask & cpus_coerce(cpu_online_map)));
+		      physmask(cpumask & cpus_addr(cpu_online_map)[0]));
 }
 
 
@@ -844,7 +844,7 @@ static void openpic_set_affinity(unsigned int irq_nr, cpumask_t cpumask)
 	cpumask_t tmp;
 
 	cpus_and(tmp, cpumask, cpu_online_map);
-	openpic_mapirq(irq_nr - open_pic_irq_offset, physmask(cpus_coerce(tmp)));
+	openpic_mapirq(irq_nr - open_pic_irq_offset, physmask(cpus_addr(tmp)[0]));
 }
 
 #ifdef CONFIG_SMP
diff --git a/arch/ppc64/kernel/open_pic_defs.h b/arch/ppc64/kernel/open_pic_defs.h
index da560b79e..6459392de 100644
--- a/arch/ppc64/kernel/open_pic_defs.h
+++ b/arch/ppc64/kernel/open_pic_defs.h
@@ -172,8 +172,6 @@ struct OpenPIC {
 	OpenPIC_Processor Processor[OPENPIC_MAX_PROCESSORS];
 };
 
-extern volatile struct OpenPIC *OpenPIC;
-
 
 /*
  *  Current Task Priority Register
diff --git a/arch/ppc64/kernel/pSeries_htab.c b/arch/ppc64/kernel/pSeries_htab.c
index 8f556f3c9..dcafb219b 100644
--- a/arch/ppc64/kernel/pSeries_htab.c
+++ b/arch/ppc64/kernel/pSeries_htab.c
@@ -198,7 +198,6 @@ static long pSeries_hpte_updatepp(unsigned long slot, unsigned long newpp,
 	HPTE *hptep = htab_data.htab + slot;
 	Hpte_dword0 dw0;
 	unsigned long avpn = va >> 23;
-	unsigned long flags;
 	int ret = 0;
 
 	if (large)
@@ -222,10 +221,10 @@ static long pSeries_hpte_updatepp(unsigned long slot, unsigned long newpp,
 		tlbiel(va);
 	} else {
 		if (!(cur_cpu_spec->cpu_features & CPU_FTR_LOCKLESS_TLBIE))
-			spin_lock_irqsave(&pSeries_tlbie_lock, flags);
+			spin_lock(&pSeries_tlbie_lock);
 		tlbie(va, large);
 		if (!(cur_cpu_spec->cpu_features & CPU_FTR_LOCKLESS_TLBIE))
-			spin_unlock_irqrestore(&pSeries_tlbie_lock, flags);
+			spin_unlock(&pSeries_tlbie_lock);
 	}
 
 	return ret;
@@ -275,6 +274,7 @@ static void pSeries_hpte_invalidate(unsigned long slot, unsigned long va,
 	if (large)
 		avpn &= ~0x1UL;
 
+	local_irq_save(flags);
 	pSeries_lock_hpte(hptep);
 
 	dw0 = hptep->dw0.dw0;
@@ -292,11 +292,12 @@ static void pSeries_hpte_invalidate(unsigned long slot, unsigned long va,
 		tlbiel(va);
 	} else {
 		if (!(cur_cpu_spec->cpu_features & CPU_FTR_LOCKLESS_TLBIE))
-			spin_lock_irqsave(&pSeries_tlbie_lock, flags);
+			spin_lock(&pSeries_tlbie_lock);
 		tlbie(va, large);
 		if (!(cur_cpu_spec->cpu_features & CPU_FTR_LOCKLESS_TLBIE))
-			spin_unlock_irqrestore(&pSeries_tlbie_lock, flags);
+			spin_unlock(&pSeries_tlbie_lock);
 	}
+	local_irq_restore(flags);
 }
 
 static void pSeries_flush_hash_range(unsigned long context,
@@ -311,6 +312,8 @@ static void pSeries_flush_hash_range(unsigned long context,
 	/* XXX fix for large ptes */
 	unsigned long large = 0;
 
+	local_irq_save(flags);
+
 	j = 0;
 	for (i = 0; i < number; i++) {
 		if ((batch->addr[i] >= USER_START) &&
@@ -363,7 +366,7 @@ static void pSeries_flush_hash_range(unsigned long context,
 	} else {
 		/* XXX double check that it is safe to take this late */
 		if (!(cur_cpu_spec->cpu_features & CPU_FTR_LOCKLESS_TLBIE))
-			spin_lock_irqsave(&pSeries_tlbie_lock, flags);
+			spin_lock(&pSeries_tlbie_lock);
 
 		asm volatile("ptesync":::"memory");
 
@@ -373,8 +376,10 @@ static void pSeries_flush_hash_range(unsigned long context,
 		asm volatile("eieio; tlbsync; ptesync":::"memory");
 
 		if (!(cur_cpu_spec->cpu_features & CPU_FTR_LOCKLESS_TLBIE))
-			spin_unlock_irqrestore(&pSeries_tlbie_lock, flags);
+			spin_unlock(&pSeries_tlbie_lock);
 	}
+
+	local_irq_restore(flags);
 }
 
 void hpte_init_pSeries(void)
diff --git a/arch/ppc64/kernel/pSeries_iommu.c b/arch/ppc64/kernel/pSeries_iommu.c
index 367da0eb5..91749173f 100644
--- a/arch/ppc64/kernel/pSeries_iommu.c
+++ b/arch/ppc64/kernel/pSeries_iommu.c
@@ -147,7 +147,7 @@ static void iommu_buses_init_lpar(struct list_head *bus_list)
 		bus = pci_bus_b(ln);
 		busdn = PCI_GET_DN(bus);
 
-		dma_window = (unsigned int *)get_property(busdn, "ibm,dma-window", 0);
+		dma_window = (unsigned int *)get_property(busdn, "ibm,dma-window", NULL);
 		if (dma_window) {
 			/* Bussubno hasn't been copied yet.
 			 * Do it now because iommu_table_setparms_lpar needs it.
@@ -231,7 +231,7 @@ static void iommu_table_setparms_lpar(struct pci_controller *phb,
 {
 	unsigned int *dma_window;
 
-	dma_window = (unsigned int *)get_property(dn, "ibm,dma-window", 0);
+	dma_window = (unsigned int *)get_property(dn, "ibm,dma-window", NULL);
 
 	if (!dma_window)
 		panic("iommu_table_setparms_lpar: device %s has no"
diff --git a/arch/ppc64/kernel/pSeries_lpar.c b/arch/ppc64/kernel/pSeries_lpar.c
index 15a9eb4ed..a44c33268 100644
--- a/arch/ppc64/kernel/pSeries_lpar.c
+++ b/arch/ppc64/kernel/pSeries_lpar.c
@@ -269,7 +269,7 @@ static int find_udbg_vterm(void)
 	}
 
 	/* now we have the stdout node; figure out what type of device it is. */
-	name = (char *)get_property(stdout_node, "name", 0);
+	name = (char *)get_property(stdout_node, "name", NULL);
 	if (!name) {
 		printk(KERN_WARNING "stdout node missing 'name' property!\n");
 		goto out;
@@ -277,7 +277,7 @@ static int find_udbg_vterm(void)
 
 	if (strncmp(name, "vty", 3) == 0) {
 		if (device_is_compatible(stdout_node, "hvterm1")) {
-			termno = (u32 *)get_property(stdout_node, "reg", 0);
+			termno = (u32 *)get_property(stdout_node, "reg", NULL);
 			if (termno) {
 				vtermno = termno[0];
 				ppc_md.udbg_putc = udbg_putcLP;
diff --git a/arch/ppc64/kernel/pSeries_nvram.c b/arch/ppc64/kernel/pSeries_nvram.c
index ebccb1663..5d74028d5 100644
--- a/arch/ppc64/kernel/pSeries_nvram.c
+++ b/arch/ppc64/kernel/pSeries_nvram.c
@@ -37,7 +37,8 @@ static spinlock_t nvram_lock = SPIN_LOCK_UNLOCKED;
 static ssize_t pSeries_nvram_read(char *buf, size_t count, loff_t *index)
 {
 	unsigned int i;
-	unsigned long len, done;
+	unsigned long len;
+	int done;
 	unsigned long flags;
 	char *p = buf;
 
@@ -80,7 +81,8 @@ static ssize_t pSeries_nvram_read(char *buf, size_t count, loff_t *index)
 static ssize_t pSeries_nvram_write(char *buf, size_t count, loff_t *index)
 {
 	unsigned int i;
-	unsigned long len, done;
+	unsigned long len;
+	int done;
 	unsigned long flags;
 	const char *p = buf;
 
diff --git a/arch/ppc64/kernel/pSeries_pci.c b/arch/ppc64/kernel/pSeries_pci.c
index 4014ccd9f..92bc868f3 100644
--- a/arch/ppc64/kernel/pSeries_pci.c
+++ b/arch/ppc64/kernel/pSeries_pci.c
@@ -40,6 +40,7 @@
 #include <asm/ppcdebug.h>
 #include <asm/naca.h>
 #include <asm/iommu.h>
+#include <asm/rtas.h>
 
 #include "open_pic.h"
 #include "pci.h"
@@ -62,7 +63,7 @@ extern unsigned long pci_probe_only;
 
 static int rtas_read_config(struct device_node *dn, int where, int size, u32 *val)
 {
-	unsigned long returnval = ~0L;
+	int returnval = -1;
 	unsigned long buid, addr;
 	int ret;
 
@@ -72,7 +73,8 @@ static int rtas_read_config(struct device_node *dn, int where, int size, u32 *va
 	addr = (dn->busno << 16) | (dn->devfn << 8) | where;
 	buid = dn->phb->buid;
 	if (buid) {
-		ret = rtas_call(ibm_read_pci_config, 4, 2, &returnval, addr, buid >> 32, buid & 0xffffffff, size);
+		ret = rtas_call(ibm_read_pci_config, 4, 2, &returnval,
+				addr, buid >> 32, buid & 0xffffffff, size);
 	} else {
 		ret = rtas_call(read_pci_config, 2, 2, &returnval, addr, size);
 	}
@@ -282,10 +284,10 @@ static void __init pci_process_bridge_OF_ranges(struct pci_controller *hose,
 				isa_dn = of_find_node_by_type(NULL, "isa");
 				if (isa_dn) {
 					isa_io_base = pci_io_base;
-					of_node_put(isa_dn);
 					pci_process_ISA_OF_ranges(isa_dn,
 						hose->io_base_phys,
 						hose->io_base_virt);
+					of_node_put(isa_dn);
                                         /* Allow all IO */
                                         io_page_mask = -1;
 				}
@@ -353,14 +355,51 @@ static void python_countermeasures(unsigned long addr)
 	iounmap(chip_regs);
 }
 
-struct pci_controller *alloc_phb(struct device_node *dev,
+void __init init_pci_config_tokens (void)
+{
+	read_pci_config = rtas_token("read-pci-config");
+	write_pci_config = rtas_token("write-pci-config");
+	ibm_read_pci_config = rtas_token("ibm,read-pci-config");
+	ibm_write_pci_config = rtas_token("ibm,write-pci-config");
+}
+
+unsigned long __init get_phb_buid (struct device_node *phb)
+{
+	int addr_cells;
+	unsigned int *buid_vals;
+	unsigned int len;
+	unsigned long buid;
+
+	if (ibm_read_pci_config == -1) return 0;
+
+	/* PHB's will always be children of the root node,
+	 * or so it is promised by the current firmware. */
+	if (phb->parent == NULL)
+		return 0;
+	if (phb->parent->parent)
+		return 0;
+
+	buid_vals = (unsigned int *) get_property(phb, "reg", &len);
+	if (buid_vals == NULL)
+		return 0;
+
+	addr_cells = prom_n_addr_cells(phb);
+	if (addr_cells == 1) {
+		buid = (unsigned long) buid_vals[0];
+	} else {
+		buid = (((unsigned long)buid_vals[0]) << 32UL) |
+			(((unsigned long)buid_vals[1]) & 0xffffffff);
+	}
+	return buid;
+}
+
+static struct pci_controller * __init alloc_phb(struct device_node *dev,
 				 unsigned int addr_size_words)
 {
 	struct pci_controller *phb;
 	unsigned int *ui_ptr = NULL, len;
 	struct reg_property64 reg_struct;
 	int *bus_range;
-	int *buid_vals;
 	char *model;
 	enum phb_types phb_type;
  	struct property *of_prop;
@@ -431,18 +470,7 @@ struct pci_controller *alloc_phb(struct device_node *dev,
 	phb->arch_data   = dev;
 	phb->ops = &rtas_pci_ops;
 
-	buid_vals = (int *) get_property(dev, "ibm,fw-phb-id", &len);
-
-	if (buid_vals == NULL) {
-		phb->buid = 0;
-	} else {
-		if (len < 2 * sizeof(int))
-			// Support for new OF that only has 1 integer for buid.
-			phb->buid = (unsigned long)buid_vals[0];
-		else
-			phb->buid = (((unsigned long)buid_vals[0]) << 32UL) |
-				(((unsigned long)buid_vals[1]) & 0xffffffff);
-	}
+	phb->buid = get_phb_buid(dev);
 
 	return phb;
 }
@@ -456,11 +484,6 @@ unsigned long __init find_and_init_phbs(void)
 	unsigned int *opprop;
 	struct device_node *root = of_find_node_by_path("/");
 
-	read_pci_config = rtas_token("read-pci-config");
-	write_pci_config = rtas_token("write-pci-config");
-	ibm_read_pci_config = rtas_token("ibm,read-pci-config");
-	ibm_write_pci_config = rtas_token("ibm,write-pci-config");
-
 	if (naca->interrupt_controller == IC_OPEN_PIC) {
 		opprop = (unsigned int *)get_property(root,
 				"platform-open-pic", NULL);
@@ -577,8 +600,9 @@ void __devinit pcibios_fixup_bus(struct pci_bus *bus)
 			BUG();	/* No I/O resource for this PHB? */
 
 		if (request_resource(&ioport_resource, res))
-			printk(KERN_ERR "Failed to request IO"
-					"on hose %d\n", 0 /* FIXME */);
+			printk(KERN_ERR "Failed to request IO on "
+					"PCI domain %d\n", pci_domain_nr(bus));
+
 
 		for (i = 0; i < 3; ++i) {
 			res = &hose->mem_resources[i];
@@ -586,8 +610,9 @@ void __devinit pcibios_fixup_bus(struct pci_bus *bus)
 				BUG();	/* No memory resource for this PHB? */
 			bus->resource[i+1] = res;
 			if (res->flags && request_resource(&iomem_resource, res))
-				printk(KERN_ERR "Failed to request MEM"
-						"on hose %d\n", 0 /* FIXME */);
+				printk(KERN_ERR "Failed to request MEM on "
+						"PCI domain %d\n",
+						pci_domain_nr(bus));
 		}
 	} else if (pci_probe_only &&
 		   (dev->class >> 8) == PCI_CLASS_BRIDGE_PCI) {
diff --git a/arch/ppc64/kernel/pacaData.c b/arch/ppc64/kernel/pacaData.c
index d283f4897..0e4228316 100644
--- a/arch/ppc64/kernel/pacaData.c
+++ b/arch/ppc64/kernel/pacaData.c
@@ -16,12 +16,24 @@
 #include <asm/ptrace.h>
 
 #include <asm/iSeries/ItLpPaca.h>
+#include <asm/iSeries/ItLpQueue.h>
 #include <asm/naca.h>
 #include <asm/paca.h>
 
 struct naca_struct *naca;
 struct systemcfg *systemcfg;
 
+/* This symbol is provided by the linker - let it fill in the paca
+ * field correctly */
+extern unsigned long __toc_start;
+
+/* Stack space used when we detect a bad kernel stack pointer, and
+ * early in SMP boots before relocation is enabled.
+ *
+ * ABI requires stack to be 128-byte aligned
+ */
+char emergency_stack[PAGE_SIZE * NR_CPUS] __attribute__((aligned(128)));
+
 /* The Paca is an array with one entry per processor.  Each contains an 
  * ItLpPaca, which contains the information shared between the 
  * hypervisor and Linux.  Each also contains an ItLpRegSave area which
@@ -34,22 +46,18 @@ struct systemcfg *systemcfg;
  */
 #define PACAINITDATA(number,start,lpq,asrr,asrv)			    \
 {									    \
-	.xLpPacaPtr = &paca[number].xLpPaca,				    \
-	.xLpRegSavePtr = &paca[number].xRegSav,				    \
+	.lppaca_ptr = &paca[number].lppaca,				    \
+	.reg_save_ptr = &paca[number].reg_save,				    \
 	.lock_token = 0x8000,						    \
-	.xPacaIndex = (number),		/* Paca Index */		    \
+	.paca_index = (number),		/* Paca Index */		    \
+	.lpqueue_ptr = (lpq),		/* &xItLpQueue, */		    \
 	.default_decr = 0x00ff0000,	/* Initial Decr */		    \
-	.xStab_data = {							    \
-		.real = (asrr),		/* Real pointer to segment table */ \
-		.virt = (asrv),		/* Virt pointer to segment table */ \
-		.next_round_robin = 1,					    \
-	},								    \
-	.lpQueuePtr = (lpq),		/* &xItLpQueue, */		    \
-	/* .xRtas = {							    \
-		.lock = SPIN_LOCK_UNLOCKED				    \
-	}, */								    \
-	.xProcStart = (start),		/* Processor start */		    \
-	.xLpPaca = {							    \
+	.kernel_toc = (unsigned long)(&__toc_start) + 0x8000UL,		    \
+	.stab_real = (asrr), 		/* Real pointer to segment table */ \
+	.stab_addr = (asrv),		/* Virt pointer to segment table */ \
+	.emergency_sp = &emergency_stack[((number)+1) * PAGE_SIZE],	    \
+	.cpu_start = (start),		/* Processor start */		    \
+	.lppaca = {							    \
 		.xDesc = 0xd397d781,	/* "LpPa" */			    \
 		.xSize = sizeof(struct ItLpPaca),			    \
 		.xFPRegsInUse = 1,					    \
@@ -58,149 +66,147 @@ struct systemcfg *systemcfg;
 		.xEndOfQuantum = 0xfffffffffffffffful,			    \
 		.xSLBCount = 64,					    \
 	},								    \
-	.xRegSav = {							    \
+	.reg_save = {							    \
 		.xDesc = 0xd397d9e2,	/* "LpRS" */			    \
 		.xSize = sizeof(struct ItLpRegSave)			    \
 	},								    \
-	.exception_sp =							    \
-		(&paca[number].exception_stack[0]) - EXC_FRAME_SIZE,	    \
 }
 
 struct paca_struct paca[] __page_aligned = {
 #ifdef CONFIG_PPC_ISERIES
 	PACAINITDATA( 0, 1, &xItLpQueue, 0, STAB0_VIRT_ADDR),
 #else
-	PACAINITDATA( 0, 1, 0, STAB0_PHYS_ADDR, STAB0_VIRT_ADDR),
+	PACAINITDATA( 0, 1, NULL, STAB0_PHYS_ADDR, STAB0_VIRT_ADDR),
 #endif
-	PACAINITDATA( 1, 0, 0, 0, 0),
-	PACAINITDATA( 2, 0, 0, 0, 0),
-	PACAINITDATA( 3, 0, 0, 0, 0),
-	PACAINITDATA( 4, 0, 0, 0, 0),
-	PACAINITDATA( 5, 0, 0, 0, 0),
-	PACAINITDATA( 6, 0, 0, 0, 0),
-	PACAINITDATA( 7, 0, 0, 0, 0),
-	PACAINITDATA( 8, 0, 0, 0, 0),
-	PACAINITDATA( 9, 0, 0, 0, 0),
-	PACAINITDATA(10, 0, 0, 0, 0),
-	PACAINITDATA(11, 0, 0, 0, 0),
-	PACAINITDATA(12, 0, 0, 0, 0),
-	PACAINITDATA(13, 0, 0, 0, 0),
-	PACAINITDATA(14, 0, 0, 0, 0),
-	PACAINITDATA(15, 0, 0, 0, 0),
-	PACAINITDATA(16, 0, 0, 0, 0),
-	PACAINITDATA(17, 0, 0, 0, 0),
-	PACAINITDATA(18, 0, 0, 0, 0),
-	PACAINITDATA(19, 0, 0, 0, 0),
-	PACAINITDATA(20, 0, 0, 0, 0),
-	PACAINITDATA(21, 0, 0, 0, 0),
-	PACAINITDATA(22, 0, 0, 0, 0),
-	PACAINITDATA(23, 0, 0, 0, 0),
-	PACAINITDATA(24, 0, 0, 0, 0),
-	PACAINITDATA(25, 0, 0, 0, 0),
-	PACAINITDATA(26, 0, 0, 0, 0),
-	PACAINITDATA(27, 0, 0, 0, 0),
-	PACAINITDATA(28, 0, 0, 0, 0),
-	PACAINITDATA(29, 0, 0, 0, 0),
-	PACAINITDATA(30, 0, 0, 0, 0),
-	PACAINITDATA(31, 0, 0, 0, 0),
+	PACAINITDATA( 1, 0, NULL, 0, 0),
+	PACAINITDATA( 2, 0, NULL, 0, 0),
+	PACAINITDATA( 3, 0, NULL, 0, 0),
+	PACAINITDATA( 4, 0, NULL, 0, 0),
+	PACAINITDATA( 5, 0, NULL, 0, 0),
+	PACAINITDATA( 6, 0, NULL, 0, 0),
+	PACAINITDATA( 7, 0, NULL, 0, 0),
+	PACAINITDATA( 8, 0, NULL, 0, 0),
+	PACAINITDATA( 9, 0, NULL, 0, 0),
+	PACAINITDATA(10, 0, NULL, 0, 0),
+	PACAINITDATA(11, 0, NULL, 0, 0),
+	PACAINITDATA(12, 0, NULL, 0, 0),
+	PACAINITDATA(13, 0, NULL, 0, 0),
+	PACAINITDATA(14, 0, NULL, 0, 0),
+	PACAINITDATA(15, 0, NULL, 0, 0),
+	PACAINITDATA(16, 0, NULL, 0, 0),
+	PACAINITDATA(17, 0, NULL, 0, 0),
+	PACAINITDATA(18, 0, NULL, 0, 0),
+	PACAINITDATA(19, 0, NULL, 0, 0),
+	PACAINITDATA(20, 0, NULL, 0, 0),
+	PACAINITDATA(21, 0, NULL, 0, 0),
+	PACAINITDATA(22, 0, NULL, 0, 0),
+	PACAINITDATA(23, 0, NULL, 0, 0),
+	PACAINITDATA(24, 0, NULL, 0, 0),
+	PACAINITDATA(25, 0, NULL, 0, 0),
+	PACAINITDATA(26, 0, NULL, 0, 0),
+	PACAINITDATA(27, 0, NULL, 0, 0),
+	PACAINITDATA(28, 0, NULL, 0, 0),
+	PACAINITDATA(29, 0, NULL, 0, 0),
+	PACAINITDATA(30, 0, NULL, 0, 0),
+	PACAINITDATA(31, 0, NULL, 0, 0),
 #if NR_CPUS > 32
-	PACAINITDATA(32, 0, 0, 0, 0),
-	PACAINITDATA(33, 0, 0, 0, 0),
-	PACAINITDATA(34, 0, 0, 0, 0),
-	PACAINITDATA(35, 0, 0, 0, 0),
-	PACAINITDATA(36, 0, 0, 0, 0),
-	PACAINITDATA(37, 0, 0, 0, 0),
-	PACAINITDATA(38, 0, 0, 0, 0),
-	PACAINITDATA(39, 0, 0, 0, 0),
-	PACAINITDATA(40, 0, 0, 0, 0),
-	PACAINITDATA(41, 0, 0, 0, 0),
-	PACAINITDATA(42, 0, 0, 0, 0),
-	PACAINITDATA(43, 0, 0, 0, 0),
-	PACAINITDATA(44, 0, 0, 0, 0),
-	PACAINITDATA(45, 0, 0, 0, 0),
-	PACAINITDATA(46, 0, 0, 0, 0),
-	PACAINITDATA(47, 0, 0, 0, 0),
-	PACAINITDATA(48, 0, 0, 0, 0),
-	PACAINITDATA(49, 0, 0, 0, 0),
-	PACAINITDATA(50, 0, 0, 0, 0),
-	PACAINITDATA(51, 0, 0, 0, 0),
-	PACAINITDATA(52, 0, 0, 0, 0),
-	PACAINITDATA(53, 0, 0, 0, 0),
-	PACAINITDATA(54, 0, 0, 0, 0),
-	PACAINITDATA(55, 0, 0, 0, 0),
-	PACAINITDATA(56, 0, 0, 0, 0),
-	PACAINITDATA(57, 0, 0, 0, 0),
-	PACAINITDATA(58, 0, 0, 0, 0),
-	PACAINITDATA(59, 0, 0, 0, 0),
-	PACAINITDATA(60, 0, 0, 0, 0),
-	PACAINITDATA(61, 0, 0, 0, 0),
-	PACAINITDATA(62, 0, 0, 0, 0),
-	PACAINITDATA(63, 0, 0, 0, 0),
+	PACAINITDATA(32, 0, NULL, 0, 0),
+	PACAINITDATA(33, 0, NULL, 0, 0),
+	PACAINITDATA(34, 0, NULL, 0, 0),
+	PACAINITDATA(35, 0, NULL, 0, 0),
+	PACAINITDATA(36, 0, NULL, 0, 0),
+	PACAINITDATA(37, 0, NULL, 0, 0),
+	PACAINITDATA(38, 0, NULL, 0, 0),
+	PACAINITDATA(39, 0, NULL, 0, 0),
+	PACAINITDATA(40, 0, NULL, 0, 0),
+	PACAINITDATA(41, 0, NULL, 0, 0),
+	PACAINITDATA(42, 0, NULL, 0, 0),
+	PACAINITDATA(43, 0, NULL, 0, 0),
+	PACAINITDATA(44, 0, NULL, 0, 0),
+	PACAINITDATA(45, 0, NULL, 0, 0),
+	PACAINITDATA(46, 0, NULL, 0, 0),
+	PACAINITDATA(47, 0, NULL, 0, 0),
+	PACAINITDATA(48, 0, NULL, 0, 0),
+	PACAINITDATA(49, 0, NULL, 0, 0),
+	PACAINITDATA(50, 0, NULL, 0, 0),
+	PACAINITDATA(51, 0, NULL, 0, 0),
+	PACAINITDATA(52, 0, NULL, 0, 0),
+	PACAINITDATA(53, 0, NULL, 0, 0),
+	PACAINITDATA(54, 0, NULL, 0, 0),
+	PACAINITDATA(55, 0, NULL, 0, 0),
+	PACAINITDATA(56, 0, NULL, 0, 0),
+	PACAINITDATA(57, 0, NULL, 0, 0),
+	PACAINITDATA(58, 0, NULL, 0, 0),
+	PACAINITDATA(59, 0, NULL, 0, 0),
+	PACAINITDATA(60, 0, NULL, 0, 0),
+	PACAINITDATA(61, 0, NULL, 0, 0),
+	PACAINITDATA(62, 0, NULL, 0, 0),
+	PACAINITDATA(63, 0, NULL, 0, 0),
 #if NR_CPUS > 64
-	PACAINITDATA(64, 0, 0, 0, 0),
-	PACAINITDATA(65, 0, 0, 0, 0),
-	PACAINITDATA(66, 0, 0, 0, 0),
-	PACAINITDATA(67, 0, 0, 0, 0),
-	PACAINITDATA(68, 0, 0, 0, 0),
-	PACAINITDATA(69, 0, 0, 0, 0),
-	PACAINITDATA(70, 0, 0, 0, 0),
-	PACAINITDATA(71, 0, 0, 0, 0),
-	PACAINITDATA(72, 0, 0, 0, 0),
-	PACAINITDATA(73, 0, 0, 0, 0),
-	PACAINITDATA(74, 0, 0, 0, 0),
-	PACAINITDATA(75, 0, 0, 0, 0),
-	PACAINITDATA(76, 0, 0, 0, 0),
-	PACAINITDATA(77, 0, 0, 0, 0),
-	PACAINITDATA(78, 0, 0, 0, 0),
-	PACAINITDATA(79, 0, 0, 0, 0),
-	PACAINITDATA(80, 0, 0, 0, 0),
-	PACAINITDATA(81, 0, 0, 0, 0),
-	PACAINITDATA(82, 0, 0, 0, 0),
-	PACAINITDATA(83, 0, 0, 0, 0),
-	PACAINITDATA(84, 0, 0, 0, 0),
-	PACAINITDATA(85, 0, 0, 0, 0),
-	PACAINITDATA(86, 0, 0, 0, 0),
-	PACAINITDATA(87, 0, 0, 0, 0),
-	PACAINITDATA(88, 0, 0, 0, 0),
-	PACAINITDATA(89, 0, 0, 0, 0),
-	PACAINITDATA(90, 0, 0, 0, 0),
-	PACAINITDATA(91, 0, 0, 0, 0),
-	PACAINITDATA(92, 0, 0, 0, 0),
-	PACAINITDATA(93, 0, 0, 0, 0),
-	PACAINITDATA(94, 0, 0, 0, 0),
-	PACAINITDATA(95, 0, 0, 0, 0),
-	PACAINITDATA(96, 0, 0, 0, 0),
-	PACAINITDATA(97, 0, 0, 0, 0),
-	PACAINITDATA(98, 0, 0, 0, 0),
-	PACAINITDATA(99, 0, 0, 0, 0),
-	PACAINITDATA(100, 0, 0, 0, 0),
-	PACAINITDATA(101, 0, 0, 0, 0),
-	PACAINITDATA(102, 0, 0, 0, 0),
-	PACAINITDATA(103, 0, 0, 0, 0),
-	PACAINITDATA(104, 0, 0, 0, 0),
-	PACAINITDATA(105, 0, 0, 0, 0),
-	PACAINITDATA(106, 0, 0, 0, 0),
-	PACAINITDATA(107, 0, 0, 0, 0),
-	PACAINITDATA(108, 0, 0, 0, 0),
-	PACAINITDATA(109, 0, 0, 0, 0),
-	PACAINITDATA(110, 0, 0, 0, 0),
-	PACAINITDATA(111, 0, 0, 0, 0),
-	PACAINITDATA(112, 0, 0, 0, 0),
-	PACAINITDATA(113, 0, 0, 0, 0),
-	PACAINITDATA(114, 0, 0, 0, 0),
-	PACAINITDATA(115, 0, 0, 0, 0),
-	PACAINITDATA(116, 0, 0, 0, 0),
-	PACAINITDATA(117, 0, 0, 0, 0),
-	PACAINITDATA(118, 0, 0, 0, 0),
-	PACAINITDATA(119, 0, 0, 0, 0),
-	PACAINITDATA(120, 0, 0, 0, 0),
-	PACAINITDATA(121, 0, 0, 0, 0),
-	PACAINITDATA(122, 0, 0, 0, 0),
-	PACAINITDATA(123, 0, 0, 0, 0),
-	PACAINITDATA(124, 0, 0, 0, 0),
-	PACAINITDATA(125, 0, 0, 0, 0),
-	PACAINITDATA(126, 0, 0, 0, 0),
-	PACAINITDATA(127, 0, 0, 0, 0),
+	PACAINITDATA(64, 0, NULL, 0, 0),
+	PACAINITDATA(65, 0, NULL, 0, 0),
+	PACAINITDATA(66, 0, NULL, 0, 0),
+	PACAINITDATA(67, 0, NULL, 0, 0),
+	PACAINITDATA(68, 0, NULL, 0, 0),
+	PACAINITDATA(69, 0, NULL, 0, 0),
+	PACAINITDATA(70, 0, NULL, 0, 0),
+	PACAINITDATA(71, 0, NULL, 0, 0),
+	PACAINITDATA(72, 0, NULL, 0, 0),
+	PACAINITDATA(73, 0, NULL, 0, 0),
+	PACAINITDATA(74, 0, NULL, 0, 0),
+	PACAINITDATA(75, 0, NULL, 0, 0),
+	PACAINITDATA(76, 0, NULL, 0, 0),
+	PACAINITDATA(77, 0, NULL, 0, 0),
+	PACAINITDATA(78, 0, NULL, 0, 0),
+	PACAINITDATA(79, 0, NULL, 0, 0),
+	PACAINITDATA(80, 0, NULL, 0, 0),
+	PACAINITDATA(81, 0, NULL, 0, 0),
+	PACAINITDATA(82, 0, NULL, 0, 0),
+	PACAINITDATA(83, 0, NULL, 0, 0),
+	PACAINITDATA(84, 0, NULL, 0, 0),
+	PACAINITDATA(85, 0, NULL, 0, 0),
+	PACAINITDATA(86, 0, NULL, 0, 0),
+	PACAINITDATA(87, 0, NULL, 0, 0),
+	PACAINITDATA(88, 0, NULL, 0, 0),
+	PACAINITDATA(89, 0, NULL, 0, 0),
+	PACAINITDATA(90, 0, NULL, 0, 0),
+	PACAINITDATA(91, 0, NULL, 0, 0),
+	PACAINITDATA(92, 0, NULL, 0, 0),
+	PACAINITDATA(93, 0, NULL, 0, 0),
+	PACAINITDATA(94, 0, NULL, 0, 0),
+	PACAINITDATA(95, 0, NULL, 0, 0),
+	PACAINITDATA(96, 0, NULL, 0, 0),
+	PACAINITDATA(97, 0, NULL, 0, 0),
+	PACAINITDATA(98, 0, NULL, 0, 0),
+	PACAINITDATA(99, 0, NULL, 0, 0),
+	PACAINITDATA(100, 0, NULL, 0, 0),
+	PACAINITDATA(101, 0, NULL, 0, 0),
+	PACAINITDATA(102, 0, NULL, 0, 0),
+	PACAINITDATA(103, 0, NULL, 0, 0),
+	PACAINITDATA(104, 0, NULL, 0, 0),
+	PACAINITDATA(105, 0, NULL, 0, 0),
+	PACAINITDATA(106, 0, NULL, 0, 0),
+	PACAINITDATA(107, 0, NULL, 0, 0),
+	PACAINITDATA(108, 0, NULL, 0, 0),
+	PACAINITDATA(109, 0, NULL, 0, 0),
+	PACAINITDATA(110, 0, NULL, 0, 0),
+	PACAINITDATA(111, 0, NULL, 0, 0),
+	PACAINITDATA(112, 0, NULL, 0, 0),
+	PACAINITDATA(113, 0, NULL, 0, 0),
+	PACAINITDATA(114, 0, NULL, 0, 0),
+	PACAINITDATA(115, 0, NULL, 0, 0),
+	PACAINITDATA(116, 0, NULL, 0, 0),
+	PACAINITDATA(117, 0, NULL, 0, 0),
+	PACAINITDATA(118, 0, NULL, 0, 0),
+	PACAINITDATA(119, 0, NULL, 0, 0),
+	PACAINITDATA(120, 0, NULL, 0, 0),
+	PACAINITDATA(121, 0, NULL, 0, 0),
+	PACAINITDATA(122, 0, NULL, 0, 0),
+	PACAINITDATA(123, 0, NULL, 0, 0),
+	PACAINITDATA(124, 0, NULL, 0, 0),
+	PACAINITDATA(125, 0, NULL, 0, 0),
+	PACAINITDATA(126, 0, NULL, 0, 0),
+	PACAINITDATA(127, 0, NULL, 0, 0),
 #endif
 #endif
 };
diff --git a/arch/ppc64/kernel/pci.h b/arch/ppc64/kernel/pci.h
index a6652d43d..2ca27ccc7 100644
--- a/arch/ppc64/kernel/pci.h
+++ b/arch/ppc64/kernel/pci.h
@@ -34,8 +34,8 @@ extern struct pci_dev *ppc64_isabridge_dev;	/* may be NULL if no ISA bus */
  *******************************************************************/
 struct device_node;
 typedef void *(*traverse_func)(struct device_node *me, void *data);
-void *traverse_pci_devices(struct device_node *start, traverse_func pre, traverse_func post, void *data);
-void *traverse_all_pci_devices(traverse_func pre);
+void *traverse_pci_devices(struct device_node *start, traverse_func pre,
+		void *data);
 
 void pci_devs_phb_init(void);
 void pci_fix_bus_sysdata(void);
@@ -47,4 +47,9 @@ struct device_node *fetch_dev_dn(struct pci_dev *dev);
 void pci_addr_cache_insert_device(struct pci_dev *dev);
 void pci_addr_cache_remove_device(struct pci_dev *dev);
 
+/* From pSeries_pci.h */
+void init_pci_config_tokens (void);
+unsigned long get_phb_buid (struct device_node *);
+
+
 #endif /* __PPC_KERNEL_PCI_H__ */
diff --git a/arch/ppc64/kernel/pci_dn.c b/arch/ppc64/kernel/pci_dn.c
index a482731c5..c771bdc64 100644
--- a/arch/ppc64/kernel/pci_dn.c
+++ b/arch/ppc64/kernel/pci_dn.c
@@ -19,8 +19,6 @@
  * along with this program; if not, write to the Free Software
  * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307 USA
  */
-
-#include <linux/config.h>
 #include <linux/kernel.h>
 #include <linux/pci.h>
 #include <linux/delay.h>
@@ -40,22 +38,22 @@
 
 #include "pci.h"
 
-/* Traverse_func that inits the PCI fields of the device node.
+/*
+ * Traverse_func that inits the PCI fields of the device node.
  * NOTE: this *must* be done before read/write config to the device.
  */
-static void * __init
-update_dn_pci_info(struct device_node *dn, void *data)
+static void * __init update_dn_pci_info(struct device_node *dn, void *data)
 {
-#ifdef CONFIG_PPC_PSERIES
-	struct pci_controller *phb = (struct pci_controller *)data;
+	struct pci_controller *phb = data;
 	u32 *regs;
-	char *device_type = get_property(dn, "device_type", 0);
+	char *device_type = get_property(dn, "device_type", NULL);
 	char *model;
 
 	dn->phb = phb;
-	if (device_type && strcmp(device_type, "pci") == 0 && get_property(dn, "class-code", 0) == 0) {
+	if (device_type && (strcmp(device_type, "pci") == 0) &&
+			(get_property(dn, "class-code", NULL) == 0)) {
 		/* special case for PHB's.  Sigh. */
-		regs = (u32 *)get_property(dn, "bus-range", 0);
+		regs = (u32 *)get_property(dn, "bus-range", NULL);
 		dn->busno = regs[0];
 
 		model = (char *)get_property(dn, "model", NULL);
@@ -65,64 +63,54 @@ update_dn_pci_info(struct device_node *dn, void *data)
 		else
 			dn->devfn = 0;	/* assumption */
 	} else {
-		regs = (u32 *)get_property(dn, "reg", 0);
+		regs = (u32 *)get_property(dn, "reg", NULL);
 		if (regs) {
 			/* First register entry is addr (00BBSS00)  */
 			dn->busno = (regs[0] >> 16) & 0xff;
 			dn->devfn = (regs[0] >> 8) & 0xff;
 		}
 	}
-#endif
 	return NULL;
 }
 
-/******************************************************************
+/*
  * Traverse a device tree stopping each PCI device in the tree.
  * This is done depth first.  As each node is processed, a "pre"
- * function is called, the children are processed recursively, and
- * then a "post" function is called.
+ * function is called and the children are processed recursively.
  *
- * The "pre" and "post" funcs return a value.  If non-zero
- * is returned from the "pre" func, the traversal stops and this
- * value is returned.  The return value from "post" is not used.
- * This return value is useful when using traverse as
- * a method of finding a device.
+ * The "pre" func returns a value.  If non-zero is returned from
+ * the "pre" func, the traversal stops and this value is returned.
+ * This return value is useful when using traverse as a method of
+ * finding a device.
  *
- * NOTE: we do not run the funcs for devices that do not appear to
+ * NOTE: we do not run the func for devices that do not appear to
  * be PCI except for the start node which we assume (this is good
  * because the start node is often a phb which may be missing PCI
  * properties).
  * We use the class-code as an indicator. If we run into
  * one of these nodes we also assume its siblings are non-pci for
  * performance.
- *
- ******************************************************************/
-void *traverse_pci_devices(struct device_node *start, traverse_func pre, traverse_func post, void *data)
+ */
+void *traverse_pci_devices(struct device_node *start, traverse_func pre,
+		void *data)
 {
 	struct device_node *dn, *nextdn;
 	void *ret;
 
-	if (pre && (ret = pre(start, data)) != NULL)
+	if (pre && ((ret = pre(start, data)) != NULL))
 		return ret;
 	for (dn = start->child; dn; dn = nextdn) {
 		nextdn = NULL;
-#ifdef CONFIG_PPC_PSERIES
-		if (get_property(dn, "class-code", 0)) {
-			if (pre && (ret = pre(dn, data)) != NULL)
+		if (get_property(dn, "class-code", NULL)) {
+			if (pre && ((ret = pre(dn, data)) != NULL))
 				return ret;
-			if (dn->child) {
+			if (dn->child)
 				/* Depth first...do children */
 				nextdn = dn->child;
-			} else if (dn->sibling) {
+			else if (dn->sibling)
 				/* ok, try next sibling instead. */
 				nextdn = dn->sibling;
-			} else {
-				/* no more children or siblings...call "post" */
-				if (post)
-					post(dn, data);
-			}
 		}
-#endif
 		if (!nextdn) {
 			/* Walk up to next valid sibling. */
 			do {
@@ -136,31 +124,35 @@ void *traverse_pci_devices(struct device_node *start, traverse_func pre, travers
 	return NULL;
 }
 
-/* Same as traverse_pci_devices except this does it for all phbs.
+/*
+ * Same as traverse_pci_devices except this does it for all phbs.
  */
-void *traverse_all_pci_devices(traverse_func pre)
+static void *traverse_all_pci_devices(traverse_func pre)
 {
-	struct pci_controller* phb;
+	struct pci_controller *phb;
 	void *ret;
-	for (phb=hose_head;phb;phb=phb->next)
-		if ((ret = traverse_pci_devices((struct device_node *)phb->arch_data, pre, NULL, phb)) != NULL)
+
+	for (phb = hose_head; phb; phb = phb->next)
+		if ((ret = traverse_pci_devices(phb->arch_data, pre, phb))
+				!= NULL)
 			return ret;
 	return NULL;
 }
 
 
-/* Traversal func that looks for a <busno,devfcn> value.
+/*
+ * Traversal func that looks for a <busno,devfcn> value.
  * If found, the device_node is returned (thus terminating the traversal).
  */
-static void *
-is_devfn_node(struct device_node *dn, void *data)
+static void *is_devfn_node(struct device_node *dn, void *data)
 {
 	int busno = ((unsigned long)data >> 8) & 0xff;
 	int devfn = ((unsigned long)data) & 0xff;
-	return (devfn == dn->devfn && busno == dn->busno) ? dn : NULL;
+	return ((devfn == dn->devfn) && (busno == dn->busno)) ? dn : NULL;
 }
 
-/* This is the "slow" path for looking up a device_node from a
+/*
+ * This is the "slow" path for looking up a device_node from a
  * pci_dev.  It will hunt for the device under its parent's
  * phb and then update sysdata for a future fastpath.
  *
@@ -174,14 +166,14 @@ is_devfn_node(struct device_node *dn, void *data)
  */
 struct device_node *fetch_dev_dn(struct pci_dev *dev)
 {
-	struct device_node *orig_dn = (struct device_node *)dev->sysdata;
+	struct device_node *orig_dn = dev->sysdata;
 	struct pci_controller *phb = orig_dn->phb; /* assume same phb as orig_dn */
 	struct device_node *phb_dn;
 	struct device_node *dn;
 	unsigned long searchval = (dev->bus->number << 8) | dev->devfn;
 
-	phb_dn = (struct device_node *)(phb->arch_data);
-	dn = (struct device_node *)traverse_pci_devices(phb_dn, is_devfn_node, NULL, (void *)searchval);
+	phb_dn = phb->arch_data;
+	dn = traverse_pci_devices(phb_dn, is_devfn_node, (void *)searchval);
 	if (dn) {
 		dev->sysdata = dn;
 		/* ToDo: call some device init hook here */
@@ -191,25 +183,23 @@ struct device_node *fetch_dev_dn(struct pci_dev *dev)
 EXPORT_SYMBOL(fetch_dev_dn);
 
 
-/******************************************************************
+/*
  * Actually initialize the phbs.
  * The buswalk on this phb has not happened yet.
- ******************************************************************/
-void __init
-pci_devs_phb_init(void)
+ */
+void __init pci_devs_phb_init(void)
 {
 	/* This must be done first so the device nodes have valid pci info! */
 	traverse_all_pci_devices(update_dn_pci_info);
 }
 
 
-static void __init
-pci_fixup_bus_sysdata_list(struct list_head *bus_list)
+static void __init pci_fixup_bus_sysdata_list(struct list_head *bus_list)
 {
 	struct list_head *ln;
 	struct pci_bus *bus;
 
-	for (ln=bus_list->next; ln != bus_list; ln=ln->next) {
+	for (ln = bus_list->next; ln != bus_list; ln = ln->next) {
 		bus = pci_bus_b(ln);
 		if (bus->self)
 			bus->sysdata = bus->self->sysdata;
@@ -217,7 +207,7 @@ pci_fixup_bus_sysdata_list(struct list_head *bus_list)
 	}
 }
 
-/******************************************************************
+/*
  * Fixup the bus->sysdata ptrs to point to the bus' device_node.
  * This is done late in pcibios_init().  We do this mostly for
  * sanity, but pci_dma.c uses these at DMA time so they must be
@@ -225,9 +215,8 @@ pci_fixup_bus_sysdata_list(struct list_head *bus_list)
  * To do this we recurse down the bus hierarchy.  Note that PHB's
  * have bus->self == NULL, but fortunately bus->sysdata is already
  * correct in this case.
- ******************************************************************/
-void __init
-pci_fix_bus_sysdata(void)
+ */
+void __init pci_fix_bus_sysdata(void)
 {
 	pci_fixup_bus_sysdata_list(&pci_root_buses);
 }
diff --git a/arch/ppc64/kernel/pmac_pci.c b/arch/ppc64/kernel/pmac_pci.c
index 3a7b57a81..169195713 100644
--- a/arch/ppc64/kernel/pmac_pci.c
+++ b/arch/ppc64/kernel/pmac_pci.c
@@ -57,7 +57,7 @@ static int __init fixup_one_level_bus_range(struct device_node *node, int higher
 		int len;
 
 		/* For PCI<->PCI bridges or CardBus bridges, we go down */
-		class_code = (unsigned int *) get_property(node, "class-code", 0);
+		class_code = (unsigned int *) get_property(node, "class-code", NULL);
 		if (!class_code || ((*class_code >> 8) != PCI_CLASS_BRIDGE_PCI &&
 			(*class_code >> 8) != PCI_CLASS_BRIDGE_CARDBUS))
 			continue;
diff --git a/arch/ppc64/kernel/pmac_smp.c b/arch/ppc64/kernel/pmac_smp.c
index a96cbbb80..a67e2a595 100644
--- a/arch/ppc64/kernel/pmac_smp.c
+++ b/arch/ppc64/kernel/pmac_smp.c
@@ -120,7 +120,7 @@ static void __init smp_core99_kick_cpu(int nr)
 
 	/* Put some life in our friend */
 	pmac_call_feature(PMAC_FTR_RESET_CPU, NULL, nr, 0);
-	paca[nr].xProcStart = 1;
+	paca[nr].cpu_start = 1;
 
 	/* 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,
diff --git a/arch/ppc64/kernel/ppc_ksyms.c b/arch/ppc64/kernel/ppc_ksyms.c
index 4fb03a944..836cf2a43 100644
--- a/arch/ppc64/kernel/ppc_ksyms.c
+++ b/arch/ppc64/kernel/ppc_ksyms.c
@@ -47,10 +47,7 @@
 
 extern int do_signal(sigset_t *, struct pt_regs *);
 
-int abs(int);
-
 EXPORT_SYMBOL(do_signal);
-EXPORT_SYMBOL(sys_ioctl);
 
 EXPORT_SYMBOL(isa_io_base);
 EXPORT_SYMBOL(pci_io_base);
@@ -158,8 +155,6 @@ EXPORT_SYMBOL_NOVERS(memscan);
 EXPORT_SYMBOL_NOVERS(memcmp);
 EXPORT_SYMBOL_NOVERS(memchr);
 
-EXPORT_SYMBOL(abs);
-
 EXPORT_SYMBOL(timer_interrupt);
 EXPORT_SYMBOL(irq_desc);
 EXPORT_SYMBOL(get_wchan);
diff --git a/arch/ppc64/kernel/proc_ppc64.c b/arch/ppc64/kernel/proc_ppc64.c
index c0ee1a2a5..ed172cd78 100644
--- a/arch/ppc64/kernel/proc_ppc64.c
+++ b/arch/ppc64/kernel/proc_ppc64.c
@@ -84,7 +84,7 @@ static int __init proc_ppc64_create(void)
 {
 	struct proc_dir_entry *root;
 
-	root = proc_mkdir("ppc64", 0);
+	root = proc_mkdir("ppc64", NULL);
 	if (!root)
 		return 1;
 
@@ -94,7 +94,7 @@ static int __init proc_ppc64_create(void)
 	if (!proc_mkdir("rtas", root))
 		return 1;
 
-	if (!proc_symlink("rtas", 0, "ppc64/rtas"))
+	if (!proc_symlink("rtas", NULL, "ppc64/rtas"))
 		return 1;
 
 	return 0;
@@ -161,21 +161,10 @@ static loff_t page_map_seek( struct file *file, loff_t off, int whence)
 	return (file->f_pos = new);
 }
 
-static ssize_t page_map_read( struct file *file, char *buf, size_t nbytes, loff_t *ppos)
+static ssize_t page_map_read( struct file *file, char __user *buf, size_t nbytes, loff_t *ppos)
 {
-	unsigned pos = *ppos;
 	struct proc_dir_entry *dp = PDE(file->f_dentry->d_inode);
-
-	if ( pos >= dp->size )
-		return 0;
-	if ( nbytes >= dp->size )
-		nbytes = dp->size;
-	if ( pos + nbytes > dp->size )
-		nbytes = dp->size - pos;
-
-	copy_to_user( buf, (char *)dp->data + pos, nbytes );
-	*ppos = pos + nbytes;
-	return nbytes;
+	return simple_read_from_buffer(buf, nbytes, ppos, dp->data, dp->size);
 }
 
 static int page_map_mmap( struct file *file, struct vm_area_struct *vma )
diff --git a/arch/ppc64/kernel/process.c b/arch/ppc64/kernel/process.c
index be153b959..5acc56729 100644
--- a/arch/ppc64/kernel/process.c
+++ b/arch/ppc64/kernel/process.c
@@ -65,8 +65,43 @@ struct mm_struct ioremap_mm = {
 	.page_table_lock = SPIN_LOCK_UNLOCKED,
 };
 
+/*
+ * Make sure the floating-point register state in the
+ * the thread_struct is up to date for task tsk.
+ */
+void flush_fp_to_thread(struct task_struct *tsk)
+{
+	if (tsk->thread.regs) {
+		/*
+		 * We need to disable preemption here because if we didn't,
+		 * another process could get scheduled after the regs->msr
+		 * test but before we have finished saving the FP registers
+		 * to the thread_struct.  That process could take over the
+		 * FPU, and then when we get scheduled again we would store
+		 * bogus values for the remaining FP registers.
+		 */
+		preempt_disable();
+		if (tsk->thread.regs->msr & MSR_FP) {
+#ifdef CONFIG_SMP
+			/*
+			 * This should only ever be called for current or
+			 * for a stopped child process.  Since we save away
+			 * the FP register state on context switch on SMP,
+			 * there is something wrong if a stopped child appears
+			 * to still have its FP state in the CPU registers.
+			 */
+			BUG_ON(tsk != current);
+#endif
+			giveup_fpu(current);
+		}
+		preempt_enable();
+	}
+}
+
 void enable_kernel_fp(void)
 {
+	WARN_ON(preemptible());
+
 #ifdef CONFIG_SMP
 	if (current->thread.regs && (current->thread.regs->msr & MSR_FP))
 		giveup_fpu(current);
@@ -80,12 +115,9 @@ EXPORT_SYMBOL(enable_kernel_fp);
 
 int dump_task_fpu(struct task_struct *tsk, elf_fpregset_t *fpregs)
 {
-	struct pt_regs *regs = tsk->thread.regs;
-
-	if (!regs)
+	if (!tsk->thread.regs)
 		return 0;
-	if (tsk == current && (regs->msr & MSR_FP))
-		giveup_fpu(current);
+	flush_fp_to_thread(current);
 
 	memcpy(fpregs, &tsk->thread.fpr[0], sizeof(*fpregs));
 
@@ -96,6 +128,8 @@ int dump_task_fpu(struct task_struct *tsk, elf_fpregset_t *fpregs)
 
 void enable_kernel_altivec(void)
 {
+	WARN_ON(preemptible());
+
 #ifdef CONFIG_SMP
 	if (current->thread.regs && (current->thread.regs->msr & MSR_VEC))
 		giveup_altivec(current);
@@ -107,10 +141,29 @@ void enable_kernel_altivec(void)
 }
 EXPORT_SYMBOL(enable_kernel_altivec);
 
+/*
+ * Make sure the VMX/Altivec register state in the
+ * the thread_struct is up to date for task tsk.
+ */
+void flush_altivec_to_thread(struct task_struct *tsk)
+{
+#ifdef CONFIG_ALTIVEC
+	if (tsk->thread.regs) {
+		preempt_disable();
+		if (tsk->thread.regs->msr & MSR_VEC) {
+#ifdef CONFIG_SMP
+			BUG_ON(tsk != current);
+#endif
+			giveup_altivec(current);
+		}
+		preempt_enable();
+	}
+#endif
+}
+
 int dump_task_altivec(struct pt_regs *regs, elf_vrregset_t *vrregs)
 {
-	if (regs->msr & MSR_VEC)
-		giveup_altivec(current);
+	flush_altivec_to_thread(current);
 	memcpy(vrregs, &current->thread.vr[0], sizeof(*vrregs));
 	return 1;
 }
@@ -166,6 +219,7 @@ struct task_struct *__switch_to(struct task_struct *prev,
 void show_regs(struct pt_regs * regs)
 {
 	int i;
+	unsigned long trap;
 
 	printk("NIP: %016lX XER: %016lX LR: %016lX\n",
 	       regs->nip, regs->xer, regs->link);
@@ -176,7 +230,8 @@ void show_regs(struct pt_regs * regs)
 	       regs->msr & MSR_FP ? 1 : 0,regs->msr&MSR_ME ? 1 : 0,
 	       regs->msr&MSR_IR ? 1 : 0,
 	       regs->msr&MSR_DR ? 1 : 0);
-	if (regs->trap == 0x300 || regs->trap == 0x380 || regs->trap == 0x600)
+	trap = TRAP(regs);
+	if (trap == 0x300 || trap == 0x380 || trap == 0x600)
 		printk("DAR: %016lx, DSISR: %016lx\n", regs->dar, regs->dsisr);
 	printk("TASK: %p[%d] '%s' THREAD: %p",
 	       current, current->pid, current->comm, current->thread_info);
@@ -191,6 +246,8 @@ void show_regs(struct pt_regs * regs)
 		}
 
 		printk("%016lX ", regs->gpr[i]);
+		if (i == 13 && !FULL_REGS(regs))
+			break;
 	}
 	printk("\n");
 	/*
@@ -245,16 +302,8 @@ release_thread(struct task_struct *t)
  */
 void prepare_to_copy(struct task_struct *tsk)
 {
-	struct pt_regs *regs = tsk->thread.regs;
-
-	if (regs == NULL)
-		return;
-	if (regs->msr & MSR_FP)
-		giveup_fpu(current);
-#ifdef CONFIG_ALTIVEC
-	if (regs->msr & MSR_VEC)
-		giveup_altivec(current);
-#endif /* CONFIG_ALTIVEC */
+	flush_fp_to_thread(current);
+	flush_altivec_to_thread(current);
 }
 
 /*
@@ -439,12 +488,8 @@ int sys_execve(unsigned long a0, unsigned long a1, unsigned long a2,
 	error = PTR_ERR(filename);
 	if (IS_ERR(filename))
 		goto out;
-	if (regs->msr & MSR_FP)
-		giveup_fpu(current);
-#ifdef CONFIG_ALTIVEC
-	if (regs->msr & MSR_VEC)
-		giveup_altivec(current);
-#endif /* CONFIG_ALTIVEC */
+	flush_fp_to_thread(current);
+	flush_altivec_to_thread(current);
 	error = do_execve(filename, (char __user * __user *) a1,
 				    (char __user * __user *) a2, regs);
   
diff --git a/arch/ppc64/kernel/prom.c b/arch/ppc64/kernel/prom.c
index a5f8f2418..bdf5e3a47 100644
--- a/arch/ppc64/kernel/prom.c
+++ b/arch/ppc64/kernel/prom.c
@@ -15,9 +15,7 @@
  *      2 of the License, or (at your option) any later version.
  */
 
-#if 0
-#define DEBUG_PROM
-#endif
+#undef DEBUG_PROM
 
 #include <stdarg.h>
 #include <linux/config.h>
@@ -91,15 +89,17 @@ extern const struct linux_logo logo_linux_clut224;
  */
 
 
-#define PROM_BUG() do { \
-        prom_print(RELOC("kernel BUG at ")); \
-        prom_print(RELOC(__FILE__)); \
-        prom_print(RELOC(":")); \
-        prom_print_hex(__LINE__); \
-        prom_print(RELOC("!\n")); \
-        __asm__ __volatile__(".long " BUG_ILLEGAL_INSTR); \
+#define PROM_BUG() do {						\
+        prom_printf("kernel BUG at %s line 0x%x!\n",		\
+		    RELOC(__FILE__), __LINE__);			\
+        __asm__ __volatile__(".long " BUG_ILLEGAL_INSTR);	\
 } while (0)
 
+#ifdef DEBUG_PROM
+#define prom_debug(x...)	prom_printf(x)
+#else
+#define prom_debug(x...)
+#endif
 
 
 struct pci_reg_property {
@@ -133,10 +133,10 @@ typedef unsigned long interpret_func(struct device_node *, unsigned long,
 /* prom structure */
 struct prom_t prom;
 
-char *prom_display_paths[FB_MAX] __initdata = { 0, };
+char *prom_display_paths[FB_MAX] __initdata = { NULL, };
 phandle prom_display_nodes[FB_MAX] __initdata;
 unsigned int prom_num_displays = 0;
-char *of_stdout_device = 0;
+char *of_stdout_device = NULL;
 
 static int iommu_force_on;
 int ppc64_iommu_off;
@@ -148,13 +148,13 @@ extern struct lmb lmb;
 #define MAX_PHB (32 * 6)  /* 32 drawers * 6 PHBs/drawer */
 struct of_tce_table of_tce_table[MAX_PHB + 1];
 
-char *bootpath = 0;
-char *bootdevice = 0;
+char *bootpath = NULL;
+char *bootdevice = NULL;
 
 int boot_cpuid = 0;
 #define MAX_CPU_THREADS 2
 
-struct device_node *allnodes = 0;
+struct device_node *allnodes = NULL;
 /* use when traversing tree through the allnext, child, sibling,
  * or parent members of struct device_node.
  */
@@ -178,37 +178,44 @@ struct {
 
 char testString[] = "LINUX\n"; 
 
+/*
+ * This are used in calls to call_prom.  The 4th and following
+ * arguments to call_prom should be 32-bit values.  64 bit values
+ * are truncated to 32 bits (and fortunately don't get interpreted
+ * as two arguments).
+ */
+#define ADDR(x)		(u32) ((unsigned long)(x) - offset)
 
 /* This is the one and *ONLY* place where we actually call open
  * firmware from, since we need to make sure we're running in 32b
  * mode when we do.  We switch back to 64b mode upon return.
  */
 
-#define PROM_ERROR	(0x00000000fffffffful)
+#define PROM_ERROR	(-1)
 
-static unsigned long __init call_prom(const char *service, int nargs, int nret, ...)
+static int __init call_prom(const char *service, int nargs, int nret, ...)
 {
 	int i;
 	unsigned long offset = reloc_offset();
 	struct prom_t *_prom = PTRRELOC(&prom);
 	va_list list;
-        
-	_prom->args.service = (u32)LONG_LSW(service);
+
+	_prom->args.service = ADDR(service);
 	_prom->args.nargs = nargs;
 	_prom->args.nret = nret;
-        _prom->args.rets = (prom_arg_t *)&(_prom->args.args[nargs]);
+	_prom->args.rets = (prom_arg_t *)&(_prom->args.args[nargs]);
 
-        va_start(list, nret);
-	for (i=0; i < nargs ;i++)
-		_prom->args.args[i] = (prom_arg_t)LONG_LSW(va_arg(list, unsigned long));
-        va_end(list);
+	va_start(list, nret);
+	for (i=0; i < nargs; i++)
+		_prom->args.args[i] = va_arg(list, prom_arg_t);
+	va_end(list);
 
 	for (i=0; i < nret ;i++)
 		_prom->args.rets[i] = 0;
 
 	enter_prom(&_prom->args);
 
-	return (unsigned long)((nret > 0) ? _prom->args.rets[0] : 0);
+	return (nret > 0)? _prom->args.rets[0]: 0;
 }
 
 
@@ -225,47 +232,81 @@ static void __init prom_print(const char *msg)
 		for (q = p; *q != 0 && *q != '\n'; ++q)
 			;
 		if (q > p)
-			call_prom(RELOC("write"), 3, 1, _prom->stdout,
-				  p, q - p);
-		if (*q != 0) {
-			++q;
-			call_prom(RELOC("write"), 3, 1, _prom->stdout,
-				  RELOC("\r\n"), 2);
-		}
+			call_prom("write", 3, 1, _prom->stdout, p, q - p);
+		if (*q == 0)
+			break;
+		++q;
+		call_prom("write", 3, 1, _prom->stdout, ADDR("\r\n"), 2);
 	}
 }
 
 
 static void __init prom_print_hex(unsigned long val)
 {
-        int i, nibbles = sizeof(val)*2;
-        char buf[sizeof(val)*2+1];
+	unsigned long offset = reloc_offset();
+	int i, nibbles = sizeof(val)*2;
+	char buf[sizeof(val)*2+1];
+	struct prom_t *_prom = PTRRELOC(&prom);
 
-        for (i = nibbles-1;  i >= 0;  i--) {
-                buf[i] = (val & 0xf) + '0';
-                if (buf[i] > '9')
-                    buf[i] += ('a'-'0'-10);
-                val >>= 4;
-        }
-        buf[nibbles] = '\0';
-	prom_print(buf);
+	for (i = nibbles-1;  i >= 0;  i--) {
+		buf[i] = (val & 0xf) + '0';
+		if (buf[i] > '9')
+			buf[i] += ('a'-'0'-10);
+		val >>= 4;
+	}
+	buf[nibbles] = '\0';
+	call_prom("write", 3, 1, _prom->stdout, buf, nibbles);
 }
 
 
-static void __init prom_print_nl(void)
+static void __init prom_printf(const char *format, ...)
 {
 	unsigned long offset = reloc_offset();
-	prom_print(RELOC("\n"));
+	const char *p, *q, *s;
+	va_list args;
+	unsigned long v;
+	struct prom_t *_prom = PTRRELOC(&prom);
+
+	va_start(args, format);
+	for (p = PTRRELOC(format); *p != 0; p = q) {
+		for (q = p; *q != 0 && *q != '\n' && *q != '%'; ++q)
+			;
+		if (q > p)
+			call_prom("write", 3, 1, _prom->stdout, p, q - p);
+		if (*q == 0)
+			break;
+		if (*q == '\n') {
+			++q;
+			call_prom("write", 3, 1, _prom->stdout,
+				  ADDR("\r\n"), 2);
+			continue;
+		}
+		++q;
+		if (*q == 0)
+			break;
+		switch (*q) {
+		case 's':
+			++q;
+			s = va_arg(args, const char *);
+			prom_print(s);
+			break;
+		case 'x':
+			++q;
+			v = va_arg(args, unsigned long);
+			prom_print_hex(v);
+			break;
+		}
+	}
 }
 
 
-static void __init prom_panic(const char *reason)
+static void __init __attribute__((noreturn)) prom_panic(const char *reason)
 {
 	unsigned long offset = reloc_offset();
 
-	prom_print(reason);
+	prom_print(PTRRELOC(reason));
 	/* ToDo: should put up an SRC here */
-	call_prom(RELOC("exit"), 0, 0);
+	call_prom("exit", 0, 0);
 
 	for (;;)			/* should never get here */
 		;
@@ -275,45 +316,49 @@ static void __init prom_panic(const char *reason)
 static int __init prom_next_node(phandle *nodep)
 {
 	phandle node;
-	unsigned long offset = reloc_offset();
 
 	if ((node = *nodep) != 0
-	    && (*nodep = call_prom(RELOC("child"), 1, 1, node)) != 0)
+	    && (*nodep = call_prom("child", 1, 1, node)) != 0)
 		return 1;
-	if ((*nodep = call_prom(RELOC("peer"), 1, 1, node)) != 0)
+	if ((*nodep = call_prom("peer", 1, 1, node)) != 0)
 		return 1;
 	for (;;) {
-		if ((node = call_prom(RELOC("parent"), 1, 1, node)) == 0)
+		if ((node = call_prom("parent", 1, 1, node)) == 0)
 			return 0;
-		if ((*nodep = call_prom(RELOC("peer"), 1, 1, node)) != 0)
+		if ((*nodep = call_prom("peer", 1, 1, node)) != 0)
 			return 1;
 	}
 }
 
+static int __init prom_getprop(phandle node, const char *pname,
+			       void *value, size_t valuelen)
+{
+	unsigned long offset = reloc_offset();
+
+	return call_prom("getprop", 4, 1, node, ADDR(pname),
+			 (u32)(unsigned long) value, (u32) valuelen);
+}
 
 static void __init prom_initialize_naca(void)
 {
 	phandle node;
 	char type[64];
-        unsigned long num_cpus = 0;
-        unsigned long offset = reloc_offset();
+	unsigned long num_cpus = 0;
+	unsigned long offset = reloc_offset();
 	struct prom_t *_prom = PTRRELOC(&prom);
-        struct naca_struct *_naca = RELOC(naca);
-        struct systemcfg *_systemcfg = RELOC(systemcfg);
+	struct naca_struct *_naca = RELOC(naca);
+	struct systemcfg *_systemcfg = RELOC(systemcfg);
 
 	/* NOTE: _naca->debug_switch is already initialized. */
-#ifdef DEBUG_PROM
-	prom_print(RELOC("prom_initialize_naca: start...\n"));
-#endif
+	prom_debug("prom_initialize_naca: start...\n");
 
 	_naca->pftSize = 0;	/* ilog2 of htab size.  computed below. */
 
-        for (node = 0; prom_next_node(&node); ) {
-                type[0] = 0;
-                call_prom(RELOC("getprop"), 4, 1, node, RELOC("device_type"),
-                          type, sizeof(type));
+	for (node = 0; prom_next_node(&node); ) {
+		type[0] = 0;
+		prom_getprop(node, "device_type", type, sizeof(type));
 
-                if (!strcmp(type, RELOC("cpu"))) {
+		if (!strcmp(type, RELOC("cpu"))) {
 			num_cpus += 1;
 
 			/* We're assuming *all* of the CPUs have the same
@@ -321,37 +366,30 @@ static void __init prom_initialize_naca(void)
 			 */
 			if ( num_cpus == 1 ) {
 				u32 size, lsize;
+				const char *dc, *ic;
 
-				call_prom(RELOC("getprop"), 4, 1, node,
-					  RELOC("d-cache-size"),
-					  &size, sizeof(size));
+				if (_systemcfg->platform == PLATFORM_POWERMAC){
+					dc = "d-cache-block-size";
+					ic = "i-cache-block-size";
+				} else {
+					dc = "d-cache-line-size";
+					ic = "i-cache-line-size";
+				}
 
-				if (_systemcfg->platform == PLATFORM_POWERMAC)
-					call_prom(RELOC("getprop"), 4, 1, node,
-						  RELOC("d-cache-block-size"),
-						  &lsize, sizeof(lsize));
-				else
-					call_prom(RELOC("getprop"), 4, 1, node,
-						  RELOC("d-cache-line-size"),
-						  &lsize, sizeof(lsize));
+				prom_getprop(node, "d-cache-size",
+					     &size, sizeof(size));
+
+				prom_getprop(node, dc, &lsize, sizeof(lsize));
 
 				_systemcfg->dCacheL1Size = size;
 				_systemcfg->dCacheL1LineSize = lsize;
 				_naca->dCacheL1LogLineSize = __ilog2(lsize);
 				_naca->dCacheL1LinesPerPage = PAGE_SIZE/lsize;
 
-				call_prom(RELOC("getprop"), 4, 1, node,
-					  RELOC("i-cache-size"),
-					  &size, sizeof(size));
+				prom_getprop(node, "i-cache-size",
+					     &size, sizeof(size));
 
-				if (_systemcfg->platform == PLATFORM_POWERMAC)
-					call_prom(RELOC("getprop"), 4, 1, node,
-						  RELOC("i-cache-block-size"),
-						  &lsize, sizeof(lsize));
-				else
-					call_prom(RELOC("getprop"), 4, 1, node,
-						  RELOC("i-cache-line-size"),
-						  &lsize, sizeof(lsize));
+				prom_getprop(node, ic, &lsize, sizeof(lsize));
 
 				_systemcfg->iCacheL1Size = size;
 				_systemcfg->iCacheL1LineSize = lsize;
@@ -360,14 +398,13 @@ static void __init prom_initialize_naca(void)
 
 				if (_systemcfg->platform == PLATFORM_PSERIES_LPAR) {
 					u32 pft_size[2];
-					call_prom(RELOC("getprop"), 4, 1, node, 
-						  RELOC("ibm,pft-size"),
-						  &pft_size, sizeof(pft_size));
+					prom_getprop(node, "ibm,pft-size",
+						&pft_size, sizeof(pft_size));
 				/* pft_size[0] is the NUMA CEC cookie */
 					_naca->pftSize = pft_size[1];
 				}
 			}
-                } else if (!strcmp(type, RELOC("serial"))) {
+		} else if (!strcmp(type, RELOC("serial"))) {
 			phandle isa, pci;
 			struct isa_reg_property reg;
 			union pci_range ranges;
@@ -375,24 +412,21 @@ static void __init prom_initialize_naca(void)
 			if (_systemcfg->platform == PLATFORM_POWERMAC)
 				continue;
 			type[0] = 0;
-			call_prom(RELOC("getprop"), 4, 1, node,
-				  RELOC("ibm,aix-loc"), type, sizeof(type));
+			prom_getprop(node, "ibm,aix-loc", type, sizeof(type));
 
 			if (strcmp(type, RELOC("S1")))
 				continue;
 
-			call_prom(RELOC("getprop"), 4, 1, node, RELOC("reg"),
-				  &reg, sizeof(reg));
+			prom_getprop(node, "reg", &reg, sizeof(reg));
 
-			isa = call_prom(RELOC("parent"), 1, 1, node);
+			isa = call_prom("parent", 1, 1, node);
 			if (!isa)
 				PROM_BUG();
-			pci = call_prom(RELOC("parent"), 1, 1, isa);
+			pci = call_prom("parent", 1, 1, isa);
 			if (!pci)
 				PROM_BUG();
 
-			call_prom(RELOC("getprop"), 4, 1, pci, RELOC("ranges"),
-				  &ranges, sizeof(ranges));
+			prom_getprop(pci, "ranges", &ranges, sizeof(ranges));
 
 			if ( _prom->encode_phys_size == 32 )
 				_naca->serialPortAddr = ranges.pci32.phys+reg.address;
@@ -401,7 +435,7 @@ static void __init prom_initialize_naca(void)
 					((((unsigned long)ranges.pci64.phys_hi) << 32) |
 					 (ranges.pci64.phys_lo)) + reg.address;
 			}
-                }
+		}
 	}
 
 	if (_systemcfg->platform == PLATFORM_POWERMAC)
@@ -410,31 +444,29 @@ static void __init prom_initialize_naca(void)
 		_naca->interrupt_controller = IC_INVALID;
 		for (node = 0; prom_next_node(&node); ) {
 			type[0] = 0;
-			call_prom(RELOC("getprop"), 4, 1, node, RELOC("name"),
-				  type, sizeof(type));
+			prom_getprop(node, "name", type, sizeof(type));
 			if (strcmp(type, RELOC("interrupt-controller")))
 				continue;
-			call_prom(RELOC("getprop"), 4, 1, node, RELOC("compatible"),
-				  type, sizeof(type));
+			prom_getprop(node, "compatible", type, sizeof(type));
 			if (strstr(type, RELOC("open-pic")))
 				_naca->interrupt_controller = IC_OPEN_PIC;
 			else if (strstr(type, RELOC("ppc-xicp")))
 				_naca->interrupt_controller = IC_PPC_XIC;
 			else
-				prom_print(RELOC("prom: failed to recognize"
-						 " interrupt-controller\n"));
+				prom_printf("prom: failed to recognize"
+					    " interrupt-controller\n");
 			break;
 		}
 	}
 
 	if (_naca->interrupt_controller == IC_INVALID) {
-		prom_print(RELOC("prom: failed to find interrupt-controller\n"));
+		prom_printf("prom: failed to find interrupt-controller\n");
 		PROM_BUG();
 	}
 
 	/* We gotta have at least 1 cpu... */
-        if ( (_systemcfg->processorCount = num_cpus) < 1 )
-                PROM_BUG();
+	if ( (_systemcfg->processorCount = num_cpus) < 1 )
+		PROM_BUG();
 
 	_systemcfg->physicalMemorySize = lmb_phys_mem_size();
 
@@ -454,7 +486,7 @@ static void __init prom_initialize_naca(void)
 	}
 
 	if (_naca->pftSize == 0) {
-		prom_print(RELOC("prom: failed to compute pftSize!\n"));
+		prom_printf("prom: failed to compute pftSize!\n");
 		PROM_BUG();
 	}
 
@@ -464,41 +496,23 @@ static void __init prom_initialize_naca(void)
 	_systemcfg->version.minor = SYSTEMCFG_MINOR;
 	_systemcfg->processor = _get_PVR();
 
-#ifdef DEBUG_PROM
-        prom_print(RELOC("systemcfg->processorCount       = 0x"));
-        prom_print_hex(_systemcfg->processorCount);
-        prom_print_nl();
-
-        prom_print(RELOC("systemcfg->physicalMemorySize   = 0x"));
-        prom_print_hex(_systemcfg->physicalMemorySize);
-        prom_print_nl();
-
-        prom_print(RELOC("naca->pftSize                   = 0x"));
-        prom_print_hex(_naca->pftSize);
-        prom_print_nl();
-
-        prom_print(RELOC("systemcfg->dCacheL1LineSize     = 0x"));
-        prom_print_hex(_systemcfg->dCacheL1LineSize);
-        prom_print_nl();
-
-        prom_print(RELOC("systemcfg->iCacheL1LineSize     = 0x"));
-        prom_print_hex(_systemcfg->iCacheL1LineSize);
-        prom_print_nl();
-
-        prom_print(RELOC("naca->serialPortAddr            = 0x"));
-        prom_print_hex(_naca->serialPortAddr);
-        prom_print_nl();
-
-        prom_print(RELOC("naca->interrupt_controller      = 0x"));
-        prom_print_hex(_naca->interrupt_controller);
-        prom_print_nl();
-
-        prom_print(RELOC("systemcfg->platform             = 0x"));
-        prom_print_hex(_systemcfg->platform);
-        prom_print_nl();
-
-	prom_print(RELOC("prom_initialize_naca: end...\n"));
-#endif
+	prom_debug("systemcfg->processorCount       = 0x%x\n",
+		   _systemcfg->processorCount);
+	prom_debug("systemcfg->physicalMemorySize   = 0x%x\n",
+		   _systemcfg->physicalMemorySize);
+	prom_debug("naca->pftSize                   = 0x%x\n",
+		   _naca->pftSize);
+	prom_debug("systemcfg->dCacheL1LineSize     = 0x%x\n",
+		   _systemcfg->dCacheL1LineSize);
+	prom_debug("systemcfg->iCacheL1LineSize     = 0x%x\n",
+		   _systemcfg->iCacheL1LineSize);
+	prom_debug("naca->serialPortAddr            = 0x%x\n",
+		   _naca->serialPortAddr);
+	prom_debug("naca->interrupt_controller      = 0x%x\n",
+		   _naca->interrupt_controller);
+	prom_debug("systemcfg->platform             = 0x%x\n",
+		   _systemcfg->platform);
+	prom_debug("prom_initialize_naca: end...\n");
 }
 
 
@@ -512,9 +526,7 @@ static void __init early_cmdline_parse(void)
 
 	opt = strstr(RELOC(cmd_line), RELOC("iommu="));
 	if (opt) {
-		prom_print(RELOC("opt is:"));
-		prom_print(opt);
-		prom_print(RELOC("\n"));
+		prom_printf("opt is:%s\n", opt);
 		opt += 6;
 		while (*opt && *opt == ' ')
 			opt++;
@@ -527,7 +539,7 @@ static void __init early_cmdline_parse(void)
 #ifndef CONFIG_PMAC_DART
 	if (_systemcfg->platform == PLATFORM_POWERMAC) {
 		RELOC(ppc64_iommu_off) = 1;
-		prom_print(RELOC("DART disabled on PowerMac !\n"));
+		prom_printf("DART disabled on PowerMac !\n");
 	}
 #endif
 }
@@ -535,51 +547,36 @@ static void __init early_cmdline_parse(void)
 #ifdef DEBUG_PROM
 void prom_dump_lmb(void)
 {
-        unsigned long i;
-        unsigned long offset = reloc_offset();
+	unsigned long i;
+	unsigned long offset = reloc_offset();
 	struct lmb *_lmb  = PTRRELOC(&lmb);
 
-        prom_print(RELOC("\nprom_dump_lmb:\n"));
-        prom_print(RELOC("    memory.cnt                  = 0x"));
-        prom_print_hex(_lmb->memory.cnt);
-	prom_print_nl();
-        prom_print(RELOC("    memory.size                 = 0x"));
-        prom_print_hex(_lmb->memory.size);
-	prom_print_nl();
-        for (i=0; i < _lmb->memory.cnt ;i++) {
-                prom_print(RELOC("    memory.region[0x"));
-		prom_print_hex(i);
-		prom_print(RELOC("].base       = 0x"));
-                prom_print_hex(_lmb->memory.region[i].base);
-		prom_print_nl();
-                prom_print(RELOC("                      .physbase = 0x"));
-                prom_print_hex(_lmb->memory.region[i].physbase);
-		prom_print_nl();
-                prom_print(RELOC("                      .size     = 0x"));
-                prom_print_hex(_lmb->memory.region[i].size);
-		prom_print_nl();
-        }
-
-	prom_print_nl();
-        prom_print(RELOC("    reserved.cnt                  = 0x"));
-        prom_print_hex(_lmb->reserved.cnt);
-	prom_print_nl();
-        prom_print(RELOC("    reserved.size                 = 0x"));
-        prom_print_hex(_lmb->reserved.size);
-	prom_print_nl();
-        for (i=0; i < _lmb->reserved.cnt ;i++) {
-                prom_print(RELOC("    reserved.region[0x"));
-		prom_print_hex(i);
-		prom_print(RELOC("].base       = 0x"));
-                prom_print_hex(_lmb->reserved.region[i].base);
-		prom_print_nl();
-                prom_print(RELOC("                      .physbase = 0x"));
-                prom_print_hex(_lmb->reserved.region[i].physbase);
-		prom_print_nl();
-                prom_print(RELOC("                      .size     = 0x"));
-                prom_print_hex(_lmb->reserved.region[i].size);
-		prom_print_nl();
-        }
+	prom_printf("\nprom_dump_lmb:\n");
+	prom_printf("    memory.cnt		  = 0x%x\n",
+		    _lmb->memory.cnt);
+	prom_printf("    memory.size		 = 0x%x\n",
+		    _lmb->memory.size);
+	for (i=0; i < _lmb->memory.cnt ;i++) {
+		prom_printf("    memory.region[0x%x].base       = 0x%x\n",
+			    i, _lmb->memory.region[i].base);
+		prom_printf("		      .physbase = 0x%x\n",
+			    _lmb->memory.region[i].physbase);
+		prom_printf("		      .size     = 0x%x\n",
+			    _lmb->memory.region[i].size);
+	}
+
+	prom_printf("\n    reserved.cnt		  = 0x%x\n",
+		    _lmb->reserved.cnt);
+	prom_printf("    reserved.size		 = 0x%x\n",
+		    _lmb->reserved.size);
+	for (i=0; i < _lmb->reserved.cnt ;i++) {
+		prom_printf("    reserved.region[0x%x\n].base       = 0x%x\n",
+			    i, _lmb->reserved.region[i].base);
+		prom_printf("		      .physbase = 0x%x\n",
+			    _lmb->reserved.region[i].physbase);
+		prom_printf("		      .size     = 0x%x\n",
+			    _lmb->reserved.region[i].size);
+	}
 }
 #endif /* DEBUG_PROM */
 
@@ -587,9 +584,9 @@ static void __init prom_initialize_lmb(void)
 {
 	phandle node;
 	char type[64];
-        unsigned long i, offset = reloc_offset();
+	unsigned long i, offset = reloc_offset();
 	struct prom_t *_prom = PTRRELOC(&prom);
-        struct systemcfg *_systemcfg = RELOC(systemcfg);
+	struct systemcfg *_systemcfg = RELOC(systemcfg);
 	union lmb_reg_property reg;
 	unsigned long lmb_base, lmb_size;
 	unsigned long num_regs, bytes_per_reg = (_prom->encode_phys_size*2)/8;
@@ -602,16 +599,15 @@ static void __init prom_initialize_lmb(void)
 	if (_systemcfg->platform == PLATFORM_POWERMAC)
 		bytes_per_reg = 12;
 
-        for (node = 0; prom_next_node(&node); ) {
-                type[0] = 0;
-                call_prom(RELOC("getprop"), 4, 1, node, RELOC("device_type"),
-                          type, sizeof(type));
+	for (node = 0; prom_next_node(&node); ) {
+		type[0] = 0;
+		prom_getprop(node, "device_type", type, sizeof(type));
 
-                if (strcmp(type, RELOC("memory")))
+		if (strcmp(type, RELOC("memory")))
 			continue;
 
-		num_regs = call_prom(RELOC("getprop"), 4, 1, node, RELOC("reg"),
-			&reg, sizeof(reg)) / bytes_per_reg;
+		num_regs = prom_getprop(node, "reg", &reg, sizeof(reg))
+			/ bytes_per_reg;
 
 		for (i=0; i < num_regs ;i++) {
 			if (_systemcfg->platform == PLATFORM_POWERMAC) {
@@ -636,7 +632,7 @@ static void __init prom_initialize_lmb(void)
 			}
 
 			if (lmb_add(lmb_base, lmb_size) < 0)
-				prom_print(RELOC("Too many LMB's, discarding this one...\n"));
+				prom_printf("Too many LMB's, discarding this one...\n");
 		}
 
 	}
@@ -655,33 +651,26 @@ prom_instantiate_rtas(void)
 	struct rtas_t *_rtas = PTRRELOC(&rtas);
 	struct systemcfg *_systemcfg = RELOC(systemcfg);
 	ihandle prom_rtas;
-        u32 getprop_rval;
+	u32 getprop_rval;
 	char hypertas_funcs[4];
 
-#ifdef DEBUG_PROM
-	prom_print(RELOC("prom_instantiate_rtas: start...\n"));
-#endif
-	prom_rtas = (ihandle)call_prom(RELOC("finddevice"), 1, 1, RELOC("/rtas"));
+	prom_debug("prom_instantiate_rtas: start...\n");
+
+	prom_rtas = call_prom("finddevice", 1, 1, ADDR("/rtas"));
 	if (prom_rtas != (ihandle) -1) {
 		unsigned long x;
-		x = call_prom(RELOC("getprop"),
-				  4, 1, prom_rtas,
-				  RELOC("ibm,hypertas-functions"), 
-				  hypertas_funcs, 
-			      sizeof(hypertas_funcs));
+		x = prom_getprop(prom_rtas, "ibm,hypertas-functions",
+				 hypertas_funcs, sizeof(hypertas_funcs));
 
 		if (x != PROM_ERROR) {
-			prom_print(RELOC("Hypertas detected, assuming LPAR !\n"));
+			prom_printf("Hypertas detected, assuming LPAR !\n");
 			_systemcfg->platform = PLATFORM_PSERIES_LPAR;
 		}
 
-		call_prom(RELOC("getprop"), 
-			  4, 1, prom_rtas,
-			  RELOC("rtas-size"), 
-			  &getprop_rval, 
-			  sizeof(getprop_rval));
-	        _rtas->size = getprop_rval;
-		prom_print(RELOC("instantiating rtas"));
+		prom_getprop(prom_rtas, "rtas-size",
+			     &getprop_rval, sizeof(getprop_rval));
+		_rtas->size = getprop_rval;
+		prom_printf("instantiating rtas");
 		if (_rtas->size != 0) {
 			unsigned long rtas_region = RTAS_INSTANTIATE_MAX;
 
@@ -696,17 +685,15 @@ prom_instantiate_rtas(void)
 
 			_rtas->base = lmb_alloc_base(_rtas->size, PAGE_SIZE, rtas_region);
 
-			prom_print(RELOC(" at 0x"));
-			prom_print_hex(_rtas->base);
+			prom_printf(" at 0x%x", _rtas->base);
 
-			prom_rtas = (ihandle)call_prom(RELOC("open"), 
-					      	1, 1, RELOC("/rtas"));
-			prom_print(RELOC("..."));
+			prom_rtas = call_prom("open", 1, 1, ADDR("/rtas"));
+			prom_printf("...");
 
-			if (call_prom(RELOC("call-method"), 3, 2,
-						      RELOC("instantiate-rtas"),
-						      prom_rtas,
-						      _rtas->base) != PROM_ERROR) {
+			if (call_prom("call-method", 3, 2,
+				      ADDR("instantiate-rtas"),
+				      prom_rtas,
+				      _rtas->base) != PROM_ERROR) {
 				_rtas->entry = (long)_prom->args.rets[1];
 			}
 			RELOC(rtas_rmo_buf)
@@ -715,26 +702,16 @@ prom_instantiate_rtas(void)
 		}
 
 		if (_rtas->entry <= 0) {
-			prom_print(RELOC(" failed\n"));
+			prom_printf(" failed\n");
 		} else {
-			prom_print(RELOC(" done\n"));
+			prom_printf(" done\n");
 		}
 
-#ifdef DEBUG_PROM
-        	prom_print(RELOC("rtas->base                 = 0x"));
-        	prom_print_hex(_rtas->base);
-        	prom_print_nl();
-        	prom_print(RELOC("rtas->entry                = 0x"));
-        	prom_print_hex(_rtas->entry);
-        	prom_print_nl();
-        	prom_print(RELOC("rtas->size                 = 0x"));
-        	prom_print_hex(_rtas->size);
-        	prom_print_nl();
-#endif
+		prom_debug("rtas->base		= 0x%x\n", _rtas->base);
+		prom_debug("rtas->entry	       = 0x%x\n", _rtas->entry);
+		prom_debug("rtas->size		= 0x%x\n", _rtas->size);
 	}
-#ifdef DEBUG_PROM
-	prom_print(RELOC("prom_instantiate_rtas: end...\n"));
-#endif
+	prom_debug("prom_instantiate_rtas: end...\n");
 }
 
 
@@ -759,9 +736,7 @@ static void __init prom_initialize_dart_table(void)
 	RELOC(dart_tablebase) = (unsigned long)
 		abs_to_virt(lmb_alloc_base(1UL<<24, 1UL<<24, 0x80000000L));
 
-	prom_print(RELOC("Dart at: "));
-	prom_print_hex(RELOC(dart_tablebase));
-	prom_print(RELOC("\n"));
+	prom_printf("Dart at: %x\n", RELOC(dart_tablebase));
 }
 #endif /* CONFIG_PMAC_DART */
 
@@ -769,7 +744,7 @@ static void __init prom_initialize_tce_table(void)
 {
 	phandle node;
 	ihandle phb_node;
-        unsigned long offset = reloc_offset();
+	unsigned long offset = reloc_offset();
 	char compatible[64], path[64], type[64], model[64];
 	unsigned long i, table = 0;
 	unsigned long base, vbase, align;
@@ -780,33 +755,29 @@ static void __init prom_initialize_tce_table(void)
 	if (RELOC(ppc64_iommu_off))
 		return;
 
-#ifdef DEBUG_PROM
-	prom_print(RELOC("starting prom_initialize_tce_table\n"));
-#endif
+	prom_debug("starting prom_initialize_tce_table\n");
 
 	/* Search all nodes looking for PHBs. */
 	for (node = 0; prom_next_node(&node); ) {
 		if (table == MAX_PHB) {
-			prom_print(RELOC("WARNING: PCI host bridge ignored, "
-				         "need to increase MAX_PHB\n"));
+			prom_printf("WARNING: PCI host bridge ignored, "
+				    "need to increase MAX_PHB\n");
 			continue;
 		}
 
 		compatible[0] = 0;
 		type[0] = 0;
 		model[0] = 0;
-		call_prom(RELOC("getprop"), 4, 1, node, RELOC("compatible"),
-			  compatible, sizeof(compatible));
-		call_prom(RELOC("getprop"), 4, 1, node, RELOC("device_type"),
-			  type, sizeof(type));
-		call_prom(RELOC("getprop"), 4, 1, node, RELOC("model"),
-			  model, sizeof(model));
+		prom_getprop(node, "compatible",
+			     compatible, sizeof(compatible));
+		prom_getprop(node, "device_type", type, sizeof(type));
+		prom_getprop(node, "model", model, sizeof(model));
 
 		/* Keep the old logic in tack to avoid regression. */
 		if (compatible[0] != 0) {
-			if((strstr(compatible, RELOC("python")) == NULL) &&
-			   (strstr(compatible, RELOC("Speedwagon")) == NULL) &&
-			   (strstr(compatible, RELOC("Winnipeg")) == NULL))
+			if ((strstr(compatible, RELOC("python")) == NULL) &&
+			    (strstr(compatible, RELOC("Speedwagon")) == NULL) &&
+			    (strstr(compatible, RELOC("Winnipeg")) == NULL))
 				continue;
 		} else if (model[0] != 0) {
 			if ((strstr(model, RELOC("ython")) == NULL) &&
@@ -819,15 +790,13 @@ static void __init prom_initialize_tce_table(void)
 			continue;
 		}
 
-		if (call_prom(RELOC("getprop"), 4, 1, node, 
-			     RELOC("tce-table-minalign"), &minalign, 
-			     sizeof(minalign)) == PROM_ERROR) {
+		if (prom_getprop(node, "tce-table-minalign", &minalign,
+				 sizeof(minalign)) == PROM_ERROR) {
 			minalign = 0;
 		}
 
-		if (call_prom(RELOC("getprop"), 4, 1, node, 
-			     RELOC("tce-table-minsize"), &minsize, 
-			     sizeof(minsize)) == PROM_ERROR) {
+		if (prom_getprop(node, "tce-table-minsize", &minsize,
+				 sizeof(minsize)) == PROM_ERROR) {
 			minsize = 4UL << 20;
 		}
 
@@ -854,7 +823,7 @@ static void __init prom_initialize_tce_table(void)
 		base = lmb_alloc(minsize, align);
 
 		if ( !base ) {
-			prom_panic(RELOC("ERROR, cannot find space for TCE table.\n"));
+			prom_panic("ERROR, cannot find space for TCE table.\n");
 		}
 
 		vbase = (unsigned long)abs_to_virt(base);
@@ -864,23 +833,10 @@ static void __init prom_initialize_tce_table(void)
 		prom_tce_table[table].base = vbase;
 		prom_tce_table[table].size = minsize;
 
-#ifdef DEBUG_PROM
-		prom_print(RELOC("TCE table: 0x"));
-		prom_print_hex(table);
-		prom_print_nl();
-
-		prom_print(RELOC("\tnode = 0x"));
-		prom_print_hex(node);
-		prom_print_nl();
-
-		prom_print(RELOC("\tbase = 0x"));
-		prom_print_hex(vbase);
-		prom_print_nl();
-
-		prom_print(RELOC("\tsize = 0x"));
-		prom_print_hex(minsize);
-		prom_print_nl();
-#endif
+		prom_debug("TCE table: 0x%x\n", table);
+		prom_debug("\tnode = 0x%x\n", node);
+		prom_debug("\tbase = 0x%x\n", vbase);
+		prom_debug("\tsize = 0x%x\n", minsize);
 
 		/* Initialize the table to have a one-to-one mapping
 		 * over the allocated size.
@@ -895,37 +851,30 @@ static void __init prom_initialize_tce_table(void)
 		/* It seems OF doesn't null-terminate the path :-( */
 		memset(path, 0, sizeof(path));
 		/* Call OF to setup the TCE hardware */
-		if (call_prom(RELOC("package-to-path"), 3, 1, node,
-                             path, sizeof(path)-1) == PROM_ERROR) {
-                        prom_print(RELOC("package-to-path failed\n"));
-                } else {
-                        prom_print(RELOC("opening PHB "));
-                        prom_print(path);
-                }
-
-                phb_node = (ihandle)call_prom(RELOC("open"), 1, 1, path);
-                if ( (long)phb_node <= 0) {
-                        prom_print(RELOC("... failed\n"));
-                } else {
-                        prom_print(RELOC("... done\n"));
-                }
-                call_prom(RELOC("call-method"), 6, 0,
-                             RELOC("set-64-bit-addressing"),
-			     phb_node,
-			     -1,
-                             minsize, 
-                             base & 0xffffffff,
-                             (base >> 32) & 0xffffffff);
-                call_prom(RELOC("close"), 1, 0, phb_node);
+		if (call_prom("package-to-path", 3, 1, node,
+			      path, sizeof(path)-1) == PROM_ERROR) {
+			prom_printf("package-to-path failed\n");
+		} else {
+			prom_printf("opening PHB %s", path);
+		}
+
+		phb_node = call_prom("open", 1, 1, path);
+		if ( (long)phb_node <= 0) {
+			prom_printf("... failed\n");
+		} else {
+			prom_printf("... done\n");
+		}
+		call_prom("call-method", 6, 0, ADDR("set-64-bit-addressing"),
+			  phb_node, -1, minsize,
+			  (u32) base, (u32) (base >> 32));
+		call_prom("close", 1, 0, phb_node);
 
 		table++;
 	}
 
 	/* Flag the first invalid entry */
 	prom_tce_table[table].node = 0;
-#ifdef DEBUG_PROM
-	prom_print(RELOC("ending prom_initialize_tce_table\n"));
-#endif
+	prom_debug("ending prom_initialize_tce_table\n");
 }
 
 /*
@@ -961,16 +910,16 @@ static void __init prom_hold_cpus(unsigned long mem)
 	unsigned int cpu_threads, hw_cpu_num;
 	int propsize;
 	extern void __secondary_hold(void);
-        extern unsigned long __secondary_hold_spinloop;
-        extern unsigned long __secondary_hold_acknowledge;
-        unsigned long *spinloop
+	extern unsigned long __secondary_hold_spinloop;
+	extern unsigned long __secondary_hold_acknowledge;
+	unsigned long *spinloop
 		= (void *)virt_to_abs(&__secondary_hold_spinloop);
-        unsigned long *acknowledge
+	unsigned long *acknowledge
 		= (void *)virt_to_abs(&__secondary_hold_acknowledge);
-        unsigned long secondary_hold
+	unsigned long secondary_hold
 		= virt_to_abs(*PTRRELOC((unsigned long *)__secondary_hold));
-        struct systemcfg *_systemcfg = RELOC(systemcfg);
-	struct paca_struct *_xPaca = PTRRELOC(&paca[0]);
+	struct systemcfg *_systemcfg = RELOC(systemcfg);
+	struct paca_struct *lpaca = PTRRELOC(&paca[0]);
 	struct prom_t *_prom = PTRRELOC(&prom);
 #ifdef CONFIG_SMP
 	struct naca_struct *_naca = RELOC(naca);
@@ -983,14 +932,12 @@ static void __init prom_hold_cpus(unsigned long mem)
 	if (_systemcfg->platform == PLATFORM_POWERMAC) {
 		for (node = 0; prom_next_node(&node); ) {
 			type[0] = 0;
-			call_prom(RELOC("getprop"), 4, 1, node, RELOC("device_type"),
-				  type, sizeof(type));
+			prom_getprop(node, "device_type", type, sizeof(type));
 			if (strcmp(type, RELOC("cpu")) != 0)
 				continue;
 			reg = -1;
-			call_prom(RELOC("getprop"), 4, 1, node, RELOC("reg"),
-				  &reg, sizeof(reg));
-			_xPaca[cpuid].xHwProcNum = reg;
+			prom_getprop(node, "reg", &reg, sizeof(reg));
+			lpaca[cpuid].hw_cpu_id = reg;
 
 #ifdef CONFIG_SMP
 			cpu_set(cpuid, RELOC(cpu_available_map));
@@ -1007,31 +954,20 @@ static void __init prom_hold_cpus(unsigned long mem)
 	/* Initially, we must have one active CPU. */
 	_systemcfg->processorCount = 1;
 
-#ifdef DEBUG_PROM
-	prom_print(RELOC("prom_hold_cpus: start...\n"));
-	prom_print(RELOC("    1) spinloop       = 0x"));
-	prom_print_hex((unsigned long)spinloop);
-	prom_print_nl();
-	prom_print(RELOC("    1) *spinloop      = 0x"));
-	prom_print_hex(*spinloop);
-	prom_print_nl();
-	prom_print(RELOC("    1) acknowledge    = 0x"));
-	prom_print_hex((unsigned long)acknowledge);
-	prom_print_nl();
-	prom_print(RELOC("    1) *acknowledge   = 0x"));
-	prom_print_hex(*acknowledge);
-	prom_print_nl();
-	prom_print(RELOC("    1) secondary_hold = 0x"));
-	prom_print_hex(secondary_hold);
-	prom_print_nl();
-#endif
+	prom_debug("prom_hold_cpus: start...\n");
+	prom_debug("    1) spinloop       = 0x%x\n", (unsigned long)spinloop);
+	prom_debug("    1) *spinloop      = 0x%x\n", *spinloop);
+	prom_debug("    1) acknowledge    = 0x%x\n",
+		   (unsigned long)acknowledge);
+	prom_debug("    1) *acknowledge   = 0x%x\n", *acknowledge);
+	prom_debug("    1) secondary_hold = 0x%x\n", secondary_hold);
 
-        /* Set the common spinloop variable, so all of the secondary cpus
+	/* Set the common spinloop variable, so all of the secondary cpus
 	 * will block when they are awakened from their OF spinloop.
 	 * This must occur for both SMP and non SMP kernels, since OF will
 	 * be trashed when we move the kernel.
-         */
-        *spinloop = 0;
+	 */
+	*spinloop = 0;
 
 #ifdef CONFIG_HMT
 	for (i=0; i < NR_CPUS; i++) {
@@ -1041,37 +977,27 @@ static void __init prom_hold_cpus(unsigned long mem)
 	/* look for cpus */
 	for (node = 0; prom_next_node(&node); ) {
 		type[0] = 0;
-		call_prom(RELOC("getprop"), 4, 1, node, RELOC("device_type"),
-			  type, sizeof(type));
+		prom_getprop(node, "device_type", type, sizeof(type));
 		if (strcmp(type, RELOC("cpu")) != 0)
 			continue;
 
 		/* Skip non-configured cpus. */
-		call_prom(RELOC("getprop"), 4, 1, node, RELOC("status"),
-			  type, sizeof(type));
+		prom_getprop(node, "status", type, sizeof(type));
 		if (strcmp(type, RELOC("okay")) != 0)
 			continue;
 
-                reg = -1;
-		call_prom(RELOC("getprop"), 4, 1, node, RELOC("reg"),
-			  &reg, sizeof(reg));
+		reg = -1;
+		prom_getprop(node, "reg", &reg, sizeof(reg));
 
 		path = (char *) mem;
 		memset(path, 0, 256);
-		if ((long) call_prom(RELOC("package-to-path"), 3, 1,
-				     node, path, 255) == PROM_ERROR)
+		if (call_prom("package-to-path", 3, 1,
+			      node, path, 255) == PROM_ERROR)
 			continue;
 
-#ifdef DEBUG_PROM
-		prom_print_nl();
-		prom_print(RELOC("cpuid        = 0x"));
-		prom_print_hex(cpuid);
-		prom_print_nl();
-		prom_print(RELOC("cpu hw idx   = 0x"));
-		prom_print_hex(reg);
-		prom_print_nl();
-#endif
-		_xPaca[cpuid].xHwProcNum = reg;
+		prom_debug("\ncpuid        = 0x%x\n", cpuid);
+		prom_debug("cpu hw idx   = 0x%x\n", reg);
+		lpaca[cpuid].hw_cpu_id = reg;
 
 		/* Init the acknowledge var which will be reset by
 		 * the secondary cpu when it awakens from its OF
@@ -1079,10 +1005,9 @@ static void __init prom_hold_cpus(unsigned long mem)
 		 */
 		*acknowledge = (unsigned long)-1;
 
-		propsize = call_prom(RELOC("getprop"), 4, 1, node,
-				     RELOC("ibm,ppc-interrupt-server#s"), 
-				     &interrupt_server, 
-				     sizeof(interrupt_server));
+		propsize = prom_getprop(node, "ibm,ppc-interrupt-server#s",
+					&interrupt_server,
+					sizeof(interrupt_server));
 		if (propsize < 0) {
 			/* no property.  old hardware has no SMT */
 			cpu_threads = 1;
@@ -1091,11 +1016,9 @@ static void __init prom_hold_cpus(unsigned long mem)
 			/* We have a threaded processor */
 			cpu_threads = propsize / sizeof(u32);
 			if (cpu_threads > MAX_CPU_THREADS) {
-				prom_print(RELOC("SMT: too many threads!\nSMT: found "));
-				prom_print_hex(cpu_threads);
-				prom_print(RELOC(", max is "));
-				prom_print_hex(MAX_CPU_THREADS);
-				prom_print_nl();
+				prom_printf("SMT: too many threads!\n"
+					    "SMT: found %x, max is %x\n",
+					    cpu_threads, MAX_CPU_THREADS);
 				cpu_threads = 1; /* ToDo: panic? */
 			}
 		}
@@ -1103,18 +1026,15 @@ static void __init prom_hold_cpus(unsigned long mem)
 		hw_cpu_num = interrupt_server[0];
 		if (hw_cpu_num != _prom->cpu) {
 			/* Primary Thread of non-boot cpu */
-			prom_print_hex(cpuid);
-			prom_print(RELOC(" : starting cpu "));
-			prom_print(path);
-			prom_print(RELOC("... "));
-			call_prom(RELOC("start-cpu"), 3, 0, node, 
+			prom_printf("%x : starting cpu %s... ", cpuid, path);
+			call_prom("start-cpu", 3, 0, node,
 				  secondary_hold, cpuid);
 
 			for ( i = 0 ; (i < 100000000) && 
 			      (*acknowledge == ((unsigned long)-1)); i++ ) ;
 
 			if (*acknowledge == cpuid) {
-				prom_print(RELOC("... done\n"));
+				prom_printf("... done\n");
 				/* We have to get every CPU out of OF,
 				 * even if we never start it. */
 				if (cpuid >= NR_CPUS)
@@ -1127,17 +1047,12 @@ static void __init prom_hold_cpus(unsigned long mem)
 				cpu_set(cpuid, RELOC(cpu_present_at_boot));
 #endif
 			} else {
-				prom_print(RELOC("... failed: "));
-				prom_print_hex(*acknowledge);
-				prom_print_nl();
+				prom_printf("... failed: %x\n", *acknowledge);
 			}
 		}
 #ifdef CONFIG_SMP
 		else {
-			prom_print_hex(cpuid);
-			prom_print(RELOC(" : booting  cpu "));
-			prom_print(path);
-			prom_print_nl();
+			prom_printf("%x : booting  cpu %s\n", cpuid, path);
 			cpu_set(cpuid, RELOC(cpu_available_map));
 			cpu_set(cpuid, RELOC(cpu_possible_map));
 			cpu_set(cpuid, RELOC(cpu_online_map));
@@ -1151,17 +1066,16 @@ next:
 			cpuid++;
 			if (cpuid >= NR_CPUS)
 				continue;
-			_xPaca[cpuid].xHwProcNum = interrupt_server[i];
-			prom_print_hex(interrupt_server[i]);
-			prom_print(RELOC(" : preparing thread ... "));
+			lpaca[cpuid].hw_cpu_id = interrupt_server[i];
+			prom_printf("%x : preparing thread ... ",
+				    interrupt_server[i]);
 			if (_naca->smt_state) {
 				cpu_set(cpuid, RELOC(cpu_available_map));
 				cpu_set(cpuid, RELOC(cpu_present_at_boot));
-				prom_print(RELOC("available"));
+				prom_printf("available\n");
 			} else {
-				prom_print(RELOC("not available"));
+				prom_printf("not available\n");
 			}
-			prom_print_nl();
 		}
 #endif
 		cpuid++;
@@ -1171,7 +1085,7 @@ next:
 	if (__is_processor(PV_PULSAR) || 
 	    __is_processor(PV_ICESTAR) ||
 	    __is_processor(PV_SSTAR)) {
-		prom_print(RELOC("    starting secondary threads\n"));
+		prom_printf("    starting secondary threads\n");
 
 		for (i = 0; i < NR_CPUS; i += 2) {
 			if (!cpu_online(i))
@@ -1192,27 +1106,25 @@ next:
 		}
 		_systemcfg->processorCount *= 2;
 	} else {
-		prom_print(RELOC("Processor is not HMT capable\n"));
+		prom_printf("Processor is not HMT capable\n");
 	}
 #endif
 
-	if (cpuid >= NR_CPUS)
-		prom_print(RELOC("WARNING: maximum CPUs (" __stringify(NR_CPUS)
-				 ") exceeded: ignoring extras\n"));
+	if (cpuid > NR_CPUS)
+		prom_printf("WARNING: maximum CPUs (" __stringify(NR_CPUS)
+			    ") exceeded: ignoring extras\n");
 
-#ifdef DEBUG_PROM
-	prom_print(RELOC("prom_hold_cpus: end...\n"));
-#endif
+	prom_debug("prom_hold_cpus: end...\n");
 }
 
 static void __init smt_setup(void)
 {
 	char *p, *q;
 	char my_smt_enabled = SMT_DYNAMIC;
-	ihandle prom_options = NULL;
+	ihandle prom_options = 0;
 	char option[9];
 	unsigned long offset = reloc_offset();
-        struct naca_struct *_naca = RELOC(naca);
+	struct naca_struct *_naca = RELOC(naca);
 	char found = 0;
 
 	if (strstr(RELOC(cmd_line), RELOC("smt-enabled="))) {
@@ -1233,13 +1145,10 @@ static void __init smt_setup(void)
 		}
 	}
 	if (!found) {
-		prom_options = (ihandle)call_prom(RELOC("finddevice"), 1, 1, RELOC("/options"));
+		prom_options = call_prom("finddevice", 1, 1, ADDR("/options"));
 		if (prom_options != (ihandle) -1) {
-			call_prom(RELOC("getprop"), 
-				4, 1, prom_options,
-				RELOC("ibm,smt-enabled"), 
-				option, 
-				sizeof(option));
+			prom_getprop(prom_options, "ibm,smt-enabled",
+				     option, sizeof(option));
 			if (option[0] != 0) {
 				found = 1;
 				if (!strcmp(option, RELOC("off")))
@@ -1272,43 +1181,29 @@ static void __init setup_disp_fake_bi(ihandle dp)
 	int i, naddrs;
 	char name[64];
 	unsigned long offset = reloc_offset();
-	char *getprop = RELOC("getprop");
-
-	prom_print(RELOC("Initializing fake screen: "));
 
 	memset(name, 0, sizeof(name));
-	call_prom(getprop, 4, 1, dp, RELOC("name"), name, sizeof(name));
+	prom_getprop(dp, "name", name, sizeof(name));
 	name[sizeof(name)-1] = 0;
-	prom_print(name);
-	prom_print(RELOC("\n"));
-	call_prom(getprop, 4, 1, dp, RELOC("width"), &width, sizeof(width));
-	call_prom(getprop, 4, 1, dp, RELOC("height"), &height, sizeof(height));
-	call_prom(getprop, 4, 1, dp, RELOC("depth"), &depth, sizeof(depth));
+	prom_printf("Initializing fake screen: %s\n", name);
+
+	prom_getprop(dp, "width", &width, sizeof(width));
+	prom_getprop(dp, "height", &height, sizeof(height));
+	prom_getprop(dp, "depth", &depth, sizeof(depth));
 	pitch = width * ((depth + 7) / 8);
-	call_prom(getprop, 4, 1, dp, RELOC("linebytes"),
-		  &pitch, sizeof(pitch));
+	prom_getprop(dp, "linebytes", &pitch, sizeof(pitch));
 	if (pitch == 1)
 		pitch = 0x1000;		/* for strange IBM display */
 	address = 0;
 
-	prom_print(RELOC("width "));
-	prom_print_hex(width);
-	prom_print(RELOC(" height "));
-	prom_print_hex(height);
-	prom_print(RELOC(" depth "));
-	prom_print_hex(depth);
-	prom_print(RELOC(" linebytes "));
-	prom_print_hex(pitch);
-	prom_print(RELOC("\n"));
-
+	prom_printf("width %x height %x depth %x linebytes %x\n",
+		    width, height, depth, depth);
 
-	call_prom(getprop, 4, 1, dp, RELOC("address"),
-		  &address, sizeof(address));
+	prom_getprop(dp, "address", &address, sizeof(address));
 	if (address == 0) {
 		/* look for an assigned address with a size of >= 1MB */
-		naddrs = (int) call_prom(getprop, 4, 1, dp,
-				RELOC("assigned-addresses"),
-				addrs, sizeof(addrs));
+		naddrs = prom_getprop(dp, "assigned-addresses",
+				      addrs, sizeof(addrs));
 		naddrs /= sizeof(struct pci_reg_property);
 		for (i = 0; i < naddrs; ++i) {
 			if (addrs[i].size_lo >= (1 << 20)) {
@@ -1320,14 +1215,12 @@ static void __init setup_disp_fake_bi(ihandle dp)
 			}
 		}
 		if (address == 0) {
-			prom_print(RELOC("Failed to get address of frame buffer\n"));
+			prom_printf("Failed to get address of frame buffer\n");
 			return;
 		}
 	}
 	btext_setup_display(width, height, depth, pitch, address);
-	prom_print(RELOC("Addr of fb: "));
-	prom_print_hex(address);
-	prom_print_nl();
+	prom_printf("Addr of fb: %x\n", address);
 	RELOC(boot_text_mapped) = 0;
 }
 #endif /* CONFIG_BOOTX_TEXT */
@@ -1344,15 +1237,14 @@ static void __init prom_init_client_services(unsigned long pp)
 	_prom->encode_phys_size = 32;
 
 	/* get a handle for the stdout device */
-	_prom->chosen = (ihandle)call_prom(RELOC("finddevice"), 1, 1,
-				       RELOC("/chosen"));
+	_prom->chosen = call_prom("finddevice", 1, 1, ADDR("/chosen"));
 	if ((long)_prom->chosen <= 0)
-		prom_panic(RELOC("cannot find chosen")); /* msg won't be printed :( */
+		prom_panic("cannot find chosen"); /* msg won't be printed :( */
 
 	/* get device tree root */
-	_prom->root = (ihandle)call_prom(RELOC("finddevice"), 1, 1, RELOC("/"));
+	_prom->root = call_prom("finddevice", 1, 1, ADDR("/"));
 	if ((long)_prom->root <= 0)
-		prom_panic(RELOC("cannot find device tree root")); /* msg won't be printed :( */
+		prom_panic("cannot find device tree root"); /* msg won't be printed :( */
 }
 
 static void __init prom_init_stdout(void)
@@ -1361,12 +1253,10 @@ static void __init prom_init_stdout(void)
 	struct prom_t *_prom = PTRRELOC(&prom);
 	u32 val;
 
-        if ((long)call_prom(RELOC("getprop"), 4, 1, _prom->chosen,
-			    RELOC("stdout"), &val,
-			    sizeof(val)) <= 0)
-                prom_panic(RELOC("cannot find stdout"));
+	if (prom_getprop(_prom->chosen, "stdout", &val, sizeof(val)) <= 0)
+		prom_panic("cannot find stdout");
 
-        _prom->stdout = (ihandle)(unsigned long)val;
+	_prom->stdout = val;
 }
 
 static int __init prom_find_machine_type(void)
@@ -1376,9 +1266,8 @@ static int __init prom_find_machine_type(void)
 	char compat[256];
 	int len, i = 0;
 
-	len = (int)(long)call_prom(RELOC("getprop"), 4, 1, _prom->root,
-				   RELOC("compatible"),
-				   compat, sizeof(compat)-1);
+	len = prom_getprop(_prom->root, "compatible",
+			   compat, sizeof(compat)-1);
 	if (len > 0) {
 		compat[len] = 0;
 		while (i < len) {
@@ -1400,13 +1289,7 @@ static int __init prom_set_color(ihandle ih, int i, int r, int g, int b)
 {
 	unsigned long offset = reloc_offset();
 
-	return (int)(long)call_prom(RELOC("call-method"), 6, 1,
-		                    RELOC("color!"),
-                                    ih,
-                                    (void *)(long) i,
-                                    (void *)(long) b,
-                                    (void *)(long) g,
-                                    (void *)(long) r );
+	return call_prom("call-method", 6, 1, ADDR("color!"), ih, i, b, g, r);
 }
 
 /*
@@ -1423,7 +1306,7 @@ static unsigned long __init check_display(unsigned long mem)
 	ihandle ih;
 	int i, j;
 	unsigned long offset = reloc_offset();
-        struct prom_t *_prom = PTRRELOC(&prom);
+	struct prom_t *_prom = PTRRELOC(&prom);
 	char type[16], *path;
 	static unsigned char default_colors[] = {
 		0x00, 0x00, 0x00,
@@ -1447,16 +1330,13 @@ static unsigned long __init check_display(unsigned long mem)
 
 	_prom->disp_node = 0;
 
-	prom_print(RELOC("Looking for displays\n"));
-	if (RELOC(of_stdout_device) != 0) {
-		prom_print(RELOC("OF stdout is    : "));
-		prom_print(PTRRELOC(RELOC(of_stdout_device)));
-		prom_print(RELOC("\n"));
-	}
+	prom_printf("Looking for displays\n");
+	if (RELOC(of_stdout_device) != 0)
+		prom_printf("OF stdout is    : %s\n",
+			    PTRRELOC(RELOC(of_stdout_device)));
 	for (node = 0; prom_next_node(&node); ) {
 		type[0] = 0;
-		call_prom(RELOC("getprop"), 4, 1, node, RELOC("device_type"),
-			  type, sizeof(type));
+		prom_getprop(node, "device_type", type, sizeof(type));
 		if (strcmp(type, RELOC("display")) != 0)
 			continue;
 		/* It seems OF doesn't null-terminate the path :-( */
@@ -1467,12 +1347,9 @@ static unsigned long __init check_display(unsigned long mem)
 		 * leave some room at the end of the path for appending extra
 		 * arguments
 		 */
-		if ((long) call_prom(RELOC("package-to-path"), 3, 1,
-				    node, path, 250) < 0)
+		if (call_prom("package-to-path", 3, 1, node, path, 250) < 0)
 			continue;
-		prom_print(RELOC("found display   : "));
-		prom_print(path);
-		prom_print(RELOC("\n"));
+		prom_printf("found display   : %s\n", path);
 		
 		/*
 		 * If this display is the device that OF is using for stdout,
@@ -1489,27 +1366,26 @@ static unsigned long __init check_display(unsigned long mem)
 				RELOC(prom_display_nodes[i])
 					= RELOC(prom_display_nodes[i-1]);
 			}
-			_prom->disp_node = (ihandle)(unsigned long)node;
+			_prom->disp_node = node;
 		}
 		RELOC(prom_display_paths[i]) = PTRUNRELOC(path);
 		RELOC(prom_display_nodes[i]) = node;
 		if (_prom->disp_node == 0)
-			_prom->disp_node = (ihandle)(unsigned long)node;
+			_prom->disp_node = node;
 		if (RELOC(prom_num_displays) >= FB_MAX)
 			break;
 	}
-	prom_print(RELOC("Opening displays...\n"));
+	prom_printf("Opening displays...\n");
 	for (j = RELOC(prom_num_displays) - 1; j >= 0; j--) {
 		path = PTRRELOC(RELOC(prom_display_paths[j]));
-		prom_print(RELOC("opening display : "));
-		prom_print(path);
-		ih = (ihandle)call_prom(RELOC("open"), 1, 1, path);
+		prom_printf("opening display : %s", path);
+		ih = call_prom("open", 1, 1, path);
 		if (ih == (ihandle)0 || ih == (ihandle)-1) {
-			prom_print(RELOC("... failed\n"));
+			prom_printf("... failed\n");
 			continue;
 		}
 
-		prom_print(RELOC("... done\n"));
+		prom_printf("... done\n");
 
 		/* Setup a useable color table when the appropriate
 		 * method is available. Should update this to set-colors */
@@ -1527,7 +1403,7 @@ static unsigned long __init check_display(unsigned long mem)
 				break;
 #endif /* CONFIG_LOGO_LINUX_CLUT224 */
 	}
-	
+
 	return DOUBLEWORD_ALIGN(mem);
 }
 
@@ -1536,19 +1412,19 @@ static void __init *__make_room(unsigned long *mem_start, unsigned long *mem_end
 				unsigned long needed, unsigned long align)
 {
 	void *ret;
-	unsigned long offset = reloc_offset();
 
 	*mem_start = ALIGN(*mem_start, align);
 	if (*mem_start + needed > *mem_end) {
 #ifdef CONFIG_BLK_DEV_INITRD
+		unsigned long offset = reloc_offset();
 		/* FIXME: Apple OF doesn't map unclaimed mem.  If this
 		 * ever happened on G5, we'd need to fix. */
 		unsigned long initrd_len;
 
 		if (*mem_end != RELOC(initrd_start))
-			prom_panic(RELOC("No memory for copy_device_tree"));
+			prom_panic("No memory for copy_device_tree");
 
-		prom_print(RELOC("Huge device_tree: moving initrd\n"));
+		prom_printf("Huge device_tree: moving initrd\n");
 		/* Move by 4M. */
 		initrd_len = RELOC(initrd_end) - RELOC(initrd_start);
 		*mem_end = RELOC(initrd_start) + 4 * 1024 * 1024;
@@ -1557,7 +1433,7 @@ static void __init *__make_room(unsigned long *mem_start, unsigned long *mem_end
 		RELOC(initrd_start) = *mem_end;
 		RELOC(initrd_end) = RELOC(initrd_start) + initrd_len;
 #else
-		prom_panic(RELOC("No memory for copy_device_tree"));
+		prom_panic("No memory for copy_device_tree");
 #endif
 	}
 
@@ -1606,8 +1482,7 @@ inspect_node(phandle node, struct device_node *dad,
 	for (;;) {
 		/* 32 is max len of name including nul. */
 		namep = make_room(mem_start, mem_end, char[32]);
-		if ((long) call_prom(RELOC("nextprop"), 3, 1, node, prev_name,
-				     namep) <= 0) {
+		if (call_prom("nextprop", 3, 1, node, prev_name, namep) <= 0) {
 			/* No more nodes: unwind alloc */
 			*mem_start = (unsigned long)namep;
 			break;
@@ -1619,28 +1494,24 @@ inspect_node(phandle node, struct device_node *dad,
 		pp->name = PTRUNRELOC(namep);
 		prev_name = namep;
 
-		pp->length = call_prom(RELOC("getproplen"), 2, 1, node, namep);
+		pp->length = call_prom("getproplen", 2, 1, node, namep);
 		if (pp->length < 0)
 			continue;
 		if (pp->length > MAX_PROPERTY_LENGTH) {
 			char path[128];
 
-			prom_print(RELOC("WARNING: ignoring large property "));
+			prom_printf("WARNING: ignoring large property ");
 			/* It seems OF doesn't null-terminate the path :-( */
 			memset(path, 0, sizeof(path));
-			if (call_prom(RELOC("package-to-path"), 3, 1, node,
-                            path, sizeof(path)-1) > 0)
-				prom_print(path);
-			prom_print(namep);
-			prom_print(RELOC(" length 0x"));
-			prom_print_hex(pp->length);
-			prom_print_nl();
-
+			if (call_prom("package-to-path", 3, 1, node,
+				      path, sizeof(path)-1) > 0)
+				prom_printf("[%s] ", path);
+			prom_printf("%s length 0x%x\n", namep, pp->length);
 			continue;
 		}
 		valp = __make_room(mem_start, mem_end, pp->length, 1);
 		pp->value = PTRUNRELOC(valp);
-		call_prom(RELOC("getprop"), 4, 1, node, namep,valp,pp->length);
+		call_prom("getprop", 4, 1, node, namep, valp, pp->length);
 		*prev_propp = PTRUNRELOC(pp);
 		prev_propp = &pp->next;
 	}
@@ -1660,19 +1531,19 @@ inspect_node(phandle node, struct device_node *dad,
 	/* Set np->linux_phandle to the value of the ibm,phandle property
 	   if it exists, otherwise to the phandle for this node. */
 	np->linux_phandle = node;
-	if ((int)call_prom(RELOC("getprop"), 4, 1, node, RELOC("ibm,phandle"),
-			   &ibm_phandle, sizeof(ibm_phandle)) > 0)
+	if (prom_getprop(node, "ibm,phandle",
+			 &ibm_phandle, sizeof(ibm_phandle)) > 0)
 		np->linux_phandle = ibm_phandle;
 
 	/* get the node's full name */
 	namep = (char *)*mem_start;
-	l = (long) call_prom(RELOC("package-to-path"), 3, 1, node,
-			     namep, *mem_end - *mem_start);
+	l = call_prom("package-to-path", 3, 1, node,
+		      namep, *mem_end - *mem_start);
 	if (l >= 0) {
 		/* Didn't fit?  Get more room. */
 		if (l+1 > *mem_end - *mem_start) {
 			namep = __make_room(mem_start, mem_end, l+1, 1);
-			call_prom(RELOC("package-to-path"),3,1,node,namep,l);
+			call_prom("package-to-path", 3, 1, node, namep, l);
 		}
 		np->full_name = PTRUNRELOC(namep);
 		namep[l] = '\0';
@@ -1680,11 +1551,11 @@ inspect_node(phandle node, struct device_node *dad,
 	}
 
 	/* do all our children */
-	child = call_prom(RELOC("child"), 1, 1, node);
+	child = call_prom("child", 1, 1, node);
 	while (child != (phandle)0) {
 		inspect_node(child, np, mem_start, mem_end,
 					 allnextpp);
-		child = call_prom(RELOC("peer"), 1, 1, child);
+		child = call_prom("peer", 1, 1, child);
 	}
 }
 
@@ -1706,13 +1577,13 @@ copy_device_tree(unsigned long mem_start)
 		mem_end = RELOC(initrd_start);
 #endif /* CONFIG_BLK_DEV_INITRD */
 
-	root = call_prom(RELOC("peer"), 1, 1, (phandle)0);
+	root = call_prom("peer", 1, 1, (phandle)0);
 	if (root == (phandle)0) {
-		prom_panic(RELOC("couldn't get device tree root\n"));
+		prom_panic("couldn't get device tree root\n");
 	}
 	allnextp = &RELOC(allnodes);
-	inspect_node(root, 0, &mem_start, &mem_end, &allnextp);
-	*allnextp = 0;
+	inspect_node(root, NULL, &mem_start, &mem_end, &allnextp);
+	*allnextp = NULL;
 	return mem_start;
 }
 
@@ -1720,44 +1591,25 @@ copy_device_tree(unsigned long mem_start)
 static struct bi_record * __init prom_bi_rec_verify(struct bi_record *bi_recs)
 {
 	struct bi_record *first, *last;
-#ifdef DEBUG_PROM
-	unsigned long offset = reloc_offset();
 
-  	prom_print(RELOC("birec_verify: r6=0x"));
-  	prom_print_hex((unsigned long)bi_recs);
-  	prom_print_nl();
-	if (bi_recs != NULL) {
-		prom_print(RELOC("  tag=0x"));
-		prom_print_hex(bi_recs->tag);
-		prom_print_nl();
-	}
-#endif /* DEBUG_PROM */
+	prom_debug("birec_verify: r6=0x%x\n", (unsigned long)bi_recs);
+	if (bi_recs != NULL)
+		prom_debug("  tag=0x%x\n", bi_recs->tag);
 
 	if ( bi_recs == NULL || bi_recs->tag != BI_FIRST )
 		return NULL;
 
 	last = (struct bi_record *)(long)bi_recs->data[0];
 
-#ifdef DEBUG_PROM
-  	prom_print(RELOC("  last=0x"));
-  	prom_print_hex((unsigned long)last);
-  	prom_print_nl();
-	if (last != NULL) {
-		prom_print(RELOC("  last_tag=0x"));
-		prom_print_hex(last->tag);
-		prom_print_nl();
-	}
-#endif /* DEBUG_PROM */
+	prom_debug("  last=0x%x\n", (unsigned long)last);
+	if (last != NULL)
+		prom_debug("  last_tag=0x%x\n", last->tag);
 
 	if ( last == NULL || last->tag != BI_LAST )
 		return NULL;
 
 	first = (struct bi_record *)(long)last->data[0];
-#ifdef DEBUG_PROM
-  	prom_print(RELOC("  first=0x"));
-  	prom_print_hex((unsigned long)first);
-  	prom_print_nl();
-#endif /* DEBUG_PROM */
+	prom_debug("  first=0x%x\n", (unsigned long)first);
 
 	if ( first == NULL || first != bi_recs )
 		return NULL;
@@ -1776,11 +1628,7 @@ static void __init prom_bi_rec_reserve(void)
 		for ( rec=_prom->bi_recs;
 		      rec->tag != BI_LAST;
 		      rec=bi_rec_next(rec) ) {
-#ifdef DEBUG_PROM
-			prom_print(RELOC("bi: 0x"));
-			prom_print_hex(rec->tag);
-			prom_print_nl();
-#endif /* DEBUG_PROM */
+			prom_debug("bi: 0x%x\n", rec->tag);
 			switch (rec->tag) {
 #ifdef CONFIG_BLK_DEV_INITRD
 			case BI_INITRD:
@@ -1816,7 +1664,7 @@ prom_init(unsigned long r3, unsigned long r4, unsigned long pp,
 	unsigned long phys;
 	u32 getprop_rval;
 	struct systemcfg *_systemcfg;
-	struct paca_struct *_xPaca = PTRRELOC(&paca[0]);
+	struct paca_struct *lpaca = PTRRELOC(&paca[0]);
 	struct prom_t *_prom = PTRRELOC(&prom);
 
 	/* First zero the BSS -- use memset, some arches don't have
@@ -1833,31 +1681,17 @@ prom_init(unsigned long r3, unsigned long r4, unsigned long pp,
 	/* Init prom stdout device */
 	prom_init_stdout();
 
-#ifdef DEBUG_PROM
-  	prom_print(RELOC("klimit=0x"));
-  	prom_print_hex(RELOC(klimit));
-  	prom_print_nl();
-  	prom_print(RELOC("offset=0x"));
-  	prom_print_hex(offset);
-  	prom_print_nl();
-  	prom_print(RELOC("->mem=0x"));
-  	prom_print_hex(RELOC(klimit) - offset);
-  	prom_print_nl();
-#endif /* DEBUG_PROM */
+	prom_debug("klimit=0x%x\n", RELOC(klimit));
+	prom_debug("offset=0x%x\n", offset);
+	prom_debug("->mem=0x%x\n", RELOC(klimit) - offset);
 
 	/* check out if we have bi_recs */
 	_prom->bi_recs = prom_bi_rec_verify((struct bi_record *)r6);
 	if ( _prom->bi_recs != NULL ) {
 		RELOC(klimit) = PTRUNRELOC((unsigned long)_prom->bi_recs +
 					   _prom->bi_recs->data[1]);
-#ifdef DEBUG_PROM
-		prom_print(RELOC("bi_recs=0x"));
-		prom_print_hex((unsigned long)_prom->bi_recs);
-		prom_print_nl();
-		prom_print(RELOC("new mem=0x"));
-		prom_print_hex(RELOC(klimit) - offset);
-		prom_print_nl();
-#endif /* DEBUG_PROM */
+		prom_debug("bi_recs=0x%x\n", (unsigned long)_prom->bi_recs);
+		prom_debug("new mem=0x%x\n", RELOC(klimit) - offset);
 	}
 
 	/* If we don't have birec's or didn't find them, check for an initrd
@@ -1879,62 +1713,51 @@ prom_init(unsigned long r3, unsigned long r4, unsigned long pp,
 		copy_and_flush(0, KERNELBASE - offset, 0x100, 0);
 
 	/* Start storing things at klimit */
-      	mem = RELOC(klimit) - offset;
+	mem = RELOC(klimit) - offset;
 
 	/* Get the full OF pathname of the stdout device */
 	p = (char *) mem;
 	memset(p, 0, 256);
-	call_prom(RELOC("instance-to-path"), 3, 1, _prom->stdout, p, 255);
+	call_prom("instance-to-path", 3, 1, _prom->stdout, p, 255);
 	RELOC(of_stdout_device) = PTRUNRELOC(p);
 	mem += strlen(p) + 1;
 
 	getprop_rval = 1;
-	call_prom(RELOC("getprop"), 4, 1,
-		  _prom->root, RELOC("#size-cells"),
-		  &getprop_rval, sizeof(getprop_rval));
+	prom_getprop(_prom->root, "#size-cells",
+		     &getprop_rval, sizeof(getprop_rval));
 	_prom->encode_phys_size = (getprop_rval == 1) ? 32 : 64;
 
 	/* Determine which cpu is actually running right _now_ */
-        if ((long)call_prom(RELOC("getprop"), 4, 1, _prom->chosen,
-			    RELOC("cpu"), &getprop_rval,
-			    sizeof(getprop_rval)) <= 0)
-                prom_panic(RELOC("cannot find boot cpu"));
-
-	prom_cpu = (ihandle)(unsigned long)getprop_rval;
-	cpu_pkg = call_prom(RELOC("instance-to-package"), 1, 1, prom_cpu);
-	call_prom(RELOC("getprop"), 4, 1,
-		cpu_pkg, RELOC("reg"),
-		&getprop_rval, sizeof(getprop_rval));
-	_prom->cpu = (int)(unsigned long)getprop_rval;
-	_xPaca[0].xHwProcNum = _prom->cpu;
+	if (prom_getprop(_prom->chosen, "cpu",
+			 &prom_cpu, sizeof(prom_cpu)) <= 0)
+		prom_panic("cannot find boot cpu");
+
+	cpu_pkg = call_prom("instance-to-package", 1, 1, prom_cpu);
+	prom_getprop(cpu_pkg, "reg", &getprop_rval, sizeof(getprop_rval));
+	_prom->cpu = getprop_rval;
+	lpaca[0].hw_cpu_id = _prom->cpu;
 
 	RELOC(boot_cpuid) = 0;
 
-#ifdef DEBUG_PROM
-  	prom_print(RELOC("Booting CPU hw index = 0x"));
-  	prom_print_hex(_prom->cpu);
-  	prom_print_nl();
-#endif
+	prom_debug("Booting CPU hw index = 0x%x\n", _prom->cpu);
 
 	/* Get the boot device and translate it to a full OF pathname. */
 	p = (char *) mem;
-	l = (long) call_prom(RELOC("getprop"), 4, 1, _prom->chosen,
-			    RELOC("bootpath"), p, 1<<20);
+	l = prom_getprop(_prom->chosen, "bootpath", p, 1<<20);
 	if (l > 0) {
 		p[l] = 0;	/* should already be null-terminated */
 		RELOC(bootpath) = PTRUNRELOC(p);
 		mem += l + 1;
 		d = (char *) mem;
 		*d = 0;
-		call_prom(RELOC("canon"), 3, 1, p, d, 1<<20);
+		call_prom("canon", 3, 1, p, d, 1<<20);
 		RELOC(bootdevice) = PTRUNRELOC(d);
 		mem = DOUBLEWORD_ALIGN(mem + strlen(d) + 1);
 	}
 
 	RELOC(cmd_line[0]) = 0;
 	if ((long)_prom->chosen > 0) {
-		call_prom(RELOC("getprop"), 4, 1, _prom->chosen,
-			  RELOC("bootargs"), p, sizeof(cmd_line));
+		prom_getprop(_prom->chosen, "bootargs", p, sizeof(cmd_line));
 		if (p != NULL && p[0] != 0)
 			strlcpy(RELOC(cmd_line), p, sizeof(cmd_line));
 	}
@@ -1950,44 +1773,31 @@ prom_init(unsigned long r3, unsigned long r4, unsigned long pp,
 	if (_systemcfg->platform != PLATFORM_POWERMAC)
 		prom_instantiate_rtas();
 
-        /* Initialize some system info into the Naca early... */
-        prom_initialize_naca();
+	/* Initialize some system info into the Naca early... */
+	prom_initialize_naca();
 
 	smt_setup();
 
-        /* If we are on an SMP machine, then we *MUST* do the
-         * following, regardless of whether we have an SMP
-         * kernel or not.
-         */
+	/* If we are on an SMP machine, then we *MUST* do the
+	 * following, regardless of whether we have an SMP
+	 * kernel or not.
+	 */
 	prom_hold_cpus(mem);
 
-#ifdef DEBUG_PROM
-  	prom_print(RELOC("after basic inits, mem=0x"));
-  	prom_print_hex(mem);
-  	prom_print_nl();
+	prom_debug("after basic inits, mem=0x%x\n", mem);
 #ifdef CONFIG_BLK_DEV_INITRD
-	prom_print(RELOC("initrd_start=0x"));
-	prom_print_hex(RELOC(initrd_start));
-	prom_print_nl();
-	prom_print(RELOC("initrd_end=0x"));
-	prom_print_hex(RELOC(initrd_end));
-	prom_print_nl();
+	prom_debug("initrd_start=0x%x\n", RELOC(initrd_start));
+	prom_debug("initrd_end=0x%x\n", RELOC(initrd_end));
 #endif /* CONFIG_BLK_DEV_INITRD */
-	prom_print(RELOC("copying OF device tree...\n"));
-#endif /* DEBUG_PROM */
+	prom_debug("copying OF device tree...\n");
+
 	mem = copy_device_tree(mem);
 
 	RELOC(klimit) = mem + offset;
 
-#ifdef DEBUG_PROM
-	prom_print(RELOC("new klimit is\n"));
-  	prom_print(RELOC("klimit=0x"));
-  	prom_print_hex(RELOC(klimit));
-	prom_print(RELOC(" ->mem=0x\n"));
-  	prom_print(RELOC("klimit=0x"));
-  	prom_print_hex(mem);
-  	prom_print_nl();
-#endif /* DEBUG_PROM */
+	prom_debug("new klimit is\n");
+	prom_debug("klimit=0x%x\n", RELOC(klimit));
+	prom_debug(" ->mem=0x%x\n", mem);
 
 	lmb_reserve(0, __pa(RELOC(klimit)));
 
@@ -2017,14 +1827,14 @@ prom_init(unsigned long r3, unsigned long r4, unsigned long pp,
 #endif
 
 #ifdef CONFIG_BOOTX_TEXT
-	if(_prom->disp_node) {
-		prom_print(RELOC("Setting up bi display...\n"));
+	if (_prom->disp_node) {
+		prom_printf("Setting up bi display...\n");
 		setup_disp_fake_bi(_prom->disp_node);
 	}
 #endif /* CONFIG_BOOTX_TEXT */
 
-	prom_print(RELOC("Calling quiesce ...\n"));
-	call_prom(RELOC("quiesce"), 0, 0);
+	prom_printf("Calling quiesce ...\n");
+	call_prom("quiesce", 0, 0);
 	phys = KERNELBASE - offset;
 
 #ifdef CONFIG_BLK_DEV_INITRD
@@ -2035,7 +1845,7 @@ prom_init(unsigned long r3, unsigned long r4, unsigned long pp,
 	}
 #endif /* CONFIG_BLK_DEV_INITRD */
 
-	prom_print(RELOC("returning from prom_init\n"));
+	prom_printf("returning from prom_init\n");
 	return phys;
 }
 
@@ -2071,8 +1881,7 @@ intr_parent(struct device_node *p)
  * Find out the size of each entry of the interrupts property
  * for a node.
  */
-static int __devinit
-prom_n_intr_cells(struct device_node *np)
+int __devinit prom_n_intr_cells(struct device_node *np)
 {
 	struct device_node *p;
 	unsigned int *icp;
@@ -2086,7 +1895,7 @@ prom_n_intr_cells(struct device_node *np)
 		    || get_property(p, "interrupt-map", NULL) != NULL) {
 			printk("oops, node %s doesn't have #interrupt-cells\n",
 			       p->full_name);
-		return 1;
+			return 1;
 		}
 	}
 #ifdef DEBUG_IRQ
@@ -2272,7 +2081,7 @@ interpret_pci_props(struct device_node *np, unsigned long mem_start,
 		i = 0;
 		adr = (struct address_range *) mem_start;
 		while ((l -= sizeof(struct pci_reg_property)) >= 0) {
- 			if (!measure_only) {
+			if (!measure_only) {
 				adr[i].space = pci_addrs[i].addr.a_hi;
 				adr[i].address = pci_addrs[i].addr.a_lo;
 				adr[i].size = pci_addrs[i].size_lo;
@@ -2311,7 +2120,7 @@ interpret_dbdma_props(struct device_node *np, unsigned long mem_start,
 		i = 0;
 		adr = (struct address_range *) mem_start;
 		while ((l -= sizeof(struct reg_property32)) >= 0) {
- 			if (!measure_only) {
+			if (!measure_only) {
 				adr[i].space = 2;
 				adr[i].address = rp[i].address + base_address;
 				adr[i].size = rp[i].size;
@@ -2351,7 +2160,7 @@ interpret_macio_props(struct device_node *np, unsigned long mem_start,
 		i = 0;
 		adr = (struct address_range *) mem_start;
 		while ((l -= sizeof(struct reg_property32)) >= 0) {
- 			if (!measure_only) {
+			if (!measure_only) {
 				adr[i].space = 2;
 				adr[i].address = rp[i].address + base_address;
 				adr[i].size = rp[i].size;
@@ -2379,7 +2188,7 @@ interpret_isa_props(struct device_node *np, unsigned long mem_start,
 		i = 0;
 		adr = (struct address_range *) mem_start;
 		while ((l -= sizeof(struct reg_property)) >= 0) {
- 			if (!measure_only) {
+			if (!measure_only) {
 				adr[i].space = rp[i].space;
 				adr[i].address = rp[i].address;
 				adr[i].size = rp[i].size;
@@ -2408,7 +2217,7 @@ interpret_root_props(struct device_node *np, unsigned long mem_start,
 		i = 0;
 		adr = (struct address_range *) mem_start;
 		while ((l -= rpsize) >= 0) {
- 			if (!measure_only) {
+			if (!measure_only) {
 				adr[i].space = 0;
 				adr[i].address = rp[naddrc - 1];
 				adr[i].size = rp[naddrc + nsizec - 1];
@@ -2431,8 +2240,8 @@ finish_node(struct device_node *np, unsigned long mem_start,
 	struct device_node *child;
 	int *ip;
 
-	np->name = get_property(np, "name", 0);
-	np->type = get_property(np, "device_type", 0);
+	np->name = get_property(np, "name", NULL);
+	np->type = get_property(np, "device_type", NULL);
 
 	if (!np->name)
 		np->name = "<NULL>";
@@ -2446,10 +2255,10 @@ finish_node(struct device_node *np, unsigned long mem_start,
 	mem_start = finish_node_interrupts(np, mem_start, measure_only);
 
 	/* Look for #address-cells and #size-cells properties. */
-	ip = (int *) get_property(np, "#address-cells", 0);
+	ip = (int *) get_property(np, "#address-cells", NULL);
 	if (ip != NULL)
 		naddrc = *ip;
-	ip = (int *) get_property(np, "#size-cells", 0);
+	ip = (int *) get_property(np, "#size-cells", NULL);
 	if (ip != NULL)
 		nsizec = *ip;
 
@@ -2457,7 +2266,7 @@ finish_node(struct device_node *np, unsigned long mem_start,
 	 * expect for the name -- Cort
 	 */
 	if (!strcmp(np->name, "display"))
-		np->name = get_property(np, "compatible", 0);
+		np->name = get_property(np, "compatible", NULL);
 
 	if (!strcmp(np->name, "device-tree") || np->parent == NULL)
 		ifunc = interpret_root_props;
@@ -2486,7 +2295,7 @@ finish_node(struct device_node *np, unsigned long mem_start,
 	return mem_start;
 }
 
-/*
+/**
  * finish_device_tree is called once things are running normally
  * (i.e. with text and data mapped to the address they were linked at).
  * It traverses the device tree and fills in the name, type,
@@ -2514,7 +2323,7 @@ prom_n_addr_cells(struct device_node* np)
 	do {
 		if (np->parent)
 			np = np->parent;
-		ip = (int *) get_property(np, "#address-cells", 0);
+		ip = (int *) get_property(np, "#address-cells", NULL);
 		if (ip != NULL)
 			return *ip;
 	} while (np->parent);
@@ -2529,7 +2338,7 @@ prom_n_size_cells(struct device_node* np)
 	do {
 		if (np->parent)
 			np = np->parent;
-		ip = (int *) get_property(np, "#size-cells", 0);
+		ip = (int *) get_property(np, "#size-cells", NULL);
 		if (ip != NULL)
 			return *ip;
 	} while (np->parent);
@@ -2537,7 +2346,7 @@ prom_n_size_cells(struct device_node* np)
 	return 1;
 }
 
-/*
+/**
  * Work out the sense (active-low level / active-high edge)
  * of each interrupt from the device tree.
  */
@@ -2559,7 +2368,7 @@ prom_get_irq_senses(unsigned char *senses, int off, int max)
 	}
 }
 
-/*
+/**
  * Construct and return a list of the device_nodes with a given name.
  */
 struct device_node *
@@ -2574,11 +2383,11 @@ find_devices(const char *name)
 			prevp = &np->next;
 		}
 	}
-	*prevp = 0;
+	*prevp = NULL;
 	return head;
 }
 
-/*
+/**
  * Construct and return a list of the device_nodes with a given type.
  */
 struct device_node *
@@ -2593,11 +2402,11 @@ find_type_devices(const char *type)
 			prevp = &np->next;
 		}
 	}
-	*prevp = 0;
+	*prevp = NULL;
 	return head;
 }
 
-/*
+/**
  * Returns all nodes linked together
  */
 struct device_node *
@@ -2610,11 +2419,11 @@ find_all_nodes(void)
 		*prevp = np;
 		prevp = &np->next;
 	}
-	*prevp = 0;
+	*prevp = NULL;
 	return head;
 }
 
-/* Checks if the given "compat" string matches one of the strings in
+/** Checks if the given "compat" string matches one of the strings in
  * the device's "compatible" property
  */
 int
@@ -2638,7 +2447,7 @@ device_is_compatible(struct device_node *device, const char *compat)
 }
 
 
-/*
+/**
  * Indicates whether the root node has a given value in its
  * compatible property.
  */
@@ -2647,7 +2456,7 @@ machine_is_compatible(const char *compat)
 {
 	struct device_node *root;
 	int rc = 0;
-  
+
 	root = of_find_node_by_path("/");
 	if (root) {
 		rc = device_is_compatible(root, compat);
@@ -2656,7 +2465,7 @@ machine_is_compatible(const char *compat)
 	return rc;
 }
 
-/*
+/**
  * Construct and return a list of the device_nodes with a given type
  * and compatible property.
  */
@@ -2675,11 +2484,11 @@ find_compatible_devices(const char *type, const char *compat)
 			prevp = &np->next;
 		}
 	}
-	*prevp = 0;
+	*prevp = NULL;
 	return head;
 }
 
-/*
+/**
  * Find the device_node with a given full_name.
  */
 struct device_node *
@@ -3094,9 +2903,9 @@ static int of_finish_dynamic_node(struct device_node *node)
 	u32 *regs;
 	int err = 0;
 	phandle *ibm_phandle;
- 
-	node->name = get_property(node, "name", 0);
-	node->type = get_property(node, "device_type", 0);
+
+	node->name = get_property(node, "name", NULL);
+	node->type = get_property(node, "device_type", NULL);
 
 	if (!parent) {
 		err = -ENODEV;
@@ -3142,32 +2951,31 @@ static int of_finish_dynamic_node(struct device_node *node)
 	}
 
 	/* now do the work of finish_node_interrupts */
-	if (get_property(node, "interrupts", 0)) {
+	if (get_property(node, "interrupts", NULL)) {
 		err = of_finish_dynamic_node_interrupts(node);
 		if (err) goto out;
 	}
 
-       /* now do the rough equivalent of update_dn_pci_info, this
-        * probably is not correct for phb's, but should work for
-	* IOAs and slots.
-        */
+	/* now do the rough equivalent of update_dn_pci_info, this
+	 * probably is not correct for phb's, but should work for
+	 * IOAs and slots.
+	 */
 
-       node->phb = parent->phb;
+	node->phb = parent->phb;
 
-       regs = (u32 *)get_property(node, "reg", 0);
-       if (regs) {
-               node->busno = (regs[0] >> 16) & 0xff;
-               node->devfn = (regs[0] >> 8) & 0xff;
-       }
+	regs = (u32 *)get_property(node, "reg", NULL);
+	if (regs) {
+		node->busno = (regs[0] >> 16) & 0xff;
+		node->devfn = (regs[0] >> 8) & 0xff;
+	}
 
 	/* fixing up iommu_table */
 
-	if(strcmp(node->name, "pci") == 0 &&
-                get_property(node, "ibm,dma-window", NULL)) {
-                node->bussubno = node->busno;
-                iommu_devnode_init(node);
-        }
-	else
+	if (strcmp(node->name, "pci") == 0 &&
+	    get_property(node, "ibm,dma-window", NULL)) {
+		node->bussubno = node->busno;
+		iommu_devnode_init(node);
+	} else
 		node->iommu_table = parent->iommu_table;
 
 out:
@@ -3287,7 +3095,7 @@ get_property(struct device_node *np, const char *name, int *lenp)
 				*lenp = pp->length;
 			return pp->value;
 		}
-	return 0;
+	return NULL;
 }
 
 /*
diff --git a/arch/ppc64/kernel/ptrace.c b/arch/ppc64/kernel/ptrace.c
index 5ff2b1c90..9c3d2f55e 100644
--- a/arch/ppc64/kernel/ptrace.c
+++ b/arch/ppc64/kernel/ptrace.c
@@ -121,8 +121,7 @@ int sys_ptrace(long request, long pid, long addr, long data)
 		if (index < PT_FPR0) {
 			tmp = get_reg(child, (int)index);
 		} else {
-			if (child->thread.regs->msr & MSR_FP)
-				giveup_fpu(child);
+			flush_fp_to_thread(child);
 			tmp = ((unsigned long *)child->thread.fpr)[index - PT_FPR0];
 		}
 		ret = put_user(tmp,(unsigned long __user *) data);
@@ -154,8 +153,7 @@ int sys_ptrace(long request, long pid, long addr, long data)
 		if (index < PT_FPR0) {
 			ret = put_reg(child, index, data);
 		} else {
-			if (child->thread.regs->msr & MSR_FP)
-				giveup_fpu(child);
+			flush_fp_to_thread(child);
 			((unsigned long *)child->thread.fpr)[index - PT_FPR0] = data;
 			ret = 0;
 		}
@@ -247,8 +245,7 @@ int sys_ptrace(long request, long pid, long addr, long data)
 		unsigned long *reg = &((unsigned long *)child->thread.fpr)[0];
 		unsigned long __user *tmp = (unsigned long __user *)addr;
 
-		if (child->thread.regs->msr & MSR_FP)
-			giveup_fpu(child);
+		flush_fp_to_thread(child);
 
 		for (i = 0; i < 32; i++) {
 			ret = put_user(*reg, tmp);
@@ -265,8 +262,7 @@ int sys_ptrace(long request, long pid, long addr, long data)
 		unsigned long *reg = &((unsigned long *)child->thread.fpr)[0];
 		unsigned long __user *tmp = (unsigned long __user *)addr;
 
-		if (child->thread.regs->msr & MSR_FP)
-			giveup_fpu(child);
+		flush_fp_to_thread(child);
 
 		for (i = 0; i < 32; i++) {
 			ret = get_user(*reg, tmp);
diff --git a/arch/ppc64/kernel/ptrace32.c b/arch/ppc64/kernel/ptrace32.c
index 309db1c08..e0ab44dc1 100644
--- a/arch/ppc64/kernel/ptrace32.c
+++ b/arch/ppc64/kernel/ptrace32.c
@@ -136,8 +136,7 @@ int sys32_ptrace(long request, long pid, unsigned long addr, unsigned long data)
 		if (index < PT_FPR0) {
 			tmp = get_reg(child, index);
 		} else {
-			if (child->thread.regs->msr & MSR_FP)
-				giveup_fpu(child);
+			flush_fp_to_thread(child);
 			/*
 			 * the user space code considers the floating point
 			 * to be an array of unsigned int (32 bits) - the
@@ -179,8 +178,7 @@ int sys32_ptrace(long request, long pid, unsigned long addr, unsigned long data)
 			break;
 
 		if (numReg >= PT_FPR0) {
-			if (child->thread.regs->msr & MSR_FP)
-				giveup_fpu(child);
+			flush_fp_to_thread(child);
 			tmp = ((unsigned long int *)child->thread.fpr)[numReg - PT_FPR0];
 		} else { /* register within PT_REGS struct */
 			tmp = get_reg(child, numReg);
@@ -244,8 +242,7 @@ int sys32_ptrace(long request, long pid, unsigned long addr, unsigned long data)
 		if (index < PT_FPR0) {
 			ret = put_reg(child, index, data);
 		} else {
-			if (child->thread.regs->msr & MSR_FP)
-				giveup_fpu(child);
+			flush_fp_to_thread(child);
 			/*
 			 * the user space code considers the floating point
 			 * to be an array of unsigned int (32 bits) - the
@@ -283,8 +280,7 @@ int sys32_ptrace(long request, long pid, unsigned long addr, unsigned long data)
 				|| ((numReg > PT_CCR) && (numReg < PT_FPR0)))
 			break;
 		if (numReg >= PT_FPR0) {
-			if (child->thread.regs->msr & MSR_FP)
-				giveup_fpu(child);
+			flush_fp_to_thread(child);
 		}
 		if (numReg == PT_MSR)
 			data = (data & MSR_DEBUGCHANGE)
@@ -379,8 +375,7 @@ int sys32_ptrace(long request, long pid, unsigned long addr, unsigned long data)
 		unsigned long *reg = &((unsigned long *)child->thread.fpr)[0];
 		unsigned int __user *tmp = (unsigned int __user *)addr;
 
-		if (child->thread.regs->msr & MSR_FP)
-			giveup_fpu(child);
+		flush_fp_to_thread(child);
 
 		for (i = 0; i < 32; i++) {
 			ret = put_user(*reg, tmp);
@@ -397,8 +392,7 @@ int sys32_ptrace(long request, long pid, unsigned long addr, unsigned long data)
 		unsigned long *reg = &((unsigned long *)child->thread.fpr)[0];
 		unsigned int __user *tmp = (unsigned int __user *)addr;
 
-		if (child->thread.regs->msr & MSR_FP)
-			giveup_fpu(child);
+		flush_fp_to_thread(child);
 
 		for (i = 0; i < 32; i++) {
 			ret = get_user(*reg, tmp);
@@ -410,7 +404,9 @@ int sys32_ptrace(long request, long pid, unsigned long addr, unsigned long data)
 		break;
 	}
 
-
+       case PTRACE_GETEVENTMSG:
+                ret = put_user(child->ptrace_message, (unsigned int __user *) data);
+                break;
 
 	default:
 		ret = ptrace_request(child, request, addr, data);
diff --git a/arch/ppc64/kernel/ras.c b/arch/ppc64/kernel/ras.c
index c21e797a3..595ae6ec2 100644
--- a/arch/ppc64/kernel/ras.c
+++ b/arch/ppc64/kernel/ras.c
@@ -52,6 +52,16 @@
 #include <asm/rtas.h>
 #include <asm/ppcdebug.h>
 
+static unsigned char ras_log_buf[RTAS_ERROR_LOG_MAX];
+static spinlock_t ras_log_buf_lock = SPIN_LOCK_UNLOCKED;
+
+static int ras_get_sensor_state_token;
+static int ras_check_exception_token;
+
+#define EPOW_SENSOR_TOKEN	9
+#define EPOW_SENSOR_INDEX	0
+#define RAS_VECTOR_OFFSET	0x500
+
 static irqreturn_t ras_epow_interrupt(int irq, void *dev_id,
 					struct pt_regs * regs);
 static irqreturn_t ras_error_interrupt(int irq, void *dev_id,
@@ -59,6 +69,35 @@ static irqreturn_t ras_error_interrupt(int irq, void *dev_id,
 
 /* #define DEBUG */
 
+static void request_ras_irqs(struct device_node *np, char *propname,
+			irqreturn_t (*handler)(int, void *, struct pt_regs *),
+			const char *name)
+{
+	unsigned int *ireg, len, i;
+	int virq, n_intr;
+
+	ireg = (unsigned int *)get_property(np, propname, &len);
+	if (ireg == NULL)
+		return;
+	n_intr = prom_n_intr_cells(np);
+	len /= n_intr * sizeof(*ireg);
+
+	for (i = 0; i < len; i++) {
+		virq = virt_irq_create_mapping(*ireg);
+		if (virq == NO_IRQ) {
+			printk(KERN_ERR "Unable to allocate interrupt "
+			       "number for %s\n", np->full_name);
+			return;
+		}
+		if (request_irq(irq_offset_up(virq), handler, 0, name, NULL)) {
+			printk(KERN_ERR "Unable to request interrupt %d for "
+			       "%s\n", irq_offset_up(virq), np->full_name);
+			return;
+		}
+		ireg += n_intr;
+	}
+}
+
 /*
  * Initialize handlers for the set of interrupts caused by hardware errors
  * and power system events.
@@ -66,52 +105,34 @@ static irqreturn_t ras_error_interrupt(int irq, void *dev_id,
 static int __init init_ras_IRQ(void)
 {
 	struct device_node *np;
-	unsigned int *ireg, len, i;
-	int virq;
-
-	if ((np = of_find_node_by_path("/event-sources/internal-errors")) &&
-	    (ireg = (unsigned int *)get_property(np, "open-pic-interrupt",
-						 &len))) {
-		for (i=0; i<(len / sizeof(*ireg)); i++) {
-			virq = virt_irq_create_mapping(*(ireg));
-			if (virq == NO_IRQ) {
-				printk(KERN_ERR "Unable to allocate interrupt "
-				       "number for %s\n", np->full_name);
-				break;
-			}
-			request_irq(irq_offset_up(virq),
-				    ras_error_interrupt, 0, 
-				    "RAS_ERROR", NULL);
-			ireg++;
-		}
+
+	ras_get_sensor_state_token = rtas_token("get-sensor-state");
+	ras_check_exception_token = rtas_token("check-exception");
+
+	/* Internal Errors */
+	np = of_find_node_by_path("/event-sources/internal-errors");
+	if (np != NULL) {
+		request_ras_irqs(np, "open-pic-interrupt", ras_error_interrupt,
+				 "RAS_ERROR");
+		request_ras_irqs(np, "interrupts", ras_error_interrupt,
+				 "RAS_ERROR");
+		of_node_put(np);
 	}
-	of_node_put(np);
-
-	if ((np = of_find_node_by_path("/event-sources/epow-events")) &&
-	    (ireg = (unsigned int *)get_property(np, "open-pic-interrupt",
-						 &len))) {
-		for (i=0; i<(len / sizeof(*ireg)); i++) {
-			virq = virt_irq_create_mapping(*(ireg));
-			if (virq == NO_IRQ) {
-				printk(KERN_ERR "Unable to allocate interrupt "
-				       " number for %s\n", np->full_name);
-				break;
-			}
-			request_irq(irq_offset_up(virq),
-				    ras_epow_interrupt, 0, 
-				    "RAS_EPOW", NULL);
-			ireg++;
-		}
+
+	/* EPOW Events */
+	np = of_find_node_by_path("/event-sources/epow-events");
+	if (np != NULL) {
+		request_ras_irqs(np, "open-pic-interrupt", ras_epow_interrupt,
+				 "RAS_EPOW");
+		request_ras_irqs(np, "interrupts", ras_epow_interrupt,
+				 "RAS_EPOW");
+		of_node_put(np);
 	}
-	of_node_put(np);
 
 	return 1;
 }
 __initcall(init_ras_IRQ);
 
-static struct rtas_error_log log_buf;
-static spinlock_t log_lock = SPIN_LOCK_UNLOCKED;
-
 /*
  * Handle power subsystem events (EPOW).
  *
@@ -122,30 +143,35 @@ static spinlock_t log_lock = SPIN_LOCK_UNLOCKED;
 static irqreturn_t
 ras_epow_interrupt(int irq, void *dev_id, struct pt_regs * regs)
 {
-	struct rtas_error_log log_entry;
-	unsigned int size = sizeof(log_entry);
-	long status = 0xdeadbeef;
+	int status = 0xdeadbeef;
+	int state = 0;
+	int critical;
 
-	spin_lock(&log_lock);
+	status = rtas_call(ras_get_sensor_state_token, 2, 2, &state,
+			   EPOW_SENSOR_TOKEN, EPOW_SENSOR_INDEX);
 
-	status = rtas_call(rtas_token("check-exception"), 6, 1, NULL, 
-			   0x500, irq, 
-			   RTAS_EPOW_WARNING | RTAS_POWERMGM_EVENTS, 
-			   1,  /* Time Critical */
-			   __pa(&log_buf), size);
+	if (state > 3)
+		critical = 1;  /* Time Critical */
+	else
+		critical = 0;
 
-	log_entry = log_buf;
+	spin_lock(&ras_log_buf_lock);
 
-	spin_unlock(&log_lock);
+	status = rtas_call(ras_check_exception_token, 6, 1, NULL,
+			   RAS_VECTOR_OFFSET,
+			   virt_irq_to_real(irq_offset_down(irq)),
+			   RTAS_EPOW_WARNING | RTAS_POWERMGM_EVENTS,
+			   critical, __pa(&ras_log_buf), RTAS_ERROR_LOG_MAX);
 
-	udbg_printf("EPOW <0x%lx 0x%lx>\n", 
-		    *((unsigned long *)&log_entry), status); 
-	printk(KERN_WARNING 
-		"EPOW <0x%lx 0x%lx>\n",*((unsigned long *)&log_entry), status);
+	udbg_printf("EPOW <0x%lx 0x%x 0x%x>\n",
+		    *((unsigned long *)&ras_log_buf), status, state);
+	printk(KERN_WARNING "EPOW <0x%lx 0x%x 0x%x>\n",
+	       *((unsigned long *)&ras_log_buf), status, state);
 
 	/* format and print the extended information */
-	log_error((char *)&log_entry, ERR_TYPE_RTAS_LOG, 0);
-	
+	log_error(ras_log_buf, ERR_TYPE_RTAS_LOG, 0);
+
+	spin_unlock(&ras_log_buf_lock);
 	return IRQ_HANDLED;
 }
 
@@ -160,37 +186,33 @@ ras_epow_interrupt(int irq, void *dev_id, struct pt_regs * regs)
 static irqreturn_t
 ras_error_interrupt(int irq, void *dev_id, struct pt_regs * regs)
 {
-	struct rtas_error_log log_entry;
-	unsigned int size = sizeof(log_entry);
-	long status = 0xdeadbeef;
+	struct rtas_error_log *rtas_elog;
+	int status = 0xdeadbeef;
 	int fatal;
 
-	spin_lock(&log_lock);
+	spin_lock(&ras_log_buf_lock);
 
-	status = rtas_call(rtas_token("check-exception"), 6, 1, NULL, 
-			   0x500, irq, 
-			   RTAS_INTERNAL_ERROR, 
-			   1, /* Time Critical */
-			   __pa(&log_buf), size);
+	status = rtas_call(ras_check_exception_token, 6, 1, NULL,
+			   RAS_VECTOR_OFFSET,
+			   virt_irq_to_real(irq_offset_down(irq)),
+			   RTAS_INTERNAL_ERROR, 1 /*Time Critical */,
+			   __pa(&ras_log_buf), RTAS_ERROR_LOG_MAX);
 
-	log_entry = log_buf;
+	rtas_elog = (struct rtas_error_log *)ras_log_buf;
 
-	spin_unlock(&log_lock);
-
-	if ((status == 0) && (log_entry.severity >= SEVERITY_ERROR_SYNC)) 
+	if ((status == 0) && (rtas_elog->severity >= SEVERITY_ERROR_SYNC))
 		fatal = 1;
 	else
 		fatal = 0;
 
 	/* format and print the extended information */
-	log_error((char *)&log_entry, ERR_TYPE_RTAS_LOG, fatal); 
+	log_error(ras_log_buf, ERR_TYPE_RTAS_LOG, fatal);
 
 	if (fatal) {
-		udbg_printf("HW Error <0x%lx 0x%lx>\n",
-			    *((unsigned long *)&log_entry), status);
-		printk(KERN_EMERG 
-		       "Error: Fatal hardware error <0x%lx 0x%lx>\n",
-		       *((unsigned long *)&log_entry), status);
+		udbg_printf("Fatal HW Error <0x%lx 0x%x>\n",
+			    *((unsigned long *)&ras_log_buf), status);
+		printk(KERN_EMERG "Error: Fatal hardware error <0x%lx 0x%x>\n",
+		       *((unsigned long *)&ras_log_buf), status);
 
 #ifndef DEBUG
 		/* Don't actually power off when debugging so we can test
@@ -200,11 +222,13 @@ ras_error_interrupt(int irq, void *dev_id, struct pt_regs * regs)
 		ppc_md.power_off();
 #endif
 	} else {
-		udbg_printf("Recoverable HW Error <0x%lx 0x%lx>\n",
-			    *((unsigned long *)&log_entry), status); 
-		printk(KERN_WARNING 
-		       "Warning: Recoverable hardware error <0x%lx 0x%lx>\n",
-		       *((unsigned long *)&log_entry), status);
+		udbg_printf("Recoverable HW Error <0x%lx 0x%x>\n",
+			    *((unsigned long *)&ras_log_buf), status);
+		printk(KERN_WARNING
+		       "Warning: Recoverable hardware error <0x%lx 0x%x>\n",
+		       *((unsigned long *)&ras_log_buf), status);
 	}
+
+	spin_unlock(&ras_log_buf_lock);
 	return IRQ_HANDLED;
 }
diff --git a/arch/ppc64/kernel/rtas-proc.c b/arch/ppc64/kernel/rtas-proc.c
index 338f66084..a055759b6 100644
--- a/arch/ppc64/kernel/rtas-proc.c
+++ b/arch/ppc64/kernel/rtas-proc.c
@@ -21,6 +21,7 @@
 #include <linux/time.h>
 #include <linux/string.h>
 #include <linux/init.h>
+#include <linux/seq_file.h>
 
 #include <asm/uaccess.h>
 #include <asm/bitops.h>
@@ -137,66 +138,122 @@ struct rtas_sensors {
 
 /* ****************************************************************** */
 /* Declarations */
-static int ppc_rtas_sensor_read(char * buf, char ** start, off_t off,
-		int count, int *eof, void *data);
-static ssize_t ppc_rtas_clock_read(struct file * file, char * buf, 
-		size_t count, loff_t *ppos);
-static ssize_t ppc_rtas_clock_write(struct file * file, const char * buf, 
-		size_t count, loff_t *ppos);
-static ssize_t ppc_rtas_progress_read(struct file * file, char * buf,
-		size_t count, loff_t *ppos);
-static ssize_t ppc_rtas_progress_write(struct file * file, const char * buf,
-		size_t count, loff_t *ppos);
-static ssize_t ppc_rtas_poweron_read(struct file * file, char * buf,
-		size_t count, loff_t *ppos);
-static ssize_t ppc_rtas_poweron_write(struct file * file, const char * buf,
-		size_t count, loff_t *ppos);
-
-static ssize_t ppc_rtas_tone_freq_write(struct file * file, const char * buf,
-		size_t count, loff_t *ppos);
-static ssize_t ppc_rtas_tone_freq_read(struct file * file, char * buf,
-		size_t count, loff_t *ppos);
-static ssize_t ppc_rtas_tone_volume_write(struct file * file, const char * buf,
-		size_t count, loff_t *ppos);
-static ssize_t ppc_rtas_tone_volume_read(struct file * file, char * buf,
-		size_t count, loff_t *ppos);
-static ssize_t ppc_rtas_rmo_buf_read(struct file *file, char *buf,
-				    size_t count, loff_t *ppos);
+static int ppc_rtas_sensors_show(struct seq_file *m, void *v);
+static int ppc_rtas_clock_show(struct seq_file *m, void *v);
+static ssize_t ppc_rtas_clock_write(struct file *file,
+		const char __user *buf, size_t count, loff_t *ppos);
+static int ppc_rtas_progress_show(struct seq_file *m, void *v);
+static ssize_t ppc_rtas_progress_write(struct file *file,
+		const char __user *buf, size_t count, loff_t *ppos);
+static int ppc_rtas_poweron_show(struct seq_file *m, void *v);
+static ssize_t ppc_rtas_poweron_write(struct file *file,
+		const char __user *buf, size_t count, loff_t *ppos);
+
+static ssize_t ppc_rtas_tone_freq_write(struct file *file,
+		const char __user *buf, size_t count, loff_t *ppos);
+static int ppc_rtas_tone_freq_show(struct seq_file *m, void *v);
+static ssize_t ppc_rtas_tone_volume_write(struct file *file,
+		const char __user *buf, size_t count, loff_t *ppos);
+static int ppc_rtas_tone_volume_show(struct seq_file *m, void *v);
+static int ppc_rtas_rmo_buf_show(struct seq_file *m, void *v);
+
+static int sensors_open(struct inode *inode, struct file *file)
+{
+	return single_open(file, ppc_rtas_sensors_show, NULL);
+}
+
+struct file_operations ppc_rtas_sensors_operations = {
+	.open		= sensors_open,
+	.read		= seq_read,
+	.llseek		= seq_lseek,
+	.release	= single_release,
+};
+
+static int poweron_open(struct inode *inode, struct file *file)
+{
+	return single_open(file, ppc_rtas_poweron_show, NULL);
+}
 
 struct file_operations ppc_rtas_poweron_operations = {
-	.read =		ppc_rtas_poweron_read,
-	.write =	ppc_rtas_poweron_write
+	.open		= poweron_open,
+	.read		= seq_read,
+	.llseek		= seq_lseek,
+	.write		= ppc_rtas_poweron_write,
+	.release	= single_release,
 };
+
+static int progress_open(struct inode *inode, struct file *file)
+{
+	return single_open(file, ppc_rtas_progress_show, NULL);
+}
+
 struct file_operations ppc_rtas_progress_operations = {
-	.read =		ppc_rtas_progress_read,
-	.write =	ppc_rtas_progress_write
+	.open		= progress_open,
+	.read		= seq_read,
+	.llseek		= seq_lseek,
+	.write		= ppc_rtas_progress_write,
+	.release	= single_release,
 };
 
+static int clock_open(struct inode *inode, struct file *file)
+{
+	return single_open(file, ppc_rtas_clock_show, NULL);
+}
+
 struct file_operations ppc_rtas_clock_operations = {
-	.read =		ppc_rtas_clock_read,
-	.write =	ppc_rtas_clock_write
+	.open		= clock_open,
+	.read		= seq_read,
+	.llseek		= seq_lseek,
+	.write		= ppc_rtas_clock_write,
+	.release	= single_release,
 };
 
+static int tone_freq_open(struct inode *inode, struct file *file)
+{
+	return single_open(file, ppc_rtas_tone_freq_show, NULL);
+}
+
 struct file_operations ppc_rtas_tone_freq_operations = {
-	.read =		ppc_rtas_tone_freq_read,
-	.write =	ppc_rtas_tone_freq_write
+	.open		= tone_freq_open,
+	.read		= seq_read,
+	.llseek		= seq_lseek,
+	.write		= ppc_rtas_tone_freq_write,
+	.release	= single_release,
 };
+
+static int tone_volume_open(struct inode *inode, struct file *file)
+{
+	return single_open(file, ppc_rtas_tone_volume_show, NULL);
+}
+
 struct file_operations ppc_rtas_tone_volume_operations = {
-	.read =		ppc_rtas_tone_volume_read,
-	.write =	ppc_rtas_tone_volume_write
+	.open		= tone_volume_open,
+	.read		= seq_read,
+	.llseek		= seq_lseek,
+	.write		= ppc_rtas_tone_volume_write,
+	.release	= single_release,
 };
 
-static struct file_operations ppc_rtas_rmo_buf_ops = {
-	.read =		ppc_rtas_rmo_buf_read,
+static int rmo_buf_open(struct inode *inode, struct file *file)
+{
+	return single_open(file, ppc_rtas_rmo_buf_show, NULL);
+}
+
+struct file_operations ppc_rtas_rmo_buf_ops = {
+	.open		= rmo_buf_open,
+	.read		= seq_read,
+	.llseek		= seq_lseek,
+	.release	= single_release,
 };
 
-int ppc_rtas_find_all_sensors (void);
-int ppc_rtas_process_sensor(struct individual_sensor s, int state, 
-		int error, char * buf);
-char * ppc_rtas_process_error(int error);
-int get_location_code(struct individual_sensor s, char * buf);
-int check_location_string (char *c, char * buf);
-int check_location (char *c, int idx, char * buf);
+static int ppc_rtas_find_all_sensors(void);
+static void ppc_rtas_process_sensor(struct seq_file *m,
+	struct individual_sensor *s, int state, int error, char *loc);
+static char *ppc_rtas_process_error(int error);
+static void get_location_code(struct seq_file *m,
+	struct individual_sensor *s, char *loc);
+static void check_location_string(struct seq_file *m, char *c);
+static void check_location(struct seq_file *m, char *c);
 
 static int __init proc_rtas_init(void)
 {
@@ -221,8 +278,9 @@ static int __init proc_rtas_init(void)
 	if (entry)
 		entry->proc_fops = &ppc_rtas_poweron_operations;
 
-	create_proc_read_entry("ppc64/rtas/sensors", S_IRUGO, NULL,
-			       ppc_rtas_sensor_read, NULL);
+	entry = create_proc_entry("ppc64/rtas/sensors", S_IRUGO, NULL);
+	if (entry)
+		entry->proc_fops = &ppc_rtas_sensors_operations;
 
 	entry = create_proc_entry("ppc64/rtas/frequency", S_IWUSR|S_IRUGO,
 				  NULL);
@@ -242,28 +300,38 @@ static int __init proc_rtas_init(void)
 
 __initcall(proc_rtas_init);
 
+static int parse_number(const char __user *p, size_t count, unsigned long *val)
+{
+	char buf[40];
+	char *end;
+
+	if (count > 39)
+		return -EINVAL;
+
+	if (copy_from_user(buf, p, count))
+		return -EFAULT;
+
+	buf[count] = 0;
+
+	*val = simple_strtoul(buf, &end, 10);
+	if (*end && *end != '\n')
+		return -EINVAL;
+
+	return 0;
+}
+
 /* ****************************************************************** */
 /* POWER-ON-TIME                                                      */
 /* ****************************************************************** */
-static ssize_t ppc_rtas_poweron_write(struct file * file, const char * buf,
-		size_t count, loff_t *ppos)
+static ssize_t ppc_rtas_poweron_write(struct file *file,
+		const char __user *buf, size_t count, loff_t *ppos)
 {
-	char stkbuf[40];  /* its small, its on stack */
 	struct rtc_time tm;
 	unsigned long nowtime;
-	char *dest;
-	int error;
+	int error = parse_number(buf, count, &nowtime);
+	if (error)
+		return error;
 
-	if (39 < count) count = 39;
-	if (copy_from_user (stkbuf, buf, count)) {
-		return -EFAULT;
-	}
-	stkbuf[count] = 0;
-	nowtime = simple_strtoul(stkbuf, &dest, 10);
-	if (*dest != '\0' && *dest != '\n') {
-		printk("ppc_rtas_poweron_write: Invalid time\n");
-		return count;
-	}
 	power_on_time = nowtime; /* save the time */
 
 	to_tm(nowtime, &tm);
@@ -271,46 +339,32 @@ static ssize_t ppc_rtas_poweron_write(struct file * file, const char * buf,
 	error = rtas_call(rtas_token("set-time-for-power-on"), 7, 1, NULL, 
 			tm.tm_year, tm.tm_mon, tm.tm_mday, 
 			tm.tm_hour, tm.tm_min, tm.tm_sec, 0 /* nano */);
-	if (error != 0)
+	if (error)
 		printk(KERN_WARNING "error: setting poweron time returned: %s\n", 
 				ppc_rtas_process_error(error));
 	return count;
 }
 /* ****************************************************************** */
-static ssize_t ppc_rtas_poweron_read(struct file * file, char * buf,
-		size_t count, loff_t *ppos)
+static int ppc_rtas_poweron_show(struct seq_file *m, void *v)
 {
-	char stkbuf[40];  /* its small, its on stack */
-	int n, sn;
 	if (power_on_time == 0)
-		n = scnprintf(stkbuf,sizeof(stkbuf),"Power on time not set\n");
+		seq_printf(m, "Power on time not set\n");
 	else
-		n = scnprintf(stkbuf,sizeof(stkbuf),"%lu\n",power_on_time);
-
-	sn = strlen (stkbuf) +1;
-	if (*ppos >= sn)
-		return 0;
-	if (n > sn - *ppos)
-		n = sn - *ppos;
-	if (n > count)
-		n = count;
-	if (copy_to_user (buf, stkbuf + (*ppos), n)) {
-		return -EFAULT;
-	}
-	*ppos += n;
-	return n;
+		seq_printf(m, "%lu\n",power_on_time);
+	return 0;
 }
 
 /* ****************************************************************** */
 /* PROGRESS                                                           */
 /* ****************************************************************** */
-static ssize_t ppc_rtas_progress_write(struct file * file, const char * buf,
-		size_t count, loff_t *ppos)
+static ssize_t ppc_rtas_progress_write(struct file *file,
+		const char __user *buf, size_t count, loff_t *ppos)
 {
 	unsigned long hex;
 
-	if (count >= MAX_LINELENGTH) count = MAX_LINELENGTH -1;
-	if (copy_from_user (progress_led, buf, count)) { /* save the string */
+	if (count >= MAX_LINELENGTH)
+		count = MAX_LINELENGTH -1;
+	if (copy_from_user(progress_led, buf, count)) { /* save the string */
 		return -EFAULT;
 	}
 	progress_led[count] = 0;
@@ -321,183 +375,106 @@ static ssize_t ppc_rtas_progress_write(struct file * file, const char * buf,
 	ppc_md.progress ((char *)progress_led, hex);
 	return count;
 
-	/* clear the line */ /* ppc_md.progress("                   ", 0xffff);*/
+	/* clear the line */
+	/* ppc_md.progress("                   ", 0xffff);*/
 }
 /* ****************************************************************** */
-static ssize_t ppc_rtas_progress_read(struct file * file, char * buf,
-		size_t count, loff_t *ppos)
+static int ppc_rtas_progress_show(struct seq_file *m, void *v)
 {
-	int sn, n = 0;
-	char *tmpbuf;
-
-	if (progress_led == NULL) return 0;
-
-	tmpbuf = kmalloc (MAX_LINELENGTH, GFP_KERNEL);
-	if (!tmpbuf) {
-		printk(KERN_ERR "error: kmalloc failed\n");
-		return -ENOMEM;
-	}
-	n = sprintf (tmpbuf, "%s\n", progress_led);
-
-	sn = strlen (tmpbuf) +1;
-	if (*ppos >= sn) {
-		kfree (tmpbuf);
-		return 0;
-	}
-	if (n > sn - *ppos)
-		n = sn - *ppos;
-	if (n > count)
-		n = count;
-	if (copy_to_user (buf, tmpbuf + (*ppos), n)) {
-		kfree (tmpbuf);
-		return -EFAULT;
-	}
-	kfree (tmpbuf);
-	*ppos += n;
-	return n;
+	if (progress_led)
+		seq_printf(m, "%s\n", progress_led);
+	return 0;
 }
 
 /* ****************************************************************** */
 /* CLOCK                                                              */
 /* ****************************************************************** */
-static ssize_t ppc_rtas_clock_write(struct file * file, const char * buf, 
-		size_t count, loff_t *ppos)
+static ssize_t ppc_rtas_clock_write(struct file *file,
+		const char __user *buf, size_t count, loff_t *ppos)
 {
-	char stkbuf[40];  /* its small, its on stack */
 	struct rtc_time tm;
 	unsigned long nowtime;
-	char *dest;
-	int error;
-
-	if (39 < count) count = 39;
-	if (copy_from_user (stkbuf, buf, count)) {
-		return -EFAULT;
-	}
-	stkbuf[count] = 0;
-	nowtime = simple_strtoul(stkbuf, &dest, 10);
-	if (*dest != '\0' && *dest != '\n') {
-		printk("ppc_rtas_clock_write: Invalid time\n");
-		return count;
-	}
+	int error = parse_number(buf, count, &nowtime);
+	if (error)
+		return error;
 
 	to_tm(nowtime, &tm);
 	error = rtas_call(rtas_token("set-time-of-day"), 7, 1, NULL, 
 			tm.tm_year, tm.tm_mon, tm.tm_mday, 
 			tm.tm_hour, tm.tm_min, tm.tm_sec, 0);
-	if (error != 0)
+	if (error)
 		printk(KERN_WARNING "error: setting the clock returned: %s\n", 
 				ppc_rtas_process_error(error));
 	return count;
 }
 /* ****************************************************************** */
-static ssize_t ppc_rtas_clock_read(struct file * file, char * buf, 
-		size_t count, loff_t *ppos)
+static int ppc_rtas_clock_show(struct seq_file *m, void *v)
 {
-	unsigned int year, mon, day, hour, min, sec;
-	unsigned long *ret = kmalloc(4*8, GFP_KERNEL);
-	int n, sn, error;
-	char stkbuf[40];  /* its small, its on stack */
+	int ret[8];
+	int error = rtas_call(rtas_token("get-time-of-day"), 0, 8, ret);
 
-	error = rtas_call(rtas_token("get-time-of-day"), 0, 8, ret);
-	
-	year = ret[0]; mon  = ret[1]; day  = ret[2];
-	hour = ret[3]; min  = ret[4]; sec  = ret[5];
-
-	if (error != 0){
+	if (error) {
 		printk(KERN_WARNING "error: reading the clock returned: %s\n", 
 				ppc_rtas_process_error(error));
-		n = scnprintf (stkbuf, sizeof(stkbuf), "0");
+		seq_printf(m, "0");
 	} else { 
-		n = scnprintf (stkbuf, sizeof(stkbuf), "%lu\n",
+		unsigned int year, mon, day, hour, min, sec;
+		year = ret[0]; mon  = ret[1]; day  = ret[2];
+		hour = ret[3]; min  = ret[4]; sec  = ret[5];
+		seq_printf(m, "%lu\n",
 				mktime(year, mon, day, hour, min, sec));
 	}
-	kfree(ret);
-
-	sn = strlen (stkbuf) +1;
-	if (*ppos >= sn)
-		return 0;
-	if (n > sn - *ppos)
-		n = sn - *ppos;
-	if (n > count)
-		n = count;
-	if (copy_to_user (buf, stkbuf + (*ppos), n)) {
-		return -EFAULT;
-	}
-	*ppos += n;
-	return n;
+	return 0;
 }
 
 /* ****************************************************************** */
 /* SENSOR STUFF                                                       */
 /* ****************************************************************** */
-static int ppc_rtas_sensor_read(char * buf, char ** start, off_t off,
-		int count, int *eof, void *data)
+static int ppc_rtas_sensors_show(struct seq_file *m, void *v)
 {
-	int i,j,n;
-	unsigned long ret;
+	int i,j;
 	int state, error;
-	char *buffer;
 	int get_sensor_state = rtas_token("get-sensor-state");
 
-	if (count < 0)
-		return -EINVAL;
-
-	/* May not be enough */
-	buffer = kmalloc(MAX_LINELENGTH*MAX_SENSORS, GFP_KERNEL);
-
-	if (!buffer)
-		return -ENOMEM;
-
-	memset(buffer, 0, MAX_LINELENGTH*MAX_SENSORS);
-
-	n  = sprintf ( buffer  , "RTAS (RunTime Abstraction Services) Sensor Information\n");
-	n += sprintf ( buffer+n, "Sensor\t\tValue\t\tCondition\tLocation\n");
-	n += sprintf ( buffer+n, "********************************************************\n");
+	seq_printf(m, "RTAS (RunTime Abstraction Services) Sensor Information\n");
+	seq_printf(m, "Sensor\t\tValue\t\tCondition\tLocation\n");
+	seq_printf(m, "********************************************************\n");
 
 	if (ppc_rtas_find_all_sensors() != 0) {
-		n += sprintf ( buffer+n, "\nNo sensors are available\n");
-		goto return_string;
+		seq_printf(m, "\nNo sensors are available\n");
+		return 0;
 	}
 
 	for (i=0; i<sensors.quant; i++) {
-		j = sensors.sensor[i].quant;
+		struct individual_sensor *p = &sensors.sensor[i];
+		char rstr[64];
+		char *loc;
+		int llen, offs;
+
+		sprintf (rstr, SENSOR_PREFIX"%04d", p->token);
+		loc = (char *) get_property(rtas_node, rstr, &llen);
+
 		/* A sensor may have multiple instances */
-		while (j >= 0) {
-
-			error =	rtas_call(get_sensor_state, 2, 2, &ret, 
-				  	  sensors.sensor[i].token, 
-				  	  sensors.sensor[i].quant - j);
-
-			state = (int) ret;
-			n += ppc_rtas_process_sensor(sensors.sensor[i], state, 
-					     	     error, buffer+n );
-			n += sprintf (buffer+n, "\n");
-			j--;
-		} /* while */
-	} /* for */
-
-return_string:
-	if (off >= strlen(buffer)) {
-		*eof = 1;
-		kfree(buffer);
-		return 0;
+		for (j = 0, offs = 0; j <= p->quant; j++) {
+			error =	rtas_call(get_sensor_state, 2, 2, &state, 
+				  	  p->token, j);
+
+			ppc_rtas_process_sensor(m, p, state, error, loc);
+			seq_putc(m, '\n');
+			if (loc) {
+				offs += strlen(loc) + 1;
+				loc += strlen(loc) + 1;
+				if (offs >= llen)
+					loc = NULL;
+			}
+		}
 	}
-	if (n > strlen(buffer) - off)
-		n = strlen(buffer) - off;
-	if (n > count)
-		n = count;
-	else
-		*eof = 1;
-
-	memcpy(buf, buffer + off, n);
-	*start = buf;
-	kfree(buffer);
-	return n;
+	return 0;
 }
 
 /* ****************************************************************** */
 
-int ppc_rtas_find_all_sensors (void)
+static int ppc_rtas_find_all_sensors(void)
 {
 	unsigned int *utmp;
 	int len, i;
@@ -521,7 +498,7 @@ int ppc_rtas_find_all_sensors (void)
 /*
  * Builds a string of what rtas returned
  */
-char * ppc_rtas_process_error(int error)
+static char *ppc_rtas_process_error(int error)
 {
 	switch (error) {
 		case SENSOR_CRITICAL_HIGH:
@@ -554,8 +531,8 @@ char * ppc_rtas_process_error(int error)
  * Builds a string out of what the sensor said
  */
 
-int ppc_rtas_process_sensor(struct individual_sensor s, int state, 
-		int error, char * buf) 
+static void ppc_rtas_process_sensor(struct seq_file *m,
+	struct individual_sensor *s, int state, int error, char *loc)
 {
 	/* Defined return vales */
 	const char * key_switch[]        = { "Off\t", "Normal\t", "Secure\t", 
@@ -581,174 +558,170 @@ int ppc_rtas_process_sensor(struct individual_sensor s, int state,
 	int num_states = 0;
 	int temperature = 0;
 	int unknown = 0;
-	int n = 0;
 
 	/* What kind of sensor do we have here? */
 	
-	switch (s.token) {
+	switch (s->token) {
 		case KEY_SWITCH:
-			n += sprintf(buf+n, "Key switch:\t");
+			seq_printf(m, "Key switch:\t");
 			num_states = sizeof(key_switch) / sizeof(char *);
 			if (state < num_states) {
-				n += sprintf(buf+n, "%s\t", key_switch[state]);
+				seq_printf(m, "%s\t", key_switch[state]);
 				have_strings = 1;
 			}
 			break;
 		case ENCLOSURE_SWITCH:
-			n += sprintf(buf+n, "Enclosure switch:\t");
+			seq_printf(m, "Enclosure switch:\t");
 			num_states = sizeof(enclosure_switch) / sizeof(char *);
 			if (state < num_states) {
-				n += sprintf(buf+n, "%s\t", 
+				seq_printf(m, "%s\t", 
 						enclosure_switch[state]);
 				have_strings = 1;
 			}
 			break;
 		case THERMAL_SENSOR:
-			n += sprintf(buf+n, "Temp. (°C/°F):\t");
+			seq_printf(m, "Temp. (°C/°F):\t");
 			temperature = 1;
 			break;
 		case LID_STATUS:
-			n += sprintf(buf+n, "Lid status:\t");
+			seq_printf(m, "Lid status:\t");
 			num_states = sizeof(lid_status) / sizeof(char *);
 			if (state < num_states) {
-				n += sprintf(buf+n, "%s\t", lid_status[state]);
+				seq_printf(m, "%s\t", lid_status[state]);
 				have_strings = 1;
 			}
 			break;
 		case POWER_SOURCE:
-			n += sprintf(buf+n, "Power source:\t");
+			seq_printf(m, "Power source:\t");
 			num_states = sizeof(power_source) / sizeof(char *);
 			if (state < num_states) {
-				n += sprintf(buf+n, "%s\t", 
+				seq_printf(m, "%s\t", 
 						power_source[state]);
 				have_strings = 1;
 			}
 			break;
 		case BATTERY_VOLTAGE:
-			n += sprintf(buf+n, "Battery voltage:\t");
+			seq_printf(m, "Battery voltage:\t");
 			break;
 		case BATTERY_REMAINING:
-			n += sprintf(buf+n, "Battery remaining:\t");
+			seq_printf(m, "Battery remaining:\t");
 			num_states = sizeof(battery_remaining) / sizeof(char *);
 			if (state < num_states)
 			{
-				n += sprintf(buf+n, "%s\t", 
+				seq_printf(m, "%s\t", 
 						battery_remaining[state]);
 				have_strings = 1;
 			}
 			break;
 		case BATTERY_PERCENTAGE:
-			n += sprintf(buf+n, "Battery percentage:\t");
+			seq_printf(m, "Battery percentage:\t");
 			break;
 		case EPOW_SENSOR:
-			n += sprintf(buf+n, "EPOW Sensor:\t");
+			seq_printf(m, "EPOW Sensor:\t");
 			num_states = sizeof(epow_sensor) / sizeof(char *);
 			if (state < num_states) {
-				n += sprintf(buf+n, "%s\t", epow_sensor[state]);
+				seq_printf(m, "%s\t", epow_sensor[state]);
 				have_strings = 1;
 			}
 			break;
 		case BATTERY_CYCLESTATE:
-			n += sprintf(buf+n, "Battery cyclestate:\t");
+			seq_printf(m, "Battery cyclestate:\t");
 			num_states = sizeof(battery_cyclestate) / 
 				     	sizeof(char *);
 			if (state < num_states) {
-				n += sprintf(buf+n, "%s\t", 
+				seq_printf(m, "%s\t", 
 						battery_cyclestate[state]);
 				have_strings = 1;
 			}
 			break;
 		case BATTERY_CHARGING:
-			n += sprintf(buf+n, "Battery Charging:\t");
+			seq_printf(m, "Battery Charging:\t");
 			num_states = sizeof(battery_charging) / sizeof(char *);
 			if (state < num_states) {
-				n += sprintf(buf+n, "%s\t", 
+				seq_printf(m, "%s\t", 
 						battery_charging[state]);
 				have_strings = 1;
 			}
 			break;
 		case IBM_SURVEILLANCE:
-			n += sprintf(buf+n, "Surveillance:\t");
+			seq_printf(m, "Surveillance:\t");
 			break;
 		case IBM_FANRPM:
-			n += sprintf(buf+n, "Fan (rpm):\t");
+			seq_printf(m, "Fan (rpm):\t");
 			break;
 		case IBM_VOLTAGE:
-			n += sprintf(buf+n, "Voltage (mv):\t");
+			seq_printf(m, "Voltage (mv):\t");
 			break;
 		case IBM_DRCONNECTOR:
-			n += sprintf(buf+n, "DR connector:\t");
+			seq_printf(m, "DR connector:\t");
 			num_states = sizeof(ibm_drconnector) / sizeof(char *);
 			if (state < num_states) {
-				n += sprintf(buf+n, "%s\t", 
+				seq_printf(m, "%s\t", 
 						ibm_drconnector[state]);
 				have_strings = 1;
 			}
 			break;
 		case IBM_POWERSUPPLY:
-			n += sprintf(buf+n, "Powersupply:\t");
+			seq_printf(m, "Powersupply:\t");
 			break;
 		case IBM_INTQUEUE:
-			n += sprintf(buf+n, "Interrupt queue:\t");
+			seq_printf(m, "Interrupt queue:\t");
 			num_states = sizeof(ibm_intqueue) / sizeof(char *);
 			if (state < num_states) {
-				n += sprintf(buf+n, "%s\t", 
+				seq_printf(m, "%s\t", 
 						ibm_intqueue[state]);
 				have_strings = 1;
 			}
 			break;
 		default:
-			n += sprintf(buf+n,  "Unknown sensor (type %d), ignoring it\n",
-					s.token);
+			seq_printf(m,  "Unknown sensor (type %d), ignoring it\n",
+					s->token);
 			unknown = 1;
 			have_strings = 1;
 			break;
 	}
 	if (have_strings == 0) {
 		if (temperature) {
-			n += sprintf(buf+n, "%4d /%4d\t", state, cel_to_fahr(state));
+			seq_printf(m, "%4d /%4d\t", state, cel_to_fahr(state));
 		} else
-			n += sprintf(buf+n, "%10d\t", state);
+			seq_printf(m, "%10d\t", state);
 	}
 	if (unknown == 0) {
-		n += sprintf ( buf+n, "%s\t", ppc_rtas_process_error(error));
-		n += get_location_code(s, buf+n);
+		seq_printf(m, "%s\t", ppc_rtas_process_error(error));
+		get_location_code(m, s, loc);
 	}
-	return n;
 }
 
 /* ****************************************************************** */
 
-int check_location (char *c, int idx, char * buf)
+static void check_location(struct seq_file *m, char *c)
 {
-	int n = 0;
-
-	switch (*(c+idx)) {
+	switch (c[0]) {
 		case LOC_PLANAR:
-			n += sprintf ( buf, "Planar #%c", *(c+idx+1));
+			seq_printf(m, "Planar #%c", c[1]);
 			break;
 		case LOC_CPU:
-			n += sprintf ( buf, "CPU #%c", *(c+idx+1));
+			seq_printf(m, "CPU #%c", c[1]);
 			break;
 		case LOC_FAN:
-			n += sprintf ( buf, "Fan #%c", *(c+idx+1));
+			seq_printf(m, "Fan #%c", c[1]);
 			break;
 		case LOC_RACKMOUNTED:
-			n += sprintf ( buf, "Rack #%c", *(c+idx+1));
+			seq_printf(m, "Rack #%c", c[1]);
 			break;
 		case LOC_VOLTAGE:
-			n += sprintf ( buf, "Voltage #%c", *(c+idx+1));
+			seq_printf(m, "Voltage #%c", c[1]);
 			break;
 		case LOC_LCD:
-			n += sprintf ( buf, "LCD #%c", *(c+idx+1));
+			seq_printf(m, "LCD #%c", c[1]);
 			break;
 		case '.':
-			n += sprintf ( buf, "- %c", *(c+idx+1));
+			seq_printf(m, "- %c", c[1]);
+			break;
 		default:
-			n += sprintf ( buf, "Unknown location");
+			seq_printf(m, "Unknown location");
 			break;
 	}
-	return n;
 }
 
 
@@ -758,199 +731,88 @@ int check_location (char *c, int idx, char * buf)
  * ${LETTER}${NUMBER}[[-/]${LETTER}${NUMBER} [ ... ] ]
  * the '.' may be an abbrevation
  */
-int check_location_string (char *c, char *buf)
+static void check_location_string(struct seq_file *m, char *c)
 {
-	int n=0,i=0;
-
-	while (c[i]) {
-		if (isalpha(c[i]) || c[i] == '.') {
-			 n += check_location(c, i, buf+n);
-		}
-		else if (c[i] == '/' || c[i] == '-')
-			n += sprintf(buf+n, " at ");
-		i++;
+	while (*c) {
+		if (isalpha(*c) || *c == '.')
+			check_location(m, c);
+		else if (*c == '/' || *c == '-')
+			seq_printf(m, " at ");
+		c++;
 	}
-	return n;
 }
 
 
 /* ****************************************************************** */
 
-int get_location_code(struct individual_sensor s, char * buffer)
+static void get_location_code(struct seq_file *m, struct individual_sensor *s, char *loc)
 {
-	char rstr[512], tmp[10], tmp2[10];
-	int n=0, i=0, llen, len;
-	/* char *buf = kmalloc(MAX_LINELENGTH, GFP_KERNEL); */
-	char *ret;
-
-	static int pos = 0; /* remember position where buffer was */
-
-	/* construct the sensor number like 0003 */
-	/* fill with zeros */
-	n = sprintf(tmp, "%d", s.token);
-	len = strlen(tmp);
-	while (strlen(tmp) < 4)
-		n += sprintf (tmp+n, "0");
-	
-	/* invert the string */
-	while (tmp[i]) {
-		if (i<len)
-			tmp2[4-len+i] = tmp[i];
-		else
-			tmp2[3-i] = tmp[i];
-		i++;
-	}
-	tmp2[4] = '\0';
-
-	sprintf (rstr, SENSOR_PREFIX"%s", tmp2);
-
-	ret = (char *) get_property(rtas_node, rstr, &llen);
-
-	n=0;
-	if (ret == NULL || ret[0] == '\0') {
-		n += sprintf ( buffer+n, "--- ");/* does not have a location */
+	if (!loc || !*loc) {
+		seq_printf(m, "---");/* does not have a location */
 	} else {
-		char t[50];
-		ret += pos;
-
-		n += check_location_string(ret, buffer + n);
-		n += sprintf ( buffer+n, " ");
-		/* see how many characters we have printed */
-		scnprintf(t, sizeof(t), "%s ", ret);
-
-		pos += strlen(t);
-		if (pos >= llen) pos=0;
+		check_location_string(m, loc);
 	}
-	return n;
+	seq_putc(m, ' ');
 }
 /* ****************************************************************** */
 /* INDICATORS - Tone Frequency                                        */
 /* ****************************************************************** */
-static ssize_t ppc_rtas_tone_freq_write(struct file * file, const char * buf,
-		size_t count, loff_t *ppos)
+static ssize_t ppc_rtas_tone_freq_write(struct file *file,
+		const char __user *buf, size_t count, loff_t *ppos)
 {
-	char stkbuf[40];  /* its small, its on stack */
 	unsigned long freq;
-	char *dest;
-	int error;
+	int error = parse_number(buf, count, &freq);
+	if (error)
+		return error;
 
-	if (39 < count) count = 39;
-	if (copy_from_user (stkbuf, buf, count)) {
-		return -EFAULT;
-	}
-	stkbuf[count] = 0;
-	freq = simple_strtoul(stkbuf, &dest, 10);
-	if (*dest != '\0' && *dest != '\n') {
-		printk("ppc_rtas_tone_freq_write: Invalid tone freqency\n");
-		return count;
-	}
-	if (freq < 0) freq = 0;
 	rtas_tone_frequency = freq; /* save it for later */
 	error = rtas_call(rtas_token("set-indicator"), 3, 1, NULL,
 			TONE_FREQUENCY, 0, freq);
-	if (error != 0)
+	if (error)
 		printk(KERN_WARNING "error: setting tone frequency returned: %s\n", 
 				ppc_rtas_process_error(error));
 	return count;
 }
 /* ****************************************************************** */
-static ssize_t ppc_rtas_tone_freq_read(struct file * file, char * buf,
-		size_t count, loff_t *ppos)
+static int ppc_rtas_tone_freq_show(struct seq_file *m, void *v)
 {
-	int n, sn;
-	char stkbuf[40];  /* its small, its on stack */
-
-	n = scnprintf(stkbuf, 40, "%lu\n", rtas_tone_frequency);
-
-	sn = strlen (stkbuf) +1;
-	if (*ppos >= sn)
-		return 0;
-	if (n > sn - *ppos)
-		n = sn - *ppos;
-	if (n > count)
-		n = count;
-	if (copy_to_user (buf, stkbuf + (*ppos), n)) {
-		return -EFAULT;
-	}
-	*ppos += n;
-	return n;
+	seq_printf(m, "%lu\n", rtas_tone_frequency);
+	return 0;
 }
 /* ****************************************************************** */
 /* INDICATORS - Tone Volume                                           */
 /* ****************************************************************** */
-static ssize_t ppc_rtas_tone_volume_write(struct file * file, const char * buf,
-		size_t count, loff_t *ppos)
+static ssize_t ppc_rtas_tone_volume_write(struct file *file,
+		const char __user *buf, size_t count, loff_t *ppos)
 {
-	char stkbuf[40];  /* its small, its on stack */
 	unsigned long volume;
-	char *dest;
-	int error;
+	int error = parse_number(buf, count, &volume);
+	if (error)
+		return error;
 
-	if (39 < count) count = 39;
-	if (copy_from_user (stkbuf, buf, count)) {
-		return -EFAULT;
-	}
-	stkbuf[count] = 0;
-	volume = simple_strtoul(stkbuf, &dest, 10);
-	if (*dest != '\0' && *dest != '\n') {
-		printk("ppc_rtas_tone_volume_write: Invalid tone volume\n");
-		return count;
-	}
-	if (volume < 0) volume = 0;
-	if (volume > 100) volume = 100;
+	if (volume > 100)
+		volume = 100;
 	
         rtas_tone_volume = volume; /* save it for later */
 	error = rtas_call(rtas_token("set-indicator"), 3, 1, NULL,
 			TONE_VOLUME, 0, volume);
-	if (error != 0)
+	if (error)
 		printk(KERN_WARNING "error: setting tone volume returned: %s\n", 
 				ppc_rtas_process_error(error));
 	return count;
 }
 /* ****************************************************************** */
-static ssize_t ppc_rtas_tone_volume_read(struct file * file, char * buf,
-		size_t count, loff_t *ppos)
+static int ppc_rtas_tone_volume_show(struct seq_file *m, void *v)
 {
-	int n, sn;
-	char stkbuf[40];  /* its small, its on stack */
-
-	n = scnprintf(stkbuf, 40, "%lu\n", rtas_tone_volume);
-
-	sn = strlen (stkbuf) +1;
-	if (*ppos >= sn)
-		return 0;
-	if (n > sn - *ppos)
-		n = sn - *ppos;
-	if (n > count)
-		n = count;
-	if (copy_to_user (buf, stkbuf + (*ppos), n)) {
-		return -EFAULT;
-	}
-	*ppos += n;
-	return n;
+	seq_printf(m, "%lu\n", rtas_tone_volume);
+	return 0;
 }
 
 #define RMO_READ_BUF_MAX 30
 
 /* RTAS Userspace access */
-static ssize_t ppc_rtas_rmo_buf_read(struct file *file, char __user *buf,
-				    size_t count, loff_t *ppos)
+static int ppc_rtas_rmo_buf_show(struct seq_file *m, void *v)
 {
-	char kbuf[RMO_READ_BUF_MAX];
-	int n;
-
-	n = sprintf(kbuf, "%016lx %x\n", rtas_rmo_buf, RTAS_RMOBUF_MAX);
-	if (n > count)
-		n = count;
-
-	if (ppos && *ppos != 0)
-		return 0;
-
-	if (copy_to_user(buf, kbuf, n))
-		return -EFAULT;
-
-	if (ppos)
-		*ppos = n;
-	
-	return n;
+	seq_printf(m, "%016lx %x\n", rtas_rmo_buf, RTAS_RMOBUF_MAX);
+	return 0;
 }
diff --git a/arch/ppc64/kernel/rtas.c b/arch/ppc64/kernel/rtas.c
index ff59b0057..438d258dc 100644
--- a/arch/ppc64/kernel/rtas.c
+++ b/arch/ppc64/kernel/rtas.c
@@ -31,28 +31,7 @@
 #include <asm/delay.h>
 #include <asm/uaccess.h>
 
-struct flash_block_list_header rtas_firmware_flash_list = {0, 0};
-
-/*
- * 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.)
- *
- * Because OF may have mapped I/O devices into the area starting at
- * KERNELBASE, particularly on CHRP machines, we can't safely call
- * OF once the kernel has been mapped to KERNELBASE.  Therefore all
- * OF calls should be done within prom_init(), and prom_init()
- * and all routines called within it must be careful to relocate
- * references as necessary.
- *
- * Note that the bss is cleared *after* prom_init runs, so we have
- * to make sure that any static or extern variables it accesses
- * are put in the data segment.
- */
+struct flash_block_list_header rtas_firmware_flash_list = {0, NULL};
 
 struct rtas_t rtas = { 
 	.lock = SPIN_LOCK_UNLOCKED
@@ -60,15 +39,13 @@ struct rtas_t rtas = {
 
 char rtas_err_buf[RTAS_ERROR_LOG_MAX];
 
-extern unsigned long reloc_offset(void);
-
 spinlock_t rtas_data_buf_lock = SPIN_LOCK_UNLOCKED;
 char rtas_data_buf[RTAS_DATA_BUF_SIZE]__page_aligned;
 
 void
 call_rtas_display_status(char c)
 {
-	struct rtas_args *args = &(get_paca()->xRtas);
+	struct rtas_args *args = &rtas.args;
 	unsigned long s;
 
 	spin_lock_irqsave(&rtas.lock, s);
@@ -97,10 +74,16 @@ rtas_token(const char *service)
 }
 
 
+/** Return a copy of the detailed error text associated with the
+ *  most recent failed call to rtas.  Because the error text
+ *  might go stale if there are any other intervening rtas calls,
+ *  this routine must be called atomically with whatever produced
+ *  the error (i.e. with rtas.lock still held from the previous call).
+ */
 static int
-__log_rtas_error(struct rtas_args *rtas_args)
+__fetch_rtas_last_error(void)
 {
-	struct rtas_args err_args, temp_args;
+	struct rtas_args err_args, save_args;
 
 	err_args.token = rtas_token("rtas-last-error");
 	err_args.nargs = 2;
@@ -111,42 +94,28 @@ __log_rtas_error(struct rtas_args *rtas_args)
 	err_args.args[1] = RTAS_ERROR_LOG_MAX;
 	err_args.args[2] = 0;
 
-	temp_args = *rtas_args;
-	get_paca()->xRtas = err_args;
+	save_args = rtas.args;
+	rtas.args = err_args;
 
 	PPCDBG(PPCDBG_RTAS, "\tentering rtas with 0x%lx\n",
 	       __pa(&err_args));
-	enter_rtas(__pa(&get_paca()->xRtas));
+	enter_rtas(__pa(&rtas.args));
 	PPCDBG(PPCDBG_RTAS, "\treturned from rtas ...\n");
 
-	err_args = get_paca()->xRtas;
-	get_paca()->xRtas = temp_args;
+	err_args = rtas.args;
+	rtas.args = save_args;
 
 	return err_args.rets[0];
 }
 
-void
-log_rtas_error(struct rtas_args	*rtas_args)
-{
-	unsigned long s;
-	int rc;
-
-	spin_lock_irqsave(&rtas.lock, s);
-	rc = __log_rtas_error(rtas_args);
-	spin_unlock_irqrestore(&rtas.lock, s);
-	if (rc == 0)
-		log_error(rtas_err_buf, ERR_TYPE_RTAS_LOG, 0);
-}
-
-long
-rtas_call(int token, int nargs, int nret,
-	  unsigned long *outputs, ...)
+int rtas_call(int token, int nargs, int nret, int *outputs, ...)
 {
 	va_list list;
 	int i, logit = 0;
 	unsigned long s;
-	struct rtas_args *rtas_args = &(get_paca()->xRtas);
-	long ret;
+	struct rtas_args *rtas_args;
+	char * buff_copy = NULL;
+	int ret;
 
 	PPCDBG(PPCDBG_RTAS, "Entering rtas_call\n");
 	PPCDBG(PPCDBG_RTAS, "\ttoken    = 0x%x\n", token);
@@ -158,6 +127,7 @@ rtas_call(int token, int nargs, int nret,
 
 	/* Gotta do something different here, use global lock for now... */
 	spin_lock_irqsave(&rtas.lock, s);
+	rtas_args = &rtas.args;
 
 	rtas_args->token = token;
 	rtas_args->nargs = nargs;
@@ -165,8 +135,8 @@ rtas_call(int token, int nargs, int nret,
 	rtas_args->rets  = (rtas_arg_t *)&(rtas_args->args[nargs]);
 	va_start(list, outputs);
 	for (i = 0; i < nargs; ++i) {
-		rtas_args->args[i] = (rtas_arg_t)LONG_LSW(va_arg(list, ulong));
-		PPCDBG(PPCDBG_RTAS, "\tnarg[%d] = 0x%lx\n", i, rtas_args->args[i]);
+		rtas_args->args[i] = va_arg(list, rtas_arg_t);
+		PPCDBG(PPCDBG_RTAS, "\tnarg[%d] = 0x%x\n", i, rtas_args->args[i]);
 	}
 	va_end(list);
 
@@ -178,8 +148,10 @@ rtas_call(int token, int nargs, int nret,
 	enter_rtas(__pa(rtas_args));
 	PPCDBG(PPCDBG_RTAS, "\treturned from rtas ...\n");
 
+	/* A -1 return code indicates that the last command couldn't
+	   be completed due to a hardware error. */
 	if (rtas_args->rets[0] == -1)
-		logit = (__log_rtas_error(rtas_args) == 0);
+		logit = (__fetch_rtas_last_error() == 0);
 
 	ifppcdebug(PPCDBG_RTAS) {
 		for(i=0; i < nret ;i++)
@@ -189,14 +161,23 @@ rtas_call(int token, int nargs, int nret,
 	if (nret > 1 && outputs != NULL)
 		for (i = 0; i < nret-1; ++i)
 			outputs[i] = rtas_args->rets[i+1];
-	ret = (ulong)((nret > 0) ? rtas_args->rets[0] : 0);
+	ret = (nret > 0)? rtas_args->rets[0]: 0;
+
+	/* Log the error in the unlikely case that there was one. */
+	if (unlikely(logit)) {
+		buff_copy = kmalloc(RTAS_ERROR_LOG_MAX, GFP_ATOMIC);
+		if (buff_copy) {
+			memcpy(buff_copy, rtas_err_buf, RTAS_ERROR_LOG_MAX);
+		}
+	}
 
 	/* Gotta do something different here, use global lock for now... */
 	spin_unlock_irqrestore(&rtas.lock, s);
 
-	if (logit)
-		log_error(rtas_err_buf, ERR_TYPE_RTAS_LOG, 0);
-
+	if (buff_copy) {
+		log_error(buff_copy, ERR_TYPE_RTAS_LOG, 0);
+		kfree(buff_copy);
+	}
 	return ret;
 }
 
@@ -216,7 +197,7 @@ rtas_extended_busy_delay_time(int status)
 
 	/* Use microseconds for reasonable accuracy */
 	for (ms=1; order > 0; order--)
-		ms *= 10;          
+		ms *= 10;
 
 	return ms; 
 }
@@ -225,20 +206,13 @@ int
 rtas_get_power_level(int powerdomain, int *level)
 {
 	int token = rtas_token("get-power-level");
-	long powerlevel;
 	int rc;
 
 	if (token == RTAS_UNKNOWN_SERVICE)
 		return RTAS_UNKNOWN_OP;
 
-	while(1) {
-		rc = (int) rtas_call(token, 1, 2, &powerlevel, powerdomain);
-		if (rc == RTAS_BUSY)
-			udelay(1);
-		else
-			break;
-	}
-	*level = (int) powerlevel;
+	while ((rc = rtas_call(token, 1, 2, level, powerdomain)) == RTAS_BUSY)
+		udelay(1);
 	return rc;
 }
 
@@ -247,25 +221,21 @@ rtas_set_power_level(int powerdomain, int level, int *setlevel)
 {
 	int token = rtas_token("set-power-level");
 	unsigned int wait_time;
-	long returned_level;
 	int rc;
 
 	if (token == RTAS_UNKNOWN_SERVICE)
 		return RTAS_UNKNOWN_OP;
 
 	while (1) {
-		rc = (int) rtas_call(token, 2, 2, &returned_level, powerdomain,
-					level);
+		rc = rtas_call(token, 2, 2, setlevel, powerdomain, level);
 		if (rc == RTAS_BUSY)
 			udelay(1);
 		else if (rtas_is_extended_busy(rc)) {
 			wait_time = rtas_extended_busy_delay_time(rc);
 			udelay(wait_time * 1000);
-		}
-		else
+		} else
 			break;
 	}
-	*setlevel = (int) returned_level;
 	return rc;
 }
 
@@ -274,25 +244,21 @@ rtas_get_sensor(int sensor, int index, int *state)
 {
 	int token = rtas_token("get-sensor-state");
 	unsigned int wait_time;
-	long returned_state;
 	int rc;
 
 	if (token == RTAS_UNKNOWN_SERVICE)
 		return RTAS_UNKNOWN_OP;
 
 	while (1) {
-		rc = (int) rtas_call(token, 2, 2, &returned_state, sensor,
-					index);
+		rc = rtas_call(token, 2, 2, state, sensor, index);
 		if (rc == RTAS_BUSY)
 			udelay(1);
 		else if (rtas_is_extended_busy(rc)) {
 			wait_time = rtas_extended_busy_delay_time(rc);
 			udelay(wait_time * 1000);
-		}
-		else
+		} else
 			break;
 	}
-	*state = (int) returned_state;
 	return rc;
 }
 
@@ -307,8 +273,7 @@ rtas_set_indicator(int indicator, int index, int new_value)
 		return RTAS_UNKNOWN_OP;
 
 	while (1) {
-		rc = (int) rtas_call(token, 3, 1, NULL, indicator, index,
-					new_value);
+		rc = rtas_call(token, 3, 1, NULL, indicator, index, new_value);
 		if (rc == RTAS_BUSY)
 			udelay(1);
 		else if (rtas_is_extended_busy(rc)) {
@@ -364,7 +329,7 @@ rtas_flash_firmware(void)
 		if (f->next)
 			f->next = (struct flash_block_list *)virt_to_abs(f->next);
 		else
-			f->next = 0LL;
+			f->next = NULL;
 		/* make num_blocks into the version/length field */
 		f->num_blocks = (FLASH_BLOCK_LIST_VERSION << 56) | ((f->num_blocks+1)*16);
 	}
@@ -407,9 +372,9 @@ rtas_restart(char *cmd)
 	if (rtas_firmware_flash_list.next)
 		rtas_flash_firmware();
 
-        printk("RTAS system-reboot returned %ld\n",
+	printk("RTAS system-reboot returned %d\n",
 	       rtas_call(rtas_token("system-reboot"), 0, 1, NULL));
-        for (;;);
+	for (;;);
 }
 
 void
@@ -417,10 +382,10 @@ rtas_power_off(void)
 {
 	if (rtas_firmware_flash_list.next)
 		rtas_flash_bypass_warning();
-        /* allow power on only with power button press */
-        printk("RTAS power-off returned %ld\n",
-               rtas_call(rtas_token("power-off"), 2, 1, NULL,0xffffffff,0xffffffff));
-        for (;;);
+	/* allow power on only with power button press */
+	printk("RTAS power-off returned %d\n",
+	       rtas_call(rtas_token("power-off"), 2, 1, NULL, -1, -1));
+	for (;;);
 }
 
 void
@@ -428,7 +393,7 @@ rtas_halt(void)
 {
 	if (rtas_firmware_flash_list.next)
 		rtas_flash_bypass_warning();
-        rtas_power_off();
+	rtas_power_off();
 }
 
 /* Must be in the RMO region, so we place it here */
@@ -436,7 +401,7 @@ static char rtas_os_term_buf[2048];
 
 void rtas_os_term(char *str)
 {
-	long status;
+	int status;
 
 	snprintf(rtas_os_term_buf, 2048, "OS panic: %s", str);
 
@@ -447,7 +412,7 @@ void rtas_os_term(char *str)
 		if (status == RTAS_BUSY)
 			udelay(1);
 		else if (status != 0)
-			printk(KERN_EMERG "ibm,os-term call failed %ld\n",
+			printk(KERN_EMERG "ibm,os-term call failed %d\n",
 			       status);
 	} while (status == RTAS_BUSY);
 }
@@ -458,7 +423,9 @@ asmlinkage int ppc_rtas(struct rtas_args __user *uargs)
 {
 	struct rtas_args args;
 	unsigned long flags;
+	char * buff_copy;
 	int nargs;
+	int err_rc = 0;
 
 	if (!capable(CAP_SYS_ADMIN))
 		return -EPERM;
@@ -477,17 +444,33 @@ asmlinkage int ppc_rtas(struct rtas_args __user *uargs)
 			   nargs * sizeof(rtas_arg_t)) != 0)
 		return -EFAULT;
 
+	buff_copy = kmalloc(RTAS_ERROR_LOG_MAX, GFP_KERNEL);
+
 	spin_lock_irqsave(&rtas.lock, flags);
 
-	get_paca()->xRtas = args;
-	enter_rtas(__pa(&get_paca()->xRtas));
-	args = get_paca()->xRtas;
+	rtas.args = args;
+	enter_rtas(__pa(&rtas.args));
+	args = rtas.args;
+
+	args.rets = &args.args[nargs];
+
+	/* A -1 return code indicates that the last command couldn't
+	   be completed due to a hardware error. */
+	if (args.rets[0] == -1) {
+		err_rc = __fetch_rtas_last_error();
+		if ((err_rc == 0) && buff_copy) {
+			memcpy(buff_copy, rtas_err_buf, RTAS_ERROR_LOG_MAX);
+		}
+	}
 
 	spin_unlock_irqrestore(&rtas.lock, flags);
 
-	args.rets  = (rtas_arg_t *)&(args.args[nargs]);
-	if (args.rets[0] == -1)
-		log_rtas_error(&args);
+	if (buff_copy) {
+		if ((args.rets[0] == -1) && (err_rc == 0)) {
+			log_error(buff_copy, ERR_TYPE_RTAS_LOG, 0);
+		}
+		kfree(buff_copy);
+	}
 
 	/* Copy out args. */
 	if (copy_to_user(uargs->args + nargs,
@@ -499,21 +482,25 @@ asmlinkage int ppc_rtas(struct rtas_args __user *uargs)
 }
 
 #ifdef CONFIG_HOTPLUG_CPU
-/* This version can't take the spinlock. */
+/* This version can't take the spinlock, because it never returns */
+
+struct rtas_args rtas_stop_self_args = {
+	/* The token is initialized for real in setup_system() */
+	.token = RTAS_UNKNOWN_SERVICE,
+	.nargs = 0,
+	.nret = 1,
+	.rets = &rtas_stop_self_args.args[0],
+};
 
 void rtas_stop_self(void)
 {
-	struct rtas_args *rtas_args = &(get_paca()->xRtas);
+	struct rtas_args *rtas_args = &rtas_stop_self_args;
 
 	local_irq_disable();
 
-	rtas_args->token = rtas_token("stop-self");
 	BUG_ON(rtas_args->token == RTAS_UNKNOWN_SERVICE);
-	rtas_args->nargs = 0;
-	rtas_args->nret  = 1;
-	rtas_args->rets  = &(rtas_args->args[0]);
 
-	printk("%u %u Ready to die...\n",
+	printk("cpu %u (hwid %u) Ready to die...\n",
 	       smp_processor_id(), hard_smp_processor_id());
 	enter_rtas(__pa(rtas_args));
 
diff --git a/arch/ppc64/kernel/rtas_flash.c b/arch/ppc64/kernel/rtas_flash.c
index e9d21eb4e..aac9e9609 100644
--- a/arch/ppc64/kernel/rtas_flash.c
+++ b/arch/ppc64/kernel/rtas_flash.c
@@ -344,8 +344,8 @@ static void manage_flash(struct rtas_manage_flash_t *args_buf)
 	s32 rc;
 
 	while (1) {
-		rc = (s32) rtas_call(rtas_token("ibm,manage-flash-image"), 1, 
-				1, NULL, (long) args_buf->op);
+		rc = rtas_call(rtas_token("ibm,manage-flash-image"), 1, 
+			       1, NULL, args_buf->op);
 		if (rc == RTAS_RC_BUSY)
 			udelay(1);
 		else if (rtas_is_extended_busy(rc)) {
@@ -429,15 +429,15 @@ static void validate_flash(struct rtas_validate_flash_t *args_buf)
 {
 	int token = rtas_token("ibm,validate-flash-image");
 	unsigned int wait_time;
-	long update_results;
+	int update_results;
 	s32 rc;	
 
 	rc = 0;
 	while(1) {
 		spin_lock(&rtas_data_buf_lock);
 		memcpy(rtas_data_buf, args_buf->buf, VALIDATE_BUF_SIZE);
-		rc = (s32) rtas_call(token, 2, 2, &update_results, 
-				     __pa(rtas_data_buf), args_buf->buf_size);
+		rc = rtas_call(token, 2, 2, &update_results, 
+			       (u32) __pa(rtas_data_buf), args_buf->buf_size);
 		memcpy(args_buf->buf, rtas_data_buf, VALIDATE_BUF_SIZE);
 		spin_unlock(&rtas_data_buf_lock);
 			
@@ -451,7 +451,7 @@ static void validate_flash(struct rtas_validate_flash_t *args_buf)
 	}
 
 	args_buf->status = rc;
-	args_buf->update_results = (u32) update_results;
+	args_buf->update_results = update_results;
 }
 
 static int get_validate_flash_msg(struct rtas_validate_flash_t *args_buf, 
diff --git a/arch/ppc64/kernel/rtasd.c b/arch/ppc64/kernel/rtasd.c
index eea82c7b2..7538cea27 100644
--- a/arch/ppc64/kernel/rtasd.c
+++ b/arch/ppc64/kernel/rtasd.c
@@ -33,7 +33,7 @@
 #define DEBUG(A...)
 #endif
 
-static spinlock_t log_lock = SPIN_LOCK_UNLOCKED;
+static spinlock_t rtasd_log_lock = SPIN_LOCK_UNLOCKED;
 
 DECLARE_WAIT_QUEUE_HEAD(rtas_log_wait);
 
@@ -152,7 +152,7 @@ void pSeries_log_error(char *buf, unsigned int err_type, int fatal)
 	if (buf == NULL)
 		return;
 
-	spin_lock_irqsave(&log_lock, s);
+	spin_lock_irqsave(&rtasd_log_lock, s);
 
 	/* get length and increase count */
 	switch (err_type & ERR_TYPE_MASK) {
@@ -163,7 +163,7 @@ void pSeries_log_error(char *buf, unsigned int err_type, int fatal)
 		break;
 	case ERR_TYPE_KERNEL_PANIC:
 	default:
-		spin_unlock_irqrestore(&log_lock, s);
+		spin_unlock_irqrestore(&rtasd_log_lock, s);
 		return;
 	}
 
@@ -174,7 +174,7 @@ void pSeries_log_error(char *buf, unsigned int err_type, int fatal)
 	/* Check to see if we need to or have stopped logging */
 	if (fatal || no_more_logging) {
 		no_more_logging = 1;
-		spin_unlock_irqrestore(&log_lock, s);
+		spin_unlock_irqrestore(&rtasd_log_lock, s);
 		return;
 	}
 
@@ -199,12 +199,12 @@ void pSeries_log_error(char *buf, unsigned int err_type, int fatal)
 		else
 			rtas_log_start += 1;
 
-		spin_unlock_irqrestore(&log_lock, s);
+		spin_unlock_irqrestore(&rtasd_log_lock, s);
 		wake_up_interruptible(&rtas_log_wait);
 		break;
 	case ERR_TYPE_KERNEL_PANIC:
 	default:
-		spin_unlock_irqrestore(&log_lock, s);
+		spin_unlock_irqrestore(&rtasd_log_lock, s);
 		return;
 	}
 
@@ -247,24 +247,24 @@ static ssize_t rtas_log_read(struct file * file, char * buf,
 		return -ENOMEM;
 
 
-	spin_lock_irqsave(&log_lock, s);
+	spin_lock_irqsave(&rtasd_log_lock, s);
 	/* if it's 0, then we know we got the last one (the one in NVRAM) */
 	if (rtas_log_size == 0 && !no_more_logging)
 		nvram_clear_error_log();
-	spin_unlock_irqrestore(&log_lock, s);
+	spin_unlock_irqrestore(&rtasd_log_lock, s);
 
 
 	error = wait_event_interruptible(rtas_log_wait, rtas_log_size);
 	if (error)
 		goto out;
 
-	spin_lock_irqsave(&log_lock, s);
+	spin_lock_irqsave(&rtasd_log_lock, s);
 	offset = rtas_error_log_buffer_max * (rtas_log_start & LOG_NUMBER_MASK);
 	memcpy(tmp, &rtas_log_buf[offset], count);
 
 	rtas_log_start += 1;
 	rtas_log_size -= 1;
-	spin_unlock_irqrestore(&log_lock, s);
+	spin_unlock_irqrestore(&rtasd_log_lock, s);
 
 	error = copy_to_user(buf, tmp, count) ? -EFAULT : count;
 out:
@@ -364,7 +364,6 @@ static int rtasd(void *unused)
 	unsigned int err_type;
 	int cpu = 0;
 	int event_scan = rtas_token("event-scan");
-	cpumask_t all = CPU_MASK_ALL;
 	int rc;
 
 	daemonize("rtasd");
@@ -415,11 +414,11 @@ static int rtasd(void *unused)
 	}
 
 	lock_cpu_hotplug();
-	cpu = first_cpu_const(mk_cpumask_const(cpu_online_map));
+	cpu = first_cpu(cpu_online_map);
 	for (;;) {
 		set_cpus_allowed(current, cpumask_of_cpu(cpu));
 		do_event_scan(event_scan);
-		set_cpus_allowed(current, all);
+		set_cpus_allowed(current, CPU_MASK_ALL);
 
 		/* Drop hotplug lock, and sleep for a bit (at least
 		 * one second since some machines have problems if we
@@ -429,9 +428,9 @@ static int rtasd(void *unused)
 		schedule_timeout((HZ*60/rtas_event_scan_rate) / 2);
 		lock_cpu_hotplug();
 
-		cpu = next_cpu_const(cpu, mk_cpumask_const(cpu_online_map));
+		cpu = next_cpu(cpu, cpu_online_map);
 		if (cpu == NR_CPUS)
-			cpu = first_cpu_const(mk_cpumask_const(cpu_online_map));
+			cpu = first_cpu(cpu_online_map);
 	}
 
 error:
@@ -456,7 +455,7 @@ static int __init rtas_init(void)
 	else
 		printk(KERN_ERR "Failed to create error_log proc entry\n");
 
-	if (kernel_thread(rtasd, 0, CLONE_FS) < 0)
+	if (kernel_thread(rtasd, NULL, CLONE_FS) < 0)
 		printk(KERN_ERR "Failed to start RTAS daemon\n");
 
 	return 0;
diff --git a/arch/ppc64/kernel/rtc.c b/arch/ppc64/kernel/rtc.c
index eff800053..7bf41f3ca 100644
--- a/arch/ppc64/kernel/rtc.c
+++ b/arch/ppc64/kernel/rtc.c
@@ -40,6 +40,7 @@
 #include <asm/uaccess.h>
 #include <asm/system.h>
 #include <asm/time.h>
+#include <asm/rtas.h>
 
 #include <asm/iSeries/LparData.h>
 #include <asm/iSeries/mf.h>
@@ -55,9 +56,7 @@ extern int piranha_simulator;
  *	ioctls.
  */
 
-static loff_t rtc_llseek(struct file *file, loff_t offset, int origin);
-
-static ssize_t rtc_read(struct file *file, char *buf,
+static ssize_t rtc_read(struct file *file, char __user *buf,
 			size_t count, loff_t *ppos);
 
 static int rtc_ioctl(struct inode *inode, struct file *file,
@@ -80,12 +79,7 @@ static const unsigned char days_in_mo[] =
  *	Now all the various file operations that we export.
  */
 
-static loff_t rtc_llseek(struct file *file, loff_t offset, int origin)
-{
-	return -ESPIPE;
-}
-
-static ssize_t rtc_read(struct file *file, char *buf,
+static ssize_t rtc_read(struct file *file, char __user *buf,
 			size_t count, loff_t *ppos)
 {
 	return -EIO;
@@ -112,7 +106,7 @@ static int rtc_ioctl(struct inode *inode, struct file *file, unsigned int cmd,
 		if (!capable(CAP_SYS_TIME))
 			return -EACCES;
 
-		if (copy_from_user(&rtc_tm, (struct rtc_time*)arg,
+		if (copy_from_user(&rtc_tm, (struct rtc_time __user *)arg,
 				   sizeof(struct rtc_time)))
 			return -EFAULT;
 
@@ -146,7 +140,7 @@ static int rtc_ioctl(struct inode *inode, struct file *file, unsigned int cmd,
 	}
 	case RTC_EPOCH_READ:	/* Read the epoch.	*/
 	{
-		return put_user (epoch, (unsigned long *)arg);
+		return put_user (epoch, (unsigned long __user *)arg);
 	}
 	case RTC_EPOCH_SET:	/* Set the epoch.	*/
 	{
@@ -165,11 +159,12 @@ static int rtc_ioctl(struct inode *inode, struct file *file, unsigned int cmd,
 	default:
 		return -EINVAL;
 	}
-	return copy_to_user((void *)arg, &wtime, sizeof wtime) ? -EFAULT : 0;
+	return copy_to_user((void __user *)arg, &wtime, sizeof wtime) ? -EFAULT : 0;
 }
 
 static int rtc_open(struct inode *inode, struct file *file)
 {
+	nonseekable_open(inode, file);
 	return 0;
 }
 
@@ -183,7 +178,7 @@ static int rtc_release(struct inode *inode, struct file *file)
  */
 static struct file_operations rtc_fops = {
 	.owner =	THIS_MODULE,
-	.llseek =	rtc_llseek,
+	.llseek =	no_llseek,
 	.read =		rtc_read,
 	.ioctl =	rtc_ioctl,
 	.open =		rtc_open,
@@ -206,7 +201,7 @@ static int __init rtc_init(void)
 		return retval;
 
 #ifdef CONFIG_PROC_FS
-	if(create_proc_read_entry ("driver/rtc", 0, 0, rtc_read_proc, NULL) == NULL)
+	if (create_proc_read_entry ("driver/rtc", 0, NULL, rtc_read_proc, NULL) == NULL)
 		misc_deregister(&rtc_dev);
 		return -ENOMEM;
 #endif
@@ -346,13 +341,13 @@ void iSeries_get_boot_time(struct rtc_time *tm)
 #define RTAS_CLOCK_BUSY (-2)
 void pSeries_get_boot_time(struct rtc_time *rtc_tm)
 {
-	unsigned long ret[8];
+	int ret[8];
 	int error, wait_time;
 	unsigned long max_wait_tb;
 
 	max_wait_tb = __get_tb() + tb_ticks_per_usec * 1000 * MAX_RTC_WAIT;
 	do {
-		error = rtas_call(rtas_token("get-time-of-day"), 0, 8, (void *)&ret);
+		error = rtas_call(rtas_token("get-time-of-day"), 0, 8, ret);
 		if (error == RTAS_CLOCK_BUSY || rtas_is_extended_busy(error)) {
 			wait_time = rtas_extended_busy_delay_time(error);
 			/* This is boot time so we spin. */
@@ -381,13 +376,13 @@ void pSeries_get_boot_time(struct rtc_time *rtc_tm)
  */
 void pSeries_get_rtc_time(struct rtc_time *rtc_tm)
 {
-        unsigned long ret[8];
+        int ret[8];
 	int error, wait_time;
 	unsigned long max_wait_tb;
 
 	max_wait_tb = __get_tb() + tb_ticks_per_usec * 1000 * MAX_RTC_WAIT;
 	do {
-		error = rtas_call(rtas_token("get-time-of-day"), 0, 8, (void *)&ret);
+		error = rtas_call(rtas_token("get-time-of-day"), 0, 8, ret);
 		if (error == RTAS_CLOCK_BUSY || rtas_is_extended_busy(error)) {
 			if (in_interrupt()) {
 				printk(KERN_WARNING "error: reading clock would delay interrupt\n");
diff --git a/arch/ppc64/kernel/scanlog.c b/arch/ppc64/kernel/scanlog.c
index 60e755132..b61d90edd 100644
--- a/arch/ppc64/kernel/scanlog.c
+++ b/arch/ppc64/kernel/scanlog.c
@@ -49,7 +49,7 @@ static ssize_t scanlog_read(struct file *file, char *buf,
         struct inode * inode = file->f_dentry->d_inode;
 	struct proc_dir_entry *dp;
 	unsigned int *data;
-	unsigned long status;
+	int status;
 	unsigned long len, off;
 	unsigned int wait_time;
 
@@ -81,11 +81,11 @@ static ssize_t scanlog_read(struct file *file, char *buf,
 		spin_lock(&rtas_data_buf_lock);
 		memcpy(rtas_data_buf, data, RTAS_DATA_BUF_SIZE);
 		status = rtas_call(ibm_scan_log_dump, 2, 1, NULL,
-				   __pa(rtas_data_buf), count);
+				   (u32) __pa(rtas_data_buf), (u32) count);
 		memcpy(data, rtas_data_buf, RTAS_DATA_BUF_SIZE);
 		spin_unlock(&rtas_data_buf_lock);
 
-		DEBUG("status=%ld, data[0]=%x, data[1]=%x, data[2]=%x\n",
+		DEBUG("status=%d, data[0]=%x, data[1]=%x, data[2]=%x\n",
 		      status, data[0], data[1], data[2]);
 		switch (status) {
 		    case SCANLOG_COMPLETE:
@@ -118,7 +118,7 @@ static ssize_t scanlog_read(struct file *file, char *buf,
 				wait_time = ms / (1000000/HZ); /* round down is fine */
 				/* Fall through to sleep */
 			} else {
-				printk(KERN_ERR "scanlog: unknown error from rtas: %ld\n", status);
+				printk(KERN_ERR "scanlog: unknown error from rtas: %d\n", status);
 				return -EIO;
 			}
 		}
@@ -133,7 +133,7 @@ static ssize_t scanlog_write(struct file * file, const char * buf,
 			     size_t count, loff_t *ppos)
 {
 	char stkbuf[20];
-	unsigned long status;
+	int status;
 
 	if (count > 19) count = 19;
 	if (copy_from_user (stkbuf, buf, count)) {
@@ -144,8 +144,8 @@ static ssize_t scanlog_write(struct file * file, const char * buf,
 	if (buf) {
 		if (strncmp(stkbuf, "reset", 5) == 0) {
 			DEBUG("reset scanlog\n");
-			status = rtas_call(ibm_scan_log_dump, 2, 1, NULL, NULL, 0);
-			DEBUG("rtas returns %ld\n", status);
+			status = rtas_call(ibm_scan_log_dump, 2, 1, NULL, 0, 0);
+			DEBUG("rtas returns %d\n", status);
 		} else if (strncmp(stkbuf, "debugon", 7) == 0) {
 			printk(KERN_ERR "scanlog: debug on\n");
 			scanlog_debug = 1;
diff --git a/arch/ppc64/kernel/setup.c b/arch/ppc64/kernel/setup.c
index f13739566..dc090d425 100644
--- a/arch/ppc64/kernel/setup.c
+++ b/arch/ppc64/kernel/setup.c
@@ -44,7 +44,9 @@
 #include <asm/sections.h>
 #include <asm/btext.h>
 #include <asm/nvram.h>
+#include <asm/setup.h>
 #include <asm/system.h>
+#include <asm/rtas.h>
 
 extern unsigned long klimit;
 /* extern void *stab; */
@@ -82,7 +84,6 @@ unsigned long decr_overclock_proc0_set = 0;
 
 int powersave_nap;
 
-char saved_command_line[COMMAND_LINE_SIZE];
 unsigned char aux_device_present;
 
 void parse_cmd_line(unsigned long r3, unsigned long r4, unsigned long r5,
@@ -165,7 +166,7 @@ void setup_system(unsigned long r3, unsigned long r4, unsigned long r5,
 		  unsigned long r6, unsigned long r7)
 {
 #if defined(CONFIG_SMP) && defined(CONFIG_PPC_PSERIES)
-	unsigned int ret, i;
+	int ret, i;
 #endif
 
 #ifdef CONFIG_XMON_DEFAULT
@@ -233,12 +234,11 @@ void setup_system(unsigned long r3, unsigned long r4, unsigned long r5,
 #ifdef CONFIG_SMP
 		/* Start secondary threads on SMT systems */
 		for (i = 0; i < NR_CPUS; i++) {
-			if(cpu_available(i)  && !cpu_possible(i)) {
+			if (cpu_available(i) && !cpu_possible(i)) {
 				printk("%16.16x : starting thread\n", i);
-				rtas_call(rtas_token("start-cpu"), 3, 1, 
-					  (void *)&ret,
+				rtas_call(rtas_token("start-cpu"), 3, 1, &ret,
 					  get_hard_smp_processor_id(i), 
-					  *((unsigned long *)pseries_secondary_smp_init),
+					  (u32)*((unsigned long *)pseries_secondary_smp_init),
 					  i);
 				cpu_set(i, cpu_possible_map);
 				systemcfg->processorCount++;
@@ -255,6 +255,10 @@ void setup_system(unsigned long r3, unsigned long r4, unsigned long r5,
 	}
 #endif /* CONFIG_PPC_PMAC */
 
+#if defined(CONFIG_HOTPLUG_CPU) &&  !defined(CONFIG_PPC_PMAC)
+	rtas_stop_self_args.token = rtas_token("stop-self");
+#endif /* CONFIG_HOTPLUG_CPU && !CONFIG_PPC_PMAC */
+
 	/* Finish initializing the hash table (do the dynamic
 	 * patching for the fast-path hashtable.S code)
 	 */
@@ -631,7 +635,7 @@ void __init setup_arch(char **cmdline_p)
 	init_mm.brk = klimit;
 	
 	/* Save unparsed command line copy for /proc/cmdline */
-	strlcpy(saved_command_line, cmd_line, sizeof(saved_command_line));
+	strlcpy(saved_command_line, cmd_line, COMMAND_LINE_SIZE);
 	*cmdline_p = cmd_line;
 
 	irqstack_early_init();
@@ -699,7 +703,7 @@ int set_spread_lpevents( char * str )
 	unsigned long val = simple_strtoul( str, NULL, 0 );
 	if ( ( val > 0 ) && ( val <= NR_CPUS ) ) {
 		for ( i=1; i<val; ++i )
-			paca[i].lpQueuePtr = paca[0].lpQueuePtr;
+			paca[i].lpqueue_ptr = paca[0].lpqueue_ptr;
 		printk("lpevent processing spread over %ld processors\n", val);
 	}
 	else
diff --git a/arch/ppc64/kernel/signal.c b/arch/ppc64/kernel/signal.c
index ce066788c..8323d7355 100644
--- a/arch/ppc64/kernel/signal.c
+++ b/arch/ppc64/kernel/signal.c
@@ -131,8 +131,7 @@ static long setup_sigcontext(struct sigcontext __user *sc, struct pt_regs *regs,
 #endif
 	long err = 0;
 
-	if (regs->msr & MSR_FP)
-		giveup_fpu(current);
+	flush_fp_to_thread(current);
 
 	/* Make sure signal doesn't get spurrious FP exceptions */
 	current->thread.fpscr = 0;
@@ -141,9 +140,8 @@ static long setup_sigcontext(struct sigcontext __user *sc, struct pt_regs *regs,
 	err |= __put_user(v_regs, &sc->v_regs);
 
 	/* save altivec registers */
-	if (current->thread.used_vr) {		
-		if (regs->msr & MSR_VEC)
-			giveup_altivec(current);
+	if (current->thread.used_vr) {
+		flush_altivec_to_thread(current);
 		/* Copy 33 vec registers (vr0..31 and vscr) to the stack */
 		err |= __copy_to_user(v_regs, current->thread.vr, 33 * sizeof(vector128));
 		/* set MSR_VEC in the MSR value in the frame to indicate that sc->v_reg)
@@ -530,13 +528,13 @@ int do_signal(sigset_t *oldset, struct pt_regs *regs)
 		struct k_sigaction *ka = &current->sighand->action[signr-1];
 
 		/* Whee!  Actually deliver the signal.  */
-		if (regs->trap == 0x0C00)
+		if (TRAP(regs) == 0x0C00)
 			syscall_restart(regs, ka);
 		handle_signal(signr, ka, &info, oldset, regs);
 		return 1;
 	}
 
-	if (regs->trap == 0x0C00) {	/* System Call! */
+	if (TRAP(regs) == 0x0C00) {	/* System Call! */
 		if ((int)regs->result == -ERESTARTNOHAND ||
 		    (int)regs->result == -ERESTARTSYS ||
 		    (int)regs->result == -ERESTARTNOINTR) {
diff --git a/arch/ppc64/kernel/signal32.c b/arch/ppc64/kernel/signal32.c
index c8f6294a2..106f008af 100644
--- a/arch/ppc64/kernel/signal32.c
+++ b/arch/ppc64/kernel/signal32.c
@@ -130,11 +130,10 @@ static int save_user_regs(struct pt_regs *regs, struct mcontext32 __user *frame,
 {
 	elf_greg_t64 *gregs = (elf_greg_t64 *)regs;
 	int i, err = 0;
-	
-	/* Make sure floating point registers are stored in regs */ 
-	if (regs->msr & MSR_FP)
-		giveup_fpu(current);
-	
+
+	/* Make sure floating point registers are stored in regs */
+	flush_fp_to_thread(current);
+
 	/* save general and floating-point registers */
 	for (i = 0; i <= PT_RESULT; i ++)
 		err |= __put_user((unsigned int)gregs[i], &frame->mc_gregs[i]);
@@ -148,8 +147,7 @@ static int save_user_regs(struct pt_regs *regs, struct mcontext32 __user *frame,
 #ifdef CONFIG_ALTIVEC
 	/* save altivec registers */
 	if (current->thread.used_vr) {
-		if (regs->msr & MSR_VEC)
-			giveup_altivec(current);
+		flush_altivec_to_thread(current);
 		if (__copy_to_user(&frame->mc_vregs, current->thread.vr,
 				   ELF_NVRREG32 * sizeof(vector128)))
 			return 1;
@@ -300,12 +298,15 @@ long sys32_sigaction(int sig, struct old_sigaction32 __user *act,
 
 	if (act) {
 		compat_old_sigset_t mask;
+		compat_uptr_t handler, restorer;
 
-		if (get_user((long)new_ka.sa.sa_handler, &act->sa_handler) ||
-		    __get_user((long)new_ka.sa.sa_restorer, &act->sa_restorer) ||
+		if (get_user(handler, &act->sa_handler) ||
+		    __get_user(restorer, &act->sa_restorer) ||
 		    __get_user(new_ka.sa.sa_flags, &act->sa_flags) ||
 		    __get_user(mask, &act->sa_mask))
 			return -EFAULT;
+		new_ka.sa.sa_handler = compat_ptr(handler);
+		new_ka.sa.sa_restorer = compat_ptr(restorer);
 		siginitset(&new_ka.sa.sa_mask, mask);
 	}
 
@@ -356,7 +357,10 @@ long sys32_rt_sigaction(int sig, const struct sigaction32 __user *act,
 		return -EINVAL;
 
 	if (act) {
-		ret = get_user((long)new_ka.sa.sa_handler, &act->sa_handler);
+		compat_uptr_t handler;
+
+		ret = get_user(handler, &act->sa_handler);
+		new_ka.sa.sa_handler = compat_ptr(handler);
 		ret |= __copy_from_user(&set32, &act->sa_mask,
 					sizeof(compat_sigset_t));
 		sigset_from_compat(&new_ka.sa.sa_mask, &set32);
@@ -598,6 +602,7 @@ int sys32_sigaltstack(u32 __new, u32 __old, int r5,
 	int ret;
 	mm_segment_t old_fs;
 	unsigned long sp;
+	compat_uptr_t ss_sp;
 
 	/*
 	 * set sp to the user stack on entry to the system call
@@ -606,11 +611,13 @@ int sys32_sigaltstack(u32 __new, u32 __old, int r5,
 	sp = regs->gpr[1];
 
 	/* Put new stack info in local 64 bit stack struct */
-	if (newstack &&
-		(get_user((long)uss.ss_sp, &newstack->ss_sp) ||
-		 __get_user(uss.ss_flags, &newstack->ss_flags) ||
-		 __get_user(uss.ss_size, &newstack->ss_size)))
-		return -EFAULT; 
+	if (newstack) {
+		if (get_user(ss_sp, &newstack->ss_sp) ||
+		    __get_user(uss.ss_flags, &newstack->ss_flags) ||
+		    __get_user(uss.ss_size, &newstack->ss_size))
+			return -EFAULT;
+		uss.ss_sp = compat_ptr(ss_sp);
+	}
 
 	old_fs = get_fs();
 	set_fs(KERNEL_DS);
@@ -934,7 +941,7 @@ int do_signal32(sigset_t *oldset, struct pt_regs *regs)
 
 	ka = (signr == 0)? NULL: &current->sighand->action[signr-1];
 
-	if (regs->trap == 0x0C00		/* System Call! */
+	if (TRAP(regs) == 0x0C00		/* System Call! */
 	    && regs->ccr & 0x10000000		/* error signalled */
 	    && ((ret = regs->gpr[3]) == ERESTARTSYS
 		|| ret == ERESTARTNOHAND || ret == ERESTARTNOINTR
diff --git a/arch/ppc64/kernel/smp.c b/arch/ppc64/kernel/smp.c
index 7fa0e5a10..1f3003408 100644
--- a/arch/ppc64/kernel/smp.c
+++ b/arch/ppc64/kernel/smp.c
@@ -52,6 +52,7 @@
 #include <asm/xics.h>
 #include <asm/cputable.h>
 #include <asm/system.h>
+#include <asm/rtas.h>
 
 int smp_threads_ready;
 unsigned long cache_decay_ticks;
@@ -119,12 +120,10 @@ static void smp_iSeries_message_pass(int target, int msg)
 static int smp_iSeries_numProcs(void)
 {
 	unsigned np, i;
-	struct ItLpPaca * lpPaca;
 
 	np = 0;
         for (i=0; i < NR_CPUS; ++i) {
-                lpPaca = paca[i].xLpPacaPtr;
-                if ( lpPaca->xDynProcStatus < 2 ) {
+                if (paca[i].lppaca.xDynProcStatus < 2) {
 			cpu_set(i, cpu_available_map);
 			cpu_set(i, cpu_possible_map);
 			cpu_set(i, cpu_present_at_boot);
@@ -138,11 +137,9 @@ static int smp_iSeries_probe(void)
 {
 	unsigned i;
 	unsigned np = 0;
-	struct ItLpPaca *lpPaca;
 
 	for (i=0; i < NR_CPUS; ++i) {
-		lpPaca = paca[i].xLpPacaPtr;
-		if (lpPaca->xDynProcStatus < 2) {
+		if (paca[i].lppaca.xDynProcStatus < 2) {
 			/*paca[i].active = 1;*/
 			++np;
 		}
@@ -153,21 +150,18 @@ static int smp_iSeries_probe(void)
 
 static void smp_iSeries_kick_cpu(int nr)
 {
-	struct ItLpPaca *lpPaca;
-
 	BUG_ON(nr < 0 || nr >= NR_CPUS);
 
 	/* Verify that our partition has a processor nr */
-	lpPaca = paca[nr].xLpPacaPtr;
-	if (lpPaca->xDynProcStatus >= 2)
+	if (paca[nr].lppaca.xDynProcStatus >= 2)
 		return;
 
 	/* The processor is currently spinning, waiting
-	 * for the xProcStart field to become non-zero
-	 * After we set xProcStart, the processor will
+	 * for the cpu_start field to become non-zero
+	 * After we set cpu_start, the processor will
 	 * continue on to secondary_start in iSeries_head.S
 	 */
-	paca[nr].xProcStart = 1;
+	paca[nr].cpu_start = 1;
 }
 
 static void __devinit smp_iSeries_setup_cpu(int nr)
@@ -241,7 +235,7 @@ static void __devinit smp_openpic_setup_cpu(int cpu)
  */
 static int query_cpu_stopped(unsigned int pcpu)
 {
-	long cpu_status;
+	int cpu_status;
 	int status, qcss_tok;
 
 	qcss_tok = rtas_token("query-cpu-stopped-state");
@@ -296,7 +290,7 @@ void __cpu_die(unsigned int cpu)
 	 * done here.  Change isolate state to Isolate and
 	 * change allocation-state to Unusable.
 	 */
-	paca[cpu].xProcStart = 0;
+	paca[cpu].cpu_start = 0;
 
 	/* So we can recognize if it fails to come up next time. */
 	cpu_callin_map[cpu] = 0;
@@ -306,6 +300,10 @@ void __cpu_die(unsigned int cpu)
 void cpu_die(void)
 {
 	local_irq_disable();
+	/* Some hardware requires clearing the CPPR, while other hardware does not
+	 * it is safe either way
+	 */
+	pSeriesLP_cppr_info(0, 0);
 	rtas_stop_self();
 	/* Should never get here... */
 	BUG();
@@ -390,12 +388,10 @@ static inline int __devinit smp_startup_cpu(unsigned int lcpu)
 	}
 
 	/* Fixup atomic count: it exited inside IRQ handler. */
-	paca[lcpu].xCurrent->thread_info->preempt_count	= 0;
-	/* Fixup SLB round-robin so next segment (kernel) goes in segment 0 */
-	paca[lcpu].xStab_data.next_round_robin = 0;
+	paca[lcpu].__current->thread_info->preempt_count	= 0;
 
 	/* At boot this is done in prom.c. */
-	paca[lcpu].xHwProcNum = pcpu;
+	paca[lcpu].hw_cpu_id = pcpu;
 
 	status = rtas_call(rtas_token("start-cpu"), 3, 1, NULL,
 			   pcpu, start_here, lcpu);
@@ -428,7 +424,11 @@ static inline void look_for_more_cpus(void)
 	}
 
 	maxcpus = ireg[num_addr_cell + num_size_cell];
-	/* DRENG need to account for threads here too */
+
+	/* Double maxcpus for processors which have SMT capability */
+	if (cur_cpu_spec->cpu_features & CPU_FTR_SMT)
+		maxcpus *= 2;
+
 
 	if (maxcpus > NR_CPUS) {
 		printk(KERN_WARNING
@@ -460,12 +460,12 @@ static void smp_pSeries_kick_cpu(int nr)
 	if (!smp_startup_cpu(nr))
 		return;
 
-	/* The processor is currently spinning, waiting
-	 * for the xProcStart field to become non-zero
-	 * After we set xProcStart, the processor will
-	 * continue on to secondary_start
+	/*
+	 * The processor is currently spinning, waiting for the
+	 * cpu_start field to become non-zero After we set cpu_start,
+	 * the processor will continue on to secondary_start
 	 */
-	paca[nr].xProcStart = 1;
+	paca[nr].cpu_start = 1;
 }
 #endif /* CONFIG_PPC_PSERIES */
 
@@ -490,10 +490,8 @@ void vpa_init(int cpu)
 	unsigned long flags;
 
 	/* Register the Virtual Processor Area (VPA) */
-	printk(KERN_INFO "register_vpa: cpu 0x%x\n", cpu);
 	flags = 1UL << (63 - 18);
-	paca[cpu].xLpPaca.xSLBCount = 64; /* SLB restore highwater mark */
-	register_vpa(flags, cpu, __pa((unsigned long)&(paca[cpu].xLpPaca))); 
+	register_vpa(flags, cpu, __pa((unsigned long)&(paca[cpu].lppaca)));
 }
 
 static inline void smp_xics_do_message(int cpu, int msg)
@@ -723,7 +721,7 @@ int smp_call_function (void (*func) (void *info), void *info, int nonatomic,
 			printk("smp_call_function on cpu %d: other cpus not "
 			       "responding (%d)\n", smp_processor_id(),
 			       atomic_read(&data.started));
-			debugger(0);
+			debugger(NULL);
 			goto out;
 		}
 	}
@@ -738,7 +736,7 @@ int smp_call_function (void (*func) (void *info), void *info, int nonatomic,
 				       smp_processor_id(),
 				       atomic_read(&data.finished),
 				       atomic_read(&data.started));
-				debugger(0);
+				debugger(NULL);
 				goto out;
 			}
 		}
@@ -816,7 +814,7 @@ static void __init smp_create_idle(unsigned int cpu)
 	init_idle(p, cpu);
 	unhash_process(p);
 
-	paca[cpu].xCurrent = p;
+	paca[cpu].__current = p;
 	current_set[cpu] = p->thread_info;
 }
 
@@ -868,7 +866,7 @@ void __devinit smp_prepare_boot_cpu(void)
 	/* cpu_possible is set up in prom.c */
 	cpu_set(boot_cpuid, cpu_online_map);
 
-	paca[boot_cpuid].xCurrent = current;
+	paca[boot_cpuid].__current = current;
 	current_set[boot_cpuid] = current->thread_info;
 }
 
@@ -893,8 +891,8 @@ int __devinit __cpu_up(unsigned int cpu)
 
 		tmp = &stab_array[PAGE_SIZE * cpu];
 		memset(tmp, 0, PAGE_SIZE); 
-		paca[cpu].xStab_data.virt = (unsigned long)tmp;
-		paca[cpu].xStab_data.real = virt_to_abs(tmp);
+		paca[cpu].stab_addr = (unsigned long)tmp;
+		paca[cpu].stab_real = virt_to_abs(tmp);
 	}
 
 	/* The information for processor bringup must
@@ -935,7 +933,11 @@ int __devinit __cpu_up(unsigned int cpu)
 
 	if (smp_ops->give_timebase)
 		smp_ops->give_timebase();
-	cpu_set(cpu, cpu_online_map);
+
+	/* Wait until cpu puts itself in the online map */
+	while (!cpu_online(cpu))
+		cpu_relax();
+
 	return 0;
 }
 
@@ -956,8 +958,6 @@ int __devinit start_secondary(void *unused)
 	if (smp_ops->take_timebase)
 		smp_ops->take_timebase();
 
-	get_paca()->yielded = 0;
-
 #ifdef CONFIG_PPC_PSERIES
 	if (cur_cpu_spec->firmware_features & FW_FEATURE_SPLPAR) {
 		vpa_init(cpu); 
@@ -973,6 +973,10 @@ int __devinit start_secondary(void *unused)
 #endif
 #endif
 
+	spin_lock(&call_lock);
+	cpu_set(cpu, cpu_online_map);
+	spin_unlock(&call_lock);
+
 	local_irq_enable();
 
 	return cpu_idle(NULL);
diff --git a/arch/ppc64/kernel/stab.c b/arch/ppc64/kernel/stab.c
index 061890449..3eea165b2 100644
--- a/arch/ppc64/kernel/stab.c
+++ b/arch/ppc64/kernel/stab.c
@@ -20,26 +20,10 @@
 #include <asm/naca.h>
 #include <asm/cputable.h>
 
-static int make_ste(unsigned long stab, unsigned long esid, unsigned long vsid);
-static void make_slbe(unsigned long esid, unsigned long vsid, int large,
-		      int kernel_segment);
+static int make_ste(unsigned long stab, unsigned long esid,
+		    unsigned long vsid);
 
-static inline void slb_add_bolted(void)
-{
-#ifndef CONFIG_PPC_ISERIES
-	unsigned long esid = GET_ESID(VMALLOCBASE);
-	unsigned long vsid = get_kernel_vsid(VMALLOCBASE);
-
-	WARN_ON(!irqs_disabled());
-
-	/*
-	 * Bolt in the first vmalloc segment. Since modules end
-	 * up there it gets hit very heavily.
-	 */
-	get_paca()->xStab_data.next_round_robin = 1;
-	make_slbe(esid, vsid, 0, 1);
-#endif
-}
+void slb_initialize(void);
 
 /*
  * Build an entry for the base kernel segment and put it into
@@ -48,32 +32,13 @@ static inline void slb_add_bolted(void)
  */
 void stab_initialize(unsigned long stab)
 {
-	unsigned long esid, vsid; 
-	int seg0_largepages = 0;
-
-	esid = GET_ESID(KERNELBASE);
-	vsid = get_kernel_vsid(esid << SID_SHIFT); 
-
-	if (cur_cpu_spec->cpu_features & CPU_FTR_16M_PAGE)
-		seg0_largepages = 1;
+	unsigned long vsid = get_kernel_vsid(KERNELBASE);
 
 	if (cur_cpu_spec->cpu_features & CPU_FTR_SLB) {
-		/* Invalidate the entire SLB & all the ERATS */
-#ifdef CONFIG_PPC_ISERIES
-		asm volatile("isync; slbia; isync":::"memory");
-#else
-		asm volatile("isync":::"memory");
-		asm volatile("slbmte  %0,%0"::"r" (0) : "memory");
-		asm volatile("isync; slbia; isync":::"memory");
-		get_paca()->xStab_data.next_round_robin = 0;
-		make_slbe(esid, vsid, seg0_largepages, 1);
-		asm volatile("isync":::"memory");
-#endif
-
-		slb_add_bolted();
+		slb_initialize();
 	} else {
 		asm volatile("isync; slbia; isync":::"memory");
-		make_ste(stab, esid, vsid);
+		make_ste(stab, GET_ESID(KERNELBASE), vsid);
 
 		/* Order update */
 		asm volatile("sync":::"memory"); 
@@ -129,7 +94,7 @@ static int make_ste(unsigned long stab, unsigned long esid, unsigned long vsid)
 	 * Could not find empty entry, pick one with a round robin selection.
 	 * Search all entries in the two groups.
 	 */
-	castout_entry = get_paca()->xStab_data.next_round_robin;
+	castout_entry = get_paca()->stab_rr;
 	for (i = 0; i < 16; i++) {
 		if (castout_entry < 8) {
 			global_entry = (esid & 0x1f) << 3;
@@ -148,7 +113,7 @@ static int make_ste(unsigned long stab, unsigned long esid, unsigned long vsid)
 		castout_entry = (castout_entry + 1) & 0xf;
 	}
 
-	get_paca()->xStab_data.next_round_robin = (castout_entry + 1) & 0xf;
+	get_paca()->stab_rr = (castout_entry + 1) & 0xf;
 
 	/* Modify the old entry to the new value. */
 
@@ -181,7 +146,7 @@ static inline void __ste_allocate(unsigned long esid, unsigned long vsid)
 	unsigned long offset;
 	int region_id = REGION_ID(esid << SID_SHIFT);
 
-	stab_entry = make_ste(get_paca()->xStab_data.virt, esid, vsid);
+	stab_entry = make_ste(get_paca()->stab_addr, esid, vsid);
 
 	if (region_id != USER_REGION_ID)
 		return;
@@ -275,7 +240,7 @@ static void preload_stab(struct task_struct *tsk, struct mm_struct *mm)
 /* Flush all user entries from the segment table of the current processor. */
 void flush_stab(struct task_struct *tsk, struct mm_struct *mm)
 {
-	STE *stab = (STE *) get_paca()->xStab_data.virt;
+	STE *stab = (STE *) get_paca()->stab_addr;
 	STE *ste;
 	unsigned long offset = __get_cpu_var(stab_cache_ptr);
 
@@ -314,229 +279,3 @@ void flush_stab(struct task_struct *tsk, struct mm_struct *mm)
 
 	preload_stab(tsk, mm);
 }
-
-/*
- * SLB stuff
- */
-
-/*
- * Create a segment buffer entry for the given esid/vsid pair.
- *
- * NOTE: A context syncronising instruction is required before and after
- * this, in the common case we use exception entry and rfid.
- */
-static void make_slbe(unsigned long esid, unsigned long vsid, int large,
-		      int kernel_segment)
-{
-	unsigned long entry, castout_entry;
-	union {
-		unsigned long word0;
-		slb_dword0    data;
-	} esid_data;
-	union {
-		unsigned long word0;
-		slb_dword1    data;
-	} vsid_data;
-	struct paca_struct *lpaca = get_paca();
-
-	/*
-	 * We take the next entry, round robin. Previously we tried
-	 * to find a free slot first but that took too long. Unfortunately
-	 * we dont have any LRU information to help us choose a slot.
-	 */
-
-	/* 
-	 * Never cast out the segment for our kernel stack. Since we
-	 * dont invalidate the ERAT we could have a valid translation
-	 * for the kernel stack during the first part of exception exit 
-	 * which gets invalidated due to a tlbie from another cpu at a
-	 * non recoverable point (after setting srr0/1) - Anton
-	 *
-	 * paca Ksave is always valid (even when on the interrupt stack)
-	 * so we use that.
-	 */
-	castout_entry = lpaca->xStab_data.next_round_robin;
-	do {
-		entry = castout_entry;
-		castout_entry++; 
-		/*
-		 * We bolt in the first kernel segment and the first
-		 * vmalloc segment.
-		 */
-		if (castout_entry >= SLB_NUM_ENTRIES)
-			castout_entry = 2;
-		asm volatile("slbmfee  %0,%1" : "=r" (esid_data) : "r" (entry));
-	} while (esid_data.data.v &&
-		 esid_data.data.esid == GET_ESID(lpaca->xKsave));
-
-	lpaca->xStab_data.next_round_robin = castout_entry;
-
-	/* slbie not needed as the previous mapping is still valid. */
-
-	/* 
-	 * Write the new SLB entry.
-	 */
-	vsid_data.word0 = 0;
-	vsid_data.data.vsid = vsid;
-	vsid_data.data.kp = 1;
-	if (large)
-		vsid_data.data.l = 1;
-	if (kernel_segment)
-		vsid_data.data.c = 1;
-	else
-		vsid_data.data.ks = 1;
-
-	esid_data.word0 = 0;
-	esid_data.data.esid = esid;
-	esid_data.data.v = 1;
-	esid_data.data.index = entry;
-
-	/*
-	 * No need for an isync before or after this slbmte. The exception
-	 * we enter with and the rfid we exit with are context synchronizing.
-	 */
-	asm volatile("slbmte  %0,%1" : : "r" (vsid_data), "r" (esid_data)); 
-}
-
-static inline void __slb_allocate(unsigned long esid, unsigned long vsid,
-				  mm_context_t context)
-{
-	int large = 0;
-	int region_id = REGION_ID(esid << SID_SHIFT);
-	unsigned long offset;
-
-	if (cur_cpu_spec->cpu_features & CPU_FTR_16M_PAGE) {
-		if (region_id == KERNEL_REGION_ID)
-			large = 1;
-		else if (region_id == USER_REGION_ID)
-			large = in_hugepage_area(context, esid << SID_SHIFT);
-	}
-
-	make_slbe(esid, vsid, large, region_id != USER_REGION_ID);
-
-	if (region_id != USER_REGION_ID)
-		return;
-
-	offset = __get_cpu_var(stab_cache_ptr);
-	if (offset < NR_STAB_CACHE_ENTRIES)
-		__get_cpu_var(stab_cache[offset++]) = esid;
-	else
-		offset = NR_STAB_CACHE_ENTRIES+1;
-	__get_cpu_var(stab_cache_ptr) = offset;
-}
-
-/*
- * Allocate a segment table entry for the given ea.
- */
-int slb_allocate(unsigned long ea)
-{
-	unsigned long vsid, esid;
-	mm_context_t context;
-
-	/* Check for invalid effective addresses. */
-	if (unlikely(!IS_VALID_EA(ea)))
-		return 1;
-
-	/* Kernel or user address? */
-	if (REGION_ID(ea) >= KERNEL_REGION_ID) {
-		context = KERNEL_CONTEXT(ea);
-		vsid = get_kernel_vsid(ea);
-	} else {
-		if (unlikely(!current->mm))
-			return 1;
-
-		context = current->mm->context;
-		vsid = get_vsid(context.id, ea);
-	}
-
-	esid = GET_ESID(ea);
-#ifndef CONFIG_PPC_ISERIES
-	BUG_ON((esid << SID_SHIFT) == VMALLOCBASE);
-#endif
-	__slb_allocate(esid, vsid, context);
-
-	return 0;
-}
-
-/*
- * preload some userspace segments into the SLB.
- */
-static void preload_slb(struct task_struct *tsk, struct mm_struct *mm)
-{
-	unsigned long pc = KSTK_EIP(tsk);
-	unsigned long stack = KSTK_ESP(tsk);
-	unsigned long unmapped_base;
-	unsigned long pc_esid = GET_ESID(pc);
-	unsigned long stack_esid = GET_ESID(stack);
-	unsigned long unmapped_base_esid;
-	unsigned long vsid;
-
-	if (test_tsk_thread_flag(tsk, TIF_32BIT))
-		unmapped_base = TASK_UNMAPPED_BASE_USER32;
-	else
-		unmapped_base = TASK_UNMAPPED_BASE_USER64;
-
-	unmapped_base_esid = GET_ESID(unmapped_base);
-
-	if (!IS_VALID_EA(pc) || (REGION_ID(pc) >= KERNEL_REGION_ID))
-		return;
-	vsid = get_vsid(mm->context.id, pc);
-	__slb_allocate(pc_esid, vsid, mm->context);
-
-	if (pc_esid == stack_esid)
-		return;
-
-	if (!IS_VALID_EA(stack) || (REGION_ID(stack) >= KERNEL_REGION_ID))
-		return;
-	vsid = get_vsid(mm->context.id, stack);
-	__slb_allocate(stack_esid, vsid, mm->context);
-
-	if (pc_esid == unmapped_base_esid || stack_esid == unmapped_base_esid)
-		return;
-
-	if (!IS_VALID_EA(unmapped_base) ||
-	    (REGION_ID(unmapped_base) >= KERNEL_REGION_ID))
-		return;
-	vsid = get_vsid(mm->context.id, unmapped_base);
-	__slb_allocate(unmapped_base_esid, vsid, mm->context);
-}
-
-/* Flush all user entries from the segment table of the current processor. */
-void flush_slb(struct task_struct *tsk, struct mm_struct *mm)
-{
-	unsigned long offset = __get_cpu_var(stab_cache_ptr);
-	union {
-		unsigned long word0;
-		slb_dword0 data;
-	} esid_data;
-
-	if (offset <= NR_STAB_CACHE_ENTRIES) {
-		int i;
-		asm volatile("isync" : : : "memory");
-		for (i = 0; i < offset; i++) {
-			esid_data.word0 = 0;
-			esid_data.data.esid = __get_cpu_var(stab_cache[i]);
-			BUG_ON(esid_data.data.esid == GET_ESID(VMALLOCBASE));
-			asm volatile("slbie %0" : : "r" (esid_data));
-		}
-		asm volatile("isync" : : : "memory");
-	} else {
-		asm volatile("isync; slbia; isync" : : : "memory");
-		slb_add_bolted();
-	}
-
-	/* Workaround POWER5 < DD2.1 issue */
-	if (offset == 1 || offset > NR_STAB_CACHE_ENTRIES) {
-		/* 
-		 * flush segment in EEH region, we dont normally access
-		 * addresses in this region.
-		 */
-		esid_data.word0 = 0;
-		esid_data.data.esid = EEH_REGION_ID;
-		asm volatile("slbie %0" : : "r" (esid_data));
-	}
-
-	__get_cpu_var(stab_cache_ptr) = 0;
-
-	preload_slb(tsk, mm);
-}
diff --git a/arch/ppc64/kernel/sys_ppc32.c b/arch/ppc64/kernel/sys_ppc32.c
index b518b9a03..376dc4a06 100644
--- a/arch/ppc64/kernel/sys_ppc32.c
+++ b/arch/ppc64/kernel/sys_ppc32.c
@@ -618,12 +618,8 @@ long sys32_execve(unsigned long a0, unsigned long a1, unsigned long a2,
 	error = PTR_ERR(filename);
 	if (IS_ERR(filename))
 		goto out;
-	if (regs->msr & MSR_FP)
-		giveup_fpu(current);
-#ifdef CONFIG_ALTIVEC
-	if (regs->msr & MSR_VEC)
-		giveup_altivec(current);
-#endif /* CONFIG_ALTIVEC */
+	flush_fp_to_thread(current);
+	flush_altivec_to_thread(current);
 
 	error = compat_do_execve(filename, compat_ptr(a1), compat_ptr(a2), regs);
 
diff --git a/arch/ppc64/kernel/syscalls.c b/arch/ppc64/kernel/syscalls.c
index 4ae0825ee..930b93f3c 100644
--- a/arch/ppc64/kernel/syscalls.c
+++ b/arch/ppc64/kernel/syscalls.c
@@ -237,5 +237,19 @@ asmlinkage time_t sys64_time(time_t __user * tloc)
 	return secs;
 }
 
+void do_show_syscall(unsigned long r3, unsigned long r4, unsigned long r5,
+		     unsigned long r6, unsigned long r7, unsigned long r8,
+		     struct pt_regs *regs)
+{
+	printk("syscall %ld(%lx, %lx, %lx, %lx, %lx, %lx) regs=%p current=%p"
+	       " cpu=%d\n", regs->gpr[0], r3, r4, r5, r6, r7, r8, regs,
+	       current, smp_processor_id());
+}
+
+void do_show_syscall_exit(unsigned long r3)
+{
+	printk(" -> %lx, current=%p cpu=%d\n", r3, current, smp_processor_id());
+}
+
 /* Only exists on P-series. */
 cond_syscall(ppc_rtas);
diff --git a/arch/ppc64/kernel/sysfs.c b/arch/ppc64/kernel/sysfs.c
index dcb1097ce..41b34932f 100644
--- a/arch/ppc64/kernel/sysfs.c
+++ b/arch/ppc64/kernel/sysfs.c
@@ -156,7 +156,7 @@ void ppc64_enable_pmcs(void)
 
 	/* instruct hypervisor to maintain PMCs */
 	if (cur_cpu_spec->firmware_features & FW_FEATURE_SPLPAR) {
-		char *ptr = (char *)&paca[smp_processor_id()].xLpPaca;
+		char *ptr = (char *)&paca[smp_processor_id()].lppaca;
 		ptr[0xBB] = 1;
 	}
 
@@ -208,8 +208,8 @@ static ssize_t show_##NAME(struct sys_device *dev, char *buf) \
 	unsigned long val = run_on_cpu(cpu->sysdev.id, read_##NAME, 0); \
 	return sprintf(buf, "%lx\n", val); \
 } \
-static ssize_t store_##NAME(struct sys_device *dev, const char *buf, \
-			    size_t count) \
+static ssize_t __attribute_used__ \
+	store_##NAME(struct sys_device *dev, const char *buf, size_t count) \
 { \
 	struct cpu *cpu = container_of(dev, struct cpu, sysdev); \
 	unsigned long val; \
@@ -325,6 +325,16 @@ static int __init topology_init(void)
 #ifdef CONFIG_NUMA
 		parent = &node_devices[cpu_to_node(cpu)];
 #endif
+		/*
+		 * For now, we just see if the system supports making
+		 * the RTAS calls for CPU hotplug.  But, there may be a
+		 * more comprehensive way to do this for an individual
+		 * CPU.  For instance, the boot cpu might never be valid
+		 * for hotplugging.
+		 */
+		if (systemcfg->platform != PLATFORM_PSERIES_LPAR)
+			c->no_control = 1;
+
 		register_cpu(c, cpu, parent);
 
 		register_cpu_pmc(&c->sysdev);
diff --git a/arch/ppc64/kernel/time.c b/arch/ppc64/kernel/time.c
index 33229ac0a..64844df4a 100644
--- a/arch/ppc64/kernel/time.c
+++ b/arch/ppc64/kernel/time.c
@@ -56,6 +56,7 @@
 #include <asm/cache.h>
 #include <asm/machdep.h>
 #ifdef CONFIG_PPC_ISERIES
+#include <asm/iSeries/ItLpQueue.h>
 #include <asm/iSeries/HvCallXm.h>
 #endif
 #include <asm/uaccess.h>
@@ -97,7 +98,7 @@ unsigned long tb_to_ns_shift;
 struct gettimeofday_struct do_gtod;
 
 extern unsigned long wall_jiffies;
-extern unsigned long lpEvent_count;
+extern unsigned long lpevent_count;
 extern int smp_tb_synchronized;
 
 void ppc_adjtimex(void);
@@ -275,7 +276,7 @@ int timer_interrupt(struct pt_regs * regs)
 	ppc64_do_profile(regs);
 #endif
 
-	lpaca->xLpPaca.xIntDword.xFields.xDecrInt = 0;
+	lpaca->lppaca.xIntDword.xFields.xDecrInt = 0;
 
 	while (lpaca->next_jiffy_update_tb <= (cur_tb = get_tb())) {
 
@@ -302,9 +303,9 @@ int timer_interrupt(struct pt_regs * regs)
 
 #ifdef CONFIG_PPC_ISERIES
 	{
-		struct ItLpQueue *lpq = lpaca->lpQueuePtr;
+		struct ItLpQueue *lpq = lpaca->lpqueue_ptr;
 		if (lpq && ItLpQueue_isLpIntPending(lpq))
-			lpEvent_count += ItLpQueue_process(lpq, regs);
+			lpevent_count += ItLpQueue_process(lpq, regs);
 	}
 #endif
 
diff --git a/arch/ppc64/kernel/traps.c b/arch/ppc64/kernel/traps.c
index c941b796a..5f70f7bc1 100644
--- a/arch/ppc64/kernel/traps.c
+++ b/arch/ppc64/kernel/traps.c
@@ -36,6 +36,7 @@
 #include <asm/io.h>
 #include <asm/processor.h>
 #include <asm/ppcdebug.h>
+#include <asm/rtas.h>
 
 #ifdef CONFIG_PPC_PSERIES
 /* This is true if we are using the firmware NMI handler (typically LPAR) */
@@ -172,9 +173,9 @@ static struct rtas_error_log *FWNMI_get_errinfo(struct pt_regs *regs)
  */
 static void FWNMI_release_errinfo(void)
 {
-	unsigned long ret = rtas_call(rtas_token("ibm,nmi-interlock"), 0, 1, NULL);
+	int ret = rtas_call(rtas_token("ibm,nmi-interlock"), 0, 1, NULL);
 	if (ret != 0)
-		printk("FWNMI: nmi-interlock failed: %ld\n", ret);
+		printk("FWNMI: nmi-interlock failed: %d\n", ret);
 }
 #endif
 
@@ -229,7 +230,7 @@ static int recover_mce(struct pt_regs *regs, struct rtas_error_log err)
 		info.si_errno = 0;
 		/* XXX something better for ECC error? */
 		info.si_code = BUS_ADRERR;
-		info.si_addr = (void *)regs->nip;
+		info.si_addr = (void __user *)regs->nip;
 		printk(KERN_ERR "MCE: uncorrectable ecc error for pid %d\n",
 		       current->pid);
 		_exception(SIGBUS, &info, regs);
@@ -285,7 +286,7 @@ UnknownException(struct pt_regs *regs)
 	info.si_signo = SIGTRAP;
 	info.si_errno = 0;
 	info.si_code = 0;
-	info.si_addr = 0;
+	info.si_addr = NULL;
 	_exception(SIGTRAP, &info, regs);	
 }
 
@@ -299,7 +300,7 @@ InstructionBreakpointException(struct pt_regs *regs)
 	info.si_signo = SIGTRAP;
 	info.si_errno = 0;
 	info.si_code = TRAP_BRKPT;
-	info.si_addr = (void *)regs->nip;
+	info.si_addr = (void __user *)regs->nip;
 	_exception(SIGTRAP, &info, regs);
 }
 
@@ -308,8 +309,7 @@ static void parse_fpe(struct pt_regs *regs)
 	siginfo_t info;
 	unsigned long fpscr;
 
-	if (regs->msr & MSR_FP)
-		giveup_fpu(current);
+	flush_fp_to_thread(current);
 
 	fpscr = current->thread.fpscr;
 
@@ -338,7 +338,7 @@ static void parse_fpe(struct pt_regs *regs)
 
 	info.si_signo = SIGFPE;
 	info.si_errno = 0;
-	info.si_addr = (void *)regs->nip;
+	info.si_addr = (void __user *)regs->nip;
 	_exception(SIGFPE, &info, regs);
 }
 
@@ -407,7 +407,7 @@ ProgramCheckException(struct pt_regs *regs)
 		info.si_signo = SIGILL;
 		info.si_errno = 0;
 		info.si_code = ILL_PRVOPC;
-		info.si_addr = (void *)regs->nip;
+		info.si_addr = (void __user *)regs->nip;
 		_exception(SIGILL, &info, regs);
 	} else if (regs->msr & 0x20000) {
 		/* trap exception */
@@ -422,7 +422,7 @@ ProgramCheckException(struct pt_regs *regs)
 		info.si_signo = SIGTRAP;
 		info.si_errno = 0;
 		info.si_code = TRAP_BRKPT;
-		info.si_addr = (void *)regs->nip;
+		info.si_addr = (void __user *)regs->nip;
 		_exception(SIGTRAP, &info, regs);
 	} else {
 		/* Illegal instruction */
@@ -430,7 +430,7 @@ ProgramCheckException(struct pt_regs *regs)
 		info.si_signo = SIGILL;
 		info.si_errno = 0;
 		info.si_code = ILL_ILLTRP;
-		info.si_addr = (void *)regs->nip;
+		info.si_addr = (void __user *)regs->nip;
 		_exception(SIGILL, &info, regs);
 	}
 }
@@ -442,8 +442,22 @@ void KernelFPUnavailableException(struct pt_regs *regs)
 	die("Unrecoverable FP Unavailable Exception", regs, SIGABRT);
 }
 
-void KernelAltivecUnavailableException(struct pt_regs *regs)
+void AltivecUnavailableException(struct pt_regs *regs)
 {
+#ifndef CONFIG_ALTIVEC
+	if (user_mode(regs)) {
+		/* A user program has executed an altivec instruction,
+		   but this kernel doesn't support altivec. */
+		siginfo_t info;
+
+		memset(&info, 0, sizeof(info));
+		info.si_signo = SIGILL;
+		info.si_code = ILL_ILLOPC;
+		info.si_addr = (void *) regs->nip;
+		_exception(SIGILL, &info, regs);
+		return;
+	}
+#endif
 	printk(KERN_EMERG "Unrecoverable VMX/Altivec Unavailable Exception "
 			  "%lx at %lx\n", regs->trap, regs->nip);
 	die("Unrecoverable VMX/Altivec Unavailable Exception", regs, SIGABRT);
@@ -462,7 +476,7 @@ SingleStepException(struct pt_regs *regs)
 	info.si_signo = SIGTRAP;
 	info.si_errno = 0;
 	info.si_code = TRAP_TRACE;
-	info.si_addr = (void *)regs->nip;
+	info.si_addr = (void __user *)regs->nip;
 	_exception(SIGTRAP, &info, regs);	
 }
 
@@ -510,7 +524,7 @@ AlignmentException(struct pt_regs *regs)
 			info.si_signo = SIGSEGV;
 			info.si_errno = 0;
 			info.si_code = SEGV_MAPERR;
-			info.si_addr = (void *)regs->dar;
+			info.si_addr = (void __user *)regs->dar;
 			force_sig_info(SIGSEGV, &info, current);
 		} else {
 			/* Search exception table */
@@ -523,7 +537,7 @@ AlignmentException(struct pt_regs *regs)
 	info.si_signo = SIGBUS;
 	info.si_errno = 0;
 	info.si_code = BUS_ADRALN;
-	info.si_addr = (void *)regs->nip;
+	info.si_addr = (void __user *)regs->nip;
 	_exception(SIGBUS, &info, regs);	
 }
 
@@ -531,10 +545,39 @@ AlignmentException(struct pt_regs *regs)
 void
 AltivecAssistException(struct pt_regs *regs)
 {
-	if (regs->msr & MSR_VEC)
-		giveup_altivec(current);
-	/* XXX quick hack for now: set the non-Java bit in the VSCR */
-	current->thread.vscr.u[3] |= 0x10000;
+	int err;
+	siginfo_t info;
+
+	if (!user_mode(regs)) {
+		printk(KERN_EMERG "VMX/Altivec assist exception in kernel mode"
+		       " at %lx\n", regs->nip);
+		die("Kernel VMX/Altivec assist exception", regs, SIGILL);
+	}
+
+	flush_altivec_to_thread(current);
+
+	err = emulate_altivec(regs);
+	if (err == 0) {
+		regs->nip += 4;		/* skip emulated instruction */
+		emulate_single_step(regs);
+		return;
+	}
+
+	if (err == -EFAULT) {
+		/* got an error reading the instruction */
+		info.si_signo = SIGSEGV;
+		info.si_errno = 0;
+		info.si_code = SEGV_MAPERR;
+		info.si_addr = (void __user *) regs->nip;
+		force_sig_info(SIGSEGV, &info, current);
+	} else {
+		/* didn't recognize the instruction */
+		/* XXX quick hack for now: set the non-Java bit in the VSCR */
+		if (printk_ratelimit())
+			printk(KERN_ERR "Unrecognized altivec instruction "
+			       "in %s at %lx\n", current->comm, regs->nip);
+		current->thread.vscr.u[3] |= 0x10000;
+	}
 }
 #endif /* CONFIG_ALTIVEC */
 
diff --git a/arch/ppc64/kernel/udbg.c b/arch/ppc64/kernel/udbg.c
index 9f54b0a7c..da2179154 100644
--- a/arch/ppc64/kernel/udbg.c
+++ b/arch/ppc64/kernel/udbg.c
@@ -3,12 +3,6 @@
  *
  * c 2001 PPC 64 Team, IBM Corp
  *
- * NOTE: I am trying to make this code avoid any static data references to
- *  simplify debugging early boot.  We'll see how that goes...
- *
- * To use this call udbg_init() first.  It will init the uart to 9600 8N1.
- * You may need to update the COM1 define if your uart is at a different addr.
- *
  *      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
@@ -53,10 +47,9 @@ struct NS16550 {
 #define LSR_TEMT 0x40  /* Xmitter empty */
 #define LSR_ERR  0x80  /* Error */
 
-volatile struct NS16550 *udbg_comport;
+static volatile struct NS16550 *udbg_comport;
 
-void
-udbg_init_uart(void *comport)
+void udbg_init_uart(void *comport)
 {
 	if (comport) {
 		udbg_comport = (struct NS16550 *)comport;
@@ -89,8 +82,7 @@ static unsigned char scc_inittab[] = {
     3,  0xc1,		/* rx enable, 8 bits */
 };
 
-void
-udbg_init_scc(struct device_node *np)
+void udbg_init_scc(struct device_node *np)
 {
 	unsigned long addr;
 	int i, x;
@@ -127,10 +119,9 @@ udbg_init_scc(struct device_node *np)
 
 #endif /* CONFIG_PPC_PMAC */
 
-void
-udbg_putc(unsigned char c)
+void udbg_putc(unsigned char c)
 {
-	if ( udbg_comport ) {
+	if (udbg_comport) {
 		while ((udbg_comport->lsr & LSR_THRE) == 0)
 			/* wait for idle */;
 		udbg_comport->thr = c; eieio();
@@ -173,10 +164,9 @@ int udbg_getc_poll(void)
 	return -1;
 }
 
-unsigned char
-udbg_getc(void)
+unsigned char udbg_getc(void)
 {
-	if ( udbg_comport ) {
+	if (udbg_comport) {
 		while ((udbg_comport->lsr & LSR_DR) == 0)
 			/* wait for char */;
 		return udbg_comport->rbr;
@@ -192,8 +182,7 @@ udbg_getc(void)
 	return 0;
 }
 
-void
-udbg_puts(const char *s)
+void udbg_puts(const char *s)
 {
 	if (ppc_md.udbg_putc) {
 		char c;
@@ -207,8 +196,7 @@ udbg_puts(const char *s)
 	}
 }
 
-int
-udbg_write(const char *s, int n)
+int udbg_write(const char *s, int n)
 {
 	int remain = n;
 	char c;
@@ -216,20 +204,23 @@ udbg_write(const char *s, int n)
 	if (!ppc_md.udbg_putc)
 		return 0;
 
-	if ( s && *s != '\0' ) {
-		while ( (( c = *s++ ) != '\0') && (remain-- > 0)) {
+	if (s && *s != '\0') {
+		while (((c = *s++) != '\0') && (remain-- > 0)) {
 			ppc_md.udbg_putc(c);
 		}
 	}
+
 	return n - remain;
 }
 
-int
-udbg_read(char *buf, int buflen) {
+int udbg_read(char *buf, int buflen)
+{
 	char c, *p = buf;
 	int i;
+
 	if (!ppc_md.udbg_putc)
-		for (;;);	/* stop here for cpuctl */
+		return 0;
+
 	for (i = 0; i < buflen; ++i) {
 		do {
 			c = ppc_md.udbg_getc();
@@ -238,68 +229,38 @@ udbg_read(char *buf, int buflen) {
 			break;
 		*p++ = c;
 	}
+
 	return i;
 }
 
-void
-udbg_console_write(struct console *con, const char *s, unsigned int n)
+void udbg_console_write(struct console *con, const char *s, unsigned int n)
 {
 	udbg_write(s, n);
 }
 
-void
-udbg_puthex(unsigned long val)
-{
-	int i, nibbles = sizeof(val)*2;
-	unsigned char buf[sizeof(val)*2+1];
-	for (i = nibbles-1;  i >= 0;  i--) {
-		buf[i] = (val & 0xf) + '0';
-		if (buf[i] > '9')
-		    buf[i] += ('a'-'0'-10);
-		val >>= 4;
-	}
-	buf[nibbles] = '\0';
-	udbg_puts(buf);
-}
-
-void
-udbg_printSP(const char *s)
-{
-	if (systemcfg->platform == PLATFORM_PSERIES) {
-		unsigned long sp;
-		asm("mr %0,1" : "=r" (sp) :);
-		if (s)
-			udbg_puts(s);
-		udbg_puthex(sp);
-	}
-}
-
-void
-udbg_printf(const char *fmt, ...)
+#define UDBG_BUFSIZE 256
+void udbg_printf(const char *fmt, ...)
 {
-	unsigned char buf[256];
-
+	unsigned char buf[UDBG_BUFSIZE];
 	va_list args;
-	va_start(args, fmt);
 
-	vsprintf(buf, fmt, args);
+	va_start(args, fmt);
+	vsnprintf(buf, UDBG_BUFSIZE, fmt, args);
 	udbg_puts(buf);
-
 	va_end(args);
 }
 
 /* Special print used by PPCDBG() macro */
-void
-udbg_ppcdbg(unsigned long debug_flags, const char *fmt, ...)
+void udbg_ppcdbg(unsigned long debug_flags, const char *fmt, ...)
 {
 	unsigned long active_debugs = debug_flags & naca->debug_switch;
 
-	if ( active_debugs ) {
+	if (active_debugs) {
 		va_list ap;
-		unsigned char buf[256];
+		unsigned char buf[UDBG_BUFSIZE];
 		unsigned long i, len = 0;
 
-		for(i=0; i < PPCDBG_NUM_FLAGS ;i++) {
+		for (i=0; i < PPCDBG_NUM_FLAGS; i++) {
 			if (((1U << i) & active_debugs) && 
 			    trace_names[i]) {
 				len += strlen(trace_names[i]); 
@@ -307,25 +268,24 @@ udbg_ppcdbg(unsigned long debug_flags, const char *fmt, ...)
 				break;
 			}
 		}
-		sprintf(buf, " [%s]: ", current->comm);
+
+		snprintf(buf, UDBG_BUFSIZE, " [%s]: ", current->comm);
 		len += strlen(buf); 
 		udbg_puts(buf);
 
-		while(len < 18) {
+		while (len < 18) {
 			udbg_puts(" ");
 			len++;
 		}
 
 		va_start(ap, fmt);
-		vsprintf(buf, fmt, ap);
+		vsnprintf(buf, UDBG_BUFSIZE, fmt, ap);
 		udbg_puts(buf);
-		
 		va_end(ap);
 	}
 }
 
-unsigned long
-udbg_ifdebug(unsigned long flags)
+unsigned long udbg_ifdebug(unsigned long flags)
 {
 	return (flags & naca->debug_switch);
 }
diff --git a/arch/ppc64/kernel/vio.c b/arch/ppc64/kernel/vio.c
index 78b05df91..a5fd6e772 100644
--- a/arch/ppc64/kernel/vio.c
+++ b/arch/ppc64/kernel/vio.c
@@ -26,39 +26,39 @@
 #include <asm/vio.h>
 #include <asm/hvcall.h>
 #include <asm/iSeries/vio.h>
+#include <asm/iSeries/HvTypes.h>
 #include <asm/iSeries/HvCallXm.h>
+#include <asm/iSeries/HvLpConfig.h>
 
 #define DBGENTER() pr_debug("%s entered\n", __FUNCTION__)
 
 extern struct subsystem devices_subsys; /* needed for vio_find_name() */
 
-static struct iommu_table *vio_build_iommu_table(struct vio_dev *);
 static const struct vio_device_id *vio_match_device(
 		const struct vio_device_id *, const struct vio_dev *);
 
 #ifdef CONFIG_PPC_PSERIES
+static struct iommu_table *vio_build_iommu_table(struct vio_dev *);
 static int vio_num_address_cells;
 #endif
 static struct vio_dev *vio_bus_device; /* fake "parent" device */
 
 #ifdef CONFIG_PPC_ISERIES
+static struct vio_dev *__init vio_register_device_iseries(char *type,
+		uint32_t unit_num);
+
 static struct iommu_table veth_iommu_table;
 static struct iommu_table vio_iommu_table;
 
-static struct vio_dev _veth_dev = {
-	.iommu_table = &veth_iommu_table,
-	.dev.bus = &vio_bus_type
-};
 static struct vio_dev _vio_dev  = {
 	.iommu_table = &vio_iommu_table,
 	.dev.bus = &vio_bus_type
 };
-
-struct vio_dev *iSeries_veth_dev = &_veth_dev;
 struct device *iSeries_vio_dev = &_vio_dev.dev;
-
-EXPORT_SYMBOL(iSeries_veth_dev);
 EXPORT_SYMBOL(iSeries_vio_dev);
+
+#define device_is_compatible(a, b)	1
+
 #endif
 
 /* convert from struct device to struct vio_dev and pass to driver.
@@ -143,14 +143,12 @@ static const struct vio_device_id * vio_match_device(const struct vio_device_id
 {
 	DBGENTER();
 
-#ifdef CONFIG_PPC_PSERIES
 	while (ids->type) {
-		if ((strncmp(((struct device_node *)dev->dev.platform_data)->type, ids->type, strlen(ids->type)) == 0) &&
+		if ((strncmp(dev->type, ids->type, strlen(ids->type)) == 0) &&
 			device_is_compatible(dev->dev.platform_data, ids->compat))
 			return ids;
 		ids++;
 	}
-#endif
 	return NULL;
 }
 
@@ -196,14 +194,59 @@ void __init iommu_vio_init(void)
 }
 #endif
 
+#ifdef CONFIG_PPC_PSERIES
+static void probe_bus_pseries(void)
+{
+	struct device_node *node_vroot, *of_node;
+
+	node_vroot = find_devices("vdevice");
+	if ((node_vroot == NULL) || (node_vroot->child == NULL))
+		/* this machine doesn't do virtual IO, and that's ok */
+		return;
+
+	vio_num_address_cells = prom_n_addr_cells(node_vroot->child);
+
+	/*
+	 * Create struct vio_devices for each virtual device in the device tree.
+	 * Drivers will associate with them later.
+	 */
+	for (of_node = node_vroot->child; of_node != NULL;
+			of_node = of_node->sibling) {
+		printk(KERN_DEBUG "%s: processing %p\n", __FUNCTION__, of_node);
+		vio_register_device_node(of_node);
+	}
+}
+#endif
+
+#ifdef CONFIG_PPC_ISERIES
+static void probe_bus_iseries(void)
+{
+	HvLpIndexMap vlan_map = HvLpConfig_getVirtualLanIndexMap();
+	struct vio_dev *viodev;
+	int i;
+
+	vlan_map = HvLpConfig_getVirtualLanIndexMap();
+	for (i = 0; i < HVMAXARCHITECTEDVIRTUALLANS; i++) {
+		if ((vlan_map & (0x8000 >> i)) == 0)
+			continue;
+		viodev = vio_register_device_iseries("vlan", i);
+		/* veth is special and has it own iommu_table */
+		viodev->iommu_table = &veth_iommu_table;
+	}
+	for (i = 0; i < HVMAXARCHITECTEDVIRTUALDISKS; i++)
+		vio_register_device_iseries("viodasd", i);
+	for (i = 0; i < HVMAXARCHITECTEDVIRTUALCDROMS; i++)
+		vio_register_device_iseries("viocd", i);
+	for (i = 0; i < HVMAXARCHITECTEDVIRTUALTAPES; i++)
+		vio_register_device_iseries("viotape", i);
+}
+#endif
+
 /**
  * vio_bus_init: - Initialize the virtual IO bus
  */
 static int __init vio_bus_init(void)
 {
-#ifdef CONFIG_PPC_PSERIES
-	struct device_node *node_vroot, *of_node;
-#endif
 	int err;
 
 	err = bus_register(&vio_bus_type);
@@ -229,25 +272,10 @@ static int __init vio_bus_init(void)
 	}
 
 #ifdef CONFIG_PPC_PSERIES
-	node_vroot = find_devices("vdevice");
-	if ((node_vroot == NULL) || (node_vroot->child == NULL)) {
-		/* this machine doesn't do virtual IO, and that's ok */
-		return 0;
-	}
-
-	vio_num_address_cells = prom_n_addr_cells(node_vroot->child);
-
-	/*
-	 * Create struct vio_devices for each virtual device in the device tree.
-	 * Drivers will associate with them later.
-	 */
-	for (of_node = node_vroot->child;
-			of_node != NULL;
-			of_node = of_node->sibling) {
-		printk(KERN_DEBUG "%s: processing %p\n", __FUNCTION__, of_node);
-
-		vio_register_device(of_node);
-	}
+	probe_bus_pseries();
+#endif
+#ifdef CONFIG_PPC_ISERIES
+	probe_bus_iseries();
 #endif
 
 	return 0;
@@ -255,20 +283,19 @@ static int __init vio_bus_init(void)
 
 __initcall(vio_bus_init);
 
-
-#ifdef CONFIG_PPC_PSERIES
 /* vio_dev refcount hit 0 */
 static void __devinit vio_dev_release(struct device *dev)
 {
-	struct vio_dev *viodev = to_vio_dev(dev);
-
 	DBGENTER();
 
+#ifdef CONFIG_PPC_PSERIES
 	/* XXX free TCE table */
-	of_node_put(viodev->dev.platform_data);
-	kfree(viodev);
+	of_node_put(dev->platform_data);
+#endif
+	kfree(to_vio_dev(dev));
 }
 
+#ifdef CONFIG_PPC_PSERIES
 static ssize_t viodev_show_devspec(struct device *dev, char *buf)
 {
 	struct device_node *of_node = dev->platform_data;
@@ -276,17 +303,43 @@ static ssize_t viodev_show_devspec(struct device *dev, char *buf)
 	return sprintf(buf, "%s\n", of_node->full_name);
 }
 DEVICE_ATTR(devspec, S_IRUSR | S_IRGRP | S_IROTH, viodev_show_devspec, NULL);
+#endif
 
 static ssize_t viodev_show_name(struct device *dev, char *buf)
 {
-	struct device_node *of_node = dev->platform_data;
-
-	return sprintf(buf, "%s\n", of_node->name);
+	return sprintf(buf, "%s\n", to_vio_dev(dev)->name);
 }
 DEVICE_ATTR(name, S_IRUSR | S_IRGRP | S_IROTH, viodev_show_name, NULL);
 
+static struct vio_dev * __devinit vio_register_device_common(
+		struct vio_dev *viodev, char *name, char *type,
+		uint32_t unit_address, struct iommu_table *iommu_table)
+{
+	DBGENTER();
+
+	viodev->name = name;
+	viodev->type = type;
+	viodev->unit_address = unit_address;
+	viodev->iommu_table = iommu_table;
+	/* init generic 'struct device' fields: */
+	viodev->dev.parent = &vio_bus_device->dev;
+	viodev->dev.bus = &vio_bus_type;
+	viodev->dev.release = vio_dev_release;
+
+	/* register with generic device framework */
+	if (device_register(&viodev->dev)) {
+		printk(KERN_ERR "%s: failed to register device %s\n",
+				__FUNCTION__, viodev->dev.bus_id);
+		return NULL;
+	}
+	device_create_file(&viodev->dev, &dev_attr_name);
+
+	return viodev;
+}
+
+#ifdef CONFIG_PPC_PSERIES
 /**
- * vio_register_device: - Register a new vio device.
+ * vio_register_device_node: - Register a new vio device.
  * @of_node:	The OF node for this device.
  *
  * Creates and initializes a vio_dev structure from the data in
@@ -294,7 +347,7 @@ DEVICE_ATTR(name, S_IRUSR | S_IRGRP | S_IROTH, viodev_show_name, NULL);
  * Returns a pointer to the created vio_dev or NULL if node has
  * NULL device_type or compatible fields.
  */
-struct vio_dev * __devinit vio_register_device(struct device_node *of_node)
+struct vio_dev * __devinit vio_register_device_node(struct device_node *of_node)
 {
 	struct vio_dev *viodev;
 	unsigned int *unit_address;
@@ -325,11 +378,9 @@ struct vio_dev * __devinit vio_register_device(struct device_node *of_node)
 	memset(viodev, 0, sizeof(struct vio_dev));
 
 	viodev->dev.platform_data = of_node_get(of_node);
-	viodev->unit_address = *unit_address;
-	viodev->iommu_table = vio_build_iommu_table(viodev);
 
 	viodev->irq = NO_IRQ;
-	irq_p = (unsigned int *)get_property(of_node, "interrupts", 0);
+	irq_p = (unsigned int *)get_property(of_node, "interrupts", NULL);
 	if (irq_p) {
 		int virq = virt_irq_create_mapping(*irq_p);
 		if (virq == NO_IRQ) {
@@ -339,36 +390,60 @@ struct vio_dev * __devinit vio_register_device(struct device_node *of_node)
 			viodev->irq = irq_offset_up(virq);
 	}
 
-	/* init generic 'struct device' fields: */
-	viodev->dev.parent = &vio_bus_device->dev;
-	viodev->dev.bus = &vio_bus_type;
-	snprintf(viodev->dev.bus_id, BUS_ID_SIZE, "%x", viodev->unit_address);
-	viodev->dev.release = vio_dev_release;
+	snprintf(viodev->dev.bus_id, BUS_ID_SIZE, "%x", *unit_address);
 
 	/* register with generic device framework */
-	if (device_register(&viodev->dev)) {
-		printk(KERN_ERR "%s: failed to register device %s\n", __FUNCTION__,
-			viodev->dev.bus_id);
+	if (vio_register_device_common(viodev, of_node->name, of_node->type,
+				*unit_address, vio_build_iommu_table(viodev))
+			== NULL) {
 		/* XXX free TCE table */
 		kfree(viodev);
 		return NULL;
 	}
-	device_create_file(&viodev->dev, &dev_attr_name);
 	device_create_file(&viodev->dev, &dev_attr_devspec);
 
 	return viodev;
 }
-EXPORT_SYMBOL(vio_register_device);
+EXPORT_SYMBOL(vio_register_device_node);
+#endif
+
+#ifdef CONFIG_PPC_ISERIES
+/**
+ * vio_register_device: - Register a new vio device.
+ * @voidev:	The device to register.
+ */
+static struct vio_dev *__init vio_register_device_iseries(char *type,
+		uint32_t unit_num)
+{
+	struct vio_dev *viodev;
+
+	DBGENTER();
+
+	/* allocate a vio_dev for this node */
+	viodev = kmalloc(sizeof(struct vio_dev), GFP_KERNEL);
+	if (!viodev)
+		return NULL;
+	memset(viodev, 0, sizeof(struct vio_dev));
+
+	snprintf(viodev->dev.bus_id, BUS_ID_SIZE, "%s%d", type, unit_num);
+
+	return vio_register_device_common(viodev, viodev->dev.bus_id, type,
+			unit_num, &vio_iommu_table);
+}
+#endif
 
 void __devinit vio_unregister_device(struct vio_dev *viodev)
 {
 	DBGENTER();
+#ifdef CONFIG_PPC_PSERIES
 	device_remove_file(&viodev->dev, &dev_attr_devspec);
+#endif
 	device_remove_file(&viodev->dev, &dev_attr_name);
 	device_unregister(&viodev->dev);
 }
 EXPORT_SYMBOL(vio_unregister_device);
 
+#ifdef CONFIG_PPC_PSERIES
 /**
  * vio_get_attribute: - get attribute for virtual device
  * @vdev:	The vio device to get property.
diff --git a/arch/ppc64/kernel/viopath.c b/arch/ppc64/kernel/viopath.c
index 3fbdd00d3..7b6c257f4 100644
--- a/arch/ppc64/kernel/viopath.c
+++ b/arch/ppc64/kernel/viopath.c
@@ -37,8 +37,10 @@
 #include <linux/dma-mapping.h>
 #include <linux/wait.h>
 #include <linux/seq_file.h>
+#include <linux/smp_lock.h>
 
 #include <asm/hardirq.h>
+#include <asm/system.h>
 #include <asm/uaccess.h>
 #include <asm/iSeries/LparData.h>
 #include <asm/iSeries/HvLpEvent.h>
@@ -108,85 +110,6 @@ static vio_event_handler_t *vio_handler[VIO_MAX_SUBTYPES];
 #define VIOPATH_KERN_WARN	KERN_WARNING "viopath: "
 #define VIOPATH_KERN_INFO	KERN_INFO "viopath: "
 
-static unsigned char e2a(unsigned char x)
-{
-	switch (x) {
-	case 0xF0:
-		return '0';
-	case 0xF1:
-		return '1';
-	case 0xF2:
-		return '2';
-	case 0xF3:
-		return '3';
-	case 0xF4:
-		return '4';
-	case 0xF5:
-		return '5';
-	case 0xF6:
-		return '6';
-	case 0xF7:
-		return '7';
-	case 0xF8:
-		return '8';
-	case 0xF9:
-		return '9';
-	case 0xC1:
-		return 'A';
-	case 0xC2:
-		return 'B';
-	case 0xC3:
-		return 'C';
-	case 0xC4:
-		return 'D';
-	case 0xC5:
-		return 'E';
-	case 0xC6:
-		return 'F';
-	case 0xC7:
-		return 'G';
-	case 0xC8:
-		return 'H';
-	case 0xC9:
-		return 'I';
-	case 0xD1:
-		return 'J';
-	case 0xD2:
-		return 'K';
-	case 0xD3:
-		return 'L';
-	case 0xD4:
-		return 'M';
-	case 0xD5:
-		return 'N';
-	case 0xD6:
-		return 'O';
-	case 0xD7:
-		return 'P';
-	case 0xD8:
-		return 'Q';
-	case 0xD9:
-		return 'R';
-	case 0xE2:
-		return 'S';
-	case 0xE3:
-		return 'T';
-	case 0xE4:
-		return 'U';
-	case 0xE5:
-		return 'V';
-	case 0xE6:
-		return 'W';
-	case 0xE7:
-		return 'X';
-	case 0xE8:
-		return 'Y';
-	case 0xE9:
-		return 'Z';
-	}
-	return ' ';
-}
-
 static int proc_viopath_show(struct seq_file *m, void *v)
 {
 	char *buf;
diff --git a/arch/ppc64/kernel/xics.c b/arch/ppc64/kernel/xics.c
index 1d9cf20a2..c9f950c2c 100644
--- a/arch/ppc64/kernel/xics.c
+++ b/arch/ppc64/kernel/xics.c
@@ -27,7 +27,6 @@
 #include <asm/naca.h>
 #include <asm/rtas.h>
 #include <asm/xics.h>
-#include <asm/ppcdebug.h>
 #include <asm/hvcall.h>
 #include <asm/machdep.h>
 
@@ -190,7 +189,7 @@ static void pSeriesLP_xirr_info_set(int n_cpu, int value)
 		      val64); 
 }
 
-static void pSeriesLP_cppr_info(int n_cpu, u8 value)
+void pSeriesLP_cppr_info(int n_cpu, u8 value)
 {
 	unsigned long lpar_rc;
 
@@ -239,15 +238,14 @@ static unsigned int real_irq_to_virt(unsigned int real_irq)
 #ifdef CONFIG_SMP
 static int get_irq_server(unsigned int irq)
 {
-	cpumask_t cpumask = irq_affinity[irq];
-	cpumask_t allcpus = CPU_MASK_ALL;
-	cpumask_t tmp = CPU_MASK_NONE;
 	unsigned int server;
 
 #ifdef CONFIG_IRQ_ALL_CPUS
 	/* For the moment only implement delivery to all cpus or one cpu */
 	if (smp_threads_ready) {
-		if (cpus_equal(cpumask, allcpus)) {
+		cpumask_t cpumask = irq_affinity[irq];
+		cpumask_t tmp = CPU_MASK_NONE;
+		if (cpus_equal(cpumask, CPU_MASK_ALL)) {
 			server = default_distrib_server;
 		} else {
 			cpus_and(tmp, cpu_online_map, cpumask);
@@ -276,7 +274,7 @@ static int get_irq_server(unsigned int irq)
 static void xics_enable_irq(unsigned int virq)
 {
 	unsigned int irq;
-	long call_status;
+	int call_status;
 	unsigned int server;
 
 	irq = virt_irq_to_real(irq_offset_down(virq));
@@ -287,23 +285,23 @@ static void xics_enable_irq(unsigned int virq)
 	call_status = rtas_call(ibm_set_xive, 3, 1, NULL, irq, server,
 				DEFAULT_PRIORITY);
 	if (call_status != 0) {
-		printk(KERN_ERR "xics_enable_irq: irq=%x: ibm_set_xive "
-		       "returned %lx\n", irq, call_status);
+		printk(KERN_ERR "xics_enable_irq: irq=%d: ibm_set_xive "
+		       "returned %x\n", irq, call_status);
 		return;
 	}
 
 	/* Now unmask the interrupt (often a no-op) */
 	call_status = rtas_call(ibm_int_on, 1, 1, NULL, irq);
 	if (call_status != 0) {
-		printk(KERN_ERR "xics_enable_irq: irq=%x: ibm_int_on "
-		       "returned %lx\n", irq, call_status);
+		printk(KERN_ERR "xics_enable_irq: irq=%d: ibm_int_on "
+		       "returned %x\n", irq, call_status);
 		return;
 	}
 }
 
 static void xics_disable_real_irq(unsigned int irq)
 {
-	long call_status;
+	int call_status;
 	unsigned int server;
 
 	if (irq == XICS_IPI)
@@ -311,8 +309,8 @@ static void xics_disable_real_irq(unsigned int irq)
 
 	call_status = rtas_call(ibm_int_off, 1, 1, NULL, irq);
 	if (call_status != 0) {
-		printk(KERN_ERR "xics_disable_real_irq: irq=%x: "
-		       "ibm_int_off returned %lx\n", irq, call_status);
+		printk(KERN_ERR "xics_disable_real_irq: irq=%d: "
+		       "ibm_int_off returned %x\n", irq, call_status);
 		return;
 	}
 
@@ -320,8 +318,8 @@ static void xics_disable_real_irq(unsigned int irq)
 	/* Have to set XIVE to 0xff to be able to remove a slot */
 	call_status = rtas_call(ibm_set_xive, 3, 1, NULL, irq, server, 0xff);
 	if (call_status != 0) {
-		printk(KERN_ERR "xics_disable_irq: irq=%x: ibm_set_xive(0xff)"
-		       " returned %lx\n", irq, call_status);
+		printk(KERN_ERR "xics_disable_irq: irq=%d: ibm_set_xive(0xff)"
+		       " returned %x\n", irq, call_status);
 		return;
 	}
 }
@@ -357,8 +355,6 @@ static void xics_mask_and_ack_irq(unsigned int irq)
 	}
 }
 
-extern unsigned int real_irq_to_virt_slowpath(unsigned int real_irq);
-
 int xics_get_irq(struct pt_regs *regs)
 {
 	unsigned int cpu = smp_processor_id();
@@ -385,7 +381,7 @@ int xics_get_irq(struct pt_regs *regs)
 		if (irq == NO_IRQ)
 			irq = real_irq_to_virt_slowpath(vec);
 		if (irq == NO_IRQ) {
-			printk(KERN_ERR "Interrupt 0x%x (real) is invalid,"
+			printk(KERN_ERR "Interrupt %d (real) is invalid,"
 			       " disabling it.\n", vec);
 			xics_disable_real_irq(vec);
 		} else
@@ -396,8 +392,6 @@ int xics_get_irq(struct pt_regs *regs)
 
 #ifdef CONFIG_SMP
 
-extern struct xics_ipi_struct xics_ipi_message[NR_CPUS] __cacheline_aligned;
-
 irqreturn_t xics_ipi_action(int irq, void *dev_id, struct pt_regs *regs)
 {
 	int cpu = smp_processor_id();
@@ -470,13 +464,11 @@ void xics_init_IRQ(void)
 	ibm_int_off = rtas_token("ibm,int-off");
 
 	np = of_find_node_by_type(NULL, "PowerPC-External-Interrupt-Presentation");
-	if (!np) {
-		printk(KERN_WARNING "Can't find Interrupt Presentation\n");
-		udbg_printf("Can't find Interrupt Presentation\n");
-		while (1);
-	}
+	if (!np)
+		panic("xics_init_IRQ: can't find interrupt presentation");
+
 nextnode:
-	ireg = (uint *)get_property(np, "ibm,interrupt-server-ranges", 0);
+	ireg = (uint *)get_property(np, "ibm,interrupt-server-ranges", NULL);
 	if (ireg) {
 		/*
 		 * set node starting index for this node
@@ -485,11 +477,8 @@ nextnode:
 	}
 
 	ireg = (uint *)get_property(np, "reg", &ilen);
-	if (!ireg) {
-		printk(KERN_WARNING "Can't find Interrupt Reg Property\n");
-		udbg_printf("Can't find Interrupt Reg Property\n");
-		while (1);
-	}
+	if (!ireg)
+		panic("xics_init_IRQ: can't find interrupt reg property");
 	
 	while (ilen) {
 		inodes[indx].addr = (unsigned long long)*ireg++ << 32;
@@ -529,16 +518,14 @@ nextnode:
 
 	np = of_find_node_by_type(NULL, "interrupt-controller");
 	if (!np) {
-		printk(KERN_WARNING "xics:  no ISA Interrupt Controller\n");
+		printk(KERN_WARNING "xics: no ISA interrupt controller\n");
 		xics_irq_8259_cascade_real = -1;
 		xics_irq_8259_cascade = -1;
 	} else {
-		ireg = (uint *) get_property(np, "interrupts", 0);
-		if (!ireg) {
-			printk(KERN_WARNING "Can't find ISA Interrupts Property\n");
-			udbg_printf("Can't find ISA Interrupts Property\n");
-			while (1);
-		}
+		ireg = (uint *) get_property(np, "interrupts", NULL);
+		if (!ireg)
+			panic("xics_init_IRQ: can't find ISA interrupts property");
+
 		xics_irq_8259_cascade_real = *ireg;
 		xics_irq_8259_cascade
 			= virt_irq_create_mapping(xics_irq_8259_cascade_real);
@@ -559,13 +546,8 @@ nextnode:
 		xics_per_cpu[0] = __ioremap((ulong)intr_base, intr_size,
 					    _PAGE_NO_CACHE);
 #endif /* CONFIG_SMP */
-#ifdef CONFIG_PPC_PSERIES
-	/* actually iSeries does not use any of xics...but it has link dependencies
-	 * for now, except this new one...
-	 */
 	} else if (systemcfg->platform == PLATFORM_PSERIES_LPAR) {
 		ops = &pSeriesLP_ops;
-#endif
 	}
 
 	xics_8259_pic.enable = i8259_pic.enable;
@@ -590,8 +572,9 @@ static int __init xics_setup_i8259(void)
 	if (naca->interrupt_controller == IC_PPC_XIC &&
 	    xics_irq_8259_cascade != -1) {
 		if (request_irq(irq_offset_up(xics_irq_8259_cascade),
-				no_action, 0, "8259 cascade", 0))
-			printk(KERN_ERR "xics_init_IRQ: couldn't get 8259 cascade\n");
+				no_action, 0, "8259 cascade", NULL))
+			printk(KERN_ERR "xics_setup_i8259: couldn't get 8259 "
+					"cascade\n");
 		i8259_init();
 	}
 	return 0;
@@ -605,7 +588,7 @@ void xics_request_IPIs(void)
 
 	/* IPIs are marked SA_INTERRUPT as they must run with irqs disabled */
 	request_irq(irq_offset_up(XICS_IPI), xics_ipi_action, SA_INTERRUPT,
-		    "IPI", 0);
+		    "IPI", NULL);
 	get_irq_desc(irq_offset_up(XICS_IPI))->status |= IRQ_PER_CPU;
 }
 #endif
@@ -613,26 +596,25 @@ void xics_request_IPIs(void)
 static void xics_set_affinity(unsigned int virq, cpumask_t cpumask)
 {
 	unsigned int irq;
-	long status;
-	unsigned long xics_status[2];
+	int status;
+	int xics_status[2];
 	unsigned long newmask;
-	cpumask_t allcpus = CPU_MASK_ALL;
 	cpumask_t tmp = CPU_MASK_NONE;
 
 	irq = virt_irq_to_real(irq_offset_down(virq));
 	if (irq == XICS_IPI || irq == NO_IRQ)
 		return;
 
-	status = rtas_call(ibm_get_xive, 1, 3, (void *)&xics_status, irq);
+	status = rtas_call(ibm_get_xive, 1, 3, xics_status, irq);
 
 	if (status) {
 		printk(KERN_ERR "xics_set_affinity: irq=%d ibm,get-xive "
-		       "returns %ld\n", irq, status);
+		       "returns %d\n", irq, status);
 		return;
 	}
 
 	/* For the moment only implement delivery to all cpus or one cpu */
-	if (cpus_equal(cpumask, allcpus)) {
+	if (cpus_equal(cpumask, CPU_MASK_ALL)) {
 		newmask = default_distrib_server;
 	} else {
 		cpus_and(tmp, cpu_online_map, cpumask);
@@ -645,8 +627,8 @@ static void xics_set_affinity(unsigned int virq, cpumask_t cpumask)
 				irq, newmask, xics_status[1]);
 
 	if (status) {
-		printk(KERN_ERR "xics_set_affinity irq=%d ibm,set-xive "
-		       "returns %ld\n", irq, status);
+		printk(KERN_ERR "xics_set_affinity: irq=%d ibm,set-xive "
+		       "returns %d\n", irq, status);
 		return;
 	}
 }
@@ -657,11 +639,9 @@ static void xics_set_affinity(unsigned int virq, cpumask_t cpumask)
 void xics_migrate_irqs_away(void)
 {
 	int set_indicator = rtas_token("set-indicator");
-	const unsigned long giqs = 9005UL; /* Global Interrupt Queue Server */
-	unsigned long status = 0;
-	unsigned int irq, cpu = smp_processor_id();
-	unsigned long xics_status[2];
-	unsigned long flags;
+	const unsigned int giqs = 9005UL; /* Global Interrupt Queue Server */
+	int status = 0;
+	unsigned int irq, virq, cpu = smp_processor_id();
 
 	BUG_ON(set_indicator == RTAS_UNKNOWN_SERVICE);
 
@@ -671,19 +651,27 @@ void xics_migrate_irqs_away(void)
 
 	/* Refuse any new interrupts... */
 	rtas_call(set_indicator, 3, 1, &status, giqs,
-		  hard_smp_processor_id(), 0UL);
+		  hard_smp_processor_id(), 0);
 	WARN_ON(status != 0);
 
 	/* Allow IPIs again... */
 	ops->cppr_info(cpu, DEFAULT_PRIORITY);
 	iosync();
 
-	printk(KERN_WARNING "HOTPLUG: Migrating IRQs away\n");
-	for_each_irq(irq) {
-		irq_desc_t *desc = get_irq_desc(irq);
+	for_each_irq(virq) {
+		irq_desc_t *desc;
+		int xics_status[2];
+		unsigned long flags;
+
+		/* We cant set affinity on ISA interrupts */
+		if (virq < irq_offset_value())
+			continue;
+
+		desc = get_irq_desc(virq);
+		irq = virt_irq_to_real(irq_offset_down(virq));
 
 		/* We need to get IPIs still. */
-		if (irq_offset_down(irq) == XICS_IPI)
+		if (irq == XICS_IPI || irq == NO_IRQ)
 			continue;
 
 		/* We only need to migrate enabled IRQS */
@@ -694,12 +682,11 @@ void xics_migrate_irqs_away(void)
 
 		spin_lock_irqsave(&desc->lock, flags);
 
-		status = rtas_call(ibm_get_xive, 1, 3, (void *)&xics_status,
-				   irq);
+		status = rtas_call(ibm_get_xive, 1, 3, xics_status, irq);
 		if (status) {
 			printk(KERN_ERR "migrate_irqs_away: irq=%d "
-					"ibm,get-xive returns %ld\n",
-					irq, status);
+					"ibm,get-xive returns %d\n",
+					virq, status);
 			goto unlock;
 		}
 
@@ -712,21 +699,20 @@ void xics_migrate_irqs_away(void)
 			goto unlock;
 
 		printk(KERN_WARNING "IRQ %d affinity broken off cpu %u\n",
-		       irq, cpu);
+		       virq, cpu);
 
 		/* Reset affinity to all cpus */
 		xics_status[0] = default_distrib_server;
 
-		status = rtas_call(ibm_set_xive, 3, 1, NULL,
-				irq, xics_status[0], xics_status[1]);
+		status = rtas_call(ibm_set_xive, 3, 1, NULL, irq,
+				xics_status[0], xics_status[1]);
 		if (status)
-			printk(KERN_ERR "migrate_irqs_away irq=%d "
-					"ibm,set-xive returns %ld\n",
-					irq, status);
+			printk(KERN_ERR "migrate_irqs_away: irq=%d "
+					"ibm,set-xive returns %d\n",
+					virq, status);
 
 unlock:
 		spin_unlock_irqrestore(&desc->lock, flags);
 	}
-
 }
 #endif
diff --git a/arch/ppc64/lib/Makefile b/arch/ppc64/lib/Makefile
index 713ae47da..01924ec67 100644
--- a/arch/ppc64/lib/Makefile
+++ b/arch/ppc64/lib/Makefile
@@ -3,9 +3,15 @@
 #
 
 lib-y := checksum.o dec_and_lock.o string.o strcase.o
-lib-y += copypage.o memcpy.o copyuser.o
+lib-y += copypage.o memcpy.o copyuser.o usercopy.o
 
 # Lock primitives are defined as no-ops in include/linux/spinlock.h
 # for non-SMP configs. Don't build the real versions.
 
 lib-$(CONFIG_SMP) += locks.o
+
+# e2a provides EBCDIC to ASCII conversions.
+ifdef CONFIG_PPC_ISERIES
+obj-$(CONFIG_PCI)	+= e2a.o
+endif
+
diff --git a/arch/ppc64/lib/locks.c b/arch/ppc64/lib/locks.c
index 4610cb938..58e973cc8 100644
--- a/arch/ppc64/lib/locks.c
+++ b/arch/ppc64/lib/locks.c
@@ -16,6 +16,7 @@
 #include <linux/kernel.h>
 #include <linux/spinlock.h>
 #include <linux/module.h>
+#include <linux/stringify.h>
 #include <asm/hvcall.h>
 #include <asm/iSeries/HvCall.h>
 
@@ -37,6 +38,10 @@
 
 /* waiting for a spinlock... */
 #if defined(CONFIG_PPC_SPLPAR) || defined(CONFIG_PPC_ISERIES)
+
+/* We only yield to the hypervisor if we are in shared processor mode */
+#define SHARED_PROCESSOR (get_paca()->lppaca.xSharedProc)
+
 void __spin_yield(spinlock_t *lock)
 {
 	unsigned int lock_value, holder_cpu, yield_count;
@@ -48,7 +53,7 @@ void __spin_yield(spinlock_t *lock)
 	holder_cpu = lock_value & 0xffff;
 	BUG_ON(holder_cpu >= NR_CPUS);
 	holder_paca = &paca[holder_cpu];
-	yield_count = holder_paca->xLpPaca.xYieldCount;
+	yield_count = holder_paca->lppaca.xYieldCount;
 	if ((yield_count & 1) == 0)
 		return;		/* virtual cpu is currently running */
 	rmb();
@@ -64,6 +69,7 @@ void __spin_yield(spinlock_t *lock)
 
 #else /* SPLPAR || ISERIES */
 #define __spin_yield(x)	barrier()
+#define SHARED_PROCESSOR	0
 #endif
 
 /*
@@ -75,7 +81,7 @@ static __inline__ unsigned long __spin_trylock(spinlock_t *lock)
 	unsigned long tmp, tmp2;
 
 	__asm__ __volatile__(
-"	lwz		%1,24(13)		# __spin_trylock\n\
+"	lwz		%1,%3(13)		# __spin_trylock\n\
 1:	lwarx		%0,0,%2\n\
 	cmpwi		0,%0,0\n\
 	bne-		2f\n\
@@ -83,7 +89,7 @@ static __inline__ unsigned long __spin_trylock(spinlock_t *lock)
 	bne-		1b\n\
 	isync\n\
 2:"	: "=&r" (tmp), "=&r" (tmp2)
-	: "r" (&lock->lock)
+	: "r" (&lock->lock), "i" (offsetof(struct paca_struct, lock_token))
 	: "cr0", "memory");
 
 	return tmp;
@@ -103,7 +109,8 @@ void _raw_spin_lock(spinlock_t *lock)
 			break;
 		do {
 			HMT_low();
-			__spin_yield(lock);
+			if (SHARED_PROCESSOR)
+				__spin_yield(lock);
 		} while (likely(lock->lock != 0));
 		HMT_medium();
 	}
@@ -122,7 +129,8 @@ void _raw_spin_lock_flags(spinlock_t *lock, unsigned long flags)
 		local_irq_restore(flags);
 		do {
 			HMT_low();
-			__spin_yield(lock);
+			if (SHARED_PROCESSOR)
+				__spin_yield(lock);
 		} while (likely(lock->lock != 0));
 		HMT_medium();
 		local_irq_restore(flags_dis);
@@ -133,8 +141,12 @@ EXPORT_SYMBOL(_raw_spin_lock_flags);
 
 void spin_unlock_wait(spinlock_t *lock)
 {
-	while (lock->lock)
-		__spin_yield(lock);
+	while (lock->lock) {
+		HMT_low();
+		if (SHARED_PROCESSOR)
+			__spin_yield(lock);
+	}
+	HMT_medium();
 }
 
 EXPORT_SYMBOL(spin_unlock_wait);
@@ -157,7 +169,7 @@ void __rw_yield(rwlock_t *rw)
 	holder_cpu = lock_value & 0xffff;
 	BUG_ON(holder_cpu >= NR_CPUS);
 	holder_paca = &paca[holder_cpu];
-	yield_count = holder_paca->xLpPaca.xYieldCount;
+	yield_count = holder_paca->lppaca.xYieldCount;
 	if ((yield_count & 1) == 0)
 		return;		/* virtual cpu is currently running */
 	rmb();
@@ -212,7 +224,8 @@ void _raw_read_lock(rwlock_t *rw)
 			break;
 		do {
 			HMT_low();
-			__rw_yield(rw);
+			if (SHARED_PROCESSOR)
+				__rw_yield(rw);
 		} while (likely(rw->lock < 0));
 		HMT_medium();
 	}
@@ -246,7 +259,7 @@ static __inline__ long __write_trylock(rwlock_t *rw)
 	long tmp, tmp2;
 
 	__asm__ __volatile__(
-"	lwz		%1,24(13)		# write_trylock\n\
+"	lwz		%1,%3(13)	# write_trylock\n\
 1:	lwarx		%0,0,%2\n\
 	cmpwi		0,%0,0\n\
 	bne-		2f\n\
@@ -254,7 +267,7 @@ static __inline__ long __write_trylock(rwlock_t *rw)
 	bne-		1b\n\
 	isync\n\
 2:"	: "=&r" (tmp), "=&r" (tmp2)
-	: "r" (&rw->lock)
+	: "r" (&rw->lock), "i" (offsetof(struct paca_struct, lock_token))
 	: "cr0", "memory");
 
 	return tmp;
@@ -274,7 +287,8 @@ void _raw_write_lock(rwlock_t *rw)
 			break;
 		do {
 			HMT_low();
-			__rw_yield(rw);
+			if (SHARED_PROCESSOR)
+				__rw_yield(rw);
 		} while (likely(rw->lock != 0));
 		HMT_medium();
 	}
diff --git a/arch/ppc64/lib/string.S b/arch/ppc64/lib/string.S
index 84d14d1b1..813587e5c 100644
--- a/arch/ppc64/lib/string.S
+++ b/arch/ppc64/lib/string.S
@@ -66,28 +66,68 @@ _GLOBAL(strlen)
 	blr
 
 _GLOBAL(memset)
+	neg	r0,r3
 	rlwimi	r4,r4,8,16,23
+	andi.	r0,r0,7			/* # bytes to be 8-byte aligned */
 	rlwimi	r4,r4,16,0,15
-	addi	r6,r3,-4
-	cmplwi	0,r5,4
-	blt	7f
-	stwu	r4,4(r6)
-	beqlr
-	andi.	r0,r6,3
-	add	r5,r0,r5
-	subf	r6,r0,r6
-	srwi	r0,r5,2
+	cmplw	cr1,r5,r0		/* do we get that far? */
+	rldimi	r4,r4,32,0
+	mtcrf	1,r0
+	mr	r6,r3
+	blt	cr1,8f
+	beq+	3f			/* if already 8-byte aligned */
+	subf	r5,r0,r5
+	bf	31,1f
+	stb	r4,0(r6)
+	addi	r6,r6,1
+1:	bf	30,2f
+	sth	r4,0(r6)
+	addi	r6,r6,2
+2:	bf	29,3f
+	stw	r4,0(r6)
+	addi	r6,r6,4
+3:	srdi.	r0,r5,6
+	clrldi	r5,r5,58
 	mtctr	r0
-	bdz	6f
-1:	stwu	r4,4(r6)
-	bdnz	1b
-6:	andi.	r5,r5,3
-7:	cmpwi	0,r5,0
-	beqlr
-	mtctr	r5
-	addi	r6,r6,3
-8:	stbu	r4,1(r6)
-	bdnz	8b
+	beq	5f
+4:	std	r4,0(r6)
+	std	r4,8(r6)
+	std	r4,16(r6)
+	std	r4,24(r6)
+	std	r4,32(r6)
+	std	r4,40(r6)
+	std	r4,48(r6)
+	std	r4,56(r6)
+	addi	r6,r6,64
+	bdnz	4b
+5:	srwi.	r0,r5,3
+	clrlwi	r5,r5,29
+	mtcrf	1,r0
+	beq	8f
+	bf	29,6f
+	std	r4,0(r6)
+	std	r4,8(r6)
+	std	r4,16(r6)
+	std	r4,24(r6)
+	addi	r6,r6,32
+6:	bf	30,7f
+	std	r4,0(r6)
+	std	r4,8(r6)
+	addi	r6,r6,16
+7:	bf	31,8f
+	std	r4,0(r6)
+	addi	r6,r6,8
+8:	cmpwi	r5,0
+	mtcrf	1,r5
+	beqlr+
+	bf	29,9f
+	stw	r4,0(r6)
+	addi	r6,r6,4
+9:	bf	30,10f
+	sth	r4,0(r6)
+	addi	r6,r6,2
+10:	bflr	31
+	stb	r4,0(r6)
 	blr
 
 _GLOBAL(memmove)
diff --git a/arch/ppc64/mm/Makefile b/arch/ppc64/mm/Makefile
index c8cdcf1e1..0306babff 100644
--- a/arch/ppc64/mm/Makefile
+++ b/arch/ppc64/mm/Makefile
@@ -4,6 +4,6 @@
 
 EXTRA_CFLAGS += -mno-minimal-toc
 
-obj-y := fault.o init.o imalloc.o hash_utils.o hash_low.o tlb.o
+obj-y := fault.o init.o imalloc.o hash_utils.o hash_low.o tlb.o slb_low.o slb.o
 obj-$(CONFIG_DISCONTIGMEM) += numa.o
 obj-$(CONFIG_HUGETLB_PAGE) += hugetlbpage.o
diff --git a/arch/ppc64/mm/fault.c b/arch/ppc64/mm/fault.c
index ca2b86d56..b78e7f4ee 100644
--- a/arch/ppc64/mm/fault.c
+++ b/arch/ppc64/mm/fault.c
@@ -80,37 +80,69 @@ static int store_updates_sp(struct pt_regs *regs)
  *  - DSISR for a non-SLB data access fault,
  *  - SRR1 & 0x08000000 for a non-SLB instruction access fault
  *  - 0 any SLB fault.
+ * The return value is 0 if the fault was handled, or the signal
+ * number if this is a kernel fault that can't be handled here.
  */
-void do_page_fault(struct pt_regs *regs, unsigned long address,
-		   unsigned long error_code)
+int do_page_fault(struct pt_regs *regs, unsigned long address,
+		  unsigned long error_code)
 {
 	struct vm_area_struct * vma;
 	struct mm_struct *mm = current->mm;
 	siginfo_t info;
 	unsigned long code = SEGV_MAPERR;
 	unsigned long is_write = error_code & 0x02000000;
+	unsigned long trap = TRAP(regs);
 
-	if (regs->trap == 0x300 || regs->trap == 0x380) {
+	BUG_ON((trap == 0x380) || (trap == 0x480));
+
+	if (trap == 0x300) {
 		if (debugger_fault_handler(regs))
-			return;
+			return 0;
 	}
 
 	/* On a kernel SLB miss we can only check for a valid exception entry */
-	if (!user_mode(regs) && (regs->trap == 0x380)) {
-		bad_page_fault(regs, address, SIGSEGV);
-		return;
-	}
+	if (!user_mode(regs) && (address >= TASK_SIZE))
+		return SIGSEGV;
 
 	if (error_code & 0x00400000) {
 		if (debugger_dabr_match(regs))
-			return;
+			return 0;
 	}
 
 	if (in_atomic() || mm == NULL) {
-		bad_page_fault(regs, address, SIGSEGV);
-		return;
+		if (!user_mode(regs))
+			return SIGSEGV;
+		/* in_atomic() in user mode is really bad,
+		   as is current->mm == NULL. */
+		printk(KERN_EMERG "Page fault in user mode with"
+		       "in_atomic() = %d mm = %p\n", in_atomic(), mm);
+		printk(KERN_EMERG "NIP = %lx  MSR = %lx\n",
+		       regs->nip, regs->msr);
+		die("Weird page fault", regs, SIGSEGV);
+	}
+
+	/* When running in the kernel we expect faults to occur only to
+	 * addresses in user space.  All other faults represent errors in the
+	 * kernel and should generate an OOPS.  Unfortunatly, in the case of an
+	 * erroneous fault occuring in a code path which already holds mmap_sem
+	 * we will deadlock attempting to validate the fault against the
+	 * address space.  Luckily the kernel only validly references user
+	 * space from well defined areas of code, which are listed in the
+	 * exceptions table.
+	 *
+	 * As the vast majority of faults will be valid we will only perform
+	 * the source reference check when there is a possibilty of a deadlock.
+	 * Attempt to lock the address space, if we cannot we then validate the
+	 * source.  If this is invalid we can skip the address space check,
+	 * thus avoiding the deadlock.
+	 */
+	if (!down_read_trylock(&mm->mmap_sem)) {
+		if (!user_mode(regs) && !search_exception_tables(regs->nip))
+			goto bad_area_nosemaphore;
+
+		down_read(&mm->mmap_sem);
 	}
-	down_read(&mm->mmap_sem);
+
 	vma = find_vma(mm, address);
 	if (!vma)
 		goto bad_area;
@@ -195,23 +227,23 @@ good_area:
 	}
 
 	up_read(&mm->mmap_sem);
-	return;
+	return 0;
 
 bad_area:
 	up_read(&mm->mmap_sem);
 
+bad_area_nosemaphore:
 	/* User mode accesses cause a SIGSEGV */
 	if (user_mode(regs)) {
 		info.si_signo = SIGSEGV;
 		info.si_errno = 0;
 		info.si_code = code;
-		info.si_addr = (void *) address;
+		info.si_addr = (void __user *) address;
 		force_sig_info(SIGSEGV, &info, current);
-		return;
+		return 0;
 	}
 
-	bad_page_fault(regs, address, SIGSEGV);
-	return;
+	return SIGSEGV;
 
 /*
  * We ran out of memory, or some other thing happened to us that made
@@ -227,18 +259,19 @@ out_of_memory:
 	printk("VM: killing process %s\n", current->comm);
 	if (user_mode(regs))
 		do_exit(SIGKILL);
-	bad_page_fault(regs, address, SIGKILL);
-	return;
+	return SIGKILL;
 
 do_sigbus:
 	up_read(&mm->mmap_sem);
-	info.si_signo = SIGBUS;
-	info.si_errno = 0;
-	info.si_code = BUS_ADRERR;
-	info.si_addr = (void *)address;
-	force_sig_info (SIGBUS, &info, current);
-	if (!user_mode(regs))
-		bad_page_fault(regs, address, SIGBUS);
+	if (user_mode(regs)) {
+		info.si_signo = SIGBUS;
+		info.si_errno = 0;
+		info.si_code = BUS_ADRERR;
+		info.si_addr = (void __user *)address;
+		force_sig_info(SIGBUS, &info, current);
+		return 0;
+	}
+	return SIGBUS;
 }
 
 /*
diff --git a/arch/ppc64/mm/hash_utils.c b/arch/ppc64/mm/hash_utils.c
index 1df6d97e2..f40565840 100644
--- a/arch/ppc64/mm/hash_utils.c
+++ b/arch/ppc64/mm/hash_utils.c
@@ -316,7 +316,6 @@ int hash_page(unsigned long ea, unsigned long access, unsigned long trap)
 		ret = __hash_page(ea, access, vsid, ptep, trap, local);
 	}
 
-
 	return ret;
 }
 
diff --git a/arch/ppc64/mm/hugetlbpage.c b/arch/ppc64/mm/hugetlbpage.c
index 9416e53df..403c79bea 100644
--- a/arch/ppc64/mm/hugetlbpage.c
+++ b/arch/ppc64/mm/hugetlbpage.c
@@ -377,6 +377,7 @@ void unmap_hugepage_range(struct vm_area_struct *vma,
 	unsigned long addr;
 	hugepte_t *ptep;
 	struct page *page;
+	int cpu;
 	int local = 0;
 	cpumask_t tmp;
 
@@ -385,7 +386,8 @@ void unmap_hugepage_range(struct vm_area_struct *vma,
 	BUG_ON((end % HPAGE_SIZE) != 0);
 
 	/* XXX are there races with checking cpu_vm_mask? - Anton */
-	tmp = cpumask_of_cpu(smp_processor_id());
+	cpu = get_cpu();
+	tmp = cpumask_of_cpu(cpu);
 	if (cpus_equal(vma->vm_mm->cpu_vm_mask, tmp))
 		local = 1;
 
@@ -408,6 +410,7 @@ void unmap_hugepage_range(struct vm_area_struct *vma,
 
 		put_page(page);
 	}
+	put_cpu();
 
 	// mm->rss -= (end - start) >> PAGE_SHIFT;
 	vx_rsspages_sub(mm, (end - start) >> PAGE_SHIFT);
diff --git a/arch/ppc64/mm/init.c b/arch/ppc64/mm/init.c
index 84ceb2db2..99d923868 100644
--- a/arch/ppc64/mm/init.c
+++ b/arch/ppc64/mm/init.c
@@ -89,15 +89,15 @@ unsigned long	top_of_ram;
 
 void show_mem(void)
 {
-	int total = 0, reserved = 0;
-	int shared = 0, cached = 0;
+	unsigned long total = 0, reserved = 0;
+	unsigned long shared = 0, cached = 0;
 	struct page *page;
 	pg_data_t *pgdat;
 	unsigned long i;
 
 	printk("Mem-info:\n");
 	show_free_areas();
-	printk("Free swap:       %6dkB\n",nr_swap_pages<<(PAGE_SHIFT-10));
+	printk("Free swap:       %6ldkB\n", nr_swap_pages<<(PAGE_SHIFT-10));
 	for_each_pgdat(pgdat) {
 		for (i = 0; i < pgdat->node_spanned_pages; i++) {
 			page = pgdat->node_mem_map + i;
@@ -110,10 +110,10 @@ void show_mem(void)
 				shared += page_count(page) - 1;
 		}
 	}
-	printk("%d pages of RAM\n",total);
-	printk("%d reserved pages\n",reserved);
-	printk("%d pages shared\n",shared);
-	printk("%d pages swap cached\n",cached);
+	printk("%ld pages of RAM\n", total);
+	printk("%ld reserved pages\n", reserved);
+	printk("%ld pages shared\n", shared);
+	printk("%ld pages swap cached\n", cached);
 }
 
 #ifdef CONFIG_PPC_ISERIES
@@ -545,6 +545,8 @@ void __init do_init_bootmem(void)
 
 	boot_mapsize = init_bootmem(start >> PAGE_SHIFT, total_pages);
 
+	max_pfn = max_low_pfn;
+
 	/* add all physical memory to the bootmem map. Also find the first */
 	for (i=0; i < lmb.memory.cnt; i++) {
 		unsigned long physbase, size;
@@ -629,7 +631,6 @@ void __init mem_init(void)
 
 	num_physpages = max_low_pfn;	/* RAM is assumed contiguous */
 	high_memory = (void *) __va(max_low_pfn * PAGE_SIZE);
-	max_pfn = max_low_pfn;
 
 #ifdef CONFIG_DISCONTIGMEM
 {
@@ -654,7 +655,7 @@ void __init mem_init(void)
 
 	totalram_pages += free_all_bootmem();
 
-	for (addr = KERNELBASE; addr <= (unsigned long)__va(lmb_end_of_DRAM());
+	for (addr = KERNELBASE; addr < (unsigned long)__va(lmb_end_of_DRAM());
 	     addr += PAGE_SIZE) {
 		if (!PageReserved(virt_to_page(addr)))
 			continue;
@@ -765,6 +766,7 @@ void update_mmu_cache(struct vm_area_struct *vma, unsigned long ea,
 	pte_t *ptep;
 	int local = 0;
 	cpumask_t tmp;
+	unsigned long flags;
 
 	/* handle i-cache coherency */
 	if (!(cur_cpu_spec->cpu_features & CPU_FTR_COHERENT_ICACHE) &&
@@ -794,12 +796,14 @@ void update_mmu_cache(struct vm_area_struct *vma, unsigned long ea,
 
 	vsid = get_vsid(vma->vm_mm->context.id, ea);
 
+	local_irq_save(flags);
 	tmp = cpumask_of_cpu(smp_processor_id());
 	if (cpus_equal(vma->vm_mm->cpu_vm_mask, tmp))
 		local = 1;
 
 	__hash_page(ea, pte_val(pte) & (_PAGE_USER|_PAGE_RW), vsid, ptep,
 		    0x300, local);
+	local_irq_restore(flags);
 }
 
 void * reserve_phb_iospace(unsigned long size)
diff --git a/arch/ppc64/mm/numa.c b/arch/ppc64/mm/numa.c
index c1c4d6cd0..eb3313694 100644
--- a/arch/ppc64/mm/numa.c
+++ b/arch/ppc64/mm/numa.c
@@ -356,6 +356,7 @@ void __init do_init_bootmem(void)
 
 	min_low_pfn = 0;
 	max_low_pfn = lmb_end_of_DRAM() >> PAGE_SHIFT;
+	max_pfn = max_low_pfn;
 
 	if (parse_numa_properties())
 		setup_nonnuma();
@@ -457,7 +458,7 @@ void __init paging_init(void)
 		zones_size[ZONE_DMA] = end_pfn - start_pfn;
 		zholes_size[ZONE_DMA] = 0;
 		if (nid == 0)
-			zholes_size[ZONE_DMA] = node0_io_hole_size;
+			zholes_size[ZONE_DMA] = node0_io_hole_size >> PAGE_SHIFT;
 
 		dbg("free_area_init node %d %lx %lx (hole: %lx)\n", nid,
 		    zones_size[ZONE_DMA], start_pfn, zholes_size[ZONE_DMA]);
diff --git a/arch/ppc64/mm/tlb.c b/arch/ppc64/mm/tlb.c
index b616f9a40..8825e14cb 100644
--- a/arch/ppc64/mm/tlb.c
+++ b/arch/ppc64/mm/tlb.c
@@ -41,6 +41,33 @@ DEFINE_PER_CPU(struct mmu_gather, mmu_gathers);
 DEFINE_PER_CPU(struct pte_freelist_batch *, pte_freelist_cur);
 unsigned long pte_freelist_forced_free;
 
+void __pte_free_tlb(struct mmu_gather *tlb, struct page *ptepage)
+{
+	/* This is safe as we are holding page_table_lock */
+        cpumask_t local_cpumask = cpumask_of_cpu(smp_processor_id());
+	struct pte_freelist_batch **batchp = &__get_cpu_var(pte_freelist_cur);
+
+	if (atomic_read(&tlb->mm->mm_users) < 2 ||
+	    cpus_equal(tlb->mm->cpu_vm_mask, local_cpumask)) {
+		pte_free(ptepage);
+		return;
+	}
+
+	if (*batchp == NULL) {
+		*batchp = (struct pte_freelist_batch *)__get_free_page(GFP_ATOMIC);
+		if (*batchp == NULL) {
+			pte_free_now(ptepage);
+			return;
+		}
+		(*batchp)->index = 0;
+	}
+	(*batchp)->pages[(*batchp)->index++] = ptepage;
+	if ((*batchp)->index == PTE_FREELIST_SIZE) {
+		pte_free_submit(*batchp);
+		*batchp = NULL;
+	}
+}
+
 /*
  * Update the MMU hash table to correspond with a change to
  * a Linux PTE.  If wrprot is true, it is permissible to
@@ -91,12 +118,15 @@ void hpte_update(pte_t *ptep, unsigned long pte, int wrprot)
 void __flush_tlb_pending(struct ppc64_tlb_batch *batch)
 {
 	int i;
-	cpumask_t tmp = cpumask_of_cpu(smp_processor_id());
+	int cpu;
+	cpumask_t tmp;
 	int local = 0;
 
 	BUG_ON(in_interrupt());
 
+	cpu = get_cpu();
 	i = batch->index;
+	tmp = cpumask_of_cpu(cpu);
 	if (cpus_equal(batch->mm->cpu_vm_mask, tmp))
 		local = 1;
 
@@ -106,6 +136,7 @@ void __flush_tlb_pending(struct ppc64_tlb_batch *batch)
 	else
 		flush_hash_range(batch->context, i, local);
 	batch->index = 0;
+	put_cpu();
 }
 
 #ifdef CONFIG_SMP
@@ -127,9 +158,10 @@ void pte_free_now(struct page *ptepage)
 	pte_free(ptepage);
 }
 
-static void pte_free_rcu_callback(void *arg)
+static void pte_free_rcu_callback(struct rcu_head *head)
 {
-	struct pte_freelist_batch *batch = arg;
+	struct pte_freelist_batch *batch =
+		container_of(head, struct pte_freelist_batch, rcu);
 	unsigned int i;
 
 	for (i = 0; i < batch->index; i++)
@@ -140,7 +172,7 @@ static void pte_free_rcu_callback(void *arg)
 void pte_free_submit(struct pte_freelist_batch *batch)
 {
 	INIT_RCU_HEAD(&batch->rcu);
-	call_rcu(&batch->rcu, pte_free_rcu_callback, batch);
+	call_rcu(&batch->rcu, pte_free_rcu_callback);
 }
 
 void pte_free_finish(void)
diff --git a/arch/ppc64/oprofile/common.c b/arch/ppc64/oprofile/common.c
index 2d5ce46cb..391e9afba 100644
--- a/arch/ppc64/oprofile/common.c
+++ b/arch/ppc64/oprofile/common.c
@@ -154,8 +154,8 @@ int __init oprofile_arch_init(struct oprofile_operations **ops)
 			oprof_ppc64_ops.cpu_type = "ppc64/power4";
 			break;
 
-		case PV_GPUL:
-		case PV_GPULp:
+		case PV_970:
+		case PV_970FX:
 			model = &op_model_power4;
 			model->num_counters = 8;
 			oprof_ppc64_ops.cpu_type = "ppc64/970";
diff --git a/arch/ppc64/oprofile/op_model_power4.c b/arch/ppc64/oprofile/op_model_power4.c
index 6b132a8c6..8a0e7a867 100644
--- a/arch/ppc64/oprofile/op_model_power4.c
+++ b/arch/ppc64/oprofile/op_model_power4.c
@@ -42,7 +42,7 @@ static void power4_reg_setup(struct op_counter_config *ctr,
 	 *
 	 * It has been verified to work on POWER5 so we enable it there.
 	 */
-	if (!(__is_processor(PV_POWER4) || __is_processor(PV_POWER4p)))
+	if (cur_cpu_spec->cpu_features & CPU_FTR_MMCRA_SIHV)
 		mmcra_has_sihv = 1;
 
 	for (i = 0; i < num_counters; ++i)
diff --git a/arch/ppc64/xmon/xmon.c b/arch/ppc64/xmon/xmon.c
index 97b1509ac..d84ac32fa 100644
--- a/arch/ppc64/xmon/xmon.c
+++ b/arch/ppc64/xmon/xmon.c
@@ -30,6 +30,7 @@
 #include <asm/paca.h>
 #include <asm/ppcdebug.h>
 #include <asm/cputable.h>
+#include <asm/rtas.h>
 
 #include "nonstdio.h"
 #include "privinst.h"
@@ -44,9 +45,6 @@ static int xmon_owner;
 static int xmon_gate;
 #endif /* CONFIG_SMP */
 
-#define TRAP(regs)	((regs)->trap)
-#define FULL_REGS(regs)	1
-
 static unsigned long in_xmon = 0;
 
 static unsigned long adrs;
@@ -1614,7 +1612,7 @@ super_regs()
 		ptrPaca = get_paca();
     
 		printf("  Local Processor Control Area (LpPaca): \n");
-		ptrLpPaca = ptrPaca->xLpPacaPtr;
+		ptrLpPaca = ptrPaca->lppaca_ptr;
 		printf("    Saved Srr0=%.16lx  Saved Srr1=%.16lx \n",
 		       ptrLpPaca->xSavedSrr0, ptrLpPaca->xSavedSrr1);
 		printf("    Saved Gpr3=%.16lx  Saved Gpr4=%.16lx \n",
@@ -1622,7 +1620,7 @@ super_regs()
 		printf("    Saved Gpr5=%.16lx \n", ptrLpPaca->xSavedGpr5);
     
 		printf("  Local Processor Register Save Area (LpRegSave): \n");
-		ptrLpRegSave = ptrPaca->xLpRegSavePtr;
+		ptrLpRegSave = ptrPaca->reg_save_ptr;
 		printf("    Saved Sprg0=%.16lx  Saved Sprg1=%.16lx \n",
 		       ptrLpRegSave->xSPRG0, ptrLpRegSave->xSPRG0);
 		printf("    Saved Sprg2=%.16lx  Saved Sprg3=%.16lx \n",
@@ -2524,7 +2522,7 @@ static void dump_slb(void)
 static void dump_stab(void)
 {
 	int i;
-	unsigned long *tmp = (unsigned long *)get_paca()->xStab_data.virt;
+	unsigned long *tmp = (unsigned long *)get_paca()->stab_addr;
 
 	printf("Segment table contents of cpu %x\n", smp_processor_id());
 
diff --git a/arch/s390/Kconfig b/arch/s390/Kconfig
index c0b72b438..d11212073 100644
--- a/arch/s390/Kconfig
+++ b/arch/s390/Kconfig
@@ -67,9 +67,9 @@ config MARCH_Z900
 	  on older 31 bit only CPUs.
 
 config MARCH_Z990
-	bool "IBM eServer zSeries model z990"
+	bool "IBM eServer zSeries model z890 and z990"
 	help
-	  Select this enable optimizations for model z990.
+	  Select this enable optimizations for model z890/z990.
 	  This will be slightly faster but does not work on
 	  older machines such as the z900.
 
@@ -107,6 +107,15 @@ config NR_CPUS
 	  This is purely to save memory - each supported CPU adds
 	  approximately sixteen kilobytes to the kernel image.
 
+config HOTPLUG_CPU
+	bool "Support for hot-pluggable CPUs (EXPERIMENTAL)"
+	depends on SMP && HOTPLUG && EXPERIMENTAL
+	default n
+	help
+	  Say Y here to experiment with turning CPUs off and on.  CPUs
+	  can be controlled through /sys/devices/system/cpu/cpu#.
+	  Say N if you want to disable CPU hotplug.
+
 config MATHEMU
 	bool "IEEE FPU emulation"
 	depends on MARCH_G5
@@ -154,7 +163,7 @@ config QDIO
 	tristate "QDIO support"
 	---help---
 	  This driver provides the Queued Direct I/O base support for the
-	  IBM S/390 (G5 and G6) and eServer zSeries (z800, z900 and z990).
+	  IBM S/390 (G5 and G6) and eServer zSeries (z800, z890, z900 and z990).
 
 	  For details please refer to the documentation provided by IBM at
 	  <http://www10.software.ibm.com/developerworks/opensource/linux390>
@@ -172,6 +181,15 @@ config QDIO_PERF_STATS
 
 	  If unsure, say N.
 
+config QDIO_DEBUG
+	bool "Extended debugging information"
+	depends on QDIO
+	help
+	  Say Y here to get extended debugging output in /proc/s390dbf/qdio...
+	  Warning: this option reduces the performance of the QDIO module.
+
+	  If unsure, say N.
+
 comment "Misc"
 
 config PREEMPT
diff --git a/arch/s390/appldata/appldata_base.c b/arch/s390/appldata/appldata_base.c
index 0f8c08ad9..3589f48de 100644
--- a/arch/s390/appldata/appldata_base.c
+++ b/arch/s390/appldata/appldata_base.c
@@ -17,6 +17,7 @@
 #include <linux/errno.h>
 #include <asm/uaccess.h>
 #include <asm/io.h>
+#include <asm/smp.h>
 #include <linux/interrupt.h>
 #include <linux/proc_fs.h>
 #include <linux/page-flags.h>
@@ -25,6 +26,8 @@
 #include <linux/sysctl.h>
 #include <asm/timer.h>
 //#include <linux/kernel_stat.h>
+#include <linux/notifier.h>
+#include <linux/cpu.h>
 
 #include "appldata.h"
 
@@ -85,11 +88,11 @@ struct appldata_parameter_list {
  */
 static const char appldata_proc_name[APPLDATA_PROC_NAME_LENGTH] = "appldata";
 static int appldata_timer_handler(ctl_table *ctl, int write, struct file *filp,
-				  void __user *buffer, size_t *lenp);
+				  void __user *buffer, size_t *lenp, loff_t *ppos);
 static int appldata_interval_handler(ctl_table *ctl, int write,
 					 struct file *filp,
 					 void __user *buffer,
-					 size_t *lenp);
+					 size_t *lenp, loff_t *ppos);
 
 static struct ctl_table_header *appldata_sysctl_header;
 static struct ctl_table appldata_table[] = {
@@ -124,10 +127,6 @@ static struct ctl_table appldata_dir_table[] = {
  */
 DEFINE_PER_CPU(struct vtimer_list, appldata_timer);
 static atomic_t appldata_expire_count = ATOMIC_INIT(0);
-static struct appldata_mod_vtimer_args {
-	struct vtimer_list *timer;
-	u64    expires;
-} appldata_mod_vtimer_args;
 
 static spinlock_t appldata_timer_lock = SPIN_LOCK_UNLOCKED;
 static int appldata_interval = APPLDATA_CPU_INTERVAL;
@@ -154,7 +153,7 @@ static LIST_HEAD(appldata_ops_list);
 static void appldata_timer_function(unsigned long data, struct pt_regs *regs)
 {
 	P_DEBUG("   -= Timer =-\n");
-	P_DEBUG("CPU: %i, expire: %i\n", smp_processor_id(),
+	P_DEBUG("CPU: %i, expire_count: %i\n", smp_processor_id(),
 		atomic_read(&appldata_expire_count));
 	if (atomic_dec_and_test(&appldata_expire_count)) {
 		atomic_set(&appldata_expire_count, num_online_cpus());
@@ -187,17 +186,6 @@ static void appldata_tasklet_function(unsigned long data)
 	spin_unlock(&appldata_ops_lock);
 }
 
-/*
- * appldata_mod_vtimer_wrap()
- *
- * wrapper function for mod_virt_timer(), because smp_call_function_on()
- * accepts only one parameter.
- */
-static void appldata_mod_vtimer_wrap(void *p) {
-	struct appldata_mod_vtimer_args *args = p;
-	mod_virt_timer(args->timer, args->expires);
-}
-
 /*
  * appldata_diag()
  *
@@ -247,6 +235,79 @@ static int appldata_diag(char record_nr, u16 function, unsigned long buffer,
 
 
 /****************************** /proc stuff **********************************/
+
+/*
+ * appldata_mod_vtimer_wrap()
+ *
+ * wrapper function for mod_virt_timer(), because smp_call_function_on()
+ * accepts only one parameter.
+ */
+static void __appldata_mod_vtimer_wrap(void *p) {
+	struct {
+		struct vtimer_list *timer;
+		u64    expires;
+	} *args = p;
+	mod_virt_timer(args->timer, args->expires);
+}
+
+#define APPLDATA_ADD_TIMER	0
+#define APPLDATA_DEL_TIMER	1
+#define APPLDATA_MOD_TIMER	2
+
+/*
+ * __appldata_vtimer_setup()
+ *
+ * Add, delete or modify virtual timers on all online cpus.
+ * The caller needs to get the appldata_timer_lock spinlock.
+ */
+static void
+__appldata_vtimer_setup(int cmd)
+{
+	u64 per_cpu_interval;
+	int i;
+
+	switch (cmd) {
+	case APPLDATA_ADD_TIMER:
+		if (appldata_timer_active)
+			break;
+		per_cpu_interval = (u64) (appldata_interval*1000 /
+					  num_online_cpus()) * TOD_MICRO;
+		for_each_online_cpu(i) {
+			per_cpu(appldata_timer, i).expires = per_cpu_interval;
+			smp_call_function_on(add_virt_timer_periodic,
+					     &per_cpu(appldata_timer, i),
+					     0, 1, i);
+		}
+		appldata_timer_active = 1;
+		P_INFO("Monitoring timer started.\n");
+		break;
+	case APPLDATA_DEL_TIMER:
+		for_each_online_cpu(i)
+			del_virt_timer(&per_cpu(appldata_timer, i));
+		if (!appldata_timer_active)
+			break;
+		appldata_timer_active = 0;
+		atomic_set(&appldata_expire_count, num_online_cpus());
+		P_INFO("Monitoring timer stopped.\n");
+		break;
+	case APPLDATA_MOD_TIMER:
+		per_cpu_interval = (u64) (appldata_interval*1000 /
+					  num_online_cpus()) * TOD_MICRO;
+		if (!appldata_timer_active)
+			break;
+		for_each_online_cpu(i) {
+			struct {
+				struct vtimer_list *timer;
+				u64    expires;
+			} args;
+			args.timer = &per_cpu(appldata_timer, i);
+			args.expires = per_cpu_interval;
+			smp_call_function_on(__appldata_mod_vtimer_wrap,
+					     &args, 0, 1, i);
+		}
+	}
+}
+
 /*
  * appldata_timer_handler()
  *
@@ -254,13 +315,12 @@ static int appldata_diag(char record_nr, u16 function, unsigned long buffer,
  */
 static int
 appldata_timer_handler(ctl_table *ctl, int write, struct file *filp,
-			   void __user *buffer, size_t *lenp)
+			   void __user *buffer, size_t *lenp, loff_t *ppos)
 {
-	int len, i;
+	int len;
 	char buf[2];
-	u64 per_cpu_interval;
 
-	if (!*lenp || filp->f_pos) {
+	if (!*lenp || *ppos) {
 		*lenp = 0;
 		return 0;
 	}
@@ -272,34 +332,18 @@ appldata_timer_handler(ctl_table *ctl, int write, struct file *filp,
 			return -EFAULT;
 		goto out;
 	}
-	per_cpu_interval = (u64) (appldata_interval*1000 /
-				 num_online_cpus()) * TOD_MICRO;
 	len = *lenp;
 	if (copy_from_user(buf, buffer, len > sizeof(buf) ? sizeof(buf) : len))
 		return -EFAULT;
 	spin_lock(&appldata_timer_lock);
-	per_cpu_interval = (u64) (appldata_interval*1000 /
-				 num_online_cpus()) * TOD_MICRO;
-	if ((buf[0] == '1') && (!appldata_timer_active)) {
-		for (i = 0; i < num_online_cpus(); i++) {
-			per_cpu(appldata_timer, i).expires = per_cpu_interval;
-			smp_call_function_on(add_virt_timer_periodic,
-						&per_cpu(appldata_timer, i),
-						0, 1, i);
-		}
-		appldata_timer_active = 1;
-		P_INFO("Monitoring timer started.\n");
-	} else if ((buf[0] == '0') && (appldata_timer_active)) {
-		for (i = 0; i < num_online_cpus(); i++) {
-			del_virt_timer(&per_cpu(appldata_timer, i));
-		}
-		appldata_timer_active = 0;
-		P_INFO("Monitoring timer stopped.\n");
-	}
+	if (buf[0] == '1')
+		__appldata_vtimer_setup(APPLDATA_ADD_TIMER);
+	else if (buf[0] == '0')
+		__appldata_vtimer_setup(APPLDATA_DEL_TIMER);
 	spin_unlock(&appldata_timer_lock);
 out:
 	*lenp = len;
-	filp->f_pos += len;
+	*ppos += len;
 	return 0;
 }
 
@@ -311,13 +355,12 @@ out:
  */
 static int
 appldata_interval_handler(ctl_table *ctl, int write, struct file *filp,
-			   void __user *buffer, size_t *lenp)
+			   void __user *buffer, size_t *lenp, loff_t *ppos)
 {
-	int len, i, interval;
+	int len, interval;
 	char buf[16];
-	u64 per_cpu_interval;
 
-	if (!*lenp || filp->f_pos) {
+	if (!*lenp || *ppos) {
 		*lenp = 0;
 		return 0;
 	}
@@ -340,27 +383,15 @@ appldata_interval_handler(ctl_table *ctl, int write, struct file *filp,
 	}
 
 	spin_lock(&appldata_timer_lock);
-	per_cpu_interval = (u64) (interval*1000 / num_online_cpus()) * TOD_MICRO;
 	appldata_interval = interval;
-	if (appldata_timer_active) {
-		for (i = 0; i < num_online_cpus(); i++) {
-			appldata_mod_vtimer_args.timer =
-					&per_cpu(appldata_timer, i);
-			appldata_mod_vtimer_args.expires =
-					per_cpu_interval;
-			smp_call_function_on(
-				appldata_mod_vtimer_wrap,
-				&appldata_mod_vtimer_args,
-				0, 1, i);
-		}
-	}
+	__appldata_vtimer_setup(APPLDATA_MOD_TIMER);
 	spin_unlock(&appldata_timer_lock);
 
 	P_INFO("Monitoring CPU interval set to %u milliseconds.\n",
 		 interval);
 out:
 	*lenp = len;
-	filp->f_pos += len;
+	*ppos += len;
 	return 0;
 }
 
@@ -372,7 +403,7 @@ out:
  */
 static int
 appldata_generic_handler(ctl_table *ctl, int write, struct file *filp,
-			   void __user *buffer, size_t *lenp)
+			   void __user *buffer, size_t *lenp, loff_t *ppos)
 {
 	struct appldata_ops *ops = NULL, *tmp_ops;
 	int rc, len, found;
@@ -398,7 +429,7 @@ appldata_generic_handler(ctl_table *ctl, int write, struct file *filp,
 	}
 	spin_unlock_bh(&appldata_ops_lock);
 
-	if (!*lenp || filp->f_pos) {
+	if (!*lenp || *ppos) {
 		*lenp = 0;
 		module_put(ops->owner);
 		return 0;
@@ -457,7 +488,7 @@ appldata_generic_handler(ctl_table *ctl, int write, struct file *filp,
 	spin_unlock_bh(&appldata_ops_lock);
 out:
 	*lenp = len;
-	filp->f_pos += len;
+	*ppos += len;
 	module_put(ops->owner);
 	return 0;
 }
@@ -564,6 +595,56 @@ void appldata_unregister_ops(struct appldata_ops *ops)
 
 
 /******************************* init / exit *********************************/
+
+static void
+appldata_online_cpu(int cpu)
+{
+	init_virt_timer(&per_cpu(appldata_timer, cpu));
+	per_cpu(appldata_timer, cpu).function = appldata_timer_function;
+	per_cpu(appldata_timer, cpu).data = (unsigned long)
+		&appldata_tasklet_struct;
+	atomic_inc(&appldata_expire_count);
+	spin_lock(&appldata_timer_lock);
+	__appldata_vtimer_setup(APPLDATA_MOD_TIMER);
+	spin_unlock(&appldata_timer_lock);
+}
+
+static void
+appldata_offline_cpu(int cpu)
+{
+	del_virt_timer(&per_cpu(appldata_timer, cpu));
+	if (atomic_dec_and_test(&appldata_expire_count)) {
+		atomic_set(&appldata_expire_count, num_online_cpus());
+		tasklet_schedule(&appldata_tasklet_struct);
+	}
+	spin_lock(&appldata_timer_lock);
+	__appldata_vtimer_setup(APPLDATA_MOD_TIMER);
+	spin_unlock(&appldata_timer_lock);
+}
+
+static int
+appldata_cpu_notify(struct notifier_block *self,
+		    unsigned long action, void *hcpu)
+{
+	switch (action) {
+	case CPU_ONLINE:
+		appldata_online_cpu((long) hcpu);
+		break;
+#ifdef CONFIG_HOTPLUG_CPU
+	case CPU_DEAD:
+		appldata_offline_cpu((long) hcpu);
+		break;
+#endif
+	default:
+		break;
+	}
+	return NOTIFY_OK;
+}
+
+static struct notifier_block __devinitdata appldata_nb = {
+	.notifier_call = appldata_cpu_notify,
+};
+
 /*
  * appldata_init()
  *
@@ -576,13 +657,11 @@ static int __init appldata_init(void)
 	P_DEBUG("sizeof(parameter_list) = %lu\n",
 		sizeof(struct appldata_parameter_list));
 
-	for (i = 0; i < num_online_cpus(); i++) {
-		init_virt_timer(&per_cpu(appldata_timer, i));
-		per_cpu(appldata_timer, i).function = appldata_timer_function;
-		per_cpu(appldata_timer, i).data = (unsigned long)
-						&appldata_tasklet_struct;
-	}
-	atomic_set(&appldata_expire_count, num_online_cpus());
+	for_each_online_cpu(i)
+		appldata_online_cpu(i);
+
+	/* Register cpu hotplug notifier */
+	register_cpu_notifier(&appldata_nb);
 
 	appldata_sysctl_header = register_sysctl_table(appldata_dir_table, 1);
 #ifdef MODULE
@@ -623,9 +702,9 @@ static void __exit appldata_exit(void)
 	}
 	spin_unlock_bh(&appldata_ops_lock);
 
-	for (i = 0; i < num_online_cpus(); i++) {
-		del_virt_timer(&per_cpu(appldata_timer, i));
-	}
+	for_each_online_cpu(i)
+		appldata_offline_cpu(i);
+
 	appldata_timer_active = 0;
 
 	unregister_sysctl_table(appldata_sysctl_header);
diff --git a/arch/s390/appldata/appldata_os.c b/arch/s390/appldata/appldata_os.c
index 58ad2cf48..b83f07484 100644
--- a/arch/s390/appldata/appldata_os.c
+++ b/arch/s390/appldata/appldata_os.c
@@ -98,8 +98,7 @@ static inline void appldata_print_debug(struct appldata_os_data *os_data)
 		LOAD_INT(a2), LOAD_FRAC(a2));
 
 	P_DEBUG("nr_cpus = %u\n", os_data->nr_cpus);
-	for (i = 0; i < NR_CPUS; i++) {
-		if (!cpu_online(i)) continue;
+	for (i = 0; i < os_data->nr_cpus; i++) {
 		P_DEBUG("cpu%u : user = %u, nice = %u, system = %u, "
 			"idle = %u, irq = %u, softirq = %u, iowait = %u\n",
 				i,
@@ -124,7 +123,7 @@ static inline void appldata_print_debug(struct appldata_os_data *os_data)
  */
 static void appldata_get_os_data(void *data)
 {
-	int i;
+	int i, j;
 	struct appldata_os_data *os_data;
 
 	os_data = data;
@@ -139,21 +138,23 @@ static void appldata_get_os_data(void *data)
 	os_data->avenrun[1] = avenrun[1] + (FIXED_1/200);
 	os_data->avenrun[2] = avenrun[2] + (FIXED_1/200);
 
-	for (i = 0; i < num_online_cpus(); i++) {
-		os_data->os_cpu[i].per_cpu_user =
+	j = 0;
+	for_each_online_cpu(i) {
+		os_data->os_cpu[j].per_cpu_user =
 					kstat_cpu(i).cpustat.user;
-		os_data->os_cpu[i].per_cpu_nice =
+		os_data->os_cpu[j].per_cpu_nice =
 					kstat_cpu(i).cpustat.nice;
-		os_data->os_cpu[i].per_cpu_system =
+		os_data->os_cpu[j].per_cpu_system =
 					kstat_cpu(i).cpustat.system;
-		os_data->os_cpu[i].per_cpu_idle =
+		os_data->os_cpu[j].per_cpu_idle =
 					kstat_cpu(i).cpustat.idle;
-		os_data->os_cpu[i].per_cpu_irq =
+		os_data->os_cpu[j].per_cpu_irq =
 					kstat_cpu(i).cpustat.irq;
-		os_data->os_cpu[i].per_cpu_softirq =
+		os_data->os_cpu[j].per_cpu_softirq =
 					kstat_cpu(i).cpustat.softirq;
-		os_data->os_cpu[i].per_cpu_iowait =
+		os_data->os_cpu[j].per_cpu_iowait =
 					kstat_cpu(i).cpustat.iowait;
+		j++;
 	}
 
 	os_data->timestamp = get_clock();
diff --git a/arch/s390/defconfig b/arch/s390/defconfig
index c694ae543..d4cd42c3e 100644
--- a/arch/s390/defconfig
+++ b/arch/s390/defconfig
@@ -11,7 +11,6 @@ CONFIG_UID16=y
 #
 CONFIG_EXPERIMENTAL=y
 CONFIG_CLEAN_COMPILE=y
-CONFIG_STANDALONE=y
 
 #
 # General setup
@@ -29,6 +28,7 @@ CONFIG_IKCONFIG_PROC=y
 # CONFIG_EMBEDDED is not set
 CONFIG_KALLSYMS=y
 # CONFIG_KALLSYMS_ALL is not set
+# CONFIG_KALLSYMS_EXTRA_PASS is not set
 CONFIG_FUTEX=y
 CONFIG_EPOLL=y
 CONFIG_IOSCHED_NOOP=y
@@ -61,6 +61,7 @@ CONFIG_MARCH_G5=y
 # CONFIG_MARCH_Z990 is not set
 CONFIG_SMP=y
 CONFIG_NR_CPUS=32
+# CONFIG_HOTPLUG_CPU is not set
 CONFIG_MATHEMU=y
 
 #
@@ -69,6 +70,7 @@ CONFIG_MATHEMU=y
 CONFIG_MACHCHK_WARNING=y
 CONFIG_QDIO=y
 # CONFIG_QDIO_PERF_STATS is not set
+# CONFIG_QDIO_DEBUG is not set
 
 #
 # Misc
@@ -84,12 +86,15 @@ CONFIG_PFAULT=y
 # CONFIG_SHARED_KERNEL is not set
 # CONFIG_CMM is not set
 # CONFIG_VIRT_TIMER is not set
-# CONFIG_NO_IDLE_HZ is not set
+CONFIG_NO_IDLE_HZ=y
+CONFIG_NO_IDLE_HZ_INIT=y
 # CONFIG_PCMCIA is not set
 
 #
 # Generic Driver Options
 #
+CONFIG_STANDALONE=y
+CONFIG_PREVENT_FIRMWARE_BUILD=y
 # CONFIG_FW_LOADER is not set
 # CONFIG_DEBUG_DRIVER is not set
 
@@ -120,13 +125,12 @@ CONFIG_SCSI_LOGGING=y
 # SCSI Transport Attributes
 #
 # CONFIG_SCSI_SPI_ATTRS is not set
-# CONFIG_SCSI_FC_ATTRS is not set
+CONFIG_SCSI_FC_ATTRS=y
 
 #
 # SCSI low-level drivers
 #
 # CONFIG_SCSI_AIC7XXX_OLD is not set
-# CONFIG_SCSI_DPT_I2O is not set
 # CONFIG_SCSI_SATA is not set
 # CONFIG_SCSI_EATA_PIO is not set
 # CONFIG_SCSI_DEBUG is not set
@@ -258,17 +262,18 @@ CONFIG_XFRM=y
 # 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=y
+CONFIG_NET_SCH_CLK_JIFFIES=y
+# CONFIG_NET_SCH_CLK_GETTIMEOFDAY is not set
+# CONFIG_NET_SCH_CLK_CPU is not set
 CONFIG_NET_SCH_CBQ=m
 # CONFIG_NET_SCH_HTB is not set
 # CONFIG_NET_SCH_HFSC is not set
-CONFIG_NET_SCH_CSZ=m
 CONFIG_NET_SCH_PRIO=m
 CONFIG_NET_SCH_RED=m
 CONFIG_NET_SCH_SFQ=m
@@ -276,7 +281,8 @@ CONFIG_NET_SCH_TEQL=m
 CONFIG_NET_SCH_TBF=m
 CONFIG_NET_SCH_GRED=m
 CONFIG_NET_SCH_DSMARK=m
-# CONFIG_NET_SCH_DELAY is not set
+# CONFIG_NET_SCH_NETEM is not set
+# CONFIG_NET_SCH_INGRESS is not set
 CONFIG_NET_QOS=y
 CONFIG_NET_ESTIMATOR=y
 CONFIG_NET_CLS=y
@@ -285,8 +291,11 @@ CONFIG_NET_CLS_ROUTE4=m
 CONFIG_NET_CLS_ROUTE=y
 CONFIG_NET_CLS_FW=m
 CONFIG_NET_CLS_U32=m
+# CONFIG_CLS_U32_PERF is not set
+# CONFIG_NET_CLS_IND is not set
 CONFIG_NET_CLS_RSVP=m
 CONFIG_NET_CLS_RSVP6=m
+# CONFIG_NET_CLS_ACT is not set
 CONFIG_NET_CLS_POLICE=y
 
 #
@@ -311,7 +320,11 @@ CONFIG_NET_ETHERNET=y
 # CONFIG_MII is not set
 
 #
-# Gigabit Ethernet (1000/10000 Mbit)
+# Ethernet (1000 Mbit)
+#
+
+#
+# Ethernet (10000 Mbit)
 #
 
 #
@@ -380,7 +393,8 @@ CONFIG_FS_MBCACHE=y
 #
 # DOS/FAT/NT Filesystems
 #
-# CONFIG_FAT_FS is not set
+# CONFIG_MSDOS_FS is not set
+# CONFIG_VFAT_FS is not set
 # CONFIG_NTFS_FS is not set
 
 #
@@ -405,6 +419,7 @@ CONFIG_RAMFS=y
 # CONFIG_BEFS_FS is not set
 # CONFIG_BFS_FS is not set
 # CONFIG_EFS_FS is not set
+# CONFIG_JFFS2_COMPRESSION_OPTIONS is not set
 # CONFIG_CRAMFS is not set
 # CONFIG_VXFS_FS is not set
 # CONFIG_HPFS_FS is not set
@@ -422,7 +437,7 @@ CONFIG_NFS_V3=y
 CONFIG_NFSD=y
 CONFIG_NFSD_V3=y
 # CONFIG_NFSD_V4 is not set
-# CONFIG_NFSD_TCP is not set
+CONFIG_NFSD_TCP=y
 CONFIG_LOCKD=y
 CONFIG_LOCKD_V4=y
 CONFIG_EXPORTFS=y
@@ -450,7 +465,6 @@ CONFIG_MSDOS_PARTITION=y
 # CONFIG_SOLARIS_X86_PARTITION is not set
 # CONFIG_UNIXWARE_DISKLABEL is not set
 # CONFIG_LDM_PARTITION is not set
-# CONFIG_NEC98_PARTITION is not set
 # CONFIG_SGI_PARTITION is not set
 # CONFIG_ULTRIX_PARTITION is not set
 # CONFIG_SUN_PARTITION is not set
@@ -497,9 +511,10 @@ CONFIG_CRYPTO=y
 # CONFIG_CRYPTO_BLOWFISH is not set
 # CONFIG_CRYPTO_TWOFISH is not set
 # CONFIG_CRYPTO_SERPENT is not set
-# CONFIG_CRYPTO_AES is not set
+# CONFIG_CRYPTO_AES_GENERIC is not set
 # CONFIG_CRYPTO_CAST5 is not set
 # CONFIG_CRYPTO_CAST6 is not set
+# CONFIG_CRYPTO_TEA is not set
 # CONFIG_CRYPTO_ARC4 is not set
 # CONFIG_CRYPTO_DEFLATE is not set
 # CONFIG_CRYPTO_MICHAEL_MIC is not set
@@ -509,5 +524,6 @@ CONFIG_CRYPTO=y
 #
 # Library routines
 #
+# CONFIG_CRC_CCITT is not set
 # CONFIG_CRC32 is not set
 # CONFIG_LIBCRC32C is not set
diff --git a/arch/s390/kernel/Makefile b/arch/s390/kernel/Makefile
index 262ae873c..892b7e1b0 100644
--- a/arch/s390/kernel/Makefile
+++ b/arch/s390/kernel/Makefile
@@ -23,6 +23,8 @@ obj-$(CONFIG_BINFMT_ELF32)	+= binfmt_elf32.o
 obj-$(CONFIG_ARCH_S390_31)	+= entry.o reipl.o
 obj-$(CONFIG_ARCH_S390X)	+= entry64.o reipl64.o
 
+obj-$(CONFIG_VIRT_TIMER)	+= vtime.o
+
 #
 # This is just to get the dependencies...
 #
diff --git a/arch/s390/kernel/compat_linux.h b/arch/s390/kernel/compat_linux.h
index a0e6722b6..48209a81a 100644
--- a/arch/s390/kernel/compat_linux.h
+++ b/arch/s390/kernel/compat_linux.h
@@ -214,4 +214,7 @@ struct sigevent32 {
 	} _sigev_un;
 };
 
+extern int copy_siginfo_to_user32(siginfo_t32 __user *to, siginfo_t *from);
+extern int copy_siginfo_from_user32(siginfo_t *to, siginfo_t32 __user *from);
+
 #endif /* _ASM_S390X_S390_H */
diff --git a/arch/s390/kernel/compat_signal.c b/arch/s390/kernel/compat_signal.c
index 67134eee7..e8c8b2fe7 100644
--- a/arch/s390/kernel/compat_signal.c
+++ b/arch/s390/kernel/compat_signal.c
@@ -40,6 +40,7 @@ typedef struct
 	__u8 callee_used_stack[__SIGNAL_FRAMESIZE32];
 	struct sigcontext32 sc;
 	_sigregs32 sregs;
+	int signo;
 	__u8 retcode[S390_SYSCALL_SIZE];
 } sigframe32;
 
@@ -105,6 +106,53 @@ int copy_siginfo_to_user32(siginfo_t32 __user *to, siginfo_t *from)
 	return err;
 }
 
+int copy_siginfo_from_user32(siginfo_t *to, siginfo_t32 __user *from)
+{
+	int err;
+	u32 tmp;
+
+	if (!access_ok (VERIFY_READ, from, sizeof(siginfo_t32)))
+		return -EFAULT;
+
+	err = __get_user(to->si_signo, &from->si_signo);
+	err |= __get_user(to->si_errno, &from->si_errno);
+	err |= __get_user(to->si_code, &from->si_code);
+
+	if (from->si_code < 0)
+		err |= __copy_from_user(&to->_sifields._pad, &from->_sifields._pad, SI_PAD_SIZE);
+	else {
+		switch (from->si_code >> 16) {
+		case __SI_RT >> 16: /* This is not generated by the kernel as of now.  */
+		case __SI_MESGQ >> 16:
+			err |= __get_user(to->si_int, &from->si_int);
+			/* fallthrough */
+		case __SI_KILL >> 16:
+			err |= __get_user(to->si_pid, &from->si_pid);
+			err |= __get_user(to->si_uid, &from->si_uid);
+			break;
+		case __SI_CHLD >> 16:
+			err |= __get_user(to->si_pid, &from->si_pid);
+			err |= __get_user(to->si_uid, &from->si_uid);
+			err |= __get_user(to->si_utime, &from->si_utime);
+			err |= __get_user(to->si_stime, &from->si_stime);
+			err |= __get_user(to->si_status, &from->si_status);
+			break;
+		case __SI_FAULT >> 16:
+			err |= __get_user(tmp, &from->si_addr);
+			to->si_addr = (void *)(u64) (tmp & PSW32_ADDR_INSN);
+			break;
+		case __SI_POLL >> 16:
+		case __SI_TIMER >> 16:
+			err |= __get_user(to->si_band, &from->si_band);
+			err |= __get_user(to->si_fd, &from->si_fd);
+			break;
+		default:
+			break;
+		}
+	}
+	return err;
+}
+
 /*
  * Atomically swap in the new signal mask, and wait for a signal.
  */
@@ -497,6 +545,10 @@ static void setup_frame32(int sig, struct k_sigaction *ka,
 	   To avoid breaking binary compatibility, they are passed as args. */
 	regs->gprs[4] = current->thread.trap_no;
 	regs->gprs[5] = current->thread.prot_addr;
+
+	/* Place signal number on stack to allow backtrace from handler.  */
+	if (__put_user(regs->gprs[2], (int __user *) &frame->signo))
+		goto give_sigsegv;
 	return;
 
 give_sigsegv:
diff --git a/arch/s390/kernel/debug.c b/arch/s390/kernel/debug.c
index 540a9a8bc..f1e538c9d 100644
--- a/arch/s390/kernel/debug.c
+++ b/arch/s390/kernel/debug.c
@@ -54,7 +54,7 @@ typedef struct
          *
          */
 	long args[0];
-} debug_sprintf_entry;
+} debug_sprintf_entry_t;
 
 
 extern void tod_to_timeval(uint64_t todval, struct timeval *xtime);
@@ -88,7 +88,7 @@ static int debug_raw_header_fn(debug_info_t * id, struct debug_view *view,
                          int area, debug_entry_t * entry, char *out_buf);
 
 static int debug_sprintf_format_fn(debug_info_t * id, struct debug_view *view,
-				   char *out_buf, debug_sprintf_entry *curr_event);
+				   char *out_buf, debug_sprintf_entry_t *curr_event);
 
 /* globals */
 
@@ -692,31 +692,21 @@ extern inline debug_entry_t *get_active_entry(debug_info_t * id)
 }
 
 /*
- * debug_common:
+ * debug_finish_entry:
  * - set timestamp, caller address, cpu number etc.
  */
 
-extern inline debug_entry_t *debug_common(debug_info_t * id, int level, 
-                                    const void *buf, int len, int exception)
+extern inline void debug_finish_entry(debug_info_t * id, debug_entry_t* active,
+		int level, int exception)
 {
-	unsigned long flags;
-	debug_entry_t *active;
-
-	spin_lock_irqsave(&id->lock, flags);
-	active = get_active_entry(id);
 	STCK(active->id.stck);
 	active->id.fields.cpuid = smp_processor_id();
 	active->caller = __builtin_return_address(0);
 	active->id.fields.exception = exception;
 	active->id.fields.level     = level;
-	memset(DEBUG_DATA(active), 0, id->buf_size);
-	memcpy(DEBUG_DATA(active), buf, MIN(len, id->buf_size));
 	proceed_active_entry(id);
 	if(exception)
 		proceed_active_area(id);
-	spin_unlock_irqrestore(&id->lock, flags);
-
-	return active;
 }
 
 /*
@@ -727,7 +717,17 @@ extern inline debug_entry_t *debug_common(debug_info_t * id, int level,
 debug_entry_t *debug_event_common(debug_info_t * id, int level, const void *buf,
 			          int len)
 {
-	return debug_common(id, level, buf, len, 0);
+	unsigned long flags;
+	debug_entry_t *active;
+
+	spin_lock_irqsave(&id->lock, flags);
+	active = get_active_entry(id);
+	memset(DEBUG_DATA(active), 0, id->buf_size);
+	memcpy(DEBUG_DATA(active), buf, MIN(len, id->buf_size));
+	debug_finish_entry(id, active, level, 0);
+	spin_unlock_irqrestore(&id->lock, flags);
+
+	return active;
 }
 
 /*
@@ -738,7 +738,17 @@ debug_entry_t *debug_event_common(debug_info_t * id, int level, const void *buf,
 debug_entry_t *debug_exception_common(debug_info_t * id, int level, 
                                       const void *buf, int len)
 {
-	return debug_common(id, level, buf, len, 1);
+	unsigned long flags;
+	debug_entry_t *active;
+
+	spin_lock_irqsave(&id->lock, flags);
+	active = get_active_entry(id);
+	memset(DEBUG_DATA(active), 0, id->buf_size);
+	memcpy(DEBUG_DATA(active), buf, MIN(len, id->buf_size));
+	debug_finish_entry(id, active, level, 1);
+	spin_unlock_irqrestore(&id->lock, flags);
+
+	return active;
 }
 
 /*
@@ -764,27 +774,28 @@ debug_entry_t *debug_sprintf_event(debug_info_t* id,
                                    int level,char *string,...)
 {
 	va_list   ap;
-	int numargs,alloc_size,idx;
-	debug_sprintf_entry *curr_event;
-	debug_entry_t *retval = NULL;
+	int numargs,idx;
+	unsigned long flags;
+	debug_sprintf_entry_t *curr_event;
+	debug_entry_t *active;
 
 	if((!id) || (level > id->level))
 		return NULL;
-	else {
-		numargs=debug_count_numargs(string);
-		alloc_size=offsetof(debug_sprintf_entry,args[numargs]);
-		curr_event=alloca(alloc_size);
-
-		if(curr_event){
-			va_start(ap,string);
-			curr_event->string=string;
-			for(idx=0;idx<numargs;idx++)
-				curr_event->args[idx]=va_arg(ap,long);
-			retval=debug_common(id,level, curr_event,alloc_size,0);
-			va_end(ap);
-		}
-		return retval;
-	}
+
+	numargs=debug_count_numargs(string);
+
+	spin_lock_irqsave(&id->lock, flags);
+	active = get_active_entry(id);
+	curr_event=(debug_sprintf_entry_t *) DEBUG_DATA(active);
+	va_start(ap,string);
+	curr_event->string=string;
+	for(idx=0;idx<MIN(numargs,((id->buf_size / sizeof(long))-1));idx++)
+		curr_event->args[idx]=va_arg(ap,long);
+	va_end(ap);
+	debug_finish_entry(id, active, level, 0);
+	spin_unlock_irqrestore(&id->lock, flags);
+
+	return active;
 }
 
 /*
@@ -795,27 +806,28 @@ debug_entry_t *debug_sprintf_exception(debug_info_t* id,
                                        int level,char *string,...)
 {
 	va_list   ap;
-	int numargs,alloc_size,idx;
-	debug_sprintf_entry *curr_event;
-	debug_entry_t *retval = NULL;
+	int numargs,idx;
+	unsigned long flags;
+	debug_sprintf_entry_t *curr_event;
+	debug_entry_t *active;
 
 	if((!id) || (level > id->level))
 		return NULL;
-	else {
-		numargs=debug_count_numargs(string);
-		alloc_size=offsetof(debug_sprintf_entry,args[numargs]);
-		curr_event=alloca(alloc_size);
-
-		if(curr_event){
-			va_start(ap,string);
-			curr_event->string=string;
-			for(idx=0;idx<numargs;idx++)
-				curr_event->args[idx]=va_arg(ap,long);
-			retval=debug_common(id,level, curr_event,alloc_size,1);
-			va_end(ap);
-		}
-		return retval;
-	}
+
+	numargs=debug_count_numargs(string);
+
+	spin_lock_irqsave(&id->lock, flags);
+	active = get_active_entry(id);
+	curr_event=(debug_sprintf_entry_t *)DEBUG_DATA(active);
+	va_start(ap,string);
+	curr_event->string=string;
+	for(idx=0;idx<MIN(numargs,((id->buf_size / sizeof(long))-1));idx++)
+		curr_event->args[idx]=va_arg(ap,long);
+	va_end(ap);
+	debug_finish_entry(id, active, level, 1);
+	spin_unlock_irqrestore(&id->lock, flags);
+
+	return active;
 }
 
 /*
@@ -1127,7 +1139,7 @@ int debug_dflt_header_fn(debug_info_t * id, struct debug_view *view,
 #define DEBUG_SPRINTF_MAX_ARGS 10
 
 int debug_sprintf_format_fn(debug_info_t * id, struct debug_view *view,
-                            char *out_buf, debug_sprintf_entry *curr_event)
+                            char *out_buf, debug_sprintf_entry_t *curr_event)
 {
 	int num_longs, num_used_args = 0,i, rc = 0;
 	int index[DEBUG_SPRINTF_MAX_ARGS];
diff --git a/arch/s390/kernel/entry.S b/arch/s390/kernel/entry.S
index f716b41f0..1f87bf29c 100644
--- a/arch/s390/kernel/entry.S
+++ b/arch/s390/kernel/entry.S
@@ -62,107 +62,53 @@ _TIF_WORK_INT = (_TIF_SIGPENDING | _TIF_NEED_RESCHED)
  *    R15 - kernel stack pointer
  */
 
-        .macro  SAVE_ALL_BASE psworg,savearea,sync
-        stm     %r12,%r15,\savearea
-	l	%r13,__LC_SVC_NEW_PSW+4   # load &system_call to %r13
+	.macro	SAVE_ALL_BASE savearea
+	stm	%r12,%r15,\savearea
+	l	%r13,__LC_SVC_NEW_PSW+4	# load &system_call to %r13
 	.endm
 
-        .macro  CLEANUP_SAVE_ALL_BASE psworg,savearea,sync
-	l	%r1,SP_PSW+4(%r15)
-	cli	1(%r1),0xcf
-	jne	0f
-	mvc	\savearea(16),SP_R12(%r15)
-0:	st	%r13,SP_R13(%r15)
-	.endm
-
-        .macro  SAVE_ALL psworg,savearea,sync
+	.macro	SAVE_ALL psworg,savearea,sync
+	la	%r12,\psworg
 	.if	\sync
-        tm      \psworg+1,0x01            # test problem state bit
-        bz      BASED(1f)                 # skip stack setup save
-        l       %r15,__LC_KERNEL_STACK    # problem state -> load ksp
+	tm	\psworg+1,0x01		# test problem state bit
+	bz	BASED(2f)		# skip stack setup save
+	l	%r15,__LC_KERNEL_STACK	# problem state -> load ksp
 	.else
-        tm      \psworg+1,0x01            # test problem state bit
-        bnz     BASED(0f)                 # from user -> load async stack
-	l	%r14,__LC_ASYNC_STACK	  # are we already on the async stack ?
-	slr     %r14,%r15
+	tm	\psworg+1,0x01		# test problem state bit
+	bnz	BASED(1f)		# from user -> load async stack
+	clc	\psworg+4(4),BASED(.Lcritical_end)
+	bhe	BASED(0f)
+	clc	\psworg+4(4),BASED(.Lcritical_start)
+	bl	BASED(0f)
+	l	%r14,BASED(.Lcleanup_critical)
+	basr	%r14,%r14
+	tm	0(%r12),0x01		# retest problem state after cleanup
+	bnz	BASED(1f)
+0:	l	%r14,__LC_ASYNC_STACK	# are we already on the async stack ?
+	slr	%r14,%r15
 	sra	%r14,13
-	be	BASED(1f)
-0:	l	%r15,__LC_ASYNC_STACK
-	.endif
-1:      s       %r15,BASED(.Lc_spsize)    # make room for registers & psw
-	l	%r14,BASED(.L\psworg)
-	slr	%r12,%r12
-	icm	%r14,12,__LC_SVC_ILC
-        stm     %r0,%r11,SP_R0(%r15)      # store gprs 0-12 to kernel stack
-        st      %r2,SP_ORIG_R2(%r15)      # store original content of gpr 2
-        mvc     SP_R12(16,%r15),\savearea # move R13-R15 to stack
-        mvc     SP_PSW(8,%r15),\psworg    # move user PSW to stack
-	st	%r14,SP_ILC(%r15)
-        st      %r12,0(%r15)              # clear back chain
-        .endm
-
-	.macro	CLEANUP_SAVE_ALL psworg,savearea,sync
-	l	%r1,\savearea+12
-	.if	\sync
-	tm	\psworg+1,0x01
-	bz	BASED(1f)
-	l	%r1,__LC_KERNEL_STACK
-	.else
-	tm	\psworg+1,0x01
-	bnz	BASED(0f)
-	l	%r0,__LC_ASYNC_STACK
-	slr	%r0,%r1
-	sra	%r0,13
-	bz	BASED(1f)
-0:	l	%r1,__LC_ASYNC_STACK
+	be	BASED(2f)
+1:	l	%r15,__LC_ASYNC_STACK
 	.endif
-1:	s	%r1,BASED(.Lc_spsize)
-	st	%r1,SP_R15(%r15)
-	l	%r0,BASED(.L\psworg)
-	xc	SP_R12(4,%r15),SP_R12(%r15)
-	icm	%r0,12,__LC_SVC_ILC
-	st	%r0,SP_R14(%r15)
-	mvc	SP_R0(48,%r1),SP_R0(%r15)
-	mvc	SP_ORIG_R2(4,%r1),SP_R2(%r15)
-	mvc	SP_R12(16,%r1),\savearea
-	mvc	SP_PSW(8,%r1),\psworg
-	st	%r0,SP_ILC(%r1)
-	xc	0(4,%r1),0(%r1)
+2:	s	%r15,BASED(.Lc_spsize)	# make room for registers & psw
+	mvc	SP_PSW(8,%r15),0(%r12)	# move user PSW to stack
+	la	%r12,\psworg
+	st	%r2,SP_ORIG_R2(%r15)	# store original content of gpr 2
+	icm	%r12,12,__LC_SVC_ILC
+	stm	%r0,%r11,SP_R0(%r15)	# store gprs %r0-%r11 to kernel stack
+	st	%r12,SP_ILC(%r15)
+	mvc	SP_R12(16,%r15),\savearea # move %r12-%r15 to stack
+	la	%r12,0
+	st	%r12,0(%r15)		# clear back chain
 	.endm
 
-        .macro  RESTORE_ALL               # system exit macro
-        mvc     __LC_RETURN_PSW(8),SP_PSW(%r15)  # move user PSW to lowcore
-        ni      __LC_RETURN_PSW+1,0xfd    # clear wait state bit
-        lm      %r0,%r15,SP_R0(%r15)      # load gprs 0-15 of user
-        lpsw    __LC_RETURN_PSW           # back to caller
-        .endm
-
-	.macro	CLEANUP_RESTORE_ALL
-	l	%r1,SP_PSW+4(%r15)
-	cli	0(%r1),0x82
-	jne	0f
-	mvc	SP_PSW(8,%r15),__LC_RETURN_PSW
-	j	1f
-0:	l	%r1,SP_R15(%r15)
-	mvc	SP_PSW(8,%r15),SP_PSW(%r1)
-	mvc	SP_R0(64,%r15),SP_R0(%r1)
-1:
-	.endm
-
-        .macro  GET_THREAD_INFO
-	l	%r9,__LC_THREAD_INFO
-        .endm
-
-	.macro	CHECK_CRITICAL
-        tm      SP_PSW+1(%r15),0x01      # test problem state bit
-	bnz	BASED(0f)		 # from user -> not critical
-	clc	SP_PSW+4(4,%r15),BASED(.Lcritical_end)
-	jnl	0f
-	clc	SP_PSW+4(4,%r15),BASED(.Lcritical_start)
-	jl	0f
-	l	%r1,BASED(.Lcleanup_critical)
-	basr	%r14,%r1
-0:
+	.macro  RESTORE_ALL sync
+	mvc	__LC_RETURN_PSW(8),SP_PSW(%r15) # move user PSW to lowcore
+	.if !\sync
+	ni	__LC_RETURN_PSW+1,0xfd	# clear wait state bit
+	.endif
+	lm	%r0,%r15,SP_R0(%r15)	# load gprs 0-15 of user
+	lpsw	__LC_RETURN_PSW		# back to caller
 	.endm
 
 /*
@@ -226,12 +172,11 @@ __critical_start:
 
 	.globl  system_call
 system_call:
-	SAVE_ALL_BASE __LC_SVC_OLD_PSW,__LC_SAVE_AREA,1
+	SAVE_ALL_BASE __LC_SAVE_AREA
         SAVE_ALL __LC_SVC_OLD_PSW,__LC_SAVE_AREA,1
 	lh	%r7,0x8a	  # get svc number from lowcore
-sysc_enter:
-        GET_THREAD_INFO           # load pointer to task_struct to R9
 sysc_do_svc:
+	l	%r9,__LC_THREAD_INFO	# load pointer to thread_info struct
 	sla	%r7,2             # *4 and test for svc 0
 	bnz	BASED(sysc_nr_ok) # svc number > 0
 	# svc 0: system call number in %r1
@@ -256,13 +201,12 @@ sysc_return:
 	tm	__TI_flags+3(%r9),_TIF_WORK_SVC
 	bnz	BASED(sysc_work)  # there is work to do (signals etc.)
 sysc_leave:
-        RESTORE_ALL
+        RESTORE_ALL 1
 
 #
 # recheck if there is more work to do
 #
 sysc_work_loop:
-        GET_THREAD_INFO           # load pointer to task_struct to R9
 	tm	__TI_flags+3(%r9),_TIF_WORK_SVC
 	bz	BASED(sysc_leave)      # there is no work to do
 #
@@ -291,6 +235,7 @@ sysc_reschedule:
 # _TIF_SIGPENDING is set, call do_signal
 #
 sysc_sigpending:     
+	ni	__TI_flags+3(%r9),255-_TIF_SINGLE_STEP # clear TIF_SINGLE_STEP
         la      %r2,SP_PTREGS(%r15)    # load pt_regs
         sr      %r3,%r3                # clear *oldset
         l       %r1,BASED(.Ldo_signal)
@@ -311,7 +256,7 @@ sysc_restart:
 	b	BASED(sysc_do_restart) # restart svc
 
 #
-# _TIF_SINGLE_STEP is set, call do_debugger_trap
+# _TIF_SINGLE_STEP is set, call do_single_step
 #
 sysc_singlestep:
 	ni	__TI_flags+3(%r9),255-_TIF_SINGLE_STEP # clear TIF_SINGLE_STEP
@@ -319,7 +264,7 @@ sysc_singlestep:
 	la	%r2,SP_PTREGS(%r15)	# address of register-save area
 	l	%r1,BASED(.Lhandle_per)	# load adr. of per handler
 	la	%r14,BASED(sysc_return)	# load adr. of system return
-	br	%r1			# branch to do_debugger_trap
+	br	%r1			# branch to do_single_step
 
 __critical_end:
 
@@ -358,7 +303,7 @@ sysc_tracenogo:
         .globl  ret_from_fork
 ret_from_fork:
 	l	%r13,__LC_SVC_NEW_PSW+4
-        GET_THREAD_INFO           # load pointer to task_struct to R9
+	l	%r9,__LC_THREAD_INFO	# load pointer to thread_info struct
         l       %r1,BASED(.Lschedtail)
 	basr    %r14,%r1
         stosm   24(%r15),0x03     # reenable interrupts
@@ -454,16 +399,17 @@ pgm_check_handler:
  * we just ignore the PER event (FIXME: is there anything we have to do
  * for LPSW?).
  */
-	SAVE_ALL_BASE __LC_PGM_OLD_PSW,__LC_SAVE_AREA,1
+	SAVE_ALL_BASE __LC_SAVE_AREA
         tm      __LC_PGM_INT_CODE+1,0x80 # check whether we got a per exception
         bnz     BASED(pgm_per)           # got per exception -> special case
 	SAVE_ALL __LC_PGM_OLD_PSW,__LC_SAVE_AREA,1
+	l	%r9,__LC_THREAD_INFO	# load pointer to thread_info struct
         l       %r3,__LC_PGM_ILC         # load program interruption code
 	la	%r8,0x7f
-        l       %r7,BASED(.Ljump_table)
 	nr	%r8,%r3
+pgm_do_call:
+        l       %r7,BASED(.Ljump_table)
         sll     %r8,2
-	GET_THREAD_INFO
         l       %r7,0(%r8,%r7)		 # load address of handler routine
         la      %r2,SP_PTREGS(%r15)	 # address of register-save area
 	la      %r14,BASED(sysc_return)
@@ -479,7 +425,7 @@ pgm_per:
         clc     __LC_PGM_OLD_PSW(8),__LC_SVC_NEW_PSW
         be      BASED(pgm_svcper)
 # no interesting special case, ignore PER event
-        lm      %r13,%r15,__LC_SAVE_AREA
+        lm      %r12,%r15,__LC_SAVE_AREA
 	lpsw    0x28
 
 #
@@ -487,25 +433,17 @@ pgm_per:
 #
 pgm_per_std:
 	SAVE_ALL __LC_PGM_OLD_PSW,__LC_SAVE_AREA,1
-	GET_THREAD_INFO
+	l	%r9,__LC_THREAD_INFO	# load pointer to thread_info struct
 	l	%r1,__TI_task(%r9)
 	mvc	__THREAD_per+__PER_atmid(2,%r1),__LC_PER_ATMID
 	mvc	__THREAD_per+__PER_address(4,%r1),__LC_PER_ADDRESS
 	mvc	__THREAD_per+__PER_access_id(1,%r1),__LC_PER_ACCESS_ID
-	la	%r4,0x7f
+	oi	__TI_flags+3(%r9),_TIF_SINGLE_STEP # set TIF_SINGLE_STEP
 	l	%r3,__LC_PGM_ILC	 # load program interruption code
-        nr      %r4,%r3                  # clear per-event-bit and ilc
-        be      BASED(pgm_per_only)      # only per or per+check ?
-        l       %r1,BASED(.Ljump_table)
-        sll     %r4,2
-        l       %r1,0(%r4,%r1)		 # load address of handler routine
-        la      %r2,SP_PTREGS(%r15)	 # address of register-save area
-	basr    %r14,%r1		 # branch to interrupt-handler
-pgm_per_only:
-	la      %r2,SP_PTREGS(15)	 # address of register-save area
-        l       %r1,BASED(.Lhandle_per)  # load adr. of per handler
-        la      %r14,BASED(sysc_return)  # load adr. of system return
-        br      %r1			 # branch to do_debugger_trap
+	la	%r8,0x7f
+	nr	%r8,%r3                  # clear per-event-bit and ilc
+	be	BASED(sysc_return)       # only per or per+check ?
+	b	BASED(pgm_do_call)
 
 #
 # it was a single stepped SVC that is causing all the trouble
@@ -513,7 +451,7 @@ pgm_per_only:
 pgm_svcper:
 	SAVE_ALL __LC_SVC_OLD_PSW,__LC_SAVE_AREA,1
 	lh	%r7,0x8a		# get svc number from lowcore
-	GET_THREAD_INFO			# load pointer to task_struct to R9
+	l	%r9,__LC_THREAD_INFO	# load pointer to thread_info struct
 	l	%r1,__TI_task(%r9)
 	mvc	__THREAD_per+__PER_atmid(2,%r1),__LC_PER_ATMID
 	mvc	__THREAD_per+__PER_address(4,%r1),__LC_PER_ADDRESS
@@ -528,11 +466,10 @@ pgm_svcper:
 
         .globl io_int_handler
 io_int_handler:
-	SAVE_ALL_BASE __LC_IO_OLD_PSW,__LC_SAVE_AREA+16,0
-        SAVE_ALL __LC_IO_OLD_PSW,__LC_SAVE_AREA+16,0
 	stck	__LC_INT_CLOCK
-	CHECK_CRITICAL
-        GET_THREAD_INFO           # load pointer to task_struct to R9
+	SAVE_ALL_BASE __LC_SAVE_AREA+16
+        SAVE_ALL __LC_IO_OLD_PSW,__LC_SAVE_AREA+16,0
+	l	%r9,__LC_THREAD_INFO	# load pointer to thread_info struct
         l       %r1,BASED(.Ldo_IRQ)        # load address of do_IRQ
         la      %r2,SP_PTREGS(%r15) # address of register-save area
         basr    %r14,%r1          # branch to standard irq handler
@@ -547,7 +484,7 @@ io_return:
 	tm	__TI_flags+3(%r9),_TIF_WORK_INT
 	bnz	BASED(io_work)         # there is work to do (signals etc.)
 io_leave:
-        RESTORE_ALL
+        RESTORE_ALL 0
 
 #ifdef CONFIG_PREEMPT
 io_preempt:
@@ -566,7 +503,6 @@ io_resume_loop:
         l       %r1,BASED(.Lschedule)
 	basr	%r14,%r1	       # call schedule
         stnsm   24(%r15),0xfc          # disable I/O and ext. interrupts
-        GET_THREAD_INFO                # load pointer to task_struct to R9
 	xc      __TI_precount(4,%r9),__TI_precount(%r9)
 	b	BASED(io_resume_loop)
 #endif
@@ -599,7 +535,6 @@ io_reschedule:
         stosm   24(%r15),0x03          # reenable interrupts
 	basr    %r14,%r1	       # call scheduler
         stnsm   24(%r15),0xfc          # disable I/O and ext. interrupts
-        GET_THREAD_INFO                # load pointer to task_struct to R9
 	tm	__TI_flags+3(%r9),_TIF_WORK_INT
 	bz	BASED(io_leave)        # there is no work to do
 	b	BASED(io_work_loop)
@@ -622,11 +557,10 @@ io_sigpending:
 
         .globl  ext_int_handler
 ext_int_handler:
-	SAVE_ALL_BASE __LC_EXT_OLD_PSW,__LC_SAVE_AREA+16,0
-        SAVE_ALL __LC_EXT_OLD_PSW,__LC_SAVE_AREA+16,0
 	stck	__LC_INT_CLOCK
-	CHECK_CRITICAL
-        GET_THREAD_INFO                # load pointer to task_struct to R9
+	SAVE_ALL_BASE __LC_SAVE_AREA+16
+        SAVE_ALL __LC_EXT_OLD_PSW,__LC_SAVE_AREA+16,0
+	l	%r9,__LC_THREAD_INFO	# load pointer to thread_info struct
 	la	%r2,SP_PTREGS(%r15)    # address of register-save area
 	lh	%r3,__LC_EXT_INT_CODE  # get interruption code
 	l	%r1,BASED(.Ldo_extint)
@@ -639,12 +573,12 @@ ext_int_handler:
 
         .globl mcck_int_handler
 mcck_int_handler:
-	SAVE_ALL_BASE __LC_MCK_OLD_PSW,__LC_SAVE_AREA+32,0
+	SAVE_ALL_BASE __LC_SAVE_AREA+32
         SAVE_ALL __LC_MCK_OLD_PSW,__LC_SAVE_AREA+32,0
 	l       %r1,BASED(.Ls390_mcck)
 	basr    %r14,%r1	  # call machine check handler
 mcck_return:
-        RESTORE_ALL
+        RESTORE_ALL 0
 
 #ifdef CONFIG_SMP
 /*
@@ -677,50 +611,68 @@ restart_crash:
 restart_go:
 #endif
 
-cleanup_table:
-	.long	system_call, sysc_enter, cleanup_sysc_enter
-	.long	sysc_return, sysc_leave, cleanup_sysc_return
-	.long	sysc_leave, sysc_work_loop, cleanup_sysc_leave
-	.long	sysc_work_loop, sysc_reschedule, cleanup_sysc_return
-cleanup_table_entries=(.-cleanup_table) / 12
+cleanup_table_system_call:
+	.long	system_call + 0x80000000, sysc_do_svc + 0x80000000
+cleanup_table_sysc_return:
+	.long	sysc_return + 0x80000000, sysc_leave + 0x80000000
+cleanup_table_sysc_leave:
+	.long	sysc_leave + 0x80000000, sysc_work_loop + 0x80000000
+cleanup_table_sysc_work_loop:
+	.long	sysc_work_loop + 0x80000000, sysc_reschedule + 0x80000000
 
 cleanup_critical:
-	lhi	%r0,cleanup_table_entries
-	la	%r1,BASED(cleanup_table)
-	l	%r2,SP_PSW+4(%r15)
-	la	%r2,0(%r2)
-cleanup_loop:
-	cl	%r2,0(%r1)
-	bl	BASED(cleanup_cont)
-	cl	%r2,4(%r1)
-	bl	BASED(cleanup_found)
-cleanup_cont:
-	la	%r1,12(%r1)
-	bct	%r0,BASED(cleanup_loop)
+	clc	4(4,%r12),BASED(cleanup_table_system_call)
+	bl	BASED(0f)
+	clc	4(4,%r12),BASED(cleanup_table_system_call+4)
+	bl	BASED(cleanup_system_call)
+0:
+	clc	4(4,%r12),BASED(cleanup_table_sysc_return)
+	bl	BASED(0f)
+	clc	4(4,%r12),BASED(cleanup_table_sysc_return+4)
+	bl	BASED(cleanup_sysc_return)
+0:
+	clc	4(4,%r12),BASED(cleanup_table_sysc_leave)
+	bl	BASED(0f)
+	clc	4(4,%r12),BASED(cleanup_table_sysc_leave+4)
+	bl	BASED(cleanup_sysc_leave)
+0:
+	clc	4(4,%r12),BASED(cleanup_table_sysc_work_loop)
+	bl	BASED(0f)
+	clc	4(4,%r12),BASED(cleanup_table_sysc_work_loop+4)
+	bl	BASED(cleanup_sysc_leave)
+0:
 	br	%r14
-cleanup_found:
-	l	%r1,8(%r1)
-	br	%r1
 
-cleanup_sysc_enter:
-	CLEANUP_SAVE_ALL_BASE __LC_SVC_OLD_PSW,__LC_SAVE_AREA,1
-	CLEANUP_SAVE_ALL __LC_SVC_OLD_PSW,__LC_SAVE_AREA,1
-	lh	%r0,0x8a
-	st	%r0,SP_R7(%r15)
-	la	%r1,BASED(sysc_enter)
-	o	%r1,BASED(.Lamode)
-	st	%r1,SP_PSW+4(%r15)
+cleanup_system_call:
+	mvc	__LC_RETURN_PSW(4),0(%r12)
+	clc	4(4,%r12),BASED(cleanup_table_system_call)
+	bne	BASED(0f)
+	mvc	__LC_SAVE_AREA(16),__LC_SAVE_AREA+16
+0:	st	%r13,__LC_SAVE_AREA+20
+	SAVE_ALL __LC_SVC_OLD_PSW,__LC_SAVE_AREA,1
+	st	%r15,__LC_SAVE_AREA+28
+	lh	%r7,0x8a
+	mvc	__LC_RETURN_PSW+4(4),BASED(cleanup_table_system_call+4)
+	la	%r12,__LC_RETURN_PSW
 	br	%r14
 
 cleanup_sysc_return:
-	la	%r1,BASED(sysc_return)
-	o	%r1,BASED(.Lamode)
-	st	%r1,SP_PSW+4(%r15)
+	mvc	__LC_RETURN_PSW(4),0(%r12)
+	mvc	__LC_RETURN_PSW+4(4),BASED(cleanup_table_sysc_return)
+	la	%r12,__LC_RETURN_PSW
 	br	%r14
 
 cleanup_sysc_leave:
-	CLEANUP_RESTORE_ALL
+	clc	4(4,%r12),BASED(cleanup_sysc_leave_lpsw)
+	be	BASED(0f)
+	mvc	__LC_RETURN_PSW(8),SP_PSW(%r15)
+	mvc	__LC_SAVE_AREA+16(16),SP_R12(%r15)
+	lm	%r0,%r11,SP_R0(%r15)
+	l	%r15,SP_R15(%r15)
+0:	la	%r12,__LC_RETURN_PSW
 	br	%r14
+cleanup_sysc_leave_lpsw:
+	.long	sysc_leave + 10 + 0x80000000
 
 /*
  * Integer constants
@@ -730,12 +682,11 @@ cleanup_sysc_leave:
 .Lc_overhead:  .long  STACK_FRAME_OVERHEAD
 .Lc_pactive:   .long  PREEMPT_ACTIVE
 .Lnr_syscalls: .long  NR_syscalls
-.L0x018:       .long  0x018
-.L0x020:       .long  0x020
-.L0x028:       .long  0x028
-.L0x030:       .long  0x030
-.L0x038:       .long  0x038
-.Lamode:       .long  0x80000000
+.L0x018:       .short 0x018
+.L0x020:       .short 0x020
+.L0x028:       .short 0x028
+.L0x030:       .short 0x030
+.L0x038:       .short 0x038
 
 /*
  * Symbol constants
@@ -745,7 +696,7 @@ cleanup_sysc_leave:
 .Ldo_extint:   .long  do_extint
 .Ldo_signal:   .long  do_signal
 .Ldo_softirq:  .long  do_softirq
-.Lhandle_per:  .long  do_debugger_trap
+.Lhandle_per:  .long  do_single_step
 .Ljump_table:  .long  pgm_check_table
 .Lschedule:    .long  schedule
 .Lclone:       .long  sys_clone
diff --git a/arch/s390/kernel/entry64.S b/arch/s390/kernel/entry64.S
index 533fa85ce..54190092b 100644
--- a/arch/s390/kernel/entry64.S
+++ b/arch/s390/kernel/entry64.S
@@ -52,6 +52,8 @@ _TIF_WORK_SVC = (_TIF_SIGPENDING | _TIF_NEED_RESCHED | \
 		 _TIF_RESTART_SVC | _TIF_SINGLE_STEP )
 _TIF_WORK_INT = (_TIF_SIGPENDING | _TIF_NEED_RESCHED)
 
+#define BASED(name) name-system_call(%r13)
+
 /*
  * Register usage in interrupt handlers:
  *    R9  - pointer to current task structure
@@ -60,99 +62,52 @@ _TIF_WORK_INT = (_TIF_SIGPENDING | _TIF_NEED_RESCHED)
  *    R15 - kernel stack pointer
  */
 
+        .macro  SAVE_ALL_BASE savearea
+	stmg	%r12,%r15,\savearea
+	larl	%r13,system_call
+	.endm
+
         .macro  SAVE_ALL psworg,savearea,sync
-        stmg    %r13,%r15,\savearea
+	la	%r12,\psworg
 	.if	\sync
-        tm      \psworg+1,0x01           # test problem state bit
-        jz      1f                       # skip stack setup save
-	lg      %r15,__LC_KERNEL_STACK   # problem state -> load ksp
+	tm	\psworg+1,0x01		# test problem state bit
+	jz	2f			# skip stack setup save
+	lg	%r15,__LC_KERNEL_STACK	# problem state -> load ksp
 	.else
-        tm      \psworg+1,0x01           # test problem state bit
-	jnz	0f			 # from user -> load kernel stack
-	lg	%r14,__LC_ASYNC_STACK	 # are we already on the async. stack ?
+	tm	\psworg+1,0x01		# test problem state bit
+	jnz	1f			# from user -> load kernel stack
+	clc	\psworg+8(8),BASED(.Lcritical_end)
+	jhe	0f
+	clc	\psworg+8(8),BASED(.Lcritical_start)
+	jl	0f
+	brasl	%r14,cleanup_critical
+	tm	0(%r12),0x01		# retest problem state after cleanup
+	jnz	1f
+0:	lg	%r14,__LC_ASYNC_STACK	# are we already on the async. stack ?
 	slgr	%r14,%r15
 	srag	%r14,%r14,14
-	jz	1f
-0:	lg      %r15,__LC_ASYNC_STACK    # load async stack
+	jz	2f
+1:	lg	%r15,__LC_ASYNC_STACK	# load async stack
 	.endif
-1:      aghi    %r15,-SP_SIZE            # make room for registers & psw
-	lghi	%r14,\psworg
-	slgr	%r13,%r13
-	icm	%r14,12,__LC_SVC_ILC
-        stmg    %r0,%r12,SP_R0(%r15)     # store gprs 0-13 to kernel stack
-        stg     %r2,SP_ORIG_R2(%r15)     # store original content of gpr 2
-        mvc     SP_R13(24,%r15),\savearea # move r13, r14 and r15 to stack
-        mvc     SP_PSW(16,%r15),\psworg  # move user PSW to stack
-	st	%r14,SP_ILC(%r15)
-	stg	%r13,0(%r15)
+2:	aghi    %r15,-SP_SIZE		# make room for registers & psw
+	mvc     SP_PSW(16,%r15),0(%r12)	# move user PSW to stack
+	la	%r12,\psworg
+	stg	%r2,SP_ORIG_R2(%r15)	# store original content of gpr 2
+	icm	%r12,12,__LC_SVC_ILC
+	stmg	%r0,%r11,SP_R0(%r15)	# store gprs %r0-%r11 to kernel stack
+	st	%r12,SP_ILC(%r15)
+	mvc	SP_R12(32,%r15),\savearea # move %r12-%r15 to stack
+	la	%r12,0
+	stg	%r12,0(%r15)
         .endm
 
-	.macro	CLEANUP_SAVE_ALL psworg,savearea,sync
-	lg	%r1,SP_PSW+8(%r15)
-	cli	1(%r1),0xdf
-	jne	2f
-	mvc	\savearea(24),SP_R13(%r15)
-2:	lg	%r1,\savearea+16
-	.if	\sync
-	tm	\psworg+1,0x01
-	jz	1f
-	lg	%r1,__LC_KERNEL_STACK
-	.else
-	tm	\psworg+1,0x01
-	jnz	0f
-	lg	%r0,__LC_ASYNC_STACK
-	slgr	%r0,%r1
-	srag	%r0,%r0,14
-	jz	1f
-0:	lg	%r1,__LC_ASYNC_STACK
+	.macro	RESTORE_ALL sync
+	mvc	__LC_RETURN_PSW(16),SP_PSW(%r15) # move user PSW to lowcore
+	.if !\sync
+	ni	__LC_RETURN_PSW+1,0xfd	# clear wait state bit
 	.endif
-1:	aghi	%r1,-SP_SIZE
-	stg	%r1,SP_R15(%r15)
-	lghi	%r0,\psworg
-	xc	SP_R13(8,%r15),SP_R13(%r15)
-	icm	%r0,12,__LC_SVC_ILC
-	stg	%r0,SP_R14(%r15)
-	mvc	SP_R0(104,%r1),SP_R0(%r15)
-	mvc	SP_ORIG_R2(8,%r1),SP_R2(%r15)
-	mvc	SP_R13(24,%r1),\savearea
-	mvc	SP_PSW(16,%r1),\psworg
-	st	%r0,SP_ILC(%r1)
-	xc	0(8,%r1),0(%r1)
-	.endm
-
-        .macro  RESTORE_ALL              # system exit macro
-        mvc     __LC_RETURN_PSW(16),SP_PSW(%r15) # move user PSW to lowcore
-        ni      __LC_RETURN_PSW+1,0xfd   # clear wait state bit
-        lmg     %r0,%r15,SP_R0(%r15)     # load gprs 0-15 of user
-        lpswe   __LC_RETURN_PSW          # back to caller
-        .endm
-
-	.macro	CLEANUP_RESTORE_ALL
-	lg	%r1,SP_PSW+8(%r15)
-	cli	0(%r1),0xb2
-	jne	0f
-	mvc	SP_PSW(16,%r15),__LC_RETURN_PSW
-	j	1f
-0:	lg	%r1,SP_R15(%r15)
-	mvc	SP_PSW(16,%r15),SP_PSW(%r1)
-	mvc	SP_R0(128,%r15),SP_R0(%r1)
-1:
-	.endm
-
-        .macro  GET_THREAD_INFO
-	lg	%r9,__LC_THREAD_INFO     # load pointer to thread_info struct
-        .endm
-
-	.macro	CHECK_CRITICAL
-        tm      SP_PSW+1(%r15),0x01      # test problem state bit
-	jnz	0f			 # from user -> not critical
-	larl	%r1,.Lcritical_start
-	clc	SP_PSW+8(8,%r15),8(%r1)  # compare ip with __critical_end
-	jnl	0f
-	clc	SP_PSW+8(8,%r15),0(%r1)  # compare ip with __critical_start
-	jl	0f
-	brasl	%r14,cleanup_critical
-0:
+	lmg	%r0,%r15,SP_R0(%r15)	# load gprs 0-15 of user
+	lpswe	__LC_RETURN_PSW		# back to caller
 	.endm
 
 /*
@@ -211,16 +166,15 @@ __critical_start:
 
 	.globl  system_call
 system_call:
+	SAVE_ALL_BASE __LC_SAVE_AREA
         SAVE_ALL __LC_SVC_OLD_PSW,__LC_SAVE_AREA,1
 	llgh    %r7,__LC_SVC_INT_CODE # get svc number from lowcore
-sysc_enter:
-        GET_THREAD_INFO           # load pointer to task_struct to R9
 sysc_do_svc:
+	lg	%r9,__LC_THREAD_INFO	# load pointer to thread_info struct
         slag    %r7,%r7,2         # *4 and test for svc 0
 	jnz	sysc_nr_ok
 	# svc 0: system call number in %r1
-	lghi	%r0,NR_syscalls
-	clr	%r1,%r0
+	cl	%r1,BASED(.Lnr_syscalls)
 	jnl	sysc_nr_ok
 	lgfr	%r7,%r1           # clear high word in r1
 	slag    %r7,%r7,2         # svc 0: system call number in %r1
@@ -248,13 +202,12 @@ sysc_return:
 	tm	__TI_flags+7(%r9),_TIF_WORK_SVC
 	jnz	sysc_work         # there is work to do (signals etc.)
 sysc_leave:
-        RESTORE_ALL
+        RESTORE_ALL 1
 
 #
 # recheck if there is more work to do
 #
 sysc_work_loop:
-        GET_THREAD_INFO           # load pointer to task_struct to R9
 	tm	__TI_flags+7(%r9),_TIF_WORK_SVC
 	jz	sysc_leave        # there is no work to do
 #
@@ -282,6 +235,7 @@ sysc_reschedule:
 # _TIF_SIGPENDING is set, call do_signal
 #
 sysc_sigpending:     
+	ni	__TI_flags+7(%r9),255-_TIF_SINGLE_STEP # clear TIF_SINGLE_STEP
         la      %r2,SP_PTREGS(%r15) # load pt_regs
         sgr     %r3,%r3           # clear *oldset
 	brasl	%r14,do_signal    # call do_signal
@@ -301,14 +255,15 @@ sysc_restart:
 	j	sysc_do_restart        # restart svc
 
 #
-# _TIF_SINGLE_STEP is set, call do_debugger_trap
+# _TIF_SINGLE_STEP is set, call do_single_step
 #
 sysc_singlestep:
 	ni	__TI_flags+7(%r9),255-_TIF_SINGLE_STEP # clear TIF_SINGLE_STEP
-	mvi	SP_TRAP+1(%r15),0x28	# set trap indication to pgm check
+	lhi	%r0,__LC_PGM_OLD_PSW
+	sth	%r0,SP_TRAP(%r15)	# set trap indication to pgm check
 	la	%r2,SP_PTREGS(%r15)	# address of register-save area
 	larl	%r14,sysc_return	# load adr. of system return
-	jg	do_debugger_trap	# branch to do_debugger_trap
+	jg	do_single_step		# branch to do_sigtrap
 
 
 __critical_end:
@@ -346,8 +301,9 @@ sysc_tracenogo:
 # a new process exits the kernel with ret_from_fork
 #
         .globl  ret_from_fork
-ret_from_fork:  
-        GET_THREAD_INFO           # load pointer to task_struct to R9
+ret_from_fork:
+	lg	%r13,__LC_SVC_NEW_PSW+8
+	lg	%r9,__LC_THREAD_INFO	# load pointer to thread_info struct
         brasl   %r14,schedule_tail
         stosm   24(%r15),0x03     # reenable interrupts
 	j	sysc_return
@@ -490,14 +446,16 @@ pgm_check_handler:
  * we just ignore the PER event (FIXME: is there anything we have to do
  * for LPSW?).
  */
+	SAVE_ALL_BASE __LC_SAVE_AREA
         tm      __LC_PGM_INT_CODE+1,0x80 # check whether we got a per exception
         jnz     pgm_per                  # got per exception -> special case
 	SAVE_ALL __LC_PGM_OLD_PSW,__LC_SAVE_AREA,1
+	lg	%r9,__LC_THREAD_INFO	# load pointer to thread_info struct
 	lgf     %r3,__LC_PGM_ILC	 # load program interruption code
 	lghi	%r8,0x7f
 	ngr	%r8,%r3
+pgm_do_call:
         sll     %r8,3
-	GET_THREAD_INFO
         larl    %r1,pgm_check_table
         lg      %r1,0(%r8,%r1)		 # load address of handler routine
         la      %r2,SP_PTREGS(%r15)	 # address of register-save area
@@ -514,6 +472,7 @@ pgm_per:
         clc     __LC_PGM_OLD_PSW(16),__LC_SVC_NEW_PSW
         je      pgm_svcper
 # no interesting special case, ignore PER event
+	lmg	%r12,%r15,__LC_SAVE_AREA
 	lpswe   __LC_PGM_OLD_PSW
 
 #
@@ -521,24 +480,17 @@ pgm_per:
 #
 pgm_per_std:
 	SAVE_ALL __LC_PGM_OLD_PSW,__LC_SAVE_AREA,1
-	GET_THREAD_INFO
+	lg	%r9,__LC_THREAD_INFO	# load pointer to thread_info struct
 	lg	%r1,__TI_task(%r9)
 	mvc	__THREAD_per+__PER_atmid(2,%r1),__LC_PER_ATMID
 	mvc	__THREAD_per+__PER_address(8,%r1),__LC_PER_ADDRESS
 	mvc	__THREAD_per+__PER_access_id(1,%r1),__LC_PER_ACCESS_ID
-	lghi    %r4,0x7f
+	oi	__TI_flags+7(%r9),_TIF_SINGLE_STEP # set TIF_SINGLE_STEP
 	lgf     %r3,__LC_PGM_ILC	 # load program interruption code
-        nr      %r4,%r3			 # clear per-event-bit and ilc
-        je      pgm_per_only		 # only per of per+check ?
-        sll     %r4,3
-        larl    %r1,pgm_check_table
-        lg      %r1,0(%r4,%r1)		 # load address of handler routine
-        la      %r2,SP_PTREGS(%r15)	 # address of register-save area
-        basr    %r14,%r1		 # branch to interrupt-handler
-pgm_per_only:
-        la      %r2,SP_PTREGS(15)	 # address of register-save area
-        larl    %r14,sysc_return	 # load adr. of system return
-        jg      do_debugger_trap
+	lghi	%r8,0x7f
+	ngr	%r8,%r3			 # clear per-event-bit and ilc
+	je	sysc_return
+	j	pgm_do_call
 
 #
 # it was a single stepped SVC that is causing all the trouble
@@ -546,7 +498,7 @@ pgm_per_only:
 pgm_svcper:
 	SAVE_ALL __LC_SVC_OLD_PSW,__LC_SAVE_AREA,1
 	llgh    %r7,__LC_SVC_INT_CODE	# get svc number from lowcore
-	GET_THREAD_INFO			# load pointer to task_struct to R9
+	lg	%r9,__LC_THREAD_INFO	# load pointer to thread_info struct
 	lg	%r1,__TI_task(%r9)
 	mvc	__THREAD_per+__PER_atmid(2,%r1),__LC_PER_ATMID
 	mvc	__THREAD_per+__PER_address(8,%r1),__LC_PER_ADDRESS
@@ -560,10 +512,10 @@ pgm_svcper:
  */
         .globl io_int_handler
 io_int_handler:
-        SAVE_ALL __LC_IO_OLD_PSW,__LC_SAVE_AREA+32,0
 	stck	__LC_INT_CLOCK
-	CHECK_CRITICAL
-        GET_THREAD_INFO                # load pointer to task_struct to R9
+	SAVE_ALL_BASE __LC_SAVE_AREA+32
+        SAVE_ALL __LC_IO_OLD_PSW,__LC_SAVE_AREA+32,0
+	lg	%r9,__LC_THREAD_INFO	# load pointer to thread_info struct
         la      %r2,SP_PTREGS(%r15)    # address of register-save area
 	brasl   %r14,do_IRQ            # call standard irq handler
 
@@ -577,7 +529,7 @@ io_return:
 	tm	__TI_flags+7(%r9),_TIF_WORK_INT
 	jnz	io_work                # there is work to do (signals etc.)
 io_leave:
-        RESTORE_ALL
+        RESTORE_ALL 0
 
 #ifdef CONFIG_PREEMPT
 io_preempt:
@@ -597,7 +549,6 @@ io_resume_loop:
         stosm   48(%r15),0x03          # reenable interrupts
 	brasl   %r14,schedule          # call schedule
         stnsm   48(%r15),0xfc          # disable I/O and ext. interrupts
-        GET_THREAD_INFO                # load pointer to task_struct to R9
 	xc      __TI_precount(4,%r9),__TI_precount(%r9)
 	j	io_resume_loop
 #endif
@@ -629,7 +580,6 @@ io_reschedule:
         stosm   48(%r15),0x03       # reenable interrupts
         brasl   %r14,schedule       # call scheduler
         stnsm   48(%r15),0xfc       # disable I/O and ext. interrupts
-        GET_THREAD_INFO             # load pointer to task_struct to R9
 	tm	__TI_flags+7(%r9),_TIF_WORK_INT
 	jz	io_leave               # there is no work to do
 	j	io_work_loop
@@ -650,10 +600,10 @@ io_sigpending:
  */
         .globl  ext_int_handler
 ext_int_handler:
-        SAVE_ALL __LC_EXT_OLD_PSW,__LC_SAVE_AREA+32,0
-	CHECK_CRITICAL
-        GET_THREAD_INFO                # load pointer to task_struct to R9
 	stck	__LC_INT_CLOCK
+	SAVE_ALL_BASE __LC_SAVE_AREA+32
+        SAVE_ALL __LC_EXT_OLD_PSW,__LC_SAVE_AREA+32,0
+	lg	%r9,__LC_THREAD_INFO	# load pointer to thread_info struct
 	la	%r2,SP_PTREGS(%r15)    # address of register-save area
 	llgh	%r3,__LC_EXT_INT_CODE  # get interruption code
 	brasl   %r14,do_extint
@@ -664,10 +614,11 @@ ext_int_handler:
  */
         .globl mcck_int_handler
 mcck_int_handler:
+	SAVE_ALL_BASE __LC_SAVE_AREA+64
         SAVE_ALL __LC_MCK_OLD_PSW,__LC_SAVE_AREA+64,0
 	brasl   %r14,s390_do_machine_check
 mcck_return:
-        RESTORE_ALL
+        RESTORE_ALL 0
 
 #ifdef CONFIG_SMP
 /*
@@ -698,46 +649,68 @@ restart_crash:
 restart_go:
 #endif
 
-cleanup_table:
-	.quad	system_call, sysc_enter, cleanup_sysc_enter
-	.quad	sysc_return, sysc_leave, cleanup_sysc_return
-	.quad	sysc_leave, sysc_work_loop, cleanup_sysc_leave
-	.quad	sysc_work_loop, sysc_reschedule, cleanup_sysc_return
-cleanup_table_entries=(.-cleanup_table) / 24
+cleanup_table_system_call:
+	.quad	system_call, sysc_do_svc
+cleanup_table_sysc_return:
+	.quad	sysc_return, sysc_leave
+cleanup_table_sysc_leave:
+	.quad	sysc_leave, sysc_work_loop
+cleanup_table_sysc_work_loop:
+	.quad	sysc_work_loop, sysc_reschedule
 
 cleanup_critical:
-	lghi	%r0,cleanup_table_entries
-	larl	%r1,cleanup_table
-	lg	%r2,SP_PSW+8(%r15)
-cleanup_loop:
-	clg	%r2,0(%r1)
-	jl	cleanup_cont
-	clg	%r2,8(%r1)
-	jl	cleanup_found
-cleanup_cont:
-	la	%r1,24(%r1)
-	brct	%r0,cleanup_loop
+	clc	8(8,%r12),BASED(cleanup_table_system_call)
+	jl	0f
+	clc	8(8,%r12),BASED(cleanup_table_system_call+8)
+	jl	cleanup_system_call
+0:
+	clc	8(8,%r12),BASED(cleanup_table_sysc_return)
+	jl	0f
+	clc	8(8,%r12),BASED(cleanup_table_sysc_return+8)
+	jl	cleanup_sysc_return
+0:
+	clc	8(8,%r12),BASED(cleanup_table_sysc_leave)
+	jl	0f
+	clc	8(8,%r12),BASED(cleanup_table_sysc_leave+8)
+	jl	cleanup_sysc_leave
+0:
+	clc	8(8,%r12),BASED(cleanup_table_sysc_work_loop)
+	jl	0f
+	clc	8(8,%r12),BASED(cleanup_table_sysc_work_loop+8)
+	jl	cleanup_sysc_leave
+0:
 	br	%r14
-cleanup_found:
-	lg	%r1,16(%r1)
-	br	%r1
-
-cleanup_sysc_enter:
-	CLEANUP_SAVE_ALL __LC_SVC_OLD_PSW,__LC_SAVE_AREA,1
-	llgh	%r0,0x8a
-	stg	%r0,SP_R7(%r15)
-	larl	%r1,sysc_enter
-	stg	%r1,SP_PSW+8(%r15)
+
+cleanup_system_call:
+	mvc	__LC_RETURN_PSW(8),0(%r12)
+	clc	8(8,%r12),BASED(cleanup_table_system_call)
+	jne	0f
+	mvc	__LC_SAVE_AREA(32),__LC_SAVE_AREA+32
+0:	stg	%r13,__LC_SAVE_AREA+40
+	SAVE_ALL __LC_SVC_OLD_PSW,__LC_SAVE_AREA,1
+	stg	%r15,__LC_SAVE_AREA+56
+	llgh	%r7,__LC_SVC_INT_CODE
+	mvc	__LC_RETURN_PSW+8(8),BASED(cleanup_table_system_call+8)
+	la	%r12,__LC_RETURN_PSW
 	br	%r14
 
 cleanup_sysc_return:
-	larl	%r1,sysc_return
-	stg	%r1,SP_PSW+8(%r15)
+	mvc	__LC_RETURN_PSW(8),0(%r12)
+	mvc	__LC_RETURN_PSW+8(8),BASED(cleanup_table_sysc_return)
+	la	%r12,__LC_RETURN_PSW
 	br	%r14
 
 cleanup_sysc_leave:
-	CLEANUP_RESTORE_ALL
+	clc	8(8,%r12),BASED(cleanup_sysc_leave_lpsw)
+	je	0f
+	mvc	__LC_RETURN_PSW(16),SP_PSW(%r15)
+	mvc	__LC_SAVE_AREA+32(32),SP_R12(%r15)
+	lmg	%r0,%r11,SP_R0(%r15)
+	lg	%r15,SP_R15(%r15)
+0:	la	%r12,__LC_RETURN_PSW
 	br	%r14
+cleanup_sysc_leave_lpsw:
+	.quad	sysc_leave + 12
 
 /*
  * Integer constants
@@ -745,6 +718,12 @@ cleanup_sysc_leave:
                .align 4
 .Lconst:
 .Lc_pactive:   .long  PREEMPT_ACTIVE
+.Lnr_syscalls: .long  NR_syscalls
+.L0x0130:      .short 0x130
+.L0x0140:      .short 0x140
+.L0x0150:      .short 0x150
+.L0x0160:      .short 0x160
+.L0x0170:      .short 0x170
 .Lcritical_start:
                .quad  __critical_start
 .Lcritical_end:
diff --git a/arch/s390/kernel/head.S b/arch/s390/kernel/head.S
index 068653a5e..fb295b79f 100644
--- a/arch/s390/kernel/head.S
+++ b/arch/s390/kernel/head.S
@@ -613,10 +613,6 @@ startup:basr  %r13,0                     # get base
         bne    .Lnop390-.LPG1(%r13)
         oi     3(%r12),4                # set P/390 flag
 .Lnop390:
-	chi    %r0,0x2084		# new stidp format?
-	bne    .Loldfmt-.LPG1(%r13)
-	oi     3(%r12),64		# set new stidp flag
-.Loldfmt:	
 
 #
 # find out if we have an IEEE fpu
diff --git a/arch/s390/kernel/head64.S b/arch/s390/kernel/head64.S
index 26caebd7d..e32a8e90f 100644
--- a/arch/s390/kernel/head64.S
+++ b/arch/s390/kernel/head64.S
@@ -623,10 +623,6 @@ startup:basr  %r13,0                     # get base
         bne    1f-.LPG1(%r13)
         oi     7(%r12),4                # set P/390 flag
 1:
-	chi    %r0,0x2084		# new stidp format?
-	bne    2f-.LPG1(%r13)
-	oi     7(%r12),64		# set new stidp flag
-2:	
 
 #
 # find out if we have the MVPG instruction
diff --git a/arch/s390/kernel/init_task.c b/arch/s390/kernel/init_task.c
index 652c42325..d73a74013 100644
--- a/arch/s390/kernel/init_task.c
+++ b/arch/s390/kernel/init_task.c
@@ -10,6 +10,7 @@
 #include <linux/module.h>
 #include <linux/sched.h>
 #include <linux/init_task.h>
+#include <linux/mqueue.h>
 
 #include <asm/uaccess.h>
 #include <asm/pgtable.h>
diff --git a/arch/s390/kernel/process.c b/arch/s390/kernel/process.c
index 63818a50e..73cb6baeb 100644
--- a/arch/s390/kernel/process.c
+++ b/arch/s390/kernel/process.c
@@ -17,6 +17,7 @@
 
 #include <linux/config.h>
 #include <linux/compiler.h>
+#include <linux/cpu.h>
 #include <linux/errno.h>
 #include <linux/sched.h>
 #include <linux/kernel.h>
@@ -34,6 +35,8 @@
 #include <linux/delay.h>
 #include <linux/reboot.h>
 #include <linux/init.h>
+#include <linux/module.h>
+#include <linux/notifier.h>
 
 #include <asm/uaccess.h>
 #include <asm/pgtable.h>
@@ -41,9 +44,7 @@
 #include <asm/io.h>
 #include <asm/processor.h>
 #include <asm/irq.h>
-#if defined(CONFIG_VIRT_TIMER) || defined (CONFIG_NO_IDLE_HZ)
 #include <asm/timer.h>
-#endif
 
 asmlinkage void ret_from_fork(void) __asm__("ret_from_fork");
 
@@ -68,13 +69,39 @@ unsigned long thread_saved_pc(struct task_struct *tsk)
 }
 
 /*
- * The idle loop on a S390...
+ * Need to know about CPUs going idle?
  */
+static struct notifier_block *idle_chain;
+
+int register_idle_notifier(struct notifier_block *nb)
+{
+	return notifier_chain_register(&idle_chain, nb);
+}
+EXPORT_SYMBOL(register_idle_notifier);
+
+int unregister_idle_notifier(struct notifier_block *nb)
+{
+	return notifier_chain_unregister(&idle_chain, nb);
+}
+EXPORT_SYMBOL(unregister_idle_notifier);
+
+void do_monitor_call(struct pt_regs *regs, long interruption_code)
+{
+	/* disable monitor call class 0 */
+	__ctl_clear_bit(8, 15);
+
+	notifier_call_chain(&idle_chain, CPU_NOT_IDLE,
+			    (void *)(long) smp_processor_id());
+}
 
+/*
+ * The idle loop on a S390...
+ */
 void default_idle(void)
 {
 	psw_t wait_psw;
 	unsigned long reg;
+	int cpu, rc;
 
 	local_irq_disable();
         if (need_resched()) {
@@ -83,14 +110,22 @@ void default_idle(void)
                 return;
         }
 
-#if defined(CONFIG_VIRT_TIMER) || defined (CONFIG_NO_IDLE_HZ)
-	/*
-	 * hook to stop timers that should not tick while CPU is idle
-	 */
-	if (stop_timers()) {
+	/* CPU is going idle. */
+	cpu = smp_processor_id();
+	rc = notifier_call_chain(&idle_chain, CPU_IDLE, (void *)(long) cpu);
+	if (rc != NOTIFY_OK && rc != NOTIFY_DONE)
+		BUG();
+	if (rc != NOTIFY_OK) {
 		local_irq_enable();
 		return;
 	}
+
+	/* enable monitor call class 0 */
+	__ctl_set_bit(8, 15);
+
+#ifdef CONFIG_HOTPLUG_CPU
+	if (cpu_is_offline(smp_processor_id()))
+		cpu_die();
 #endif
 
 	/* 
diff --git a/arch/s390/kernel/ptrace.c b/arch/s390/kernel/ptrace.c
index cada0f794..6e35d53b4 100644
--- a/arch/s390/kernel/ptrace.c
+++ b/arch/s390/kernel/ptrace.c
@@ -553,6 +553,19 @@ do_ptrace_emu31(struct task_struct *child, long request, long addr, long data)
 			copied += sizeof(unsigned int);
 		}
 		return 0;
+	case PTRACE_GETEVENTMSG:
+		return put_user((__u32) child->ptrace_message,
+				(unsigned int __user *) data);
+	case PTRACE_GETSIGINFO:
+		if (child->last_siginfo == NULL)
+			return -EINVAL;
+		return copy_siginfo_to_user32((siginfo_t32 __user *) data,
+					      child->last_siginfo);
+	case PTRACE_SETSIGINFO:
+		if (child->last_siginfo == NULL)
+			return -EINVAL;
+		return copy_siginfo_from_user32(child->last_siginfo,
+						(siginfo_t32 __user *) data);
 	}
 	return ptrace_request(child, request, addr, data);
 }
diff --git a/arch/s390/kernel/s390_ksyms.c b/arch/s390/kernel/s390_ksyms.c
index 5ba86ba1a..43afd32f8 100644
--- a/arch/s390/kernel/s390_ksyms.c
+++ b/arch/s390/kernel/s390_ksyms.c
@@ -19,9 +19,6 @@
 #ifdef CONFIG_IP_MULTICAST
 #include <net/arp.h>
 #endif
-#ifdef CONFIG_VIRT_TIMER
-#include <asm/timer.h>
-#endif
 
 /*
  * memory management
@@ -53,17 +50,6 @@ EXPORT_SYMBOL(overflowuid);
 EXPORT_SYMBOL(overflowgid);
 EXPORT_SYMBOL(empty_zero_page);
 
-/*
- * virtual CPU timer
- */
-#ifdef CONFIG_VIRT_TIMER
-EXPORT_SYMBOL(init_virt_timer);
-EXPORT_SYMBOL(add_virt_timer);
-EXPORT_SYMBOL(add_virt_timer_periodic);
-EXPORT_SYMBOL(mod_virt_timer);
-EXPORT_SYMBOL(del_virt_timer);
-#endif
-
 /*
  * misc.
  */
@@ -72,8 +58,8 @@ EXPORT_SYMBOL(__udelay);
 EXPORT_SYMBOL(kernel_thread);
 EXPORT_SYMBOL(csum_fold);
 EXPORT_SYMBOL(console_mode);
-EXPORT_SYMBOL(console_device);
+EXPORT_SYMBOL(console_devno);
+EXPORT_SYMBOL(console_irq);
 EXPORT_SYMBOL_NOVERS(do_call_softirq);
 EXPORT_SYMBOL(sys_wait4);
 EXPORT_SYMBOL(cpcmd);
-EXPORT_SYMBOL(sys_ioctl);
diff --git a/arch/s390/kernel/setup.c b/arch/s390/kernel/setup.c
index d549ad5c2..a50891ce0 100644
--- a/arch/s390/kernel/setup.c
+++ b/arch/s390/kernel/setup.c
@@ -49,7 +49,7 @@
  * Machine setup..
  */
 unsigned int console_mode = 0;
-unsigned int console_device = -1;
+unsigned int console_devno = -1;
 unsigned int console_irq = -1;
 unsigned long memory_size = 0;
 unsigned long machine_flags = 0;
@@ -58,8 +58,6 @@ struct {
 } memory_chunk[MEMORY_CHUNKS] = { { 0 } };
 #define CHUNK_READ_WRITE 0
 #define CHUNK_READ_ONLY 1
-int cpus_initialized = 0;
-static cpumask_t cpu_initialized;
 volatile int __cpu_logical_map[NR_CPUS]; /* logical cpu to cpu address */
 
 /*
@@ -76,7 +74,6 @@ extern int _text,_etext, _edata, _end;
 #include <asm/setup.h>
 
 static char command_line[COMMAND_LINE_SIZE] = { 0, };
-       char saved_command_line[COMMAND_LINE_SIZE];
 
 static struct resource code_resource = { "Kernel code", 0x100000, 0 };
 static struct resource data_resource = { "Kernel data", 0, 0 };
@@ -86,15 +83,8 @@ static struct resource data_resource = { "Kernel data", 0, 0 };
  */
 void __devinit cpu_init (void)
 {
-        int nr = smp_processor_id();
         int addr = hard_smp_processor_id();
 
-        if (cpu_test_and_set(nr,cpu_initialized)) {
-                printk("CPU#%d ALREADY INITIALIZED!!!!!!!!!\n", nr);
-                for (;;) local_irq_enable();
-        }
-        cpus_initialized++;
-
         /*
          * Store processor id in lowcore (used e.g. in timer_interrupt)
          */
@@ -161,7 +151,7 @@ static int __init condev_setup(char *str)
 
 	vdev = simple_strtoul(str, &str, 0);
 	if (vdev >= 0 && vdev < 65536) {
-		console_device = vdev;
+		console_devno = vdev;
 		console_irq = -1;
 	}
 	return 1;
@@ -195,7 +185,7 @@ static void __init conmode_default(void)
 
         if (MACHINE_IS_VM) {
 		cpcmd("QUERY CONSOLE", query_buffer, 1024);
-		console_device = simple_strtoul(query_buffer + 5, NULL, 16);
+		console_devno = simple_strtoul(query_buffer + 5, NULL, 16);
 		ptr = strstr(query_buffer, "SUBCHANNEL =");
 		console_irq = simple_strtoul(ptr + 13, NULL, 16);
 		cpcmd("QUERY TERM", query_buffer, 1024);
@@ -650,3 +640,13 @@ int show_interrupts(struct seq_file *p, void *v)
 	
         return 0;
 }
+
+/*
+ * For compatibilty only. S/390 specific setup of interrupts et al. is done
+ * much later in init_channel_subsystem().
+ */
+void __init
+init_IRQ(void)
+{
+	/* nothing... */
+}
diff --git a/arch/s390/kernel/signal.c b/arch/s390/kernel/signal.c
index d32b2c44b..d5b648153 100644
--- a/arch/s390/kernel/signal.c
+++ b/arch/s390/kernel/signal.c
@@ -39,6 +39,7 @@ typedef struct
 	__u8 callee_used_stack[__SIGNAL_FRAMESIZE];
 	struct sigcontext sc;
 	_sigregs sregs;
+	int signo;
 	__u8 retcode[S390_SYSCALL_SIZE];
 } sigframe;
 
@@ -350,6 +351,10 @@ static void setup_frame(int sig, struct k_sigaction *ka,
 	   To avoid breaking binary compatibility, they are passed as args. */
 	regs->gprs[4] = current->thread.trap_no;
 	regs->gprs[5] = current->thread.prot_addr;
+
+	/* Place signal number on stack to allow backtrace from handler.  */
+	if (__put_user(regs->gprs[2], (int __user *) &frame->signo))
+		goto give_sigsegv;
 	return;
 
 give_sigsegv:
diff --git a/arch/s390/kernel/smp.c b/arch/s390/kernel/smp.c
index 91746632e..eb8a5161a 100644
--- a/arch/s390/kernel/smp.c
+++ b/arch/s390/kernel/smp.c
@@ -5,6 +5,7 @@
  *    Copyright (C) 1999,2000 IBM Deutschland Entwicklung GmbH, IBM Corporation
  *    Author(s): Denis Joseph Barrow (djbarrow@de.ibm.com,barrow_dj@yahoo.com),
  *               Martin Schwidefsky (schwidefsky@de.ibm.com)
+ *               Heiko Carstens (heiko.carstens@de.ibm.com)
  *
  *  based on other smp stuff by 
  *    (c) 1995 Alan Cox, CymruNET Ltd  <alan@cymru.net>
@@ -57,6 +58,8 @@ cpumask_t cpu_online_map;
 cpumask_t cpu_possible_map;
 unsigned long    cache_decay_ticks = 0;
 
+static struct task_struct *current_set[NR_CPUS];
+
 EXPORT_SYMBOL(cpu_online_map);
 
 /*
@@ -124,7 +127,6 @@ int smp_call_function (void (*func) (void *info), void *info, int nonatomic,
 	struct call_data_struct data;
 	int cpus = num_online_cpus()-1;
 
-	/* FIXME: get cpu lock -hc */
 	if (cpus <= 0)
 		return 0;
 
@@ -211,7 +213,6 @@ EXPORT_SYMBOL(smp_call_function_on);
 
 static inline void do_send_stop(void)
 {
-        unsigned long dummy;
         int i, rc;
 
         /* stop all processors */
@@ -219,25 +220,23 @@ static inline void do_send_stop(void)
                 if (!cpu_online(i) || smp_processor_id() == i)
 			continue;
 		do {
-			rc = signal_processor_ps(&dummy, 0, i, sigp_stop);
+			rc = signal_processor(i, sigp_stop);
 		} while (rc == sigp_busy);
 	}
 }
 
 static inline void do_store_status(void)
 {
-        unsigned long low_core_addr;
-        unsigned long dummy;
         int i, rc;
 
         /* store status of all processors in their lowcores (real 0) */
         for (i =  0; i < NR_CPUS; i++) {
                 if (!cpu_online(i) || smp_processor_id() == i) 
 			continue;
-		low_core_addr = (unsigned long) lowcore_ptr[i];
 		do {
-			rc = signal_processor_ps(&dummy, low_core_addr, i,
-						 sigp_store_status_at_address);
+			rc = signal_processor_p(
+				(__u32)(unsigned long) lowcore_ptr[i], i,
+				sigp_store_status_at_address);
 		} while(rc == sigp_busy);
         }
 }
@@ -265,8 +264,10 @@ static cpumask_t cpu_restart_map;
 
 static void do_machine_restart(void * __unused)
 {
+	static atomic_t cpuid = ATOMIC_INIT(-1);
+
 	cpu_clear(smp_processor_id(), cpu_restart_map);
-	if (smp_processor_id() == 0) {
+	if (atomic_compare_and_swap(-1, smp_processor_id(), &cpuid) == 0) {
 		/* Wait for all other cpus to enter do_machine_restart. */
 		while (!cpus_empty(cpu_restart_map))
 			cpu_relax();
@@ -307,7 +308,9 @@ static void do_wait_for_stop(void)
 
 static void do_machine_halt(void * __unused)
 {
-	if (smp_processor_id() == 0) {
+	static atomic_t cpuid = ATOMIC_INIT(-1);
+
+	if (atomic_compare_and_swap(-1, smp_processor_id(), &cpuid) == 0) {
 		smp_send_stop();
 		if (MACHINE_IS_VM && strlen(vmhalt_cmd) > 0)
 			cpcmd(vmhalt_cmd, NULL, 0);
@@ -324,7 +327,9 @@ void machine_halt_smp(void)
 
 static void do_machine_power_off(void * __unused)
 {
-	if (smp_processor_id() == 0) {
+	static atomic_t cpuid = ATOMIC_INIT(-1);
+
+	if (atomic_compare_and_swap(-1, smp_processor_id(), &cpuid) == 0) {
 		smp_send_stop();
 		if (MACHINE_IS_VM && strlen(vmpoff_cmd) > 0)
 			cpcmd(vmpoff_cmd, NULL, 0);
@@ -482,7 +487,24 @@ void smp_ctl_clear_bit(int cr, int bit) {
  * Lets check how many CPUs we have.
  */
 
-void __init smp_check_cpus(unsigned int max_cpus)
+#ifdef CONFIG_HOTPLUG_CPU
+
+void
+__init smp_check_cpus(unsigned int max_cpus)
+{
+	int cpu;
+
+	/*
+	 * cpu 0 is the boot cpu. See smp_prepare_boot_cpu.
+	 */
+	for (cpu = 1; cpu < max_cpus; cpu++)
+		cpu_set(cpu, cpu_possible_map);
+}
+
+#else /* CONFIG_HOTPLUG_CPU */
+
+void
+__init smp_check_cpus(unsigned int max_cpus)
 {
         int curr_cpu, num_cpus;
 	__u16 boot_cpu_addr;
@@ -505,10 +527,13 @@ void __init smp_check_cpus(unsigned int max_cpus)
         printk("Boot cpu address %2X\n", boot_cpu_addr);
 }
 
+#endif /* CONFIG_HOTPLUG_CPU */
+
 /*
  *      Activate a secondary processor.
  */
 extern void init_cpu_timer(void);
+extern void init_cpu_vtimer(void);
 extern int pfault_init(void);
 extern int pfault_token(void);
 
@@ -518,6 +543,9 @@ int __devinit start_secondary(void *cpuvoid)
         cpu_init();
         /* init per CPU timer */
         init_cpu_timer();
+#ifdef CONFIG_VIRT_TIMER
+        init_cpu_vtimer();
+#endif
 #ifdef CONFIG_PFAULT
 	/* Enable pfault pseudo page faults on this cpu. */
 	pfault_init();
@@ -532,26 +560,102 @@ int __devinit start_secondary(void *cpuvoid)
         return cpu_idle(NULL);
 }
 
-static struct task_struct *__devinit fork_by_hand(void)
+static void __init smp_create_idle(unsigned int cpu)
 {
-       struct pt_regs regs;
-       /* don't care about the psw and regs settings since we'll never
-          reschedule the forked task. */
-       memset(&regs,0,sizeof(struct pt_regs));
-       return copy_process(CLONE_VM|CLONE_IDLETASK, 0, &regs, 0, NULL, NULL);
+	struct pt_regs regs;
+	struct task_struct *p;
+
+	/*
+	 *  don't care about the psw and regs settings since we'll never
+	 *  reschedule the forked task.
+	 */
+	memset(&regs, 0, sizeof(struct pt_regs));
+	p = copy_process(CLONE_VM | CLONE_IDLETASK, 0, &regs, 0, NULL, NULL);
+	if (IS_ERR(p))
+		panic("failed fork for CPU %u: %li", cpu, PTR_ERR(p));
+
+	wake_up_forked_process(p);
+	init_idle(p, cpu);
+	unhash_process(p);
+	current_set[cpu] = p;
 }
 
-int __cpu_up(unsigned int cpu)
+/* Reserving and releasing of CPUs */
+
+static spinlock_t smp_reserve_lock = SPIN_LOCK_UNLOCKED;
+static int smp_cpu_reserved[NR_CPUS];
+
+int
+smp_get_cpu(cpumask_t cpu_mask)
+{
+	unsigned long flags;
+	int cpu;
+
+	spin_lock_irqsave(&smp_reserve_lock, flags);
+	/* Try to find an already reserved cpu. */
+	for_each_cpu_mask(cpu, cpu_mask) {
+		if (smp_cpu_reserved[cpu] != 0) {
+			smp_cpu_reserved[cpu]++;
+			/* Found one. */
+			goto out;
+		}
+	}
+	/* Reserve a new cpu from cpu_mask. */
+	for_each_cpu_mask(cpu, cpu_mask) {
+		if (cpu_online(cpu)) {
+			smp_cpu_reserved[cpu]++;
+			goto out;
+		}
+	}
+	cpu = -ENODEV;
+out:
+	spin_unlock_irqrestore(&smp_reserve_lock, flags);
+	return cpu;
+}
+
+void
+smp_put_cpu(int cpu)
+{
+	unsigned long flags;
+
+	spin_lock_irqsave(&smp_reserve_lock, flags);
+	smp_cpu_reserved[cpu]--;
+	spin_unlock_irqrestore(&smp_reserve_lock, flags);
+}
+
+static inline int
+cpu_stopped(int cpu)
 {
-        struct task_struct *idle;
+	__u32 status;
+
+	/* Check for stopped state */
+	if (signal_processor_ps(&status, 0, cpu, sigp_sense) == sigp_status_stored) {
+		if (status & 0x40)
+			return 1;
+	}
+	return 0;
+}
+
+/* Upping and downing of CPUs */
+
+int
+__cpu_up(unsigned int cpu)
+{
+	struct task_struct *idle;
         struct _lowcore    *cpu_lowcore;
         sigp_ccode          ccode;
+	int                 curr_cpu;
 
-	/*
-	 *  Set prefix page for new cpu
-	 */
+	for (curr_cpu = 0; curr_cpu <= 65535; curr_cpu++) {
+		__cpu_logical_map[cpu] = (__u16) curr_cpu;
+		if (cpu_stopped(cpu))
+			break;
+	}
+
+	if (!cpu_stopped(cpu))
+		return -ENODEV;
 
-	ccode = signal_processor_p((unsigned long)(lowcore_ptr[cpu]),
+	ccode = signal_processor_p((__u32)(unsigned long)(lowcore_ptr[cpu]),
 				   cpu, sigp_set_prefix);
 	if (ccode){
 		printk("sigp_set_prefix failed for cpu %d "
@@ -560,23 +664,7 @@ int __cpu_up(unsigned int cpu)
 		return -EIO;
 	}
 
-        /* We can't use kernel_thread since we must _avoid_ to reschedule
-           the child. */
-        idle = fork_by_hand();
-	if (IS_ERR(idle)){
-                printk("failed fork for CPU %d", cpu);
-		return -EIO;
-	}
-	wake_up_forked_process(idle);
-
-        /*
-         * We remove it from the pidhash and the runqueue
-         * once we got the process:
-         */
-	init_idle(idle, cpu);
-
-        unhash_process(idle);
-
+	idle = current_set[cpu];
         cpu_lowcore = lowcore_ptr[cpu];
 	cpu_lowcore->save_area[15] = idle->thread.ksp;
 	cpu_lowcore->kernel_stack = (unsigned long)
@@ -595,6 +683,64 @@ int __cpu_up(unsigned int cpu)
 	return 0;
 }
 
+int
+__cpu_disable(void)
+{
+	unsigned long flags;
+	ec_creg_mask_parms cr_parms;
+
+	spin_lock_irqsave(&smp_reserve_lock, flags);
+	if (smp_cpu_reserved[smp_processor_id()] != 0) {
+		spin_unlock_irqrestore(&smp_reserve_lock, flags);
+		return -EBUSY;
+	}
+
+	/* disable all external interrupts */
+
+	cr_parms.start_ctl = 0;
+	cr_parms.end_ctl = 0;
+	cr_parms.orvals[0] = 0;
+	cr_parms.andvals[0] = ~(1<<15 | 1<<14 | 1<<13 | 1<<12 |
+				1<<11 | 1<<10 | 1<< 6 | 1<< 4);
+	smp_ctl_bit_callback(&cr_parms);
+
+	/* disable all I/O interrupts */
+
+	cr_parms.start_ctl = 6;
+	cr_parms.end_ctl = 6;
+	cr_parms.orvals[6] = 0;
+	cr_parms.andvals[6] = ~(1<<31 | 1<<30 | 1<<29 | 1<<28 |
+				1<<27 | 1<<26 | 1<<25 | 1<<24);
+	smp_ctl_bit_callback(&cr_parms);
+
+	/* disable most machine checks */
+
+	cr_parms.start_ctl = 14;
+	cr_parms.end_ctl = 14;
+	cr_parms.orvals[14] = 0;
+	cr_parms.andvals[14] = ~(1<<28 | 1<<27 | 1<<26 | 1<<25 | 1<<24);
+	smp_ctl_bit_callback(&cr_parms);
+
+	spin_unlock_irqrestore(&smp_reserve_lock, flags);
+	return 0;
+}
+
+void
+__cpu_die(unsigned int cpu)
+{
+	/* Wait until target cpu is down */
+	while (!cpu_stopped(cpu));
+	printk("Processor %d spun down\n", cpu);
+}
+
+void
+cpu_die(void)
+{
+	signal_processor(smp_processor_id(), sigp_stop);
+	BUG();
+	for(;;);
+}
+
 /*
  *	Cycle through the processors and setup structures.
  */
@@ -602,6 +748,7 @@ int __cpu_up(unsigned int cpu)
 void __init smp_prepare_cpus(unsigned int max_cpus)
 {
 	unsigned long async_stack;
+	unsigned int cpu;
         int i;
 
         /* request the 0x1202 external interrupt */
@@ -628,13 +775,20 @@ void __init smp_prepare_cpus(unsigned int max_cpus)
 		lowcore_ptr[i]->async_stack = async_stack + (ASYNC_SIZE);
 	}
 	set_prefix((u32)(unsigned long) lowcore_ptr[smp_processor_id()]);
+
+	for_each_cpu(cpu)
+		if (cpu != smp_processor_id())
+			smp_create_idle(cpu);
 }
 
 void __devinit smp_prepare_boot_cpu(void)
 {
-	cpu_set(smp_processor_id(), cpu_online_map);
-	cpu_set(smp_processor_id(), cpu_possible_map);
-	S390_lowcore.percpu_offset = __per_cpu_offset[smp_processor_id()];
+	BUG_ON(smp_processor_id() != 0);
+
+	cpu_set(0, cpu_online_map);
+	cpu_set(0, cpu_possible_map);
+	S390_lowcore.percpu_offset = __per_cpu_offset[0];
+	current_set[0] = current;
 }
 
 void smp_cpus_done(unsigned int max_cpus)
@@ -675,3 +829,6 @@ EXPORT_SYMBOL(lowcore_ptr);
 EXPORT_SYMBOL(smp_ctl_set_bit);
 EXPORT_SYMBOL(smp_ctl_clear_bit);
 EXPORT_SYMBOL(smp_call_function);
+EXPORT_SYMBOL(smp_get_cpu);
+EXPORT_SYMBOL(smp_put_cpu);
+
diff --git a/arch/s390/kernel/time.c b/arch/s390/kernel/time.c
index e687d0aa4..12f46a65a 100644
--- a/arch/s390/kernel/time.c
+++ b/arch/s390/kernel/time.c
@@ -1,5 +1,6 @@
 /*
  *  arch/s390/kernel/time.c
+ *    Time of day based timer functions.
  *
  *  S390 version
  *    Copyright (C) 1999 IBM Deutschland Entwicklung GmbH, IBM Corporation
@@ -11,6 +12,7 @@
  *    Copyright (C) 1991, 1992, 1995  Linus Torvalds
  */
 
+#include <linux/config.h>
 #include <linux/errno.h>
 #include <linux/module.h>
 #include <linux/sched.h>
@@ -26,16 +28,14 @@
 #include <linux/types.h>
 #include <linux/profile.h>
 #include <linux/timex.h>
-#include <linux/config.h>
+#include <linux/notifier.h>
 
 #include <asm/uaccess.h>
 #include <asm/delay.h>
 #include <asm/s390_ext.h>
 #include <asm/div64.h>
 #include <asm/irq.h>
-#ifdef CONFIG_VIRT_TIMER
 #include <asm/timer.h>
-#endif
 
 /* change this if you have some constant time drift */
 #define USECS_PER_JIFFY     ((unsigned long) 1000000/HZ)
@@ -60,12 +60,6 @@ static u64 xtime_cc;
 
 extern unsigned long wall_jiffies;
 
-#ifdef CONFIG_VIRT_TIMER
-#define VTIMER_MAGIC (0x4b87ad6e + 1)
-static ext_int_info_t ext_int_info_timer;
-DEFINE_PER_CPU(struct vtimer_queue, virt_cpu_timer);
-#endif
-
 /*
  * Scheduler clock - returns current time in nanosec units.
  */
@@ -236,6 +230,8 @@ void account_ticks(struct pt_regs *regs)
 	__u32 ticks;
 
 	/* Calculate how many ticks have passed. */
+	if (S390_lowcore.int_clock < S390_lowcore.jiffy_timer)
+		return;
 	tmp = S390_lowcore.int_clock - S390_lowcore.jiffy_timer;
 	if (tmp >= 2*CLK_TICKS_PER_JIFFY) {  /* more than two ticks ? */
 		ticks = __calculate_ticks(tmp) + 1;
@@ -283,174 +279,6 @@ void account_ticks(struct pt_regs *regs)
 	s390_do_profile(regs);
 }
 
-#ifdef CONFIG_VIRT_TIMER
-void start_cpu_timer(void)
-{
-	struct vtimer_queue *vt_list;
-
-	vt_list = &per_cpu(virt_cpu_timer, smp_processor_id());
-	set_vtimer(vt_list->idle);
-}
-
-int stop_cpu_timer(void)
-{
-	__u64 done;
-	struct vtimer_queue *vt_list;
-
-	vt_list = &per_cpu(virt_cpu_timer, smp_processor_id());
-
-	/* nothing to do */
-	if (list_empty(&vt_list->list)) {
-		vt_list->idle = VTIMER_MAX_SLICE;
-		goto fire;
-	}
-
-	/* store progress */
-	asm volatile ("STPT %0" : "=m" (done));
-
-	/*
-	 * If done is negative we do not stop the CPU timer
-	 * because we will get instantly an interrupt that
-	 * will start the CPU timer again.
-	 */
-	if (done & 1LL<<63)
-		return 1;
-	else
-		vt_list->offset += vt_list->to_expire - done;
-
-	/* save the actual expire value */
-	vt_list->idle = done;
-
-	/*
-	 * We cannot halt the CPU timer, we just write a value that
-	 * nearly never expires (only after 71 years) and re-write
-	 * the stored expire value if we continue the timer
-	 */
- fire:
-	set_vtimer(VTIMER_MAX_SLICE);
-	return 0;
-}
-
-void set_vtimer(__u64 expires)
-{
-	asm volatile ("SPT %0" : : "m" (expires));
-
-	/* store expire time for this CPU timer */
-	per_cpu(virt_cpu_timer, smp_processor_id()).to_expire = expires;
-}
-
-/*
- * Sorted add to a list. List is linear searched until first bigger
- * element is found.
- */
-void list_add_sorted(struct vtimer_list *timer, struct list_head *head)
-{
-	struct vtimer_list *event;
-
-	list_for_each_entry(event, head, entry) {
-		if (event->expires > timer->expires) {
-			list_add_tail(&timer->entry, &event->entry);
-			return;
-		}
-	}
-	list_add_tail(&timer->entry, head);
-}
-
-/*
- * Do the callback functions of expired vtimer events.
- * Called from within the interrupt handler.
- */
-static void do_callbacks(struct list_head *cb_list, struct pt_regs *regs)
-{
-	struct vtimer_queue *vt_list;
-	struct vtimer_list *event, *tmp;
-	void (*fn)(unsigned long, struct pt_regs*);
-	unsigned long data;
-
-	if (list_empty(cb_list))
-		return;
-
-	vt_list = &per_cpu(virt_cpu_timer, smp_processor_id());
-
-	list_for_each_entry_safe(event, tmp, cb_list, entry) {
-		fn = event->function;
-		data = event->data;
-		fn(data, regs);
-
-		if (!event->interval)
-			/* delete one shot timer */
-			list_del_init(&event->entry);
-		else {
-			/* move interval timer back to list */
-			spin_lock(&vt_list->lock);
-			list_del_init(&event->entry);
-			list_add_sorted(event, &vt_list->list);
-			spin_unlock(&vt_list->lock);
-		}
-	}
-}
-
-/*
- * Handler for the virtual CPU timer.
- */
-static void do_cpu_timer_interrupt(struct pt_regs *regs, __u16 error_code)
-{
-	int cpu;
-	__u64 next, delta;
-	struct vtimer_queue *vt_list;
-	struct vtimer_list *event, *tmp;
-	struct list_head *ptr;
-	/* the callback queue */
-	struct list_head cb_list;
-
-	INIT_LIST_HEAD(&cb_list);
-	cpu = smp_processor_id();
-	vt_list = &per_cpu(virt_cpu_timer, cpu);
-
-	/* walk timer list, fire all expired events */
-	spin_lock(&vt_list->lock);
-
-	if (vt_list->to_expire < VTIMER_MAX_SLICE)
-		vt_list->offset += vt_list->to_expire;
-
-	list_for_each_entry_safe(event, tmp, &vt_list->list, entry) {
-		if (event->expires > vt_list->offset)
-			/* found first unexpired event, leave */
-			break;
-
-		/* re-charge interval timer, we have to add the offset */
-		if (event->interval)
-			event->expires = event->interval + vt_list->offset;
-
-		/* move expired timer to the callback queue */
-		list_move_tail(&event->entry, &cb_list);
-	}
-	spin_unlock(&vt_list->lock);
-	do_callbacks(&cb_list, regs);
-
-	/* next event is first in list */
-	spin_lock(&vt_list->lock);
-	if (!list_empty(&vt_list->list)) {
-		ptr = vt_list->list.next;
-		event = list_entry(ptr, struct vtimer_list, entry);
-		next = event->expires - vt_list->offset;
-
-		/* add the expired time from this interrupt handler
-		 * and the callback functions
-		 */
-		asm volatile ("STPT %0" : "=m" (delta));
-		delta = 0xffffffffffffffffLL - delta + 1;
-		vt_list->offset += delta;
-		next -= delta;
-	} else {
-		vt_list->offset = 0;
-		next = VTIMER_MAX_SLICE;
-	}
-	spin_unlock(&vt_list->lock);
-	set_vtimer(next);
-}
-#endif
-
 #ifdef CONFIG_NO_IDLE_HZ
 
 #ifdef CONFIG_NO_IDLE_HZ_INIT
@@ -459,78 +287,23 @@ int sysctl_hz_timer = 0;
 int sysctl_hz_timer = 1;
 #endif
 
-/*
- * Start the HZ tick on the current CPU.
- * Only cpu_idle may call this function.
- */
-void start_hz_timer(struct pt_regs *regs)
-{
-	__u64 tmp;
-	__u32 ticks;
-
-	if (!cpu_isset(smp_processor_id(), nohz_cpu_mask))
-		return;
-
-	/* Calculate how many ticks have passed */
-	asm volatile ("STCK 0(%0)" : : "a" (&tmp) : "memory", "cc");
-	tmp = tmp + CLK_TICKS_PER_JIFFY - S390_lowcore.jiffy_timer;
-	ticks = __calculate_ticks(tmp);
-	S390_lowcore.jiffy_timer += CLK_TICKS_PER_JIFFY * (__u64) ticks;
-
-	/* Set the clock comparator to the next tick. */
-	tmp = S390_lowcore.jiffy_timer + CPU_DEVIATION;
-	asm volatile ("SCKC %0" : : "m" (tmp));
-
-	/* Charge the ticks. */
-	if (ticks > 0) {
-#ifdef CONFIG_SMP
-		/*
-		 * Do not rely on the boot cpu to do the calls to do_timer.
-		 * Spread it over all cpus instead.
-		 */
-		write_seqlock(&xtime_lock);
-		if (S390_lowcore.jiffy_timer > xtime_cc) {
-			__u32 xticks;
-
-			tmp = S390_lowcore.jiffy_timer - xtime_cc;
-			if (tmp >= 2*CLK_TICKS_PER_JIFFY) {
-				xticks = __calculate_ticks(tmp);
-				xtime_cc += (__u64) xticks*CLK_TICKS_PER_JIFFY;
-			} else {
-				xticks = 1;
-				xtime_cc += CLK_TICKS_PER_JIFFY;
-			}
-			while (xticks--)
-				do_timer(regs);
-		}
-		write_sequnlock(&xtime_lock);
-		while (ticks--)
-			update_process_times(user_mode(regs));
-#else
-		while (ticks--)
-			do_timer(regs);
-#endif
-	}
-	cpu_clear(smp_processor_id(), nohz_cpu_mask);
-}
-
 /*
  * Stop the HZ tick on the current CPU.
  * Only cpu_idle may call this function.
  */
-int stop_hz_timer(void)
+static inline void stop_hz_timer(void)
 {
 	__u64 timer;
 
 	if (sysctl_hz_timer != 0)
-		return 1;
+		return;
 
 	/*
 	 * Leave the clock comparator set up for the next timer
 	 * tick if either rcu or a softirq is pending.
 	 */
 	if (rcu_pending(smp_processor_id()) || local_softirq_pending())
-		return 1;
+		return;
 
 	/*
 	 * This cpu is going really idle. Set up the clock comparator
@@ -540,61 +313,53 @@ int stop_hz_timer(void)
 	timer = (__u64) (next_timer_interrupt() - jiffies) + jiffies_64;
 	timer = jiffies_timer_cc + timer * CLK_TICKS_PER_JIFFY;
 	asm volatile ("SCKC %0" : : "m" (timer));
-
-	return 0;
-}
-#endif
-
-#if defined(CONFIG_VIRT_TIMER) || defined(CONFIG_NO_IDLE_HZ)
-
-void do_monitor_call(struct pt_regs *regs, long interruption_code)
-{
-	/* disable monitor call class 0 */
-	__ctl_clear_bit(8, 15);
-
-#ifdef CONFIG_VIRT_TIMER
-	start_cpu_timer();
-#endif
-#ifdef CONFIG_NO_IDLE_HZ
-	start_hz_timer(regs);
-#endif
 }
 
 /*
- * called from cpu_idle to stop any timers
- * returns 1 if CPU should not be stopped
+ * Start the HZ tick on the current CPU.
+ * Only cpu_idle may call this function.
  */
-int stop_timers(void)
+static inline void start_hz_timer(void)
 {
-#ifdef CONFIG_VIRT_TIMER
-	if (stop_cpu_timer())
-		return 1;
-#endif
+	if (!cpu_isset(smp_processor_id(), nohz_cpu_mask))
+		return;
+	account_ticks(__KSTK_PTREGS(current));
+	cpu_clear(smp_processor_id(), nohz_cpu_mask);
+}
 
-#ifdef CONFIG_NO_IDLE_HZ
-	if (stop_hz_timer())
-		return 1;
-#endif
+static int nohz_idle_notify(struct notifier_block *self,
+			    unsigned long action, void *hcpu)
+{
+	switch (action) {
+	case CPU_IDLE:
+		stop_hz_timer();
+		break;
+	case CPU_NOT_IDLE:
+		start_hz_timer();
+		break;
+	}
+	return NOTIFY_OK;
+}
 
-	/* enable monitor call class 0 */
-	__ctl_set_bit(8, 15);
+static struct notifier_block nohz_idle_nb = {
+	.notifier_call = nohz_idle_notify,
+};
 
-	return 0;
+void __init nohz_init(void)
+{
+	if (register_idle_notifier(&nohz_idle_nb))
+		panic("Couldn't register idle notifier");
 }
 
 #endif
 
 /*
- * Start the clock comparator and the virtual CPU timer
- * on the current CPU.
+ * Start the clock comparator on the current CPU.
  */
 void init_cpu_timer(void)
 {
 	unsigned long cr0;
 	__u64 timer;
-#ifdef CONFIG_VIRT_TIMER
-	struct vtimer_queue *vt_list;
-#endif
 
 	timer = jiffies_timer_cc + jiffies_64 * CLK_TICKS_PER_JIFFY;
 	S390_lowcore.jiffy_timer = timer + CLK_TICKS_PER_JIFFY;
@@ -604,24 +369,10 @@ void init_cpu_timer(void)
 	__ctl_store(cr0, 0, 0);
         cr0 |= 0x800;
 	__ctl_load(cr0, 0, 0);
-
-#ifdef CONFIG_VIRT_TIMER
-	/* kick the virtual timer */
-	timer = VTIMER_MAX_SLICE;
-	asm volatile ("SPT %0" : : "m" (timer));
-	__ctl_store(cr0, 0, 0);
-	cr0 |= 0x400;
-	__ctl_load(cr0, 0, 0);
-
-	vt_list = &per_cpu(virt_cpu_timer, smp_processor_id());
-	INIT_LIST_HEAD(&vt_list->list);
-	spin_lock_init(&vt_list->lock);
-	vt_list->to_expire = 0;
-	vt_list->offset = 0;
-	vt_list->idle = 0;
-#endif
 }
 
+extern void vtime_init(void);
+
 /*
  * Initialize the TOD clock and the CPU timer of
  * the boot cpu.
@@ -664,247 +415,14 @@ void __init time_init(void)
 					      &ext_int_info_cc) != 0)
                 panic("Couldn't request external interrupt 0x1004");
 
-#ifdef CONFIG_VIRT_TIMER
-	/* request the cpu timer external interrupt */
-	if (register_early_external_interrupt(0x1005, do_cpu_timer_interrupt,
-					      &ext_int_info_timer) != 0)
-		panic("Couldn't request external interrupt 0x1005");
-#endif
-
         init_cpu_timer();
-}
-
-#ifdef CONFIG_VIRT_TIMER
-void init_virt_timer(struct vtimer_list *timer)
-{
-	timer->magic = VTIMER_MAGIC;
-	timer->function = NULL;
-	INIT_LIST_HEAD(&timer->entry);
-	spin_lock_init(&timer->lock);
-}
-
-static inline int check_vtimer(struct vtimer_list *timer)
-{
-	if (timer->magic != VTIMER_MAGIC)
-		return -EINVAL;
-	return 0;
-}
-
-static inline int vtimer_pending(struct vtimer_list *timer)
-{
-	return (!list_empty(&timer->entry));
-}
-
-/*
- * this function should only run on the specified CPU
- */
-static void internal_add_vtimer(struct vtimer_list *timer)
-{
-	unsigned long flags;
-	__u64 done;
-	struct vtimer_list *event;
-	struct vtimer_queue *vt_list;
-
-	vt_list = &per_cpu(virt_cpu_timer, timer->cpu);
-	spin_lock_irqsave(&vt_list->lock, flags);
-
-	if (timer->cpu != smp_processor_id())
-		printk("internal_add_vtimer: BUG, running on wrong CPU");
-
-	/* if list is empty we only have to set the timer */
-	if (list_empty(&vt_list->list)) {
-		/* reset the offset, this may happen if the last timer was
-		 * just deleted by mod_virt_timer and the interrupt
-		 * didn't happen until here
-		 */
-		vt_list->offset = 0;
-		goto fire;
-	}
-
-	/* save progress */
-	asm volatile ("STPT %0" : "=m" (done));
-
-	/* calculate completed work */
-	done = vt_list->to_expire - done + vt_list->offset;
-	vt_list->offset = 0;
-
-	list_for_each_entry(event, &vt_list->list, entry)
-		event->expires -= done;
-
- fire:
-	list_add_sorted(timer, &vt_list->list);
-
-	/* get first element, which is the next vtimer slice */
-	event = list_entry(vt_list->list.next, struct vtimer_list, entry);
-
-	set_vtimer(event->expires);
-	spin_unlock_irqrestore(&vt_list->lock, flags);
-	/* release CPU aquired in prepare_vtimer or mod_virt_timer() */
-	put_cpu();
-}
-
-static inline int prepare_vtimer(struct vtimer_list *timer)
-{
-	if (check_vtimer(timer) || !timer->function) {
-		printk("add_virt_timer: uninitialized timer\n");
-		return -EINVAL;
-	}
 
-	if (!timer->expires || timer->expires > VTIMER_MAX_SLICE) {
-		printk("add_virt_timer: invalid timer expire value!\n");
-		return -EINVAL;
-	}
-
-	if (vtimer_pending(timer)) {
-		printk("add_virt_timer: timer pending\n");
-		return -EBUSY;
-	}
-
-	timer->cpu = get_cpu();
-	return 0;
-}
-
-/*
- * add_virt_timer - add an oneshot virtual CPU timer
- */
-void add_virt_timer(void *new)
-{
-	struct vtimer_list *timer;
-
-	timer = (struct vtimer_list *)new;
-
-	if (prepare_vtimer(timer) < 0)
-		return;
-
-	timer->interval = 0;
-	internal_add_vtimer(timer);
-}
-
-/*
- * add_virt_timer_int - add an interval virtual CPU timer
- */
-void add_virt_timer_periodic(void *new)
-{
-	struct vtimer_list *timer;
-
-	timer = (struct vtimer_list *)new;
-
-	if (prepare_vtimer(timer) < 0)
-		return;
-
-	timer->interval = timer->expires;
-	internal_add_vtimer(timer);
-}
-
-/*
- * If we change a pending timer the function must be called on the CPU
- * where the timer is running on, e.g. by smp_call_function_on()
- *
- * The original mod_timer adds the timer if it is not pending. For compatibility
- * we do the same. The timer will be added on the current CPU as a oneshot timer.
- *
- * returns whether it has modified a pending timer (1) or not (0)
- */
-int mod_virt_timer(struct vtimer_list *timer, __u64 expires)
-{
-	struct vtimer_queue *vt_list;
-	unsigned long flags;
-	int cpu;
-
-	if (check_vtimer(timer) || !timer->function) {
-		printk("mod_virt_timer: uninitialized timer\n");
-		return	-EINVAL;
-	}
-
-	if (!expires || expires > VTIMER_MAX_SLICE) {
-		printk("mod_virt_timer: invalid expire range\n");
-		return -EINVAL;
-	}
-
-	/*
-	 * This is a common optimization triggered by the
-	 * networking code - if the timer is re-modified
-	 * to be the same thing then just return:
-	 */
-	if (timer->expires == expires && vtimer_pending(timer))
-		return 1;
-
-	cpu = get_cpu();
-	vt_list = &per_cpu(virt_cpu_timer, cpu);
-
-	/* disable interrupts before test if timer is pending */
-	spin_lock_irqsave(&vt_list->lock, flags);
-
-	/* if timer isn't pending add it on the current CPU */
-	if (!vtimer_pending(timer)) {
-		spin_unlock_irqrestore(&vt_list->lock, flags);
-		/* we do not activate an interval timer with mod_virt_timer */
-		timer->interval = 0;
-		timer->expires = expires;
-		timer->cpu = cpu;
-		internal_add_vtimer(timer);
-		return 0;
-	}
-
-	/* check if we run on the right CPU */
-	if (timer->cpu != cpu) {
-		printk("mod_virt_timer: running on wrong CPU, check your code\n");
-		spin_unlock_irqrestore(&vt_list->lock, flags);
-		put_cpu();
-		return -EINVAL;
-	}
-
-	list_del_init(&timer->entry);
-	timer->expires = expires;
-
-	/* also change the interval if we have an interval timer */
-	if (timer->interval)
-		timer->interval = expires;
-
-	/* the timer can't expire anymore so we can release the lock */
-	spin_unlock_irqrestore(&vt_list->lock, flags);
-	internal_add_vtimer(timer);
-	return 1;
-}
-
-/*
- * delete a virtual timer
- *
- * returns whether the deleted timer was pending (1) or not (0)
- */
-int del_virt_timer(struct vtimer_list *timer)
-{
-	unsigned long flags;
-	struct vtimer_queue *vt_list;
-
-	if (check_vtimer(timer)) {
-		printk("del_virt_timer: timer not initialized\n");
-		return -EINVAL;
-	}
-
-	/* check if timer is pending */
-	if (!vtimer_pending(timer))
-		return 0;
-
-	if (!cpu_online(timer->cpu)) {
-		printk("del_virt_timer: CPU not present!\n");
-		return -1;
-	}
-
-	vt_list = &per_cpu(virt_cpu_timer, timer->cpu);
-	spin_lock_irqsave(&vt_list->lock, flags);
-
-	/* we don't interrupt a running timer, just let it expire! */
-	list_del_init(&timer->entry);
-
-	/* last timer removed */
-	if (list_empty(&vt_list->list)) {
-		vt_list->to_expire = 0;
-		vt_list->offset = 0;
-	}
+#ifdef CONFIG_NO_IDLE_HZ
+	nohz_init();
+#endif
 
-	spin_unlock_irqrestore(&vt_list->lock, flags);
-	return 1;
-}
+#ifdef CONFIG_VIRT_TIMER
+	vtime_init();
 #endif
+}
 
diff --git a/arch/s390/kernel/traps.c b/arch/s390/kernel/traps.c
index 537700fbe..6614d4be1 100644
--- a/arch/s390/kernel/traps.c
+++ b/arch/s390/kernel/traps.c
@@ -54,9 +54,7 @@ int sysctl_userprocess_debug = 0;
 #endif
 
 extern pgm_check_handler_t do_protection_exception;
-extern pgm_check_handler_t do_segment_exception;
-extern pgm_check_handler_t do_region_exception;
-extern pgm_check_handler_t do_page_exception;
+extern pgm_check_handler_t do_dat_exception;
 extern pgm_check_handler_t do_pseudo_page_fault;
 #ifdef CONFIG_PFAULT
 extern int pfault_init(void);
@@ -64,9 +62,7 @@ extern void pfault_fini(void);
 extern void pfault_interrupt(struct pt_regs *regs, __u16 error_code);
 static ext_int_info_t ext_int_pfault;
 #endif
-#if defined(CONFIG_NO_IDLE_HZ) || defined(CONFIG_VIRT_TIMER)
 extern pgm_check_handler_t do_monitor_call;
-#endif
 
 #define stack_pointer ({ void **sp; asm("la %0,0(15)" : "=&d" (sp)); sp; })
 
@@ -302,14 +298,10 @@ static inline void *get_check_address(struct pt_regs *regs)
 	return (void *)((regs->psw.addr-S390_lowcore.pgm_ilc) & PSW_ADDR_INSN);
 }
 
-int do_debugger_trap(struct pt_regs *regs)
+void do_single_step(struct pt_regs *regs)
 {
-	if ((regs->psw.mask & PSW_MASK_PSTATE) &&
-	    (current->ptrace & PT_PTRACED)) {
-		force_sig(SIGTRAP,current);
-		return 0;
-	}
-	return 1;
+	if ((current->ptrace & PT_PTRACED) != 0)
+		force_sig(SIGTRAP, current);
 }
 
 #define DO_ERROR(signr, str, name) \
@@ -331,12 +323,24 @@ asmlinkage void name(struct pt_regs * regs, long interruption_code) \
 
 DO_ERROR(SIGSEGV, "Unknown program exception", default_trap_handler)
 
-DO_ERROR_INFO(SIGBUS, "addressing exception", addressing_exception,
-	      BUS_ADRERR, get_check_address(regs))
+DO_ERROR_INFO(SIGILL, "addressing exception", addressing_exception,
+	      ILL_ILLADR, get_check_address(regs))
 DO_ERROR_INFO(SIGILL,  "execute exception", execute_exception,
 	      ILL_ILLOPN, get_check_address(regs))
 DO_ERROR_INFO(SIGFPE,  "fixpoint divide exception", divide_exception,
 	      FPE_INTDIV, get_check_address(regs))
+DO_ERROR_INFO(SIGFPE,  "fixpoint overflow exception", overflow_exception,
+	      FPE_INTOVF, get_check_address(regs))
+DO_ERROR_INFO(SIGFPE,  "HFP overflow exception", hfp_overflow_exception,
+	      FPE_FLTOVF, get_check_address(regs))
+DO_ERROR_INFO(SIGFPE,  "HFP underflow exception", hfp_underflow_exception,
+	      FPE_FLTUND, get_check_address(regs))
+DO_ERROR_INFO(SIGFPE,  "HFP significance exception", hfp_significance_exception,
+	      FPE_FLTRES, get_check_address(regs))
+DO_ERROR_INFO(SIGFPE,  "HFP divide exception", hfp_divide_exception,
+	      FPE_FLTDIV, get_check_address(regs))
+DO_ERROR_INFO(SIGFPE,  "HFP square root exception", hfp_sqrt_exception,
+	      FPE_FLTINV, get_check_address(regs))
 DO_ERROR_INFO(SIGILL,  "operand exception", operand_exception,
 	      ILL_ILLOPN, get_check_address(regs))
 DO_ERROR_INFO(SIGILL,  "privileged operation", privileged_op,
@@ -390,19 +394,15 @@ asmlinkage void illegal_op(struct pt_regs * regs, long interruption_code)
 	if (regs->psw.mask & PSW_MASK_PSTATE)
 		local_irq_enable();
 
-	if (regs->psw.mask & PSW_MASK_PSTATE)
-		get_user(*((__u16 *) opcode), (__u16 __user *)location);
-	else
-		*((__u16 *)opcode)=*((__u16 *)location);
-	if (*((__u16 *)opcode)==S390_BREAKPOINT_U16)
-        {
-		if(do_debugger_trap(regs))
-			signal = SIGILL;
-	}
+	if (regs->psw.mask & PSW_MASK_PSTATE) {
+		get_user(*((__u16 *) opcode), (__u16 __user *) location);
+		if (*((__u16 *) opcode) == S390_BREAKPOINT_U16) {
+			if (current->ptrace & PT_PTRACED)
+				force_sig(SIGTRAP, current);
+			else
+				signal = SIGILL;
 #ifdef CONFIG_MATHEMU
-        else if (regs->psw.mask & PSW_MASK_PSTATE)
-	{
-		if (opcode[0] == 0xb3) {
+		} else if (opcode[0] == 0xb3) {
 			get_user(*((__u16 *) (opcode+2)), location+1);
 			signal = math_emu_b3(opcode, regs);
                 } else if (opcode[0] == 0xed) {
@@ -418,12 +418,12 @@ asmlinkage void illegal_op(struct pt_regs * regs, long interruption_code)
 		} else if (*((__u16 *) opcode) == 0xb29d) {
 			get_user(*((__u16 *) (opcode+2)), location+1);
 			signal = math_emu_lfpc(opcode, regs);
+#endif
 		} else
 			signal = SIGILL;
-        }
-#endif 
-	else
+	} else
 		signal = SIGILL;
+
         if (signal == SIGFPE)
 		do_fp_trap(regs, location,
                            current->thread.fp_regs.fpc, interruption_code);
@@ -447,9 +447,9 @@ specification_exception(struct pt_regs * regs, long interruption_code)
 	 * We got all needed information from the lowcore and can
 	 * now safely switch on interrupts.
 	 */
-	if (regs->psw.mask & PSW_MASK_PSTATE)
+        if (regs->psw.mask & PSW_MASK_PSTATE)
 		local_irq_enable();
-		
+
         if (regs->psw.mask & PSW_MASK_PSTATE) {
 		get_user(*((__u16 *) opcode), location);
 		switch (opcode[0]) {
@@ -481,6 +481,7 @@ specification_exception(struct pt_regs * regs, long interruption_code)
                 }
         } else
 		signal = SIGILL;
+
         if (signal == SIGFPE)
 		do_fp_trap(regs, location,
                            current->thread.fp_regs.fpc, interruption_code);
@@ -607,22 +608,31 @@ void __init trap_init(void)
         pgm_check_table[5] = &addressing_exception;
         pgm_check_table[6] = &specification_exception;
         pgm_check_table[7] = &data_exception;
+        pgm_check_table[8] = &overflow_exception;
         pgm_check_table[9] = &divide_exception;
-        pgm_check_table[0x10] = &do_segment_exception;
-        pgm_check_table[0x11] = &do_page_exception;
+        pgm_check_table[0x0A] = &overflow_exception;
+        pgm_check_table[0x0B] = &divide_exception;
+        pgm_check_table[0x0C] = &hfp_overflow_exception;
+        pgm_check_table[0x0D] = &hfp_underflow_exception;
+        pgm_check_table[0x0E] = &hfp_significance_exception;
+        pgm_check_table[0x0F] = &hfp_divide_exception;
+        pgm_check_table[0x10] = &do_dat_exception;
+        pgm_check_table[0x11] = &do_dat_exception;
         pgm_check_table[0x12] = &translation_exception;
         pgm_check_table[0x13] = &special_op_exception;
 #ifndef CONFIG_ARCH_S390X
  	pgm_check_table[0x14] = &do_pseudo_page_fault;
 #else /* CONFIG_ARCH_S390X */
-        pgm_check_table[0x38] = &addressing_exception;
-        pgm_check_table[0x3B] = &do_region_exception;
+        pgm_check_table[0x38] = &do_dat_exception;
+	pgm_check_table[0x39] = &do_dat_exception;
+	pgm_check_table[0x3A] = &do_dat_exception;
+        pgm_check_table[0x3B] = &do_dat_exception;
 #endif /* CONFIG_ARCH_S390X */
         pgm_check_table[0x15] = &operand_exception;
         pgm_check_table[0x1C] = &privileged_op;
-#if defined(CONFIG_VIRT_TIMER) || defined(CONFIG_NO_IDLE_HZ)
+        pgm_check_table[0x1D] = &hfp_sqrt_exception;
 	pgm_check_table[0x40] = &do_monitor_call;
-#endif
+
 	if (MACHINE_IS_VM) {
 		/*
 		 * First try to get pfault pseudo page faults going.
diff --git a/arch/s390/lib/string.c b/arch/s390/lib/string.c
index dea4957d0..966af7c52 100644
--- a/arch/s390/lib/string.c
+++ b/arch/s390/lib/string.c
@@ -394,12 +394,3 @@ void *memset(void *s, int c, size_t n)
 	return s;
 }
 EXPORT_SYMBOL_NOVERS(memset);
-
-/*
- * missing exports for string functions defined in lib/string.c
- */
-EXPORT_SYMBOL_NOVERS(memmove);
-EXPORT_SYMBOL_NOVERS(strchr);
-EXPORT_SYMBOL_NOVERS(strnchr);
-EXPORT_SYMBOL_NOVERS(strncmp);
-EXPORT_SYMBOL_NOVERS(strpbrk);
diff --git a/arch/s390/mm/cmm.c b/arch/s390/mm/cmm.c
index 095a5648c..cb2950301 100644
--- a/arch/s390/mm/cmm.c
+++ b/arch/s390/mm/cmm.c
@@ -19,6 +19,7 @@
 
 #include <asm/pgalloc.h>
 #include <asm/uaccess.h>
+#include <asm/smp.h>
 
 #include "../../../drivers/s390/net/smsgiucv.h"
 
@@ -255,13 +256,13 @@ static struct ctl_table cmm_table[];
 
 static int
 cmm_pages_handler(ctl_table *ctl, int write, struct file *filp,
-		  void *buffer, size_t *lenp)
+		  void *buffer, size_t *lenp, loff_t *ppos)
 {
 	char buf[16], *p;
 	long pages;
 	int len;
 
-	if (!*lenp || (filp->f_pos && !write)) {
+	if (!*lenp || (*ppos && !write)) {
 		*lenp = 0;
 		return 0;
 	}
@@ -290,19 +291,19 @@ cmm_pages_handler(ctl_table *ctl, int write, struct file *filp,
 			return -EFAULT;
 	}
 	*lenp = len;
-	filp->f_pos += len;
+	*ppos += len;
 	return 0;
 }
 
 static int
 cmm_timeout_handler(ctl_table *ctl, int write, struct file *filp,
-		    void *buffer, size_t *lenp)
+		    void *buffer, size_t *lenp, loff_t *ppos)
 {
 	char buf[64], *p;
 	long pages, seconds;
 	int len;
 
-	if (!*lenp || (filp->f_pos && !write)) {
+	if (!*lenp || (*ppos && !write)) {
 		*lenp = 0;
 		return 0;
 	}
@@ -327,7 +328,7 @@ cmm_timeout_handler(ctl_table *ctl, int write, struct file *filp,
 			return -EFAULT;
 	}
 	*lenp = len;
-	filp->f_pos += len;
+	*ppos += len;
 	return 0;
 }
 
@@ -407,6 +408,14 @@ struct ctl_table_header *cmm_sysctl_header;
 static int
 cmm_init (void)
 {
+	int rc;
+
+	/* Prevent logical cpu 0 from being set offline. */
+	rc = smp_get_cpu(cpumask_of_cpu(0));
+	if (rc) {
+		printk(KERN_ERR "CMM: unable to reserve cpu 0\n");
+		return rc;
+	}
 #ifdef CONFIG_CMM_PROC
 	cmm_sysctl_header = register_sysctl_table(cmm_dir_table, 1);
 #endif
@@ -430,6 +439,8 @@ cmm_exit(void)
 #ifdef CONFIG_CMM_IUCV
 	smsg_unregister_callback(SMSG_PREFIX, cmm_smsg_target);
 #endif
+	/* Allow logical cpu 0 to be set offline again. */
+	smp_put_cpu(0);
 }
 
 module_init(cmm_init);
diff --git a/arch/s390/mm/fault.c b/arch/s390/mm/fault.c
index 9cf3b392e..8b2dda883 100644
--- a/arch/s390/mm/fault.c
+++ b/arch/s390/mm/fault.c
@@ -159,7 +159,8 @@ static void force_sigsegv(struct pt_regs *regs, unsigned long error_code,
  *   11       Page translation     ->  Not present       (nullification)
  *   3b       Region third trans.  ->  Not present       (nullification)
  */
-extern inline void do_exception(struct pt_regs *regs, unsigned long error_code)
+extern inline void
+do_exception(struct pt_regs *regs, unsigned long error_code, int is_protection)
 {
         struct task_struct *tsk;
         struct mm_struct *mm;
@@ -177,7 +178,7 @@ extern inline void do_exception(struct pt_regs *regs, unsigned long error_code)
 	 * as a special case because the translation exception code 
 	 * field is not guaranteed to contain valid data in this case.
 	 */
-	if (error_code == 4 && !(S390_lowcore.trans_exc_code & 4)) {
+	if (is_protection && !(S390_lowcore.trans_exc_code & 4)) {
 
 		/* Low-address protection hit in kernel mode means 
 		   NULL pointer write access in kernel mode.  */
@@ -232,7 +233,7 @@ extern inline void do_exception(struct pt_regs *regs, unsigned long error_code)
  */
 good_area:
 	si_code = SEGV_ACCERR;
-	if (error_code != 4) {
+	if (!is_protection) {
 		/* page not present, check vm flags */
 		if (!(vma->vm_flags & (VM_READ | VM_EXEC | VM_WRITE)))
 			goto bad_area;
@@ -247,7 +248,7 @@ survive:
 	 * make sure we exit gracefully rather than endlessly redo
 	 * the fault.
 	 */
-	switch (handle_mm_fault(mm, vma, address, error_code == 4)) {
+	switch (handle_mm_fault(mm, vma, address, is_protection)) {
 	case VM_FAULT_MINOR:
 		tsk->min_flt++;
 		break;
@@ -263,6 +264,11 @@ survive:
 	}
 
         up_read(&mm->mmap_sem);
+	/*
+	 * The instruction that caused the program check will
+	 * be repeated. Don't signal single step via SIGTRAP.
+	 */
+	clear_tsk_thread_flag(current, TIF_SINGLE_STEP);
         return;
 
 /*
@@ -337,28 +343,15 @@ do_sigbus:
 void do_protection_exception(struct pt_regs *regs, unsigned long error_code)
 {
 	regs->psw.addr -= (error_code >> 16);
-	do_exception(regs, 4);
+	do_exception(regs, 4, 1);
 }
 
-void do_segment_exception(struct pt_regs *regs, unsigned long error_code)
+void do_dat_exception(struct pt_regs *regs, unsigned long error_code)
 {
-	do_exception(regs, 0x10);
+	do_exception(regs, error_code & 0xff, 0);
 }
 
-void do_page_exception(struct pt_regs *regs, unsigned long error_code)
-{
-	do_exception(regs, 0x11);
-}
-
-#ifdef CONFIG_ARCH_S390X
-
-void
-do_region_exception(struct pt_regs *regs, unsigned long error_code)
-{
-	do_exception(regs, 0x3b);
-}
-
-#else /* CONFIG_ARCH_S390X */
+#ifndef CONFIG_ARCH_S390X
 
 typedef struct _pseudo_wait_t {
        struct _pseudo_wait_t *next;
@@ -456,6 +449,11 @@ do_pseudo_page_fault(struct pt_regs *regs, unsigned long error_code)
                 wait_struct.next = pseudo_lock_queue;
                 pseudo_lock_queue = &wait_struct;
                 spin_unlock(&pseudo_wait_spinlock);
+		/*
+		 * The instruction that caused the program check will
+		 * be repeated. Don't signal single step via SIGTRAP.
+		 */
+		clear_tsk_thread_flag(current, TIF_SINGLE_STEP);
                 /* go to sleep */
                 wait_event(wait_struct.queue, wait_struct.resolved);
         }
diff --git a/arch/s390/mm/init.c b/arch/s390/mm/init.c
index 177a3d26e..1541b8699 100644
--- a/arch/s390/mm/init.c
+++ b/arch/s390/mm/init.c
@@ -60,7 +60,7 @@ void show_mem(void)
 
         printk("Mem-info:\n");
         show_free_areas();
-        printk("Free swap:       %6dkB\n",nr_swap_pages<<(PAGE_SHIFT-10));
+        printk("Free swap:       %6ldkB\n", nr_swap_pages<<(PAGE_SHIFT-10));
         i = max_mapnr;
         while (i-- > 0) {
                 total++;
diff --git a/arch/sh/Kconfig b/arch/sh/Kconfig
index e774424d6..2140eb0ec 100644
--- a/arch/sh/Kconfig
+++ b/arch/sh/Kconfig
@@ -45,6 +45,12 @@ config SH_7751_SOLUTION_ENGINE
 	  Select 7751 SolutionEngine if configuring for a Hitachi SH7751
 	  evalutation board.
 
+config SH_7300_SOLUTION_ENGINE
+	bool "SolutionEngine7300"
+	help
+	  Select 7300 SolutionEngine if configuring for a Hitachi SH7300(SH-Mobile V)
+	  evalutation board.
+
 config SH_7751_SYSTEMH
 	bool "SystemH7751R"
 	help
@@ -138,6 +144,18 @@ config SH_SECUREEDGE5410
 	  This includes both the OEM SecureEdge products as well as the
 	  SME product line.
 
+config SH_HS7751RVOIP
+	bool "HS7751RVOIP"
+	help
+	  Select HS7751RVOIP if configuring for a Renesas Technology
+	  Sales VoIP board.
+
+config SH_RTS7751R2D
+	bool "RTS7751R2D"
+	help
+	  Select RTS7751R2D if configuring for a Renesas Technology
+	  Sales SH-Graphics board.
+
 config SH_UNKNOWN
 	bool "BareCPU"
 	help
@@ -186,7 +204,11 @@ config CPU_SUBTYPE_SH7604
 config CPU_SUBTYPE_SH7300
 	bool "SH7300"
 	depends on CPU_SH3
-	  
+
+config CPU_SUBTYPE_SH7705
+	bool "SH7705"
+	depends on CPU_SH3
+
 config CPU_SUBTYPE_SH7707
 	bool "SH7707"
 	depends on CPU_SH3
@@ -224,10 +246,17 @@ config CPU_SUBTYPE_SH7760
 	depends on CPU_SH4
 
 config CPU_SUBTYPE_ST40STB1
-	bool "ST40STB1"
-	depends on CPU_SH4
-	help
-	  Select ST40STB1 if you have a ST40STB1 CPU.
+       bool "ST40STB1 / ST40RA"
+       depends on CPU_SH4
+       help
+         Select ST40STB1 if you have a ST40RA CPU.
+         This was previously called the ST40STB1, hence the option name.
+
+config CPU_SUBTYPE_ST40GX1
+       bool "ST40GX1"
+       depends on CPU_SH4
+       help
+         Select ST40GX1 if you have a ST40GX1 CPU.
 
 endchoice
 
@@ -268,7 +297,7 @@ config CMDLINE
 config MEMORY_START
 	hex "Physical memory start address" if !MEMORY_SET || MEMORY_OVERRIDE
 	default "0x08000000" if !MEMORY_SET || MEMORY_OVERRIDE || !MEMORY_OVERRIDE && SH_ADX || SH_MPC1211 || SH_SECUREEDGE5410
-	default "0x0c000000" if !MEMORY_OVERRIDE && (SH_DREAMCAST || SH_HP600 || SH_BIGSUR || SH_SH2000 || SH_7751_SOLUTION_ENGINE || SH_SOLUTION_ENGINE)
+	default "0x0c000000" if !MEMORY_OVERRIDE && (SH_DREAMCAST || SH_HP600 || SH_BIGSUR || SH_SH2000 || SH_7751_SOLUTION_ENGINE || SH_SOLUTION_ENGINE || SH_HS7751RVOIP || SH_RTS7751R2D)
 	---help---
 	  Computers built with Hitachi SuperH processors always
 	  map the ROM starting at address zero.  But the processor
@@ -287,7 +316,7 @@ config MEMORY_SIZE
 	hex "Physical memory size" if !MEMORY_SET || MEMORY_OVERRIDE
 	default "0x00400000" if !MEMORY_SET || MEMORY_OVERRIDE || !MEMORY_OVERRIDE && SH_ADX || !MEMORY_OVERRIDE && (SH_HP600 || SH_BIGSUR || SH_SH2000)
 	default "0x01000000" if !MEMORY_OVERRIDE && SH_DREAMCAST || SH_SECUREEDGE5410
-	default "0x04000000" if !MEMORY_OVERRIDE && SH_7751_SOLUTION_ENGINE
+	default "0x04000000" if !MEMORY_OVERRIDE && (SH_7751_SOLUTION_ENGINE || SH_HS7751RVOIP || SH_RTS7751R2D)
 	default "0x02000000" if !MEMORY_OVERRIDE && SH_SOLUTION_ENGINE
 	default "0x08000000" if SH_MPC1211
 	help
@@ -299,7 +328,7 @@ config MEMORY_SIZE
 
 config MEMORY_SET
 	bool
-	depends on !MEMORY_OVERRIDE && (SH_MPC1211 || SH_ADX || SH_DREAMCAST || SH_HP600 || SH_BIGSUR || SH_SH2000 || SH_7751_SOLUTION_ENGINE || SH_SOLUTION_ENGINE || SH_SECUREEDGE5410)
+	depends on !MEMORY_OVERRIDE && (SH_MPC1211 || SH_ADX || SH_DREAMCAST || SH_HP600 || SH_BIGSUR || SH_SH2000 || SH_7751_SOLUTION_ENGINE || SH_SOLUTION_ENGINE || SH_SECUREEDGE5410 || SH_HS7751RVOIP || SH_RTS7751R2D)
 	default y
 	help
 	  This is an option about which you will never be asked a question.
@@ -358,7 +387,7 @@ config CF_BASE_ADDR
 # The SH7750 RTC module is disabled in the Dreamcast
 config SH_RTC
 	bool
-	depends on !SH_DREAMCAST && !SH_SATURN
+	depends on !SH_DREAMCAST && !SH_SATURN && !SH_7300_SOLUTION_ENGINE
 	default y
 	help
 	  Selecting this option will allow the Linux kernel to emulate
@@ -377,11 +406,26 @@ config SH_DSP
 
 	  This option must be set in order to enable the DSP.
 
+config SH_ADC
+	bool "ADC support"
+	depends on CPU_SH3
+	default y
+	help
+	  Selecting this option will allow the Linux kernel to use SH3 on-chip
+	  ADC module.
+
+	  If unsure, say N.
+
 config SH_HP600
 	bool
 	depends on SH_HP620 || SH_HP680 || SH_HP690
 	default y
 
+config CPU_SUBTYPE_ST40
+       bool
+       depends on CPU_SUBTYPE_ST40STB1 || CPU_SUBTYPE_ST40GX1
+       default y
+
 config DISCONTIGMEM
 	bool
 	depends on SH_HP690
@@ -514,10 +558,32 @@ config NR_CPUS
 	  This is purely to save memory - each supported CPU adds
 	  approximately eight kilobytes to the kernel image.
 
+config HS7751RVOIP_CODEC
+	bool "Support VoIP Codec section"
+	depends on SH_HS7751RVOIP
+	help
+	  Selecting this option will support CODEC section.
+
+config RTS7751R2D_REV11
+	bool "RTS7751R2D Rev. 1.1 board support"
+	depends on SH_RTS7751R2D
+	help
+	  Selecting this option will support version rev. 1.1.
+
+config SH_PCLK_CALC
+	bool
+	default n if CPU_SUBTYPE_SH7300
+	default y
+	help
+	  This option will cause the PCLK value to be probed at run-time. It
+	  will display a notification if the probed value has greater than a
+	  1% variance of the hardcoded CONFIG_SH_PCLK_FREQ.
+
 config SH_PCLK_FREQ
 	int "Peripheral clock frequency (in Hz)"
 	default "49876504" if CPU_SUBTYPE_SH7750
 	default "60013568" if CPU_SUBTYPE_SH7751
+	default "33333333" if CPU_SUBTYPE_SH7300
 	default "1193182"
 	help
 	  This option is used to specify the peripheral clock frequency. This
@@ -570,12 +636,18 @@ source "arch/sh/cchips/Kconfig"
 
 config HEARTBEAT
 	bool "Heartbeat LED"
-	depends on SH_MPC1211 || SH_CAT68701 || SH_STB1_HARP || SH_STB1_OVERDRIVE || SH_BIGSUR || SH_7751_SOLUTION_ENGINE || SH_SOLUTION_ENGINE
+	depends on SH_MPC1211 || SH_CAT68701 || SH_STB1_HARP || SH_STB1_OVERDRIVE || SH_BIGSUR || SH_7751_SOLUTION_ENGINE || SH_7300_SOLUTION_ENGINE || SH_SOLUTION_ENGINE || SH_RTS7751R2D
 	help
 	  Use the power-on LED on your machine as a load meter.  The exact
 	  behavior is platform-dependent, but normally the flash frequency is
 	  a hyperbolic function of the 5-minute load average.
 
+config RTC_9701JE
+	tristate "EPSON RTC-9701JE support"
+	depends on SH_RTS7751R2D
+	help
+	  Selecting this option will support EPSON RTC-9701JE.
+
 endmenu
 
 
@@ -646,6 +718,24 @@ source "fs/Kconfig.binfmt"
 
 endmenu
 
+menu "SH initrd options"
+	depends on BLK_DEV_INITRD
+
+config EMBEDDED_RAMDISK
+	bool "Embed root filesystem ramdisk into the kernel"
+
+config EMBEDDED_RAMDISK_IMAGE
+	string "Filename of gziped ramdisk image"
+	depends on EMBEDDED_RAMDISK
+	default "ramdisk.gz"
+	help
+	  This is the filename of the ramdisk image to be built into the
+	  kernel.  Relative pathnames are relative to arch/mips/ramdisk/.
+	  The ramdisk image is not part of the kernel distribution; you must
+	  provide one yourself.
+
+endmenu
+
 source "drivers/Kconfig"
 
 source "fs/Kconfig"
@@ -675,6 +765,14 @@ config DEBUG_SPINLOCK
 	  best used in conjunction with the NMI watchdog so that spinlock
 	  deadlocks are also debuggable.
 
+config DEBUG_INFO
+        bool "Compile the kernel with debug info"
+        help
+          If you say Y here the resulting kernel image will include
+          debugging info resulting in a larger kernel image.
+          Say Y here only if you plan to use gdb to debug the kernel.
+          If you don't debug the kernel, you can say N.
+
 config SH_STANDARD_BIOS
 	bool "Use LinuxSH standard BIOS"
 	help
@@ -688,9 +786,13 @@ config SH_STANDARD_BIOS
 	  mask ROM and no flash (WindowsCE machines fall in this category).
 	  If unsure, say N.
 
-config SH_EARLY_PRINTK
+config EARLY_SCIF_CONSOLE
+	bool "Use early SCIF console"
+	depends on CPU_SH4
+
+config EARLY_PRINTK
 	bool "Early printk support"
-	depends on SH_STANDARD_BIOS
+	depends on SH_STANDARD_BIOS || EARLY_SCIF_CONSOLE
 	help
 	  Say Y here to redirect kernel printk messages to the serial port
 	  used by the SH-IPL bootloader, starting very early in the boot
diff --git a/arch/sh/Makefile b/arch/sh/Makefile
index ea63935f1..7e0087146 100644
--- a/arch/sh/Makefile
+++ b/arch/sh/Makefile
@@ -1,11 +1,11 @@
-# $Id: Makefile,v 1.34 2004/03/21 17:31:06 lethal Exp $
+# $Id: Makefile,v 1.35 2004/04/15 03:39:20 sugioka 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) 1999  Kaz Kojima
-# Copyright (C) 2002, 2003  Paul Mundt
+# Copyright (C) 2002, 2003, 2004  Paul Mundt
 # Copyright (C) 2002  M. R. Brown
 #
 # This file is included by the global makefile so that you can add your own
@@ -64,10 +64,18 @@ LIBGCC := $(shell $(CC) $(CFLAGS) -print-libgcc-file-name)
 
 core-y				+= arch/sh/kernel/ arch/sh/mm/
 
+#
+# ramdisk/initrd support
+# You need a compressed ramdisk image, named
+# CONFIG_EMBEDDED_RAMDISK_IMAGE. Relative pathnames
+# are relative to arch/sh/ramdisk/.
+#
+core-$(CONFIG_EMBEDDED_RAMDISK)	+= arch/sh/ramdisk/
+
 # Boards
 machdir-$(CONFIG_SH_SOLUTION_ENGINE)		:= se/770x
 machdir-$(CONFIG_SH_7751_SOLUTION_ENGINE)	:= se/7751
-machdir-$(CONFIG_SH_7751_SYSTEMH)		:= systemh
+machdir-$(CONFIG_SH_7300_SOLUTION_ENGINE)	:= se/7300
 machdir-$(CONFIG_SH_STB1_HARP)			:= harp
 machdir-$(CONFIG_SH_STB1_OVERDRIVE)		:= overdrive
 machdir-$(CONFIG_SH_HP620)			:= hp6xx/hp620
@@ -84,19 +92,24 @@ machdir-$(CONFIG_SH_SH2000)			:= sh2000
 machdir-$(CONFIG_SH_ADX)			:= adx
 machdir-$(CONFIG_SH_MPC1211)			:= mpc1211
 machdir-$(CONFIG_SH_SECUREEDGE5410)		:= snapgear
+machdir-$(CONFIG_SH_HS7751RVOIP)		:= renesas/hs7751rvoip
+machdir-$(CONFIG_SH_RTS7751R2D)			:= renesas/rts7751r2d
+machdir-$(CONFIG_SH_7751_SYSTEMH)		:= renesas/systemh
 machdir-$(CONFIG_SH_UNKNOWN)			:= unknown
 
-incdir-y			:= $(machdir-y)
+incdir-y			:= $(notdir $(machdir-y))
 
 incdir-$(CONFIG_SH_SOLUTION_ENGINE)		:= se
 incdir-$(CONFIG_SH_7751_SOLUTION_ENGINE)	:= se7751
+incdir-$(CONFIG_SH_7300_SOLUTION_ENGINE)        := se7300
 incdir-$(CONFIG_SH_HP600)			:= hp6xx
 
 core-y				+= arch/sh/boards/$(machdir-y)/
 
 # Companion chips
-core-$(CONFIG_HD64461)	+= arch/sh/cchips/hd6446x/hd64461/
-core-$(CONFIG_HD64465)	+= arch/sh/cchips/hd6446x/hd64465/
+core-$(CONFIG_HD64461)		+= arch/sh/cchips/hd6446x/hd64461/
+core-$(CONFIG_HD64465)		+= arch/sh/cchips/hd6446x/hd64465/
+core-$(CONFIG_VOYAGERGX)	+= arch/sh/cchips/voyagergx/
 
 cpuincdir-$(CONFIG_CPU_SH2)	:= cpu-sh2
 cpuincdir-$(CONFIG_CPU_SH3)	:= cpu-sh3
@@ -114,6 +127,9 @@ AFLAGS_vmlinux.lds.o := -traditional
 prepare: target_links
 
 .PHONY: target_links FORCE
+
+all: zImage
+
 target_links:
 	@echo '  Making asm-sh/cpu -> asm-sh/$(cpuincdir-y) link'
 	@rm -f include/asm-sh/cpu
diff --git a/arch/sh/boot/compressed/Makefile b/arch/sh/boot/compressed/Makefile
index 04489a938..05ca14dfa 100644
--- a/arch/sh/boot/compressed/Makefile
+++ b/arch/sh/boot/compressed/Makefile
@@ -15,7 +15,11 @@ endif
 
 #
 # IMAGE_OFFSET is the load offset of the compression loader
+# Assign dummy values if these 2 variables are not defined,
+# in order to suppress error message.
 #
+CONFIG_MEMORY_START     ?= 0x0c000000
+CONFIG_BOOT_LINK_OFFSET ?= 0x00800000
 IMAGE_OFFSET := $(shell printf "0x%8x" $$[0x80000000+$(CONFIG_MEMORY_START)+$(CONFIG_BOOT_LINK_OFFSET)])
 
 LDFLAGS_vmlinux := -Ttext $(IMAGE_OFFSET) -e startup -T $(obj)/../../kernel/vmlinux.lds.s
diff --git a/arch/sh/boot/compressed/misc.c b/arch/sh/boot/compressed/misc.c
index 1ed7425a4..211e91100 100644
--- a/arch/sh/boot/compressed/misc.c
+++ b/arch/sh/boot/compressed/misc.c
@@ -1,7 +1,7 @@
 /*
  * arch/sh/boot/compressed/misc.c
- * 
- * This is a collection of several routines from gzip-1.0.3 
+ *
+ * This is a collection of several routines from gzip-1.0.3
  * adapted for Linux.
  *
  * malloc by Hannu Savolainen 1993 and Matthias Urlichs 1994
@@ -52,7 +52,7 @@ static unsigned outcnt = 0;  /* bytes in output buffer */
 #define RESERVED     0xC0 /* bit 6,7:   reserved */
 
 #define get_byte()  (inptr < insize ? inbuf[inptr++] : fill_inbuf())
-		
+
 /* Diagnostic functions */
 #ifdef DEBUG
 #  define Assert(cond,msg) {if(!(cond)) error(msg);}
@@ -75,7 +75,7 @@ static void flush_window(void);
 static void error(char *m);
 static void gzip_mark(void **);
 static void gzip_release(void **);
-  
+
 extern char input_data[];
 extern int input_len;
 
@@ -83,20 +83,19 @@ static long bytes_out = 0;
 static uch *output_data;
 static unsigned long output_ptr = 0;
 
- 
 static void *malloc(int size);
 static void free(void *where);
 static void error(char *m);
 static void gzip_mark(void **);
 static void gzip_release(void **);
- 
-static void puts(const char *);
-  
+
+int puts(const char *);
+
 extern int _text;		/* Defined in vmlinux.lds.S */
 extern int _end;
 static unsigned long free_mem_ptr;
 static unsigned long free_mem_end_ptr;
- 
+
 #define HEAP_SIZE             0x10000
 
 #include "../../../../lib/inflate.c"
@@ -134,7 +133,7 @@ static void gzip_release(void **ptr)
 }
 
 #ifdef CONFIG_SH_STANDARD_BIOS
-static int strlen(const char *s)
+size_t strlen(const char *s)
 {
 	int i = 0;
 
@@ -143,14 +142,17 @@ static int strlen(const char *s)
 	return i;
 }
 
-void puts(const char *s)
+int puts(const char *s)
 {
-	sh_bios_console_write(s, strlen(s));
+	int len = strlen(s);
+	sh_bios_console_write(s, len);
+	return len;
 }
 #else
-void puts(const char *s)
+int puts(const char *s)
 {
-  /* This should be updated to use the sh-sci routines */
+	/* This should be updated to use the sh-sci routines */
+	return 0;
 }
 #endif
 
@@ -198,9 +200,9 @@ static void flush_window(void)
     ulg c = crc;         /* temporary variable */
     unsigned n;
     uch *in, *out, ch;
-    
+
     in = window;
-    out = &output_data[output_ptr]; 
+    out = &output_data[output_ptr];
     for (n = 0; n < outcnt; n++) {
 	    ch = *out++ = *in++;
 	    c = crc_32_tab[((int)c ^ ch) & 0xff] ^ (c >> 8);
diff --git a/arch/sh/cchips/Kconfig b/arch/sh/cchips/Kconfig
index 8a11af1ba..155d13988 100644
--- a/arch/sh/cchips/Kconfig
+++ b/arch/sh/cchips/Kconfig
@@ -1,5 +1,18 @@
 menu "Companion Chips"
 
+config VOYAGERGX
+	bool "VoyagerGX chip support"
+	depends on SH_RTS7751R2D
+	help
+	  Selecting this option will support Silicon Motion, Inc. SM501.
+	  Designed to complement needs for the embedded industry, it
+	  provides video and 2D capability. To reduce system cost a
+	  wide variety of include I/O is supported, including analog RGB
+	  and digital LCD Panel interface, 8-bit parallel interface, USB,
+	  UART, IrDA, Zoom Video, AC97 or I2S, SSP, PWM, and I2C. There
+	  are additional GPIO bits that can be used to interface to
+	  external as well.
+
 # A board must have defined HD6446X_SERIES in order to see these
 config HD6446X_SERIES
 	bool "HD6446x support"
diff --git a/arch/sh/cchips/hd6446x/hd64461/setup.c b/arch/sh/cchips/hd6446x/hd64461/setup.c
index 5e03ea938..f014b9bf6 100644
--- a/arch/sh/cchips/hd6446x/hd64461/setup.c
+++ b/arch/sh/cchips/hd6446x/hd64461/setup.c
@@ -134,7 +134,7 @@ int hd64461_irq_demux(int irq)
 	return __irq_demux(irq);
 }
 
-static struct irqaction irq0 = { hd64461_interrupt, SA_INTERRUPT, 0, "HD64461", NULL, NULL };
+static struct irqaction irq0 = { hd64461_interrupt, SA_INTERRUPT, CPU_MASK_NONE, "HD64461", NULL, NULL };
 
 int __init setup_hd64461(void)
 {
diff --git a/arch/sh/cchips/hd6446x/hd64465/setup.c b/arch/sh/cchips/hd6446x/hd64465/setup.c
index 73a44a770..68e4c4e42 100644
--- a/arch/sh/cchips/hd6446x/hd64465/setup.c
+++ b/arch/sh/cchips/hd6446x/hd64465/setup.c
@@ -154,7 +154,7 @@ int hd64465_irq_demux(int irq)
 	return irq;
 }
 
-static struct irqaction irq0  = { hd64465_interrupt, SA_INTERRUPT, 0, "HD64465", NULL, NULL};
+static struct irqaction irq0  = { hd64465_interrupt, SA_INTERRUPT, CPU_MASK_NONE, "HD64465", NULL, NULL};
 
 
 static int __init setup_hd64465(void)
diff --git a/arch/sh/configs/dreamcast_defconfig b/arch/sh/configs/dreamcast_defconfig
index 6d7e566d5..ec2a0f332 100644
--- a/arch/sh/configs/dreamcast_defconfig
+++ b/arch/sh/configs/dreamcast_defconfig
@@ -261,7 +261,6 @@ CONFIG_IPV6_SCTP__=y
 # 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
 
 #
diff --git a/arch/sh/configs/rts7751r2d_defconfig b/arch/sh/configs/rts7751r2d_defconfig
index f9e1f7c5a..b724a5192 100644
--- a/arch/sh/configs/rts7751r2d_defconfig
+++ b/arch/sh/configs/rts7751r2d_defconfig
@@ -264,7 +264,6 @@ CONFIG_IPV6_SCTP__=y
 # 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
 
 #
diff --git a/arch/sh/configs/se7751_defconfig b/arch/sh/configs/se7751_defconfig
index 6501d94ff..4162d3d6d 100644
--- a/arch/sh/configs/se7751_defconfig
+++ b/arch/sh/configs/se7751_defconfig
@@ -284,7 +284,6 @@ CONFIG_IPV6_SCTP__=y
 # 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
 
 #
diff --git a/arch/sh/configs/snapgear_defconfig b/arch/sh/configs/snapgear_defconfig
index 877f25ada..25919849d 100644
--- a/arch/sh/configs/snapgear_defconfig
+++ b/arch/sh/configs/snapgear_defconfig
@@ -203,7 +203,6 @@ CONFIG_IPV6_SCTP__=y
 # 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
 
 #
diff --git a/arch/sh/defconfig b/arch/sh/defconfig
index 44ec26ea5..ef852bbc9 100644
--- a/arch/sh/defconfig
+++ b/arch/sh/defconfig
@@ -352,7 +352,7 @@ CONFIG_MSDOS_PARTITION=y
 # CONFIG_MAGIC_SYSRQ is not set
 # CONFIG_DEBUG_SPINLOCK is not set
 CONFIG_SH_STANDARD_BIOS=y
-CONFIG_SH_EARLY_PRINTK=y
+CONFIG_EARLY_PRINTK=y
 # CONFIG_KGDB is not set
 # CONFIG_FRAME_POINTER is not set
 
diff --git a/arch/sh/drivers/dma/Makefile b/arch/sh/drivers/dma/Makefile
index e89418542..065d4c909 100644
--- a/arch/sh/drivers/dma/Makefile
+++ b/arch/sh/drivers/dma/Makefile
@@ -3,6 +3,7 @@
 #
 
 obj-y				+= dma-api.o dma-isa.o
+obj-$(CONFIG_SYSFS)		+= dma-sysfs.o
 obj-$(CONFIG_SH_DMA)		+= dma-sh.o
 obj-$(CONFIG_SH_DREAMCAST)	+= dma-pvr2.o dma-g2.o
 
diff --git a/arch/sh/drivers/dma/dma-api.c b/arch/sh/drivers/dma/dma-api.c
index f8b352d4b..3fc34e1cf 100644
--- a/arch/sh/drivers/dma/dma-api.c
+++ b/arch/sh/drivers/dma/dma-api.c
@@ -3,23 +3,24 @@
  *
  * SuperH-specific DMA management API
  *
- * Copyright (C) 2003  Paul Mundt
+ * Copyright (C) 2003, 2004  Paul Mundt
  *
  * This file is subject to the terms and conditions of the GNU General Public
  * License.  See the file "COPYING" in the main directory of this archive
  * for more details.
- */ 
+ */
 #include <linux/init.h>
 #include <linux/module.h>
 #include <linux/interrupt.h>
 #include <linux/spinlock.h>
 #include <linux/proc_fs.h>
+#include <linux/list.h>
 #include <asm/dma.h>
 
-struct dma_info dma_info[MAX_DMA_CHANNELS] = { { 0, } };
 spinlock_t dma_spin_lock = SPIN_LOCK_UNLOCKED;
+static LIST_HEAD(registered_dmac_list);
 
-/* 
+/*
  * A brief note about the reasons for this API as it stands.
  *
  * For starters, the old ISA DMA API didn't work for us for a number of
@@ -54,124 +55,213 @@ spinlock_t dma_spin_lock = SPIN_LOCK_UNLOCKED;
 
 struct dma_info *get_dma_info(unsigned int chan)
 {
-	return dma_info + chan;
+	struct list_head *pos, *tmp;
+	unsigned int total = 0;
+
+	/*
+	 * Look for each DMAC's range to determine who the owner of
+	 * the channel is.
+	 */
+	list_for_each_safe(pos, tmp, &registered_dmac_list) {
+		struct dma_info *info = list_entry(pos, struct dma_info, list);
+
+		total += info->nr_channels;
+		if (chan > total)
+			continue;
+
+		return info;
+	}
+
+	return NULL;
+}
+
+struct dma_channel *get_dma_channel(unsigned int chan)
+{
+	struct dma_info *info = get_dma_info(chan);
+
+	if (!info)
+		return ERR_PTR(-EINVAL);
+
+	return info->channels + chan;
 }
 
 int get_dma_residue(unsigned int chan)
 {
 	struct dma_info *info = get_dma_info(chan);
+	struct dma_channel *channel = &info->channels[chan];
 
 	if (info->ops->get_residue)
-		return info->ops->get_residue(info);
-	
+		return info->ops->get_residue(channel);
+
 	return 0;
 }
 
 int request_dma(unsigned int chan, const char *dev_id)
 {
 	struct dma_info *info = get_dma_info(chan);
+	struct dma_channel *channel = &info->channels[chan];
 
-	down(&info->sem);
+	down(&channel->sem);
 
 	if (!info->ops || chan >= MAX_DMA_CHANNELS) {
-		up(&info->sem);
+		up(&channel->sem);
 		return -EINVAL;
 	}
-	
-	atomic_set(&info->busy, 1);
 
-	info->dev_id = dev_id;
+	atomic_set(&channel->busy, 1);
 
-	up(&info->sem);
+	strlcpy(channel->dev_id, dev_id, sizeof(channel->dev_id));
+
+	up(&channel->sem);
 
 	if (info->ops->request)
-		return info->ops->request(info);
-	
+		return info->ops->request(channel);
+
 	return 0;
 }
 
 void free_dma(unsigned int chan)
 {
 	struct dma_info *info = get_dma_info(chan);
+	struct dma_channel *channel = &info->channels[chan];
 
 	if (info->ops->free)
-		info->ops->free(info);
-	
-	atomic_set(&info->busy, 0);
+		info->ops->free(channel);
+
+	atomic_set(&channel->busy, 0);
 }
 
 void dma_wait_for_completion(unsigned int chan)
 {
 	struct dma_info *info = get_dma_info(chan);
+	struct dma_channel *channel = &info->channels[chan];
 
-	if (info->tei_capable) {
-		wait_event(info->wait_queue, (info->ops->get_residue(info) == 0));
+	if (channel->flags & DMA_TEI_CAPABLE) {
+		wait_event(channel->wait_queue,
+			   (info->ops->get_residue(channel) == 0));
 		return;
 	}
 
-	while (info->ops->get_residue(info))
+	while (info->ops->get_residue(channel))
 		cpu_relax();
 }
 
 void dma_configure_channel(unsigned int chan, unsigned long flags)
 {
 	struct dma_info *info = get_dma_info(chan);
+	struct dma_channel *channel = &info->channels[chan];
 
 	if (info->ops->configure)
-		info->ops->configure(info, flags);
+		info->ops->configure(channel, flags);
 }
 
 int dma_xfer(unsigned int chan, unsigned long from,
 	     unsigned long to, size_t size, unsigned int mode)
 {
 	struct dma_info *info = get_dma_info(chan);
+	struct dma_channel *channel = &info->channels[chan];
 
-	info->sar	= from;
-	info->dar	= to;
-	info->count	= size;
-	info->mode	= mode;
+	channel->sar	= from;
+	channel->dar	= to;
+	channel->count	= size;
+	channel->mode	= mode;
 
-	return info->ops->xfer(info);
+	return info->ops->xfer(channel);
 }
 
 #ifdef CONFIG_PROC_FS
 static int dma_read_proc(char *buf, char **start, off_t off,
 			 int len, int *eof, void *data)
 {
-	struct dma_info *info;
+	struct list_head *pos, *tmp;
 	char *p = buf;
-	int i;
 
-	for (i = 0, info = dma_info; i < MAX_DMA_CHANNELS; i++, info++) {
-		if (!atomic_read(&info->busy))
-			continue;
+	if (list_empty(&registered_dmac_list))
+		return 0;
+
+	/*
+	 * Iterate over each registered DMAC
+	 */
+	list_for_each_safe(pos, tmp, &registered_dmac_list) {
+		struct dma_info *info = list_entry(pos, struct dma_info, list);
+		int i;
 
-		p += sprintf(p, "%2d: %14s    %s\n", i,
-			     info->ops->name, info->dev_id);
+		/*
+		 * Iterate over each channel
+		 */
+		for (i = 0; i < info->nr_channels; i++) {
+			struct dma_channel *channel = info->channels + i;
+
+			if (!(channel->flags & DMA_CONFIGURED))
+				continue;
+
+			p += sprintf(p, "%2d: %14s    %s\n", i,
+				     info->name, channel->dev_id);
+		}
 	}
 
 	return p - buf;
 }
 #endif
 
-int __init register_dmac(struct dma_ops *ops)
+
+int __init register_dmac(struct dma_info *info)
 {
 	int i;
 
-	printk("DMA: Registering %s handler.\n", ops->name);
+	INIT_LIST_HEAD(&info->list);
+
+	printk(KERN_INFO "DMA: Registering %s handler (%d channels).\n",
+	       info->name, info->nr_channels);
+
+	BUG_ON((info->flags & DMAC_CHANNELS_CONFIGURED) && !info->channels);
 
-	for (i = 0; i < MAX_DMA_CHANNELS; i++) {
-		struct dma_info *info = get_dma_info(i);
+	/*
+	 * Don't touch pre-configured channels
+	 */
+	if (!(info->flags & DMAC_CHANNELS_CONFIGURED)) {
+		unsigned int size;
 
-		info->chan = i;
+		size = sizeof(struct dma_channel) * info->nr_channels;
 
-		init_MUTEX(&info->sem);
-		init_waitqueue_head(&info->wait_queue);
+		info->channels = kmalloc(size, GFP_KERNEL);
+		if (!info->channels)
+			return -ENOMEM;
+
+		memset(info->channels, 0, size);
 	}
 
+	for (i = 0; i < info->nr_channels; i++) {
+		struct dma_channel *chan = info->channels + i;
+
+		chan->chan = i;
+
+		memcpy(chan->dev_id, "Unused", 7);
+
+		if (info->flags & DMAC_CHANNELS_TEI_CAPABLE)
+			chan->flags |= DMA_TEI_CAPABLE;
+
+		init_MUTEX(&chan->sem);
+		init_waitqueue_head(&chan->wait_queue);
+
+#ifdef CONFIG_SYSFS
+		dma_create_sysfs_files(chan);
+#endif
+	}
+
+	list_add(&info->list, &registered_dmac_list);
+
 	return 0;
 }
 
+void __exit unregister_dmac(struct dma_info *info)
+{
+	if (!(info->flags & DMAC_CHANNELS_CONFIGURED))
+		kfree(info->channels);
+
+	list_del(&info->list);
+}
+
 static int __init dma_api_init(void)
 {
 	printk("DMA: Registering DMA API.\n");
@@ -191,8 +281,11 @@ MODULE_LICENSE("GPL");
 
 EXPORT_SYMBOL(request_dma);
 EXPORT_SYMBOL(free_dma);
+EXPORT_SYMBOL(register_dmac);
+EXPORT_SYMBOL(unregister_dmac);
 EXPORT_SYMBOL(get_dma_residue);
 EXPORT_SYMBOL(get_dma_info);
+EXPORT_SYMBOL(get_dma_channel);
 EXPORT_SYMBOL(dma_xfer);
 EXPORT_SYMBOL(dma_wait_for_completion);
 EXPORT_SYMBOL(dma_configure_channel);
diff --git a/arch/sh/drivers/dma/dma-isa.c b/arch/sh/drivers/dma/dma-isa.c
index 01564983b..1c9bc45b8 100644
--- a/arch/sh/drivers/dma/dma-isa.c
+++ b/arch/sh/drivers/dma/dma-isa.c
@@ -3,13 +3,14 @@
  *
  * Generic ISA DMA wrapper for SH DMA API
  *
- * Copyright (C) 2003  Paul Mundt
+ * Copyright (C) 2003, 2004  Paul Mundt
  *
  * This file is subject to the terms and conditions of the GNU General Public
  * License.  See the file "COPYING" in the main directory of this archive
  * for more details.
- */ 
+ */
 #include <linux/kernel.h>
+#include <linux/module.h>
 #include <asm/dma.h>
 
 /*
@@ -39,55 +40,67 @@ unsigned long __deprecated claim_dma_lock(void)
 
 	return flags;
 }
+EXPORT_SYMBOL(claim_dma_lock);
 
 void __deprecated release_dma_lock(unsigned long flags)
 {
 	spin_unlock_irqrestore(&dma_spin_lock, flags);
 }
+EXPORT_SYMBOL(release_dma_lock);
 
 void __deprecated disable_dma(unsigned int chan)
 {
 	/* Nothing */
 }
+EXPORT_SYMBOL(disable_dma);
 
 void __deprecated enable_dma(unsigned int chan)
 {
 	struct dma_info *info = get_dma_info(chan);
+	struct dma_channel *channel = &info->channels[chan];
 
-	info->ops->xfer(info);
+	info->ops->xfer(channel);
 }
+EXPORT_SYMBOL(enable_dma);
 
 void clear_dma_ff(unsigned int chan)
 {
 	/* Nothing */
 }
+EXPORT_SYMBOL(clear_dma_ff);
 
 void set_dma_mode(unsigned int chan, char mode)
 {
 	struct dma_info *info = get_dma_info(chan);
+	struct dma_channel *channel = &info->channels[chan];
 
-	info->mode = mode;
+	channel->mode = mode;
 }
+EXPORT_SYMBOL(set_dma_mode);
 
 void set_dma_addr(unsigned int chan, unsigned int addr)
 {
 	struct dma_info *info = get_dma_info(chan);
+	struct dma_channel *channel = &info->channels[chan];
 
 	/*
 	 * Single address mode is the only thing supported through
 	 * this interface.
 	 */
-	if ((info->mode & DMA_MODE_MASK) == DMA_MODE_READ) {
-		info->sar = addr;
+	if ((channel->mode & DMA_MODE_MASK) == DMA_MODE_READ) {
+		channel->sar = addr;
 	} else {
-		info->dar = addr;
+		channel->dar = addr;
 	}
 }
+EXPORT_SYMBOL(set_dma_addr);
 
 void set_dma_count(unsigned int chan, unsigned int count)
 {
 	struct dma_info *info = get_dma_info(chan);
+	struct dma_channel *channel = &info->channels[chan];
 
-	info->count = count;
+	channel->count = count;
 }
+EXPORT_SYMBOL(set_dma_count);
 
diff --git a/arch/sh/drivers/dma/dma-sh.c b/arch/sh/drivers/dma/dma-sh.c
index ec3ff5044..31dacd444 100644
--- a/arch/sh/drivers/dma/dma-sh.c
+++ b/arch/sh/drivers/dma/dma-sh.c
@@ -1,10 +1,10 @@
 /*
- * arch/sh/kernel/cpu/dma.c
+ * arch/sh/drivers/dma/dma-sh.c
  *
- * Copyright (C) 2000 Takashi YOSHII
- * Copyright (C) 2003 Paul Mundt
+ * SuperH On-chip DMAC Support
  *
- * PC like DMA API for SuperH's DMAC.
+ * Copyright (C) 2000 Takashi YOSHII
+ * Copyright (C) 2003, 2004 Paul Mundt
  *
  * This file is subject to the terms and conditions of the GNU General Public
  * License.  See the file "COPYING" in the main directory of this archive
@@ -29,43 +29,29 @@
  * Defaults to a 64-bit transfer size.
  */
 enum {
-	XMIT_SZ_64BIT	= 0,
-	XMIT_SZ_8BIT	= 1,
-	XMIT_SZ_16BIT	= 2,
-	XMIT_SZ_32BIT	= 3,
-	XMIT_SZ_256BIT	= 4,
+	XMIT_SZ_64BIT,
+	XMIT_SZ_8BIT,
+	XMIT_SZ_16BIT,
+	XMIT_SZ_32BIT,
+	XMIT_SZ_256BIT,
 };
 
 /*
  * The DMA count is defined as the number of bytes to transfer.
  */
 static unsigned int ts_shift[] = {
-	[XMIT_SZ_64BIT]		3,
-	[XMIT_SZ_8BIT]		0,
-	[XMIT_SZ_16BIT]		1,
-	[XMIT_SZ_32BIT]		2,
-	[XMIT_SZ_256BIT]	5,
-};
-
-struct sh_dmac_channel {
-        unsigned long sar;
-        unsigned long dar;
-        unsigned long dmatcr;
-        unsigned long chcr;
-} __attribute__ ((aligned(16)));
-
-struct sh_dmac_info {
-        struct sh_dmac_channel channel[4];
-        unsigned long dmaor;
+	[XMIT_SZ_64BIT]		= 3,
+	[XMIT_SZ_8BIT]		= 0,
+	[XMIT_SZ_16BIT]		= 1,
+	[XMIT_SZ_32BIT]		= 2,
+	[XMIT_SZ_256BIT]	= 5,
 };
 
-static volatile struct sh_dmac_info *sh_dmac = (volatile struct sh_dmac_info *)SH_DMAC_BASE;
-
 static inline unsigned int get_dmte_irq(unsigned int chan)
 {
 	unsigned int irq;
 
-	/* 
+	/*
 	 * Normally we could just do DMTE0_IRQ + chan outright, though in the
 	 * case of the 7751R, the DMTE IRQs for channels > 4 start right above
 	 * the SCIF
@@ -84,13 +70,17 @@ static inline unsigned int get_dmte_irq(unsigned int chan)
  * We determine the correct shift size based off of the CHCR transmit size
  * for the given channel. Since we know that it will take:
  *
- * 	info->count >> ts_shift[transmit_size]
+ *	info->count >> ts_shift[transmit_size]
  *
  * iterations to complete the transfer.
  */
-static inline unsigned int calc_xmit_shift(struct dma_info *info)
+static inline unsigned int calc_xmit_shift(struct dma_channel *chan)
 {
-	return ts_shift[(sh_dmac->channel[info->chan].chcr >> 4) & 0x0007];
+	u32 chcr = ctrl_inl(CHCR[chan->chan]);
+
+	chcr >>= 4;
+
+	return ts_shift[chcr & 0x0007];
 }
 
 /*
@@ -101,68 +91,79 @@ static inline unsigned int calc_xmit_shift(struct dma_info *info)
  */
 static irqreturn_t dma_tei(int irq, void *dev_id, struct pt_regs *regs)
 {
-	struct dma_info * info = (struct dma_info *)dev_id;
-	u32 chcr = sh_dmac->channel[info->chan].chcr;
+	struct dma_channel *chan = (struct dma_channel *)dev_id;
+	u32 chcr;
+
+	chcr = ctrl_inl(CHCR[chan->chan]);
 
 	if (!(chcr & CHCR_TE))
 		return IRQ_NONE;
 
-	sh_dmac->channel[info->chan].chcr = chcr & ~(CHCR_IE | CHCR_DE);
+	chcr &= ~(CHCR_IE | CHCR_DE);
+	ctrl_outl(chcr, CHCR[chan->chan]);
 
-	wake_up(&info->wait_queue);
+	wake_up(&chan->wait_queue);
 
 	return IRQ_HANDLED;
 }
 
-static int sh_dmac_request_dma(struct dma_info *info)
+static int sh_dmac_request_dma(struct dma_channel *chan)
 {
-	return request_irq(get_dmte_irq(info->chan), dma_tei,
-			   SA_INTERRUPT, "DMAC Transfer End", info);
+	return request_irq(get_dmte_irq(chan->chan), dma_tei,
+			   SA_INTERRUPT, "DMAC Transfer End", chan);
 }
 
-static void sh_dmac_free_dma(struct dma_info *info)
+static void sh_dmac_free_dma(struct dma_channel *chan)
 {
-	free_irq(get_dmte_irq(info->chan), info);
+	free_irq(get_dmte_irq(chan->chan), chan);
 }
 
-static void sh_dmac_configure_channel(struct dma_info *info, unsigned long chcr)
+static void sh_dmac_configure_channel(struct dma_channel *chan, unsigned long chcr)
 {
 	if (!chcr)
 		chcr = RS_DUAL;
 
-	sh_dmac->channel[info->chan].chcr = chcr;
+	ctrl_outl(chcr, CHCR[chan->chan]);
 
-	info->configured = 1;
+	chan->flags |= DMA_CONFIGURED;
 }
 
-static void sh_dmac_enable_dma(struct dma_info *info)
+static void sh_dmac_enable_dma(struct dma_channel *chan)
 {
-	int irq = get_dmte_irq(info->chan);
+	int irq = get_dmte_irq(chan->chan);
+	u32 chcr;
+
+	chcr = ctrl_inl(CHCR[chan->chan]);
+	chcr |= CHCR_DE | CHCR_IE;
+	ctrl_outl(chcr, CHCR[chan->chan]);
 
-	sh_dmac->channel[info->chan].chcr |= (CHCR_DE | CHCR_IE);
 	enable_irq(irq);
 }
 
-static void sh_dmac_disable_dma(struct dma_info *info)
+static void sh_dmac_disable_dma(struct dma_channel *chan)
 {
-	int irq = get_dmte_irq(info->chan);
+	int irq = get_dmte_irq(chan->chan);
+	u32 chcr;
 
 	disable_irq(irq);
-	sh_dmac->channel[info->chan].chcr &= ~(CHCR_DE | CHCR_TE | CHCR_IE);
+
+	chcr = ctrl_inl(CHCR[chan->chan]);
+	chcr &= ~(CHCR_DE | CHCR_TE | CHCR_IE);
+	ctrl_outl(chcr, CHCR[chan->chan]);
 }
 
-static int sh_dmac_xfer_dma(struct dma_info *info)
+static int sh_dmac_xfer_dma(struct dma_channel *chan)
 {
-	/* 
+	/*
 	 * If we haven't pre-configured the channel with special flags, use
 	 * the defaults.
 	 */
-	if (!info->configured)
-		sh_dmac_configure_channel(info, 0);
+	if (!(chan->flags & DMA_CONFIGURED))
+		sh_dmac_configure_channel(chan, 0);
+
+	sh_dmac_disable_dma(chan);
 
-	sh_dmac_disable_dma(info);
-	
-	/* 
+	/*
 	 * Single-address mode usage note!
 	 *
 	 * It's important that we don't accidentally write any value to SAR/DAR
@@ -177,33 +178,36 @@ static int sh_dmac_xfer_dma(struct dma_info *info)
 	 * cascading to the PVR2 DMAC. In this case, we still need to write
 	 * SAR and DAR, regardless of value, in order for cascading to work.
 	 */
-	if (info->sar || (mach_is_dreamcast() && info->chan == 2))
-		sh_dmac->channel[info->chan].sar = info->sar;
-	if (info->dar || (mach_is_dreamcast() && info->chan == 2))
-		sh_dmac->channel[info->chan].dar = info->dar;
-	
-	sh_dmac->channel[info->chan].dmatcr = info->count >> calc_xmit_shift(info);
+	if (chan->sar || (mach_is_dreamcast() && chan->chan == 2))
+		ctrl_outl(chan->sar, SAR[chan->chan]);
+	if (chan->dar || (mach_is_dreamcast() && chan->chan == 2))
+		ctrl_outl(chan->dar, DAR[chan->chan]);
+
+	ctrl_outl(chan->count >> calc_xmit_shift(chan), DMATCR[chan->chan]);
 
-	sh_dmac_enable_dma(info);
+	sh_dmac_enable_dma(chan);
 
 	return 0;
 }
 
-static int sh_dmac_get_dma_residue(struct dma_info *info)
+static int sh_dmac_get_dma_residue(struct dma_channel *chan)
 {
-	if (!(sh_dmac->channel[info->chan].chcr & CHCR_DE))
+	if (!(ctrl_inl(CHCR[chan->chan]) & CHCR_DE))
 		return 0;
 
-	return sh_dmac->channel[info->chan].dmatcr << calc_xmit_shift(info);
+	return ctrl_inl(DMATCR[chan->chan]) << calc_xmit_shift(chan);
 }
 
 #if defined(CONFIG_CPU_SH4)
 static irqreturn_t dma_err(int irq, void *dev_id, struct pt_regs *regs)
 {
-	printk("DMAE: DMAOR=%lx\n", sh_dmac->dmaor);
+	unsigned long dmaor = ctrl_inl(DMAOR);
 
-	sh_dmac->dmaor &= ~(DMAOR_NMIF | DMAOR_AE);
-	sh_dmac->dmaor |= DMAOR_DME;
+	printk("DMAE: DMAOR=%lx\n", dmaor);
+
+	ctrl_outl(ctrl_inl(DMAOR)&~DMAOR_NMIF, DMAOR);
+	ctrl_outl(ctrl_inl(DMAOR)&~DMAOR_AE, DMAOR);
+	ctrl_outl(ctrl_inl(DMAOR)|DMAOR_DME, DMAOR);
 
 	disable_irq(irq);
 
@@ -212,16 +216,23 @@ static irqreturn_t dma_err(int irq, void *dev_id, struct pt_regs *regs)
 #endif
 
 static struct dma_ops sh_dmac_ops = {
-	.name		= "SuperH DMAC",
 	.request	= sh_dmac_request_dma,
 	.free		= sh_dmac_free_dma,
 	.get_residue	= sh_dmac_get_dma_residue,
 	.xfer		= sh_dmac_xfer_dma,
 	.configure	= sh_dmac_configure_channel,
 };
-	
+
+static struct dma_info sh_dmac_info = {
+	.name		= "SuperH DMAC",
+	.nr_channels	= 4,
+	.ops		= &sh_dmac_ops,
+	.flags		= DMAC_CHANNELS_TEI_CAPABLE,
+};
+
 static int __init sh_dmac_init(void)
 {
+	struct dma_info *info = &sh_dmac_info;
 	int i;
 
 #ifdef CONFIG_CPU_SH4
@@ -231,18 +242,15 @@ static int __init sh_dmac_init(void)
 		return i;
 #endif
 
-	for (i = 0; i < MAX_DMAC_CHANNELS; i++) {
+	for (i = 0; i < info->nr_channels; i++) {
 		int irq = get_dmte_irq(i);
 
 		make_ipr_irq(irq, DMA_IPR_ADDR, DMA_IPR_POS, DMA_PRIORITY);
-
-		dma_info[i].ops = &sh_dmac_ops;
-		dma_info[i].tei_capable = 1;
 	}
 
-	sh_dmac->dmaor |= 0x8000 | DMAOR_DME;
+	ctrl_outl(0x8000 | DMAOR_DME, DMAOR);
 
-	return register_dmac(&sh_dmac_ops);
+	return register_dmac(info);
 }
 
 static void __exit sh_dmac_exit(void)
diff --git a/arch/sh/drivers/pci/Makefile b/arch/sh/drivers/pci/Makefile
index 20e928162..4923bbf5e 100644
--- a/arch/sh/drivers/pci/Makefile
+++ b/arch/sh/drivers/pci/Makefile
@@ -12,4 +12,5 @@ obj-$(CONFIG_SH_DREAMCAST)		+= ops-dreamcast.o fixups-dreamcast.o \
 					   dma-dreamcast.o
 obj-$(CONFIG_SH_SECUREEDGE5410)		+= ops-snapgear.o
 obj-$(CONFIG_SH_BIGSUR)			+= ops-bigsur.o
+obj-$(CONFIG_SH_RTS7751R2D)		+= ops-rts7751r2d.o fixups-rts7751r2d.o
 
diff --git a/arch/sh/drivers/pci/ops-snapgear.c b/arch/sh/drivers/pci/ops-snapgear.c
index b44fe7f53..6fdb9765c 100644
--- a/arch/sh/drivers/pci/ops-snapgear.c
+++ b/arch/sh/drivers/pci/ops-snapgear.c
@@ -61,6 +61,8 @@ static struct sh7751_pci_address_map sh7751_pci_map = {
 		.base	= SH7751_CS2_BASE_ADDR,
 		.size	= SNAPGEAR_LSR1_SIZE,
 	},
+
+	.flags	= SH7751_PCIC_NO_RESET,
 };
 
 /*
diff --git a/arch/sh/drivers/pci/pci-auto.c b/arch/sh/drivers/pci/pci-auto.c
index 65fb8832f..2ad70d499 100644
--- a/arch/sh/drivers/pci/pci-auto.c
+++ b/arch/sh/drivers/pci/pci-auto.c
@@ -45,7 +45,7 @@
 #include <linux/types.h>
 #include <linux/pci.h>
 
-#define	DEBUG
+#undef	DEBUG
 #ifdef 	DEBUG
 #define	DBG(x...)	printk(x)
 #else
@@ -106,7 +106,8 @@ static void __init
 pciauto_setup_bars(struct pci_channel *hose,
 		   int top_bus,
 		   int current_bus,
-		   int pci_devfn)
+		   int pci_devfn,
+		   int bar_limit)
 {
 	u32 bar_response, bar_size, bar_value;
 	u32 bar, addr_mask, bar_nr = 0;
@@ -114,7 +115,8 @@ pciauto_setup_bars(struct pci_channel *hose,
 	u32 * lower_limit;
 	int found_mem64 = 0;
 
-	for (bar = PCI_BASE_ADDRESS_0; bar <= PCI_BASE_ADDRESS_5; bar+=4) {
+	for (bar = PCI_BASE_ADDRESS_0; bar <= bar_limit; bar+=4) {
+#if !defined(CONFIG_SH_HS7751RVOIP) && !defined(CONFIG_SH_RTS7751R2D)
 		u32 bar_addr;
 
 		/* Read the old BAR value */
@@ -123,6 +125,7 @@ pciauto_setup_bars(struct pci_channel *hose,
 					pci_devfn,
 					bar,
 					&bar_addr);
+#endif
 
 		/* Tickle the BAR and get the response */
 		early_write_config_dword(hose, top_bus,
@@ -137,6 +140,7 @@ pciauto_setup_bars(struct pci_channel *hose,
 					bar,
 					&bar_response);
 
+#if !defined(CONFIG_SH_HS7751RVOIP) && !defined(CONFIG_SH_RTS7751R2D)
 		/* 
 		 * Write the old BAR value back out, only update the BAR
 		 * if we implicitly want resources to be updated, which
@@ -147,6 +151,7 @@ pciauto_setup_bars(struct pci_channel *hose,
 					 pci_devfn,
 					 bar,
 					 bar_addr);
+#endif
 
 		/* If BAR is not implemented go to the next BAR */
 		if (!bar_response)
@@ -287,6 +292,11 @@ pciauto_postscan_setup_bridge(struct pci_channel *hose,
 {
 	u32 temp;
 
+	/*
+	 * [jsun] we always bump up baselines a little, so that if there
+	 * nothing behind P2P bridge, we don't wind up overlapping IO/MEM
+	 * spaces.
+	 */
 	pciauto_lower_memspc += 1;
 	pciauto_lower_iospc += 1;
 
@@ -318,93 +328,99 @@ pciauto_postscan_setup_bridge(struct pci_channel *hose,
 
 static void __init
 pciauto_prescan_setup_cardbus_bridge(struct pci_channel *hose,
-                            int top_bus,
-                            int current_bus,
-                            int pci_devfn,
-                            int sub_bus)
+			int top_bus,
+			int current_bus,
+			int pci_devfn,
+			int sub_bus)
 {
-       /* Configure bus number registers */
-       early_write_config_byte(hose, top_bus, current_bus, pci_devfn,
-                               PCI_PRIMARY_BUS, current_bus);
-       early_write_config_byte(hose, top_bus, current_bus, pci_devfn,
-                               PCI_SECONDARY_BUS, sub_bus + 1);
-       early_write_config_byte(hose, top_bus, current_bus, pci_devfn,
-                               PCI_SUBORDINATE_BUS, 0xff);
-
-       /* Align memory and I/O to 4KB and 4 byte boundaries. */
-       pciauto_lower_memspc = (pciauto_lower_memspc + (0x1000 - 1))
-               & ~(0x1000 - 1);
-       pciauto_lower_iospc = (pciauto_lower_iospc + (0x4 - 1))
-               & ~(0x4 - 1);
-
-       early_write_config_dword(hose, top_bus, current_bus, pci_devfn,
-               PCI_CB_MEMORY_BASE_0, pciauto_lower_memspc);
-       early_write_config_dword(hose, top_bus, current_bus, pci_devfn,
-               PCI_CB_IO_BASE_0, pciauto_lower_iospc);  
+	/* Configure bus number registers */
+	early_write_config_byte(hose, top_bus, current_bus, pci_devfn,
+				PCI_PRIMARY_BUS, current_bus);
+	early_write_config_byte(hose, top_bus, current_bus, pci_devfn,
+				PCI_SECONDARY_BUS, sub_bus + 1);
+	early_write_config_byte(hose, top_bus, current_bus, pci_devfn,
+				PCI_SUBORDINATE_BUS, 0xff);
+
+	/* Align memory and I/O to 4KB and 4 byte boundaries. */
+	pciauto_lower_memspc = (pciauto_lower_memspc + (0x1000 - 1))
+		& ~(0x1000 - 1);
+	pciauto_lower_iospc = (pciauto_lower_iospc + (0x4 - 1))
+		& ~(0x4 - 1);
+
+	early_write_config_dword(hose, top_bus, current_bus, pci_devfn,
+		PCI_CB_MEMORY_BASE_0, pciauto_lower_memspc);
+	early_write_config_dword(hose, top_bus, current_bus, pci_devfn,
+		PCI_CB_IO_BASE_0, pciauto_lower_iospc);
 }
 
 static void __init
 pciauto_postscan_setup_cardbus_bridge(struct pci_channel *hose,
-                             int top_bus,
-                             int current_bus,
-                             int pci_devfn,
-                             int sub_bus)
+			int top_bus,
+			int current_bus,
+			int pci_devfn,
+			int sub_bus)
 {
-       u32 temp;
-
-       /* 
-        * [jsun] we always bump up baselines a little, so that if there 
-        * nothing behind P2P bridge, we don't wind up overlapping IO/MEM 
-        * spaces.
-        */
-       pciauto_lower_memspc += 1;
-       pciauto_lower_iospc += 1;
-
-       /*
-        * Configure subordinate bus number.  The PCI subsystem
-        * bus scan will renumber buses (reserving three additional
-        * for this PCI<->CardBus bridge for the case where a CardBus
-        * adapter contains a P2P or CB2CB bridge.
-        */
-
-       early_write_config_byte(hose, top_bus, current_bus, pci_devfn,
-                               PCI_SUBORDINATE_BUS, sub_bus);
-
-       /*
-        * Reserve an additional 4MB for mem space and 16KB for
-        * I/O space.  This should cover any additional space
-        * requirement of unusual CardBus devices with 
-        * additional bridges that can consume more address space.
-        * 
-        * Although pcmcia-cs currently will reprogram bridge
-        * windows, the goal is to add an option to leave them
-        * alone and use the bridge window ranges as the regions
-        * that are searched for free resources upon hot-insertion
-        * of a device.  This will allow a PCI<->CardBus bridge
-        * configured by this routine to happily live behind a
-        * P2P bridge in a system.
-        */
-
-       /* Align memory and I/O to 4KB and 4 byte boundaries. */
-       pciauto_lower_memspc = (pciauto_lower_memspc + (0x1000 - 1))
-               & ~(0x1000 - 1);
-       pciauto_lower_iospc = (pciauto_lower_iospc + (0x4 - 1))
-               & ~(0x4 - 1);
-       /* Set up memory and I/O filter limits, assume 32-bit I/O space */
-       early_write_config_dword(hose, top_bus, current_bus, pci_devfn,
-               PCI_CB_MEMORY_LIMIT_0, pciauto_lower_memspc - 1); 
-       early_write_config_dword(hose, top_bus, current_bus, pci_devfn,
-               PCI_CB_IO_LIMIT_0, pciauto_lower_iospc - 1);
-       
-       /* Enable memory and I/O accesses, enable bus master */
-       early_read_config_dword(hose, top_bus, current_bus, pci_devfn,
-               PCI_COMMAND, &temp);
-       early_write_config_dword(hose, top_bus, current_bus, pci_devfn,
-               PCI_COMMAND, temp | PCI_COMMAND_IO | PCI_COMMAND_MEMORY
-               | PCI_COMMAND_MASTER);
+	u32 temp;
+
+#if !defined(CONFIG_SH_HS7751RVOIP) && !defined(CONFIG_SH_RTS7751R2D)
+	/*
+	 * [jsun] we always bump up baselines a little, so that if there
+	 * nothing behind P2P bridge, we don't wind up overlapping IO/MEM
+	 * spaces.
+	 */
+	pciauto_lower_memspc += 1;
+	pciauto_lower_iospc += 1;
+#endif
+
+	/*
+	 * Configure subordinate bus number.  The PCI subsystem
+	 * bus scan will renumber buses (reserving three additional
+	 * for this PCI<->CardBus bridge for the case where a CardBus
+	 * adapter contains a P2P or CB2CB bridge.
+	 */
+
+	early_write_config_byte(hose, top_bus, current_bus, pci_devfn,
+				PCI_SUBORDINATE_BUS, sub_bus);
+
+	/*
+	 * Reserve an additional 4MB for mem space and 16KB for
+	 * I/O space.  This should cover any additional space
+	 * requirement of unusual CardBus devices with
+	 * additional bridges that can consume more address space.
+	 *
+	 * Although pcmcia-cs currently will reprogram bridge
+	 * windows, the goal is to add an option to leave them
+	 * alone and use the bridge window ranges as the regions
+	 * that are searched for free resources upon hot-insertion
+	 * of a device.  This will allow a PCI<->CardBus bridge
+	 * configured by this routine to happily live behind a
+	 * P2P bridge in a system.
+	 */
+#if defined(CONFIG_SH_HS7751RVOIP) || defined(CONFIG_SH_RTS7751R2D)
+	pciauto_lower_memspc += 0x00400000;
+	pciauto_lower_iospc += 0x00004000;
+#endif
+
+	/* Align memory and I/O to 4KB and 4 byte boundaries. */
+	pciauto_lower_memspc = (pciauto_lower_memspc + (0x1000 - 1))
+		& ~(0x1000 - 1);
+	pciauto_lower_iospc = (pciauto_lower_iospc + (0x4 - 1))
+		& ~(0x4 - 1);
+	/* Set up memory and I/O filter limits, assume 32-bit I/O space */
+	early_write_config_dword(hose, top_bus, current_bus, pci_devfn,
+		PCI_CB_MEMORY_LIMIT_0, pciauto_lower_memspc - 1);
+	early_write_config_dword(hose, top_bus, current_bus, pci_devfn,
+		PCI_CB_IO_LIMIT_0, pciauto_lower_iospc - 1);
+
+	/* Enable memory and I/O accesses, enable bus master */
+	early_read_config_dword(hose, top_bus, current_bus, pci_devfn,
+		PCI_COMMAND, &temp);
+	early_write_config_dword(hose, top_bus, current_bus, pci_devfn,
+		PCI_COMMAND, temp | PCI_COMMAND_IO | PCI_COMMAND_MEMORY |
+		PCI_COMMAND_MASTER);
 }
 
-#define      PCIAUTO_IDE_MODE_MASK           0x05
+#define	PCIAUTO_IDE_MODE_MASK		0x05
 
 static int __init
 pciauto_bus_scan(struct pci_channel *hose, int top_bus, int current_bus)
@@ -455,6 +471,9 @@ pciauto_bus_scan(struct pci_channel *hose, int top_bus, int current_bus)
 		if ((pci_class >> 16) == PCI_CLASS_BRIDGE_PCI) {
 			DBG("        Bridge: primary=%.2x, secondary=%.2x\n",
 				current_bus, sub_bus + 1);
+#if defined(CONFIG_SH_HS7751RVOIP) || defined(CONFIG_SH_RTS7751R2D)
+			pciauto_setup_bars(hose, top_bus, current_bus, pci_devfn, PCI_BASE_ADDRESS_1);
+#endif
 			pciauto_prescan_setup_bridge(hose, top_bus, current_bus,
 						     pci_devfn, sub_bus);
 			DBG("Scanning sub bus %.2x, I/O 0x%.8x, Mem 0x%.8x\n",
@@ -463,26 +482,26 @@ pciauto_bus_scan(struct pci_channel *hose, int top_bus, int current_bus)
 			sub_bus = pciauto_bus_scan(hose, top_bus, sub_bus+1);
 			DBG("Back to bus %.2x\n", current_bus);
 			pciauto_postscan_setup_bridge(hose, top_bus, current_bus,
-						      pci_devfn, sub_bus);
+							pci_devfn, sub_bus);
 			continue;
-                } else if ((pci_class >> 16) == PCI_CLASS_BRIDGE_CARDBUS) {
-                        DBG("  CARDBUS  Bridge: primary=%.2x, secondary=%.2x\n",
-                                current_bus, sub_bus + 1);
-                        DBG("PCI Autoconfig: Found CardBus bridge, device %d function %d\n", PCI_SLOT(pci_devfn), PCI_FUNC(pci_devfn));
-                        /* Place CardBus Socket/ExCA registers */
-                        pciauto_setup_bars(hose, top_bus, current_bus, pci_devfn);
+		} else if ((pci_class >> 16) == PCI_CLASS_BRIDGE_CARDBUS) {
+			DBG("  CARDBUS  Bridge: primary=%.2x, secondary=%.2x\n",
+				current_bus, sub_bus + 1);
+			DBG("PCI Autoconfig: Found CardBus bridge, device %d function %d\n", PCI_SLOT(pci_devfn), PCI_FUNC(pci_devfn));
+			/* Place CardBus Socket/ExCA registers */
+			pciauto_setup_bars(hose, top_bus, current_bus, pci_devfn, PCI_BASE_ADDRESS_0);
  
-                        pciauto_prescan_setup_cardbus_bridge(hose, top_bus, 
-                                        current_bus, pci_devfn, sub_bus);
+			pciauto_prescan_setup_cardbus_bridge(hose, top_bus,
+					current_bus, pci_devfn, sub_bus);
  
-                        DBG("Scanning sub bus %.2x, I/O 0x%.8x, Mem 0x%.8x\n",
-                                sub_bus + 1,
-                                pciauto_lower_iospc, pciauto_lower_memspc);
-                        sub_bus = pciauto_bus_scan(hose, top_bus, sub_bus+1);
-                        DBG("Back to bus %.2x, sub_bus is %x\n", current_bus, sub_bus);
-                        pciauto_postscan_setup_cardbus_bridge(hose, top_bus, 
-                                        current_bus, pci_devfn, sub_bus);
-                        continue;
+			DBG("Scanning sub bus %.2x, I/O 0x%.8x, Mem 0x%.8x\n",
+				sub_bus + 1,
+				pciauto_lower_iospc, pciauto_lower_memspc);
+			sub_bus = pciauto_bus_scan(hose, top_bus, sub_bus+1);
+			DBG("Back to bus %.2x, sub_bus is %x\n", current_bus, sub_bus);
+			pciauto_postscan_setup_cardbus_bridge(hose, top_bus,
+					current_bus, pci_devfn, sub_bus);
+			continue;
 		} else if ((pci_class >> 16) == PCI_CLASS_STORAGE_IDE) {
 
 			unsigned char prg_iface;
@@ -495,7 +514,7 @@ pciauto_bus_scan(struct pci_channel *hose, int top_bus, int current_bus)
 			}
 		}
 
- 		/*
+		/*
 		 * Found a peripheral, enable some standard
 		 * settings
 		 */
@@ -509,7 +528,7 @@ pciauto_bus_scan(struct pci_channel *hose, int top_bus, int current_bus)
 					PCI_LATENCY_TIMER, 0x80);
 
 		/* Allocate PCI I/O and/or memory space */
-		pciauto_setup_bars(hose, top_bus, current_bus, pci_devfn);
+		pciauto_setup_bars(hose, top_bus, current_bus, pci_devfn, PCI_BASE_ADDRESS_5);
 	}
 	return sub_bus;
 }
diff --git a/arch/sh/drivers/pci/pci-sh7751.c b/arch/sh/drivers/pci/pci-sh7751.c
index e53823e65..b2bb72972 100644
--- a/arch/sh/drivers/pci/pci-sh7751.c
+++ b/arch/sh/drivers/pci/pci-sh7751.c
@@ -31,6 +31,7 @@
 #include "pci-sh7751.h"
 
 static unsigned int pci_probe = PCI_PROBE_CONF1;
+extern int pci_fixup_pcic(void);
 
 /*
  * Direct access to PCI hardware...
@@ -74,7 +75,8 @@ static int sh7751_pci_read(struct pci_bus *bus, unsigned int devfn,
 }
 
 /* 
- * Since SH7751 only does 32bit access we'll have to do a read,mask,write operation.  
+ * Since SH7751 only does 32bit access we'll have to do a read,
+ * mask,write operation.
  * We'll allow an odd byte offset, though it should be illegal.
  */ 
 static int sh7751_pci_write(struct pci_bus *bus, unsigned int devfn,
@@ -156,6 +158,7 @@ static int __init pci_check_direct(void)
  *  Handle bus scanning and fixups ....
  */
 
+#if !defined(CONFIG_SH_HS7751RVOIP) && !defined(CONFIG_SH_RTS7751R2D)
 static void __init pci_fixup_ide_bases(struct pci_dev *d)
 {
 	int i;
@@ -174,11 +177,13 @@ static void __init pci_fixup_ide_bases(struct pci_dev *d)
 		}
 	}
 }
-
+#endif
 
 /* Add future fixups here... */
 struct pci_fixup pcibios_fixups[] = {
+#if !defined(CONFIG_SH_HS7751RVOIP) && !defined(CONFIG_SH_RTS7751R2D)
 	{ PCI_FIXUP_HEADER,	PCI_ANY_ID,	PCI_ANY_ID,	pci_fixup_ide_bases },
+#endif
 	{ 0 }
 };
 
@@ -261,19 +266,19 @@ int __init sh7751_pcic_init(struct sh7751_pci_address_map *map)
 	outl(word, PCI_REG(SH7751_PCICLKR));
 
 	/*
-	 * XXX: This code is unused for the SnapGear boards as it is done in
-	 * the bootloader and doing it here means the MAC addresses loaded by
-	 * the bootloader get lost.
+	 * This code is unused for some boards as it is done in the
+	 * bootloader and doing it here means the MAC addresses loaded
+	 * by the bootloader get lost.
 	 */
-#ifndef CONFIG_SH_SECUREEDGE5410
-	/* toggle PCI reset pin */
-	word = SH7751_PCICR_PREFIX | SH7751_PCICR_PRST;
-	outl(word,PCI_REG(SH7751_PCICR));    
-	/* Wait for a long time... not 1 sec. but long enough */
-	mdelay(100);
-	word = SH7751_PCICR_PREFIX;
-	outl(word,PCI_REG(SH7751_PCICR)); 
-#endif
+	if (!(map->flags & SH7751_PCIC_NO_RESET)) {
+		/* toggle PCI reset pin */
+		word = SH7751_PCICR_PREFIX | SH7751_PCICR_PRST;
+		outl(word,PCI_REG(SH7751_PCICR));
+		/* Wait for a long time... not 1 sec. but long enough */
+		mdelay(100);
+		word = SH7751_PCICR_PREFIX;
+		outl(word,PCI_REG(SH7751_PCICR));
+	}
 	
 	/* set the command/status bits to:
 	 * Wait Cycle Control + Parity Enable + Bus Master +
@@ -364,6 +369,10 @@ int __init sh7751_pcic_init(struct sh7751_pci_address_map *map)
 	 * DMA interrupts...
 	 */
 	 
+#ifdef CONFIG_SH_RTS7751R2D
+	pci_fixup_pcic();
+#endif
+
 	/* SH7751 init done, set central function init complete */
 	/* use round robin mode to stop a device starving/overruning */
 	word = SH7751_PCICR_PREFIX | SH7751_PCICR_CFIN | SH7751_PCICR_ARBM;
diff --git a/arch/sh/drivers/pci/pci-sh7751.h b/arch/sh/drivers/pci/pci-sh7751.h
index b8b1d421a..1fee5cae1 100644
--- a/arch/sh/drivers/pci/pci-sh7751.h
+++ b/arch/sh/drivers/pci/pci-sh7751.h
@@ -234,6 +234,7 @@
 #define SH7751_PCIWCR2             0x1EC         /* Wait Control 2 Register */
 #define SH7751_PCIWCR3             0x1F0         /* Wait Control 3 Register */
 #define SH7751_PCIMCR              0x1F4         /* Memory Control Register */
+#define SH7751_PCIBCR3		   0x1f8	 /* Memory BCR3 Register */
 #define SH7751_PCIPCTR             0x200         /* Port Control Register */
   #define SH7751_PCIPCTR_P2EN        0x000400000 /* Port 2 Enable */
   #define SH7751_PCIPCTR_P1EN        0x000200000 /* Port 1 Enable */
@@ -256,6 +257,8 @@
 /* Memory Control Registers */
 #define SH7751_BCR1                0xFF800000    /* Memory BCR1 Register */
 #define SH7751_BCR2                0xFF800004    /* Memory BCR2 Register */
+#define SH7751_BCR3                0xFF800050    /* Memory BCR3 Register */
+#define SH7751_BCR4                0xFE0A00F0    /* Memory BCR4 Register */
 #define SH7751_WCR1                0xFF800008    /* Wait Control 1 Register */
 #define SH7751_WCR2                0xFF80000C    /* Wait Control 2 Register */
 #define SH7751_WCR3                0xFF800010    /* Wait Control 3 Register */
@@ -274,6 +277,9 @@
 /* General PCI values */
 #define SH7751_PCI_HOST_BRIDGE		0x6
 
+/* Flags */
+#define SH7751_PCIC_NO_RESET	0x0001
+
 /* External functions defined per platform i.e. Big Sur, SE... (these could be routed 
  * through the machine vectors... */
 extern int pcibios_init_platform(void);
@@ -287,6 +293,7 @@ struct sh7751_pci_address_space {
 struct sh7751_pci_address_map {
 	struct sh7751_pci_address_space window0;
 	struct sh7751_pci_address_space window1;
+	unsigned long flags;
 };
 
 /* arch/sh/drivers/pci/pci-sh7751.c */
diff --git a/arch/sh/drivers/pci/pci.c b/arch/sh/drivers/pci/pci.c
index fce69a2ec..4bf35336d 100644
--- a/arch/sh/drivers/pci/pci.c
+++ b/arch/sh/drivers/pci/pci.c
@@ -25,7 +25,7 @@ static int __init pcibios_init(void)
 
 #ifdef CONFIG_PCI_AUTO
 	/* assign resources */
-	busno=0;
+	busno = 0;
 	for (p = board_pci_channels; p->pci_ops != NULL; p++) {
 		busno = pciauto_assign_resources(busno, p) + 1;
 	}
diff --git a/arch/sh/kernel/Makefile b/arch/sh/kernel/Makefile
index a7c247a30..d36bd9410 100644
--- a/arch/sh/kernel/Makefile
+++ b/arch/sh/kernel/Makefile
@@ -16,6 +16,7 @@ obj-$(CONFIG_SH_STANDARD_BIOS)	+= sh_bios.o
 obj-$(CONFIG_SH_KGDB)		+= kgdb_stub.o kgdb_jmp.o
 obj-$(CONFIG_SH_CPU_FREQ)	+= cpufreq.o
 obj-$(CONFIG_MODULES)		+= module.o
+obj-$(CONFIG_EARLY_PRINTK)	+= early_printk.o
 
 USE_STANDARD_AS_RULE := true
 
diff --git a/arch/sh/kernel/cpu/Makefile b/arch/sh/kernel/cpu/Makefile
index bf3a311c9..cd43714df 100644
--- a/arch/sh/kernel/cpu/Makefile
+++ b/arch/sh/kernel/cpu/Makefile
@@ -2,7 +2,7 @@
 # Makefile for the Linux/SuperH CPU-specifc backends.
 #
 
-obj-y	:= irq_ipr.o irq_imask.o init.o
+obj-y	:= irq_ipr.o irq_imask.o init.o bus.o
 
 obj-$(CONFIG_CPU_SH2)		+= sh2/
 obj-$(CONFIG_CPU_SH3)		+= sh3/
@@ -10,6 +10,7 @@ obj-$(CONFIG_CPU_SH4)		+= sh4/
 
 obj-$(CONFIG_SH_RTC)            += rtc.o
 obj-$(CONFIG_UBC_WAKEUP)	+= ubc.o
+obj-$(CONFIG_SH_ADC)            += adc.o
 
 USE_STANDARD_AS_RULE := true
 
diff --git a/arch/sh/kernel/cpu/init.c b/arch/sh/kernel/cpu/init.c
index a81b3401f..975103f34 100644
--- a/arch/sh/kernel/cpu/init.c
+++ b/arch/sh/kernel/cpu/init.c
@@ -42,7 +42,7 @@ onchip_setup(dsp);
  */
 static void __init cache_init(void)
 {
-	unsigned long ccr, flags = 0;
+	unsigned long ccr, flags;
 
 	if (cpu_data->type == CPU_SH_NONE)
 		panic("Unknown CPU");
@@ -54,42 +54,50 @@ static void __init cache_init(void)
 	 * If the cache is already enabled .. flush it.
 	 */
 	if (ccr & CCR_CACHE_ENABLE) {
-		unsigned long entries, i, j;
+		unsigned long ways, waysize, addrstart;
 
-		entries = cpu_data->dcache.sets;
+		waysize = cpu_data->dcache.sets;
 
 		/*
 		 * If the OC is already in RAM mode, we only have
 		 * half of the entries to flush..
 		 */
 		if (ccr & CCR_CACHE_ORA)
-			entries >>= 1;
+			waysize >>= 1;
 
-		for (i = 0; i < entries; i++) {
-			for (j = 0; j < cpu_data->dcache.ways; j++) {
-				unsigned long data, addr;
+		waysize <<= cpu_data->dcache.entry_shift;
 
-				addr = CACHE_OC_ADDRESS_ARRAY |
-					(j << cpu_data->dcache.way_shift) |
-					(i << cpu_data->dcache.entry_shift);
+#ifdef CCR_CACHE_EMODE
+		/* If EMODE is not set, we only have 1 way to flush. */
+		if (!(ccr & CCR_CACHE_EMODE))
+			ways = 1;
+		else
+#endif
+			ways = cpu_data->dcache.ways;
 
-				data = ctrl_inl(addr);
+		addrstart = CACHE_OC_ADDRESS_ARRAY;
+		do {
+			unsigned long addr;
 
-				if ((data & (SH_CACHE_UPDATED | SH_CACHE_VALID))
-					== (SH_CACHE_UPDATED | SH_CACHE_VALID))
-					ctrl_outl(data & ~SH_CACHE_UPDATED, addr);
-			}
-		}
+			for (addr = addrstart;
+			     addr < addrstart + waysize;
+			     addr += cpu_data->dcache.linesz)
+				ctrl_outl(0, addr);
+
+			addrstart += cpu_data->dcache.way_incr;
+		} while (--ways);
 	}
 
 	/* 
 	 * Default CCR values .. enable the caches
-	 * and flush them immediately..
+	 * and invalidate them immediately..
 	 */
-	flags |= CCR_CACHE_ENABLE | CCR_CACHE_INVALIDATE;
-	
+	flags = CCR_CACHE_ENABLE | CCR_CACHE_INVALIDATE;
+
 #ifdef CCR_CACHE_EMODE
-	flags |= (ccr & CCR_CACHE_EMODE);
+	/* Force EMODE if possible */
+	if (cpu_data->dcache.ways > 1)
+		flags |= CCR_CACHE_EMODE;
 #endif
 
 #ifdef CONFIG_SH_WRITETHROUGH
@@ -145,8 +153,8 @@ static void __init dsp_init(void)
 
 	/* If the DSP bit is still set, this CPU has a DSP */
 	if (sr & SR_DSP)
-		set_bit(CPU_HAS_DSP, &(cpu_data->flags));
-	
+		cpu_data->flags |= CPU_HAS_DSP;
+
 	/* Now that we've determined the DSP status, clear the DSP bit. */
 	release_dsp();
 }
@@ -184,7 +192,7 @@ asmlinkage void __init sh_cpu_init(void)
 	}
 
 	/* FPU initialization */
-	if (test_bit(CPU_HAS_FPU, &(cpu_data->flags))) {
+	if ((cpu_data->flags & CPU_HAS_FPU)) {
 		clear_thread_flag(TIF_USEDFPU);
 		current->used_math = 0;
 	}
diff --git a/arch/sh/kernel/cpu/irq_ipr.c b/arch/sh/kernel/cpu/irq_ipr.c
index c66d62279..daae02e6b 100644
--- a/arch/sh/kernel/cpu/irq_ipr.c
+++ b/arch/sh/kernel/cpu/irq_ipr.c
@@ -4,12 +4,13 @@
  *
  * Copyright (C) 1999  Niibe Yutaka & Takeshi Yaegashi
  * Copyright (C) 2000  Kazumoto Kojima
+ * Copyright (C) 2003 Takashi Kusuda <kusuda-takashi@hitachi-ul.co.jp>
  *
  * Interrupt handling for IPR-based IRQ.
  *
  * Supported system:
  *	On-chip supporting modules (TMU, RTC, etc.).
- *	On-chip supporting modules for SH7709/SH7709A/SH7729.
+ *	On-chip supporting modules for SH7709/SH7709A/SH7729/SH7300.
  *	Hitachi SolutionEngine external I/O:
  *		MS7709SE01, MS7709ASE01, and MS7750SE01
  *
@@ -88,7 +89,8 @@ static void mask_and_ack_ipr(unsigned int irq)
 {
 	disable_ipr_irq(irq);
 
-#if defined(CONFIG_CPU_SUBTYPE_SH7707) || defined(CONFIG_CPU_SUBTYPE_SH7709)
+#if defined(CONFIG_CPU_SUBTYPE_SH7707) || defined(CONFIG_CPU_SUBTYPE_SH7709) || \
+    defined(CONFIG_CPU_SUBTYPE_SH7300) || defined(CONFIG_CPU_SUBTYPE_SH7705)
 	/* This is needed when we use edge triggered setting */
 	/* XXX: Is it really needed? */
 	if (IRQ0_IRQ <= irq && irq <= IRQ5_IRQ) {
@@ -117,7 +119,9 @@ void make_ipr_irq(unsigned int irq, unsigned int addr, int pos, int priority)
 	disable_ipr_irq(irq);
 }
 
-#if defined(CONFIG_CPU_SUBTYPE_SH7707) || defined(CONFIG_CPU_SUBTYPE_SH7709)
+#if defined(CONFIG_CPU_SUBTYPE_SH7705) || \
+    defined(CONFIG_CPU_SUBTYPE_SH7707) || \
+    defined(CONFIG_CPU_SUBTYPE_SH7709)
 static unsigned char pint_map[256];
 static unsigned long portcr_mask = 0;
 
@@ -131,7 +135,7 @@ static void mask_and_ack_pint(unsigned int);
 static void end_pint_irq(unsigned int irq);
 
 static unsigned int startup_pint_irq(unsigned int irq)
-{ 
+{
 	enable_pint_irq(irq);
 	return 0; /* never anything pending */
 }
@@ -191,13 +195,17 @@ void make_pint_irq(unsigned int irq)
 
 void __init init_IRQ(void)
 {
-#if defined(CONFIG_CPU_SUBTYPE_SH7707) || defined(CONFIG_CPU_SUBTYPE_SH7709)
+#if defined(CONFIG_CPU_SUBTYPE_SH7705) || \
+    defined(CONFIG_CPU_SUBTYPE_SH7707) || \
+    defined(CONFIG_CPU_SUBTYPE_SH7709)
 	int i;
 #endif
 
 	make_ipr_irq(TIMER_IRQ, TIMER_IPR_ADDR, TIMER_IPR_POS, TIMER_PRIORITY);
 	make_ipr_irq(TIMER1_IRQ, TIMER1_IPR_ADDR, TIMER1_IPR_POS, TIMER1_PRIORITY);
+#if defined(CONFIG_SH_RTC)
 	make_ipr_irq(RTC_IRQ, RTC_IPR_ADDR, RTC_IPR_POS, RTC_PRIORITY);
+#endif
 
 #ifdef SCI_ERI_IRQ
 	make_ipr_irq(SCI_ERI_IRQ, SCI_IPR_ADDR, SCI_IPR_POS, SCI_PRIORITY);
@@ -212,6 +220,13 @@ void __init init_IRQ(void)
 	make_ipr_irq(SCIF1_TXI_IRQ, SCIF1_IPR_ADDR, SCIF1_IPR_POS, SCIF1_PRIORITY);
 #endif
 
+#if defined(CONFIG_CPU_SUBTYPE_SH7300)
+	make_ipr_irq(SCIF0_IRQ, SCIF0_IPR_ADDR, SCIF0_IPR_POS, SCIF0_PRIORITY);
+	make_ipr_irq(DMTE2_IRQ, DMA1_IPR_ADDR, DMA1_IPR_POS, DMA1_PRIORITY);
+	make_ipr_irq(DMTE3_IRQ, DMA1_IPR_ADDR, DMA1_IPR_POS, DMA1_PRIORITY);
+	make_ipr_irq(VIO_IRQ, VIO_IPR_ADDR, VIO_IPR_POS, VIO_PRIORITY);
+#endif
+
 #ifdef SCIF_ERI_IRQ
 	make_ipr_irq(SCIF_ERI_IRQ, SCIF_IPR_ADDR, SCIF_IPR_POS, SCIF_PRIORITY);
 	make_ipr_irq(SCIF_RXI_IRQ, SCIF_IPR_ADDR, SCIF_IPR_POS, SCIF_PRIORITY);
@@ -226,11 +241,12 @@ void __init init_IRQ(void)
 	make_ipr_irq(IRDA_TXI_IRQ, IRDA_IPR_ADDR, IRDA_IPR_POS, IRDA_PRIORITY);
 #endif
 
-#if defined(CONFIG_CPU_SUBTYPE_SH7707) || defined(CONFIG_CPU_SUBTYPE_SH7709)
+#if defined(CONFIG_CPU_SUBTYPE_SH7707) || defined(CONFIG_CPU_SUBTYPE_SH7709) || \
+    defined(CONFIG_CPU_SUBTYPE_SH7300) || defined(CONFIG_CPU_SUBTYPE_SH7705)
 	/*
 	 * Initialize the Interrupt Controller (INTC)
 	 * registers to their power on values
-	 */ 
+	 */
 
 	/*
 	 * Enable external irq (INTC IRQ mode).
@@ -243,6 +259,7 @@ void __init init_IRQ(void)
 	make_ipr_irq(IRQ3_IRQ, IRQ3_IPR_ADDR, IRQ3_IPR_POS, IRQ3_PRIORITY);
 	make_ipr_irq(IRQ4_IRQ, IRQ4_IPR_ADDR, IRQ4_IPR_POS, IRQ4_PRIORITY);
 	make_ipr_irq(IRQ5_IRQ, IRQ5_IPR_ADDR, IRQ5_IPR_POS, IRQ5_PRIORITY);
+#if !defined(CONFIG_CPU_SUBTYPE_SH7300)
 	make_ipr_irq(PINT0_IRQ, PINT0_IPR_ADDR, PINT0_IPR_POS, PINT0_PRIORITY);
 	make_ipr_irq(PINT8_IRQ, PINT8_IPR_ADDR, PINT8_IPR_POS, PINT8_PRIORITY);
 	enable_ipr_irq(PINT0_IRQ);
@@ -261,16 +278,19 @@ void __init init_IRQ(void)
 		else if(i & 0x40) pint_map[i] = 6;
 		else if(i & 0x80) pint_map[i] = 7;
 	}
-#endif /* CONFIG_CPU_SUBTYPE_SH7707 || CONFIG_CPU_SUBTYPE_SH7709 */
+#endif /* !CONFIG_CPU_SUBTYPE_SH7300 */
+#endif /* CONFIG_CPU_SUBTYPE_SH7707 || CONFIG_CPU_SUBTYPE_SH7709  || CONFIG_CPU_SUBTYPE_SH7300*/
 
 	/* Perform the machine specific initialisation */
 	if (sh_mv.mv_init_irq != NULL) {
 		sh_mv.mv_init_irq();
 	}
 }
-#if defined(CONFIG_CPU_SUBTYPE_SH7707) || defined(CONFIG_CPU_SUBTYPE_SH7709)
+#if defined(CONFIG_CPU_SUBTYPE_SH7707) || defined(CONFIG_CPU_SUBTYPE_SH7709) || \
+    defined(CONFIG_CPU_SUBTYPE_SH7300) || defined(CONFIG_CPU_SUBTYPE_SH7705)
 int ipr_irq_demux(int irq)
 {
+#if !defined(CONFIG_CPU_SUBTYPE_SH7300)
 	unsigned long creg, dreg, d, sav;
 
 	if(irq == PINT0_IRQ)
@@ -305,6 +325,7 @@ int ipr_irq_demux(int irq)
 		if(d == 0) return irq;
 		return PINT_IRQ_BASE + 8 + pint_map[d];
 	}
+#endif
 	return irq;
 }
 #endif
diff --git a/arch/sh/kernel/cpu/sh3/ex.S b/arch/sh/kernel/cpu/sh3/ex.S
index 78df0d1bf..966c0858b 100644
--- a/arch/sh/kernel/cpu/sh3/ex.S
+++ b/arch/sh/kernel/cpu/sh3/ex.S
@@ -85,7 +85,8 @@ ENTRY(interrupt_table)
 	.long	do_IRQ	!      rovi
 	.long	do_IRQ			
 	.long	do_IRQ			/* 5E0 */
-#if  defined(CONFIG_CPU_SUBTYPE_SH7707) || defined(CONFIG_CPU_SUBTYPE_SH7709)
+#if  defined(CONFIG_CPU_SUBTYPE_SH7707) || defined(CONFIG_CPU_SUBTYPE_SH7709) || \
+     defined(CONFIG_CPU_SUBTYPE_SH7300) || defined(CONFIG_CPU_SUBTYPE_SH7705)
 	.long	do_IRQ	! 32 IRQ  irq0	/* 600 */
 	.long	do_IRQ	! 33      irq1
 	.long	do_IRQ	! 34      irq2
@@ -115,10 +116,84 @@ ENTRY(interrupt_table)
 	.long	do_IRQ	! 58      bri2
 	.long	do_IRQ	! 59      txi2
 	.long	do_IRQ	! 60 ADC  adi	/* 980 */
-#if defined(CONFIG_CPU_SUBTYPE_SH7707)
+#if defined(CONFIG_CPU_SUBTYPE_SH7705)
+	.long	exception_none	! 61	/* 9A0 */
+	.long	exception_none	! 62
+	.long	exception_none	! 63
+	.long	exception_none	! 64	/* A00 */
+	.long	do_IRQ	! 65 USB  usi0
+	.long	do_IRQ	! 66      usi1
+	.long	exception_none	! 67
+	.long	exception_none	! 68
+	.long	exception_none	! 69
+	.long	exception_none	! 70
+	.long	exception_none	! 71
+	.long	exception_none	! 72	/* B00 */
+	.long	exception_none	! 73
+	.long	exception_none	! 74
+	.long	exception_none	! 75
+	.long	exception_none	! 76
+	.long	exception_none	! 77
+	.long	exception_none	! 78
+	.long	exception_none	! 79
+	.long	do_IRQ	! 80 TPU0 tpi0	/* C00 */
+	.long	do_IRQ	! 81 TPU1 tpi1
+	.long	exception_none	! 82
+	.long	exception_none	! 83
+	.long	do_IRQ	! 84 TPU2 tpi2
+	.long	do_IRQ	! 85 TPU3 tpi3	/* CA0 */
+#endif
+#if defined(CONFIG_CPU_SUBTYPE_SH7707) || defined(CONFIG_CPU_SUBTYPE_SH7300)
 	.long   do_IRQ	! 61 LCDC lcdi	/* 9A0 */
 	.long   do_IRQ	! 62 PCC  pcc0i
 	.long   do_IRQ	! 63      pcc1i	/* 9E0 */
 #endif
+#if defined(CONFIG_CPU_SUBTYPE_SH7300)
+	.long   do_IRQ	! 64
+	.long   do_IRQ	! 65
+	.long   do_IRQ	! 66
+	.long   do_IRQ	! 67
+	.long   do_IRQ	! 68
+	.long   do_IRQ	! 69
+	.long   do_IRQ	! 70
+	.long   do_IRQ	! 71
+	.long   do_IRQ	! 72
+	.long   do_IRQ	! 73
+	.long   do_IRQ	! 74
+	.long   do_IRQ	! 75
+	.long   do_IRQ	! 76
+	.long   do_IRQ	! 77
+	.long   do_IRQ	! 78
+	.long   do_IRQ	! 79
+	.long   do_IRQ	! 80 SCIF0(SH7300)
+	.long   do_IRQ	! 81
+	.long   do_IRQ	! 82
+	.long   do_IRQ	! 83
+	.long   do_IRQ	! 84
+	.long   do_IRQ	! 85
+	.long   do_IRQ	! 86
+	.long   do_IRQ	! 87
+	.long   do_IRQ	! 88
+	.long   do_IRQ	! 89
+	.long   do_IRQ	! 90
+	.long   do_IRQ	! 91
+	.long   do_IRQ	! 92
+	.long   do_IRQ	! 93
+	.long   do_IRQ	! 94
+	.long   do_IRQ	! 95
+	.long   do_IRQ	! 96
+	.long   do_IRQ	! 97
+	.long   do_IRQ	! 98
+	.long   do_IRQ	! 99
+	.long   do_IRQ	! 100
+	.long   do_IRQ	! 101
+	.long   do_IRQ	! 102
+	.long   do_IRQ	! 103
+	.long   do_IRQ	! 104
+	.long   do_IRQ	! 105
+	.long   do_IRQ	! 106
+	.long   do_IRQ	! 107
+	.long   do_IRQ	! 108
+#endif
 #endif
 
diff --git a/arch/sh/kernel/cpu/sh4/sq.c b/arch/sh/kernel/cpu/sh4/sq.c
index 7a0eb521e..3dfe1741d 100644
--- a/arch/sh/kernel/cpu/sh4/sq.c
+++ b/arch/sh/kernel/cpu/sh4/sq.c
@@ -34,8 +34,6 @@
 static LIST_HEAD(sq_mapping_list);
 static spinlock_t sq_mapping_lock = SPIN_LOCK_UNLOCKED;
 
-extern struct vm_struct *__get_vm_area(unsigned long size, unsigned long flags, unsigned long start, unsigned long end);
-
 /**
  * sq_flush - Flush (prefetch) the store queue cache
  *
diff --git a/arch/sh/kernel/entry.S b/arch/sh/kernel/entry.S
index dbc33d726..05dcc2e01 100644
--- a/arch/sh/kernel/entry.S
+++ b/arch/sh/kernel/entry.S
@@ -1,4 +1,4 @@
-/* $Id: entry.S,v 1.35 2004/02/21 14:45:47 lethal Exp $
+/* $Id: entry.S,v 1.37 2004/06/11 13:02:46 doyu Exp $
  *
  *  linux/arch/sh/entry.S
  *
@@ -77,7 +77,8 @@ EINVAL = 22
 #if defined(CONFIG_CPU_SH3)
 TRA     = 0xffffffd0
 EXPEVT  = 0xffffffd4
-#if defined(CONFIG_CPU_SUBTYPE_SH7707) || defined(CONFIG_CPU_SUBTYPE_SH7709)
+#if defined(CONFIG_CPU_SUBTYPE_SH7707) || defined(CONFIG_CPU_SUBTYPE_SH7709) || \
+    defined(CONFIG_CPU_SUBTYPE_SH7300) || defined(CONFIG_CPU_SUBTYPE_SH7705)
 INTEVT  = 0xa4000000		! INTEVTE2(0xa4000000)
 #else
 INTEVT  = 0xffffffd8
@@ -1129,6 +1130,14 @@ ENTRY(sys_call_table)
 	.long sys_utimes
  	.long sys_fadvise64_64_wrapper
 	.long sys_ni_syscall	/* Reserved for vserver */
-	.long sys_ni_syscall
+	.long sys_ni_syscall	/* Reserved for mbind */
+	.long sys_ni_syscall	/* 275 - get_mempolicy */
+	.long sys_ni_syscall	/* set_mempolicy */
+	.long sys_mq_open
+	.long sys_mq_unlink
+	.long sys_mq_timedsend
+	.long sys_mq_timedreceive       /* 280 */
+	.long sys_mq_notify
+	.long sys_mq_getsetattr
 
 /* End of entry.S */
diff --git a/arch/sh/kernel/init_task.c b/arch/sh/kernel/init_task.c
index 469a988d4..44053ea92 100644
--- a/arch/sh/kernel/init_task.c
+++ b/arch/sh/kernel/init_task.c
@@ -2,6 +2,7 @@
 #include <linux/module.h>
 #include <linux/sched.h>
 #include <linux/init_task.h>
+#include <linux/mqueue.h>
 
 #include <asm/uaccess.h>
 #include <asm/pgtable.h>
diff --git a/arch/sh/kernel/io_generic.c b/arch/sh/kernel/io_generic.c
index e920a5954..a911b0149 100644
--- a/arch/sh/kernel/io_generic.c
+++ b/arch/sh/kernel/io_generic.c
@@ -1,4 +1,4 @@
-/* $Id: io_generic.c,v 1.1.1.1.4.2.2.1 2003/01/10 17:26:56 lethal Exp $
+/* $Id: io_generic.c,v 1.2 2003/05/04 19:29:53 lethal Exp $
  *
  * linux/arch/sh/kernel/io_generic.c
  *
@@ -71,16 +71,32 @@ unsigned int generic_inl_p(unsigned long port)
 	return v;
 }
 
+/*
+ * insb/w/l all read a series of bytes/words/longs from a fixed port
+ * address. However as the port address doesn't change we only need to
+ * convert the port address to real address once.
+ */
+
 void generic_insb(unsigned long port, void *buffer, unsigned long count)
 {
+	volatile unsigned char *port_addr;
 	unsigned char *buf=buffer;
-	while(count--) *buf++=inb(port);
+
+	port_addr = (volatile unsigned char *)PORT2ADDR(port);
+
+	while(count--)
+	    *buf++ = *port_addr;
 }
 
 void generic_insw(unsigned long port, void *buffer, unsigned long count)
 {
+	volatile unsigned short *port_addr;
 	unsigned short *buf=buffer;
-	while(count--) *buf++=inw(port);
+
+	port_addr = (volatile unsigned short *)PORT2ADDR(port);
+
+	while(count--)
+	    *buf++ = *port_addr;
 #ifdef SH3_PCMCIA_BUG_WORKAROUND
 	ctrl_inb (DUMMY_READ_AREA6);
 #endif
@@ -88,8 +104,13 @@ void generic_insw(unsigned long port, void *buffer, unsigned long count)
 
 void generic_insl(unsigned long port, void *buffer, unsigned long count)
 {
+	volatile unsigned long *port_addr;
 	unsigned long *buf=buffer;
-	while(count--) *buf++=inl(port);
+
+	port_addr = (volatile unsigned long *)PORT2ADDR(port);
+
+	while(count--)
+	    *buf++ = *port_addr;
 #ifdef SH3_PCMCIA_BUG_WORKAROUND
 	ctrl_inb (DUMMY_READ_AREA6);
 #endif
@@ -128,16 +149,33 @@ void generic_outl_p(unsigned int b, unsigned long port)
 	delay();
 }
 
+/*
+ * outsb/w/l all write a series of bytes/words/longs to a fixed port
+ * address. However as the port address doesn't change we only need to
+ * convert the port address to real address once.
+ */
+
 void generic_outsb(unsigned long port, const void *buffer, unsigned long count)
 {
+	volatile unsigned char *port_addr;
 	const unsigned char *buf=buffer;
-	while(count--) outb(*buf++, port);
+
+	port_addr = (volatile unsigned char *)PORT2ADDR(port);
+
+	while(count--)
+	    *port_addr = *buf++;
 }
 
 void generic_outsw(unsigned long port, const void *buffer, unsigned long count)
 {
+	volatile unsigned short *port_addr;
 	const unsigned short *buf=buffer;
-	while(count--) outw(*buf++, port);
+
+	port_addr = (volatile unsigned short *)PORT2ADDR(port);
+
+	while(count--)
+	    *port_addr = *buf++;
+
 #ifdef SH3_PCMCIA_BUG_WORKAROUND
 	ctrl_inb (DUMMY_READ_AREA6);
 #endif
@@ -145,8 +183,14 @@ void generic_outsw(unsigned long port, const void *buffer, unsigned long count)
 
 void generic_outsl(unsigned long port, const void *buffer, unsigned long count)
 {
+	volatile unsigned long *port_addr;
 	const unsigned long *buf=buffer;
-	while(count--) outl(*buf++, port);
+
+	port_addr = (volatile unsigned long *)PORT2ADDR(port);
+
+	while(count--)
+	    *port_addr = *buf++;
+
 #ifdef SH3_PCMCIA_BUG_WORKAROUND
 	ctrl_inb (DUMMY_READ_AREA6);
 #endif
diff --git a/arch/sh/kernel/irq.c b/arch/sh/kernel/irq.c
index a37e2d1cf..d78503dd2 100644
--- a/arch/sh/kernel/irq.c
+++ b/arch/sh/kernel/irq.c
@@ -436,7 +436,7 @@ int request_irq(unsigned int irq,
 
 	action->handler = handler;
 	action->flags = irqflags;
-	action->mask = 0;
+	cpus_clear(action->mask);
 	action->name = devname;
 	action->next = NULL;
 	action->dev_id = dev_id;
@@ -575,6 +575,49 @@ unsigned long probe_irq_on(void)
 
 EXPORT_SYMBOL(probe_irq_on);
 
+/* Return a mask of triggered interrupts (this
+ * can handle only legacy ISA interrupts).
+ */
+
+/*
+ *	probe_irq_mask - scan a bitmap of interrupt lines
+ *	@val:	mask of interrupts to consider
+ *
+ *	Scan the ISA bus interrupt lines and return a bitmap of
+ *	active interrupts. The interrupt probe logic state is then
+ *	returned to its previous value.
+ *
+ *	Note: we need to scan all the irq's even though we will
+ *	only return ISA irq numbers - just so that we reset them
+ *	all to a known state.
+ */
+unsigned int probe_irq_mask(unsigned long val)
+{
+	int i;
+	unsigned int mask;
+
+	mask = 0;
+	for (i = 0; i < NR_IRQS; i++) {
+		irq_desc_t *desc = irq_desc + i;
+		unsigned int status;
+
+		spin_lock_irq(&desc->lock);
+		status = desc->status;
+
+		if (status & IRQ_AUTODETECT) {
+			if (i < 16 && !(status & IRQ_WAITING))
+				mask |= 1 << i;
+
+			desc->status = status & ~IRQ_AUTODETECT;
+			desc->handler->shutdown(i);
+		}
+		spin_unlock_irq(&desc->lock);
+	}
+	up(&probe_sem);
+
+	return mask & val;
+}
+
 int probe_irq_off(unsigned long val)
 {
 	int i, irq_found, nr_irqs;
diff --git a/arch/sh/kernel/process.c b/arch/sh/kernel/process.c
index 6b4cb096b..8ba6dd300 100644
--- a/arch/sh/kernel/process.c
+++ b/arch/sh/kernel/process.c
@@ -1,4 +1,4 @@
-/* $Id: process.c,v 1.26 2004/02/06 14:14:14 kkojima Exp $
+/* $Id: process.c,v 1.28 2004/05/05 16:54:23 lethal Exp $
  *
  *  linux/arch/sh/kernel/process.c
  *
@@ -25,6 +25,11 @@
 #include <asm/uaccess.h>
 #include <asm/mmu_context.h>
 #include <asm/elf.h>
+#if defined(CONFIG_SH_HS7751RVOIP)
+#include <asm/hs7751rvoip/hs7751rvoip.h>
+#elif defined(CONFIG_SH_RTS7751R2D)
+#include <asm/rts7751r2d/rts7751r2d.h>
+#endif
 
 static int hlt_counter=0;
 
@@ -50,8 +55,14 @@ void default_idle(void)
 {
 	/* endless idle loop with no priority at all */
 	while (1) {
-		while (!need_resched())
-			cpu_relax();
+		if (hlt_counter) {
+			while (1)
+				if (need_resched())
+					break;
+		} else {
+			while (!need_resched())
+				cpu_sleep();
+		}
 
 		schedule();
 	}
@@ -73,14 +84,30 @@ EXPORT_SYMBOL(machine_restart);
 
 void machine_halt(void)
 {
+#if defined(CONFIG_SH_HS7751RVOIP)
+	unsigned short value;
+
+	value = ctrl_inw(PA_OUTPORTR);
+	ctrl_outw((value & 0xffdf), PA_OUTPORTR);
+#elif defined(CONFIG_SH_RTS7751R2D)
+	ctrl_outw(0x0001, PA_POWOFF);
+#endif
 	while (1)
-		cpu_relax();
+		cpu_sleep();
 }
 
 EXPORT_SYMBOL(machine_halt);
 
 void machine_power_off(void)
 {
+#if defined(CONFIG_SH_HS7751RVOIP)
+	unsigned short value;
+
+	value = ctrl_inw(PA_OUTPORTR);
+	ctrl_outw((value & 0xffdf), PA_OUTPORTR);
+#elif defined(CONFIG_SH_RTS7751R2D)
+	ctrl_outw(0x0001, PA_POWOFF);
+#endif
 }
 
 EXPORT_SYMBOL(machine_power_off);
diff --git a/arch/sh/kernel/ptrace.c b/arch/sh/kernel/ptrace.c
index 732afaeaf..bfdfa7489 100644
--- a/arch/sh/kernel/ptrace.c
+++ b/arch/sh/kernel/ptrace.c
@@ -1,4 +1,4 @@
-/* $Id: ptrace.c,v 1.14 2003/11/28 23:05:43 kkojima Exp $
+/* $Id: ptrace.c,v 1.15 2004/05/07 05:32:05 sugioka Exp $
  *
  * linux/arch/sh/kernel/ptrace.c
  *
@@ -257,13 +257,6 @@ asmlinkage int sys_ptrace(long request, long pid, long addr, long data)
 		ret = ptrace_detach(child, data);
 		break;
 
-	case PTRACE_SETOPTIONS:
-		if (data & PTRACE_O_TRACESYSGOOD)
-			child->ptrace |= PT_TRACESYSGOOD;
-		else
-			child->ptrace &= ~PT_TRACESYSGOOD;
-		ret = 0;
-		break;
 #ifdef CONFIG_SH_DSP
 	case PTRACE_GETDSPREGS: {
 		unsigned long dp;
diff --git a/arch/sh/kernel/setup.c b/arch/sh/kernel/setup.c
index 574ac24f8..ca2105907 100644
--- a/arch/sh/kernel/setup.c
+++ b/arch/sh/kernel/setup.c
@@ -25,15 +25,13 @@
 #include <asm/io_generic.h>
 #include <asm/sections.h>
 #include <asm/irq.h>
-#ifdef CONFIG_SH_EARLY_PRINTK
-#include <asm/sh_bios.h>
-#endif
+#include <asm/setup.h>
 
 #ifdef CONFIG_SH_KGDB
 #include <asm/kgdb.h>
 static int kgdb_parse_options(char *options);
 #endif
-
+extern void * __rd_start, * __rd_end;
 /*
  * Machine setup..
  */
@@ -85,14 +83,12 @@ static struct sh_machine_vector* __init get_mv_byname(const char* name);
 #define INITRD_SIZE (*(unsigned long *) (PARAM+0x014))
 /* ... */
 #define COMMAND_LINE ((char *) (PARAM+0x100))
-#define COMMAND_LINE_SIZE 256
 
 #define RAMDISK_IMAGE_START_MASK  	0x07FF
 #define RAMDISK_PROMPT_FLAG		0x8000
 #define RAMDISK_LOAD_FLAG		0x4000	
 
 static char command_line[COMMAND_LINE_SIZE] = { 0, };
-       char saved_command_line[COMMAND_LINE_SIZE];
 
 struct resource standard_io_resources[] = {
 	{ "dma1", 0x00, 0x1f },
@@ -120,130 +116,6 @@ static struct resource ram_resources[] = {
 
 unsigned long memory_start, memory_end;
 
-/* XXX: MRB-remove - blatant hack */
-#if 1
-#define SCIF_REG	0xffe80000
-
-static void scif_sercon_putc(int c)
-{
-	while (!(ctrl_inw(SCIF_REG + 0x10) & 0x20)) ;
-
-	ctrl_outb(c, SCIF_REG + 12);
-	ctrl_outw((ctrl_inw(SCIF_REG + 0x10) & 0x9f), SCIF_REG + 0x10);
-
-	if (c == '\n')
-		scif_sercon_putc('\r');
-}
-
-static void scif_sercon_flush(void)
-{
-	ctrl_outw((ctrl_inw(SCIF_REG + 0x10) & 0xbf), SCIF_REG + 0x10);
-
-	while (!(ctrl_inw(SCIF_REG + 0x10) & 0x40)) ;
-
-	ctrl_outw((ctrl_inw(SCIF_REG + 0x10) & 0xbf), SCIF_REG + 0x10);
-}
-
-static void scif_sercon_write(struct console *con, const char *s, unsigned count)
-{
-	while (count-- > 0)
-		scif_sercon_putc(*s++);
-
-	scif_sercon_flush();
-}
-
-static int __init scif_sercon_setup(struct console *con, char *options)
-{
-	con->cflag = CREAD | HUPCL | CLOCAL | B57600 | CS8;
-
-	return 0;
-}
-
-static struct console scif_sercon = {
-	.name		= "sercon",
-	.write		= scif_sercon_write,
-	.setup		= scif_sercon_setup,
-	.flags		= CON_PRINTBUFFER,
-	.index		= -1,
-};
-
-void scif_sercon_init(int baud)
-{
-	ctrl_outw(0, SCIF_REG + 8);
-	ctrl_outw(0, SCIF_REG);
-
-	/* Set baud rate */
-	ctrl_outb((50000000 / (32 * baud)) - 1, SCIF_REG + 4);
-
-	ctrl_outw(12, SCIF_REG + 24);
-	ctrl_outw(8, SCIF_REG + 24);
-	ctrl_outw(0, SCIF_REG + 32);
-	ctrl_outw(0x60, SCIF_REG + 16);
-	ctrl_outw(0, SCIF_REG + 36);
-	ctrl_outw(0x30, SCIF_REG + 8);
-
-	register_console(&scif_sercon);
-}
-
-void scif_sercon_unregister(void)
-{
-	unregister_console(&scif_sercon);
-}
-#endif
-
-#ifdef CONFIG_SH_EARLY_PRINTK
-/*
- *	Print a string through the BIOS
- */
-static void sh_console_write(struct console *co, const char *s,
-				 unsigned count)
-{
-    	sh_bios_console_write(s, count);
-}
-
-/*
- *	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 sh_console_setup(struct console *co, char *options)
-{
-	int	cflag = CREAD | HUPCL | CLOCAL;
-
-	/*
-	 *	Now construct a cflag setting.
-	 *  	TODO: this is a totally bogus cflag, as we have
-	 *  	no idea what serial settings the BIOS is using, or
-	 *  	even if its using the serial port at all.
-	 */
-    	cflag |= B115200 | CS8 | /*no parity*/0;
-
-	co->cflag = cflag;
-
-	return 0;
-}
-
-static struct console sh_console = {
-	.name		= "bios",
-	.write		= sh_console_write,
-	.setup		= sh_console_setup,
-	.flags		= CON_PRINTBUFFER,
-	.index		= -1,
-};
-
-void sh_console_init(void)
-{
-	register_console(&sh_console);
-}
-
-void sh_console_unregister(void)
-{
-	unregister_console(&sh_console);
-}
-
-#endif
-
 static inline void parse_cmdline (char ** cmdline_p, char mv_name[MV_NAME_SIZE],
 				  struct sh_machine_vector** mvp,
 				  unsigned long *mv_io_base,
@@ -325,10 +197,6 @@ static int __init sh_mv_setup(char **cmdline_p)
 
 	parse_cmdline(cmdline_p, mv_name, &mv, &mv_io_base, &mv_mmio_enable);
 
-#ifdef CONFIG_CMDLINE_BOOL
-        sprintf(*cmdline_p, CONFIG_CMDLINE);
-#endif
-
 #ifdef CONFIG_SH_GENERIC
 	if (mv == NULL) {
 		mv = &mv_unknown;
@@ -382,14 +250,15 @@ void __init setup_arch(char **cmdline_p)
 	unsigned long bootmap_size;
 	unsigned long start_pfn, max_pfn, max_low_pfn;
 
-/* XXX: MRB-remove */
-#if 0
-	scif_sercon_init(57600);
+#ifdef CONFIG_EARLY_PRINTK
+	extern void enable_early_printk(void);
+
+	enable_early_printk();
 #endif
-#ifdef CONFIG_SH_EARLY_PRINTK
-	sh_console_init();
+#ifdef CONFIG_CMDLINE_BOOL
+        strcpy(COMMAND_LINE, CONFIG_CMDLINE);
 #endif
-	
+
 	ROOT_DEV = old_decode_dev(ORIG_ROOT_DEV);
 
 #ifdef CONFIG_BLK_DEV_RAM
@@ -492,6 +361,13 @@ void __init setup_arch(char **cmdline_p)
 	reserve_bootmem_node(NODE_DATA(0), __MEMORY_START, PAGE_SIZE);
 
 #ifdef CONFIG_BLK_DEV_INITRD
+ 	ROOT_DEV = MKDEV(RAMDISK_MAJOR, 0);
+ 	if (&__rd_start != &__rd_end) {
+		LOADER_TYPE = 1;
+		INITRD_START = PHYSADDR((unsigned long)&__rd_start) - __MEMORY_START;
+		INITRD_SIZE = (unsigned long)&__rd_end - (unsigned long)&__rd_start;
+ 	}
+
 	if (LOADER_TYPE && INITRD_START) {
 		if (INITRD_START + INITRD_SIZE <= (max_low_pfn << PAGE_SHIFT)) {
 			reserve_bootmem_node(NODE_DATA(0), INITRD_START+__MEMORY_START, INITRD_SIZE);
@@ -557,8 +433,10 @@ subsys_initcall(topology_init);
 
 static const char *cpu_name[] = {
 	[CPU_SH7604]	= "SH7604",
+	[CPU_SH7705]	= "SH7705",
 	[CPU_SH7708]	= "SH7708",
 	[CPU_SH7729]	= "SH7729",
+	[CPU_SH7300]	= "SH7300",
 	[CPU_SH7750]	= "SH7750",
 	[CPU_SH7750S]	= "SH7750S",
 	[CPU_SH7750R]	= "SH7750R",
@@ -595,8 +473,8 @@ static void show_cpuflags(struct seq_file *m)
 
 	for (i = 0; i < cpu_data->flags; i++)
 		if ((cpu_data->flags & (1 << i)))
-			seq_printf(m, " %s", cpu_flags[i]);
-	
+			seq_printf(m, " %s", cpu_flags[i+1]);
+
 	seq_printf(m, "\n");
 }
 
diff --git a/arch/sh/kernel/sh_ksyms.c b/arch/sh/kernel/sh_ksyms.c
index abe649077..42868fca4 100644
--- a/arch/sh/kernel/sh_ksyms.c
+++ b/arch/sh/kernel/sh_ksyms.c
@@ -33,6 +33,7 @@ EXPORT_SYMBOL(dump_fpu);
 EXPORT_SYMBOL(iounmap);
 EXPORT_SYMBOL(enable_irq);
 EXPORT_SYMBOL(disable_irq);
+EXPORT_SYMBOL(probe_irq_mask);
 EXPORT_SYMBOL(kernel_thread);
 EXPORT_SYMBOL(disable_irq_nosync);
 EXPORT_SYMBOL(irq_desc);
@@ -83,6 +84,7 @@ EXPORT_SYMBOL(__down);
 EXPORT_SYMBOL(__down_interruptible);
 
 EXPORT_SYMBOL(__udelay);
+EXPORT_SYMBOL(__ndelay);
 EXPORT_SYMBOL(__const_udelay);
 
 #define DECLARE_EXPORT(name) extern void name(void);EXPORT_SYMBOL_NOVERS(name)
@@ -100,6 +102,7 @@ DECLARE_EXPORT(__movstr);
  
 DECLARE_EXPORT(__movstr_i4_even);
 DECLARE_EXPORT(__movstr_i4_odd);
+DECLARE_EXPORT(__movstrSI12_i4);
 
 /* needed by some modules */
 EXPORT_SYMBOL(flush_cache_all);
@@ -115,3 +118,4 @@ EXPORT_SYMBOL(synchronize_irq);
 #endif
 
 EXPORT_SYMBOL(csum_partial);
+EXPORT_SYMBOL(consistent_sync);
diff --git a/arch/sh/kernel/time.c b/arch/sh/kernel/time.c
index cd91a59a9..3bcdf4ca4 100644
--- a/arch/sh/kernel/time.c
+++ b/arch/sh/kernel/time.c
@@ -1,10 +1,10 @@
-/* $Id: time.c,v 1.19 2004/02/27 00:40:48 lethal Exp $
+/* $Id: time.c,v 1.21 2004/04/21 00:09:15 lethal Exp $
  *
  *  linux/arch/sh/kernel/time.c
  *
  *  Copyright (C) 1999  Tetsuya Okada & Niibe Yutaka
  *  Copyright (C) 2000  Philipp Rumpf <prumpf@tux.org>
- *  Copyright (C) 2002, 2003  Paul Mundt
+ *  Copyright (C) 2002, 2003, 2004  Paul Mundt
  *  Copyright (C) 2002  M. R. Brown  <mrbrown@linux-sh.org>
  *
  *  Some code taken from i386 version.
@@ -47,12 +47,26 @@
 #define TMU0_TCR_CALIB	0x0000
 
 #if defined(CONFIG_CPU_SH3)
+#if defined(CONFIG_CPU_SUBTYPE_SH7300)
+#define TMU_TSTR        0xA412FE92      /* Byte access */
+
+#define TMU0_TCOR       0xA412FE94      /* Long access */
+#define TMU0_TCNT       0xA412FE98      /* Long access */
+#define TMU0_TCR        0xA412FE9C      /* Word access */
+
+#define TMU1_TCOR	0xA412FEA0	/* Long access */
+#define TMU1_TCNT	0xA412FEA4	/* Long access */
+#define TMU1_TCR	0xA412FEA8	/* Word access */
+
+#define FRQCR           0xA415FF80
+#else
 #define TMU_TOCR	0xfffffe90	/* Byte access */
 #define TMU_TSTR	0xfffffe92	/* Byte access */
 
 #define TMU0_TCOR	0xfffffe94	/* Long access */
 #define TMU0_TCNT	0xfffffe98	/* Long access */
 #define TMU0_TCR	0xfffffe9c	/* Word access */
+#endif
 #elif defined(CONFIG_CPU_SH4)
 #define TMU_TOCR	0xffd80000	/* Byte access */
 #define TMU_TSTR	0xffd80004	/* Byte access */
@@ -85,6 +99,9 @@ void (*rtc_get_time)(struct timespec *) = 0;
 int (*rtc_set_time)(const time_t) = 0;
 #endif
 
+#if defined(CONFIG_CPU_SUBTYPE_SH7300)
+static int md_table[] = { 1, 2, 3, 4, 6, 8, 12 };
+#endif
 #if defined(CONFIG_CPU_SH3)
 static int stc_multipliers[] = { 1, 2, 3, 4, 6, 1, 1, 1 };
 static int stc_values[]      = { 0, 1, 4, 2, 5, 0, 0, 0 };
@@ -337,7 +354,9 @@ static unsigned int __init get_timer_frequency(void)
 	 * have it count down at its natural rate.
 	 */
 	ctrl_outb(0, TMU_TSTR);
+#if !defined(CONFIG_CPU_SUBTYPE_SH7300)
 	ctrl_outb(TMU_TOCR_INIT, TMU_TOCR);
+#endif
 	ctrl_outw(TMU0_TCR_CALIB, TMU0_TCR);
 	ctrl_outl(0xffffffff, TMU0_TCOR);
 	ctrl_outl(0xffffffff, TMU0_TCNT);
@@ -391,13 +410,22 @@ static int __init sh_pclk_setup(char *str)
 }
 __setup("sh_pclk=", sh_pclk_setup);
 
-static struct irqaction irq0  = { timer_interrupt, SA_INTERRUPT, 0, "timer", NULL, NULL};
+static struct irqaction irq0  = { timer_interrupt, SA_INTERRUPT, CPU_MASK_NONE, "timer", NULL, NULL};
 
 void get_current_frequency_divisors(unsigned int *ifc, unsigned int *bfc, unsigned int *pfc)
 {
 	unsigned int frqcr = ctrl_inw(FRQCR);
 
 #if defined(CONFIG_CPU_SH3)
+#if defined(CONFIG_CPU_SUBTYPE_SH7300)
+	*ifc = md_table[((frqcr & 0x0070) >> 4)];
+	*bfc = md_table[((frqcr & 0x0700) >> 8)];
+	*pfc = md_table[frqcr & 0x0007];
+#elif defined(CONFIG_CPU_SUBTYPE_SH7705)
+	*bfc = stc_multipliers[(frqcr & 0x0300) >> 8];
+	*ifc = ifc_divisors[(frqcr & 0x0030) >> 4];
+	*pfc = pfc_divisors[frqcr & 0x0003];
+#else
 	unsigned int tmp;
 
 	tmp  = (frqcr & 0x8000) >> 13;
@@ -409,6 +437,7 @@ void get_current_frequency_divisors(unsigned int *ifc, unsigned int *bfc, unsign
 	tmp  = (frqcr & 0x2000) >> 11;
 	tmp |= frqcr & 0x0003;
 	*pfc = pfc_divisors[tmp];
+#endif
 #elif defined(CONFIG_CPU_SH4)
 	*ifc = ifc_divisors[(frqcr >> 6) & 0x0007];
 	*bfc = bfc_divisors[(frqcr >> 3) & 0x0007];
@@ -431,26 +460,139 @@ _FREQ_TABLE(ifc);
 _FREQ_TABLE(bfc);
 _FREQ_TABLE(pfc);
 
+#ifdef CONFIG_CPU_SUBTYPE_ST40STB1
+
+/* The ST40 divisors are totally different so we set the cpu data
+** clocks using a different algorithm
+**
+** I've just plugged this from the 2.4 code - Alex Bennee <kernel-hacker@bennee.com>
+*/
+#define CCN_PVR_CHIP_SHIFT 24
+#define CCN_PVR_CHIP_MASK  0xff
+#define CCN_PVR_CHIP_ST40STB1 0x4
+
+
+struct frqcr_data {
+    unsigned short frqcr;
+    struct {
+	unsigned char multiplier;
+	unsigned char divisor;
+    } factor[3];
+};
+
+static struct frqcr_data st40_frqcr_table[] = {
+    { 0x000, {{1,1}, {1,1}, {1,2}}},
+    { 0x002, {{1,1}, {1,1}, {1,4}}},
+    { 0x004, {{1,1}, {1,1}, {1,8}}},
+    { 0x008, {{1,1}, {1,2}, {1,2}}},
+    { 0x00A, {{1,1}, {1,2}, {1,4}}},
+    { 0x00C, {{1,1}, {1,2}, {1,8}}},
+    { 0x011, {{1,1}, {2,3}, {1,6}}},
+    { 0x013, {{1,1}, {2,3}, {1,3}}},
+    { 0x01A, {{1,1}, {1,2}, {1,4}}},
+    { 0x01C, {{1,1}, {1,2}, {1,8}}},
+    { 0x023, {{1,1}, {2,3}, {1,3}}},
+    { 0x02C, {{1,1}, {1,2}, {1,8}}},
+    { 0x048, {{1,2}, {1,2}, {1,4}}},
+    { 0x04A, {{1,2}, {1,2}, {1,6}}},
+    { 0x04C, {{1,2}, {1,2}, {1,8}}},
+    { 0x05A, {{1,2}, {1,3}, {1,6}}},
+    { 0x05C, {{1,2}, {1,3}, {1,6}}},
+    { 0x063, {{1,2}, {1,4}, {1,4}}},
+    { 0x06C, {{1,2}, {1,4}, {1,8}}},
+    { 0x091, {{1,3}, {1,3}, {1,6}}},
+    { 0x093, {{1,3}, {1,3}, {1,6}}},
+    { 0x0A3, {{1,3}, {1,6}, {1,6}}},
+    { 0x0DA, {{1,4}, {1,4}, {1,8}}},
+    { 0x0DC, {{1,4}, {1,4}, {1,8}}},
+    { 0x0EC, {{1,4}, {1,8}, {1,8}}},
+    { 0x123, {{1,4}, {1,4}, {1,8}}},
+    { 0x16C, {{1,4}, {1,8}, {1,8}}},
+};
+
+struct memclk_data {
+    unsigned char multiplier;
+    unsigned char divisor;
+};
+static struct memclk_data st40_memclk_table[8] = {
+    {1,1},	// 000
+    {1,2},	// 001
+    {1,3},	// 010
+    {2,3},	// 011
+    {1,4},	// 100
+    {1,6},	// 101
+    {1,8},	// 110
+    {1,8}	// 111
+};
+
+static void st40_specific_time_init(unsigned int module_clock, unsigned short frqcr)
+{
+    unsigned int cpu_clock, master_clock, bus_clock, memory_clock;
+    struct frqcr_data *d;
+    int a;
+    unsigned long memclkcr;
+    struct memclk_data *e;
+
+    for (a=0; a<ARRAY_SIZE(st40_frqcr_table); a++) {
+	d = &st40_frqcr_table[a];
+	if (d->frqcr == (frqcr & 0x1ff))
+	    break;
+    }
+    if (a == ARRAY_SIZE(st40_frqcr_table)) {
+	d = st40_frqcr_table;
+	printk("ERROR: Unrecognised FRQCR value (0x%x), using default multipliers\n",frqcr);
+    }
+
+    memclkcr = ctrl_inl(CLOCKGEN_MEMCLKCR);
+    e = &st40_memclk_table[memclkcr & MEMCLKCR_RATIO_MASK];
+
+    printk("Clock multipliers: CPU: %d/%d Bus: %d/%d Mem: %d/%d Periph: %d/%d\n",
+	    d->factor[0].multiplier, d->factor[0].divisor,
+	    d->factor[1].multiplier, d->factor[1].divisor,
+	    e->multiplier,           e->divisor,
+	    d->factor[2].multiplier, d->factor[2].divisor);
+
+    master_clock = module_clock * d->factor[2].divisor    / d->factor[2].multiplier;
+    bus_clock    = master_clock * d->factor[1].multiplier / d->factor[1].divisor;
+    memory_clock = master_clock * e->multiplier           / e->divisor;
+    cpu_clock    = master_clock * d->factor[0].multiplier / d->factor[0].divisor;
+
+    current_cpu_data.cpu_clock    = cpu_clock;
+    current_cpu_data.master_clock = master_clock;
+    current_cpu_data.bus_clock    = bus_clock;
+    current_cpu_data.memory_clock = memory_clock;
+    current_cpu_data.module_clock = module_clock;
+
+}
+
+#endif
+
 void __init time_init(void)
 {
 	unsigned int timer_freq = 0;
 	unsigned int ifc, pfc, bfc;
 	unsigned long interval;
+#ifdef CONFIG_CPU_SUBTYPE_ST40STB1
+	unsigned long pvr;
+	unsigned short frqcr;
+#endif
 
 	if (board_time_init)
 		board_time_init();
 
-	get_current_frequency_divisors(&ifc, &bfc, &pfc);
 
 	/*
 	 * If we don't have an RTC (such as with the SH7300), don't attempt to
 	 * probe the timer frequency. Rely on an either hardcoded peripheral
-	 * clock value, or on the sh_pclk command line option.
+	 * clock value, or on the sh_pclk command line option. Note that we
+	 * still need to have CONFIG_SH_PCLK_FREQ set in order for things like
+	 * CLOCK_TICK_RATE to be sane.
 	 */
 	current_cpu_data.module_clock = sh_pclk_freq;
 
+#ifdef CONFIG_SH_PCLK_CALC
 	/* XXX: Switch this over to a more generic test. */
-	if (current_cpu_data.type != CPU_SH7300) {
+	{
 		unsigned int freq;
 
 		/* 
@@ -466,15 +608,31 @@ void __init time_init(void)
 		timer_freq = get_timer_frequency();
 		freq = timer_freq * 4;
 
-		if (sh_pclk_freq && sh_pclk_freq != freq) {
+		if (sh_pclk_freq && (sh_pclk_freq/100*99 > freq || sh_pclk_freq/100*101 < freq)) {
 			printk(KERN_NOTICE "Calculated peripheral clock value "
 			       "%d differs from sh_pclk value %d, fixing..\n",
 			       freq, sh_pclk_freq);
 			current_cpu_data.module_clock = freq;
 		}
 	}
+#endif
+
+#ifdef CONFIG_CPU_SUBTYPE_ST40STB1
+	pvr = ctrl_inl(CCN_PVR);
+	frqcr = ctrl_inw(FRQCR);
+	printk("time.c ST40 Probe: PVR %08lx, FRQCR %04hx\n", pvr, frqcr);
+	if (((pvr >>CCN_PVR_CHIP_SHIFT) & CCN_PVR_CHIP_MASK) == CCN_PVR_CHIP_ST40STB1)
+	    st40_specific_time_init(current_cpu_data.module_clock, frqcr);
+	else
+#endif
+	    get_current_frequency_divisors(&ifc, &bfc, &pfc);
 
-	rtc_get_time(&xtime);
+	if (rtc_get_time)
+		rtc_get_time(&xtime);
+	else {
+         	xtime.tv_sec = mktime(2000, 1, 1, 0, 0, 0);
+         	xtime.tv_nsec = 0;
+	}
 
         set_normalized_timespec(&wall_to_monotonic,
                                 -xtime.tv_sec, -xtime.tv_nsec);
@@ -485,6 +643,10 @@ void __init time_init(void)
 		setup_irq(TIMER_IRQ, &irq0);
 	}
 
+	/*
+	** for ST40 chips the current_cpu_data should already be set
+	** so not having valid pfc/bfc/ifc shouldn't be a problem
+	*/
 	if (!current_cpu_data.master_clock)
 		current_cpu_data.master_clock = current_cpu_data.module_clock * pfc;
 	if (!current_cpu_data.bus_clock)
@@ -506,13 +668,19 @@ void __init time_init(void)
 	printk("Module clock: %d.%02dMHz\n",
 	       (current_cpu_data.module_clock / 1000000),
 	       (current_cpu_data.module_clock % 1000000)/10000);
+#if defined(CONFIG_SH_HS7751RVOIP) || defined(CONFIG_SH_RTS7751R2D)
+	interval = ((current_cpu_data.module_clock/4 + HZ/2) / HZ) - 1;
+#else
 	interval = (current_cpu_data.module_clock/4 + HZ/2) / HZ;
+#endif
 
 	printk("Interval = %ld\n", interval);
 
 	/* Start TMU0 */
 	ctrl_outb(0, TMU_TSTR);
+#if !defined(CONFIG_CPU_SUBTYPE_SH7300)
 	ctrl_outb(TMU_TOCR_INIT, TMU_TOCR);
+#endif
 	ctrl_outw(TMU0_TCR_INIT, TMU0_TCR);
 	ctrl_outl(interval, TMU0_TCOR);
 	ctrl_outl(interval, TMU0_TCNT);
diff --git a/arch/sh/kernel/traps.c b/arch/sh/kernel/traps.c
index 3e63d8a70..da5721f4a 100644
--- a/arch/sh/kernel/traps.c
+++ b/arch/sh/kernel/traps.c
@@ -1,4 +1,4 @@
-/* $Id: traps.c,v 1.16 2004/03/16 00:10:54 lethal Exp $
+/* $Id: traps.c,v 1.17 2004/05/02 01:46:30 sugioka Exp $
  *
  *  linux/arch/sh/traps.c
  *
@@ -559,7 +559,7 @@ int is_dsp_inst(struct pt_regs *regs)
 	 * Safe guard if DSP mode is already enabled or we're lacking
 	 * the DSP altogether.
 	 */
-	if (!test_bit(CPU_HAS_DSP, &(cpu_data->flags)) || (regs->sr & SR_DSP))
+	if (!(cpu_data->flags & CPU_HAS_DSP) || (regs->sr & SR_DSP))
 		return 0;
 
 	get_user(inst, ((unsigned short *) regs->pc));
@@ -636,7 +636,7 @@ void __init trap_init(void)
 		= (void *)do_illegal_slot_inst;
 
 #ifdef CONFIG_CPU_SH4
-	if (!test_bit(CPU_HAS_FPU, &(cpu_data->flags))) {
+	if (!(cpu_data->flags & CPU_HAS_FPU)) {
 		/* For SH-4 lacking an FPU, treat floating point instructions
 		   as reserved. */
 		/* entry 64 corresponds to EXPEVT=0x800 */
diff --git a/arch/sh/kernel/vmlinux.lds.S b/arch/sh/kernel/vmlinux.lds.S
index da0f5d728..923980741 100644
--- a/arch/sh/kernel/vmlinux.lds.S
+++ b/arch/sh/kernel/vmlinux.lds.S
@@ -38,6 +38,14 @@ SECTIONS
 
   .data : {			/* Data */
 	*(.data)
+
+ 	 /* Align the initial ramdisk image (INITRD) on page boundaries. */
+ 	 . = ALIGN(4096);
+ 	 __rd_start = .;
+ 	 *(.initrd)
+ 	 . = ALIGN(4096);
+ 	 __rd_end = .;
+
 	CONSTRUCTORS
 	}
 
diff --git a/arch/sh/lib/delay.c b/arch/sh/lib/delay.c
index e1fcc970f..550454649 100644
--- a/arch/sh/lib/delay.c
+++ b/arch/sh/lib/delay.c
@@ -33,3 +33,9 @@ void __udelay(unsigned long usecs)
 {
 	__const_udelay(usecs * 0x000010c6);  /* 2**32 / 1000000 */
 }
+
+void __ndelay(unsigned long nsecs)
+{
+	__const_udelay(nsecs * 0x00000005);
+}
+
diff --git a/arch/sh/mm/cache-sh3.c b/arch/sh/mm/cache-sh3.c
index cb6c0c0c7..b03d5e441 100644
--- a/arch/sh/mm/cache-sh3.c
+++ b/arch/sh/mm/cache-sh3.c
@@ -1,4 +1,4 @@
-/* $Id: cache-sh3.c,v 1.8 2004/02/01 16:26:27 lethal Exp $
+/* $Id: cache-sh3.c,v 1.9 2004/05/02 01:46:30 sugioka Exp $
  *
  *  linux/arch/sh/mm/cache-sh3.c
  *
@@ -65,14 +65,14 @@ int __init detect_cpu_and_cache_system(void)
 	 * 2K(direct) 7702 is not supported (yet)
 	 */
 	if (data0 == data1 && data2 == data3) {	/* Shadow */
-		cpu_data->dcache.way_shift	= 11;
+		cpu_data->dcache.way_incr	= (1 << 11);
 		cpu_data->dcache.entry_mask	= 0x7f0;
 		cpu_data->dcache.sets		= 128;
 		cpu_data->type = CPU_SH7708;
 
-		set_bit(CPU_HAS_MMU_PAGE_ASSOC, &(cpu_data->flags));
+		cpu_data->flags |= CPU_HAS_MMU_PAGE_ASSOC;
 	} else {				/* 7709A or 7729  */
-		cpu_data->dcache.way_shift	= 12;
+		cpu_data->dcache.way_incr	= (1 << 12);
 		cpu_data->dcache.entry_mask	= 0xff0;
 		cpu_data->dcache.sets		= 256;
 		cpu_data->type = CPU_SH7729;
@@ -108,13 +108,12 @@ void __flush_wback_region(void *start, int size)
 		& ~(L1_CACHE_BYTES-1);
 
 	for (v = begin; v < end; v+=L1_CACHE_BYTES) {
+		unsigned long addrstart = CACHE_OC_ADDRESS_ARRAY;
 		for (j = 0; j < cpu_data->dcache.ways; j++) {
 			unsigned long data, addr, p;
 
 			p = __pa(v);
-			addr = CACHE_OC_ADDRESS_ARRAY |
-				(j << cpu_data->dcache.way_shift)|
-				(v & cpu_data->dcache.entry_mask);
+			addr = addrstart | (v & cpu_data->dcache.entry_mask);
 			local_irq_save(flags);
 			data = ctrl_inl(addr);
 			
@@ -126,6 +125,7 @@ void __flush_wback_region(void *start, int size)
 				break;
 			}
 			local_irq_restore(flags);
+			addrstart += cpu_data->dcache.way_incr;
 		}
 	}
 }
diff --git a/arch/sh/mm/cache-sh4.c b/arch/sh/mm/cache-sh4.c
index dde3de346..adb99d833 100644
--- a/arch/sh/mm/cache-sh4.c
+++ b/arch/sh/mm/cache-sh4.c
@@ -30,7 +30,7 @@ static void __flush_dcache_all_ex(void);
 
 int __init detect_cpu_and_cache_system(void)
 {
-	unsigned long pvr, prr, ccr, cvr;
+	unsigned long pvr, prr, cvr;
 	unsigned long size;
 
 	static unsigned long sizes[16] = {
@@ -48,7 +48,7 @@ int __init detect_cpu_and_cache_system(void)
 	/*
 	 * Setup some sane SH-4 defaults for the icache
 	 */
-	cpu_data->icache.way_shift	= 13;
+	cpu_data->icache.way_incr	= (1 << 13);
 	cpu_data->icache.entry_shift	= 5;
 	cpu_data->icache.entry_mask	= 0x1fe0;
 	cpu_data->icache.sets		= 256;
@@ -58,7 +58,7 @@ int __init detect_cpu_and_cache_system(void)
 	/*
 	 * And again for the dcache ..
 	 */
-	cpu_data->dcache.way_shift	= 14;
+	cpu_data->dcache.way_incr	= (1 << 14);
 	cpu_data->dcache.entry_shift	= 5;
 	cpu_data->dcache.entry_mask	= 0x3fe0;
 	cpu_data->dcache.sets		= 512;
@@ -66,7 +66,7 @@ int __init detect_cpu_and_cache_system(void)
 	cpu_data->dcache.linesz		= L1_CACHE_BYTES;
 
 	/* Set the FPU flag, virtually all SH-4's have one */
-	set_bit(CPU_HAS_FPU, &(cpu_data->flags));
+	cpu_data->flags |= CPU_HAS_FPU;
 
 	/*
 	 * Probe the underlying processor version/revision and
@@ -75,7 +75,7 @@ int __init detect_cpu_and_cache_system(void)
 	switch (pvr) {
 	case 0x205:
 		cpu_data->type = CPU_SH7750;
-		set_bit(CPU_HAS_P2_FLUSH_BUG, &(cpu_data->flags));
+		cpu_data->flags |= CPU_HAS_P2_FLUSH_BUG;
 		break;
 	case 0x206:
 		cpu_data->type = CPU_SH7750S;
@@ -84,7 +84,7 @@ int __init detect_cpu_and_cache_system(void)
 		 * FIXME: This is needed for 7750, but do we need it for the
 		 * 7750S too? For now, assume we do.. -- PFM
 		 */
-		set_bit(CPU_HAS_P2_FLUSH_BUG, &(cpu_data->flags));
+		cpu_data->flags |= CPU_HAS_P2_FLUSH_BUG;
 
 		break;
 	case 0x1100:
@@ -102,7 +102,7 @@ int __init detect_cpu_and_cache_system(void)
 		cpu_data->dcache.ways = 2;
 
 		/* No FPU on the SH4-500 series.. */
-		clear_bit(CPU_HAS_FPU, &(cpu_data->flags));
+		cpu_data->flags &= ~CPU_HAS_FPU;
 		break;
 	case 0x600:
 		cpu_data->type = CPU_SH4_202;
@@ -129,27 +129,20 @@ int __init detect_cpu_and_cache_system(void)
 	 * On anything that's not a direct-mapped cache, look to the CVR
 	 * for I/D-cache specifics.
 	 */
-	if (cpu_data->dcache.ways > 1) {
-		jump_to_P2();
-		ccr = ctrl_inl(CCR);
-
-		/* Force EMODE */
-		if (!(ccr & CCR_CACHE_EMODE)) {
-			ccr |= CCR_CACHE_EMODE;
-			ctrl_outl(ccr, CCR);
-		}
-
-		back_to_P1();
-
+	if (cpu_data->icache.ways > 1) {
 		size = sizes[(cvr >> 20) & 0xf];
-		cpu_data->icache.way_shift	=  (size >> 1);
-		cpu_data->icache.entry_mask	= ((size >> 2) - (1 << 5));
-		cpu_data->icache.sets		=  (size >> 6);
+		cpu_data->icache.way_incr	= size / cpu_data->icache.ways;
+		cpu_data->icache.sets		= (size >> 6);
+		cpu_data->icache.entry_mask	=
+			((size / cpu_data->icache.ways) - (1 << 5));
+	}
 
+	if (cpu_data->dcache.ways > 1) {
 		size = sizes[(cvr >> 16) & 0xf];
-		cpu_data->dcache.way_shift	=  (size >> 1);
-		cpu_data->dcache.entry_mask	= ((size >> 2) - (1 << 5));
-		cpu_data->dcache.sets		=  (size >> 6);
+		cpu_data->dcache.way_incr	= size / cpu_data->dcache.ways;
+		cpu_data->dcache.sets		= (size >> 6);
+		cpu_data->dcache.entry_mask	=
+			((size / cpu_data->dcache.ways) - (1 << 5));
 	}
 
 	return 0;
@@ -250,7 +243,7 @@ static void __flush_cache_4096_all_ex(unsigned long start)
 	int i;
 
 	entry_offset = 1 << cpu_data->dcache.entry_shift;
-	for (i = 0; i < cpu_data->dcache.ways; i++, start += (1 << cpu_data->dcache.way_shift)) {
+	for (i = 0; i < cpu_data->dcache.ways; i++, start += cpu_data->dcache.way_incr) {
 		for (addr = CACHE_OC_ADDRESS_ARRAY + start;
 		     addr < CACHE_OC_ADDRESS_ARRAY + 4096 + start;
 		     addr += entry_offset) {
@@ -297,7 +290,7 @@ void flush_cache_sigtramp(unsigned long addr)
 
 	local_irq_save(flags);
 	jump_to_P2();
-	for(i = 0; i < cpu_data->icache.ways; i++, index += (1 << cpu_data->icache.way_shift))
+	for(i = 0; i < cpu_data->icache.ways; i++, index += cpu_data->icache.way_incr)
 		ctrl_outl(0, index);	/* Clear out Valid-bit */
 	back_to_P1();
 	local_irq_restore(flags);
@@ -313,12 +306,13 @@ static inline void flush_cache_4096(unsigned long start,
 	 * SH7751, SH7751R, and ST40 have no restriction to handle cache.
 	 * (While SH7750 must do that at P2 area.)
 	 */
-	if (test_bit(CPU_HAS_P2_FLUSH_BUG, &(cpu_data->flags))) {
+	if ((cpu_data->flags & CPU_HAS_P2_FLUSH_BUG)
+	   || start < CACHE_OC_ADDRESS_ARRAY) {
 		local_irq_save(flags);
-		__flush_cache_4096(start | SH_CACHE_ASSOC, phys | 0x80000000, 0x20000000);
+		__flush_cache_4096(start | SH_CACHE_ASSOC, P1SEGADDR(phys), 0x20000000);
 		local_irq_restore(flags);
-	} else if (start >= CACHE_OC_ADDRESS_ARRAY) {
-		__flush_cache_4096(start | SH_CACHE_ASSOC, phys | 0x80000000, 0);
+	} else {
+		__flush_cache_4096(start | SH_CACHE_ASSOC, P1SEGADDR(phys), 0);
 	}
 }
 
diff --git a/arch/sh/mm/consistent.c b/arch/sh/mm/consistent.c
index f988035c7..789bacf1a 100644
--- a/arch/sh/mm/consistent.c
+++ b/arch/sh/mm/consistent.c
@@ -24,56 +24,58 @@ void *consistent_alloc(int gfp, size_t size, dma_addr_t *handle)
 	if (!page)
 		return NULL;
 
-	ret = (void *)P2SEGADDR(page_to_bus(page));
+	ret = page_address(page);
+	*handle = virt_to_phys(ret);
 
 	/*
 	 * We must flush the cache before we pass it on to the device
 	 */
 	dma_cache_wback_inv(ret, size);
 
-	*handle = (unsigned long)ret;
-
+	page = virt_to_page(ret);
 	free = page + (size >> PAGE_SHIFT);
 	end  = page + (1 << order);
 
-	do {
+	while (++page < end) {
 		set_page_count(page, 1);
-		page++;
-	} while (size -= PAGE_SIZE);
 
-	/*
-	 * Free any unused pages
-	 */
-	while (page < end) {
-		set_page_count(page, 1);
-		__free_page(page);
-		page++;
+		/* Free any unused pages */
+		if (page >= free) {
+			__free_page(page);
+		}
 	}
 
-	return ret;
+	return P2SEGADDR(ret);
 }
 
 void consistent_free(void *vaddr, size_t size)
 {
 	unsigned long addr = P1SEGADDR((unsigned long)vaddr);
+	struct page *page=virt_to_page(addr);
+	int num_pages=(size+PAGE_SIZE-1) >> PAGE_SHIFT;
+	int i;
 
-	free_pages(addr, get_order(size));
+	for(i=0;i<num_pages;i++) {
+		__free_page((page+i));
+	}
 }
 
 void consistent_sync(void *vaddr, size_t size, int direction)
 {
+	void * p1addr = (void*) P1SEGADDR((unsigned long)vaddr);
+
 	switch (direction) {
 	case DMA_FROM_DEVICE:		/* invalidate only */
-		dma_cache_inv(vaddr, size);
+		dma_cache_inv(p1addr, size);
 		break;
 	case DMA_TO_DEVICE:		/* writeback only */
-		dma_cache_wback(vaddr, size);
+		dma_cache_wback(p1addr, size);
 		break;
 	case DMA_BIDIRECTIONAL:		/* writeback and invalidate */
-		dma_cache_wback_inv(vaddr, size);
+		dma_cache_wback_inv(p1addr, size);
 		break;
 	default:
 		BUG();
 	}
 }
-
+EXPORT_SYMBOL(consistent_sync);
diff --git a/arch/sh/mm/init.c b/arch/sh/mm/init.c
index 95b5368c0..7b49b6976 100644
--- a/arch/sh/mm/init.c
+++ b/arch/sh/mm/init.c
@@ -3,7 +3,7 @@
  *  linux/arch/sh/mm/init.c
  *
  *  Copyright (C) 1999  Niibe Yutaka
- *  Copyright (C) 2002  Paul Mundt
+ *  Copyright (C) 2002, 2004  Paul Mundt
  *
  *  Based on linux/arch/i386/mm/init.c:
  *   Copyright (C) 1995  Linus Torvalds
@@ -66,7 +66,7 @@ void show_mem(void)
 
 	printk("Mem-info:\n");
 	show_free_areas();
-	printk("Free swap:       %6dkB\n",nr_swap_pages<<(PAGE_SHIFT-10));
+	printk("Free swap:       %6ldkB\n", nr_swap_pages<<(PAGE_SHIFT-10));
 	i = max_mapnr;
 	while (i-- > 0) {
 		total++;
@@ -83,6 +83,66 @@ void show_mem(void)
 	printk("%d pages swap cached\n",cached);
 }
 
+static void set_pte_phys(unsigned long addr, unsigned long phys, pgprot_t prot)
+{
+	pgd_t *pgd;
+	pmd_t *pmd;
+	pte_t *pte;
+
+	pgd = swapper_pg_dir + pgd_index(addr);
+	if (pgd_none(*pgd)) {
+		pgd_ERROR(*pgd);
+		return;
+	}
+
+	pmd = pmd_offset(pgd, addr);
+	if (pmd_none(*pmd)) {
+		pte = (pte_t *)get_zeroed_page(GFP_ATOMIC);
+		set_pmd(pmd, __pmd(__pa(pte) | _KERNPG_TABLE | _PAGE_USER));
+		if (pte != pte_offset_kernel(pmd, 0)) {
+			pmd_ERROR(*pmd);
+			return;
+		}
+	}
+
+	pte = pte_offset_kernel(pmd, addr);
+	if (!pte_none(*pte)) {
+		pte_ERROR(*pte);
+		return;
+	}
+
+	set_pte(pte, pfn_pte(phys >> PAGE_SHIFT, prot));
+
+	__flush_tlb_page(get_asid(), addr);
+}
+
+/*
+ * As a performance optimization, other platforms preserve the fixmap mapping
+ * across a context switch, we don't presently do this, but this could be done
+ * in a similar fashion as to the wired TLB interface that sh64 uses (by way
+ * of the memorry mapped UTLB configuration) -- this unfortunately forces us to
+ * give up a TLB entry for each mapping we want to preserve. While this may be
+ * viable for a small number of fixmaps, it's not particularly useful for
+ * everything and needs to be carefully evaluated. (ie, we may want this for
+ * the vsyscall page).
+ *
+ * XXX: Perhaps add a _PAGE_WIRED flag or something similar that we can pass
+ * in at __set_fixmap() time to determine the appropriate behavior to follow.
+ *
+ *					 -- PFM.
+ */
+void __set_fixmap(enum fixed_addresses idx, unsigned long phys, pgprot_t prot)
+{
+	unsigned long address = __fix_to_virt(idx);
+
+	if (idx >= __end_of_fixed_addresses) {
+		BUG();
+		return;
+	}
+
+	set_pte_phys(address, phys, prot);
+}
+
 /* References to section boundaries */
 
 extern char _text, _etext, _edata, __bss_start, _end;
diff --git a/arch/sh/mm/pg-sh4.c b/arch/sh/mm/pg-sh4.c
index 07cbbd6c1..f6a762308 100644
--- a/arch/sh/mm/pg-sh4.c
+++ b/arch/sh/mm/pg-sh4.c
@@ -1,7 +1,5 @@
-/* 
- * $Id: pg-sh4.c,v 1.1.2.2 2002/11/17 17:56:18 lethal Exp $
- *
- *  arch/sh/mm/pg-sh4.c
+/*
+ * arch/sh/mm/pg-sh4.c
  *
  * Copyright (C) 1999, 2000, 2002  Niibe Yutaka
  * Copyright (C) 2002  Paul Mundt
@@ -101,3 +99,24 @@ void copy_user_page(void *to, void *from, unsigned long address,
 		up(&p3map_sem[(address & CACHE_ALIAS)>>12]);
 	}
 }
+
+/*
+ * For SH-4, we have our own implementation for ptep_get_and_clear
+ */
+inline pte_t ptep_get_and_clear(pte_t *ptep)
+{
+	pte_t pte = *ptep;
+
+	pte_clear(ptep);
+	if (!pte_not_present(pte)) {
+		unsigned long pfn = pte_pfn(pte);
+		if (pfn_valid(pfn)) {
+			struct page *page = pfn_to_page(pfn);
+			struct address_space *mapping = page_mapping(page);
+			if (!mapping || !mapping_writably_mapped(mapping))
+				__clear_bit(PG_mapped, &page->flags);
+		}
+	}
+	return pte;
+}
+
diff --git a/arch/sh/mm/tlb-sh3.c b/arch/sh/mm/tlb-sh3.c
index 88213cef3..318d1a529 100644
--- a/arch/sh/mm/tlb-sh3.c
+++ b/arch/sh/mm/tlb-sh3.c
@@ -72,7 +72,7 @@ void __flush_tlb_page(unsigned long asid, unsigned long page)
 	addr = MMU_TLB_ADDRESS_ARRAY | (page & 0x1F000);
 	data = (page & 0xfffe0000) | asid; /* VALID bit is off */
 	
-	if (test_bit(CPU_HAS_MMU_PAGE_ASSOC, &(cpu_data->flags))) {
+	if ((cpu_data->flags & CPU_HAS_MMU_PAGE_ASSOC)) {
 		addr |= MMU_PAGE_ASSOC_BIT;
 		ways = 1;	/* we already know the way .. */
 	}
diff --git a/arch/sh/tools/mach-types b/arch/sh/tools/mach-types
index be54d527d..faf6d9e38 100644
--- a/arch/sh/tools/mach-types
+++ b/arch/sh/tools/mach-types
@@ -7,6 +7,7 @@
 #
 SE			SH_SOLUTION_ENGINE
 7751SE			SH_7751_SOLUTION_ENGINE		
+7300SE			SH_7300_SOLUTION_ENGINE
 7751SYSTEMH		SH_7751_SYSTEMH
 HP600			SH_HP600
 HP620			SH_HP620
@@ -21,4 +22,6 @@ BIGSUR			SH_BIGSUR
 ADX			SH_ADX
 MPC1211			SH_MPC1211
 SNAPGEAR		SH_SECUREEDGE5410
+HS7751RVOIP		SH_HS7751RVOIP
+RTS7751R2D		SH_RTS7751R2D
 
diff --git a/arch/sh64/configs/cayman_defconfig b/arch/sh64/configs/cayman_defconfig
index 6dd7cea5d..2d1b41549 100644
--- a/arch/sh64/configs/cayman_defconfig
+++ b/arch/sh64/configs/cayman_defconfig
@@ -228,7 +228,6 @@ CONFIG_IP_PNP=y
 # 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
 
 #
diff --git a/arch/sh64/defconfig b/arch/sh64/defconfig
index e6233e8fb..8cfca490c 100644
--- a/arch/sh64/defconfig
+++ b/arch/sh64/defconfig
@@ -226,7 +226,6 @@ CONFIG_IP_PNP=y
 # 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
 
 #
diff --git a/arch/sparc/Kconfig b/arch/sparc/Kconfig
index 4b3dd85b5..02ce6ccd3 100644
--- a/arch/sparc/Kconfig
+++ b/arch/sparc/Kconfig
@@ -83,6 +83,7 @@ config HW_CONSOLE
 
 config SMP
 	bool "Symmetric multi-processing support (does not work on sun4/sun4c)"
+	depends on BROKEN
 	---help---
 	  This enables support for systems with more than one CPU. If you have
 	  a system with only one CPU, like most personal computers, say N. If
@@ -221,6 +222,7 @@ config SUN_PM
 
 config SUN4
 	bool "Support for SUN4 machines (disables SUN4[CDM] support)"
+	depends on !SMP
 	help
 	  Say Y here if, and only if, your machine is a sun4. Note that
 	  a kernel compiled with this option will run only on sun4.
diff --git a/arch/sparc/defconfig b/arch/sparc/defconfig
index 3a4ddbd07..a69856263 100644
--- a/arch/sparc/defconfig
+++ b/arch/sparc/defconfig
@@ -19,18 +19,22 @@ CONFIG_BROKEN_ON_SMP=y
 #
 CONFIG_SWAP=y
 CONFIG_SYSVIPC=y
+CONFIG_POSIX_MQUEUE=y
 # CONFIG_BSD_PROCESS_ACCT is not set
 CONFIG_SYSCTL=y
+# CONFIG_AUDIT is not set
 CONFIG_LOG_BUF_SHIFT=14
 # CONFIG_HOTPLUG is not set
 # CONFIG_IKCONFIG is not set
 # CONFIG_EMBEDDED is not set
 CONFIG_KALLSYMS=y
+# CONFIG_KALLSYMS_ALL is not set
 CONFIG_FUTEX=y
 CONFIG_EPOLL=y
 CONFIG_IOSCHED_NOOP=y
 CONFIG_IOSCHED_AS=y
 CONFIG_IOSCHED_DEADLINE=y
+CONFIG_IOSCHED_CFQ=y
 # CONFIG_CC_OPTIMIZE_FOR_SIZE is not set
 
 #
@@ -171,7 +175,6 @@ CONFIG_CHR_DEV_SG=m
 # Some SCSI devices (e.g. CD jukebox) support multiple LUNs
 #
 # CONFIG_SCSI_MULTI_LUN is not set
-CONFIG_SCSI_REPORT_LUNS=y
 # CONFIG_SCSI_CONSTANTS is not set
 # CONFIG_SCSI_LOGGING is not set
 
@@ -190,11 +193,11 @@ CONFIG_SCSI_SPI_ATTRS=m
 # CONFIG_SCSI_AIC7XXX is not set
 # CONFIG_SCSI_AIC7XXX_OLD is not set
 # CONFIG_SCSI_AIC79XX is not set
+# CONFIG_SCSI_DPT_I2O is not set
 # CONFIG_SCSI_ADVANSYS is not set
 # CONFIG_SCSI_MEGARAID is not set
 # CONFIG_SCSI_SATA is not set
 # CONFIG_SCSI_BUSLOGIC is not set
-# CONFIG_SCSI_CPQFCTS is not set
 # CONFIG_SCSI_DMX3191D is not set
 # CONFIG_SCSI_EATA is not set
 # CONFIG_SCSI_EATA_PIO is not set
@@ -203,6 +206,7 @@ CONFIG_SCSI_SPI_ATTRS=m
 # CONFIG_SCSI_IPS is not set
 # CONFIG_SCSI_INIA100 is not set
 # CONFIG_SCSI_SYM53C8XX_2 is not set
+# CONFIG_SCSI_IPR is not set
 # CONFIG_SCSI_QLOGIC_ISP is not set
 # CONFIG_SCSI_QLOGIC_FC is not set
 # CONFIG_SCSI_QLOGIC_1280 is not set
@@ -263,8 +267,6 @@ CONFIG_INET6_AH=m
 CONFIG_INET6_ESP=m
 CONFIG_INET6_IPCOMP=m
 CONFIG_IPV6_TUNNEL=m
-# CONFIG_DECNET is not set
-# CONFIG_BRIDGE is not set
 # CONFIG_NETFILTER is not set
 CONFIG_XFRM=y
 CONFIG_XFRM_USER=m
@@ -279,7 +281,9 @@ CONFIG_SCTP_DBG_OBJCNT=y
 # CONFIG_SCTP_HMAC_SHA1 is not set
 CONFIG_SCTP_HMAC_MD5=y
 # CONFIG_ATM is not set
+# CONFIG_BRIDGE is not set
 # CONFIG_VLAN_8021Q is not set
+# CONFIG_DECNET is not set
 # CONFIG_LLC2 is not set
 # CONFIG_IPX is not set
 # CONFIG_ATALK is not set
@@ -288,7 +292,6 @@ CONFIG_SCTP_HMAC_MD5=y
 # 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
 
 #
@@ -300,18 +303,23 @@ CONFIG_SCTP_HMAC_MD5=y
 # Network testing
 #
 CONFIG_NET_PKTGEN=m
+# CONFIG_NETPOLL is not set
+# CONFIG_NET_POLL_CONTROLLER is not set
+# CONFIG_HAMRADIO is not set
+# CONFIG_IRDA is not set
+# CONFIG_BT is not set
 CONFIG_NETDEVICES=y
-
-#
-# ARCnet devices
-#
-# CONFIG_ARCNET is not set
 CONFIG_DUMMY=m
 # CONFIG_BONDING is not set
 # CONFIG_EQUALIZER is not set
 CONFIG_TUN=m
 # CONFIG_ETHERTAP is not set
 
+#
+# ARCnet devices
+#
+# CONFIG_ARCNET is not set
+
 #
 # Ethernet (10 or 100Mbit)
 #
@@ -342,7 +350,6 @@ CONFIG_SUNQE=m
 # CONFIG_HAMACHI is not set
 # CONFIG_YELLOWFIN is not set
 # CONFIG_R8169 is not set
-# CONFIG_SIS190 is not set
 # CONFIG_SK98LIN is not set
 # CONFIG_TIGON3 is not set
 
@@ -350,46 +357,29 @@ CONFIG_SUNQE=m
 # Ethernet (10000 Mbit)
 #
 # CONFIG_IXGB is not set
-# CONFIG_FDDI is not set
-# CONFIG_HIPPI is not set
-# CONFIG_PPP is not set
-# CONFIG_SLIP is not set
-
-#
-# Wireless LAN (non-hamradio)
-#
-# CONFIG_NET_RADIO is not set
+# CONFIG_S2IO 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
-# CONFIG_NETCONSOLE is not set
-
-#
-# Wan interfaces
-#
-# CONFIG_WAN is not set
 
 #
-# Amateur Radio support
-#
-# CONFIG_HAMRADIO is not set
-
-#
-# IrDA (infrared) support
+# Wireless LAN (non-hamradio)
 #
-# CONFIG_IRDA is not set
+# CONFIG_NET_RADIO is not set
 
 #
-# Bluetooth support
+# Wan interfaces
 #
-# CONFIG_BT is not set
-# CONFIG_NETPOLL is not set
-# CONFIG_NET_POLL_CONTROLLER is not set
+# CONFIG_WAN is not set
+# CONFIG_FDDI is not set
+# CONFIG_HIPPI is not set
+# CONFIG_PPP is not set
+# CONFIG_SLIP is not set
+# CONFIG_NET_FC is not set
+# CONFIG_SHAPER is not set
+# CONFIG_NETCONSOLE is not set
 
 #
 # Unix98 PTY support
@@ -486,6 +476,7 @@ CONFIG_ISO9660_FS=m
 #
 CONFIG_PROC_FS=y
 CONFIG_PROC_KCORE=y
+CONFIG_SYSFS=y
 # CONFIG_DEVFS_FS is not set
 CONFIG_DEVPTS_FS_XATTR=y
 # CONFIG_DEVPTS_FS_SECURITY is not set
@@ -527,9 +518,9 @@ CONFIG_SUNRPC_GSS=m
 CONFIG_RPCSEC_GSS_KRB5=m
 # CONFIG_SMB_FS is not set
 CONFIG_CIFS=m
+# CONFIG_CIFS_STATS is not set
 # CONFIG_NCP_FS is not set
 # CONFIG_CODA_FS is not set
-# CONFIG_INTERMEZZO_FS is not set
 CONFIG_AFS_FS=m
 CONFIG_RXRPC=m
 
@@ -641,11 +632,13 @@ CONFIG_CRYPTO_CAST6=m
 CONFIG_CRYPTO_ARC4=m
 CONFIG_CRYPTO_DEFLATE=y
 CONFIG_CRYPTO_MICHAEL_MIC=m
+CONFIG_CRYPTO_CRC32C=m
 # CONFIG_CRYPTO_TEST is not set
 
 #
 # Library routines
 #
 CONFIG_CRC32=y
+CONFIG_LIBCRC32C=m
 CONFIG_ZLIB_INFLATE=y
 CONFIG_ZLIB_DEFLATE=y
diff --git a/arch/sparc/kernel/init_task.c b/arch/sparc/kernel/init_task.c
index 76f53648c..af81a999f 100644
--- a/arch/sparc/kernel/init_task.c
+++ b/arch/sparc/kernel/init_task.c
@@ -2,6 +2,7 @@
 #include <linux/module.h>
 #include <linux/sched.h>
 #include <linux/init_task.h>
+#include <linux/mqueue.h>
 
 #include <asm/pgtable.h>
 #include <asm/uaccess.h>
diff --git a/arch/sparc/kernel/ioport.c b/arch/sparc/kernel/ioport.c
index c47650d7f..5b4a0e194 100644
--- a/arch/sparc/kernel/ioport.c
+++ b/arch/sparc/kernel/ioport.c
@@ -41,7 +41,7 @@
 #include <asm/oplib.h>
 #include <asm/page.h>
 #include <asm/pgalloc.h>
-#include <asm/pgtable.h>
+#include <asm/dma.h>
 
 #define mmu_inval_dma_area(p, l)	/* Anton pulled it out for 2.4.0-xx */
 
@@ -725,7 +725,7 @@ _sparc_find_resource(struct resource *root, unsigned long hit)
 void register_proc_sparc_ioport(void)
 {
 #ifdef CONFIG_PROC_FS
-	create_proc_read_entry("io_map",0,0,_sparc_io_get_info,&sparc_iomap);
-	create_proc_read_entry("dvma_map",0,0,_sparc_io_get_info,&_sparc_dvma);
+	create_proc_read_entry("io_map",0,NULL,_sparc_io_get_info,&sparc_iomap);
+	create_proc_read_entry("dvma_map",0,NULL,_sparc_io_get_info,&_sparc_dvma);
 #endif
 }
diff --git a/arch/sparc/kernel/irq.c b/arch/sparc/kernel/irq.c
index 6b1698b5a..cfabf35ee 100644
--- a/arch/sparc/kernel/irq.c
+++ b/arch/sparc/kernel/irq.c
@@ -336,7 +336,7 @@ void handler_irq(int irq, struct pt_regs * regs)
 	kstat_cpu(cpu).irqs[irq]++;
 	do {
 		if (!action || !action->handler)
-			unexpected_irq(irq, 0, regs);
+			unexpected_irq(irq, NULL, regs);
 		action->handler(irq, action->dev_id, regs);
 		action = action->next;
 	} while (action);
@@ -449,7 +449,7 @@ int request_fast_irq(unsigned int irq,
 
 	action->handler = handler;
 	action->flags = irqflags;
-	action->mask = 0;
+	cpus_clear(action->mask);
 	action->name = devname;
 	action->dev_id = NULL;
 	action->next = NULL;
@@ -529,7 +529,7 @@ int request_irq(unsigned int irq,
 
 	action->handler = handler;
 	action->flags = irqflags;
-	action->mask = 0;
+	cpus_clear(action->mask);
 	action->name = devname;
 	action->next = NULL;
 	action->dev_id = dev_id;
diff --git a/arch/sparc/kernel/process.c b/arch/sparc/kernel/process.c
index 277883d6c..4ff019336 100644
--- a/arch/sparc/kernel/process.c
+++ b/arch/sparc/kernel/process.c
@@ -628,7 +628,7 @@ int dump_fpu (struct pt_regs * regs, elf_fpregset_t * fpregs)
 		       &current->thread.fpqueue[0], &current->thread.fpqdepth);
 		if (regs != NULL) {
 			regs->psr &= ~(PSR_EF);
-			last_task_used_math = 0;
+			last_task_used_math = NULL;
 		}
 	}
 #endif
diff --git a/arch/sparc/kernel/setup.c b/arch/sparc/kernel/setup.c
index e4558e7f0..7bc43b4c0 100644
--- a/arch/sparc/kernel/setup.c
+++ b/arch/sparc/kernel/setup.c
@@ -47,6 +47,7 @@
 #include <asm/hardirq.h>
 #include <asm/machines.h>
 #include <asm/cpudata.h>
+#include <asm/setup.h>
 
 struct screen_info screen_info = {
 	0, 0,			/* orig-x, orig-y */
@@ -233,7 +234,6 @@ extern void sun4c_probe_vac(void);
 extern char cputypval;
 extern unsigned long start, end;
 extern void panic_setup(char *, int *);
-extern void srmmu_end_memory(unsigned long, unsigned long *);
 
 extern unsigned short root_flags;
 extern unsigned short root_dev;
@@ -244,8 +244,7 @@ extern unsigned short ram_flags;
 
 extern int root_mountflags;
 
-char saved_command_line[256];
-char reboot_command[256];
+char reboot_command[COMMAND_LINE_SIZE];
 enum sparc_cpu sparc_cpu_model;
 
 struct tt_entry *sparc_ttable;
diff --git a/arch/sparc/kernel/signal.c b/arch/sparc/kernel/signal.c
index 68847c143..28edf9319 100644
--- a/arch/sparc/kernel/signal.c
+++ b/arch/sparc/kernel/signal.c
@@ -198,7 +198,7 @@ restore_fpu_state(struct pt_regs *regs, __siginfo_fpu_t __user *fpu)
 		regs->psr &= ~PSR_EF;
 #else
 	if (current == last_task_used_math) {
-		last_task_used_math = 0;
+		last_task_used_math = NULL;
 		regs->psr &= ~PSR_EF;
 	}
 #endif
@@ -439,7 +439,7 @@ setup_frame(struct sigaction *sa, struct pt_regs *regs, int signr, sigset_t *old
 	unsigned long pc = regs->pc;
 	unsigned long npc = regs->npc;
 	struct thread_info *tp = current_thread_info();
-	void *sig_address;
+	void __user *sig_address;
 	int sig_code;
 
 	synchronize_user_stack();
@@ -570,7 +570,7 @@ save_fpu_state(struct pt_regs *regs, __siginfo_fpu_t __user *fpu)
 		put_psr(get_psr() | PSR_EF);
 		fpsave(&current->thread.float_regs[0], &current->thread.fsr,
 		       &current->thread.fpqueue[0], &current->thread.fpqdepth);
-		last_task_used_math = 0;
+		last_task_used_math = NULL;
 		regs->psr &= ~(PSR_EF);
 	}
 #endif
diff --git a/arch/sparc/kernel/smp.c b/arch/sparc/kernel/smp.c
index cb2399ee4..46591a15e 100644
--- a/arch/sparc/kernel/smp.c
+++ b/arch/sparc/kernel/smp.c
@@ -45,6 +45,7 @@ int smp_activated = 0;
 volatile int __cpu_number_map[NR_CPUS];
 volatile int __cpu_logical_map[NR_CPUS];
 cycles_t cacheflush_time = 0; /* XXX */
+unsigned long cache_decay_ticks = 100;
 
 cpumask_t cpu_online_map = CPU_MASK_NONE;
 cpumask_t phys_cpu_present_map = CPU_MASK_NONE;
@@ -127,7 +128,9 @@ void smp_flush_tlb_all(void)
 void smp_flush_cache_mm(struct mm_struct *mm)
 {
 	if(mm->context != NO_CONTEXT) {
-		if(mm->cpu_vm_mask != (1 << smp_processor_id()))
+		cpumask_t cpu_mask = mm->cpu_vm_mask;
+		cpu_clear(smp_processor_id(), cpu_mask);
+		if (!cpus_empty(cpu_mask))
 			xc1((smpfunc_t) BTFIXUP_CALL(local_flush_cache_mm), (unsigned long) mm);
 		local_flush_cache_mm(mm);
 	}
@@ -136,10 +139,12 @@ void smp_flush_cache_mm(struct mm_struct *mm)
 void smp_flush_tlb_mm(struct mm_struct *mm)
 {
 	if(mm->context != NO_CONTEXT) {
-		if(mm->cpu_vm_mask != (1 << smp_processor_id())) {
+		cpumask_t cpu_mask = mm->cpu_vm_mask;
+		cpu_clear(smp_processor_id(), cpu_mask);
+		if (!cpus_empty(cpu_mask)) {
 			xc1((smpfunc_t) BTFIXUP_CALL(local_flush_tlb_mm), (unsigned long) mm);
 			if(atomic_read(&mm->mm_users) == 1 && current->active_mm == mm)
-				mm->cpu_vm_mask = (1 << smp_processor_id());
+				mm->cpu_vm_mask = cpumask_of_cpu(smp_processor_id());
 		}
 		local_flush_tlb_mm(mm);
 	}
@@ -151,7 +156,9 @@ void smp_flush_cache_range(struct vm_area_struct *vma, unsigned long start,
 	struct mm_struct *mm = vma->vm_mm;
 
 	if (mm->context != NO_CONTEXT) {
-		if(mm->cpu_vm_mask != (1 << smp_processor_id()))
+		cpumask_t cpu_mask = mm->cpu_vm_mask;
+		cpu_clear(smp_processor_id(), cpu_mask);
+		if (!cpus_empty(cpu_mask))
 			xc3((smpfunc_t) BTFIXUP_CALL(local_flush_cache_range), (unsigned long) vma, start, end);
 		local_flush_cache_range(vma, start, end);
 	}
@@ -163,7 +170,9 @@ void smp_flush_tlb_range(struct vm_area_struct *vma, unsigned long start,
 	struct mm_struct *mm = vma->vm_mm;
 
 	if (mm->context != NO_CONTEXT) {
-		if(mm->cpu_vm_mask != (1 << smp_processor_id()))
+		cpumask_t cpu_mask = mm->cpu_vm_mask;
+		cpu_clear(smp_processor_id(), cpu_mask);
+		if (!cpus_empty(cpu_mask))
 			xc3((smpfunc_t) BTFIXUP_CALL(local_flush_tlb_range), (unsigned long) vma, start, end);
 		local_flush_tlb_range(vma, start, end);
 	}
@@ -174,7 +183,9 @@ void smp_flush_cache_page(struct vm_area_struct *vma, unsigned long page)
 	struct mm_struct *mm = vma->vm_mm;
 
 	if(mm->context != NO_CONTEXT) {
-		if(mm->cpu_vm_mask != (1 << smp_processor_id()))
+		cpumask_t cpu_mask = mm->cpu_vm_mask;
+		cpu_clear(smp_processor_id(), cpu_mask);
+		if (!cpus_empty(cpu_mask))
 			xc2((smpfunc_t) BTFIXUP_CALL(local_flush_cache_page), (unsigned long) vma, page);
 		local_flush_cache_page(vma, page);
 	}
@@ -185,12 +196,19 @@ void smp_flush_tlb_page(struct vm_area_struct *vma, unsigned long page)
 	struct mm_struct *mm = vma->vm_mm;
 
 	if(mm->context != NO_CONTEXT) {
-		if(mm->cpu_vm_mask != (1 << smp_processor_id()))
+		cpumask_t cpu_mask = mm->cpu_vm_mask;
+		cpu_clear(smp_processor_id(), cpu_mask);
+		if (!cpus_empty(cpu_mask))
 			xc2((smpfunc_t) BTFIXUP_CALL(local_flush_tlb_page), (unsigned long) vma, page);
 		local_flush_tlb_page(vma, page);
 	}
 }
 
+void smp_reschedule_irq(void)
+{
+	set_need_resched();
+}
+
 void smp_flush_page_to_ram(unsigned long page)
 {
 	/* Current theory is that those who call this are the one's
@@ -207,7 +225,9 @@ void smp_flush_page_to_ram(unsigned long page)
 
 void smp_flush_sig_insns(struct mm_struct *mm, unsigned long insn_addr)
 {
-	if(mm->cpu_vm_mask != (1 << smp_processor_id()))
+	cpumask_t cpu_mask = mm->cpu_vm_mask;
+	cpu_clear(smp_processor_id(), cpu_mask);
+	if (!cpus_empty(cpu_mask))
 		xc2((smpfunc_t) BTFIXUP_CALL(local_flush_sig_insns), (unsigned long) mm, insn_addr);
 	local_flush_sig_insns(mm, insn_addr);
 }
diff --git a/arch/sparc/kernel/sparc_ksyms.c b/arch/sparc/kernel/sparc_ksyms.c
index 601c97a31..fdaacfa47 100644
--- a/arch/sparc/kernel/sparc_ksyms.c
+++ b/arch/sparc/kernel/sparc_ksyms.c
@@ -11,6 +11,7 @@
 
 #include <linux/config.h>
 #include <linux/module.h>
+#include <linux/init.h>
 #include <linux/smp.h>
 #include <linux/types.h>
 #include <linux/string.h>
@@ -74,7 +75,6 @@ extern void *__memscan_zero(void *, size_t);
 extern void *__memscan_generic(void *, int, size_t);
 extern int __memcmp(const void *, const void *, __kernel_size_t);
 extern int __strncmp(const char *, const char *, __kernel_size_t);
-extern char saved_command_line[];
 
 extern void bcopy (const char *, char *, int);
 extern int __ashrdi3(int, int);
diff --git a/arch/sparc/kernel/sun4c_irq.c b/arch/sparc/kernel/sun4c_irq.c
index ca790d4cc..96ca38871 100644
--- a/arch/sparc/kernel/sun4c_irq.c
+++ b/arch/sparc/kernel/sun4c_irq.c
@@ -50,7 +50,7 @@ static struct resource sun4c_intr_eb = { "sun4c_intr" };
  *
  * so don't go making it static, like I tried. sigh.
  */
-unsigned char *interrupt_enable = 0;
+unsigned char *interrupt_enable = NULL;
 
 static int sun4c_pil_map[] = { 0, 1, 2, 3, 5, 7, 8, 9 };
 
diff --git a/arch/sparc/kernel/sun4d_irq.c b/arch/sparc/kernel/sun4d_irq.c
index 5e9a705c1..81223f882 100644
--- a/arch/sparc/kernel/sun4d_irq.c
+++ b/arch/sparc/kernel/sun4d_irq.c
@@ -216,7 +216,7 @@ void sun4d_handler_irq(int irq, struct pt_regs * regs)
 	if (!sbusl) {
 		action = *(irq + irq_action);
 		if (!action)
-			unexpected_irq(irq, 0, regs);
+			unexpected_irq(irq, NULL, regs);
 		do {
 			action->handler(irq, action->dev_id, regs);
 			action = action->next;
@@ -243,7 +243,7 @@ void sun4d_handler_irq(int irq, struct pt_regs * regs)
 						action = actionp->action;
 						
 						if (!action)
-							unexpected_irq(irq, 0, regs);
+							unexpected_irq(irq, NULL, regs);
 						do {
 							action->handler(irq, action->dev_id, regs);
 							action = action->next;
@@ -336,7 +336,7 @@ int sun4d_request_irq(unsigned int irq,
 
 	action->handler = handler;
 	action->flags = irqflags;
-	action->mask = 0;
+	cpus_clear(action->mask);
 	action->name = devname;
 	action->next = NULL;
 	action->dev_id = dev_id;
diff --git a/arch/sparc/kernel/sun4d_smp.c b/arch/sparc/kernel/sun4d_smp.c
index e5e134903..9f659c2f4 100644
--- a/arch/sparc/kernel/sun4d_smp.c
+++ b/arch/sparc/kernel/sun4d_smp.c
@@ -43,7 +43,6 @@ extern ctxd_t *srmmu_ctx_table_phys;
 extern void calibrate_delay(void);
 
 extern volatile int smp_processors_ready;
-extern unsigned long cpu_present_map;
 extern int smp_num_cpus;
 static int smp_highest_cpu;
 extern int smp_threads_ready;
@@ -100,8 +99,6 @@ void __init smp4d_callin(void)
 	 * the SMP initialization the master will be just allowed
 	 * to call the scheduler code.
 	 */
-	init_idle();
-
 	/* Get our local ticker going. */
 	smp_setup_percpu_timer();
 
@@ -152,7 +149,6 @@ void __init smp4d_callin(void)
 extern int cpu_idle(void *unused);
 extern void init_IRQ(void);
 extern void cpu_panic(void);
-extern int start_secondary(void *unused);
 
 /*
  *	Cycle through the processors asking the PROM to start each one.
@@ -174,12 +170,12 @@ void __init smp4d_boot_cpus(void)
 		current_set[0] = NULL;
 
 	local_irq_enable();
-	cpu_present_map = 0;
+	cpus_clear(cpu_present_map);
 
 	/* XXX This whole thing has to go.  See sparc64. */
 	for (i = 0; !cpu_find_by_instance(i, NULL, &mid); i++)
-		cpu_present_map |= (1<<mid);
-	SMP_PRINTK(("cpu_present_map %08lx\n", cpu_present_map));
+		cpu_set(mid, cpu_present_map);
+	SMP_PRINTK(("cpu_present_map %08lx\n", cpus_addr(cpu_present_map)[0]));
 	for(i=0; i < NR_CPUS; i++)
 		__cpu_number_map[i] = -1;
 	for(i=0; i < NR_CPUS; i++)
@@ -197,7 +193,7 @@ void __init smp4d_boot_cpus(void)
 		if(i == boot_cpu_id)
 			continue;
 
-		if(cpu_present_map & (1 << i)) {
+		if (cpu_isset(i, cpu_present_map)) {
 			extern unsigned long sun4d_cpu_startup;
 			unsigned long *entry = &sun4d_cpu_startup;
 			struct task_struct *p;
@@ -254,19 +250,19 @@ void __init smp4d_boot_cpus(void)
 			}
 		}
 		if(!(cpu_callin_map[i])) {
-			cpu_present_map &= ~(1 << i);
+			cpu_clear(i, cpu_present_map);
 			__cpu_number_map[i] = -1;
 		}
 	}
 	local_flush_cache_all();
 	if(cpucount == 0) {
 		printk("Error: only one Processor found.\n");
-		cpu_present_map = (1 << hard_smp4d_processor_id());
+		cpu_present_map = cpumask_of_cpu(hard_smp4d_processor_id());
 	} else {
 		unsigned long bogosum = 0;
 		
 		for(i = 0; i < NR_CPUS; i++) {
-			if(cpu_present_map & (1 << i)) {
+			if (cpu_isset(i, cpu_present_map)) {
 				bogosum += cpu_data(i).udelay_val;
 				smp_highest_cpu = i;
 			}
@@ -346,12 +342,13 @@ void smp4d_cross_call(smpfunc_t func, unsigned long arg1, unsigned long arg2,
 
 		/* Init receive/complete mapping, plus fire the IPI's off. */
 		{
-			register unsigned long mask;
+			cpumask_t mask;
 			register int i;
 
-			mask = (cpu_present_map & ~(1 << hard_smp4d_processor_id()));
+			mask = cpumask_of_cpu(hard_smp4d_processor_id());
+			cpus_andnot(mask, cpu_present_map, mask);
 			for(i = 0; i <= high; i++) {
-				if(mask & (1 << i)) {
+				if (cpu_isset(i, mask)) {
 					ccall_info.processors_in[i] = 0;
 					ccall_info.processors_out[i] = 0;
 					sun4d_send_ipi(i, IRQ_CROSS_CALL);
@@ -498,11 +495,11 @@ void __init sun4d_init_smp(void)
 	t_nmi[1] = t_nmi[1] + (linux_trap_ipi15_sun4d - linux_trap_ipi15_sun4m);
 	
 	/* And set btfixup... */
-	BTFIXUPSET_BLACKBOX(smp_processor_id, smp4d_blackbox_id);
+	BTFIXUPSET_BLACKBOX(hard_smp_processor_id, smp4d_blackbox_id);
 	BTFIXUPSET_BLACKBOX(load_current, smp4d_blackbox_current);
 	BTFIXUPSET_CALL(smp_cross_call, smp4d_cross_call, BTFIXUPCALL_NORM);
 	BTFIXUPSET_CALL(smp_message_pass, smp4d_message_pass, BTFIXUPCALL_NORM);
-	BTFIXUPSET_CALL(__smp_processor_id, __smp4d_processor_id, BTFIXUPCALL_NORM);
+	BTFIXUPSET_CALL(__hard_smp_processor_id, __smp4d_processor_id, BTFIXUPCALL_NORM);
 	
 	for (i = 0; i < NR_CPUS; i++) {
 		ccall_info.processors_in[i] = 1;
diff --git a/arch/sparc/kernel/sun4m_smp.c b/arch/sparc/kernel/sun4m_smp.c
index 65bb10ff3..f2fc64edc 100644
--- a/arch/sparc/kernel/sun4m_smp.c
+++ b/arch/sparc/kernel/sun4m_smp.c
@@ -40,7 +40,6 @@ extern ctxd_t *srmmu_ctx_table_phys;
 extern void calibrate_delay(void);
 
 extern volatile int smp_processors_ready;
-extern unsigned long cpu_present_map;
 extern int smp_num_cpus;
 extern int smp_threads_ready;
 extern volatile unsigned long cpu_callin_map[NR_CPUS];
@@ -96,8 +95,6 @@ void __init smp4m_callin(void)
 	 * the SMP initialization the master will be just allowed
 	 * to call the scheduler code.
 	 */
-	init_idle();
-
 	/* Allow master to continue. */
 	swap((unsigned long *)&cpu_callin_map[cpuid], 1);
 
@@ -127,7 +124,6 @@ void __init smp4m_callin(void)
 extern int cpu_idle(void *unused);
 extern void init_IRQ(void);
 extern void cpu_panic(void);
-extern int start_secondary(void *unused);
 
 /*
  *	Cycle through the processors asking the PROM to start each one.
@@ -146,10 +142,10 @@ void __init smp4m_boot_cpus(void)
 	printk("Entering SMP Mode...\n");
 
 	local_irq_enable();
-	cpu_present_map = 0;
+	cpus_clear(cpu_present_map);
 
 	for (i = 0; !cpu_find_by_instance(i, NULL, &mid); i++)
-		cpu_present_map |= (1<<mid);
+		cpu_set(mid, cpu_present_map);
 
 	for(i=0; i < NR_CPUS; i++) {
 		__cpu_number_map[i] = -1;
@@ -170,7 +166,7 @@ void __init smp4m_boot_cpus(void)
 		if(i == boot_cpu_id)
 			continue;
 
-		if(cpu_present_map & (1 << i)) {
+		if (cpu_isset(i, cpu_present_map)) {
 			extern unsigned long sun4m_cpu_startup;
 			unsigned long *entry = &sun4m_cpu_startup;
 			struct task_struct *p;
@@ -223,18 +219,18 @@ void __init smp4m_boot_cpus(void)
 			}
 		}
 		if(!(cpu_callin_map[i])) {
-			cpu_present_map &= ~(1 << i);
+			cpu_clear(i, cpu_present_map);
 			__cpu_number_map[i] = -1;
 		}
 	}
 	local_flush_cache_all();
 	if(cpucount == 0) {
 		printk("Error: only one Processor found.\n");
-		cpu_present_map = (1 << smp_processor_id());
+		cpu_present_map = cpumask_of_cpu(smp_processor_id());
 	} else {
 		unsigned long bogosum = 0;
 		for(i = 0; i < NR_CPUS; i++) {
-			if(cpu_present_map & (1 << i))
+			if (cpu_isset(i, cpu_present_map))
 				bogosum += cpu_data(i).udelay_val;
 		}
 		printk("Total of %d Processors activated (%lu.%02lu BogoMIPS).\n",
@@ -246,21 +242,21 @@ void __init smp4m_boot_cpus(void)
 	}
 
 	/* Free unneeded trap tables */
-	if (!(cpu_present_map & (1 << 1))) {
+	if (!cpu_isset(i, cpu_present_map)) {
 		ClearPageReserved(virt_to_page(trapbase_cpu1));
 		set_page_count(virt_to_page(trapbase_cpu1), 1);
 		free_page((unsigned long)trapbase_cpu1);
 		totalram_pages++;
 		num_physpages++;
 	}
-	if (!(cpu_present_map & (1 << 2))) {
+	if (!cpu_isset(2, cpu_present_map)) {
 		ClearPageReserved(virt_to_page(trapbase_cpu2));
 		set_page_count(virt_to_page(trapbase_cpu2), 1);
 		free_page((unsigned long)trapbase_cpu2);
 		totalram_pages++;
 		num_physpages++;
 	}
-	if (!(cpu_present_map & (1 << 3))) {
+	if (!cpu_isset(3, cpu_present_map)) {
 		ClearPageReserved(virt_to_page(trapbase_cpu3));
 		set_page_count(virt_to_page(trapbase_cpu3), 1);
 		free_page((unsigned long)trapbase_cpu3);
@@ -289,7 +285,7 @@ void smp4m_irq_rotate(int cpu)
 void smp4m_message_pass(int target, int msg, unsigned long data, int wait)
 {
 	static unsigned long smp_cpu_in_msg[NR_CPUS];
-	unsigned long mask;
+	cpumask_t mask;
 	int me = smp_processor_id();
 	int irq, i;
 
@@ -308,9 +304,9 @@ void smp4m_message_pass(int target, int msg, unsigned long data, int wait)
 	if(target == MSG_ALL_BUT_SELF || target == MSG_ALL) {
 		mask = cpu_present_map;
 		if(target == MSG_ALL_BUT_SELF)
-			mask &= ~(1 << me);
+			cpu_clear(me, mask);
 		for(i = 0; i < 4; i++) {
-			if(mask & (1 << i))
+			if (cpu_isset(i, mask))
 				set_cpu_int(i, irq);
 		}
 	} else {
@@ -357,12 +353,12 @@ void smp4m_cross_call(smpfunc_t func, unsigned long arg1, unsigned long arg2,
 
 		/* Init receive/complete mapping, plus fire the IPI's off. */
 		{
-			register unsigned long mask;
+			cpumask_t mask = cpu_present_map;
 			register int i;
 
-			mask = (cpu_present_map & ~(1 << smp_processor_id()));
+			cpu_clear(smp_processor_id(), mask);
 			for(i = 0; i < ncpus; i++) {
-				if(mask & (1 << i)) {
+				if (cpu_isset(i, mask)) {
 					ccall_info.processors_in[i] = 0;
 					ccall_info.processors_out[i] = 0;
 					set_cpu_int(i, IRQ_CROSS_CALL);
@@ -461,9 +457,9 @@ void __init smp4m_blackbox_current(unsigned *addr)
 
 void __init sun4m_init_smp(void)
 {
-	BTFIXUPSET_BLACKBOX(smp_processor_id, smp4m_blackbox_id);
+	BTFIXUPSET_BLACKBOX(hard_smp_processor_id, smp4m_blackbox_id);
 	BTFIXUPSET_BLACKBOX(load_current, smp4m_blackbox_current);
 	BTFIXUPSET_CALL(smp_cross_call, smp4m_cross_call, BTFIXUPCALL_NORM);
 	BTFIXUPSET_CALL(smp_message_pass, smp4m_message_pass, BTFIXUPCALL_NORM);
-	BTFIXUPSET_CALL(__smp_processor_id, __smp4m_processor_id, BTFIXUPCALL_NORM);
+	BTFIXUPSET_CALL(__hard_smp_processor_id, __smp4m_processor_id, BTFIXUPCALL_NORM);
 }
diff --git a/arch/sparc/kernel/sun4setup.c b/arch/sparc/kernel/sun4setup.c
index 8aae2f85d..229a52f55 100644
--- a/arch/sparc/kernel/sun4setup.c
+++ b/arch/sparc/kernel/sun4setup.c
@@ -69,6 +69,7 @@ void __init sun4setup(void)
 			sun4_esp_physaddr=SUN4_400_ESP_PHYSADDR;
 			break;
 		default:
+			;
 	}
 }
 
diff --git a/arch/sparc/kernel/sys_sparc.c b/arch/sparc/kernel/sys_sparc.c
index 50140f4dd..07879079a 100644
--- a/arch/sparc/kernel/sys_sparc.c
+++ b/arch/sparc/kernel/sys_sparc.c
@@ -376,7 +376,7 @@ sparc_breakpoint (struct pt_regs *regs)
 	info.si_signo = SIGTRAP;
 	info.si_errno = 0;
 	info.si_code = TRAP_BRKPT;
-	info.si_addr = (void *)regs->pc;
+	info.si_addr = (void __user *)regs->pc;
 	info.si_trapno = 0;
 	force_sig_info(SIGTRAP, &info, current);
 
diff --git a/arch/sparc/kernel/sys_sunos.c b/arch/sparc/kernel/sys_sunos.c
index 6b2bccee7..b248f0576 100644
--- a/arch/sparc/kernel/sys_sunos.c
+++ b/arch/sparc/kernel/sys_sunos.c
@@ -97,7 +97,7 @@ asmlinkage unsigned long sunos_mmap(unsigned long addr, unsigned long len,
 		    iminor(file->f_dentry->d_inode) == 5) {
 			flags |= MAP_ANONYMOUS;
 			fput(file);
-			file = 0;
+			file = NULL;
 		}
 	}
 	ret_type = flags & _MAP_NEW;
@@ -505,7 +505,7 @@ asmlinkage int sunos_nosys(void)
 	info.si_signo = SIGSYS;
 	info.si_errno = 0;
 	info.si_code = __SI_FAULT|0x100;
-	info.si_addr = (void *)regs->pc;
+	info.si_addr = (void __user *)regs->pc;
 	info.si_trapno = regs->u_regs[UREG_G1];
 	send_sig_info(SIGSYS, &info, current);
 	if (cnt++ < 4) {
@@ -755,7 +755,7 @@ sunos_mount(char __user *type, char __user *dir, int flags, void __user *data)
 {
 	int linux_flags = 0;
 	int ret = -EINVAL;
-	char *dev_fname = 0;
+	char *dev_fname = NULL;
 	char *dir_page, *type_page;
 
 	if (!capable (CAP_SYS_ADMIN))
diff --git a/arch/sparc/kernel/time.c b/arch/sparc/kernel/time.c
index fa99b0c60..bdec61be6 100644
--- a/arch/sparc/kernel/time.c
+++ b/arch/sparc/kernel/time.c
@@ -54,7 +54,7 @@ spinlock_t rtc_lock = SPIN_LOCK_UNLOCKED;
 enum sparc_clock_type sp_clock_typ;
 spinlock_t mostek_lock = SPIN_LOCK_UNLOCKED;
 unsigned long mstk48t02_regs = 0UL;
-static struct mostek48t08 *mstk48t08_regs = 0;
+static struct mostek48t08 *mstk48t08_regs = NULL;
 static int set_rtc_mmss(unsigned long);
 static int sbus_do_settimeofday(struct timespec *tv);
 
@@ -251,9 +251,9 @@ static __inline__ void sun4_clock_probe(void)
 		sp_clock_typ = MSTK48T02;
 		r.start = sun4_clock_physaddr;
 		mstk48t02_regs = sbus_ioremap(&r, 0,
-				       sizeof(struct mostek48t02), 0);
-		mstk48t08_regs = 0;  /* To catch weirdness */
-		intersil_clock = 0;  /* just in case */
+				       sizeof(struct mostek48t02), NULL);
+		mstk48t08_regs = NULL;  /* To catch weirdness */
+		intersil_clock = NULL;  /* just in case */
 
 		/* Kick start the clock if it is completely stopped. */
 		if (mostek_read(mstk48t02_regs + MOSTEK_SEC) & MSTK_STOP)
@@ -266,7 +266,7 @@ static __inline__ void sun4_clock_probe(void)
 		intersil_clock = (struct intersil *) 
 		    sbus_ioremap(&r, 0, sizeof(*intersil_clock), "intersil");
 		mstk48t02_regs = 0;  /* just be sure */
-		mstk48t08_regs = 0;  /* ditto */
+		mstk48t08_regs = NULL;  /* ditto */
 		/* initialise the clock */
 
 		intersil_intr(intersil_clock,INTERSIL_INT_100HZ);
@@ -340,7 +340,7 @@ static __inline__ void clock_probe(void)
 		r.start = clk_reg[0].phys_addr;
 		mstk48t02_regs = sbus_ioremap(&r, 0,
 		    sizeof(struct mostek48t02), "mk48t02");
-		mstk48t08_regs = 0;  /* To catch weirdness */
+		mstk48t08_regs = NULL;  /* To catch weirdness */
 	} else if (strcmp(model, "mk48t08") == 0) {
 		sp_clock_typ = MSTK48T08;
 		if(prom_getproperty(node, "reg", (char *) clk_reg,
diff --git a/arch/sparc/kernel/trampoline.S b/arch/sparc/kernel/trampoline.S
index 1db353f46..2dcdaa1fd 100644
--- a/arch/sparc/kernel/trampoline.S
+++ b/arch/sparc/kernel/trampoline.S
@@ -88,8 +88,6 @@ cpu3_startup:
 	.align	4
 
 smp_do_cpu_idle:
-	call	init_idle
-	 nop
 	call	cpu_idle
 	 mov	0, %o0
 
diff --git a/arch/sparc/kernel/traps.c b/arch/sparc/kernel/traps.c
index 136a00c7b..ceb4a8f29 100644
--- a/arch/sparc/kernel/traps.c
+++ b/arch/sparc/kernel/traps.c
@@ -147,7 +147,7 @@ void do_hw_interrupt(struct pt_regs *regs, unsigned long type)
 	info.si_signo = SIGILL;
 	info.si_errno = 0;
 	info.si_code = ILL_ILLTRP;
-	info.si_addr = (void *)regs->pc;
+	info.si_addr = (void __user *)regs->pc;
 	info.si_trapno = type - 0x80;
 	force_sig_info(SIGILL, &info, current);
 }
@@ -170,7 +170,7 @@ void do_illegal_instruction(struct pt_regs *regs, unsigned long pc, unsigned lon
 	info.si_signo = SIGILL;
 	info.si_errno = 0;
 	info.si_code = ILL_ILLOPC;
-	info.si_addr = (void *)pc;
+	info.si_addr = (void __user *)pc;
 	info.si_trapno = 0;
 	send_sig_info(SIGILL, &info, current);
 }
@@ -185,7 +185,7 @@ void do_priv_instruction(struct pt_regs *regs, unsigned long pc, unsigned long n
 	info.si_signo = SIGILL;
 	info.si_errno = 0;
 	info.si_code = ILL_PRVOPC;
-	info.si_addr = (void *)pc;
+	info.si_addr = (void __user *)pc;
 	info.si_trapno = 0;
 	send_sig_info(SIGILL, &info, current);
 }
@@ -354,7 +354,7 @@ void do_fpe_trap(struct pt_regs *regs, unsigned long pc, unsigned long npc,
 	fsr = fpt->thread.fsr;
 	info.si_signo = SIGFPE;
 	info.si_errno = 0;
-	info.si_addr = (void *)pc;
+	info.si_addr = (void __user *)pc;
 	info.si_trapno = 0;
 	info.si_code = __SI_FAULT;
 	if ((fsr & 0x1c000) == (1 << 14)) {
@@ -388,7 +388,7 @@ void handle_tag_overflow(struct pt_regs *regs, unsigned long pc, unsigned long n
 	info.si_signo = SIGEMT;
 	info.si_errno = 0;
 	info.si_code = EMT_TAGOVF;
-	info.si_addr = (void *)pc;
+	info.si_addr = (void __user *)pc;
 	info.si_trapno = 0;
 	send_sig_info(SIGEMT, &info, current);
 }
@@ -417,7 +417,7 @@ void handle_reg_access(struct pt_regs *regs, unsigned long pc, unsigned long npc
 	info.si_signo = SIGBUS;
 	info.si_errno = 0;
 	info.si_code = BUS_OBJERR;
-	info.si_addr = (void *)pc;
+	info.si_addr = (void __user *)pc;
 	info.si_trapno = 0;
 	force_sig_info(SIGBUS, &info, current);
 }
@@ -430,7 +430,7 @@ void handle_cp_disabled(struct pt_regs *regs, unsigned long pc, unsigned long np
 	info.si_signo = SIGILL;
 	info.si_errno = 0;
 	info.si_code = ILL_COPROC;
-	info.si_addr = (void *)pc;
+	info.si_addr = (void __user *)pc;
 	info.si_trapno = 0;
 	send_sig_info(SIGILL, &info, current);
 }
@@ -447,7 +447,7 @@ void handle_cp_exception(struct pt_regs *regs, unsigned long pc, unsigned long n
 	info.si_signo = SIGILL;
 	info.si_errno = 0;
 	info.si_code = ILL_COPROC;
-	info.si_addr = (void *)pc;
+	info.si_addr = (void __user *)pc;
 	info.si_trapno = 0;
 	send_sig_info(SIGILL, &info, current);
 }
@@ -460,7 +460,7 @@ void handle_hw_divzero(struct pt_regs *regs, unsigned long pc, unsigned long npc
 	info.si_signo = SIGFPE;
 	info.si_errno = 0;
 	info.si_code = FPE_INTDIV;
-	info.si_addr = (void *)pc;
+	info.si_addr = (void __user *)pc;
 	info.si_trapno = 0;
 	send_sig_info(SIGFPE, &info, current);
 }
diff --git a/arch/sparc/kernel/unaligned.c b/arch/sparc/kernel/unaligned.c
index a9a9e0c73..a40bbcfeb 100644
--- a/arch/sparc/kernel/unaligned.c
+++ b/arch/sparc/kernel/unaligned.c
@@ -473,7 +473,7 @@ void user_mna_trap_fault(struct pt_regs *regs, unsigned int insn)
 	info.si_signo = SIGBUS;
 	info.si_errno = 0;
 	info.si_code = BUS_ADRALN;
-	info.si_addr = (void *)safe_compute_effective_address(regs, insn);
+	info.si_addr = (void __user *)safe_compute_effective_address(regs, insn);
 	info.si_trapno = 0;
 	send_sig_info(SIGBUS, &info, current);
 }
diff --git a/arch/sparc/lib/copy_user.S b/arch/sparc/lib/copy_user.S
index 0924f829d..577505b69 100644
--- a/arch/sparc/lib/copy_user.S
+++ b/arch/sparc/lib/copy_user.S
@@ -64,52 +64,52 @@
 
 /* Both these macros have to start with exactly the same insn */
 #define MOVE_BIGCHUNK(src, dst, offset, t0, t1, t2, t3, t4, t5, t6, t7) \
-	ldd	[%src + offset + 0x00], %t0; \
-	ldd	[%src + offset + 0x08], %t2; \
-	ldd	[%src + offset + 0x10], %t4; \
-	ldd	[%src + offset + 0x18], %t6; \
-	st	%t0, [%dst + offset + 0x00]; \
-	st	%t1, [%dst + offset + 0x04]; \
-	st	%t2, [%dst + offset + 0x08]; \
-	st	%t3, [%dst + offset + 0x0c]; \
-	st	%t4, [%dst + offset + 0x10]; \
-	st	%t5, [%dst + offset + 0x14]; \
-	st	%t6, [%dst + offset + 0x18]; \
-	st	%t7, [%dst + offset + 0x1c];
+	ldd	[%src + (offset) + 0x00], %t0; \
+	ldd	[%src + (offset) + 0x08], %t2; \
+	ldd	[%src + (offset) + 0x10], %t4; \
+	ldd	[%src + (offset) + 0x18], %t6; \
+	st	%t0, [%dst + (offset) + 0x00]; \
+	st	%t1, [%dst + (offset) + 0x04]; \
+	st	%t2, [%dst + (offset) + 0x08]; \
+	st	%t3, [%dst + (offset) + 0x0c]; \
+	st	%t4, [%dst + (offset) + 0x10]; \
+	st	%t5, [%dst + (offset) + 0x14]; \
+	st	%t6, [%dst + (offset) + 0x18]; \
+	st	%t7, [%dst + (offset) + 0x1c];
 
 #define MOVE_BIGALIGNCHUNK(src, dst, offset, t0, t1, t2, t3, t4, t5, t6, t7) \
-	ldd	[%src + offset + 0x00], %t0; \
-	ldd	[%src + offset + 0x08], %t2; \
-	ldd	[%src + offset + 0x10], %t4; \
-	ldd	[%src + offset + 0x18], %t6; \
-	std	%t0, [%dst + offset + 0x00]; \
-	std	%t2, [%dst + offset + 0x08]; \
-	std	%t4, [%dst + offset + 0x10]; \
-	std	%t6, [%dst + offset + 0x18];
+	ldd	[%src + (offset) + 0x00], %t0; \
+	ldd	[%src + (offset) + 0x08], %t2; \
+	ldd	[%src + (offset) + 0x10], %t4; \
+	ldd	[%src + (offset) + 0x18], %t6; \
+	std	%t0, [%dst + (offset) + 0x00]; \
+	std	%t2, [%dst + (offset) + 0x08]; \
+	std	%t4, [%dst + (offset) + 0x10]; \
+	std	%t6, [%dst + (offset) + 0x18];
 
 #define MOVE_LASTCHUNK(src, dst, offset, t0, t1, t2, t3) \
-	ldd	[%src - offset - 0x10], %t0; \
-	ldd	[%src - offset - 0x08], %t2; \
-	st	%t0, [%dst - offset - 0x10]; \
-	st	%t1, [%dst - offset - 0x0c]; \
-	st	%t2, [%dst - offset - 0x08]; \
-	st	%t3, [%dst - offset - 0x04];
+	ldd	[%src - (offset) - 0x10], %t0; \
+	ldd	[%src - (offset) - 0x08], %t2; \
+	st	%t0, [%dst - (offset) - 0x10]; \
+	st	%t1, [%dst - (offset) - 0x0c]; \
+	st	%t2, [%dst - (offset) - 0x08]; \
+	st	%t3, [%dst - (offset) - 0x04];
 
 #define MOVE_HALFCHUNK(src, dst, offset, t0, t1, t2, t3) \
-	lduh	[%src + offset + 0x00], %t0; \
-	lduh	[%src + offset + 0x02], %t1; \
-	lduh	[%src + offset + 0x04], %t2; \
-	lduh	[%src + offset + 0x06], %t3; \
-	sth	%t0, [%dst + offset + 0x00]; \
-	sth	%t1, [%dst + offset + 0x02]; \
-	sth	%t2, [%dst + offset + 0x04]; \
-	sth	%t3, [%dst + offset + 0x06];
+	lduh	[%src + (offset) + 0x00], %t0; \
+	lduh	[%src + (offset) + 0x02], %t1; \
+	lduh	[%src + (offset) + 0x04], %t2; \
+	lduh	[%src + (offset) + 0x06], %t3; \
+	sth	%t0, [%dst + (offset) + 0x00]; \
+	sth	%t1, [%dst + (offset) + 0x02]; \
+	sth	%t2, [%dst + (offset) + 0x04]; \
+	sth	%t3, [%dst + (offset) + 0x06];
 
 #define MOVE_SHORTCHUNK(src, dst, offset, t0, t1) \
-	ldub	[%src - offset - 0x02], %t0; \
-	ldub	[%src - offset - 0x01], %t1; \
-	stb	%t0, [%dst - offset - 0x02]; \
-	stb	%t1, [%dst - offset - 0x01];
+	ldub	[%src - (offset) - 0x02], %t0; \
+	ldub	[%src - (offset) - 0x01], %t1; \
+	stb	%t0, [%dst - (offset) - 0x02]; \
+	stb	%t1, [%dst - (offset) - 0x01];
 
 	.text
 	.align	4
diff --git a/arch/sparc/lib/memcpy.S b/arch/sparc/lib/memcpy.S
index ed91f1e8c..eb6a9e759 100644
--- a/arch/sparc/lib/memcpy.S
+++ b/arch/sparc/lib/memcpy.S
@@ -42,124 +42,124 @@ x:
 #endif
 
 /* Both these macros have to start with exactly the same insn */
-#define MOVE_BIGCHUNK(src, dst, offset, t0, t1, t2, t3, t4, t5, t6, t7) 				\
-	ldd	[%src + offset + 0x00], %t0; 								\
-	ldd	[%src + offset + 0x08], %t2; 								\
-	ldd	[%src + offset + 0x10], %t4; 								\
-	ldd	[%src + offset + 0x18], %t6; 								\
-	st	%t0, [%dst + offset + 0x00]; 								\
-	st	%t1, [%dst + offset + 0x04]; 								\
-	st	%t2, [%dst + offset + 0x08]; 								\
-	st	%t3, [%dst + offset + 0x0c]; 								\
-	st	%t4, [%dst + offset + 0x10]; 								\
-	st	%t5, [%dst + offset + 0x14]; 								\
-	st	%t6, [%dst + offset + 0x18]; 								\
-	st	%t7, [%dst + offset + 0x1c];
-
-#define MOVE_BIGALIGNCHUNK(src, dst, offset, t0, t1, t2, t3, t4, t5, t6, t7) 				\
-	ldd	[%src + offset + 0x00], %t0; 								\
-	ldd	[%src + offset + 0x08], %t2; 								\
-	ldd	[%src + offset + 0x10], %t4; 								\
-	ldd	[%src + offset + 0x18], %t6; 								\
-	std	%t0, [%dst + offset + 0x00]; 								\
-	std	%t2, [%dst + offset + 0x08]; 								\
-	std	%t4, [%dst + offset + 0x10]; 								\
-	std	%t6, [%dst + offset + 0x18];
-
-#define MOVE_LASTCHUNK(src, dst, offset, t0, t1, t2, t3) 						\
-	ldd	[%src - offset - 0x10], %t0; 								\
-	ldd	[%src - offset - 0x08], %t2; 								\
-	st	%t0, [%dst - offset - 0x10]; 								\
-	st	%t1, [%dst - offset - 0x0c]; 								\
-	st	%t2, [%dst - offset - 0x08]; 								\
-	st	%t3, [%dst - offset - 0x04];
-
-#define MOVE_LASTALIGNCHUNK(src, dst, offset, t0, t1, t2, t3) 						\
-	ldd	[%src - offset - 0x10], %t0; 								\
-	ldd	[%src - offset - 0x08], %t2; 								\
-	std	%t0, [%dst - offset - 0x10]; 								\
-	std	%t2, [%dst - offset - 0x08];
-
-#define MOVE_SHORTCHUNK(src, dst, offset, t0, t1) 							\
-	ldub	[%src - offset - 0x02], %t0; 								\
-	ldub	[%src - offset - 0x01], %t1; 								\
-	stb	%t0, [%dst - offset - 0x02]; 								\
-	stb	%t1, [%dst - offset - 0x01];
+#define MOVE_BIGCHUNK(src, dst, offset, t0, t1, t2, t3, t4, t5, t6, t7) \
+	ldd	[%src + (offset) + 0x00], %t0; \
+	ldd	[%src + (offset) + 0x08], %t2; \
+	ldd	[%src + (offset) + 0x10], %t4; \
+	ldd	[%src + (offset) + 0x18], %t6; \
+	st	%t0, [%dst + (offset) + 0x00]; \
+	st	%t1, [%dst + (offset) + 0x04]; \
+	st	%t2, [%dst + (offset) + 0x08]; \
+	st	%t3, [%dst + (offset) + 0x0c]; \
+	st	%t4, [%dst + (offset) + 0x10]; \
+	st	%t5, [%dst + (offset) + 0x14]; \
+	st	%t6, [%dst + (offset) + 0x18]; \
+	st	%t7, [%dst + (offset) + 0x1c];
+
+#define MOVE_BIGALIGNCHUNK(src, dst, offset, t0, t1, t2, t3, t4, t5, t6, t7) \
+	ldd	[%src + (offset) + 0x00], %t0; \
+	ldd	[%src + (offset) + 0x08], %t2; \
+	ldd	[%src + (offset) + 0x10], %t4; \
+	ldd	[%src + (offset) + 0x18], %t6; \
+	std	%t0, [%dst + (offset) + 0x00]; \
+	std	%t2, [%dst + (offset) + 0x08]; \
+	std	%t4, [%dst + (offset) + 0x10]; \
+	std	%t6, [%dst + (offset) + 0x18];
+
+#define MOVE_LASTCHUNK(src, dst, offset, t0, t1, t2, t3) \
+	ldd	[%src - (offset) - 0x10], %t0; \
+	ldd	[%src - (offset) - 0x08], %t2; \
+	st	%t0, [%dst - (offset) - 0x10]; \
+	st	%t1, [%dst - (offset) - 0x0c]; \
+	st	%t2, [%dst - (offset) - 0x08]; \
+	st	%t3, [%dst - (offset) - 0x04];
+
+#define MOVE_LASTALIGNCHUNK(src, dst, offset, t0, t1, t2, t3) \
+	ldd	[%src - (offset) - 0x10], %t0; \
+	ldd	[%src - (offset) - 0x08], %t2; \
+	std	%t0, [%dst - (offset) - 0x10]; \
+	std	%t2, [%dst - (offset) - 0x08];
+
+#define MOVE_SHORTCHUNK(src, dst, offset, t0, t1) \
+	ldub	[%src - (offset) - 0x02], %t0; \
+	ldub	[%src - (offset) - 0x01], %t1; \
+	stb	%t0, [%dst - (offset) - 0x02]; \
+	stb	%t1, [%dst - (offset) - 0x01];
 
 /* Both these macros have to start with exactly the same insn */
-#define RMOVE_BIGCHUNK(src, dst, offset, t0, t1, t2, t3, t4, t5, t6, t7) 				\
-	ldd	[%src - offset - 0x20], %t0; 								\
-	ldd	[%src - offset - 0x18], %t2; 								\
-	ldd	[%src - offset - 0x10], %t4; 								\
-	ldd	[%src - offset - 0x08], %t6; 								\
-	st	%t0, [%dst - offset - 0x20]; 								\
-	st	%t1, [%dst - offset - 0x1c]; 								\
-	st	%t2, [%dst - offset - 0x18]; 								\
-	st	%t3, [%dst - offset - 0x14]; 								\
-	st	%t4, [%dst - offset - 0x10]; 								\
-	st	%t5, [%dst - offset - 0x0c]; 								\
-	st	%t6, [%dst - offset - 0x08]; 								\
-	st	%t7, [%dst - offset - 0x04];
-
-#define RMOVE_BIGALIGNCHUNK(src, dst, offset, t0, t1, t2, t3, t4, t5, t6, t7) 				\
-	ldd	[%src - offset - 0x20], %t0; 								\
-	ldd	[%src - offset - 0x18], %t2; 								\
-	ldd	[%src - offset - 0x10], %t4; 								\
-	ldd	[%src - offset - 0x08], %t6; 								\
-	std	%t0, [%dst - offset - 0x20]; 								\
-	std	%t2, [%dst - offset - 0x18]; 								\
-	std	%t4, [%dst - offset - 0x10]; 								\
-	std	%t6, [%dst - offset - 0x08];
-
-#define RMOVE_LASTCHUNK(src, dst, offset, t0, t1, t2, t3) 						\
-	ldd	[%src + offset + 0x00], %t0; 								\
-	ldd	[%src + offset + 0x08], %t2; 								\
-	st	%t0, [%dst + offset + 0x00]; 								\
-	st	%t1, [%dst + offset + 0x04]; 								\
-	st	%t2, [%dst + offset + 0x08]; 								\
-	st	%t3, [%dst + offset + 0x0c];
-
-#define RMOVE_SHORTCHUNK(src, dst, offset, t0, t1) 							\
-	ldub	[%src + offset + 0x00], %t0; 								\
-	ldub	[%src + offset + 0x01], %t1; 								\
-	stb	%t0, [%dst + offset + 0x00]; 								\
-	stb	%t1, [%dst + offset + 0x01];
-
-#define SMOVE_CHUNK(src, dst, offset, t0, t1, t2, t3, t4, t5, t6, prev, shil, shir, offset2) 		\
-	ldd	[%src + offset + 0x00], %t0; 								\
-	ldd	[%src + offset + 0x08], %t2; 								\
-	srl	%t0, shir, %t5; 									\
-	srl	%t1, shir, %t6; 									\
-	sll	%t0, shil, %t0; 									\
-	or	%t5, %prev, %t5; 									\
-	sll	%t1, shil, %prev; 									\
-	or	%t6, %t0, %t0; 										\
-	srl	%t2, shir, %t1; 									\
-	srl	%t3, shir, %t6; 									\
-	sll	%t2, shil, %t2; 									\
-	or	%t1, %prev, %t1; 									\
-	std	%t4, [%dst + offset + offset2 - 0x04]; 							\
-	std	%t0, [%dst + offset + offset2 + 0x04];							\
-	sll	%t3, shil, %prev; 									\
+#define RMOVE_BIGCHUNK(src, dst, offset, t0, t1, t2, t3, t4, t5, t6, t7) \
+	ldd	[%src - (offset) - 0x20], %t0; \
+	ldd	[%src - (offset) - 0x18], %t2; \
+	ldd	[%src - (offset) - 0x10], %t4; \
+	ldd	[%src - (offset) - 0x08], %t6; \
+	st	%t0, [%dst - (offset) - 0x20]; \
+	st	%t1, [%dst - (offset) - 0x1c]; \
+	st	%t2, [%dst - (offset) - 0x18]; \
+	st	%t3, [%dst - (offset) - 0x14]; \
+	st	%t4, [%dst - (offset) - 0x10]; \
+	st	%t5, [%dst - (offset) - 0x0c]; \
+	st	%t6, [%dst - (offset) - 0x08]; \
+	st	%t7, [%dst - (offset) - 0x04];
+
+#define RMOVE_BIGALIGNCHUNK(src, dst, offset, t0, t1, t2, t3, t4, t5, t6, t7) \
+	ldd	[%src - (offset) - 0x20], %t0; \
+	ldd	[%src - (offset) - 0x18], %t2; \
+	ldd	[%src - (offset) - 0x10], %t4; \
+	ldd	[%src - (offset) - 0x08], %t6; \
+	std	%t0, [%dst - (offset) - 0x20]; \
+	std	%t2, [%dst - (offset) - 0x18]; \
+	std	%t4, [%dst - (offset) - 0x10]; \
+	std	%t6, [%dst - (offset) - 0x08];
+
+#define RMOVE_LASTCHUNK(src, dst, offset, t0, t1, t2, t3) \
+	ldd	[%src + (offset) + 0x00], %t0; \
+	ldd	[%src + (offset) + 0x08], %t2; \
+	st	%t0, [%dst + (offset) + 0x00]; \
+	st	%t1, [%dst + (offset) + 0x04]; \
+	st	%t2, [%dst + (offset) + 0x08]; \
+	st	%t3, [%dst + (offset) + 0x0c];
+
+#define RMOVE_SHORTCHUNK(src, dst, offset, t0, t1) \
+	ldub	[%src + (offset) + 0x00], %t0; \
+	ldub	[%src + (offset) + 0x01], %t1; \
+	stb	%t0, [%dst + (offset) + 0x00]; \
+	stb	%t1, [%dst + (offset) + 0x01];
+
+#define SMOVE_CHUNK(src, dst, offset, t0, t1, t2, t3, t4, t5, t6, prev, shil, shir, offset2) \
+	ldd	[%src + (offset) + 0x00], %t0; \
+	ldd	[%src + (offset) + 0x08], %t2; \
+	srl	%t0, shir, %t5; \
+	srl	%t1, shir, %t6; \
+	sll	%t0, shil, %t0; \
+	or	%t5, %prev, %t5; \
+	sll	%t1, shil, %prev; \
+	or	%t6, %t0, %t0; \
+	srl	%t2, shir, %t1; \
+	srl	%t3, shir, %t6; \
+	sll	%t2, shil, %t2; \
+	or	%t1, %prev, %t1; \
+	std	%t4, [%dst + (offset) + (offset2) - 0x04]; \
+	std	%t0, [%dst + (offset) + (offset2) + 0x04]; \
+	sll	%t3, shil, %prev; \
 	or	%t6, %t2, %t4;
 
-#define SMOVE_ALIGNCHUNK(src, dst, offset, t0, t1, t2, t3, t4, t5, t6, prev, shil, shir, offset2) 	\
-	ldd	[%src + offset + 0x00], %t0; 								\
-	ldd	[%src + offset + 0x08], %t2; 								\
-	srl	%t0, shir, %t4; 									\
-	srl	%t1, shir, %t5; 									\
-	sll	%t0, shil, %t6; 									\
-	or	%t4, %prev, %t0; 									\
-	sll	%t1, shil, %prev; 									\
-	or	%t5, %t6, %t1; 										\
-	srl	%t2, shir, %t4; 									\
-	srl	%t3, shir, %t5; 									\
-	sll	%t2, shil, %t6; 									\
-	or	%t4, %prev, %t2; 									\
-	sll	%t3, shil, %prev; 									\
-	or	%t5, %t6, %t3;										\
-	std	%t0, [%dst + offset + offset2 + 0x00]; 							\
-	std	%t2, [%dst + offset + offset2 + 0x08];
+#define SMOVE_ALIGNCHUNK(src, dst, offset, t0, t1, t2, t3, t4, t5, t6, prev, shil, shir, offset2) \
+	ldd	[%src + (offset) + 0x00], %t0; \
+	ldd	[%src + (offset) + 0x08], %t2; \
+	srl	%t0, shir, %t4;	\
+	srl	%t1, shir, %t5;	\
+	sll	%t0, shil, %t6;	\
+	or	%t4, %prev, %t0; \
+	sll	%t1, shil, %prev; \
+	or	%t5, %t6, %t1; \
+	srl	%t2, shir, %t4;	\
+	srl	%t3, shir, %t5;	\
+	sll	%t2, shil, %t6; \
+	or	%t4, %prev, %t2; \
+	sll	%t3, shil, %prev; \
+	or	%t5, %t6, %t3; \
+	std	%t0, [%dst + (offset) + (offset2) + 0x00]; \
+	std	%t2, [%dst + (offset) + (offset2) + 0x08];
 
 	.text
 	.align	4
diff --git a/arch/sparc/mm/fault.c b/arch/sparc/mm/fault.c
index cc857f681..dde63e16c 100644
--- a/arch/sparc/mm/fault.c
+++ b/arch/sparc/mm/fault.c
@@ -326,7 +326,7 @@ bad_area_nosemaphore:
 		info.si_errno = 0;
 		/* info.si_code set above to make clear whether
 		   this was a SEGV_MAPERR or SEGV_ACCERR fault.  */
-		info.si_addr = (void *) compute_si_addr(regs, text_fault);
+		info.si_addr = (void __user *)compute_si_addr(regs, text_fault);
 		info.si_trapno = 0;
 		force_sig_info (SIGSEGV, &info, tsk);
 		return;
@@ -380,7 +380,7 @@ do_sigbus:
 	info.si_signo = SIGBUS;
 	info.si_errno = 0;
 	info.si_code = BUS_ADRERR;
-	info.si_addr = (void *) compute_si_addr(regs, text_fault);
+	info.si_addr = (void __user *) compute_si_addr(regs, text_fault);
 	info.si_trapno = 0;
 	force_sig_info (SIGBUS, &info, tsk);
 	if (!from_user)
@@ -549,7 +549,7 @@ bad_area:
 	info.si_errno = 0;
 	/* info.si_code set above to make clear whether
 	   this was a SEGV_MAPERR or SEGV_ACCERR fault.  */
-	info.si_addr = (void *) address;
+	info.si_addr = (void __user *) address;
 	info.si_trapno = 0;
 	force_sig_info (SIGSEGV, &info, tsk);
 	return;
@@ -559,7 +559,7 @@ do_sigbus:
 	info.si_signo = SIGBUS;
 	info.si_errno = 0;
 	info.si_code = BUS_ADRERR;
-	info.si_addr = (void *) address;
+	info.si_addr = (void __user *) address;
 	info.si_trapno = 0;
 	force_sig_info (SIGBUS, &info, tsk);
 }
diff --git a/arch/sparc/mm/init.c b/arch/sparc/mm/init.c
index 1d61ed413..cdc04590d 100644
--- a/arch/sparc/mm/init.c
+++ b/arch/sparc/mm/init.c
@@ -76,7 +76,7 @@ void show_mem(void)
 {
 	printk("Mem-info:\n");
 	show_free_areas();
-	printk("Free swap:       %6dkB\n",
+	printk("Free swap:       %6ldkB\n",
 	       nr_swap_pages << (PAGE_SHIFT-10));
 	printk("%ld pages of RAM\n", totalram_pages);
 	printk("%d free pages\n", nr_free_pages());
@@ -100,7 +100,7 @@ void __init sparc_context_init(int numctx)
 
 		clist = (ctx_list_pool + ctx);
 		clist->ctx_number = ctx;
-		clist->ctx_mm = 0;
+		clist->ctx_mm = NULL;
 	}
 	ctx_free.next = ctx_free.prev = &ctx_free;
 	ctx_used.next = ctx_used.prev = &ctx_used;
diff --git a/arch/sparc/mm/io-unit.c b/arch/sparc/mm/io-unit.c
index 21ca5fe8f..7eddc56b7 100644
--- a/arch/sparc/mm/io-unit.c
+++ b/arch/sparc/mm/io-unit.c
@@ -22,6 +22,7 @@
 #include <asm/bitops.h>
 #include <asm/cacheflush.h>
 #include <asm/tlbflush.h>
+#include <asm/dma.h>
 
 /* #define IOUNIT_DEBUG */
 #ifdef IOUNIT_DEBUG
diff --git a/arch/sparc/mm/iommu.c b/arch/sparc/mm/iommu.c
index 64e3456a2..b661ca03a 100644
--- a/arch/sparc/mm/iommu.c
+++ b/arch/sparc/mm/iommu.c
@@ -25,6 +25,7 @@
 #include <asm/tlbflush.h>
 #include <asm/bitext.h>
 #include <asm/iommu.h>
+#include <asm/dma.h>
 
 /*
  * This can be sized dynamically, but we will do this
diff --git a/arch/sparc/mm/nosrmmu.c b/arch/sparc/mm/nosrmmu.c
index 4e49380d2..9e2156596 100644
--- a/arch/sparc/mm/nosrmmu.c
+++ b/arch/sparc/mm/nosrmmu.c
@@ -9,10 +9,12 @@
 #include <linux/mm.h>
 #include <linux/init.h>
 #include <asm/mbus.h>
+#include <asm/sbus.h>
 
 static char shouldnothappen[] __initdata = "SUN4 kernel can only run on SUN4\n";
 
 enum mbus_module srmmu_modtype;
+void *srmmu_nocache_pool;
 
 int vac_cache_size = 0;
 
@@ -46,11 +48,6 @@ void srmmu_unmapioaddr(unsigned long virt_addr)
 {
 }
 
-void __init srmmu_end_memory(unsigned long memory_size, unsigned long *mem_end_p)
-{
-	return 0;
-}
-
 __u32 iounit_map_dma_init(struct sbus_bus *sbus, int size)
 {
 	return 0;
diff --git a/arch/sparc/mm/srmmu.c b/arch/sparc/mm/srmmu.c
index 45469d2f6..c18475eaa 100644
--- a/arch/sparc/mm/srmmu.c
+++ b/arch/sparc/mm/srmmu.c
@@ -1697,9 +1697,7 @@ static void turbosparc_flush_cache_mm(struct mm_struct *mm)
 
 static void turbosparc_flush_cache_range(struct vm_area_struct *vma, unsigned long start, unsigned long end)
 {
-	struct mm_struct *mm = vma->vm_mm;
-
-	FLUSH_BEGIN(mm)
+	FLUSH_BEGIN(vma->vm_mm)
 	flush_user_windows();
 	turbosparc_idflash_clear();
 	FLUSH_END
@@ -1750,9 +1748,7 @@ static void turbosparc_flush_tlb_mm(struct mm_struct *mm)
 
 static void turbosparc_flush_tlb_range(struct vm_area_struct *vma, unsigned long start, unsigned long end)
 {
-	struct mm_struct *mm = vma->vm_mm;
-
-	FLUSH_BEGIN(mm)
+	FLUSH_BEGIN(vma->vm_mm)
 	srmmu_flush_whole_tlb();
 	FLUSH_END
 }
diff --git a/arch/sparc/mm/sun4c.c b/arch/sparc/mm/sun4c.c
index f169a4838..b56b67b45 100644
--- a/arch/sparc/mm/sun4c.c
+++ b/arch/sparc/mm/sun4c.c
@@ -497,7 +497,7 @@ static void __init sun4c_probe_mmu(void)
 	patch_kernel_fault_handler();
 }
 
-volatile unsigned long *sun4c_memerr_reg = 0;
+volatile unsigned long *sun4c_memerr_reg = NULL;
 
 void __init sun4c_probe_memerr_reg(void)
 {
@@ -599,13 +599,13 @@ static void __init sun4c_init_mmu_entry_pool(void)
 
 	for (i=0; i < SUN4C_MAX_SEGMAPS; i++) {
 		mmu_entry_pool[i].pseg = i;
-		mmu_entry_pool[i].next = 0;
-		mmu_entry_pool[i].prev = 0;
+		mmu_entry_pool[i].next = NULL;
+		mmu_entry_pool[i].prev = NULL;
 		mmu_entry_pool[i].vaddr = 0;
 		mmu_entry_pool[i].locked = 0;
 		mmu_entry_pool[i].ctx = 0;
-		mmu_entry_pool[i].lru_next = 0;
-		mmu_entry_pool[i].lru_prev = 0;
+		mmu_entry_pool[i].lru_next = NULL;
+		mmu_entry_pool[i].lru_prev = NULL;
 	}
 	mmu_entry_pool[invalid_segment].locked = 1;
 }
@@ -1170,7 +1170,7 @@ abend:
 	local_irq_restore(flags);
 	printk("DMA vaddr=0x%p size=%08lx\n", vaddr, size);
 	panic("Out of iobuffer table");
-	return 0;
+	return NULL;
 }
 
 static void sun4c_unlockarea(char *vaddr, unsigned long size)
diff --git a/arch/sparc64/Kconfig b/arch/sparc64/Kconfig
index 57156710c..c85f8f25d 100644
--- a/arch/sparc64/Kconfig
+++ b/arch/sparc64/Kconfig
@@ -139,7 +139,7 @@ config CPU_FREQ
 	  fly.  Currently there are only sparc64 drivers for UltraSPARC-III
 	  and UltraSPARC-IIe processors.
 
-	  For details, take a look at linux/Documentation/cpu-freq.
+	  For details, take a look at <file:Documentation/cpu-freq>.
 
 	  If in doubt, say N.
 
@@ -159,7 +159,7 @@ config US3_FREQ
 	help
 	  This adds the CPUFreq driver for UltraSPARC-III processors.
 
-	  For details, take a look at linux/Documentation/cpu-freq.
+	  For details, take a look at <file:Documentation/cpu-freq>.
 
 	  If in doubt, say N.
 
@@ -169,7 +169,7 @@ config US2E_FREQ
 	help
 	  This adds the CPUFreq driver for UltraSPARC-IIe processors.
 
-	  For details, take a look at linux/Documentation/cpu-freq.
+	  For details, take a look at <file:Documentation/cpu-freq>.
 
 	  If in doubt, say N.
 
@@ -382,6 +382,7 @@ source "fs/Kconfig.binfmt"
 
 config SUNOS_EMUL
 	bool "SunOS binary emulation"
+	depends on BINFMT_AOUT32
 	help
 	  This allows you to run most SunOS binaries.  If you want to do this,
 	  say Y here and place appropriate files in /usr/gnemul/sunos. See
@@ -391,7 +392,7 @@ config SUNOS_EMUL
 
 config SOLARIS_EMUL
 	tristate "Solaris binary emulation (EXPERIMENTAL)"
-	depends on EXPERIMENTAL
+	depends on SPARC32_COMPAT && EXPERIMENTAL
 	help
 	  This is experimental code which will enable you to run (many)
 	  Solaris binaries on your SPARC Linux machine.
diff --git a/arch/sparc64/defconfig b/arch/sparc64/defconfig
index dfedd7e73..7fa2d47a6 100644
--- a/arch/sparc64/defconfig
+++ b/arch/sparc64/defconfig
@@ -9,7 +9,6 @@ CONFIG_MMU=y
 #
 CONFIG_EXPERIMENTAL=y
 CONFIG_CLEAN_COMPILE=y
-CONFIG_STANDALONE=y
 
 #
 # General setup
@@ -26,6 +25,7 @@ CONFIG_HOTPLUG=y
 # CONFIG_EMBEDDED is not set
 CONFIG_KALLSYMS=y
 # CONFIG_KALLSYMS_ALL is not set
+# CONFIG_KALLSYMS_EXTRA_PASS is not set
 CONFIG_FUTEX=y
 CONFIG_EPOLL=y
 CONFIG_IOSCHED_NOOP=y
@@ -89,7 +89,6 @@ CONFIG_BINFMT_ELF32=y
 # CONFIG_BINFMT_AOUT32 is not set
 CONFIG_BINFMT_ELF=y
 CONFIG_BINFMT_MISC=m
-# CONFIG_SUNOS_EMUL is not set
 CONFIG_SOLARIS_EMUL=m
 
 #
@@ -110,6 +109,8 @@ CONFIG_DISPLAY7SEG=m
 #
 # Generic Driver Options
 #
+CONFIG_STANDALONE=y
+# CONFIG_PREVENT_FIRMWARE_BUILD is not set
 CONFIG_FW_LOADER=m
 # CONFIG_DEBUG_DRIVER is not set
 
@@ -117,9 +118,9 @@ CONFIG_FW_LOADER=m
 # Graphics support
 #
 CONFIG_FB=y
+# CONFIG_FB_CIRRUS is not set
 CONFIG_FB_PM2=y
 # CONFIG_FB_PM2_FIFO_DISCONNECT is not set
-# CONFIG_FB_CYBER2000 is not set
 # CONFIG_FB_ASILIANT is not set
 # CONFIG_FB_IMSTT is not set
 # CONFIG_FB_BW2 is not set
@@ -156,7 +157,6 @@ CONFIG_FB_FFB=y
 # CONFIG_PROM_CONSOLE is not set
 CONFIG_DUMMY_CONSOLE=y
 CONFIG_FRAMEBUFFER_CONSOLE=y
-CONFIG_PCI_CONSOLE=y
 CONFIG_FONTS=y
 # CONFIG_FONT_8x8 is not set
 # CONFIG_FONT_8x16 is not set
@@ -178,7 +178,6 @@ CONFIG_LOGO_SUN_CLUT224=y
 #
 # Serial drivers
 #
-# CONFIG_SERIAL_8250 is not set
 
 #
 # Non-8250 serial port support
@@ -199,8 +198,6 @@ CONFIG_SUN_OPENPROMIO=m
 CONFIG_SUN_MOSTEK_RTC=y
 CONFIG_OBP_FLASH=m
 # CONFIG_SUN_BPP is not set
-# CONFIG_SUN_VIDEOPIX is not set
-# CONFIG_SUN_AURORA is not set
 
 #
 # Memory Technology Devices (MTD)
@@ -219,7 +216,7 @@ CONFIG_OBP_FLASH=m
 CONFIG_BLK_DEV_LOOP=m
 CONFIG_BLK_DEV_CRYPTOLOOP=m
 CONFIG_BLK_DEV_NBD=m
-CONFIG_BLK_DEV_CARMEL=m
+CONFIG_BLK_DEV_SX8=m
 # CONFIG_BLK_DEV_RAM is not set
 
 #
@@ -231,6 +228,7 @@ CONFIG_BLK_DEV_IDE=y
 #
 # Please see Documentation/ide.txt for help/info on IDE drives
 #
+# CONFIG_BLK_DEV_IDE_SATA is not set
 CONFIG_BLK_DEV_IDEDISK=y
 # CONFIG_IDEDISK_MULTI_MODE is not set
 CONFIG_BLK_DEV_IDECD=y
@@ -317,6 +315,7 @@ CONFIG_SCSI_FC_ATTRS=m
 # SCSI low-level drivers
 #
 CONFIG_BLK_DEV_3W_XXXX_RAID=m
+CONFIG_SCSI_3W_9XXX=m
 CONFIG_SCSI_ACARD=m
 CONFIG_SCSI_AACRAID=m
 # CONFIG_SCSI_AIC7XXX is not set
@@ -329,23 +328,20 @@ CONFIG_AIC79XX_RESET_DELAY_MS=15000
 # CONFIG_AIC79XX_DEBUG_ENABLE is not set
 CONFIG_AIC79XX_DEBUG_MASK=0
 # CONFIG_AIC79XX_REG_PRETTY_PRINT is not set
-# CONFIG_SCSI_ADVANSYS is not set
 # CONFIG_SCSI_MEGARAID is not set
 CONFIG_SCSI_SATA=y
 CONFIG_SCSI_SATA_SVW=m
 CONFIG_SCSI_ATA_PIIX=m
+CONFIG_SCSI_SATA_NV=m
 CONFIG_SCSI_SATA_PROMISE=m
 CONFIG_SCSI_SATA_SX4=m
 CONFIG_SCSI_SATA_SIL=m
 CONFIG_SCSI_SATA_SIS=m
 CONFIG_SCSI_SATA_VIA=m
 CONFIG_SCSI_SATA_VITESSE=m
-# CONFIG_SCSI_BUSLOGIC is not set
 CONFIG_SCSI_DMX3191D=m
-# CONFIG_SCSI_EATA is not set
 CONFIG_SCSI_EATA_PIO=m
 # CONFIG_SCSI_FUTURE_DOMAIN is not set
-# CONFIG_SCSI_GDTH is not set
 CONFIG_SCSI_IPS=m
 CONFIG_SCSI_INIA100=m
 CONFIG_SCSI_PPA=m
@@ -373,7 +369,7 @@ CONFIG_SCSI_QLA2XXX=y
 # CONFIG_SCSI_QLA6312 is not set
 # CONFIG_SCSI_QLA6322 is not set
 CONFIG_SCSI_DC395x=m
-CONFIG_SCSI_DC390T=m
+# CONFIG_SCSI_DC390T is not set
 CONFIG_SCSI_DEBUG=m
 CONFIG_SCSI_SUNESP=y
 
@@ -407,6 +403,9 @@ CONFIG_MD_RAID6=m
 CONFIG_MD_MULTIPATH=m
 CONFIG_BLK_DEV_DM=m
 CONFIG_DM_CRYPT=m
+CONFIG_DM_SNAPSHOT=m
+CONFIG_DM_MIRROR=m
+CONFIG_DM_ZERO=m
 
 #
 # Fusion MPT device support
@@ -579,6 +578,8 @@ CONFIG_IP_NF_COMPAT_IPCHAINS=m
 CONFIG_IP_NF_COMPAT_IPFWADM=m
 CONFIG_IP_NF_TARGET_NOTRACK=m
 CONFIG_IP_NF_RAW=m
+CONFIG_IP_NF_MATCH_ADDRTYPE=m
+CONFIG_IP_NF_MATCH_REALM=m
 
 #
 # IPv6: Netfilter Configuration
@@ -667,17 +668,18 @@ CONFIG_LAPB=m
 CONFIG_NET_DIVERT=y
 # 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=y
+# CONFIG_NET_SCH_CLK_JIFFIES is not set
+# CONFIG_NET_SCH_CLK_GETTIMEOFDAY is not set
+CONFIG_NET_SCH_CLK_CPU=y
 CONFIG_NET_SCH_CBQ=m
 CONFIG_NET_SCH_HTB=m
 CONFIG_NET_SCH_HFSC=m
-CONFIG_NET_SCH_CSZ=m
 CONFIG_NET_SCH_ATM=y
 CONFIG_NET_SCH_PRIO=m
 CONFIG_NET_SCH_RED=m
@@ -686,7 +688,7 @@ CONFIG_NET_SCH_TEQL=m
 CONFIG_NET_SCH_TBF=m
 CONFIG_NET_SCH_GRED=m
 CONFIG_NET_SCH_DSMARK=m
-CONFIG_NET_SCH_DELAY=m
+CONFIG_NET_SCH_NETEM=m
 CONFIG_NET_SCH_INGRESS=m
 CONFIG_NET_QOS=y
 CONFIG_NET_ESTIMATOR=y
@@ -696,9 +698,12 @@ CONFIG_NET_CLS_ROUTE4=m
 CONFIG_NET_CLS_ROUTE=y
 CONFIG_NET_CLS_FW=m
 CONFIG_NET_CLS_U32=m
+CONFIG_CLS_U32_PERF=y
+CONFIG_NET_CLS_IND=y
 CONFIG_NET_CLS_RSVP=m
 CONFIG_NET_CLS_RSVP6=m
-CONFIG_NET_CLS_POLICE=y
+CONFIG_NET_CLS_ACT=y
+CONFIG_NET_ACT_POLICE=m
 
 #
 # Network testing
@@ -769,7 +774,6 @@ CONFIG_IRDA_FAST_RR=y
 #
 # CONFIG_USB_IRDA is not set
 CONFIG_SIGMATEL_FIR=m
-# CONFIG_TOSHIBA_FIR is not set
 # CONFIG_VLSI_FIR is not set
 CONFIG_BT=m
 CONFIG_BT_L2CAP=m
@@ -780,6 +784,7 @@ CONFIG_BT_BNEP=m
 CONFIG_BT_BNEP_MC_FILTER=y
 CONFIG_BT_BNEP_PROTO_FILTER=y
 CONFIG_BT_CMTP=m
+CONFIG_BT_HIDP=m
 
 #
 # Bluetooth device drivers
@@ -860,6 +865,7 @@ CONFIG_SUNDANCE=m
 CONFIG_SUNDANCE_MMIO=y
 CONFIG_VIA_RHINE=m
 # CONFIG_VIA_RHINE_MMIO is not set
+CONFIG_VIA_VELOCITY=m
 
 #
 # Ethernet (1000 Mbit)
@@ -903,7 +909,6 @@ CONFIG_NET_RADIO=y
 #
 # Wireless 802.11b ISA/PCI cards support
 #
-CONFIG_AIRO=m
 CONFIG_HERMES=m
 CONFIG_PLX_HERMES=m
 CONFIG_TMD_HERMES=m
@@ -1120,12 +1125,15 @@ CONFIG_I2C_VOODOO3=m
 #
 CONFIG_I2C_SENSOR=m
 CONFIG_SENSORS_ADM1021=m
+CONFIG_SENSORS_ADM1025=m
+CONFIG_SENSORS_ADM1031=m
 CONFIG_SENSORS_ASB100=m
 CONFIG_SENSORS_DS1621=m
 CONFIG_SENSORS_FSCHER=m
 CONFIG_SENSORS_GL518SM=m
 CONFIG_SENSORS_IT87=m
 CONFIG_SENSORS_LM75=m
+CONFIG_SENSORS_LM77=m
 CONFIG_SENSORS_LM78=m
 CONFIG_SENSORS_LM80=m
 CONFIG_SENSORS_LM83=m
@@ -1188,6 +1196,7 @@ CONFIG_ISO9660_FS=m
 CONFIG_JOLIET=y
 # CONFIG_ZISOFS is not set
 CONFIG_UDF_FS=m
+CONFIG_UDF_NLS=y
 
 #
 # DOS/FAT/NT Filesystems
@@ -1195,6 +1204,8 @@ CONFIG_UDF_FS=m
 CONFIG_FAT_FS=m
 CONFIG_MSDOS_FS=m
 CONFIG_VFAT_FS=m
+CONFIG_FAT_DEFAULT_CODEPAGE=437
+CONFIG_FAT_DEFAULT_IOCHARSET="iso8859-1"
 # CONFIG_NTFS_FS is not set
 
 #
@@ -1255,6 +1266,8 @@ CONFIG_SMB_FS=m
 # CONFIG_SMB_NLS_DEFAULT is not set
 CONFIG_CIFS=m
 # CONFIG_CIFS_STATS is not set
+# CONFIG_CIFS_XATTR is not set
+CONFIG_CIFS_POSIX=y
 CONFIG_NCP_FS=m
 # CONFIG_NCPFS_PACKET_SIGNING is not set
 # CONFIG_NCPFS_IOCTL_LOCKING is not set
@@ -1281,43 +1294,44 @@ CONFIG_SUN_PARTITION=y
 #
 CONFIG_NLS=y
 CONFIG_NLS_DEFAULT="iso8859-1"
-# CONFIG_NLS_CODEPAGE_437 is not set
-# CONFIG_NLS_CODEPAGE_737 is not set
-# CONFIG_NLS_CODEPAGE_775 is not set
-# CONFIG_NLS_CODEPAGE_850 is not set
-# CONFIG_NLS_CODEPAGE_852 is not set
-# CONFIG_NLS_CODEPAGE_855 is not set
-# CONFIG_NLS_CODEPAGE_857 is not set
-# CONFIG_NLS_CODEPAGE_860 is not set
-# CONFIG_NLS_CODEPAGE_861 is not set
-# CONFIG_NLS_CODEPAGE_862 is not set
-# CONFIG_NLS_CODEPAGE_863 is not set
-# CONFIG_NLS_CODEPAGE_864 is not set
-# CONFIG_NLS_CODEPAGE_865 is not set
-# CONFIG_NLS_CODEPAGE_866 is not set
-# CONFIG_NLS_CODEPAGE_869 is not set
-# CONFIG_NLS_CODEPAGE_936 is not set
-# CONFIG_NLS_CODEPAGE_950 is not set
-# CONFIG_NLS_CODEPAGE_932 is not set
-# CONFIG_NLS_CODEPAGE_949 is not set
-# CONFIG_NLS_CODEPAGE_874 is not set
-# CONFIG_NLS_ISO8859_8 is not set
-# CONFIG_NLS_CODEPAGE_1250 is not set
-# CONFIG_NLS_CODEPAGE_1251 is not set
-# CONFIG_NLS_ISO8859_1 is not set
-# CONFIG_NLS_ISO8859_2 is not set
-# CONFIG_NLS_ISO8859_3 is not set
-# CONFIG_NLS_ISO8859_4 is not set
-# CONFIG_NLS_ISO8859_5 is not set
-# CONFIG_NLS_ISO8859_6 is not set
-# CONFIG_NLS_ISO8859_7 is not set
-# CONFIG_NLS_ISO8859_9 is not set
-# CONFIG_NLS_ISO8859_13 is not set
-# CONFIG_NLS_ISO8859_14 is not set
-# CONFIG_NLS_ISO8859_15 is not set
-# CONFIG_NLS_KOI8_R is not set
-# CONFIG_NLS_KOI8_U is not set
-# CONFIG_NLS_UTF8 is not set
+CONFIG_NLS_CODEPAGE_437=m
+CONFIG_NLS_CODEPAGE_737=m
+CONFIG_NLS_CODEPAGE_775=m
+CONFIG_NLS_CODEPAGE_850=m
+CONFIG_NLS_CODEPAGE_852=m
+CONFIG_NLS_CODEPAGE_855=m
+CONFIG_NLS_CODEPAGE_857=m
+CONFIG_NLS_CODEPAGE_860=m
+CONFIG_NLS_CODEPAGE_861=m
+CONFIG_NLS_CODEPAGE_862=m
+CONFIG_NLS_CODEPAGE_863=m
+CONFIG_NLS_CODEPAGE_864=m
+CONFIG_NLS_CODEPAGE_865=m
+CONFIG_NLS_CODEPAGE_866=m
+CONFIG_NLS_CODEPAGE_869=m
+CONFIG_NLS_CODEPAGE_936=m
+CONFIG_NLS_CODEPAGE_950=m
+CONFIG_NLS_CODEPAGE_932=m
+CONFIG_NLS_CODEPAGE_949=m
+CONFIG_NLS_CODEPAGE_874=m
+CONFIG_NLS_ISO8859_8=m
+CONFIG_NLS_CODEPAGE_1250=m
+CONFIG_NLS_CODEPAGE_1251=m
+CONFIG_NLS_ASCII=m
+CONFIG_NLS_ISO8859_1=m
+CONFIG_NLS_ISO8859_2=m
+CONFIG_NLS_ISO8859_3=m
+CONFIG_NLS_ISO8859_4=m
+CONFIG_NLS_ISO8859_5=m
+CONFIG_NLS_ISO8859_6=m
+CONFIG_NLS_ISO8859_7=m
+CONFIG_NLS_ISO8859_9=m
+CONFIG_NLS_ISO8859_13=m
+CONFIG_NLS_ISO8859_14=m
+CONFIG_NLS_ISO8859_15=m
+CONFIG_NLS_KOI8_R=m
+CONFIG_NLS_KOI8_U=m
+CONFIG_NLS_UTF8=m
 
 #
 # Multimedia devices
@@ -1349,6 +1363,7 @@ CONFIG_VIDEO_DPC=m
 CONFIG_VIDEO_HEXIUM_ORION=m
 CONFIG_VIDEO_HEXIUM_GEMINI=m
 CONFIG_VIDEO_CX88=m
+CONFIG_VIDEO_OVCAMCHIP=m
 
 #
 # Radio Adapters
@@ -1504,11 +1519,6 @@ CONFIG_SND_VX222=m
 CONFIG_SND_SUN_AMD7930=m
 CONFIG_SND_SUN_CS4231=m
 
-#
-# Open Sound System
-#
-# CONFIG_SOUND_PRIME is not set
-
 #
 # USB support
 #
@@ -1544,6 +1554,7 @@ CONFIG_USB_ACM=m
 CONFIG_USB_PRINTER=m
 CONFIG_USB_STORAGE=m
 # CONFIG_USB_STORAGE_DEBUG is not set
+CONFIG_USB_STORAGE_RW_DETECT=y
 # CONFIG_USB_STORAGE_DATAFAB is not set
 CONFIG_USB_STORAGE_FREECOM=y
 CONFIG_USB_STORAGE_ISD200=y
@@ -1587,6 +1598,7 @@ CONFIG_USB_HPUSBSCSI=m
 # CONFIG_USB_OV511 is not set
 CONFIG_USB_PWC=m
 # CONFIG_USB_SE401 is not set
+CONFIG_USB_SN9C102=m
 # CONFIG_USB_STV680 is not set
 CONFIG_USB_W9968CF=m
 
@@ -1756,7 +1768,9 @@ CONFIG_CRYPTO_SERPENT=m
 CONFIG_CRYPTO_AES=m
 CONFIG_CRYPTO_CAST5=m
 CONFIG_CRYPTO_CAST6=m
+CONFIG_CRYPTO_TEA=m
 CONFIG_CRYPTO_ARC4=m
+CONFIG_CRYPTO_KHAZAD=m
 CONFIG_CRYPTO_DEFLATE=y
 CONFIG_CRYPTO_MICHAEL_MIC=m
 CONFIG_CRYPTO_CRC32C=m
@@ -1765,6 +1779,7 @@ CONFIG_CRYPTO_TEST=m
 #
 # Library routines
 #
+CONFIG_CRC_CCITT=m
 CONFIG_CRC32=y
 CONFIG_LIBCRC32C=m
 CONFIG_ZLIB_INFLATE=y
diff --git a/arch/sparc64/kernel/auxio.c b/arch/sparc64/kernel/auxio.c
index 09a97496e..24ecb1075 100644
--- a/arch/sparc64/kernel/auxio.c
+++ b/arch/sparc64/kernel/auxio.c
@@ -113,7 +113,7 @@ void auxio_set_lte(int on)
 void __init auxio_probe(void)
 {
         struct sbus_bus *sbus;
-        struct sbus_dev *sdev = 0;
+        struct sbus_dev *sdev = NULL;
 
         for_each_sbus(sbus) {
                 for_each_sbusdev(sdev, sbus) {
@@ -131,7 +131,7 @@ found_sdev:
 #ifdef CONFIG_PCI
 	else {
 		struct linux_ebus *ebus;
-		struct linux_ebus_device *edev = 0;
+		struct linux_ebus_device *edev = NULL;
 
 		for_each_ebus(ebus) {
 			for_each_ebusdev(edev, ebus) {
diff --git a/arch/sparc64/kernel/binfmt_aout32.c b/arch/sparc64/kernel/binfmt_aout32.c
index 14533fdb8..ae92b7776 100644
--- a/arch/sparc64/kernel/binfmt_aout32.c
+++ b/arch/sparc64/kernel/binfmt_aout32.c
@@ -27,6 +27,7 @@
 #include <linux/binfmts.h>
 #include <linux/personality.h>
 #include <linux/init.h>
+#include <linux/vs_memory.h>
 
 #include <asm/system.h>
 #include <asm/uaccess.h>
@@ -112,9 +113,9 @@ static int aout32_core_dump(long signr, struct pt_regs *regs, struct file *file)
 
 /* make sure we actually have a data and stack area to dump */
 	set_fs(USER_DS);
-	if (verify_area(VERIFY_READ, (void *) START_DATA(dump), dump.u_dsize))
+	if (verify_area(VERIFY_READ, (void __user *) START_DATA(dump), dump.u_dsize))
 		dump.u_dsize = 0;
-	if (verify_area(VERIFY_READ, (void *) START_STACK(dump), dump.u_ssize))
+	if (verify_area(VERIFY_READ, (void __user *) START_STACK(dump), dump.u_ssize))
 		dump.u_ssize = 0;
 
 	set_fs(KERNEL_DS);
@@ -148,24 +149,25 @@ end_coredump:
  * addresses on the "stack", returning the new stack pointer value.
  */
 
-static u32 *create_aout32_tables(char * p, struct linux_binprm * bprm)
+static u32 __user *create_aout32_tables(char __user *p, struct linux_binprm *bprm)
 {
-	u32 *argv, *envp;
-	u32 *sp;
+	u32 __user *argv;
+	u32 __user *envp;
+	u32 __user *sp;
 	int argc = bprm->argc;
 	int envc = bprm->envc;
 
-	sp = (u32 *) ((-(unsigned long)sizeof(char *)) & (unsigned long) p);
+	sp = (u32 __user *)((-(unsigned long)sizeof(char *))&(unsigned long)p);
 
 	/* This imposes the proper stack alignment for a new process. */
-	sp = (u32 *) (((unsigned long) sp) & ~7);
+	sp = (u32 __user *) (((unsigned long) sp) & ~7);
 	if ((envc+argc+3)&1)
 		--sp;
 
 	sp -= envc+1;
-	envp = (u32 *) sp;
+	envp = sp;
 	sp -= argc+1;
-	argv = (u32 *) sp;
+	argv = sp;
 	put_user(argc,--sp);
 	current->mm->arg_start = (unsigned long) p;
 	while (argc-->0) {
@@ -247,10 +249,10 @@ static int load_aout32_binary(struct linux_binprm * bprm, struct pt_regs * regs)
 		loff_t pos = fd_offset;
 		/* Fuck me plenty... */
 		error = do_brk(N_TXTADDR(ex), ex.a_text);
-		bprm->file->f_op->read(bprm->file, (char *) N_TXTADDR(ex),
+		bprm->file->f_op->read(bprm->file, (char __user *)N_TXTADDR(ex),
 			  ex.a_text, &pos);
 		error = do_brk(N_DATADDR(ex), ex.a_data);
-		bprm->file->f_op->read(bprm->file, (char *) N_DATADDR(ex),
+		bprm->file->f_op->read(bprm->file, (char __user *)N_DATADDR(ex),
 			  ex.a_data, &pos);
 		goto beyond_if;
 	}
@@ -259,7 +261,7 @@ static int load_aout32_binary(struct linux_binprm * bprm, struct pt_regs * regs)
 		loff_t pos = fd_offset;
 		do_brk(N_TXTADDR(ex) & PAGE_MASK,
 			ex.a_text+ex.a_data + PAGE_SIZE - 1);
-		bprm->file->f_op->read(bprm->file, (char *) N_TXTADDR(ex),
+		bprm->file->f_op->read(bprm->file, (char __user *)N_TXTADDR(ex),
 			  ex.a_text+ex.a_data, &pos);
 	} else {
 		static unsigned long error_time;
@@ -273,7 +275,8 @@ static int load_aout32_binary(struct linux_binprm * bprm, struct pt_regs * regs)
 		if (!bprm->file->f_op->mmap) {
 			loff_t pos = fd_offset;
 			do_brk(0, ex.a_text+ex.a_data);
-			bprm->file->f_op->read(bprm->file,(char *)N_TXTADDR(ex),
+			bprm->file->f_op->read(bprm->file,
+				  (char __user *)N_TXTADDR(ex),
 				  ex.a_text+ex.a_data, &pos);
 			goto beyond_if;
 		}
@@ -320,7 +323,7 @@ beyond_if:
 	}
 
 	current->mm->start_stack =
-		(unsigned long) create_aout32_tables((char *)bprm->p, bprm);
+		(unsigned long) create_aout32_tables((char __user *)bprm->p, bprm);
 	if (!(orig_thr_flags & _TIF_32BIT)) {
 		unsigned long pgd_cache;
 
diff --git a/arch/sparc64/kernel/ebus.c b/arch/sparc64/kernel/ebus.c
index 044b85837..6ffbeb701 100644
--- a/arch/sparc64/kernel/ebus.c
+++ b/arch/sparc64/kernel/ebus.c
@@ -267,7 +267,7 @@ void ebus_dma_enable(struct ebus_dma_info *p, int on)
 }
 EXPORT_SYMBOL(ebus_dma_enable);
 
-struct linux_ebus *ebus_chain = 0;
+struct linux_ebus *ebus_chain = NULL;
 
 #ifdef CONFIG_SUN_AUXIO
 extern void auxio_probe(void);
@@ -503,7 +503,7 @@ probe_interrupts:
 		dev->children = ebus_alloc(sizeof(struct linux_ebus_child));
 
 		child = dev->children;
-		child->next = 0;
+		child->next = NULL;
 		child->parent = dev;
 		child->bus = dev->bus;
 		fill_ebus_child(node, &regs[0],
@@ -513,7 +513,7 @@ probe_interrupts:
 			child->next = ebus_alloc(sizeof(struct linux_ebus_child));
 
 			child = child->next;
-			child->next = 0;
+			child->next = NULL;
 			child->parent = dev;
 			child->bus = dev->bus;
 			fill_ebus_child(node, &regs[0],
@@ -563,7 +563,7 @@ void __init ebus_init(void)
 	ebusnd = cookie->prom_node;
 
 	ebus_chain = ebus = ebus_alloc(sizeof(struct linux_ebus));
-	ebus->next = 0;
+	ebus->next = NULL;
 	ebus->is_rio = is_rio;
 
 	while (ebusnd) {
@@ -606,8 +606,8 @@ void __init ebus_init(void)
 		ebus->devices = ebus_alloc(sizeof(struct linux_ebus_device));
 
 		dev = ebus->devices;
-		dev->next = 0;
-		dev->children = 0;
+		dev->next = NULL;
+		dev->children = NULL;
 		dev->bus = ebus;
 		fill_ebus_device(nd, dev);
 
@@ -615,8 +615,8 @@ void __init ebus_init(void)
 			dev->next = ebus_alloc(sizeof(struct linux_ebus_device));
 
 			dev = dev->next;
-			dev->next = 0;
-			dev->children = 0;
+			dev->next = NULL;
+			dev->children = NULL;
 			dev->bus = ebus;
 			fill_ebus_device(nd, dev);
 		}
@@ -633,7 +633,7 @@ void __init ebus_init(void)
 
 		ebus->next = ebus_alloc(sizeof(struct linux_ebus));
 		ebus = ebus->next;
-		ebus->next = 0;
+		ebus->next = NULL;
 		ebus->is_rio = is_rio;
 		++num_ebus;
 	}
diff --git a/arch/sparc64/kernel/entry.S b/arch/sparc64/kernel/entry.S
index f82adfbf7..1462b2460 100644
--- a/arch/sparc64/kernel/entry.S
+++ b/arch/sparc64/kernel/entry.S
@@ -1496,28 +1496,30 @@ sunos_getgid:
 	/* SunOS's execv() call only specifies the argv argument, the
 	 * environment settings are the same as the calling processes.
 	 */
-	.globl	sunos_execv, sys_execve, sys32_execve
+	.globl	sunos_execv
 sys_execve:
 	sethi		%hi(sparc_execve), %g1
 	ba,pt		%xcc, execve_merge
 	 or		%g1, %lo(sparc_execve), %g1
+#ifdef CONFIG_COMPAT
+	.globl	sys_execve
 sunos_execv:
 	stx		%g0, [%sp + PTREGS_OFF + PT_V9_I2]
+	.globl	sys32_execve
 sys32_execve:
 	sethi		%hi(sparc32_execve), %g1
 	or		%g1, %lo(sparc32_execve), %g1
+#endif
 execve_merge:
 	flushw
 	jmpl		%g1, %g0
 	 add		%sp, PTREGS_OFF, %o0
 
 	.globl	sys_pipe, sys_sigpause, sys_nis_syscall
-	.globl	sys_sigsuspend, sys_rt_sigsuspend, sys32_rt_sigsuspend
+	.globl	sys_sigsuspend, sys_rt_sigsuspend
 	.globl	sys_rt_sigreturn
-	.globl	sys32_sigreturn, sys32_rt_sigreturn
-	.globl	sys32_execve, sys_ptrace
-	.globl	sys_sigaltstack, sys32_sigaltstack
-	.globl	sys32_sigstack
+	.globl	sys_ptrace
+	.globl	sys_sigaltstack
 	.align	32
 sys_pipe:	ba,pt		%xcc, sparc_pipe
 		 add		%sp, PTREGS_OFF, %o0
@@ -1528,12 +1530,15 @@ sys_memory_ordering:
 		 add		%sp, PTREGS_OFF, %o1
 sys_sigaltstack:ba,pt		%xcc, do_sigaltstack
 		 add		%i6, STACK_BIAS, %o2
+#ifdef CONFIG_COMPAT
+	.globl	sys32_sigstack
 sys32_sigstack:	ba,pt		%xcc, do_sys32_sigstack
 		 mov		%i6, %o2
+	.globl	sys32_sigaltstack
 sys32_sigaltstack:
 		ba,pt		%xcc, do_sys32_sigaltstack
 		 mov		%i6, %o2
-
+#endif
 		.align		32
 sys_sigsuspend:	add		%sp, PTREGS_OFF, %o0
 		call		do_sigsuspend
@@ -1544,31 +1549,40 @@ sys_rt_sigsuspend: /* NOTE: %o0,%o1 have a correct value already */
 		call		do_rt_sigsuspend
 		 add		%o7, 1f-.-4, %o7
 		nop
+#ifdef CONFIG_COMPAT
+	.globl	sys32_rt_sigsuspend
 sys32_rt_sigsuspend: /* NOTE: %o0,%o1 have a correct value already */
 		srl		%o0, 0, %o0
 		add		%sp, PTREGS_OFF, %o2
 		call		do_rt_sigsuspend32
 		 add		%o7, 1f-.-4, %o7
+#endif
 		/* NOTE: %o0 has a correct value already */
 sys_sigpause:	add		%sp, PTREGS_OFF, %o1
 		call		do_sigpause
 		 add		%o7, 1f-.-4, %o7
 		nop
+#ifdef CONFIG_COMPAT
+	.globl	sys32_sigreturn
 sys32_sigreturn:
 		add		%sp, PTREGS_OFF, %o0
 		call		do_sigreturn32
 		 add		%o7, 1f-.-4, %o7
 		nop
+#endif
 sys_rt_sigreturn:
 		add		%sp, PTREGS_OFF, %o0
 		call		do_rt_sigreturn
 		 add		%o7, 1f-.-4, %o7
 		nop
+#ifdef CONFIG_COMPAT
+	.globl	sys32_rt_sigreturn
 sys32_rt_sigreturn:
 		add		%sp, PTREGS_OFF, %o0
 		call		do_rt_sigreturn32
 		 add		%o7, 1f-.-4, %o7
 		nop
+#endif
 sys_ptrace:	add		%sp, PTREGS_OFF, %o0
 		call		do_ptrace
 		 add		%o7, 1f-.-4, %o7
@@ -1751,42 +1765,44 @@ ret_sys_call:
 	ldx		[%sp + PTREGS_OFF + PT_V9_TNPC], %l1 ! pc = npc
 	sra		%o0, 0, %o0
 	mov		%ulo(TSTATE_XCARRY | TSTATE_ICARRY), %g2
-	cmp		%o0, -ENOIOCTLCMD
 	sllx		%g2, 32, %g2
+
+	/* Check if force_successful_syscall_return()
+	 * was invoked.
+	 */
+	ldx		[%curptr + TI_FLAGS], %l0
+	andcc		%l0, _TIF_SYSCALL_SUCCESS, %g0
+	be,pt		%icc, 1f
+	 andn		%l0, _TIF_SYSCALL_SUCCESS, %l0
+	ba,pt		%xcc, 80f
+	 stx		%l0, [%curptr + TI_FLAGS]
+
+1:
+	cmp		%o0, -ENOIOCTLCMD
 	bgeu,pn		%xcc, 1f
 	 andcc		%l0, _TIF_SYSCALL_TRACE, %l6	
 80:
-	andn		%g3, %g2, %g3		/* System call success, clear Carry condition code. */
+	/* System call success, clear Carry condition code. */
+	andn		%g3, %g2, %g3
 	stx		%g3, [%sp + PTREGS_OFF + PT_V9_TSTATE]	
 	bne,pn		%icc, linux_syscall_trace2
-	 add		%l1, 0x4, %l2				         ! npc = npc+4
+	 add		%l1, 0x4, %l2			! npc = npc+4
 	stx		%l1, [%sp + PTREGS_OFF + PT_V9_TPC]
 	ba,pt		%xcc, rtrap_clr_l6
 	 stx		%l2, [%sp + PTREGS_OFF + PT_V9_TNPC]
 
 1:
-	/* Really a failure?  Check if force_successful_syscall_return()
-	 * was invoked.
-	 */
-	ldx		[%curptr + TI_FLAGS], %l0		! Load
-	andcc		%l0, _TIF_SYSCALL_SUCCESS, %g0
-	be,pt		%icc, 1f
-	 andcc		%l0, _TIF_SYSCALL_TRACE, %l6	
-	andn		%l0, _TIF_SYSCALL_SUCCESS, %l0
-	ba,pt		%xcc, 80b
-	 stx		%l0, [%curptr + TI_FLAGS]
-
 	/* System call failure, set Carry condition code.
 	 * Also, get abs(errno) to return to the process.
 	 */
-1:
+	andcc		%l0, _TIF_SYSCALL_TRACE, %l6	
 	sub		%g0, %o0, %o0
 	or		%g3, %g2, %g3
 	stx		%o0, [%sp + PTREGS_OFF + PT_V9_I0]
 	mov		1, %l6
 	stx		%g3, [%sp + PTREGS_OFF + PT_V9_TSTATE]
 	bne,pn		%icc, linux_syscall_trace2
-	 add		%l1, 0x4, %l2				         !npc = npc+4
+	 add		%l1, 0x4, %l2			! npc = npc+4
 	stx		%l1, [%sp + PTREGS_OFF + PT_V9_TPC]
 
 	b,pt		%xcc, rtrap
diff --git a/arch/sparc64/kernel/head.S b/arch/sparc64/kernel/head.S
index 910f768d8..01c8869a7 100644
--- a/arch/sparc64/kernel/head.S
+++ b/arch/sparc64/kernel/head.S
@@ -50,7 +50,6 @@ bootup_user_stack:
  */
         .global root_flags, ram_flags, root_dev
         .global sparc_ramdisk_image, sparc_ramdisk_size
-	.globl	silo_args
 
         .ascii  "HdrS"
         .word   LINUX_VERSION_CODE
@@ -523,8 +522,6 @@ cheetah_tlb_fixup:
 	/* Patch copy/page operations to cheetah optimized versions. */
 	call	cheetah_patch_copyops
 	 nop
-	call	cheetah_patch_pgcopyops
-	 nop
 	call	cheetah_patch_cachetlbops
 	 nop
 
diff --git a/arch/sparc64/kernel/init_task.c b/arch/sparc64/kernel/init_task.c
index e4525064b..329b38fa5 100644
--- a/arch/sparc64/kernel/init_task.c
+++ b/arch/sparc64/kernel/init_task.c
@@ -2,6 +2,7 @@
 #include <linux/module.h>
 #include <linux/sched.h>
 #include <linux/init_task.h>
+#include <linux/mqueue.h>
 
 #include <asm/pgtable.h>
 #include <asm/uaccess.h>
diff --git a/arch/sparc64/kernel/ioctl32.c b/arch/sparc64/kernel/ioctl32.c
index 912e04cc6..af8eb0b59 100644
--- a/arch/sparc64/kernel/ioctl32.c
+++ b/arch/sparc64/kernel/ioctl32.c
@@ -25,7 +25,7 @@
 /* Use this to get at 32-bit user passed pointers. 
  * See sys_sparc32.c for description about it.
  */
-#define A(__x) ((void __user *)(unsigned long)(__x))
+#define A(__x) compat_ptr(__x)
 
 static __inline__ void *alloc_user_space(long len)
 {
@@ -54,39 +54,21 @@ struct  fbcmap32 {
 
 static int fbiogetputcmap(unsigned int fd, unsigned int cmd, unsigned long arg)
 {
-	struct fbcmap f;
+	struct fbcmap32 __user *argp = (void __user *)arg;
+	struct fbcmap __user *p = compat_alloc_user_space(sizeof(*p));
+	u32 addr;
 	int ret;
-	char red[256], green[256], blue[256];
-	u32 r, g, b;
-	mm_segment_t old_fs = get_fs();
 	
-	ret = get_user(f.index, &(((struct fbcmap32 __user *)arg)->index));
-	ret |= __get_user(f.count, &(((struct fbcmap32 __user *)arg)->count));
-	ret |= __get_user(r, &(((struct fbcmap32 __user *)arg)->red));
-	ret |= __get_user(g, &(((struct fbcmap32 __user *)arg)->green));
-	ret |= __get_user(b, &(((struct fbcmap32 __user *)arg)->blue));
+	ret = copy_in_user(p, argp, 2 * sizeof(int));
+	ret |= get_user(addr, &argp->red);
+	ret |= put_user(compat_ptr(addr), &p->red);
+	ret |= get_user(addr, &argp->green);
+	ret |= put_user(compat_ptr(addr), &p->green);
+	ret |= get_user(addr, &argp->blue);
+	ret |= put_user(compat_ptr(addr), &p->blue);
 	if (ret)
 		return -EFAULT;
-	if ((f.index < 0) || (f.index > 255)) return -EINVAL;
-	if (f.index + f.count > 256)
-		f.count = 256 - f.index;
-	if (cmd == FBIOPUTCMAP32) {
-		ret = copy_from_user (red, A(r), f.count);
-		ret |= copy_from_user (green, A(g), f.count);
-		ret |= copy_from_user (blue, A(b), f.count);
-		if (ret)
-			return -EFAULT;
-	}
-	f.red = red; f.green = green; f.blue = blue;
-	set_fs (KERNEL_DS);
-	ret = sys_ioctl (fd, (cmd == FBIOPUTCMAP32) ? FBIOPUTCMAP_SPARC : FBIOGETCMAP_SPARC, (long)&f);
-	set_fs (old_fs);
-	if (!ret && cmd == FBIOGETCMAP32) {
-		ret = copy_to_user (A(r), red, f.count);
-		ret |= copy_to_user (A(g), green, f.count);
-		ret |= copy_to_user (A(b), blue, f.count);
-	}
-	return ret ? -EFAULT : 0;
+	return sys_ioctl(fd, (cmd == FBIOPUTCMAP32) ? FBIOPUTCMAP_SPARC : FBIOGETCMAP_SPARC, (unsigned long)p);
 }
 
 struct fbcursor32 {
@@ -105,52 +87,28 @@ struct fbcursor32 {
 
 static int fbiogscursor(unsigned int fd, unsigned int cmd, unsigned long arg)
 {
-	struct fbcursor f;
+	struct fbcursor __user *p = compat_alloc_user_space(sizeof(*p));
+	struct fbcursor32 __user *argp =  (void __user *)arg;
+	compat_uptr_t addr;
 	int ret;
-	char red[2], green[2], blue[2];
-	char image[128], mask[128];
-	u32 r, g, b;
-	u32 m, i;
-	mm_segment_t old_fs = get_fs();
 	
-	ret = copy_from_user (&f, (struct fbcursor32 __user *) arg,
+	ret = copy_in_user(p, argp,
 			      2 * sizeof (short) + 2 * sizeof(struct fbcurpos));
-	ret |= __get_user(f.size.x,
-			  &(((struct fbcursor32 __user *)arg)->size.x));
-	ret |= __get_user(f.size.y,
-			  &(((struct fbcursor32 __user *)arg)->size.y));
-	ret |= __get_user(f.cmap.index,
-			  &(((struct fbcursor32 __user *)arg)->cmap.index));
-	ret |= __get_user(f.cmap.count,
-			  &(((struct fbcursor32 __user *)arg)->cmap.count));
-	ret |= __get_user(r, &(((struct fbcursor32 __user *)arg)->cmap.red));
-	ret |= __get_user(g, &(((struct fbcursor32 __user *)arg)->cmap.green));
-	ret |= __get_user(b, &(((struct fbcursor32 __user *)arg)->cmap.blue));
-	ret |= __get_user(m, &(((struct fbcursor32 __user *)arg)->mask));
-	ret |= __get_user(i, &(((struct fbcursor32 __user *)arg)->image));
+	ret |= copy_in_user(&p->size, &argp->size, sizeof(struct fbcurpos));
+	ret |= copy_in_user(&p->cmap, &argp->cmap, 2 * sizeof(int));
+	ret |= get_user(addr, &argp->cmap.red);
+	ret |= put_user(compat_ptr(addr), &p->cmap.red);
+	ret |= get_user(addr, &argp->cmap.green);
+	ret |= put_user(compat_ptr(addr), &p->cmap.green);
+	ret |= get_user(addr, &argp->cmap.blue);
+	ret |= put_user(compat_ptr(addr), &p->cmap.blue);
+	ret |= get_user(addr, &argp->mask);
+	ret |= put_user(compat_ptr(addr), &p->mask);
+	ret |= get_user(addr, &argp->image);
+	ret |= put_user(compat_ptr(addr), &p->image);
 	if (ret)
 		return -EFAULT;
-	if (f.set & FB_CUR_SETCMAP) {
-		if ((uint) f.size.y > 32)
-			return -EINVAL;
-		ret = copy_from_user (mask, A(m), f.size.y * 4);
-		ret |= copy_from_user (image, A(i), f.size.y * 4);
-		if (ret)
-			return -EFAULT;
-		f.image = image; f.mask = mask;
-	}
-	if (f.set & FB_CUR_SETCMAP) {
-		ret = copy_from_user (red, A(r), 2);
-		ret |= copy_from_user (green, A(g), 2);
-		ret |= copy_from_user (blue, A(b), 2);
-		if (ret)
-			return -EFAULT;
-		f.cmap.red = red; f.cmap.green = green; f.cmap.blue = blue;
-	}
-	set_fs (KERNEL_DS);
-	ret = sys_ioctl (fd, FBIOSCURSOR, (long)&f);
-	set_fs (old_fs);
-	return ret;
+	return sys_ioctl (fd, FBIOSCURSOR, (unsigned long)p);
 }
 
 #if defined(CONFIG_DRM) || defined(CONFIG_DRM_MODULE)
@@ -173,72 +131,40 @@ typedef struct drm32_version {
 static int drm32_version(unsigned int fd, unsigned int cmd, unsigned long arg)
 {
 	drm32_version_t __user *uversion = (drm32_version_t __user *)arg;
-	char __user *name_ptr, *date_ptr, *desc_ptr;
-	u32 tmp1, tmp2, tmp3;
-	drm_version_t kversion;
-	mm_segment_t old_fs;
+	drm_version_t __user *p = compat_alloc_user_space(sizeof(*p));
+	compat_uptr_t addr;
+	int n;
 	int ret;
 
-	memset(&kversion, 0, sizeof(kversion));
-	if (get_user(kversion.name_len, &uversion->name_len) ||
-	    get_user(kversion.date_len, &uversion->date_len) ||
-	    get_user(kversion.desc_len, &uversion->desc_len) ||
-	    get_user(tmp1, &uversion->name) ||
-	    get_user(tmp2, &uversion->date) ||
-	    get_user(tmp3, &uversion->desc))
+	if (clear_user(p, 3 * sizeof(int)) ||
+	    get_user(n, &uversion->name_len) ||
+	    put_user(n, &p->name_len) ||
+	    get_user(addr, &uversion->name) ||
+	    put_user(compat_ptr(addr), &p->name) ||
+	    get_user(n, &uversion->date_len) ||
+	    put_user(n, &p->date_len) ||
+	    get_user(addr, &uversion->date) ||
+	    put_user(compat_ptr(addr), &p->date) ||
+	    get_user(n, &uversion->desc_len) ||
+	    put_user(n, &p->desc_len) ||
+	    get_user(addr, &uversion->desc) ||
+	    put_user(compat_ptr(addr), &p->desc))
 		return -EFAULT;
 
-	name_ptr = A(tmp1);
-	date_ptr = A(tmp2);
-	desc_ptr = A(tmp3);
-
-	ret = -ENOMEM;
-	if (kversion.name_len && name_ptr) {
-		kversion.name = kmalloc(kversion.name_len, GFP_KERNEL);
-		if (!kversion.name)
-			goto out;
-	}
-	if (kversion.date_len && date_ptr) {
-		kversion.date = kmalloc(kversion.date_len, GFP_KERNEL);
-		if (!kversion.date)
-			goto out;
-	}
-	if (kversion.desc_len && desc_ptr) {
-		kversion.desc = kmalloc(kversion.desc_len, GFP_KERNEL);
-		if (!kversion.desc)
-			goto out;
-	}
-
-        old_fs = get_fs();
-	set_fs(KERNEL_DS);
-        ret = sys_ioctl (fd, DRM_IOCTL_VERSION, (unsigned long)&kversion);
-        set_fs(old_fs);
-
-	if (!ret) {
-		if ((kversion.name &&
-		     copy_to_user(name_ptr, kversion.name, kversion.name_len)) ||
-		    (kversion.date &&
-		     copy_to_user(date_ptr, kversion.date, kversion.date_len)) ||
-		    (kversion.desc &&
-		     copy_to_user(desc_ptr, kversion.desc, kversion.desc_len)))
-			ret = -EFAULT;
-		if (put_user(kversion.version_major, &uversion->version_major) ||
-		    put_user(kversion.version_minor, &uversion->version_minor) ||
-		    put_user(kversion.version_patchlevel, &uversion->version_patchlevel) ||
-		    put_user(kversion.name_len, &uversion->name_len) ||
-		    put_user(kversion.date_len, &uversion->date_len) ||
-		    put_user(kversion.desc_len, &uversion->desc_len))
-			ret = -EFAULT;
-	}
+        ret = sys_ioctl(fd, DRM_IOCTL_VERSION, (unsigned long)p);
+	if (ret)
+		return ret;
+
+	if (copy_in_user(uversion, p, 3 * sizeof(int)) ||
+	    get_user(n, &p->name_len) ||
+	    put_user(n, &uversion->name_len) ||
+	    get_user(n, &p->date_len) ||
+	    put_user(n, &uversion->date_len) ||
+	    get_user(n, &p->desc_len) ||
+	    put_user(n, &uversion->desc_len))
+		return -EFAULT;
 
-out:
-	if (kversion.name)
-		kfree(kversion.name);
-	if (kversion.date)
-		kfree(kversion.date);
-	if (kversion.desc)
-		kfree(kversion.desc);
-	return ret;
+	return 0;
 }
 
 typedef struct drm32_unique {
@@ -251,53 +177,29 @@ typedef struct drm32_unique {
 static int drm32_getsetunique(unsigned int fd, unsigned int cmd, unsigned long arg)
 {
 	drm32_unique_t __user *uarg = (drm32_unique_t __user *)arg;
-	drm_unique_t karg;
-	mm_segment_t old_fs;
-	char __user *uptr;
-	u32 tmp;
+	drm_unique_t __user *p = compat_alloc_user_space(sizeof(*p));
+	compat_uptr_t addr;
+	int n;
 	int ret;
 
-	if (get_user(karg.unique_len, &uarg->unique_len))
+	if (get_user(n, &uarg->unique_len) ||
+	    put_user(n, &p->unique_len) ||
+	    get_user(addr, &uarg->unique) ||
+	    put_user(compat_ptr(addr), &p->unique))
 		return -EFAULT;
-	karg.unique = NULL;
-
-	if (get_user(tmp, &uarg->unique))
-		return -EFAULT;
-
-	uptr = A(tmp);
 
-	if (uptr) {
-		karg.unique = kmalloc(karg.unique_len, GFP_KERNEL);
-		if (!karg.unique)
-			return -ENOMEM;
-		if (cmd == DRM32_IOCTL_SET_UNIQUE &&
-		    copy_from_user(karg.unique, uptr, karg.unique_len)) {
-			kfree(karg.unique);
-			return -EFAULT;
-		}
-	}
-
-	old_fs = get_fs();
-	set_fs(KERNEL_DS);
 	if (cmd == DRM32_IOCTL_GET_UNIQUE)
-		ret = sys_ioctl (fd, DRM_IOCTL_GET_UNIQUE, (unsigned long)&karg);
+		ret = sys_ioctl (fd, DRM_IOCTL_GET_UNIQUE, (unsigned long)p);
 	else
-		ret = sys_ioctl (fd, DRM_IOCTL_SET_UNIQUE, (unsigned long)&karg);
-        set_fs(old_fs);
+		ret = sys_ioctl (fd, DRM_IOCTL_SET_UNIQUE, (unsigned long)p);
 
-	if (!ret) {
-		if (cmd == DRM32_IOCTL_GET_UNIQUE &&
-		    uptr != NULL &&
-		    copy_to_user(uptr, karg.unique, karg.unique_len))
-			ret = -EFAULT;
-		if (put_user(karg.unique_len, &uarg->unique_len))
-			ret = -EFAULT;
-	}
+	if (ret)
+		return ret;
 
-	if (karg.unique != NULL)
-		kfree(karg.unique);
+	if (get_user(n, &p->unique_len) || put_user(n, &uarg->unique_len))
+		return -EFAULT;
 
-	return ret;
+	return 0;
 }
 
 typedef struct drm32_map {
@@ -360,41 +262,23 @@ typedef struct drm32_buf_info {
 static int drm32_info_bufs(unsigned int fd, unsigned int cmd, unsigned long arg)
 {
 	drm32_buf_info_t __user *uarg = (drm32_buf_info_t __user *)arg;
-	drm_buf_desc_t __user *ulist;
-	drm_buf_info_t karg;
-	mm_segment_t old_fs;
-	int orig_count, ret;
-	u32 tmp;
+	drm_buf_info_t __user *p = compat_alloc_user_space(sizeof(*p));
+	compat_uptr_t addr;
+	int n;
+	int ret;
 
-	if (get_user(karg.count, &uarg->count) ||
-	    get_user(tmp, &uarg->list))
+	if (get_user(n, &uarg->count) || put_user(n, &p->count) ||
+	    get_user(addr, &uarg->list) || put_user(compat_ptr(addr), &p->list))
 		return -EFAULT;
 
-	ulist = A(tmp);
-
-	orig_count = karg.count;
+	ret = sys_ioctl(fd, DRM_IOCTL_INFO_BUFS, (unsigned long)p);
+	if (ret)
+		return ret;
 
-	karg.list = kmalloc(karg.count * sizeof(drm_buf_desc_t), GFP_KERNEL);
-	if (!karg.list)
+	if (get_user(n, &p->count) || put_user(n, &uarg->count))
 		return -EFAULT;
 
-	old_fs = get_fs();
-	set_fs(KERNEL_DS);
-	ret = sys_ioctl(fd, DRM_IOCTL_INFO_BUFS, (unsigned long) &karg);
-	set_fs(old_fs);
-
-	if (!ret) {
-		if (karg.count <= orig_count &&
-		    (copy_to_user(ulist, karg.list,
-				  karg.count * sizeof(drm_buf_desc_t))))
-			ret = -EFAULT;
-		if (put_user(karg.count, &uarg->count))
-			ret = -EFAULT;
-	}
-
-	kfree(karg.list);
-
-	return ret;
+	return 0;
 }
 
 typedef struct drm32_buf_free {
@@ -406,35 +290,15 @@ typedef struct drm32_buf_free {
 static int drm32_free_bufs(unsigned int fd, unsigned int cmd, unsigned long arg)
 {
 	drm32_buf_free_t __user *uarg = (drm32_buf_free_t __user *)arg;
-	drm_buf_free_t karg;
-	mm_segment_t old_fs;
-	int __user *ulist;
-	int ret;
-	u32 tmp;
+	drm_buf_free_t __user *p = compat_alloc_user_space(sizeof(*p));
+	compat_uptr_t addr;
+	int n;
 
-	if (get_user(karg.count, &uarg->count) ||
-	    get_user(tmp, &uarg->list))
+	if (get_user(n, &uarg->count) || put_user(n, &p->count) ||
+	    get_user(addr, &uarg->list) || put_user(compat_ptr(addr), &p->list))
 		return -EFAULT;
 
-	ulist = A(tmp);
-
-	karg.list = kmalloc(karg.count * sizeof(int), GFP_KERNEL);
-	if (!karg.list)
-		return -ENOMEM;
-
-	ret = -EFAULT;
-	if (copy_from_user(karg.list, ulist, (karg.count * sizeof(int))))
-		goto out;
-
-	old_fs = get_fs();
-	set_fs(KERNEL_DS);
-	ret = sys_ioctl(fd, DRM_IOCTL_FREE_BUFS, (unsigned long) &karg);
-	set_fs(old_fs);
-
-out:
-	kfree(karg.list);
-
-	return ret;
+	return sys_ioctl(fd, DRM_IOCTL_FREE_BUFS, (unsigned long)p);
 }
 
 typedef struct drm32_buf_pub {
@@ -455,59 +319,61 @@ static int drm32_map_bufs(unsigned int fd, unsigned int cmd, unsigned long arg)
 {
 	drm32_buf_map_t __user *uarg = (drm32_buf_map_t __user *)arg;
 	drm32_buf_pub_t __user *ulist;
-	drm_buf_map_t karg;
-	mm_segment_t old_fs;
+	drm_buf_map_t __user *arg64;
+	drm_buf_pub_t __user *list;
 	int orig_count, ret, i;
-	u32 tmp1, tmp2;
+	int n;
+	compat_uptr_t addr;
 
-	if (get_user(karg.count, &uarg->count) ||
-	    get_user(tmp1, &uarg->virtual) ||
-	    get_user(tmp2, &uarg->list))
+	if (get_user(orig_count, &uarg->count))
 		return -EFAULT;
 
-	karg.virtual = (void *) (unsigned long) tmp1;
-	ulist = A(tmp2);
-
-	orig_count = karg.count;
-
-	karg.list = kmalloc(karg.count * sizeof(drm_buf_pub_t), GFP_KERNEL);
-	if (!karg.list)
-		return -ENOMEM;
+	arg64 = compat_alloc_user_space(sizeof(drm_buf_map_t) +
+				(size_t)orig_count * sizeof(drm_buf_pub_t));
+	list = (void __user *)(arg64 + 1);
 
-	ret = -EFAULT;
-	for (i = 0; i < karg.count; i++) {
-		if (get_user(karg.list[i].idx, &ulist[i].idx) ||
-		    get_user(karg.list[i].total, &ulist[i].total) ||
-		    get_user(karg.list[i].used, &ulist[i].used) ||
-		    get_user(tmp1, &ulist[i].address))
-			goto out;
+	if (put_user(orig_count, &arg64->count) ||
+	    put_user(list, &arg64->list) ||
+	    get_user(addr, &uarg->virtual) ||
+	    put_user(compat_ptr(addr), &arg64->virtual) ||
+	    get_user(addr, &uarg->list))
+		return -EFAULT;
 
-		karg.list[i].address = (void *) (unsigned long) tmp1;
+	ulist = compat_ptr(addr);
+
+	for (i = 0; i < orig_count; i++) {
+		if (get_user(n, &ulist[i].idx) ||
+		    put_user(n, &list[i].idx) ||
+		    get_user(n, &ulist[i].total) ||
+		    put_user(n, &list[i].total) ||
+		    get_user(n, &ulist[i].used) ||
+		    put_user(n, &list[i].used) ||
+		    get_user(addr, &ulist[i].address) ||
+		    put_user(compat_ptr(addr), &list[i].address))
+			return -EFAULT;
 	}
 
-	old_fs = get_fs();
-	set_fs(KERNEL_DS);
-	ret = sys_ioctl(fd, DRM_IOCTL_MAP_BUFS, (unsigned long) &karg);
-	set_fs(old_fs);
-
-	if (!ret) {
-		for (i = 0; i < orig_count; i++) {
-			tmp1 = (u32) (long) karg.list[i].address;
-			if (put_user(karg.list[i].idx, &ulist[i].idx) ||
-			    put_user(karg.list[i].total, &ulist[i].total) ||
-			    put_user(karg.list[i].used, &ulist[i].used) ||
-			    put_user(tmp1, &ulist[i].address)) {
-				ret = -EFAULT;
-				goto out;
-			}
-		}
-		if (put_user(karg.count, &uarg->count))
-			ret = -EFAULT;
+	ret = sys_ioctl(fd, DRM_IOCTL_MAP_BUFS, (unsigned long) arg64);
+	if (ret)
+		return ret;
+
+	for (i = 0; i < orig_count; i++) {
+		void __user *p;
+		if (get_user(n, &list[i].idx) ||
+		    put_user(n, &ulist[i].idx) ||
+		    get_user(n, &list[i].total) ||
+		    put_user(n, &ulist[i].total) ||
+		    get_user(n, &list[i].used) ||
+		    put_user(n, &ulist[i].used) ||
+		    get_user(p, &list[i].address) ||
+		    put_user((unsigned long)p, &ulist[i].address))
+			return -EFAULT;
 	}
 
-out:
-	kfree(karg.list);
-	return ret;
+	if (get_user(n, &arg64->count) || put_user(n, &uarg->count))
+		return -EFAULT;
+
+	return 0;
 }
 
 typedef struct drm32_dma {
@@ -533,105 +399,37 @@ typedef struct drm32_dma {
 static int drm32_dma(unsigned int fd, unsigned int cmd, unsigned long arg)
 {
 	drm32_dma_t __user *uarg = (drm32_dma_t __user *) arg;
-	int __user *u_si, *u_ss, *u_ri, *u_rs;
-	drm_dma_t karg;
-	mm_segment_t old_fs;
+	drm_dma_t __user *p = compat_alloc_user_space(sizeof(*p));
+	compat_uptr_t addr;
 	int ret;
-	u32 tmp1, tmp2, tmp3, tmp4;
-
-	karg.send_indices = karg.send_sizes = NULL;
-	karg.request_indices = karg.request_sizes = NULL;
-
-	if (get_user(karg.context, &uarg->context) ||
-	    get_user(karg.send_count, &uarg->send_count) ||
-	    get_user(tmp1, &uarg->send_indices) ||
-	    get_user(tmp2, &uarg->send_sizes) ||
-	    get_user(karg.flags, &uarg->flags) ||
-	    get_user(karg.request_count, &uarg->request_count) ||
-	    get_user(karg.request_size, &uarg->request_size) ||
-	    get_user(tmp3, &uarg->request_indices) ||
-	    get_user(tmp4, &uarg->request_sizes) ||
-	    get_user(karg.granted_count, &uarg->granted_count))
-		return -EFAULT;
-
-	u_si = A(tmp1);
-	u_ss = A(tmp2);
-	u_ri = A(tmp3);
-	u_rs = A(tmp4);
-
-	if (karg.send_count) {
-		karg.send_indices = kmalloc(karg.send_count * sizeof(int), GFP_KERNEL);
-		karg.send_sizes = kmalloc(karg.send_count * sizeof(int), GFP_KERNEL);
-
-		ret = -ENOMEM;
-		if (!karg.send_indices || !karg.send_sizes)
-			goto out;
-
-		ret = -EFAULT;
-		if (copy_from_user(karg.send_indices, u_si,
-				   (karg.send_count * sizeof(int))) ||
-		    copy_from_user(karg.send_sizes, u_ss,
-				   (karg.send_count * sizeof(int))))
-			goto out;
-	}
-
-	if (karg.request_count) {
-		karg.request_indices = kmalloc(karg.request_count * sizeof(int), GFP_KERNEL);
-		karg.request_sizes = kmalloc(karg.request_count * sizeof(int), GFP_KERNEL);
-
-		ret = -ENOMEM;
-		if (!karg.request_indices || !karg.request_sizes)
-			goto out;
 
-		ret = -EFAULT;
-		if (copy_from_user(karg.request_indices, u_ri,
-				   (karg.request_count * sizeof(int))) ||
-		    copy_from_user(karg.request_sizes, u_rs,
-				   (karg.request_count * sizeof(int))))
-			goto out;
-	}
-
-	old_fs = get_fs();
-	set_fs(KERNEL_DS);
-	ret = sys_ioctl(fd, DRM_IOCTL_DMA, (unsigned long) &karg);
-	set_fs(old_fs);
-
-	if (!ret) {
-		if (put_user(karg.context, &uarg->context) ||
-		    put_user(karg.send_count, &uarg->send_count) ||
-		    put_user(karg.flags, &uarg->flags) ||
-		    put_user(karg.request_count, &uarg->request_count) ||
-		    put_user(karg.request_size, &uarg->request_size) ||
-		    put_user(karg.granted_count, &uarg->granted_count))
-			ret = -EFAULT;
+	if (copy_in_user(p, uarg, 2 * sizeof(int)) ||
+	    get_user(addr, &uarg->send_indices) ||
+	    put_user(compat_ptr(addr), &p->send_indices) ||
+	    get_user(addr, &uarg->send_sizes) ||
+	    put_user(compat_ptr(addr), &p->send_sizes) ||
+	    copy_in_user(&p->flags, &uarg->flags, sizeof(drm_dma_flags_t)) ||
+	    copy_in_user(&p->request_count, &uarg->request_count, sizeof(int))||
+	    copy_in_user(&p->request_size, &uarg->request_size, sizeof(int)) ||
+	    get_user(addr, &uarg->request_indices) ||
+	    put_user(compat_ptr(addr), &p->request_indices) ||
+	    get_user(addr, &uarg->request_sizes) ||
+	    put_user(compat_ptr(addr), &p->request_sizes) ||
+	    copy_in_user(&p->granted_count, &uarg->granted_count, sizeof(int)))
+		return -EFAULT;
 
-		if (karg.send_count) {
-			if (copy_to_user(u_si, karg.send_indices,
-					 (karg.send_count * sizeof(int))) ||
-			    copy_to_user(u_ss, karg.send_sizes,
-					 (karg.send_count * sizeof(int))))
-				ret = -EFAULT;
-		}
-		if (karg.request_count) {
-			if (copy_to_user(u_ri, karg.request_indices,
-					 (karg.request_count * sizeof(int))) ||
-			    copy_to_user(u_rs, karg.request_sizes,
-					 (karg.request_count * sizeof(int))))
-				ret = -EFAULT;
-		}
-	}
+	ret = sys_ioctl(fd, DRM_IOCTL_DMA, (unsigned long)p);
+	if (ret)
+		return ret;
 
-out:
-	if (karg.send_indices)
-		kfree(karg.send_indices);
-	if (karg.send_sizes)
-		kfree(karg.send_sizes);
-	if (karg.request_indices)
-		kfree(karg.request_indices);
-	if (karg.request_sizes)
-		kfree(karg.request_sizes);
+	if (copy_in_user(uarg, p, 2 * sizeof(int)) ||
+	    copy_in_user(&uarg->flags, &p->flags, sizeof(drm_dma_flags_t)) ||
+	    copy_in_user(&uarg->request_count, &p->request_count, sizeof(int))||
+	    copy_in_user(&uarg->request_size, &p->request_size, sizeof(int)) ||
+	    copy_in_user(&uarg->granted_count, &p->granted_count, sizeof(int)))
+		return -EFAULT;
 
-	return ret;
+	return 0;
 }
 
 typedef struct drm32_ctx_res {
@@ -643,50 +441,23 @@ typedef struct drm32_ctx_res {
 static int drm32_res_ctx(unsigned int fd, unsigned int cmd, unsigned long arg)
 {
 	drm32_ctx_res_t __user *uarg = (drm32_ctx_res_t __user *) arg;
-	drm_ctx_t __user *ulist;
-	drm_ctx_res_t karg;
-	mm_segment_t old_fs;
-	int orig_count, ret;
-	u32 tmp;
+	drm_ctx_res_t __user *p = compat_alloc_user_space(sizeof(*p));
+	compat_uptr_t addr;
+	int ret;
 
-	karg.contexts = NULL;
-	if (get_user(karg.count, &uarg->count) ||
-	    get_user(tmp, &uarg->contexts))
+	if (copy_in_user(p, uarg, sizeof(int)) ||
+	    get_user(addr, &uarg->contexts) ||
+	    put_user(compat_ptr(addr), &p->contexts))
 		return -EFAULT;
 
-	ulist = A(tmp);
-
-	orig_count = karg.count;
-	if (karg.count && ulist) {
-		karg.contexts = kmalloc((karg.count * sizeof(drm_ctx_t)), GFP_KERNEL);
-		if (!karg.contexts)
-			return -ENOMEM;
-		if (copy_from_user(karg.contexts, ulist,
-				   (karg.count * sizeof(drm_ctx_t)))) {
-			kfree(karg.contexts);
-			return -EFAULT;
-		}
-	}
-
-	old_fs = get_fs();
-	set_fs(KERNEL_DS);
-	ret = sys_ioctl(fd, DRM_IOCTL_RES_CTX, (unsigned long) &karg);
-	set_fs(old_fs);
-
-	if (!ret) {
-		if (orig_count) {
-			if (copy_to_user(ulist, karg.contexts,
-					 (orig_count * sizeof(drm_ctx_t))))
-				ret = -EFAULT;
-		}
-		if (put_user(karg.count, &uarg->count))
-			ret = -EFAULT;
-	}
+	ret = sys_ioctl(fd, DRM_IOCTL_RES_CTX, (unsigned long)p);
+	if (ret)
+		return ret;
 
-	if (karg.contexts)
-		kfree(karg.contexts);
+	if (copy_in_user(uarg, p, sizeof(int)))
+		return -EFAULT;
 
-	return ret;
+	return 0;
 }
 
 #endif
diff --git a/arch/sparc64/kernel/irq.c b/arch/sparc64/kernel/irq.c
index b7f6a1eb9..d52b84291 100644
--- a/arch/sparc64/kernel/irq.c
+++ b/arch/sparc64/kernel/irq.c
@@ -118,10 +118,6 @@ static void register_irq_proc (unsigned int irq);
 		action->flags |= __irq_ino(irq) << 48;
 #define get_ino_in_irqaction(action)	(action->flags >> 48)
 
-#if NR_CPUS > 64
-#error irqaction embedded smp affinity does not work with > 64 cpus, FIXME
-#endif
-
 #define put_smpaff_in_irqaction(action, smpaff)	(action)->mask = (smpaff)
 #define get_smpaff_in_irqaction(action) 	((action)->mask)
 
@@ -458,7 +454,7 @@ int request_irq(unsigned int irq, irqreturn_t (*handler)(int, void *, struct pt_
 	action->next = NULL;
 	action->dev_id = dev_id;
 	put_ino_in_irqaction(action, irq);
-	put_smpaff_in_irqaction(action, 0);
+	put_smpaff_in_irqaction(action, CPU_MASK_NONE);
 
 	if (tmp)
 		tmp->next = action;
@@ -691,9 +687,10 @@ static inline void redirect_intr(int cpu, struct ino_bucket *bp)
 	 *    Just Do It.
 	 */
 	struct irqaction *ap = bp->irq_info;
-	cpumask_t cpu_mask = get_smpaff_in_irqaction(ap);
+	cpumask_t cpu_mask;
 	unsigned int buddy, ticks;
 
+	cpu_mask = get_smpaff_in_irqaction(ap);
 	cpus_and(cpu_mask, cpu_mask, cpu_online_map);
 	if (cpus_empty(cpu_mask))
 		cpu_mask = cpu_online_map;
@@ -714,7 +711,7 @@ static inline void redirect_intr(int cpu, struct ino_bucket *bp)
 		if (++buddy >= NR_CPUS)
 			buddy = 0;
 		if (++ticks > NR_CPUS) {
-			put_smpaff_in_irqaction(ap, 0);
+			put_smpaff_in_irqaction(ap, CPU_MASK_NONE);
 			goto out;
 		}
 	}
@@ -948,7 +945,7 @@ int request_fast_irq(unsigned int irq,
 	action->name = name;
 	action->next = NULL;
 	put_ino_in_irqaction(action, irq);
-	put_smpaff_in_irqaction(action, 0);
+	put_smpaff_in_irqaction(action, CPU_MASK_NONE);
 
 	*(bucket->pil + irq_action) = action;
 	enable_irq(irq);
@@ -1166,53 +1163,15 @@ static struct proc_dir_entry * irq_dir [NUM_IVECS];
 
 #ifdef CONFIG_SMP
 
-#define HEX_DIGITS 16
-
-static unsigned int parse_hex_value (const char __user *buffer,
-		unsigned long count, unsigned long *ret)
-{
-	unsigned char hexnum [HEX_DIGITS];
-	unsigned long value;
-	int i;
-
-	if (!count)
-		return -EINVAL;
-	if (count > HEX_DIGITS)
-		count = HEX_DIGITS;
-	if (copy_from_user(hexnum, buffer, count))
-		return -EFAULT;
-
-	/*
-	 * Parse the first 8 characters as a hex string, any non-hex char
-	 * is end-of-string. '00e1', 'e1', '00E1', 'E1' are all the same.
-	 */
-	value = 0;
-
-	for (i = 0; i < count; i++) {
-		unsigned int c = hexnum[i];
-
-		switch (c) {
-			case '0' ... '9': c -= '0'; break;
-			case 'a' ... 'f': c -= 'a'-10; break;
-			case 'A' ... 'F': c -= 'A'-10; break;
-		default:
-			goto out;
-		}
-		value = (value << 4) | c;
-	}
-out:
-	*ret = value;
-	return 0;
-}
-
 static int irq_affinity_read_proc (char *page, char **start, off_t off,
 			int count, int *eof, void *data)
 {
 	struct ino_bucket *bp = ivector_table + (long)data;
 	struct irqaction *ap = bp->irq_info;
-	cpumask_t mask = get_smpaff_in_irqaction(ap);
+	cpumask_t mask;
 	int len;
 
+	mask = get_smpaff_in_irqaction(ap);
 	if (cpus_empty(mask))
 		mask = cpu_online_map;
 
@@ -1223,7 +1182,7 @@ static int irq_affinity_read_proc (char *page, char **start, off_t off,
 	return len;
 }
 
-static inline void set_intr_affinity(int irq, unsigned long hw_aff)
+static inline void set_intr_affinity(int irq, cpumask_t hw_aff)
 {
 	struct ino_bucket *bp = ivector_table + irq;
 
@@ -1241,22 +1200,17 @@ static int irq_affinity_write_proc (struct file *file, const char __user *buffer
 					unsigned long count, void *data)
 {
 	int irq = (long) data, full_count = count, err;
-	unsigned long new_value, i;
+	cpumask_t new_value;
 
-	err = parse_hex_value(buffer, count, &new_value);
+	err = cpumask_parse(buffer, count, new_value);
 
 	/*
 	 * Do not allow disabling IRQs completely - it's a too easy
 	 * way to make the system unusable accidentally :-) At least
 	 * one online CPU still has to be targeted.
 	 */
-	for (i = 0; i < NR_CPUS; i++) {
-		if ((new_value & (1UL << i)) != 0 &&
-		    !cpu_online(i))
-			new_value &= ~(1UL << i);
-	}
-
-	if (!new_value)
+	cpus_and(new_value, new_value, cpu_online_map);
+	if (cpus_empty(new_value))
 		return -EINVAL;
 
 	set_intr_affinity(irq, new_value);
@@ -1302,6 +1256,6 @@ static void register_irq_proc (unsigned int irq)
 void init_irq_proc (void)
 {
 	/* create /proc/irq */
-	root_irq_dir = proc_mkdir("irq", 0);
+	root_irq_dir = proc_mkdir("irq", NULL);
 }
 
diff --git a/arch/sparc64/kernel/itlb_base.S b/arch/sparc64/kernel/itlb_base.S
index 36c41501a..b5e32dfa4 100644
--- a/arch/sparc64/kernel/itlb_base.S
+++ b/arch/sparc64/kernel/itlb_base.S
@@ -41,6 +41,9 @@
 	CREATE_VPTE_OFFSET2(%g4, %g6)			! Create VPTE offset
 	ldxa		[%g3 + %g6] ASI_P, %g5		! Load VPTE
 1:	brgez,pn	%g5, 3f				! Not valid, branch out
+	 sethi		%hi(_PAGE_EXEC), %g4		! Delay-slot
+	andcc		%g5, %g4, %g0			! Executable?
+	be,pn		%xcc, 3f			! Nope, branch.
 	 nop						! Delay-slot
 2:	stxa		%g5, [%g0] ASI_ITLB_DATA_IN	! Load PTE into TLB
 	retry						! Trap return
@@ -69,9 +72,6 @@ winfix_trampoline:
 	done						! Do it to it
 
 /* ITLB ** ICACHE line 4: Unused...	*/
-	nop
-	nop
-	nop
 	nop
 	nop
 	nop
diff --git a/arch/sparc64/kernel/power.c b/arch/sparc64/kernel/power.c
index b501622f0..006a562dc 100644
--- a/arch/sparc64/kernel/power.c
+++ b/arch/sparc64/kernel/power.c
@@ -134,7 +134,7 @@ found:
 	printk("power: Control reg at %016lx ... ", power_reg);
 	poweroff_method = machine_halt;  /* able to use the standard halt */
 	if (has_button_interrupt(edev)) {
-		if (kernel_thread(powerd, 0, CLONE_FS) < 0) {
+		if (kernel_thread(powerd, NULL, CLONE_FS) < 0) {
 			printk("Failed to start power daemon.\n");
 			return;
 		}
diff --git a/arch/sparc64/kernel/process.c b/arch/sparc64/kernel/process.c
index 7f03853f8..145ce7c73 100644
--- a/arch/sparc64/kernel/process.c
+++ b/arch/sparc64/kernel/process.c
@@ -12,6 +12,7 @@
 
 #include <stdarg.h>
 
+#include <linux/config.h>
 #include <linux/errno.h>
 #include <linux/module.h>
 #include <linux/sched.h>
@@ -28,6 +29,7 @@
 #include <linux/config.h>
 #include <linux/reboot.h>
 #include <linux/delay.h>
+#include <linux/compat.h>
 #include <linux/init.h>
 
 #include <asm/oplib.h>
@@ -588,10 +590,13 @@ asmlinkage long sparc_do_fork(unsigned long clone_flags,
 
 	clone_flags &= ~CLONE_IDLETASK;
 
+#ifdef CONFIG_COMPAT
 	if (test_thread_flag(TIF_32BIT)) {
 		parent_tid_ptr = compat_ptr(regs->u_regs[UREG_I2]);
 		child_tid_ptr = compat_ptr(regs->u_regs[UREG_I4]);
-	} else {
+	} else
+#endif
+	{
 		parent_tid_ptr = (int __user *) regs->u_regs[UREG_I2];
 		child_tid_ptr = (int __user *) regs->u_regs[UREG_I4];
 	}
diff --git a/arch/sparc64/kernel/rtrap.S b/arch/sparc64/kernel/rtrap.S
index b58afaeca..b7c3277bb 100644
--- a/arch/sparc64/kernel/rtrap.S
+++ b/arch/sparc64/kernel/rtrap.S
@@ -152,7 +152,8 @@ __handle_signal:
 		.globl			rtrap_irq, rtrap_clr_l6, rtrap, irqsz_patchme, rtrap_xcall
 rtrap_irq:
 rtrap_clr_l6:	clr			%l6
-rtrap:		ldub			[%g6 + TI_CPU], %l0
+rtrap:
+		ldub			[%g6 + TI_CPU], %l0
 		sethi			%hi(irq_stat), %l2	! &softirq_active
 		or			%l2, %lo(irq_stat), %l2	! &softirq_active
 irqsz_patchme:	sllx			%l0, 0, %l0
diff --git a/arch/sparc64/kernel/sbus.c b/arch/sparc64/kernel/sbus.c
index 549e9782b..14d9c3a21 100644
--- a/arch/sparc64/kernel/sbus.c
+++ b/arch/sparc64/kernel/sbus.c
@@ -28,10 +28,10 @@
  *
  * On SYSIO, using an 8K page size we have 1GB of SBUS
  * DMA space mapped.  We divide this space into equally
- * sized clusters.  Currently we allow clusters up to a
- * size of 1MB.  If anything begins to generate DMA
- * mapping requests larger than this we will need to
- * increase things a bit.
+ * sized clusters. We allocate a DMA mapping from the
+ * cluster that matches the order of the allocation, or
+ * if the order is greater than the number of clusters,
+ * we try to allocate from the last cluster.
  */
 
 #define NCLUSTERS	8UL
@@ -134,12 +134,17 @@ static void strbuf_flush(struct sbus_iommu *iommu, u32 base, unsigned long npage
 
 static iopte_t *alloc_streaming_cluster(struct sbus_iommu *iommu, unsigned long npages)
 {
-	iopte_t *iopte, *limit, *first;
-	unsigned long cnum, ent, flush_point;
+	iopte_t *iopte, *limit, *first, *cluster;
+	unsigned long cnum, ent, nent, flush_point, found;
 
 	cnum = 0;
+	nent = 1;
 	while ((1UL << cnum) < npages)
 		cnum++;
+	if(cnum >= NCLUSTERS) {
+		nent = 1UL << (cnum - NCLUSTERS);
+		cnum = NCLUSTERS - 1;
+	}
 	iopte  = iommu->page_table + (cnum * CLUSTER_NPAGES);
 
 	if (cnum == 0)
@@ -152,22 +157,31 @@ static iopte_t *alloc_streaming_cluster(struct sbus_iommu *iommu, unsigned long
 	flush_point = iommu->alloc_info[cnum].flush;
 
 	first = iopte;
+	cluster = NULL;
+	found = 0;
 	for (;;) {
 		if (iopte_val(*iopte) == 0UL) {
-			if ((iopte + (1 << cnum)) >= limit)
-				ent = 0;
-			else
-				ent = ent + 1;
-			iommu->alloc_info[cnum].next = ent;
-			if (ent == flush_point)
-				__iommu_flushall(iommu);
-			break;
+			found++;
+			if (!cluster)
+				cluster = iopte;
+		} else {
+			/* Used cluster in the way */
+			cluster = NULL;
+			found = 0;
 		}
+
+		if (found == nent)
+			break;
+
 		iopte += (1 << cnum);
 		ent++;
 		if (iopte >= limit) {
 			iopte = (iommu->page_table + (cnum * CLUSTER_NPAGES));
 			ent = 0;
+
+			/* Multiple cluster allocations must not wrap */
+			cluster = NULL;
+			found = 0;
 		}
 		if (ent == flush_point)
 			__iommu_flushall(iommu);
@@ -175,8 +189,19 @@ static iopte_t *alloc_streaming_cluster(struct sbus_iommu *iommu, unsigned long
 			goto bad;
 	}
 
+	/* ent/iopte points to the last cluster entry we're going to use,
+	 * so save our place for the next allocation.
+	 */
+	if ((iopte + (1 << cnum)) >= limit)
+		ent = 0;
+	else
+		ent = ent + 1;
+	iommu->alloc_info[cnum].next = ent;
+	if (ent == flush_point)
+		__iommu_flushall(iommu);
+
 	/* I've got your streaming cluster right here buddy boy... */
-	return iopte;
+	return cluster;
 
 bad:
 	printk(KERN_EMERG "sbus: alloc_streaming_cluster of npages(%ld) failed!\n",
@@ -186,15 +211,23 @@ bad:
 
 static void free_streaming_cluster(struct sbus_iommu *iommu, u32 base, unsigned long npages)
 {
-	unsigned long cnum, ent;
+	unsigned long cnum, ent, nent;
 	iopte_t *iopte;
 
 	cnum = 0;
+	nent = 1;
 	while ((1UL << cnum) < npages)
 		cnum++;
+	if(cnum >= NCLUSTERS) {
+		nent = 1UL << (cnum - NCLUSTERS);
+		cnum = NCLUSTERS - 1;
+	}
 	ent = (base & CLUSTER_MASK) >> (IO_PAGE_SHIFT + cnum);
 	iopte = iommu->page_table + ((base - MAP_BASE) >> IO_PAGE_SHIFT);
-	iopte_val(*iopte) = 0UL;
+	do {
+		iopte_val(*iopte) = 0UL;
+		iopte += 1 << cnum;
+	} while(--nent);
 
 	/* If the global flush might not have caught this entry,
 	 * adjust the flush point such that we will flush before
diff --git a/arch/sparc64/kernel/setup.c b/arch/sparc64/kernel/setup.c
index 3d097a4bb..438e373ce 100644
--- a/arch/sparc64/kernel/setup.c
+++ b/arch/sparc64/kernel/setup.c
@@ -47,6 +47,7 @@
 #include <asm/mmu_context.h>
 #include <asm/timer.h>
 #include <asm/sections.h>
+#include <asm/setup.h>
 
 #ifdef CONFIG_IP_PNP
 #include <net/ipconfig.h>
@@ -451,8 +452,7 @@ extern unsigned short ram_flags;
 
 extern int root_mountflags;
 
-char saved_command_line[256];
-char reboot_command[256];
+char reboot_command[COMMAND_LINE_SIZE];
 
 static struct pt_regs fake_swapper_regs = { { 0, }, 0, 0, 0, 0 };
 
diff --git a/arch/sparc64/kernel/signal32.c b/arch/sparc64/kernel/signal32.c
index 2fb26c9b9..a9a5b31a3 100644
--- a/arch/sparc64/kernel/signal32.c
+++ b/arch/sparc64/kernel/signal32.c
@@ -461,7 +461,7 @@ asmlinkage void do_rt_sigreturn32(struct pt_regs *regs)
 		err |= restore_fpu_state32(regs, &sf->fpu_state);
 	err |= copy_from_user(&seta, &sf->mask, sizeof(compat_sigset_t));
 	err |= __get_user(u_ss_sp, &sf->stack.ss_sp);
-	st.ss_sp = (void *) (long) u_ss_sp;
+	st.ss_sp = compat_ptr(u_ss_sp);
 	err |= __get_user(st.ss_flags, &sf->stack.ss_flags);
 	err |= __get_user(st.ss_size, &sf->stack.ss_size);
 	if (err)
@@ -520,7 +520,7 @@ setup_frame32(struct sigaction *sa, struct pt_regs *regs, int signr, sigset_t *o
 	struct sigcontext32 __user *sc;
 	unsigned int seta[_COMPAT_NSIG_WORDS];
 	int err = 0;
-	void *sig_address;
+	void __user *sig_address;
 	int sig_code;
 	unsigned long pc = regs->tpc;
 	unsigned long npc = regs->tnpc;
@@ -1031,7 +1031,7 @@ asmlinkage int svr4_setcontext(svr4_ucontext_t __user *c, struct pt_regs *regs)
 		set.sig[1] = setv.sigbits[2] | (((long)setv.sigbits[3]) << 32);
 	
 	err |= __get_user(u_ss_sp, &c->stack.sp);
-	st.ss_sp = (void *) (long) u_ss_sp;
+	st.ss_sp = compat_ptr(u_ss_sp);
 	err |= __get_user(st.ss_flags, &c->stack.flags);
 	err |= __get_user(st.ss_size, &c->stack.size);
 	if (err)
@@ -1360,7 +1360,7 @@ asmlinkage long do_sys32_sigaltstack(u32 ussa, u32 uossa, unsigned long sp)
 		    __get_user(uss.ss_flags, &((stack_t32 __user *)(long)ussa)->ss_flags) ||
 		    __get_user(uss.ss_size, &((stack_t32 __user *)(long)ussa)->ss_size)))
 		return -EFAULT;
-	uss.ss_sp = (void *) (long) u_ss_sp;
+	uss.ss_sp = compat_ptr(u_ss_sp);
 	old_fs = get_fs();
 	set_fs(KERNEL_DS);
 	ret = do_sigaltstack(ussa ? (stack_t __user *) &uss : NULL,
diff --git a/arch/sparc64/kernel/smp.c b/arch/sparc64/kernel/smp.c
index 64b873212..abc65dc6d 100644
--- a/arch/sparc64/kernel/smp.c
+++ b/arch/sparc64/kernel/smp.c
@@ -35,6 +35,7 @@
 #include <asm/uaccess.h>
 #include <asm/timer.h>
 #include <asm/starfire.h>
+#include <asm/tlb.h>
 
 extern int linux_num_cpus;
 extern void calibrate_delay(void);
@@ -406,23 +407,14 @@ static __inline__ void spitfire_xcall_deliver(u64 data0, u64 data1, u64 data2, c
 	int i;
 
 	__asm__ __volatile__("rdpr %%pstate, %0" : "=r" (pstate));
-	for (i = 0; i < NR_CPUS; i++) {
-		if (cpu_isset(i, mask)) {
-			spitfire_xcall_helper(data0, data1, data2, pstate, i);
-			cpu_clear(i, mask);
-			if (cpus_empty(mask))
-				break;
-		}
-	}
+	for_each_cpu_mask(i, mask)
+		spitfire_xcall_helper(data0, data1, data2, pstate, i);
 }
 
 /* Cheetah now allows to send the whole 64-bytes of data in the interrupt
  * packet, but we have no use for that.  However we do take advantage of
  * the new pipelining feature (ie. dispatch to multiple cpus simultaneously).
  */
-#if NR_CPUS > 32
-#error Fixup cheetah_xcall_deliver Dave...
-#endif
 static void cheetah_xcall_deliver(u64 data0, u64 data1, u64 data2, cpumask_t mask)
 {
 	u64 pstate, ver;
@@ -456,25 +448,19 @@ retry:
 
 	nack_busy_id = 0;
 	{
-		cpumask_t work_mask = mask;
 		int i;
 
-		for (i = 0; i < NR_CPUS; i++) {
-			if (cpu_isset(i, work_mask)) {
-				u64 target = (i << 14) | 0x70;
-
-				if (!is_jalapeno)
-					target |= (nack_busy_id << 24);
-				__asm__ __volatile__(
-					"stxa	%%g0, [%0] %1\n\t"
-					"membar	#Sync\n\t"
-					: /* no outputs */
-					: "r" (target), "i" (ASI_INTR_W));
-				nack_busy_id++;
- 				cpu_clear(i, work_mask);
-				if (cpus_empty(work_mask))
-					break;
-			}
+		for_each_cpu_mask(i, mask) {
+			u64 target = (i << 14) | 0x70;
+
+			if (!is_jalapeno)
+				target |= (nack_busy_id << 24);
+			__asm__ __volatile__(
+				"stxa	%%g0, [%0] %1\n\t"
+				"membar	#Sync\n\t"
+				: /* no outputs */
+				: "r" (target), "i" (ASI_INTR_W));
+			nack_busy_id++;
 		}
 	}
 
@@ -507,7 +493,6 @@ retry:
 			printk("CPU[%d]: mondo stuckage result[%016lx]\n",
 			       smp_processor_id(), dispatch_stat);
 		} else {
-			cpumask_t work_mask = mask;
 			int i, this_busy_nack = 0;
 
 			/* Delay some random time with interrupts enabled
@@ -518,22 +503,17 @@ retry:
 			/* Clear out the mask bits for cpus which did not
 			 * NACK us.
 			 */
-			for (i = 0; i < NR_CPUS; i++) {
-				if (cpu_isset(i, work_mask)) {
-					u64 check_mask;
-
-					if (is_jalapeno)
-						check_mask = (0x2UL << (2*i));
-					else
-						check_mask = (0x2UL <<
-							      this_busy_nack);
-					if ((dispatch_stat & check_mask) == 0)
-						cpu_clear(i, mask);
-					this_busy_nack += 2;
-					cpu_clear(i, work_mask);
-					if (cpus_empty(work_mask))
-						break;
-				}
+			for_each_cpu_mask(i, mask) {
+				u64 check_mask;
+
+				if (is_jalapeno)
+					check_mask = (0x2UL << (2*i));
+				else
+					check_mask = (0x2UL <<
+						      this_busy_nack);
+				if ((dispatch_stat & check_mask) == 0)
+					cpu_clear(i, mask);
+				this_busy_nack += 2;
 			}
 
 			goto retry;
@@ -656,9 +636,8 @@ void smp_call_function_client(int irq, struct pt_regs *regs)
 	}
 }
 
-extern unsigned long xcall_flush_tlb_page;
 extern unsigned long xcall_flush_tlb_mm;
-extern unsigned long xcall_flush_tlb_range;
+extern unsigned long xcall_flush_tlb_pending;
 extern unsigned long xcall_flush_tlb_kernel_range;
 extern unsigned long xcall_flush_tlb_all_spitfire;
 extern unsigned long xcall_flush_tlb_all_cheetah;
@@ -675,13 +654,13 @@ extern atomic_t dcpage_flushes_xcall;
 static __inline__ void __local_flush_dcache_page(struct page *page)
 {
 #if (L1DCACHE_SIZE > PAGE_SIZE)
-	__flush_dcache_page(page->virtual,
+	__flush_dcache_page(page_address(page),
 			    ((tlb_type == spitfire) &&
 			     page_mapping(page) != NULL));
 #else
 	if (page_mapping(page) != NULL &&
 	    tlb_type == spitfire)
-		__flush_icache_page(__pa(page->virtual));
+		__flush_icache_page(__pa(page_address(page)));
 #endif
 }
 
@@ -696,6 +675,7 @@ void smp_flush_dcache_page_impl(struct page *page, int cpu)
 	if (cpu == this_cpu) {
 		__local_flush_dcache_page(page);
 	} else if (cpu_online(cpu)) {
+		void *pg_addr = page_address(page);
 		u64 data0;
 
 		if (tlb_type == spitfire) {
@@ -704,14 +684,14 @@ void smp_flush_dcache_page_impl(struct page *page, int cpu)
 			if (page_mapping(page) != NULL)
 				data0 |= ((u64)1 << 32);
 			spitfire_xcall_deliver(data0,
-					       __pa(page->virtual),
-					       (u64) page->virtual,
+					       __pa(pg_addr),
+					       (u64) pg_addr,
 					       mask);
 		} else {
 			data0 =
 				((u64)&xcall_flush_dcache_page_cheetah);
 			cheetah_xcall_deliver(data0,
-					      __pa(page->virtual),
+					      __pa(pg_addr),
 					      0, mask);
 		}
 #ifdef CONFIG_DEBUG_DCFLUSH
@@ -724,6 +704,7 @@ void smp_flush_dcache_page_impl(struct page *page, int cpu)
 
 void flush_dcache_page_all(struct mm_struct *mm, struct page *page)
 {
+	void *pg_addr = page_address(page);
 	cpumask_t mask = cpu_online_map;
 	u64 data0;
 	int this_cpu = get_cpu();
@@ -740,13 +721,13 @@ void flush_dcache_page_all(struct mm_struct *mm, struct page *page)
 		if (page_mapping(page) != NULL)
 			data0 |= ((u64)1 << 32);
 		spitfire_xcall_deliver(data0,
-				       __pa(page->virtual),
-				       (u64) page->virtual,
+				       __pa(pg_addr),
+				       (u64) pg_addr,
 				       mask);
 	} else {
 		data0 = ((u64)&xcall_flush_dcache_page_cheetah);
 		cheetah_xcall_deliver(data0,
-				      __pa(page->virtual),
+				      __pa(pg_addr),
 				      0, mask);
 	}
 #ifdef CONFIG_DEBUG_DCFLUSH
@@ -854,7 +835,6 @@ void smp_flush_tlb_mm(struct mm_struct *mm)
 		int cpu = get_cpu();
 
 		if (atomic_read(&mm->mm_users) == 1) {
-			/* See smp_flush_tlb_page for info about this. */
 			mm->cpu_vm_mask = cpumask_of_cpu(cpu);
 			goto local_flush_and_out;
 		}
@@ -870,27 +850,40 @@ void smp_flush_tlb_mm(struct mm_struct *mm)
 	}
 }
 
-void smp_flush_tlb_range(struct mm_struct *mm, unsigned long start,
-			 unsigned long end)
+void smp_flush_tlb_pending(struct mm_struct *mm, unsigned long nr, unsigned long *vaddrs)
 {
 	u32 ctx = CTX_HWBITS(mm->context);
 	int cpu = get_cpu();
 
-	start &= PAGE_MASK;
-	end    = PAGE_ALIGN(end);
-
 	if (mm == current->active_mm && atomic_read(&mm->mm_users) == 1) {
 		mm->cpu_vm_mask = cpumask_of_cpu(cpu);
 		goto local_flush_and_out;
+	} else {
+		/* This optimization is not valid.  Normally
+		 * we will be holding the page_table_lock, but
+		 * there is an exception which is copy_page_range()
+		 * when forking.  The lock is held during the individual
+		 * page table updates in the parent, but not at the
+		 * top level, which is where we are invoked.
+		 */
+		if (0) {
+			cpumask_t this_cpu_mask = cpumask_of_cpu(cpu);
+
+			/* By virtue of running under the mm->page_table_lock,
+			 * and mmu_context.h:switch_mm doing the same, the
+			 * following operation is safe.
+			 */
+			if (cpus_equal(mm->cpu_vm_mask, this_cpu_mask))
+				goto local_flush_and_out;
+		}
 	}
 
-	smp_cross_call_masked(&xcall_flush_tlb_range,
-			      ctx, start, end,
+	smp_cross_call_masked(&xcall_flush_tlb_pending,
+			      ctx, nr, (unsigned long) vaddrs,
 			      mm->cpu_vm_mask);
 
- local_flush_and_out:
-	__flush_tlb_range(ctx, start, SECONDARY_CONTEXT,
-			  end, PAGE_SIZE, (end-start));
+local_flush_and_out:
+	__flush_tlb_pending(ctx, nr, vaddrs);
 
 	put_cpu();
 }
@@ -907,55 +900,6 @@ void smp_flush_tlb_kernel_range(unsigned long start, unsigned long end)
 	}
 }
 
-void smp_flush_tlb_page(struct mm_struct *mm, unsigned long page)
-{
-	{
-		u32 ctx = CTX_HWBITS(mm->context);
-		int cpu = get_cpu();
-
-		page &= PAGE_MASK;
-		if (mm == current->active_mm &&
-		    atomic_read(&mm->mm_users) == 1) {
-			/* By virtue of being the current address space, and
-			 * having the only reference to it, the following
-			 * operation is safe.
-			 *
-			 * It would not be a win to perform the xcall tlb
-			 * flush in this case, because even if we switch back
-			 * to one of the other processors in cpu_vm_mask it
-			 * is almost certain that all TLB entries for this
-			 * context will be replaced by the time that happens.
-			 */
-			mm->cpu_vm_mask = cpumask_of_cpu(cpu);
-			goto local_flush_and_out;
-		} else {
-			cpumask_t this_cpu_mask = cpumask_of_cpu(cpu);
-
-			/* By virtue of running under the mm->page_table_lock,
-			 * and mmu_context.h:switch_mm doing the same, the
-			 * following operation is safe.
-			 */
-			if (cpus_equal(mm->cpu_vm_mask, this_cpu_mask))
-				goto local_flush_and_out;
-		}
-
-		/* OK, we have to actually perform the cross call.  Most
-		 * likely this is a cloned mm or kswapd is kicking out pages
-		 * for a task which has run recently on another cpu.
-		 */
-		smp_cross_call_masked(&xcall_flush_tlb_page,
-				      ctx, page, 0,
-				      mm->cpu_vm_mask);
-		if (!cpu_isset(cpu, mm->cpu_vm_mask))
-			return;
-
-	local_flush_and_out:
-		__flush_tlb_page(ctx, page, SECONDARY_CONTEXT);
-
-		put_cpu();
-	}
-}
-
 /* CPU capture. */
 /* #define CAPTURE_DEBUG */
 extern unsigned long xcall_capture;
diff --git a/arch/sparc64/kernel/sparc64_ksyms.c b/arch/sparc64/kernel/sparc64_ksyms.c
index 10c782137..5eafadd28 100644
--- a/arch/sparc64/kernel/sparc64_ksyms.c
+++ b/arch/sparc64/kernel/sparc64_ksyms.c
@@ -24,6 +24,7 @@
 #include <linux/socket.h>
 #include <linux/syscalls.h>
 #include <linux/percpu.h>
+#include <linux/init.h>
 #include <net/compat.h>
 
 #include <asm/oplib.h>
@@ -76,7 +77,6 @@ extern int __memcmp(const void *, const void *, __kernel_size_t);
 extern int __strncmp(const char *, const char *, __kernel_size_t);
 extern __kernel_size_t __strlen(const char *);
 extern __kernel_size_t strlen(const char *);
-extern char saved_command_line[];
 extern void linux_sparc_syscall(void);
 extern void rtrap(void);
 extern void show_regs(struct pt_regs *);
@@ -135,6 +135,7 @@ EXPORT_SYMBOL(__write_lock);
 EXPORT_SYMBOL(__write_unlock);
 EXPORT_SYMBOL(__write_trylock);
 /* Out of line spin-locking implementation. */
+EXPORT_SYMBOL(_raw_spin_lock);
 EXPORT_SYMBOL(_raw_spin_lock_flags);
 #endif
 
@@ -142,8 +143,8 @@ EXPORT_SYMBOL(_raw_spin_lock_flags);
 EXPORT_SYMBOL(synchronize_irq);
 
 #if defined(CONFIG_MCOUNT)
-extern void mcount(void);
-EXPORT_SYMBOL_NOVERS(mcount);
+extern void _mcount(void);
+EXPORT_SYMBOL_NOVERS(_mcount);
 #endif
 
 /* CPU online map and active count.  */
@@ -258,7 +259,7 @@ EXPORT_SYMBOL(verify_compat_iovec);
 
 EXPORT_SYMBOL(dump_thread);
 EXPORT_SYMBOL(dump_fpu);
-EXPORT_SYMBOL(pte_alloc_one_kernel);
+EXPORT_SYMBOL(__pte_alloc_one_kernel);
 #ifndef CONFIG_SMP
 EXPORT_SYMBOL(pgt_quicklists);
 #endif
@@ -327,14 +328,12 @@ EXPORT_SYMBOL(sys_getegid);
 EXPORT_SYMBOL(sys_getgid);
 EXPORT_SYMBOL(svr4_getcontext);
 EXPORT_SYMBOL(svr4_setcontext);
-EXPORT_SYMBOL(sys_ioctl);
 EXPORT_SYMBOL(compat_sys_ioctl);
 EXPORT_SYMBOL(sparc32_open);
 EXPORT_SYMBOL(sys_close);
 #endif
 
 /* Special internal versions of library functions. */
-EXPORT_SYMBOL(__memcpy);
 EXPORT_SYMBOL(__memset);
 EXPORT_SYMBOL(_clear_page);
 EXPORT_SYMBOL(clear_user_page);
@@ -351,9 +350,10 @@ EXPORT_SYMBOL(csum_partial);
 EXPORT_SYMBOL(csum_partial_copy_sparc64);
 EXPORT_SYMBOL(ip_fast_csum);
 
-/* Moving data to/from userspace. */
+/* Moving data to/from/in userspace. */
 EXPORT_SYMBOL(__copy_to_user);
 EXPORT_SYMBOL(__copy_from_user);
+EXPORT_SYMBOL(__copy_in_user);
 EXPORT_SYMBOL(__strncpy_from_user);
 EXPORT_SYMBOL(__bzero_noasi);
 
@@ -361,6 +361,8 @@ EXPORT_SYMBOL(__bzero_noasi);
 EXPORT_SYMBOL(phys_base);
 EXPORT_SYMBOL(pfn_base);
 EXPORT_SYMBOL(sparc64_valid_addr_bitmap);
+EXPORT_SYMBOL(page_to_pfn);
+EXPORT_SYMBOL(pfn_to_page);
 
 /* No version information on this, heavily used in inline asm,
  * and will always be 'void __ret_efault(void)'.
diff --git a/arch/sparc64/kernel/sys_sparc.c b/arch/sparc64/kernel/sys_sparc.c
index 8c85f3902..3d6fd1ea1 100644
--- a/arch/sparc64/kernel/sys_sparc.c
+++ b/arch/sparc64/kernel/sys_sparc.c
@@ -449,7 +449,7 @@ asmlinkage void sparc_breakpoint(struct pt_regs *regs)
 	info.si_signo = SIGTRAP;
 	info.si_errno = 0;
 	info.si_code = TRAP_BRKPT;
-	info.si_addr = (void *)regs->tpc;
+	info.si_addr = (void __user *)regs->tpc;
 	info.si_trapno = 0;
 	force_sig_info(SIGTRAP, &info, current);
 #ifdef DEBUG_SPARC_BREAKPOINT
diff --git a/arch/sparc64/kernel/sys_sparc32.c b/arch/sparc64/kernel/sys_sparc32.c
index e55f9e494..56e277383 100644
--- a/arch/sparc64/kernel/sys_sparc32.c
+++ b/arch/sparc64/kernel/sys_sparc32.c
@@ -867,138 +867,6 @@ asmlinkage long sys32_ftruncate64(unsigned int fd, unsigned long high, unsigned
 		return sys_ftruncate(fd, (high << 32) | low);
 }
 
-/* readdir & getdents */
-
-#define NAME_OFFSET(de) ((int) ((de)->d_name - (char __user *) (de)))
-#define ROUND_UP(x) (((x)+sizeof(u32)-1) & ~(sizeof(u32)-1))
-
-struct old_linux_dirent32 {
-	u32		d_ino;
-	u32		d_offset;
-	unsigned short	d_namlen;
-	char		d_name[1];
-};
-
-struct readdir_callback32 {
-	struct old_linux_dirent32 __user * dirent;
-	int count;
-};
-
-static int fillonedir(void * __buf, const char * name, int namlen,
-		      loff_t offset, ino_t ino, unsigned int d_type)
-{
-	struct readdir_callback32 * buf = (struct readdir_callback32 *) __buf;
-	struct old_linux_dirent32 __user * dirent;
-
-	if (buf->count)
-		return -EINVAL;
-	buf->count++;
-	dirent = buf->dirent;
-	put_user(ino, &dirent->d_ino);
-	put_user(offset, &dirent->d_offset);
-	put_user(namlen, &dirent->d_namlen);
-	copy_to_user(dirent->d_name, name, namlen);
-	put_user(0, dirent->d_name + namlen);
-	return 0;
-}
-
-asmlinkage long old32_readdir(unsigned int fd, struct old_linux_dirent32 __user *dirent, unsigned int count)
-{
-	int error = -EBADF;
-	struct file * file;
-	struct readdir_callback32 buf;
-
-	file = fget(fd);
-	if (!file)
-		goto out;
-
-	buf.count = 0;
-	buf.dirent = dirent;
-
-	error = vfs_readdir(file, fillonedir, &buf);
-	if (error < 0)
-		goto out_putf;
-	error = buf.count;
-
-out_putf:
-	fput(file);
-out:
-	return error;
-}
-
-struct linux_dirent32 {
-	u32		d_ino;
-	u32		d_off;
-	unsigned short	d_reclen;
-	char		d_name[1];
-};
-
-struct getdents_callback32 {
-	struct linux_dirent32 __user *current_dir;
-	struct linux_dirent32 __user *previous;
-	int count;
-	int error;
-};
-
-static int filldir(void * __buf, const char * name, int namlen, loff_t offset, ino_t ino,
-		   unsigned int d_type)
-{
-	struct linux_dirent32 __user * dirent;
-	struct getdents_callback32 * buf = (struct getdents_callback32 *) __buf;
-	int reclen = ROUND_UP(NAME_OFFSET(dirent) + namlen + 2);
-
-	buf->error = -EINVAL;	/* only used if we fail.. */
-	if (reclen > buf->count)
-		return -EINVAL;
-	dirent = buf->previous;
-	if (dirent)
-		put_user(offset, &dirent->d_off);
-	dirent = buf->current_dir;
-	buf->previous = dirent;
-	put_user(ino, &dirent->d_ino);
-	put_user(reclen, &dirent->d_reclen);
-	copy_to_user(dirent->d_name, name, namlen);
-	put_user(0, dirent->d_name + namlen);
-	put_user(d_type, (char __user *) dirent + reclen - 1);
-	dirent = (void __user *) dirent + reclen;
-	buf->current_dir = dirent;
-	buf->count -= reclen;
-	return 0;
-}
-
-asmlinkage long sys32_getdents(unsigned int fd, struct linux_dirent32 __user *dirent, unsigned int count)
-{
-	struct file * file;
-	struct linux_dirent32 __user *lastdirent;
-	struct getdents_callback32 buf;
-	int error = -EBADF;
-
-	file = fget(fd);
-	if (!file)
-		goto out;
-
-	buf.current_dir = dirent;
-	buf.previous = NULL;
-	buf.count = count;
-	buf.error = 0;
-
-	error = vfs_readdir(file, filldir, &buf);
-	if (error < 0)
-		goto out_putf;
-	lastdirent = buf.previous;
-	error = buf.error;
-	if (lastdirent) {
-		put_user(file->f_pos, &lastdirent->d_off);
-		error = count - buf.count;
-	}
-out_putf:
-	fput(file);
-out:
-	return error;
-}
-
-/* end of readdir & getdents */
-
 int cp_compat_stat(struct kstat *stat, struct compat_stat __user *statbuf)
 {
 	int err;
@@ -1293,9 +1161,9 @@ asmlinkage long compat_sys_sigaction(int sig, struct old_sigaction32 __user *act
 		u32 u_handler, u_restorer;
 		
 		ret = get_user(u_handler, &act->sa_handler);
-		new_ka.sa.sa_handler = (void *) (long) u_handler;
+		new_ka.sa.sa_handler =  compat_ptr(u_handler);
 		ret |= __get_user(u_restorer, &act->sa_restorer);
-		new_ka.sa.sa_restorer = (void *) (long) u_restorer;
+		new_ka.sa.sa_restorer = compat_ptr(u_restorer);
 		ret |= __get_user(new_ka.sa.sa_flags, &act->sa_flags);
 		ret |= __get_user(mask, &act->sa_mask);
 		if (ret)
@@ -1340,7 +1208,7 @@ asmlinkage long compat_sys_rt_sigaction(int sig,
 
 		new_ka.ka_restorer = restorer;
 		ret = get_user(u_handler, &act->sa_handler);
-		new_ka.sa.sa_handler = (void *) (long) u_handler;
+		new_ka.sa.sa_handler =  compat_ptr(u_handler);
 		ret |= __copy_from_user(&set32, &act->sa_mask, sizeof(compat_sigset_t));
 		switch (_NSIG_WORDS) {
 		case 4: new_ka.sa.sa_mask.sig[3] = set32.sig[6] | (((long)set32.sig[7]) << 32);
@@ -1350,7 +1218,7 @@ asmlinkage long compat_sys_rt_sigaction(int sig,
 		}
 		ret |= __get_user(new_ka.sa.sa_flags, &act->sa_flags);
 		ret |= __get_user(u_restorer, &act->sa_restorer);
-		new_ka.sa.sa_restorer = (void *) (long) u_restorer;
+		new_ka.sa.sa_restorer = compat_ptr(u_restorer);
                 if (ret)
                 	return -EFAULT;
 	}
diff --git a/arch/sparc64/kernel/sys_sunos32.c b/arch/sparc64/kernel/sys_sunos32.c
index 0ed11eaec..ace96ee27 100644
--- a/arch/sparc64/kernel/sys_sunos32.c
+++ b/arch/sparc64/kernel/sys_sunos32.c
@@ -465,7 +465,7 @@ asmlinkage int sunos_nosys(void)
 	info.si_signo = SIGSYS;
 	info.si_errno = 0;
 	info.si_code = __SI_FAULT|0x100;
-	info.si_addr = (void *)regs->tpc;
+	info.si_addr = (void __user *)regs->tpc;
 	info.si_trapno = regs->u_regs[UREG_G1];
 	send_sig_info(SIGSYS, &info, current);
 	if (cnt++ < 4) {
@@ -1280,7 +1280,7 @@ asmlinkage int sunos_sigaction (int sig,
 		if (get_user(u_handler, &act->sa_handler) ||
 		    __get_user(new_ka.sa.sa_flags, &act->sa_flags))
 			return -EFAULT;
-		new_ka.sa.sa_handler = (void *) (long) u_handler;
+		new_ka.sa.sa_handler = compat_ptr(u_handler);
 		__get_user(mask, &act->sa_mask);
 		new_ka.sa.sa_restorer = NULL;
 		new_ka.ka_restorer = NULL;
diff --git a/arch/sparc64/kernel/systbls.S b/arch/sparc64/kernel/systbls.S
index 2187876ec..4aee27656 100644
--- a/arch/sparc64/kernel/systbls.S
+++ b/arch/sparc64/kernel/systbls.S
@@ -15,6 +15,7 @@
 	.text
 	.align	4
 
+#ifdef CONFIG_COMPAT
 	/* First, the 32-bit Linux native syscall table. */
 
 	.globl sys_call_table32
@@ -53,13 +54,13 @@ sys_call_table32:
 	.word compat_sys_fcntl64, sys_ni_syscall, compat_sys_statfs, compat_sys_fstatfs, sys_oldumount
 /*160*/	.word compat_sys_sched_setaffinity, compat_sys_sched_getaffinity, sys32_getdomainname, sys32_setdomainname, sys_nis_syscall
 	.word sys_quotactl, sys_set_tid_address, compat_sys_mount, sys_ustat, sys32_setxattr
-/*170*/	.word sys32_lsetxattr, sys32_fsetxattr, sys_getxattr, sys_lgetxattr, sys32_getdents
+/*170*/	.word sys32_lsetxattr, sys32_fsetxattr, sys_getxattr, sys_lgetxattr, compat_sys_getdents
 	.word sys_setsid, sys_fchdir, sys32_fgetxattr, sys_listxattr, sys_llistxattr
 /*180*/	.word sys32_flistxattr, sys_removexattr, sys_lremovexattr, compat_sys_sigpending, sys_ni_syscall
 	.word sys32_setpgid, sys32_fremovexattr, sys32_tkill, sys32_exit_group, sparc64_newuname
 /*190*/	.word sys32_init_module, sparc64_personality, sys_remap_file_pages, sys32_epoll_create, sys32_epoll_ctl
 	.word sys32_epoll_wait, sys_nis_syscall, sys_getppid, sys32_sigaction, sys_sgetmask
-/*200*/	.word sys32_ssetmask, sys_sigsuspend, compat_sys_newlstat, sys_uselib, old32_readdir
+/*200*/	.word sys32_ssetmask, sys_sigsuspend, compat_sys_newlstat, sys_uselib, compat_old_readdir
 	.word sys32_readahead, sys32_socketcall, sys32_syslog, sys32_lookup_dcookie, sys32_fadvise64
 /*210*/	.word sys32_fadvise64_64, sys32_tgkill, sys32_waitpid, sys_swapoff, sys32_sysinfo
 	.word sys32_ipc, sys32_sigreturn, sys_clone, sys_nis_syscall, sys32_adjtimex
@@ -77,6 +78,8 @@ sys_call_table32:
 	.word sys_mq_timedsend, sys_mq_timedreceive, compat_sys_mq_notify, compat_sys_mq_getsetattr, sys_ni_syscall
 /*280*/	.word sys_ni_syscall, sys_ni_syscall, sys_ni_syscall
 
+#endif /* CONFIG_COMPAT */
+
 	/* Now the 64-bit native Linux syscall table. */
 
 	.align	4
@@ -85,7 +88,7 @@ sys_call_table64:
 sys_call_table:
 /*0*/	.word sys_restart_syscall, sparc_exit, sys_fork, sys_read, sys_write
 /*5*/	.word sys_open, sys_close, sys_wait4, sys_creat, sys_link
-/*10*/  .word sys_unlink, sunos_execv, sys_chdir, sys_chown, sys_mknod
+/*10*/  .word sys_unlink, sys_nis_syscall, sys_chdir, sys_chown, sys_mknod
 /*15*/	.word sys_chmod, sys_lchown, sparc_brk, sys_perfctr, sys_lseek
 /*20*/	.word sys_getpid, sys_capget, sys_capset, sys_setuid, sys_getuid
 /*25*/	.word sys_nis_syscall, sys_ptrace, sys_alarm, sys_sigaltstack, sys_nis_syscall
diff --git a/arch/sparc64/kernel/time.c b/arch/sparc64/kernel/time.c
index 06e1579f0..f961a0d3b 100644
--- a/arch/sparc64/kernel/time.c
+++ b/arch/sparc64/kernel/time.c
@@ -423,7 +423,7 @@ static unsigned long timer_ticks_per_nsec_quotient;
 
 #define TICK_SIZE (tick_nsec / 1000)
 
-static __inline__ void timer_check_rtc(void)
+static inline void timer_check_rtc(void)
 {
 	/* last time the cmos clock got updated */
 	static long last_rtc_update;
@@ -443,8 +443,7 @@ static __inline__ void timer_check_rtc(void)
 
 void sparc64_do_profile(struct pt_regs *regs)
 {
-	unsigned long pc = regs->tpc;
-	unsigned long o7 = regs->u_regs[UREG_RETPC];
+	unsigned long pc;
 
 	profile_hook(regs);
 
@@ -454,32 +453,14 @@ void sparc64_do_profile(struct pt_regs *regs)
 	if (!prof_buffer)
 		return;
 
-	{
-		extern int rwlock_impl_begin, rwlock_impl_end;
-		extern int atomic_impl_begin, atomic_impl_end;
-		extern int __memcpy_begin, __memcpy_end;
-		extern int __bzero_begin, __bzero_end;
-		extern int __bitops_begin, __bitops_end;
-
-		if ((pc >= (unsigned long) &atomic_impl_begin &&
-		     pc < (unsigned long) &atomic_impl_end) ||
-		    (pc >= (unsigned long) &rwlock_impl_begin &&
-		     pc < (unsigned long) &rwlock_impl_end) ||
-		    (pc >= (unsigned long) &__memcpy_begin &&
-		     pc < (unsigned long) &__memcpy_end) ||
-		    (pc >= (unsigned long) &__bzero_begin &&
-		     pc < (unsigned long) &__bzero_end) ||
-		    (pc >= (unsigned long) &__bitops_begin &&
-		     pc < (unsigned long) &__bitops_end))
-			pc = o7;
-
-		pc -= (unsigned long) _stext;
-		pc >>= prof_shift;
-
-		if(pc >= prof_len)
-			pc = prof_len - 1;
-		atomic_inc((atomic_t *)&prof_buffer[pc]);
-	}
+	pc = regs->tpc;
+
+	pc -= (unsigned long) _stext;
+	pc >>= prof_shift;
+
+	if(pc >= prof_len)
+		pc = prof_len - 1;
+	atomic_inc((atomic_t *)&prof_buffer[pc]);
 }
 
 static irqreturn_t timer_interrupt(int irq, void *dev_id, struct pt_regs * regs)
@@ -1139,7 +1120,6 @@ EXPORT_SYMBOL(do_settimeofday);
  */
 void do_gettimeofday(struct timeval *tv)
 {
-	unsigned long flags;
 	unsigned long seq;
 	unsigned long usec, sec;
 	unsigned long max_ntp_tick = tick_usec - tickadj;
@@ -1147,7 +1127,7 @@ void do_gettimeofday(struct timeval *tv)
 	do {
 		unsigned long lost;
 
-		seq = read_seqbegin_irqsave(&xtime_lock, flags);
+		seq = read_seqbegin(&xtime_lock);
 		usec = do_gettimeoffset();
 		lost = jiffies - wall_jiffies;
 
@@ -1166,8 +1146,18 @@ void do_gettimeofday(struct timeval *tv)
 			usec += lost * tick_usec;
 
 		sec = xtime.tv_sec;
-		usec += (xtime.tv_nsec / 1000);
-	} while (read_seqretry_irqrestore(&xtime_lock, seq, flags));
+
+		/* Believe it or not, this divide shows up on
+		 * kernel profiles.  The problem is that it is
+		 * both 64-bit and signed.  Happily, 32-bits
+		 * of precision is all we really need and in
+		 * doing so gcc ends up emitting a cheap multiply.
+		 *
+		 * XXX Why is tv_nsec 'long' and 'signed' in
+		 * XXX the first place, can it even be negative?
+		 */
+		usec += ((unsigned int) xtime.tv_nsec / 1000U);
+	} while (read_seqretry(&xtime_lock, seq));
 
 	while (usec >= 1000000) {
 		usec -= 1000000;
diff --git a/arch/sparc64/kernel/traps.c b/arch/sparc64/kernel/traps.c
index b4fb0fbef..473901974 100644
--- a/arch/sparc64/kernel/traps.c
+++ b/arch/sparc64/kernel/traps.c
@@ -93,7 +93,7 @@ void bad_trap (struct pt_regs *regs, long lvl)
 	info.si_signo = SIGILL;
 	info.si_errno = 0;
 	info.si_code = ILL_ILLTRP;
-	info.si_addr = (void *)regs->tpc;
+	info.si_addr = (void __user *)regs->tpc;
 	info.si_trapno = lvl;
 	force_sig_info(SIGILL, &info, current);
 }
@@ -133,7 +133,7 @@ void instruction_access_exception(struct pt_regs *regs,
 	info.si_signo = SIGSEGV;
 	info.si_errno = 0;
 	info.si_code = SEGV_MAPERR;
-	info.si_addr = (void *)regs->tpc;
+	info.si_addr = (void __user *)regs->tpc;
 	info.si_trapno = 0;
 	force_sig_info(SIGSEGV, &info, current);
 }
@@ -176,7 +176,7 @@ void data_access_exception (struct pt_regs *regs,
 	info.si_signo = SIGSEGV;
 	info.si_errno = 0;
 	info.si_code = SEGV_MAPERR;
-	info.si_addr = (void *)sfar;
+	info.si_addr = (void __user *)sfar;
 	info.si_trapno = 0;
 	force_sig_info(SIGSEGV, &info, current);
 }
@@ -1617,7 +1617,7 @@ void do_fpe_common(struct pt_regs *regs)
 		}
 		info.si_signo = SIGFPE;
 		info.si_errno = 0;
-		info.si_addr = (void *)regs->tpc;
+		info.si_addr = (void __user *)regs->tpc;
 		info.si_trapno = 0;
 		info.si_code = __SI_FAULT;
 		if ((fsr & 0x1c000) == (1 << 14)) {
@@ -1672,7 +1672,7 @@ void do_tof(struct pt_regs *regs)
 	info.si_signo = SIGEMT;
 	info.si_errno = 0;
 	info.si_code = EMT_TAGOVF;
-	info.si_addr = (void *)regs->tpc;
+	info.si_addr = (void __user *)regs->tpc;
 	info.si_trapno = 0;
 	force_sig_info(SIGEMT, &info, current);
 }
@@ -1690,7 +1690,7 @@ void do_div0(struct pt_regs *regs)
 	info.si_signo = SIGFPE;
 	info.si_errno = 0;
 	info.si_code = FPE_INTDIV;
-	info.si_addr = (void *)regs->tpc;
+	info.si_addr = (void __user *)regs->tpc;
 	info.si_trapno = 0;
 	force_sig_info(SIGFPE, &info, current);
 }
@@ -1850,7 +1850,7 @@ void do_illegal_instruction(struct pt_regs *regs)
 	info.si_signo = SIGILL;
 	info.si_errno = 0;
 	info.si_code = ILL_ILLOPC;
-	info.si_addr = (void *)pc;
+	info.si_addr = (void __user *)pc;
 	info.si_trapno = 0;
 	force_sig_info(SIGILL, &info, current);
 }
@@ -1872,7 +1872,7 @@ void mem_address_unaligned(struct pt_regs *regs, unsigned long sfar, unsigned lo
 	info.si_signo = SIGBUS;
 	info.si_errno = 0;
 	info.si_code = BUS_ADRALN;
-	info.si_addr = (void *)sfar;
+	info.si_addr = (void __user *)sfar;
 	info.si_trapno = 0;
 	force_sig_info(SIGBUS, &info, current);
 }
@@ -1888,7 +1888,7 @@ void do_privop(struct pt_regs *regs)
 	info.si_signo = SIGILL;
 	info.si_errno = 0;
 	info.si_code = ILL_PRVOPC;
-	info.si_addr = (void *)regs->tpc;
+	info.si_addr = (void __user *)regs->tpc;
 	info.si_trapno = 0;
 	force_sig_info(SIGILL, &info, current);
 }
diff --git a/arch/sparc64/lib/Makefile b/arch/sparc64/lib/Makefile
index 230e59f18..2da5af9a1 100644
--- a/arch/sparc64/lib/Makefile
+++ b/arch/sparc64/lib/Makefile
@@ -5,7 +5,7 @@
 EXTRA_AFLAGS := -ansi
 EXTRA_CFLAGS := -Werror
 
-lib-y := PeeCeeI.o blockops.o strlen.o strncmp.o \
+lib-y := PeeCeeI.o copy_page.o clear_page.o strlen.o strncmp.o \
 	 memscan.o strncpy_from_user.o strlen_user.o memcmp.o checksum.o \
 	 VIScopy.o VISbzero.o VISmemset.o VIScsum.o VIScsumcopy.o \
 	 VIScsumcopyusr.o VISsave.o atomic.o rwlock.o bitops.o \
diff --git a/arch/sparc64/lib/U3copy_from_user.S b/arch/sparc64/lib/U3copy_from_user.S
index c2ae2f4f4..46b446b14 100644
--- a/arch/sparc64/lib/U3copy_from_user.S
+++ b/arch/sparc64/lib/U3copy_from_user.S
@@ -1,20 +1,31 @@
-/* $Id: U3copy_from_user.S,v 1.4 2002/01/15 07:16:26 davem Exp $
- * U3memcpy.S: UltraSparc-III optimized copy from userspace.
+/* U3copy_from_user.S: UltraSparc-III optimized copy from userspace.
  *
- * Copyright (C) 1999, 2000 David S. Miller (davem@redhat.com)
+ * Copyright (C) 1999, 2000, 2004 David S. Miller (davem@redhat.com)
  */
 
-#ifdef __KERNEL__
 #include <asm/visasm.h>
 #include <asm/asi.h>
 #include <asm/dcu.h>
 #include <asm/spitfire.h>
-#undef SMALL_COPY_USES_FPU
+
+#define XCC xcc
+
+#define EXNV_RAW(x,y,a,b)		\
+98:	x,y;				\
+	.section .fixup;		\
+	.align 4;			\
+99:	ba U3cfu_fixup;			\
+	 a, b, %o1;			\
+	.section __ex_table;		\
+	.align 4;			\
+	.word 98b, 99b;			\
+	.text;				\
+	.align 4;
 #define EXNV(x,y,a,b)			\
 98:	x,y;				\
 	.section .fixup;		\
 	.align 4;			\
-99:	VISExitHalf;			\
+99:	add %o1, %o3, %o0;		\
 	ba U3cfu_fixup;			\
 	 a, b, %o1;			\
 	.section __ex_table;		\
@@ -22,6 +33,32 @@
 	.word 98b, 99b;			\
 	.text;				\
 	.align 4;
+#define EXNV4(x,y,a,b)			\
+98:	x,y;				\
+	.section .fixup;		\
+	.align 4;			\
+99:	add %o1, %o3, %o0;		\
+	a, b, %o1;			\
+	ba U3cfu_fixup;			\
+	 add %o1, 4, %o1;		\
+	.section __ex_table;		\
+	.align 4;			\
+	.word 98b, 99b;			\
+	.text;				\
+	.align 4;
+#define EXNV8(x,y,a,b)			\
+98:	x,y;				\
+	.section .fixup;		\
+	.align 4;			\
+99:	add %o1, %o3, %o0;		\
+	a, b, %o1;			\
+	ba U3cfu_fixup;			\
+	 add %o1, 8, %o1;		\
+	.section __ex_table;		\
+	.align 4;			\
+	.word 98b, 99b;			\
+	.text;				\
+	.align 4;
 #define EX(x,y,a,b)			\
 98:	x,y;				\
 	.section .fixup;		\
@@ -77,18 +114,9 @@
 	.word 98b, 99b;			\
 	.text;				\
 	.align 4;
-#else
-#define ASI_BLK_P 0xf0
-#define FPRS_FEF  0x04
-#define VISEntryHalf rd %fprs, %o5; wr %g0, FPRS_FEF, %fprs
-#define VISExitHalf and %o5, FPRS_FEF, %o5; wr %o5, 0x0, %fprs
-#define SMALL_COPY_USES_FPU
-#define EXNV(x,y,a,b)	x,y;
-#define EX(x,y,a,b)	x,y;
-#define EX2(x,y)	x,y;
-#define EX3(x,y)	x,y;
-#define EX4(x,y)	x,y;
-#endif
+
+	.register	%g2,#scratch
+	.register	%g3,#scratch
 
 	/* Special/non-trivial issues of this code:
 	 *
@@ -109,398 +137,264 @@
 	 * of up to 2.4GB per second.
 	 */
 
-	.globl		U3copy_from_user
-U3copy_from_user: /* %o0=dst, %o1=src, %o2=len */
-#ifndef __KERNEL__
-	/* Save away original 'dst' for memcpy return value. */
-	mov		%o0, %g3			! A0	Group
-#endif
-	/* Anything to copy at all? */
-	cmp		%o2, 0				! A1
-	ble,pn		%icc, U3copy_from_user_short_ret! BR
-
-	/* Extremely small copy? */
-	 cmp		%o2, 31				! A0	Group
-	ble,pn		%icc, U3copy_from_user_short	! BR
-
-	/* Large enough to use unrolled prefetch loops? */
-	 cmp		%o2, 0x100			! A1
-	bge,a,pt	%icc, U3copy_from_user_enter	! BR	Group
-	 andcc		%o0, 0x3f, %g2			! A0
-
-	ba,pt		%xcc, U3copy_from_user_toosmall	! BR	Group
-	 andcc		%o0, 0x7, %g2			! A0
-
-	.align		32
-U3copy_from_user_short:
-	/* Copy %o2 bytes from src to dst, one byte at a time. */
-	EXNV(lduba [%o1 + 0x00] %asi, %o3, add %o2, %g0)! MS	Group
-	add		%o1, 0x1, %o1			! A0
-	add		%o0, 0x1, %o0			! A1
-	subcc		%o2, 1, %o2			! A0	Group
-
-	bg,pt		%icc, U3copy_from_user_short	! BR
-	 stb		%o3, [%o0 + -1]			! MS	Group (1-cycle stall)
-
-U3copy_from_user_short_ret:
-#ifdef __KERNEL__
-	retl						! BR	Group (0-4 cycle stall)
-	 clr		%o0				! A0
-#else
-	retl						! BR	Group (0-4 cycle stall)
-	 mov		%g3, %o0			! A0
-#endif
-
-	/* Here len >= (6 * 64) and condition codes reflect execution
+	.globl	U3copy_from_user
+U3copy_from_user:	/* %o0=dst, %o1=src, %o2=len */
+	cmp		%o2, 0
+	be,pn		%XCC, 85f
+	 or		%o0, %o1, %o3
+	cmp		%o2, 16
+	bleu,a,pn	%XCC, 80f
+	 or		%o3, %o2, %o3
+
+	cmp		%o2, 256
+	blu,pt		%XCC, 70f
+	 andcc		%o3, 0x7, %g0
+
+	ba,pt		%xcc, 1f
+	 andcc		%o0, 0x3f, %g2
+
+	/* Here len >= 256 and condition codes reflect execution
 	 * of "andcc %o0, 0x7, %g2", done by caller.
 	 */
 	.align		64
-U3copy_from_user_enter:
+1:
 	/* Is 'dst' already aligned on an 64-byte boundary? */
-	be,pt		%xcc, 2f			! BR
+	be,pt		%XCC, 2f
 
 	/* Compute abs((dst & 0x3f) - 0x40) into %g2.  This is the number
 	 * of bytes to copy to make 'dst' 64-byte aligned.  We pre-
 	 * subtract this from 'len'.
 	 */
-	 sub		%g2, 0x40, %g2			! A0	Group
-	sub		%g0, %g2, %g2			! A0	Group
-	sub		%o2, %g2, %o2			! A0	Group
+	 sub		%g2, 0x40, %g2
+	sub		%g0, %g2, %g2
+	sub		%o2, %g2, %o2
 
 	/* Copy %g2 bytes from src to dst, one byte at a time. */
-1:	EXNV(lduba [%o1 + 0x00] %asi, %o3, add %o2, %g2)! MS	(Group)
-	add		%o1, 0x1, %o1			! A1
-	add		%o0, 0x1, %o0			! A0	Group
-	subcc		%g2, 0x1, %g2			! A1
+1:	EXNV_RAW(lduba [%o1 + 0x00] %asi, %o3, add %o2, %g2)
+	add		%o1, 0x1, %o1
+	add		%o0, 0x1, %o0
+	subcc		%g2, 0x1, %g2
 
-	bg,pt		%icc, 1b			! BR	Group
-	 stb		%o3, [%o0 + -1]			! MS	Group
+	bg,pt		%XCC, 1b
+	 stb		%o3, [%o0 + -1]
 
-2:	VISEntryHalf					! MS+MS
-	and		%o1, 0x7, %g1			! A1
-	ba,pt		%xcc, U3copy_from_user_begin		! BR
-	 alignaddr	%o1, %g0, %o1			! MS	      (Break-after)
+2:	VISEntryHalf
+	and		%o1, 0x7, %g1
+	ba,pt		%xcc, 1f
+	 alignaddr	%o1, %g0, %o1
 
 	.align		64
-U3copy_from_user_begin:
-#ifdef __KERNEL__
-	.globl		U3copy_from_user_nop_1_6
-U3copy_from_user_nop_1_6:
-	ldxa		[%g0] ASI_DCU_CONTROL_REG, %g3
-	sethi		%uhi(DCU_PE), %o3
-	sllx		%o3, 32, %o3
-	or		%g3, %o3, %o3
-	stxa		%o3, [%g0] ASI_DCU_CONTROL_REG	! Enable P-cache
-	membar		#Sync
-#endif
-	prefetcha	[%o1 + 0x000] %asi, #one_read	! MS	Group1
-	prefetcha	[%o1 + 0x040] %asi, #one_read	! MS	Group2
-	andn		%o2, (0x40 - 1), %o4		! A0
-	prefetcha	[%o1 + 0x080] %asi, #one_read	! MS	Group3
-	cmp		%o4, 0x140			! A0
-	prefetcha	[%o1 + 0x0c0] %asi, #one_read	! MS	Group4
-	EX(ldda [%o1 + 0x000] %asi, %f0, add %o2, %g0)	! MS	Group5 (%f0 results at G8)
-	bge,a,pt	%icc, 1f			! BR
-
-	prefetcha	[%o1 + 0x100] %asi, #one_read	! MS	Group6
-1:	EX(ldda [%o1 + 0x008] %asi, %f2, add %o2, %g0)	! AX	       (%f2 results at G9)
-	cmp		%o4, 0x180			! A1
-	bge,a,pt	%icc, 1f			! BR
-	 prefetcha	[%o1 + 0x140] %asi, #one_read	! MS	Group7
-1:	EX(ldda [%o1 + 0x010] %asi, %f4, add %o2, %g0)	! AX	       (%f4 results at G10)
-	cmp		%o4, 0x1c0			! A1
-	bge,a,pt	%icc, 1f			! BR
-
-	 prefetcha	[%o1 + 0x180] %asi, #one_read	! MS	Group8
-1:	faligndata	%f0, %f2, %f16			! FGA	Group9 (%f16 at G12)
-	EX(ldda [%o1 + 0x018] %asi, %f6, add %o2, %g0)	! AX	       (%f6 results at G12)
-	faligndata	%f2, %f4, %f18			! FGA	Group10 (%f18 results at G13)
-	EX(ldda [%o1 + 0x020] %asi, %f8, add %o2, %g0)	! MS	        (%f8 results at G13)
-	faligndata	%f4, %f6, %f20			! FGA	Group12	(1-cycle stall,%f20 at G15)
-	EX(ldda [%o1 + 0x028] %asi, %f10, add %o2, %g0)	! MS		(%f10 results at G15)
-	faligndata	%f6, %f8, %f22			! FGA	Group13 (%f22 results at G16)
-
-	EX(ldda [%o1 + 0x030] %asi, %f12, add %o2, %g0)	! MS		(%f12 results at G16)
-	faligndata	%f8, %f10, %f24			! FGA	Group15 (1-cycle stall,%f24 at G18)
-	EX(ldda [%o1 + 0x038] %asi, %f14, add %o2, %g0)	! MS		(%f14 results at G18)
-	faligndata	%f10, %f12, %f26		! FGA	Group16 (%f26 results at G19)
-	EX(ldda [%o1 + 0x040] %asi, %f0, add %o2, %g0)	! MS		(%f0 results at G19)
-
-	/* We only use the first loop if len > (7 * 64). */
-	subcc		%o4, 0x1c0, %o4			! A0	Group17
-	bg,pt		%icc, U3copy_from_user_loop1	! BR
-	 add		%o1, 0x40, %o1			! A1
-
-	add		%o4, 0x140, %o4			! A0	Group18
-	ba,pt		%xcc, U3copy_from_user_loop2	! BR
-	 srl		%o4, 6, %o3			! A0	Group19
-	nop
-	nop
-	nop
-	nop
-	nop
-
-	nop
-	nop
-
-	/* This loop performs the copy and queues new prefetches.
-	 * We drop into the second loop when len <= (5 * 64).  Note
-	 * that this (5 * 64) factor has been subtracted from len
-	 * already.
-	 */
-U3copy_from_user_loop1:
-	EX2(ldda [%o1 + 0x008] %asi, %f2)		! MS	Group2	(%f2 results at G5)
-	faligndata	%f12, %f14, %f28		! FGA		(%f28 results at G5)
-	EX2(ldda [%o1 + 0x010] %asi, %f4)		! MS	Group3	(%f4 results at G6)
-	faligndata	%f14, %f0, %f30			! FGA	Group4	(1-cycle stall, %f30 at G7)
-	stda		%f16, [%o0] ASI_BLK_P		! MS
-	EX2(ldda [%o1 + 0x018] %asi, %f6)		! AX		(%f6 results at G7)
-
-	faligndata	%f0, %f2, %f16			! FGA	Group12 (7-cycle stall)
-	EX2(ldda [%o1 + 0x020] %asi, %f8)		! MS	        (%f8 results at G15)
-	faligndata	%f2, %f4, %f18			! FGA	Group13	(%f18 results at G16)
-	EX2(ldda [%o1 + 0x028] %asi, %f10)		! MS		(%f10 results at G16)
-	faligndata	%f4, %f6, %f20			! FGA	Group14	(%f20 results at G17)
-	EX2(ldda [%o1 + 0x030] %asi, %f12)		! MS		(%f12 results at G17)
-	faligndata	%f6, %f8, %f22			! FGA	Group15	(%f22 results at G18)
-	EX2(ldda [%o1 + 0x038] %asi, %f14)		! MS		(%f14 results at G18)
-
-	faligndata	%f8, %f10, %f24			! FGA	Group16	(%f24 results at G19)
-	EX2(ldda [%o1 + 0x040] %asi, %f0)		! AX		(%f0 results at G19)
-	prefetcha	[%o1 + 0x180] %asi, #one_read	! MS
-	faligndata	%f10, %f12, %f26		! FGA	Group17	(%f26 results at G20)
-	subcc		%o4, 0x40, %o4			! A0
-	add		%o1, 0x40, %o1			! A1
-	bg,pt		%xcc, U3copy_from_user_loop1	! BR
-	 add		%o0, 0x40, %o0			! A0	Group18
-
-U3copy_from_user_loop2_enter:
-	mov		5, %o3				! A1
-
-	/* This loop performs on the copy, no new prefetches are
-	 * queued.  We do things this way so that we do not perform
-	 * any spurious prefetches past the end of the src buffer.
-	 */
-U3copy_from_user_loop2:
-	EX3(ldda [%o1 + 0x008] %asi, %f2)		! MS
-	faligndata	%f12, %f14, %f28		! FGA	Group2
-	EX3(ldda [%o1 + 0x010] %asi, %f4)		! MS
-	faligndata	%f14, %f0, %f30			! FGA	Group4	(1-cycle stall)
-	stda		%f16, [%o0] ASI_BLK_P		! MS
-	EX3(ldda [%o1 + 0x018] %asi, %f6)		! AX
-	faligndata	%f0, %f2, %f16			! FGA	Group12 (7-cycle stall)
-
-	EX3(ldda [%o1 + 0x020] %asi, %f8)		! MS
-	faligndata	%f2, %f4, %f18			! FGA	Group13
-	EX3(ldda [%o1 + 0x028] %asi, %f10)		! MS
-	faligndata	%f4, %f6, %f20			! FGA	Group14
-	EX3(ldda [%o1 + 0x030] %asi, %f12)		! MS
-	faligndata	%f6, %f8, %f22			! FGA	Group15
-	EX3(ldda [%o1 + 0x038] %asi, %f14)		! MS
-	faligndata	%f8, %f10, %f24			! FGA	Group16
-
-	EX3(ldda [%o1 + 0x040] %asi, %f0)		! AX
-	faligndata	%f10, %f12, %f26		! FGA	Group17
-	subcc		%o3, 0x01, %o3			! A0
-	add		%o1, 0x40, %o1			! A1
-	bg,pt		%xcc, U3copy_from_user_loop2	! BR
-	 add		%o0, 0x40, %o0			! A0	Group18
+1:
+	membar		#StoreLoad | #StoreStore | #LoadStore
+	prefetcha	[%o1 + 0x000] %asi, #one_read
+	prefetcha	[%o1 + 0x040] %asi, #one_read
+	andn		%o2, (0x40 - 1), %o4
+	prefetcha	[%o1 + 0x080] %asi, #one_read
+	prefetcha	[%o1 + 0x0c0] %asi, #one_read
+	EX(ldda [%o1 + 0x000] %asi, %f0, add %o2, %g0)
+	prefetcha	[%o1 + 0x100] %asi, #one_read
+	EX(ldda [%o1 + 0x008] %asi, %f2, add %o2, %g0)
+	prefetcha	[%o1 + 0x140] %asi, #one_read
+	EX(ldda [%o1 + 0x010] %asi, %f4, add %o2, %g0)
+	prefetcha	[%o1 + 0x180] %asi, #one_read
+	faligndata	%f0, %f2, %f16
+	EX(ldda [%o1 + 0x018] %asi, %f6, add %o2, %g0)
+	faligndata	%f2, %f4, %f18
+	EX(ldda [%o1 + 0x020] %asi, %f8, add %o2, %g0)
+	faligndata	%f4, %f6, %f20
+	EX(ldda [%o1 + 0x028] %asi, %f10, add %o2, %g0)
+	faligndata	%f6, %f8, %f22
+
+	EX(ldda [%o1 + 0x030] %asi, %f12, add %o2, %g0)
+	faligndata	%f8, %f10, %f24
+	EX(ldda [%o1 + 0x038] %asi, %f14, add %o2, %g0)
+	faligndata	%f10, %f12, %f26
+	EX(ldda [%o1 + 0x040] %asi, %f0, add %o2, %g0)
+
+	sub		%o4, 0x80, %o4
+	add		%o1, 0x40, %o1
+	ba,pt		%xcc, 1f
+	 srl		%o4, 6, %o3
+
+	.align		64
+1:
+	EX3(ldda [%o1 + 0x008] %asi, %f2)
+	faligndata	%f12, %f14, %f28
+	EX3(ldda [%o1 + 0x010] %asi, %f4)
+	faligndata	%f14, %f0, %f30
+	stda		%f16, [%o0] ASI_BLK_P
+	EX3(ldda [%o1 + 0x018] %asi, %f6)
+	faligndata	%f0, %f2, %f16
+
+	EX3(ldda [%o1 + 0x020] %asi, %f8)
+	faligndata	%f2, %f4, %f18
+	EX3(ldda [%o1 + 0x028] %asi, %f10)
+	faligndata	%f4, %f6, %f20
+	EX3(ldda [%o1 + 0x030] %asi, %f12)
+	faligndata	%f6, %f8, %f22
+	EX3(ldda [%o1 + 0x038] %asi, %f14)
+	faligndata	%f8, %f10, %f24
+
+	EX3(ldda [%o1 + 0x040] %asi, %f0)
+	prefetcha	[%o1 + 0x180] %asi, #one_read
+	faligndata	%f10, %f12, %f26
+	subcc		%o3, 0x01, %o3
+	add		%o1, 0x40, %o1
+	bg,pt		%XCC, 1b
+	 add		%o0, 0x40, %o0
 
 	/* Finally we copy the last full 64-byte block. */
-U3copy_from_user_loopfini:
-	EX3(ldda [%o1 + 0x008] %asi, %f2)		! MS
-	faligndata	%f12, %f14, %f28		! FGA
-	EX3(ldda [%o1 + 0x010] %asi, %f4)		! MS	Group19
-	faligndata	%f14, %f0, %f30			! FGA
-	stda		%f16, [%o0] ASI_BLK_P		! MS	Group20
-	EX3(ldda [%o1 + 0x018] %asi, %f6)		! AX
-	faligndata	%f0, %f2, %f16			! FGA	Group11 (7-cycle stall)
-	EX3(ldda [%o1 + 0x020] %asi, %f8)		! MS
-	faligndata	%f2, %f4, %f18			! FGA	Group12
-	EX3(ldda [%o1 + 0x028] %asi, %f10)		! MS
-	faligndata	%f4, %f6, %f20			! FGA	Group13
-	EX3(ldda [%o1 + 0x030] %asi, %f12)		! MS
-	faligndata	%f6, %f8, %f22			! FGA	Group14
-	EX3(ldda [%o1 + 0x038] %asi, %f14)		! MS
-	faligndata	%f8, %f10, %f24			! FGA	Group15
-	cmp		%g1, 0				! A0
-	be,pt		%icc, 1f			! BR
-	 add		%o0, 0x40, %o0			! A1
-	EX4(ldda [%o1 + 0x040] %asi, %f0)		! MS
-1:	faligndata	%f10, %f12, %f26		! FGA	Group16
-	faligndata	%f12, %f14, %f28		! FGA	Group17
-	faligndata	%f14, %f0, %f30			! FGA	Group18
-	stda		%f16, [%o0] ASI_BLK_P		! MS
-	add		%o0, 0x40, %o0			! A0
-	add		%o1, 0x40, %o1			! A1
-#ifdef __KERNEL__
-	.globl		U3copy_from_user_nop_2_3
-U3copy_from_user_nop_2_3:
-	mov		PRIMARY_CONTEXT, %o3
-	stxa		%g0, [%o3] ASI_DMMU		! Flush P-cache
-	stxa		%g3, [%g0] ASI_DCU_CONTROL_REG	! Disable P-cache
-#endif
-	membar		#Sync				! MS	Group26 (7-cycle stall)
+	EX3(ldda [%o1 + 0x008] %asi, %f2)
+	faligndata	%f12, %f14, %f28
+	EX3(ldda [%o1 + 0x010] %asi, %f4)
+	faligndata	%f14, %f0, %f30
+	stda		%f16, [%o0] ASI_BLK_P
+	EX3(ldda [%o1 + 0x018] %asi, %f6)
+	faligndata	%f0, %f2, %f16
+	EX3(ldda [%o1 + 0x020] %asi, %f8)
+	faligndata	%f2, %f4, %f18
+	EX3(ldda [%o1 + 0x028] %asi, %f10)
+	faligndata	%f4, %f6, %f20
+	EX3(ldda [%o1 + 0x030] %asi, %f12)
+	faligndata	%f6, %f8, %f22
+	EX3(ldda [%o1 + 0x038] %asi, %f14)
+	faligndata	%f8, %f10, %f24
+	cmp		%g1, 0
+	be,pt		%XCC, 1f
+	 add		%o0, 0x40, %o0
+	EX4(ldda [%o1 + 0x040] %asi, %f0)
+1:	faligndata	%f10, %f12, %f26
+	faligndata	%f12, %f14, %f28
+	faligndata	%f14, %f0, %f30
+	stda		%f16, [%o0] ASI_BLK_P
+	add		%o0, 0x40, %o0
+	add		%o1, 0x40, %o1
+
+	membar		#Sync
 
 	/* Now we copy the (len modulo 64) bytes at the end.
 	 * Note how we borrow the %f0 loaded above.
 	 *
 	 * Also notice how this code is careful not to perform a
-	 * load past the end of the src buffer just like similar
-	 * code found in U3copy_from_user_toosmall processing.
+	 * load past the end of the src buffer.
 	 */
-U3copy_from_user_loopend:
-	and		%o2, 0x3f, %o2			! A0	Group
-	andcc		%o2, 0x38, %g2			! A0	Group
-	be,pn		%icc, U3copy_from_user_endcruft	! BR
-	 subcc		%g2, 0x8, %g2			! A1
-	be,pn		%icc, U3copy_from_user_endcruft	! BR	Group
-	 cmp		%g1, 0				! A0
-
-	be,a,pt		%icc, 1f			! BR	Group
-	 EX(ldda [%o1 + 0x00] %asi, %f0, add %o2, %g0)	! MS
-
-1:	EX(ldda [%o1 + 0x08] %asi, %f2, add %o2, %g0)	! MS	Group
-	add		%o1, 0x8, %o1			! A0
-	sub		%o2, 0x8, %o2			! A1
-	subcc		%g2, 0x8, %g2			! A0	Group
-	faligndata	%f0, %f2, %f8			! FGA	Group
-	std		%f8, [%o0 + 0x00]		! MS	(XXX does it stall here? XXX)
-	be,pn		%icc, U3copy_from_user_endcruft	! BR
-	 add		%o0, 0x8, %o0			! A0
-	EX(ldda [%o1 + 0x08] %asi, %f0, add %o2, %g0)	! MS	Group
-	add		%o1, 0x8, %o1			! A0
-	sub		%o2, 0x8, %o2			! A1
-	subcc		%g2, 0x8, %g2			! A0	Group
-	faligndata	%f2, %f0, %f8			! FGA
-	std		%f8, [%o0 + 0x00]		! MS	(XXX does it stall here? XXX)
-	bne,pn		%icc, 1b			! BR
-	 add		%o0, 0x8, %o0			! A0	Group
+	and		%o2, 0x3f, %o2
+	andcc		%o2, 0x38, %g2
+	be,pn		%XCC, 10f
+	 subcc		%g2, 0x8, %g2
+	be,pn		%XCC, 10f
+	 cmp		%g1, 0
+
+	be,a,pt		%XCC, 1f
+	 EX(ldda [%o1 + 0x00] %asi, %f0, add %o2, %g0)
+
+1:	EX(ldda [%o1 + 0x08] %asi, %f2, add %o2, %g0)
+	add		%o1, 0x8, %o1
+	sub		%o2, 0x8, %o2
+	subcc		%g2, 0x8, %g2
+	faligndata	%f0, %f2, %f8
+	std		%f8, [%o0 + 0x00]
+	be,pn		%XCC, 10f
+	 add		%o0, 0x8, %o0
+	EX(ldda [%o1 + 0x08] %asi, %f0, add %o2, %g0)
+	add		%o1, 0x8, %o1
+	sub		%o2, 0x8, %o2
+	subcc		%g2, 0x8, %g2
+	faligndata	%f2, %f0, %f8
+	std		%f8, [%o0 + 0x00]
+	bne,pn		%XCC, 1b
+	 add		%o0, 0x8, %o0
 
 	/* If anything is left, we copy it one byte at a time.
 	 * Note that %g1 is (src & 0x3) saved above before the
 	 * alignaddr was performed.
 	 */
-U3copy_from_user_endcruft:
+10:
 	cmp		%o2, 0
 	add		%o1, %g1, %o1
 	VISExitHalf
-	be,pn		%icc, U3copy_from_user_short_ret
-	 nop
-	ba,a,pt		%xcc, U3copy_from_user_short
-
-	/* If we get here, then 32 <= len < (6 * 64) */
-U3copy_from_user_toosmall:
-
-#ifdef SMALL_COPY_USES_FPU
-
-	/* Is 'dst' already aligned on an 8-byte boundary? */
-	be,pt		%xcc, 2f			! BR	Group
-
-	/* Compute abs((dst & 7) - 8) into %g2.  This is the number
-	 * of bytes to copy to make 'dst' 8-byte aligned.  We pre-
-	 * subtract this from 'len'.
-	 */
-	 sub		%g2, 0x8, %g2			! A0
-	sub		%g0, %g2, %g2			! A0	Group (reg-dep)
-	sub		%o2, %g2, %o2			! A0	Group (reg-dep)
+	be,pn		%XCC, 85f
+	 sub		%o0, %o1, %o3
 
-	/* Copy %g2 bytes from src to dst, one byte at a time. */
-1:	EXNV(lduba [%o1 + 0x00] %asi, %o3, add %o2, %g2)! MS	(Group) (%o3 in 3 cycles)
-	add		%o1, 0x1, %o1			! A1
-	add		%o0, 0x1, %o0			! A0	Group
-	subcc		%g2, 0x1, %g2			! A1
-
-	bg,pt		%icc, 1b			! BR	Group
-	 stb		%o3, [%o0 + -1]			! MS	Group
+	andcc		%g1, 0x7, %g0
+	bne,pn		%icc, 90f
+	 andcc		%o2, 0x8, %g0
+	be,pt		%icc, 1f
+	 nop
+	EXNV(ldxa [%o1] %asi, %o5, add %o2, %g0)
+	stx		%o5, [%o1 + %o3]
+	add		%o1, 0x8, %o1
 
-2:	VISEntryHalf					! MS+MS
+1:	andcc		%o2, 0x4, %g0
+	be,pt		%icc, 1f
+	 nop
+	EXNV(lduwa [%o1] %asi, %o5, and %o2, 0x7)
+	stw		%o5, [%o1 + %o3]
+	add		%o1, 0x4, %o1
 
-	/* Compute (len - (len % 8)) into %g2.  This is guaranteed
-	 * to be nonzero.
-	 */
-	andn		%o2, 0x7, %g2			! A0	Group
-
-	/* You may read this and believe that it allows reading
-	 * one 8-byte longword past the end of src.  It actually
-	 * does not, as %g2 is subtracted as loads are done from
-	 * src, so we always stop before running off the end.
-	 * Also, we are guaranteed to have at least 0x10 bytes
-	 * to move here.
-	 */
-	sub		%g2, 0x8, %g2			! A0	Group (reg-dep)
-	alignaddr	%o1, %g0, %g1			! MS	      (Break-after)
-	EX(ldda [%g1 + 0x00] %asi, %f0, add %o2, %g0)	! MS	Group (1-cycle stall)
-	add		%g1, 0x8, %g1			! A0
-
-1:	EX(ldda [%g1 + 0x00] %asi, %f2, add %o2, %g0)	! MS	Group
-	add		%g1, 0x8, %g1			! A0
-	sub		%o2, 0x8, %o2			! A1
-	subcc		%g2, 0x8, %g2			! A0	Group
-
-	faligndata	%f0, %f2, %f8			! FGA	Group (1-cycle stall)
-	std		%f8, [%o0 + 0x00]		! MS	Group (2-cycle stall)
-	add		%o1, 0x8, %o1			! A0
-	be,pn		%icc, 2f			! BR
-
-	 add		%o0, 0x8, %o0			! A1
-	EX(ldda [%g1 + 0x00] %asi, %f0, add %o2, %g0)	! MS	Group
-	add		%g1, 0x8, %g1			! A0
-	sub		%o2, 0x8, %o2			! A1
-
-	subcc		%g2, 0x8, %g2			! A0	Group
-	faligndata	%f2, %f0, %f8			! FGA	Group (1-cycle stall)
-	std		%f8, [%o0 + 0x00]		! MS	Group (2-cycle stall)
-	add		%o1, 0x8, %o1			! A0
-
-	bne,pn		%icc, 1b			! BR
-	 add		%o0, 0x8, %o0			! A1
-
-	/* Nothing left to copy? */
-2:	cmp		%o2, 0				! A0	Group
-	VISExitHalf					! A0+MS
-	be,pn		%icc, U3copy_from_user_short_ret! BR	Group
-	 nop						! A0
-	ba,a,pt		%xcc, U3copy_from_user_short	! BR	Group
-
-#else /* !(SMALL_COPY_USES_FPU) */
-
-	xor		%o1, %o0, %g2
-	andcc		%g2, 0x7, %g0
-	bne,pn		%icc, U3copy_from_user_short
-	 andcc		%o1, 0x7, %g2
-
-	be,pt		%xcc, 2f
-	 sub		%g2, 0x8, %g2
-	sub		%g0, %g2, %g2
-	sub		%o2, %g2, %o2
+1:	andcc		%o2, 0x2, %g0
+	be,pt		%icc, 1f
+	 nop
+	EXNV(lduha [%o1] %asi, %o5, and %o2, 0x3)
+	sth		%o5, [%o1 + %o3]
+	add		%o1, 0x2, %o1
 
-1:	EXNV(lduba [%o1 + 0x00] %asi, %o3, add %o2, %g2)
-	add		%o1, 0x1, %o1
-	add		%o0, 0x1, %o0
-	subcc		%g2, 0x1, %g2
-	bg,pt		%icc, 1b
-	 stb		%o3, [%o0 + -1]
+1:	andcc		%o2, 0x1, %g0
+	be,pt		%icc, 85f
+	 nop
+	EXNV(lduba [%o1] %asi, %o5, and %o2, 0x1)
+	ba,pt		%xcc, 85f
+	 stb		%o5, [%o1 + %o3]
+
+70: /* 16 < len <= 64 */
+	bne,pn		%XCC, 90f
+	 sub		%o0, %o1, %o3
+
+	andn		%o2, 0x7, %o4
+	and		%o2, 0x7, %o2
+1:	subcc		%o4, 0x8, %o4
+	EXNV8(ldxa [%o1] %asi, %o5, add %o2, %o4)
+	stx		%o5, [%o1 + %o3]
+	bgu,pt		%XCC, 1b
+	 add		%o1, 0x8, %o1
+	andcc		%o2, 0x4, %g0
+	be,pt		%XCC, 1f
+	 nop
+	sub		%o2, 0x4, %o2
+	EXNV4(lduwa [%o1] %asi, %o5, add %o2, %g0)
+	stw		%o5, [%o1 + %o3]
+	add		%o1, 0x4, %o1
+1:	cmp		%o2, 0
+	be,pt		%XCC, 85f
+	 nop
+	ba,pt		%xcc, 90f
+	 nop
 
-2:	andn		%o2, 0x7, %g2
-	sub		%o2, %g2, %o2
+80: /* 0 < len <= 16 */
+	andcc		%o3, 0x3, %g0
+	bne,pn		%XCC, 90f
+	 sub		%o0, %o1, %o3
 
-3:	EXNV(ldxa [%o1 + 0x00] %asi, %o3, add %o2, %g2)
-	add		%o1, 0x8, %o1
-	add		%o0, 0x8, %o0
-	subcc		%g2, 0x8, %g2
-	bg,pt		%icc, 3b
-	 stx		%o3, [%o0 + -8]
+1:
+	subcc		%o2, 4, %o2
+	EXNV(lduwa [%o1] %asi, %g1, add %o2, %g0)
+	stw		%g1, [%o1 + %o3]
+	bgu,pt		%XCC, 1b
+	 add		%o1, 4, %o1
 
-	cmp		%o2, 0
-	bne,pn		%icc, U3copy_from_user_short
-	 nop
-	ba,a,pt		%xcc, U3copy_from_user_short_ret
+85:	retl
+	 clr		%o0
 
-#endif /* !(SMALL_COPY_USES_FPU) */
+	.align	32
+90:
+	subcc		%o2, 1, %o2
+	EXNV(lduba [%o1] %asi, %g1, add %o2, %g0)
+	stb		%g1, [%o1 + %o3]
+	bgu,pt		%XCC, 90b
+	 add		%o1, 1, %o1
+	retl
+	 clr		%o0
 
-#ifdef __KERNEL__
-	.globl		U3cfu_fixup
 U3cfu_fixup:
 	/* Since this is copy_from_user(), zero out the rest of the
 	 * kernel buffer.
@@ -516,4 +410,3 @@ U3cfu_fixup:
 
 2:	retl
 	 mov		%o1, %o0
-#endif
diff --git a/arch/sparc64/lib/U3copy_in_user.S b/arch/sparc64/lib/U3copy_in_user.S
index 674e232b0..af3961fb0 100644
--- a/arch/sparc64/lib/U3copy_in_user.S
+++ b/arch/sparc64/lib/U3copy_in_user.S
@@ -1,13 +1,15 @@
-/* $Id: U3copy_in_user.S,v 1.4 2001/03/21 05:58:47 davem Exp $
- * U3memcpy.S: UltraSparc-III optimized copy within userspace.
+/* U3copy_in_user.S: UltraSparc-III optimized memcpy.
  *
- * Copyright (C) 1999, 2000 David S. Miller (davem@redhat.com)
+ * Copyright (C) 1999, 2000, 2004 David S. Miller (davem@redhat.com)
  */
 
-#ifdef __KERNEL__
 #include <asm/visasm.h>
 #include <asm/asi.h>
-#undef SMALL_COPY_USES_FPU
+#include <asm/dcu.h>
+#include <asm/spitfire.h>
+
+#define XCC xcc
+
 #define EXNV(x,y,a,b)	\
 98:	x,y;				\
 	.section .fixup;		\
@@ -19,7 +21,7 @@
 	.word 98b, 99b;			\
 	.text;				\
 	.align 4;
-#define EXNV2(x,y,a,b)	\
+#define EXNV1(x,y,a,b)			\
 98:	x,y;				\
 	.section .fixup;		\
 	.align 4;			\
@@ -31,501 +33,108 @@
 	.word 98b, 99b;			\
 	.text;				\
 	.align 4;
-#define EXNV3(x,y,a,b)	\
+#define EXNV4(x,y,a,b)			\
 98:	x,y;				\
 	.section .fixup;		\
 	.align 4;			\
 99:	a, b, %o0;			\
 	retl;				\
-	 add %o0, 8, %o0;		\
-	.section __ex_table;		\
-	.align 4;			\
-	.word 98b, 99b;			\
-	.text;				\
-	.align 4;
-#define EX(x,y,a,b)			\
-98:	x,y;				\
-	.section .fixup;		\
-	.align 4;			\
-99:	VISExitHalf;			\
-	retl;				\
-	 a, b, %o0;			\
+	 add %o0, 4, %o0;		\
 	.section __ex_table;		\
 	.align 4;			\
 	.word 98b, 99b;			\
 	.text;				\
 	.align 4;
-#define EXBLK1(x,y)			\
+#define EXNV8(x,y,a,b)			\
 98:	x,y;				\
 	.section .fixup;		\
 	.align 4;			\
-99:	VISExitHalf;			\
-	add %o4, 0x1c0, %o1;		\
-	and %o2, (0x40 - 1), %o2;	\
-	retl;				\
-	 add %o1, %o2, %o0;		\
-	.section __ex_table;		\
-	.align 4;			\
-	.word 98b, 99b;			\
-	.text;				\
-	.align 4;
-#define EXBLK2(x,y)			\
-98:	x,y;				\
-	.section .fixup;		\
-	.align 4;			\
-99:	VISExitHalf;			\
-	sll %o3, 6, %o3;		\
-	and %o2, (0x40 - 1), %o2;	\
-	add %o3, 0x80, %o1;		\
-	retl;				\
-	 add %o1, %o2, %o0;		\
-	.section __ex_table;		\
-	.align 4;			\
-	.word 98b, 99b;			\
-	.text;				\
-	.align 4;
-#define EXBLK3(x,y)			\
-98:	x,y;				\
-	.section .fixup;		\
-	.align 4;			\
-99:	VISExitHalf;			\
-	and %o2, (0x40 - 1), %o2;	\
-	retl;				\
-	 add %o2, 0x80, %o0;		\
-	.section __ex_table;		\
-	.align 4;			\
-	.word 98b, 99b;			\
-	.text;				\
-	.align 4;
-#define EXBLK4(x,y)			\
-98:	x,y;				\
-	.section .fixup;		\
-	.align 4;			\
-99:	VISExitHalf;			\
-	and %o2, (0x40 - 1), %o2;	\
+99:	a, b, %o0;			\
 	retl;				\
-	 add %o2, 0x40, %o0;		\
+	 add %o0, 8, %o0;		\
 	.section __ex_table;		\
 	.align 4;			\
 	.word 98b, 99b;			\
 	.text;				\
 	.align 4;
-#else
-#define ASI_AIUS 0x80
-#define ASI_BLK_AIUS 0xf0
-#define FPRS_FEF  0x04
-#define VISEntryHalf rd %fprs, %o5; wr %g0, FPRS_FEF, %fprs
-#define VISExitHalf and %o5, FPRS_FEF, %o5; wr %o5, 0x0, %fprs
-#define SMALL_COPY_USES_FPU
-#define EXNV(x,y,a,b)	x,y;
-#define EXNV2(x,y,a,b)	x,y;
-#define EXNV3(x,y,a,b)	x,y;
-#define EX(x,y,a,b)	x,y;
-#define EXBLK1(x,y)	x,y;
-#define EXBLK2(x,y)	x,y;
-#define EXBLK3(x,y)	x,y;
-#define EXBLK4(x,y)	x,y;
-#endif
 
-	/* Special/non-trivial issues of this code:
-	 *
-	 * 1) %o5 is preserved from VISEntryHalf to VISExitHalf
-	 * 2) Only low 32 FPU registers are used so that only the
-	 *    lower half of the FPU register set is dirtied by this
-	 *    code.  This is especially important in the kernel.
-	 * 3) This code never prefetches cachelines past the end
-	 *    of the source buffer.
-	 *
-	 *    XXX Actually, Cheetah can buffer up to 8 concurrent
-	 *    XXX prefetches, revisit this...
-	 */
+	.register	%g2,#scratch
+	.register	%g3,#scratch
 
 	.text
 	.align	32
 
-	/* The cheetah's flexible spine, oversized liver, enlarged heart,
-	 * slender muscular body, and claws make it the swiftest hunter
-	 * in Africa and the fastest animal on land.  Can reach speeds
-	 * of up to 2.4GB per second.
+	/* Don't try to get too fancy here, just nice and
+	 * simple.  This is predominantly used for well aligned
+	 * small copies in the compat layer.  It is also used
+	 * to copy register windows around during thread cloning.
 	 */
 
-	.globl		U3copy_in_user
-U3copy_in_user: /* %o0=dst, %o1=src, %o2=len */
+	.globl	U3copy_in_user
+U3copy_in_user:	/* %o0=dst, %o1=src, %o2=len */
 	/* Writing to %asi is _expensive_ so we hardcode it.
 	 * Reading %asi to check for KERNEL_DS is comparatively
 	 * cheap.
 	 */
-	rd		%asi, %g1			! MS	Group	(4 cycles)
-	cmp		%g1, ASI_AIUS			! A0	Group
-	bne		U3memcpy			! BR
-	 nop						! A1
-#ifndef __KERNEL__
-	/* Save away original 'dst' for memcpy return value. */
-	mov		%o0, %g3			! A0	Group
-#endif
-	/* Anything to copy at all? */
-	cmp		%o2, 0				! A1
-	ble,pn		%icc, U3copy_in_user_short_ret	! BR
-
-	/* Extremely small copy? */
-	 cmp		%o2, 31				! A0	Group
-	ble,pn		%icc, U3copy_in_user_short	! BR
-
-	/* Large enough to use unrolled prefetch loops? */
-	 cmp		%o2, 0x100			! A1
-	bge,a,pt	%icc, U3copy_in_user_enter	! BR	Group
-	 andcc		%o0, 0x3f, %g2			! A0
-
-	ba,pt		%xcc, U3copy_in_user_toosmall	! BR	Group
-	 andcc		%o0, 0x7, %g2			! A0
-
-	.align		32
-U3copy_in_user_short:
-	/* Copy %o2 bytes from src to dst, one byte at a time. */
-	EXNV(lduba [%o1 + 0x00] %asi, %o3, add %o2, %g0)! MS	Group
-	add		%o1, 0x1, %o1			! A0
-	add		%o0, 0x1, %o0			! A1
-	subcc		%o2, 1, %o2			! A0	Group
-
-	bg,pt		%icc, U3copy_in_user_short	! BR
-	 EXNV(stba %o3, [%o0 + -1] %asi, add %o2, 1)	! MS	Group (1-cycle stall)
-
-U3copy_in_user_short_ret:
-#ifdef __KERNEL__
-	retl						! BR	Group (0-4 cycle stall)
-	 clr		%o0				! A0
-#else
-	retl						! BR	Group (0-4 cycle stall)
-	 mov		%g3, %o0			! A0
-#endif
-
-	/* Here len >= (6 * 64) and condition codes reflect execution
-	 * of "andcc %o0, 0x7, %g2", done by caller.
-	 */
-	.align		64
-U3copy_in_user_enter:
-	/* Is 'dst' already aligned on an 64-byte boundary? */
-	be,pt		%xcc, 2f			! BR
-
-	/* Compute abs((dst & 0x3f) - 0x40) into %g2.  This is the number
-	 * of bytes to copy to make 'dst' 64-byte aligned.  We pre-
-	 * subtract this from 'len'.
-	 */
-	 sub		%g2, 0x40, %g2			! A0	Group
-	sub		%g0, %g2, %g2			! A0	Group
-	sub		%o2, %g2, %o2			! A0	Group
-
-	/* Copy %g2 bytes from src to dst, one byte at a time. */
-1:	EXNV(lduba [%o1 + 0x00] %asi, %o3, add %o2, %g2)! MS	(Group)
-	add		%o1, 0x1, %o1			! A1
-	add		%o0, 0x1, %o0			! A0	Group
-	subcc		%g2, 0x1, %g2			! A1
-
-	bg,pt		%icc, 1b			! BR	Group
-	 EXNV2(stba %o3, [%o0 + -1] %asi, add %o2, %g2)	! MS	Group
-
-2:	VISEntryHalf					! MS+MS
-	and		%o1, 0x7, %g1			! A1
-	ba,pt		%xcc, U3copy_in_user_begin	! BR
-	 alignaddr	%o1, %g0, %o1			! MS	      (Break-after)
-
-	.align		64
-U3copy_in_user_begin:
-	prefetcha	[%o1 + 0x000] %asi, #one_read	! MS	Group1
-	prefetcha	[%o1 + 0x040] %asi, #one_read	! MS	Group2
-	andn		%o2, (0x40 - 1), %o4		! A0
-	prefetcha	[%o1 + 0x080] %asi, #one_read	! MS	Group3
-	cmp		%o4, 0x140			! A0
-	prefetcha	[%o1 + 0x0c0] %asi, #one_read	! MS	Group4
-	EX(ldda [%o1 + 0x000] %asi, %f0, add %o2, %g0)	! MS	Group5 (%f0 results at G8)
-	bge,a,pt	%icc, 1f			! BR
-
-	 prefetcha	[%o1 + 0x100] %asi, #one_read	! MS	Group6
-1:	EX(ldda [%o1 + 0x008] %asi, %f2, add %o2, %g0)	! AX	       (%f2 results at G9)
-	cmp		%o4, 0x180			! A1
-	bge,a,pt	%icc, 1f			! BR
-	 prefetcha	[%o1 + 0x140] %asi, #one_read	! MS	Group7
-1:	EX(ldda [%o1 + 0x010] %asi, %f4, add %o2, %g0)	! AX	       (%f4 results at G10)
-	cmp		%o4, 0x1c0			! A1
-	bge,a,pt	%icc, 1f			! BR
-
-	 prefetcha	[%o1 + 0x180] %asi, #one_read	! MS	Group8
-1:	faligndata	%f0, %f2, %f16			! FGA	Group9 (%f16 at G12)
-	EX(ldda [%o1 + 0x018] %asi, %f6, add %o2, %g0)	! AX	       (%f6 results at G12)
-	faligndata	%f2, %f4, %f18			! FGA	Group10 (%f18 results at G13)
-	EX(ldda [%o1 + 0x020] %asi, %f8, add %o2, %g0)	! MS	        (%f8 results at G13)
-	faligndata	%f4, %f6, %f20			! FGA	Group12	(1-cycle stall,%f20 at G15)
-	EX(ldda [%o1 + 0x028] %asi, %f10, add %o2, %g0)	! MS		(%f10 results at G15)
-	faligndata	%f6, %f8, %f22			! FGA	Group13 (%f22 results at G16)
-	
-	EX(ldda [%o1 + 0x030] %asi, %f12, add %o2, %g0)	! MS		(%f12 results at G16)
-	faligndata	%f8, %f10, %f24			! FGA	Group15 (1-cycle stall,%f24 at G18)
-	EX(ldda [%o1 + 0x038] %asi, %f14, add %o2, %g0)	! MS		(%f14 results at G18)
-	faligndata	%f10, %f12, %f26		! FGA	Group16 (%f26 results at G19)
-	EX(ldda [%o1 + 0x040] %asi, %f0, add %o2, %g0)	! MS		(%f0 results at G19)
-
-	/* We only use the first loop if len > (7 * 64). */
-	subcc		%o4, 0x1c0, %o4			! A0	Group17
-	bg,pt		%icc, U3copy_in_user_loop1	! BR
-	 add		%o1, 0x40, %o1			! A1
-
-	add		%o4, 0x140, %o4			! A0	Group18
-	ba,pt		%xcc, U3copy_in_user_loop2	! BR
-	 srl		%o4, 6, %o3			! A0	Group19
-	nop
-	nop
-	nop
-	nop
-	nop
-
-	nop
-	nop
-
-	/* This loop performs the copy and queues new prefetches.
-	 * We drop into the second loop when len <= (5 * 64).  Note
-	 * that this (5 * 64) factor has been subtracted from len
-	 * already.
-	 */
-U3copy_in_user_loop1:
-	EXBLK1(ldda [%o1 + 0x008] %asi, %f2)		! MS	Group2	(%f2 results at G5)
-	faligndata	%f12, %f14, %f28		! FGA		(%f28 results at G5)
-	EXBLK1(ldda [%o1 + 0x010] %asi, %f4)		! MS	Group3	(%f4 results at G6)
-	faligndata	%f14, %f0, %f30			! FGA	Group4	(1-cycle stall, %f30 at G7)
-	EXBLK1(stda %f16, [%o0] ASI_BLK_AIUS)		! MS
-	EXBLK1(ldda [%o1 + 0x018] %asi, %f6)		! AX		(%f6 results at G7)
-
-	faligndata	%f0, %f2, %f16			! FGA	Group12 (7-cycle stall)
-	EXBLK1(ldda [%o1 + 0x020] %asi, %f8)		! MS	        (%f8 results at G15)
-	faligndata	%f2, %f4, %f18			! FGA	Group13	(%f18 results at G16)
-	EXBLK1(ldda [%o1 + 0x028] %asi, %f10)		! MS		(%f10 results at G16)
-	faligndata	%f4, %f6, %f20			! FGA	Group14	(%f20 results at G17)
-	EXBLK1(ldda [%o1 + 0x030] %asi, %f12)		! MS		(%f12 results at G17)
-	faligndata	%f6, %f8, %f22			! FGA	Group15	(%f22 results at G18)
-	EXBLK1(ldda [%o1 + 0x038] %asi, %f14)		! MS		(%f14 results at G18)
-
-	faligndata	%f8, %f10, %f24			! FGA	Group16	(%f24 results at G19)
-	EXBLK1(ldda [%o1 + 0x040] %asi, %f0)		! AX		(%f0 results at G19)
-	prefetcha	[%o1 + 0x180] %asi, #one_read	! MS
-	faligndata	%f10, %f12, %f26		! FGA	Group17	(%f26 results at G20)
-	subcc		%o4, 0x40, %o4			! A0
-	add		%o1, 0x40, %o1			! A1
-	bg,pt		%xcc, U3copy_in_user_loop1		! BR
-	 add		%o0, 0x40, %o0			! A0	Group18
-
-U3copy_in_user_loop2_enter:
-	mov		5, %o3				! A1
-
-	/* This loop performs on the copy, no new prefetches are
-	 * queued.  We do things this way so that we do not perform
-	 * any spurious prefetches past the end of the src buffer.
-	 */
-U3copy_in_user_loop2:
-	EXBLK2(ldda [%o1 + 0x008] %asi, %f2)		! MS
-	faligndata	%f12, %f14, %f28		! FGA	Group2
-	EXBLK2(ldda [%o1 + 0x010] %asi, %f4)		! MS
-	faligndata	%f14, %f0, %f30			! FGA	Group4	(1-cycle stall)
-	EXBLK2(stda %f16, [%o0] ASI_BLK_AIUS)		! MS
-	EXBLK2(ldda [%o1 + 0x018] %asi, %f6)		! AX
-	faligndata	%f0, %f2, %f16			! FGA	Group12 (7-cycle stall)
-
-	EXBLK2(ldda [%o1 + 0x020] %asi, %f8)		! MS
-	faligndata	%f2, %f4, %f18			! FGA	Group13
-	EXBLK2(ldda [%o1 + 0x028] %asi, %f10)		! MS
-	faligndata	%f4, %f6, %f20			! FGA	Group14
-	EXBLK2(ldda [%o1 + 0x030] %asi, %f12)		! MS
-	faligndata	%f6, %f8, %f22			! FGA	Group15
-	EXBLK2(ldda [%o1 + 0x038] %asi, %f14)		! MS
-	faligndata	%f8, %f10, %f24			! FGA	Group16
-
-	EXBLK2(ldda [%o1 + 0x040] %asi, %f0)		! AX
-	faligndata	%f10, %f12, %f26		! FGA	Group17
-	subcc		%o3, 0x01, %o3			! A0
-	add		%o1, 0x40, %o1			! A1
-	bg,pt		%xcc, U3copy_in_user_loop2	! BR
-	 add		%o0, 0x40, %o0			! A0	Group18
-
-	/* Finally we copy the last full 64-byte block. */
-U3copy_in_user_loopfini:
-	EXBLK3(ldda [%o1 + 0x008] %asi, %f2)		! MS
-	faligndata	%f12, %f14, %f28		! FGA
-	EXBLK3(ldda [%o1 + 0x010] %asi, %f4)		! MS	Group19
-	faligndata	%f14, %f0, %f30			! FGA
-	EXBLK3(stda %f16, [%o0] ASI_BLK_AIUS)		! MS	Group20
-	EXBLK4(ldda [%o1 + 0x018] %asi, %f6)		! AX
-	faligndata	%f0, %f2, %f16			! FGA	Group11 (7-cycle stall)
-	EXBLK4(ldda [%o1 + 0x020] %asi, %f8)		! MS
-	faligndata	%f2, %f4, %f18			! FGA	Group12
-	EXBLK4(ldda [%o1 + 0x028] %asi, %f10)		! MS
-	faligndata	%f4, %f6, %f20			! FGA	Group13
-	EXBLK4(ldda [%o1 + 0x030] %asi, %f12)		! MS
-	faligndata	%f6, %f8, %f22			! FGA	Group14
-	EXBLK4(ldda [%o1 + 0x038] %asi, %f14)		! MS
-	faligndata	%f8, %f10, %f24			! FGA	Group15
-	cmp		%g1, 0				! A0
-	be,pt		%icc, 1f			! BR
-	 add		%o0, 0x40, %o0			! A1
-	EXBLK4(ldda [%o1 + 0x040] %asi, %f0)		! MS
-1:	faligndata	%f10, %f12, %f26		! FGA	Group16
-	faligndata	%f12, %f14, %f28		! FGA	Group17
-	faligndata	%f14, %f0, %f30			! FGA	Group18
-	EXBLK4(stda %f16, [%o0] ASI_BLK_AIUS)		! MS
-	add		%o0, 0x40, %o0			! A0
-	add		%o1, 0x40, %o1			! A1
-	membar		#Sync				! MS	Group26 (7-cycle stall)
-
-	/* Now we copy the (len modulo 64) bytes at the end.
-	 * Note how we borrow the %f0 loaded above.
-	 *
-	 * Also notice how this code is careful not to perform a
-	 * load past the end of the src buffer just like similar
-	 * code found in U3copy_in_user_toosmall processing.
-	 */
-U3copy_in_user_loopend:
-	and		%o2, 0x3f, %o2			! A0	Group
-	andcc		%o2, 0x38, %g2			! A0	Group
-	be,pn		%icc, U3copy_in_user_endcruft	! BR
-	 subcc		%g2, 0x8, %g2			! A1
-	be,pn		%icc, U3copy_in_user_endcruft	! BR	Group
-	 cmp		%g1, 0				! A0
-
-	be,a,pt		%icc, 1f			! BR	Group
-	 EX(ldda [%o1 + 0x00] %asi, %f0, add %o2, %g0)	! MS
-
-1:	EX(ldda [%o1 + 0x08] %asi, %f2, add %o2, %g0)	! MS	Group
-	add		%o1, 0x8, %o1			! A0
-	sub		%o2, 0x8, %o2			! A1
-	subcc		%g2, 0x8, %g2			! A0	Group
-	faligndata	%f0, %f2, %f8			! FGA	Group
-	EX(stda %f8, [%o0 + 0x00] %asi, add %o2, 0x8)	! MS	(XXX does it stall here? XXX)
-	be,pn		%icc, U3copy_in_user_endcruft	! BR
-	 add		%o0, 0x8, %o0			! A0
-	EX(ldda [%o1 + 0x08] %asi, %f0, add %o2, %g0)	! MS	Group
-	add		%o1, 0x8, %o1			! A0
-	sub		%o2, 0x8, %o2			! A1
-	subcc		%g2, 0x8, %g2			! A0	Group
-	faligndata	%f2, %f0, %f8			! FGA
-	EX(stda %f8, [%o0 + 0x00] %asi, add %o2, 0x8)	! MS	(XXX does it stall here? XXX)
-	bne,pn		%icc, 1b			! BR
-	 add		%o0, 0x8, %o0			! A0	Group
+	rd		%asi, %g1
+	cmp		%g1, ASI_AIUS
+	bne,pn		%icc, U3memcpy_user_stub
+	 nop
 
-	/* If anything is left, we copy it one byte at a time.
-	 * Note that %g1 is (src & 0x3) saved above before the
-	 * alignaddr was performed.
-	 */
-U3copy_in_user_endcruft:
 	cmp		%o2, 0
-	add		%o1, %g1, %o1
-	VISExitHalf
-	be,pn		%icc, U3copy_in_user_short_ret
+	be,pn		%XCC, out
+	 or		%o0, %o1, %o3
+	cmp		%o2, 16
+	bleu,a,pn	%XCC, small_copy
+	 or		%o3, %o2, %o3
+
+medium_copy: /* 16 < len <= 64 */
+	andcc		%o3, 0x7, %g0
+	bne,pn		%XCC, small_copy_unaligned
+	 sub		%o0, %o1, %o3
+
+medium_copy_aligned:
+	andn		%o2, 0x7, %o4
+	and		%o2, 0x7, %o2
+1:	subcc		%o4, 0x8, %o4
+	EXNV8(ldxa [%o1] %asi, %o5, add %o4, %o2)
+	EXNV8(stxa %o5, [%o1 + %o3] ASI_AIUS, add %o4, %o2)
+	bgu,pt		%XCC, 1b
+	 add		%o1, 0x8, %o1
+	andcc		%o2, 0x4, %g0
+	be,pt		%XCC, 1f
+	 nop
+	sub		%o2, 0x4, %o2
+	EXNV4(lduwa [%o1] %asi, %o5, add %o4, %o2)
+	EXNV4(stwa %o5, [%o1 + %o3] ASI_AIUS, add %o4, %o2)
+	add		%o1, 0x4, %o1
+1:	cmp		%o2, 0
+	be,pt		%XCC, out
+	 nop
+	ba,pt		%xcc, small_copy_unaligned
 	 nop
-	ba,a,pt		%xcc, U3copy_in_user_short
-
-	/* If we get here, then 32 <= len < (6 * 64) */
-U3copy_in_user_toosmall:
-
-#ifdef SMALL_COPY_USES_FPU
-
-	/* Is 'dst' already aligned on an 8-byte boundary? */
-	be,pt		%xcc, 2f			! BR	Group
-
-	/* Compute abs((dst & 7) - 8) into %g2.  This is the number
-	 * of bytes to copy to make 'dst' 8-byte aligned.  We pre-
-	 * subtract this from 'len'.
-	 */
-	 sub		%g2, 0x8, %g2			! A0
-	sub		%g0, %g2, %g2			! A0	Group (reg-dep)
-	sub		%o2, %g2, %o2			! A0	Group (reg-dep)
-
-	/* Copy %g2 bytes from src to dst, one byte at a time. */
-1:	EXNV2(lduba [%o1 + 0x00] %asi, %o3, add %o2, %g2)! MS	(Group) (%o3 in 3 cycles)
-	add		%o1, 0x1, %o1			! A1
-	add		%o0, 0x1, %o0			! A0	Group
-	subcc		%g2, 0x1, %g2			! A1
-
-	bg,pt		%icc, 1b			! BR	Group
-	 EXNV2(stba %o3, [%o0 + -1] %asi, add %o2, %g2)	! MS	Group
-
-2:	VISEntryHalf					! MS+MS
-
-	/* Compute (len - (len % 8)) into %g2.  This is guaranteed
-	 * to be nonzero.
-	 */
-	andn		%o2, 0x7, %g2			! A0	Group
-
-	/* You may read this and believe that it allows reading
-	 * one 8-byte longword past the end of src.  It actually
-	 * does not, as %g2 is subtracted as loads are done from
-	 * src, so we always stop before running off the end.
-	 * Also, we are guaranteed to have at least 0x10 bytes
-	 * to move here.
-	 */
-	sub		%g2, 0x8, %g2			! A0	Group (reg-dep)
-	alignaddr	%o1, %g0, %g1			! MS	      (Break-after)
-	EX(ldda [%g1 + 0x00] %asi, %f0, add %o2, %g0)	! MS	Group (1-cycle stall)
-	add		%g1, 0x8, %g1			! A0
-
-1:	EX(ldda [%g1 + 0x00] %asi, %f2, add %o2, %g0)	! MS	Group
-	add		%g1, 0x8, %g1			! A0
-	sub		%o2, 0x8, %o2			! A1
-	subcc		%g2, 0x8, %g2			! A0	Group
-
-	faligndata	%f0, %f2, %f8			! FGA	Group (1-cycle stall)
-	EX(stda %f8, [%o0 + 0x00] %asi, add %o2, 0x8)	! MS	Group (2-cycle stall)
-	add		%o1, 0x8, %o1			! A0
-	be,pn		%icc, 2f			! BR
-
-	 add		%o0, 0x8, %o0			! A1
-	EX(ldda [%g1 + 0x00] %asi, %f0, add %o2, %g0)	! MS	Group
-	add		%g1, 0x8, %g1			! A0
-	sub		%o2, 0x8, %o2			! A1
-
-	subcc		%g2, 0x8, %g2			! A0	Group
-	faligndata	%f2, %f0, %f8			! FGA	Group (1-cycle stall)
-	EX(stda %f8, [%o0 + 0x00] %asi, add %o2, 0x8)	! MS	Group (2-cycle stall)
-	add		%o1, 0x8, %o1			! A0
-
-	bne,pn		%icc, 1b			! BR
-	 add		%o0, 0x8, %o0			! A1
-
-	/* Nothing left to copy? */
-2:	cmp		%o2, 0				! A0	Group
-	VISExitHalf					! A0+MS
-	be,pn		%icc, U3copy_in_user_short_ret	! BR	Group
-	 nop						! A0
-	ba,a,pt		%xcc, U3copy_in_user_short	! BR	Group
-
-#else /* !(SMALL_COPY_USES_FPU) */
-
-	xor		%o1, %o0, %g2
-	andcc		%g2, 0x7, %g0
-	bne,pn		%icc, U3copy_in_user_short
-	 andcc		%o1, 0x7, %g2
-
-	be,pt		%xcc, 2f
-	 sub		%g2, 0x8, %g2
-	sub		%g0, %g2, %g2
-	sub		%o2, %g2, %o2
-
-1:	EXNV2(lduba [%o1 + 0x00] %asi, %o3, add %o2, %g2)
-	add		%o1, 0x1, %o1
-	add		%o0, 0x1, %o0
-	subcc		%g2, 0x1, %g2
-	bg,pt		%icc, 1b
-	 EXNV2(stba %o3, [%o0 + -1] %asi, add %o2, %g2)
 
-2:	andn		%o2, 0x7, %g2
-	sub		%o2, %g2, %o2
+small_copy: /* 0 < len <= 16 */
+	andcc		%o3, 0x3, %g0
+	bne,pn		%XCC, small_copy_unaligned
+	 sub		%o0, %o1, %o3
 
-3:	EXNV3(ldxa [%o1 + 0x00] %asi, %o3, add %o2, %g2)
-	add		%o1, 0x8, %o1
-	add		%o0, 0x8, %o0
-	subcc		%g2, 0x8, %g2
-	bg,pt		%icc, 3b
-	 EXNV3(stxa %o3, [%o0 + -8] %asi, add %o2, %g2)
+small_copy_aligned:
+	subcc		%o2, 4, %o2
+	EXNV4(lduwa [%o1] %asi, %g1, add %o2, %g0)
+	EXNV4(stwa %g1, [%o1 + %o3] ASI_AIUS, add %o2, %g0)
+	bgu,pt		%XCC, small_copy_aligned
+	 add		%o1, 4, %o1
 
-	cmp		%o2, 0
-	bne,pn		%icc, U3copy_in_user_short
-	 nop
-	ba,a,pt		%xcc, U3copy_in_user_short_ret
+out:	retl
+	 clr		%o0
 
-#endif /* !(SMALL_COPY_USES_FPU) */
+	.align	32
+small_copy_unaligned:
+	subcc		%o2, 1, %o2
+	EXNV1(lduba [%o1] %asi, %g1, add %o2, %g0)
+	EXNV1(stba %g1, [%o1 + %o3] ASI_AIUS, add %o2, %g0)
+	bgu,pt		%XCC, small_copy_unaligned
+	 add		%o1, 1, %o1
+	retl
+	 clr		%o0
diff --git a/arch/sparc64/lib/U3copy_to_user.S b/arch/sparc64/lib/U3copy_to_user.S
index 6b421fc2f..715227156 100644
--- a/arch/sparc64/lib/U3copy_to_user.S
+++ b/arch/sparc64/lib/U3copy_to_user.S
@@ -1,15 +1,15 @@
-/* $Id: U3copy_to_user.S,v 1.3 2000/11/01 09:29:19 davem Exp $
- * U3memcpy.S: UltraSparc-III optimized copy to userspace.
+/* U3copy_to_user.S: UltraSparc-III optimized memcpy.
  *
- * Copyright (C) 1999, 2000 David S. Miller (davem@redhat.com)
+ * Copyright (C) 1999, 2000, 2004 David S. Miller (davem@redhat.com)
  */
 
-#ifdef __KERNEL__
 #include <asm/visasm.h>
 #include <asm/asi.h>
 #include <asm/dcu.h>
 #include <asm/spitfire.h>
-#undef SMALL_COPY_USES_FPU
+
+#define XCC xcc
+
 #define EXNV(x,y,a,b)	\
 98:	x,y;				\
 	.section .fixup;		\
@@ -34,6 +34,18 @@
 	.text;				\
 	.align 4;
 #define EXNV3(x,y,a,b)	\
+98:	x,y;				\
+	.section .fixup;		\
+	.align 4;			\
+99:	a, b, %o0;			\
+	retl;				\
+	 add %o0, 4, %o0;		\
+	.section __ex_table;		\
+	.align 4;			\
+	.word 98b, 99b;			\
+	.text;				\
+	.align 4;
+#define EXNV4(x,y,a,b)	\
 98:	x,y;				\
 	.section .fixup;		\
 	.align 4;			\
@@ -112,22 +124,9 @@
 	.word 98b, 99b;			\
 	.text;				\
 	.align 4;
-#else
-#define ASI_AIUS 0x80
-#define ASI_BLK_AIUS 0xf0
-#define FPRS_FEF  0x04
-#define VISEntryHalf rd %fprs, %o5; wr %g0, FPRS_FEF, %fprs
-#define VISExitHalf and %o5, FPRS_FEF, %o5; wr %o5, 0x0, %fprs
-#define SMALL_COPY_USES_FPU
-#define EXNV(x,y,a,b)	x,y;
-#define EXNV2(x,y,a,b)	x,y;
-#define EXNV3(x,y,a,b)	x,y;
-#define EX(x,y,a,b)	x,y;
-#define EXBLK1(x,y)	x,y;
-#define EXBLK2(x,y)	x,y;
-#define EXBLK3(x,y)	x,y;
-#define EXBLK4(x,y)	x,y;
-#endif
+
+	.register	%g2,#scratch
+	.register	%g3,#scratch
 
 	/* Special/non-trivial issues of this code:
 	 *
@@ -148,400 +147,269 @@
 	 * of up to 2.4GB per second.
 	 */
 
-	.globl		U3copy_to_user
-U3copy_to_user: /* %o0=dst, %o1=src, %o2=len */
+	.globl	U3copy_to_user
+U3copy_to_user:	/* %o0=dst, %o1=src, %o2=len */
 	/* Writing to %asi is _expensive_ so we hardcode it.
 	 * Reading %asi to check for KERNEL_DS is comparatively
 	 * cheap.
 	 */
-	rd		%asi, %g1			! MS	Group	(4 cycles)
-	cmp		%g1, ASI_AIUS			! A0	Group
-	bne		U3memcpy			! BR
-	 nop						! A1
-#ifndef __KERNEL__
-	/* Save away original 'dst' for memcpy return value. */
-	mov		%o0, %g3			! A0	Group
-#endif
-	/* Anything to copy at all? */
-	cmp		%o2, 0				! A1
-	ble,pn		%icc, U3copy_to_user_short_ret	! BR
-
-	/* Extremely small copy? */
-	 cmp		%o2, 31				! A0	Group
-	ble,pn		%icc, U3copy_to_user_short	! BR
-
-	/* Large enough to use unrolled prefetch loops? */
-	 cmp		%o2, 0x100			! A1
-	bge,a,pt	%icc, U3copy_to_user_enter	! BR	Group
-	 andcc		%o0, 0x3f, %g2			! A0
-
-	ba,pt		%xcc, U3copy_to_user_toosmall	! BR	Group
-	 andcc		%o0, 0x7, %g2			! A0
-
-	.align		32
-U3copy_to_user_short:
-	/* Copy %o2 bytes from src to dst, one byte at a time. */
-	ldub		[%o1 + 0x00], %o3		! MS	Group
-	add		%o1, 0x1, %o1			! A0
-	add		%o0, 0x1, %o0			! A1
-	subcc		%o2, 1, %o2			! A0	Group
-
-	bg,pt		%icc, U3copy_to_user_short	! BR
-	 EXNV(stba %o3, [%o0 + -1] %asi, add %o2, 1)	! MS	Group (1-cycle stall)
-
-U3copy_to_user_short_ret:
-#ifdef __KERNEL__
-	retl						! BR	Group (0-4 cycle stall)
-	 clr		%o0				! A0
-#else
-	retl						! BR	Group (0-4 cycle stall)
-	 mov		%g3, %o0			! A0
-#endif
-
-	/* Here len >= (6 * 64) and condition codes reflect execution
+	rd		%asi, %g1
+	cmp		%g1, ASI_AIUS
+	bne,pn		%icc, U3memcpy_user_stub
+	 nop
+
+	cmp		%o2, 0
+	be,pn		%XCC, 85f
+	 or		%o0, %o1, %o3
+	cmp		%o2, 16
+	bleu,a,pn	%XCC, 80f
+	 or		%o3, %o2, %o3
+
+	cmp		%o2, 256
+	blu,pt		%XCC, 70f
+	 andcc		%o3, 0x7, %g0
+
+	ba,pt		%xcc, 1f
+	 andcc		%o0, 0x3f, %g2
+
+	/* Here len >= 256 and condition codes reflect execution
 	 * of "andcc %o0, 0x7, %g2", done by caller.
 	 */
 	.align		64
-U3copy_to_user_enter:
+1:
 	/* Is 'dst' already aligned on an 64-byte boundary? */
-	be,pt		%xcc, 2f			! BR
+	be,pt		%XCC, 2f
 
 	/* Compute abs((dst & 0x3f) - 0x40) into %g2.  This is the number
 	 * of bytes to copy to make 'dst' 64-byte aligned.  We pre-
 	 * subtract this from 'len'.
 	 */
-	 sub		%g2, 0x40, %g2			! A0	Group
-	sub		%g0, %g2, %g2			! A0	Group
-	sub		%o2, %g2, %o2			! A0	Group
+	 sub		%g2, 0x40, %g2
+	sub		%g0, %g2, %g2
+	sub		%o2, %g2, %o2
 
 	/* Copy %g2 bytes from src to dst, one byte at a time. */
-1:	ldub		[%o1 + 0x00], %o3		! MS	(Group)
-	add		%o1, 0x1, %o1			! A1
-	add		%o0, 0x1, %o0			! A0	Group
-	subcc		%g2, 0x1, %g2			! A1
+1:	ldub		[%o1 + 0x00], %o3
+	add		%o1, 0x1, %o1
+	add		%o0, 0x1, %o0
+	subcc		%g2, 0x1, %g2
 
-	bg,pt		%icc, 1b			! BR	Group
-	 EXNV2(stba %o3, [%o0 + -1] %asi, add %o2, %g2)	! MS	Group
+	bg,pt		%XCC, 1b
+	 EXNV2(stba %o3, [%o0 + -1] %asi, add %o2, %g2)
 
-2:	VISEntryHalf					! MS+MS
-	and		%o1, 0x7, %g1			! A1
-	ba,pt		%xcc, U3copy_to_user_begin	! BR
-	 alignaddr	%o1, %g0, %o1			! MS	      (Break-after)
+2:	VISEntryHalf
+	and		%o1, 0x7, %g1
+	ba,pt		%xcc, 1f
+	 alignaddr	%o1, %g0, %o1
 
 	.align		64
-U3copy_to_user_begin:
-#ifdef __KERNEL__
-	.globl		U3copy_to_user_nop_1_6
-U3copy_to_user_nop_1_6:
-	ldxa		[%g0] ASI_DCU_CONTROL_REG, %g3
-	sethi		%uhi(DCU_PE), %o3
-	sllx		%o3, 32, %o3
-	or		%g3, %o3, %o3
-	stxa		%o3, [%g0] ASI_DCU_CONTROL_REG	! Enable P-cache
-	membar		#Sync
-#endif
-	prefetch	[%o1 + 0x000], #one_read	! MS	Group1
-	prefetch	[%o1 + 0x040], #one_read	! MS	Group2
-	andn		%o2, (0x40 - 1), %o4		! A0
-	prefetch	[%o1 + 0x080], #one_read	! MS	Group3
-	cmp		%o4, 0x140			! A0
-	prefetch	[%o1 + 0x0c0], #one_read	! MS	Group4
-	ldd		[%o1 + 0x000], %f0		! MS	Group5 (%f0 results at G8)
-	bge,a,pt	%icc, 1f			! BR
-
-	 prefetch	[%o1 + 0x100], #one_read	! MS	Group6
-1:	ldd		[%o1 + 0x008], %f2		! AX	       (%f2 results at G9)
-	cmp		%o4, 0x180			! A1
-	bge,a,pt	%icc, 1f			! BR
-	 prefetch	[%o1 + 0x140], #one_read	! MS	Group7
-1:	ldd		[%o1 + 0x010], %f4		! AX	       (%f4 results at G10)
-	cmp		%o4, 0x1c0			! A1
-	bge,a,pt	%icc, 1f			! BR
-
-	 prefetch	[%o1 + 0x180], #one_read	! MS	Group8
-1:	faligndata	%f0, %f2, %f16			! FGA	Group9 (%f16 at G12)
-	ldd		[%o1 + 0x018], %f6		! AX	       (%f6 results at G12)
-	faligndata	%f2, %f4, %f18			! FGA	Group10 (%f18 results at G13)
-	ldd		[%o1 + 0x020], %f8		! MS	        (%f8 results at G13)
-	faligndata	%f4, %f6, %f20			! FGA	Group12	(1-cycle stall,%f20 at G15)
-	ldd		[%o1 + 0x028], %f10		! MS		(%f10 results at G15)
-	faligndata	%f6, %f8, %f22			! FGA	Group13 (%f22 results at G16)
-	
-	ldd		[%o1 + 0x030], %f12		! MS		(%f12 results at G16)
-	faligndata	%f8, %f10, %f24			! FGA	Group15 (1-cycle stall,%f24 at G18)
-	ldd		[%o1 + 0x038], %f14		! MS		(%f14 results at G18)
-	faligndata	%f10, %f12, %f26		! FGA	Group16 (%f26 results at G19)
-	ldd		[%o1 + 0x040], %f0		! MS		(%f0 results at G19)
-
-	/* We only use the first loop if len > (7 * 64). */
-	subcc		%o4, 0x1c0, %o4			! A0	Group17
-	bg,pt		%icc, U3copy_to_user_loop1	! BR
-	 add		%o1, 0x40, %o1			! A1
-
-	add		%o4, 0x140, %o4			! A0	Group18
-	ba,pt		%xcc, U3copy_to_user_loop2	! BR
-	 srl		%o4, 6, %o3			! A0	Group19
-	nop
-	nop
-	nop
-	nop
-	nop
-
-	nop
-	nop
-
-	/* This loop performs the copy and queues new prefetches.
-	 * We drop into the second loop when len <= (5 * 64).  Note
-	 * that this (5 * 64) factor has been subtracted from len
-	 * already.
-	 */
-U3copy_to_user_loop1:
-	ldd		[%o1 + 0x008], %f2		! MS	Group2	(%f2 results at G5)
-	faligndata	%f12, %f14, %f28		! FGA		(%f28 results at G5)
-	ldd		[%o1 + 0x010], %f4		! MS	Group3	(%f4 results at G6)
-	faligndata	%f14, %f0, %f30			! FGA	Group4	(1-cycle stall, %f30 at G7)
-	EXBLK1(stda %f16, [%o0] ASI_BLK_AIUS)		! MS
-	ldd		[%o1 + 0x018], %f6		! AX		(%f6 results at G7)
-
-	faligndata	%f0, %f2, %f16			! FGA	Group12 (7-cycle stall)
-	ldd		[%o1 + 0x020], %f8		! MS	        (%f8 results at G15)
-	faligndata	%f2, %f4, %f18			! FGA	Group13	(%f18 results at G16)
-	ldd		[%o1 + 0x028], %f10		! MS		(%f10 results at G16)
-	faligndata	%f4, %f6, %f20			! FGA	Group14	(%f20 results at G17)
-	ldd		[%o1 + 0x030], %f12		! MS		(%f12 results at G17)
-	faligndata	%f6, %f8, %f22			! FGA	Group15	(%f22 results at G18)
-	ldd		[%o1 + 0x038], %f14		! MS		(%f14 results at G18)
-
-	faligndata	%f8, %f10, %f24			! FGA	Group16	(%f24 results at G19)
-	ldd		[%o1 + 0x040], %f0		! AX		(%f0 results at G19)
-	prefetch	[%o1 + 0x180], #one_read	! MS
-	faligndata	%f10, %f12, %f26		! FGA	Group17	(%f26 results at G20)
-	subcc		%o4, 0x40, %o4			! A0
-	add		%o1, 0x40, %o1			! A1
-	bg,pt		%xcc, U3copy_to_user_loop1		! BR
-	 add		%o0, 0x40, %o0			! A0	Group18
-
-U3copy_to_user_loop2_enter:
-	mov		5, %o3				! A1
-
-	/* This loop performs on the copy, no new prefetches are
-	 * queued.  We do things this way so that we do not perform
-	 * any spurious prefetches past the end of the src buffer.
-	 */
-U3copy_to_user_loop2:
-	ldd		[%o1 + 0x008], %f2		! MS
-	faligndata	%f12, %f14, %f28		! FGA	Group2
-	ldd		[%o1 + 0x010], %f4		! MS
-	faligndata	%f14, %f0, %f30			! FGA	Group4	(1-cycle stall)
-	EXBLK2(stda %f16, [%o0] ASI_BLK_AIUS)		! MS
-	ldd		[%o1 + 0x018], %f6		! AX
-	faligndata	%f0, %f2, %f16			! FGA	Group12 (7-cycle stall)
-
-	ldd		[%o1 + 0x020], %f8		! MS
-	faligndata	%f2, %f4, %f18			! FGA	Group13
-	ldd		[%o1 + 0x028], %f10		! MS
-	faligndata	%f4, %f6, %f20			! FGA	Group14
-	ldd		[%o1 + 0x030], %f12		! MS
-	faligndata	%f6, %f8, %f22			! FGA	Group15
-	ldd		[%o1 + 0x038], %f14		! MS
-	faligndata	%f8, %f10, %f24			! FGA	Group16
-
-	ldd		[%o1 + 0x040], %f0		! AX
-	faligndata	%f10, %f12, %f26		! FGA	Group17
-	subcc		%o3, 0x01, %o3			! A0
-	add		%o1, 0x40, %o1			! A1
-	bg,pt		%xcc, U3copy_to_user_loop2	! BR
-	 add		%o0, 0x40, %o0			! A0	Group18
+1:
+	membar		#StoreLoad | #StoreStore | #LoadStore
+	prefetch	[%o1 + 0x000], #one_read
+	prefetch	[%o1 + 0x040], #one_read
+	andn		%o2, (0x40 - 1), %o4
+	prefetch	[%o1 + 0x080], #one_read
+	prefetch	[%o1 + 0x0c0], #one_read
+	ldd		[%o1 + 0x000], %f0
+	prefetch	[%o1 + 0x100], #one_read
+	ldd		[%o1 + 0x008], %f2
+	prefetch	[%o1 + 0x140], #one_read
+	ldd		[%o1 + 0x010], %f4
+	prefetch	[%o1 + 0x180], #one_read
+	faligndata	%f0, %f2, %f16
+	ldd		[%o1 + 0x018], %f6
+	faligndata	%f2, %f4, %f18
+	ldd		[%o1 + 0x020], %f8
+	faligndata	%f4, %f6, %f20
+	ldd		[%o1 + 0x028], %f10
+	faligndata	%f6, %f8, %f22
+
+	ldd		[%o1 + 0x030], %f12
+	faligndata	%f8, %f10, %f24
+	ldd		[%o1 + 0x038], %f14
+	faligndata	%f10, %f12, %f26
+	ldd		[%o1 + 0x040], %f0
+
+	sub		%o4, 0x80, %o4
+	add		%o1, 0x40, %o1
+	ba,pt		%xcc, 1f
+	 srl		%o4, 6, %o3
+
+	.align		64
+1:
+	ldd		[%o1 + 0x008], %f2
+	faligndata	%f12, %f14, %f28
+	ldd		[%o1 + 0x010], %f4
+	faligndata	%f14, %f0, %f30
+	EXBLK2(stda %f16, [%o0] ASI_BLK_AIUS)
+	ldd		[%o1 + 0x018], %f6
+	faligndata	%f0, %f2, %f16
+
+	ldd		[%o1 + 0x020], %f8
+	faligndata	%f2, %f4, %f18
+	ldd		[%o1 + 0x028], %f10
+	faligndata	%f4, %f6, %f20
+	ldd		[%o1 + 0x030], %f12
+	faligndata	%f6, %f8, %f22
+	ldd		[%o1 + 0x038], %f14
+	faligndata	%f8, %f10, %f24
+
+	ldd		[%o1 + 0x040], %f0
+	prefetch	[%o1 + 0x180], #one_read
+	faligndata	%f10, %f12, %f26
+	subcc		%o3, 0x01, %o3
+	add		%o1, 0x40, %o1
+	bg,pt		%XCC, 1b
+	 add		%o0, 0x40, %o0
 
 	/* Finally we copy the last full 64-byte block. */
-U3copy_to_user_loopfini:
-	ldd		[%o1 + 0x008], %f2		! MS
-	faligndata	%f12, %f14, %f28		! FGA
-	ldd		[%o1 + 0x010], %f4		! MS	Group19
-	faligndata	%f14, %f0, %f30			! FGA
-	EXBLK3(stda %f16, [%o0] ASI_BLK_AIUS)		! MS	Group20
-	ldd		[%o1 + 0x018], %f6		! AX
-	faligndata	%f0, %f2, %f16			! FGA	Group11 (7-cycle stall)
-	ldd		[%o1 + 0x020], %f8		! MS
-	faligndata	%f2, %f4, %f18			! FGA	Group12
-	ldd		[%o1 + 0x028], %f10		! MS
-	faligndata	%f4, %f6, %f20			! FGA	Group13
-	ldd		[%o1 + 0x030], %f12		! MS
-	faligndata	%f6, %f8, %f22			! FGA	Group14
-	ldd		[%o1 + 0x038], %f14		! MS
-	faligndata	%f8, %f10, %f24			! FGA	Group15
-	cmp		%g1, 0				! A0
-	be,pt		%icc, 1f			! BR
-	 add		%o0, 0x40, %o0			! A1
-	ldd		[%o1 + 0x040], %f0		! MS
-1:	faligndata	%f10, %f12, %f26		! FGA	Group16
-	faligndata	%f12, %f14, %f28		! FGA	Group17
-	faligndata	%f14, %f0, %f30			! FGA	Group18
-	EXBLK4(stda %f16, [%o0] ASI_BLK_AIUS)		! MS
-	add		%o0, 0x40, %o0			! A0
-	add		%o1, 0x40, %o1			! A1
-#ifdef __KERNEL__
-	.globl		U3copy_to_user_nop_2_3
-U3copy_to_user_nop_2_3:
-	mov		PRIMARY_CONTEXT, %o3
-	stxa		%g0, [%o3] ASI_DMMU		! Flush P-cache
-	stxa		%g3, [%g0] ASI_DCU_CONTROL_REG	! Disable P-cache
-#endif
-	membar		#Sync				! MS	Group26 (7-cycle stall)
+	ldd		[%o1 + 0x008], %f2
+	faligndata	%f12, %f14, %f28
+	ldd		[%o1 + 0x010], %f4
+	faligndata	%f14, %f0, %f30
+	EXBLK3(stda %f16, [%o0] ASI_BLK_AIUS)
+	ldd		[%o1 + 0x018], %f6
+	faligndata	%f0, %f2, %f16
+	ldd		[%o1 + 0x020], %f8
+	faligndata	%f2, %f4, %f18
+	ldd		[%o1 + 0x028], %f10
+	faligndata	%f4, %f6, %f20
+	ldd		[%o1 + 0x030], %f12
+	faligndata	%f6, %f8, %f22
+	ldd		[%o1 + 0x038], %f14
+	faligndata	%f8, %f10, %f24
+	cmp		%g1, 0
+	be,pt		%XCC, 1f
+	 add		%o0, 0x40, %o0
+	ldd		[%o1 + 0x040], %f0
+1:	faligndata	%f10, %f12, %f26
+	faligndata	%f12, %f14, %f28
+	faligndata	%f14, %f0, %f30
+	EXBLK4(stda %f16, [%o0] ASI_BLK_AIUS)
+	add		%o0, 0x40, %o0
+	add		%o1, 0x40, %o1
+
+	membar		#Sync
 
 	/* Now we copy the (len modulo 64) bytes at the end.
 	 * Note how we borrow the %f0 loaded above.
 	 *
 	 * Also notice how this code is careful not to perform a
-	 * load past the end of the src buffer just like similar
-	 * code found in U3copy_to_user_toosmall processing.
+	 * load past the end of the src buffer.
 	 */
-U3copy_to_user_loopend:
-	and		%o2, 0x3f, %o2			! A0	Group
-	andcc		%o2, 0x38, %g2			! A0	Group
-	be,pn		%icc, U3copy_to_user_endcruft	! BR
-	 subcc		%g2, 0x8, %g2			! A1
-	be,pn		%icc, U3copy_to_user_endcruft	! BR	Group
-	 cmp		%g1, 0				! A0
-
-	be,a,pt		%icc, 1f			! BR	Group
-	 ldd		[%o1 + 0x00], %f0		! MS
-
-1:	ldd		[%o1 + 0x08], %f2		! MS	Group
-	add		%o1, 0x8, %o1			! A0
-	sub		%o2, 0x8, %o2			! A1
-	subcc		%g2, 0x8, %g2			! A0	Group
-	faligndata	%f0, %f2, %f8			! FGA	Group
-	EX(stda %f8, [%o0 + 0x00] %asi, add %o2, 0x8)	! MS	(XXX does it stall here? XXX)
-	be,pn		%icc, U3copy_to_user_endcruft	! BR
-	 add		%o0, 0x8, %o0			! A0
-	ldd		[%o1 + 0x08], %f0		! MS	Group
-	add		%o1, 0x8, %o1			! A0
-	sub		%o2, 0x8, %o2			! A1
-	subcc		%g2, 0x8, %g2			! A0	Group
-	faligndata	%f2, %f0, %f8			! FGA
-	EX(stda %f8, [%o0 + 0x00] %asi, add %o2, 0x8)	! MS	(XXX does it stall here? XXX)
-	bne,pn		%icc, 1b			! BR
-	 add		%o0, 0x8, %o0			! A0	Group
+	and		%o2, 0x3f, %o2
+	andcc		%o2, 0x38, %g2
+	be,pn		%XCC, 2f
+	 subcc		%g2, 0x8, %g2
+	be,pn		%XCC, 2f
+	 cmp		%g1, 0
+
+	be,a,pt		%XCC, 1f
+	 ldd		[%o1 + 0x00], %f0
+
+1:	ldd		[%o1 + 0x08], %f2
+	add		%o1, 0x8, %o1
+	sub		%o2, 0x8, %o2
+	subcc		%g2, 0x8, %g2
+	faligndata	%f0, %f2, %f8
+	EX(stda %f8, [%o0 + 0x00] %asi, add %o2, 0x8)
+	be,pn		%XCC, 2f
+	 add		%o0, 0x8, %o0
+	ldd		[%o1 + 0x08], %f0
+	add		%o1, 0x8, %o1
+	sub		%o2, 0x8, %o2
+	subcc		%g2, 0x8, %g2
+	faligndata	%f2, %f0, %f8
+	EX(stda %f8, [%o0 + 0x00] %asi, add %o2, 0x8)
+	bne,pn		%XCC, 1b
+	 add		%o0, 0x8, %o0
 
 	/* If anything is left, we copy it one byte at a time.
 	 * Note that %g1 is (src & 0x3) saved above before the
 	 * alignaddr was performed.
 	 */
-U3copy_to_user_endcruft:
+2:
 	cmp		%o2, 0
 	add		%o1, %g1, %o1
 	VISExitHalf
-	be,pn		%icc, U3copy_to_user_short_ret
-	 nop
-	ba,a,pt		%xcc, U3copy_to_user_short
-
-	/* If we get here, then 32 <= len < (6 * 64) */
-U3copy_to_user_toosmall:
-
-#ifdef SMALL_COPY_USES_FPU
-
-	/* Is 'dst' already aligned on an 8-byte boundary? */
-	be,pt		%xcc, 2f			! BR	Group
-
-	/* Compute abs((dst & 7) - 8) into %g2.  This is the number
-	 * of bytes to copy to make 'dst' 8-byte aligned.  We pre-
-	 * subtract this from 'len'.
-	 */
-	 sub		%g2, 0x8, %g2			! A0
-	sub		%g0, %g2, %g2			! A0	Group (reg-dep)
-	sub		%o2, %g2, %o2			! A0	Group (reg-dep)
-
-	/* Copy %g2 bytes from src to dst, one byte at a time. */
-1:	ldub		[%o1 + 0x00], %o3		! MS	(Group) (%o3 in 3 cycles)
-	add		%o1, 0x1, %o1			! A1
-	add		%o0, 0x1, %o0			! A0	Group
-	subcc		%g2, 0x1, %g2			! A1
+	be,pn		%XCC, 85f
+	 sub		%o0, %o1, %o3
 
-	bg,pt		%icc, 1b			! BR	Group
-	 EXNV2(stba %o3, [%o0 + -1] %asi, add %o2, %g2)	! MS	Group
+	andcc		%g1, 0x7, %g0
+	bne,pn		%icc, 90f
+	 andcc		%o2, 0x8, %g0
+	be,pt		%icc, 1f
+	 nop
+	ldx		[%o1], %o5
+	EXNV(stxa %o5, [%o1 + %o3] ASI_AIUS, add %o2, %g0)
+	add		%o1, 0x8, %o1
 
-2:	VISEntryHalf					! MS+MS
+1:	andcc		%o2, 0x4, %g0
+	be,pt		%icc, 1f
+	 nop
+	lduw		[%o1], %o5
+	EXNV(stwa %o5, [%o1 + %o3] ASI_AIUS, and %o2, 0x7)
+	add		%o1, 0x4, %o1
 
-	/* Compute (len - (len % 8)) into %g2.  This is guaranteed
-	 * to be nonzero.
-	 */
-	andn		%o2, 0x7, %g2			! A0	Group
-
-	/* You may read this and believe that it allows reading
-	 * one 8-byte longword past the end of src.  It actually
-	 * does not, as %g2 is subtracted as loads are done from
-	 * src, so we always stop before running off the end.
-	 * Also, we are guaranteed to have at least 0x10 bytes
-	 * to move here.
-	 */
-	sub		%g2, 0x8, %g2			! A0	Group (reg-dep)
-	alignaddr	%o1, %g0, %g1			! MS	      (Break-after)
-	ldd		[%g1 + 0x00], %f0		! MS	Group (1-cycle stall)
-	add		%g1, 0x8, %g1			! A0
-
-1:	ldd		[%g1 + 0x00], %f2		! MS	Group
-	add		%g1, 0x8, %g1			! A0
-	sub		%o2, 0x8, %o2			! A1
-	subcc		%g2, 0x8, %g2			! A0	Group
-
-	faligndata	%f0, %f2, %f8			! FGA	Group (1-cycle stall)
-	EX(stda %f8, [%o0 + 0x00] %asi, add %o2, 0x8)	! MS	Group (2-cycle stall)
-	add		%o1, 0x8, %o1			! A0
-	be,pn		%icc, 2f			! BR
-
-	 add		%o0, 0x8, %o0			! A1
-	ldd		[%g1 + 0x00], %f0		! MS	Group
-	add		%g1, 0x8, %g1			! A0
-	sub		%o2, 0x8, %o2			! A1
-
-	subcc		%g2, 0x8, %g2			! A0	Group
-	faligndata	%f2, %f0, %f8			! FGA	Group (1-cycle stall)
-	EX(stda %f8, [%o0 + 0x00] %asi, add %o2, 0x8)	! MS	Group (2-cycle stall)
-	add		%o1, 0x8, %o1			! A0
-
-	bne,pn		%icc, 1b			! BR
-	 add		%o0, 0x8, %o0			! A1
-
-	/* Nothing left to copy? */
-2:	cmp		%o2, 0				! A0	Group
-	VISExitHalf					! A0+MS
-	be,pn		%icc, U3copy_to_user_short_ret	! BR	Group
-	 nop						! A0
-	ba,a,pt		%xcc, U3copy_to_user_short	! BR	Group
-
-#else /* !(SMALL_COPY_USES_FPU) */
-
-	xor		%o1, %o0, %g2
-	andcc		%g2, 0x7, %g0
-	bne,pn		%icc, U3copy_to_user_short
-	 andcc		%o1, 0x7, %g2
-
-	be,pt		%xcc, 2f
-	 sub		%g2, 0x8, %g2
-	sub		%g0, %g2, %g2
-	sub		%o2, %g2, %o2
+1:	andcc		%o2, 0x2, %g0
+	be,pt		%icc, 1f
+	 nop
+	lduh		[%o1], %o5
+	EXNV(stha %o5, [%o1 + %o3] ASI_AIUS, and %o2, 0x3)
+	add		%o1, 0x2, %o1
 
-1:	ldub		[%o1 + 0x00], %o3
-	add		%o1, 0x1, %o1
-	add		%o0, 0x1, %o0
-	subcc		%g2, 0x1, %g2
-	bg,pt		%icc, 1b
-	 EXNV2(stba %o3, [%o0 + -1] %asi, add %o2, %g2)
+1:	andcc		%o2, 0x1, %g0
+	be,pt		%icc, 85f
+	 nop
+	ldub		[%o1], %o5
+	ba,pt		%xcc, 85f
+	 EXNV(stba %o5, [%o1 + %o3] ASI_AIUS, and %o2, 0x1)
+
+70: /* 16 < len <= 64 */
+	bne,pn		%XCC, 90f
+	 sub		%o0, %o1, %o3
+
+	andn		%o2, 0x7, %o4
+	and		%o2, 0x7, %o2
+1:	subcc		%o4, 0x8, %o4
+	ldx		[%o1], %o5
+	EXNV4(stxa %o5, [%o1 + %o3] ASI_AIUS, add %o2, %o4)
+	bgu,pt		%XCC, 1b
+	 add		%o1, 0x8, %o1
+	andcc		%o2, 0x4, %g0
+	be,pt		%XCC, 1f
+	 nop
+	sub		%o2, 0x4, %o2
+	lduw		[%o1], %o5
+	EXNV3(stwa %o5, [%o1 + %o3] ASI_AIUS, add %o2, %g0)
+	add		%o1, 0x4, %o1
+1:	cmp		%o2, 0
+	be,pt		%XCC, 85f
+	 nop
+	ba,pt		%xcc, 90f
+	 nop
 
-2:	andn		%o2, 0x7, %g2
-	sub		%o2, %g2, %o2
+80: /* 0 < len <= 16 */
+	andcc		%o3, 0x3, %g0
+	bne,pn		%XCC, 90f
+	 sub		%o0, %o1, %o3
 
-3:	ldx		[%o1 + 0x00], %o3
-	add		%o1, 0x8, %o1
-	add		%o0, 0x8, %o0
-	subcc		%g2, 0x8, %g2
-	bg,pt		%icc, 3b
-	 EXNV3(stxa %o3, [%o0 + -8] %asi, add %o2, %g2)
+1:
+	subcc		%o2, 4, %o2
+	lduw		[%o1], %g1
+	EXNV3(stwa %g1, [%o1 + %o3] ASI_AIUS, add %o2, %g0)
+	bgu,pt		%XCC, 1b
+	 add		%o1, 4, %o1
 
-	cmp		%o2, 0
-	bne,pn		%icc, U3copy_to_user_short
-	 nop
-	ba,a,pt		%xcc, U3copy_to_user_short_ret
+85:	retl
+	 clr		%o0
 
-#endif /* !(SMALL_COPY_USES_FPU) */
+	.align	32
+90:
+	subcc		%o2, 1, %o2
+	ldub		[%o1], %g1
+	EXNV2(stba %g1, [%o1 + %o3] ASI_AIUS, add %o2, %g0)
+	bgu,pt		%XCC, 90b
+	 add		%o1, 1, %o1
+	retl
+	 clr		%o0
diff --git a/arch/sparc64/lib/U3memcpy.S b/arch/sparc64/lib/U3memcpy.S
index 459940103..e9982deef 100644
--- a/arch/sparc64/lib/U3memcpy.S
+++ b/arch/sparc64/lib/U3memcpy.S
@@ -1,7 +1,6 @@
-/* $Id: U3memcpy.S,v 1.2 2000/11/01 09:29:19 davem Exp $
- * U3memcpy.S: UltraSparc-III optimized memcpy.
+/* U3memcpy.S: UltraSparc-III optimized memcpy.
  *
- * Copyright (C) 1999, 2000 David S. Miller (davem@redhat.com)
+ * Copyright (C) 1999, 2000, 2004 David S. Miller (davem@redhat.com)
  */
 
 #ifdef __KERNEL__
@@ -9,15 +8,20 @@
 #include <asm/asi.h>
 #include <asm/dcu.h>
 #include <asm/spitfire.h>
-#undef SMALL_COPY_USES_FPU
 #else
 #define ASI_BLK_P 0xf0
 #define FPRS_FEF  0x04
 #define VISEntryHalf rd %fprs, %o5; wr %g0, FPRS_FEF, %fprs
 #define VISExitHalf and %o5, FPRS_FEF, %o5; wr %o5, 0x0, %fprs
-#define SMALL_COPY_USES_FPU
 #endif
 
+#ifndef XCC
+#define XCC xcc
+#endif
+
+	.register	%g2,#scratch
+	.register	%g3,#scratch
+
 	/* Special/non-trivial issues of this code:
 	 *
 	 * 1) %o5 is preserved from VISEntryHalf to VISExitHalf
@@ -37,392 +41,274 @@
 	 * of up to 2.4GB per second.
 	 */
 
-	.globl		U3memcpy
-U3memcpy: /* %o0=dst, %o1=src, %o2=len */
-#ifndef __KERNEL__
-	/* Save away original 'dst' for memcpy return value. */
-	mov		%o0, %g3			! A0	Group
-#endif
-	/* Anything to copy at all? */
-	cmp		%o2, 0				! A1
-	ble,pn		%icc, U3memcpy_short_ret	! BR
-
-	/* Extremely small copy? */
-	 cmp		%o2, 31				! A0	Group
-	ble,pn		%icc, U3memcpy_short		! BR
-
-	/* Large enough to use unrolled prefetch loops? */
-	 cmp		%o2, 0x100			! A1
-	bge,a,pt	%icc, U3memcpy_enter		! BR	Group
-	 andcc		%o0, 0x3f, %g2			! A0
-
-	ba,pt		%xcc, U3memcpy_toosmall		! BR	Group
-	 andcc		%o0, 0x7, %g2			! A0
-
-	.align		32
-U3memcpy_short:
-	/* Copy %o2 bytes from src to dst, one byte at a time. */
-	ldub		[%o1 + 0x00], %o3		! MS	Group
-	add		%o1, 0x1, %o1			! A0
-	add		%o0, 0x1, %o0			! A1
-	subcc		%o2, 1, %o2			! A0	Group
-
-	bg,pt		%icc, U3memcpy_short		! BR
-	 stb		%o3, [%o0 + -1]			! MS	Group (1-cycle stall)
-
-U3memcpy_short_ret:
-#ifdef __KERNEL__
-	retl						! BR	Group (0-4 cycle stall)
-	 clr		%o0				! A0
-#else
-	retl						! BR	Group (0-4 cycle stall)
-	 mov		%g3, %o0			! A0
-#endif
+	.globl	U3memcpy
+U3memcpy:	/* %o0=dst, %o1=src, %o2=len */
+	mov		%o0, %g5
+	cmp		%o2, 0
+	be,pn		%XCC, 85f
+	 or		%o0, %o1, %o3
+	cmp		%o2, 16
+	bleu,a,pn	%XCC, 70f
+	 or		%o3, %o2, %o3
 
-	/* Here len >= (6 * 64) and condition codes reflect execution
+	cmp		%o2, 256
+	blu,pt		%XCC, 80f
+	 andcc		%o3, 0x7, %g0
+
+	ba,pt		%xcc, 1f
+	 andcc		%o0, 0x3f, %g2
+
+	/* Here len >= 256 and condition codes reflect execution
 	 * of "andcc %o0, 0x7, %g2", done by caller.
 	 */
 	.align		64
-U3memcpy_enter:
+1:
 	/* Is 'dst' already aligned on an 64-byte boundary? */
-	be,pt		%xcc, 2f			! BR
+	be,pt		%XCC, 2f
 
 	/* Compute abs((dst & 0x3f) - 0x40) into %g2.  This is the number
 	 * of bytes to copy to make 'dst' 64-byte aligned.  We pre-
 	 * subtract this from 'len'.
 	 */
-	 sub		%g2, 0x40, %g2			! A0	Group
-	sub		%g0, %g2, %g2			! A0	Group
-	sub		%o2, %g2, %o2			! A0	Group
+	 sub		%g2, 0x40, %g2
+	sub		%g0, %g2, %g2
+	sub		%o2, %g2, %o2
 
 	/* Copy %g2 bytes from src to dst, one byte at a time. */
-1:	ldub		[%o1 + 0x00], %o3		! MS	(Group)
-	add		%o1, 0x1, %o1			! A1
-	add		%o0, 0x1, %o0			! A0	Group
-	subcc		%g2, 0x1, %g2			! A1
+1:	ldub		[%o1 + 0x00], %o3
+	add		%o1, 0x1, %o1
+	add		%o0, 0x1, %o0
+	subcc		%g2, 0x1, %g2
 
-	bg,pt		%icc, 1b			! BR	Group
-	 stb		%o3, [%o0 + -1]			! MS	Group
+	bg,pt		%XCC, 1b
+	 stb		%o3, [%o0 + -1]
 
-2:	VISEntryHalf					! MS+MS
-	and		%o1, 0x7, %g1			! A1
-	ba,pt		%xcc, U3memcpy_begin		! BR
-	 alignaddr	%o1, %g0, %o1			! MS	      (Break-after)
+2:	VISEntryHalf
+	and		%o1, 0x7, %g1
+	ba,pt		%xcc, 1f
+	 alignaddr	%o1, %g0, %o1
 
 	.align		64
-U3memcpy_begin:
-#ifdef __KERNEL__
-	.globl		U3memcpy_nop_1_6
-U3memcpy_nop_1_6:
-	ldxa		[%g0] ASI_DCU_CONTROL_REG, %g3
-	sethi		%uhi(DCU_PE), %o3
-	sllx		%o3, 32, %o3
-	or		%g3, %o3, %o3
-	stxa		%o3, [%g0] ASI_DCU_CONTROL_REG	! Enable P-cache
-	membar		#Sync
-#endif
-	prefetch	[%o1 + 0x000], #one_read	! MS	Group1
-	prefetch	[%o1 + 0x040], #one_read	! MS	Group2
-	andn		%o2, (0x40 - 1), %o4		! A0
-	prefetch	[%o1 + 0x080], #one_read	! MS	Group3
-	cmp		%o4, 0x140			! A0
-	prefetch	[%o1 + 0x0c0], #one_read	! MS	Group4
-	ldd		[%o1 + 0x000], %f0		! MS	Group5 (%f0 results at G8)
-	bge,a,pt	%icc, 1f			! BR
-
-	 prefetch	[%o1 + 0x100], #one_read	! MS	Group6
-1:	ldd		[%o1 + 0x008], %f2		! AX	       (%f2 results at G9)
-	cmp		%o4, 0x180			! A1
-	bge,a,pt	%icc, 1f			! BR
-	 prefetch	[%o1 + 0x140], #one_read	! MS	Group7
-1:	ldd		[%o1 + 0x010], %f4		! AX	       (%f4 results at G10)
-	cmp		%o4, 0x1c0			! A1
-	bge,a,pt	%icc, 1f			! BR
-
-	 prefetch	[%o1 + 0x180], #one_read	! MS	Group8
-1:	faligndata	%f0, %f2, %f16			! FGA	Group9 (%f16 at G12)
-	ldd		[%o1 + 0x018], %f6		! AX	       (%f6 results at G12)
-	faligndata	%f2, %f4, %f18			! FGA	Group10 (%f18 results at G13)
-	ldd		[%o1 + 0x020], %f8		! MS	        (%f8 results at G13)
-	faligndata	%f4, %f6, %f20			! FGA	Group12	(1-cycle stall,%f20 at G15)
-	ldd		[%o1 + 0x028], %f10		! MS		(%f10 results at G15)
-	faligndata	%f6, %f8, %f22			! FGA	Group13 (%f22 results at G16)
-
-	ldd		[%o1 + 0x030], %f12		! MS		(%f12 results at G16)
-	faligndata	%f8, %f10, %f24			! FGA	Group15 (1-cycle stall,%f24 at G18)
-	ldd		[%o1 + 0x038], %f14		! MS		(%f14 results at G18)
-	faligndata	%f10, %f12, %f26		! FGA	Group16 (%f26 results at G19)
-	ldd		[%o1 + 0x040], %f0		! MS		(%f0 results at G19)
-
-	/* We only use the first loop if len > (7 * 64). */
-	subcc		%o4, 0x1c0, %o4			! A0	Group17
-	bg,pt		%icc, U3memcpy_loop1		! BR
-	 add		%o1, 0x40, %o1			! A1
-
-	add		%o4, 0x140, %o4			! A0	Group18
-	ba,pt		%xcc, U3memcpy_loop2		! BR
-	 srl		%o4, 6, %o3			! A0	Group19
-	nop
-	nop
-	nop
-	nop
-	nop
-
-	nop
-	nop
-
-	/* This loop performs the copy and queues new prefetches.
-	 * We drop into the second loop when len <= (5 * 64).  Note
-	 * that this (5 * 64) factor has been subtracted from len
-	 * already.
-	 */
-U3memcpy_loop1:
-	ldd		[%o1 + 0x008], %f2		! MS	Group2	(%f2 results at G5)
-	faligndata	%f12, %f14, %f28		! FGA		(%f28 results at G5)
-	ldd		[%o1 + 0x010], %f4		! MS	Group3	(%f4 results at G6)
-	faligndata	%f14, %f0, %f30			! FGA	Group4	(1-cycle stall, %f30 at G7)
-	stda		%f16, [%o0] ASI_BLK_P		! MS
-	ldd		[%o1 + 0x018], %f6		! AX		(%f6 results at G7)
-
-	faligndata	%f0, %f2, %f16			! FGA	Group12 (7-cycle stall)
-	ldd		[%o1 + 0x020], %f8		! MS	        (%f8 results at G15)
-	faligndata	%f2, %f4, %f18			! FGA	Group13	(%f18 results at G16)
-	ldd		[%o1 + 0x028], %f10		! MS		(%f10 results at G16)
-	faligndata	%f4, %f6, %f20			! FGA	Group14	(%f20 results at G17)
-	ldd		[%o1 + 0x030], %f12		! MS		(%f12 results at G17)
-	faligndata	%f6, %f8, %f22			! FGA	Group15	(%f22 results at G18)
-	ldd		[%o1 + 0x038], %f14		! MS		(%f14 results at G18)
-
-	faligndata	%f8, %f10, %f24			! FGA	Group16	(%f24 results at G19)
-	ldd		[%o1 + 0x040], %f0		! AX		(%f0 results at G19)
-	prefetch	[%o1 + 0x180], #one_read	! MS
-	faligndata	%f10, %f12, %f26		! FGA	Group17	(%f26 results at G20)
-	subcc		%o4, 0x40, %o4			! A0
-	add		%o1, 0x40, %o1			! A1
-	bg,pt		%xcc, U3memcpy_loop1		! BR
-	 add		%o0, 0x40, %o0			! A0	Group18
-
-U3memcpy_loop2_enter:
-	mov		5, %o3				! A1
-
-	/* This loop performs on the copy, no new prefetches are
-	 * queued.  We do things this way so that we do not perform
-	 * any spurious prefetches past the end of the src buffer.
-	 */
-U3memcpy_loop2:
-	ldd		[%o1 + 0x008], %f2		! MS
-	faligndata	%f12, %f14, %f28		! FGA	Group2
-	ldd		[%o1 + 0x010], %f4		! MS
-	faligndata	%f14, %f0, %f30			! FGA	Group4	(1-cycle stall)
-	stda		%f16, [%o0] ASI_BLK_P		! MS
-	ldd		[%o1 + 0x018], %f6		! AX
-	faligndata	%f0, %f2, %f16			! FGA	Group12 (7-cycle stall)
-
-	ldd		[%o1 + 0x020], %f8		! MS
-	faligndata	%f2, %f4, %f18			! FGA	Group13
-	ldd		[%o1 + 0x028], %f10		! MS
-	faligndata	%f4, %f6, %f20			! FGA	Group14
-	ldd		[%o1 + 0x030], %f12		! MS
-	faligndata	%f6, %f8, %f22			! FGA	Group15
-	ldd		[%o1 + 0x038], %f14		! MS
-	faligndata	%f8, %f10, %f24			! FGA	Group16
-
-	ldd		[%o1 + 0x040], %f0		! AX
-	faligndata	%f10, %f12, %f26		! FGA	Group17
-	subcc		%o3, 0x01, %o3			! A0
-	add		%o1, 0x40, %o1			! A1
-	bg,pt		%xcc, U3memcpy_loop2		! BR
-	 add		%o0, 0x40, %o0			! A0	Group18
+1:
+	membar		#StoreLoad | #StoreStore | #LoadStore
+	prefetch	[%o1 + 0x000], #one_read
+	prefetch	[%o1 + 0x040], #one_read
+	andn		%o2, (0x40 - 1), %o4
+	prefetch	[%o1 + 0x080], #one_read
+	prefetch	[%o1 + 0x0c0], #one_read
+	ldd		[%o1 + 0x000], %f0
+	prefetch	[%o1 + 0x100], #one_read
+	ldd		[%o1 + 0x008], %f2
+	prefetch	[%o1 + 0x140], #one_read
+	ldd		[%o1 + 0x010], %f4
+	prefetch	[%o1 + 0x180], #one_read
+	faligndata	%f0, %f2, %f16
+	ldd		[%o1 + 0x018], %f6
+	faligndata	%f2, %f4, %f18
+	ldd		[%o1 + 0x020], %f8
+	faligndata	%f4, %f6, %f20
+	ldd		[%o1 + 0x028], %f10
+	faligndata	%f6, %f8, %f22
+
+	ldd		[%o1 + 0x030], %f12
+	faligndata	%f8, %f10, %f24
+	ldd		[%o1 + 0x038], %f14
+	faligndata	%f10, %f12, %f26
+	ldd		[%o1 + 0x040], %f0
+
+	sub		%o4, 0x80, %o4
+	add		%o1, 0x40, %o1
+	ba,pt		%xcc, 1f
+	 srl		%o4, 6, %o3
+
+	.align		64
+1:
+	ldd		[%o1 + 0x008], %f2
+	faligndata	%f12, %f14, %f28
+	ldd		[%o1 + 0x010], %f4
+	faligndata	%f14, %f0, %f30
+	stda		%f16, [%o0] ASI_BLK_P
+	ldd		[%o1 + 0x018], %f6
+	faligndata	%f0, %f2, %f16
+
+	ldd		[%o1 + 0x020], %f8
+	faligndata	%f2, %f4, %f18
+	ldd		[%o1 + 0x028], %f10
+	faligndata	%f4, %f6, %f20
+	ldd		[%o1 + 0x030], %f12
+	faligndata	%f6, %f8, %f22
+	ldd		[%o1 + 0x038], %f14
+	faligndata	%f8, %f10, %f24
+
+	ldd		[%o1 + 0x040], %f0
+	prefetch	[%o1 + 0x180], #one_read
+	faligndata	%f10, %f12, %f26
+	subcc		%o3, 0x01, %o3
+	add		%o1, 0x40, %o1
+	bg,pt		%XCC, 1b
+	 add		%o0, 0x40, %o0
 
 	/* Finally we copy the last full 64-byte block. */
-U3memcpy_loopfini:
-	ldd		[%o1 + 0x008], %f2		! MS
-	faligndata	%f12, %f14, %f28		! FGA
-	ldd		[%o1 + 0x010], %f4		! MS	Group19
-	faligndata	%f14, %f0, %f30			! FGA
-	stda		%f16, [%o0] ASI_BLK_P		! MS	Group20
-	ldd		[%o1 + 0x018], %f6		! AX
-	faligndata	%f0, %f2, %f16			! FGA	Group11 (7-cycle stall)
-	ldd		[%o1 + 0x020], %f8		! MS
-	faligndata	%f2, %f4, %f18			! FGA	Group12
-	ldd		[%o1 + 0x028], %f10		! MS
-	faligndata	%f4, %f6, %f20			! FGA	Group13
-	ldd		[%o1 + 0x030], %f12		! MS
-	faligndata	%f6, %f8, %f22			! FGA	Group14
-	ldd		[%o1 + 0x038], %f14		! MS
-	faligndata	%f8, %f10, %f24			! FGA	Group15
-	cmp		%g1, 0				! A0
-	be,pt		%icc, 1f			! BR
-	 add		%o0, 0x40, %o0			! A1
-	ldd		[%o1 + 0x040], %f0		! MS
-1:	faligndata	%f10, %f12, %f26		! FGA	Group16
-	faligndata	%f12, %f14, %f28		! FGA	Group17
-	faligndata	%f14, %f0, %f30			! FGA	Group18
-	stda		%f16, [%o0] ASI_BLK_P		! MS
-	add		%o0, 0x40, %o0			! A0
-	add		%o1, 0x40, %o1			! A1
-#ifdef __KERNEL__
-	.globl		U3memcpy_nop_2_3
-U3memcpy_nop_2_3:
-	mov		PRIMARY_CONTEXT, %o3
-	stxa		%g0, [%o3] ASI_DMMU		! Flush P-cache
-	stxa		%g3, [%g0] ASI_DCU_CONTROL_REG	! Disable P-cache
-#endif
-	membar		#Sync				! MS	Group26 (7-cycle stall)
+	ldd		[%o1 + 0x008], %f2
+	faligndata	%f12, %f14, %f28
+	ldd		[%o1 + 0x010], %f4
+	faligndata	%f14, %f0, %f30
+	stda		%f16, [%o0] ASI_BLK_P
+	ldd		[%o1 + 0x018], %f6
+	faligndata	%f0, %f2, %f16
+	ldd		[%o1 + 0x020], %f8
+	faligndata	%f2, %f4, %f18
+	ldd		[%o1 + 0x028], %f10
+	faligndata	%f4, %f6, %f20
+	ldd		[%o1 + 0x030], %f12
+	faligndata	%f6, %f8, %f22
+	ldd		[%o1 + 0x038], %f14
+	faligndata	%f8, %f10, %f24
+	cmp		%g1, 0
+	be,pt		%XCC, 1f
+	 add		%o0, 0x40, %o0
+	ldd		[%o1 + 0x040], %f0
+1:	faligndata	%f10, %f12, %f26
+	faligndata	%f12, %f14, %f28
+	faligndata	%f14, %f0, %f30
+	stda		%f16, [%o0] ASI_BLK_P
+	add		%o0, 0x40, %o0
+	add		%o1, 0x40, %o1
+	membar		#Sync
 
 	/* Now we copy the (len modulo 64) bytes at the end.
 	 * Note how we borrow the %f0 loaded above.
 	 *
 	 * Also notice how this code is careful not to perform a
-	 * load past the end of the src buffer just like similar
-	 * code found in U3memcpy_toosmall processing.
+	 * load past the end of the src buffer.
 	 */
-U3memcpy_loopend:
-	and		%o2, 0x3f, %o2			! A0	Group
-	andcc		%o2, 0x38, %g2			! A0	Group
-	be,pn		%icc, U3memcpy_endcruft		! BR
-	 subcc		%g2, 0x8, %g2			! A1
-	be,pn		%icc, U3memcpy_endcruft		! BR	Group
-	 cmp		%g1, 0				! A0
-
-	be,a,pt		%icc, 1f			! BR	Group
-	 ldd		[%o1 + 0x00], %f0		! MS
-
-1:	ldd		[%o1 + 0x08], %f2		! MS	Group
-	add		%o1, 0x8, %o1			! A0
-	sub		%o2, 0x8, %o2			! A1
-	subcc		%g2, 0x8, %g2			! A0	Group
-	faligndata	%f0, %f2, %f8			! FGA	Group
-	std		%f8, [%o0 + 0x00]		! MS	(XXX does it stall here? XXX)
-	be,pn		%icc, U3memcpy_endcruft		! BR
-	 add		%o0, 0x8, %o0			! A0
-	ldd		[%o1 + 0x08], %f0		! MS	Group
-	add		%o1, 0x8, %o1			! A0
-	sub		%o2, 0x8, %o2			! A1
-	subcc		%g2, 0x8, %g2			! A0	Group
-	faligndata	%f2, %f0, %f8			! FGA
-	std		%f8, [%o0 + 0x00]		! MS	(XXX does it stall here? XXX)
-	bne,pn		%icc, 1b			! BR
-	 add		%o0, 0x8, %o0			! A0	Group
+	and		%o2, 0x3f, %o2
+	andcc		%o2, 0x38, %g2
+	be,pn		%XCC, 2f
+	 subcc		%g2, 0x8, %g2
+	be,pn		%XCC, 2f
+	 cmp		%g1, 0
+
+	be,a,pt		%XCC, 1f
+	 ldd		[%o1 + 0x00], %f0
+
+1:	ldd		[%o1 + 0x08], %f2
+	add		%o1, 0x8, %o1
+	sub		%o2, 0x8, %o2
+	subcc		%g2, 0x8, %g2
+	faligndata	%f0, %f2, %f8
+	std		%f8, [%o0 + 0x00]
+	be,pn		%XCC, 2f
+	 add		%o0, 0x8, %o0
+	ldd		[%o1 + 0x08], %f0
+	add		%o1, 0x8, %o1
+	sub		%o2, 0x8, %o2
+	subcc		%g2, 0x8, %g2
+	faligndata	%f2, %f0, %f8
+	std		%f8, [%o0 + 0x00]
+	bne,pn		%XCC, 1b
+	 add		%o0, 0x8, %o0
 
 	/* If anything is left, we copy it one byte at a time.
 	 * Note that %g1 is (src & 0x3) saved above before the
 	 * alignaddr was performed.
 	 */
-U3memcpy_endcruft:
+2:
 	cmp		%o2, 0
 	add		%o1, %g1, %o1
 	VISExitHalf
-	be,pn		%icc, U3memcpy_short_ret
-	 nop
-	ba,a,pt		%xcc, U3memcpy_short
+	be,pn		%XCC, 85f
+	 sub		%o0, %o1, %o3
 
-	/* If we get here, then 32 <= len < (6 * 64) */
-U3memcpy_toosmall:
+	andcc		%g1, 0x7, %g0
+	bne,pn		%icc, 90f
+	 andcc		%o2, 0x8, %g0
+	be,pt		%icc, 1f
+	 nop
+	ldx		[%o1], %o5
+	stx		%o5, [%o1 + %o3]
+	add		%o1, 0x8, %o1
 
-#ifdef SMALL_COPY_USES_FPU
+1:	andcc		%o2, 0x4, %g0
+	be,pt		%icc, 1f
+	 nop
+	lduw		[%o1], %o5
+	stw		%o5, [%o1 + %o3]
+	add		%o1, 0x4, %o1
 
-	/* Is 'dst' already aligned on an 8-byte boundary? */
-	be,pt		%xcc, 2f			! BR	Group
+1:	andcc		%o2, 0x2, %g0
+	be,pt		%icc, 1f
+	 nop
+	lduh		[%o1], %o5
+	sth		%o5, [%o1 + %o3]
+	add		%o1, 0x2, %o1
 
-	/* Compute abs((dst & 7) - 8) into %g2.  This is the number
-	 * of bytes to copy to make 'dst' 8-byte aligned.  We pre-
-	 * subtract this from 'len'.
-	 */
-	 sub		%g2, 0x8, %g2			! A0
-	sub		%g0, %g2, %g2			! A0	Group (reg-dep)
-	sub		%o2, %g2, %o2			! A0	Group (reg-dep)
+1:	andcc		%o2, 0x1, %g0
+	be,pt		%icc, 85f
+	 nop
+	ldub		[%o1], %o5
+	ba,pt		%xcc, 85f
+	 stb		%o5, [%o1 + %o3]
+
+70: /* 16 < len <= 64 */
+	bne,pn		%XCC, 90f
+	 sub		%o0, %o1, %o3
+
+	andn		%o2, 0x7, %o4
+	and		%o2, 0x7, %o2
+1:	subcc		%o4, 0x8, %o4
+	ldx		[%o1], %o5
+	stx		%o5, [%o1 + %o3]
+	bgu,pt		%XCC, 1b
+	 add		%o1, 0x8, %o1
+	andcc		%o2, 0x4, %g0
+	be,pt		%XCC, 1f
+	 nop
+	sub		%o2, 0x4, %o2
+	lduw		[%o1], %o5
+	stw		%o5, [%o1 + %o3]
+	add		%o1, 0x4, %o1
+1:	cmp		%o2, 0
+	be,pt		%XCC, 85f
+	 nop
+	ba,pt		%xcc, 90f
+	 nop
 
-	/* Copy %g2 bytes from src to dst, one byte at a time. */
-1:	ldub		[%o1 + 0x00], %o3		! MS	(Group) (%o3 in 3 cycles)
-	add		%o1, 0x1, %o1			! A1
-	add		%o0, 0x1, %o0			! A0	Group
-	subcc		%g2, 0x1, %g2			! A1
+80: /* 0 < len <= 16 */
+	andcc		%o3, 0x3, %g0
+	bne,pn		%XCC, 90f
+	 sub		%o0, %o1, %o3
 
-	bg,pt		%icc, 1b			! BR	Group
-	 stb		%o3, [%o0 + -1]			! MS	Group
+1:
+	subcc		%o2, 4, %o2
+	lduw		[%o1], %g1
+	stw		%g1, [%o1 + %o3]
+	bgu,pt		%XCC, 1b
+	 add		%o1, 4, %o1
 
-2:	VISEntryHalf					! MS+MS
+85:	retl
+	 mov		%g5, %o0
 
-	/* Compute (len - (len % 8)) into %g2.  This is guaranteed
-	 * to be nonzero.
-	 */
-	andn		%o2, 0x7, %g2			! A0	Group
-
-	/* You may read this and believe that it allows reading
-	 * one 8-byte longword past the end of src.  It actually
-	 * does not, as %g2 is subtracted as loads are done from
-	 * src, so we always stop before running off the end.
-	 * Also, we are guaranteed to have at least 0x10 bytes
-	 * to move here.
+	.align	32
+90:
+	subcc		%o2, 1, %o2
+	ldub		[%o1], %g1
+	stb		%g1, [%o1 + %o3]
+	bgu,pt		%XCC, 90b
+	 add		%o1, 1, %o1
+	retl
+	 mov		%g5, %o0
+
+	/* Act like copy_{to,in}_user(), ie. return zero instead
+	 * of original destination pointer.  This is invoked when
+	 * copy_{to,in}_user() finds that %asi is kernel space.
 	 */
-	sub		%g2, 0x8, %g2			! A0	Group (reg-dep)
-	alignaddr	%o1, %g0, %g1			! MS	      (Break-after)
-	ldd		[%g1 + 0x00], %f0		! MS	Group (1-cycle stall)
-	add		%g1, 0x8, %g1			! A0
-
-1:	ldd		[%g1 + 0x00], %f2		! MS	Group
-	add		%g1, 0x8, %g1			! A0
-	sub		%o2, 0x8, %o2			! A1
-	subcc		%g2, 0x8, %g2			! A0	Group
-
-	faligndata	%f0, %f2, %f8			! FGA	Group (1-cycle stall)
-	std		%f8, [%o0 + 0x00]		! MS	Group (2-cycle stall)
-	add		%o1, 0x8, %o1			! A0
-	be,pn		%icc, 2f			! BR
-
-	 add		%o0, 0x8, %o0			! A1
-	ldd		[%g1 + 0x00], %f0		! MS	Group
-	add		%g1, 0x8, %g1			! A0
-	sub		%o2, 0x8, %o2			! A1
-
-	subcc		%g2, 0x8, %g2			! A0	Group
-	faligndata	%f2, %f0, %f8			! FGA	Group (1-cycle stall)
-	std		%f8, [%o0 + 0x00]		! MS	Group (2-cycle stall)
-	add		%o1, 0x8, %o1			! A0
-
-	bne,pn		%icc, 1b			! BR
-	 add		%o0, 0x8, %o0			! A1
-
-	/* Nothing left to copy? */
-2:	cmp		%o2, 0				! A0	Group
-	VISExitHalf					! A0+MS
-	be,pn		%icc, U3memcpy_short_ret	! BR	Group
-	 nop						! A0
-	ba,a,pt		%xcc, U3memcpy_short		! BR	Group
-
-#else /* !(SMALL_COPY_USES_FPU) */
-
-	xor		%o1, %o0, %g2
-	andcc		%g2, 0x7, %g0
-	bne,pn		%icc, U3memcpy_short
-	 andcc		%o1, 0x7, %g2
-
-	be,pt		%xcc, 2f
-	 sub		%g2, 0x8, %g2
-	sub		%g0, %g2, %g2
-	sub		%o2, %g2, %o2
-
-1:	ldub		[%o1 + 0x00], %o3
-	add		%o1, 0x1, %o1
-	add		%o0, 0x1, %o0
-	subcc		%g2, 0x1, %g2
-	bg,pt		%icc, 1b
-	 stb		%o3, [%o0 + -1]
-
-2:	andn		%o2, 0x7, %g2
-	sub		%o2, %g2, %o2
-
-3:	ldx		[%o1 + 0x00], %o3
-	add		%o1, 0x8, %o1
-	add		%o0, 0x8, %o0
-	subcc		%g2, 0x8, %g2
-	bg,pt		%icc, 3b
-	 stx		%o3, [%o0 + -8]
-
-	cmp		%o2, 0
-	bne,pn		%icc, U3memcpy_short
-	 nop
-	ba,a,pt		%xcc, U3memcpy_short_ret
-
-#endif /* !(SMALL_COPY_USES_FPU) */
+	.globl	U3memcpy_user_stub
+U3memcpy_user_stub:
+	save		%sp, -192, %sp
+	mov		%i0, %o0
+	mov		%i1, %o1
+	call		U3memcpy
+	 mov		%i2, %o2
+	ret
+	 restore	%g0, %g0, %o0
diff --git a/arch/sparc64/lib/VISbzero.S b/arch/sparc64/lib/VISbzero.S
index c8713995c..06b697bab 100644
--- a/arch/sparc64/lib/VISbzero.S
+++ b/arch/sparc64/lib/VISbzero.S
@@ -83,8 +83,6 @@
 	.text
 	.align		32
 #ifdef __KERNEL__
-	.globl		__bzero_begin
-__bzero_begin:
 	.globl		__bzero, __bzero_noasi
 __bzero_noasi:
 	rd		%asi, %g5
@@ -274,5 +272,3 @@ VISbzerofixup_zb:
 	ba,pt		%xcc, VISbzerofixup_ret0
 	 sub		%o1, %g2, %o0
 #endif
-	.globl		__bzero_end
-__bzero_end:
diff --git a/arch/sparc64/lib/VIScopy.S b/arch/sparc64/lib/VIScopy.S
index f02f8eec7..2c90b2566 100644
--- a/arch/sparc64/lib/VIScopy.S
+++ b/arch/sparc64/lib/VIScopy.S
@@ -303,14 +303,7 @@
 		.type			bcopy,@function
 
 #ifdef __KERNEL__
-		.globl			__memcpy_begin
-__memcpy_begin:
-
-		.globl			__memcpy
-		.type			__memcpy,@function
-
 memcpy_private:
-__memcpy:
 memcpy:		mov		ASI_P, asi_src			! IEU0	Group
 		brnz,pt		%o2, __memcpy_entry		! CTI
 		 mov		ASI_P, asi_dest			! IEU1
@@ -367,28 +360,6 @@ bcopy:		or		%o0, 0, %g3			! IEU0	Group
 	or	%g3, %lo(NOP), %g3; \
 	stw	%g3, [%g2 + 0x4]; \
 	flush	%g2;
-#define ULTRA3_PCACHE_DO_NOP(symbol)	\
-	sethi	%hi(symbol##_nop_1_6), %g1; \
-	or	%g1, %lo(symbol##_nop_1_6), %g1; \
-	sethi	%hi(NOP), %g2; \
-	stw	%g2, [%g1 + 0x00]; \
-	stw	%g2, [%g1 + 0x04]; \
-	flush	%g1 + 0x00; \
-	stw	%g2, [%g1 + 0x08]; \
-	stw	%g2, [%g1 + 0x0c]; \
-	flush	%g1 + 0x08; \
-	stw	%g2, [%g1 + 0x10]; \
-	stw	%g2, [%g1 + 0x04]; \
-	flush	%g1 + 0x10; \
-	sethi	%hi(symbol##_nop_2_3), %g1; \
-	or	%g1, %lo(symbol##_nop_2_3), %g1; \
-	stw	%g2, [%g1 + 0x00]; \
-	stw	%g2, [%g1 + 0x04]; \
-	flush	%g1 + 0x00; \
-	stw	%g2, [%g1 + 0x08]; \
-	flush	%g1 + 0x08;
-
-#include <asm/dcu.h>
 
 	.globl	cheetah_patch_copyops
 cheetah_patch_copyops:
@@ -396,23 +367,6 @@ cheetah_patch_copyops:
 	ULTRA3_DO_PATCH(__copy_from_user, U3copy_from_user)
 	ULTRA3_DO_PATCH(__copy_to_user, U3copy_to_user)
 	ULTRA3_DO_PATCH(__copy_in_user, U3copy_in_user)
-#if 0 /* Causes data corruption, nop out the optimization
-       * for now -DaveM
-       */
-	ldxa			[%g0] ASI_DCU_CONTROL_REG, %g3
-	sethi			%uhi(DCU_PE), %o3
-	sllx			%o3, 32, %o3
-	andcc			%g3, %o3, %g0
-	be,pn			%xcc, pcache_disabled
-	 nop
-#endif
-	ULTRA3_PCACHE_DO_NOP(U3memcpy)
-	ULTRA3_PCACHE_DO_NOP(U3copy_from_user)
-	ULTRA3_PCACHE_DO_NOP(U3copy_to_user)
-	ULTRA3_PCACHE_DO_NOP(cheetah_copy_user_page)
-#if 0
-pcache_disabled:
-#endif
 	retl
 	 nop
 #undef BRANCH_ALWAYS
@@ -1059,9 +1013,6 @@ fpu_retl:
 	FPU_RETL
 
 #ifdef __KERNEL__
-	.globl		__memcpy_end
-__memcpy_end:
-
 		.section	.fixup
 		.align		4
 VIScopyfixup_reto2:
diff --git a/arch/sparc64/lib/atomic.S b/arch/sparc64/lib/atomic.S
index 13d68fd64..a0d6d8ac3 100644
--- a/arch/sparc64/lib/atomic.S
+++ b/arch/sparc64/lib/atomic.S
@@ -9,10 +9,7 @@
 	.text
 	.align	64
 
-	.globl	atomic_impl_begin, atomic_impl_end
-
 	.globl	__atomic_add
-atomic_impl_begin:
 __atomic_add: /* %o0 = increment, %o1 = atomic_ptr */
 	lduw	[%o1], %g5
 	add	%g5, %o0, %g7
@@ -56,4 +53,3 @@ __atomic64_sub: /* %o0 = increment, %o1 = atomic_ptr */
 	retl
 	 sub	%g7, %o0, %o0
 
-atomic_impl_end:
diff --git a/arch/sparc64/lib/bitops.S b/arch/sparc64/lib/bitops.S
index fa8558237..0c2aacc83 100644
--- a/arch/sparc64/lib/bitops.S
+++ b/arch/sparc64/lib/bitops.S
@@ -8,9 +8,6 @@
 
 	.text
 	.align	64
-	.globl	__bitops_begin
-__bitops_begin:
-
 	.globl	___test_and_set_bit
 ___test_and_set_bit:	/* %o0=nr, %o1=addr */
 	srlx	%o0, 6, %g1
@@ -105,6 +102,3 @@ ___test_and_clear_le_bit:	/* %o0=nr, %o1=addr */
 	 lduwa	[%o1] ASI_PL, %g7
 2:	retl
 	 membar	#StoreLoad | #StoreStore
-
-	.globl	__bitops_end
-__bitops_end:
diff --git a/arch/sparc64/lib/find_bit.c b/arch/sparc64/lib/find_bit.c
index 420dfbafd..585261449 100644
--- a/arch/sparc64/lib/find_bit.c
+++ b/arch/sparc64/lib/find_bit.c
@@ -6,9 +6,10 @@
  * @offset: The bitnumber to start searching at
  * @size: The maximum size to search
  */
-unsigned long find_next_bit(unsigned long *addr, unsigned long size, unsigned long offset)
+unsigned long find_next_bit(const unsigned long *addr, unsigned long size,
+				unsigned long offset)
 {
-	unsigned long *p = addr + (offset >> 6);
+	const unsigned long *p = addr + (offset >> 6);
 	unsigned long result = offset & ~63UL;
 	unsigned long tmp;
 
diff --git a/arch/sparc64/lib/rwlock.S b/arch/sparc64/lib/rwlock.S
index ffbf75bc3..8d8ecece2 100644
--- a/arch/sparc64/lib/rwlock.S
+++ b/arch/sparc64/lib/rwlock.S
@@ -7,12 +7,9 @@
 	.text
 	.align	64
 
-	.globl	rwlock_impl_begin, rwlock_impl_end
-
 	/* The non-contention read lock usage is 2 cache lines. */
 
 	.globl	__read_lock, __read_unlock
-rwlock_impl_begin:
 __read_lock: /* %o0 = lock_ptr */
 	ldsw		[%o0], %g5
 	brlz,pn		%g5, __read_wait_for_writer
@@ -85,5 +82,4 @@ __write_trylock_succeed:
 __write_trylock_fail:
 	retl
 	 mov		0, %o0
-rwlock_impl_end:
 
diff --git a/arch/sparc64/lib/splock.S b/arch/sparc64/lib/splock.S
index d17a3badd..e466ed225 100644
--- a/arch/sparc64/lib/splock.S
+++ b/arch/sparc64/lib/splock.S
@@ -6,6 +6,18 @@
 	.text
 	.align	64
 
+	.globl		_raw_spin_lock
+_raw_spin_lock:		/* %o0 = lock_ptr */
+1:	ldstub		[%o0], %g7
+	brnz,pn		%g7, 2f
+	 membar		#StoreLoad | #StoreStore
+	retl
+	 nop
+2:	ldub		[%o0], %g7
+	brnz,pt		%g7, 2b
+	 membar		#LoadLoad
+	ba,a,pt		%xcc, 1b
+
 	.globl	_raw_spin_lock_flags
 _raw_spin_lock_flags:	/* %o0 = lock_ptr, %o1 = irq_flags */
 1:	ldstub		[%o0], %g7
diff --git a/arch/sparc64/mm/Makefile b/arch/sparc64/mm/Makefile
index fb85e5a2a..cda87333a 100644
--- a/arch/sparc64/mm/Makefile
+++ b/arch/sparc64/mm/Makefile
@@ -5,6 +5,6 @@
 EXTRA_AFLAGS := -ansi
 EXTRA_CFLAGS := -Werror
 
-obj-y    := ultra.o fault.o init.o generic.o extable.o
+obj-y    := ultra.o tlb.o fault.o init.o generic.o extable.o
 
 obj-$(CONFIG_HUGETLB_PAGE) += hugetlbpage.o
diff --git a/arch/sparc64/mm/fault.c b/arch/sparc64/mm/fault.c
index 5fc4644aa..49c3dd29a 100644
--- a/arch/sparc64/mm/fault.c
+++ b/arch/sparc64/mm/fault.c
@@ -218,9 +218,9 @@ static void do_fault_siginfo(int code, int sig, struct pt_regs *regs,
 	info.si_signo = sig;
 	info.si_errno = 0;
 	if (fault_code & FAULT_CODE_ITLB)
-		info.si_addr = (void *) regs->tpc;
+		info.si_addr = (void __user *) regs->tpc;
 	else
-		info.si_addr = (void *)
+		info.si_addr = (void __user *)
 			compute_effective_address(regs, insn, 0);
 	info.si_trapno = 0;
 	force_sig_info(sig, &info, current);
@@ -257,7 +257,7 @@ static void do_kernel_fault(struct pt_regs *regs, int si_code, int fault_code,
 	 * in that case.
 	 */
 
-	if (!(fault_code & FAULT_CODE_WRITE) &&
+	if (!(fault_code & (FAULT_CODE_WRITE|FAULT_CODE_ITLB)) &&
 	    (insn & 0xc0800000) == 0xc0800000) {
 		if (insn & 0x2000)
 			asi = (regs->tstate >> 24);
@@ -408,6 +408,16 @@ continue_fault:
 	 */
 good_area:
 	si_code = SEGV_ACCERR;
+
+	/* If we took a ITLB miss on a non-executable page, catch
+	 * that here.
+	 */
+	if ((fault_code & FAULT_CODE_ITLB) && !(vma->vm_flags & VM_EXEC)) {
+		BUG_ON(address != regs->tpc);
+		BUG_ON(regs->tstate & TSTATE_PRIV);
+		goto bad_area;
+	}
+
 	if (fault_code & FAULT_CODE_WRITE) {
 		if (!(vma->vm_flags & VM_WRITE))
 			goto bad_area;
@@ -418,7 +428,8 @@ good_area:
 		if (tlb_type == spitfire &&
 		    (vma->vm_flags & VM_EXEC) != 0 &&
 		    vma->vm_file != NULL)
-			set_thread_flag(TIF_BLKCOMMIT);
+			set_thread_fault_code(fault_code |
+					      FAULT_CODE_BLKCOMMIT);
 	} else {
 		/* Allow reads even for write-only mappings */
 		if (!(vma->vm_flags & (VM_READ | VM_EXEC)))
@@ -487,6 +498,5 @@ do_sigbus:
 fault_done:
 	/* These values are no longer needed, clear them. */
 	set_thread_fault_code(0);
-	clear_thread_flag(TIF_BLKCOMMIT);
 	current_thread_info()->fault_address = 0;
 }
diff --git a/arch/sparc64/mm/init.c b/arch/sparc64/mm/init.c
index 043861f31..60308cead 100644
--- a/arch/sparc64/mm/init.c
+++ b/arch/sparc64/mm/init.c
@@ -37,8 +37,6 @@
 #include <asm/spitfire.h>
 #include <asm/sections.h>
 
-DEFINE_PER_CPU(struct mmu_gather, mmu_gathers);
-
 extern void device_scan(void);
 
 struct sparc_phys_banks sp_banks[SPARC_PHYS_BANKS];
@@ -137,13 +135,13 @@ __inline__ void flush_dcache_page_impl(struct page *page)
 #endif
 
 #if (L1DCACHE_SIZE > PAGE_SIZE)
-	__flush_dcache_page(page->virtual,
+	__flush_dcache_page(page_address(page),
 			    ((tlb_type == spitfire) &&
 			     page_mapping(page) != NULL));
 #else
 	if (page_mapping(page) != NULL &&
 	    tlb_type == spitfire)
-		__flush_icache_page(__pa(page->virtual));
+		__flush_icache_page(__pa(page_address(page)));
 #endif
 }
 
@@ -252,87 +250,6 @@ out:
 	put_cpu();
 }
 
-/* When shared+writable mmaps of files go away, we lose all dirty
- * page state, so we have to deal with D-cache aliasing here.
- *
- * This code relies on the fact that flush_cache_range() is always
- * called for an area composed by a single VMA.  It also assumes that
- * the MM's page_table_lock is held.
- */
-static inline void flush_cache_pte_range(struct mm_struct *mm, pmd_t *pmd, unsigned long address, unsigned long size)
-{
-	unsigned long offset;
-	pte_t *ptep;
-
-	if (pmd_none(*pmd))
-		return;
-	ptep = pte_offset_map(pmd, address);
-	offset = address & ~PMD_MASK;
-	if (offset + size > PMD_SIZE)
-		size = PMD_SIZE - offset;
-	size &= PAGE_MASK;
-	for (offset = 0; offset < size; ptep++, offset += PAGE_SIZE) {
-		pte_t pte = *ptep;
-
-		if (pte_none(pte))
-			continue;
-
-		if (pte_present(pte) && pte_dirty(pte)) {
-			struct page *page;
-			unsigned long pgaddr, uaddr;
-			unsigned long pfn = pte_pfn(pte);
-
-			if (!pfn_valid(pfn))
-				continue;
-			page = pfn_to_page(pfn);
-			if (PageReserved(page) || !page_mapping(page))
-				continue;
-			pgaddr = (unsigned long) page_address(page);
-			uaddr = address + offset;
-			if ((pgaddr ^ uaddr) & (1 << 13))
-				flush_dcache_page_all(mm, page);
-		}
-	}
-	pte_unmap(ptep - 1);
-}
-
-static inline void flush_cache_pmd_range(struct mm_struct *mm, pgd_t *dir, unsigned long address, unsigned long size)
-{
-	pmd_t *pmd;
-	unsigned long end;
-
-	if (pgd_none(*dir))
-		return;
-	pmd = pmd_offset(dir, address);
-	end = address + size;
-	if (end > ((address + PGDIR_SIZE) & PGDIR_MASK))
-		end = ((address + PGDIR_SIZE) & PGDIR_MASK);
-	do {
-		flush_cache_pte_range(mm, pmd, address, end - address);
-		address = (address + PMD_SIZE) & PMD_MASK;
-		pmd++;
-	} while (address < end);
-}
-
-void flush_cache_range(struct vm_area_struct *vma, unsigned long start, unsigned long end)
-{
-	struct mm_struct *mm = vma->vm_mm;
-	pgd_t *dir = pgd_offset(mm, start);
-
-	if (mm == current->mm)
-		flushw_user();
-
-	if (vma->vm_file == NULL ||
-	    ((vma->vm_flags & (VM_SHARED|VM_WRITE)) != (VM_SHARED|VM_WRITE)))
-		return;
-
-	do {
-		flush_cache_pmd_range(mm, dir, start, end - start);
-		start = (start + PGDIR_SIZE) & PGDIR_MASK;
-		dir++;
-	} while (start && (start < end));
-}
-
 void flush_icache_range(unsigned long start, unsigned long end)
 {
 	/* Cheetah has coherent I-cache. */
@@ -344,11 +261,21 @@ void flush_icache_range(unsigned long start, unsigned long end)
 	}
 }
 
+unsigned long page_to_pfn(struct page *page)
+{
+	return (unsigned long) ((page - mem_map) + pfn_base);
+}
+
+struct page *pfn_to_page(unsigned long pfn)
+{
+	return (mem_map + (pfn - pfn_base));
+}
+
 void show_mem(void)
 {
 	printk("Mem-info:\n");
 	show_free_areas();
-	printk("Free swap:       %6dkB\n",
+	printk("Free swap:       %6ldkB\n",
 	       nr_swap_pages << (PAGE_SHIFT-10));
 	printk("%ld pages of RAM\n", num_physpages);
 	printk("%d free pages\n", nr_free_pages());
@@ -1163,7 +1090,7 @@ struct pgtable_cache_struct pgt_quicklists;
 #else
 #define DC_ALIAS_SHIFT	0
 #endif
-pte_t *pte_alloc_one_kernel(struct mm_struct *mm, unsigned long address)
+pte_t *__pte_alloc_one_kernel(struct mm_struct *mm, unsigned long address)
 {
 	struct page *page;
 	unsigned long color;
diff --git a/arch/sparc64/mm/ultra.S b/arch/sparc64/mm/ultra.S
index 16410ba95..af8205edf 100644
--- a/arch/sparc64/mm/ultra.S
+++ b/arch/sparc64/mm/ultra.S
@@ -26,25 +26,7 @@
 	 */
 	.text
 	.align		32
-	.globl		__flush_tlb_page, __flush_tlb_mm, __flush_tlb_range
-__flush_tlb_page: /* %o0=(ctx & TAG_CONTEXT_BITS), %o1=page&PAGE_MASK, %o2=SECONDARY_CONTEXT */
-	ldxa		[%o2] ASI_DMMU, %g2
-	cmp		%g2, %o0
-	bne,pn		%icc, __spitfire_flush_tlb_page_slow
-	 or		%o1, 0x10, %g3
-	stxa		%g0, [%g3] ASI_DMMU_DEMAP
-	stxa		%g0, [%g3] ASI_IMMU_DEMAP
-	retl
-	 flush		%g6
-	nop
-	nop
-	nop
-	nop
-	nop
-	nop
-	nop
-	nop
-
+	.globl		__flush_tlb_mm
 __flush_tlb_mm: /* %o0=(ctx & TAG_CONTEXT_BITS), %o1=SECONDARY_CONTEXT */
 	ldxa		[%o1] ASI_DMMU, %g2
 	cmp		%g2, %o0
@@ -63,84 +45,32 @@ __flush_tlb_mm: /* %o0=(ctx & TAG_CONTEXT_BITS), %o1=SECONDARY_CONTEXT */
 	nop
 	nop
 
-__flush_tlb_range: /* %o0=(ctx&TAG_CONTEXT_BITS), %o1=start&PAGE_MASK, %o2=SECONDARY_CONTEXT,
-		    * %o3=end&PAGE_MASK, %o4=PAGE_SIZE, %o5=(end - start)
-		    */
-#define TLB_MAGIC	207 /* Students, do you know how I calculated this?  -DaveM */
-	cmp		%o5, %o4
-	bleu,pt		%xcc, __flush_tlb_page
-	 srlx		%o5, PAGE_SHIFT, %g5
-	cmp		%g5, TLB_MAGIC
-	bgeu,pn		%icc, __spitfire_flush_tlb_range_constant_time
-	 or		%o1, 0x10, %g5
-	ldxa		[%o2] ASI_DMMU, %g2
-	cmp		%g2, %o0
-__spitfire_flush_tlb_range_page_by_page:
-	bne,pn		%icc, __spitfire_flush_tlb_range_pbp_slow
-	 sub		%o5, %o4, %o5
-1:	stxa		%g0, [%g5 + %o5] ASI_DMMU_DEMAP
-	stxa		%g0, [%g5 + %o5] ASI_IMMU_DEMAP
-	brnz,pt		%o5, 1b
-	 sub		%o5, %o4, %o5
-	retl
-	 flush		%g6
-__spitfire_flush_tlb_range_constant_time: /* %o0=ctx, %o1=start, %o3=end */
-	rdpr		%pstate, %g1
-	wrpr		%g1, PSTATE_IE, %pstate
-	mov		TLB_TAG_ACCESS, %g3
-	mov		((SPITFIRE_HIGHEST_LOCKED_TLBENT-1) << 3), %g2
-
-	/* Spitfire Errata #32 workaround. */
-	mov		0x8, %o4
-	stxa		%g0, [%o4] ASI_DMMU
-	flush		%g6
-
-1:	ldxa		[%g2] ASI_ITLB_TAG_READ, %o4
-	and		%o4, TAG_CONTEXT_BITS, %o5
-	cmp		%o5, %o0
-	bne,pt		%icc, 2f
-	 andn		%o4, TAG_CONTEXT_BITS, %o4
-	cmp		%o4, %o1
-	blu,pt		%xcc, 2f
-	 cmp		%o4, %o3
-	blu,pn		%xcc, 4f
-2:	 ldxa		[%g2] ASI_DTLB_TAG_READ, %o4
-	and		%o4, TAG_CONTEXT_BITS, %o5
-	cmp		%o5, %o0
-	andn		%o4, TAG_CONTEXT_BITS, %o4
-	bne,pt		%icc, 3f
-	 cmp		%o4, %o1
-	blu,pt		%xcc, 3f
-	 cmp		%o4, %o3
-	blu,pn		%xcc, 5f
-	 nop
-3:	brnz,pt		%g2, 1b
-	 sub		%g2, (1 << 3), %g2
-	retl
-	 wrpr		%g1, 0x0, %pstate
-4:	stxa		%g0, [%g3] ASI_IMMU
-	stxa		%g0, [%g2] ASI_ITLB_DATA_ACCESS
-	flush		%g6
-
-	/* Spitfire Errata #32 workaround. */
-	mov		0x8, %o4
-	stxa		%g0, [%o4] ASI_DMMU
-	flush		%g6
-
-	ba,pt		%xcc, 2b
+	.align		32
+	.globl		__flush_tlb_pending
+__flush_tlb_pending:
+	/* %o0 = context, %o1 = nr, %o2 = vaddrs[] */
+	rdpr		%pstate, %g5
+	sllx		%o1, 3, %o1
+	andn		%g5, PSTATE_IE, %g2
+	wrpr		%g2, %pstate
+	mov		SECONDARY_CONTEXT, %o4
+	ldxa		[%o4] ASI_DMMU, %g2
+	stxa		%o0, [%o4] ASI_DMMU
+1:	sub		%o1, (1 << 3), %o1
+	ldx		[%o2 + %o1], %o3
+	andcc		%o3, 1, %g0
+	andn		%o3, 1, %o3
+	be,pn		%icc, 2f
+	 or		%o3, 0x10, %o3
+	stxa		%g0, [%o3] ASI_IMMU_DEMAP
+2:	stxa		%g0, [%o3] ASI_DMMU_DEMAP
+	membar		#Sync
+	brnz,pt		%o1, 1b
 	 nop
-
-5:	stxa		%g0, [%g3] ASI_DMMU
-	stxa		%g0, [%g2] ASI_DTLB_DATA_ACCESS
+	stxa		%g2, [%o4] ASI_DMMU
 	flush		%g6
-
-	/* Spitfire Errata #32 workaround. */
-	mov		0x8, %o4
-	stxa		%g0, [%o4] ASI_DMMU
-	flush		%g6
-
-	ba,pt		%xcc, 3b
-	 nop
+	retl
+	 wrpr		%g5, 0x0, %pstate
 
 	.align		32
 	.globl		__flush_tlb_kernel_range
@@ -171,33 +101,6 @@ __spitfire_flush_tlb_mm_slow:
 	retl
 	 wrpr		%g1, 0, %pstate
 
-__spitfire_flush_tlb_page_slow:
-	rdpr		%pstate, %g1
-	wrpr		%g1, PSTATE_IE, %pstate
-	stxa		%o0, [%o2] ASI_DMMU
-	stxa		%g0, [%g3] ASI_DMMU_DEMAP
-	stxa		%g0, [%g3] ASI_IMMU_DEMAP
-	flush		%g6
-	stxa		%g2, [%o2] ASI_DMMU
-	flush		%g6
-	retl
-	 wrpr		%g1, 0, %pstate
-
-__spitfire_flush_tlb_range_pbp_slow:
-	rdpr		%pstate, %g1
-	wrpr		%g1, PSTATE_IE, %pstate
-	stxa		%o0, [%o2] ASI_DMMU
-
-2:	stxa		%g0, [%g5 + %o5] ASI_DMMU_DEMAP
-	stxa		%g0, [%g5 + %o5] ASI_IMMU_DEMAP
-	brnz,pt		%o5, 2b
-	 sub		%o5, %o4, %o5
-	flush		%g6
-	stxa		%g2, [%o2] ASI_DMMU
-	flush		%g6
-	retl
-	 wrpr		%g1, 0x0, %pstate
-
 /*
  * The following code flushes one page_size worth.
  */
@@ -356,22 +259,6 @@ __update_mmu_cache:	/* %o0=hw_context, %o1=address, %o2=pte, %o3=fault_code */
 	ba,a,pt		%xcc, __prefill_itlb
 
 	/* Cheetah specific versions, patched at boot time.  */
-__cheetah_flush_tlb_page: /* 14 insns */
-	rdpr		%pstate, %g5
-	andn		%g5, PSTATE_IE, %g2
-	wrpr		%g2, 0x0, %pstate
-	wrpr		%g0, 1, %tl
-	mov		PRIMARY_CONTEXT, %o2
-	ldxa		[%o2] ASI_DMMU, %g2
-	stxa		%o0, [%o2] ASI_DMMU
-	stxa		%g0, [%o1] ASI_DMMU_DEMAP
-	stxa		%g0, [%o1] ASI_IMMU_DEMAP
-	stxa		%g2, [%o2] ASI_DMMU
-	flush		%g6
-	wrpr		%g0, 0, %tl
-	retl
-	 wrpr		%g5, 0x0, %pstate
-
 __cheetah_flush_tlb_mm: /* 15 insns */
 	rdpr		%pstate, %g5
 	andn		%g5, PSTATE_IE, %g2
@@ -389,26 +276,29 @@ __cheetah_flush_tlb_mm: /* 15 insns */
 	retl
 	 wrpr		%g5, 0x0, %pstate
 
-__cheetah_flush_tlb_range: /* 20 insns */
-	cmp		%o5, %o4
-	blu,pt		%xcc, 9f
-	 rdpr		%pstate, %g5
+__cheetah_flush_tlb_pending:	/* 22 insns */
+	/* %o0 = context, %o1 = nr, %o2 = vaddrs[] */
+	rdpr		%pstate, %g5
+	sllx		%o1, 3, %o1
 	andn		%g5, PSTATE_IE, %g2
 	wrpr		%g2, 0x0, %pstate
 	wrpr		%g0, 1, %tl
-	mov		PRIMARY_CONTEXT, %o2
-	sub		%o5, %o4, %o5
-	ldxa		[%o2] ASI_DMMU, %g2
-	stxa		%o0, [%o2] ASI_DMMU
-1:	stxa		%g0, [%o1 + %o5] ASI_DMMU_DEMAP
-	stxa		%g0, [%o1 + %o5] ASI_IMMU_DEMAP
-	membar		#Sync
-	brnz,pt		%o5, 1b
-	 sub		%o5, %o4, %o5
-	stxa		%g2, [%o2] ASI_DMMU
+	mov		PRIMARY_CONTEXT, %o4
+	ldxa		[%o4] ASI_DMMU, %g2
+	stxa		%o0, [%o4] ASI_DMMU
+1:	sub		%o1, (1 << 3), %o1
+	ldx		[%o2 + %o1], %o3
+	andcc		%o3, 1, %g0
+	be,pn		%icc, 2f
+	 andn		%o3, 1, %o3
+	stxa		%g0, [%o3] ASI_IMMU_DEMAP
+2:	stxa		%g0, [%o3] ASI_DMMU_DEMAP	
+	brnz,pt		%o1, 1b
+	 membar		#Sync
+	stxa		%g2, [%o4] ASI_DMMU
 	flush		%g6
 	wrpr		%g0, 0, %tl
-9:	retl
+	retl
 	 wrpr		%g5, 0x0, %pstate
 
 flush_dcpage_cheetah: /* 11 insns */
@@ -439,13 +329,6 @@ cheetah_patch_one:
 cheetah_patch_cachetlbops:
 	save		%sp, -128, %sp
 
-	sethi		%hi(__flush_tlb_page), %o0
-	or		%o0, %lo(__flush_tlb_page), %o0
-	sethi		%hi(__cheetah_flush_tlb_page), %o1
-	or		%o1, %lo(__cheetah_flush_tlb_page), %o1
-	call		cheetah_patch_one
-	 mov		14, %o2
-
 	sethi		%hi(__flush_tlb_mm), %o0
 	or		%o0, %lo(__flush_tlb_mm), %o0
 	sethi		%hi(__cheetah_flush_tlb_mm), %o1
@@ -453,12 +336,12 @@ cheetah_patch_cachetlbops:
 	call		cheetah_patch_one
 	 mov		15, %o2
 
-	sethi		%hi(__flush_tlb_range), %o0
-	or		%o0, %lo(__flush_tlb_range), %o0
-	sethi		%hi(__cheetah_flush_tlb_range), %o1
-	or		%o1, %lo(__cheetah_flush_tlb_range), %o1
+	sethi		%hi(__flush_tlb_pending), %o0
+	or		%o0, %lo(__flush_tlb_pending), %o0
+	sethi		%hi(__cheetah_flush_tlb_pending), %o1
+	or		%o1, %lo(__cheetah_flush_tlb_pending), %o1
 	call		cheetah_patch_one
-	 mov		20, %o2
+	 mov		22, %o2
 
 	sethi		%hi(__flush_dcache_page), %o0
 	or		%o0, %lo(__flush_dcache_page), %o0
@@ -487,17 +370,7 @@ cheetah_patch_cachetlbops:
 	 * TODO: Make xcall TLB range flushes use the tricks above... -DaveM
 	 */
 	.align		32
-	.globl		xcall_flush_tlb_page, xcall_flush_tlb_mm, xcall_flush_tlb_range
-xcall_flush_tlb_page:
-	mov		PRIMARY_CONTEXT, %g2
-	ldxa		[%g2] ASI_DMMU, %g3
-	stxa		%g5, [%g2] ASI_DMMU
-	stxa		%g0, [%g1] ASI_DMMU_DEMAP
-	stxa		%g0, [%g1] ASI_IMMU_DEMAP
-	stxa		%g3, [%g2] ASI_DMMU
-	retry
-	nop
-
+	.globl		xcall_flush_tlb_mm
 xcall_flush_tlb_mm:
 	mov		PRIMARY_CONTEXT, %g2
 	mov		0x40, %g4
@@ -508,34 +381,26 @@ xcall_flush_tlb_mm:
 	stxa		%g3, [%g2] ASI_DMMU
 	retry
 
-xcall_flush_tlb_range:
-	sethi		%hi(PAGE_SIZE - 1), %g2
-	or		%g2, %lo(PAGE_SIZE - 1), %g2
-	andn		%g1, %g2, %g1
-	andn		%g7, %g2, %g7
-	sub		%g7, %g1, %g3
-	add		%g2, 1, %g2
-	srlx		%g3, PAGE_SHIFT, %g4
-	cmp		%g4, 96
-
-	bgu,pn		%icc, xcall_flush_tlb_mm
-	 mov		PRIMARY_CONTEXT, %g4
-	ldxa		[%g4] ASI_DMMU, %g7
-	sub		%g3, %g2, %g3
+	.globl		xcall_flush_tlb_pending
+xcall_flush_tlb_pending:
+	/* %g5=context, %g1=nr, %g7=vaddrs[] */
+	sllx		%g1, 3, %g1
+	mov		PRIMARY_CONTEXT, %g4
+	ldxa		[%g4] ASI_DMMU, %g2
 	stxa		%g5, [%g4] ASI_DMMU
-	nop
-	nop
-	nop
-
-1:	stxa		%g0, [%g1 + %g3] ASI_DMMU_DEMAP
-	stxa		%g0, [%g1 + %g3] ASI_IMMU_DEMAP
+1:	sub		%g1, (1 << 3), %g1
+	ldx		[%g7 + %g1], %g5
+	andcc		%g5, 0x1, %g0
+	be,pn		%icc, 2f
+
+	 andn		%g5, 0x1, %g5
+	stxa		%g0, [%g5] ASI_IMMU_DEMAP
+2:	stxa		%g0, [%g5] ASI_DMMU_DEMAP
 	membar		#Sync
-	brnz,pt		%g3, 1b
-	 sub		%g3, %g2, %g3
-	stxa		%g7, [%g4] ASI_DMMU
+	brnz,pt		%g1, 1b
+	 nop
+	stxa		%g2, [%g4] ASI_DMMU
 	retry
-	nop
-	nop
 
 	.globl		xcall_flush_tlb_kernel_range
 xcall_flush_tlb_kernel_range:
@@ -555,7 +420,6 @@ xcall_flush_tlb_kernel_range:
 	retry
 	nop
 	nop
-	nop
 
 	/* This runs in a very controlled environment, so we do
 	 * not need to worry about BH races etc.
diff --git a/arch/sparc64/solaris/conv.h b/arch/sparc64/solaris/conv.h
index 1cb3c9018..5faf59a9d 100644
--- a/arch/sparc64/solaris/conv.h
+++ b/arch/sparc64/solaris/conv.h
@@ -17,7 +17,7 @@
 	__asm__ ("srl	%0, 0, %0"	\
 		 : "=r" (__ret)		\
 		 : "0" (__x));		\
-	__ret;				\
+	(void __user *)__ret;		\
 })
 
 extern unsigned sys_call_table[];
diff --git a/arch/sparc64/solaris/fs.c b/arch/sparc64/solaris/fs.c
index 35e745949..a237c68ac 100644
--- a/arch/sparc64/solaris/fs.c
+++ b/arch/sparc64/solaris/fs.c
@@ -79,7 +79,7 @@ struct sol_stat64 {
 
 #define UFSMAGIC (((unsigned)'u'<<24)||((unsigned)'f'<<16)||((unsigned)'s'<<8))
 
-static inline int putstat(struct sol_stat *ubuf, struct kstat *kbuf)
+static inline int putstat(struct sol_stat __user *ubuf, struct kstat *kbuf)
 {
 	if (kbuf->size > MAX_NON_LFS ||
 	    !sysv_valid_dev(kbuf->dev) ||
@@ -101,12 +101,12 @@ static inline int putstat(struct sol_stat *ubuf, struct kstat *kbuf)
 	    __put_user (kbuf->ctime.tv_nsec, &ubuf->st_ctime.tv_nsec)	||
 	    __put_user (kbuf->blksize, &ubuf->st_blksize)	||
 	    __put_user (kbuf->blocks, &ubuf->st_blocks)	||
-	    __put_user (UFSMAGIC, (unsigned *)ubuf->st_fstype))
+	    __put_user (UFSMAGIC, (unsigned __user *)ubuf->st_fstype))
 		return -EFAULT;
 	return 0;
 }
 
-static inline int putstat64(struct sol_stat64 *ubuf, struct kstat *kbuf)
+static inline int putstat64(struct sol_stat64 __user *ubuf, struct kstat *kbuf)
 {
 	if (!sysv_valid_dev(kbuf->dev) || !sysv_valid_dev(kbuf->rdev))
 		return -EOVERFLOW;
@@ -126,27 +126,17 @@ static inline int putstat64(struct sol_stat64 *ubuf, struct kstat *kbuf)
 	    __put_user (kbuf->ctime.tv_nsec, &ubuf->st_ctime.tv_nsec)	||
 	    __put_user (kbuf->blksize, &ubuf->st_blksize)	||
 	    __put_user (kbuf->blocks, &ubuf->st_blocks)	||
-	    __put_user (UFSMAGIC, (unsigned *)ubuf->st_fstype))
+	    __put_user (UFSMAGIC, (unsigned __user *)ubuf->st_fstype))
 		return -EFAULT;
 	return 0;
 }
 
 asmlinkage int solaris_stat(u32 filename, u32 statbuf)
 {
-	int ret;
 	struct kstat s;
-	char *filenam;
-	mm_segment_t old_fs = get_fs();
-	
-	filenam = getname ((char *)A(filename));
-	ret = PTR_ERR(filenam);
-	if (!IS_ERR(filenam)) {
-		set_fs (KERNEL_DS);
-		ret = vfs_stat(filenam, &s);
-		set_fs (old_fs);
-		putname (filenam);
-		return putstat((struct sol_stat *)A(statbuf), &s);
-	}
+	int ret = vfs_stat(A(filename), &s);
+	if (!ret)
+		return putstat(A(statbuf), &s);
 	return ret;
 }
 
@@ -158,39 +148,19 @@ asmlinkage int solaris_xstat(int vers, u32 filename, u32 statbuf)
 
 asmlinkage int solaris_stat64(u32 filename, u32 statbuf)
 {
-	int ret;
 	struct kstat s;
-	char *filenam;
-	mm_segment_t old_fs = get_fs();
-	
-	filenam = getname ((char *)A(filename));
-	ret = PTR_ERR(filenam);
-	if (!IS_ERR(filenam)) {
-		set_fs (KERNEL_DS);
-		ret = vfs_stat(filenam, &s);
-		set_fs (old_fs);
-		putname (filenam);
-		return putstat64((struct sol_stat64 *)A(statbuf), &s);
-	}
+	int ret = vfs_stat(A(filename), &s);
+	if (!ret)
+		return putstat64(A(statbuf), &s);
 	return ret;
 }
 
 asmlinkage int solaris_lstat(u32 filename, u32 statbuf)
 {
-	int ret;
 	struct kstat s;
-	char *filenam;
-	mm_segment_t old_fs = get_fs();
-	
-	filenam = getname ((char *)A(filename));
-	ret = PTR_ERR(filenam);
-	if (!IS_ERR(filenam)) {
-		set_fs (KERNEL_DS);
-		ret = vfs_lstat(filenam, &s);
-		set_fs (old_fs);
-		putname (filenam);
-		return putstat((struct sol_stat *)A(statbuf), &s);
-	}
+	int ret = vfs_lstat(A(filename), &s);
+	if (!ret)
+		return putstat(A(statbuf), &s);
 	return ret;
 }
 
@@ -201,30 +171,19 @@ asmlinkage int solaris_lxstat(int vers, u32 filename, u32 statbuf)
 
 asmlinkage int solaris_lstat64(u32 filename, u32 statbuf)
 {
-	int ret;
 	struct kstat s;
-	char *filenam;
-	mm_segment_t old_fs = get_fs();
-	
-	filenam = getname ((char *)A(filename));
-	ret = PTR_ERR(filenam);
-	if (!IS_ERR(filenam)) {
-		set_fs (KERNEL_DS);
-		ret = vfs_lstat(filenam, &s);
-		set_fs (old_fs);
-		putname (filenam);
-		return putstat64((struct sol_stat64 *)A(statbuf), &s);
-	}
+	int ret = vfs_lstat(A(filename), &s);
+	if (!ret)
+		return putstat64(A(statbuf), &s);
 	return ret;
 }
 
 asmlinkage int solaris_fstat(unsigned int fd, u32 statbuf)
 {
-	int ret;
 	struct kstat s;
-	ret = vfs_fstat(fd, &s);
+	int ret = vfs_fstat(fd, &s);
 	if (!ret)
-		return putstat((struct sol_stat *)A(statbuf), &s);
+		return putstat(A(statbuf), &s);
 	return ret;
 }
 
@@ -235,27 +194,24 @@ asmlinkage int solaris_fxstat(int vers, u32 fd, u32 statbuf)
 
 asmlinkage int solaris_fstat64(unsigned int fd, u32 statbuf)
 {
-	int ret;
 	struct kstat s;
-	
-	ret = vfs_fstat(fd, &s);
+	int ret = vfs_fstat(fd, &s);
 	if (!ret)
-		return putstat64((struct sol_stat64 *)A(statbuf), &s);
+		return putstat64(A(statbuf), &s);
 	return ret;
 }
 
 asmlinkage int solaris_mknod(u32 path, u32 mode, s32 dev)
 {
-	int (*sys_mknod)(const char *,int,unsigned) = 
-		(int (*)(const char *,int,unsigned))SYS(mknod);
+	int (*sys_mknod)(const char __user *,int,unsigned) = 
+		(int (*)(const char __user *,int,unsigned))SYS(mknod);
 	int major = sysv_major(dev);
 	int minor = sysv_minor(dev);
 
 	/* minor is guaranteed to be OK for MKDEV, major might be not */
 	if (major > 0xfff)
 		return -EINVAL;
-	return sys_mknod((const char *)A(path), mode,
-				new_encode_dev(MKDEV(major,minor)));
+	return sys_mknod(A(path), mode, new_encode_dev(MKDEV(major,minor)));
 }
 
 asmlinkage int solaris_xmknod(int vers, u32 path, u32 mode, s32 dev)
@@ -263,10 +219,10 @@ asmlinkage int solaris_xmknod(int vers, u32 path, u32 mode, s32 dev)
 	return solaris_mknod(path, mode, dev);
 }
 
-asmlinkage int solaris_getdents64(unsigned int fd, void *dirent, unsigned int count)
+asmlinkage int solaris_getdents64(unsigned int fd, void __user *dirent, unsigned int count)
 {
-	int (*sys_getdents)(unsigned int, void *, unsigned int) =
-		(int (*)(unsigned int, void *, unsigned int))SYS(getdents);
+	int (*sys_getdents)(unsigned int, void __user *, unsigned int) =
+		(int (*)(unsigned int, void __user *, unsigned int))SYS(getdents);
 		
 	return sys_getdents(fd, dirent, count);
 }
@@ -290,14 +246,15 @@ asmlinkage int solaris_statfs(u32 path, u32 buf, int len, int fstype)
 	int ret;
 	struct statfs s;
 	mm_segment_t old_fs = get_fs();
-	int (*sys_statfs)(const char *,struct statfs *) = 
-		(int (*)(const char *,struct statfs *))SYS(statfs);
-	struct sol_statfs *ss = (struct sol_statfs *)A(buf);
+	int (*sys_statfs)(const char __user *,struct statfs __user *) = 
+		(int (*)(const char __user *,struct statfs __user *))SYS(statfs);
+	struct sol_statfs __user *ss = A(buf);
 	
 	if (len != sizeof(struct sol_statfs)) return -EINVAL;
 	if (!fstype) {
+		/* FIXME: mixing userland and kernel pointers */
 		set_fs (KERNEL_DS);
-		ret = sys_statfs((const char *)A(path), &s);
+		ret = sys_statfs(A(path), &s);
 		set_fs (old_fs);
 		if (!ret) {
 			if (put_user (s.f_type, &ss->f_type)		||
@@ -332,9 +289,9 @@ asmlinkage int solaris_fstatfs(u32 fd, u32 buf, int len, int fstype)
 	int ret;
 	struct statfs s;
 	mm_segment_t old_fs = get_fs();
-	int (*sys_fstatfs)(unsigned,struct statfs *) = 
-		(int (*)(unsigned,struct statfs *))SYS(fstatfs);
-	struct sol_statfs *ss = (struct sol_statfs *)A(buf);
+	int (*sys_fstatfs)(unsigned,struct statfs __user *) = 
+		(int (*)(unsigned,struct statfs __user *))SYS(fstatfs);
+	struct sol_statfs __user *ss = A(buf);
 	
 	if (len != sizeof(struct sol_statfs)) return -EINVAL;
 	if (!fstype) {
@@ -396,7 +353,7 @@ static int report_statvfs(struct vfsmount *mnt, struct inode *inode, u32 buf)
 {
 	struct kstatfs s;
 	int error;
-	struct sol_statvfs *ss = (struct sol_statvfs *)A(buf);
+	struct sol_statvfs __user *ss = A(buf);
 
 	error = vfs_statfs(mnt->mnt_sb, &s);
 	if (!error) {
@@ -419,7 +376,7 @@ static int report_statvfs(struct vfsmount *mnt, struct inode *inode, u32 buf)
 		    __put_user (s.f_ffree, &ss->f_favail)	||
 		    __put_user (sysv_encode_dev(inode->i_sb->s_dev), &ss->f_fsid) ||
 		    __copy_to_user (ss->f_basetype,p,j)		||
-		    __put_user (0, (char *)&ss->f_basetype[j])	||
+		    __put_user (0, (char __user *)&ss->f_basetype[j])	||
 		    __put_user (s.f_namelen, &ss->f_namemax)	||
 		    __put_user (i, &ss->f_flag)			||		    
 		    __clear_user (&ss->f_fstr, 32))
@@ -432,7 +389,7 @@ static int report_statvfs64(struct vfsmount *mnt, struct inode *inode, u32 buf)
 {
 	struct kstatfs s;
 	int error;
-	struct sol_statvfs64 *ss = (struct sol_statvfs64 *)A(buf);
+	struct sol_statvfs64 __user *ss = A(buf);
 			
 	error = vfs_statfs(mnt->mnt_sb, &s);
 	if (!error) {
@@ -455,7 +412,7 @@ static int report_statvfs64(struct vfsmount *mnt, struct inode *inode, u32 buf)
 		    __put_user (s.f_ffree, &ss->f_favail)	||
 		    __put_user (sysv_encode_dev(inode->i_sb->s_dev), &ss->f_fsid) ||
 		    __copy_to_user (ss->f_basetype,p,j)		||
-		    __put_user (0, (char *)&ss->f_basetype[j])	||
+		    __put_user (0, (char __user *)&ss->f_basetype[j])	||
 		    __put_user (s.f_namelen, &ss->f_namemax)	||
 		    __put_user (i, &ss->f_flag)			||		    
 		    __clear_user (&ss->f_fstr, 32))
@@ -469,7 +426,7 @@ asmlinkage int solaris_statvfs(u32 path, u32 buf)
 	struct nameidata nd;
 	int error;
 
-	error = user_path_walk((const char *)A(path),&nd);
+	error = user_path_walk(A(path),&nd);
 	if (!error) {
 		struct inode * inode = nd.dentry->d_inode;
 		error = report_statvfs(nd.mnt, inode, buf);
@@ -499,7 +456,7 @@ asmlinkage int solaris_statvfs64(u32 path, u32 buf)
 	int error;
 
 	lock_kernel();
-	error = user_path_walk((const char *)A(path), &nd);
+	error = user_path_walk(A(path), &nd);
 	if (!error) {
 		struct inode * inode = nd.dentry->d_inode;
 		error = report_statvfs64(nd.mnt, inode, buf);
@@ -594,6 +551,7 @@ asmlinkage int solaris_fcntl(unsigned fd, unsigned cmd, u32 arg)
 	case SOL_F_SETLKW:
 		{
 			struct flock f;
+			struct sol_flock __user *p = A(arg);
 			mm_segment_t old_fs = get_fs();
 
 			switch (cmd) {
@@ -602,23 +560,23 @@ asmlinkage int solaris_fcntl(unsigned fd, unsigned cmd, u32 arg)
 			case SOL_F_SETLKW: cmd = F_SETLKW; break;
 			}
 
-			if (get_user (f.l_type, &((struct sol_flock *)A(arg))->l_type) ||
-			    __get_user (f.l_whence, &((struct sol_flock *)A(arg))->l_whence) ||
-			    __get_user (f.l_start, &((struct sol_flock *)A(arg))->l_start) ||
-			    __get_user (f.l_len, &((struct sol_flock *)A(arg))->l_len) ||
-			    __get_user (f.l_pid, &((struct sol_flock *)A(arg))->l_sysid))
+			if (get_user (f.l_type, &p->l_type) ||
+			    __get_user (f.l_whence, &p->l_whence) ||
+			    __get_user (f.l_start, &p->l_start) ||
+			    __get_user (f.l_len, &p->l_len) ||
+			    __get_user (f.l_pid, &p->l_sysid))
 				return -EFAULT;
 
 			set_fs(KERNEL_DS);
 			ret = sys_fcntl(fd, cmd, (unsigned long)&f);
 			set_fs(old_fs);
 
-			if (__put_user (f.l_type, &((struct sol_flock *)A(arg))->l_type) ||
-			    __put_user (f.l_whence, &((struct sol_flock *)A(arg))->l_whence) ||
-			    __put_user (f.l_start, &((struct sol_flock *)A(arg))->l_start) ||
-			    __put_user (f.l_len, &((struct sol_flock *)A(arg))->l_len) ||
-			    __put_user (f.l_pid, &((struct sol_flock *)A(arg))->l_pid) ||
-			    __put_user (0, &((struct sol_flock *)A(arg))->l_sysid))
+			if (__put_user (f.l_type, &p->l_type) ||
+			    __put_user (f.l_whence, &p->l_whence) ||
+			    __put_user (f.l_start, &p->l_start) ||
+			    __put_user (f.l_len, &p->l_len) ||
+			    __put_user (f.l_pid, &p->l_pid) ||
+			    __put_user (0, &p->l_sysid))
 				return -EFAULT;
 
 			return ret;
@@ -629,7 +587,7 @@ asmlinkage int solaris_fcntl(unsigned fd, unsigned cmd, u32 arg)
 		    int (*sys_newftruncate)(unsigned int, unsigned long)=
 			    (int (*)(unsigned int, unsigned long))SYS(ftruncate);
 
-		    if (get_user(length, &((struct sol_flock*)A(arg))->l_start))
+		    if (get_user(length, &((struct sol_flock __user *)A(arg))->l_start))
 			    return -EFAULT;
 
 		    return sys_newftruncate(fd, length);
@@ -677,18 +635,18 @@ asmlinkage int solaris_facl(unsigned int fd, int cmd, int nentries, u32 aclbufp)
 	return -ENOSYS;
 }
 
-asmlinkage int solaris_pread(unsigned int fd, char *buf, u32 count, u32 pos)
+asmlinkage int solaris_pread(unsigned int fd, char __user *buf, u32 count, u32 pos)
 {
-	ssize_t (*sys_pread64)(unsigned int, char *, size_t, loff_t) =
-		(ssize_t (*)(unsigned int, char *, size_t, loff_t))SYS(pread64);
+	ssize_t (*sys_pread64)(unsigned int, char __user *, size_t, loff_t) =
+		(ssize_t (*)(unsigned int, char __user *, size_t, loff_t))SYS(pread64);
 
 	return sys_pread64(fd, buf, count, (loff_t)pos);
 }
 
-asmlinkage int solaris_pwrite(unsigned int fd, char *buf, u32 count, u32 pos)
+asmlinkage int solaris_pwrite(unsigned int fd, char __user *buf, u32 count, u32 pos)
 {
-	ssize_t (*sys_pwrite64)(unsigned int, char *, size_t, loff_t) =
-		(ssize_t (*)(unsigned int, char *, size_t, loff_t))SYS(pwrite64);
+	ssize_t (*sys_pwrite64)(unsigned int, char __user *, size_t, loff_t) =
+		(ssize_t (*)(unsigned int, char __user *, size_t, loff_t))SYS(pwrite64);
 
 	return sys_pwrite64(fd, buf, count, (loff_t)pos);
 }
@@ -757,8 +715,8 @@ asmlinkage int solaris_pathconf(u32 path, int name)
 /* solaris_llseek returns long long - quite difficult */
 asmlinkage long solaris_llseek(struct pt_regs *regs, u32 off_hi, u32 off_lo, int whence)
 {
-	int (*sys_llseek)(unsigned int, unsigned long, unsigned long, loff_t *, unsigned int) =
-		(int (*)(unsigned int, unsigned long, unsigned long, loff_t *, unsigned int))SYS(_llseek);
+	int (*sys_llseek)(unsigned int, unsigned long, unsigned long, loff_t __user *, unsigned int) =
+		(int (*)(unsigned int, unsigned long, unsigned long, loff_t __user *, unsigned int))SYS(_llseek);
 	int ret;
 	mm_segment_t old_fs = get_fs();
 	loff_t retval;
@@ -774,8 +732,8 @@ asmlinkage long solaris_llseek(struct pt_regs *regs, u32 off_hi, u32 off_lo, int
 /* Have to mask out all but lower 3 bits */
 asmlinkage int solaris_access(u32 filename, long mode)
 {
-	int (*sys_access)(const char *, int) = 
-		(int (*)(const char *, int))SYS(access);
+	int (*sys_access)(const char __user *, int) = 
+		(int (*)(const char __user *, int))SYS(access);
 		
-	return sys_access((const char *)A(filename), mode & 7);
+	return sys_access(A(filename), mode & 7);
 }
diff --git a/arch/sparc64/solaris/ioctl.c b/arch/sparc64/solaris/ioctl.c
index 28f60ab10..b0d12032b 100644
--- a/arch/sparc64/solaris/ioctl.c
+++ b/arch/sparc64/solaris/ioctl.c
@@ -39,10 +39,10 @@ extern asmlinkage int compat_sys_ioctl(unsigned int fd, unsigned int cmd,
 	u32 arg);
 asmlinkage int solaris_ioctl(unsigned int fd, unsigned int cmd, u32 arg);
 
-extern int timod_putmsg(unsigned int fd, char *ctl_buf, int ctl_len,
-			char *data_buf, int data_len, int flags);
-extern int timod_getmsg(unsigned int fd, char *ctl_buf, int ctl_maxlen, int *ctl_len,
-			char *data_buf, int data_maxlen, int *data_len, int *flags);
+extern int timod_putmsg(unsigned int fd, char __user *ctl_buf, int ctl_len,
+			char __user *data_buf, int data_len, int flags);
+extern int timod_getmsg(unsigned int fd, char __user *ctl_buf, int ctl_maxlen, int __user *ctl_len,
+			char __user *data_buf, int data_maxlen, int __user *data_len, int *flags);
 
 /* termio* stuff {{{ */
 
@@ -117,16 +117,17 @@ static u32 linux_to_solaris_cflag(u32 cflag)
 
 static inline int linux_to_solaris_termio(unsigned int fd, unsigned int cmd, u32 arg)
 {
+	struct solaris_termio __user *p = A(arg);
 	int ret;
 	
-	ret = sys_ioctl(fd, cmd, A(arg));
+	ret = sys_ioctl(fd, cmd, (unsigned long)p);
 	if (!ret) {
 		u32 cflag;
 		
-		if (__get_user (cflag, &((struct solaris_termio *)A(arg))->c_cflag))
+		if (__get_user (cflag, &p->c_cflag))
 			return -EFAULT;
 		cflag = linux_to_solaris_cflag(cflag);
-		if (__put_user (cflag, &((struct solaris_termio *)A(arg))->c_cflag))
+		if (__put_user (cflag, &p->c_cflag))
 			return -EFAULT;
 	}
 	return ret;
@@ -138,7 +139,7 @@ static int solaris_to_linux_termio(unsigned int fd, unsigned int cmd, u32 arg)
 	struct solaris_termio s;
 	mm_segment_t old_fs = get_fs();
 	
-	if (copy_from_user (&s, (struct solaris_termio *)A(arg), sizeof(struct solaris_termio)))
+	if (copy_from_user (&s, (struct solaris_termio __user *)A(arg), sizeof(struct solaris_termio)))
 		return -EFAULT;
 	s.c_cflag = solaris_to_linux_cflag(s.c_cflag);
 	set_fs(KERNEL_DS);
@@ -157,12 +158,13 @@ static inline int linux_to_solaris_termios(unsigned int fd, unsigned int cmd, u3
 	ret = sys_ioctl(fd, cmd, (unsigned long)&s);
 	set_fs(old_fs);
 	if (!ret) {
-		if (put_user (s.c_iflag, &((struct solaris_termios *)A(arg))->c_iflag) ||
-		    __put_user (s.c_oflag, &((struct solaris_termios *)A(arg))->c_oflag) ||
-		    __put_user (linux_to_solaris_cflag(s.c_cflag), &((struct solaris_termios *)A(arg))->c_cflag) ||
-		    __put_user (s.c_lflag, &((struct solaris_termios *)A(arg))->c_lflag) ||
-		    __copy_to_user (((struct solaris_termios *)A(arg))->c_cc, s.c_cc, 16) ||
-		    __clear_user (((struct solaris_termios *)A(arg))->c_cc + 16, 2))
+		struct solaris_termios __user *p = A(arg);
+		if (put_user (s.c_iflag, &p->c_iflag) ||
+		    __put_user (s.c_oflag, &p->c_oflag) ||
+		    __put_user (linux_to_solaris_cflag(s.c_cflag), &p->c_cflag) ||
+		    __put_user (s.c_lflag, &p->c_lflag) ||
+		    __copy_to_user (p->c_cc, s.c_cc, 16) ||
+		    __clear_user (p->c_cc + 16, 2))
 			return -EFAULT;
 	}
 	return ret;
@@ -172,17 +174,18 @@ static int solaris_to_linux_termios(unsigned int fd, unsigned int cmd, u32 arg)
 {
 	int ret;
 	struct solaris_termios s;
+	struct solaris_termios __user *p = A(arg);
 	mm_segment_t old_fs = get_fs();
 
 	set_fs(KERNEL_DS);
 	ret = sys_ioctl(fd, TCGETS, (unsigned long)&s);
 	set_fs(old_fs);
 	if (ret) return ret;
-	if (put_user (s.c_iflag, &((struct solaris_termios *)A(arg))->c_iflag) ||
-	    __put_user (s.c_oflag, &((struct solaris_termios *)A(arg))->c_oflag) ||
-	    __put_user (s.c_cflag, &((struct solaris_termios *)A(arg))->c_cflag) ||
-	    __put_user (s.c_lflag, &((struct solaris_termios *)A(arg))->c_lflag) ||
-	    __copy_from_user (s.c_cc, ((struct solaris_termios *)A(arg))->c_cc, 16))
+	if (put_user (s.c_iflag, &p->c_iflag) ||
+	    __put_user (s.c_oflag, &p->c_oflag) ||
+	    __put_user (s.c_cflag, &p->c_cflag) ||
+	    __put_user (s.c_lflag, &p->c_lflag) ||
+	    __copy_from_user (s.c_cc, p->c_cc, 16))
 		return -EFAULT;
 	s.c_cflag = solaris_to_linux_cflag(s.c_cflag);
 	set_fs(KERNEL_DS);
@@ -305,7 +308,7 @@ static inline int solaris_sockmod(unsigned int fd, unsigned int cmd, u32 arg)
 	case 109: /* SI_SOCKPARAMS */
 	{
 		struct solaris_si_sockparams si;
-		if (copy_from_user (&si, (struct solaris_si_sockparams *) A(arg), sizeof(si)))
+		if (copy_from_user (&si, A(arg), sizeof(si)))
 			return (EFAULT << 8) | TSYSERR;
 
 		/* Should we modify socket ino->socket_i.ops and type? */
@@ -314,6 +317,7 @@ static inline int solaris_sockmod(unsigned int fd, unsigned int cmd, u32 arg)
 	case 110: /* SI_GETUDATA */
 	{
 		int etsdusize, servtype;
+		struct solaris_si_udata __user *p = A(arg);
 		switch (SOCKET_I(ino)->type) {
 		case SOCK_STREAM:
 			etsdusize = 1;
@@ -324,23 +328,24 @@ static inline int solaris_sockmod(unsigned int fd, unsigned int cmd, u32 arg)
 			servtype = 3;
 			break;
 		}
-		if (put_user(16384, &((struct solaris_si_udata *)A(arg))->tidusize) ||
-		    __put_user(sizeof(struct sockaddr), &((struct solaris_si_udata *)A(arg))->addrsize) ||
-		    __put_user(-1, &((struct solaris_si_udata *)A(arg))->optsize) ||
-		    __put_user(etsdusize, &((struct solaris_si_udata *)A(arg))->etsdusize) ||
-		    __put_user(servtype, &((struct solaris_si_udata *)A(arg))->servtype) ||
-		    __put_user(0, &((struct solaris_si_udata *)A(arg))->so_state) ||
-		    __put_user(0, &((struct solaris_si_udata *)A(arg))->so_options) ||
-		    __put_user(16384, &((struct solaris_si_udata *)A(arg))->tsdusize) ||
-		    __put_user(SOCKET_I(ino)->ops->family, &((struct solaris_si_udata *)A(arg))->sockparams.sp_family) ||
-		    __put_user(SOCKET_I(ino)->type, &((struct solaris_si_udata *)A(arg))->sockparams.sp_type) ||
-		    __put_user(SOCKET_I(ino)->ops->family, &((struct solaris_si_udata *)A(arg))->sockparams.sp_protocol))
+		if (put_user(16384, &p->tidusize) ||
+		    __put_user(sizeof(struct sockaddr), &p->addrsize) ||
+		    __put_user(-1, &p->optsize) ||
+		    __put_user(etsdusize, &p->etsdusize) ||
+		    __put_user(servtype, &p->servtype) ||
+		    __put_user(0, &p->so_state) ||
+		    __put_user(0, &p->so_options) ||
+		    __put_user(16384, &p->tsdusize) ||
+		    __put_user(SOCKET_I(ino)->ops->family, &p->sockparams.sp_family) ||
+		    __put_user(SOCKET_I(ino)->type, &p->sockparams.sp_type) ||
+		    __put_user(SOCKET_I(ino)->ops->family, &p->sockparams.sp_protocol))
 			return (EFAULT << 8) | TSYSERR;
 		return 0;
 	}
 	case 101: /* O_SI_GETUDATA */
 	{
 		int etsdusize, servtype;
+		struct solaris_o_si_udata __user *p = A(arg);
 		switch (SOCKET_I(ino)->type) {
 		case SOCK_STREAM:
 			etsdusize = 1;
@@ -351,14 +356,14 @@ static inline int solaris_sockmod(unsigned int fd, unsigned int cmd, u32 arg)
 			servtype = 3;
 			break;
 		}
-		if (put_user(16384, &((struct solaris_o_si_udata *)A(arg))->tidusize) ||
-		    __put_user(sizeof(struct sockaddr), &((struct solaris_o_si_udata *)A(arg))->addrsize) ||
-		    __put_user(-1, &((struct solaris_o_si_udata *)A(arg))->optsize) ||
-		    __put_user(etsdusize, &((struct solaris_o_si_udata *)A(arg))->etsdusize) ||
-		    __put_user(servtype, &((struct solaris_o_si_udata *)A(arg))->servtype) ||
-		    __put_user(0, &((struct solaris_o_si_udata *)A(arg))->so_state) ||
-		    __put_user(0, &((struct solaris_o_si_udata *)A(arg))->so_options) ||
-		    __put_user(16384, &((struct solaris_o_si_udata *)A(arg))->tsdusize))
+		if (put_user(16384, &p->tidusize) ||
+		    __put_user(sizeof(struct sockaddr), &p->addrsize) ||
+		    __put_user(-1, &p->optsize) ||
+		    __put_user(etsdusize, &p->etsdusize) ||
+		    __put_user(servtype, &p->servtype) ||
+		    __put_user(0, &p->so_state) ||
+		    __put_user(0, &p->so_options) ||
+		    __put_user(16384, &p->tsdusize))
 			return (EFAULT << 8) | TSYSERR;
 		return 0;
 	}
@@ -375,7 +380,7 @@ static inline int solaris_sockmod(unsigned int fd, unsigned int cmd, u32 arg)
 }
 
 static inline int solaris_timod(unsigned int fd, unsigned int cmd, u32 arg,
-                                    int len, int *len_p)
+                                    int len, int __user *len_p)
 {
 	int ret;
 		
@@ -385,25 +390,25 @@ static inline int solaris_timod(unsigned int fd, unsigned int cmd, u32 arg,
 		int i;
 		u32 prim;
 		SOLD("TI_OPMGMT entry");
-		ret = timod_putmsg(fd, (char *)A(arg), len, NULL, -1, 0);
+		ret = timod_putmsg(fd, A(arg), len, NULL, -1, 0);
 		SOLD("timod_putmsg() returned");
 		if (ret)
 			return (-ret << 8) | TSYSERR;
 		i = MSG_HIPRI;
 		SOLD("calling timod_getmsg()");
-		ret = timod_getmsg(fd, (char *)A(arg), len, len_p, NULL, -1, NULL, &i);
+		ret = timod_getmsg(fd, A(arg), len, len_p, NULL, -1, NULL, &i);
 		SOLD("timod_getmsg() returned");
 		if (ret)
 			return (-ret << 8) | TSYSERR;
 		SOLD("ret ok");
-		if (get_user(prim, (u32 *)A(arg)))
+		if (get_user(prim, (u32 __user *)A(arg)))
 			return (EFAULT << 8) | TSYSERR;
 		SOLD("got prim");
 		if (prim == T_ERROR_ACK) {
 			u32 tmp, tmp2;
 			SOLD("prim is T_ERROR_ACK");
-			if (get_user(tmp, (u32 *)A(arg)+3) ||
-			    get_user(tmp2, (u32 *)A(arg)+2))
+			if (get_user(tmp, (u32 __user *)A(arg)+3) ||
+			    get_user(tmp2, (u32 __user *)A(arg)+2))
 				return (EFAULT << 8) | TSYSERR;
 			return (tmp2 << 8) | tmp;
 		}
@@ -415,26 +420,26 @@ static inline int solaris_timod(unsigned int fd, unsigned int cmd, u32 arg,
 		int i;
 		u32 prim;
 		SOLD("TI_BIND entry");
-		ret = timod_putmsg(fd, (char *)A(arg), len, NULL, -1, 0);
+		ret = timod_putmsg(fd, A(arg), len, NULL, -1, 0);
 		SOLD("timod_putmsg() returned");
 		if (ret)
 			return (-ret << 8) | TSYSERR;
 		len = 1024; /* Solaris allows arbitrary return size */
 		i = MSG_HIPRI;
 		SOLD("calling timod_getmsg()");
-		ret = timod_getmsg(fd, (char *)A(arg), len, len_p, NULL, -1, NULL, &i);
+		ret = timod_getmsg(fd, A(arg), len, len_p, NULL, -1, NULL, &i);
 		SOLD("timod_getmsg() returned");
 		if (ret)
 			return (-ret << 8) | TSYSERR;
 		SOLD("ret ok");
-		if (get_user(prim, (u32 *)A(arg)))
+		if (get_user(prim, (u32 __user *)A(arg)))
 			return (EFAULT << 8) | TSYSERR;
 		SOLD("got prim");
 		if (prim == T_ERROR_ACK) {
 			u32 tmp, tmp2;
 			SOLD("prim is T_ERROR_ACK");
-			if (get_user(tmp, (u32 *)A(arg)+3) ||
-			    get_user(tmp2, (u32 *)A(arg)+2))
+			if (get_user(tmp, (u32 __user *)A(arg)+3) ||
+			    get_user(tmp2, (u32 __user *)A(arg)+2))
 				return (EFAULT << 8) | TSYSERR;
 			return (tmp2 << 8) | tmp;
 		}
@@ -444,7 +449,7 @@ static inline int solaris_timod(unsigned int fd, unsigned int cmd, u32 arg,
 		SOLD("OK_ACK requested");
 		i = MSG_HIPRI;
 		SOLD("calling timod_getmsg()");
-		ret = timod_getmsg(fd, (char *)A(arg), len, len_p, NULL, -1, NULL, &i);
+		ret = timod_getmsg(fd, A(arg), len, len_p, NULL, -1, NULL, &i);
 		SOLD("timod_getmsg() returned");
 		if (ret)
 			return (-ret << 8) | TSYSERR;
@@ -491,7 +496,7 @@ static inline int solaris_S(struct file *filp, unsigned int fd, unsigned int cmd
 		return -ENOSYS;
 	case 2: /* I_PUSH */
         {
-		p = getname ((char *)A(arg));
+		p = getname (A(arg));
 		if (IS_ERR (p))
 			return PTR_ERR(p);
                 ret = -EINVAL;
@@ -520,14 +525,14 @@ static inline int solaris_S(struct file *filp, unsigned int fd, unsigned int cmd
         	const char *p;
                 if (sock->modcount <= 0) return -EINVAL;
                 p = module_table[(unsigned)sock->module[sock->modcount]].name;
-                if (copy_to_user ((char *)A(arg), p, strlen(p)))
+                if (copy_to_user (A(arg), p, strlen(p)))
                 	return -EFAULT;
                 return 0;
         }
 	case 5: /* I_FLUSH */
 		return 0;
 	case 8: /* I_STR */
-		if (copy_from_user(&si, (struct strioctl *)A(arg), sizeof(struct strioctl)))
+		if (copy_from_user(&si, A(arg), sizeof(struct strioctl)))
 			return -EFAULT;
                 /* We ignore what module is actually at the top of stack. */
 		switch ((si.cmd >> 8) & 0xff) {
@@ -535,7 +540,7 @@ static inline int solaris_S(struct file *filp, unsigned int fd, unsigned int cmd
                         return solaris_sockmod(fd, si.cmd, si.data);
 		case 'T':
                         return solaris_timod(fd, si.cmd, si.data, si.len,
-                                                &((struct strioctl*)A(arg))->len);
+				&((struct strioctl __user *)A(arg))->len);
 		default:
 			return solaris_ioctl(fd, si.cmd, si.data);
 		}
@@ -551,7 +556,7 @@ static inline int solaris_S(struct file *filp, unsigned int fd, unsigned int cmd
 	case 11: /* I_FIND */
         {
                 int i;
-		p = getname ((char *)A(arg));
+		p = getname (A(arg));
 		if (IS_ERR (p))
 			return PTR_ERR(p);
                 ret = 0;
@@ -580,7 +585,7 @@ static inline int solaris_s(unsigned int fd, unsigned int cmd, u32 arg)
 		return 0; /* We don't support them */
 	case 1: /* SIOCGHIWAT */
 	case 3: /* SIOCGLOWAT */
-		if (put_user (0, (u32 *)A(arg)))
+		if (put_user (0, (u32 __user *)A(arg)))
 			return -EFAULT;
 		return 0; /* Lie */
 	case 7: /* SIOCATMARK */
@@ -663,7 +668,7 @@ static inline int solaris_i(unsigned int fd, unsigned int cmd, u32 arg)
 					args);
 			set_fs(old_fs);
 			if (ret >= 0) {
-				if (copy_to_user((char *)A(arg), &uaddr, uaddr_len))
+				if (copy_to_user(A(arg), &uaddr, uaddr_len))
 					return -EFAULT;
 			}
 			return ret;
@@ -681,7 +686,7 @@ static inline int solaris_i(unsigned int fd, unsigned int cmd, u32 arg)
 			for (d = dev_base; d; d = d->next) i++;
 			read_unlock_bh(&dev_base_lock);
 
-			if (put_user (i, (int *)A(arg)))
+			if (put_user (i, (int __user *)A(arg)))
 				return -EFAULT;
 			return 0;
 		}
diff --git a/arch/sparc64/solaris/ipc.c b/arch/sparc64/solaris/ipc.c
index 3d312b5e1..8cef5fd57 100644
--- a/arch/sparc64/solaris/ipc.c
+++ b/arch/sparc64/solaris/ipc.c
@@ -54,8 +54,8 @@ struct solaris_shmid_ds {
 
 asmlinkage long solaris_shmsys(int cmd, u32 arg1, u32 arg2, u32 arg3)
 {
-	int (*sys_ipc)(unsigned,int,int,unsigned long,void *,long) = 
-		(int (*)(unsigned,int,int,unsigned long,void *,long))SYS(ipc);
+	int (*sys_ipc)(unsigned,int,int,unsigned long,void __user *,long) = 
+		(int (*)(unsigned,int,int,unsigned long,void __user *,long))SYS(ipc);
 	mm_segment_t old_fs;
 	unsigned long raddr;
 	int ret;
@@ -64,7 +64,7 @@ asmlinkage long solaris_shmsys(int cmd, u32 arg1, u32 arg2, u32 arg3)
 	case 0: /* shmat */
 		old_fs = get_fs();
 		set_fs(KERNEL_DS);
-		ret = sys_ipc(SHMAT, arg1, arg3 & ~0x4000, (unsigned long)&raddr, (void *)A(arg2), 0);
+		ret = sys_ipc(SHMAT, arg1, arg3 & ~0x4000, (unsigned long)&raddr, A(arg2), 0);
 		set_fs(old_fs);
 		if (ret >= 0) return (u32)raddr;
 		else return ret;
@@ -78,10 +78,11 @@ asmlinkage long solaris_shmsys(int cmd, u32 arg1, u32 arg2, u32 arg3)
 		case 11: /* IPC_SET */
 			{
 				struct shmid_ds s;
+				struct solaris_shmid_ds __user *p = A(arg3);
 				
-				if (get_user (s.shm_perm.uid, &(((struct solaris_shmid_ds *)A(arg3))->shm_perm.uid)) ||
-				    __get_user (s.shm_perm.gid, &(((struct solaris_shmid_ds *)A(arg3))->shm_perm.gid)) || 
-				    __get_user (s.shm_perm.mode, &(((struct solaris_shmid_ds *)A(arg3))->shm_perm.mode)))
+				if (get_user (s.shm_perm.uid, &p->shm_perm.uid) ||
+				    __get_user (s.shm_perm.gid, &p->shm_perm.gid) || 
+				    __get_user (s.shm_perm.mode, &p->shm_perm.mode))
 					return -EFAULT;
 				old_fs = get_fs();
 				set_fs(KERNEL_DS);
@@ -92,32 +93,33 @@ asmlinkage long solaris_shmsys(int cmd, u32 arg1, u32 arg2, u32 arg3)
 		case 12: /* IPC_STAT */
 			{
 				struct shmid_ds s;
+				struct solaris_shmid_ds __user *p = A(arg3);
 				
 				old_fs = get_fs();
 				set_fs(KERNEL_DS);
 				ret = sys_ipc(SHMCTL, arg1, IPC_SET, 0, &s, 0);
 				set_fs(old_fs);
-				if (get_user (s.shm_perm.uid, &(((struct solaris_shmid_ds *)A(arg3))->shm_perm.uid)) ||
-				    __get_user (s.shm_perm.gid, &(((struct solaris_shmid_ds *)A(arg3))->shm_perm.gid)) || 
-				    __get_user (s.shm_perm.cuid, &(((struct solaris_shmid_ds *)A(arg3))->shm_perm.cuid)) ||
-				    __get_user (s.shm_perm.cgid, &(((struct solaris_shmid_ds *)A(arg3))->shm_perm.cgid)) || 
-				    __get_user (s.shm_perm.mode, &(((struct solaris_shmid_ds *)A(arg3))->shm_perm.mode)) ||
-				    __get_user (s.shm_perm.seq, &(((struct solaris_shmid_ds *)A(arg3))->shm_perm.seq)) ||
-				    __get_user (s.shm_perm.key, &(((struct solaris_shmid_ds *)A(arg3))->shm_perm.key)) ||
-				    __get_user (s.shm_segsz, &(((struct solaris_shmid_ds *)A(arg3))->shm_segsz)) ||
-				    __get_user (s.shm_lpid, &(((struct solaris_shmid_ds *)A(arg3))->shm_lpid)) ||
-				    __get_user (s.shm_cpid, &(((struct solaris_shmid_ds *)A(arg3))->shm_cpid)) ||
-				    __get_user (s.shm_nattch, &(((struct solaris_shmid_ds *)A(arg3))->shm_nattch)) ||
-				    __get_user (s.shm_atime, &(((struct solaris_shmid_ds *)A(arg3))->shm_atime)) ||
-				    __get_user (s.shm_dtime, &(((struct solaris_shmid_ds *)A(arg3))->shm_dtime)) ||
-				    __get_user (s.shm_ctime, &(((struct solaris_shmid_ds *)A(arg3))->shm_ctime)))
+				if (put_user (s.shm_perm.uid, &(p->shm_perm.uid)) ||
+				    __put_user (s.shm_perm.gid, &(p->shm_perm.gid)) || 
+				    __put_user (s.shm_perm.cuid, &(p->shm_perm.cuid)) ||
+				    __put_user (s.shm_perm.cgid, &(p->shm_perm.cgid)) || 
+				    __put_user (s.shm_perm.mode, &(p->shm_perm.mode)) ||
+				    __put_user (s.shm_perm.seq, &(p->shm_perm.seq)) ||
+				    __put_user (s.shm_perm.key, &(p->shm_perm.key)) ||
+				    __put_user (s.shm_segsz, &(p->shm_segsz)) ||
+				    __put_user (s.shm_lpid, &(p->shm_lpid)) ||
+				    __put_user (s.shm_cpid, &(p->shm_cpid)) ||
+				    __put_user (s.shm_nattch, &(p->shm_nattch)) ||
+				    __put_user (s.shm_atime, &(p->shm_atime)) ||
+				    __put_user (s.shm_dtime, &(p->shm_dtime)) ||
+				    __put_user (s.shm_ctime, &(p->shm_ctime)))
 					return -EFAULT;
 				return ret;
 			}
 		default: return -EINVAL;
 		}
 	case 2: /* shmdt */
-		return sys_ipc(SHMDT, 0, 0, 0, (void *)A(arg1), 0);
+		return sys_ipc(SHMDT, 0, 0, 0, A(arg1), 0);
 	case 3: /* shmget */
 		return sys_ipc(SHMGET, arg1, arg2, arg3, NULL, 0);
 	}
diff --git a/arch/sparc64/solaris/misc.c b/arch/sparc64/solaris/misc.c
index cea38c0cb..4a3db02e1 100644
--- a/arch/sparc64/solaris/misc.c
+++ b/arch/sparc64/solaris/misc.c
@@ -121,10 +121,10 @@ asmlinkage u32 solaris_mmap64(struct pt_regs *regs, u32 len, u32 prot, u32 flags
 	u32 offlo;
 	
 	if (regs->u_regs[UREG_G1]) {
-		if (get_user (offlo, (u32 *)(long)((u32)regs->u_regs[UREG_I6] + 0x5c)))
+		if (get_user (offlo, (u32 __user *)(long)((u32)regs->u_regs[UREG_I6] + 0x5c)))
 			return -EFAULT;
 	} else {
-		if (get_user (offlo, (u32 *)(long)((u32)regs->u_regs[UREG_I6] + 0x60)))
+		if (get_user (offlo, (u32 __user *)(long)((u32)regs->u_regs[UREG_I6] + 0x60)))
 			return -EFAULT;
 	}
 	return do_solaris_mmap((u32)regs->u_regs[UREG_I0], len, prot, flags, fd, (((u64)offhi)<<32)|offlo);
@@ -148,7 +148,7 @@ asmlinkage int solaris_brk(u32 brk)
 		for (p=from,i=0; *p && *p != '.' && --len; p++,i++); 	\
 	else 								\
 		i = len - 1; 						\
-	if (__put_user('\0', (char *)(to+i)))				\
+	if (__put_user('\0', (char __user *)((to)+i)))			\
 		return -EFAULT;						\
 }
 
@@ -218,21 +218,17 @@ static char *serial(char *buffer)
 
 asmlinkage int solaris_utssys(u32 buf, u32 flags, int which, u32 buf2)
 {
+	struct sol_uname __user *v = A(buf);
 	switch (which) {
 	case 0:	/* old uname */
 		/* Let's cheat */
-		set_utsfield(((struct sol_uname *)A(buf))->sysname, 
-			"SunOS", 1, 0);
+		set_utsfield(v->sysname, "SunOS", 1, 0);
 		down_read(&uts_sem);
-		set_utsfield(((struct sol_uname *)A(buf))->nodename, 
-			system_utsname.nodename, 1, 1);
+		set_utsfield(v->nodename, system_utsname.nodename, 1, 1);
 		up_read(&uts_sem);
-		set_utsfield(((struct sol_uname *)A(buf))->release, 
-			"2.6", 0, 0);
-		set_utsfield(((struct sol_uname *)A(buf))->version, 
-			"Generic", 0, 0);
-		set_utsfield(((struct sol_uname *)A(buf))->machine, 
-			machine(), 0, 0);
+		set_utsfield(v->release, "2.6", 0, 0);
+		set_utsfield(v->version, "Generic", 0, 0);
+		set_utsfield(v->machine, machine(), 0, 0);
 		return 0;
 	case 2: /* ustat */
 		return -ENOSYS;
@@ -245,18 +241,14 @@ asmlinkage int solaris_utssys(u32 buf, u32 flags, int which, u32 buf2)
 
 asmlinkage int solaris_utsname(u32 buf)
 {
+	struct sol_utsname __user *v = A(buf);
 	/* Why should we not lie a bit? */
 	down_read(&uts_sem);
-	set_utsfield(((struct sol_utsname *)A(buf))->sysname, 
-			"SunOS", 0, 0);
-	set_utsfield(((struct sol_utsname *)A(buf))->nodename, 
-			system_utsname.nodename, 1, 1);
-	set_utsfield(((struct sol_utsname *)A(buf))->release, 
-			"5.6", 0, 0);
-	set_utsfield(((struct sol_utsname *)A(buf))->version, 
-			"Generic", 0, 0);
-	set_utsfield(((struct sol_utsname *)A(buf))->machine, 
-			machine(), 0, 0);
+	set_utsfield(v->sysname, "SunOS", 0, 0);
+	set_utsfield(v->nodename, system_utsname.nodename, 1, 1);
+	set_utsfield(v->release, "5.6", 0, 0);
+	set_utsfield(v->version, "Generic", 0, 0);
+	set_utsfield(v->machine, machine(), 0, 0);
 	up_read(&uts_sem);
 	return 0;
 }
@@ -302,11 +294,11 @@ asmlinkage int solaris_sysinfo(int cmd, u32 buf, s32 count)
 	}
 	len = strlen(r) + 1;
 	if (count < len) {
-		if (copy_to_user((char *)A(buf), r, count - 1) ||
-		    __put_user(0, (char *)A(buf) + count - 1))
+		if (copy_to_user(A(buf), r, count - 1) ||
+		    __put_user(0, (char __user *)A(buf) + count - 1))
 			return -EFAULT;
 	} else {
-		if (copy_to_user((char *)A(buf), r, len))
+		if (copy_to_user(A(buf), r, len))
 			return -EFAULT;
 	}
 	return len;
@@ -453,7 +445,7 @@ struct rlimit32 {
 	u32	rlim_max;
 };
 
-asmlinkage int solaris_getrlimit(unsigned int resource, struct rlimit32 *rlim)
+asmlinkage int solaris_getrlimit(unsigned int resource, struct rlimit32 __user *rlim)
 {
 	struct rlimit r;
 	int ret;
@@ -486,15 +478,15 @@ asmlinkage int solaris_getrlimit(unsigned int resource, struct rlimit32 *rlim)
 	return ret;
 }
 
-asmlinkage int solaris_setrlimit(unsigned int resource, struct rlimit32 *rlim)
+asmlinkage int solaris_setrlimit(unsigned int resource, struct rlimit32 __user *rlim)
 {
 	struct rlimit r, rold;
 	int ret;
 	mm_segment_t old_fs = get_fs ();
-	int (*sys_getrlimit)(unsigned int, struct rlimit *) =
-		(int (*)(unsigned int, struct rlimit *))SYS(getrlimit);
-	int (*sys_setrlimit)(unsigned int, struct rlimit *) =
-		(int (*)(unsigned int, struct rlimit *))SYS(setrlimit);
+	int (*sys_getrlimit)(unsigned int, struct rlimit __user *) =
+		(int (*)(unsigned int, struct rlimit __user *))SYS(getrlimit);
+	int (*sys_setrlimit)(unsigned int, struct rlimit __user *) =
+		(int (*)(unsigned int, struct rlimit __user *))SYS(setrlimit);
 
 	if (resource > RLIMIT_SOL_VMEM)
 		return -EINVAL;	
@@ -527,13 +519,13 @@ asmlinkage int solaris_setrlimit(unsigned int resource, struct rlimit32 *rlim)
 	return ret;
 }
 
-asmlinkage int solaris_getrlimit64(unsigned int resource, struct rlimit *rlim)
+asmlinkage int solaris_getrlimit64(unsigned int resource, struct rlimit __user *rlim)
 {
 	struct rlimit r;
 	int ret;
 	mm_segment_t old_fs = get_fs ();
-	int (*sys_getrlimit)(unsigned int, struct rlimit *) =
-		(int (*)(unsigned int, struct rlimit *))SYS(getrlimit);
+	int (*sys_getrlimit)(unsigned int, struct rlimit __user *) =
+		(int (*)(unsigned int, struct rlimit __user *))SYS(getrlimit);
 
 	if (resource > RLIMIT_SOL_VMEM)
 		return -EINVAL;	
@@ -556,15 +548,15 @@ asmlinkage int solaris_getrlimit64(unsigned int resource, struct rlimit *rlim)
 	return ret;
 }
 
-asmlinkage int solaris_setrlimit64(unsigned int resource, struct rlimit *rlim)
+asmlinkage int solaris_setrlimit64(unsigned int resource, struct rlimit __user *rlim)
 {
 	struct rlimit r, rold;
 	int ret;
 	mm_segment_t old_fs = get_fs ();
-	int (*sys_getrlimit)(unsigned int, struct rlimit *) =
-		(int (*)(unsigned int, struct rlimit *))SYS(getrlimit);
-	int (*sys_setrlimit)(unsigned int, struct rlimit *) =
-		(int (*)(unsigned int, struct rlimit *))SYS(setrlimit);
+	int (*sys_getrlimit)(unsigned int, struct rlimit __user *) =
+		(int (*)(unsigned int, struct rlimit __user *))SYS(getrlimit);
+	int (*sys_setrlimit)(unsigned int, struct rlimit __user *) =
+		(int (*)(unsigned int, struct rlimit __user *))SYS(setrlimit);
 
 	if (resource > RLIMIT_SOL_VMEM)
 		return -EINVAL;	
@@ -623,10 +615,10 @@ struct sol_timex {
 	s32 stbcnt;
 };
 
-asmlinkage int solaris_ntp_gettime(struct sol_ntptimeval *ntp)
+asmlinkage int solaris_ntp_gettime(struct sol_ntptimeval __user *ntp)
 {
-	int (*sys_adjtimex)(struct timex *) =
-		(int (*)(struct timex *))SYS(adjtimex);
+	int (*sys_adjtimex)(struct timex __user *) =
+		(int (*)(struct timex __user *))SYS(adjtimex);
 	struct timex t;
 	int ret;
 	mm_segment_t old_fs = get_fs();
@@ -644,10 +636,10 @@ asmlinkage int solaris_ntp_gettime(struct sol_ntptimeval *ntp)
 	return ret;	                        
 }
 
-asmlinkage int solaris_ntp_adjtime(struct sol_timex *txp)
+asmlinkage int solaris_ntp_adjtime(struct sol_timex __user *txp)
 {
-	int (*sys_adjtimex)(struct timex *) =
-		(int (*)(struct timex *))SYS(adjtimex);
+	int (*sys_adjtimex)(struct timex __user *) =
+		(int (*)(struct timex __user *))SYS(adjtimex);
 	struct timex t;
 	int ret, err;
 	mm_segment_t old_fs = get_fs();
diff --git a/arch/sparc64/solaris/signal.c b/arch/sparc64/solaris/signal.c
index 72f126c3d..7fa2634e2 100644
--- a/arch/sparc64/solaris/signal.c
+++ b/arch/sparc64/solaris/signal.c
@@ -76,8 +76,8 @@ static long sig_handler(int sig, u32 arg, int one_shot)
 	struct sigaction sa, old;
 	int ret;
 	mm_segment_t old_fs = get_fs();
-	int (*sys_sigaction)(int,struct sigaction *,struct sigaction *) = 
-		(int (*)(int,struct sigaction *,struct sigaction *))SYS(sigaction);
+	int (*sys_sigaction)(int,struct sigaction __user *,struct sigaction __user *) = 
+		(int (*)(int,struct sigaction __user *,struct sigaction __user *))SYS(sigaction);
 	
 	sigemptyset(&sa.sa_mask);
 	sa.sa_restorer = NULL;
@@ -85,10 +85,10 @@ static long sig_handler(int sig, u32 arg, int one_shot)
 	sa.sa_flags = 0;
 	if (one_shot) sa.sa_flags = SA_ONESHOT | SA_NOMASK;
 	set_fs (KERNEL_DS);
-	ret = sys_sigaction(sig, &sa, &old);
+	ret = sys_sigaction(sig, (void __user *)&sa, (void __user *)&old);
 	set_fs (old_fs);
 	if (ret < 0) return ret;
-	return (u32)(long)old.sa_handler;
+	return (u32)(unsigned long)old.sa_handler;
 }
 
 static inline long solaris_signal(int sig, u32 arg)
@@ -129,7 +129,7 @@ static inline long solaris_sigrelse(int sig)
 
 static inline long solaris_sigignore(int sig)
 {
-	return sig_handler (sig, (u32)SIG_IGN, 0);
+	return sig_handler(sig, (u32)(unsigned long)SIG_IGN, 0);
 }
 
 static inline long solaris_sigpause(int sig)
@@ -207,21 +207,22 @@ asmlinkage int solaris_sigprocmask(int how, u32 in, u32 out)
 	sigset_t in_s, *ins, out_s, *outs;
 	mm_segment_t old_fs = get_fs();
 	int ret;
-	int (*sys_sigprocmask)(int,sigset_t *,sigset_t *) = 
-		(int (*)(int,sigset_t *,sigset_t *))SYS(sigprocmask);
+	int (*sys_sigprocmask)(int,sigset_t __user *,sigset_t __user *) = 
+		(int (*)(int,sigset_t __user *,sigset_t __user *))SYS(sigprocmask);
 	
 	ins = NULL; outs = NULL;
 	if (in) {
 		u32 tmp[2];
 		
-		if (copy_from_user (tmp, (sol_sigset_t *)A(in), 2*sizeof(u32)))
+		if (copy_from_user (tmp, (void __user *)A(in), 2*sizeof(u32)))
 			return -EFAULT;
 		ins = &in_s;
 		if (mapin (tmp, ins)) return -EINVAL;
 	}
 	if (out) outs = &out_s;
 	set_fs (KERNEL_DS);
-	ret = sys_sigprocmask((how == 3) ? SIG_SETMASK : how, ins, outs);
+	ret = sys_sigprocmask((how == 3) ? SIG_SETMASK : how,
+				(void __user *)ins, (void __user *)outs);
 	set_fs (old_fs);
 	if (ret) return ret;
 	if (out) {
@@ -229,7 +230,7 @@ asmlinkage int solaris_sigprocmask(int how, u32 in, u32 out)
 		
 		tmp[2] = 0; tmp[3] = 0;
 		if (mapout (outs, tmp)) return -EINVAL;
-		if (copy_to_user((sol_sigset_t *)A(out), tmp, 4*sizeof(u32)))
+		if (copy_to_user((void __user *)A(out), tmp, 4*sizeof(u32)))
 			return -EFAULT;
 	}
 	return 0;
@@ -240,7 +241,7 @@ asmlinkage long do_sol_sigsuspend(u32 mask)
 	sigset_t s;
 	u32 tmp[2];
 		
-	if (copy_from_user (tmp, (sol_sigset_t *)A(mask), 2*sizeof(u32)))
+	if (copy_from_user (tmp, (sol_sigset_t __user *)A(mask), 2*sizeof(u32)))
 		return -EFAULT;
 	if (mapin (tmp, &s)) return -EINVAL;
 	return (long)s.sig[0];
@@ -259,18 +260,19 @@ asmlinkage int solaris_sigaction(int sig, u32 act, u32 old)
 	struct sigaction s, s2;
 	int ret;
 	mm_segment_t old_fs = get_fs();
-	int (*sys_sigaction)(int,struct sigaction *,struct sigaction *) = 
-		(int (*)(int,struct sigaction *,struct sigaction *))SYS(sigaction);
+	struct sol_sigaction __user *p = (void __user *)A(old);
+	int (*sys_sigaction)(int,struct sigaction __user *,struct sigaction __user *) = 
+		(int (*)(int,struct sigaction __user *,struct sigaction __user *))SYS(sigaction);
 	
 	sig = mapsig(sig); 
 	if (sig < 0) {
 		/* We cheat a little bit for Solaris only signals */
-		if (old && clear_user((struct sol_sigaction *)A(old), sizeof(struct sol_sigaction)))
+		if (old && clear_user(p, sizeof(struct sol_sigaction)))
 			return -EFAULT;
 		return 0;
 	}
 	if (act) {
-		if (get_user (tmp, &((struct sol_sigaction *)A(act))->sa_flags))
+		if (get_user (tmp, &p->sa_flags))
 			return -EFAULT;
 		s.sa_flags = 0;
 		if (tmp & SOLARIS_SA_ONSTACK) s.sa_flags |= SA_STACK;
@@ -278,15 +280,16 @@ asmlinkage int solaris_sigaction(int sig, u32 act, u32 old)
 		if (tmp & SOLARIS_SA_NODEFER) s.sa_flags |= SA_NOMASK;
 		if (tmp & SOLARIS_SA_RESETHAND) s.sa_flags |= SA_ONESHOT;
 		if (tmp & SOLARIS_SA_NOCLDSTOP) s.sa_flags |= SA_NOCLDSTOP;
-		if (get_user (tmp, &((struct sol_sigaction *)A(act))->sa_handler) ||
-		    copy_from_user (tmp2, &((struct sol_sigaction *)A(act))->sa_mask, 2*sizeof(u32)))
+		if (get_user (tmp, &p->sa_handler) ||
+		    copy_from_user (tmp2, &p->sa_mask, 2*sizeof(u32)))
 			return -EFAULT;
 		s.sa_handler = (__sighandler_t)A(tmp);
 		if (mapin (tmp2, &s.sa_mask)) return -EINVAL;
-		s.sa_restorer = 0;
+		s.sa_restorer = NULL;
 	}
 	set_fs(KERNEL_DS);
-	ret = sys_sigaction(sig, act ? &s : NULL, old ? &s2 : NULL);
+	ret = sys_sigaction(sig, act ? (void __user *)&s : NULL,
+				 old ? (void __user *)&s2 : NULL);
 	set_fs(old_fs);
 	if (ret) return ret;
 	if (old) {
@@ -297,9 +300,9 @@ asmlinkage int solaris_sigaction(int sig, u32 act, u32 old)
 		if (s2.sa_flags & SA_NOMASK) tmp |= SOLARIS_SA_NODEFER;
 		if (s2.sa_flags & SA_ONESHOT) tmp |= SOLARIS_SA_RESETHAND;
 		if (s2.sa_flags & SA_NOCLDSTOP) tmp |= SOLARIS_SA_NOCLDSTOP;
-		if (put_user (tmp, &((struct sol_sigaction *)A(old))->sa_flags) ||
-		    __put_user ((u32)(long)s2.sa_handler, &((struct sol_sigaction *)A(old))->sa_handler) ||
-		    copy_to_user (&((struct sol_sigaction *)A(old))->sa_mask, tmp2, 4*sizeof(u32)))
+		if (put_user (tmp, &p->sa_flags) ||
+		    __put_user ((u32)(unsigned long)s2.sa_handler, &p->sa_handler) ||
+		    copy_to_user (&p->sa_mask, tmp2, 4*sizeof(u32)))
 			return -EFAULT;
 	}
 	return 0;
@@ -323,26 +326,27 @@ asmlinkage int solaris_sigpending(int which, u32 set)
 	}
 	if (mapout (&s, tmp)) return -EINVAL;
 	tmp[2] = 0; tmp[3] = 0;
-	if (copy_to_user ((u32 *)A(set), tmp, sizeof(tmp)))
+	if (copy_to_user ((u32 __user *)A(set), tmp, sizeof(tmp)))
 		return -EFAULT;
 	return 0;
 }
 
 asmlinkage int solaris_wait(u32 stat_loc)
 {
-	int (*sys_wait4)(pid_t,unsigned int *, int, struct rusage *) =
-		(int (*)(pid_t,unsigned int *, int, struct rusage *))SYS(wait4);
+	unsigned __user *p = (unsigned __user *)A(stat_loc);
+	int (*sys_wait4)(pid_t,unsigned __user *, int, struct rusage __user *) =
+		(int (*)(pid_t,unsigned __user *, int, struct rusage __user *))SYS(wait4);
 	int ret, status;
 	
-	ret = sys_wait4(-1, (unsigned int *)A(stat_loc), WUNTRACED, NULL);
+	ret = sys_wait4(-1, p, WUNTRACED, NULL);
 	if (ret >= 0 && stat_loc) {
-		if (get_user (status, (unsigned int *)A(stat_loc)))
+		if (get_user (status, p))
 			return -EFAULT;
 		if (((status - 1) & 0xffff) < 0xff)
 			status = linux_to_solaris_signals[status & 0x7f] & 0x7f;
 		else if ((status & 0xff) == 0x7f)
 			status = (linux_to_solaris_signals[(status >> 8) & 0xff] << 8) | 0x7f;
-		if (__put_user (status, (unsigned int *)A(stat_loc)))
+		if (__put_user (status, p))
 			return -EFAULT;
 	}
 	return ret;
@@ -350,8 +354,8 @@ asmlinkage int solaris_wait(u32 stat_loc)
 
 asmlinkage int solaris_waitid(int idtype, s32 pid, u32 info, int options)
 {
-	int (*sys_wait4)(pid_t,unsigned int *, int, struct rusage *) =
-		(int (*)(pid_t,unsigned int *, int, struct rusage *))SYS(wait4);
+	int (*sys_wait4)(pid_t,unsigned __user *, int, struct rusage __user *) =
+		(int (*)(pid_t,unsigned __user *, int, struct rusage __user *))SYS(wait4);
 	int opts, status, ret;
 	
 	switch (idtype) {
@@ -364,12 +368,12 @@ asmlinkage int solaris_waitid(int idtype, s32 pid, u32 info, int options)
 	if (options & SOLARIS_WUNTRACED) opts |= WUNTRACED;
 	if (options & SOLARIS_WNOHANG) opts |= WNOHANG;
 	current->state = TASK_RUNNING;
-	ret = sys_wait4(pid, (unsigned int *)A(info), opts, NULL);
+	ret = sys_wait4(pid, (unsigned int __user *)A(info), opts, NULL);
 	if (ret < 0) return ret;
 	if (info) {
-		struct sol_siginfo *s = (struct sol_siginfo *)A(info);
+		struct sol_siginfo __user *s = (void __user *)A(info);
 	
-		if (get_user (status, (unsigned int *)A(info)))
+		if (get_user (status, (unsigned int __user *)A(info)))
 			return -EFAULT;
 
 		if (__put_user (SOLARIS_SIGCLD, &s->si_signo) ||
diff --git a/arch/sparc64/solaris/socket.c b/arch/sparc64/solaris/socket.c
index fb7978dd7..ec8e074c4 100644
--- a/arch/sparc64/solaris/socket.c
+++ b/arch/sparc64/solaris/socket.c
@@ -132,18 +132,18 @@ asmlinkage int solaris_getsockopt(int fd, int level, int optname, u32 optval, u3
 	return sunos_getsockopt(fd, level, optname, optval, optlen);
 }
 
-asmlinkage int solaris_connect(int fd, struct sockaddr *addr, int addrlen)
+asmlinkage int solaris_connect(int fd, struct sockaddr __user *addr, int addrlen)
 {
-	int (*sys_connect)(int, struct sockaddr *, int) =
-		(int (*)(int, struct sockaddr *, int))SYS(connect);
+	int (*sys_connect)(int, struct sockaddr __user *, int) =
+		(int (*)(int, struct sockaddr __user *, int))SYS(connect);
 
 	return sys_connect(fd, addr, addrlen);
 }
 
-asmlinkage int solaris_accept(int fd, struct sockaddr *addr, int *addrlen)
+asmlinkage int solaris_accept(int fd, struct sockaddr __user *addr, int __user *addrlen)
 {
-	int (*sys_accept)(int, struct sockaddr *, int *) =
-		(int (*)(int, struct sockaddr *, int *))SYS(accept);
+	int (*sys_accept)(int, struct sockaddr __user *, int __user *) =
+		(int (*)(int, struct sockaddr __user *, int __user *))SYS(accept);
 
 	return sys_accept(fd, addr, addrlen);
 }
@@ -197,28 +197,28 @@ static int linux_to_solaris_msgflags(int flags)
 	return fl;
 }
 
-asmlinkage int solaris_recvfrom(int s, char *buf, int len, int flags, u32 from, u32 fromlen)
+asmlinkage int solaris_recvfrom(int s, char __user *buf, int len, int flags, u32 from, u32 fromlen)
 {
-	int (*sys_recvfrom)(int, void *, size_t, unsigned, struct sockaddr *, int *) =
-		(int (*)(int, void *, size_t, unsigned, struct sockaddr *, int *))SYS(recvfrom);
+	int (*sys_recvfrom)(int, void __user *, size_t, unsigned, struct sockaddr __user *, int __user *) =
+		(int (*)(int, void __user *, size_t, unsigned, struct sockaddr __user *, int __user *))SYS(recvfrom);
 	
-	return sys_recvfrom(s, buf, len, solaris_to_linux_msgflags(flags), (struct sockaddr *)A(from), (int *)A(fromlen));
+	return sys_recvfrom(s, buf, len, solaris_to_linux_msgflags(flags), A(from), A(fromlen));
 }
 
-asmlinkage int solaris_recv(int s, char *buf, int len, int flags)
+asmlinkage int solaris_recv(int s, char __user *buf, int len, int flags)
 {
-	int (*sys_recvfrom)(int, void *, size_t, unsigned, struct sockaddr *, int *) =
-		(int (*)(int, void *, size_t, unsigned, struct sockaddr *, int *))SYS(recvfrom);
+	int (*sys_recvfrom)(int, void __user *, size_t, unsigned, struct sockaddr __user *, int __user *) =
+		(int (*)(int, void __user *, size_t, unsigned, struct sockaddr __user *, int __user *))SYS(recvfrom);
 	
 	return sys_recvfrom(s, buf, len, solaris_to_linux_msgflags(flags), NULL, NULL);
 }
 
-asmlinkage int solaris_sendto(int s, char *buf, int len, int flags, u32 to, u32 tolen)
+asmlinkage int solaris_sendto(int s, char __user *buf, int len, int flags, u32 to, u32 tolen)
 {
-	int (*sys_sendto)(int, void *, size_t, unsigned, struct sockaddr *, int *) =
-		(int (*)(int, void *, size_t, unsigned, struct sockaddr *, int *))SYS(sendto);
+	int (*sys_sendto)(int, void __user *, size_t, unsigned, struct sockaddr __user *, int __user *) =
+		(int (*)(int, void __user *, size_t, unsigned, struct sockaddr __user *, int __user *))SYS(sendto);
 	
-	return sys_sendto(s, buf, len, solaris_to_linux_msgflags(flags), (struct sockaddr *)A(to), (int *)A(tolen));
+	return sys_sendto(s, buf, len, solaris_to_linux_msgflags(flags), A(to), A(tolen));
 }
 
 asmlinkage int solaris_send(int s, char *buf, int len, int flags)
@@ -269,7 +269,7 @@ struct sol_cmsghdr {
 };
 
 static inline int msghdr_from_user32_to_kern(struct msghdr *kmsg,
-					     struct sol_nmsghdr *umsg)
+					     struct sol_nmsghdr __user *umsg)
 {
 	u32 tmp1, tmp2, tmp3;
 	int err;
@@ -280,9 +280,9 @@ static inline int msghdr_from_user32_to_kern(struct msghdr *kmsg,
 	if (err)
 		return -EFAULT;
 
-	kmsg->msg_name = (void *)A(tmp1);
-	kmsg->msg_iov = (struct iovec *)A(tmp2);
-	kmsg->msg_control = (void *)A(tmp3);
+	kmsg->msg_name = A(tmp1);
+	kmsg->msg_iov = A(tmp2);
+	kmsg->msg_control = A(tmp3);
 
 	err = get_user(kmsg->msg_namelen, &umsg->msg_namelen);
 	err |= get_user(kmsg->msg_controllen, &umsg->msg_controllen);
@@ -293,7 +293,7 @@ static inline int msghdr_from_user32_to_kern(struct msghdr *kmsg,
 	return err;
 }
 
-asmlinkage int solaris_sendmsg(int fd, struct sol_nmsghdr *user_msg, unsigned user_flags)
+asmlinkage int solaris_sendmsg(int fd, struct sol_nmsghdr __user *user_msg, unsigned user_flags)
 {
 	struct socket *sock;
 	char address[MAX_SOCK_ADDR];
@@ -313,7 +313,7 @@ asmlinkage int solaris_sendmsg(int fd, struct sol_nmsghdr *user_msg, unsigned us
 	total_len = err;
 
 	if(kern_msg.msg_controllen) {
-		struct sol_cmsghdr *ucmsg = (struct sol_cmsghdr *)kern_msg.msg_control;
+		struct sol_cmsghdr __user *ucmsg = kern_msg.msg_control;
 		unsigned long *kcmsg;
 		compat_size_t cmlen;
 
@@ -356,15 +356,15 @@ out:
 	return err;
 }
 
-asmlinkage int solaris_recvmsg(int fd, struct sol_nmsghdr *user_msg, unsigned int user_flags)
+asmlinkage int solaris_recvmsg(int fd, struct sol_nmsghdr __user *user_msg, unsigned int user_flags)
 {
 	struct iovec iovstack[UIO_FASTIOV];
 	struct msghdr kern_msg;
 	char addr[MAX_SOCK_ADDR];
 	struct socket *sock;
 	struct iovec *iov = iovstack;
-	struct sockaddr *uaddr;
-	int *uaddr_len;
+	struct sockaddr __user *uaddr;
+	int __user *uaddr_len;
 	unsigned long cmsg_ptr;
 	int err, total_len, len = 0;
 
diff --git a/arch/sparc64/solaris/timod.c b/arch/sparc64/solaris/timod.c
index feebc8296..24de50620 100644
--- a/arch/sparc64/solaris/timod.c
+++ b/arch/sparc64/solaris/timod.c
@@ -219,7 +219,7 @@ static void timod_ok(unsigned int fd, int prim)
 	SOLD("done");
 }
 
-static int timod_optmgmt(unsigned int fd, int flag, char *opt_buf, int opt_len, int do_ret)
+static int timod_optmgmt(unsigned int fd, int flag, char __user *opt_buf, int opt_len, int do_ret)
 {
 	int error, failed;
 	int ret_space, ret_len;
@@ -337,8 +337,8 @@ static int timod_optmgmt(unsigned int fd, int flag, char *opt_buf, int opt_len,
 	return 0;
 }
 
-int timod_putmsg(unsigned int fd, char *ctl_buf, int ctl_len,
-			char *data_buf, int data_len, int flags)
+int timod_putmsg(unsigned int fd, char __user *ctl_buf, int ctl_len,
+			char __user *data_buf, int data_len, int flags)
 {
 	int ret, error, terror;
 	char *buf;
@@ -347,15 +347,15 @@ int timod_putmsg(unsigned int fd, char *ctl_buf, int ctl_len,
 	struct sol_socket_struct *sock;
 	mm_segment_t old_fs = get_fs();
 	long args[6];
-	int (*sys_socketcall)(int, unsigned long *) =
-		(int (*)(int, unsigned long *))SYS(socketcall);
-	int (*sys_sendto)(int, void *, size_t, unsigned, struct sockaddr *, int) =
-		(int (*)(int, void *, size_t, unsigned, struct sockaddr *, int))SYS(sendto);
+	int (*sys_socketcall)(int, unsigned long __user *) =
+		(int (*)(int, unsigned long __user *))SYS(socketcall);
+	int (*sys_sendto)(int, void __user *, size_t, unsigned, struct sockaddr __user *, int) =
+		(int (*)(int, void __user *, size_t, unsigned, struct sockaddr __user *, int))SYS(sendto);
 	filp = current->files->fd[fd];
 	ino = filp->f_dentry->d_inode;
 	sock = (struct sol_socket_struct *)filp->private_data;
 	SOLD("entry");
-	if (get_user(ret, (int *)A(ctl_buf)))
+	if (get_user(ret, (int __user *)A(ctl_buf)))
 		return -EFAULT;
 	switch (ret) {
 	case T_BIND_REQ:
@@ -596,7 +596,7 @@ int timod_putmsg(unsigned int fd, char *ctl_buf, int ctl_len,
 			printk("\n");
 		}
 #endif		
-		err = sys_sendto(fd, data_buf, data_len, 0, req.DEST_length > 0 ? (struct sockaddr*)(ctl_buf+req.DEST_offset) : NULL, req.DEST_length);
+		err = sys_sendto(fd, data_buf, data_len, 0, req.DEST_length > 0 ? (struct sockaddr __user *)(ctl_buf+req.DEST_offset) : NULL, req.DEST_length);
 		if (err == data_len)
 			return 0;
 		if(err >= 0) {
@@ -613,8 +613,8 @@ int timod_putmsg(unsigned int fd, char *ctl_buf, int ctl_len,
 	return -EINVAL;
 }
 
-int timod_getmsg(unsigned int fd, char *ctl_buf, int ctl_maxlen, s32 *ctl_len,
-			char *data_buf, int data_maxlen, s32 *data_len, int *flags_p)
+int timod_getmsg(unsigned int fd, char __user *ctl_buf, int ctl_maxlen, s32 __user *ctl_len,
+			char __user *data_buf, int data_maxlen, s32 __user *data_len, int *flags_p)
 {
 	int error;
 	int oldflags;
@@ -624,11 +624,11 @@ int timod_getmsg(unsigned int fd, char *ctl_buf, int ctl_maxlen, s32 *ctl_len,
 	struct T_unitdata_ind udi;
 	mm_segment_t old_fs = get_fs();
 	long args[6];
-	char *tmpbuf;
+	char __user *tmpbuf;
 	int tmplen;
-	int (*sys_socketcall)(int, unsigned long *) =
-		(int (*)(int, unsigned long *))SYS(socketcall);
-	int (*sys_recvfrom)(int, void *, size_t, unsigned, struct sockaddr *, int *);
+	int (*sys_socketcall)(int, unsigned long __user *) =
+		(int (*)(int, unsigned long __user *))SYS(socketcall);
+	int (*sys_recvfrom)(int, void __user *, size_t, unsigned, struct sockaddr __user *, int __user *);
 	
 	SOLD("entry");
 	SOLDD(("%u %p %d %p %p %d %p %d\n", fd, ctl_buf, ctl_maxlen, ctl_len, data_buf, data_maxlen, data_len, *flags_p));
@@ -808,8 +808,8 @@ int timod_getmsg(unsigned int fd, char *ctl_buf, int ctl_maxlen, s32 *ctl_len,
 	oldflags = filp->f_flags;
 	filp->f_flags |= O_NONBLOCK;
 	SOLD("calling recvfrom");
-	sys_recvfrom = (int (*)(int, void *, size_t, unsigned, struct sockaddr *, int *))SYS(recvfrom);
-	error = sys_recvfrom(fd, data_buf, data_maxlen, 0, (struct sockaddr*)tmpbuf, ctl_len);
+	sys_recvfrom = (int (*)(int, void __user *, size_t, unsigned, struct sockaddr __user *, int __user *))SYS(recvfrom);
+	error = sys_recvfrom(fd, data_buf, data_maxlen, 0, (struct sockaddr __user *)tmpbuf, ctl_len);
 	filp->f_flags = oldflags;
 	if (error < 0)
 		return error;
@@ -838,9 +838,10 @@ asmlinkage int solaris_getmsg(unsigned int fd, u32 arg1, u32 arg2, u32 arg3)
 {
 	struct file *filp;
 	struct inode *ino;
-	struct strbuf *ctlptr, *datptr;
+	struct strbuf __user *ctlptr;
+	struct strbuf __user *datptr;
 	struct strbuf ctl, dat;
-	int *flgptr;
+	int __user *flgptr;
 	int flags;
 	int error = -EBADF;
 
@@ -857,9 +858,9 @@ asmlinkage int solaris_getmsg(unsigned int fd, u32 arg1, u32 arg2, u32 arg3)
 	if (!ino->i_sock)
 		goto out;
 
-	ctlptr = (struct strbuf *)A(arg1);
-	datptr = (struct strbuf *)A(arg2);
-	flgptr = (int *)A(arg3);
+	ctlptr = (struct strbuf __user *)A(arg1);
+	datptr = (struct strbuf __user *)A(arg2);
+	flgptr = (int __user *)A(arg3);
 
 	error = -EFAULT;
 
@@ -891,8 +892,8 @@ asmlinkage int solaris_getmsg(unsigned int fd, u32 arg1, u32 arg2, u32 arg3)
 		goto out;
 	}
 
-	error = timod_getmsg(fd,(char*)A(ctl.buf),ctl.maxlen,&ctlptr->len,
-				(char*)A(dat.buf),dat.maxlen,&datptr->len,&flags);
+	error = timod_getmsg(fd,A(ctl.buf),ctl.maxlen,&ctlptr->len,
+				A(dat.buf),dat.maxlen,&datptr->len,&flags);
 
 	if (!error && put_user(flags,flgptr))
 		error = -EFAULT;
@@ -906,7 +907,8 @@ asmlinkage int solaris_putmsg(unsigned int fd, u32 arg1, u32 arg2, u32 arg3)
 {
 	struct file *filp;
 	struct inode *ino;
-	struct strbuf *ctlptr, *datptr;
+	struct strbuf __user *ctlptr;
+	struct strbuf __user *datptr;
 	struct strbuf ctl, dat;
 	int flags = (int) arg3;
 	int error = -EBADF;
@@ -925,8 +927,8 @@ asmlinkage int solaris_putmsg(unsigned int fd, u32 arg1, u32 arg2, u32 arg3)
 		(imajor(ino) != 30 || iminor(ino) != 1))
 		goto out;
 
-	ctlptr = (struct strbuf *)A(arg1);
-	datptr = (struct strbuf *)A(arg2);
+	ctlptr = A(arg1);
+	datptr = A(arg2);
 
 	error = -EFAULT;
 
@@ -950,8 +952,8 @@ asmlinkage int solaris_putmsg(unsigned int fd, u32 arg1, u32 arg2, u32 arg3)
 		dat.buf = 0;
 	}
 
-	error = timod_putmsg(fd,(char*)A(ctl.buf),ctl.len,
-				(char*)A(dat.buf),dat.len,flags);
+	error = timod_putmsg(fd,A(ctl.buf),ctl.len,
+				A(dat.buf),dat.len,flags);
 out:
 	unlock_kernel();
 	SOLD("done");
diff --git a/arch/um/config.release b/arch/um/config.release
index 82d3badeb..6d32bc20c 100644
--- a/arch/um/config.release
+++ b/arch/um/config.release
@@ -104,7 +104,6 @@ CONFIG_INET=y
 # 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
 
 #
diff --git a/arch/um/defconfig b/arch/um/defconfig
index 3430e124a..412d006b9 100644
--- a/arch/um/defconfig
+++ b/arch/um/defconfig
@@ -148,7 +148,6 @@ CONFIG_IPV6_SCTP__=y
 # 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
 
 #
diff --git a/arch/um/drivers/harddog_kern.c b/arch/um/drivers/harddog_kern.c
index e3f3cddea..147ec19f6 100644
--- a/arch/um/drivers/harddog_kern.c
+++ b/arch/um/drivers/harddog_kern.c
@@ -82,7 +82,7 @@ static int harddog_open(struct inode *inode, struct file *file)
 
 	timer_alive = 1;
 	unlock_kernel();
-	return 0;
+	return nonseekable_open(inode, file);
 }
 
 extern void stop_watchdog(int in_fd, int out_fd);
@@ -108,10 +108,6 @@ extern int ping_watchdog(int fd);
 static ssize_t harddog_write(struct file *file, const char *data, size_t len,
 			     loff_t *ppos)
 {
-	/*  Can't seek (pwrite) on this device  */
-	if (ppos != &file->f_pos)
-		return -ESPIPE;
-
 	/*
 	 *	Refresh the timer.
 	 */
diff --git a/arch/um/kernel/init_task.c b/arch/um/kernel/init_task.c
index 7d6bb961d..be82cafe9 100644
--- a/arch/um/kernel/init_task.c
+++ b/arch/um/kernel/init_task.c
@@ -9,6 +9,7 @@
 #include "linux/sched.h"
 #include "linux/init_task.h"
 #include "linux/version.h"
+#include "linux/mqueue.h"
 #include "asm/uaccess.h"
 #include "asm/pgtable.h"
 #include "user_util.h"
diff --git a/arch/um/kernel/irq.c b/arch/um/kernel/irq.c
index 5f6c8502a..0e968bb11 100644
--- a/arch/um/kernel/irq.c
+++ b/arch/um/kernel/irq.c
@@ -419,7 +419,7 @@ int request_irq(unsigned int irq,
 
 	action->handler = handler;
 	action->flags = irqflags;
-	action->mask = 0;
+	cpus_clear(action->mask);
 	action->name = devname;
 	action->next = NULL;
 	action->dev_id = dev_id;
diff --git a/arch/um/kernel/mem.c b/arch/um/kernel/mem.c
index ec2be14be..84a895c2a 100644
--- a/arch/um/kernel/mem.c
+++ b/arch/um/kernel/mem.c
@@ -380,7 +380,7 @@ void show_mem(void)
 
         printk("Mem-info:\n");
         show_free_areas();
-        printk("Free swap:       %6dkB\n", nr_swap_pages<<(PAGE_SHIFT-10));
+        printk("Free swap:       %6ldkB\n", nr_swap_pages<<(PAGE_SHIFT-10));
         pfn = max_mapnr;
         while(pfn-- > 0) {
 		page = pfn_to_page(pfn);
diff --git a/arch/um/kernel/sys_call_table.c b/arch/um/kernel/sys_call_table.c
index 77a7d922e..3948719dc 100644
--- a/arch/um/kernel/sys_call_table.c
+++ b/arch/um/kernel/sys_call_table.c
@@ -237,6 +237,8 @@ extern syscall_handler_t sys_epoll_wait;
 extern syscall_handler_t sys_remap_file_pages;
 extern syscall_handler_t sys_set_tid_address;
 
+extern syscall_handler_t sys_vserver;
+
 #ifdef CONFIG_NFSD
 #define NFSSERVCTL sys_nfsservctl
 #else
@@ -489,6 +491,7 @@ syscall_handler_t *sys_call_table[] = {
 	[ __NR_epoll_wait ] = sys_epoll_wait,
         [ __NR_remap_file_pages ] = sys_remap_file_pages,
         [ __NR_set_tid_address ] = sys_set_tid_address,
+        [ __NR_vserver ] = sys_vserver,
 
 	ARCH_SYSCALLS
 	[ LAST_SYSCALL + 1 ... NR_syscalls ] = 
diff --git a/arch/um/kernel/sysrq.c b/arch/um/kernel/sysrq.c
index ce108f7d6..b43c21466 100644
--- a/arch/um/kernel/sysrq.c
+++ b/arch/um/kernel/sysrq.c
@@ -23,7 +23,7 @@ void show_trace(unsigned long * stack)
         i = 1;
         while (((long) stack & (THREAD_SIZE-1)) != 0) {
                 addr = *stack++;
-		if (kernel_text_address(addr)) {
+		if (__kernel_text_address(addr)) {
 			if (i && ((i % 6) == 0))
 				printk("\n   ");
 			printk("[<%08lx>] ", addr);
diff --git a/arch/um/kernel/user_util.c b/arch/um/kernel/user_util.c
index a953a08c1..9e4fbae93 100644
--- a/arch/um/kernel/user_util.c
+++ b/arch/um/kernel/user_util.c
@@ -34,7 +34,6 @@
 #define COMMAND_LINE_SIZE _POSIX_ARG_MAX
 
 /* Changed in linux_main and setup_arch, which run before SMP is started */
-char saved_command_line[COMMAND_LINE_SIZE] = { 0 };
 char command_line[COMMAND_LINE_SIZE] = { 0 };
 
 void add_arg(char *cmd_line, char *arg)
diff --git a/arch/v850/kernel/as85ep1.c b/arch/v850/kernel/as85ep1.c
index ccdb7fd23..4059b1df1 100644
--- a/arch/v850/kernel/as85ep1.c
+++ b/arch/v850/kernel/as85ep1.c
@@ -57,10 +57,10 @@ void __init mach_early_init (void)
 	AS85EP1_ASC    = 0;
 	AS85EP1_LBS    = 0x00A9;
 
-	AS85EP1_PORT_PMC(6)  = 0xFF; /* A20-25, A0,A1 $BM-8z(B */
-	AS85EP1_PORT_PMC(7)  = 0x0E; /* CS1,2,3       $BM-8z(B */
-	AS85EP1_PORT_PMC(9)  = 0xFF; /* D16-23        $BM-8z(B */
-	AS85EP1_PORT_PMC(10) = 0xFF; /* D24-31        $BM-8z(B */
+	AS85EP1_PORT_PMC(6)  = 0xFF; /* valid A0,A1,A20-A25 */
+	AS85EP1_PORT_PMC(7)  = 0x0E; /* valid CS1-CS3       */
+	AS85EP1_PORT_PMC(9)  = 0xFF; /* valid D16-D23       */
+	AS85EP1_PORT_PMC(10) = 0xFF; /* valid D24-D31       */
 
 	AS85EP1_RFS(1) = 0x800c;
 	AS85EP1_RFS(3) = 0x800c;
@@ -76,7 +76,7 @@ void __init mach_early_init (void)
 	   write to address (N - 0x10).  We avoid this (effectively) by
 	   writing in 16-byte chunks backwards from the end.  */
 
-	AS85EP1_IRAMM = 0x3;	/* $BFbB"L?Na(BRAM$B$O!V(Bwrite-mode$B!W$K$J$j$^$9(B */
+	AS85EP1_IRAMM = 0x3;	/* "write-mode" for the internal instruction memory */
 
 	src = (u32 *)(((u32)&_intv_copy_src_end - 1) & ~0xF);
 	dst = (u32 *)&_intv_copy_dst_start
@@ -88,7 +88,7 @@ void __init mach_early_init (void)
 		src -= 4;
 	} while (src > (u32 *)&_intv_copy_src_start);
 
-	AS85EP1_IRAMM = 0x0;	/* $BFbB"L?Na(BRAM$B$O!V(Bread-mode$B!W$K$J$j$^$9(B */
+	AS85EP1_IRAMM = 0x0;	/* "read-mode" for the internal instruction memory */
 #endif /* !CONFIG_ROM_KERNEL */
 
 	v850e_intc_disable_irqs ();
diff --git a/arch/v850/kernel/as85ep1.ld b/arch/v850/kernel/as85ep1.ld
index 7b7ffccf6..ef2c43990 100644
--- a/arch/v850/kernel/as85ep1.ld
+++ b/arch/v850/kernel/as85ep1.ld
@@ -2,7 +2,7 @@
    (CONFIG_V850E_AS85EP1).  */
 
 MEMORY {
-	/* 1MB of internal memory (Æâ¢̿ÎáRAM).  */
+	/* 1MB of internal instruction memory. */
 	iMEM0 : ORIGIN = 0,	     LENGTH = 0x00100000
 
 	/* 1MB of static RAM.  */
diff --git a/arch/v850/kernel/fpga85e2c.c b/arch/v850/kernel/fpga85e2c.c
index 72dda796f..17e3dbafc 100644
--- a/arch/v850/kernel/fpga85e2c.c
+++ b/arch/v850/kernel/fpga85e2c.c
@@ -168,5 +168,5 @@ static void make_reg_snap (int irq, void *dummy, struct pt_regs *regs)
 
 static int reg_snap_dev_id;
 static struct irqaction reg_snap_action = {
-	make_reg_snap, 0, 0, "reg_snap", &reg_snap_dev_id, 0
+	make_reg_snap, 0, CPU_MASK_NONE, "reg_snap", &reg_snap_dev_id, 0
 };
diff --git a/arch/v850/kernel/init_task.c b/arch/v850/kernel/init_task.c
index a5dac3a83..ed2f93cf7 100644
--- a/arch/v850/kernel/init_task.c
+++ b/arch/v850/kernel/init_task.c
@@ -15,6 +15,7 @@
 #include <linux/init.h>
 #include <linux/init_task.h>
 #include <linux/fs.h>
+#include <linux/mqueue.h>
 
 #include <asm/uaccess.h>
 #include <asm/pgtable.h>
diff --git a/arch/v850/kernel/irq.c b/arch/v850/kernel/irq.c
index a5d918e71..89809fb98 100644
--- a/arch/v850/kernel/irq.c
+++ b/arch/v850/kernel/irq.c
@@ -1,8 +1,8 @@
 /*
  * arch/v850/kernel/irq.c -- High-level interrupt handling
  *
- *  Copyright (C) 2001,02,03  NEC Electronics Corporation
- *  Copyright (C) 2001,02,03  Miles Bader <miles@gnu.org>
+ *  Copyright (C) 2001,02,03,04  NEC Electronics Corporation
+ *  Copyright (C) 2001,02,03,04  Miles Bader <miles@gnu.org>
  *  Copyright (C) 1994-2000  Ralf Baechle
  *  Copyright (C) 1992  Linus Torvalds
  *
@@ -40,7 +40,10 @@ irq_desc_t irq_desc[NR_IRQS] __cacheline_aligned = {
  * Special irq handlers.
  */
 
-irqreturn_t no_action(int cpl, void *dev_id, struct pt_regs *regs) { }
+irqreturn_t no_action(int cpl, void *dev_id, struct pt_regs *regs)
+{
+	return IRQ_NONE;
+}
 
 /*
  * Generic no controller code
@@ -392,7 +395,7 @@ int request_irq(unsigned int irq,
 
 	action->handler = handler;
 	action->flags = irqflags;
-	action->mask = 0;
+	cpus_clear(action->mask);
 	action->name = devname;
 	action->next = NULL;
 	action->dev_id = dev_id;
diff --git a/arch/v850/kernel/setup.c b/arch/v850/kernel/setup.c
index 960802a75..8e8bf5ddc 100644
--- a/arch/v850/kernel/setup.c
+++ b/arch/v850/kernel/setup.c
@@ -20,8 +20,10 @@
 #include <linux/major.h>
 #include <linux/root_dev.h>
 #include <linux/mtd/mtd.h>
+#include <linux/init.h>
 
 #include <asm/irq.h>
+#include <asm/setup.h>
 
 #include "mach.h"
 
@@ -40,8 +42,7 @@ extern char _root_fs_image_start __attribute__ ((__weak__));
 extern char _root_fs_image_end __attribute__ ((__weak__));
 
 
-char command_line[512];
-char saved_command_line[512];
+char command_line[COMMAND_LINE_SIZE];
 
 /* Memory not used by the kernel.  */
 static unsigned long total_ram_pages;
@@ -63,8 +64,8 @@ void __init setup_arch (char **cmdline)
 {
 	/* Keep a copy of command line */
 	*cmdline = command_line;
-	memcpy (saved_command_line, command_line, sizeof saved_command_line);
-	saved_command_line[sizeof saved_command_line - 1] = '\0';
+	memcpy (saved_command_line, command_line, COMMAND_LINE_SIZE);
+	saved_command_line[COMMAND_LINE_SIZE - 1] = '\0';
 
 	console_verbose ();
 
diff --git a/arch/v850/kernel/time.c b/arch/v850/kernel/time.c
index fee3e957d..74067adea 100644
--- a/arch/v850/kernel/time.c
+++ b/arch/v850/kernel/time.c
@@ -203,7 +203,7 @@ static int timer_dev_id;
 static struct irqaction timer_irqaction = {
 	timer_interrupt,
 	SA_INTERRUPT,
-	0,
+	CPU_MASK_NONE,
 	"timer",
 	&timer_dev_id,
 	NULL
diff --git a/arch/v850/kernel/vmlinux.lds.S b/arch/v850/kernel/vmlinux.lds.S
index 59e3c28fc..71669f7a9 100644
--- a/arch/v850/kernel/vmlinux.lds.S
+++ b/arch/v850/kernel/vmlinux.lds.S
@@ -1,8 +1,8 @@
 /*
  * arch/v850/vmlinux.lds.S -- kernel linker script for v850 platforms
  *
- *  Copyright (C) 2002,03  NEC Electronics Corporation
- *  Copyright (C) 2002,03  Miles Bader <miles@gnu.org>
+ *  Copyright (C) 2002,03,04  NEC Electronics Corporation
+ *  Copyright (C) 2002,03,04  Miles Bader <miles@gnu.org>
  *
  * 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
@@ -65,7 +65,7 @@
 #define TEXT_CONTENTS							      \
 		__stext = . ;						      \
         	*(.text)						      \
-		SCHED_TEXT
+		SCHED_TEXT						      \
 			*(.exit.text)	/* 2.5 convention */		      \
 			*(.text.exit)	/* 2.4 convention */		      \
 			*(.text.lock)					      \
diff --git a/arch/v850/lib/memset.c b/arch/v850/lib/memset.c
index a724d31d1..d1b2ad821 100644
--- a/arch/v850/lib/memset.c
+++ b/arch/v850/lib/memset.c
@@ -1,8 +1,8 @@
 /*
  * arch/v850/lib/memset.c -- Memory initialization
  *
- *  Copyright (C) 2001,02  NEC Corporation
- *  Copyright (C) 2001,02  Miles Bader <miles@gnu.org>
+ *  Copyright (C) 2001,02,04  NEC Corporation
+ *  Copyright (C) 2001,02,04  Miles Bader <miles@gnu.org>
  *
  * 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
@@ -26,11 +26,13 @@ void *memset (void *dst, int val, __kernel_size_t count)
 
 		/* copy initial unaligned bytes.  */
 		if ((long)ptr & 1) {
-			*((char *)ptr)++ = val;
+			*(char *)ptr = val;
+			ptr = (void *)((char *)ptr + 1);
 			count--;
 		}
 		if (count > 2 && ((long)ptr & 2)) {
-			*((short *)ptr)++ = val;
+			*(short *)ptr = val;
+			ptr = (void *)((short *)ptr + 1);
 			count -= 2;
 		}
 
@@ -46,15 +48,20 @@ void *memset (void *dst, int val, __kernel_size_t count)
 		count %= 32;
 
 		/* long copying loop.  */
-		for (loop = count / 4; loop; loop--)
-			*((long *)ptr)++ = val;
+		for (loop = count / 4; loop; loop--) {
+			*(long *)ptr = val;
+			ptr = (void *)((long *)ptr + 1);
+		}
 		count %= 4;
 
 		/* finish up with any trailing bytes.  */
-		if (count & 2)
-			*((short *)ptr)++ = val;
-		if (count & 1)
+		if (count & 2) {
+			*(short *)ptr = val;
+			ptr = (void *)((short *)ptr + 1);
+		}
+		if (count & 1) {
 			*(char *)ptr = val;
+		}
 	}
 
 	return dst;
diff --git a/arch/x86_64/Makefile b/arch/x86_64/Makefile
index 896873b9d..9b9a504ef 100644
--- a/arch/x86_64/Makefile
+++ b/arch/x86_64/Makefile
@@ -37,6 +37,8 @@ LDFLAGS		:= -m elf_x86_64
 OBJCOPYFLAGS	:= -O binary -R .note -R .comment -S
 LDFLAGS_vmlinux := -e stext
 
+CHECK           := $(CHECK) -D__x86_64__=1
+
 cflags-$(CONFIG_MK8) += $(call check_gcc,-march=k8,)
 cflags-$(CONFIG_MPSC) += $(call check_gcc,-march=nocona,)
 CFLAGS += $(cflags-y)
diff --git a/arch/x86_64/defconfig b/arch/x86_64/defconfig
index e569a1435..bf6969fa0 100644
--- a/arch/x86_64/defconfig
+++ b/arch/x86_64/defconfig
@@ -386,7 +386,6 @@ CONFIG_IPV6=y
 # 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
 
 #
diff --git a/arch/x86_64/ia32/ia32_aout.c b/arch/x86_64/ia32/ia32_aout.c
index b7b698c68..fe6bae25e 100644
--- a/arch/x86_64/ia32/ia32_aout.c
+++ b/arch/x86_64/ia32/ia32_aout.c
@@ -25,6 +25,7 @@
 #include <linux/binfmts.h>
 #include <linux/personality.h>
 #include <linux/init.h>
+#include <linux/vs_memory.h>
 
 #include <asm/system.h>
 #include <asm/uaccess.h>
@@ -216,18 +217,19 @@ end_coredump:
  * memory and creates the pointer tables from them, and puts their
  * addresses on the "stack", returning the new stack pointer value.
  */
-static u32 * create_aout_tables(char * p, struct linux_binprm * bprm)
+static u32 __user *create_aout_tables(char __user *p, struct linux_binprm *bprm)
 {
-	u32 *argv, *envp;
-	u32 * sp;
+	u32 __user *argv;
+	u32 __user *envp;
+	u32 __user *sp;
 	int argc = bprm->argc;
 	int envc = bprm->envc;
 
-	sp = (u32 *) ((-(unsigned long)sizeof(u32)) & (unsigned long) p);
+	sp = (u32 __user *) ((-(unsigned long)sizeof(u32)) & (unsigned long) p);
 	sp -= envc+1;
-	envp = (u32 *) sp;
+	envp = sp;
 	sp -= argc+1;
-	argv = (u32 *) sp;
+	argv = sp;
 	put_user((unsigned long) envp,--sp);
 	put_user((unsigned long) argv,--sp);
 	put_user(argc,--sp);
@@ -404,7 +406,7 @@ beyond_if:
 	}
 
 	current->mm->start_stack =
-		(unsigned long) create_aout_tables((char *) bprm->p, bprm);
+		(unsigned long)create_aout_tables((char __user *)bprm->p, bprm);
 	/* start thread */
 	asm volatile("movl %0,%%fs" :: "r" (0)); \
 	asm volatile("movl %0,%%es; movl %0,%%ds": :"r" (__USER32_DS));
diff --git a/arch/x86_64/ia32/ia32_signal.c b/arch/x86_64/ia32/ia32_signal.c
index 2fe68d976..5716c8bec 100644
--- a/arch/x86_64/ia32/ia32_signal.c
+++ b/arch/x86_64/ia32/ia32_signal.c
@@ -109,7 +109,7 @@ int ia32_copy_siginfo_from_user(siginfo_t *to, siginfo_t32 __user *from)
 	err |= __get_user(to->si_pid, &from->si_pid);
 	err |= __get_user(to->si_uid, &from->si_uid);
 	err |= __get_user(ptr32, &from->si_ptr);
-	to->si_ptr = (void*)(u64)ptr32;
+	to->si_ptr = compat_ptr(ptr32);
 
 	return err;
 }
@@ -146,12 +146,12 @@ sys32_sigaltstack(const stack_ia32_t __user *uss_ptr,
 	if (uss_ptr) { 
 		u32 ptr;
 		memset(&uss,0,sizeof(stack_t));
-	if (!access_ok(VERIFY_READ,uss_ptr,sizeof(stack_ia32_t)) ||
-		    __get_user(ptr, &uss_ptr->ss_sp) ||
-		    __get_user(uss.ss_flags, &uss_ptr->ss_flags) ||
-		    __get_user(uss.ss_size, &uss_ptr->ss_size))
-		return -EFAULT;
-		uss.ss_sp = (void *)(u64)ptr;
+		if (!access_ok(VERIFY_READ,uss_ptr,sizeof(stack_ia32_t)) ||
+			    __get_user(ptr, &uss_ptr->ss_sp) ||
+			    __get_user(uss.ss_flags, &uss_ptr->ss_flags) ||
+			    __get_user(uss.ss_size, &uss_ptr->ss_size))
+			return -EFAULT;
+		uss.ss_sp = compat_ptr(ptr);
 	}
 	seg = get_fs(); 
 	set_fs(KERNEL_DS); 
@@ -448,7 +448,7 @@ void ia32_setup_frame(int sig, struct k_sigaction *ka,
 
 	/* Return stub is in 32bit vsyscall page */
 	{ 
-		void *restorer = VSYSCALL32_SIGRETURN; 
+		void __user *restorer = VSYSCALL32_SIGRETURN; 
 		if (ka->sa.sa_flags & SA_RESTORER)
 			restorer = ka->sa.sa_restorer;       
 		err |= __put_user(ptr_to_u32(restorer), &frame->pretcode);
@@ -541,7 +541,7 @@ void ia32_setup_rt_frame(int sig, struct k_sigaction *ka, siginfo_t *info,
 
 	
 	{ 
-		void *restorer = VSYSCALL32_RTSIGRETURN; 
+		void __user *restorer = VSYSCALL32_RTSIGRETURN; 
 		if (ka->sa.sa_flags & SA_RESTORER)
 			restorer = ka->sa.sa_restorer;       
 		err |= __put_user(ptr_to_u32(restorer), &frame->pretcode);
diff --git a/arch/x86_64/ia32/sys_ia32.c b/arch/x86_64/ia32/sys_ia32.c
index c0b196e20..8b4734252 100644
--- a/arch/x86_64/ia32/sys_ia32.c
+++ b/arch/x86_64/ia32/sys_ia32.c
@@ -886,7 +886,7 @@ sys32_sysctl(struct sysctl_ia32 __user *args32)
 	oldvalp = (void *) A(a32.oldval);
 	newvalp = (void *) A(a32.newval);
 
-	if ((oldvalp && get_user(oldlen, (int *) A(a32.oldlenp)))
+	if ((oldvalp && get_user(oldlen, (int __user *)compat_ptr(a32.oldlenp)))
 	    || !access_ok(VERIFY_WRITE, namep, 0)
 	    || !access_ok(VERIFY_WRITE, oldvalp, 0)
 	    || !access_ok(VERIFY_WRITE, newvalp, 0))
@@ -898,7 +898,7 @@ sys32_sysctl(struct sysctl_ia32 __user *args32)
 	unlock_kernel();
 	set_fs(old_fs);
 
-	if (oldvalp && put_user (oldlen, (int *) A(a32.oldlenp)))
+	if (oldvalp && put_user (oldlen, (int __user *)compat_ptr(a32.oldlenp)))
 		return -EFAULT;
 
 	return ret;
@@ -1291,28 +1291,20 @@ sys_timer_create(clockid_t which_clock,
 long
 sys32_timer_create(u32 clock, struct sigevent32 __user *se32, timer_t __user *timer_id)
 {
-	struct sigevent se;
-	mm_segment_t oldfs;
-	long err;
-
+	struct sigevent __user *p = NULL;
 	if (se32) { 
+		struct sigevent se;
+		p = compat_alloc_user_space(sizeof(struct sigevent));
 		memset(&se, 0, sizeof(struct sigevent)); 
 		if (get_user(se.sigev_value.sival_int,  &se32->sigev_value) ||
 		    __get_user(se.sigev_signo, &se32->sigev_signo) ||
 		    __get_user(se.sigev_notify, &se32->sigev_notify) ||
 		    __copy_from_user(&se._sigev_un._pad, &se32->payload, 
-				     sizeof(se32->payload)))
+				     sizeof(se32->payload)) ||
+		    copy_to_user(p, &se, sizeof(se)))
 			return -EFAULT;
 	} 
-	if (!access_ok(VERIFY_WRITE,timer_id,sizeof(timer_t)))
-		return -EFAULT;
-
-	oldfs = get_fs();
-	set_fs(KERNEL_DS);
-	err = sys_timer_create(clock, se32 ? &se : NULL, timer_id);
-	set_fs(oldfs); 
-	
-	return err; 
+	return sys_timer_create(clock, p, timer_id);
 } 
 
 long sys32_fadvise64_64(int fd, __u32 offset_low, __u32 offset_high, 
diff --git a/arch/x86_64/kernel/e820.c b/arch/x86_64/kernel/e820.c
index e338e5f26..5b65992b8 100644
--- a/arch/x86_64/kernel/e820.c
+++ b/arch/x86_64/kernel/e820.c
@@ -34,7 +34,7 @@ unsigned long end_pfn_map;
  */
 unsigned long end_user_pfn = MAXMEM>>PAGE_SHIFT;  
 
-extern struct resource code_resource, data_resource, vram_resource;
+extern struct resource code_resource, data_resource;
 
 /* Check for some hardcoded bad areas that early boot is not allowed to touch */ 
 static inline int bad_addr(unsigned long *addrp, unsigned long size)
diff --git a/arch/x86_64/kernel/head64.c b/arch/x86_64/kernel/head64.c
index 4055c78d2..127a67880 100644
--- a/arch/x86_64/kernel/head64.c
+++ b/arch/x86_64/kernel/head64.c
@@ -16,6 +16,7 @@
 #include <asm/proto.h>
 #include <asm/smp.h>
 #include <asm/bootsetup.h>
+#include <asm/setup.h>
 
 /* Don't add a printk in there. printk relies on the PDA which is not initialized 
    yet. */
diff --git a/arch/x86_64/kernel/i8259.c b/arch/x86_64/kernel/i8259.c
index 304b6a37f..c52b859c9 100644
--- a/arch/x86_64/kernel/i8259.c
+++ b/arch/x86_64/kernel/i8259.c
@@ -47,6 +47,12 @@
 	BI(x,8) BI(x,9) BI(x,a) BI(x,b) \
 	BI(x,c) BI(x,d) BI(x,e) BI(x,f)
 
+#define BUILD_14_IRQS(x) \
+	BI(x,0) BI(x,1) BI(x,2) BI(x,3) \
+	BI(x,4) BI(x,5) BI(x,6) BI(x,7) \
+	BI(x,8) BI(x,9) BI(x,a) BI(x,b) \
+	BI(x,c) BI(x,d)
+
 /*
  * ISA PIC or low IO-APIC triggered (INTA-cycle or APIC) interrupts:
  * (these are usually mapped to vectors 0x20-0x2f)
@@ -68,9 +74,15 @@ BUILD_16_IRQS(0x0)
 BUILD_16_IRQS(0x4) BUILD_16_IRQS(0x5) BUILD_16_IRQS(0x6) BUILD_16_IRQS(0x7)
 BUILD_16_IRQS(0x8) BUILD_16_IRQS(0x9) BUILD_16_IRQS(0xa) BUILD_16_IRQS(0xb)
 BUILD_16_IRQS(0xc) BUILD_16_IRQS(0xd)
+
+#ifdef CONFIG_PCI_MSI
+	BUILD_14_IRQS(0xe)
+#endif
+
 #endif
 
 #undef BUILD_16_IRQS
+#undef BUILD_14_IRQS
 #undef BI
 
 
@@ -83,6 +95,12 @@ BUILD_16_IRQS(0xc) BUILD_16_IRQS(0xd)
 	IRQ(x,8), IRQ(x,9), IRQ(x,a), IRQ(x,b), \
 	IRQ(x,c), IRQ(x,d), IRQ(x,e), IRQ(x,f)
 
+#define IRQLIST_14(x) \
+	IRQ(x,0), IRQ(x,1), IRQ(x,2), IRQ(x,3), \
+	IRQ(x,4), IRQ(x,5), IRQ(x,6), IRQ(x,7), \
+	IRQ(x,8), IRQ(x,9), IRQ(x,a), IRQ(x,b), \
+	IRQ(x,c), IRQ(x,d)
+
 void (*interrupt[NR_IRQS])(void) = {
 	IRQLIST_16(0x0),
 
@@ -91,11 +109,17 @@ void (*interrupt[NR_IRQS])(void) = {
 	IRQLIST_16(0x4), IRQLIST_16(0x5), IRQLIST_16(0x6), IRQLIST_16(0x7),
 	IRQLIST_16(0x8), IRQLIST_16(0x9), IRQLIST_16(0xa), IRQLIST_16(0xb),
 	IRQLIST_16(0xc), IRQLIST_16(0xd)
+
+#ifdef CONFIG_PCI_MSI
+	, IRQLIST_14(0xe)
+#endif
+
 #endif
 };
 
 #undef IRQ
 #undef IRQLIST_16
+#undef IRQLIST_14
 
 /*
  * This is the 'legacy' 8259A Programmable Interrupt Controller,
@@ -365,7 +389,7 @@ void __init init_8259A(int auto_eoi)
  * IRQ2 is cascade interrupt to second interrupt controller
  */
 
-static struct irqaction irq2 = { no_action, 0, 0, "cascade", NULL, NULL};
+static struct irqaction irq2 = { no_action, 0, CPU_MASK_NONE, "cascade", NULL, NULL};
 
 void __init init_ISA_irqs (void)
 {
@@ -378,7 +402,7 @@ void __init init_ISA_irqs (void)
 
 	for (i = 0; i < NR_IRQS; i++) {
 		irq_desc[i].status = IRQ_DISABLED;
-		irq_desc[i].action = 0;
+		irq_desc[i].action = NULL;
 		irq_desc[i].depth = 1;
 
 		if (i < 16) {
diff --git a/arch/x86_64/kernel/init_task.c b/arch/x86_64/kernel/init_task.c
index 57ec2f0ee..33185ca33 100644
--- a/arch/x86_64/kernel/init_task.c
+++ b/arch/x86_64/kernel/init_task.c
@@ -4,6 +4,7 @@
 #include <linux/init.h>
 #include <linux/init_task.h>
 #include <linux/fs.h>
+#include <linux/mqueue.h>
 
 #include <asm/uaccess.h>
 #include <asm/pgtable.h>
diff --git a/arch/x86_64/kernel/io_apic.c b/arch/x86_64/kernel/io_apic.c
index 718504a32..6cb45b7eb 100644
--- a/arch/x86_64/kernel/io_apic.c
+++ b/arch/x86_64/kernel/io_apic.c
@@ -67,8 +67,8 @@ static struct irq_pin_list {
 	short apic, pin, next;
 } irq_2_pin[PIN_MAP_SIZE];
 
-#ifdef CONFIG_PCI_USE_VECTOR
-int vector_irq[NR_IRQS] = { [0 ... NR_IRQS -1] = -1};
+int vector_irq[NR_VECTORS] = { [0 ... NR_VECTORS - 1] = -1};
+#ifdef CONFIG_PCI_MSI
 #define vector_to_irq(vector) 	\
 	(platform_legacy_irq(vector) ? vector : vector_irq[vector])
 #else
@@ -656,10 +656,14 @@ static inline int IO_APIC_irq_trigger(int irq)
 /* irq_vectors is indexed by the sum of all RTEs in all I/O APICs. */
 u8 irq_vector[NR_IRQ_VECTORS] = { FIRST_DEVICE_VECTOR , 0 };
 
-#ifndef CONFIG_PCI_USE_VECTOR
+#ifdef CONFIG_PCI_MSI
+int assign_irq_vector(int irq)
+#else
 int __init assign_irq_vector(int irq)
+#endif
 {
 	static int current_vector = FIRST_DEVICE_VECTOR, offset = 0;
+
 	BUG_ON(irq >= NR_IRQ_VECTORS);
 	if (IO_APIC_VECTOR(irq) > 0)
 		return IO_APIC_VECTOR(irq);
@@ -668,18 +672,19 @@ next:
 	if (current_vector == IA32_SYSCALL_VECTOR)
 		goto next;
 
-	if (current_vector > FIRST_SYSTEM_VECTOR) {
+	if (current_vector >= FIRST_SYSTEM_VECTOR) {
 		offset++;
+		if (!(offset%8))
+			return -ENOSPC;
 		current_vector = FIRST_DEVICE_VECTOR + offset;
 	}
 
-	if (current_vector == FIRST_SYSTEM_VECTOR)
-		panic("ran out of interrupt sources!");
+	vector_irq[current_vector] = irq;
+	if (irq != AUTO_ASSIGN)
+		IO_APIC_VECTOR(irq) = current_vector;
 
-	IO_APIC_VECTOR(irq) = current_vector;
 	return current_vector;
 }
-#endif
 
 extern void (*interrupt[NR_IRQS])(void);
 static struct hw_interrupt_type ioapic_level_type;
@@ -925,12 +930,17 @@ void __init print_IO_APIC(void)
 		);
 	}
 	}
+	if (use_pci_vector())
+		printk(KERN_INFO "Using vector-based indexing\n");
 	printk(KERN_DEBUG "IRQ to pin mappings:\n");
 	for (i = 0; i < NR_IRQS; i++) {
 		struct irq_pin_list *entry = irq_2_pin + i;
 		if (entry->pin < 0)
 			continue;
-		printk(KERN_DEBUG "IRQ%d ", i);
+ 		if (use_pci_vector() && !platform_legacy_irq(i))
+			printk(KERN_DEBUG "IRQ%d ", IO_APIC_VECTOR(i));
+		else
+			printk(KERN_DEBUG "IRQ%d ", i);
 		for (;;) {
 			printk("-> %d:%d", entry->apic, entry->pin);
 			if (!entry->next)
@@ -1384,7 +1394,7 @@ static void set_ioapic_affinity_irq(unsigned int irq, cpumask_t mask)
 	unsigned long flags;
 	unsigned int dest;
 
-	dest = cpu_mask_to_apicid(mk_cpumask_const(mask));
+	dest = cpu_mask_to_apicid(mask);
 
 	/*
 	 * Only the first 8 bits are valid.
@@ -1396,7 +1406,7 @@ static void set_ioapic_affinity_irq(unsigned int irq, cpumask_t mask)
 	spin_unlock_irqrestore(&ioapic_lock, flags);
 }
 
-#ifdef CONFIG_PCI_USE_VECTOR
+#ifdef CONFIG_PCI_MSI
 static unsigned int startup_edge_ioapic_vector(unsigned int vector)
 {
 	int irq = vector_to_irq(vector);
@@ -1737,7 +1747,7 @@ static inline void check_timer(void)
 		return;
 	}
 	printk(" failed :(.\n");
-	panic("IO-APIC + timer doesn't work! pester mingo@redhat.com");
+	panic("IO-APIC + timer doesn't work! Try using the 'noapic' kernel parameter\n");
 }
 
 /*
diff --git a/arch/x86_64/kernel/irq.c b/arch/x86_64/kernel/irq.c
index bfdb95e8b..189418294 100644
--- a/arch/x86_64/kernel/irq.c
+++ b/arch/x86_64/kernel/irq.c
@@ -488,7 +488,7 @@ int request_irq(unsigned int irq,
 
 	action->handler = handler;
 	action->flags = irqflags;
-	action->mask = 0;
+	cpus_clear(action->mask);
 	action->name = devname;
 	action->next = NULL;
 	action->dev_id = dev_id;
@@ -930,7 +930,7 @@ void init_irq_proc (void)
 	int i;
 
 	/* create /proc/irq */
-	root_irq_dir = proc_mkdir("irq", 0);
+	root_irq_dir = proc_mkdir("irq", NULL);
 
 	/* create /proc/irq/prof_cpu_mask */
 	entry = create_proc_entry("prof_cpu_mask", 0600, root_irq_dir);
diff --git a/arch/x86_64/kernel/ldt.c b/arch/x86_64/kernel/ldt.c
index 4e43e53a1..c7d7dac04 100644
--- a/arch/x86_64/kernel/ldt.c
+++ b/arch/x86_64/kernel/ldt.c
@@ -66,7 +66,7 @@ static int alloc_ldt(mm_context_t *pc, unsigned mincount, int reload)
 		mask = cpumask_of_cpu(smp_processor_id());
 		load_LDT(pc);
 		if (!cpus_equal(current->mm->cpu_vm_mask, mask))
-			smp_call_function(flush_ldt, 0, 1, 1);
+			smp_call_function(flush_ldt, NULL, 1, 1);
 		preempt_enable();
 #else
 		load_LDT(pc);
diff --git a/arch/x86_64/kernel/module.c b/arch/x86_64/kernel/module.c
index c2256e5ac..78ce354a5 100644
--- a/arch/x86_64/kernel/module.c
+++ b/arch/x86_64/kernel/module.c
@@ -121,7 +121,7 @@ void *module_alloc(unsigned long size)
 			goto fail;
 	}
 	
-	if (map_vm_area(area, PAGE_KERNEL_EXECUTABLE, &pages))
+	if (map_vm_area(area, PAGE_KERNEL_EXEC, &pages))
 		goto fail;
 	
 	memset(addr, 0, size);
diff --git a/arch/x86_64/kernel/mpparse.c b/arch/x86_64/kernel/mpparse.c
index 7dcc1b51a..646b3c0a9 100644
--- a/arch/x86_64/kernel/mpparse.c
+++ b/arch/x86_64/kernel/mpparse.c
@@ -44,7 +44,7 @@ int acpi_found_madt;
 int apic_version [MAX_APICS];
 unsigned char mp_bus_id_to_type [MAX_MP_BUSSES] = { [0 ... MAX_MP_BUSSES-1] = -1 };
 int mp_bus_id_to_pci_bus [MAX_MP_BUSSES] = { [0 ... MAX_MP_BUSSES-1] = -1 };
-cpumask_t mp_bus_to_cpumask [MAX_MP_BUSSES] = { [0 ... MAX_MP_BUSSES-1] = CPU_MASK_ALL };
+cpumask_t pci_bus_to_cpumask [256] = { [0 ... 255] = CPU_MASK_ALL };
 
 int mp_current_pci_id = 0;
 /* I/O APIC entries */
@@ -716,7 +716,7 @@ struct mp_ioapic_routing {
 } mp_ioapic_routing[MAX_IO_APICS];
 
 
-static int __init mp_find_ioapic (
+static int mp_find_ioapic (
 	int			gsi)
 {
 	int			i = 0;
@@ -859,15 +859,22 @@ void __init mp_config_acpi_legacy_irqs (void)
 	for (i = 0; i < 16; i++) {
 		int idx;
 
-		for (idx = 0; idx < mp_irq_entries; idx++)
-			if (mp_irqs[idx].mpc_srcbus == MP_ISA_BUS &&
-				(mp_irqs[idx].mpc_srcbusirq == i ||
-				mp_irqs[idx].mpc_dstirq == i))
-					break;
+		for (idx = 0; idx < mp_irq_entries; idx++) {
+			struct mpc_config_intsrc *irq = mp_irqs + idx;
+
+			/* Do we already have a mapping for this ISA IRQ? */
+			if (irq->mpc_srcbus == MP_ISA_BUS && irq->mpc_srcbusirq == i)
+				break;
+
+			/* Do we already have a mapping for this IOAPIC pin */
+			if ((irq->mpc_dstapic == intsrc.mpc_dstapic) &&
+				(irq->mpc_dstirq == i))
+				break;
+		}
 
 		if (idx != mp_irq_entries) {
 			printk(KERN_DEBUG "ACPI: IRQ%d used by override.\n", i);
-			continue;			 /* IRQ already used */
+			continue;			/* IRQ already used */
 		}
 
 		intsrc.mpc_irqtype = mp_INT;
@@ -888,91 +895,54 @@ void __init mp_config_acpi_legacy_irqs (void)
 	return;
 }
 
-
-extern FADT_DESCRIPTOR acpi_fadt;
-
-#ifdef CONFIG_ACPI_PCI
-
-void __init mp_parse_prt (void)
+void mp_register_gsi (u32 gsi, int edge_level, int active_high_low)
 {
-	struct list_head	*node = NULL;
-	struct acpi_prt_entry	*entry = NULL;
 	int			ioapic = -1;
 	int			ioapic_pin = 0;
-	int			gsi = 0;
 	int			idx, bit = 0;
-	int			edge_level = 0;
-	int			active_high_low = 0;
 
-	/*
-	 * Parsing through the PCI Interrupt Routing Table (PRT) and program
-	 * routing for all static (IOAPIC-direct) entries.
-	 */
-	list_for_each(node, &acpi_prt.entries) {
-		entry = list_entry(node, struct acpi_prt_entry, node);
-
-		/* Need to get gsi for dynamic entry */
-		if (entry->link.handle) {
-			gsi = acpi_pci_link_get_irq(entry->link.handle, entry->link.index, &edge_level, &active_high_low);
-			if (!gsi)
-				continue;
-		} else {
-			/* Hardwired GSI. Assume PCI standard settings */
-			gsi = entry->link.index;
-			edge_level = 1;
-			active_high_low = 1;
-		}
+	if (acpi_irq_model != ACPI_IRQ_MODEL_IOAPIC)
+		return;
 
-		/* Don't set up the ACPI SCI because it's already set up */
-		if (acpi_fadt.sci_int == gsi) {
-			/* we still need to set up the entry's irq */
-			acpi_gsi_to_irq(gsi, &entry->irq);
-			continue;
-		}
+#ifdef CONFIG_ACPI_BUS
+	/* Don't set up the ACPI SCI because it's already set up */
+	if (acpi_fadt.sci_int == gsi)
+		return;
+#endif
 
-		ioapic = mp_find_ioapic(gsi);
-		if (ioapic < 0)
-			continue;
-		ioapic_pin = gsi - mp_ioapic_routing[ioapic].gsi_start;
+	ioapic = mp_find_ioapic(gsi);
+	if (ioapic < 0) {
+		printk(KERN_WARNING "No IOAPIC for GSI %u\n", gsi);
+		return;
+	}
 
-		/* 
-		 * Avoid pin reprogramming.  PRTs typically include entries  
-		 * with redundant pin->gsi mappings (but unique PCI devices);
-		 * we only only program the IOAPIC on the first.
-		 */
-		bit = ioapic_pin % 32;
-		idx = (ioapic_pin < 32) ? 0 : (ioapic_pin / 32);
-		if (idx > 3) {
-			printk(KERN_ERR "Invalid reference to IOAPIC pin "
-				"%d-%d\n", mp_ioapic_routing[ioapic].apic_id, 
-				ioapic_pin);
-			continue;
-		}
-		if ((1<<bit) & mp_ioapic_routing[ioapic].pin_programmed[idx]) {
-			Dprintk(KERN_DEBUG "Pin %d-%d already programmed\n",
-				mp_ioapic_routing[ioapic].apic_id, ioapic_pin);
-			acpi_gsi_to_irq(gsi, &entry->irq);
-			continue;
-		}
+	ioapic_pin = gsi - mp_ioapic_routing[ioapic].gsi_start;
 
-		mp_ioapic_routing[ioapic].pin_programmed[idx] |= (1<<bit);
-		if (!io_apic_set_pci_routing(ioapic, ioapic_pin, gsi, edge_level, active_high_low)) {
-			acpi_gsi_to_irq(gsi, &entry->irq);
- 		}
-		printk(KERN_DEBUG "%02x:%02x:%02x[%c] -> %d-%d -> IRQ %d\n",
-			entry->id.segment, entry->id.bus,
-			entry->id.device, ('A' + entry->pin), 
-			mp_ioapic_routing[ioapic].apic_id, ioapic_pin,
-			entry->irq);
+	/* 
+	 * Avoid pin reprogramming.  PRTs typically include entries  
+	 * with redundant pin->gsi mappings (but unique PCI devices);
+	 * we only program the IOAPIC on the first.
+	 */
+	bit = ioapic_pin % 32;
+	idx = (ioapic_pin < 32) ? 0 : (ioapic_pin / 32);
+	if (idx > 3) {
+		printk(KERN_ERR "Invalid reference to IOAPIC pin "
+			"%d-%d\n", mp_ioapic_routing[ioapic].apic_id, 
+			ioapic_pin);
+		return;
+	}
+	if ((1<<bit) & mp_ioapic_routing[ioapic].pin_programmed[idx]) {
+		Dprintk(KERN_DEBUG "Pin %d-%d already programmed\n",
+			mp_ioapic_routing[ioapic].apic_id, ioapic_pin);
+		return;
 	}
-	
-	print_IO_APIC();
 
-	return;
-}
+	mp_ioapic_routing[ioapic].pin_programmed[idx] |= (1<<bit);
 
-#endif /*CONFIG_ACPI_PCI*/
+	io_apic_set_pci_routing(ioapic, ioapic_pin, gsi,
+		edge_level == ACPI_EDGE_SENSITIVE ? 0 : 1,
+		active_high_low == ACPI_ACTIVE_HIGH ? 0 : 1);
+}
 
 #endif /*CONFIG_X86_IO_APIC*/
-
 #endif /*CONFIG_ACPI_BOOT*/
diff --git a/arch/x86_64/kernel/pci-gart.c b/arch/x86_64/kernel/pci-gart.c
index fd1c2d791..09fde74cb 100644
--- a/arch/x86_64/kernel/pci-gart.c
+++ b/arch/x86_64/kernel/pci-gart.c
@@ -70,6 +70,8 @@ int iommu_fullflush = 1;
 static spinlock_t iommu_bitmap_lock = SPIN_LOCK_UNLOCKED;
 static unsigned long *iommu_gart_bitmap; /* guarded by iommu_bitmap_lock */
 
+static u32 gart_unmapped_entry; 
+
 #define GPTE_VALID    1
 #define GPTE_COHERENT 2
 #define GPTE_ENCODE(x) \
@@ -147,8 +149,6 @@ static void free_iommu(unsigned long offset, int size)
 static void flush_gart(struct pci_dev *dev)
 { 
 	unsigned long flags;
-	int bus = dev ? dev->bus->number : -1;
-	cpumask_const_t bus_cpumask = pcibus_to_cpumask(bus);
 	int flushed = 0;
 	int i;
 
@@ -158,8 +158,6 @@ static void flush_gart(struct pci_dev *dev)
 			u32 w;
 			if (!northbridges[i]) 
 				continue;
-			if (bus >= 0 && !(cpu_isset_const(i, bus_cpumask)))
-				continue;
 			pci_write_config_dword(northbridges[i], 0x9c, 
 					       northbridge_flush_word[i] | 1); 
 			/* Make sure the hardware actually executed the flush. */
@@ -169,7 +167,7 @@ static void flush_gart(struct pci_dev *dev)
 			flushed++;
 		} 
 		if (!flushed) 
-			printk("nothing to flush? %d\n", bus);
+			printk("nothing to flush?\n");
 		need_flush = 0;
 	} 
 	spin_unlock_irqrestore(&iommu_bitmap_lock, flags);
@@ -255,7 +253,7 @@ void pci_free_consistent(struct pci_dev *hwdev, size_t size,
 #define SET_LEAK(x) if (iommu_leak_tab) \
 			iommu_leak_tab[x] = __builtin_return_address(0);
 #define CLEAR_LEAK(x) if (iommu_leak_tab) \
-			iommu_leak_tab[x] = 0;
+			iommu_leak_tab[x] = NULL;
 
 /* Debugging aid for drivers that don't free their IOMMU tables */
 static void **iommu_leak_tab; 
@@ -479,6 +477,11 @@ int pci_map_sg(struct pci_dev *dev, struct scatterlist *sg, int nents, int dir)
 	unsigned long pages = 0;
 	int need = 0, nextneed;
 
+#ifdef CONFIG_SWIOTLB
+	if (swiotlb)
+		return swiotlb_map_sg(&dev->dev,sg,nents,dir);
+#endif
+
 	BUG_ON(dir == PCI_DMA_NONE);
 	if (nents == 0) 
 		return 0;
@@ -562,7 +565,7 @@ void pci_unmap_single(struct pci_dev *hwdev, dma_addr_t dma_addr,
 	iommu_page = (dma_addr - iommu_bus_base)>>PAGE_SHIFT;	
 	npages = to_pages(dma_addr, size);
 	for (i = 0; i < npages; i++) { 
-		iommu_gatt_base[iommu_page + i] = 0; 
+		iommu_gatt_base[iommu_page + i] = gart_unmapped_entry; 
 		CLEAR_LEAK(iommu_page + i);
 	}
 	free_iommu(iommu_page, npages);
@@ -729,7 +732,8 @@ static int __init pci_iommu_init(void)
 	unsigned long aper_size;
 	unsigned long iommu_start;
 	struct pci_dev *dev;
-		
+	unsigned long scratch;
+	long i;
 
 #ifndef CONFIG_AGP_AMD64
 	no_agp = 1; 
@@ -766,7 +770,7 @@ static int __init pci_iommu_init(void)
 			return -1;
 		}
 	} 
-	
+
 	aper_size = info.aper_size * 1024 * 1024;	
 	iommu_size = check_iommu_size(info.aper_base, aper_size); 
 	iommu_pages = iommu_size >> PAGE_SHIFT; 
@@ -815,6 +819,19 @@ static int __init pci_iommu_init(void)
 	 */
 	clear_kernel_mapping((unsigned long)__va(iommu_bus_base), iommu_size);
 
+	/* 
+	 * Try to workaround a bug (thanks to BenH) 
+	 * Set unmapped entries to a scratch page instead of 0. 
+	 * Any prefetches that hit unmapped entries won't get an bus abort
+	 * then.
+	 */
+	scratch = get_zeroed_page(GFP_KERNEL); 
+	if (!scratch) 
+		panic("Cannot allocate iommu scratch page");
+	gart_unmapped_entry = GPTE_ENCODE(__pa(scratch));
+	for (i = EMERGENCY_PAGES; i < iommu_pages; i++) 
+		iommu_gatt_base[i] = gart_unmapped_entry;
+
 	for_all_nb(dev) {
 		u32 flag; 
 		int cpu = PCI_SLOT(dev->devfn) - 24;
diff --git a/arch/x86_64/kernel/setup.c b/arch/x86_64/kernel/setup.c
index 14a25720f..c0d3c8dfa 100644
--- a/arch/x86_64/kernel/setup.c
+++ b/arch/x86_64/kernel/setup.c
@@ -55,6 +55,7 @@
 #include <asm/bootsetup.h>
 #include <asm/smp.h>
 #include <asm/proto.h>
+#include <asm/setup.h>
 
 /*
  * Machine setup..
@@ -100,7 +101,6 @@ extern int root_mountflags;
 extern char _text, _etext, _edata, _end;
 
 char command_line[COMMAND_LINE_SIZE];
-char saved_command_line[COMMAND_LINE_SIZE];
 
 struct resource standard_io_resources[] = {
 	{ "dma1", 0x00, 0x1f, IORESOURCE_BUSY | IORESOURCE_IO },
@@ -116,9 +116,10 @@ struct resource standard_io_resources[] = {
 #define STANDARD_IO_RESOURCES \
 	(sizeof standard_io_resources / sizeof standard_io_resources[0])
 
-struct resource code_resource = { "Kernel code", 0x100000, 0, IORESOURCE_MEM };
-struct resource data_resource = { "Kernel data", 0, 0, IORESOURCE_MEM };
-struct resource vram_resource = { "Video RAM area", 0xa0000, 0xbffff, IORESOURCE_BUSY | IORESOURCE_MEM };
+#define IORESOURCE_RAM (IORESOURCE_BUSY | IORESOURCE_MEM)
+
+struct resource data_resource = { "Kernel data", 0, 0, IORESOURCE_RAM };
+struct resource code_resource = { "Kernel code", 0, 0, IORESOURCE_RAM };
 
 #define IORESOURCE_ROM (IORESOURCE_BUSY | IORESOURCE_READONLY | IORESOURCE_MEM)
 
@@ -138,10 +139,11 @@ static struct resource adapter_rom_resources[] = {
 	(sizeof adapter_rom_resources / sizeof adapter_rom_resources[0])
 
 static struct resource video_rom_resource = { "Video ROM", 0xc0000, 0xc7fff, IORESOURCE_ROM };
+static struct resource video_ram_resource = { "Video RAM area", 0xa0000, 0xbffff, IORESOURCE_RAM };
 
 #define romsignature(x) (*(unsigned short *)(x) == 0xaa55)
 
-static int __init checksum(unsigned char *rom, unsigned long length)
+static int __init romchecksum(unsigned char *rom, unsigned long length)
 {
 	unsigned char *p, sum = 0;
 
@@ -169,7 +171,7 @@ static void __init probe_roms(void)
 		length = rom[2] * 512;
 
 		/* if checksum okay, trust length byte */
-		if (length && checksum(rom, length))
+		if (length && romchecksum(rom, length))
 			video_rom_resource.end = start + length - 1;
 
 		request_resource(&iomem_resource, &video_rom_resource);
@@ -188,7 +190,7 @@ static void __init probe_roms(void)
 	rom = isa_bus_to_virt(extension_rom_resource.start);
 	if (romsignature(rom)) {
 		length = extension_rom_resource.end - extension_rom_resource.start + 1;
-		if (checksum(rom, length)) {
+		if (romchecksum(rom, length)) {
 			request_resource(&iomem_resource, &extension_rom_resource);
 			upper = extension_rom_resource.start;
 		}
@@ -204,7 +206,7 @@ static void __init probe_roms(void)
 		length = rom[2] * 512;
 
 		/* but accept any length that fits if checksum okay */
-		if (!length || start + length > upper || !checksum(rom, length))
+		if (!length || start + length > upper || !romchecksum(rom, length))
 			continue;
 
 		adapter_rom_resources[i].start = start;
@@ -399,27 +401,26 @@ static int __init noreplacement_setup(char *s)
 __setup("noreplacement", noreplacement_setup); 
 
 #if defined(CONFIG_EDD) || defined(CONFIG_EDD_MODULE)
-unsigned char eddnr;
-struct edd_info edd[EDDMAXNR];
-unsigned int edd_disk80_sig;
+struct edd edd;
 #ifdef CONFIG_EDD_MODULE
-EXPORT_SYMBOL(eddnr);
 EXPORT_SYMBOL(edd);
-EXPORT_SYMBOL(edd_disk80_sig);
 #endif
 /**
  * copy_edd() - Copy the BIOS EDD information
- *              from empty_zero_page into a safe place.
+ *              from boot_params into a safe place.
  *
  */
 static inline void copy_edd(void)
 {
-     eddnr = EDD_NR;
-     memcpy(edd, EDD_BUF, sizeof(edd));
-     edd_disk80_sig = DISK80_SIGNATURE;
+     memcpy(edd.mbr_signature, EDD_MBR_SIGNATURE, sizeof(edd.mbr_signature));
+     memcpy(edd.edd_info, EDD_BUF, sizeof(edd.edd_info));
+     edd.mbr_signature_nr = EDD_MBR_SIG_NR;
+     edd.edd_info_nr = EDD_NR;
 }
 #else
-#define copy_edd() do {} while (0)
+static inline void copy_edd(void)
+{
+}
 #endif
 
 void __init setup_arch(char **cmdline_p)
@@ -555,13 +556,13 @@ void __init setup_arch(char **cmdline_p)
 	probe_roms();
 	e820_reserve_resources(); 
 
-	request_resource(&iomem_resource, &vram_resource);
+	request_resource(&iomem_resource, &video_ram_resource);
 
 	{
 	unsigned i;
 	/* request I/O space for devices used on all i[345]86 PCs */
 	for (i = 0; i < STANDARD_IO_RESOURCES; i++)
-		request_resource(&ioport_resource, standard_io_resources+i);
+		request_resource(&ioport_resource, &standard_io_resources[i]);
 	}
 
 	/* Will likely break when you have unassigned resources with more
diff --git a/arch/x86_64/kernel/signal.c b/arch/x86_64/kernel/signal.c
index d814db6e3..f6eb0e337 100644
--- a/arch/x86_64/kernel/signal.c
+++ b/arch/x86_64/kernel/signal.c
@@ -242,7 +242,7 @@ static void setup_rt_frame(int sig, struct k_sigaction *ka, siginfo_t *info,
 
 	if (me->used_math) {
 		fp = get_stack(ka, regs, sizeof(struct _fpstate)); 
-		frame = (void __user *)round_down((u64)fp - sizeof(struct rt_sigframe), 16) - 8;
+		frame = (void __user *)round_down((unsigned long)fp - sizeof(struct rt_sigframe), 16) - 8;
 
 		if (!access_ok(VERIFY_WRITE, fp, sizeof(struct _fpstate))) { 
 		goto give_sigsegv;
diff --git a/arch/x86_64/kernel/smp.c b/arch/x86_64/kernel/smp.c
index fec777046..409460ebc 100644
--- a/arch/x86_64/kernel/smp.c
+++ b/arch/x86_64/kernel/smp.c
@@ -94,7 +94,7 @@ void send_IPI_self(int vector)
 
 static inline void send_IPI_mask(cpumask_t cpumask, int vector)
 {
-	unsigned long mask = cpus_coerce(cpumask);
+	unsigned long mask = cpus_addr(cpumask)[0];
 	unsigned long cfg;
 	unsigned long flags;
 
@@ -343,7 +343,7 @@ static void do_flush_tlb_all(void* info)
 
 void flush_tlb_all(void)
 {
-	on_each_cpu(do_flush_tlb_all, 0, 1, 1);
+	on_each_cpu(do_flush_tlb_all, NULL, 1, 1);
 }
 
 void smp_kdb_stop(void)
diff --git a/arch/x86_64/kernel/smpboot.c b/arch/x86_64/kernel/smpboot.c
index ba2cba68d..29f2578bf 100644
--- a/arch/x86_64/kernel/smpboot.c
+++ b/arch/x86_64/kernel/smpboot.c
@@ -659,7 +659,7 @@ static void __init do_boot_cpu (int apicid)
 			Dprintk("CPU has booted.\n");
 		} else {
 			boot_error = 1;
-			if (*((volatile unsigned char *)phys_to_virt(8192))
+			if (*((volatile unsigned char *)phys_to_virt(SMP_TRAMPOLINE_BASE))
 					== 0xA5)
 				/* trampoline started but...? */
 				printk("Stuck ??\n");
@@ -676,9 +676,6 @@ static void __init do_boot_cpu (int apicid)
 		clear_bit(cpu, &cpu_initialized); /* was set by cpu_init() */
 		cpucount--;
 	}
-
-	/* mark "stuck" area as not stuck */
-	*((volatile unsigned *)phys_to_virt(8192)) = 0;
 }
 
 cycles_t cacheflush_time;
@@ -827,7 +824,7 @@ static void __init smp_boot_cpus(unsigned int max_cpus)
 		if (apicid == boot_cpu_id || (apicid == BAD_APICID))
 			continue;
 
-		if (!cpu_isset(apicid, phys_cpu_present_map))
+		if (!physid_isset(apicid, phys_cpu_present_map))
 			continue;
 		if ((max_cpus >= 0) && (max_cpus <= cpucount+1))
 			continue;
diff --git a/arch/x86_64/kernel/suspend.c b/arch/x86_64/kernel/suspend.c
index d8cdbe131..751982df5 100644
--- a/arch/x86_64/kernel/suspend.c
+++ b/arch/x86_64/kernel/suspend.c
@@ -35,40 +35,45 @@ unsigned long saved_context_r08, saved_context_r09, saved_context_r10, saved_con
 unsigned long saved_context_r12, saved_context_r13, saved_context_r14, saved_context_r15;
 unsigned long saved_context_eflags;
 
-void save_processor_state (void)
+void __save_processor_state(struct saved_context *ctxt)
 {
 	kernel_fpu_begin();
 
 	/*
 	 * descriptor tables
 	 */
-	asm volatile ("sgdt %0" : "=m" (saved_context.gdt_limit));
-	asm volatile ("sidt %0" : "=m" (saved_context.idt_limit));
-	asm volatile ("sldt %0" : "=m" (saved_context.ldt));
-	asm volatile ("str %0"  : "=m" (saved_context.tr));
+	asm volatile ("sgdt %0" : "=m" (ctxt->gdt_limit));
+	asm volatile ("sidt %0" : "=m" (ctxt->idt_limit));
+	asm volatile ("sldt %0" : "=m" (ctxt->ldt));
+	asm volatile ("str %0"  : "=m" (ctxt->tr));
 
 	/* XMM0..XMM15 should be handled by kernel_fpu_begin(). */
 	/* EFER should be constant for kernel version, no need to handle it. */
 	/*
 	 * segment registers
 	 */
-	asm volatile ("movw %%ds, %0" : "=m" (saved_context.ds));
-	asm volatile ("movw %%es, %0" : "=m" (saved_context.es));
-	asm volatile ("movw %%fs, %0" : "=m" (saved_context.fs));
-	asm volatile ("movw %%gs, %0" : "=m" (saved_context.gs));
-	asm volatile ("movw %%ss, %0" : "=m" (saved_context.ss));
+	asm volatile ("movw %%ds, %0" : "=m" (ctxt->ds));
+	asm volatile ("movw %%es, %0" : "=m" (ctxt->es));
+	asm volatile ("movw %%fs, %0" : "=m" (ctxt->fs));
+	asm volatile ("movw %%gs, %0" : "=m" (ctxt->gs));
+	asm volatile ("movw %%ss, %0" : "=m" (ctxt->ss));
 
-	rdmsrl(MSR_FS_BASE, saved_context.fs_base);
-	rdmsrl(MSR_GS_BASE, saved_context.gs_base);
-	rdmsrl(MSR_KERNEL_GS_BASE, saved_context.gs_kernel_base);
+	rdmsrl(MSR_FS_BASE, ctxt->fs_base);
+	rdmsrl(MSR_GS_BASE, ctxt->gs_base);
+	rdmsrl(MSR_KERNEL_GS_BASE, ctxt->gs_kernel_base);
 
 	/*
 	 * control registers 
 	 */
-	asm volatile ("movq %%cr0, %0" : "=r" (saved_context.cr0));
-	asm volatile ("movq %%cr2, %0" : "=r" (saved_context.cr2));
-	asm volatile ("movq %%cr3, %0" : "=r" (saved_context.cr3));
-	asm volatile ("movq %%cr4, %0" : "=r" (saved_context.cr4));
+	asm volatile ("movq %%cr0, %0" : "=r" (ctxt->cr0));
+	asm volatile ("movq %%cr2, %0" : "=r" (ctxt->cr2));
+	asm volatile ("movq %%cr3, %0" : "=r" (ctxt->cr3));
+	asm volatile ("movq %%cr4, %0" : "=r" (ctxt->cr4));
+}
+
+void save_processor_state(void)
+{
+	__save_processor_state(&saved_context);
 }
 
 static void
@@ -80,42 +85,47 @@ do_fpu_end(void)
 	mxcsr_feature_mask_init();
 }
 
-void restore_processor_state(void)
+void __restore_processor_state(struct saved_context *ctxt)
 {
 	/*
 	 * control registers
 	 */
-	asm volatile ("movq %0, %%cr4" :: "r" (saved_context.cr4));
-	asm volatile ("movq %0, %%cr3" :: "r" (saved_context.cr3));
-	asm volatile ("movq %0, %%cr2" :: "r" (saved_context.cr2));
-	asm volatile ("movq %0, %%cr0" :: "r" (saved_context.cr0));
+	asm volatile ("movq %0, %%cr4" :: "r" (ctxt->cr4));
+	asm volatile ("movq %0, %%cr3" :: "r" (ctxt->cr3));
+	asm volatile ("movq %0, %%cr2" :: "r" (ctxt->cr2));
+	asm volatile ("movq %0, %%cr0" :: "r" (ctxt->cr0));
 
 	/*
 	 * segment registers
 	 */
-	asm volatile ("movw %0, %%ds" :: "r" (saved_context.ds));
-	asm volatile ("movw %0, %%es" :: "r" (saved_context.es));
-	asm volatile ("movw %0, %%fs" :: "r" (saved_context.fs));
-	load_gs_index(saved_context.gs);
-	asm volatile ("movw %0, %%ss" :: "r" (saved_context.ss));
+	asm volatile ("movw %0, %%ds" :: "r" (ctxt->ds));
+	asm volatile ("movw %0, %%es" :: "r" (ctxt->es));
+	asm volatile ("movw %0, %%fs" :: "r" (ctxt->fs));
+	load_gs_index(ctxt->gs);
+	asm volatile ("movw %0, %%ss" :: "r" (ctxt->ss));
 
-	wrmsrl(MSR_FS_BASE, saved_context.fs_base);
-	wrmsrl(MSR_GS_BASE, saved_context.gs_base);
-	wrmsrl(MSR_KERNEL_GS_BASE, saved_context.gs_kernel_base);
+	wrmsrl(MSR_FS_BASE, ctxt->fs_base);
+	wrmsrl(MSR_GS_BASE, ctxt->gs_base);
+	wrmsrl(MSR_KERNEL_GS_BASE, ctxt->gs_kernel_base);
 
 	/*
 	 * now restore the descriptor tables to their proper values
 	 * ltr is done i fix_processor_context().
 	 */
-	asm volatile ("lgdt %0" :: "m" (saved_context.gdt_limit));
-	asm volatile ("lidt %0" :: "m" (saved_context.idt_limit));
-	asm volatile ("lldt %0" :: "m" (saved_context.ldt));
+	asm volatile ("lgdt %0" :: "m" (ctxt->gdt_limit));
+	asm volatile ("lidt %0" :: "m" (ctxt->idt_limit));
+	asm volatile ("lldt %0" :: "m" (ctxt->ldt));
 
 	fix_processor_context();
 
 	do_fpu_end();
 }
 
+void restore_processor_state(void)
+{
+	__restore_processor_state(&saved_context);
+}
+
 void fix_processor_context(void)
 {
 	int cpu = smp_processor_id();
diff --git a/arch/x86_64/kernel/time.c b/arch/x86_64/kernel/time.c
index d47d3f8de..10c511f50 100644
--- a/arch/x86_64/kernel/time.c
+++ b/arch/x86_64/kernel/time.c
@@ -689,7 +689,7 @@ int __init time_setup(char *str)
 }
 
 static struct irqaction irq0 = {
-	timer_interrupt, SA_INTERRUPT, 0, "timer", NULL, NULL
+	timer_interrupt, SA_INTERRUPT, CPU_MASK_NONE, "timer", NULL, NULL
 };
 
 extern void __init config_acpi_tables(void);
diff --git a/arch/x86_64/kernel/traps.c b/arch/x86_64/kernel/traps.c
index d82da80d8..99d0ec2ab 100644
--- a/arch/x86_64/kernel/traps.c
+++ b/arch/x86_64/kernel/traps.c
@@ -115,7 +115,7 @@ unsigned long *in_exception_stack(int cpu, unsigned long stack)
 		if (stack >= init_tss[cpu].ist[k]  && stack <= end) 
 			return (unsigned long *)end;
 	}
-	return 0;
+	return NULL;
 } 
 
 /*
@@ -140,7 +140,7 @@ void show_trace(unsigned long *stack)
 	if (estack_end) { 
 		while (stack < estack_end) { 
 			addr = *stack++; 
-			if (kernel_text_address(addr)) {  
+			if (__kernel_text_address(addr)) {
 				i += printk_address(addr);
 				i += printk(" "); 
 				if (i > 50) {
@@ -169,7 +169,7 @@ void show_trace(unsigned long *stack)
 			 * down the cause of the crash will be able to figure
 			 * out the call path that was taken.
 			 */
-			 if (kernel_text_address(addr)) {  
+			 if (__kernel_text_address(addr)) {
 				 i += printk_address(addr);
 				 i += printk(" "); 
 				 if (i > 50) { 
@@ -185,7 +185,7 @@ void show_trace(unsigned long *stack)
 
 	while (((long) stack & (THREAD_SIZE-1)) != 0) {
 		addr = *stack++;
-		if (kernel_text_address(addr)) { 	 
+		if (__kernel_text_address(addr)) {
 			i += printk_address(addr);
 			i += printk(" "); 
 			if (i > 50) { 
@@ -448,7 +448,7 @@ asmlinkage void do_##name(struct pt_regs * regs, long error_code) \
 	info.si_signo = signr; \
 	info.si_errno = 0; \
 	info.si_code = sicode; \
-	info.si_addr = (void *)siaddr; \
+	info.si_addr = (void __user *)siaddr; \
 	if (notify_die(DIE_TRAP, str, regs, error_code, trapnr, signr) == NOTIFY_BAD) \
 		return; \
 	do_trap(trapnr, signr, str, regs, error_code, &info); \
@@ -662,7 +662,7 @@ asmlinkage void *do_debug(struct pt_regs * regs, unsigned long error_code)
 	if ((regs->cs & 3) == 0) 
 		goto clear_dr7; 
 
-	info.si_addr = (void *)regs->rip;
+	info.si_addr = (void __user *)regs->rip;
 	force_sig_info(SIGTRAP, &info, tsk);	
 clear_dr7:
 	asm volatile("movq %0,%%db7"::"r"(0UL));
@@ -686,7 +686,7 @@ clear_TF:
  * the correct behaviour even in the presence of the asynchronous
  * IRQ13 behaviour
  */
-void math_error(void *rip)
+void math_error(void __user *rip)
 {
 	struct task_struct * task;
 	siginfo_t info;
@@ -743,7 +743,7 @@ void math_error(void *rip)
 asmlinkage void do_coprocessor_error(struct pt_regs * regs)
 {
 	conditional_sti(regs);
-	math_error((void *)regs->rip);
+	math_error((void __user *)regs->rip);
 }
 
 asmlinkage void bad_intr(void)
@@ -751,7 +751,7 @@ asmlinkage void bad_intr(void)
 	printk("bad interrupt"); 
 }
 
-static inline void simd_math_error(void *rip)
+static inline void simd_math_error(void __user *rip)
 {
 	struct task_struct * task;
 	siginfo_t info;
@@ -802,7 +802,7 @@ static inline void simd_math_error(void *rip)
 asmlinkage void do_simd_coprocessor_error(struct pt_regs * regs)
 {
 	conditional_sti(regs);
-		simd_math_error((void *)regs->rip);
+		simd_math_error((void __user *)regs->rip);
 }
 
 asmlinkage void do_spurious_interrupt_bug(struct pt_regs * regs)
diff --git a/arch/x86_64/kernel/x8664_ksyms.c b/arch/x86_64/kernel/x8664_ksyms.c
index 2b0d63924..1fb138482 100644
--- a/arch/x86_64/kernel/x8664_ksyms.c
+++ b/arch/x86_64/kernel/x8664_ksyms.c
@@ -218,4 +218,3 @@ EXPORT_SYMBOL(flush_tlb_page);
 EXPORT_SYMBOL_GPL(flush_tlb_all);
 #endif
 
-EXPORT_SYMBOL(sys_ioctl);
diff --git a/arch/x86_64/lib/csum-wrappers.c b/arch/x86_64/lib/csum-wrappers.c
index a8e4c189f..c5b166224 100644
--- a/arch/x86_64/lib/csum-wrappers.c
+++ b/arch/x86_64/lib/csum-wrappers.c
@@ -43,7 +43,7 @@ csum_partial_copy_from_user(const char __user *src, char *dst,
 				len -= 2;
 			}
 		}
-		isum = csum_partial_copy_generic((void *)src,dst,len,isum,errp,NULL);
+		isum = csum_partial_copy_generic((__force void *)src,dst,len,isum,errp,NULL);
 		if (likely(*errp == 0)) 
 			return isum;
 	} 
@@ -88,7 +88,7 @@ csum_partial_copy_to_user(const char *src, char __user *dst,
 	}
 
 	*errp = 0;
-	return csum_partial_copy_generic(src, (void *)dst,len,isum,NULL,errp); 
+	return csum_partial_copy_generic(src, (void __force *)dst,len,isum,NULL,errp); 
 } 
 
 EXPORT_SYMBOL(csum_partial_copy_to_user);
diff --git a/arch/x86_64/lib/usercopy.c b/arch/x86_64/lib/usercopy.c
index c83825e5c..a17c85c5b 100644
--- a/arch/x86_64/lib/usercopy.c
+++ b/arch/x86_64/lib/usercopy.c
@@ -145,7 +145,7 @@ long strlen_user(const char __user *s)
 unsigned long copy_in_user(void __user *to, const void __user *from, unsigned len)
 {
 	if (access_ok(VERIFY_WRITE, to, len) && access_ok(VERIFY_READ, from, len)) { 
-		return copy_user_generic((void *)to, (void *)from, len);
+		return copy_user_generic((__force void *)to, (__force void *)from, len);
 	} 
 	return len;		
 }
diff --git a/arch/x86_64/mm/fault.c b/arch/x86_64/mm/fault.c
index 2cdf34b99..32a1d0ce9 100644
--- a/arch/x86_64/mm/fault.c
+++ b/arch/x86_64/mm/fault.c
@@ -389,7 +389,7 @@ bad_area_nosemaphore:
 		info.si_signo = SIGSEGV;
 		info.si_errno = 0;
 		/* info.si_code has been set above */
-		info.si_addr = (void *)address;
+		info.si_addr = (void __user *)address;
 		force_sig_info(SIGSEGV, &info, tsk);
 		return;
 	}
@@ -463,7 +463,7 @@ do_sigbus:
 	info.si_signo = SIGBUS;
 	info.si_errno = 0;
 	info.si_code = BUS_ADRERR;
-	info.si_addr = (void *)address;
+	info.si_addr = (void __user *)address;
 	force_sig_info(SIGBUS, &info, tsk);
 	return;
 
diff --git a/arch/x86_64/mm/init.c b/arch/x86_64/mm/init.c
index fa8cc3648..f393e3355 100644
--- a/arch/x86_64/mm/init.c
+++ b/arch/x86_64/mm/init.c
@@ -60,7 +60,7 @@ void show_mem(void)
 
 	printk("Mem-info:\n");
 	show_free_areas();
-	printk("Free swap:       %6dkB\n",nr_swap_pages<<(PAGE_SHIFT-10));
+	printk("Free swap:       %6ldkB\n", nr_swap_pages<<(PAGE_SHIFT-10));
 
 	for_each_pgdat(pgdat) {
                for (i = 0; i < pgdat->node_spanned_pages; ++i) {
diff --git a/arch/x86_64/mm/numa.c b/arch/x86_64/mm/numa.c
index 36743bf53..598a35c19 100644
--- a/arch/x86_64/mm/numa.c
+++ b/arch/x86_64/mm/numa.c
@@ -182,7 +182,7 @@ void __init numa_initmem_init(unsigned long start_pfn, unsigned long end_pfn)
 	numnodes = 1;
 	for (i = 0; i < NR_CPUS; i++)
 		cpu_to_node[i] = 0;
-	node_to_cpumask[0] = 1;
+	node_to_cpumask[0] = cpumask_of_cpu(0);
 	setup_node_bootmem(0, start_pfn<<PAGE_SHIFT, end_pfn<<PAGE_SHIFT);
 }
 
diff --git a/arch/x86_64/mm/pageattr.c b/arch/x86_64/mm/pageattr.c
index 550770815..61b73dac4 100644
--- a/arch/x86_64/mm/pageattr.c
+++ b/arch/x86_64/mm/pageattr.c
@@ -180,7 +180,7 @@ int change_page_attr(struct page *page, int numpages, pgprot_t prot)
 			unsigned long addr2;
 			addr2 = __START_KERNEL_map + page_to_phys(page);
 			err = __change_page_attr(addr2, page, prot, 
-						 PAGE_KERNEL_EXECUTABLE);
+						 PAGE_KERNEL_EXEC);
 		} 
 	} 	
 	up_write(&init_mm.mmap_sem); 
diff --git a/crypto/Kconfig b/crypto/Kconfig
index d0ed3ce3e..12429ef28 100644
--- a/crypto/Kconfig
+++ b/crypto/Kconfig
@@ -120,7 +120,7 @@ config CRYPTO_SERPENT
 
 config CRYPTO_AES
 	tristate "AES cipher algorithms"
-	depends on CRYPTO
+	depends on CRYPTO && !(X86 && !X86_64)
 	help
 	  AES cipher algorithms (FIPS-197). AES uses the Rijndael 
 	  algorithm.
@@ -138,6 +138,26 @@ config CRYPTO_AES
 
 	  See http://csrc.nist.gov/CryptoToolkit/aes/ for more information.
 
+config CRYPTO_AES_586
+	tristate "AES cipher algorithms (i586)"
+	depends on CRYPTO && (X86 && !X86_64)
+	help
+	  AES cipher algorithms (FIPS-197). AES uses the Rijndael 
+	  algorithm.
+
+	  Rijndael appears to be consistently a very good performer in
+	  both hardware and software across a wide range of computing 
+	  environments regardless of its use in feedback or non-feedback 
+	  modes. Its key setup time is excellent, and its key agility is 
+	  good. Rijndael's very low memory requirements make it very well 
+	  suited for restricted-space environments, in which it also 
+	  demonstrates excellent performance. Rijndael's operations are 
+	  among the easiest to defend against power and timing attacks.	
+
+	  The AES specifies three key sizes: 128, 192 and 256 bits	  
+
+	  See http://csrc.nist.gov/encryption/aes/ for more information.
+
 config CRYPTO_CAST5
 	tristate "CAST5 (CAST-128) cipher algorithm"
 	depends on CRYPTO
@@ -152,6 +172,20 @@ config CRYPTO_CAST6
 	  The CAST6 encryption algorithm (synonymous with CAST-256) is
 	  described in RFC2612.
 
+config CRYPTO_TEA
+	tristate "TEA and XTEA cipher algorithms"
+	depends on CRYPTO
+	help
+	  TEA cipher algorithm.
+
+	  Tiny Encryption Algorithm is a simple cipher that uses
+	  many rounds for security.  It is very fast and uses
+	  little memory.
+
+	  Xtendend Tiny Encryption Algorithm is a modifcation to
+	  the TEA algorithm to address a potential key weakness
+	  in the TEA algorithm.
+
 config CRYPTO_ARC4
 	tristate "ARC4 cipher algorithm"
 	depends on CRYPTO
@@ -163,6 +197,19 @@ config CRYPTO_ARC4
 	  WEP, but it should not be for other purposes because of the
 	  weakness of the algorithm.
 
+config CRYPTO_KHAZAD
+	tristate "Khazad cipher algorithm"
+	depends on CRYPTO
+	help
+	  Khazad cipher algorithm.
+
+	  Khazad was a finalist in the initial NESSIE competition.  It is
+	  an algorithm optimized for 64-bit processors with good performance
+	  on 32-bit processors.  Khazad uses an 128 bit key size.
+
+	  See also:
+	  http://planeta.terra.com.br/informatica/paulobarreto/KhazadPage.html
+
 config CRYPTO_DEFLATE
 	tristate "Deflate compression algorithm"
 	depends on CRYPTO
diff --git a/crypto/Makefile b/crypto/Makefile
index 105429fd2..04428a655 100644
--- a/crypto/Makefile
+++ b/crypto/Makefile
@@ -22,6 +22,8 @@ obj-$(CONFIG_CRYPTO_AES) += aes.o
 obj-$(CONFIG_CRYPTO_CAST5) += cast5.o
 obj-$(CONFIG_CRYPTO_CAST6) += cast6.o
 obj-$(CONFIG_CRYPTO_ARC4) += arc4.o
+obj-$(CONFIG_CRYPTO_TEA) += tea.o
+obj-$(CONFIG_CRYPTO_KHAZAD) += khazad.o
 obj-$(CONFIG_CRYPTO_DEFLATE) += deflate.o
 obj-$(CONFIG_CRYPTO_MICHAEL_MIC) += michael_mic.o
 obj-$(CONFIG_CRYPTO_CRC32C) += crc32c.o
diff --git a/crypto/cipher.c b/crypto/cipher.c
index cdcf3472e..6ab56eb35 100644
--- a/crypto/cipher.c
+++ b/crypto/cipher.c
@@ -52,8 +52,8 @@ static int crypt(struct crypto_tfm *tfm,
 {
 	struct scatter_walk walk_in, walk_out;
 	const unsigned int bsize = crypto_tfm_alg_blocksize(tfm);
-	u8 tmp_src[nbytes > src->length ? bsize : 0];
-	u8 tmp_dst[nbytes > dst->length ? bsize : 0];
+	u8 tmp_src[bsize];
+	u8 tmp_dst[bsize];
 
 	if (!nbytes)
 		return 0;
diff --git a/crypto/deflate.c b/crypto/deflate.c
index e2726b652..77d7655d3 100644
--- a/crypto/deflate.c
+++ b/crypto/deflate.c
@@ -39,44 +39,16 @@
 #define DEFLATE_DEF_MEMLEVEL		MAX_MEM_LEVEL
 
 struct deflate_ctx {
-	int comp_initialized;
-	int decomp_initialized;
 	struct z_stream_s comp_stream;
 	struct z_stream_s decomp_stream;
 };
 
-static inline int deflate_gfp(void)
-{
-	return in_softirq() ? GFP_ATOMIC : GFP_KERNEL;
-}
-
-static int deflate_init(void *ctx)
-{
-	return 0;
-}
-
-static void deflate_exit(void *ctx)
-{
-	struct deflate_ctx *dctx = ctx;
-
-	if (dctx->comp_initialized)
-		vfree(dctx->comp_stream.workspace);
-	if (dctx->decomp_initialized)
-		kfree(dctx->decomp_stream.workspace);
-}
-
-/*
- * Lazy initialization to make interface simple without allocating
- * un-needed workspaces.  Thus can be called in softirq context.
- */
 static int deflate_comp_init(struct deflate_ctx *ctx)
 {
 	int ret = 0;
 	struct z_stream_s *stream = &ctx->comp_stream;
 
-	stream->workspace = __vmalloc(zlib_deflate_workspacesize(),
-	                              deflate_gfp()|__GFP_HIGHMEM,
-	                              PAGE_KERNEL);
+	stream->workspace = vmalloc(zlib_deflate_workspacesize());
 	if (!stream->workspace ) {
 		ret = -ENOMEM;
 		goto out;
@@ -89,7 +61,6 @@ static int deflate_comp_init(struct deflate_ctx *ctx)
 		ret = -EINVAL;
 		goto out_free;
 	}
-	ctx->comp_initialized = 1;
 out:	
 	return ret;
 out_free:
@@ -102,8 +73,7 @@ static int deflate_decomp_init(struct deflate_ctx *ctx)
 	int ret = 0;
 	struct z_stream_s *stream = &ctx->decomp_stream;
 
-	stream->workspace = kmalloc(zlib_inflate_workspacesize(),
-	                            deflate_gfp());
+	stream->workspace = kmalloc(zlib_inflate_workspacesize(), GFP_KERNEL);
 	if (!stream->workspace ) {
 		ret = -ENOMEM;
 		goto out;
@@ -114,7 +84,6 @@ static int deflate_decomp_init(struct deflate_ctx *ctx)
 		ret = -EINVAL;
 		goto out_free;
 	}
-	ctx->decomp_initialized = 1;
 out:
 	return ret;
 out_free:
@@ -122,6 +91,36 @@ out_free:
 	goto out;
 }
 
+static void deflate_comp_exit(struct deflate_ctx *ctx)
+{
+	vfree(ctx->comp_stream.workspace);
+}
+
+static void deflate_decomp_exit(struct deflate_ctx *ctx)
+{
+	kfree(ctx->decomp_stream.workspace);
+}
+
+static int deflate_init(void *ctx)
+{
+	int ret;
+	
+	ret = deflate_comp_init(ctx);
+	if (ret)
+		goto out;
+	ret = deflate_decomp_init(ctx);
+	if (ret)
+		deflate_comp_exit(ctx);
+out:
+	return ret;
+}
+
+static void deflate_exit(void *ctx)
+{
+	deflate_comp_exit(ctx);
+	deflate_decomp_exit(ctx);
+}
+
 static int deflate_compress(void *ctx, const u8 *src, unsigned int slen,
 	                    u8 *dst, unsigned int *dlen)
 {
@@ -129,12 +128,6 @@ static int deflate_compress(void *ctx, const u8 *src, unsigned int slen,
 	struct deflate_ctx *dctx = ctx;
 	struct z_stream_s *stream = &dctx->comp_stream;
 
-	if (!dctx->comp_initialized) {
-		ret = deflate_comp_init(dctx);
-		if (ret)
-			goto out;
-	}
-
 	ret = zlib_deflateReset(stream);
 	if (ret != Z_OK) {
 		ret = -EINVAL;
@@ -165,12 +158,6 @@ static int deflate_decompress(void *ctx, const u8 *src, unsigned int slen,
 	struct deflate_ctx *dctx = ctx;
 	struct z_stream_s *stream = &dctx->decomp_stream;
 
-	if (!dctx->decomp_initialized) {
-		ret = deflate_decomp_init(dctx);
-		if (ret)
-			goto out;
-	}
-
 	ret = zlib_inflateReset(stream);
 	if (ret != Z_OK) {
 		ret = -EINVAL;
diff --git a/crypto/tcrypt.c b/crypto/tcrypt.c
index 152ad41ce..f1e631b9c 100644
--- a/crypto/tcrypt.c
+++ b/crypto/tcrypt.c
@@ -61,7 +61,7 @@ static char *tvmem;
 static char *check[] = {
 	"des", "md5", "des3_ede", "rot13", "sha1", "sha256", "blowfish",
 	"twofish", "serpent", "sha384", "sha512", "md4", "aes", "cast6", 
-	"arc4", "michael_mic", "deflate", "crc32c", NULL
+	"arc4", "michael_mic", "deflate", "crc32c", "tea", "xtea", NULL
 };
 
 static void
@@ -665,6 +665,19 @@ do_test(void)
 		test_cipher ("arc4", MODE_ECB, ENCRYPT, arc4_enc_tv_template, ARC4_ENC_TEST_VECTORS);
 		test_cipher ("arc4", MODE_ECB, DECRYPT, arc4_dec_tv_template, ARC4_DEC_TEST_VECTORS);
 
+		//TEA
+		test_cipher ("tea", MODE_ECB, ENCRYPT, tea_enc_tv_template, TEA_ENC_TEST_VECTORS);
+		test_cipher ("tea", MODE_ECB, DECRYPT, tea_dec_tv_template, TEA_DEC_TEST_VECTORS);
+
+
+		//XTEA
+		test_cipher ("xtea", MODE_ECB, ENCRYPT, xtea_enc_tv_template, XTEA_ENC_TEST_VECTORS);
+		test_cipher ("xtea", MODE_ECB, DECRYPT, xtea_dec_tv_template, XTEA_DEC_TEST_VECTORS);
+
+		//KHAZAD
+		test_cipher ("khazad", MODE_ECB, ENCRYPT, khazad_enc_tv_template, KHAZAD_ENC_TEST_VECTORS);
+		test_cipher ("khazad", MODE_ECB, DECRYPT, khazad_dec_tv_template, KHAZAD_DEC_TEST_VECTORS);
+
 		test_hash("sha384", sha384_tv_template, SHA384_TEST_VECTORS);
 		test_hash("sha512", sha512_tv_template, SHA512_TEST_VECTORS);
 		test_deflate();
@@ -763,6 +776,21 @@ do_test(void)
 		test_crc32c();
 		break;
 
+	case 19:
+		test_cipher ("tea", MODE_ECB, ENCRYPT, tea_enc_tv_template, TEA_ENC_TEST_VECTORS);
+		test_cipher ("tea", MODE_ECB, DECRYPT, tea_dec_tv_template, TEA_DEC_TEST_VECTORS);
+		break;
+
+	case 20:
+		test_cipher ("xtea", MODE_ECB, ENCRYPT, xtea_enc_tv_template, XTEA_ENC_TEST_VECTORS);
+		test_cipher ("xtea", MODE_ECB, DECRYPT, xtea_dec_tv_template, XTEA_DEC_TEST_VECTORS);
+		break;
+
+	case 21:
+		test_cipher ("khazad", MODE_ECB, ENCRYPT, khazad_enc_tv_template, KHAZAD_ENC_TEST_VECTORS);
+		test_cipher ("khazad", MODE_ECB, DECRYPT, khazad_dec_tv_template, KHAZAD_DEC_TEST_VECTORS);
+		break;
+
 #ifdef CONFIG_CRYPTO_HMAC
 	case 100:
 		test_hmac("md5", hmac_md5_tv_template, HMAC_MD5_TEST_VECTORS);
diff --git a/crypto/tcrypt.h b/crypto/tcrypt.h
index 43563450c..56a825d65 100644
--- a/crypto/tcrypt.h
+++ b/crypto/tcrypt.h
@@ -1630,6 +1630,291 @@ struct cipher_testvec arc4_dec_tv_template[] =
 	},
 };
 
+/* 
+ * TEA test vectors
+ */
+#define TEA_ENC_TEST_VECTORS	4
+#define TEA_DEC_TEST_VECTORS	4
+
+struct cipher_testvec tea_enc_tv_template[] =
+{
+	{
+		.key    = { [0 ... 15] = 0x00 },
+		.klen	= 16,
+		.input  = { [0 ... 8] = 0x00 },
+		.ilen	= 8,
+		.result	= { 0x0a, 0x3a, 0xea, 0x41, 0x40, 0xa9, 0xba, 0x94 },
+		.rlen	= 8,
+	}, {
+		.key	= { 0x2b, 0x02, 0x05, 0x68, 0x06, 0x14, 0x49, 0x76,
+			    0x77, 0x5d, 0x0e, 0x26, 0x6c, 0x28, 0x78, 0x43 },
+		.klen	= 16,
+		.input	= { 0x74, 0x65, 0x73, 0x74, 0x20, 0x6d, 0x65, 0x2e },
+		.ilen	= 8,
+		.result	= { 0x77, 0x5d, 0x2a, 0x6a, 0xf6, 0xce, 0x92, 0x09 },
+		.rlen	= 8,
+	}, {
+		.key	= { 0x09, 0x65, 0x43, 0x11, 0x66, 0x44, 0x39, 0x25,
+			    0x51, 0x3a, 0x16, 0x10, 0x0a, 0x08, 0x12, 0x6e },
+		.klen	= 16,
+		.input	= { 0x6c, 0x6f, 0x6e, 0x67, 0x65, 0x72, 0x5f, 0x74, 
+			    0x65, 0x73, 0x74, 0x5f, 0x76, 0x65, 0x63, 0x74 },
+		.ilen	= 16,
+		.result	= { 0xbe, 0x7a, 0xbb, 0x81, 0x95, 0x2d, 0x1f, 0x1e, 
+			    0xdd, 0x89, 0xa1, 0x25, 0x04, 0x21, 0xdf, 0x95 },
+		.rlen	= 16,
+	}, {
+		.key	= { 0x4d, 0x76, 0x32, 0x17, 0x05, 0x3f, 0x75, 0x2c,
+			    0x5d, 0x04, 0x16, 0x36, 0x15, 0x72, 0x63, 0x2f },
+		.klen	= 16,
+		.input	= { 0x54, 0x65, 0x61, 0x20, 0x69, 0x73, 0x20, 0x67, 
+			    0x6f, 0x6f, 0x64, 0x20, 0x66, 0x6f, 0x72, 0x20, 
+			    0x79, 0x6f, 0x75, 0x21, 0x21, 0x21, 0x20, 0x72, 
+			    0x65, 0x61, 0x6c, 0x6c, 0x79, 0x21, 0x21, 0x21 },
+		.ilen	= 32,
+		.result	= { 0xe0, 0x4d, 0x5d, 0x3c, 0xb7, 0x8c, 0x36, 0x47, 
+			    0x94, 0x18, 0x95, 0x91, 0xa9, 0xfc, 0x49, 0xf8, 
+			    0x44, 0xd1, 0x2d, 0xc2, 0x99, 0xb8, 0x08, 0x2a, 
+			    0x07, 0x89, 0x73, 0xc2, 0x45, 0x92, 0xc6, 0x90 },
+		.rlen	= 32,
+	}
+};
+
+struct cipher_testvec tea_dec_tv_template[] =
+{
+	{
+		.key    = { [0 ... 15] = 0x00 },
+		.klen	= 16,
+		.input	= { 0x0a, 0x3a, 0xea, 0x41, 0x40, 0xa9, 0xba, 0x94 },
+		.ilen	= 8,
+		.result = { [0 ... 8] = 0x00 },
+		.rlen	= 8,
+	}, {
+		.key	= { 0x2b, 0x02, 0x05, 0x68, 0x06, 0x14, 0x49, 0x76,
+			    0x77, 0x5d, 0x0e, 0x26, 0x6c, 0x28, 0x78, 0x43 },
+		.klen	= 16,
+		.input	= { 0x77, 0x5d, 0x2a, 0x6a, 0xf6, 0xce, 0x92, 0x09 },
+		.ilen	= 8,
+		.result	= { 0x74, 0x65, 0x73, 0x74, 0x20, 0x6d, 0x65, 0x2e },
+		.rlen	= 8,
+	}, {
+		.key	= { 0x09, 0x65, 0x43, 0x11, 0x66, 0x44, 0x39, 0x25,
+			    0x51, 0x3a, 0x16, 0x10, 0x0a, 0x08, 0x12, 0x6e },
+		.klen	= 16,
+		.input	= { 0xbe, 0x7a, 0xbb, 0x81, 0x95, 0x2d, 0x1f, 0x1e,
+                            0xdd, 0x89, 0xa1, 0x25, 0x04, 0x21, 0xdf, 0x95 },
+                .ilen   = 16,
+		.result	= { 0x6c, 0x6f, 0x6e, 0x67, 0x65, 0x72, 0x5f, 0x74, 
+			    0x65, 0x73, 0x74, 0x5f, 0x76, 0x65, 0x63, 0x74 },
+		.rlen	= 16,
+	}, {
+		.key	= { 0x4d, 0x76, 0x32, 0x17, 0x05, 0x3f, 0x75, 0x2c,
+			    0x5d, 0x04, 0x16, 0x36, 0x15, 0x72, 0x63, 0x2f },
+		.klen	= 16,
+		.input	= { 0xe0, 0x4d, 0x5d, 0x3c, 0xb7, 0x8c, 0x36, 0x47,
+                            0x94, 0x18, 0x95, 0x91, 0xa9, 0xfc, 0x49, 0xf8,
+                            0x44, 0xd1, 0x2d, 0xc2, 0x99, 0xb8, 0x08, 0x2a,
+                            0x07, 0x89, 0x73, 0xc2, 0x45, 0x92, 0xc6, 0x90 },
+		.ilen	= 32,
+		.result	= { 0x54, 0x65, 0x61, 0x20, 0x69, 0x73, 0x20, 0x67, 
+			    0x6f, 0x6f, 0x64, 0x20, 0x66, 0x6f, 0x72, 0x20, 
+			    0x79, 0x6f, 0x75, 0x21, 0x21, 0x21, 0x20, 0x72, 
+			    0x65, 0x61, 0x6c, 0x6c, 0x79, 0x21, 0x21, 0x21 },
+		.rlen	= 32,
+	}
+};
+
+/* 
+ * XTEA test vectors 
+ */
+#define XTEA_ENC_TEST_VECTORS	4
+#define XTEA_DEC_TEST_VECTORS	4
+
+struct cipher_testvec xtea_enc_tv_template[] =
+{
+	{
+		.key    = { [0 ... 15] = 0x00 },
+		.klen	= 16,
+		.input  = { [0 ... 8] = 0x00 },
+		.ilen	= 8,
+		.result	= { 0xaa, 0x22, 0x96, 0xe5, 0x6c, 0x61, 0xf3, 0x45 },
+		.rlen	= 8,
+	}, {
+		.key	= { 0x2b, 0x02, 0x05, 0x68, 0x06, 0x14, 0x49, 0x76,
+			    0x77, 0x5d, 0x0e, 0x26, 0x6c, 0x28, 0x78, 0x43 },
+		.klen	= 16,
+		.input	= { 0x74, 0x65, 0x73, 0x74, 0x20, 0x6d, 0x65, 0x2e },
+		.ilen	= 8,
+		.result	= { 0x82, 0x3e, 0xeb, 0x35, 0xdc, 0xdd, 0xd9, 0xc3 },
+		.rlen	= 8,
+	}, {
+		.key	= { 0x09, 0x65, 0x43, 0x11, 0x66, 0x44, 0x39, 0x25,
+			    0x51, 0x3a, 0x16, 0x10, 0x0a, 0x08, 0x12, 0x6e },
+		.klen	= 16,
+		.input	= { 0x6c, 0x6f, 0x6e, 0x67, 0x65, 0x72, 0x5f, 0x74, 
+			    0x65, 0x73, 0x74, 0x5f, 0x76, 0x65, 0x63, 0x74 },
+		.ilen	= 16,
+		.result	= { 0xe2, 0x04, 0xdb, 0xf2, 0x89, 0x85, 0x9e, 0xea, 
+			    0x61, 0x35, 0xaa, 0xed, 0xb5, 0xcb, 0x71, 0x2c },
+		.rlen	= 16,
+	}, {
+		.key	= { 0x4d, 0x76, 0x32, 0x17, 0x05, 0x3f, 0x75, 0x2c,
+			    0x5d, 0x04, 0x16, 0x36, 0x15, 0x72, 0x63, 0x2f },
+		.klen	= 16,
+		.input	= { 0x54, 0x65, 0x61, 0x20, 0x69, 0x73, 0x20, 0x67, 
+			    0x6f, 0x6f, 0x64, 0x20, 0x66, 0x6f, 0x72, 0x20, 
+			    0x79, 0x6f, 0x75, 0x21, 0x21, 0x21, 0x20, 0x72, 
+			    0x65, 0x61, 0x6c, 0x6c, 0x79, 0x21, 0x21, 0x21 },
+		.ilen	= 32,
+		.result	= { 0x0b, 0x03, 0xcd, 0x8a, 0xbe, 0x95, 0xfd, 0xb1, 
+			    0xc1, 0x44, 0x91, 0x0b, 0xa5, 0xc9, 0x1b, 0xb4, 
+			    0xa9, 0xda, 0x1e, 0x9e, 0xb1, 0x3e, 0x2a, 0x8f, 
+			    0xea, 0xa5, 0x6a, 0x85, 0xd1, 0xf4, 0xa8, 0xa5 },
+		.rlen	= 32,
+	}
+};
+
+struct cipher_testvec xtea_dec_tv_template[] =
+{
+	{
+		.key    = { [0 ... 15] = 0x00 },
+		.klen	= 16,
+		.input	= { 0xaa, 0x22, 0x96, 0xe5, 0x6c, 0x61, 0xf3, 0x45 },
+		.ilen	= 8,
+		.result = { [0 ... 8] = 0x00 },
+		.rlen	= 8,
+	}, {
+		.key	= { 0x2b, 0x02, 0x05, 0x68, 0x06, 0x14, 0x49, 0x76,
+			    0x77, 0x5d, 0x0e, 0x26, 0x6c, 0x28, 0x78, 0x43 },
+		.klen	= 16,
+		.input	= { 0x82, 0x3e, 0xeb, 0x35, 0xdc, 0xdd, 0xd9, 0xc3 },
+		.ilen	= 8,
+		.result	= { 0x74, 0x65, 0x73, 0x74, 0x20, 0x6d, 0x65, 0x2e },
+		.rlen	= 8,
+	}, {
+		.key	= { 0x09, 0x65, 0x43, 0x11, 0x66, 0x44, 0x39, 0x25,
+			    0x51, 0x3a, 0x16, 0x10, 0x0a, 0x08, 0x12, 0x6e },
+		.klen	= 16,
+		.input	= { 0xe2, 0x04, 0xdb, 0xf2, 0x89, 0x85, 0x9e, 0xea, 
+			    0x61, 0x35, 0xaa, 0xed, 0xb5, 0xcb, 0x71, 0x2c },
+		.ilen	= 16,
+		.result	= { 0x6c, 0x6f, 0x6e, 0x67, 0x65, 0x72, 0x5f, 0x74, 
+			    0x65, 0x73, 0x74, 0x5f, 0x76, 0x65, 0x63, 0x74 },
+		.rlen	= 16,
+	}, {
+		.key	= { 0x4d, 0x76, 0x32, 0x17, 0x05, 0x3f, 0x75, 0x2c,
+			    0x5d, 0x04, 0x16, 0x36, 0x15, 0x72, 0x63, 0x2f },
+		.klen	= 16,
+		.input	= { 0x0b, 0x03, 0xcd, 0x8a, 0xbe, 0x95, 0xfd, 0xb1, 
+			    0xc1, 0x44, 0x91, 0x0b, 0xa5, 0xc9, 0x1b, 0xb4, 
+			    0xa9, 0xda, 0x1e, 0x9e, 0xb1, 0x3e, 0x2a, 0x8f, 
+			    0xea, 0xa5, 0x6a, 0x85, 0xd1, 0xf4, 0xa8, 0xa5 },
+		.ilen	= 32,
+		.result	= { 0x54, 0x65, 0x61, 0x20, 0x69, 0x73, 0x20, 0x67, 
+			    0x6f, 0x6f, 0x64, 0x20, 0x66, 0x6f, 0x72, 0x20, 
+			    0x79, 0x6f, 0x75, 0x21, 0x21, 0x21, 0x20, 0x72, 
+			    0x65, 0x61, 0x6c, 0x6c, 0x79, 0x21, 0x21, 0x21 },
+		.rlen	= 32,
+	}
+};
+
+/*
+ * KHAZAD test vectors.
+ */
+#define KHAZAD_ENC_TEST_VECTORS 5
+#define KHAZAD_DEC_TEST_VECTORS 5
+
+struct cipher_testvec khazad_enc_tv_template[] = { 
+	{ 
+		.key	= { 0x80, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 
+			    0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00 },
+		.klen	= 16,
+		.input	= { 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00 },
+		.ilen	= 8,
+		.result	= { 0x49, 0xa4, 0xce, 0x32, 0xac, 0x19, 0x0e, 0x3f },
+		.rlen	= 8,
+	}, {
+		.key	= { 0x38, 0x38, 0x38, 0x38, 0x38, 0x38, 0x38, 0x38,
+			    0x38, 0x38, 0x38, 0x38, 0x38, 0x38, 0x38, 0x38 },
+		.klen	= 16,
+		.input	= { 0x38, 0x38, 0x38, 0x38, 0x38, 0x38, 0x38, 0x38 },
+		.ilen	= 8,
+		.result	= { 0x7e, 0x82, 0x12, 0xa1, 0Xd9, 0X5b, 0Xe4, 0Xf9 },
+		.rlen	= 8,
+	}, {
+		.key	= { 0Xa2, 0Xa2, 0Xa2, 0Xa2, 0Xa2, 0Xa2, 0Xa2, 0Xa2,
+			    0Xa2, 0Xa2, 0Xa2, 0Xa2, 0Xa2, 0Xa2, 0Xa2, 0Xa2 },
+		.klen	= 16,
+		.input	= { 0Xa2, 0Xa2, 0Xa2, 0Xa2, 0Xa2, 0Xa2, 0Xa2, 0Xa2 },
+		.ilen	= 8,
+		.result	= { 0Xaa, 0Xbe, 0Xc1, 0X95, 0Xc5, 0X94, 0X1a, 0X9c },
+		.rlen	= 8,
+	}, {
+		.key	= { 0X2f, 0X2f, 0X2f, 0X2f, 0X2f, 0X2f, 0X2f, 0X2f,
+			    0X2f, 0X2f, 0X2f, 0X2f, 0X2f, 0X2f, 0X2f, 0X2f },
+		.klen	= 16,
+		.input	= { 0X2f, 0X2f, 0X2f, 0X2f, 0X2f, 0X2f, 0X2f, 0X2f },
+		.ilen	= 8,
+		.result = { 0X04, 0X74, 0Xf5, 0X70, 0X50, 0X16, 0Xd3, 0Xb8 },
+		.rlen	= 8,
+	}, {
+		.key	= { 0X2f, 0X2f, 0X2f, 0X2f, 0X2f, 0X2f, 0X2f, 0X2f,
+			    0X2f, 0X2f, 0X2f, 0X2f, 0X2f, 0X2f, 0X2f, 0X2f },
+		.klen	= 16,
+		.input	= { 0X2f, 0X2f, 0X2f, 0X2f, 0X2f, 0X2f, 0X2f, 0X2f ,
+			    0X2f, 0X2f, 0X2f, 0X2f, 0X2f, 0X2f, 0X2f, 0X2f },
+		.ilen	= 16,
+		.result = { 0X04, 0X74, 0Xf5, 0X70, 0X50, 0X16, 0Xd3, 0Xb8 ,
+			    0X04, 0X74, 0Xf5, 0X70, 0X50, 0X16, 0Xd3, 0Xb8 },
+		.rlen	= 16,
+	},
+};
+
+struct cipher_testvec khazad_dec_tv_template[] = { 
+	{
+		.key	= { 0x80, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 
+			    0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00 },
+		.klen	= 16,
+		.input	= { 0X49, 0Xa4, 0Xce, 0X32, 0Xac, 0X19, 0X0e, 0X3f },
+		.ilen	= 8,
+		.result	= { 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00 },
+		.rlen	= 8,
+	}, {
+		.key	= { 0x38, 0x38, 0x38, 0x38, 0x38, 0x38, 0x38, 0x38,
+			    0x38, 0x38, 0x38, 0x38, 0x38, 0x38, 0x38, 0x38 },
+		.klen	= 16,
+		.input	= { 0X7e, 0X82, 0X12, 0Xa1, 0Xd9, 0X5b, 0Xe4, 0Xf9 },
+		.ilen	= 8,
+		.result	= { 0x38, 0x38, 0x38, 0x38, 0x38, 0x38, 0x38, 0x38 },
+		.rlen	= 8,
+	}, {
+		.key	= { 0Xa2, 0Xa2, 0Xa2, 0Xa2, 0Xa2, 0Xa2, 0Xa2, 0Xa2,
+			    0Xa2, 0Xa2, 0Xa2, 0Xa2, 0Xa2, 0Xa2, 0Xa2, 0Xa2 },
+		.klen	= 16,
+		.input	= { 0Xaa, 0Xbe, 0Xc1, 0X95, 0Xc5, 0X94, 0X1a, 0X9c },
+		.ilen	= 8,
+		.result	= { 0Xa2, 0Xa2, 0Xa2, 0Xa2, 0Xa2, 0Xa2, 0Xa2, 0Xa2 },
+		.rlen	= 8,
+	}, {
+		.key	= { 0x2f, 0X2f, 0X2f, 0X2f, 0X2f, 0X2f, 0X2f, 0X2f,
+			    0X2f, 0X2f, 0X2f, 0X2f, 0X2f, 0X2f, 0X2f, 0X2f },
+		.klen	= 16,
+		.input = { 0X04, 0X74, 0Xf5, 0X70, 0X50, 0X16, 0Xd3, 0Xb8 },
+		.ilen	= 8,
+		.result	= { 0X2f, 0X2f, 0X2f, 0X2f, 0X2f, 0X2f, 0X2f, 0X2f },
+		.rlen	= 8,
+	}, {
+		.key	= { 0X2f, 0X2f, 0X2f, 0X2f, 0X2f, 0X2f, 0X2f, 0X2f,
+			    0X2f, 0X2f, 0X2f, 0X2f, 0X2f, 0X2f, 0X2f, 0X2f },
+		.klen	= 16,
+		.input = { 0X04, 0X74, 0Xf5, 0X70, 0X50, 0X16, 0Xd3, 0Xb8 ,
+			    0X04, 0X74, 0Xf5, 0X70, 0X50, 0X16, 0Xd3, 0Xb8 },
+		.ilen	= 16,
+		.result	= { 0X2f, 0X2f, 0X2f, 0X2f, 0X2f, 0X2f, 0X2f, 0X2f ,
+			    0X2f, 0X2f, 0X2f, 0X2f, 0X2f, 0X2f, 0X2f, 0X2f },
+		.rlen	= 16,
+	},
+};
 
 /*
  * Compression stuff.
@@ -1771,4 +2056,5 @@ struct hash_testvec michael_mic_tv_template[] =
 		.digest = { 0x0a, 0x94, 0x2b, 0x12, 0x4e, 0xca, 0xa5, 0x46 },
 	}
 };
+
 #endif	/* _CRYPTO_TCRYPT_H */
diff --git a/crypto/twofish.c b/crypto/twofish.c
index 9feced721..5d6d02c1a 100644
--- a/crypto/twofish.c
+++ b/crypto/twofish.c
@@ -663,7 +663,10 @@ static int twofish_setkey(void *cx, const u8 *key,
 
 	/* Check key length. */
 	if (key_len != 16 && key_len != 24 && key_len != 32)
+	{
+		*flags |= CRYPTO_TFM_RES_BAD_KEY_LEN;
 		return -EINVAL; /* unsupported key length */
+	}
 
 	/* Compute the first two words of the S vector.  The magic numbers are
 	 * the entries of the RS matrix, preprocessed through poly_to_exp. The
diff --git a/drivers/Kconfig b/drivers/Kconfig
index 1387b98c0..3270c2a3a 100644
--- a/drivers/Kconfig
+++ b/drivers/Kconfig
@@ -42,6 +42,8 @@ source "drivers/char/Kconfig"
 
 source "drivers/i2c/Kconfig"
 
+source "drivers/w1/Kconfig"
+
 source "drivers/misc/Kconfig"
 
 source "drivers/media/Kconfig"
diff --git a/drivers/Makefile b/drivers/Makefile
index c767329e9..847d2c1ed 100644
--- a/drivers/Makefile
+++ b/drivers/Makefile
@@ -42,6 +42,7 @@ obj-$(CONFIG_GAMEPORT)		+= input/gameport/
 obj-$(CONFIG_SERIO)		+= input/serio/
 obj-$(CONFIG_I2O)		+= message/
 obj-$(CONFIG_I2C)		+= i2c/
+obj-$(CONFIG_W1)		+= w1/
 obj-$(CONFIG_PHONE)		+= telephony/
 obj-$(CONFIG_MD)		+= md/
 obj-$(CONFIG_BT)		+= bluetooth/
diff --git a/drivers/acpi/Kconfig b/drivers/acpi/Kconfig
index 1a537e08e..a742764db 100644
--- a/drivers/acpi/Kconfig
+++ b/drivers/acpi/Kconfig
@@ -267,7 +267,7 @@ config X86_PM_TIMER
 	  (TSC) timing source.
 
 	  So, if you see messages like 'Losing too many ticks!' in the
-	  kernel logs, and/or you are using a this on a notebook which
+	  kernel logs, and/or you are using this on a notebook which
 	  does not yet have an HPET, you should say "Y" here.
 
 endmenu
diff --git a/drivers/acpi/namespace/nsalloc.c b/drivers/acpi/namespace/nsalloc.c
index f7a216c2f..c9dd49ff7 100644
--- a/drivers/acpi/namespace/nsalloc.c
+++ b/drivers/acpi/namespace/nsalloc.c
@@ -496,14 +496,14 @@ acpi_ns_delete_namespace_subtree (
 
 			/* Check if this node has any children */
 
-			if (acpi_ns_get_next_node (ACPI_TYPE_ANY, child_node, 0)) {
+			if (acpi_ns_get_next_node (ACPI_TYPE_ANY, child_node, NULL)) {
 				/*
 				 * There is at least one child of this node,
 				 * visit the node
 				 */
 				level++;
 				parent_node   = child_node;
-				child_node    = 0;
+				child_node    = NULL;
 			}
 		}
 		else {
diff --git a/drivers/acpi/namespace/nsdumpdv.c b/drivers/acpi/namespace/nsdumpdv.c
index d249d42b0..7196a0112 100644
--- a/drivers/acpi/namespace/nsdumpdv.c
+++ b/drivers/acpi/namespace/nsdumpdv.c
@@ -128,7 +128,7 @@ acpi_ns_dump_root_devices (void)
 		return;
 	}
 
-	status = acpi_get_handle (0, ACPI_NS_SYSTEM_BUS, &sys_bus_handle);
+	status = acpi_get_handle(NULL, ACPI_NS_SYSTEM_BUS, &sys_bus_handle);
 	if (ACPI_FAILURE (status)) {
 		return;
 	}
diff --git a/drivers/acpi/namespace/nsload.c b/drivers/acpi/namespace/nsload.c
index 077548496..314ec6659 100644
--- a/drivers/acpi/namespace/nsload.c
+++ b/drivers/acpi/namespace/nsload.c
@@ -352,7 +352,7 @@ acpi_ns_delete_subtree (
 
 
 	parent_handle = start_handle;
-	child_handle = 0;
+	child_handle = NULL;
 	level        = 1;
 
 	/*
@@ -373,14 +373,14 @@ acpi_ns_delete_subtree (
 			/* Check if this object has any children */
 
 			if (ACPI_SUCCESS (acpi_get_next_object (ACPI_TYPE_ANY, child_handle,
-					 0, &dummy))) {
+					 NULL, &dummy))) {
 				/*
 				 * There is at least one child of this object,
 				 * visit the object
 				 */
 				level++;
 				parent_handle = child_handle;
-				child_handle = 0;
+				child_handle = NULL;
 			}
 		}
 		else {
diff --git a/drivers/acpi/namespace/nswalk.c b/drivers/acpi/namespace/nswalk.c
index 130d0c006..5482e74de 100644
--- a/drivers/acpi/namespace/nswalk.c
+++ b/drivers/acpi/namespace/nswalk.c
@@ -183,7 +183,7 @@ acpi_ns_walk_namespace (
 	/* Null child means "get first node" */
 
 	parent_node = start_node;
-	child_node  = 0;
+	child_node  = NULL;
 	child_type  = ACPI_TYPE_ANY;
 	level       = 1;
 
@@ -258,14 +258,14 @@ acpi_ns_walk_namespace (
 			 * maximum depth has been reached.
 			 */
 			if ((level < max_depth) && (status != AE_CTRL_DEPTH)) {
-				if (acpi_ns_get_next_node (ACPI_TYPE_ANY, child_node, 0)) {
+				if (acpi_ns_get_next_node (ACPI_TYPE_ANY, child_node, NULL)) {
 					/*
 					 * There is at least one child of this
 					 * node, visit the onde
 					 */
 					level++;
 					parent_node   = child_node;
-					child_node    = 0;
+					child_node    = NULL;
 				}
 			}
 		}
diff --git a/drivers/acpi/pci_irq.c b/drivers/acpi/pci_irq.c
index 8e73079df..23e994522 100644
--- a/drivers/acpi/pci_irq.c
+++ b/drivers/acpi/pci_irq.c
@@ -35,12 +35,6 @@
 #include <linux/pm.h>
 #include <linux/pci.h>
 #include <linux/acpi.h>
-#ifdef CONFIG_X86_IO_APIC
-#include <asm/mpspec.h>
-#endif
-#ifdef CONFIG_IOSAPIC
-# include <asm/iosapic.h>
-#endif
 #include <acpi/acpi_bus.h>
 #include <acpi/acpi_drivers.h>
 
@@ -50,10 +44,6 @@ ACPI_MODULE_NAME		("pci_irq")
 
 struct acpi_prt_list		acpi_prt;
 
-#ifdef CONFIG_X86
-extern void eisa_set_level_irq(unsigned int irq);
-#endif
-
 
 /* --------------------------------------------------------------------------
                          PCI IRQ Routing Table (PRT) Support
@@ -237,12 +227,18 @@ acpi_pci_irq_add_prt (
                           PCI Interrupt Routing Support
    -------------------------------------------------------------------------- */
 
-int
-acpi_pci_irq_lookup (struct pci_bus *bus, int device, int pin)
+static int
+acpi_pci_irq_lookup (
+	struct pci_bus		*bus,
+	int			device,
+	int			pin,
+	int			*edge_level,
+	int			*active_high_low)
 {
 	struct acpi_prt_entry	*entry = NULL;
 	int segment = pci_domain_nr(bus);
 	int bus_nr = bus->number;
+	int irq;
 
 	ACPI_FUNCTION_TRACE("acpi_pci_irq_lookup");
 
@@ -255,28 +251,30 @@ acpi_pci_irq_lookup (struct pci_bus *bus, int device, int pin)
 		ACPI_DEBUG_PRINT((ACPI_DB_INFO, "PRT entry not found\n"));
 		return_VALUE(0);
 	}
-
-	if (!entry->irq && entry->link.handle) {
-		entry->irq = acpi_pci_link_get_irq(entry->link.handle, entry->link.index, NULL, NULL);
-		if (!entry->irq) {
+	
+	if (entry->link.handle) {
+		irq = acpi_pci_link_get_irq(entry->link.handle, entry->link.index, edge_level, active_high_low);
+		if (!irq) {
 			ACPI_DEBUG_PRINT((ACPI_DB_WARN, "Invalid IRQ link routing entry\n"));
 			return_VALUE(0);
 		}
-	}
-	else if (!entry->irq) {
-		ACPI_DEBUG_PRINT((ACPI_DB_INFO, "Invalid static routing entry (IRQ 0)\n"));
-		return_VALUE(0);
+	} else {
+		irq = entry->link.index;
+		*edge_level = ACPI_LEVEL_SENSITIVE;
+		*active_high_low = ACPI_ACTIVE_LOW;
 	}
 
-	ACPI_DEBUG_PRINT((ACPI_DB_INFO, "Found IRQ %d\n", entry->irq));
+	ACPI_DEBUG_PRINT((ACPI_DB_INFO, "Found IRQ %d\n", irq));
 
-	return_VALUE(entry->irq);
+	return_VALUE(irq);
 }
 
 static int
 acpi_pci_irq_derive (
 	struct pci_dev		*dev,
-	int			pin)
+	int			pin,
+	int			*edge_level,
+	int			*active_high_low)
 {
 	struct pci_dev		*bridge = dev;
 	int			irq = 0;
@@ -308,8 +306,8 @@ acpi_pci_irq_derive (
 			pin = bridge_pin;
 		}
 
-		irq = acpi_pci_irq_lookup(bridge->bus,
-				PCI_SLOT(bridge->devfn), pin);
+		irq = acpi_pci_irq_lookup(bridge->bus, PCI_SLOT(bridge->devfn),
+			pin, edge_level, active_high_low);
 	}
 
 	if (!irq) {
@@ -330,6 +328,8 @@ acpi_pci_irq_enable (
 {
 	int			irq = 0;
 	u8			pin = 0;
+	int			edge_level = ACPI_LEVEL_SENSITIVE;
+	int			active_high_low = ACPI_ACTIVE_LOW;
 
 	ACPI_FUNCTION_TRACE("acpi_pci_irq_enable");
 
@@ -352,21 +352,22 @@ acpi_pci_irq_enable (
 	 * First we check the PCI IRQ routing table (PRT) for an IRQ.  PRT
 	 * values override any BIOS-assigned IRQs set during boot.
 	 */
- 	irq = acpi_pci_irq_lookup(dev->bus, PCI_SLOT(dev->devfn), pin);
+ 	irq = acpi_pci_irq_lookup(dev->bus, PCI_SLOT(dev->devfn), pin, &edge_level, &active_high_low);
 
 	/*
 	 * If no PRT entry was found, we'll try to derive an IRQ from the
 	 * device's parent bridge.
 	 */
 	if (!irq)
- 		irq = acpi_pci_irq_derive(dev, pin);
+ 		irq = acpi_pci_irq_derive(dev, pin, &edge_level, &active_high_low);
  
 	/*
 	 * No IRQ known to the ACPI subsystem - maybe the BIOS / 
 	 * driver reported one, then use it. Exit in any case.
 	 */
 	if (!irq) {
-		printk(KERN_WARNING PREFIX "No IRQ known for interrupt pin %c of device %s", ('A' + pin), pci_name(dev));
+		printk(KERN_WARNING PREFIX "PCI interrupt %s[%c]: no GSI",
+			pci_name(dev), ('A' + pin));
 		/* Interrupt Line values above 0xF are forbidden */
 		if (dev->irq && (dev->irq <= 0xF)) {
 			printk(" - using IRQ %d\n", dev->irq);
@@ -378,62 +379,14 @@ acpi_pci_irq_enable (
 		}
  	}
 
-	dev->irq = irq;
+	dev->irq = acpi_register_gsi(irq, edge_level, active_high_low);
 
-	ACPI_DEBUG_PRINT((ACPI_DB_INFO, "Device %s using IRQ %d\n", pci_name(dev), dev->irq));
-
-	/* 
-	 * Make sure all (legacy) PCI IRQs are set as level-triggered.
-	 */
-#ifdef CONFIG_X86
-	{
-		static u16 irq_mask;
-		if ((dev->irq < 16) &&  !((1 << dev->irq) & irq_mask)) {
-			ACPI_DEBUG_PRINT((ACPI_DB_INFO, "Setting IRQ %d as level-triggered\n", dev->irq));
-			irq_mask |= (1 << dev->irq);
-			eisa_set_level_irq(dev->irq);
-		}
-	}
-#endif
-#ifdef CONFIG_IOSAPIC
-	if (acpi_irq_model == ACPI_IRQ_MODEL_IOSAPIC)
-		iosapic_enable_intr(dev->irq);
-#endif
+	printk(KERN_INFO PREFIX "PCI interrupt %s[%c] -> GSI %u "
+		"(%s, %s) -> IRQ %d\n",
+		pci_name(dev), 'A' + pin, irq,
+		(edge_level == ACPI_LEVEL_SENSITIVE) ? "level" : "edge",
+		(active_high_low == ACPI_ACTIVE_LOW) ? "low" : "high",
+		dev->irq);
 
 	return_VALUE(dev->irq);
 }
-
-
-int __init
-acpi_pci_irq_init (void)
-{
-	struct pci_dev          *dev = NULL;
-
-	ACPI_FUNCTION_TRACE("acpi_pci_irq_init");
-
-	if (!acpi_prt.count) {
-		printk(KERN_WARNING PREFIX "ACPI tables contain no PCI IRQ "
-			"routing entries\n");
-		return_VALUE(-ENODEV);
-	}
-
-	/* Make sure all link devices have a valid IRQ. */
-	if (acpi_pci_link_check()) {
-		return_VALUE(-ENODEV);
-	}
-
-#ifdef CONFIG_X86_IO_APIC
-	/* Program IOAPICs using data from PRT entries. */
-	if (acpi_irq_model == ACPI_IRQ_MODEL_IOAPIC)
-		mp_parse_prt();
-#endif
-#ifdef CONFIG_IOSAPIC
-	if (acpi_irq_model == ACPI_IRQ_MODEL_IOSAPIC)
-		iosapic_parse_prt();
-#endif
-
-	while ((dev = pci_find_device(PCI_ANY_ID, PCI_ANY_ID, dev)) != NULL)
-		acpi_pci_irq_enable(dev);
-
-	return_VALUE(0);
-}
diff --git a/drivers/acpi/pci_link.c b/drivers/acpi/pci_link.c
index 8940e11df..13e922551 100644
--- a/drivers/acpi/pci_link.c
+++ b/drivers/acpi/pci_link.c
@@ -308,31 +308,12 @@ acpi_pci_link_set (
 		struct acpi_resource	end;
 	}                       resource;
 	struct acpi_buffer	buffer = {sizeof(resource)+1, &resource};
-	int			i = 0;
-	int			valid = 0;
 
 	ACPI_FUNCTION_TRACE("acpi_pci_link_set");
 
 	if (!link || !irq)
 		return_VALUE(-EINVAL);
 
-	/* We don't check irqs the first time around */
-	if (link->irq.setonboot) {
-		/* See if we're already at the target IRQ. */
-		if (irq == link->irq.active)
-			return_VALUE(0);
-
-		/* Make sure the target IRQ in the list of possible IRQs. */
-		for (i=0; i<link->irq.possible_count; i++) {
-			if (irq == link->irq.possible[i])
-				valid = 1;
-		}
-		if (!valid) {
-			ACPI_DEBUG_PRINT((ACPI_DB_ERROR, "Target IRQ %d invalid\n", irq));
-			return_VALUE(-EINVAL);
-		}
-	}
-
 	memset(&resource, 0, sizeof(resource));
 
 	switch(link->irq.resource_type) {
@@ -487,13 +468,13 @@ static int __initdata acpi_irq_penalty[ACPI_MAX_IRQS] = {
 };
 
 int
-acpi_pci_link_check (void)
+acpi_irq_penalty_init(void)
 {
 	struct list_head	*node = NULL;
 	struct acpi_pci_link    *link = NULL;
 	int			i = 0;
 
-	ACPI_FUNCTION_TRACE("acpi_pci_link_check");
+	ACPI_FUNCTION_TRACE("acpi_irq_penalty_init");
 
 	/*
 	 * Update penalties to facilitate IRQ balancing.
@@ -703,6 +684,9 @@ acpi_pci_link_add (
 	acpi_link.count++;
 
 end:
+	/* disable all links -- to be activated on use */
+	acpi_ut_evaluate_object(link->handle, "_DIS", 0, NULL);
+
 	if (result)
 		kfree(link);
 
diff --git a/drivers/acpi/pci_root.c b/drivers/acpi/pci_root.c
index 3d19331bc..dd08b633a 100644
--- a/drivers/acpi/pci_root.c
+++ b/drivers/acpi/pci_root.c
@@ -113,6 +113,40 @@ void acpi_pci_unregister_driver(struct acpi_pci_driver *driver)
 	}
 }
 
+static acpi_status
+get_root_bridge_busnr_callback (struct acpi_resource *resource, void *data)
+{
+	int *busnr = (int *)data;
+	struct acpi_resource_address64 address;
+
+	if (resource->id != ACPI_RSTYPE_ADDRESS16 &&
+	    resource->id != ACPI_RSTYPE_ADDRESS32 &&
+	    resource->id != ACPI_RSTYPE_ADDRESS64)
+		return AE_OK;
+
+	acpi_resource_to_address64(resource, &address);
+	if ((address.address_length > 0) && 
+	   (address.resource_type == ACPI_BUS_NUMBER_RANGE))
+		*busnr = address.min_address_range;
+
+	return AE_OK;
+}
+
+static acpi_status 
+try_get_root_bridge_busnr(acpi_handle handle, int *busnum)
+{
+	acpi_status status;
+
+	*busnum = -1;
+	status = acpi_walk_resources(handle, METHOD_NAME__CRS, get_root_bridge_busnr_callback, busnum);
+	if (ACPI_FAILURE(status))
+		return status;
+	/* Check if we really get a bus number from _CRS */
+	if (*busnum == -1)
+		return AE_ERROR;
+	return AE_OK;
+}
+
 static int
 acpi_pci_root_add (
 	struct acpi_device	*device)
@@ -190,9 +224,22 @@ acpi_pci_root_add (
 	/* Some systems have wrong _BBN */
 	list_for_each_entry(tmp, &acpi_pci_roots, node) {
 		if ((tmp->id.segment == root->id.segment)
-				&& (tmp->id.bus == root->id.bus))
+				&& (tmp->id.bus == root->id.bus)) {
+			int bus = 0;
+			acpi_status status;
+
 			ACPI_DEBUG_PRINT((ACPI_DB_ERROR, 
 				"Wrong _BBN value, please reboot and using option 'pci=noacpi'\n"));
+
+			status = try_get_root_bridge_busnr(root->handle, &bus);
+			if (ACPI_FAILURE(status))
+				break;
+			if (bus != root->id.bus) {
+				printk(KERN_INFO PREFIX "PCI _CRS %d overrides _BBN 0\n", bus);
+				root->id.bus = bus;
+			}
+			break;
+		}
 	}
 	/*
 	 * Device & Function
diff --git a/drivers/acpi/scan.c b/drivers/acpi/scan.c
index 8f3557bd1..be148f489 100644
--- a/drivers/acpi/scan.c
+++ b/drivers/acpi/scan.c
@@ -101,7 +101,7 @@ acpi_bus_get_power_flags (
 	struct acpi_device	*device)
 {
 	acpi_status             status = 0;
-	acpi_handle		handle = 0;
+	acpi_handle		handle = NULL;
 	u32                     i = 0;
 
 	ACPI_FUNCTION_TRACE("acpi_bus_get_power_flags");
@@ -799,8 +799,8 @@ static int acpi_bus_scan (struct acpi_device	*start)
 	acpi_status		status = AE_OK;
 	struct acpi_device	*parent = NULL;
 	struct acpi_device	*child = NULL;
-	acpi_handle		phandle = 0;
-	acpi_handle		chandle = 0;
+	acpi_handle		phandle = NULL;
+	acpi_handle		chandle = NULL;
 	acpi_object_type	type = 0;
 	u32			level = 1;
 
@@ -843,7 +843,7 @@ static int acpi_bus_scan (struct acpi_device	*start)
 		if (type == ACPI_TYPE_LOCAL_SCOPE) {
 			level++;
 			phandle = chandle;
-			chandle = 0;
+			chandle = NULL;
 			continue;
 		}
 
@@ -883,11 +883,11 @@ static int acpi_bus_scan (struct acpi_device	*start)
 		 */
 		if (child->status.present) {
 			status = acpi_get_next_object(ACPI_TYPE_ANY, chandle,
-				0, NULL);
+						      NULL, NULL);
 			if (ACPI_SUCCESS(status)) {
 				level++;
 				phandle = chandle;
-				chandle = 0;
+				chandle = NULL;
 				parent = child;
 			}
 		}
diff --git a/drivers/acpi/sleep/main.c b/drivers/acpi/sleep/main.c
index ac7a480e8..c7b17e7fa 100644
--- a/drivers/acpi/sleep/main.c
+++ b/drivers/acpi/sleep/main.c
@@ -10,6 +10,7 @@
 
 #include <linux/delay.h>
 #include <linux/irq.h>
+#include <linux/dmi.h>
 #include <linux/device.h>
 #include <linux/suspend.h>
 #include <acpi/acpi_bus.h>
@@ -30,6 +31,8 @@ static u32 acpi_suspend_states[] = {
 	[PM_SUSPEND_DISK]	= ACPI_STATE_S4,
 };
 
+static int init_8259A_after_S1;
+
 /**
  *	acpi_pm_prepare - Do preliminary suspend work.
  *	@state:		suspend state we're entering.
@@ -138,7 +141,7 @@ static int acpi_pm_finish(u32 state)
 	/* reset firmware waking vector */
 	acpi_set_firmware_waking_vector((acpi_physical_address) 0);
 
-	if (dmi_broken & BROKEN_INIT_AFTER_S1) {
+	if (init_8259A_after_S1) {
 		printk("Broken toshiba laptop -> kicking interrupts\n");
 		init_8259A(0);
 	}
@@ -159,17 +162,39 @@ int acpi_suspend(u32 acpi_state)
 	return -EINVAL;
 }
 
-
 static struct pm_ops acpi_pm_ops = {
 	.prepare	= acpi_pm_prepare,
 	.enter		= acpi_pm_enter,
 	.finish		= acpi_pm_finish,
 };
 
+
+/*
+ * Toshiba fails to preserve interrupts over S1, reinitialization
+ * of 8259 is needed after S1 resume.
+ */
+static int __init init_ints_after_s1(struct dmi_system_id *d)
+{
+	printk(KERN_WARNING "%s with broken S1 detected.\n", d->ident);
+	init_8259A_after_S1 = 1;
+	return 0;
+}
+
+static struct dmi_system_id __initdata acpisleep_dmi_table[] = {
+	{
+		.callback = init_ints_after_s1,
+		.ident = "Toshiba Satellite 4030cdt",
+		.matches = { DMI_MATCH(DMI_PRODUCT_NAME, "S4030CDT/4.3"), },
+	},
+	{ },
+};
+
 static int __init acpi_sleep_init(void)
 {
 	int			i = 0;
 
+	dmi_check_system(acpisleep_dmi_table);
+
 	if (acpi_disabled)
 		return 0;
 
diff --git a/drivers/acpi/sleep/proc.c b/drivers/acpi/sleep/proc.c
index a64ef154d..7eb206096 100644
--- a/drivers/acpi/sleep/proc.c
+++ b/drivers/acpi/sleep/proc.c
@@ -345,7 +345,7 @@ acpi_system_write_alarm (
 
 	acpi_set_register(ACPI_BITREG_RT_CLOCK_ENABLE, 1, ACPI_MTX_LOCK);
 
-	file->f_pos += count;
+	*ppos += count;
 
 	result = 0;
 end:
diff --git a/drivers/acpi/system.c b/drivers/acpi/system.c
index 892184a9e..9919e76d7 100644
--- a/drivers/acpi/system.c
+++ b/drivers/acpi/system.c
@@ -92,8 +92,7 @@ acpi_system_read_dsdt (
 {
 	acpi_status		status = AE_OK;
 	struct acpi_buffer	dsdt = {ACPI_ALLOCATE_BUFFER, NULL};
-	void			*data = 0;
-	size_t			size = 0;
+	ssize_t			res;
 
 	ACPI_FUNCTION_TRACE("acpi_system_read_dsdt");
 
@@ -101,22 +100,11 @@ acpi_system_read_dsdt (
 	if (ACPI_FAILURE(status))
 		return_VALUE(-ENODEV);
 
-	if (*ppos < dsdt.length) {
-		data = dsdt.pointer + file->f_pos;
-		size = dsdt.length - file->f_pos;
-		if (size > count)
-			size = count;
-		if (copy_to_user(buffer, data, size)) {
-			acpi_os_free(dsdt.pointer);
-			return_VALUE(-EFAULT);
-		}
-	}
-
+	res = simple_read_from_buffer(buffer, count, ppos,
+				      dsdt.pointer, dsdt.length);
 	acpi_os_free(dsdt.pointer);
 
-	*ppos += size;
-
-	return_VALUE(size);
+	return_VALUE(res);
 }
 
 
@@ -135,8 +123,7 @@ acpi_system_read_fadt (
 {
 	acpi_status		status = AE_OK;
 	struct acpi_buffer	fadt = {ACPI_ALLOCATE_BUFFER, NULL};
-	void			*data = 0;
-	size_t			size = 0;
+	ssize_t			res;
 
 	ACPI_FUNCTION_TRACE("acpi_system_read_fadt");
 
@@ -144,22 +131,11 @@ acpi_system_read_fadt (
 	if (ACPI_FAILURE(status))
 		return_VALUE(-ENODEV);
 
-	if (*ppos < fadt.length) {
-		data = fadt.pointer + file->f_pos;
-		size = fadt.length - file->f_pos;
-		if (size > count)
-			size = count;
-		if (copy_to_user(buffer, data, size)) {
-			acpi_os_free(fadt.pointer);
-			return_VALUE(-EFAULT);
-		}
-	}
-
+	res = simple_read_from_buffer(buffer, count, ppos,
+				      fadt.pointer, fadt.length);
 	acpi_os_free(fadt.pointer);
 
-	*ppos += size;
-
-	return_VALUE(size);
+	return_VALUE(res);
 }
 
 
diff --git a/drivers/acpi/tables.c b/drivers/acpi/tables.c
index d87764ebd..e7480822b 100644
--- a/drivers/acpi/tables.c
+++ b/drivers/acpi/tables.c
@@ -131,7 +131,7 @@ acpi_table_print_madt_entry (
 	{
 		struct acpi_table_ioapic *p =
 			(struct acpi_table_ioapic*) header;
-		printk(KERN_INFO PREFIX "IOAPIC (id[0x%02x] address[0x%08x] global_irq_base[0x%x])\n",
+		printk(KERN_INFO PREFIX "IOAPIC (id[0x%02x] address[0x%08x] gsi_base[%d])\n",
 			p->id, p->address, p->global_irq_base);
 	}
 		break;
@@ -185,8 +185,8 @@ acpi_table_print_madt_entry (
 	{
 		struct acpi_table_iosapic *p =
 			(struct acpi_table_iosapic*) header;
-		printk(KERN_INFO PREFIX "IOSAPIC (id[0x%x] global_irq_base[0x%x] address[%p])\n",
-			p->id, p->global_irq_base, (void *) (unsigned long) p->address);
+		printk(KERN_INFO PREFIX "IOSAPIC (id[0x%x] address[%p] gsi_base[%d])\n",
+			p->id, (void *) (unsigned long) p->address, p->global_irq_base);
 	}
 		break;
 
@@ -286,7 +286,7 @@ acpi_get_table_header_early (
 			*header = (void *) __acpi_map_table(fadt->V1_dsdt,
 					sizeof(struct acpi_table_header));
 		} else
-			*header = 0;
+			*header = NULL;
 
 		if (!*header) {
 			printk(KERN_WARNING PREFIX "Unable to map DSDT\n");
diff --git a/drivers/acpi/thermal.c b/drivers/acpi/thermal.c
index 00c80593a..7b94ac081 100644
--- a/drivers/acpi/thermal.c
+++ b/drivers/acpi/thermal.c
@@ -289,6 +289,13 @@ acpi_thermal_set_cooling_mode (
 	status = acpi_get_handle(tz->handle, "_SCP", &handle);
 	if (ACPI_FAILURE(status)) {
 		ACPI_DEBUG_PRINT((ACPI_DB_INFO, "_SCP not present\n"));
+		status = acpi_get_handle(tz->handle, "_PSV", &handle);
+		if(!ACPI_FAILURE(status)) {
+			tz->cooling_mode = 1;
+			ACPI_DEBUG_PRINT((ACPI_DB_INFO, "Cooling mode [%s]\n", 
+				mode?"passive":"active"));
+			return_VALUE(0);
+		}
 		return_VALUE(-ENODEV);
 	}
 
diff --git a/drivers/acpi/toshiba_acpi.c b/drivers/acpi/toshiba_acpi.c
index 508bcb495..a07325638 100644
--- a/drivers/acpi/toshiba_acpi.c
+++ b/drivers/acpi/toshiba_acpi.c
@@ -115,7 +115,7 @@ is_valid_acpi_path(const char* methodName)
 	acpi_handle handle;
 	acpi_status status;
 
-	status = acpi_get_handle(0, (char*)methodName, &handle);
+	status = acpi_get_handle(NULL, (char*)methodName, &handle);
 	return !ACPI_FAILURE(status);
 }
 
@@ -131,7 +131,7 @@ write_acpi_int(const char* methodName, int val)
 	in_objs[0].type = ACPI_TYPE_INTEGER;
 	in_objs[0].integer.value = val;
 
-	status = acpi_evaluate_object(0, (char*)methodName, &params, 0);
+	status = acpi_evaluate_object(NULL, (char*)methodName, &params, NULL);
 	return (status == AE_OK);
 }
 
@@ -178,7 +178,7 @@ hci_raw(const u32 in[HCI_WORDS], u32 out[HCI_WORDS])
 	results.length = sizeof(out_objs);
 	results.pointer = out_objs;
 
-	status = acpi_evaluate_object(0, (char*)method_hci, &params,
+	status = acpi_evaluate_object(NULL, (char*)method_hci, &params,
 		&results);
 	if ((status == AE_OK) && (out_objs->package.count <= HCI_WORDS)) {
 		for (i = 0; i < out_objs->package.count; ++i) {
@@ -487,8 +487,8 @@ ProcItem proc_items[] =
 	{ "video"	, read_video	, write_video	},
 	{ "fan"		, read_fan	, write_fan	},
 	{ "keys"	, read_keys	, write_keys	},
-	{ "version"	, read_version	, 0		},
-	{ 0		, 0		, 0		},
+	{ "version"	, read_version	, NULL		},
+	{ NULL }
 };
 
 static acpi_status __init
diff --git a/drivers/atm/ambassador.c b/drivers/atm/ambassador.c
index c26a12e56..fe809480e 100644
--- a/drivers/atm/ambassador.c
+++ b/drivers/atm/ambassador.c
@@ -1126,7 +1126,7 @@ static int amb_open (struct atm_vcc * atm_vcc)
 	  } else {
 	    r = round_up;
 	  }
-	  error = make_rate (pcr, r, &tx_rate_bits, 0);
+	  error = make_rate (pcr, r, &tx_rate_bits, NULL);
 	  tx_vc_bits = TX_UBR_CAPPED;
 	  tx_frame_bits = TX_FRAME_CAPPED;
 	}
@@ -1333,7 +1333,7 @@ static void amb_close (struct atm_vcc * atm_vcc) {
       PRINTK (KERN_ERR, "%s vcc=%p rxer[vci]=%p",
 	      "arghhh! we're going to die!",
 	      vcc, dev->rxer[vci]);
-    dev->rxer[vci] = 0;
+    dev->rxer[vci] = NULL;
     while (command_do (dev, &cmd))
       schedule();
     
diff --git a/drivers/atm/firestream.c b/drivers/atm/firestream.c
index 025c692fd..91b85a95d 100644
--- a/drivers/atm/firestream.c
+++ b/drivers/atm/firestream.c
@@ -1000,7 +1000,7 @@ static int fs_open(struct atm_vcc *atm_vcc)
 				} else {
 					r = ROUND_UP;
 				}
-				error = make_rate (pcr, r, &tmc0, 0);
+				error = make_rate (pcr, r, &tmc0, NULL);
 			}
 			fs_dprintk (FS_DEBUG_OPEN, "pcr = %d.\n", pcr);
 		}
@@ -1380,7 +1380,7 @@ static void __devinit *aligned_kmalloc (int size, int flags, int alignment)
 
 	if (alignment <= 0x10) {
 		t = kmalloc (size, flags);
-		if ((unsigned int)t & (alignment-1)) {
+		if ((unsigned long)t & (alignment-1)) {
 			printk ("Kmalloc doesn't align things correctly! %p\n", t);
 			kfree (t);
 			return aligned_kmalloc (size, flags, alignment * 4);
diff --git a/drivers/atm/fore200e.c b/drivers/atm/fore200e.c
index e33b5357e..b2f13752c 100644
--- a/drivers/atm/fore200e.c
+++ b/drivers/atm/fore200e.c
@@ -110,8 +110,8 @@
 #endif
 
 
-extern const struct atmdev_ops   fore200e_ops;
-extern const struct fore200e_bus fore200e_bus[];
+static const struct atmdev_ops   fore200e_ops;
+static const struct fore200e_bus fore200e_bus[];
 
 static struct fore200e* fore200e_boards = NULL;
 
diff --git a/drivers/atm/he.c b/drivers/atm/he.c
index ad746d981..71e5b5146 100644
--- a/drivers/atm/he.c
+++ b/drivers/atm/he.c
@@ -360,7 +360,7 @@ he_init_one(struct pci_dev *pci_dev, const struct pci_device_id *pci_ent)
 		goto init_one_failure;
 	}
 
-	atm_dev = atm_dev_register(DEV_LABEL, &he_ops, -1, 0);
+	atm_dev = atm_dev_register(DEV_LABEL, &he_ops, -1, NULL);
 	if (!atm_dev) {
 		err = -ENODEV;
 		goto init_one_failure;
diff --git a/drivers/atm/horizon.c b/drivers/atm/horizon.c
index a794610da..9ae4121ae 100644
--- a/drivers/atm/horizon.c
+++ b/drivers/atm/horizon.c
@@ -1184,7 +1184,7 @@ static void tx_schedule (hrz_dev * const dev, int irq) {
 	// tx_regions == 0
 	// that's all folks - end of frame
 	struct sk_buff * skb = dev->tx_skb;
-	dev->tx_iovec = 0;
+	dev->tx_iovec = NULL;
 	
 	// VC layer stats
 	atomic_inc(&ATM_SKB(skb)->vcc->stats->tx);
@@ -1761,7 +1761,7 @@ static int hrz_send (struct atm_vcc * atm_vcc, struct sk_buff * skb) {
     if (tx_iovcnt) {
       // scatter gather transfer
       dev->tx_regions = tx_iovcnt;
-      dev->tx_iovec = 0;		/* @@@ needs rewritten */
+      dev->tx_iovec = NULL;		/* @@@ needs rewritten */
       dev->tx_bytes = 0;
       PRINTD (DBG_TX|DBG_BUS, "TX start scatter-gather transfer (iovec %p, len %d)",
 	      skb->data, tx_len);
@@ -1771,7 +1771,7 @@ static int hrz_send (struct atm_vcc * atm_vcc, struct sk_buff * skb) {
     } else {
       // simple transfer
       dev->tx_regions = 0;
-      dev->tx_iovec = 0;
+      dev->tx_iovec = NULL;
       dev->tx_bytes = tx_len;
       dev->tx_addr = skb->data;
       PRINTD (DBG_TX|DBG_BUS, "TX start simple transfer (addr %p, len %d)",
@@ -2278,7 +2278,7 @@ static int hrz_open (struct atm_vcc *atm_vcc)
 	// we take "the PCR" as a rate-cap
 	// not reserved
 	vcc.tx_rate = 0;
-	make_rate (dev, 1<<30, round_nearest, &vcc.tx_pcr_bits, 0);
+	make_rate (dev, 1<<30, round_nearest, &vcc.tx_pcr_bits, NULL);
 	vcc.tx_xbr_bits = ABR_RATE_TYPE;
 	break;
       }
@@ -2583,7 +2583,7 @@ static void hrz_close (struct atm_vcc * atm_vcc) {
       PRINTK (KERN_ERR, "%s atm_vcc=%p rxer[channel]=%p",
 	      "arghhh! we're going to die!",
 	      atm_vcc, dev->rxer[channel]);
-    dev->rxer[channel] = 0;
+    dev->rxer[channel] = NULL;
   }
   
   // atomically release our rate reservation
@@ -2806,8 +2806,8 @@ static int __init hrz_probe (void) {
 	
 	dev->tx_regions = 0;
 	dev->tx_bytes = 0;
-	dev->tx_skb = 0;
-	dev->tx_iovec = 0;
+	dev->tx_skb = NULL;
+	dev->tx_iovec = NULL;
 	
 	dev->tx_cell_count = 0;
 	dev->rx_cell_count = 0;
diff --git a/drivers/atm/idt77105.c b/drivers/atm/idt77105.c
index c1fb6c710..0747dbadb 100644
--- a/drivers/atm/idt77105.c
+++ b/drivers/atm/idt77105.c
@@ -198,7 +198,7 @@ static int idt77105_ioctl(struct atm_dev *dev,unsigned int cmd,void __user *arg)
 		case IDT77105_GETSTAT:
 			return fetch_stats(dev, arg, cmd == IDT77105_GETSTATZ);
 		case ATM_SETLOOP:
-			return set_loopback(dev,(int) (long) arg);
+			return set_loopback(dev,(int)(unsigned long) arg);
 		case ATM_GETLOOP:
 			return put_user(PRIV(dev)->loop_mode,(int __user *)arg) ?
 			    -EFAULT : 0;
diff --git a/drivers/atm/idt77252.c b/drivers/atm/idt77252.c
index b929f43d0..b2bede540 100644
--- a/drivers/atm/idt77252.c
+++ b/drivers/atm/idt77252.c
@@ -3729,7 +3729,7 @@ idt77252_init_one(struct pci_dev *pcidev, const struct pci_device_id *id)
 		return -EIO;
 	}
 
-	dev = atm_dev_register("idt77252", &idt77252_ops, -1, 0);
+	dev = atm_dev_register("idt77252", &idt77252_ops, -1, NULL);
 	if (!dev) {
 		printk("%s: can't register atm device\n", card->name);
 		iounmap((void *) card->membase);
diff --git a/drivers/atm/iphase.c b/drivers/atm/iphase.c
index 3c964ecfb..0c8395cfb 100644
--- a/drivers/atm/iphase.c
+++ b/drivers/atm/iphase.c
@@ -2667,7 +2667,7 @@ static void ia_close(struct atm_vcc *vcc)
            }                                 
            // Drain the packets
            rx_dle_intr(vcc->dev); 
-           iadev->rx_open[vcc->vci] = 0;
+           iadev->rx_open[vcc->vci] = NULL;
         }
 	kfree(INPH_IA_VCC(vcc));  
         ia_vcc = NULL;
diff --git a/drivers/atm/iphase.h b/drivers/atm/iphase.h
index 92e514c79..9da028683 100644
--- a/drivers/atm/iphase.h
+++ b/drivers/atm/iphase.h
@@ -68,8 +68,6 @@
 #define IF_IADBG_SUNI_STAT      0x02000000        // suni statistics
 #define IF_IADBG_RESET          0x04000000        
 
-extern	unsigned int	IADebugFlag;
-
 #define IF_IADBG(f) if (IADebugFlag & (f))
 
 #ifdef  CONFIG_ATM_IA_DEBUG   /* Debug build */
diff --git a/drivers/atm/lanai.c b/drivers/atm/lanai.c
index ac80b9efd..53f6d29c5 100644
--- a/drivers/atm/lanai.c
+++ b/drivers/atm/lanai.c
@@ -2702,7 +2702,7 @@ static int __devinit lanai_init_one(struct pci_dev *pci,
 		return -ENOMEM;
 	}
 
-	atmdev = atm_dev_register(DEV_LABEL, &ops, -1, 0);
+	atmdev = atm_dev_register(DEV_LABEL, &ops, -1, NULL);
 	if (atmdev == NULL) {
 		printk(KERN_ERR DEV_LABEL
 		    ": couldn't register atm device!\n");
diff --git a/drivers/atm/suni.c b/drivers/atm/suni.c
index e5a0f5cbd..678df9418 100644
--- a/drivers/atm/suni.c
+++ b/drivers/atm/suni.c
@@ -196,7 +196,7 @@ static int suni_ioctl(struct atm_dev *dev,unsigned int cmd,void __user *arg)
 		case SONET_GETFRSENSE:
 			return -EINVAL;
 		case ATM_SETLOOP:
-			return set_loopback(dev,(int) (long) arg);
+			return set_loopback(dev,(int)(unsigned long)arg);
 		case ATM_GETLOOP:
 			return put_user(PRIV(dev)->loop_mode,(int __user *)arg) ?
 			    -EFAULT : 0;
diff --git a/drivers/atm/uPD98402.c b/drivers/atm/uPD98402.c
index da33eaddc..9504cce51 100644
--- a/drivers/atm/uPD98402.c
+++ b/drivers/atm/uPD98402.c
@@ -140,14 +140,14 @@ static int uPD98402_ioctl(struct atm_dev *dev,unsigned int cmd,void __user *arg)
                 case SONET_GETSTAT:
 			return fetch_stats(dev,arg, cmd == SONET_GETSTATZ);
 		case SONET_SETFRAMING:
-			return set_framing(dev,(int) (long) arg);
+			return set_framing(dev, (int)(unsigned long)arg);
 		case SONET_GETFRAMING:
 			return put_user(PRIV(dev)->framing,(int __user *)arg) ?
 			    -EFAULT : 0;
 		case SONET_GETFRSENSE:
 			return get_sense(dev,arg);
 		case ATM_SETLOOP:
-			return set_loopback(dev,(int) (long) arg);
+			return set_loopback(dev, (int)(unsigned long)arg);
 		case ATM_GETLOOP:
 			return put_user(PRIV(dev)->loop_mode,(int __user *)arg) ?
 			    -EFAULT : 0;
diff --git a/drivers/base/Kconfig b/drivers/base/Kconfig
index 88c103e61..0a160b2a5 100644
--- a/drivers/base/Kconfig
+++ b/drivers/base/Kconfig
@@ -1,5 +1,23 @@
 menu "Generic Driver Options"
 
+config STANDALONE
+	bool "Select only drivers that don't need compile-time external firmware" if EXPERIMENTAL
+	default y
+	help
+	  Select this option if you don't have magic firmware for drivers that
+	  need it.
+
+	  If unsure, say Y.
+
+config PREVENT_FIRMWARE_BUILD
+	bool "Prevent firmware from being built"
+	default y
+	help
+	  Say yes to avoid building firmware. Firmware is usually shipped
+	  with the driver, and only when updating the firware a rebuild
+	  should be made.
+	  If unsure say Y here.
+
 config FW_LOADER
 	tristate "Hotplug firmware loading support"
 	depends on HOTPLUG
@@ -9,7 +27,7 @@ config FW_LOADER
 	  the kernel tree does.
 
 config DEBUG_DRIVER
-	 bool "Driver Core verbose debug messages"
+	bool "Driver Core verbose debug messages"
 	depends on DEBUG_KERNEL
 	help
 	  Say Y here if you want the Driver core to produce a bunch of
diff --git a/drivers/base/base.h b/drivers/base/base.h
index da16cc5c9..8d1e8bd48 100644
--- a/drivers/base/base.h
+++ b/drivers/base/base.h
@@ -6,12 +6,13 @@ extern void bus_remove_driver(struct device_driver *);
 
 static inline struct class_device *to_class_dev(struct kobject *obj)
 {
-	return container_of(obj,struct class_device,kobj);
+	return container_of(obj, struct class_device, kobj);
 }
+
 static inline
 struct class_device_attribute *to_class_dev_attr(struct attribute *_attr)
 {
-	return container_of(_attr,struct class_device_attribute,attr);
+	return container_of(_attr, struct class_device_attribute, attr);
 }
 
 
diff --git a/drivers/base/bus.c b/drivers/base/bus.c
index b40af6a72..12701407b 100644
--- a/drivers/base/bus.c
+++ b/drivers/base/bus.c
@@ -3,7 +3,7 @@
  *
  * Copyright (c) 2002-3 Patrick Mochel
  * Copyright (c) 2002-3 Open Source Development Labs
- * 
+ *
  * This file is released under the GPLv2
  *
  */
@@ -17,17 +17,17 @@
 #include "base.h"
 #include "power/power.h"
 
-#define to_dev(node) container_of(node,struct device,bus_list)
-#define to_drv(node) container_of(node,struct device_driver,kobj.entry)
+#define to_dev(node) container_of(node, struct device, bus_list)
+#define to_drv(node) container_of(node, struct device_driver, kobj.entry)
 
-#define to_bus_attr(_attr) container_of(_attr,struct bus_attribute,attr)
-#define to_bus(obj) container_of(obj,struct bus_type,subsys.kset.kobj)
+#define to_bus_attr(_attr) container_of(_attr, struct bus_attribute, attr)
+#define to_bus(obj) container_of(obj, struct bus_type, subsys.kset.kobj)
 
 /*
  * sysfs bindings for drivers
  */
 
-#define to_drv_attr(_attr) container_of(_attr,struct driver_attribute,attr)
+#define to_drv_attr(_attr) container_of(_attr, struct driver_attribute, attr)
 #define to_driver(obj) container_of(obj, struct device_driver, kobj)
 
 
@@ -39,12 +39,12 @@ drv_attr_show(struct kobject * kobj, struct attribute * attr, char * buf)
 	ssize_t ret = 0;
 
 	if (drv_attr->show)
-		ret = drv_attr->show(drv,buf);
+		ret = drv_attr->show(drv, buf);
 	return ret;
 }
 
 static ssize_t
-drv_attr_store(struct kobject * kobj, struct attribute * attr, 
+drv_attr_store(struct kobject * kobj, struct attribute * attr,
 	       const char * buf, size_t count)
 {
 	struct driver_attribute * drv_attr = to_drv_attr(attr);
@@ -52,7 +52,7 @@ drv_attr_store(struct kobject * kobj, struct attribute * attr,
 	ssize_t ret = 0;
 
 	if (drv_attr->store)
-		ret = drv_attr->store(drv,buf,count);
+		ret = drv_attr->store(drv, buf, count);
 	return ret;
 }
 
@@ -87,12 +87,12 @@ bus_attr_show(struct kobject * kobj, struct attribute * attr, char * buf)
 	ssize_t ret = 0;
 
 	if (bus_attr->show)
-		ret = bus_attr->show(bus,buf);
+		ret = bus_attr->show(bus, buf);
 	return ret;
 }
 
 static ssize_t
-bus_attr_store(struct kobject * kobj, struct attribute * attr, 
+bus_attr_store(struct kobject * kobj, struct attribute * attr,
 	       const char * buf, size_t count)
 {
 	struct bus_attribute * bus_attr = to_bus_attr(attr);
@@ -100,7 +100,7 @@ bus_attr_store(struct kobject * kobj, struct attribute * attr,
 	ssize_t ret = 0;
 
 	if (bus_attr->store)
-		ret = bus_attr->store(bus,buf,count);
+		ret = bus_attr->store(bus, buf, count);
 	return ret;
 }
 
@@ -113,7 +113,7 @@ int bus_create_file(struct bus_type * bus, struct bus_attribute * attr)
 {
 	int error;
 	if (get_bus(bus)) {
-		error = sysfs_create_file(&bus->subsys.kset.kobj,&attr->attr);
+		error = sysfs_create_file(&bus->subsys.kset.kobj, &attr->attr);
 		put_bus(bus);
 	} else
 		error = -EINVAL;
@@ -123,7 +123,7 @@ int bus_create_file(struct bus_type * bus, struct bus_attribute * attr)
 void bus_remove_file(struct bus_type * bus, struct bus_attribute * attr)
 {
 	if (get_bus(bus)) {
-		sysfs_remove_file(&bus->subsys.kset.kobj,&attr->attr);
+		sysfs_remove_file(&bus->subsys.kset.kobj, &attr->attr);
 		put_bus(bus);
 	}
 }
@@ -133,7 +133,7 @@ static struct kobj_type ktype_bus = {
 
 };
 
-decl_subsys(bus,&ktype_bus,NULL);
+decl_subsys(bus, &ktype_bus, NULL);
 
 /**
  *	bus_for_each_dev - device iterator.
@@ -151,10 +151,10 @@ decl_subsys(bus,&ktype_bus,NULL);
  *
  *	NOTE: The device that returns a non-zero value is not retained
  *	in any way, nor is its refcount incremented. If the caller needs
- *	to retain this data, it should do, and increment the reference 
+ *	to retain this data, it should do, and increment the reference
  *	count in the supplied callback.
  */
-int bus_for_each_dev(struct bus_type * bus, struct device * start, 
+int bus_for_each_dev(struct bus_type * bus, struct device * start,
 		     void * data, int (*fn)(struct device *, void *))
 {
 	struct device *dev;
@@ -170,7 +170,7 @@ int bus_for_each_dev(struct bus_type * bus, struct device * start,
 	down_read(&bus->subsys.rwsem);
 	list_for_each_entry_continue(dev, head, bus_list) {
 		get_device(dev);
-		error = fn(dev,data);
+		error = fn(dev, data);
 		put_device(dev);
 		if (error)
 			break;
@@ -193,7 +193,7 @@ int bus_for_each_dev(struct bus_type * bus, struct device * start,
  *	and return it. If @start is not NULL, we use it as the head
  *	of the list.
  *
- *	NOTE: we don't return the driver that returns a non-zero 
+ *	NOTE: we don't return the driver that returns a non-zero
  *	value, nor do we leave the reference count incremented for that
  *	driver. If the caller needs to know that info, it must set it
  *	in the callback. It must also be sure to increment the refcount
@@ -216,7 +216,7 @@ int bus_for_each_drv(struct bus_type * bus, struct device_driver * start,
 	down_read(&bus->subsys.rwsem);
 	list_for_each_entry_continue(drv, head, kobj.entry) {
 		get_driver(drv);
-		error = fn(drv,data);
+		error = fn(drv, data);
 		put_driver(drv);
 		if(error)
 			break;
@@ -233,8 +233,8 @@ int bus_for_each_drv(struct bus_type * bus, struct device_driver * start,
  *	Allow manual attachment of a driver to a deivce.
  *	Caller must have already set @dev->driver.
  *
- *	Note that this does not modify the bus reference count 
- *	nor take the bus's rwsem. Please verify those are accounted 
+ *	Note that this does not modify the bus reference count
+ *	nor take the bus's rwsem. Please verify those are accounted
  *	for before calling this. (It is ok to call with no other effort
  *	from a driver's probe() method.)
  */
@@ -242,9 +242,9 @@ int bus_for_each_drv(struct bus_type * bus, struct device_driver * start,
 void device_bind_driver(struct device * dev)
 {
 	pr_debug("bound device '%s' to driver '%s'\n",
-		 dev->bus_id,dev->driver->name);
-	list_add_tail(&dev->driver_list,&dev->driver->devices);
-	sysfs_create_link(&dev->driver->kobj,&dev->kobj,
+		 dev->bus_id, dev->driver->name);
+	list_add_tail(&dev->driver_list, &dev->driver->devices);
+	sysfs_create_link(&dev->driver->kobj, &dev->kobj,
 			  kobject_name(&dev->kobj));
 }
 
@@ -255,18 +255,18 @@ void device_bind_driver(struct device * dev)
  *	@drv:	driver.
  *
  *	First, we call the bus's match function, which should compare
- *	the device IDs the driver supports with the device IDs of the 
- *	device. Note we don't do this ourselves because we don't know 
+ *	the device IDs the driver supports with the device IDs of the
+ *	device. Note we don't do this ourselves because we don't know
  *	the format of the ID structures, nor what is to be considered
  *	a match and what is not.
- *	
- *	If we find a match, we call @drv->probe(@dev) if it exists, and 
+ *
+ *	If we find a match, we call @drv->probe(@dev) if it exists, and
  *	call attach() above.
  */
 static int bus_match(struct device * dev, struct device_driver * drv)
 {
 	int error = -ENODEV;
-	if (dev->bus->match(dev,drv)) {
+	if (dev->bus->match(dev, drv)) {
 		dev->driver = drv;
 		if (drv->probe) {
 			if ((error = drv->probe(dev))) {
@@ -285,7 +285,7 @@ static int bus_match(struct device * dev, struct device_driver * drv)
  *	device_attach - try to attach device to a driver.
  *	@dev:	device.
  *
- *	Walk the list of drivers that the bus has and call bus_match() 
+ *	Walk the list of drivers that the bus has and call bus_match()
  *	for each pair. If a compatible pair is found, break out and return.
  */
 static int device_attach(struct device * dev)
@@ -300,15 +300,15 @@ static int device_attach(struct device * dev)
 	}
 
 	if (bus->match) {
-		list_for_each(entry,&bus->drivers.list) {
+		list_for_each(entry, &bus->drivers.list) {
 			struct device_driver * drv = to_drv(entry);
-			error = bus_match(dev,drv);
-			if (!error )  
+			error = bus_match(dev, drv);
+			if (!error)
 				/* success, driver matched */
-				return 1; 
-			if (error != -ENODEV) 
+				return 1;
+			if (error != -ENODEV)
 				/* driver matched but the probe failed */
-				printk(KERN_WARNING 
+				printk(KERN_WARNING
 				    "%s: probe of %s failed with error %d\n",
 				    drv->name, dev->bus_id, error);
 		}
@@ -327,7 +327,7 @@ static int device_attach(struct device * dev)
  *	If bus_match() returns 0 and the @dev->driver is set, we've found
  *	a compatible pair.
  *
- *	Note that we ignore the -ENODEV error from bus_match(), since it's 
+ *	Note that we ignore the -ENODEV error from bus_match(), since it's
  *	perfectly valid for a driver not to bind to any devices.
  */
 void driver_attach(struct device_driver * drv)
@@ -339,13 +339,13 @@ void driver_attach(struct device_driver * drv)
 	if (!bus->match)
 		return;
 
-	list_for_each(entry,&bus->devices.list) {
-		struct device * dev = container_of(entry,struct device,bus_list);
+	list_for_each(entry, &bus->devices.list) {
+		struct device * dev = container_of(entry, struct device, bus_list);
 		if (!dev->driver) {
-			error = bus_match(dev,drv);
+			error = bus_match(dev, drv);
 			if (error && (error != -ENODEV))
 				/* driver matched but the probe failed */
-				printk(KERN_WARNING 
+				printk(KERN_WARNING
 				    "%s: probe of %s failed with error %d\n",
 				    drv->name, dev->bus_id, error);
 		}
@@ -367,7 +367,7 @@ void device_release_driver(struct device * dev)
 {
 	struct device_driver * drv = dev->driver;
 	if (drv) {
-		sysfs_remove_link(&drv->kobj,kobject_name(&dev->kobj));
+		sysfs_remove_link(&drv->kobj, kobject_name(&dev->kobj));
 		list_del_init(&dev->driver_list);
 		device_detach_shutdown(dev);
 		if (drv->remove)
@@ -385,13 +385,44 @@ void device_release_driver(struct device * dev)
 static void driver_detach(struct device_driver * drv)
 {
 	struct list_head * entry, * next;
-	list_for_each_safe(entry,next,&drv->devices) {
-		struct device * dev = container_of(entry,struct device,driver_list);
+	list_for_each_safe(entry, next, &drv->devices) {
+		struct device * dev = container_of(entry, struct device, driver_list);
 		device_release_driver(dev);
 	}
-	
 }
 
+static int device_add_attrs(struct bus_type * bus, struct device * dev)
+{
+	int error = 0;
+	int i;
+
+	if (bus->dev_attrs) {
+		for (i = 0; attr_name(bus->dev_attrs[i]); i++) {
+			error = device_create_file(dev,&bus->dev_attrs[i]);
+			if (error)
+				goto Err;
+		}
+	}
+ Done:
+	return error;
+ Err:
+	while (--i >= 0)
+		device_remove_file(dev,&bus->dev_attrs[i]);
+	goto Done;
+}
+
+
+static void device_remove_attrs(struct bus_type * bus, struct device * dev)
+{
+	int i;
+
+	if (bus->dev_attrs) {
+		for (i = 0; attr_name(bus->dev_attrs[i]); i++)
+			device_remove_file(dev,&bus->dev_attrs[i]);
+	}
+}
+
+
 /**
  *	bus_add_device - add device to bus
  *	@dev:	device being added
@@ -407,11 +438,12 @@ int bus_add_device(struct device * dev)
 
 	if (bus) {
 		down_write(&dev->bus->subsys.rwsem);
-		pr_debug("bus %s: add device %s\n",bus->name,dev->bus_id);
-		list_add_tail(&dev->bus_list,&dev->bus->devices.list);
+		pr_debug("bus %s: add device %s\n", bus->name, dev->bus_id);
+		list_add_tail(&dev->bus_list, &dev->bus->devices.list);
 		device_attach(dev);
 		up_write(&dev->bus->subsys.rwsem);
-		sysfs_create_link(&bus->devices.kobj,&dev->kobj,dev->bus_id);
+		device_add_attrs(bus, dev);
+		sysfs_create_link(&bus->devices.kobj, &dev->kobj, dev->bus_id);
 	}
 	return error;
 }
@@ -428,9 +460,10 @@ int bus_add_device(struct device * dev)
 void bus_remove_device(struct device * dev)
 {
 	if (dev->bus) {
-		sysfs_remove_link(&dev->bus->devices.kobj,dev->bus_id);
+		sysfs_remove_link(&dev->bus->devices.kobj, dev->bus_id);
+		device_remove_attrs(dev->bus, dev);
 		down_write(&dev->bus->subsys.rwsem);
-		pr_debug("bus %s: remove device %s\n",dev->bus->name,dev->bus_id);
+		pr_debug("bus %s: remove device %s\n", dev->bus->name, dev->bus_id);
 		device_release_driver(dev);
 		list_del_init(&dev->bus_list);
 		up_write(&dev->bus->subsys.rwsem);
@@ -438,6 +471,37 @@ void bus_remove_device(struct device * dev)
 	}
 }
 
+static int driver_add_attrs(struct bus_type * bus, struct device_driver * drv)
+{
+	int error = 0;
+	int i;
+
+	if (bus->drv_attrs) {
+		for (i = 0; attr_name(bus->drv_attrs[i]); i++) {
+			error = driver_create_file(drv, &bus->drv_attrs[i]);
+			if (error)
+				goto Err;
+		}
+	}
+ Done:
+	return error;
+ Err:
+	while (--i >= 0)
+		driver_remove_file(drv, &bus->drv_attrs[i]);
+	goto Done;
+}
+
+
+static void driver_remove_attrs(struct bus_type * bus, struct device_driver * drv)
+{
+	int i;
+
+	if (bus->drv_attrs) {
+		for (i = 0; attr_name(bus->drv_attrs[i]); i++)
+			driver_remove_file(drv, &bus->drv_attrs[i]);
+	}
+}
+
 
 /**
  *	bus_add_driver - Add a driver to the bus.
@@ -450,8 +514,8 @@ int bus_add_driver(struct device_driver * drv)
 	int error = 0;
 
 	if (bus) {
-		pr_debug("bus %s: add driver %s\n",bus->name,drv->name);
-		error = kobject_set_name(&drv->kobj,drv->name);
+		pr_debug("bus %s: add driver %s\n", bus->name, drv->name);
+		error = kobject_set_name(&drv->kobj, drv->name);
 		if (error) {
 			put_bus(bus);
 			return error;
@@ -466,6 +530,7 @@ int bus_add_driver(struct device_driver * drv)
 		driver_attach(drv);
 		up_write(&bus->subsys.rwsem);
 
+		driver_add_attrs(bus, drv);
 	}
 	return error;
 }
@@ -483,8 +548,9 @@ int bus_add_driver(struct device_driver * drv)
 void bus_remove_driver(struct device_driver * drv)
 {
 	if (drv->bus) {
+		driver_remove_attrs(drv->bus, drv);
 		down_write(&drv->bus->subsys.rwsem);
-		pr_debug("bus %s: remove driver %s\n",drv->bus->name,drv->name);
+		pr_debug("bus %s: remove driver %s\n", drv->bus->name, drv->name);
 		driver_detach(drv);
 		up_write(&drv->bus->subsys.rwsem);
 		kobject_unregister(&drv->kobj);
@@ -526,7 +592,7 @@ int bus_rescan_devices(struct bus_type * bus)
 
 struct bus_type * get_bus(struct bus_type * bus)
 {
-	return bus ? container_of(subsys_get(&bus->subsys),struct bus_type,subsys) : NULL;
+	return bus ? container_of(subsys_get(&bus->subsys), struct bus_type, subsys) : NULL;
 }
 
 void put_bus(struct bus_type * bus)
@@ -541,33 +607,70 @@ void put_bus(struct bus_type * bus)
  *
  *	Call kset_find_obj() to iterate over list of buses to
  *	find a bus by name. Return bus if found.
+ *
+ *	Note that kset_find_obj increments bus' reference count.
  */
 
 struct bus_type * find_bus(char * name)
 {
-	struct kobject * k = kset_find_obj(&bus_subsys.kset,name);
+	struct kobject * k = kset_find_obj(&bus_subsys.kset, name);
 	return k ? to_bus(k) : NULL;
 }
 
+
+/**
+ *	bus_add_attrs - Add default attributes for this bus.
+ *	@bus:	Bus that has just been registered.
+ */
+
+static int bus_add_attrs(struct bus_type * bus)
+{
+	int error = 0;
+	int i;
+
+	if (bus->bus_attrs) {
+		for (i = 0; attr_name(bus->bus_attrs[i]); i++) {
+			if ((error = bus_create_file(bus,&bus->bus_attrs[i])))
+				goto Err;
+		}
+	}
+ Done:
+	return error;
+ Err:
+	while (--i >= 0)
+		bus_remove_file(bus,&bus->bus_attrs[i]);
+	goto Done;
+}
+
+static void bus_remove_attrs(struct bus_type * bus)
+{
+	int i;
+
+	if (bus->bus_attrs) {
+		for (i = 0; attr_name(bus->bus_attrs[i]); i++)
+			bus_remove_file(bus,&bus->bus_attrs[i]);
+	}
+}
+
 /**
  *	bus_register - register a bus with the system.
  *	@bus:	bus.
  *
  *	Once we have that, we registered the bus with the kobject
  *	infrastructure, then register the children subsystems it has:
- *	the devices and drivers that belong to the bus. 
+ *	the devices and drivers that belong to the bus.
  */
 int bus_register(struct bus_type * bus)
 {
 	int retval;
 
-	retval = kobject_set_name(&bus->subsys.kset.kobj,bus->name);
+	retval = kobject_set_name(&bus->subsys.kset.kobj, bus->name);
 	if (retval)
 		goto out;
 
-	subsys_set_kset(bus,bus_subsys);
+	subsys_set_kset(bus, bus_subsys);
 	retval = subsystem_register(&bus->subsys);
-	if (retval) 
+	if (retval)
 		goto out;
 
 	kobject_set_name(&bus->devices.kobj, "devices");
@@ -582,8 +685,9 @@ int bus_register(struct bus_type * bus)
 	retval = kset_register(&bus->drivers);
 	if (retval)
 		goto bus_drivers_fail;
+	bus_add_attrs(bus);
 
-	pr_debug("bus type '%s' registered\n",bus->name);
+	pr_debug("bus type '%s' registered\n", bus->name);
 	return 0;
 
 bus_drivers_fail:
@@ -596,7 +700,7 @@ out:
 
 
 /**
- *	bus_unregister - remove a bus from the system 
+ *	bus_unregister - remove a bus from the system
  *	@bus:	bus.
  *
  *	Unregister the child subsystems and the bus itself.
@@ -604,7 +708,8 @@ out:
  */
 void bus_unregister(struct bus_type * bus)
 {
-	pr_debug("bus %s: unregistering\n",bus->name);
+	pr_debug("bus %s: unregistering\n", bus->name);
+	bus_remove_attrs(bus);
 	kset_unregister(&bus->drivers);
 	kset_unregister(&bus->devices);
 	subsystem_unregister(&bus->subsys);
diff --git a/drivers/base/class.c b/drivers/base/class.c
index ed13d9de0..2693bb545 100644
--- a/drivers/base/class.c
+++ b/drivers/base/class.c
@@ -5,7 +5,7 @@
  * Copyright (c) 2002-3 Open Source Development Labs
  * Copyright (c) 2003-2004 Greg Kroah-Hartman
  * Copyright (c) 2003-2004 IBM Corp.
- * 
+ *
  * This file is released under the GPLv2
  *
  */
@@ -17,8 +17,8 @@
 #include <linux/string.h>
 #include "base.h"
 
-#define to_class_attr(_attr) container_of(_attr,struct class_attribute,attr)
-#define to_class(obj) container_of(obj,struct class,subsys.kset.kobj)
+#define to_class_attr(_attr) container_of(_attr, struct class_attribute, attr)
+#define to_class(obj) container_of(obj, struct class, subsys.kset.kobj)
 
 static ssize_t
 class_attr_show(struct kobject * kobj, struct attribute * attr, char * buf)
@@ -28,12 +28,12 @@ class_attr_show(struct kobject * kobj, struct attribute * attr, char * buf)
 	ssize_t ret = 0;
 
 	if (class_attr->show)
-		ret = class_attr->show(dc,buf);
+		ret = class_attr->show(dc, buf);
 	return ret;
 }
 
 static ssize_t
-class_attr_store(struct kobject * kobj, struct attribute * attr, 
+class_attr_store(struct kobject * kobj, struct attribute * attr,
 		 const char * buf, size_t count)
 {
 	struct class_attribute * class_attr = to_class_attr(attr);
@@ -41,7 +41,7 @@ class_attr_store(struct kobject * kobj, struct attribute * attr,
 	ssize_t ret = 0;
 
 	if (class_attr->store)
-		ret = class_attr->store(dc,buf,count);
+		ret = class_attr->store(dc, buf, count);
 	return ret;
 }
 
@@ -69,14 +69,14 @@ static struct kobj_type ktype_class = {
 };
 
 /* Hotplug events for classes go to the class_obj subsys */
-static decl_subsys(class,&ktype_class,NULL);
+static decl_subsys(class, &ktype_class, NULL);
 
 
 int class_create_file(struct class * cls, const struct class_attribute * attr)
 {
 	int error;
 	if (cls) {
-		error = sysfs_create_file(&cls->subsys.kset.kobj,&attr->attr);
+		error = sysfs_create_file(&cls->subsys.kset.kobj, &attr->attr);
 	} else
 		error = -EINVAL;
 	return error;
@@ -85,13 +85,13 @@ int class_create_file(struct class * cls, const struct class_attribute * attr)
 void class_remove_file(struct class * cls, const struct class_attribute * attr)
 {
 	if (cls)
-		sysfs_remove_file(&cls->subsys.kset.kobj,&attr->attr);
+		sysfs_remove_file(&cls->subsys.kset.kobj, &attr->attr);
 }
 
 struct class * class_get(struct class * cls)
 {
 	if (cls)
-		return container_of(subsys_get(&cls->subsys),struct class,subsys);
+		return container_of(subsys_get(&cls->subsys), struct class, subsys);
 	return NULL;
 }
 
@@ -100,33 +100,67 @@ void class_put(struct class * cls)
 	subsys_put(&cls->subsys);
 }
 
+
+static int add_class_attrs(struct class * cls)
+{
+	int i;
+	int error = 0;
+
+	if (cls->class_attrs) {
+		for (i = 0; attr_name(cls->class_attrs[i]); i++) {
+			error = class_create_file(cls,&cls->class_attrs[i]);
+			if (error)
+				goto Err;
+		}
+	}
+ Done:
+	return error;
+ Err:
+	while (--i >= 0)
+		class_remove_file(cls,&cls->class_attrs[i]);
+	goto Done;
+}
+
+static void remove_class_attrs(struct class * cls)
+{
+	int i;
+
+	if (cls->class_attrs) {
+		for (i = 0; attr_name(cls->class_attrs[i]); i++)
+			class_remove_file(cls,&cls->class_attrs[i]);
+	}
+}
+
 int class_register(struct class * cls)
 {
 	int error;
 
-	pr_debug("device class '%s': registering\n",cls->name);
+	pr_debug("device class '%s': registering\n", cls->name);
 
 	INIT_LIST_HEAD(&cls->children);
 	INIT_LIST_HEAD(&cls->interfaces);
-	error = kobject_set_name(&cls->subsys.kset.kobj,cls->name);
+	error = kobject_set_name(&cls->subsys.kset.kobj, cls->name);
 	if (error)
 		return error;
 
-	subsys_set_kset(cls,class_subsys);
+	subsys_set_kset(cls, class_subsys);
 
 	error = subsystem_register(&cls->subsys);
-	if (error)
-		return error;
-
-	return 0;
+	if (!error) {
+		error = add_class_attrs(class_get(cls));
+		class_put(cls);
+	}
+	return error;
 }
 
 void class_unregister(struct class * cls)
 {
-	pr_debug("device class '%s': unregistering\n",cls->name);
+	pr_debug("device class '%s': unregistering\n", cls->name);
+	remove_class_attrs(cls);
 	subsystem_unregister(&cls->subsys);
 }
 
+
 /* Class Device Stuff */
 
 int class_device_create_file(struct class_device * class_dev,
@@ -181,12 +215,12 @@ class_device_attr_show(struct kobject * kobj, struct attribute * attr,
 	ssize_t ret = 0;
 
 	if (class_dev_attr->show)
-		ret = class_dev_attr->show(cd,buf);
+		ret = class_dev_attr->show(cd, buf);
 	return ret;
 }
 
 static ssize_t
-class_device_attr_store(struct kobject * kobj, struct attribute * attr, 
+class_device_attr_store(struct kobject * kobj, struct attribute * attr,
 			const char * buf, size_t count)
 {
 	struct class_device_attribute * class_dev_attr = to_class_dev_attr(attr);
@@ -194,7 +228,7 @@ class_device_attr_store(struct kobject * kobj, struct attribute * attr,
 	ssize_t ret = 0;
 
 	if (class_dev_attr->store)
-		ret = class_dev_attr->store(cd,buf,count);
+		ret = class_dev_attr->store(cd, buf, count);
 	return ret;
 }
 
@@ -208,7 +242,7 @@ static void class_dev_release(struct kobject * kobj)
 	struct class_device *cd = to_class_dev(kobj);
 	struct class * cls = cd->class;
 
-	pr_debug("device class '%s': release.\n",cd->class_id);
+	pr_debug("device class '%s': release.\n", cd->class_id);
 
 	if (cls->release)
 		cls->release(cd);
@@ -272,6 +306,40 @@ static struct kset_hotplug_ops class_hotplug_ops = {
 
 static decl_subsys(class_obj, &ktype_class_device, &class_hotplug_ops);
 
+
+static int class_device_add_attrs(struct class_device * cd)
+{
+	int i;
+	int error = 0;
+	struct class * cls = cd->class;
+
+	if (cls->class_dev_attrs) {
+		for (i = 0; attr_name(cls->class_dev_attrs[i]); i++) {
+			error = class_device_create_file(cd,
+							 &cls->class_dev_attrs[i]);
+			if (error)
+				goto Err;
+		}
+	}
+ Done:
+	return error;
+ Err:
+	while (--i >= 0)
+		class_device_remove_file(cd,&cls->class_dev_attrs[i]);
+	goto Done;
+}
+
+static void class_device_remove_attrs(struct class_device * cd)
+{
+	int i;
+	struct class * cls = cd->class;
+
+	if (cls->class_dev_attrs) {
+		for (i = 0; attr_name(cls->class_dev_attrs[i]); i++)
+			class_device_remove_file(cd,&cls->class_dev_attrs[i]);
+	}
+}
+
 void class_device_initialize(struct class_device *class_dev)
 {
 	kobj_set_kset_s(class_dev, class_obj_subsys);
@@ -311,7 +379,7 @@ int class_device_add(struct class_device *class_dev)
 				class_intf->add(class_dev);
 		up_write(&parent->subsys.rwsem);
 	}
-
+	class_device_add_attrs(class_dev);
 	class_device_dev_link(class_dev);
 	class_device_driver_link(class_dev);
 
@@ -344,7 +412,8 @@ void class_device_del(struct class_device *class_dev)
 
 	class_device_dev_unlink(class_dev);
 	class_device_driver_unlink(class_dev);
-	
+	class_device_remove_attrs(class_dev);
+
 	kobject_del(&class_dev->kobj);
 
 	if (parent)
diff --git a/drivers/base/class_simple.c b/drivers/base/class_simple.c
index 20707be0d..3410636de 100644
--- a/drivers/base/class_simple.c
+++ b/drivers/base/class_simple.c
@@ -3,7 +3,7 @@
  *
  * Copyright (c) 2003-2004 Greg Kroah-Hartman <greg@kroah.com>
  * Copyright (c) 2003-2004 IBM Corp.
- * 
+ *
  * This file is released under the GPLv2
  *
  */
@@ -111,7 +111,7 @@ EXPORT_SYMBOL(class_simple_destroy);
 
 /**
  * class_simple_device_add - adds a class device to sysfs for a character driver
- * @cs: pointer to the struct class_simple that this device should be registered to.  
+ * @cs: pointer to the struct class_simple that this device should be registered to.
  * @dev: the dev_t for the device to be added.
  * @device: a pointer to a struct device that is assiociated with this class device.
  * @fmt: string for the class device's name
@@ -146,8 +146,8 @@ struct class_device *class_simple_device_add(struct class_simple *cs, dev_t dev,
 	s_dev->dev = dev;
 	s_dev->class_dev.dev = device;
 	s_dev->class_dev.class = &cs->class;
-	
-	va_start(args,fmt);
+
+	va_start(args, fmt);
 	vsnprintf(s_dev->class_dev.class_id, BUS_ID_SIZE, fmt, args);
 	va_end(args);
 	retval = class_device_register(&s_dev->class_dev);
@@ -173,10 +173,10 @@ EXPORT_SYMBOL(class_simple_device_add);
  * @cs: pointer to the struct class_simple to hold the pointer
  * @hotplug: function pointer to the hotplug function
  *
- * Implement and set a hotplug function to add environment variables specific to this 
+ * Implement and set a hotplug function to add environment variables specific to this
  * class on the hotplug event.
  */
-int class_simple_set_hotplug(struct class_simple *cs, 
+int class_simple_set_hotplug(struct class_simple *cs,
 	int (*hotplug)(struct class_device *dev, char **envp, int num_envp, char *buffer, int buffer_size))
 {
 	if ((cs == NULL) || (IS_ERR(cs)))
diff --git a/drivers/base/core.c b/drivers/base/core.c
index 0eaa2c003..153cdc48b 100644
--- a/drivers/base/core.c
+++ b/drivers/base/core.c
@@ -3,7 +3,7 @@
  *
  * Copyright (c) 2002-3 Patrick Mochel
  * Copyright (c) 2002-3 Open Source Development Labs
- * 
+ *
  * This file is released under the GPLv2
  *
  */
@@ -28,8 +28,8 @@ int (*platform_notify_remove)(struct device * dev) = NULL;
  * sysfs bindings for devices.
  */
 
-#define to_dev(obj) container_of(obj,struct device,kobj)
-#define to_dev_attr(_attr) container_of(_attr,struct device_attribute,attr)
+#define to_dev(obj) container_of(obj, struct device, kobj)
+#define to_dev_attr(_attr) container_of(_attr, struct device_attribute, attr)
 
 extern struct attribute * dev_default_attrs[];
 
@@ -41,12 +41,12 @@ dev_attr_show(struct kobject * kobj, struct attribute * attr, char * buf)
 	ssize_t ret = 0;
 
 	if (dev_attr->show)
-		ret = dev_attr->show(dev,buf);
+		ret = dev_attr->show(dev, buf);
 	return ret;
 }
 
 static ssize_t
-dev_attr_store(struct kobject * kobj, struct attribute * attr, 
+dev_attr_store(struct kobject * kobj, struct attribute * attr,
 	       const char * buf, size_t count)
 {
 	struct device_attribute * dev_attr = to_dev_attr(attr);
@@ -54,7 +54,7 @@ dev_attr_store(struct kobject * kobj, struct attribute * attr,
 	ssize_t ret = 0;
 
 	if (dev_attr->store)
-		ret = dev_attr->store(dev,buf,count);
+		ret = dev_attr->store(dev, buf, count);
 	return ret;
 }
 
@@ -153,7 +153,7 @@ int device_create_file(struct device * dev, struct device_attribute * attr)
 {
 	int error = 0;
 	if (get_device(dev)) {
-		error = sysfs_create_file(&dev->kobj,&attr->attr);
+		error = sysfs_create_file(&dev->kobj, &attr->attr);
 		put_device(dev);
 	}
 	return error;
@@ -168,7 +168,7 @@ int device_create_file(struct device * dev, struct device_attribute * attr)
 void device_remove_file(struct device * dev, struct device_attribute * attr)
 {
 	if (get_device(dev)) {
-		sysfs_remove_file(&dev->kobj,&attr->attr);
+		sysfs_remove_file(&dev->kobj, &attr->attr);
 		put_device(dev);
 	}
 }
@@ -179,7 +179,7 @@ void device_remove_file(struct device * dev, struct device_attribute * attr)
  *	@dev:	device.
  *
  *	This prepares the device for use by other layers,
- *	including adding it to the device hierarchy. 
+ *	including adding it to the device hierarchy.
  *	It is the first half of device_register(), if called by
  *	that, though it can also be called separately, so one
  *	may use @dev's fields (e.g. the refcount).
@@ -187,7 +187,7 @@ void device_remove_file(struct device * dev, struct device_attribute * attr)
 
 void device_initialize(struct device *dev)
 {
-	kobj_set_kset_s(dev,devices_subsys);
+	kobj_set_kset_s(dev, devices_subsys);
 	kobject_init(&dev->kobj);
 	INIT_LIST_HEAD(&dev->node);
 	INIT_LIST_HEAD(&dev->children);
@@ -200,7 +200,7 @@ void device_initialize(struct device *dev)
  *	device_add - add device to device hierarchy.
  *	@dev:	device.
  *
- *	This is part 2 of device_register(), though may be called 
+ *	This is part 2 of device_register(), though may be called
  *	separately _iff_ device_initialize() has been called separately.
  *
  *	This adds it to the kobject hierarchy via kobject_add(), adds it
@@ -221,7 +221,7 @@ int device_add(struct device *dev)
 	pr_debug("DEV: registering device: ID = '%s'\n", dev->bus_id);
 
 	/* first, register with generic layer. */
-	kobject_set_name(&dev->kobj,dev->bus_id);
+	kobject_set_name(&dev->kobj, dev->bus_id);
 	if (parent)
 		dev->kobj.parent = &parent->kobj;
 
@@ -233,7 +233,7 @@ int device_add(struct device *dev)
 		goto BusError;
 	down_write(&devices_subsys.rwsem);
 	if (parent)
-		list_add_tail(&dev->node,&parent->children);
+		list_add_tail(&dev->node, &parent->children);
 	up_write(&devices_subsys.rwsem);
 
 	/* notify platform of device entry */
@@ -245,7 +245,7 @@ int device_add(struct device *dev)
  BusError:
 	device_pm_remove(dev);
  PMError:
-	kobject_unregister(&dev->kobj);
+	kobject_del(&dev->kobj);
  Error:
 	if (parent)
 		put_device(parent);
@@ -258,9 +258,9 @@ int device_add(struct device *dev)
  *	@dev:	pointer to the device structure
  *
  *	This happens in two clean steps - initialize the device
- *	and add it to the system. The two steps can be called 
- *	separately, but this is the easiest and most common. 
- *	I.e. you should only call the two helpers separately if 
+ *	and add it to the system. The two steps can be called
+ *	separately, but this is the easiest and most common.
+ *	I.e. you should only call the two helpers separately if
  *	have a clearly defined need to use and refcount the device
  *	before it is added to the hierarchy.
  */
@@ -301,13 +301,13 @@ void put_device(struct device * dev)
  *	device_del - delete device from system.
  *	@dev:	device.
  *
- *	This is the first part of the device unregistration 
+ *	This is the first part of the device unregistration
  *	sequence. This removes the device from the lists we control
- *	from here, has it removed from the other driver model 
+ *	from here, has it removed from the other driver model
  *	subsystems it was added to in device_add(), and removes it
  *	from the kobject hierarchy.
  *
- *	NOTE: this should be called manually _iff_ device_add() was 
+ *	NOTE: this should be called manually _iff_ device_add() was
  *	also called manually.
  */
 
@@ -340,7 +340,7 @@ void device_del(struct device * dev)
  *	we remove it from all the subsystems with device_del(), then
  *	we decrement the reference count via put_device(). If that
  *	is the final reference count, the device will be cleaned up
- *	via device_release() above. Otherwise, the structure will 
+ *	via device_release() above. Otherwise, the structure will
  *	stick around until the final reference to the device is dropped.
  */
 void device_unregister(struct device * dev)
@@ -358,7 +358,7 @@ void device_unregister(struct device * dev)
  *	@fn:	function to be called for each device.
  *
  *	Iterate over @dev's child devices, and call @fn for each,
- *	passing it @data. 
+ *	passing it @data.
  *
  *	We check the return of @fn each time. If it returns anything
  *	other than 0, we break out and return that value.
@@ -370,14 +370,24 @@ int device_for_each_child(struct device * dev, void * data,
 	int error = 0;
 
 	down_read(&devices_subsys.rwsem);
-	list_for_each_entry(child,&dev->children,node) {
-		if((error = fn(child,data)))
+	list_for_each_entry(child, &dev->children, node) {
+		if((error = fn(child, data)))
 			break;
 	}
 	up_read(&devices_subsys.rwsem);
 	return error;
 }
 
+/**
+ *	device_find - locate device on a bus by name.
+ *	@name:	name of the device.
+ *	@bus:	bus to scan for the device.
+ *
+ *	Call kset_find_obj() to iterate over list of devices on
+ *	a bus to find device by name. Return device if found.
+ *
+ *	Note that kset_find_obj increments device's reference count.
+ */
 struct device *device_find(const char *name, struct bus_type *bus)
 {
 	struct kobject *k = kset_find_obj(&bus->devices, name);
diff --git a/drivers/base/cpu.c b/drivers/base/cpu.c
index 82b4430ab..aa66d7198 100644
--- a/drivers/base/cpu.c
+++ b/drivers/base/cpu.c
@@ -58,6 +58,8 @@ static inline void register_cpu_control(struct cpu *cpu)
 
 /*
  * register_cpu - Setup a driverfs device for a CPU.
+ * @cpu - Callers can set the cpu->no_control field to 1, to indicate not to
+ *		  generate a control file in sysfs for this CPU.
  * @num - CPU number to use when creating the device.
  *
  * Initialize and register the CPU device.
@@ -75,7 +77,7 @@ int __init register_cpu(struct cpu *cpu, int num, struct node *root)
 		error = sysfs_create_link(&root->sysdev.kobj,
 					  &cpu->sysdev.kobj,
 					  kobject_name(&cpu->sysdev.kobj));
-	if (!error)
+	if (!error && !cpu->no_control)
 		register_cpu_control(cpu);
 	return error;
 }
diff --git a/drivers/base/dmapool.c b/drivers/base/dmapool.c
index bbbf06643..55cdd46f5 100644
--- a/drivers/base/dmapool.c
+++ b/drivers/base/dmapool.c
@@ -110,7 +110,7 @@ dma_pool_create (const char *name, struct device *dev,
 	if (align == 0)
 		align = 1;
 	if (size == 0)
-		return 0;
+		return NULL;
 	else if (size < align)
 		size = align;
 	else if ((size % align) != 0) {
@@ -125,7 +125,7 @@ dma_pool_create (const char *name, struct device *dev,
 			allocation = PAGE_SIZE;
 		// FIXME: round up for less fragmentation
 	} else if (allocation < size)
-		return 0;
+		return NULL;
 
 	if (!(retval = kmalloc (sizeof *retval, SLAB_KERNEL)))
 		return retval;
@@ -167,7 +167,7 @@ pool_alloc_page (struct dma_pool *pool, int mem_flags)
 
 	page = (struct dma_page *) kmalloc (mapsize + sizeof *page, mem_flags);
 	if (!page)
-		return 0;
+		return NULL;
 	page->vaddr = dma_alloc_coherent (pool->dev,
 					    pool->allocation,
 					    &page->dma,
@@ -181,7 +181,7 @@ pool_alloc_page (struct dma_pool *pool, int mem_flags)
 		page->in_use = 0;
 	} else {
 		kfree (page);
-		page = 0;
+		page = NULL;
 	}
 	return page;
 }
@@ -302,7 +302,7 @@ restart:
 			remove_wait_queue (&pool->waitq, &wait);
 			goto restart;
 		}
-		retval = 0;
+		retval = NULL;
 		goto done;
 	}
 
@@ -334,7 +334,7 @@ pool_find_page (struct dma_pool *pool, dma_addr_t dma)
 		if (dma < (page->dma + pool->allocation))
 			goto done;
 	}
-	page = 0;
+	page = NULL;
 done:
 	spin_unlock_irqrestore (&pool->lock, flags);
 	return page;
diff --git a/drivers/base/driver.c b/drivers/base/driver.c
index 0236ba335..735bd1702 100644
--- a/drivers/base/driver.c
+++ b/drivers/base/driver.c
@@ -3,7 +3,7 @@
  *
  * Copyright (c) 2002-3 Patrick Mochel
  * Copyright (c) 2002-3 Open Source Development Labs
- * 
+ *
  * This file is released under the GPLv2
  *
  */
@@ -15,8 +15,8 @@
 #include <linux/string.h>
 #include "base.h"
 
-#define to_dev(node) container_of(node,struct device,driver_list)
-#define to_drv(obj) container_of(obj,struct device_driver,kobj)
+#define to_dev(node) container_of(node, struct device, driver_list)
+#define to_drv(obj) container_of(obj, struct device_driver, kobj)
 
 /**
  *	driver_create_file - create sysfs file for driver.
@@ -28,7 +28,7 @@ int driver_create_file(struct device_driver * drv, struct driver_attribute * att
 {
 	int error;
 	if (get_driver(drv)) {
-		error = sysfs_create_file(&drv->kobj,&attr->attr);
+		error = sysfs_create_file(&drv->kobj, &attr->attr);
 		put_driver(drv);
 	} else
 		error = -EINVAL;
@@ -45,7 +45,7 @@ int driver_create_file(struct device_driver * drv, struct driver_attribute * att
 void driver_remove_file(struct device_driver * drv, struct driver_attribute * attr)
 {
 	if (get_driver(drv)) {
-		sysfs_remove_file(&drv->kobj,&attr->attr);
+		sysfs_remove_file(&drv->kobj, &attr->attr);
 		put_driver(drv);
 	}
 }
@@ -76,7 +76,7 @@ void put_driver(struct device_driver * drv)
  *	@drv:	driver to register
  *
  *	We pass off most of the work to the bus_add_driver() call,
- *	since most of the things we have to do deal with the bus 
+ *	since most of the things we have to do deal with the bus
  *	structures.
  *
  *	The one interesting aspect is that we initialize @drv->unload_sem
@@ -99,8 +99,8 @@ int driver_register(struct device_driver * drv)
  *
  *	Though, once that is done, we attempt to take @drv->unload_sem.
  *	This will block until the driver refcount reaches 0, and it is
- *	released. Only modular drivers will call this function, and we 
- *	have to guarantee that it won't complete, letting the driver 
+ *	released. Only modular drivers will call this function, and we
+ *	have to guarantee that it won't complete, letting the driver
  *	unload until all references are gone.
  */
 
@@ -111,10 +111,29 @@ void driver_unregister(struct device_driver * drv)
 	up(&drv->unload_sem);
 }
 
+/**
+ *	driver_find - locate driver on a bus by its name.
+ *	@name:	name of the driver.
+ *	@bus:	bus to scan for the driver.
+ *
+ *	Call kset_find_obj() to iterate over list of drivers on
+ *	a bus to find driver by name. Return driver if found.
+ *
+ *	Note that kset_find_obj increments driver's reference count.
+ */
+struct device_driver *driver_find(const char *name, struct bus_type *bus)
+{
+	struct kobject *k = kset_find_obj(&bus->drivers, name);
+	if (k)
+		return to_drv(k);
+	return NULL;
+}
+
 EXPORT_SYMBOL(driver_register);
 EXPORT_SYMBOL(driver_unregister);
 EXPORT_SYMBOL(get_driver);
 EXPORT_SYMBOL(put_driver);
+EXPORT_SYMBOL(driver_find);
 
 EXPORT_SYMBOL(driver_create_file);
 EXPORT_SYMBOL(driver_remove_file);
diff --git a/drivers/base/firmware.c b/drivers/base/firmware.c
index 886d49614..0cff0498e 100644
--- a/drivers/base/firmware.c
+++ b/drivers/base/firmware.c
@@ -3,7 +3,7 @@
  *
  * Copyright (c) 2002-3 Patrick Mochel
  * Copyright (c) 2002-3 Open Source Development Labs
- * 
+ *
  * This file is released under the GPLv2
  *
  */
@@ -12,11 +12,11 @@
 #include <linux/module.h>
 #include <linux/init.h>
 
-static decl_subsys(firmware,NULL,NULL);
+static decl_subsys(firmware, NULL, NULL);
 
 int firmware_register(struct subsystem * s)
 {
-	kset_set_kset_s(s,firmware_subsys);
+	kset_set_kset_s(s, firmware_subsys);
 	return subsystem_register(s);
 }
 
diff --git a/drivers/base/firmware_class.c b/drivers/base/firmware_class.c
index 8ff239f14..a57ba84eb 100644
--- a/drivers/base/firmware_class.c
+++ b/drivers/base/firmware_class.c
@@ -68,7 +68,7 @@ firmware_timeout_show(struct class *class, char *buf)
  *	firmware will be provided.
  *
  *	Note: zero means 'wait for ever'
- *  
+ *
  **/
 static ssize_t
 firmware_timeout_store(struct class *class, const char *buf, size_t count)
@@ -121,7 +121,7 @@ firmware_loading_show(struct class_device *class_dev, char *buf)
 /**
  * firmware_loading_store: - loading control file
  * Description:
- *	The relevant values are: 
+ *	The relevant values are:
  *
  *	 1: Start a load, discarding any previous partial load.
  *	 0: Conclude the load and handle the data to the driver code.
@@ -376,7 +376,7 @@ out:
 	return retval;
 }
 
-/** 
+/**
  * request_firmware: - request firmware to hotplug and wait for it
  * Description:
  *	@firmware will be used to return a firmware image by the name
@@ -457,7 +457,7 @@ release_firmware(const struct firmware *fw)
 
 /**
  * register_firmware: - provide a firmware image for later usage
- * 
+ *
  * Description:
  *	Make sure that @data will be available by requesting firmware @name.
  *
@@ -541,7 +541,7 @@ request_firmware_nowait(
 
 	ret = kernel_thread(request_firmware_work_func, fw_work,
 			    CLONE_FS | CLONE_FILES);
-	
+
 	if (ret < 0) {
 		fw_work->cont(NULL, fw_work->context);
 		return ret;
diff --git a/drivers/base/init.c b/drivers/base/init.c
index fd53f364b..7b86c409c 100644
--- a/drivers/base/init.c
+++ b/drivers/base/init.c
@@ -2,7 +2,7 @@
  *
  * Copyright (c) 2002-3 Patrick Mochel
  * Copyright (c) 2002-3 Open Source Development Labs
- * 
+ *
  * This file is released under the GPLv2
  *
  */
@@ -33,7 +33,7 @@ void __init driver_init(void)
 	classes_init();
 	firmware_init();
 
-	/* These are also core pieces, but must come after the 
+	/* These are also core pieces, but must come after the
 	 * core core pieces.
 	 */
 	platform_bus_init();
diff --git a/drivers/base/interface.c b/drivers/base/interface.c
index 1e2d4c328..bd515843a 100644
--- a/drivers/base/interface.c
+++ b/drivers/base/interface.c
@@ -1,10 +1,10 @@
 /*
- * drivers/base/interface.c - common driverfs interface that's exported to 
+ * drivers/base/interface.c - common driverfs interface that's exported to
  * 	the world for all devices.
  *
  * Copyright (c) 2002-3 Patrick Mochel
  * Copyright (c) 2002-3 Open Source Development Labs
- * 
+ *
  * This file is released under the GPLv2
  *
  */
@@ -16,33 +16,33 @@
 
 /**
  *	detach_state - control the default power state for the device.
- *	
- *	This is the state the device enters when it's driver module is 
+ *
+ *	This is the state the device enters when it's driver module is
  *	unloaded. The value is an unsigned integer, in the range of 0-4.
  *	'0' indicates 'On', so no action will be taken when the driver is
  *	unloaded. This is the default behavior.
  *	'4' indicates 'Off', meaning the driver core will call the driver's
  *	shutdown method to quiesce the device.
- *	1-3 indicate a low-power state for the device to enter via the 
- *	driver's suspend method. 
+ *	1-3 indicate a low-power state for the device to enter via the
+ *	driver's suspend method.
  */
 
 static ssize_t detach_show(struct device * dev, char * buf)
 {
-	return sprintf(buf,"%u\n",dev->detach_state);
+	return sprintf(buf, "%u\n", dev->detach_state);
 }
 
 static ssize_t detach_store(struct device * dev, const char * buf, size_t n)
 {
 	u32 state;
-	state = simple_strtoul(buf,NULL,10);
+	state = simple_strtoul(buf, NULL, 10);
 	if (state > 4)
 		return -EINVAL;
 	dev->detach_state = state;
 	return n;
 }
 
-static DEVICE_ATTR(detach_state,0644,detach_show,detach_store);
+static DEVICE_ATTR(detach_state, 0644, detach_show, detach_store);
 
 
 struct attribute * dev_default_attrs[] = {
diff --git a/drivers/base/node.c b/drivers/base/node.c
index b5aa9dc6c..c1187363f 100644
--- a/drivers/base/node.c
+++ b/drivers/base/node.c
@@ -7,6 +7,7 @@
 #include <linux/init.h>
 #include <linux/mm.h>
 #include <linux/node.h>
+#include <linux/hugetlb.h>
 #include <linux/cpumask.h>
 #include <linux/topology.h>
 
@@ -29,13 +30,7 @@ static ssize_t node_read_cpumap(struct sys_device * dev, char * buf)
 	return len;
 }
 
-static SYSDEV_ATTR(cpumap,S_IRUGO,node_read_cpumap,NULL);
-
-/* Can be overwritten by architecture specific code. */
-int __attribute__((weak)) hugetlb_report_node_meminfo(int node, char *buf)
-{
-	return 0;
-}
+static SYSDEV_ATTR(cpumap, S_IRUGO, node_read_cpumap, NULL);
 
 #define K(x) ((x) << (PAGE_SHIFT - 10))
 static ssize_t node_read_meminfo(struct sys_device * dev, char * buf)
@@ -54,17 +49,17 @@ static ssize_t node_read_meminfo(struct sys_device * dev, char * buf)
 		       "Node %d LowFree:      %8lu kB\n",
 		       nid, K(i.totalram),
 		       nid, K(i.freeram),
-		       nid, K(i.totalram-i.freeram),
+		       nid, K(i.totalram - i.freeram),
 		       nid, K(i.totalhigh),
 		       nid, K(i.freehigh),
-		       nid, K(i.totalram-i.totalhigh),
-		       nid, K(i.freeram-i.freehigh));
+		       nid, K(i.totalram - i.totalhigh),
+		       nid, K(i.freeram - i.freehigh));
 	n += hugetlb_report_node_meminfo(nid, buf + n);
 	return n;
 }
 
-#undef K 
-static SYSDEV_ATTR(meminfo,S_IRUGO,node_read_meminfo,NULL);
+#undef K
+static SYSDEV_ATTR(meminfo, S_IRUGO, node_read_meminfo, NULL);
 
 static ssize_t node_read_numastat(struct sys_device * dev, char * buf)
 {
@@ -104,7 +99,7 @@ static ssize_t node_read_numastat(struct sys_device * dev, char * buf)
 		       local_node,
 		       other_node);
 }
-static SYSDEV_ATTR(numastat,S_IRUGO,node_read_numastat,NULL);
+static SYSDEV_ATTR(numastat, S_IRUGO, node_read_numastat, NULL);
 
 /*
  * register_node - Setup a driverfs device for a node.
diff --git a/drivers/base/platform.c b/drivers/base/platform.c
index 0d75909a4..9f285ed4e 100644
--- a/drivers/base/platform.c
+++ b/drivers/base/platform.c
@@ -3,7 +3,7 @@
  *
  * Copyright (c) 2002-3 Patrick Mochel
  * Copyright (c) 2002-3 Open Source Development Labs
- * 
+ *
  * This file is released under the GPLv2
  *
  * Please see Documentation/driver-model/platform.txt for more
@@ -13,11 +13,71 @@
 #include <linux/device.h>
 #include <linux/module.h>
 #include <linux/init.h>
+#include <linux/dma-mapping.h>
+#include <linux/bootmem.h>
+#include <linux/err.h>
 
 struct device platform_bus = {
 	.bus_id		= "platform",
 };
 
+/**
+ *	platform_get_resource - get a resource for a device
+ *	@dev: platform device
+ *	@type: resource type
+ *	@num: resource index
+ */
+struct resource *
+platform_get_resource(struct platform_device *dev, unsigned int type,
+		      unsigned int num)
+{
+	int i;
+
+	for (i = 0; i < dev->num_resources; i++) {
+		struct resource *r = &dev->resource[i];
+
+		if ((r->flags & (IORESOURCE_IO|IORESOURCE_MEM|
+				 IORESOURCE_IRQ|IORESOURCE_DMA))
+		    == type)
+			if (num-- == 0)
+				return r;
+	}
+	return NULL;
+}
+
+/**
+ *	platform_get_irq - get an IRQ for a device
+ *	@dev: platform device
+ *	@num: IRQ number index
+ */
+int platform_get_irq(struct platform_device *dev, unsigned int num)
+{
+	struct resource *r = platform_get_resource(dev, IORESOURCE_IRQ, num);
+
+	return r ? r->start : 0;
+}
+
+/**
+ *	platform_add_devices - add a numbers of platform devices
+ *	@devs: array of platform devices to add
+ *	@num: number of platform devices in array
+ */
+int platform_add_devices(struct platform_device **devs, int num)
+{
+	int i, ret = 0;
+
+	for (i = 0; i < num; i++) {
+		ret = platform_device_register(devs[i]);
+		if (ret) {
+			while (--i >= 0)
+				platform_device_unregister(devs[i]);
+			break;
+		}
+	}
+
+	return ret;
+}
+
 /**
  *	platform_device_register - add a platform-level device
  *	@dev:	platform device we're adding
@@ -25,6 +85,8 @@ struct device platform_bus = {
  */
 int platform_device_register(struct platform_device * pdev)
 {
+	int i, ret = 0;
+
 	if (!pdev)
 		return -EINVAL;
 
@@ -32,18 +94,125 @@ int platform_device_register(struct platform_device * pdev)
 		pdev->dev.parent = &platform_bus;
 
 	pdev->dev.bus = &platform_bus_type;
-	
-	snprintf(pdev->dev.bus_id,BUS_ID_SIZE,"%s%u",pdev->name,pdev->id);
+
+	if (pdev->id != -1)
+		snprintf(pdev->dev.bus_id, BUS_ID_SIZE, "%s%u", pdev->name, pdev->id);
+	else
+		strlcpy(pdev->dev.bus_id, pdev->name, BUS_ID_SIZE);
+
+	for (i = 0; i < pdev->num_resources; i++) {
+		struct resource *p, *r = &pdev->resource[i];
+
+		r->name = pdev->dev.bus_id;
+
+		p = NULL;
+		if (r->flags & IORESOURCE_MEM)
+			p = &iomem_resource;
+		else if (r->flags & IORESOURCE_IO)
+			p = &ioport_resource;
+
+		if (p && request_resource(p, r)) {
+			printk(KERN_ERR
+			       "%s: failed to claim resource %d\n",
+			       pdev->dev.bus_id, i);
+			ret = -EBUSY;
+			goto failed;
+		}
+	}
 
 	pr_debug("Registering platform device '%s'. Parent at %s\n",
-		 pdev->dev.bus_id,pdev->dev.parent->bus_id);
-	return device_register(&pdev->dev);
+		 pdev->dev.bus_id, pdev->dev.parent->bus_id);
+
+	ret = device_register(&pdev->dev);
+	if (ret == 0)
+		return ret;
+
+ failed:
+	while (--i >= 0)
+		if (pdev->resource[i].flags & (IORESOURCE_MEM|IORESOURCE_IO))
+			release_resource(&pdev->resource[i]);
+	return ret;
 }
 
+/**
+ *	platform_device_unregister - remove a platform-level device
+ *	@dev:	platform device we're removing
+ *
+ *	Note that this function will also release all memory- and port-based
+ *	resources owned by the device (@dev->resource).
+ */
 void platform_device_unregister(struct platform_device * pdev)
 {
-	if (pdev)
+	int i;
+
+	if (pdev) {
+		for (i = 0; i < pdev->num_resources; i++) {
+			struct resource *r = &pdev->resource[i];
+			if (r->flags & (IORESOURCE_MEM|IORESOURCE_IO))
+				release_resource(r);
+		}
+
 		device_unregister(&pdev->dev);
+	}
+}
+
+struct platform_object {
+        struct platform_device pdev;
+        struct resource resources[0];
+};
+
+static void platform_device_release_simple(struct device *dev)
+{
+	struct platform_device *pdev = to_platform_device(dev);
+
+	kfree(container_of(pdev, struct platform_object, pdev));
+}
+
+/**
+ *	platform_device_register_simple
+ *	@name:  base name of the device we're adding
+ *	@id:    instance id
+ *	@res:   set of resources that needs to be allocated for the device
+ *	@num:	number of resources
+ *
+ *	This function creates a simple platform device that requires minimal
+ *	resource and memory management. Canned release function freeing
+ *	memory allocated for the device allows drivers using such devices
+ *	to be unloaded iwithout waiting for the last reference to the device
+ *	to be dropped.
+ */
+struct platform_device *platform_device_register_simple(char *name, unsigned int id,
+							struct resource *res, unsigned int num)
+{
+	struct platform_object *pobj;
+	int retval;
+
+	pobj = kmalloc(sizeof(struct platform_object) + sizeof(struct resource) * num, GFP_KERNEL);
+	if (!pobj) {
+		retval = -ENOMEM;
+		goto error;
+	}
+
+	memset(pobj, 0, sizeof(*pobj));
+	pobj->pdev.name = name;
+	pobj->pdev.id = id;
+	pobj->pdev.dev.release = platform_device_release_simple;
+
+	if (num) {
+		memcpy(pobj->resources, res, sizeof(struct resource) * num);
+		pobj->pdev.resource = pobj->resources;
+		pobj->pdev.num_resources = num;
+	}
+
+	retval = platform_device_register(&pobj->pdev);
+	if (retval)
+		goto error;
+
+	return &pobj->pdev;
+
+error:
+	kfree(pobj);
+	return ERR_PTR(retval);
 }
 
 
@@ -52,13 +221,13 @@ void platform_device_unregister(struct platform_device * pdev)
  *	@dev:	device.
  *	@drv:	driver.
  *
- *	Platform device IDs are assumed to be encoded like this: 
- *	"<name><instance>", where <name> is a short description of the 
- *	type of device, like "pci" or "floppy", and <instance> is the 
+ *	Platform device IDs are assumed to be encoded like this:
+ *	"<name><instance>", where <name> is a short description of the
+ *	type of device, like "pci" or "floppy", and <instance> is the
  *	enumerated instance of the device, like '0' or '42'.
- *	Driver IDs are simply "<name>". 
- *	So, extract the <name> from the platform_device structure, 
- *	and compare it against the name of the driver. Return whether 
+ *	Driver IDs are simply "<name>".
+ *	So, extract the <name> from the platform_device structure,
+ *	and compare it against the name of the driver. Return whether
  *	they match or not.
  */
 
@@ -110,7 +279,32 @@ int __init platform_bus_init(void)
 	return bus_register(&platform_bus_type);
 }
 
+#ifndef ARCH_HAS_DMA_GET_REQUIRED_MASK
+u64 dma_get_required_mask(struct device *dev)
+{
+	u32 low_totalram = ((max_pfn - 1) << PAGE_SHIFT);
+	u32 high_totalram = ((max_pfn - 1) >> (32 - PAGE_SHIFT));
+	u64 mask;
+
+	if (!high_totalram) {
+		/* convert to mask just covering totalram */
+		low_totalram = (1 << (fls(low_totalram) - 1));
+		low_totalram += low_totalram - 1;
+		mask = low_totalram;
+	} else {
+		high_totalram = (1 << (fls(high_totalram) - 1));
+		high_totalram += high_totalram - 1;
+		mask = (((u64)high_totalram) << 32) + 0xffffffff;
+	}
+	return mask & *dev->dma_mask;
+}
+EXPORT_SYMBOL(dma_get_required_mask);
+#endif
+
 EXPORT_SYMBOL(platform_bus);
 EXPORT_SYMBOL(platform_bus_type);
 EXPORT_SYMBOL(platform_device_register);
+EXPORT_SYMBOL(platform_device_register_simple);
 EXPORT_SYMBOL(platform_device_unregister);
+EXPORT_SYMBOL(platform_get_irq);
+EXPORT_SYMBOL(platform_get_resource);
diff --git a/drivers/base/power/main.c b/drivers/base/power/main.c
index 634c98f5c..635ea2001 100644
--- a/drivers/base/power/main.c
+++ b/drivers/base/power/main.c
@@ -12,10 +12,10 @@
  * and add it to the list of power-controlled devices. sysfs entries for
  * controlling device power management will also be added.
  *
- * A different set of lists than the global subsystem list are used to 
- * keep track of power info because we use different lists to hold 
- * devices based on what stage of the power management process they 
- * are in. The power domain dependencies may also differ from the 
+ * A different set of lists than the global subsystem list are used to
+ * keep track of power info because we use different lists to hold
+ * devices based on what stage of the power management process they
+ * are in. The power domain dependencies may also differ from the
  * ancestral dependencies that the subsystem list maintains.
  */
 
@@ -74,10 +74,10 @@ int device_pm_add(struct device * dev)
 
 	pr_debug("PM: Adding info for %s:%s\n",
 		 dev->bus ? dev->bus->name : "No Bus", dev->kobj.name);
-	atomic_set(&dev->power.pm_users,0);
+	atomic_set(&dev->power.pm_users, 0);
 	down(&dpm_sem);
-	list_add_tail(&dev->power.entry,&dpm_active);
-	device_pm_set_parent(dev,dev->parent);
+	list_add_tail(&dev->power.entry, &dpm_active);
+	device_pm_set_parent(dev, dev->parent);
 	if ((error = dpm_sysfs_add(dev)))
 		list_del(&dev->power.entry);
 	up(&dpm_sem);
diff --git a/drivers/base/power/power.h b/drivers/base/power/power.h
index b930ccef5..6971cc667 100644
--- a/drivers/base/power/power.h
+++ b/drivers/base/power/power.h
@@ -27,7 +27,7 @@ extern void device_shutdown(void);
  */
 extern struct semaphore dpm_sem;
 
-/* 
+/*
  * The PM lists.
  */
 extern struct list_head dpm_active;
@@ -37,12 +37,12 @@ extern struct list_head dpm_off_irq;
 
 static inline struct dev_pm_info * to_pm_info(struct list_head * entry)
 {
-	return container_of(entry,struct dev_pm_info,entry);
+	return container_of(entry, struct dev_pm_info, entry);
 }
 
 static inline struct device * to_device(struct list_head * entry)
 {
-	return container_of(to_pm_info(entry),struct device,power);
+	return container_of(to_pm_info(entry), struct device, power);
 }
 
 extern int device_pm_add(struct device *);
@@ -56,7 +56,7 @@ extern int dpm_sysfs_add(struct device *);
 extern void dpm_sysfs_remove(struct device *);
 
 /*
- * resume.c 
+ * resume.c
  */
 
 extern void dpm_resume(void);
diff --git a/drivers/base/power/resume.c b/drivers/base/power/resume.c
index 21d4b56de..1d830be4c 100644
--- a/drivers/base/power/resume.c
+++ b/drivers/base/power/resume.c
@@ -39,7 +39,7 @@ void dpm_resume(void)
 		if (!dev->power.prev_state)
 			resume_device(dev);
 
-		list_add_tail(entry,&dpm_active);
+		list_add_tail(entry, &dpm_active);
 	}
 }
 
@@ -48,7 +48,7 @@ void dpm_resume(void)
  *	device_resume - Restore state of each device in system.
  *
  *	Walk the dpm_off list, remove each entry, resume the device,
- *	then add it to the dpm_active list. 
+ *	then add it to the dpm_active list.
  */
 
 void device_resume(void)
@@ -62,14 +62,14 @@ EXPORT_SYMBOL(device_resume);
 
 
 /**
- *	device_power_up_irq - Power on some devices. 
+ *	device_power_up_irq - Power on some devices.
  *
- *	Walk the dpm_off_irq list and power each device up. This 
+ *	Walk the dpm_off_irq list and power each device up. This
  *	is used for devices that required they be powered down with
  *	interrupts disabled. As devices are powered on, they are moved to
  *	the dpm_suspended list.
  *
- *	Interrupts must be disabled when calling this. 
+ *	Interrupts must be disabled when calling this.
  */
 
 void dpm_power_up(void)
@@ -78,7 +78,7 @@ void dpm_power_up(void)
 		struct list_head * entry = dpm_off_irq.next;
 		list_del_init(entry);
 		resume_device(to_device(entry));
-		list_add_tail(entry,&dpm_active);
+		list_add_tail(entry, &dpm_active);
 	}
 }
 
diff --git a/drivers/base/power/runtime.c b/drivers/base/power/runtime.c
index 4ff5340e9..5e58f6836 100644
--- a/drivers/base/power/runtime.c
+++ b/drivers/base/power/runtime.c
@@ -24,9 +24,9 @@ static void runtime_resume(struct device * dev)
  *	dpm_runtime_resume - Power one device back on.
  *	@dev:	Device.
  *
- *	Bring one device back to the on state by first powering it 
+ *	Bring one device back to the on state by first powering it
  *	on, then restoring state. We only operate on devices that aren't
- *	already on. 
+ *	already on.
  *	FIXME: We need to handle devices that are in an unknown state.
  */
 
@@ -55,7 +55,7 @@ int dpm_runtime_suspend(struct device * dev, u32 state)
 	if (dev->power.power_state)
 		runtime_resume(dev);
 
-	if (!(error = suspend_device(dev,state)))
+	if (!(error = suspend_device(dev, state)))
 		dev->power.power_state = state;
  Done:
 	up(&dpm_sem);
@@ -70,7 +70,7 @@ int dpm_runtime_suspend(struct device * dev, u32 state)
  *
  *	This is an update mechanism for drivers to notify the core
  *	what power state a device is in. Device probing code may not
- *	always be able to tell, but we need accurate information to 
+ *	always be able to tell, but we need accurate information to
  *	work reliably.
  */
 void dpm_set_power_state(struct device * dev, u32 state)
diff --git a/drivers/base/power/shutdown.c b/drivers/base/power/shutdown.c
index 6725ffacb..d1e023fbe 100644
--- a/drivers/base/power/shutdown.c
+++ b/drivers/base/power/shutdown.c
@@ -1,9 +1,9 @@
 /*
  * shutdown.c - power management functions for the device tree.
- * 
+ *
  * Copyright (c) 2002-3 Patrick Mochel
  *		 2002-3 Open Source Development Lab
- * 
+ *
  * This file is released under the GPLv2
  *
  */
@@ -14,7 +14,7 @@
 
 #include "power.h"
 
-#define to_dev(node) container_of(node,struct device,kobj.entry)
+#define to_dev(node) container_of(node, struct device, kobj.entry)
 
 extern struct subsystem devices_subsys;
 
@@ -29,7 +29,7 @@ int device_detach_shutdown(struct device * dev)
 			dev->driver->shutdown(dev);
 		return 0;
 	}
-	return dpm_runtime_suspend(dev,dev->detach_state);
+	return dpm_runtime_suspend(dev, dev->detach_state);
 }
 
 
@@ -38,8 +38,8 @@ int device_detach_shutdown(struct device * dev)
  * down last and resume them first. That way, we don't do anything stupid like
  * shutting down the interrupt controller before any devices..
  *
- * Note that there are not different stages for power management calls - 
- * they only get one called once when interrupts are disabled. 
+ * Note that there are not different stages for power management calls -
+ * they only get one called once when interrupts are disabled.
  */
 
 extern int sysdev_shutdown(void);
@@ -50,10 +50,10 @@ extern int sysdev_shutdown(void);
 void device_shutdown(void)
 {
 	struct device * dev;
-	
+
 	down_write(&devices_subsys.rwsem);
-	list_for_each_entry_reverse(dev,&devices_subsys.kset.list,kobj.entry) {
-		pr_debug("shutting down %s: ",dev->bus_id);
+	list_for_each_entry_reverse(dev, &devices_subsys.kset.list, kobj.entry) {
+		pr_debug("shutting down %s: ", dev->bus_id);
 		if (dev->driver && dev->driver->shutdown) {
 			pr_debug("Ok\n");
 			dev->driver->shutdown(dev);
diff --git a/drivers/base/power/suspend.c b/drivers/base/power/suspend.c
index a2bc41cc9..86f9e6ec0 100644
--- a/drivers/base/power/suspend.c
+++ b/drivers/base/power/suspend.c
@@ -1,5 +1,5 @@
 /*
- * suspend.c - Functions for putting devices to sleep. 
+ * suspend.c - Functions for putting devices to sleep.
  *
  * Copyright (c) 2003 Patrick Mochel
  * Copyright (c) 2003 Open Source Development Labs
@@ -10,18 +10,18 @@
 
 #include <linux/device.h>
 #include "power.h"
- 
+
 extern int sysdev_suspend(u32 state);
 
 /*
  * The entries in the dpm_active list are in a depth first order, simply
- * because children are guaranteed to be discovered after parents, and 
- * are inserted at the back of the list on discovery. 
- * 
+ * because children are guaranteed to be discovered after parents, and
+ * are inserted at the back of the list on discovery.
+ *
  * All list on the suspend path are done in reverse order, so we operate
  * on the leaves of the device tree (or forests, depending on how you want
- * to look at it ;) first. As nodes are removed from the back of the list, 
- * they are inserted into the front of their destintation lists. 
+ * to look at it ;) first. As nodes are removed from the back of the list,
+ * they are inserted into the front of their destintation lists.
  *
  * Things are the reverse on the resume path - iterations are done in
  * forward order, and nodes are inserted at the back of their destination
@@ -44,7 +44,7 @@ int suspend_device(struct device * dev, u32 state)
 	dev->power.prev_state = dev->power.power_state;
 
 	if (dev->bus && dev->bus->suspend && !dev->power.power_state)
-		error = dev->bus->suspend(dev,state);
+		error = dev->bus->suspend(dev, state);
 
 	return error;
 }
@@ -52,16 +52,16 @@ int suspend_device(struct device * dev, u32 state)
 
 /**
  *	device_suspend - Save state and stop all devices in system.
- *	@state:		Power state to put each device in. 
+ *	@state:		Power state to put each device in.
  *
  *	Walk the dpm_active list, call ->suspend() for each device, and move
- *	it to dpm_off. 
+ *	it to dpm_off.
  *	Check the return value for each. If it returns 0, then we move the
- *	the device to the dpm_off list. If it returns -EAGAIN, we move it to 
- *	the dpm_off_irq list. If we get a different error, try and back out. 
+ *	the device to the dpm_off list. If it returns -EAGAIN, we move it to
+ *	the dpm_off_irq list. If we get a different error, try and back out.
  *
  *	If we hit a failure with any of the devices, call device_resume()
- *	above to bring the suspended devices back to life. 
+ *	above to bring the suspended devices back to life.
  *
  *	Note this function leaves dpm_sem held to
  *	a) block other devices from registering.
@@ -78,14 +78,14 @@ int device_suspend(u32 state)
 	while(!list_empty(&dpm_active)) {
 		struct list_head * entry = dpm_active.prev;
 		struct device * dev = to_device(entry);
-		error = suspend_device(dev,state);
+		error = suspend_device(dev, state);
 
 		if (!error) {
 			list_del(&dev->power.entry);
-			list_add(&dev->power.entry,&dpm_off);
+			list_add(&dev->power.entry, &dpm_off);
 		} else if (error == -EAGAIN) {
 			list_del(&dev->power.entry);
-			list_add(&dev->power.entry,&dpm_off_irq);
+			list_add(&dev->power.entry, &dpm_off_irq);
 		} else {
 			printk(KERN_ERR "Could not suspend device %s: "
 				"error %d\n", kobject_name(&dev->kobj), error);
@@ -108,8 +108,8 @@ EXPORT_SYMBOL(device_suspend);
  *	@state:		Power state to enter.
  *
  *	Walk the dpm_off_irq list, calling ->power_down() for each device that
- *	couldn't power down the device with interrupts enabled. When we're 
- *	done, power down system devices. 
+ *	couldn't power down the device with interrupts enabled. When we're
+ *	done, power down system devices.
  */
 
 int device_power_down(u32 state)
@@ -117,10 +117,10 @@ int device_power_down(u32 state)
 	int error = 0;
 	struct device * dev;
 
-	list_for_each_entry_reverse(dev,&dpm_off_irq,power.entry) {
-		if ((error = suspend_device(dev,state)))
+	list_for_each_entry_reverse(dev, &dpm_off_irq, power.entry) {
+		if ((error = suspend_device(dev, state)))
 			break;
-	} 
+	}
 	if (error)
 		goto Error;
 	if ((error = sysdev_suspend(state)))
diff --git a/drivers/base/power/sysfs.c b/drivers/base/power/sysfs.c
index 683dd59b0..6ac96349a 100644
--- a/drivers/base/power/sysfs.c
+++ b/drivers/base/power/sysfs.c
@@ -11,10 +11,10 @@
  *
  *	show() returns the current power state of the device. '0' indicates
  *	the device is on. Other values (1-3) indicate the device is in a low
- *	power state. 
+ *	power state.
  *
- *	store() sets the current power state, which is an integer value 
- *	between 0-3. If the device is on ('0'), and the value written is 
+ *	store() sets the current power state, which is an integer value
+ *	between 0-3. If the device is on ('0'), and the value written is
  *	greater than 0, then the device is placed directly into the low-power
  *	state (via its driver's ->suspend() method).
  *	If the device is currently in a low-power state, and the value is 0,
@@ -26,7 +26,7 @@
 
 static ssize_t state_show(struct device * dev, char * buf)
 {
-	return sprintf(buf,"%u\n",dev->power.power_state);
+	return sprintf(buf, "%u\n", dev->power.power_state);
 }
 
 static ssize_t state_store(struct device * dev, const char * buf, size_t n)
@@ -35,17 +35,17 @@ static ssize_t state_store(struct device * dev, const char * buf, size_t n)
 	char * rest;
 	int error = 0;
 
-	state = simple_strtoul(buf,&rest,10);
+	state = simple_strtoul(buf, &rest, 10);
 	if (*rest)
 		return -EINVAL;
 	if (state)
-		error = dpm_runtime_suspend(dev,state);
+		error = dpm_runtime_suspend(dev, state);
 	else
 		dpm_runtime_resume(dev);
 	return error ? error : n;
 }
 
-static DEVICE_ATTR(state,0644,state_show,state_store);
+static DEVICE_ATTR(state, 0644, state_show, state_store);
 
 
 static struct attribute * power_attrs[] = {
@@ -59,10 +59,10 @@ static struct attribute_group pm_attr_group = {
 
 int dpm_sysfs_add(struct device * dev)
 {
-	return sysfs_create_group(&dev->kobj,&pm_attr_group);
+	return sysfs_create_group(&dev->kobj, &pm_attr_group);
 }
 
 void dpm_sysfs_remove(struct device * dev)
 {
-	sysfs_remove_group(&dev->kobj,&pm_attr_group);
+	sysfs_remove_group(&dev->kobj, &pm_attr_group);
 }
diff --git a/drivers/base/sys.c b/drivers/base/sys.c
index b0d55a930..9d10500cd 100644
--- a/drivers/base/sys.c
+++ b/drivers/base/sys.c
@@ -5,8 +5,8 @@
  *               2002-3 Open Source Development Lab
  *
  * This file is released under the GPLv2
- * 
- * This exports a 'system' bus type. 
+ *
+ * This exports a 'system' bus type.
  * By default, a 'sys' bus gets added to the root of the system. There will
  * always be core system devices. Devices can use sysdev_register() to
  * add themselves as children of the system bus.
@@ -24,31 +24,31 @@
 
 extern struct subsystem devices_subsys;
 
-#define to_sysdev(k) container_of(k,struct sys_device,kobj)
-#define to_sysdev_attr(a) container_of(a,struct sysdev_attribute,attr)
+#define to_sysdev(k) container_of(k, struct sys_device, kobj)
+#define to_sysdev_attr(a) container_of(a, struct sysdev_attribute, attr)
 
 
-static ssize_t 
+static ssize_t
 sysdev_show(struct kobject * kobj, struct attribute * attr, char * buffer)
 {
 	struct sys_device * sysdev = to_sysdev(kobj);
 	struct sysdev_attribute * sysdev_attr = to_sysdev_attr(attr);
 
 	if (sysdev_attr->show)
-		return sysdev_attr->show(sysdev,buffer);
+		return sysdev_attr->show(sysdev, buffer);
 	return 0;
 }
 
 
 static ssize_t
-sysdev_store(struct kobject * kobj, struct attribute * attr, 
+sysdev_store(struct kobject * kobj, struct attribute * attr,
 	     const char * buffer, size_t count)
 {
 	struct sys_device * sysdev = to_sysdev(kobj);
 	struct sysdev_attribute * sysdev_attr = to_sysdev_attr(attr);
 
 	if (sysdev_attr->store)
-		return sysdev_attr->store(sysdev,buffer,count);
+		return sysdev_attr->store(sysdev, buffer, count);
 	return 0;
 }
 
@@ -64,22 +64,22 @@ static struct kobj_type ktype_sysdev = {
 
 int sysdev_create_file(struct sys_device * s, struct sysdev_attribute * a)
 {
-	return sysfs_create_file(&s->kobj,&a->attr);
+	return sysfs_create_file(&s->kobj, &a->attr);
 }
 
 
 void sysdev_remove_file(struct sys_device * s, struct sysdev_attribute * a)
 {
-	sysfs_remove_file(&s->kobj,&a->attr);
+	sysfs_remove_file(&s->kobj, &a->attr);
 }
 
 EXPORT_SYMBOL(sysdev_create_file);
 EXPORT_SYMBOL(sysdev_remove_file);
 
-/* 
- * declare system_subsys 
+/*
+ * declare system_subsys
  */
-decl_subsys(system,&ktype_sysdev,NULL);
+decl_subsys(system, &ktype_sysdev, NULL);
 
 int sysdev_class_register(struct sysdev_class * cls)
 {
@@ -87,7 +87,7 @@ int sysdev_class_register(struct sysdev_class * cls)
 		 kobject_name(&cls->kset.kobj));
 	INIT_LIST_HEAD(&cls->drivers);
 	cls->kset.subsys = &system_subsys;
-	kset_set_kset_s(cls,system_subsys);
+	kset_set_kset_s(cls, system_subsys);
 	return kset_register(&cls->kset);
 }
 
@@ -109,19 +109,19 @@ static LIST_HEAD(global_drivers);
  * 	@cls:	Device class driver belongs to.
  *	@drv:	Driver.
  *
- *	If @cls is valid, then @drv is inserted into @cls->drivers to be 
+ *	If @cls is valid, then @drv is inserted into @cls->drivers to be
  *	called on each operation on devices of that class. The refcount
- *	of @cls is incremented. 
- *	Otherwise, @drv is inserted into global_drivers, and called for 
+ *	of @cls is incremented.
+ *	Otherwise, @drv is inserted into global_drivers, and called for
  *	each device.
  */
 
-int sysdev_driver_register(struct sysdev_class * cls, 
+int sysdev_driver_register(struct sysdev_class * cls,
 			   struct sysdev_driver * drv)
 {
 	down_write(&system_subsys.rwsem);
 	if (cls && kset_get(&cls->kset)) {
-		list_add_tail(&drv->entry,&cls->drivers);
+		list_add_tail(&drv->entry, &cls->drivers);
 
 		/* If devices of this class already exist, tell the driver */
 		if (drv->add) {
@@ -130,7 +130,7 @@ int sysdev_driver_register(struct sysdev_class * cls,
 				drv->add(dev);
 		}
 	} else
-		list_add_tail(&drv->entry,&global_drivers);
+		list_add_tail(&drv->entry, &global_drivers);
 	up_write(&system_subsys.rwsem);
 	return 0;
 }
@@ -180,12 +180,12 @@ int sysdev_register(struct sys_device * sysdev)
 
 	/* But make sure we point to the right type for sysfs translation */
 	sysdev->kobj.ktype = &ktype_sysdev;
-	error = kobject_set_name(&sysdev->kobj,"%s%d",
-			 kobject_name(&cls->kset.kobj),sysdev->id);
+	error = kobject_set_name(&sysdev->kobj, "%s%d",
+			 kobject_name(&cls->kset.kobj), sysdev->id);
 	if (error)
 		return error;
 
-	pr_debug("Registering sys device '%s'\n",kobject_name(&sysdev->kobj));
+	pr_debug("Registering sys device '%s'\n", kobject_name(&sysdev->kobj));
 
 	/* Register the object */
 	error = kobject_register(&sysdev->kobj);
@@ -194,18 +194,18 @@ int sysdev_register(struct sys_device * sysdev)
 		struct sysdev_driver * drv;
 
 		down_write(&system_subsys.rwsem);
-		/* Generic notification is implicit, because it's that 
-		 * code that should have called us. 
+		/* Generic notification is implicit, because it's that
+		 * code that should have called us.
 		 */
 
 		/* Notify global drivers */
-		list_for_each_entry(drv,&global_drivers,entry) {
+		list_for_each_entry(drv, &global_drivers, entry) {
 			if (drv->add)
 				drv->add(sysdev);
 		}
 
 		/* Notify class auxillary drivers */
-		list_for_each_entry(drv,&cls->drivers,entry) {
+		list_for_each_entry(drv, &cls->drivers, entry) {
 			if (drv->add)
 				drv->add(sysdev);
 		}
@@ -219,12 +219,12 @@ void sysdev_unregister(struct sys_device * sysdev)
 	struct sysdev_driver * drv;
 
 	down_write(&system_subsys.rwsem);
-	list_for_each_entry(drv,&global_drivers,entry) {
+	list_for_each_entry(drv, &global_drivers, entry) {
 		if (drv->remove)
 			drv->remove(sysdev);
 	}
 
-	list_for_each_entry(drv,&sysdev->cls->drivers,entry) {
+	list_for_each_entry(drv, &sysdev->cls->drivers, entry) {
 		if (drv->remove)
 			drv->remove(sysdev);
 	}
@@ -241,12 +241,12 @@ void sysdev_unregister(struct sys_device * sysdev)
  *	Loop over each class of system devices, and the devices in each
  *	of those classes. For each device, we call the shutdown method for
  *	each driver registered for the device - the globals, the auxillaries,
- *	and the class driver. 
+ *	and the class driver.
  *
  *	Note: The list is iterated in reverse order, so that we shut down
  *	child devices before we shut down thier parents. The list ordering
  *	is guaranteed by virtue of the fact that child devices are registered
- *	after their parents. 
+ *	after their parents.
  */
 
 void sysdev_shutdown(void)
@@ -256,25 +256,25 @@ void sysdev_shutdown(void)
 	pr_debug("Shutting Down System Devices\n");
 
 	down_write(&system_subsys.rwsem);
-	list_for_each_entry_reverse(cls,&system_subsys.kset.list,
+	list_for_each_entry_reverse(cls, &system_subsys.kset.list,
 				    kset.kobj.entry) {
 		struct sys_device * sysdev;
 
 		pr_debug("Shutting down type '%s':\n",
 			 kobject_name(&cls->kset.kobj));
 
-		list_for_each_entry(sysdev,&cls->kset.list,kobj.entry) {
+		list_for_each_entry(sysdev, &cls->kset.list, kobj.entry) {
 			struct sysdev_driver * drv;
-			pr_debug(" %s\n",kobject_name(&sysdev->kobj));
+			pr_debug(" %s\n", kobject_name(&sysdev->kobj));
 
 			/* Call global drivers first. */
-			list_for_each_entry(drv,&global_drivers,entry) {
+			list_for_each_entry(drv, &global_drivers, entry) {
 				if (drv->shutdown)
 					drv->shutdown(sysdev);
 			}
 
 			/* Call auxillary drivers next. */
-			list_for_each_entry(drv,&cls->drivers,entry) {
+			list_for_each_entry(drv, &cls->drivers, entry) {
 				if (drv->shutdown)
 					drv->shutdown(sysdev);
 			}
@@ -295,7 +295,7 @@ void sysdev_shutdown(void)
  *	We perform an almost identical operation as sys_device_shutdown()
  *	above, though calling ->suspend() instead. Interrupts are disabled
  *	when this called. Devices are responsible for both saving state and
- *	quiescing or powering down the device. 
+ *	quiescing or powering down the device.
  *
  *	This is only called by the device PM core, so we let them handle
  *	all synchronization.
@@ -307,32 +307,32 @@ int sysdev_suspend(u32 state)
 
 	pr_debug("Suspending System Devices\n");
 
-	list_for_each_entry_reverse(cls,&system_subsys.kset.list,
+	list_for_each_entry_reverse(cls, &system_subsys.kset.list,
 				    kset.kobj.entry) {
 		struct sys_device * sysdev;
 
 		pr_debug("Suspending type '%s':\n",
 			 kobject_name(&cls->kset.kobj));
 
-		list_for_each_entry(sysdev,&cls->kset.list,kobj.entry) {
+		list_for_each_entry(sysdev, &cls->kset.list, kobj.entry) {
 			struct sysdev_driver * drv;
-			pr_debug(" %s\n",kobject_name(&sysdev->kobj));
+			pr_debug(" %s\n", kobject_name(&sysdev->kobj));
 
 			/* Call global drivers first. */
-			list_for_each_entry(drv,&global_drivers,entry) {
+			list_for_each_entry(drv, &global_drivers, entry) {
 				if (drv->suspend)
-					drv->suspend(sysdev,state);
+					drv->suspend(sysdev, state);
 			}
 
 			/* Call auxillary drivers next. */
-			list_for_each_entry(drv,&cls->drivers,entry) {
+			list_for_each_entry(drv, &cls->drivers, entry) {
 				if (drv->suspend)
-					drv->suspend(sysdev,state);
+					drv->suspend(sysdev, state);
 			}
 
 			/* Now call the generic one */
 			if (cls->suspend)
-				cls->suspend(sysdev,state);
+				cls->suspend(sysdev, state);
 		}
 	}
 	return 0;
@@ -345,7 +345,7 @@ int sysdev_suspend(u32 state)
  *	Similar to sys_device_suspend(), but we iterate the list forwards
  *	to guarantee that parent devices are resumed before their children.
  *
- *	Note: Interrupts are disabled when called. 
+ *	Note: Interrupts are disabled when called.
  */
 
 int sysdev_resume(void)
@@ -354,28 +354,28 @@ int sysdev_resume(void)
 
 	pr_debug("Resuming System Devices\n");
 
-	list_for_each_entry(cls,&system_subsys.kset.list,kset.kobj.entry) {
+	list_for_each_entry(cls, &system_subsys.kset.list, kset.kobj.entry) {
 		struct sys_device * sysdev;
 
 		pr_debug("Resuming type '%s':\n",
 			 kobject_name(&cls->kset.kobj));
 
-		list_for_each_entry(sysdev,&cls->kset.list,kobj.entry) {
+		list_for_each_entry(sysdev, &cls->kset.list, kobj.entry) {
 			struct sysdev_driver * drv;
-			pr_debug(" %s\n",kobject_name(&sysdev->kobj));
+			pr_debug(" %s\n", kobject_name(&sysdev->kobj));
 
 			/* First, call the class-specific one */
 			if (cls->resume)
 				cls->resume(sysdev);
 
 			/* Call auxillary drivers next. */
-			list_for_each_entry(drv,&cls->drivers,entry) {
+			list_for_each_entry(drv, &cls->drivers, entry) {
 				if (drv->resume)
 					drv->resume(sysdev);
 			}
 
 			/* Call global drivers. */
-			list_for_each_entry(drv,&global_drivers,entry) {
+			list_for_each_entry(drv, &global_drivers, entry) {
 				if (drv->resume)
 					drv->resume(sysdev);
 			}
diff --git a/drivers/block/Kconfig b/drivers/block/Kconfig
index ecbc4e489..c44f27f24 100644
--- a/drivers/block/Kconfig
+++ b/drivers/block/Kconfig
@@ -6,7 +6,7 @@ menu "Block devices"
 
 config BLK_DEV_FD
 	tristate "Normal floppy disk support"
-	depends on (!X86_PC9800 && !ARCH_S390 && !M68K && !IA64) || Q40 || (SUN3X && BROKEN)
+	depends on (!ARCH_S390 && !M68K && !IA64) || Q40 || (SUN3X && BROKEN)
 	---help---
 	  If you want to use the floppy disk drive(s) of your PC under Linux,
 	  say Y. Information about this driver, especially important for IBM
@@ -26,13 +26,6 @@ config ATARI_FLOPPY
 	tristate "Atari floppy support"
 	depends on ATARI
 
-config BLK_DEV_FD98
-	tristate "NEC PC-9800 floppy disk support"
-	depends on X86_PC9800
-	---help---
-	  If you want to use the floppy disk drive(s) of NEC PC-9801/PC-9821,
-	  say Y.
-
 config BLK_DEV_SWIM_IOP
 	bool "Macintosh IIfx/Quadra 900/Quadra 950 floppy support (EXPERIMENTAL)"
 	depends on MAC && EXPERIMENTAL && BROKEN
@@ -40,6 +33,13 @@ config BLK_DEV_SWIM_IOP
 	  Say Y here to support the SWIM (Super Woz Integrated Machine) IOP
 	  floppy controller on the Macintosh IIfx and Quadra 900/950.
 
+config MAC_FLOPPY
+	tristate "Support for PowerMac floppy"
+	depends on PPC_PMAC && !PPC_PMAC64
+	help
+	  If you have a SWIM-3 (Super Woz Integrated Machine 3; from Apple)
+	  floppy controller, say Y here. Most commonly found in PowerMacs.
+
 config BLK_DEV_PS2
 	tristate "PS/2 ESDI hard disk support"
 	depends on MCA && MCA_LEGACY
@@ -292,14 +292,14 @@ config BLK_DEV_NBD
 
 	  If unsure, say N.
 
-config BLK_DEV_CARMEL
-	tristate "Promise SATA SX8 (carmel) support"
+config BLK_DEV_SX8
+	tristate "Promise SATA SX8 support"
 	depends on PCI
 	---help---
 	  Saying Y or M here will enable support for the 
-	  Promise SATA SX8 ("carmel") controllers.
+	  Promise SATA SX8 controllers.
 
-	  Use devices /dev/carmel/$N and /dev/carmel/$Np$M.
+	  Use devices /dev/sx8/$N and /dev/sx8/$Np$M.
 
 config BLK_DEV_RAM
 	tristate "RAM disk support"
diff --git a/drivers/block/Makefile b/drivers/block/Makefile
index 33b14e84c..2654b5b76 100644
--- a/drivers/block/Makefile
+++ b/drivers/block/Makefile
@@ -41,5 +41,5 @@ obj-$(CONFIG_BLK_DEV_NBD)	+= nbd.o
 obj-$(CONFIG_BLK_DEV_CRYPTOLOOP) += cryptoloop.o
 
 obj-$(CONFIG_VIODASD)		+= viodasd.o
-obj-$(CONFIG_BLK_DEV_CARMEL)	+= carmel.o
+obj-$(CONFIG_BLK_DEV_SX8)	+= sx8.o
 
diff --git a/drivers/block/ataflop.c b/drivers/block/ataflop.c
index b98fa53f3..c5385258d 100644
--- a/drivers/block/ataflop.c
+++ b/drivers/block/ataflop.c
@@ -342,8 +342,6 @@ static void fd_select_drive( int drive );
 static void fd_deselect( void );
 static void fd_motor_off_timer( unsigned long dummy );
 static void check_change( unsigned long dummy );
-static __inline__ void set_head_settle_flag( void );
-static __inline__ int get_head_settle_flag( void );
 static irqreturn_t floppy_irq (int irq, void *dummy, struct pt_regs *fp);
 static void fd_error( void );
 static int do_format(int drive, int type, struct atari_format_descr *desc);
@@ -361,7 +359,6 @@ static void fd_writetrack_done( int status );
 static void fd_times_out( unsigned long dummy );
 static void finish_fdc( void );
 static void finish_fdc_done( int dummy );
-static __inline__ void copy_buffer( void *from, void *to);
 static void setup_req_params( int drive );
 static void redo_fd_request( void);
 static int fd_ioctl( struct inode *inode, struct file *filp, unsigned int
@@ -385,27 +382,23 @@ static struct timer_list timeout_timer =
 static struct timer_list fd_timer =
 	TIMER_INITIALIZER(check_change, 0, 0);
 	
-static inline void
-start_motor_off_timer(void)
+static inline void start_motor_off_timer(void)
 {
 	mod_timer(&motor_off_timer, jiffies + FD_MOTOR_OFF_DELAY);
 	MotorOffTrys = 0;
 }
 
-static inline void
-start_check_change_timer( void )
+static inline void start_check_change_timer( void )
 {
 	mod_timer(&fd_timer, jiffies + CHECK_CHANGE_DELAY);
 }
 
-static inline void
-start_timeout(void)
+static inline void start_timeout(void)
 {
 	mod_timer(&timeout_timer, jiffies + FLOPPY_TIMEOUT);
 }
 
-static inline void
-stop_timeout(void)
+static inline void stop_timeout(void)
 {
 	del_timer(&timeout_timer);
 }
@@ -558,18 +551,27 @@ static void check_change( unsigned long dummy )
  * seek operation, because we don't use seeks with verify.
  */
 
-static __inline__ void set_head_settle_flag( void )
+static inline void set_head_settle_flag(void)
 {
 	HeadSettleFlag = FDCCMDADD_E;
 }
 
-static __inline__ int get_head_settle_flag( void )
+static inline int get_head_settle_flag(void)
 {
 	int	tmp = HeadSettleFlag;
 	HeadSettleFlag = 0;
 	return( tmp );
 }
 
+static inline void copy_buffer(void *from, void *to)
+{
+	ulong *p1 = (ulong *)from, *p2 = (ulong *)to;
+	int cnt;
+
+	for (cnt = 512/4; cnt; cnt--)
+		*p2++ = *p1++;
+}
+
   
   
 
@@ -1372,15 +1374,6 @@ static int floppy_revalidate(struct gendisk *disk)
 	return 0;
 }
 
-static __inline__ void copy_buffer(void *from, void *to)
-{
-	ulong	*p1 = (ulong *)from, *p2 = (ulong *)to;
-	int		cnt;
-
-	for( cnt = 512/4; cnt; cnt-- )
-		*p2++ = *p1++;
-}
-
 
 /* This sets up the global variables describing the current request. */
 
diff --git a/drivers/block/cciss.c b/drivers/block/cciss.c
index 0d45b81e1..5509e5620 100644
--- a/drivers/block/cciss.c
+++ b/drivers/block/cciss.c
@@ -37,6 +37,7 @@
 #include <linux/init.h> 
 #include <linux/hdreg.h>
 #include <linux/spinlock.h>
+#include <linux/compat.h>
 #include <asm/uaccess.h>
 #include <asm/io.h>
 
@@ -479,6 +480,145 @@ static int cciss_release(struct inode *inode, struct file *filep)
 	return 0;
 }
 
+#ifdef CONFIG_COMPAT
+/* for AMD 64 bit kernel compatibility with 32-bit userland ioctls */
+extern long sys_ioctl(unsigned int fd, unsigned int cmd, unsigned long arg);
+extern int
+register_ioctl32_conversion(unsigned int cmd, int (*handler)(unsigned int,
+      unsigned int, unsigned long, struct file *));
+extern int unregister_ioctl32_conversion(unsigned int cmd);
+
+static int cciss_ioctl32_passthru(unsigned int fd, unsigned cmd, unsigned long arg, struct file *file);
+static int cciss_ioctl32_big_passthru(unsigned int fd, unsigned cmd, unsigned long arg,
+	struct file *file);
+
+typedef int (*handler_type) (unsigned int, unsigned int, unsigned long, struct file *);
+
+static struct ioctl32_map {
+	unsigned int cmd;
+	handler_type handler;
+	int registered;
+} cciss_ioctl32_map[] = {
+	{ CCISS_GETPCIINFO,	(handler_type) sys_ioctl, 0 },
+	{ CCISS_GETINTINFO,	(handler_type) sys_ioctl, 0 },
+	{ CCISS_SETINTINFO,	(handler_type) sys_ioctl, 0 },
+	{ CCISS_GETNODENAME,	(handler_type) sys_ioctl, 0 },
+	{ CCISS_SETNODENAME,	(handler_type) sys_ioctl, 0 },
+	{ CCISS_GETHEARTBEAT,	(handler_type) sys_ioctl, 0 },
+	{ CCISS_GETBUSTYPES,	(handler_type) sys_ioctl, 0 },
+	{ CCISS_GETFIRMVER,	(handler_type) sys_ioctl, 0 },
+	{ CCISS_GETDRIVVER,	(handler_type) sys_ioctl, 0 },
+	{ CCISS_REVALIDVOLS,	(handler_type) sys_ioctl, 0 },
+	{ CCISS_PASSTHRU32,	cciss_ioctl32_passthru, 0 },
+	{ CCISS_DEREGDISK,	(handler_type) sys_ioctl, 0 },
+	{ CCISS_REGNEWDISK,	(handler_type) sys_ioctl, 0 },
+	{ CCISS_REGNEWD,	(handler_type) sys_ioctl, 0 },
+	{ CCISS_RESCANDISK,	(handler_type) sys_ioctl, 0 },
+	{ CCISS_GETLUNINFO,	(handler_type) sys_ioctl, 0 },
+	{ CCISS_BIG_PASSTHRU32,	cciss_ioctl32_big_passthru, 0 },
+};
+#define NCCISS_IOCTL32_ENTRIES (sizeof(cciss_ioctl32_map) / sizeof(cciss_ioctl32_map[0]))
+static void register_cciss_ioctl32(void)
+{
+	int i, rc;
+
+	for (i=0; i < NCCISS_IOCTL32_ENTRIES; i++) {
+		rc = register_ioctl32_conversion(
+			cciss_ioctl32_map[i].cmd,
+			cciss_ioctl32_map[i].handler);
+		if (rc != 0) {
+			printk(KERN_WARNING "cciss: failed to register "
+				"32 bit compatible ioctl 0x%08x\n",
+				cciss_ioctl32_map[i].cmd);
+			cciss_ioctl32_map[i].registered = 0;
+		} else
+			cciss_ioctl32_map[i].registered = 1;
+	}
+}
+static void unregister_cciss_ioctl32(void)
+{
+	int i, rc;
+
+	for (i=0; i < NCCISS_IOCTL32_ENTRIES; i++) {
+		if (!cciss_ioctl32_map[i].registered)
+			continue;
+		rc = unregister_ioctl32_conversion(
+			cciss_ioctl32_map[i].cmd);
+		if (rc == 0) {
+			cciss_ioctl32_map[i].registered = 0;
+			continue;
+		}
+		printk(KERN_WARNING "cciss: failed to unregister "
+			"32 bit compatible ioctl 0x%08x\n",
+			cciss_ioctl32_map[i].cmd);
+	}
+}
+int cciss_ioctl32_passthru(unsigned int fd, unsigned cmd, unsigned long arg,
+	struct file *file)
+{
+	IOCTL32_Command_struct __user *arg32 =
+		(IOCTL32_Command_struct __user *) arg;
+	IOCTL_Command_struct arg64;
+	IOCTL_Command_struct __user *p = compat_alloc_user_space(sizeof(arg64));
+	int err;
+	u32 cp;
+
+	err = 0;
+	err |= copy_from_user(&arg64.LUN_info, &arg32->LUN_info, sizeof(arg64.LUN_info));
+	err |= copy_from_user(&arg64.Request, &arg32->Request, sizeof(arg64.Request));
+	err |= copy_from_user(&arg64.error_info, &arg32->error_info, sizeof(arg64.error_info));
+	err |= get_user(arg64.buf_size, &arg32->buf_size);
+	err |= get_user(cp, &arg32->buf);
+	arg64.buf = compat_ptr(cp);
+	err |= copy_to_user(p, &arg64, sizeof(arg64));
+
+	if (err)
+		return -EFAULT;
+
+	err = sys_ioctl(fd, CCISS_PASSTHRU, (unsigned long) p);
+	if (err)
+		return err;
+	err |= copy_in_user(&arg32->error_info, &p->error_info, sizeof(&arg32->error_info));
+	if (err)
+		return -EFAULT;
+	return err;
+}
+
+int cciss_ioctl32_big_passthru(unsigned int fd, unsigned cmd, unsigned long arg,
+	struct file *file)
+{
+	BIG_IOCTL32_Command_struct __user *arg32 =
+		(BIG_IOCTL32_Command_struct __user *) arg;
+	BIG_IOCTL_Command_struct arg64;
+	BIG_IOCTL_Command_struct __user *p = compat_alloc_user_space(sizeof(arg64));
+	int err;
+	u32 cp;
+
+	err = 0;
+	err |= copy_from_user(&arg64.LUN_info, &arg32->LUN_info, sizeof(arg64.LUN_info));
+	err |= copy_from_user(&arg64.Request, &arg32->Request, sizeof(arg64.Request));
+	err |= copy_from_user(&arg64.error_info, &arg32->error_info, sizeof(arg64.error_info));
+	err |= get_user(arg64.buf_size, &arg32->buf_size);
+	err |= get_user(arg64.malloc_size, &arg32->malloc_size);
+	err |= get_user(cp, &arg32->buf);
+	arg64.buf = compat_ptr(cp);
+	err |= copy_to_user(p, &arg64, sizeof(arg64));
+
+	if (err)
+		 return -EFAULT;
+
+	err = sys_ioctl(fd, CCISS_BIG_PASSTHRU, (unsigned long) p);
+	if (err)
+		return err;
+	err |= copy_in_user(&arg32->error_info, &p->error_info, sizeof(&arg32->error_info));
+	if (err)
+		return -EFAULT;
+	return err;
+}
+#else
+static inline void register_cciss_ioctl32(void) {}
+static inline void unregister_cciss_ioctl32(void) {}
+#endif
 /*
  * ioctl 
  */
@@ -2728,6 +2868,7 @@ int __init cciss_init(void)
 
 static int __init init_cciss_module(void)
 {
+	register_cciss_ioctl32();
 	return ( cciss_init());
 }
 
@@ -2735,6 +2876,7 @@ static void __exit cleanup_cciss_module(void)
 {
 	int i;
 
+	unregister_cciss_ioctl32();
 	pci_unregister_driver(&cciss_pci_driver);
 	/* double check that all controller entrys have been removed */
 	for (i=0; i< MAX_CTLR; i++) 
diff --git a/drivers/block/cciss_scsi.c b/drivers/block/cciss_scsi.c
index 9636ac51e..9df82b8e9 100644
--- a/drivers/block/cciss_scsi.c
+++ b/drivers/block/cciss_scsi.c
@@ -29,7 +29,7 @@
    physical nor logical disks are presented through the scsi layer. */
 
 #include "../scsi/scsi.h" 
-#include "../scsi/hosts.h" 
+#include <scsi/scsi_host.h> 
 #include <asm/atomic.h>
 #include <linux/timer.h>
 #include <linux/completion.h>
diff --git a/drivers/block/cfq-iosched.c b/drivers/block/cfq-iosched.c
index 977d32ddd..068f4eae0 100644
--- a/drivers/block/cfq-iosched.c
+++ b/drivers/block/cfq-iosched.c
@@ -59,6 +59,14 @@ struct cfq_data {
 	unsigned int max_queued;
 
 	mempool_t *crq_pool;
+
+	request_queue_t *queue;
+
+	/*
+	 * tunables
+	 */
+	unsigned int cfq_quantum;
+	unsigned int cfq_queued;
 };
 
 struct cfq_queue {
@@ -89,7 +97,8 @@ struct cfq_rq {
 
 static void cfq_put_queue(struct cfq_data *cfqd, struct cfq_queue *cfqq);
 static struct cfq_queue *cfq_find_cfq_hash(struct cfq_data *cfqd, int pid);
-static void cfq_dispatch_sort(struct list_head *head, struct cfq_rq *crq);
+static void cfq_dispatch_sort(struct cfq_data *cfqd, struct cfq_queue *cfqq,
+			      struct cfq_rq *crq);
 
 /*
  * lots of deadline iosched dupes, can be abstracted later...
@@ -187,7 +196,7 @@ __cfq_add_crq_rb(struct cfq_queue *cfqq, struct cfq_rq *crq)
 	}
 
 	rb_link_node(&crq->rb_node, parent, p);
-	return 0;
+	return NULL;
 }
 
 static void
@@ -206,8 +215,7 @@ retry:
 		return;
 	}
 
-	cfq_del_crq_rb(cfqq, __alias);
-	cfq_dispatch_sort(cfqd->dispatch, __alias);
+	cfq_dispatch_sort(cfqd, cfqq, __alias);
 	goto retry;
 }
 
@@ -321,11 +329,16 @@ cfq_merged_requests(request_queue_t *q, struct request *req,
 	cfq_remove_request(q, next);
 }
 
-static void cfq_dispatch_sort(struct list_head *head, struct cfq_rq *crq)
+static void
+cfq_dispatch_sort(struct cfq_data *cfqd, struct cfq_queue *cfqq,
+		  struct cfq_rq *crq)
 {
-	struct list_head *entry = head;
+	struct list_head *head = cfqd->dispatch, *entry = head;
 	struct request *__rq;
 
+	cfq_del_crq_rb(cfqq, crq);
+	cfq_remove_merge_hints(cfqd->queue, crq);
+
 	if (!list_empty(head)) {
 		__rq = list_entry_rq(head->next);
 
@@ -352,9 +365,7 @@ __cfq_dispatch_requests(request_queue_t *q, struct cfq_data *cfqd,
 {
 	struct cfq_rq *crq = rb_entry_crq(rb_first(&cfqq->sort_list));
 
-	cfq_del_crq_rb(cfqq, crq);
-	cfq_remove_merge_hints(q, crq);
-	cfq_dispatch_sort(cfqd->dispatch, crq);
+	cfq_dispatch_sort(cfqd, cfqq, crq);
 }
 
 static int cfq_dispatch_requests(request_queue_t *q, struct cfq_data *cfqd)
@@ -385,7 +396,7 @@ restart:
 		ret = 1;
 	}
 
-	if ((queued < cfq_quantum) && good_queues)
+	if ((queued < cfqd->cfq_quantum) && good_queues)
 		goto restart;
 
 	return ret;
@@ -445,13 +456,27 @@ static void cfq_put_queue(struct cfq_data *cfqd, struct cfq_queue *cfqq)
 	mempool_free(cfqq, cfq_mpool);
 }
 
-static struct cfq_queue *cfq_get_queue(struct cfq_data *cfqd, int pid)
+static struct cfq_queue *__cfq_get_queue(struct cfq_data *cfqd, int pid,
+					 int gfp_mask)
 {
 	const int hashval = hash_long(current->tgid, CFQ_QHASH_SHIFT);
-	struct cfq_queue *cfqq = __cfq_find_cfq_hash(cfqd, pid, hashval);
+	struct cfq_queue *cfqq, *new_cfqq = NULL;
+	request_queue_t *q = cfqd->queue;
+
+retry:
+	cfqq = __cfq_find_cfq_hash(cfqd, pid, hashval);
 
 	if (!cfqq) {
-		cfqq = mempool_alloc(cfq_mpool, GFP_NOIO);
+		if (new_cfqq) {
+			cfqq = new_cfqq;
+			new_cfqq = NULL;
+		} else if (gfp_mask & __GFP_WAIT) {
+			spin_unlock_irq(q->queue_lock);
+			new_cfqq = mempool_alloc(cfq_mpool, gfp_mask);
+			spin_lock_irq(q->queue_lock);
+			goto retry;
+		} else
+			return NULL;
 
 		INIT_LIST_HEAD(&cfqq->cfq_hash);
 		INIT_LIST_HEAD(&cfqq->cfq_list);
@@ -462,20 +487,44 @@ static struct cfq_queue *cfq_get_queue(struct cfq_data *cfqd, int pid)
 		list_add(&cfqq->cfq_hash, &cfqd->cfq_hash[hashval]);
 	}
 
+	if (new_cfqq)
+		mempool_free(new_cfqq, cfq_mpool);
+
 	return cfqq;
 }
 
-static void cfq_enqueue(struct cfq_data *cfqd, struct cfq_rq *crq)
+static struct cfq_queue *cfq_get_queue(struct cfq_data *cfqd, int pid,
+				       int gfp_mask)
 {
+	request_queue_t *q = cfqd->queue;
 	struct cfq_queue *cfqq;
 
-	cfqq = cfq_get_queue(cfqd, current->tgid);
+	spin_lock_irq(q->queue_lock);
+	cfqq = __cfq_get_queue(cfqd, pid, gfp_mask);
+	spin_unlock_irq(q->queue_lock);
+
+	return cfqq;
+}
+
+static void cfq_enqueue(struct cfq_data *cfqd, struct cfq_rq *crq)
+{
+	struct cfq_queue *cfqq;
 
-	cfq_add_crq_rb(cfqd, cfqq, crq);
+	cfqq = __cfq_get_queue(cfqd, current->tgid, GFP_ATOMIC);
+	if (cfqq) {
+		cfq_add_crq_rb(cfqd, cfqq, crq);
 
-	if (list_empty(&cfqq->cfq_list)) {
-		list_add(&cfqq->cfq_list, &cfqd->rr_list);
-		cfqd->busy_queues++;
+		if (list_empty(&cfqq->cfq_list)) {
+			list_add(&cfqq->cfq_list, &cfqd->rr_list);
+			cfqd->busy_queues++;
+		}
+	} else {
+		/*
+		 * should can only happen if the request wasn't allocated
+		 * through blk_alloc_request(), eg stack requests from ide-cd
+		 * (those should be removed) _and_ we are in OOM.
+		 */
+		list_add_tail(&crq->request->queuelist, cfqd->dispatch);
 	}
 }
 
@@ -556,7 +605,7 @@ static int cfq_may_queue(request_queue_t *q, int rw)
 
 	cfqq = cfq_find_cfq_hash(cfqd, current->tgid);
 	if (cfqq) {
-		int limit = (q->nr_requests - cfq_queued) / cfqd->busy_queues;
+		int limit = (q->nr_requests - cfqd->cfq_queued) / cfqd->busy_queues;
 
 		if (limit < 3)
 			limit = 3;
@@ -574,6 +623,8 @@ static void cfq_put_request(request_queue_t *q, struct request *rq)
 {
 	struct cfq_data *cfqd = q->elevator.elevator_data;
 	struct cfq_rq *crq = RQ_DATA(rq);
+	struct request_list *rl;
+	int other_rw;
 
 	if (crq) {
 		BUG_ON(q->last_merge == rq);
@@ -582,14 +633,41 @@ static void cfq_put_request(request_queue_t *q, struct request *rq)
 		mempool_free(crq, cfqd->crq_pool);
 		rq->elevator_private = NULL;
 	}
+
+	/*
+	 * work-around for may_queue "bug": if a read gets issued and refused
+	 * to queue because writes ate all the allowed slots and no other
+	 * reads are pending for this queue, it could get stuck infinitely
+	 * since freed_request() only checks the waitqueue for writes when
+	 * freeing them. or vice versa for a single write vs many reads.
+	 * so check here whether "the other" data direction might be able
+	 * to queue and wake them
+	 */
+	rl = &q->rq;
+	other_rw = rq_data_dir(rq) ^ 1;
+	if (rl->count[other_rw] <= q->nr_requests) {
+		smp_mb();
+		if (waitqueue_active(&rl->wait[other_rw]))
+			wake_up(&rl->wait[other_rw]);
+	}
 }
 
 static int cfq_set_request(request_queue_t *q, struct request *rq, int gfp_mask)
 {
 	struct cfq_data *cfqd = q->elevator.elevator_data;
-	struct cfq_rq *crq = mempool_alloc(cfqd->crq_pool, gfp_mask);
+	struct cfq_queue *cfqq;
+	struct cfq_rq *crq;
 
+	/*
+	 * prepare a queue up front, so cfq_enqueue() doesn't have to
+	 */
+	cfqq = cfq_get_queue(cfqd, current->tgid, gfp_mask);
+	if (!cfqq)
+		return 1;
+
+	crq = mempool_alloc(cfqd->crq_pool, gfp_mask);
 	if (crq) {
+		memset(crq, 0, sizeof(*crq));
 		RB_CLEAR(&crq->rb_node);
 		crq->request = rq;
 		crq->cfq_queue = NULL;
@@ -643,6 +721,7 @@ static int cfq_init(request_queue_t *q, elevator_t *e)
 
 	cfqd->dispatch = &q->queue_head;
 	e->elevator_data = cfqd;
+	cfqd->queue = q;
 
 	/*
 	 * just set it to some high value, we want anyone to be able to queue
@@ -651,6 +730,9 @@ static int cfq_init(request_queue_t *q, elevator_t *e)
 	cfqd->max_queued = q->nr_requests;
 	q->nr_requests = 8192;
 
+	cfqd->cfq_queued = cfq_queued;
+	cfqd->cfq_quantum = cfq_quantum;
+
 	return 0;
 out_crqpool:
 	kfree(cfqd->cfq_hash);
@@ -685,8 +767,110 @@ static int __init cfq_slab_setup(void)
 
 subsys_initcall(cfq_slab_setup);
 
+/*
+ * sysfs parts below -->
+ */
+struct cfq_fs_entry {
+	struct attribute attr;
+	ssize_t (*show)(struct cfq_data *, char *);
+	ssize_t (*store)(struct cfq_data *, const char *, size_t);
+};
+
+static ssize_t
+cfq_var_show(unsigned int var, char *page)
+{
+	return sprintf(page, "%d\n", var);
+}
+
+static ssize_t
+cfq_var_store(unsigned int *var, const char *page, size_t count)
+{
+	char *p = (char *) page;
+
+	*var = simple_strtoul(p, &p, 10);
+	return count;
+}
+
+#define SHOW_FUNCTION(__FUNC, __VAR)					\
+static ssize_t __FUNC(struct cfq_data *cfqd, char *page)		\
+{									\
+	return cfq_var_show(__VAR, (page));				\
+}
+SHOW_FUNCTION(cfq_quantum_show, cfqd->cfq_quantum);
+SHOW_FUNCTION(cfq_queued_show, cfqd->cfq_queued);
+#undef SHOW_FUNCTION
+
+#define STORE_FUNCTION(__FUNC, __PTR, MIN, MAX)				\
+static ssize_t __FUNC(struct cfq_data *cfqd, const char *page, size_t count)	\
+{									\
+	int ret = cfq_var_store(__PTR, (page), count);			\
+	if (*(__PTR) < (MIN))						\
+		*(__PTR) = (MIN);					\
+	else if (*(__PTR) > (MAX))					\
+		*(__PTR) = (MAX);					\
+	return ret;							\
+}
+STORE_FUNCTION(cfq_quantum_store, &cfqd->cfq_quantum, 1, INT_MAX);
+STORE_FUNCTION(cfq_queued_store, &cfqd->cfq_queued, 1, INT_MAX);
+#undef STORE_FUNCTION
+
+static struct cfq_fs_entry cfq_quantum_entry = {
+	.attr = {.name = "quantum", .mode = S_IRUGO | S_IWUSR },
+	.show = cfq_quantum_show,
+	.store = cfq_quantum_store,
+};
+static struct cfq_fs_entry cfq_queued_entry = {
+	.attr = {.name = "queued", .mode = S_IRUGO | S_IWUSR },
+	.show = cfq_queued_show,
+	.store = cfq_queued_store,
+};
+
+static struct attribute *default_attrs[] = {
+	&cfq_quantum_entry.attr,
+	&cfq_queued_entry.attr,
+	NULL,
+};
+
+#define to_cfq(atr) container_of((atr), struct cfq_fs_entry, attr)
+
+static ssize_t
+cfq_attr_show(struct kobject *kobj, struct attribute *attr, char *page)
+{
+	elevator_t *e = container_of(kobj, elevator_t, kobj);
+	struct cfq_fs_entry *entry = to_cfq(attr);
+
+	if (!entry->show)
+		return 0;
+
+	return entry->show(e->elevator_data, page);
+}
+
+static ssize_t
+cfq_attr_store(struct kobject *kobj, struct attribute *attr,
+	       const char *page, size_t length)
+{
+	elevator_t *e = container_of(kobj, elevator_t, kobj);
+	struct cfq_fs_entry *entry = to_cfq(attr);
+
+	if (!entry->store)
+		return -EINVAL;
+
+	return entry->store(e->elevator_data, page, length);
+}
+
+static struct sysfs_ops cfq_sysfs_ops = {
+	.show	= cfq_attr_show,
+	.store	= cfq_attr_store,
+};
+
+struct kobj_type cfq_ktype = {
+	.sysfs_ops	= &cfq_sysfs_ops,
+	.default_attrs	= default_attrs,
+};
+
 elevator_t iosched_cfq = {
 	.elevator_name =		"cfq",
+	.elevator_ktype =		&cfq_ktype,
 	.elevator_merge_fn = 		cfq_merge,
 	.elevator_merged_fn =		cfq_merged_request,
 	.elevator_merge_req_fn =	cfq_merged_requests,
diff --git a/drivers/block/cryptoloop.c b/drivers/block/cryptoloop.c
index 6dc9a0915..5be6f998d 100644
--- a/drivers/block/cryptoloop.c
+++ b/drivers/block/cryptoloop.c
@@ -93,8 +93,8 @@ cryptoloop_transfer_ecb(struct loop_device *lo, int cmd,
 			int size, sector_t IV)
 {
 	struct crypto_tfm *tfm = (struct crypto_tfm *) lo->key_data;
-	struct scatterlist sg_out = { 0, };
-	struct scatterlist sg_in = { 0, };
+	struct scatterlist sg_out = { NULL, };
+	struct scatterlist sg_in = { NULL, };
 
 	encdec_ecb_t encdecfunc;
 	struct page *in_page, *out_page;
@@ -147,8 +147,8 @@ cryptoloop_transfer_cbc(struct loop_device *lo, int cmd,
 			int size, sector_t IV)
 {
 	struct crypto_tfm *tfm = (struct crypto_tfm *) lo->key_data;
-	struct scatterlist sg_out = { 0, };
-	struct scatterlist sg_in = { 0, };
+	struct scatterlist sg_out = { NULL, };
+	struct scatterlist sg_in = { NULL, };
 
 	encdec_cbc_t encdecfunc;
 	struct page *in_page, *out_page;
diff --git a/drivers/block/deadline-iosched.c b/drivers/block/deadline-iosched.c
index 317e7db70..fb7ab733c 100644
--- a/drivers/block/deadline-iosched.c
+++ b/drivers/block/deadline-iosched.c
@@ -205,7 +205,7 @@ __deadline_add_drq_rb(struct deadline_data *dd, struct deadline_rq *drq)
 	}
 
 	rb_link_node(&drq->rb_node, parent, p);
-	return 0;
+	return NULL;
 }
 
 static void
diff --git a/drivers/block/elevator.c b/drivers/block/elevator.c
index 4ce5ca130..35c9385ac 100644
--- a/drivers/block/elevator.c
+++ b/drivers/block/elevator.c
@@ -181,6 +181,14 @@ void __elv_add_request(request_queue_t *q, struct request *rq, int where,
 
 	rq->q = q;
 	q->elevator.elevator_add_req_fn(q, rq, where);
+
+	if (blk_queue_plugged(q)) {
+		int nrq = q->rq.count[READ] + q->rq.count[WRITE] - q->in_flight;
+
+		if (nrq == q->unplug_thresh)
+			__generic_unplug_device(q);
+	}
+
 }
 
 void elv_add_request(request_queue_t *q, struct request *rq, int where,
@@ -203,7 +211,7 @@ struct request *elv_next_request(request_queue_t *q)
 	struct request *rq;
 	int ret;
 
-	while ((rq = __elv_next_request(q))) {
+	while ((rq = __elv_next_request(q)) != NULL) {
 		/*
 		 * just mark as started even if we don't start it, a request
 		 * that has been delayed should not be passed by new incoming
diff --git a/drivers/block/floppy.c b/drivers/block/floppy.c
index 70375a056..5bf390d1b 100644
--- a/drivers/block/floppy.c
+++ b/drivers/block/floppy.c
@@ -922,7 +922,7 @@ static inline void unlock_fdc(void)
 {
 	unsigned long flags;
 
-	raw_cmd = 0;
+	raw_cmd = NULL;
 	if (!test_bit(0, &fdc_busy))
 		DPRINT("FDC access conflict!\n");
 
@@ -2021,7 +2021,7 @@ static void floppy_start(void)
 static void do_wakeup(void)
 {
 	reschedule_timeout(MAXTIMEOUT, "do wakeup", 0);
-	cont = 0;
+	cont = NULL;
 	command_status += 2;
 	wake_up(&command_done);
 }
@@ -3191,7 +3191,7 @@ static void raw_cmd_free(struct floppy_raw_cmd **ptr)
 	struct floppy_raw_cmd *next, *this;
 
 	this = *ptr;
-	*ptr = 0;
+	*ptr = NULL;
 	while (this) {
 		if (this->buffer_length) {
 			fd_dma_mem_free((unsigned long)this->kernel_data,
@@ -3211,7 +3211,7 @@ static inline int raw_cmd_copyin(int cmd, char __user *param,
 	int ret;
 	int i;
 
-	*rcmd = 0;
+	*rcmd = NULL;
 	while (1) {
 		ptr = (struct floppy_raw_cmd *)
 		    kmalloc(sizeof(struct floppy_raw_cmd), GFP_USER);
@@ -3219,7 +3219,7 @@ static inline int raw_cmd_copyin(int cmd, char __user *param,
 			return -ENOMEM;
 		*rcmd = ptr;
 		COPYIN(*ptr);
-		ptr->next = 0;
+		ptr->next = NULL;
 		ptr->buffer_length = 0;
 		param += sizeof(struct floppy_raw_cmd);
 		if (ptr->cmd_count > 33)
@@ -3236,7 +3236,7 @@ static inline int raw_cmd_copyin(int cmd, char __user *param,
 		for (i = 0; i < 16; i++)
 			ptr->reply[i] = 0;
 		ptr->resultcode = 0;
-		ptr->kernel_data = 0;
+		ptr->kernel_data = NULL;
 
 		if (ptr->flags & (FD_RAW_READ | FD_RAW_WRITE)) {
 			if (ptr->length <= 0)
@@ -4125,32 +4125,32 @@ static struct param_table {
 	int def_param;
 	int param2;
 } config_params[] = {
-	{"allowed_drive_mask", 0, &allowed_drive_mask, 0xff, 0}, /* obsolete */
-	{"all_drives", 0, &allowed_drive_mask, 0xff, 0},	/* obsolete */
-	{"asus_pci", 0, &allowed_drive_mask, 0x33, 0},
-	{"irq", 0, &FLOPPY_IRQ, 6, 0},
-	{"dma", 0, &FLOPPY_DMA, 2, 0},
-	{"daring", daring, 0, 1, 0},
+	{"allowed_drive_mask", NULL, &allowed_drive_mask, 0xff, 0}, /* obsolete */
+	{"all_drives", NULL, &allowed_drive_mask, 0xff, 0},	/* obsolete */
+	{"asus_pci", NULL, &allowed_drive_mask, 0x33, 0},
+	{"irq", NULL, &FLOPPY_IRQ, 6, 0},
+	{"dma", NULL, &FLOPPY_DMA, 2, 0},
+	{"daring", daring, NULL, 1, 0},
 #if N_FDC > 1
-	{"two_fdc", 0, &FDC2, 0x370, 0},
-	{"one_fdc", 0, &FDC2, 0, 0},
+	{"two_fdc", NULL, &FDC2, 0x370, 0},
+	{"one_fdc", NULL, &FDC2, 0, 0},
 #endif
-	{"thinkpad", floppy_set_flags, 0, 1, FD_INVERTED_DCL},
-	{"broken_dcl", floppy_set_flags, 0, 1, FD_BROKEN_DCL},
-	{"messages", floppy_set_flags, 0, 1, FTD_MSG},
-	{"silent_dcl_clear", floppy_set_flags, 0, 1, FD_SILENT_DCL_CLEAR},
-	{"debug", floppy_set_flags, 0, 1, FD_DEBUG},
-	{"nodma", 0, &can_use_virtual_dma, 1, 0},
-	{"omnibook", 0, &can_use_virtual_dma, 1, 0},
-	{"yesdma", 0, &can_use_virtual_dma, 0, 0},
-	{"fifo_depth", 0, &fifo_depth, 0xa, 0},
-	{"nofifo", 0, &no_fifo, 0x20, 0},
-	{"usefifo", 0, &no_fifo, 0, 0},
-	{"cmos", set_cmos, 0, 0, 0},
-	{"slow", 0, &slow_floppy, 1, 0},
-	{"unexpected_interrupts", 0, &print_unex, 1, 0},
-	{"no_unexpected_interrupts", 0, &print_unex, 0, 0},
-	{"L40SX", 0, &print_unex, 0, 0}
+	{"thinkpad", floppy_set_flags, NULL, 1, FD_INVERTED_DCL},
+	{"broken_dcl", floppy_set_flags, NULL, 1, FD_BROKEN_DCL},
+	{"messages", floppy_set_flags, NULL, 1, FTD_MSG},
+	{"silent_dcl_clear", floppy_set_flags, NULL, 1, FD_SILENT_DCL_CLEAR},
+	{"debug", floppy_set_flags, NULL, 1, FD_DEBUG},
+	{"nodma", NULL, &can_use_virtual_dma, 1, 0},
+	{"omnibook", NULL, &can_use_virtual_dma, 1, 0},
+	{"yesdma", NULL, &can_use_virtual_dma, 0, 0},
+	{"fifo_depth", NULL, &fifo_depth, 0xa, 0},
+	{"nofifo", NULL, &no_fifo, 0x20, 0},
+	{"usefifo", NULL, &no_fifo, 0, 0},
+	{"cmos", set_cmos, NULL, 0, 0},
+	{"slow", NULL, &slow_floppy, 1, 0},
+	{"unexpected_interrupts", NULL, &print_unex, 1, 0},
+	{"no_unexpected_interrupts", NULL, &print_unex, 0, 0},
+	{"L40SX", NULL, &print_unex, 0, 0}
 
 	EXTRA_FLOPPY_PARAMS
 };
@@ -4190,7 +4190,7 @@ static int __init floppy_setup(char *str)
 		printk("\n");
 	} else
 		DPRINT("botched floppy option\n");
-	DPRINT("Read linux/Documentation/floppy.txt\n");
+	DPRINT("Read Documentation/floppy.txt\n");
 	return 0;
 }
 
@@ -4228,7 +4228,6 @@ int __init floppy_init(void)
 	int err, dr;
 
 	raw_cmd = NULL;
-	i = 0;
 
 	for (dr = 0; dr < N_DRIVE; dr++) {
 		disks[dr] = alloc_disk(1);
diff --git a/drivers/block/genhd.c b/drivers/block/genhd.c
index 2c849532f..e82caa224 100644
--- a/drivers/block/genhd.c
+++ b/drivers/block/genhd.c
@@ -90,7 +90,7 @@ int register_blkdev(unsigned int major, const char *name)
 
 	p->major = major;
 	strlcpy(p->name, name, sizeof(p->name));
-	p->next = 0;
+	p->next = NULL;
 	index = major_to_index(major);
 
 	spin_lock_irqsave(&major_names_lock, flags);
@@ -352,6 +352,12 @@ static ssize_t disk_range_read(struct gendisk * disk, char *page)
 {
 	return sprintf(page, "%d\n", disk->minors);
 }
+static ssize_t disk_removable_read(struct gendisk * disk, char *page)
+{
+	return sprintf(page, "%d\n",
+		       (disk->flags & GENHD_FL_REMOVABLE ? 1 : 0));
+
+}
 static ssize_t disk_size_read(struct gendisk * disk, char *page)
 {
 	return sprintf(page, "%llu\n", (unsigned long long)get_capacity(disk));
@@ -384,6 +390,10 @@ static struct disk_attribute disk_attr_range = {
 	.attr = {.name = "range", .mode = S_IRUGO },
 	.show	= disk_range_read
 };
+static struct disk_attribute disk_attr_removable = {
+	.attr = {.name = "removable", .mode = S_IRUGO },
+	.show	= disk_removable_read
+};
 static struct disk_attribute disk_attr_size = {
 	.attr = {.name = "size", .mode = S_IRUGO },
 	.show	= disk_size_read
@@ -396,6 +406,7 @@ static struct disk_attribute disk_attr_stat = {
 static struct attribute * default_attrs[] = {
 	&disk_attr_dev.attr,
 	&disk_attr_range.attr,
+	&disk_attr_removable.attr,
 	&disk_attr_size.attr,
 	&disk_attr_stat.attr,
 	NULL,
diff --git a/drivers/block/ll_rw_blk.c b/drivers/block/ll_rw_blk.c
index 5baa11da0..17c403ebd 100644
--- a/drivers/block/ll_rw_blk.c
+++ b/drivers/block/ll_rw_blk.c
@@ -632,6 +632,8 @@ int blk_queue_resize_tags(request_queue_t *q, int new_depth)
 	return 0;
 }
 
+EXPORT_SYMBOL(blk_queue_resize_tags);
+
 /**
  * blk_queue_end_tag - end tag operations for a request
  * @q:  the request queue for the device
@@ -817,14 +819,14 @@ EXPORT_SYMBOL(blk_dump_rq_flags);
 void blk_recount_segments(request_queue_t *q, struct bio *bio)
 {
 	struct bio_vec *bv, *bvprv = NULL;
-	int i, nr_phys_segs, nr_hw_segs, seg_size, cluster;
+	int i, nr_phys_segs, nr_hw_segs, seg_size, hw_seg_size, cluster;
 	int high, highprv = 1;
 
 	if (unlikely(!bio->bi_io_vec))
 		return;
 
 	cluster = q->queue_flags & (1 << QUEUE_FLAG_CLUSTER);
-	seg_size = nr_phys_segs = nr_hw_segs = 0;
+	hw_seg_size = seg_size = nr_phys_segs = nr_hw_segs = 0;
 	bio_for_each_segment(bv, bio, i) {
 		/*
 		 * the trick here is making sure that a high page is never
@@ -841,22 +843,35 @@ void blk_recount_segments(request_queue_t *q, struct bio *bio)
 				goto new_segment;
 			if (!BIOVEC_SEG_BOUNDARY(q, bvprv, bv))
 				goto new_segment;
+			if (BIOVEC_VIRT_OVERSIZE(hw_seg_size + bv->bv_len))
+				goto new_hw_segment;
 
 			seg_size += bv->bv_len;
+			hw_seg_size += bv->bv_len;
 			bvprv = bv;
 			continue;
 		}
 new_segment:
-		if (!BIOVEC_VIRT_MERGEABLE(bvprv, bv))
+		if (BIOVEC_VIRT_MERGEABLE(bvprv, bv) &&
+		    !BIOVEC_VIRT_OVERSIZE(hw_seg_size + bv->bv_len)) {
+			hw_seg_size += bv->bv_len;
+		} else {
 new_hw_segment:
+			if (hw_seg_size > bio->bi_hw_front_size)
+				bio->bi_hw_front_size = hw_seg_size;
+			hw_seg_size = BIOVEC_VIRT_START_SIZE(bv) + bv->bv_len;
 			nr_hw_segs++;
+		}
 
 		nr_phys_segs++;
 		bvprv = bv;
 		seg_size = bv->bv_len;
 		highprv = high;
 	}
-
+	if (hw_seg_size > bio->bi_hw_back_size)
+		bio->bi_hw_back_size = hw_seg_size;
+	if (nr_hw_segs == 1 && hw_seg_size > bio->bi_hw_front_size)
+		bio->bi_hw_front_size = hw_seg_size;
 	bio->bi_phys_segments = nr_phys_segs;
 	bio->bi_hw_segments = nr_hw_segs;
 	bio->bi_flags |= (1 << BIO_SEG_VALID);
@@ -889,22 +904,17 @@ EXPORT_SYMBOL(blk_phys_contig_segment);
 int blk_hw_contig_segment(request_queue_t *q, struct bio *bio,
 				 struct bio *nxt)
 {
-	if (!(q->queue_flags & (1 << QUEUE_FLAG_CLUSTER)))
-		return 0;
-
-	if (!BIOVEC_VIRT_MERGEABLE(__BVEC_END(bio), __BVEC_START(nxt)))
+	if (unlikely(!bio_flagged(bio, BIO_SEG_VALID)))
+		blk_recount_segments(q, bio);
+	if (unlikely(!bio_flagged(nxt, BIO_SEG_VALID)))
+		blk_recount_segments(q, nxt);
+	if (!BIOVEC_VIRT_MERGEABLE(__BVEC_END(bio), __BVEC_START(nxt)) ||
+	    BIOVEC_VIRT_OVERSIZE(bio->bi_hw_front_size + bio->bi_hw_back_size))
 		return 0;
 	if (bio->bi_size + nxt->bi_size > q->max_segment_size)
 		return 0;
 
-	/*
-	 * bio and nxt are contigous in memory, check if the queue allows
-	 * these two to be merged into one
-	 */
-	if (BIO_SEG_BOUNDARY(q, bio, nxt))
-		return 1;
-
-	return 0;
+	return 1;
 }
 
 EXPORT_SYMBOL(blk_hw_contig_segment);
@@ -974,7 +984,8 @@ static inline int ll_new_mergeable(request_queue_t *q,
 
 	if (req->nr_phys_segments + nr_phys_segs > q->max_phys_segments) {
 		req->flags |= REQ_NOMERGE;
-		q->last_merge = NULL;
+		if (req == q->last_merge)
+			q->last_merge = NULL;
 		return 0;
 	}
 
@@ -996,7 +1007,8 @@ static inline int ll_new_hw_segment(request_queue_t *q,
 	if (req->nr_hw_segments + nr_hw_segs > q->max_hw_segments
 	    || req->nr_phys_segments + nr_phys_segs > q->max_phys_segments) {
 		req->flags |= REQ_NOMERGE;
-		q->last_merge = NULL;
+		if (req == q->last_merge)
+			q->last_merge = NULL;
 		return 0;
 	}
 
@@ -1012,14 +1024,31 @@ static inline int ll_new_hw_segment(request_queue_t *q,
 static int ll_back_merge_fn(request_queue_t *q, struct request *req, 
 			    struct bio *bio)
 {
+	int len;
+
 	if (req->nr_sectors + bio_sectors(bio) > q->max_sectors) {
 		req->flags |= REQ_NOMERGE;
-		q->last_merge = NULL;
+		if (req == q->last_merge)
+			q->last_merge = NULL;
 		return 0;
 	}
-
-	if (BIOVEC_VIRT_MERGEABLE(__BVEC_END(req->biotail), __BVEC_START(bio)))
-		return ll_new_mergeable(q, req, bio);
+	if (unlikely(!bio_flagged(req->biotail, BIO_SEG_VALID)))
+		blk_recount_segments(q, req->biotail);
+	if (unlikely(!bio_flagged(bio, BIO_SEG_VALID)))
+		blk_recount_segments(q, bio);
+	len = req->biotail->bi_hw_back_size + bio->bi_hw_front_size;
+	if (BIOVEC_VIRT_MERGEABLE(__BVEC_END(req->biotail), __BVEC_START(bio)) &&
+	    !BIOVEC_VIRT_OVERSIZE(len)) {
+		int mergeable =  ll_new_mergeable(q, req, bio);
+
+		if (mergeable) {
+			if (req->nr_hw_segments == 1)
+				req->bio->bi_hw_front_size = len;
+			if (bio->bi_hw_segments == 1)
+				bio->bi_hw_back_size = len;
+		}
+		return mergeable;
+	}
 
 	return ll_new_hw_segment(q, req, bio);
 }
@@ -1027,14 +1056,31 @@ static int ll_back_merge_fn(request_queue_t *q, struct request *req,
 static int ll_front_merge_fn(request_queue_t *q, struct request *req, 
 			     struct bio *bio)
 {
+	int len;
+
 	if (req->nr_sectors + bio_sectors(bio) > q->max_sectors) {
 		req->flags |= REQ_NOMERGE;
-		q->last_merge = NULL;
+		if (req == q->last_merge)
+			q->last_merge = NULL;
 		return 0;
 	}
-
-	if (BIOVEC_VIRT_MERGEABLE(__BVEC_END(bio), __BVEC_START(req->bio)))
-		return ll_new_mergeable(q, req, bio);
+	len = bio->bi_hw_back_size + req->bio->bi_hw_front_size;
+	if (unlikely(!bio_flagged(bio, BIO_SEG_VALID)))
+		blk_recount_segments(q, bio);
+	if (unlikely(!bio_flagged(req->bio, BIO_SEG_VALID)))
+		blk_recount_segments(q, req->bio);
+	if (BIOVEC_VIRT_MERGEABLE(__BVEC_END(bio), __BVEC_START(req->bio)) &&
+	    !BIOVEC_VIRT_OVERSIZE(len)) {
+		int mergeable =  ll_new_mergeable(q, req, bio);
+
+		if (mergeable) {
+			if (bio->bi_hw_segments == 1)
+				bio->bi_hw_front_size = len;
+			if (req->nr_hw_segments == 1)
+				req->biotail->bi_hw_back_size = len;
+		}
+		return mergeable;
+	}
 
 	return ll_new_hw_segment(q, req, bio);
 }
@@ -1066,8 +1112,17 @@ static int ll_merge_requests_fn(request_queue_t *q, struct request *req,
 		return 0;
 
 	total_hw_segments = req->nr_hw_segments + next->nr_hw_segments;
-	if (blk_hw_contig_segment(q, req->biotail, next->bio))
+	if (blk_hw_contig_segment(q, req->biotail, next->bio)) {
+		int len = req->biotail->bi_hw_back_size + next->bio->bi_hw_front_size;
+		/*
+		 * propagate the combined length to the end of the requests
+		 */
+		if (req->nr_hw_segments == 1)
+			req->bio->bi_hw_front_size = len;
+		if (next->nr_hw_segments == 1)
+			next->biotail->bi_hw_back_size = len;
 		total_hw_segments--;
+	}
 
 	if (total_hw_segments > q->max_hw_segments)
 		return 0;
@@ -1123,7 +1178,7 @@ EXPORT_SYMBOL(blk_remove_plug);
 /*
  * remove the plug and let it rip..
  */
-static inline void __generic_unplug_device(request_queue_t *q)
+void __generic_unplug_device(request_queue_t *q)
 {
 	if (test_bit(QUEUE_FLAG_STOPPED, &q->queue_flags))
 		return;
@@ -1137,6 +1192,7 @@ static inline void __generic_unplug_device(request_queue_t *q)
 	if (elv_next_request(q))
 		q->request_fn(q);
 }
+EXPORT_SYMBOL(__generic_unplug_device);
 
 /**
  * generic_unplug_device - fire a request queue
@@ -1411,9 +1467,6 @@ request_queue_t *blk_init_queue(request_fn_proc *rfn, spinlock_t *lock)
 		printk("Using %s io scheduler\n", chosen_elevator->elevator_name);
 	}
 
-	if (elevator_init(q, chosen_elevator))
-		goto out_elv;
-
 	q->request_fn		= rfn;
 	q->back_merge_fn       	= ll_back_merge_fn;
 	q->front_merge_fn      	= ll_front_merge_fn;
@@ -1431,8 +1484,12 @@ request_queue_t *blk_init_queue(request_fn_proc *rfn, spinlock_t *lock)
 	blk_queue_max_hw_segments(q, MAX_HW_SEGMENTS);
 	blk_queue_max_phys_segments(q, MAX_PHYS_SEGMENTS);
 
-	return q;
-out_elv:
+	/*
+	 * all done
+	 */
+	if (!elevator_init(q, chosen_elevator))
+		return q;
+
 	blk_cleanup_queue(q);
 out_init:
 	kmem_cache_free(requestq_cachep, q);
@@ -1759,54 +1816,53 @@ EXPORT_SYMBOL(blk_insert_request);
  *
  *    A matching blk_rq_unmap_user() must be issued at the end of io, while
  *    still in process context.
+ *
+ *    Note: The mapped bio may need to be bounced through blk_queue_bounce()
+ *    before being submitted to the device, as pages mapped may be out of
+ *    reach. It's the callers responsibility to make sure this happens. The
+ *    original bio must be passed back in to blk_rq_unmap_user() for proper
+ *    unmapping.
  */
 struct request *blk_rq_map_user(request_queue_t *q, int rw, void __user *ubuf,
 				unsigned int len)
 {
-	struct request *rq = NULL;
-	char *buf = NULL;
+	unsigned long uaddr;
+	struct request *rq;
 	struct bio *bio;
-	int ret;
+
+	if (len > (q->max_sectors << 9))
+		return ERR_PTR(-EINVAL);
+	if ((!len && ubuf) || (len && !ubuf))
+		return ERR_PTR(-EINVAL);
 
 	rq = blk_get_request(q, rw, __GFP_WAIT);
 	if (!rq)
 		return ERR_PTR(-ENOMEM);
 
-	bio = bio_map_user(q, NULL, (unsigned long) ubuf, len, rw == READ);
-	if (!bio) {
-		int bytes = (len + 511) & ~511;
-
-		buf = kmalloc(bytes, q->bounce_gfp | GFP_USER);
-		if (!buf) {
-			ret = -ENOMEM;
-			goto fault;
-		}
-
-		if (rw == WRITE) {
-			if (copy_from_user(buf, ubuf, len)) {
-				ret = -EFAULT;
-				goto fault;
-			}
-		} else
-			memset(buf, 0, len);
-	}
+	/*
+	 * if alignment requirement is satisfied, map in user pages for
+	 * direct dma. else, set up kernel bounce buffers
+	 */
+	uaddr = (unsigned long) ubuf;
+	if (!(uaddr & queue_dma_alignment(q)) && !(len & queue_dma_alignment(q)))
+		bio = bio_map_user(q, NULL, uaddr, len, rw == READ);
+	else
+		bio = bio_copy_user(q, uaddr, len, rw == READ);
 
-	rq->bio = rq->biotail = bio;
-	if (rq->bio)
+	if (!IS_ERR(bio)) {
+		rq->bio = rq->biotail = bio;
 		blk_rq_bio_prep(q, rq, bio);
 
-	rq->buffer = rq->data = buf;
-	rq->data_len = len;
-	return rq;
-fault:
-	if (buf)
-		kfree(buf);
-	if (bio)
-		bio_unmap_user(bio, 1);
-	if (rq)
-		blk_put_request(rq);
+		rq->buffer = rq->data = NULL;
+		rq->data_len = len;
+		return rq;
+	}
 
-	return ERR_PTR(ret);
+	/*
+	 * bio is the err-ptr
+	 */
+	blk_put_request(rq);
+	return (struct request *) bio;
 }
 
 EXPORT_SYMBOL(blk_rq_map_user);
@@ -1820,18 +1876,15 @@ EXPORT_SYMBOL(blk_rq_map_user);
  * Description:
  *    Unmap a request previously mapped by blk_rq_map_user().
  */
-int blk_rq_unmap_user(struct request *rq, void __user *ubuf, struct bio *bio,
-		      unsigned int ulen)
+int blk_rq_unmap_user(struct request *rq, struct bio *bio, unsigned int ulen)
 {
-	const int read = rq_data_dir(rq) == READ;
 	int ret = 0;
 
-	if (bio)
-		bio_unmap_user(bio, read);
-	if (rq->buffer) {
-		if (read && copy_to_user(ubuf, rq->buffer, ulen))
-			ret = -EFAULT;
-		kfree(rq->buffer);
+	if (bio) {
+		if (bio_flagged(bio, BIO_USER_MAPPED))
+			bio_unmap_user(bio);
+		else
+			ret = bio_uncopy_user(bio);
 	}
 
 	blk_put_request(rq);
@@ -2280,13 +2333,9 @@ get_rq:
 out:
 	if (freereq)
 		__blk_put_request(q, freereq);
+	if (bio_sync(bio))
+		__generic_unplug_device(q);
 
-	if (blk_queue_plugged(q)) {
-		int nrq = q->rq.count[READ] + q->rq.count[WRITE] - q->in_flight;
-
-		if (nrq == q->unplug_thresh || bio_sync(bio))
-			__generic_unplug_device(q);
-	}
 	spin_unlock_irq(q->queue_lock);
 	return 0;
 
@@ -2535,7 +2584,7 @@ EXPORT_SYMBOL(process_that_request_first);
 
 void blk_recalc_rq_segments(struct request *rq)
 {
-	struct bio *bio;
+	struct bio *bio, *prevbio = NULL;
 	int nr_phys_segs, nr_hw_segs;
 
 	if (!rq->bio)
@@ -2548,6 +2597,13 @@ void blk_recalc_rq_segments(struct request *rq)
 
 		nr_phys_segs += bio_phys_segments(rq->q, bio);
 		nr_hw_segs += bio_hw_segments(rq->q, bio);
+		if (prevbio) {
+			if (blk_phys_contig_segment(rq->q, prevbio, bio))
+				nr_phys_segs--;
+			if (blk_hw_contig_segment(rq->q, prevbio, bio))
+				nr_hw_segs--;
+		}
+		prevbio = bio;
 	}
 
 	rq->nr_phys_segments = nr_phys_segs;
@@ -2610,7 +2666,7 @@ static int __end_that_request_first(struct request *req, int uptodate,
 	}
 
 	total_bytes = bio_nbytes = 0;
-	while ((bio = req->bio)) {
+	while ((bio = req->bio) != NULL) {
 		int nbytes;
 
 		if (nr_bytes >= bio->bi_size) {
@@ -2812,6 +2868,8 @@ int kblockd_schedule_work(struct work_struct *work)
 	return queue_work(kblockd_workqueue, work);
 }
 
+EXPORT_SYMBOL(kblockd_schedule_work);
+
 void kblockd_flush(void)
 {
 	flush_workqueue(kblockd_workqueue);
diff --git a/drivers/block/loop.c b/drivers/block/loop.c
index f1250943c..946742912 100644
--- a/drivers/block/loop.c
+++ b/drivers/block/loop.c
@@ -293,7 +293,7 @@ lo_read_actor(read_descriptor_t *desc, struct page *page,
 	      unsigned long offset, unsigned long size)
 {
 	unsigned long count = desc->count;
-	struct lo_read_data *p = (struct lo_read_data*)desc->buf;
+	struct lo_read_data *p = desc->arg.data;
 	struct loop_device *lo = p->lo;
 	sector_t IV;
 
diff --git a/drivers/block/nbd.c b/drivers/block/nbd.c
index 3554188eb..b98b70b8f 100644
--- a/drivers/block/nbd.c
+++ b/drivers/block/nbd.c
@@ -158,15 +158,12 @@ static void nbd_end_request(struct request *req)
 static int sock_xmit(struct socket *sock, int send, void *buf, int size,
 		int msg_flags)
 {
-	mm_segment_t oldfs;
 	int result;
 	struct msghdr msg;
-	struct iovec iov;
+	struct kvec iov;
 	unsigned long flags;
 	sigset_t oldset;
 
-	oldfs = get_fs();
-	set_fs(get_ds());
 	/* Allow interception of SIGKILL only
 	 * Don't allow other signals to interrupt the transmission */
 	spin_lock_irqsave(&current->sighand->siglock, flags);
@@ -182,17 +179,15 @@ static int sock_xmit(struct socket *sock, int send, void *buf, int size,
 		iov.iov_len = size;
 		msg.msg_name = NULL;
 		msg.msg_namelen = 0;
-		msg.msg_iov = &iov;
-		msg.msg_iovlen = 1;
 		msg.msg_control = NULL;
 		msg.msg_controllen = 0;
 		msg.msg_namelen = 0;
 		msg.msg_flags = msg_flags | MSG_NOSIGNAL;
 
 		if (send)
-			result = sock_sendmsg(sock, &msg, size);
+			result = kernel_sendmsg(sock, &msg, &iov, 1, size);
 		else
-			result = sock_recvmsg(sock, &msg, size, 0);
+			result = kernel_recvmsg(sock, &msg, &iov, 1, size, 0);
 
 		if (signal_pending(current)) {
 			siginfo_t info;
@@ -219,7 +214,6 @@ static int sock_xmit(struct socket *sock, int send, void *buf, int size,
 	recalc_sigpending();
 	spin_unlock_irqrestore(&current->sighand->siglock, flags);
 
-	set_fs(oldfs);
 	return result;
 }
 
diff --git a/drivers/block/paride/bpck6.c b/drivers/block/paride/bpck6.c
index 71646dba6..354f67ac5 100644
--- a/drivers/block/paride/bpck6.c
+++ b/drivers/block/paride/bpck6.c
@@ -41,7 +41,7 @@ static int verbose; /* set this to 1 to see debugging messages and whatnot */
 
  
 
-#define PPCSTRUCT(pi) ((PPC *)(pi->private))
+#define PPCSTRUCT(pi) ((Interface *)(pi->private))
 
 /****************************************************************/
 /*
@@ -224,10 +224,10 @@ static void bpck6_log_adapter( PIA *pi, char * scratch, int verbose )
 
 static int bpck6_init_proto(PIA *pi)
 {
-	PPC *p = kmalloc(sizeof(PPC), GFP_KERNEL);
+	Interface *p = kmalloc(sizeof(Interface), GFP_KERNEL);
 
 	if (p) {
-		memset(p, 0, sizeof(PPC));
+		memset(p, 0, sizeof(Interface));
 		pi->private = (unsigned long)p;
 		return 0;
 	}
diff --git a/drivers/block/paride/paride.c b/drivers/block/paride/paride.c
index d95e4f8ec..9f9401c1a 100644
--- a/drivers/block/paride/paride.c
+++ b/drivers/block/paride/paride.c
@@ -264,7 +264,7 @@ void pi_unregister(PIP * pr)
 		printk("paride: %s not registered\n", pr->name);
 		return;
 	}
-	protocols[pr->index] = 0;
+	protocols[pr->index] = NULL;
 }
 
 EXPORT_SYMBOL(pi_unregister);
diff --git a/drivers/block/paride/pcd.c b/drivers/block/paride/pcd.c
index 4ab5efad0..876a23690 100644
--- a/drivers/block/paride/pcd.c
+++ b/drivers/block/paride/pcd.c
@@ -259,7 +259,7 @@ static int pcd_block_ioctl(struct inode *inode, struct file *file,
 				unsigned cmd, unsigned long arg)
 {
 	struct pcd_unit *cd = inode->i_bdev->bd_disk->private_data;
-	return cdrom_ioctl(&cd->info, inode, cmd, arg);
+	return cdrom_ioctl(file, &cd->info, inode, cmd, arg);
 }
 
 static int pcd_block_media_changed(struct gendisk *disk)
@@ -752,7 +752,7 @@ static void do_pcd_request(request_queue_t * q)
 			pcd_count = pcd_req->current_nr_sectors;
 			pcd_buf = pcd_req->buffer;
 			pcd_busy = 1;
-			ps_set_intr(do_pcd_read, 0, 0, nice);
+			ps_set_intr(do_pcd_read, NULL, 0, nice);
 			return;
 		} else
 			end_request(pcd_req, 0);
diff --git a/drivers/block/paride/pf.c b/drivers/block/paride/pf.c
index b4a696e73..c4fab51d9 100644
--- a/drivers/block/paride/pf.c
+++ b/drivers/block/paride/pf.c
@@ -841,7 +841,7 @@ static inline void next_request(int success)
 /* detach from the calling context - in case the spinlock is held */
 static void do_pf_read(void)
 {
-	ps_set_intr(do_pf_read_start, 0, 0, nice);
+	ps_set_intr(do_pf_read_start, NULL, 0, nice);
 }
 
 static void do_pf_read_start(void)
@@ -887,7 +887,7 @@ static void do_pf_read_drq(void)
 
 static void do_pf_write(void)
 {
-	ps_set_intr(do_pf_write_start, 0, 0, nice);
+	ps_set_intr(do_pf_write_start, NULL, 0, nice);
 }
 
 static void do_pf_write_start(void)
diff --git a/drivers/block/paride/ppc6lnx.c b/drivers/block/paride/ppc6lnx.c
index 829c9c515..5e5521d3b 100644
--- a/drivers/block/paride/ppc6lnx.c
+++ b/drivers/block/paride/ppc6lnx.c
@@ -79,7 +79,7 @@ typedef struct ppc_storage {
 	u8	org_data;				// original LPT data port contents
 	u8	org_ctrl;				// original LPT control port contents
 	u8	cur_ctrl;				// current control port contents
-} PPC;
+} Interface;
 
 //***************************************************************************
 
@@ -101,25 +101,25 @@ typedef struct ppc_storage {
 
 //***************************************************************************
 
-static int ppc6_select(PPC *ppc);
-static void ppc6_deselect(PPC *ppc);
-static void ppc6_send_cmd(PPC *ppc, u8 cmd);
-static void ppc6_wr_data_byte(PPC *ppc, u8 data);
-static u8 ppc6_rd_data_byte(PPC *ppc);
-static u8 ppc6_rd_port(PPC *ppc, u8 port);
-static void ppc6_wr_port(PPC *ppc, u8 port, u8 data);
-static void ppc6_rd_data_blk(PPC *ppc, u8 *data, long count);
-static void ppc6_wait_for_fifo(PPC *ppc);
-static void ppc6_wr_data_blk(PPC *ppc, u8 *data, long count);
-static void ppc6_rd_port16_blk(PPC *ppc, u8 port, u8 *data, long length);
-static void ppc6_wr_port16_blk(PPC *ppc, u8 port, u8 *data, long length);
-static void ppc6_wr_extout(PPC *ppc, u8 regdata);
-static int ppc6_open(PPC *ppc);
-static void ppc6_close(PPC *ppc);
+static int ppc6_select(Interface *ppc);
+static void ppc6_deselect(Interface *ppc);
+static void ppc6_send_cmd(Interface *ppc, u8 cmd);
+static void ppc6_wr_data_byte(Interface *ppc, u8 data);
+static u8 ppc6_rd_data_byte(Interface *ppc);
+static u8 ppc6_rd_port(Interface *ppc, u8 port);
+static void ppc6_wr_port(Interface *ppc, u8 port, u8 data);
+static void ppc6_rd_data_blk(Interface *ppc, u8 *data, long count);
+static void ppc6_wait_for_fifo(Interface *ppc);
+static void ppc6_wr_data_blk(Interface *ppc, u8 *data, long count);
+static void ppc6_rd_port16_blk(Interface *ppc, u8 port, u8 *data, long length);
+static void ppc6_wr_port16_blk(Interface *ppc, u8 port, u8 *data, long length);
+static void ppc6_wr_extout(Interface *ppc, u8 regdata);
+static int ppc6_open(Interface *ppc);
+static void ppc6_close(Interface *ppc);
 
 //***************************************************************************
 
-static int ppc6_select(PPC *ppc)
+static int ppc6_select(Interface *ppc)
 {
 	u8 i, j, k;
 
@@ -205,7 +205,7 @@ static int ppc6_select(PPC *ppc)
 
 //***************************************************************************
 
-static void ppc6_deselect(PPC *ppc)
+static void ppc6_deselect(Interface *ppc)
 {
 	if (ppc->mode & 4)	// EPP
 		ppc->cur_ctrl |= port_init;
@@ -223,7 +223,7 @@ static void ppc6_deselect(PPC *ppc)
 
 //***************************************************************************
 
-static void ppc6_send_cmd(PPC *ppc, u8 cmd)
+static void ppc6_send_cmd(Interface *ppc, u8 cmd)
 {
 	switch(ppc->mode)
 	{
@@ -254,7 +254,7 @@ static void ppc6_send_cmd(PPC *ppc, u8 cmd)
 
 //***************************************************************************
 
-static void ppc6_wr_data_byte(PPC *ppc, u8 data)
+static void ppc6_wr_data_byte(Interface *ppc, u8 data)
 {
 	switch(ppc->mode)
 	{
@@ -285,7 +285,7 @@ static void ppc6_wr_data_byte(PPC *ppc, u8 data)
 
 //***************************************************************************
 
-static u8 ppc6_rd_data_byte(PPC *ppc)
+static u8 ppc6_rd_data_byte(Interface *ppc)
 {
 	u8 data = 0;
 
@@ -358,7 +358,7 @@ static u8 ppc6_rd_data_byte(PPC *ppc)
 
 //***************************************************************************
 
-static u8 ppc6_rd_port(PPC *ppc, u8 port)
+static u8 ppc6_rd_port(Interface *ppc, u8 port)
 {
 	ppc6_send_cmd(ppc,(u8)(port | ACCESS_PORT | ACCESS_READ));
 
@@ -367,7 +367,7 @@ static u8 ppc6_rd_port(PPC *ppc, u8 port)
 
 //***************************************************************************
 
-static void ppc6_wr_port(PPC *ppc, u8 port, u8 data)
+static void ppc6_wr_port(Interface *ppc, u8 port, u8 data)
 {
 	ppc6_send_cmd(ppc,(u8)(port | ACCESS_PORT | ACCESS_WRITE));
 
@@ -376,7 +376,7 @@ static void ppc6_wr_port(PPC *ppc, u8 port, u8 data)
 
 //***************************************************************************
 
-static void ppc6_rd_data_blk(PPC *ppc, u8 *data, long count)
+static void ppc6_rd_data_blk(Interface *ppc, u8 *data, long count)
 {
 	switch(ppc->mode)
 	{
@@ -512,7 +512,7 @@ static void ppc6_rd_data_blk(PPC *ppc, u8 *data, long count)
 
 //***************************************************************************
 
-static void ppc6_wait_for_fifo(PPC *ppc)
+static void ppc6_wait_for_fifo(Interface *ppc)
 {
 	int i;
 
@@ -525,7 +525,7 @@ static void ppc6_wait_for_fifo(PPC *ppc)
 
 //***************************************************************************
 
-static void ppc6_wr_data_blk(PPC *ppc, u8 *data, long count)
+static void ppc6_wr_data_blk(Interface *ppc, u8 *data, long count)
 {
 	switch(ppc->mode)
 	{
@@ -644,7 +644,7 @@ static void ppc6_wr_data_blk(PPC *ppc, u8 *data, long count)
 
 //***************************************************************************
 
-static void ppc6_rd_port16_blk(PPC *ppc, u8 port, u8 *data, long length)
+static void ppc6_rd_port16_blk(Interface *ppc, u8 port, u8 *data, long length)
 {
 	length = length << 1;
 
@@ -664,7 +664,7 @@ static void ppc6_rd_port16_blk(PPC *ppc, u8 port, u8 *data, long length)
 
 //***************************************************************************
 
-static void ppc6_wr_port16_blk(PPC *ppc, u8 port, u8 *data, long length)
+static void ppc6_wr_port16_blk(Interface *ppc, u8 port, u8 *data, long length)
 {
 	length = length << 1;
 
@@ -684,7 +684,7 @@ static void ppc6_wr_port16_blk(PPC *ppc, u8 port, u8 *data, long length)
 
 //***************************************************************************
 
-static void ppc6_wr_extout(PPC *ppc, u8 regdata)
+static void ppc6_wr_extout(Interface *ppc, u8 regdata)
 {
 	ppc6_send_cmd(ppc,(REG_VERSION | ACCESS_REG | ACCESS_WRITE));
 
@@ -693,7 +693,7 @@ static void ppc6_wr_extout(PPC *ppc, u8 regdata)
 
 //***************************************************************************
 
-static int ppc6_open(PPC *ppc)
+static int ppc6_open(Interface *ppc)
 {
 	int ret;
 
@@ -717,7 +717,7 @@ static int ppc6_open(PPC *ppc)
 
 //***************************************************************************
 
-static void ppc6_close(PPC *ppc)
+static void ppc6_close(Interface *ppc)
 {
 	ppc6_deselect(ppc);
 }
diff --git a/drivers/block/scsi_ioctl.c b/drivers/block/scsi_ioctl.c
index 93ebb681c..41d023931 100644
--- a/drivers/block/scsi_ioctl.c
+++ b/drivers/block/scsi_ioctl.c
@@ -90,7 +90,7 @@ static int sg_set_reserved_size(request_queue_t *q, int __user *p)
 	if (size < 0)
 		return -EINVAL;
 	if (size > (q->max_sectors << 9))
-		return -EINVAL;
+		size = q->max_sectors << 9;
 
 	q->sg_reserved_size = size;
 	return 0;
@@ -105,8 +105,80 @@ static int sg_emulated_host(request_queue_t *q, int __user *p)
 	return put_user(1, p);
 }
 
-static int sg_io(request_queue_t *q, struct gendisk *bd_disk,
-		 struct sg_io_hdr *hdr)
+#define CMD_READ_SAFE	0x01
+#define CMD_WRITE_SAFE	0x02
+#define safe_for_read(cmd)	[cmd] = CMD_READ_SAFE
+#define safe_for_write(cmd)	[cmd] = CMD_WRITE_SAFE
+
+static int verify_command(struct file *file, unsigned char *cmd)
+{
+	static const unsigned char cmd_type[256] = {
+
+		/* Basic read-only commands */
+		safe_for_read(TEST_UNIT_READY),
+		safe_for_read(REQUEST_SENSE),
+		safe_for_read(READ_6),
+		safe_for_read(READ_10),
+		safe_for_read(READ_12),
+		safe_for_read(READ_16),
+		safe_for_read(READ_BUFFER),
+		safe_for_read(READ_LONG),
+		safe_for_read(INQUIRY),
+		safe_for_read(MODE_SENSE),
+		safe_for_read(MODE_SENSE_10),
+		safe_for_read(START_STOP),
+
+		/* Audio CD commands */
+		safe_for_read(GPCMD_PLAY_CD),
+		safe_for_read(GPCMD_PLAY_AUDIO_10),
+		safe_for_read(GPCMD_PLAY_AUDIO_MSF),
+		safe_for_read(GPCMD_PLAY_AUDIO_TI),
+
+		/* CD/DVD data reading */
+		safe_for_read(GPCMD_READ_CD),
+		safe_for_read(GPCMD_READ_CD_MSF),
+		safe_for_read(GPCMD_READ_DISC_INFO),
+		safe_for_read(GPCMD_READ_CDVD_CAPACITY),
+		safe_for_read(GPCMD_READ_DVD_STRUCTURE),
+		safe_for_read(GPCMD_READ_HEADER),
+		safe_for_read(GPCMD_READ_TRACK_RZONE_INFO),
+		safe_for_read(GPCMD_READ_SUBCHANNEL),
+		safe_for_read(GPCMD_READ_TOC_PMA_ATIP),
+		safe_for_read(GPCMD_REPORT_KEY),
+		safe_for_read(GPCMD_SCAN),
+
+		/* Basic writing commands */
+		safe_for_write(WRITE_6),
+		safe_for_write(WRITE_10),
+		safe_for_write(WRITE_VERIFY),
+		safe_for_write(WRITE_12),
+		safe_for_write(WRITE_VERIFY_12),
+		safe_for_write(WRITE_16),
+		safe_for_write(WRITE_BUFFER),
+		safe_for_write(WRITE_LONG),
+	};
+	unsigned char type = cmd_type[cmd[0]];
+
+	/* Anybody who can open the device can do a read-safe command */
+	if (type & CMD_READ_SAFE)
+		return 0;
+
+	/* Write-safe commands just require a writable open.. */
+	if (type & CMD_WRITE_SAFE) {
+		if (file->f_mode & FMODE_WRITE)
+			return 0;
+	}
+
+	/* And root can do any command.. */
+	if (capable(CAP_SYS_RAWIO))
+		return 0;
+
+	/* Otherwise fail it with an "Operation not permitted" */
+	return -EPERM;
+}
+
+static int sg_io(struct file *file, request_queue_t *q,
+		struct gendisk *bd_disk, struct sg_io_hdr *hdr)
 {
 	unsigned long start_time;
 	int reading, writing;
@@ -121,6 +193,8 @@ static int sg_io(request_queue_t *q, struct gendisk *bd_disk,
 		return -EINVAL;
 	if (copy_from_user(cmd, hdr->cmdp, hdr->cmd_len))
 		return -EFAULT;
+	if (verify_command(file, cmd))
+		return -EPERM;
 
 	/*
 	 * we'll do that later
@@ -170,6 +244,13 @@ static int sg_io(request_queue_t *q, struct gendisk *bd_disk,
 	rq->flags |= REQ_BLOCK_PC;
 	bio = rq->bio;
 
+	/*
+	 * bounce this after holding a reference to the original bio, it's
+	 * needed for proper unmapping
+	 */
+	if (rq->bio)
+		blk_queue_bounce(q, &rq->bio);
+
 	rq->timeout = (hdr->timeout * HZ) / 1000;
 	if (!rq->timeout)
 		rq->timeout = q->sg_timeout;
@@ -204,7 +285,7 @@ static int sg_io(request_queue_t *q, struct gendisk *bd_disk,
 			hdr->sb_len_wr = len;
 	}
 
-	if (blk_rq_unmap_user(rq, hdr->dxferp, bio, hdr->dxfer_len))
+	if (blk_rq_unmap_user(rq, bio, hdr->dxfer_len))
 		return -EFAULT;
 
 	/* may not have succeeded, but output values written to control
@@ -219,8 +300,8 @@ static int sg_io(request_queue_t *q, struct gendisk *bd_disk,
 #define READ_DEFECT_DATA_TIMEOUT	(60 * HZ )
 #define OMAX_SB_LEN 16          /* For backward compatibility */
 
-static int sg_scsi_ioctl(request_queue_t *q, struct gendisk *bd_disk,
-			 Scsi_Ioctl_Command __user *sic)
+static int sg_scsi_ioctl(struct file *file, request_queue_t *q,
+			 struct gendisk *bd_disk, Scsi_Ioctl_Command __user *sic)
 {
 	struct request *rq;
 	int err, in_len, out_len, bytes, opcode, cmdlen;
@@ -262,6 +343,10 @@ static int sg_scsi_ioctl(request_queue_t *q, struct gendisk *bd_disk,
 	if (copy_from_user(buffer, sic->data + cmdlen, in_len))
 		goto error;
 
+	err = verify_command(file, rq->cmd);
+	if (err)
+		goto error;
+
 	switch (opcode) {
 		case SEND_DIAGNOSTIC:
 		case FORMAT_UNIT:
@@ -312,7 +397,7 @@ error:
 	return err;
 }
 
-int scsi_cmd_ioctl(struct gendisk *bd_disk, unsigned int cmd, void __user *arg)
+int scsi_cmd_ioctl(struct file *file, struct gendisk *bd_disk, unsigned int cmd, void __user *arg)
 {
 	request_queue_t *q;
 	struct request *rq;
@@ -359,7 +444,7 @@ int scsi_cmd_ioctl(struct gendisk *bd_disk, unsigned int cmd, void __user *arg)
 			err = -EFAULT;
 			if (copy_from_user(&hdr, arg, sizeof(hdr)))
 				break;
-			err = sg_io(q, bd_disk, &hdr);
+			err = sg_io(file, q, bd_disk, &hdr);
 			if (err == -EFAULT)
 				break;
 
@@ -407,7 +492,7 @@ int scsi_cmd_ioctl(struct gendisk *bd_disk, unsigned int cmd, void __user *arg)
 			hdr.cmdp = ((struct cdrom_generic_command __user*) arg)->cmd;
 			hdr.cmd_len = sizeof(cgc.cmd);
 
-			err = sg_io(q, bd_disk, &hdr);
+			err = sg_io(file, q, bd_disk, &hdr);
 			if (err == -EFAULT)
 				break;
 
@@ -430,7 +515,7 @@ int scsi_cmd_ioctl(struct gendisk *bd_disk, unsigned int cmd, void __user *arg)
 			if (!arg)
 				break;
 
-			err = sg_scsi_ioctl(q, bd_disk, arg);
+			err = sg_scsi_ioctl(file, q, bd_disk, arg);
 			break;
 		case CDROMCLOSETRAY:
 			close = 1;
diff --git a/drivers/block/swim3.c b/drivers/block/swim3.c
index 73554d3fe..ca17d8373 100644
--- a/drivers/block/swim3.c
+++ b/drivers/block/swim3.c
@@ -1058,6 +1058,7 @@ int swim3_init(void)
 		disk->fops = &floppy_fops;
 		disk->private_data = &floppy_states[i];
 		disk->queue = swim3_queue;
+		disk->flags |= GENHD_FL_REMOVABLE;
 		sprintf(disk->disk_name, "fd%d", i);
 		sprintf(disk->devfs_name, "floppy/%d", i);
 		set_capacity(disk, 2880);
diff --git a/drivers/block/viodasd.c b/drivers/block/viodasd.c
index fdac6e366..9534c740e 100644
--- a/drivers/block/viodasd.c
+++ b/drivers/block/viodasd.c
@@ -68,7 +68,7 @@ MODULE_LICENSE("GPL");
 
 enum {
 	PARTITION_SHIFT = 3,
-	MAX_DISKNO = 32,
+	MAX_DISKNO = HVMAXARCHITECTEDVIRTUALDISKS,
 	MAX_DISK_NAME = sizeof(((struct gendisk *)0)->disk_name)
 };
 
@@ -168,6 +168,7 @@ struct viodasd_device {
 	int		read_only;
 	spinlock_t	q_lock;
 	struct gendisk	*disk;
+	struct device	*dev;
 } viodasd_devices[MAX_DISKNO];
 
 /*
@@ -342,7 +343,7 @@ static int send_request(struct request *req)
 
 	/* Now build the scatter-gather list */
 	nsg = blk_rq_map_sg(req->q, req, sg);
-	nsg = dma_map_sg(iSeries_vio_dev, sg, nsg, direction);
+	nsg = dma_map_sg(d->dev, sg, nsg, direction);
 
 	spin_lock_irqsave(&viodasd_spinlock, flags);
 	num_req_outstanding++;
@@ -422,7 +423,7 @@ static int send_request(struct request *req)
 error_ret:
 	num_req_outstanding--;
 	spin_unlock_irqrestore(&viodasd_spinlock, flags);
-	dma_unmap_sg(iSeries_vio_dev, sg, nsg, direction);
+	dma_unmap_sg(d->dev, sg, nsg, direction);
 	return -1;
 }
 
@@ -557,6 +558,7 @@ retry:
 	g->fops = &viodasd_fops;
 	g->queue = q;
 	g->private_data = d;
+	g->driverfs_dev = d->dev;
 	set_capacity(g, d->size >> 9);
 
 	printk(VIOD_KERN_INFO "disk %d: %lu sectors (%lu MB) "
@@ -623,7 +625,7 @@ static int viodasd_handle_read_write(struct vioblocklpevent *bevent)
 	struct scatterlist sg[VIOMAXBLOCKDMA];
 	struct HvLpEvent *event = &bevent->event;
 	unsigned long irq_flags;
-	int device_no;
+	struct viodasd_device *d;
 	int error;
 	spinlock_t *qlock;
 
@@ -633,7 +635,10 @@ static int viodasd_handle_read_write(struct vioblocklpevent *bevent)
 		pci_direction = DMA_FROM_DEVICE;
 	else
 		pci_direction = DMA_TO_DEVICE;
-	dma_unmap_sg(iSeries_vio_dev, sg, num_sg, pci_direction);
+	req = (struct request *)bevent->event.xCorrelationToken;
+	d = req->rq_disk->private_data;
+
+	dma_unmap_sg(d->dev, sg, num_sg, pci_direction);
 
 	/*
 	 * Since this is running in interrupt mode, we need to make sure
@@ -643,9 +648,6 @@ static int viodasd_handle_read_write(struct vioblocklpevent *bevent)
 	num_req_outstanding--;
 	spin_unlock_irqrestore(&viodasd_spinlock, irq_flags);
 
-	req = (struct request *)bevent->event.xCorrelationToken;
-	device_no = DEVICE_NO(req->rq_disk->private_data);
-
 	error = event->xRc != HvLpEvent_Rc_Good;
 	if (error) {
 		const struct vio_error_entry *err;
@@ -660,7 +662,7 @@ static int viodasd_handle_read_write(struct vioblocklpevent *bevent)
 	spin_unlock_irqrestore(qlock, irq_flags);
 
 	/* Finally, try to get more requests off of this device's queue */
-	viodasd_restart_all_queues_starting_from(device_no);
+	viodasd_restart_all_queues_starting_from(DEVICE_NO(d));
 
 	return 0;
 }
@@ -742,10 +744,49 @@ static ssize_t probe_disks(struct device_driver *drv, const char *buf,
 	}
 	return count;
 }
-static DRIVER_ATTR(probe, S_IWUSR, NULL, probe_disks)
+static DRIVER_ATTR(probe, S_IWUSR, NULL, probe_disks);
+
+static int viodasd_probe(struct vio_dev *vdev, const struct vio_device_id *id)
+{
+	struct viodasd_device *d = &viodasd_devices[vdev->unit_address];
+
+	d->dev = &vdev->dev;
+	probe_disk(d);
+	if (d->disk == NULL)
+		return -ENODEV;
+	return 0;
+}
+
+static int viodasd_remove(struct vio_dev *vdev)
+{
+	struct viodasd_device *d;
+
+	d = &viodasd_devices[vdev->unit_address];
+	if (d->disk) {
+		del_gendisk(d->disk);
+		put_disk(d->disk);
+		blk_cleanup_queue(d->disk->queue);
+		d->disk = NULL;
+	}
+	d->dev = NULL;
+	return 0;
+}
+
+/**
+ * viodasd_device_table: Used by vio.c to match devices that we
+ * support.
+ */
+static struct vio_device_id viodasd_device_table[] __devinitdata = {
+	{ "viodasd", "" },
+	{ 0, }
+};
 
+MODULE_DEVICE_TABLE(vio, viodasd_device_table);
 static struct vio_driver viodasd_driver = {
-	.name = "viodasd"
+	.name = "viodasd",
+	.id_table = viodasd_device_table,
+	.probe = viodasd_probe,
+	.remove = viodasd_remove
 };
 
 /*
@@ -754,7 +795,7 @@ static struct vio_driver viodasd_driver = {
  */
 static int __init viodasd_init(void)
 {
-	int i;
+	int rc;
 
 	/* Try to open to our host lp */
 	if (viopath_hostLp == HvLpIndexInvalid)
@@ -788,33 +829,17 @@ static int __init viodasd_init(void)
 	/* Initialize our request handler */
 	vio_setHandler(viomajorsubtype_blockio, handle_block_event);
 
-	for (i = 0; i < MAX_DISKNO; i++)
-		probe_disk(&viodasd_devices[i]);
-
-	vio_register_driver(&viodasd_driver);	/* FIX ME - error checking */
-	driver_create_file(&viodasd_driver.driver, &driver_attr_probe);
-
-	return 0;
+	rc = vio_register_driver(&viodasd_driver);
+	if (rc == 0)
+		driver_create_file(&viodasd_driver.driver, &driver_attr_probe);
+	return rc;
 }
 module_init(viodasd_init);
 
 void viodasd_exit(void)
 {
-	int i;
-	struct viodasd_device *d;
-
 	driver_remove_file(&viodasd_driver.driver, &driver_attr_probe);
 	vio_unregister_driver(&viodasd_driver);
-
-        for (i = 0; i < MAX_DISKNO; i++) {
-		d = &viodasd_devices[i];
-		if (d->disk) {
-			del_gendisk(d->disk);
-			put_disk(d->disk);
-			blk_cleanup_queue(d->disk->queue);
-			d->disk = NULL;
-		}
-	}
 	vio_clearHandler(viomajorsubtype_blockio);
 	unregister_blkdev(VIODASD_MAJOR, VIOD_GENHD_NAME);
 	viopath_close(viopath_hostLp, viomajorsubtype_blockio, VIOMAXREQ + 2);
diff --git a/drivers/block/xd.c b/drivers/block/xd.c
index 1fd72e005..5ca834fcd 100644
--- a/drivers/block/xd.c
+++ b/drivers/block/xd.c
@@ -96,7 +96,7 @@ XD_INFO xd_info[XD_MAXDRIVES];
 #include <asm/page.h>
 #define xd_dma_mem_alloc(size) __get_dma_pages(GFP_KERNEL,get_order(size))
 #define xd_dma_mem_free(addr, size) free_pages(addr, get_order(size))
-static char *xd_dma_buffer = 0;
+static char *xd_dma_buffer;
 
 static XD_SIGNATURE xd_sigs[] __initdata = {
 	{ 0x0000,"Override geometry handler",NULL,xd_override_init_drive,"n unknown" }, /* Pat Mackinlay, pat@it.com.au */
@@ -344,7 +344,7 @@ static int xd_ioctl (struct inode *inode,struct file *file,u_int cmd,u_long arg)
 			if (nodma && xd_dma_buffer) {
 				xd_dma_mem_free((unsigned long)xd_dma_buffer,
 						xd_maxsectors * 0x200);
-				xd_dma_buffer = 0;
+				xd_dma_buffer = NULL;
 			} else if (!nodma && !xd_dma_buffer) {
 				xd_dma_buffer = (char *)xd_dma_mem_alloc(xd_maxsectors * 0x200);
 				if (!xd_dma_buffer) {
@@ -448,7 +448,7 @@ static void xd_recalibrate (u_char drive)
 	u_char cmdblk[6];
 	
 	xd_build(cmdblk,CMD_RECALIBRATE,drive,0,0,0,0,0);
-	if (xd_command(cmdblk,PIO_MODE,0,0,0,XD_TIMEOUT * 8))
+	if (xd_command(cmdblk,PIO_MODE,NULL,NULL,NULL,XD_TIMEOUT * 8))
 		printk("xd%c: warning! error recalibrating, controller may be unstable\n", 'a'+drive);
 }
 
@@ -607,7 +607,7 @@ static u_int xd_command (u_char *command,u_char mode,u_char *indata,u_char *outd
 
 	if (csb & CSB_ERROR) {									/* read sense data if error */
 		xd_build(cmdblk,CMD_SENSE,(csb & CSB_LUN) >> 5,0,0,0,0,0);
-		if (xd_command(cmdblk,0,sense,0,0,XD_TIMEOUT))
+		if (xd_command(cmdblk,0,sense,NULL,NULL,XD_TIMEOUT))
 			printk("xd: warning! sense command failed!\n");
 	}
 
@@ -624,7 +624,7 @@ static u_char __init xd_initdrives (void (*init_drive)(u_char drive))
 
 	for (i = 0; i < XD_MAXDRIVES; i++) {
 		xd_build(cmdblk,CMD_TESTREADY,i,0,0,0,0,0);
-		if (!xd_command(cmdblk,PIO_MODE,0,0,0,XD_TIMEOUT * 8)) {
+		if (!xd_command(cmdblk,PIO_MODE,NULL,NULL,NULL,XD_TIMEOUT*8)) {
 			set_current_state(TASK_INTERRUPTIBLE);
 			schedule_timeout(XD_INIT_DISK_DELAY);
 
@@ -714,7 +714,7 @@ static void __init xd_dtc_init_drive (u_char drive)
 	u_char cmdblk[6],buf[64];
 
 	xd_build(cmdblk,CMD_DTCGETGEOM,drive,0,0,0,0,0);
-	if (!xd_command(cmdblk,PIO_MODE,buf,0,0,XD_TIMEOUT * 2)) {
+	if (!xd_command(cmdblk,PIO_MODE,buf,NULL,NULL,XD_TIMEOUT * 2)) {
 		xd_info[drive].heads = buf[0x0A];			/* heads */
 		xd_info[drive].cylinders = ((u_short *) (buf))[0x04];	/* cylinders */
 		xd_info[drive].sectors = 17;				/* sectors */
@@ -729,7 +729,7 @@ static void __init xd_dtc_init_drive (u_char drive)
 
 		xd_setparam(CMD_DTCSETPARAM,drive,xd_info[drive].heads,xd_info[drive].cylinders,((u_short *) (buf + 1))[0x05],((u_short *) (buf + 1))[0x06],buf[0x0F]);
 		xd_build(cmdblk,CMD_DTCSETSTEP,drive,0,0,0,0,7);
-		if (xd_command(cmdblk,PIO_MODE,0,0,0,XD_TIMEOUT * 2))
+		if (xd_command(cmdblk,PIO_MODE,NULL,NULL,NULL,XD_TIMEOUT * 2))
 			printk("xd_dtc_init_drive: error setting step rate for xd%c\n", 'a'+drive);
 	}
 	else
@@ -785,7 +785,7 @@ static void __init xd_wd_init_drive (u_char drive)
 		xd_irq = 9;
 	rll = (jumper_state & 0x30) ? (0x04 << wd_1002) : 0;
 	xd_build(cmdblk,CMD_READ,drive,0,0,0,1,0);
-	if (!xd_command(cmdblk,PIO_MODE,buf,0,0,XD_TIMEOUT * 2)) {
+	if (!xd_command(cmdblk,PIO_MODE,buf,NULL,NULL,XD_TIMEOUT * 2)) {
 		xd_info[drive].heads = buf[0x1AF];				/* heads */
 		xd_info[drive].cylinders = ((u_short *) (buf + 1))[0xD6];	/* cylinders */
 		xd_info[drive].sectors = 17;					/* sectors */
@@ -862,7 +862,7 @@ static void __init xd_seagate_init_drive (u_char drive)
 	u_char cmdblk[6],buf[0x200];
 
 	xd_build(cmdblk,CMD_ST11GETGEOM,drive,0,0,0,1,0);
-	if (!xd_command(cmdblk,PIO_MODE,buf,0,0,XD_TIMEOUT * 2)) {
+	if (!xd_command(cmdblk,PIO_MODE,buf,NULL,NULL,XD_TIMEOUT * 2)) {
 		xd_info[drive].heads = buf[0x04];				/* heads */
 		xd_info[drive].cylinders = (buf[0x02] << 8) | buf[0x03];	/* cylinders */
 		xd_info[drive].sectors = buf[0x05];				/* sectors */
@@ -987,7 +987,7 @@ static void __init xd_override_init_drive (u_char drive)
 			while (min[i] != max[i] - 1) {
 				test[i] = (min[i] + max[i]) / 2;
 				xd_build(cmdblk,CMD_SEEK,drive,(u_char) test[0],(u_short) test[1],(u_char) test[2],0,0);
-				if (!xd_command(cmdblk,PIO_MODE,0,0,0,XD_TIMEOUT * 2))
+				if (!xd_command(cmdblk,PIO_MODE,NULL,NULL,NULL,XD_TIMEOUT * 2))
 					min[i] = test[i];
 				else
 					max[i] = test[i];
@@ -1039,7 +1039,7 @@ static void __init xd_setparam (u_char command,u_char drive,u_char heads,u_short
 
 	/* Some controllers require geometry info as data, not command */
 
-	if (xd_command(cmdblk,PIO_MODE,0,&cmdblk[6],0,XD_TIMEOUT * 2))
+	if (xd_command(cmdblk,PIO_MODE,NULL,&cmdblk[6],NULL,XD_TIMEOUT * 2))
 		printk("xd: error setting characteristics for xd%c\n", 'a'+drive);
 }
 
diff --git a/drivers/bluetooth/bfusb.c b/drivers/bluetooth/bfusb.c
index 45e35bc21..79ff338e9 100644
--- a/drivers/bluetooth/bfusb.c
+++ b/drivers/bluetooth/bfusb.c
@@ -585,6 +585,8 @@ static int bfusb_load_firmware(struct bfusb *bfusb, unsigned char *firmware, int
 		return -EBUSY;
 	}
 
+	bfusb->udev->toggle[0] = bfusb->udev->toggle[1] = 0;
+
 	buf = kmalloc(BFUSB_MAX_BLOCK_SIZE + 3, GFP_ATOMIC);
 	if (!buf) {
 		BT_ERR("Can't allocate memory chunk for firmware");
@@ -624,6 +626,8 @@ static int bfusb_load_firmware(struct bfusb *bfusb, unsigned char *firmware, int
 		goto error;
 	}
 
+	bfusb->udev->toggle[0] = bfusb->udev->toggle[1] = 0;
+
 	BT_INFO("BlueFRITZ! USB device ready");
 
 	kfree(buf);
diff --git a/drivers/bluetooth/bluecard_cs.c b/drivers/bluetooth/bluecard_cs.c
index 4e146b366..54ef5f941 100644
--- a/drivers/bluetooth/bluecard_cs.c
+++ b/drivers/bluetooth/bluecard_cs.c
@@ -28,6 +28,7 @@
 #include <linux/slab.h>
 #include <linux/types.h>
 #include <linux/sched.h>
+#include <linux/delay.h>
 #include <linux/timer.h>
 #include <linux/errno.h>
 #include <linux/ptrace.h>
@@ -776,8 +777,7 @@ int bluecard_open(bluecard_info_t *info)
 	outb(0x80, iobase + 0x30);
 
 	/* Wait some time */
-	set_current_state(TASK_INTERRUPTIBLE);
-	schedule_timeout(HZ / 100);
+	msleep(10);
 
 	/* Turn FPGA on */
 	outb(0x00, iobase + 0x30);
@@ -823,8 +823,7 @@ int bluecard_open(bluecard_info_t *info)
 	outb((0x0f << RTS_LEVEL_SHIFT_BITS) | 1, iobase + REG_RX_CONTROL);
 
 	/* Timeout before it is safe to send the first HCI packet */
-	set_current_state(TASK_INTERRUPTIBLE);
-	schedule_timeout((HZ * 5) / 4);		// or set it to 3/2
+	msleep(1250);
 
 	/* Register HCI device */
 	if (hci_register_dev(hdev) < 0) {
diff --git a/drivers/bluetooth/bt3c_cs.c b/drivers/bluetooth/bt3c_cs.c
index 5aa5cd3a2..d67d0385f 100644
--- a/drivers/bluetooth/bt3c_cs.c
+++ b/drivers/bluetooth/bt3c_cs.c
@@ -25,12 +25,11 @@
 #include <linux/module.h>
 
 #include <linux/kernel.h>
-#include <linux/kmod.h>
 #include <linux/init.h>
 #include <linux/slab.h>
-#include <linux/delay.h>
 #include <linux/types.h>
 #include <linux/sched.h>
+#include <linux/delay.h>
 #include <linux/errno.h>
 #include <linux/ptrace.h>
 #include <linux/ioport.h>
@@ -194,10 +193,8 @@ static int bt3c_write(unsigned int iobase, int fifo_size, __u8 *buf, int len)
 }
 
 
-static void bt3c_write_wakeup(bt3c_info_t *info, int from)
+static void bt3c_write_wakeup(bt3c_info_t *info)
 {
-	unsigned long flags;
-
 	if (!info) {
 		BT_ERR("Unknown device");
 		return;
@@ -206,8 +203,6 @@ static void bt3c_write_wakeup(bt3c_info_t *info, int from)
 	if (test_and_set_bit(XMIT_SENDING, &(info->tx_state)))
 		return;
 
-	spin_lock_irqsave(&(info->lock), flags);
-
 	do {
 		register unsigned int iobase = info->link.io.BasePort1;
 		register struct sk_buff *skb;
@@ -234,8 +229,6 @@ static void bt3c_write_wakeup(bt3c_info_t *info, int from)
 		info->hdev->stat.byte_tx += len;
 
 	} while (0);
-
-	spin_unlock_irqrestore(&(info->lock), flags);
 }
 
 
@@ -391,7 +384,7 @@ static irqreturn_t bt3c_interrupt(int irq, void *dev_inst, struct pt_regs *regs)
 			if (stat & 0x0002) {
 				//BT_ERR("Ack (stat=0x%04x)", stat);
 				clear_bit(XMIT_SENDING, &(info->tx_state));
-				bt3c_write_wakeup(info, 1);
+				bt3c_write_wakeup(info);
 			}
 
 			bt3c_io_write(iobase, 0x7001, 0x0000);
@@ -444,6 +437,7 @@ static int bt3c_hci_send_frame(struct sk_buff *skb)
 {
 	bt3c_info_t *info;
 	struct hci_dev *hdev = (struct hci_dev *)(skb->dev);
+	unsigned long flags;
 
 	if (!hdev) {
 		BT_ERR("Frame for unknown HCI device (hdev=NULL)");
@@ -468,7 +462,11 @@ static int bt3c_hci_send_frame(struct sk_buff *skb)
 	memcpy(skb_push(skb, 1), &(skb->pkt_type), 1);
 	skb_queue_tail(&(info->txq), skb);
 
-	bt3c_write_wakeup(info, 0);
+	spin_lock_irqsave(&(info->lock), flags);
+
+	bt3c_write_wakeup(info);
+
+	spin_unlock_irqrestore(&(info->lock), flags);
 
 	return 0;
 }
@@ -489,12 +487,19 @@ static int bt3c_hci_ioctl(struct hci_dev *hdev, unsigned int cmd, unsigned long
 /* ======================== Card services HCI interaction ======================== */
 
 
-static struct device bt3c_device = {
-	.bus_id = "pcmcia",
-	.kobj = {
-		.k_name = "bt3c"
-	}
-};
+static struct device *bt3c_device(void)
+{
+	static char *kobj_name = "bt3c";
+
+	static struct device dev = {
+		.bus_id = "pcmcia",
+	};
+	dev.kobj.k_name = kmalloc(strlen(kobj_name) + 1, GFP_KERNEL);
+	strcpy(dev.kobj.k_name, kobj_name);
+	kobject_init(&dev.kobj);
+
+	return &dev;
+}
 
 
 static int bt3c_load_firmware(bt3c_info_t *info, unsigned char *firmware, int count)
@@ -617,7 +622,7 @@ int bt3c_open(bt3c_info_t *info)
 	hdev->owner = THIS_MODULE;
 
 	/* Load firmware */
-	err = request_firmware(&firmware, "BT3CPCC.bin", &bt3c_device);
+	err = request_firmware(&firmware, "BT3CPCC.bin", bt3c_device());
 	if (err < 0) {
 		BT_ERR("Firmware request failed");
 		goto error;
@@ -633,8 +638,7 @@ int bt3c_open(bt3c_info_t *info)
 	}
 
 	/* Timeout before it is safe to send the first HCI packet */
-	set_current_state(TASK_INTERRUPTIBLE);
-	schedule_timeout(HZ);
+	msleep(1000);
 
 	/* Register HCI device */
 	err = hci_register_dev(hdev);
diff --git a/drivers/bluetooth/btuart_cs.c b/drivers/bluetooth/btuart_cs.c
index a18be62b0..b44fa7dd3 100644
--- a/drivers/bluetooth/btuart_cs.c
+++ b/drivers/bluetooth/btuart_cs.c
@@ -28,6 +28,7 @@
 #include <linux/slab.h>
 #include <linux/types.h>
 #include <linux/sched.h>
+#include <linux/delay.h>
 #include <linux/errno.h>
 #include <linux/ptrace.h>
 #include <linux/ioport.h>
@@ -545,8 +546,7 @@ int btuart_open(btuart_info_t *info)
 	btuart_change_speed(info, DEFAULT_BAUD_RATE);
 
 	/* Timeout before it is safe to send the first HCI packet */
-	set_current_state(TASK_INTERRUPTIBLE);
-	schedule_timeout(HZ);
+	msleep(1000);
 
 	/* Register HCI device */
 	if (hci_register_dev(hdev) < 0) {
diff --git a/drivers/bluetooth/dtl1_cs.c b/drivers/bluetooth/dtl1_cs.c
index f3b423b09..79ec1ce78 100644
--- a/drivers/bluetooth/dtl1_cs.c
+++ b/drivers/bluetooth/dtl1_cs.c
@@ -28,6 +28,7 @@
 #include <linux/slab.h>
 #include <linux/types.h>
 #include <linux/sched.h>
+#include <linux/delay.h>
 #include <linux/errno.h>
 #include <linux/ptrace.h>
 #include <linux/ioport.h>
@@ -524,8 +525,7 @@ int dtl1_open(dtl1_info_t *info)
 	spin_unlock_irqrestore(&(info->lock), flags);
 
 	/* Timeout before it is safe to send the first HCI packet */
-	set_current_state(TASK_INTERRUPTIBLE);
-	schedule_timeout(HZ * 2);
+	msleep(2000);
 
 	/* Register HCI device */
 	if (hci_register_dev(hdev) < 0) {
diff --git a/drivers/bluetooth/hci_bcsp.c b/drivers/bluetooth/hci_bcsp.c
index ab3c28d49..4d1f7ea9c 100644
--- a/drivers/bluetooth/hci_bcsp.c
+++ b/drivers/bluetooth/hci_bcsp.c
@@ -633,7 +633,8 @@ static void bcsp_timed_event(unsigned long arg)
 	struct sk_buff *skb;
 	unsigned long flags;
 
-	BT_ERR("Timeout, retransmitting %u pkts", bcsp->unack.qlen);
+	BT_DBG("hu %p retransmitting %u pkts", hu, bcsp->unack.qlen);
+
 	spin_lock_irqsave(&bcsp->unack.lock, flags);
 
 	while ((skb = __skb_dequeue_tail(&bcsp->unack)) != NULL) {
diff --git a/drivers/bluetooth/hci_usb.c b/drivers/bluetooth/hci_usb.c
index 1874debfa..9babb21df 100644
--- a/drivers/bluetooth/hci_usb.c
+++ b/drivers/bluetooth/hci_usb.c
@@ -65,7 +65,7 @@
 #define URB_ZERO_PACKET 0
 #endif
 
-#define VERSION "2.6"
+#define VERSION "2.7"
 
 static struct usb_driver hci_usb_driver; 
 
@@ -76,14 +76,15 @@ static struct usb_device_id bluetooth_ids[] = {
 	/* AVM BlueFRITZ! USB v2.0 */
 	{ USB_DEVICE(0x057c, 0x3800) },
 
-	/* Ericsson with non-standard id */
-	{ USB_DEVICE(0x0bdb, 0x1002) },
+	/* Bluetooth Ultraport Module from IBM */
+	{ USB_DEVICE(0x04bf, 0x030a) },
 
-	/* ALPS Module with non-standard id */
+	/* ALPS Modules with non-standard id */
+	{ USB_DEVICE(0x044e, 0x3001) },
 	{ USB_DEVICE(0x044e, 0x3002) },
 
-	/* Bluetooth Ultraport Module from IBM */
-	{ USB_DEVICE(0x04bf, 0x030a) },
+	/* Ericsson with non-standard id */
+	{ USB_DEVICE(0x0bdb, 0x1002) },
 
 	{ }	/* Terminating entry */
 };
@@ -97,6 +98,9 @@ static struct usb_device_id blacklist_ids[] = {
 	/* Broadcom BCM2035 */
 	{ USB_DEVICE(0x0a5c, 0x200a), .driver_info = HCI_RESET },
 
+	/* ISSC Bluetooth Adapter v3.1 */
+	{ USB_DEVICE(0x1131, 0x1001), .driver_info = HCI_RESET },
+
 	/* Digianswer device */
 	{ USB_DEVICE(0x08fd, 0x0001), .driver_info = HCI_DIGIANSWER },
 
@@ -338,26 +342,18 @@ static int hci_usb_flush(struct hci_dev *hdev)
 
 	BT_DBG("%s", hdev->name);
 
-	for (i=0; i < 4; i++)
+	for (i = 0; i < 4; i++)
 		skb_queue_purge(&husb->transmit_q[i]);
 	return 0;
 }
 
-static inline void hci_usb_wait_for_urb(struct urb *urb)
-{
-	while (atomic_read(&urb->kref.refcount) > 1) {
-		current->state = TASK_UNINTERRUPTIBLE;
-		schedule_timeout((5 * HZ + 999) / 1000);
-	}
-}
-
 static void hci_usb_unlink_urbs(struct hci_usb *husb)
 {
 	int i;
 
 	BT_DBG("%s", husb->hdev->name);
 
-	for (i=0; i < 4; i++) {
+	for (i = 0; i < 4; i++) {
 		struct _urb *_urb;
 		struct urb *urb;
 
@@ -366,8 +362,7 @@ static void hci_usb_unlink_urbs(struct hci_usb *husb)
 			urb = &_urb->urb;
 			BT_DBG("%s unlinking _urb %p type %d urb %p", 
 					husb->hdev->name, _urb, _urb->type, urb);
-			usb_unlink_urb(urb);
-			hci_usb_wait_for_urb(urb);
+			usb_kill_urb(urb);
 			_urb_queue_tail(__completed_q(husb, _urb->type), _urb);
 		}
 
diff --git a/drivers/bluetooth/hci_vhci.c b/drivers/bluetooth/hci_vhci.c
index 9faa8a08a..d1df4adff 100644
--- a/drivers/bluetooth/hci_vhci.c
+++ b/drivers/bluetooth/hci_vhci.c
@@ -302,7 +302,7 @@ static int hci_vhci_chr_open(struct inode *inode, struct file * file)
 	}
 
 	file->private_data = hci_vhci;
-	return 0;   
+	return nonseekable_open(inode, file);   
 }
 
 static int hci_vhci_chr_close(struct inode *inode, struct file *file)
diff --git a/drivers/cdrom/aztcd.c b/drivers/cdrom/aztcd.c
index 97ab1b33f..b6a14c80e 100644
--- a/drivers/cdrom/aztcd.c
+++ b/drivers/cdrom/aztcd.c
@@ -129,7 +129,7 @@
                 Werner Zimmermann, August 8, 1995
         V1.70   Multisession support now is completed, but there is still not 
                 enough testing done. If you can test it, please contact me. For
-                details please read /usr/src/linux/Documentation/cdrom/aztcd
+                details please read Documentation/cdrom/aztcd
                 Werner Zimmermann, August 19, 1995
         V1.80   Modification to suit the new kernel boot procedure introduced
                 with kernel 1.3.33. Will definitely not work with older kernels.
diff --git a/drivers/cdrom/cdrom.c b/drivers/cdrom/cdrom.c
index d82006ca7..2e1ee63d1 100644
--- a/drivers/cdrom/cdrom.c
+++ b/drivers/cdrom/cdrom.c
@@ -508,6 +508,8 @@ int cdrom_is_mrw(struct cdrom_device_info *cdi, int *write)
 	unsigned char buffer[16];
 	int ret;
 
+	*write = 0;
+
 	init_cdrom_command(&cgc, buffer, sizeof(buffer), CGC_DATA_READ);
 
 	cgc.cmd[0] = GPCMD_GET_CONFIGURATION;
@@ -521,8 +523,10 @@ int cdrom_is_mrw(struct cdrom_device_info *cdi, int *write)
 	mfd = (struct mrw_feature_desc *)&buffer[sizeof(struct feature_header)];
 	*write = mfd->write;
 
-	if ((ret = cdrom_mrw_probe_pc(cdi)))
+	if ((ret = cdrom_mrw_probe_pc(cdi))) {
+		*write = 0;
 		return ret;
+	}
 
 	return 0;
 }
@@ -822,14 +826,39 @@ static int cdrom_ram_open_write(struct cdrom_device_info *cdi)
  */
 static int cdrom_open_write(struct cdrom_device_info *cdi)
 {
+	int mrw, mrw_write, ram_write;
 	int ret = 1;
 
+	mrw = 0;
+	if (!cdrom_is_mrw(cdi, &mrw_write))
+		mrw = 1;
+
+	if (CDROM_CAN(CDC_MO_DRIVE))
+		ram_write = 1;
+	else
+		(void) cdrom_is_random_writable(cdi, &ram_write);
+	
+	if (mrw)
+		cdi->mask &= ~CDC_MRW;
+	else
+		cdi->mask |= CDC_MRW;
+
+	if (mrw_write)
+		cdi->mask &= ~CDC_MRW_W;
+	else
+		cdi->mask |= CDC_MRW_W;
+
+	if (ram_write)
+		cdi->mask &= ~CDC_RAM;
+	else
+		cdi->mask |= CDC_RAM;
+
 	if (CDROM_CAN(CDC_MRW_W))
 		ret = cdrom_mrw_open_write(cdi);
 	else if (CDROM_CAN(CDC_DVD_RAM))
 		ret = cdrom_dvdram_open_write(cdi);
  	else if (CDROM_CAN(CDC_RAM) &&
- 		 !CDROM_CAN(CDC_CD_R|CDC_CD_RW|CDC_DVD|CDC_DVD_R|CDC_MRW))
+ 		 !CDROM_CAN(CDC_CD_R|CDC_CD_RW|CDC_DVD|CDC_DVD_R|CDC_MRW|CDC_MO_DRIVE))
  		ret = cdrom_ram_open_write(cdi);
 	else if (CDROM_CAN(CDC_MO_DRIVE))
 		ret = mo_open_write(cdi);
@@ -866,14 +895,17 @@ int cdrom_open(struct cdrom_device_info *cdi, struct inode *ip, struct file *fp)
 	if ((fp->f_flags & O_NONBLOCK) && (cdi->options & CDO_USE_FFLAGS)) {
 		ret = cdi->ops->open(cdi, 1);
 	} else {
+		ret = open_for_data(cdi);
+		if (ret)
+			goto err;
 		if (fp->f_mode & FMODE_WRITE) {
 			ret = -EROFS;
-			if (!CDROM_CAN(CDC_RAM))
-				goto err;
 			if (cdrom_open_write(cdi))
 				goto err;
+			if (!CDROM_CAN(CDC_RAM))
+				goto err;
+			ret = 0;
 		}
-		ret = open_for_data(cdi);
 	}
 
 	if (ret)
@@ -1448,6 +1480,7 @@ static int dvd_do_auth(struct cdrom_device_info *cdi, dvd_authinfo *ai)
 	/* LU data send */
 	case DVD_LU_SEND_AGID:
 		cdinfo(CD_DVD, "entering DVD_LU_SEND_AGID\n"); 
+		cgc.quiet = 1;
 		setup_report_key(&cgc, ai->lsa.agid, 0);
 
 		if ((ret = cdo->generic_packet(cdi, &cgc)))
@@ -1482,6 +1515,7 @@ static int dvd_do_auth(struct cdrom_device_info *cdi, dvd_authinfo *ai)
 	/* Post-auth key */
 	case DVD_LU_SEND_TITLE_KEY:
 		cdinfo(CD_DVD, "entering DVD_LU_SEND_TITLE_KEY\n"); 
+		cgc.quiet = 1;
 		setup_report_key(&cgc, ai->lstk.agid, 4);
 		cgc.cmd[5] = ai->lstk.lba;
 		cgc.cmd[4] = ai->lstk.lba >> 8;
@@ -1890,6 +1924,8 @@ static int cdrom_read_cdda_old(struct cdrom_device_info *cdi, __u8 __user *ubuf,
 	struct packet_command cgc;
 	int nr, ret;
 
+	cdi->last_sense = 0;
+
 	memset(&cgc, 0, sizeof(cgc));
 
 	/*
@@ -1941,6 +1977,8 @@ static int cdrom_read_cdda_bpc(struct cdrom_device_info *cdi, __u8 __user *ubuf,
 	if (!q)
 		return -ENXIO;
 
+	cdi->last_sense = 0;
+
 	while (nframes) {
 		nr = nframes;
 		if (cdi->cdda_method == CDDA_BPC_SINGLE)
@@ -1971,13 +2009,16 @@ static int cdrom_read_cdda_bpc(struct cdrom_device_info *cdi, __u8 __user *ubuf,
 		rq->timeout = 60 * HZ;
 		bio = rq->bio;
 
+		if (rq->bio)
+			blk_queue_bounce(q, &rq->bio);
+
 		if (blk_execute_rq(q, cdi->disk, rq)) {
 			struct request_sense *s = rq->sense;
 			ret = -EIO;
 			cdi->last_sense = s->sense_key;
 		}
 
-		if (blk_rq_unmap_user(rq, ubuf, bio, len))
+		if (blk_rq_unmap_user(rq, bio, len))
 			ret = -EFAULT;
 
 		if (ret)
@@ -1985,6 +2026,7 @@ static int cdrom_read_cdda_bpc(struct cdrom_device_info *cdi, __u8 __user *ubuf,
 
 		nframes -= nr;
 		lba += nr;
+		ubuf += len;
 	}
 
 	return ret;
@@ -2033,14 +2075,14 @@ retry:
  * these days. ATAPI / SCSI specific code now mainly resides in
  * mmc_ioct().
  */
-int cdrom_ioctl(struct cdrom_device_info *cdi, struct inode *ip,
-		unsigned int cmd, unsigned long arg)
+int cdrom_ioctl(struct file * file, struct cdrom_device_info *cdi,
+		struct inode *ip, unsigned int cmd, unsigned long arg)
 {
 	struct cdrom_device_ops *cdo = cdi->ops;
 	int ret;
 
 	/* Try the generic SCSI command ioctl's first.. */
-	ret = scsi_cmd_ioctl(ip->i_bdev->bd_disk, cmd, (void __user *)arg);
+	ret = scsi_cmd_ioctl(file, ip->i_bdev->bd_disk, cmd, (void __user *)arg);
 	if (ret != -ENOTTY)
 		return ret;
 
@@ -2894,13 +2936,13 @@ struct cdrom_sysctl_settings {
 } cdrom_sysctl_settings;
 
 int cdrom_sysctl_info(ctl_table *ctl, int write, struct file * filp,
-                           void __user *buffer, size_t *lenp)
+                           void __user *buffer, size_t *lenp, loff_t *ppos)
 {
         int pos;
 	struct cdrom_device_info *cdi;
 	char *info = cdrom_sysctl_settings.info;
 	
-	if (!*lenp || (filp->f_pos && !write)) {
+	if (!*lenp || (*ppos && !write)) {
 		*lenp = 0;
 		return 0;
 	}
@@ -2989,7 +3031,7 @@ int cdrom_sysctl_info(ctl_table *ctl, int write, struct file * filp,
 
 	strcpy(info+pos,"\n\n");
 		
-        return proc_dostring(ctl, write, filp, buffer, lenp);
+        return proc_dostring(ctl, write, filp, buffer, lenp, ppos);
 }
 
 /* Unfortunately, per device settings are not implemented through
@@ -3021,13 +3063,13 @@ void cdrom_update_settings(void)
 }
 
 static int cdrom_sysctl_handler(ctl_table *ctl, int write, struct file * filp,
-				void __user *buffer, size_t *lenp)
+				void __user *buffer, size_t *lenp, loff_t *ppos)
 {
 	int *valp = ctl->data;
 	int val = *valp;
 	int ret;
 	
-	ret = proc_dointvec(ctl, write, filp, buffer, lenp);
+	ret = proc_dointvec(ctl, write, filp, buffer, lenp, ppos);
 
 	if (write && *valp != val) {
 	
diff --git a/drivers/cdrom/cdu31a.c b/drivers/cdrom/cdu31a.c
index 3a758a020..cbe336429 100644
--- a/drivers/cdrom/cdu31a.c
+++ b/drivers/cdrom/cdu31a.c
@@ -3179,7 +3179,7 @@ static int scd_block_release(struct inode *inode, struct file *file)
 static int scd_block_ioctl(struct inode *inode, struct file *file,
 				unsigned cmd, unsigned long arg)
 {
-	return cdrom_ioctl(&scd_info, inode, cmd, arg);
+	return cdrom_ioctl(file, &scd_info, inode, cmd, arg);
 }
 
 static int scd_block_media_changed(struct gendisk *disk)
diff --git a/drivers/cdrom/cm206.c b/drivers/cdrom/cm206.c
index d6d49df4d..ccd260362 100644
--- a/drivers/cdrom/cm206.c
+++ b/drivers/cdrom/cm206.c
@@ -1363,7 +1363,7 @@ static int cm206_block_release(struct inode *inode, struct file *file)
 static int cm206_block_ioctl(struct inode *inode, struct file *file,
 				unsigned cmd, unsigned long arg)
 {
-	return cdrom_ioctl(&cm206_info, inode, cmd, arg);
+	return cdrom_ioctl(file, &cm206_info, inode, cmd, arg);
 }
 
 static int cm206_block_media_changed(struct gendisk *disk)
diff --git a/drivers/cdrom/isp16.c b/drivers/cdrom/isp16.c
index 6d66d0b64..ff89164bc 100644
--- a/drivers/cdrom/isp16.c
+++ b/drivers/cdrom/isp16.c
@@ -16,6 +16,10 @@
  *			   module_init & module_exit.
  *			   Torben Mathiasen <tmm@image.dk>
  *
+ *     19 June 2004     -- check_region() converted to request_region()
+ *                         and return statement cleanups.
+ *                         Jesper Juhl <juhl-lkml@dif.dk>
+ *
  *    Detect cdrom interface on ISP16 sound card.
  *    Configure cdrom interface.
  *
@@ -118,17 +122,17 @@ int __init isp16_init(void)
 
 	if (!strcmp(isp16_cdrom_type, "noisp16")) {
 		printk("ISP16: no cdrom interface configured.\n");
-		return (0);
+		return 0;
 	}
 
-	if (check_region(ISP16_IO_BASE, ISP16_IO_SIZE)) {
+	if (!request_region(ISP16_IO_BASE, ISP16_IO_SIZE, "isp16")) {
 		printk("ISP16: i/o ports already in use.\n");
-		return (-EIO);
+		goto out;
 	}
 
 	if ((isp16_type = isp16_detect()) < 0) {
 		printk("ISP16: no cdrom interface found.\n");
-		return (-EIO);
+		goto cleanup_out;
 	}
 
 	printk(KERN_INFO
@@ -148,27 +152,32 @@ int __init isp16_init(void)
 	else {
 		printk("ISP16: %s not supported by cdrom interface.\n",
 		       isp16_cdrom_type);
-		return (-EIO);
+		goto cleanup_out;
 	}
 
 	if (isp16_cdi_config(isp16_cdrom_base, expected_drive,
 			     isp16_cdrom_irq, isp16_cdrom_dma) < 0) {
 		printk
 		    ("ISP16: cdrom interface has not been properly configured.\n");
-		return (-EIO);
+		goto cleanup_out;
 	}
 	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, isp16_cdrom_type);
-	return (0);
+	return 0;
+
+cleanup_out:
+	release_region(ISP16_IO_BASE, ISP16_IO_SIZE);
+out:
+	return -EIO;
 }
 
 static short __init isp16_detect(void)
 {
 
 	if (isp16_c929__detect() >= 0)
-		return (2);
+		return 2;
 	else
 		return (isp16_c928__detect());
 }
@@ -206,7 +215,7 @@ static short __init isp16_c928__detect(void)
 			ISP16_OUT(ISP16_C928__ENABLE_PORT, enable_cdrom);
 		} else {	/* bits are not the same */
 			ISP16_OUT(ISP16_CTRL_PORT, ctrl);
-			return (i);	/* -> not detected: possibly incorrect conclusion */
+			return i;	/* -> not detected: possibly incorrect conclusion */
 		}
 	} else if (enable_cdrom == 0x20)
 		i = 0;
@@ -215,7 +224,7 @@ static short __init isp16_c928__detect(void)
 
 	ISP16_OUT(ISP16_CTRL_PORT, ctrl);
 
-	return (i);
+	return i;
 }
 
 static short __init isp16_c929__detect(void)
@@ -236,12 +245,12 @@ static short __init isp16_c929__detect(void)
 	tmp = ISP16_IN(ISP16_CTRL_PORT);
 
 	if (tmp != 2)		/* isp16 with 82C929 not detected */
-		return (-1);
+		return -1;
 
 	/* restore ctrl port value */
 	ISP16_OUT(ISP16_CTRL_PORT, ctrl);
 
-	return (2);
+	return 2;
 }
 
 static short __init
@@ -272,7 +281,7 @@ isp16_cdi_config(int base, u_char drive_type, int irq, int dma)
 		printk
 		    ("ISP16: base address 0x%03X not supported by cdrom interface.\n",
 		     base);
-		return (-1);
+		return -1;
 	}
 	switch (irq) {
 	case 0:
@@ -303,7 +312,7 @@ isp16_cdi_config(int base, u_char drive_type, int irq, int dma)
 	default:
 		printk("ISP16: irq %d not supported by cdrom interface.\n",
 		       irq);
-		return (-1);
+		return -1;
 	}
 	switch (dma) {
 	case 0:
@@ -312,7 +321,7 @@ isp16_cdi_config(int base, u_char drive_type, int irq, int dma)
 	case 1:
 		printk("ISP16: dma 1 cannot be used by cdrom interface,"
 		       " due to conflict with the sound card.\n");
-		return (-1);
+		return -1;
 		break;
 	case 3:
 		dma_code = ISP16_DMA_3;
@@ -329,7 +338,7 @@ isp16_cdi_config(int base, u_char drive_type, int irq, int dma)
 	default:
 		printk("ISP16: dma %d not supported by cdrom interface.\n",
 		       dma);
-		return (-1);
+		return -1;
 	}
 
 	if (drive_type != ISP16_SONY && drive_type != ISP16_PANASONIC0 &&
@@ -339,7 +348,7 @@ isp16_cdi_config(int base, u_char drive_type, int irq, int dma)
 		printk
 		    ("ISP16: drive type (code 0x%02X) not supported by cdrom"
 		     " interface.\n", drive_type);
-		return (-1);
+		return -1;
 	}
 
 	/* set type of interface */
@@ -354,7 +363,7 @@ isp16_cdi_config(int base, u_char drive_type, int irq, int dma)
 	i = ISP16_IN(ISP16_IO_SET_PORT) & ISP16_IO_SET_MASK;	/* keep some bits */
 	ISP16_OUT(ISP16_IO_SET_PORT, i | base_code | irq_code | dma_code);
 
-	return (0);
+	return 0;
 }
 
 void __exit isp16_exit(void)
diff --git a/drivers/cdrom/mcd.c b/drivers/cdrom/mcd.c
index 33b35e30e..4cb0fb491 100644
--- a/drivers/cdrom/mcd.c
+++ b/drivers/cdrom/mcd.c
@@ -227,7 +227,7 @@ static int mcd_block_release(struct inode *inode, struct file *file)
 static int mcd_block_ioctl(struct inode *inode, struct file *file,
 				unsigned cmd, unsigned long arg)
 {
-	return cdrom_ioctl(&mcd_info, inode, cmd, arg);
+	return cdrom_ioctl(file, &mcd_info, inode, cmd, arg);
 }
 
 static int mcd_block_media_changed(struct gendisk *disk)
diff --git a/drivers/cdrom/mcdx.c b/drivers/cdrom/mcdx.c
index d3cd4c140..01b4e9a56 100644
--- a/drivers/cdrom/mcdx.c
+++ b/drivers/cdrom/mcdx.c
@@ -233,7 +233,7 @@ static int mcdx_block_ioctl(struct inode *inode, struct file *file,
 				unsigned cmd, unsigned long arg)
 {
 	struct s_drive_stuff *p = inode->i_bdev->bd_disk->private_data;
-	return cdrom_ioctl(&p->info, inode, cmd, arg);
+	return cdrom_ioctl(file, &p->info, inode, cmd, arg);
 }
 
 static int mcdx_block_media_changed(struct gendisk *disk)
@@ -307,9 +307,6 @@ static int mcdx_setattentuator(struct s_drive_stuff *,
 
 static int mcdx_drive_map[][2] = MCDX_DRIVEMAP;
 static struct s_drive_stuff *mcdx_stuffp[MCDX_NDRIVES];
-static struct s_drive_stuff *mcdx_irq_map[16] = { 0, 0, 0, 0, 0, 0, 0, 0,
-	0, 0, 0, 0, 0, 0, 0, 0
-};
 static spinlock_t mcdx_lock = SPIN_LOCK_UNLOCKED;
 static struct request_queue *mcdx_queue;
 MODULE_PARM(mcdx, "1-4i");
@@ -849,11 +846,9 @@ static void mcdx_delay(struct s_drive_stuff *stuff, long jifs)
 
 static irqreturn_t mcdx_intr(int irq, void *dev_id, struct pt_regs *regs)
 {
-	struct s_drive_stuff *stuffp;
+	struct s_drive_stuff *stuffp = dev_id;
 	unsigned char b;
 
-	stuffp = mcdx_irq_map[irq];
-
 	if (stuffp == NULL) {
 		xwarn("mcdx: no device for intr %d\n", irq);
 		return IRQ_NONE;
@@ -1199,8 +1194,7 @@ int __init mcdx_init_drive(int drive)
 	}
 
 	xtrace(INIT, "init() subscribe irq and i/o\n");
-	mcdx_irq_map[stuffp->irq] = stuffp;
-	if (request_irq(stuffp->irq, mcdx_intr, SA_INTERRUPT, "mcdx", NULL)) {
+	if (request_irq(stuffp->irq, mcdx_intr, SA_INTERRUPT, "mcdx", stuffp)) {
 		release_region(stuffp->wreg_data, MCDX_IO_SIZE);
 		xwarn("%s=0x%03x,%d: Init failed. Can't get irq (%d).\n",
 		      MCDX, stuffp->wreg_data, stuffp->irq, stuffp->irq);
@@ -1247,8 +1241,8 @@ int __init mcdx_init_drive(int drive)
 	xtrace(INIT, "init() mcdx_stuffp[%d] = %p\n", drive, stuffp);
 	if (register_cdrom(&stuffp->info) != 0) {
 		printk("Cannot register Mitsumi CD-ROM!\n");
-		release_region(stuffp->wreg_data, MCDX_IO_SIZE);
 		free_irq(stuffp->irq, NULL);
+		release_region(stuffp->wreg_data, MCDX_IO_SIZE);
 		kfree(stuffp);
 		put_disk(disk);
 		if (unregister_blkdev(MAJOR_NR, "mcdx") != 0)
diff --git a/drivers/cdrom/optcd.c b/drivers/cdrom/optcd.c
index 62e2d11b3..caaeb724a 100644
--- a/drivers/cdrom/optcd.c
+++ b/drivers/cdrom/optcd.c
@@ -964,7 +964,7 @@ static int update_toc(void)
 #endif /* MULTISESSION */
 	if (disk_info.multi)
 		printk(KERN_WARNING "optcd: Multisession support experimental, "
-			"see linux/Documentation/cdrom/optcd\n");
+			"see Documentation/cdrom/optcd\n");
 
 	DEBUG((DEBUG_TOC, "exiting update_toc"));
 
diff --git a/drivers/cdrom/sbpcd.c b/drivers/cdrom/sbpcd.c
index 8e81cff49..884674959 100644
--- a/drivers/cdrom/sbpcd.c
+++ b/drivers/cdrom/sbpcd.c
@@ -570,7 +570,7 @@ static const char *major_name="sbpcd";
 
 /*==========================================================================*/
 
-#if FUTURE
+#ifdef FUTURE
 static DECLARE_WAIT_QUEUE_HEAD(sbp_waitq);
 #endif /* FUTURE */
 
@@ -703,7 +703,7 @@ static struct sbpcd_drive {
 	u_char TocEnt_number;
 	u_char TocEnt_format; /* em */
 	u_int TocEnt_address;
-#if SAFE_MIXED
+#ifdef SAFE_MIXED
 	char has_data;
 #endif /* SAFE_MIXED */ 
 	u_char ored_ctl_adr; /* to detect if CDROM contains data tracks */
@@ -3176,7 +3176,7 @@ static int cc_CheckMultiSession(void)
 	return (0);
 }
 /*==========================================================================*/
-#if FUTURE
+#ifdef FUTURE
 static int cc_SubChanInfo(int frame, int count, u_char *buffer)
 	/* "frame" is a RED BOOK (msf-bin) address */
 {
@@ -3733,7 +3733,7 @@ static int __init check_drives(void)
 	return (0);
 }
 /*==========================================================================*/
-#if FUTURE
+#ifdef FUTURE
 /*
  *  obtain if requested service disturbs current audio state
  */            
@@ -4027,7 +4027,7 @@ static int sbpcd_drive_status(struct cdrom_device_info *cdi, int slot_nr)
 
 
 /*==========================================================================*/
-#if FUTURE
+#ifdef FUTURE
 /*
  *  called always if driver gets entered
  *  returns 0 or ERROR2 or ERROR15
@@ -4198,7 +4198,7 @@ static int sbpcd_dev_ioctl(struct cdrom_device_info *cdi, u_int cmd,
 		
 	case CDROMREADMODE1:
 		msg(DBG_IOC,"ioctl: CDROMREADMODE1 requested.\n");
-#if SAFE_MIXED
+#ifdef SAFE_MIXED
 		if (current_drive->has_data>1) RETURN_UP(-EBUSY);
 #endif /* SAFE_MIXED */
 		cc_ModeSelect(CD_FRAMESIZE);
@@ -4208,7 +4208,7 @@ static int sbpcd_dev_ioctl(struct cdrom_device_info *cdi, u_int cmd,
 		
 	case CDROMREADMODE2: /* not usable at the moment */
 		msg(DBG_IOC,"ioctl: CDROMREADMODE2 requested.\n");
-#if SAFE_MIXED
+#ifdef SAFE_MIXED
 		if (current_drive->has_data>1) RETURN_UP(-EBUSY);
 #endif /* SAFE_MIXED */
 		cc_ModeSelect(CD_FRAMESIZE_RAW1);
@@ -4257,11 +4257,11 @@ static int sbpcd_dev_ioctl(struct cdrom_device_info *cdi, u_int cmd,
 		if (famL_drive) RETURN_UP(-EINVAL);
 		if (famV_drive) RETURN_UP(-EINVAL);
 		if (famT_drive) RETURN_UP(-EINVAL);
-#if SAFE_MIXED
+#ifdef SAFE_MIXED
 		if (current_drive->has_data>1) RETURN_UP(-EBUSY);
 #endif /* SAFE_MIXED */ 
 		if (current_drive->aud_buf==NULL) RETURN_UP(-EINVAL);
-		if (copy_from_user(&read_audio, (void *)arg,
+		if (copy_from_user(&read_audio, (void __user *)arg,
 				   sizeof(struct cdrom_read_audio)))
 			RETURN_UP(-EFAULT);
 		if (read_audio.nframes < 0 || read_audio.nframes>current_drive->sbp_audsiz) RETURN_UP(-EINVAL);
@@ -4460,8 +4460,8 @@ static int sbpcd_dev_ioctl(struct cdrom_device_info *cdi, u_int cmd,
 				msg(DBG_AUD,"read_audio: cc_ReadError was necessary after read: %02X\n",i);
 				continue;
 			}
-			if (copy_to_user((u_char *)read_audio.buf,
-					 (u_char *) current_drive->aud_buf,
+			if (copy_to_user(read_audio.buf,
+					 current_drive->aud_buf,
 					 read_audio.nframes * CD_FRAMESIZE_RAW))
 				RETURN_UP(-EFAULT);
 			msg(DBG_AUD,"read_audio: copy_to_user done.\n");
@@ -4549,7 +4549,7 @@ static int sbpcd_audio_ioctl(struct cdrom_device_info *cdi, u_int cmd,
 		
 	case CDROMPLAYMSF:
 		msg(DBG_IOC,"ioctl: CDROMPLAYMSF entered.\n");
-#if SAFE_MIXED
+#ifdef SAFE_MIXED
 		if (current_drive->has_data>1) RETURN_UP(-EBUSY);
 #endif /* SAFE_MIXED */ 
 		if (current_drive->audio_state==audio_playing)
@@ -4584,7 +4584,7 @@ static int sbpcd_audio_ioctl(struct cdrom_device_info *cdi, u_int cmd,
 		
 	case CDROMPLAYTRKIND: /* Play a track.  This currently ignores index. */
 		msg(DBG_IOC,"ioctl: CDROMPLAYTRKIND entered.\n");
-#if SAFE_MIXED
+#ifdef SAFE_MIXED
 		if (current_drive->has_data>1) RETURN_UP(-EBUSY);
 #endif /* SAFE_MIXED */ 
 		if (current_drive->audio_state==audio_playing)
@@ -4647,7 +4647,7 @@ static int sbpcd_audio_ioctl(struct cdrom_device_info *cdi, u_int cmd,
 		
 	case CDROMSTOP:      /* Spin down the drive */
 		msg(DBG_IOC,"ioctl: CDROMSTOP entered.\n");
-#if SAFE_MIXED
+#ifdef SAFE_MIXED
 		if (current_drive->has_data>1) RETURN_UP(-EBUSY);
 #endif /* SAFE_MIXED */ 
 		i=cc_Pause_Resume(1);
@@ -4912,7 +4912,7 @@ static void do_sbpcd_request(request_queue_t * q)
 		goto request_loop;
 	}
 
-#if FUTURE
+#ifdef FUTURE
 	i=prepare(0,0); /* at moment not really a hassle check, but ... */
 	if (i!=0)
 		msg(DBG_INF,"\"prepare\" tells error %d -- ignored\n", i);
@@ -4940,7 +4940,7 @@ static void do_sbpcd_request(request_queue_t * q)
 		sbp_sleep(0);
 		if (sbp_data(req) != 0)
 		{
-#if SAFE_MIXED
+#ifdef SAFE_MIXED
 			current_drive->has_data=2; /* is really a data disk */
 #endif /* SAFE_MIXED */ 
 #ifdef DEBUG_GTL
@@ -5372,7 +5372,7 @@ static int sbpcd_block_ioctl(struct inode *inode, struct file *file,
 				unsigned cmd, unsigned long arg)
 {
 	struct sbpcd_drive *p = inode->i_bdev->bd_disk->private_data;
-	return cdrom_ioctl(p->sbpcd_infop, inode, cmd, arg);
+	return cdrom_ioctl(file, p->sbpcd_infop, inode, cmd, arg);
 }
 
 static int sbpcd_block_media_changed(struct gendisk *disk)
@@ -5416,11 +5416,11 @@ static int sbpcd_open(struct cdrom_device_info *cdi, int purpose)
 		if ((current_drive->ored_ctl_adr&0x40)==0)
 		{		
 			msg(DBG_INF,"CD contains no data tracks.\n");
-#if SAFE_MIXED
+#ifdef SAFE_MIXED
 			current_drive->has_data=0;
 #endif /* SAFE_MIXED */
 		}
-#if SAFE_MIXED
+#ifdef SAFE_MIXED
 		else if (current_drive->has_data<1) current_drive->has_data=1;
 #endif /* SAFE_MIXED */ 
 	}
@@ -5455,7 +5455,7 @@ static void sbpcd_release(struct cdrom_device_info * cdi)
 				if (p->f_eject) cc_SpinDown();
 			p->diskstate_flags &= ~cd_size_bit;
 			p->open_count=0; 
-#if SAFE_MIXED
+#ifdef SAFE_MIXED
 			p->has_data=0;
 #endif /* SAFE_MIXED */ 
 		}
@@ -5715,7 +5715,7 @@ int __init sbpcd_init(void)
 	
 	if (port_index>0)
           {
-            msg(DBG_INF, "You should read linux/Documentation/cdrom/sbpcd\n");
+            msg(DBG_INF, "You should read Documentation/cdrom/sbpcd\n");
             msg(DBG_INF, "and then configure sbpcd.h for your hardware.\n");
           }
 	check_datarate();
@@ -5822,7 +5822,7 @@ int __init sbpcd_init(void)
 
 		if (p->drv_id==-1) continue;
 		switch_drive(p);
-#if SAFE_MIXED
+#ifdef SAFE_MIXED
 		p->has_data=0;
 #endif /* SAFE_MIXED */ 
 		/*
@@ -5942,7 +5942,7 @@ static int sbpcd_media_changed(struct cdrom_device_info *cdi, int disc_nr)
 		current_drive->diskstate_flags &= ~toc_bit;
 		/* we *don't* need invalidate here, it's done by caller */
 		current_drive->diskstate_flags &= ~cd_size_bit;
-#if SAFE_MIXED
+#ifdef SAFE_MIXED
 		current_drive->has_data=0;
 #endif /* SAFE_MIXED */ 
 
diff --git a/drivers/cdrom/sbpcd.h b/drivers/cdrom/sbpcd.h
index 16a0208a2..2f2225f13 100644
--- a/drivers/cdrom/sbpcd.h
+++ b/drivers/cdrom/sbpcd.h
@@ -5,7 +5,7 @@
 /*
  * Attention! This file contains user-serviceable parts!
  * I recommend to make use of it...
- * If you feel helpless, look into linux/Documentation/cdrom/sbpcd
+ * If you feel helpless, look into Documentation/cdrom/sbpcd
  * (good idea anyway, at least before mailing me).
  *
  * The definitions for the first controller can get overridden by
diff --git a/drivers/cdrom/viocd.c b/drivers/cdrom/viocd.c
index 9d2759d8a..3a2acc0fb 100644
--- a/drivers/cdrom/viocd.c
+++ b/drivers/cdrom/viocd.c
@@ -44,6 +44,7 @@
 
 #include <asm/bug.h>
 
+#include <asm/vio.h>
 #include <asm/scatterlist.h>
 #include <asm/iSeries/HvTypes.h>
 #include <asm/iSeries/HvLpEvent.h>
@@ -84,7 +85,7 @@ enum viocdsubtype {
 /*
  * Should probably make this a module parameter....sigh
  */
-#define VIOCD_MAX_CD 8
+#define VIOCD_MAX_CD	HVMAXARCHITECTEDVIRTUALCDROMS
 
 static const struct vio_error_entry viocd_err_table[] = {
 	{0x0201, EINVAL, "Invalid Range"},
@@ -144,6 +145,7 @@ static dma_addr_t unitinfo_dmaaddr;
 struct disk_info {
 	struct gendisk			*viocd_disk;
 	struct cdrom_device_info	viocd_info;
+	struct device			*dev;
 };
 static struct disk_info viocd_diskinfo[VIOCD_MAX_CD];
 
@@ -197,7 +199,7 @@ static int viocd_blk_ioctl(struct inode *inode, struct file *file,
 		unsigned cmd, unsigned long arg)
 {
 	struct disk_info *di = inode->i_bdev->bd_disk->private_data;
-	return cdrom_ioctl(&di->viocd_info, inode, cmd, arg);
+	return cdrom_ioctl(file, &di->viocd_info, inode, cmd, arg);
 }
 
 static int viocd_blk_media_changed(struct gendisk *disk)
@@ -260,13 +262,13 @@ static void __init get_viocd_info(void)
 	for (i = 0; (i < VIOCD_MAX_CD) && viocd_unitinfo[i].rsrcname[0]; i++)
 		viocd_numdev++;
 
-	return;
-
 error_ret:
-	dma_free_coherent(iSeries_vio_dev,
-			sizeof(*viocd_unitinfo) * VIOCD_MAX_CD,
-			viocd_unitinfo, unitinfo_dmaaddr);
-	viocd_unitinfo = NULL;
+	if (viocd_numdev == 0) {
+		dma_free_coherent(iSeries_vio_dev,
+				sizeof(*viocd_unitinfo) * VIOCD_MAX_CD,
+				viocd_unitinfo, unitinfo_dmaaddr);
+		viocd_unitinfo = NULL;
+	}
 }
 
 static int viocd_open(struct cdrom_device_info *cdi, int purpose)
@@ -341,7 +343,7 @@ static int send_request(struct request *req)
 		return -1;
 	}
 
-	if (dma_map_sg(iSeries_vio_dev, &sg, 1, DMA_FROM_DEVICE) == 0) {
+	if (dma_map_sg(diskinfo->dev, &sg, 1, DMA_FROM_DEVICE) == 0) {
 		printk(VIOCD_KERN_WARNING "error allocating sg tce\n");
 		return -1;
 	}
@@ -513,8 +515,9 @@ return_complete:
 		 * Since this is running in interrupt mode, we need to
 		 * make sure we're not stepping on any global I/O operations
 		 */
+		di = &viocd_diskinfo[bevent->disk];
 		spin_lock_irqsave(&viocd_reqlock, flags);
-		dma_unmap_single(iSeries_vio_dev, bevent->token, bevent->len,
+		dma_unmap_single(di->dev, bevent->token, bevent->len,
 				DMA_FROM_DEVICE);
 		req = (struct request *)bevent->event.xCorrelationToken;
 		rwreq--;
@@ -565,12 +568,97 @@ static int __init find_capability(const char *type)
 	return entry->capability;
 }
 
-static int __init viocd_init(void)
+static int viocd_probe(struct vio_dev *vdev, const struct vio_device_id *id)
 {
 	struct gendisk *gendisk;
 	int deviceno;
-	int ret = 0;
+	struct disk_info *d;
+	struct cdrom_device_info *c;
+	struct cdrom_info *ci;
+
+	deviceno = vdev->unit_address;
+	if (deviceno >= viocd_numdev)
+		return -ENODEV;
+
+	d = &viocd_diskinfo[deviceno];
+	c = &d->viocd_info;
+	ci = &viocd_unitinfo[deviceno];
+
+	c->ops = &viocd_dops;
+	c->speed = 4;
+	c->capacity = 1;
+	c->handle = d;
+	c->mask = ~find_capability(ci->type);
+	sprintf(c->name, VIOCD_DEVICE "%c", 'a' + deviceno);
+
+	if (register_cdrom(c) != 0) {
+		printk(VIOCD_KERN_WARNING "Cannot register viocd CD-ROM %s!\n",
+				c->name);
+		return 0;
+	}
+	printk(VIOCD_KERN_INFO "cd %s is iSeries resource %10.10s "
+			"type %4.4s, model %3.3s\n",
+			c->name, ci->rsrcname, ci->type, ci->model);
+	gendisk = alloc_disk(1);
+	if (gendisk == NULL) {
+		printk(VIOCD_KERN_WARNING "Cannot create gendisk for %s!\n",
+				c->name);
+		unregister_cdrom(c);
+		return 0;
+	}
+	gendisk->major = VIOCD_MAJOR;
+	gendisk->first_minor = deviceno;
+	strncpy(gendisk->disk_name, c->name,
+			sizeof(gendisk->disk_name));
+	snprintf(gendisk->devfs_name, sizeof(gendisk->devfs_name),
+			VIOCD_DEVICE_DEVFS "%d", deviceno);
+	gendisk->queue = viocd_queue;
+	gendisk->fops = &viocd_fops;
+	gendisk->flags = GENHD_FL_CD|GENHD_FL_REMOVABLE;
+	set_capacity(gendisk, 0);
+	gendisk->private_data = d;
+	d->viocd_disk = gendisk;
+	d->dev = &vdev->dev;
+	gendisk->driverfs_dev = d->dev;
+	add_disk(gendisk);
+
+	return 0;
+}
+
+static int viocd_remove(struct vio_dev *vdev)
+{
+	struct disk_info *d = &viocd_diskinfo[vdev->unit_address];
+
+	if (unregister_cdrom(&d->viocd_info) != 0)
+		printk(VIOCD_KERN_WARNING
+				"Cannot unregister viocd CD-ROM %s!\n",
+				d->viocd_info.name);
+	del_gendisk(d->viocd_disk);
+	put_disk(d->viocd_disk);
+	return 0;
+}
+
+/**
+ * viocd_device_table: Used by vio.c to match devices that we
+ * support.
+ */
+static struct vio_device_id viocd_device_table[] __devinitdata = {
+	{ "viocd", "" },
+	{ 0, }
+};
+
+MODULE_DEVICE_TABLE(vio, viocd_device_table);
+static struct vio_driver viocd_driver = {
+	.name = "viocd",
+	.id_table = viocd_device_table,
+	.probe = viocd_probe,
+	.remove = viocd_remove
+};
+
+static int __init viocd_init(void)
+{
 	struct proc_dir_entry *e;
+	int ret = 0;
 
 	if (viopath_hostLp == HvLpIndexInvalid) {
 		vio_set_hostlp();
@@ -583,8 +671,7 @@ static int __init viocd_init(void)
 			viopath_hostLp);
 
 	if (register_blkdev(VIOCD_MAJOR, VIOCD_DEVICE) != 0) {
-		printk(VIOCD_KERN_WARNING
-				"Unable to get major %d for %s\n",
+		printk(VIOCD_KERN_WARNING "Unable to get major %d for %s\n",
 				VIOCD_MAJOR, VIOCD_DEVICE);
 		return -EIO;
 	}
@@ -605,59 +692,19 @@ static int __init viocd_init(void)
 	if (viocd_numdev == 0)
 		goto out_undo_vio;
 
-	ret = -ENOMEM;
 	spin_lock_init(&viocd_reqlock);
 	viocd_queue = blk_init_queue(do_viocd_request, &viocd_reqlock);
-	if (viocd_queue == NULL)
-		goto out_unregister;
+	if (viocd_queue == NULL) {
+		ret = -ENOMEM;
+		goto out_free_info;
+	}
 	blk_queue_max_hw_segments(viocd_queue, 1);
 	blk_queue_max_phys_segments(viocd_queue, 1);
 	blk_queue_max_sectors(viocd_queue, 4096 / 512);
 
-	/* initialize units */
-	for (deviceno = 0; deviceno < viocd_numdev; deviceno++) {
-		struct disk_info *d = &viocd_diskinfo[deviceno];
-		struct cdrom_device_info *c = &d->viocd_info;
-		struct cdrom_info *ci = &viocd_unitinfo[deviceno];
-
-		c->ops = &viocd_dops;
-		c->speed = 4;
-		c->capacity = 1;
-		c->handle = d;
-		c->mask = ~find_capability(ci->type);
-		sprintf(c->name, VIOCD_DEVICE "%c", 'a' + deviceno);
-
-		if (register_cdrom(c) != 0) {
-			printk(VIOCD_KERN_WARNING
-					"Cannot register viocd CD-ROM %s!\n",
-					c->name);
-			continue;
-		}
-		printk(VIOCD_KERN_INFO "cd %s is iSeries resource %10.10s "
-				"type %4.4s, model %3.3s\n",
-				c->name, ci->rsrcname, ci->type, ci->model);
-		gendisk = alloc_disk(1);
-		if (gendisk == NULL) {
-			printk(VIOCD_KERN_WARNING
-					"Cannot create gendisk for %s!\n",
-					c->name);
-			unregister_cdrom(c);
-			continue;
-		}
-		gendisk->major = VIOCD_MAJOR;
-		gendisk->first_minor = deviceno;
-		strncpy(gendisk->disk_name, c->name,
-				sizeof(gendisk->disk_name));
-		snprintf(gendisk->devfs_name, sizeof(gendisk->devfs_name),
-				VIOCD_DEVICE_DEVFS "%d", deviceno);
-		gendisk->queue = viocd_queue;
-		gendisk->fops = &viocd_fops;
-		gendisk->flags = GENHD_FL_CD|GENHD_FL_REMOVABLE;
-		set_capacity(gendisk, 0);
-		gendisk->private_data = d;
-		d->viocd_disk = gendisk;
-		add_disk(gendisk);
-	}
+	ret = vio_register_driver(&viocd_driver);
+	if (ret)
+		goto out_cleanup_queue;
 
 	e = create_proc_entry("iSeries/viocd", S_IFREG|S_IRUGO, NULL);
 	if (e) {
@@ -667,6 +714,12 @@ static int __init viocd_init(void)
 
 	return 0;
 
+out_cleanup_queue:
+	blk_cleanup_queue(viocd_queue);
+out_free_info:
+	dma_free_coherent(iSeries_vio_dev,
+			sizeof(*viocd_unitinfo) * VIOCD_MAX_CD,
+			viocd_unitinfo, unitinfo_dmaaddr);
 out_undo_vio:
 	vio_clearHandler(viomajorsubtype_cdio);
 	viopath_close(viopath_hostLp, viomajorsubtype_cdio, MAX_CD_REQ + 2);
@@ -677,18 +730,8 @@ out_unregister:
 
 static void __exit viocd_exit(void)
 {
-	int deviceno;
-
 	remove_proc_entry("iSeries/viocd", NULL);
-	for (deviceno = 0; deviceno < viocd_numdev; deviceno++) {
-		struct disk_info *d = &viocd_diskinfo[deviceno];
-		if (unregister_cdrom(&d->viocd_info) != 0)
-			printk(VIOCD_KERN_WARNING
-					"Cannot unregister viocd CD-ROM %s!\n",
-					d->viocd_info.name);
-		del_gendisk(d->viocd_disk);
-		put_disk(d->viocd_disk);
-	}
+	vio_unregister_driver(&viocd_driver);
 	blk_cleanup_queue(viocd_queue);
 	if (viocd_unitinfo != NULL)
 		dma_free_coherent(iSeries_vio_dev,
diff --git a/drivers/char/Kconfig b/drivers/char/Kconfig
index 69122d880..37e067351 100644
--- a/drivers/char/Kconfig
+++ b/drivers/char/Kconfig
@@ -203,7 +203,7 @@ config MOXA_SMARTIO
 
 config ISI
 	tristate "Multi-Tech multiport card support (EXPERIMENTAL)"
-	depends on SERIAL_NONSTANDARD && EXPERIMENTAL && BROKEN_ON_SMP && m
+	depends on SERIAL_NONSTANDARD && PCI && EXPERIMENTAL && BROKEN_ON_SMP && m
 	help
 	  This is a driver for the Multi-Tech cards which provide several
 	  serial ports.  The driver is experimental and can currently only be
@@ -212,7 +212,7 @@ config ISI
 
 config SYNCLINK
 	tristate "Microgate SyncLink card support"
-	depends on SERIAL_NONSTANDARD
+	depends on SERIAL_NONSTANDARD && PCI
 	help
 	  Provides support for the SyncLink ISA and PCI multiprotocol serial
 	  adapters. These adapters support asynchronous and HDLC bit
@@ -349,7 +349,7 @@ config ISTALLION
 	  module will be called istallion.
 
 config SERIAL_TX3912
-	bool "TMPTX3912/PR31700 serial port support"
+	bool "TX3912/PR31700 serial port support"
 	depends on SERIAL_NONSTANDARD && MIPS && BROKEN_ON_SMP
 	help
 	  The TX3912 is a Toshiba RISC processor based o the MIPS 3900 core;
@@ -357,7 +357,7 @@ config SERIAL_TX3912
 	  Say Y here to enable kernel support for the on-board serial port.
 
 config SERIAL_TX3912_CONSOLE
-	bool "Console on TMPTX3912/PR31700 serial port"
+	bool "Console on TX3912/PR31700 serial port"
 	depends on SERIAL_TX3912
 	help
 	  The TX3912 is a Toshiba RISC processor based o the MIPS 3900 core;
@@ -371,22 +371,6 @@ config AU1000_UART
 	  If you have an Alchemy AU1000 processor (MIPS based) and you want
 	  to use serial ports, say Y.  Otherwise, say N.
 
-config SGI_L1_SERIAL
-	bool "SGI Altix L1 serial support"
-	depends on SERIAL_NONSTANDARD && IA64
-	help
-	  If you have an SGI Altix and you want to use the serial port
-	  connected to the system controller (you want this!), say Y.
-	  Otherwise, say N.
-
-config SGI_L1_SERIAL_CONSOLE
-	bool "SGI Altix L1 serial console support"
-	depends on SGI_L1_SERIAL
-	help
-	  If you have an SGI Altix and you would like to use the system
-	  controller serial port as your console (you want this!),
-	  say Y.  Otherwise, say N.
-
 config AU1000_SERIAL_CONSOLE
 	bool "Enable Au1000 serial console"
 	depends on AU1000_UART
@@ -586,16 +570,22 @@ config HVC_CONSOLE
 	  console. This driver allows each pSeries partition to have a console
 	  which is accessed via the HMC.
 
-config PC9800_OLDLP
-	tristate "NEC PC-9800 old-style printer port support"
-	depends on X86_PC9800 && !PARPORT
-	---help---
-	  If you intend to attach a printer to the parallel port of NEC PC-9801
-	  /PC-9821 with OLD compatibility mode, Say Y.
+config HVCS
+	tristate "IBM Hypervisor Virtual Console Server support"
+	depends on PPC_PSERIES
+	help
+	  Partitionable IBM Power5 ppc64 machines allow hosting of
+	  firmware virtual consoles from one Linux partition by
+	  another Linux partition.  This driver allows console data
+	  from Linux partitions to be accessed through TTY device
+	  interfaces in the device tree of a Linux partition running
+	  this driver.
 
-config PC9800_OLDLP_CONSOLE
-	bool "Support for console on line printer"
-	depends on PC9800_OLDLP
+	  To compile this driver as a module, choose M here: the
+	  module will be called hvcs.ko.  Additionally, this module
+	  will depend on arch specific APIs exported from hvcserver.ko
+	  which will also be compiled when this driver is built as a
+	  module.
 
 config QIC02_TAPE
 	tristate "QIC-02 tape support"
@@ -740,7 +730,7 @@ config NVRAM
 
 config RTC
 	tristate "Enhanced Real Time Clock Support"
-	depends on !PPC32 && !PARISC && !IA64 && !X86_PC9800 && !M68K
+	depends on !PPC32 && !PARISC && !IA64 && !M68K
 	---help---
 	  If you say Y here and create a character special file /dev/rtc with
 	  major number 10 and minor number 135 using mknod ("man mknod"), you
@@ -764,6 +754,28 @@ config RTC
 	  To compile this driver as a module, choose M here: the
 	  module will be called rtc.
 
+config SGI_DS1286
+	tristate "SGI DS1286 RTC support"
+	depends on SGI_IP22
+	help
+	  If you say Y here and create a character special file /dev/rtc with
+	  major number 10 and minor number 135 using mknod ("man mknod"), you
+	  will get access to the real time clock built into your computer.
+	  Every SGI has such a clock built in. It reports status information
+	  via the file /proc/rtc and its behaviour is set by various ioctls on
+	  /dev/rtc.
+
+config SGI_IP27_RTC
+	bool "SGI M48T35 RTC support"
+	depends on SGI_IP27
+	help
+	  If you say Y here and create a character special file /dev/rtc with
+	  major number 10 and minor number 135 using mknod ("man mknod"), you
+	  will get access to the real time clock built into your computer.
+	  Every SGI has such a clock built in. It reports status information
+	  via the file /proc/rtc and its behaviour is set by various ioctls on
+	  /dev/rtc.
+
 config GEN_RTC
 	tristate "Generic /dev/rtc emulation"
 	depends on RTC!=y && !IA64
@@ -793,24 +805,12 @@ config EFI_RTC
 	bool "EFI Real Time Clock Services"
 	depends on IA64
 
-config RTC98
-	tristate "NEC PC-9800 Real Time Clock Support"
-	depends on X86_PC9800
-	default y
-	---help---
-	  If you say Y here and create a character special file /dev/rtc with
-	  major number 10 and minor number 135 using mknod ("man mknod"), you
-	  will get access to the real time clock (or hardware clock) built
-
-config H8
-	bool "Tadpole ANA H8 Support (OBSOLETE)"
-	depends on OBSOLETE && ALPHA_BOOK1
+config COBALT_LCD
+	bool "Support for Cobalt LCD"
+	depends on MIPS_COBALT
 	help
-	  The Hitachi H8/337 is a microcontroller used to deal with the power
-	  and thermal environment. If you say Y here, you will be able to
-	  communicate with it via a character special device.
-
-	  If unsure, say N.
+	  This option enables support for the LCD display and buttons found
+	  on Cobalt systems through a misc device.
 
 config DTLK
 	tristate "Double Talk PC internal speech card support"
@@ -836,6 +836,7 @@ config R3964
 
 config APPLICOM
 	tristate "Applicom intelligent fieldbus card support"
+	depends on PCI
 	---help---
 	  This driver provides the kernel-side support for the intelligent
 	  fieldbus cards made by Applicom International. More information
@@ -866,7 +867,7 @@ menu "Ftape, the floppy tape device driver"
 
 config FTAPE
 	tristate "Ftape (QIC-80/Travan) support"
-	depends on BROKEN_ON_SMP
+	depends on BROKEN_ON_SMP && (ALPHA || X86)
 	---help---
 	  If you have a tape drive that is connected to your floppy
 	  controller, say Y here.
@@ -957,6 +958,37 @@ config RAW_DRIVER
           kernels.  Applications should simply open the device (eg /dev/hda1)
           with the O_DIRECT flag.
 
+config HPET
+	bool "HPET - High Precision Event Timer" if (X86 || IA64)
+	default n
+	depends on ACPI
+	help
+	  If you say Y here, you will have a miscdevice named "/dev/hpet/".  Each
+	  open selects one of the timers supported by the HPET.  The timers are
+	  non-periodioc and/or periodic.
+
+config HPET_RTC_IRQ
+	bool "HPET Control RTC IRQ" if !HPET_EMULATE_RTC
+	default n
+	depends on HPET
+	help
+	  If you say Y here, you will disable RTC_IRQ in drivers/char/rtc.c. It
+	  is assumed the platform called hpet_alloc with the RTC IRQ values for
+	  the HPET timers.
+
+config HPET_MMAP
+	bool "Allow mmap of HPET"
+	default y
+	depends on HPET
+	help
+	  If you say Y here, user applications will be able to mmap
+	  the HPET registers.
+
+	  In some hardware implementations, the page containing HPET
+	  registers may also contain other things that shouldn't be
+	  exposed to the user.  If this applies to your hardware,
+	  say N here.
+
 config MAX_RAW_DEVS
 	int "Maximum number of RAW devices to support (1-8192)"
 	depends on RAW_DRIVER
diff --git a/drivers/char/Makefile b/drivers/char/Makefile
index 2a42fd3c7..b927c16bb 100644
--- a/drivers/char/Makefile
+++ b/drivers/char/Makefile
@@ -41,21 +41,23 @@ obj-$(CONFIG_SX)		+= sx.o generic_serial.o
 obj-$(CONFIG_RIO)		+= rio/ generic_serial.o
 obj-$(CONFIG_HVC_CONSOLE)	+= hvc_console.o
 obj-$(CONFIG_RAW_DRIVER)	+= raw.o
-obj-$(CONFIG_SGI_L1_SERIAL)	+= sn_serial.o
 obj-$(CONFIG_VIOCONS) += viocons.o
 obj-$(CONFIG_VIOTAPE)		+= viotape.o
+obj-$(CONFIG_HVCS)		+= hvcs.o
 
 obj-$(CONFIG_PRINTER) += lp.o
 obj-$(CONFIG_TIPAR) += tipar.o
-obj-$(CONFIG_PC9800_OLDLP) += lp_old98.o
 
 obj-$(CONFIG_DTLK) += dtlk.o
 obj-$(CONFIG_R3964) += n_r3964.o
 obj-$(CONFIG_APPLICOM) += applicom.o
 obj-$(CONFIG_SONYPI) += sonypi.o
 obj-$(CONFIG_RTC) += rtc.o
+obj-$(CONFIG_HPET) += hpet.o
 obj-$(CONFIG_GEN_RTC) += genrtc.o
 obj-$(CONFIG_EFI_RTC) += efirtc.o
+obj-$(CONFIG_SGI_DS1286) += ds1286.o
+obj-$(CONFIG_SGI_IP27_RTC) += ip27-rtc.o
 ifeq ($(CONFIG_GENERIC_NVRAM),y)
   obj-$(CONFIG_NVRAM) += generic_nvram.o
 else
@@ -67,7 +69,7 @@ obj-$(CONFIG_DS1620) += ds1620.o
 obj-$(CONFIG_HW_RANDOM) += hw_random.o
 obj-$(CONFIG_QIC02_TAPE) += tpqic02.o
 obj-$(CONFIG_FTAPE) += ftape/
-obj-$(CONFIG_H8) += h8.o
+obj-$(CONFIG_COBALT_LCD) += lcd.o
 obj-$(CONFIG_PPDEV) += ppdev.o
 obj-$(CONFIG_NWBUTTON) += nwbutton.o
 obj-$(CONFIG_NWFLASH) += nwflash.o
diff --git a/drivers/char/README.scc b/drivers/char/README.scc
index 8837d8a5d..90fa4b8ae 100644
--- a/drivers/char/README.scc
+++ b/drivers/char/README.scc
@@ -2,4 +2,4 @@ The z8530drv is now a network device driver, you can find it in
 	../net/scc.c
 
 A subset of the documentation is in
-	../../Documentation/networking/z8530drv.txt
+	Documentation/networking/z8530drv.txt
diff --git a/drivers/char/agp/Kconfig b/drivers/char/agp/Kconfig
index f438b0762..773279d48 100644
--- a/drivers/char/agp/Kconfig
+++ b/drivers/char/agp/Kconfig
@@ -82,7 +82,7 @@ config AGP_INTEL
 	  This option gives you AGP support for the GLX component of XFree86 4.x
 	  on Intel 440LX/BX/GX, 815, 820, 830, 840, 845, 850, 860, 875,
 	  E7205 and E7505 chipsets and full support for the 810, 815, 830M, 845G,
-	  852GM, 855GM and 865G integrated graphics chipsets.
+	  852GM, 855GM, 865G and I915 integrated graphics chipsets.
 
 	  You should say Y here if you use XFree86 3.3.6 or 4.x and want to
 	  use GLX or DRI, or if you have any Intel integrated graphics
@@ -165,7 +165,7 @@ config AGP_EFFICEON
 	tristate "Transmeta Efficeon support"
 	depends on AGP && X86 && !X86_64
 	help
-	  This option fives you AGP support for the Transmeta Efficeon
+	  This option gives you AGP support for the Transmeta Efficeon
 	  series processors with integrated northbridges.
 
 	  You should say Y here if you use XFree86 3.3.6 or 4.x and want to
diff --git a/drivers/char/agp/amd64-agp.c b/drivers/char/agp/amd64-agp.c
index 06a7ef269..924ffc3db 100644
--- a/drivers/char/agp/amd64-agp.c
+++ b/drivers/char/agp/amd64-agp.c
@@ -536,6 +536,15 @@ static struct pci_device_id agp_amd64_pci_table[] = {
 	.subvendor	= PCI_ANY_ID,
 	.subdevice	= PCI_ANY_ID,
 	},
+	/* VIA K8T800Pro */
+	{
+	.class		= (PCI_CLASS_BRIDGE_HOST << 8),
+	.class_mask	= ~0,
+	.vendor		= PCI_VENDOR_ID_VIA,
+	.device		= PCI_DEVICE_ID_VIA_K8T800PRO_0,
+	.subvendor	= PCI_ANY_ID,
+	.subdevice	= PCI_ANY_ID,
+	},
 	/* VIA K8T800 */
 	{
 	.class		= (PCI_CLASS_BRIDGE_HOST << 8),
@@ -554,14 +563,25 @@ static struct pci_device_id agp_amd64_pci_table[] = {
 	.subvendor	= PCI_ANY_ID,
 	.subdevice	= PCI_ANY_ID,
 	},
+	/* VIA K8T890 */
 	{
 	.class		= (PCI_CLASS_BRIDGE_HOST << 8),
 	.class_mask	= ~0,
 	.vendor		= PCI_VENDOR_ID_VIA,
-	.device		= PCI_DEVICE_ID_VIA_8380_0,
+	.device		= PCI_DEVICE_ID_VIA_3238_0,
 	.subvendor	= PCI_ANY_ID,
 	.subdevice	= PCI_ANY_ID,
 	},
+	/* VIA K8T800/K8M800/K8N800 */
+	{
+	.class		= (PCI_CLASS_BRIDGE_HOST << 8),
+	.class_mask	= ~0,
+	.vendor		= PCI_VENDOR_ID_VIA,
+	.device		= PCI_DEVICE_ID_VIA_838X_1,
+	.subvendor	= PCI_ANY_ID,
+	.subdevice	= PCI_ANY_ID,
+	},
+
 	/* NForce3 */
 	{
 	.class		= (PCI_CLASS_BRIDGE_HOST << 8),
diff --git a/drivers/char/agp/generic.c b/drivers/char/agp/generic.c
index ba6c102d2..f65662437 100644
--- a/drivers/char/agp/generic.c
+++ b/drivers/char/agp/generic.c
@@ -1,6 +1,6 @@
 /*
  * AGPGART driver.
- * Copyright (C) 2002-2003 Dave Jones.
+ * Copyright (C) 2002-2004 Dave Jones.
  * Copyright (C) 1999 Jeff Hartmann.
  * Copyright (C) 1999 Precision Insight, Inc.
  * Copyright (C) 1999 Xi Graphics, Inc.
@@ -18,12 +18,12 @@
  * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS
  * OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
  * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.  IN NO EVENT SHALL
- * JEFF HARTMANN, OR ANY OTHER CONTRIBUTORS BE LIABLE FOR ANY CLAIM, 
- * DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR 
- * OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE 
+ * JEFF HARTMANN, OR ANY OTHER CONTRIBUTORS BE LIABLE FOR ANY CLAIM,
+ * DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR
+ * OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE
  * OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
  *
- * TODO: 
+ * TODO:
  * - Allocate more than order 0 pages to avoid too much linear map splitting.
  */
 #include <linux/config.h>
@@ -37,7 +37,7 @@
 #include <linux/vmalloc.h>
 #include "agp.h"
 
-__u32 *agp_gatt_table; 
+__u32 *agp_gatt_table;
 int agp_memory_reserved;
 
 /*
@@ -46,7 +46,7 @@ int agp_memory_reserved;
  */
 EXPORT_SYMBOL_GPL(agp_memory_reserved);
 
-/* 
+/*
  * Generic routines for handling agp_memory structures -
  * They use the basic page allocation routines to do the brunt of the work.
  */
@@ -142,12 +142,12 @@ EXPORT_SYMBOL(agp_free_memory);
  *	agp_allocate_memory  -  allocate a group of pages of a certain type.
  *
  *	@page_count:	size_t argument of the number of pages
- *	@type:	u32 argument of the type of memory to be allocated.  
+ *	@type:	u32 argument of the type of memory to be allocated.
  *
  *	Every agp bridge device will allow you to allocate AGP_NORMAL_MEMORY which
  *	maps to physical ram.  Any other type is device dependent.
  *
- *	It returns NULL whenever memory is unavailable. 
+ *	It returns NULL whenever memory is unavailable.
  */
 struct agp_memory *agp_allocate_memory(size_t page_count, u32 type)
 {
@@ -311,7 +311,7 @@ EXPORT_SYMBOL(agp_copy_info);
 
 /**
  *	agp_bind_memory  -  Bind an agp_memory structure into the GATT.
- * 
+ *
  *	@curr:		agp_memory pointer
  *	@pg_start:	an offset into the graphics aperture translation table
  *
@@ -347,9 +347,9 @@ EXPORT_SYMBOL(agp_bind_memory);
 
 /**
  *	agp_unbind_memory  -  Removes an agp_memory structure from the GATT
- * 
+ *
  * @curr:	agp_memory pointer to be removed from the GATT.
- * 
+ *
  * It returns -EINVAL if this piece of agp_memory is not currently bound to
  * the graphics aperture translation table or if the agp_memory pointer == NULL
  */
@@ -404,12 +404,18 @@ static void agp_v2_parse_one(u32 *mode, u32 *cmd, u32 *tmp)
 		*cmd &= ~(AGPSTAT2_1X | AGPSTAT2_4X);	/* 2X */
 
 	if (*cmd & AGPSTAT2_1X)
-		*cmd &= ~(AGPSTAT2_2X | AGPSTAT2_4X);	/* 1Xf */
+		*cmd &= ~(AGPSTAT2_2X | AGPSTAT2_4X);	/* 1X */
 }
 
-
+/*
+ * mode = requested mode.
+ * cmd = PCI_AGP_STATUS from agp bridge.
+ * tmp = PCI_AGP_STATUS from graphic card.
+ */
 static void agp_v3_parse_one(u32 *mode, u32 *cmd, u32 *tmp)
 {
+	u32 origcmd=*cmd, origtmp=*tmp;
+
 	/* ARQSZ - Set the value to the maximum one.
 	 * Don't allow the mode register to override values. */
 	*cmd = ((*cmd & ~AGPSTAT_ARQSZ) |
@@ -452,17 +458,43 @@ static void agp_v3_parse_one(u32 *mode, u32 *cmd, u32 *tmp)
 		*mode |= AGPSTAT3_4X;
 	}
 
-	if (!((*cmd & AGPSTAT3_8X) && (*tmp & AGPSTAT3_8X) && (*mode & AGPSTAT3_8X)))
-		*cmd &= ~AGPSTAT3_8X;
+	if (*mode & AGPSTAT3_8X) {
+		if (!(*cmd & AGPSTAT3_8X)) {
+			*cmd &= ~(AGPSTAT3_8X | AGPSTAT3_RSVD);
+			*cmd |= AGPSTAT3_4X;
+			printk ("%s requested AGPx8 but bridge not capable.\n", current->comm);
+			return;
+		}
+		if (!(*tmp & AGPSTAT3_8X)) {
+			*cmd &= ~(AGPSTAT3_8X | AGPSTAT3_RSVD);
+			*cmd |= AGPSTAT3_4X;
+			printk ("%s requested AGPx8 but graphic card not capable.\n", current->comm);
+			return;
+		}
+		/* All set, bridge & device can do AGP x8*/
+		*cmd &= ~(AGPSTAT3_4X | AGPSTAT3_RSVD);
+		return;
 
-	if (!((*cmd & AGPSTAT3_4X) && (*tmp & AGPSTAT3_4X) && (*mode & AGPSTAT3_4X)))
-		*cmd &= ~AGPSTAT3_4X;
+	} else {
 
-	/* Clear out unwanted bits. */
-	if (*cmd & AGPSTAT3_8X)
-		*cmd &= ~(AGPSTAT3_4X | AGPSTAT3_RSVD);
-	if (*cmd & AGPSTAT3_4X)
+		/*
+		 * If we didn't specify AGPx8, we can only do x4.
+		 * If the hardware can't do x4, we're up shit creek, and never
+		 *  should have got this far.
+		 */
 		*cmd &= ~(AGPSTAT3_8X | AGPSTAT3_RSVD);
+		if ((*cmd & AGPSTAT3_4X) && (*tmp & AGPSTAT3_4X))
+			*cmd |= AGPSTAT3_4X;
+		else {
+			printk (KERN_INFO PFX "Badness. Don't know which AGP mode to set. "
+							"[cmd:%x tmp:%x fell back to:- cmd:%x tmp:%x]\n",
+							origcmd, origtmp, *cmd, *tmp);
+			if (!(*cmd & AGPSTAT3_4X))
+				printk (KERN_INFO PFX "Bridge couldn't do AGP x4.\n");
+			if (!(*tmp & AGPSTAT3_4X))
+				printk (KERN_INFO PFX "Graphic card couldn't do AGP x4.\n");
+		}
+	}
 }
 
 //FIXME: This doesn't smell right.
@@ -479,8 +511,10 @@ u32 agp_collect_device_status(u32 mode, u32 cmd)
 		if (!cap_ptr)
 			continue;
 
+		//FIXME: We should probably skip anything here that
+		// isn't an AGP graphic card.
 		/*
-		 * Ok, here we have a AGP device. Disable impossible 
+		 * Ok, here we have a AGP device. Disable impossible
 		 * settings, and adjust the readqueue to the minimum.
 		 */
 		pci_read_config_dword(device, cap_ptr+PCI_AGP_STATUS, &tmp);
@@ -489,7 +523,7 @@ u32 agp_collect_device_status(u32 mode, u32 cmd)
 		cmd = ((cmd & ~AGPSTAT_RQ_DEPTH) |
 		     min_t(u32, (mode & AGPSTAT_RQ_DEPTH),
 			 min_t(u32, (cmd & AGPSTAT_RQ_DEPTH), (tmp & AGPSTAT_RQ_DEPTH))));
-		
+
 		/* disable FW if it's not supported */
 		if (!((cmd & AGPSTAT_FW) && (tmp & AGPSTAT_FW) && (mode & AGPSTAT_FW)))
 			cmd &= ~AGPSTAT_FW;
@@ -663,7 +697,7 @@ int agp_generic_create_gatt_table(void)
 					    agp_bridge->current_size;
 					break;
 				}
-				temp = agp_bridge->current_size;	
+				temp = agp_bridge->current_size;
 			} else {
 				agp_bridge->aperture_size_idx = i;
 			}
@@ -684,7 +718,7 @@ int agp_generic_create_gatt_table(void)
 		SetPageReserved(page);
 
 	agp_bridge->gatt_table_real = (u32 *) table;
-	agp_gatt_table = (void *)table; 
+	agp_gatt_table = (void *)table;
 
 	agp_bridge->driver->cache_flush();
 	agp_bridge->gatt_table = ioremap_nocache(virt_to_phys(table),
@@ -870,9 +904,9 @@ void agp_generic_free_by_type(struct agp_memory *curr)
 EXPORT_SYMBOL(agp_generic_free_by_type);
 
 
-/* 
+/*
  * Basic Page Allocation Routines -
- * These routines handle page allocation and by default they reserve the allocated 
+ * These routines handle page allocation and by default they reserve the allocated
  * memory.  They also handle incrementing the current_memory_agp value, Which is checked
  * against a maximum value.
  */
@@ -883,7 +917,7 @@ void *agp_generic_alloc_page(void)
 
 	page = alloc_page(GFP_KERNEL);
 	if (page == NULL)
-		return 0;
+		return NULL;
 
 	map_page_into_agp(page);
 
@@ -914,9 +948,9 @@ EXPORT_SYMBOL(agp_generic_destroy_page);
 /* End Basic Page Allocation Routines */
 
 
-/** 
+/**
  * agp_enable  -  initialise the agp point-to-point connection.
- * 
+ *
  * @mode:	agp mode register value to configure with.
  */
 void agp_enable(u32 mode)
diff --git a/drivers/char/agp/hp-agp.c b/drivers/char/agp/hp-agp.c
index cafae37d5..5fd2adc96 100644
--- a/drivers/char/agp/hp-agp.c
+++ b/drivers/char/agp/hp-agp.c
@@ -1,7 +1,12 @@
 /*
- * HP AGPGART routines.
- *	Copyright (C) 2002-2003 Hewlett-Packard Co
- *		Bjorn Helgaas <bjorn_helgaas@hp.com>
+ * HP zx1 AGPGART routines.
+ *
+ * (c) Copyright 2002, 2003 Hewlett-Packard Development Company, L.P.
+ *	Bjorn Helgaas <bjorn.helgaas@hp.com>
+ *
+ * This program is free software; you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License version 2 as
+ * published by the Free Software Foundation.
  */
 
 #include <linux/acpi.h>
diff --git a/drivers/char/agp/intel-agp.c b/drivers/char/agp/intel-agp.c
index f8b991673..f04527540 100644
--- a/drivers/char/agp/intel-agp.c
+++ b/drivers/char/agp/intel-agp.c
@@ -5,11 +5,15 @@
 /*
  * Intel(R) 855GM/852GM and 865G support added by David Dawes
  * <dawes@tungstengraphics.com>.
+ *
+ * Intel(R) 915G support added by Alan Hourihane
+ * <alanh@tungstengraphics.com>.
  */
 
 #include <linux/module.h>
 #include <linux/pci.h>
 #include <linux/init.h>
+#include <linux/pagemap.h>
 #include <linux/agp_backend.h>
 #include "agp.h"
 
@@ -29,6 +33,14 @@
 #define INTEL_I850_MCHCFG	0x50
 #define INTEL_I850_ERRSTS	0xc8
 
+/* intel 915G registers */
+#define I915_GMADDR	0x18
+#define I915_MMADDR	0x10
+#define I915_PTEADDR	0x1C
+#define I915_GMCH_GMS_STOLEN_48M	(0x6 << 4)
+#define I915_GMCH_GMS_STOLEN_64M	(0x7 << 4)
+
+
 /* Intel 7505 registers */
 #define INTEL_I7505_APSIZE	0x74
 #define INTEL_I7505_NCAPID	0x60
@@ -143,6 +155,40 @@ static void intel_i810_agp_enable(u32 mode)
 	return;
 }
 
+/* Exists to support ARGB cursors */
+static void *i8xx_alloc_pages(void)
+{
+	struct page * page;
+
+	page = alloc_pages(GFP_KERNEL, 2);
+	if (page == NULL) {
+		return 0;
+	}
+	if (change_page_attr(page, 4, PAGE_KERNEL_NOCACHE) < 0) {
+		__free_page(page); 
+		return 0;
+	}
+	get_page(page);
+	SetPageLocked(page);
+	atomic_inc(&agp_bridge->current_memory_agp);
+	return page_address(page);
+}
+
+static void i8xx_destroy_pages(void *addr)
+{
+	struct page *page;
+
+	if (addr == NULL)
+		return;
+	
+	page = virt_to_page(addr);
+	change_page_attr(page, 4, PAGE_KERNEL);
+	put_page(page);
+	unlock_page(page);
+	free_pages((unsigned long)addr, 2);
+	atomic_dec(&agp_bridge->current_memory_agp);
+}
+
 static int intel_i810_insert_entries(struct agp_memory *mem, off_t pg_start,
 				int type)
 {
@@ -218,20 +264,36 @@ static struct agp_memory *alloc_agpphysmem_i8xx(size_t pg_count, int type)
 	struct agp_memory *new;
 	void *addr;
 
-	if (pg_count != 1)
+	if (pg_count != 1 && pg_count != 4)
 		return NULL;
 
-	addr = agp_bridge->driver->agp_alloc_page();
+	switch (pg_count) {
+	case 1: addr = agp_bridge->driver->agp_alloc_page();
+		break;
+	case 4:
+		/* kludge to get 4 physical pages for ARGB cursor */
+		addr = i8xx_alloc_pages();
+		break;
+	default:
+		return NULL;
+	}
+
 	if (addr == NULL)
 		return NULL;
 
-	new = agp_create_memory(1);
+	new = agp_create_memory(pg_count);
 	if (new == NULL)
 		return NULL;
 
-	new->memory[0] = agp_bridge->driver->mask_memory(virt_to_phys(addr), type);
-	new->page_count = 1;
-	new->num_scratch_pages = 1;
+	new->memory[0] = virt_to_phys(addr);
+	if (pg_count == 4) {
+		/* kludge to get 4 physical pages for ARGB cursor */
+		new->memory[1] = new->memory[0] + PAGE_SIZE;
+		new->memory[2] = new->memory[1] + PAGE_SIZE;
+		new->memory[3] = new->memory[2] + PAGE_SIZE;
+	}
+	new->page_count = pg_count;
+	new->num_scratch_pages = pg_count;
 	new->type = AGP_PHYS_MEMORY;
 	new->physical = new->memory[0];
 	return new;
@@ -265,7 +327,11 @@ static void intel_i810_free_by_type(struct agp_memory *curr)
 {
 	agp_free_key(curr->key);
 	if(curr->type == AGP_PHYS_MEMORY) {
-		agp_bridge->driver->agp_destroy_page(phys_to_virt(curr->memory[0]));
+		if (curr->page_count == 4)
+			i8xx_destroy_pages(phys_to_virt(curr->memory[0]));
+		else
+	   		agp_bridge->driver->agp_destroy_page(
+				 phys_to_virt(curr->memory[0]));
 		vfree(curr->memory);
 	}
 	kfree(curr);
@@ -281,12 +347,14 @@ static struct aper_size_info_fixed intel_i830_sizes[] =
 {
 	{128, 32768, 5},
 	/* The 64M mode still requires a 128k gatt */
-	{64, 16384, 5}
+	{64, 16384, 5},
+	{256, 65536, 6},
 };
 
 static struct _intel_i830_private {
 	struct pci_dev *i830_dev;		/* device one */
 	volatile u8 *registers;
+	volatile u32 *gtt;		/* I915G */
 	int gtt_entries;
 } intel_i830_private;
 
@@ -297,20 +365,26 @@ static void intel_i830_init_gtt_entries(void)
 	u8 rdct;
 	int local = 0;
 	static const int ddt[4] = { 0, 16, 32, 64 };
+	int size;
 
 	pci_read_config_word(agp_bridge->dev,I830_GMCH_CTRL,&gmch_ctrl);
 
+	/* We obtain the size of the GTT, which is also stored (for some
+	 * reason) at the top of stolen memory. Then we add 4KB to that
+ 	 * for the video BIOS popup, which is also stored in there. */
+	size = agp_bridge->driver->fetch_size() + 4;
+
 	if (agp_bridge->dev->device == PCI_DEVICE_ID_INTEL_82830_HB ||
 	    agp_bridge->dev->device == PCI_DEVICE_ID_INTEL_82845G_HB) {
 		switch (gmch_ctrl & I830_GMCH_GMS_MASK) {
 		case I830_GMCH_GMS_STOLEN_512:
-			gtt_entries = KB(512) - KB(132);
+			gtt_entries = KB(512) - KB(size);
 			break;
 		case I830_GMCH_GMS_STOLEN_1024:
-			gtt_entries = MB(1) - KB(132);
+			gtt_entries = MB(1) - KB(size);
 			break;
 		case I830_GMCH_GMS_STOLEN_8192:
-			gtt_entries = MB(8) - KB(132);
+			gtt_entries = MB(8) - KB(size);
 			break;
 		case I830_GMCH_GMS_LOCAL:
 			rdct = INREG8(intel_i830_private.registers,
@@ -326,20 +400,33 @@ static void intel_i830_init_gtt_entries(void)
 	} else {
 		switch (gmch_ctrl & I830_GMCH_GMS_MASK) {
 		case I855_GMCH_GMS_STOLEN_1M:
-			gtt_entries = MB(1) - KB(132);
+			gtt_entries = MB(1) - KB(size);
 			break;
 		case I855_GMCH_GMS_STOLEN_4M:
-			gtt_entries = MB(4) - KB(132);
+			gtt_entries = MB(4) - KB(size);
 			break;
 		case I855_GMCH_GMS_STOLEN_8M:
-			gtt_entries = MB(8) - KB(132);
+			gtt_entries = MB(8) - KB(size);
 			break;
 		case I855_GMCH_GMS_STOLEN_16M:
-			gtt_entries = MB(16) - KB(132);
+			gtt_entries = MB(16) - KB(size);
 			break;
 		case I855_GMCH_GMS_STOLEN_32M:
-			gtt_entries = MB(32) - KB(132);
+			gtt_entries = MB(32) - KB(size);
+			break;
+		case I915_GMCH_GMS_STOLEN_48M:
+			/* Check it's really I915G */
+			if (agp_bridge->dev->device == PCI_DEVICE_ID_INTEL_82915G_HB)
+				gtt_entries = MB(48) - KB(size);
+			else
+				gtt_entries = 0;
 			break;
+		case I915_GMCH_GMS_STOLEN_64M:
+			/* Check it's really I915G */
+			if (agp_bridge->dev->device == PCI_DEVICE_ID_INTEL_82915G_HB)
+				gtt_entries = MB(64) - KB(size);
+			else
+				gtt_entries = 0;
 		default:
 			gtt_entries = 0;
 			break;
@@ -369,7 +456,7 @@ static int intel_i830_create_gatt_table(void)
 	size = agp_bridge->current_size;
 	page_order = size->page_order;
 	num_entries = size->num_entries;
-	agp_bridge->gatt_table_real = 0;
+	agp_bridge->gatt_table_real = NULL;
 
 	pci_read_config_dword(intel_i830_private.i830_dev,I810_MMADDR,&temp);
 	temp &= 0xfff80000;
@@ -421,7 +508,7 @@ static int intel_i830_fetch_size(void)
 		agp_bridge->aperture_size_idx = 0;
 		return(values[0].size);
 	} else {
-		agp_bridge->previous_size = agp_bridge->current_size = (void *) values;
+		agp_bridge->previous_size = agp_bridge->current_size = (void *) (values + 1);
 		agp_bridge->aperture_size_idx = 1;
 		return(values[1].size);
 	}
@@ -532,6 +619,161 @@ static struct agp_memory *intel_i830_alloc_by_type(size_t pg_count,int type)
 	return(NULL);
 }
 
+static int intel_i915_configure(void)
+{
+	struct aper_size_info_fixed *current_size;
+	u32 temp;
+	u16 gmch_ctrl;
+	int i;
+
+	current_size = A_SIZE_FIX(agp_bridge->current_size);
+
+	pci_read_config_dword(intel_i830_private.i830_dev, I915_GMADDR, &temp);
+
+	agp_bridge->gart_bus_addr = (temp & PCI_BASE_ADDRESS_MEM_MASK);
+
+	pci_read_config_word(agp_bridge->dev,I830_GMCH_CTRL,&gmch_ctrl);
+	gmch_ctrl |= I830_GMCH_ENABLED;
+	pci_write_config_word(agp_bridge->dev,I830_GMCH_CTRL,gmch_ctrl);
+
+	OUTREG32(intel_i830_private.registers,I810_PGETBL_CTL,agp_bridge->gatt_bus_addr | I810_PGETBL_ENABLED);
+	global_cache_flush();
+
+	if (agp_bridge->driver->needs_scratch_page) {
+		for (i = intel_i830_private.gtt_entries; i < current_size->num_entries; i++)
+			OUTREG32(intel_i830_private.gtt, i, agp_bridge->scratch_page);
+	}
+
+	return (0);
+}
+
+static void intel_i915_cleanup(void)
+{
+	iounmap((void *) intel_i830_private.gtt);
+	iounmap((void *) intel_i830_private.registers);
+}
+
+static int intel_i915_insert_entries(struct agp_memory *mem,off_t pg_start,
+				int type)
+{
+	int i,j,num_entries;
+	void *temp;
+
+	temp = agp_bridge->current_size;
+	num_entries = A_SIZE_FIX(temp)->num_entries;
+
+	if (pg_start < intel_i830_private.gtt_entries) {
+		printk (KERN_DEBUG PFX "pg_start == 0x%.8lx,intel_i830_private.gtt_entries == 0x%.8x\n",
+				pg_start,intel_i830_private.gtt_entries);
+
+		printk (KERN_INFO PFX "Trying to insert into local/stolen memory\n");
+		return (-EINVAL);
+	}
+
+	if ((pg_start + mem->page_count) > num_entries)
+		return (-EINVAL);
+
+	/* The i830 can't check the GTT for entries since its read only,
+	 * depend on the caller to make the correct offset decisions.
+	 */
+
+	if ((type != 0 && type != AGP_PHYS_MEMORY) ||
+		(mem->type != 0 && mem->type != AGP_PHYS_MEMORY))
+		return (-EINVAL);
+
+	global_cache_flush();
+
+	for (i = 0, j = pg_start; i < mem->page_count; i++, j++)
+		OUTREG32(intel_i830_private.gtt, j, agp_bridge->driver->mask_memory(mem->memory[i], mem->type));
+
+	global_cache_flush();
+
+	agp_bridge->driver->tlb_flush(mem);
+
+	return(0);
+}
+
+static int intel_i915_remove_entries(struct agp_memory *mem,off_t pg_start,
+				int type)
+{
+	int i;
+
+	global_cache_flush();
+
+	if (pg_start < intel_i830_private.gtt_entries) {
+		printk (KERN_INFO PFX "Trying to disable local/stolen memory\n");
+		return (-EINVAL);
+	}
+
+	for (i = pg_start; i < (mem->page_count + pg_start); i++)
+		OUTREG32(intel_i830_private.gtt, i, agp_bridge->scratch_page);
+
+	global_cache_flush();
+
+	agp_bridge->driver->tlb_flush(mem);
+
+	return (0);
+}
+
+static int intel_i915_fetch_size(void)
+{
+	struct aper_size_info_fixed *values;
+	u32 temp, offset = 0;
+
+#define I915_256MB_ADDRESS_MASK (1<<27)
+
+	values = A_SIZE_FIX(agp_bridge->driver->aperture_sizes);
+
+	pci_read_config_dword(intel_i830_private.i830_dev, I915_GMADDR, &temp);
+	if (temp & I915_256MB_ADDRESS_MASK)
+		offset = 0;	/* 128MB aperture */
+	else
+		offset = 2;	/* 256MB aperture */
+	agp_bridge->previous_size = agp_bridge->current_size = (void *)(values + offset);
+	return(values[offset].size);
+}
+
+/* The intel i915 automatically initializes the agp aperture during POST.
+ * Use the memory already set aside for in the GTT.
+ */
+static int intel_i915_create_gatt_table(void)
+{
+	int page_order;
+	struct aper_size_info_fixed *size;
+	int num_entries;
+	u32 temp, temp2;
+
+	size = agp_bridge->current_size;
+	page_order = size->page_order;
+	num_entries = size->num_entries;
+	agp_bridge->gatt_table_real = 0;
+
+	pci_read_config_dword(intel_i830_private.i830_dev, I915_MMADDR, &temp);
+	pci_read_config_dword(intel_i830_private.i830_dev, I915_PTEADDR,&temp2);
+
+	intel_i830_private.gtt = (volatile u32 *) ioremap(temp2, 256 * 1024);
+	if (!intel_i830_private.gtt) 
+		return (-ENOMEM);
+
+	temp &= 0xfff80000;
+
+	intel_i830_private.registers = (volatile u8 *) ioremap(temp,128 * 4096);
+	if (!intel_i830_private.registers)
+		return (-ENOMEM);
+
+	temp = INREG32(intel_i830_private.registers,I810_PGETBL_CTL) & 0xfffff000;
+	global_cache_flush();
+
+	/* we have to call this as early as possible after the MMIO base address is known */
+	intel_i830_init_gtt_entries();
+
+	agp_bridge->gatt_table = NULL;
+
+	agp_bridge->gatt_bus_addr = temp;
+
+	return(0);
+}
+
 static int intel_fetch_size(void)
 {
 	int i;
@@ -1041,7 +1283,7 @@ static struct agp_bridge_driver intel_830_driver = {
 	.owner			= THIS_MODULE,
 	.aperture_sizes		= intel_i830_sizes,
 	.size_type		= FIXED_APER_SIZE,
-	.num_aperture_sizes 	= 2,
+	.num_aperture_sizes 	= 3,
 	.needs_scratch_page	= TRUE,
 	.configure		= intel_i830_configure,
 	.fetch_size		= intel_i830_fetch_size,
@@ -1199,6 +1441,31 @@ static struct agp_bridge_driver intel_860_driver = {
 	.agp_destroy_page	= agp_generic_destroy_page,
 };
 
+static struct agp_bridge_driver intel_915_driver = {
+	.owner			= THIS_MODULE,
+	.aperture_sizes		= intel_i830_sizes,
+	.size_type		= FIXED_APER_SIZE,
+	.num_aperture_sizes 	= 3,
+	.needs_scratch_page	= TRUE,
+	.configure		= intel_i915_configure,
+	.fetch_size		= intel_i915_fetch_size,
+	.cleanup		= intel_i915_cleanup,
+	.tlb_flush		= intel_i810_tlbflush,
+	.mask_memory		= intel_i810_mask_memory,
+	.masks			= intel_i810_masks,
+	.agp_enable		= intel_i810_agp_enable,
+	.cache_flush		= global_cache_flush,
+	.create_gatt_table	= intel_i915_create_gatt_table,
+	.free_gatt_table	= intel_i830_free_gatt_table,
+	.insert_memory		= intel_i915_insert_entries,
+	.remove_memory		= intel_i915_remove_entries,
+	.alloc_by_type		= intel_i830_alloc_by_type,
+	.free_by_type		= intel_i810_free_by_type,
+	.agp_alloc_page		= agp_generic_alloc_page,
+	.agp_destroy_page	= agp_generic_destroy_page,
+};
+
+
 static struct agp_bridge_driver intel_7505_driver = {
 	.owner			= THIS_MODULE,
 	.aperture_sizes		= intel_8xx_sizes,
@@ -1373,9 +1640,17 @@ static int __devinit agp_intel_probe(struct pci_dev *pdev,
 		bridge->driver = &intel_845_driver;
 		name = "i875";
 		break;
+	case PCI_DEVICE_ID_INTEL_82915G_HB:
+		if (find_i830(PCI_DEVICE_ID_INTEL_82915G_IG)) {
+			bridge->driver = &intel_915_driver;
+		} else {
+			bridge->driver = &intel_845_driver;
+		}
+		name = "915G";
+		break;
 	case PCI_DEVICE_ID_INTEL_7505_0:
 		bridge->driver = &intel_7505_driver;
-		name =  "E7505";
+		name = "E7505";
 		break;
 	case PCI_DEVICE_ID_INTEL_7205_0:
 		bridge->driver = &intel_7505_driver;
@@ -1458,6 +1733,8 @@ static int agp_intel_resume(struct pci_dev *pdev)
 		intel_845_configure();
 	else if (bridge->driver == &intel_830mp_driver)
 		intel_830mp_configure();
+	else if (bridge->driver == &intel_915_driver)
+		intel_i915_configure();
 
 	return 0;
 }
diff --git a/drivers/char/agp/intel-mch-agp.c b/drivers/char/agp/intel-mch-agp.c
index dff4d9933..c8f230acc 100644
--- a/drivers/char/agp/intel-mch-agp.c
+++ b/drivers/char/agp/intel-mch-agp.c
@@ -167,7 +167,7 @@ static int intel_i830_create_gatt_table(void)
 	size = agp_bridge->current_size;
 	page_order = size->page_order;
 	num_entries = size->num_entries;
-	agp_bridge->gatt_table_real = 0;
+	agp_bridge->gatt_table_real = NULL;
 
 	pci_read_config_dword(intel_i830_private.i830_dev,I810_MMADDR,&temp);
 	temp &= 0xfff80000;
diff --git a/drivers/char/agp/sis-agp.c b/drivers/char/agp/sis-agp.c
index 549149ff5..2a99c738f 100644
--- a/drivers/char/agp/sis-agp.c
+++ b/drivers/char/agp/sis-agp.c
@@ -144,6 +144,10 @@ struct agp_bridge_driver sis_driver = {
 
 static struct agp_device_ids sis_agp_device_ids[] __devinitdata =
 {
+	{
+		.device_id	= PCI_DEVICE_ID_SI_5591_AGP,
+		.chipset_name	= "5591",
+	},
 	{
 		.device_id	= PCI_DEVICE_ID_SI_530,
 		.chipset_name	= "530",
diff --git a/drivers/char/agp/sworks-agp.c b/drivers/char/agp/sworks-agp.c
index d3f3e80ff..44e11acbc 100644
--- a/drivers/char/agp/sworks-agp.c
+++ b/drivers/char/agp/sworks-agp.c
@@ -447,6 +447,7 @@ static int __devinit agp_serverworks_probe(struct pci_dev *pdev,
 	struct agp_bridge_data *bridge;
 	struct pci_dev *bridge_dev;
 	u32 temp, temp2;
+	u8 cap_ptr = 0;
 
 	/* Everything is on func 1 here so we are hardcoding function one */
 	bridge_dev = pci_find_slot((unsigned int)pdev->bus->number,
@@ -457,6 +458,8 @@ static int __devinit agp_serverworks_probe(struct pci_dev *pdev,
 		return -ENODEV;
 	}
 
+	cap_ptr = pci_find_capability(pdev, PCI_CAP_ID_AGP);
+
 	switch (pdev->device) {
 	case 0x0006:
 		/* ServerWorks CNB20HE
@@ -470,14 +473,15 @@ static int __devinit agp_serverworks_probe(struct pci_dev *pdev,
 		break;
 
 	default:
-		printk(KERN_ERR PFX "Unsupported Serverworks chipset "
-				"(device id: %04x)\n", pdev->device);
+		if (cap_ptr)
+			printk(KERN_ERR PFX "Unsupported Serverworks chipset "
+					"(device id: %04x)\n", pdev->device);
 		return -ENODEV;
 	}
 
 	serverworks_private.svrwrks_dev = bridge_dev;
 	serverworks_private.gart_addr_ofs = 0x10;
-	
+
 	pci_read_config_dword(pdev, SVWRKS_APSIZE, &temp);
 	if (temp & PCI_BASE_ADDRESS_MEM_TYPE_64) {
 		pci_read_config_dword(pdev, SVWRKS_APSIZE + 4, &temp2);
diff --git a/drivers/char/agp/via-agp.c b/drivers/char/agp/via-agp.c
index 2f5c50c29..c619722e5 100644
--- a/drivers/char/agp/via-agp.c
+++ b/drivers/char/agp/via-agp.c
@@ -348,6 +348,21 @@ static struct agp_device_ids via_agp_device_ids[] __devinitdata =
 		.device_id	= PCI_DEVICE_ID_VIA_PX8X0_0,
 		.chipset_name	= "PM800/PN800/PM880/PN880",
 	},
+	/* KT880 */
+	{
+		.device_id	= PCI_DEVICE_ID_VIA_3269_0,
+		.chipset_name	= "KT880",
+	},
+	/* KTxxx/Px8xx */
+	{
+		.device_id	= PCI_DEVICE_ID_VIA_83_87XX_1,
+		.chipset_name	= "VT83xx/VT87xx/KTxxx/Px8xx",
+	},
+	/* P4M800 */
+	{
+		.device_id	= PCI_DEVICE_ID_VIA_3296_0,
+		.chipset_name	= "P4M800",
+	},
 
 	{ }, /* dummy final entry, always present */
 };
@@ -434,6 +449,7 @@ static struct pci_device_id agp_via_pci_table[] = {
 	.subvendor	= PCI_ANY_ID,			\
 	.subdevice	= PCI_ANY_ID,			\
 	}
+	ID(PCI_DEVICE_ID_VIA_82C597_0),
 	ID(PCI_DEVICE_ID_VIA_82C598_0),
 	ID(PCI_DEVICE_ID_VIA_8501_0),
 	ID(PCI_DEVICE_ID_VIA_8601_0),
@@ -456,7 +472,10 @@ static struct pci_device_id agp_via_pci_table[] = {
 	ID(PCI_DEVICE_ID_VIA_8378_0),
 	ID(PCI_DEVICE_ID_VIA_PT880),
 	ID(PCI_DEVICE_ID_VIA_8783_0),
-	ID(PCI_DEVICE_ID_VIA_PX8X0_0),	
+	ID(PCI_DEVICE_ID_VIA_PX8X0_0),
+	ID(PCI_DEVICE_ID_VIA_3269_0),
+	ID(PCI_DEVICE_ID_VIA_83_87XX_1),
+	ID(PCI_DEVICE_ID_VIA_3296_0),
 	{ }
 };
 
diff --git a/drivers/char/applicom.c b/drivers/char/applicom.c
index 4d4eaf2e4..0b2c40e94 100644
--- a/drivers/char/applicom.c
+++ b/drivers/char/applicom.c
@@ -105,8 +105,8 @@ static unsigned int WriteErrorCount;	/* number of write error      */
 static unsigned int ReadErrorCount;	/* number of read error       */
 static unsigned int DeviceErrorCount;	/* number of device error     */
 
-static ssize_t ac_read (struct file *, char *, size_t, loff_t *);
-static ssize_t ac_write (struct file *, const char *, size_t, loff_t *);
+static ssize_t ac_read (struct file *, char __user *, size_t, loff_t *);
+static ssize_t ac_write (struct file *, const char __user *, size_t, loff_t *);
 static int ac_ioctl(struct inode *, struct file *, unsigned int,
 		    unsigned long);
 static irqreturn_t ac_interrupt(int, void *, struct pt_regs *);
@@ -343,7 +343,7 @@ int __init applicom_init(void)
 __initcall(applicom_init);
 #endif
 
-static ssize_t ac_write(struct file *file, const char *buf, size_t count, loff_t * ppos)
+static ssize_t ac_write(struct file *file, const char __user *buf, size_t count, loff_t * ppos)
 {
 	unsigned int NumCard;	/* Board number 1 -> 8           */
 	unsigned int IndexCard;	/* Index board number 0 -> 7     */
@@ -467,7 +467,7 @@ static ssize_t ac_write(struct file *file, const char *buf, size_t count, loff_t
 	return 0;
 }
 
-static int do_ac_read(int IndexCard, char *buf,
+static int do_ac_read(int IndexCard, char __user *buf,
 		struct st_ram_io *st_loc, struct mailbox *mailbox)
 {
 	unsigned long from = (unsigned long)apbs[IndexCard].RamIO + RAM_TO_PC;
@@ -521,7 +521,7 @@ static int do_ac_read(int IndexCard, char *buf,
 	return (sizeof(struct st_ram_io) + sizeof(struct mailbox));
 }
 
-static ssize_t ac_read (struct file *filp, char *buf, size_t count, loff_t *ptr)
+static ssize_t ac_read (struct file *filp, char __user *buf, size_t count, loff_t *ptr)
 {
 	unsigned long flags;
 	unsigned int i;
@@ -689,6 +689,7 @@ static int ac_ioctl(struct inode *inode, struct file *file, unsigned int cmd, un
 	int ret = 0;
 	volatile unsigned char byte_reset_it;
 	struct st_ram_io *adgl;
+	void __user *argp = (void __user *)arg;
 
 	/* In general, the device is only openable by root anyway, so we're not
 	   particularly concerned that bogus ioctls can flood the console. */
@@ -697,7 +698,7 @@ static int ac_ioctl(struct inode *inode, struct file *file, unsigned int cmd, un
 	if (!adgl)
 		return -ENOMEM;
 
-	if (copy_from_user(adgl, (void *)arg,sizeof(struct st_ram_io))) {
+	if (copy_from_user(adgl, argp, sizeof(struct st_ram_io))) {
 		kfree(adgl);
 		return -EFAULT;
 	}
@@ -721,7 +722,7 @@ static int ac_ioctl(struct inode *inode, struct file *file, unsigned int cmd, un
 		pmem = apbs[IndexCard].RamIO;
 		for (i = 0; i < sizeof(struct st_ram_io); i++)
 			((unsigned char *)adgl)[i]=readb(pmem++);
-		if (copy_to_user((void *)arg, adgl, sizeof(struct st_ram_io)))
+		if (copy_to_user(argp, adgl, sizeof(struct st_ram_io)))
 			ret = -EFAULT;
 		break;
 	case 1:
@@ -742,7 +743,7 @@ static int ac_ioctl(struct inode *inode, struct file *file, unsigned int cmd, un
 			(readb(apbs[IndexCard].RamIO + SERIAL_NUMBER + 1) << 8) + 
 			(readb(apbs[IndexCard].RamIO + SERIAL_NUMBER + 2) );
 
-		if (copy_to_user((void *)arg, adgl, sizeof(struct st_ram_io)))
+		if (copy_to_user(argp, adgl, sizeof(struct st_ram_io)))
 			ret = -EFAULT;
 		break;
 	case 2:
@@ -768,7 +769,7 @@ static int ac_ioctl(struct inode *inode, struct file *file, unsigned int cmd, un
 		pmem = apbs[IndexCard].RamIO + TIC_OWNER_TO_PC;
 		adgl->tic_owner_to_pc     = readb(pmem++);
 		adgl->numcard_owner_to_pc = readb(pmem);
-		if (copy_to_user((void *)arg, adgl,sizeof(struct st_ram_io)))
+		if (copy_to_user(argp, adgl,sizeof(struct st_ram_io)))
 			ret = -EFAULT;
 		break;
 	case 5:
diff --git a/drivers/char/cyclades.c b/drivers/char/cyclades.c
index 48ae91c92..e69dc6d00 100644
--- a/drivers/char/cyclades.c
+++ b/drivers/char/cyclades.c
@@ -676,8 +676,6 @@ static char rcsid[] =
 #include <linux/stat.h>
 #include <linux/proc_fs.h>
 
-#define cy_put_user	put_user
-
 static void cy_throttle (struct tty_struct *tty);
 static void cy_send_xchar (struct tty_struct *tty, char ch);
 
@@ -723,7 +721,7 @@ static unsigned char *cy_isa_addresses[] = {
         (unsigned char *) 0xDA000,
         (unsigned char *) 0xDC000,
         (unsigned char *) 0xDE000,
-        0,0,0,0,0,0,0,0
+        NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL
 };
 #define NR_ISA_ADDRS (sizeof(cy_isa_addresses)/sizeof(unsigned char*))
 
@@ -2238,7 +2236,7 @@ shutdown(struct cyclades_port * info)
 	    if (info->xmit_buf){
 		unsigned char * temp;
 		temp = info->xmit_buf;
-		info->xmit_buf = 0;
+		info->xmit_buf = NULL;
 		free_page((unsigned long) temp);
 	    }
 	    cy_writeb((u_long)base_addr+(CyCAR<<index), (u_char)channel);
@@ -2290,7 +2288,7 @@ shutdown(struct cyclades_port * info)
 	    if (info->xmit_buf){
 		unsigned char * temp;
 		temp = info->xmit_buf;
-		info->xmit_buf = 0;
+		info->xmit_buf = NULL;
 		free_page((unsigned long) temp);
 	    }
 	    
@@ -2858,7 +2856,7 @@ cy_close(struct tty_struct *tty, struct file *filp)
 
     tty->closing = 0;
     info->event = 0;
-    info->tty = 0;
+    info->tty = NULL;
     if (info->blocked_open) {
 	CY_UNLOCK(info, flags);
         if (info->close_delay) {
@@ -3536,7 +3534,7 @@ set_line_char(struct cyclades_port * info)
 
 static int
 get_serial_info(struct cyclades_port * info,
-                           struct serial_struct * retinfo)
+                           struct serial_struct __user * retinfo)
 {
   struct serial_struct tmp;
   struct cyclades_card *cinfo = &cy_card[info->card];
@@ -3559,7 +3557,7 @@ get_serial_info(struct cyclades_port * info,
 
 static int
 set_serial_info(struct cyclades_port * info,
-                           struct serial_struct * new_info)
+                           struct serial_struct __user * new_info)
 {
   struct serial_struct new_serial;
   struct cyclades_port old_info;
@@ -3613,7 +3611,7 @@ check_and_exit:
  *	    transmit holding register is empty.  This functionality
  *	    allows an RS485 driver to be written in user space.
  */
-static int get_lsr_info(struct cyclades_port *info, unsigned int *value)
+static int get_lsr_info(struct cyclades_port *info, unsigned int __user *value)
 {
     int card, chip, channel, index;
     unsigned char status;
@@ -3638,7 +3636,7 @@ static int get_lsr_info(struct cyclades_port *info, unsigned int *value)
 	/* Not supported yet */
 	return -EINVAL;
     }
-    return cy_put_user(result, (unsigned long *) value);
+    return put_user(result, (unsigned long __user *) value);
 }
 
 static int
@@ -3916,7 +3914,7 @@ cy_break(struct tty_struct *tty, int break_state)
 } /* cy_break */
 
 static int
-get_mon_info(struct cyclades_port * info, struct cyclades_monitor * mon)
+get_mon_info(struct cyclades_port * info, struct cyclades_monitor __user * mon)
 {
 
     if(copy_to_user(mon, &info->mon, sizeof(struct cyclades_monitor)))
@@ -3961,7 +3959,7 @@ set_threshold(struct cyclades_port * info, unsigned long value)
 
 
 static int
-get_threshold(struct cyclades_port * info, unsigned long *value)
+get_threshold(struct cyclades_port * info, unsigned long __user *value)
 {
   unsigned char *base_addr;
   int card,channel,chip,index;
@@ -3978,7 +3976,7 @@ get_threshold(struct cyclades_port * info, unsigned long *value)
 		       + (cy_chip_offset[chip]<<index));
 
 	tmp = cy_readb(base_addr+(CyCOR3<<index)) & CyREC_FIFO;
-	return cy_put_user(tmp,value);
+	return put_user(tmp,value);
     } else {
 	// Nothing to do!
 	return 0;
@@ -3995,9 +3993,9 @@ set_default_threshold(struct cyclades_port * info, unsigned long value)
 
 
 static int
-get_default_threshold(struct cyclades_port * info, unsigned long *value)
+get_default_threshold(struct cyclades_port * info, unsigned long __user *value)
 {
-    return cy_put_user(info->default_threshold,value);
+    return put_user(info->default_threshold,value);
 }/* get_default_threshold */
 
 
@@ -4029,7 +4027,7 @@ set_timeout(struct cyclades_port * info, unsigned long value)
 
 
 static int
-get_timeout(struct cyclades_port * info, unsigned long *value)
+get_timeout(struct cyclades_port * info, unsigned long __user *value)
 {
   unsigned char *base_addr;
   int card,channel,chip,index;
@@ -4046,7 +4044,7 @@ get_timeout(struct cyclades_port * info, unsigned long *value)
 		       + (cy_chip_offset[chip]<<index));
 
 	tmp = cy_readb(base_addr+(CyRTPR<<index));
-	return cy_put_user(tmp,value);
+	return put_user(tmp,value);
     } else {
 	// Nothing to do!
 	return 0;
@@ -4063,9 +4061,9 @@ set_default_timeout(struct cyclades_port * info, unsigned long value)
 
 
 static int
-get_default_timeout(struct cyclades_port * info, unsigned long *value)
+get_default_timeout(struct cyclades_port * info, unsigned long __user *value)
 {
-    return cy_put_user(info->default_timeout,value);
+    return put_user(info->default_timeout,value);
 }/* get_default_timeout */
 
 /*
@@ -4079,9 +4077,10 @@ cy_ioctl(struct tty_struct *tty, struct file * file,
 {
   struct cyclades_port * info = (struct cyclades_port *)tty->driver_data;
   struct cyclades_icount cprev, cnow;		/* kernel counter temps */
-  struct serial_icounter_struct *p_cuser;	/* user space */
+  struct serial_icounter_struct __user *p_cuser;	/* user space */
   int ret_val = 0;
   unsigned long flags;
+  void __user *argp = (void __user *)arg;
 
     if (serial_paranoia_check(info, tty->name, "cy_ioctl"))
 	return -ENODEV;
@@ -4093,31 +4092,31 @@ cy_ioctl(struct tty_struct *tty, struct file * file,
 
     switch (cmd) {
         case CYGETMON:
-            ret_val = get_mon_info(info, (struct cyclades_monitor *)arg);
+            ret_val = get_mon_info(info, argp);
             break;
         case CYGETTHRESH:
-            ret_val = get_threshold(info, (unsigned long *)arg);
+            ret_val = get_threshold(info, argp);
             break;
         case CYSETTHRESH:
-            ret_val = set_threshold(info, (unsigned long)arg);
+            ret_val = set_threshold(info, arg);
             break;
         case CYGETDEFTHRESH:
-            ret_val = get_default_threshold(info, (unsigned long *)arg);
+            ret_val = get_default_threshold(info, argp);
             break;
         case CYSETDEFTHRESH:
-            ret_val = set_default_threshold(info, (unsigned long)arg);
+            ret_val = set_default_threshold(info, arg);
             break;
         case CYGETTIMEOUT:
-            ret_val = get_timeout(info, (unsigned long *)arg);
+            ret_val = get_timeout(info, argp);
             break;
         case CYSETTIMEOUT:
-            ret_val = set_timeout(info, (unsigned long)arg);
+            ret_val = set_timeout(info, arg);
             break;
         case CYGETDEFTIMEOUT:
-            ret_val = get_default_timeout(info, (unsigned long *)arg);
+            ret_val = get_default_timeout(info, argp);
             break;
         case CYSETDEFTIMEOUT:
-            ret_val = set_default_timeout(info, (unsigned long)arg);
+            ret_val = set_default_timeout(info, arg);
             break;
 	case CYSETRFLOW:
     	    info->rflow = (int)arg;
@@ -4134,7 +4133,7 @@ cy_ioctl(struct tty_struct *tty, struct file * file,
 	    ret_val = info->rtsdtr_inv;
 	    break;
 	case CYGETCARDINFO:
-            if (copy_to_user((void *)arg, (void *)&cy_card[info->card], 
+            if (copy_to_user(argp, &cy_card[info->card], 
 			sizeof (struct cyclades_card))) {
 		ret_val = -EFAULT;
 		break;
@@ -4161,13 +4160,13 @@ cy_ioctl(struct tty_struct *tty, struct file * file,
 	    ret_val = info->closing_wait / (HZ/100);
 	    break;
         case TIOCGSERIAL:
-            ret_val = get_serial_info(info, (struct serial_struct *) arg);
+            ret_val = get_serial_info(info, argp);
             break;
         case TIOCSSERIAL:
-            ret_val = set_serial_info(info, (struct serial_struct *) arg);
+            ret_val = set_serial_info(info, argp);
             break;
 	case TIOCSERGETLSR: /* Get line status register */
-	    ret_val = get_lsr_info(info, (unsigned int *) arg);
+	    ret_val = get_lsr_info(info, argp);
 	    break;
 	/*
 	 * Wait for any of the 4 modem inputs (DCD,RI,DSR,CTS) to change 
@@ -4215,7 +4214,7 @@ cy_ioctl(struct tty_struct *tty, struct file * file,
 	    CY_LOCK(info, flags);
 	    cnow = info->icount;
 	    CY_UNLOCK(info, flags);
-	    p_cuser = (struct serial_icounter_struct *) arg;
+	    p_cuser = argp;
 	    ret_val = put_user(cnow.cts, &p_cuser->cts);
 	    if (ret_val) return ret_val;
 	    ret_val = put_user(cnow.dsr, &p_cuser->dsr);
@@ -4584,7 +4583,7 @@ cy_hangup(struct tty_struct *tty)
 #ifdef CY_DEBUG_COUNT
     printk("cyc:cy_hangup (%d): setting count to 0\n", current->pid);
 #endif
-    info->tty = 0;
+    info->tty = NULL;
     info->flags &= ~ASYNC_NORMAL_ACTIVE;
     wake_up_interruptible(&info->open_wait);
 } /* cy_hangup */
@@ -5472,7 +5471,7 @@ cy_init(void)
                     info->line = port;
 		    info->chip_rev = 0;
                     info->flags = STD_COM_FLAGS;
-                    info->tty = 0;
+                    info->tty = NULL;
 		    if (mailbox == ZO_V1)
 			info->xmit_fifo_size = CYZ_FIFO_SIZE;
 		    else
@@ -5534,7 +5533,7 @@ cy_init(void)
                     info->card = board;
                     info->line = port;
                     info->flags = STD_COM_FLAGS;
-                    info->tty = 0;
+                    info->tty = NULL;
                     info->xmit_fifo_size = CyMAX_CHAR_FIFO;
                     info->cor1 = CyPARITY_NONE|Cy_1_STOP|Cy_8_BITS;
                     info->cor2 = CyETC;
diff --git a/drivers/char/defkeymap.c_shipped b/drivers/char/defkeymap.c_shipped
index d8ac176c2..453a2f1ff 100644
--- a/drivers/char/defkeymap.c_shipped
+++ b/drivers/char/defkeymap.c_shipped
@@ -139,10 +139,10 @@ u_short ctrl_alt_map[NR_KEYS] = {
 };
 
 ushort *key_maps[MAX_NR_KEYMAPS] = {
-	plain_map, shift_map, altgr_map, 0,
-	ctrl_map, shift_ctrl_map, 0, 0,
-	alt_map, 0, 0, 0,
-	ctrl_alt_map,	0
+	plain_map, shift_map, altgr_map, NULL,
+	ctrl_map, shift_ctrl_map, NULL, NULL,
+	alt_map, NULL, NULL, NULL,
+	ctrl_alt_map, NULL
 };
 
 unsigned int keymap_count = 7;
@@ -216,10 +216,10 @@ char *func_table[MAX_NR_FUNC] = {
 	func_buf + 135,
 	func_buf + 140,
 	func_buf + 145,
-	0,
-	0,
+	NULL,
+	NULL,
 	func_buf + 149,
-	0,
+	NULL,
 };
 
 struct kbdiacr accent_table[MAX_DIACR] = {
diff --git a/drivers/char/drm/Kconfig b/drivers/char/drm/Kconfig
index 087ad5d29..13797ca0c 100644
--- a/drivers/char/drm/Kconfig
+++ b/drivers/char/drm/Kconfig
@@ -76,7 +76,7 @@ config DRM_SIS
 	tristate "SiS video cards"
 	depends on DRM && AGP
 	help
-	  Choose this option if you have a SiS 630 or compatibel video 
+	  Choose this option if you have a SiS 630 or compatible video 
           chipset. If M is selected the module will be called sis. AGP
           support is required for this driver to work.
 
diff --git a/drivers/char/drm/drm.h b/drivers/char/drm/drm.h
index ea37452f8..587305282 100644
--- a/drivers/char/drm/drm.h
+++ b/drivers/char/drm/drm.h
@@ -153,11 +153,11 @@ typedef struct drm_version {
 	int    version_minor;	  /**< Minor version */
 	int    version_patchlevel;/**< Patch level */
 	size_t name_len;	  /**< Length of name buffer */
-	char   *name;		  /**< Name of driver */
+	char   __user *name;	  /**< Name of driver */
 	size_t date_len;	  /**< Length of date buffer */
-	char   *date;		  /**< User-space buffer to hold date */
+	char   __user *date;	  /**< User-space buffer to hold date */
 	size_t desc_len;	  /**< Length of desc buffer */
-	char   *desc;		  /**< User-space buffer to hold desc */
+	char   __user *desc;	  /**< User-space buffer to hold desc */
 } drm_version_t;
 
 
@@ -168,13 +168,13 @@ typedef struct drm_version {
  */
 typedef struct drm_unique {
 	size_t unique_len;	  /**< Length of unique */
-	char   *unique;		  /**< Unique name for driver instantiation */
+	char   __user *unique;	  /**< Unique name for driver instantiation */
 } drm_unique_t;
 
 
 typedef struct drm_list {
 	int		 count;	  /**< Length of user-space structures */
-	drm_version_t	 *version;
+	drm_version_t	 __user *version;
 } drm_list_t;
 
 
@@ -380,7 +380,7 @@ typedef struct drm_buf_desc {
  */
 typedef struct drm_buf_info {
 	int	       count;	/**< Entries in list */
-	drm_buf_desc_t *list;
+	drm_buf_desc_t __user *list;
 } drm_buf_info_t;
 
 
@@ -389,7 +389,7 @@ typedef struct drm_buf_info {
  */
 typedef struct drm_buf_free {
 	int	       count;
-	int	       *list;
+	int	       __user *list;
 } drm_buf_free_t;
 
 
@@ -402,7 +402,7 @@ typedef struct drm_buf_pub {
 	int		  idx;	       /**< Index into the master buffer list */
 	int		  total;       /**< Buffer size */
 	int		  used;	       /**< Amount of buffer in use (for DMA) */
-	void		  *address;    /**< Address of buffer */
+	void	  __user *address;     /**< Address of buffer */
 } drm_buf_pub_t;
 
 
@@ -411,8 +411,8 @@ typedef struct drm_buf_pub {
  */
 typedef struct drm_buf_map {
 	int	      count;	/**< Length of the buffer list */
-	void	      *virtual;	/**< Mmap'd area in user-virtual */
-	drm_buf_pub_t *list;	/**< Buffer information */
+	void	      __user *virtual;	/**< Mmap'd area in user-virtual */
+	drm_buf_pub_t __user *list;	/**< Buffer information */
 } drm_buf_map_t;
 
 
@@ -426,13 +426,13 @@ typedef struct drm_buf_map {
 typedef struct drm_dma {
 	int		context;	  /**< Context handle */
 	int		send_count;	  /**< Number of buffers to send */
-	int		*send_indices;	  /**< List of handles to buffers */
-	int		*send_sizes;	  /**< Lengths of data to send */
+	int	__user *send_indices;	  /**< List of handles to buffers */
+	int	__user *send_sizes;	  /**< Lengths of data to send */
 	drm_dma_flags_t flags;		  /**< Flags */
 	int		request_count;	  /**< Number of buffers requested */
 	int		request_size;	  /**< Desired size for buffers */
-	int		*request_indices; /**< Buffer information */
-	int		*request_sizes;
+	int	__user *request_indices;  /**< Buffer information */
+	int	__user *request_sizes;
 	int		granted_count;	  /**< Number of buffers granted */
 } drm_dma_t;
 
@@ -459,7 +459,7 @@ typedef struct drm_ctx {
  */
 typedef struct drm_ctx_res {
 	int		count;
-	drm_ctx_t	*contexts;
+	drm_ctx_t	__user *contexts;
 } drm_ctx_res_t;
 
 
diff --git a/drivers/char/drm/drmP.h b/drivers/char/drm/drmP.h
index 8bd842346..88886cbf9 100644
--- a/drivers/char/drm/drmP.h
+++ b/drivers/char/drm/drmP.h
@@ -599,7 +599,7 @@ typedef struct drm_ctx_list {
 	drm_file_t		*tag;   /**< associated fd private data */
 } drm_ctx_list_t;
 
-#if __HAVE_VBL_IRQ
+#ifdef __HAVE_VBL_IRQ
 
 typedef struct drm_vbl_sig {
 	struct list_head	head;
@@ -698,7 +698,7 @@ typedef struct drm_device {
 	struct work_struct	work;
 	/** \name VBLANK IRQ support */
 	/*@{*/
-#if __HAVE_VBL_IRQ
+#ifdef __HAVE_VBL_IRQ
    	wait_queue_head_t vbl_queue;	/**< VBLANK wait queue */
    	atomic_t          vbl_received;
 	spinlock_t        vbl_lock;
@@ -776,7 +776,7 @@ extern int	     DRM(mmap_dma)(struct file *filp,
 				   struct vm_area_struct *vma);
 extern int	     DRM(mmap)(struct file *filp, struct vm_area_struct *vma);
 extern unsigned int  DRM(poll)(struct file *filp, struct poll_table_struct *wait);
-extern ssize_t       DRM(read)(struct file *filp, char *buf, size_t count, loff_t *off);
+extern ssize_t       DRM(read)(struct file *filp, char __user *buf, size_t count, loff_t *off);
 
 				/* Memory management support (drm_memory.h) */
 extern void	     DRM(mem_init)(void);
@@ -915,13 +915,13 @@ extern irqreturn_t   DRM(irq_handler)( DRM_IRQ_ARGS );
 extern void          DRM(driver_irq_preinstall)( drm_device_t *dev );
 extern void          DRM(driver_irq_postinstall)( drm_device_t *dev );
 extern void          DRM(driver_irq_uninstall)( drm_device_t *dev );
-#if __HAVE_VBL_IRQ
+#ifdef __HAVE_VBL_IRQ
 extern int           DRM(wait_vblank)(struct inode *inode, struct file *filp,
 				      unsigned int cmd, unsigned long arg);
 extern int           DRM(vblank_wait)(drm_device_t *dev, unsigned int *vbl_seq);
 extern void          DRM(vbl_send_signals)( drm_device_t *dev );
 #endif
-#if __HAVE_IRQ_BH
+#ifdef __HAVE_IRQ_BH
 extern void          DRM(irq_immediate_bh)( void *dev );
 #endif
 #endif
@@ -969,7 +969,7 @@ extern int            DRM(proc_cleanup)(int minor,
 					struct proc_dir_entry *root,
 					struct proc_dir_entry *dev_root);
 
-#if __HAVE_SG
+#ifdef __HAVE_SG
 				/* Scatter Gather Support (drm_scatter.h) */
 extern void           DRM(sg_cleanup)(drm_sg_mem_t *entry);
 extern int            DRM(sg_alloc)(struct inode *inode, struct file *filp,
diff --git a/drivers/char/drm/drm_agpsupport.h b/drivers/char/drm/drm_agpsupport.h
index aa7fd54bb..491c3051c 100644
--- a/drivers/char/drm/drm_agpsupport.h
+++ b/drivers/char/drm/drm_agpsupport.h
@@ -79,7 +79,7 @@ int DRM(agp_info)(struct inode *inode, struct file *filp,
 	info.id_vendor         = kern->device->vendor;
 	info.id_device         = kern->device->device;
 
-	if (copy_to_user((drm_agp_info_t *)arg, &info, sizeof(info)))
+	if (copy_to_user((drm_agp_info_t __user *)arg, &info, sizeof(info)))
 		return -EFAULT;
 	return 0;
 }
@@ -173,7 +173,7 @@ int DRM(agp_enable)(struct inode *inode, struct file *filp,
 	if (!dev->agp || !dev->agp->acquired || !drm_agp->enable)
 		return -EINVAL;
 
-	if (copy_from_user(&mode, (drm_agp_mode_t *)arg, sizeof(mode)))
+	if (copy_from_user(&mode, (drm_agp_mode_t __user *)arg, sizeof(mode)))
 		return -EFAULT;
 
 	dev->agp->mode    = mode.mode;
@@ -205,10 +205,11 @@ int DRM(agp_alloc)(struct inode *inode, struct file *filp,
 	DRM_AGP_MEM      *memory;
 	unsigned long    pages;
 	u32 		 type;
+	drm_agp_buffer_t __user *argp = (void __user *)arg;
 
 	if (!dev->agp || !dev->agp->acquired)
 		return -EINVAL;
-	if (copy_from_user(&request, (drm_agp_buffer_t *)arg, sizeof(request)))
+	if (copy_from_user(&request, argp, sizeof(request)))
 		return -EFAULT;
 	if (!(entry = DRM(alloc)(sizeof(*entry), DRM_MEM_AGPLISTS)))
 		return -ENOMEM;
@@ -236,7 +237,7 @@ int DRM(agp_alloc)(struct inode *inode, struct file *filp,
 	request.handle   = entry->handle;
 	request.physical = memory->physical;
 
-	if (copy_to_user((drm_agp_buffer_t *)arg, &request, sizeof(request))) {
+	if (copy_to_user(argp, &request, sizeof(request))) {
 		dev->agp->memory       = entry->next;
 		dev->agp->memory->prev = NULL;
 		DRM(free_agp)(memory, pages);
@@ -290,7 +291,7 @@ int DRM(agp_unbind)(struct inode *inode, struct file *filp,
 
 	if (!dev->agp || !dev->agp->acquired)
 		return -EINVAL;
-	if (copy_from_user(&request, (drm_agp_binding_t *)arg, sizeof(request)))
+	if (copy_from_user(&request, (drm_agp_binding_t __user *)arg, sizeof(request)))
 		return -EFAULT;
 	if (!(entry = DRM(agp_lookup_entry)(dev, request.handle)))
 		return -EINVAL;
@@ -327,7 +328,7 @@ int DRM(agp_bind)(struct inode *inode, struct file *filp,
 
 	if (!dev->agp || !dev->agp->acquired || !drm_agp->bind_memory)
 		return -EINVAL;
-	if (copy_from_user(&request, (drm_agp_binding_t *)arg, sizeof(request)))
+	if (copy_from_user(&request, (drm_agp_binding_t __user *)arg, sizeof(request)))
 		return -EFAULT;
 	if (!(entry = DRM(agp_lookup_entry)(dev, request.handle)))
 		return -EINVAL;
@@ -366,7 +367,7 @@ int DRM(agp_free)(struct inode *inode, struct file *filp,
 
 	if (!dev->agp || !dev->agp->acquired)
 		return -EINVAL;
-	if (copy_from_user(&request, (drm_agp_buffer_t *)arg, sizeof(request)))
+	if (copy_from_user(&request, (drm_agp_buffer_t __user *)arg, sizeof(request)))
 		return -EFAULT;
 	if (!(entry = DRM(agp_lookup_entry)(dev, request.handle)))
 		return -EINVAL;
diff --git a/drivers/char/drm/drm_auth.h b/drivers/char/drm/drm_auth.h
index 00049d603..fe099871a 100644
--- a/drivers/char/drm/drm_auth.h
+++ b/drivers/char/drm/drm_auth.h
@@ -194,7 +194,7 @@ int DRM(getmagic)(struct inode *inode, struct file *filp,
 	}
 
 	DRM_DEBUG("%u\n", auth.magic);
-	if (copy_to_user((drm_auth_t *)arg, &auth, sizeof(auth)))
+	if (copy_to_user((drm_auth_t __user *)arg, &auth, sizeof(auth)))
 		return -EFAULT;
 	return 0;
 }
@@ -218,7 +218,7 @@ int DRM(authmagic)(struct inode *inode, struct file *filp,
 	drm_auth_t	   auth;
 	drm_file_t	   *file;
 
-	if (copy_from_user(&auth, (drm_auth_t *)arg, sizeof(auth)))
+	if (copy_from_user(&auth, (drm_auth_t __user *)arg, sizeof(auth)))
 		return -EFAULT;
 	DRM_DEBUG("%u\n", auth.magic);
 	if ((file = DRM(find_file)(dev, auth.magic))) {
diff --git a/drivers/char/drm/drm_bufs.h b/drivers/char/drm/drm_bufs.h
index a0361c03b..6fa862372 100644
--- a/drivers/char/drm/drm_bufs.h
+++ b/drivers/char/drm/drm_bufs.h
@@ -70,9 +70,10 @@ int DRM(order)( unsigned long size )
 	int order;
 	unsigned long tmp;
 
-	for ( order = 0, tmp = size ; tmp >>= 1 ; ++order );
+	for (order = 0, tmp = size >> 1; tmp; tmp >>= 1, order++)
+		;
 
-	if ( size & ~(1 << order) )
+	if (size & (size - 1))
 		++order;
 
 	return order;
@@ -97,6 +98,7 @@ int DRM(addmap)( struct inode *inode, struct file *filp,
 	drm_file_t *priv = filp->private_data;
 	drm_device_t *dev = priv->dev;
 	drm_map_t *map;
+	drm_map_t __user *argp = (void __user *)arg;
 	drm_map_list_t *list;
 
 	if ( !(filp->f_mode & 3) ) return -EACCES; /* Require read/write */
@@ -105,7 +107,7 @@ int DRM(addmap)( struct inode *inode, struct file *filp,
 	if ( !map )
 		return -ENOMEM;
 
-	if ( copy_from_user( map, (drm_map_t *)arg, sizeof(*map) ) ) {
+	if ( copy_from_user( map, argp, sizeof(*map) ) ) {
 		DRM(free)( map, sizeof(*map), DRM_MEM_MAPS );
 		return -EFAULT;
 	}
@@ -125,7 +127,7 @@ int DRM(addmap)( struct inode *inode, struct file *filp,
 		return -EINVAL;
 	}
 	map->mtrr   = -1;
-	map->handle = 0;
+	map->handle = NULL;
 
 	switch ( map->type ) {
 	case _DRM_REGISTERS:
@@ -206,10 +208,10 @@ int DRM(addmap)( struct inode *inode, struct file *filp,
 	list_add(&list->head, &dev->maplist->head);
  	up(&dev->struct_sem);
 
-	if ( copy_to_user( (drm_map_t *)arg, map, sizeof(*map) ) )
+	if ( copy_to_user( argp, map, sizeof(*map) ) )
 		return -EFAULT;
 	if ( map->type != _DRM_SHM ) {
-		if ( copy_to_user( &((drm_map_t *)arg)->handle,
+		if ( copy_to_user( &argp->handle,
 				   &map->offset,
 				   sizeof(map->offset) ) )
 			return -EFAULT;
@@ -246,7 +248,7 @@ int DRM(rmmap)(struct inode *inode, struct file *filp,
 	drm_map_t request;
 	int found_maps = 0;
 
-	if (copy_from_user(&request, (drm_map_t *)arg,
+	if (copy_from_user(&request, (drm_map_t __user *)arg,
 			   sizeof(request))) {
 		return -EFAULT;
 	}
@@ -388,10 +390,11 @@ int DRM(addbufs_agp)( struct inode *inode, struct file *filp,
 	int byte_count;
 	int i;
 	drm_buf_t **temp_buflist;
+	drm_buf_desc_t __user *argp = (void __user *)arg;
 
 	if ( !dma ) return -EINVAL;
 
-	if ( copy_from_user( &request, (drm_buf_desc_t *)arg,
+	if ( copy_from_user( &request, argp,
 			     sizeof(request) ) )
 		return -EFAULT;
 
@@ -468,7 +471,7 @@ int DRM(addbufs_agp)( struct inode *inode, struct file *filp,
 		buf->waiting = 0;
 		buf->pending = 0;
 		init_waitqueue_head( &buf->dma_wait );
-		buf->filp    = 0;
+		buf->filp    = NULL;
 
 		buf->dev_priv_size = sizeof(DRIVER_BUF_PRIV_T);
 		buf->dev_private = DRM(alloc)( sizeof(DRIVER_BUF_PRIV_T),
@@ -528,7 +531,7 @@ int DRM(addbufs_agp)( struct inode *inode, struct file *filp,
 	request.count = entry->buf_count;
 	request.size = size;
 
-	if ( copy_to_user( (drm_buf_desc_t *)arg, &request, sizeof(request) ) )
+	if ( copy_to_user( argp, &request, sizeof(request) ) )
 		return -EFAULT;
 
 	dma->flags = _DRM_DMA_USE_AGP;
@@ -561,11 +564,11 @@ int DRM(addbufs_pci)( struct inode *inode, struct file *filp,
 	int page_count;
 	unsigned long *temp_pagelist;
 	drm_buf_t **temp_buflist;
+	drm_buf_desc_t __user *argp = (void __user *)arg;
 
 	if ( !dma ) return -EINVAL;
 
-	if ( copy_from_user( &request, (drm_buf_desc_t *)arg,
-			     sizeof(request) ) )
+	if ( copy_from_user( &request, argp, sizeof(request) ) )
 		return -EFAULT;
 
 	count = request.count;
@@ -692,7 +695,7 @@ int DRM(addbufs_pci)( struct inode *inode, struct file *filp,
 			buf->waiting = 0;
 			buf->pending = 0;
 			init_waitqueue_head( &buf->dma_wait );
-			buf->filp    = 0;
+			buf->filp    = NULL;
 
 			buf->dev_priv_size = sizeof(DRIVER_BUF_PRIV_T);
 			buf->dev_private = DRM(alloc)( sizeof(DRIVER_BUF_PRIV_T),
@@ -766,7 +769,7 @@ int DRM(addbufs_pci)( struct inode *inode, struct file *filp,
 	request.count = entry->buf_count;
 	request.size = size;
 
-	if ( copy_to_user( (drm_buf_desc_t *)arg, &request, sizeof(request) ) )
+	if ( copy_to_user( argp, &request, sizeof(request) ) )
 		return -EFAULT;
 
 	atomic_dec( &dev->buf_alloc );
@@ -782,6 +785,7 @@ int DRM(addbufs_sg)( struct inode *inode, struct file *filp,
 	drm_file_t *priv = filp->private_data;
 	drm_device_t *dev = priv->dev;
 	drm_device_dma_t *dma = dev->dma;
+	drm_buf_desc_t __user *argp = (void __user *)arg;
 	drm_buf_desc_t request;
 	drm_buf_entry_t *entry;
 	drm_buf_t *buf;
@@ -799,8 +803,7 @@ int DRM(addbufs_sg)( struct inode *inode, struct file *filp,
 
 	if ( !dma ) return -EINVAL;
 
-	if ( copy_from_user( &request, (drm_buf_desc_t *)arg,
-                             sizeof(request) ) )
+	if ( copy_from_user( &request, argp, sizeof(request) ) )
 		return -EFAULT;
 
 	count = request.count;
@@ -876,7 +879,7 @@ int DRM(addbufs_sg)( struct inode *inode, struct file *filp,
 		buf->waiting = 0;
 		buf->pending = 0;
 		init_waitqueue_head( &buf->dma_wait );
-		buf->filp    = 0;
+		buf->filp    = NULL;
 
 		buf->dev_priv_size = sizeof(DRIVER_BUF_PRIV_T);
 		buf->dev_private = DRM(alloc)( sizeof(DRIVER_BUF_PRIV_T),
@@ -937,7 +940,7 @@ int DRM(addbufs_sg)( struct inode *inode, struct file *filp,
 	request.count = entry->buf_count;
 	request.size = size;
 
-	if ( copy_to_user( (drm_buf_desc_t *)arg, &request, sizeof(request) ) )
+	if ( copy_to_user( argp, &request, sizeof(request) ) )
 		return -EFAULT;
 
 	dma->flags = _DRM_DMA_USE_SG;
@@ -966,7 +969,7 @@ int DRM(addbufs)( struct inode *inode, struct file *filp,
 {
 	drm_buf_desc_t request;
 
-	if ( copy_from_user( &request, (drm_buf_desc_t *)arg,
+	if ( copy_from_user( &request, (drm_buf_desc_t __user *)arg,
 			     sizeof(request) ) )
 		return -EFAULT;
 
@@ -1012,6 +1015,7 @@ int DRM(infobufs)( struct inode *inode, struct file *filp,
 	drm_device_t *dev = priv->dev;
 	drm_device_dma_t *dma = dev->dma;
 	drm_buf_info_t request;
+	drm_buf_info_t __user *argp = (void __user *)arg;
 	int i;
 	int count;
 
@@ -1025,9 +1029,7 @@ int DRM(infobufs)( struct inode *inode, struct file *filp,
 	++dev->buf_use;		/* Can't allocate more after this call */
 	spin_unlock( &dev->count_lock );
 
-	if ( copy_from_user( &request,
-			     (drm_buf_info_t *)arg,
-			     sizeof(request) ) )
+	if ( copy_from_user( &request, argp, sizeof(request) ) )
 		return -EFAULT;
 
 	for ( i = 0, count = 0 ; i < DRM_MAX_ORDER + 1 ; i++ ) {
@@ -1039,7 +1041,7 @@ int DRM(infobufs)( struct inode *inode, struct file *filp,
 	if ( request.count >= count ) {
 		for ( i = 0, count = 0 ; i < DRM_MAX_ORDER + 1 ; i++ ) {
 			if ( dma->bufs[i].buf_count ) {
-				drm_buf_desc_t *to = &request.list[count];
+				drm_buf_desc_t __user *to = &request.list[count];
 				drm_buf_entry_t *from = &dma->bufs[i];
 				drm_freelist_t *list = &dma->bufs[i].freelist;
 				if ( copy_to_user( &to->count,
@@ -1068,9 +1070,7 @@ int DRM(infobufs)( struct inode *inode, struct file *filp,
 	}
 	request.count = count;
 
-	if ( copy_to_user( (drm_buf_info_t *)arg,
-			   &request,
-			   sizeof(request) ) )
+	if ( copy_to_user( argp, &request, sizeof(request) ) )
 		return -EFAULT;
 
 	return 0;
@@ -1103,7 +1103,7 @@ int DRM(markbufs)( struct inode *inode, struct file *filp,
 	if ( !dma ) return -EINVAL;
 
 	if ( copy_from_user( &request,
-			     (drm_buf_desc_t *)arg,
+			     (drm_buf_desc_t __user *)arg,
 			     sizeof(request) ) )
 		return -EFAULT;
 
@@ -1150,7 +1150,7 @@ int DRM(freebufs)( struct inode *inode, struct file *filp,
 	if ( !dma ) return -EINVAL;
 
 	if ( copy_from_user( &request,
-			     (drm_buf_free_t *)arg,
+			     (drm_buf_free_t __user *)arg,
 			     sizeof(request) ) )
 		return -EFAULT;
 
@@ -1196,6 +1196,7 @@ int DRM(mapbufs)( struct inode *inode, struct file *filp,
 	drm_file_t *priv = filp->private_data;
 	drm_device_t *dev = priv->dev;
 	drm_device_dma_t *dma = dev->dma;
+	drm_buf_map_t __user *argp = (void __user *)arg;
 	int retcode = 0;
 	const int zero = 0;
 	unsigned long virtual;
@@ -1213,8 +1214,7 @@ int DRM(mapbufs)( struct inode *inode, struct file *filp,
 	dev->buf_use++;		/* Can't allocate more after this call */
 	spin_unlock( &dev->count_lock );
 
-	if ( copy_from_user( &request, (drm_buf_map_t *)arg,
-			     sizeof(request) ) )
+	if ( copy_from_user( &request, argp, sizeof(request) ) )
 		return -EFAULT;
 
 	if ( request.count >= dma->buf_count ) {
@@ -1261,7 +1261,7 @@ int DRM(mapbufs)( struct inode *inode, struct file *filp,
 			retcode = (signed long)virtual;
 			goto done;
 		}
-		request.virtual = (void *)virtual;
+		request.virtual = (void __user *)virtual;
 
 		for ( i = 0 ; i < dma->buf_count ; i++ ) {
 			if ( copy_to_user( &request.list[i].idx,
@@ -1295,7 +1295,7 @@ int DRM(mapbufs)( struct inode *inode, struct file *filp,
 	request.count = dma->buf_count;
 	DRM_DEBUG( "%d buffers, retcode = %d\n", request.count, retcode );
 
-	if ( copy_to_user( (drm_buf_map_t *)arg, &request, sizeof(request) ) )
+	if ( copy_to_user( argp, &request, sizeof(request) ) )
 		return -EFAULT;
 
 	return retcode;
diff --git a/drivers/char/drm/drm_context.h b/drivers/char/drm/drm_context.h
index 79b200e08..d8000cfbf 100644
--- a/drivers/char/drm/drm_context.h
+++ b/drivers/char/drm/drm_context.h
@@ -214,12 +214,11 @@ int DRM(getsareactx)(struct inode *inode, struct file *filp,
 {
 	drm_file_t	*priv	= filp->private_data;
 	drm_device_t	*dev	= priv->dev;
+	drm_ctx_priv_map_t __user *argp = (void __user *)arg;
 	drm_ctx_priv_map_t request;
 	drm_map_t *map;
 
-	if (copy_from_user(&request,
-			   (drm_ctx_priv_map_t *)arg,
-			   sizeof(request)))
+	if (copy_from_user(&request, argp, sizeof(request)))
 		return -EFAULT;
 
 	down(&dev->struct_sem);
@@ -232,7 +231,7 @@ int DRM(getsareactx)(struct inode *inode, struct file *filp,
 	up(&dev->struct_sem);
 
 	request.handle = map->handle;
-	if (copy_to_user((drm_ctx_priv_map_t *)arg, &request, sizeof(request)))
+	if (copy_to_user(argp, &request, sizeof(request)))
 		return -EFAULT;
 	return 0;
 }
@@ -260,7 +259,7 @@ int DRM(setsareactx)(struct inode *inode, struct file *filp,
 	struct list_head *list;
 
 	if (copy_from_user(&request,
-			   (drm_ctx_priv_map_t *)arg,
+			   (drm_ctx_priv_map_t __user *)arg,
 			   sizeof(request)))
 		return -EFAULT;
 
@@ -363,10 +362,11 @@ int DRM(resctx)( struct inode *inode, struct file *filp,
 		 unsigned int cmd, unsigned long arg )
 {
 	drm_ctx_res_t res;
+	drm_ctx_t __user *argp = (void __user *)arg;
 	drm_ctx_t ctx;
 	int i;
 
-	if ( copy_from_user( &res, (drm_ctx_res_t *)arg, sizeof(res) ) )
+	if ( copy_from_user( &res, argp, sizeof(res) ) )
 		return -EFAULT;
 
 	if ( res.count >= DRM_RESERVED_CONTEXTS ) {
@@ -380,7 +380,7 @@ int DRM(resctx)( struct inode *inode, struct file *filp,
 	}
 	res.count = DRM_RESERVED_CONTEXTS;
 
-	if ( copy_to_user( (drm_ctx_res_t *)arg, &res, sizeof(res) ) )
+	if ( copy_to_user( argp, &res, sizeof(res) ) )
 		return -EFAULT;
 	return 0;
 }
@@ -402,9 +402,10 @@ int DRM(addctx)( struct inode *inode, struct file *filp,
 	drm_file_t *priv = filp->private_data;
 	drm_device_t *dev = priv->dev;
 	drm_ctx_list_t * ctx_entry;
+	drm_ctx_t __user *argp = (void __user *)arg;
 	drm_ctx_t ctx;
 
-	if ( copy_from_user( &ctx, (drm_ctx_t *)arg, sizeof(ctx) ) )
+	if ( copy_from_user( &ctx, argp, sizeof(ctx) ) )
 		return -EFAULT;
 
 	ctx.handle = DRM(ctxbitmap_next)( dev );
@@ -437,7 +438,7 @@ int DRM(addctx)( struct inode *inode, struct file *filp,
 	++dev->ctx_count;
 	up( &dev->ctxlist_sem );
 
-	if ( copy_to_user( (drm_ctx_t *)arg, &ctx, sizeof(ctx) ) )
+	if ( copy_to_user( argp, &ctx, sizeof(ctx) ) )
 		return -EFAULT;
 	return 0;
 }
@@ -461,15 +462,16 @@ int DRM(modctx)( struct inode *inode, struct file *filp,
 int DRM(getctx)( struct inode *inode, struct file *filp,
 		 unsigned int cmd, unsigned long arg )
 {
+	drm_ctx_t __user *argp = (void __user *)arg;
 	drm_ctx_t ctx;
 
-	if ( copy_from_user( &ctx, (drm_ctx_t*)arg, sizeof(ctx) ) )
+	if ( copy_from_user( &ctx, argp, sizeof(ctx) ) )
 		return -EFAULT;
 
 	/* This is 0, because we don't handle any context flags */
 	ctx.flags = 0;
 
-	if ( copy_to_user( (drm_ctx_t*)arg, &ctx, sizeof(ctx) ) )
+	if ( copy_to_user( argp, &ctx, sizeof(ctx) ) )
 		return -EFAULT;
 	return 0;
 }
@@ -492,7 +494,7 @@ int DRM(switchctx)( struct inode *inode, struct file *filp,
 	drm_device_t *dev = priv->dev;
 	drm_ctx_t ctx;
 
-	if ( copy_from_user( &ctx, (drm_ctx_t *)arg, sizeof(ctx) ) )
+	if ( copy_from_user( &ctx, (drm_ctx_t __user *)arg, sizeof(ctx) ) )
 		return -EFAULT;
 
 	DRM_DEBUG( "%d\n", ctx.handle );
@@ -517,7 +519,7 @@ int DRM(newctx)( struct inode *inode, struct file *filp,
 	drm_device_t *dev = priv->dev;
 	drm_ctx_t ctx;
 
-	if ( copy_from_user( &ctx, (drm_ctx_t *)arg, sizeof(ctx) ) )
+	if ( copy_from_user( &ctx, (drm_ctx_t __user *)arg, sizeof(ctx) ) )
 		return -EFAULT;
 
 	DRM_DEBUG( "%d\n", ctx.handle );
@@ -544,7 +546,7 @@ int DRM(rmctx)( struct inode *inode, struct file *filp,
 	drm_device_t *dev = priv->dev;
 	drm_ctx_t ctx;
 
-	if ( copy_from_user( &ctx, (drm_ctx_t *)arg, sizeof(ctx) ) )
+	if ( copy_from_user( &ctx, (drm_ctx_t __user *)arg, sizeof(ctx) ) )
 		return -EFAULT;
 
 	DRM_DEBUG( "%d\n", ctx.handle );
diff --git a/drivers/char/drm/drm_dma.h b/drivers/char/drm/drm_dma.h
index f0230ebec..72122754d 100644
--- a/drivers/char/drm/drm_dma.h
+++ b/drivers/char/drm/drm_dma.h
@@ -152,7 +152,7 @@ void DRM(free_buffer)(drm_device_t *dev, drm_buf_t *buf)
 
 	buf->waiting  = 0;
 	buf->pending  = 0;
-	buf->filp     = 0;
+	buf->filp     = NULL;
 	buf->used     = 0;
 
 	if ( __HAVE_DMA_WAITQUEUE && waitqueue_active(&buf->dma_wait)) {
@@ -214,7 +214,7 @@ int DRM(control)( struct inode *inode, struct file *filp,
 {
 	drm_control_t ctl;
 
-	if ( copy_from_user( &ctl, (drm_control_t *)arg, sizeof(ctl) ) )
+	if ( copy_from_user( &ctl, (drm_control_t __user *)arg, sizeof(ctl) ) )
 		return -EFAULT;
 
 	switch ( ctl.func ) {
diff --git a/drivers/char/drm/drm_drawable.h b/drivers/char/drm/drm_drawable.h
index aac2c5ab6..5f1562b6a 100644
--- a/drivers/char/drm/drm_drawable.h
+++ b/drivers/char/drm/drm_drawable.h
@@ -43,7 +43,7 @@ int DRM(adddraw)(struct inode *inode, struct file *filp,
 
 	draw.handle = 0;	/* NOOP */
 	DRM_DEBUG("%d\n", draw.handle);
-	if (copy_to_user((drm_draw_t *)arg, &draw, sizeof(draw)))
+	if (copy_to_user((drm_draw_t __user *)arg, &draw, sizeof(draw)))
 		return -EFAULT;
 	return 0;
 }
diff --git a/drivers/char/drm/drm_drv.h b/drivers/char/drm/drm_drv.h
index 4e67b7bd4..389fc7ef2 100644
--- a/drivers/char/drm/drm_drv.h
+++ b/drivers/char/drm/drm_drv.h
@@ -243,7 +243,7 @@ static drm_ioctl_desc_t		  DRM(ioctls)[] = {
 	[DRM_IOCTL_NR(DRM_IOCTL_SG_FREE)]       = { DRM(sg_free),     1, 1 },
 #endif
 
-#if __HAVE_VBL_IRQ
+#ifdef __HAVE_VBL_IRQ
 	[DRM_IOCTL_NR(DRM_IOCTL_WAIT_VBLANK)]   = { DRM(wait_vblank), 0, 0 },
 #endif
 
@@ -532,7 +532,7 @@ static int DRM(takedown)( drm_device_t *dev )
 #endif
 	if ( dev->lock.hw_lock ) {
 		dev->sigdata.lock = dev->lock.hw_lock = NULL; /* SHM removed */
-		dev->lock.filp = 0;
+		dev->lock.filp = NULL;
 		wake_up_interruptible( &dev->lock.lock_queue );
 	}
 	up( &dev->struct_sem );
@@ -741,12 +741,11 @@ module_exit( drm_cleanup );
 int DRM(version)( struct inode *inode, struct file *filp,
 		  unsigned int cmd, unsigned long arg )
 {
+	drm_version_t __user *argp = (void __user *)arg;
 	drm_version_t version;
 	int len;
 
-	if ( copy_from_user( &version,
-			     (drm_version_t *)arg,
-			     sizeof(version) ) )
+	if ( copy_from_user( &version, argp, sizeof(version) ) )
 		return -EFAULT;
 
 #define DRM_COPY( name, value )						\
@@ -766,9 +765,7 @@ int DRM(version)( struct inode *inode, struct file *filp,
 	DRM_COPY( version.date, DRIVER_DATE );
 	DRM_COPY( version.desc, DRIVER_DESC );
 
-	if ( copy_to_user( (drm_version_t *)arg,
-			   &version,
-			   sizeof(version) ) )
+	if ( copy_to_user( argp, &version, sizeof(version) ) )
 		return -EFAULT;
 	return 0;
 }
@@ -1048,7 +1045,7 @@ int DRM(lock)( struct inode *inode, struct file *filp,
 
 	++priv->lock_count;
 
-        if ( copy_from_user( &lock, (drm_lock_t *)arg, sizeof(lock) ) )
+        if ( copy_from_user( &lock, (drm_lock_t __user *)arg, sizeof(lock) ) )
 		return -EFAULT;
 
         if ( lock.context == DRM_KERNEL_CONTEXT ) {
@@ -1161,7 +1158,7 @@ int DRM(unlock)( struct inode *inode, struct file *filp,
 	drm_device_t *dev = priv->dev;
 	drm_lock_t lock;
 
-	if ( copy_from_user( &lock, (drm_lock_t *)arg, sizeof(lock) ) )
+	if ( copy_from_user( &lock, (drm_lock_t __user *)arg, sizeof(lock) ) )
 		return -EFAULT;
 
 	if ( lock.context == DRM_KERNEL_CONTEXT ) {
@@ -1181,7 +1178,7 @@ int DRM(unlock)( struct inode *inode, struct file *filp,
 	 * agent to request it then we should just be able to
 	 * take it immediately and not eat the ioctl.
 	 */
-	dev->lock.filp = 0;
+	dev->lock.filp = NULL;
 	{
 		__volatile__ unsigned int *plock = &dev->lock.hw_lock->lock;
 		unsigned int old, new, prev, ctx;
diff --git a/drivers/char/drm/drm_fops.h b/drivers/char/drm/drm_fops.h
index 48ceabdb0..0aa02444a 100644
--- a/drivers/char/drm/drm_fops.h
+++ b/drivers/char/drm/drm_fops.h
@@ -141,7 +141,7 @@ unsigned int DRM(poll)(struct file *filp, struct poll_table_struct *wait)
 
 #if !__HAVE_DRIVER_FOPS_READ
 /** No-op. */
-ssize_t DRM(read)(struct file *filp, char *buf, size_t count, loff_t *off)
+ssize_t DRM(read)(struct file *filp, char __user *buf, size_t count, loff_t *off)
 {
 	return 0;
 }
diff --git a/drivers/char/drm/drm_ioctl.h b/drivers/char/drm/drm_ioctl.h
index cbf2dbf02..ef6532a31 100644
--- a/drivers/char/drm/drm_ioctl.h
+++ b/drivers/char/drm/drm_ioctl.h
@@ -53,16 +53,17 @@ int DRM(getunique)(struct inode *inode, struct file *filp,
 {
 	drm_file_t	 *priv	 = filp->private_data;
 	drm_device_t	 *dev	 = priv->dev;
+	drm_unique_t	 __user *argp = (void __user *)arg;
 	drm_unique_t	 u;
 
-	if (copy_from_user(&u, (drm_unique_t *)arg, sizeof(u)))
+	if (copy_from_user(&u, argp, sizeof(u)))
 		return -EFAULT;
 	if (u.unique_len >= dev->unique_len) {
 		if (copy_to_user(u.unique, dev->unique, dev->unique_len))
 			return -EFAULT;
 	}
 	u.unique_len = dev->unique_len;
-	if (copy_to_user((drm_unique_t *)arg, &u, sizeof(u)))
+	if (copy_to_user(argp, &u, sizeof(u)))
 		return -EFAULT;
 	return 0;
 }
@@ -91,7 +92,8 @@ int DRM(setunique)(struct inode *inode, struct file *filp,
 
 	if (dev->unique_len || dev->unique) return -EBUSY;
 
-	if (copy_from_user(&u, (drm_unique_t *)arg, sizeof(u))) return -EFAULT;
+	if (copy_from_user(&u, (drm_unique_t __user *)arg, sizeof(u)))
+		return -EFAULT;
 
 	if (!u.unique_len || u.unique_len > 1024) return -EINVAL;
 
@@ -171,13 +173,14 @@ int DRM(getmap)( struct inode *inode, struct file *filp,
 {
 	drm_file_t   *priv = filp->private_data;
 	drm_device_t *dev  = priv->dev;
+	drm_map_t    __user *argp = (void __user *)arg;
 	drm_map_t    map;
 	drm_map_list_t *r_list = NULL;
 	struct list_head *list;
 	int          idx;
 	int	     i;
 
-	if (copy_from_user(&map, (drm_map_t *)arg, sizeof(map)))
+	if (copy_from_user(&map, argp, sizeof(map)))
 		return -EFAULT;
 	idx = map.offset;
 
@@ -208,7 +211,7 @@ int DRM(getmap)( struct inode *inode, struct file *filp,
 	map.mtrr   = r_list->map->mtrr;
 	up(&dev->struct_sem);
 
-	if (copy_to_user((drm_map_t *)arg, &map, sizeof(map))) return -EFAULT;
+	if (copy_to_user(argp, &map, sizeof(map))) return -EFAULT;
 	return 0;
 }
 
@@ -230,12 +233,13 @@ int DRM(getclient)( struct inode *inode, struct file *filp,
 {
 	drm_file_t   *priv = filp->private_data;
 	drm_device_t *dev  = priv->dev;
+	drm_client_t __user *argp = (void __user *)arg;
 	drm_client_t client;
 	drm_file_t   *pt;
 	int          idx;
 	int          i;
 
-	if (copy_from_user(&client, (drm_client_t *)arg, sizeof(client)))
+	if (copy_from_user(&client, argp, sizeof(client)))
 		return -EFAULT;
 	idx = client.idx;
 	down(&dev->struct_sem);
@@ -253,7 +257,7 @@ int DRM(getclient)( struct inode *inode, struct file *filp,
 	client.iocs  = pt->ioctl_count;
 	up(&dev->struct_sem);
 
-	if (copy_to_user((drm_client_t *)arg, &client, sizeof(client)))
+	if (copy_to_user((drm_client_t __user *)arg, &client, sizeof(client)))
 		return -EFAULT;
 	return 0;
 }
@@ -294,7 +298,7 @@ int DRM(getstats)( struct inode *inode, struct file *filp,
 
 	up(&dev->struct_sem);
 
-	if (copy_to_user((drm_stats_t *)arg, &stats, sizeof(stats)))
+	if (copy_to_user((drm_stats_t __user *)arg, &stats, sizeof(stats)))
 		return -EFAULT;
 	return 0;
 }
@@ -308,15 +312,16 @@ int DRM(setversion)(DRM_IOCTL_ARGS)
 	drm_set_version_t sv;
 	drm_set_version_t retv;
 	int if_version;
+	drm_set_version_t __user *argp = (void __user *)data;
 
-	DRM_COPY_FROM_USER_IOCTL(sv, (drm_set_version_t *)data, sizeof(sv));
+	DRM_COPY_FROM_USER_IOCTL(sv, argp, sizeof(sv));
 
 	retv.drm_di_major = DRM_IF_MAJOR;
 	retv.drm_di_minor = DRM_IF_MINOR;
 	retv.drm_dd_major = DRIVER_MAJOR;
 	retv.drm_dd_minor = DRIVER_MINOR;
 
-	DRM_COPY_TO_USER_IOCTL((drm_set_version_t *)data, retv, sizeof(sv));
+	DRM_COPY_TO_USER_IOCTL(argp, retv, sizeof(sv));
 
 	if (sv.drm_di_major != -1) {
 		if (sv.drm_di_major != DRM_IF_MAJOR ||
diff --git a/drivers/char/drm/drm_irq.h b/drivers/char/drm/drm_irq.h
index 1d1d95116..04bb0ac11 100644
--- a/drivers/char/drm/drm_irq.h
+++ b/drivers/char/drm/drm_irq.h
@@ -65,9 +65,10 @@ int DRM(irq_by_busid)(struct inode *inode, struct file *filp,
 {
 	drm_file_t *priv = filp->private_data;
 	drm_device_t *dev = priv->dev;
+	drm_irq_busid_t __user *argp = (void __user *)arg;
 	drm_irq_busid_t p;
 
-	if (copy_from_user(&p, (drm_irq_busid_t *)arg, sizeof(p)))
+	if (copy_from_user(&p, argp, sizeof(p)))
 		return -EFAULT;
 
 	if ((p.busnum >> 8) != dev->pci_domain ||
@@ -80,7 +81,7 @@ int DRM(irq_by_busid)(struct inode *inode, struct file *filp,
 
 	DRM_DEBUG("%d:%d:%d => IRQ %d\n",
 		  p.busnum, p.devnum, p.funcnum, p.irq);
-	if (copy_to_user((drm_irq_busid_t *)arg, &p, sizeof(p)))
+	if (copy_to_user(argp, &p, sizeof(p)))
 		return -EFAULT;
 	return 0;
 }
@@ -127,11 +128,11 @@ int DRM(irq_install)( drm_device_t *dev )
 	dev->dma->this_buffer = NULL;
 #endif
 
-#if __HAVE_IRQ_BH
+#ifdef __HAVE_IRQ_BH
 	INIT_WORK(&dev->work, DRM(irq_immediate_bh), dev);
 #endif
 
-#if __HAVE_VBL_IRQ
+#ifdef __HAVE_VBL_IRQ
 	init_waitqueue_head(&dev->vbl_queue);
 
 	spin_lock_init( &dev->vbl_lock );
@@ -206,7 +207,7 @@ int DRM(control)( struct inode *inode, struct file *filp,
 	drm_device_t *dev = priv->dev;
 	drm_control_t ctl;
 
-	if ( copy_from_user( &ctl, (drm_control_t *)arg, sizeof(ctl) ) )
+	if ( copy_from_user( &ctl, (drm_control_t __user *)arg, sizeof(ctl) ) )
 		return -EFAULT;
 
 	switch ( ctl.func ) {
@@ -222,7 +223,7 @@ int DRM(control)( struct inode *inode, struct file *filp,
 	}
 }
 
-#if __HAVE_VBL_IRQ
+#ifdef __HAVE_VBL_IRQ
 
 /**
  * Wait for VBLANK.
@@ -247,6 +248,7 @@ int DRM(wait_vblank)( DRM_IOCTL_ARGS )
 {
 	drm_file_t *priv = filp->private_data;
 	drm_device_t *dev = priv->dev;
+	drm_wait_vblank_t __user *argp = (void __user *)data;
 	drm_wait_vblank_t vblwait;
 	struct timeval now;
 	int ret = 0;
@@ -255,8 +257,7 @@ int DRM(wait_vblank)( DRM_IOCTL_ARGS )
 	if (!dev->irq)
 		return -EINVAL;
 
-	DRM_COPY_FROM_USER_IOCTL( vblwait, (drm_wait_vblank_t *)data,
-				  sizeof(vblwait) );
+	DRM_COPY_FROM_USER_IOCTL( vblwait, argp, sizeof(vblwait) );
 
 	switch ( vblwait.request.type & ~_DRM_VBLANK_FLAGS_MASK ) {
 	case _DRM_VBLANK_RELATIVE:
@@ -325,8 +326,7 @@ int DRM(wait_vblank)( DRM_IOCTL_ARGS )
 	}
 
 done:
-	DRM_COPY_TO_USER_IOCTL( (drm_wait_vblank_t *)data, vblwait,
-				sizeof(vblwait) );
+	DRM_COPY_TO_USER_IOCTL( argp, vblwait, sizeof(vblwait) );
 
 	return ret;
 }
diff --git a/drivers/char/drm/drm_lock.h b/drivers/char/drm/drm_lock.h
index 3288996ef..55fb29f39 100644
--- a/drivers/char/drm/drm_lock.h
+++ b/drivers/char/drm/drm_lock.h
@@ -95,7 +95,7 @@ int DRM(lock_transfer)(drm_device_t *dev,
 {
 	unsigned int old, new, prev;
 
-	dev->lock.filp = 0;
+	dev->lock.filp = NULL;
 	do {
 		old  = *lock;
 		new  = context | _DRM_LOCK_HELD;
@@ -120,7 +120,7 @@ int DRM(lock_free)(drm_device_t *dev,
 {
 	unsigned int old, new, prev;
 
-	dev->lock.filp = 0;
+	dev->lock.filp = NULL;
 	do {
 		old  = *lock;
 		new  = 0;
diff --git a/drivers/char/drm/drm_scatter.h b/drivers/char/drm/drm_scatter.h
index 6b1b2c70b..e5d829367 100644
--- a/drivers/char/drm/drm_scatter.h
+++ b/drivers/char/drm/drm_scatter.h
@@ -66,6 +66,7 @@ int DRM(sg_alloc)( struct inode *inode, struct file *filp,
 {
 	drm_file_t *priv = filp->private_data;
 	drm_device_t *dev = priv->dev;
+	drm_scatter_gather_t __user *argp = (void __user *)arg;
 	drm_scatter_gather_t request;
 	drm_sg_mem_t *entry;
 	unsigned long pages, i, j;
@@ -75,9 +76,7 @@ int DRM(sg_alloc)( struct inode *inode, struct file *filp,
 	if ( dev->sg )
 		return -EINVAL;
 
-	if ( copy_from_user( &request,
-			     (drm_scatter_gather_t *)arg,
-			     sizeof(request) ) )
+	if ( copy_from_user( &request, argp, sizeof(request) ) )
 		return -EFAULT;
 
 	entry = DRM(alloc)( sizeof(*entry), DRM_MEM_SGLISTS );
@@ -145,9 +144,7 @@ int DRM(sg_alloc)( struct inode *inode, struct file *filp,
 
 	request.handle = entry->handle;
 
-	if ( copy_to_user( (drm_scatter_gather_t *)arg,
-			   &request,
-			   sizeof(request) ) ) {
+	if ( copy_to_user( argp, &request, sizeof(request) ) ) {
 		DRM(sg_cleanup)( entry );
 		return -EFAULT;
 	}
@@ -210,7 +207,7 @@ int DRM(sg_free)( struct inode *inode, struct file *filp,
 	drm_sg_mem_t *entry;
 
 	if ( copy_from_user( &request,
-			     (drm_scatter_gather_t *)arg,
+			     (drm_scatter_gather_t __user *)arg,
 			     sizeof(request) ) )
 		return -EFAULT;
 
diff --git a/drivers/char/drm/drm_vm.h b/drivers/char/drm/drm_vm.h
index 844ab32e0..d7dce3ae9 100644
--- a/drivers/char/drm/drm_vm.h
+++ b/drivers/char/drm/drm_vm.h
@@ -75,7 +75,7 @@ static __inline__ struct page *DRM(do_vm_nopage)(struct vm_area_struct *vma,
 		struct drm_agp_mem *agpmem;
 		struct page *page;
 
-#if __alpha__
+#ifdef __alpha__
 		/*
                  * Adjust to a bus-relative address
                  */
diff --git a/drivers/char/drm/ffb_context.c b/drivers/char/drm/ffb_context.c
index d45cf9cd1..6fae05c8b 100644
--- a/drivers/char/drm/ffb_context.c
+++ b/drivers/char/drm/ffb_context.c
@@ -358,7 +358,7 @@ int DRM(context_switch)(drm_device_t *dev, int old, int new)
 {
 	ffb_dev_priv_t *fpriv = (ffb_dev_priv_t *) dev->dev_private;
 
-#if DRM_DMA_HISTOGRAM
+#ifdef DRM_DMA_HISTOGRAM
         dev->ctx_start = get_cycles();
 #endif
         
@@ -388,7 +388,7 @@ int DRM(resctx)(struct inode *inode, struct file *filp, unsigned int cmd,
 	int		i;
 
 	DRM_DEBUG("%d\n", DRM_RESERVED_CONTEXTS);
-	if (copy_from_user(&res, (drm_ctx_res_t *)arg, sizeof(res)))
+	if (copy_from_user(&res, (drm_ctx_res_t __user *)arg, sizeof(res)))
 		return -EFAULT;
 	if (res.count >= DRM_RESERVED_CONTEXTS) {
 		memset(&ctx, 0, sizeof(ctx));
@@ -401,7 +401,7 @@ int DRM(resctx)(struct inode *inode, struct file *filp, unsigned int cmd,
 		}
 	}
 	res.count = DRM_RESERVED_CONTEXTS;
-	if (copy_to_user((drm_ctx_res_t *)arg, &res, sizeof(res)))
+	if (copy_to_user((drm_ctx_res_t __user *)arg, &res, sizeof(res)))
 		return -EFAULT;
 	return 0;
 }
@@ -415,7 +415,7 @@ int DRM(addctx)(struct inode *inode, struct file *filp, unsigned int cmd,
 	drm_ctx_t	ctx;
 	int idx;
 
-	if (copy_from_user(&ctx, (drm_ctx_t *)arg, sizeof(ctx)))
+	if (copy_from_user(&ctx, (drm_ctx_t __user *)arg, sizeof(ctx)))
 		return -EFAULT;
 	idx = DRM(alloc_queue)(dev, (ctx.flags & _DRM_CONTEXT_2DONLY));
 	if (idx < 0)
@@ -423,7 +423,7 @@ int DRM(addctx)(struct inode *inode, struct file *filp, unsigned int cmd,
 
 	DRM_DEBUG("%d\n", ctx.handle);
 	ctx.handle = idx;
-	if (copy_to_user((drm_ctx_t *)arg, &ctx, sizeof(ctx)))
+	if (copy_to_user((drm_ctx_t __user *)arg, &ctx, sizeof(ctx)))
 		return -EFAULT;
 	return 0;
 }
@@ -438,7 +438,7 @@ int DRM(modctx)(struct inode *inode, struct file *filp, unsigned int cmd,
 	drm_ctx_t ctx;
 	int idx;
 
-	if (copy_from_user(&ctx, (drm_ctx_t*)arg, sizeof(ctx)))
+	if (copy_from_user(&ctx, (drm_ctx_t __user *)arg, sizeof(ctx)))
 		return -EFAULT;
 
 	idx = ctx.handle;
@@ -467,7 +467,7 @@ int DRM(getctx)(struct inode *inode, struct file *filp, unsigned int cmd,
 	drm_ctx_t ctx;
 	int idx;
 
-	if (copy_from_user(&ctx, (drm_ctx_t*)arg, sizeof(ctx)))
+	if (copy_from_user(&ctx, (drm_ctx_t __user *)arg, sizeof(ctx)))
 		return -EFAULT;
 
 	idx = ctx.handle;
@@ -483,7 +483,7 @@ int DRM(getctx)(struct inode *inode, struct file *filp, unsigned int cmd,
 	else
 		ctx.flags = 0;
 
-	if (copy_to_user((drm_ctx_t*)arg, &ctx, sizeof(ctx)))
+	if (copy_to_user((drm_ctx_t __user *)arg, &ctx, sizeof(ctx)))
 		return -EFAULT;
 
 	return 0;
@@ -496,7 +496,7 @@ int DRM(switchctx)(struct inode *inode, struct file *filp, unsigned int cmd,
 	drm_device_t	*dev	= priv->dev;
 	drm_ctx_t	ctx;
 
-	if (copy_from_user(&ctx, (drm_ctx_t *)arg, sizeof(ctx)))
+	if (copy_from_user(&ctx, (drm_ctx_t  __user *)arg, sizeof(ctx)))
 		return -EFAULT;
 	DRM_DEBUG("%d\n", ctx.handle);
 	return DRM(context_switch)(dev, dev->last_context, ctx.handle);
@@ -507,7 +507,7 @@ int DRM(newctx)(struct inode *inode, struct file *filp, unsigned int cmd,
 {
 	drm_ctx_t	ctx;
 
-	if (copy_from_user(&ctx, (drm_ctx_t *)arg, sizeof(ctx)))
+	if (copy_from_user(&ctx, (drm_ctx_t  __user *)arg, sizeof(ctx)))
 		return -EFAULT;
 	DRM_DEBUG("%d\n", ctx.handle);
 
@@ -523,7 +523,7 @@ int DRM(rmctx)(struct inode *inode, struct file *filp, unsigned int cmd,
 	ffb_dev_priv_t	*fpriv	= (ffb_dev_priv_t *) dev->dev_private;
 	int idx;
 
-	if (copy_from_user(&ctx, (drm_ctx_t *)arg, sizeof(ctx)))
+	if (copy_from_user(&ctx, (drm_ctx_t __user *)arg, sizeof(ctx)))
 		return -EFAULT;
 	DRM_DEBUG("%d\n", ctx.handle);
 
diff --git a/drivers/char/drm/gamma_context.h b/drivers/char/drm/gamma_context.h
index df319c039..d3c8c29c2 100644
--- a/drivers/char/drm/gamma_context.h
+++ b/drivers/char/drm/gamma_context.h
@@ -42,7 +42,7 @@
    the circular buffer), is based on Alessandro Rubini's LINUX DEVICE
    DRIVERS (Cambridge: O'Reilly, 1998), pages 111-113. */
 
-ssize_t DRM(read)(struct file *filp, char *buf, size_t count, loff_t *off)
+ssize_t DRM(read)(struct file *filp, char __user *buf, size_t count, loff_t *off)
 {
 	drm_file_t    *priv   = filp->private_data;
 	drm_device_t  *dev    = priv->dev;
@@ -295,12 +295,13 @@ static int DRM(alloc_queue)(drm_device_t *dev)
 int DRM(resctx)(struct inode *inode, struct file *filp,
 		unsigned int cmd, unsigned long arg)
 {
+	drm_ctx_res_t __user *argp = (void __user *)arg;
 	drm_ctx_res_t	res;
 	drm_ctx_t	ctx;
 	int		i;
 
 	DRM_DEBUG("%d\n", DRM_RESERVED_CONTEXTS);
-	if (copy_from_user(&res, (drm_ctx_res_t *)arg, sizeof(res)))
+	if (copy_from_user(&res, argp, sizeof(res)))
 		return -EFAULT;
 	if (res.count >= DRM_RESERVED_CONTEXTS) {
 		memset(&ctx, 0, sizeof(ctx));
@@ -313,7 +314,7 @@ int DRM(resctx)(struct inode *inode, struct file *filp,
 		}
 	}
 	res.count = DRM_RESERVED_CONTEXTS;
-	if (copy_to_user((drm_ctx_res_t *)arg, &res, sizeof(res)))
+	if (copy_to_user(argp, &res, sizeof(res)))
 		return -EFAULT;
 	return 0;
 }
@@ -324,8 +325,9 @@ int DRM(addctx)(struct inode *inode, struct file *filp,
 	drm_file_t	*priv	= filp->private_data;
 	drm_device_t	*dev	= priv->dev;
 	drm_ctx_t	ctx;
+	drm_ctx_t	__user *argp = (void __user *)arg;
 
-	if (copy_from_user(&ctx, (drm_ctx_t *)arg, sizeof(ctx)))
+	if (copy_from_user(&ctx, argp, sizeof(ctx)))
 		return -EFAULT;
 	if ((ctx.handle = DRM(alloc_queue)(dev)) == DRM_KERNEL_CONTEXT) {
 				/* Init kernel's context and get a new one. */
@@ -334,7 +336,7 @@ int DRM(addctx)(struct inode *inode, struct file *filp,
 	}
 	DRM(init_queue)(dev, dev->queuelist[ctx.handle], &ctx);
 	DRM_DEBUG("%d\n", ctx.handle);
-	if (copy_to_user((drm_ctx_t *)arg, &ctx, sizeof(ctx)))
+	if (copy_to_user(argp, &ctx, sizeof(ctx)))
 		return -EFAULT;
 	return 0;
 }
@@ -347,7 +349,7 @@ int DRM(modctx)(struct inode *inode, struct file *filp,
 	drm_ctx_t	ctx;
 	drm_queue_t	*q;
 
-	if (copy_from_user(&ctx, (drm_ctx_t *)arg, sizeof(ctx)))
+	if (copy_from_user(&ctx, (drm_ctx_t __user *)arg, sizeof(ctx)))
 		return -EFAULT;
 
 	DRM_DEBUG("%d\n", ctx.handle);
@@ -378,10 +380,11 @@ int DRM(getctx)(struct inode *inode, struct file *filp,
 {
 	drm_file_t	*priv	= filp->private_data;
 	drm_device_t	*dev	= priv->dev;
+	drm_ctx_t	__user *argp = (void __user *)arg;
 	drm_ctx_t	ctx;
 	drm_queue_t	*q;
 
-	if (copy_from_user(&ctx, (drm_ctx_t *)arg, sizeof(ctx)))
+	if (copy_from_user(&ctx, argp, sizeof(ctx)))
 		return -EFAULT;
 
 	DRM_DEBUG("%d\n", ctx.handle);
@@ -399,7 +402,7 @@ int DRM(getctx)(struct inode *inode, struct file *filp,
 	ctx.flags = q->flags;
 	atomic_dec(&q->use_count);
 
-	if (copy_to_user((drm_ctx_t *)arg, &ctx, sizeof(ctx)))
+	if (copy_to_user(argp, &ctx, sizeof(ctx)))
 		return -EFAULT;
 
 	return 0;
@@ -412,7 +415,7 @@ int DRM(switchctx)(struct inode *inode, struct file *filp,
 	drm_device_t	*dev	= priv->dev;
 	drm_ctx_t	ctx;
 
-	if (copy_from_user(&ctx, (drm_ctx_t *)arg, sizeof(ctx)))
+	if (copy_from_user(&ctx, (drm_ctx_t __user *)arg, sizeof(ctx)))
 		return -EFAULT;
 	DRM_DEBUG("%d\n", ctx.handle);
 	return DRM(context_switch)(dev, dev->last_context, ctx.handle);
@@ -425,7 +428,7 @@ int DRM(newctx)(struct inode *inode, struct file *filp,
 	drm_device_t	*dev	= priv->dev;
 	drm_ctx_t	ctx;
 
-	if (copy_from_user(&ctx, (drm_ctx_t *)arg, sizeof(ctx)))
+	if (copy_from_user(&ctx, (drm_ctx_t __user *)arg, sizeof(ctx)))
 		return -EFAULT;
 	DRM_DEBUG("%d\n", ctx.handle);
 	DRM(context_switch_complete)(dev, ctx.handle);
@@ -442,7 +445,7 @@ int DRM(rmctx)(struct inode *inode, struct file *filp,
 	drm_queue_t	*q;
 	drm_buf_t	*buf;
 
-	if (copy_from_user(&ctx, (drm_ctx_t *)arg, sizeof(ctx)))
+	if (copy_from_user(&ctx, (drm_ctx_t __user *)arg, sizeof(ctx)))
 		return -EFAULT;
 	DRM_DEBUG("%d\n", ctx.handle);
 
diff --git a/drivers/char/drm/gamma_dma.c b/drivers/char/drm/gamma_dma.c
index ed6a8358d..7802f5156 100644
--- a/drivers/char/drm/gamma_dma.c
+++ b/drivers/char/drm/gamma_dma.c
@@ -565,9 +565,10 @@ int gamma_dma(struct inode *inode, struct file *filp, unsigned int cmd,
 	drm_device_t	  *dev	    = priv->dev;
 	drm_device_dma_t  *dma	    = dev->dma;
 	int		  retcode   = 0;
+	drm_dma_t	  __user *argp = (void __user *)arg;
 	drm_dma_t	  d;
 
-	if (copy_from_user(&d, (drm_dma_t *)arg, sizeof(d)))
+	if (copy_from_user(&d, argp, sizeof(d)))
 		return -EFAULT;
 
 	if (d.send_count < 0 || d.send_count > dma->buf_count) {
@@ -597,7 +598,7 @@ int gamma_dma(struct inode *inode, struct file *filp, unsigned int cmd,
 
 	DRM_DEBUG("%d returning, granted = %d\n",
 		  current->pid, d.granted_count);
-	if (copy_to_user((drm_dma_t *)arg, &d, sizeof(d)))
+	if (copy_to_user(argp, &d, sizeof(d)))
 		return -EFAULT;
 
 	return retcode;
@@ -720,7 +721,7 @@ int gamma_dma_init( struct inode *inode, struct file *filp,
 
 	LOCK_TEST_WITH_RETURN( dev, filp );
 
-	if ( copy_from_user( &init, (drm_gamma_init_t *)arg, sizeof(init) ) )
+	if ( copy_from_user( &init, (drm_gamma_init_t __user *)arg, sizeof(init) ) )
 		return -EFAULT;
 
 	switch ( init.func ) {
@@ -789,7 +790,7 @@ int gamma_dma_copy( struct inode *inode, struct file *filp,
 	drm_device_t *dev = priv->dev;
 	drm_gamma_copy_t copy;
 
-	if ( copy_from_user( &copy, (drm_gamma_copy_t *)arg, sizeof(copy) ) )
+	if ( copy_from_user( &copy, (drm_gamma_copy_t __user *)arg, sizeof(copy) ) )
 		return -EFAULT;
 
 	return gamma_do_copy_dma( dev, &copy );
@@ -804,12 +805,11 @@ int gamma_getsareactx(struct inode *inode, struct file *filp,
 {
 	drm_file_t	*priv	= filp->private_data;
 	drm_device_t	*dev	= priv->dev;
+	drm_ctx_priv_map_t __user *argp = (void __user *)arg;
 	drm_ctx_priv_map_t request;
 	drm_map_t *map;
 
-	if (copy_from_user(&request,
-			   (drm_ctx_priv_map_t *)arg,
-			   sizeof(request)))
+	if (copy_from_user(&request, argp, sizeof(request)))
 		return -EFAULT;
 
 	down(&dev->struct_sem);
@@ -822,7 +822,7 @@ int gamma_getsareactx(struct inode *inode, struct file *filp,
 	up(&dev->struct_sem);
 
 	request.handle = map->handle;
-	if (copy_to_user((drm_ctx_priv_map_t *)arg, &request, sizeof(request)))
+	if (copy_to_user(argp, &request, sizeof(request)))
 		return -EFAULT;
 	return 0;
 }
@@ -838,7 +838,7 @@ int gamma_setsareactx(struct inode *inode, struct file *filp,
 	struct list_head *list;
 
 	if (copy_from_user(&request,
-			   (drm_ctx_priv_map_t *)arg,
+			   (drm_ctx_priv_map_t __user *)arg,
 			   sizeof(request)))
 		return -EFAULT;
 
diff --git a/drivers/char/drm/gamma_lock.h b/drivers/char/drm/gamma_lock.h
index 1ecbf8f9e..ddec67e4e 100644
--- a/drivers/char/drm/gamma_lock.h
+++ b/drivers/char/drm/gamma_lock.h
@@ -132,7 +132,7 @@ int DRM(finish)(struct inode *inode, struct file *filp, unsigned int cmd,
 
 	DRM_DEBUG("\n");
 
-	if (copy_from_user(&lock, (drm_lock_t *)arg, sizeof(lock)))
+	if (copy_from_user(&lock, (drm_lock_t __user *)arg, sizeof(lock)))
 		return -EFAULT;
 	ret = DRM(flush_block_and_flush)(dev, lock.context, lock.flags);
 	DRM(flush_unblock)(dev, lock.context, lock.flags);
diff --git a/drivers/char/drm/gamma_old_dma.h b/drivers/char/drm/gamma_old_dma.h
index 43be5c803..abdd454aa 100644
--- a/drivers/char/drm/gamma_old_dma.h
+++ b/drivers/char/drm/gamma_old_dma.h
@@ -122,6 +122,8 @@ int DRM(dma_enqueue)(struct file *filp, drm_dma_t *d)
 	int		  idx;
 	int		  while_locked = 0;
 	drm_device_dma_t  *dma = dev->dma;
+	int		  *ind;
+	int		  err;
 	DECLARE_WAITQUEUE(entry, current);
 
 	DRM_DEBUG("%d\n", d->send_count);
@@ -168,45 +170,51 @@ int DRM(dma_enqueue)(struct file *filp, drm_dma_t *d)
 		remove_wait_queue(&q->write_queue, &entry);
 	}
 
+	ind = DRM(alloc)(d->send_count * sizeof(int), DRM_MEM_DRIVER);
+	if (!ind)
+		return -ENOMEM;
+
+	if (copy_from_user(ind, d->send_indices, d->send_count * sizeof(int))) {
+		err = -EFAULT;
+                goto out;
+	}
+
+	err = -EINVAL;
 	for (i = 0; i < d->send_count; i++) {
-		idx = d->send_indices[i];
+		idx = ind[i];
 		if (idx < 0 || idx >= dma->buf_count) {
-			atomic_dec(&q->use_count);
 			DRM_ERROR("Index %d (of %d max)\n",
-				  d->send_indices[i], dma->buf_count - 1);
-			return -EINVAL;
+				  ind[i], dma->buf_count - 1);
+			goto out;
 		}
 		buf = dma->buflist[ idx ];
 		if (buf->filp != filp) {
-			atomic_dec(&q->use_count);
 			DRM_ERROR("Process %d using buffer not owned\n",
 				  current->pid);
-			return -EINVAL;
+			goto out;
 		}
 		if (buf->list != DRM_LIST_NONE) {
-			atomic_dec(&q->use_count);
 			DRM_ERROR("Process %d using buffer %d on list %d\n",
 				  current->pid, buf->idx, buf->list);
+			goto out;
 		}
-		buf->used	  = d->send_sizes[i];
+		buf->used	  = ind[i];
 		buf->while_locked = while_locked;
 		buf->context	  = d->context;
 		if (!buf->used) {
 			DRM_ERROR("Queueing 0 length buffer\n");
 		}
 		if (buf->pending) {
-			atomic_dec(&q->use_count);
 			DRM_ERROR("Queueing pending buffer:"
 				  " buffer %d, offset %d\n",
-				  d->send_indices[i], i);
-			return -EINVAL;
+				  ind[i], i);
+			goto out;
 		}
 		if (buf->waiting) {
-			atomic_dec(&q->use_count);
 			DRM_ERROR("Queueing waiting buffer:"
 				  " buffer %d, offset %d\n",
-				  d->send_indices[i], i);
-			return -EINVAL;
+				  ind[i], i);
+			goto out;
 		}
 		buf->waiting = 1;
 		if (atomic_read(&q->use_count) == 1
@@ -220,6 +228,11 @@ int DRM(dma_enqueue)(struct file *filp, drm_dma_t *d)
 	atomic_dec(&q->use_count);
 
 	return 0;
+
+out:
+	DRM(free)(ind, d->send_count * sizeof(int), DRM_MEM_DRIVER);
+	atomic_dec(&q->use_count);
+	return err;
 }
 
 static int DRM(dma_get_buffers_of_order)(struct file *filp, drm_dma_t *d,
diff --git a/drivers/char/drm/i810_dma.c b/drivers/char/drm/i810_dma.c
index 84823f664..42220efe7 100644
--- a/drivers/char/drm/i810_dma.c
+++ b/drivers/char/drm/i810_dma.c
@@ -171,7 +171,7 @@ static int i810_map_buffer(drm_buf_t *buf, struct file *filp)
 		/* Real error */
 		DRM_ERROR("mmap error\n");
 		retcode = (signed int)buf_priv->virtual;
-		buf_priv->virtual = 0;
+		buf_priv->virtual = NULL;
 	}
 	up_write( &current->mm->mmap_sem );
 
@@ -193,7 +193,7 @@ static int i810_unmap_buffer(drm_buf_t *buf)
 	up_write(&current->mm->mmap_sem);
 
    	buf_priv->currently_mapped = I810_BUF_UNMAPPED;
-   	buf_priv->virtual = 0;
+   	buf_priv->virtual = NULL;
 
 	return retcode;
 }
@@ -459,7 +459,7 @@ int i810_dma_init_compat(drm_i810_init_t *init, unsigned long arg)
 {
 
 	/* Get v1.1 init data */
-	if (copy_from_user(init, (drm_i810_pre12_init_t *)arg,
+	if (copy_from_user(init, (drm_i810_pre12_init_t __user *)arg,
 			  sizeof(drm_i810_pre12_init_t))) {
 		return -EFAULT;
 	}
@@ -468,7 +468,7 @@ int i810_dma_init_compat(drm_i810_init_t *init, unsigned long arg)
 
 		/* This is a v1.2 client, just get the v1.2 init data */
 		DRM_INFO("Using POST v1.2 init.\n");
-		if (copy_from_user(init, (drm_i810_init_t *)arg,
+		if (copy_from_user(init, (drm_i810_init_t __user *)arg,
 				   sizeof(drm_i810_init_t))) {
 			return -EFAULT;
 		}
@@ -497,7 +497,7 @@ int i810_dma_init(struct inode *inode, struct file *filp,
    	int retcode = 0;
 
 	/* Get only the init func */
-	if (copy_from_user(&init, (void *)arg, sizeof(drm_i810_init_func_t))) 
+	if (copy_from_user(&init, (void __user *)arg, sizeof(drm_i810_init_func_t))) 
 		return -EFAULT;
 
    	switch(init.func) {
@@ -521,7 +521,7 @@ int i810_dma_init(struct inode *inode, struct file *filp,
 		default:
 	 	case I810_INIT_DMA_1_4:
 			DRM_INFO("Using v1.4 init.\n");
-  			if (copy_from_user(&init, (drm_i810_init_t *)arg,
+  			if (copy_from_user(&init, (drm_i810_init_t __user *)arg,
 					  sizeof(drm_i810_init_t))) {
 				return -EFAULT;
 			}
@@ -846,11 +846,11 @@ static void i810_dma_dispatch_vertex(drm_device_t *dev,
 
 		put_user((GFX_OP_PRIMITIVE | prim |
 					     ((used/4)-2)),
-		(u32 *)buf_priv->virtual);
+		(u32 __user *)buf_priv->virtual);
 
 		if (used & 4) {
 			put_user(0,
-			(u32 *)((u32)buf_priv->virtual + used));
+			(u32 __user *)((u32)buf_priv->virtual + used));
 			used += 4;
 		}
 
@@ -1056,7 +1056,7 @@ int i810_dma_vertex(struct inode *inode, struct file *filp,
      					dev_priv->sarea_priv;
 	drm_i810_vertex_t vertex;
 
-	if (copy_from_user(&vertex, (drm_i810_vertex_t *)arg, sizeof(vertex)))
+	if (copy_from_user(&vertex, (drm_i810_vertex_t __user *)arg, sizeof(vertex)))
 		return -EFAULT;
 
 	if (!_DRM_LOCK_IS_HELD(dev->lock.hw_lock->lock)) {
@@ -1091,7 +1091,7 @@ int i810_clear_bufs(struct inode *inode, struct file *filp,
 	drm_device_t *dev = priv->dev;
 	drm_i810_clear_t clear;
 
-   	if (copy_from_user(&clear, (drm_i810_clear_t *)arg, sizeof(clear)))
+   	if (copy_from_user(&clear, (drm_i810_clear_t __user *)arg, sizeof(clear)))
 		return -EFAULT;
 
 	if (!_DRM_LOCK_IS_HELD(dev->lock.hw_lock->lock)) {
@@ -1153,7 +1153,7 @@ int i810_getbuf(struct inode *inode, struct file *filp, unsigned int cmd,
    	drm_i810_sarea_t *sarea_priv = (drm_i810_sarea_t *)
      					dev_priv->sarea_priv;
 
-   	if (copy_from_user(&d, (drm_i810_dma_t *)arg, sizeof(d)))
+   	if (copy_from_user(&d, (drm_i810_dma_t __user *)arg, sizeof(d)))
 		return -EFAULT;
 
 	if (!_DRM_LOCK_IS_HELD(dev->lock.hw_lock->lock)) {
@@ -1168,7 +1168,7 @@ int i810_getbuf(struct inode *inode, struct file *filp, unsigned int cmd,
 	DRM_DEBUG("i810_dma: %d returning %d, granted = %d\n",
 		  current->pid, retcode, d.granted);
 
-	if (copy_to_user((drm_dma_t *)arg, &d, sizeof(d)))
+	if (copy_to_user((drm_dma_t __user *)arg, &d, sizeof(d)))
 		return -EFAULT;
    	sarea_priv->last_dispatch = (int) hw_status[5];
 
@@ -1266,7 +1266,7 @@ int i810_dma_mc(struct inode *inode, struct file *filp,
 		dev_priv->sarea_priv;
 	drm_i810_mc_t mc;
 
-	if (copy_from_user(&mc, (drm_i810_mc_t *)arg, sizeof(mc)))
+	if (copy_from_user(&mc, (drm_i810_mc_t __user *)arg, sizeof(mc)))
 		return -EFAULT;
 
 
@@ -1309,7 +1309,7 @@ int i810_ov0_info(struct inode *inode, struct file *filp,
 
 	data.offset = dev_priv->overlay_offset;
 	data.physical = dev_priv->overlay_physical;
-	if (copy_to_user((drm_i810_overlay_t *)arg,&data,sizeof(data)))
+	if (copy_to_user((drm_i810_overlay_t __user *)arg,&data,sizeof(data)))
 		return -EFAULT;
 	return 0;
 }
diff --git a/drivers/char/drm/i830_dma.c b/drivers/char/drm/i830_dma.c
index 86c4e4204..856dc81f8 100644
--- a/drivers/char/drm/i830_dma.c
+++ b/drivers/char/drm/i830_dma.c
@@ -153,6 +153,7 @@ static int i830_map_buffer(drm_buf_t *buf, struct file *filp)
 	drm_i830_buf_priv_t *buf_priv = buf->dev_private;
       	drm_i830_private_t *dev_priv = dev->dev_private;
    	struct file_operations *old_fops;
+	unsigned long virtual;
 	int retcode = 0;
 
 	if(buf_priv->currently_mapped == I830_BUF_MAPPED) return -EINVAL;
@@ -161,17 +162,17 @@ static int i830_map_buffer(drm_buf_t *buf, struct file *filp)
 	old_fops = filp->f_op;
 	filp->f_op = &i830_buffer_fops;
 	dev_priv->mmap_buffer = buf;
-	buf_priv->virtual = (void __user *)do_mmap(filp, 0, buf->total,
-					    PROT_READ|PROT_WRITE,
-					    MAP_SHARED, 
-					    buf->bus_address);
+	virtual = do_mmap(filp, 0, buf->total, PROT_READ|PROT_WRITE,
+			    MAP_SHARED, buf->bus_address);
 	dev_priv->mmap_buffer = NULL;
 	filp->f_op = old_fops;
-	if (IS_ERR(buf_priv->virtual)) {
+	if (IS_ERR((void *)virtual)) {		/* ugh */
 		/* Real error */
 		DRM_ERROR("mmap error\n");
-		retcode = PTR_ERR(buf_priv->virtual);
-		buf_priv->virtual = 0;
+		retcode = virtual;
+		buf_priv->virtual = NULL;
+	} else {
+		buf_priv->virtual = (void __user *)virtual;
 	}
 	up_write( &current->mm->mmap_sem );
 
@@ -193,7 +194,7 @@ static int i830_unmap_buffer(drm_buf_t *buf)
 	up_write(&current->mm->mmap_sem);
 
    	buf_priv->currently_mapped = I830_BUF_UNMAPPED;
-   	buf_priv->virtual = 0;
+   	buf_priv->virtual = NULL;
 
 	return retcode;
 }
@@ -463,7 +464,7 @@ static int i830_dma_initialize(drm_device_t *dev,
 }
 
 int i830_dma_init(struct inode *inode, struct file *filp,
-		  unsigned int cmd, unsigned long __user arg)
+		  unsigned int cmd, unsigned long arg)
 {
    	drm_file_t *priv = filp->private_data;
    	drm_device_t *dev = priv->dev;
@@ -1165,7 +1166,7 @@ static void i830_dma_dispatch_vertex(drm_device_t *dev,
    	DRM_DEBUG(  "start + used - 4 : %ld\n", start + used - 4);
 
 	if (buf_priv->currently_mapped == I830_BUF_MAPPED) {
-		u32  *vp = buf_priv->virtual;
+		u32  __user *vp = buf_priv->virtual;
 
 		put_user( (GFX_OP_PRIMITIVE |
 			 sarea_priv->vertex_prim |
@@ -1315,7 +1316,7 @@ void i830_reclaim_buffers( struct file *filp )
 }
 
 int i830_flush_ioctl(struct inode *inode, struct file *filp, 
-		     unsigned int cmd, unsigned long __user arg)
+		     unsigned int cmd, unsigned long arg)
 {
    	drm_file_t	  *priv	  = filp->private_data;
    	drm_device_t	  *dev	  = priv->dev;
@@ -1330,7 +1331,7 @@ int i830_flush_ioctl(struct inode *inode, struct file *filp,
 }
 
 int i830_dma_vertex(struct inode *inode, struct file *filp,
-	       unsigned int cmd, unsigned long __user arg)
+	       unsigned int cmd, unsigned long arg)
 {
 	drm_file_t *priv = filp->private_data;
 	drm_device_t *dev = priv->dev;
@@ -1365,7 +1366,7 @@ int i830_dma_vertex(struct inode *inode, struct file *filp,
 }
 
 int i830_clear_bufs(struct inode *inode, struct file *filp,
-		   unsigned int cmd, unsigned long __user arg)
+		   unsigned int cmd, unsigned long arg)
 {
 	drm_file_t *priv = filp->private_data;
 	drm_device_t *dev = priv->dev;
@@ -1392,7 +1393,7 @@ int i830_clear_bufs(struct inode *inode, struct file *filp,
 }
 
 int i830_swap_bufs(struct inode *inode, struct file *filp,
-		  unsigned int cmd, unsigned long __user arg)
+		  unsigned int cmd, unsigned long arg)
 {
 	drm_file_t *priv = filp->private_data;
 	drm_device_t *dev = priv->dev;
@@ -1435,7 +1436,7 @@ int i830_do_cleanup_pageflip( drm_device_t *dev )
 }
 
 int i830_flip_bufs(struct inode *inode, struct file *filp,
-		   unsigned int cmd, unsigned long __user arg)
+		   unsigned int cmd, unsigned long arg)
 {
 	drm_file_t *priv = filp->private_data;
 	drm_device_t *dev = priv->dev;
@@ -1456,7 +1457,7 @@ int i830_flip_bufs(struct inode *inode, struct file *filp,
 }
 
 int i830_getage(struct inode *inode, struct file *filp, unsigned int cmd,
-		unsigned long __user arg)
+		unsigned long arg)
 {
    	drm_file_t	  *priv	    = filp->private_data;
 	drm_device_t	  *dev	    = priv->dev;
@@ -1470,7 +1471,7 @@ int i830_getage(struct inode *inode, struct file *filp, unsigned int cmd,
 }
 
 int i830_getbuf(struct inode *inode, struct file *filp, unsigned int cmd,
-		unsigned long __user arg)
+		unsigned long arg)
 {
 	drm_file_t	  *priv	    = filp->private_data;
 	drm_device_t	  *dev	    = priv->dev;
@@ -1507,7 +1508,7 @@ int i830_getbuf(struct inode *inode, struct file *filp, unsigned int cmd,
 int i830_copybuf(struct inode *inode,
 		 struct file *filp, 
 		 unsigned int cmd,
-		 unsigned long __user arg)
+		 unsigned long arg)
 {
 	/* Never copy - 2.4.x doesn't need it */
 	return 0;
@@ -1522,7 +1523,7 @@ int i830_docopy(struct inode *inode, struct file *filp, unsigned int cmd,
 
 
 int i830_getparam( struct inode *inode, struct file *filp, unsigned int cmd,
-		      unsigned long __user arg )
+		      unsigned long arg )
 {
 	drm_file_t	  *priv	    = filp->private_data;
 	drm_device_t	  *dev	    = priv->dev;
@@ -1556,7 +1557,7 @@ int i830_getparam( struct inode *inode, struct file *filp, unsigned int cmd,
 
 
 int i830_setparam( struct inode *inode, struct file *filp, unsigned int cmd,
-		   unsigned long __user arg )
+		   unsigned long arg )
 {
 	drm_file_t	  *priv	    = filp->private_data;
 	drm_device_t	  *dev	    = priv->dev;
diff --git a/drivers/char/drm/i830_irq.c b/drivers/char/drm/i830_irq.c
index b90670882..362d66ef1 100644
--- a/drivers/char/drm/i830_irq.c
+++ b/drivers/char/drm/i830_irq.c
@@ -121,7 +121,7 @@ int i830_wait_irq(drm_device_t *dev, int irq_nr)
 /* Needs the lock as it touches the ring.
  */
 int i830_irq_emit( struct inode *inode, struct file *filp, unsigned int cmd,
-		   unsigned long __user arg )
+		   unsigned long arg )
 {
 	drm_file_t	  *priv	    = filp->private_data;
 	drm_device_t	  *dev	    = priv->dev;
@@ -139,7 +139,7 @@ int i830_irq_emit( struct inode *inode, struct file *filp, unsigned int cmd,
 		return -EINVAL;
 	}
 
-	if (copy_from_user( &emit, (drm_i830_irq_emit_t *)arg, sizeof(emit) ))
+	if (copy_from_user( &emit, (drm_i830_irq_emit_t __user *)arg, sizeof(emit) ))
 		return -EFAULT;
 
 	result = i830_emit_irq( dev );
@@ -168,7 +168,7 @@ int i830_irq_wait( struct inode *inode, struct file *filp, unsigned int cmd,
 		return -EINVAL;
 	}
 
-	if (copy_from_user( &irqwait, (drm_i830_irq_wait_t *)arg, 
+	if (copy_from_user( &irqwait, (drm_i830_irq_wait_t __user *)arg, 
 			    sizeof(irqwait) ))
 		return -EFAULT;
 
diff --git a/drivers/char/drm/mga_dma.c b/drivers/char/drm/mga_dma.c
index 5e5c407d1..76fbf714b 100644
--- a/drivers/char/drm/mga_dma.c
+++ b/drivers/char/drm/mga_dma.c
@@ -668,7 +668,7 @@ int mga_dma_init( DRM_IOCTL_ARGS )
 
 	LOCK_TEST_WITH_RETURN( dev, filp );
 
-	DRM_COPY_FROM_USER_IOCTL( init, (drm_mga_init_t *)data, sizeof(init) );
+	DRM_COPY_FROM_USER_IOCTL( init, (drm_mga_init_t __user *)data, sizeof(init) );
 
 	switch ( init.func ) {
 	case MGA_INIT_DMA:
@@ -693,7 +693,7 @@ int mga_dma_flush( DRM_IOCTL_ARGS )
 
 	LOCK_TEST_WITH_RETURN( dev, filp );
 
-	DRM_COPY_FROM_USER_IOCTL( lock, (drm_lock_t *)data, sizeof(lock) );
+	DRM_COPY_FROM_USER_IOCTL( lock, (drm_lock_t __user *)data, sizeof(lock) );
 
 	DRM_DEBUG( "%s%s%s\n",
 		   (lock.flags & _DRM_LOCK_FLUSH) ?	"flush, " : "",
@@ -764,12 +764,13 @@ int mga_dma_buffers( DRM_IOCTL_ARGS )
 	DRM_DEVICE;
 	drm_device_dma_t *dma = dev->dma;
 	drm_mga_private_t *dev_priv = (drm_mga_private_t *)dev->dev_private;
+	drm_dma_t __user *argp = (void __user *)data;
 	drm_dma_t d;
 	int ret = 0;
 
 	LOCK_TEST_WITH_RETURN( dev, filp );
 
-	DRM_COPY_FROM_USER_IOCTL( d, (drm_dma_t *)data, sizeof(d) );
+	DRM_COPY_FROM_USER_IOCTL( d, argp, sizeof(d) );
 
 	/* Please don't send us buffers.
 	 */
@@ -795,7 +796,7 @@ int mga_dma_buffers( DRM_IOCTL_ARGS )
 		ret = mga_dma_get_buffers( filp, dev, &d );
 	}
 
-	DRM_COPY_TO_USER_IOCTL( (drm_dma_t *)data, d, sizeof(d) );
+	DRM_COPY_TO_USER_IOCTL( argp, d, sizeof(d) );
 
 	return ret;
 }
diff --git a/drivers/char/drm/mga_drm.h b/drivers/char/drm/mga_drm.h
index 989889068..521d4451d 100644
--- a/drivers/char/drm/mga_drm.h
+++ b/drivers/char/drm/mga_drm.h
@@ -343,7 +343,7 @@ typedef struct _drm_mga_blit {
 
 typedef struct drm_mga_getparam {
 	int param;
-	void *value;
+	void __user *value;
 } drm_mga_getparam_t;
 
 #endif
diff --git a/drivers/char/drm/mga_state.c b/drivers/char/drm/mga_state.c
index 256dd47d6..436598252 100644
--- a/drivers/char/drm/mga_state.c
+++ b/drivers/char/drm/mga_state.c
@@ -889,7 +889,7 @@ int mga_dma_clear( DRM_IOCTL_ARGS )
 
 	LOCK_TEST_WITH_RETURN( dev, filp );
 
-	DRM_COPY_FROM_USER_IOCTL( clear, (drm_mga_clear_t *)data, sizeof(clear) );
+	DRM_COPY_FROM_USER_IOCTL( clear, (drm_mga_clear_t __user *)data, sizeof(clear) );
 
 	if ( sarea_priv->nbox > MGA_NR_SAREA_CLIPRECTS )
 		sarea_priv->nbox = MGA_NR_SAREA_CLIPRECTS;
@@ -939,7 +939,7 @@ int mga_dma_vertex( DRM_IOCTL_ARGS )
 	LOCK_TEST_WITH_RETURN( dev, filp );
 
 	DRM_COPY_FROM_USER_IOCTL( vertex,
-			     (drm_mga_vertex_t *)data,
+			     (drm_mga_vertex_t __user *)data,
 			     sizeof(vertex) );
 
         if(vertex.idx < 0 || vertex.idx > dma->buf_count) return DRM_ERR(EINVAL);
@@ -978,7 +978,7 @@ int mga_dma_indices( DRM_IOCTL_ARGS )
 	LOCK_TEST_WITH_RETURN( dev, filp );
 
 	DRM_COPY_FROM_USER_IOCTL( indices,
-			     (drm_mga_indices_t *)data,
+			     (drm_mga_indices_t __user *)data,
 			     sizeof(indices) );
 
         if(indices.idx < 0 || indices.idx > dma->buf_count) return DRM_ERR(EINVAL);
@@ -1017,7 +1017,7 @@ int mga_dma_iload( DRM_IOCTL_ARGS )
 
 	LOCK_TEST_WITH_RETURN( dev, filp );
 
-	DRM_COPY_FROM_USER_IOCTL( iload, (drm_mga_iload_t *)data, sizeof(iload) );
+	DRM_COPY_FROM_USER_IOCTL( iload, (drm_mga_iload_t __user *)data, sizeof(iload) );
 
 #if 0
 	if ( mga_do_wait_for_idle( dev_priv ) < 0 ) {
@@ -1057,7 +1057,7 @@ int mga_dma_blit( DRM_IOCTL_ARGS )
 
 	LOCK_TEST_WITH_RETURN( dev, filp );
 
-	DRM_COPY_FROM_USER_IOCTL( blit, (drm_mga_blit_t *)data, sizeof(blit) );
+	DRM_COPY_FROM_USER_IOCTL( blit, (drm_mga_blit_t __user *)data, sizeof(blit) );
 
 	if ( sarea_priv->nbox > MGA_NR_SAREA_CLIPRECTS )
 		sarea_priv->nbox = MGA_NR_SAREA_CLIPRECTS;
@@ -1088,7 +1088,7 @@ int mga_getparam( DRM_IOCTL_ARGS )
 		return DRM_ERR(EINVAL);
 	}
 
-	DRM_COPY_FROM_USER_IOCTL( param, (drm_mga_getparam_t *)data,
+	DRM_COPY_FROM_USER_IOCTL( param, (drm_mga_getparam_t __user *)data,
 			     sizeof(param) );
 
 	DRM_DEBUG( "pid=%d\n", DRM_CURRENTPID );
diff --git a/drivers/char/drm/r128_cce.c b/drivers/char/drm/r128_cce.c
index bf4b4d95d..22d38b70c 100644
--- a/drivers/char/drm/r128_cce.c
+++ b/drivers/char/drm/r128_cce.c
@@ -632,7 +632,7 @@ int r128_cce_init( DRM_IOCTL_ARGS )
 
 	LOCK_TEST_WITH_RETURN( dev, filp );
 
-	DRM_COPY_FROM_USER_IOCTL( init, (drm_r128_init_t *)data, sizeof(init) );
+	DRM_COPY_FROM_USER_IOCTL( init, (drm_r128_init_t __user *)data, sizeof(init) );
 
 	switch ( init.func ) {
 	case R128_INIT_CCE:
@@ -675,7 +675,7 @@ int r128_cce_stop( DRM_IOCTL_ARGS )
 
 	LOCK_TEST_WITH_RETURN( dev, filp );
 
-	DRM_COPY_FROM_USER_IOCTL(stop, (drm_r128_cce_stop_t *)data, sizeof(stop) );
+	DRM_COPY_FROM_USER_IOCTL(stop, (drm_r128_cce_stop_t __user *)data, sizeof(stop) );
 
 	/* Flush any pending CCE commands.  This ensures any outstanding
 	 * commands are exectuted by the engine before we turn it off.
@@ -912,11 +912,12 @@ int r128_cce_buffers( DRM_IOCTL_ARGS )
 	DRM_DEVICE;
 	drm_device_dma_t *dma = dev->dma;
 	int ret = 0;
+	drm_dma_t __user *argp = (void __user *)data;
 	drm_dma_t d;
 
 	LOCK_TEST_WITH_RETURN( dev, filp );
 
-	DRM_COPY_FROM_USER_IOCTL( d, (drm_dma_t *) data, sizeof(d) );
+	DRM_COPY_FROM_USER_IOCTL( d, argp, sizeof(d) );
 
 	/* Please don't send us buffers.
 	 */
@@ -940,7 +941,7 @@ int r128_cce_buffers( DRM_IOCTL_ARGS )
 		ret = r128_cce_get_buffers( filp, dev, &d );
 	}
 
-	DRM_COPY_TO_USER_IOCTL((drm_dma_t *) data, d, sizeof(d) );
+	DRM_COPY_TO_USER_IOCTL(argp, d, sizeof(d) );
 
 	return ret;
 }
diff --git a/drivers/char/drm/r128_drm.h b/drivers/char/drm/r128_drm.h
index ae51de34b..0cba17d1e 100644
--- a/drivers/char/drm/r128_drm.h
+++ b/drivers/char/drm/r128_drm.h
@@ -308,14 +308,14 @@ typedef struct drm_r128_depth {
 		R128_READ_PIXELS	= 0x04
 	} func;
 	int n;
-	int *x;
-	int *y;
-	unsigned int *buffer;
-	unsigned char *mask;
+	int __user *x;
+	int __user *y;
+	unsigned int __user *buffer;
+	unsigned char __user *mask;
 } drm_r128_depth_t;
 
 typedef struct drm_r128_stipple {
-	unsigned int *mask;
+	unsigned int __user *mask;
 } drm_r128_stipple_t;
 
 typedef struct drm_r128_indirect {
@@ -339,7 +339,7 @@ typedef struct drm_r128_fullscreen {
 
 typedef struct drm_r128_getparam {
 	int param;
-	void *value;
+	void __user *value;
 } drm_r128_getparam_t;
 
 #endif
diff --git a/drivers/char/drm/r128_state.c b/drivers/char/drm/r128_state.c
index 6ec11b025..34ebcae1f 100644
--- a/drivers/char/drm/r128_state.c
+++ b/drivers/char/drm/r128_state.c
@@ -1271,7 +1271,7 @@ int r128_cce_clear( DRM_IOCTL_ARGS )
 
 	LOCK_TEST_WITH_RETURN( dev, filp );
 
-	DRM_COPY_FROM_USER_IOCTL( clear, (drm_r128_clear_t *) data,
+	DRM_COPY_FROM_USER_IOCTL( clear, (drm_r128_clear_t __user *) data,
 			     sizeof(clear) );
 
 	RING_SPACE_TEST_WITH_RETURN( dev_priv );
@@ -1386,7 +1386,7 @@ int r128_cce_vertex( DRM_IOCTL_ARGS )
 		return DRM_ERR(EINVAL);
 	}
 
-	DRM_COPY_FROM_USER_IOCTL( vertex, (drm_r128_vertex_t *) data,
+	DRM_COPY_FROM_USER_IOCTL( vertex, (drm_r128_vertex_t __user *) data,
 			     sizeof(vertex) );
 
 	DRM_DEBUG( "pid=%d index=%d count=%d discard=%d\n",
@@ -1447,7 +1447,7 @@ int r128_cce_indices( DRM_IOCTL_ARGS )
 		return DRM_ERR(EINVAL);
 	}
 
-	DRM_COPY_FROM_USER_IOCTL( elts, (drm_r128_indices_t *) data,
+	DRM_COPY_FROM_USER_IOCTL( elts, (drm_r128_indices_t __user *) data,
 			     sizeof(elts) );
 
 	DRM_DEBUG( "pid=%d buf=%d s=%d e=%d d=%d\n", DRM_CURRENTPID,
@@ -1512,7 +1512,7 @@ int r128_cce_blit( DRM_IOCTL_ARGS )
 
 	LOCK_TEST_WITH_RETURN( dev, filp );
 
-	DRM_COPY_FROM_USER_IOCTL( blit, (drm_r128_blit_t *) data,
+	DRM_COPY_FROM_USER_IOCTL( blit, (drm_r128_blit_t __user *) data,
 			     sizeof(blit) );
 
 	DRM_DEBUG( "pid=%d index=%d\n", DRM_CURRENTPID, blit.idx );
@@ -1541,7 +1541,7 @@ int r128_cce_depth( DRM_IOCTL_ARGS )
 
 	LOCK_TEST_WITH_RETURN( dev, filp );
 
-	DRM_COPY_FROM_USER_IOCTL( depth, (drm_r128_depth_t *) data,
+	DRM_COPY_FROM_USER_IOCTL( depth, (drm_r128_depth_t __user *) data,
 			     sizeof(depth) );
 
 	RING_SPACE_TEST_WITH_RETURN( dev_priv );
@@ -1571,7 +1571,7 @@ int r128_cce_stipple( DRM_IOCTL_ARGS )
 
 	LOCK_TEST_WITH_RETURN( dev, filp );
 
-	DRM_COPY_FROM_USER_IOCTL( stipple, (drm_r128_stipple_t *) data,
+	DRM_COPY_FROM_USER_IOCTL( stipple, (drm_r128_stipple_t __user *) data,
 			     sizeof(stipple) );
 
 	if ( DRM_COPY_FROM_USER( &mask, stipple.mask,
@@ -1605,7 +1605,7 @@ int r128_cce_indirect( DRM_IOCTL_ARGS )
 		return DRM_ERR(EINVAL);
 	}
 
-	DRM_COPY_FROM_USER_IOCTL( indirect, (drm_r128_indirect_t *) data,
+	DRM_COPY_FROM_USER_IOCTL( indirect, (drm_r128_indirect_t __user *) data,
 			     sizeof(indirect) );
 
 	DRM_DEBUG( "indirect: idx=%d s=%d e=%d d=%d\n",
@@ -1674,7 +1674,7 @@ int r128_getparam( DRM_IOCTL_ARGS )
 		return DRM_ERR(EINVAL);
 	}
 
-	DRM_COPY_FROM_USER_IOCTL( param, (drm_r128_getparam_t *)data,
+	DRM_COPY_FROM_USER_IOCTL( param, (drm_r128_getparam_t __user *)data,
 			     sizeof(param) );
 
 	DRM_DEBUG( "pid=%d\n", DRM_CURRENTPID );
diff --git a/drivers/char/drm/radeon.h b/drivers/char/drm/radeon.h
index 54fac7940..83902f869 100644
--- a/drivers/char/drm/radeon.h
+++ b/drivers/char/drm/radeon.h
@@ -141,7 +141,7 @@ do {									\
 			radeon_do_cleanup_pageflip( dev );		\
 		}							\
 		radeon_mem_release( filp, dev_priv->gart_heap );	\
-                radeon_mem_release( filp, dev_priv->fb_heap );		\
+		radeon_mem_release( filp, dev_priv->fb_heap );		\
 	}								\
 } while (0)
 
diff --git a/drivers/char/drm/radeon_cp.c b/drivers/char/drm/radeon_cp.c
index e145c78e7..f6964908a 100644
--- a/drivers/char/drm/radeon_cp.c
+++ b/drivers/char/drm/radeon_cp.c
@@ -1358,7 +1358,7 @@ int radeon_cp_init( DRM_IOCTL_ARGS )
 
 	LOCK_TEST_WITH_RETURN( dev, filp );
 
-	DRM_COPY_FROM_USER_IOCTL( init, (drm_radeon_init_t *)data, sizeof(init) );
+	DRM_COPY_FROM_USER_IOCTL( init, (drm_radeon_init_t __user *)data, sizeof(init) );
 
 	switch ( init.func ) {
 	case RADEON_INIT_CP:
@@ -1407,7 +1407,7 @@ int radeon_cp_stop( DRM_IOCTL_ARGS )
 
 	LOCK_TEST_WITH_RETURN( dev, filp );
 
-	DRM_COPY_FROM_USER_IOCTL( stop, (drm_radeon_cp_stop_t *)data, sizeof(stop) );
+	DRM_COPY_FROM_USER_IOCTL( stop, (drm_radeon_cp_stop_t __user *)data, sizeof(stop) );
 
 	if (!dev_priv->cp_running)
 		return 0;
@@ -1712,11 +1712,12 @@ int radeon_cp_buffers( DRM_IOCTL_ARGS )
 	DRM_DEVICE;
 	drm_device_dma_t *dma = dev->dma;
 	int ret = 0;
+	drm_dma_t __user *argp = (void __user *)data;
 	drm_dma_t d;
 
 	LOCK_TEST_WITH_RETURN( dev, filp );
 
-	DRM_COPY_FROM_USER_IOCTL( d, (drm_dma_t *)data, sizeof(d) );
+	DRM_COPY_FROM_USER_IOCTL( d, argp, sizeof(d) );
 
 	/* Please don't send us buffers.
 	 */
@@ -1740,7 +1741,7 @@ int radeon_cp_buffers( DRM_IOCTL_ARGS )
 		ret = radeon_cp_get_buffers( filp, dev, &d );
 	}
 
-	DRM_COPY_TO_USER_IOCTL( (drm_dma_t *)data, d, sizeof(d) );
+	DRM_COPY_TO_USER_IOCTL( argp, d, sizeof(d) );
 
 	return ret;
 }
diff --git a/drivers/char/drm/radeon_drm.h b/drivers/char/drm/radeon_drm.h
index 735e04ef4..e447308b7 100644
--- a/drivers/char/drm/radeon_drm.h
+++ b/drivers/char/drm/radeon_drm.h
@@ -482,7 +482,7 @@ typedef struct drm_radeon_clear {
 	unsigned int clear_depth;
 	unsigned int color_mask;
 	unsigned int depth_mask;   /* misnamed field:  should be stencil */
-	drm_radeon_clear_rect_t *depth_boxes;
+	drm_radeon_clear_rect_t __user *depth_boxes;
 } drm_radeon_clear_t;
 
 typedef struct drm_radeon_vertex {
@@ -508,9 +508,9 @@ typedef struct drm_radeon_vertex2 {
 	int idx;			/* Index of vertex buffer */
 	int discard;			/* Client finished with buffer? */
 	int nr_states;
-	drm_radeon_state_t *state;
+	drm_radeon_state_t __user *state;
 	int nr_prims;
-	drm_radeon_prim_t *prim;
+	drm_radeon_prim_t __user *prim;
 } drm_radeon_vertex2_t;
 
 /* v1.3 - obsoletes drm_radeon_vertex2
@@ -525,15 +525,15 @@ typedef struct drm_radeon_vertex2 {
  */
 typedef struct drm_radeon_cmd_buffer {
 	int bufsz;
-	char *buf;
+	char __user *buf;
 	int nbox;
-	drm_clip_rect_t *boxes;
+	drm_clip_rect_t __user *boxes;
 } drm_radeon_cmd_buffer_t;
 
 typedef struct drm_radeon_tex_image {
 	unsigned int x, y;		/* Blit coordinates */
 	unsigned int width, height;
-	const void *data;
+	const void __user *data;
 } drm_radeon_tex_image_t;
 
 typedef struct drm_radeon_texture {
@@ -542,11 +542,11 @@ typedef struct drm_radeon_texture {
 	int format;
 	int width;			/* Texture image coordinates */
 	int height;
-	drm_radeon_tex_image_t *image;
+	drm_radeon_tex_image_t __user *image;
 } drm_radeon_texture_t;
 
 typedef struct drm_radeon_stipple {
-	unsigned int *mask;
+	unsigned int __user *mask;
 } drm_radeon_stipple_t;
 
 typedef struct drm_radeon_indirect {
@@ -576,7 +576,7 @@ typedef struct drm_radeon_indirect {
 
 typedef struct drm_radeon_getparam {
 	int param;
-	void *value;
+	void __user *value;
 } drm_radeon_getparam_t;
 
 /* 1.6: Set up a memory manager for regions of shared memory:
@@ -588,7 +588,7 @@ typedef struct drm_radeon_mem_alloc {
 	int region;
 	int alignment;
 	int size;
-	int *region_offset;	/* offset from start of fb or GART */
+	int __user *region_offset;	/* offset from start of fb or GART */
 } drm_radeon_mem_alloc_t;
 
 typedef struct drm_radeon_mem_free {
@@ -606,7 +606,7 @@ typedef struct drm_radeon_mem_init_heap {
 /* 1.6: Userspace can request & wait on irq's:
  */
 typedef struct drm_radeon_irq_emit {
-	int *irq_seq;
+	int __user *irq_seq;
 } drm_radeon_irq_emit_t;
 
 typedef struct drm_radeon_irq_wait {
diff --git a/drivers/char/drm/radeon_drv.h b/drivers/char/drm/radeon_drv.h
index 45eafd056..e24e0ec09 100644
--- a/drivers/char/drm/radeon_drv.h
+++ b/drivers/char/drm/radeon_drv.h
@@ -887,7 +887,7 @@ do {									\
 
 #define OUT_RING_USER_TABLE( tab, sz ) do {			\
 	int _size = (sz);					\
-	int *_tab = (tab);					\
+	int __user *_tab = (tab);					\
 								\
 	if (write + _size > mask) {				\
 		int i = (mask+1) - write;			\
diff --git a/drivers/char/drm/radeon_irq.c b/drivers/char/drm/radeon_irq.c
index f503153a9..51d194935 100644
--- a/drivers/char/drm/radeon_irq.c
+++ b/drivers/char/drm/radeon_irq.c
@@ -187,7 +187,7 @@ int radeon_irq_emit( DRM_IOCTL_ARGS )
 		return DRM_ERR(EINVAL);
 	}
 
-	DRM_COPY_FROM_USER_IOCTL( emit, (drm_radeon_irq_emit_t *)data,
+	DRM_COPY_FROM_USER_IOCTL( emit, (drm_radeon_irq_emit_t __user *)data,
 				  sizeof(emit) );
 
 	result = radeon_emit_irq( dev );
@@ -214,7 +214,7 @@ int radeon_irq_wait( DRM_IOCTL_ARGS )
 		return DRM_ERR(EINVAL);
 	}
 
-	DRM_COPY_FROM_USER_IOCTL( irqwait, (drm_radeon_irq_wait_t *)data,
+	DRM_COPY_FROM_USER_IOCTL( irqwait, (drm_radeon_irq_wait_t __user*)data,
 				  sizeof(irqwait) );
 
 	return radeon_wait_irq( dev, irqwait.irq_seq );
diff --git a/drivers/char/drm/radeon_mem.c b/drivers/char/drm/radeon_mem.c
index 83e2f6c04..289957406 100644
--- a/drivers/char/drm/radeon_mem.c
+++ b/drivers/char/drm/radeon_mem.c
@@ -49,7 +49,7 @@ static struct mem_block *split_block(struct mem_block *p, int start, int size,
 			goto out;
 		newblock->start = start;
 		newblock->size = p->size - (start - p->start);
-		newblock->filp = 0;
+		newblock->filp = NULL;
 		newblock->next = p->next;
 		newblock->prev = p;
 		p->next->prev = newblock;
@@ -65,7 +65,7 @@ static struct mem_block *split_block(struct mem_block *p, int start, int size,
 			goto out;
 		newblock->start = start + size;
 		newblock->size = p->size - size;
-		newblock->filp = 0;
+		newblock->filp = NULL;
 		newblock->next = p->next;
 		newblock->prev = p;
 		p->next->prev = newblock;
@@ -108,7 +108,7 @@ static struct mem_block *find_block( struct mem_block *heap, int start )
 
 static void free_block( struct mem_block *p )
 {
-	p->filp = 0;
+	p->filp = NULL;
 
 	/* Assumes a single contiguous range.  Needs a special filp in
 	 * 'heap' to stop it being subsumed.
@@ -147,7 +147,7 @@ static int init_heap(struct mem_block **heap, int start, int size)
 
 	blocks->start = start;
 	blocks->size = size;
-	blocks->filp = 0;
+	blocks->filp = NULL;
 	blocks->next = blocks->prev = *heap;
 
 	memset( *heap, 0, sizeof(**heap) );
@@ -168,7 +168,7 @@ void radeon_mem_release( DRMFILE filp, struct mem_block *heap )
 
 	for (p = heap->next ; p != heap ; p = p->next) {
 		if (p->filp == filp) 
-			p->filp = 0;
+			p->filp = NULL;
 	}
 
 	/* Assumes a single contiguous range.  Needs a special filp in
@@ -201,7 +201,7 @@ void radeon_mem_takedown( struct mem_block **heap )
 	}
 
 	DRM_FREE( *heap, sizeof(**heap) );
-	*heap = 0;
+	*heap = NULL;
 }
 
 
@@ -217,7 +217,7 @@ static struct mem_block **get_heap( drm_radeon_private_t *dev_priv,
 	case RADEON_MEM_REGION_FB:
 		return &dev_priv->fb_heap;
 	default:
-		return 0;
+		return NULL;
 	}
 }
 
@@ -233,7 +233,7 @@ int radeon_mem_alloc( DRM_IOCTL_ARGS )
 		return DRM_ERR(EINVAL);
 	}
 
-	DRM_COPY_FROM_USER_IOCTL( alloc, (drm_radeon_mem_alloc_t *)data,
+	DRM_COPY_FROM_USER_IOCTL( alloc, (drm_radeon_mem_alloc_t __user *)data,
 				  sizeof(alloc) );
 
 	heap = get_heap( dev_priv, alloc.region );
@@ -275,7 +275,7 @@ int radeon_mem_free( DRM_IOCTL_ARGS )
 		return DRM_ERR(EINVAL);
 	}
 
-	DRM_COPY_FROM_USER_IOCTL( memfree, (drm_radeon_mem_free_t *)data,
+	DRM_COPY_FROM_USER_IOCTL( memfree, (drm_radeon_mem_free_t __user *)data,
 				  sizeof(memfree) );
 
 	heap = get_heap( dev_priv, memfree.region );
@@ -305,7 +305,7 @@ int radeon_mem_init_heap( DRM_IOCTL_ARGS )
 		return DRM_ERR(EINVAL);
 	}
 
-	DRM_COPY_FROM_USER_IOCTL( initheap, (drm_radeon_mem_init_heap_t *)data,
+	DRM_COPY_FROM_USER_IOCTL( initheap, (drm_radeon_mem_init_heap_t __user *)data,
 				  sizeof(initheap) );
 
 	heap = get_heap( dev_priv, initheap.region );
diff --git a/drivers/char/drm/radeon_state.c b/drivers/char/drm/radeon_state.c
index 64143d190..984d74589 100644
--- a/drivers/char/drm/radeon_state.c
+++ b/drivers/char/drm/radeon_state.c
@@ -63,7 +63,7 @@ static __inline__ int radeon_check_and_fixup_offset( drm_radeon_private_t *dev_p
 
 static __inline__ int radeon_check_and_fixup_offset_user( drm_radeon_private_t *dev_priv,
 							  drm_file_t *filp_priv,
-							  u32 *offset ) {
+							  u32 __user *offset ) {
 	u32 off;
 
 	DRM_GET_USER_UNCHECKED( off, offset );
@@ -79,7 +79,7 @@ static __inline__ int radeon_check_and_fixup_offset_user( drm_radeon_private_t *
 static __inline__ int radeon_check_and_fixup_packets( drm_radeon_private_t *dev_priv,
 						      drm_file_t *filp_priv,
 						      int id,
-						      u32 *data ) {
+						      u32 __user *data ) {
 	switch ( id ) {
 
 	case RADEON_EMIT_PP_MISC:
@@ -217,7 +217,8 @@ static __inline__ int radeon_check_and_fixup_packet3( drm_radeon_private_t *dev_
 						      drm_file_t *filp_priv,
 						      drm_radeon_cmd_buffer_t *cmdbuf,
 						      unsigned int *cmdsz ) {
-	u32 tmp[4], *cmd = ( u32* )cmdbuf->buf;
+	u32 tmp[4];
+	u32 __user *cmd = (u32 __user *)cmdbuf->buf;
 
 	if ( DRM_COPY_FROM_USER_UNCHECKED( tmp, cmd, sizeof( tmp ) ) ) {
 		DRM_ERROR( "Failed to copy data from user space\n" );
@@ -563,7 +564,7 @@ static struct {
 	{ R200_PP_CUBIC_OFFSET_F1_5, 5, "R200_PP_CUBIC_OFFSET_F1_5" },
 	{ RADEON_PP_TEX_SIZE_0, 2, "RADEON_PP_TEX_SIZE_0" },
 	{ RADEON_PP_TEX_SIZE_1, 2, "RADEON_PP_TEX_SIZE_1" },
-	{ RADEON_PP_TEX_SIZE_2, 2, "RADEON_PP_TEX_SIZE_1" },
+	{ RADEON_PP_TEX_SIZE_2, 2, "RADEON_PP_TEX_SIZE_2" },
 	{ R200_RB3D_BLENDCOLOR, 3, "R200_RB3D_BLENDCOLOR" },
 };
 
@@ -1339,7 +1340,7 @@ static int radeon_cp_dispatch_texture( DRMFILE filp,
 	drm_buf_t *buf;
 	u32 format;
 	u32 *buffer;
-	const u8 *data;
+	const u8 __user *data;
 	int size, dwords, tex_width, blit_width;
 	u32 height;
 	int i;
@@ -1417,7 +1418,7 @@ static int radeon_cp_dispatch_texture( DRMFILE filp,
 		 * update them for a multi-pass texture blit.
 		 */
 		height = image->height;
-		data = (const u8 *)image->data;
+		data = (const u8 __user *)image->data;
 		
 		size = height * blit_width;
 
@@ -1499,7 +1500,7 @@ static int radeon_cp_dispatch_texture( DRMFILE filp,
 		/* Update the input parameters for next time */
 		image->y += height;
 		image->height -= height;
-		image->data = (const u8 *)image->data + size;
+		image->data = (const u8 __user *)image->data + size;
 	} while (image->height > 0);
 
 	/* Flush the pixel cache after the blit completes.  This ensures
@@ -1550,7 +1551,7 @@ int radeon_cp_clear( DRM_IOCTL_ARGS )
 
 	LOCK_TEST_WITH_RETURN( dev, filp );
 
-	DRM_COPY_FROM_USER_IOCTL( clear, (drm_radeon_clear_t *)data,
+	DRM_COPY_FROM_USER_IOCTL( clear, (drm_radeon_clear_t __user *)data,
 			     sizeof(clear) );
 
 	RING_SPACE_TEST_WITH_RETURN( dev_priv );
@@ -1671,7 +1672,7 @@ int radeon_cp_vertex( DRM_IOCTL_ARGS )
 
 	DRM_GET_PRIV_WITH_RETURN( filp_priv, filp );
 
-	DRM_COPY_FROM_USER_IOCTL( vertex, (drm_radeon_vertex_t *)data,
+	DRM_COPY_FROM_USER_IOCTL( vertex, (drm_radeon_vertex_t __user *)data,
 			     sizeof(vertex) );
 
 	DRM_DEBUG( "pid=%d index=%d count=%d discard=%d\n",
@@ -1762,7 +1763,7 @@ int radeon_cp_indices( DRM_IOCTL_ARGS )
 
 	DRM_GET_PRIV_WITH_RETURN( filp_priv, filp );
 
-	DRM_COPY_FROM_USER_IOCTL( elts, (drm_radeon_indices_t *)data,
+	DRM_COPY_FROM_USER_IOCTL( elts, (drm_radeon_indices_t __user *)data,
 			     sizeof(elts) );
 
 	DRM_DEBUG( "pid=%d index=%d start=%d end=%d discard=%d\n",
@@ -1853,7 +1854,7 @@ int radeon_cp_texture( DRM_IOCTL_ARGS )
 
 	LOCK_TEST_WITH_RETURN( dev, filp );
 
-	DRM_COPY_FROM_USER_IOCTL( tex, (drm_radeon_texture_t *)data, sizeof(tex) );
+	DRM_COPY_FROM_USER_IOCTL( tex, (drm_radeon_texture_t __user *)data, sizeof(tex) );
 
 	if ( tex.image == NULL ) {
 		DRM_ERROR( "null texture image!\n" );
@@ -1861,7 +1862,7 @@ int radeon_cp_texture( DRM_IOCTL_ARGS )
 	}
 
 	if ( DRM_COPY_FROM_USER( &image,
-			     (drm_radeon_tex_image_t *)tex.image,
+			     (drm_radeon_tex_image_t __user *)tex.image,
 			     sizeof(image) ) )
 		return DRM_ERR(EFAULT);
 
@@ -1883,7 +1884,7 @@ int radeon_cp_stipple( DRM_IOCTL_ARGS )
 
 	LOCK_TEST_WITH_RETURN( dev, filp );
 
-	DRM_COPY_FROM_USER_IOCTL( stipple, (drm_radeon_stipple_t *)data,
+	DRM_COPY_FROM_USER_IOCTL( stipple, (drm_radeon_stipple_t __user *)data,
 			     sizeof(stipple) );
 
 	if ( DRM_COPY_FROM_USER( &mask, stipple.mask, 32 * sizeof(u32) ) )
@@ -1913,7 +1914,7 @@ int radeon_cp_indirect( DRM_IOCTL_ARGS )
 		return DRM_ERR(EINVAL);
 	}
 
-	DRM_COPY_FROM_USER_IOCTL( indirect, (drm_radeon_indirect_t *)data,
+	DRM_COPY_FROM_USER_IOCTL( indirect, (drm_radeon_indirect_t __user *)data,
 			     sizeof(indirect) );
 
 	DRM_DEBUG( "indirect: idx=%d s=%d e=%d d=%d\n",
@@ -1993,7 +1994,7 @@ int radeon_cp_vertex2( DRM_IOCTL_ARGS )
 
 	DRM_GET_PRIV_WITH_RETURN( filp_priv, filp );
 
-	DRM_COPY_FROM_USER_IOCTL( vertex, (drm_radeon_vertex2_t *)data,
+	DRM_COPY_FROM_USER_IOCTL( vertex, (drm_radeon_vertex2_t __user *)data,
 			     sizeof(vertex) );
 
 	DRM_DEBUG( "pid=%d index=%d discard=%d\n",
@@ -2086,7 +2087,7 @@ static int radeon_emit_packets(
 {
 	int id = (int)header.packet.packet_id;
 	int sz, reg;
-	int *data = (int *)cmdbuf->buf;
+	int __user *data = (int __user *)cmdbuf->buf;
 	RING_LOCALS;
    
 	if (id >= RADEON_MAX_STATE_PACKETS)
@@ -2121,7 +2122,7 @@ static __inline__ int radeon_emit_scalars(
 	drm_radeon_cmd_buffer_t *cmdbuf )
 {
 	int sz = header.scalars.count;
-	int *data = (int *)cmdbuf->buf;
+	int __user *data = (int __user *)cmdbuf->buf;
 	int start = header.scalars.offset;
 	int stride = header.scalars.stride;
 	RING_LOCALS;
@@ -2145,7 +2146,7 @@ static __inline__ int radeon_emit_scalars2(
 	drm_radeon_cmd_buffer_t *cmdbuf )
 {
 	int sz = header.scalars.count;
-	int *data = (int *)cmdbuf->buf;
+	int __user *data = (int __user *)cmdbuf->buf;
 	int start = ((unsigned int)header.scalars.offset) + 0x100;
 	int stride = header.scalars.stride;
 	RING_LOCALS;
@@ -2167,7 +2168,7 @@ static __inline__ int radeon_emit_vectors(
 	drm_radeon_cmd_buffer_t *cmdbuf )
 {
 	int sz = header.vectors.count;
-	int *data = (int *)cmdbuf->buf;
+	int __user *data = (int __user *)cmdbuf->buf;
 	int start = header.vectors.offset;
 	int stride = header.vectors.stride;
 	RING_LOCALS;
@@ -2191,7 +2192,8 @@ static int radeon_emit_packet3( drm_device_t *dev,
 {
 	drm_radeon_private_t *dev_priv = dev->dev_private;
 	unsigned int cmdsz;
-	int *cmd = (int *)cmdbuf->buf, ret;
+	int __user *cmd = (int __user *)cmdbuf->buf;
+	int ret;
 	RING_LOCALS;
 
 	DRM_DEBUG("\n");
@@ -2220,8 +2222,9 @@ static int radeon_emit_packet3_cliprect( drm_device_t *dev,
 	drm_radeon_private_t *dev_priv = dev->dev_private;
 	drm_clip_rect_t box;
 	unsigned int cmdsz;
-	int *cmd = (int *)cmdbuf->buf, ret;
-	drm_clip_rect_t *boxes = cmdbuf->boxes;
+	int __user *cmd = (int __user *)cmdbuf->buf;
+	int ret;
+	drm_clip_rect_t __user *boxes = cmdbuf->boxes;
 	int i = 0;
 	RING_LOCALS;
 
@@ -2310,7 +2313,7 @@ int radeon_cp_cmdbuf( DRM_IOCTL_ARGS )
 	drm_radeon_private_t *dev_priv = dev->dev_private;
 	drm_file_t *filp_priv;
 	drm_device_dma_t *dma = dev->dma;
-	drm_buf_t *buf = 0;
+	drm_buf_t *buf = NULL;
 	int idx;
 	drm_radeon_cmd_buffer_t cmdbuf;
 	drm_radeon_cmd_header_t header;
@@ -2325,7 +2328,7 @@ int radeon_cp_cmdbuf( DRM_IOCTL_ARGS )
 
 	DRM_GET_PRIV_WITH_RETURN( filp_priv, filp );
 
-	DRM_COPY_FROM_USER_IOCTL( cmdbuf, (drm_radeon_cmd_buffer_t *)data,
+	DRM_COPY_FROM_USER_IOCTL( cmdbuf, (drm_radeon_cmd_buffer_t __user *)data,
 			     sizeof(cmdbuf) );
 
 	RING_SPACE_TEST_WITH_RETURN( dev_priv );
@@ -2344,7 +2347,7 @@ int radeon_cp_cmdbuf( DRM_IOCTL_ARGS )
 
 	while ( cmdbuf.bufsz >= sizeof(header) ) {
 		
-		if (DRM_GET_USER_UNCHECKED( header.i, (int *)cmdbuf.buf )) {
+		if (DRM_GET_USER_UNCHECKED( header.i, (int __user *)cmdbuf.buf )) {
 			DRM_ERROR("__get_user %p\n", cmdbuf.buf);
 			return DRM_ERR(EFAULT);
 		}
@@ -2455,7 +2458,7 @@ int radeon_cp_getparam( DRM_IOCTL_ARGS )
 		return DRM_ERR(EINVAL);
 	}
 
-	DRM_COPY_FROM_USER_IOCTL( param, (drm_radeon_getparam_t *)data,
+	DRM_COPY_FROM_USER_IOCTL( param, (drm_radeon_getparam_t __user *)data,
 			     sizeof(param) );
 
 	DRM_DEBUG( "pid=%d\n", DRM_CURRENTPID );
@@ -2530,7 +2533,7 @@ int radeon_cp_setparam( DRM_IOCTL_ARGS ) {
 
 	DRM_GET_PRIV_WITH_RETURN( filp_priv, filp );
 
-	DRM_COPY_FROM_USER_IOCTL( sp, ( drm_radeon_setparam_t* )data,
+	DRM_COPY_FROM_USER_IOCTL( sp, ( drm_radeon_setparam_t __user * )data,
 				  sizeof( sp ) );
 
 	switch( sp.param ) {
diff --git a/drivers/char/drm/sis_ds.c b/drivers/char/drm/sis_ds.c
index 543ce71ef..083915545 100644
--- a/drivers/char/drm/sis_ds.c
+++ b/drivers/char/drm/sis_ds.c
@@ -165,7 +165,7 @@ memHeap_t *mmInit(int ofs,
 	PMemBlock blocks;
 
 	if (size <= 0)
-		return 0;
+		return NULL;
 
 	blocks = (TMemBlock *)DRM(calloc)(1, sizeof(TMemBlock), DRM_MEM_DRIVER);
 	if (blocks != NULL) {
@@ -174,7 +174,7 @@ memHeap_t *mmInit(int ofs,
 		blocks->free = 1;
 		return (memHeap_t *)blocks;
 	} else
-		return 0;
+		return NULL;
 }
 
 /* Checks if a pointer 'b' is part of the heap 'heap' */
diff --git a/drivers/char/drm/sis_mm.c b/drivers/char/drm/sis_mm.c
index 80935d6a7..5d29b40be 100644
--- a/drivers/char/drm/sis_mm.c
+++ b/drivers/char/drm/sis_mm.c
@@ -113,7 +113,7 @@ int sis_fb_alloc( DRM_IOCTL_ARGS )
 
 	DRM_COPY_TO_USER_IOCTL((drm_sis_mem_t *)data, fb, sizeof(fb));
 
-	DRM_DEBUG("alloc fb, size = %d, offset = %ld\n", fb.size, req.offset);
+	DRM_DEBUG("alloc fb, size = %d, offset = %d\n", fb.size, req.offset);
 
 	return retval;
 }
@@ -130,7 +130,7 @@ int sis_fb_free( DRM_IOCTL_ARGS )
 
 	if (!del_alloc_set(fb.context, VIDEO_TYPE, fb.free))
 		retval = DRM_ERR(EINVAL);
-	sis_free(fb.free);
+	sis_free((u32)fb.free);
 
 	DRM_DEBUG("free fb, offset = %lu\n", fb.free);
 
@@ -155,7 +155,7 @@ int sis_fb_init( DRM_IOCTL_ARGS )
 	drm_sis_private_t *dev_priv = dev->dev_private;
 	drm_sis_fb_t fb;
 
-	DRM_COPY_FROM_USER_IOCTL(fb, (drm_sis_fb_t *)data, sizeof(fb));
+	DRM_COPY_FROM_USER_IOCTL(fb, (drm_sis_fb_t __user *)data, sizeof(fb));
 
 	if (dev_priv == NULL) {
 		dev->dev_private = DRM(calloc)(1, sizeof(drm_sis_private_t),
@@ -179,6 +179,7 @@ int sis_fb_alloc( DRM_IOCTL_ARGS )
 {
 	DRM_DEVICE;
 	drm_sis_private_t *dev_priv = dev->dev_private;
+	drm_sis_mem_t __user *argp = (void __user *)data;
 	drm_sis_mem_t fb;
 	PMemBlock block;
 	int retval = 0;
@@ -186,7 +187,7 @@ int sis_fb_alloc( DRM_IOCTL_ARGS )
 	if (dev_priv == NULL || dev_priv->FBHeap == NULL)
 		return DRM_ERR(EINVAL);
   
-	DRM_COPY_FROM_USER_IOCTL(fb, (drm_sis_mem_t *)data, sizeof(fb));
+	DRM_COPY_FROM_USER_IOCTL(fb, argp, sizeof(fb));
   
 	block = mmAllocMem(dev_priv->FBHeap, fb.size, 0, 0);
 	if (block) {
@@ -204,7 +205,7 @@ int sis_fb_alloc( DRM_IOCTL_ARGS )
 		fb.free = 0;
 	}
 
-	DRM_COPY_TO_USER_IOCTL((drm_sis_mem_t *)data, fb, sizeof(fb));
+	DRM_COPY_TO_USER_IOCTL(argp, fb, sizeof(fb));
 
 	DRM_DEBUG("alloc fb, size = %d, offset = %d\n", fb.size, fb.offset);
 
@@ -220,7 +221,7 @@ int sis_fb_free( DRM_IOCTL_ARGS )
 	if (dev_priv == NULL || dev_priv->FBHeap == NULL)
 		return DRM_ERR(EINVAL);
 
-	DRM_COPY_FROM_USER_IOCTL(fb, (drm_sis_mem_t *)data, sizeof(fb));
+	DRM_COPY_FROM_USER_IOCTL(fb, (drm_sis_mem_t __user *)data, sizeof(fb));
 
 	if (!mmBlockInHeap(dev_priv->FBHeap, (PMemBlock)fb.free))
 		return DRM_ERR(EINVAL);
@@ -255,7 +256,7 @@ int sis_ioctl_agp_init( DRM_IOCTL_ARGS )
 	if (dev_priv->AGPHeap != NULL)
 		return DRM_ERR(EINVAL);
 
-	DRM_COPY_FROM_USER_IOCTL(agp, (drm_sis_agp_t *)data, sizeof(agp));
+	DRM_COPY_FROM_USER_IOCTL(agp, (drm_sis_agp_t __user *)data, sizeof(agp));
 
 	dev_priv->AGPHeap = mmInit(agp.offset, agp.size);
 
@@ -268,6 +269,7 @@ int sis_ioctl_agp_alloc( DRM_IOCTL_ARGS )
 {
 	DRM_DEVICE;
 	drm_sis_private_t *dev_priv = dev->dev_private;
+	drm_sis_mem_t __user *argp = (void __user *)data;
 	drm_sis_mem_t agp;
 	PMemBlock block;
 	int retval = 0;
@@ -275,7 +277,7 @@ int sis_ioctl_agp_alloc( DRM_IOCTL_ARGS )
 	if (dev_priv == NULL || dev_priv->AGPHeap == NULL)
 		return DRM_ERR(EINVAL);
   
-	DRM_COPY_FROM_USER_IOCTL(agp, (drm_sis_mem_t *)data, sizeof(agp));
+	DRM_COPY_FROM_USER_IOCTL(agp, argp, sizeof(agp));
   
 	block = mmAllocMem(dev_priv->AGPHeap, agp.size, 0, 0);
 	if (block) {
@@ -293,7 +295,7 @@ int sis_ioctl_agp_alloc( DRM_IOCTL_ARGS )
 		agp.free = 0;
 	}
 
-	DRM_COPY_TO_USER_IOCTL((drm_sis_mem_t *)data, agp, sizeof(agp));
+	DRM_COPY_TO_USER_IOCTL(argp, agp, sizeof(agp));
 
 	DRM_DEBUG("alloc agp, size = %d, offset = %d\n", agp.size, agp.offset);
 
@@ -309,7 +311,7 @@ int sis_ioctl_agp_free( DRM_IOCTL_ARGS )
 	if (dev_priv == NULL || dev_priv->AGPHeap == NULL)
 		return DRM_ERR(EINVAL);
 
-	DRM_COPY_FROM_USER_IOCTL(agp, (drm_sis_mem_t *)data, sizeof(agp));
+	DRM_COPY_FROM_USER_IOCTL(agp, (drm_sis_mem_t __user *)data, sizeof(agp));
 
 	if (!mmBlockInHeap(dev_priv->AGPHeap, (PMemBlock)agp.free))
 		return DRM_ERR(EINVAL);
diff --git a/drivers/char/ds1620.c b/drivers/char/ds1620.c
index 4171ca18b..e2c4ecac7 100644
--- a/drivers/char/ds1620.c
+++ b/drivers/char/ds1620.c
@@ -213,15 +213,11 @@ static void ds1620_read_state(struct therm *therm)
 }
 
 static ssize_t
-ds1620_read(struct file *file, char *buf, size_t count, loff_t *ptr)
+ds1620_read(struct file *file, char __user *buf, size_t count, loff_t *ptr)
 {
 	signed int cur_temp;
 	signed char cur_temp_degF;
 
-	/* Can't seek (pread) on this device */
-	if (ptr != &file->f_pos)
-		return -ESPIPE;
-
 	cur_temp = cvt_9_to_int(ds1620_in(THERM_READ_TEMP, 9)) >> 1;
 
 	/* convert to Fahrenheit, as per wdt.c */
@@ -237,8 +233,14 @@ static int
 ds1620_ioctl(struct inode *inode, struct file *file, unsigned int cmd, unsigned long arg)
 {
 	struct therm therm;
+	union {
+		struct therm __user *therm;
+		int __user *i;
+	} uarg;
 	int i;
 
+	uarg.i = (int __user *)arg;
+
 	switch(cmd) {
 	case CMD_SET_THERMOSTATE:
 	case CMD_SET_THERMOSTATE2:
@@ -246,11 +248,11 @@ ds1620_ioctl(struct inode *inode, struct file *file, unsigned int cmd, unsigned
 			return -EPERM;
 
 		if (cmd == CMD_SET_THERMOSTATE) {
-			if (get_user(therm.hi, (int *)arg))
+			if (get_user(therm.hi, uarg.i))
 				return -EFAULT;
 			therm.lo = therm.hi - 3;
 		} else {
-			if (copy_from_user(&therm, (void *)arg, sizeof(therm)))
+			if (copy_from_user(&therm, uarg.therm, sizeof(therm)))
 				return -EFAULT;
 		}
 
@@ -268,10 +270,10 @@ ds1620_ioctl(struct inode *inode, struct file *file, unsigned int cmd, unsigned
 		therm.hi >>= 1;
 
 		if (cmd == CMD_GET_THERMOSTATE) {
-			if (put_user(therm.hi, (int *)arg))
+			if (put_user(therm.hi, uarg.i))
 				return -EFAULT;
 		} else {
-			if (copy_to_user((void *)arg, &therm, sizeof(therm)))
+			if (copy_to_user(uarg.therm, &therm, sizeof(therm)))
 				return -EFAULT;
 		}
 		break;
@@ -283,23 +285,23 @@ ds1620_ioctl(struct inode *inode, struct file *file, unsigned int cmd, unsigned
 		if (cmd == CMD_GET_TEMPERATURE)
 			i >>= 1;
 
-		return put_user(i, (int *)arg) ? -EFAULT : 0;
+		return put_user(i, uarg.i) ? -EFAULT : 0;
 
 	case CMD_GET_STATUS:
 		i = ds1620_in(THERM_READ_CONFIG, 8) & 0xe3;
 
-		return put_user(i, (int *)arg) ? -EFAULT : 0;
+		return put_user(i, uarg.i) ? -EFAULT : 0;
 
 	case CMD_GET_FAN:
 		i = netwinder_get_fan();
 
-		return put_user(i, (int *)arg) ? -EFAULT : 0;
+		return put_user(i, uarg.i) ? -EFAULT : 0;
 
 	case CMD_SET_FAN:
 		if (!capable(CAP_SYS_ADMIN))
 			return -EPERM;
 
-		if (get_user(i, (int *)arg))
+		if (get_user(i, uarg.i))
 			return -EFAULT;
 
 		netwinder_set_fan(i);
@@ -338,6 +340,7 @@ static struct proc_dir_entry *proc_therm_ds1620;
 
 static struct file_operations ds1620_fops = {
 	.owner		= THIS_MODULE,
+	.open		= nonseekable_open,
 	.read		= ds1620_read,
 	.ioctl		= ds1620_ioctl,
 };
@@ -380,7 +383,7 @@ static int __init ds1620_init(void)
 		return ret;
 
 #ifdef THERM_USE_PROC
-	proc_therm_ds1620 = create_proc_entry("therm", 0, 0);
+	proc_therm_ds1620 = create_proc_entry("therm", 0, NULL);
 	if (proc_therm_ds1620)
 		proc_therm_ds1620->read_proc = proc_therm_ds1620_read;
 	else
diff --git a/drivers/char/dsp56k.c b/drivers/char/dsp56k.c
index 04276a89d..b022aca3d 100644
--- a/drivers/char/dsp56k.c
+++ b/drivers/char/dsp56k.c
@@ -293,10 +293,10 @@ static ssize_t dsp56k_write(struct file *file, const char *buf, size_t count,
 		}
 		case 2:  /* 16 bit */
 		{
-			short *data;
+			const short *data;
 
 			count /= 2;
-			data = (short*) buf;
+			data = (const short *)buf;
 			handshake(count, dsp56k.maxio, dsp56k.timeout, DSP56K_TRANSMIT,
 				  get_user(dsp56k_host_interface.data.w[1], data+n++));
 			return 2*n;
@@ -312,10 +312,10 @@ static ssize_t dsp56k_write(struct file *file, const char *buf, size_t count,
 		}
 		case 4:  /* 32 bit */
 		{
-			long *data;
+			const long *data;
 
 			count /= 4;
-			data = (long*) buf;
+			data = (const long *)buf;
 			handshake(count, dsp56k.maxio, dsp56k.timeout, DSP56K_TRANSMIT,
 				  get_user(dsp56k_host_interface.data.l, data+n++));
 			return 4*n;
diff --git a/drivers/char/dtlk.c b/drivers/char/dtlk.c
index 8febd413f..e8f15f46e 100644
--- a/drivers/char/dtlk.c
+++ b/drivers/char/dtlk.c
@@ -85,9 +85,9 @@ static wait_queue_head_t dtlk_process_list;
 static struct timer_list dtlk_timer;
 
 /* prototypes for file_operations struct */
-static ssize_t dtlk_read(struct file *, char *,
+static ssize_t dtlk_read(struct file *, char __user *,
 			 size_t nbytes, loff_t * ppos);
-static ssize_t dtlk_write(struct file *, const char *,
+static ssize_t dtlk_write(struct file *, const char __user *,
 			  size_t nbytes, loff_t * ppos);
 static unsigned int dtlk_poll(struct file *, poll_table *);
 static int dtlk_open(struct inode *, struct file *);
@@ -121,17 +121,13 @@ static char dtlk_write_tts(char);
  */
 static void dtlk_timer_tick(unsigned long data);
 
-static ssize_t dtlk_read(struct file *file, char *buf,
+static ssize_t dtlk_read(struct file *file, char __user *buf,
 			 size_t count, loff_t * ppos)
 {
 	unsigned int minor = iminor(file->f_dentry->d_inode);
 	char ch;
 	int i = 0, retries;
 
-	/* Can't seek (pread) on the DoubleTalk.  */
-	if (ppos != &file->f_pos)
-		return -ESPIPE;
-
 	TRACE_TEXT("(dtlk_read");
 	/*  printk("DoubleTalk PC - dtlk_read()\n"); */
 
@@ -158,7 +154,7 @@ static ssize_t dtlk_read(struct file *file, char *buf,
 	return -EAGAIN;
 }
 
-static ssize_t dtlk_write(struct file *file, const char *buf,
+static ssize_t dtlk_write(struct file *file, const char __user *buf,
 			  size_t count, loff_t * ppos)
 {
 	int i = 0, retries = 0, ch;
@@ -180,10 +176,6 @@ static ssize_t dtlk_write(struct file *file, const char *buf,
 	}
 #endif
 
-	/* Can't seek (pwrite) on the DoubleTalk.  */
-	if (ppos != &file->f_pos)
-		return -ESPIPE;
-
 	if (iminor(file->f_dentry->d_inode) != DTLK_MINOR)
 		return -EINVAL;
 
@@ -277,6 +269,7 @@ static int dtlk_ioctl(struct inode *inode,
 		      unsigned int cmd,
 		      unsigned long arg)
 {
+	char __user *argp = (char __user *)arg;
 	struct dtlk_settings *sp;
 	char portval;
 	TRACE_TEXT(" dtlk_ioctl");
@@ -285,14 +278,13 @@ static int dtlk_ioctl(struct inode *inode,
 
 	case DTLK_INTERROGATE:
 		sp = dtlk_interrogate();
-		if (copy_to_user((char *) arg, (char *) sp,
-				   sizeof(struct dtlk_settings)))
+		if (copy_to_user(argp, sp, sizeof(struct dtlk_settings)))
 			return -EINVAL;
 		return 0;
 
 	case DTLK_STATUS:
 		portval = inb_p(dtlk_port_tts);
-		return put_user(portval, (char *) arg);
+		return put_user(portval, argp);
 
 	default:
 		return -EINVAL;
@@ -303,11 +295,12 @@ static int dtlk_open(struct inode *inode, struct file *file)
 {
 	TRACE_TEXT("(dtlk_open");
 
+	nonseekable_open(inode, file);
 	switch (iminor(inode)) {
 	case DTLK_MINOR:
 		if (dtlk_busy)
 			return -EBUSY;
-		return 0;
+		return nonseekable_open(inode, file);
 
 	default:
 		return -ENXIO;
diff --git a/drivers/char/epca.c b/drivers/char/epca.c
index 8b838c187..854d16a39 100644
--- a/drivers/char/epca.c
+++ b/drivers/char/epca.c
@@ -48,8 +48,8 @@
 #define ENABLE_PCI
 #endif /* CONFIG_PCI */
 
-#define putUser(arg1, arg2) put_user(arg1, (unsigned long *)arg2)
-#define getUser(arg1, arg2) get_user(arg1, (unsigned int *)arg2)
+#define putUser(arg1, arg2) put_user(arg1, (unsigned long __user *)arg2)
+#define getUser(arg1, arg2) get_user(arg1, (unsigned __user *)arg2)
 
 #ifdef ENABLE_PCI
 #include <linux/pci.h>
@@ -218,7 +218,7 @@ static void setup_empty_event(struct tty_struct *tty, struct channel *ch);
 void epca_setup(char *, int *);
 void console_print(const char *);
 
-static int get_termio(struct tty_struct *, struct termio *);
+static int get_termio(struct tty_struct *, struct termio __user *);
 static int pc_write(struct tty_struct *, int, const unsigned char *, int);
 int pc_init(void);
 
@@ -835,38 +835,29 @@ static int pc_write(struct tty_struct * tty, int from_user,
 
 		if (bytesAvailable) 
 		{ /* Begin bytesAvailable */
+			/* ---------------------------------------------------------------
+				The below function reads data from user memory.  This routine
+				can not be used in an interrupt routine. (Because it may 
+				generate a page fault)  It can only be called while we can the
+				user context is accessible. 
+
+				The prototype is :
+				inline void copy_from_user(void * to, const void * from,
+							  unsigned long count);
+
+				I also think (Check hackers guide) that optimization must
+				be turned ON.  (Which sounds strange to me...)
+
+				Remember copy_from_user WILL generate a page fault if the
+				user memory being accessed has been swapped out.  This can
+				cause this routine to temporarily sleep while this page
+				fault is occurring.
+			
+			----------------------------------------------------------------- */
 
-			/* Can the user buffer be accessed at the moment ? */
-			if (verify_area(VERIFY_READ, (char*)buf, bytesAvailable))
-				bytesAvailable = 0; /* Can't do; try again later */
-			else  /* Evidently it can, began transmission */
-			{ /* Begin if area verified */
-				/* ---------------------------------------------------------------
-					The below function reads data from user memory.  This routine
-					can not be used in an interrupt routine. (Because it may 
-					generate a page fault)  It can only be called while we can the
-					user context is accessible. 
-
-					The prototype is :
-					inline void copy_from_user(void * to, const void * from,
-					                          unsigned long count);
-
-					I also think (Check hackers guide) that optimization must
-					be turned ON.  (Which sounds strange to me...)
-	
-					Remember copy_from_user WILL generate a page fault if the
-					user memory being accessed has been swapped out.  This can
-					cause this routine to temporarily sleep while this page
-					fault is occurring.
-				
-				----------------------------------------------------------------- */
-
-				if (copy_from_user(ch->tmp_buf, buf,
-						   bytesAvailable))
-					return -EFAULT;
-
-			} /* End if area verified */
-
+			if (copy_from_user(ch->tmp_buf, buf,
+					   bytesAvailable))
+				return -EFAULT;
 		} /* End bytesAvailable */
 
 		/* ------------------------------------------------------------------ 
@@ -1984,7 +1975,7 @@ static void post_fep_init(unsigned int crd)
 		ch->boardnum   = crd;
 		ch->channelnum = i;
 		ch->magic      = EPCA_MAGIC;
-		ch->tty        = 0;
+		ch->tty        = NULL;
 
 		if (shrinkmem) 
 		{
@@ -2728,7 +2719,7 @@ static void receive_data(struct channel *ch)
 { /* Begin receive_data */
 
 	unchar *rptr;
-	struct termios *ts = 0;
+	struct termios *ts = NULL;
 	struct tty_struct *tty;
 	volatile struct board_chan *bc;
 	register int dataToRead, wrapgap, bytesAvailable;
@@ -2851,8 +2842,6 @@ static void receive_data(struct channel *ch)
 static int info_ioctl(struct tty_struct *tty, struct file * file,
 		    unsigned int cmd, unsigned long arg)
 {
-	int error;
-	
 	switch (cmd) 
 	{ /* Begin switch cmd */
 
@@ -2862,13 +2851,7 @@ static int info_ioctl(struct tty_struct *tty, struct file * file,
 			struct digi_info di ;
 			int brd;
 
-			getUser(brd, (unsigned int *)arg);
-
-			if ((error = verify_area(VERIFY_WRITE, (char*)arg, sizeof(di))))
-			{
-				printk(KERN_ERR "DIGI_GETINFO : verify area size 0x%x failed\n",sizeof(di));
-				return(error);
-			}
+			getUser(brd, (unsigned int __user *)arg);
 
 			if ((brd < 0) || (brd >= num_cards) || (num_cards == 0))
 				return (-ENODEV);
@@ -2882,7 +2865,7 @@ static int info_ioctl(struct tty_struct *tty, struct file * file,
 			di.port = boards[brd].port ;
 			di.membase = boards[brd].membase ;
 
-			if (copy_to_user((char *)arg, &di, sizeof (di)))
+			if (copy_to_user((void __user *)arg, &di, sizeof (di)))
 				return -EFAULT;
 			break;
 
@@ -3020,6 +3003,7 @@ static int pc_tiocmset(struct tty_struct *tty, struct file *file,
 	epcaparam(tty,ch);
 	memoff(ch);
 	restore_flags(flags);
+	return 0;
 }
 
 static int pc_ioctl(struct tty_struct *tty, struct file * file,
@@ -3027,12 +3011,13 @@ static int pc_ioctl(struct tty_struct *tty, struct file * file,
 { /* Begin pc_ioctl */
 
 	digiflow_t dflow;
-	int retval, error;
+	int retval;
 	unsigned long flags;
 	unsigned int mflag, mstat;
 	unsigned char startc, stopc;
 	volatile struct board_chan *bc;
 	struct channel *ch = (struct channel *) tty->driver_data;
+	void __user *argp = (void __user *)arg;
 	
 	if (ch)
 		bc = ch->brdchan;
@@ -3054,13 +3039,13 @@ static int pc_ioctl(struct tty_struct *tty, struct file * file,
 	{ /* Begin switch cmd */
 
 		case TCGETS:
-			if (copy_to_user((struct termios *)arg, 
+			if (copy_to_user(argp, 
 					 tty->termios, sizeof(struct termios)))
 				return -EFAULT;
 			return(0);
 
 		case TCGETA:
-			return get_termio(tty, (struct termio *)arg);
+			return get_termio(tty, argp);
 
 		case TCSBRK:	/* SVID version: non-zero arg --> no break */
 
@@ -3090,21 +3075,16 @@ static int pc_ioctl(struct tty_struct *tty, struct file * file,
 			return 0;
 
 		case TIOCGSOFTCAR:
-
-			error = verify_area(VERIFY_WRITE, (void *) arg,sizeof(long));
-			if (error)
-				return error;
-
-			putUser(C_CLOCAL(tty) ? 1 : 0,
-			            (unsigned long *) arg);
+			if (put_user(C_CLOCAL(tty)?1:0, (unsigned long __user *)arg))
+				return -EFAULT;
 			return 0;
 
 		case TIOCSSOFTCAR:
-			/*RONNIE PUT VERIFY_READ (See above) check here */
 		{
 			unsigned int value;
 
-			getUser(value, (unsigned int *)arg);
+			if (get_user(value, (unsigned __user *)argp))
+				return -EFAULT;
 			tty->termios->c_cflag =
 				((tty->termios->c_cflag & ~CLOCAL) |
 				 (value ? CLOCAL : 0));
@@ -3113,12 +3093,12 @@ static int pc_ioctl(struct tty_struct *tty, struct file * file,
 
 		case TIOCMODG:
 			mflag = pc_tiocmget(tty, file);
-			if (putUser(mflag, (unsigned int *) arg))
+			if (put_user(mflag, (unsigned long __user *)argp))
 				return -EFAULT;
 			break;
 
 		case TIOCMODS:
-			if (getUser(mstat, (unsigned int *)arg))
+			if (get_user(mstat, (unsigned __user *)argp))
 				return -EFAULT;
 			return pc_tiocmset(tty, file, mstat, ~mstat);
 
@@ -3141,8 +3121,7 @@ static int pc_ioctl(struct tty_struct *tty, struct file * file,
 			break;
 
 		case DIGI_GETA:
-			if (copy_to_user((char*)arg, &ch->digiext,
-					 sizeof(digi_t)))
+			if (copy_to_user(argp, &ch->digiext, sizeof(digi_t)))
 				return -EFAULT;
 			break;
 
@@ -3164,8 +3143,7 @@ static int pc_ioctl(struct tty_struct *tty, struct file * file,
 			/* Fall Thru */
 
 		case DIGI_SETA:
-			if (copy_from_user(&ch->digiext, (char*)arg,
-					   sizeof(digi_t)))
+			if (copy_from_user(&ch->digiext, argp, sizeof(digi_t)))
 				return -EFAULT;
 			
 			if (ch->digiext.digi_flags & DIGI_ALTPIN) 
@@ -3209,7 +3187,7 @@ static int pc_ioctl(struct tty_struct *tty, struct file * file,
 			memoff(ch);
 			restore_flags(flags);
 
-			if (copy_to_user((char*)arg, &dflow, sizeof(dflow)))
+			if (copy_to_user(argp, &dflow, sizeof(dflow)))
 				return -EFAULT;
 			break;
 
@@ -3226,7 +3204,7 @@ static int pc_ioctl(struct tty_struct *tty, struct file * file,
 				stopc = ch->stopca;
 			}
 
-			if (copy_from_user(&dflow, (char*)arg, sizeof(dflow)))
+			if (copy_from_user(&dflow, argp, sizeof(dflow)))
 				return -EFAULT;
 
 			if (dflow.startc != startc || dflow.stopc != stopc) 
@@ -3555,17 +3533,9 @@ static void setup_empty_event(struct tty_struct *tty, struct channel *ch)
 
 /* --------------------- Begin get_termio ----------------------- */
 
-static int get_termio(struct tty_struct * tty, struct termio * termio)
+static int get_termio(struct tty_struct * tty, struct termio __user * termio)
 { /* Begin get_termio */
-	int error;
-
-	error = verify_area(VERIFY_WRITE, termio, sizeof (struct termio));
-	if (error)
-		return error;
-
-	kernel_termios_to_user_termio(termio, tty->termios);
-
-	return 0;
+	return kernel_termios_to_user_termio(termio, tty->termios);
 } /* End get_termio */
 /* ---------------------- Begin epca_setup  -------------------------- */
 void epca_setup(char *str, int *ints)
diff --git a/drivers/char/esp.c b/drivers/char/esp.c
index d7e0061b8..663a1e24f 100644
--- a/drivers/char/esp.c
+++ b/drivers/char/esp.c
@@ -933,7 +933,7 @@ static int startup(struct esp_struct * info)
 		else if (request_dma(dma, "esp serial")) {
 			free_pages((unsigned long)dma_buffer,
 				   get_order(DMA_BUFFER_SZ));
-			dma_buffer = 0;
+			dma_buffer = NULL;
 			info->stat_flags |= ESP_STAT_USE_PIO;
 		}
 			
@@ -1038,13 +1038,13 @@ static void shutdown(struct esp_struct * info)
 			free_dma(dma);
 			free_pages((unsigned long)dma_buffer,
 				   get_order(DMA_BUFFER_SZ));
-			dma_buffer = 0;
+			dma_buffer = NULL;
 		}		
 	}
 
 	if (info->xmit_buf) {
 		free_page((unsigned long) info->xmit_buf);
-		info->xmit_buf = 0;
+		info->xmit_buf = NULL;
 	}
 
 	info->IER = 0;
@@ -1435,12 +1435,10 @@ static void rs_unthrottle(struct tty_struct * tty)
  */
 
 static int get_serial_info(struct esp_struct * info,
-			   struct serial_struct * retinfo)
+			   struct serial_struct __user *retinfo)
 {
 	struct serial_struct tmp;
   
-	if (!retinfo)
-		return -EFAULT;
 	memset(&tmp, 0, sizeof(tmp));
 	tmp.type = PORT_16550A;
 	tmp.line = info->line;
@@ -1459,7 +1457,7 @@ static int get_serial_info(struct esp_struct * info,
 }
 
 static int get_esp_config(struct esp_struct * info,
-			  struct hayes_esp_config * retinfo)
+			  struct hayes_esp_config __user *retinfo)
 {
 	struct hayes_esp_config tmp;
   
@@ -1479,7 +1477,7 @@ static int get_esp_config(struct esp_struct * info,
 }
 
 static int set_serial_info(struct esp_struct * info,
-			   struct serial_struct * new_info)
+			   struct serial_struct __user *new_info)
 {
 	struct serial_struct new_serial;
 	struct esp_struct old_info;
@@ -1594,7 +1592,7 @@ static int set_serial_info(struct esp_struct * info,
 }
 
 static int set_esp_config(struct esp_struct * info,
-			  struct hayes_esp_config * new_info)
+			  struct hayes_esp_config __user * new_info)
 {
 	struct hayes_esp_config new_config;
 	unsigned int change_dma;
@@ -1739,7 +1737,7 @@ static int set_esp_config(struct esp_struct * info,
  * 	    transmit holding register is empty.  This functionality
  * 	    allows an RS485 driver to be written in user space. 
  */
-static int get_lsr_info(struct esp_struct * info, unsigned int *value)
+static int get_lsr_info(struct esp_struct * info, unsigned int __user *value)
 {
 	unsigned char status;
 	unsigned int result;
@@ -1780,7 +1778,6 @@ static int esp_tiocmset(struct tty_struct *tty, struct file *file,
 			unsigned int set, unsigned int clear)
 {
 	struct esp_struct * info = (struct esp_struct *)tty->driver_data;
-	unsigned int arg;
 
 	if (serial_paranoia_check(info, tty->name, __FUNCTION__))
 		return -ENODEV;
@@ -1835,7 +1832,8 @@ static int rs_ioctl(struct tty_struct *tty, struct file * file,
 {
 	struct esp_struct * info = (struct esp_struct *)tty->driver_data;
 	struct async_icount cprev, cnow;	/* kernel counter temps */
-	struct serial_icounter_struct *p_cuser;	/* user space */
+	struct serial_icounter_struct __user *p_cuser;	/* user space */
+	void __user *argp = (void __user *)arg;
 
 	if (serial_paranoia_check(info, tty->name, "rs_ioctl"))
 		return -ENODEV;
@@ -1851,20 +1849,18 @@ static int rs_ioctl(struct tty_struct *tty, struct file * file,
 	
 	switch (cmd) {
 		case TIOCGSERIAL:
-			return get_serial_info(info,
-					       (struct serial_struct *) arg);
+			return get_serial_info(info, argp);
 		case TIOCSSERIAL:
-			return set_serial_info(info,
-					       (struct serial_struct *) arg);
+			return set_serial_info(info, argp);
 		case TIOCSERCONFIG:
 			/* do not reconfigure after initial configuration */
 			return 0;
 
 		case TIOCSERGWILD:
-			return put_user(0L, (unsigned long *) arg);
+			return put_user(0L, (unsigned long __user *)argp);
 
 		case TIOCSERGETLSR: /* Get line status register */
-			    return get_lsr_info(info, (unsigned int *) arg);
+			    return get_lsr_info(info, argp);
 
 		case TIOCSERSWILD:
 			if (!capable(CAP_SYS_ADMIN))
@@ -1918,7 +1914,7 @@ static int rs_ioctl(struct tty_struct *tty, struct file * file,
 			cli();
 			cnow = info->icount;
 			sti();
-			p_cuser = (struct serial_icounter_struct *) arg;
+			p_cuser = argp;
 			if (put_user(cnow.cts, &p_cuser->cts) ||
 			    put_user(cnow.dsr, &p_cuser->dsr) ||
 			    put_user(cnow.rng, &p_cuser->rng) ||
@@ -1927,9 +1923,9 @@ static int rs_ioctl(struct tty_struct *tty, struct file * file,
 
 			return 0;
 	case TIOCGHAYESESP:
-		return (get_esp_config(info, (struct hayes_esp_config *)arg));
+		return get_esp_config(info, argp);
 	case TIOCSHAYESESP:
-		return (set_esp_config(info, (struct hayes_esp_config *)arg));
+		return set_esp_config(info, argp);
 
 		default:
 			return -ENOIOCTLCMD;
@@ -2077,7 +2073,7 @@ static void rs_close(struct tty_struct *tty, struct file * filp)
 		tty->ldisc.flush_buffer(tty);
 	tty->closing = 0;
 	info->event = 0;
-	info->tty = 0;
+	info->tty = NULL;
 
 	if (info->blocked_open) {
 		if (info->close_delay) {
@@ -2145,7 +2141,7 @@ static void esp_hangup(struct tty_struct *tty)
 	info->event = 0;
 	info->count = 0;
 	info->flags &= ~ASYNC_NORMAL_ACTIVE;
-	info->tty = 0;
+	info->tty = NULL;
 	wake_up_interruptible(&info->open_wait);
 }
 
@@ -2447,7 +2443,7 @@ int __init espserial_init(void)
 	int i, offset;
 	int region_start;
 	struct esp_struct * info;
-	struct esp_struct *last_primary = 0;
+	struct esp_struct *last_primary = NULL;
 	int esp[] = {0x100,0x140,0x180,0x200,0x240,0x280,0x300,0x380};
 
 	esp_driver = alloc_tty_driver(NR_PORTS);
diff --git a/drivers/char/ftape/compressor/lzrw3.c b/drivers/char/ftape/compressor/lzrw3.c
index a45cd2ba5..a032a0ee2 100644
--- a/drivers/char/ftape/compressor/lzrw3.c
+++ b/drivers/char/ftape/compressor/lzrw3.c
@@ -115,13 +115,14 @@ LOCAL void compress_decompress(UBYTE *,UBYTE *,LONG, UBYTE *, ULONG *);
 /* compress a block of memory, decompress a block of memory, or to identify   */
 /* itself. For more information, see the specification file "compress.h".     */
 
-EXPORT void lzrw3_compress(action,wrk_mem,src_adr,src_len,dst_adr,p_dst_len)
-UWORD     action;      /* Action to be performed.                             */
-UBYTE   *wrk_mem;      /* Address of working memory we can use.               */
-UBYTE   *src_adr;      /* Address of input data.                              */
-LONG     src_len;      /* Length  of input data.                              */
-UBYTE   *dst_adr;      /* Address to put output data.                         */
-void  *p_dst_len;      /* Address of longword for length of output data.      */
+EXPORT void lzrw3_compress(
+	UWORD     action,      /* Action to be performed.		*/
+	UBYTE   *wrk_mem,	/* Address of working memory we can use.*/
+	UBYTE   *src_adr,	/* Address of input data.		*/
+	LONG     src_len,	/* Length  of input data.		*/
+	UBYTE   *dst_adr,	/* Address to put output data.		*/
+	void  *p_dst_len	/* Address of longword for length of output data.*/
+)
 {
  switch (action)
    {
@@ -314,9 +315,7 @@ void  *p_dst_len;      /* Address of longword for length of output data.      */
    (((40543*(((*(PTR))<<8)^((*((PTR)+1))<<4)^(*((PTR)+2))))>>4) & 0xFFF)
 
 /******************************************************************************/
-                            
-LOCAL void compress_compress
-           (p_wrk_mem,p_src_first,src_len,p_dst_first,p_dst_len)
+
 /* Input  : Hand over the required amount of working memory in p_wrk_mem.     */
 /* Input  : Specify input block using p_src_first and src_len.                */
 /* Input  : Point p_dst_first to the start of the output zone (OZ).           */
@@ -326,11 +325,9 @@ LOCAL void compress_compress
 /* Output : Output block in Mem[p_dst_first..p_dst_first+*p_dst_len-1]. May   */
 /* Output : write in OZ=Mem[p_dst_first..p_dst_first+src_len+MAX_CMP_GROUP-1].*/
 /* Output : Upon completion guaranteed *p_dst_len<=src_len+FLAG_BYTES.        */
-UBYTE *p_wrk_mem;
-UBYTE *p_src_first;
-ULONG  src_len;
-UBYTE *p_dst_first;
-LONG  *p_dst_len;
+LOCAL void compress_compress(UBYTE *p_wrk_mem,
+			     UBYTE *p_src_first, ULONG  src_len,
+			     UBYTE *p_dst_first, LONG  *p_dst_len)
 {
  /* p_src and p_dst step through the source and destination blocks.           */
  register UBYTE *p_src = p_src_first;
@@ -366,8 +363,8 @@ LONG  *p_dst_len;
  /* to the hash table entry corresponding to the second youngest literal.     */
  /* Note: p_h1=0=>p_h2=0 because zero values denote absence of a pending      */
  /* literal. The variables are initialized to zero meaning an empty "buffer". */
- UBYTE **p_h1=0;
- UBYTE **p_h2=0;
+ UBYTE **p_h1=NULL;
+ UBYTE **p_h2=NULL;
   
  /* To start, we write the flag bytes. Being optimistic, we set the flag to   */
  /* FLAG_COMPRESS. The remaining flag bytes are zeroed so as to keep the      */
@@ -488,9 +485,9 @@ LONG  *p_dst_len;
           /* upon the arrival of extra context bytes.                         */
           if (p_h1!=0)
             {
-             if (p_h2!=0)
-               {*p_h2=p_ziv-2; p_h2=0;}
-             *p_h1=p_ziv-1; p_h1=0;
+             if (p_h2)
+               {*p_h2=p_ziv-2; p_h2=NULL;}
+             *p_h1=p_ziv-1; p_h1=NULL;
             }
             
           /* In any case, we can update the hash table based on the current   */
@@ -564,8 +561,6 @@ LONG  *p_dst_len;
 
 /******************************************************************************/
 
-LOCAL void compress_decompress
-           (p_wrk_mem,p_src_first,src_len,p_dst_first,p_dst_len)
 /* Input  : Hand over the required amount of working memory in p_wrk_mem.     */
 /* Input  : Specify input block using p_src_first and src_len.                */
 /* Input  : Point p_dst_first to the start of the output zone.                */
@@ -576,11 +571,9 @@ LOCAL void compress_decompress
 /* Output : Length of output block written to *p_dst_len.                     */
 /* Output : Output block in Mem[p_dst_first..p_dst_first+*p_dst_len-1].       */
 /* Output : Writes only  in Mem[p_dst_first..p_dst_first+*p_dst_len-1].       */
-UBYTE *p_wrk_mem;
-UBYTE *p_src_first;
-LONG   src_len;
-UBYTE *p_dst_first;
-ULONG *p_dst_len;
+LOCAL void compress_decompress( UBYTE *p_wrk_mem,
+				UBYTE *p_src_first, LONG   src_len,
+				UBYTE *p_dst_first, ULONG *p_dst_len)
 {
  /* Byte pointers p_src and p_dst scan through the input and output blocks.   */
  register UBYTE *p_src = p_src_first+FLAG_BYTES;
diff --git a/drivers/char/ftape/compressor/zftape-compress.c b/drivers/char/ftape/compressor/zftape-compress.c
index 430aa0db6..874627ab1 100644
--- a/drivers/char/ftape/compressor/zftape-compress.c
+++ b/drivers/char/ftape/compressor/zftape-compress.c
@@ -74,10 +74,10 @@ static unsigned int zftc_rd_compressed   = 0;
 /* forward */
 static int  zftc_write(int *write_cnt,
 		       __u8 *dst_buf, const int seg_sz,
-		       const __u8 *src_buf, const int req_len,
+		       const __u8 __user *src_buf, const int req_len,
 		       const zft_position *pos, const zft_volinfo *volume);
 static int  zftc_read(int *read_cnt,
-		      __u8  *dst_buf, const int to_do,
+		      __u8  __user *dst_buf, const int to_do,
 		      const __u8 *src_buf, const int seg_sz,
 		      const zft_position *pos, const zft_volinfo *volume);
 static int  zftc_seek(unsigned int new_block_pos, 
@@ -539,7 +539,7 @@ static int start_new_cseg(cmpr_info *cluster,
  */
 static int zftc_write(int *write_cnt,
 		      __u8 *dst_buf, const int seg_sz,
-		      const __u8 *src_buf, const int req_len,
+		      const __u8 __user *src_buf, const int req_len,
 		      const zft_position *pos, const zft_volinfo *volume)
 {
 	int req_len_left = req_len;
@@ -656,7 +656,7 @@ static int zftc_write(int *write_cnt,
  * be set to 0 
  */
 static int zftc_read (int *read_cnt, 
-		      __u8  *dst_buf, const int to_do, 
+		      __u8  __user *dst_buf, const int to_do, 
 		      const __u8 *src_buf, const int seg_sz, 
 		      const zft_position *pos, const zft_volinfo *volume)
 {          
diff --git a/drivers/char/ftape/lowlevel/fdc-io.c b/drivers/char/ftape/lowlevel/fdc-io.c
index a41a8e319..3b78eda30 100644
--- a/drivers/char/ftape/lowlevel/fdc-io.c
+++ b/drivers/char/ftape/lowlevel/fdc-io.c
@@ -31,6 +31,7 @@
 #include <linux/sched.h>
 #include <linux/ioport.h>
 #include <linux/interrupt.h>
+#include <linux/kernel.h>
 #include <asm/system.h>
 #include <asm/io.h>
 #include <asm/dma.h>
@@ -786,8 +787,8 @@ int fdc_seek(int track)
 		}
 	}
 #ifdef TESTING
-	time = ftape_timediff(time, ftape_timestamp()) / ABS(track - ftape_current_cylinder);
-	if ((time < 900 || time > 3100) && ABS(track - ftape_current_cylinder) > 5) {
+	time = ftape_timediff(time, ftape_timestamp()) / abs(track - ftape_current_cylinder);
+	if ((time < 900 || time > 3100) && abs(track - ftape_current_cylinder) > 5) {
 		TRACE(ft_t_warn, "Wrong FDC STEP interval: %d usecs (%d)",
                          time, track - ftape_current_cylinder);
 	}
diff --git a/drivers/char/ftape/lowlevel/ftape-init.c b/drivers/char/ftape/lowlevel/ftape-init.c
index 8d5368a66..17a7f0e0c 100644
--- a/drivers/char/ftape/lowlevel/ftape-init.c
+++ b/drivers/char/ftape/lowlevel/ftape-init.c
@@ -55,7 +55,7 @@ char ft_rev[] __initdata = "$Revision: 1.8 $";
 char ft_dat[] __initdata = "$Date: 1997/11/06 00:38:08 $";
 
 
-#ifndef CONFIG_FT_NO_TRACE_AT_ALL
+#if defined(MODULE) && !defined(CONFIG_FT_NO_TRACE_AT_ALL)
 static int ft_tracing = -1;
 #endif
 
@@ -90,7 +90,7 @@ KERN_INFO "Compiled for Linux version %s\n", UTS_RELEASE);
 	TRACE(ft_t_info, "ftape_init @ 0x%p", ftape_init);
 	/*  Allocate the DMA buffers. They are deallocated at cleanup() time.
 	 */
-#if TESTING
+#ifdef TESTING
 #ifdef MODULE
 	while (ftape_set_nr_buffers(CONFIG_FT_NR_BUFFERS) < 0) {
 		ftape_sleep(FT_SECOND/20);
diff --git a/drivers/char/ftape/lowlevel/ftape-proc.c b/drivers/char/ftape/lowlevel/ftape-proc.c
index 6b8844ff4..1e27c908e 100644
--- a/drivers/char/ftape/lowlevel/ftape-proc.c
+++ b/drivers/char/ftape/lowlevel/ftape-proc.c
@@ -192,7 +192,7 @@ int ftape_read_proc(char *page, char **start, off_t off,
 	ptr += get_history_info(ptr);
 
 	len = strlen(page);
-	*start = 0;
+	*start = NULL;
 	if (off+count >= len) {
 		*eof = 1;
 	} else {
diff --git a/drivers/char/ftape/zftape/zftape-ctl.c b/drivers/char/ftape/zftape/zftape-ctl.c
index 93010ccaa..6c7874e5c 100644
--- a/drivers/char/ftape/zftape/zftape-ctl.c
+++ b/drivers/char/ftape/zftape/zftape-ctl.c
@@ -1319,7 +1319,7 @@ ftmtcmd_error:
 
 /*  IOCTL routine called by kernel-interface code
  */
-int _zft_ioctl(unsigned int command, void * arg)
+int _zft_ioctl(unsigned int command, void __user * arg)
 {
 	int result;
 	union { struct mtop       mtop;
diff --git a/drivers/char/ftape/zftape/zftape-ctl.h b/drivers/char/ftape/zftape/zftape-ctl.h
index 6c5a2532a..414159891 100644
--- a/drivers/char/ftape/zftape/zftape-ctl.h
+++ b/drivers/char/ftape/zftape/zftape-ctl.h
@@ -52,7 +52,7 @@ extern int  zft_def_idle_state(void);
  */
 extern int  _zft_open(unsigned int dev_minor, unsigned int access_mode);
 extern int  _zft_close(void);
-extern int  _zft_ioctl(unsigned int command, void *arg);
+extern int  _zft_ioctl(unsigned int command, void __user *arg);
 #endif
 
 
diff --git a/drivers/char/ftape/zftape/zftape-init.c b/drivers/char/ftape/zftape/zftape-init.c
index 1fc5feaf9..eefd94a6d 100644
--- a/drivers/char/ftape/zftape/zftape-init.c
+++ b/drivers/char/ftape/zftape/zftape-init.c
@@ -88,9 +88,9 @@ static int zft_close(struct inode *ino, struct file *filep);
 static int  zft_ioctl(struct inode *ino, struct file *filep,
 		      unsigned int command, unsigned long arg);
 static int  zft_mmap(struct file *filep, struct vm_area_struct *vma);
-static ssize_t zft_read (struct file *fp, char *buff,
+static ssize_t zft_read (struct file *fp, char __user *buff,
 			 size_t req_len, loff_t *ppos);
-static ssize_t zft_write(struct file *fp, const char *buff,
+static ssize_t zft_write(struct file *fp, const char __user *buff,
 			 size_t req_len, loff_t *ppos);
 
 static struct file_operations zft_cdev =
@@ -113,6 +113,7 @@ static int zft_open(struct inode *ino, struct file *filep)
 	int result;
 	TRACE_FUN(ft_t_flow);
 
+	nonseekable_open(ino, filep);
 	TRACE(ft_t_flow, "called for minor %d", iminor(ino));
 	if ( test_and_set_bit(0,&busy_flag) ) {
 		TRACE_ABORT(-EBUSY, ft_t_warn, "failed: already busy");
@@ -177,7 +178,7 @@ static int zft_ioctl(struct inode *ino, struct file *filep,
 	old_sigmask = current->blocked; /* save mask */
 	sigfillset(&current->blocked);
 	/* This will work as long as sizeof(void *) == sizeof(long) */
-	result = _zft_ioctl(command, (void *) arg);
+	result = _zft_ioctl(command, (void __user *) arg);
 	current->blocked = old_sigmask; /* restore mask */
 	TRACE_EXIT result;
 }
@@ -211,7 +212,7 @@ static int  zft_mmap(struct file *filep, struct vm_area_struct *vma)
 
 /*      Read from floppy tape device
  */
-static ssize_t zft_read(struct file *fp, char *buff,
+static ssize_t zft_read(struct file *fp, char __user *buff,
 			size_t req_len, loff_t *ppos)
 {
 	int result = -EIO;
@@ -234,7 +235,7 @@ static ssize_t zft_read(struct file *fp, char *buff,
 
 /*      Write to tape device
  */
-static ssize_t zft_write(struct file *fp, const char *buff,
+static ssize_t zft_write(struct file *fp, const char __user *buff,
 			 size_t req_len, loff_t *ppos)
 {
 	int result = -EIO;
diff --git a/drivers/char/ftape/zftape/zftape-init.h b/drivers/char/ftape/zftape/zftape-init.h
index 5f9ce2eef..2145892b9 100644
--- a/drivers/char/ftape/zftape/zftape-init.h
+++ b/drivers/char/ftape/zftape/zftape-init.h
@@ -52,10 +52,10 @@ extern const  ftape_info *zft_status; /* needed for zftape-vtbl.h */
 struct zft_cmpr_ops {
 	int (*write)(int *write_cnt,
 		     __u8 *dst_buf, const int seg_sz,
-		     const __u8 *src_buf, const int req_len, 
+		     const __u8 __user *src_buf, const int req_len, 
 		     const zft_position *pos, const zft_volinfo *volume);
 	int (*read)(int *read_cnt,
-		    __u8 *dst_buf, const int req_len,
+		    __u8 __user *dst_buf, const int req_len,
 		    const __u8 *src_buf, const int seg_sz,
 		    const zft_position *pos, const zft_volinfo *volume);
 	int (*seek)(unsigned int new_block_pos,
diff --git a/drivers/char/ftape/zftape/zftape-read.c b/drivers/char/ftape/zftape/zftape-read.c
index 42de63254..214bf03dc 100644
--- a/drivers/char/ftape/zftape/zftape-read.c
+++ b/drivers/char/ftape/zftape/zftape-read.c
@@ -154,7 +154,7 @@ int zft_fetch_segment_fraction(const unsigned int segment, void *buffer,
  * amount of data actually * copied to the user-buffer
  */
 static int zft_simple_read (int *read_cnt, 
-			    __u8  *dst_buf, 
+			    __u8  __user *dst_buf, 
 			    const int to_do, 
 			    const __u8 *src_buf, 
 			    const int seg_sz, 
@@ -252,7 +252,7 @@ static int check_read_access(int *req_len,
  * req_len: how much data should be read at most.
  * volume: contains information on current volume (blk_sz etc.)
  */  
-static int empty_deblock_buf(__u8 *usr_buf, const int req_len,
+static int empty_deblock_buf(__u8 __user *usr_buf, const int req_len,
 			     const __u8 *src_buf, const int seg_sz,
 			     zft_position *pos,
 			     const zft_volinfo *volume)
@@ -293,7 +293,7 @@ static int empty_deblock_buf(__u8 *usr_buf, const int req_len,
  * use small block-sizes. The block-size may be 1kb (SECTOR_SIZE). In
  * this case a MTFSR 28 maybe still inside the same segment.
  */
-int _zft_read(char* buff, int req_len)
+int _zft_read(char __user *buff, int req_len)
 {
 	int req_clipped;
 	int result     = 0;
diff --git a/drivers/char/ftape/zftape/zftape-read.h b/drivers/char/ftape/zftape/zftape-read.h
index ad2e9dbc4..42941de0c 100644
--- a/drivers/char/ftape/zftape/zftape-read.h
+++ b/drivers/char/ftape/zftape/zftape-read.h
@@ -48,6 +48,6 @@ extern int  zft_fetch_segment_fraction(const unsigned int segment,
 				   0, FT_SEGMENT_SIZE)
 /*   hook for the VFS interface
  */
-extern int  _zft_read(char* buff, int req_len);
+extern int  _zft_read(char __user *buff, int req_len);
 
 #endif /* _ZFTAPE_READ_H */
diff --git a/drivers/char/ftape/zftape/zftape-write.c b/drivers/char/ftape/zftape/zftape-write.c
index 43129fdf0..94327b8c9 100644
--- a/drivers/char/ftape/zftape/zftape-write.c
+++ b/drivers/char/ftape/zftape/zftape-write.c
@@ -303,7 +303,7 @@ int zft_flush_buffers(void)
  */
 static int zft_simple_write(int *cnt,
 			    __u8 *dst_buf, const int seg_sz,
-			    const __u8 *src_buf, const int req_len, 
+			    const __u8 __user *src_buf, const int req_len, 
 			    const zft_position *pos,const zft_volinfo *volume)
 {
 	int space_left;
@@ -379,7 +379,7 @@ static int check_write_access(int req_len,
 
 static int fill_deblock_buf(__u8 *dst_buf, const int seg_sz,
 			    zft_position *pos, const zft_volinfo *volume,
-			    const char *usr_buf, const int req_len)
+			    const char __user *usr_buf, const int req_len)
 {
 	int cnt = 0;
 	int result = 0;
@@ -420,7 +420,7 @@ static int fill_deblock_buf(__u8 *dst_buf, const int seg_sz,
 
 /*  called by the kernel-interface routine "zft_write()"
  */
-int _zft_write(const char* buff, int req_len)
+int _zft_write(const char __user *buff, int req_len)
 {
 	int result = 0;
 	int written = 0;
diff --git a/drivers/char/ftape/zftape/zftape-write.h b/drivers/char/ftape/zftape/zftape-write.h
index 4a8d47687..ea887015b 100644
--- a/drivers/char/ftape/zftape/zftape-write.h
+++ b/drivers/char/ftape/zftape/zftape-write.h
@@ -34,5 +34,5 @@ extern void zft_prevent_flush(void);
 
 /*  hook for the VFS interface 
  */
-extern int _zft_write(const char *buff, int req_len);
+extern int _zft_write(const char __user *buff, int req_len);
 #endif /* _ZFTAPE_WRITE_H */
diff --git a/drivers/char/generic_serial.c b/drivers/char/generic_serial.c
index 1f278a42e..1027eb7c6 100644
--- a/drivers/char/generic_serial.c
+++ b/drivers/char/generic_serial.c
@@ -45,7 +45,7 @@ static int gs_debug;
 #define func_enter() gs_dprintk (GS_DEBUG_FLOW, "gs: enter %s\n", __FUNCTION__)
 #define func_exit()  gs_dprintk (GS_DEBUG_FLOW, "gs: exit  %s\n", __FUNCTION__)
 
-#if NEW_WRITE_LOCKING
+#ifdef NEW_WRITE_LOCKING
 #define DECL      /* Nothing */
 #define LOCKIT    down (& port->port_write_sem);
 #define RELEASEIT up (&port->port_write_sem);
@@ -526,7 +526,7 @@ void gs_shutdown_port (struct gs_port *port)
 
 	if (port->xmit_buf) {
 		free_page((unsigned long) port->xmit_buf);
-		port->xmit_buf = 0;
+		port->xmit_buf = NULL;
 	}
 
 	if (port->tty)
@@ -767,7 +767,7 @@ void gs_close(struct tty_struct * tty, struct file * filp)
 	port->event = 0;
 	port->rd->close (port);
 	port->rd->shutdown_port (port);
-	port->tty = 0;
+	port->tty = NULL;
 
 	if (port->blocked_open) {
 		if (port->close_delay) {
@@ -967,7 +967,7 @@ int gs_init_port(struct gs_port *port)
 }
 
 
-int gs_setserial(struct gs_port *port, struct serial_struct *sp)
+int gs_setserial(struct gs_port *port, struct serial_struct __user *sp)
 {
 	struct serial_struct sio;
 
@@ -1002,7 +1002,7 @@ int gs_setserial(struct gs_port *port, struct serial_struct *sp)
  *      Generate the serial struct info.
  */
 
-int gs_getserial(struct gs_port *port, struct serial_struct *sp)
+int gs_getserial(struct gs_port *port, struct serial_struct __user *sp)
 {
 	struct serial_struct    sio;
 
diff --git a/drivers/char/genrtc.c b/drivers/char/genrtc.c
index d110713e8..266fe4002 100644
--- a/drivers/char/genrtc.c
+++ b/drivers/char/genrtc.c
@@ -171,7 +171,7 @@ static void gen_rtc_interrupt(unsigned long arg)
 /*
  *	Now all the various file operations that we export.
  */
-static ssize_t gen_rtc_read(struct file *file, char *buf,
+static ssize_t gen_rtc_read(struct file *file, char __user *buf,
 			size_t count, loff_t *ppos)
 {
 	DECLARE_WAITQUEUE(wait, current);
@@ -200,10 +200,10 @@ static ssize_t gen_rtc_read(struct file *file, char *buf,
 	/* first test allows optimizer to nuke this case for 32-bit machines */
 	if (sizeof (int) != sizeof (long) && count == sizeof (unsigned int)) {
 		unsigned int uidata = data;
-		retval = put_user(uidata, (unsigned long *)buf);
+		retval = put_user(uidata, (unsigned long __user *)buf);
 	}
 	else {
-		retval = put_user(data, (unsigned long *)buf);
+		retval = put_user(data, (unsigned long __user *)buf);
 	}
 	if (!retval)
 		retval = sizeof(unsigned long);
@@ -278,6 +278,7 @@ static int gen_rtc_ioctl(struct inode *inode, struct file *file,
 {
 	struct rtc_time wtime;
 	struct rtc_pll_info pll;
+	void __user *argp = (void __user *)arg;
 
 	switch (cmd) {
 
@@ -285,13 +286,12 @@ static int gen_rtc_ioctl(struct inode *inode, struct file *file,
 	    if (get_rtc_pll(&pll))
 	 	    return -EINVAL;
 	    else
-		    return copy_to_user((void *)arg, &pll, sizeof pll) ? -EFAULT : 0;
+		    return copy_to_user(argp, &pll, sizeof pll) ? -EFAULT : 0;
 
 	case RTC_PLL_SET:
 		if (!capable(CAP_SYS_TIME))
 			return -EACCES;
-		if (copy_from_user(&pll, (struct rtc_pll_info*)arg,
-				   sizeof(pll)))
+		if (copy_from_user(&pll, argp, sizeof(pll)))
 			return -EFAULT;
 	    return set_rtc_pll(&pll);
 
@@ -307,7 +307,7 @@ static int gen_rtc_ioctl(struct inode *inode, struct file *file,
 		memset(&wtime, 0, sizeof(wtime));
 		get_rtc_time(&wtime);
 
-		return copy_to_user((void *)arg, &wtime, sizeof(wtime)) ? -EFAULT : 0;
+		return copy_to_user(argp, &wtime, sizeof(wtime)) ? -EFAULT : 0;
 
 	case RTC_SET_TIME:	/* Set the RTC */
 	    {
@@ -317,8 +317,7 @@ static int gen_rtc_ioctl(struct inode *inode, struct file *file,
 		if (!capable(CAP_SYS_TIME))
 			return -EACCES;
 
-		if (copy_from_user(&wtime, (struct rtc_time *)arg,
-				   sizeof(wtime)))
+		if (copy_from_user(&wtime, argp, sizeof(wtime)))
 			return -EFAULT;
 
 		year = wtime.tm_year + 1900;
@@ -470,7 +469,7 @@ static int __init gen_rtc_proc_init(void)
 {
 	struct proc_dir_entry *r;
 
-	r = create_proc_read_entry("driver/rtc", 0, 0, gen_rtc_read_proc, NULL);
+	r = create_proc_read_entry("driver/rtc", 0, NULL, gen_rtc_read_proc, NULL);
 	if (!r)
 		return -ENOMEM;
 	return 0;
diff --git a/drivers/char/hpet.c b/drivers/char/hpet.c
index cef6032b8..5e8c47244 100644
--- a/drivers/char/hpet.c
+++ b/drivers/char/hpet.c
@@ -1,8 +1,14 @@
 /*
  * Intel & MS High Precision Event Timer Implementation.
- * Contributors:
+ *
+ * Copyright (C) 2003 Intel Corporation
  *	Venki Pallipadi
- * 	Bob Picco
+ * (c) Copyright 2004 Hewlett-Packard Development Company, L.P.
+ *	Bob Picco <robert.picco@hp.com>
+ *
+ * This program is free software; you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License version 2 as
+ * published by the Free Software Foundation.
  */
 
 #include <linux/config.h>
@@ -50,6 +56,8 @@ static spinlock_t hpet_lock = SPIN_LOCK_UNLOCKED;
 /* A lock for concurrent intermodule access to hpet and isr hpet activity. */
 static spinlock_t hpet_task_lock = SPIN_LOCK_UNLOCKED;
 
+#define	HPET_DEV_NAME	(7)
+
 struct hpet_dev {
 	struct hpets *hd_hpets;
 	struct hpet *hd_hpet;
@@ -62,6 +70,7 @@ struct hpet_dev {
 	unsigned int hd_flags;
 	unsigned int hd_irq;
 	unsigned int hd_hdwirq;
+	char hd_name[HPET_DEV_NAME];
 };
 
 struct hpets {
@@ -148,6 +157,9 @@ static int hpet_open(struct inode *inode, struct file *file)
 	struct hpets *hpetp;
 	int i;
 
+	if (file->f_mode & FMODE_WRITE)
+		return -EINVAL;
+
 	spin_lock_irq(&hpet_lock);
 
 	for (devp = NULL, hpetp = hpets; hpetp && !devp; hpetp = hpetp->hp_next)
@@ -174,7 +186,7 @@ static int hpet_open(struct inode *inode, struct file *file)
 }
 
 static ssize_t
-hpet_read(struct file *file, char *buf, size_t count, loff_t * ppos)
+hpet_read(struct file *file, char __user *buf, size_t count, loff_t * ppos)
 {
 	DECLARE_WAITQUEUE(wait, current);
 	unsigned long data;
@@ -190,8 +202,8 @@ hpet_read(struct file *file, char *buf, size_t count, loff_t * ppos)
 
 	add_wait_queue(&devp->hd_waitqueue, &wait);
 
-	do {
-		__set_current_state(TASK_INTERRUPTIBLE);
+	for ( ; ; ) {
+		set_current_state(TASK_INTERRUPTIBLE);
 
 		spin_lock_irq(&hpet_lock);
 		data = devp->hd_irqdata;
@@ -207,16 +219,14 @@ hpet_read(struct file *file, char *buf, size_t count, loff_t * ppos)
 			retval = -ERESTARTSYS;
 			goto out;
 		}
-
 		schedule();
+	}
 
-	} while (1);
-
-	retval = put_user(data, (unsigned long *)buf);
+	retval = put_user(data, (unsigned long __user *)buf);
 	if (!retval)
 		retval = sizeof(unsigned long);
-      out:
-	current->state = TASK_RUNNING;
+out:
+	__set_current_state(TASK_RUNNING);
 	remove_wait_queue(&devp->hd_waitqueue, &wait);
 
 	return retval;
@@ -246,18 +256,13 @@ static unsigned int hpet_poll(struct file *file, poll_table * wait)
 
 static int hpet_mmap(struct file *file, struct vm_area_struct *vma)
 {
-#ifdef	CONFIG_HPET_NOMMAP
-	return -ENOSYS;
-#else
+#ifdef	CONFIG_HPET_MMAP
 	struct hpet_dev *devp;
 	unsigned long addr;
 
 	if (((vma->vm_end - vma->vm_start) != PAGE_SIZE) || vma->vm_pgoff)
 		return -EINVAL;
 
-	if (vma->vm_flags & VM_WRITE)
-		return -EPERM;
-
 	devp = file->private_data;
 	addr = (unsigned long)devp->hd_hpet;
 
@@ -275,6 +280,8 @@ static int hpet_mmap(struct file *file, struct vm_area_struct *vma)
 	}
 
 	return 0;
+#else
+	return -ENOSYS;
 #endif
 }
 
@@ -327,7 +334,7 @@ static int hpet_release(struct inode *inode, struct file *file)
 	if (file->f_flags & FASYNC)
 		hpet_fasync(-1, file, 0);
 
-	file->private_data = 0;
+	file->private_data = NULL;
 	return 0;
 }
 
@@ -371,12 +378,10 @@ static int hpet_ioctl_ieon(struct hpet_dev *devp)
 	irq = devp->hd_hdwirq;
 
 	if (irq) {
-		char name[7];
-
-		sprintf(name, "hpet%d", (int)(devp - hpetp->hp_dev));
+		sprintf(devp->hd_name, "hpet%d", (int)(devp - hpetp->hp_dev));
 
 		if (request_irq
-		    (irq, hpet_interrupt, SA_INTERRUPT, name, (void *)devp)) {
+		    (irq, hpet_interrupt, SA_INTERRUPT, devp->hd_name, (void *)devp)) {
 			printk(KERN_ERR "hpet: IRQ %d is not free\n", irq);
 			irq = 0;
 		}
@@ -477,7 +482,7 @@ hpet_ioctl_common(struct hpet_dev *devp, int cmd, unsigned long arg, int kernel)
 			    readq(&timer->hpet_config) & Tn_PER_INT_CAP_MASK;
 			info.hi_hpet = devp->hd_hpets->hp_which;
 			info.hi_timer = devp - devp->hd_hpets->hp_dev;
-			if (copy_to_user((void *)arg, &info, sizeof(info)))
+			if (copy_to_user((void __user *)arg, &info, sizeof(info)))
 				err = -EFAULT;
 			break;
 		}
@@ -560,7 +565,7 @@ int hpet_register(struct hpet_task *tp, int periodic)
 	spin_lock_irq(&hpet_task_lock);
 	spin_lock(&hpet_lock);
 
-	for (devp = 0, hpetp = hpets; hpetp && !devp; hpetp = hpetp->hp_next)
+	for (devp = NULL, hpetp = hpets; hpetp && !devp; hpetp = hpetp->hp_next)
 		for (timer = hpetp->hp_hpet->hpet_timers, i = 0;
 		     i < hpetp->hp_ntimer; i++, timer++) {
 			if ((readq(&timer->hpet_config) & Tn_PER_INT_CAP_MASK)
@@ -570,7 +575,7 @@ int hpet_register(struct hpet_task *tp, int periodic)
 			devp = &hpetp->hp_dev[i];
 
 			if (devp->hd_flags & HPET_OPEN || devp->hd_task) {
-				devp = 0;
+				devp = NULL;
 				continue;
 			}
 
@@ -630,7 +635,7 @@ int hpet_unregister(struct hpet_task *tp)
 	writeq((readq(&timer->hpet_config) & ~Tn_INT_ENB_CNF_MASK),
 	       &timer->hpet_config);
 	devp->hd_flags &= ~(HPET_IE | HPET_PERIODIC);
-	devp->hd_task = 0;
+	devp->hd_task = NULL;
 	spin_unlock(&hpet_lock);
 	spin_unlock_irq(&hpet_task_lock);
 
@@ -731,73 +736,6 @@ static ctl_table dev_root[] = {
 
 static struct ctl_table_header *sysctl_header;
 
-static void *hpet_start(struct seq_file *s, loff_t * pos)
-{
-	struct hpets *hpetp;
-	loff_t n;
-
-	for (n = *pos, hpetp = hpets; hpetp; hpetp = hpetp->hp_next)
-		if (!n--)
-			return hpetp;
-
-	return 0;
-}
-
-static void *hpet_next(struct seq_file *s, void *v, loff_t * pos)
-{
-	struct hpets *hpetp;
-
-	hpetp = v;
-	++*pos;
-	return hpetp->hp_next;
-}
-
-static void hpet_stop(struct seq_file *s, void *v)
-{
-	return;
-}
-
-static int hpet_show(struct seq_file *s, void *v)
-{
-	struct hpets *hpetp;
-	struct hpet *hpet;
-	u64 cap, vendor, period;
-
-	hpetp = v;
-	hpet = hpetp->hp_hpet;
-
-	cap = readq(&hpet->hpet_cap);
-	period = (cap & HPET_COUNTER_CLK_PERIOD_MASK) >>
-	    HPET_COUNTER_CLK_PERIOD_SHIFT;
-	vendor = (cap & HPET_VENDOR_ID_MASK) >> HPET_VENDOR_ID_SHIFT;
-
-	seq_printf(s,
-		   "HPET%d period = %d 10**-15  vendor = 0x%x number timer = %d\n",
-		   hpetp->hp_which, (u32) period, (u32) vendor,
-		   hpetp->hp_ntimer);
-
-	return 0;
-}
-
-static struct seq_operations hpet_seq_ops = {
-	.start = hpet_start,
-	.next = hpet_next,
-	.stop = hpet_stop,
-	.show = hpet_show
-};
-
-static int hpet_proc_open(struct inode *inode, struct file *file)
-{
-	return seq_open(file, &hpet_seq_ops);
-}
-
-static struct file_operations hpet_proc_fops = {
-	.open = hpet_proc_open,
-	.read = seq_read,
-	.llseek = seq_lseek,
-	.release = seq_release
-};
-
 /*
  * Adjustment for when arming the timer with
  * initial conditions.  That is, main counter
@@ -807,14 +745,13 @@ static struct file_operations hpet_proc_fops = {
 
 static unsigned long __init hpet_calibrate(struct hpets *hpetp)
 {
-	struct hpet_timer *timer;
+	struct hpet_timer *timer = NULL;
 	unsigned long t, m, count, i, flags, start;
 	struct hpet_dev *devp;
 	int j;
 	struct hpet *hpet;
 
-	for (timer = 0, j = 0, devp = hpetp->hp_dev; j < hpetp->hp_ntimer;
-	     j++, devp++)
+	for (j = 0, devp = hpetp->hp_dev; j < hpetp->hp_ntimer; j++, devp++)
 		if ((devp->hd_flags & HPET_OPEN) == 0) {
 			timer = devp->hd_timer;
 			break;
@@ -970,14 +907,10 @@ static acpi_status __init hpet_resources(struct acpi_resource *res, void *data)
 			hdp->hd_nirqs = irqp->number_of_interrupts;
 
 			for (i = 0; i < hdp->hd_nirqs; i++)
-#ifdef	CONFIG_IA64
 				hdp->hd_irq[i] =
 				    acpi_register_gsi(irqp->interrupts[i],
 						      irqp->edge_level,
 						      irqp->active_high_low);
-#else
-				hdp->hd_irq[i] = irqp->interrupts[i];
-#endif
 		}
 	}
 
@@ -1025,19 +958,12 @@ static struct miscdevice hpet_misc = { HPET_MINOR, "hpet", &hpet_fops };
 
 static int __init hpet_init(void)
 {
-	struct proc_dir_entry *entry;
-
 	(void)acpi_bus_register_driver(&hpet_acpi_driver);
 
 	if (hpets) {
 		if (misc_register(&hpet_misc))
 			return -ENODEV;
 
-		entry = create_proc_entry("driver/hpet", 0, 0);
-
-		if (entry)
-			entry->proc_fops = &hpet_proc_fops;
-
 		sysctl_header = register_sysctl_table(dev_root, 0);
 
 #ifdef	CONFIG_TIME_INTERPOLATION
@@ -1062,10 +988,8 @@ static void __exit hpet_exit(void)
 {
 	acpi_bus_unregister_driver(&hpet_acpi_driver);
 
-	if (hpets) {
+	if (hpets)
 		unregister_sysctl_table(sysctl_header);
-		remove_proc_entry("driver/hpet", NULL);
-	}
 
 	return;
 }
diff --git a/drivers/char/ip2main.c b/drivers/char/ip2main.c
index d5c18535b..ac97e617a 100644
--- a/drivers/char/ip2main.c
+++ b/drivers/char/ip2main.c
@@ -203,16 +203,16 @@ static void ip2_wait_until_sent(PTTY,int);
 
 static void set_params (i2ChanStrPtr, struct termios *);
 static int set_modem_info(i2ChanStrPtr, unsigned int, unsigned int *);
-static int get_serial_info(i2ChanStrPtr, struct serial_struct *);
-static int set_serial_info(i2ChanStrPtr, struct serial_struct *);
+static int get_serial_info(i2ChanStrPtr, struct serial_struct __user *);
+static int set_serial_info(i2ChanStrPtr, struct serial_struct __user *);
 
-static ssize_t ip2_ipl_read(struct file *, char *, size_t, loff_t *);
-static ssize_t ip2_ipl_write(struct file *, const char *, size_t, loff_t *);
+static ssize_t ip2_ipl_read(struct file *, char __user *, size_t, loff_t *);
+static ssize_t ip2_ipl_write(struct file *, const char __user *, size_t, loff_t *);
 static int ip2_ipl_ioctl(struct inode *, struct file *, UINT, ULONG);
 static int ip2_ipl_open(struct inode *, struct file *);
 
-static int DumpTraceBuffer(char *, int);
-static int DumpFifoBuffer( char *, int);
+static int DumpTraceBuffer(char __user *, int);
+static int DumpFifoBuffer( char __user *, int);
 
 static void ip2_init_board(int);
 static unsigned short find_eisa_board(int);
@@ -1121,7 +1121,7 @@ set_irq( int boardnum, int boardIrq )
 /******************************************************************************/
 
 static inline void
-service_all_boards()
+service_all_boards(void)
 {
 	int i;
 	i2eBordStrPtr  pB;
@@ -2082,9 +2082,10 @@ ip2_ioctl ( PTTY tty, struct file *pFile, UINT cmd, ULONG arg )
 	wait_queue_t wait;
 	i2ChanStrPtr pCh = DevTable[tty->index];
 	struct async_icount cprev, cnow;	/* kernel counter temps */
-	struct serial_icounter_struct *p_cuser;	/* user space */
+	struct serial_icounter_struct __user *p_cuser;
 	int rc = 0;
 	unsigned long flags;
+	void __user *argp = (void __user *)arg;
 
 	if ( pCh == NULL ) {
 		return -ENODEV;
@@ -2101,7 +2102,7 @@ ip2_ioctl ( PTTY tty, struct file *pFile, UINT cmd, ULONG arg )
 
 		ip2trace (CHANN, ITRC_IOCTL, 2, 1, rc );
 
-		rc = get_serial_info(pCh, (struct serial_struct *) arg);
+		rc = get_serial_info(pCh, argp);
 		if (rc)
 			return rc;
 		break;
@@ -2110,7 +2111,7 @@ ip2_ioctl ( PTTY tty, struct file *pFile, UINT cmd, ULONG arg )
 
 		ip2trace (CHANN, ITRC_IOCTL, 3, 1, rc );
 
-		rc = set_serial_info(pCh, (struct serial_struct *) arg);
+		rc = set_serial_info(pCh, argp);
 		if (rc)
 			return rc;
 		break;
@@ -2174,7 +2175,7 @@ ip2_ioctl ( PTTY tty, struct file *pFile, UINT cmd, ULONG arg )
 
 		ip2trace (CHANN, ITRC_IOCTL, 6, 1, rc );
 
-			rc = put_user(C_CLOCAL(tty) ? 1 : 0, (unsigned long *) arg);
+			rc = put_user(C_CLOCAL(tty) ? 1 : 0, (unsigned long __user *)argp);
 		if (rc)	
 			return rc;
 	break;
@@ -2183,7 +2184,7 @@ ip2_ioctl ( PTTY tty, struct file *pFile, UINT cmd, ULONG arg )
 
 		ip2trace (CHANN, ITRC_IOCTL, 7, 1, rc );
 
-		rc = get_user(arg,(unsigned long *) arg);
+		rc = get_user(arg,(unsigned long __user *) argp);
 		if (rc) 
 			return rc;
 		tty->termios->c_cflag = ((tty->termios->c_cflag & ~CLOCAL)
@@ -2262,7 +2263,7 @@ ip2_ioctl ( PTTY tty, struct file *pFile, UINT cmd, ULONG arg )
 		save_flags(flags);cli();
 		cnow = pCh->icount;
 		restore_flags(flags);
-		p_cuser = (struct serial_icounter_struct *) arg;
+		p_cuser = argp;
 		rc = put_user(cnow.cts, &p_cuser->cts);
 		rc = put_user(cnow.dsr, &p_cuser->dsr);
 		rc = put_user(cnow.rng, &p_cuser->rng);
@@ -2311,14 +2312,9 @@ ip2_ioctl ( PTTY tty, struct file *pFile, UINT cmd, ULONG arg )
 /* standard Linux serial structure.                                           */
 /******************************************************************************/
 static int
-get_serial_info ( i2ChanStrPtr pCh, struct serial_struct *retinfo )
+get_serial_info ( i2ChanStrPtr pCh, struct serial_struct __user *retinfo )
 {
 	struct serial_struct tmp;
-	int rc;
-
-	if ( !retinfo ) {
-		return -EFAULT;
-	}
 
 	memset ( &tmp, 0, sizeof(tmp) );
 	tmp.type = pCh->pMyBord->channelBtypes.bid_value[(pCh->port_index & (IP2_PORTS_PER_BOARD-1))/16];
@@ -2335,8 +2331,7 @@ get_serial_info ( i2ChanStrPtr pCh, struct serial_struct *retinfo )
 	tmp.close_delay = pCh->ClosingDelay;
 	tmp.closing_wait = pCh->ClosingWaitTime;
 	tmp.custom_divisor = pCh->BaudDivisor;
-   	rc = copy_to_user(retinfo,&tmp,sizeof(*retinfo));
-   return rc;
+   	return copy_to_user(retinfo,&tmp,sizeof(*retinfo));
 }
 
 /******************************************************************************/
@@ -2351,18 +2346,13 @@ get_serial_info ( i2ChanStrPtr pCh, struct serial_struct *retinfo )
 /* change the IRQ, address or type of the port the ioctl fails.               */
 /******************************************************************************/
 static int
-set_serial_info( i2ChanStrPtr pCh, struct serial_struct *new_info )
+set_serial_info( i2ChanStrPtr pCh, struct serial_struct __user *new_info )
 {
 	struct serial_struct ns;
 	int   old_flags, old_baud_divisor;
 
-	if ( !new_info ) {
+	if (copy_from_user(&ns, new_info, sizeof (ns)))
 		return -EFAULT;
-	}
-
-	if (copy_from_user(&ns, new_info, sizeof (ns))) {
-		return -EFAULT;
-	}
 
 	/*
 	 * We don't allow setserial to change IRQ, board address, type or baud
@@ -2727,7 +2717,7 @@ service_it:
 
 static 
 ssize_t
-ip2_ipl_read(struct file *pFile, char *pData, size_t count, loff_t *off )
+ip2_ipl_read(struct file *pFile, char __user *pData, size_t count, loff_t *off )
 {
 	unsigned int minor = iminor(pFile->f_dentry->d_inode);
 	int rc = 0;
@@ -2760,7 +2750,7 @@ ip2_ipl_read(struct file *pFile, char *pData, size_t count, loff_t *off )
 }
 
 static int
-DumpFifoBuffer ( char *pData, int count )
+DumpFifoBuffer ( char __user *pData, int count )
 {
 #ifdef DEBUG_FIFO
 	int rc;
@@ -2774,13 +2764,13 @@ DumpFifoBuffer ( char *pData, int count )
 }
 
 static int
-DumpTraceBuffer ( char *pData, int count )
+DumpTraceBuffer ( char __user *pData, int count )
 {
 #ifdef IP2DEBUG_TRACE
 	int rc;
 	int dumpcount;
 	int chunk;
-	int *pIndex = (int*)pData;
+	int *pIndex = (int __user *)pData;
 
 	if ( count < (sizeof(int) * 6) ) {
 		return -EIO;
@@ -2836,7 +2826,7 @@ DumpTraceBuffer ( char *pData, int count )
 /*                                                                            */
 /******************************************************************************/
 static ssize_t
-ip2_ipl_write(struct file *pFile, const char *pData, size_t count, loff_t *off)
+ip2_ipl_write(struct file *pFile, const char __user *pData, size_t count, loff_t *off)
 {
 #ifdef IP2DEBUG_IPL
 	printk (KERN_DEBUG "IP2IPL: write %p, %d bytes\n", pData, count );
@@ -2861,7 +2851,8 @@ ip2_ipl_ioctl ( struct inode *pInode, struct file *pFile, UINT cmd, ULONG arg )
 {
 	unsigned int iplminor = iminor(pInode);
 	int rc = 0;
-	ULONG *pIndex = (ULONG*)arg;
+	void __user *argp = (void __user *)arg;
+	ULONG __user *pIndex = argp;
 	i2eBordStrPtr pB = i2BoardPtrTable[iplminor / 4];
 	i2ChanStrPtr pCh;
 
@@ -2886,9 +2877,9 @@ ip2_ipl_ioctl ( struct inode *pInode, struct file *pFile, UINT cmd, ULONG arg )
 
 		case 65:	/* Board  - ip2stat */
 			if ( pB ) {
-				rc = copy_to_user((char*)arg, (char*)pB, sizeof(i2eBordStr) );
+				rc = copy_to_user(argp, pB, sizeof(i2eBordStr));
 				rc = put_user(INB(pB->i2eStatus),
-					(ULONG*)(arg + (ULONG)(&pB->i2eStatus) - (ULONG)pB ) );
+					(ULONG __user *)(arg + (ULONG)(&pB->i2eStatus) - (ULONG)pB ) );
 			} else {
 				rc = -ENODEV;
 			}
@@ -2899,7 +2890,7 @@ ip2_ipl_ioctl ( struct inode *pInode, struct file *pFile, UINT cmd, ULONG arg )
 				pCh = DevTable[cmd];
 				if ( pCh )
 				{
-					rc = copy_to_user((char*)arg, (char*)pCh, sizeof(i2ChanStr) );
+					rc = copy_to_user(argp, pCh, sizeof(i2ChanStr));
 				} else {
 					rc = -ENODEV;
 				}
diff --git a/drivers/char/ipmi/ipmi_bt_sm.c b/drivers/char/ipmi/ipmi_bt_sm.c
index 6fc7077d9..7295bc559 100644
--- a/drivers/char/ipmi/ipmi_bt_sm.c
+++ b/drivers/char/ipmi/ipmi_bt_sm.c
@@ -31,7 +31,7 @@
 #include <linux/ipmi_msgdefs.h>		/* for completion codes */
 #include "ipmi_si_sm.h"
 
-#define IPMI_BT_VERSION "v31"
+#define IPMI_BT_VERSION "v32"
 
 static int bt_debug = 0x00;	/* Production value 0, see following flags */
 
diff --git a/drivers/char/ipmi/ipmi_devintf.c b/drivers/char/ipmi/ipmi_devintf.c
index afd1de325..8d1a08bcc 100644
--- a/drivers/char/ipmi/ipmi_devintf.c
+++ b/drivers/char/ipmi/ipmi_devintf.c
@@ -45,7 +45,7 @@
 #include <asm/semaphore.h>
 #include <linux/init.h>
 
-#define IPMI_DEVINTF_VERSION "v31"
+#define IPMI_DEVINTF_VERSION "v32"
 
 struct ipmi_file_private
 {
@@ -174,7 +174,7 @@ static int handle_send_req(ipmi_user_t     user,
 {
 	int              rv;
 	struct ipmi_addr addr;
-	unsigned char    *msgdata;
+	struct kernel_ipmi_msg msg;
 
 	if (req->addr_len > sizeof(struct ipmi_addr))
 		return -EINVAL;
@@ -182,8 +182,11 @@ static int handle_send_req(ipmi_user_t     user,
 	if (copy_from_user(&addr, req->addr, req->addr_len))
 		return -EFAULT;
 
-	msgdata = kmalloc(IPMI_MAX_MSG_LENGTH, GFP_KERNEL);
-	if (!msgdata)
+	msg.netfn = req->msg.netfn;
+	msg.cmd = req->msg.cmd;
+	msg.data_len = req->msg.data_len;
+	msg.data = kmalloc(IPMI_MAX_MSG_LENGTH, GFP_KERNEL);
+	if (!msg.data)
 		return -ENOMEM;
 
 	/* From here out we cannot return, we must jump to "out" for
@@ -199,7 +202,7 @@ static int handle_send_req(ipmi_user_t     user,
 			goto out;
 		}
 
-		if (copy_from_user(&msgdata,
+		if (copy_from_user(msg.data,
 				   req->msg.data,
 				   req->msg.data_len))
 		{
@@ -207,20 +210,19 @@ static int handle_send_req(ipmi_user_t     user,
 			goto out;
 		}
 	} else {
-		req->msg.data_len = 0;
+		msg.data_len = 0;
 	}
-	req->msg.data = msgdata;
 
 	rv = ipmi_request_settime(user,
 				  &addr,
 				  req->msgid,
-				  &(req->msg),
+				  &msg,
 				  NULL,
 				  0,
 				  retries,
 				  retry_time_ms);
  out:
-	kfree(msgdata);
+	kfree(msg.data);
 	return rv;
 }
 
@@ -231,6 +233,7 @@ static int ipmi_ioctl(struct inode  *inode,
 {
 	int                      rv = -EINVAL;
 	struct ipmi_file_private *priv = file->private_data;
+	void __user *arg = (void __user *)data;
 
 	switch (cmd) 
 	{
@@ -238,7 +241,7 @@ static int ipmi_ioctl(struct inode  *inode,
 	{
 		struct ipmi_req req;
 
-		if (copy_from_user(&req, (void *) data, sizeof(req))) {
+		if (copy_from_user(&req, arg, sizeof(req))) {
 			rv = -EFAULT;
 			break;
 		}
@@ -254,7 +257,7 @@ static int ipmi_ioctl(struct inode  *inode,
 	{
 		struct ipmi_req_settime req;
 
-		if (copy_from_user(&req, (void *) data, sizeof(req))) {
+		if (copy_from_user(&req, arg, sizeof(req))) {
 			rv = -EFAULT;
 			break;
 		}
@@ -277,7 +280,7 @@ static int ipmi_ioctl(struct inode  *inode,
 		
 
 		rv = 0;
-		if (copy_from_user(&rsp, (void *) data, sizeof(rsp))) {
+		if (copy_from_user(&rsp, arg, sizeof(rsp))) {
 			rv = -EFAULT;
 			break;
 		}
@@ -344,7 +347,7 @@ static int ipmi_ioctl(struct inode  *inode,
 			rsp.msg.data_len = 0;
 		}
 
-		if (copy_to_user((void *) data, &rsp, sizeof(rsp))) {
+		if (copy_to_user(arg, &rsp, sizeof(rsp))) {
 			rv = -EFAULT;
 			goto recv_putback_on_err;
 		}
@@ -371,7 +374,7 @@ static int ipmi_ioctl(struct inode  *inode,
 	{
 		struct ipmi_cmdspec val;
 
-		if (copy_from_user(&val, (void *) data, sizeof(val))) {
+		if (copy_from_user(&val, arg, sizeof(val))) {
 			rv = -EFAULT;
 			break;
 		}
@@ -384,7 +387,7 @@ static int ipmi_ioctl(struct inode  *inode,
 	{
 		struct ipmi_cmdspec   val;
 
-		if (copy_from_user(&val, (void *) data, sizeof(val))) {
+		if (copy_from_user(&val, arg, sizeof(val))) {
 			rv = -EFAULT;
 			break;
 		}
@@ -397,7 +400,7 @@ static int ipmi_ioctl(struct inode  *inode,
 	{
 		int val;
 
-		if (copy_from_user(&val, (void *) data, sizeof(val))) {
+		if (copy_from_user(&val, arg, sizeof(val))) {
 			rv = -EFAULT;
 			break;
 		}
@@ -410,7 +413,7 @@ static int ipmi_ioctl(struct inode  *inode,
 	{
 		unsigned int val;
 
-		if (copy_from_user(&val, (void *) data, sizeof(val))) {
+		if (copy_from_user(&val, arg, sizeof(val))) {
 			rv = -EFAULT;
 			break;
 		}
@@ -426,7 +429,7 @@ static int ipmi_ioctl(struct inode  *inode,
 
 		val = ipmi_get_my_address(priv->user);
 
-		if (copy_to_user((void *) data, &val, sizeof(val))) {
+		if (copy_to_user(arg, &val, sizeof(val))) {
 			rv = -EFAULT;
 			break;
 		}
@@ -438,7 +441,7 @@ static int ipmi_ioctl(struct inode  *inode,
 	{
 		unsigned int val;
 
-		if (copy_from_user(&val, (void *) data, sizeof(val))) {
+		if (copy_from_user(&val, arg, sizeof(val))) {
 			rv = -EFAULT;
 			break;
 		}
@@ -454,7 +457,7 @@ static int ipmi_ioctl(struct inode  *inode,
 
 		val = ipmi_get_my_LUN(priv->user);
 
-		if (copy_to_user((void *) data, &val, sizeof(val))) {
+		if (copy_to_user(arg, &val, sizeof(val))) {
 			rv = -EFAULT;
 			break;
 		}
@@ -465,7 +468,7 @@ static int ipmi_ioctl(struct inode  *inode,
 	{
 		struct ipmi_timing_parms parms;
 
-		if (copy_from_user(&parms, (void *) data, sizeof(parms))) {
+		if (copy_from_user(&parms, arg, sizeof(parms))) {
 			rv = -EFAULT;
 			break;
 		}
@@ -483,7 +486,7 @@ static int ipmi_ioctl(struct inode  *inode,
 		parms.retries = priv->default_retries;
 		parms.retry_time_ms = priv->default_retry_time_ms;
 
-		if (copy_to_user((void *) data, &parms, sizeof(parms))) {
+		if (copy_to_user(arg, &parms, sizeof(parms))) {
 			rv = -EFAULT;
 			break;
 		}
diff --git a/drivers/char/ipmi/ipmi_kcs_sm.c b/drivers/char/ipmi/ipmi_kcs_sm.c
index f4dd321e9..d155f9a58 100644
--- a/drivers/char/ipmi/ipmi_kcs_sm.c
+++ b/drivers/char/ipmi/ipmi_kcs_sm.c
@@ -42,7 +42,7 @@
 #include <linux/ipmi_msgdefs.h>		/* for completion codes */
 #include "ipmi_si_sm.h"
 
-#define IPMI_KCS_VERSION "v31"
+#define IPMI_KCS_VERSION "v32"
 
 /* Set this if you want a printout of why the state machine was hosed
    when it gets hosed. */
diff --git a/drivers/char/ipmi/ipmi_msghandler.c b/drivers/char/ipmi/ipmi_msghandler.c
index aa0fe2dbf..83ae6f530 100644
--- a/drivers/char/ipmi/ipmi_msghandler.c
+++ b/drivers/char/ipmi/ipmi_msghandler.c
@@ -46,7 +46,7 @@
 #include <linux/init.h>
 #include <linux/proc_fs.h>
 
-#define IPMI_MSGHANDLER_VERSION "v31"
+#define IPMI_MSGHANDLER_VERSION "v32"
 
 struct ipmi_recv_msg *ipmi_alloc_recv_msg(void);
 static int ipmi_init_msghandler(void);
@@ -907,7 +907,7 @@ ipmb_checksum(unsigned char *data, int size)
 }
 
 static inline void format_ipmb_msg(struct ipmi_smi_msg   *smi_msg,
-				   struct ipmi_msg       *msg,
+				   struct kernel_ipmi_msg *msg,
 				   struct ipmi_ipmb_addr *ipmb_addr,
 				   long                  msgid,
 				   unsigned char         ipmb_seq,
@@ -949,7 +949,7 @@ static inline void format_ipmb_msg(struct ipmi_smi_msg   *smi_msg,
 }
 
 static inline void format_lan_msg(struct ipmi_smi_msg   *smi_msg,
-				  struct ipmi_msg       *msg,
+				  struct kernel_ipmi_msg *msg,
 				  struct ipmi_lan_addr  *lan_addr,
 				  long                  msgid,
 				  unsigned char         ipmb_seq,
@@ -993,7 +993,7 @@ static inline int i_ipmi_request(ipmi_user_t          user,
 				 ipmi_smi_t           intf,
 				 struct ipmi_addr     *addr,
 				 long                 msgid,
-				 struct ipmi_msg      *msg,
+				 struct kernel_ipmi_msg *msg,
 				 void                 *user_msg_data,
 				 void                 *supplied_smi,
 				 struct ipmi_recv_msg *supplied_recv,
@@ -1335,7 +1335,7 @@ static inline int i_ipmi_request(ipmi_user_t          user,
 		goto out_err;
 	}
 
-#if DEBUG_MSGING
+#ifdef DEBUG_MSGING
 	{
 		int m;
 		for (m=0; m<smi_msg->data_size; m++)
@@ -1356,7 +1356,7 @@ static inline int i_ipmi_request(ipmi_user_t          user,
 int ipmi_request(ipmi_user_t      user,
 		 struct ipmi_addr *addr,
 		 long             msgid,
-		 struct ipmi_msg  *msg,
+		 struct kernel_ipmi_msg  *msg,
 		 void             *user_msg_data,
 		 int              priority)
 {
@@ -1376,7 +1376,7 @@ int ipmi_request(ipmi_user_t      user,
 int ipmi_request_settime(ipmi_user_t      user,
 			 struct ipmi_addr *addr,
 			 long             msgid,
-			 struct ipmi_msg  *msg,
+			 struct kernel_ipmi_msg  *msg,
 			 void             *user_msg_data,
 			 int              priority,
 			 int              retries,
@@ -1399,7 +1399,7 @@ int ipmi_request_settime(ipmi_user_t      user,
 int ipmi_request_supply_msgs(ipmi_user_t          user,
 			     struct ipmi_addr     *addr,
 			     long                 msgid,
-			     struct ipmi_msg      *msg,
+			     struct kernel_ipmi_msg *msg,
 			     void                 *user_msg_data,
 			     void                 *supplied_smi,
 			     struct ipmi_recv_msg *supplied_recv,
@@ -1422,7 +1422,7 @@ int ipmi_request_supply_msgs(ipmi_user_t          user,
 int ipmi_request_with_source(ipmi_user_t      user,
 			     struct ipmi_addr *addr,
 			     long             msgid,
-			     struct ipmi_msg  *msg,
+			     struct kernel_ipmi_msg  *msg,
 			     void             *user_msg_data,
 			     int              priority,
 			     unsigned char    source_address,
@@ -1609,7 +1609,7 @@ static void remove_proc_entries(ipmi_smi_t smi)
 static int
 send_channel_info_cmd(ipmi_smi_t intf, int chan)
 {
-	struct ipmi_msg                   msg;
+	struct kernel_ipmi_msg            msg;
 	unsigned char                     data[1];
 	struct ipmi_system_interface_addr si;
 
@@ -1648,6 +1648,22 @@ channel_handler(ipmi_smi_t intf, struct ipmi_smi_msg *msg)
 		/* It's the one we want */
 		if (msg->rsp[2] != 0) {
 			/* Got an error from the channel, just go on. */
+
+			if (msg->rsp[2] == IPMI_INVALID_COMMAND_ERR) {
+				/* If the MC does not support this
+				   command, that is legal.  We just
+				   assume it has one IPMB at channel
+				   zero. */
+				intf->channels[0].medium
+					= IPMI_CHANNEL_MEDIUM_IPMB;
+				intf->channels[0].protocol
+					= IPMI_CHANNEL_PROTOCOL_IPMB;
+				rv = -ENOSYS;
+
+				intf->curr_channel = IPMI_MAX_CHANNELS;
+				wake_up(&intf->waitq);
+				goto out;
+			}
 			goto next_channel;
 		}
 		if (msg->rsp_size < 6) {
@@ -1671,10 +1687,20 @@ channel_handler(ipmi_smi_t intf, struct ipmi_smi_msg *msg)
 			wake_up(&intf->waitq);
 
 			printk(KERN_WARNING "ipmi_msghandler: Error sending"
-			       "channel information: 0x%x\n",
+			       "channel information: %d\n",
 			       rv);
 		}
 	}
+ out:
+	return;
+}
+
+void ipmi_poll_interface(ipmi_user_t user)
+{
+	ipmi_smi_t intf = user->intf;
+
+	if (intf->handlers->poll)
+		intf->handlers->poll(intf->send_info);
 }
 
 int ipmi_register_smi(struct ipmi_smi_handlers *handlers,
@@ -2007,7 +2033,7 @@ static int handle_ipmb_get_msg_cmd(ipmi_smi_t          intf,
 		msg->data[10] = ipmb_checksum(&(msg->data[6]), 4);
 		msg->data_size = 11;
 
-#if DEBUG_MSGING
+#ifdef DEBUG_MSGING
 	{
 		int m;
 		printk("Invalid command:");
@@ -2398,7 +2424,7 @@ static int handle_new_recv_msg(ipmi_smi_t          intf,
 	int requeue;
 	int chan;
 
-#if DEBUG_MSGING
+#ifdef DEBUG_MSGING
 	int m;
 	printk("Recv:");
 	for (m=0; m<msg->rsp_size; m++)
@@ -2613,7 +2639,7 @@ send_from_recv_msg(ipmi_smi_t intf, struct ipmi_recv_msg *recv_msg,
 	   MC, which don't get resent. */
 	intf->handlers->sender(intf->send_info, smi_msg, 0);
 
-#if DEBUG_MSGING
+#ifdef DEBUG_MSGING
 	{
 		int m;
 		printk("Resend: ");
@@ -2847,7 +2873,7 @@ static void device_id_fetcher(ipmi_smi_t intf, struct ipmi_smi_msg *msg)
 
 static void send_panic_events(char *str)
 {
-	struct ipmi_msg                   msg;
+	struct kernel_ipmi_msg            msg;
 	ipmi_smi_t                        intf;
 	unsigned char                     data[16];
 	int                               i;
@@ -3072,7 +3098,7 @@ static struct notifier_block panic_block = {
 	200   /* priority: INT_MAX >= x >= 0 */
 };
 
-static __init int ipmi_init_msghandler(void)
+static int ipmi_init_msghandler(void)
 {
 	int i;
 
@@ -3086,7 +3112,7 @@ static __init int ipmi_init_msghandler(void)
 		ipmi_interfaces[i] = NULL;
 	}
 
-	proc_ipmi_root = proc_mkdir("ipmi", 0);
+	proc_ipmi_root = proc_mkdir("ipmi", NULL);
 	if (!proc_ipmi_root) {
 	    printk("Unable to create IPMI proc dir");
 	    return -ENOMEM;
@@ -3107,6 +3133,12 @@ static __init int ipmi_init_msghandler(void)
 	return 0;
 }
 
+static __init int ipmi_init_msghandler_mod(void)
+{
+	ipmi_init_msghandler();
+	return 0;
+}
+
 static __exit void cleanup_ipmi(void)
 {
 	int count;
@@ -3143,7 +3175,7 @@ static __exit void cleanup_ipmi(void)
 }
 module_exit(cleanup_ipmi);
 
-module_init(ipmi_init_msghandler);
+module_init(ipmi_init_msghandler_mod);
 MODULE_LICENSE("GPL");
 
 EXPORT_SYMBOL(ipmi_alloc_recv_msg);
@@ -3154,6 +3186,7 @@ EXPORT_SYMBOL(ipmi_request);
 EXPORT_SYMBOL(ipmi_request_settime);
 EXPORT_SYMBOL(ipmi_request_supply_msgs);
 EXPORT_SYMBOL(ipmi_request_with_source);
+EXPORT_SYMBOL(ipmi_poll_interface);
 EXPORT_SYMBOL(ipmi_register_smi);
 EXPORT_SYMBOL(ipmi_unregister_smi);
 EXPORT_SYMBOL(ipmi_register_for_cmd);
diff --git a/drivers/char/ipmi/ipmi_si_intf.c b/drivers/char/ipmi/ipmi_si_intf.c
index 8a1fd40d5..ea330f3ff 100644
--- a/drivers/char/ipmi/ipmi_si_intf.c
+++ b/drivers/char/ipmi/ipmi_si_intf.c
@@ -51,7 +51,7 @@
 #include <linux/list.h>
 #include <linux/pci.h>
 #include <linux/ioport.h>
-#include <linux/irq.h>
+#include <asm/irq.h>
 #ifdef CONFIG_HIGH_RES_TIMERS
 #include <linux/hrtime.h>
 # if defined(schedule_next_int)
@@ -76,7 +76,7 @@ static inline void add_usec_to_timer(struct timer_list *t, long v)
 #include "ipmi_si_sm.h"
 #include <linux/init.h>
 
-#define IPMI_SI_VERSION "v31"
+#define IPMI_SI_VERSION "v32"
 
 /* Measure times between events in the driver. */
 #undef DEBUG_TIMING
@@ -712,6 +712,13 @@ static void set_run_to_completion(void *send_info, int i_run_to_completion)
 	spin_unlock_irqrestore(&(smi_info->si_lock), flags);
 }
 
+static void poll(void *send_info)
+{
+	struct smi_info *smi_info = send_info;
+
+	smi_event_handler(smi_info, 0);
+}
+
 static void request_events(void *send_info)
 {
 	struct smi_info *smi_info = send_info;
@@ -851,7 +858,8 @@ static struct ipmi_smi_handlers handlers =
 	.owner                  = THIS_MODULE,
 	.sender			= sender,
 	.request_events		= request_events,
-	.set_run_to_completion  = set_run_to_completion
+	.set_run_to_completion  = set_run_to_completion,
+	.poll			= poll,
 };
 
 /* There can be 4 IO ports passed in (with or without IRQs), 4 addresses,
@@ -1772,7 +1780,7 @@ static int init_one_smi(int intf_num, struct smi_info **smi)
 	/* So we know not to free it unless we have allocated one. */
 	new_smi->intf = NULL;
 	new_smi->si_sm = NULL;
-	new_smi->handlers = 0;
+	new_smi->handlers = NULL;
 
 	if (!new_smi->irq_setup) {
 		new_smi->irq = irqs[intf_num];
@@ -1848,6 +1856,21 @@ static int init_one_smi(int intf_num, struct smi_info **smi)
 	atomic_set(&new_smi->req_events, 0);
 	new_smi->run_to_completion = 0;
 
+	new_smi->interrupt_disabled = 0;
+	new_smi->timer_stopped = 0;
+	new_smi->stop_operation = 0;
+
+	/* The ipmi_register_smi() code does some operations to
+	   determine the channel information, so we must be ready to
+	   handle operations before it is called.  This means we have
+	   to stop the timer if we get an error after this point. */
+	init_timer(&(new_smi->si_timer));
+	new_smi->si_timer.data = (long) new_smi;
+	new_smi->si_timer.function = smi_timeout;
+	new_smi->last_timeout_jiffies = jiffies;
+	new_smi->si_timer.expires = jiffies + SI_TIMEOUT_JIFFIES;
+	add_timer(&(new_smi->si_timer));
+
 	rv = ipmi_register_smi(&handlers,
 			       new_smi,
 			       new_smi->ipmi_version_major,
@@ -1857,7 +1880,7 @@ static int init_one_smi(int intf_num, struct smi_info **smi)
 		printk(KERN_ERR
 		       "ipmi_si: Unable to register device: error %d\n",
 		       rv);
-		goto out_err;
+		goto out_err_stop_timer;
 	}
 
 	rv = ipmi_smi_add_proc_entry(new_smi->intf, "type",
@@ -1867,7 +1890,7 @@ static int init_one_smi(int intf_num, struct smi_info **smi)
 		printk(KERN_ERR
 		       "ipmi_si: Unable to create proc entry: %d\n",
 		       rv);
-		goto out_err;
+		goto out_err_stop_timer;
 	}
 
 	rv = ipmi_smi_add_proc_entry(new_smi->intf, "si_stats",
@@ -1877,7 +1900,7 @@ static int init_one_smi(int intf_num, struct smi_info **smi)
 		printk(KERN_ERR
 		       "ipmi_si: Unable to create proc entry: %d\n",
 		       rv);
-		goto out_err;
+		goto out_err_stop_timer;
 	}
 
 	start_clear_flags(new_smi);
@@ -1886,34 +1909,40 @@ static int init_one_smi(int intf_num, struct smi_info **smi)
 	if (new_smi->irq)
 		new_smi->si_state = SI_CLEARING_FLAGS_THEN_SET_IRQ;
 
-	new_smi->interrupt_disabled = 0;
-	new_smi->timer_stopped = 0;
-	new_smi->stop_operation = 0;
-
-	init_timer(&(new_smi->si_timer));
-	new_smi->si_timer.data = (long) new_smi;
-	new_smi->si_timer.function = smi_timeout;
-	new_smi->last_timeout_jiffies = jiffies;
-	new_smi->si_timer.expires = jiffies + SI_TIMEOUT_JIFFIES;
-	add_timer(&(new_smi->si_timer));
-
 	*smi = new_smi;
 
 	printk(" IPMI %s interface initialized\n", si_type[intf_num]);
 
 	return 0;
 
+ out_err_stop_timer:
+	new_smi->stop_operation = 1;
+
+	/* Wait for the timer to stop.  This avoids problems with race
+	   conditions removing the timer here. */
+	while (!new_smi->timer_stopped) {
+		set_current_state(TASK_UNINTERRUPTIBLE);
+		schedule_timeout(1);
+	}
+
  out_err:
 	if (new_smi->intf)
 		ipmi_unregister_smi(new_smi->intf);
 
 	new_smi->irq_cleanup(new_smi);
+
+	/* Wait until we know that we are out of any interrupt
+	   handlers might have been running before we freed the
+	   interrupt. */
+	synchronize_kernel();
+
 	if (new_smi->si_sm) {
 		if (new_smi->handlers)
 			new_smi->handlers->cleanup(new_smi->si_sm);
 		kfree(new_smi->si_sm);
 	}
 	new_smi->io_cleanup(new_smi);
+
 	return rv;
 }
 
diff --git a/drivers/char/ipmi/ipmi_smic_sm.c b/drivers/char/ipmi/ipmi_smic_sm.c
index 7bd7041e3..b5c08d6e0 100644
--- a/drivers/char/ipmi/ipmi_smic_sm.c
+++ b/drivers/char/ipmi/ipmi_smic_sm.c
@@ -46,7 +46,7 @@
 #include <linux/ipmi_msgdefs.h>		/* for completion codes */
 #include "ipmi_si_sm.h"
 
-#define IPMI_SMIC_VERSION "v31"
+#define IPMI_SMIC_VERSION "v32"
 
 /* smic_debug is a bit-field
  *	SMIC_DEBUG_ENABLE -	turned on for now
diff --git a/drivers/char/ipmi/ipmi_watchdog.c b/drivers/char/ipmi/ipmi_watchdog.c
index 50aa9590b..fb8492490 100644
--- a/drivers/char/ipmi/ipmi_watchdog.c
+++ b/drivers/char/ipmi/ipmi_watchdog.c
@@ -51,7 +51,7 @@
 #include <asm/apic.h>
 #endif
 
-#define IPMI_WATCHDOG_VERSION "v31"
+#define IPMI_WATCHDOG_VERSION "v32"
 
 /*
  * The IPMI command/response information for the watchdog timer.
@@ -129,6 +129,12 @@
 #define	WDIOC_GET_PRETIMEOUT     _IOW(WATCHDOG_IOCTL_BASE, 22, int)
 #endif
 
+#ifdef CONFIG_WATCHDOG_NOWAYOUT
+static int nowayout = 1;
+#else
+static int nowayout;
+#endif
+
 static ipmi_user_t watchdog_user = NULL;
 
 /* Default the timeout to 10 seconds. */
@@ -175,6 +181,8 @@ MODULE_PARM_DESC(preop, "Pretimeout driver operation.  One of: "
 module_param(start_now, int, 0);
 MODULE_PARM_DESC(start_now, "Set to 1 to start the watchdog as"
 		 "soon as the driver is loaded.");
+module_param(nowayout, int, 0);
+MODULE_PARM_DESC(nowayout, "Watchdog cannot be stopped once started (default=CONFIG_WATCHDOG_NOWAYOUT)");
 
 /* Default state of the timer. */
 static unsigned char ipmi_watchdog_state = WDOG_TIMEOUT_NONE;
@@ -229,7 +237,7 @@ static int i_ipmi_set_timeout(struct ipmi_smi_msg  *smi_msg,
 			      struct ipmi_recv_msg *recv_msg,
 			      int                  *send_heartbeat_now)
 {
-	struct ipmi_msg                   msg;
+	struct kernel_ipmi_msg            msg;
 	unsigned char                     data[6];
 	int                               rv;
 	struct ipmi_system_interface_addr addr;
@@ -406,7 +414,7 @@ static struct ipmi_recv_msg panic_halt_heartbeat_recv_msg =
  
 static int ipmi_heartbeat(void)
 {
-	struct ipmi_msg                   msg;
+	struct kernel_ipmi_msg            msg;
 	int                               rv;
 	struct ipmi_system_interface_addr addr;
 
@@ -478,7 +486,7 @@ static int ipmi_heartbeat(void)
 
 static void panic_halt_ipmi_heartbeat(void)
 {
-	struct ipmi_msg                   msg;
+	struct kernel_ipmi_msg             msg;
 	struct ipmi_system_interface_addr addr;
 
 
@@ -515,40 +523,37 @@ static struct watchdog_info ident=
 static int ipmi_ioctl(struct inode *inode, struct file *file,
 		      unsigned int cmd, unsigned long arg)
 {
+	void __user *argp = (void __user *)arg;
 	int i;
 	int val;
 
 	switch(cmd) {
 	case WDIOC_GETSUPPORT:
-		i = copy_to_user((void*)arg, &ident, sizeof(ident));
+		i = copy_to_user(argp, &ident, sizeof(ident));
 		return i ? -EFAULT : 0;
 
 	case WDIOC_SETTIMEOUT:
-		i = copy_from_user(&val, (void *) arg, sizeof(int));
+		i = copy_from_user(&val, argp, sizeof(int));
 		if (i)
 			return -EFAULT;
 		timeout = val;
 		return ipmi_set_timeout(IPMI_SET_TIMEOUT_HB_IF_NECESSARY);
 
 	case WDIOC_GETTIMEOUT:
-		i = copy_to_user((void *) arg,
-				 &timeout,
-				 sizeof(timeout));
+		i = copy_to_user(argp, &timeout, sizeof(timeout));
 		if (i)
 			return -EFAULT;
 		return 0;
 
 	case WDIOC_SET_PRETIMEOUT:
-		i = copy_from_user(&val, (void *) arg, sizeof(int));
+		i = copy_from_user(&val, argp, sizeof(int));
 		if (i)
 			return -EFAULT;
 		pretimeout = val;
 		return ipmi_set_timeout(IPMI_SET_TIMEOUT_HB_IF_NECESSARY);
 
 	case WDIOC_GET_PRETIMEOUT:
-		i = copy_to_user((void *) arg,
-				 &pretimeout,
-				 sizeof(pretimeout));
+		i = copy_to_user(argp, &pretimeout, sizeof(pretimeout));
 		if (i)
 			return -EFAULT;
 		return 0;
@@ -557,7 +562,7 @@ static int ipmi_ioctl(struct inode *inode, struct file *file,
 		return ipmi_heartbeat();
 
 	case WDIOC_SETOPTIONS:
-		i = copy_from_user(&val, (void *) arg, sizeof(int));
+		i = copy_from_user(&val, argp, sizeof(int));
 		if (i)
 			return -EFAULT;
 		if (val & WDIOS_DISABLECARD)
@@ -576,7 +581,7 @@ static int ipmi_ioctl(struct inode *inode, struct file *file,
 
 	case WDIOC_GETSTATUS:
 		val = 0;
-		i = copy_to_user((void *) arg, &val, sizeof(val));
+		i = copy_to_user(argp, &val, sizeof(val));
 		if (i)
 			return -EFAULT;
 		return 0;
@@ -587,16 +592,12 @@ static int ipmi_ioctl(struct inode *inode, struct file *file,
 }
 
 static ssize_t ipmi_write(struct file *file,
-			  const char  *buf,
+			  const char  __user *buf,
 			  size_t      len,
 			  loff_t      *ppos)
 {
 	int rv;
 
-	/*  Can't seek (pwrite) on this device  */
-	if (ppos != &file->f_pos)
-		return -ESPIPE;
-
 	if (len) {
 		rv = ipmi_heartbeat();
 		if (rv)
@@ -607,17 +608,13 @@ static ssize_t ipmi_write(struct file *file,
 }
 
 static ssize_t ipmi_read(struct file *file,
-			 char        *buf,
+			 char        __user *buf,
 			 size_t      count,
 			 loff_t      *ppos)
 {
 	int          rv = 0;
 	wait_queue_t wait;
 
-	/*  Can't seek (pread) on this device  */
-	if (ppos != &file->f_pos)
-		return -ESPIPE;
-
 	if (count <= 0)
 		return 0;
 
@@ -673,7 +670,7 @@ static int ipmi_open(struct inode *ino, struct file *filep)
 		    /* Don't start the timer now, let it start on the
 		       first heartbeat. */
 		    ipmi_start_timer_on_heartbeat = 1;
-                    return(0);
+                    return nonseekable_open(ino, filep);
 
                 default:
                     return (-ENODEV);
@@ -707,10 +704,10 @@ static int ipmi_close(struct inode *ino, struct file *filep)
 {
 	if (iminor(ino)==WATCHDOG_MINOR)
 	{
-#ifndef CONFIG_WATCHDOG_NOWAYOUT	
-		ipmi_watchdog_state = WDOG_TIMEOUT_NONE;
-		ipmi_set_timeout(IPMI_SET_TIMEOUT_NO_HB);
-#endif		
+		if (!nowayout) {
+			ipmi_watchdog_state = WDOG_TIMEOUT_NONE;
+			ipmi_set_timeout(IPMI_SET_TIMEOUT_NO_HB);
+		}
 	        ipmi_wdog_open = 0;
 	}
 
@@ -883,14 +880,12 @@ static int wdog_panic_handler(struct notifier_block *this,
 
 	/* On a panic, if we have a panic timeout, make sure that the thing
 	   reboots, even if it hangs during that panic. */
-	if (watchdog_user && !panic_event_handled && (panic_timeout > 0)) {
+	if (watchdog_user && !panic_event_handled) {
 		/* Make sure the panic doesn't hang, and make sure we
 		   do this only once. */
 		panic_event_handled = 1;
 	    
-		timeout = panic_timeout + 120;
-		if (timeout > 255)
-			timeout = 255;
+		timeout = 255;
 		pretimeout = 0;
 		ipmi_watchdog_state = WDOG_TIMEOUT_RESET;
 		panic_halt_ipmi_set_timeout();
diff --git a/drivers/char/isicom.c b/drivers/char/isicom.c
index c609ebb96..e8650449f 100644
--- a/drivers/char/isicom.c
+++ b/drivers/char/isicom.c
@@ -90,7 +90,7 @@ static int ISILoad_ioctl(struct inode *inode, struct file *filp, unsigned  int c
 static void isicom_tx(unsigned long _data);
 static void isicom_start(struct tty_struct * tty);
 
-static unsigned char * tmp_buf = 0;
+static unsigned char * tmp_buf;
 static DECLARE_MUTEX(tmp_buf_sem);
 
 /*   baud index mappings from linux defns to isi */
@@ -132,9 +132,10 @@ static int ISILoad_ioctl(struct inode *inode, struct file *filp,
 	unsigned long t;
 	unsigned short word_count, base;
 	bin_frame frame;
+	void __user *argp = (void __user *)arg;
 	/* exec_record exec_rec; */
 	
-	if(get_user(card, (int *)arg))
+	if(get_user(card, (int __user *)argp))
 		return -EFAULT;
 		
 	if(card < 0 || card >= BOARD_COUNT)
@@ -208,13 +209,13 @@ static int ISILoad_ioctl(struct inode *inode, struct file *filp,
 				 return -EIO;
 			}
 			printk("-Done\n");
-			return put_user(signature,(unsigned int*)arg);
+			return put_user(signature,(unsigned __user *)argp);
 						
 	case	MIOCTL_LOAD_FIRMWARE:
 			if (!capable(CAP_SYS_ADMIN))
 				return -EPERM;
 				
-			if(copy_from_user(&frame, (void *) arg, sizeof(bin_frame)))
+			if(copy_from_user(&frame, argp, sizeof(bin_frame)))
 				return -EFAULT;
 			
 			if (WaitTillCardIsFree(base))
@@ -257,7 +258,7 @@ static int ISILoad_ioctl(struct inode *inode, struct file *filp,
 			if (!capable(CAP_SYS_ADMIN))
 				return -EPERM;
 				
-			if(copy_from_user(&frame, (void *) arg, sizeof(bin_header)))
+			if(copy_from_user(&frame, argp, sizeof(bin_header)))
 				return -EFAULT;
 			
 			if (WaitTillCardIsFree(base))
@@ -296,7 +297,7 @@ static int ISILoad_ioctl(struct inode *inode, struct file *filp,
 				return -EIO;
 			}	
 			
-			if(copy_to_user((void *) arg, &frame, sizeof(bin_frame)))
+			if(copy_to_user(argp, &frame, sizeof(bin_frame)))
 				return -EFAULT;
 			return 0;
 	
@@ -1121,7 +1122,7 @@ static void isicom_close(struct tty_struct * tty, struct file * filp)
 	if (tty->ldisc.flush_buffer)
 		tty->ldisc.flush_buffer(tty);
 	tty->closing = 0;
-	port->tty = 0;
+	port->tty = NULL;
 	if (port->blocked_open) {
 		if (port->close_delay) {
 			set_current_state(TASK_INTERRUPTIBLE);
@@ -1334,7 +1335,7 @@ static int isicom_tiocmset(struct tty_struct *tty, struct file *file,
 }			
 
 static int isicom_set_serial_info(struct isi_port * port,
-					struct serial_struct * info)
+					struct serial_struct __user *info)
 {
 	struct serial_struct newinfo;
 	unsigned long flags;
@@ -1370,7 +1371,7 @@ static int isicom_set_serial_info(struct isi_port * port,
 }		
 
 static int isicom_get_serial_info(struct isi_port * port, 
-					struct serial_struct * info)
+					struct serial_struct __user *info)
 {
 	struct serial_struct out_info;
 	
@@ -1392,6 +1393,7 @@ static int isicom_ioctl(struct tty_struct * tty, struct file * filp,
 			unsigned int cmd, unsigned long arg) 
 {
 	struct isi_port * port = (struct isi_port *) tty->driver_data;
+	void __user *argp = (void __user *)arg;
 	int retval;
 
 	if (isicom_paranoia_check(port, tty->name, "isicom_ioctl"))
@@ -1416,10 +1418,10 @@ static int isicom_ioctl(struct tty_struct * tty, struct file * filp,
 			return 0;
 			
 		case TIOCGSOFTCAR:
-			return put_user(C_CLOCAL(tty) ? 1 : 0, (unsigned long *) arg);
+			return put_user(C_CLOCAL(tty) ? 1 : 0, (unsigned long __user *)argp);
 			
 		case TIOCSSOFTCAR:
-			if(get_user(arg, (unsigned long *) arg))
+			if(get_user(arg, (unsigned long __user *) argp))
 				return -EFAULT;
 			tty->termios->c_cflag =
 				((tty->termios->c_cflag & ~CLOCAL) |
@@ -1427,12 +1429,10 @@ static int isicom_ioctl(struct tty_struct * tty, struct file * filp,
 			return 0;	
 			
 		case TIOCGSERIAL:
-			return isicom_get_serial_info(port, 
-					(struct serial_struct *) arg);
+			return isicom_get_serial_info(port, argp);
 		
 		case TIOCSSERIAL:
-			return isicom_set_serial_info(port,
-					(struct serial_struct *) arg);
+			return isicom_set_serial_info(port, argp);
 					
 		default:
 			return -ENOIOCTLCMD;						
@@ -1545,7 +1545,7 @@ static void isicom_hangup(struct tty_struct * tty)
 	isicom_shutdown_port(port);
 	port->count = 0;
 	port->flags &= ~ASYNC_NORMAL_ACTIVE;
-	port->tty = 0;
+	port->tty = NULL;
 	wake_up_interruptible(&port->open_wait);
 }
 
diff --git a/drivers/char/istallion.c b/drivers/char/istallion.c
index 1a5a2df1b..4a8b7d51e 100644
--- a/drivers/char/istallion.c
+++ b/drivers/char/istallion.c
@@ -3,7 +3,7 @@
 /*
  *	istallion.c  -- stallion intelligent multiport serial driver.
  *
- *	Copyright (C) 1996-1999  Stallion Technologies (support@stallion.oz.au).
+ *	Copyright (C) 1996-1999  Stallion Technologies
  *	Copyright (C) 1994-1996  Greg Ungerer.
  *
  *	This code is loosely based on the Linux serial driver, written by
@@ -680,8 +680,8 @@ static int	stli_portinfo(stlibrd_t *brdp, stliport_t *portp, int portnr, char *p
 
 static int	stli_brdinit(stlibrd_t *brdp);
 static int	stli_startbrd(stlibrd_t *brdp);
-static ssize_t	stli_memread(struct file *fp, char *buf, size_t count, loff_t *offp);
-static ssize_t	stli_memwrite(struct file *fp, const char *buf, size_t count, loff_t *offp);
+static ssize_t	stli_memread(struct file *fp, char __user *buf, size_t count, loff_t *offp);
+static ssize_t	stli_memwrite(struct file *fp, const char __user *buf, size_t count, loff_t *offp);
 static int	stli_memioctl(struct inode *ip, struct file *fp, unsigned int cmd, unsigned long arg);
 static void	stli_brdpoll(stlibrd_t *brdp, volatile cdkhdr_t *hdrp);
 static void	stli_poll(unsigned long arg);
@@ -700,14 +700,14 @@ static void	stli_mkasyport(stliport_t *portp, asyport_t *pp, struct termios *tio
 static void	stli_mkasysigs(asysigs_t *sp, int dtr, int rts);
 static long	stli_mktiocm(unsigned long sigvalue);
 static void	stli_read(stlibrd_t *brdp, stliport_t *portp);
-static int	stli_getserial(stliport_t *portp, struct serial_struct *sp);
-static int	stli_setserial(stliport_t *portp, struct serial_struct *sp);
-static int	stli_getbrdstats(combrd_t *bp);
-static int	stli_getportstats(stliport_t *portp, comstats_t *cp);
+static int	stli_getserial(stliport_t *portp, struct serial_struct __user *sp);
+static int	stli_setserial(stliport_t *portp, struct serial_struct __user *sp);
+static int	stli_getbrdstats(combrd_t __user *bp);
+static int	stli_getportstats(stliport_t *portp, comstats_t __user *cp);
 static int	stli_portcmdstats(stliport_t *portp);
-static int	stli_clrportstats(stliport_t *portp, comstats_t *cp);
-static int	stli_getportstruct(unsigned long arg);
-static int	stli_getbrdstruct(unsigned long arg);
+static int	stli_clrportstats(stliport_t *portp, comstats_t __user *cp);
+static int	stli_getportstruct(stliport_t __user *arg);
+static int	stli_getbrdstruct(stlibrd_t __user *arg);
 static void	*stli_memalloc(int len);
 static stlibrd_t *stli_allocbrd(void);
 
@@ -808,7 +808,7 @@ static int __init istallion_module_init(void)
 {
 	unsigned long	flags;
 
-#if DEBUG
+#ifdef DEBUG
 	printk("init_module()\n");
 #endif
 
@@ -829,7 +829,7 @@ static void __exit istallion_module_exit(void)
 	unsigned long	flags;
 	int		i, j;
 
-#if DEBUG
+#ifdef DEBUG
 	printk("cleanup_module()\n");
 #endif
 
@@ -851,7 +851,7 @@ static void __exit istallion_module_exit(void)
 	i = tty_unregister_driver(stli_serial);
 	if (i) {
 		printk("STALLION: failed to un-register tty driver, "
-			"errno=%d,%d\n", -i);
+			"errno=%d\n", -i);
 		restore_flags(flags);
 		return;
 	}
@@ -901,13 +901,13 @@ module_exit(istallion_module_exit);
  *	Check for any arguments passed in on the module load command line.
  */
 
-static void stli_argbrds()
+static void stli_argbrds(void)
 {
 	stlconf_t	conf;
 	stlibrd_t	*brdp;
 	int		nrargs, i;
 
-#if DEBUG
+#ifdef DEBUG
 	printk("stli_argbrds()\n");
 #endif
 
@@ -975,7 +975,7 @@ static int stli_parsebrd(stlconf_t *confp, char **argp)
 	char	*sp;
 	int	nrbrdnames, i;
 
-#if DEBUG
+#ifdef DEBUG
 	printk("stli_parsebrd(confp=%x,argp=%x)\n", (int) confp, (int) argp);
 #endif
 
@@ -1025,7 +1025,7 @@ static int stli_open(struct tty_struct *tty, struct file *filp)
 	unsigned int	minordev;
 	int		brdnr, portnr, rc;
 
-#if DEBUG
+#ifdef DEBUG
 	printk("stli_open(tty=%x,filp=%x): device=%s\n", (int) tty,
 		(int) filp, tty->name);
 #endif
@@ -1125,7 +1125,7 @@ static void stli_close(struct tty_struct *tty, struct file *filp)
 	stliport_t	*portp;
 	unsigned long	flags;
 
-#if DEBUG
+#ifdef DEBUG
 	printk("stli_close(tty=%x,filp=%x)\n", (int) tty, (int) filp);
 #endif
 
@@ -1210,7 +1210,7 @@ static int stli_initopen(stlibrd_t *brdp, stliport_t *portp)
 	asyport_t		aport;
 	int			rc;
 
-#if DEBUG
+#ifdef DEBUG
 	printk("stli_initopen(brdp=%x,portp=%x)\n", (int) brdp, (int) portp);
 #endif
 
@@ -1263,7 +1263,7 @@ static int stli_rawopen(stlibrd_t *brdp, stliport_t *portp, unsigned long arg, i
 	unsigned long		flags;
 	int			rc;
 
-#if DEBUG
+#ifdef DEBUG
 	printk("stli_rawopen(brdp=%x,portp=%x,arg=%x,wait=%d)\n",
 		(int) brdp, (int) portp, (int) arg, wait);
 #endif
@@ -1344,7 +1344,7 @@ static int stli_rawclose(stlibrd_t *brdp, stliport_t *portp, unsigned long arg,
 	unsigned long		flags;
 	int			rc;
 
-#if DEBUG
+#ifdef DEBUG
 	printk("stli_rawclose(brdp=%x,portp=%x,arg=%x,wait=%d)\n",
 		(int) brdp, (int) portp, (int) arg, wait);
 #endif
@@ -1417,7 +1417,7 @@ static int stli_cmdwait(stlibrd_t *brdp, stliport_t *portp, unsigned long cmd, v
 {
 	unsigned long	flags;
 
-#if DEBUG
+#ifdef DEBUG
 	printk("stli_cmdwait(brdp=%x,portp=%x,cmd=%x,arg=%x,size=%d,"
 		"copyback=%d)\n", (int) brdp, (int) portp, (int) cmd,
 		(int) arg, size, copyback);
@@ -1461,7 +1461,7 @@ static int stli_setport(stliport_t *portp)
 	stlibrd_t	*brdp;
 	asyport_t	aport;
 
-#if DEBUG
+#ifdef DEBUG
 	printk("stli_setport(portp=%x)\n", (int) portp);
 #endif
 
@@ -1489,7 +1489,7 @@ static int stli_setport(stliport_t *portp)
 
 static void stli_delay(int len)
 {
-#if DEBUG
+#ifdef DEBUG
 	printk("stli_delay(len=%d)\n", len);
 #endif
 	if (len > 0) {
@@ -1510,7 +1510,7 @@ static int stli_waitcarrier(stlibrd_t *brdp, stliport_t *portp, struct file *fil
 	unsigned long	flags;
 	int		rc, doclocal;
 
-#if DEBUG
+#ifdef DEBUG
 	printk("stli_waitcarrier(brdp=%x,portp=%x,filp=%x)\n",
 		(int) brdp, (int) portp, (int) filp);
 #endif
@@ -1578,7 +1578,7 @@ static int stli_write(struct tty_struct *tty, int from_user, const unsigned char
 	unsigned int		len, stlen, head, tail, size;
 	unsigned long		flags;
 
-#if DEBUG
+#ifdef DEBUG
 	printk("stli_write(tty=%x,from_user=%d,buf=%x,count=%d)\n",
 		(int) tty, from_user, (int) buf, count);
 #endif
@@ -1699,7 +1699,7 @@ static int stli_write(struct tty_struct *tty, int from_user, const unsigned char
 
 static void stli_putchar(struct tty_struct *tty, unsigned char ch)
 {
-#if DEBUG
+#ifdef DEBUG
 	printk("stli_putchar(tty=%x,ch=%x)\n", (int) tty, (int) ch);
 #endif
 
@@ -1736,7 +1736,7 @@ static void stli_flushchars(struct tty_struct *tty)
 	unsigned char		*buf, *shbuf;
 	unsigned long		flags;
 
-#if DEBUG
+#ifdef DEBUG
 	printk("stli_flushchars(tty=%x)\n", (int) tty);
 #endif
 
@@ -1827,7 +1827,7 @@ static int stli_writeroom(struct tty_struct *tty)
 	unsigned int		head, tail, len;
 	unsigned long		flags;
 
-#if DEBUG
+#ifdef DEBUG
 	printk("stli_writeroom(tty=%x)\n", (int) tty);
 #endif
 
@@ -1887,7 +1887,7 @@ static int stli_charsinbuffer(struct tty_struct *tty)
 	unsigned int		head, tail, len;
 	unsigned long		flags;
 
-#if DEBUG
+#ifdef DEBUG
 	printk("stli_charsinbuffer(tty=%x)\n", (int) tty);
 #endif
 
@@ -1927,12 +1927,12 @@ static int stli_charsinbuffer(struct tty_struct *tty)
  *	Generate the serial struct info.
  */
 
-static int stli_getserial(stliport_t *portp, struct serial_struct *sp)
+static int stli_getserial(stliport_t *portp, struct serial_struct __user *sp)
 {
 	struct serial_struct	sio;
 	stlibrd_t		*brdp;
 
-#if DEBUG
+#ifdef DEBUG
 	printk("stli_getserial(portp=%x,sp=%x)\n", (int) portp, (int) sp);
 #endif
 
@@ -1964,13 +1964,13 @@ static int stli_getserial(stliport_t *portp, struct serial_struct *sp)
  *	just quietly ignore any requests to change irq, etc.
  */
 
-static int stli_setserial(stliport_t *portp, struct serial_struct *sp)
+static int stli_setserial(stliport_t *portp, struct serial_struct __user *sp)
 {
 	struct serial_struct	sio;
 	int			rc;
 
-#if DEBUG
-	printk("stli_setserial(portp=%x,sp=%x)\n", (int) portp, (int) sp);
+#ifdef DEBUG
+	printk("stli_setserial(portp=%p,sp=%p)\n", portp, sp);
 #endif
 
 	if (copy_from_user(&sio, sp, sizeof(struct serial_struct)))
@@ -2058,8 +2058,9 @@ static int stli_ioctl(struct tty_struct *tty, struct file *file, unsigned int cm
 	stlibrd_t	*brdp;
 	unsigned int	ival;
 	int		rc;
+	void __user *argp = (void __user *)arg;
 
-#if DEBUG
+#ifdef DEBUG
 	printk("stli_ioctl(tty=%x,file=%x,cmd=%x,arg=%x)\n",
 		(int) tty, (int) file, cmd, (int) arg);
 #endif
@@ -2086,40 +2087,32 @@ static int stli_ioctl(struct tty_struct *tty, struct file *file, unsigned int cm
 	switch (cmd) {
 	case TIOCGSOFTCAR:
 		rc = put_user(((tty->termios->c_cflag & CLOCAL) ? 1 : 0),
-			(unsigned int *) arg);
+			(unsigned __user *) arg);
 		break;
 	case TIOCSSOFTCAR:
-		if ((rc = get_user(ival, (unsigned int *) arg)) == 0)
+		if ((rc = get_user(ival, (unsigned __user *) arg)) == 0)
 			tty->termios->c_cflag =
 				(tty->termios->c_cflag & ~CLOCAL) |
 				(ival ? CLOCAL : 0);
 		break;
 	case TIOCGSERIAL:
-		if ((rc = verify_area(VERIFY_WRITE, (void *) arg,
-		    sizeof(struct serial_struct))) == 0)
-			rc = stli_getserial(portp, (struct serial_struct *) arg);
+		rc = stli_getserial(portp, argp);
 		break;
 	case TIOCSSERIAL:
-		if ((rc = verify_area(VERIFY_READ, (void *) arg,
-		    sizeof(struct serial_struct))) == 0)
-			rc = stli_setserial(portp, (struct serial_struct *)arg);
+		rc = stli_setserial(portp, argp);
 		break;
 	case STL_GETPFLAG:
-		rc = put_user(portp->pflag, (unsigned int *) arg);
+		rc = put_user(portp->pflag, (unsigned __user *)argp);
 		break;
 	case STL_SETPFLAG:
-		if ((rc = get_user(portp->pflag, (unsigned int *) arg)) == 0)
+		if ((rc = get_user(portp->pflag, (unsigned __user *)argp)) == 0)
 			stli_setport(portp);
 		break;
 	case COM_GETPORTSTATS:
-		if ((rc = verify_area(VERIFY_WRITE, (void *) arg,
-		    sizeof(comstats_t))) == 0)
-			rc = stli_getportstats(portp, (comstats_t *) arg);
+		rc = stli_getportstats(portp, argp);
 		break;
 	case COM_CLRPORTSTATS:
-		if ((rc = verify_area(VERIFY_WRITE, (void *) arg,
-		    sizeof(comstats_t))) == 0)
-			rc = stli_clrportstats(portp, (comstats_t *) arg);
+		rc = stli_clrportstats(portp, argp);
 		break;
 	case TIOCSERCONFIG:
 	case TIOCSERGWILD:
@@ -2150,7 +2143,7 @@ static void stli_settermios(struct tty_struct *tty, struct termios *old)
 	struct termios	*tiosp;
 	asyport_t	aport;
 
-#if DEBUG
+#ifdef DEBUG
 	printk("stli_settermios(tty=%x,old=%x)\n", (int) tty, (int) old);
 #endif
 
@@ -2197,7 +2190,7 @@ static void stli_throttle(struct tty_struct *tty)
 {
 	stliport_t	*portp;
 
-#if DEBUG
+#ifdef DEBUG
 	printk("stli_throttle(tty=%x)\n", (int) tty);
 #endif
 
@@ -2222,7 +2215,7 @@ static void stli_unthrottle(struct tty_struct *tty)
 {
 	stliport_t	*portp;
 
-#if DEBUG
+#ifdef DEBUG
 	printk("stli_unthrottle(tty=%x)\n", (int) tty);
 #endif
 
@@ -2248,7 +2241,7 @@ static void stli_stop(struct tty_struct *tty)
 	stliport_t	*portp;
 	asyctrl_t	actrl;
 
-#if DEBUG
+#ifdef DEBUG
 	printk("stli_stop(tty=%x)\n", (int) tty);
 #endif
 
@@ -2282,7 +2275,7 @@ static void stli_start(struct tty_struct *tty)
 	stlibrd_t	*brdp;
 	asyctrl_t	actrl;
 
-#if DEBUG
+#ifdef DEBUG
 	printk("stli_start(tty=%x)\n", (int) tty);
 #endif
 
@@ -2319,7 +2312,7 @@ static void stli_dohangup(void *arg)
 {
 	stliport_t	*portp;
 
-#if DEBUG
+#ifdef DEBUG
 	printk(KERN_DEBUG "stli_dohangup(portp=%x)\n", (int) arg);
 #endif
 
@@ -2351,7 +2344,7 @@ static void stli_hangup(struct tty_struct *tty)
 	stlibrd_t	*brdp;
 	unsigned long	flags;
 
-#if DEBUG
+#ifdef DEBUG
 	printk(KERN_DEBUG "stli_hangup(tty=%x)\n", (int) tty);
 #endif
 
@@ -2409,7 +2402,7 @@ static void stli_flushbuffer(struct tty_struct *tty)
 	stlibrd_t	*brdp;
 	unsigned long	ftype, flags;
 
-#if DEBUG
+#ifdef DEBUG
 	printk(KERN_DEBUG "stli_flushbuffer(tty=%x)\n", (int) tty);
 #endif
 
@@ -2459,7 +2452,7 @@ static void stli_breakctl(struct tty_struct *tty, int state)
 	long		arg;
 	/* long savestate, savetime; */
 
-#if DEBUG
+#ifdef DEBUG
 	printk(KERN_DEBUG "stli_breakctl(tty=%x,state=%d)\n", (int) tty, state);
 #endif
 
@@ -2498,7 +2491,7 @@ static void stli_waituntilsent(struct tty_struct *tty, int timeout)
 	stliport_t	*portp;
 	unsigned long	tend;
 
-#if DEBUG
+#ifdef DEBUG
 	printk(KERN_DEBUG "stli_waituntilsent(tty=%x,timeout=%x)\n", (int) tty, timeout);
 #endif
 
@@ -2529,7 +2522,7 @@ static void stli_sendxchar(struct tty_struct *tty, char ch)
 	stliport_t	*portp;
 	asyctrl_t	actrl;
 
-#if DEBUG
+#ifdef DEBUG
 	printk(KERN_DEBUG "stli_sendxchar(tty=%x,ch=%x)\n", (int) tty, ch);
 #endif
 
@@ -2636,7 +2629,7 @@ static int stli_readproc(char *page, char **start, off_t off, int count, int *eo
 	int		curoff, maxoff;
 	char		*pos;
 
-#if DEBUG
+#ifdef DEBUG
 	printk(KERN_DEBUG "stli_readproc(page=%x,start=%x,off=%x,count=%d,eof=%x,"
 		"data=%x\n", (int) page, (int) start, (int) off, count,
 		(int) eof, (int) data);
@@ -2712,7 +2705,7 @@ static void stli_sendcmd(stlibrd_t *brdp, stliport_t *portp, unsigned long cmd,
 	volatile unsigned char	*bits;
 	unsigned long		flags;
 
-#if DEBUG
+#ifdef DEBUG
 	printk(KERN_DEBUG "stli_sendcmd(brdp=%x,portp=%x,cmd=%x,arg=%x,size=%d,"
 		"copyback=%d)\n", (int) brdp, (int) portp, (int) cmd,
 		(int) arg, size, copyback);
@@ -2766,7 +2759,7 @@ static inline void stli_read(stlibrd_t *brdp, stliport_t *portp)
 	unsigned int		head, tail, size;
 	unsigned int		len, stlen;
 
-#if DEBUG
+#ifdef DEBUG
 	printk(KERN_DEBUG "stli_read(brdp=%x,portp=%d)\n",
 			(int) brdp, (int) portp);
 #endif
@@ -2883,7 +2876,7 @@ static inline int stli_hostcmd(stlibrd_t *brdp, stliport_t *portp)
 	unsigned long		oldsigs;
 	int			rc, donerx;
 
-#if DEBUG
+#ifdef DEBUG
 	printk(KERN_DEBUG "stli_hostcmd(brdp=%x,channr=%d)\n",
 			(int) brdp, channr);
 #endif
@@ -3135,7 +3128,7 @@ static void stli_poll(unsigned long arg)
 
 static void stli_mkasyport(stliport_t *portp, asyport_t *pp, struct termios *tiosp)
 {
-#if DEBUG
+#ifdef DEBUG
 	printk(KERN_DEBUG "stli_mkasyport(portp=%x,pp=%x,tiosp=%d)\n",
 		(int) portp, (int) pp, (int) tiosp);
 #endif
@@ -3258,7 +3251,7 @@ static void stli_mkasyport(stliport_t *portp, asyport_t *pp, struct termios *tio
 
 static void stli_mkasysigs(asysigs_t *sp, int dtr, int rts)
 {
-#if DEBUG
+#ifdef DEBUG
 	printk(KERN_DEBUG "stli_mkasysigs(sp=%x,dtr=%d,rts=%d)\n",
 			(int) sp, dtr, rts);
 #endif
@@ -3285,7 +3278,7 @@ static long stli_mktiocm(unsigned long sigvalue)
 {
 	long	tiocm;
 
-#if DEBUG
+#ifdef DEBUG
 	printk(KERN_DEBUG "stli_mktiocm(sigvalue=%x)\n", (int) sigvalue);
 #endif
 
@@ -3311,7 +3304,7 @@ static inline int stli_initports(stlibrd_t *brdp)
 	stliport_t	*portp;
 	int		i, panelnr, panelport;
 
-#if DEBUG
+#ifdef DEBUG
 	printk(KERN_DEBUG "stli_initports(brdp=%x)\n", (int) brdp);
 #endif
 
@@ -3355,7 +3348,7 @@ static void stli_ecpinit(stlibrd_t *brdp)
 {
 	unsigned long	memconf;
 
-#if DEBUG
+#ifdef DEBUG
 	printk(KERN_DEBUG "stli_ecpinit(brdp=%d)\n", (int) brdp);
 #endif
 
@@ -3372,7 +3365,7 @@ static void stli_ecpinit(stlibrd_t *brdp)
 
 static void stli_ecpenable(stlibrd_t *brdp)
 {	
-#if DEBUG
+#ifdef DEBUG
 	printk(KERN_DEBUG "stli_ecpenable(brdp=%x)\n", (int) brdp);
 #endif
 	outb(ECP_ATENABLE, (brdp->iobase + ECP_ATCONFR));
@@ -3382,7 +3375,7 @@ static void stli_ecpenable(stlibrd_t *brdp)
 
 static void stli_ecpdisable(stlibrd_t *brdp)
 {	
-#if DEBUG
+#ifdef DEBUG
 	printk(KERN_DEBUG "stli_ecpdisable(brdp=%x)\n", (int) brdp);
 #endif
 	outb(ECP_ATDISABLE, (brdp->iobase + ECP_ATCONFR));
@@ -3395,7 +3388,7 @@ static char *stli_ecpgetmemptr(stlibrd_t *brdp, unsigned long offset, int line)
 	void		*ptr;
 	unsigned char	val;
 
-#if DEBUG
+#ifdef DEBUG
 	printk(KERN_DEBUG "stli_ecpgetmemptr(brdp=%x,offset=%x)\n", (int) brdp,
 		(int) offset);
 #endif
@@ -3404,7 +3397,7 @@ static char *stli_ecpgetmemptr(stlibrd_t *brdp, unsigned long offset, int line)
 		printk(KERN_ERR "STALLION: shared memory pointer=%x out of "
 				"range at line=%d(%d), brd=%d\n",
 			(int) offset, line, __LINE__, brdp->brdnr);
-		ptr = 0;
+		ptr = NULL;
 		val = 0;
 	} else {
 		ptr = brdp->membase + (offset % ECP_ATPAGESIZE);
@@ -3418,7 +3411,7 @@ static char *stli_ecpgetmemptr(stlibrd_t *brdp, unsigned long offset, int line)
 
 static void stli_ecpreset(stlibrd_t *brdp)
 {	
-#if DEBUG
+#ifdef DEBUG
 	printk(KERN_DEBUG "stli_ecpreset(brdp=%x)\n", (int) brdp);
 #endif
 
@@ -3432,7 +3425,7 @@ static void stli_ecpreset(stlibrd_t *brdp)
 
 static void stli_ecpintr(stlibrd_t *brdp)
 {	
-#if DEBUG
+#ifdef DEBUG
 	printk(KERN_DEBUG "stli_ecpintr(brdp=%x)\n", (int) brdp);
 #endif
 	outb(0x1, brdp->iobase);
@@ -3448,7 +3441,7 @@ static void stli_ecpeiinit(stlibrd_t *brdp)
 {
 	unsigned long	memconf;
 
-#if DEBUG
+#ifdef DEBUG
 	printk(KERN_DEBUG "stli_ecpeiinit(brdp=%x)\n", (int) brdp);
 #endif
 
@@ -3485,7 +3478,7 @@ static char *stli_ecpeigetmemptr(stlibrd_t *brdp, unsigned long offset, int line
 	void		*ptr;
 	unsigned char	val;
 
-#if DEBUG
+#ifdef DEBUG
 	printk(KERN_DEBUG "stli_ecpeigetmemptr(brdp=%x,offset=%x,line=%d)\n",
 		(int) brdp, (int) offset, line);
 #endif
@@ -3494,7 +3487,7 @@ static char *stli_ecpeigetmemptr(stlibrd_t *brdp, unsigned long offset, int line
 		printk(KERN_ERR "STALLION: shared memory pointer=%x out of "
 				"range at line=%d(%d), brd=%d\n",
 			(int) offset, line, __LINE__, brdp->brdnr);
-		ptr = 0;
+		ptr = NULL;
 		val = 0;
 	} else {
 		ptr = brdp->membase + (offset % ECP_EIPAGESIZE);
@@ -3546,7 +3539,7 @@ static char *stli_ecpmcgetmemptr(stlibrd_t *brdp, unsigned long offset, int line
 		printk(KERN_ERR "STALLION: shared memory pointer=%x out of "
 				"range at line=%d(%d), brd=%d\n",
 			(int) offset, line, __LINE__, brdp->brdnr);
-		ptr = 0;
+		ptr = NULL;
 		val = 0;
 	} else {
 		ptr = brdp->membase + (offset % ECP_MCPAGESIZE);
@@ -3574,7 +3567,7 @@ static void stli_ecpmcreset(stlibrd_t *brdp)
 
 static void stli_ecppciinit(stlibrd_t *brdp)
 {
-#if DEBUG
+#ifdef DEBUG
 	printk(KERN_DEBUG "stli_ecppciinit(brdp=%x)\n", (int) brdp);
 #endif
 
@@ -3591,7 +3584,7 @@ static char *stli_ecppcigetmemptr(stlibrd_t *brdp, unsigned long offset, int lin
 	void		*ptr;
 	unsigned char	val;
 
-#if DEBUG
+#ifdef DEBUG
 	printk(KERN_DEBUG "stli_ecppcigetmemptr(brdp=%x,offset=%x,line=%d)\n",
 		(int) brdp, (int) offset, line);
 #endif
@@ -3600,7 +3593,7 @@ static char *stli_ecppcigetmemptr(stlibrd_t *brdp, unsigned long offset, int lin
 		printk(KERN_ERR "STALLION: shared memory pointer=%x out of "
 				"range at line=%d(%d), board=%d\n",
 				(int) offset, line, __LINE__, brdp->brdnr);
-		ptr = 0;
+		ptr = NULL;
 		val = 0;
 	} else {
 		ptr = brdp->membase + (offset % ECP_PCIPAGESIZE);
@@ -3630,7 +3623,7 @@ static void stli_onbinit(stlibrd_t *brdp)
 {
 	unsigned long	memconf;
 
-#if DEBUG
+#ifdef DEBUG
 	printk(KERN_DEBUG "stli_onbinit(brdp=%d)\n", (int) brdp);
 #endif
 
@@ -3649,7 +3642,7 @@ static void stli_onbinit(stlibrd_t *brdp)
 
 static void stli_onbenable(stlibrd_t *brdp)
 {	
-#if DEBUG
+#ifdef DEBUG
 	printk(KERN_DEBUG "stli_onbenable(brdp=%x)\n", (int) brdp);
 #endif
 	outb((brdp->enabval | ONB_ATENABLE), (brdp->iobase + ONB_ATCONFR));
@@ -3659,7 +3652,7 @@ static void stli_onbenable(stlibrd_t *brdp)
 
 static void stli_onbdisable(stlibrd_t *brdp)
 {	
-#if DEBUG
+#ifdef DEBUG
 	printk(KERN_DEBUG "stli_onbdisable(brdp=%x)\n", (int) brdp);
 #endif
 	outb((brdp->enabval | ONB_ATDISABLE), (brdp->iobase + ONB_ATCONFR));
@@ -3671,7 +3664,7 @@ static char *stli_onbgetmemptr(stlibrd_t *brdp, unsigned long offset, int line)
 {	
 	void	*ptr;
 
-#if DEBUG
+#ifdef DEBUG
 	printk(KERN_DEBUG "stli_onbgetmemptr(brdp=%x,offset=%x)\n", (int) brdp,
 		(int) offset);
 #endif
@@ -3680,7 +3673,7 @@ static char *stli_onbgetmemptr(stlibrd_t *brdp, unsigned long offset, int line)
 		printk(KERN_ERR "STALLION: shared memory pointer=%x out of "
 				"range at line=%d(%d), brd=%d\n",
 				(int) offset, line, __LINE__, brdp->brdnr);
-		ptr = 0;
+		ptr = NULL;
 	} else {
 		ptr = brdp->membase + (offset % ONB_ATPAGESIZE);
 	}
@@ -3692,7 +3685,7 @@ static char *stli_onbgetmemptr(stlibrd_t *brdp, unsigned long offset, int line)
 static void stli_onbreset(stlibrd_t *brdp)
 {	
 
-#if DEBUG
+#ifdef DEBUG
 	printk(KERN_DEBUG "stli_onbreset(brdp=%x)\n", (int) brdp);
 #endif
 
@@ -3712,7 +3705,7 @@ static void stli_onbeinit(stlibrd_t *brdp)
 {
 	unsigned long	memconf;
 
-#if DEBUG
+#ifdef DEBUG
 	printk(KERN_DEBUG "stli_onbeinit(brdp=%d)\n", (int) brdp);
 #endif
 
@@ -3734,7 +3727,7 @@ static void stli_onbeinit(stlibrd_t *brdp)
 
 static void stli_onbeenable(stlibrd_t *brdp)
 {	
-#if DEBUG
+#ifdef DEBUG
 	printk(KERN_DEBUG "stli_onbeenable(brdp=%x)\n", (int) brdp);
 #endif
 	outb(ONB_EIENABLE, (brdp->iobase + ONB_EICONFR));
@@ -3744,7 +3737,7 @@ static void stli_onbeenable(stlibrd_t *brdp)
 
 static void stli_onbedisable(stlibrd_t *brdp)
 {	
-#if DEBUG
+#ifdef DEBUG
 	printk(KERN_DEBUG "stli_onbedisable(brdp=%x)\n", (int) brdp);
 #endif
 	outb(ONB_EIDISABLE, (brdp->iobase + ONB_EICONFR));
@@ -3757,7 +3750,7 @@ static char *stli_onbegetmemptr(stlibrd_t *brdp, unsigned long offset, int line)
 	void		*ptr;
 	unsigned char	val;
 
-#if DEBUG
+#ifdef DEBUG
 	printk(KERN_DEBUG "stli_onbegetmemptr(brdp=%x,offset=%x,line=%d)\n",
 		(int) brdp, (int) offset, line);
 #endif
@@ -3766,7 +3759,7 @@ static char *stli_onbegetmemptr(stlibrd_t *brdp, unsigned long offset, int line)
 		printk(KERN_ERR "STALLION: shared memory pointer=%x out of "
 				"range at line=%d(%d), brd=%d\n",
 			(int) offset, line, __LINE__, brdp->brdnr);
-		ptr = 0;
+		ptr = NULL;
 		val = 0;
 	} else {
 		ptr = brdp->membase + (offset % ONB_EIPAGESIZE);
@@ -3784,7 +3777,7 @@ static char *stli_onbegetmemptr(stlibrd_t *brdp, unsigned long offset, int line)
 static void stli_onbereset(stlibrd_t *brdp)
 {	
 
-#if DEBUG
+#ifdef DEBUG
 	printk(KERN_ERR "stli_onbereset(brdp=%x)\n", (int) brdp);
 #endif
 
@@ -3803,7 +3796,7 @@ static void stli_onbereset(stlibrd_t *brdp)
 static void stli_bbyinit(stlibrd_t *brdp)
 {
 
-#if DEBUG
+#ifdef DEBUG
 	printk(KERN_ERR "stli_bbyinit(brdp=%d)\n", (int) brdp);
 #endif
 
@@ -3822,7 +3815,7 @@ static char *stli_bbygetmemptr(stlibrd_t *brdp, unsigned long offset, int line)
 	void		*ptr;
 	unsigned char	val;
 
-#if DEBUG
+#ifdef DEBUG
 	printk(KERN_ERR "stli_bbygetmemptr(brdp=%x,offset=%x)\n", (int) brdp,
 		(int) offset);
 #endif
@@ -3831,7 +3824,7 @@ static char *stli_bbygetmemptr(stlibrd_t *brdp, unsigned long offset, int line)
 		printk(KERN_ERR "STALLION: shared memory pointer=%x out of "
 				"range at line=%d(%d), brd=%d\n",
 				(int) offset, line, __LINE__, brdp->brdnr);
-		ptr = 0;
+		ptr = NULL;
 		val = 0;
 	} else {
 		ptr = brdp->membase + (offset % BBY_PAGESIZE);
@@ -3846,7 +3839,7 @@ static char *stli_bbygetmemptr(stlibrd_t *brdp, unsigned long offset, int line)
 static void stli_bbyreset(stlibrd_t *brdp)
 {	
 
-#if DEBUG
+#ifdef DEBUG
 	printk(KERN_DEBUG "stli_bbyreset(brdp=%x)\n", (int) brdp);
 #endif
 
@@ -3865,7 +3858,7 @@ static void stli_bbyreset(stlibrd_t *brdp)
 static void stli_stalinit(stlibrd_t *brdp)
 {
 
-#if DEBUG
+#ifdef DEBUG
 	printk(KERN_DEBUG "stli_stalinit(brdp=%d)\n", (int) brdp);
 #endif
 
@@ -3879,7 +3872,7 @@ static char *stli_stalgetmemptr(stlibrd_t *brdp, unsigned long offset, int line)
 {	
 	void	*ptr;
 
-#if DEBUG
+#ifdef DEBUG
 	printk(KERN_DEBUG "stli_stalgetmemptr(brdp=%x,offset=%x)\n", (int) brdp,
 		(int) offset);
 #endif
@@ -3888,7 +3881,7 @@ static char *stli_stalgetmemptr(stlibrd_t *brdp, unsigned long offset, int line)
 		printk(KERN_ERR "STALLION: shared memory pointer=%x out of "
 				"range at line=%d(%d), brd=%d\n",
 				(int) offset, line, __LINE__, brdp->brdnr);
-		ptr = 0;
+		ptr = NULL;
 	} else {
 		ptr = brdp->membase + (offset % STAL_PAGESIZE);
 	}
@@ -3901,7 +3894,7 @@ static void stli_stalreset(stlibrd_t *brdp)
 {	
 	volatile unsigned long	*vecp;
 
-#if DEBUG
+#ifdef DEBUG
 	printk(KERN_DEBUG "stli_stalreset(brdp=%x)\n", (int) brdp);
 #endif
 
@@ -3926,7 +3919,7 @@ static inline int stli_initecp(stlibrd_t *brdp)
 	char		*name;
 	int		panelnr, nrports;
 
-#if DEBUG
+#ifdef DEBUG
 	printk(KERN_DEBUG "stli_initecp(brdp=%x)\n", (int) brdp);
 #endif
 
@@ -4086,7 +4079,7 @@ static inline int stli_initonb(stlibrd_t *brdp)
 	char		*name;
 	int		i;
 
-#if DEBUG
+#ifdef DEBUG
 	printk(KERN_DEBUG "stli_initonb(brdp=%x)\n", (int) brdp);
 #endif
 
@@ -4254,7 +4247,7 @@ static int stli_startbrd(stlibrd_t *brdp)
 	stliport_t		*portp;
 	int			portnr, nrdevs, i, rc;
 
-#if DEBUG
+#ifdef DEBUG
 	printk(KERN_DEBUG "stli_startbrd(brdp=%x)\n", (int) brdp);
 #endif
 
@@ -4360,7 +4353,7 @@ stli_donestartup:
 
 static int __init stli_brdinit(stlibrd_t *brdp)
 {
-#if DEBUG
+#ifdef DEBUG
 	printk(KERN_DEBUG "stli_brdinit(brdp=%x)\n", (int) brdp);
 #endif
 
@@ -4427,7 +4420,7 @@ static inline int stli_eisamemprobe(stlibrd_t *brdp)
 	cdkonbsig_t	onbsig, *onbsigp;
 	int		i, foundit;
 
-#if DEBUG
+#ifdef DEBUG
 	printk(KERN_DEBUG "stli_eisamemprobe(brdp=%x)\n", (int) brdp);
 #endif
 
@@ -4504,7 +4497,7 @@ static inline int stli_eisamemprobe(stlibrd_t *brdp)
 
 	if (! foundit) {
 		brdp->memaddr = 0;
-		brdp->membase = 0;
+		brdp->membase = NULL;
 		printk(KERN_ERR "STALLION: failed to probe shared memory "
 				"region for %s in EISA slot=%d\n",
 			stli_brdnames[brdp->brdtype], (brdp->iobase >> 12));
@@ -4513,6 +4506,20 @@ static inline int stli_eisamemprobe(stlibrd_t *brdp)
 	return(0);
 }
 
+static inline int stli_getbrdnr(void)
+{
+	int i;
+
+	for (i = 0; i < STL_MAXBRDS; i++) {
+		if (!stli_brds[i]) {
+			if (i >= stli_nrbrds)
+				stli_nrbrds = i + 1;
+			return i;
+		}
+	}
+	return -1;
+}
+
 /*****************************************************************************/
 
 /*
@@ -4525,13 +4532,13 @@ static inline int stli_eisamemprobe(stlibrd_t *brdp)
  *	do is go probing around in the usual places hoping we can find it.
  */
 
-static inline int stli_findeisabrds()
+static inline int stli_findeisabrds(void)
 {
 	stlibrd_t	*brdp;
 	unsigned int	iobase, eid;
 	int		i;
 
-#if DEBUG
+#ifdef DEBUG
 	printk(KERN_DEBUG "stli_findeisabrds()\n");
 #endif
 
@@ -4599,20 +4606,6 @@ static inline int stli_findeisabrds()
  *	Find the next available board number that is free.
  */
 
-static inline int stli_getbrdnr()
-{
-	int	i;
-
-	for (i = 0; (i < STL_MAXBRDS); i++) {
-		if (stli_brds[i] == (stlibrd_t *) NULL) {
-			if (i >= stli_nrbrds)
-				stli_nrbrds = i + 1;
-			return(i);
-		}
-	}
-	return(-1);
-}
-
 /*****************************************************************************/
 
 #ifdef	CONFIG_PCI
@@ -4627,7 +4620,7 @@ static inline int stli_initpcibrd(int brdtype, struct pci_dev *devp)
 {
 	stlibrd_t	*brdp;
 
-#if DEBUG
+#ifdef DEBUG
 	printk(KERN_DEBUG "stli_initpcibrd(brdtype=%d,busnr=%x,devnr=%x)\n",
 		brdtype, dev->bus->number, dev->devfn);
 #endif
@@ -4643,7 +4636,7 @@ static inline int stli_initpcibrd(int brdtype, struct pci_dev *devp)
 	}
 	brdp->brdtype = brdtype;
 
-#if DEBUG
+#ifdef DEBUG
 	printk(KERN_DEBUG "%s(%d): BAR[]=%lx,%lx,%lx,%lx\n", __FILE__, __LINE__,
 		pci_resource_start(devp, 0),
 		pci_resource_start(devp, 1),
@@ -4669,12 +4662,12 @@ static inline int stli_initpcibrd(int brdtype, struct pci_dev *devp)
  *	one as it is found.
  */
 
-static inline int stli_findpcibrds()
+static inline int stli_findpcibrds(void)
 {
 	struct pci_dev	*dev = NULL;
 	int		rc;
 
-#if DEBUG
+#ifdef DEBUG
 	printk("stli_findpcibrds()\n");
 #endif
 
@@ -4695,7 +4688,7 @@ static inline int stli_findpcibrds()
  *	Allocate a new board structure. Fill out the basic info in it.
  */
 
-static stlibrd_t *stli_allocbrd()
+static stlibrd_t *stli_allocbrd(void)
 {
 	stlibrd_t	*brdp;
 
@@ -4718,13 +4711,13 @@ static stlibrd_t *stli_allocbrd()
  *	can find.
  */
 
-static inline int stli_initbrds()
+static inline int stli_initbrds(void)
 {
 	stlibrd_t	*brdp, *nxtbrdp;
 	stlconf_t	*confp;
 	int		i, j;
 
-#if DEBUG
+#ifdef DEBUG
 	printk(KERN_DEBUG "stli_initbrds()\n");
 #endif
 
@@ -4815,14 +4808,14 @@ static inline int stli_initbrds()
  *	the slave image (and debugging :-)
  */
 
-static ssize_t stli_memread(struct file *fp, char *buf, size_t count, loff_t *offp)
+static ssize_t stli_memread(struct file *fp, char __user *buf, size_t count, loff_t *offp)
 {
 	unsigned long	flags;
 	void		*memptr;
 	stlibrd_t	*brdp;
 	int		brdnr, size, n;
 
-#if DEBUG
+#ifdef DEBUG
 	printk(KERN_DEBUG "stli_memread(fp=%x,buf=%x,count=%x,offp=%x)\n",
 			(int) fp, (int) buf, count, (int) offp);
 #endif
@@ -4869,15 +4862,15 @@ out:
  *	the slave image (and debugging :-)
  */
 
-static ssize_t stli_memwrite(struct file *fp, const char *buf, size_t count, loff_t *offp)
+static ssize_t stli_memwrite(struct file *fp, const char __user *buf, size_t count, loff_t *offp)
 {
 	unsigned long	flags;
 	void		*memptr;
 	stlibrd_t	*brdp;
-	char		*chbuf;
+	char		__user *chbuf;
 	int		brdnr, size, n;
 
-#if DEBUG
+#ifdef DEBUG
 	printk(KERN_DEBUG "stli_memwrite(fp=%x,buf=%x,count=%x,offp=%x)\n",
 			(int) fp, (int) buf, count, (int) offp);
 #endif
@@ -4893,7 +4886,7 @@ static ssize_t stli_memwrite(struct file *fp, const char *buf, size_t count, lof
 	if (fp->f_pos >= brdp->memsize)
 		return(0);
 
-	chbuf = (char *) buf;
+	chbuf = (char __user *) buf;
 	size = MIN(count, (brdp->memsize - fp->f_pos));
 
 	save_flags(flags);
@@ -4923,7 +4916,7 @@ out:
  *	Return the board stats structure to user app.
  */
 
-static int stli_getbrdstats(combrd_t *bp)
+static int stli_getbrdstats(combrd_t __user *bp)
 {
 	stlibrd_t	*brdp;
 	int		i;
@@ -5062,26 +5055,26 @@ static int stli_portcmdstats(stliport_t *portp)
  *	what port to get stats for (used through board control device).
  */
 
-static int stli_getportstats(stliport_t *portp, comstats_t *cp)
+static int stli_getportstats(stliport_t *portp, comstats_t __user *cp)
 {
 	stlibrd_t	*brdp;
 	int		rc;
 
-	if (portp == (stliport_t *) NULL) {
+	if (!portp) {
 		if (copy_from_user(&stli_comstats, cp, sizeof(comstats_t)))
 			return -EFAULT;
 		portp = stli_getport(stli_comstats.brd, stli_comstats.panel,
 			stli_comstats.port);
-		if (portp == (stliport_t *) NULL)
-			return(-ENODEV);
+		if (!portp)
+			return -ENODEV;
 	}
 
 	brdp = stli_brds[portp->brdnr];
-	if (brdp == (stlibrd_t *) NULL)
-		return(-ENODEV);
+	if (!brdp)
+		return -ENODEV;
 
 	if ((rc = stli_portcmdstats(portp)) < 0)
-		return(rc);
+		return rc;
 
 	return copy_to_user(cp, &stli_comstats, sizeof(comstats_t)) ?
 			-EFAULT : 0;
@@ -5093,27 +5086,27 @@ static int stli_getportstats(stliport_t *portp, comstats_t *cp)
  *	Clear the port stats structure. We also return it zeroed out...
  */
 
-static int stli_clrportstats(stliport_t *portp, comstats_t *cp)
+static int stli_clrportstats(stliport_t *portp, comstats_t __user *cp)
 {
 	stlibrd_t	*brdp;
 	int		rc;
 
-	if (portp == (stliport_t *) NULL) {
+	if (!portp) {
 		if (copy_from_user(&stli_comstats, cp, sizeof(comstats_t)))
 			return -EFAULT;
 		portp = stli_getport(stli_comstats.brd, stli_comstats.panel,
 			stli_comstats.port);
-		if (portp == (stliport_t *) NULL)
-			return(-ENODEV);
+		if (!portp)
+			return -ENODEV;
 	}
 
 	brdp = stli_brds[portp->brdnr];
-	if (brdp == (stlibrd_t *) NULL)
-		return(-ENODEV);
+	if (!brdp)
+		return -ENODEV;
 
 	if (brdp->state & BST_STARTED) {
-		if ((rc = stli_cmdwait(brdp, portp, A_CLEARSTATS, 0, 0, 0)) < 0)
-			return(rc);
+		if ((rc = stli_cmdwait(brdp, portp, A_CLEARSTATS, NULL, 0, 0)) < 0)
+			return rc;
 	}
 
 	memset(&stli_comstats, 0, sizeof(comstats_t));
@@ -5123,7 +5116,7 @@ static int stli_clrportstats(stliport_t *portp, comstats_t *cp)
 
 	if (copy_to_user(cp, &stli_comstats, sizeof(comstats_t)))
 		return -EFAULT;
-	return(0);
+	return 0;
 }
 
 /*****************************************************************************/
@@ -5132,19 +5125,19 @@ static int stli_clrportstats(stliport_t *portp, comstats_t *cp)
  *	Return the entire driver ports structure to a user app.
  */
 
-static int stli_getportstruct(unsigned long arg)
+static int stli_getportstruct(stliport_t __user *arg)
 {
 	stliport_t	*portp;
 
-	if (copy_from_user(&stli_dummyport, (void *)arg, sizeof(stliport_t)))
+	if (copy_from_user(&stli_dummyport, arg, sizeof(stliport_t)))
 		return -EFAULT;
 	portp = stli_getport(stli_dummyport.brdnr, stli_dummyport.panelnr,
 		 stli_dummyport.portnr);
-	if (portp == (stliport_t *) NULL)
-		return(-ENODEV);
-	if (copy_to_user((void *) arg, portp, sizeof(stliport_t)))
+	if (!portp)
+		return -ENODEV;
+	if (copy_to_user(arg, portp, sizeof(stliport_t)))
 		return -EFAULT;
-	return(0);
+	return 0;
 }
 
 /*****************************************************************************/
@@ -5153,20 +5146,20 @@ static int stli_getportstruct(unsigned long arg)
  *	Return the entire driver board structure to a user app.
  */
 
-static int stli_getbrdstruct(unsigned long arg)
+static int stli_getbrdstruct(stlibrd_t __user *arg)
 {
 	stlibrd_t	*brdp;
 
-	if (copy_from_user(&stli_dummybrd, (void *)arg, sizeof(stlibrd_t)))
+	if (copy_from_user(&stli_dummybrd, arg, sizeof(stlibrd_t)))
 		return -EFAULT;
 	if ((stli_dummybrd.brdnr < 0) || (stli_dummybrd.brdnr >= STL_MAXBRDS))
-		return(-ENODEV);
+		return -ENODEV;
 	brdp = stli_brds[stli_dummybrd.brdnr];
-	if (brdp == (stlibrd_t *) NULL)
-		return(-ENODEV);
-	if (copy_to_user((void *) arg, brdp, sizeof(stlibrd_t)))
+	if (!brdp)
+		return -ENODEV;
+	if (copy_to_user(arg, brdp, sizeof(stlibrd_t)))
 		return -EFAULT;
-	return(0);
+	return 0;
 }
 
 /*****************************************************************************/
@@ -5181,8 +5174,9 @@ static int stli_memioctl(struct inode *ip, struct file *fp, unsigned int cmd, un
 {
 	stlibrd_t	*brdp;
 	int		brdnr, rc, done;
+	void __user *argp = (void __user *)arg;
 
-#if DEBUG
+#ifdef DEBUG
 	printk(KERN_DEBUG "stli_memioctl(ip=%x,fp=%x,cmd=%x,arg=%x)\n",
 			(int) ip, (int) fp, cmd, (int) arg);
 #endif
@@ -5195,23 +5189,23 @@ static int stli_memioctl(struct inode *ip, struct file *fp, unsigned int cmd, un
 
 	switch (cmd) {
 	case COM_GETPORTSTATS:
-		rc = stli_getportstats((stliport_t *)NULL, (comstats_t *)arg);
+		rc = stli_getportstats(NULL, argp);
 		done++;
 		break;
 	case COM_CLRPORTSTATS:
-		rc = stli_clrportstats((stliport_t *)NULL, (comstats_t *)arg);
+		rc = stli_clrportstats(NULL, argp);
 		done++;
 		break;
 	case COM_GETBRDSTATS:
-		rc = stli_getbrdstats((combrd_t *) arg);
+		rc = stli_getbrdstats(argp);
 		done++;
 		break;
 	case COM_READPORT:
-		rc = stli_getportstruct(arg);
+		rc = stli_getportstruct(argp);
 		done++;
 		break;
 	case COM_READBOARD:
-		rc = stli_getbrdstruct(arg);
+		rc = stli_getbrdstruct(argp);
 		done++;
 		break;
 	}
@@ -5227,7 +5221,7 @@ static int stli_memioctl(struct inode *ip, struct file *fp, unsigned int cmd, un
 	if (brdnr >= STL_MAXBRDS)
 		return(-ENODEV);
 	brdp = stli_brds[brdnr];
-	if (brdp == (stlibrd_t *) NULL)
+	if (!brdp)
 		return(-ENODEV);
 	if (brdp->state == 0)
 		return(-ENODEV);
diff --git a/drivers/char/keyboard.c b/drivers/char/keyboard.c
index 010bff6e1..3ad30ba46 100644
--- a/drivers/char/keyboard.c
+++ b/drivers/char/keyboard.c
@@ -52,13 +52,12 @@ extern void ctrl_alt_del(void);
 
 /*
  * Some laptops take the 789uiojklm,. keys as number pad when NumLock is on.
- * This seems a good reason to start with NumLock off. On PC9800 and HIL keyboards 
+ * This seems a good reason to start with NumLock off. On HIL keyboards
  * of PARISC machines however there is no NumLock key and everyone expects the keypad 
  * to be used for numbers.
  */
 
-#if defined(CONFIG_X86_PC9800) || \
-    defined(CONFIG_PARISC) && (defined(CONFIG_KEYBOARD_HIL) || defined(CONFIG_KEYBOARD_HIL_OLD))
+#if defined(CONFIG_PARISC) && (defined(CONFIG_KEYBOARD_HIL) || defined(CONFIG_KEYBOARD_HIL_OLD))
 #define KBD_DEFLEDS (1 << VC_NUMLOCK)
 #else
 #define KBD_DEFLEDS 0
@@ -940,7 +939,7 @@ void kbd_refresh_leds(struct input_handle *handle)
 	tasklet_enable(&keyboard_tasklet);
 }
 
-#if defined(CONFIG_X86) || defined(CONFIG_IA64) || defined(CONFIG_ALPHA) || defined(CONFIG_MIPS) || defined(CONFIG_PPC) || defined(CONFIG_SPARC32) || defined(CONFIG_SPARC64) || defined(CONFIG_PARISC) || defined(CONFIG_SH_MPC1211)
+#if defined(CONFIG_X86) || defined(CONFIG_IA64) || defined(CONFIG_ALPHA) || defined(CONFIG_MIPS) || defined(CONFIG_PPC) || defined(CONFIG_SPARC32) || defined(CONFIG_SPARC64) || defined(CONFIG_PARISC) || defined(CONFIG_SUPERH)
 
 static unsigned short x86_keycodes[256] =
 	{ 0,  1,  2,  3,  4,  5,  6,  7,  8,  9, 10, 11, 12, 13, 14, 15,
diff --git a/drivers/char/lcd.c b/drivers/char/lcd.c
index 41f2d4e41..64837783d 100644
--- a/drivers/char/lcd.c
+++ b/drivers/char/lcd.c
@@ -12,7 +12,7 @@
  *
  */
 
-#define RTC_IO_EXTENT	0x10    /*Only really two ports, but...	*/
+#define RTC_IO_EXTENT	0x10	/*Only really two ports, but... */
 
 #include <linux/config.h>
 #include <linux/types.h>
@@ -32,8 +32,8 @@
 
 #include "lcd.h"
 
-static int lcd_ioctl(struct inode *inode, struct file *file, unsigned int cmd, 
-                     unsigned long arg);
+static int lcd_ioctl(struct inode *inode, struct file *file,
+		     unsigned int cmd, unsigned long arg);
 
 static int lcd_present = 1;
 
@@ -57,8 +57,8 @@ int lcd_register_linkcheck_func(int iface_num, void *func, void *cookie)
 }
 #endif
 
-static int lcd_ioctl(struct inode *inode, struct file *file, unsigned int cmd, 
-			unsigned long arg)
+static int lcd_ioctl(struct inode *inode, struct file *file,
+		     unsigned int cmd, unsigned long arg)
 {
 	struct lcd_display button_display;
 	unsigned long address, a;
@@ -69,7 +69,7 @@ static int lcd_ioctl(struct inode *inode, struct file *file, unsigned int cmd,
 		udelay(150);
 		BusyCheck();
 		LCDWriteInst(0x0F);
-		break;		
+		break;
 
 	case LCD_Off:
 		udelay(150);
@@ -95,7 +95,7 @@ static int lcd_ioctl(struct inode *inode, struct file *file, unsigned int cmd,
 	case LCD_Clear:
 		udelay(150);
 		BusyCheck();
-       		LCDWriteInst(0x01);     
+		LCDWriteInst(0x01);
 		break;
 
 	case LCD_Cursor_Left:
@@ -108,86 +108,95 @@ static int lcd_ioctl(struct inode *inode, struct file *file, unsigned int cmd,
 		udelay(150);
 		BusyCheck();
 		LCDWriteInst(0x14);
-		break;	
+		break;
 
 	case LCD_Cursor_Off:
 		udelay(150);
-                BusyCheck();
-                LCDWriteInst(0x0C);
-	        break;
-
-        case LCD_Cursor_On:
-                udelay(150);
-                BusyCheck();
-                LCDWriteInst(0x0F);
-                break;
-
-        case LCD_Blink_Off:
-                udelay(150);
-                BusyCheck();
-                LCDWriteInst(0x0E);
-                break;
-
-	case LCD_Get_Cursor_Pos:{
-                struct lcd_display display;
+		BusyCheck();
+		LCDWriteInst(0x0C);
+		break;
 
+	case LCD_Cursor_On:
 		udelay(150);
-                BusyCheck();
-		display.cursor_address = ( LCDReadInst ); 
-		display.cursor_address = ( display.cursor_address & 0x07F );
-		if(copy_to_user((struct lcd_display*)arg, &display, sizeof(struct lcd_display)))
-		  return -EFAULT;
+		BusyCheck();
+		LCDWriteInst(0x0F);
+		break;
 
+	case LCD_Blink_Off:
+		udelay(150);
+		BusyCheck();
+		LCDWriteInst(0x0E);
 		break;
+
+	case LCD_Get_Cursor_Pos:{
+			struct lcd_display display;
+
+			udelay(150);
+			BusyCheck();
+			display.cursor_address = (LCDReadInst);
+			display.cursor_address =
+			    (display.cursor_address & 0x07F);
+			if (copy_to_user
+			    ((struct lcd_display *) arg, &display,
+			     sizeof(struct lcd_display)))
+				return -EFAULT;
+
+			break;
 		}
 
 
-	case LCD_Set_Cursor_Pos: {
-                struct lcd_display display;
+	case LCD_Set_Cursor_Pos:{
+			struct lcd_display display;
 
-                if(copy_from_user(&display, (struct lcd_display*)arg, sizeof(struct lcd_display)))
-		  return -EFAULT;
+			if (copy_from_user
+			    (&display, (struct lcd_display *) arg,
+			     sizeof(struct lcd_display)))
+				return -EFAULT;
 
-		a = (display.cursor_address | kLCD_Addr ); 
+			a = (display.cursor_address | kLCD_Addr);
 
-                udelay(150);
-                BusyCheck();    
-                LCDWriteInst( a );
+			udelay(150);
+			BusyCheck();
+			LCDWriteInst(a);
 
-                break;
+			break;
 		}
-	
-	case LCD_Get_Cursor: {
-                struct lcd_display display;
 
-                udelay(150);
-                BusyCheck();    
-		display.character = LCDReadData;	
+	case LCD_Get_Cursor:{
+			struct lcd_display display;
 
-		if(copy_to_user((struct lcd_display*)arg, &display, sizeof(struct lcd_display)))
-		  return -EFAULT;
-                udelay(150);
-                BusyCheck();
-                LCDWriteInst(0x10);
+			udelay(150);
+			BusyCheck();
+			display.character = LCDReadData;
 
-		break;
+			if (copy_to_user
+			    ((struct lcd_display *) arg, &display,
+			     sizeof(struct lcd_display)))
+				return -EFAULT;
+			udelay(150);
+			BusyCheck();
+			LCDWriteInst(0x10);
+
+			break;
 		}
 
 	case LCD_Set_Cursor:{
-                struct lcd_display display;
-   
-                if(copy_from_user(&display, (struct lcd_display*)arg, sizeof(struct lcd_display)))
-		  return -EFAULT;
+			struct lcd_display display;
 
-                udelay(150);
-		BusyCheck();    
-                LCDWriteData( display.character );
-                udelay(150);
-                BusyCheck();
-                LCDWriteInst(0x10);
+			if (copy_from_user
+			    (&display, (struct lcd_display *) arg,
+			     sizeof(struct lcd_display)))
+				return -EFAULT;
 
-                break;
-                }
+			udelay(150);
+			BusyCheck();
+			LCDWriteData(display.character);
+			udelay(150);
+			BusyCheck();
+			LCDWriteInst(0x10);
+
+			break;
+		}
 
 
 	case LCD_Disp_Left:
@@ -208,294 +217,330 @@ static int lcd_ioctl(struct inode *inode, struct file *file, unsigned int cmd,
 		LCDWriteInst(0x02);
 		break;
 
-	case LCD_Write: {
-		struct lcd_display display;
-   
+	case LCD_Write:{
+			struct lcd_display display;
+
+
+			if (copy_from_user
+			    (&display, (struct lcd_display *) arg,
+			     sizeof(struct lcd_display)))
+				return -EFAULT;
 
-                if(copy_from_user(&display, (struct lcd_display*)arg, sizeof(struct lcd_display)))
-		  return -EFAULT;
- 
-		udelay(150);
-                BusyCheck();    
-                LCDWriteInst(0x80);
-		udelay(150);
-		BusyCheck();
-	
-		for (index = 0; index < (display.size1); index++) {
 			udelay(150);
-			BusyCheck();	
-			LCDWriteData( display.line1[index]);
-			BusyCheck();	
-		}		
-		
-		udelay(150);
-		BusyCheck();	
-		LCDWriteInst(0xC0);	
-		udelay(150);
-		BusyCheck();	
-                for (index = 0; index < (display.size2); index++) {
-                        udelay(150);
-                        BusyCheck();    
-                        LCDWriteData( display.line2[index]);
-		}
- 
-		break;	
-	}
-	
-	case LCD_Read: {	
-        	struct lcd_display display;
+			BusyCheck();
+			LCDWriteInst(0x80);
+			udelay(150);
+			BusyCheck();
 
-		BusyCheck();
-		for (address = kDD_R00; address <= kDD_R01; address++) {
-			a = (address | kLCD_Addr );	
+			for (index = 0; index < (display.size1); index++) {
+				udelay(150);
+				BusyCheck();
+				LCDWriteData(display.line1[index]);
+				BusyCheck();
+			}
 
 			udelay(150);
 			BusyCheck();
-			LCDWriteInst( a );
+			LCDWriteInst(0xC0);
 			udelay(150);
 			BusyCheck();
-			display.line1[address] = LCDReadData;
+			for (index = 0; index < (display.size2); index++) {
+				udelay(150);
+				BusyCheck();
+				LCDWriteData(display.line2[index]);
+			}
+
+			break;
 		}
 
-		display.line1[ 0x27 ] = '\0';
-	
-		for (address = kDD_R10; address <= kDD_R11; address++) {
-			a = (address | kLCD_Addr );     
-        
-			udelay(150);
-	 		BusyCheck();
-        		LCDWriteInst( a );
-       
-        		udelay(150);
-	 		BusyCheck();
-        		display.line2[address - 0x40 ] = LCDReadData;
-		 }
-
-		display.line2[ 0x27 ] = '\0';
-
-		if(copy_to_user((struct lcd_display*)arg, &display,
-				sizeof(struct lcd_display)))
-		  return -EFAULT;
-		break;
-	}
+	case LCD_Read:{
+			struct lcd_display display;
 
-//  set all GPIO leds to led_display.leds 
+			BusyCheck();
+			for (address = kDD_R00; address <= kDD_R01;
+			     address++) {
+				a = (address | kLCD_Addr);
+
+				udelay(150);
+				BusyCheck();
+				LCDWriteInst(a);
+				udelay(150);
+				BusyCheck();
+				display.line1[address] = LCDReadData;
+			}
 
-	case LED_Set: {	
-		struct lcd_display led_display;
-	
+			display.line1[0x27] = '\0';
 
-	        if(copy_from_user(&led_display, (struct lcd_display*)arg,
-				  sizeof(struct lcd_display)))
-		  return -EFAULT;
+			for (address = kDD_R10; address <= kDD_R11;
+			     address++) {
+				a = (address | kLCD_Addr);
 
-		led_state = led_display.leds;
-		LEDSet(led_state);
+				udelay(150);
+				BusyCheck();
+				LCDWriteInst(a);
+
+				udelay(150);
+				BusyCheck();
+				display.line2[address - 0x40] =
+				    LCDReadData;
+			}
+
+			display.line2[0x27] = '\0';
+
+			if (copy_to_user
+			    ((struct lcd_display *) arg, &display,
+			     sizeof(struct lcd_display)))
+				return -EFAULT;
+			break;
+		}
+
+//  set all GPIO leds to led_display.leds
+
+	case LED_Set:{
+			struct lcd_display led_display;
 
-        	break;
-	}
+
+			if (copy_from_user
+			    (&led_display, (struct lcd_display *) arg,
+			     sizeof(struct lcd_display)))
+				return -EFAULT;
+
+			led_state = led_display.leds;
+			LEDSet(led_state);
+
+			break;
+		}
 
 
 //  set only bit led_display.leds
 
-        case LED_Bit_Set: {
-                int i;
-		int bit=1;
-                struct lcd_display led_display;
+	case LED_Bit_Set:{
+			int i;
+			int bit = 1;
+			struct lcd_display led_display;
 
 
-                if(copy_from_user(&led_display, (struct lcd_display*)arg,
-				  sizeof(struct lcd_display)))
-		  return -EFAULT;
+			if (copy_from_user
+			    (&led_display, (struct lcd_display *) arg,
+			     sizeof(struct lcd_display)))
+				return -EFAULT;
 
-		for (i=0;i<(int)led_display.leds;i++)
-			{
-				bit = 2*bit;	
+			for (i = 0; i < (int) led_display.leds; i++) {
+				bit = 2 * bit;
 			}
 
-		led_state = led_state | bit;
-                LEDSet(led_state);
-                break;
-        }
+			led_state = led_state | bit;
+			LEDSet(led_state);
+			break;
+		}
 
 //  clear only bit led_display.leds
 
-        case LED_Bit_Clear: {
-                int i;
-		int bit=1;
-                struct lcd_display led_display;
+	case LED_Bit_Clear:{
+			int i;
+			int bit = 1;
+			struct lcd_display led_display;
 
 
-                if(copy_from_user(&led_display, (struct lcd_display*)arg,
-				  sizeof(struct lcd_display)))
-		  return -EFAULT;
+			if (copy_from_user
+			    (&led_display, (struct lcd_display *) arg,
+			     sizeof(struct lcd_display)))
+				return -EFAULT;
 
-                for (i=0;i<(int)led_display.leds;i++)
-                        {
-                                bit = 2*bit;
-                        }
+			for (i = 0; i < (int) led_display.leds; i++) {
+				bit = 2 * bit;
+			}
 
-		led_state = led_state &  ~bit;
-                LEDSet(led_state);
-                break;
-        }
+			led_state = led_state & ~bit;
+			LEDSet(led_state);
+			break;
+		}
 
 
-	case BUTTON_Read: {
-		button_display.buttons = GPIRead;
-                if(copy_to_user((struct lcd_display*)arg, &button_display, sizeof(struct lcd_display)))
-		  return -EFAULT;
-		break;
-	}
+	case BUTTON_Read:{
+			button_display.buttons = GPIRead;
+			if (copy_to_user
+			    ((struct lcd_display *) arg, &button_display,
+			     sizeof(struct lcd_display)))
+				return -EFAULT;
+			break;
+		}
 
-        case LINK_Check: {
-                button_display.buttons = *((volatile unsigned long *) (0xB0100060) );
-                if(copy_to_user((struct lcd_display*)arg, &button_display, sizeof(struct lcd_display)))
-		  return -EFAULT;
-                break;
-        }
-
-	case LINK_Check_2: {
-		int iface_num;
-
-		/* panel-utils should pass in the desired interface status is wanted for
-		 * in "buttons" of the structure.  We will set this to non-zero if the
-		 * link is in fact up for the requested interface.  --DaveM
-		 */
-		if(copy_from_user(&button_display, (struct lcd_display *)arg, sizeof(button_display)))
-		  return -EFAULT;
-		iface_num = button_display.buttons;
-#if defined(CONFIG_TULIP) && 0
-		if (iface_num >= 0 &&
-		    iface_num < MAX_INTERFACES &&
-		    linkcheck_callbacks[iface_num] != NULL) {
+	case LINK_Check:{
 			button_display.buttons =
-				linkcheck_callbacks[iface_num](linkcheck_cookies[iface_num]);
-		} else
+			    *((volatile unsigned long *) (0xB0100060));
+			if (copy_to_user
+			    ((struct lcd_display *) arg, &button_display,
+			     sizeof(struct lcd_display)))
+				return -EFAULT;
+			break;
+		}
+
+	case LINK_Check_2:{
+			int iface_num;
+
+			/* panel-utils should pass in the desired interface status is wanted for
+			 * in "buttons" of the structure.  We will set this to non-zero if the
+			 * link is in fact up for the requested interface.  --DaveM
+			 */
+			if (copy_from_user
+			    (&button_display, (struct lcd_display *) arg,
+			     sizeof(button_display)))
+				return -EFAULT;
+			iface_num = button_display.buttons;
+#if defined(CONFIG_TULIP) && 0
+			if (iface_num >= 0 &&
+			    iface_num < MAX_INTERFACES &&
+			    linkcheck_callbacks[iface_num] != NULL) {
+				button_display.buttons =
+				    linkcheck_callbacks[iface_num]
+				    (linkcheck_cookies[iface_num]);
+			} else
 #endif
-			button_display.buttons = 0;
+				button_display.buttons = 0;
 
-                if(__copy_to_user((struct lcd_display*)arg, &button_display, sizeof(struct lcd_display)))
-		  return -EFAULT;
-                break;
-	}
+			if (__copy_to_user
+			    ((struct lcd_display *) arg, &button_display,
+			     sizeof(struct lcd_display)))
+				return -EFAULT;
+			break;
+		}
 
 //  Erase the flash
 
-	case FLASH_Erase: {
+	case FLASH_Erase:{
 
-		int ctr=0;
+			int ctr = 0;
 
-		    // Chip Erase Sequence
-		WRITE_FLASH( kFlash_Addr1, kFlash_Data1 );
-		WRITE_FLASH( kFlash_Addr2, kFlash_Data2 );
-		WRITE_FLASH( kFlash_Addr1, kFlash_Erase3 );
-		WRITE_FLASH( kFlash_Addr1, kFlash_Data1 );
-		WRITE_FLASH( kFlash_Addr2, kFlash_Data2 );
-		WRITE_FLASH( kFlash_Addr1, kFlash_Erase6 );
+			// Chip Erase Sequence
+			WRITE_FLASH(kFlash_Addr1, kFlash_Data1);
+			WRITE_FLASH(kFlash_Addr2, kFlash_Data2);
+			WRITE_FLASH(kFlash_Addr1, kFlash_Erase3);
+			WRITE_FLASH(kFlash_Addr1, kFlash_Data1);
+			WRITE_FLASH(kFlash_Addr2, kFlash_Data2);
+			WRITE_FLASH(kFlash_Addr1, kFlash_Erase6);
 
-		printk( "Erasing Flash.\n");
+			printk("Erasing Flash.\n");
 
-		while ( (!dqpoll(0x00000000,0xFF)) && (!timeout(0x00000000)) ) {
-		    ctr++;
-		}
+			while ((!dqpoll(0x00000000, 0xFF))
+			       && (!timeout(0x00000000))) {
+				ctr++;
+			}
 
-		printk("\n");
-		printk("\n");
-		printk("\n");
+			printk("\n");
+			printk("\n");
+			printk("\n");
 
-		if (READ_FLASH(0x07FFF0)==0xFF) { printk("Erase Successful\r\n"); }
-		else if (timeout) { printk("Erase Timed Out\r\n"); }
+			if (READ_FLASH(0x07FFF0) == 0xFF) {
+				printk("Erase Successful\r\n");
+			} else if (timeout) {
+				printk("Erase Timed Out\r\n");
+			}
 
-	break;
-	}
+			break;
+		}
 
-// burn the flash 
-
-	case FLASH_Burn: {
-
-		volatile unsigned long burn_addr;
-		unsigned long flags;
-		int i;
-		unsigned char *rom;
-		
-
-                struct lcd_display display;
-
-                if(copy_from_user(&display, (struct lcd_display*)arg, sizeof(struct lcd_display)))
-		  return -EFAULT;
-		rom = (unsigned char *) kmalloc((128),GFP_ATOMIC);
-                if ( rom == NULL ) {
-                       printk ("broken\n");
-                       return 1;
-                   }
-
-		printk("Churning and Burning -");
-		save_flags(flags);
-		for (i=0; i<FLASH_SIZE; i=i+128) {
-
-		        if(copy_from_user(rom, display.RomImage + i, 128))
-			   return -EFAULT;
-			burn_addr = kFlashBase + i;
-			cli();
-			for ( index = 0; index < ( 128 ) ; index++ ) 
-		  	  {
-
-				WRITE_FLASH( kFlash_Addr1, kFlash_Data1 );
-		 	    	WRITE_FLASH( kFlash_Addr2, kFlash_Data2 );
-		 	    	WRITE_FLASH( kFlash_Addr1, kFlash_Prog );
-		 	    	*((volatile unsigned char *)burn_addr) = (volatile unsigned char) rom[index];
-
-		   	 	 while ( (!dqpoll(burn_addr,(volatile unsigned char) rom[index])) && (!timeout(burn_addr)) ) {
-		  	   		}
-		  	   	burn_addr++;
-		  	  }
-			restore_flags(flags);
-                	if ( *((volatile unsigned char *)(burn_addr-1)) == (volatile unsigned char) rom[index-1]  ) {
-               		 } else if (timeout) {
-                	    printk("Program timed out\r\n");
-               		 }
+// burn the flash
 
+	case FLASH_Burn:{
 
-		}
-		kfree(rom);
+			volatile unsigned long burn_addr;
+			unsigned long flags;
+			int i;
+			unsigned char *rom;
 
-	break;
-	}
 
-//  read the flash all at once 
-	
-	case FLASH_Read: {
+			struct lcd_display display;
 
-		unsigned char *user_bytes;
-                volatile unsigned long read_addr;
-                int i;
+			if (copy_from_user
+			    (&display, (struct lcd_display *) arg,
+			     sizeof(struct lcd_display)))
+				return -EFAULT;
+			rom = (unsigned char *) kmalloc((128), GFP_ATOMIC);
+			if (rom == NULL) {
+				printk("broken\n");
+				return 1;
+			}
 
-		user_bytes = &(((struct lcd_display *)arg)->RomImage[0]);
+			printk("Churning and Burning -");
+			save_flags(flags);
+			for (i = 0; i < FLASH_SIZE; i = i + 128) {
+
+				if (copy_from_user
+				    (rom, display.RomImage + i, 128))
+					return -EFAULT;
+				burn_addr = kFlashBase + i;
+				cli();
+				for (index = 0; index < (128); index++) {
+
+					WRITE_FLASH(kFlash_Addr1,
+						    kFlash_Data1);
+					WRITE_FLASH(kFlash_Addr2,
+						    kFlash_Data2);
+					WRITE_FLASH(kFlash_Addr1,
+						    kFlash_Prog);
+					*((volatile unsigned char *)
+					  burn_addr) =
+		 (volatile unsigned char) rom[index];
+
+					while ((!dqpoll
+						(burn_addr,
+						 (volatile unsigned char)
+						 rom[index]))
+					       && (!timeout(burn_addr))) {
+					}
+					burn_addr++;
+				}
+				restore_flags(flags);
+				if (*
+				    ((volatile unsigned char *) (burn_addr
+								 - 1)) ==
+				    (volatile unsigned char) rom[index -
+								 1]) {
+				} else if (timeout) {
+					printk("Program timed out\r\n");
+				}
 
-		if(!access_ok(VERIFY_WRITE, user_bytes, FLASH_SIZE))
-                         return -EFAULT;
 
-		printk("Reading Flash");
-		for (i=0; i<FLASH_SIZE; i++) {
-			unsigned char tmp_byte;
-			read_addr = kFlashBase + i;
-			tmp_byte = *((volatile unsigned char *)read_addr);
-			if(__put_user (tmp_byte, &user_bytes[i]))
-			  return -EFAULT;
+			}
+			kfree(rom);
+
+			break;
 		}
 
+//  read the flash all at once
 
-	break;
-	}
+	case FLASH_Read:{
 
+			unsigned char *user_bytes;
+			volatile unsigned long read_addr;
+			int i;
 
+			user_bytes =
+			    &(((struct lcd_display *) arg)->RomImage[0]);
 
+			if (!access_ok
+			    (VERIFY_WRITE, user_bytes, FLASH_SIZE))
+				return -EFAULT;
 
+			printk("Reading Flash");
+			for (i = 0; i < FLASH_SIZE; i++) {
+				unsigned char tmp_byte;
+				read_addr = kFlashBase + i;
+				tmp_byte =
+				    *((volatile unsigned char *)
+				      read_addr);
+				if (__put_user(tmp_byte, &user_bytes[i]))
+					return -EFAULT;
+			}
+
+
+			break;
+		}
 
 	default:
 		return 0;
-	break;
+		break;
 
 	}
 
@@ -517,7 +562,8 @@ static inline int button_pressed(void)
 {
 	unsigned long buttons = GPIRead;
 
-	if ( (buttons == BUTTON_Next) || (buttons == BUTTON_Next_B) || (buttons == BUTTON_Reset_B) )
+	if ((buttons == BUTTON_Next) || (buttons == BUTTON_Next_B)
+	    || (buttons == BUTTON_Reset_B))
 		return buttons;
 	return 0;
 }
@@ -526,22 +572,23 @@ static inline int button_pressed(void)
 
 static int lcd_waiters = 0;
 
-static long lcd_read(struct inode *inode, struct file *file, char *buf, unsigned long count)
+static long lcd_read(struct inode *inode, struct file *file, char *buf,
+		     unsigned long count)
 {
 	long buttons_now;
 
-	if(lcd_waiters > 0)
+	if (lcd_waiters > 0)
 		return -EINVAL;
 
 	lcd_waiters++;
-	while(((buttons_now = (long)button_pressed()) == 0) &&
-	      !(signal_pending(current))) {
+	while (((buttons_now = (long) button_pressed()) == 0) &&
+	       !(signal_pending(current))) {
 		current->state = TASK_INTERRUPTIBLE;
 		schedule_timeout(2 * HZ);
 	}
 	lcd_waiters--;
 
-	if(signal_pending(current))
+	if (signal_pending(current))
 		return -ERESTARTSYS;
 	return buttons_now;
 }
@@ -551,21 +598,20 @@ static long lcd_read(struct inode *inode, struct file *file, char *buf, unsigned
  */
 
 static struct file_operations lcd_fops = {
-	.read		= lcd_read,
-	.ioctl		= lcd_ioctl,
-	.open		= lcd_open,
+	.read = lcd_read,
+	.ioctl = lcd_ioctl,
+	.open = lcd_open,
 };
 
-static struct miscdevice lcd_dev=
-{
-	LCD_MINOR,
+static struct miscdevice lcd_dev = {
+	MISC_DYNAMIC_MINOR,
 	"lcd",
 	&lcd_fops
 };
 
-int lcd_init(void)
+static int lcd_init(void)
 {
-unsigned long data;
+	unsigned long data;
 
 	printk("%s\n", LCD_DRIVER);
 	misc_register(&lcd_dev);
@@ -575,19 +621,22 @@ unsigned long data;
 
 	udelay(150);
 	data = LCDReadData;
-	if ( (data & 0x000000FF) == (0x00) ) {
+	if ((data & 0x000000FF) == (0x00)) {
 		lcd_present = 0;
 		printk("LCD Not Present\n");
-	        }
-	else {
+	} else {
 		lcd_present = 1;
-		WRITE_GAL( kGal_DevBank2PReg, kGal_DevBank2Cfg );
-		WRITE_GAL( kGal_DevBank3PReg, kGal_DevBank3Cfg );
-		}
+		WRITE_GAL(kGal_DevBank2PReg, kGal_DevBank2Cfg);
+		WRITE_GAL(kGal_DevBank3PReg, kGal_DevBank3Cfg);
+	}
 
 	return 0;
 }
 
+static void __exit lcd_exit(void)
+{
+	misc_deregister(&lcd_dev);
+}
 
 //
 // Function: dqpoll
@@ -600,17 +649,15 @@ unsigned long data;
 //
 //
 
-int dqpoll( volatile unsigned long address, volatile unsigned char data ) {
-
-volatile unsigned char dq7;
-
-dq7 = data & 0x80;
+static int dqpoll(volatile unsigned long address, volatile unsigned char data)
+{
+	volatile unsigned char dq7;
 
-return ( (READ_FLASH(address) & 0x80) == dq7  );
+	dq7 = data & 0x80;
 
+	return ((READ_FLASH(address) & 0x80) == dq7);
 }
 
-
 //
 // Function: timeout
 //
@@ -622,12 +669,13 @@ return ( (READ_FLASH(address) & 0x80) == dq7  );
 //
 // Out: 0 = not timed out, 1 = timed out
 
-int timeout( volatile unsigned long address ) {
-
-
-return (  (READ_FLASH(address) & 0x20) ==  0x20 );
-
+static int timeout(volatile unsigned long address)
+{
+	return (READ_FLASH(address) & 0x20) == 0x20;
 }
 
+module_init(lcd_init);
+module_exit(lcd_exit);
 
-
+MODULE_AUTHOR("Andrew Bose");
+MODULE_LICENSE("GPL");
diff --git a/drivers/char/mem.c b/drivers/char/mem.c
index 50a32d17e..3274c3a73 100644
--- a/drivers/char/mem.c
+++ b/drivers/char/mem.c
@@ -26,7 +26,6 @@
 
 #include <asm/uaccess.h>
 #include <asm/io.h>
-#include <asm/pgalloc.h>
 
 #ifdef CONFIG_IA64
 # include <linux/efi.h>
diff --git a/drivers/char/misc.c b/drivers/char/misc.c
index a878d99f8..13b11270a 100644
--- a/drivers/char/misc.c
+++ b/drivers/char/misc.c
@@ -63,13 +63,8 @@ static DECLARE_MUTEX(misc_sem);
 #define DYNAMIC_MINORS 64 /* like dynamic majors */
 static unsigned char misc_minors[DYNAMIC_MINORS / 8];
 
-#ifdef CONFIG_SGI_NEWPORT_GFX
-extern void gfx_register(void);
-#endif
-extern void streamable_init(void);
 extern int rtc_DP8570A_init(void);
 extern int rtc_MK48T08_init(void);
-extern int ds1286_init(void);
 extern int pmu_device_init(void);
 extern int tosh_init(void);
 extern int i8k_init(void);
@@ -318,21 +313,9 @@ static int __init misc_init(void)
 #ifdef CONFIG_BVME6000
 	rtc_DP8570A_init();
 #endif
-#ifdef CONFIG_SGI_DS1286
-	ds1286_init();
-#endif
 #ifdef CONFIG_PMAC_PBOOK
 	pmu_device_init();
 #endif
-#ifdef CONFIG_SGI_NEWPORT_GFX
-	gfx_register ();
-#endif
-#ifdef CONFIG_SGI_IP22
-	streamable_init ();
-#endif
-#ifdef CONFIG_SGI_NEWPORT_GFX
-	gfx_register ();
-#endif
 #ifdef CONFIG_TOSHIBA
 	tosh_init();
 #endif
diff --git a/drivers/char/moxa.c b/drivers/char/moxa.c
index c6430cf00..0e75a0dc9 100644
--- a/drivers/char/moxa.c
+++ b/drivers/char/moxa.c
@@ -104,6 +104,7 @@ static char *moxa_brdname[] =
 	"CP-204J series",
 };
 
+#ifdef CONFIG_PCI
 static struct pci_device_id moxa_pcibrds[] = {
 	{ PCI_VENDOR_ID_MOXA, PCI_DEVICE_ID_C218, PCI_ANY_ID, PCI_ANY_ID, 
 	  0, 0, MOXA_BOARD_C218_PCI },
@@ -114,6 +115,7 @@ static struct pci_device_id moxa_pcibrds[] = {
 	{ 0 }
 };
 MODULE_DEVICE_TABLE(pci, moxa_pcibrds);
+#endif /* CONFIG_PCI */
 
 typedef struct _moxa_isa_board_conf {
 	int boardType;
@@ -190,9 +192,11 @@ static struct mxser_mstatus GMStatus[MAX_PORTS];
 static int verbose = 0;
 static int ttymajor = MOXAMAJOR;
 /* Variables for insmod */
+#ifdef MODULE
 static int baseaddr[] 	= 	{0, 0, 0, 0};
 static int type[]	=	{0, 0, 0, 0};
 static int numports[] 	=	{0, 0, 0, 0};
+#endif
 
 MODULE_AUTHOR("William Chen");
 MODULE_DESCRIPTION("MOXA Intellio Family Multiport Board Device Driver");
@@ -215,7 +219,6 @@ static struct semaphore moxaBuffSem;
 /*
  * static functions:
  */
-static int moxa_get_PCI_conf(struct pci_dev *, int, moxa_board_conf *);
 static void do_moxa_softint(void *);
 static int moxa_open(struct tty_struct *, struct file *);
 static void moxa_close(struct tty_struct *, struct file *);
@@ -272,8 +275,8 @@ static void MoxaPortTxDisable(int);
 static void MoxaPortTxEnable(int);
 static int MoxaPortResetBrkCnt(int);
 static void MoxaPortSendBreak(int, int);
-static int moxa_get_serial_info(struct moxa_str *, struct serial_struct *);
-static int moxa_set_serial_info(struct moxa_str *, struct serial_struct *);
+static int moxa_get_serial_info(struct moxa_str *, struct serial_struct __user *);
+static int moxa_set_serial_info(struct moxa_str *, struct serial_struct __user *);
 static void MoxaSetFifo(int port, int enable);
 
 static struct tty_operations moxa_ops = {
@@ -296,6 +299,32 @@ static struct tty_operations moxa_ops = {
 	.tiocmset = moxa_tiocmset,
 };
 
+#ifdef CONFIG_PCI
+static int moxa_get_PCI_conf(struct pci_dev *p, int board_type, moxa_board_conf * board)
+{
+	board->baseAddr = pci_resource_start (p, 2);
+	board->boardType = board_type;
+	switch (board_type) {
+	case MOXA_BOARD_C218_ISA:
+	case MOXA_BOARD_C218_PCI:
+		board->numPorts = 8;
+		break;
+
+	case MOXA_BOARD_CP204J:
+		board->numPorts = 4;
+		break;
+	default:
+		board->numPorts = 0;
+		break;
+	}
+	board->busType = MOXA_BUS_TYPE_PCI;
+	board->pciInfo.busNum = p->bus->number;
+	board->pciInfo.devNum = p->devfn >> 3;
+
+	return (0);
+}
+#endif /* CONFIG_PCI */
+
 static int __init moxa_init(void)
 {
 	int i, numBoards;
@@ -322,13 +351,13 @@ static int __init moxa_init(void)
 	moxaDriver->flags = TTY_DRIVER_REAL_RAW;
 	tty_set_operations(moxaDriver, &moxa_ops);
 
-	moxaXmitBuff = 0;
+	moxaXmitBuff = NULL;
 
 	for (i = 0, ch = moxaChannels; i < MAX_PORTS; i++, ch++) {
 		ch->type = PORT_16550A;
 		ch->port = i;
 		INIT_WORK(&ch->tqueue, do_moxa_softint, ch);
-		ch->tty = 0;
+		ch->tty = NULL;
 		ch->close_delay = 5 * HZ / 10;
 		ch->closing_wait = 30 * HZ;
 		ch->count = 0;
@@ -469,30 +498,6 @@ static void __exit moxa_exit(void)
 module_init(moxa_init);
 module_exit(moxa_exit);
 
-static int moxa_get_PCI_conf(struct pci_dev *p, int board_type, moxa_board_conf * board)
-{
-	board->baseAddr = pci_resource_start (p, 2);
-	board->boardType = board_type;
-	switch (board_type) {
-	case MOXA_BOARD_C218_ISA:
-	case MOXA_BOARD_C218_PCI:
-		board->numPorts = 8;
-		break;
-
-	case MOXA_BOARD_CP204J:
-		board->numPorts = 4;
-		break;
-	default:
-		board->numPorts = 0;
-		break;
-	}
-	board->busType = MOXA_BUS_TYPE_PCI;
-	board->pciInfo.busNum = p->bus->number;
-	board->pciInfo.devNum = p->devfn >> 3;
-
-	return (0);
-}
-
 static void do_moxa_softint(void *private_)
 {
 	struct moxa_str *ch = (struct moxa_str *) private_;
@@ -617,7 +622,7 @@ static void moxa_close(struct tty_struct *tty, struct file *filp)
 		tty->ldisc.flush_buffer(tty);
 	tty->closing = 0;
 	ch->event = 0;
-	ch->tty = 0;
+	ch->tty = NULL;
 	if (ch->blocked_open) {
 		if (ch->close_delay) {
 			set_current_state(TASK_INTERRUPTIBLE);
@@ -802,6 +807,7 @@ static int moxa_ioctl(struct tty_struct *tty, struct file *file,
 {
 	struct moxa_str *ch = (struct moxa_str *) tty->driver_data;
 	register int port;
+	void __user *argp = (void __user *)arg;
 	int retval;
 
 	port = PORTNO(tty);
@@ -827,9 +833,9 @@ static int moxa_ioctl(struct tty_struct *tty, struct file *file,
 		MoxaPortSendBreak(ch->port, arg);
 		return (0);
 	case TIOCGSOFTCAR:
-		return put_user(C_CLOCAL(tty) ? 1 : 0, (unsigned long *) arg);
+		return put_user(C_CLOCAL(tty) ? 1 : 0, (unsigned long __user *) argp);
 	case TIOCSSOFTCAR:
-		if(get_user(retval, (unsigned long *) arg))
+		if(get_user(retval, (unsigned long __user *) argp))
 			return -EFAULT;
 		arg = retval;
 		tty->termios->c_cflag = ((tty->termios->c_cflag & ~CLOCAL) |
@@ -840,10 +846,10 @@ static int moxa_ioctl(struct tty_struct *tty, struct file *file,
 			ch->asyncflags |= ASYNC_CHECK_CD;
 		return (0);
 	case TIOCGSERIAL:
-		return (moxa_get_serial_info(ch, (struct serial_struct *) arg));
+		return moxa_get_serial_info(ch, argp);
 
 	case TIOCSSERIAL:
-		return (moxa_set_serial_info(ch, (struct serial_struct *) arg));
+		return moxa_set_serial_info(ch, argp);
 	default:
 		retval = MoxaDriverIoctl(cmd, arg, port);
 	}
@@ -911,7 +917,7 @@ static void moxa_hangup(struct tty_struct *tty)
 	ch->event = 0;
 	ch->count = 0;
 	ch->asyncflags &= ~ASYNC_NORMAL_ACTIVE;
-	ch->tty = 0;
+	ch->tty = NULL;
 	wake_up_interruptible(&ch->open_wait);
 }
 
@@ -1158,7 +1164,7 @@ static void receive_data(struct moxa_str *ch)
 	unsigned char *charptr, *flagptr;
 	unsigned long flags;
 
-	ts = 0;
+	ts = NULL;
 	tp = ch->tty;
 	if (tp)
 		ts = tp->termios;
@@ -1517,10 +1523,10 @@ static void moxadelay(int);
 static void moxafunc(unsigned long, int, ushort);
 static void wait_finish(unsigned long);
 static void low_water_check(unsigned long);
-static int moxaloadbios(int, unsigned char *, int);
+static int moxaloadbios(int, unsigned char __user *, int);
 static int moxafindcard(int);
-static int moxaload320b(int, unsigned char *, int);
-static int moxaloadcode(int, unsigned char *, int);
+static int moxaload320b(int, unsigned char __user *, int);
+static int moxaloadcode(int, unsigned char __user *, int);
 static int moxaloadc218(int, unsigned long, int);
 static int moxaloadc320(int, unsigned long, int, int *);
 
@@ -1570,7 +1576,7 @@ struct moxaq_str {
 };
 
 struct dl_str {
-	char *buf;
+	char __user *buf;
 	int len;
 	int cardno;
 };
@@ -1596,6 +1602,7 @@ int MoxaDriverIoctl(unsigned int cmd, unsigned long arg, int port)
 	int i;
 	int status;
 	int MoxaPortTxQueue(int), MoxaPortRxQueue(int);
+	void __user *argp = (void __user *)arg;
 
 	if (port == QueryPort) {
 		if ((cmd != MOXA_GET_CONF) && (cmd != MOXA_INIT_DRIVER) &&
@@ -1607,7 +1614,7 @@ int MoxaDriverIoctl(unsigned int cmd, unsigned long arg, int port)
 	}
 	switch (cmd) {
 	case MOXA_GET_CONF:
-		if(copy_to_user((void *)arg, &moxa_boards, MAX_BOARDS * sizeof(moxa_board_conf)))
+		if(copy_to_user(argp, &moxa_boards, MAX_BOARDS * sizeof(moxa_board_conf)))
 			return -EFAULT;
 		return (0);
 	case MOXA_INIT_DRIVER:
@@ -1616,7 +1623,7 @@ int MoxaDriverIoctl(unsigned int cmd, unsigned long arg, int port)
 		return (0);
 	case MOXA_GETDATACOUNT:
 		moxaLog.tick = jiffies;
-		if(copy_to_user((void *)arg, &moxaLog, sizeof(mon_st)))
+		if(copy_to_user(argp, &moxaLog, sizeof(mon_st)))
 			return -EFAULT;
 		return (0);
 	case MOXA_FLUSH_QUEUE:
@@ -1629,22 +1636,22 @@ int MoxaDriverIoctl(unsigned int cmd, unsigned long arg, int port)
 				temp_queue[i].outq = MoxaPortTxQueue(i);
 			}
 		}
-		if(copy_to_user((void *)arg, temp_queue, sizeof(struct moxaq_str) * MAX_PORTS))
+		if(copy_to_user(argp, temp_queue, sizeof(struct moxaq_str) * MAX_PORTS))
 			return -EFAULT;
 		return (0);
 	case MOXA_GET_OQUEUE:
 		i = MoxaPortTxQueue(port);
-		return put_user(i, (unsigned long *) arg);
+		return put_user(i, (unsigned long __user *)argp);
 	case MOXA_GET_IQUEUE:
 		i = MoxaPortRxQueue(port);
-		return put_user(i, (unsigned long *) arg);
+		return put_user(i, (unsigned long __user *)argp);
 	case MOXA_GET_MAJOR:
-		if(copy_to_user((void *)arg, &ttymajor, sizeof(int)))
+		if(copy_to_user(argp, &ttymajor, sizeof(int)))
 			return -EFAULT;
 		return 0;
 	case MOXA_GET_CUMAJOR:
 		i = 0;
-		if(copy_to_user((void *)arg, &i, sizeof(int)))
+		if(copy_to_user(argp, &i, sizeof(int)))
 			return -EFAULT;
 		return 0;
 	case MOXA_GETMSTATUS:
@@ -1670,7 +1677,7 @@ int MoxaDriverIoctl(unsigned int cmd, unsigned long arg, int port)
 			else
 				GMStatus[i].cflag = moxaChannels[i].tty->termios->c_cflag;
 		}
-		if(copy_to_user((void *)arg, GMStatus, sizeof(struct mxser_mstatus) * MAX_PORTS))
+		if(copy_to_user(argp, GMStatus, sizeof(struct mxser_mstatus) * MAX_PORTS))
 			return -EFAULT;
 		return 0;
 	default:
@@ -1682,7 +1689,7 @@ int MoxaDriverIoctl(unsigned int cmd, unsigned long arg, int port)
 		break;
 	}
 
-	if(copy_from_user(&dltmp, (void *)arg, sizeof(struct dl_str)))
+	if(copy_from_user(&dltmp, argp, sizeof(struct dl_str)))
 		return -EFAULT;
 	if(dltmp.cardno < 0 || dltmp.cardno >= MAX_BOARDS)
 		return -EINVAL;
@@ -2677,12 +2684,10 @@ void MoxaPortSendBreak(int port, int ms100)
 }
 
 static int moxa_get_serial_info(struct moxa_str *info,
-				struct serial_struct *retinfo)
+				struct serial_struct __user *retinfo)
 {
 	struct serial_struct tmp;
 
-	if (!retinfo)
-		return (-EFAULT);
 	memset(&tmp, 0, sizeof(tmp));
 	tmp.type = info->type;
 	tmp.line = info->port;
@@ -2701,7 +2706,7 @@ static int moxa_get_serial_info(struct moxa_str *info,
 
 
 static int moxa_set_serial_info(struct moxa_str *info,
-				struct serial_struct *new_info)
+				struct serial_struct __user *new_info)
 {
 	struct serial_struct new_serial;
 
@@ -2790,7 +2795,7 @@ static void low_water_check(unsigned long ofsAddr)
 	}
 }
 
-static int moxaloadbios(int cardno, unsigned char *tmp, int len)
+static int moxaloadbios(int cardno, unsigned char __user *tmp, int len)
 {
 	unsigned long baseAddr;
 	int i;
@@ -2837,7 +2842,7 @@ static int moxafindcard(int cardno)
 	return (0);
 }
 
-static int moxaload320b(int cardno, unsigned char * tmp, int len)
+static int moxaload320b(int cardno, unsigned char __user *tmp, int len)
 {
 	unsigned long baseAddr;
 	int i;
@@ -2857,7 +2862,7 @@ static int moxaload320b(int cardno, unsigned char * tmp, int len)
 	return (0);
 }
 
-static int moxaloadcode(int cardno, unsigned char * tmp, int len)
+static int moxaloadcode(int cardno, unsigned char __user *tmp, int len)
 {
 	unsigned long baseAddr, ofsAddr;
 	int retval, port, i;
diff --git a/drivers/char/mwave/3780i.c b/drivers/char/mwave/3780i.c
index 0fb356e98..8832ed21d 100644
--- a/drivers/char/mwave/3780i.c
+++ b/drivers/char/mwave/3780i.c
@@ -467,10 +467,10 @@ int dsp3780I_Run(DSP_3780I_CONFIG_SETTINGS * pSettings)
 }
 
 
-int dsp3780I_ReadDStore(unsigned short usDspBaseIO, void *pvBuffer,
+int dsp3780I_ReadDStore(unsigned short usDspBaseIO, void __user *pvBuffer,
                         unsigned uCount, unsigned long ulDSPAddr)
 {
-	unsigned short *pusBuffer = pvBuffer;
+	unsigned short __user *pusBuffer = pvBuffer;
 	unsigned short val;
 
 
@@ -508,10 +508,10 @@ int dsp3780I_ReadDStore(unsigned short usDspBaseIO, void *pvBuffer,
 }
 
 int dsp3780I_ReadAndClearDStore(unsigned short usDspBaseIO,
-                                void *pvBuffer, unsigned uCount,
+                                void __user *pvBuffer, unsigned uCount,
                                 unsigned long ulDSPAddr)
 {
-	unsigned short *pusBuffer = pvBuffer;
+	unsigned short __user *pusBuffer = pvBuffer;
 	unsigned short val;
 
 
@@ -549,10 +549,10 @@ int dsp3780I_ReadAndClearDStore(unsigned short usDspBaseIO,
 }
 
 
-int dsp3780I_WriteDStore(unsigned short usDspBaseIO, void *pvBuffer,
+int dsp3780I_WriteDStore(unsigned short usDspBaseIO, void __user *pvBuffer,
                          unsigned uCount, unsigned long ulDSPAddr)
 {
-	unsigned short *pusBuffer = pvBuffer;
+	unsigned short __user *pusBuffer = pvBuffer;
 
 
 	PRINTK_5(TRACE_3780I,
@@ -590,10 +590,10 @@ int dsp3780I_WriteDStore(unsigned short usDspBaseIO, void *pvBuffer,
 }
 
 
-int dsp3780I_ReadIStore(unsigned short usDspBaseIO, void *pvBuffer,
+int dsp3780I_ReadIStore(unsigned short usDspBaseIO, void __user *pvBuffer,
                         unsigned uCount, unsigned long ulDSPAddr)
 {
-	unsigned short *pusBuffer = pvBuffer;
+	unsigned short __user *pusBuffer = pvBuffer;
 
 	PRINTK_5(TRACE_3780I,
 		"3780i::dsp3780I_ReadIStore entry usDspBaseIO %x, pusBuffer %p, uCount %x, ulDSPAddr %lx\n",
@@ -637,10 +637,10 @@ int dsp3780I_ReadIStore(unsigned short usDspBaseIO, void *pvBuffer,
 }
 
 
-int dsp3780I_WriteIStore(unsigned short usDspBaseIO, void *pvBuffer,
+int dsp3780I_WriteIStore(unsigned short usDspBaseIO, void __user *pvBuffer,
                          unsigned uCount, unsigned long ulDSPAddr)
 {
-	unsigned short *pusBuffer = pvBuffer;
+	unsigned short __user *pusBuffer = pvBuffer;
 
 	PRINTK_5(TRACE_3780I,
 		"3780i::dsp3780I_WriteIStore entry usDspBaseIO %x, pusBuffer %p, uCount %x, ulDSPAddr %lx\n",
diff --git a/drivers/char/mwave/3780i.h b/drivers/char/mwave/3780i.h
index 863289096..3e7d020d1 100644
--- a/drivers/char/mwave/3780i.h
+++ b/drivers/char/mwave/3780i.h
@@ -323,16 +323,16 @@ int dsp3780I_EnableDSP(DSP_3780I_CONFIG_SETTINGS * pSettings,
 int dsp3780I_DisableDSP(DSP_3780I_CONFIG_SETTINGS * pSettings);
 int dsp3780I_Reset(DSP_3780I_CONFIG_SETTINGS * pSettings);
 int dsp3780I_Run(DSP_3780I_CONFIG_SETTINGS * pSettings);
-int dsp3780I_ReadDStore(unsigned short usDspBaseIO, void *pvBuffer,
+int dsp3780I_ReadDStore(unsigned short usDspBaseIO, void __user *pvBuffer,
                         unsigned uCount, unsigned long ulDSPAddr);
 int dsp3780I_ReadAndClearDStore(unsigned short usDspBaseIO,
-                                void *pvBuffer, unsigned uCount,
+                                void __user *pvBuffer, unsigned uCount,
                                 unsigned long ulDSPAddr);
-int dsp3780I_WriteDStore(unsigned short usDspBaseIO, void *pvBuffer,
+int dsp3780I_WriteDStore(unsigned short usDspBaseIO, void __user *pvBuffer,
                          unsigned uCount, unsigned long ulDSPAddr);
-int dsp3780I_ReadIStore(unsigned short usDspBaseIO, void *pvBuffer,
+int dsp3780I_ReadIStore(unsigned short usDspBaseIO, void __user *pvBuffer,
                         unsigned uCount, unsigned long ulDSPAddr);
-int dsp3780I_WriteIStore(unsigned short usDspBaseIO, void *pvBuffer,
+int dsp3780I_WriteIStore(unsigned short usDspBaseIO, void __user *pvBuffer,
                          unsigned uCount, unsigned long ulDSPAddr);
 unsigned short dsp3780I_ReadMsaCfg(unsigned short usDspBaseIO,
                                    unsigned long ulMsaAddr);
diff --git a/drivers/char/mwave/mwavedd.c b/drivers/char/mwave/mwavedd.c
index f2365385c..2983c278c 100644
--- a/drivers/char/mwave/mwavedd.c
+++ b/drivers/char/mwave/mwavedd.c
@@ -94,8 +94,8 @@ static int mwave_open(struct inode *inode, struct file *file)
 	unsigned int retval = 0;
 
 	PRINTK_3(TRACE_MWAVE,
-		"mwavedd::mwave_open, entry inode %x file %x\n",
-		(int) inode, (int) file);
+		"mwavedd::mwave_open, entry inode %p file %p\n",
+		 inode, file);
 	PRINTK_2(TRACE_MWAVE,
 		"mwavedd::mwave_open, exit return retval %x\n", retval);
 
@@ -107,8 +107,8 @@ static int mwave_close(struct inode *inode, struct file *file)
 	unsigned int retval = 0;
 
 	PRINTK_3(TRACE_MWAVE,
-		"mwavedd::mwave_close, entry inode %x file %x\n",
-		(int) inode, (int) file);
+		"mwavedd::mwave_close, entry inode %p file %p\n",
+		 inode,  file);
 
 	PRINTK_2(TRACE_MWAVE, "mwavedd::mwave_close, exit retval %x\n",
 		retval);
@@ -121,10 +121,11 @@ static int mwave_ioctl(struct inode *inode, struct file *file,
 {
 	unsigned int retval = 0;
 	pMWAVE_DEVICE_DATA pDrvData = &mwave_s_mdd;
+	void __user *arg = (void __user *)ioarg;
 
 	PRINTK_5(TRACE_MWAVE,
-		"mwavedd::mwave_ioctl, entry inode %x file %x cmd %x arg %x\n",
-		(int) inode, (int) file, iocmd, (int) ioarg);
+		"mwavedd::mwave_ioctl, entry inode %p file %p cmd %x arg %x\n",
+		 inode,  file, iocmd, (int) ioarg);
 
 	switch (iocmd) {
 
@@ -164,8 +165,7 @@ static int mwave_ioctl(struct inode *inode, struct file *file,
 				" retval %x from tp3780I_QueryAbilities\n",
 				retval);
 			if (retval == 0) {
-				if( copy_to_user((char *) ioarg,
-							(char *) &rAbilities,
+				if( copy_to_user(arg, &rAbilities,
 							sizeof(MW_ABILITIES)) )
 					return -EFAULT;
 			}
@@ -179,13 +179,12 @@ static int mwave_ioctl(struct inode *inode, struct file *file,
 		case IOCTL_MW_READ_DATA:
 		case IOCTL_MW_READCLEAR_DATA: {
 			MW_READWRITE rReadData;
-			unsigned short *pusBuffer = 0;
+			unsigned short __user *pusBuffer = NULL;
 	
-			if( copy_from_user((char *) &rReadData,
-						(char *) ioarg,
+			if( copy_from_user(&rReadData, arg,
 						sizeof(MW_READWRITE)) )
 				return -EFAULT;
-			pusBuffer = (unsigned short *) (rReadData.pBuf);
+			pusBuffer = (unsigned short __user *) (rReadData.pBuf);
 	
 			PRINTK_4(TRACE_MWAVE,
 				"mwavedd::mwave_ioctl IOCTL_MW_READ_DATA,"
@@ -193,7 +192,7 @@ static int mwave_ioctl(struct inode *inode, struct file *file,
 				rReadData.ulDataLength, ioarg, pusBuffer);
 			retval = tp3780I_ReadWriteDspDStore(&pDrvData->rBDData,
 					iocmd,
-					(void *) pusBuffer,
+					pusBuffer,
 					rReadData.ulDataLength,
 					rReadData.usDspAddress);
 		}
@@ -201,12 +200,12 @@ static int mwave_ioctl(struct inode *inode, struct file *file,
 	
 		case IOCTL_MW_READ_INST: {
 			MW_READWRITE rReadData;
-			unsigned short *pusBuffer = 0;
+			unsigned short __user *pusBuffer = NULL;
 	
-			if( copy_from_user((char *) &rReadData, (char *) ioarg,
+			if( copy_from_user(&rReadData, arg,
 						sizeof(MW_READWRITE)) )
 				return -EFAULT;
-			pusBuffer = (unsigned short *) (rReadData.pBuf);
+			pusBuffer = (unsigned short __user *) (rReadData.pBuf);
 	
 			PRINTK_4(TRACE_MWAVE,
 				"mwavedd::mwave_ioctl IOCTL_MW_READ_INST,"
@@ -222,13 +221,12 @@ static int mwave_ioctl(struct inode *inode, struct file *file,
 	
 		case IOCTL_MW_WRITE_DATA: {
 			MW_READWRITE rWriteData;
-			unsigned short *pusBuffer = 0;
+			unsigned short __user *pusBuffer = NULL;
 	
-			if( copy_from_user((char *) &rWriteData,
-						(char *) ioarg,
+			if( copy_from_user(&rWriteData, arg,
 						sizeof(MW_READWRITE)) )
 				return -EFAULT;
-			pusBuffer = (unsigned short *) (rWriteData.pBuf);
+			pusBuffer = (unsigned short __user *) (rWriteData.pBuf);
 	
 			PRINTK_4(TRACE_MWAVE,
 				"mwavedd::mwave_ioctl IOCTL_MW_WRITE_DATA,"
@@ -244,13 +242,12 @@ static int mwave_ioctl(struct inode *inode, struct file *file,
 	
 		case IOCTL_MW_WRITE_INST: {
 			MW_READWRITE rWriteData;
-			unsigned short *pusBuffer = 0;
+			unsigned short __user *pusBuffer = NULL;
 	
-			if( copy_from_user((char *) &rWriteData,
-						(char *) ioarg,
+			if( copy_from_user(&rWriteData, arg,
 						sizeof(MW_READWRITE)) )
 				return -EFAULT;
-			pusBuffer = (unsigned short *) (rWriteData.pBuf);
+			pusBuffer = (unsigned short __user *)(rWriteData.pBuf);
 	
 			PRINTK_4(TRACE_MWAVE,
 				"mwavedd::mwave_ioctl IOCTL_MW_WRITE_INST,"
@@ -388,23 +385,23 @@ static int mwave_ioctl(struct inode *inode, struct file *file,
 }
 
 
-static ssize_t mwave_read(struct file *file, char *buf, size_t count,
+static ssize_t mwave_read(struct file *file, char __user *buf, size_t count,
                           loff_t * ppos)
 {
 	PRINTK_5(TRACE_MWAVE,
-		"mwavedd::mwave_read entry file %p, buf %p, count %x ppos %p\n",
+		"mwavedd::mwave_read entry file %p, buf %p, count %zx ppos %p\n",
 		file, buf, count, ppos);
 
 	return -EINVAL;
 }
 
 
-static ssize_t mwave_write(struct file *file, const char *buf,
+static ssize_t mwave_write(struct file *file, const char __user *buf,
                            size_t count, loff_t * ppos)
 {
 	PRINTK_5(TRACE_MWAVE,
 		"mwavedd::mwave_write entry file %p, buf %p,"
-		" count %x ppos %p\n",
+		" count %zx ppos %p\n",
 		file, buf, count, ppos);
 
 	return -EINVAL;
diff --git a/drivers/char/mwave/tp3780i.c b/drivers/char/mwave/tp3780i.c
index 373173de5..ab650cd6e 100644
--- a/drivers/char/mwave/tp3780i.c
+++ b/drivers/char/mwave/tp3780i.c
@@ -99,7 +99,7 @@ static void EnableSRAM(THINKPAD_BD_DATA * pBDData)
 static irqreturn_t UartInterrupt(int irq, void *dev_id, struct pt_regs *regs)
 {
 	PRINTK_3(TRACE_TP3780I,
-		"tp3780i::UartInterrupt entry irq %x dev_id %x\n", irq, (int) dev_id);
+		"tp3780i::UartInterrupt entry irq %x dev_id %p\n", irq, dev_id);
 	return IRQ_HANDLED;
 }
 
@@ -111,7 +111,7 @@ static irqreturn_t DspInterrupt(int irq, void *dev_id, struct pt_regs *regs)
 	unsigned short usIPCSource = 0, usIsolationMask, usPCNum;
 
 	PRINTK_3(TRACE_TP3780I,
-		"tp3780i::DspInterrupt entry irq %x dev_id %x\n", irq, (int) dev_id);
+		"tp3780i::DspInterrupt entry irq %x dev_id %p\n", irq, dev_id);
 
 	if (dsp3780I_GetIPCSource(usDspBaseIO, &usIPCSource) == 0) {
 		PRINTK_2(TRACE_TP3780I,
@@ -277,7 +277,7 @@ int tp3780I_ReleaseResources(THINKPAD_BD_DATA * pBDData)
 	release_region(pSettings->usDspBaseIO & (~3), 16);
 
 	if (pSettings->bInterruptClaimed) {
-		free_irq(pSettings->usDspIrq, 0);
+		free_irq(pSettings->usDspIrq, NULL);
 		pSettings->bInterruptClaimed = FALSE;
 	}
 
@@ -368,14 +368,14 @@ int tp3780I_EnableDSP(THINKPAD_BD_DATA * pBDData)
 	pSettings->bPllBypass = TP_CFG_PllBypass;
 	pSettings->usChipletEnable = TP_CFG_ChipletEnable;
 
-	if (request_irq(pSettings->usUartIrq, &UartInterrupt, 0, "mwave_uart", 0)) {
+	if (request_irq(pSettings->usUartIrq, &UartInterrupt, 0, "mwave_uart", NULL)) {
 		PRINTK_ERROR(KERN_ERR_MWAVE "tp3780i::tp3780I_EnableDSP: Error: Could not get UART IRQ %x\n", pSettings->usUartIrq);
 		goto exit_cleanup;
 	} else {		/* no conflict just release */
-		free_irq(pSettings->usUartIrq, 0);
+		free_irq(pSettings->usUartIrq, NULL);
 	}
 
-	if (request_irq(pSettings->usDspIrq, &DspInterrupt, 0, "mwave_3780i", 0)) {
+	if (request_irq(pSettings->usDspIrq, &DspInterrupt, 0, "mwave_3780i", NULL)) {
 		PRINTK_ERROR("tp3780i::tp3780I_EnableDSP: Error: Could not get 3780i IRQ %x\n", pSettings->usDspIrq);
 		goto exit_cleanup;
 	} else {
@@ -416,7 +416,7 @@ exit_cleanup:
 	if (bDSPPoweredUp)
 		smapi_set_DSP_power_state(FALSE);
 	if (bInterruptAllocated) {
-		free_irq(pSettings->usDspIrq, 0);
+		free_irq(pSettings->usDspIrq, NULL);
 		pSettings->bInterruptClaimed = FALSE;
 	}
 	return -EIO;
@@ -433,7 +433,7 @@ int tp3780I_DisableDSP(THINKPAD_BD_DATA * pBDData)
 	if (pBDData->bDSPEnabled) {
 		dsp3780I_DisableDSP(&pBDData->rDspSettings);
 		if (pSettings->bInterruptClaimed) {
-			free_irq(pSettings->usDspIrq, 0);
+			free_irq(pSettings->usDspIrq, NULL);
 			pSettings->bInterruptClaimed = FALSE;
 		}
 		smapi_set_DSP_power_state(FALSE);
@@ -522,7 +522,7 @@ int tp3780I_QueryAbilities(THINKPAD_BD_DATA * pBDData, MW_ABILITIES * pAbilities
 }
 
 int tp3780I_ReadWriteDspDStore(THINKPAD_BD_DATA * pBDData, unsigned int uOpcode,
-                               void *pvBuffer, unsigned int uCount,
+                               void __user *pvBuffer, unsigned int uCount,
                                unsigned long ulDSPAddr)
 {
 	int retval = 0;
@@ -558,7 +558,7 @@ int tp3780I_ReadWriteDspDStore(THINKPAD_BD_DATA * pBDData, unsigned int uOpcode,
 
 
 int tp3780I_ReadWriteDspIStore(THINKPAD_BD_DATA * pBDData, unsigned int uOpcode,
-                               void *pvBuffer, unsigned int uCount,
+                               void __user *pvBuffer, unsigned int uCount,
                                unsigned long ulDSPAddr)
 {
 	int retval = 0;
diff --git a/drivers/char/mwave/tp3780i.h b/drivers/char/mwave/tp3780i.h
index fc049acc8..07685b685 100644
--- a/drivers/char/mwave/tp3780i.h
+++ b/drivers/char/mwave/tp3780i.h
@@ -93,10 +93,10 @@ int tp3780I_StartDSP(THINKPAD_BD_DATA * pBDData);
 int tp3780I_QueryAbilities(THINKPAD_BD_DATA * pBDData, MW_ABILITIES * pAbilities);
 int tp3780I_Cleanup(THINKPAD_BD_DATA * pBDData);
 int tp3780I_ReadWriteDspDStore(THINKPAD_BD_DATA * pBDData, unsigned int uOpcode,
-                               void *pvBuffer, unsigned int uCount,
+                               void __user *pvBuffer, unsigned int uCount,
                                unsigned long ulDSPAddr);
 int tp3780I_ReadWriteDspIStore(THINKPAD_BD_DATA * pBDData, unsigned int uOpcode,
-                               void *pvBuffer, unsigned int uCount,
+                               void __user *pvBuffer, unsigned int uCount,
                                unsigned long ulDSPAddr);
 
 
diff --git a/drivers/char/mxser.c b/drivers/char/mxser.c
index 64ffd8d31..d4ba62a29 100644
--- a/drivers/char/mxser.c
+++ b/drivers/char/mxser.c
@@ -198,6 +198,7 @@ static int mxser_numports[] =
 #define         MOXA_GET_CUMAJOR      (MOXA + 64)
 #define         MOXA_GETMSTATUS       (MOXA + 65)
 
+#ifdef CONFIG_PCI
 static struct pci_device_id mxser_pcibrds[] = {
 	{ PCI_VENDOR_ID_MOXA, PCI_DEVICE_ID_C168, PCI_ANY_ID, PCI_ANY_ID, 0, 0, 
 	  MXSER_BOARD_C168_PCI },
@@ -214,6 +215,7 @@ static struct pci_device_id mxser_pcibrds[] = {
 	{ 0 }
 };
 MODULE_DEVICE_TABLE(pci, mxser_pcibrds);
+#endif /* CONFIG_PCI */
 
 static int ioaddr[MXSER_BOARDS];
 static int ttymajor = MXSERMAJOR;
@@ -330,7 +332,6 @@ struct mxser_hwconf mxsercfg[MXSER_BOARDS];
 
 static void mxser_getcfg(int board, struct mxser_hwconf *hwconf);
 static int mxser_get_ISA_conf(int, struct mxser_hwconf *);
-static int mxser_get_PCI_conf(struct pci_dev *, int, struct mxser_hwconf *);
 static void mxser_do_softint(void *);
 static int mxser_open(struct tty_struct *, struct file *);
 static void mxser_close(struct tty_struct *, struct file *);
@@ -356,9 +357,9 @@ static int mxser_block_til_ready(struct tty_struct *, struct file *, struct mxse
 static int mxser_startup(struct mxser_struct *);
 static void mxser_shutdown(struct mxser_struct *);
 static int mxser_change_speed(struct mxser_struct *, struct termios *old_termios);
-static int mxser_get_serial_info(struct mxser_struct *, struct serial_struct *);
-static int mxser_set_serial_info(struct mxser_struct *, struct serial_struct *);
-static int mxser_get_lsr_info(struct mxser_struct *, unsigned int *);
+static int mxser_get_serial_info(struct mxser_struct *, struct serial_struct __user *);
+static int mxser_set_serial_info(struct mxser_struct *, struct serial_struct __user *);
+static int mxser_get_lsr_info(struct mxser_struct *, unsigned int __user *);
 static void mxser_send_break(struct mxser_struct *, int);
 static int mxser_tiocmget(struct tty_struct *, struct file *);
 static int mxser_tiocmset(struct tty_struct *, struct file *, unsigned int, unsigned int);
@@ -461,6 +462,7 @@ static void mxser_getcfg(int board, struct mxser_hwconf *hwconf)
 	mxsercfg[board] = *hwconf;
 }
 
+#ifdef CONFIG_PCI
 static int mxser_get_PCI_conf(struct pci_dev *pdev, int board_type, struct mxser_hwconf *hwconf)
 {
 	int i;
@@ -485,6 +487,7 @@ static int mxser_get_PCI_conf(struct pci_dev *pdev, int board_type, struct mxser
 	}
 	return (0);
 }
+#endif /* CONFIG_PCI */
 
 static struct tty_operations mxser_ops = {
 	.open = mxser_open,
@@ -614,7 +617,6 @@ static int __init mxser_module_init(void)
 	{
 		struct pci_dev *pdev = NULL;
 		int n = (sizeof(mxser_pcibrds) / sizeof(mxser_pcibrds[0])) - 1;
-		int index = 0;
 		for (b = 0; b < n; b++) {
 			while ((pdev = pci_find_device(mxser_pcibrds[b].vendor, mxser_pcibrds[b].device, pdev)))
 			{
@@ -819,7 +821,7 @@ static void mxser_close(struct tty_struct *tty, struct file *filp)
 		tty->ldisc.flush_buffer(tty);
 	tty->closing = 0;
 	info->event = 0;
-	info->tty = 0;
+	info->tty = NULL;
 	if (info->blocked_open) {
 		if (info->close_delay) {
 			set_current_state(TASK_INTERRUPTIBLE);
@@ -986,8 +988,9 @@ static int mxser_ioctl(struct tty_struct *tty, struct file *file,
 	struct mxser_struct *info = (struct mxser_struct *) tty->driver_data;
 	int retval;
 	struct async_icount cprev, cnow;	/* kernel counter temps */
-	struct serial_icounter_struct *p_cuser;		/* user space */
+	struct serial_icounter_struct __user *p_cuser;
 	unsigned long templ;
+	void __user *argp = (void __user *)arg;
 
 	if (PORTNO(tty) == MXSER_PORTS)
 		return (mxser_ioctl_special(cmd, arg));
@@ -1013,20 +1016,20 @@ static int mxser_ioctl(struct tty_struct *tty, struct file *file,
 		mxser_send_break(info, arg ? arg * (HZ / 10) : HZ / 4);
 		return (0);
 	case TIOCGSOFTCAR:
-		return put_user(C_CLOCAL(tty) ? 1 : 0, (unsigned long *) arg);
+		return put_user(C_CLOCAL(tty) ? 1 : 0, (unsigned long __user *)argp);
 	case TIOCSSOFTCAR:
-		if(get_user(templ, (unsigned long *) arg))
+		if(get_user(templ, (unsigned long __user *) arg))
 			return -EFAULT;
 		arg = templ;
 		tty->termios->c_cflag = ((tty->termios->c_cflag & ~CLOCAL) |
 					 (arg ? CLOCAL : 0));
 		return (0);
 	case TIOCGSERIAL:
-		return (mxser_get_serial_info(info, (struct serial_struct *) arg));
+		return mxser_get_serial_info(info, argp);
 	case TIOCSSERIAL:
-		return (mxser_set_serial_info(info, (struct serial_struct *) arg));
+		return mxser_set_serial_info(info, argp);
 	case TIOCSERGETLSR:	/* Get line status register */
-		return (mxser_get_lsr_info(info, (unsigned int *) arg));
+		return mxser_get_lsr_info(info, argp);
 		/*
 		 * Wait for any of the 4 modem inputs (DCD,RI,DSR,CTS) to change
 		 * - mask passed in arg for lines of interest
@@ -1070,7 +1073,7 @@ static int mxser_ioctl(struct tty_struct *tty, struct file *file,
 		cli();
 		cnow = info->icount;
 		restore_flags(flags);
-		p_cuser = (struct serial_icounter_struct *) arg;
+		p_cuser = argp;
 		if(put_user(cnow.cts, &p_cuser->cts))
 			return -EFAULT;
 		if(put_user(cnow.dsr, &p_cuser->dsr))
@@ -1079,7 +1082,7 @@ static int mxser_ioctl(struct tty_struct *tty, struct file *file,
 			return -EFAULT;
 		return put_user(cnow.dcd, &p_cuser->dcd);
 	case MOXA_HighSpeedOn:
-		return put_user(info->baud_base != 115200 ? 1 : 0, (int *) arg);
+		return put_user(info->baud_base != 115200 ? 1 : 0, (int __user *)argp);
 	default:
 		return (-ENOIOCTLCMD);
 	}
@@ -1089,21 +1092,22 @@ static int mxser_ioctl(struct tty_struct *tty, struct file *file,
 static int mxser_ioctl_special(unsigned int cmd, unsigned long arg)
 {
 	int i, result, status;
+	void __user *argp = (void __user *)arg;
 
 	switch (cmd) {
 	case MOXA_GET_CONF:
-		if(copy_to_user((struct mxser_hwconf *) arg, mxsercfg,
+		if(copy_to_user(argp, mxsercfg,
 			     sizeof(struct mxser_hwconf) * 4))
 			     	return -EFAULT;
 		return 0;
 	case MOXA_GET_MAJOR:
-		if(copy_to_user((int *) arg, &ttymajor, sizeof(int)))
+		if(copy_to_user(argp, &ttymajor, sizeof(int)))
 			return -EFAULT;
 		return 0;
 
 	case MOXA_GET_CUMAJOR:
 		result = 0;
-		if(copy_to_user((int *) arg, &result, sizeof(int)))
+		if(copy_to_user(argp, &result, sizeof(int)))
 			return -EFAULT;
 		return 0;
 
@@ -1113,9 +1117,9 @@ static int mxser_ioctl_special(unsigned int cmd, unsigned long arg)
 			if (mxvar_table[i].base)
 				result |= (1 << i);
 		}
-		return put_user(result, (unsigned long *) arg);
+		return put_user(result, (unsigned long __user *) argp);
 	case MOXA_GETDATACOUNT:
-		if(copy_to_user((struct mxser_log *) arg, &mxvar_log, sizeof(mxvar_log)))
+		if (copy_to_user(argp, &mxvar_log, sizeof(mxvar_log)))
 			return -EFAULT;
 		return (0);
 	case MOXA_GETMSTATUS:
@@ -1149,7 +1153,7 @@ static int mxser_ioctl_special(unsigned int cmd, unsigned long arg)
 			else
 				GMStatus[i].cts = 0;
 		}
-		if(copy_to_user((struct mxser_mstatus *) arg, GMStatus,
+		if(copy_to_user(argp, GMStatus,
 			     sizeof(struct mxser_mstatus) * MXSER_PORTS))
 			return -EFAULT;
 		return 0;
@@ -1299,7 +1303,7 @@ void mxser_hangup(struct tty_struct *tty)
 	info->event = 0;
 	info->count = 0;
 	info->flags &= ~ASYNC_NORMAL_ACTIVE;
-	info->tty = 0;
+	info->tty = NULL;
 	wake_up_interruptible(&info->open_wait);
 }
 
@@ -1315,7 +1319,7 @@ static irqreturn_t mxser_interrupt(int irq, void *dev_id, struct pt_regs *regs)
 	int pass_counter = 0;
 	int handled = 0;
 
-	port = 0;
+	port = NULL;
 	for (i = 0; i < MXSER_BOARDS; i++) {
 		if (dev_id == &(mxvar_table[i * MXSER_PORTS_PER_BOARD])) {
 			port = dev_id;
@@ -1663,7 +1667,7 @@ static int mxser_startup(struct mxser_struct *info)
 	/*
 	 * and set the speed of the serial port
 	 */
-	mxser_change_speed(info, 0);
+	mxser_change_speed(info, NULL);
 
 	info->flags |= ASYNC_INITIALIZED;
 	restore_flags(flags);
@@ -1695,7 +1699,7 @@ static void mxser_shutdown(struct mxser_struct *info)
 	 */
 	if (info->xmit_buf) {
 		free_page((unsigned long) info->xmit_buf);
-		info->xmit_buf = 0;
+		info->xmit_buf = NULL;
 	}
 	info->IER = 0;
 	outb(0x00, info->base + UART_IER);	/* disable all intrs */
@@ -2046,7 +2050,7 @@ static int mxser_change_speed(struct mxser_struct *info,
  * ------------------------------------------------------------
  */
 static int mxser_get_serial_info(struct mxser_struct *info,
-				 struct serial_struct *retinfo)
+				 struct serial_struct __user *retinfo)
 {
 	struct serial_struct tmp;
 
@@ -2067,7 +2071,7 @@ static int mxser_get_serial_info(struct mxser_struct *info,
 }
 
 static int mxser_set_serial_info(struct mxser_struct *info,
-				 struct serial_struct *new_info)
+				 struct serial_struct __user *new_info)
 {
 	struct serial_struct new_serial;
 	unsigned int flags;
@@ -2108,7 +2112,7 @@ static int mxser_set_serial_info(struct mxser_struct *info,
 
 	if (info->flags & ASYNC_INITIALIZED) {
 		if (flags != (info->flags & ASYNC_SPD_MASK)) {
-			mxser_change_speed(info, 0);
+			mxser_change_speed(info, NULL);
 		}
 	} else
 		retval = mxser_startup(info);
@@ -2125,7 +2129,7 @@ static int mxser_set_serial_info(struct mxser_struct *info,
  *          transmit holding register is empty.  This functionality
  *          allows an RS485 driver to be written in user space.
  */
-static int mxser_get_lsr_info(struct mxser_struct *info, unsigned int *value)
+static int mxser_get_lsr_info(struct mxser_struct *info, unsigned int __user *value)
 {
 	unsigned char status;
 	unsigned int result;
diff --git a/drivers/char/n_hdlc.c b/drivers/char/n_hdlc.c
index 328f2701c..3e10c700d 100644
--- a/drivers/char/n_hdlc.c
+++ b/drivers/char/n_hdlc.c
@@ -182,9 +182,9 @@ static ssize_t maxframe = 4096;
 /* TTY callbacks */
 
 static ssize_t n_hdlc_tty_read(struct tty_struct *tty, struct file *file,
-			   __u8 *buf, size_t nr);
+			   __u8 __user *buf, size_t nr);
 static ssize_t n_hdlc_tty_write(struct tty_struct *tty, struct file *file,
-			    const __u8 *buf, size_t nr);
+			    const __u8 __user *buf, size_t nr);
 static int n_hdlc_tty_ioctl(struct tty_struct *tty, struct file *file,
 			    unsigned int cmd, unsigned long arg);
 static unsigned int n_hdlc_tty_poll(struct tty_struct *tty, struct file *filp,
@@ -294,7 +294,7 @@ static void n_hdlc_tty_close(struct tty_struct *tty)
 #endif
 		tty->disc_data = NULL;
 		if (tty == n_hdlc->backup_tty)
-			n_hdlc->backup_tty = 0;
+			n_hdlc->backup_tty = NULL;
 		if (tty != n_hdlc->tty)
 			return;
 		if (n_hdlc->backup_tty) {
@@ -572,7 +572,7 @@ static void n_hdlc_tty_receive(struct tty_struct *tty, const __u8 *data,
  * Returns the number of bytes returned or error code.
  */
 static ssize_t n_hdlc_tty_read(struct tty_struct *tty, struct file *file,
-			   __u8 *buf, size_t nr)
+			   __u8 __user *buf, size_t nr)
 {
 	struct n_hdlc *n_hdlc = tty2n_hdlc(tty);
 	int error;
@@ -649,7 +649,7 @@ static ssize_t n_hdlc_tty_read(struct tty_struct *tty, struct file *file,
  * Returns the number of bytes written (or error code).
  */
 static ssize_t n_hdlc_tty_write(struct tty_struct *tty, struct file *file,
-			    const __u8 *data, size_t count)
+			    const __u8 __user *data, size_t count)
 {
 	struct n_hdlc *n_hdlc = tty2n_hdlc (tty);
 	int error = 0;
@@ -755,7 +755,7 @@ static int n_hdlc_tty_ioctl(struct tty_struct *tty, struct file *file,
 		else
 			count = 0;
 		spin_unlock_irqrestore(&n_hdlc->rx_buf_list.spinlock,flags);
-		error = put_user(count, (int *)arg);
+		error = put_user(count, (int __user *)arg);
 		break;
 
 	case TIOCOUTQ:
@@ -767,7 +767,7 @@ static int n_hdlc_tty_ioctl(struct tty_struct *tty, struct file *file,
 		if (n_hdlc->tx_buf_list.head)
 			count += n_hdlc->tx_buf_list.head->count;
 		spin_unlock_irqrestore(&n_hdlc->tx_buf_list.spinlock,flags);
-		error = put_user(count, (int*)arg);
+		error = put_user(count, (int __user *)arg);
 		break;
 
 	default:
@@ -829,7 +829,7 @@ static struct n_hdlc *n_hdlc_alloc(void)
 	struct n_hdlc *n_hdlc = kmalloc(sizeof(*n_hdlc), GFP_KERNEL);
 
 	if (!n_hdlc)
-		return 0;
+		return NULL;
 
 	memset(n_hdlc, 0, sizeof(*n_hdlc));
 
diff --git a/drivers/char/n_r3964.c b/drivers/char/n_r3964.c
index e3a50dacd..e24b7efaf 100644
--- a/drivers/char/n_r3964.c
+++ b/drivers/char/n_r3964.c
@@ -126,7 +126,7 @@ static void receive_char(struct r3964_info *pInfo, const unsigned char c);
 static void receive_error(struct r3964_info *pInfo, const char flag);
 static void on_timeout(unsigned long priv);
 static int enable_signals(struct r3964_info *pInfo, pid_t pid, int arg);
-static int read_telegram(struct r3964_info *pInfo, pid_t pid, unsigned char *buf);
+static int read_telegram(struct r3964_info *pInfo, pid_t pid, unsigned char __user *buf);
 static void add_msg(struct r3964_client_info *pClient, int msg_id, int arg,
              int error_code, struct r3964_block_header *pBlock);
 static struct r3964_message* remove_msg(struct r3964_info *pInfo, 
@@ -137,9 +137,9 @@ static void remove_client_block(struct r3964_info *pInfo,
 static int  r3964_open(struct tty_struct *tty);
 static void r3964_close(struct tty_struct *tty);
 static ssize_t r3964_read(struct tty_struct *tty, struct file *file,
-                     unsigned char *buf, size_t nr);
+                     unsigned char __user *buf, size_t nr);
 static ssize_t r3964_write(struct tty_struct * tty, struct file * file,
-                      const unsigned char * buf, size_t nr);
+                      const unsigned char __user * buf, size_t nr);
 static int r3964_ioctl(struct tty_struct * tty, struct file * file,
                        unsigned int cmd, unsigned long arg);
 static void r3964_set_termios(struct tty_struct *tty, struct termios * old);
@@ -910,7 +910,7 @@ static int enable_signals(struct r3964_info *pInfo, pid_t pid, int arg)
    return 0;
 }
 
-static int read_telegram(struct r3964_info *pInfo, pid_t pid, unsigned char *buf)
+static int read_telegram(struct r3964_info *pInfo, pid_t pid, unsigned char __user *buf)
 {
     struct r3964_client_info *pClient;
     struct r3964_block_header *block;
@@ -1185,7 +1185,7 @@ static void r3964_close(struct tty_struct *tty)
 }
 
 static ssize_t r3964_read(struct tty_struct *tty, struct file *file,
-			  unsigned char *buf, size_t nr)
+			  unsigned char __user *buf, size_t nr)
 {
    struct r3964_info *pInfo=(struct r3964_info*)tty->disc_data;
    struct r3964_client_info *pClient;
@@ -1246,7 +1246,7 @@ repeat:
 }
 
 static ssize_t r3964_write(struct tty_struct * tty, struct file * file,
-			   const unsigned char *data, size_t count)
+			   const unsigned char __user *data, size_t count)
 {
    struct r3964_info *pInfo=(struct r3964_info*)tty->disc_data;
    struct r3964_block_header *pHeader;
@@ -1348,7 +1348,7 @@ static int r3964_ioctl(struct tty_struct * tty, struct file * file,
             pInfo->flags &= ~R3964_BCC;
          return 0;
       case R3964_READ_TELEGRAM:
-         return read_telegram(pInfo, current->pid, (unsigned char *)arg);
+         return read_telegram(pInfo, current->pid, (unsigned char __user *)arg);
       default:
          return -ENOIOCTLCMD;
    }
diff --git a/drivers/char/n_tty.c b/drivers/char/n_tty.c
index 9382646e8..072197462 100644
--- a/drivers/char/n_tty.c
+++ b/drivers/char/n_tty.c
@@ -62,17 +62,12 @@
 
 static inline unsigned char *alloc_buf(void)
 {
-	unsigned char *p;
 	int prio = in_interrupt() ? GFP_ATOMIC : GFP_KERNEL;
 
-	if (PAGE_SIZE != N_TTY_BUF_SIZE) {
-		p = kmalloc(N_TTY_BUF_SIZE, prio);
-		if (p)
-			memset(p, 0, N_TTY_BUF_SIZE);
-	} else
-		p = (unsigned char *)get_zeroed_page(prio);
-
-	return p;
+	if (PAGE_SIZE != N_TTY_BUF_SIZE)
+		return kmalloc(N_TTY_BUF_SIZE, prio);
+	else
+		return (unsigned char *)__get_free_page(prio);
 }
 
 static inline void free_buf(unsigned char *buf)
@@ -903,7 +898,7 @@ static void n_tty_close(struct tty_struct *tty)
 	n_tty_flush_buffer(tty);
 	if (tty->read_buf) {
 		free_buf(tty->read_buf);
-		tty->read_buf = 0;
+		tty->read_buf = NULL;
 	}
 }
 
@@ -920,7 +915,7 @@ static int n_tty_open(struct tty_struct *tty)
 	memset(tty->read_buf, 0, N_TTY_BUF_SIZE);
 	reset_buffer_flags(tty);
 	tty->column = 0;
-	n_tty_set_termios(tty, 0);
+	n_tty_set_termios(tty, NULL);
 	tty->minimum_to_wake = 1;
 	tty->closing = 0;
 	return 0;
diff --git a/drivers/char/nvram.c b/drivers/char/nvram.c
index b5f32d65e..e4d24e068 100644
--- a/drivers/char/nvram.c
+++ b/drivers/char/nvram.c
@@ -467,7 +467,7 @@ nvram_init(void)
 		    NVRAM_MINOR);
 		goto out;
 	}
-	if (!create_proc_read_entry("driver/nvram", 0, 0, nvram_read_proc,
+	if (!create_proc_read_entry("driver/nvram", 0, NULL, nvram_read_proc,
 		NULL)) {
 		printk(KERN_ERR "nvram: can't create /proc/driver/nvram\n");
 		ret = -ENOMEM;
@@ -485,7 +485,7 @@ nvram_init(void)
 static void __exit
 nvram_cleanup_module(void)
 {
-	remove_proc_entry("driver/nvram", 0);
+	remove_proc_entry("driver/nvram", NULL);
 	misc_deregister(&nvram_dev);
 }
 
diff --git a/drivers/char/nwbutton.c b/drivers/char/nwbutton.c
index 513777e53..4083b781a 100644
--- a/drivers/char/nwbutton.c
+++ b/drivers/char/nwbutton.c
@@ -170,7 +170,7 @@ static irqreturn_t button_handler (int irq, void *dev_id, struct pt_regs *regs)
  * device at any one time.
  */
 
-static int button_read (struct file *filp, char *buffer,
+static int button_read (struct file *filp, char __user *buffer,
 			size_t count, loff_t *ppos)
 {
 	interruptible_sleep_on (&button_wait_queue);
diff --git a/drivers/char/nwbutton.h b/drivers/char/nwbutton.h
index 91176b509..ddb7b928d 100644
--- a/drivers/char/nwbutton.h
+++ b/drivers/char/nwbutton.h
@@ -26,8 +26,6 @@ struct button_callback {
 
 static void button_sequence_finished (unsigned long parameters);
 static irqreturn_t button_handler (int irq, void *dev_id, struct pt_regs *regs);
-static int button_read (struct file *filp, char *buffer,
-			size_t count, loff_t *ppos);
 int button_init (void);
 int button_add_callback (void (*callback) (void), int count);
 int button_del_callback (void (*callback) (void));
diff --git a/drivers/char/nwflash.c b/drivers/char/nwflash.c
index 8cffbf0d6..e75381ec1 100644
--- a/drivers/char/nwflash.c
+++ b/drivers/char/nwflash.c
@@ -43,11 +43,7 @@
 static void kick_open(void);
 static int get_flash_id(void);
 static int erase_block(int nBlock);
-static int write_block(unsigned long p, const char *buf, int count);
-static int flash_ioctl(struct inode *inodep, struct file *filep, unsigned int cmd, unsigned long arg);
-static ssize_t flash_read(struct file *file, char *buf, size_t count, loff_t * ppos);
-static ssize_t flash_write(struct file *file, const char *buf, size_t count, loff_t * ppos);
-static loff_t flash_llseek(struct file *file, loff_t offset, int orig);
+static int write_block(unsigned long p, const char __user *buf, int count);
 
 #define KFLASH_SIZE	1024*1024	//1 Meg
 #define KFLASH_SIZE4	4*1024*1024	//4 Meg
@@ -132,15 +128,16 @@ static int flash_ioctl(struct inode *inodep, struct file *filep, unsigned int cm
 	return 0;
 }
 
-static ssize_t flash_read(struct file *file, char *buf, size_t size, loff_t * ppos)
+static ssize_t flash_read(struct file *file, char __user *buf, size_t size,
+			  loff_t *ppos)
 {
 	unsigned long p = *ppos;
 	unsigned int count = size;
 	int ret = 0;
 
 	if (flashdebug)
-		printk(KERN_DEBUG "flash_read: flash_read: offset=0x%lX, buffer=%p, count=0x%X.\n",
-		       p, buf, count);
+		printk(KERN_DEBUG "flash_read: flash_read: offset=0x%lX, "
+		       "buffer=%p, count=0x%X.\n", p, buf, count);
 
 	if (count)
 		ret = -ENXIO;
@@ -166,7 +163,8 @@ static ssize_t flash_read(struct file *file, char *buf, size_t size, loff_t * pp
 	return ret;
 }
 
-static ssize_t flash_write(struct file *file, const char *buf, size_t size, loff_t * ppos)
+static ssize_t flash_write(struct file *file, const char __user *buf,
+			   size_t size, loff_t * ppos)
 {
 	unsigned long p = *ppos;
 	unsigned int count = size;
@@ -244,8 +242,9 @@ static ssize_t flash_write(struct file *file, const char *buf, size_t size, loff
 			break;
 		}
 		if (flashdebug)
-			printk(KERN_DEBUG "flash_write: writing offset %lX, from buf "
-				"%p, bytes left %X.\n", p, buf, count - written);
+			printk(KERN_DEBUG "flash_write: writing offset %lX, "
+			       "from buf %p, bytes left %X.\n", p, buf,
+			       count - written);
 
 		/*
 		 * write_block will limit write to space left in this block
@@ -460,7 +459,7 @@ static int erase_block(int nBlock)
 /*
  * write_block will limit number of bytes written to the space in this block
  */
-static int write_block(unsigned long p, const char *buf, int count)
+static int write_block(unsigned long p, const char __user *buf, int count)
 {
 	volatile unsigned int c1;
 	volatile unsigned int c2;
diff --git a/drivers/char/pcmcia/synclink_cs.c b/drivers/char/pcmcia/synclink_cs.c
index 970e2331a..cb1cfb0af 100644
--- a/drivers/char/pcmcia/synclink_cs.c
+++ b/drivers/char/pcmcia/synclink_cs.c
@@ -257,6 +257,11 @@ typedef struct _mgslpc_info {
     
 #define CHA     0x00   /* channel A offset */
 #define CHB     0x40   /* channel B offset */
+
+/*
+ *  FIXME: PPC has PVR defined in asm/reg.h.  For now we just undef it.
+ */
+#undef PVR
     
 #define RXFIFO  0
 #define TXFIFO  0
@@ -849,9 +854,8 @@ static inline int mgslpc_paranoia_check(MGSLPC_INFO *info,
 static BOOLEAN wait_command_complete(MGSLPC_INFO *info, unsigned char channel) 
 {
 	int i = 0;
-	unsigned char status;
 	/* wait for command completion */ 
-	while ((status = read_reg(info, (unsigned char)(channel+STAR)) & BIT2)) {
+	while (read_reg(info, (unsigned char)(channel+STAR)) & BIT2) {
 		udelay(1);
 		if (i++ == 1000)
 			return FALSE;
@@ -1513,7 +1517,7 @@ static void shutdown(MGSLPC_INFO * info)
 
 	if (info->tx_buf) {
 		free_page((unsigned long) info->tx_buf);
-		info->tx_buf = 0;
+		info->tx_buf = NULL;
 	}
 
 	spin_lock_irqsave(&info->lock,flags);
@@ -2591,7 +2595,7 @@ static void mgslpc_close(struct tty_struct *tty, struct file * filp)
 	shutdown(info);
 	
 	tty->closing = 0;
-	info->tty = 0;
+	info->tty = NULL;
 	
 	if (info->blocked_open) {
 		if (info->close_delay) {
@@ -2695,7 +2699,7 @@ static void mgslpc_hangup(struct tty_struct *tty)
 	
 	info->count = 0;	
 	info->flags &= ~ASYNC_NORMAL_ACTIVE;
-	info->tty = 0;
+	info->tty = NULL;
 
 	wake_up_interruptible(&info->open_wait);
 }
@@ -2872,7 +2876,7 @@ static int mgslpc_open(struct tty_struct *tty, struct file * filp)
 cleanup:			
 	if (retval) {
 		if (tty->count == 1)
-			info->tty = 0; /* tty layer will release tty struct */
+			info->tty = NULL;/* tty layer will release tty struct */
 		if(info->count)
 			info->count--;
 	}
diff --git a/drivers/char/pty.c b/drivers/char/pty.c
index 4cea8c05c..fcbb32547 100644
--- a/drivers/char/pty.c
+++ b/drivers/char/pty.c
@@ -144,14 +144,14 @@ static int pty_write(struct tty_struct * tty, int from_user,
 			buf   += n; 
 			c     += n;
 			count -= n;
-			to->ldisc.receive_buf(to, temp_buffer, 0, n);
+			to->ldisc.receive_buf(to, temp_buffer, NULL, n);
 		}
 		up(&tty->flip.pty_sem);
 	} else {
 		c = to->ldisc.receive_room(to);
 		if (c > count)
 			c = count;
-		to->ldisc.receive_buf(to, buf, 0, c);
+		to->ldisc.receive_buf(to, buf, NULL, c);
 	}
 	
 	return c;
diff --git a/drivers/char/random.c b/drivers/char/random.c
index f51b54112..e39179f50 100644
--- a/drivers/char/random.c
+++ b/drivers/char/random.c
@@ -822,6 +822,11 @@ static void add_timer_randomness(struct timer_rand_state *state, unsigned num)
 	} else {
 		time = jiffies;
 	}
+#elif defined (__sparc_v9__)
+	unsigned long tick = tick_ops->get_tick();
+
+	time = (unsigned int) tick;
+	num ^= (tick >> 32UL);
 #else
 	time = jiffies;
 #endif
@@ -1894,13 +1899,13 @@ static int change_poolsize(int poolsize)
 }
 
 static int proc_do_poolsize(ctl_table *table, int write, struct file *filp,
-			    void __user *buffer, size_t *lenp)
+			    void __user *buffer, size_t *lenp, loff_t *ppos)
 {
 	int	ret;
 
 	sysctl_poolsize = random_state->poolinfo.POOLBYTES;
 
-	ret = proc_dointvec(table, write, filp, buffer, lenp);
+	ret = proc_dointvec(table, write, filp, buffer, lenp, ppos);
 	if (ret || !write ||
 	    (sysctl_poolsize == random_state->poolinfo.POOLBYTES))
 		return ret;
@@ -1945,7 +1950,7 @@ static int poolsize_strategy(ctl_table *table, int __user *name, int nlen,
  * sysctl system call, it is returned as 16 bytes of binary data.
  */
 static int proc_do_uuid(ctl_table *table, int write, struct file *filp,
-			void __user *buffer, size_t *lenp)
+			void __user *buffer, size_t *lenp, loff_t *ppos)
 {
 	ctl_table	fake_table;
 	unsigned char	buf[64], tmp_uuid[16], *uuid;
@@ -1967,7 +1972,7 @@ static int proc_do_uuid(ctl_table *table, int write, struct file *filp,
 	fake_table.data = buf;
 	fake_table.maxlen = sizeof(buf);
 
-	return proc_dostring(&fake_table, write, filp, buffer, lenp);
+	return proc_dostring(&fake_table, write, filp, buffer, lenp, ppos);
 }
 
 static int uuid_strategy(ctl_table *table, int __user *name, int nlen,
diff --git a/drivers/char/raw.c b/drivers/char/raw.c
index 9c19dbc8e..a2e33ec79 100644
--- a/drivers/char/raw.c
+++ b/drivers/char/raw.c
@@ -18,6 +18,7 @@
 #include <linux/capability.h>
 #include <linux/uio.h>
 #include <linux/cdev.h>
+#include <linux/device.h>
 
 #include <asm/uaccess.h>
 
@@ -26,6 +27,7 @@ struct raw_device_data {
 	int inuse;
 };
 
+static struct class_simple *raw_class;
 static struct raw_device_data raw_devices[MAX_RAW_MINORS];
 static DECLARE_MUTEX(raw_mutex);
 static struct file_operations raw_ctl_fops;	     /* forward declaration */
@@ -123,6 +125,13 @@ raw_ioctl(struct inode *inode, struct file *filp,
 	return ioctl_by_bdev(bdev, command, arg);
 }
 
+static void bind_device(struct raw_config_request *rq)
+{
+	class_simple_device_remove(MKDEV(RAW_MAJOR, rq->raw_minor));
+	class_simple_device_add(raw_class, MKDEV(RAW_MAJOR, rq->raw_minor),
+				      NULL, "raw%d", rq->raw_minor);
+}
+
 /*
  * Deal with ioctls against the raw-device control interface, to bind
  * and unbind other raw devices.
@@ -191,12 +200,16 @@ static int raw_ctl_ioctl(struct inode *inode, struct file *filp,
 			if (rq.block_major == 0 && rq.block_minor == 0) {
 				/* unbind */
 				rawdev->binding = NULL;
+				class_simple_device_remove(MKDEV(RAW_MAJOR,
+								rq.raw_minor));
 			} else {
 				rawdev->binding = bdget(dev);
 				if (rawdev->binding == NULL)
 					err = -ENOMEM;
-				else
+				else {
 					__module_get(THIS_MODULE);
+					bind_device(&rq);
+				}
 			}
 			up(&raw_mutex);
 		} else {
@@ -287,6 +300,15 @@ static int __init raw_init(void)
 		goto error;
 	}
 
+	raw_class = class_simple_create(THIS_MODULE, "raw");
+	if (IS_ERR(raw_class)) {
+		printk(KERN_ERR "Error creating raw class.\n");
+		cdev_del(&raw_cdev);
+		unregister_chrdev_region(dev, MAX_RAW_MINORS);
+		goto error;
+	}
+	class_simple_device_add(raw_class, MKDEV(RAW_MAJOR, 0), NULL, "rawctl");
+
 	devfs_mk_cdev(MKDEV(RAW_MAJOR, 0),
 		      S_IFCHR | S_IRUGO | S_IWUGO,
 		      "raw/rawctl");
@@ -309,6 +331,8 @@ static void __exit raw_exit(void)
 		devfs_remove("raw/raw%d", i);
 	devfs_remove("raw/rawctl");
 	devfs_remove("raw");
+	class_simple_device_remove(MKDEV(RAW_MAJOR, 0));
+	class_simple_destroy(raw_class);
 	cdev_del(&raw_cdev);
 	unregister_chrdev_region(MKDEV(RAW_MAJOR, 0), MAX_RAW_MINORS);
 }
diff --git a/drivers/char/riscom8.c b/drivers/char/riscom8.c
index c4b51d346..69108ceea 100644
--- a/drivers/char/riscom8.c
+++ b/drivers/char/riscom8.c
@@ -1131,7 +1131,7 @@ static void rc_close(struct tty_struct * tty, struct file * filp)
 		tty->ldisc.flush_buffer(tty);
 	tty->closing = 0;
 	port->event = 0;
-	port->tty = 0;
+	port->tty = NULL;
 	if (port->blocked_open) {
 		if (port->close_delay) {
 			current->state = TASK_INTERRUPTIBLE;
@@ -1380,7 +1380,7 @@ static inline void rc_send_break(struct riscom_port * port, unsigned long length
 }
 
 static inline int rc_set_serial_info(struct riscom_port * port,
-				     struct serial_struct * newinfo)
+				     struct serial_struct __user * newinfo)
 {
 	struct serial_struct tmp;
 	struct riscom_board *bp = port_Board(port);
@@ -1427,7 +1427,7 @@ static inline int rc_set_serial_info(struct riscom_port * port,
 }
 
 static inline int rc_get_serial_info(struct riscom_port * port,
-				     struct serial_struct * retinfo)
+				     struct serial_struct __user *retinfo)
 {
 	struct serial_struct tmp;
 	struct riscom_board *bp = port_Board(port);
@@ -1450,6 +1450,7 @@ static int rc_ioctl(struct tty_struct * tty, struct file * filp,
 		    
 {
 	struct riscom_port *port = (struct riscom_port *)tty->driver_data;
+	void __user *argp = (void __user *)arg;
 	int retval;
 				
 	if (rc_paranoia_check(port, tty->name, "rc_ioctl"))
@@ -1472,18 +1473,18 @@ static int rc_ioctl(struct tty_struct * tty, struct file * filp,
 		rc_send_break(port, arg ? arg*(HZ/10) : HZ/4);
 		break;
 	 case TIOCGSOFTCAR:
-		return put_user(C_CLOCAL(tty) ? 1 : 0, (unsigned int *) arg);
+		return put_user(C_CLOCAL(tty) ? 1 : 0, (unsigned __user *)argp);
 	 case TIOCSSOFTCAR:
-		if (get_user(arg,(unsigned int *) arg))
+		if (get_user(arg,(unsigned __user *) argp))
 			return -EFAULT;
 		tty->termios->c_cflag =
 			((tty->termios->c_cflag & ~CLOCAL) |
 			(arg ? CLOCAL : 0));
 		break;
 	 case TIOCGSERIAL:	
-		return rc_get_serial_info(port, (struct serial_struct *) arg);
+		return rc_get_serial_info(port, argp);
 	 case TIOCSSERIAL:	
-		return rc_set_serial_info(port, (struct serial_struct *) arg);
+		return rc_set_serial_info(port, argp);
 	 default:
 		return -ENOIOCTLCMD;
 	}
@@ -1607,7 +1608,7 @@ static void rc_hangup(struct tty_struct * tty)
 	port->event = 0;
 	port->count = 0;
 	port->flags &= ~ASYNC_NORMAL_ACTIVE;
-	port->tty = 0;
+	port->tty = NULL;
 	wake_up_interruptible(&port->open_wait);
 }
 
diff --git a/drivers/char/rocket.c b/drivers/char/rocket.c
index b0da37eab..129b8ccd8 100644
--- a/drivers/char/rocket.c
+++ b/drivers/char/rocket.c
@@ -1115,7 +1115,7 @@ static void rp_close(struct tty_struct *tty, struct file *filp)
 	} else {
 		if (info->xmit_buf) {
 			free_page((unsigned long) info->xmit_buf);
-			info->xmit_buf = 0;
+			info->xmit_buf = NULL;
 		}
 	}
 	info->flags &= ~(ROCKET_INITIALIZED | ROCKET_CLOSING | ROCKET_NORMAL_ACTIVE);
@@ -1258,7 +1258,7 @@ static int rp_tiocmset(struct tty_struct *tty, struct file *file,
 	return 0;
 }
 
-static int get_config(struct r_port *info, struct rocket_config *retinfo)
+static int get_config(struct r_port *info, struct rocket_config __user *retinfo)
 {
 	struct rocket_config tmp;
 
@@ -1276,7 +1276,7 @@ static int get_config(struct r_port *info, struct rocket_config *retinfo)
 	return 0;
 }
 
-static int set_config(struct r_port *info, struct rocket_config *new_info)
+static int set_config(struct r_port *info, struct rocket_config __user *new_info)
 {
 	struct rocket_config new_serial;
 
@@ -1292,7 +1292,7 @@ static int set_config(struct r_port *info, struct rocket_config *new_info)
 		if ((new_serial.flags & ~ROCKET_USR_MASK) != (info->flags & ~ROCKET_USR_MASK))
 			return -EPERM;
 		info->flags = ((info->flags & ~ROCKET_USR_MASK) | (new_serial.flags & ROCKET_USR_MASK));
-		configure_r_port(info, 0);
+		configure_r_port(info, NULL);
 		return 0;
 	}
 
@@ -1309,7 +1309,7 @@ static int set_config(struct r_port *info, struct rocket_config *new_info)
 	if ((info->flags & ROCKET_SPD_MASK) == ROCKET_SPD_WARP)
 		info->tty->alt_speed = 460800;
 
-	configure_r_port(info, 0);
+	configure_r_port(info, NULL);
 	return 0;
 }
 
@@ -1319,7 +1319,7 @@ static int set_config(struct r_port *info, struct rocket_config *new_info)
  *  to user space.  See setrocket.c where the info is used to create
  *  the /dev/ttyRx ports.
  */
-static int get_ports(struct r_port *info, struct rocket_ports *retports)
+static int get_ports(struct r_port *info, struct rocket_ports __user *retports)
 {
 	struct rocket_ports tmp;
 	int board;
@@ -1341,11 +1341,11 @@ static int get_ports(struct r_port *info, struct rocket_ports *retports)
 	return 0;
 }
 
-static int reset_rm2(struct r_port *info, unsigned long arg)
+static int reset_rm2(struct r_port *info, void __user *arg)
 {
 	int reset;
 
-	if (copy_from_user(&reset, (void *) arg, sizeof (int)))
+	if (copy_from_user(&reset, arg, sizeof (int)))
 		return -EFAULT;
 	if (reset)
 		reset = 1;
@@ -1362,7 +1362,7 @@ static int reset_rm2(struct r_port *info, unsigned long arg)
 	return 0;
 }
 
-static int get_version(struct r_port *info, struct rocket_version *retvers)
+static int get_version(struct r_port *info, struct rocket_version __user *retvers)
 {
 	if (copy_to_user(retvers, &driver_version, sizeof (*retvers)))
 		return -EFAULT;
@@ -1374,25 +1374,26 @@ static int rp_ioctl(struct tty_struct *tty, struct file *file,
 		    unsigned int cmd, unsigned long arg)
 {
 	struct r_port *info = (struct r_port *) tty->driver_data;
+	void __user *argp = (void __user *)arg;
 
 	if (cmd != RCKP_GET_PORTS && rocket_paranoia_check(info, "rp_ioctl"))
 		return -ENXIO;
 
 	switch (cmd) {
 	case RCKP_GET_STRUCT:
-		if (copy_to_user((void *) arg, info, sizeof (struct r_port)))
+		if (copy_to_user(argp, info, sizeof (struct r_port)))
 			return -EFAULT;
 		return 0;
 	case RCKP_GET_CONFIG:
-		return get_config(info, (struct rocket_config *) arg);
+		return get_config(info, argp);
 	case RCKP_SET_CONFIG:
-		return set_config(info, (struct rocket_config *) arg);
+		return set_config(info, argp);
 	case RCKP_GET_PORTS:
-		return get_ports(info, (struct rocket_ports *) arg);
+		return get_ports(info, argp);
 	case RCKP_RESET_RM2:
-		return reset_rm2(info, arg);
+		return reset_rm2(info, argp);
 	case RCKP_GET_VERSION:
-		return get_version(info, (struct rocket_version *) arg);
+		return get_version(info, argp);
 	default:
 		return -ENOIOCTLCMD;
 	}
@@ -1571,7 +1572,7 @@ static void rp_hangup(struct tty_struct *tty)
 
 	info->count = 0;
 	info->flags &= ~ROCKET_NORMAL_ACTIVE;
-	info->tty = 0;
+	info->tty = NULL;
 
 	cp = &info->channel;
 	sDisRxFIFO(cp);
diff --git a/drivers/char/rtc.c b/drivers/char/rtc.c
index 03b4f2097..1b3b25889 100644
--- a/drivers/char/rtc.c
+++ b/drivers/char/rtc.c
@@ -97,6 +97,10 @@ static unsigned long rtc_port;
 static int rtc_irq = PCI_IRQ_NONE;
 #endif
 
+#ifdef	CONFIG_HPET_RTC_IRQ
+#undef	RTC_IRQ
+#endif
+
 #ifdef RTC_IRQ
 static int rtc_has_irq = 1;
 #endif
@@ -504,7 +508,7 @@ static int rtc_do_ioctl(unsigned int cmd, unsigned long arg, int kernel)
 		unsigned char mon, day, hrs, min, sec, leap_yr;
 		unsigned char save_control, save_freq_select;
 		unsigned int yrs;
-#ifdef CONFIG_DECSTATION
+#ifdef CONFIG_MACH_DECSTATION
 		unsigned int real_yrs;
 #endif
 
@@ -540,7 +544,7 @@ static int rtc_do_ioctl(unsigned int cmd, unsigned long arg, int kernel)
 			return -EINVAL;
 
 		spin_lock_irq(&rtc_lock);
-#ifdef CONFIG_DECSTATION
+#ifdef CONFIG_MACH_DECSTATION
 		real_yrs = yrs;
 		yrs = 72;
 
@@ -579,7 +583,7 @@ static int rtc_do_ioctl(unsigned int cmd, unsigned long arg, int kernel)
 		save_freq_select = CMOS_READ(RTC_FREQ_SELECT);
 		CMOS_WRITE((save_freq_select|RTC_DIV_RESET2), RTC_FREQ_SELECT);
 
-#ifdef CONFIG_DECSTATION
+#ifdef CONFIG_MACH_DECSTATION
 		CMOS_WRITE(real_yrs, RTC_DEC_YEAR);
 #endif
 		CMOS_WRITE(yrs, RTC_YEAR);
@@ -970,7 +974,7 @@ no_irq:
 		release_region(RTC_PORT(0), RTC_IO_EXTENT);
 		return -ENODEV;
 	}
-	if (create_proc_read_entry ("driver/rtc", 0, 0, rtc_read_proc, NULL) == NULL) {
+	if (!create_proc_read_entry ("driver/rtc", 0, NULL, rtc_read_proc, NULL)) {
 #ifdef RTC_IRQ
 		free_irq(RTC_IRQ, NULL);
 #endif
@@ -1209,7 +1213,7 @@ void rtc_get_rtc_time(struct rtc_time *rtc_tm)
 {
 	unsigned long uip_watchdog = jiffies;
 	unsigned char ctrl;
-#ifdef CONFIG_DECSTATION
+#ifdef CONFIG_MACH_DECSTATION
 	unsigned int real_year;
 #endif
 
@@ -1242,7 +1246,7 @@ void rtc_get_rtc_time(struct rtc_time *rtc_tm)
 	rtc_tm->tm_mday = CMOS_READ(RTC_DAY_OF_MONTH);
 	rtc_tm->tm_mon = CMOS_READ(RTC_MONTH);
 	rtc_tm->tm_year = CMOS_READ(RTC_YEAR);
-#ifdef CONFIG_DECSTATION
+#ifdef CONFIG_MACH_DECSTATION
 	real_year = CMOS_READ(RTC_DEC_YEAR);
 #endif
 	ctrl = CMOS_READ(RTC_CONTROL);
@@ -1258,7 +1262,7 @@ void rtc_get_rtc_time(struct rtc_time *rtc_tm)
 		BCD_TO_BIN(rtc_tm->tm_year);
 	}
 
-#ifdef CONFIG_DECSTATION
+#ifdef CONFIG_MACH_DECSTATION
 	rtc_tm->tm_year += real_year - 72;
 #endif
 
diff --git a/drivers/char/scx200_gpio.c b/drivers/char/scx200_gpio.c
index e937346e1..70b5e94b5 100644
--- a/drivers/char/scx200_gpio.c
+++ b/drivers/char/scx200_gpio.c
@@ -32,9 +32,6 @@ static ssize_t scx200_gpio_write(struct file *file, const char __user *data,
 	unsigned m = iminor(file->f_dentry->d_inode);
 	size_t i;
 
-	if (ppos != &file->f_pos)
-		return -ESPIPE;
-
 	for (i = 0; i < len; ++i) {
 		char c;
 		if (get_user(c, data+i))
@@ -83,9 +80,6 @@ static ssize_t scx200_gpio_read(struct file *file, char __user *buf,
 	unsigned m = iminor(file->f_dentry->d_inode);
 	int value;
 
-	if (ppos != &file->f_pos)
-		return -ESPIPE;
-
 	value = scx200_gpio_get(m);
 	if (put_user(value ? '1' : '0', buf))
 		return -EFAULT;
@@ -98,7 +92,7 @@ static int scx200_gpio_open(struct inode *inode, struct file *file)
 	unsigned m = iminor(inode);
 	if (m > 63)
 		return -EINVAL;
-	return 0;
+	return nonseekable_open(inode, file);
 }
 
 static int scx200_gpio_release(struct inode *inode, struct file *file)
diff --git a/drivers/char/selection.c b/drivers/char/selection.c
index f08fd7920..598f60110 100644
--- a/drivers/char/selection.c
+++ b/drivers/char/selection.c
@@ -296,7 +296,7 @@ int paste_selection(struct tty_struct *tty)
 		}
 		count = sel_buffer_lth - pasted;
 		count = MIN(count, tty->ldisc.receive_room(tty));
-		tty->ldisc.receive_buf(tty, sel_buffer + pasted, 0, count);
+		tty->ldisc.receive_buf(tty, sel_buffer + pasted, NULL, count);
 		pasted += count;
 	}
 	remove_wait_queue(&vt->paste_wait, &wait);
diff --git a/drivers/char/ser_a2232.c b/drivers/char/ser_a2232.c
index 58f82dad2..f0b966876 100644
--- a/drivers/char/ser_a2232.c
+++ b/drivers/char/ser_a2232.c
@@ -109,12 +109,6 @@
 /************************* End of Includes **************************/
 
 /***************************** Prototypes ***************************/
-/* Helper functions */
-static __inline__ volatile struct a2232status *a2232stat(unsigned int board,
-						unsigned int portonboard);
-static __inline__ volatile struct a2232memory *a2232mem (unsigned int board); 
-static __inline__ void a2232_receive_char(	struct a2232_port *port,
-						int ch, int err );
 /* The interrupt service routine */
 static irqreturn_t a2232_vbl_inter(int irq, void *data, struct pt_regs *fp);
 /* Initialize the port structures */
@@ -178,6 +172,51 @@ static int nr_a2232;
 static struct zorro_dev *zd_a2232[MAX_A2232_BOARDS]; 
 /***************************** End of Global variables **************/
 
+/* Helper functions */
+
+static inline volatile struct a2232memory *a2232mem(unsigned int board)
+{
+	return (volatile struct a2232memory *)ZTWO_VADDR(zd_a2232[board]->resource.start);
+}
+
+static inline volatile struct a2232status *a2232stat(unsigned int board,
+						     unsigned int portonboard)
+{
+	volatile struct a2232memory *mem = a2232mem(board);
+	return &(mem->Status[portonboard]);
+}
+
+static inline void a2232_receive_char(struct a2232_port *port, int ch, int err)
+{
+/* 	Mostly stolen from other drivers.
+	Maybe one could implement a more efficient version by not only
+	transferring one character at a time.
+*/
+	struct tty_struct *tty = port->gs.tty;
+
+	if (tty->flip.count >= TTY_FLIPBUF_SIZE)
+		return;
+
+	tty->flip.count++;
+
+#if 0
+	switch(err) {
+	case TTY_BREAK:
+		break;
+	case TTY_PARITY:
+		break;
+	case TTY_OVERRUN:
+		break;
+	case TTY_FRAME:
+		break;
+	}
+#endif
+
+	*tty->flip.flag_buf_ptr++ = err;
+	*tty->flip.char_buf_ptr++ = ch;
+	tty_flip_buffer_push(tty);
+}
+
 /***************************** Functions ****************************/
 /*** BEGIN OF REAL_DRIVER FUNCTIONS ***/
 
@@ -470,49 +509,6 @@ static int  a2232_open(struct tty_struct * tty, struct file * filp)
 }
 /*** END OF FUNCTIONS EXPECTED BY TTY DRIVER STRUCTS ***/
 
-static __inline__ volatile struct a2232status *a2232stat(unsigned int board, unsigned int portonboard)
-{
-	volatile struct a2232memory *mem = a2232mem(board);
-	return &(mem->Status[portonboard]);
-}
-
-static __inline__ volatile struct a2232memory *a2232mem (unsigned int board)
-{
-	return (volatile struct a2232memory *) ZTWO_VADDR( zd_a2232[board]->resource.start );
-}
-
-static __inline__ void a2232_receive_char(	struct a2232_port *port,
-						int ch, int err )
-{
-/* 	Mostly stolen from other drivers.
-	Maybe one could implement a more efficient version by not only
-	transferring one character at a time.
-*/
-	struct tty_struct *tty = port->gs.tty;
-	
-	if (tty->flip.count >= TTY_FLIPBUF_SIZE)
-		return;
-
-	tty->flip.count++;
-
-#if 0
-	switch(err) {
-	case TTY_BREAK:
-		break;
-	case TTY_PARITY:
-		break;
-	case TTY_OVERRUN:
-		break;
-	case TTY_FRAME:
-		break;
-	}
-#endif
-
-	*tty->flip.flag_buf_ptr++ = err;
-	*tty->flip.char_buf_ptr++ = ch;
-	tty_flip_buffer_push(tty);
-}
-
 static irqreturn_t a2232_vbl_inter(int irq, void *data, struct pt_regs *fp)
 {
 #if A2232_IOBUFLEN != 256
diff --git a/drivers/char/sonypi.c b/drivers/char/sonypi.c
index a906dfad2..28418d57f 100644
--- a/drivers/char/sonypi.c
+++ b/drivers/char/sonypi.c
@@ -43,6 +43,8 @@
 #include <linux/delay.h>
 #include <linux/wait.h>
 #include <linux/acpi.h>
+#include <linux/dmi.h>
+#include <linux/sysdev.h>
 
 #include <asm/uaccess.h>
 #include <asm/io.h>
@@ -602,44 +604,68 @@ struct miscdevice sonypi_misc_device = {
 };
 
 #ifdef CONFIG_PM
+static int old_camera_power;
+
+static int sonypi_suspend(struct sys_device *dev, u32 state) {
+	sonypi_call2(0x81, 0); /* make sure we don't get any more events */
+	if (camera) {
+		old_camera_power = sonypi_device.camera_power;
+		sonypi_camera_off();
+	}
+	if (sonypi_device.model == SONYPI_DEVICE_MODEL_TYPE2)
+		sonypi_type2_dis();
+	else
+		sonypi_type1_dis();
+	/* disable ACPI mode */
+	if (!SONYPI_ACPI_ACTIVE && fnkeyinit)
+		outb(0xf1, 0xb2);
+	return 0;
+}
+
+static int sonypi_resume(struct sys_device *dev) {
+	/* Enable ACPI mode to get Fn key events */
+	if (!SONYPI_ACPI_ACTIVE && fnkeyinit)
+		outb(0xf0, 0xb2);
+	if (sonypi_device.model == SONYPI_DEVICE_MODEL_TYPE2)
+		sonypi_type2_srs();
+	else
+		sonypi_type1_srs();
+	sonypi_call1(0x82);
+	sonypi_call2(0x81, 0xff);
+	if (compat)
+		sonypi_call1(0x92); 
+	else
+		sonypi_call1(0x82);
+	if (camera && old_camera_power)
+		sonypi_camera_on();
+	return 0;
+}
+
+/* Old PM scheme */
 static int sonypi_pm_callback(struct pm_dev *dev, pm_request_t rqst, void *data) {
-	static int old_camera_power;
 
 	switch (rqst) {
-	case PM_SUSPEND:
-		sonypi_call2(0x81, 0); /* make sure we don't get any more events */
-		if (camera) {
-			old_camera_power = sonypi_device.camera_power;
-			sonypi_camera_off();
-		}
-		if (sonypi_device.model == SONYPI_DEVICE_MODEL_TYPE2)
-			sonypi_type2_dis();
-		else
-			sonypi_type1_dis();
-		/* disable ACPI mode */
-		if (!SONYPI_ACPI_ACTIVE && fnkeyinit)
-			outb(0xf1, 0xb2);
-		break;
-	case PM_RESUME:
-		/* Enable ACPI mode to get Fn key events */
-		if (!SONYPI_ACPI_ACTIVE && fnkeyinit)
-			outb(0xf0, 0xb2);
-		if (sonypi_device.model == SONYPI_DEVICE_MODEL_TYPE2)
-			sonypi_type2_srs();
-		else
-			sonypi_type1_srs();
-		sonypi_call1(0x82);
-		sonypi_call2(0x81, 0xff);
-		if (compat)
-			sonypi_call1(0x92); 
-		else
-			sonypi_call1(0x82);
-		if (camera && old_camera_power)
-			sonypi_camera_on();
-		break;
+		case PM_SUSPEND:
+			sonypi_suspend(NULL, 0);
+			break;
+		case PM_RESUME:
+			sonypi_resume(NULL);
+			break;
 	}
 	return 0;
 }
+
+/* New PM scheme (device model) */
+static struct sysdev_class sonypi_sysclass = {
+	set_kset_name("sonypi"),
+	.suspend = sonypi_suspend,
+	.resume = sonypi_resume,
+};
+
+static struct sys_device sonypi_sysdev = {
+	.id = 0,
+	.cls = &sonypi_sysclass,
+};
 #endif
 
 static int __devinit sonypi_probe(struct pci_dev *pcidev) {
@@ -734,6 +760,21 @@ static int __devinit sonypi_probe(struct pci_dev *pcidev) {
 		goto out3;
 	}
 
+#ifdef CONFIG_PM
+	sonypi_device.pm = pm_register(PM_PCI_DEV, 0, sonypi_pm_callback);
+
+	if (sysdev_class_register(&sonypi_sysclass) != 0) {
+		printk(KERN_ERR "sonypi: sysdev_class_register failed\n");
+		ret = -ENODEV;
+		goto out4;
+	}
+	if (sysdev_register(&sonypi_sysdev) != 0) {
+		printk(KERN_ERR "sonypi: sysdev_register failed\n");
+		ret = -ENODEV;
+		goto out5;
+	}
+#endif
+
 	/* Enable ACPI mode to get Fn key events */
 	if (!SONYPI_ACPI_ACTIVE && fnkeyinit)
 		outb(0xf0, 0xb2);
@@ -743,7 +784,7 @@ static int __devinit sonypi_probe(struct pci_dev *pcidev) {
 	       SONYPI_DRIVER_MINORVERSION);
 	printk(KERN_INFO "sonypi: detected %s model, "
 	       "verbose = %d, fnkeyinit = %s, camera = %s, "
-	       "compat = %s, mask = 0x%08lx, useinput = %s\n",
+	       "compat = %s, mask = 0x%08lx, useinput = %s, acpi = %s\n",
 	       (sonypi_device.model == SONYPI_DEVICE_MODEL_TYPE1) ?
 			"type1" : "type2",
 	       verbose,
@@ -751,10 +792,12 @@ static int __devinit sonypi_probe(struct pci_dev *pcidev) {
 	       camera ? "on" : "off",
 	       compat ? "on" : "off",
 	       mask,
-	       useinput ? "on" : "off");
+	       useinput ? "on" : "off",
+	       SONYPI_ACPI_ACTIVE ? "on" : "off");
 	printk(KERN_INFO "sonypi: enabled at irq=%d, port1=0x%x, port2=0x%x\n",
 	       sonypi_device.irq, 
 	       sonypi_device.ioport1, sonypi_device.ioport2);
+
 	if (minor == -1)
 		printk(KERN_INFO "sonypi: device allocated minor is %d\n",
 		       sonypi_misc_device.minor);
@@ -776,12 +819,14 @@ static int __devinit sonypi_probe(struct pci_dev *pcidev) {
 	}
 #endif /* SONYPI_USE_INPUT */
 
-#ifdef CONFIG_PM
-	sonypi_device.pm = pm_register(PM_PCI_DEV, 0, sonypi_pm_callback);
-#endif
-
 	return 0;
 
+#ifdef CONFIG_PM
+out5:
+	sysdev_class_unregister(&sonypi_sysclass);
+out4:
+	free_irq(sonypi_device.irq, sonypi_irq);
+#endif
 out3:
 	release_region(sonypi_device.ioport1, sonypi_device.region_size);
 out2:
@@ -794,6 +839,9 @@ static void __devexit sonypi_remove(void) {
 
 #ifdef CONFIG_PM
 	pm_unregister(sonypi_device.pm);
+
+	sysdev_unregister(&sonypi_sysdev);
+	sysdev_class_unregister(&sonypi_sysclass);
 #endif
 
 	sonypi_call2(0x81, 0); /* make sure we don't get any more events */
@@ -820,10 +868,28 @@ static void __devexit sonypi_remove(void) {
 	printk(KERN_INFO "sonypi: removed.\n");
 }
 
-static int __init sonypi_init_module(void) {
-	struct pci_dev *pcidev = NULL;
+static struct dmi_system_id __initdata sonypi_dmi_table[] = {
+	{
+		.ident = "Sony Vaio",
+		.matches = {
+			DMI_MATCH(DMI_SYS_VENDOR, "Sony Corporation"),
+			DMI_MATCH(DMI_PRODUCT_NAME, "PCG-"),
+		},
+	},
+	{
+		.ident = "Sony Vaio",
+		.matches = {
+			DMI_MATCH(DMI_SYS_VENDOR, "Sony Corporation"),
+			DMI_MATCH(DMI_PRODUCT_NAME, "VGN-"),
+		},
+	},
+	{ }
+};
 
-	if (is_sony_vaio_laptop) {
+static int __init sonypi_init_module(void)
+{
+	struct pci_dev *pcidev = NULL;
+	if (dmi_check_system(sonypi_dmi_table)) {
 		pcidev = pci_find_device(PCI_VENDOR_ID_INTEL, 
 					 PCI_DEVICE_ID_INTEL_82371AB_3, 
 					 NULL);
diff --git a/drivers/char/sonypi.h b/drivers/char/sonypi.h
index 83a6c5b12..0eb8f46ab 100644
--- a/drivers/char/sonypi.h
+++ b/drivers/char/sonypi.h
@@ -37,7 +37,7 @@
 #ifdef __KERNEL__
 
 #define SONYPI_DRIVER_MAJORVERSION	 1
-#define SONYPI_DRIVER_MINORVERSION	22
+#define SONYPI_DRIVER_MINORVERSION	23
 
 #define SONYPI_DEVICE_MODEL_TYPE1	1
 #define SONYPI_DEVICE_MODEL_TYPE2	2
@@ -336,7 +336,7 @@ struct sonypi_eventtypes {
 	{ SONYPI_DEVICE_MODEL_TYPE2, 0x41, SONYPI_BATTERY_MASK, sonypi_batteryev },
 	{ SONYPI_DEVICE_MODEL_TYPE2, 0x31, SONYPI_PKEY_MASK, sonypi_pkeyev },
 
-	{ 0, 0, 0, 0 }
+	{ 0 }
 };
 
 #define SONYPI_BUF_SIZE	128
diff --git a/drivers/char/specialix.c b/drivers/char/specialix.c
index 14ce60360..0d3763dc6 100644
--- a/drivers/char/specialix.c
+++ b/drivers/char/specialix.c
@@ -72,7 +72,7 @@
 /*
  * There is a bunch of documentation about the card, jumpers, config
  * settings, restrictions, cables, device names and numbers in
- * ../../Documentation/specialix.txt 
+ * Documentation/specialix.txt
  */
 
 #include <linux/config.h>
@@ -1472,7 +1472,7 @@ static void sx_close(struct tty_struct * tty, struct file * filp)
 		tty->ldisc.flush_buffer(tty);
 	tty->closing = 0;
 	port->event = 0;
-	port->tty = 0;
+	port->tty = NULL;
 	if (port->blocked_open) {
 		if (port->close_delay) {
 			current->state = TASK_INTERRUPTIBLE;
@@ -1757,18 +1757,13 @@ static inline void sx_send_break(struct specialix_port * port, unsigned long len
 
 
 static inline int sx_set_serial_info(struct specialix_port * port,
-                                     struct serial_struct * newinfo)
+                                     struct serial_struct __user * newinfo)
 {
 	struct serial_struct tmp;
 	struct specialix_board *bp = port_Board(port);
 	int change_speed;
 	unsigned long flags;
-	int error;
 	
-	error = verify_area(VERIFY_READ, (void *) newinfo, sizeof(tmp));
-	if (error)
-		return error;
-
 	if (copy_from_user(&tmp, newinfo, sizeof(tmp)))
 		return -EFAULT;
 	
@@ -1813,16 +1808,11 @@ static inline int sx_set_serial_info(struct specialix_port * port,
 
 
 static inline int sx_get_serial_info(struct specialix_port * port,
-				     struct serial_struct * retinfo)
+				     struct serial_struct __user *retinfo)
 {
 	struct serial_struct tmp;
 	struct specialix_board *bp = port_Board(port);
-	int error;
 	
-	error = verify_area(VERIFY_WRITE, (void *) retinfo, sizeof(tmp));
-	if (error)
-		return error;
-
 	memset(&tmp, 0, sizeof(tmp));
 	tmp.type = PORT_CIRRUS;
 	tmp.line = port - sx_port;
@@ -1844,8 +1834,8 @@ static int sx_ioctl(struct tty_struct * tty, struct file * filp,
                     unsigned int cmd, unsigned long arg)
 {
 	struct specialix_port *port = (struct specialix_port *)tty->driver_data;
-	int error;
 	int retval;
+	void __user *argp = (void __user *)arg;
 				
 	if (sx_paranoia_check(port, tty->name, "sx_ioctl"))
 		return -ENODEV;
@@ -1867,22 +1857,20 @@ static int sx_ioctl(struct tty_struct * tty, struct file * filp,
 		sx_send_break(port, arg ? arg*(HZ/10) : HZ/4);
 		return 0;
 	 case TIOCGSOFTCAR:
-		error = verify_area(VERIFY_WRITE, (void *) arg, sizeof(long));
-		if (error)
-			return error;
-		put_user(C_CLOCAL(tty) ? 1 : 0,
-		         (unsigned long *) arg);
+		if (put_user(C_CLOCAL(tty)?1:0, (unsigned long __user *)argp))
+			return -EFAULT;
 		return 0;
 	 case TIOCSSOFTCAR:
-		get_user(arg, (unsigned long *) arg);
+		if (get_user(arg, (unsigned long __user *) argp))
+			return -EFAULT;
 		tty->termios->c_cflag =
 			((tty->termios->c_cflag & ~CLOCAL) |
 			(arg ? CLOCAL : 0));
 		return 0;
 	 case TIOCGSERIAL:	
-		return sx_get_serial_info(port, (struct serial_struct *) arg);
+		return sx_get_serial_info(port, argp);
 	 case TIOCSSERIAL:	
-		return sx_set_serial_info(port, (struct serial_struct *) arg);
+		return sx_set_serial_info(port, argp);
 	 default:
 		return -ENOIOCTLCMD;
 	}
@@ -2027,7 +2015,7 @@ static void sx_hangup(struct tty_struct * tty)
 	port->event = 0;
 	port->count = 0;
 	port->flags &= ~ASYNC_NORMAL_ACTIVE;
-	port->tty = 0;
+	port->tty = NULL;
 	wake_up_interruptible(&port->open_wait);
 }
 
diff --git a/drivers/char/stallion.c b/drivers/char/stallion.c
index bbaafd88d..a0b3ba7b0 100644
--- a/drivers/char/stallion.c
+++ b/drivers/char/stallion.c
@@ -3,7 +3,7 @@
 /*
  *	stallion.c  -- stallion multiport serial driver.
  *
- *	Copyright (C) 1996-1999  Stallion Technologies (support@stallion.oz.au).
+ *	Copyright (C) 1996-1999  Stallion Technologies
  *	Copyright (C) 1994-1996  Greg Ungerer.
  *
  *	This code is loosely based on the Linux serial driver, written by
@@ -504,13 +504,13 @@ static int	stl_readproc(char *page, char **start, off_t off, int count, int *eof
 static int	stl_brdinit(stlbrd_t *brdp);
 static int	stl_initports(stlbrd_t *brdp, stlpanel_t *panelp);
 static int	stl_mapirq(int irq, char *name);
-static int	stl_getserial(stlport_t *portp, struct serial_struct *sp);
-static int	stl_setserial(stlport_t *portp, struct serial_struct *sp);
-static int	stl_getbrdstats(combrd_t *bp);
-static int	stl_getportstats(stlport_t *portp, comstats_t *cp);
-static int	stl_clrportstats(stlport_t *portp, comstats_t *cp);
-static int	stl_getportstruct(unsigned long arg);
-static int	stl_getbrdstruct(unsigned long arg);
+static int	stl_getserial(stlport_t *portp, struct serial_struct __user *sp);
+static int	stl_setserial(stlport_t *portp, struct serial_struct __user *sp);
+static int	stl_getbrdstats(combrd_t __user *bp);
+static int	stl_getportstats(stlport_t *portp, comstats_t __user *cp);
+static int	stl_clrportstats(stlport_t *portp, comstats_t __user *cp);
+static int	stl_getportstruct(stlport_t __user *arg);
+static int	stl_getbrdstruct(stlbrd_t __user *arg);
 static int	stl_waitcarrier(stlport_t *portp, struct file *filp);
 static void	stl_delay(int len);
 static void	stl_eiointr(stlbrd_t *brdp);
@@ -745,7 +745,7 @@ static int __init stallion_module_init(void)
 {
 	unsigned long	flags;
 
-#if DEBUG
+#ifdef DEBUG
 	printk("init_module()\n");
 #endif
 
@@ -767,7 +767,7 @@ static void __exit stallion_module_exit(void)
 	unsigned long	flags;
 	int		i, j, k;
 
-#if DEBUG
+#ifdef DEBUG
 	printk("cleanup_module()\n");
 #endif
 
@@ -847,13 +847,13 @@ module_exit(stallion_module_exit);
  *	Check for any arguments passed in on the module load command line.
  */
 
-static void stl_argbrds()
+static void stl_argbrds(void)
 {
 	stlconf_t	conf;
 	stlbrd_t	*brdp;
 	int		nrargs, i;
 
-#if DEBUG
+#ifdef DEBUG
 	printk("stl_argbrds()\n");
 #endif
 
@@ -923,7 +923,7 @@ static int stl_parsebrd(stlconf_t *confp, char **argp)
 	char	*sp;
 	int	nrbrdnames, i;
 
-#if DEBUG
+#ifdef DEBUG
 	printk("stl_parsebrd(confp=%x,argp=%x)\n", (int) confp, (int) argp);
 #endif
 
@@ -978,7 +978,7 @@ static void *stl_memalloc(int len)
  *	Allocate a new board structure. Fill out the basic info in it.
  */
 
-static stlbrd_t *stl_allocbrd()
+static stlbrd_t *stl_allocbrd(void)
 {
 	stlbrd_t	*brdp;
 
@@ -1003,7 +1003,7 @@ static int stl_open(struct tty_struct *tty, struct file *filp)
 	unsigned int	minordev;
 	int		brdnr, panelnr, portnr, rc;
 
-#if DEBUG
+#ifdef DEBUG
 	printk("stl_open(tty=%x,filp=%x): device=%s\n", (int) tty,
 		(int) filp, tty->name);
 #endif
@@ -1096,7 +1096,7 @@ static int stl_waitcarrier(stlport_t *portp, struct file *filp)
 	unsigned long	flags;
 	int		rc, doclocal;
 
-#if DEBUG
+#ifdef DEBUG
 	printk("stl_waitcarrier(portp=%x,filp=%x)\n", (int) portp, (int) filp);
 #endif
 
@@ -1148,7 +1148,7 @@ static void stl_close(struct tty_struct *tty, struct file *filp)
 	stlport_t	*portp;
 	unsigned long	flags;
 
-#if DEBUG
+#ifdef DEBUG
 	printk("stl_close(tty=%x,filp=%x)\n", (int) tty, (int) filp);
 #endif
 
@@ -1224,7 +1224,7 @@ static void stl_close(struct tty_struct *tty, struct file *filp)
 
 static void stl_delay(int len)
 {
-#if DEBUG
+#ifdef DEBUG
 	printk("stl_delay(len=%d)\n", len);
 #endif
 	if (len > 0) {
@@ -1247,7 +1247,7 @@ static int stl_write(struct tty_struct *tty, int from_user, const unsigned char
 	unsigned char	*chbuf;
 	char		*head, *tail;
 
-#if DEBUG
+#ifdef DEBUG
 	printk("stl_write(tty=%x,from_user=%d,buf=%x,count=%d)\n",
 		(int) tty, from_user, (int) buf, count);
 #endif
@@ -1324,7 +1324,7 @@ static void stl_putchar(struct tty_struct *tty, unsigned char ch)
 	unsigned int	len;
 	char		*head, *tail;
 
-#if DEBUG
+#ifdef DEBUG
 	printk("stl_putchar(tty=%x,ch=%x)\n", (int) tty, (int) ch);
 #endif
 
@@ -1362,7 +1362,7 @@ static void stl_flushchars(struct tty_struct *tty)
 {
 	stlport_t	*portp;
 
-#if DEBUG
+#ifdef DEBUG
 	printk("stl_flushchars(tty=%x)\n", (int) tty);
 #endif
 
@@ -1389,7 +1389,7 @@ static int stl_writeroom(struct tty_struct *tty)
 	stlport_t	*portp;
 	char		*head, *tail;
 
-#if DEBUG
+#ifdef DEBUG
 	printk("stl_writeroom(tty=%x)\n", (int) tty);
 #endif
 
@@ -1423,7 +1423,7 @@ static int stl_charsinbuffer(struct tty_struct *tty)
 	unsigned int	size;
 	char		*head, *tail;
 
-#if DEBUG
+#ifdef DEBUG
 	printk("stl_charsinbuffer(tty=%x)\n", (int) tty);
 #endif
 
@@ -1449,12 +1449,12 @@ static int stl_charsinbuffer(struct tty_struct *tty)
  *	Generate the serial struct info.
  */
 
-static int stl_getserial(stlport_t *portp, struct serial_struct *sp)
+static int stl_getserial(stlport_t *portp, struct serial_struct __user *sp)
 {
 	struct serial_struct	sio;
 	stlbrd_t		*brdp;
 
-#if DEBUG
+#ifdef DEBUG
 	printk("stl_getserial(portp=%x,sp=%x)\n", (int) portp, (int) sp);
 #endif
 
@@ -1490,11 +1490,11 @@ static int stl_getserial(stlport_t *portp, struct serial_struct *sp)
  *	just quietly ignore any requests to change irq, etc.
  */
 
-static int stl_setserial(stlport_t *portp, struct serial_struct *sp)
+static int stl_setserial(stlport_t *portp, struct serial_struct __user *sp)
 {
 	struct serial_struct	sio;
 
-#if DEBUG
+#ifdef DEBUG
 	printk("stl_setserial(portp=%x,sp=%x)\n", (int) portp, (int) sp);
 #endif
 
@@ -1567,8 +1567,9 @@ static int stl_ioctl(struct tty_struct *tty, struct file *file, unsigned int cmd
 	stlport_t	*portp;
 	unsigned int	ival;
 	int		rc;
+	void __user *argp = (void __user *)arg;
 
-#if DEBUG
+#ifdef DEBUG
 	printk("stl_ioctl(tty=%x,file=%x,cmd=%x,arg=%x)\n",
 		(int) tty, (int) file, cmd, (int) arg);
 #endif
@@ -1590,36 +1591,26 @@ static int stl_ioctl(struct tty_struct *tty, struct file *file, unsigned int cmd
 	switch (cmd) {
 	case TIOCGSOFTCAR:
 		rc = put_user(((tty->termios->c_cflag & CLOCAL) ? 1 : 0),
-			(unsigned int *) arg);
+			(unsigned __user *) argp);
 		break;
 	case TIOCSSOFTCAR:
-		if ((rc = verify_area(VERIFY_READ, (void *) arg,
-		    sizeof(int))) == 0) {
-			get_user(ival, (unsigned int *) arg);
-			tty->termios->c_cflag =
+		if (get_user(ival, (unsigned int __user *) arg))
+			return -EFAULT;
+		tty->termios->c_cflag =
 				(tty->termios->c_cflag & ~CLOCAL) |
 				(ival ? CLOCAL : 0);
-		}
 		break;
 	case TIOCGSERIAL:
-		if ((rc = verify_area(VERIFY_WRITE, (void *) arg,
-		    sizeof(struct serial_struct))) == 0)
-			rc = stl_getserial(portp, (struct serial_struct *) arg);
+		rc = stl_getserial(portp, argp);
 		break;
 	case TIOCSSERIAL:
-		if ((rc = verify_area(VERIFY_READ, (void *) arg,
-		    sizeof(struct serial_struct))) == 0)
-			rc = stl_setserial(portp, (struct serial_struct *) arg);
+		rc = stl_setserial(portp, argp);
 		break;
 	case COM_GETPORTSTATS:
-		if ((rc = verify_area(VERIFY_WRITE, (void *) arg,
-		    sizeof(comstats_t))) == 0)
-			rc = stl_getportstats(portp, (comstats_t *) arg);
+		rc = stl_getportstats(portp, argp);
 		break;
 	case COM_CLRPORTSTATS:
-		if ((rc = verify_area(VERIFY_WRITE, (void *) arg,
-		    sizeof(comstats_t))) == 0)
-			rc = stl_clrportstats(portp, (comstats_t *) arg);
+		rc = stl_clrportstats(portp, argp);
 		break;
 	case TIOCSERCONFIG:
 	case TIOCSERGWILD:
@@ -1643,7 +1634,7 @@ static void stl_settermios(struct tty_struct *tty, struct termios *old)
 	stlport_t	*portp;
 	struct termios	*tiosp;
 
-#if DEBUG
+#ifdef DEBUG
 	printk("stl_settermios(tty=%x,old=%x)\n", (int) tty, (int) old);
 #endif
 
@@ -1680,7 +1671,7 @@ static void stl_throttle(struct tty_struct *tty)
 {
 	stlport_t	*portp;
 
-#if DEBUG
+#ifdef DEBUG
 	printk("stl_throttle(tty=%x)\n", (int) tty);
 #endif
 
@@ -1702,7 +1693,7 @@ static void stl_unthrottle(struct tty_struct *tty)
 {
 	stlport_t	*portp;
 
-#if DEBUG
+#ifdef DEBUG
 	printk("stl_unthrottle(tty=%x)\n", (int) tty);
 #endif
 
@@ -1725,7 +1716,7 @@ static void stl_stop(struct tty_struct *tty)
 {
 	stlport_t	*portp;
 
-#if DEBUG
+#ifdef DEBUG
 	printk("stl_stop(tty=%x)\n", (int) tty);
 #endif
 
@@ -1747,7 +1738,7 @@ static void stl_start(struct tty_struct *tty)
 {
 	stlport_t	*portp;
 
-#if DEBUG
+#ifdef DEBUG
 	printk("stl_start(tty=%x)\n", (int) tty);
 #endif
 
@@ -1771,7 +1762,7 @@ static void stl_hangup(struct tty_struct *tty)
 {
 	stlport_t	*portp;
 
-#if DEBUG
+#ifdef DEBUG
 	printk("stl_hangup(tty=%x)\n", (int) tty);
 #endif
 
@@ -1807,7 +1798,7 @@ static void stl_flushbuffer(struct tty_struct *tty)
 {
 	stlport_t	*portp;
 
-#if DEBUG
+#ifdef DEBUG
 	printk("stl_flushbuffer(tty=%x)\n", (int) tty);
 #endif
 
@@ -1830,7 +1821,7 @@ static void stl_breakctl(struct tty_struct *tty, int state)
 {
 	stlport_t	*portp;
 
-#if DEBUG
+#ifdef DEBUG
 	printk("stl_breakctl(tty=%x,state=%d)\n", (int) tty, state);
 #endif
 
@@ -1850,7 +1841,7 @@ static void stl_waituntilsent(struct tty_struct *tty, int timeout)
 	stlport_t	*portp;
 	unsigned long	tend;
 
-#if DEBUG
+#ifdef DEBUG
 	printk("stl_waituntilsent(tty=%x,timeout=%d)\n", (int) tty, timeout);
 #endif
 
@@ -1879,7 +1870,7 @@ static void stl_sendxchar(struct tty_struct *tty, char ch)
 {
 	stlport_t	*portp;
 
-#if DEBUG
+#ifdef DEBUG
 	printk("stl_sendxchar(tty=%x,ch=%x)\n", (int) tty, ch);
 #endif
 
@@ -1960,7 +1951,7 @@ static int stl_readproc(char *page, char **start, off_t off, int count, int *eof
 	int		curoff, maxoff;
 	char		*pos;
 
-#if DEBUG
+#ifdef DEBUG
 	printk("stl_readproc(page=%x,start=%x,off=%x,count=%d,eof=%x,"
 		"data=%x\n", (int) page, (int) start, (int) off, count,
 		(int) eof, (int) data);
@@ -2043,7 +2034,7 @@ static irqreturn_t stl_intr(int irq, void *dev_id, struct pt_regs *regs)
 	int		i;
 	int handled = 0;
 
-#if DEBUG
+#ifdef DEBUG
 	printk("stl_intr(irq=%d,regs=%x)\n", irq, (int) regs);
 #endif
 
@@ -2189,7 +2180,7 @@ static void stl_offintr(void *private)
 
 	portp = private;
 
-#if DEBUG
+#ifdef DEBUG
 	printk("stl_offintr(portp=%x)\n", (int) portp);
 #endif
 
@@ -2233,7 +2224,7 @@ static int __init stl_mapirq(int irq, char *name)
 {
 	int	rc, i;
 
-#if DEBUG
+#ifdef DEBUG
 	printk("stl_mapirq(irq=%d,name=%s)\n", irq, name);
 #endif
 
@@ -2265,7 +2256,7 @@ static int __init stl_initports(stlbrd_t *brdp, stlpanel_t *panelp)
 	stlport_t	*portp;
 	int		chipmask, i;
 
-#if DEBUG
+#ifdef DEBUG
 	printk("stl_initports(brdp=%x,panelp=%x)\n", (int) brdp, (int) panelp);
 #endif
 
@@ -2319,7 +2310,7 @@ static inline int stl_initeio(stlbrd_t *brdp)
 	char		*name;
 	int		rc;
 
-#if DEBUG
+#ifdef DEBUG
 	printk("stl_initeio(brdp=%x)\n", (int) brdp);
 #endif
 
@@ -2457,7 +2448,7 @@ static inline int stl_initech(stlbrd_t *brdp)
 	int		panelnr, banknr, i;
 	char		*name;
 
-#if DEBUG
+#ifdef DEBUG
 	printk("stl_initech(brdp=%x)\n", (int) brdp);
 #endif
 
@@ -2661,7 +2652,7 @@ static int __init stl_brdinit(stlbrd_t *brdp)
 {
 	int	i;
 
-#if DEBUG
+#ifdef DEBUG
 	printk("stl_brdinit(brdp=%x)\n", (int) brdp);
 #endif
 
@@ -2707,7 +2698,7 @@ static int __init stl_brdinit(stlbrd_t *brdp)
  *	Find the next available board number that is free.
  */
 
-static inline int stl_getbrdnr()
+static inline int stl_getbrdnr(void)
 {
 	int	i;
 
@@ -2735,7 +2726,7 @@ static inline int stl_initpcibrd(int brdtype, struct pci_dev *devp)
 {
 	stlbrd_t	*brdp;
 
-#if DEBUG
+#ifdef DEBUG
 	printk("stl_initpcibrd(brdtype=%d,busnr=%x,devnr=%x)\n", brdtype,
 		devp->bus->number, devp->devfn);
 #endif
@@ -2755,7 +2746,7 @@ static inline int stl_initpcibrd(int brdtype, struct pci_dev *devp)
  *	Different Stallion boards use the BAR registers in different ways,
  *	so set up io addresses based on board type.
  */
-#if DEBUG
+#ifdef DEBUG
 	printk("%s(%d): BAR[]=%x,%x,%x,%x IRQ=%x\n", __FILE__, __LINE__,
 		pci_resource_start(devp, 0), pci_resource_start(devp, 1),
 		pci_resource_start(devp, 2), pci_resource_start(devp, 3), devp->irq);
@@ -2797,12 +2788,12 @@ static inline int stl_initpcibrd(int brdtype, struct pci_dev *devp)
  */
 
 
-static inline int stl_findpcibrds()
+static inline int stl_findpcibrds(void)
 {
 	struct pci_dev	*dev = NULL;
 	int		i, rc;
 
-#if DEBUG
+#ifdef DEBUG
 	printk("stl_findpcibrds()\n");
 #endif
 
@@ -2835,13 +2826,13 @@ static inline int stl_findpcibrds()
  *	since the initial search and setup is too different.
  */
 
-static inline int stl_initbrds()
+static inline int stl_initbrds(void)
 {
 	stlbrd_t	*brdp;
 	stlconf_t	*confp;
 	int		i;
 
-#if DEBUG
+#ifdef DEBUG
 	printk("stl_initbrds()\n");
 #endif
 
@@ -2891,7 +2882,7 @@ static inline int stl_initbrds()
  *	Return the board stats structure to user app.
  */
 
-static int stl_getbrdstats(combrd_t *bp)
+static int stl_getbrdstats(combrd_t __user *bp)
 {
 	stlbrd_t	*brdp;
 	stlpanel_t	*panelp;
@@ -2959,12 +2950,12 @@ static stlport_t *stl_getport(int brdnr, int panelnr, int portnr)
  *	what port to get stats for (used through board control device).
  */
 
-static int stl_getportstats(stlport_t *portp, comstats_t *cp)
+static int stl_getportstats(stlport_t *portp, comstats_t __user *cp)
 {
 	unsigned char	*head, *tail;
 	unsigned long	flags;
 
-	if (portp == (stlport_t *) NULL) {
+	if (!portp) {
 		if (copy_from_user(&stl_comstats, cp, sizeof(comstats_t)))
 			return -EFAULT;
 		portp = stl_getport(stl_comstats.brd, stl_comstats.panel,
@@ -3017,9 +3008,9 @@ static int stl_getportstats(stlport_t *portp, comstats_t *cp)
  *	Clear the port stats structure. We also return it zeroed out...
  */
 
-static int stl_clrportstats(stlport_t *portp, comstats_t *cp)
+static int stl_clrportstats(stlport_t *portp, comstats_t __user *cp)
 {
-	if (portp == (stlport_t *) NULL) {
+	if (!portp) {
 		if (copy_from_user(&stl_comstats, cp, sizeof(comstats_t)))
 			return -EFAULT;
 		portp = stl_getport(stl_comstats.brd, stl_comstats.panel,
@@ -3042,18 +3033,17 @@ static int stl_clrportstats(stlport_t *portp, comstats_t *cp)
  *	Return the entire driver ports structure to a user app.
  */
 
-static int stl_getportstruct(unsigned long arg)
+static int stl_getportstruct(stlport_t __user *arg)
 {
 	stlport_t	*portp;
 
-	if (copy_from_user(&stl_dummyport, (void *) arg, sizeof(stlport_t)))
+	if (copy_from_user(&stl_dummyport, arg, sizeof(stlport_t)))
 		return -EFAULT;
 	portp = stl_getport(stl_dummyport.brdnr, stl_dummyport.panelnr,
 		 stl_dummyport.portnr);
-	if (portp == (stlport_t *) NULL)
-		return(-ENODEV);
-	return copy_to_user((void *)arg, portp,
-			    sizeof(stlport_t)) ? -EFAULT : 0;
+	if (!portp)
+		return -ENODEV;
+	return copy_to_user(arg, portp, sizeof(stlport_t)) ? -EFAULT : 0;
 }
 
 /*****************************************************************************/
@@ -3062,18 +3052,18 @@ static int stl_getportstruct(unsigned long arg)
  *	Return the entire driver board structure to a user app.
  */
 
-static int stl_getbrdstruct(unsigned long arg)
+static int stl_getbrdstruct(stlbrd_t __user *arg)
 {
 	stlbrd_t	*brdp;
 
-	if (copy_from_user(&stl_dummybrd, (void *) arg, sizeof(stlbrd_t)))
+	if (copy_from_user(&stl_dummybrd, arg, sizeof(stlbrd_t)))
 		return -EFAULT;
 	if ((stl_dummybrd.brdnr < 0) || (stl_dummybrd.brdnr >= STL_MAXBRDS))
-		return(-ENODEV);
+		return -ENODEV;
 	brdp = stl_brds[stl_dummybrd.brdnr];
-	if (brdp == (stlbrd_t *) NULL)
+	if (!brdp)
 		return(-ENODEV);
-	return copy_to_user((void *)arg, brdp, sizeof(stlbrd_t)) ? -EFAULT : 0;
+	return copy_to_user(arg, brdp, sizeof(stlbrd_t)) ? -EFAULT : 0;
 }
 
 /*****************************************************************************/
@@ -3087,8 +3077,9 @@ static int stl_getbrdstruct(unsigned long arg)
 static int stl_memioctl(struct inode *ip, struct file *fp, unsigned int cmd, unsigned long arg)
 {
 	int	brdnr, rc;
+	void __user *argp = (void __user *)arg;
 
-#if DEBUG
+#ifdef DEBUG
 	printk("stl_memioctl(ip=%x,fp=%x,cmd=%x,arg=%x)\n", (int) ip,
 		(int) fp, cmd, (int) arg);
 #endif
@@ -3100,31 +3091,19 @@ static int stl_memioctl(struct inode *ip, struct file *fp, unsigned int cmd, uns
 
 	switch (cmd) {
 	case COM_GETPORTSTATS:
-		if ((rc = verify_area(VERIFY_WRITE, (void *) arg,
-		    sizeof(comstats_t))) == 0)
-			rc = stl_getportstats((stlport_t *) NULL,
-				(comstats_t *) arg);
+		rc = stl_getportstats(NULL, argp);
 		break;
 	case COM_CLRPORTSTATS:
-		if ((rc = verify_area(VERIFY_WRITE, (void *) arg,
-		    sizeof(comstats_t))) == 0)
-			rc = stl_clrportstats((stlport_t *) NULL,
-				(comstats_t *) arg);
+		rc = stl_clrportstats(NULL, argp);
 		break;
 	case COM_GETBRDSTATS:
-		if ((rc = verify_area(VERIFY_WRITE, (void *) arg,
-		    sizeof(combrd_t))) == 0)
-			rc = stl_getbrdstats((combrd_t *) arg);
+		rc = stl_getbrdstats(argp);
 		break;
 	case COM_READPORT:
-		if ((rc = verify_area(VERIFY_WRITE, (void *) arg,
-		    sizeof(stlport_t))) == 0)
-			rc = stl_getportstruct(arg);
+		rc = stl_getportstruct(argp);
 		break;
 	case COM_READBOARD:
-		if ((rc = verify_area(VERIFY_WRITE, (void *) arg,
-		    sizeof(stlbrd_t))) == 0)
-			rc = stl_getbrdstruct(arg);
+		rc = stl_getbrdstruct(argp);
 		break;
 	default:
 		rc = -ENOIOCTLCMD;
@@ -3262,7 +3241,7 @@ static int stl_cd1400panelinit(stlbrd_t *brdp, stlpanel_t *panelp)
 	int		chipmask, i, j;
 	int		nrchips, uartaddr, ioaddr;
 
-#if DEBUG
+#ifdef DEBUG
 	printk("stl_panelinit(brdp=%x,panelp=%x)\n", (int) brdp, (int) panelp);
 #endif
 
@@ -3314,7 +3293,7 @@ static int stl_cd1400panelinit(stlbrd_t *brdp, stlpanel_t *panelp)
 
 static void stl_cd1400portinit(stlbrd_t *brdp, stlpanel_t *panelp, stlport_t *portp)
 {
-#if DEBUG
+#ifdef DEBUG
 	printk("stl_cd1400portinit(brdp=%x,panelp=%x,portp=%x)\n",
 		(int) brdp, (int) panelp, (int) portp);
 #endif
@@ -3529,7 +3508,7 @@ static void stl_cd1400setport(stlport_t *portp, struct termios *tiosp)
  *	them all up.
  */
 
-#if DEBUG
+#ifdef DEBUG
 	printk("SETPORT: portnr=%d panelnr=%d brdnr=%d\n",
 		portp->portnr, portp->panelnr, portp->brdnr);
 	printk("    cor1=%x cor2=%x cor3=%x cor4=%x cor5=%x\n",
@@ -3594,7 +3573,7 @@ static void stl_cd1400setsignals(stlport_t *portp, int dtr, int rts)
 	unsigned char	msvr1, msvr2;
 	unsigned long	flags;
 
-#if DEBUG
+#ifdef DEBUG
 	printk("stl_cd1400setsignals(portp=%x,dtr=%d,rts=%d)\n",
 		(int) portp, dtr, rts);
 #endif
@@ -3630,7 +3609,7 @@ static int stl_cd1400getsignals(stlport_t *portp)
 	unsigned long	flags;
 	int		sigs;
 
-#if DEBUG
+#ifdef DEBUG
 	printk("stl_cd1400getsignals(portp=%x)\n", (int) portp);
 #endif
 
@@ -3668,7 +3647,7 @@ static void stl_cd1400enablerxtx(stlport_t *portp, int rx, int tx)
 	unsigned char	ccr;
 	unsigned long	flags;
 
-#if DEBUG
+#ifdef DEBUG
 	printk("stl_cd1400enablerxtx(portp=%x,rx=%d,tx=%d)\n",
 		(int) portp, rx, tx);
 #endif
@@ -3705,7 +3684,7 @@ static void stl_cd1400startrxtx(stlport_t *portp, int rx, int tx)
 	unsigned char	sreron, sreroff;
 	unsigned long	flags;
 
-#if DEBUG
+#ifdef DEBUG
 	printk("stl_cd1400startrxtx(portp=%x,rx=%d,tx=%d)\n",
 		(int) portp, rx, tx);
 #endif
@@ -3745,7 +3724,7 @@ static void stl_cd1400disableintrs(stlport_t *portp)
 {
 	unsigned long	flags;
 
-#if DEBUG
+#ifdef DEBUG
 	printk("stl_cd1400disableintrs(portp=%x)\n", (int) portp);
 #endif
 	save_flags(flags);
@@ -3763,7 +3742,7 @@ static void stl_cd1400sendbreak(stlport_t *portp, int len)
 {
 	unsigned long	flags;
 
-#if DEBUG
+#ifdef DEBUG
 	printk("stl_cd1400sendbreak(portp=%x,len=%d)\n", (int) portp, len);
 #endif
 
@@ -3792,7 +3771,7 @@ static void stl_cd1400flowctrl(stlport_t *portp, int state)
 	struct tty_struct	*tty;
 	unsigned long		flags;
 
-#if DEBUG
+#ifdef DEBUG
 	printk("stl_cd1400flowctrl(portp=%x,state=%x)\n", (int) portp, state);
 #endif
 
@@ -3857,7 +3836,7 @@ static void stl_cd1400sendflow(stlport_t *portp, int state)
 	struct tty_struct	*tty;
 	unsigned long		flags;
 
-#if DEBUG
+#ifdef DEBUG
 	printk("stl_cd1400sendflow(portp=%x,state=%x)\n", (int) portp, state);
 #endif
 
@@ -3892,7 +3871,7 @@ static void stl_cd1400flush(stlport_t *portp)
 {
 	unsigned long	flags;
 
-#if DEBUG
+#ifdef DEBUG
 	printk("stl_cd1400flush(portp=%x)\n", (int) portp);
 #endif
 
@@ -3922,7 +3901,7 @@ static void stl_cd1400flush(stlport_t *portp)
 
 static int stl_cd1400datastate(stlport_t *portp)
 {
-#if DEBUG
+#ifdef DEBUG
 	printk("stl_cd1400datastate(portp=%x)\n", (int) portp);
 #endif
 
@@ -3942,7 +3921,7 @@ static void stl_cd1400eiointr(stlpanel_t *panelp, unsigned int iobase)
 {
 	unsigned char	svrtype;
 
-#if DEBUG
+#ifdef DEBUG
 	printk("stl_cd1400eiointr(panelp=%x,iobase=%x)\n",
 		(int) panelp, iobase);
 #endif
@@ -3972,7 +3951,7 @@ static void stl_cd1400echintr(stlpanel_t *panelp, unsigned int iobase)
 {
 	unsigned char	svrtype;
 
-#if DEBUG
+#ifdef DEBUG
 	printk("stl_cd1400echintr(panelp=%x,iobase=%x)\n", (int) panelp,
 		iobase);
 #endif
@@ -4046,7 +4025,7 @@ static void stl_cd1400txisr(stlpanel_t *panelp, int ioaddr)
 	char		*head, *tail;
 	unsigned char	ioack, srer;
 
-#if DEBUG
+#ifdef DEBUG
 	printk("stl_cd1400txisr(panelp=%x,ioaddr=%x)\n", (int) panelp, ioaddr);
 #endif
 
@@ -4128,7 +4107,7 @@ static void stl_cd1400rxisr(stlpanel_t *panelp, int ioaddr)
 	unsigned char		status;
 	char			ch;
 
-#if DEBUG
+#ifdef DEBUG
 	printk("stl_cd1400rxisr(panelp=%x,ioaddr=%x)\n", (int) panelp, ioaddr);
 #endif
 
@@ -4237,7 +4216,7 @@ static void stl_cd1400mdmisr(stlpanel_t *panelp, int ioaddr)
 	unsigned int	ioack;
 	unsigned char	misr;
 
-#if DEBUG
+#ifdef DEBUG
 	printk("stl_cd1400mdmisr(panelp=%x)\n", (int) panelp);
 #endif
 
@@ -4326,7 +4305,7 @@ static int stl_sc26198panelinit(stlbrd_t *brdp, stlpanel_t *panelp)
 	int	chipmask, i;
 	int	nrchips, ioaddr;
 
-#if DEBUG
+#ifdef DEBUG
 	printk("stl_sc26198panelinit(brdp=%x,panelp=%x)\n",
 		(int) brdp, (int) panelp);
 #endif
@@ -4371,7 +4350,7 @@ static int stl_sc26198panelinit(stlbrd_t *brdp, stlpanel_t *panelp)
 
 static void stl_sc26198portinit(stlbrd_t *brdp, stlpanel_t *panelp, stlport_t *portp)
 {
-#if DEBUG
+#ifdef DEBUG
 	printk("stl_sc26198portinit(brdp=%x,panelp=%x,portp=%x)\n",
 		(int) brdp, (int) panelp, (int) portp);
 #endif
@@ -4548,7 +4527,7 @@ static void stl_sc26198setport(stlport_t *portp, struct termios *tiosp)
  *	them all up.
  */
 
-#if DEBUG
+#ifdef DEBUG
 	printk("SETPORT: portnr=%d panelnr=%d brdnr=%d\n",
 		portp->portnr, portp->panelnr, portp->brdnr);
 	printk("    mr0=%x mr1=%x mr2=%x clk=%x\n", mr0, mr1, mr2, clk);
@@ -4600,7 +4579,7 @@ static void stl_sc26198setsignals(stlport_t *portp, int dtr, int rts)
 	unsigned char	iopioron, iopioroff;
 	unsigned long	flags;
 
-#if DEBUG
+#ifdef DEBUG
 	printk("stl_sc26198setsignals(portp=%x,dtr=%d,rts=%d)\n",
 		(int) portp, dtr, rts);
 #endif
@@ -4637,7 +4616,7 @@ static int stl_sc26198getsignals(stlport_t *portp)
 	unsigned long	flags;
 	int		sigs;
 
-#if DEBUG
+#ifdef DEBUG
 	printk("stl_sc26198getsignals(portp=%x)\n", (int) portp);
 #endif
 
@@ -4668,7 +4647,7 @@ static void stl_sc26198enablerxtx(stlport_t *portp, int rx, int tx)
 	unsigned char	ccr;
 	unsigned long	flags;
 
-#if DEBUG
+#ifdef DEBUG
 	printk("stl_sc26198enablerxtx(portp=%x,rx=%d,tx=%d)\n",
 		(int) portp, rx, tx);
 #endif
@@ -4703,7 +4682,7 @@ static void stl_sc26198startrxtx(stlport_t *portp, int rx, int tx)
 	unsigned char	imr;
 	unsigned long	flags;
 
-#if DEBUG
+#ifdef DEBUG
 	printk("stl_sc26198startrxtx(portp=%x,rx=%d,tx=%d)\n",
 		(int) portp, rx, tx);
 #endif
@@ -4739,7 +4718,7 @@ static void stl_sc26198disableintrs(stlport_t *portp)
 {
 	unsigned long	flags;
 
-#if DEBUG
+#ifdef DEBUG
 	printk("stl_sc26198disableintrs(portp=%x)\n", (int) portp);
 #endif
 
@@ -4758,7 +4737,7 @@ static void stl_sc26198sendbreak(stlport_t *portp, int len)
 {
 	unsigned long	flags;
 
-#if DEBUG
+#ifdef DEBUG
 	printk("stl_sc26198sendbreak(portp=%x,len=%d)\n", (int) portp, len);
 #endif
 
@@ -4787,7 +4766,7 @@ static void stl_sc26198flowctrl(stlport_t *portp, int state)
 	unsigned long		flags;
 	unsigned char		mr0;
 
-#if DEBUG
+#ifdef DEBUG
 	printk("stl_sc26198flowctrl(portp=%x,state=%x)\n", (int) portp, state);
 #endif
 
@@ -4859,7 +4838,7 @@ static void stl_sc26198sendflow(stlport_t *portp, int state)
 	unsigned long		flags;
 	unsigned char		mr0;
 
-#if DEBUG
+#ifdef DEBUG
 	printk("stl_sc26198sendflow(portp=%x,state=%x)\n", (int) portp, state);
 #endif
 
@@ -4899,7 +4878,7 @@ static void stl_sc26198flush(stlport_t *portp)
 {
 	unsigned long	flags;
 
-#if DEBUG
+#ifdef DEBUG
 	printk("stl_sc26198flush(portp=%x)\n", (int) portp);
 #endif
 
@@ -4931,7 +4910,7 @@ static int stl_sc26198datastate(stlport_t *portp)
 	unsigned long	flags;
 	unsigned char	sr;
 
-#if DEBUG
+#ifdef DEBUG
 	printk("stl_sc26198datastate(portp=%x)\n", (int) portp);
 #endif
 
@@ -4961,7 +4940,7 @@ static void stl_sc26198wait(stlport_t *portp)
 {
 	int	i;
 
-#if DEBUG
+#ifdef DEBUG
 	printk("stl_sc26198wait(portp=%x)\n", (int) portp);
 #endif
 
@@ -5039,7 +5018,7 @@ static void stl_sc26198txisr(stlport_t *portp)
 	int		len, stlen;
 	char		*head, *tail;
 
-#if DEBUG
+#ifdef DEBUG
 	printk("stl_sc26198txisr(portp=%x)\n", (int) portp);
 #endif
 
@@ -5100,7 +5079,7 @@ static void stl_sc26198rxisr(stlport_t *portp, unsigned int iack)
 	struct tty_struct	*tty;
 	unsigned int		len, buflen, ioaddr;
 
-#if DEBUG
+#ifdef DEBUG
 	printk("stl_sc26198rxisr(portp=%x,iack=%x)\n", (int) portp, iack);
 #endif
 
@@ -5256,7 +5235,7 @@ static void stl_sc26198otherisr(stlport_t *portp, unsigned int iack)
 {
 	unsigned char	cir, ipr, xisr;
 
-#if DEBUG
+#ifdef DEBUG
 	printk("stl_sc26198otherisr(portp=%x,iack=%x)\n", (int) portp, iack);
 #endif
 
diff --git a/drivers/char/sx.c b/drivers/char/sx.c
index 643163b08..1ca3d2543 100644
--- a/drivers/char/sx.c
+++ b/drivers/char/sx.c
@@ -251,11 +251,13 @@
 #define PCI_DEVICE_ID_SPECIALIX_SX_XIO_IO8 0x2000
 #endif
 
+#ifdef CONFIG_PCI
 static struct pci_device_id sx_pci_tbl[] = {
 	{ PCI_VENDOR_ID_SPECIALIX, PCI_DEVICE_ID_SPECIALIX_SX_XIO_IO8, PCI_ANY_ID, PCI_ANY_ID },
 	{ 0 }
 };
 MODULE_DEVICE_TABLE(pci, sx_pci_tbl);
+#endif /* CONFIG_PCI */
 
 /* Configurable options: 
    (Don't be too sure that it'll work if you toggle them) */
@@ -1592,7 +1594,8 @@ static int sx_fw_ioctl (struct inode *inode, struct file *filp,
                         unsigned int cmd, unsigned long arg)
 {
 	int rc = 0;
-	int *descr = (int *)arg, i;
+	int __user *descr = (int __user *)arg;
+	int i;
 	static struct sx_board *board = NULL;
 	int nbytes, offset;
 	unsigned long data;
@@ -1668,7 +1671,7 @@ static int sx_fw_ioctl (struct inode *inode, struct file *filp,
 		get_user (data,	 descr++);
 		while (nbytes && data) {
 			for (i=0;i<nbytes;i += SX_CHUNK_SIZE) {
-				if (copy_from_user(tmp, (char *)data + i, 
+				if (copy_from_user(tmp, (char __user *)data+i, 
 						   (i + SX_CHUNK_SIZE >
 						    nbytes) ? nbytes - i :
 						   	      SX_CHUNK_SIZE)) {
@@ -1774,6 +1777,7 @@ static int sx_ioctl (struct tty_struct * tty, struct file * filp,
 {
 	int rc;
 	struct sx_port *port = tty->driver_data;
+	void __user *argp = (void __user *)arg;
 	int ival;
 
 	/* func_enter2(); */
@@ -1782,24 +1786,20 @@ static int sx_ioctl (struct tty_struct * tty, struct file * filp,
 	switch (cmd) {
 	case TIOCGSOFTCAR:
 		rc = put_user(((tty->termios->c_cflag & CLOCAL) ? 1 : 0),
-		              (unsigned int *) arg);
+		              (unsigned __user *) argp);
 		break;
 	case TIOCSSOFTCAR:
-		if ((rc = get_user(ival, (unsigned int *) arg)) == 0) {
+		if ((rc = get_user(ival, (unsigned __user *) argp)) == 0) {
 			tty->termios->c_cflag =
 				(tty->termios->c_cflag & ~CLOCAL) |
 				(ival ? CLOCAL : 0);
 		}
 		break;
 	case TIOCGSERIAL:
-		if ((rc = verify_area(VERIFY_WRITE, (void *) arg,
-		                      sizeof(struct serial_struct))) == 0)
-			rc = gs_getserial(&port->gs, (struct serial_struct *) arg);
+		rc = gs_getserial(&port->gs, argp);
 		break;
 	case TIOCSSERIAL:
-		if ((rc = verify_area(VERIFY_READ, (void *) arg,
-		                      sizeof(struct serial_struct))) == 0)
-			rc = gs_setserial(&port->gs, (struct serial_struct *) arg);
+		rc = gs_setserial(&port->gs, argp);
 		break;
 	default:
 		rc = -ENOIOCTLCMD;
diff --git a/drivers/char/synclink.c b/drivers/char/synclink.c
index 89f04b737..78d4efe6f 100644
--- a/drivers/char/synclink.c
+++ b/drivers/char/synclink.c
@@ -1873,7 +1873,7 @@ static void shutdown(struct mgsl_struct * info)
 
 	if (info->xmit_buf) {
 		free_page((unsigned long) info->xmit_buf);
-		info->xmit_buf = 0;
+		info->xmit_buf = NULL;
 	}
 
 	spin_lock_irqsave(&info->irq_spinlock,flags);
@@ -3260,7 +3260,7 @@ static void mgsl_close(struct tty_struct *tty, struct file * filp)
 	shutdown(info);
 	
 	tty->closing = 0;
-	info->tty = 0;
+	info->tty = NULL;
 	
 	if (info->blocked_open) {
 		if (info->close_delay) {
@@ -3381,7 +3381,7 @@ static void mgsl_hangup(struct tty_struct *tty)
 	
 	info->count = 0;	
 	info->flags &= ~ASYNC_NORMAL_ACTIVE;
-	info->tty = 0;
+	info->tty = NULL;
 
 	wake_up_interruptible(&info->open_wait);
 	
@@ -3592,7 +3592,7 @@ static int mgsl_open(struct tty_struct *tty, struct file * filp)
 cleanup:			
 	if (retval) {
 		if (tty->count == 1)
-			info->tty = 0; /* tty layer will release tty struct */
+			info->tty = NULL;/* tty layer will release tty struct */
 		if(info->count)
 			info->count--;
 	}
@@ -4341,11 +4341,11 @@ void mgsl_release_resources(struct mgsl_struct *info)
 	}
 	if (info->memory_base){
 		iounmap(info->memory_base);
-		info->memory_base = 0;
+		info->memory_base = NULL;
 	}
 	if (info->lcr_base){
 		iounmap(info->lcr_base - info->lcr_offset);
-		info->lcr_base = 0;
+		info->lcr_base = NULL;
 	}
 	
 	if ( debug_level >= DEBUG_LEVEL_INFO )
diff --git a/drivers/char/synclinkmp.c b/drivers/char/synclinkmp.c
index e76454311..1361ea041 100644
--- a/drivers/char/synclinkmp.c
+++ b/drivers/char/synclinkmp.c
@@ -361,6 +361,10 @@ typedef struct _synclinkmp_info {
 #define TMCS	0x64
 #define TEPR	0x65
 
+/*
+ *  FIXME: DAR here clashed with asm-ppc/reg.h and asm-sh/.../dma.h
+ */
+#undef DAR
 /* DMA Controller Register macros */
 #define DAR	0x80
 #define DARL	0x80
@@ -567,17 +571,17 @@ static struct net_device_stats *sppp_cb_net_stats(struct net_device *dev);
 
 /* ioctl handlers */
 
-static int  get_stats(SLMP_INFO *info, struct mgsl_icount *user_icount);
-static int  get_params(SLMP_INFO *info, MGSL_PARAMS *params);
-static int  set_params(SLMP_INFO *info, MGSL_PARAMS *params);
-static int  get_txidle(SLMP_INFO *info, int*idle_mode);
+static int  get_stats(SLMP_INFO *info, struct mgsl_icount __user *user_icount);
+static int  get_params(SLMP_INFO *info, MGSL_PARAMS __user *params);
+static int  set_params(SLMP_INFO *info, MGSL_PARAMS __user *params);
+static int  get_txidle(SLMP_INFO *info, int __user *idle_mode);
 static int  set_txidle(SLMP_INFO *info, int idle_mode);
 static int  tx_enable(SLMP_INFO *info, int enable);
 static int  tx_abort(SLMP_INFO *info);
 static int  rx_enable(SLMP_INFO *info, int enable);
 static int  map_status(int signals);
 static int  modem_input_wait(SLMP_INFO *info,int arg);
-static int  wait_mgsl_event(SLMP_INFO *info, int *mask_ptr);
+static int  wait_mgsl_event(SLMP_INFO *info, int __user *mask_ptr);
 static int  tiocmget(struct tty_struct *tty, struct file *file);
 static int  tiocmset(struct tty_struct *tty, struct file *file,
 		     unsigned int set, unsigned int clear);
@@ -692,7 +696,7 @@ static u32 sca_pci_load_interval = 64;
  * This allows remote debugging of dynamically loadable modules.
  */
 static void* synclinkmp_get_text_ptr(void);
-static void* synclinkmp_get_text_ptr() {return synclinkmp_get_text_ptr;}
+static void* synclinkmp_get_text_ptr(void) {return synclinkmp_get_text_ptr;}
 
 static inline int sanity_check(SLMP_INFO *info,
 			       char *name, const char *routine)
@@ -796,7 +800,7 @@ static int open(struct tty_struct *tty, struct file *filp)
 cleanup:
 	if (retval) {
 		if (tty->count == 1)
-			info->tty = 0; /* tty layer will release tty struct */
+			info->tty = NULL;/* tty layer will release tty struct */
 		if(info->count)
 			info->count--;
 	}
@@ -871,7 +875,7 @@ static void close(struct tty_struct *tty, struct file *filp)
 	shutdown(info);
 
 	tty->closing = 0;
-	info->tty = 0;
+	info->tty = NULL;
 
 	if (info->blocked_open) {
 		if (info->close_delay) {
@@ -910,7 +914,7 @@ static void hangup(struct tty_struct *tty)
 
 	info->count = 0;
 	info->flags &= ~ASYNC_NORMAL_ACTIVE;
-	info->tty = 0;
+	info->tty = NULL;
 
 	wake_up_interruptible(&info->open_wait);
 }
@@ -1333,8 +1337,9 @@ static int ioctl(struct tty_struct *tty, struct file *file,
 	SLMP_INFO *info = (SLMP_INFO *)tty->driver_data;
 	int error;
 	struct mgsl_icount cnow;	/* kernel counter temps */
-	struct serial_icounter_struct *p_cuser;	/* user space */
+	struct serial_icounter_struct __user *p_cuser;	/* user space */
 	unsigned long flags;
+	void __user *argp = (void __user *)arg;
 
 	if (debug_level >= DEBUG_LEVEL_INFO)
 		printk("%s(%d):%s ioctl() cmd=%08X\n", __FILE__,__LINE__,
@@ -1351,23 +1356,23 @@ static int ioctl(struct tty_struct *tty, struct file *file,
 
 	switch (cmd) {
 	case MGSL_IOCGPARAMS:
-		return get_params(info,(MGSL_PARAMS *)arg);
+		return get_params(info, argp);
 	case MGSL_IOCSPARAMS:
-		return set_params(info,(MGSL_PARAMS *)arg);
+		return set_params(info, argp);
 	case MGSL_IOCGTXIDLE:
-		return get_txidle(info,(int*)arg);
+		return get_txidle(info, argp);
 	case MGSL_IOCSTXIDLE:
-		return set_txidle(info,(int)arg);
+		return set_txidle(info, (int)arg);
 	case MGSL_IOCTXENABLE:
-		return tx_enable(info,(int)arg);
+		return tx_enable(info, (int)arg);
 	case MGSL_IOCRXENABLE:
-		return rx_enable(info,(int)arg);
+		return rx_enable(info, (int)arg);
 	case MGSL_IOCTXABORT:
 		return tx_abort(info);
 	case MGSL_IOCGSTATS:
-		return get_stats(info,(struct mgsl_icount*)arg);
+		return get_stats(info, argp);
 	case MGSL_IOCWAITEVENT:
-		return wait_mgsl_event(info,(int*)arg);
+		return wait_mgsl_event(info, argp);
 	case MGSL_IOCLOOPTXDONE:
 		return 0; // TODO: Not supported, need to document
 		/* Wait for modem input (DCD,RI,DSR,CTS) change
@@ -1386,7 +1391,7 @@ static int ioctl(struct tty_struct *tty, struct file *file,
 		spin_lock_irqsave(&info->lock,flags);
 		cnow = info->icount;
 		spin_unlock_irqrestore(&info->lock,flags);
-		p_cuser = (struct serial_icounter_struct *) arg;
+		p_cuser = argp;
 		PUT_USER(error,cnow.cts, &p_cuser->cts);
 		if (error) return error;
 		PUT_USER(error,cnow.dsr, &p_cuser->dsr);
@@ -2606,7 +2611,7 @@ static void shutdown(SLMP_INFO * info)
 
 	if (info->tx_buf) {
 		kfree(info->tx_buf);
-		info->tx_buf = 0;
+		info->tx_buf = NULL;
 	}
 
 	spin_lock_irqsave(&info->lock,flags);
@@ -2762,7 +2767,7 @@ static void change_params(SLMP_INFO *info)
 	program_hw(info);
 }
 
-static int get_stats(SLMP_INFO * info, struct mgsl_icount *user_icount)
+static int get_stats(SLMP_INFO * info, struct mgsl_icount __user *user_icount)
 {
 	int err;
 
@@ -2781,7 +2786,7 @@ static int get_stats(SLMP_INFO * info, struct mgsl_icount *user_icount)
 	return 0;
 }
 
-static int get_params(SLMP_INFO * info, MGSL_PARAMS *user_params)
+static int get_params(SLMP_INFO * info, MGSL_PARAMS __user *user_params)
 {
 	int err;
 	if (debug_level >= DEBUG_LEVEL_INFO)
@@ -2799,7 +2804,7 @@ static int get_params(SLMP_INFO * info, MGSL_PARAMS *user_params)
 	return 0;
 }
 
-static int set_params(SLMP_INFO * info, MGSL_PARAMS *new_params)
+static int set_params(SLMP_INFO * info, MGSL_PARAMS __user *new_params)
 {
  	unsigned long flags;
 	MGSL_PARAMS tmp_params;
@@ -2825,7 +2830,7 @@ static int set_params(SLMP_INFO * info, MGSL_PARAMS *new_params)
 	return 0;
 }
 
-static int get_txidle(SLMP_INFO * info, int*idle_mode)
+static int get_txidle(SLMP_INFO * info, int __user *idle_mode)
 {
 	int err;
 
@@ -2938,7 +2943,7 @@ static int map_status(int signals)
 
 /* wait for specified event to occur
  */
-static int wait_mgsl_event(SLMP_INFO * info, int * mask_ptr)
+static int wait_mgsl_event(SLMP_INFO * info, int __user *mask_ptr)
 {
  	unsigned long flags;
 	int s;
@@ -3547,22 +3552,22 @@ void release_resources(SLMP_INFO *info)
 
 	if (info->memory_base){
 		iounmap(info->memory_base);
-		info->memory_base = 0;
+		info->memory_base = NULL;
 	}
 
 	if (info->sca_base) {
 		iounmap(info->sca_base - info->sca_offset);
-		info->sca_base=0;
+		info->sca_base=NULL;
 	}
 
 	if (info->statctrl_base) {
 		iounmap(info->statctrl_base - info->statctrl_offset);
-		info->statctrl_base=0;
+		info->statctrl_base=NULL;
 	}
 
 	if (info->lcr_base){
 		iounmap(info->lcr_base - info->lcr_offset);
-		info->lcr_base = 0;
+		info->lcr_base = NULL;
 	}
 
 	if ( debug_level >= DEBUG_LEVEL_INFO )
@@ -5142,7 +5147,7 @@ int loopback_test(SLMP_INFO *info)
 	u32 speed = info->params.clock_speed;
 
 	info->params.clock_speed = 3686400;
-	info->tty = 0;
+	info->tty = NULL;
 
 	/* assume failure */
 	info->init_error = DiagStatus_DmaFailure;
diff --git a/drivers/char/tipar.c b/drivers/char/tipar.c
index 8cbf15bb5..48d7a7cc0 100644
--- a/drivers/char/tipar.c
+++ b/drivers/char/tipar.c
@@ -262,7 +262,7 @@ tipar_open(struct inode *inode, struct file *file)
 	init_ti_parallel(minor);
 	parport_release(table[minor].dev);
 
-	return 0;
+	return nonseekable_open(inode, file);
 }
 
 static int
@@ -279,7 +279,7 @@ tipar_close(struct inode *inode, struct file *file)
 }
 
 static ssize_t
-tipar_write(struct file *file, const char *buf, size_t count, loff_t * ppos)
+tipar_write(struct file *file, const char __user *buf, size_t count, loff_t * ppos)
 {
 	unsigned int minor = iminor(file->f_dentry->d_inode) - TIPAR_MINOR;
 	ssize_t n;
@@ -306,7 +306,7 @@ tipar_write(struct file *file, const char *buf, size_t count, loff_t * ppos)
 }
 
 static ssize_t
-tipar_read(struct file *file, char *buf, size_t count, loff_t * ppos)
+tipar_read(struct file *file, char __user *buf, size_t count, loff_t * ppos)
 {
 	int b = 0;
 	unsigned int minor = iminor(file->f_dentry->d_inode) - TIPAR_MINOR;
@@ -316,9 +316,6 @@ tipar_read(struct file *file, char *buf, size_t count, loff_t * ppos)
 	if (count == 0)
 		return 0;
 
-	if (ppos != &file->f_pos)
-		return -ESPIPE;
-
 	parport_claim_or_block(table[minor].dev);
 
 	while (n < count) {
@@ -328,7 +325,7 @@ tipar_read(struct file *file, char *buf, size_t count, loff_t * ppos)
 			retval = -ETIMEDOUT;
 			goto out;
 		} else {
-			if (put_user(b, ((unsigned char *) buf) + n)) {
+			if (put_user(b, buf + n)) {
 				retval = -EFAULT;
 				break;
 			} else
diff --git a/drivers/char/tpqic02.c b/drivers/char/tpqic02.c
index 6ee95af21..66881e953 100644
--- a/drivers/char/tpqic02.c
+++ b/drivers/char/tpqic02.c
@@ -898,7 +898,7 @@ static int ll_do_qic_cmd(int cmd, time_t timeout)
 		printk(TPQIC02_NAME ": ll_do_qic_cmd(%x, %ld) failed\n", cmd, (long) timeout);
 		return -EIO;
 	}
-#if OBSOLETE
+#ifdef OBSOLETE
 	/* wait for ready since it may not be active immediately after reading status */
 	while ((inb_p(QIC02_STAT_PORT) & QIC02_STAT_READY) != 0)
 		cpu_relax();
@@ -1419,7 +1419,7 @@ static int start_dma(short mode, unsigned long bytes_todo)
 		if (stat != TE_OK)
 			return stat;
 
-#if OBSOLETE
+#ifdef OBSOLETE
 		/************* not needed iff rd_status() would wait for ready!!!!!! **********/
 		if (wait_for_ready(TIM_S) != TE_OK) {	/*** not sure this is needed ***/
 			tpqputs(TPQD_ALWAYS, "wait_for_ready failed in start_dma");
@@ -2589,7 +2589,7 @@ static void qic02_release_resources(void)
 	release_region(QIC02_TAPE_PORT, QIC02_TAPE_PORT_RANGE);
 	if (buffaddr)
 		free_pages((unsigned long) buffaddr, get_order(TPQBUF_SIZE));
-	buffaddr = 0;		/* Better to cause a panic than overwite someone else */
+	buffaddr = NULL;	/* Better to cause a panic than overwite someone else */
 	status_zombie = YES;
 }				/* qic02_release_resources */
 
diff --git a/drivers/char/tty_io.c b/drivers/char/tty_io.c
index 0c762379a..91f530c61 100644
--- a/drivers/char/tty_io.c
+++ b/drivers/char/tty_io.c
@@ -91,6 +91,7 @@
 #include <linux/module.h>
 #include <linux/smp_lock.h>
 #include <linux/device.h>
+#include <linux/idr.h>
 
 #include <asm/uaccess.h>
 #include <asm/system.h>
@@ -128,6 +129,8 @@ DECLARE_MUTEX(tty_sem);
 #ifdef CONFIG_UNIX98_PTYS
 extern struct tty_driver *ptm_driver;	/* Unix98 pty masters; for /dev/ptmx */
 extern int pty_limit;		/* Config limit on Unix98 ptys */
+static DEFINE_IDR(allocated_ptys);
+static DECLARE_MUTEX(allocated_ptys_lock);
 #endif
 
 extern void disable_early_printk(void);
@@ -342,18 +345,12 @@ EXPORT_SYMBOL(tty_check_change);
 static ssize_t hung_up_tty_read(struct file * file, char __user * buf,
 				size_t count, loff_t *ppos)
 {
-	/* Can't seek (pread) on ttys.  */
-	if (ppos != &file->f_pos)
-		return -ESPIPE;
 	return 0;
 }
 
 static ssize_t hung_up_tty_write(struct file * file, const char __user * buf,
 				 size_t count, loff_t *ppos)
 {
-	/* Can't seek (pwrite) on ttys.  */
-	if (ppos != &file->f_pos)
-		return -ESPIPE;
 	return -EIO;
 }
 
@@ -645,10 +642,6 @@ static ssize_t tty_read(struct file * file, char __user * buf, size_t count,
 	struct tty_struct * tty;
 	struct inode *inode;
 
-	/* Can't seek (pread) on ttys.  */
-	if (ppos != &file->f_pos)
-		return -ESPIPE;
-
 	tty = (struct tty_struct *)file->private_data;
 	inode = file->f_dentry->d_inode;
 	if (tty_paranoia_check(tty, inode, "tty_read"))
@@ -723,10 +716,6 @@ static ssize_t tty_write(struct file * file, const char __user * buf, size_t cou
 	struct tty_struct * tty;
 	struct inode *inode = file->f_dentry->d_inode;
 
-	/* Can't seek (pwrite) on ttys.  */
-	if (ppos != &file->f_pos)
-		return -ESPIPE;
-
 	tty = (struct tty_struct *)file->private_data;
 	if (tty_paranoia_check(tty, inode, "tty_write"))
 		return -EIO;
@@ -752,9 +741,6 @@ ssize_t redirected_tty_write(struct file * file, const char __user * buf, size_t
 
 	if (p) {
 		ssize_t res;
-		/* Can't seek (pwrite) on ttys.  */
-		if (ppos != &file->f_pos)
-			return -ESPIPE;
 		res = vfs_write(p, buf, count, &p->f_pos);
 		fput(p);
 		return res;
@@ -1065,6 +1051,7 @@ static void release_dev(struct file * filp)
 {
 	struct tty_struct *tty, *o_tty;
 	int	pty_master, tty_closing, o_tty_closing, do_sleep;
+	int	devpts_master, devpts;
 	int	idx;
 	char	buf[64];
 	
@@ -1079,6 +1066,8 @@ static void release_dev(struct file * filp)
 	idx = tty->index;
 	pty_master = (tty->driver->type == TTY_DRIVER_TYPE_PTY &&
 		      tty->driver->subtype == PTY_TYPE_MASTER);
+	devpts = (tty->driver->flags & TTY_DRIVER_DEVPTS_MEM) != 0;
+	devpts_master = pty_master && devpts;
 	o_tty = tty->link;
 
 #ifdef TTY_PARANOIA_CHECK
@@ -1295,11 +1284,21 @@ static void release_dev(struct file * filp)
 		o_tty->ldisc = ldiscs[N_TTY];
 	}
 
-	/* 
+	/*
 	 * The release_mem function takes care of the details of clearing
 	 * the slots and preserving the termios structure.
 	 */
 	release_mem(tty, idx);
+
+#ifdef CONFIG_UNIX98_PTYS
+	/* Make this pty number available for reallocation */
+	if (devpts) {
+		down(&allocated_ptys_lock);
+		idr_remove(&allocated_ptys, idx);
+		up(&allocated_ptys_lock);
+	}
+#endif
+
 }
 
 /*
@@ -1322,8 +1321,13 @@ static int tty_open(struct inode * inode, struct file * filp)
 	int index;
 	dev_t device = inode->i_rdev;
 	unsigned short saved_flags = filp->f_flags;
+
+	nonseekable_open(inode, filp);
 retry_open:
 	noctty = filp->f_flags & O_NOCTTY;
+	index  = -1;
+	retval = 0;
+
 	if (device == MKDEV(TTYAUX_MAJOR,0)) {
 		if (!current->signal->tty)
 			return -ENXIO;
@@ -1344,13 +1348,8 @@ retry_open:
 	}
 #endif
 	if (device == MKDEV(TTYAUX_MAJOR,1)) {
-		struct console *c = console_drivers;
-		for (c = console_drivers; c; c = c->next) {
-			if (!c->device)
-				continue;
-			driver = c->device(c, &index);
-			if (!driver)
-				continue;
+		driver = console_device(&index);
+		if (driver) {
 			/* Don't let /dev/console block */
 			filp->f_flags |= O_NONBLOCK;
 			noctty = 1;
@@ -1361,24 +1360,40 @@ retry_open:
 
 #ifdef CONFIG_UNIX98_PTYS
 	if (device == MKDEV(TTYAUX_MAJOR,2)) {
+		int idr_ret;
+
 		/* find a device that is not in use. */
-		static int next_ptmx_dev = 0;
-		retval = -1;
+		down(&allocated_ptys_lock);
+		if (!idr_pre_get(&allocated_ptys, GFP_KERNEL)) {
+			up(&allocated_ptys_lock);
+			return -ENOMEM;
+		}
+		idr_ret = idr_get_new(&allocated_ptys, NULL, &index);
+		if (idr_ret < 0) {
+			up(&allocated_ptys_lock);
+			if (idr_ret == -EAGAIN)
+				return -ENOMEM;
+			return -EIO;
+		}
+		if (index >= pty_limit) {
+			idr_remove(&allocated_ptys, index);
+			up(&allocated_ptys_lock);
+			return -EIO;
+		}
+		up(&allocated_ptys_lock);
+
 		driver = ptm_driver;
-		while (driver->refcount < pty_limit) {
-			index = next_ptmx_dev;
-			next_ptmx_dev = (next_ptmx_dev+1) % driver->num;
-			if (!init_dev(driver, index, &tty))
-				goto ptmx_found; /* ok! */
+		retval = init_dev(driver, index, &tty);
+		if (retval) {
+			down(&allocated_ptys_lock);
+			idr_remove(&allocated_ptys, index);
+			up(&allocated_ptys_lock);
+			return retval;
 		}
-		return -EIO; /* no free ptys */
-	ptmx_found:
+
 		set_bit(TTY_PTY_LOCK, &tty->flags); /* LOCK THE SLAVE */
-		if (devpts_pty_new(tty->link)) {
-			/* BADNESS - need to destroy both ptm and pts! */
-			return -ENOMEM;
-		}
-		noctty = 1;
+		if (devpts_pty_new(tty->link))
+			retval = -ENOMEM;
 	} else
 #endif
 	{
@@ -1400,10 +1415,12 @@ got_driver:
 #ifdef TTY_DEBUG_HANGUP
 	printk(KERN_DEBUG "opening %s...", tty->name);
 #endif
-	if (tty->driver->open)
-		retval = tty->driver->open(tty, filp);
-	else
-		retval = -ENODEV;
+	if (!retval) {
+		if (tty->driver->open)
+			retval = tty->driver->open(tty, filp);
+		else
+			retval = -ENODEV;
+	}
 	filp->f_flags = saved_flags;
 
 	if (!retval && test_bit(TTY_EXCLUSIVE, &tty->flags) && !capable(CAP_SYS_ADMIN))
@@ -1415,6 +1432,14 @@ got_driver:
 		       tty->name);
 #endif
 
+#ifdef CONFIG_UNIX98_PTYS
+		if (index != -1) {
+			down(&allocated_ptys_lock);
+			idr_remove(&allocated_ptys, index);
+			up(&allocated_ptys_lock);
+		}
+#endif
+
 		release_dev(filp);
 		if (retval != -ERESTARTSYS)
 			return retval;
diff --git a/drivers/char/vc_screen.c b/drivers/char/vc_screen.c
index c357ab7f9..c5c6b5e26 100644
--- a/drivers/char/vc_screen.c
+++ b/drivers/char/vc_screen.c
@@ -70,11 +70,11 @@ static loff_t vcs_lseek(struct file *file, loff_t offset, int orig)
 {
 	int size;
 
-	lock_kernel();
+	down(&con_buf_sem);
 	size = vcs_size(file->f_dentry->d_inode);
 	switch (orig) {
 		default:
-			unlock_kernel();
+			up(&con_buf_sem);
 			return -EINVAL;
 		case 2:
 			offset += size;
@@ -85,28 +85,21 @@ static loff_t vcs_lseek(struct file *file, loff_t offset, int orig)
 			break;
 	}
 	if (offset < 0 || offset > size) {
-		unlock_kernel();
+		up(&con_buf_sem);
 		return -EINVAL;
 	}
 	file->f_pos = offset;
-	unlock_kernel();
+	up(&con_buf_sem);
 	return file->f_pos;
 }
 
-/* We share this temporary buffer with the console write code
- * so that we can easily avoid touching user space while holding the
- * console spinlock.
- */
-extern char con_buf[PAGE_SIZE];
-#define CON_BUF_SIZE	PAGE_SIZE
-extern struct semaphore con_buf_sem;
 
 static ssize_t
 vcs_read(struct file *file, char __user *buf, size_t count, loff_t *ppos)
 {
 	struct inode *inode = file->f_dentry->d_inode;
 	unsigned int currcons = iminor(inode);
-	long pos = *ppos;
+	long pos;
 	long viewed, attr, read;
 	int col, maxcol;
 	unsigned short *org = NULL;
@@ -114,6 +107,8 @@ vcs_read(struct file *file, char __user *buf, size_t count, loff_t *ppos)
 
 	down(&con_buf_sem);
 
+	pos = *ppos;
+
 	/* Select the proper current console and verify
 	 * sanity of the situation under the console lock.
 	 */
@@ -275,7 +270,7 @@ vcs_write(struct file *file, const char __user *buf, size_t count, loff_t *ppos)
 {
 	struct inode *inode = file->f_dentry->d_inode;
 	unsigned int currcons = iminor(inode);
-	long pos = *ppos;
+	long pos;
 	long viewed, attr, size, written;
 	char *con_buf0;
 	int col, maxcol;
@@ -284,6 +279,8 @@ vcs_write(struct file *file, const char __user *buf, size_t count, loff_t *ppos)
 
 	down(&con_buf_sem);
 
+	pos = *ppos;
+
 	/* Select the proper current console and verify
 	 * sanity of the situation under the console lock.
 	 */
diff --git a/drivers/char/viotape.c b/drivers/char/viotape.c
index a5915c1e7..34a48d2f2 100644
--- a/drivers/char/viotape.c
+++ b/drivers/char/viotape.c
@@ -53,6 +53,7 @@
 #include <asm/uaccess.h>
 #include <asm/ioctls.h>
 
+#include <asm/vio.h>
 #include <asm/iSeries/vio.h>
 #include <asm/iSeries/HvLpEvent.h>
 #include <asm/iSeries/HvCallEvent.h>
@@ -216,7 +217,7 @@ static const struct vio_error_entry viotape_err_table[] = {
 };
 
 /* Maximum number of tapes we support */
-#define VIOTAPE_MAX_TAPE	8
+#define VIOTAPE_MAX_TAPE	HVMAXARCHITECTEDVIRTUALTAPES
 #define MAX_PARTITIONS		4
 
 /* defines for current tape state */
@@ -238,6 +239,8 @@ static struct mtget viomtget[VIOTAPE_MAX_TAPE];
 
 static struct class_simple *tape_class;
 
+static struct device *tape_device[VIOTAPE_MAX_TAPE];
+
 /*
  * maintain the current state of each tape (and partition)
  * so that we know when to write EOF marks.
@@ -262,6 +265,7 @@ struct op_struct {
 	int			rc;
 	int			non_blocking;
 	struct completion	com;
+	struct device		*dev;
 	struct op_struct	*next;
 };
 
@@ -459,7 +463,8 @@ static ssize_t viotap_write(struct file *file, const char *buf,
 		down(&reqSem);
 
 	/* Allocate a DMA buffer */
-	op->buffer = dma_alloc_coherent(iSeries_vio_dev, count, &op->dmaaddr,
+	op->dev = tape_device[devi.devno];
+	op->buffer = dma_alloc_coherent(op->dev, count, &op->dmaaddr,
 			GFP_ATOMIC);
 
 	if (op->buffer == NULL) {
@@ -509,7 +514,7 @@ static ssize_t viotap_write(struct file *file, const char *buf,
 	}
 
 free_dma:
-	dma_free_coherent(iSeries_vio_dev, count, op->buffer, op->dmaaddr);
+	dma_free_coherent(op->dev, count, op->buffer, op->dmaaddr);
 up_sem:
 	up(&reqSem);
 free_op:
@@ -550,7 +555,8 @@ static ssize_t viotap_read(struct file *file, char *buf, size_t count,
 	chg_state(devi.devno, VIOT_READING, file);
 
 	/* Allocate a DMA buffer */
-	op->buffer = dma_alloc_coherent(iSeries_vio_dev, count, &op->dmaaddr,
+	op->dev = tape_device[devi.devno];
+	op->buffer = dma_alloc_coherent(op->dev, count, &op->dmaaddr,
 			GFP_ATOMIC);
 	if (op->buffer == NULL) {
 		ret = -EFAULT;
@@ -588,7 +594,7 @@ static ssize_t viotap_read(struct file *file, char *buf, size_t count,
 	}
 
 free_dma:
-	dma_free_coherent(iSeries_vio_dev, count, op->buffer, op->dmaaddr);
+	dma_free_coherent(op->dev, count, op->buffer, op->dmaaddr);
 up_sem:
 	up(&reqSem);
 free_op:
@@ -910,7 +916,7 @@ static void vioHandleTapeEvent(struct HvLpEvent *event)
 		break;
 	case viotapewrite:
 		if (op->non_blocking) {
-			dma_free_coherent(iSeries_vio_dev, op->count,
+			dma_free_coherent(op->dev, op->count,
 					op->buffer, op->dmaaddr);
 			free_op_struct(op);
 			up(&reqSem);
@@ -936,12 +942,70 @@ static void vioHandleTapeEvent(struct HvLpEvent *event)
 	}
 }
 
+static int viotape_probe(struct vio_dev *vdev, const struct vio_device_id *id)
+{
+	char tapename[32];
+	int i = vdev->unit_address;
+	int j;
+
+	if (i >= viotape_numdev)
+		return -ENODEV;
+
+	tape_device[i] = &vdev->dev;
+
+	state[i].cur_part = 0;
+	for (j = 0; j < MAX_PARTITIONS; ++j)
+		state[i].part_stat_rwi[j] = VIOT_IDLE;
+	class_simple_device_add(tape_class, MKDEV(VIOTAPE_MAJOR, i), NULL,
+			"iseries!vt%d", i);
+	class_simple_device_add(tape_class, MKDEV(VIOTAPE_MAJOR, i | 0x80),
+			NULL, "iseries!nvt%d", i);
+	devfs_mk_cdev(MKDEV(VIOTAPE_MAJOR, i), S_IFCHR | S_IRUSR | S_IWUSR,
+			"iseries/vt%d", i);
+	devfs_mk_cdev(MKDEV(VIOTAPE_MAJOR, i | 0x80),
+			S_IFCHR | S_IRUSR | S_IWUSR, "iseries/nvt%d", i);
+	sprintf(tapename, "iseries/vt%d", i);
+	state[i].dev_handle = devfs_register_tape(tapename);
+	printk(VIOTAPE_KERN_INFO "tape %s is iSeries "
+			"resource %10.10s type %4.4s, model %3.3s\n",
+			tapename, viotape_unitinfo[i].rsrcname,
+			viotape_unitinfo[i].type, viotape_unitinfo[i].model);
+	return 0;
+}
+
+static int viotape_remove(struct vio_dev *vdev)
+{
+	int i = vdev->unit_address;
+
+	devfs_remove("iseries/nvt%d", i);
+	devfs_remove("iseries/vt%d", i);
+	devfs_unregister_tape(state[i].dev_handle);
+	class_simple_device_remove(MKDEV(VIOTAPE_MAJOR, i | 0x80));
+	class_simple_device_remove(MKDEV(VIOTAPE_MAJOR, i));
+	return 0;
+}
+
+/**
+ * viotape_device_table: Used by vio.c to match devices that we
+ * support.
+ */
+static struct vio_device_id viotape_device_table[] __devinitdata = {
+	{ "viotape", "" },
+	{ 0, }
+};
+
+MODULE_DEVICE_TABLE(vio, viotape_device_table);
+static struct vio_driver viotape_driver = {
+	.name = "viotape",
+	.id_table = viotape_device_table,
+	.probe = viotape_probe,
+	.remove = viotape_remove
+};
+
 
 int __init viotap_init(void)
 {
 	int ret;
-	char tapename[32];
-	int i;
 	struct proc_dir_entry *e;
 
 	op_struct_list = NULL;
@@ -993,31 +1057,9 @@ int __init viotap_init(void)
 		goto unreg_class;
 	}
 
-	for (i = 0; i < viotape_numdev; i++) {
-		int j;
-
-		state[i].cur_part = 0;
-		for (j = 0; j < MAX_PARTITIONS; ++j)
-			state[i].part_stat_rwi[j] = VIOT_IDLE;
-		class_simple_device_add(tape_class, MKDEV(VIOTAPE_MAJOR, i),
-				NULL, "iseries!vt%d", i);
-		class_simple_device_add(tape_class,
-				MKDEV(VIOTAPE_MAJOR, i | 0x80),
-				NULL, "iseries!nvt%d", i);
-		devfs_mk_cdev(MKDEV(VIOTAPE_MAJOR, i),
-				S_IFCHR | S_IRUSR | S_IWUSR,
-				"iseries/vt%d", i);
-		devfs_mk_cdev(MKDEV(VIOTAPE_MAJOR, i | 0x80),
-				S_IFCHR | S_IRUSR | S_IWUSR,
-				"iseries/nvt%d", i);
-		sprintf(tapename, "iseries/vt%d", i);
-		state[i].dev_handle = devfs_register_tape(tapename);
-		printk(VIOTAPE_KERN_INFO "tape %s is iSeries "
-				"resource %10.10s type %4.4s, model %3.3s\n",
-				tapename, viotape_unitinfo[i].rsrcname,
-				viotape_unitinfo[i].type,
-				viotape_unitinfo[i].model);
-	}
+	ret = vio_register_driver(&viotape_driver);
+	if (ret)
+		goto unreg_class;
 
 	e = create_proc_entry("iSeries/viotape", S_IFREG|S_IRUGO, NULL);
 	if (e) {
@@ -1064,17 +1106,10 @@ static int chg_state(int index, unsigned char new_state, struct file *file)
 /* Cleanup */
 static void __exit viotap_exit(void)
 {
-	int i, ret;
+	int ret;
 
 	remove_proc_entry("iSeries/viotape", NULL);
-
-	for (i = 0; i < viotape_numdev; ++i) {
-		devfs_remove("iseries/nvt%d", i);
-		devfs_remove("iseries/vt%d", i);
-		devfs_unregister_tape(state[i].dev_handle);
-		class_simple_device_remove(MKDEV(VIOTAPE_MAJOR, i | 0x80));
-		class_simple_device_remove(MKDEV(VIOTAPE_MAJOR, i));
-	}
+	vio_unregister_driver(&viotape_driver);
 	class_simple_destroy(tape_class);
 	ret = unregister_chrdev(VIOTAPE_MAJOR, "viotape");
 	if (ret < 0)
diff --git a/drivers/char/vt.c b/drivers/char/vt.c
index 521b6fbff..a204572f5 100644
--- a/drivers/char/vt.c
+++ b/drivers/char/vt.c
@@ -100,6 +100,7 @@
 #include <linux/workqueue.h>
 #include <linux/bootmem.h>
 #include <linux/pm.h>
+#include <linux/font.h>
 
 #include <asm/io.h>
 #include <asm/system.h>
@@ -1865,7 +1866,6 @@ static void do_con_trol(struct tty_struct *tty, unsigned int currcons, int c)
  * kernel memory allocation is available.
  */
 char con_buf[PAGE_SIZE];
-#define CON_BUF_SIZE	PAGE_SIZE
 DECLARE_MUTEX(con_buf_sem);
 
 /* acquires console_sem */
@@ -2499,7 +2499,7 @@ static void con_close(struct tty_struct *tty, struct file *filp)
 		vt = tty->driver_data;
 		if (vt)
 			vc_cons[vt->vc_num].d->vc_tty = NULL;
-		tty->driver_data = 0;
+		tty->driver_data = NULL;
 		release_console_sem();
 		vcs_remove_devfs(tty);
 		up(&tty_sem);
@@ -2712,6 +2712,10 @@ int take_over_console(const struct consw *csw, int first, int last, int deflt)
 			save_screen(i);
 		old_was_color = vc_cons[i].d->vc_can_do_color;
 		vc_cons[i].d->vc_sw->con_deinit(vc_cons[i].d);
+		origin = (unsigned long) screenbuf;
+		visible_origin = origin;
+		scr_end = origin + screenbuf_size;
+		pos = origin + video_size_row*y + 2*x;
 		visual_init(i, 0);
 		update_attr(i);
 
@@ -3020,98 +3024,182 @@ void reset_palette(int currcons)
 
 #define max_font_size 65536
 
-int con_font_op(int currcons, struct console_font_op *op)
+int con_font_get(int currcons, struct console_font_op *op)
 {
+	struct console_font font;
 	int rc = -EINVAL;
-	int size = max_font_size, set;
-	u8 *temp = NULL;
-	struct console_font_op old_op;
+	int c;
 
 	if (vt_cons[currcons]->vc_mode != KD_TEXT)
-		goto quit;
-	memcpy(&old_op, op, sizeof(old_op));
-	if (op->op == KD_FONT_OP_SET) {
-		if (!op->data)
-			return -EINVAL;
-		if (op->charcount > 512)
-			goto quit;
-		if (!op->height) {		/* Need to guess font height [compat] */
-			int h, i;
-			u8 __user *charmap = op->data;
-			u8 tmp;
-			
-			/* If from KDFONTOP ioctl, don't allow things which can be done in userland,
-			   so that we can get rid of this soon */
-			if (!(op->flags & KD_FONT_FLAG_OLD))
-				goto quit;
-			rc = -EFAULT;
-			for (h = 32; h > 0; h--)
-				for (i = 0; i < op->charcount; i++) {
-					if (get_user(tmp, &charmap[32*i+h-1]))
-						goto quit;
-					if (tmp)
-						goto nonzero;
-				}
-			rc = -EINVAL;
-			goto quit;
-		nonzero:
-			rc = -EINVAL;
-			op->height = h;
-		}
-		if (op->width > 32 || op->height > 32)
-			goto quit;
-		size = (op->width+7)/8 * 32 * op->charcount;
-		if (size > max_font_size)
-			return -ENOSPC;
-		set = 1;
-	} else if (op->op == KD_FONT_OP_GET)
-		set = 0;
-	else {
-		acquire_console_sem();
-		rc = sw->con_font_op(vc_cons[currcons].d, op);
-		release_console_sem();
-		return rc;
-	}
+		return -EINVAL;
+
 	if (op->data) {
-		temp = kmalloc(size, GFP_KERNEL);
-		if (!temp)
+		font.data = kmalloc(max_font_size, GFP_KERNEL);
+		if (!font.data)
 			return -ENOMEM;
-		if (set && copy_from_user(temp, op->data, size)) {
-			rc = -EFAULT;
-			goto quit;
-		}
-		op->data = temp;
-	}
+	} else
+		font.data = NULL;
 
 	acquire_console_sem();
-	rc = sw->con_font_op(vc_cons[currcons].d, op);
+	if (sw->con_font_get)
+		rc = sw->con_font_get(vc_cons[currcons].d, &font);
+	else
+		rc = -ENOSYS;
 	release_console_sem();
 
-	op->data = old_op.data;
-	if (!rc && !set) {
-		int c = (op->width+7)/8 * 32 * op->charcount;
-		
-		if (op->data && op->charcount > old_op.charcount)
+	if (rc)
+		goto out;
+
+	c = (font.width+7)/8 * 32 * font.charcount;
+	
+	if (op->data && font.charcount > op->charcount)
+		rc = -ENOSPC;
+	if (!(op->flags & KD_FONT_FLAG_OLD)) {
+		if (font.width > op->width || font.height > op->height) 
 			rc = -ENOSPC;
-		if (!(op->flags & KD_FONT_FLAG_OLD)) {
-			if (op->width > old_op.width || 
-			    op->height > old_op.height)
-				rc = -ENOSPC;
-		} else {
-			if (op->width != 8)
-				rc = -EIO;
-			else if ((old_op.height && op->height > old_op.height) ||
-			         op->height > 32)
-				rc = -ENOSPC;
-		}
-		if (!rc && op->data && copy_to_user(op->data, temp, c))
-			rc = -EFAULT;
+	} else {
+		if (font.width != 8)
+			rc = -EIO;
+		else if ((op->height && font.height > op->height) ||
+			 font.height > 32)
+			rc = -ENOSPC;
+	}
+	if (rc)
+		goto out;
+
+	if (op->data && copy_to_user(op->data, font.data, c))
+		rc = -EFAULT;
+
+out:
+	kfree(font.data);
+	return rc;
+}
+
+int con_font_set(int currcons, struct console_font_op *op)
+{
+	struct console_font font;
+	int rc = -EINVAL;
+	int size;
+
+	if (vt_cons[currcons]->vc_mode != KD_TEXT)
+		return -EINVAL;
+	if (!op->data)
+		return -EINVAL;
+	if (op->charcount > 512)
+		return -EINVAL;
+	if (!op->height) {		/* Need to guess font height [compat] */
+		int h, i;
+		u8 __user *charmap = op->data;
+		u8 tmp;
+		
+		/* If from KDFONTOP ioctl, don't allow things which can be done in userland,
+		   so that we can get rid of this soon */
+		if (!(op->flags & KD_FONT_FLAG_OLD))
+			return -EINVAL;
+		for (h = 32; h > 0; h--)
+			for (i = 0; i < op->charcount; i++) {
+				if (get_user(tmp, &charmap[32*i+h-1]))
+					return -EFAULT;
+				if (tmp)
+					goto nonzero;
+			}
+		return -EINVAL;
+	nonzero:
+		op->height = h;
+	}
+	if (op->width <= 0 || op->width > 32 || op->height > 32)
+		return -EINVAL;
+	size = (op->width+7)/8 * 32 * op->charcount;
+	if (size > max_font_size)
+		return -ENOSPC;
+	font.charcount = op->charcount;
+	font.height = op->height;
+	font.width = op->width;
+	font.data = kmalloc(size, GFP_KERNEL);
+	if (!font.data)
+		return -ENOMEM;
+	if (copy_from_user(font.data, op->data, size)) {
+		kfree(font.data);
+		return -EFAULT;
 	}
-quit:	if (temp)
-		kfree(temp);
+	acquire_console_sem();
+	if (sw->con_font_set)
+		rc = sw->con_font_set(vc_cons[currcons].d, &font, op->flags);
+	else
+		rc = -ENOSYS;
+	release_console_sem();
+	kfree(font.data);
 	return rc;
 }
 
+int con_font_default(int currcons, struct console_font_op *op)
+{
+	struct console_font font = {.width = op->width, .height = op->height};
+	char name[MAX_FONT_NAME];
+	char *s = name;
+	int rc;
+
+	if (vt_cons[currcons]->vc_mode != KD_TEXT)
+		return -EINVAL;
+
+	if (!op->data)
+		s = NULL;
+	else if (strncpy_from_user(name, op->data, MAX_FONT_NAME - 1) < 0)
+		return -EFAULT;
+	else
+		name[MAX_FONT_NAME - 1] = 0;
+
+	acquire_console_sem();
+	if (sw->con_font_default)
+		rc = sw->con_font_default(vc_cons[currcons].d, &font, s);
+	else
+		rc = -ENOSYS;
+	release_console_sem();
+	if (!rc) {
+		op->width = font.width;
+		op->height = font.height;
+	}
+	return rc;
+}
+
+int con_font_copy(int currcons, struct console_font_op *op)
+{
+	int con = op->height;
+	struct vc_data *vc;
+	int rc;
+
+	if (vt_cons[currcons]->vc_mode != KD_TEXT)
+		return -EINVAL;
+
+	acquire_console_sem();
+	vc = vc_cons[currcons].d;
+	if (!sw->con_font_copy)
+		rc = -ENOSYS;
+	else if (con < 0 || !vc_cons_allocated(con))
+		rc = -ENOTTY;
+	else if (con == vc->vc_num)	/* nothing to do */
+		rc = 0;
+	else
+		rc = sw->con_font_copy(vc, con);
+	release_console_sem();
+	return rc;
+}
+
+int con_font_op(int currcons, struct console_font_op *op)
+{
+	switch (op->op) {
+	case KD_FONT_OP_SET:
+		return con_font_set(currcons, op);
+	case KD_FONT_OP_GET:
+		return con_font_get(currcons, op);
+	case KD_FONT_OP_SET_DEFAULT:
+		return con_font_default(currcons, op);
+	case KD_FONT_OP_COPY:
+		return con_font_copy(currcons, op);
+	}
+	return -ENOSYS;
+}
+
 /*
  *	Interface exported to selection and vcs.
  */
diff --git a/drivers/char/vt_ioctl.c b/drivers/char/vt_ioctl.c
index 2cd1770eb..682b44e9d 100644
--- a/drivers/char/vt_ioctl.c
+++ b/drivers/char/vt_ioctl.c
@@ -100,7 +100,7 @@ do_kdsk_ioctl(int cmd, struct kbentry __user *user_kbe, int perm, struct kbd_str
 			/* disallocate map */
 			key_map = key_maps[s];
 			if (s && key_map) {
-			    key_maps[s] = 0;
+			    key_maps[s] = NULL;
 			    if (key_map[0] == U(K_ALLOCATED)) {
 					kfree(key_map);
 					keymap_count--;
@@ -915,7 +915,7 @@ int vt_ioctl(struct tty_struct *tty, struct file * file,
 		op.width = 8;
 		op.height = 0;
 		op.charcount = 256;
-		op.data = (char *) arg;
+		op.data = up;
 		return con_font_op(fg_console, &op);
 	}
 
@@ -925,7 +925,7 @@ int vt_ioctl(struct tty_struct *tty, struct file * file,
 		op.width = 8;
 		op.height = 32;
 		op.charcount = 256;
-		op.data = (char *) arg;
+		op.data = up;
 		return con_font_op(fg_console, &op);
 	}
 
diff --git a/drivers/char/watchdog/Kconfig b/drivers/char/watchdog/Kconfig
index c2b2dec80..a9dec9e98 100644
--- a/drivers/char/watchdog/Kconfig
+++ b/drivers/char/watchdog/Kconfig
@@ -95,13 +95,25 @@ config IXP4XX_WATCHDOG
 
 	  Say N if you are unsure.
 
+config IXP2000_WATCHDOG
+	tristate "IXP2000 Watchdog"
+	depends on WATCHDOG && ARCH_IXP2000
+	help
+	  Say Y here if to include support for the watchdog timer
+	  in the Intel IXP2000(2400, 2800, 2850) network processors.
+	  This driver can be built as a module by choosing M. The module
+	  will be called ixp2000_wdt.
+
+	  Say N if you are unsure.
+
 config SA1100_WATCHDOG
-	tristate "SA1100 watchdog"
-	depends on WATCHDOG && ARCH_SA1100
+	tristate "SA1100/PXA2xx watchdog"
+	depends on WATCHDOG && ( ARCH_SA1100 || ARCH_PXA )
 	help
-	  Watchdog timer embedded into SA11x0 chips. This will reboot your
-	  system when timeout is reached.
-	  NOTE, that once enabled, this timer cannot be disabled.
+	  Watchdog timer embedded into SA11x0 and PXA2xx chips. This will
+	  reboot your system when timeout is reached.
+
+	  NOTE: once enabled, this timer cannot be disabled.
 
 	  To compile this driver as a module, choose M here: the
 	  module will be called sa1100_wdt.
diff --git a/drivers/char/watchdog/Makefile b/drivers/char/watchdog/Makefile
index 76d260550..c5f99d332 100644
--- a/drivers/char/watchdog/Makefile
+++ b/drivers/char/watchdog/Makefile
@@ -36,3 +36,4 @@ obj-$(CONFIG_INDYDOG) += indydog.o
 obj-$(CONFIG_PCIPCWATCHDOG) += pcwd_pci.o
 obj-$(CONFIG_USBPCWATCHDOG) += pcwd_usb.o
 obj-$(CONFIG_IXP4XX_WATCHDOG) += ixp4xx_wdt.o
+obj-$(CONFIG_IXP2000_WATCHDOG) += ixp2000_wdt.o
diff --git a/drivers/char/watchdog/acquirewdt.c b/drivers/char/watchdog/acquirewdt.c
index acb25de93..8f3021217 100644
--- a/drivers/char/watchdog/acquirewdt.c
+++ b/drivers/char/watchdog/acquirewdt.c
@@ -111,12 +111,8 @@ static void acq_stop(void)
  *	/dev/watchdog handling.
  */
 
-static ssize_t acq_write(struct file *file, const char *buf, size_t count, loff_t *ppos)
+static ssize_t acq_write(struct file *file, const char __user *buf, size_t count, loff_t *ppos)
 {
-	/*  Can't seek (pwrite) on this device  */
-	if (ppos != &file->f_pos)
-		return -ESPIPE;
-
 	/* See if we got the magic character 'V' and reload the timer */
 	if(count) {
 		if (!nowayout) {
@@ -146,6 +142,8 @@ static int acq_ioctl(struct inode *inode, struct file *file, unsigned int cmd,
 	unsigned long arg)
 {
 	int options, retval = -EINVAL;
+	void __user *argp = (void __user *)arg;
+	int __user *p = argp;
 	static struct watchdog_info ident =
 	{
 		.options = WDIOF_KEEPALIVEPING | WDIOF_MAGICCLOSE,
@@ -156,22 +154,22 @@ static int acq_ioctl(struct inode *inode, struct file *file, unsigned int cmd,
 	switch(cmd)
 	{
 	case WDIOC_GETSUPPORT:
-	  return copy_to_user((struct watchdog_info *)arg, &ident, sizeof(ident)) ? -EFAULT : 0;
+	  return copy_to_user(argp, &ident, sizeof(ident)) ? -EFAULT : 0;
 
 	case WDIOC_GETSTATUS:
 	case WDIOC_GETBOOTSTATUS:
-	  return put_user(0, (int *)arg);
+	  return put_user(0, p);
 
 	case WDIOC_KEEPALIVE:
 	  acq_keepalive();
 	  return 0;
 
 	case WDIOC_GETTIMEOUT:
-	  return put_user(WATCHDOG_HEARTBEAT, (int *)arg);
+	  return put_user(WATCHDOG_HEARTBEAT, p);
 
 	case WDIOC_SETOPTIONS:
 	{
-	    if (get_user(options, (int *)arg))
+	    if (get_user(options, p))
 	      return -EFAULT;
 
 	    if (options & WDIOS_DISABLECARD)
@@ -204,7 +202,7 @@ static int acq_open(struct inode *inode, struct file *file)
 
 	/* Activate */
 	acq_keepalive();
-	return 0;
+	return nonseekable_open(inode, file);
 }
 
 static int acq_close(struct inode *inode, struct file *file)
diff --git a/drivers/char/watchdog/advantechwdt.c b/drivers/char/watchdog/advantechwdt.c
index a92b3ae02..ea73c8379 100644
--- a/drivers/char/watchdog/advantechwdt.c
+++ b/drivers/char/watchdog/advantechwdt.c
@@ -100,12 +100,8 @@ advwdt_disable(void)
 }
 
 static ssize_t
-advwdt_write(struct file *file, const char *buf, size_t count, loff_t *ppos)
+advwdt_write(struct file *file, const char __user *buf, size_t count, loff_t *ppos)
 {
-	/*  Can't seek (pwrite) on this device  */
-	if (ppos != &file->f_pos)
-		return -ESPIPE;
-
 	if (count) {
 		if (!nowayout) {
 			size_t i;
@@ -130,6 +126,8 @@ advwdt_ioctl(struct inode *inode, struct file *file, unsigned int cmd,
 	  unsigned long arg)
 {
 	int new_timeout;
+	void __user *argp = (void __user *)arg;
+	int __user *p = argp;
 	static struct watchdog_info ident = {
 		.options = WDIOF_KEEPALIVEPING | WDIOF_SETTIMEOUT | WDIOF_MAGICCLOSE,
 		.firmware_version = 1,
@@ -138,20 +136,20 @@ advwdt_ioctl(struct inode *inode, struct file *file, unsigned int cmd,
 
 	switch (cmd) {
 	case WDIOC_GETSUPPORT:
-	  if (copy_to_user((struct watchdog_info *)arg, &ident, sizeof(ident)))
+	  if (copy_to_user(argp, &ident, sizeof(ident)))
 	    return -EFAULT;
 	  break;
 
 	case WDIOC_GETSTATUS:
 	case WDIOC_GETBOOTSTATUS:
-	  return put_user(0, (int *)arg);
+	  return put_user(0, p);
 
 	case WDIOC_KEEPALIVE:
 	  advwdt_ping();
 	  break;
 
 	case WDIOC_SETTIMEOUT:
-	  if (get_user(new_timeout, (int *)arg))
+	  if (get_user(new_timeout, p))
 		  return -EFAULT;
 	  if ((new_timeout < 1) || (new_timeout > 63))
 		  return -EINVAL;
@@ -160,13 +158,13 @@ advwdt_ioctl(struct inode *inode, struct file *file, unsigned int cmd,
 	  /* Fall */
 
 	case WDIOC_GETTIMEOUT:
-	  return put_user(timeout, (int *)arg);
+	  return put_user(timeout, p);
 
 	case WDIOC_SETOPTIONS:
 	{
 	  int options, retval = -EINVAL;
 
-	  if (get_user(options, (int *)arg))
+	  if (get_user(options, p))
 	    return -EFAULT;
 
 	  if (options & WDIOS_DISABLECARD) {
@@ -198,7 +196,7 @@ advwdt_open(struct inode *inode, struct file *file)
 	 */
 
 	advwdt_ping();
-	return 0;
+	return nonseekable_open(inode, file);
 }
 
 static int
diff --git a/drivers/char/watchdog/alim1535_wdt.c b/drivers/char/watchdog/alim1535_wdt.c
index 9a3207d81..35dcbf8be 100644
--- a/drivers/char/watchdog/alim1535_wdt.c
+++ b/drivers/char/watchdog/alim1535_wdt.c
@@ -138,13 +138,9 @@ static int ali_settimer(int t)
  *	the next close to turn off the watchdog.
  */
 
-static ssize_t ali_write(struct file *file, const char *data,
+static ssize_t ali_write(struct file *file, const char __user *data,
 			      size_t len, loff_t * ppos)
 {
-	/*  Can't seek (pwrite) on this device  */
-	if (ppos != &file->f_pos)
-		return -ESPIPE;
-
 	/* See if we got the magic character 'V' and reload the timer */
 	if (len) {
 		if (!nowayout) {
@@ -184,6 +180,8 @@ static ssize_t ali_write(struct file *file, const char *data,
 static int ali_ioctl(struct inode *inode, struct file *file,
 			  unsigned int cmd, unsigned long arg)
 {
+	void __user *argp = (void __user *)arg;
+	int __user *p = argp;
 	static struct watchdog_info ident = {
 		.options =		WDIOF_KEEPALIVEPING |
 					WDIOF_SETTIMEOUT |
@@ -194,12 +192,12 @@ static int ali_ioctl(struct inode *inode, struct file *file,
 
 	switch (cmd) {
 		case WDIOC_GETSUPPORT:
-			return copy_to_user((struct watchdog_info *) arg, &ident,
+			return copy_to_user(argp, &ident,
 				sizeof (ident)) ? -EFAULT : 0;
 
 		case WDIOC_GETSTATUS:
 		case WDIOC_GETBOOTSTATUS:
-			return put_user(0, (int *) arg);
+			return put_user(0, p);
 
 		case WDIOC_KEEPALIVE:
 			ali_keepalive();
@@ -209,7 +207,7 @@ static int ali_ioctl(struct inode *inode, struct file *file,
 		{
 			int new_options, retval = -EINVAL;
 
-			if (get_user (new_options, (int *) arg))
+			if (get_user (new_options, p))
 				return -EFAULT;
 
 			if (new_options & WDIOS_DISABLECARD) {
@@ -229,7 +227,7 @@ static int ali_ioctl(struct inode *inode, struct file *file,
 		{
 			int new_timeout;
 
-			if (get_user(new_timeout, (int *) arg))
+			if (get_user(new_timeout, p))
 				return -EFAULT;
 
 			if (ali_settimer(new_timeout))
@@ -240,7 +238,7 @@ static int ali_ioctl(struct inode *inode, struct file *file,
 		}
 
 		case WDIOC_GETTIMEOUT:
-			return put_user(timeout, (int *)arg);
+			return put_user(timeout, p);
 
 		default:
 			return -ENOIOCTLCMD;
@@ -264,7 +262,7 @@ static int ali_open(struct inode *inode, struct file *file)
 
 	/* Activate */
 	ali_start();
-	return 0;
+	return nonseekable_open(inode, file);
 }
 
 /*
diff --git a/drivers/char/watchdog/alim7101_wdt.c b/drivers/char/watchdog/alim7101_wdt.c
index 00baec945..5ff6a6e4a 100644
--- a/drivers/char/watchdog/alim7101_wdt.c
+++ b/drivers/char/watchdog/alim7101_wdt.c
@@ -148,12 +148,8 @@ static void wdt_keepalive(void)
  * /dev/watchdog handling
  */
 
-static ssize_t fop_write(struct file * file, const char * buf, size_t count, loff_t * ppos)
+static ssize_t fop_write(struct file * file, const char __user * buf, size_t count, loff_t * ppos)
 {
-	/* We can't seek */
-	if(ppos != &file->f_pos)
-		return -ESPIPE;
-
 	/* See if we got the magic character 'V' and reload the timer */
 	if(count) {
 		if (!nowayout) {
@@ -185,7 +181,7 @@ static int fop_open(struct inode * inode, struct file * file)
 		return -EBUSY;
 	/* Good, fire up the show */
 	wdt_startup();
-	return 0;
+	return nonseekable_open(inode, file);
 }
 
 static int fop_close(struct inode * inode, struct file * file)
@@ -203,6 +199,8 @@ static int fop_close(struct inode * inode, struct file * file)
 
 static int fop_ioctl(struct inode *inode, struct file *file, unsigned int cmd, unsigned long arg)
 {
+	void __user *argp = (void __user *)arg;
+	int __user *p = argp;
 	static struct watchdog_info ident =
 	{
 		.options = WDIOF_KEEPALIVEPING | WDIOF_SETTIMEOUT | WDIOF_MAGICCLOSE,
@@ -213,10 +211,10 @@ static int fop_ioctl(struct inode *inode, struct file *file, unsigned int cmd, u
 	switch(cmd)
 	{
 		case WDIOC_GETSUPPORT:
-			return copy_to_user((struct watchdog_info *)arg, &ident, sizeof(ident))?-EFAULT:0;
+			return copy_to_user(argp, &ident, sizeof(ident))?-EFAULT:0;
 		case WDIOC_GETSTATUS:
 		case WDIOC_GETBOOTSTATUS:
-			return put_user(0, (int *)arg);
+			return put_user(0, p);
 		case WDIOC_KEEPALIVE:
 			wdt_keepalive();
 			return 0;
@@ -224,7 +222,7 @@ static int fop_ioctl(struct inode *inode, struct file *file, unsigned int cmd, u
 		{
 			int new_options, retval = -EINVAL;
 
-			if(get_user(new_options, (int *)arg))
+			if(get_user(new_options, p))
 				return -EFAULT;
 
 			if(new_options & WDIOS_DISABLECARD) {
@@ -243,7 +241,7 @@ static int fop_ioctl(struct inode *inode, struct file *file, unsigned int cmd, u
 		{
 			int new_timeout;
 
-			if(get_user(new_timeout, (int *)arg))
+			if(get_user(new_timeout, p))
 				return -EFAULT;
 
 			if(new_timeout < 1 || new_timeout > 3600) /* arbitrary upper limit */
@@ -254,7 +252,7 @@ static int fop_ioctl(struct inode *inode, struct file *file, unsigned int cmd, u
 			/* Fall through */
 		}
 		case WDIOC_GETTIMEOUT:
-			return put_user(timeout, (int *)arg);
+			return put_user(timeout, p);
 		default:
 			return -ENOIOCTLCMD;
 	}
diff --git a/drivers/char/watchdog/cpu5wdt.c b/drivers/char/watchdog/cpu5wdt.c
index dad804ff5..7e7b653a2 100644
--- a/drivers/char/watchdog/cpu5wdt.c
+++ b/drivers/char/watchdog/cpu5wdt.c
@@ -145,6 +145,7 @@ static int cpu5wdt_release(struct inode *inode, struct file *file)
 
 static int cpu5wdt_ioctl(struct inode *inode, struct file *file, unsigned int cmd, unsigned long arg)
 {
+	void __user *argp = (void __user *)arg;
 	unsigned int value;
 	static struct watchdog_info ident =
 	{
@@ -159,15 +160,15 @@ static int cpu5wdt_ioctl(struct inode *inode, struct file *file, unsigned int cm
 		case WDIOC_GETSTATUS:
 			value = inb(port + CPU5WDT_STATUS_REG);
 			value = (value >> 2) & 1;
-			if ( copy_to_user((int *)arg, (int *)&value, sizeof(int)) )
+			if ( copy_to_user(argp, &value, sizeof(int)) )
 				return -EFAULT;
 			break;
 		case WDIOC_GETSUPPORT:
-			if ( copy_to_user((struct watchdog_info *)arg, &ident, sizeof(ident)) )
+			if ( copy_to_user(argp, &ident, sizeof(ident)) )
 				return -EFAULT;
 			break;
 		case WDIOC_SETOPTIONS:
-			if ( copy_from_user(&value, (int *)arg, sizeof(int)) )
+			if ( copy_from_user(&value, argp, sizeof(int)) )
 				return -EFAULT;
 			switch(value) {
 				case WDIOS_ENABLECARD:
@@ -185,7 +186,7 @@ static int cpu5wdt_ioctl(struct inode *inode, struct file *file, unsigned int cm
 	return 0;
 }
 
-static ssize_t cpu5wdt_write(struct file *file, const char *buf, size_t count, loff_t *ppos)
+static ssize_t cpu5wdt_write(struct file *file, const char __user *buf, size_t count, loff_t *ppos)
 {
 	if ( !count )
 		return -EIO;
diff --git a/drivers/char/watchdog/eurotechwdt.c b/drivers/char/watchdog/eurotechwdt.c
index ab28ca2ac..d10e554a1 100644
--- a/drivers/char/watchdog/eurotechwdt.c
+++ b/drivers/char/watchdog/eurotechwdt.c
@@ -196,13 +196,9 @@ static void eurwdt_ping(void)
  * write of data will do, as we we don't define content meaning.
  */
 
-static ssize_t eurwdt_write(struct file *file, const char *buf, size_t count,
-loff_t *ppos)
+static ssize_t eurwdt_write(struct file *file, const char __user *buf,
+size_t count, loff_t *ppos)
 {
-	/*  Can't seek (pwrite) on this device  */
-	if (ppos != &file->f_pos)
-	return -ESPIPE;
-
 	if (count) 	{
 		if (!nowayout) {
 			size_t i;
@@ -237,6 +233,8 @@ loff_t *ppos)
 static int eurwdt_ioctl(struct inode *inode, struct file *file,
 	unsigned int cmd, unsigned long arg)
 {
+	void __user *argp = (void __user *)arg;
+	int __user *p = argp;
 	static struct watchdog_info ident = {
 		.options	  = WDIOF_KEEPALIVEPING | WDIOF_SETTIMEOUT | WDIOF_MAGICCLOSE,
 		.firmware_version = 1,
@@ -251,19 +249,18 @@ static int eurwdt_ioctl(struct inode *inode, struct file *file,
 		return -ENOIOCTLCMD;
 
 	case WDIOC_GETSUPPORT:
-		return copy_to_user((struct watchdog_info *)arg, &ident,
-			sizeof(ident)) ? -EFAULT : 0;
+		return copy_to_user(argp, &ident, sizeof(ident)) ? -EFAULT : 0;
 
 	case WDIOC_GETSTATUS:
 	case WDIOC_GETBOOTSTATUS:
-		return put_user(0, (int *) arg);
+		return put_user(0, p);
 
 	case WDIOC_KEEPALIVE:
 		eurwdt_ping();
 		return 0;
 
 	case WDIOC_SETTIMEOUT:
-		if (copy_from_user(&time, (int *) arg, sizeof(int)))
+		if (copy_from_user(&time, p, sizeof(int)))
 			return -EFAULT;
 
 		/* Sanity check */
@@ -275,10 +272,10 @@ static int eurwdt_ioctl(struct inode *inode, struct file *file,
 		/* Fall */
 
 	case WDIOC_GETTIMEOUT:
-		return put_user(eurwdt_timeout, (int *)arg);
+		return put_user(eurwdt_timeout, p);
 
 	case WDIOC_SETOPTIONS:
-		if (get_user(options, (int *)arg))
+		if (get_user(options, p))
 			return -EFAULT;
 		if (options & WDIOS_DISABLECARD) {
 			eurwdt_disable_timer();
@@ -309,7 +306,7 @@ static int eurwdt_open(struct inode *inode, struct file *file)
 	eurwdt_timeout = WDT_TIMEOUT;	/* initial timeout */
 	/* Activate the WDT */
 	eurwdt_activate_timer();
-	return 0;
+	return nonseekable_open(inode, file);
 }
 
 /**
diff --git a/drivers/char/watchdog/i8xx_tco.c b/drivers/char/watchdog/i8xx_tco.c
index efe3c1d9e..5fc054700 100644
--- a/drivers/char/watchdog/i8xx_tco.c
+++ b/drivers/char/watchdog/i8xx_tco.c
@@ -193,7 +193,7 @@ static int i8xx_tco_open (struct inode *inode, struct file *file)
 	 */
 	tco_timer_keepalive ();
 	tco_timer_start ();
-	return 0;
+	return nonseekable_open(inode, file);
 }
 
 static int i8xx_tco_release (struct inode *inode, struct file *file)
@@ -212,13 +212,9 @@ static int i8xx_tco_release (struct inode *inode, struct file *file)
 	return 0;
 }
 
-static ssize_t i8xx_tco_write (struct file *file, const char *data,
+static ssize_t i8xx_tco_write (struct file *file, const char __user *data,
 			      size_t len, loff_t * ppos)
 {
-	/*  Can't seek (pwrite) on this device  */
-	if (ppos != &file->f_pos)
-		return -ESPIPE;
-
 	/* See if we got the magic character 'V' and reload the timer */
 	if (len) {
 		if (!nowayout) {
@@ -249,6 +245,8 @@ static int i8xx_tco_ioctl (struct inode *inode, struct file *file,
 {
 	int new_options, retval = -EINVAL;
 	int new_heartbeat;
+	void __user *argp = (void __user *)arg;
+	int __user *p = argp;
 	static struct watchdog_info ident = {
 		.options =		WDIOF_SETTIMEOUT |
 					WDIOF_KEEPALIVEPING |
@@ -259,12 +257,12 @@ static int i8xx_tco_ioctl (struct inode *inode, struct file *file,
 
 	switch (cmd) {
 		case WDIOC_GETSUPPORT:
-			return copy_to_user((struct watchdog_info *) arg, &ident,
+			return copy_to_user(argp, &ident,
 				sizeof (ident)) ? -EFAULT : 0;
 
 		case WDIOC_GETSTATUS:
 		case WDIOC_GETBOOTSTATUS:
-			return put_user (0, (int *) arg);
+			return put_user (0, p);
 
 		case WDIOC_KEEPALIVE:
 			tco_timer_keepalive ();
@@ -272,7 +270,7 @@ static int i8xx_tco_ioctl (struct inode *inode, struct file *file,
 
 		case WDIOC_SETOPTIONS:
 		{
-			if (get_user (new_options, (int *) arg))
+			if (get_user (new_options, p))
 				return -EFAULT;
 
 			if (new_options & WDIOS_DISABLECARD) {
@@ -291,7 +289,7 @@ static int i8xx_tco_ioctl (struct inode *inode, struct file *file,
 
 		case WDIOC_SETTIMEOUT:
 		{
-			if (get_user(new_heartbeat, (int *) arg))
+			if (get_user(new_heartbeat, p))
 				return -EFAULT;
 
 			if (tco_timer_set_heartbeat(new_heartbeat))
@@ -302,7 +300,7 @@ static int i8xx_tco_ioctl (struct inode *inode, struct file *file,
 		}
 
 		case WDIOC_GETTIMEOUT:
-			return put_user(heartbeat, (int *)arg);
+			return put_user(heartbeat, p);
 
 		default:
 			return -ENOIOCTLCMD;
diff --git a/drivers/char/watchdog/ib700wdt.c b/drivers/char/watchdog/ib700wdt.c
index 2e259a10f..cd6467eb4 100644
--- a/drivers/char/watchdog/ib700wdt.c
+++ b/drivers/char/watchdog/ib700wdt.c
@@ -139,12 +139,8 @@ ibwdt_ping(void)
 }
 
 static ssize_t
-ibwdt_write(struct file *file, const char *buf, size_t count, loff_t *ppos)
+ibwdt_write(struct file *file, const char __user *buf, size_t count, loff_t *ppos)
 {
-	/*  Can't seek (pwrite) on this device  */
-	if (ppos != &file->f_pos)
-		return -ESPIPE;
-
 	if (count) {
 		if (!nowayout) {
 			size_t i;
@@ -170,6 +166,8 @@ ibwdt_ioctl(struct inode *inode, struct file *file, unsigned int cmd,
 	  unsigned long arg)
 {
 	int i, new_margin;
+	void __user *argp = (void __user *)arg;
+	int __user *p = argp;
 
 	static struct watchdog_info ident = {
 		.options = WDIOF_KEEPALIVEPING | WDIOF_SETTIMEOUT | WDIOF_MAGICCLOSE,
@@ -179,19 +177,19 @@ ibwdt_ioctl(struct inode *inode, struct file *file, unsigned int cmd,
 
 	switch (cmd) {
 	case WDIOC_GETSUPPORT:
-	  if (copy_to_user((struct watchdog_info *)arg, &ident, sizeof(ident)))
+	  if (copy_to_user(argp, &ident, sizeof(ident)))
 	    return -EFAULT;
 	  break;
 
 	case WDIOC_GETSTATUS:
-	  return put_user(0, (int *) arg);
+	  return put_user(0, p);
 
 	case WDIOC_KEEPALIVE:
 	  ibwdt_ping();
 	  break;
 
 	case WDIOC_SETTIMEOUT:
-	  if (get_user(new_margin, (int *)arg))
+	  if (get_user(new_margin, p))
 		  return -EFAULT;
 	  if ((new_margin < 0) || (new_margin > 30))
 		  return -EINVAL;
@@ -203,7 +201,7 @@ ibwdt_ioctl(struct inode *inode, struct file *file, unsigned int cmd,
 	  /* Fall */
 
 	case WDIOC_GETTIMEOUT:
-	  return put_user(wd_times[wd_margin], (int *)arg);
+	  return put_user(wd_times[wd_margin], p);
 	  break;
 
 	default:
@@ -226,7 +224,7 @@ ibwdt_open(struct inode *inode, struct file *file)
 	/* Activate */
 	ibwdt_ping();
 	spin_unlock(&ibwdt_lock);
-	return 0;
+	return nonseekable_open(inode, file);
 }
 
 static int
diff --git a/drivers/char/watchdog/indydog.c b/drivers/char/watchdog/indydog.c
index 42363f353..4e9093b4a 100644
--- a/drivers/char/watchdog/indydog.c
+++ b/drivers/char/watchdog/indydog.c
@@ -12,6 +12,7 @@
  */
 
 #include <linux/module.h>
+#include <linux/moduleparam.h>
 #include <linux/config.h>
 #include <linux/types.h>
 #include <linux/kernel.h>
@@ -22,16 +23,11 @@
 #include <linux/notifier.h>
 #include <linux/reboot.h>
 #include <linux/init.h>
-#include <linux/moduleparam.h>
 #include <asm/uaccess.h>
-#include <asm/sgi/sgimc.h>
+#include <asm/sgi/mc.h>
 
 #define PFX "indydog: "
-#define WATCHDOG_HEARTBEAT 60
-
-static unsigned long indydog_alive;
-static struct sgimc_misc_ctrl *mcmisc_regs;
-static char expect_close;
+static int indydog_alive;
 
 #ifdef CONFIG_WATCHDOG_NOWAYOUT
 static int nowayout = 1;
@@ -39,96 +35,71 @@ static int nowayout = 1;
 static int nowayout = 0;
 #endif
 
+#define WATCHDOG_TIMEOUT 30		/* 30 sec default timeout */
+
 module_param(nowayout, int, 0);
 MODULE_PARM_DESC(nowayout, "Watchdog cannot be stopped once started (default=CONFIG_WATCHDOG_NOWAYOUT)");
 
 static void indydog_start(void)
 {
-	u32 mc_ctrl0 = mcmisc_regs->cpuctrl0;
-
-	mc_ctrl0 |= SGIMC_CCTRL0_WDOG;
-	mcmisc_regs->cpuctrl0 = mc_ctrl0;
+	u32 mc_ctrl0 = sgimc->cpuctrl0;
 
-	printk(KERN_INFO PFX "Started watchdog timer.\n");
+	mc_ctrl0 = sgimc->cpuctrl0 | SGIMC_CCTRL0_WDOG;
+	sgimc->cpuctrl0 = mc_ctrl0;
 }
 
 static void indydog_stop(void)
 {
-	u32 mc_ctrl0 = mcmisc_regs->cpuctrl0;
+	u32 mc_ctrl0 = sgimc->cpuctrl0;
 
 	mc_ctrl0 &= ~SGIMC_CCTRL0_WDOG;
-	mcmisc_regs->cpuctrl0 = mc_ctrl0;
+	sgimc->cpuctrl0 = mc_ctrl0;
 
 	printk(KERN_INFO PFX "Stopped watchdog timer.\n");
 }
 
 static void indydog_ping(void)
 {
-	mcmisc_regs->watchdogt = 0;
+	sgimc->watchdogt = 0;
 }
 
 /*
  *	Allow only one person to hold it open
  */
-
 static int indydog_open(struct inode *inode, struct file *file)
 {
-	if( test_and_set_bit(0,&indydog_alive) )
+	if (indydog_alive)
 		return -EBUSY;
 
 	if (nowayout)
 		__module_get(THIS_MODULE);
 
-	/*
-	 *	Activate timer
-	 */
+	/* Activate timer */
 	indydog_start();
 	indydog_ping();
 
-	return 0;
+	indydog_alive = 1;
+	printk(KERN_INFO "Started watchdog timer.\n");
+
+	return nonseekable_open(inode, file);
 }
 
 static int indydog_release(struct inode *inode, struct file *file)
 {
-	/*
-	 *	Shut off the timer.
-	 * 	Lock it in if it's a module and we set nowayout
-	 */
-
-	if (expect_close == 42) {
-		indydog_stop();
-	} else {
-		printk(KERN_CRIT PFX "WDT device closed unexpectedly.  WDT will not stop!\n");
-		indydog_ping();
-	}
-	clear_bit(0,&indydog_alive);
-	expect_close = 0;
+	/* Shut off the timer.
+	 * Lock it in if it's a module and we defined ...NOWAYOUT */
+	if (!nowayout)
+		indydog_stop();		/* Turn the WDT off */
+
+	indydog_alive = 0;
+
 	return 0;
 }
 
 static ssize_t indydog_write(struct file *file, const char *data, size_t len, loff_t *ppos)
 {
-	/*  Can't seek (pwrite) on this device  */
-	if (ppos != &file->f_pos)
-		return -ESPIPE;
-
 	/* Refresh the timer. */
 	if (len) {
-		if (!nowayout) {
-			size_t i;
-
-			/* In case it was set long ago */
-			expect_close = 0;
-
-			for (i = 0; i != len; i++) {
-				char c;
-
-				if (get_user(c, data + i))
-					return -EFAULT;
-				if (c == 'V')
-					expect_close = 42;
-			}
-		}
 		indydog_ping();
 	}
 	return len;
@@ -139,17 +110,18 @@ static int indydog_ioctl(struct inode *inode, struct file *file,
 {
 	int options, retval = -EINVAL;
 	static struct watchdog_info ident = {
-		.options =		WDIOF_KEEPALIVEPING |
-					WDIOF_MAGICCLOSE,
-		.firmware_version =	0,
-		.identity =		"Hardware Watchdog for SGI IP22",
+		.options		= WDIOF_KEEPALIVEPING |
+					  WDIOF_MAGICCLOSE,
+		.firmware_version	= 0,
+		.identity		= "Hardware Watchdog for SGI IP22",
 	};
 
 	switch (cmd) {
 		default:
 			return -ENOIOCTLCMD;
 		case WDIOC_GETSUPPORT:
-			if(copy_to_user((struct watchdog_info *)arg, &ident, sizeof(ident)))
+			if (copy_to_user((struct watchdog_info *)arg,
+					 &ident, sizeof(ident)))
 				return -EFAULT;
 			return 0;
 		case WDIOC_GETSTATUS:
@@ -165,14 +137,12 @@ static int indydog_ioctl(struct inode *inode, struct file *file,
 			if (get_user(options, (int *)arg))
 				return -EFAULT;
 
-			if (options & WDIOS_DISABLECARD)
-			{
+			if (options & WDIOS_DISABLECARD) {
 				indydog_stop();
 				retval = 0;
 			}
 
-			if (options & WDIOS_ENABLECARD)
-			{
+			if (options & WDIOS_ENABLECARD) {
 				indydog_start();
 				retval = 0;
 			}
@@ -184,40 +154,37 @@ static int indydog_ioctl(struct inode *inode, struct file *file,
 
 static int indydog_notify_sys(struct notifier_block *this, unsigned long code, void *unused)
 {
-	if (code==SYS_DOWN || code==SYS_HALT) {
-		/* Turn the WDT off */
-		indydog_stop();
-	}
+	if (code == SYS_DOWN || code == SYS_HALT)
+		indydog_stop();		/* Turn the WDT off */
 
 	return NOTIFY_DONE;
 }
 
 static struct file_operations indydog_fops = {
-	.owner	= THIS_MODULE,
-	.write	= indydog_write,
-	.ioctl	= indydog_ioctl,
-	.open	= indydog_open,
-	.release= indydog_release,
+	.owner		= THIS_MODULE,
+	.write		= indydog_write,
+	.ioctl		= indydog_ioctl,
+	.open		= indydog_open,
+	.release	= indydog_release,
 };
 
 static struct miscdevice indydog_miscdev = {
-	.minor	= WATCHDOG_MINOR,
-	.name	= "watchdog",
-	.fops	= &indydog_fops,
+	.minor		= WATCHDOG_MINOR,
+	.name		= "watchdog",
+	.fops		= &indydog_fops,
 };
 
 static struct notifier_block indydog_notifier = {
 	.notifier_call = indydog_notify_sys,
 };
 
-static char banner[] __initdata = KERN_INFO PFX "Hardware Watchdog Timer for SGI IP22: 0.3\n";
+static char banner[] __initdata =
+	KERN_INFO PFX "Hardware Watchdog Timer for SGI IP22: 0.3\n";
 
 static int __init watchdog_init(void)
 {
 	int ret;
 
-	mcmisc_regs = (struct sgimc_misc_ctrl *)(KSEG1+0x1fa00000);
-
 	ret = register_reboot_notifier(&indydog_notifier);
 	if (ret) {
 		printk(KERN_ERR PFX "cannot register reboot notifier (err=%d)\n",
diff --git a/drivers/char/watchdog/ixp4xx_wdt.c b/drivers/char/watchdog/ixp4xx_wdt.c
index 79493650f..b8e3d91d3 100644
--- a/drivers/char/watchdog/ixp4xx_wdt.c
+++ b/drivers/char/watchdog/ixp4xx_wdt.c
@@ -69,16 +69,12 @@ ixp4xx_wdt_open(struct inode *inode, struct file *file)
 
 	wdt_enable();
 
-	return 0;
+	return nonseekable_open(inode, file);
 }
 
 static ssize_t
 ixp4xx_wdt_write(struct file *file, const char *data, size_t len, loff_t *ppos)
 {
-	/* Can't seek (pwrite) on this device  */
-	if (ppos != &file->f_pos)
-		return -ESPIPE;
-
 	if (len) {
 		if (!nowayout) {
 			size_t i;
diff --git a/drivers/char/watchdog/machzwd.c b/drivers/char/watchdog/machzwd.c
index 99c6b21b3..3782930e6 100644
--- a/drivers/char/watchdog/machzwd.c
+++ b/drivers/char/watchdog/machzwd.c
@@ -302,13 +302,9 @@ static void zf_ping(unsigned long data)
 	}
 }
 
-static ssize_t zf_write(struct file *file, const char *buf, size_t count,
+static ssize_t zf_write(struct file *file, const char __user *buf, size_t count,
 								loff_t *ppos)
 {
-	/*  Can't seek (pwrite) on this device  */
-	if (ppos != &file->f_pos)
-		return -ESPIPE;
-
 	/* See if we got the magic character */
 	if(count){
 
@@ -352,15 +348,16 @@ static ssize_t zf_write(struct file *file, const char *buf, size_t count,
 static int zf_ioctl(struct inode *inode, struct file *file, unsigned int cmd,
 	unsigned long arg)
 {
+	void __user *argp = (void __user *)arg;
+	int __user *p = argp;
 	switch(cmd){
 		case WDIOC_GETSUPPORT:
-			if (copy_to_user((struct watchdog_info *)arg,
-					 &zf_info, sizeof(zf_info)))
+			if (copy_to_user(argp, &zf_info, sizeof(zf_info)))
 				return -EFAULT;
 			break;
 
 		case WDIOC_GETSTATUS:
-			return put_user(0, (int *) arg);
+			return put_user(0, p);
 
 		case WDIOC_KEEPALIVE:
 			zf_ping(0);
@@ -388,7 +385,7 @@ static int zf_open(struct inode *inode, struct file *file)
 
 	zf_timer_on();
 
-	return 0;
+	return nonseekable_open(inode, file);
 }
 
 static int zf_close(struct inode *inode, struct file *file)
diff --git a/drivers/char/watchdog/mixcomwd.c b/drivers/char/watchdog/mixcomwd.c
index 6d3e7d5fa..15a3547f2 100644
--- a/drivers/char/watchdog/mixcomwd.c
+++ b/drivers/char/watchdog/mixcomwd.c
@@ -108,7 +108,7 @@ static int mixcomwd_open(struct inode *inode, struct file *file)
 			mixcomwd_timer_alive=0;
 		}
 	}
-	return 0;
+	return nonseekable_open(inode, file);
 }
 
 static int mixcomwd_release(struct inode *inode, struct file *file)
@@ -134,12 +134,8 @@ static int mixcomwd_release(struct inode *inode, struct file *file)
 }
 
 
-static ssize_t mixcomwd_write(struct file *file, const char *data, size_t len, loff_t *ppos)
+static ssize_t mixcomwd_write(struct file *file, const char __user *data, size_t len, loff_t *ppos)
 {
-	if (ppos != &file->f_pos) {
-		return -ESPIPE;
-	}
-
 	if(len)
 	{
 		if (!nowayout) {
@@ -164,6 +160,8 @@ static ssize_t mixcomwd_write(struct file *file, const char *data, size_t len, l
 static int mixcomwd_ioctl(struct inode *inode, struct file *file,
 	unsigned int cmd, unsigned long arg)
 {
+	void __user *argp = (void __user *)arg;
+	int __user *p = argp;
 	int status;
 	static struct watchdog_info ident = {
 		.options = WDIOF_KEEPALIVEPING | WDIOF_MAGICCLOSE,
@@ -178,13 +176,12 @@ static int mixcomwd_ioctl(struct inode *inode, struct file *file,
 			if (!nowayout) {
 				status|=mixcomwd_timer_alive;
 			}
-			if (copy_to_user((int *)arg, &status, sizeof(int))) {
+			if (copy_to_user(p, &status, sizeof(int))) {
 				return -EFAULT;
 			}
 			break;
 		case WDIOC_GETSUPPORT:
-			if (copy_to_user((struct watchdog_info *)arg, &ident,
-			    sizeof(ident))) {
+			if (copy_to_user(argp, &ident, sizeof(ident))) {
 				return -EFAULT;
 			}
 			break;
diff --git a/drivers/char/watchdog/pcwd.c b/drivers/char/watchdog/pcwd.c
index 295e11461..88bdbda92 100644
--- a/drivers/char/watchdog/pcwd.c
+++ b/drivers/char/watchdog/pcwd.c
@@ -485,10 +485,6 @@ static int pcwd_ioctl(struct inode *inode, struct file *file,
 static ssize_t pcwd_write(struct file *file, const char __user *buf, size_t len,
 			  loff_t *ppos)
 {
-	/*  Can't seek (pwrite) on this device  */
-	if (ppos != &file->f_pos)
-		return -ESPIPE;
-
 	if (len) {
 		if (!nowayout) {
 			size_t i;
@@ -523,7 +519,7 @@ static int pcwd_open(struct inode *inode, struct file *file)
 	/* Activate */
 	pcwd_start();
 	pcwd_keepalive();
-	return(0);
+	return nonseekable_open(inode, file);
 }
 
 static int pcwd_close(struct inode *inode, struct file *file)
@@ -548,10 +544,6 @@ static ssize_t pcwd_temp_read(struct file *file, char __user *buf, size_t count,
 {
 	int temperature;
 
-	/* Can't seek (pread) on this device */
-	if (ppos != &file->f_pos)
-		return -ESPIPE;
-
 	if (pcwd_get_temperature(&temperature))
 		return -EFAULT;
 
@@ -566,7 +558,7 @@ static int pcwd_temp_open(struct inode *inode, struct file *file)
 	if (!supports_temp)
 		return -ENODEV;
 
-	return 0;
+	return nonseekable_open(inode, file);
 }
 
 static int pcwd_temp_close(struct inode *inode, struct file *file)
diff --git a/drivers/char/watchdog/pcwd_pci.c b/drivers/char/watchdog/pcwd_pci.c
index 0b3c727e5..7216e4836 100644
--- a/drivers/char/watchdog/pcwd_pci.c
+++ b/drivers/char/watchdog/pcwd_pci.c
@@ -258,13 +258,9 @@ static int pcipcwd_get_temperature(int *temperature)
  *	/dev/watchdog handling
  */
 
-static ssize_t pcipcwd_write(struct file *file, const char *data,
+static ssize_t pcipcwd_write(struct file *file, const char __user *data,
 			      size_t len, loff_t *ppos)
 {
-	/* Can't seek (pwrite) on this device  */
-	if (ppos != &file->f_pos)
-		return -ESPIPE;
-
 	/* See if we got the magic character 'V' and reload the timer */
 	if (len) {
 		if (!nowayout) {
@@ -293,6 +289,8 @@ static ssize_t pcipcwd_write(struct file *file, const char *data,
 static int pcipcwd_ioctl(struct inode *inode, struct file *file,
 			  unsigned int cmd, unsigned long arg)
 {
+	void __user *argp = (void __user *)arg;
+	int __user *p = argp;
 	static struct watchdog_info ident = {
 		.options =		WDIOF_OVERHEAT |
 					WDIOF_CARDRESET |
@@ -305,7 +303,7 @@ static int pcipcwd_ioctl(struct inode *inode, struct file *file,
 
 	switch (cmd) {
 		case WDIOC_GETSUPPORT:
-			return copy_to_user((struct watchdog_info *) arg, &ident,
+			return copy_to_user(argp, &ident,
 				sizeof (ident)) ? -EFAULT : 0;
 
 		case WDIOC_GETSTATUS:
@@ -314,11 +312,11 @@ static int pcipcwd_ioctl(struct inode *inode, struct file *file,
 
 			pcipcwd_get_status(&status);
 
-			return put_user(status, (int *) arg);
+			return put_user(status, p);
 		}
 
 		case WDIOC_GETBOOTSTATUS:
-			return put_user(pcipcwd_private.boot_status, (int *) arg);
+			return put_user(pcipcwd_private.boot_status, p);
 
 		case WDIOC_GETTEMP:
 		{
@@ -327,7 +325,7 @@ static int pcipcwd_ioctl(struct inode *inode, struct file *file,
 			if (pcipcwd_get_temperature(&temperature))
 				return -EFAULT;
 
-			return put_user(temperature, (int *) arg);
+			return put_user(temperature, p);
 		}
 
 		case WDIOC_KEEPALIVE:
@@ -338,7 +336,7 @@ static int pcipcwd_ioctl(struct inode *inode, struct file *file,
 		{
 			int new_options, retval = -EINVAL;
 
-			if (get_user (new_options, (int *) arg))
+			if (get_user (new_options, p))
 				return -EFAULT;
 
 			if (new_options & WDIOS_DISABLECARD) {
@@ -363,7 +361,7 @@ static int pcipcwd_ioctl(struct inode *inode, struct file *file,
 		{
 			int new_heartbeat;
 
-			if (get_user(new_heartbeat, (int *) arg))
+			if (get_user(new_heartbeat, p))
 				return -EFAULT;
 
 			if (pcipcwd_set_heartbeat(new_heartbeat))
@@ -374,7 +372,7 @@ static int pcipcwd_ioctl(struct inode *inode, struct file *file,
 		}
 
 		case WDIOC_GETTIMEOUT:
-			return put_user(heartbeat, (int *)arg);
+			return put_user(heartbeat, p);
 
 		default:
 			return -ENOIOCTLCMD;
@@ -390,7 +388,7 @@ static int pcipcwd_open(struct inode *inode, struct file *file)
 	/* Activate */
 	pcipcwd_start();
 	pcipcwd_keepalive();
-	return 0;
+	return nonseekable_open(inode, file);
 }
 
 static int pcipcwd_release(struct inode *inode, struct file *file)
@@ -413,15 +411,11 @@ static int pcipcwd_release(struct inode *inode, struct file *file)
  *	/dev/temperature handling
  */
 
-static ssize_t pcipcwd_temp_read(struct file *file, char *data,
+static ssize_t pcipcwd_temp_read(struct file *file, char __user *data,
 				size_t len, loff_t *ppos)
 {
 	int temperature;
 
-	/* Can't seek (pwrite) on this device  */
-	if (ppos != &file->f_pos)
-		return -ESPIPE;
-
 	if (pcipcwd_get_temperature(&temperature))
 		return -EFAULT;
 
@@ -436,7 +430,7 @@ static int pcipcwd_temp_open(struct inode *inode, struct file *file)
 	if (!pcipcwd_private.supports_temp)
 		return -ENODEV;
 
-	return 0;
+	return nonseekable_open(inode, file);
 }
 
 static int pcipcwd_temp_release(struct inode *inode, struct file *file)
diff --git a/drivers/char/watchdog/pcwd_usb.c b/drivers/char/watchdog/pcwd_usb.c
index 0f4c1ca0c..cdfe0db28 100644
--- a/drivers/char/watchdog/pcwd_usb.c
+++ b/drivers/char/watchdog/pcwd_usb.c
@@ -326,13 +326,9 @@ static int usb_pcwd_get_temperature(struct usb_pcwd_private *usb_pcwd, int *temp
  *	/dev/watchdog handling
  */
 
-static ssize_t usb_pcwd_write(struct file *file, const char *data,
+static ssize_t usb_pcwd_write(struct file *file, const char __user *data,
 			      size_t len, loff_t *ppos)
 {
-	/* Can't seek (pwrite) on this device  */
-	if (ppos != &file->f_pos)
-		return -ESPIPE;
-
 	/* See if we got the magic character 'V' and reload the timer */
 	if (len) {
 		if (!nowayout) {
@@ -361,6 +357,8 @@ static ssize_t usb_pcwd_write(struct file *file, const char *data,
 static int usb_pcwd_ioctl(struct inode *inode, struct file *file,
 			  unsigned int cmd, unsigned long arg)
 {
+	void __user *argp = (void __user *)arg;
+	int __user *p = argp;
 	static struct watchdog_info ident = {
 		.options =		WDIOF_KEEPALIVEPING |
 					WDIOF_SETTIMEOUT |
@@ -371,12 +369,12 @@ static int usb_pcwd_ioctl(struct inode *inode, struct file *file,
 
 	switch (cmd) {
 		case WDIOC_GETSUPPORT:
-			return copy_to_user((struct watchdog_info *) arg, &ident,
+			return copy_to_user(argp, &ident,
 				sizeof (ident)) ? -EFAULT : 0;
 
 		case WDIOC_GETSTATUS:
 		case WDIOC_GETBOOTSTATUS:
-			return put_user(0, (int *) arg);
+			return put_user(0, p);
 
 		case WDIOC_GETTEMP:
 		{
@@ -385,7 +383,7 @@ static int usb_pcwd_ioctl(struct inode *inode, struct file *file,
 			if (usb_pcwd_get_temperature(usb_pcwd_device, &temperature))
 				return -EFAULT;
 
-			return put_user(temperature, (int *) arg);
+			return put_user(temperature, p);
 		}
 
 		case WDIOC_KEEPALIVE:
@@ -396,7 +394,7 @@ static int usb_pcwd_ioctl(struct inode *inode, struct file *file,
 		{
 			int new_options, retval = -EINVAL;
 
-			if (get_user (new_options, (int *) arg))
+			if (get_user (new_options, p))
 				return -EFAULT;
 
 			if (new_options & WDIOS_DISABLECARD) {
@@ -416,7 +414,7 @@ static int usb_pcwd_ioctl(struct inode *inode, struct file *file,
 		{
 			int new_heartbeat;
 
-			if (get_user(new_heartbeat, (int *) arg))
+			if (get_user(new_heartbeat, p))
 				return -EFAULT;
 
 			if (usb_pcwd_set_heartbeat(usb_pcwd_device, new_heartbeat))
@@ -427,7 +425,7 @@ static int usb_pcwd_ioctl(struct inode *inode, struct file *file,
 		}
 
 		case WDIOC_GETTIMEOUT:
-			return put_user(heartbeat, (int *)arg);
+			return put_user(heartbeat, p);
 
 		default:
 			return -ENOIOCTLCMD;
@@ -443,7 +441,7 @@ static int usb_pcwd_open(struct inode *inode, struct file *file)
 	/* Activate */
 	usb_pcwd_start(usb_pcwd_device);
 	usb_pcwd_keepalive(usb_pcwd_device);
-	return 0;
+	return nonseekable_open(inode, file);
 }
 
 static int usb_pcwd_release(struct inode *inode, struct file *file)
@@ -466,19 +464,15 @@ static int usb_pcwd_release(struct inode *inode, struct file *file)
  *	/dev/temperature handling
  */
 
-static ssize_t usb_pcwd_temperature_read(struct file *file, char *data,
+static ssize_t usb_pcwd_temperature_read(struct file *file, char __user *data,
 				size_t len, loff_t *ppos)
 {
 	int temperature;
 
-	/* Can't seek (pwrite) on this device  */
-	if (ppos != &file->f_pos)
-		return -ESPIPE;
-
 	if (usb_pcwd_get_temperature(usb_pcwd_device, &temperature))
 		return -EFAULT;
 
-	if (copy_to_user (data, &temperature, 1))
+	if (copy_to_user(data, &temperature, 1))
 		return -EFAULT;
 
 	return 1;
@@ -486,7 +480,7 @@ static ssize_t usb_pcwd_temperature_read(struct file *file, char *data,
 
 static int usb_pcwd_temperature_open(struct inode *inode, struct file *file)
 {
-	return 0;
+	return nonseekable_open(inode, file);
 }
 
 static int usb_pcwd_temperature_release(struct inode *inode, struct file *file)
diff --git a/drivers/char/watchdog/sa1100_wdt.c b/drivers/char/watchdog/sa1100_wdt.c
index 862fb9ab3..1adf09f83 100644
--- a/drivers/char/watchdog/sa1100_wdt.c
+++ b/drivers/char/watchdog/sa1100_wdt.c
@@ -1,5 +1,5 @@
 /*
- *	Watchdog driver for the SA11x0
+ *	Watchdog driver for the SA11x0/PXA2xx
  *
  *      (c) Copyright 2000 Oleg Drokin <green@crimea.edu>
  *          Based on SoftDog driver by Alan Cox <alan@redhat.com>
@@ -49,6 +49,7 @@ static int nowayout = 0;
  */
 static int sa1100dog_open(struct inode *inode, struct file *file)
 {
+	nonseekable_open(inode, file);
 	if (test_and_set_bit(1,&sa1100wdt_users))
 		return -EBUSY;
 
@@ -84,10 +85,6 @@ static int sa1100dog_release(struct inode *inode, struct file *file)
 
 static ssize_t sa1100dog_write(struct file *file, const char *data, size_t len, loff_t *ppos)
 {
-	/* Can't seek (pwrite) on this device  */
-	if (ppos != &file->f_pos)
-		return -ESPIPE;
-
 	if (len) {
 		if (!nowayout) {
 			size_t i;
@@ -174,7 +171,7 @@ static struct file_operations sa1100dog_fops =
 static struct miscdevice sa1100dog_miscdev =
 {
 	.minor		= WATCHDOG_MINOR,
-	.name		= "SA1100 watchdog",
+	.name		= "SA1100/PXA2xx watchdog",
 	.fops		= &sa1100dog_fops,
 };
 
@@ -194,7 +191,7 @@ static int __init sa1100dog_init(void)
 
 	ret = misc_register(&sa1100dog_miscdev);
 	if (ret == 0)
-		printk("SA1100 Watchdog Timer: timer margin %d sec\n",
+		printk("SA1100/PXA2xx Watchdog Timer: timer margin %d sec\n",
 		       margin);
 
 	return ret;
@@ -209,7 +206,7 @@ module_init(sa1100dog_init);
 module_exit(sa1100dog_exit);
 
 MODULE_AUTHOR("Oleg Drokin <green@crimea.edu>");
-MODULE_DESCRIPTION("SA1100 Watchdog");
+MODULE_DESCRIPTION("SA1100/PXA2xx Watchdog");
 
 module_param(margin, int, 0);
 MODULE_PARM_DESC(margin, "Watchdog margin in seconds (default 60s)");
diff --git a/drivers/char/watchdog/sbc60xxwdt.c b/drivers/char/watchdog/sbc60xxwdt.c
index c533c4660..d7de98806 100644
--- a/drivers/char/watchdog/sbc60xxwdt.c
+++ b/drivers/char/watchdog/sbc60xxwdt.c
@@ -166,12 +166,8 @@ static void wdt_keepalive(void)
  * /dev/watchdog handling
  */
 
-static ssize_t fop_write(struct file * file, const char * buf, size_t count, loff_t * ppos)
+static ssize_t fop_write(struct file * file, const char __user * buf, size_t count, loff_t * ppos)
 {
-	/* We can't seek */
-	if(ppos != &file->f_pos)
-		return -ESPIPE;
-
 	/* See if we got the magic character 'V' and reload the timer */
 	if(count)
 	{
@@ -202,6 +198,8 @@ static ssize_t fop_write(struct file * file, const char * buf, size_t count, lof
 
 static int fop_open(struct inode * inode, struct file * file)
 {
+	nonseekable_open(inode, file);
+
 	/* Just in case we're already talking to someone... */
 	if(test_and_set_bit(0, &wdt_is_open))
 		return -EBUSY;
@@ -230,6 +228,8 @@ static int fop_close(struct inode * inode, struct file * file)
 static int fop_ioctl(struct inode *inode, struct file *file, unsigned int cmd,
 	unsigned long arg)
 {
+	void __user *argp = (void __user *)arg;
+	int __user *p = argp;
 	static struct watchdog_info ident=
 	{
 		.options = WDIOF_KEEPALIVEPING | WDIOF_SETTIMEOUT | WDIOF_MAGICCLOSE,
@@ -242,10 +242,10 @@ static int fop_ioctl(struct inode *inode, struct file *file, unsigned int cmd,
 		default:
 			return -ENOIOCTLCMD;
 		case WDIOC_GETSUPPORT:
-			return copy_to_user((struct watchdog_info *)arg, &ident, sizeof(ident))?-EFAULT:0;
+			return copy_to_user(argp, &ident, sizeof(ident))?-EFAULT:0;
 		case WDIOC_GETSTATUS:
 		case WDIOC_GETBOOTSTATUS:
-			return put_user(0, (int *)arg);
+			return put_user(0, p);
 		case WDIOC_KEEPALIVE:
 			wdt_keepalive();
 			return 0;
@@ -253,7 +253,7 @@ static int fop_ioctl(struct inode *inode, struct file *file, unsigned int cmd,
 		{
 			int new_options, retval = -EINVAL;
 
-			if(get_user(new_options, (int *)arg))
+			if(get_user(new_options, p))
 				return -EFAULT;
 
 			if(new_options & WDIOS_DISABLECARD) {
@@ -272,7 +272,7 @@ static int fop_ioctl(struct inode *inode, struct file *file, unsigned int cmd,
 		{
 			int new_timeout;
 
-			if(get_user(new_timeout, (int *)arg))
+			if(get_user(new_timeout, p))
 				return -EFAULT;
 
 			if(new_timeout < 1 || new_timeout > 3600) /* arbitrary upper limit */
@@ -283,7 +283,7 @@ static int fop_ioctl(struct inode *inode, struct file *file, unsigned int cmd,
 			/* Fall through */
 		}
 		case WDIOC_GETTIMEOUT:
-			return put_user(timeout, (int *)arg);
+			return put_user(timeout, p);
 	}
 }
 
diff --git a/drivers/char/watchdog/sc1200wdt.c b/drivers/char/watchdog/sc1200wdt.c
index b7e48851f..9ddebaebe 100644
--- a/drivers/char/watchdog/sc1200wdt.c
+++ b/drivers/char/watchdog/sc1200wdt.c
@@ -157,6 +157,8 @@ static inline int sc1200wdt_status(void)
 
 static int sc1200wdt_open(struct inode *inode, struct file *file)
 {
+	nonseekable_open(inode, file);
+
 	/* allow one at a time */
 	if (down_trylock(&open_sem))
 		return -EBUSY;
@@ -174,6 +176,8 @@ static int sc1200wdt_open(struct inode *inode, struct file *file)
 static int sc1200wdt_ioctl(struct inode *inode, struct file *file, unsigned int cmd, unsigned long arg)
 {
 	int new_timeout;
+	void __user *argp = (void __user *)arg;
+	int __user *p = argp;
 	static struct watchdog_info ident = {
 		.options = WDIOF_KEEPALIVEPING | WDIOF_SETTIMEOUT | WDIOF_MAGICCLOSE,
 		.firmware_version = 0,
@@ -185,22 +189,22 @@ static int sc1200wdt_ioctl(struct inode *inode, struct file *file, unsigned int
 			return -ENOIOCTLCMD;	/* Keep Pavel Machek amused ;) */
 
 		case WDIOC_GETSUPPORT:
-			if (copy_to_user((struct watchdog_info *)arg, &ident, sizeof ident))
+			if (copy_to_user(argp, &ident, sizeof ident))
 				return -EFAULT;
 			return 0;
 
 		case WDIOC_GETSTATUS:
-			return put_user(sc1200wdt_status(), (int *)arg);
+			return put_user(sc1200wdt_status(), p);
 
 		case WDIOC_GETBOOTSTATUS:
-			return put_user(0, (int *)arg);
+			return put_user(0, p);
 
 		case WDIOC_KEEPALIVE:
 			sc1200wdt_write_data(WDTO, timeout);
 			return 0;
 
 		case WDIOC_SETTIMEOUT:
-			if (get_user(new_timeout, (int *)arg))
+			if (get_user(new_timeout, p))
 				return -EFAULT;
 
 			/* the API states this is given in secs */
@@ -213,13 +217,13 @@ static int sc1200wdt_ioctl(struct inode *inode, struct file *file, unsigned int
 			/* fall through and return the new timeout */
 
 		case WDIOC_GETTIMEOUT:
-			return put_user(timeout * 60, (int *)arg);
+			return put_user(timeout * 60, p);
 
 		case WDIOC_SETOPTIONS:
 		{
 			int options, retval = -EINVAL;
 
-			if (get_user(options, (int *)arg))
+			if (get_user(options, p))
 				return -EFAULT;
 
 			if (options & WDIOS_DISABLECARD) {
@@ -254,11 +258,8 @@ static int sc1200wdt_release(struct inode *inode, struct file *file)
 }
 
 
-static ssize_t sc1200wdt_write(struct file *file, const char *data, size_t len, loff_t *ppos)
+static ssize_t sc1200wdt_write(struct file *file, const char __user *data, size_t len, loff_t *ppos)
 {
-	if (ppos != &file->f_pos)
-		return -ESPIPE;
-
 	if (len) {
 		if (!nowayout) {
 			size_t i;
diff --git a/drivers/char/watchdog/sc520_wdt.c b/drivers/char/watchdog/sc520_wdt.c
index b54c47b72..8b68721f9 100644
--- a/drivers/char/watchdog/sc520_wdt.c
+++ b/drivers/char/watchdog/sc520_wdt.c
@@ -225,12 +225,8 @@ static int wdt_set_heartbeat(int t)
  *	/dev/watchdog handling
  */
 
-static ssize_t fop_write(struct file * file, const char * buf, size_t count, loff_t * ppos)
+static ssize_t fop_write(struct file * file, const char __user * buf, size_t count, loff_t * ppos)
 {
-	/* We can't seek */
-	if(ppos != &file->f_pos)
-		return -ESPIPE;
-
 	/* See if we got the magic character 'V' and reload the timer */
 	if(count) {
 		if (!nowayout) {
@@ -258,6 +254,8 @@ static ssize_t fop_write(struct file * file, const char * buf, size_t count, lof
 
 static int fop_open(struct inode * inode, struct file * file)
 {
+	nonseekable_open(inode, file);
+
 	/* Just in case we're already talking to someone... */
 	if(test_and_set_bit(0, &wdt_is_open))
 		return -EBUSY;
@@ -285,6 +283,8 @@ static int fop_close(struct inode * inode, struct file * file)
 static int fop_ioctl(struct inode *inode, struct file *file, unsigned int cmd,
 	unsigned long arg)
 {
+	void __user *argp = (void __user *)arg;
+	int __user *p = argp;
 	static struct watchdog_info ident = {
 		.options = WDIOF_KEEPALIVEPING | WDIOF_SETTIMEOUT | WDIOF_MAGICCLOSE,
 		.firmware_version = 1,
@@ -296,10 +296,10 @@ static int fop_ioctl(struct inode *inode, struct file *file, unsigned int cmd,
 		default:
 			return -ENOIOCTLCMD;
 		case WDIOC_GETSUPPORT:
-			return copy_to_user((struct watchdog_info *)arg, &ident, sizeof(ident))?-EFAULT:0;
+			return copy_to_user(argp, &ident, sizeof(ident))?-EFAULT:0;
 		case WDIOC_GETSTATUS:
 		case WDIOC_GETBOOTSTATUS:
-			return put_user(0, (int *)arg);
+			return put_user(0, p);
 		case WDIOC_KEEPALIVE:
 			wdt_keepalive();
 			return 0;
@@ -307,7 +307,7 @@ static int fop_ioctl(struct inode *inode, struct file *file, unsigned int cmd,
 		{
 			int new_options, retval = -EINVAL;
 
-			if(get_user(new_options, (int *)arg))
+			if(get_user(new_options, p))
 				return -EFAULT;
 
 			if(new_options & WDIOS_DISABLECARD) {
@@ -326,7 +326,7 @@ static int fop_ioctl(struct inode *inode, struct file *file, unsigned int cmd,
 		{
 			int new_timeout;
 
-			if(get_user(new_timeout, (int *)arg))
+			if(get_user(new_timeout, p))
 				return -EFAULT;
 
 			if(wdt_set_heartbeat(new_timeout))
@@ -336,7 +336,7 @@ static int fop_ioctl(struct inode *inode, struct file *file, unsigned int cmd,
 			/* Fall through */
 		}
 		case WDIOC_GETTIMEOUT:
-			return put_user(timeout, (int *)arg);
+			return put_user(timeout, p);
 	}
 }
 
diff --git a/drivers/char/watchdog/scx200_wdt.c b/drivers/char/watchdog/scx200_wdt.c
index 6f0657b2b..ed1800cff 100644
--- a/drivers/char/watchdog/scx200_wdt.c
+++ b/drivers/char/watchdog/scx200_wdt.c
@@ -101,7 +101,7 @@ static int scx200_wdt_open(struct inode *inode, struct file *file)
 		return -EBUSY;
 	scx200_wdt_enable();
 
-	return 0;
+	return nonseekable_open(inode, file);
 }
 
 static int scx200_wdt_release(struct inode *inode, struct file *file)
@@ -132,12 +132,9 @@ static struct notifier_block scx200_wdt_notifier =
 	.notifier_call = scx200_wdt_notify_sys,
 };
 
-static ssize_t scx200_wdt_write(struct file *file, const char *data,
+static ssize_t scx200_wdt_write(struct file *file, const char __user *data,
 				     size_t len, loff_t *ppos)
 {
-	if (ppos != &file->f_pos)
-		return -ESPIPE;
-
 	/* check for a magic close character */
 	if (len)
 	{
@@ -163,6 +160,8 @@ static ssize_t scx200_wdt_write(struct file *file, const char *data,
 static int scx200_wdt_ioctl(struct inode *inode, struct file *file,
 	unsigned int cmd, unsigned long arg)
 {
+	void __user *argp = (void __user *)arg;
+	int __user *p = argp;
 	static struct watchdog_info ident = {
 		.identity = "NatSemi SCx200 Watchdog",
 		.firmware_version = 1,
@@ -174,20 +173,19 @@ static int scx200_wdt_ioctl(struct inode *inode, struct file *file,
 	default:
 		return -ENOIOCTLCMD;
 	case WDIOC_GETSUPPORT:
-		if(copy_to_user((struct watchdog_info *)arg, &ident,
-				sizeof(ident)))
+		if(copy_to_user(argp, &ident, sizeof(ident)))
 			return -EFAULT;
 		return 0;
 	case WDIOC_GETSTATUS:
 	case WDIOC_GETBOOTSTATUS:
-		if (put_user(0, (int *)arg))
+		if (put_user(0, p))
 			return -EFAULT;
 		return 0;
 	case WDIOC_KEEPALIVE:
 		scx200_wdt_ping();
 		return 0;
 	case WDIOC_SETTIMEOUT:
-		if (get_user(new_margin, (int *)arg))
+		if (get_user(new_margin, p))
 			return -EFAULT;
 		if (new_margin < 1)
 			return -EINVAL;
@@ -195,7 +193,7 @@ static int scx200_wdt_ioctl(struct inode *inode, struct file *file,
 		scx200_wdt_update_margin();
 		scx200_wdt_ping();
 	case WDIOC_GETTIMEOUT:
-		if (put_user(margin, (int *)arg))
+		if (put_user(margin, p))
 			return -EFAULT;
 		return 0;
 	}
diff --git a/drivers/char/watchdog/shwdt.c b/drivers/char/watchdog/shwdt.c
index e4c235de7..3bc9272a4 100644
--- a/drivers/char/watchdog/shwdt.c
+++ b/drivers/char/watchdog/shwdt.c
@@ -209,7 +209,7 @@ static int sh_wdt_open(struct inode *inode, struct file *file)
 
 	sh_wdt_start();
 
-	return 0;
+	return nonseekable_open(inode, file);
 }
 
 /**
@@ -248,10 +248,6 @@ static int sh_wdt_close(struct inode *inode, struct file *file)
 static ssize_t sh_wdt_write(struct file *file, const char *buf,
 			    size_t count, loff_t *ppos)
 {
-	/* Can't seek (pwrite) on this device */
-	if (ppos != &file->f_pos)
-		return -ESPIPE;
-
 	if (count) {
 		if (!nowayout) {
 			size_t i;
diff --git a/drivers/char/watchdog/softdog.c b/drivers/char/watchdog/softdog.c
index e9f4f22e7..117903498 100644
--- a/drivers/char/watchdog/softdog.c
+++ b/drivers/char/watchdog/softdog.c
@@ -141,7 +141,7 @@ static int softdog_open(struct inode *inode, struct file *file)
 	 *	Activate timer
 	 */
 	softdog_keepalive();
-	return 0;
+	return nonseekable_open(inode, file);
 }
 
 static int softdog_release(struct inode *inode, struct file *file)
@@ -161,12 +161,8 @@ static int softdog_release(struct inode *inode, struct file *file)
 	return 0;
 }
 
-static ssize_t softdog_write(struct file *file, const char *data, size_t len, loff_t *ppos)
+static ssize_t softdog_write(struct file *file, const char __user *data, size_t len, loff_t *ppos)
 {
-	/*  Can't seek (pwrite) on this device  */
-	if (ppos != &file->f_pos)
-		return -ESPIPE;
-
 	/*
 	 *	Refresh the timer.
 	 */
@@ -194,6 +190,8 @@ static ssize_t softdog_write(struct file *file, const char *data, size_t len, lo
 static int softdog_ioctl(struct inode *inode, struct file *file,
 	unsigned int cmd, unsigned long arg)
 {
+	void __user *argp = (void __user *)arg;
+	int __user *p = argp;
 	int new_margin;
 	static struct watchdog_info ident = {
 		.options =		WDIOF_SETTIMEOUT |
@@ -206,23 +204,23 @@ static int softdog_ioctl(struct inode *inode, struct file *file,
 		default:
 			return -ENOIOCTLCMD;
 		case WDIOC_GETSUPPORT:
-			return copy_to_user((struct watchdog_info *)arg, &ident,
+			return copy_to_user(argp, &ident,
 				sizeof(ident)) ? -EFAULT : 0;
 		case WDIOC_GETSTATUS:
 		case WDIOC_GETBOOTSTATUS:
-			return put_user(0,(int *)arg);
+			return put_user(0, p);
 		case WDIOC_KEEPALIVE:
 			softdog_keepalive();
 			return 0;
 		case WDIOC_SETTIMEOUT:
-			if (get_user(new_margin, (int *)arg))
+			if (get_user(new_margin, p))
 				return -EFAULT;
 			if (softdog_set_heartbeat(new_margin))
 				return -EINVAL;
 			softdog_keepalive();
 			/* Fall */
 		case WDIOC_GETTIMEOUT:
-			return put_user(soft_margin, (int *)arg);
+			return put_user(soft_margin, p);
 	}
 }
 
diff --git a/drivers/char/watchdog/w83627hf_wdt.c b/drivers/char/watchdog/w83627hf_wdt.c
index 7a129302c..813c97038 100644
--- a/drivers/char/watchdog/w83627hf_wdt.c
+++ b/drivers/char/watchdog/w83627hf_wdt.c
@@ -142,12 +142,8 @@ wdt_set_heartbeat(int t)
 }
 
 static ssize_t
-wdt_write(struct file *file, const char *buf, size_t count, loff_t *ppos)
+wdt_write(struct file *file, const char __user *buf, size_t count, loff_t *ppos)
 {
-	/*  Can't seek (pwrite) on this device  */
-	if (ppos != &file->f_pos)
-		return -ESPIPE;
-
 	if (count) {
 		if (!nowayout) {
 			size_t i;
@@ -171,6 +167,8 @@ static int
 wdt_ioctl(struct inode *inode, struct file *file, unsigned int cmd,
 	  unsigned long arg)
 {
+	void __user *argp = (void __user *)arg;
+	int __user *p = argp;
 	int new_timeout;
 	static struct watchdog_info ident = {
 		.options = WDIOF_KEEPALIVEPING | WDIOF_SETTIMEOUT | WDIOF_MAGICCLOSE,
@@ -180,20 +178,20 @@ wdt_ioctl(struct inode *inode, struct file *file, unsigned int cmd,
 
 	switch (cmd) {
 	case WDIOC_GETSUPPORT:
-	  if (copy_to_user((struct watchdog_info *)arg, &ident, sizeof(ident)))
+	  if (copy_to_user(argp, &ident, sizeof(ident)))
 	    return -EFAULT;
 	  break;
 
 	case WDIOC_GETSTATUS:
 	case WDIOC_GETBOOTSTATUS:
-	  return put_user(0, (int *)arg);
+	  return put_user(0, p);
 
 	case WDIOC_KEEPALIVE:
 	  wdt_ping();
 	  break;
 
 	case WDIOC_SETTIMEOUT:
-	  if (get_user(new_timeout, (int *)arg))
+	  if (get_user(new_timeout, p))
 		  return -EFAULT;
 	  if (wdt_set_heartbeat(new_timeout))
 		  return -EINVAL;
@@ -201,13 +199,13 @@ wdt_ioctl(struct inode *inode, struct file *file, unsigned int cmd,
 	  /* Fall */
 
 	case WDIOC_GETTIMEOUT:
-	  return put_user(timeout, (int *)arg);
+	  return put_user(timeout, p);
 
 	case WDIOC_SETOPTIONS:
 	{
 	  int options, retval = -EINVAL;
 
-	  if (get_user(options, (int *)arg))
+	  if (get_user(options, p))
 	    return -EFAULT;
 
 	  if (options & WDIOS_DISABLECARD) {
@@ -239,7 +237,7 @@ wdt_open(struct inode *inode, struct file *file)
 	 */
 
 	wdt_ping();
-	return 0;
+	return nonseekable_open(inode, file);
 }
 
 static int
diff --git a/drivers/char/watchdog/w83877f_wdt.c b/drivers/char/watchdog/w83877f_wdt.c
index 2b657a522..bccbd4d6a 100644
--- a/drivers/char/watchdog/w83877f_wdt.c
+++ b/drivers/char/watchdog/w83877f_wdt.c
@@ -188,12 +188,8 @@ static void wdt_keepalive(void)
  * /dev/watchdog handling
  */
 
-static ssize_t fop_write(struct file * file, const char * buf, size_t count, loff_t * ppos)
+static ssize_t fop_write(struct file * file, const char __user * buf, size_t count, loff_t * ppos)
 {
-	/* We can't seek */
-	if(ppos != &file->f_pos)
-		return -ESPIPE;
-
 	/* See if we got the magic character 'V' and reload the timer */
 	if(count)
 	{
@@ -230,7 +226,7 @@ static int fop_open(struct inode * inode, struct file * file)
 
 	/* Good, fire up the show */
 	wdt_startup();
-	return 0;
+	return nonseekable_open(inode, file);
 }
 
 static int fop_close(struct inode * inode, struct file * file)
@@ -249,6 +245,8 @@ static int fop_close(struct inode * inode, struct file * file)
 static int fop_ioctl(struct inode *inode, struct file *file, unsigned int cmd,
 	unsigned long arg)
 {
+	void __user *argp = (void __user *)arg;
+	int __user *p = argp;
 	static struct watchdog_info ident=
 	{
 		.options = WDIOF_KEEPALIVEPING | WDIOF_SETTIMEOUT | WDIOF_MAGICCLOSE,
@@ -261,10 +259,10 @@ static int fop_ioctl(struct inode *inode, struct file *file, unsigned int cmd,
 		default:
 			return -ENOIOCTLCMD;
 		case WDIOC_GETSUPPORT:
-			return copy_to_user((struct watchdog_info *)arg, &ident, sizeof(ident))?-EFAULT:0;
+			return copy_to_user(argp, &ident, sizeof(ident))?-EFAULT:0;
 		case WDIOC_GETSTATUS:
 		case WDIOC_GETBOOTSTATUS:
-			return put_user(0, (int *)arg);
+			return put_user(0, p);
 		case WDIOC_KEEPALIVE:
 			wdt_keepalive();
 			return 0;
@@ -272,7 +270,7 @@ static int fop_ioctl(struct inode *inode, struct file *file, unsigned int cmd,
 		{
 			int new_options, retval = -EINVAL;
 
-			if(get_user(new_options, (int *)arg))
+			if(get_user(new_options, p))
 				return -EFAULT;
 
 			if(new_options & WDIOS_DISABLECARD) {
@@ -291,7 +289,7 @@ static int fop_ioctl(struct inode *inode, struct file *file, unsigned int cmd,
 		{
 			int new_timeout;
 
-			if(get_user(new_timeout, (int *)arg))
+			if(get_user(new_timeout, p))
 				return -EFAULT;
 
 			if(new_timeout < 1 || new_timeout > 3600) /* arbitrary upper limit */
@@ -302,7 +300,7 @@ static int fop_ioctl(struct inode *inode, struct file *file, unsigned int cmd,
 			/* Fall through */
 		}
 		case WDIOC_GETTIMEOUT:
-			return put_user(timeout, (int *)arg);
+			return put_user(timeout, p);
 	}
 }
 
diff --git a/drivers/char/watchdog/wafer5823wdt.c b/drivers/char/watchdog/wafer5823wdt.c
index 464a5a796..abb0bea45 100644
--- a/drivers/char/watchdog/wafer5823wdt.c
+++ b/drivers/char/watchdog/wafer5823wdt.c
@@ -95,12 +95,8 @@ wafwdt_stop(void)
 	inb_p(wdt_stop);
 }
 
-static ssize_t wafwdt_write(struct file *file, const char *buf, size_t count, loff_t * ppos)
+static ssize_t wafwdt_write(struct file *file, const char __user *buf, size_t count, loff_t * ppos)
 {
-	/*  Can't seek (pwrite) on this device  */
-	if (ppos != &file->f_pos)
-		return -ESPIPE;
-
 	/* See if we got the magic character 'V' and reload the timer */
 	if (count) {
 		if (!nowayout) {
@@ -128,6 +124,8 @@ static int wafwdt_ioctl(struct inode *inode, struct file *file, unsigned int cmd
 	     unsigned long arg)
 {
 	int new_timeout;
+	void __user *argp = (void __user *)arg;
+	int __user *p = argp;
 	static struct watchdog_info ident = {
 		.options = WDIOF_KEEPALIVEPING | WDIOF_SETTIMEOUT | WDIOF_MAGICCLOSE,
 		.firmware_version = 1,
@@ -136,21 +134,20 @@ static int wafwdt_ioctl(struct inode *inode, struct file *file, unsigned int cmd
 
 	switch (cmd) {
 	case WDIOC_GETSUPPORT:
-		if (copy_to_user
-		    ((struct watchdog_info *) arg, &ident, sizeof (ident)))
+		if (copy_to_user(argp, &ident, sizeof (ident)))
 			return -EFAULT;
 		break;
 
 	case WDIOC_GETSTATUS:
 	case WDIOC_GETBOOTSTATUS:
-		return put_user(0, (int *)arg);
+		return put_user(0, p);
 
 	case WDIOC_KEEPALIVE:
 		wafwdt_ping();
 		break;
 
 	case WDIOC_SETTIMEOUT:
-		if (get_user(new_timeout, (int *)arg))
+		if (get_user(new_timeout, p))
 			return -EFAULT;
 		if ((new_timeout < 1) || (new_timeout > 255))
 			return -EINVAL;
@@ -159,13 +156,13 @@ static int wafwdt_ioctl(struct inode *inode, struct file *file, unsigned int cmd
 		wafwdt_start();
 		/* Fall */
 	case WDIOC_GETTIMEOUT:
-		return put_user(timeout, (int *)arg);
+		return put_user(timeout, p);
 
 	case WDIOC_SETOPTIONS:
 	{
 		int options, retval = -EINVAL;
 
-		if (get_user(options, (int *)arg))
+		if (get_user(options, p))
 			return -EFAULT;
 
 		if (options & WDIOS_DISABLECARD) {
@@ -196,7 +193,7 @@ static int wafwdt_open(struct inode *inode, struct file *file)
 	 *      Activate
 	 */
 	wafwdt_start();
-	return 0;
+	return nonseekable_open(inode, file);
 }
 
 static int
diff --git a/drivers/char/watchdog/wdt.c b/drivers/char/watchdog/wdt.c
index c606ce433..5684aa379 100644
--- a/drivers/char/watchdog/wdt.c
+++ b/drivers/char/watchdog/wdt.c
@@ -286,12 +286,8 @@ static irqreturn_t wdt_interrupt(int irq, void *dev_id, struct pt_regs *regs)
  *	write of data will do, as we we don't define content meaning.
  */
 
-static ssize_t wdt_write(struct file *file, const char *buf, size_t count, loff_t *ppos)
+static ssize_t wdt_write(struct file *file, const char __user *buf, size_t count, loff_t *ppos)
 {
-	/*  Can't seek (pwrite) on this device  */
-	if (ppos != &file->f_pos)
-		return -ESPIPE;
-
 	if(count) {
 		if (!nowayout) {
 			size_t i;
@@ -327,6 +323,8 @@ static ssize_t wdt_write(struct file *file, const char *buf, size_t count, loff_
 static int wdt_ioctl(struct inode *inode, struct file *file, unsigned int cmd,
 	unsigned long arg)
 {
+	void __user *argp = (void __user *)arg;
+	int __user *p = argp;
 	int new_heartbeat;
 	int status;
 
@@ -351,18 +349,18 @@ static int wdt_ioctl(struct inode *inode, struct file *file, unsigned int cmd,
 		default:
 			return -ENOIOCTLCMD;
 		case WDIOC_GETSUPPORT:
-			return copy_to_user((struct watchdog_info *)arg, &ident, sizeof(ident))?-EFAULT:0;
+			return copy_to_user(argp, &ident, sizeof(ident))?-EFAULT:0;
 
 		case WDIOC_GETSTATUS:
 			wdt_get_status(&status);
-			return put_user(status,(int *)arg);
+			return put_user(status, p);
 		case WDIOC_GETBOOTSTATUS:
-			return put_user(0, (int *)arg);
+			return put_user(0, p);
 		case WDIOC_KEEPALIVE:
 			wdt_ping();
 			return 0;
 		case WDIOC_SETTIMEOUT:
-			if (get_user(new_heartbeat, (int *)arg))
+			if (get_user(new_heartbeat, p))
 				return -EFAULT;
 
 			if (wdt_set_heartbeat(new_heartbeat))
@@ -371,7 +369,7 @@ static int wdt_ioctl(struct inode *inode, struct file *file, unsigned int cmd,
 			wdt_ping();
 			/* Fall */
 		case WDIOC_GETTIMEOUT:
-			return put_user(heartbeat, (int *)arg);
+			return put_user(heartbeat, p);
 	}
 }
 
@@ -395,7 +393,7 @@ static int wdt_open(struct inode *inode, struct file *file)
 	 *	Activate
 	 */
 	wdt_start();
-	return 0;
+	return nonseekable_open(inode, file);
 }
 
 /**
@@ -435,14 +433,10 @@ static int wdt_release(struct inode *inode, struct file *file)
  *	farenheit. It was designed by an imperial measurement luddite.
  */
 
-static ssize_t wdt_temp_read(struct file *file, char *buf, size_t count, loff_t *ptr)
+static ssize_t wdt_temp_read(struct file *file, char __user *buf, size_t count, loff_t *ptr)
 {
 	int temperature;
 
-	/*  Can't seek (pread) on this device  */
-	if (ptr != &file->f_pos)
-		return -ESPIPE;
-
 	if (wdt_get_temperature(&temperature))
 		return -EFAULT;
 
@@ -462,7 +456,7 @@ static ssize_t wdt_temp_read(struct file *file, char *buf, size_t count, loff_t
 
 static int wdt_temp_open(struct inode *inode, struct file *file)
 {
-	return 0;
+	return nonseekable_open(inode, file);
 }
 
 /**
diff --git a/drivers/char/watchdog/wdt285.c b/drivers/char/watchdog/wdt285.c
index b61d9e1cc..d3fced33d 100644
--- a/drivers/char/watchdog/wdt285.c
+++ b/drivers/char/watchdog/wdt285.c
@@ -97,6 +97,7 @@ static int watchdog_open(struct inode *inode, struct file *file)
 
 	ret = 0;
 #endif
+	nonseekable_open(inode, file);
 	return ret;
 }
 
@@ -117,10 +118,6 @@ static int watchdog_release(struct inode *inode, struct file *file)
 static ssize_t
 watchdog_write(struct file *file, const char *data, size_t len, loff_t *ppos)
 {
-	/* Can't seek (pwrite) on this device  */
-	if (ppos != &file->f_pos)
-		return -ESPIPE;
-
 	/*
 	 *	Refresh the timer.
 	 */
diff --git a/drivers/char/watchdog/wdt977.c b/drivers/char/watchdog/wdt977.c
index 5de016ebe..388c548c2 100644
--- a/drivers/char/watchdog/wdt977.c
+++ b/drivers/char/watchdog/wdt977.c
@@ -240,7 +240,7 @@ static int wdt977_open(struct inode *inode, struct file *file)
 		__module_get(THIS_MODULE);
 
 	wdt977_start();
-	return 0;
+	return nonseekable_open(inode, file);
 }
 
 static int wdt977_release(struct inode *inode, struct file *file)
@@ -273,12 +273,9 @@ static int wdt977_release(struct inode *inode, struct file *file)
  *      write of data will do, as we we don't define content meaning.
  */
 
-static ssize_t wdt977_write(struct file *file, const char *buf, size_t count, loff_t *ppos)
+static ssize_t wdt977_write(struct file *file, const char __user *buf,
+			    size_t count, loff_t *ppos)
 {
-	/* Can't seek (pwrite) on this device  */
-	if (ppos != &file->f_pos)
-		return -ESPIPE;
-
 	if (count) {
 		if (!nowayout) {
 			size_t i;
@@ -325,6 +322,12 @@ static int wdt977_ioctl(struct inode *inode, struct file *file,
 	int status;
 	int new_options, retval = -EINVAL;
 	int new_timeout;
+	union {
+		struct watchdog_info __user *ident;
+		int __user *i;
+	} uarg;
+
+	uarg.i = (int __user *)arg;
 
 	switch(cmd)
 	{
@@ -332,22 +335,22 @@ static int wdt977_ioctl(struct inode *inode, struct file *file,
 		return -ENOIOCTLCMD;
 
 	case WDIOC_GETSUPPORT:
-		return copy_to_user((struct watchdog_info *)arg, &ident,
+		return copy_to_user(uarg.ident, &ident,
 			sizeof(ident)) ? -EFAULT : 0;
 
 	case WDIOC_GETSTATUS:
 		wdt977_get_status(&status);
-		return put_user(status, (int *) arg);
+		return put_user(status, uarg.i);
 
 	case WDIOC_GETBOOTSTATUS:
-		return put_user(0, (int *) arg);
+		return put_user(0, uarg.i);
 
 	case WDIOC_KEEPALIVE:
 		wdt977_keepalive();
 		return 0;
 
 	case WDIOC_SETOPTIONS:
-		if (get_user (new_options, (int *) arg))
+		if (get_user (new_options, uarg.i))
 			return -EFAULT;
 
 		if (new_options & WDIOS_DISABLECARD) {
@@ -363,7 +366,7 @@ static int wdt977_ioctl(struct inode *inode, struct file *file,
 		return retval;
 
 	case WDIOC_SETTIMEOUT:
-		if (get_user(new_timeout, (int *) arg))
+		if (get_user(new_timeout, uarg.i))
 			return -EFAULT;
 
 		if (wdt977_set_timeout(new_timeout))
@@ -373,7 +376,7 @@ static int wdt977_ioctl(struct inode *inode, struct file *file,
 		/* Fall */
 
 	case WDIOC_GETTIMEOUT:
-		return put_user(timeout, (int *)arg);
+		return put_user(timeout, uarg.i);
 
 	}
 }
diff --git a/drivers/char/watchdog/wdt_pci.c b/drivers/char/watchdog/wdt_pci.c
index 395df48c8..9d5b5f4e5 100644
--- a/drivers/char/watchdog/wdt_pci.c
+++ b/drivers/char/watchdog/wdt_pci.c
@@ -331,12 +331,8 @@ static irqreturn_t wdtpci_interrupt(int irq, void *dev_id, struct pt_regs *regs)
  *	write of data will do, as we we don't define content meaning.
  */
 
-static ssize_t wdtpci_write(struct file *file, const char *buf, size_t count, loff_t *ppos)
+static ssize_t wdtpci_write(struct file *file, const char __user *buf, size_t count, loff_t *ppos)
 {
-	/*  Can't seek (pwrite) on this device  */
-	if (ppos != &file->f_pos)
-		return -ESPIPE;
-
 	if (count) {
 		if (!nowayout) {
 			size_t i;
@@ -374,6 +370,8 @@ static int wdtpci_ioctl(struct inode *inode, struct file *file, unsigned int cmd
 {
 	int new_heartbeat;
 	int status;
+	void __user *argp = (void __user *)arg;
+	int __user *p = argp;
 
 	static struct watchdog_info ident = {
 		.options =		WDIOF_SETTIMEOUT|
@@ -396,18 +394,18 @@ static int wdtpci_ioctl(struct inode *inode, struct file *file, unsigned int cmd
 		default:
 			return -ENOIOCTLCMD;
 		case WDIOC_GETSUPPORT:
-			return copy_to_user((struct watchdog_info *)arg, &ident, sizeof(ident))?-EFAULT:0;
+			return copy_to_user(argp, &ident, sizeof(ident))?-EFAULT:0;
 
 		case WDIOC_GETSTATUS:
 			wdtpci_get_status(&status);
-			return put_user(status,(int *)arg);
+			return put_user(status, p);
 		case WDIOC_GETBOOTSTATUS:
-			return put_user(0, (int *)arg);
+			return put_user(0, p);
 		case WDIOC_KEEPALIVE:
 			wdtpci_ping();
 			return 0;
 		case WDIOC_SETTIMEOUT:
-			if (get_user(new_heartbeat, (int *)arg))
+			if (get_user(new_heartbeat, p))
 				return -EFAULT;
 
 			if (wdtpci_set_heartbeat(new_heartbeat))
@@ -416,7 +414,7 @@ static int wdtpci_ioctl(struct inode *inode, struct file *file, unsigned int cmd
 			wdtpci_ping();
 			/* Fall */
 		case WDIOC_GETTIMEOUT:
-			return put_user(heartbeat, (int *)arg);
+			return put_user(heartbeat, p);
 	}
 }
 
@@ -444,7 +442,7 @@ static int wdtpci_open(struct inode *inode, struct file *file)
 	 *	Activate
 	 */
 	wdtpci_start();
-	return 0;
+	return nonseekable_open(inode, file);
 }
 
 /**
@@ -484,14 +482,10 @@ static int wdtpci_release(struct inode *inode, struct file *file)
  *	fahrenheit. It was designed by an imperial measurement luddite.
  */
 
-static ssize_t wdtpci_temp_read(struct file *file, char *buf, size_t count, loff_t *ptr)
+static ssize_t wdtpci_temp_read(struct file *file, char __user *buf, size_t count, loff_t *ptr)
 {
 	int temperature;
 
-	/*  Can't seek (pread) on this device  */
-	if (ptr != &file->f_pos)
-		return -ESPIPE;
-
 	if (wdtpci_get_temperature(&temperature))
 		return -EFAULT;
 
@@ -511,7 +505,7 @@ static ssize_t wdtpci_temp_read(struct file *file, char *buf, size_t count, loff
 
 static int wdtpci_temp_open(struct inode *inode, struct file *file)
 {
-	return 0;
+	return nonseekable_open(inode, file);
 }
 
 /**
diff --git a/drivers/cpufreq/cpufreq_userspace.c b/drivers/cpufreq/cpufreq_userspace.c
index 510214470..161e8a27c 100644
--- a/drivers/cpufreq/cpufreq_userspace.c
+++ b/drivers/cpufreq/cpufreq_userspace.c
@@ -151,13 +151,13 @@ EXPORT_SYMBOL_GPL(cpufreq_setmax);
 /*********************** cpufreq_sysctl interface ********************/
 static int
 cpufreq_procctl(ctl_table *ctl, int write, struct file *filp,
-		void __user *buffer, size_t *lenp)
+		void __user *buffer, size_t *lenp, loff_t *ppos)
 {
 	char buf[16], *p;
 	int cpu = (long) ctl->extra1;
 	unsigned int len, left = *lenp;
 
-	if (!left || (filp->f_pos && !write) || !cpu_online(cpu)) {
+	if (!left || (*ppos && !write) || !cpu_online(cpu)) {
 		*lenp = 0;
 		return 0;
 	}
@@ -183,7 +183,7 @@ cpufreq_procctl(ctl_table *ctl, int write, struct file *filp,
 	}
 
 	*lenp = len;
-	filp->f_pos += len;
+	*ppos += len;
 	return 0;
 }
 
diff --git a/drivers/fc4/fc.c b/drivers/fc4/fc.c
index e5f41e017..1fbb219aa 100644
--- a/drivers/fc4/fc.c
+++ b/drivers/fc4/fc.c
@@ -38,7 +38,7 @@
 #include <asm/irq.h>
 #include <asm/semaphore.h>
 #include "fcp_impl.h"
-#include "../scsi/hosts.h"
+#include <scsi/scsi_host.h>
 
 /* #define FCDEBUG */
 
diff --git a/drivers/fc4/soc.c b/drivers/fc4/soc.c
index 16f156726..3f8b4c151 100644
--- a/drivers/fc4/soc.c
+++ b/drivers/fc4/soc.c
@@ -714,7 +714,7 @@ static inline void soc_init(struct sbus_dev *sdev, int no)
 static int __init soc_probe(void)
 {
 	struct sbus_bus *sbus;
-	struct sbus_dev *sdev = 0;
+	struct sbus_dev *sdev = NULL;
 	struct soc *s;
 	int cards = 0;
 
diff --git a/drivers/fc4/socal.c b/drivers/fc4/socal.c
index db01b6d7f..e158d7d26 100644
--- a/drivers/fc4/socal.c
+++ b/drivers/fc4/socal.c
@@ -851,7 +851,7 @@ static inline void socal_init(struct sbus_dev *sdev, int no)
 static int __init socal_probe(void)
 {
 	struct sbus_bus *sbus;
-	struct sbus_dev *sdev = 0;
+	struct sbus_dev *sdev = NULL;
 	struct socal *s;
 	int cards = 0;
 
diff --git a/drivers/firmware/Kconfig b/drivers/firmware/Kconfig
index 597bf5f04..a6504dbd3 100644
--- a/drivers/firmware/Kconfig
+++ b/drivers/firmware/Kconfig
@@ -34,4 +34,23 @@ config EFI_VARS
 	  Subsequent efibootmgr releases may be found at:
 	  http://linux.dell.com/efibootmgr
 
+config EFI_PCDP
+	bool "Console device selection via EFI PCDP or HCDP table"
+	depends on ACPI && EFI && IA64
+	default y if IA64
+	help
+	  If your firmware supplies the PCDP table, and you want to
+	  automatically use the primary console device it describes
+	  as the Linux console, say Y here.
+
+	  If your firmware supplies the HCDP table, and you want to
+	  use the first serial port it describes as the Linux console,
+	  say Y here.  If your EFI ConOut path contains only a UART
+	  device, it will become the console automatically.  Otherwise,
+	  you must specify the "console=ttyS0" kernel boot argument.
+
+	  You must also enable the appropriate drivers (serial, VGA, etc.)
+
+	  See <http://www.dig64.org/specifications/DIG64_HCDPv20_042804.pdf>
+
 endmenu
diff --git a/drivers/firmware/Makefile b/drivers/firmware/Makefile
index ca7745add..90fd0b26d 100644
--- a/drivers/firmware/Makefile
+++ b/drivers/firmware/Makefile
@@ -3,3 +3,4 @@
 #
 obj-$(CONFIG_EDD)             	+= edd.o
 obj-$(CONFIG_EFI_VARS)		+= efivars.o
+obj-$(CONFIG_EFI_PCDP)		+= pcdp.o
diff --git a/drivers/firmware/edd.c b/drivers/firmware/edd.c
index 40257f7ef..47d430a33 100644
--- a/drivers/firmware/edd.c
+++ b/drivers/firmware/edd.c
@@ -2,7 +2,7 @@
  * linux/arch/i386/kernel/edd.c
  *  Copyright (C) 2002, 2003, 2004 Dell Inc.
  *  by Matt Domsch <Matt_Domsch@dell.com>
- *  disk80 signature by Matt Domsch, Andrew Wilks, and Sandeep K. Shandilya
+ *  disk signature by Matt Domsch, Andrew Wilks, and Sandeep K. Shandilya
  *  legacy CHS by Patrick J. LoPresti <patl@users.sourceforge.net>
  *
  * BIOS Enhanced Disk Drive Services (EDD)
@@ -43,8 +43,8 @@
 #include <linux/blkdev.h>
 #include <linux/edd.h>
 
-#define EDD_VERSION "0.15"
-#define EDD_DATE    "2004-May-17"
+#define EDD_VERSION "0.16"
+#define EDD_DATE    "2004-Jun-25"
 
 MODULE_AUTHOR("Matt Domsch <Matt_Domsch@Dell.com>");
 MODULE_DESCRIPTION("sysfs interface to BIOS EDD information");
@@ -54,6 +54,8 @@ MODULE_VERSION(EDD_VERSION);
 #define left (PAGE_SIZE - (p - buf) - 1)
 
 struct edd_device {
+	unsigned int index;
+	unsigned int mbr_signature;
 	struct edd_info *info;
 	struct kobject kobj;
 };
@@ -77,6 +79,18 @@ struct edd_attribute edd_attr_##_name = { 	\
 	.test	= _test,				\
 };
 
+static int
+edd_has_mbr_signature(struct edd_device *edev)
+{
+	return edev->index < min_t(unsigned char, edd.mbr_signature_nr, EDD_MBR_SIG_MAX);
+}
+
+static int
+edd_has_edd_info(struct edd_device *edev)
+{
+	return edev->index < min_t(unsigned char, edd.edd_info_nr, EDDMAXNR);
+}
+
 static inline struct edd_info *
 edd_dev_get_info(struct edd_device *edev)
 {
@@ -84,9 +98,13 @@ edd_dev_get_info(struct edd_device *edev)
 }
 
 static inline void
-edd_dev_set_info(struct edd_device *edev, struct edd_info *info)
+edd_dev_set_info(struct edd_device *edev, int i)
 {
-	edev->info = info;
+	edev->index = i;
+	if (edd_has_mbr_signature(edev))
+		edev->mbr_signature = edd.mbr_signature[i];
+	if (edd_has_edd_info(edev))
+		edev->info = &edd.edd_info[i];
 }
 
 #define to_edd_attr(_attr) container_of(_attr,struct edd_attribute,attr)
@@ -256,10 +274,10 @@ edd_show_version(struct edd_device *edev, char *buf)
 }
 
 static ssize_t
-edd_show_disk80_sig(struct edd_device *edev, char *buf)
+edd_show_mbr_signature(struct edd_device *edev, char *buf)
 {
 	char *p = buf;
-	p += scnprintf(p, left, "0x%08x\n", edd_disk80_sig);
+	p += scnprintf(p, left, "0x%08x\n", edev->mbr_signature);
 	return (p - buf);
 }
 
@@ -440,10 +458,10 @@ edd_has_legacy_max_cylinder(struct edd_device *edev)
 {
 	struct edd_info *info;
 	if (!edev)
-		return -EINVAL;
+		return 0;
 	info = edd_dev_get_info(edev);
 	if (!info)
-		return -EINVAL;
+		return 0;
 	return info->legacy_max_cylinder > 0;
 }
 
@@ -452,10 +470,10 @@ edd_has_legacy_max_head(struct edd_device *edev)
 {
 	struct edd_info *info;
 	if (!edev)
-		return -EINVAL;
+		return 0;
 	info = edd_dev_get_info(edev);
 	if (!info)
-		return -EINVAL;
+		return 0;
 	return info->legacy_max_head > 0;
 }
 
@@ -464,10 +482,10 @@ edd_has_legacy_sectors_per_track(struct edd_device *edev)
 {
 	struct edd_info *info;
 	if (!edev)
-		return -EINVAL;
+		return 0;
 	info = edd_dev_get_info(edev);
 	if (!info)
-		return -EINVAL;
+		return 0;
 	return info->legacy_sectors_per_track > 0;
 }
 
@@ -476,10 +494,10 @@ edd_has_default_cylinders(struct edd_device *edev)
 {
 	struct edd_info *info;
 	if (!edev)
-		return -EINVAL;
+		return 0;
 	info = edd_dev_get_info(edev);
 	if (!info)
-		return -EINVAL;
+		return 0;
 	return info->params.num_default_cylinders > 0;
 }
 
@@ -488,10 +506,10 @@ edd_has_default_heads(struct edd_device *edev)
 {
 	struct edd_info *info;
 	if (!edev)
-		return -EINVAL;
+		return 0;
 	info = edd_dev_get_info(edev);
 	if (!info)
-		return -EINVAL;
+		return 0;
 	return info->params.num_default_heads > 0;
 }
 
@@ -500,10 +518,10 @@ edd_has_default_sectors_per_track(struct edd_device *edev)
 {
 	struct edd_info *info;
 	if (!edev)
-		return -EINVAL;
+		return 0;
 	info = edd_dev_get_info(edev);
 	if (!info)
-		return -EINVAL;
+		return 0;
 	return info->params.sectors_per_track > 0;
 }
 
@@ -538,23 +556,12 @@ edd_has_edd30(struct edd_device *edev)
 	return 1;
 }
 
-static int
-edd_has_disk80_sig(struct edd_device *edev)
-{
-	struct edd_info *info;
-	if (!edev)
-		return 0;
-	info = edd_dev_get_info(edev);
-	if (!info)
-		return 0;
-	return info->device == 0x80;
-}
 
-static EDD_DEVICE_ATTR(raw_data, 0444, edd_show_raw_data, NULL);
-static EDD_DEVICE_ATTR(version, 0444, edd_show_version, NULL);
-static EDD_DEVICE_ATTR(extensions, 0444, edd_show_extensions, NULL);
-static EDD_DEVICE_ATTR(info_flags, 0444, edd_show_info_flags, NULL);
-static EDD_DEVICE_ATTR(sectors, 0444, edd_show_sectors, NULL);
+static EDD_DEVICE_ATTR(raw_data, 0444, edd_show_raw_data, edd_has_edd_info);
+static EDD_DEVICE_ATTR(version, 0444, edd_show_version, edd_has_edd_info);
+static EDD_DEVICE_ATTR(extensions, 0444, edd_show_extensions, edd_has_edd_info);
+static EDD_DEVICE_ATTR(info_flags, 0444, edd_show_info_flags, edd_has_edd_info);
+static EDD_DEVICE_ATTR(sectors, 0444, edd_show_sectors, edd_has_edd_info);
 static EDD_DEVICE_ATTR(legacy_max_cylinder, 0444,
                        edd_show_legacy_max_cylinder,
 		       edd_has_legacy_max_cylinder);
@@ -572,23 +579,23 @@ static EDD_DEVICE_ATTR(default_sectors_per_track, 0444,
 		       edd_has_default_sectors_per_track);
 static EDD_DEVICE_ATTR(interface, 0444, edd_show_interface, edd_has_edd30);
 static EDD_DEVICE_ATTR(host_bus, 0444, edd_show_host_bus, edd_has_edd30);
-static EDD_DEVICE_ATTR(mbr_signature, 0444, edd_show_disk80_sig, edd_has_disk80_sig);
+static EDD_DEVICE_ATTR(mbr_signature, 0444, edd_show_mbr_signature, edd_has_mbr_signature);
 
 
 /* These are default attributes that are added for every edd
- * device discovered.
+ * device discovered.  There are none.
  */
 static struct attribute * def_attrs[] = {
-	&edd_attr_raw_data.attr,
-	&edd_attr_version.attr,
-	&edd_attr_extensions.attr,
-	&edd_attr_info_flags.attr,
-	&edd_attr_sectors.attr,
 	NULL,
 };
 
 /* These attributes are conditional and only added for some devices. */
 static struct edd_attribute * edd_attrs[] = {
+	&edd_attr_raw_data,
+	&edd_attr_version,
+	&edd_attr_extensions,
+	&edd_attr_info_flags,
+	&edd_attr_sectors,
 	&edd_attr_legacy_max_cylinder,
 	&edd_attr_legacy_max_head,
 	&edd_attr_legacy_sectors_per_track,
@@ -709,9 +716,9 @@ edd_device_register(struct edd_device *edev, int i)
 	if (!edev)
 		return 1;
 	memset(edev, 0, sizeof (*edev));
-	edd_dev_set_info(edev, &edd[i]);
+	edd_dev_set_info(edev, i);
 	kobject_set_name(&edev->kobj, "int13_dev%02x",
-			 edd[i].device);
+			 0x80 + i);
 	kobj_set_kset_s(edev,edd_subsys);
 	error = kobject_register(&edev->kobj);
 	if (!error)
@@ -719,11 +726,15 @@ edd_device_register(struct edd_device *edev, int i)
 	return error;
 }
 
+static inline int edd_num_devices(void)
+{
+	return min_t(unsigned char,
+		     max_t(unsigned char, edd.edd_info_nr, edd.mbr_signature_nr),
+		     max_t(unsigned char, EDD_MBR_SIG_MAX, EDDMAXNR));
+}
+
 /**
  * edd_init() - creates sysfs tree of EDD data
- *
- * This assumes that eddnr and edd were
- * assigned in setup.c already.
  */
 static int __init
 edd_init(void)
@@ -733,9 +744,9 @@ edd_init(void)
 	struct edd_device *edev;
 
 	printk(KERN_INFO "BIOS EDD facility v%s %s, %d devices found\n",
-	       EDD_VERSION, EDD_DATE, eddnr);
+	       EDD_VERSION, EDD_DATE, edd_num_devices());
 
-	if (!eddnr) {
+	if (!edd_num_devices()) {
 		printk(KERN_INFO "EDD information not available.\n");
 		return 1;
 	}
@@ -744,7 +755,7 @@ edd_init(void)
 	if (rc)
 		return rc;
 
-	for (i = 0; i < eddnr && i < EDDMAXNR && !rc; i++) {
+	for (i = 0; i < edd_num_devices() && !rc; i++) {
 		edev = kmalloc(sizeof (*edev), GFP_KERNEL);
 		if (!edev)
 			return -ENOMEM;
@@ -768,7 +779,7 @@ edd_exit(void)
 	int i;
 	struct edd_device *edev;
 
-	for (i = 0; i < eddnr && i < EDDMAXNR; i++) {
+	for (i = 0; i < edd_num_devices(); i++) {
 		if ((edev = edd_devices[i]))
 			edd_device_unregister(edev);
 	}
diff --git a/drivers/firmware/efivars.c b/drivers/firmware/efivars.c
index 429070cd8..4f9284956 100644
--- a/drivers/firmware/efivars.c
+++ b/drivers/firmware/efivars.c
@@ -134,7 +134,7 @@ struct efivar_attribute {
 
 #define EFI_ATTR(_name, _mode, _show, _store) \
 struct subsys_attribute efi_attr_##_name = { \
-	.attr {.name = __stringify(_name), .mode = _mode, .owner = THIS_MODULE}, \
+	.attr = {.name = __stringify(_name), .mode = _mode, .owner = THIS_MODULE}, \
 	.show = _show, \
 	.store = _store, \
 };
diff --git a/drivers/firmware/pcdp.c b/drivers/firmware/pcdp.c
index 61457c505..09e4f68d0 100644
--- a/drivers/firmware/pcdp.c
+++ b/drivers/firmware/pcdp.c
@@ -1,10 +1,14 @@
 /*
- * Copyright (C) 2002, 2003, 2004 Hewlett-Packard Co.
- *	Khalid Aziz <khalid_aziz@hp.com>
+ * Parse the EFI PCDP table to locate the console device.
+ *
+ * (c) Copyright 2002, 2003, 2004 Hewlett-Packard Development Company, L.P.
+ *	Khalid Aziz <khalid.aziz@hp.com>
  *	Alex Williamson <alex.williamson@hp.com>
  *	Bjorn Helgaas <bjorn.helgaas@hp.com>
  *
- * Parse the EFI PCDP table to locate the console device.
+ * 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/acpi.h>
diff --git a/drivers/firmware/pcdp.h b/drivers/firmware/pcdp.h
index 4217c3b1c..863bb6f76 100644
--- a/drivers/firmware/pcdp.h
+++ b/drivers/firmware/pcdp.h
@@ -1,12 +1,16 @@
 /*
- * Copyright (C) 2002, 2004 Hewlett-Packard Co.
- *	Khalid Aziz <khalid_aziz@hp.com>
- *	Bjorn Helgaas <bjorn.helgaas@hp.com>
- *
  * Definitions for PCDP-defined console devices
  *
  * v1.0a: http://www.dig64.org/specifications/DIG64_HCDPv10a_01.pdf
  * v2.0:  http://www.dig64.org/specifications/DIG64_HCDPv20_042804.pdf
+ *
+ * (c) Copyright 2002, 2004 Hewlett-Packard Development Company, L.P.
+ *	Khalid Aziz <khalid.aziz@hp.com>
+ *	Bjorn Helgaas <bjorn.helgaas@hp.com>
+ *
+ * This program is free software; you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License version 2 as
+ * published by the Free Software Foundation.
  */
 
 #define PCDP_CONSOLE			0
diff --git a/drivers/i2c/busses/i2c-elektor.c b/drivers/i2c/busses/i2c-elektor.c
index c16d97e95..768c901a8 100644
--- a/drivers/i2c/busses/i2c-elektor.c
+++ b/drivers/i2c/busses/i2c-elektor.c
@@ -143,7 +143,7 @@ static int pcf_isa_init(void)
 		}
 	}
 	if (irq > 0) {
-		if (request_irq(irq, pcf_isa_handler, 0, "PCF8584", 0) < 0) {
+		if (request_irq(irq, pcf_isa_handler, 0, "PCF8584", NULL) < 0) {
 			printk(KERN_ERR "i2c-elektor: Request irq%d failed\n", irq);
 			irq = 0;
 		} else
@@ -244,7 +244,7 @@ static int __init i2c_pcfisa_init(void)
  fail:
 	if (irq > 0) {
 		disable_irq(irq);
-		free_irq(irq, 0);
+		free_irq(irq, NULL);
 	}
 
 	if (!mmapped)
@@ -258,7 +258,7 @@ static void i2c_pcfisa_exit(void)
 
 	if (irq > 0) {
 		disable_irq(irq);
-		free_irq(irq, 0);
+		free_irq(irq, NULL);
 	}
 
 	if (!mmapped)
diff --git a/drivers/i2c/busses/i2c-ibm_iic.c b/drivers/i2c/busses/i2c-ibm_iic.c
index 962184be1..a25218dba 100644
--- a/drivers/i2c/busses/i2c-ibm_iic.c
+++ b/drivers/i2c/busses/i2c-ibm_iic.c
@@ -45,7 +45,7 @@
 
 #include "i2c-ibm_iic.h"
 
-#define DRIVER_VERSION "2.01"
+#define DRIVER_VERSION "2.1"
 
 MODULE_DESCRIPTION("IBM IIC driver v" DRIVER_VERSION);
 MODULE_LICENSE("GPL");
@@ -96,6 +96,31 @@ static void dump_iic_regs(const char* header, struct ibm_iic_private* dev)
 #  define DUMP_REGS(h,dev)	((void)0)
 #endif
 
+/* Bus timings (in ns) for bit-banging */
+static struct i2c_timings {
+	unsigned int hd_sta;
+	unsigned int su_sto;
+	unsigned int low;
+	unsigned int high;
+	unsigned int buf;
+} timings [] = {
+/* Standard mode (100 KHz) */
+{
+	.hd_sta	= 4000,
+	.su_sto	= 4000,
+	.low	= 4700,
+	.high	= 4000,
+	.buf	= 4700,
+},
+/* Fast mode (400 KHz) */
+{
+	.hd_sta = 600,
+	.su_sto	= 600,
+	.low 	= 1300,
+	.high 	= 600,
+	.buf	= 1300,
+}};
+
 /* Enable/disable interrupt generation */
 static inline void iic_interrupt_mode(struct ibm_iic_private* dev, int enable)
 {
@@ -195,6 +220,104 @@ static void iic_dev_reset(struct ibm_iic_private* dev)
 	iic_dev_init(dev);
 }
 
+/*
+ * Do 0-length transaction using bit-banging through IIC_DIRECTCNTL register.
+ */
+
+/* Wait for SCL and/or SDA to be high */
+static int iic_dc_wait(volatile struct iic_regs *iic, u8 mask)
+{
+	unsigned long x = jiffies + HZ / 28 + 2;
+	while ((in_8(&iic->directcntl) & mask) != mask){
+		if (unlikely(time_after(jiffies, x)))
+			return -1;
+		cond_resched();
+	}
+	return 0;
+}
+
+static int iic_smbus_quick(struct ibm_iic_private* dev, const struct i2c_msg* p)
+{
+	volatile struct iic_regs* iic = dev->vaddr;
+	const struct i2c_timings* t = &timings[dev->fast_mode ? 1 : 0];
+	u8 mask, v, sda;
+	int i, res;
+
+	/* Only 7-bit addresses are supported */
+	if (unlikely(p->flags & I2C_M_TEN)){
+		DBG("%d: smbus_quick - 10 bit addresses are not supported\n",
+			dev->idx);
+		return -EINVAL;
+	}
+
+	DBG("%d: smbus_quick(0x%02x)\n", dev->idx, p->addr);
+
+	/* Reset IIC interface */
+	out_8(&iic->xtcntlss, XTCNTLSS_SRST);
+
+	/* Wait for bus to become free */
+	out_8(&iic->directcntl, DIRCNTL_SDAC | DIRCNTL_SCC);
+	if (unlikely(iic_dc_wait(iic, DIRCNTL_MSDA | DIRCNTL_MSC)))
+		goto err;
+	ndelay(t->buf);
+
+	/* START */
+	out_8(&iic->directcntl, DIRCNTL_SCC);
+	sda = 0;
+	ndelay(t->hd_sta);
+
+	/* Send address */
+	v = (u8)((p->addr << 1) | ((p->flags & I2C_M_RD) ? 1 : 0));
+	for (i = 0, mask = 0x80; i < 8; ++i, mask >>= 1){
+		out_8(&iic->directcntl, sda);
+		ndelay(t->low / 2);
+		sda = (v & mask) ? DIRCNTL_SDAC : 0;
+		out_8(&iic->directcntl, sda);
+		ndelay(t->low / 2);
+
+		out_8(&iic->directcntl, DIRCNTL_SCC | sda);
+		if (unlikely(iic_dc_wait(iic, DIRCNTL_MSC)))
+			goto err;
+		ndelay(t->high);
+	}
+
+	/* ACK */
+	out_8(&iic->directcntl, sda);
+	ndelay(t->low / 2);
+	out_8(&iic->directcntl, DIRCNTL_SDAC);
+	ndelay(t->low / 2);
+	out_8(&iic->directcntl, DIRCNTL_SDAC | DIRCNTL_SCC);
+	if (unlikely(iic_dc_wait(iic, DIRCNTL_MSC)))
+		goto err;
+	res = (in_8(&iic->directcntl) & DIRCNTL_MSDA) ? -EREMOTEIO : 1;
+	ndelay(t->high);
+
+	/* STOP */
+	out_8(&iic->directcntl, 0);
+	ndelay(t->low);
+	out_8(&iic->directcntl, DIRCNTL_SCC);
+	if (unlikely(iic_dc_wait(iic, DIRCNTL_MSC)))
+		goto err;
+	ndelay(t->su_sto);
+	out_8(&iic->directcntl, DIRCNTL_SDAC | DIRCNTL_SCC);
+
+	ndelay(t->buf);
+
+	DBG("%d: smbus_quick -> %s\n", dev->idx, res ? "NACK" : "ACK");
+out:
+	/* Remove reset */
+	out_8(&iic->xtcntlss, 0);
+
+	/* Reinitialize interface */
+	iic_dev_init(dev);
+
+	return res;
+err:
+	DBG("%d: smbus_quick - bus is stuck\n", dev->idx);
+	res = -EREMOTEIO;
+	goto out;
+}
+
 /*
  * IIC interrupt handler
  */
@@ -457,13 +580,10 @@ static int iic_xfer(struct i2c_adapter *adap, struct i2c_msg msgs[], int num)
 		if (unlikely(msgs[i].len <= 0)){
 			if (num == 1 && !msgs[0].len){
 				/* Special case for I2C_SMBUS_QUICK emulation.
-				 * Although this logic is FAR FROM PERFECT, this 
-				 * is what previous driver version did.
 				 * IBM IIC doesn't support 0-length transactions
-				 * (except bit-banging through IICx_DIRECTCNTL).
+				 * so we have to emulate them using bit-banging.
 				 */
-				DBG("%d: zero-length msg kludge\n", dev->idx); 
-				return 0;
+				return iic_smbus_quick(dev, &msgs[0]);
 			}
 			DBG("%d: invalid len %d in msg[%d]\n", dev->idx, 
 				msgs[i].len, i);
diff --git a/drivers/i2c/busses/i2c-piix4.c b/drivers/i2c/busses/i2c-piix4.c
index 31ee54341..e7c0262b0 100644
--- a/drivers/i2c/busses/i2c-piix4.c
+++ b/drivers/i2c/busses/i2c-piix4.c
@@ -40,6 +40,7 @@
 #include <linux/i2c.h>
 #include <linux/init.h>
 #include <linux/apm_bios.h>
+#include <linux/dmi.h>
 #include <asm/io.h>
 
 
@@ -114,18 +115,13 @@ static int piix4_transaction(void);
 static unsigned short piix4_smba = 0;
 static struct i2c_adapter piix4_adapter;
 
-/*
- * Get DMI information.
- */
-static int __devinit ibm_dmi_probe(void)
-{
-#ifdef CONFIG_X86
-	extern int is_unsafe_smbus;
-	return is_unsafe_smbus;
-#else
-	return 0;
-#endif
-}
+static struct dmi_system_id __devinitdata piix4_dmi_table[] = {
+	{
+		.ident = "IBM",
+		.matches = { DMI_MATCH(DMI_SYS_VENDOR, "IBM"), },
+	},
+	{ },
+};
 
 static int __devinit piix4_setup(struct pci_dev *PIIX4_dev,
 				const struct pci_device_id *id)
@@ -138,7 +134,9 @@ static int __devinit piix4_setup(struct pci_dev *PIIX4_dev,
 
 	dev_info(&PIIX4_dev->dev, "Found %s device\n", pci_name(PIIX4_dev));
 
-	if(ibm_dmi_probe()) {
+	/* Don't access SMBus on IBM systems which get corrupted eeproms */
+	if (dmi_check_system(piix4_dmi_table) &&
+			PIIX4_dev->vendor == PCI_VENDOR_ID_INTEL) {
 		dev_err(&PIIX4_dev->dev, "IBM Laptop detected; this module "
 			"may corrupt your serial eeprom! Refusing to load "
 			"module!\n");
diff --git a/drivers/i2c/busses/i2c-rpx.c b/drivers/i2c/busses/i2c-rpx.c
index 5d4ee2c4e..9497b1b68 100644
--- a/drivers/i2c/busses/i2c-rpx.c
+++ b/drivers/i2c/busses/i2c-rpx.c
@@ -50,8 +50,8 @@ rpx_iic_init(struct i2c_algo_8xx_data *data)
 	/* Allocate space for two transmit and two receive buffer
 	 * descriptors in the DP ram.
 	 */
-	data->dp_addr = m8xx_cpm_dpalloc(sizeof(cbd_t) * 4);
-
+	data->dp_addr = cpm_dpalloc(sizeof(cbd_t) * 4, 8);
+		
 	/* ptr to i2c area */
 	data->i2c = (i2c8xx_t *)&(((immap_t *)IMAP_ADDR)->im_i2c);
 }
diff --git a/drivers/i2c/busses/scx200_acb.c b/drivers/i2c/busses/scx200_acb.c
index 76a9d68c0..b3cbbb9ea 100644
--- a/drivers/i2c/busses/scx200_acb.c
+++ b/drivers/i2c/busses/scx200_acb.c
@@ -458,6 +458,7 @@ static int  __init scx200_acb_create(int base, int index)
 	adapter->owner = THIS_MODULE;
 	adapter->id = I2C_ALGO_SMBUS;
 	adapter->algo = &scx200_acb_algorithm;
+	adapter->class = I2C_CLASS_HWMON;
 
 	init_MUTEX(&iface->sem);
 
diff --git a/drivers/i2c/chips/Kconfig b/drivers/i2c/chips/Kconfig
index 29ba21651..af8d273d0 100644
--- a/drivers/i2c/chips/Kconfig
+++ b/drivers/i2c/chips/Kconfig
@@ -22,6 +22,26 @@ config SENSORS_ADM1021
 	  This driver can also be built as a module.  If so, the module
 	  will be called adm1021.
 
+config SENSORS_ADM1025
+	tristate "Analog Devices ADM1025 and compatibles"
+	depends on I2C && EXPERIMENTAL
+	select I2C_SENSOR
+	help
+	  If you say yes here you get support for Analog Devices ADM1025
+	  and Philips NE1619 sensor chips.
+	  This driver can also be built as a module.  If so, the module
+	  will be called adm1025.
+
+config SENSORS_ADM1031
+	tristate "Analog Devices ADM1031 and compatibles"
+	depends on I2C && EXPERIMENTAL
+	select I2C_SENSOR
+	help
+	  If you say yes here you get support for Analog Devices ADM1031 
+	  and ADM1030 sensor chips.
+	  This driver can also be built as a module.  If so, the module
+	  will be called adm1031.
+
 config SENSORS_ASB100
 	tristate "Asus ASB100 Bach"
 	depends on I2C && EXPERIMENTAL
@@ -83,12 +103,27 @@ config SENSORS_LM75
 	select I2C_SENSOR
 	help
 	  If you say yes here you get support for National Semiconductor LM75
-	  sensor chips and clones: Dallas Semi DS75 and DS1775, TelCon
-	  TCN75, and National Semiconductor LM77.
+	  sensor chips and clones: Dallas Semiconductor DS75 and DS1775 (in
+	  9-bit precision mode), and TelCom (now Microchip) TCN75.
+
+	  The DS75 and DS1775 in 10- to 12-bit precision modes will require
+	  a force module parameter. The driver will not handle the extra
+	  precision anyhow.
 
 	  This driver can also be built as a module.  If so, the module
 	  will be called lm75.
 
+config SENSORS_LM77
+	tristate "National Semiconductor LM77"
+	depends on I2C && EXPERIMENTAL
+	select I2C_SENSOR
+	help
+	  If you say yes here you get support for National Semiconductor LM77
+	  sensor chips.
+
+	  This driver can also be built as a module.  If so, the module
+	  will be called lm77.
+
 config SENSORS_LM78
 	tristate "National Semiconductor LM78 and compatibles"
 	depends on I2C && EXPERIMENTAL
@@ -140,7 +175,8 @@ config SENSORS_LM90
 	select I2C_SENSOR
 	help
 	  If you say yes here you get support for National Semiconductor LM90,
-	  LM89 and LM99, and Analog Devices ADM1032 sensor chips.
+	  LM86, LM89 and LM99, Analog Devices ADM1032 and Maxim MAX6657 and
+	  MAX6658 sensor chips.
 
 	  This driver can also be built as a module.  If so, the module
 	  will be called lm90.
@@ -157,7 +193,7 @@ config SENSORS_MAX1619
 
 config SENSORS_VIA686A
 	tristate "VIA686A"
-	depends on I2C && EXPERIMENTAL
+	depends on I2C && PCI && EXPERIMENTAL
 	select I2C_SENSOR
 	select I2C_ISA
 	help
diff --git a/drivers/i2c/chips/Makefile b/drivers/i2c/chips/Makefile
index 6e85e3f62..f024e71a5 100644
--- a/drivers/i2c/chips/Makefile
+++ b/drivers/i2c/chips/Makefile
@@ -8,12 +8,15 @@ obj-$(CONFIG_SENSORS_W83627HF)	+= w83627hf.o
 obj-$(CONFIG_SENSORS_W83781D)	+= w83781d.o
 
 obj-$(CONFIG_SENSORS_ADM1021)	+= adm1021.o
+obj-$(CONFIG_SENSORS_ADM1025)	+= adm1025.o
+obj-$(CONFIG_SENSORS_ADM1031)	+= adm1031.o
 obj-$(CONFIG_SENSORS_DS1621)	+= ds1621.o
 obj-$(CONFIG_SENSORS_EEPROM)	+= eeprom.o
 obj-$(CONFIG_SENSORS_FSCHER)	+= fscher.o
 obj-$(CONFIG_SENSORS_GL518SM)	+= gl518sm.o
 obj-$(CONFIG_SENSORS_IT87)	+= it87.o
 obj-$(CONFIG_SENSORS_LM75)	+= lm75.o
+obj-$(CONFIG_SENSORS_LM77)	+= lm77.o
 obj-$(CONFIG_SENSORS_LM78)	+= lm78.o
 obj-$(CONFIG_SENSORS_LM80)	+= lm80.o
 obj-$(CONFIG_SENSORS_LM83)	+= lm83.o
diff --git a/drivers/i2c/chips/asb100.c b/drivers/i2c/chips/asb100.c
index f93b6f676..a416e4ee5 100644
--- a/drivers/i2c/chips/asb100.c
+++ b/drivers/i2c/chips/asb100.c
@@ -272,7 +272,7 @@ static ssize_t \
 	return show_in(dev, buf, 0x##offset); \
 } \
 static DEVICE_ATTR(in##offset##_input, S_IRUGO, \
-		show_in##offset, NULL) \
+		show_in##offset, NULL); \
 static ssize_t \
 	show_in##offset##_min (struct device *dev, char *buf) \
 { \
@@ -294,17 +294,17 @@ static ssize_t set_in##offset##_max (struct device *dev, \
 	return set_in_max(dev, buf, count, 0x##offset); \
 } \
 static DEVICE_ATTR(in##offset##_min, S_IRUGO | S_IWUSR, \
-		show_in##offset##_min, set_in##offset##_min) \
+		show_in##offset##_min, set_in##offset##_min); \
 static DEVICE_ATTR(in##offset##_max, S_IRUGO | S_IWUSR, \
-		show_in##offset##_max, set_in##offset##_max)
+		show_in##offset##_max, set_in##offset##_max);
 
-sysfs_in(0)
-sysfs_in(1)
-sysfs_in(2)
-sysfs_in(3)
-sysfs_in(4)
-sysfs_in(5)
-sysfs_in(6)
+sysfs_in(0);
+sysfs_in(1);
+sysfs_in(2);
+sysfs_in(3);
+sysfs_in(4);
+sysfs_in(5);
+sysfs_in(6);
 
 #define device_create_file_in(client, offset) do { \
 	device_create_file(&client->dev, &dev_attr_in##offset##_input); \
@@ -410,15 +410,15 @@ static ssize_t set_fan##offset##_div(struct device *dev, const char *buf, \
 	return set_fan_div(dev, buf, count, offset - 1); \
 } \
 static DEVICE_ATTR(fan##offset##_input, S_IRUGO, \
-		show_fan##offset, NULL) \
+		show_fan##offset, NULL); \
 static DEVICE_ATTR(fan##offset##_min, S_IRUGO | S_IWUSR, \
-		show_fan##offset##_min, set_fan##offset##_min) \
+		show_fan##offset##_min, set_fan##offset##_min); \
 static DEVICE_ATTR(fan##offset##_div, S_IRUGO | S_IWUSR, \
-		show_fan##offset##_div, set_fan##offset##_div)
+		show_fan##offset##_div, set_fan##offset##_div);
 
-sysfs_fan(1)
-sysfs_fan(2)
-sysfs_fan(3)
+sysfs_fan(1);
+sysfs_fan(2);
+sysfs_fan(3);
 
 #define device_create_file_fan(client, offset) do { \
 	device_create_file(&client->dev, &dev_attr_fan##offset##_input); \
@@ -449,9 +449,9 @@ static ssize_t show_##reg(struct device *dev, char *buf, int nr) \
 	return sprintf_temp_from_reg(data->reg[nr], buf, nr); \
 }
 
-show_temp_reg(temp)
-show_temp_reg(temp_max)
-show_temp_reg(temp_hyst)
+show_temp_reg(temp);
+show_temp_reg(temp_max);
+show_temp_reg(temp_hyst);
 
 #define set_temp_reg(REG, reg) \
 static ssize_t set_##reg(struct device *dev, const char *buf, \
@@ -473,15 +473,15 @@ static ssize_t set_##reg(struct device *dev, const char *buf, \
 	return count; \
 }
 
-set_temp_reg(MAX, temp_max)
-set_temp_reg(HYST, temp_hyst)
+set_temp_reg(MAX, temp_max);
+set_temp_reg(HYST, temp_hyst);
 
 #define sysfs_temp(num) \
 static ssize_t show_temp##num(struct device *dev, char *buf) \
 { \
 	return show_temp(dev, buf, num-1); \
 } \
-static DEVICE_ATTR(temp##num##_input, S_IRUGO, show_temp##num, NULL) \
+static DEVICE_ATTR(temp##num##_input, S_IRUGO, show_temp##num, NULL); \
 static ssize_t show_temp_max##num(struct device *dev, char *buf) \
 { \
 	return show_temp_max(dev, buf, num-1); \
@@ -492,7 +492,7 @@ static ssize_t set_temp_max##num(struct device *dev, const char *buf, \
 	return set_temp_max(dev, buf, count, num-1); \
 } \
 static DEVICE_ATTR(temp##num##_max, S_IRUGO | S_IWUSR, \
-		show_temp_max##num, set_temp_max##num) \
+		show_temp_max##num, set_temp_max##num); \
 static ssize_t show_temp_hyst##num(struct device *dev, char *buf) \
 { \
 	return show_temp_hyst(dev, buf, num-1); \
@@ -503,12 +503,12 @@ static ssize_t set_temp_hyst##num(struct device *dev, const char *buf, \
 	return set_temp_hyst(dev, buf, count, num-1); \
 } \
 static DEVICE_ATTR(temp##num##_max_hyst, S_IRUGO | S_IWUSR, \
-		show_temp_hyst##num, set_temp_hyst##num)
+		show_temp_hyst##num, set_temp_hyst##num);
 
-sysfs_temp(1)
-sysfs_temp(2)
-sysfs_temp(3)
-sysfs_temp(4)
+sysfs_temp(1);
+sysfs_temp(2);
+sysfs_temp(3);
+sysfs_temp(4);
 
 /* VID */
 #define device_create_file_temp(client, num) do { \
@@ -523,7 +523,7 @@ static ssize_t show_vid(struct device *dev, char *buf)
 	return sprintf(buf, "%d\n", vid_from_reg(data->vid, data->vrm));
 }
 
-static DEVICE_ATTR(in0_ref, S_IRUGO, show_vid, NULL)
+static DEVICE_ATTR(in0_ref, S_IRUGO, show_vid, NULL);
 #define device_create_file_vid(client) \
 device_create_file(&client->dev, &dev_attr_in0_ref)
 
@@ -544,7 +544,7 @@ static ssize_t set_vrm(struct device *dev, const char *buf, size_t count)
 }
 
 /* Alarms */
-static DEVICE_ATTR(vrm, S_IRUGO | S_IWUSR, show_vrm, set_vrm)
+static DEVICE_ATTR(vrm, S_IRUGO | S_IWUSR, show_vrm, set_vrm);
 #define device_create_file_vrm(client) \
 device_create_file(&client->dev, &dev_attr_vrm);
 
@@ -554,7 +554,7 @@ static ssize_t show_alarms(struct device *dev, char *buf)
 	return sprintf(buf, "%d\n", ALARMS_FROM_REG(data->alarms));
 }
 
-static DEVICE_ATTR(alarms, S_IRUGO, show_alarms, NULL)
+static DEVICE_ATTR(alarms, S_IRUGO, show_alarms, NULL);
 #define device_create_file_alarms(client) \
 device_create_file(&client->dev, &dev_attr_alarms)
 
@@ -594,9 +594,9 @@ static ssize_t set_pwm_enable1(struct device *dev, const char *buf,
 	return count;
 }
 
-static DEVICE_ATTR(fan1_pwm, S_IRUGO | S_IWUSR, show_pwm1, set_pwm1)
+static DEVICE_ATTR(fan1_pwm, S_IRUGO | S_IWUSR, show_pwm1, set_pwm1);
 static DEVICE_ATTR(fan1_pwm_enable, S_IRUGO | S_IWUSR,
-		show_pwm_enable1, set_pwm_enable1)
+		show_pwm_enable1, set_pwm_enable1);
 #define device_create_file_pwm1(client) do { \
 	device_create_file(&new_client->dev, &dev_attr_fan1_pwm); \
 	device_create_file(&new_client->dev, &dev_attr_fan1_pwm_enable); \
diff --git a/drivers/i2c/chips/it87.c b/drivers/i2c/chips/it87.c
index 061a0b800..ef6562987 100644
--- a/drivers/i2c/chips/it87.c
+++ b/drivers/i2c/chips/it87.c
@@ -128,15 +128,15 @@ static int reset;
 
 #define IT87_REG_FAN(nr)       (0x0d + (nr))
 #define IT87_REG_FAN_MIN(nr)   (0x10 + (nr))
-#define IT87_REG_FAN_CTRL      0x13
+#define IT87_REG_FAN_MAIN_CTRL 0x13
 
 #define IT87_REG_VIN(nr)       (0x20 + (nr))
 #define IT87_REG_TEMP(nr)      (0x29 + (nr))
 
 #define IT87_REG_VIN_MAX(nr)   (0x30 + (nr) * 2)
 #define IT87_REG_VIN_MIN(nr)   (0x31 + (nr) * 2)
-#define IT87_REG_TEMP_HIGH(nr) (0x40 + ((nr) * 2))
-#define IT87_REG_TEMP_LOW(nr)  (0x41 + ((nr) * 2))
+#define IT87_REG_TEMP_HIGH(nr) (0x40 + (nr) * 2)
+#define IT87_REG_TEMP_LOW(nr)  (0x41 + (nr) * 2)
 
 #define IT87_REG_I2C_ADDR      0x48
 
@@ -145,8 +145,8 @@ static int reset;
 
 #define IT87_REG_CHIPID        0x58
 
-#define IN_TO_REG(val)  (SENSORS_LIMIT((((val) * 10 + 8)/16),0,255))
-#define IN_FROM_REG(val) (((val) *  16) / 10)
+#define IN_TO_REG(val)  (SENSORS_LIMIT((((val) + 8)/16),0,255))
+#define IN_FROM_REG(val) ((val) * 16)
 
 static inline u8 FAN_TO_REG(long rpm, int div)
 {
@@ -159,9 +159,9 @@ static inline u8 FAN_TO_REG(long rpm, int div)
 
 #define FAN_FROM_REG(val,div) ((val)==0?-1:(val)==255?0:1350000/((val)*(div)))
 
-#define TEMP_TO_REG(val) (SENSORS_LIMIT(((val)<0?(((val)-5)/10):\
-					((val)+5)/10),0,255))
-#define TEMP_FROM_REG(val) (((val)>0x80?(val)-0x100:(val))*10)
+#define TEMP_TO_REG(val) (SENSORS_LIMIT(((val)<0?(((val)-500)/1000):\
+					((val)+500)/1000),-128,127))
+#define TEMP_FROM_REG(val) (((val)>0x80?(val)-0x100:(val))*1000)
 
 #define VID_FROM_REG(val) ((val)==0x1f?0:(val)>=0x10?510-(val)*10:\
 				205-(val)*5)
@@ -170,7 +170,7 @@ static inline u8 FAN_TO_REG(long rpm, int div)
 static int DIV_TO_REG(int val)
 {
 	int answer = 0;
-	while ((val >>= 1))
+	while ((val >>= 1) != 0)
 		answer++;
 	return answer;
 }
@@ -231,19 +231,19 @@ static int it87_id = 0;
 static ssize_t show_in(struct device *dev, char *buf, int nr)
 {
 	struct it87_data *data = it87_update_device(dev);
-	return sprintf(buf, "%d\n", IN_FROM_REG(data->in[nr])*10 );
+	return sprintf(buf, "%d\n", IN_FROM_REG(data->in[nr]));
 }
 
 static ssize_t show_in_min(struct device *dev, char *buf, int nr)
 {
 	struct it87_data *data = it87_update_device(dev);
-	return sprintf(buf, "%d\n", IN_FROM_REG(data->in_min[nr])*10 );
+	return sprintf(buf, "%d\n", IN_FROM_REG(data->in_min[nr]));
 }
 
 static ssize_t show_in_max(struct device *dev, char *buf, int nr)
 {
 	struct it87_data *data = it87_update_device(dev);
-	return sprintf(buf, "%d\n", IN_FROM_REG(data->in_max[nr])*10 );
+	return sprintf(buf, "%d\n", IN_FROM_REG(data->in_max[nr]));
 }
 
 static ssize_t set_in_min(struct device *dev, const char *buf, 
@@ -251,7 +251,7 @@ static ssize_t set_in_min(struct device *dev, const char *buf,
 {
 	struct i2c_client *client = to_i2c_client(dev);
 	struct it87_data *data = i2c_get_clientdata(client);
-	unsigned long val = simple_strtoul(buf, NULL, 10)/10;
+	unsigned long val = simple_strtoul(buf, NULL, 10);
 	data->in_min[nr] = IN_TO_REG(val);
 	it87_write_value(client, IT87_REG_VIN_MIN(nr), 
 			data->in_min[nr]);
@@ -262,7 +262,7 @@ static ssize_t set_in_max(struct device *dev, const char *buf,
 {
 	struct i2c_client *client = to_i2c_client(dev);
 	struct it87_data *data = i2c_get_clientdata(client);
-	unsigned long val = simple_strtoul(buf, NULL, 10)/10;
+	unsigned long val = simple_strtoul(buf, NULL, 10);
 	data->in_max[nr] = IN_TO_REG(val);
 	it87_write_value(client, IT87_REG_VIN_MAX(nr), 
 			data->in_max[nr]);
@@ -275,7 +275,7 @@ static ssize_t							\
 {								\
 	return show_in(dev, buf, 0x##offset);			\
 }								\
-static DEVICE_ATTR(in##offset##_input, S_IRUGO, show_in##offset, NULL)
+static DEVICE_ATTR(in##offset##_input, S_IRUGO, show_in##offset, NULL);
 
 #define limit_in_offset(offset)					\
 static ssize_t							\
@@ -299,9 +299,9 @@ static ssize_t set_in##offset##_max (struct device *dev,	\
 	return set_in_max(dev, buf, count, 0x##offset);		\
 }								\
 static DEVICE_ATTR(in##offset##_min, S_IRUGO | S_IWUSR, 	\
-		show_in##offset##_min, set_in##offset##_min)	\
+		show_in##offset##_min, set_in##offset##_min);	\
 static DEVICE_ATTR(in##offset##_max, S_IRUGO | S_IWUSR, 	\
-		show_in##offset##_max, set_in##offset##_max)
+		show_in##offset##_max, set_in##offset##_max);
 
 show_in_offset(0);
 limit_in_offset(0);
@@ -325,24 +325,24 @@ show_in_offset(8);
 static ssize_t show_temp(struct device *dev, char *buf, int nr)
 {
 	struct it87_data *data = it87_update_device(dev);
-	return sprintf(buf, "%d\n", TEMP_FROM_REG(data->temp[nr])*100 );
+	return sprintf(buf, "%d\n", TEMP_FROM_REG(data->temp[nr]));
 }
 static ssize_t show_temp_max(struct device *dev, char *buf, int nr)
 {
 	struct it87_data *data = it87_update_device(dev);
-	return sprintf(buf, "%d\n", TEMP_FROM_REG(data->temp_high[nr])*100);
+	return sprintf(buf, "%d\n", TEMP_FROM_REG(data->temp_high[nr]));
 }
 static ssize_t show_temp_min(struct device *dev, char *buf, int nr)
 {
 	struct it87_data *data = it87_update_device(dev);
-	return sprintf(buf, "%d\n", TEMP_FROM_REG(data->temp_low[nr])*100);
+	return sprintf(buf, "%d\n", TEMP_FROM_REG(data->temp_low[nr]));
 }
 static ssize_t set_temp_max(struct device *dev, const char *buf, 
 		size_t count, int nr)
 {
 	struct i2c_client *client = to_i2c_client(dev);
 	struct it87_data *data = i2c_get_clientdata(client);
-	int val = simple_strtol(buf, NULL, 10)/100;
+	int val = simple_strtol(buf, NULL, 10);
 	data->temp_high[nr] = TEMP_TO_REG(val);
 	it87_write_value(client, IT87_REG_TEMP_HIGH(nr), data->temp_high[nr]);
 	return count;
@@ -352,7 +352,7 @@ static ssize_t set_temp_min(struct device *dev, const char *buf,
 {
 	struct i2c_client *client = to_i2c_client(dev);
 	struct it87_data *data = i2c_get_clientdata(client);
-	int val = simple_strtol(buf, NULL, 10)/100;
+	int val = simple_strtol(buf, NULL, 10);
 	data->temp_low[nr] = TEMP_TO_REG(val);
 	it87_write_value(client, IT87_REG_TEMP_LOW(nr), data->temp_low[nr]);
 	return count;
@@ -382,11 +382,11 @@ static ssize_t set_temp_##offset##_min (struct device *dev, 		\
 {									\
 	return set_temp_min(dev, buf, count, 0x##offset - 1);		\
 }									\
-static DEVICE_ATTR(temp##offset##_input, S_IRUGO, show_temp_##offset, NULL) \
+static DEVICE_ATTR(temp##offset##_input, S_IRUGO, show_temp_##offset, NULL); \
 static DEVICE_ATTR(temp##offset##_max, S_IRUGO | S_IWUSR, 		\
-		show_temp_##offset##_max, set_temp_##offset##_max) 	\
+		show_temp_##offset##_max, set_temp_##offset##_max); 	\
 static DEVICE_ATTR(temp##offset##_min, S_IRUGO | S_IWUSR, 		\
-		show_temp_##offset##_min, set_temp_##offset##_min)	
+		show_temp_##offset##_min, set_temp_##offset##_min);	
 
 show_temp_offset(1);
 show_temp_offset(2);
@@ -430,8 +430,8 @@ static ssize_t set_sensor_##offset (struct device *dev, 		\
 {									\
 	return set_sensor(dev, buf, count, 0x##offset - 1);		\
 }									\
-static DEVICE_ATTR(temp##offset##_type, S_IRUGO | S_IWUSR,	 		\
-		show_sensor_##offset, set_sensor_##offset)
+static DEVICE_ATTR(temp##offset##_type, S_IRUGO | S_IWUSR, 		\
+		show_sensor_##offset, set_sensor_##offset);
 
 show_sensor_offset(1);
 show_sensor_offset(2);
@@ -525,11 +525,11 @@ static ssize_t set_fan_##offset##_div (struct device *dev, 		\
 {									\
 	return set_fan_div(dev, buf, count, 0x##offset - 1);		\
 }									\
-static DEVICE_ATTR(fan##offset##_input, S_IRUGO, show_fan_##offset, NULL) \
+static DEVICE_ATTR(fan##offset##_input, S_IRUGO, show_fan_##offset, NULL); \
 static DEVICE_ATTR(fan##offset##_min, S_IRUGO | S_IWUSR, 		\
-		show_fan_##offset##_min, set_fan_##offset##_min) 	\
+		show_fan_##offset##_min, set_fan_##offset##_min); 	\
 static DEVICE_ATTR(fan##offset##_div, S_IRUGO | S_IWUSR, 		\
-		show_fan_##offset##_div, set_fan_##offset##_div)
+		show_fan_##offset##_div, set_fan_##offset##_div);
 
 show_fan_offset(1);
 show_fan_offset(2);
@@ -773,9 +773,7 @@ static int it87_detach_client(struct i2c_client *client)
    We don't want to lock the whole ISA bus, so we lock each client
    separately.
    We ignore the IT87 BUSY flag at this moment - it could lead to deadlocks,
-   would slow down the IT87 access and should not be necessary. 
-   There are some ugly typecasts here, but the good new is - they should
-   nowhere else be necessary! */
+   would slow down the IT87 access and should not be necessary. */
 static int it87_read_value(struct i2c_client *client, u8 reg)
 {
 	struct it87_data *data = i2c_get_clientdata(client);
@@ -795,9 +793,7 @@ static int it87_read_value(struct i2c_client *client, u8 reg)
    We don't want to lock the whole ISA bus, so we lock each client
    separately.
    We ignore the IT87 BUSY flag at this moment - it could lead to deadlocks,
-   would slow down the IT87 access and should not be necessary. 
-   There are some ugly typecasts here, but the good new is - they should
-   nowhere else be necessary! */
+   would slow down the IT87 access and should not be necessary. */
 static int it87_write_value(struct i2c_client *client, u8 reg, u8 value)
 {
 	struct it87_data *data = i2c_get_clientdata(client);
@@ -840,11 +836,11 @@ static void it87_init_client(struct i2c_client *client, struct it87_data *data)
 	}
 
 	/* Check if tachometers are reset manually or by some reason */
-	tmp = it87_read_value(client, IT87_REG_FAN_CTRL);
+	tmp = it87_read_value(client, IT87_REG_FAN_MAIN_CTRL);
 	if ((tmp & 0x70) == 0) {
 		/* Enable all fan tachometers */
 		tmp = (tmp & 0x8f) | 0x70;
-		it87_write_value(client, IT87_REG_FAN_CTRL, tmp);
+		it87_write_value(client, IT87_REG_FAN_MAIN_CTRL, tmp);
 	}
 
 	/* Start monitoring */
diff --git a/drivers/i2c/chips/lm75.c b/drivers/i2c/chips/lm75.c
index e431db905..3752a2706 100644
--- a/drivers/i2c/chips/lm75.c
+++ b/drivers/i2c/chips/lm75.c
@@ -113,7 +113,7 @@ static int lm75_attach_adapter(struct i2c_adapter *adapter)
 /* This function is called by i2c_detect */
 static int lm75_detect(struct i2c_adapter *adapter, int address, int kind)
 {
-	int i, cur, conf, hyst, os;
+	int i;
 	struct i2c_client *new_client;
 	struct lm75_data *data;
 	int err = 0;
@@ -149,16 +149,41 @@ static int lm75_detect(struct i2c_adapter *adapter, int address, int kind)
 	new_client->driver = &lm75_driver;
 	new_client->flags = 0;
 
-	/* Now, we do the remaining detection. It is lousy. */
+	/* Now, we do the remaining detection. There is no identification-
+	   dedicated register so we have to rely on several tricks:
+	   unused bits, registers cycling over 8-address boundaries,
+	   addresses 0x04-0x07 returning the last read value.
+	   The cycling+unused addresses combination is not tested,
+	   since it would significantly slow the detection down and would
+	   hardly add any value. */
 	if (kind < 0) {
+		int cur, conf, hyst, os;
+
+		/* Unused addresses */
 		cur = i2c_smbus_read_word_data(new_client, 0);
 		conf = i2c_smbus_read_byte_data(new_client, 1);
 		hyst = i2c_smbus_read_word_data(new_client, 2);
+		if (i2c_smbus_read_word_data(new_client, 4) != hyst
+		 || i2c_smbus_read_word_data(new_client, 5) != hyst
+		 || i2c_smbus_read_word_data(new_client, 6) != hyst
+		 || i2c_smbus_read_word_data(new_client, 7) != hyst)
+		 	goto exit_free;
 		os = i2c_smbus_read_word_data(new_client, 3);
-		for (i = 0; i <= 0x1f; i++)
-			if ((i2c_smbus_read_byte_data(new_client, i * 8 + 1) != conf) ||
-			    (i2c_smbus_read_word_data(new_client, i * 8 + 2) != hyst) ||
-			    (i2c_smbus_read_word_data(new_client, i * 8 + 3) != os))
+		if (i2c_smbus_read_word_data(new_client, 4) != os
+		 || i2c_smbus_read_word_data(new_client, 5) != os
+		 || i2c_smbus_read_word_data(new_client, 6) != os
+		 || i2c_smbus_read_word_data(new_client, 7) != os)
+		 	goto exit_free;
+
+		/* Unused bits */
+		if (conf & 0xe0)
+		 	goto exit_free;
+
+		/* Addresses cycling */
+		for (i = 8; i < 0xff; i += 8)
+			if (i2c_smbus_read_byte_data(new_client, i + 1) != conf
+			 || i2c_smbus_read_word_data(new_client, i + 2) != hyst
+			 || i2c_smbus_read_word_data(new_client, i + 3) != os)
 				goto exit_free;
 	}
 
diff --git a/drivers/i2c/chips/lm78.c b/drivers/i2c/chips/lm78.c
index 74a1ca76c..40385ffd8 100644
--- a/drivers/i2c/chips/lm78.c
+++ b/drivers/i2c/chips/lm78.c
@@ -123,55 +123,6 @@ static inline u8 DIV_TO_REG(int val)
 }
 #define DIV_FROM_REG(val) (1 << (val))
 
-/* Initial limits. To keep them sane, we use the 'standard' translation as
-   specified in the LM78 sheet. Use the config file to set better limits. */
-#define LM78_INIT_IN_0(vid) ((vid)==3500 ? 2800 : (vid))
-#define LM78_INIT_IN_1(vid) ((vid)==3500 ? 2800 : (vid))
-#define LM78_INIT_IN_2 3300
-#define LM78_INIT_IN_3 (((5000)   * 100)/168)
-#define LM78_INIT_IN_4 (((12000)  * 10)/38)
-#define LM78_INIT_IN_5 (((-12000) * -604)/2100)
-#define LM78_INIT_IN_6 (((-5000)  * -604)/909)
-
-#define LM78_INIT_IN_PERCENTAGE 10
-
-#define LM78_INIT_IN_MIN_0(vid) (LM78_INIT_IN_0(vid) - \
-	LM78_INIT_IN_0(vid) * LM78_INIT_IN_PERCENTAGE / 100)
-#define LM78_INIT_IN_MAX_0(vid) (LM78_INIT_IN_0(vid) + \
-	LM78_INIT_IN_0(vid) * LM78_INIT_IN_PERCENTAGE / 100)
-#define LM78_INIT_IN_MIN_1(vid) (LM78_INIT_IN_1(vid) - \
-	LM78_INIT_IN_1(vid) * LM78_INIT_IN_PERCENTAGE / 100)
-#define LM78_INIT_IN_MAX_1(vid) (LM78_INIT_IN_1(vid) + \
-	LM78_INIT_IN_1(vid) * LM78_INIT_IN_PERCENTAGE / 100)
-
-#define LM78_INIT_IN_MIN_2 \
-        (LM78_INIT_IN_2 - LM78_INIT_IN_2 * LM78_INIT_IN_PERCENTAGE / 100)
-#define LM78_INIT_IN_MAX_2 \
-        (LM78_INIT_IN_2 + LM78_INIT_IN_2 * LM78_INIT_IN_PERCENTAGE / 100)
-#define LM78_INIT_IN_MIN_3 \
-        (LM78_INIT_IN_3 - LM78_INIT_IN_3 * LM78_INIT_IN_PERCENTAGE / 100)
-#define LM78_INIT_IN_MAX_3 \
-        (LM78_INIT_IN_3 + LM78_INIT_IN_3 * LM78_INIT_IN_PERCENTAGE / 100)
-#define LM78_INIT_IN_MIN_4 \
-        (LM78_INIT_IN_4 - LM78_INIT_IN_4 * LM78_INIT_IN_PERCENTAGE / 100)
-#define LM78_INIT_IN_MAX_4 \
-        (LM78_INIT_IN_4 + LM78_INIT_IN_4 * LM78_INIT_IN_PERCENTAGE / 100)
-#define LM78_INIT_IN_MIN_5 \
-        (LM78_INIT_IN_5 - LM78_INIT_IN_5 * LM78_INIT_IN_PERCENTAGE / 100)
-#define LM78_INIT_IN_MAX_5 \
-        (LM78_INIT_IN_5 + LM78_INIT_IN_5 * LM78_INIT_IN_PERCENTAGE / 100)
-#define LM78_INIT_IN_MIN_6 \
-        (LM78_INIT_IN_6 - LM78_INIT_IN_6 * LM78_INIT_IN_PERCENTAGE / 100)
-#define LM78_INIT_IN_MAX_6 \
-        (LM78_INIT_IN_6 + LM78_INIT_IN_6 * LM78_INIT_IN_PERCENTAGE / 100)
-
-#define LM78_INIT_FAN_MIN_1 3000
-#define LM78_INIT_FAN_MIN_2 3000
-#define LM78_INIT_FAN_MIN_3 3000
-
-#define LM78_INIT_TEMP_OVER 60000
-#define LM78_INIT_TEMP_HYST 50000
-
 /* There are some complications in a module like this. First off, LM78 chips
    may be both present on the SMBus and the ISA bus, and we have to handle
    those cases separately at some places. Second, there might be several
@@ -281,7 +232,7 @@ static ssize_t							\
 	return show_in(dev, buf, 0x##offset);			\
 }								\
 static DEVICE_ATTR(in##offset##_input, S_IRUGO, 		\
-		show_in##offset, NULL)				\
+		show_in##offset, NULL);				\
 static ssize_t							\
 	show_in##offset##_min (struct device *dev, char *buf)   \
 {								\
@@ -303,9 +254,9 @@ static ssize_t set_in##offset##_max (struct device *dev,	\
 	return set_in_max(dev, buf, count, 0x##offset);		\
 }								\
 static DEVICE_ATTR(in##offset##_min, S_IRUGO | S_IWUSR,		\
-		show_in##offset##_min, set_in##offset##_min)    \
+		show_in##offset##_min, set_in##offset##_min);	\
 static DEVICE_ATTR(in##offset##_max, S_IRUGO | S_IWUSR,		\
-		show_in##offset##_max, set_in##offset##_max)
+		show_in##offset##_max, set_in##offset##_max);
 
 show_in_offset(0);
 show_in_offset(1);
@@ -354,11 +305,11 @@ static ssize_t set_temp_hyst(struct device *dev, const char *buf, size_t count)
 	return count;
 }
 
-static DEVICE_ATTR(temp1_input, S_IRUGO, show_temp, NULL)
+static DEVICE_ATTR(temp1_input, S_IRUGO, show_temp, NULL);
 static DEVICE_ATTR(temp1_max, S_IRUGO | S_IWUSR,
-		show_temp_over, set_temp_over)
+		show_temp_over, set_temp_over);
 static DEVICE_ATTR(temp1_max_hyst, S_IRUGO | S_IWUSR,
-		show_temp_hyst, set_temp_hyst)
+		show_temp_hyst, set_temp_hyst);
 
 /* 3 Fans */
 static ssize_t show_fan(struct device *dev, char *buf, int nr)
@@ -439,9 +390,9 @@ static ssize_t set_fan_##offset##_min (struct device *dev,		\
 {									\
 	return set_fan_min(dev, buf, count, 0x##offset - 1);		\
 }									\
-static DEVICE_ATTR(fan##offset##_input, S_IRUGO, show_fan_##offset, NULL) \
+static DEVICE_ATTR(fan##offset##_input, S_IRUGO, show_fan_##offset, NULL);\
 static DEVICE_ATTR(fan##offset##_min, S_IRUGO | S_IWUSR,		\
-		show_fan_##offset##_min, set_fan_##offset##_min)
+		show_fan_##offset##_min, set_fan_##offset##_min);
 
 static ssize_t set_fan_1_div(struct device *dev, const char *buf,
 		size_t count)
@@ -461,10 +412,10 @@ show_fan_offset(3);
 
 /* Fan 3 divisor is locked in H/W */
 static DEVICE_ATTR(fan1_div, S_IRUGO | S_IWUSR,
-		show_fan_1_div, set_fan_1_div)
+		show_fan_1_div, set_fan_1_div);
 static DEVICE_ATTR(fan2_div, S_IRUGO | S_IWUSR,
-		show_fan_2_div, set_fan_2_div)
-static DEVICE_ATTR(fan3_div, S_IRUGO, show_fan_3_div, NULL)
+		show_fan_2_div, set_fan_2_div);
+static DEVICE_ATTR(fan3_div, S_IRUGO, show_fan_3_div, NULL);
 
 /* VID */
 static ssize_t show_vid(struct device *dev, char *buf)
@@ -756,45 +707,6 @@ static void lm78_init_client(struct i2c_client *client)
 		vid |= 0x10;
 	vid = VID_FROM_REG(vid);
 
-	lm78_write_value(client, LM78_REG_IN_MIN(0),
-			 IN_TO_REG(LM78_INIT_IN_MIN_0(vid)));
-	lm78_write_value(client, LM78_REG_IN_MAX(0),
-			 IN_TO_REG(LM78_INIT_IN_MAX_0(vid)));
-	lm78_write_value(client, LM78_REG_IN_MIN(1),
-			 IN_TO_REG(LM78_INIT_IN_MIN_1(vid)));
-	lm78_write_value(client, LM78_REG_IN_MAX(1),
-			 IN_TO_REG(LM78_INIT_IN_MAX_1(vid)));
-	lm78_write_value(client, LM78_REG_IN_MIN(2),
-			 IN_TO_REG(LM78_INIT_IN_MIN_2));
-	lm78_write_value(client, LM78_REG_IN_MAX(2),
-			 IN_TO_REG(LM78_INIT_IN_MAX_2));
-	lm78_write_value(client, LM78_REG_IN_MIN(3),
-			 IN_TO_REG(LM78_INIT_IN_MIN_3));
-	lm78_write_value(client, LM78_REG_IN_MAX(3),
-			 IN_TO_REG(LM78_INIT_IN_MAX_3));
-	lm78_write_value(client, LM78_REG_IN_MIN(4),
-			 IN_TO_REG(LM78_INIT_IN_MIN_4));
-	lm78_write_value(client, LM78_REG_IN_MAX(4),
-			 IN_TO_REG(LM78_INIT_IN_MAX_4));
-	lm78_write_value(client, LM78_REG_IN_MIN(5),
-			 IN_TO_REG(LM78_INIT_IN_MIN_5));
-	lm78_write_value(client, LM78_REG_IN_MAX(5),
-			 IN_TO_REG(LM78_INIT_IN_MAX_5));
-	lm78_write_value(client, LM78_REG_IN_MIN(6),
-			 IN_TO_REG(LM78_INIT_IN_MIN_6));
-	lm78_write_value(client, LM78_REG_IN_MAX(6),
-			 IN_TO_REG(LM78_INIT_IN_MAX_6));
-	lm78_write_value(client, LM78_REG_FAN_MIN(0),
-			 FAN_TO_REG(LM78_INIT_FAN_MIN_1, 2));
-	lm78_write_value(client, LM78_REG_FAN_MIN(1),
-			 FAN_TO_REG(LM78_INIT_FAN_MIN_2, 2));
-	lm78_write_value(client, LM78_REG_FAN_MIN(2),
-			 FAN_TO_REG(LM78_INIT_FAN_MIN_3, 2));
-	lm78_write_value(client, LM78_REG_TEMP_OVER,
-			 TEMP_TO_REG(LM78_INIT_TEMP_OVER));
-	lm78_write_value(client, LM78_REG_TEMP_HYST,
-			 TEMP_TO_REG(LM78_INIT_TEMP_HYST));
-
 	/* Start monitoring */
 	lm78_write_value(client, LM78_REG_CONFIG,
 			 (lm78_read_value(client, LM78_REG_CONFIG) & 0xf7)
diff --git a/drivers/i2c/chips/lm85.c b/drivers/i2c/chips/lm85.c
index 795852aa6..11f850431 100644
--- a/drivers/i2c/chips/lm85.c
+++ b/drivers/i2c/chips/lm85.c
@@ -451,9 +451,9 @@ static ssize_t set_fan_##offset##_min (struct device *dev, 		\
 {									\
 	return set_fan_min(dev, buf, count, 0x##offset - 1);		\
 }									\
-static DEVICE_ATTR(fan##offset##_input, S_IRUGO, show_fan_##offset, NULL) \
+static DEVICE_ATTR(fan##offset##_input, S_IRUGO, show_fan_##offset, NULL);\
 static DEVICE_ATTR(fan##offset##_min, S_IRUGO | S_IWUSR, 		\
-		show_fan_##offset##_min, set_fan_##offset##_min)
+		show_fan_##offset##_min, set_fan_##offset##_min);
 
 show_fan_offset(1);
 show_fan_offset(2);
@@ -468,7 +468,7 @@ static ssize_t show_vid_reg(struct device *dev, char *buf)
 	return sprintf(buf, "%ld\n", (long) vid_from_reg(data->vid, data->vrm));
 }
 
-static DEVICE_ATTR(in0_ref, S_IRUGO, show_vid_reg, NULL)
+static DEVICE_ATTR(in0_ref, S_IRUGO, show_vid_reg, NULL);
 
 static ssize_t show_vrm_reg(struct device *dev, char *buf)
 {
@@ -487,7 +487,7 @@ static ssize_t store_vrm_reg(struct device *dev, const char *buf, size_t count)
 	return count;
 }
 
-static DEVICE_ATTR(vrm, S_IRUGO | S_IWUSR, show_vrm_reg, store_vrm_reg)
+static DEVICE_ATTR(vrm, S_IRUGO | S_IWUSR, show_vrm_reg, store_vrm_reg);
 
 static ssize_t show_alarms_reg(struct device *dev, char *buf)
 {
@@ -495,7 +495,7 @@ static ssize_t show_alarms_reg(struct device *dev, char *buf)
 	return sprintf(buf, "%ld\n", (long) ALARMS_FROM_REG(data->alarms));
 }
 
-static DEVICE_ATTR(alarms, S_IRUGO, show_alarms_reg, NULL)
+static DEVICE_ATTR(alarms, S_IRUGO, show_alarms_reg, NULL);
 
 /* pwm */
 
@@ -542,8 +542,8 @@ static ssize_t show_pwm_enable##offset (struct device *dev, char *buf)	\
 	return show_pwm_enable(dev, buf, 0x##offset - 1);			\
 }									\
 static DEVICE_ATTR(fan##offset##_pwm, S_IRUGO | S_IWUSR, 			\
-		show_pwm_##offset, set_pwm_##offset)			\
-static DEVICE_ATTR(fan##offset##_pwm_enable, S_IRUGO, show_pwm_enable##offset, NULL)
+		show_pwm_##offset, set_pwm_##offset);			\
+static DEVICE_ATTR(fan##offset##_pwm_enable, S_IRUGO, show_pwm_enable##offset, NULL);
 
 show_pwm_reg(1);
 show_pwm_reg(2);
@@ -617,11 +617,11 @@ static ssize_t set_in_##offset##_max (struct device *dev, 		\
 {									\
 	return set_in_max(dev, buf, count, 0x##offset);			\
 }									\
-static DEVICE_ATTR(in##offset##_input, S_IRUGO, show_in_##offset, NULL)	\
+static DEVICE_ATTR(in##offset##_input, S_IRUGO, show_in_##offset, NULL);	\
 static DEVICE_ATTR(in##offset##_min, S_IRUGO | S_IWUSR, 		\
-		show_in_##offset##_min, set_in_##offset##_min)		\
+		show_in_##offset##_min, set_in_##offset##_min);		\
 static DEVICE_ATTR(in##offset##_max, S_IRUGO | S_IWUSR, 		\
-		show_in_##offset##_max, set_in_##offset##_max)
+		show_in_##offset##_max, set_in_##offset##_max);
 
 show_in_reg(0);
 show_in_reg(1);
@@ -697,11 +697,11 @@ static ssize_t set_temp_##offset##_max (struct device *dev, 		\
 {									\
 	return set_temp_max(dev, buf, count, 0x##offset - 1);		\
 }									\
-static DEVICE_ATTR(temp##offset##_input, S_IRUGO, show_temp_##offset, NULL)	\
+static DEVICE_ATTR(temp##offset##_input, S_IRUGO, show_temp_##offset, NULL);	\
 static DEVICE_ATTR(temp##offset##_min, S_IRUGO | S_IWUSR, 		\
-		show_temp_##offset##_min, set_temp_##offset##_min)	\
+		show_temp_##offset##_min, set_temp_##offset##_min);	\
 static DEVICE_ATTR(temp##offset##_max, S_IRUGO | S_IWUSR, 		\
-		show_temp_##offset##_max, set_temp_##offset##_max)
+		show_temp_##offset##_max, set_temp_##offset##_max);
 
 show_temp_reg(1);
 show_temp_reg(2);
diff --git a/drivers/i2c/chips/lm90.c b/drivers/i2c/chips/lm90.c
index f28b6679f..c3dd521c4 100644
--- a/drivers/i2c/chips/lm90.c
+++ b/drivers/i2c/chips/lm90.c
@@ -21,11 +21,26 @@
  *   http://www.national.com/pf/LM/LM99.html
  * Note that there is no way to differenciate between both chips.
  *
+ * This driver also supports the LM86, another sensor chip made by
+ * National Semiconductor. It is exactly similar to the LM90 except it
+ * has a higher accuracy.
+ * Complete datasheet can be obtained from National's website at:
+ *   http://www.national.com/pf/LM/LM86.html
+ *
  * This driver also supports the ADM1032, a sensor chip made by Analog
  * Devices. That chip is similar to the LM90, with a few differences
  * that are not handled by this driver. Complete datasheet can be
  * obtained from Analog's website at:
  *   http://products.analog.com/products/info.asp?product=ADM1032
+ * Among others, it has a higher accuracy than the LM90, much like the
+ * LM86 does.
+ *
+ * This driver also supports the MAX6657 and MAX6658, sensor chips made
+ * by Maxim. These chips are similar to the LM86. Complete datasheet
+ * can be obtained at Maxim's website at:
+ *   http://www.maxim-ic.com/quick_view2.cfm/qv_pk/2578
+ * Note that there is no way to differenciate between both chips (but
+ * no need either).
  *
  * Since the LM90 was the first chipset supported by this driver, most
  * comments will refer to this chipset, but are actually general and
@@ -56,7 +71,7 @@
 /*
  * Addresses to scan
  * Address is fully defined internally and cannot be changed.
- * LM89, LM90, LM99 and ADM1032 have address 0x4c.
+ * LM86, LM89, LM90, LM99, ADM1032, MAX6657 and MAX6658 have address 0x4c.
  * LM89-1, and LM99-1 have address 0x4d.
  */
 
@@ -69,7 +84,7 @@ static unsigned int normal_isa_range[] = { I2C_CLIENT_ISA_END };
  * Insmod parameters
  */
 
-SENSORS_INSMOD_3(lm90, adm1032, lm99);
+SENSORS_INSMOD_5(lm90, adm1032, lm99, lm86, max6657);
 
 /*
  * The LM90 registers
@@ -289,7 +304,6 @@ static int lm90_detect(struct i2c_adapter *adapter, int address, int kind)
 	struct lm90_data *data;
 	int err = 0;
 	const char *name = "";
-	u8 reg_config1=0, reg_convrate=0;
 
 	if (!i2c_check_functionality(adapter, I2C_FUNC_SMBUS_BYTE_DATA))
 		goto exit;
@@ -319,28 +333,22 @@ static int lm90_detect(struct i2c_adapter *adapter, int address, int kind)
 	 * requested, so both the detection and the identification steps
 	 * are skipped.
 	 */
-	if (kind < 0) { /* detection */
-		reg_config1 = i2c_smbus_read_byte_data(new_client,
-			      LM90_REG_R_CONFIG1);
-		reg_convrate = i2c_smbus_read_byte_data(new_client,
-			       LM90_REG_R_CONVRATE);
 
-		if ((reg_config1 & 0x2A) != 0x00
-		 || reg_convrate > 0x0A) {
-			dev_dbg(&adapter->dev,
-				"LM90 detection failed at 0x%02x.\n",
-				address);
-			goto exit_free;
-		}
-	}
+	/* Default to an LM90 if forced */
+	if (kind == 0)
+		kind = lm90;
 
-	if (kind <= 0) { /* identification */
-		u8 man_id, chip_id;
+	if (kind < 0) { /* detection and identification */
+		u8 man_id, chip_id, reg_config1, reg_convrate;
 
 		man_id = i2c_smbus_read_byte_data(new_client,
 			 LM90_REG_R_MAN_ID);
 		chip_id = i2c_smbus_read_byte_data(new_client,
 			  LM90_REG_R_CHIP_ID);
+		reg_config1 = i2c_smbus_read_byte_data(new_client,
+			      LM90_REG_R_CONFIG1);
+		reg_convrate = i2c_smbus_read_byte_data(new_client,
+			       LM90_REG_R_CONVRATE);
 		
 		if (man_id == 0x01) { /* National Semiconductor */
 			u8 reg_config2;
@@ -348,25 +356,36 @@ static int lm90_detect(struct i2c_adapter *adapter, int address, int kind)
 			reg_config2 = i2c_smbus_read_byte_data(new_client,
 				      LM90_REG_R_CONFIG2);
 
-			if (kind == 0 /* skip detection */
-			 || ((reg_config2 & 0xF8) == 0x00
-			  && reg_convrate <= 0x09)) {
+			if ((reg_config1 & 0x2A) == 0x00
+			 && (reg_config2 & 0xF8) == 0x00
+			 && reg_convrate <= 0x09) {
 				if (address == 0x4C
 				 && (chip_id & 0xF0) == 0x20) { /* LM90 */
 					kind = lm90;
 				} else
 				if ((chip_id & 0xF0) == 0x30) { /* LM89/LM99 */
 					kind = lm99;
+				} else
+				if (address == 0x4C
+				 && (chip_id & 0xF0) == 0x10) { /* LM86 */
+					kind = lm86;
 				}
 			}
 		} else
 		if (man_id == 0x41) { /* Analog Devices */
 			if (address == 0x4C
 			 && (chip_id & 0xF0) == 0x40 /* ADM1032 */
-			 && (kind == 0 /* skip detection */
-			  || (reg_config1 & 0x3F) == 0x00)) {
+			 && (reg_config1 & 0x3F) == 0x00
+			 && reg_convrate <= 0x0A) {
 				kind = adm1032;
 			}
+		} else
+		if (man_id == 0x4D) { /* Maxim */
+			if (address == 0x4C
+			 && (reg_config1 & 0x1F) == 0
+			 && reg_convrate <= 0x09) {
+			 	kind = max6657;
+			}
 		}
 
 		if (kind <= 0) { /* identification failed */
@@ -383,6 +402,10 @@ static int lm90_detect(struct i2c_adapter *adapter, int address, int kind)
 		name = "adm1032";
 	} else if (kind == lm99) {
 		name = "lm99";
+	} else if (kind == lm86) {
+		name = "lm86";
+	} else if (kind == max6657) {
+		name = "max6657";
 	}
 
 	/* We can fill in the remaining client fields */
diff --git a/drivers/i2c/chips/via686a.c b/drivers/i2c/chips/via686a.c
index a5ec359b0..3aa334583 100644
--- a/drivers/i2c/chips/via686a.c
+++ b/drivers/i2c/chips/via686a.c
@@ -405,11 +405,11 @@ static ssize_t set_in##offset##_max (struct device *dev,	\
 {								\
 	return set_in_max(dev, buf, count, 0x##offset);		\
 }								\
-static DEVICE_ATTR(in##offset##_input, S_IRUGO, show_in##offset, NULL) 	\
+static DEVICE_ATTR(in##offset##_input, S_IRUGO, show_in##offset, NULL);\
 static DEVICE_ATTR(in##offset##_min, S_IRUGO | S_IWUSR, 	\
-		show_in##offset##_min, set_in##offset##_min)	\
+		show_in##offset##_min, set_in##offset##_min);	\
 static DEVICE_ATTR(in##offset##_max, S_IRUGO | S_IWUSR, 	\
-		show_in##offset##_max, set_in##offset##_max)
+		show_in##offset##_max, set_in##offset##_max);
 
 show_in_offset(0);
 show_in_offset(1);
@@ -473,11 +473,11 @@ static ssize_t set_temp_##offset##_hyst (struct device *dev, 		\
 {									\
 	return set_temp_hyst(dev, buf, count, 0x##offset - 1);		\
 }									\
-static DEVICE_ATTR(temp##offset##_input, S_IRUGO, show_temp_##offset, NULL) \
+static DEVICE_ATTR(temp##offset##_input, S_IRUGO, show_temp_##offset, NULL);\
 static DEVICE_ATTR(temp##offset##_max, S_IRUGO | S_IWUSR, 		\
-		show_temp_##offset##_over, set_temp_##offset##_over) 	\
+		show_temp_##offset##_over, set_temp_##offset##_over);	\
 static DEVICE_ATTR(temp##offset##_max_hyst, S_IRUGO | S_IWUSR, 		\
-		show_temp_##offset##_hyst, set_temp_##offset##_hyst)	
+		show_temp_##offset##_hyst, set_temp_##offset##_hyst);	
 
 show_temp_offset(1);
 show_temp_offset(2);
@@ -542,11 +542,11 @@ static ssize_t set_fan_##offset##_div (struct device *dev, 		\
 {									\
 	return set_fan_div(dev, buf, count, 0x##offset - 1);		\
 }									\
-static DEVICE_ATTR(fan##offset##_input, S_IRUGO, show_fan_##offset, NULL) \
+static DEVICE_ATTR(fan##offset##_input, S_IRUGO, show_fan_##offset, NULL);\
 static DEVICE_ATTR(fan##offset##_min, S_IRUGO | S_IWUSR, 		\
-		show_fan_##offset##_min, set_fan_##offset##_min) 	\
+		show_fan_##offset##_min, set_fan_##offset##_min);	\
 static DEVICE_ATTR(fan##offset##_div, S_IRUGO | S_IWUSR, 		\
-		show_fan_##offset##_div, set_fan_##offset##_div)
+		show_fan_##offset##_div, set_fan_##offset##_div);
 
 show_fan_offset(1);
 show_fan_offset(2);
diff --git a/drivers/i2c/chips/w83627hf.c b/drivers/i2c/chips/w83627hf.c
index c38a7f971..5d1a31bcb 100644
--- a/drivers/i2c/chips/w83627hf.c
+++ b/drivers/i2c/chips/w83627hf.c
@@ -199,7 +199,7 @@ superio_exit(void)
 #define W83627THF_REG_PWM2		0x03	/* 697HF and 637HF too */
 #define W83627THF_REG_PWM3		0x11	/* 637HF too */
 
-#define W83627THF_REG_VRM_OVT_CFG 	0x18	/* 637HF too, unused yet */
+#define W83627THF_REG_VRM_OVT_CFG 	0x18	/* 637HF too */
 
 static const u8 regpwm_627hf[] = { W83627HF_REG_PWM1, W83627HF_REG_PWM2 };
 static const u8 regpwm[] = { W83627THF_REG_PWM1, W83627THF_REG_PWM2,
@@ -222,7 +222,7 @@ static const u8 BIT_SCFG2[] = { 0x10, 0x20, 0x40 };
    these macros are called: arguments may be evaluated more than once.
    Fixing this is just not worth it. */
 #define IN_TO_REG(val)  (SENSORS_LIMIT((((val) + 8)/16),0,255))
-#define IN_FROM_REG(val) ((val) * 16 + 5)
+#define IN_FROM_REG(val) ((val) * 16)
 
 static inline u8 FAN_TO_REG(long rpm, int div)
 {
@@ -312,6 +312,7 @@ struct w83627hf_data {
 				   Default = 3435.
 				   Other Betas unimplemented */
 	u8 vrm;
+	u8 vrm_ovt;		/* Register value, 627thf & 637hf only */
 };
 
 
@@ -370,7 +371,7 @@ show_regs_in_##offset (struct device *dev, char *buf) \
 { \
         return show_in(dev, buf, 0x##offset); \
 } \
-static DEVICE_ATTR(in##offset##_input, S_IRUGO, show_regs_in_##offset, NULL)
+static DEVICE_ATTR(in##offset##_input, S_IRUGO, show_regs_in_##offset, NULL);
 
 #define sysfs_in_reg_offset(reg, offset) \
 static ssize_t show_regs_in_##reg##offset (struct device *dev, char *buf) \
@@ -384,22 +385,104 @@ store_regs_in_##reg##offset (struct device *dev, \
 	return store_in_##reg (dev, buf, count, 0x##offset); \
 } \
 static DEVICE_ATTR(in##offset##_##reg, S_IRUGO| S_IWUSR, \
-		  show_regs_in_##reg##offset, store_regs_in_##reg##offset)
+		  show_regs_in_##reg##offset, store_regs_in_##reg##offset);
 
 #define sysfs_in_offsets(offset) \
 sysfs_in_offset(offset) \
 sysfs_in_reg_offset(min, offset) \
 sysfs_in_reg_offset(max, offset)
 
-sysfs_in_offsets(0)
-sysfs_in_offsets(1)
-sysfs_in_offsets(2)
-sysfs_in_offsets(3)
-sysfs_in_offsets(4)
-sysfs_in_offsets(5)
-sysfs_in_offsets(6)
-sysfs_in_offsets(7)
-sysfs_in_offsets(8)
+sysfs_in_offsets(1);
+sysfs_in_offsets(2);
+sysfs_in_offsets(3);
+sysfs_in_offsets(4);
+sysfs_in_offsets(5);
+sysfs_in_offsets(6);
+sysfs_in_offsets(7);
+sysfs_in_offsets(8);
+
+/* use a different set of functions for in0 */
+static ssize_t show_in_0(struct w83627hf_data *data, char *buf, u8 reg)
+{
+	long in0;
+
+	if ((data->vrm_ovt & 0x01) &&
+		(w83627thf == data->type || w83637hf == data->type))
+
+		/* use VRM9 calculation */
+		in0 = (long)((reg * 488 + 70000 + 50) / 100);
+	else
+		/* use VRM8 (standard) calculation */
+		in0 = (long)IN_FROM_REG(reg);
+
+	return sprintf(buf,"%ld\n", in0);
+}
+
+static ssize_t show_regs_in_0(struct device *dev, char *buf)
+{
+	struct w83627hf_data *data = w83627hf_update_device(dev);
+	return show_in_0(data, buf, data->in[0]);
+}
+
+static ssize_t show_regs_in_min0(struct device *dev, char *buf)
+{
+	struct w83627hf_data *data = w83627hf_update_device(dev);
+	return show_in_0(data, buf, data->in_min[0]);
+}
+
+static ssize_t show_regs_in_max0(struct device *dev, char *buf)
+{
+	struct w83627hf_data *data = w83627hf_update_device(dev);
+	return show_in_0(data, buf, data->in_max[0]);
+}
+
+static ssize_t store_regs_in_min0(struct device *dev,
+	const char *buf, size_t count)
+{
+	struct i2c_client *client = to_i2c_client(dev);
+	struct w83627hf_data *data = i2c_get_clientdata(client);
+	u32 val;
+
+	val = simple_strtoul(buf, NULL, 10);
+	if ((data->vrm_ovt & 0x01) &&
+		(w83627thf == data->type || w83637hf == data->type))
+
+		/* use VRM9 calculation */
+		data->in_min[0] = (u8)(((val * 100) - 70000 + 244) / 488);
+	else
+		/* use VRM8 (standard) calculation */
+		data->in_min[0] = IN_TO_REG(val);
+
+	w83627hf_write_value(client, W83781D_REG_IN_MIN(0), data->in_min[0]);
+	return count;
+}
+
+static ssize_t store_regs_in_max0(struct device *dev,
+	const char *buf, size_t count)
+{
+	struct i2c_client *client = to_i2c_client(dev);
+	struct w83627hf_data *data = i2c_get_clientdata(client);
+	u32 val;
+
+	val = simple_strtoul(buf, NULL, 10);
+	if ((data->vrm_ovt & 0x01) &&
+		(w83627thf == data->type || w83637hf == data->type))
+		
+		/* use VRM9 calculation */
+		data->in_max[0] = (u8)(((val * 100) - 70000 + 244) / 488);
+	else
+		/* use VRM8 (standard) calculation */
+		data->in_max[0] = IN_TO_REG(val);
+
+	w83627hf_write_value(client, W83781D_REG_IN_MAX(0), data->in_max[0]);
+	return count;
+}
+
+static DEVICE_ATTR(in0_input, S_IRUGO, show_regs_in_0, NULL);
+static DEVICE_ATTR(in0_min, S_IRUGO | S_IWUSR,
+	show_regs_in_min0, store_regs_in_min0);
+static DEVICE_ATTR(in0_max, S_IRUGO | S_IWUSR,
+	show_regs_in_max0, store_regs_in_max0);
 
 #define device_create_file_in(client, offset) \
 do { \
@@ -416,8 +499,8 @@ static ssize_t show_##reg (struct device *dev, char *buf, int nr) \
 		FAN_FROM_REG(data->reg[nr-1], \
 			    (long)DIV_FROM_REG(data->fan_div[nr-1]))); \
 }
-show_fan_reg(fan)
-show_fan_reg(fan_min)
+show_fan_reg(fan);
+show_fan_reg(fan_min);
 
 static ssize_t
 store_fan_min(struct device *dev, const char *buf, size_t count, int nr)
@@ -440,7 +523,7 @@ static ssize_t show_regs_fan_##offset (struct device *dev, char *buf) \
 { \
 	return show_fan(dev, buf, 0x##offset); \
 } \
-static DEVICE_ATTR(fan##offset##_input, S_IRUGO, show_regs_fan_##offset, NULL)
+static DEVICE_ATTR(fan##offset##_input, S_IRUGO, show_regs_fan_##offset, NULL);
 
 #define sysfs_fan_min_offset(offset) \
 static ssize_t show_regs_fan_min##offset (struct device *dev, char *buf) \
@@ -453,14 +536,14 @@ store_regs_fan_min##offset (struct device *dev, const char *buf, size_t count) \
 	return store_fan_min(dev, buf, count, 0x##offset); \
 } \
 static DEVICE_ATTR(fan##offset##_min, S_IRUGO | S_IWUSR, \
-		  show_regs_fan_min##offset, store_regs_fan_min##offset)
+		  show_regs_fan_min##offset, store_regs_fan_min##offset);
 
-sysfs_fan_offset(1)
-sysfs_fan_min_offset(1)
-sysfs_fan_offset(2)
-sysfs_fan_min_offset(2)
-sysfs_fan_offset(3)
-sysfs_fan_min_offset(3)
+sysfs_fan_offset(1);
+sysfs_fan_min_offset(1);
+sysfs_fan_offset(2);
+sysfs_fan_min_offset(2);
+sysfs_fan_offset(3);
+sysfs_fan_min_offset(3);
 
 #define device_create_file_fan(client, offset) \
 do { \
@@ -479,9 +562,9 @@ static ssize_t show_##reg (struct device *dev, char *buf, int nr) \
 		return sprintf(buf,"%ld\n", (long)TEMP_FROM_REG(data->reg)); \
 	} \
 }
-show_temp_reg(temp)
-show_temp_reg(temp_max)
-show_temp_reg(temp_max_hyst)
+show_temp_reg(temp);
+show_temp_reg(temp_max);
+show_temp_reg(temp_max_hyst);
 
 #define store_temp_reg(REG, reg) \
 static ssize_t \
@@ -505,8 +588,8 @@ store_temp_##reg (struct device *dev, const char *buf, size_t count, int nr) \
 	 \
 	return count; \
 }
-store_temp_reg(OVER, max)
-store_temp_reg(HYST, max_hyst)
+store_temp_reg(OVER, max);
+store_temp_reg(HYST, max_hyst);
 
 #define sysfs_temp_offset(offset) \
 static ssize_t \
@@ -514,7 +597,7 @@ show_regs_temp_##offset (struct device *dev, char *buf) \
 { \
 	return show_temp(dev, buf, 0x##offset); \
 } \
-static DEVICE_ATTR(temp##offset##_input, S_IRUGO, show_regs_temp_##offset, NULL)
+static DEVICE_ATTR(temp##offset##_input, S_IRUGO, show_regs_temp_##offset, NULL);
 
 #define sysfs_temp_reg_offset(reg, offset) \
 static ssize_t show_regs_temp_##reg##offset (struct device *dev, char *buf) \
@@ -528,16 +611,16 @@ store_regs_temp_##reg##offset (struct device *dev, \
 	return store_temp_##reg (dev, buf, count, 0x##offset); \
 } \
 static DEVICE_ATTR(temp##offset##_##reg, S_IRUGO| S_IWUSR, \
-		  show_regs_temp_##reg##offset, store_regs_temp_##reg##offset)
+		  show_regs_temp_##reg##offset, store_regs_temp_##reg##offset);
 
 #define sysfs_temp_offsets(offset) \
 sysfs_temp_offset(offset) \
 sysfs_temp_reg_offset(max, offset) \
 sysfs_temp_reg_offset(max_hyst, offset)
 
-sysfs_temp_offsets(1)
-sysfs_temp_offsets(2)
-sysfs_temp_offsets(3)
+sysfs_temp_offsets(1);
+sysfs_temp_offsets(2);
+sysfs_temp_offsets(3);
 
 #define device_create_file_temp(client, offset) \
 do { \
@@ -552,7 +635,7 @@ show_vid_reg(struct device *dev, char *buf)
 	struct w83627hf_data *data = w83627hf_update_device(dev);
 	return sprintf(buf, "%ld\n", (long) vid_from_reg(data->vid, data->vrm));
 }
-static DEVICE_ATTR(in0_ref, S_IRUGO, show_vid_reg, NULL)
+static DEVICE_ATTR(in0_ref, S_IRUGO, show_vid_reg, NULL);
 #define device_create_file_vid(client) \
 device_create_file(&client->dev, &dev_attr_in0_ref)
 
@@ -574,7 +657,7 @@ store_vrm_reg(struct device *dev, const char *buf, size_t count)
 
 	return count;
 }
-static DEVICE_ATTR(vrm, S_IRUGO | S_IWUSR, show_vrm_reg, store_vrm_reg)
+static DEVICE_ATTR(vrm, S_IRUGO | S_IWUSR, show_vrm_reg, store_vrm_reg);
 #define device_create_file_vrm(client) \
 device_create_file(&client->dev, &dev_attr_vrm)
 
@@ -584,7 +667,7 @@ show_alarms_reg(struct device *dev, char *buf)
 	struct w83627hf_data *data = w83627hf_update_device(dev);
 	return sprintf(buf, "%ld\n", (long) data->alarms);
 }
-static DEVICE_ATTR(alarms, S_IRUGO, show_alarms_reg, NULL)
+static DEVICE_ATTR(alarms, S_IRUGO, show_alarms_reg, NULL);
 #define device_create_file_alarms(client) \
 device_create_file(&client->dev, &dev_attr_alarms)
 
@@ -641,10 +724,10 @@ store_regs_beep_##reg (struct device *dev, const char *buf, size_t count) \
 	return store_beep_reg(dev, buf, count, BEEP_##REG); \
 } \
 static DEVICE_ATTR(beep_##reg, S_IRUGO | S_IWUSR, \
-		  show_regs_beep_##reg, store_regs_beep_##reg)
+		  show_regs_beep_##reg, store_regs_beep_##reg);
 
-sysfs_beep(ENABLE, enable)
-sysfs_beep(MASK, mask)
+sysfs_beep(ENABLE, enable);
+sysfs_beep(MASK, mask);
 
 #define device_create_file_beep(client) \
 do { \
@@ -707,11 +790,11 @@ store_regs_fan_div_##offset (struct device *dev, \
 	return store_fan_div_reg(dev, buf, count, offset - 1); \
 } \
 static DEVICE_ATTR(fan##offset##_div, S_IRUGO | S_IWUSR, \
-		  show_regs_fan_div_##offset, store_regs_fan_div_##offset)
+		  show_regs_fan_div_##offset, store_regs_fan_div_##offset);
 
-sysfs_fan_div(1)
-sysfs_fan_div(2)
-sysfs_fan_div(3)
+sysfs_fan_div(1);
+sysfs_fan_div(2);
+sysfs_fan_div(3);
 
 #define device_create_file_fan_div(client, offset) \
 do { \
@@ -763,11 +846,11 @@ store_regs_pwm_##offset (struct device *dev, const char *buf, size_t count) \
 	return store_pwm_reg(dev, buf, count, offset); \
 } \
 static DEVICE_ATTR(fan##offset##_pwm, S_IRUGO | S_IWUSR, \
-		  show_regs_pwm_##offset, store_regs_pwm_##offset)
+		  show_regs_pwm_##offset, store_regs_pwm_##offset);
 
-sysfs_pwm(1)
-sysfs_pwm(2)
-sysfs_pwm(3)
+sysfs_pwm(1);
+sysfs_pwm(2);
+sysfs_pwm(3);
 
 #define device_create_file_pwm(client, offset) \
 do { \
@@ -836,11 +919,11 @@ store_regs_sensor_##offset (struct device *dev, const char *buf, size_t count) \
     return store_sensor_reg(dev, buf, count, offset); \
 } \
 static DEVICE_ATTR(temp##offset##_type, S_IRUGO | S_IWUSR, \
-		  show_regs_sensor_##offset, store_regs_sensor_##offset)
+		  show_regs_sensor_##offset, store_regs_sensor_##offset);
 
-sysfs_sensor(1)
-sysfs_sensor(2)
-sysfs_sensor(3)
+sysfs_sensor(1);
+sysfs_sensor(2);
+sysfs_sensor(3);
 
 #define device_create_file_sensor(client, offset) \
 do { \
@@ -1157,7 +1240,7 @@ static int w83627hf_write_value(struct i2c_client *client, u16 reg, u16 value)
 static void w83627hf_init_client(struct i2c_client *client)
 {
 	struct w83627hf_data *data = i2c_get_clientdata(client);
-	int vid = 0, i;
+	int i;
 	int type = data->type;
 	u8 tmp;
 
@@ -1191,10 +1274,15 @@ static void w83627hf_init_client(struct i2c_client *client)
 		data->vid = w83627thf_read_gpio5(client) & 0x1f;
 	}
 
-	/* Convert VID to voltage based on default VRM */
-	data->vrm = DEFAULT_VRM;
-	if (type != w83697hf)
-		vid = vid_from_reg(vid, data->vrm);
+	/* Read VRM & OVT Config only once */
+	if (w83627thf == data->type || w83637hf == data->type) {
+		data->vrm_ovt = 
+			w83627hf_read_value(client, W83627THF_REG_VRM_OVT_CFG);
+		data->vrm = (data->vrm_ovt & 0x01) ? 90 : 82;
+	} else {
+		/* Convert VID to voltage based on default VRM */
+		data->vrm = DEFAULT_VRM;
+	}
 
 	tmp = w83627hf_read_value(client, W83781D_REG_SCFG1);
 	for (i = 1; i <= 3; i++) {
diff --git a/drivers/i2c/chips/w83781d.c b/drivers/i2c/chips/w83781d.c
index ac378b54b..785203d39 100644
--- a/drivers/i2c/chips/w83781d.c
+++ b/drivers/i2c/chips/w83781d.c
@@ -320,7 +320,7 @@ show_regs_in_##offset (struct device *dev, char *buf) \
 { \
         return show_in(dev, buf, 0x##offset); \
 } \
-static DEVICE_ATTR(in##offset##_input, S_IRUGO, show_regs_in_##offset, NULL)
+static DEVICE_ATTR(in##offset##_input, S_IRUGO, show_regs_in_##offset, NULL);
 
 #define sysfs_in_reg_offset(reg, offset) \
 static ssize_t show_regs_in_##reg##offset (struct device *dev, char *buf) \
@@ -331,7 +331,7 @@ static ssize_t store_regs_in_##reg##offset (struct device *dev, const char *buf,
 { \
 	return store_in_##reg (dev, buf, count, 0x##offset); \
 } \
-static DEVICE_ATTR(in##offset##_##reg, S_IRUGO| S_IWUSR, show_regs_in_##reg##offset, store_regs_in_##reg##offset)
+static DEVICE_ATTR(in##offset##_##reg, S_IRUGO| S_IWUSR, show_regs_in_##reg##offset, store_regs_in_##reg##offset);
 
 #define sysfs_in_offsets(offset) \
 sysfs_in_offset(offset); \
@@ -386,7 +386,7 @@ static ssize_t show_regs_fan_##offset (struct device *dev, char *buf) \
 { \
 	return show_fan(dev, buf, 0x##offset); \
 } \
-static DEVICE_ATTR(fan##offset##_input, S_IRUGO, show_regs_fan_##offset, NULL)
+static DEVICE_ATTR(fan##offset##_input, S_IRUGO, show_regs_fan_##offset, NULL);
 
 #define sysfs_fan_min_offset(offset) \
 static ssize_t show_regs_fan_min##offset (struct device *dev, char *buf) \
@@ -397,7 +397,7 @@ static ssize_t store_regs_fan_min##offset (struct device *dev, const char *buf,
 { \
 	return store_fan_min(dev, buf, count, 0x##offset); \
 } \
-static DEVICE_ATTR(fan##offset##_min, S_IRUGO | S_IWUSR, show_regs_fan_min##offset, store_regs_fan_min##offset)
+static DEVICE_ATTR(fan##offset##_min, S_IRUGO | S_IWUSR, show_regs_fan_min##offset, store_regs_fan_min##offset);
 
 sysfs_fan_offset(1);
 sysfs_fan_min_offset(1);
@@ -466,7 +466,7 @@ show_regs_temp_##offset (struct device *dev, char *buf) \
 { \
 	return show_temp(dev, buf, 0x##offset); \
 } \
-static DEVICE_ATTR(temp##offset##_input, S_IRUGO, show_regs_temp_##offset, NULL)
+static DEVICE_ATTR(temp##offset##_input, S_IRUGO, show_regs_temp_##offset, NULL);
 
 #define sysfs_temp_reg_offset(reg, offset) \
 static ssize_t show_regs_temp_##reg##offset (struct device *dev, char *buf) \
@@ -477,7 +477,7 @@ static ssize_t store_regs_temp_##reg##offset (struct device *dev, const char *bu
 { \
 	return store_temp_##reg (dev, buf, count, 0x##offset); \
 } \
-static DEVICE_ATTR(temp##offset##_##reg, S_IRUGO| S_IWUSR, show_regs_temp_##reg##offset, store_regs_temp_##reg##offset)
+static DEVICE_ATTR(temp##offset##_##reg, S_IRUGO| S_IWUSR, show_regs_temp_##reg##offset, store_regs_temp_##reg##offset);
 
 #define sysfs_temp_offsets(offset) \
 sysfs_temp_offset(offset); \
@@ -503,7 +503,7 @@ show_vid_reg(struct device *dev, char *buf)
 }
 
 static
-DEVICE_ATTR(in0_ref, S_IRUGO, show_vid_reg, NULL)
+DEVICE_ATTR(in0_ref, S_IRUGO, show_vid_reg, NULL);
 #define device_create_file_vid(client) \
 device_create_file(&client->dev, &dev_attr_in0_ref);
 static ssize_t
@@ -527,7 +527,7 @@ store_vrm_reg(struct device *dev, const char *buf, size_t count)
 }
 
 static
-DEVICE_ATTR(vrm, S_IRUGO | S_IWUSR, show_vrm_reg, store_vrm_reg)
+DEVICE_ATTR(vrm, S_IRUGO | S_IWUSR, show_vrm_reg, store_vrm_reg);
 #define device_create_file_vrm(client) \
 device_create_file(&client->dev, &dev_attr_vrm);
 static ssize_t
@@ -538,7 +538,7 @@ show_alarms_reg(struct device *dev, char *buf)
 }
 
 static
-DEVICE_ATTR(alarms, S_IRUGO, show_alarms_reg, NULL)
+DEVICE_ATTR(alarms, S_IRUGO, show_alarms_reg, NULL);
 #define device_create_file_alarms(client) \
 device_create_file(&client->dev, &dev_attr_alarms);
 static ssize_t show_beep_mask (struct device *dev, char *buf)
@@ -598,7 +598,7 @@ static ssize_t store_regs_beep_##reg (struct device *dev, const char *buf, size_
 { \
 	return store_beep_reg(dev, buf, count, BEEP_##REG); \
 } \
-static DEVICE_ATTR(beep_##reg, S_IRUGO | S_IWUSR, show_regs_beep_##reg, store_regs_beep_##reg)
+static DEVICE_ATTR(beep_##reg, S_IRUGO | S_IWUSR, show_regs_beep_##reg, store_regs_beep_##reg);
 
 sysfs_beep(ENABLE, enable);
 sysfs_beep(MASK, mask);
@@ -665,7 +665,7 @@ static ssize_t store_regs_fan_div_##offset (struct device *dev, const char *buf,
 { \
 	return store_fan_div_reg(dev, buf, count, offset - 1); \
 } \
-static DEVICE_ATTR(fan##offset##_div, S_IRUGO | S_IWUSR, show_regs_fan_div_##offset, store_regs_fan_div_##offset)
+static DEVICE_ATTR(fan##offset##_div, S_IRUGO | S_IWUSR, show_regs_fan_div_##offset, store_regs_fan_div_##offset);
 
 sysfs_fan_div(1);
 sysfs_fan_div(2);
@@ -744,7 +744,7 @@ static ssize_t store_regs_pwm_##offset (struct device *dev, const char *buf, siz
 { \
 	return store_pwm_reg(dev, buf, count, offset); \
 } \
-static DEVICE_ATTR(fan##offset##_pwm, S_IRUGO | S_IWUSR, show_regs_pwm_##offset, store_regs_pwm_##offset)
+static DEVICE_ATTR(fan##offset##_pwm, S_IRUGO | S_IWUSR, show_regs_pwm_##offset, store_regs_pwm_##offset);
 
 #define sysfs_pwmenable(offset) \
 static ssize_t show_regs_pwmenable_##offset (struct device *dev, char *buf) \
@@ -755,7 +755,7 @@ static ssize_t store_regs_pwmenable_##offset (struct device *dev, const char *bu
 { \
 	return store_pwmenable_reg(dev, buf, count, offset); \
 } \
-static DEVICE_ATTR(fan##offset##_pwm_enable, S_IRUGO | S_IWUSR, show_regs_pwmenable_##offset, store_regs_pwmenable_##offset)
+static DEVICE_ATTR(fan##offset##_pwm_enable, S_IRUGO | S_IWUSR, show_regs_pwmenable_##offset, store_regs_pwmenable_##offset);
 
 sysfs_pwm(1);
 sysfs_pwm(2);
@@ -833,7 +833,7 @@ static ssize_t store_regs_sensor_##offset (struct device *dev, const char *buf,
 { \
     return store_sensor_reg(dev, buf, count, offset); \
 } \
-static DEVICE_ATTR(temp##offset##_type, S_IRUGO | S_IWUSR, show_regs_sensor_##offset, store_regs_sensor_##offset)
+static DEVICE_ATTR(temp##offset##_type, S_IRUGO | S_IWUSR, show_regs_sensor_##offset, store_regs_sensor_##offset);
 
 sysfs_sensor(1);
 sysfs_sensor(2);
@@ -891,7 +891,7 @@ static ssize_t store_regs_rt_##offset (struct device *dev, const char *buf, size
 { \
     return store_rt_reg(dev, buf, count, offset); \
 } \
-static DEVICE_ATTR(rt##offset, S_IRUGO | S_IWUSR, show_regs_rt_##offset, store_regs_rt_##offset)
+static DEVICE_ATTR(rt##offset, S_IRUGO | S_IWUSR, show_regs_rt_##offset, store_regs_rt_##offset);
 
 sysfs_rt(1);
 sysfs_rt(2);
@@ -1491,7 +1491,7 @@ static void
 w83781d_init_client(struct i2c_client *client)
 {
 	struct w83781d_data *data = i2c_get_clientdata(client);
-	int vid = 0, i, p;
+	int i, p;
 	int type = data->type;
 	u8 tmp;
 
@@ -1513,14 +1513,7 @@ w83781d_init_client(struct i2c_client *client)
 		w83781d_write_value(client, W83781D_REG_BEEP_INTS2, 0);
 	}
 
-	if (type != w83697hf) {
-		vid = w83781d_read_value(client, W83781D_REG_VID_FANDIV) & 0x0f;
-		vid |=
-		    (w83781d_read_value(client, W83781D_REG_CHIPID) & 0x01) <<
-		    4;
-		data->vrm = DEFAULT_VRM;
-		vid = vid_from_reg(vid, data->vrm);
-	}
+	data->vrm = 82;
 
 	if ((type != w83781d) && (type != as99127f)) {
 		tmp = w83781d_read_value(client, W83781D_REG_SCFG1);
diff --git a/drivers/i2c/chips/w83l785ts.c b/drivers/i2c/chips/w83l785ts.c
index 52118f9bf..58575861f 100644
--- a/drivers/i2c/chips/w83l785ts.c
+++ b/drivers/i2c/chips/w83l785ts.c
@@ -137,8 +137,8 @@ static ssize_t show_temp_over(struct device *dev, char *buf)
 	return sprintf(buf, "%d\n", TEMP_FROM_REG(data->temp_over));
 }
 
-static DEVICE_ATTR(temp1_input, S_IRUGO, show_temp, NULL)
-static DEVICE_ATTR(temp1_max, S_IRUGO, show_temp_over, NULL)
+static DEVICE_ATTR(temp1_input, S_IRUGO, show_temp, NULL);
+static DEVICE_ATTR(temp1_max, S_IRUGO, show_temp_over, NULL);
 
 /*
  * Real code
diff --git a/drivers/i2c/i2c-core.c b/drivers/i2c/i2c-core.c
index 56225a516..2583ecaa9 100644
--- a/drivers/i2c/i2c-core.c
+++ b/drivers/i2c/i2c-core.c
@@ -126,7 +126,13 @@ int i2c_add_adapter(struct i2c_adapter *adap)
 		goto out_unlock;
 	}
 
-	id = idr_get_new(&i2c_adapter_idr, NULL);
+	res = idr_get_new(&i2c_adapter_idr, NULL, &id);
+	if (res < 0) {
+		if (res == -EAGAIN)
+			res = -ENOMEM;
+		goto out_unlock;
+	}
+
 	adap->nr =  id & MAX_ID_MASK;
 	init_MUTEX(&adap->bus_lock);
 	init_MUTEX(&adap->clist_lock);
@@ -162,7 +168,7 @@ int i2c_add_adapter(struct i2c_adapter *adap)
 
 	dev_dbg(&adap->dev, "registered as adapter #%d\n", adap->nr);
 
- out_unlock:
+out_unlock:
 	up(&core_lists);
 	return res;
 }
diff --git a/drivers/i2c/i2c-dev.c b/drivers/i2c/i2c-dev.c
index a0a4aa15a..af17f14e0 100644
--- a/drivers/i2c/i2c-dev.c
+++ b/drivers/i2c/i2c-dev.c
@@ -181,7 +181,7 @@ int i2cdev_ioctl (struct inode *inode, struct file *file, unsigned int cmd,
 	struct i2c_smbus_ioctl_data data_arg;
 	union i2c_smbus_data temp;
 	struct i2c_msg *rdwr_pa;
-	u8 **data_ptrs;
+	u8 __user **data_ptrs;
 	int i,datasize,res;
 	unsigned long funcs;
 
@@ -238,8 +238,7 @@ int i2cdev_ioctl (struct inode *inode, struct file *file, unsigned int cmd,
 			return -EFAULT;
 		}
 
-		data_ptrs = (u8 **) kmalloc(rdwr_arg.nmsgs * sizeof(u8 *),
-					    GFP_KERNEL);
+		data_ptrs = kmalloc(rdwr_arg.nmsgs * sizeof(u8 __user *), GFP_KERNEL);
 		if (data_ptrs == NULL) {
 			kfree(rdwr_pa);
 			return -ENOMEM;
@@ -252,7 +251,7 @@ int i2cdev_ioctl (struct inode *inode, struct file *file, unsigned int cmd,
 				res = -EINVAL;
 				break;
 			}
-			data_ptrs[i] = rdwr_pa[i].buf;
+			data_ptrs[i] = (u8 __user *)rdwr_pa[i].buf;
 			rdwr_pa[i].buf = kmalloc(rdwr_pa[i].len, GFP_KERNEL);
 			if(rdwr_pa[i].buf == NULL) {
 				res = -ENOMEM;
@@ -519,20 +518,29 @@ static int __init i2c_dev_init(void)
 
 	printk(KERN_INFO "i2c /dev entries driver\n");
 
-	if (register_chrdev(I2C_MAJOR,"i2c",&i2cdev_fops)) {
-		printk(KERN_ERR "i2c-dev.o: unable to get major %d for i2c bus\n",
-		       I2C_MAJOR);
-		return -EIO;
-	}
+	res = register_chrdev(I2C_MAJOR, "i2c", &i2cdev_fops);
+	if (res)
+		goto out;
+
+	res = class_register(&i2c_dev_class);
+	if (res)
+		goto out_unreg_chrdev;
+
+	res = i2c_add_driver(&i2cdev_driver);
+	if (res)
+		goto out_unreg_class;
+
 	devfs_mk_dir("i2c");
-	class_register(&i2c_dev_class);
-	if ((res = i2c_add_driver(&i2cdev_driver))) {
-		printk(KERN_ERR "i2c-dev.o: Driver registration failed, module not inserted.\n");
-		devfs_remove("i2c");
-		unregister_chrdev(I2C_MAJOR,"i2c");
-		return res;
-	}
+
 	return 0;
+
+out_unreg_class:
+	class_unregister(&i2c_dev_class);
+out_unreg_chrdev:
+	unregister_chrdev(I2C_MAJOR, "i2c");
+out:
+	printk(KERN_ERR "%s: Driver Initialisation failed", __FILE__);
+	return res;
 }
 
 static void __exit i2c_dev_exit(void)
diff --git a/drivers/ide/Kconfig b/drivers/ide/Kconfig
index 91e9282b4..f28496bd2 100644
--- a/drivers/ide/Kconfig
+++ b/drivers/ide/Kconfig
@@ -54,7 +54,7 @@ if IDE
 
 config IDE_MAX_HWIFS 
 	int "Max IDE interfaces"
-	depends on ALPHA
+	depends on ALPHA || SUPERH
 	default 4
 	help
 	  This is the maximum number of IDE hardware interfaces that will
@@ -95,27 +95,29 @@ if BLK_DEV_IDE
 
 comment "Please see Documentation/ide.txt for help/info on IDE drives"
 
-config BLK_DEV_HD_IDE
-	bool "Use old disk-only driver on primary interface"
-	depends on ((X86 && X86_PC9800!=y) || SH_MPC1211)
+config BLK_DEV_IDE_SATA
+	bool "Support for SATA (deprecated; conflicts with libata SATA driver)"
+	default n
 	---help---
-	  There are two drivers for MFM/RLL/IDE disks.  Most people use just
-	  the new enhanced driver by itself.  This option however installs the
-	  old hard disk driver to control the primary IDE/disk interface in
-	  the system, leaving the new enhanced IDE driver to take care of only
-	  the 2nd/3rd/4th IDE interfaces.  Doing this will prevent you from
-	  having an IDE/ATAPI CD-ROM or tape drive connected to the primary
-	  IDE interface.  Choosing this option may be useful for older systems
-	  which have MFM/RLL/ESDI controller+drives at the primary port
-	  address (0x1f0), along with IDE drives at the secondary/3rd/4th port
-	  addresses.
+	  There are two drivers for Serial ATA controllers.
 
-	  Normally, just say N here; you will then use the new driver for all
-	  4 interfaces.
+	  The main driver, "libata", exists inside the SCSI subsystem
+	  and supports most modern SATA controllers.
 
-config BLK_DEV_HD_IDE98
+	  The IDE driver (which you are currently configuring) supports
+	  a few first-generation SATA controllers.
+
+	  In order to eliminate conflicts between the two subsystems,
+	  this config option enables the IDE driver's SATA support.
+	  Normally this is disabled, as it is preferred that libata
+	  supports SATA controllers, and this (IDE) driver supports
+	  PATA controllers.
+
+	  If unsure, say N.
+
+config BLK_DEV_HD_IDE
 	bool "Use old disk-only driver on primary interface"
-	depends on X86 && X86_PC9800
+	depends on (X86 || SH_MPC1211)
 	---help---
 	  There are two drivers for MFM/RLL/IDE disks.  Most people use just
 	  the new enhanced driver by itself.  This option however installs the
@@ -751,7 +753,7 @@ endif
 
 config BLK_DEV_IDE_PMAC
 	bool "Builtin PowerMac IDE support"
-	depends on PPC_PMAC
+	depends on PPC_PMAC && IDE=y
 	help
 	  This driver provides support for the built-in IDE controller on
 	  most of the recent Apple Power Macintoshes and PowerBooks.
diff --git a/drivers/ide/Makefile b/drivers/ide/Makefile
index 462976033..aeac73d8a 100644
--- a/drivers/ide/Makefile
+++ b/drivers/ide/Makefile
@@ -29,7 +29,6 @@ ide-core-$(CONFIG_BLK_DEV_IDEPNP)	+= ide-pnp.o
 ide-core-$(CONFIG_IDE_ARM)		+= arm/ide_arm.o
 
 # built-in only drivers from legacy/
-ide-core-$(CONFIG_BLK_DEV_IDE_PC9800)	+= legacy/pc9800.o
 ide-core-$(CONFIG_BLK_DEV_BUDDHA)	+= legacy/buddha.o
 ide-core-$(CONFIG_BLK_DEV_FALCON_IDE)	+= legacy/falconide.o
 ide-core-$(CONFIG_BLK_DEV_GAYLE)	+= legacy/gayle.o
diff --git a/drivers/ide/ide-cd.c b/drivers/ide/ide-cd.c
index 6f14bbfc3..c3d6286eb 100644
--- a/drivers/ide/ide-cd.c
+++ b/drivers/ide/ide-cd.c
@@ -785,14 +785,6 @@ static int cdrom_decode_status(ide_drive_t *drive, int good_stat, int *stat_ret)
 				do_end_request = 1;
 		} else if (sense_key == ILLEGAL_REQUEST ||
 			   sense_key == DATA_PROTECT) {
-			/*
-			 * check if this was a write protected media
-			 */
-			if (rq_data_dir(rq) == WRITE) {
-				printk("ide-cd: media marked write protected\n");
-				set_disk_ro(drive->disk, 1);
-			}
-
 			/* No point in retrying after an illegal
 			   request or data protect error.*/
 			ide_dump_status (drive, "command error", stat);
@@ -1967,13 +1959,17 @@ static ide_startstop_t cdrom_do_block_pc(ide_drive_t *drive, struct request *rq)
 	 * sg request
 	 */
 	if (rq->bio) {
-		if (rq->data_len & 3) {
-			printk("%s: block pc not aligned, len=%d\n", drive->name, rq->data_len);
-			cdrom_end_request(drive, 0);
-			return ide_stopped;
-		}
-		info->dma = drive->using_dma;
+		int mask = drive->queue->dma_alignment;
+		unsigned long addr = (unsigned long) page_address(bio_page(rq->bio));
+
 		info->cmd = rq_data_dir(rq);
+		info->dma = drive->using_dma;
+
+		/*
+		 * check if dma is safe
+		 */
+		if ((rq->data_len & mask) || (addr & mask))
+			info->dma = 0;
 	}
 
 	/* Start sending the command to the drive. */
@@ -2816,7 +2812,6 @@ int ide_cdrom_open_real (struct cdrom_device_info *cdi, int purpose)
 	return 0;
 }
 
-
 /*
  * Close down the device.  Invalidate all cached blocks.
  */
@@ -2890,12 +2885,6 @@ static int ide_cdrom_register (ide_drive_t *drive, int nslots)
 		devinfo->mask |= CDC_CLOSE_TRAY;
 	if (!CDROM_CONFIG_FLAGS(drive)->mo_drive)
 		devinfo->mask |= CDC_MO_DRIVE;
-	if (!CDROM_CONFIG_FLAGS(drive)->mrw)
-		devinfo->mask |= CDC_MRW;
-	if (!CDROM_CONFIG_FLAGS(drive)->mrw_w)
-		devinfo->mask |= CDC_MRW_W;
-	if (!CDROM_CONFIG_FLAGS(drive)->ram)
-		devinfo->mask |= CDC_RAM;
 
 	devinfo->disk = drive->disk;
 	return register_cdrom(devinfo);
@@ -2932,7 +2921,7 @@ int ide_cdrom_probe_capabilities (ide_drive_t *drive)
 	struct cdrom_info *info = drive->driver_data;
 	struct cdrom_device_info *cdi = &info->devinfo;
 	struct atapi_capabilities_page cap;
-	int nslots = 1, mrw_write = 0, ram_write = 0;
+	int nslots = 1;
 
 	if (drive->media == ide_optical) {
 		CDROM_CONFIG_FLAGS(drive)->mo_drive = 1;
@@ -2961,17 +2950,6 @@ int ide_cdrom_probe_capabilities (ide_drive_t *drive)
 	if (ide_cdrom_get_capabilities(drive, &cap))
 		return 0;
 
-	if (!cdrom_is_mrw(cdi, &mrw_write)) {
-		CDROM_CONFIG_FLAGS(drive)->mrw = 1;
-		if (mrw_write) {
-			CDROM_CONFIG_FLAGS(drive)->mrw_w = 1;
-			CDROM_CONFIG_FLAGS(drive)->ram = 1;
-		}
-	}
-	if (!cdrom_is_random_writable(cdi, &ram_write))
-		if (ram_write)
-			CDROM_CONFIG_FLAGS(drive)->ram = 1;
-
 	if (cap.lock == 0)
 		CDROM_CONFIG_FLAGS(drive)->no_doorlock = 1;
 	if (cap.eject)
@@ -3051,9 +3029,6 @@ int ide_cdrom_probe_capabilities (ide_drive_t *drive)
         	(CDROM_CONFIG_FLAGS(drive)->cd_r)? "-R" : "", 
         	(CDROM_CONFIG_FLAGS(drive)->cd_rw)? "/RW" : "");
 
-	if (CDROM_CONFIG_FLAGS(drive)->mrw || CDROM_CONFIG_FLAGS(drive)->mrw_w)
-		printk(" CD-MR%s", CDROM_CONFIG_FLAGS(drive)->mrw_w ? "W" : "");
-
         if (CDROM_CONFIG_FLAGS(drive)->is_changer) 
         	printk(" changer w/%d slots", nslots);
         else 	
@@ -3162,7 +3137,7 @@ int ide_cdrom_setup (ide_drive_t *drive)
 	int nslots;
 
 	blk_queue_prep_rq(drive->queue, ide_cdrom_prep_fn);
-	blk_queue_dma_alignment(drive->queue, 3);
+	blk_queue_dma_alignment(drive->queue, 31);
 	drive->queue->unplug_delay = (1 * HZ) / 1000;
 	if (!drive->queue->unplug_delay)
 		drive->queue->unplug_delay = 1;
@@ -3269,9 +3244,8 @@ int ide_cdrom_setup (ide_drive_t *drive)
 	nslots = ide_cdrom_probe_capabilities (drive);
 
 	/*
-	 * set correct block size and read-only for non-ram media
+	 * set correct block size
 	 */
-	set_disk_ro(drive->disk, !CDROM_CONFIG_FLAGS(drive)->ram);
 	blk_queue_hardsect_size(drive->queue, CD_FRAMESIZE);
 
 #if 0
@@ -3421,10 +3395,10 @@ static int idecd_ioctl (struct inode *inode, struct file *file,
 {
 	struct block_device *bdev = inode->i_bdev;
 	ide_drive_t *drive = bdev->bd_disk->private_data;
-	int err = generic_ide_ioctl(bdev, cmd, arg);
+	int err = generic_ide_ioctl(file, bdev, cmd, arg);
 	if (err == -EINVAL) {
 		struct cdrom_info *info = drive->driver_data;
-		err = cdrom_ioctl(&info->devinfo, inode, cmd, arg);
+		err = cdrom_ioctl(file, &info->devinfo, inode, cmd, arg);
 	}
 	return err;
 }
diff --git a/drivers/ide/ide-cd.h b/drivers/ide/ide-cd.h
index 7a3bcd3c4..8305bcab8 100644
--- a/drivers/ide/ide-cd.h
+++ b/drivers/ide/ide-cd.h
@@ -79,8 +79,6 @@ struct ide_cd_config_flags {
 	__u8 dvd		: 1; /* Drive is a DVD-ROM */
 	__u8 dvd_r		: 1; /* Drive can write DVD-R */
 	__u8 dvd_ram		: 1; /* Drive can write DVD-RAM */
-	__u8 mrw		: 1; /* drive can read mrw */
-	__u8 mrw_w		: 1; /* drive can write mrw */
 	__u8 ram		: 1; /* generic WRITE (dvd-ram/mrw) */
 	__u8 test_write		: 1; /* Drive can fake writes */
 	__u8 supp_disc_present	: 1; /* Changer can report exact contents
diff --git a/drivers/ide/ide-disk.c b/drivers/ide/ide-disk.c
index 9217f0ced..7b3bf05cb 100644
--- a/drivers/ide/ide-disk.c
+++ b/drivers/ide/ide-disk.c
@@ -1334,7 +1334,8 @@ enum {
 	idedisk_pm_flush_cache	= ide_pm_state_start_suspend,
 	idedisk_pm_standby,
 
-	idedisk_pm_restore_dma	= ide_pm_state_start_resume,
+	idedisk_pm_idle		= ide_pm_state_start_resume,
+	idedisk_pm_restore_dma,
 };
 
 static void idedisk_complete_power_step (ide_drive_t *drive, struct request *rq, u8 stat, u8 error)
@@ -1349,6 +1350,9 @@ static void idedisk_complete_power_step (ide_drive_t *drive, struct request *rq,
 	case idedisk_pm_standby:	/* Suspend step 2 (standby) complete */
 		rq->pm->pm_step = ide_pm_state_completed;
 		break;
+	case idedisk_pm_idle:		/* Resume step 1 (idle) complete */
+		rq->pm->pm_step = idedisk_pm_restore_dma;
+		break;
 	}
 }
 
@@ -1372,13 +1376,20 @@ static ide_startstop_t idedisk_start_power_step (ide_drive_t *drive, struct requ
 		args->command_type = IDE_DRIVE_TASK_NO_DATA;
 		args->handler	   = &task_no_data_intr;
 		return do_rw_taskfile(drive, args);
+
 	case idedisk_pm_standby:	/* Suspend step 2 (standby) */
 		args->tfRegister[IDE_COMMAND_OFFSET] = WIN_STANDBYNOW1;
 		args->command_type = IDE_DRIVE_TASK_NO_DATA;
 		args->handler	   = &task_no_data_intr;
 		return do_rw_taskfile(drive, args);
 
-	case idedisk_pm_restore_dma:	/* Resume step 1 (restore DMA) */
+	case idedisk_pm_idle:		/* Resume step 1 (idle) */
+		args->tfRegister[IDE_COMMAND_OFFSET] = WIN_IDLEIMMEDIATE;
+		args->command_type = IDE_DRIVE_TASK_NO_DATA;
+		args->handler = task_no_data_intr;
+		return do_rw_taskfile(drive, args);
+
+	case idedisk_pm_restore_dma:	/* Resume step 2 (restore DMA) */
 		/*
 		 * Right now, all we do is call hwif->ide_dma_check(drive),
 		 * we could be smarter and check for current xfer_speed
@@ -1657,7 +1668,7 @@ static int idedisk_ioctl(struct inode *inode, struct file *file,
 			unsigned int cmd, unsigned long arg)
 {
 	struct block_device *bdev = inode->i_bdev;
-	return generic_ide_ioctl(bdev, cmd, arg);
+	return generic_ide_ioctl(file, bdev, cmd, arg);
 }
 
 static int idedisk_media_changed(struct gendisk *disk)
diff --git a/drivers/ide/ide-dma.c b/drivers/ide/ide-dma.c
index 19ae46dc0..6ed4de8a5 100644
--- a/drivers/ide/ide-dma.c
+++ b/drivers/ide/ide-dma.c
@@ -100,7 +100,7 @@ static const struct drive_list_entry drive_whitelist [] = {
 	{ "CONNER CTMA 4000"	,       "ALL"		},
 	{ "CONNER CTT8000-A"	,       "ALL"		},
 	{ "ST34342A"		,	"ALL"		},
-	{ 0			,	0		}
+	{ NULL			,	NULL		}
 };
 
 static const struct drive_list_entry drive_blacklist [] = {
@@ -138,7 +138,7 @@ static const struct drive_list_entry drive_blacklist [] = {
 	{ "PLEXTOR CD-R PX-W8432T",	"ALL"		},
 	{ "ATAPI CD-ROM DRIVE 40X MAXIMUM",	"ALL"		},
 	{ "_NEC DV5800A",               "ALL"           },  
-	{ 0			,	0		}
+	{ NULL			,	NULL		}
 
 };
 
diff --git a/drivers/ide/ide-floppy.c b/drivers/ide/ide-floppy.c
index 56fec5ca1..7383f44a2 100644
--- a/drivers/ide/ide-floppy.c
+++ b/drivers/ide/ide-floppy.c
@@ -1946,7 +1946,7 @@ static int idefloppy_ioctl(struct inode *inode, struct file *file,
 	ide_drive_t *drive = bdev->bd_disk->private_data;
 	idefloppy_floppy_t *floppy = drive->driver_data;
 	void __user *argp = (void __user *)arg;
-	int err = generic_ide_ioctl(bdev, cmd, arg);
+	int err = generic_ide_ioctl(file, bdev, cmd, arg);
 	int prevent = (arg) ? 1 : 0;
 	idefloppy_pc_t pc;
 	if (err != -EINVAL)
diff --git a/drivers/ide/ide-proc.c b/drivers/ide/ide-proc.c
index 96c8e0021..a3ebd9e12 100644
--- a/drivers/ide/ide-proc.c
+++ b/drivers/ide/ide-proc.c
@@ -321,7 +321,6 @@ static int proc_ide_read_imodel
 		case ide_cy82c693:	name = "cy82c693";	break;
 		case ide_4drives:	name = "4drives";	break;
 		case ide_pmac:		name = "mac-io";	break;
-		case ide_pc9800:	name = "pc9800";	break;
 		default:		name = "(unknown)";	break;
 	}
 	len = sprintf(page, "%s\n", name);
@@ -791,5 +790,5 @@ void proc_ide_destroy(void)
 {
 	remove_proc_entry("ide/drivers", proc_ide_root);
 	destroy_proc_ide_interfaces();
-	remove_proc_entry("ide", 0);
+	remove_proc_entry("ide", NULL);
 }
diff --git a/drivers/ide/ide-tape.c b/drivers/ide/ide-tape.c
index 7603f6a56..d19ee543e 100644
--- a/drivers/ide/ide-tape.c
+++ b/drivers/ide/ide-tape.c
@@ -2674,7 +2674,7 @@ static idetape_stage_t *idetape_kmalloc_stage (idetape_tape_t *tape)
 	return __idetape_kmalloc_stage(tape, 0, 0);
 }
 
-static void idetape_copy_stage_from_user (idetape_tape_t *tape, idetape_stage_t *stage, const char *buf, int n)
+static void idetape_copy_stage_from_user (idetape_tape_t *tape, idetape_stage_t *stage, const char __user *buf, int n)
 {
 	struct idetape_bh *bh = tape->bh;
 	int count;
@@ -2701,7 +2701,7 @@ static void idetape_copy_stage_from_user (idetape_tape_t *tape, idetape_stage_t
 	tape->bh = bh;
 }
 
-static void idetape_copy_stage_to_user (idetape_tape_t *tape, char *buf, idetape_stage_t *stage, int n)
+static void idetape_copy_stage_to_user (idetape_tape_t *tape, char __user *buf, idetape_stage_t *stage, int n)
 {
 	struct idetape_bh *bh = tape->bh;
 	int count;
@@ -3610,6 +3610,7 @@ static int idetape_blkdev_ioctl(ide_drive_t *drive, unsigned int cmd, unsigned l
 {
 	idetape_tape_t *tape = drive->driver_data;
 	idetape_config_t config;
+	void __user *argp = (void __user *)arg;
 
 #if IDETAPE_DEBUG_LOG	
 	if (tape->debug_level >= 4)
@@ -3617,7 +3618,7 @@ static int idetape_blkdev_ioctl(ide_drive_t *drive, unsigned int cmd, unsigned l
 #endif /* IDETAPE_DEBUG_LOG */
 	switch (cmd) {
 		case 0x0340:
-			if (copy_from_user ((char *) &config, (char *) arg, sizeof (idetape_config_t)))
+			if (copy_from_user(&config, argp, sizeof (idetape_config_t)))
 				return -EFAULT;
 			tape->best_dsc_rw_frequency = config.dsc_rw_frequency;
 			tape->max_stages = config.nr_stages;
@@ -3625,7 +3626,7 @@ static int idetape_blkdev_ioctl(ide_drive_t *drive, unsigned int cmd, unsigned l
 		case 0x0350:
 			config.dsc_rw_frequency = (int) tape->best_dsc_rw_frequency;
 			config.nr_stages = tape->max_stages; 
-			if (copy_to_user((char *) arg, (char *) &config, sizeof (idetape_config_t)))
+			if (copy_to_user(argp, &config, sizeof (idetape_config_t)))
 				return -EFAULT;
 			break;
 		default:
@@ -3747,17 +3748,13 @@ static int idetape_space_over_filemarks (ide_drive_t *drive,short mt_op,int mt_c
  *	will no longer hit performance.
  *      This is not applicable to Onstream.
  */
-static ssize_t idetape_chrdev_read (struct file *file, char *buf,
+static ssize_t idetape_chrdev_read (struct file *file, char __user *buf,
 				    size_t count, loff_t *ppos)
 {
 	ide_drive_t *drive = file->private_data;
 	idetape_tape_t *tape = drive->driver_data;
 	ssize_t bytes_read,temp, actually_read = 0, rc;
 
-	if (ppos != &file->f_pos) {
-		/* "A request was outside the capabilities of the device." */
-		return -ENXIO;
-	}
 #if IDETAPE_DEBUG_LOG
 	if (tape->debug_level >= 3)
 		printk(KERN_INFO "ide-tape: Reached idetape_chrdev_read, count %Zd\n", count);
@@ -3810,18 +3807,13 @@ finish:
 	return actually_read;
 }
 
-static ssize_t idetape_chrdev_write (struct file *file, const char *buf,
+static ssize_t idetape_chrdev_write (struct file *file, const char __user *buf,
 				     size_t count, loff_t *ppos)
 {
 	ide_drive_t *drive = file->private_data;
 	idetape_tape_t *tape = drive->driver_data;
 	ssize_t retval, actually_written = 0;
 
-	if (ppos != &file->f_pos) {
-		/* "A request was outside the capabilities of the device." */
-		return -ENXIO;
-	}
-
 	/* The drive is write protected. */
 	if (tape->write_prot)
 		return -EACCES;
@@ -4127,6 +4119,7 @@ static int idetape_chrdev_ioctl (struct inode *inode, struct file *file, unsigne
 	struct mtget mtget;
 	struct mtpos mtpos;
 	int block_offset = 0, position = tape->first_frame_position;
+	void __user *argp = (void __user *)arg;
 
 #if IDETAPE_DEBUG_LOG
 	if (tape->debug_level >= 3)
@@ -4146,7 +4139,7 @@ static int idetape_chrdev_ioctl (struct inode *inode, struct file *file, unsigne
 	}
 	switch (cmd) {
 		case MTIOCTOP:
-			if (copy_from_user((char *) &mtop, (char *) arg, sizeof (struct mtop)))
+			if (copy_from_user(&mtop, argp, sizeof (struct mtop)))
 				return -EFAULT;
 			return (idetape_mtioctop(drive,mtop.mt_op,mtop.mt_count));
 		case MTIOCGET:
@@ -4157,12 +4150,12 @@ static int idetape_chrdev_ioctl (struct inode *inode, struct file *file, unsigne
 			if (tape->drv_write_prot) {
 				mtget.mt_gstat |= GMT_WR_PROT(0xffffffff);
 			}
-			if (copy_to_user((char *) arg,(char *) &mtget, sizeof(struct mtget)))
+			if (copy_to_user(argp, &mtget, sizeof(struct mtget)))
 				return -EFAULT;
 			return 0;
 		case MTIOCPOS:
 			mtpos.mt_blkno = position / tape->user_bs_factor - block_offset;
-			if (copy_to_user((char *) arg,(char *) &mtpos, sizeof(struct mtpos)))
+			if (copy_to_user(argp, &mtpos, sizeof(struct mtpos)))
 				return -EFAULT;
 			return 0;
 		default:
@@ -4185,6 +4178,7 @@ static int idetape_chrdev_open (struct inode *inode, struct file *filp)
 	idetape_pc_t pc;
 	int retval;
 
+	nonseekable_open(inode, filp);
 #if IDETAPE_DEBUG_LOG
 	printk(KERN_INFO "ide-tape: Reached idetape_chrdev_open\n");
 #endif /* IDETAPE_DEBUG_LOG */
@@ -4813,7 +4807,7 @@ static int idetape_ioctl(struct inode *inode, struct file *file,
 {
 	struct block_device *bdev = inode->i_bdev;
 	ide_drive_t *drive = bdev->bd_disk->private_data;
-	int err = generic_ide_ioctl(bdev, cmd, arg);
+	int err = generic_ide_ioctl(file, bdev, cmd, arg);
 	if (err == -EINVAL)
 		err = idetape_blkdev_ioctl(drive, cmd, arg);
 	return err;
diff --git a/drivers/ide/ide-taskfile.c b/drivers/ide/ide-taskfile.c
index 98f4f3e4d..e83c9a9eb 100644
--- a/drivers/ide/ide-taskfile.c
+++ b/drivers/ide/ide-taskfile.c
@@ -53,12 +53,6 @@
 
 #define DEBUG_TASKFILE	0	/* unset when fixed */
 
-#if DEBUG_TASKFILE
-#define DTF(x...) printk(x)
-#else
-#define DTF(x...)
-#endif
-
 static void ata_bswap_data (void *buffer, int wcount)
 {
 	u16 *p = buffer;
@@ -165,7 +159,7 @@ ide_startstop_t do_rw_taskfile (ide_drive_t *drive, ide_task_t *task)
 	hwif->OUTB(taskfile->high_cylinder, IDE_HCYL_REG);
 
 	hwif->OUTB((taskfile->device_head & HIHI) | drive->select.all, IDE_SELECT_REG);
-#ifdef CONFIG_IDE_TASKFILE_IO
+
 	if (task->handler != NULL) {
 		if (task->prehandler != NULL) {
 			hwif->OUTBSYNC(drive, taskfile->command, IDE_COMMAND_REG);
@@ -175,14 +169,6 @@ ide_startstop_t do_rw_taskfile (ide_drive_t *drive, ide_task_t *task)
 		ide_execute_command(drive, taskfile->command, task->handler, WAIT_WORSTCASE, NULL);
 		return ide_started;
 	}
-#else
-	if (task->handler != NULL) {
-		ide_execute_command(drive, taskfile->command, task->handler, WAIT_WORSTCASE, NULL);
-		if (task->prehandler != NULL)
-			return task->prehandler(drive, task->rq);
-		return ide_started;
-	}
-#endif
 
 	if (!drive->using_dma)
 		return ide_stopped;
@@ -283,8 +269,6 @@ ide_startstop_t task_no_data_intr (ide_drive_t *drive)
 
 	local_irq_enable();
 	if (!OK_STAT(stat = hwif->INB(IDE_STATUS_REG),READY_STAT,BAD_STAT)) {
-		DTF("%s: command opcode 0x%02x\n", drive->name,
-			args->tfRegister[IDE_COMMAND_OFFSET]);
 		return DRIVER(drive)->error(drive, "task_no_data_intr", stat);
 		/* calls ide_end_drive_cmd */
 	}
@@ -296,256 +280,72 @@ ide_startstop_t task_no_data_intr (ide_drive_t *drive)
 
 EXPORT_SYMBOL(task_no_data_intr);
 
-/*
- * old taskfile PIO handlers, to be killed as soon as possible.
- */
-#ifndef CONFIG_IDE_TASKFILE_IO
-
-/*
- * Handler for command with PIO data-in phase, READ
- */
-ide_startstop_t task_in_intr (ide_drive_t *drive)
+static void task_buffer_sectors(ide_drive_t *drive, struct request *rq,
+				unsigned nsect, unsigned rw)
 {
-	struct request *rq	= HWGROUP(drive)->rq;
-	ide_hwif_t *hwif	= HWIF(drive);
-	char *pBuf		= NULL;
-	u8 stat;
+	char *buf = rq->buffer + blk_rq_offset(rq);
 
-	if (!OK_STAT(stat = hwif->INB(IDE_STATUS_REG),DATA_READY,BAD_R_STAT)) {
-		if (stat & (ERR_STAT|DRQ_STAT)) {
-			return DRIVER(drive)->error(drive, "task_in_intr", stat);
-		}
-		if (!(stat & BUSY_STAT)) {
-			DTF("task_in_intr to Soon wait for next interrupt\n");
-			if (HWGROUP(drive)->handler == NULL)
-				ide_set_handler(drive, &task_in_intr, WAIT_WORSTCASE, NULL);
-			return ide_started;  
-		}
-	}
-
-	pBuf = rq->buffer + task_rq_offset(rq);
-	DTF("Read: %p, rq->current_nr_sectors: %d, stat: %02x\n",
-		pBuf, (int) rq->current_nr_sectors, stat);
-	taskfile_input_data(drive, pBuf, SECTOR_WORDS);
-
-	/* FIXME: check drive status */
-	if (--rq->current_nr_sectors <= 0)
-		if (!DRIVER(drive)->end_request(drive, 1, 0))
-			return ide_stopped;
-	/*
-	 * ERM, it is techincally legal to leave/exit here but it makes
-	 * a mess of the code ...
-	 */
-	if (HWGROUP(drive)->handler == NULL)
-		ide_set_handler(drive, &task_in_intr, WAIT_WORSTCASE, NULL);
-	return ide_started;
+	rq->sector += nsect;
+	rq->current_nr_sectors -= nsect;
+	rq->nr_sectors -= nsect;
+	__task_sectors(drive, buf, nsect, rw);
 }
 
-EXPORT_SYMBOL(task_in_intr);
-
-/*
- * Handler for command with Read Multiple
- */
-ide_startstop_t task_mulin_intr (ide_drive_t *drive)
+static inline void task_buffer_multi_sectors(ide_drive_t *drive,
+					     struct request *rq, unsigned rw)
 {
-	ide_hwif_t *hwif	= HWIF(drive);
-	struct request *rq	= HWGROUP(drive)->rq;
-	char *pBuf		= NULL;
-	unsigned int msect	= drive->mult_count;
-	unsigned int nsect;
-	u8 stat;
+	unsigned int msect = drive->mult_count, nsect;
 
-	if (!OK_STAT(stat = hwif->INB(IDE_STATUS_REG),DATA_READY,BAD_R_STAT)) {
-		if (stat & (ERR_STAT|DRQ_STAT)) {
-			return DRIVER(drive)->error(drive, "task_mulin_intr", stat);
-		}
-		/* no data yet, so wait for another interrupt */
-		if (HWGROUP(drive)->handler == NULL)
-			ide_set_handler(drive, &task_mulin_intr, WAIT_WORSTCASE, NULL);
-		return ide_started;
-	}
+	nsect = rq->current_nr_sectors;
+	if (nsect > msect)
+		nsect = msect;
 
-	do {
-		nsect = rq->current_nr_sectors;
-		if (nsect > msect)
-			nsect = msect;
-		pBuf = rq->buffer + task_rq_offset(rq);
-		DTF("Multiread: %p, nsect: %d, msect: %d, " \
-			" rq->current_nr_sectors: %d\n",
-			pBuf, nsect, msect, rq->current_nr_sectors);
-		taskfile_input_data(drive, pBuf, nsect * SECTOR_WORDS);
-		rq->errors = 0;
-		rq->current_nr_sectors -= nsect;
-		msect -= nsect;
-
-		/* FIXME: check drive status */
-		if (!rq->current_nr_sectors) {
-			if (!DRIVER(drive)->end_request(drive, 1, 0))
-				return ide_stopped;
-		}
-	} while (msect);
-	if (HWGROUP(drive)->handler == NULL)
-		ide_set_handler(drive, &task_mulin_intr, WAIT_WORSTCASE, NULL);
-	return ide_started;
+	task_buffer_sectors(drive, rq, nsect, rw);
 }
 
-EXPORT_SYMBOL(task_mulin_intr);
-
-/*
- * VERIFY ME before 2.4 ... unexpected race is possible based on details
- * RMK with 74LS245/373/374 TTL buffer logic because of passthrough.
- */
-ide_startstop_t pre_task_out_intr (ide_drive_t *drive, struct request *rq)
-{
-	ide_startstop_t startstop;
-
-	if (ide_wait_stat(&startstop, drive, DATA_READY,
-			drive->bad_wstat, WAIT_DRQ)) {
-		printk(KERN_ERR "%s: no DRQ after issuing WRITE%s\n",
-			drive->name,
-			drive->addressing ? "_EXT" : "");
-		return startstop;
-	}
-	/* For Write_sectors we need to stuff the first sector */
-	taskfile_output_data(drive, rq->buffer + task_rq_offset(rq), SECTOR_WORDS);
-	rq->current_nr_sectors--;
-	return ide_started;
-}
-
-EXPORT_SYMBOL(pre_task_out_intr);
-
-/*
- * Handler for command with PIO data-out phase WRITE
- *
- * WOOHOO this is a CORRECT STATE DIAGRAM NOW, <andre@linux-ide.org>
- */
-ide_startstop_t task_out_intr (ide_drive_t *drive)
+#ifdef CONFIG_IDE_TASKFILE_IO
+static void task_sectors(ide_drive_t *drive, struct request *rq,
+			 unsigned nsect, unsigned rw)
 {
-	ide_hwif_t *hwif	= HWIF(drive);
-	struct request *rq	= HWGROUP(drive)->rq;
-	char *pBuf		= NULL;
-	u8 stat;
-
-	if (!OK_STAT(stat = hwif->INB(IDE_STATUS_REG), DRIVE_READY, drive->bad_wstat)) {
-		return DRIVER(drive)->error(drive, "task_out_intr", stat);
-	}
-	/*
-	 * Safe to update request for partial completions.
-	 * We have a good STATUS CHECK!!!
-	 */
-	if (!rq->current_nr_sectors)
-		if (!DRIVER(drive)->end_request(drive, 1, 0))
-			return ide_stopped;
-	if ((rq->current_nr_sectors==1) ^ (stat & DRQ_STAT)) {
-		rq = HWGROUP(drive)->rq;
-		pBuf = rq->buffer + task_rq_offset(rq);
-		DTF("write: %p, rq->current_nr_sectors: %d\n",
-			pBuf, (int) rq->current_nr_sectors);
-		taskfile_output_data(drive, pBuf, SECTOR_WORDS);
+	if (rq->cbio) {	/* fs request */
 		rq->errors = 0;
-		rq->current_nr_sectors--;
-	}
-	if (HWGROUP(drive)->handler == NULL)
-		ide_set_handler(drive, &task_out_intr, WAIT_WORSTCASE, NULL);
-	return ide_started;
+		task_bio_sectors(drive, rq, nsect, rw);
+	} else		/* task request */
+		task_buffer_sectors(drive, rq, nsect, rw);
 }
 
-EXPORT_SYMBOL(task_out_intr);
-
-ide_startstop_t pre_task_mulout_intr (ide_drive_t *drive, struct request *rq)
-{
-	ide_task_t *args = rq->special;
-	ide_startstop_t startstop;
-
-	if (ide_wait_stat(&startstop, drive, DATA_READY,
-			drive->bad_wstat, WAIT_DRQ)) {
-		printk(KERN_ERR "%s: no DRQ after issuing %s\n",
-			drive->name,
-			drive->addressing ? "MULTWRITE_EXT" : "MULTWRITE");
-		return startstop;
-	}
-	if (!(drive_is_ready(drive))) {
-		int i;
-		for (i=0; i<100; i++) {
-			if (drive_is_ready(drive))
-				break;
-		}
-	}
-
-	/*
-	 * WARNING :: if the drive as not acked good status we may not
-	 * move the DATA-TRANSFER T-Bar as BSY != 0. <andre@linux-ide.org>
-	 */
-	return args->handler(drive);
-}
-
-EXPORT_SYMBOL(pre_task_mulout_intr);
-
-/*
- * Handler for command write multiple
- * Called directly from execute_drive_cmd for the first bunch of sectors,
- * afterwards only by the ISR
- */
-ide_startstop_t task_mulout_intr (ide_drive_t *drive)
+static inline void task_bio_multi_sectors(ide_drive_t *drive,
+					  struct request *rq, unsigned rw)
 {
-	ide_hwif_t *hwif		= HWIF(drive);
-	u8 stat				= hwif->INB(IDE_STATUS_REG);
-	struct request *rq		= HWGROUP(drive)->rq;
-	char *pBuf			= NULL;
-	unsigned int msect		= drive->mult_count;
-	unsigned int nsect;
-
-	if (!OK_STAT(stat, DATA_READY, BAD_R_STAT) || !rq->current_nr_sectors) {
-		if (stat & (ERR_STAT|DRQ_STAT)) {
-			return DRIVER(drive)->error(drive, "task_mulout_intr", stat);
-		}
-		/* Handle last IRQ, occurs after all data was sent. */
-		if (!rq->current_nr_sectors) {
-			DRIVER(drive)->end_request(drive, 1, 0);
-			return ide_stopped;
-		}
-		/* no data yet, so wait for another interrupt */
-		if (HWGROUP(drive)->handler == NULL)
-			ide_set_handler(drive, &task_mulout_intr, WAIT_WORSTCASE, NULL);
-		return ide_started;
-	}
-
-	if (HWGROUP(drive)->handler != NULL) {
-		unsigned long lflags;
-		spin_lock_irqsave(&ide_lock, lflags);
-		HWGROUP(drive)->handler = NULL;
-		del_timer(&HWGROUP(drive)->timer);
-		spin_unlock_irqrestore(&ide_lock, lflags);
-	}
+	unsigned int nsect, msect = drive->mult_count;
 
 	do {
 		nsect = rq->current_nr_sectors;
 		if (nsect > msect)
 			nsect = msect;
-		pBuf = rq->buffer + task_rq_offset(rq);
-		DTF("Multiwrite: %p, nsect: %d, msect: %d, " \
-			"rq->current_nr_sectors: %ld\n",
-			pBuf, nsect, msect, rq->current_nr_sectors);
-		msect -= nsect;
-		taskfile_output_data(drive, pBuf, nsect * SECTOR_WORDS);
-		rq->current_nr_sectors -= nsect;
-
-		/* FIXME: check drive status */
-		if (!rq->current_nr_sectors) {
-			if (!DRIVER(drive)->end_request(drive, 1, 0))
-				if (!rq->bio)
-					return ide_stopped;
-		}
+
+		task_bio_sectors(drive, rq, nsect, rw);
+
+		if (!rq->nr_sectors)
+			msect = 0;
+		else
+			msect -= nsect;
 	} while (msect);
-	rq->errors = 0;
-	if (HWGROUP(drive)->handler == NULL)
-		ide_set_handler(drive, &task_mulout_intr, WAIT_WORSTCASE, NULL);
-	return ide_started;
 }
 
-EXPORT_SYMBOL(task_mulout_intr);
-
-#else /* !CONFIG_IDE_TASKFILE_IO */
+static void task_multi_sectors(ide_drive_t *drive,
+			       struct request *rq, unsigned rw)
+{
+	if (rq->cbio) {	/* fs request */
+		rq->errors = 0;
+		task_bio_multi_sectors(drive, rq, rw);
+	} else		/* task request */
+		task_buffer_multi_sectors(drive, rq, rw);
+}
+#else
+# define task_sectors(d, rq, nsect, rw)	task_buffer_sectors(d, rq, nsect, rw)
+# define task_multi_sectors(d, rq, rw)	task_buffer_multi_sectors(d, rq, rw)
+#endif /* CONFIG_IDE_TASKFILE_IO */
 
 static u8 wait_drive_not_busy(ide_drive_t *drive)
 {
@@ -567,46 +367,61 @@ static u8 wait_drive_not_busy(ide_drive_t *drive)
 	return stat;
 }
 
+#ifdef CONFIG_IDE_TASKFILE_IO
+static ide_startstop_t task_error(ide_drive_t *drive, struct request *rq,
+				  const char *s, u8 stat, unsigned cur_bad)
+{
+	if (rq->bio) {
+		int sectors = rq->hard_nr_sectors - rq->nr_sectors - cur_bad;
+
+		if (sectors > 0)
+			drive->driver->end_request(drive, 1, sectors);
+	}
+	return drive->driver->error(drive, s, stat);
+}
+#else
+# define task_error(d, rq, s, stat, cur_bad) drive->driver->error(d, s, stat)
+#endif
+
+static void task_end_request(ide_drive_t *drive, struct request *rq, u8 stat)
+{
+	if (rq->flags & REQ_DRIVE_TASKFILE) {
+		ide_task_t *task = rq->special;
+
+		if (task->tf_out_flags.all) {
+			u8 err = drive->hwif->INB(IDE_ERROR_REG);
+			ide_end_drive_cmd(drive, stat, err);
+			return;
+		}
+	}
+	drive->driver->end_request(drive, 1, rq->hard_nr_sectors);
+}
+
 /*
  * Handler for command with PIO data-in phase (Read).
  */
 ide_startstop_t task_in_intr (ide_drive_t *drive)
 {
 	struct request *rq = HWGROUP(drive)->rq;
-	u8 stat, good_stat;
+	u8 stat = HWIF(drive)->INB(IDE_STATUS_REG);
 
-	good_stat = DATA_READY;
-	stat = HWIF(drive)->INB(IDE_STATUS_REG);
-check_status:
-	if (!OK_STAT(stat, good_stat, BAD_R_STAT)) {
+	if (!OK_STAT(stat, DATA_READY, BAD_R_STAT)) {
 		if (stat & (ERR_STAT | DRQ_STAT))
-			return DRIVER(drive)->error(drive, __FUNCTION__, stat);
-		/* BUSY_STAT: No data yet, so wait for another IRQ. */
+			return task_error(drive, rq, __FUNCTION__, stat, 0);
+		/* No data yet, so wait for another IRQ. */
 		ide_set_handler(drive, &task_in_intr, WAIT_WORSTCASE, NULL);
 		return ide_started;
 	}
 
-	/*
-	 * Complete previously submitted bios (if any).
-	 * Status was already verifyied.
-	 */
-	while (rq->bio != rq->cbio)
-		if (!DRIVER(drive)->end_request(drive, 1, bio_sectors(rq->bio)))
-			return ide_stopped;
-	/* Complete rq->buffer based request (ioctls). */
-	if (!rq->bio && !rq->nr_sectors) {
-		ide_end_drive_cmd(drive, stat, HWIF(drive)->INB(IDE_ERROR_REG));
-		return ide_stopped;
-	}
-
-	rq->errors = 0;
 	task_sectors(drive, rq, 1, IDE_PIO_IN);
 
 	/* If it was the last datablock check status and finish transfer. */
 	if (!rq->nr_sectors) {
-		good_stat = 0;
 		stat = wait_drive_not_busy(drive);
-		goto check_status;
+		if (!OK_STAT(stat, 0, BAD_R_STAT))
+			return task_error(drive, rq, __FUNCTION__, stat, 1);
+		task_end_request(drive, rq, stat);
+		return ide_stopped;
 	}
 
 	/* Still data left to transfer. */
@@ -622,53 +437,25 @@ EXPORT_SYMBOL(task_in_intr);
 ide_startstop_t task_mulin_intr (ide_drive_t *drive)
 {
 	struct request *rq = HWGROUP(drive)->rq;
-	unsigned int msect = drive->mult_count;
-	unsigned int nsect;
-	u8 stat, good_stat;
+	u8 stat = HWIF(drive)->INB(IDE_STATUS_REG);
 
-	good_stat = DATA_READY;
-	stat = HWIF(drive)->INB(IDE_STATUS_REG);
-check_status:
-	if (!OK_STAT(stat, good_stat, BAD_R_STAT)) {
+	if (!OK_STAT(stat, DATA_READY, BAD_R_STAT)) {
 		if (stat & (ERR_STAT | DRQ_STAT))
-			return DRIVER(drive)->error(drive, __FUNCTION__, stat);
-		/* BUSY_STAT: No data yet, so wait for another IRQ. */
+			return task_error(drive, rq, __FUNCTION__, stat, 0);
+		/* No data yet, so wait for another IRQ. */
 		ide_set_handler(drive, &task_mulin_intr, WAIT_WORSTCASE, NULL);
 		return ide_started;
 	}
 
-	/*
-	 * Complete previously submitted bios (if any).
-	 * Status was already verifyied.
-	 */
-	while (rq->bio != rq->cbio)
-		if (!DRIVER(drive)->end_request(drive, 1, bio_sectors(rq->bio)))
-			return ide_stopped;
-	/* Complete rq->buffer based request (ioctls). */
-	if (!rq->bio && !rq->nr_sectors) {
-		ide_end_drive_cmd(drive, stat, HWIF(drive)->INB(IDE_ERROR_REG));
-		return ide_stopped;
-	}
-
-	rq->errors = 0;
-	do {
-		nsect = rq->current_nr_sectors;
-		if (nsect > msect)
-			nsect = msect;
-
-		task_sectors(drive, rq, nsect, IDE_PIO_IN);
-
-		if (!rq->nr_sectors)
-			msect = 0;
-		else
-			msect -= nsect;
-	} while (msect);
+	task_multi_sectors(drive, rq, IDE_PIO_IN);
 
 	/* If it was the last datablock check status and finish transfer. */
 	if (!rq->nr_sectors) {
-		good_stat = 0;
 		stat = wait_drive_not_busy(drive);
-		goto check_status;
+		if (!OK_STAT(stat, 0, BAD_R_STAT))
+			return task_error(drive, rq, __FUNCTION__, stat, drive->mult_count);
+		task_end_request(drive, rq, stat);
+		return ide_stopped;
 	}
 
 	/* Still data left to transfer. */
@@ -687,40 +474,21 @@ ide_startstop_t task_out_intr (ide_drive_t *drive)
 	u8 stat;
 
 	stat = HWIF(drive)->INB(IDE_STATUS_REG);
-	if (!OK_STAT(stat, DRIVE_READY, drive->bad_wstat)) {
-		if ((stat & (ERR_STAT | DRQ_STAT)) ||
-		    ((stat & WRERR_STAT) && !drive->nowerr))
-			return DRIVER(drive)->error(drive, __FUNCTION__, stat);
-		if (stat & BUSY_STAT) {
-			/* Not ready yet, so wait for another IRQ. */
-			ide_set_handler(drive, &task_out_intr, WAIT_WORSTCASE, NULL);
-			return ide_started;
-		}
-	}
+	if (!OK_STAT(stat, DRIVE_READY, drive->bad_wstat))
+		return task_error(drive, rq, __FUNCTION__, stat, 1);
 
 	/* Deal with unexpected ATA data phase. */
-	if ((!(stat & DATA_READY) && rq->nr_sectors) ||
-	    ((stat & DATA_READY) && !rq->nr_sectors))
-		return DRIVER(drive)->error(drive, __FUNCTION__, stat);
+	if (((stat & DRQ_STAT) == 0) ^ !rq->nr_sectors)
+		return task_error(drive, rq, __FUNCTION__, stat, 1);
 
-	/* 
-	 * Complete previously submitted bios (if any).
-	 * Status was already verifyied.
-	 */
-	while (rq->bio != rq->cbio)
-		if (!DRIVER(drive)->end_request(drive, 1, bio_sectors(rq->bio)))
-			return ide_stopped;
-	/* Complete rq->buffer based request (ioctls). */
-	if (!rq->bio && !rq->nr_sectors) {
-		ide_end_drive_cmd(drive, stat, HWIF(drive)->INB(IDE_ERROR_REG));
+	if (!rq->nr_sectors) {
+		task_end_request(drive, rq, stat);
 		return ide_stopped;
 	}
 
 	/* Still data left to transfer. */
-	ide_set_handler(drive, &task_out_intr, WAIT_WORSTCASE, NULL);
-
-	rq->errors = 0;
 	task_sectors(drive, rq, 1, IDE_PIO_OUT);
+	ide_set_handler(drive, &task_out_intr, WAIT_WORSTCASE, NULL);
 
 	return ide_started;
 }
@@ -741,7 +509,10 @@ ide_startstop_t pre_task_out_intr (ide_drive_t *drive, struct request *rq)
 	if (!drive->unmask)
 		local_irq_disable();
 
-	return task_out_intr(drive);
+	ide_set_handler(drive, &task_out_intr, WAIT_WORSTCASE, NULL);
+	task_sectors(drive, rq, 1, IDE_PIO_OUT);
+
+	return ide_started;
 }
 EXPORT_SYMBOL(pre_task_out_intr);
 
@@ -751,57 +522,25 @@ EXPORT_SYMBOL(pre_task_out_intr);
 ide_startstop_t task_mulout_intr (ide_drive_t *drive)
 {
 	struct request *rq = HWGROUP(drive)->rq;
-	unsigned int msect = drive->mult_count;
-	unsigned int nsect;
 	u8 stat;
 
 	stat = HWIF(drive)->INB(IDE_STATUS_REG);
-	if (!OK_STAT(stat, DRIVE_READY, drive->bad_wstat)) {
-		if ((stat & (ERR_STAT | DRQ_STAT)) ||
-		    ((stat & WRERR_STAT) && !drive->nowerr))
-			return DRIVER(drive)->error(drive, __FUNCTION__, stat);
-		if (stat & BUSY_STAT) {
-			/* Not ready yet, so wait for another IRQ. */
-			ide_set_handler(drive, &task_mulout_intr, WAIT_WORSTCASE, NULL);
-			return ide_started;
-		}
-	}
+	if (!OK_STAT(stat, DRIVE_READY, drive->bad_wstat))
+		return task_error(drive, rq, __FUNCTION__, stat, drive->mult_count);
 
 	/* Deal with unexpected ATA data phase. */
-	if ((!(stat & DATA_READY) && rq->nr_sectors) ||
-	    ((stat & DATA_READY) && !rq->nr_sectors))
-		return DRIVER(drive)->error(drive, __FUNCTION__, stat);
+	if (((stat & DRQ_STAT) == 0) ^ !rq->nr_sectors)
+		return task_error(drive, rq, __FUNCTION__, stat, drive->mult_count);
 
-	/* 
-	 * Complete previously submitted bios (if any).
-	 * Status was already verifyied.
-	 */
-	while (rq->bio != rq->cbio)
-		if (!DRIVER(drive)->end_request(drive, 1, bio_sectors(rq->bio)))
-			return ide_stopped;
-	/* Complete rq->buffer based request (ioctls). */
-	if (!rq->bio && !rq->nr_sectors) {
-		ide_end_drive_cmd(drive, stat, HWIF(drive)->INB(IDE_ERROR_REG));
+	if (!rq->nr_sectors) {
+		task_end_request(drive, rq, stat);
 		return ide_stopped;
 	}
 
 	/* Still data left to transfer. */
+	task_multi_sectors(drive, rq, IDE_PIO_OUT);
 	ide_set_handler(drive, &task_mulout_intr, WAIT_WORSTCASE, NULL);
 
-	rq->errors = 0;
-	do {
-		nsect = rq->current_nr_sectors;
-		if (nsect > msect)
-			nsect = msect;
-
-		task_sectors(drive, rq, nsect, IDE_PIO_OUT);
-
-		if (!rq->nr_sectors)
-			msect = 0;
-		else
-			msect -= nsect;
-	} while (msect);
-
 	return ide_started;
 }
 EXPORT_SYMBOL(task_mulout_intr);
@@ -820,12 +559,13 @@ ide_startstop_t pre_task_mulout_intr (ide_drive_t *drive, struct request *rq)
 	if (!drive->unmask)
 		local_irq_disable();
 
-	return task_mulout_intr(drive);
+	ide_set_handler(drive, &task_mulout_intr, WAIT_WORSTCASE, NULL);
+	task_multi_sectors(drive, rq, IDE_PIO_OUT);
+
+	return ide_started;
 }
 EXPORT_SYMBOL(pre_task_mulout_intr);
 
-#endif /* !CONFIG_IDE_TASKFILE_IO */
-
 int ide_diag_taskfile (ide_drive_t *drive, ide_task_t *args, unsigned long data_size, u8 *buf)
 {
 	struct request rq;
@@ -872,13 +612,6 @@ EXPORT_SYMBOL(ide_raw_taskfile);
 #define MAX_DMA		(256*SECTOR_WORDS)
 
 ide_startstop_t flagged_taskfile(ide_drive_t *, ide_task_t *);
-ide_startstop_t flagged_task_no_data_intr(ide_drive_t *);
-ide_startstop_t flagged_task_in_intr(ide_drive_t *);
-ide_startstop_t flagged_task_mulin_intr(ide_drive_t *);
-ide_startstop_t flagged_pre_task_out_intr(ide_drive_t *, struct request *);
-ide_startstop_t flagged_task_out_intr(ide_drive_t *);
-ide_startstop_t flagged_pre_task_mulout_intr(ide_drive_t *, struct request *);
-ide_startstop_t flagged_task_mulout_intr(ide_drive_t *);
 
 int ide_taskfile_ioctl (ide_drive_t *drive, unsigned int cmd, unsigned long arg)
 {
@@ -977,23 +710,13 @@ int ide_taskfile_ioctl (ide_drive_t *drive, unsigned int cmd, unsigned long arg)
 				err = -EPERM;
 				goto abort;
 			}
-			if (args.tf_out_flags.all != 0) {
-				args.prehandler = &flagged_pre_task_mulout_intr;
-				args.handler = &flagged_task_mulout_intr;
-			} else {
-				args.prehandler = &pre_task_mulout_intr;
-				args.handler = &task_mulout_intr;
-			}
+			args.prehandler = &pre_task_mulout_intr;
+			args.handler = &task_mulout_intr;
 			err = ide_diag_taskfile(drive, &args, taskout, outbuf);
 			break;
 		case TASKFILE_OUT:
-			if (args.tf_out_flags.all != 0) {
-				args.prehandler = &flagged_pre_task_out_intr;
-				args.handler    = &flagged_task_out_intr;
-			} else {
-				args.prehandler = &pre_task_out_intr;
-				args.handler = &task_out_intr;
-			}
+			args.prehandler = &pre_task_out_intr;
+			args.handler = &task_out_intr;
 			err = ide_diag_taskfile(drive, &args, taskout, outbuf);
 			break;
 		case TASKFILE_MULTI_IN:
@@ -1005,27 +728,15 @@ int ide_taskfile_ioctl (ide_drive_t *drive, unsigned int cmd, unsigned long arg)
 				err = -EPERM;
 				goto abort;
 			}
-			if (args.tf_out_flags.all != 0) {
-				args.handler = &flagged_task_mulin_intr;
-			} else {
-				args.handler = &task_mulin_intr;
-			}
+			args.handler = &task_mulin_intr;
 			err = ide_diag_taskfile(drive, &args, taskin, inbuf);
 			break;
 		case TASKFILE_IN:
-			if (args.tf_out_flags.all != 0) {
-				args.handler = &flagged_task_in_intr;
-			} else {
-				args.handler = &task_in_intr;
-			}
+			args.handler = &task_in_intr;
 			err = ide_diag_taskfile(drive, &args, taskin, inbuf);
 			break;
 		case TASKFILE_NO_DATA:
-			if (args.tf_out_flags.all != 0) {
-				args.handler = &flagged_task_no_data_intr;
-			} else {
-				args.handler = &task_no_data_intr;
-			}
+			args.handler = &task_no_data_intr;
 			err = ide_diag_taskfile(drive, &args, 0, NULL);
 			break;
 		default:
@@ -1201,6 +912,14 @@ ide_startstop_t flagged_taskfile (ide_drive_t *drive, ide_task_t *task)
 	void debug_taskfile(drive, task);
 #endif /* CONFIG_IDE_TASK_IOCTL_DEBUG */
 
+	if (task->data_phase == TASKFILE_MULTI_IN ||
+	    task->data_phase == TASKFILE_MULTI_OUT) {
+		if (!drive->mult_count) {
+			printk(KERN_ERR "%s: multimode not set!\n", drive->name);
+			return ide_stopped;
+		}
+	}
+
 	/*
 	 * (ks) Check taskfile in/out flags.
 	 * If set, then execute as it is defined.
@@ -1290,277 +1009,15 @@ ide_startstop_t flagged_taskfile (ide_drive_t *drive, ide_task_t *task)
 				return ide_stopped;
 
 			/* Issue the command */
+			if (task->prehandler) {
+				hwif->OUTBSYNC(drive, taskfile->command, IDE_COMMAND_REG);
+				ndelay(400);	/* FIXME */
+				return task->prehandler(drive, task->rq);
+			}
 			ide_execute_command(drive, taskfile->command, task->handler, WAIT_WORSTCASE, NULL);
-			if (task->prehandler != NULL)
-				return task->prehandler(drive, HWGROUP(drive)->rq);
 	}
 
 	return ide_started;
 }
 
 EXPORT_SYMBOL(flagged_taskfile);
-
-ide_startstop_t flagged_task_no_data_intr (ide_drive_t *drive)
-{
-	ide_hwif_t *hwif = HWIF(drive);
-	u8 stat;
-
-	local_irq_enable();
-
-	if (!OK_STAT(stat = hwif->INB(IDE_STATUS_REG), READY_STAT, BAD_STAT)) {
-		if (stat & ERR_STAT) {
-			return DRIVER(drive)->error(drive, "flagged_task_no_data_intr", stat);
-		}
-		/*
-		 * (ks) Unexpected ATA data phase detected.
-		 * This should not happen. But, it can !
-		 * I am not sure, which function is best to clean up
-		 * this situation.  I choose: ide_error(...)
-		 */
- 		return DRIVER(drive)->error(drive, "flagged_task_no_data_intr (unexpected phase)", stat); 
-	}
-
-	ide_end_drive_cmd(drive, stat, hwif->INB(IDE_ERROR_REG));
-
-	return ide_stopped;
-}
-
-/*
- * Handler for command with PIO data-in phase
- */
-ide_startstop_t flagged_task_in_intr (ide_drive_t *drive)
-{
-	ide_hwif_t *hwif	= HWIF(drive);
-	u8 stat			= hwif->INB(IDE_STATUS_REG);
-	struct request *rq	= HWGROUP(drive)->rq;
-	char *pBuf		= NULL;
-	int retries             = 5;
-
-	if (!OK_STAT(stat, DATA_READY, BAD_R_STAT)) {
-		if (stat & ERR_STAT) {
-			return DRIVER(drive)->error(drive, "flagged_task_in_intr", stat);
-		}
-		/*
-		 * (ks) Unexpected ATA data phase detected.
-		 * This should not happen. But, it can !
-		 * I am not sure, which function is best to clean up
-		 * this situation.  I choose: ide_error(...)
-		 */
-		return DRIVER(drive)->error(drive, "flagged_task_in_intr (unexpected data phase)", stat); 
-	}
-
-	pBuf = rq->buffer + ((rq->nr_sectors - rq->current_nr_sectors) * SECTOR_SIZE);
-	DTF("Read - rq->current_nr_sectors: %d, status: %02x\n", (int) rq->current_nr_sectors, stat);
-
-	taskfile_input_data(drive, pBuf, SECTOR_WORDS);
-
-	if (--rq->current_nr_sectors != 0) {
-		/*
-                 * (ks) We don't know which command was executed. 
-		 * So, we wait the 'WORSTCASE' value.
-                 */
-		ide_set_handler(drive, &flagged_task_in_intr,  WAIT_WORSTCASE, NULL);
-		return ide_started;
-	}
-	/*
-	 * (ks) Last sector was transfered, wait until drive is ready. 
-	 * This can take up to 10 usec. We willl wait max 50 us.
-	 */
-	while (((stat = hwif->INB(IDE_STATUS_REG)) & BUSY_STAT) && retries--)
-		udelay(10);
-	ide_end_drive_cmd (drive, stat, hwif->INB(IDE_ERROR_REG));
-
-	return ide_stopped;
-}
-
-ide_startstop_t flagged_task_mulin_intr (ide_drive_t *drive)
-{
-	ide_hwif_t *hwif	= HWIF(drive);
-	u8 stat			= hwif->INB(IDE_STATUS_REG);
-	struct request *rq	= HWGROUP(drive)->rq;
-	char *pBuf		= NULL;
-	int retries             = 5;
-	unsigned int msect, nsect;
-
-	msect = drive->mult_count;
-	if (msect == 0) 
-		return DRIVER(drive)->error(drive, "flagged_task_mulin_intr (multimode not set)", stat); 
-
-	if (!OK_STAT(stat, DATA_READY, BAD_R_STAT)) {
-		if (stat & ERR_STAT) {
-			return DRIVER(drive)->error(drive, "flagged_task_mulin_intr", stat);
-		}
-		/*
-		 * (ks) Unexpected ATA data phase detected.
-		 * This should not happen. But, it can !
-		 * I am not sure, which function is best to clean up
-		 * this situation.  I choose: ide_error(...)
-		 */
-		return DRIVER(drive)->error(drive, "flagged_task_mulin_intr (unexpected data phase)", stat); 
-	}
-
-	nsect = (rq->current_nr_sectors > msect) ? msect : rq->current_nr_sectors;
-	pBuf = rq->buffer + ((rq->nr_sectors - rq->current_nr_sectors) * SECTOR_SIZE);
-
-	DTF("Multiread: %p, nsect: %d , rq->current_nr_sectors: %ld\n",
-	    pBuf, nsect, rq->current_nr_sectors);
-
-	taskfile_input_data(drive, pBuf, nsect * SECTOR_WORDS);
-
-	rq->current_nr_sectors -= nsect;
-	if (rq->current_nr_sectors != 0) {
-		/*
-                 * (ks) We don't know which command was executed. 
-		 * So, we wait the 'WORSTCASE' value.
-                 */
-		ide_set_handler(drive, &flagged_task_mulin_intr,  WAIT_WORSTCASE, NULL);
-		return ide_started;
-	}
-
-	/*
-	 * (ks) Last sector was transfered, wait until drive is ready. 
-	 * This can take up to 10 usec. We willl wait max 50 us.
-	 */
-	while (((stat = hwif->INB(IDE_STATUS_REG)) & BUSY_STAT) && retries--)
-		udelay(10);
-	ide_end_drive_cmd (drive, stat, hwif->INB(IDE_ERROR_REG));
-
-	return ide_stopped;
-}
-
-/*
- * Pre handler for command with PIO data-out phase
- */
-ide_startstop_t flagged_pre_task_out_intr (ide_drive_t *drive, struct request *rq)
-{
-	ide_startstop_t startstop;
-
-	if (ide_wait_stat(&startstop, drive, DATA_READY,
-			BAD_W_STAT, WAIT_DRQ)) {
-		printk(KERN_ERR "%s: No DRQ bit after issuing write command.\n", drive->name);
-		return startstop;
-	}
-
-	taskfile_output_data(drive, rq->buffer, SECTOR_WORDS);
-	--rq->current_nr_sectors;
-
-	return ide_started;
-}
-
-ide_startstop_t flagged_task_out_intr (ide_drive_t *drive)
-{
-	ide_hwif_t *hwif	= HWIF(drive);
-	u8 stat			= hwif->INB(IDE_STATUS_REG);
-	struct request *rq	= HWGROUP(drive)->rq;
-	char *pBuf		= NULL;
-
-	if (!OK_STAT(stat, DRIVE_READY, BAD_W_STAT)) 
-		return DRIVER(drive)->error(drive, "flagged_task_out_intr", stat);
-	
-	if (!rq->current_nr_sectors) { 
-		ide_end_drive_cmd (drive, stat, hwif->INB(IDE_ERROR_REG));
-		return ide_stopped;
-	}
-
-	if (!OK_STAT(stat, DATA_READY, BAD_W_STAT)) {
-		/*
-		 * (ks) Unexpected ATA data phase detected.
-		 * This should not happen. But, it can !
-		 * I am not sure, which function is best to clean up
-		 * this situation.  I choose: ide_error(...)
-		 */
-		return DRIVER(drive)->error(drive, "flagged_task_out_intr (unexpected data phase)", stat); 
-	}
-
-	pBuf = rq->buffer + ((rq->nr_sectors - rq->current_nr_sectors) * SECTOR_SIZE);
-	DTF("Write - rq->current_nr_sectors: %d, status: %02x\n",
-		(int) rq->current_nr_sectors, stat);
-
-	taskfile_output_data(drive, pBuf, SECTOR_WORDS);
-	--rq->current_nr_sectors;
-
-	/*
-	 * (ks) We don't know which command was executed. 
-	 * So, we wait the 'WORSTCASE' value.
-	 */
-	ide_set_handler(drive, &flagged_task_out_intr, WAIT_WORSTCASE, NULL);
-
-	return ide_started;
-}
-
-ide_startstop_t flagged_pre_task_mulout_intr (ide_drive_t *drive, struct request *rq)
-{
-	ide_hwif_t *hwif	= HWIF(drive);
-	u8 stat			= hwif->INB(IDE_STATUS_REG);
-	char *pBuf		= NULL;
-	ide_startstop_t startstop;
-	unsigned int msect, nsect;
-
-	msect = drive->mult_count;
-	if (msect == 0)
-		return DRIVER(drive)->error(drive, "flagged_pre_task_mulout_intr (multimode not set)", stat);
-
-	if (ide_wait_stat(&startstop, drive, DATA_READY,
-			BAD_W_STAT, WAIT_DRQ)) {
-		printk(KERN_ERR "%s: No DRQ bit after issuing write command.\n", drive->name);
-		return startstop;
-	}
-
-	nsect = (rq->current_nr_sectors > msect) ? msect : rq->current_nr_sectors;
-	pBuf = rq->buffer + ((rq->nr_sectors - rq->current_nr_sectors) * SECTOR_SIZE);
-	DTF("Multiwrite: %p, nsect: %d , rq->current_nr_sectors: %ld\n",
-	    pBuf, nsect, rq->current_nr_sectors);
-
-	taskfile_output_data(drive, pBuf, nsect * SECTOR_WORDS);
-
-	rq->current_nr_sectors -= nsect;
-
-	return ide_started;
-}
-
-ide_startstop_t flagged_task_mulout_intr (ide_drive_t *drive)
-{
-	ide_hwif_t *hwif	= HWIF(drive);
-	u8 stat			= hwif->INB(IDE_STATUS_REG);
-	struct request *rq	= HWGROUP(drive)->rq;
-	char *pBuf		= NULL;
-	unsigned int msect, nsect;
-
-	msect = drive->mult_count;
-	if (msect == 0)
-		return DRIVER(drive)->error(drive, "flagged_task_mulout_intr (multimode not set)", stat);
-
-	if (!OK_STAT(stat, DRIVE_READY, BAD_W_STAT)) 
-		return DRIVER(drive)->error(drive, "flagged_task_mulout_intr", stat);
-	
-	if (!rq->current_nr_sectors) { 
-		ide_end_drive_cmd (drive, stat, hwif->INB(IDE_ERROR_REG));
-		return ide_stopped;
-	}
-
-	if (!OK_STAT(stat, DATA_READY, BAD_W_STAT)) {
-		/*
-		 * (ks) Unexpected ATA data phase detected.
-		 * This should not happen. But, it can !
-		 * I am not sure, which function is best to clean up
-		 * this situation.  I choose: ide_error(...)
-		 */
-		return DRIVER(drive)->error(drive, "flagged_task_mulout_intr (unexpected data phase)", stat); 
-	}
-
-	nsect = (rq->current_nr_sectors > msect) ? msect : rq->current_nr_sectors;
-	pBuf = rq->buffer + ((rq->nr_sectors - rq->current_nr_sectors) * SECTOR_SIZE);
-	DTF("Multiwrite: %p, nsect: %d , rq->current_nr_sectors: %ld\n",
-	    pBuf, nsect, rq->current_nr_sectors);
-
-	taskfile_output_data(drive, pBuf, nsect * SECTOR_WORDS);
-	rq->current_nr_sectors -= nsect;
-
-	/*
-	 * (ks) We don't know which command was executed. 
-	 * So, we wait the 'WORSTCASE' value.
-	 */
-	ide_set_handler(drive, &flagged_task_mulout_intr, WAIT_WORSTCASE, NULL);
-
-	return ide_started;
-}
diff --git a/drivers/ide/ide.c b/drivers/ide/ide.c
index 2714aa1a3..e99d9ec19 100644
--- a/drivers/ide/ide.c
+++ b/drivers/ide/ide.c
@@ -1453,8 +1453,8 @@ static int generic_ide_resume(struct device *dev)
 	return ide_do_drive_cmd(drive, &rq, ide_head_wait);
 }
 
-int generic_ide_ioctl(struct block_device *bdev, unsigned int cmd,
-			unsigned long arg)
+int generic_ide_ioctl(struct file *file, struct block_device *bdev,
+			unsigned int cmd, unsigned long arg)
 {
 	ide_drive_t *drive = bdev->bd_disk->private_data;
 	ide_settings_t *setting;
@@ -1605,7 +1605,7 @@ int generic_ide_ioctl(struct block_device *bdev, unsigned int cmd,
 
 		case CDROMEJECT:
 		case CDROMCLOSETRAY:
-			return scsi_cmd_ioctl(bdev->bd_disk, cmd, p);
+			return scsi_cmd_ioctl(file, bdev->bd_disk, cmd, p);
 
 		case HDIO_GET_BUSSTATE:
 			if (!capable(CAP_SYS_ADMIN))
@@ -2320,7 +2320,7 @@ int __init ide_init (void)
 	init_ide_data();
 
 #ifdef CONFIG_PROC_FS
-	proc_ide_root = proc_mkdir("ide", 0);
+	proc_ide_root = proc_mkdir("ide", NULL);
 #endif
 
 #ifdef CONFIG_BLK_DEV_ALI14XX
diff --git a/drivers/ide/legacy/hd.c b/drivers/ide/legacy/hd.c
index 05ea9a705..5d35808ac 100644
--- a/drivers/ide/legacy/hd.c
+++ b/drivers/ide/legacy/hd.c
@@ -660,7 +660,7 @@ static int hd_ioctl(struct inode * inode, struct file * file,
 	unsigned int cmd, unsigned long arg)
 {
 	struct hd_i_struct *disk = inode->i_bdev->bd_disk->private_data;
-	struct hd_geometry *loc = (struct hd_geometry *) arg;
+	struct hd_geometry __user *loc = (struct hd_geometry __user *) arg;
 	struct hd_geometry g; 
 
 	if (cmd != HDIO_GETGEO)
diff --git a/drivers/ide/legacy/ide-cs.c b/drivers/ide/legacy/ide-cs.c
index fb7ae0006..3147d9099 100644
--- a/drivers/ide/legacy/ide-cs.c
+++ b/drivers/ide/legacy/ide-cs.c
@@ -199,6 +199,16 @@ static void ide_detach(dev_link_t *link)
     
 } /* ide_detach */
 
+static int idecs_register(unsigned long io, unsigned long ctl, unsigned long irq)
+{
+    hw_regs_t hw;
+    memset(&hw, 0, sizeof(hw));
+    ide_init_hwif_ports(&hw, io, ctl, NULL);
+    hw.irq = irq;
+    hw.chipset = ide_pci;
+    return ide_register_hw(&hw, NULL);
+}
+
 /*======================================================================
 
     ide_config() is scheduled to run after a CARD_INSERTION event
@@ -210,84 +220,82 @@ static void ide_detach(dev_link_t *link)
 #define CS_CHECK(fn, ret) \
 do { last_fn = (fn); if ((last_ret = (ret)) != 0) goto cs_failed; } while (0)
 
-static int idecs_register(unsigned long io, unsigned long ctl, unsigned long irq)
-{
-    hw_regs_t hw;
-    memset(&hw, 0, sizeof(hw));
-    ide_init_hwif_ports(&hw, io, ctl, NULL);
-    hw.irq = irq;
-    hw.chipset = ide_pci;
-    return ide_register_hw(&hw, NULL);
-}
-
 void ide_config(dev_link_t *link)
 {
     client_handle_t handle = link->handle;
     ide_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 };
-    int i, pass, last_ret, last_fn, hd, is_kme = 0;
+    struct {
+	u_short		buf[128];
+	cisparse_t	parse;
+	config_info_t	conf;
+	cistpl_cftable_entry_t dflt;
+    } *stk = NULL;
+    cistpl_cftable_entry_t *cfg;
+    int i, pass, last_ret = 0, last_fn = 0, hd, is_kme = 0;
     unsigned long io_base, ctl_base;
 
     DEBUG(0, "ide_config(0x%p)\n", link);
-    
-    tuple.TupleData = (cisdata_t *)buf;
-    tuple.TupleOffset = 0; tuple.TupleDataMax = 255;
+
+    stk = kmalloc(sizeof(*stk), GFP_KERNEL);
+    if (!stk) goto err_mem;
+    memset(stk, 0, sizeof(*stk));
+    cfg = &stk->parse.cftable_entry;
+
+    tuple.TupleData = (cisdata_t *)&stk->buf;
+    tuple.TupleOffset = 0;
+    tuple.TupleDataMax = 255;
     tuple.Attributes = 0;
     tuple.DesiredTuple = CISTPL_CONFIG;
     CS_CHECK(GetFirstTuple, pcmcia_get_first_tuple(handle, &tuple));
     CS_CHECK(GetTupleData, pcmcia_get_tuple_data(handle, &tuple));
-    CS_CHECK(ParseTuple, pcmcia_parse_tuple(handle, &tuple, &parse));
-    link->conf.ConfigBase = parse.config.base;
-    link->conf.Present = parse.config.rmask[0];
+    CS_CHECK(ParseTuple, pcmcia_parse_tuple(handle, &tuple, &stk->parse));
+    link->conf.ConfigBase = stk->parse.config.base;
+    link->conf.Present = stk->parse.config.rmask[0];
 
     tuple.DesiredTuple = CISTPL_MANFID;
     if (!pcmcia_get_first_tuple(handle, &tuple) &&
 	!pcmcia_get_tuple_data(handle, &tuple) &&
-	!pcmcia_parse_tuple(handle, &tuple, &parse))
-	is_kme = ((parse.manfid.manf == MANFID_KME) &&
-		  ((parse.manfid.card == PRODID_KME_KXLC005_A) ||
-		   (parse.manfid.card == PRODID_KME_KXLC005_B)));
+	!pcmcia_parse_tuple(handle, &tuple, &stk->parse))
+	is_kme = ((stk->parse.manfid.manf == MANFID_KME) &&
+		  ((stk->parse.manfid.card == PRODID_KME_KXLC005_A) ||
+		   (stk->parse.manfid.card == PRODID_KME_KXLC005_B)));
 
     /* Configure card */
     link->state |= DEV_CONFIG;
 
     /* Not sure if this is right... look up the current Vcc */
-    CS_CHECK(GetConfigurationInfo, pcmcia_get_configuration_info(handle, &conf));
-    link->conf.Vcc = conf.Vcc;
-    
+    CS_CHECK(GetConfigurationInfo, pcmcia_get_configuration_info(handle, &stk->conf));
+    link->conf.Vcc = stk->conf.Vcc;
+
     pass = io_base = ctl_base = 0;
     tuple.DesiredTuple = CISTPL_CFTABLE_ENTRY;
     tuple.Attributes = 0;
     CS_CHECK(GetFirstTuple, pcmcia_get_first_tuple(handle, &tuple));
     while (1) {
     	if (pcmcia_get_tuple_data(handle, &tuple) != 0) goto next_entry;
-	if (pcmcia_parse_tuple(handle, &tuple, &parse) != 0) goto next_entry;
+	if (pcmcia_parse_tuple(handle, &tuple, &stk->parse) != 0) goto next_entry;
 
 	/* Check for matching Vcc, unless we're desperate */
 	if (!pass) {
-	    if (cfg->vcc.present & (1<<CISTPL_POWER_VNOM)) {
-		if (conf.Vcc != cfg->vcc.param[CISTPL_POWER_VNOM]/10000)
+	    if (cfg->vcc.present & (1 << CISTPL_POWER_VNOM)) {
+		if (stk->conf.Vcc != cfg->vcc.param[CISTPL_POWER_VNOM] / 10000)
 		    goto next_entry;
-	    } else if (dflt.vcc.present & (1<<CISTPL_POWER_VNOM)) {
-		if (conf.Vcc != dflt.vcc.param[CISTPL_POWER_VNOM]/10000)
+	    } else if (stk->dflt.vcc.present & (1 << CISTPL_POWER_VNOM)) {
+		if (stk->conf.Vcc != stk->dflt.vcc.param[CISTPL_POWER_VNOM] / 10000)
 		    goto next_entry;
 	    }
 	}
-	
-	if (cfg->vpp1.present & (1<<CISTPL_POWER_VNOM))
+
+	if (cfg->vpp1.present & (1 << CISTPL_POWER_VNOM))
 	    link->conf.Vpp1 = link->conf.Vpp2 =
-		cfg->vpp1.param[CISTPL_POWER_VNOM]/10000;
-	else if (dflt.vpp1.present & (1<<CISTPL_POWER_VNOM))
+		cfg->vpp1.param[CISTPL_POWER_VNOM] / 10000;
+	else if (stk->dflt.vpp1.present & (1 << CISTPL_POWER_VNOM))
 	    link->conf.Vpp1 = link->conf.Vpp2 =
-		dflt.vpp1.param[CISTPL_POWER_VNOM]/10000;
-	
-	if ((cfg->io.nwin > 0) || (dflt.io.nwin > 0)) {
-	    cistpl_io_t *io = (cfg->io.nwin) ? &cfg->io : &dflt.io;
+		stk->dflt.vpp1.param[CISTPL_POWER_VNOM] / 10000;
+
+	if ((cfg->io.nwin > 0) || (stk->dflt.io.nwin > 0)) {
+	    cistpl_io_t *io = (cfg->io.nwin) ? &cfg->io : &stk->dflt.io;
 	    link->conf.ConfigIndex = cfg->index;
 	    link->io.BasePort1 = io->win[0].base;
 	    link->io.IOAddrLines = io->flags & CISTPL_IO_LINES_MASK;
@@ -307,54 +315,52 @@ void ide_config(dev_link_t *link)
 		if (pcmcia_request_io(link->handle, &link->io) != 0)
 			goto next_entry;
 		io_base = link->io.BasePort1;
-		ctl_base = link->io.BasePort1+0x0e;
+		ctl_base = link->io.BasePort1 + 0x0e;
 	    } else goto next_entry;
 	    /* If we've got this far, we're done */
 	    break;
 	}
-	
+
     next_entry:
-	if (cfg->flags & CISTPL_CFTABLE_DEFAULT) dflt = *cfg;
+	if (cfg->flags & CISTPL_CFTABLE_DEFAULT)
+	    memcpy(&stk->dflt, cfg, sizeof(stk->dflt));
 	if (pass) {
 	    CS_CHECK(GetNextTuple, pcmcia_get_next_tuple(handle, &tuple));
 	} else if (pcmcia_get_next_tuple(handle, &tuple) != 0) {
 	    CS_CHECK(GetFirstTuple, pcmcia_get_first_tuple(handle, &tuple));
-	    memset(&dflt, 0, sizeof(dflt));
+	    memset(&stk->dflt, 0, sizeof(stk->dflt));
 	    pass++;
 	}
     }
-    
+
     CS_CHECK(RequestIRQ, pcmcia_request_irq(handle, &link->irq));
     CS_CHECK(RequestConfiguration, pcmcia_request_configuration(handle, &link->conf));
 
-    /* deal with brain dead IDE resource management */
-    release_region(link->io.BasePort1, link->io.NumPorts1);
-    if (link->io.NumPorts2)
-	release_region(link->io.BasePort2, link->io.NumPorts2);
-
     /* disable drive interrupts during IDE probe */
     outb(0x02, ctl_base);
 
     /* special setup for KXLC005 card */
-    if (is_kme) outb(0x81, ctl_base+1);
+    if (is_kme)
+	outb(0x81, ctl_base+1);
 
     /* retry registration in case device is still spinning up */
     for (hd = -1, i = 0; i < 10; i++) {
 	hd = idecs_register(io_base, ctl_base, link->irq.AssignedIRQ);
 	if (hd >= 0) break;
 	if (link->io.NumPorts1 == 0x20) {
-	    outb(0x02, ctl_base+0x10);
-	    hd = idecs_register(io_base+0x10, ctl_base+0x10,
+	    outb(0x02, ctl_base + 0x10);
+	    hd = idecs_register(io_base + 0x10, ctl_base + 0x10,
 				link->irq.AssignedIRQ);
 	    if (hd >= 0) {
-		io_base += 0x10; ctl_base += 0x10;
+		io_base += 0x10;
+		ctl_base += 0x10;
 		break;
 	    }
 	}
 	__set_current_state(TASK_UNINTERRUPTIBLE);
 	schedule_timeout(HZ/10);
     }
-    
+
     if (hd < 0) {
 	printk(KERN_NOTICE "ide-cs: ide_register() at 0x%3lx & 0x%3lx"
 	       ", irq %u failed\n", io_base, ctl_base,
@@ -363,24 +369,29 @@ void ide_config(dev_link_t *link)
     }
 
     info->ndev = 1;
-    sprintf(info->node.dev_name, "hd%c", 'a'+(hd*2));
+    sprintf(info->node.dev_name, "hd%c", 'a' + (hd * 2));
     info->node.major = ide_major[hd];
     info->node.minor = 0;
     info->hd = hd;
     link->dev = &info->node;
     printk(KERN_INFO "ide-cs: %s: Vcc = %d.%d, Vpp = %d.%d\n",
-	   info->node.dev_name, link->conf.Vcc/10, link->conf.Vcc%10,
-	   link->conf.Vpp1/10, link->conf.Vpp1%10);
+	   info->node.dev_name, link->conf.Vcc / 10, link->conf.Vcc % 10,
+	   link->conf.Vpp1 / 10, link->conf.Vpp1 % 10);
 
     link->state &= ~DEV_CONFIG_PENDING;
+    kfree(stk);
     return;
-    
+
+err_mem:
+    printk(KERN_NOTICE "ide-cs: ide_config failed memory allocation\n");
+    goto failed;
+
 cs_failed:
     cs_error(link->handle, last_fn, last_ret);
 failed:
+    kfree(stk);
     ide_release(link);
     link->state &= ~DEV_CONFIG_PENDING;
-
 } /* ide_config */
 
 /*======================================================================
diff --git a/drivers/ide/legacy/pdc4030.c b/drivers/ide/legacy/pdc4030.c
index 73e833d0f..c07d341d1 100644
--- a/drivers/ide/legacy/pdc4030.c
+++ b/drivers/ide/legacy/pdc4030.c
@@ -355,7 +355,7 @@ read_next:
 #endif /* DEBUG_READ */
 
 #ifdef CONFIG_IDE_TASKFILE_IO
-	task_sectors(drive, rq, nsect, IDE_PIO_IN);
+	task_bio_sectors(drive, rq, nsect, IDE_PIO_IN);
 
 	/* FIXME: can we check status after transfer on pdc4030? */
 	/* Complete previously submitted bios. */
@@ -478,7 +478,7 @@ static void promise_multwrite (ide_drive_t *drive, unsigned int msect)
 		if (nsect > msect)
 			nsect = msect;
 
-		task_sectors(drive, rq, nsect, IDE_PIO_OUT);
+		task_bio_sectors(drive, rq, nsect, IDE_PIO_OUT);
 
 		if (!rq->nr_sectors)
 			msect = 0;
diff --git a/drivers/ide/pci/amd74xx.c b/drivers/ide/pci/amd74xx.c
index d6b052300..30bdcb3ec 100644
--- a/drivers/ide/pci/amd74xx.c
+++ b/drivers/ide/pci/amd74xx.c
@@ -71,11 +71,7 @@ static struct amd_ide_chip {
 	{ PCI_DEVICE_ID_NVIDIA_NFORCE3S_SATA,	0x50, AMD_UDMA_133 },
 	{ PCI_DEVICE_ID_NVIDIA_NFORCE3S_SATA2,	0x50, AMD_UDMA_133 },
 	{ PCI_DEVICE_ID_NVIDIA_NFORCE_CK804_IDE,	0x50, AMD_UDMA_133 },
-	{ PCI_DEVICE_ID_NVIDIA_NFORCE_CK804_SATA,	0x50, AMD_UDMA_133 },
-	{ PCI_DEVICE_ID_NVIDIA_NFORCE_CK804_SATA2,	0x50, AMD_UDMA_133 },
 	{ PCI_DEVICE_ID_NVIDIA_NFORCE_MCP04_IDE,	0x50, AMD_UDMA_133 },
-	{ PCI_DEVICE_ID_NVIDIA_NFORCE_MCP04_SATA,	0x50, AMD_UDMA_133 },
-	{ PCI_DEVICE_ID_NVIDIA_NFORCE_MCP04_SATA2,	0x50, AMD_UDMA_133 },
 	{ 0 }
 };
 
@@ -487,11 +483,7 @@ static ide_pci_device_t amd74xx_chipsets[] __devinitdata = {
 	/* 11 */ DECLARE_NV_DEV("NFORCE3-250-SATA"),
 	/* 12 */ DECLARE_NV_DEV("NFORCE3-250-SATA2"),
 	/* 13 */ DECLARE_NV_DEV("NFORCE-CK804"),
-	/* 14 */ DECLARE_NV_DEV("NFORCE-CK804-SATA"),
-	/* 15 */ DECLARE_NV_DEV("NFORCE-CK804-SATA2"),
-	/* 16 */ DECLARE_NV_DEV("NFORCE-MCP04"),
-	/* 17 */ DECLARE_NV_DEV("NFORCE-MCP04-SATA"),
-	/* 18 */ DECLARE_NV_DEV("NFORCE-MCP04-SATA2")
+	/* 14 */ DECLARE_NV_DEV("NFORCE-MCP04"),
 };
 
 static int __devinit amd74xx_probe(struct pci_dev *dev, const struct pci_device_id *id)
@@ -512,17 +504,17 @@ static struct pci_device_id amd74xx_pci_tbl[] = {
 	{ PCI_VENDOR_ID_NVIDIA, PCI_DEVICE_ID_NVIDIA_NFORCE_IDE,	PCI_ANY_ID, PCI_ANY_ID, 0, 0,  5 },
 	{ PCI_VENDOR_ID_NVIDIA, PCI_DEVICE_ID_NVIDIA_NFORCE2_IDE,	PCI_ANY_ID, PCI_ANY_ID, 0, 0,  6 },
 	{ PCI_VENDOR_ID_NVIDIA, PCI_DEVICE_ID_NVIDIA_NFORCE2S_IDE,	PCI_ANY_ID, PCI_ANY_ID, 0, 0,  7 },
+#ifdef CONFIG_BLK_DEV_IDE_SATA
 	{ PCI_VENDOR_ID_NVIDIA, PCI_DEVICE_ID_NVIDIA_NFORCE2S_SATA,	PCI_ANY_ID, PCI_ANY_ID, 0, 0,  8 },
+#endif
 	{ PCI_VENDOR_ID_NVIDIA, PCI_DEVICE_ID_NVIDIA_NFORCE3_IDE,	PCI_ANY_ID, PCI_ANY_ID, 0, 0,  9 },
 	{ PCI_VENDOR_ID_NVIDIA, PCI_DEVICE_ID_NVIDIA_NFORCE3S_IDE,	PCI_ANY_ID, PCI_ANY_ID, 0, 0, 10 },
+#ifdef CONFIG_BLK_DEV_IDE_SATA
 	{ PCI_VENDOR_ID_NVIDIA, PCI_DEVICE_ID_NVIDIA_NFORCE3S_SATA,	PCI_ANY_ID, PCI_ANY_ID, 0, 0, 11 },
 	{ PCI_VENDOR_ID_NVIDIA, PCI_DEVICE_ID_NVIDIA_NFORCE3S_SATA2,	PCI_ANY_ID, PCI_ANY_ID, 0, 0, 12 },
+#endif
 	{ PCI_VENDOR_ID_NVIDIA, PCI_DEVICE_ID_NVIDIA_NFORCE_CK804_IDE,	PCI_ANY_ID, PCI_ANY_ID, 0, 0, 13 },
-	{ PCI_VENDOR_ID_NVIDIA, PCI_DEVICE_ID_NVIDIA_NFORCE_CK804_SATA,	PCI_ANY_ID, PCI_ANY_ID, 0, 0, 14 },
-	{ PCI_VENDOR_ID_NVIDIA, PCI_DEVICE_ID_NVIDIA_NFORCE_CK804_SATA2, PCI_ANY_ID, PCI_ANY_ID, 0, 0, 15 },
-	{ PCI_VENDOR_ID_NVIDIA, PCI_DEVICE_ID_NVIDIA_NFORCE_MCP04_IDE,	PCI_ANY_ID, PCI_ANY_ID, 0, 0, 16 },
-	{ PCI_VENDOR_ID_NVIDIA, PCI_DEVICE_ID_NVIDIA_NFORCE_MCP04_SATA,	PCI_ANY_ID, PCI_ANY_ID, 0, 0, 17 },
-	{ PCI_VENDOR_ID_NVIDIA, PCI_DEVICE_ID_NVIDIA_NFORCE_MCP04_SATA2, PCI_ANY_ID, PCI_ANY_ID, 0, 0, 18 },
+	{ PCI_VENDOR_ID_NVIDIA, PCI_DEVICE_ID_NVIDIA_NFORCE_MCP04_IDE,	PCI_ANY_ID, PCI_ANY_ID, 0, 0, 14 },
 	{ 0, },
 };
 MODULE_DEVICE_TABLE(pci, amd74xx_pci_tbl);
diff --git a/drivers/ide/pci/generic.c b/drivers/ide/pci/generic.c
index e73279563..2150a18a8 100644
--- a/drivers/ide/pci/generic.c
+++ b/drivers/ide/pci/generic.c
@@ -127,7 +127,9 @@ static struct pci_device_id generic_pci_tbl[] = {
 	{ PCI_VENDOR_ID_HINT,   PCI_DEVICE_ID_HINT_VXPROII_IDE,    PCI_ANY_ID, PCI_ANY_ID, 0, 0, 6},
 	{ PCI_VENDOR_ID_VIA,    PCI_DEVICE_ID_VIA_82C561,          PCI_ANY_ID, PCI_ANY_ID, 0, 0, 7},
 	{ PCI_VENDOR_ID_OPTI,   PCI_DEVICE_ID_OPTI_82C558,         PCI_ANY_ID, PCI_ANY_ID, 0, 0, 8},
+#ifdef CONFIG_BLK_DEV_IDE_SATA
 	{ PCI_VENDOR_ID_VIA,	PCI_DEVICE_ID_VIA_8237_SATA,	   PCI_ANY_ID, PCI_ANY_ID, 0, 0, 9},
+#endif
 	{ PCI_VENDOR_ID_TOSHIBA,PCI_DEVICE_ID_TOSHIBA_PICCOLO,     PCI_ANY_ID, PCI_ANY_ID, 0, 0, 10},
 	{ PCI_VENDOR_ID_TOSHIBA,PCI_DEVICE_ID_TOSHIBA_PICCOLO_1,   PCI_ANY_ID, PCI_ANY_ID, 0, 0, 11},
 	{ PCI_VENDOR_ID_TOSHIBA,PCI_DEVICE_ID_TOSHIBA_PICCOLO_2,   PCI_ANY_ID, PCI_ANY_ID, 0, 0, 12},
diff --git a/drivers/ide/pci/hpt366.c b/drivers/ide/pci/hpt366.c
index 77bc20861..5f5bc3b6e 100644
--- a/drivers/ide/pci/hpt366.c
+++ b/drivers/ide/pci/hpt366.c
@@ -1,8 +1,9 @@
 /*
- * linux/drivers/ide/pci/hpt366.c		Version 0.34	Sept 17, 2002
+ * linux/drivers/ide/pci/hpt366.c		Version 0.36	April 25, 2003
  *
  * Copyright (C) 1999-2003		Andre Hedrick <andre@linux-ide.org>
  * Portions Copyright (C) 2001	        Sun Microsystems, Inc.
+ * Portions Copyright (C) 2003		Red Hat Inc
  *
  * Thanks to HighPoint Technologies for their assistance, and hardware.
  * Special Thanks to Jon Burchmore in SanDiego for the deep pockets, his
@@ -39,6 +40,13 @@
  * Reset the hpt366 on error, reset on dma
  * Fix disabling Fast Interrupt hpt366.
  * 	Mike Waychison <crlf@sun.com>
+ *
+ * Added support for 372N clocking and clock switching. The 372N needs
+ * different clocks on read/write. This requires overloading rw_disk and
+ * other deeply crazy things. Thanks to <http://www.hoerstreich.de> for
+ * keeping me sane. 
+ *		Alan Cox <alan@redhat.com>
+ *
  */
 
 
@@ -168,6 +176,9 @@ static u32 hpt_revision (struct pci_dev *dev)
 	class_rev &= 0xff;
 
 	switch(dev->device) {
+		/* Remap new 372N onto 372 */
+		case PCI_DEVICE_ID_TTI_HPT372N:
+			class_rev = PCI_DEVICE_ID_TTI_HPT372; break;
 		case PCI_DEVICE_ID_TTI_HPT374:
 			class_rev = PCI_DEVICE_ID_TTI_HPT374; break;
 		case PCI_DEVICE_ID_TTI_HPT371:
@@ -217,6 +228,11 @@ static u8 hpt3xx_ratemask (ide_drive_t *drive)
 	return mode;
 }
 
+/*
+ *	Note for the future; the SATA hpt37x we must set
+ *	either PIO or UDMA modes 0,4,5
+ */
+ 
 static u8 hpt3xx_ratefilter (ide_drive_t *drive, u8 speed)
 {
 	struct pci_dev *dev	= HWIF(drive)->pci_dev;
@@ -292,7 +308,7 @@ static unsigned int pci_bus_clock_list (u8 speed, struct chipset_bus_clock_list_
 	return chipset_table->chipset_settings;
 }
 
-static void hpt366_tune_chipset (ide_drive_t *drive, u8 xferspeed)
+static int hpt36x_tune_chipset(ide_drive_t *drive, u8 xferspeed)
 {
 	struct pci_dev *dev	= HWIF(drive)->pci_dev;
 	u8 speed		= hpt3xx_ratefilter(drive, xferspeed);
@@ -329,14 +345,11 @@ static void hpt366_tune_chipset (ide_drive_t *drive, u8 xferspeed)
 	reg2 &= ~0x80000000;
 
 	pci_write_config_dword(dev, regtime, reg2);
-}
 
-static void hpt368_tune_chipset (ide_drive_t *drive, u8 speed)
-{
-	hpt366_tune_chipset(drive, speed);
+	return ide_config_drive_speed(drive, speed);
 }
 
-static void hpt370_tune_chipset (ide_drive_t *drive, u8 xferspeed)
+static int hpt370_tune_chipset(ide_drive_t *drive, u8 xferspeed)
 {
 	struct pci_dev *dev = HWIF(drive)->pci_dev;
 	u8 speed	= hpt3xx_ratefilter(drive, xferspeed);
@@ -378,9 +391,11 @@ static void hpt370_tune_chipset (ide_drive_t *drive, u8 xferspeed)
 	}
 
 	pci_write_config_dword(dev, drive_pci, list_conf);
+
+	return ide_config_drive_speed(drive, speed);
 }
 
-static void hpt372_tune_chipset (ide_drive_t *drive, u8 xferspeed)
+static int hpt372_tune_chipset(ide_drive_t *drive, u8 xferspeed)
 {
 	struct pci_dev *dev	= HWIF(drive)->pci_dev;
 	u8 speed	= hpt3xx_ratefilter(drive, xferspeed);
@@ -406,11 +421,8 @@ static void hpt372_tune_chipset (ide_drive_t *drive, u8 xferspeed)
 	if (speed < XFER_MW_DMA_0)
 		list_conf &= ~0x80000000; /* Disable on-chip PIO FIFO/buffer */
 	pci_write_config_dword(dev, drive_pci, list_conf);
-}
 
-static void hpt374_tune_chipset (ide_drive_t *drive, u8 speed)
-{
-	hpt372_tune_chipset(drive, speed);
+	return ide_config_drive_speed(drive, speed);
 }
 
 static int hpt3xx_tune_chipset (ide_drive_t *drive, u8 speed)
@@ -418,7 +430,7 @@ static int hpt3xx_tune_chipset (ide_drive_t *drive, u8 speed)
 	struct pci_dev *dev	= HWIF(drive)->pci_dev;
 
 	if (hpt_minimum_revision(dev, 8))
-		hpt374_tune_chipset(drive, speed);
+		return hpt372_tune_chipset(drive, speed); /* not a typo */
 #if 0
 	else if (hpt_minimum_revision(dev, 7))
 		hpt371_tune_chipset(drive, speed);
@@ -426,15 +438,11 @@ static int hpt3xx_tune_chipset (ide_drive_t *drive, u8 speed)
 		hpt302_tune_chipset(drive, speed);
 #endif
 	else if (hpt_minimum_revision(dev, 5))
-		hpt372_tune_chipset(drive, speed);
+		return hpt372_tune_chipset(drive, speed);
 	else if (hpt_minimum_revision(dev, 3))
-		hpt370_tune_chipset(drive, speed);
-	else if (hpt_minimum_revision(dev, 2))
-		hpt368_tune_chipset(drive, speed);
-	else
-                hpt366_tune_chipset(drive, speed);
-
-	return ((int) ide_config_drive_speed(drive, speed));
+		return hpt370_tune_chipset(drive, speed);
+	else	/* hpt368: hpt_minimum_revision(dev, 2) */
+		return hpt36x_tune_chipset(drive, speed);
 }
 
 static void hpt3xx_tune_drive (ide_drive_t *drive, u8 pio)
@@ -680,6 +688,69 @@ static int hpt374_ide_dma_end (ide_drive_t *drive)
 	return __ide_dma_end(drive);
 }
 
+/**
+ *	hpt372n_set_clock	-	perform clock switching dance
+ *	@drive: Drive to switch
+ *	@mode: Switching mode (0x21 for write, 0x23 otherwise)
+ *
+ *	Switch the DPLL clock on the HPT372N devices. This is a
+ *	right mess.
+ */
+ 
+static void hpt372n_set_clock(ide_drive_t *drive, int mode)
+{
+	ide_hwif_t *hwif	= HWIF(drive);
+	
+	/* FIXME: should we check for DMA active and BUG() */
+	/* Tristate the bus */
+	outb(0x80, hwif->dma_base+0x73);
+	outb(0x80, hwif->dma_base+0x77);
+	
+	/* Switch clock and reset channels */
+	outb(mode, hwif->dma_base+0x7B);
+	outb(0xC0, hwif->dma_base+0x79);
+	
+	/* Reset state machines */
+	outb(0x37, hwif->dma_base+0x70);
+	outb(0x37, hwif->dma_base+0x74);
+	
+	/* Complete reset */
+	outb(0x00, hwif->dma_base+0x79);
+	
+	/* Reconnect channels to bus */
+	outb(0x00, hwif->dma_base+0x73);
+	outb(0x00, hwif->dma_base+0x77);
+}
+
+/**
+ *	hpt372n_rw_disk		-	wrapper for I/O
+ *	@drive: drive for command
+ *	@rq: block request structure
+ *	@block: block number
+ *
+ *	This is called when a disk I/O is issued to the 372N instead
+ *	of the default functionality. We need it because of the clock
+ *	switching
+ *
+ */
+ 
+static ide_startstop_t hpt372n_rw_disk(ide_drive_t *drive, struct request *rq, sector_t block)
+{
+	int wantclock;
+	
+	if(rq_data_dir(rq) == READ)
+		wantclock = 0x21;
+	else
+		wantclock = 0x23;
+		
+	if(HWIF(drive)->config_data != wantclock)
+	{
+		hpt372n_set_clock(drive, wantclock);
+		HWIF(drive)->config_data = wantclock;
+	}
+	return __ide_do_rw_disk(drive, rq, block);
+}
+
 /*
  * Since SUN Cobalt is attempting to do this operation, I should disclose
  * this has been a long time ago Thu Jul 27 16:40:57 2000 was the patch date
@@ -801,13 +872,23 @@ static int __devinit init_hpt37x(struct pci_dev *dev)
 	u16 freq;
 	u32 pll;
 	u8 reg5bh;
-
-#if 1
 	u8 reg5ah = 0;
+	unsigned long dmabase = pci_resource_start(dev, 4);
+	u8 did, rid;	
+	int is_372n = 0;
+	
 	pci_read_config_byte(dev, 0x5a, &reg5ah);
 	/* interrupt force enable */
 	pci_write_config_byte(dev, 0x5a, (reg5ah & ~0x10));
-#endif
+
+	if(dmabase)
+	{
+		did = inb(dmabase + 0x22);
+		rid = inb(dmabase + 0x28);
+	
+		if((did == 4 && rid == 6) || (did == 5 && rid > 1))
+			is_372n = 1;
+	}
 
 	/*
 	 * default to pci clock. make sure MA15/16 are set to output
@@ -818,47 +899,86 @@ static int __devinit init_hpt37x(struct pci_dev *dev)
 	/*
 	 * set up the PLL. we need to adjust it so that it's stable. 
 	 * freq = Tpll * 192 / Tpci
+	 *
+	 * Todo. For non x86 should probably check the dword is
+	 * set to 0xABCDExxx indicating the BIOS saved f_CNT
 	 */
 	pci_read_config_word(dev, 0x78, &freq);
 	freq &= 0x1FF;
-	if (freq < 0xa0) {
-		pll = F_LOW_PCI_33;
-		if (hpt_minimum_revision(dev,8))
-			pci_set_drvdata(dev, (void *) thirty_three_base_hpt374);
-		else if (hpt_minimum_revision(dev,5))
-			pci_set_drvdata(dev, (void *) thirty_three_base_hpt372);
-		else if (hpt_minimum_revision(dev,4))
-			pci_set_drvdata(dev, (void *) thirty_three_base_hpt370a);
+	
+	/*
+	 * The 372N uses different PCI clock information and has
+	 * some other complications
+	 *	On PCI33 timing we must clock switch
+	 *	On PCI66 timing we must NOT use the PCI clock
+	 *
+	 * Currently we always set up the PLL for the 372N
+	 */
+	 
+	pci_set_drvdata(dev, NULL);
+	
+	if(is_372n)
+	{
+		printk(KERN_INFO "hpt: HPT372N detected, using 372N timing.\n");
+		if(freq < 0x55)
+			pll = F_LOW_PCI_33;
+		else if(freq < 0x70)
+			pll = F_LOW_PCI_40;
+		else if(freq < 0x7F)
+			pll = F_LOW_PCI_50;
 		else
-			pci_set_drvdata(dev, (void *) thirty_three_base_hpt370);
-		printk("HPT37X: using 33MHz PCI clock\n");
-	} else if (freq < 0xb0) {
-		pll = F_LOW_PCI_40;
-	} else if (freq < 0xc8) {
-		pll = F_LOW_PCI_50;
-		if (hpt_minimum_revision(dev,8))
-			pci_set_drvdata(dev, NULL);
-		else if (hpt_minimum_revision(dev,5))
-			pci_set_drvdata(dev, (void *) fifty_base_hpt372);
-		else if (hpt_minimum_revision(dev,4))
-			pci_set_drvdata(dev, (void *) fifty_base_hpt370a);
+			pll = F_LOW_PCI_66;
+			
+		printk(KERN_INFO "FREQ: %d PLL: %d\n", freq, pll);
+			
+		/* We always use the pll not the PCI clock on 372N */
+	}
+	else
+	{
+		if(freq < 0x9C)
+			pll = F_LOW_PCI_33;
+		else if(freq < 0xb0)
+			pll = F_LOW_PCI_40;
+		else if(freq <0xc8)
+			pll = F_LOW_PCI_50;
 		else
-			pci_set_drvdata(dev, (void *) fifty_base_hpt370a);
-		printk("HPT37X: using 50MHz PCI clock\n");
-	} else {
-		pll = F_LOW_PCI_66;
-		if (hpt_minimum_revision(dev,8))
-		{
-			printk(KERN_ERR "HPT37x: 66MHz timings are not supported.\n");
-			pci_set_drvdata(dev, NULL);
+			pll = F_LOW_PCI_66;
+	
+		if (pll == F_LOW_PCI_33) {
+			if (hpt_minimum_revision(dev,8))
+				pci_set_drvdata(dev, (void *) thirty_three_base_hpt374);
+			else if (hpt_minimum_revision(dev,5))
+				pci_set_drvdata(dev, (void *) thirty_three_base_hpt372);
+			else if (hpt_minimum_revision(dev,4))
+				pci_set_drvdata(dev, (void *) thirty_three_base_hpt370a);
+			else
+				pci_set_drvdata(dev, (void *) thirty_three_base_hpt370);
+			printk("HPT37X: using 33MHz PCI clock\n");
+		} else if (pll == F_LOW_PCI_40) {
+			/* Unsupported */
+		} else if (pll == F_LOW_PCI_50) {
+			if (hpt_minimum_revision(dev,8))
+				pci_set_drvdata(dev, NULL);
+			else if (hpt_minimum_revision(dev,5))
+				pci_set_drvdata(dev, (void *) fifty_base_hpt372);
+			else if (hpt_minimum_revision(dev,4))
+				pci_set_drvdata(dev, (void *) fifty_base_hpt370a);
+			else
+				pci_set_drvdata(dev, (void *) fifty_base_hpt370a);
+			printk("HPT37X: using 50MHz PCI clock\n");
+		} else {
+			if (hpt_minimum_revision(dev,8))
+			{
+				printk(KERN_ERR "HPT37x: 66MHz timings are not supported.\n");
+			}
+			else if (hpt_minimum_revision(dev,5))
+				pci_set_drvdata(dev, (void *) sixty_six_base_hpt372);
+			else if (hpt_minimum_revision(dev,4))
+				pci_set_drvdata(dev, (void *) sixty_six_base_hpt370a);
+			else
+				pci_set_drvdata(dev, (void *) sixty_six_base_hpt370);
+			printk("HPT37X: using 66MHz PCI clock\n");
 		}
-		else if (hpt_minimum_revision(dev,5))
-			pci_set_drvdata(dev, (void *) sixty_six_base_hpt372);
-		else if (hpt_minimum_revision(dev,4))
-			pci_set_drvdata(dev, (void *) sixty_six_base_hpt370a);
-		else
-			pci_set_drvdata(dev, (void *) sixty_six_base_hpt370);
-		printk("HPT37X: using 66MHz PCI clock\n");
 	}
 	
 	/*
@@ -871,6 +991,11 @@ static int __devinit init_hpt37x(struct pci_dev *dev)
 	if (pci_get_drvdata(dev)) 
 		goto init_hpt37X_done;
 	
+	if (hpt_minimum_revision(dev,8))
+	{
+		printk(KERN_ERR "HPT374: Only 33MHz PCI timings are supported.\n");
+		return -EOPNOTSUPP;
+	}
 	/*
 	 * adjust PLL based upon PCI clock, enable it, and wait for
 	 * stabilization.
@@ -1008,12 +1133,27 @@ static void __devinit init_hwif_hpt366(ide_hwif_t *hwif)
 {
 	struct pci_dev *dev		= hwif->pci_dev;
 	u8 ata66 = 0, regmask		= (hwif->channel) ? 0x01 : 0x02;
-
+	u8 did, rid;
+	unsigned long dmabase		= hwif->dma_base;
+	int is_372n = 0;
+	
+	if(dmabase)
+	{
+		did = inb(dmabase + 0x22);
+		rid = inb(dmabase + 0x28);
+	
+		if((did == 4 && rid == 6) || (did == 5 && rid > 1))
+			is_372n = 1;
+	}
+		
 	hwif->tuneproc			= &hpt3xx_tune_drive;
 	hwif->speedproc			= &hpt3xx_tune_chipset;
 	hwif->quirkproc			= &hpt3xx_quirkproc;
 	hwif->intrproc			= &hpt3xx_intrproc;
 	hwif->maskproc			= &hpt3xx_maskproc;
+	
+	if(is_372n)
+		hwif->rw_disk = &hpt372n_rw_disk;
 
 	/*
 	 * The HPT37x uses the CBLID pins as outputs for MA15/MA16
@@ -1187,7 +1327,8 @@ static void __devinit init_setup_hpt366(struct pci_dev *dev, ide_pci_device_t *d
 	u8 pin1 = 0, pin2 = 0;
 	unsigned int class_rev;
 	char *chipset_names[] = {"HPT366", "HPT366",  "HPT368",
-				 "HPT370", "HPT370A", "HPT372"};
+				 "HPT370", "HPT370A", "HPT372",
+				 "HPT372N" };
 
 	if (PCI_FUNC(dev->devfn) & 1)
 		return;
@@ -1195,9 +1336,14 @@ static void __devinit init_setup_hpt366(struct pci_dev *dev, ide_pci_device_t *d
 	pci_read_config_dword(dev, PCI_CLASS_REVISION, &class_rev);
 	class_rev &= 0xff;
 
-	strcpy(d->name, chipset_names[class_rev]);
+	if(dev->device == PCI_DEVICE_ID_TTI_HPT372N)
+		class_rev = 6;
+		
+	if(class_rev <= 6)
+		d->name = chipset_names[class_rev];
 
 	switch(class_rev) {
+		case 6:
 		case 5:
 		case 4:
 		case 3: ide_setup_pci_device(dev, d);
@@ -1251,6 +1397,7 @@ static struct pci_device_id hpt366_pci_tbl[] = {
 	{ PCI_VENDOR_ID_TTI, PCI_DEVICE_ID_TTI_HPT302, PCI_ANY_ID, PCI_ANY_ID, 0, 0, 2},
 	{ PCI_VENDOR_ID_TTI, PCI_DEVICE_ID_TTI_HPT371, PCI_ANY_ID, PCI_ANY_ID, 0, 0, 3},
 	{ PCI_VENDOR_ID_TTI, PCI_DEVICE_ID_TTI_HPT374, PCI_ANY_ID, PCI_ANY_ID, 0, 0, 4},
+	{ PCI_VENDOR_ID_TTI, PCI_DEVICE_ID_TTI_HPT372N, PCI_ANY_ID, PCI_ANY_ID, 0, 0, 5},
 	{ 0, },
 };
 MODULE_DEVICE_TABLE(pci, hpt366_pci_tbl);
diff --git a/drivers/ide/pci/hpt366.h b/drivers/ide/pci/hpt366.h
index 7b3d8b410..388d6ae49 100644
--- a/drivers/ide/pci/hpt366.h
+++ b/drivers/ide/pci/hpt366.h
@@ -470,6 +470,15 @@ static ide_pci_device_t hpt366_chipsets[] __devinitdata = {
 		.channels	= 2,	/* 4 */
 		.autodma	= AUTODMA,
 		.bootable	= OFF_BOARD,
+	},{	/* 5 */
+		.name		= "HPT372N",
+		.init_setup	= init_setup_hpt37x,
+		.init_chipset	= init_chipset_hpt366,
+		.init_hwif	= init_hwif_hpt366,
+		.init_dma	= init_dma_hpt366,
+		.channels	= 2,	/* 4 */
+		.autodma	= AUTODMA,
+		.bootable	= OFF_BOARD,
 	}
 };
 
diff --git a/drivers/ide/pci/pdc202xx_old.c b/drivers/ide/pci/pdc202xx_old.c
index cf6082ad7..3b4379c63 100644
--- a/drivers/ide/pci/pdc202xx_old.c
+++ b/drivers/ide/pci/pdc202xx_old.c
@@ -717,6 +717,12 @@ static unsigned int __devinit init_chipset_pdc202xx(struct pci_dev *dev, const c
 
 static void __devinit init_hwif_pdc202xx(ide_hwif_t *hwif)
 {
+	struct pci_dev *dev = hwif->pci_dev;
+
+	/* PDC20265 has problems with large LBA48 requests */
+	if (dev->device == PCI_DEVICE_ID_PROMISE_20265)
+		hwif->rqsize = 256;
+
 	hwif->autodma = 0;
 	hwif->tuneproc  = &config_chipset_for_pio;
 	hwif->quirkproc = &pdc202xx_quirkproc;
diff --git a/drivers/ide/pci/piix.c b/drivers/ide/pci/piix.c
index fec700bba..26719f2c7 100644
--- a/drivers/ide/pci/piix.c
+++ b/drivers/ide/pci/piix.c
@@ -793,9 +793,9 @@ static struct pci_device_id piix_pci_tbl[] = {
 	{ PCI_VENDOR_ID_INTEL, PCI_DEVICE_ID_INTEL_82801EB_11,PCI_ANY_ID, PCI_ANY_ID, 0, 0, 15},
 	{ PCI_VENDOR_ID_INTEL, PCI_DEVICE_ID_INTEL_82801E_11, PCI_ANY_ID, PCI_ANY_ID, 0, 0, 16},
 	{ PCI_VENDOR_ID_INTEL, PCI_DEVICE_ID_INTEL_82801DB_10,PCI_ANY_ID, PCI_ANY_ID, 0, 0, 17},
-#ifndef CONFIG_SCSI_SATA
+#ifdef CONFIG_BLK_DEV_IDE_SATA
  	{ PCI_VENDOR_ID_INTEL, PCI_DEVICE_ID_INTEL_82801EB_1, PCI_ANY_ID, PCI_ANY_ID, 0, 0, 18},
-#endif /* !CONFIG_SCSI_SATA */
+#endif
 	{ PCI_VENDOR_ID_INTEL, PCI_DEVICE_ID_INTEL_ESB_2, PCI_ANY_ID, PCI_ANY_ID, 0, 0, 19},
 	{ PCI_VENDOR_ID_INTEL, PCI_DEVICE_ID_INTEL_ICH6_19, PCI_ANY_ID, PCI_ANY_ID, 0, 0, 20},
 	{ 0, },
diff --git a/drivers/ide/pci/siimage.c b/drivers/ide/pci/siimage.c
index 5a7483ef6..91b039826 100644
--- a/drivers/ide/pci/siimage.c
+++ b/drivers/ide/pci/siimage.c
@@ -21,6 +21,7 @@
  *	if neccessary
  */
 
+#include <linux/config.h>
 #include <linux/types.h>
 #include <linux/module.h>
 #include <linux/pci.h>
@@ -1006,7 +1007,7 @@ static void __devinit init_iops_siimage(ide_hwif_t *hwif)
 	pci_read_config_dword(dev, PCI_CLASS_REVISION, &class_rev);
 	class_rev &= 0xff;
 	
-	hwif->hwif_data = 0;
+	hwif->hwif_data = NULL;
 
 	hwif->rqsize = 128;
 	if (is_sata(hwif) && is_dev_seagate_sata(&hwif->drives[0]))
@@ -1127,8 +1128,10 @@ static int __devinit siimage_init_one(struct pci_dev *dev, const struct pci_devi
 
 static struct pci_device_id siimage_pci_tbl[] = {
 	{ PCI_VENDOR_ID_CMD, PCI_DEVICE_ID_SII_680,  PCI_ANY_ID, PCI_ANY_ID, 0, 0, 0},
+#ifdef CONFIG_BLK_DEV_IDE_SATA
 	{ PCI_VENDOR_ID_CMD, PCI_DEVICE_ID_SII_3112, PCI_ANY_ID, PCI_ANY_ID, 0, 0, 1},
 	{ PCI_VENDOR_ID_CMD, PCI_DEVICE_ID_SII_1210SA, PCI_ANY_ID, PCI_ANY_ID, 0, 0, 2},
+#endif
 	{ 0, },
 };
 MODULE_DEVICE_TABLE(pci, siimage_pci_tbl);
diff --git a/drivers/ide/pci/trm290.c b/drivers/ide/pci/trm290.c
index d482d8310..d4c753930 100644
--- a/drivers/ide/pci/trm290.c
+++ b/drivers/ide/pci/trm290.c
@@ -3,6 +3,10 @@
  *
  *  Copyright (c) 1997-1998  Mark Lord
  *  May be copied or modified under the terms of the GNU General Public License
+ *
+ *  June 22, 2004 - get rid of check_region
+ *                  Jesper Juhl <juhl-lkml@dif.dk>
+ *
  */
 
 /*
@@ -372,16 +376,6 @@ void __devinit init_hwif_trm290(ide_hwif_t *hwif)
 		if (old != compat && old_mask == 0xff) {
 			/* leave lower 10 bits untouched */
 			compat += (next_offset += 0x400);
-#  if 1
-			if (check_region(compat + 2, 1))
-				printk(KERN_ERR "%s: check_region failure at 0x%04x\n",
-					hwif->name, (compat + 2));
-			/*
-			 * The region check is not needed; however.........
-			 * Since this is the checked in ide-probe.c,
-			 * this is only an assignment.
-			 */
-#  endif
 			hwif->io_ports[IDE_CONTROL_OFFSET] = compat + 2;
 			hwif->OUTW(compat|1, hwif->config_data);
 			new = hwif->INW(hwif->config_data);
diff --git a/drivers/ide/ppc/pmac.c b/drivers/ide/ppc/pmac.c
index 2abbffa8c..7030168e6 100644
--- a/drivers/ide/ppc/pmac.c
+++ b/drivers/ide/ppc/pmac.c
@@ -1126,11 +1126,9 @@ pmac_ide_do_resume(ide_hwif_t *hwif)
 	if (!pmif->mediabay) {
 		ppc_md.feature_call(PMAC_FTR_IDE_RESET, pmif->node, pmif->aapl_bus_id, 1);
 		ppc_md.feature_call(PMAC_FTR_IDE_ENABLE, pmif->node, pmif->aapl_bus_id, 1);
-		set_current_state(TASK_UNINTERRUPTIBLE);
-		schedule_timeout(HZ/100);
+		msleep(10);
 		ppc_md.feature_call(PMAC_FTR_IDE_RESET, pmif->node, pmif->aapl_bus_id, 0);
-		set_current_state(TASK_UNINTERRUPTIBLE);
-		schedule_timeout(IDE_WAKEUP_DELAY);
+		msleep(jiffies_to_msecs(IDE_WAKEUP_DELAY));
 	}
 
 	/* Sanitize drive timings */
@@ -1208,11 +1206,9 @@ pmac_ide_setup_device(pmac_ide_hwif_t *pmif, ide_hwif_t *hwif)
  		/* This is necessary to enable IDE when net-booting */
 		ppc_md.feature_call(PMAC_FTR_IDE_RESET, np, pmif->aapl_bus_id, 1);
 		ppc_md.feature_call(PMAC_FTR_IDE_ENABLE, np, pmif->aapl_bus_id, 1);
-		set_current_state(TASK_UNINTERRUPTIBLE);
-		schedule_timeout(HZ/100);
+		msleep(10);
 		ppc_md.feature_call(PMAC_FTR_IDE_RESET, np, pmif->aapl_bus_id, 0);
-		set_current_state(TASK_UNINTERRUPTIBLE);
-		schedule_timeout(IDE_WAKEUP_DELAY);		
+		msleep(jiffies_to_msecs(IDE_WAKEUP_DELAY));
 	}
 
 	/* Setup MMIO ops */
diff --git a/drivers/ieee1394/Kconfig b/drivers/ieee1394/Kconfig
index 1a625d8b2..f2ae81289 100644
--- a/drivers/ieee1394/Kconfig
+++ b/drivers/ieee1394/Kconfig
@@ -4,6 +4,7 @@ menu "IEEE 1394 (FireWire) support"
 
 config IEEE1394
 	tristate "IEEE 1394 (FireWire) support"
+	depends on PCI || BROKEN
 	help
 	  IEEE 1394 describes a high performance serial bus, which is also
 	  known as FireWire(tm) or i.Link(tm) and is used for connecting all
@@ -113,7 +114,7 @@ config IEEE1394_VIDEO1394
 
 config IEEE1394_SBP2
 	tristate "SBP-2 support (Harddisks etc.)"
-	depends on IEEE1394 && SCSI
+	depends on IEEE1394 && SCSI && (PCI || BROKEN)
 	help
 	  This option enables you to use SBP-2 devices connected to your IEEE
 	  1394 bus.  SBP-2 devices include harddrives and DVD devices.
diff --git a/drivers/ieee1394/amdtp.c b/drivers/ieee1394/amdtp.c
index 10606f8f1..4ee5d42e8 100644
--- a/drivers/ieee1394/amdtp.c
+++ b/drivers/ieee1394/amdtp.c
@@ -1095,7 +1095,7 @@ void stream_free(struct stream *s)
 
 /* File operations */
 
-static ssize_t amdtp_write(struct file *file, const char *buffer, size_t count,
+static ssize_t amdtp_write(struct file *file, const char __user *buffer, size_t count,
 			   loff_t *offset_is_ignored)
 {
 	struct stream *s = file->private_data;
@@ -1150,7 +1150,7 @@ static int amdtp_ioctl(struct inode *inode, struct file *file,
 	{
 	case AMDTP_IOC_PLUG:
 	case AMDTP_IOC_CHANNEL:
-		if (copy_from_user(&cfg, (struct amdtp_ioctl *) arg, sizeof cfg))
+		if (copy_from_user(&cfg, (struct amdtp_ioctl __user *) arg, sizeof cfg))
 			return -EFAULT;
 		else
 			return stream_configure(s, cmd, &cfg);
diff --git a/drivers/ieee1394/dv1394.c b/drivers/ieee1394/dv1394.c
index 9964d6fbc..ecf6830b3 100644
--- a/drivers/ieee1394/dv1394.c
+++ b/drivers/ieee1394/dv1394.c
@@ -1322,7 +1322,7 @@ static unsigned int dv1394_poll(struct file *file, struct poll_table_struct *wai
 static int dv1394_fasync(int fd, struct file *file, int on)
 {
 	/* I just copied this code verbatim from Alan Cox's mouse driver example
-	   (linux/Documentation/DocBook/) */
+	   (Documentation/DocBook/) */
 
 	struct video_card *video = file_to_video_card(file);
 
@@ -1333,7 +1333,7 @@ static int dv1394_fasync(int fd, struct file *file, int on)
         return 0;
 }
 
-static ssize_t dv1394_write(struct file *file, const char *buffer, size_t count, loff_t *ppos)
+static ssize_t dv1394_write(struct file *file, const char __user *buffer, size_t count, loff_t *ppos)
 {
 	struct video_card *video = file_to_video_card(file);
 	DECLARE_WAITQUEUE(wait, current);
@@ -1430,7 +1430,7 @@ static ssize_t dv1394_write(struct file *file, const char *buffer, size_t count,
 }
 
 
-static ssize_t dv1394_read(struct file *file,  char *buffer, size_t count, loff_t *ppos)
+static ssize_t dv1394_read(struct file *file,  char __user *buffer, size_t count, loff_t *ppos)
 {
 	struct video_card *video = file_to_video_card(file);
 	DECLARE_WAITQUEUE(wait, current);
@@ -1549,6 +1549,7 @@ static int dv1394_ioctl(struct inode *inode, struct file *file,
 	struct video_card *video = file_to_video_card(file);
 	unsigned long flags;
 	int ret = -EINVAL;
+	void __user *argp = (void __user *)arg;
 
 	DECLARE_WAITQUEUE(wait, current);
 
@@ -1718,10 +1719,10 @@ static int dv1394_ioctl(struct inode *inode, struct file *file,
 
 	case DV1394_IOC_INIT: {
 		struct dv1394_init init;
-		if (arg == (unsigned long) NULL) {
+		if (!argp) {
 			ret = do_dv1394_init_default(video);
 		} else {
-			if (copy_from_user(&init, (void*)arg, sizeof(init))) {
+			if (copy_from_user(&init, argp, sizeof(init))) {
 				ret = -EFAULT;
 				goto out;
 			}
@@ -1767,7 +1768,7 @@ static int dv1394_ioctl(struct inode *inode, struct file *file,
 
 		spin_unlock_irqrestore(&video->spinlock, flags);
 
-		if (copy_to_user((void*)arg, &status, sizeof(status))) {
+		if (copy_to_user(argp, &status, sizeof(status))) {
 			ret = -EFAULT;
 			goto out;
 		}
@@ -2517,7 +2518,7 @@ static int handle_dv1394_init(unsigned int fd, unsigned int cmd, unsigned long a
 	if (file->f_op->ioctl != dv1394_ioctl)
 		return -EFAULT;
 
-	if (copy_from_user(&dv32, (void *)arg, sizeof(dv32)))
+	if (copy_from_user(&dv32, (void __user *)arg, sizeof(dv32)))
 		return -EFAULT;
 
 	dv.api_version = dv32.api_version;
@@ -2567,7 +2568,7 @@ static int handle_dv1394_get_status(unsigned int fd, unsigned int cmd, unsigned
 		dv32.n_clear_frames = dv.n_clear_frames;
 		dv32.dropped_frames = dv.dropped_frames;
 
-		if (copy_to_user((struct dv1394_status32 *)arg, &dv32, sizeof(dv32)))
+		if (copy_to_user((struct dv1394_status32 __user *)arg, &dv32, sizeof(dv32)))
 			ret = -EFAULT;
 	}
 
diff --git a/drivers/ieee1394/eth1394.c b/drivers/ieee1394/eth1394.c
index 48a7c5049..a9709b846 100644
--- a/drivers/ieee1394/eth1394.c
+++ b/drivers/ieee1394/eth1394.c
@@ -290,6 +290,20 @@ static int ether1394_change_mtu(struct net_device *dev, int new_mtu)
 	return 0;
 }
 
+static inline void purge_partial_datagram(struct list_head *old)
+{
+	struct partial_datagram *pd = list_entry(old, struct partial_datagram, list);
+	struct list_head *lh, *n;
+
+	list_for_each_safe(lh, n, &pd->frag_info) {
+		struct fragment_info *fi = list_entry(lh, struct fragment_info, list);
+		list_del(lh);
+		kfree(fi);
+	}
+	list_del(old);
+	kfree_skb(pd->skb);
+	kfree(pd);
+}
 
 /******************************************
  * 1394 bus activity functions
@@ -431,9 +445,12 @@ static int eth1394_update(struct unit_directory *ud)
 		if (!node)
 			return -ENOMEM;
 
-
 		node_info = kmalloc(sizeof(struct eth1394_node_info),
 				    in_interrupt() ? GFP_ATOMIC : GFP_KERNEL);
+		if (!node_info) {
+			kfree(node);
+			return -ENOMEM;
+                }
 
 		spin_lock_init(&node_info->pdg.lock);
 		INIT_LIST_HEAD(&node_info->pdg.list);
@@ -1078,21 +1095,6 @@ static inline int update_partial_datagram(struct list_head *pdgl, struct list_he
 	return 0;
 }
 
-static inline void purge_partial_datagram(struct list_head *old)
-{
-	struct partial_datagram *pd = list_entry(old, struct partial_datagram, list);
-	struct list_head *lh, *n;
-
-	list_for_each_safe(lh, n, &pd->frag_info) {
-		struct fragment_info *fi = list_entry(lh, struct fragment_info, list);
-		list_del(lh);
-		kfree(fi);
-	}
-	list_del(old);
-	kfree_skb(pd->skb);
-	kfree(pd);
-}
-
 static inline int is_datagram_complete(struct list_head *lh, int dg_size)
 {
 	struct partial_datagram *pd = list_entry(lh, struct partial_datagram, list);
diff --git a/drivers/ieee1394/nodemgr.c b/drivers/ieee1394/nodemgr.c
index c912be4b2..cc9c999f9 100644
--- a/drivers/ieee1394/nodemgr.c
+++ b/drivers/ieee1394/nodemgr.c
@@ -1075,7 +1075,7 @@ do {								\
 
 #undef PUT_ENVP
 
-	envp[i] = 0;
+	envp[i] = NULL;
 
 	return 0;
 }
diff --git a/drivers/ieee1394/raw1394-private.h b/drivers/ieee1394/raw1394-private.h
index 674d55c7f..c93587be9 100644
--- a/drivers/ieee1394/raw1394-private.h
+++ b/drivers/ieee1394/raw1394-private.h
@@ -35,11 +35,11 @@ struct file_info {
 
         struct list_head addr_list;
 
-        u8 *fcp_buffer;
+        u8 __user *fcp_buffer;
 
 	/* old ISO API */
         u64 listen_channels;
-        quadlet_t *iso_buffer;
+        quadlet_t __user *iso_buffer;
         size_t iso_buffer_length;
 
         u8 notification; /* (busreset-notification) RAW1394_NOTIFY_OFF/ON */
diff --git a/drivers/ieee1394/raw1394.c b/drivers/ieee1394/raw1394.c
index dd43837d1..d57a000c5 100644
--- a/drivers/ieee1394/raw1394.c
+++ b/drivers/ieee1394/raw1394.c
@@ -55,13 +55,8 @@
 #include "raw1394.h"
 #include "raw1394-private.h"
 
-#if BITS_PER_LONG == 64
-#define int2ptr(x) ((void *)x)
-#define ptr2int(x) ((u64)x)
-#else
-#define int2ptr(x) ((void *)(u32)x)
-#define ptr2int(x) ((u64)(u32)x)
-#endif
+#define int2ptr(x) ((void __user *)(unsigned long)x)
+#define ptr2int(x) ((u64)(unsigned long)(void __user *)x)
 
 #ifdef CONFIG_IEEE1394_VERBOSEDEBUG
 #define RAW1394_DEBUG
@@ -410,7 +405,7 @@ static void fcp_request(struct hpsb_host *host, int nodeid, int direction,
 }
 
 
-static ssize_t raw1394_read(struct file *file, char *buffer, size_t count,
+static ssize_t raw1394_read(struct file *file, char __user *buffer, size_t count,
                     loff_t *offset_is_ignored)
 {
         struct file_info *fi = (struct file_info *)file->private_data;
@@ -602,7 +597,7 @@ static void handle_fcp_listen(struct file_info *fi, struct pending_request *req)
                 if (fi->fcp_buffer) {
                         req->req.error = RAW1394_ERROR_ALREADY;
                 } else {
-                        fi->fcp_buffer = (u8 *)int2ptr(req->req.recvb);
+                        fi->fcp_buffer = int2ptr(req->req.recvb);
                 }
         } else {
                 if (!fi->fcp_buffer) {
@@ -826,7 +821,7 @@ static int handle_async_send(struct file_info *fi, struct pending_request *req)
                 return sizeof(struct raw1394_request);
         }
 
-        if (copy_from_user(packet->data, ((u8*) int2ptr(req->req.sendb)) + header_length,
+        if (copy_from_user(packet->data, int2ptr(req->req.sendb) + header_length,
                            packet->data_size)) {
                 req->req.error = RAW1394_ERROR_MEMFAULT;
                 req->req.length = 0;
@@ -964,9 +959,8 @@ static int arm_read (struct hpsb_host *host, int nodeid, quadlet_t *buffer,
                 arm_req->buffer  = NULL;
                 arm_resp->buffer = NULL;
                 if (rcode == RCODE_COMPLETE) {
-                        arm_resp->buffer = ((byte_t *)(arm_resp) +
-                                (sizeof(struct arm_response)));
-                        memcpy (arm_resp->buffer,
+                        byte_t *buf = (byte_t *)arm_resp + sizeof(struct arm_response);
+                        memcpy (buf,
                                 (arm_addr->addr_space_buffer)+(addr-(arm_addr->start)),
                                 length);
                         arm_resp->buffer = int2ptr((arm_addr->recvb) +
@@ -1091,10 +1085,9 @@ static int arm_write (struct hpsb_host *host, int nodeid, int destid,
                         (sizeof (struct arm_request_response)));
                 arm_resp = (struct arm_response *) ((byte_t *)(arm_req) +
                         (sizeof(struct arm_request)));
-                arm_req->buffer = ((byte_t *)(arm_resp) +
-                        (sizeof(struct arm_response)));
                 arm_resp->buffer = NULL;
-                memcpy (arm_req->buffer, data, length);
+                memcpy ((byte_t *)arm_resp + sizeof(struct arm_response),
+			data, length);
                 arm_req->buffer = int2ptr((arm_addr->recvb) +
                         sizeof (struct arm_request_response) +
                         sizeof (struct arm_request) +
@@ -1233,6 +1226,7 @@ static int arm_lock (struct hpsb_host *host, int nodeid, quadlet_t *store,
                 }
         }
         if (arm_addr->notification_options & ARM_LOCK) {
+		byte_t *buf1, *buf2;
                 DBGMSG("arm_lock -> entering notification-section");
                 req = __alloc_pending_request(SLAB_ATOMIC);
                 if (!req) {
@@ -1258,26 +1252,22 @@ static int arm_lock (struct hpsb_host *host, int nodeid, quadlet_t *store,
                         (sizeof (struct arm_request_response)));
                 arm_resp = (struct arm_response *) ((byte_t *)(arm_req) +
                         (sizeof(struct arm_request)));
-                arm_req->buffer = ((byte_t *)(arm_resp) +
-                        (sizeof(struct arm_response)));
-                arm_resp->buffer = ((byte_t *)(arm_req->buffer) +
-                        (2* sizeof(*store)));
+                buf1 = (byte_t *)arm_resp + sizeof(struct arm_response);
+		buf2 = buf1 + 2 * sizeof(*store);
                 if ((ext_tcode == EXTCODE_FETCH_ADD) ||
                         (ext_tcode == EXTCODE_LITTLE_ADD)) {
                         arm_req->buffer_length = sizeof(*store);
-                        memcpy (arm_req->buffer, &data, sizeof(*store));
+                        memcpy (buf1, &data, sizeof(*store));
 
                 } else {
                         arm_req->buffer_length = 2 * sizeof(*store);
-                        memcpy (arm_req->buffer, &arg,  sizeof(*store));
-                        memcpy (((arm_req->buffer) + sizeof(*store)),
-                                &data, sizeof(*store));
+                        memcpy (buf1, &arg,  sizeof(*store));
+                        memcpy (buf1 + sizeof(*store), &data, sizeof(*store));
                 }
                 if (rcode == RCODE_COMPLETE) {
                         arm_resp->buffer_length = sizeof(*store);
-                        memcpy (arm_resp->buffer, &old, sizeof(*store));
+                        memcpy (buf2, &old, sizeof(*store));
                 } else {
-                        arm_resp->buffer = NULL;
                         arm_resp->buffer_length = 0;
                 }
                 req->file_info = fi;
@@ -1438,6 +1428,7 @@ static int arm_lock64 (struct hpsb_host *host, int nodeid, octlet_t *store,
                 }
         }
         if (arm_addr->notification_options & ARM_LOCK) {
+		byte_t *buf1, *buf2;
                 DBGMSG("arm_lock64 -> entering notification-section");
                 req = __alloc_pending_request(SLAB_ATOMIC);
                 if (!req) {
@@ -1463,26 +1454,22 @@ static int arm_lock64 (struct hpsb_host *host, int nodeid, octlet_t *store,
                         (sizeof (struct arm_request_response)));
                 arm_resp = (struct arm_response *) ((byte_t *)(arm_req) +
                         (sizeof(struct arm_request)));
-                arm_req->buffer = ((byte_t *)(arm_resp) +
-                        (sizeof(struct arm_response)));
-                arm_resp->buffer = ((byte_t *)(arm_req->buffer) +
-                        (2* sizeof(*store)));
+                buf1 = (byte_t *)arm_resp + sizeof(struct arm_response);
+                buf2 = buf1 + 2 * sizeof(*store);
                 if ((ext_tcode == EXTCODE_FETCH_ADD) ||
                         (ext_tcode == EXTCODE_LITTLE_ADD)) {
                         arm_req->buffer_length = sizeof(*store);
-                        memcpy (arm_req->buffer, &data, sizeof(*store));
+                        memcpy (buf1, &data, sizeof(*store));
 
                 } else {
                         arm_req->buffer_length = 2 * sizeof(*store);
-                        memcpy (arm_req->buffer, &arg,  sizeof(*store));
-                        memcpy (((arm_req->buffer) + sizeof(*store)),
-                                &data, sizeof(*store));
+                        memcpy (buf1, &arg,  sizeof(*store));
+                        memcpy (buf1 + sizeof(*store), &data, sizeof(*store));
                 }
                 if (rcode == RCODE_COMPLETE) {
                         arm_resp->buffer_length = sizeof(*store);
-                        memcpy (arm_resp->buffer, &old, sizeof(*store));
+                        memcpy (buf2, &old, sizeof(*store));
                 } else {
-                        arm_resp->buffer = NULL;
                         arm_resp->buffer_length = 0;
                 }
                 req->file_info = fi;
@@ -1637,7 +1624,7 @@ static int arm_register(struct file_info *fi, struct pending_request *req)
         if (another_host) {
                 DBGMSG("another hosts entry is valid -> SUCCESS");
                 if (copy_to_user(int2ptr(req->req.recvb),
-                        int2ptr(&addr->start),sizeof(u64))) {
+                        &addr->start,sizeof(u64))) {
                         printk(KERN_ERR "raw1394: arm_register failed "
                               " address-range-entry is invalid -> EFAULT !!!\n");
                         vfree(addr->addr_space_buffer);
@@ -2146,7 +2133,7 @@ static int state_connected(struct file_info *fi, struct pending_request *req)
 }
 
 
-static ssize_t raw1394_write(struct file *file, const char *buffer, size_t count,
+static ssize_t raw1394_write(struct file *file, const char __user *buffer, size_t count,
                      loff_t *offset_is_ignored)
 {
         struct file_info *fi = (struct file_info *)file->private_data;
@@ -2262,7 +2249,7 @@ static void raw1394_iso_fill_status(struct hpsb_iso *iso, struct raw1394_iso_sta
 	stat->xmit_cycle = iso->xmit_cycle;
 }
 
-static int raw1394_iso_xmit_init(struct file_info *fi, void *uaddr)
+static int raw1394_iso_xmit_init(struct file_info *fi, void __user *uaddr)
 {
 	struct raw1394_iso_status stat;
 
@@ -2294,7 +2281,7 @@ static int raw1394_iso_xmit_init(struct file_info *fi, void *uaddr)
 	return 0;
 }
 
-static int raw1394_iso_recv_init(struct file_info *fi, void *uaddr)
+static int raw1394_iso_recv_init(struct file_info *fi, void __user *uaddr)
 {
 	struct raw1394_iso_status stat;
 
@@ -2322,7 +2309,7 @@ static int raw1394_iso_recv_init(struct file_info *fi, void *uaddr)
 	return 0;
 }
 
-static int raw1394_iso_get_status(struct file_info *fi, void *uaddr)
+static int raw1394_iso_get_status(struct file_info *fi, void __user *uaddr)
 {
 	struct raw1394_iso_status stat;
 	struct hpsb_iso *iso = fi->iso_handle;
@@ -2338,7 +2325,7 @@ static int raw1394_iso_get_status(struct file_info *fi, void *uaddr)
 }
 
 /* copy N packet_infos out of the ringbuffer into user-supplied array */
-static int raw1394_iso_recv_packets(struct file_info *fi, void *uaddr)
+static int raw1394_iso_recv_packets(struct file_info *fi, void __user *uaddr)
 {
 	struct raw1394_iso_packets upackets;
 	unsigned int packet = fi->iso_handle->first_packet;
@@ -2369,7 +2356,7 @@ static int raw1394_iso_recv_packets(struct file_info *fi, void *uaddr)
 }
 
 /* copy N packet_infos from user to ringbuffer, and queue them for transmission */
-static int raw1394_iso_send_packets(struct file_info *fi, void *uaddr)
+static int raw1394_iso_send_packets(struct file_info *fi, void __user *uaddr)
 {
 	struct raw1394_iso_packets upackets;
 	int i, rv;
@@ -2426,14 +2413,15 @@ static int raw1394_mmap(struct file *file, struct vm_area_struct *vma)
 static int raw1394_ioctl(struct inode *inode, struct file *file, unsigned int cmd, unsigned long arg)
 {
 	struct file_info *fi = file->private_data;
+	void __user *argp = (void __user *)arg;
 
 	switch(fi->iso_state) {
 	case RAW1394_ISO_INACTIVE:
 		switch(cmd) {
 		case RAW1394_IOC_ISO_XMIT_INIT:
-			return raw1394_iso_xmit_init(fi, (void*) arg);
+			return raw1394_iso_xmit_init(fi, argp);
 		case RAW1394_IOC_ISO_RECV_INIT:
-			return raw1394_iso_recv_init(fi, (void*) arg);
+			return raw1394_iso_recv_init(fi, argp);
 		default:
 			break;
 		}
@@ -2443,7 +2431,7 @@ static int raw1394_ioctl(struct inode *inode, struct file *file, unsigned int cm
 		case RAW1394_IOC_ISO_RECV_START: {
 			/* copy args from user-space */
 			int args[3];
-			if (copy_from_user(&args[0], (void*) arg, sizeof(args)))
+			if (copy_from_user(&args[0], argp, sizeof(args)))
 				return -EFAULT;
 			return hpsb_iso_recv_start(fi->iso_handle, args[0], args[1], args[2]);
 		}
@@ -2457,14 +2445,14 @@ static int raw1394_ioctl(struct inode *inode, struct file *file, unsigned int cm
 		case RAW1394_IOC_ISO_RECV_SET_CHANNEL_MASK: {
 			/* copy the u64 from user-space */
 			u64 mask;
-			if (copy_from_user(&mask, (void*) arg, sizeof(mask)))
+			if (copy_from_user(&mask, argp, sizeof(mask)))
 				return -EFAULT;
 			return hpsb_iso_recv_set_channel_mask(fi->iso_handle, mask);
 		}
 		case RAW1394_IOC_ISO_GET_STATUS:
-			return raw1394_iso_get_status(fi, (void*) arg);
+			return raw1394_iso_get_status(fi, argp);
 		case RAW1394_IOC_ISO_RECV_PACKETS:
-			return raw1394_iso_recv_packets(fi, (void*) arg);
+			return raw1394_iso_recv_packets(fi, argp);
 		case RAW1394_IOC_ISO_RECV_RELEASE_PACKETS:
 			return hpsb_iso_recv_release_packets(fi->iso_handle, arg);
 		case RAW1394_IOC_ISO_RECV_FLUSH:
@@ -2482,7 +2470,7 @@ static int raw1394_ioctl(struct inode *inode, struct file *file, unsigned int cm
 		case RAW1394_IOC_ISO_XMIT_START: {
 			/* copy two ints from user-space */
 			int args[2];
-			if (copy_from_user(&args[0], (void*) arg, sizeof(args)))
+			if (copy_from_user(&args[0], argp, sizeof(args)))
 				return -EFAULT;
 			return hpsb_iso_xmit_start(fi->iso_handle, args[0], args[1]);
 		}
@@ -2492,9 +2480,9 @@ static int raw1394_ioctl(struct inode *inode, struct file *file, unsigned int cm
 			hpsb_iso_stop(fi->iso_handle);
 			return 0;
 		case RAW1394_IOC_ISO_GET_STATUS:
-			return raw1394_iso_get_status(fi, (void*) arg);
+			return raw1394_iso_get_status(fi, argp);
 		case RAW1394_IOC_ISO_XMIT_PACKETS:
-			return raw1394_iso_send_packets(fi, (void*) arg);
+			return raw1394_iso_send_packets(fi, argp);
 		case RAW1394_IOC_ISO_SHUTDOWN:
 			raw1394_iso_shutdown(fi);
 			return 0;
diff --git a/drivers/ieee1394/raw1394.h b/drivers/ieee1394/raw1394.h
index 258ed558e..35bfc38f0 100644
--- a/drivers/ieee1394/raw1394.h
+++ b/drivers/ieee1394/raw1394.h
@@ -105,18 +105,18 @@ typedef struct arm_request {
         __u8            extended_transaction_code;
         __u32           generation;
         __u16           buffer_length;
-        __u8            *buffer;
+        __u8            __user *buffer;
 } *arm_request_t;
 
 typedef struct arm_response {
         __s32           response_code;
         __u16           buffer_length;
-        __u8            *buffer;
+        __u8            __user *buffer;
 } *arm_response_t;
 
 typedef struct arm_request_response {
-        struct arm_request  *request;
-        struct arm_response *response;
+        struct arm_request  __user *request;
+        struct arm_response __user *response;
 } *arm_request_response_t;
 
 /* rawiso API */
@@ -136,7 +136,7 @@ struct raw1394_iso_packet_info {
 /* argument for RAW1394_ISO_RECV/XMIT_PACKETS ioctls */
 struct raw1394_iso_packets {
 	__u32 n_packets;
-	struct raw1394_iso_packet_info *infos;
+	struct raw1394_iso_packet_info __user *infos;
 };
 
 struct raw1394_iso_config {
diff --git a/drivers/ieee1394/sbp2.c b/drivers/ieee1394/sbp2.c
index 78a4f8ed5..47de79f21 100644
--- a/drivers/ieee1394/sbp2.c
+++ b/drivers/ieee1394/sbp2.c
@@ -65,7 +65,7 @@
 #include <asm/scatterlist.h>
 
 #include "../scsi/scsi.h"
-#include "../scsi/hosts.h"
+#include <scsi/scsi_host.h>
 
 #include "csr1212.h"
 #include "ieee1394.h"
diff --git a/drivers/ieee1394/video1394.c b/drivers/ieee1394/video1394.c
index 7a757fc43..fd40358ae 100644
--- a/drivers/ieee1394/video1394.c
+++ b/drivers/ieee1394/video1394.c
@@ -705,6 +705,7 @@ static int video1394_ioctl(struct inode *inode, struct file *file,
 	struct file_ctx *ctx = (struct file_ctx *)file->private_data;
 	struct ti_ohci *ohci = ctx->ohci;
 	unsigned long flags;
+	void __user *argp = (void __user *)arg;
 
 	switch(cmd)
 	{
@@ -716,7 +717,7 @@ static int video1394_ioctl(struct inode *inode, struct file *file,
 		struct dma_iso_ctx *d;
 		int i;
 
-		if (copy_from_user(&v, (void *)arg, sizeof(v)))
+		if (copy_from_user(&v, argp, sizeof(v)))
 			return -EFAULT;
 
 		/* if channel < 0, find lowest available one */
@@ -813,7 +814,7 @@ static int video1394_ioctl(struct inode *inode, struct file *file,
 			      v.channel);
 		}
 
-		if (copy_to_user((void *)arg, &v, sizeof(v)))
+		if (copy_to_user(argp, &v, sizeof(v)))
 			return -EFAULT;
 
 		return 0;
@@ -825,7 +826,7 @@ static int video1394_ioctl(struct inode *inode, struct file *file,
 		u64 mask;
 		struct dma_iso_ctx *d;
 
-		if (copy_from_user(&channel, (void *)arg, sizeof(int)))
+		if (copy_from_user(&channel, argp, sizeof(int)))
 			return -EFAULT;
 
 		if (channel<0 || channel>(ISO_CHANNELS-1)) {
@@ -860,7 +861,7 @@ static int video1394_ioctl(struct inode *inode, struct file *file,
 		struct video1394_wait v;
 		struct dma_iso_ctx *d;
 
-		if (copy_from_user(&v, (void *)arg, sizeof(v)))
+		if (copy_from_user(&v, argp, sizeof(v)))
 			return -EFAULT;
 
 		d = find_ctx(&ctx->context_list, OHCI_ISO_RECEIVE, v.channel);
@@ -923,7 +924,7 @@ static int video1394_ioctl(struct inode *inode, struct file *file,
 		struct dma_iso_ctx *d;
 		int i;
 
-		if (copy_from_user(&v, (void *)arg, sizeof(v)))
+		if (copy_from_user(&v, argp, sizeof(v)))
 			return -EFAULT;
 
 		d = find_ctx(&ctx->context_list, OHCI_ISO_RECEIVE, v.channel);
@@ -994,7 +995,7 @@ static int video1394_ioctl(struct inode *inode, struct file *file,
 		spin_unlock_irqrestore(&d->lock, flags);
 
 		v.buffer=i;
-		if (copy_to_user((void *)arg, &v, sizeof(v)))
+		if (copy_to_user(argp, &v, sizeof(v)))
 			return -EFAULT;
 
 		return 0;
@@ -1002,12 +1003,10 @@ static int video1394_ioctl(struct inode *inode, struct file *file,
 	case VIDEO1394_IOC_TALK_QUEUE_BUFFER:
 	{
 		struct video1394_wait v;
-		struct video1394_queue_variable qv;
+		unsigned int *psizes = NULL;
 		struct dma_iso_ctx *d;
 
-		qv.packet_sizes = NULL;
-
-		if (copy_from_user(&v, (void *)arg, sizeof(v)))
+		if (copy_from_user(&v, argp, sizeof(v)))
 			return -EFAULT;
 
 		d = find_ctx(&ctx->context_list, OHCI_ISO_TRANSMIT, v.channel);
@@ -1020,22 +1019,21 @@ static int video1394_ioctl(struct inode *inode, struct file *file,
 		}
 
 		if (d->flags & VIDEO1394_VARIABLE_PACKET_SIZE) {
-			unsigned int *psizes;
 			int buf_size = d->nb_cmd * sizeof(unsigned int);
+			struct video1394_queue_variable __user *p = argp;
+			unsigned int __user *qv;
 
-			if (copy_from_user(&qv, (void *)arg, sizeof(qv)))
+			if (get_user(qv, &p->packet_sizes))
 				return -EFAULT;
 
 			psizes = kmalloc(buf_size, GFP_KERNEL);
 			if (!psizes)
 				return -ENOMEM;
 
-			if (copy_from_user(psizes, qv.packet_sizes, buf_size)) {
+			if (copy_from_user(psizes, qv, buf_size)) {
 				kfree(psizes);
 				return -EFAULT;
 			}
-
-			qv.packet_sizes = psizes;
 		}
 
 		spin_lock_irqsave(&d->lock,flags);
@@ -1044,14 +1042,14 @@ static int video1394_ioctl(struct inode *inode, struct file *file,
 			PRINT(KERN_ERR, ohci->host->id,
 			      "Buffer %d is already used",v.buffer);
 			spin_unlock_irqrestore(&d->lock,flags);
-			if (qv.packet_sizes)
-				kfree(qv.packet_sizes);
+			if (psizes)
+				kfree(psizes);
 			return -EFAULT;
 		}
 
 		if (d->flags & VIDEO1394_VARIABLE_PACKET_SIZE) {
 			initialize_dma_it_prg_var_packet_queue(
-				d, v.buffer, qv.packet_sizes,
+				d, v.buffer, psizes,
 				ohci);
 		}
 
@@ -1100,8 +1098,8 @@ static int video1394_ioctl(struct inode *inode, struct file *file,
 			}
 		}
 
-		if (qv.packet_sizes)
-			kfree(qv.packet_sizes);
+		if (psizes)
+			kfree(psizes);
 
 		return 0;
 
@@ -1111,7 +1109,7 @@ static int video1394_ioctl(struct inode *inode, struct file *file,
 		struct video1394_wait v;
 		struct dma_iso_ctx *d;
 
-		if (copy_from_user(&v, (void *)arg, sizeof(v)))
+		if (copy_from_user(&v, argp, sizeof(v)))
 			return -EFAULT;
 
 		d = find_ctx(&ctx->context_list, OHCI_ISO_TRANSMIT, v.channel);
@@ -1338,6 +1336,7 @@ struct video1394_wait32 {
 static int video1394_wr_wait32(unsigned int fd, unsigned int cmd, unsigned long arg,
 			       struct file *file)
 {
+        struct video1394_wait32 __user *argp = (void __user *)arg;
         struct video1394_wait32 wait32;
         struct video1394_wait wait;
         mm_segment_t old_fs;
@@ -1346,7 +1345,7 @@ static int video1394_wr_wait32(unsigned int fd, unsigned int cmd, unsigned long
 	if (file->f_op->ioctl != video1394_ioctl)
 		return -EFAULT;
 
-        if (copy_from_user(&wait32, (void *)arg, sizeof(wait32)))
+        if (copy_from_user(&wait32, argp, sizeof(wait32)))
                 return -EFAULT;
 
         wait.channel = wait32.channel;
@@ -1372,7 +1371,7 @@ static int video1394_wr_wait32(unsigned int fd, unsigned int cmd, unsigned long
                 wait32.filltime.tv_sec = (int)wait.filltime.tv_sec;
                 wait32.filltime.tv_usec = (int)wait.filltime.tv_usec;
 
-                if (copy_to_user((struct video1394_wait32 *)arg, &wait32, sizeof(wait32)))
+                if (copy_to_user(argp, &wait32, sizeof(wait32)))
                         ret = -EFAULT;
         }
 
@@ -1390,7 +1389,7 @@ static int video1394_w_wait32(unsigned int fd, unsigned int cmd, unsigned long a
 	if (file->f_op->ioctl != video1394_ioctl)
 		return -EFAULT;
 
-        if (copy_from_user(&wait32, (void *)arg, sizeof(wait32)))
+        if (copy_from_user(&wait32, (void __user *)arg, sizeof(wait32)))
                 return -EFAULT;
 
         wait.channel = wait32.channel;
diff --git a/drivers/ieee1394/video1394.h b/drivers/ieee1394/video1394.h
index d34bfef30..9a89d9cc3 100644
--- a/drivers/ieee1394/video1394.h
+++ b/drivers/ieee1394/video1394.h
@@ -53,7 +53,7 @@ struct video1394_mmap {
 struct video1394_queue_variable {
 	unsigned int channel;
 	unsigned int buffer;
-	unsigned int* packet_sizes; /* Buffer of size:
+	unsigned int __user * packet_sizes; /* Buffer of size:
 				       buf_size / packet_size  */
 };
 
diff --git a/drivers/input/input.c b/drivers/input/input.c
index 73b17418a..416084b80 100644
--- a/drivers/input/input.c
+++ b/drivers/input/input.c
@@ -369,7 +369,7 @@ static void input_call_hotplug(char *verb, struct input_dev *dev)
 
 	argv[0] = hotplug_path;
 	argv[1] = "input";
-	argv[2] = 0;
+	argv[2] = NULL;
 
 	envp[i++] = "HOME=/";
 	envp[i++] = "PATH=/sbin:/bin:/usr/sbin:/usr/bin";
@@ -402,7 +402,7 @@ static void input_call_hotplug(char *verb, struct input_dev *dev)
 	SPRINTF_BIT_A2(sndbit, "SND=", SND_MAX, EV_SND);
 	SPRINTF_BIT_A2(ffbit,  "FF=",  FF_MAX, EV_FF);
 
-	envp[i++] = 0;
+	envp[i++] = NULL;
 
 #ifdef INPUT_DEBUG
 	printk(KERN_DEBUG "input.c: calling %s %s [%s %s %s %s %s]\n",
diff --git a/drivers/input/joydev.c b/drivers/input/joydev.c
index 3cc849e03..5eb884656 100644
--- a/drivers/input/joydev.c
+++ b/drivers/input/joydev.c
@@ -191,12 +191,12 @@ static int joydev_open(struct inode *inode, struct file *file)
 	return 0;
 }
 
-static ssize_t joydev_write(struct file * file, const char * buffer, size_t count, loff_t *ppos)
+static ssize_t joydev_write(struct file * file, const char __user * buffer, size_t count, loff_t *ppos)
 {
 	return -EINVAL;
 }
 
-static ssize_t joydev_read(struct file *file, char *buf, size_t count, loff_t *ppos)
+static ssize_t joydev_read(struct file *file, char __user *buf, size_t count, loff_t *ppos)
 {
 	struct joydev_list *list = file->private_data;
 	struct joydev *joydev = list->joydev;
@@ -291,6 +291,7 @@ static int joydev_ioctl(struct inode *inode, struct file *file, unsigned int cmd
 	struct joydev_list *list = file->private_data;
 	struct joydev *joydev = list->joydev;
 	struct input_dev *dev = joydev->handle.dev;
+	void __user *argp = (void __user *)arg;
 	int i, j;
 
 	if (!joydev->exist) return -ENODEV;
@@ -298,34 +299,34 @@ static int joydev_ioctl(struct inode *inode, struct file *file, unsigned int cmd
 	switch (cmd) {
 
 		case JS_SET_CAL:
-			return copy_from_user(&joydev->glue.JS_CORR, (struct JS_DATA_TYPE *) arg,
+			return copy_from_user(&joydev->glue.JS_CORR, argp,
 				sizeof(struct JS_DATA_TYPE)) ? -EFAULT : 0;
 		case JS_GET_CAL:
-			return copy_to_user((struct JS_DATA_TYPE *) arg, &joydev->glue.JS_CORR,
+			return copy_to_user(argp, &joydev->glue.JS_CORR,
 				sizeof(struct JS_DATA_TYPE)) ? -EFAULT : 0;
 		case JS_SET_TIMEOUT:
-			return get_user(joydev->glue.JS_TIMEOUT, (int *) arg);
+			return get_user(joydev->glue.JS_TIMEOUT, (int __user *) arg);
 		case JS_GET_TIMEOUT:
-			return put_user(joydev->glue.JS_TIMEOUT, (int *) arg);
+			return put_user(joydev->glue.JS_TIMEOUT, (int __user *) arg);
 		case JS_SET_TIMELIMIT:
-			return get_user(joydev->glue.JS_TIMELIMIT, (long *) arg);
+			return get_user(joydev->glue.JS_TIMELIMIT, (long __user *) arg);
 		case JS_GET_TIMELIMIT:
-			return put_user(joydev->glue.JS_TIMELIMIT, (long *) arg);
+			return put_user(joydev->glue.JS_TIMELIMIT, (long __user *) arg);
 		case JS_SET_ALL:
-			return copy_from_user(&joydev->glue, (struct JS_DATA_SAVE_TYPE *) arg,
+			return copy_from_user(&joydev->glue, argp,
 						sizeof(struct JS_DATA_SAVE_TYPE)) ? -EFAULT : 0;
 		case JS_GET_ALL:
-			return copy_to_user((struct JS_DATA_SAVE_TYPE *) arg, &joydev->glue,
+			return copy_to_user(argp, &joydev->glue,
 						sizeof(struct JS_DATA_SAVE_TYPE)) ? -EFAULT : 0;
 
 		case JSIOCGVERSION:
-			return put_user(JS_VERSION, (__u32 *) arg);
+			return put_user(JS_VERSION, (__u32 __user *) arg);
 		case JSIOCGAXES:
-			return put_user(joydev->nabs, (__u8 *) arg);
+			return put_user(joydev->nabs, (__u8 __user *) arg);
 		case JSIOCGBUTTONS:
-			return put_user(joydev->nkey, (__u8 *) arg);
+			return put_user(joydev->nkey, (__u8 __user *) arg);
 		case JSIOCSCORR:
-			if (copy_from_user(joydev->corr, (struct js_corr *)arg,
+			if (copy_from_user(joydev->corr, argp,
 				      sizeof(struct js_corr) * joydev->nabs))
 			    return -EFAULT;
 			for (i = 0; i < joydev->nabs; i++) {
@@ -334,10 +335,10 @@ static int joydev_ioctl(struct inode *inode, struct file *file, unsigned int cmd
 			}
 			return 0;
 		case JSIOCGCORR:
-			return copy_to_user((struct js_corr *) arg, joydev->corr,
+			return copy_to_user(argp, joydev->corr,
 						sizeof(struct js_corr) * joydev->nabs) ? -EFAULT : 0;
 		case JSIOCSAXMAP:
-			if (copy_from_user(joydev->abspam, (__u8 *) arg, sizeof(__u8) * ABS_MAX))
+			if (copy_from_user(joydev->abspam, argp, sizeof(__u8) * ABS_MAX))
 				return -EFAULT;
 			for (i = 0; i < joydev->nabs; i++) {
 				if (joydev->abspam[i] > ABS_MAX) return -EINVAL;
@@ -345,10 +346,10 @@ static int joydev_ioctl(struct inode *inode, struct file *file, unsigned int cmd
 			}
 			return 0;
 		case JSIOCGAXMAP:
-			return copy_to_user((__u8 *) arg, joydev->abspam,
+			return copy_to_user(argp, joydev->abspam,
 						sizeof(__u8) * ABS_MAX) ? -EFAULT : 0;
 		case JSIOCSBTNMAP:
-			if (copy_from_user(joydev->keypam, (__u16 *) arg, sizeof(__u16) * (KEY_MAX - BTN_MISC)))
+			if (copy_from_user(joydev->keypam, argp, sizeof(__u16) * (KEY_MAX - BTN_MISC)))
 				return -EFAULT;
 			for (i = 0; i < joydev->nkey; i++) {
 				if (joydev->keypam[i] > KEY_MAX || joydev->keypam[i] < BTN_MISC) return -EINVAL;
@@ -356,7 +357,7 @@ static int joydev_ioctl(struct inode *inode, struct file *file, unsigned int cmd
 			}
 			return 0;
 		case JSIOCGBTNMAP:
-			return copy_to_user((__u16 *) arg, joydev->keypam,
+			return copy_to_user(argp, joydev->keypam,
 						sizeof(__u16) * (KEY_MAX - BTN_MISC)) ? -EFAULT : 0;
 		default:
 			if ((cmd & ~(_IOC_SIZEMASK << _IOC_SIZESHIFT)) == JSIOCGNAME(0)) {
@@ -364,7 +365,7 @@ static int joydev_ioctl(struct inode *inode, struct file *file, unsigned int cmd
 				if (!dev->name) return 0;
 				len = strlen(dev->name) + 1;
 				if (len > _IOC_SIZE(cmd)) len = _IOC_SIZE(cmd);
-				if (copy_to_user((char *) arg, dev->name, len)) return -EFAULT;
+				if (copy_to_user(argp, dev->name, len)) return -EFAULT;
 				return len;
 			}
 	}
diff --git a/drivers/input/joystick/analog.c b/drivers/input/joystick/analog.c
index 3e83968a9..7e52f9609 100644
--- a/drivers/input/joystick/analog.c
+++ b/drivers/input/joystick/analog.c
@@ -158,11 +158,11 @@ static unsigned int get_time_pit(void)
 
         return count;
 }
-#elif __x86_64__
+#elif defined(__x86_64__)
 #define GET_TIME(x)	rdtscl(x)
 #define DELTA(x,y)	((y)-(x))
 #define TIME_NAME	"TSC"
-#elif __alpha__
+#elif defined(__alpha__)
 #define GET_TIME(x)	do { x = get_cycles(); } while (0)
 #define DELTA(x,y)	((y)-(x))
 #define TIME_NAME	"PCC"
diff --git a/drivers/input/joystick/grip.c b/drivers/input/joystick/grip.c
index 3b1b07e2d..cd2bb5d62 100644
--- a/drivers/input/joystick/grip.c
+++ b/drivers/input/joystick/grip.c
@@ -76,8 +76,8 @@ static int grip_abs_dc[] = { ABS_X, ABS_Y, ABS_RX, ABS_RY, ABS_THROTTLE, ABS_HAT
 
 static char *grip_name[] = { NULL, "Gravis GamePad Pro", "Gravis Blackhawk Digital",
 				"Gravis Xterminator Digital", "Gravis Xterminator DualControl" };
-static int *grip_abs[] = { 0, grip_abs_gpp, grip_abs_bd, grip_abs_xt, grip_abs_dc };
-static int *grip_btn[] = { 0, grip_btn_gpp, grip_btn_bd, grip_btn_xt, grip_btn_dc };
+static int *grip_abs[] = { NULL, grip_abs_gpp, grip_abs_bd, grip_abs_xt, grip_abs_dc };
+static int *grip_btn[] = { NULL, grip_btn_gpp, grip_btn_bd, grip_btn_xt, grip_btn_dc };
 static char grip_anx[] = { 0, 0, 3, 5, 5 };
 static char grip_cen[] = { 0, 0, 2, 2, 4 };
 
diff --git a/drivers/input/joystick/grip_mp.c b/drivers/input/joystick/grip_mp.c
index 995caa3e4..8e1949683 100644
--- a/drivers/input/joystick/grip_mp.c
+++ b/drivers/input/joystick/grip_mp.c
@@ -92,8 +92,8 @@ static int grip_btn_c64[] = { BTN_JOYSTICK, -1 };
 static int grip_abs_gp[]  = { ABS_X, ABS_Y, -1 };
 static int grip_abs_c64[] = { ABS_X, ABS_Y, -1 };
 
-static int *grip_abs[] = { 0, 0, grip_abs_gp, grip_abs_c64 };
-static int *grip_btn[] = { 0, 0, grip_btn_gp, grip_btn_c64 };
+static int *grip_abs[] = { NULL, NULL, grip_abs_gp, grip_abs_c64 };
+static int *grip_btn[] = { NULL, NULL, grip_btn_gp, grip_btn_c64 };
 
 static char *grip_name[] = { NULL, NULL, "Gravis Grip Pad", "Commodore 64 Joystick" };
 
diff --git a/drivers/input/keyboard/Kconfig b/drivers/input/keyboard/Kconfig
index 45322b41a..b724190b2 100644
--- a/drivers/input/keyboard/Kconfig
+++ b/drivers/input/keyboard/Kconfig
@@ -96,15 +96,3 @@ config KEYBOARD_AMIGA
 
 	  To compile this driver as a module, choose M here: the
 	  module will be called amikbd.
-
-config KEYBOARD_98KBD
-	tristate "NEC PC-9800 Keyboard support"
-	depends on X86_PC9800 && INPUT && INPUT_KEYBOARD
-	select SERIO
-	help
-	  Say Y here if you want to use the NEC PC-9801/PC-9821 keyboard (or
-	  compatible) on your system.
-
-	  To compile this driver as a module, choose M here: the
-	  module will be called 98kbd.
-
diff --git a/drivers/input/keyboard/atkbd.c b/drivers/input/keyboard/atkbd.c
index 026fc13ea..00ec1f86a 100644
--- a/drivers/input/keyboard/atkbd.c
+++ b/drivers/input/keyboard/atkbd.c
@@ -288,7 +288,7 @@ static irqreturn_t atkbd_interrupt(struct serio *serio, unsigned char data,
 			atkbd_report_key(&atkbd->dev, regs, KEY_HANJA, 3);
 			goto out;
 		case ATKBD_RET_ERR:
-			printk(KERN_WARNING "atkbd.c: Keyboard on %s reports too many keys pressed.\n", serio->phys);
+			printk(KERN_DEBUG "atkbd.c: Keyboard on %s reports too many keys pressed.\n", serio->phys);
 			goto out;
 	}
 
diff --git a/drivers/input/keyboard/sunkbd.c b/drivers/input/keyboard/sunkbd.c
index 1bb8a57e2..c281e726b 100644
--- a/drivers/input/keyboard/sunkbd.c
+++ b/drivers/input/keyboard/sunkbd.c
@@ -81,8 +81,8 @@ struct sunkbd {
 	char name[64];
 	char phys[32];
 	char type;
-	volatile char reset;
-	volatile char layout;
+	volatile s8 reset;
+	volatile s8 layout;
 };
 
 /*
diff --git a/drivers/input/misc/Kconfig b/drivers/input/misc/Kconfig
index d31aaffa5..d3e5d841e 100644
--- a/drivers/input/misc/Kconfig
+++ b/drivers/input/misc/Kconfig
@@ -40,10 +40,6 @@ config INPUT_M68K_BEEP
 	tristate "M68k Beeper support"
 	depends on M68K && INPUT && INPUT_MISC
 
-config INPUT_98SPKR
-	tristate "PC-9800 Speaker support"
-	depends on X86_PC9800 && INPUT && INPUT_MISC
-
 config INPUT_UINPUT
 	tristate "User level driver support"
 	depends on INPUT && INPUT_MISC
diff --git a/drivers/input/misc/uinput.c b/drivers/input/misc/uinput.c
index 2e097dc66..b86acf04d 100644
--- a/drivers/input/misc/uinput.c
+++ b/drivers/input/misc/uinput.c
@@ -166,7 +166,7 @@ static int uinput_validate_absbits(struct input_dev *dev)
 	return retval;
 }
 
-static int uinput_alloc_device(struct file *file, const char *buffer, size_t count)
+static int uinput_alloc_device(struct file *file, const char __user *buffer, size_t count)
 {
 	struct uinput_user_dev	*user_dev;
 	struct input_dev	*dev;
@@ -226,7 +226,7 @@ exit:
 	return retval;
 }
 
-static ssize_t uinput_write(struct file *file, const char *buffer, size_t count, loff_t *ppos)
+static ssize_t uinput_write(struct file *file, const char __user *buffer, size_t count, loff_t *ppos)
 {
 	struct uinput_device	*udev = file->private_data;
 
@@ -243,7 +243,7 @@ static ssize_t uinput_write(struct file *file, const char *buffer, size_t count,
 	return count;
 }
 
-static ssize_t uinput_read(struct file *file, char *buffer, size_t count, loff_t *ppos)
+static ssize_t uinput_read(struct file *file, char __user *buffer, size_t count, loff_t *ppos)
 {
 	struct uinput_device *udev = file->private_data;
 	int retval = 0;
diff --git a/drivers/input/mouse/Kconfig b/drivers/input/mouse/Kconfig
index 17db090dc..1274cb68b 100644
--- a/drivers/input/mouse/Kconfig
+++ b/drivers/input/mouse/Kconfig
@@ -130,14 +130,3 @@ config MOUSE_VSXXXAA
 	  described in the source file). This driver should, in theory,
 	  also work with the digitizer DEC produced, but it isn't tested
 	  with that (I don't have the hardware yet).
-
-config MOUSE_PC9800
-	tristate "NEC PC-9800 busmouse"
-	depends on X86_PC9800 && INPUT && INPUT_MOUSE && ISA
-	help
-	  Say Y here if you have NEC PC-9801/PC-9821 computer and want its
-	  native mouse supported.
-
-	  To compile this driver as a module, choose M here: the
-	  module will be called 98busmouse.
-
diff --git a/drivers/input/mouse/Makefile b/drivers/input/mouse/Makefile
index 57987f3e2..c030c08b1 100644
--- a/drivers/input/mouse/Makefile
+++ b/drivers/input/mouse/Makefile
@@ -10,7 +10,6 @@ obj-$(CONFIG_MOUSE_INPORT)	+= inport.o
 obj-$(CONFIG_MOUSE_LOGIBM)	+= logibm.o
 obj-$(CONFIG_MOUSE_MAPLE)	+= maplemouse.o
 obj-$(CONFIG_MOUSE_PC110PAD)	+= pc110pad.o
-obj-$(CONFIG_MOUSE_PC9800)	+= 98busmouse.o
 obj-$(CONFIG_MOUSE_PS2)		+= psmouse.o
 obj-$(CONFIG_MOUSE_SERIAL)	+= sermouse.o
 obj-$(CONFIG_MOUSE_VSXXXAA)	+= vsxxxaa.o
diff --git a/drivers/input/mouse/pc110pad.c b/drivers/input/mouse/pc110pad.c
index 910e03593..526a11e70 100644
--- a/drivers/input/mouse/pc110pad.c
+++ b/drivers/input/mouse/pc110pad.c
@@ -98,9 +98,9 @@ static int pc110pad_open(struct input_dev *dev)
 	if (pc110pad_used++)
 		return 0;
 
-	pc110pad_interrupt(0,0,0);
-	pc110pad_interrupt(0,0,0);
-	pc110pad_interrupt(0,0,0);
+	pc110pad_interrupt(0,NULL,NULL);
+	pc110pad_interrupt(0,NULL,NULL);
+	pc110pad_interrupt(0,NULL,NULL);
 	outb(PC110PAD_ON, pc110pad_io + 2);
 	pc110pad_count = 0;
 
@@ -117,7 +117,7 @@ static int __init pc110pad_init(void)
 
 	outb(PC110PAD_OFF, pc110pad_io + 2);
 
-	if (request_irq(pc110pad_irq, pc110pad_interrupt, 0, "pc110pad", 0))
+	if (request_irq(pc110pad_irq, pc110pad_interrupt, 0, "pc110pad", NULL))
 	{
 		release_region(pc110pad_io, 4);
 		printk(KERN_ERR "pc110pad: Unable to get irq %d.\n", pc110pad_irq);
@@ -155,7 +155,7 @@ static void __exit pc110pad_exit(void)
 
 	outb(PC110PAD_OFF, pc110pad_io + 2);
 
-	free_irq(pc110pad_irq, 0);
+	free_irq(pc110pad_irq, NULL);
 	release_region(pc110pad_io, 4);
 }
 
diff --git a/drivers/input/serio/Kconfig b/drivers/input/serio/Kconfig
index fb810fa6a..cd74954bd 100644
--- a/drivers/input/serio/Kconfig
+++ b/drivers/input/serio/Kconfig
@@ -97,16 +97,6 @@ config SERIO_SA1111
 	tristate "Intel SA1111 keyboard controller"
 	depends on SA1111 && SERIO
 
-config SERIO_98KBD
-	tristate "NEC PC-9800 keyboard controller"
-	depends on X86_PC9800 && SERIO
-	help
-	  Say Y here if you have the NEC PC-9801/PC-9821 and want to use its
-	  standard keyboard connected to its keyboard controller.
-
-	  To compile this driver as a module, choose M here: the
-	  module will be called 98kbd-io.
-
 config SERIO_GSCPS2
 	tristate "HP GSC PS/2 keyboard and PS/2 mouse controller"
 	depends on GSC && SERIO
diff --git a/drivers/input/serio/ambakmi.c b/drivers/input/serio/ambakmi.c
index df6183954..6a780c10f 100644
--- a/drivers/input/serio/ambakmi.c
+++ b/drivers/input/serio/ambakmi.c
@@ -18,17 +18,19 @@
 #include <linux/device.h>
 #include <linux/delay.h>
 #include <linux/slab.h>
+#include <linux/err.h>
 
 #include <asm/io.h>
 #include <asm/irq.h>
 #include <asm/hardware/amba.h>
 #include <asm/hardware/amba_kmi.h>
+#include <asm/hardware/clock.h>
 
 #define KMI_BASE	(kmi->base)
 
 struct amba_kmi_port {
 	struct serio		io;
-	struct amba_kmi_port	*next;
+	struct clk		*clk;
 	unsigned char		*base;
 	unsigned int		irq;
 	unsigned int		divisor;
@@ -67,21 +69,38 @@ static int amba_kmi_write(struct serio *io, unsigned char val)
 static int amba_kmi_open(struct serio *io)
 {
 	struct amba_kmi_port *kmi = io->driver;
+	unsigned int divisor;
 	int ret;
 
-	writeb(kmi->divisor, KMICLKDIV);
+	ret = clk_use(kmi->clk);
+	if (ret)
+		goto out;
+
+	ret = clk_enable(kmi->clk);
+	if (ret)
+		goto clk_unuse;
+
+	divisor = clk_get_rate(kmi->clk) / 8000000 - 1;
+	writeb(divisor, KMICLKDIV);
 	writeb(KMICR_EN, KMICR);
 
 	ret = request_irq(kmi->irq, amba_kmi_int, 0, "kmi-pl050", kmi);
 	if (ret) {
 		printk(KERN_ERR "kmi: failed to claim IRQ%d\n", kmi->irq);
 		writeb(0, KMICR);
-		return ret;
+		goto clk_disable;
 	}
 
 	writeb(KMICR_EN | KMICR_RXINTREN, KMICR);
 
 	return 0;
+
+ clk_disable:
+	clk_disable(kmi->clk);
+ clk_unuse:
+	clk_unuse(kmi->clk);
+ out:
+	return ret;
 }
 
 static void amba_kmi_close(struct serio *io)
@@ -91,6 +110,8 @@ static void amba_kmi_close(struct serio *io)
 	writeb(0, KMICR);
 
 	free_irq(kmi->irq, kmi);
+	clk_disable(kmi->clk);
+	clk_unuse(kmi->clk);
 }
 
 static int amba_kmi_probe(struct amba_device *dev, void *id)
@@ -124,14 +145,20 @@ static int amba_kmi_probe(struct amba_device *dev, void *id)
 		goto out;
 	}
 
-	kmi->irq	= dev->irq[0];
-	kmi->divisor	= 24 / 8 - 1;
+	kmi->clk = clk_get(&dev->dev, "KMIREFCLK");
+	if (IS_ERR(kmi->clk)) {
+		ret = PTR_ERR(kmi->clk);
+		goto unmap;
+	}
 
+	kmi->irq = dev->irq[0];
 	amba_set_drvdata(dev, kmi);
 
 	serio_register_port(&kmi->io);
 	return 0;
 
+ unmap:
+	iounmap(kmi->base);
  out:
 	kfree(kmi);
 	amba_release_regions(dev);
@@ -145,6 +172,7 @@ static int amba_kmi_remove(struct amba_device *dev)
 	amba_set_drvdata(dev, NULL);
 
 	serio_unregister_port(&kmi->io);
+	clk_put(kmi->clk);
 	iounmap(kmi->base);
 	kfree(kmi);
 	amba_release_regions(dev);
diff --git a/drivers/input/serio/i8042-io.h b/drivers/input/serio/i8042-io.h
index 9b36485fc..2cba08840 100644
--- a/drivers/input/serio/i8042-io.h
+++ b/drivers/input/serio/i8042-io.h
@@ -28,6 +28,8 @@
 #elif defined(__arm__)
 /* defined in include/asm-arm/arch-xxx/irqs.h */
 #include <asm/irq.h>
+#elif defined(CONFIG_SUPERH64)
+#include <asm/irq.h>
 #else
 # define I8042_KBD_IRQ	1
 # define I8042_AUX_IRQ	12
diff --git a/drivers/input/tsdev.c b/drivers/input/tsdev.c
index 7958ae857..ac072d37c 100644
--- a/drivers/input/tsdev.c
+++ b/drivers/input/tsdev.c
@@ -151,7 +151,7 @@ static int tsdev_release(struct inode *inode, struct file *file)
 	return 0;
 }
 
-static ssize_t tsdev_read(struct file *file, char *buffer, size_t count,
+static ssize_t tsdev_read(struct file *file, char __user *buffer, size_t count,
 			  loff_t * ppos)
 {
 	struct tsdev_list *list = file->private_data;
diff --git a/drivers/isdn/act2000/act2000.h b/drivers/isdn/act2000/act2000.h
index aa219cbbc..b091d1a54 100644
--- a/drivers/isdn/act2000/act2000.h
+++ b/drivers/isdn/act2000/act2000.h
@@ -15,6 +15,8 @@
 #ifndef act2000_h
 #define act2000_h
 
+#include <linux/compiler.h>
+
 #define ACT2000_IOCTL_SETPORT    1
 #define ACT2000_IOCTL_GETPORT    2
 #define ACT2000_IOCTL_SETIRQ     3
@@ -46,7 +48,7 @@ typedef struct act2000_cdef {
 /* Struct for downloading firmware */
 typedef struct act2000_ddef {
         int length;             /* Length of code */
-        char *buffer;           /* Ptr. to code   */
+        char __user *buffer;    /* Ptr. to code   */
 } act2000_ddef;
 
 typedef struct act2000_fwid {
diff --git a/drivers/isdn/act2000/act2000_isa.c b/drivers/isdn/act2000/act2000_isa.c
index 662a61e67..e84aa5fb3 100644
--- a/drivers/isdn/act2000/act2000_isa.c
+++ b/drivers/isdn/act2000/act2000_isa.c
@@ -405,7 +405,7 @@ act2000_isa_getid(act2000_card * card)
  * Download microcode into card, check Firmware signature.
  */
 int
-act2000_isa_download(act2000_card * card, act2000_ddef * cb)
+act2000_isa_download(act2000_card * card, act2000_ddef __user * cb)
 {
         unsigned int length;
         int ret;
@@ -413,18 +413,18 @@ act2000_isa_download(act2000_card * card, act2000_ddef * cb)
         int c;
         long timeout;
         u_char *b;
-        u_char *p;
+        u_char __user *p;
         u_char *buf;
         act2000_ddef cblock;
 
         if (!act2000_isa_reset(card->port))
                 return -ENXIO;
         act2000_isa_delay(HZ / 2);
-        if(copy_from_user(&cblock, (char *) cb, sizeof(cblock)))
+        if(copy_from_user(&cblock, cb, sizeof(cblock)))
         	return -EFAULT;
         length = cblock.length;
         p = cblock.buffer;
-        if ((ret = verify_area(VERIFY_READ, (void *) p, length)))
+        if ((ret = verify_area(VERIFY_READ, p, length)))
                 return ret;
         buf = (u_char *) kmalloc(1024, GFP_KERNEL);
         if (!buf)
diff --git a/drivers/isdn/act2000/act2000_isa.h b/drivers/isdn/act2000/act2000_isa.h
index caee2ba80..ad86c5ed9 100644
--- a/drivers/isdn/act2000/act2000_isa.h
+++ b/drivers/isdn/act2000/act2000_isa.h
@@ -128,7 +128,7 @@ typedef enum {
 extern int act2000_isa_detect(unsigned short portbase);
 extern int act2000_isa_config_irq(act2000_card * card, short irq);
 extern int act2000_isa_config_port(act2000_card * card, unsigned short portbase);
-extern int act2000_isa_download(act2000_card * card, act2000_ddef * cb);
+extern int act2000_isa_download(act2000_card * card, act2000_ddef __user * cb);
 extern void act2000_isa_release(act2000_card * card);
 extern void act2000_isa_receive(act2000_card *card);
 extern void act2000_isa_send(act2000_card *card);
diff --git a/drivers/isdn/act2000/module.c b/drivers/isdn/act2000/module.c
index 6129c8e50..07522663b 100644
--- a/drivers/isdn/act2000/module.c
+++ b/drivers/isdn/act2000/module.c
@@ -243,16 +243,18 @@ act2000_command(act2000_card * card, isdn_ctrl * c)
 	char tmp[17];
 	int ret;
 	unsigned long flags;
+	void __user *arg;
  
         switch (c->command) {
 		case ISDN_CMD_IOCTL:
 			memcpy(&a, c->parm.num, sizeof(ulong));
+			arg = (void __user *)a;
 			switch (c->arg) {
 				case ACT2000_IOCTL_LOADBOOT:
 					switch (card->bus) {
 						case ACT2000_BUS_ISA:
 							ret = act2000_isa_download(card,
-									   (act2000_ddef *)a);
+									   arg);
 							if (!ret) {
 								card->flags |= ACT2000_FLAGS_LOADED;
 								if (!(card->flags & ACT2000_FLAGS_IVALID)) {
@@ -278,7 +280,7 @@ act2000_command(act2000_card * card, isdn_ctrl * c)
 					actcapi_manufacturer_req_net(card);
 					return 0;
 				case ACT2000_IOCTL_SETMSN:
-					if (copy_from_user(tmp, (char *)a,
+					if (copy_from_user(tmp, arg,
 							   sizeof(tmp)))
 						return -EFAULT;
 					if ((ret = act2000_set_msn(card, tmp)))
@@ -287,7 +289,7 @@ act2000_command(act2000_card * card, isdn_ctrl * c)
 						return(actcapi_manufacturer_req_msn(card));
 					return 0;
 				case ACT2000_IOCTL_ADDCARD:
-					if (copy_from_user(&cdef, (char *)a,
+					if (copy_from_user(&cdef, arg,
 							   sizeof(cdef)))
 						return -EFAULT;
 					if (act2000_addcard(cdef.bus, cdef.port, cdef.irq, cdef.id))
@@ -463,18 +465,15 @@ act2000_sendbuf(act2000_card *card, int channel, int ack, struct sk_buff *skb)
 
 /* Read the Status-replies from the Interface */
 static int
-act2000_readstatus(u_char * buf, int len, int user, act2000_card * card)
+act2000_readstatus(u_char __user * buf, int len, act2000_card * card)
 {
         int count;
-        u_char *p;
+        u_char __user *p;
 
         for (p = buf, count = 0; count < len; p++, count++) {
                 if (card->status_buf_read == card->status_buf_write)
                         return count;
-                if (user)
-                        put_user(*card->status_buf_read++, p);
-                else
-                        *p = *card->status_buf_read++;
+		put_user(*card->status_buf_read++, p);
                 if (card->status_buf_read > card->status_buf_end)
                         card->status_buf_read = card->status_buf;
         }
@@ -514,7 +513,7 @@ if_command(isdn_ctrl * c)
 }
 
 static int
-if_writecmd(const u_char * buf, int len, int user, int id, int channel)
+if_writecmd(const u_char __user *buf, int len, int id, int channel)
 {
         act2000_card *card = act2000_findcard(id);
 
@@ -529,14 +528,14 @@ if_writecmd(const u_char * buf, int len, int user, int id, int channel)
 }
 
 static int
-if_readstatus(u_char * buf, int len, int user, int id, int channel)
+if_readstatus(u_char __user * buf, int len, int id, int channel)
 {
         act2000_card *card = act2000_findcard(id);
 	
         if (card) {
                 if (!card->flags & ACT2000_FLAGS_RUNNING)
                         return -ENODEV;
-                return (act2000_readstatus(buf, len, user, card));
+                return (act2000_readstatus(buf, len, card));
         }
         printk(KERN_ERR
                "act2000: if_readstatus called with invalid driverId!\n");
diff --git a/drivers/isdn/capi/capi.c b/drivers/isdn/capi/capi.c
index 8c86df4f2..3429d57e2 100644
--- a/drivers/isdn/capi/capi.c
+++ b/drivers/isdn/capi/capi.c
@@ -162,7 +162,7 @@ static int capincci_add_ack(struct capiminor *mp, u16 datahandle)
 	   printk(KERN_ERR "capi: alloc datahandle failed\n");
 	   return -1;
 	}
-	n->next = 0;
+	n->next = NULL;
 	n->datahandle = datahandle;
 	for (pp = &mp->ackqueue; *pp; pp = &(*pp)->next) ;
 	*pp = n;
@@ -211,7 +211,7 @@ static struct capiminor *capiminor_alloc(struct capi20_appl *ap, u32 ncci)
 	mp = kmalloc(sizeof(*mp), GFP_ATOMIC);
   	if (!mp) {
   		printk(KERN_ERR "capi: can't alloc capiminor\n");
-		return 0;
+		return NULL;
 	}
 
 	memset(mp, 0, sizeof(struct capiminor));
@@ -245,7 +245,7 @@ static struct capiminor *capiminor_alloc(struct capi20_appl *ap, u32 ncci)
 	if (!(minor < capi_ttyminors)) {
 		printk(KERN_NOTICE "capi: out of minors\n");
 			kfree(mp);
-		return 0;
+		return NULL;
 	}
 
 	return mp;
@@ -260,7 +260,7 @@ static void capiminor_free(struct capiminor *mp)
 	write_unlock_irqrestore(&capiminor_list_lock, flags);
 
 	if (mp->ttyskb) kfree_skb(mp->ttyskb);
-	mp->ttyskb = 0;
+	mp->ttyskb = NULL;
 	skb_queue_purge(&mp->inqueue);
 	skb_queue_purge(&mp->outqueue);
 	capiminor_del_all_ack(mp);
@@ -292,17 +292,17 @@ static struct capincci *capincci_alloc(struct capidev *cdev, u32 ncci)
 {
 	struct capincci *np, **pp;
 #ifdef CONFIG_ISDN_CAPI_MIDDLEWARE
-	struct capiminor *mp = 0;
+	struct capiminor *mp = NULL;
 #endif /* CONFIG_ISDN_CAPI_MIDDLEWARE */
 
 	np = kmalloc(sizeof(*np), GFP_ATOMIC);
 	if (!np)
-		return 0;
+		return NULL;
 	memset(np, 0, sizeof(struct capincci));
 	np->ncci = ncci;
 	np->cdev = cdev;
 #ifdef CONFIG_ISDN_CAPI_MIDDLEWARE
-	mp = 0;
+	mp = NULL;
 	if (cdev->userflags & CAPIFLAG_HIGHJACKING)
 		mp = np->minorp = capiminor_alloc(&cdev->ap, ncci);
 	if (mp) {
@@ -339,7 +339,7 @@ static void capincci_free(struct capidev *cdev, u32 ncci)
 				capifs_free_ncci(mp->minor);
 #endif
 				if (mp->tty) {
-					mp->nccip = 0;
+					mp->nccip = NULL;
 #ifdef _DEBUG_REFCOUNT
 					printk(KERN_DEBUG "reset mp->nccip\n");
 #endif
@@ -377,7 +377,7 @@ static struct capidev *capidev_alloc(void)
 
 	cdev = kmalloc(sizeof(*cdev), GFP_KERNEL);
 	if (!cdev)
-		return 0;
+		return NULL;
 	memset(cdev, 0, sizeof(struct capidev));
 
 	init_MUTEX(&cdev->ncci_list_sem);
@@ -473,7 +473,7 @@ static int handle_recv_skb(struct capiminor *mp, struct sk_buff *skb)
 		printk(KERN_DEBUG "capi: DATA_B3_RESP %u len=%d => ldisc\n",
 					datahandle, skb->len);
 #endif
-		mp->tty->ldisc.receive_buf(mp->tty, skb->data, 0, skb->len);
+		mp->tty->ldisc.receive_buf(mp->tty, skb->data, NULL, skb->len);
 		kfree_skb(skb);
 		return 0;
 
@@ -650,15 +650,12 @@ static void capi_recv_message(struct capi20_appl *ap, struct sk_buff *skb)
 /* -------- file_operations for capidev ----------------------------- */
 
 static ssize_t
-capi_read(struct file *file, char *buf, size_t count, loff_t *ppos)
+capi_read(struct file *file, char __user *buf, size_t count, loff_t *ppos)
 {
 	struct capidev *cdev = (struct capidev *)file->private_data;
 	struct sk_buff *skb;
 	size_t copied;
 
-	if (ppos != &file->f_pos)
-		return -ESPIPE;
-
 	if (!cdev->ap.applid)
 		return -ENODEV;
 
@@ -693,15 +690,12 @@ capi_read(struct file *file, char *buf, size_t count, loff_t *ppos)
 }
 
 static ssize_t
-capi_write(struct file *file, const char *buf, size_t count, loff_t *ppos)
+capi_write(struct file *file, const char __user *buf, size_t count, loff_t *ppos)
 {
 	struct capidev *cdev = (struct capidev *)file->private_data;
 	struct sk_buff *skb;
 	u16 mlen;
 
-        if (ppos != &file->f_pos)
-		return -ESPIPE;
-
 	if (!cdev->ap.applid)
 		return -ENODEV;
 
@@ -766,6 +760,7 @@ capi_ioctl(struct inode *inode, struct file *file,
 	struct capi20_appl *ap = &cdev->ap;
 	capi_ioctl_struct data;
 	int retval = -EINVAL;
+	void __user *argp = (void __user *)arg;
 
 	switch (cmd) {
 	case CAPI_REGISTER:
@@ -773,7 +768,7 @@ capi_ioctl(struct inode *inode, struct file *file,
 			if (ap->applid)
 				return -EEXIST;
 
-			if (copy_from_user(&cdev->ap.rparam, (void *) arg,
+			if (copy_from_user(&cdev->ap.rparam, argp,
 					   sizeof(struct capi_register_params)))
 				return -EFAULT;
 			
@@ -789,14 +784,13 @@ capi_ioctl(struct inode *inode, struct file *file,
 
 	case CAPI_GET_VERSION:
 		{
-			if (copy_from_user((void *) &data.contr,
-						(void *) arg,
+			if (copy_from_user(&data.contr, argp,
 						sizeof(data.contr)))
 				return -EFAULT;
 		        cdev->errcode = capi20_get_version(data.contr, &data.version);
 			if (cdev->errcode)
 				return -EIO;
-			if (copy_to_user((void *)arg, (void *)&data.version,
+			if (copy_to_user(argp, &data.version,
 					 sizeof(data.version)))
 				return -EFAULT;
 		}
@@ -804,20 +798,20 @@ capi_ioctl(struct inode *inode, struct file *file,
 
 	case CAPI_GET_SERIAL:
 		{
-			if (copy_from_user((void *)&data.contr, (void *)arg,
+			if (copy_from_user(&data.contr, argp,
 					   sizeof(data.contr)))
 				return -EFAULT;
 			cdev->errcode = capi20_get_serial (data.contr, data.serial);
 			if (cdev->errcode)
 				return -EIO;
-			if (copy_to_user((void *)arg, (void *)data.serial,
+			if (copy_to_user(argp, data.serial,
 					 sizeof(data.serial)))
 				return -EFAULT;
 		}
 		return 0;
 	case CAPI_GET_PROFILE:
 		{
-			if (copy_from_user((void *)&data.contr, (void *)arg,
+			if (copy_from_user(&data.contr, argp,
 					   sizeof(data.contr)))
 				return -EFAULT;
 
@@ -826,8 +820,8 @@ capi_ioctl(struct inode *inode, struct file *file,
 				if (cdev->errcode)
 					return -EIO;
 
-				retval = copy_to_user((void *) arg,
-				      (void *) &data.profile.ncontroller,
+				retval = copy_to_user(argp,
+				      &data.profile.ncontroller,
 				       sizeof(data.profile.ncontroller));
 
 			} else {
@@ -835,8 +829,7 @@ capi_ioctl(struct inode *inode, struct file *file,
 				if (cdev->errcode)
 					return -EIO;
 
-				retval = copy_to_user((void *) arg,
-						  (void *) &data.profile,
+				retval = copy_to_user(argp, &data.profile,
 						   sizeof(data.profile));
 			}
 			if (retval)
@@ -846,14 +839,14 @@ capi_ioctl(struct inode *inode, struct file *file,
 
 	case CAPI_GET_MANUFACTURER:
 		{
-			if (copy_from_user((void *)&data.contr, (void *)arg,
+			if (copy_from_user(&data.contr, argp,
 					   sizeof(data.contr)))
 				return -EFAULT;
 			cdev->errcode = capi20_get_manufacturer(data.contr, data.manufacturer);
 			if (cdev->errcode)
 				return -EIO;
 
-			if (copy_to_user((void *)arg, (void *)data.manufacturer,
+			if (copy_to_user(argp, data.manufacturer,
 					 sizeof(data.manufacturer)))
 				return -EFAULT;
 
@@ -863,7 +856,7 @@ capi_ioctl(struct inode *inode, struct file *file,
 		data.errcode = cdev->errcode;
 		cdev->errcode = CAPI_NOERROR;
 		if (arg) {
-			if (copy_to_user((void *)arg, (void *)&data.errcode,
+			if (copy_to_user(argp, &data.errcode,
 					 sizeof(data.errcode)))
 				return -EFAULT;
 		}
@@ -879,8 +872,7 @@ capi_ioctl(struct inode *inode, struct file *file,
 			struct capi_manufacturer_cmd mcmd;
 			if (!capable(CAP_SYS_ADMIN))
 				return -EPERM;
-			if (copy_from_user((void *)&mcmd, (void *)arg,
-					   sizeof(mcmd)))
+			if (copy_from_user(&mcmd, argp, sizeof(mcmd)))
 				return -EFAULT;
 			return capi20_manufacturer(mcmd.cmd, mcmd.data);
 		}
@@ -890,7 +882,7 @@ capi_ioctl(struct inode *inode, struct file *file,
 	case CAPI_CLR_FLAGS:
 		{
 			unsigned userflags;
-			if (copy_from_user((void *)&userflags, (void *)arg,
+			if (copy_from_user(&userflags, argp,
 					   sizeof(userflags)))
 				return -EFAULT;
 			if (cmd == CAPI_SET_FLAGS)
@@ -901,7 +893,7 @@ capi_ioctl(struct inode *inode, struct file *file,
 		return 0;
 
 	case CAPI_GET_FLAGS:
-		if (copy_to_user((void *)arg, (void *)&cdev->userflags,
+		if (copy_to_user(argp, &cdev->userflags,
 				 sizeof(cdev->userflags)))
 			return -EFAULT;
 		return 0;
@@ -914,8 +906,7 @@ capi_ioctl(struct inode *inode, struct file *file,
 #endif /* CONFIG_ISDN_CAPI_MIDDLEWARE */
 			unsigned ncci;
 			int count = 0;
-			if (copy_from_user((void *)&ncci, (void *)arg,
-					   sizeof(ncci)))
+			if (copy_from_user(&ncci, argp, sizeof(ncci)))
 				return -EFAULT;
 
 			down(&cdev->ncci_list_sem);
@@ -940,7 +931,7 @@ capi_ioctl(struct inode *inode, struct file *file,
 			struct capiminor *mp;
 			unsigned ncci;
 			int unit = 0;
-			if (copy_from_user((void *)&ncci, (void *)arg,
+			if (copy_from_user(&ncci, argp,
 					   sizeof(ncci)))
 				return -EFAULT;
 			down(&cdev->ncci_list_sem);
@@ -968,7 +959,7 @@ capi_open(struct inode *inode, struct file *file)
 	if ((file->private_data = capidev_alloc()) == 0)
 		return -ENOMEM;
 
-	return 0;
+	return nonseekable_open(inode, file);
 }
 
 static int
@@ -1028,8 +1019,8 @@ static void capinc_tty_close(struct tty_struct * tty, struct file * file)
 #ifdef _DEBUG_REFCOUNT
 			printk(KERN_DEBUG "capinc_tty_close lastclose\n");
 #endif
-			tty->driver_data = (void *)0;
-			mp->tty = 0;
+			tty->driver_data = NULL;
+			mp->tty = NULL;
 		}
 #ifdef _DEBUG_REFCOUNT
 		printk(KERN_DEBUG "capinc_tty_close ocount=%d\n", atomic_read(&mp->ttyopencount));
@@ -1064,7 +1055,7 @@ static int capinc_tty_write(struct tty_struct * tty, int from_user,
 
 	skb = mp->ttyskb;
 	if (skb) {
-		mp->ttyskb = 0;
+		mp->ttyskb = NULL;
 		skb_queue_tail(&mp->outqueue, skb);
 		mp->outbytes += skb->len;
 	}
@@ -1077,7 +1068,8 @@ static int capinc_tty_write(struct tty_struct * tty, int from_user,
 
 	skb_reserve(skb, CAPI_DATA_B3_REQ_LEN);
 	if (from_user) {
-		if ((retval = copy_from_user(skb_put(skb, count), buf, count))) {
+		retval = copy_from_user(skb_put(skb, count), buf, count);
+		if (retval) {
 			kfree_skb(skb);
 #ifdef _DEBUG_TTYFUNCS
 			printk(KERN_DEBUG "capinc_tty_write: copy_from_user=%d\n", retval);
@@ -1117,7 +1109,7 @@ static void capinc_tty_put_char(struct tty_struct *tty, unsigned char ch)
 			*(skb_put(skb, 1)) = ch;
 			return;
 		}
-		mp->ttyskb = 0;
+		mp->ttyskb = NULL;
 		skb_queue_tail(&mp->outqueue, skb);
 		mp->outbytes += skb->len;
 		(void)handle_minor_send(mp);
@@ -1150,7 +1142,7 @@ static void capinc_tty_flush_chars(struct tty_struct *tty)
 
 	skb = mp->ttyskb;
 	if (skb) {
-		mp->ttyskb = 0;
+		mp->ttyskb = NULL;
 		skb_queue_tail(&mp->outqueue, skb);
 		mp->outbytes += skb->len;
 		(void)handle_minor_send(mp);
@@ -1468,7 +1460,7 @@ static void __init proc_init(void)
 
     for (i=0; i < nelem; i++) {
         struct procfsentries *p = procfsentries + i;
-	p->procent = create_proc_entry(p->name, p->mode, 0);
+	p->procent = create_proc_entry(p->name, p->mode, NULL);
 	if (p->procent) p->procent->read_proc = p->read_proc;
     }
 }
@@ -1481,8 +1473,8 @@ static void __exit proc_exit(void)
     for (i=nelem-1; i >= 0; i--) {
         struct procfsentries *p = procfsentries + i;
 	if (p->procent) {
-	   remove_proc_entry(p->name, 0);
-	   p->procent = 0;
+	   remove_proc_entry(p->name, NULL);
+	   p->procent = NULL;
 	}
     }
 }
diff --git a/drivers/isdn/capi/capidrv.c b/drivers/isdn/capi/capidrv.c
index 36ee8c2d0..150e31d32 100644
--- a/drivers/isdn/capi/capidrv.c
+++ b/drivers/isdn/capi/capidrv.c
@@ -230,7 +230,7 @@ static _cstruct b1config(int l2, int l3)
 	case ISDN_PROTO_L2_HDLC:
 	case ISDN_PROTO_L2_TRANS:
 	default:
-		return 0;
+		return NULL;
         case ISDN_PROTO_L2_V11096:
 	    return b1config_async_v110(9600);
         case ISDN_PROTO_L2_V11019:
@@ -336,7 +336,7 @@ static capidrv_plci *new_plci(capidrv_contr * card, int chan)
 	plcip = (capidrv_plci *) kmalloc(sizeof(capidrv_plci), GFP_ATOMIC);
 
 	if (plcip == 0)
-		return 0;
+		return NULL;
 
 	memset(plcip, 0, sizeof(capidrv_plci));
 	plcip->state = ST_PLCI_NONE;
@@ -356,7 +356,7 @@ static capidrv_plci *find_plci_by_plci(capidrv_contr * card, u32 plci)
 	for (p = card->plci_list; p; p = p->next)
 		if (p->plci == plci)
 			return p;
-	return 0;
+	return NULL;
 }
 
 static capidrv_plci *find_plci_by_msgid(capidrv_contr * card, u16 msgid)
@@ -365,7 +365,7 @@ static capidrv_plci *find_plci_by_msgid(capidrv_contr * card, u16 msgid)
 	for (p = card->plci_list; p; p = p->next)
 		if (p->msgid == msgid)
 			return p;
-	return 0;
+	return NULL;
 }
 
 static capidrv_plci *find_plci_by_ncci(capidrv_contr * card, u32 ncci)
@@ -374,7 +374,7 @@ static capidrv_plci *find_plci_by_ncci(capidrv_contr * card, u32 ncci)
 	for (p = card->plci_list; p; p = p->next)
 		if (p->plci == (ncci & 0xffff))
 			return p;
-	return 0;
+	return NULL;
 }
 
 static void free_plci(capidrv_contr * card, capidrv_plci * plcip)
@@ -384,7 +384,7 @@ static void free_plci(capidrv_contr * card, capidrv_plci * plcip)
 	for (pp = &card->plci_list; *pp; pp = &(*pp)->next) {
 		if (*pp == plcip) {
 			*pp = (*pp)->next;
-			card->bchans[plcip->chan].plcip = 0;
+			card->bchans[plcip->chan].plcip = NULL;
 			card->bchans[plcip->chan].disconnecting = 0;
 			card->bchans[plcip->chan].incoming = 0;
 			kfree(plcip);
@@ -406,7 +406,7 @@ static inline capidrv_ncci *new_ncci(capidrv_contr * card,
 	nccip = (capidrv_ncci *) kmalloc(sizeof(capidrv_ncci), GFP_ATOMIC);
 
 	if (nccip == 0)
-		return 0;
+		return NULL;
 
 	memset(nccip, 0, sizeof(capidrv_ncci));
 	nccip->ncci = ncci;
@@ -429,12 +429,12 @@ static inline capidrv_ncci *find_ncci(capidrv_contr * card, u32 ncci)
 	capidrv_ncci *p;
 
 	if ((plcip = find_plci_by_ncci(card, ncci)) == 0)
-		return 0;
+		return NULL;
 
 	for (p = plcip->ncci_list; p; p = p->next)
 		if (p->ncci == ncci)
 			return p;
-	return 0;
+	return NULL;
 }
 
 static inline capidrv_ncci *find_ncci_by_msgid(capidrv_contr * card,
@@ -444,12 +444,12 @@ static inline capidrv_ncci *find_ncci_by_msgid(capidrv_contr * card,
 	capidrv_ncci *p;
 
 	if ((plcip = find_plci_by_ncci(card, ncci)) == 0)
-		return 0;
+		return NULL;
 
 	for (p = plcip->ncci_list; p; p = p->next)
 		if (p->msgid == msgid)
 			return p;
-	return 0;
+	return NULL;
 }
 
 static void free_ncci(capidrv_contr * card, struct capidrv_ncci *nccip)
@@ -462,7 +462,7 @@ static void free_ncci(capidrv_contr * card, struct capidrv_ncci *nccip)
 			break;
 		}
 	}
-	card->bchans[nccip->chan].nccip = 0;
+	card->bchans[nccip->chan].nccip = NULL;
 	kfree(nccip);
 }
 
@@ -477,7 +477,7 @@ static int capidrv_add_ack(struct capidrv_ncci *nccip,
 	   printk(KERN_ERR "capidrv: kmalloc ncci_datahandle failed\n");
 	   return -1;
 	}
-	n->next = 0;
+	n->next = NULL;
 	n->datahandle = datahandle;
 	n->len = len;
 	for (pp = &nccip->ackqueue; *pp; pp = &(*pp)->next) ;
@@ -560,7 +560,7 @@ static void p0(capidrv_contr * card, capidrv_plci * plci)
 {
 	isdn_ctrl cmd;
 
-	card->bchans[plci->chan].contr = 0;
+	card->bchans[plci->chan].contr = NULL;
 	cmd.command = ISDN_STAT_DHUP;
 	cmd.driver = card->myid;
 	cmd.arg = plci->chan;
@@ -580,54 +580,54 @@ struct plcistatechange {
 static struct plcistatechange plcitable[] =
 {
   /* P-0 */
-  {ST_PLCI_NONE, ST_PLCI_OUTGOING, EV_PLCI_CONNECT_REQ, 0},
-  {ST_PLCI_NONE, ST_PLCI_ALLOCATED, EV_PLCI_FACILITY_IND_UP, 0},
-  {ST_PLCI_NONE, ST_PLCI_INCOMING, EV_PLCI_CONNECT_IND, 0},
-  {ST_PLCI_NONE, ST_PLCI_RESUMEING, EV_PLCI_RESUME_REQ, 0},
+  {ST_PLCI_NONE, ST_PLCI_OUTGOING, EV_PLCI_CONNECT_REQ, NULL},
+  {ST_PLCI_NONE, ST_PLCI_ALLOCATED, EV_PLCI_FACILITY_IND_UP, NULL},
+  {ST_PLCI_NONE, ST_PLCI_INCOMING, EV_PLCI_CONNECT_IND, NULL},
+  {ST_PLCI_NONE, ST_PLCI_RESUMEING, EV_PLCI_RESUME_REQ, NULL},
   /* P-0.1 */
   {ST_PLCI_OUTGOING, ST_PLCI_NONE, EV_PLCI_CONNECT_CONF_ERROR, p0},
-  {ST_PLCI_OUTGOING, ST_PLCI_ALLOCATED, EV_PLCI_CONNECT_CONF_OK, 0},
+  {ST_PLCI_OUTGOING, ST_PLCI_ALLOCATED, EV_PLCI_CONNECT_CONF_OK, NULL},
   /* P-1 */
-  {ST_PLCI_ALLOCATED, ST_PLCI_ACTIVE, EV_PLCI_CONNECT_ACTIVE_IND, 0},
-  {ST_PLCI_ALLOCATED, ST_PLCI_DISCONNECTING, EV_PLCI_DISCONNECT_REQ, 0},
-  {ST_PLCI_ALLOCATED, ST_PLCI_DISCONNECTING, EV_PLCI_FACILITY_IND_DOWN, 0},
-  {ST_PLCI_ALLOCATED, ST_PLCI_DISCONNECTED, EV_PLCI_DISCONNECT_IND, 0},
+  {ST_PLCI_ALLOCATED, ST_PLCI_ACTIVE, EV_PLCI_CONNECT_ACTIVE_IND, NULL},
+  {ST_PLCI_ALLOCATED, ST_PLCI_DISCONNECTING, EV_PLCI_DISCONNECT_REQ, NULL},
+  {ST_PLCI_ALLOCATED, ST_PLCI_DISCONNECTING, EV_PLCI_FACILITY_IND_DOWN, NULL},
+  {ST_PLCI_ALLOCATED, ST_PLCI_DISCONNECTED, EV_PLCI_DISCONNECT_IND, NULL},
   /* P-ACT */
-  {ST_PLCI_ACTIVE, ST_PLCI_DISCONNECTING, EV_PLCI_DISCONNECT_REQ, 0},
-  {ST_PLCI_ACTIVE, ST_PLCI_DISCONNECTING, EV_PLCI_FACILITY_IND_DOWN, 0},
-  {ST_PLCI_ACTIVE, ST_PLCI_DISCONNECTED, EV_PLCI_DISCONNECT_IND, 0},
-  {ST_PLCI_ACTIVE, ST_PLCI_HELD, EV_PLCI_HOLD_IND, 0},
-  {ST_PLCI_ACTIVE, ST_PLCI_DISCONNECTING, EV_PLCI_SUSPEND_IND, 0},
+  {ST_PLCI_ACTIVE, ST_PLCI_DISCONNECTING, EV_PLCI_DISCONNECT_REQ, NULL},
+  {ST_PLCI_ACTIVE, ST_PLCI_DISCONNECTING, EV_PLCI_FACILITY_IND_DOWN, NULL},
+  {ST_PLCI_ACTIVE, ST_PLCI_DISCONNECTED, EV_PLCI_DISCONNECT_IND, NULL},
+  {ST_PLCI_ACTIVE, ST_PLCI_HELD, EV_PLCI_HOLD_IND, NULL},
+  {ST_PLCI_ACTIVE, ST_PLCI_DISCONNECTING, EV_PLCI_SUSPEND_IND, NULL},
   /* P-2 */
-  {ST_PLCI_INCOMING, ST_PLCI_DISCONNECTING, EV_PLCI_CONNECT_REJECT, 0},
-  {ST_PLCI_INCOMING, ST_PLCI_FACILITY_IND, EV_PLCI_FACILITY_IND_UP, 0},
-  {ST_PLCI_INCOMING, ST_PLCI_ACCEPTING, EV_PLCI_CONNECT_RESP, 0},
-  {ST_PLCI_INCOMING, ST_PLCI_DISCONNECTING, EV_PLCI_DISCONNECT_REQ, 0},
-  {ST_PLCI_INCOMING, ST_PLCI_DISCONNECTING, EV_PLCI_FACILITY_IND_DOWN, 0},
-  {ST_PLCI_INCOMING, ST_PLCI_DISCONNECTED, EV_PLCI_DISCONNECT_IND, 0},
-  {ST_PLCI_INCOMING, ST_PLCI_DISCONNECTING, EV_PLCI_CD_IND, 0},
+  {ST_PLCI_INCOMING, ST_PLCI_DISCONNECTING, EV_PLCI_CONNECT_REJECT, NULL},
+  {ST_PLCI_INCOMING, ST_PLCI_FACILITY_IND, EV_PLCI_FACILITY_IND_UP, NULL},
+  {ST_PLCI_INCOMING, ST_PLCI_ACCEPTING, EV_PLCI_CONNECT_RESP, NULL},
+  {ST_PLCI_INCOMING, ST_PLCI_DISCONNECTING, EV_PLCI_DISCONNECT_REQ, NULL},
+  {ST_PLCI_INCOMING, ST_PLCI_DISCONNECTING, EV_PLCI_FACILITY_IND_DOWN, NULL},
+  {ST_PLCI_INCOMING, ST_PLCI_DISCONNECTED, EV_PLCI_DISCONNECT_IND, NULL},
+  {ST_PLCI_INCOMING, ST_PLCI_DISCONNECTING, EV_PLCI_CD_IND, NULL},
   /* P-3 */
-  {ST_PLCI_FACILITY_IND, ST_PLCI_DISCONNECTING, EV_PLCI_CONNECT_REJECT, 0},
-  {ST_PLCI_FACILITY_IND, ST_PLCI_ACCEPTING, EV_PLCI_CONNECT_ACTIVE_IND, 0},
-  {ST_PLCI_FACILITY_IND, ST_PLCI_DISCONNECTING, EV_PLCI_DISCONNECT_REQ, 0},
-  {ST_PLCI_FACILITY_IND, ST_PLCI_DISCONNECTING, EV_PLCI_FACILITY_IND_DOWN, 0},
-  {ST_PLCI_FACILITY_IND, ST_PLCI_DISCONNECTED, EV_PLCI_DISCONNECT_IND, 0},
+  {ST_PLCI_FACILITY_IND, ST_PLCI_DISCONNECTING, EV_PLCI_CONNECT_REJECT, NULL},
+  {ST_PLCI_FACILITY_IND, ST_PLCI_ACCEPTING, EV_PLCI_CONNECT_ACTIVE_IND, NULL},
+  {ST_PLCI_FACILITY_IND, ST_PLCI_DISCONNECTING, EV_PLCI_DISCONNECT_REQ, NULL},
+  {ST_PLCI_FACILITY_IND, ST_PLCI_DISCONNECTING, EV_PLCI_FACILITY_IND_DOWN, NULL},
+  {ST_PLCI_FACILITY_IND, ST_PLCI_DISCONNECTED, EV_PLCI_DISCONNECT_IND, NULL},
   /* P-4 */
-  {ST_PLCI_ACCEPTING, ST_PLCI_ACTIVE, EV_PLCI_CONNECT_ACTIVE_IND, 0},
-  {ST_PLCI_ACCEPTING, ST_PLCI_DISCONNECTING, EV_PLCI_DISCONNECT_REQ, 0},
-  {ST_PLCI_ACCEPTING, ST_PLCI_DISCONNECTING, EV_PLCI_FACILITY_IND_DOWN, 0},
-  {ST_PLCI_ACCEPTING, ST_PLCI_DISCONNECTED, EV_PLCI_DISCONNECT_IND, 0},
+  {ST_PLCI_ACCEPTING, ST_PLCI_ACTIVE, EV_PLCI_CONNECT_ACTIVE_IND, NULL},
+  {ST_PLCI_ACCEPTING, ST_PLCI_DISCONNECTING, EV_PLCI_DISCONNECT_REQ, NULL},
+  {ST_PLCI_ACCEPTING, ST_PLCI_DISCONNECTING, EV_PLCI_FACILITY_IND_DOWN, NULL},
+  {ST_PLCI_ACCEPTING, ST_PLCI_DISCONNECTED, EV_PLCI_DISCONNECT_IND, NULL},
   /* P-5 */
-  {ST_PLCI_DISCONNECTING, ST_PLCI_DISCONNECTED, EV_PLCI_DISCONNECT_IND, 0},
+  {ST_PLCI_DISCONNECTING, ST_PLCI_DISCONNECTED, EV_PLCI_DISCONNECT_IND, NULL},
   /* P-6 */
   {ST_PLCI_DISCONNECTED, ST_PLCI_NONE, EV_PLCI_DISCONNECT_RESP, p0},
   /* P-0.Res */
   {ST_PLCI_RESUMEING, ST_PLCI_NONE, EV_PLCI_RESUME_CONF_ERROR, p0},
-  {ST_PLCI_RESUMEING, ST_PLCI_RESUME, EV_PLCI_RESUME_CONF_OK, 0},
+  {ST_PLCI_RESUMEING, ST_PLCI_RESUME, EV_PLCI_RESUME_CONF_OK, NULL},
   /* P-RES */
-  {ST_PLCI_RESUME, ST_PLCI_ACTIVE, EV_PLCI_RESUME_IND, 0},
+  {ST_PLCI_RESUME, ST_PLCI_ACTIVE, EV_PLCI_RESUME_IND, NULL},
   /* P-HELD */
-  {ST_PLCI_HELD, ST_PLCI_ACTIVE, EV_PLCI_RETRIEVE_IND, 0},
+  {ST_PLCI_HELD, ST_PLCI_ACTIVE, EV_PLCI_RETRIEVE_IND, NULL},
   {},
 };
 
@@ -662,10 +662,10 @@ static void n0(capidrv_contr * card, capidrv_ncci * ncci)
 				 global.ap.applid,
 				 card->msgid++,
 				 ncci->plcip->plci,
-				 0,	/* BChannelinformation */
-				 0,	/* Keypadfacility */
-				 0,	/* Useruserdata */   /* $$$$ */
-				 0	/* Facilitydataarray */
+				 NULL,	/* BChannelinformation */
+				 NULL,	/* Keypadfacility */
+				 NULL,	/* Useruserdata */   /* $$$$ */
+				 NULL	/* Facilitydataarray */
 	);
 	send_message(card, &cmsg);
 	plci_change_state(card, ncci->plcip, EV_PLCI_DISCONNECT_REQ);
@@ -689,32 +689,32 @@ struct nccistatechange {
 static struct nccistatechange nccitable[] =
 {
   /* N-0 */
-  {ST_NCCI_NONE, ST_NCCI_OUTGOING, EV_NCCI_CONNECT_B3_REQ, 0},
-  {ST_NCCI_NONE, ST_NCCI_INCOMING, EV_NCCI_CONNECT_B3_IND, 0},
+  {ST_NCCI_NONE, ST_NCCI_OUTGOING, EV_NCCI_CONNECT_B3_REQ, NULL},
+  {ST_NCCI_NONE, ST_NCCI_INCOMING, EV_NCCI_CONNECT_B3_IND, NULL},
   /* N-0.1 */
-  {ST_NCCI_OUTGOING, ST_NCCI_ALLOCATED, EV_NCCI_CONNECT_B3_CONF_OK, 0},
+  {ST_NCCI_OUTGOING, ST_NCCI_ALLOCATED, EV_NCCI_CONNECT_B3_CONF_OK, NULL},
   {ST_NCCI_OUTGOING, ST_NCCI_NONE, EV_NCCI_CONNECT_B3_CONF_ERROR, n0},
   /* N-1 */
-  {ST_NCCI_INCOMING, ST_NCCI_DISCONNECTING, EV_NCCI_CONNECT_B3_REJECT, 0},
-  {ST_NCCI_INCOMING, ST_NCCI_ALLOCATED, EV_NCCI_CONNECT_B3_RESP, 0},
-  {ST_NCCI_INCOMING, ST_NCCI_DISCONNECTED, EV_NCCI_DISCONNECT_B3_IND, 0},
-  {ST_NCCI_INCOMING, ST_NCCI_DISCONNECTING, EV_NCCI_DISCONNECT_B3_REQ, 0},
+  {ST_NCCI_INCOMING, ST_NCCI_DISCONNECTING, EV_NCCI_CONNECT_B3_REJECT, NULL},
+  {ST_NCCI_INCOMING, ST_NCCI_ALLOCATED, EV_NCCI_CONNECT_B3_RESP, NULL},
+  {ST_NCCI_INCOMING, ST_NCCI_DISCONNECTED, EV_NCCI_DISCONNECT_B3_IND, NULL},
+  {ST_NCCI_INCOMING, ST_NCCI_DISCONNECTING, EV_NCCI_DISCONNECT_B3_REQ, NULL},
   /* N-2 */
-  {ST_NCCI_ALLOCATED, ST_NCCI_ACTIVE, EV_NCCI_CONNECT_B3_ACTIVE_IND, 0},
-  {ST_NCCI_ALLOCATED, ST_NCCI_DISCONNECTED, EV_NCCI_DISCONNECT_B3_IND, 0},
-  {ST_NCCI_ALLOCATED, ST_NCCI_DISCONNECTING, EV_NCCI_DISCONNECT_B3_REQ, 0},
+  {ST_NCCI_ALLOCATED, ST_NCCI_ACTIVE, EV_NCCI_CONNECT_B3_ACTIVE_IND, NULL},
+  {ST_NCCI_ALLOCATED, ST_NCCI_DISCONNECTED, EV_NCCI_DISCONNECT_B3_IND, NULL},
+  {ST_NCCI_ALLOCATED, ST_NCCI_DISCONNECTING, EV_NCCI_DISCONNECT_B3_REQ, NULL},
   /* N-ACT */
-  {ST_NCCI_ACTIVE, ST_NCCI_ACTIVE, EV_NCCI_RESET_B3_IND, 0},
-  {ST_NCCI_ACTIVE, ST_NCCI_RESETING, EV_NCCI_RESET_B3_REQ, 0},
-  {ST_NCCI_ACTIVE, ST_NCCI_DISCONNECTED, EV_NCCI_DISCONNECT_B3_IND, 0},
-  {ST_NCCI_ACTIVE, ST_NCCI_DISCONNECTING, EV_NCCI_DISCONNECT_B3_REQ, 0},
+  {ST_NCCI_ACTIVE, ST_NCCI_ACTIVE, EV_NCCI_RESET_B3_IND, NULL},
+  {ST_NCCI_ACTIVE, ST_NCCI_RESETING, EV_NCCI_RESET_B3_REQ, NULL},
+  {ST_NCCI_ACTIVE, ST_NCCI_DISCONNECTED, EV_NCCI_DISCONNECT_B3_IND, NULL},
+  {ST_NCCI_ACTIVE, ST_NCCI_DISCONNECTING, EV_NCCI_DISCONNECT_B3_REQ, NULL},
   /* N-3 */
-  {ST_NCCI_RESETING, ST_NCCI_ACTIVE, EV_NCCI_RESET_B3_IND, 0},
-  {ST_NCCI_RESETING, ST_NCCI_DISCONNECTED, EV_NCCI_DISCONNECT_B3_IND, 0},
-  {ST_NCCI_RESETING, ST_NCCI_DISCONNECTING, EV_NCCI_DISCONNECT_B3_REQ, 0},
+  {ST_NCCI_RESETING, ST_NCCI_ACTIVE, EV_NCCI_RESET_B3_IND, NULL},
+  {ST_NCCI_RESETING, ST_NCCI_DISCONNECTED, EV_NCCI_DISCONNECT_B3_IND, NULL},
+  {ST_NCCI_RESETING, ST_NCCI_DISCONNECTING, EV_NCCI_DISCONNECT_B3_REQ, NULL},
   /* N-4 */
-  {ST_NCCI_DISCONNECTING, ST_NCCI_DISCONNECTED, EV_NCCI_DISCONNECT_B3_IND, 0},
-  {ST_NCCI_DISCONNECTING, ST_NCCI_PREVIOUS, EV_NCCI_DISCONNECT_B3_CONF_ERROR,0},
+  {ST_NCCI_DISCONNECTING, ST_NCCI_DISCONNECTED, EV_NCCI_DISCONNECT_B3_IND, NULL},
+  {ST_NCCI_DISCONNECTING, ST_NCCI_PREVIOUS, EV_NCCI_DISCONNECT_B3_CONF_ERROR,NULL},
   /* N-5 */
   {ST_NCCI_DISCONNECTED, ST_NCCI_NONE, EV_NCCI_DISCONNECT_B3_RESP, n0},
   {},
@@ -821,7 +821,7 @@ static void handle_controller(_cmsg * cmsg)
 		goto ignored;
 	case CAPI_MANUFACTURER_CONF:	/* Controller */
 		if (cmsg->ManuID == 0x214D5641) {
-		   char *s = 0;
+		   char *s = NULL;
 		   switch (cmsg->Class) {
 		      case 0: break;
 		      case 1: s = "unknown class"; break;
@@ -950,10 +950,10 @@ static void handle_incoming_call(capidrv_contr * card, _cmsg * cmsg)
 					    global.ap.applid,
 					    card->msgid++,
 					    plcip->plci,	/* adr */
-					    0,	/* BChannelinformation */
-					    0,	/* Keypadfacility */
-					    0,	/* Useruserdata */
-					    0	/* Facilitydataarray */
+					    NULL,/* BChannelinformation */
+					    NULL,/* Keypadfacility */
+					    NULL,/* Useruserdata */
+					    NULL /* Facilitydataarray */
 			);
 			plcip->msgid = cmsg->Messagenumber;
 			send_message(card, cmsg);
@@ -1090,7 +1090,7 @@ static void handle_plci(_cmsg * cmsg)
 						 global.ap.applid,
 						 card->msgid++,
 						 plcip->plci,	/* adr */
-						 0	/* NCPI */
+						 NULL	/* NCPI */
 			);
 			nccip->msgid = cmsg->Messagenumber;
 			send_message(card, cmsg);
@@ -1208,7 +1208,7 @@ static void handle_ncci(_cmsg * cmsg)
 							  card->msgid++,
 							  nccip->ncci,	/* adr */
 							  0,	/* Reject */
-							  0	/* NCPI */
+							  NULL	/* NCPI */
 				);
 				send_message(card, cmsg);
 				ncci_change_state(card, nccip, EV_NCCI_CONNECT_B3_RESP);
@@ -1226,7 +1226,7 @@ static void handle_ncci(_cmsg * cmsg)
 					  card->msgid++,
 					  cmsg->adr.adrNCCI,
 					  2,	/* Reject */
-					  0	/* NCPI */
+					  NULL	/* NCPI */
 		);
 		send_message(card, cmsg);
 		break;
@@ -1624,22 +1624,22 @@ static int capidrv_command(isdn_ctrl * c, capidrv_contr * card)
 					  si2cip(bchan->si1, bchan->si2),	/* cipvalue */
 					      called,	/* CalledPartyNumber */
 					      calling,	/* CallingPartyNumber */
-					      0,	/* CalledPartySubaddress */
-					      0,	/* CallingPartySubaddress */
+					      NULL,	/* CalledPartySubaddress */
+					      NULL,	/* CallingPartySubaddress */
 					    b1prot(bchan->l2, bchan->l3),	/* B1protocol */
 					    b2prot(bchan->l2, bchan->l3),	/* B2protocol */
 					    b3prot(bchan->l2, bchan->l3),	/* B3protocol */
 					    b1config(bchan->l2, bchan->l3),	/* B1configuration */
-					      0,	/* B2configuration */
-					      0,	/* B3configuration */
-					      0,	/* BC */
-					      0,	/* LLC */
-					      0,	/* HLC */
+					      NULL,	/* B2configuration */
+					      NULL,	/* B3configuration */
+					      NULL,	/* BC */
+					      NULL,	/* LLC */
+					      NULL,	/* HLC */
 					      /* BChannelinformation */
-					      isleasedline ? AdditionalInfo : 0,
-					      0,	/* Keypadfacility */
-					      0,	/* Useruserdata */
-					      0		/* Facilitydataarray */
+					      isleasedline ? AdditionalInfo : NULL,
+					      NULL,	/* Keypadfacility */
+					      NULL,	/* Useruserdata */
+					      NULL	/* Facilitydataarray */
 			    );
 			if ((plcip = new_plci(card, (c->arg % card->nbchan))) == 0) {
 				cmd.command = ISDN_STAT_DHUP;
@@ -1672,15 +1672,15 @@ static int capidrv_command(isdn_ctrl * c, capidrv_contr * card)
 				       b2prot(bchan->l2, bchan->l3),	/* B2protocol */
 				       b3prot(bchan->l2, bchan->l3),	/* B3protocol */
 				       b1config(bchan->l2, bchan->l3),	/* B1configuration */
-				       0,	/* B2configuration */
-				       0,	/* B3configuration */
-				       0,	/* ConnectedNumber */
-				       0,	/* ConnectedSubaddress */
-				       0,	/* LLC */
-				       0,	/* BChannelinformation */
-				       0,	/* Keypadfacility */
-				       0,	/* Useruserdata */
-				       0	/* Facilitydataarray */
+				       NULL,	/* B2configuration */
+				       NULL,	/* B3configuration */
+				       NULL,	/* ConnectedNumber */
+				       NULL,	/* ConnectedSubaddress */
+				       NULL,	/* LLC */
+				       NULL,	/* BChannelinformation */
+				       NULL,	/* Keypadfacility */
+				       NULL,	/* Useruserdata */
+				       NULL	/* Facilitydataarray */
 		);
 		capi_cmsg2message(&cmdcmsg, cmdcmsg.buf);
 		plci_change_state(card, bchan->plcip, EV_PLCI_CONNECT_RESP);
@@ -1714,7 +1714,7 @@ static int capidrv_command(isdn_ctrl * c, capidrv_contr * card)
 						    global.ap.applid,
 						    card->msgid++,
 						    bchan->nccip->ncci,
-						    0	/* NCPI */
+						    NULL	/* NCPI */
 			);
 			ncci_change_state(card, bchan->nccip, EV_NCCI_DISCONNECT_B3_REQ);
 			send_message(card, &cmdcmsg);
@@ -1735,10 +1735,10 @@ static int capidrv_command(isdn_ctrl * c, capidrv_contr * card)
 							 global.ap.applid,
 							 card->msgid++,
 						      bchan->plcip->plci,
-							 0,	/* BChannelinformation */
-							 0,	/* Keypadfacility */
-							 0,	/* Useruserdata */
-							 0	/* Facilitydataarray */
+							 NULL,	/* BChannelinformation */
+							 NULL,	/* Keypadfacility */
+							 NULL,	/* Useruserdata */
+							 NULL	/* Facilitydataarray */
 				);
 				plci_change_state(card, bchan->plcip, EV_PLCI_DISCONNECT_REQ);
 				send_message(card, &cmdcmsg);
@@ -1892,11 +1892,11 @@ static int if_sendbuf(int id, int channel, int doack, struct sk_buff *skb)
 	}
 }
 
-static int if_readstat(u8 *buf, int len, int user, int id, int channel)
+static int if_readstat(u8 __user *buf, int len, int id, int channel)
 {
 	capidrv_contr *card = findcontrbydriverid(id);
 	int count;
-	u8 *p;
+	u8 __user *p;
 
 	if (!card) {
 		printk(KERN_ERR "capidrv: if_readstat called with invalid driverId %d!\n",
@@ -1905,10 +1905,7 @@ static int if_readstat(u8 *buf, int len, int user, int id, int channel)
 	}
 
 	for (p=buf, count=0; count < len; p++, count++) {
-	        if (user)
-	                put_user(*card->q931_read++, p);
-	        else
-	                *p = *card->q931_read++;
+		put_user(*card->q931_read++, p);
 	        if (card->q931_read > card->q931_end)
 	                card->q931_read = card->q931_buf;
 	}
@@ -1977,7 +1974,7 @@ static void send_listen(capidrv_contr *card)
 			     1 << 6,	/* Infomask */
 			     card->cipmask,
 			     card->cipmask2,
-			     0, 0);
+			     NULL, NULL);
 	send_message(card, &cmdcmsg);
 	listen_change_state(card, EV_LISTEN_REQ);
 }
@@ -2028,7 +2025,7 @@ static int capidrv_addcontr(u16 contr, struct capi_profile *profp)
 	card->interface.maxbufsize = 2048;
 	card->interface.command = if_command;
 	card->interface.writebuf_skb = if_sendbuf;
-	card->interface.writecmd = 0;
+	card->interface.writecmd = NULL;
 	card->interface.readstat = if_readstat;
 	card->interface.features = ISDN_FEATURE_L2_HDLC |
 	    			   ISDN_FEATURE_L2_TRANS |
@@ -2141,7 +2138,7 @@ static int capidrv_delcontr(u16 contr)
 		card->nbchan--;
 	}
 	kfree(card->bchans);
-	card->bchans = 0;
+	card->bchans = NULL;
 
 	if (debugmode)
 		printk(KERN_DEBUG "capidrv-%d: id=%d isdn unload\n",
@@ -2159,7 +2156,7 @@ static int capidrv_delcontr(u16 contr)
 	for (pp = &global.contr_list; *pp; pp = &(*pp)->next) {
 		if (*pp == card) {
 			*pp = (*pp)->next;
-			card->next = 0;
+			card->next = NULL;
 			global.ncontr--;
 			break;
 		}
@@ -2228,7 +2225,7 @@ static void __init proc_init(void)
 
     for (i=0; i < nelem; i++) {
         struct procfsentries *p = procfsentries + i;
-	p->procent = create_proc_entry(p->name, p->mode, 0);
+	p->procent = create_proc_entry(p->name, p->mode, NULL);
 	if (p->procent) p->procent->read_proc = p->read_proc;
     }
 }
@@ -2241,8 +2238,8 @@ static void __exit proc_exit(void)
     for (i=nelem-1; i >= 0; i--) {
         struct procfsentries *p = procfsentries + i;
 	if (p->procent) {
-	   remove_proc_entry(p->name, 0);
-	   p->procent = 0;
+	   remove_proc_entry(p->name, NULL);
+	   p->procent = NULL;
 	}
     }
 }
diff --git a/drivers/isdn/capi/capilib.c b/drivers/isdn/capi/capilib.c
index 00d8795b9..68409d971 100644
--- a/drivers/isdn/capi/capilib.c
+++ b/drivers/isdn/capi/capilib.c
@@ -30,8 +30,8 @@ struct capilib_ncci {
 static inline void mq_init(struct capilib_ncci * np)
 {
 	u_int i;
-	np->msgidqueue = 0;
-	np->msgidlast = 0;
+	np->msgidqueue = NULL;
+	np->msgidlast = NULL;
 	np->nmsg = 0;
 	memset(np->msgidpool, 0, sizeof(np->msgidpool));
 	np->msgidfree = &np->msgidpool[0];
@@ -48,7 +48,7 @@ static inline int mq_enqueue(struct capilib_ncci * np, u16 msgid)
 		return 0;
 	np->msgidfree = mq->next;
 	mq->msgid = msgid;
-	mq->next = 0;
+	mq->next = NULL;
 	if (np->msgidlast)
 		np->msgidlast->next = mq;
 	np->msgidlast = mq;
@@ -66,7 +66,7 @@ static inline int mq_dequeue(struct capilib_ncci * np, u16 msgid)
 			struct capilib_msgidqueue *mq = *pp;
 			*pp = mq->next;
 			if (mq == np->msgidlast)
-				np->msgidlast = 0;
+				np->msgidlast = NULL;
 			mq->next = np->msgidfree;
 			np->msgidfree = mq;
 			np->nmsg--;
diff --git a/drivers/isdn/capi/capiutil.c b/drivers/isdn/capi/capiutil.c
index c26dec646..e7cf6bc28 100644
--- a/drivers/isdn/capi/capiutil.c
+++ b/drivers/isdn/capi/capiutil.c
@@ -335,85 +335,54 @@ static _cdef cdef[] =
 
 static unsigned char *cpars[] =
 {
-    /*00 */ 0,
-    /*01 ALERT_REQ */ (unsigned char *) "\x03\x04\x0c\x27\x2f\x1c\x01\x01",
-    /*02 CONNECT_REQ */ (unsigned char *) "\x03\x14\x0e\x10\x0f\x11\x0d\x06\x08\x0a\x05\x07\x09\x01\x0b\x28\x22\x04\x0c\x27\x2f\x1c\x01\x01",
-    /*03 */ 0,
-    /*04 DISCONNECT_REQ */ (unsigned char *) "\x03\x04\x0c\x27\x2f\x1c\x01\x01",
-    /*05 LISTEN_REQ */ (unsigned char *) "\x03\x25\x12\x13\x10\x11\x01",
-    /*06 */ 0,
-    /*07 */ 0,
-    /*08 INFO_REQ */ (unsigned char *) "\x03\x0e\x04\x0c\x27\x2f\x1c\x01\x01",
-    /*09 FACILITY_REQ */ (unsigned char *) "\x03\x1f\x1e\x01",
-    /*0a SELECT_B_PROTOCOL_REQ */ (unsigned char *) "\x03\x0d\x06\x08\x0a\x05\x07\x09\x01\x01",
-    /*0b CONNECT_B3_REQ */ (unsigned char *) "\x03\x2b\x01",
-    /*0c */ 0,
-    /*0d DISCONNECT_B3_REQ */ (unsigned char *) "\x03\x2b\x01",
-    /*0e */ 0,
-    /*0f DATA_B3_REQ */ (unsigned char *) "\x03\x18\x1a\x19\x20\x01",
-    /*10 RESET_B3_REQ */ (unsigned char *) "\x03\x2b\x01",
-    /*11 */ 0,
-    /*12 */ 0,
-    /*13 ALERT_CONF */ (unsigned char *) "\x03\x23\x01",
-    /*14 CONNECT_CONF */ (unsigned char *) "\x03\x23\x01",
-    /*15 */ 0,
-    /*16 DISCONNECT_CONF */ (unsigned char *) "\x03\x23\x01",
-    /*17 LISTEN_CONF */ (unsigned char *) "\x03\x23\x01",
-    /*18 MANUFACTURER_REQ */ (unsigned char *) "\x03\x2a\x15\x21\x29\x01",
-    /*19 */ 0,
-    /*1a INFO_CONF */ (unsigned char *) "\x03\x23\x01",
-    /*1b FACILITY_CONF */ (unsigned char *) "\x03\x23\x1f\x1b\x01",
-    /*1c SELECT_B_PROTOCOL_CONF */ (unsigned char *) "\x03\x23\x01",
-    /*1d CONNECT_B3_CONF */ (unsigned char *) "\x03\x23\x01",
-    /*1e */ 0,
-    /*1f DISCONNECT_B3_CONF */ (unsigned char *) "\x03\x23\x01",
-    /*20 */ 0,
-    /*21 DATA_B3_CONF */ (unsigned char *) "\x03\x19\x23\x01",
-    /*22 RESET_B3_CONF */ (unsigned char *) "\x03\x23\x01",
-    /*23 */ 0,
-    /*24 */ 0,
-    /*25 */ 0,
-    /*26 CONNECT_IND */ (unsigned char *) "\x03\x14\x0e\x10\x0f\x11\x0b\x28\x22\x04\x0c\x27\x2f\x1c\x01\x01",
-    /*27 CONNECT_ACTIVE_IND */ (unsigned char *) "\x03\x16\x17\x28\x01",
-    /*28 DISCONNECT_IND */ (unsigned char *) "\x03\x2c\x01",
-    /*29 */ 0,
-    /*2a MANUFACTURER_CONF */ (unsigned char *) "\x03\x2a\x15\x21\x29\x01",
-    /*2b */ 0,
-    /*2c INFO_IND */ (unsigned char *) "\x03\x26\x24\x01",
-    /*2d FACILITY_IND */ (unsigned char *) "\x03\x1f\x1d\x01",
-    /*2e */ 0,
-    /*2f CONNECT_B3_IND */ (unsigned char *) "\x03\x2b\x01",
-    /*30 CONNECT_B3_ACTIVE_IND */ (unsigned char *) "\x03\x2b\x01",
-    /*31 DISCONNECT_B3_IND */ (unsigned char *) "\x03\x2d\x2b\x01",
-    /*32 */ 0,
-    /*33 DATA_B3_IND */ (unsigned char *) "\x03\x18\x1a\x19\x20\x01",
-    /*34 RESET_B3_IND */ (unsigned char *) "\x03\x2b\x01",
-    /*35 CONNECT_B3_T90_ACTIVE_IND */ (unsigned char *) "\x03\x2b\x01",
-    /*36 */ 0,
-    /*37 */ 0,
-    /*38 CONNECT_RESP */ (unsigned char *) "\x03\x2e\x0d\x06\x08\x0a\x05\x07\x09\x01\x16\x17\x28\x04\x0c\x27\x2f\x1c\x01\x01",
-    /*39 CONNECT_ACTIVE_RESP */ (unsigned char *) "\x03\x01",
-    /*3a DISCONNECT_RESP */ (unsigned char *) "\x03\x01",
-    /*3b */ 0,
-    /*3c MANUFACTURER_IND */ (unsigned char *) "\x03\x2a\x15\x21\x29\x01",
-    /*3d */ 0,
-    /*3e INFO_RESP */ (unsigned char *) "\x03\x01",
-    /*3f FACILITY_RESP */ (unsigned char *) "\x03\x1f\x01",
-    /*40 */ 0,
-    /*41 CONNECT_B3_RESP */ (unsigned char *) "\x03\x2e\x2b\x01",
-    /*42 CONNECT_B3_ACTIVE_RESP */ (unsigned char *) "\x03\x01",
-    /*43 DISCONNECT_B3_RESP */ (unsigned char *) "\x03\x01",
-    /*44 */ 0,
-    /*45 DATA_B3_RESP */ (unsigned char *) "\x03\x19\x01",
-    /*46 RESET_B3_RESP */ (unsigned char *) "\x03\x01",
-    /*47 CONNECT_B3_T90_ACTIVE_RESP */ (unsigned char *) "\x03\x01",
-    /*48 */ 0,
-    /*49 */ 0,
-    /*4a */ 0,
-    /*4b */ 0,
-    /*4c */ 0,
-    /*4d */ 0,
-    /*4e MANUFACTURER_RESP */ (unsigned char *) "\x03\x2a\x15\x21\x29\x01",
+    /* ALERT_REQ */ [0x01] = "\x03\x04\x0c\x27\x2f\x1c\x01\x01",
+    /* CONNECT_REQ */ [0x02] = "\x03\x14\x0e\x10\x0f\x11\x0d\x06\x08\x0a\x05\x07\x09\x01\x0b\x28\x22\x04\x0c\x27\x2f\x1c\x01\x01",
+    /* DISCONNECT_REQ */ [0x04] = "\x03\x04\x0c\x27\x2f\x1c\x01\x01",
+    /* LISTEN_REQ */ [0x05] = "\x03\x25\x12\x13\x10\x11\x01",
+    /* INFO_REQ */ [0x08] = "\x03\x0e\x04\x0c\x27\x2f\x1c\x01\x01",
+    /* FACILITY_REQ */ [0x09] = "\x03\x1f\x1e\x01",
+    /* SELECT_B_PROTOCOL_REQ */ [0x0a] = "\x03\x0d\x06\x08\x0a\x05\x07\x09\x01\x01",
+    /* CONNECT_B3_REQ */ [0x0b] = "\x03\x2b\x01",
+    /* DISCONNECT_B3_REQ */ [0x0d] = "\x03\x2b\x01",
+    /* DATA_B3_REQ */ [0x0f] = "\x03\x18\x1a\x19\x20\x01",
+    /* RESET_B3_REQ */ [0x10] = "\x03\x2b\x01",
+    /* ALERT_CONF */ [0x13] = "\x03\x23\x01",
+    /* CONNECT_CONF */ [0x14] = "\x03\x23\x01",
+    /* DISCONNECT_CONF */ [0x16] = "\x03\x23\x01",
+    /* LISTEN_CONF */ [0x17] = "\x03\x23\x01",
+    /* MANUFACTURER_REQ */ [0x18] = "\x03\x2a\x15\x21\x29\x01",
+    /* INFO_CONF */ [0x1a] = "\x03\x23\x01",
+    /* FACILITY_CONF */ [0x1b] = "\x03\x23\x1f\x1b\x01",
+    /* SELECT_B_PROTOCOL_CONF */ [0x1c] = "\x03\x23\x01",
+    /* CONNECT_B3_CONF */ [0x1d] = "\x03\x23\x01",
+    /* DISCONNECT_B3_CONF */ [0x1f] = "\x03\x23\x01",
+    /* DATA_B3_CONF */ [0x21] = "\x03\x19\x23\x01",
+    /* RESET_B3_CONF */ [0x22] = "\x03\x23\x01",
+    /* CONNECT_IND */ [0x26] = "\x03\x14\x0e\x10\x0f\x11\x0b\x28\x22\x04\x0c\x27\x2f\x1c\x01\x01",
+    /* CONNECT_ACTIVE_IND */ [0x27] = "\x03\x16\x17\x28\x01",
+    /* DISCONNECT_IND */ [0x28] = "\x03\x2c\x01",
+    /* MANUFACTURER_CONF */ [0x2a] = "\x03\x2a\x15\x21\x29\x01",
+    /* INFO_IND */ [0x2c] = "\x03\x26\x24\x01",
+    /* FACILITY_IND */ [0x2d] = "\x03\x1f\x1d\x01",
+    /* CONNECT_B3_IND */ [0x2f] = "\x03\x2b\x01",
+    /* CONNECT_B3_ACTIVE_IND */ [0x30] = "\x03\x2b\x01",
+    /* DISCONNECT_B3_IND */ [0x31] = "\x03\x2d\x2b\x01",
+    /* DATA_B3_IND */ [0x33] = "\x03\x18\x1a\x19\x20\x01",
+    /* RESET_B3_IND */ [0x34] = "\x03\x2b\x01",
+    /* CONNECT_B3_T90_ACTIVE_IND */ [0x35] = "\x03\x2b\x01",
+    /* CONNECT_RESP */ [0x38] = "\x03\x2e\x0d\x06\x08\x0a\x05\x07\x09\x01\x16\x17\x28\x04\x0c\x27\x2f\x1c\x01\x01",
+    /* CONNECT_ACTIVE_RESP */ [0x39] = "\x03\x01",
+    /* DISCONNECT_RESP */ [0x3a] = "\x03\x01",
+    /* MANUFACTURER_IND */ [0x3c] = "\x03\x2a\x15\x21\x29\x01",
+    /* INFO_RESP */ [0x3e] = "\x03\x01",
+    /* FACILITY_RESP */ [0x3f] = "\x03\x1f\x01",
+    /* CONNECT_B3_RESP */ [0x41] = "\x03\x2e\x2b\x01",
+    /* CONNECT_B3_ACTIVE_RESP */ [0x42] = "\x03\x01",
+    /* DISCONNECT_B3_RESP */ [0x43] = "\x03\x01",
+    /* DATA_B3_RESP */ [0x45] = "\x03\x19\x01",
+    /* RESET_B3_RESP */ [0x46] = "\x03\x01",
+    /* CONNECT_B3_T90_ACTIVE_RESP */ [0x47] = "\x03\x01",
+    /* MANUFACTURER_RESP */ [0x4e] = "\x03\x2a\x15\x21\x29\x01",
 };
 
 /*-------------------------------------------------------*/
@@ -623,85 +592,54 @@ unsigned capi_cmsg_header(_cmsg * cmsg, u16 _ApplId,
 
 static char *mnames[] =
 {
-	0,
-	"ALERT_REQ",
-	"CONNECT_REQ",
-	0,
-	"DISCONNECT_REQ",
-	"LISTEN_REQ",
-	0,
-	0,
-	"INFO_REQ",
-	"FACILITY_REQ",
-	"SELECT_B_PROTOCOL_REQ",
-	"CONNECT_B3_REQ",
-	0,
-	"DISCONNECT_B3_REQ",
-	0,
-	"DATA_B3_REQ",
-	"RESET_B3_REQ",
-	0,
-	0,
-	"ALERT_CONF",
-	"CONNECT_CONF",
-	0,
-	"DISCONNECT_CONF",
-	"LISTEN_CONF",
-	"MANUFACTURER_REQ",
-	0,
-	"INFO_CONF",
-	"FACILITY_CONF",
-	"SELECT_B_PROTOCOL_CONF",
-	"CONNECT_B3_CONF",
-	0,
-	"DISCONNECT_B3_CONF",
-	0,
-	"DATA_B3_CONF",
-	"RESET_B3_CONF",
-	0,
-	0,
-	0,
-	"CONNECT_IND",
-	"CONNECT_ACTIVE_IND",
-	"DISCONNECT_IND",
-	0,
-	"MANUFACTURER_CONF",
-	0,
-	"INFO_IND",
-	"FACILITY_IND",
-	0,
-	"CONNECT_B3_IND",
-	"CONNECT_B3_ACTIVE_IND",
-	"DISCONNECT_B3_IND",
-	0,
-	"DATA_B3_IND",
-	"RESET_B3_IND",
-	"CONNECT_B3_T90_ACTIVE_IND",
-	0,
-	0,
-	"CONNECT_RESP",
-	"CONNECT_ACTIVE_RESP",
-	"DISCONNECT_RESP",
-	0,
-	"MANUFACTURER_IND",
-	0,
-	"INFO_RESP",
-	"FACILITY_RESP",
-	0,
-	"CONNECT_B3_RESP",
-	"CONNECT_B3_ACTIVE_RESP",
-	"DISCONNECT_B3_RESP",
-	0,
-	"DATA_B3_RESP",
-	"RESET_B3_RESP",
-	"CONNECT_B3_T90_ACTIVE_RESP",
-	0,
-	0,
-	0,
-	0,
-	0,
-	0,
-	"MANUFACTURER_RESP"
+	[0x01] = "ALERT_REQ",
+	[0x02] = "CONNECT_REQ",
+	[0x04] = "DISCONNECT_REQ",
+	[0x05] = "LISTEN_REQ",
+	[0x08] = "INFO_REQ",
+	[0x09] = "FACILITY_REQ",
+	[0x0a] = "SELECT_B_PROTOCOL_REQ",
+	[0x0b] = "CONNECT_B3_REQ",
+	[0x0d] = "DISCONNECT_B3_REQ",
+	[0x0f] = "DATA_B3_REQ",
+	[0x10] = "RESET_B3_REQ",
+	[0x13] = "ALERT_CONF",
+	[0x14] = "CONNECT_CONF",
+	[0x16] = "DISCONNECT_CONF",
+	[0x17] = "LISTEN_CONF",
+	[0x18] = "MANUFACTURER_REQ",
+	[0x1a] = "INFO_CONF",
+	[0x1b] = "FACILITY_CONF",
+	[0x1c] = "SELECT_B_PROTOCOL_CONF",
+	[0x1d] = "CONNECT_B3_CONF",
+	[0x1f] = "DISCONNECT_B3_CONF",
+	[0x21] = "DATA_B3_CONF",
+	[0x22] = "RESET_B3_CONF",
+	[0x26] = "CONNECT_IND",
+	[0x27] = "CONNECT_ACTIVE_IND",
+	[0x28] = "DISCONNECT_IND",
+	[0x2a] = "MANUFACTURER_CONF",
+	[0x2c] = "INFO_IND",
+	[0x2d] = "FACILITY_IND",
+	[0x2f] = "CONNECT_B3_IND",
+	[0x30] = "CONNECT_B3_ACTIVE_IND",
+	[0x31] = "DISCONNECT_B3_IND",
+	[0x33] = "DATA_B3_IND",
+	[0x34] = "RESET_B3_IND",
+	[0x35] = "CONNECT_B3_T90_ACTIVE_IND",
+	[0x38] = "CONNECT_RESP",
+	[0x39] = "CONNECT_ACTIVE_RESP",
+	[0x3a] = "DISCONNECT_RESP",
+	[0x3c] = "MANUFACTURER_IND",
+	[0x3e] = "INFO_RESP",
+	[0x3f] = "FACILITY_RESP",
+	[0x41] = "CONNECT_B3_RESP",
+	[0x42] = "CONNECT_B3_ACTIVE_RESP",
+	[0x43] = "DISCONNECT_B3_RESP",
+	[0x45] = "DATA_B3_RESP",
+	[0x46] = "RESET_B3_RESP",
+	[0x47] = "CONNECT_B3_T90_ACTIVE_RESP",
+	[0x4e] = "MANUFACTURER_RESP"
 };
 
 char *capi_cmd2str(u8 cmd, u8 subcmd)
@@ -715,9 +653,9 @@ char *capi_cmd2str(u8 cmd, u8 subcmd)
 
 static char *pnames[] =
 {
-    /*00 */ 0,
-    /*01 */ 0,
-    /*02 */ 0,
+    /*00 */ NULL,
+    /*01 */ NULL,
+    /*02 */ NULL,
     /*03 */ "Controller/PLCI/NCCI",
     /*04 */ "AdditionalInfo",
     /*05 */ "B1configuration",
@@ -767,7 +705,7 @@ static char *pnames[] =
 
 
 static char buf[8192];
-static char *p = 0;
+static char *p = NULL;
 
 #include <stdarg.h>
 
diff --git a/drivers/isdn/capi/kcapi.c b/drivers/isdn/capi/kcapi.c
index 8524997b1..8d58cfd45 100644
--- a/drivers/isdn/capi/kcapi.c
+++ b/drivers/isdn/capi/kcapi.c
@@ -193,7 +193,7 @@ static void notify_down(u32 contr)
 	for (applid = 1; applid <= CAPI_MAXAPPL; applid++) {
 		ap = get_capi_appl_by_nr(applid);
 		if (ap && ap->callback && !ap->release_in_progress)
-			ap->callback(KCI_CONTRDOWN, contr, 0);
+			ap->callback(KCI_CONTRDOWN, contr, NULL);
 	}
 }
 
@@ -421,7 +421,7 @@ attach_capi_ctr(struct capi_ctr *card)
 	card->traceflag = showcapimsgs;
 
 	sprintf(card->procfn, "capi/controllers/%d", card->cnr);
-	card->procent = create_proc_entry(card->procfn, 0, 0);
+	card->procent = create_proc_entry(card->procfn, 0, NULL);
 	if (card->procent) {
 	   card->procent->read_proc = 
 		(int (*)(char *,char **,off_t,int,int *,void *))
@@ -445,8 +445,8 @@ int detach_capi_ctr(struct capi_ctr *card)
 	ncards--;
 
 	if (card->procent) {
-	   remove_proc_entry(card->procfn, 0);
-	   card->procent = 0;
+	   remove_proc_entry(card->procfn, NULL);
+	   card->procent = NULL;
 	}
 	capi_cards[card->cnr - 1] = NULL;
 	printk(KERN_NOTICE "kcapi: Controller %d: %s unregistered\n",
@@ -524,7 +524,7 @@ u16 capi20_register(struct capi20_appl *ap)
 	ap->nrecvdatapkt = 0;
 	ap->nsentctlpkt = 0;
 	ap->nsentdatapkt = 0;
-	ap->callback = 0;
+	ap->callback = NULL;
 	init_MUTEX(&ap->recv_sem);
 	skb_queue_head_init(&ap->recv_queue);
 	INIT_WORK(&ap->recv_work, recv_handler, (void *)ap);
@@ -711,14 +711,14 @@ u16 capi20_get_profile(u32 contr, struct capi_profile *profp)
 EXPORT_SYMBOL(capi20_get_profile);
 
 #ifdef CONFIG_AVMB1_COMPAT
-static int old_capi_manufacturer(unsigned int cmd, void *data)
+static int old_capi_manufacturer(unsigned int cmd, void __user *data)
 {
 	avmb1_loadandconfigdef ldef;
 	avmb1_extcarddef cdef;
 	avmb1_resetdef rdef;
 	capicardparams cparams;
 	struct capi_ctr *card;
-	struct capi_driver *driver = 0;
+	struct capi_driver *driver = NULL;
 	capiloaddata ldata;
 	struct list_head *l;
 	unsigned long flags;
@@ -728,12 +728,12 @@ static int old_capi_manufacturer(unsigned int cmd, void *data)
 	case AVMB1_ADDCARD:
 	case AVMB1_ADDCARD_WITH_TYPE:
 		if (cmd == AVMB1_ADDCARD) {
-		   if ((retval = copy_from_user((void *) &cdef, data,
+		   if ((retval = copy_from_user(&cdef, data,
 					    sizeof(avmb1_carddef))))
 			   return retval;
 		   cdef.cardtype = AVM_CARDTYPE_B1;
 		} else {
-		   if ((retval = copy_from_user((void *) &cdef, data,
+		   if ((retval = copy_from_user(&cdef, data,
 					    sizeof(avmb1_extcarddef))))
 			   return retval;
 		}
@@ -758,7 +758,7 @@ static int old_capi_manufacturer(unsigned int cmd, void *data)
 				}
 				break;
 			default:
-				driver = 0;
+				driver = NULL;
 				break;
 		}
 		if (!driver) {
@@ -780,13 +780,13 @@ static int old_capi_manufacturer(unsigned int cmd, void *data)
 	case AVMB1_LOAD_AND_CONFIG:
 
 		if (cmd == AVMB1_LOAD) {
-			if (copy_from_user((void *)&ldef, data,
+			if (copy_from_user(&ldef, data,
 					   sizeof(avmb1_loaddef)))
 				return -EFAULT;
 			ldef.t4config.len = 0;
-			ldef.t4config.data = 0;
+			ldef.t4config.data = NULL;
 		} else {
-			if (copy_from_user((void *)&ldef, data,
+			if (copy_from_user(&ldef, data,
 					   sizeof(avmb1_loadandconfigdef)))
 				return -EFAULT;
 		}
@@ -843,7 +843,7 @@ static int old_capi_manufacturer(unsigned int cmd, void *data)
 		return 0;
 
 	case AVMB1_RESETCARD:
-		if (copy_from_user((void *)&rdef, data, sizeof(avmb1_resetdef)))
+		if (copy_from_user(&rdef, data, sizeof(avmb1_resetdef)))
 			return -EFAULT;
 		card = get_capi_ctr_by_nr(rdef.contr);
 		if (!card)
@@ -869,7 +869,7 @@ static int old_capi_manufacturer(unsigned int cmd, void *data)
 }
 #endif
 
-int capi20_manufacturer(unsigned int cmd, void *data)
+int capi20_manufacturer(unsigned int cmd, void __user *data)
 {
         struct capi_ctr *card;
 
@@ -886,7 +886,7 @@ int capi20_manufacturer(unsigned int cmd, void *data)
 	{
 		kcapi_flagdef fdef;
 
-		if (copy_from_user((void *)&fdef, data, sizeof(kcapi_flagdef)))
+		if (copy_from_user(&fdef, data, sizeof(kcapi_flagdef)))
 			return -EFAULT;
 
 		card = get_capi_ctr_by_nr(fdef.contr);
@@ -901,13 +901,12 @@ int capi20_manufacturer(unsigned int cmd, void *data)
 	case KCAPI_CMD_ADDCARD:
 	{
 		struct list_head *l;
-		struct capi_driver *driver = 0;
+		struct capi_driver *driver = NULL;
 		capicardparams cparams;
 		kcapi_carddef cdef;
 		int retval;
 
-		if ((retval = copy_from_user((void *) &cdef, data,
-							sizeof(cdef))))
+		if ((retval = copy_from_user(&cdef, data, sizeof(cdef))))
 			return retval;
 
 		cparams.port = cdef.port;
diff --git a/drivers/isdn/capi/kcapi_proc.c b/drivers/isdn/capi/kcapi_proc.c
index 195be3b8b..16dc5418f 100644
--- a/drivers/isdn/capi/kcapi_proc.c
+++ b/drivers/isdn/capi/kcapi_proc.c
@@ -246,7 +246,7 @@ create_seq_entry(char *name, mode_t mode, struct file_operations *f)
 
 static __inline__ struct capi_driver *capi_driver_get_idx(loff_t pos)
 {
-	struct capi_driver *drv = 0;
+	struct capi_driver *drv = NULL;
 	struct list_head *l;
 	loff_t i;
 
@@ -256,7 +256,7 @@ static __inline__ struct capi_driver *capi_driver_get_idx(loff_t pos)
 		if (i++ == pos)
 			return drv;
 	}
-	return 0;
+	return NULL;
 }
 
 static void *capi_driver_start(struct seq_file *seq, loff_t *pos)
@@ -271,7 +271,7 @@ static void *capi_driver_next(struct seq_file *seq, void *v, loff_t *pos)
 {
 	struct capi_driver *drv = (struct capi_driver *)v;
 	++*pos;
-	if (drv->list.next == &capi_drivers) return 0;
+	if (drv->list.next == &capi_drivers) return NULL;
 	return list_entry(drv->list.next, struct capi_driver, list);
 }
 
diff --git a/drivers/isdn/divert/divert_procfs.c b/drivers/isdn/divert/divert_procfs.c
index d89a94b96..d3506ee85 100644
--- a/drivers/isdn/divert/divert_procfs.c
+++ b/drivers/isdn/divert/divert_procfs.c
@@ -94,7 +94,7 @@ isdn_divert_read(struct file *file, char *buf, size_t count, loff_t * off)
 	if ((len = strlen(inf->info_start)) <= count) {
 		if (copy_to_user(buf, inf->info_start, len))
 			return -EFAULT;
-		file->f_pos += len;
+		*off += len;
 		return (len);
 	}
 	return (0);
@@ -142,7 +142,7 @@ isdn_divert_open(struct inode *ino, struct file *filep)
 		(struct divert_info **) filep->private_data = &divert_info_head;
 	spin_unlock_irqrestore( &divert_info_lock, flags );
 	/*  start_divert(); */
-	return (0);
+	return nonseekable_open(ino, filep);
 }				/* isdn_divert_open */
 
 /*******************/
diff --git a/drivers/isdn/hardware/avm/b1.c b/drivers/isdn/hardware/avm/b1.c
index daa4b55a7..c87516ab2 100644
--- a/drivers/isdn/hardware/avm/b1.c
+++ b/drivers/isdn/hardware/avm/b1.c
@@ -67,14 +67,14 @@ avmcard *b1_alloc_card(int nr_controllers)
 
 	card = kmalloc(sizeof(*card), GFP_KERNEL);
 	if (!card)
-		return 0;
+		return NULL;
 
 	memset(card, 0, sizeof(*card));
 
         cinfo = kmalloc(sizeof(*cinfo) * nr_controllers, GFP_KERNEL);
 	if (!cinfo) {
 		kfree(card);
-		return 0;
+		return NULL;
 	}
 	memset(cinfo, 0, sizeof(*cinfo) * nr_controllers);
 
@@ -753,7 +753,7 @@ avmcard_dma_alloc(char *name, struct pci_dev *pdev, long rsize, long ssize)
  err_kfree:
 	kfree(p);
  err:
-	return 0;
+	return NULL;
 }
 
 void avmcard_dma_free(avmcard_dmainfo *p)
diff --git a/drivers/isdn/hardware/eicon/capifunc.c b/drivers/isdn/hardware/eicon/capifunc.c
index ba5dc752f..15d081a09 100644
--- a/drivers/isdn/hardware/eicon/capifunc.c
+++ b/drivers/isdn/hardware/eicon/capifunc.c
@@ -228,7 +228,7 @@ void sendf(APPL * appl, word command, dword Id, word Number, byte * format, ...)
 	word length = 12, dlength = 0;
 	byte *write;
 	CAPI_MSG msg;
-	byte *string = 0;
+	byte *string = NULL;
 	va_list ap;
 	diva_os_message_buffer_s *dmb;
 	diva_card *card = NULL;
@@ -1072,7 +1072,7 @@ static int divacapi_connect_didd(void)
 			req.didd_notify.e.Rc =
 			    IDI_SYNC_REQ_DIDD_REGISTER_ADAPTER_NOTIFY;
 			req.didd_notify.info.callback = (void *)didd_callback;
-			req.didd_notify.info.context = 0;
+			req.didd_notify.info.context = NULL;
 			DAdapter.request((ENTITY *) & req);
 			if (req.didd_notify.e.Rc != 0xff) {
 				stop_dbg();
diff --git a/drivers/isdn/hardware/eicon/capimain.c b/drivers/isdn/hardware/eicon/capimain.c
index 4a1702523..8fe4f3f09 100644
--- a/drivers/isdn/hardware/eicon/capimain.c
+++ b/drivers/isdn/hardware/eicon/capimain.c
@@ -102,8 +102,8 @@ static int diva_ctl_read_proc(char *page, char **start, off_t off,
 void diva_os_set_controller_struct(struct capi_ctr *ctrl)
 {
 	ctrl->driver_name = DRIVERLNAME;
-	ctrl->load_firmware = 0;
-	ctrl->reset_ctr = 0;
+	ctrl->load_firmware = NULL;
+	ctrl->reset_ctr = NULL;
 	ctrl->ctr_read_proc = diva_ctl_read_proc;
 	ctrl->owner = THIS_MODULE;
 }
diff --git a/drivers/isdn/hardware/eicon/dadapter.c b/drivers/isdn/hardware/eicon/dadapter.c
index dcfae9e9a..3d4cfe919 100644
--- a/drivers/isdn/hardware/eicon/dadapter.c
+++ b/drivers/isdn/hardware/eicon/dadapter.c
@@ -293,8 +293,8 @@ static void diva_remove_adapter_callback (dword handle) {
  diva_os_spin_lock_magic_t irql;
  if (handle && ((--handle) < DIVA_DIDD_MAX_NOTIFICATIONS)) {
   diva_os_enter_spin_lock (&didd_spin, &irql, "didd_nfy_rm");
-  NotificationTable[handle].callback = 0;
-  NotificationTable[handle].context  = 0;
+  NotificationTable[handle].callback = NULL;
+  NotificationTable[handle].context  = NULL;
   diva_os_leave_spin_lock (&didd_spin, &irql, "didd_nfy_rm");
   DBG_TRC(("Remove adapter notification[%d]", (int)(handle+1)))
   return;
diff --git a/drivers/isdn/hardware/eicon/debug.c b/drivers/isdn/hardware/eicon/debug.c
index 907364c9c..e8e99ad35 100644
--- a/drivers/isdn/hardware/eicon/debug.c
+++ b/drivers/isdn/hardware/eicon/debug.c
@@ -89,7 +89,7 @@ static void queueInit (MSG_QUEUE *Q, byte *Buffer, dword sizeBuffer) {
 	Q->Size = sizeBuffer;
 	Q->Base = Q->Head = Q->Tail = Buffer;
 	Q->High = Buffer + sizeBuffer;
-	Q->Wrap = 0;
+	Q->Wrap = NULL;
 	Q->Count= 0;
 }
 
@@ -107,7 +107,7 @@ static byte *queueAllocMsg (MSG_QUEUE *Q, word size) {
 
 	if (Q->Tail == Q->Head) {
 		if (Q->Wrap || need > Q->Size) {
-			return(0); /* full */
+			return NULL; /* full */
 		}
 		goto alloc; /* empty */
 	}
@@ -115,7 +115,7 @@ static byte *queueAllocMsg (MSG_QUEUE *Q, word size) {
 	if (Q->Tail > Q->Head) {
 		if (Q->Tail + need <= Q->High) goto alloc; /* append */
 		if (Q->Base + need > Q->Head) {
-			return (0); /* too much */
+			return NULL; /* too much */
 		}
 		/* wraparound the queue (but not the message) */
 		Q->Wrap = Q->Tail;
@@ -124,7 +124,7 @@ static byte *queueAllocMsg (MSG_QUEUE *Q, word size) {
 	}
 
 	if (Q->Tail + need > Q->Head) {
-		return (0); /* too much */
+		return NULL; /* too much */
 	}
 
 alloc:
@@ -151,7 +151,7 @@ static void queueFreeMsg (MSG_QUEUE *Q) {
 	if (Q->Wrap) {
 		if (Q->Head >= Q->Wrap) {
 			Q->Head = Q->Base;
-			Q->Wrap = 0;
+			Q->Wrap = NULL;
 		}
 	} else if (Q->Head >= Q->Tail) {
 		Q->Head = Q->Tail = Q->Base;
@@ -167,7 +167,7 @@ static byte *queuePeekMsg (MSG_QUEUE *Q, word *size) {
 
 	if (((byte *)Msg == Q->Tail && !Q->Wrap) ||
 	    (Msg->Size & MSG_INCOMPLETE)) {
-		return (0);
+		return NULL;
 	} else {
 		*size = Msg->Size;
 		return ((byte *)(Msg + 1));
@@ -177,13 +177,13 @@ static byte *queuePeekMsg (MSG_QUEUE *Q, word *size) {
 /*
   Message queue header
   */
-static MSG_QUEUE*          dbg_queue = 0;
-static byte*               dbg_base  = 0;
-static int                 external_dbg_queue = 0;
+static MSG_QUEUE*          dbg_queue;
+static byte*               dbg_base;
+static int                 external_dbg_queue;
 static diva_os_spin_lock_t dbg_q_lock;
 static diva_os_spin_lock_t dbg_adapter_lock;
-static int                 dbg_q_busy = 0;
-static volatile dword      dbg_sequence = 0;
+static int                 dbg_q_busy;
+static volatile dword      dbg_sequence;
 static dword               start_sec;
 static dword               start_usec;
 
@@ -235,16 +235,16 @@ int diva_maint_init (byte* base, unsigned long length, int do_init) {
 
 
 	if (diva_os_initialize_spin_lock (&dbg_q_lock, "dbg_init")) {
-    dbg_queue = 0;
-    dbg_base = 0;
+    dbg_queue = NULL;
+    dbg_base = NULL;
     external_dbg_queue = 0;
 		return (-1);
   }
 
 	if (diva_os_initialize_spin_lock (&dbg_adapter_lock, "dbg_init")) {
     diva_os_destroy_spin_lock(&dbg_q_lock, "dbg_init");
-    dbg_queue = 0;
-    dbg_base = 0;
+    dbg_queue = NULL;
+    dbg_base = NULL;
     external_dbg_queue = 0;
 		return (-1);
   }
@@ -263,8 +263,8 @@ void* diva_maint_finit (void) {
   void* ret = (void*)dbg_base;
   int i;
 
-  dbg_queue = 0;
-  dbg_base  = 0;
+  dbg_queue = NULL;
+  dbg_base  = NULL;
 
   if (ret) {
     diva_os_destroy_spin_lock(&dbg_q_lock, "dbg_finit");
@@ -272,7 +272,7 @@ void* diva_maint_finit (void) {
   }
 
   if (external_dbg_queue) {
-    ret = 0;
+    ret = NULL;
   }
   external_dbg_queue = 0;
 
@@ -300,12 +300,12 @@ dword diva_dbg_q_length (void) {
   */
 diva_dbg_entry_head_t* diva_maint_get_message (word* size,
                                                diva_os_spin_lock_magic_t* old_irql) {
-  diva_dbg_entry_head_t*     pmsg = 0;
+  diva_dbg_entry_head_t*     pmsg = NULL;
 
   diva_os_enter_spin_lock_hard (&dbg_q_lock, old_irql, "read");
   if (dbg_q_busy) {
     diva_os_leave_spin_lock_hard (&dbg_q_lock, old_irql, "read_busy");
-    return (0);
+    return NULL;
   }
   dbg_q_busy = 1;
 
@@ -406,7 +406,7 @@ static void DI_register (void *arg) {
   }
 
   if (free_id != -1) {
-    diva_dbg_entry_head_t* pmsg = 0;
+    diva_dbg_entry_head_t* pmsg = NULL;
     int len;
     char tmp[256];
     word size;
@@ -476,7 +476,7 @@ static void DI_deregister (pDbgHandle hDbg) {
   dword sec, usec;
   int i;
   word size;
-  byte* pmem = 0;
+  byte* pmem = NULL;
 
   diva_os_get_time (&sec, &usec);
 
@@ -489,24 +489,24 @@ static void DI_deregister (pDbgHandle hDbg) {
       char tmp[256];
       int len;
 
-      clients[i].hDbg = 0;
+      clients[i].hDbg = NULL;
 
       hDbg->id       = -1;
       hDbg->dbgMask  = 0;
-      hDbg->dbg_end  = 0;
-      hDbg->dbg_prt  = 0;
-      hDbg->dbg_irq  = 0;
+      hDbg->dbg_end  = NULL;
+      hDbg->dbg_prt  = NULL;
+      hDbg->dbg_irq  = NULL;
       if (hDbg->Version > 0)
-        hDbg->dbg_old = 0;
+        hDbg->dbg_old = NULL;
       hDbg->Registered = 0;
-      hDbg->next     = 0;
+      hDbg->next     = NULL;
 
       if (clients[i].pIdiLib) {
         (*(clients[i].pIdiLib->DivaSTraceLibraryFinit))(clients[i].pIdiLib->hLib);
-        clients[i].pIdiLib = 0;
+        clients[i].pIdiLib = NULL;
 
         pmem = clients[i].pmem;
-        clients[i].pmem = 0;
+        clients[i].pmem = NULL;
       }
 
       /*
@@ -565,7 +565,7 @@ static void DI_format (int do_lock,
                        va_list ap) {
   diva_os_spin_lock_magic_t old_irql;
   dword sec, usec;
-  diva_dbg_entry_head_t* pmsg = 0;
+  diva_dbg_entry_head_t* pmsg = NULL;
   dword length;
   word size;
   static char fmtBuf[MSG_FRAME_MAX_SIZE+sizeof(*pmsg)+1];
@@ -843,7 +843,7 @@ void diva_mnt_add_xdi_adapter (const DESCRIPTOR* d) {
   dword sec, usec, logical, serial, org_mask;
   int id, best_id = 0, free_id = -1;
   char tmp[256];
-  diva_dbg_entry_head_t* pmsg = 0;
+  diva_dbg_entry_head_t* pmsg = NULL;
   int len;
   word size;
   byte* pmem;
@@ -938,7 +938,7 @@ void diva_mnt_add_xdi_adapter (const DESCRIPTOR* d) {
       if (((*(clients[id].pIdiLib->DivaSTraceLibraryStart))(clients[id].pIdiLib->hLib))) {
         diva_mnt_internal_dprintf (0, DLI_ERR, "Adapter(%d) Start failed", (int)logical);
         (*(clients[id].pIdiLib->DivaSTraceLibraryFinit))(clients[id].pIdiLib->hLib);
-        clients[id].pIdiLib = 0;
+        clients[id].pIdiLib = NULL;
       }
     } else {
       diva_mnt_internal_dprintf (0, DLI_ERR, "A(%d) management init failed", (int)logical);
@@ -946,9 +946,9 @@ void diva_mnt_add_xdi_adapter (const DESCRIPTOR* d) {
   }
 
   if (!clients[id].pIdiLib) {
-    clients[id].request = 0;
+    clients[id].request = NULL;
     clients[id].request_pending = 0;
-    clients[id].hDbg    = 0;
+    clients[id].hDbg    = NULL;
     diva_os_leave_spin_lock_hard (&dbg_q_lock, &old_irql, "register");
     diva_os_leave_spin_lock_hard (&dbg_adapter_lock, &old_irql1, "register");
     diva_os_free (0, pmem);
@@ -1008,7 +1008,7 @@ void diva_mnt_remove_xdi_adapter (const DESCRIPTOR* d) {
   dword sec, usec;
   int i;
   word size;
-  byte* pmem = 0;
+  byte* pmem = NULL;
 
   diva_os_get_time (&sec, &usec);
 
@@ -1023,14 +1023,14 @@ void diva_mnt_remove_xdi_adapter (const DESCRIPTOR* d) {
 
       if (clients[i].pIdiLib) {
         (*(clients[i].pIdiLib->DivaSTraceLibraryFinit))(clients[i].pIdiLib->hLib);
-        clients[i].pIdiLib = 0;
+        clients[i].pIdiLib = NULL;
 
         pmem = clients[i].pmem;
-        clients[i].pmem = 0;
+        clients[i].pmem = NULL;
       }
 
-      clients[i].hDbg    = 0;
-      clients[i].request = 0;
+      clients[i].hDbg    = NULL;
+      clients[i].request = NULL;
       clients[i].request_pending = 0;
 
       /*
@@ -1092,7 +1092,7 @@ void* SuperTraceOpenAdapter   (int AdapterNumber) {
     }
   }
 
-  return (0);
+  return NULL;
 }
 
 int SuperTraceCloseAdapter  (void* AdapterHandle) {
@@ -1741,7 +1741,7 @@ int diva_mnt_shutdown_xdi_adapters (void) {
 
 
   for (i = 1; i < (sizeof(clients)/sizeof(clients[0])); i++) {
-    pmem = 0;
+    pmem = NULL;
 
     diva_os_enter_spin_lock_hard (&dbg_adapter_lock, &old_irql1, "unload");
     diva_os_enter_spin_lock_hard (&dbg_q_lock, &old_irql, "unload");
@@ -1753,13 +1753,13 @@ int diva_mnt_shutdown_xdi_adapters (void) {
           */
         if (clients[i].pIdiLib) {
           (*(clients[i].pIdiLib->DivaSTraceLibraryFinit))(clients[i].pIdiLib->hLib);
-          clients[i].pIdiLib = 0;
+          clients[i].pIdiLib = NULL;
 
           pmem = clients[i].pmem;
-          clients[i].pmem = 0;
+          clients[i].pmem = NULL;
         }
-        clients[i].hDbg    = 0;
-        clients[i].request = 0;
+        clients[i].hDbg    = NULL;
+        clients[i].request = NULL;
         clients[i].request_pending = 0;
       } else {
         fret = -1;
diff --git a/drivers/isdn/hardware/eicon/di.c b/drivers/isdn/hardware/eicon/di.c
index 8e1791d3b..24fa5943b 100644
--- a/drivers/isdn/hardware/eicon/di.c
+++ b/drivers/isdn/hardware/eicon/di.c
@@ -81,7 +81,7 @@ static void xdi_xlog_ind (byte Adapter,
 void pr_out(ADAPTER * a)
 {
   byte e_no;
-  ENTITY  * this = 0;
+  ENTITY  * this = NULL;
   BUFFERS  *X;
   word length;
   word i;
@@ -761,7 +761,7 @@ byte isdn_ind(ADAPTER * a,
   word clength;
   word offset;
   BUFFERS  *R;
-  byte* cma = 0;
+  byte* cma = NULL;
 #ifdef USE_EXTENDED_DEBUGS
   {
     DBG_TRC(("<A%d Id=0x%x Ind=0x%x", ((ISDN_ADAPTER *)a->io)->ANum, Id, Ind))
@@ -814,7 +814,7 @@ byte isdn_ind(ADAPTER * a,
                                                      Id,
                                                      cma,
                                                      sizeof(a->stream_buffer),
-                                                     &final, 0, 0);
+                                                     &final, NULL, NULL);
         }
         IoAdapter->RBuffer.length = MIN(MLength, 270);
         if (IoAdapter->RBuffer.length != MLength) {
diff --git a/drivers/isdn/hardware/eicon/diddfunc.c b/drivers/isdn/hardware/eicon/diddfunc.c
index 69abacc7c..33172c1d6 100644
--- a/drivers/isdn/hardware/eicon/diddfunc.c
+++ b/drivers/isdn/hardware/eicon/diddfunc.c
@@ -66,7 +66,7 @@ static int DIVA_INIT_FUNCTION connect_didd(void)
 			req.didd_notify.e.Rc =
 			    IDI_SYNC_REQ_DIDD_REGISTER_ADAPTER_NOTIFY;
 			req.didd_notify.info.callback = (void *)didd_callback;
-			req.didd_notify.info.context = 0;
+			req.didd_notify.info.context = NULL;
 			_DAdapter.request((ENTITY *) & req);
 			if (req.didd_notify.e.Rc != 0xff)
 				return (0);
diff --git a/drivers/isdn/hardware/eicon/diva.c b/drivers/isdn/hardware/eicon/diva.c
index 47cf327eb..8ab8027f3 100644
--- a/drivers/isdn/hardware/eicon/diva.c
+++ b/drivers/isdn/hardware/eicon/diva.c
@@ -131,7 +131,7 @@ static diva_supported_cards_info_t divas_supported_cards[] = {
 	/*
 	   EOL
 	 */
-	{-1, 0}
+	{-1}
 };
 
 static void diva_init_request_array(void);
@@ -174,7 +174,7 @@ void *diva_driver_add_card(void *pdev, unsigned long CardOrdinal)
 	for (i = 0; divas_supported_cards[i].CardOrdinal != -1; i++) {
 		if (divas_supported_cards[i].CardOrdinal == CardOrdinal) {
 			if (!(pdiva = divas_create_pci_card(i, pdev))) {
-				return (0);
+				return NULL;
 			}
 			switch (CardOrdinal) {
 			case CARDTYPE_DIVASRV_Q_8M_PCI:
@@ -237,11 +237,11 @@ void *diva_driver_add_card(void *pdev, unsigned long CardOrdinal)
 			DBG_ERR(("can not alloc request array"))
 			diva_driver_remove_card(pdiva);
 
-			return (0);
+			return NULL;
 		}
 	}
 
-	return (0);
+	return NULL;
 }
 
 /* --------------------------------------------------------------------------
@@ -286,7 +286,7 @@ void diva_driver_remove_card(void *pdiva)
 	int i;
 
 	pa = a[0] = (diva_os_xdi_adapter_t *) pdiva;
-	a[1] = a[2] = a[3] = 0;
+	a[1] = a[2] = a[3] = NULL;
 
 	diva_os_enter_spin_lock(&adapter_lock, &old_irql, "remode adapter");
 
@@ -311,7 +311,7 @@ void diva_driver_remove_card(void *pdiva)
 		if (a[i]) {
 			if (a[i]->controller) {
 				DBG_LOG(("remove adapter (%d)",
-					 a[i]->controller)) IoAdapters[a[i]->controller - 1] = 0;
+					 a[i]->controller)) IoAdapters[a[i]->controller - 1] = NULL;
 				remove_adapter_proc(a[i]);
 			}
 			diva_os_free(0, a[i]);
@@ -332,7 +332,7 @@ static void *divas_create_pci_card(int handle, void *pci_dev_handle)
 
 	if (!(a = (diva_os_xdi_adapter_t *) diva_os_malloc(0, sizeof(*a)))) {
 		DBG_ERR(("A: can't alloc adapter"));
-		return (0);
+		return NULL;
 	}
 
 	memset(a, 0x00, sizeof(*a));
@@ -359,7 +359,7 @@ static void *divas_create_pci_card(int handle, void *pci_dev_handle)
 		diva_os_leave_spin_lock(&adapter_lock, &old_irql, "found_pci_card");
 		diva_os_free(0, a);
 		DBG_ERR(("A: can't get adapter resources"));
-		return (0);
+		return NULL;
 	}
 
 	return (a);
@@ -377,7 +377,7 @@ void divasa_xdi_driver_unload(void)
 			(*(a->interface.cleanup_adapter_proc)) (a);
 		}
 		if (a->controller) {
-			IoAdapters[a->controller - 1] = 0;
+			IoAdapters[a->controller - 1] = NULL;
 			remove_adapter_proc(a);
 		}
 		diva_os_free(0, a);
@@ -388,7 +388,7 @@ void divasa_xdi_driver_unload(void)
 /*
 **  Receive and process command from user mode utility
 */
-void *diva_xdi_open_adapter(void *os_handle, const void *src,
+void *diva_xdi_open_adapter(void *os_handle, const void __user *src,
 			    int length,
 			    divas_xdi_copy_from_user_fn_t cp_fn)
 {
@@ -400,11 +400,11 @@ void *diva_xdi_open_adapter(void *os_handle, const void *src,
 	if (length < sizeof(diva_xdi_um_cfg_cmd_t)) {
 		DBG_ERR(("A: A(?) open, msg too small (%d < %d)",
 			 length, sizeof(diva_xdi_um_cfg_cmd_t)))
-		return (0);
+		return NULL;
 	}
 	if ((*cp_fn) (os_handle, &msg, src, sizeof(msg)) <= 0) {
 		DBG_ERR(("A: A(?) open, write error"))
-		return (0);
+		return NULL;
 	}
 	diva_os_enter_spin_lock(&adapter_lock, &old_irql, "open_adapter");
 	list_for_each(tmp, &adapter_queue) {
@@ -432,12 +432,12 @@ void diva_xdi_close_adapter(void *adapter, void *os_handle)
 	a->xdi_mbox.status &= ~DIVA_XDI_MBOX_BUSY;
 	if (a->xdi_mbox.data) {
 		diva_os_free(0, a->xdi_mbox.data);
-		a->xdi_mbox.data = 0;
+		a->xdi_mbox.data = NULL;
 	}
 }
 
 int
-diva_xdi_write(void *adapter, void *os_handle, const void *src,
+diva_xdi_write(void *adapter, void *os_handle, const void __user *src,
 	       int length, divas_xdi_copy_from_user_fn_t cp_fn)
 {
 	diva_os_xdi_adapter_t *a = (diva_os_xdi_adapter_t *) adapter;
@@ -480,7 +480,7 @@ diva_xdi_write(void *adapter, void *os_handle, const void *src,
 **  Write answers to user mode utility, if any
 */
 int
-diva_xdi_read(void *adapter, void *os_handle, void *dst,
+diva_xdi_read(void *adapter, void *os_handle, void __user *dst,
 	      int max_length, divas_xdi_copy_to_user_fn_t cp_fn)
 {
 	diva_os_xdi_adapter_t *a = (diva_os_xdi_adapter_t *) adapter;
@@ -507,7 +507,7 @@ diva_xdi_read(void *adapter, void *os_handle, void *dst,
 		      a->xdi_mbox.data_length);
 	if (ret > 0) {
 		diva_os_free(0, a->xdi_mbox.data);
-		a->xdi_mbox.data = 0;
+		a->xdi_mbox.data = NULL;
 		a->xdi_mbox.status &= ~DIVA_XDI_MBOX_BUSY;
 	}
 
@@ -526,7 +526,7 @@ irqreturn_t diva_os_irq_wrapper(int irq, void *context, struct pt_regs *regs)
 
 	if ((clear_int_proc = a->clear_interrupts_proc)) {
 		(*clear_int_proc) (a);
-		a->clear_interrupts_proc = 0;
+		a->clear_interrupts_proc = NULL;
 		return IRQ_HANDLED;
 	}
 
diff --git a/drivers/isdn/hardware/eicon/diva.h b/drivers/isdn/hardware/eicon/diva.h
index 7d5100931..e979085d1 100644
--- a/drivers/isdn/hardware/eicon/diva.h
+++ b/drivers/isdn/hardware/eicon/diva.h
@@ -9,19 +9,19 @@ void divasa_xdi_driver_unload(void);
 void *diva_driver_add_card(void *pdev, unsigned long CardOrdinal);
 void diva_driver_remove_card(void *pdiva);
 
-typedef int (*divas_xdi_copy_to_user_fn_t) (void *os_handle, void *dst,
+typedef int (*divas_xdi_copy_to_user_fn_t) (void *os_handle, void __user *dst,
 					    const void *src, int length);
 
 typedef int (*divas_xdi_copy_from_user_fn_t) (void *os_handle, void *dst,
-					      const void *src, int length);
+					      const void __user *src, int length);
 
-int diva_xdi_read(void *adapter, void *os_handle, void *dst,
+int diva_xdi_read(void *adapter, void *os_handle, void __user *dst,
 		  int max_length, divas_xdi_copy_to_user_fn_t cp_fn);
 
-int diva_xdi_write(void *adapter, void *os_handle, const void *src,
+int diva_xdi_write(void *adapter, void *os_handle, const void __user *src,
 		   int length, divas_xdi_copy_from_user_fn_t cp_fn);
 
-void *diva_xdi_open_adapter(void *os_handle, const void *src,
+void *diva_xdi_open_adapter(void *os_handle, const void __user *src,
 			    int length,
 			    divas_xdi_copy_from_user_fn_t cp_fn);
 
diff --git a/drivers/isdn/hardware/eicon/diva_dma.c b/drivers/isdn/hardware/eicon/diva_dma.c
index bdf2969e6..f53a74076 100644
--- a/drivers/isdn/hardware/eicon/diva_dma.c
+++ b/drivers/isdn/hardware/eicon/diva_dma.c
@@ -39,11 +39,10 @@ struct _diva_dma_map_entry {
   Create local mapping structure and init it to default state
   */
 struct _diva_dma_map_entry* diva_alloc_dma_map (void* os_context, int nentries) {
-  diva_dma_map_entry_t* pmap;
-  if (!(pmap = diva_os_malloc (0, sizeof(*pmap)*(nentries+1))))
-    return (0);
-  memset (pmap, 0x00, sizeof(*pmap)*(nentries+1));
-  return (pmap);
+  diva_dma_map_entry_t* pmap = diva_os_malloc(0, sizeof(*pmap)*(nentries+1));
+  if (pmap)
+	  memset (pmap, 0, sizeof(*pmap)*(nentries+1));
+  return pmap;
 }
 /*
   Free local map (context should be freed before) if any
diff --git a/drivers/isdn/hardware/eicon/divamnt.c b/drivers/isdn/hardware/eicon/divamnt.c
index abd70d0d0..6b22a8a5f 100644
--- a/drivers/isdn/hardware/eicon/divamnt.c
+++ b/drivers/isdn/hardware/eicon/divamnt.c
@@ -53,7 +53,7 @@ static struct timeval start_time;
 
 extern int mntfunc_init(int *, void **, unsigned long);
 extern void mntfunc_finit(void);
-extern int maint_read_write(void *buf, int count);
+extern int maint_read_write(void __user *buf, int count);
 
 /*
  *  helper functions
@@ -90,12 +90,12 @@ void diva_os_free_tbuffer(unsigned long flags, void *ptr)
 /*
  * kernel/user space copy functions
  */
-int diva_os_copy_to_user(void *os_handle, void *dst, const void *src,
+int diva_os_copy_to_user(void *os_handle, void __user *dst, const void *src,
 			 int length)
 {
 	return (copy_to_user(dst, src, length));
 }
-int diva_os_copy_from_user(void *os_handle, void *dst, const void *src,
+int diva_os_copy_from_user(void *os_handle, void *dst, const void __user *src,
 			   int length)
 {
 	return (copy_from_user(dst, src, length));
@@ -142,18 +142,15 @@ static struct proc_dir_entry *maint_proc_entry = NULL;
   to read unstructured traces, formated as ascii string only
   */
 static ssize_t
-maint_read(struct file *file, char *buf, size_t count, loff_t * off)
+maint_read(struct file *file, char __user *buf, size_t count, loff_t * off)
 {
-	diva_dbg_entry_head_t *pmsg = 0;
+	diva_dbg_entry_head_t *pmsg = NULL;
 	diva_os_spin_lock_magic_t old_irql;
 	word size;
 	char *pstr, *dli_label = "UNK";
 	int str_length;
 	int *str_msg;
 
-	if (off != &file->f_pos)
-		return -ESPIPE;
-
 	if (!file->private_data) {
 		for (;;) {
 			while (
@@ -264,20 +261,20 @@ maint_read(struct file *file, char *buf, size_t count, loff_t * off)
 
 	if (diva_os_copy_to_user(NULL, buf, pstr, str_length)) {
 		diva_os_free_tbuffer(0, str_msg);
-		file->private_data = 0;
+		file->private_data = NULL;
 		return (-EFAULT);
 	}
 	str_msg[1] += str_length;
 	if ((str_msg[0] - str_msg[1]) <= 0) {
 		diva_os_free_tbuffer(0, str_msg);
-		file->private_data = 0;
+		file->private_data = NULL;
 	}
 
 	return (str_length);
 }
 
 static ssize_t
-maint_write(struct file *file, const char *buf, size_t count, loff_t * off)
+maint_write(struct file *file, const char __user *buf, size_t count, loff_t * off)
 {
 	return (-ENODEV);
 }
@@ -304,16 +301,16 @@ static int maint_open(struct inode *ino, struct file *filep)
 	opened++;
 	up(&opened_sem);
 
-	filep->private_data = 0;
+	filep->private_data = NULL;
 
-	return (0);
+	return nonseekable_open(ino, filep);
 }
 
 static int maint_close(struct inode *ino, struct file *filep)
 {
 	if (filep->private_data) {
 		diva_os_free_tbuffer(0, filep->private_data);
-		filep->private_data = 0;
+		filep->private_data = NULL;
 	}
 
 	down(&opened_sem);
@@ -360,13 +357,13 @@ static void remove_maint_proc(void)
 /*
  * device node operations
  */
-static ssize_t divas_maint_write(struct file *file, const char *buf,
+static ssize_t divas_maint_write(struct file *file, const char __user *buf,
 				 size_t count, loff_t * ppos)
 {
-	return (maint_read_write((char *) buf, (int) count));
+	return (maint_read_write((char __user *) buf, (int) count));
 }
 
-static ssize_t divas_maint_read(struct file *file, char *buf,
+static ssize_t divas_maint_read(struct file *file, char __user *buf,
 				size_t count, loff_t * ppos)
 {
 	return (maint_read_write(buf, (int) count));
@@ -416,7 +413,7 @@ static int DIVA_INIT_FUNCTION maint_init(void)
 {
 	char tmprev[50];
 	int ret = 0;
-	void *buffer = 0;
+	void *buffer = NULL;
 
 	do_gettimeofday(&start_time);
 	init_waitqueue_head(&msgwaitq);
diff --git a/drivers/isdn/hardware/eicon/divasfunc.c b/drivers/isdn/hardware/eicon/divasfunc.c
index 52385931f..4ee56d4bb 100644
--- a/drivers/isdn/hardware/eicon/divasfunc.c
+++ b/drivers/isdn/hardware/eicon/divasfunc.c
@@ -173,7 +173,7 @@ static int DIVA_INIT_FUNCTION connect_didd(void)
 			req.didd_notify.e.Rc =
 			    IDI_SYNC_REQ_DIDD_REGISTER_ADAPTER_NOTIFY;
 			req.didd_notify.info.callback = (void *)didd_callback;
-			req.didd_notify.info.context = 0;
+			req.didd_notify.info.context = NULL;
 			DAdapter.request((ENTITY *) & req);
 			if (req.didd_notify.e.Rc != 0xff) {
 				stop_dbg();
diff --git a/drivers/isdn/hardware/eicon/divasi.c b/drivers/isdn/hardware/eicon/divasi.c
index 1a0640d82..058b5c29c 100644
--- a/drivers/isdn/hardware/eicon/divasi.c
+++ b/drivers/isdn/hardware/eicon/divasi.c
@@ -71,9 +71,9 @@ static char *getrev(const char *revision)
 /*
  *  LOCALS
  */
-static ssize_t um_idi_read(struct file *file, char *buf, size_t count,
+static ssize_t um_idi_read(struct file *file, char __user *buf, size_t count,
 			   loff_t * offset);
-static ssize_t um_idi_write(struct file *file, const char *buf,
+static ssize_t um_idi_write(struct file *file, const char __user *buf,
 			    size_t count, loff_t * offset);
 static unsigned int um_idi_poll(struct file *file, poll_table * wait);
 static int um_idi_open(struct inode *inode, struct file *file);
@@ -231,7 +231,7 @@ divas_um_idi_copy_to_user(void *os_handle, void *dst, const void *src,
 }
 
 static ssize_t
-um_idi_read(struct file *file, char *buf, size_t count, loff_t * offset)
+um_idi_read(struct file *file, char __user *buf, size_t count, loff_t * offset)
 {
 	diva_um_idi_os_context_t *p_os;
 	int ret = -EINVAL;
@@ -312,7 +312,7 @@ static int um_idi_open_adapter(struct file *file, int adapter_nr)
 }
 
 static ssize_t
-um_idi_write(struct file *file, const char *buf, size_t count,
+um_idi_write(struct file *file, const char __user *buf, size_t count,
 	     loff_t * offset)
 {
 	diva_um_idi_os_context_t *p_os;
diff --git a/drivers/isdn/hardware/eicon/divasmain.c b/drivers/isdn/hardware/eicon/divasmain.c
index f00f6ba19..866ae64d2 100644
--- a/drivers/isdn/hardware/eicon/divasmain.c
+++ b/drivers/isdn/hardware/eicon/divasmain.c
@@ -556,7 +556,7 @@ void diva_os_remove_soft_isr(diva_os_soft_isr_t * psoft_isr)
 		tasklet_kill(&pdpc->divas_task);
 		flush_scheduled_work();
 		mem = psoft_isr->object;
-		psoft_isr->object = 0;
+		psoft_isr->object = NULL;
 		diva_os_free(0, mem);
 	}
 }
@@ -565,7 +565,7 @@ void diva_os_remove_soft_isr(diva_os_soft_isr_t * psoft_isr)
  * kernel/user space copy functions
  */
 static int
-xdi_copy_to_user(void *os_handle, void *dst, const void *src, int length)
+xdi_copy_to_user(void *os_handle, void __user *dst, const void *src, int length)
 {
 	if (copy_to_user(dst, src, length)) {
 		return (-EFAULT);
@@ -574,7 +574,7 @@ xdi_copy_to_user(void *os_handle, void *dst, const void *src, int length)
 }
 
 static int
-xdi_copy_from_user(void *os_handle, void *dst, const void *src, int length)
+xdi_copy_from_user(void *os_handle, void *dst, const void __user *src, int length)
 {
 	if (copy_from_user(dst, src, length)) {
 		return (-EFAULT);
@@ -598,7 +598,7 @@ static int divas_release(struct inode *inode, struct file *file)
 	return (0);
 }
 
-static ssize_t divas_write(struct file *file, const char *buf,
+static ssize_t divas_write(struct file *file, const char __user *buf,
 			   size_t count, loff_t * ppos)
 {
 	int ret = -EINVAL;
@@ -629,7 +629,7 @@ static ssize_t divas_write(struct file *file, const char *buf,
 	return (ret);
 }
 
-static ssize_t divas_read(struct file *file, char *buf,
+static ssize_t divas_read(struct file *file, char __user *buf,
 			  size_t count, loff_t * ppos)
 {
 	int ret = -EINVAL;
@@ -703,7 +703,7 @@ static int DIVA_INIT_FUNCTION divas_register_chrdev(void)
 static int __devinit divas_init_one(struct pci_dev *pdev,
 				    const struct pci_device_id *ent)
 {
-	void *pdiva = 0;
+	void *pdiva = NULL;
 	u8 pci_latency;
 	u8 new_latency = 32;
 
diff --git a/drivers/isdn/hardware/eicon/divasproc.c b/drivers/isdn/hardware/eicon/divasproc.c
index abf80d82e..55e83d188 100644
--- a/drivers/isdn/hardware/eicon/divasproc.c
+++ b/drivers/isdn/hardware/eicon/divasproc.c
@@ -54,7 +54,7 @@ extern struct proc_dir_entry *proc_net_eicon;
 static struct proc_dir_entry *divas_proc_entry = NULL;
 
 static ssize_t
-divas_read(struct file *file, char *buf, size_t count, loff_t * off)
+divas_read(struct file *file, char __user *buf, size_t count, loff_t * off)
 {
 	int len = 0;
 	int cadapter;
@@ -63,8 +63,6 @@ divas_read(struct file *file, char *buf, size_t count, loff_t * off)
 
 	if (*off)
 		return 0;
-	if (off != &file->f_pos)
-		return -ESPIPE;
 
 	divas_get_version(tmpbuf);
 	if (copy_to_user(buf + len, &tmpbuf, strlen(tmpbuf)))
@@ -95,7 +93,7 @@ divas_read(struct file *file, char *buf, size_t count, loff_t * off)
 }
 
 static ssize_t
-divas_write(struct file *file, const char *buf, size_t count, loff_t * off)
+divas_write(struct file *file, const char __user *buf, size_t count, loff_t * off)
 {
 	return (-ENODEV);
 }
@@ -107,7 +105,7 @@ static unsigned int divas_poll(struct file *file, poll_table * wait)
 
 static int divas_open(struct inode *inode, struct file *file)
 {
-	return (0);
+	return nonseekable_open(inode, file);
 }
 
 static int divas_close(struct inode *inode, struct file *file)
@@ -151,14 +149,17 @@ void remove_divas_proc(void)
 ** write group_optimization 
 */
 static int
-write_grp_opt(struct file *file, const char *buffer, unsigned long count,
+write_grp_opt(struct file *file, const char __user *buffer, unsigned long count,
 	      void *data)
 {
 	diva_os_xdi_adapter_t *a = (diva_os_xdi_adapter_t *) data;
 	PISDN_ADAPTER IoAdapter = IoAdapters[a->controller - 1];
 
 	if ((count == 1) || (count == 2)) {
-		switch (buffer[0]) {
+		char c;
+		if (get_user(c, buffer))
+			return -EFAULT;
+		switch (c) {
 		case '0':
 			IoAdapter->capi_cfg.cfg_1 &=
 			    ~DIVA_XDI_CAPI_CFG_1_GROUP_POPTIMIZATION_ON;
@@ -179,14 +180,17 @@ write_grp_opt(struct file *file, const char *buffer, unsigned long count,
 ** write dynamic_l1_down
 */
 static int
-write_d_l1_down(struct file *file, const char *buffer, unsigned long count,
+write_d_l1_down(struct file *file, const char __user *buffer, unsigned long count,
 		void *data)
 {
 	diva_os_xdi_adapter_t *a = (diva_os_xdi_adapter_t *) data;
 	PISDN_ADAPTER IoAdapter = IoAdapters[a->controller - 1];
 
 	if ((count == 1) || (count == 2)) {
-		switch (buffer[0]) {
+		char c;
+		if (get_user(c, buffer))
+			return -EFAULT;
+		switch (c) {
 		case '0':
 			IoAdapter->capi_cfg.cfg_1 &=
 			    ~DIVA_XDI_CAPI_CFG_1_DYNAMIC_L1_ON;
@@ -256,14 +260,21 @@ read_grp_opt(char *page, char **start, off_t off, int count, int *eof,
 ** info write
 */
 static int
-info_write(struct file *file, const char *buffer, unsigned long count,
+info_write(struct file *file, const char __user *buffer, unsigned long count,
 	   void *data)
 {
 	diva_os_xdi_adapter_t *a = (diva_os_xdi_adapter_t *) data;
 	PISDN_ADAPTER IoAdapter = IoAdapters[a->controller - 1];
+	char c[4];
+
+	if (count <= 4)
+		return -EINVAL;
+
+	if (copy_from_user(c, buffer, 4))
+		return -EFAULT;
 
 	/* this is for test purposes only */
-	if ((count > 4) && (!memcmp(buffer, "trap", 4))) {
+	if (!memcmp(c, "trap", 4)) {
 		(*(IoAdapter->os_trap_nfy_Fnc)) (IoAdapter, IoAdapter->ANum);
 		return (count);
 	}
diff --git a/drivers/isdn/hardware/eicon/dqueue.c b/drivers/isdn/hardware/eicon/dqueue.c
index f1d7997f3..982258225 100644
--- a/drivers/isdn/hardware/eicon/dqueue.c
+++ b/drivers/isdn/hardware/eicon/dqueue.c
@@ -23,7 +23,7 @@ diva_data_q_init(diva_um_idi_data_queue_t * q,
 	q->segments = max_segments;
 
 	for (i = 0; i < q->segments; i++) {
-		q->data[i] = 0;
+		q->data[i] = NULL;
 		q->length[i] = 0;
 	}
 	q->read = q->write = q->count = q->segment_pending = 0;
@@ -46,7 +46,7 @@ int diva_data_q_finit(diva_um_idi_data_queue_t * q)
 		if (q->data[i]) {
 			diva_os_free(0, q->data[i]);
 		}
-		q->data[i] = 0;
+		q->data[i] = NULL;
 		q->length[i] = 0;
 	}
 	q->read = q->write = q->count = q->segment_pending = 0;
@@ -66,7 +66,7 @@ void *diva_data_q_get_segment4write(diva_um_idi_data_queue_t * q)
 		return (q->data[q->write]);
 	}
 
-	return (0);
+	return NULL;
 }
 
 void
@@ -89,7 +89,7 @@ const void *diva_data_q_get_segment4read(const diva_um_idi_data_queue_t *
 	if (q->count) {
 		return (q->data[q->read]);
 	}
-	return (0);
+	return NULL;
 }
 
 int diva_data_q_get_segment_length(const diva_um_idi_data_queue_t * q)
diff --git a/drivers/isdn/hardware/eicon/idifunc.c b/drivers/isdn/hardware/eicon/idifunc.c
index f3427aad6..63746f401 100644
--- a/drivers/isdn/hardware/eicon/idifunc.c
+++ b/drivers/isdn/hardware/eicon/idifunc.c
@@ -199,7 +199,7 @@ static int DIVA_INIT_FUNCTION connect_didd(void)
 			req.didd_notify.e.Rc =
 			    IDI_SYNC_REQ_DIDD_REGISTER_ADAPTER_NOTIFY;
 			req.didd_notify.info.callback = (void *)didd_callback;
-			req.didd_notify.info.context = 0;
+			req.didd_notify.info.context = NULL;
 			DAdapter.request((ENTITY *) & req);
 			if (req.didd_notify.e.Rc != 0xff) {
 				stop_dbg();
diff --git a/drivers/isdn/hardware/eicon/maintidi.c b/drivers/isdn/hardware/eicon/maintidi.c
index 29850cf19..8bef29b8b 100644
--- a/drivers/isdn/hardware/eicon/maintidi.c
+++ b/drivers/isdn/hardware/eicon/maintidi.c
@@ -112,7 +112,7 @@ diva_strace_library_interface_t* DivaSTraceLibraryCreateInstance (int Adapter,
 	int i;
 
 	if (!pLib) {
-		return (0);
+		return NULL;
 	}
 
   pmem += sizeof(*pLib);
@@ -161,7 +161,7 @@ diva_strace_library_interface_t* DivaSTraceLibraryCreateInstance (int Adapter,
 
 	if (!(pLib->hAdapter = SuperTraceOpenAdapter (Adapter))) {
     diva_mnt_internal_dprintf (0, DLI_ERR, "Can not open XDI adapter");
-		return (0);
+		return NULL;
 	}
 	pLib->Channels = SuperTraceGetNumberOfChannels (pLib->hAdapter);
 
@@ -1170,13 +1170,13 @@ static diva_man_var_header_t* get_next_var (diva_man_var_header_t* pVar) {
 	byte* start;
 	int msg_length;
 
-	if (*msg != ESC) return (0);
+	if (*msg != ESC) return NULL;
 
 	start = msg + 2;
 	msg_length = *(msg+1);
 	msg = (start+msg_length);
 
-	if (*msg != ESC) return (0);
+	if (*msg != ESC) return NULL;
 
 	return ((diva_man_var_header_t*)msg);
 }
diff --git a/drivers/isdn/hardware/eicon/message.c b/drivers/isdn/hardware/eicon/message.c
index 03d89d426..5ce359aac 100644
--- a/drivers/isdn/hardware/eicon/message.c
+++ b/drivers/isdn/hardware/eicon/message.c
@@ -414,7 +414,7 @@ word api_put(APPL   * appl, CAPI_MSG   * msg)
   }
   
   a = &adapter[controller];
-  plci = 0;
+  plci = NULL;
   if ((msg->header.plci != 0) && (msg->header.plci <= a->max_plci) && !a->adapter_disabled)
   {
     dbug(1,dprintf("plci=%x",msg->header.plci));
@@ -547,7 +547,7 @@ word api_put(APPL   * appl, CAPI_MSG   * msg)
     }
     else
     {
-      plci = 0;
+      plci = NULL;
     }
   }
   dbug(1,dprintf("com=%x",msg->header.command));
@@ -629,7 +629,7 @@ word api_parse(byte   * msg, word length, byte * format, API_PARSE * parms)
 
     if(p>length) return TRUE;
   }
-  if(parms) parms[i].info = 0;
+  if(parms) parms[i].info = NULL;
   return FALSE;
 }
 
@@ -661,7 +661,7 @@ void api_save_msg(API_PARSE   *in, byte *format, API_SAVE   *out)
     for (j = 0; j < n; j++)
       *(p++) = in[i].info[j];
   }
-  out->parms[i].info = 0;
+  out->parms[i].info = NULL;
   out->parms[i].length = 0;
 }
 
@@ -725,7 +725,7 @@ void init_internal_command_queue (PLCI   *plci)
 
   plci->internal_command = 0;
   for (i = 0; i < MAX_INTERNAL_COMMAND_LEVELS; i++)
-    plci->internal_command_queue[i] = 0;
+    plci->internal_command_queue[i] = NULL;
 }
 
 
@@ -759,16 +759,16 @@ void next_internal_command (dword Id, PLCI   *plci)
     UnMapId (Id), (char   *)(FILE_), __LINE__));
 
   plci->internal_command = 0;
-  plci->internal_command_queue[0] = 0;
+  plci->internal_command_queue[0] = NULL;
   while (plci->internal_command_queue[1] != 0)
   {
     for (i = 0; i < MAX_INTERNAL_COMMAND_LEVELS - 1; i++)
       plci->internal_command_queue[i] = plci->internal_command_queue[i+1];
-    plci->internal_command_queue[MAX_INTERNAL_COMMAND_LEVELS - 1] = 0;
+    plci->internal_command_queue[MAX_INTERNAL_COMMAND_LEVELS - 1] = NULL;
     (*(plci->internal_command_queue[0]))(Id, plci, OK);
     if (plci->internal_command != 0)
       return;
-    plci->internal_command_queue[0] = 0;
+    plci->internal_command_queue[0] = NULL;
   }
 }
 
@@ -1085,7 +1085,7 @@ void plci_remove(PLCI   * plci)
   plci_free_msg_in_queue (plci);
 
   plci->channels = 0;
-  plci->appl = 0;
+  plci->appl = NULL;
   if ((plci->State == INC_CON_PENDING) || (plci->State == INC_CON_ALERT))
     plci->State = OUTG_DIS_PENDING;
 }
@@ -1715,7 +1715,7 @@ byte info_req(dword Id, word Number, DIVA_CAPI_ADAPTER   * a, PLCI   * plci, APP
 {
   word i;
   API_PARSE * ai;
-  PLCI   * rc_plci = 0;
+  PLCI   * rc_plci = NULL;
     API_PARSE ai_parms[5];
   word Info = 0;
 
@@ -2195,7 +2195,7 @@ byte facility_req(dword Id, word Number, DIVA_CAPI_ADAPTER   * a, PLCI   * plci,
               relatedadapter = &adapter[MapController ((byte)(relatedPLCIvalue & 0x7f))-1];
               relatedPLCIvalue >>=8;
               /* find PLCI PTR*/
-              for(i=0,rplci=0;i<relatedadapter->max_plci;i++)
+              for(i=0,rplci=NULL;i<relatedadapter->max_plci;i++)
               {
                 if(relatedadapter->plci[i].Id == (byte)relatedPLCIvalue)
                 {
@@ -4355,7 +4355,7 @@ void control_rc(PLCI   * plci, byte req, byte rc, byte ch, byte global_req, byte
         if(rc!=OK)
         {
           Info = 0x300E; /* not supported */
-          plci->relatedPTYPLCI = 0;
+          plci->relatedPTYPLCI = NULL;
           plci->ptyState = 0;
         }
         sendf(rplci->appl,
@@ -4376,7 +4376,7 @@ void control_rc(PLCI   * plci, byte req, byte rc, byte ch, byte global_req, byte
         if(rc!=OK)
         {
           Info = 0x300E; /* not supported */
-          plci->relatedPTYPLCI = 0;
+          plci->relatedPTYPLCI = NULL;
           plci->ptyState = 0;
         }
         sendf(rplci->appl,
@@ -4560,7 +4560,7 @@ void control_rc(PLCI   * plci, byte req, byte rc, byte ch, byte global_req, byte
         if(rc!=OK)
         {
           Info = 0x300E; /* not supported */
-          plci->relatedPTYPLCI = 0;
+          plci->relatedPTYPLCI = NULL;
           plci->ptyState = 0;
         }
         sendf(rplci->appl,
@@ -4722,7 +4722,7 @@ void control_rc(PLCI   * plci, byte req, byte rc, byte ch, byte global_req, byte
           dbug(1,dprintf("Auto-Law assign failed"));
           a->automatic_law = 3;
           plci->internal_command = 0;
-          a->automatic_lawPLCI = 0;
+          a->automatic_lawPLCI = NULL;
         }
         break;
       }
@@ -4739,7 +4739,7 @@ void control_rc(PLCI   * plci, byte req, byte rc, byte ch, byte global_req, byte
         plci->internal_command = 0;
         sig_req(plci,REMOVE,0);
         send_req(plci);
-        a->automatic_lawPLCI = 0;
+        a->automatic_lawPLCI = NULL;
       }
       break;
     }
@@ -4839,7 +4839,7 @@ void sig_ind(PLCI   * plci)
     byte   *esc_profile = "";
 
     byte facility[256];
-  PLCI   * tplci = 0;
+  PLCI   * tplci = NULL;
   byte chi[] = "\x02\x18\x01";
   byte voice_cai[]  = "\x06\x14\x00\x00\x00\x00\x08";
     byte resume_cau[] = "\x05\x05\x00\x02\x00\x00";
@@ -4981,7 +4981,7 @@ void sig_ind(PLCI   * plci)
         plci->internal_command = 0;
         sig_req(plci,REMOVE,0);
         send_req(plci);
-        a->automatic_lawPLCI = 0;
+        a->automatic_lawPLCI = NULL;
       }
     }
     if (esc_profile[0])
@@ -5073,7 +5073,7 @@ void sig_ind(PLCI   * plci)
   {
     force_mt_info =  SendMultiIE(plci,Id,multi_fac_parms, FTY, 0x20, 0);
     force_mt_info |= SendMultiIE(plci,Id,multi_pi_parms, PI, 0x210, 0);
-    SendSSExtInd(0,plci,Id,multi_ssext_parms);
+    SendSSExtInd(NULL,plci,Id,multi_ssext_parms);
     SendInfo(plci,Id, parms, force_mt_info);
 
     VSwitchReqInd(plci,Id,multi_vswitch_parms);
@@ -5144,7 +5144,7 @@ void sig_ind(PLCI   * plci)
       {
         WRITE_WORD(&SS_Ind[4],0x300E);
       }
-      plci->relatedPTYPLCI = 0;
+      plci->relatedPTYPLCI = NULL;
       plci->ptyState = 0;
       sendf(tplci->appl,_FACILITY_I,rId,0,"ws",3, SS_Ind);
       break;
@@ -5298,7 +5298,7 @@ void sig_ind(PLCI   * plci)
           break;
       case CONF_ADD:
           WRITE_WORD(&CONF_Ind[1],S_CONF_ADD);
-          plci->relatedPTYPLCI = 0;
+          plci->relatedPTYPLCI = NULL;
           tplci=plci->relatedPTYPLCI;
           if(tplci) tplci->ptyState = CONNECTED;
           plci->ptyState = CONNECTED;
@@ -5342,7 +5342,7 @@ void sig_ind(PLCI   * plci)
         {
 
         plci->ptyState = IDLE;
-        plci->relatedPTYPLCI = 0;
+        plci->relatedPTYPLCI = NULL;
         plci->ptyState = 0;
 
         }
@@ -5364,7 +5364,7 @@ void sig_ind(PLCI   * plci)
 
         case S_3PTY_END:
           plci->ptyState = IDLE;
-          plci->relatedPTYPLCI = 0;
+          plci->relatedPTYPLCI = NULL;
           plci->ptyState = 0;
           dbug(1,dprintf("3PTY OFF"));
           break;
@@ -5904,7 +5904,7 @@ void sig_ind(PLCI   * plci)
           /* and signal '+'.Appl must decide */
           /* with connect_res if call must   */
           /* accepted or not                 */
-          for(i=0, tplci=0;i<max_appl;i++){
+          for(i=0, tplci=NULL;i<max_appl;i++){
             if(a->codec_listen[i]
             && (a->codec_listen[i]->State==INC_CON_PENDING
               ||a->codec_listen[i]->State==INC_CON_ALERT) ){
@@ -5927,7 +5927,7 @@ void sig_ind(PLCI   * plci)
               add_p(tplci, CAI, voice_cai);
               add_p(tplci, OAD, a->TelOAD);
               add_p(tplci, OSA, a->TelOSA);
-              add_p(tplci,SHIFT|6,0);
+              add_p(tplci,SHIFT|6,NULL);
               add_p(tplci,SIN,"\x02\x01\x00");
               add_p(tplci,UID,"\x06\x43\x61\x70\x69\x32\x30");
               sig_req(tplci,ASSIGN,DSIG_ID);
@@ -6080,7 +6080,7 @@ void sig_ind(PLCI   * plci)
     break;
 
   case SSEXT_IND:
-    SendSSExtInd(0,plci,Id,multi_ssext_parms);
+    SendSSExtInd(NULL,plci,Id,multi_ssext_parms);
     break;
 
   case VSWITCH_REQ:
@@ -6218,7 +6218,7 @@ void SendInfo(PLCI   * plci, dword Id, byte   * * parms, byte iesent)
         Info_Number = 0x0008;
         Info_Mask = 0x00;
         cause[2] = ie[2];
-        Info_Element = 0;
+        Info_Element = NULL;
         break;
       case 8:  /* display      */
         dbug(1,dprintf("display(%d)",i));
@@ -7273,8 +7273,8 @@ word get_plci(DIVA_CAPI_ADAPTER   * a)
   plci->sig_req = 0;
   plci->nl_req = 0;
 
-  plci->appl = 0;
-  plci->relatedPTYPLCI = 0;
+  plci->appl = NULL;
+  plci->relatedPTYPLCI = NULL;
   plci->State = IDLE;
   plci->SuppState = IDLE;
   plci->channels = 0;
@@ -8899,7 +8899,7 @@ void listen_check(DIVA_CAPI_ADAPTER   * a)
         add_p(plci,CAI,"\x01\xc0");
         add_p(plci,UID,"\x06\x43\x61\x70\x69\x32\x30");
         add_p(plci,LLI,"\x01\xc4");                  /* support Dummy CR FAC + MWI + SpoofNotify */       
-        add_p(plci,SHIFT|6,0);
+        add_p(plci,SHIFT|6,NULL);
         add_p(plci,SIN,"\x02\x00\x00");
         plci->internal_command = LISTEN_SIG_ASSIGN_PEND;     /* do indicate_req if OK  */
         sig_req(plci,ASSIGN,DSIG_ID);
@@ -9216,10 +9216,10 @@ void CodecIdCheck(DIVA_CAPI_ADAPTER   *a, PLCI   *plci)
       dbug(1,dprintf("remove temp codec PLCI"));
       plci_remove(a->AdvCodecPLCI);
       a->AdvCodecFLAG  = 0;
-      a->AdvCodecPLCI  = 0;
-      a->AdvSignalAppl = 0;
+      a->AdvCodecPLCI  = NULL;
+      a->AdvSignalAppl = NULL;
     }
-    a->AdvSignalPLCI = 0;
+    a->AdvSignalPLCI = NULL;
   }
 }
 
@@ -9351,7 +9351,7 @@ word CapiRelease(word Id)
       a->Info_Mask[Id-1] = 0;
       a->CIP_Mask[Id-1] = 0;
       a->Notification_Mask[Id-1] = 0;
-      a->codec_listen[Id-1] = 0;
+      a->codec_listen[Id-1] = NULL;
       a->requested_options_table[Id-1] = 0;
       for(j=0; j<a->max_plci; j++)           /* and all PLCIs connected */
       {                                      /* with this application   */
@@ -9386,7 +9386,7 @@ word CapiRelease(word Id)
           }
           if(plci->appl==this)
           {
-            plci->appl = 0;
+            plci->appl = NULL;
             plci_remove(plci);
             plci->State = IDLE;
           }
@@ -9405,7 +9405,7 @@ word CapiRelease(word Id)
             add_p(plci,OAD,"\x01\xfd");
             add_p(plci,CAI,"\x01\x80");
             add_p(plci,UID,"\x06\x43\x61\x70\x69\x32\x30");
-            add_p(plci,SHIFT|6,0);
+            add_p(plci,SHIFT|6,NULL);
             add_p(plci,SIN,"\x02\x00\x00");
             plci->internal_command = REM_L1_SIG_ASSIGN_PEND;
             sig_req(plci,ASSIGN,DSIG_ID);
@@ -9424,10 +9424,10 @@ word CapiRelease(word Id)
           a->AdvCodecPLCI->tel = 0;
           a->AdvCodecPLCI->adv_nl = 0;
         }
-        a->AdvSignalAppl = 0;
-        a->AdvSignalPLCI = 0;
+        a->AdvSignalAppl = NULL;
+        a->AdvSignalPLCI = NULL;
         a->AdvCodecFLAG = 0;
-        a->AdvCodecPLCI = 0;
+        a->AdvCodecPLCI = NULL;
       }
     }
   }
@@ -9458,7 +9458,7 @@ static word plci_remove_check(PLCI   *plci)
         plci->Id = 0;
         plci->State = IDLE;
         plci->channels = 0;
-        plci->appl = 0;
+        plci->appl = NULL;
         plci->notifiedcall = 0;
       }
       listen_check(plci->adapter);
@@ -10265,8 +10265,8 @@ static word dtmf_parameter_restore_config (dword Id, PLCI   *plci, byte Rc)
 /*------------------------------------------------------------------*/
 
 
-LI_CONFIG   *li_config_table = 0;
-word li_total_channels = 0;
+LI_CONFIG   *li_config_table;
+word li_total_channels;
 
 
 /*------------------------------------------------------------------*/
@@ -14948,7 +14948,7 @@ word CapiRegister(word id)
             add_p(plci,OAD,"\x01\xfd");
             add_p(plci,CAI,"\x01\x80");
             add_p(plci,UID,"\x06\x43\x61\x70\x69\x32\x30");
-            add_p(plci,SHIFT|6,0);
+            add_p(plci,SHIFT|6,NULL);
             add_p(plci,SIN,"\x02\x00\x00");
             plci->internal_command = START_L1_SIG_ASSIGN_PEND;
             sig_req(plci,ASSIGN,DSIG_ID);
@@ -15068,7 +15068,7 @@ static int diva_get_dma_descriptor (PLCI   *plci, dword   *dma_magic) {
 
   pReq->xdi_dma_descriptor_operation.info.operation =     IDI_SYNC_REQ_DMA_DESCRIPTOR_ALLOC;
   pReq->xdi_dma_descriptor_operation.info.descriptor_number  = -1;
-  pReq->xdi_dma_descriptor_operation.info.descriptor_address = 0;
+  pReq->xdi_dma_descriptor_operation.info.descriptor_address = NULL;
   pReq->xdi_dma_descriptor_operation.info.descriptor_magic   = 0;
 
   e.user[0] = plci->adapter->Id - 1;
@@ -15102,7 +15102,7 @@ static void diva_free_dma_descriptor (PLCI   *plci, int nr) {
 
   pReq->xdi_dma_descriptor_operation.info.operation =                                                IDI_SYNC_REQ_DMA_DESCRIPTOR_FREE;
   pReq->xdi_dma_descriptor_operation.info.descriptor_number  = nr;
-  pReq->xdi_dma_descriptor_operation.info.descriptor_address = 0;
+  pReq->xdi_dma_descriptor_operation.info.descriptor_address = NULL;
   pReq->xdi_dma_descriptor_operation.info.descriptor_magic   = 0;
 
   e.user[0] = plci->adapter->Id - 1;
diff --git a/drivers/isdn/hardware/eicon/mntfunc.c b/drivers/isdn/hardware/eicon/mntfunc.c
index 00ef979d6..c94229904 100644
--- a/drivers/isdn/hardware/eicon/mntfunc.c
+++ b/drivers/isdn/hardware/eicon/mntfunc.c
@@ -34,10 +34,10 @@ static DESCRIPTOR MaintDescriptor =
 extern void *diva_os_malloc_tbuffer(unsigned long flags,
 				    unsigned long size);
 extern void diva_os_free_tbuffer(unsigned long flags, void *ptr);
-extern int diva_os_copy_to_user(void *os_handle, void *dst,
+extern int diva_os_copy_to_user(void *os_handle, void __user *dst,
 				const void *src, int length);
 extern int diva_os_copy_from_user(void *os_handle, void *dst,
-				  const void *src, int length);
+				  const void __user *src, int length);
 
 static void no_printf(unsigned char *x, ...)
 {
@@ -102,7 +102,7 @@ static int DIVA_INIT_FUNCTION connect_didd(void)
 			req.didd_notify.e.Rc =
 			    IDI_SYNC_REQ_DIDD_REGISTER_ADAPTER_NOTIFY;
 			req.didd_notify.info.callback = (void *)didd_callback;
-			req.didd_notify.info.context = 0;
+			req.didd_notify.info.context = NULL;
 			DAdapter.request((ENTITY *) & req);
 			if (req.didd_notify.e.Rc != 0xff)
 				return (0);
@@ -148,7 +148,7 @@ static void DIVA_EXIT_FUNCTION disconnect_didd(void)
 /*
  * read/write maint
  */
-int maint_read_write(void *buf, int count)
+int maint_read_write(void __user *buf, int count)
 {
 	byte data[128];
 	dword cmd, id, mask;
@@ -228,7 +228,7 @@ int maint_read_write(void *buf, int count)
 			diva_os_spin_lock_magic_t old_irql;
 			word size;
 			diva_dbg_entry_head_t *pmsg;
-			byte *pbuf = 0;
+			byte *pbuf = NULL;
 			int written = 0;
 
 			if (mask < 4096) {
diff --git a/drivers/isdn/hardware/eicon/os_4bri.c b/drivers/isdn/hardware/eicon/os_4bri.c
index 7dade2d8d..e6016f924 100644
--- a/drivers/isdn/hardware/eicon/os_4bri.c
+++ b/drivers/isdn/hardware/eicon/os_4bri.c
@@ -17,7 +17,7 @@
 #include "mi_pc.h"
 #include "dsrv4bri.h"
 
-void *diva_xdiLoadFileFile = 0;
+void *diva_xdiLoadFileFile = NULL;
 dword diva_xdiLoadFileLength = 0;
 
 /*
@@ -268,7 +268,7 @@ int diva_4bri_init_card(diva_os_xdi_adapter_t * a)
 		     (diva_os_xdi_adapter_t *) diva_os_malloc(0, sizeof(*a))))
 		{
 			diva_os_free(0, a->slave_adapters[0]);
-			a->slave_adapters[0] = 0;
+			a->slave_adapters[0] = NULL;
 			diva_4bri_cleanup_adapter(a);
 			return (-1);
 		}
@@ -277,8 +277,8 @@ int diva_4bri_init_card(diva_os_xdi_adapter_t * a)
 		{
 			diva_os_free(0, a->slave_adapters[0]);
 			diva_os_free(0, a->slave_adapters[1]);
-			a->slave_adapters[0] = 0;
-			a->slave_adapters[1] = 0;
+			a->slave_adapters[0] = NULL;
+			a->slave_adapters[1] = NULL;
 			diva_4bri_cleanup_adapter(a);
 			return (-1);
 		}
@@ -300,7 +300,7 @@ int diva_4bri_init_card(diva_os_xdi_adapter_t * a)
 	if (!(a->slave_list = quadro_list)) {
 		for (i = 0; i < (tasks - 1); i++) {
 			diva_os_free(0, a->slave_adapters[i]);
-			a->slave_adapters[i] = 0;
+			a->slave_adapters[i] = NULL;
 		}
 		diva_4bri_cleanup_adapter(a);
 		return (-1);
@@ -499,7 +499,7 @@ static int diva_4bri_cleanup_adapter(diva_os_xdi_adapter_t * a)
 			    && a->resources.pci.addr[bar]) {
 				divasa_unmap_pci_bar(a->resources.pci.addr[bar]);
 				a->resources.pci.bar[bar] = 0;
-				a->resources.pci.addr[bar] = 0;
+				a->resources.pci.addr[bar] = NULL;
 			}
 		}
 	}
@@ -515,12 +515,12 @@ static int diva_4bri_cleanup_adapter(diva_os_xdi_adapter_t * a)
 					 _4bri_bar_length[1],
 					 &a->port_name[0], 1);
 		a->resources.pci.bar[1] = 0;
-		a->resources.pci.addr[1] = 0;
+		a->resources.pci.addr[1] = NULL;
 	}
 
 	if (a->slave_list) {
 		diva_os_free(0, a->slave_list);
-		a->slave_list = 0;
+		a->slave_list = NULL;
 	}
 
 	return (0);
@@ -607,14 +607,14 @@ static int diva_4bri_cleanup_slave_adapters(diva_os_xdi_adapter_t * a)
 
 			diva_os_remove_soft_isr(&diva_current->xdi_adapter.
 						req_soft_isr);
-			diva_current->xdi_adapter.isr_soft_isr.object = 0;
+			diva_current->xdi_adapter.isr_soft_isr.object = NULL;
 
 			if (diva_current->xdi_adapter.e_tbl) {
 				diva_os_free(0,
 					     diva_current->xdi_adapter.
 					     e_tbl);
 			}
-			diva_current->xdi_adapter.e_tbl = 0;
+			diva_current->xdi_adapter.e_tbl = NULL;
 			diva_current->xdi_adapter.e_max = 0;
 			diva_current->xdi_adapter.e_count = 0;
 		}
@@ -823,7 +823,7 @@ void *xdiLoadFile(char *FileName, unsigned long *FileLength,
 	if (FileLength) {
 		*FileLength = diva_xdiLoadFileLength;
 	}
-	diva_xdiLoadFileFile = 0;
+	diva_xdiLoadFileFile = NULL;
 	diva_xdiLoadFileLength = 0;
 
 	return (ret);
@@ -848,7 +848,7 @@ diva_4bri_write_fpga_image(diva_os_xdi_adapter_t * a, byte * data,
 
 	ret = qBri_FPGA_download(&a->xdi_adapter);
 
-	diva_xdiLoadFileFile = 0;
+	diva_xdiLoadFileFile = NULL;
 	diva_xdiLoadFileLength = 0;
 
 	return (ret ? 0 : -1);
@@ -1116,7 +1116,7 @@ static int diva_4bri_stop_adapter(diva_os_xdi_adapter_t * a)
 
 	if (a->clear_interrupts_proc) {
 		diva_4bri_clear_interrupts(a);
-		a->clear_interrupts_proc = 0;
+		a->clear_interrupts_proc = NULL;
 		DBG_ERR(("A: A(%d) no final interrupt from 4BRI adapter",
 			 IoAdapter->ANum))
 	}
diff --git a/drivers/isdn/hardware/eicon/os_bri.c b/drivers/isdn/hardware/eicon/os_bri.c
index b2acc3fd8..e8f023d2d 100644
--- a/drivers/isdn/hardware/eicon/os_bri.c
+++ b/drivers/isdn/hardware/eicon/os_bri.c
@@ -282,7 +282,7 @@ static int diva_bri_cleanup_adapter(diva_os_xdi_adapter_t * a)
 
 	if (a->resources.pci.addr[0] && a->resources.pci.bar[0]) {
 		divasa_unmap_pci_bar(a->resources.pci.addr[0]);
-		a->resources.pci.addr[0] = 0;
+		a->resources.pci.addr[0] = NULL;
 		a->resources.pci.bar[0] = 0;
 	}
 
@@ -293,7 +293,7 @@ static int diva_bri_cleanup_adapter(diva_os_xdi_adapter_t * a)
 						 a->resources.pci.
 						 length[i],
 						 &a->port_name[0], i);
-			a->resources.pci.addr[i] = 0;
+			a->resources.pci.addr[i] = NULL;
 			a->resources.pci.bar[i] = 0;
 		}
 	}
@@ -305,7 +305,7 @@ static int diva_bri_cleanup_adapter(diva_os_xdi_adapter_t * a)
 	diva_os_cancel_soft_isr(&a->xdi_adapter.isr_soft_isr);
 
 	diva_os_remove_soft_isr(&a->xdi_adapter.req_soft_isr);
-	a->xdi_adapter.isr_soft_isr.object = 0;
+	a->xdi_adapter.isr_soft_isr.object = NULL;
 
 	diva_os_destroy_spin_lock(&a->xdi_adapter.isr_spin_lock, "rm");
 	diva_os_destroy_spin_lock(&a->xdi_adapter.data_spin_lock, "rm");
@@ -315,7 +315,7 @@ static int diva_bri_cleanup_adapter(diva_os_xdi_adapter_t * a)
 	 */
 	if (a->xdi_adapter.e_tbl) {
 		diva_os_free(0, a->xdi_adapter.e_tbl);
-		a->xdi_adapter.e_tbl = 0;
+		a->xdi_adapter.e_tbl = NULL;
 	}
 
 	return (0);
@@ -367,7 +367,7 @@ static int diva_bri_reregister_io(diva_os_xdi_adapter_t * a)
 		diva_os_register_io_port(a, 0, a->resources.pci.bar[i],
 					 a->resources.pci.length[i],
 					 &a->port_name[0], i);
-		a->resources.pci.addr[i] = 0;
+		a->resources.pci.addr[i] = NULL;
 	}
 
 	sprintf(a->port_name, "DIVA BRI %ld",
@@ -797,7 +797,7 @@ static int diva_bri_stop_adapter(diva_os_xdi_adapter_t * a)
 	} while (i-- && a->clear_interrupts_proc);
 	if (a->clear_interrupts_proc) {
 		diva_bri_clear_interrupts(a);
-		a->clear_interrupts_proc = 0;
+		a->clear_interrupts_proc = NULL;
 		DBG_ERR(("A: A(%d) no final interrupt from BRI adapter",
 			 IoAdapter->ANum))
 	}
diff --git a/drivers/isdn/hardware/eicon/os_pri.c b/drivers/isdn/hardware/eicon/os_pri.c
index 0fafdc154..28e9df236 100644
--- a/drivers/isdn/hardware/eicon/os_pri.c
+++ b/drivers/isdn/hardware/eicon/os_pri.c
@@ -283,7 +283,7 @@ static int diva_pri_cleanup_adapter(diva_os_xdi_adapter_t * a)
 		    && a->resources.pci.addr[bar]) {
 			divasa_unmap_pci_bar(a->resources.pci.addr[bar]);
 			a->resources.pci.bar[bar] = 0;
-			a->resources.pci.addr[bar] = 0;
+			a->resources.pci.addr[bar] = NULL;
 		}
 	}
 
@@ -294,7 +294,7 @@ static int diva_pri_cleanup_adapter(diva_os_xdi_adapter_t * a)
 	diva_os_cancel_soft_isr(&a->xdi_adapter.req_soft_isr);
 
 	diva_os_remove_soft_isr(&a->xdi_adapter.req_soft_isr);
-	a->xdi_adapter.isr_soft_isr.object = 0;
+	a->xdi_adapter.isr_soft_isr.object = NULL;
 
 	diva_os_destroy_spin_lock(&a->xdi_adapter.isr_spin_lock, "rm");
 	diva_os_destroy_spin_lock(&a->xdi_adapter.data_spin_lock, "rm");
@@ -304,7 +304,7 @@ static int diva_pri_cleanup_adapter(diva_os_xdi_adapter_t * a)
 	 */
 	if (a->xdi_adapter.e_tbl) {
 		diva_os_free(0, a->xdi_adapter.e_tbl);
-		a->xdi_adapter.e_tbl = 0;
+		a->xdi_adapter.e_tbl = NULL;
 	}
 	a->xdi_adapter.Channels = 0;
 	a->xdi_adapter.e_max = 0;
@@ -316,7 +316,7 @@ static int diva_pri_cleanup_adapter(diva_os_xdi_adapter_t * a)
 	diva_free_dma_map(a->resources.pci.hdev,
 			  (struct _diva_dma_map_entry *) a->xdi_adapter.
 			  dma_map);
-	a->xdi_adapter.dma_map = 0;
+	a->xdi_adapter.dma_map = NULL;
 
 
 	/*
@@ -576,7 +576,7 @@ static int diva_pri_stop_adapter(diva_os_xdi_adapter_t * a)
 
 	if (a->clear_interrupts_proc) {
 		diva_pri_clear_interrupts(a);
-		a->clear_interrupts_proc = 0;
+		a->clear_interrupts_proc = NULL;
 		DBG_ERR(("A: A(%d) no final interrupt from PRI adapter",
 			 IoAdapter->ANum))
 	}
diff --git a/drivers/isdn/hardware/eicon/platform.h b/drivers/isdn/hardware/eicon/platform.h
index c38f8718d..31299feb7 100644
--- a/drivers/isdn/hardware/eicon/platform.h
+++ b/drivers/isdn/hardware/eicon/platform.h
@@ -1,4 +1,4 @@
-/* $Id: platform.h,v 1.37 2004/03/20 17:44:29 armin Exp $
+/* $Id: platform.h,v 1.37.4.1 2004/07/28 14:47:21 armin Exp $
  *
  * platform.h
  * 
@@ -214,10 +214,7 @@ void diva_os_free_message_buffer(diva_os_message_buffer_s *dmb);
 */
 static __inline__ void diva_os_sleep(dword mSec)
 {
-	unsigned long timeout = HZ * mSec / 1000 + 1;
-
-	set_current_state(TASK_UNINTERRUPTIBLE);
-	schedule_timeout(timeout);
+	msleep(mSec);
 }
 static __inline__ void diva_os_wait(dword mSec)
 {
diff --git a/drivers/isdn/hardware/eicon/um_idi.c b/drivers/isdn/hardware/eicon/um_idi.c
index decb8989c..6563db998 100644
--- a/drivers/isdn/hardware/eicon/um_idi.c
+++ b/drivers/isdn/hardware/eicon/um_idi.c
@@ -188,9 +188,9 @@ static void cleanup_adapter(diva_um_idi_adapter_t * a)
    ------------------------------------------------------------------------ */
 static void cleanup_entity(divas_um_idi_entity_t * e)
 {
-	e->os_ref = 0;
+	e->os_ref = NULL;
 	e->status = 0;
-	e->adapter = 0;
+	e->adapter = NULL;
 	e->e.Id = 0;
 	e->rc_count = 0;
 
@@ -218,20 +218,20 @@ void *divas_um_idi_create_entity(dword adapter_nr, void *file)
 		     diva_os_malloc(0, diva_os_get_context_size()))) {
 			DBG_LOG(("E(%08x) no memory for os context", e));
 			diva_os_free(0, e);
-			return (0);
+			return NULL;
 		}
 		memset(e->os_context, 0x00, diva_os_get_context_size());
 
 		if ((diva_data_q_init(&e->data, 2048 + 512, 16))) {
 			diva_os_free(0, e->os_context);
 			diva_os_free(0, e);
-			return (0);
+			return NULL;
 		}
 		if ((diva_data_q_init(&e->rc, sizeof(diva_um_idi_ind_hdr_t), 2))) {
 			diva_data_q_finit(&e->data);
 			diva_os_free(0, e->os_context);
 			diva_os_free(0, e);
-			return (0);
+			return NULL;
 		}
 
 		diva_os_enter_spin_lock(&adapter_lock, &old_irql, "create_entity");
@@ -250,7 +250,7 @@ void *divas_um_idi_create_entity(dword adapter_nr, void *file)
 			diva_os_free(0, e->os_context);
 			diva_os_free(0, e);
 
-			return (0);
+			return NULL;
 		}
 
 		e->os_ref = file;	/* link to os handle */
@@ -608,9 +608,9 @@ static int process_idi_request(divas_um_idi_entity_t * e,
 			e->e.IndCh = 0;
 			e->e.XNum = 0;
 			e->e.RNum = 0;
-			e->e.callback = 0;
-			e->e.X = 0;
-			e->e.R = 0;
+			e->e.callback = NULL;
+			e->e.X = NULL;
+			e->e.R = NULL;
 			write_return_code(e, ASSIGN_RC | OUT_OF_RESOURCES);
 			return (-2);
 		} else {
@@ -631,7 +631,7 @@ static int process_idi_rc(divas_um_idi_entity_t * e, byte rc)
 		if (rc != ASSIGN_OK) {
 			DBG_ERR(("A: A(%d) E(%08x) ASSIGN failed",
 				 e->adapter->adapter_nr, e));
-			e->e.callback = 0;
+			e->e.callback = NULL;
 			e->e.Id = 0;
 			e->e.Req = 0;
 			e->e.ReqCh = 0;
@@ -639,8 +639,8 @@ static int process_idi_rc(divas_um_idi_entity_t * e, byte rc)
 			e->e.RcCh = 0;
 			e->e.Ind = 0;
 			e->e.IndCh = 0;
-			e->e.X = 0;
-			e->e.R = 0;
+			e->e.X = NULL;
+			e->e.R = NULL;
 			e->e.XNum = 0;
 			e->e.RNum = 0;
 		}
@@ -651,7 +651,7 @@ static int process_idi_rc(divas_um_idi_entity_t * e, byte rc)
 		return (0);	/* let us do it in the driver */
 	}
 	if ((e->e.Req == REMOVE) && (!e->e.Id)) {	/* REMOVE COMPLETE */
-		e->e.callback = 0;
+		e->e.callback = NULL;
 		e->e.Id = 0;
 		e->e.Req = 0;
 		e->e.ReqCh = 0;
@@ -659,8 +659,8 @@ static int process_idi_rc(divas_um_idi_entity_t * e, byte rc)
 		e->e.RcCh = 0;
 		e->e.Ind = 0;
 		e->e.IndCh = 0;
-		e->e.X = 0;
-		e->e.R = 0;
+		e->e.X = NULL;
+		e->e.R = NULL;
 		e->e.XNum = 0;
 		e->e.RNum = 0;
 		e->rc_count = 0;
diff --git a/drivers/isdn/hisax/Kconfig b/drivers/isdn/hisax/Kconfig
index d08d9b7f7..c7709db82 100644
--- a/drivers/isdn/hisax/Kconfig
+++ b/drivers/isdn/hisax/Kconfig
@@ -4,6 +4,7 @@ menu "Passive cards"
 
 config ISDN_DRV_HISAX
 	tristate "HiSax SiemensChipSet driver support"
+	select CRC_CCITT
 	---help---
 	  This is a driver supporting the Siemens chipset on various
 	  ISDN-cards (like AVM A1, Elsa ISDN cards, Teles S0-16.0, Teles
@@ -109,7 +110,7 @@ config HISAX_16_3
 
 config HISAX_TELESPCI
 	bool "Teles PCI"
-	depends on PCI
+	depends on PCI && (BROKEN || !(SPARC64 || PPC))
 	help
 	  This enables HiSax support for the Teles PCI.
 	  See <file:Documentation/isdn/README.HiSax> on how to configure it.
@@ -236,7 +237,7 @@ config HISAX_MIC
 
 config HISAX_NETJET
 	bool "NETjet card"
-	depends on PCI
+	depends on PCI && (BROKEN || !(SPARC64 || PPC))
 	help
 	  This enables HiSax support for the NetJet from Traverse
 	  Technologies.
@@ -247,7 +248,7 @@ config HISAX_NETJET
 
 config HISAX_NETJET_U
 	bool "NETspider U card"
-	depends on PCI
+	depends on PCI && (BROKEN || !(SPARC64 || PPC))
 	help
 	  This enables HiSax support for the Netspider U interface ISDN card
 	  from Traverse Technologies.
@@ -315,7 +316,7 @@ config HISAX_GAZEL
 
 config HISAX_HFC_PCI
 	bool "HFC PCI-Bus cards"
-	depends on PCI
+	depends on PCI && (BROKEN || !(SPARC64 || PPC))
 	help
 	  This enables HiSax support for the HFC-S PCI 2BDS0 based cards.
 
@@ -342,7 +343,7 @@ config HISAX_HFC_SX
 
 config HISAX_ENTERNOW_PCI
 	bool "Formula-n enter:now PCI card"
-	depends on PCI
+	depends on PCI && (BROKEN || !(SPARC64 || PPC))
 	help
 	  This enables HiSax support for the Formula-n enter:now PCI
 	  ISDN card.
@@ -399,6 +400,7 @@ comment "HiSax sub driver modules"
 config HISAX_ST5481
 	tristate "ST5481 USB ISDN modem (EXPERIMENTAL)"
 	depends on USB && EXPERIMENTAL
+	select CRC_CCITT
 	help
 	  This enables the driver for ST5481 based USB ISDN adapters,
 	  e.g. the BeWan Gazel 128 USB
@@ -411,7 +413,7 @@ config HISAX_HFCUSB
 
 config HISAX_FRITZ_PCIPNP
 	tristate "AVM Fritz!Card PCI/PCIv2/PnP support (EXPERIMENTAL)"
-	depends on EXPERIMENTAL
+	depends on PCI && EXPERIMENTAL
 	help
 	  This enables the driver for the AVM Fritz!Card PCI,
 	  Fritz!Card PCI v2 and Fritz!Card PnP.
diff --git a/drivers/isdn/hisax/avm_pci.c b/drivers/isdn/hisax/avm_pci.c
index d7ba32f3d..235f28a46 100644
--- a/drivers/isdn/hisax/avm_pci.c
+++ b/drivers/isdn/hisax/avm_pci.c
@@ -729,7 +729,9 @@ AVM_card_msg(struct IsdnCardState *cs, int mt, void *arg)
 	return(0);
 }
 
+#ifdef CONFIG_PCI
 static struct pci_dev *dev_avm __initdata = NULL;
+#endif
 #ifdef __ISAPNP__
 static struct pnp_card *pnp_avm_c __initdata = NULL;
 #endif
@@ -788,7 +790,7 @@ setup_avm_pcipnp(struct IsdnCard *card)
 			printk(KERN_INFO "FritzPnP: no ISA PnP present\n");
 		}
 #endif
-#if CONFIG_PCI
+#ifdef CONFIG_PCI
 		if ((dev_avm = pci_find_device(PCI_VENDOR_ID_AVM,
 			PCI_DEVICE_ID_AVM_A1,  dev_avm))) {
 			cs->irq = dev_avm->irq;
diff --git a/drivers/isdn/hisax/callc.c b/drivers/isdn/hisax/callc.c
index 6b2623af1..04065ab26 100644
--- a/drivers/isdn/hisax/callc.c
+++ b/drivers/isdn/hisax/callc.c
@@ -7,7 +7,7 @@
  * of the GNU General Public License, incorporated herein by reference.
  *
  * For changes and modifications please read
- * ../../../Documentation/isdn/HiSax.cert
+ * Documentation/isdn/HiSax.cert
  *
  * based on the teles driver from Jan den Ouden
  *
diff --git a/drivers/isdn/hisax/config.c b/drivers/isdn/hisax/config.c
index b3a26ffd5..26bb71d96 100644
--- a/drivers/isdn/hisax/config.c
+++ b/drivers/isdn/hisax/config.c
@@ -8,7 +8,7 @@
  * of the GNU General Public License, incorporated herein by reference.
  *
  * For changes and modifications please read
- * ../../../Documentation/isdn/HiSax.cert
+ * Documentation/isdn/HiSax.cert
  *
  * based on the teles driver from Jan den Ouden
  *
@@ -618,10 +618,10 @@ struct IsdnCardState *hisax_get_card(int cardnr)
 	return NULL;
 }
 
-int HiSax_readstatus(u_char * buf, int len, int user, int id, int channel)
+int HiSax_readstatus(u_char __user *buf, int len, int id, int channel)
 {
 	int count, cnt;
-	u_char *p = buf;
+	u_char __user *p = buf;
 	struct IsdnCardState *cs = hisax_findcard(id);
 
 	if (cs) {
@@ -633,10 +633,7 @@ int HiSax_readstatus(u_char * buf, int len, int user, int id, int channel)
 		count = cs->status_end - cs->status_read + 1;
 		if (count >= len)
 			count = len;
-		if (user)
-			copy_to_user(p, cs->status_read, count);
-		else
-			memcpy(p, cs->status_read, count);
+		copy_to_user(p, cs->status_read, count);
 		cs->status_read += count;
 		if (cs->status_read > cs->status_end)
 			cs->status_read = cs->status_buf;
@@ -647,10 +644,7 @@ int HiSax_readstatus(u_char * buf, int len, int user, int id, int channel)
 				cnt = HISAX_STATUS_BUFSIZE;
 			else
 				cnt = count;
-			if (user)
-				copy_to_user(p, cs->status_read, cnt);
-			else
-				memcpy(p, cs->status_read, cnt);
+			copy_to_user(p, cs->status_read, cnt);
 			p += cnt;
 			cs->status_read += cnt % HISAX_STATUS_BUFSIZE;
 			count -= cnt;
@@ -1586,7 +1580,7 @@ int hisax_register(struct hisax_d_if *hisax_d_if, struct hisax_b_if *b_if[],
 	cards[i].protocol = protocol;
 	sprintf(id, "%s%d", name, i);
 	nrcards++;
-	retval = checkcard(i, id, 0, hisax_d_if->owner);
+	retval = checkcard(i, id, NULL, hisax_d_if->owner);
 	if (retval == 0) { // yuck
 		cards[i].typ = 0;
 		nrcards--;
@@ -1884,6 +1878,7 @@ static void EChannel_proc_rcv(struct hisax_d_if *d_if)
 	}
 }
 
+#ifdef CONFIG_PCI
 #include <linux/pci.h>
 
 static struct pci_device_id hisax_pci_tbl[] __initdata = {
@@ -1952,6 +1947,7 @@ static struct pci_device_id hisax_pci_tbl[] __initdata = {
 };
 
 MODULE_DEVICE_TABLE(pci, hisax_pci_tbl);
+#endif /* CONFIG_PCI */
 
 module_init(HiSax_init);
 module_exit(HiSax_exit);
diff --git a/drivers/isdn/hisax/diva.c b/drivers/isdn/hisax/diva.c
index 7471d4b87..2b54e7d6f 100644
--- a/drivers/isdn/hisax/diva.c
+++ b/drivers/isdn/hisax/diva.c
@@ -9,7 +9,7 @@
  * of the GNU General Public License, incorporated herein by reference.
  *
  * For changes and modifications please read
- * ../../../Documentation/isdn/HiSax.cert
+ * Documentation/isdn/HiSax.cert
  *
  * Thanks to Eicon Technology for documents and information
  *
@@ -1158,7 +1158,7 @@ ready:
 		cs->writeisacfifo = &MemWriteISACfifo_IPACX;
 		cs->BC_Read_Reg  = &MemReadHSCX_IPACX;
 		cs->BC_Write_Reg = &MemWriteHSCX_IPACX;
-		cs->BC_Send_Data = 0; // function located in ipacx module
+		cs->BC_Send_Data = NULL; // function located in ipacx module
 		cs->irq_func = &diva_irq_ipacx_pci;
 		printk(KERN_INFO "Diva: IPACX Design Id: %x\n", 
 			MemReadISAC_IPACX(cs, IPACX_ID) &0x3F);
diff --git a/drivers/isdn/hisax/elsa.c b/drivers/isdn/hisax/elsa.c
index 8b6da9ea4..b33678129 100644
--- a/drivers/isdn/hisax/elsa.c
+++ b/drivers/isdn/hisax/elsa.c
@@ -9,7 +9,7 @@
  * of the GNU General Public License, incorporated herein by reference.
  *
  * For changes and modifications please read
- * ../../../Documentation/isdn/HiSax.cert
+ * Documentation/isdn/HiSax.cert
  *
  * Thanks to    Elsa GmbH for documents and information
  *
diff --git a/drivers/isdn/hisax/elsa_cs.c b/drivers/isdn/hisax/elsa_cs.c
index f957e5731..0c198804e 100644
--- a/drivers/isdn/hisax/elsa_cs.c
+++ b/drivers/isdn/hisax/elsa_cs.c
@@ -271,19 +271,6 @@ static void elsa_cs_detach(dev_link_t *link)
     if (link->state & DEV_CONFIG)
         elsa_cs_release(link);
 
-    /*
-       If the device is currently configured and active, we won't
-       actually delete it yet.  Instead, it is marked so that when
-       the release() function is called, that will trigger a proper
-       detach().
-    */
-    if (link->state & DEV_CONFIG) {
-      DEBUG(0, "elsa_cs: detach postponed, '%s' "
-               "still locked\n", link->dev->dev_name);
-        link->state |= DEV_STALE_LINK;
-        return;
-    }
-
     /* Break the link with Card Services */
     if (link->handle) {
         ret = pcmcia_deregister_client(link->handle);
@@ -480,10 +467,6 @@ static void elsa_cs_release(dev_link_t *link)
     pcmcia_release_io(link->handle, &link->io);
     pcmcia_release_irq(link->handle, &link->irq);
     link->state &= ~DEV_CONFIG;
-
-    if (link->state & DEV_STALE_LINK)
-        elsa_cs_detach(link);
-
 } /* elsa_cs_release */
 
 /*======================================================================
diff --git a/drivers/isdn/hisax/elsa_ser.c b/drivers/isdn/hisax/elsa_ser.c
index 479164b3a..689c83395 100644
--- a/drivers/isdn/hisax/elsa_ser.c
+++ b/drivers/isdn/hisax/elsa_ser.c
@@ -401,7 +401,7 @@ static void rs_interrupt_elsa(int irq, struct IsdnCardState *cs)
 		if (status & UART_LSR_DR)
 			receive_chars(cs, &status);
 		if (status & UART_LSR_THRE)
-			transmit_chars(cs, 0);
+			transmit_chars(cs, NULL);
 		if (pass_counter++ > RS_ISR_PASS_LIMIT) {
 			printk("rs_single loop break.\n");
 			break;
diff --git a/drivers/isdn/hisax/hfc_2bds0.c b/drivers/isdn/hisax/hfc_2bds0.c
index e84700c6a..ebea3feef 100644
--- a/drivers/isdn/hisax/hfc_2bds0.c
+++ b/drivers/isdn/hisax/hfc_2bds0.c
@@ -40,7 +40,7 @@ ReadReg(struct IsdnCardState *cs, int data, u_char reg)
 			byteout(cs->hw.hfcD.addr | 1, reg);
 		}
 		ret = bytein(cs->hw.hfcD.addr);
-#if HFC_REG_DEBUG
+#ifdef HFC_REG_DEBUG
 		if (cs->debug & L1_DEB_HSCX_FIFO && (data != 2))
 			debugl1(cs, "t3c RD %02x %02x", reg, ret);
 #endif
@@ -58,7 +58,7 @@ WriteReg(struct IsdnCardState *cs, int data, u_char reg, u_char value)
 	}
 	if (data)
 		byteout(cs->hw.hfcD.addr, value);
-#if HFC_REG_DEBUG
+#ifdef HFC_REG_DEBUG
 	if (cs->debug & L1_DEB_HSCX_FIFO && (data != HFCD_DATA_NODEB))
 		debugl1(cs, "t3c W%c %02x %02x", data ? 'D' : 'C', reg, value);
 #endif
diff --git a/drivers/isdn/hisax/hfc_pci.c b/drivers/isdn/hisax/hfc_pci.c
index c058ccbc5..20042fda8 100644
--- a/drivers/isdn/hisax/hfc_pci.c
+++ b/drivers/isdn/hisax/hfc_pci.c
@@ -11,7 +11,7 @@
  * of the GNU General Public License, incorporated herein by reference.
  *
  * For changes and modifications please read
- * ../../../Documentation/isdn/HiSax.cert
+ * Documentation/isdn/HiSax.cert
  *
  */
 
diff --git a/drivers/isdn/hisax/hfc_usb.c b/drivers/isdn/hisax/hfc_usb.c
index c95d91d58..4490c883f 100644
--- a/drivers/isdn/hisax/hfc_usb.c
+++ b/drivers/isdn/hisax/hfc_usb.c
@@ -133,7 +133,7 @@ static const char *hfcusb_revision = "4.0";
 /**********/
 /* macros */
 /**********/
-#define write_usb(a,b,c) usb_control_msg((a)->dev,(a)->ctrl_out_pipe,0,0x40,(c),(b),0,0,HFC_CTRL_TIMEOUT)
+#define write_usb(a,b,c) usb_control_msg((a)->dev,(a)->ctrl_out_pipe,0,0x40,(c),(b),NULL,0,HFC_CTRL_TIMEOUT)
 #define read_usb(a,b,c) usb_control_msg((a)->dev,(a)->ctrl_in_pipe,1,0xC0,0,(b),(c),1,HFC_CTRL_TIMEOUT)
 
 /*************************************************/
@@ -353,7 +353,7 @@ vendor_data vdata[]=
 	{0x8e3, 0x0301, "Olitec USB RNIS",              LED_SCHEME1,  LED_NORMAL,   {2,0,1,4}},           /* Olitec TA  */
 	{0x675, 0x1688, "DrayTec USB ISDN TA",          LED_SCHEME1,  LED_NORMAL,   {4,0,2,1}},           /* Draytec TA */
 	{0x7fa, 0x0846, "Bewan Modem RNIS USB",         LED_SCHEME1,  LED_INVERTED, {8,0x40,0x20,0x10}},  /* Bewan TA   */
-	{0,0,0}			   // EOL element
+	{0}			   // EOL element
 };
 										
 /***************************************************/
diff --git a/drivers/isdn/hisax/isac.c b/drivers/isdn/hisax/isac.c
index 270df3bd5..20b949952 100644
--- a/drivers/isdn/hisax/isac.c
+++ b/drivers/isdn/hisax/isac.c
@@ -9,7 +9,7 @@
  * of the GNU General Public License, incorporated herein by reference.
  *
  * For changes and modifications please read
- * ../../../Documentation/isdn/HiSax.cert
+ * Documentation/isdn/HiSax.cert
  *
  */
 
diff --git a/drivers/isdn/hisax/isar.c b/drivers/isdn/hisax/isar.c
index 44aecafa6..ee081321e 100644
--- a/drivers/isdn/hisax/isar.c
+++ b/drivers/isdn/hisax/isar.c
@@ -186,12 +186,12 @@ ISARVersion(struct IsdnCardState *cs, char *s)
 }
 
 int
-isar_load_firmware(struct IsdnCardState *cs, u_char *buf)
+isar_load_firmware(struct IsdnCardState *cs, u_char __user *buf)
 {
 	int ret, size, cnt, debug;
 	u_char len, nom, noc;
 	u_short sadr, left, *sp;
-	u_char *p = buf;
+	u_char __user *p = buf;
 	u_char *msg, *tmpmsg, *mp, tmp[64];
 	u_long flags;
 	struct isar_reg *ireg = cs->bcs[0].hw.isar.reg;
@@ -1856,7 +1856,7 @@ isar_auxcmd(struct IsdnCardState *cs, isdn_ctrl *ic) {
 						ISDN_FEATURE_L2_FAX |
 						ISDN_FEATURE_L3_FCLASS1;
 					memcpy(&adr, ic->parm.num, sizeof(ulong));
-					if (isar_load_firmware(cs, (u_char *)adr))
+					if (isar_load_firmware(cs, (u_char __user *)adr))
 						return(1);
 					else 
 						ll_run(cs, features);
diff --git a/drivers/isdn/hisax/isdnhdlc.c b/drivers/isdn/hisax/isdnhdlc.c
index 4204b52b0..c25b3d649 100644
--- a/drivers/isdn/hisax/isdnhdlc.c
+++ b/drivers/isdn/hisax/isdnhdlc.c
@@ -22,6 +22,7 @@
 
 #include <linux/module.h>
 #include <linux/init.h>
+#include <linux/crc-ccitt.h>
 #include "isdnhdlc.h"
 
 /*-------------------------------------------------------------------*/
@@ -58,43 +59,6 @@ const unsigned char isdnhdlc_bit_rev_tab[256] = {
 	0x0F,0x8F,0x4F,0xCF,0x2F,0xAF,0x6F,0xEF,0x1F,0x9F,0x5F,0xDF,0x3F,0xBF,0x7F,0xFF
 };
 
-/* Table for CRC16. Internal used only. */
-static const unsigned short int 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
@@ -339,12 +303,10 @@ int isdnhdlc_decode (struct isdnhdlc_vars *hdlc, const unsigned char *src,
 				return status;
 			}
 			if(hdlc->data_bits==8){
-				unsigned cval;
-
 				hdlc->data_bits = 0;
 				hdlc->data_received = 1;
-				cval = (hdlc->crc^hdlc->shift_reg) & 0xff;
-				hdlc->crc = (hdlc->crc>>8)^crc16_tab[cval];
+				hdlc->crc = crc_ccitt_byte(hdlc->crc, hdlc->shift_reg);
+
 				// good byte received
 				if (dsize--) {
 					dst[hdlc->dstpos++] = hdlc->shift_reg;
@@ -520,10 +482,7 @@ int isdnhdlc_encode(struct isdnhdlc_vars *hdlc, const unsigned char *src,
 				break;
 			}
 			if(hdlc->bit_shift==8){
-				unsigned cval;
-
-				cval = (hdlc->crc^hdlc->shift_reg) & 0xff;
-				hdlc->crc = (hdlc->crc>>8)^crc16_tab[cval];
+				hdlc->crc = crc_ccitt_byte(hdlc->crc, hdlc->shift_reg);
 			}
 			if(hdlc->shift_reg & 0x01){
 				hdlc->hdlc_bits1++;
diff --git a/drivers/isdn/hisax/isdnl1.c b/drivers/isdn/hisax/isdnl1.c
index 35536661b..4d08d27f1 100644
--- a/drivers/isdn/hisax/isdnl1.c
+++ b/drivers/isdn/hisax/isdnl1.c
@@ -10,7 +10,7 @@
  * of the GNU General Public License, incorporated herein by reference.
  *
  * For changes and modifications please read
- * ../../../Documentation/isdn/HiSax.cert
+ * Documentation/isdn/HiSax.cert
  *
  * Thanks to    Jan den Ouden
  *              Fritz Elfert
diff --git a/drivers/isdn/hisax/isdnl2.c b/drivers/isdn/hisax/isdnl2.c
index da87f1ee6..d311b5fbf 100644
--- a/drivers/isdn/hisax/isdnl2.c
+++ b/drivers/isdn/hisax/isdnl2.c
@@ -8,7 +8,7 @@
  * of the GNU General Public License, incorporated herein by reference.
  *
  * For changes and modifications please read
- * ../../../Documentation/isdn/HiSax.cert
+ * Documentation/isdn/HiSax.cert
  *
  * Thanks to    Jan den Ouden
  *              Fritz Elfert
diff --git a/drivers/isdn/hisax/isdnl3.c b/drivers/isdn/hisax/isdnl3.c
index 5145948dc..f571b5d18 100644
--- a/drivers/isdn/hisax/isdnl3.c
+++ b/drivers/isdn/hisax/isdnl3.c
@@ -8,7 +8,7 @@
  * of the GNU General Public License, incorporated herein by reference.
  *
  * For changes and modifications please read
- * ../../../Documentation/isdn/HiSax.cert
+ * Documentation/isdn/HiSax.cert
  *
  * Thanks to    Jan den Ouden
  *              Fritz Elfert
diff --git a/drivers/isdn/hisax/l3_1tr6.c b/drivers/isdn/hisax/l3_1tr6.c
index 235477494..d6c1c8f83 100644
--- a/drivers/isdn/hisax/l3_1tr6.c
+++ b/drivers/isdn/hisax/l3_1tr6.c
@@ -9,7 +9,7 @@
  * of the GNU General Public License, incorporated herein by reference.
  *
  * For changes and modifications please read
- * ../../../Documentation/isdn/HiSax.cert
+ * Documentation/isdn/HiSax.cert
  *
  */
 
diff --git a/drivers/isdn/hisax/l3dss1.c b/drivers/isdn/hisax/l3dss1.c
index 092634c03..ec92308c1 100644
--- a/drivers/isdn/hisax/l3dss1.c
+++ b/drivers/isdn/hisax/l3dss1.c
@@ -12,7 +12,7 @@
  * of the GNU General Public License, incorporated herein by reference.
  *
  * For changes and modifications please read
- * ../../../Documentation/isdn/HiSax.cert
+ * Documentation/isdn/HiSax.cert
  *
  * Thanks to    Jan den Ouden
  *              Fritz Elfert
diff --git a/drivers/isdn/hisax/netjet.c b/drivers/isdn/hisax/netjet.c
index ef81eb9a7..fe61d2636 100644
--- a/drivers/isdn/hisax/netjet.c
+++ b/drivers/isdn/hisax/netjet.c
@@ -58,42 +58,6 @@ NETjet_ReadICfifo(struct IsdnCardState *cs, u_char *data, int size)
 	insb(cs->hw.njet.isac, data, size);
 }
 
-__u16 fcstab[256] =
-{
-	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
-};
-
 void 
 NETjet_WriteICfifo(struct IsdnCardState *cs, u_char *data, int size)
 {
@@ -737,8 +701,8 @@ static void write_raw(struct BCState *bcs, u_int *buf, int cnt) {
 		}
 		bcs->hw.tiger.s_tot += s_cnt;
 		if (bcs->cs->debug & L1_DEB_HSCX)
-			debugl1(bcs->cs,"tiger write_raw: c%d %x-%x %d/%d %d %x", bcs->channel,
-				(u_int)buf, (u_int)p, s_cnt, cnt,
+			debugl1(bcs->cs,"tiger write_raw: c%d %p-%p %d/%d %d %x", bcs->channel,
+				buf, p, s_cnt, cnt,
 				bcs->hw.tiger.sendcnt, bcs->cs->hw.njet.irqstat0);
 		if (bcs->cs->debug & L1_DEB_HSCX_FIFO)
 			printframe(bcs->cs, bcs->hw.tiger.sp, s_cnt, "snd");
@@ -967,8 +931,8 @@ inittiger(struct IsdnCardState *cs)
 	cs->bcs[1].hw.tiger.s_end = cs->bcs[0].hw.tiger.s_end;
 	
 	memset(cs->bcs[0].hw.tiger.send, 0xff, NETJET_DMA_TXSIZE * sizeof(unsigned int));
-	debugl1(cs, "tiger: send buf %x - %x", (u_int)cs->bcs[0].hw.tiger.send,
-		(u_int)(cs->bcs[0].hw.tiger.send + NETJET_DMA_TXSIZE - 1));
+	debugl1(cs, "tiger: send buf %p - %p", cs->bcs[0].hw.tiger.send,
+		cs->bcs[0].hw.tiger.send + NETJET_DMA_TXSIZE - 1);
 	outl(virt_to_bus(cs->bcs[0].hw.tiger.send),
 		cs->hw.njet.base + NETJET_DMA_READ_START);
 	outl(virt_to_bus(cs->bcs[0].hw.tiger.s_irq),
@@ -981,8 +945,8 @@ inittiger(struct IsdnCardState *cs)
 		       "HiSax: No memory for tiger.rec\n");
 		return;
 	}
-	debugl1(cs, "tiger: rec buf %x - %x", (u_int)cs->bcs[0].hw.tiger.rec,
-		(u_int)(cs->bcs[0].hw.tiger.rec + NETJET_DMA_RXSIZE - 1));
+	debugl1(cs, "tiger: rec buf %p - %p", cs->bcs[0].hw.tiger.rec,
+		cs->bcs[0].hw.tiger.rec + NETJET_DMA_RXSIZE - 1);
 	cs->bcs[1].hw.tiger.rec = cs->bcs[0].hw.tiger.rec;
 	memset(cs->bcs[0].hw.tiger.rec, 0xff, NETJET_DMA_RXSIZE * sizeof(unsigned int));
 	outl(virt_to_bus(cs->bcs[0].hw.tiger.rec),
diff --git a/drivers/isdn/hisax/st5481_d.c b/drivers/isdn/hisax/st5481_d.c
index 5ff7fdf72..51d120237 100644
--- a/drivers/isdn/hisax/st5481_d.c
+++ b/drivers/isdn/hisax/st5481_d.c
@@ -623,7 +623,7 @@ static void ph_connect(struct st5481_adapter *adapter)
 	st5481_usb_device_ctrl_msg(adapter, FFMSK_D, 0xfc, NULL, NULL);
 	st5481_in_mode(d_in, L1_MODE_HDLC);
 
-#if LOOPBACK
+#ifdef LOOPBACK
 	// Turn loopback on (data sent on B and D looped back)
 	st5481_usb_device_ctrl_msg(cs, LBB, 0x04, NULL, NULL);
 #endif
diff --git a/drivers/isdn/hisax/st5481_hdlc.c b/drivers/isdn/hisax/st5481_hdlc.c
index 2ea5136be..680f42e9a 100644
--- a/drivers/isdn/hisax/st5481_hdlc.c
+++ b/drivers/isdn/hisax/st5481_hdlc.c
@@ -10,44 +10,9 @@
  *
  */
 
+#include <linux/crc-ccitt.h>
 #include "st5481_hdlc.h"
 
-static const unsigned short int 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,
@@ -295,12 +260,10 @@ int hdlc_decode(struct hdlc_vars *hdlc, const unsigned char *src,
 				return status;
 			}
 			if(hdlc->data_bits==8){
-				unsigned cval;
-				
 				hdlc->data_bits = 0;
 				hdlc->data_received = 1;
-				cval = (hdlc->crc^hdlc->shift_reg) & 0xff;
-				hdlc->crc = (hdlc->crc>>8)^crc16_tab[cval];
+				hdlc->crc = crc_ccitt_byte(hdlc->crc, hdlc->shift_reg);
+
 				// good byte received
 				if (dsize--) {
 					dst[hdlc->dstpos++] = hdlc->shift_reg;
@@ -476,10 +439,7 @@ int hdlc_encode(struct hdlc_vars *hdlc, const unsigned char *src,
 				break;
 			}
 			if(hdlc->bit_shift==8){
-				unsigned cval;
-
-				cval = (hdlc->crc^hdlc->shift_reg) & 0xff;
-				hdlc->crc = (hdlc->crc>>8)^crc16_tab[cval];
+				hdlc->crc = crc_ccitt_byte(hdlc->crc, hdlc->shift_reg);
 			}
 			if(hdlc->shift_reg & 0x01){
 				hdlc->hdlc_bits1++;
diff --git a/drivers/isdn/hisax/tei.c b/drivers/isdn/hisax/tei.c
index 301436516..082726db3 100644
--- a/drivers/isdn/hisax/tei.c
+++ b/drivers/isdn/hisax/tei.c
@@ -8,7 +8,7 @@
  * of the GNU General Public License, incorporated herein by reference.
  *
  * For changes and modifications please read
- * ../../../Documentation/isdn/HiSax.cert
+ * Documentation/isdn/HiSax.cert
  *
  * Thanks to    Jan den Ouden
  *              Fritz Elfert
@@ -239,7 +239,7 @@ tei_id_remove(struct FsmInst *fi, int event, void *arg)
 	if ((st->l2.tei != -1) && ((tei == GROUP_TEI) || (tei == st->l2.tei))) {
 		FsmDelTimer(&st->ma.t202, 5);
 		FsmChangeState(&st->ma.tei_m, ST_TEI_NOP);
-		st->l3.l3l2(st, MDL_REMOVE | REQUEST, 0);
+		st->l3.l3l2(st, MDL_REMOVE | REQUEST, NULL);
 		cs = (struct IsdnCardState *) st->l1.hardware;
 		cs->cardmsg(cs, MDL_REMOVE | REQUEST, NULL);
 	}
@@ -275,7 +275,7 @@ tei_id_req_tout(struct FsmInst *fi, int event, void *arg)
 		FsmAddTimer(&st->ma.t202, st->ma.T202, EV_T202, NULL, 3);
 	} else {
 		st->ma.tei_m.printdebug(&st->ma.tei_m, "assign req failed");
-		st->l3.l3l2(st, MDL_ERROR | RESPONSE, 0);
+		st->l3.l3l2(st, MDL_ERROR | RESPONSE, NULL);
 		cs = (struct IsdnCardState *) st->l1.hardware;
 		cs->cardmsg(cs, MDL_REMOVE | REQUEST, NULL);
 		FsmChangeState(fi, ST_TEI_NOP);
@@ -298,7 +298,7 @@ tei_id_ver_tout(struct FsmInst *fi, int event, void *arg)
 	} else {
 		st->ma.tei_m.printdebug(&st->ma.tei_m,
 			"verify req for tei %d failed", st->l2.tei);
-		st->l3.l3l2(st, MDL_REMOVE | REQUEST, 0);
+		st->l3.l3l2(st, MDL_REMOVE | REQUEST, NULL);
 		cs = (struct IsdnCardState *) st->l1.hardware;
 		cs->cardmsg(cs, MDL_REMOVE | REQUEST, NULL);
 		FsmChangeState(fi, ST_TEI_NOP);
diff --git a/drivers/isdn/hisax/teles_cs.c b/drivers/isdn/hisax/teles_cs.c
index 98f8e2848..74b89d8a1 100644
--- a/drivers/isdn/hisax/teles_cs.c
+++ b/drivers/isdn/hisax/teles_cs.c
@@ -252,19 +252,6 @@ static void teles_detach(dev_link_t *link)
     if (link->state & DEV_CONFIG)
         teles_cs_release(link);
 
-    /*
-       If the device is currently configured and active, we won't
-       actually delete it yet.  Instead, it is marked so that when
-       the release() function is called, that will trigger a proper
-       detach().
-    */
-    if (link->state & DEV_CONFIG) {
-      DEBUG(0, "teles_cs: detach postponed, '%s' "
-               "still locked\n", link->dev->dev_name);
-        link->state |= DEV_STALE_LINK;
-        return;
-    }
-
     /* Break the link with Card Services */
     if (link->handle) {
         ret = pcmcia_deregister_client(link->handle);
@@ -461,10 +448,6 @@ static void teles_cs_release(dev_link_t *link)
     pcmcia_release_io(link->handle, &link->io);
     pcmcia_release_irq(link->handle, &link->irq);
     link->state &= ~DEV_CONFIG;
-
-    if (link->state & DEV_STALE_LINK)
-        teles_detach(link);
-
 } /* teles_cs_release */
 
 /*======================================================================
diff --git a/drivers/isdn/hysdn/Kconfig b/drivers/isdn/hysdn/Kconfig
index 1d82f3b4e..c6d8a7042 100644
--- a/drivers/isdn/hysdn/Kconfig
+++ b/drivers/isdn/hysdn/Kconfig
@@ -3,7 +3,7 @@
 #
 config HYSDN
 	tristate "Hypercope HYSDN cards (Champ, Ergo, Metro) support (module only)"
-	depends on m && PROC_FS && BROKEN_ON_SMP
+	depends on m && PROC_FS && PCI && BROKEN_ON_SMP
 	help
 	  Say Y here if you have one of Hypercope's active PCI ISDN cards
 	  Champ, Ergo and Metro. You will then get a module called hysdn.
diff --git a/drivers/isdn/hysdn/hycapi.c b/drivers/isdn/hysdn/hycapi.c
index f5fb79565..4f639037f 100644
--- a/drivers/isdn/hysdn/hycapi.c
+++ b/drivers/isdn/hysdn/hycapi.c
@@ -96,7 +96,7 @@ hycapi_remove_ctr(struct capi_ctr *ctrl)
 		}
 	}
 	detach_capi_ctr(ctrl);
-	ctrl->driverdata = 0;
+	ctrl->driverdata = NULL;
 	kfree(card->hyctrlinfo);
 
 		
@@ -678,7 +678,7 @@ attach the capi-driver to the kernel-capi.
 
 ***********************************************************/
 
-int hycapi_init()
+int hycapi_init(void)
 {
 	int i;
 	for(i=0;i<CAPI_MAXAPPL;i++) {
diff --git a/drivers/isdn/hysdn/hysdn_procconf.c b/drivers/isdn/hysdn/hysdn_procconf.c
index 2a312dee7..5da507e53 100644
--- a/drivers/isdn/hysdn/hysdn_procconf.c
+++ b/drivers/isdn/hysdn/hysdn_procconf.c
@@ -89,14 +89,12 @@ process_line(struct conf_writedata *cnf)
 /* write conf file -> boot or send cfg line to card */
 /****************************************************/
 static ssize_t
-hysdn_conf_write(struct file *file, const char *buf, size_t count, loff_t * off)
+hysdn_conf_write(struct file *file, const char __user *buf, size_t count, loff_t * off)
 {
 	struct conf_writedata *cnf;
 	int i;
 	uchar ch, *cp;
 
-	if (&file->f_pos != off)	/* fs error check */
-		return (-ESPIPE);
 	if (!count)
 		return (0);	/* nothing to handle */
 
@@ -209,14 +207,11 @@ hysdn_conf_write(struct file *file, const char *buf, size_t count, loff_t * off)
 /* read conf file -> output card info data */
 /*******************************************/
 static ssize_t
-hysdn_conf_read(struct file *file, char *buf, size_t count, loff_t * off)
+hysdn_conf_read(struct file *file, char __user *buf, size_t count, loff_t * off)
 {
 	char *cp;
 	int i;
 
-	if (off != &file->f_pos)	/* fs error check */
-		return -ESPIPE;
-
 	if (file->f_mode & FMODE_READ) {
 		if (!(cp = file->private_data))
 			return (-EFAULT);	/* should never happen */
@@ -320,7 +315,7 @@ hysdn_conf_open(struct inode *ino, struct file *filep)
 		return (-EPERM);	/* no permission this time */
 	}
 	unlock_kernel();
-	return (0);
+	return nonseekable_open(ino, filep);
 }				/* hysdn_conf_open */
 
 /***************************/
diff --git a/drivers/isdn/hysdn/hysdn_proclog.c b/drivers/isdn/hysdn/hysdn_proclog.c
index 4211cd042..8ef2b7c95 100644
--- a/drivers/isdn/hysdn/hysdn_proclog.c
+++ b/drivers/isdn/hysdn/hysdn_proclog.c
@@ -150,7 +150,7 @@ put_log_buffer(hysdn_card * card, char *cp)
 /* write log file -> set log level bits */
 /****************************************/
 static ssize_t
-hysdn_log_write(struct file *file, const char *buf, size_t count, loff_t * off)
+hysdn_log_write(struct file *file, const char __user *buf, size_t count, loff_t * off)
 {
 	ulong u = 0;
 	int found = 0;
@@ -158,9 +158,6 @@ hysdn_log_write(struct file *file, const char *buf, size_t count, loff_t * off)
 	long base = 10;
 	hysdn_card *card = (hysdn_card *) file->private_data;
 
-	if (&file->f_pos != off)	/* fs error check */
-		return (-ESPIPE);
-
 	if (count > (sizeof(valbuf) - 1))
 		count = sizeof(valbuf) - 1;	/* limit length */
 	if (copy_from_user(valbuf, buf, count))
@@ -203,7 +200,7 @@ hysdn_log_write(struct file *file, const char *buf, size_t count, loff_t * off)
 /* read log file */
 /******************/
 static ssize_t
-hysdn_log_read(struct file *file, char *buf, size_t count, loff_t * off)
+hysdn_log_read(struct file *file, char __user *buf, size_t count, loff_t * off)
 {
 	struct log_data *inf;
 	int len;
@@ -237,7 +234,7 @@ hysdn_log_read(struct file *file, char *buf, size_t count, loff_t * off)
 	if ((len = strlen(inf->log_start)) <= count) {
 		if (copy_to_user(buf, inf->log_start, len))
 			return -EFAULT;
-		file->f_pos += len;
+		*off += len;
 		return (len);
 	}
 	return (0);
@@ -285,7 +282,7 @@ hysdn_log_open(struct inode *ino, struct file *filep)
 		return (-EPERM);	/* no permission this time */
 	}
 	unlock_kernel();
-	return (0);
+	return nonseekable_open(ino, filep);
 }				/* hysdn_log_open */
 
 /*******************************************************************************/
diff --git a/drivers/isdn/i4l/isdn_common.c b/drivers/isdn/i4l/isdn_common.c
index 1b95f6005..4956e2e02 100644
--- a/drivers/isdn/i4l/isdn_common.c
+++ b/drivers/isdn/i4l/isdn_common.c
@@ -64,7 +64,7 @@ static isdn_divert_if *divert_if; /* = NULL */
 #endif /* CONFIG_ISDN_DIVERSION */
 
 
-static int isdn_writebuf_stub(int, int, const u_char *, int, int);
+static int isdn_writebuf_stub(int, int, const u_char __user *, int);
 static void set_global_features(void);
 static int isdn_wildmat(char *s, char *p);
 
@@ -937,7 +937,7 @@ isdn_info_update(void)
 }
 
 static ssize_t
-isdn_read(struct file *file, char *buf, size_t count, loff_t * off)
+isdn_read(struct file *file, char __user *buf, size_t count, loff_t * off)
 {
 	uint minor = MINOR(file->f_dentry->d_inode->i_rdev);
 	int len = 0;
@@ -946,9 +946,6 @@ isdn_read(struct file *file, char *buf, size_t count, loff_t * off)
 	int retval;
 	char *p;
 
-	if (off != &file->f_pos)
-		return -ESPIPE;
-
 	lock_kernel();
 	if (minor == ISDN_MINOR_STATUS) {
 		if (!file->private_data) {
@@ -959,7 +956,7 @@ isdn_read(struct file *file, char *buf, size_t count, loff_t * off)
 			interruptible_sleep_on(&(dev->info_waitq));
 		}
 		p = isdn_statstr();
-		file->private_data = 0;
+		file->private_data = NULL;
 		if ((len = strlen(p)) <= count) {
 			if (copy_to_user(buf, p, len)) {
 				retval = -EFAULT;
@@ -992,7 +989,7 @@ isdn_read(struct file *file, char *buf, size_t count, loff_t * off)
 			retval = -ENOMEM;
 			goto out;
 		}
-		len = isdn_readbchan(drvidx, chidx, p, 0, count,
+		len = isdn_readbchan(drvidx, chidx, p, NULL, count,
 				     &dev->drv[drvidx]->rcv_waitq[chidx]);
 		*off += len;
 		if (copy_to_user(buf,p,len)) 
@@ -1018,7 +1015,7 @@ isdn_read(struct file *file, char *buf, size_t count, loff_t * off)
 			if (count > dev->drv[drvidx]->stavail)
 				count = dev->drv[drvidx]->stavail;
 			len = dev->drv[drvidx]->interface->
-				readstat(buf, count, 1, drvidx,
+				readstat(buf, count, drvidx,
 					 isdn_minor2chan(minor));
 		} else {
 			len = 0;
@@ -1044,16 +1041,13 @@ isdn_read(struct file *file, char *buf, size_t count, loff_t * off)
 }
 
 static ssize_t
-isdn_write(struct file *file, const char *buf, size_t count, loff_t * off)
+isdn_write(struct file *file, const char __user *buf, size_t count, loff_t * off)
 {
 	uint minor = MINOR(file->f_dentry->d_inode->i_rdev);
 	int drvidx;
 	int chidx;
 	int retval;
 
-	if (off != &file->f_pos)
-		return -ESPIPE;
-
 	if (minor == ISDN_MINOR_STATUS)
 		return -EPERM;
 	if (!dev->drivers)
@@ -1072,7 +1066,7 @@ isdn_write(struct file *file, const char *buf, size_t count, loff_t * off)
 			goto out;
 		}
 		chidx = isdn_minor2chan(minor);
-		while (isdn_writebuf_stub(drvidx, chidx, buf, count, 1) != count)
+		while (isdn_writebuf_stub(drvidx, chidx, buf, count) != count)
 			interruptible_sleep_on(&dev->drv[drvidx]->snd_waitq[chidx]);
 		retval = count;
 		goto out;
@@ -1091,7 +1085,7 @@ isdn_write(struct file *file, const char *buf, size_t count, loff_t * off)
 		 */
 		if (dev->drv[drvidx]->interface->writecmd)
 			retval = dev->drv[drvidx]->interface->
-				writecmd(buf, count, 1, drvidx, isdn_minor2chan(minor));
+				writecmd(buf, count, drvidx, isdn_minor2chan(minor));
 		else
 			retval = count;
 		goto out;
@@ -1159,7 +1153,7 @@ isdn_ioctl(struct inode *inode, struct file *file, uint cmd, ulong arg)
 	int chidx;
 	int ret;
 	int i;
-	char *p;
+	char __user *p;
 	char *s;
 	union iocpar {
 		char name[10];
@@ -1168,6 +1162,7 @@ isdn_ioctl(struct inode *inode, struct file *file, uint cmd, ulong arg)
 		isdn_net_ioctl_phone phone;
 		isdn_net_ioctl_cfg cfg;
 	} iocpar;
+	void __user *argp = (void __user *)arg;
 
 #define name  iocpar.name
 #define bname iocpar.bname
@@ -1183,9 +1178,9 @@ isdn_ioctl(struct inode *inode, struct file *file, uint cmd, ulong arg)
 					(INF_DV << 16));
 			case IIOCGETCPS:
 				if (arg) {
-					ulong *p = (ulong *) arg;
+					ulong __user *p = argp;
 					int i;
-					if ((ret = verify_area(VERIFY_WRITE, (void *) arg,
+					if ((ret = verify_area(VERIFY_WRITE, p,
 							       sizeof(ulong) * ISDN_MAX_CHANNELS * 2)))
 						return ret;
 					for (i = 0; i < ISDN_MAX_CHANNELS; i++) {
@@ -1201,9 +1196,9 @@ isdn_ioctl(struct inode *inode, struct file *file, uint cmd, ulong arg)
 				/* Get peer phone number of a connected 
 				 * isdn network interface */
 				if (arg) {
-					if (copy_from_user((char *) &phone, (char *) arg, sizeof(phone)))
+					if (copy_from_user(&phone, argp, sizeof(phone)))
 						return -EFAULT;
-					return isdn_net_getpeer(&phone, (isdn_net_ioctl_phone *) arg);
+					return isdn_net_getpeer(&phone, argp);
 				} else
 					return -EINVAL;
 #endif
@@ -1241,7 +1236,7 @@ isdn_ioctl(struct inode *inode, struct file *file, uint cmd, ulong arg)
 			case IIOCNETAIF:
 				/* Add a network-interface */
 				if (arg) {
-					if (copy_from_user(name, (char *) arg, sizeof(name)))
+					if (copy_from_user(name, argp, sizeof(name)))
 						return -EFAULT;
 					s = name;
 				} else {
@@ -1250,7 +1245,7 @@ isdn_ioctl(struct inode *inode, struct file *file, uint cmd, ulong arg)
 				ret = down_interruptible(&dev->sem);
 				if( ret ) return ret;
 				if ((s = isdn_net_new(s, NULL))) {
-					if (copy_to_user((char *) arg, s, strlen(s) + 1)){
+					if (copy_to_user(argp, s, strlen(s) + 1)){
 						ret = -EFAULT;
 					} else {
 						ret = 0;
@@ -1262,14 +1257,14 @@ isdn_ioctl(struct inode *inode, struct file *file, uint cmd, ulong arg)
 			case IIOCNETASL:
 				/* Add a slave to a network-interface */
 				if (arg) {
-					if (copy_from_user(bname, (char *) arg, sizeof(bname) - 1))
+					if (copy_from_user(bname, argp, sizeof(bname) - 1))
 						return -EFAULT;
 				} else
 					return -EINVAL;
 				ret = down_interruptible(&dev->sem);
 				if( ret ) return ret;
 				if ((s = isdn_net_newslave(bname))) {
-					if (copy_to_user((char *) arg, s, strlen(s) + 1)){
+					if (copy_to_user(argp, s, strlen(s) + 1)){
 						ret = -EFAULT;
 					} else {
 						ret = 0;
@@ -1281,7 +1276,7 @@ isdn_ioctl(struct inode *inode, struct file *file, uint cmd, ulong arg)
 			case IIOCNETDIF:
 				/* Delete a network-interface */
 				if (arg) {
-					if (copy_from_user(name, (char *) arg, sizeof(name)))
+					if (copy_from_user(name, argp, sizeof(name)))
 						return -EFAULT;
 					ret = down_interruptible(&dev->sem);
 					if( ret ) return ret;
@@ -1293,7 +1288,7 @@ isdn_ioctl(struct inode *inode, struct file *file, uint cmd, ulong arg)
 			case IIOCNETSCF:
 				/* Set configurable parameters of a network-interface */
 				if (arg) {
-					if (copy_from_user((char *) &cfg, (char *) arg, sizeof(cfg)))
+					if (copy_from_user(&cfg, argp, sizeof(cfg)))
 						return -EFAULT;
 					return isdn_net_setcfg(&cfg);
 				} else
@@ -1301,10 +1296,10 @@ isdn_ioctl(struct inode *inode, struct file *file, uint cmd, ulong arg)
 			case IIOCNETGCF:
 				/* Get configurable parameters of a network-interface */
 				if (arg) {
-					if (copy_from_user((char *) &cfg, (char *) arg, sizeof(cfg)))
+					if (copy_from_user(&cfg, argp, sizeof(cfg)))
 						return -EFAULT;
 					if (!(ret = isdn_net_getcfg(&cfg))) {
-						if (copy_to_user((char *) arg, (char *) &cfg, sizeof(cfg)))
+						if (copy_to_user(argp, &cfg, sizeof(cfg)))
 							return -EFAULT;
 					}
 					return ret;
@@ -1313,7 +1308,7 @@ isdn_ioctl(struct inode *inode, struct file *file, uint cmd, ulong arg)
 			case IIOCNETANM:
 				/* Add a phone-number to a network-interface */
 				if (arg) {
-					if (copy_from_user((char *) &phone, (char *) arg, sizeof(phone)))
+					if (copy_from_user(&phone, argp, sizeof(phone)))
 						return -EFAULT;
 					ret = down_interruptible(&dev->sem);
 					if( ret ) return ret;
@@ -1325,11 +1320,11 @@ isdn_ioctl(struct inode *inode, struct file *file, uint cmd, ulong arg)
 			case IIOCNETGNM:
 				/* Get list of phone-numbers of a network-interface */
 				if (arg) {
-					if (copy_from_user((char *) &phone, (char *) arg, sizeof(phone)))
+					if (copy_from_user(&phone, argp, sizeof(phone)))
 						return -EFAULT;
 					ret = down_interruptible(&dev->sem);
 					if( ret ) return ret;
-					ret = isdn_net_getphones(&phone, (char *) arg);
+					ret = isdn_net_getphones(&phone, argp);
 					up(&dev->sem);
 					return ret;
 				} else
@@ -1337,7 +1332,7 @@ isdn_ioctl(struct inode *inode, struct file *file, uint cmd, ulong arg)
 			case IIOCNETDNM:
 				/* Delete a phone-number of a network-interface */
 				if (arg) {
-					if (copy_from_user((char *) &phone, (char *) arg, sizeof(phone)))
+					if (copy_from_user(&phone, argp, sizeof(phone)))
 						return -EFAULT;
 					ret = down_interruptible(&dev->sem);
 					if( ret ) return ret;
@@ -1349,7 +1344,7 @@ isdn_ioctl(struct inode *inode, struct file *file, uint cmd, ulong arg)
 			case IIOCNETDIL:
 				/* Force dialing of a network-interface */
 				if (arg) {
-					if (copy_from_user(name, (char *) arg, sizeof(name)))
+					if (copy_from_user(name, argp, sizeof(name)))
 						return -EFAULT;
 					return isdn_net_force_dial(name);
 				} else
@@ -1358,13 +1353,13 @@ isdn_ioctl(struct inode *inode, struct file *file, uint cmd, ulong arg)
 			case IIOCNETALN:
 				if (!arg)
 					return -EINVAL;
-				if (copy_from_user(name, (char *) arg, sizeof(name)))
+				if (copy_from_user(name, argp, sizeof(name)))
 					return -EFAULT;
 				return isdn_ppp_dial_slave(name);
 			case IIOCNETDLN:
 				if (!arg)
 					return -EINVAL;
-				if (copy_from_user(name, (char *) arg, sizeof(name)))
+				if (copy_from_user(name, argp, sizeof(name)))
 					return -EFAULT;
 				return isdn_ppp_hangup_slave(name);
 #endif
@@ -1372,7 +1367,7 @@ isdn_ioctl(struct inode *inode, struct file *file, uint cmd, ulong arg)
 				/* Force hangup of a network-interface */
 				if (!arg)
 					return -EINVAL;
-				if (copy_from_user(name, (char *) arg, sizeof(name)))
+				if (copy_from_user(name, argp, sizeof(name)))
 					return -EFAULT;
 				return isdn_net_force_hangup(name);
 				break;
@@ -1394,7 +1389,7 @@ isdn_ioctl(struct inode *inode, struct file *file, uint cmd, ulong arg)
 				if (arg) {
 					int i;
 					char *p;
-					if (copy_from_user((char *) &iocts, (char *) arg,
+					if (copy_from_user(&iocts, argp,
 					     sizeof(isdn_ioctl_struct)))
 						return -EFAULT;
 					if (strlen(iocts.drvid)) {
@@ -1422,10 +1417,10 @@ isdn_ioctl(struct inode *inode, struct file *file, uint cmd, ulong arg)
 			case IIOCGETPRF:
 				/* Get all Modem-Profiles */
 				if (arg) {
-					char *p = (char *) arg;
+					char __user *p = argp;
 					int i;
 
-					if ((ret = verify_area(VERIFY_WRITE, (void *) arg,
+					if ((ret = verify_area(VERIFY_WRITE, argp,
 					(ISDN_MODEM_NUMREG + ISDN_MSNLEN + ISDN_LMSNLEN)
 						   * ISDN_MAX_CHANNELS)))
 						return ret;
@@ -1449,10 +1444,10 @@ isdn_ioctl(struct inode *inode, struct file *file, uint cmd, ulong arg)
 			case IIOCSETPRF:
 				/* Set all Modem-Profiles */
 				if (arg) {
-					char *p = (char *) arg;
+					char __user *p = argp;
 					int i;
 
-					if ((ret = verify_area(VERIFY_READ, (void *) arg,
+					if ((ret = verify_area(VERIFY_READ, argp,
 					(ISDN_MODEM_NUMREG + ISDN_MSNLEN + ISDN_LMSNLEN)
 						   * ISDN_MAX_CHANNELS)))
 						return ret;
@@ -1478,8 +1473,7 @@ isdn_ioctl(struct inode *inode, struct file *file, uint cmd, ulong arg)
 				/* Set/Get MSN->EAZ-Mapping for a driver */
 				if (arg) {
 
-					if (copy_from_user((char *) &iocts,
-							    (char *) arg,
+					if (copy_from_user(&iocts, argp,
 					     sizeof(isdn_ioctl_struct)))
 						return -EFAULT;
 					if (strlen(iocts.drvid)) {
@@ -1496,7 +1490,7 @@ isdn_ioctl(struct inode *inode, struct file *file, uint cmd, ulong arg)
 					if (cmd == IIOCSETMAP) {
 						int loop = 1;
 
-						p = (char *) iocts.arg;
+						p = (char __user *) iocts.arg;
 						i = 0;
 						while (loop) {
 							int j = 0;
@@ -1524,7 +1518,7 @@ isdn_ioctl(struct inode *inode, struct file *file, uint cmd, ulong arg)
 								break;
 						}
 					} else {
-						p = (char *) iocts.arg;
+						p = (char __user *) iocts.arg;
 						for (i = 0; i < 10; i++) {
 							sprintf(bname, "%s%s",
 								strlen(dev->drv[drvidx]->msn2eaz[i]) ?
@@ -1540,7 +1534,7 @@ isdn_ioctl(struct inode *inode, struct file *file, uint cmd, ulong arg)
 					return -EINVAL;
 			case IIOCDBGVAR:
 				if (arg) {
-					if (copy_to_user((char *) arg, (char *) &dev, sizeof(ulong)))
+					if (copy_to_user(argp, &dev, sizeof(ulong)))
 						return -EFAULT;
 					return 0;
 				} else
@@ -1554,7 +1548,7 @@ isdn_ioctl(struct inode *inode, struct file *file, uint cmd, ulong arg)
 				if (arg) {
 					int i;
 					char *p;
-					if (copy_from_user((char *) &iocts, (char *) arg, sizeof(isdn_ioctl_struct)))
+					if (copy_from_user(&iocts, argp, sizeof(isdn_ioctl_struct)))
 						return -EFAULT;
 					if (strlen(iocts.drvid)) {
 						if ((p = strchr(iocts.drvid, ',')))
@@ -1569,16 +1563,16 @@ isdn_ioctl(struct inode *inode, struct file *file, uint cmd, ulong arg)
 						drvidx = 0;
 					if (drvidx == -1)
 						return -ENODEV;
-					if ((ret = verify_area(VERIFY_WRITE, (void *) arg,
+					if ((ret = verify_area(VERIFY_WRITE, argp,
 					     sizeof(isdn_ioctl_struct))))
 						return ret;
 					c.driver = drvidx;
 					c.command = ISDN_CMD_IOCTL;
 					c.arg = cmd;
-					memcpy(c.parm.num, (char *) &iocts.arg, sizeof(ulong));
+					memcpy(c.parm.num, &iocts.arg, sizeof(ulong));
 					ret = isdn_command(&c);
-					memcpy((char *) &iocts.arg, c.parm.num, sizeof(ulong));
-					if (copy_to_user((char *) arg, &iocts, sizeof(isdn_ioctl_struct)))
+					memcpy(&iocts.arg, c.parm.num, sizeof(ulong));
+					if (copy_to_user(argp, &iocts, sizeof(isdn_ioctl_struct)))
 						return -EFAULT;
 					return ret;
 				} else
@@ -1659,6 +1653,7 @@ isdn_open(struct inode *ino, struct file *filep)
 	}
 #endif
  out:
+	nonseekable_open(ino, filep);
 	return retval;
 }
 
@@ -1838,8 +1833,7 @@ isdn_unexclusive_channel(int di, int ch)
  *  writebuf replacement for SKB_ABLE drivers
  */
 static int
-isdn_writebuf_stub(int drvidx, int chan, const u_char * buf, int len,
-		   int user)
+isdn_writebuf_stub(int drvidx, int chan, const u_char __user * buf, int len)
 {
 	int ret;
 	int hl = dev->drv[drvidx]->interface->hl_hdrlen;
@@ -1848,10 +1842,7 @@ isdn_writebuf_stub(int drvidx, int chan, const u_char * buf, int len,
 	if (!skb)
 		return 0;
 	skb_reserve(skb, hl);
-	if (user)
-		copy_from_user(skb_put(skb, len), buf, len);
-	else
-		memcpy(skb_put(skb, len), buf, len);
+	copy_from_user(skb_put(skb, len), buf, len);
 	ret = dev->drv[drvidx]->interface->writebuf_skb(drvidx, chan, 1, skb);
 	if (ret <= 0)
 		dev_kfree_skb(skb);
diff --git a/drivers/isdn/i4l/isdn_net.c b/drivers/isdn/i4l/isdn_net.c
index 03f22b6b7..69c6884e9 100644
--- a/drivers/isdn/i4l/isdn_net.c
+++ b/drivers/isdn/i4l/isdn_net.c
@@ -315,7 +315,7 @@ isdn_net_unbind_channel(isdn_net_local * lp)
 unsigned long last_jiffies = -HZ;
 
 void
-isdn_net_autohup()
+isdn_net_autohup(void)
 {
 	isdn_net_dev *p = dev->netdev;
 	int anymore;
@@ -396,8 +396,8 @@ isdn_net_stat_callback(int idx, isdn_ctrl *c)
 	if (p) {
 		isdn_net_local *lp = p->local;
 #ifdef CONFIG_ISDN_X25
-		struct concap_proto *cprot = lp -> netdev -> cprot;
-		struct concap_proto_ops *pops = cprot ? cprot -> pops : 0;
+		struct concap_proto *cprot = lp->netdev->cprot;
+		struct concap_proto_ops *pops = cprot ? cprot->pops : NULL;
 #endif
 		switch (cmd) {
 			case ISDN_STAT_BSENT:
@@ -617,7 +617,7 @@ isdn_net_dial(void)
 						s = "dial suppressed: isdn system stopped";
 					else
 						s = "dial suppressed: dialmode `off'";
-					isdn_net_unreachable(&p->dev, 0, s);
+					isdn_net_unreachable(&p->dev, NULL, s);
 					isdn_net_hangup(&p->dev);
 					break;
 				}
@@ -645,7 +645,7 @@ isdn_net_dial(void)
 						if (time_after(jiffies, lp->dialstarted + lp->dialtimeout)) {
 							lp->dialwait_timer = jiffies + lp->dialwait;
 							lp->dialstarted = 0;
-							isdn_net_unreachable(&p->dev, 0, "dial: timed out");
+							isdn_net_unreachable(&p->dev, NULL, "dial: timed out");
 							isdn_net_hangup(&p->dev);
 							break;
 						}
@@ -675,7 +675,7 @@ isdn_net_dial(void)
 							if (lp->dialtimeout == 0) {
 								lp->dialwait_timer = jiffies + lp->dialwait;
 								lp->dialstarted = 0;
-								isdn_net_unreachable(&p->dev, 0, "dial: tried all numbers dialmax times");
+								isdn_net_unreachable(&p->dev, NULL, "dial: tried all numbers dialmax times");
 							}
 							isdn_net_hangup(&p->dev);
 							break;
@@ -827,8 +827,8 @@ isdn_net_hangup(struct net_device *d)
 	isdn_net_local *lp = (isdn_net_local *) d->priv;
 	isdn_ctrl cmd;
 #ifdef CONFIG_ISDN_X25
-	struct concap_proto *cprot = lp -> netdev -> cprot;
-	struct concap_proto_ops *pops = cprot ? cprot -> pops : 0;
+	struct concap_proto *cprot = lp->netdev->cprot;
+	struct concap_proto_ops *pops = cprot ? cprot->pops : NULL;
 #endif
 
 	if (lp->flags & ISDN_NET_CONNECTED) {
@@ -1416,11 +1416,10 @@ isdn_net_ciscohdlck_alloc_skb(isdn_net_local *lp, int len)
 	struct sk_buff *skb;
 
 	skb = alloc_skb(hl + len, GFP_ATOMIC);
-	if (!skb) {
+	if (skb)
+		skb_reserve(skb, hl);
+	else 
 		printk("isdn out of mem at %s:%d!\n", __FILE__, __LINE__);
-		return 0;
-	}
-	skb_reserve(skb, hl);
 	return skb;
 }
 
@@ -1433,7 +1432,7 @@ isdn_ciscohdlck_dev_ioctl(struct net_device *dev, struct ifreq *ifr, int cmd)
 	unsigned long expires = 0;
 	int tmp = 0;
 	int period = lp->cisco_keepalive_period;
-	char debserint = lp->cisco_debserint;
+	s8 debserint = lp->cisco_debserint;
 	int rc = 0;
 
 	if (lp->p_encap != ISDN_NET_ENCAP_CISCOHDLCK)
@@ -1443,15 +1442,14 @@ isdn_ciscohdlck_dev_ioctl(struct net_device *dev, struct ifreq *ifr, int cmd)
 		/* get/set keepalive period */
 		case SIOCGKEEPPERIOD:
 			len = (unsigned long)sizeof(lp->cisco_keepalive_period);
-			if (copy_to_user((char *)ifr->ifr_ifru.ifru_data,
-				(int *)&lp->cisco_keepalive_period, len))
+			if (copy_to_user(ifr->ifr_data,
+				&lp->cisco_keepalive_period, len))
 				rc = -EFAULT;
 			break;
 		case SIOCSKEEPPERIOD:
 			tmp = lp->cisco_keepalive_period;
 			len = (unsigned long)sizeof(lp->cisco_keepalive_period);
-			if (copy_from_user((int *)&period,
-				(char *)ifr->ifr_ifru.ifru_data, len))
+			if (copy_from_user(&period, ifr->ifr_data, len))
 				rc = -EFAULT;
 			if ((period > 0) && (period <= 32767))
 				lp->cisco_keepalive_period = period;
@@ -1470,14 +1468,14 @@ isdn_ciscohdlck_dev_ioctl(struct net_device *dev, struct ifreq *ifr, int cmd)
 		/* get/set debugging */
 		case SIOCGDEBSERINT:
 			len = (unsigned long)sizeof(lp->cisco_debserint);
-			if (copy_to_user((char *)ifr->ifr_ifru.ifru_data,
-				(char *)&lp->cisco_debserint, len))
+			if (copy_to_user(ifr->ifr_data,
+				&lp->cisco_debserint, len))
 				rc = -EFAULT;
 			break;
 		case SIOCSDEBSERINT:
 			len = (unsigned long)sizeof(lp->cisco_debserint);
-			if (copy_from_user((char *)&debserint,
-				(char *)ifr->ifr_ifru.ifru_data, len))
+			if (copy_from_user(&debserint,
+				ifr->ifr_data, len))
 				rc = -EFAULT;
 			if ((debserint >= 0) && (debserint <= 64))
 				lp->cisco_debserint = debserint;
@@ -2183,7 +2181,7 @@ isdn_net_find_icall(int di, int ch, int idx, setup_parm *setup)
 			    *my_eaz == 'b' || *my_eaz == 'B')
                                 my_eaz++; /* skip to allow a match */
                         else
-                                my_eaz = 0; /* force non match */
+                                my_eaz = NULL; /* force non match */
                 } else { /* it's a DATA call, check if we allow it */
                         if (*my_eaz == 'b' || *my_eaz == 'B')
                                 my_eaz++; /* skip to allow a match */
@@ -2968,7 +2966,7 @@ isdn_net_addphone(isdn_net_ioctl_phone * phone)
  * This might sleep and must be called with the isdn semaphore down.
  */
 int
-isdn_net_getphones(isdn_net_ioctl_phone * phone, char *phones)
+isdn_net_getphones(isdn_net_ioctl_phone * phone, char __user *phones)
 {
 	isdn_net_dev *p = isdn_net_findif(phone->name);
 	int inout = phone->outgoing & 1;
@@ -3001,7 +2999,7 @@ isdn_net_getphones(isdn_net_ioctl_phone * phone, char *phones)
  * to user space.
  */
 int
-isdn_net_getpeer(isdn_net_ioctl_phone *phone, isdn_net_ioctl_phone *peer)
+isdn_net_getpeer(isdn_net_ioctl_phone *phone, isdn_net_ioctl_phone __user *peer)
 {
 	isdn_net_dev *p = isdn_net_findif(phone->name);
 	int ch, dv, idx;
diff --git a/drivers/isdn/i4l/isdn_net.h b/drivers/isdn/i4l/isdn_net.h
index 839518fe3..ebdcde371 100644
--- a/drivers/isdn/i4l/isdn_net.h
+++ b/drivers/isdn/i4l/isdn_net.h
@@ -39,8 +39,8 @@ extern int isdn_net_stat_callback(int, isdn_ctrl *);
 extern int isdn_net_setcfg(isdn_net_ioctl_cfg *);
 extern int isdn_net_getcfg(isdn_net_ioctl_cfg *);
 extern int isdn_net_addphone(isdn_net_ioctl_phone *);
-extern int isdn_net_getphones(isdn_net_ioctl_phone *, char *);
-extern int isdn_net_getpeer(isdn_net_ioctl_phone *, isdn_net_ioctl_phone *);
+extern int isdn_net_getphones(isdn_net_ioctl_phone *, char __user *);
+extern int isdn_net_getpeer(isdn_net_ioctl_phone *, isdn_net_ioctl_phone __user *);
 extern int isdn_net_delphone(isdn_net_ioctl_phone *);
 extern int isdn_net_find_icall(int, int, int, setup_parm *);
 extern void isdn_net_hangup(struct net_device *);
diff --git a/drivers/isdn/i4l/isdn_ppp.c b/drivers/isdn/i4l/isdn_ppp.c
index 62ffcc67b..a11be5357 100644
--- a/drivers/isdn/i4l/isdn_ppp.c
+++ b/drivers/isdn/i4l/isdn_ppp.c
@@ -320,8 +320,8 @@ isdn_ppp_open(int min, struct file *file)
 	is->slcomp = slhc_init(16, 16);	/* not necessary for 2. link in bundle */
 #endif
 #ifdef CONFIG_IPPP_FILTER
-	is->pass_filter.filter = NULL;
-	is->active_filter.filter = NULL;
+	is->pass_filter = NULL;
+	is->active_filter = NULL;
 #endif
 	is->state = IPPP_OPEN;
 
@@ -378,13 +378,13 @@ isdn_ppp_release(int min, struct file *file)
 	is->slcomp = NULL;
 #endif
 #ifdef CONFIG_IPPP_FILTER
-	if (is->pass_filter.filter) {
-		kfree(is->pass_filter.filter);
-		is->pass_filter.filter = NULL;
+	if (is->pass_filter) {
+		kfree(is->pass_filter);
+		is->pass_filter = NULL;
 	}
-	if (is->active_filter.filter) {
-		kfree(is->active_filter.filter);
-		is->active_filter.filter = NULL;
+	if (is->active_filter) {
+		kfree(is->active_filter);
+		is->active_filter = NULL;
 	}
 #endif
 
@@ -414,11 +414,11 @@ isdn_ppp_release(int min, struct file *file)
  * get_arg .. ioctl helper
  */
 static int
-get_arg(void *b, void *val, int len)
+get_arg(void __user *b, void *val, int len)
 {
 	if (len <= 0)
 		len = sizeof(void *);
-	if (copy_from_user((void *) val, b, len))
+	if (copy_from_user(val, b, len))
 		return -EFAULT;
 	return 0;
 }
@@ -427,15 +427,50 @@ get_arg(void *b, void *val, int len)
  * set arg .. ioctl helper
  */
 static int
-set_arg(void *b, void *val,int len)
+set_arg(void __user *b, void *val,int len)
 {
 	if(len <= 0)
 		len = sizeof(void *);
-	if (copy_to_user(b, (void *) val, len))
+	if (copy_to_user(b, val, len))
 		return -EFAULT;
 	return 0;
 }
 
+static int get_filter(void __user *arg, struct sock_filter **p)
+{
+	struct sock_fprog uprog;
+	struct sock_filter *code = NULL;
+	int len, err;
+
+	if (copy_from_user(&uprog, arg, sizeof(uprog)))
+		return -EFAULT;
+
+	if (!uprog.len) {
+		*p = NULL;
+		return 0;
+	}
+
+	/* uprog.len is unsigned short, so no overflow here */
+	len = uprog.len * sizeof(struct sock_filter);
+	code = kmalloc(len, GFP_KERNEL);
+	if (code == NULL)
+		return -ENOMEM;
+
+	if (copy_from_user(code, uprog.filter, len)) {
+		kfree(code);
+		return -EFAULT;
+	}
+
+	err = sk_chk_filter(code, uprog.len);
+	if (err) {
+		kfree(code);
+		return err;
+	}
+
+	*p = code;
+	return uprog.len;
+}
+
 /*
  * ippp device ioctl
  */
@@ -447,6 +482,7 @@ isdn_ppp_ioctl(int min, struct file *file, unsigned int cmd, unsigned long arg)
 	struct ippp_struct *is;
 	isdn_net_local *lp;
 	struct isdn_ppp_comp_data data;
+	void __user *argp = (void __user *)arg;
 
 	is = (struct ippp_struct *) file->private_data;
 	lp = is->lp;
@@ -462,7 +498,7 @@ isdn_ppp_ioctl(int min, struct file *file, unsigned int cmd, unsigned long arg)
 #ifdef CONFIG_ISDN_MPP
 			if (!(is->state & IPPP_CONNECT))
 				return -EINVAL;
-			if ((r = get_arg((void *) arg, &val, sizeof(val) )))
+			if ((r = get_arg(argp, &val, sizeof(val) )))
 				return r;
 			printk(KERN_DEBUG "iPPP-bundle: minor: %d, slave unit: %d, master unit: %d\n",
 			       (int) min, (int) is->unit, (int) val);
@@ -472,30 +508,30 @@ isdn_ppp_ioctl(int min, struct file *file, unsigned int cmd, unsigned long arg)
 #endif
 			break;
 		case PPPIOCGUNIT:	/* get ppp/isdn unit number */
-			if ((r = set_arg((void *) arg, &is->unit, sizeof(is->unit) )))
+			if ((r = set_arg(argp, &is->unit, sizeof(is->unit) )))
 				return r;
 			break;
 		case PPPIOCGIFNAME:
 			if(!lp)
 				return -EINVAL;
-			if ((r = set_arg((void *) arg, lp->name, strlen(lp->name))))
+			if ((r = set_arg(argp, lp->name, strlen(lp->name))))
 				return r;
 			break;
 		case PPPIOCGMPFLAGS:	/* get configuration flags */
-			if ((r = set_arg((void *) arg, &is->mpppcfg, sizeof(is->mpppcfg) )))
+			if ((r = set_arg(argp, &is->mpppcfg, sizeof(is->mpppcfg) )))
 				return r;
 			break;
 		case PPPIOCSMPFLAGS:	/* set configuration flags */
-			if ((r = get_arg((void *) arg, &val, sizeof(val) )))
+			if ((r = get_arg(argp, &val, sizeof(val) )))
 				return r;
 			is->mpppcfg = val;
 			break;
 		case PPPIOCGFLAGS:	/* get configuration flags */
-			if ((r = set_arg((void *) arg, &is->pppcfg,sizeof(is->pppcfg) )))
+			if ((r = set_arg(argp, &is->pppcfg,sizeof(is->pppcfg) )))
 				return r;
 			break;
 		case PPPIOCSFLAGS:	/* set configuration flags */
-			if ((r = get_arg((void *) arg, &val, sizeof(val) ))) {
+			if ((r = get_arg(argp, &val, sizeof(val) ))) {
 				return r;
 			}
 			if (val & SC_ENABLE_IP && !(is->pppcfg & SC_ENABLE_IP) && (is->state & IPPP_CONNECT)) {
@@ -512,12 +548,12 @@ isdn_ppp_ioctl(int min, struct file *file, unsigned int cmd, unsigned long arg)
 			if (lp) {
 				struct ppp_idle pidle;
 				pidle.xmit_idle = pidle.recv_idle = lp->huptimer;
-				if ((r = set_arg((void *) arg, &pidle,sizeof(struct ppp_idle))))
+				if ((r = set_arg(argp, &pidle,sizeof(struct ppp_idle))))
 					 return r;
 			}
 			break;
 		case PPPIOCSMRU:	/* set receive unit size for PPP */
-			if ((r = get_arg((void *) arg, &val, sizeof(val) )))
+			if ((r = get_arg(argp, &val, sizeof(val) )))
 				return r;
 			is->mru = val;
 			break;
@@ -526,7 +562,7 @@ isdn_ppp_ioctl(int min, struct file *file, unsigned int cmd, unsigned long arg)
 		case PPPIOCSMPMTU:
 			break;
 		case PPPIOCSMAXCID:	/* set the maximum compression slot id */
-			if ((r = get_arg((void *) arg, &val, sizeof(val) )))
+			if ((r = get_arg(argp, &val, sizeof(val) )))
 				return r;
 			val++;
 			if (is->maxcid != val) {
@@ -549,11 +585,11 @@ isdn_ppp_ioctl(int min, struct file *file, unsigned int cmd, unsigned long arg)
 			}
 			break;
 		case PPPIOCGDEBUG:
-			if ((r = set_arg((void *) arg, &is->debug, sizeof(is->debug) )))
+			if ((r = set_arg(argp, &is->debug, sizeof(is->debug) )))
 				return r;
 			break;
 		case PPPIOCSDEBUG:
-			if ((r = get_arg((void *) arg, &val, sizeof(val) )))
+			if ((r = get_arg(argp, &val, sizeof(val) )))
 				return r;
 			is->debug = val;
 			break;
@@ -568,12 +604,12 @@ isdn_ppp_ioctl(int min, struct file *file, unsigned int cmd, unsigned long arg)
 						protos[j] |= (0x1<<i);
 					ipc = ipc->next;
 				}
-				if ((r = set_arg((void *) arg,protos,8*sizeof(long) )))
+				if ((r = set_arg(argp,protos,8*sizeof(long) )))
 					return r;
 			}
 			break;
 		case PPPIOCSCOMPRESSOR:
-			if ((r = get_arg((void *) arg, &data, sizeof(struct isdn_ppp_comp_data))))
+			if ((r = get_arg(argp, &data, sizeof(struct isdn_ppp_comp_data))))
 				return r;
 			return isdn_ppp_set_compressor(is, &data);
 		case PPPIOCGCALLINFO:
@@ -594,38 +630,29 @@ isdn_ppp_ioctl(int min, struct file *file, unsigned int cmd, unsigned long arg)
 					if(lp->flags & ISDN_NET_CALLBACK)
 						pci.calltype |= CALLTYPE_CALLBACK;
 				}
-				return set_arg((void *)arg,&pci,sizeof(struct pppcallinfo));
+				return set_arg(argp,&pci,sizeof(struct pppcallinfo));
 			}
 #ifdef CONFIG_IPPP_FILTER
 		case PPPIOCSPASS:
+			{
+				struct sock_filter *code;
+				int len = get_filter(argp, &code);
+				if (len < 0)
+					return len;
+				kfree(is->pass_filter);
+				is->pass_filter = code;
+				is->pass_len = len;
+				break;
+			}
 		case PPPIOCSACTIVE:
 			{
-				struct sock_fprog uprog, *filtp;
-				struct sock_filter *code = NULL;
-				int len, err;
-
-				if (copy_from_user(&uprog, (void *) arg, sizeof(uprog)))
-					return -EFAULT;
-				if (uprog.len > 0) {
-					len = uprog.len * sizeof(struct sock_filter);
-					code = kmalloc(len, GFP_KERNEL);
-					if (code == NULL)
-						return -ENOMEM;
-					if (copy_from_user(code, uprog.filter, len)) {
-						kfree(code);
-						return -EFAULT;
-					}
-					err = sk_chk_filter(code, uprog.len);
-					if (err) {
-						kfree(code);
-						return err;
-					}
-				}
-				filtp = (cmd == PPPIOCSPASS) ? &is->pass_filter : &is->active_filter;
-				if (filtp->filter)
-					kfree(filtp->filter);
-				filtp->filter = code;
-				filtp->len = uprog.len;
+				struct sock_filter *code;
+				int len = get_filter(argp, &code);
+				if (len < 0)
+					return len;
+				kfree(is->active_filter);
+				is->active_filter = code;
+				is->active_len = len;
 				break;
 			}
 #endif /* CONFIG_IPPP_FILTER */
@@ -733,7 +760,7 @@ isdn_ppp_fill_rq(unsigned char *buf, int len, int proto, int slot)
  */
 
 int
-isdn_ppp_read(int min, struct file *file, char *buf, int count)
+isdn_ppp_read(int min, struct file *file, char __user *buf, int count)
 {
 	struct ippp_struct *is;
 	struct ippp_buf_queue *b;
@@ -746,7 +773,7 @@ isdn_ppp_read(int min, struct file *file, char *buf, int count)
 	if (!(is->state & IPPP_OPEN))
 		return 0;
 
-	if ((r = verify_area(VERIFY_WRITE, (void *) buf, count)))
+	if ((r = verify_area(VERIFY_WRITE, buf, count)))
 		return r;
 
 	spin_lock_irqsave(&is->buflock, flags);
@@ -773,7 +800,7 @@ isdn_ppp_read(int min, struct file *file, char *buf, int count)
  */
 
 int
-isdn_ppp_write(int min, struct file *file, const char *buf, int count)
+isdn_ppp_write(int min, struct file *file, const char __user *buf, int count)
 {
 	isdn_net_local *lp;
 	struct ippp_struct *is;
@@ -1128,17 +1155,16 @@ isdn_ppp_push_higher(isdn_net_dev * net_dev, isdn_net_local * lp, struct sk_buff
 		*p = 0;	/* indicate inbound in DLT_LINUX_SLL */
 	}
 
-	if (is->pass_filter.filter
-	    && sk_run_filter(skb, is->pass_filter.filter,
-	                    is->pass_filter.len) == 0) {
+	if (is->pass_filter
+	    && sk_run_filter(skb, is->pass_filter, is->pass_len) == 0) {
 		if (is->debug & 0x2)
 			printk(KERN_DEBUG "IPPP: inbound frame filtered.\n");
 		kfree_skb(skb);
 		return;
 	}
-	if (!(is->active_filter.filter
-	      && sk_run_filter(skb, is->active_filter.filter,
-	                       is->active_filter.len) == 0)) {
+	if (!(is->active_filter
+	      && sk_run_filter(skb, is->active_filter,
+	                       is->active_len) == 0)) {
 		if (is->debug & 0x2)
 			printk(KERN_DEBUG "IPPP: link-active filter: reseting huptimer.\n");
 		lp->huptimer = 0;
@@ -1276,17 +1302,16 @@ isdn_ppp_xmit(struct sk_buff *skb, struct net_device *netdev)
 		*p   = htons(proto);
 	}
 
-	if (ipt->pass_filter.filter 
-	    && sk_run_filter(skb, ipt->pass_filter.filter,
-		             ipt->pass_filter.len) == 0) {
+	if (ipt->pass_filter
+	    && sk_run_filter(skb, ipt->pass_filter, ipt->pass_len) == 0) {
 		if (ipt->debug & 0x4)
 			printk(KERN_DEBUG "IPPP: outbound frame filtered.\n");
 		kfree_skb(skb);
 		goto unlock;
 	}
-	if (!(ipt->active_filter.filter
-	      && sk_run_filter(skb, ipt->active_filter.filter,
-		               ipt->active_filter.len) == 0)) {
+	if (!(ipt->active_filter
+	      && sk_run_filter(skb, ipt->active_filter,
+		               ipt->active_len) == 0)) {
 		if (ipt->debug & 0x4)
 			printk(KERN_DEBUG "IPPP: link-active filter: reseting huptimer.\n");
 		lp->huptimer = 0;
@@ -1475,12 +1500,10 @@ int isdn_ppp_autodial_filter(struct sk_buff *skb, isdn_net_local *lp)
 		*p   = htons(proto);
 	}
 	
-	drop |= is->pass_filter.filter
-	        && sk_run_filter(skb, is->pass_filter.filter,
-	                         is->pass_filter.len) == 0;
-	drop |= is->active_filter.filter
-	        && sk_run_filter(skb, is->active_filter.filter,
-	                         is->active_filter.len) == 0;
+	drop |= is->pass_filter
+	        && sk_run_filter(skb, is->pass_filter, is->pass_len) == 0;
+	drop |= is->active_filter
+	        && sk_run_filter(skb, is->active_filter, is->active_len) == 0;
 	
 	skb_push(skb, IPPP_MAX_HEADER - 4);
 	return drop;
@@ -1969,12 +1992,11 @@ out:
 static int
 isdn_ppp_dev_ioctl_stats(int slot, struct ifreq *ifr, struct net_device *dev)
 {
-	struct ppp_stats *res,
-	 t;
+	struct ppp_stats __user *res = ifr->ifr_data;
+	struct ppp_stats t;
 	isdn_net_local *lp = (isdn_net_local *) dev->priv;
 	int err;
 
-	res = (struct ppp_stats *) ifr->ifr_ifru.ifru_data;
 	err = verify_area(VERIFY_WRITE, res, sizeof(struct ppp_stats));
 
 	if (err)
@@ -2004,7 +2026,8 @@ isdn_ppp_dev_ioctl_stats(int slot, struct ifreq *ifr, struct net_device *dev)
 		}
 #endif
 	}
-	if( copy_to_user(res, &t, sizeof(struct ppp_stats))) return -EFAULT;
+	if (copy_to_user(res, &t, sizeof(struct ppp_stats)))
+		return -EFAULT;
 	return 0;
 }
 
@@ -2012,7 +2035,6 @@ int
 isdn_ppp_dev_ioctl(struct net_device *dev, struct ifreq *ifr, int cmd)
 {
 	int error=0;
-	char *r;
 	int len;
 	isdn_net_local *lp = (isdn_net_local *) dev->priv;
 
@@ -2023,9 +2045,8 @@ isdn_ppp_dev_ioctl(struct net_device *dev, struct ifreq *ifr, int cmd)
 	switch (cmd) {
 #define PPP_VERSION "2.3.7"
 		case SIOCGPPPVER:
-			r = (char *) ifr->ifr_ifru.ifru_data;
 			len = strlen(PPP_VERSION) + 1;
-			if (copy_to_user(r, PPP_VERSION, len))
+			if (copy_to_user(ifr->ifr_data, PPP_VERSION, len))
 				error = -EFAULT;
 			break;
 
diff --git a/drivers/isdn/i4l/isdn_ppp.h b/drivers/isdn/i4l/isdn_ppp.h
index f14b8a849..8cc05c7cc 100644
--- a/drivers/isdn/i4l/isdn_ppp.h
+++ b/drivers/isdn/i4l/isdn_ppp.h
@@ -12,8 +12,8 @@
 #include <linux/ppp_defs.h>     /* for PPP_PROTOCOL */
 #include <linux/isdn_ppp.h>	/* for isdn_ppp info */
 
-extern int isdn_ppp_read(int, struct file *, char *, int);
-extern int isdn_ppp_write(int, struct file *, const char *, int);
+extern int isdn_ppp_read(int, struct file *, char __user *, int);
+extern int isdn_ppp_write(int, struct file *, const char __user *, int);
 extern int isdn_ppp_open(int, struct file *);
 extern int isdn_ppp_init(void);
 extern void isdn_ppp_cleanup(void);
diff --git a/drivers/isdn/i4l/isdn_tty.c b/drivers/isdn/i4l/isdn_tty.c
index 3abc26e2d..02b912ab1 100644
--- a/drivers/isdn/i4l/isdn_tty.c
+++ b/drivers/isdn/i4l/isdn_tty.c
@@ -134,7 +134,7 @@ isdn_tty_readmodem(void)
 						if (c > 0) {
 							r = isdn_readbchan(info->isdn_driver, info->isdn_channel,
 									   tty->flip.char_buf_ptr,
-									   tty->flip.flag_buf_ptr, c, 0);
+									   tty->flip.flag_buf_ptr, c, NULL);
 							/* CISCO AsyncPPP Hack */
 							if (!(info->emu.mdmreg[REG_CPPP] & BIT_CPPP))
 								memset(tty->flip.flag_buf_ptr, 0, r);
@@ -1359,14 +1359,14 @@ isdn_tty_unthrottle(struct tty_struct *tty)
  *          allows RS485 driver to be written in user space.
  */
 static int
-isdn_tty_get_lsr_info(modem_info * info, uint * value)
+isdn_tty_get_lsr_info(modem_info * info, uint __user * value)
 {
 	u_char status;
 	uint result;
 
 	status = info->lsr;
 	result = ((status & UART_LSR_TEMT) ? TIOCSER_TEMT : 0);
-	return put_user(result, (uint *) value);
+	return put_user(result, value);
 }
 
 
@@ -1468,12 +1468,12 @@ isdn_tty_ioctl(struct tty_struct *tty, struct file *file,
 #ifdef ISDN_DEBUG_MODEM_IOCTL
 			printk(KERN_DEBUG "ttyI%d ioctl TIOCGSOFTCAR\n", info->line);
 #endif
-			return put_user(C_CLOCAL(tty) ? 1 : 0, (ulong *) arg);
+			return put_user(C_CLOCAL(tty) ? 1 : 0, (ulong __user *) arg);
 		case TIOCSSOFTCAR:
 #ifdef ISDN_DEBUG_MODEM_IOCTL
 			printk(KERN_DEBUG "ttyI%d ioctl TIOCSSOFTCAR\n", info->line);
 #endif
-			if (get_user(arg, (ulong *) arg))
+			if (get_user(arg, (ulong __user *) arg))
 				return -EFAULT;
 			tty->termios->c_cflag =
 			    ((tty->termios->c_cflag & ~CLOCAL) |
@@ -1483,7 +1483,7 @@ isdn_tty_ioctl(struct tty_struct *tty, struct file *file,
 #ifdef ISDN_DEBUG_MODEM_IOCTL
 			printk(KERN_DEBUG "ttyI%d ioctl TIOCSERGETLSR\n", info->line);
 #endif
-			return isdn_tty_get_lsr_info(info, (uint *) arg);
+			return isdn_tty_get_lsr_info(info, (uint __user *) arg);
 		default:
 #ifdef ISDN_DEBUG_MODEM_IOCTL
 			printk(KERN_DEBUG "UNKNOWN ioctl 0x%08x on ttyi%d\n", cmd, info->line);
@@ -1751,7 +1751,7 @@ isdn_tty_close(struct tty_struct *tty, struct file *filp)
 		tty->driver->flush_buffer(tty);
 	if (tty->ldisc.flush_buffer)
 		tty->ldisc.flush_buffer(tty);
-	info->tty = 0;
+	info->tty = NULL;
 	info->ncarrier = 0;
 	tty->closing = 0;
 	module_put(info->owner);
@@ -1780,7 +1780,7 @@ isdn_tty_hangup(struct tty_struct *tty)
 	isdn_tty_shutdown(info);
 	info->count = 0;
 	info->flags &= ~(ISDN_ASYNC_NORMAL_ACTIVE | ISDN_ASYNC_CALLOUT_ACTIVE);
-	info->tty = 0;
+	info->tty = NULL;
 	wake_up_interruptible(&info->open_wait);
 }
 
@@ -1959,7 +1959,7 @@ isdn_tty_modem_init(void)
 		isdn_tty_modem_reset_regs(info, 1);
 		info->magic = ISDN_ASYNC_MAGIC;
 		info->line = i;
-		info->tty = 0;
+		info->tty = NULL;
 		info->x_char = 0;
 		info->count = 0;
 		info->blocked_open = 0;
@@ -2373,8 +2373,8 @@ isdn_tty_at_cout(char *msg, modem_info * info)
 	char *p;
 	char c;
 	u_long flags;
-	struct sk_buff *skb = 0;
-	char *sp = 0;
+	struct sk_buff *skb = NULL;
+	char *sp = NULL;
 
 	if (!msg) {
 		printk(KERN_WARNING "isdn_tty: Null-Message in isdn_tty_at_cout\n");
diff --git a/drivers/isdn/i4l/isdn_x25iface.c b/drivers/isdn/i4l/isdn_x25iface.c
index 8f507e11d..da1d2fb9f 100644
--- a/drivers/isdn/i4l/isdn_x25iface.c
+++ b/drivers/isdn/i4l/isdn_x25iface.c
@@ -8,7 +8,7 @@
  * stuff needed to support the Linux X.25 PLP code on top of devices that
  * can provide a lab_b service using the concap_proto mechanism.
  * This module supports a network interface wich provides lapb_sematics
- * -- as defined in ../../Documentation/networking/x25-iface.txt -- to
+ * -- as defined in Documentation/networking/x25-iface.txt -- to
  * the upper layer and assumes that the lower layer provides a reliable
  * data link service by means of the concap_device_ops callbacks.
  *
@@ -79,7 +79,7 @@ static int pdata_is_bad( ix25_pdata_t * pda ){
 
 /* create a new x25 interface protocol instance
  */
-struct concap_proto * isdn_x25iface_proto_new()
+struct concap_proto * isdn_x25iface_proto_new(void)
 {
 	ix25_pdata_t * tmp = kmalloc(sizeof(ix25_pdata_t),GFP_KERNEL);
 	IX25DEBUG("isdn_x25iface_proto_new\n");
@@ -270,13 +270,12 @@ int isdn_x25iface_disconn_ind(struct concap_proto *cprot)
 }
 
 /* process a frame handed over to us from linux network layer. First byte
-   semantics as defined in ../../Documentation/networking/x25-iface.txt 
+   semantics as defined in Documentation/networking/x25-iface.txt
    */
 int isdn_x25iface_xmit(struct concap_proto *cprot, struct sk_buff *skb)
 {
 	unsigned char firstbyte = skb->data[0];
-	unsigned *state = 
-		&( ( (ix25_pdata_t*) (cprot -> proto_data) ) -> state  );
+	enum wan_states *state = &((ix25_pdata_t*)cprot->proto_data)->state;
 	int ret = 0;
 	IX25DEBUG( "isdn_x25iface_xmit: %s first=%x state=%d \n", MY_DEVNAME(cprot -> net_dev), firstbyte, *state );
 	switch ( firstbyte ){
diff --git a/drivers/isdn/icn/icn.c b/drivers/isdn/icn/icn.c
index 391a8f139..0c256d698 100644
--- a/drivers/isdn/icn/icn.c
+++ b/drivers/isdn/icn/icn.c
@@ -798,7 +798,7 @@ int slsec = sec; \
 #endif
 
 static int
-icn_loadboot(u_char * buffer, icn_card * card)
+icn_loadboot(u_char __user * buffer, icn_card * card)
 {
 	int ret;
 	u_char *codebuf;
@@ -903,9 +903,9 @@ icn_loadboot(u_char * buffer, icn_card * card)
 }
 
 static int
-icn_loadproto(u_char * buffer, icn_card * card)
+icn_loadproto(u_char __user * buffer, icn_card * card)
 {
-	register u_char *p = buffer;
+	register u_char __user *p = buffer;
 	u_char codebuf[256];
 	uint left = ICN_CODE_STAGE2;
 	uint cnt;
@@ -916,7 +916,7 @@ icn_loadproto(u_char * buffer, icn_card * card)
 #ifdef BOOT_DEBUG
 	printk(KERN_DEBUG "icn_loadproto called\n");
 #endif
-	if ((ret = verify_area(VERIFY_READ, (void *) buffer, ICN_CODE_STAGE2)))
+	if ((ret = verify_area(VERIFY_READ, buffer, ICN_CODE_STAGE2)))
 		return ret;
 	timer = 0;
 	spin_lock_irqsave(&dev.devlock, flags);
@@ -1007,18 +1007,15 @@ icn_loadproto(u_char * buffer, icn_card * card)
 
 /* Read the Status-replies from the Interface */
 static int
-icn_readstatus(u_char * buf, int len, int user, icn_card * card)
+icn_readstatus(u_char __user *buf, int len, icn_card * card)
 {
 	int count;
-	u_char *p;
+	u_char __user *p;
 
 	for (p = buf, count = 0; count < len; p++, count++) {
 		if (card->msg_buf_read == card->msg_buf_write)
 			return count;
-		if (user)
-			put_user(*card->msg_buf_read++, p);
-		else
-			*p = *card->msg_buf_read++;
+		put_user(*card->msg_buf_read++, p);
 		if (card->msg_buf_read > card->msg_buf_end)
 			card->msg_buf_read = card->msg_buf;
 	}
@@ -1163,10 +1160,12 @@ icn_command(isdn_ctrl * c, icn_card * card)
 	char cbuf[60];
 	isdn_ctrl cmd;
 	icn_cdef cdef;
+	char __user *arg;
 
 	switch (c->command) {
 		case ISDN_CMD_IOCTL:
 			memcpy(&a, c->parm.num, sizeof(ulong));
+			arg = (char __user *)a;
 			switch (c->arg) {
 				case ICN_IOCTL_SETMMIO:
 					if (dev.memaddr != (a & 0x0ffc000)) {
@@ -1230,15 +1229,15 @@ icn_command(isdn_ctrl * c, icn_card * card)
 				case ICN_IOCTL_GETDOUBLE:
 					return (int) card->doubleS0;
 				case ICN_IOCTL_DEBUGVAR:
-					if (copy_to_user((char *)a,
-							 (char *)&card,
+					if (copy_to_user(arg,
+							 &card,
 							 sizeof(ulong)))
 						return -EFAULT;
 					a += sizeof(ulong);
 					{
 						ulong l = (ulong) & dev;
-						if (copy_to_user((char *)a,
-								 (char *)&l,
+						if (copy_to_user(arg,
+								 &l,
 								 sizeof(ulong)))
 							return -EFAULT;
 					}
@@ -1249,20 +1248,20 @@ icn_command(isdn_ctrl * c, icn_card * card)
 						dev.firstload = 0;
 					}
 					icn_stopcard(card);
-					return (icn_loadboot((u_char *) a, card));
+					return (icn_loadboot(arg, card));
 				case ICN_IOCTL_LOADPROTO:
 					icn_stopcard(card);
-					if ((i = (icn_loadproto((u_char *) a, card))))
+					if ((i = (icn_loadproto(arg, card))))
 						return i;
 					if (card->doubleS0)
-						i = icn_loadproto((u_char *) (a + ICN_CODE_STAGE2), card->other);
+						i = icn_loadproto(arg + ICN_CODE_STAGE2, card->other);
 					return i;
 					break;
 				case ICN_IOCTL_ADDCARD:
 					if (!dev.firstload)
 						return -EBUSY;
-					if (copy_from_user((char *)&cdef,
-							   (char *)a,
+					if (copy_from_user(&cdef,
+							   arg,
 							   sizeof(cdef)))
 						return -EFAULT;
 					return (icn_addcard(cdef.port, cdef.id1, cdef.id2));
@@ -1470,14 +1469,14 @@ if_command(isdn_ctrl * c)
 }
 
 static int
-if_writecmd(const u_char * buf, int len, int user, int id, int channel)
+if_writecmd(const u_char __user *buf, int len, int id, int channel)
 {
 	icn_card *card = icn_findcard(id);
 
 	if (card) {
 		if (!card->flags & ICN_FLAGS_RUNNING)
 			return -ENODEV;
-		return (icn_writecmd(buf, len, user, card));
+		return (icn_writecmd(buf, len, 1, card));
 	}
 	printk(KERN_ERR
 	       "icn: if_writecmd called with invalid driverId!\n");
@@ -1485,14 +1484,14 @@ if_writecmd(const u_char * buf, int len, int user, int id, int channel)
 }
 
 static int
-if_readstatus(u_char * buf, int len, int user, int id, int channel)
+if_readstatus(u_char __user *buf, int len, int id, int channel)
 {
 	icn_card *card = icn_findcard(id);
 
 	if (card) {
 		if (!card->flags & ICN_FLAGS_RUNNING)
 			return -ENODEV;
-		return (icn_readstatus(buf, len, user, card));
+		return (icn_readstatus(buf, len, card));
 	}
 	printk(KERN_ERR
 	       "icn: if_readstatus called with invalid driverId!\n");
diff --git a/drivers/isdn/isdnloop/isdnloop.c b/drivers/isdn/isdnloop/isdnloop.c
index fde3db9ab..544f41b41 100644
--- a/drivers/isdn/isdnloop/isdnloop.c
+++ b/drivers/isdn/isdnloop/isdnloop.c
@@ -443,18 +443,15 @@ isdnloop_sendbuf(int channel, struct sk_buff *skb, isdnloop_card * card)
  *   number of bytes actually transferred.
  */
 static int
-isdnloop_readstatus(u_char * buf, int len, int user, isdnloop_card * card)
+isdnloop_readstatus(u_char __user *buf, int len, isdnloop_card * card)
 {
 	int count;
-	u_char *p;
+	u_char __user *p;
 
 	for (p = buf, count = 0; count < len; p++, count++) {
 		if (card->msg_buf_read == card->msg_buf_write)
 			return count;
-		if (user)
-			put_user(*card->msg_buf_read++, p);
-		else
-			*p = *card->msg_buf_read++;
+		put_user(*card->msg_buf_read++, p);
 		if (card->msg_buf_read > card->msg_buf_end)
 			card->msg_buf_read = card->msg_buf;
 	}
@@ -1388,14 +1385,14 @@ if_command(isdn_ctrl * c)
 }
 
 static int
-if_writecmd(const u_char * buf, int len, int user, int id, int channel)
+if_writecmd(const u_char __user *buf, int len, int id, int channel)
 {
 	isdnloop_card *card = isdnloop_findcard(id);
 
 	if (card) {
 		if (!card->flags & ISDNLOOP_FLAGS_RUNNING)
 			return -ENODEV;
-		return (isdnloop_writecmd(buf, len, user, card));
+		return (isdnloop_writecmd(buf, len, 1, card));
 	}
 	printk(KERN_ERR
 	       "isdnloop: if_writecmd called with invalid driverId!\n");
@@ -1403,14 +1400,14 @@ if_writecmd(const u_char * buf, int len, int user, int id, int channel)
 }
 
 static int
-if_readstatus(u_char * buf, int len, int user, int id, int channel)
+if_readstatus(u_char __user *buf, int len, int id, int channel)
 {
 	isdnloop_card *card = isdnloop_findcard(id);
 
 	if (card) {
 		if (!card->flags & ISDNLOOP_FLAGS_RUNNING)
 			return -ENODEV;
-		return (isdnloop_readstatus(buf, len, user, card));
+		return (isdnloop_readstatus(buf, len, card));
 	}
 	printk(KERN_ERR
 	       "isdnloop: if_readstatus called with invalid driverId!\n");
diff --git a/drivers/isdn/pcbit/Kconfig b/drivers/isdn/pcbit/Kconfig
index e4b083c2f..f06997fae 100644
--- a/drivers/isdn/pcbit/Kconfig
+++ b/drivers/isdn/pcbit/Kconfig
@@ -3,7 +3,7 @@
 #
 config ISDN_DRV_PCBIT
 	tristate "PCBIT-D support"
-	depends on ISDN_I4L && ISA
+	depends on ISDN_I4L && ISA && (BROKEN || !PPC)
 	help
 	  This enables support for the PCBIT ISDN-card.  This card is
 	  manufactured in Portugal by Octal.  For running this card,
diff --git a/drivers/isdn/pcbit/drv.c b/drivers/isdn/pcbit/drv.c
index c3f43a56b..ed8af7ff0 100644
--- a/drivers/isdn/pcbit/drv.c
+++ b/drivers/isdn/pcbit/drv.c
@@ -57,9 +57,9 @@ static char* pcbit_devname[MAX_PCBIT_CARDS] = {
  */
 
 int pcbit_command(isdn_ctrl* ctl);
-int pcbit_stat(u_char* buf, int len, int user, int, int);
+int pcbit_stat(u_char __user * buf, int len, int, int);
 int pcbit_xmit(int driver, int chan, int ack, struct sk_buff *skb);
-int pcbit_writecmd(const u_char*, int, int, int, int);
+int pcbit_writecmd(const u_char __user *, int, int, int);
 
 static int set_protocol_running(struct pcbit_dev * dev);
 
@@ -389,12 +389,13 @@ int pcbit_xmit(int driver, int chnum, int ack, struct sk_buff *skb)
 	return len;
 }
 
-int pcbit_writecmd(const u_char* buf, int len, int user, int driver, int channel)
+int pcbit_writecmd(const u_char __user *buf, int len, int driver, int channel)
 {
 	struct pcbit_dev * dev;
 	int i, j;
 	const u_char * loadbuf;
 	u_char * ptr = NULL;
+	u_char *cbuf;
 
 	int errstat;
 
@@ -415,37 +416,28 @@ int pcbit_writecmd(const u_char* buf, int len, int user, int driver, int channel
 			return -EINVAL;
 		}
 
-		if (user)
-		{
-			u_char *cbuf = kmalloc(len, GFP_KERNEL);
-			if (!cbuf)
-				return -ENOMEM;
+		cbuf = kmalloc(len, GFP_KERNEL);
+		if (!cbuf)
+			return -ENOMEM;
 
-			if (copy_from_user(cbuf, buf, len)) {
-				kfree(cbuf);
-				return -EFAULT;
-			}
-			memcpy_toio(dev->sh_mem, cbuf, len);
+		if (copy_from_user(cbuf, buf, len)) {
 			kfree(cbuf);
+			return -EFAULT;
 		}
-		else
-			memcpy_toio(dev->sh_mem, buf, len);
+		memcpy_toio(dev->sh_mem, cbuf, len);
+		kfree(cbuf);
 		return len;
 	case L2_FWMODE:
 		/* this is the hard part */
 		/* dumb board */
-		if (user) {		
-			/* get it into kernel space */
-			if ((ptr = kmalloc(len, GFP_KERNEL))==NULL)
-				return -ENOMEM;
-			if (copy_from_user(ptr, buf, len)) {
-				kfree(ptr);
-				return -EFAULT;
-			}
-			loadbuf = ptr;
+		/* get it into kernel space */
+		if ((ptr = kmalloc(len, GFP_KERNEL))==NULL)
+			return -ENOMEM;
+		if (copy_from_user(ptr, buf, len)) {
+			kfree(ptr);
+			return -EFAULT;
 		}
-		else
-			loadbuf = buf;
+		loadbuf = ptr;
     
 		errstat = 0;
 
@@ -468,9 +460,7 @@ int pcbit_writecmd(const u_char* buf, int len, int user, int driver, int channel
 			if (dev->loadptr > LOAD_ZONE_END)
 				dev->loadptr = LOAD_ZONE_START;
 		}
-
-		if (user)
-			kfree(ptr);
+		kfree(ptr);
 
 		return errstat ? errstat : len;
 	default:
@@ -723,17 +713,7 @@ static char statbuf[STATBUF_LEN];
 static int stat_st = 0;
 static int stat_end = 0;
 
-
-static __inline void
-memcpy_to_COND(int flag, char *d, const char *s, int len) {
-	if (flag)
-		copy_to_user(d, s, len);
-	else
-		memcpy(d, s, len);
-}
-
-
-int pcbit_stat(u_char* buf, int len, int user, int driver, int channel)
+int pcbit_stat(u_char __user *buf, int len, int driver, int channel)
 {
 	int stat_count;
 	stat_count = stat_end - stat_st;
@@ -747,24 +727,23 @@ int pcbit_stat(u_char* buf, int len, int user, int driver, int channel)
 
 	if (stat_st < stat_end)
 	{
-		memcpy_to_COND(user, buf, statbuf + stat_st, len);
+		copy_to_user(buf, statbuf + stat_st, len);
 		stat_st += len;	   
 	}
 	else
 	{
 		if (len > STATBUF_LEN - stat_st)
 		{
-			memcpy_to_COND(user, buf, statbuf + stat_st, 
+			copy_to_user(buf, statbuf + stat_st, 
 				       STATBUF_LEN - stat_st);
-			memcpy_to_COND(user, buf, statbuf, 
+			copy_to_user(buf, statbuf, 
 				       len - (STATBUF_LEN - stat_st));
 
 			stat_st = len - (STATBUF_LEN - stat_st);
 		}
 		else
 		{
-			memcpy_to_COND(user, buf, statbuf + stat_st, 
-				       len);
+			copy_to_user(buf, statbuf + stat_st, len);
 
 			stat_st += len;
 			
diff --git a/drivers/isdn/pcbit/module.c b/drivers/isdn/pcbit/module.c
index 1a0d6b848..c546ad3c8 100644
--- a/drivers/isdn/pcbit/module.c
+++ b/drivers/isdn/pcbit/module.c
@@ -25,11 +25,11 @@ MODULE_LICENSE("GPL");
 MODULE_PARM(mem, "1-" __MODULE_STRING(MAX_PCBIT_CARDS) "i");
 MODULE_PARM(irq, "1-" __MODULE_STRING(MAX_PCBIT_CARDS) "i");
 
-static int mem[MAX_PCBIT_CARDS] = {0, };
-static int irq[MAX_PCBIT_CARDS] = {0, };
+static int mem[MAX_PCBIT_CARDS];
+static int irq[MAX_PCBIT_CARDS];
 
 static int num_boards;
-struct pcbit_dev * dev_pcbit[MAX_PCBIT_CARDS] = {0, };
+struct pcbit_dev * dev_pcbit[MAX_PCBIT_CARDS];
 
 extern void pcbit_terminate(int board);
 extern int pcbit_init_dev(int board, int mem_base, int irq);
diff --git a/drivers/isdn/sc/command.c b/drivers/isdn/sc/command.c
index e37879a9a..b2c4eac7c 100644
--- a/drivers/isdn/sc/command.c
+++ b/drivers/isdn/sc/command.c
@@ -117,7 +117,7 @@ int command(isdn_ctrl *cmd)
 		scs_ioctl	ioc;
 
 		memcpy(&cmdptr, cmd->parm.num, sizeof(unsigned long));
-		if (copy_from_user(&ioc, (scs_ioctl *)cmdptr,
+		if (copy_from_user(&ioc, (scs_ioctl __user *)cmdptr,
 				   sizeof(scs_ioctl))) {
 			pr_debug("%s: Failed to verify user space 0x%x\n",
 				sc_adapter[card]->devicename, cmdptr);
@@ -215,7 +215,7 @@ int startproc(int card)
        	status = sendmessage(card, CMPID,cmReqType2,
 			  cmReqClass0,
 			  cmReqStartProc,
-			  0,0,0);
+			  0,0,NULL);
 	pr_debug("%s: Sent startProc\n", sc_adapter[card]->devicename);
 	
 	return status;
diff --git a/drivers/isdn/sc/hardware.h b/drivers/isdn/sc/hardware.h
index 49219ad95..adde8fb14 100644
--- a/drivers/isdn/sc/hardware.h
+++ b/drivers/isdn/sc/hardware.h
@@ -105,7 +105,7 @@
  */
 
 /* Return the number of jiffies in a given number of msecs */
-#define milliseconds(x)	(x/(1000/HZ))
+#define milliseconds(x)	(((x)*HZ)/1000)
 
 /* Determine if a channel number is valid for the adapter */
 #define IS_VALID_CHANNEL(y,x)	((x>0) && (x <= sc_adapter[y]->channels))
diff --git a/drivers/isdn/sc/ioctl.c b/drivers/isdn/sc/ioctl.c
index 70e0faadc..1371a9904 100644
--- a/drivers/isdn/sc/ioctl.c
+++ b/drivers/isdn/sc/ioctl.c
@@ -72,7 +72,7 @@ int sc_ioctl(int card, scs_ioctl *data)
 		/*
 		 * Get the SRec from user space
 		 */
-		if (copy_from_user(srec, (char *) data->dataptr, sizeof(srec))) {
+		if (copy_from_user(srec, data->dataptr, sizeof(srec))) {
 			kfree(rcvmsg);
 			kfree(srec);
 			return -EFAULT;
@@ -118,8 +118,7 @@ int sc_ioctl(int card, scs_ioctl *data)
 		/*
 		 * Get the switch type from user space
 		 */
-		if (copy_from_user(&switchtype, (char *)data->dataptr,
-				   sizeof(char))) {
+		if (copy_from_user(&switchtype, data->dataptr, sizeof(char))) {
 			kfree(rcvmsg);
 			return -EFAULT;
 		}
@@ -152,7 +151,7 @@ int sc_ioctl(int card, scs_ioctl *data)
 		 * Get the switch type from the board
 		 */
 		status = send_and_receive(card, CEPID, ceReqTypeCall, ceReqClass0, 
-			ceReqCallGetSwitchType, 0, 0, 0, rcvmsg, SAR_TIMEOUT);
+			ceReqCallGetSwitchType, 0, 0, NULL, rcvmsg, SAR_TIMEOUT);
 		if (!status && !(rcvmsg->rsp_status)) {
 			pr_debug("%s: SCIOCGETSWITCH: command successful\n",
 					sc_adapter[card]->devicename);
@@ -169,7 +168,7 @@ int sc_ioctl(int card, scs_ioctl *data)
 		/*
 		 * Package the switch type and send to user space
 		 */
-		if (copy_to_user((char *)data->dataptr, &switchtype,
+		if (copy_to_user(data->dataptr, &switchtype,
 				 sizeof(char))) {
 			kfree(rcvmsg);
 			return -EFAULT;
@@ -193,7 +192,7 @@ int sc_ioctl(int card, scs_ioctl *data)
 		 * Get the spid from the board
 		 */
 		status = send_and_receive(card, CEPID, ceReqTypeCall, ceReqClass0, ceReqCallGetSPID,
-					data->channel, 0, 0, rcvmsg, SAR_TIMEOUT);
+					data->channel, 0, NULL, rcvmsg, SAR_TIMEOUT);
 		if (!status) {
 			pr_debug("%s: SCIOCGETSPID: command successful\n",
 					sc_adapter[card]->devicename);
@@ -209,7 +208,7 @@ int sc_ioctl(int card, scs_ioctl *data)
 		/*
 		 * Package the switch type and send to user space
 		 */
-		if (copy_to_user((char *)data->dataptr, spid, SCIOC_SPIDSIZE)) {
+		if (copy_to_user(data->dataptr, spid, SCIOC_SPIDSIZE)) {
 			kfree(spid);
 			kfree(rcvmsg);
 			return -EFAULT;
@@ -234,7 +233,7 @@ int sc_ioctl(int card, scs_ioctl *data)
 		/*
 		 * Get the spid from user space
 		 */
-		if (copy_from_user(spid, (char *) data->dataptr, SCIOC_SPIDSIZE)) {
+		if (copy_from_user(spid, data->dataptr, SCIOC_SPIDSIZE)) {
 			kfree(rcvmsg);
 			return -EFAULT;
 		}
@@ -269,7 +268,7 @@ int sc_ioctl(int card, scs_ioctl *data)
 		 * Get the dn from the board
 		 */
 		status = send_and_receive(card, CEPID, ceReqTypeCall, ceReqClass0, ceReqCallGetMyNumber,
-					data->channel, 0, 0, rcvmsg, SAR_TIMEOUT);
+					data->channel, 0, NULL, rcvmsg, SAR_TIMEOUT);
 		if (!status) {
 			pr_debug("%s: SCIOCGETDN: command successful\n",
 					sc_adapter[card]->devicename);
@@ -292,7 +291,7 @@ int sc_ioctl(int card, scs_ioctl *data)
 		/*
 		 * Package the dn and send to user space
 		 */
-		if (copy_to_user((char *)data->dataptr, dn, SCIOC_DNSIZE)) {
+		if (copy_to_user(data->dataptr, dn, SCIOC_DNSIZE)) {
 			kfree(dn);
 			return -EFAULT;
 		}
@@ -313,7 +312,7 @@ int sc_ioctl(int card, scs_ioctl *data)
 		/*
 		 * Get the spid from user space
 		 */
-		if (copy_from_user(dn, (char *)data->dataptr, SCIOC_DNSIZE)) {
+		if (copy_from_user(dn, data->dataptr, SCIOC_DNSIZE)) {
 			kfree(rcvmsg);
 			kfree(dn);
 			return -EFAULT;
@@ -366,8 +365,7 @@ int sc_ioctl(int card, scs_ioctl *data)
 		kfree(rcvmsg);
 		GetStatus(card, bi);
 
-		if (copy_to_user((boardInfo *)data->dataptr, bi,
-				 sizeof(boardInfo))) {
+		if (copy_to_user(data->dataptr, bi, sizeof(boardInfo))) {
 			kfree(bi);
 			return -EFAULT;
 		}
@@ -385,7 +383,7 @@ int sc_ioctl(int card, scs_ioctl *data)
 		 * Get the speed from the board
 		 */
 		status = send_and_receive(card, CEPID, ceReqTypeCall, ceReqClass0, 
-			ceReqCallGetCallType, data->channel, 0, 0, rcvmsg, SAR_TIMEOUT);
+			ceReqCallGetCallType, data->channel, 0, NULL, rcvmsg, SAR_TIMEOUT);
 		if (!status && !(rcvmsg->rsp_status)) {
 			pr_debug("%s: SCIOCGETSPEED: command successful\n",
 				sc_adapter[card]->devicename);
@@ -405,7 +403,7 @@ int sc_ioctl(int card, scs_ioctl *data)
 		 * Package the switch type and send to user space
 		 */
 
-		if (copy_to_user((char *) data->dataptr, &speed, sizeof(char)))
+		if (copy_to_user(data->dataptr, &speed, sizeof(char)))
 			return -EFAULT;
 
 		return 0;
diff --git a/drivers/isdn/sc/message.c b/drivers/isdn/sc/message.c
index 192eacb0c..ca204da32 100644
--- a/drivers/isdn/sc/message.c
+++ b/drivers/isdn/sc/message.c
@@ -30,7 +30,6 @@ extern unsigned int cinst;
  */
 extern int indicate_status(int,ulong,char*);
 extern int scm_command(isdn_ctrl *);
-extern void *memcpy_fromshmem(int, void *, const void *, size_t);
 
 
 /*
diff --git a/drivers/isdn/sc/packet.c b/drivers/isdn/sc/packet.c
index 4190851fe..8e3fac3ba 100644
--- a/drivers/isdn/sc/packet.c
+++ b/drivers/isdn/sc/packet.c
@@ -25,8 +25,8 @@ extern unsigned int cinst;
 
 extern int get_card_from_id(int);
 extern int indicate_status(int, int,ulong, char*);
-extern void *memcpy_toshmem(int, void *, const void *, size_t);
-extern void *memcpy_fromshmem(int, void *, const void *, size_t);
+extern void memcpy_toshmem(int, void *, const void *, size_t);
+extern void memcpy_fromshmem(int, void *, const void *, size_t);
 extern int sendmessage(int, unsigned int, unsigned int, unsigned int,
                 unsigned int, unsigned int, unsigned int, unsigned int *);
 
diff --git a/drivers/isdn/sc/scioc.h b/drivers/isdn/sc/scioc.h
index c3dd551ec..d08e650c7 100644
--- a/drivers/isdn/sc/scioc.h
+++ b/drivers/isdn/sc/scioc.h
@@ -27,7 +27,7 @@ typedef struct {
 	int device;
 	int channel;
 	unsigned long command;
-	void *dataptr;
+	void __user *dataptr;
 } scs_ioctl;
 
 /* Size of strings */
diff --git a/drivers/isdn/sc/shmem.c b/drivers/isdn/sc/shmem.c
index 55493e0ec..7bc2dfad0 100644
--- a/drivers/isdn/sc/shmem.c
+++ b/drivers/isdn/sc/shmem.c
@@ -30,19 +30,18 @@ extern int cinst;
 /*
  *
  */
-void *memcpy_toshmem(int card, void *dest, const void *src, size_t n)
+void memcpy_toshmem(int card, void *dest, const void *src, size_t n)
 {
 	unsigned long flags;
-	void *ret;
 	unsigned char ch;
 
 	if(!IS_VALID_CARD(card)) {
 		pr_debug("Invalid param: %d is not a valid card id\n", card);
-		return NULL;
+		return;
 	}
 
 	if(n > SRAM_PAGESIZE) {
-		return NULL;
+		return;
 	}
 
 	/*
@@ -57,7 +56,7 @@ void *memcpy_toshmem(int card, void *dest, const void *src, size_t n)
 
 	outb(((sc_adapter[card]->shmem_magic + ch * SRAM_PAGESIZE) >> 14) | 0x80,
 		sc_adapter[card]->ioport[sc_adapter[card]->shmem_pgport]);
-	ret = memcpy_toio(sc_adapter[card]->rambase +
+	memcpy_toio(sc_adapter[card]->rambase +
 		((unsigned long) dest % 0x4000), src, n);
 	spin_unlock_irqrestore(&sc_adapter[card]->lock, flags);
 	pr_debug("%s: set page to %#x\n",sc_adapter[card]->devicename,
@@ -66,26 +65,23 @@ void *memcpy_toshmem(int card, void *dest, const void *src, size_t n)
 		sc_adapter[card]->devicename, n,
 		(unsigned long) src,
 		sc_adapter[card]->rambase + ((unsigned long) dest %0x4000));
-
-	return ret;
 }
 
 /*
  * Reverse of above
  */
-void *memcpy_fromshmem(int card, void *dest, const void *src, size_t n)
+void memcpy_fromshmem(int card, void *dest, const void *src, size_t n)
 {
 	unsigned long flags;
-	void *ret;
 	unsigned char ch;
 
 	if(!IS_VALID_CARD(card)) {
 		pr_debug("Invalid param: %d is not a valid card id\n", card);
-		return NULL;
+		return;
 	}
 
 	if(n > SRAM_PAGESIZE) {
-		return NULL;
+		return;
 	}
 
 	/*
@@ -102,7 +98,7 @@ void *memcpy_fromshmem(int card, void *dest, const void *src, size_t n)
 
 	outb(((sc_adapter[card]->shmem_magic + ch * SRAM_PAGESIZE) >> 14) | 0x80,
 		sc_adapter[card]->ioport[sc_adapter[card]->shmem_pgport]);
-	ret = memcpy_fromio(dest,(void *)(sc_adapter[card]->rambase +
+	memcpy_fromio(dest,(void *)(sc_adapter[card]->rambase +
 		((unsigned long) src % 0x4000)), n);
 	spin_unlock_irqrestore(&sc_adapter[card]->lock, flags);
 	pr_debug("%s: set page to %#x\n",sc_adapter[card]->devicename,
@@ -110,23 +106,20 @@ void *memcpy_fromshmem(int card, void *dest, const void *src, size_t n)
 /*	pr_debug("%s: copying %d bytes from %#x to %#x\n",
 		sc_adapter[card]->devicename, n,
 		sc_adapter[card]->rambase + ((unsigned long) src %0x4000), (unsigned long) dest); */
-
-	return ret;
 }
 
-void *memset_shmem(int card, void *dest, int c, size_t n)
+void memset_shmem(int card, void *dest, int c, size_t n)
 {
 	unsigned long flags;
 	unsigned char ch;
-	void *ret;
 
 	if(!IS_VALID_CARD(card)) {
 		pr_debug("Invalid param: %d is not a valid card id\n", card);
-		return NULL;
+		return;
 	}
 
 	if(n > SRAM_PAGESIZE) {
-		return NULL;
+		return;
 	}
 
 	/*
@@ -142,11 +135,9 @@ void *memset_shmem(int card, void *dest, int c, size_t n)
 
 	outb(((sc_adapter[card]->shmem_magic + ch * SRAM_PAGESIZE) >> 14) | 0x80,
 		sc_adapter[card]->ioport[sc_adapter[card]->shmem_pgport]);
-	ret = memset_io(sc_adapter[card]->rambase +
+	memset_io(sc_adapter[card]->rambase +
 		((unsigned long) dest % 0x4000), c, n);
 	pr_debug("%s: set page to %#x\n",sc_adapter[card]->devicename,
 		((sc_adapter[card]->shmem_magic + ch * SRAM_PAGESIZE)>>14)|0x80);
 	spin_unlock_irqrestore(&sc_adapter[card]->lock, flags);
-
-	return ret;
 }
diff --git a/drivers/isdn/tpam/Kconfig b/drivers/isdn/tpam/Kconfig
index a252f9f9c..c1098b2a6 100644
--- a/drivers/isdn/tpam/Kconfig
+++ b/drivers/isdn/tpam/Kconfig
@@ -4,6 +4,7 @@
 config ISDN_DRV_TPAM
 	tristate "Auvertech TurboPAM support (EXPERIMENTAL)"
 	depends on EXPERIMENTAL && ISDN_I4L && PCI
+	select CRC_CCITT
 	help
 	  This enables support for the Auvertech TurboPAM ISDN-card.
 	  For running this card, additional firmware is necessary, which has
diff --git a/drivers/isdn/tpam/tpam.h b/drivers/isdn/tpam/tpam.h
index 96d0db3e5..c1456d4b6 100644
--- a/drivers/isdn/tpam/tpam.h
+++ b/drivers/isdn/tpam/tpam.h
@@ -173,8 +173,8 @@ extern void copy_to_pam_dword(tpam_card *, const void *, u32);
 extern void copy_to_pam(tpam_card *, void *, const void *, u32);
 extern u32 copy_from_pam_dword(tpam_card *, const void *);
 extern void copy_from_pam(tpam_card *, void *, const void *, u32);
-extern int copy_from_pam_to_user(tpam_card *, void *, const void *, u32);
-extern int copy_from_user_to_pam(tpam_card *, void *, const void *, u32);
+extern int copy_from_pam_to_user(tpam_card *, void __user *, const void *, u32);
+extern int copy_from_user_to_pam(tpam_card *, void *, const void __user *, u32);
 extern int tpam_verify_area(u32, u32);
 
 /* Function prototypes from tpam_nco.c */
diff --git a/drivers/isdn/tpam/tpam_commands.c b/drivers/isdn/tpam/tpam_commands.c
index 02c199594..9cf6ef14f 100644
--- a/drivers/isdn/tpam/tpam_commands.c
+++ b/drivers/isdn/tpam/tpam_commands.c
@@ -120,7 +120,7 @@ static int tpam_command_ioctl_dspload(tpam_card *card, u32 arg) {
 	dprintk("TurboPAM(tpam_command_ioctl_dspload): card=%d\n", card->id);
 
 	/* get the IOCTL parameter from userspace */
-	if (copy_from_user(&tdl, (void *)arg, sizeof(tpam_dsp_ioctl)))
+	if (copy_from_user(&tdl, (void __user *)arg, sizeof(tpam_dsp_ioctl)))
 		return -EFAULT;
 
 	/* if the board's firmware was started, protect against writes
@@ -131,7 +131,7 @@ static int tpam_command_ioctl_dspload(tpam_card *card, u32 arg) {
 
 	/* write the data in the board's memory */
 	return copy_from_user_to_pam(card, (void *)tdl.address, 
-				     (void *)arg + sizeof(tpam_dsp_ioctl), 
+				     (void __user *)arg + sizeof(tpam_dsp_ioctl), 
 				     tdl.data_len);
 }
 
@@ -150,7 +150,7 @@ static int tpam_command_ioctl_dspsave(tpam_card *card, u32 arg) {
 	dprintk("TurboPAM(tpam_command_ioctl_dspsave): card=%d\n", card->id);
 
 	/* get the IOCTL parameter from userspace */
-	if (copy_from_user(&tdl, (void *)arg, sizeof(tpam_dsp_ioctl)))
+	if (copy_from_user(&tdl, (void __user *)arg, sizeof(tpam_dsp_ioctl)))
 		return -EFAULT;
 
 	/* protect against read from unallowed memory areas */
@@ -158,7 +158,7 @@ static int tpam_command_ioctl_dspsave(tpam_card *card, u32 arg) {
 		return -EPERM;
 
 	/* read the data from the board's memory */
-	return copy_from_pam_to_user(card, (void *)arg + sizeof(tpam_dsp_ioctl),
+	return copy_from_pam_to_user(card, (void __user *)arg + sizeof(tpam_dsp_ioctl),
 				     (void *)tdl.address, tdl.data_len);
 }
 
diff --git a/drivers/isdn/tpam/tpam_crcpc.c b/drivers/isdn/tpam/tpam_crcpc.c
index 762a82575..fae8df7ae 100644
--- a/drivers/isdn/tpam/tpam_crcpc.c
+++ b/drivers/isdn/tpam/tpam_crcpc.c
@@ -27,6 +27,7 @@ Revision History:
 
 ---------------------------------------------------------------------------*/
 
+#include <linux/crc-ccitt.h>
 #include "tpam.h"
 
 #define  HDLC_CTRL_CHAR_CMPL_MASK	0x20	/* HDLC control character complement mask */
@@ -38,41 +39,6 @@ Revision History:
 #define TRUE	1
 #define FALSE	0
 
-static u16 t_ap_hdlc_like_fcs [256] = {
-	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
-};
-
 static u8 ap_t_ctrl_char_complemented[256]; /* list of characters to complement */
 
 static void ap_hdlc_like_ctrl_char_list (u32 ctrl_char) {
@@ -88,7 +54,7 @@ static void ap_hdlc_like_ctrl_char_list (u32 ctrl_char) {
 		
 }
 
-void init_CRC() {
+void init_CRC(void) {
 	ap_hdlc_like_ctrl_char_list(0xffffffff);
 }
 
@@ -119,7 +85,7 @@ void hdlc_encode_modem(u8 *buffer_in, u32 lng_in,
 		/*
 		 *   FCS calculation
 		 */
-		fcs = (fcs>>8) ^ t_ap_hdlc_like_fcs[((u8)(fcs^data)) & 0xff];
+		fcs = crc_ccitt_byte(fcs, data);
 
 		ESCAPE_CHAR(p_data_out, data);
 	}
@@ -155,7 +121,7 @@ void hdlc_no_accm_encode(u8 *buffer_in, u32 lng_in,
 	while (lng_in--) {
 		data = *buffer_in++;
 		/* calculate FCS */
-		fcs = (fcs>>8) ^ t_ap_hdlc_like_fcs[((u8)(fcs^data)) & 0xff];
+		fcs = crc_ccitt_byte(fcs, data);
 		*p_data_out++ = data;
 	}
 
@@ -185,7 +151,7 @@ u32 hdlc_no_accm_decode(u8 *buffer_in, u32 lng_in) {
 	while (lng_in--) {
 		data = *buffer_in++;
 		/* calculate FCS */
-		fcs = (fcs>>8) ^ t_ap_hdlc_like_fcs[((u8)(fcs^data)) & 0xff];
+		fcs = crc_ccitt_byte(fcs, data);
 	}
 
 	if (fcs == HDLC_FCS_OK) 
diff --git a/drivers/isdn/tpam/tpam_memory.c b/drivers/isdn/tpam/tpam_memory.c
index fe70c08b5..ae690b7ce 100644
--- a/drivers/isdn/tpam/tpam_memory.c
+++ b/drivers/isdn/tpam/tpam_memory.c
@@ -30,7 +30,7 @@ void copy_to_pam_dword(tpam_card *card, const void *addr, u32 val) {
 	       card->bar0 + TPAM_PAGE_REGISTER);
 
 	/* write the value */
-	writel(val, card->bar0 + (((u32)addr) & TPAM_PAGE_SIZE));
+	writel(val, card->bar0 + (((unsigned long)addr) & TPAM_PAGE_SIZE));
 }
 
 /*
@@ -125,7 +125,7 @@ void copy_from_pam(tpam_card *card, void *to, const void *from, u32 n) {
  *
  * Return: 0 if OK, <0 if error.
  */
-int copy_from_pam_to_user(tpam_card *card, void *to, const void *from, u32 n) {
+int copy_from_pam_to_user(tpam_card *card, void __user *to, const void *from, u32 n) {
 	void *page;
 	u32 count;
 
@@ -171,7 +171,7 @@ int copy_from_pam_to_user(tpam_card *card, void *to, const void *from, u32 n) {
  *
  * Return: 0 if OK, <0 if error.
  */
-int copy_from_user_to_pam(tpam_card *card, void *to, const void *from, u32 n) {
+int copy_from_user_to_pam(tpam_card *card, void *to, const void __user *from, u32 n) {
 	void *page;
 	u32 count;
 
diff --git a/drivers/macintosh/Kconfig b/drivers/macintosh/Kconfig
index 80b5a8200..f87ed8553 100644
--- a/drivers/macintosh/Kconfig
+++ b/drivers/macintosh/Kconfig
@@ -118,13 +118,6 @@ config PMAC_BACKLIGHT
 	  events; also, the PowerBook button device will be enabled so you can
 	  change the screen brightness.
 
-config MAC_FLOPPY
-	bool "Support for PowerMac floppy"
-	depends on PPC_PMAC && !PPC_PMAC64
-	help
-	  If you have a SWIM-3 (Super Woz Integrated Machine 3; from Apple)
-	  floppy controller, say Y here. Most commonly found in PowerMacs.
-
 config MAC_SERIAL
 	tristate "Support for PowerMac serial ports (OBSOLETE DRIVER)"
 	depends on PPC_PMAC && BROKEN
@@ -191,7 +184,7 @@ config THERM_PM72
 	  G5 machines. 
 
 config ANSLCD
-	bool "Support for ANS LCD display"
+	tristate "Support for ANS LCD display"
 	depends on ADB_CUDA && PPC_PMAC
 
 endmenu
diff --git a/drivers/macintosh/adb.c b/drivers/macintosh/adb.c
index 3d2357e50..b7cc2da37 100644
--- a/drivers/macintosh/adb.c
+++ b/drivers/macintosh/adb.c
@@ -139,10 +139,9 @@ static void printADBreply(struct adb_request *req)
 static __inline__ void adb_wait_ms(unsigned int ms)
 {
 	if (current->pid && adb_probe_task_pid &&
-	  adb_probe_task_pid == current->pid) {
-		set_task_state(current, TASK_UNINTERRUPTIBLE);
-		schedule_timeout(1 + ms * HZ / 1000);
-	} else
+	  adb_probe_task_pid == current->pid)
+		msleep(ms);
+	else
 		mdelay(ms);
 }
 
@@ -561,7 +560,7 @@ adb_unregister(int index)
 			write_lock_irq(&adb_handler_lock);
 		}
 		ret = 0;
-		adb_handler[index].handler = 0;
+		adb_handler[index].handler = NULL;
 	}
 	write_unlock_irq(&adb_handler_lock);
 	up(&adb_handler_sem);
diff --git a/drivers/macintosh/adbhid.c b/drivers/macintosh/adbhid.c
index 08d1dc4ca..c0ab8589b 100644
--- a/drivers/macintosh/adbhid.c
+++ b/drivers/macintosh/adbhid.c
@@ -102,7 +102,7 @@ struct adbhid {
 #define FLAG_POWER_FROM_FN	0x00000002
 #define FLAG_EMU_FWDEL_DOWN	0x00000004
 
-static struct adbhid *adbhid[16] = { 0 };
+static struct adbhid *adbhid[16];
 
 static void adbhid_probe(void);
 
@@ -689,7 +689,7 @@ static void adbhid_input_unregister(int id)
 	if (adbhid[id]->keycode)
 		kfree(adbhid[id]->keycode);
 	kfree(adbhid[id]);
-	adbhid[id] = 0;
+	adbhid[id] = NULL;
 }
 
 
diff --git a/drivers/macintosh/ans-lcd.c b/drivers/macintosh/ans-lcd.c
index c6073d342..0e130f598 100644
--- a/drivers/macintosh/ans-lcd.c
+++ b/drivers/macintosh/ans-lcd.c
@@ -49,10 +49,10 @@ anslcd_write_byte_data ( unsigned char c )
 }
 
 static ssize_t __pmac
-anslcd_write( struct file * file, const char * buf, 
+anslcd_write( struct file * file, const char __user * buf, 
 				size_t count, loff_t *ppos )
 {
-	const char * p = buf;
+	const char __user *p = buf;
 	int i;
 
 #ifdef DEBUG
@@ -75,7 +75,7 @@ static int __pmac
 anslcd_ioctl( struct inode * inode, struct file * file,
 				unsigned int cmd, unsigned long arg )
 {
-	char ch, *temp;
+	char ch, __user *temp;
 
 #ifdef DEBUG
 	printk(KERN_DEBUG "LCD: ioctl(%d,%d)\n",cmd,arg);
@@ -91,7 +91,7 @@ anslcd_ioctl( struct inode * inode, struct file * file,
 		anslcd_write_byte_ctrl ( 0x02 );
 		return 0;
 	case ANSLCD_SENDCTRL:
-		temp = (char *) arg;
+		temp = (char __user *) arg;
 		__get_user(ch, temp);
 		for (; ch; temp++) { /* FIXME: This is ugly, but should work, as a \0 byte is not a valid command code */
 			anslcd_write_byte_ctrl ( ch );
@@ -136,7 +136,7 @@ const char anslcd_logo[] =	"********************"  /* Line #1 */
 				"*    Welcome to    *"  /* Line #2 */
 				"********************"; /* Line #4 */
 
-int __init
+static int __init
 anslcd_init(void)
 {
 	int a;
@@ -173,5 +173,12 @@ anslcd_init(void)
 	return 0;
 }
 
-__initcall(anslcd_init);
+static void __exit
+anslcd_exit(void)
+{
+	misc_deregister(&anslcd_dev);
+	iounmap(anslcd_ptr);
+}
 
+module_init(anslcd_init);
+module_exit(anslcd_exit);
diff --git a/drivers/macintosh/macio-adb.c b/drivers/macintosh/macio-adb.c
index f8bc90fb4..5283a6d11 100644
--- a/drivers/macintosh/macio-adb.c
+++ b/drivers/macintosh/macio-adb.c
@@ -175,7 +175,7 @@ static int macio_send_request(struct adb_request *req, int sync)
 		req->data[i] = req->data[i+1];
 	--req->nbytes;
 	
-	req->next = 0;
+	req->next = NULL;
 	req->sent = 0;
 	req->complete = 0;
 	req->reply_len = 0;
@@ -280,6 +280,6 @@ static void macio_adb_poll(void)
 
 	local_irq_save(flags);
 	if (in_8(&adb->intr.r) != 0)
-		macio_adb_interrupt(0, 0, 0);
+		macio_adb_interrupt(0, NULL, NULL);
 	local_irq_restore(flags);
 }
diff --git a/drivers/macintosh/macserial.c b/drivers/macintosh/macserial.c
index 2ac2b9196..1d61a9af6 100644
--- a/drivers/macintosh/macserial.c
+++ b/drivers/macintosh/macserial.c
@@ -158,10 +158,6 @@ static void dma_init(struct mac_serial * info);
 static void rxdma_start(struct mac_serial * info, int current);
 static void rxdma_to_tty(struct mac_serial * info);
 
-#ifndef MIN
-#define MIN(a,b)	((a) < (b) ? (a) : (b))
-#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,
@@ -1485,9 +1481,8 @@ static int rs_write(struct tty_struct * tty, int from_user,
 	if (from_user) {
 		down(&tmp_buf_sem);
 		while (1) {
-			c = MIN(count,
-				MIN(SERIAL_XMIT_SIZE - info->xmit_cnt - 1,
-				    SERIAL_XMIT_SIZE - info->xmit_head));
+			c = min_t(int, count, min(SERIAL_XMIT_SIZE - info->xmit_cnt - 1,
+						  SERIAL_XMIT_SIZE - info->xmit_head));
 			if (c <= 0)
 				break;
 
@@ -1498,8 +1493,8 @@ static int rs_write(struct tty_struct * tty, int from_user,
 				break;
 			}
 			spin_lock_irqsave(&info->lock, flags);
-			c = MIN(c, MIN(SERIAL_XMIT_SIZE - info->xmit_cnt - 1,
-				       SERIAL_XMIT_SIZE - info->xmit_head));
+			c = min_t(int, c, min(SERIAL_XMIT_SIZE - info->xmit_cnt - 1,
+					      SERIAL_XMIT_SIZE - info->xmit_head));
 			memcpy(info->xmit_buf + info->xmit_head, tmp_buf, c);
 			info->xmit_head = ((info->xmit_head + c) &
 					   (SERIAL_XMIT_SIZE-1));
@@ -1513,9 +1508,8 @@ static int rs_write(struct tty_struct * tty, int from_user,
 	} else {
 		while (1) {
 			spin_lock_irqsave(&info->lock, flags);
-			c = MIN(count,
-				MIN(SERIAL_XMIT_SIZE - info->xmit_cnt - 1,
-				    SERIAL_XMIT_SIZE - info->xmit_head));
+			c = min_t(int, count, min(SERIAL_XMIT_SIZE - info->xmit_cnt - 1,
+						  SERIAL_XMIT_SIZE - info->xmit_head));
 			if (c <= 0) {
 				spin_unlock_irqrestore(&info->lock, flags);
 				break;
@@ -2052,7 +2046,7 @@ static void rs_wait_until_sent(struct tty_struct *tty, int timeout)
 	} else if (char_time == 0)
 		char_time = 1;
 	if (timeout)
-		char_time = MIN(char_time, timeout);
+		char_time = min_t(unsigned long, char_time, timeout);
 	while ((read_zsreg(info->zs_channel, 1) & ALL_SNT) == 0) {
 		current->state = TASK_INTERRUPTIBLE;
 		schedule_timeout(char_time);
diff --git a/drivers/macintosh/mediabay.c b/drivers/macintosh/mediabay.c
index 12132c0f9..aa0719775 100644
--- a/drivers/macintosh/mediabay.c
+++ b/drivers/macintosh/mediabay.c
@@ -435,6 +435,7 @@ int __pmac check_media_bay(struct device_node *which_bay, int what)
 #endif /* CONFIG_BLK_DEV_IDE */
 	return -ENODEV;
 }
+EXPORT_SYMBOL(check_media_bay);
 
 int __pmac check_media_bay_by_base(unsigned long base, int what)
 {
@@ -686,15 +687,13 @@ static int __devinit media_bay_attach(struct macio_dev *mdev, const struct of_ma
 
 	/* Force an immediate detect */
 	set_mb_power(bay, 0);
-	set_current_state(TASK_UNINTERRUPTIBLE);
-	schedule_timeout(MS_TO_HZ(MB_POWER_DELAY));
+	msleep(MB_POWER_DELAY);
 	bay->content_id = MB_NO;
 	bay->last_value = bay->ops->content(bay);
 	bay->value_count = MS_TO_HZ(MB_STABLE_DELAY);
 	bay->state = mb_empty;
 	do {
-		set_current_state(TASK_UNINTERRUPTIBLE);
-		schedule_timeout(MS_TO_HZ(MB_POLL_DELAY));
+		msleep(MB_POLL_DELAY);
 		media_bay_step(i);
 	} while((bay->state != mb_empty) &&
 		(bay->state != mb_up));
@@ -719,8 +718,7 @@ static int __pmac media_bay_suspend(struct macio_dev *mdev, u32 state)
 		bay->sleeping = 1;
 		set_mb_power(bay, 0);
 		up(&bay->lock);
-		set_current_state(TASK_UNINTERRUPTIBLE);
-		schedule_timeout(MS_TO_HZ(MB_POLL_DELAY));
+		msleep(MB_POLL_DELAY);
 		mdev->ofdev.dev.power_state = state;
 	}
 	return 0;
@@ -740,8 +738,7 @@ static int __pmac media_bay_resume(struct macio_dev *mdev)
 	       	/* Force MB power to 0 */
 		down(&bay->lock);
 	       	set_mb_power(bay, 0);
-		set_current_state(TASK_UNINTERRUPTIBLE);
-		schedule_timeout(MS_TO_HZ(MB_POWER_DELAY));
+		msleep(MB_POWER_DELAY);
 	       	if (bay->ops->content(bay) != bay->content_id) {
 			printk("mediabay%d: content changed during sleep...\n", bay->index);
 			up(&bay->lock);
@@ -755,8 +752,7 @@ static int __pmac media_bay_resume(struct macio_dev *mdev)
 	       	bay->cd_retry = 0;
 #endif
 	       	do {
-			set_current_state(TASK_UNINTERRUPTIBLE);
-			schedule_timeout(MS_TO_HZ(MB_POLL_DELAY));
+			msleep(MB_POLL_DELAY);
 	       		media_bay_step(bay->index);
 	       	} while((bay->state != mb_empty) &&
 	       		(bay->state != mb_up));
diff --git a/drivers/macintosh/therm_pm72.c b/drivers/macintosh/therm_pm72.c
index fb2e0707b..32333f27d 100644
--- a/drivers/macintosh/therm_pm72.c
+++ b/drivers/macintosh/therm_pm72.c
@@ -317,6 +317,20 @@ static int fan_write_reg(int reg, const unsigned char *ptr, int nb)
 	return nw;
 }
 
+static int start_fcu(void)
+{
+	unsigned char buf = 0xff;
+	int rc;
+
+	rc = fan_write_reg(0xe, &buf, 1);
+	if (rc < 0)
+		return -EIO;
+	rc = fan_write_reg(0x2e, &buf, 1);
+	if (rc < 0)
+		return -EIO;
+	return 0;
+}
+
 static int set_rpm_fan(int fan, int rpm)
 {
 	unsigned char buf[2];
@@ -1011,6 +1025,12 @@ static int main_control_loop(void *x)
 
 	down(&driver_lock);
 
+	if (start_fcu() < 0) {
+		printk(KERN_ERR "kfand: failed to start FCU\n");
+		up(&driver_lock);
+		goto out;
+	}
+
 	/* Set the PCI fan once for now */
 	set_pwm_fan(SLOTS_FAN_PWM_ID, SLOTS_FAN_DEFAULT_PWM);
 
@@ -1057,6 +1077,7 @@ static int main_control_loop(void *x)
 			schedule_timeout(HZ - elapsed);
 	}
 
+ out:
 	DBG("main_control_loop ended\n");
 
 	ctrl_task = 0;
diff --git a/drivers/macintosh/via-cuda.c b/drivers/macintosh/via-cuda.c
index f74f67540..70723139f 100644
--- a/drivers/macintosh/via-cuda.c
+++ b/drivers/macintosh/via-cuda.c
@@ -386,7 +386,7 @@ cuda_write(struct adb_request *req)
 	req->complete = 1;
 	return -EINVAL;
     }
-    req->next = 0;
+    req->next = NULL;
     req->sent = 0;
     req->complete = 0;
     req->reply_len = 0;
@@ -437,7 +437,7 @@ cuda_poll(void)
      * disable_irq(), would that work on m68k ? --BenH
      */
     local_irq_save(flags);
-    cuda_interrupt(0, 0, 0);
+    cuda_interrupt(0, NULL, NULL);
     local_irq_restore(flags);
 }
 
diff --git a/drivers/macintosh/via-pmu.c b/drivers/macintosh/via-pmu.c
index b9831678b..27e14a726 100644
--- a/drivers/macintosh/via-pmu.c
+++ b/drivers/macintosh/via-pmu.c
@@ -492,7 +492,7 @@ static int __init via_pmu_dev_init(void)
 	}
 #endif /* CONFIG_PMAC_PBOOK */
 	/* Create /proc/pmu */
-	proc_pmu_root = proc_mkdir("pmu", 0);
+	proc_pmu_root = proc_mkdir("pmu", NULL);
 	if (proc_pmu_root) {
 		int i;
 		proc_pmu_info = create_proc_read_entry("info", 0, proc_pmu_root,
@@ -549,7 +549,7 @@ init_pmu(void)
 		}
 		if (pmu_state == idle)
 			adb_int_pending = 1;
-		via_pmu_interrupt(0, 0, 0);
+		via_pmu_interrupt(0, NULL, NULL);
 		udelay(10);
 	}
 
@@ -1122,7 +1122,7 @@ pmu_queue_request(struct adb_request *req)
 		return -EINVAL;
 	}
 
-	req->next = 0;
+	req->next = NULL;
 	req->sent = 0;
 	req->complete = 0;
 
@@ -1225,7 +1225,7 @@ pmu_poll(void)
 		return;
 	if (disable_poll)
 		return;
-	via_pmu_interrupt(0, 0, 0);
+	via_pmu_interrupt(0, NULL, NULL);
 }
 
 void __openfirmware
@@ -1238,7 +1238,7 @@ pmu_poll_adb(void)
 	/* Kicks ADB read when PMU is suspended */
 	adb_int_pending = 1;
 	do {
-		via_pmu_interrupt(0, 0, 0);
+		via_pmu_interrupt(0, NULL, NULL);
 	} while (pmu_suspended && (adb_int_pending || pmu_state != idle
 		|| req_awaiting_reply));
 }
@@ -1249,7 +1249,7 @@ pmu_wait_complete(struct adb_request *req)
 	if (!via)
 		return;
 	while((pmu_state != idle && pmu_state != locked) || !req->complete)
-		via_pmu_interrupt(0, 0, 0);
+		via_pmu_interrupt(0, NULL, NULL);
 }
 
 /* This function loops until the PMU is idle and prevents it from
@@ -1278,7 +1278,7 @@ pmu_suspend(void)
 		spin_unlock_irqrestore(&pmu_lock, flags);
 		if (req_awaiting_reply)
 			adb_int_pending = 1;
-		via_pmu_interrupt(0, 0, 0);
+		via_pmu_interrupt(0, NULL, NULL);
 		spin_lock_irqsave(&pmu_lock, flags);
 		if (!adb_int_pending && pmu_state == idle && !req_awaiting_reply) {
 #ifdef SUSPEND_USES_PMU
@@ -1377,7 +1377,7 @@ next:
 				printk(KERN_ERR "PMU: extra ADB reply\n");
 				return;
 			}
-			req_awaiting_reply = 0;
+			req_awaiting_reply = NULL;
 			if (len <= 2)
 				req->reply_len = 0;
 			else {
@@ -1662,7 +1662,7 @@ gpio1_interrupt(int irq, void *arg, struct pt_regs *regs)
 		pmu_irq_stats[1]++;
 		adb_int_pending = 1;
 		spin_unlock_irqrestore(&pmu_lock, flags);
-		via_pmu_interrupt(0, 0, 0);
+		via_pmu_interrupt(0, NULL, NULL);
 		return IRQ_HANDLED;
 	}
 	return IRQ_NONE;
@@ -2071,7 +2071,7 @@ pmu_unregister_sleep_notifier(struct pmu_sleep_notifier* n)
 	if (n->list.next == 0)
 		return -ENOENT;
 	list_del(&n->list);
-	n->list.next = 0;
+	n->list.next = NULL;
 	return 0;
 }
 
@@ -2406,7 +2406,7 @@ pmac_wakeup_devices(void)
 
 	/* Force a poll of ADB interrupts */
 	adb_int_pending = 1;
-	via_pmu_interrupt(0, 0, 0);
+	via_pmu_interrupt(0, NULL, NULL);
 
 	/* Restart jiffies & scheduling */
 	wakeup_decrementer();
@@ -2857,7 +2857,7 @@ pmu_release(struct inode *inode, struct file *file)
 
 	lock_kernel();
 	if (pp != 0) {
-		file->private_data = 0;
+		file->private_data = NULL;
 		spin_lock_irqsave(&all_pvt_lock, flags);
 		list_del(&pp->list);
 		spin_unlock_irqrestore(&all_pvt_lock, flags);
@@ -2880,6 +2880,7 @@ pmu_ioctl(struct inode * inode, struct file *filp,
 		     u_int cmd, u_long arg)
 {
 	struct pmu_private *pp = filp->private_data;
+	__u32 __user *argp = (__u32 __user *)arg;
 	int error;
 
 	switch (cmd) {
@@ -2906,7 +2907,7 @@ pmu_ioctl(struct inode * inode, struct file *filp,
 		sleep_in_progress = 0;
 		return error;
 	case PMU_IOC_CAN_SLEEP:
-		return put_user((u32)can_sleep, (__u32 *)arg);
+		return put_user((u32)can_sleep, argp);
 
 #ifdef CONFIG_PMAC_BACKLIGHT
 	/* Backlight should have its own device or go via
@@ -2918,13 +2919,13 @@ pmu_ioctl(struct inode * inode, struct file *filp,
 		error = get_backlight_level();
 		if (error < 0)
 			return error;
-		return put_user(error, (__u32 *)arg);
+		return put_user(error, argp);
 	case PMU_IOC_SET_BACKLIGHT:
 	{
 		__u32 value;
 		if (sleep_in_progress)
 			return -EBUSY;
-		error = get_user(value, (__u32 *)arg);
+		error = get_user(value, argp);
 		if (!error)
 			error = set_backlight_level(value);
 		return error;
@@ -2943,9 +2944,9 @@ pmu_ioctl(struct inode * inode, struct file *filp,
 #endif /* CONFIG_INPUT_ADBHID */
 #endif /* CONFIG_PMAC_BACKLIGHT */
 	case PMU_IOC_GET_MODEL:
-	    	return put_user(pmu_kind, (__u32 *)arg);
+	    	return put_user(pmu_kind, argp);
 	case PMU_IOC_HAS_ADB:
-		return put_user(pmu_has_adb, (__u32 *)arg);
+		return put_user(pmu_has_adb, argp);
 	}
 	return -EINVAL;
 }
diff --git a/drivers/macintosh/via-pmu68k.c b/drivers/macintosh/via-pmu68k.c
index 6fc1fbab8..820dc52e3 100644
--- a/drivers/macintosh/via-pmu68k.c
+++ b/drivers/macintosh/via-pmu68k.c
@@ -177,7 +177,7 @@ static s8 pmu_data_len[256][2] = {
 /*f8*/	{-1,-1},{-1,-1},{-1,-1},{-1,-1},{-1,-1},{-1,-1},{-1,-1},{-1,-1},
 };
 
-int pmu_probe()
+int pmu_probe(void)
 {
 	if (macintosh_config->adb_type == MAC_ADB_PB1) {
 		pmu_kind = PMU_68K_V1;
@@ -521,7 +521,7 @@ send_byte(int x)
 }
 
 static void 
-recv_byte()
+recv_byte(void)
 {
 	char c;
 
@@ -531,7 +531,7 @@ recv_byte()
 }
 
 static void 
-pmu_start()
+pmu_start(void)
 {
 	unsigned long flags;
 	struct adb_request *req;
@@ -556,7 +556,7 @@ out:
 }
 
 void 
-pmu_poll()
+pmu_poll(void)
 {
 	unsigned long flags;
 
diff --git a/drivers/md/Kconfig b/drivers/md/Kconfig
index b9ae866f0..87261d37f 100644
--- a/drivers/md/Kconfig
+++ b/drivers/md/Kconfig
@@ -180,5 +180,25 @@ config DM_CRYPT
 
 	  If unsure, say N.
 
+config DM_SNAPSHOT
+       tristate "Snapshot target (EXPERIMENTAL)"
+       depends on BLK_DEV_DM && EXPERIMENTAL
+       ---help---
+         Allow volume managers to take writeable snapshots of a device.
+
+config DM_MIRROR
+       tristate "Mirror target (EXPERIMENTAL)"
+       depends on BLK_DEV_DM && EXPERIMENTAL
+       ---help---
+         Allow volume managers to mirror logical volumes, also
+         needed for live data migration tools such as 'pvmove'.
+
+config DM_ZERO
+	tristate "Zero target (EXPERIMENTAL)"
+	depends on BLK_DEV_DM && EXPERIMENTAL
+	---help---
+	  A target that discards writes, and returns all zeroes for
+	  reads.  Useful in some recovery situations.
+
 endmenu
 
diff --git a/drivers/md/Makefile b/drivers/md/Makefile
index 7b04d6349..c8feb8346 100644
--- a/drivers/md/Makefile
+++ b/drivers/md/Makefile
@@ -3,7 +3,9 @@
 #
 
 dm-mod-objs	:= dm.o dm-table.o dm-target.o dm-linear.o dm-stripe.o \
-		   dm-ioctl.o
+		   dm-ioctl.o dm-io.o kcopyd.o
+dm-snapshot-objs := dm-snap.o dm-exception-store.o
+dm-mirror-objs	:= dm-log.o dm-raid1.o
 raid6-objs	:= raid6main.o raid6algos.o raid6recov.o raid6tables.o \
 		   raid6int1.o raid6int2.o raid6int4.o \
 		   raid6int8.o raid6int16.o raid6int32.o \
@@ -24,6 +26,9 @@ obj-$(CONFIG_MD_MULTIPATH)	+= multipath.o
 obj-$(CONFIG_BLK_DEV_MD)	+= md.o
 obj-$(CONFIG_BLK_DEV_DM)	+= dm-mod.o
 obj-$(CONFIG_DM_CRYPT)		+= dm-crypt.o
+obj-$(CONFIG_DM_SNAPSHOT)	+= dm-snapshot.o
+obj-$(CONFIG_DM_MIRROR)		+= dm-mirror.o
+obj-$(CONFIG_DM_ZERO)		+= dm-zero.o
 
 quiet_cmd_unroll = UNROLL  $@
       cmd_unroll = $(PERL) $(srctree)/$(src)/unroll.pl $(UNROLL) \
diff --git a/drivers/md/dm-raid1.c b/drivers/md/dm-raid1.c
index 843e9b83d..92792bb7d 100644
--- a/drivers/md/dm-raid1.c
+++ b/drivers/md/dm-raid1.c
@@ -602,7 +602,7 @@ static int recover(struct mirror_set *ms, struct region *reg)
 {
 	int r;
 	unsigned int i;
-	struct io_region from, to[ms->nr_mirrors - 1], *dest;
+	struct io_region from, to[KCOPYD_MAX_REGIONS], *dest;
 	struct mirror *m;
 	unsigned long flags = 0;
 
@@ -757,7 +757,7 @@ static void write_callback(unsigned long error, void *context)
 static void do_write(struct mirror_set *ms, struct bio *bio)
 {
 	unsigned int i;
-	struct io_region io[ms->nr_mirrors];
+	struct io_region io[KCOPYD_MAX_REGIONS+1];
 	struct mirror *m;
 
 	for (i = 0; i < ms->nr_mirrors; i++) {
@@ -1028,7 +1028,7 @@ static int mirror_ctr(struct dm_target *ti, unsigned int argc, char **argv)
 	argc -= args_used;
 
 	if (!argc || sscanf(argv[0], "%u", &nr_mirrors) != 1 ||
-	    nr_mirrors < 2) {
+	    nr_mirrors < 2 || nr_mirrors > KCOPYD_MAX_REGIONS + 1) {
 		ti->error = "dm-mirror: Invalid number of mirrors";
 		dm_destroy_dirty_log(dl);
 		return -EINVAL;
diff --git a/drivers/md/dm-table.c b/drivers/md/dm-table.c
index 14cabe53f..d189f8549 100644
--- a/drivers/md/dm-table.c
+++ b/drivers/md/dm-table.c
@@ -400,7 +400,7 @@ static int upgrade_mode(struct dm_dev *dd, int new_mode)
 	struct dm_dev dd_copy;
 	dev_t dev = dd->bdev->bd_dev;
 
-	memcpy(&dd_copy, dd, sizeof(dd_copy));
+	dd_copy = *dd;
 
 	dd->mode |= new_mode;
 	dd->bdev = NULL;
@@ -408,7 +408,7 @@ static int upgrade_mode(struct dm_dev *dd, int new_mode)
 	if (!r)
 		close_dev(&dd_copy);
 	else
-		memcpy(dd, &dd_copy, sizeof(dd_copy));
+		*dd = dd_copy;
 
 	return r;
 }
diff --git a/drivers/md/dm.c b/drivers/md/dm.c
index 03381e003..01794ed39 100644
--- a/drivers/md/dm.c
+++ b/drivers/md/dm.c
@@ -17,11 +17,13 @@
 #include <linux/slab.h>
 
 static const char *_name = DM_NAME;
-#define MAX_DEVICES 1024
 
 static unsigned int major = 0;
 static unsigned int _major = 0;
 
+static int realloc_minor_bits(unsigned long requested_minor);
+static void free_minor_bits(void);
+
 /*
  * One of these is allocated per bio.
  */
@@ -111,11 +113,19 @@ static int __init local_init(void)
 		return -ENOMEM;
 	}
 
+	r = realloc_minor_bits(1024);
+	if (r < 0) {
+		kmem_cache_destroy(_tio_cache);
+		kmem_cache_destroy(_io_cache);
+		return r;
+	}
+
 	_major = major;
 	r = register_blkdev(_major, _name);
 	if (r < 0) {
 		kmem_cache_destroy(_tio_cache);
 		kmem_cache_destroy(_io_cache);
+		free_minor_bits();
 		return r;
 	}
 
@@ -129,6 +139,7 @@ static void local_exit(void)
 {
 	kmem_cache_destroy(_tio_cache);
 	kmem_cache_destroy(_io_cache);
+	free_minor_bits();
 
 	if (unregister_blkdev(_major, _name) < 0)
 		DMERR("devfs_unregister_blkdev failed");
@@ -394,7 +405,7 @@ static struct bio *split_bvec(struct bio *bio, sector_t sector,
 	struct bio_vec *bv = bio->bi_io_vec + idx;
 
 	clone = bio_alloc(GFP_NOIO, 1);
-	memcpy(clone->bi_io_vec, bv, sizeof(*bv));
+	*clone->bi_io_vec = *bv;
 
 	clone->bi_sector = sector;
 	clone->bi_bdev = bio->bi_bdev;
@@ -615,14 +626,58 @@ static int dm_any_congested(void *congested_data, int bdi_bits)
 /*-----------------------------------------------------------------
  * A bitset is used to keep track of allocated minor numbers.
  *---------------------------------------------------------------*/
-static spinlock_t _minor_lock = SPIN_LOCK_UNLOCKED;
-static unsigned long _minor_bits[MAX_DEVICES / BITS_PER_LONG];
+static DECLARE_MUTEX(_minor_lock);
+static unsigned long *_minor_bits = NULL;
+static unsigned long _max_minors = 0;
+
+#define MINORS_SIZE(minors) ((minors / BITS_PER_LONG) * sizeof(unsigned long))
+
+static int realloc_minor_bits(unsigned long requested_minor)
+{
+	unsigned long max_minors;
+	unsigned long *minor_bits, *tmp;
+
+	if (requested_minor < _max_minors)
+		return -EINVAL;
+
+	/* Round up the requested minor to the next power-of-2. */
+	max_minors = 1 << fls(requested_minor - 1);
+	if (max_minors > (1 << MINORBITS))
+		return -EINVAL;
+
+	minor_bits = kmalloc(MINORS_SIZE(max_minors), GFP_KERNEL);
+	if (!minor_bits)
+		return -ENOMEM;
+	memset(minor_bits, 0, MINORS_SIZE(max_minors));
+
+	/* Copy the existing bit-set to the new one. */
+	if (_minor_bits)
+		memcpy(minor_bits, _minor_bits, MINORS_SIZE(_max_minors));
+
+	tmp = _minor_bits;
+	_minor_bits = minor_bits;
+	_max_minors = max_minors;
+	if (tmp)
+		kfree(tmp);
+
+	return 0;
+}
+
+static void free_minor_bits(void)
+{
+	down(&_minor_lock);
+	kfree(_minor_bits);
+	_minor_bits = NULL;
+	_max_minors = 0;
+	up(&_minor_lock);
+}
 
 static void free_minor(unsigned int minor)
 {
-	spin_lock(&_minor_lock);
-	clear_bit(minor, _minor_bits);
-	spin_unlock(&_minor_lock);
+	down(&_minor_lock);
+	if (minor < _max_minors)
+		clear_bit(minor, _minor_bits);
+	up(&_minor_lock);
 }
 
 /*
@@ -630,37 +685,48 @@ static void free_minor(unsigned int minor)
  */
 static int specific_minor(unsigned int minor)
 {
-	int r = -EBUSY;
+	int r = 0;
 
-	if (minor >= MAX_DEVICES) {
-		DMWARN("request for a mapped_device beyond MAX_DEVICES (%d)",
-		       MAX_DEVICES);
+	if (minor > (1 << MINORBITS))
 		return -EINVAL;
+
+	down(&_minor_lock);
+	if (minor >= _max_minors) {
+		r = realloc_minor_bits(minor);
+		if (r) {
+			up(&_minor_lock);
+			return r;
+		}
 	}
 
-	spin_lock(&_minor_lock);
-	if (!test_and_set_bit(minor, _minor_bits))
-		r = 0;
-	spin_unlock(&_minor_lock);
+	if (test_and_set_bit(minor, _minor_bits))
+		r = -EBUSY;
+	up(&_minor_lock);
 
 	return r;
 }
 
 static int next_free_minor(unsigned int *minor)
 {
-	int r = -EBUSY;
+	int r;
 	unsigned int m;
 
-	spin_lock(&_minor_lock);
-	m = find_first_zero_bit(_minor_bits, MAX_DEVICES);
-	if (m != MAX_DEVICES) {
-		set_bit(m, _minor_bits);
-		*minor = m;
-		r = 0;
+	down(&_minor_lock);
+	m = find_first_zero_bit(_minor_bits, _max_minors);
+	if (m >= _max_minors) {
+		r = realloc_minor_bits(_max_minors * 2);
+		if (r) {
+			up(&_minor_lock);
+			return r;
+		}
+		m = find_first_zero_bit(_minor_bits, _max_minors);
 	}
-	spin_unlock(&_minor_lock);
 
-	return r;
+	set_bit(m, _minor_bits);
+	*minor = m;
+	up(&_minor_lock);
+
+	return 0;
 }
 
 static struct block_device_operations dm_blk_dops;
diff --git a/drivers/md/kcopyd.c b/drivers/md/kcopyd.c
index 40e46944e..f2961618b 100644
--- a/drivers/md/kcopyd.c
+++ b/drivers/md/kcopyd.c
@@ -24,9 +24,6 @@
 
 #include "kcopyd.h"
 
-/* FIXME: this is only needed for the DMERR macros */
-#include "dm.h"
-
 static struct workqueue_struct *_kcopyd_wq;
 static struct work_struct _kcopyd_work;
 
@@ -87,7 +84,7 @@ static int kcopyd_get_pages(struct kcopyd_client *kc,
 		;
 
 	kc->pages = pl->next;
-	pl->next = 0;
+	pl->next = NULL;
 
 	spin_unlock(&kc->lock);
 
@@ -576,12 +573,11 @@ int kcopyd_cancel(struct kcopyd_job *job, int block)
 static DECLARE_MUTEX(_client_lock);
 static LIST_HEAD(_clients);
 
-static int client_add(struct kcopyd_client *kc)
+static void client_add(struct kcopyd_client *kc)
 {
 	down(&_client_lock);
 	list_add(&kc->list, &_clients);
 	up(&_client_lock);
-	return 0;
 }
 
 static void client_del(struct kcopyd_client *kc)
@@ -671,15 +667,7 @@ int kcopyd_client_create(unsigned int nr_pages, struct kcopyd_client **result)
 		return r;
 	}
 
-	r = client_add(kc);
-	if (r) {
-		dm_io_put(nr_pages);
-		client_free_pages(kc);
-		kfree(kc);
-		kcopyd_exit();
-		return r;
-	}
-
+	client_add(kc);
 	*result = kc;
 	return 0;
 }
diff --git a/drivers/md/multipath.c b/drivers/md/multipath.c
index 3d8790135..a9df710da 100644
--- a/drivers/md/multipath.c
+++ b/drivers/md/multipath.c
@@ -120,7 +120,7 @@ int multipath_end_request(struct bio *bio, unsigned int bytes_done, int error)
 
 	if (uptodate)
 		multipath_end_bh_io(mp_bh, uptodate);
-	else {
+	else if ((bio->bi_rw & (1 << BIO_RW_AHEAD)) == 0) {
 		/*
 		 * oops, IO error:
 		 */
@@ -130,7 +130,8 @@ int multipath_end_request(struct bio *bio, unsigned int bytes_done, int error)
 		       bdevname(rdev->bdev,b), 
 		       (unsigned long long)bio->bi_sector);
 		multipath_reschedule_retry(mp_bh);
-	}
+	} else
+		multipath_end_bh_io(mp_bh, 0);
 	rdev_dec_pending(rdev, conf->mddev);
 	return 0;
 }
@@ -382,7 +383,11 @@ static void multipathd (mddev_t *mddev)
 				" to another IO path\n",
 				bdevname(bio->bi_bdev,b),
 				(unsigned long long)bio->bi_sector);
+			*bio = *(mp_bh->master_bio);
 			bio->bi_bdev = conf->multipaths[mp_bh->path].rdev->bdev;
+			bio->bi_rw |= (1 << BIO_RW_FAILFAST);
+			bio->bi_end_io = multipath_end_request;
+			bio->bi_private = mp_bh;
 			generic_make_request(bio);
 		}
 	}
diff --git a/drivers/md/raid1.c b/drivers/md/raid1.c
index 1b80c5b68..04b2aef4a 100644
--- a/drivers/md/raid1.c
+++ b/drivers/md/raid1.c
@@ -206,7 +206,7 @@ static int map(mddev_t *mddev, mdk_rdev_t **rdevp)
 			*rdevp = rdev;
 			atomic_inc(&rdev->nr_pending);
 			spin_unlock_irq(&conf->device_lock);
-			return 0;
+			return i;
 		}
 	}
 	spin_unlock_irq(&conf->device_lock);
@@ -376,7 +376,8 @@ static int read_balance(conf_t *conf, struct bio *bio, r1bio_t *r1_bio)
 	 * device if no resync is going on, or below the resync window.
 	 * We take the first readable disk when above the resync window.
 	 */
-	if (!conf->mddev->in_sync && (this_sector + sectors >= conf->next_resync)) {
+	if (conf->mddev->recovery_cp < MaxSector &&
+	    (this_sector + sectors >= conf->next_resync)) {
 		/* make sure that disk is operational */
 		new_disk = 0;
 
@@ -918,18 +919,22 @@ static void raid1d(mddev_t *mddev)
 
 		mddev = r1_bio->mddev;
 		conf = mddev_to_conf(mddev);
-		bio = r1_bio->master_bio;
 		if (test_bit(R1BIO_IsSync, &r1_bio->state)) {
 			sync_request_write(mddev, r1_bio);
 			unplug = 1;
 		} else {
-			if (map(mddev, &rdev) == -1) {
+			int disk;
+			bio = r1_bio->bios[r1_bio->read_disk];
+			if ((disk=map(mddev, &rdev)) == -1) {
 				printk(KERN_ALERT "raid1: %s: unrecoverable I/O"
 				       " read error for block %llu\n",
 				       bdevname(bio->bi_bdev,b),
 				       (unsigned long long)r1_bio->sector);
 				raid_end_bio_io(r1_bio);
 			} else {
+				r1_bio->bios[r1_bio->read_disk] = NULL;
+				r1_bio->read_disk = disk;
+				r1_bio->bios[r1_bio->read_disk] = bio;
 				printk(KERN_ERR "raid1: %s: redirecting sector %llu to"
 				       " another mirror\n",
 				       bdevname(rdev->bdev,b),
diff --git a/drivers/md/raid5.c b/drivers/md/raid5.c
index 773f9bfe7..b28f29005 100644
--- a/drivers/md/raid5.c
+++ b/drivers/md/raid5.c
@@ -55,7 +55,7 @@
  */
 #define RAID5_DEBUG	0
 #define RAID5_PARANOIA	1
-#if RAID5_PARANOIA && CONFIG_SMP
+#if RAID5_PARANOIA && defined(CONFIG_SMP)
 # define CHECK_DEVLOCK() if (!spin_is_locked(&conf->device_lock)) BUG()
 #else
 # define CHECK_DEVLOCK()
diff --git a/drivers/md/raid6main.c b/drivers/md/raid6main.c
index 714dfb2e1..1ad99be9c 100644
--- a/drivers/md/raid6main.c
+++ b/drivers/md/raid6main.c
@@ -61,7 +61,7 @@
 #define RAID6_DEBUG	0	/* Extremely verbose printk */
 #define RAID6_PARANOIA	1	/* Check spinlocks */
 #define RAID6_DUMPSTATE 0	/* Include stripe cache state in /proc/mdstat */
-#if RAID6_PARANOIA && CONFIG_SMP
+#if RAID6_PARANOIA && defined(CONFIG_SMP)
 # define CHECK_DEVLOCK() if (!spin_is_locked(&conf->device_lock)) BUG()
 #else
 # define CHECK_DEVLOCK()
diff --git a/drivers/md/xor.c b/drivers/md/xor.c
index e2103a8bb..324897c4b 100644
--- a/drivers/md/xor.c
+++ b/drivers/md/xor.c
@@ -108,29 +108,40 @@ calibrate_xor_block(void)
 	}
 	b2 = b1 + 2*PAGE_SIZE + BENCH_SIZE;
 
-	printk(KERN_INFO "raid5: measuring checksumming speed\n");
+	/*
+	 * If this arch/cpu has a short-circuited selection, don't loop through all
+	 * the possible functions, just test the best one
+	 */
+
+	fastest = NULL;
+
+#ifdef XOR_SELECT_TEMPLATE
+		fastest = XOR_SELECT_TEMPLATE(fastest);
+#endif
 
 #define xor_speed(templ)	do_xor_speed((templ), b1, b2)
 
-	XOR_TRY_TEMPLATES;
+	if (fastest) {
+		printk(KERN_INFO "raid5: automatically using best checksumming function: %s\n",
+			fastest->name);
+		xor_speed(fastest);
+	} else {
+		printk(KERN_INFO "raid5: measuring checksumming speed\n");
+		XOR_TRY_TEMPLATES;
+		fastest = template_list;
+		for (f = fastest; f; f = f->next)
+			if (f->speed > fastest->speed)
+				fastest = f;
+	}
+
+	printk("raid5: using function: %s (%d.%03d MB/sec)\n",
+	       fastest->name, fastest->speed / 1000, fastest->speed % 1000);
 
 #undef xor_speed
 
 	free_pages((unsigned long)b1, 2);
 
-	fastest = template_list;
-	for (f = fastest; f; f = f->next)
-		if (f->speed > fastest->speed)
-			fastest = f;
-
-#ifdef XOR_SELECT_TEMPLATE
-	fastest = XOR_SELECT_TEMPLATE(fastest);
-#endif
-
 	active_template = fastest;
-	printk("raid5: using function: %s (%d.%03d MB/sec)\n",
-	       fastest->name, fastest->speed / 1000, fastest->speed % 1000);
-
 	return 0;
 }
 
diff --git a/drivers/media/common/ir-common.c b/drivers/media/common/ir-common.c
index 7e9216051..2c007571a 100644
--- a/drivers/media/common/ir-common.c
+++ b/drivers/media/common/ir-common.c
@@ -75,6 +75,8 @@ IR_KEYTAB_TYPE ir_codes_rc5_tv[IR_KEYTAB_SIZE] = {
 	[ 0x35 ] = KEY_PLAY,            // play
 	[ 0x36 ] = KEY_STOP,            // stop
 	[ 0x37 ] = KEY_RECORD,          // recording
+	[ 0x3c ] = KEY_TEXT,            // teletext submode (Japan: 12)
+	[ 0x3d ] = KEY_SUSPEND,         // system standby
 
 #if 0 /* FIXME */
 	[ 0x0a ] = KEY_RESERVED,        // 1/2/3 digits (japan: 10)
@@ -106,8 +108,6 @@ IR_KEYTAB_TYPE ir_codes_rc5_tv[IR_KEYTAB_SIZE] = {
 	[ 0x39 ] = KEY_RESERVED,        // external 2
 	[ 0x3a ] = KEY_RESERVED,        // PIP display mode
 	[ 0x3b ] = KEY_RESERVED,        // view data mode / advance
-	[ 0x3c ] = KEY_RESERVED,        // teletext submode (Japan: 12)
-	[ 0x3d ] = KEY_RESERVED,        // system standby
 	[ 0x3e ] = KEY_RESERVED,        // crispener on/off
 	[ 0x3f ] = KEY_RESERVED,        // system select
 #endif
diff --git a/drivers/media/common/saa7146_fops.c b/drivers/media/common/saa7146_fops.c
index a61e91ac7..a5621d7ac 100644
--- a/drivers/media/common/saa7146_fops.c
+++ b/drivers/media/common/saa7146_fops.c
@@ -83,7 +83,7 @@ int saa7146_buffer_queue(struct saa7146_dev *dev,
 			 struct saa7146_dmaqueue *q,
 			 struct saa7146_buf *buf)
 {
-#if DEBUG_SPINLOCKS
+#ifdef DEBUG_SPINLOCKS
 	BUG_ON(!spin_is_locked(&dev->slock));
 #endif
 	DEB_EE(("dev:%p, dmaq:%p, buf:%p\n", dev, q, buf));
@@ -109,7 +109,7 @@ void saa7146_buffer_finish(struct saa7146_dev *dev,
 			   struct saa7146_dmaqueue *q,
 			   int state)
 {
-#if DEBUG_SPINLOCKS
+#ifdef DEBUG_SPINLOCKS
 	BUG_ON(!spin_is_locked(&dev->slock));
 #endif
 	if( NULL == q->curr ) {
@@ -145,7 +145,7 @@ void saa7146_buffer_next(struct saa7146_dev *dev,
 
 	DEB_INT(("dev:%p, dmaq:%p, vbi:%d\n", dev, q, vbi));
 
-#if DEBUG_SPINLOCKS
+#ifdef DEBUG_SPINLOCKS
 	BUG_ON(!spin_is_locked(&dev->slock));
 #endif
 	if (!list_empty(&q->queue)) {
diff --git a/drivers/media/common/saa7146_vbi.c b/drivers/media/common/saa7146_vbi.c
index 0a6c5d6a9..6c4f0bedd 100644
--- a/drivers/media/common/saa7146_vbi.c
+++ b/drivers/media/common/saa7146_vbi.c
@@ -459,7 +459,7 @@ static void vbi_irq_done(struct saa7146_dev *dev, unsigned long status)
 	spin_unlock(&dev->slock);
 }
 
-static ssize_t vbi_read(struct file *file, char *data, size_t count, loff_t *ppos)
+static ssize_t vbi_read(struct file *file, char __user *data, size_t count, loff_t *ppos)
 {
 	struct saa7146_fh *fh = file->private_data;
 	struct saa7146_dev *dev = fh->dev;
diff --git a/drivers/media/common/saa7146_video.c b/drivers/media/common/saa7146_video.c
index 93299758d..e89713195 100644
--- a/drivers/media/common/saa7146_video.c
+++ b/drivers/media/common/saa7146_video.c
@@ -1,9 +1,9 @@
 #include <media/saa7146_vv.h>
 
-static int memory = 32;
+static int max_memory = 32;
 
-MODULE_PARM(memory,"i");
-MODULE_PARM_DESC(memory, "maximum memory usage for capture buffers (default: 32Mb)");
+MODULE_PARM(max_memory,"i");
+MODULE_PARM_DESC(max_memory, "maximum memory usage for capture buffers (default: 32Mb)");
 
 #define IS_CAPTURE_ACTIVE(fh) \
 	(((vv->video_status & STATUS_CAPTURE) != 0) && (vv->video_fh == fh))
@@ -1331,9 +1331,9 @@ static int buffer_setup(struct file *file, unsigned int *count, unsigned int *si
 
 	*size = fh->video_fmt.sizeimage;
 
-	/* check if we exceed the "memory" parameter */
-	if( (*count * *size) > (memory*1048576) ) {
-		*count = (memory*1048576) / *size;
+	/* check if we exceed the "max_memory" parameter */
+	if( (*count * *size) > (max_memory*1048576) ) {
+		*count = (max_memory*1048576) / *size;
 	}
 	
 	DEB_CAP(("%d buffers, %d bytes each.\n",*count,*size));
@@ -1450,7 +1450,7 @@ static void video_irq_done(struct saa7146_dev *dev, unsigned long st)
 	spin_unlock(&dev->slock);
 }
 
-static ssize_t video_read(struct file *file, char *data, size_t count, loff_t *ppos)
+static ssize_t video_read(struct file *file, char __user *data, size_t count, loff_t *ppos)
 {
 	struct saa7146_fh *fh = file->private_data;
 	struct saa7146_dev *dev = fh->dev;
diff --git a/drivers/media/dvb/b2c2/Kconfig b/drivers/media/dvb/b2c2/Kconfig
index ebc6b5f9a..b3a45b4fc 100644
--- a/drivers/media/dvb/b2c2/Kconfig
+++ b/drivers/media/dvb/b2c2/Kconfig
@@ -1,6 +1,6 @@
 config DVB_B2C2_SKYSTAR
 	tristate "Technisat Skystar2 PCI"
-	depends on DVB_CORE
+	depends on DVB_CORE && PCI
 	help
 	  Support for the Skystar2 PCI DVB card by Technisat, which
 	  is equipped with the FlexCopII chipset by B2C2.
diff --git a/drivers/media/dvb/b2c2/skystar2.c b/drivers/media/dvb/b2c2/skystar2.c
index dc0c687a0..940f6a862 100644
--- a/drivers/media/dvb/b2c2/skystar2.c
+++ b/drivers/media/dvb/b2c2/skystar2.c
@@ -208,7 +208,7 @@ static int flex_i2c_write4(struct adapter *adapter, u32 device, u32 chip_addr, u
 
 	i2c_main_setup(device, chip_addr, 0, addr, buf[0], len, &command);
 
-	return i2c_main_write_for_flex2(adapter, command, 0, 100000);
+	return i2c_main_write_for_flex2(adapter, command, NULL, 100000);
 }
 
 static void fixchipaddr(u32 device, u32 bus, u32 addr, u32 *ret)
@@ -1681,7 +1681,7 @@ static void init_dma_queue(struct adapter *adapter)
 
 	adapter->dmaq1.head = 0;
 	adapter->dmaq1.tail = 0;
-	adapter->dmaq1.buffer = 0;
+	adapter->dmaq1.buffer = NULL;
 
 	adapter->dmaq1.buffer = pci_alloc_consistent(adapter->pdev, SIZE_OF_BUF_DMA1 + 0x80, &dma_addr);
 
@@ -1707,7 +1707,7 @@ static void init_dma_queue(struct adapter *adapter)
 
 	adapter->dmaq2.head = 0;
 	adapter->dmaq2.tail = 0;
-	adapter->dmaq2.buffer = 0;
+	adapter->dmaq2.buffer = NULL;
 
 	adapter->dmaq2.buffer = pci_alloc_consistent(adapter->pdev, SIZE_OF_BUF_DMA2 + 0x80, &dma_addr);
 
@@ -1738,7 +1738,7 @@ static void free_dma_queue(struct adapter *adapter)
 		adapter->dmaq1.head = 0;
 		adapter->dmaq1.tail = 0;
 		adapter->dmaq1.buffer_size = 0;
-		adapter->dmaq1.buffer = 0;
+		adapter->dmaq1.buffer = NULL;
 	}
 
 	if (adapter->dmaq2.buffer != 0) {
@@ -1748,7 +1748,7 @@ static void free_dma_queue(struct adapter *adapter)
 		adapter->dmaq2.head = 0;
 		adapter->dmaq2.tail = 0;
 		adapter->dmaq2.buffer_size = 0;
-		adapter->dmaq2.buffer = 0;
+		adapter->dmaq2.buffer = NULL;
 	}
 }
 
@@ -2272,7 +2272,7 @@ static int skystar2_probe(struct pci_dev *pdev, const struct pci_device_id *ent)
 	dvbdemux->feednum = N_PID_SLOTS;
 	dvbdemux->start_feed = dvb_start_feed;
 	dvbdemux->stop_feed = dvb_stop_feed;
-	dvbdemux->write_to_decoder = 0;
+	dvbdemux->write_to_decoder = NULL;
 	dvbdemux->dmx.capabilities = (DMX_TS_FILTERING | DMX_SECTION_FILTERING | DMX_MEMORY_BASED_FILTERING);
 
 	dvb_dmx_init(&adapter->demux);
diff --git a/drivers/media/dvb/bt8xx/dvb-bt8xx.c b/drivers/media/dvb/bt8xx/dvb-bt8xx.c
index 77a37cfc9..bd8323072 100644
--- a/drivers/media/dvb/bt8xx/dvb-bt8xx.c
+++ b/drivers/media/dvb/bt8xx/dvb-bt8xx.c
@@ -205,7 +205,7 @@ static struct dvb_bt8xx_card *dvb_bt8xx_find_by_pci(struct i2c_adapter *adap)
 	if (NULL == dev) {
 		/* shoudn't happen with 2.6.0-test7 + newer */
 		printk("attach: Huh? i2c adapter not in sysfs tree?\n");
-		return 0;
+		return NULL;
 	}
 	pci = to_pci_dev(dev);
 	list_for_each(item, &card_list) {
diff --git a/drivers/media/dvb/dvb-core/dmxdev.c b/drivers/media/dvb/dvb-core/dmxdev.c
index 4a780e55e..1d685f6bc 100644
--- a/drivers/media/dvb/dvb-core/dmxdev.c
+++ b/drivers/media/dvb/dvb-core/dmxdev.c
@@ -54,7 +54,7 @@ dvb_dmxdev_file_to_dvr(struct dmxdev *dmxdev, struct file *file)
 
 static inline void dvb_dmxdev_buffer_init(struct dmxdev_buffer *buffer) 
 {
-	buffer->data=0;
+	buffer->data=NULL;
 	buffer->size=8192;
 	buffer->pread=0;
 	buffer->pwrite=0;
@@ -97,7 +97,7 @@ static inline int dvb_dmxdev_buffer_write(struct dmxdev_buffer *buf, const u8 *s
 }
 
 static ssize_t dvb_dmxdev_buffer_read(struct dmxdev_buffer *src,
-		int non_blocking, char *buf, size_t count, loff_t *ppos)
+		int non_blocking, char __user *buf, size_t count, loff_t *ppos)
 {
 	unsigned long todo=count;
 	int split, avail, error;
@@ -162,12 +162,12 @@ static struct dmx_frontend * get_fe(struct dmx_demux *demux, int type)
 
 	head=demux->get_frontends(demux);
 	if (!head)
-		return 0;
+		return NULL;
 	list_for_each(pos, head)
 		if (DMX_FE_ENTRY(pos)->source==type)
 			return DMX_FE_ENTRY(pos);
 	
-	return 0;
+	return NULL;
 }
 
 static inline void dvb_dmxdev_dvr_state_set(struct dmxdev_dvr *dmxdevdvr, int state)
@@ -244,7 +244,7 @@ static int dvb_dvr_release(struct inode *inode, struct file *file)
 			void *mem=dmxdev->dvr_buffer.data;
 			mb();
 			spin_lock_irq(&dmxdev->lock);
-			dmxdev->dvr_buffer.data=0;
+			dmxdev->dvr_buffer.data=NULL;
 			spin_unlock_irq(&dmxdev->lock);
 			vfree(mem);
 		}
@@ -253,7 +253,7 @@ static int dvb_dvr_release(struct inode *inode, struct file *file)
 	return 0;
 }
 
-static ssize_t dvb_dvr_write(struct file *file, const char *buf,
+static ssize_t dvb_dvr_write(struct file *file, const char __user *buf,
 		size_t count, loff_t *ppos)
 {
 	struct dvb_device *dvbdev=(struct dvb_device *) file->private_data;
@@ -271,7 +271,7 @@ static ssize_t dvb_dvr_write(struct file *file, const char *buf,
 	return ret;
 }
 
-static ssize_t dvb_dvr_read(struct file *file, char *buf, size_t count,
+static ssize_t dvb_dvr_read(struct file *file, char __user *buf, size_t count,
 		loff_t *ppos)
 {
 	struct dvb_device *dvbdev=(struct dvb_device *) file->private_data;
@@ -304,7 +304,7 @@ static int dvb_dmxdev_set_buffer_size(struct dmxdev_filter *dmxdevfilter, unsign
 		return -EBUSY;
 	spin_lock_irq(&dmxdevfilter->dev->lock);
 	mem=buf->data;
-	buf->data=0;
+	buf->data=NULL;
 	buf->size=size;
 	buf->pwrite=buf->pread=0;    
 	spin_unlock_irq(&dmxdevfilter->dev->lock);
@@ -497,7 +497,7 @@ static int dvb_dmxdev_filter_stop(struct dmxdev_filter *dmxdevfilter)
 				release_filter(dmxdevfilter->feed.sec,
 					       dmxdevfilter->filter.sec);
 		dvb_dmxdev_feed_restart(dmxdevfilter);
-		dmxdevfilter->feed.sec=0;
+		dmxdevfilter->feed.sec=NULL;
 		break;
 	case DMXDEV_TYPE_PES:
 		if (!dmxdevfilter->feed.ts)
@@ -506,7 +506,7 @@ static int dvb_dmxdev_filter_stop(struct dmxdev_filter *dmxdevfilter)
 		dmxdevfilter->dev->demux->
 			release_ts_feed(dmxdevfilter->dev->demux,
 					dmxdevfilter->feed.ts);
-		dmxdevfilter->feed.ts=0;
+		dmxdevfilter->feed.ts=NULL;
 		break;
 	default:
 		if (dmxdevfilter->state==DMXDEV_STATE_ALLOCATED) 
@@ -558,8 +558,8 @@ static int dvb_dmxdev_filter_start(struct dmxdev_filter *filter)
 		struct dmx_section_filter **secfilter=&filter->filter.sec;
 		struct dmx_section_feed **secfeed=&filter->feed.sec;
 
-		*secfilter=0;
-		*secfeed=0;
+		*secfilter=NULL;
+		*secfeed=NULL;
 
 		/* find active filter/feed with same PID */
 		for (i=0; i<dmxdev->filternum; i++) {
@@ -640,7 +640,7 @@ static int dvb_dmxdev_filter_start(struct dmxdev_filter *filter)
 		enum dmx_ts_pes ts_pes;
 		struct dmx_ts_feed **tsfeed = &filter->feed.ts;
 		
-		filter->feed.ts = 0;
+		filter->feed.ts = NULL;
 		otype=para->output;
 		
 		ts_pes=(enum dmx_ts_pes) para->pes_type;
@@ -717,7 +717,7 @@ static int dvb_demux_open(struct inode *inode, struct file *file)
 	dvb_dmxdev_buffer_init(&dmxdevfilter->buffer);
 	dmxdevfilter->type=DMXDEV_TYPE_NONE;
 	dvb_dmxdev_filter_state_set(dmxdevfilter, DMXDEV_STATE_ALLOCATED);
-	dmxdevfilter->feed.ts=0;
+	dmxdevfilter->feed.ts=NULL;
 	init_timer(&dmxdevfilter->timer);
 
 	up(&dmxdev->mutex);
@@ -742,7 +742,7 @@ static int dvb_dmxdev_filter_free(struct dmxdev *dmxdev, struct dmxdev_filter *d
 		void *mem=dmxdevfilter->buffer.data;
 		
 		spin_lock_irq(&dmxdev->lock);
-		dmxdevfilter->buffer.data=0;
+		dmxdevfilter->buffer.data=NULL;
 		spin_unlock_irq(&dmxdev->lock);
 		vfree(mem);
 	}
@@ -806,7 +806,7 @@ static int dvb_dmxdev_pes_filter_set(struct dmxdev *dmxdev,
 }
 
 static ssize_t dvb_dmxdev_read_sec(struct dmxdev_filter *dfil,
-		struct file *file, char *buf, size_t count, loff_t *ppos)
+		struct file *file, char __user *buf, size_t count, loff_t *ppos)
 {
 	int result, hcount;
 	int done=0;
@@ -845,7 +845,7 @@ static ssize_t dvb_dmxdev_read_sec(struct dmxdev_filter *dfil,
 
 
 ssize_t 
-dvb_demux_read(struct file *file, char *buf, size_t count, loff_t *ppos)
+dvb_demux_read(struct file *file, char __user *buf, size_t count, loff_t *ppos)
 {
 	struct dmxdev_filter *dmxdevfilter=dvb_dmxdev_file_to_filter(file);
 	int ret=0;
@@ -1006,7 +1006,7 @@ static struct file_operations dvb_demux_fops = {
 };
 
 static struct dvb_device dvbdev_demux = {
-	.priv		= 0,
+	.priv		= NULL,
 	.users		= 1,
 	.writers	= 1,
 	.fops		= &dvb_demux_fops
@@ -1077,7 +1077,7 @@ static struct file_operations dvb_dvr_fops = {
 };
 
 static struct dvb_device dvbdev_dvr = {
-	.priv		= 0,
+	.priv		= NULL,
 	.users		= 1,
 	.writers	= 1,
 	.fops		= &dvb_dvr_fops
@@ -1106,10 +1106,10 @@ dvb_dmxdev_init(struct dmxdev *dmxdev, struct dvb_adapter *dvb_adapter)
 	spin_lock_init(&dmxdev->lock);
 	for (i=0; i<dmxdev->filternum; i++) {
 		dmxdev->filter[i].dev=dmxdev;
-		dmxdev->filter[i].buffer.data=0;
+		dmxdev->filter[i].buffer.data=NULL;
 		dvb_dmxdev_filter_state_set(&dmxdev->filter[i], DMXDEV_STATE_FREE);
 		dmxdev->dvr[i].dev=dmxdev;
-		dmxdev->dvr[i].buffer.data=0;
+		dmxdev->dvr[i].buffer.data=NULL;
 		dvb_dmxdev_filter_state_set(&dmxdev->filter[i], DMXDEV_STATE_FREE);
 		dvb_dmxdev_dvr_state_set(&dmxdev->dvr[i], DMXDEV_STATE_FREE);
 	}
@@ -1128,11 +1128,11 @@ dvb_dmxdev_release(struct dmxdev *dmxdev)
 	dvb_unregister_device(dmxdev->dvr_dvbdev);
 	if (dmxdev->filter) {
 		vfree(dmxdev->filter);
-		dmxdev->filter=0;
+		dmxdev->filter=NULL;
 	}
 	if (dmxdev->dvr) {
 		vfree(dmxdev->dvr);
-		dmxdev->dvr=0;
+		dmxdev->dvr=NULL;
 	}
 	dmxdev->demux->close(dmxdev->demux);
 }
diff --git a/drivers/media/dvb/dvb-core/dvb_ca_en50221.c b/drivers/media/dvb/dvb-core/dvb_ca_en50221.c
index 88ed3b92c..a4c3794a1 100644
--- a/drivers/media/dvb/dvb-core/dvb_ca_en50221.c
+++ b/drivers/media/dvb/dvb-core/dvb_ca_en50221.c
@@ -621,7 +621,7 @@ static int dvb_ca_en50221_read_data(struct dvb_ca_private* ca, int slot, u8* ebu
 
         /* OK, add it to the receive buffer, or copy into external buffer if supplied */
         if (ebuf == NULL) {
-                dvb_ringbuffer_pkt_write(&ca->slot_info[slot].rx_buffer, buf, bytes_read, 0);
+                dvb_ringbuffer_pkt_write(&ca->slot_info[slot].rx_buffer, buf, bytes_read);
         } else {
                 memcpy(ebuf, buf, bytes_read);
         }
@@ -1188,7 +1188,7 @@ static int dvb_ca_en50221_io_ioctl(struct inode *inode, struct file *file, unsig
  *
  * @return Number of bytes read, or <0 on error.
  */
-static ssize_t dvb_ca_en50221_io_write(struct file *file, const char *buf, size_t count, loff_t *ppos)
+static ssize_t dvb_ca_en50221_io_write(struct file *file, const char __user *buf, size_t count, loff_t *ppos)
 {
         struct dvb_device *dvbdev=(struct dvb_device *) file->private_data;
         struct dvb_ca_private *ca=(struct dvb_ca_private*) dvbdev->priv;
@@ -1303,7 +1303,7 @@ nextslot:
  *
  * @return Number of bytes read, or <0 on error.
  */
-static ssize_t dvb_ca_en50221_io_read(struct file *file, char *buf, size_t count, loff_t *ppos)
+static ssize_t dvb_ca_en50221_io_read(struct file *file, char __user *buf, size_t count, loff_t *ppos)
 {
         struct dvb_device *dvbdev=(struct dvb_device *) file->private_data;
         struct dvb_ca_private *ca=(struct dvb_ca_private*) dvbdev->priv;
@@ -1494,7 +1494,7 @@ static struct file_operations dvb_ca_fops = {
 };
 
 static struct dvb_device dvbdev_ca = {
-        priv: 0,
+        priv: NULL,
         users: 1,
         readers: 1,
         writers: 1,
diff --git a/drivers/media/dvb/dvb-core/dvb_demux.c b/drivers/media/dvb/dvb-core/dvb_demux.c
index ad096f121..657d5579b 100644
--- a/drivers/media/dvb/dvb-core/dvb_demux.c
+++ b/drivers/media/dvb/dvb-core/dvb_demux.c
@@ -160,7 +160,7 @@ static inline int dvb_dmx_swfilter_payload (struct dvb_demux_feed *feed, const u
 
 	feed->peslen += count;
 
-	return feed->cb.ts (&buf[p], count, 0, 0, &feed->feed.ts, DMX_OK); 
+	return feed->cb.ts (&buf[p], count, NULL, 0, &feed->feed.ts, DMX_OK); 
 }
 
 
@@ -179,11 +179,11 @@ static int dvb_dmx_swfilter_sectionfilter (struct dvb_demux_feed *feed,
 		neq |= f->maskandnotmode[i] & xor;
 	}
 
-	if (f->doneq & !neq)
+	if (f->doneq && !neq)
 		return 0;
 
 	return feed->cb.sec (feed->feed.sec.secbuf, feed->feed.sec.seclen, 
-			     0, 0, &f->filter, DMX_OK); 
+			     NULL, 0, &f->filter, DMX_OK); 
 }
 
 
@@ -373,7 +373,7 @@ static inline void dvb_dmx_swfilter_packet_type(struct dvb_demux_feed *feed, con
 			if (feed->ts_type & TS_PAYLOAD_ONLY)
 				dvb_dmx_swfilter_payload(feed, buf);
 			else
-				feed->cb.ts(buf, 188, 0, 0, &feed->feed.ts, DMX_OK); 
+				feed->cb.ts(buf, 188, NULL, 0, &feed->feed.ts, DMX_OK); 
 		}
 		if (feed->ts_type & TS_DECODER) 
 			if (feed->demux->write_to_decoder)
@@ -422,7 +422,7 @@ void dvb_dmx_swfilter_packet(struct dvb_demux *demux, const u8 *buf)
 		}
 
 		if (feed->pid == 0x2000)
-			feed->cb.ts(buf, 188, 0, 0, &feed->feed.ts, DMX_OK);
+			feed->cb.ts(buf, 188, NULL, 0, &feed->feed.ts, DMX_OK);
 	}
 }
 
@@ -637,7 +637,7 @@ static int dmx_ts_feed_set (struct dmx_ts_feed* ts_feed, u16 pid, int ts_type,
 
 	if (feed->buffer_size) {
 #ifdef NOBUFS
-		feed->buffer=0;
+		feed->buffer=NULL;
 #else
 		feed->buffer = vmalloc(feed->buffer_size);
 		if (!feed->buffer) {
@@ -736,11 +736,11 @@ static int dvbdmx_allocate_ts_feed (struct dmx_demux *dmx, struct dmx_ts_feed **
 	feed->demux = demux;
 	feed->pid = 0xffff;
 	feed->peslen = 0xfffa;
-	feed->buffer = 0;
+	feed->buffer = NULL;
 
 	(*ts_feed) = &feed->feed.ts;
 	(*ts_feed)->parent = dmx;
-	(*ts_feed)->priv = 0;
+	(*ts_feed)->priv = NULL;
 	(*ts_feed)->is_filtering = 0;
 	(*ts_feed)->start_filtering = dmx_ts_feed_start_filtering;
 	(*ts_feed)->stop_filtering = dmx_ts_feed_stop_filtering;
@@ -820,7 +820,7 @@ static int dmx_section_feed_allocate_filter(struct dmx_section_feed* feed,
 	spin_lock_irq(&dvbdemux->lock);
 	*filter=&dvbdmxfilter->filter;
 	(*filter)->parent=feed;
-	(*filter)->priv=0;
+	(*filter)->priv=NULL;
 	dvbdmxfilter->feed=dvbdmxfeed;
 	dvbdmxfilter->type=DMX_TYPE_SEC;
 	dvbdmxfilter->state=DMX_STATE_READY;
@@ -858,7 +858,7 @@ static int dmx_section_feed_set(struct dmx_section_feed* feed,
 
 	dvbdmxfeed->feed.sec.check_crc=check_crc;
 #ifdef NOBUFS
-	dvbdmxfeed->buffer=0;
+	dvbdmxfeed->buffer=NULL;
 #else
 	dvbdmxfeed->buffer=vmalloc(dvbdmxfeed->buffer_size);
 	if (!dvbdmxfeed->buffer) {
@@ -1015,13 +1015,13 @@ static int dvbdmx_allocate_section_feed(struct dmx_demux *demux,
 	dvbdmxfeed->feed.sec.secbuf = dvbdmxfeed->feed.sec.secbuf_base;
 	dvbdmxfeed->feed.sec.secbufp = dvbdmxfeed->feed.sec.seclen = 0;
 	dvbdmxfeed->feed.sec.tsfeedp = 0;
-	dvbdmxfeed->filter=0;
-	dvbdmxfeed->buffer=0;
+	dvbdmxfeed->filter=NULL;
+	dvbdmxfeed->buffer=NULL;
 
 	(*feed)=&dvbdmxfeed->feed.sec;
 	(*feed)->is_filtering=0;
 	(*feed)->parent=demux;
-	(*feed)->priv=0;
+	(*feed)->priv=NULL;
 
 	(*feed)->set=dmx_section_feed_set;
 	(*feed)->allocate_filter=dmx_section_feed_allocate_filter;
@@ -1223,7 +1223,7 @@ int dvb_dmx_init(struct dvb_demux *dvbdemux)
 	 if (!dvbdemux->memcopy)
 		 dvbdemux->memcopy = dvb_dmx_memcopy;
 
-	dmx->frontend=0;
+	dmx->frontend=NULL;
 	dmx->reg_list.prev = dmx->reg_list.next = &dmx->reg_list;
 	dmx->priv=(void *) dvbdemux;
 	dmx->open=dvbdmx_open;
diff --git a/drivers/media/dvb/dvb-core/dvb_functions.c b/drivers/media/dvb/dvb-core/dvb_functions.c
index d608fdbb1..2a39b2ef9 100644
--- a/drivers/media/dvb/dvb-core/dvb_functions.c
+++ b/drivers/media/dvb/dvb-core/dvb_functions.c
@@ -36,7 +36,11 @@ int dvb_usercopy(struct inode *inode, struct file *file,
         /*  Copy arguments into temp kernel buffer  */
         switch (_IOC_DIR(cmd)) {
         case _IOC_NONE:
-                parg = (void *)arg;
+		/*
+		 * For this command, the pointer is actually an integer
+		 * argument.
+		 */
+                parg = (void *) arg;
                 break;
         case _IOC_READ: /* some v4l ioctls are marked wrong ... */
         case _IOC_WRITE:
@@ -52,7 +56,7 @@ int dvb_usercopy(struct inode *inode, struct file *file,
                 }
 
                 err = -EFAULT;
-                if (copy_from_user(parg, (void *)arg, _IOC_SIZE(cmd)))
+                if (copy_from_user(parg, (void __user *)arg, _IOC_SIZE(cmd)))
                         goto out;
                 break;
         }
@@ -69,7 +73,7 @@ int dvb_usercopy(struct inode *inode, struct file *file,
         {
         case _IOC_READ:
         case (_IOC_WRITE | _IOC_READ):
-                if (copy_to_user((void *)arg, parg, _IOC_SIZE(cmd)))
+                if (copy_to_user((void __user *)arg, parg, _IOC_SIZE(cmd)))
                         err = -EFAULT;
                 break;
         }
diff --git a/drivers/media/dvb/dvb-core/dvb_i2c.c b/drivers/media/dvb/dvb-core/dvb_i2c.c
index fd4989f4f..8bc8b5e7b 100644
--- a/drivers/media/dvb/dvb-core/dvb_i2c.c
+++ b/drivers/media/dvb/dvb-core/dvb_i2c.c
@@ -191,8 +191,10 @@ dvb_register_i2c_bus (int (*xfer) (struct dvb_i2c_bus *i2c,
 	if (down_interruptible (&dvb_i2c_mutex))
 		return NULL;
 
-	if (!(i2c = kmalloc (sizeof (struct dvb_i2c_bus), GFP_KERNEL)))
+	if (!(i2c = kmalloc (sizeof (struct dvb_i2c_bus), GFP_KERNEL))) {
+		up (&dvb_i2c_mutex);
 		return NULL;
+	}
 
 	INIT_LIST_HEAD(&i2c->list_head);
 	INIT_LIST_HEAD(&i2c->client_list);
@@ -239,8 +241,10 @@ int dvb_register_i2c_device (struct module *owner,
 	if (down_interruptible (&dvb_i2c_mutex))
 		return -ERESTARTSYS;
 
-	if (!(entry = kmalloc (sizeof (struct dvb_i2c_device), GFP_KERNEL)))
+	if (!(entry = kmalloc (sizeof (struct dvb_i2c_device), GFP_KERNEL))) {
+		up(&dvb_i2c_mutex);
 		return -ENOMEM;
+	}
 
 	entry->owner = owner;
 	entry->attach = attach;
diff --git a/drivers/media/dvb/dvb-core/dvb_net.c b/drivers/media/dvb/dvb-core/dvb_net.c
index e77dd2dd7..dfa5be4e2 100644
--- a/drivers/media/dvb/dvb-core/dvb_net.c
+++ b/drivers/media/dvb/dvb-core/dvb_net.c
@@ -43,7 +43,7 @@
 #include "dvb_functions.h"
 
 
-static inline __u32 iov_crc32( __u32 c, struct iovec *iov, unsigned int cnt )
+static inline __u32 iov_crc32( __u32 c, struct kvec *iov, unsigned int cnt )
 {
 	unsigned int j;
 	for (j = 0; j < cnt; j++)
@@ -481,7 +481,7 @@ static void dvb_net_ule( struct net_device *dev, const u8 *buf, size_t buf_len )
 			/* Check CRC32, we've got it in our skb already. */
 			unsigned short ulen = htons(priv->ule_sndu_len);
 			unsigned short utype = htons(priv->ule_sndu_type);
-			struct iovec iov[4] = {
+			struct kvec iov[4] = {
 				{ &ulen, sizeof ulen },
 				{ &utype, sizeof utype },
 				{ NULL, 0 },
@@ -677,7 +677,7 @@ static int dvb_net_filter_sec_set(struct net_device *dev,
 	struct dvb_net_priv *priv = (struct dvb_net_priv*) dev->priv;
 	int ret;
 
-	*secfilter=0;
+	*secfilter=NULL;
 	ret = priv->secfeed->allocate_filter(priv->secfeed, secfilter);
 	if (ret<0) {
 		printk("%s: could not get filter\n", dev->name);
@@ -726,9 +726,9 @@ static int dvb_net_feed_start(struct net_device *dev)
 	if (priv->secfeed || priv->secfilter || priv->multi_secfilter[0])
 		printk("%s: BUG %d\n", __FUNCTION__, __LINE__);
 
-	priv->secfeed=0;
-	priv->secfilter=0;
-	priv->tsfeed = 0;
+	priv->secfeed=NULL;
+	priv->secfilter=NULL;
+	priv->tsfeed = NULL;
 
 	if (priv->feedtype == DVB_NET_FEEDTYPE_MPE) {
 	dprintk("%s: alloc secfeed\n", __FUNCTION__);
@@ -744,7 +744,7 @@ static int dvb_net_feed_start(struct net_device *dev)
 	if (ret<0) {
 		printk("%s: could not set section feed\n", dev->name);
 		priv->demux->release_section_feed(priv->demux, priv->secfeed);
-		priv->secfeed=0;
+		priv->secfeed=NULL;
 		return ret;
 	}
 
@@ -799,7 +799,7 @@ static int dvb_net_feed_start(struct net_device *dev)
 		if (ret < 0) {
 			printk("%s: could not set ts feed\n", dev->name);
 			priv->demux->release_ts_feed(priv->demux, priv->tsfeed);
-			priv->tsfeed = 0;
+			priv->tsfeed = NULL;
 			return ret;
 		}
 
@@ -828,7 +828,7 @@ static int dvb_net_feed_stop(struct net_device *dev)
 			dprintk("%s: release secfilter\n", __FUNCTION__);
 			priv->secfeed->release_filter(priv->secfeed,
 					       priv->secfilter);
-		priv->secfilter=0;
+		priv->secfilter=NULL;
 		}
 
 		for (i=0; i<priv->multi_num; i++) {
@@ -837,12 +837,12 @@ static int dvb_net_feed_stop(struct net_device *dev)
 						__FUNCTION__, i);
 				priv->secfeed->release_filter(priv->secfeed,
 						       priv->multi_secfilter[i]);
-			priv->multi_secfilter[i]=0;
+			priv->multi_secfilter[i]=NULL;
 		}
 		}
 
 		priv->demux->release_section_feed(priv->demux, priv->secfeed);
-		priv->secfeed=0;
+		priv->secfeed=NULL;
 	} else
 		printk("%s: no feed to stop\n", dev->name);
 	} else if (priv->feedtype == DVB_NET_FEEDTYPE_ULE) {
@@ -852,7 +852,7 @@ static int dvb_net_feed_stop(struct net_device *dev)
 				priv->tsfeed->stop_filtering(priv->tsfeed);
 			}
 			priv->demux->release_ts_feed(priv->demux, priv->tsfeed);
-			priv->tsfeed = 0;
+			priv->tsfeed = NULL;
 		}
 		else
 			printk("%s: no ts feed to stop\n", dev->name);
@@ -1178,16 +1178,13 @@ static int dvb_net_ioctl(struct inode *inode, struct file *file,
 
 static struct file_operations dvb_net_fops = {
 	.owner = THIS_MODULE,
-        .read =	0,
-	.write = 0,
 	.ioctl = dvb_net_ioctl,
 	.open =	dvb_generic_open,
 	.release = dvb_generic_release,
-	.poll =	0,
 };
 
 static struct dvb_device dvbdev_net = {
-        .priv = 0,
+        .priv = NULL,
         .users = 1,
         .writers = 1,
         .fops = &dvb_net_fops,
diff --git a/drivers/media/dvb/dvb-core/dvb_ringbuffer.c b/drivers/media/dvb/dvb-core/dvb_ringbuffer.c
index b8bc3e6c4..fd04a1f3f 100644
--- a/drivers/media/dvb/dvb-core/dvb_ringbuffer.c
+++ b/drivers/media/dvb/dvb-core/dvb_ringbuffer.c
@@ -133,8 +133,7 @@ ssize_t dvb_ringbuffer_read(struct dvb_ringbuffer *rbuf, u8 *buf, size_t len, in
 
 
 
-ssize_t dvb_ringbuffer_write(struct dvb_ringbuffer *rbuf, const u8 *buf,
-                             size_t len, int usermem)
+ssize_t dvb_ringbuffer_write(struct dvb_ringbuffer *rbuf, const u8 *buf, size_t len)
 {
         size_t todo = len;
         size_t split;
@@ -142,28 +141,18 @@ ssize_t dvb_ringbuffer_write(struct dvb_ringbuffer *rbuf, const u8 *buf,
         split = (rbuf->pwrite + len > rbuf->size) ? rbuf->size - rbuf->pwrite : 0;
 
         if (split > 0) {
-                if (!usermem) 
-                        memcpy(rbuf->data+rbuf->pwrite, buf, split);
-                else
-                        if (copy_from_user(rbuf->data+rbuf->pwrite, 
-                                           buf, split))
-                                return -EFAULT;
+		memcpy(rbuf->data+rbuf->pwrite, buf, split);
                 buf += split;
                 todo -= split;
                 rbuf->pwrite = 0;
         }
-        if (!usermem) 
-                memcpy(rbuf->data+rbuf->pwrite, buf, todo);
-        else
-                if (copy_from_user(rbuf->data+rbuf->pwrite, buf, todo)) 
-                        return -EFAULT;
-
+	memcpy(rbuf->data+rbuf->pwrite, buf, todo);
         rbuf->pwrite = (rbuf->pwrite + todo) % rbuf->size;
 
 	return len;
 }
 
-ssize_t dvb_ringbuffer_pkt_write(struct dvb_ringbuffer *rbuf, u8* buf, size_t len, int usermem)
+ssize_t dvb_ringbuffer_pkt_write(struct dvb_ringbuffer *rbuf, u8* buf, size_t len)
 {
         int status;
         ssize_t oldpwrite = rbuf->pwrite;
@@ -171,7 +160,7 @@ ssize_t dvb_ringbuffer_pkt_write(struct dvb_ringbuffer *rbuf, u8* buf, size_t le
         DVB_RINGBUFFER_WRITE_BYTE(rbuf, len >> 8);
         DVB_RINGBUFFER_WRITE_BYTE(rbuf, len & 0xff);
         DVB_RINGBUFFER_WRITE_BYTE(rbuf, PKT_READY);
-        status = dvb_ringbuffer_write(rbuf, buf, len, usermem);
+        status = dvb_ringbuffer_write(rbuf, buf, len);
 
         if (status < 0) rbuf->pwrite = oldpwrite;
         return status;
diff --git a/drivers/media/dvb/dvb-core/dvb_ringbuffer.h b/drivers/media/dvb/dvb-core/dvb_ringbuffer.h
index 4158406c6..c1ffa271f 100644
--- a/drivers/media/dvb/dvb-core/dvb_ringbuffer.h
+++ b/drivers/media/dvb/dvb-core/dvb_ringbuffer.h
@@ -53,7 +53,7 @@ struct dvb_ringbuffer {
 **     *** write <buflen> bytes ***
 **     free = dvb_ringbuffer_free(rbuf);
 **     if (free >= buflen) 
-**         count = dvb_ringbuffer_write(rbuf, buffer, buflen, 0);
+**         count = dvb_ringbuffer_write(rbuf, buffer, buflen);
 **     else
 **         ...
 **
@@ -121,7 +121,7 @@ extern ssize_t dvb_ringbuffer_read(struct dvb_ringbuffer *rbuf, u8 *buf,
 ** returns number of bytes transferred or -EFAULT
 */
 extern ssize_t dvb_ringbuffer_write(struct dvb_ringbuffer *rbuf, const u8 *buf,
-                                    size_t len, int usermem);
+                                    size_t len);
 
 
 /**
@@ -130,11 +130,10 @@ extern ssize_t dvb_ringbuffer_write(struct dvb_ringbuffer *rbuf, const u8 *buf,
  * <rbuf> Ringbuffer to write to.
  * <buf> Buffer to write.
  * <len> Length of buffer (currently limited to 65535 bytes max).
- * <usermem> Set to 1 if <buf> is in userspace.
  * returns Number of bytes written, or -EFAULT, -ENOMEM, -EVINAL.
  */
 extern ssize_t dvb_ringbuffer_pkt_write(struct dvb_ringbuffer *rbuf, u8* buf,
-                                        size_t len, int usermem);
+                                        size_t len);
 
 /**
  * Read from a packet in the ringbuffer. Note: unlike dvb_ringbuffer_read(), this
diff --git a/drivers/media/dvb/dvb-core/dvbdev.c b/drivers/media/dvb/dvb-core/dvbdev.c
index fa719c78c..686ffc229 100644
--- a/drivers/media/dvb/dvb-core/dvbdev.c
+++ b/drivers/media/dvb/dvb-core/dvbdev.c
@@ -191,7 +191,7 @@ int dvb_register_device(struct dvb_adapter *adap, struct dvb_device **pdvbdev,
 
 	if ((id = dvbdev_get_free_id (adap, type)) < 0) {
 		up (&dvbdev_register_lock);
-		*pdvbdev = 0;
+		*pdvbdev = NULL;
 		printk ("%s: could get find free device id...\n", __FUNCTION__);
 		return -ENFILE;
 	}
diff --git a/drivers/media/dvb/dvb-core/dvbdev.h b/drivers/media/dvb/dvb-core/dvbdev.h
index 6c4e3a00a..fc4700f05 100644
--- a/drivers/media/dvb/dvb-core/dvbdev.h
+++ b/drivers/media/dvb/dvb-core/dvbdev.h
@@ -29,7 +29,7 @@
 #include <linux/list.h>
 #include <linux/devfs_fs_kernel.h>
 
-#define DVB_MAJOR 250
+#define DVB_MAJOR 212
 
 #define DVB_DEVICE_VIDEO      0
 #define DVB_DEVICE_AUDIO      1
diff --git a/drivers/media/dvb/frontends/alps_tdlb7.c b/drivers/media/dvb/frontends/alps_tdlb7.c
index 64d95f2f8..cf165f2d5 100644
--- a/drivers/media/dvb/frontends/alps_tdlb7.c
+++ b/drivers/media/dvb/frontends/alps_tdlb7.c
@@ -28,8 +28,6 @@
     
 */  
 
-
-#define __KERNEL_SYSCALLS__
 #include <linux/module.h>
 #include <linux/init.h>
 #include <linux/vmalloc.h>
@@ -151,13 +149,13 @@ static int sp8870_read_firmware_file (const char *fn, char **fp)
 	loff_t filesize;
 	char *dp;
 
-	fd = open(fn, 0, 0);
+	fd = sys_open(fn, 0, 0);
 	if (fd == -1) {
                 printk("%s: unable to open '%s'.\n", __FUNCTION__, fn);
 		return -EIO;
 	}
 
-	filesize = lseek(fd, 0L, 2);
+	filesize = sys_lseek(fd, 0L, 2);
 	if (filesize <= 0 || filesize < SP8870_FIRMWARE_OFFSET + SP8870_FIRMWARE_SIZE) {
 	        printk("%s: firmware filesize to small '%s'\n", __FUNCTION__, fn);
 		sys_close(fd);
@@ -171,8 +169,8 @@ static int sp8870_read_firmware_file (const char *fn, char **fp)
 		return -EIO;
 	}
 
-	lseek(fd, SP8870_FIRMWARE_OFFSET, 0);
-	if (read(fd, dp, SP8870_FIRMWARE_SIZE) != SP8870_FIRMWARE_SIZE) {
+	sys_lseek(fd, SP8870_FIRMWARE_OFFSET, 0);
+	if (sys_read(fd, dp, SP8870_FIRMWARE_SIZE) != SP8870_FIRMWARE_SIZE) {
 		printk("%s: failed to read '%s'.\n",__FUNCTION__, fn);
 		vfree(dp);
 		sys_close(fd);
diff --git a/drivers/media/dvb/frontends/sp887x.c b/drivers/media/dvb/frontends/sp887x.c
index 3b3a73bb0..53ebf4a69 100644
--- a/drivers/media/dvb/frontends/sp887x.c
+++ b/drivers/media/dvb/frontends/sp887x.c
@@ -12,7 +12,6 @@
    next 0x4000 loaded. This may change in future versions.
  */
 
-#define __KERNEL_SYSCALLS__
 #include <linux/kernel.h>
 #include <linux/vmalloc.h>
 #include <linux/module.h>
@@ -211,13 +210,13 @@ int sp887x_initial_setup (struct dvb_frontend *fe)
 
 	// Load the firmware
 	set_fs(get_ds());
-	fd = open(sp887x_firmware, 0, 0);
+	fd = sys_open(sp887x_firmware, 0, 0);
 	if (fd < 0) {
 		printk(KERN_WARNING "%s: Unable to open firmware %s\n", __FUNCTION__,
 		       sp887x_firmware);
 		return -EIO;
 	}
-	filesize = lseek(fd, 0L, 2);
+	filesize = sys_lseek(fd, 0L, 2);
 	if (filesize <= 0) {
 		printk(KERN_WARNING "%s: Firmware %s is empty\n", __FUNCTION__,
 		       sp887x_firmware);
@@ -239,8 +238,8 @@ int sp887x_initial_setup (struct dvb_frontend *fe)
 	// read it!
 	// read the first 16384 bytes from the file
 	// ignore the first 10 bytes
-	lseek(fd, 10, 0);
-	if (read(fd, firmware, fw_size) != fw_size) {
+	sys_lseek(fd, 10, 0);
+	if (sys_read(fd, firmware, fw_size) != fw_size) {
 		printk(KERN_WARNING "%s: Failed to read firmware\n", __FUNCTION__);
 		vfree(firmware);
 		sys_close(fd);
diff --git a/drivers/media/dvb/frontends/stv0299.c b/drivers/media/dvb/frontends/stv0299.c
index be9d86a1b..c6a98de01 100644
--- a/drivers/media/dvb/frontends/stv0299.c
+++ b/drivers/media/dvb/frontends/stv0299.c
@@ -418,8 +418,6 @@ static int tsa5059_set_tv_freq	(struct dvb_i2c_bus *i2c, u32 freq, int ftype, in
 }
 
 
-
-#define ABS(x) ((x) < 0 ? -(x) : (x))
 #define MIN2(a,b) ((a) < (b) ? (a) : (b))
 #define MIN3(a,b,c) MIN2(MIN2(a,b),c)
 
@@ -436,8 +434,8 @@ static int tua6100_set_tv_freq	(struct dvb_i2c_bus *i2c, u32 freq,
 
 	first_ZF = (freq) / 1000;
 
-	if (ABS(MIN2(ABS(first_ZF-1190),ABS(first_ZF-1790))) <
-	    ABS(MIN3(ABS(first_ZF-1202),ABS(first_ZF-1542),ABS(first_ZF-1890))))
+	if (abs(MIN2(abs(first_ZF-1190),abs(first_ZF-1790))) <
+	    abs(MIN3(abs(first_ZF-1202),abs(first_ZF-1542),abs(first_ZF-1890))))
 		_fband = 2;
 	else
 		_fband = 3;
diff --git a/drivers/media/dvb/frontends/tda1004x.c b/drivers/media/dvb/frontends/tda1004x.c
index 20d86a8c4..28dc299a8 100644
--- a/drivers/media/dvb/frontends/tda1004x.c
+++ b/drivers/media/dvb/frontends/tda1004x.c
@@ -32,7 +32,6 @@
  */
 
 
-#define __KERNEL_SYSCALLS__
 #include <linux/kernel.h>
 #include <linux/vmalloc.h>
 #include <linux/module.h>
@@ -40,7 +39,6 @@
 #include <linux/string.h>
 #include <linux/slab.h>
 #include <linux/fs.h>
-#include <linux/unistd.h>
 #include <linux/fcntl.h>
 #include <linux/errno.h>
 #include <linux/syscalls.h>
@@ -399,13 +397,13 @@ static int tda1004x_fwupload(struct dvb_i2c_bus *i2c, struct tda1004x_state *tda
 
 	// Load the firmware
 	set_fs(get_ds());
-	fd = open(tda1004x_firmware, 0, 0);
+	fd = sys_open(tda1004x_firmware, 0, 0);
 	if (fd < 0) {
 		printk("%s: Unable to open firmware %s\n", __FUNCTION__,
 		       tda1004x_firmware);
 		return -EIO;
 	}
-	filesize = lseek(fd, 0L, 2);
+	filesize = sys_lseek(fd, 0L, 2);
 	if (filesize <= 0) {
 		printk("%s: Firmware %s is empty\n", __FUNCTION__,
 		       tda1004x_firmware);
@@ -436,8 +434,8 @@ static int tda1004x_fwupload(struct dvb_i2c_bus *i2c, struct tda1004x_state *tda
 	}
 
 	// read it!
-	lseek(fd, fw_offset, 0);
-	if (read(fd, firmware, fw_size) != fw_size) {
+	sys_lseek(fd, fw_offset, 0);
+	if (sys_read(fd, firmware, fw_size) != fw_size) {
 		printk("%s: Failed to read firmware\n", __FUNCTION__);
 		vfree(firmware);
 		sys_close(fd);
@@ -538,7 +536,7 @@ static int tda1004x_fwupload(struct dvb_i2c_bus *i2c, struct tda1004x_state *tda
 
 static int tda10045h_init(struct dvb_i2c_bus *i2c, struct tda1004x_state *tda_state)
 {
-        struct i2c_msg tuner_msg = {.addr = 0,.flags = 0,.buf = 0,.len = 0 };
+        struct i2c_msg tuner_msg = {.addr = 0,.flags = 0,.buf = NULL,.len = 0 };
         static u8 disable_mc44BC374c[] = { 0x1d, 0x74, 0xa0, 0x68 };
 
         dprintk("%s\n", __FUNCTION__);
@@ -576,7 +574,7 @@ static int tda10045h_init(struct dvb_i2c_bus *i2c, struct tda1004x_state *tda_st
 
 static int tda10046h_init(struct dvb_i2c_bus *i2c, struct tda1004x_state *tda_state)
 {
-        struct i2c_msg tuner_msg = {.addr = 0,.flags = 0,.buf = 0,.len = 0 };
+        struct i2c_msg tuner_msg = {.addr = 0,.flags = 0,.buf = NULL,.len = 0 };
         static u8 disable_mc44BC374c[] = { 0x1d, 0x74, 0xa0, 0x68 };
 
         dprintk("%s\n", __FUNCTION__);
@@ -1393,7 +1391,7 @@ static int tda1004x_attach(struct dvb_i2c_bus *i2c, void **data)
         int tuner_type = -1;
 	struct tda1004x_state tda_state;
 	struct tda1004x_state* ptda_state;
-	struct i2c_msg tuner_msg = {.addr=0, .flags=0, .buf=0, .len=0 };
+	struct i2c_msg tuner_msg = {.addr=0, .flags=0, .buf=NULL, .len=0 };
         static u8 td1344_init[] = { 0x0b, 0xf5, 0x88, 0xab };
         static u8 td1316_init[] = { 0x0b, 0xf5, 0x85, 0xab };
         static u8 td1316_init_tda10046h[] = { 0x0b, 0xf5, 0x80, 0xab };
diff --git a/drivers/media/dvb/ttpci/av7110.c b/drivers/media/dvb/ttpci/av7110.c
index d20b96203..11e9ba768 100644
--- a/drivers/media/dvb/ttpci/av7110.c
+++ b/drivers/media/dvb/ttpci/av7110.c
@@ -320,7 +320,7 @@ static void debiirq (unsigned long data)
         case DATA_PIPING:
                 if (av7110->handle2filter[handle]) 
                         DvbDmxFilterCallback((u8 *)av7110->debi_virt, 
-                                             av7110->debilen, 0, 0, 
+                                             av7110->debilen, NULL, 0, 
                                              av7110->handle2filter[handle], 
                                              DMX_OK, av7110); 
                 spin_lock(&av7110->debilock);
@@ -651,7 +651,7 @@ static struct file_operations dvb_osd_fops = {
 };
 
 static struct dvb_device dvbdev_osd = {
-	.priv		= 0,
+	.priv		= NULL,
 	.users		= 1,
 	.writers	= 1,
 	.fops		= &dvb_osd_fops,
@@ -928,7 +928,7 @@ static int av7110_stop_feed(struct dvb_demux_feed *feed)
 			    !demux->pesfilter[feed->pes_type])
 				return -EINVAL;
 			demux->pids[feed->pes_type] |= 0x8000;
-			demux->pesfilter[feed->pes_type] = 0;
+			demux->pesfilter[feed->pes_type] = NULL;
 		}
 		if (feed->ts_type & TS_DECODER &&
 		    feed->pes_type < DMX_TS_PES_OTHER) {
@@ -1402,7 +1402,7 @@ static int av7110_attach(struct saa7146_dev* dev, struct saa7146_pci_extension_d
 
         /* ARM "watchdog" */
 	init_waitqueue_head(&av7110->arm_wait);
-        av7110->arm_thread=0;
+        av7110->arm_thread=NULL;
      
         /* allocate and init buffers */
         av7110->debi_virt = pci_alloc_consistent(dev->pci, 8192,
diff --git a/drivers/media/dvb/ttpci/av7110_av.c b/drivers/media/dvb/ttpci/av7110_av.c
index 054e2e90d..b922851d8 100644
--- a/drivers/media/dvb/ttpci/av7110_av.c
+++ b/drivers/media/dvb/ttpci/av7110_av.c
@@ -109,7 +109,7 @@ int av7110_record_cb(struct dvb_filter_pes2ts *p2t, u8 *buf, size_t len)
 	if (buf[3] == 0xe0)	 // video PES do not have a length in TS
 		buf[4] = buf[5] = 0;
 	if (dvbdmxfeed->ts_type & TS_PAYLOAD_ONLY)
-		return dvbdmxfeed->cb.ts(buf, len, 0, 0,
+		return dvbdmxfeed->cb.ts(buf, len, NULL, 0,
 					 &dvbdmxfeed->feed.ts, DMX_OK);
 	else
 		return dvb_filter_pes2ts(p2t, buf, len, 1);
@@ -121,7 +121,7 @@ static int dvb_filter_pes2ts_cb(void *priv, unsigned char *data)
 
 //	DEB_EE(("dvb_demux_feed:%p\n", dvbdmxfeed));
 
-	dvbdmxfeed->cb.ts(data, 188, 0, 0,
+	dvbdmxfeed->cb.ts(data, 188, NULL, 0,
 			  &dvbdmxfeed->feed.ts, DMX_OK);
 	return 0;
 }
@@ -393,7 +393,7 @@ static inline long aux_ring_buffer_write(struct dvb_ringbuffer *rbuf,
 		free = dvb_ringbuffer_free(rbuf);
 		if (free > todo)
 			free = todo;
-		dvb_ringbuffer_write(rbuf, buf, free, 0);
+		dvb_ringbuffer_write(rbuf, buf, free);
 		todo -= free;
 		buf += free;
 	}
@@ -424,8 +424,8 @@ static void play_audio_cb(u8 *buf, int count, void *priv)
 #define FREE_COND (dvb_ringbuffer_free(&av7110->avout) >= 20 * 1024 && \
 		   dvb_ringbuffer_free(&av7110->aout) >= 20 * 1024)
 
-static ssize_t dvb_play(struct av7110 *av7110, const u8 *buf,
-			unsigned long count, int nonblock, int type, int umem)
+static ssize_t dvb_play(struct av7110 *av7110, const u8 __user *buf,
+			unsigned long count, int nonblock, int type)
 {
 	unsigned long todo = count, n;
 	DEB_EE(("av7110: %p\n", av7110));
@@ -447,22 +447,47 @@ static ssize_t dvb_play(struct av7110 *av7110, const u8 *buf,
 		n = todo;
 		if (n > IPACKS * 2)
 			n = IPACKS * 2;
-		if (umem) {
-			if (copy_from_user(av7110->kbuf[type], buf, n))
-				return -EFAULT;
-			av7110_ipack_instant_repack(av7110->kbuf[type], n,
-						    &av7110->ipack[type]);
-		} else {
-			av7110_ipack_instant_repack(buf, n,
-						    &av7110->ipack[type]);
+		if (copy_from_user(av7110->kbuf[type], buf, n))
+			return -EFAULT;
+		av7110_ipack_instant_repack(av7110->kbuf[type], n,
+					    &av7110->ipack[type]);
+		todo -= n;
+		buf += n;
+	}
+	return count - todo;
+}
+
+static ssize_t dvb_play_kernel(struct av7110 *av7110, const u8 *buf,
+			unsigned long count, int nonblock, int type)
+{
+	unsigned long todo = count, n;
+	DEB_EE(("av7110: %p\n", av7110));
+
+	if (!av7110->kbuf[type])
+		return -ENOBUFS;
+
+	if (nonblock && !FREE_COND)
+		return -EWOULDBLOCK;
+
+	while (todo > 0) {
+		if (!FREE_COND) {
+			if (nonblock)
+				return count - todo;
+			if (wait_event_interruptible(av7110->avout.queue,
+						     FREE_COND))
+				return count - todo;
 		}
+		n = todo;
+		if (n > IPACKS * 2)
+			n = IPACKS * 2;
+		av7110_ipack_instant_repack(buf, n, &av7110->ipack[type]);
 		todo -= n;
 		buf += n;
 	}
 	return count - todo;
 }
 
-static ssize_t dvb_aplay(struct av7110 *av7110, const u8 *buf,
+static ssize_t dvb_aplay(struct av7110 *av7110, const u8 __user *buf,
 			 unsigned long count, int nonblock, int type)
 {
 	unsigned long todo = count, n;
@@ -733,7 +758,7 @@ static void p_to_t(u8 const *buf, long int length, u16 pid, u8 *counter,
 			memcpy(obuf + l, buf + c, TS_SIZE - l);
 			c = length;
 		}
-		feed->cb.ts(obuf, 188, 0, 0, &feed->feed.ts, DMX_OK);
+		feed->cb.ts(obuf, 188, NULL, 0, &feed->feed.ts, DMX_OK);
 		pes_start = 0;
 	}
 }
@@ -871,7 +896,7 @@ static unsigned int dvb_video_poll(struct file *file, poll_table *wait)
 	return mask;
 }
 
-static ssize_t dvb_video_write(struct file *file, const char *buf,
+static ssize_t dvb_video_write(struct file *file, const char __user *buf,
 			       size_t count, loff_t *ppos)
 {
 	struct dvb_device *dvbdev = (struct dvb_device *) file->private_data;
@@ -885,7 +910,7 @@ static ssize_t dvb_video_write(struct file *file, const char *buf,
 	if (av7110->videostate.stream_source != VIDEO_SOURCE_MEMORY)
 		return -EPERM;
 
-	return dvb_play(av7110, buf, count, file->f_flags & O_NONBLOCK, 1, 1);
+	return dvb_play(av7110, buf, count, file->f_flags & O_NONBLOCK, 1);
 }
 
 static unsigned int dvb_audio_poll(struct file *file, poll_table *wait)
@@ -907,7 +932,7 @@ static unsigned int dvb_audio_poll(struct file *file, poll_table *wait)
 	return mask;
 }
 
-static ssize_t dvb_audio_write(struct file *file, const char *buf,
+static ssize_t dvb_audio_write(struct file *file, const char __user *buf,
 			       size_t count, loff_t *ppos)
 {
 	struct dvb_device *dvbdev = (struct dvb_device *) file->private_data;
@@ -926,7 +951,7 @@ u8 iframe_header[] = { 0x00, 0x00, 0x01, 0xe0, 0x00, 0x00, 0x80, 0x00, 0x00 };
 
 #define MIN_IFRAME 400000
 
-static int play_iframe(struct av7110 *av7110, u8 *buf, unsigned int len, int nonblock)
+static int play_iframe(struct av7110 *av7110, u8 __user *buf, unsigned int len, int nonblock)
 {
 	int i, n;
 
@@ -942,10 +967,10 @@ static int play_iframe(struct av7110 *av7110, u8 *buf, unsigned int len, int non
 	n = MIN_IFRAME / len + 1;
 
 	/* FIXME: nonblock? */
-	dvb_play(av7110, iframe_header, sizeof(iframe_header), 0, 1, 0);
+	dvb_play_kernel(av7110, iframe_header, sizeof(iframe_header), 0, 1);
 
 	for (i = 0; i < n; i++)
-		dvb_play(av7110, buf, len, 0, 1, 1);
+		dvb_play(av7110, buf, len, 0, 1);
 
 	av7110_ipack_flush(&av7110->ipack[1]);
 	return 0;
@@ -1347,7 +1372,7 @@ static struct file_operations dvb_video_fops = {
 };
 
 static struct dvb_device dvbdev_video = {
-	.priv		= 0,
+	.priv		= NULL,
 	.users		= 6,
 	.readers	= 5,	/* arbitrary */
 	.writers	= 1,
@@ -1365,7 +1390,7 @@ static struct file_operations dvb_audio_fops = {
 };
 
 static struct dvb_device dvbdev_audio = {
-	.priv		= 0,
+	.priv		= NULL,
 	.users		= 1,
 	.writers	= 1,
 	.fops		= &dvb_audio_fops,
diff --git a/drivers/media/dvb/ttpci/av7110_ca.c b/drivers/media/dvb/ttpci/av7110_ca.c
index 7c9a5c84e..2d169d630 100644
--- a/drivers/media/dvb/ttpci/av7110_ca.c
+++ b/drivers/media/dvb/ttpci/av7110_ca.c
@@ -85,7 +85,7 @@ void ci_get_data(struct dvb_ringbuffer *cibuf, u8 *data, int len)
 
 	DVB_RINGBUFFER_WRITE_BYTE(cibuf, len >> 8);
 	DVB_RINGBUFFER_WRITE_BYTE(cibuf, len & 0xff);
-	dvb_ringbuffer_write(cibuf, data, len, 0);
+	dvb_ringbuffer_write(cibuf, data, len);
 	wake_up_interruptible(&cibuf->queue);
 }
 
@@ -110,9 +110,9 @@ void ci_ll_flush(struct dvb_ringbuffer *cirbuf, struct dvb_ringbuffer *ciwbuf)
 void ci_ll_release(struct dvb_ringbuffer *cirbuf, struct dvb_ringbuffer *ciwbuf)
 {
 	vfree(cirbuf->data);
-	cirbuf->data = 0;
+	cirbuf->data = NULL;
 	vfree(ciwbuf->data);
-	ciwbuf->data = 0;
+	ciwbuf->data = NULL;
 }
 
 int ci_ll_reset(struct dvb_ringbuffer *cibuf, struct file *file,
@@ -133,7 +133,7 @@ int ci_ll_reset(struct dvb_ringbuffer *cibuf, struct file *file,
 	for (i = 0; i < 2; i++) {
 		if (slots & (1 << i)) {
 			msg[2] = i;
-			dvb_ringbuffer_write(cibuf, msg, 8, 0);
+			dvb_ringbuffer_write(cibuf, msg, 8);
 			slot[i].flags = 0;
 		}
 	}
@@ -142,30 +142,46 @@ int ci_ll_reset(struct dvb_ringbuffer *cibuf, struct file *file,
 }
 
 static ssize_t ci_ll_write(struct dvb_ringbuffer *cibuf, struct file *file,
-			   const char *buf, size_t count, loff_t *ppos)
+			   const char __user *buf, size_t count, loff_t *ppos)
 {
 	int free;
 	int non_blocking = file->f_flags & O_NONBLOCK;
+	char *page = (char *)__get_free_page(GFP_USER);
+	int res;
 
+	if (!page)
+		return -ENOMEM;
+
+	res = -EINVAL;
 	if (count > 2048)
-		return -EINVAL;
+		goto out;
+
+	res = -EFAULT;
+	if (copy_from_user(page, buf, count))
+		goto out;
+
 	free = dvb_ringbuffer_free(cibuf);
 	if (count + 2 > free) {
+		res = -EWOULDBLOCK;
 		if (non_blocking)
-			return -EWOULDBLOCK;
+			goto out;
+		res = -ERESTARTSYS;
 		if (wait_event_interruptible(cibuf->queue,
 					     (dvb_ringbuffer_free(cibuf) >= count + 2)))
-			return -ERESTARTSYS;
+			goto out;
 	}
 
 	DVB_RINGBUFFER_WRITE_BYTE(cibuf, count >> 8);
 	DVB_RINGBUFFER_WRITE_BYTE(cibuf, count & 0xff);
 
-	return dvb_ringbuffer_write(cibuf, buf, count, 1);
+	res = dvb_ringbuffer_write(cibuf, page, count);
+out:
+	free_page((unsigned long)page);
+	return res;
 }
 
 static ssize_t ci_ll_read(struct dvb_ringbuffer *cibuf, struct file *file,
-			  char *buf, size_t count, loff_t *ppos)
+			  char __user *buf, size_t count, loff_t *ppos)
 {
 	int avail;
 	int non_blocking = file->f_flags & O_NONBLOCK;
@@ -301,7 +317,7 @@ static int dvb_ca_ioctl(struct inode *inode, struct file *file,
 	return 0;
 }
 
-static ssize_t dvb_ca_write(struct file *file, const char *buf,
+static ssize_t dvb_ca_write(struct file *file, const char __user *buf,
 			    size_t count, loff_t *ppos)
 {
 	struct dvb_device *dvbdev = (struct dvb_device *) file->private_data;
@@ -311,7 +327,7 @@ static ssize_t dvb_ca_write(struct file *file, const char *buf,
 	return ci_ll_write(&av7110->ci_wbuffer, file, buf, count, ppos);
 }
 
-static ssize_t dvb_ca_read(struct file *file, char *buf,
+static ssize_t dvb_ca_read(struct file *file, char __user *buf,
 			   size_t count, loff_t *ppos)
 {
 	struct dvb_device *dvbdev = (struct dvb_device *) file->private_data;
@@ -334,7 +350,7 @@ static struct file_operations dvb_ca_fops = {
 };
 
 static struct dvb_device dvbdev_ca = {
-	.priv		= 0,
+	.priv		= NULL,
 	.users		= 1,
 	.writers	= 1,
 	.fops		= &dvb_ca_fops,
diff --git a/drivers/media/dvb/ttpci/av7110_hw.c b/drivers/media/dvb/ttpci/av7110_hw.c
index f56e9dcfb..054018b3f 100644
--- a/drivers/media/dvb/ttpci/av7110_hw.c
+++ b/drivers/media/dvb/ttpci/av7110_hw.c
@@ -737,7 +737,7 @@ static enum av7110_window_display_type bpp2bit[8] = {
 };
 
 static inline int LoadBitmap(struct av7110 *av7110, u16 format,
-			     u16 dx, u16 dy, int inc, u8* data)
+			     u16 dx, u16 dy, int inc, u8 __user * data)
 {
 	int bpp;
 	int i;
@@ -887,7 +887,7 @@ static int OSDSetPalette(struct av7110 *av7110, u32 *colors, u8 first, u8 last)
 }
 
 static int OSDSetBlock(struct av7110 *av7110, int x0, int y0,
-		       int x1, int y1, int inc, u8 *data)
+		       int x1, int y1, int inc, u8 __user *data)
 {
 	uint w, h, bpp, bpl, size, lpb, bnum, brest;
 	int i;
@@ -953,17 +953,32 @@ int av7110_osd_cmd(struct av7110 *av7110, osd_cmd_t *dc)
 		return 0;
 	case OSD_SetPalette:
 	{
+		int len = dc->x0-dc->color+1;
+		void *buf;
+		if (len <= 0)
+			return 0;
+
+		buf = kmalloc(len * 4, GFP_KERNEL);
+		if (!buf)
+			return -ENOMEM;
+
+		if (copy_from_user(buf, dc->data, len * 4)) {
+			kfree(buf);
+			return -EFAULT;
+		}
+
 		if (FW_VERSION(av7110->arm_app) >= 0x2618)
-			OSDSetPalette(av7110, (u32 *)dc->data, dc->color, dc->x0);
+			OSDSetPalette(av7110, buf, dc->color, dc->x0);
 		else {
-			int i, len = dc->x0-dc->color+1;
-			u8 *colors = (u8 *)dc->data;
+			int i;
+			u8 *colors = buf;
 
 			for (i = 0; i<len; i++)
 				OSDSetColor(av7110, dc->color + i,
 					colors[i * 4], colors[i * 4 + 1],
 					colors[i * 4 + 2], colors[i * 4 + 3]);
 		}
+		kfree(buf);
 		return 0;
 	}
 	case OSD_SetTrans:
diff --git a/drivers/media/dvb/ttpci/av7110_ir.c b/drivers/media/dvb/ttpci/av7110_ir.c
index 609e6862d..22039beb4 100644
--- a/drivers/media/dvb/ttpci/av7110_ir.c
+++ b/drivers/media/dvb/ttpci/av7110_ir.c
@@ -138,7 +138,7 @@ static void input_repeat_key(unsigned long data)
 }
 
 
-static int av7110_ir_write_proc (struct file *file, const char *buffer,
+static int av7110_ir_write_proc (struct file *file, const char __user *buffer,
 	                  unsigned long count, void *data)
 {
 	char *page;
diff --git a/drivers/media/dvb/ttusb-budget/dvb-ttusb-budget.c b/drivers/media/dvb/ttusb-budget/dvb-ttusb-budget.c
index 8b927e6f9..cc14ec76d 100644
--- a/drivers/media/dvb/ttusb-budget/dvb-ttusb-budget.c
+++ b/drivers/media/dvb/ttusb-budget/dvb-ttusb-budget.c
@@ -1125,7 +1125,7 @@ static int ttusb_probe(struct usb_interface *intf, const struct usb_device_id *i
 
 	ttusb->dvb_demux.dmx.capabilities =
 	    DMX_TS_FILTERING | DMX_SECTION_FILTERING;
-	ttusb->dvb_demux.priv = 0;
+	ttusb->dvb_demux.priv = NULL;
 #ifdef TTUSB_HWSECTIONS
 	ttusb->dvb_demux.filternum = TTUSB_MAXFILTER;
 #else
@@ -1134,7 +1134,7 @@ static int ttusb_probe(struct usb_interface *intf, const struct usb_device_id *i
 	ttusb->dvb_demux.feednum = TTUSB_MAXCHANNEL;
 	ttusb->dvb_demux.start_feed = ttusb_start_feed;
 	ttusb->dvb_demux.stop_feed = ttusb_stop_feed;
-	ttusb->dvb_demux.write_to_decoder = 0;
+	ttusb->dvb_demux.write_to_decoder = NULL;
 
 	if ((result = dvb_dmx_init(&ttusb->dvb_demux)) < 0) {
 		printk("ttusb_dvb: dvb_dmx_init failed (errno = %d)\n",
diff --git a/drivers/media/dvb/ttusb-dec/ttusb_dec.c b/drivers/media/dvb/ttusb-dec/ttusb_dec.c
index 039a4a1f7..5e3f5eacc 100644
--- a/drivers/media/dvb/ttusb-dec/ttusb_dec.c
+++ b/drivers/media/dvb/ttusb-dec/ttusb_dec.c
@@ -314,7 +314,7 @@ static int ttusb_dec_audio_pes2ts_cb(void *priv, unsigned char *data)
 {
 	struct ttusb_dec *dec = (struct ttusb_dec *)priv;
 
-	dec->audio_filter->feed->cb.ts(data, 188, 0, 0,
+	dec->audio_filter->feed->cb.ts(data, 188, NULL, 0,
 				       &dec->audio_filter->feed->feed.ts,
 				       DMX_OK);
 
@@ -325,7 +325,7 @@ static int ttusb_dec_video_pes2ts_cb(void *priv, unsigned char *data)
 {
 	struct ttusb_dec *dec = (struct ttusb_dec *)priv;
 
-	dec->video_filter->feed->cb.ts(data, 188, 0, 0,
+	dec->video_filter->feed->cb.ts(data, 188, NULL, 0,
 				       &dec->video_filter->feed->feed.ts,
 				       DMX_OK);
 
@@ -378,7 +378,7 @@ static void ttusb_dec_process_pva(struct ttusb_dec *dec, u8 *pva, int length)
 			u16 v_pes_payload_length;
 
 		if (output_pva) {
-			dec->video_filter->feed->cb.ts(pva, length, 0, 0,
+			dec->video_filter->feed->cb.ts(pva, length, NULL, 0,
 				&dec->video_filter->feed->feed.ts, DMX_OK);
 			return;
 		}
@@ -439,7 +439,7 @@ static void ttusb_dec_process_pva(struct ttusb_dec *dec, u8 *pva, int length)
 
 	case 0x02:		/* MainAudioStream */
 		if (output_pva) {
-			dec->audio_filter->feed->cb.ts(pva, length, 0, 0,
+			dec->audio_filter->feed->cb.ts(pva, length, NULL, 0,
 				&dec->audio_filter->feed->feed.ts, DMX_OK);
 			return;
 		}
diff --git a/drivers/media/radio/Kconfig b/drivers/media/radio/Kconfig
index bdc34d152..d318be383 100644
--- a/drivers/media/radio/Kconfig
+++ b/drivers/media/radio/Kconfig
@@ -145,7 +145,7 @@ config RADIO_GEMTEK_PCI
 
 config RADIO_MAXIRADIO
 	tristate "Guillemot MAXI Radio FM 2000 radio"
-	depends on VIDEO_DEV
+	depends on VIDEO_DEV && PCI
 	---help---
 	  Choose Y here if you have this radio card.  This card may also be
 	  found as Gemtek PCI FM.
diff --git a/drivers/media/radio/miropcm20-radio.c b/drivers/media/radio/miropcm20-radio.c
index a4bc55c93..4fd5e32cc 100644
--- a/drivers/media/radio/miropcm20-radio.c
+++ b/drivers/media/radio/miropcm20-radio.c
@@ -61,7 +61,7 @@ static int pcm20_setfreq(struct pcm20_device *dev, unsigned long freq)
 	freql = freq & 0xff;
 	freqh = freq >> 8;
 
-	aci_rds_cmd(RDS_RESET, 0, 0);
+	aci_rds_cmd(RDS_RESET, NULL, 0);
 	pcm20_stereo(dev, 1);
 
 	return aci_rw_cmd(ACI_WRITE_TUNE, freql, freqh);
@@ -75,7 +75,7 @@ static int pcm20_getflags(struct pcm20_device *dev, __u32 *flags, __u16 *signal)
 
 	if ((i=aci_rw_cmd(ACI_READ_TUNERSTATION, -1, -1))<0)
 		return i;
-#if DEBUG
+#ifdef DEBUG
 	printk("check_sig: 0x%x\n", i);
 #endif
 	if (i & 0x80) {
@@ -107,7 +107,7 @@ static int pcm20_getflags(struct pcm20_device *dev, __u32 *flags, __u16 *signal)
 
 	if ((i=aci_rds_cmd(RDS_RXVALUE, &buf, 1))<0)
 		return i;
-#if DEBUG
+#ifdef DEBUG
 	printk("rds-signal: %d\n", buf);
 #endif
 	if (buf > 15) {
@@ -172,7 +172,7 @@ static int pcm20_do_ioctl(struct inode *inode, struct file *file,
 			unsigned long *freq = arg;
 			pcm20->freq = *freq;
 			i=pcm20_setfreq(pcm20, pcm20->freq);
-#if DEBUG
+#ifdef DEBUG
 			printk("First view (setfreq): 0x%x\n", i);
 #endif
 			return i;
diff --git a/drivers/media/radio/miropcm20-rds.c b/drivers/media/radio/miropcm20-rds.c
index f98d4c50b..6b11044e7 100644
--- a/drivers/media/radio/miropcm20-rds.c
+++ b/drivers/media/radio/miropcm20-rds.c
@@ -53,7 +53,7 @@ static void print_matrix(char *ch, char out[])
 	}
 }
 
-static ssize_t rds_f_read(struct file *file, char *buffer, size_t length, loff_t *offset)
+static ssize_t rds_f_read(struct file *file, char __user *buffer, size_t length, loff_t *offset)
 {
 //	i = sprintf(text_buffer, "length: %d, offset: %d\n", length, *offset);
 
diff --git a/drivers/media/radio/radio-cadet.c b/drivers/media/radio/radio-cadet.c
index 842e14baa..8cc5191ac 100644
--- a/drivers/media/radio/radio-cadet.c
+++ b/drivers/media/radio/radio-cadet.c
@@ -323,7 +323,7 @@ void cadet_handler(unsigned long data)
 
 
 
-static ssize_t cadet_read(struct file *file, char *data,
+static ssize_t cadet_read(struct file *file, char __user *data,
 			  size_t count, loff_t *ppos)
 {
         int i=0;
diff --git a/drivers/media/radio/radio-gemtek.c b/drivers/media/radio/radio-gemtek.c
index 3e765d66d..23bc25d10 100644
--- a/drivers/media/radio/radio-gemtek.c
+++ b/drivers/media/radio/radio-gemtek.c
@@ -194,7 +194,7 @@ static int gemtek_do_ioctl(struct inode *inode, struct file *file,
 		}
 		case VIDIOCGAUDIO:
 		{	
-			struct video_audio *v = 0;
+			struct video_audio *v = arg;
 			memset(v,0, sizeof(*v));
 			v->flags|=VIDEO_AUDIO_MUTABLE;
 			v->volume=1;
diff --git a/drivers/media/radio/radio-zoltrix.c b/drivers/media/radio/radio-zoltrix.c
index 70a3ee406..8bc9075b2 100644
--- a/drivers/media/radio/radio-zoltrix.c
+++ b/drivers/media/radio/radio-zoltrix.c
@@ -273,7 +273,7 @@ static int zol_do_ioctl(struct inode *inode, struct file *file,
 	case VIDIOCGAUDIO:
 		{
 			struct video_audio *v = arg;
-			memset(&v, 0, sizeof(*v));
+			memset(v, 0, sizeof(*v));
 			v->flags |= VIDEO_AUDIO_MUTABLE | VIDEO_AUDIO_VOLUME;
 			v->mode |= zol_is_stereo(zol)
 				? VIDEO_SOUND_STEREO : VIDEO_SOUND_MONO;
diff --git a/drivers/media/video/Kconfig b/drivers/media/video/Kconfig
index 90249af1e..db5270b73 100644
--- a/drivers/media/video/Kconfig
+++ b/drivers/media/video/Kconfig
@@ -112,11 +112,11 @@ config VIDEO_CPIA_USB
 	  It is also available as a module (cpia_usb).
 
 config VIDEO_SAA5246A
-	tristate "SAA5246A Teletext processor"
+	tristate "SAA5246A, SAA5281 Teletext processor"
 	depends on VIDEO_DEV && I2C
 	help
-	  Support for I2C bus based teletext using the SAA5246A chip. Useful
-	  only if you live in Europe.
+	  Support for I2C bus based teletext using the SAA5246A or SAA5281
+	  chip. Useful only if you live in Europe.
 
 	  To compile this driver as a module, choose M here: the
 	  module will be called saa5246a.
@@ -295,5 +295,16 @@ config VIDEO_CX88
 	  To compile this driver as a module, choose M here: the
 	  module will be called cx8800
 
+config VIDEO_OVCAMCHIP
+	tristate "OmniVision Camera Chip support"
+	depends on VIDEO_DEV && I2C
+	---help---
+	  Support for the OmniVision OV6xxx and OV7xxx series of camera chips.
+	  This driver is intended to be used with the ov511 and w9968cf USB
+	  camera drivers.
+
+	  To compile this driver as a module, choose M here: the
+	  module will be called ovcamchip
+
 endmenu
 
diff --git a/drivers/media/video/Makefile b/drivers/media/video/Makefile
index 56f2e7c4a..6a14ce96f 100644
--- a/drivers/media/video/Makefile
+++ b/drivers/media/video/Makefile
@@ -37,6 +37,7 @@ obj-$(CONFIG_VIDEO_CPIA_USB) += cpia_usb.o
 obj-$(CONFIG_VIDEO_MEYE) += meye.o
 obj-$(CONFIG_VIDEO_SAA7134) += saa7134/
 obj-$(CONFIG_VIDEO_CX88) += cx88/
+obj-$(CONFIG_VIDEO_OVCAMCHIP) += ovcamchip/
 obj-$(CONFIG_VIDEO_MXB) += saa7111.o tuner.o tda9840.o tea6415c.o tea6420.o mxb.o
 obj-$(CONFIG_VIDEO_HEXIUM_ORION) += hexium_orion.o
 obj-$(CONFIG_VIDEO_HEXIUM_GEMINI) += hexium_gemini.o
diff --git a/drivers/media/video/bttv-cards.c b/drivers/media/video/bttv-cards.c
index fbc748e5f..7ea762f35 100644
--- a/drivers/media/video/bttv-cards.c
+++ b/drivers/media/video/bttv-cards.c
@@ -71,6 +71,9 @@ static void gvc1100_muxsel(struct bttv *btv, unsigned int input);
 
 static void PXC200_muxsel(struct bttv *btv, unsigned int input);
 
+static void picolo_tetra_muxsel(struct bttv *btv, unsigned int input);
+static void picolo_tetra_init(struct bttv *btv);
+
 static int terratec_active_radio_upgrade(struct bttv *btv);
 static int tea5757_read(struct bttv *btv);
 static int tea5757_write(struct bttv *btv, int value);
@@ -181,6 +184,7 @@ static struct CARD {
 	{ 0xff00bd11, BTTV_PINNACLE,      "Pinnacle PCTV [bswap]" },
 
 	{ 0x3000121a, BTTV_VOODOOTV_FM,   "3Dfx VoodooTV FM/ VoodooTV 200" },
+	{ 0x263710b4, BTTV_VOODOOTV_FM,   "3Dfx VoodooTV FM/ VoodooTV 200" },
 	{ 0x3060121a, BTTV_STB2,	  "3Dfx VoodooTV 100/ STB OEM" },
 	
 	{ 0x3000144f, BTTV_MAGICTVIEW063, "(Askey Magic/others) TView99 CPH06x" },
@@ -260,12 +264,15 @@ static struct CARD {
 	{ 0x41424344, BTTV_GRANDTEC,      "GrandTec Multi Capture" },
 	{ 0x01020304, BTTV_XGUARD,        "Grandtec Grand X-Guard" },
 	
-    	{ 0x010115cb, BTTV_GMV1,          "AG GMV1" },
-	{ 0x010114c7, BTTV_MODTEC_205,    "Modular Technology MM201/MM202/MM205/MM210/MM215 PCTV" },
 	{ 0x18501851, BTTV_CHRONOS_VS2,   "FlyVideo 98 (LR50)/ Chronos Video Shuttle II" },
 	{ 0x18511851, BTTV_FLYVIDEO98EZ,  "FlyVideo 98EZ (LR51)/ CyberMail AV" },
 	{ 0x18521852, BTTV_TYPHOON_TVIEW, "FlyVideo 98FM (LR50)/ Typhoon TView TV/FM Tuner" },
 	{ 0x41a0a051, BTTV_FLYVIDEO_98FM, "Lifeview FlyVideo 98 LR50 Rev Q" },
+	{ 0x18501f7f, BTTV_FLYVIDEO_98,   "Lifeview Flyvideo 98" },
+
+    	{ 0x010115cb, BTTV_GMV1,          "AG GMV1" },
+	{ 0x010114c7, BTTV_MODTEC_205,    "Modular Technology MM201/MM202/MM205/MM210/MM215 PCTV" },
+
 	{ 0x10b42636, BTTV_HAUPPAUGE878,  "STB ???" },
 	{ 0x217d6606, BTTV_WINFAST2000,   "Leadtek WinFast TV 2000" },
 	{ 0xfff6f6ff, BTTV_WINFAST2000,   "Leadtek WinFast TV 2000" },
@@ -280,14 +287,21 @@ static struct CARD {
 	{ 0x40111554, BTTV_PV_BT878P_9B,  "Prolink Pixelview PV-BT" },
 	{ 0x17de0a01, BTTV_KWORLD,        "Mecer TV/FM/Video Tuner" },
 
+	{ 0x01051805, BTTV_PICOLO_TETRA_CHIP, "Picolo Tetra Chip #1" },
+	{ 0x01061805, BTTV_PICOLO_TETRA_CHIP, "Picolo Tetra Chip #2" },
+	{ 0x01071805, BTTV_PICOLO_TETRA_CHIP, "Picolo Tetra Chip #3" },
+	{ 0x01081805, BTTV_PICOLO_TETRA_CHIP, "Picolo Tetra Chip #4" },
+
 	// likely broken, vendor id doesn't match the other magic views ...
 	//{ 0xa0fca04f, BTTV_MAGICTVIEW063, "Guillemot Maxi TV Video 3" },
 	
 	// DVB cards (using pci function .1 for mpeg data xfer)
 	{ 0x01010071, BTTV_NEBULA_DIGITV, "Nebula Electronics DigiTV" },
+	{ 0x07611461, BTTV_NEBULA_DIGITV, "AverMedia AverTV DVB-T" },
 	{ 0x002611bd, BTTV_TWINHAN_DST,   "Pinnacle PCTV SAT CI" },
 	{ 0x00011822, BTTV_TWINHAN_DST,   "Twinhan VisionPlus DVB-T" },
 	{ 0xfc00270f, BTTV_TWINHAN_DST,   "ChainTech digitop DST-1000 DVB-S" },
+	{ 0x07711461, BTTV_AVDVBT_771,    "AVermedia DVB-T 771" },
 	
 	{ 0, -1, NULL }
 };
@@ -835,7 +849,7 @@ struct tvcard bttv_tvcards[] = {
 	.svhs		= 2,
 	.gpiomask	= 0x03000F,
 	.muxsel		= { 2, 3, 1, 1},
-	.audiomux	= { 2, 0, 0, 0, 1},
+	.audiomux	= { 2, 0xd0001, 0, 0, 1},
 	.needs_tvaudio	= 0,
 	.pll		= PLL_28,
 	.tuner_type	= -1,
@@ -1646,6 +1660,7 @@ struct tvcard bttv_tvcards[] = {
 	.muxsel         = { 3, 0, 1, 2},
 	.needs_tvaudio  = 0, 
 	.pll            = PLL_28,
+	.no_gpioirq     = 1,
 },{
         .name           = "Formac ProTV II (bt878)",
         .video_inputs   = 4,
@@ -2012,6 +2027,57 @@ struct tvcard bttv_tvcards[] = {
 	.tuner_type     = TUNER_PHILIPS_PAL,
 	.has_remote     = 1,
 	.has_radio      = 1,
+},{
+	/*Eric DEBIEF <debief@telemsa.com>*/
+	/*EURESYS Picolo Tetra : 4 Conexant Fusion 878A, no audio, video input set with analog multiplexers GPIO controled*/
+	/* adds picolo_tetra_muxsel(), picolo_tetra_init(), the folowing declaration strucure, and #define BTTV_PICOLO_TETRA_CHIP*/
+	/*0x79 in bttv.h*/
+	.name           = "Euresys Picolo Tetra",
+	.video_inputs   = 4,
+	.audio_inputs   = 0,
+	.tuner          = -1,
+	.svhs           = -1,
+	.gpiomask       = 0,
+	.gpiomask2      = 0x3C<<16,/*Set the GPIO[18]->GPIO[21] as output pin.==> drive the video inputs through analog multiplexers*/
+	.no_msp34xx     = 1,
+	.no_tda9875     = 1,
+	.no_tda7432     = 1,
+	.muxsel         = {2,2,2,2},/*878A input is always MUX0, see above.*/
+	.audiomux       = { 0, 0, 0, 0, 0, 0 }, /* card has no audio */
+	.pll            = PLL_28,
+	.needs_tvaudio  = 0,
+	.muxsel_hook    = picolo_tetra_muxsel,/*Required as it doesn't follow the classic input selection policy*/
+},{
+	/* Spirit TV Tuner from http://spiritmodems.com.au */
+	/* Stafford Goodsell <surge@goliath.homeunix.org> */
+	.name           = "Spirit TV Tuner",
+	.video_inputs   = 3,
+	.audio_inputs   = 1,
+	.tuner          = 0,
+	.svhs           = 2,
+	.gpiomask       = 0x0000000f,
+	.muxsel         = { 2, 1, 1 },
+	.audiomux       = { 0x02, 0x00, 0x00, 0x00, 0x00},
+	.tuner_type     = TUNER_TEMIC_PAL,
+	.no_msp34xx     = 1,
+	.no_tda9875     = 1,
+},{
+	/* Wolfram Joost <wojo@frokaschwei.de> */
+        .name           = "AVerMedia AVerTV DVB-T 771",
+        .video_inputs   = 2,
+        .svhs           = 1,
+        .tuner          = -1,
+        .tuner_type     = TUNER_ABSENT,
+        .muxsel         = { 3 , 3 },
+        .no_msp34xx     = 1,
+        .no_tda9875     = 1,
+        .no_tda7432     = 1,
+        .pll            = PLL_28,
+        .has_dvb        = 1,
+        .no_gpioirq     = 1,
+#if 0 /* untested */
+        .has_remote     = 1,
+#endif
 }};
 
 const unsigned int bttv_num_tvcards = ARRAY_SIZE(bttv_tvcards);
@@ -2381,6 +2447,7 @@ void __devinit bttv_init_card1(struct bttv *btv)
 		pvr_boot(btv);
 		break;
 	case BTTV_TWINHAN_DST:
+	case BTTV_AVDVBT_771:
 		btv->use_i2c_hw = 1;
 		break;
 	}
@@ -2432,6 +2499,9 @@ void __devinit bttv_init_card2(struct bttv *btv)
 	case BTTV_PXC200:
 		init_PXC200(btv);
 		break;
+	case BTTV_PICOLO_TETRA_CHIP:
+		picolo_tetra_init(btv);
+		break;
 	case BTTV_VHX:
 		btv->has_radio    = 1;
 		btv->has_matchbox = 1;
@@ -2668,6 +2738,10 @@ static void modtec_eeprom(struct bttv *btv)
 		btv->tuner_type=TUNER_ALPS_TSBB5_PAL_I;
 		printk("bttv%d: Modtec: Tuner autodetected by eeprom: %s\n",
                        btv->c.nr,&eeprom_data[0x1e]);
+        } else if (strncmp(&(eeprom_data[0x1e]),"Philips FM1246",14) ==0) {
+                btv->tuner_type=TUNER_PHILIPS_NTSC;
+                printk("bttv%d: Modtec: Tuner autodetected by eeprom: %s\n",
+                       btv->c.nr,&eeprom_data[0x1e]);
 	} else {
 		printk("bttv%d: Modtec: Unknown TunerString: %s\n",
 		       btv->c.nr,&eeprom_data[0x1e]);
@@ -3786,6 +3860,21 @@ static void xguard_muxsel(struct bttv *btv, unsigned int input)
 	};
 	gpio_write(masks[input%16]);
 }
+static void picolo_tetra_init(struct bttv *btv)
+{
+	/*This is the video input redirection fonctionality : I DID NOT USED IT. */
+	btwrite (0x08<<16,BT848_GPIO_DATA);/*GPIO[19] [==> 4053 B+C] set to 1 */
+	btwrite (0x04<<16,BT848_GPIO_DATA);/*GPIO[18] [==> 4053 A]  set to 1*/
+}
+static void picolo_tetra_muxsel (struct bttv* btv, unsigned int input)
+{
+
+	dprintk (KERN_DEBUG "bttv%d : picolo_tetra_muxsel =>  input = %d\n",btv->c.nr,input);
+	/*Just set the right path in the analog multiplexers : channel 1 -> 4 ==> Analog Mux ==> MUX0*/
+	/*GPIO[20]&GPIO[21] used to choose the right input*/
+	btwrite (input<<20,BT848_GPIO_DATA);
+
+}
 
 /*
  * ivc120_muxsel [Added by Alan Garfield <alan@fromorbit.com>]
@@ -3974,7 +4063,7 @@ static void PXC200_muxsel(struct bttv *btv, unsigned int input)
 	  return;
 	}
 
-	rc=bttv_I2CRead(btv,(PX_I2C_PIC<<1),0);
+	rc=bttv_I2CRead(btv,(PX_I2C_PIC<<1),NULL);
 	if (!(rc & PX_CFG_PXC200F)) {
 	  printk(KERN_DEBUG "bttv%d: PXC200_muxsel: not PXC200F rc:%d \n", btv->c.nr,rc);
 	  return;
diff --git a/drivers/media/video/bttv-driver.c b/drivers/media/video/bttv-driver.c
index 9e6e537b7..e7ffe1841 100644
--- a/drivers/media/video/bttv-driver.c
+++ b/drivers/media/video/bttv-driver.c
@@ -1068,7 +1068,7 @@ static void init_bt848(struct bttv *btv)
 	init_irqreg(btv);
 }
 
-extern void bttv_reinit_bt848(struct bttv *btv)
+void bttv_reinit_bt848(struct bttv *btv)
 {
 	unsigned long flags;
 
@@ -1334,7 +1334,8 @@ bttv_switch_overlay(struct bttv *btv, struct bttv_fh *fh,
 	spin_lock_irqsave(&btv->s_lock,flags);
 	old = btv->screen;
 	btv->screen = new;
-	bttv_set_dma(btv, 0x03, 1);
+	btv->curr.irqflags |= 1;
+	bttv_set_dma(btv, 0x03, btv->curr.irqflags);
 	spin_unlock_irqrestore(&btv->s_lock,flags);
 	if (NULL == new)
 		free_btres(btv,fh,RESOURCE_OVERLAY);
@@ -1441,7 +1442,8 @@ buffer_queue(struct file *file, struct videobuf_buffer *vb)
 
 	buf->vb.state = STATE_QUEUED;
 	list_add_tail(&buf->vb.queue,&fh->btv->capture);
-	bttv_set_dma(fh->btv, 0x03, 1);
+	fh->btv->curr.irqflags |= 1;
+	bttv_set_dma(fh->btv, 0x03, fh->btv->curr.irqflags);
 }
 
 static void buffer_release(struct file *file, struct videobuf_buffer *vb)
@@ -2259,7 +2261,7 @@ static int bttv_do_ioctl(struct inode *inode, struct file *file,
 		w2.w.width   = win->width;
 		w2.w.height  = win->height;
 		w2.clipcount = win->clipcount;
-		w2.clips     = (struct v4l2_clip*)win->clips;
+		w2.clips     = (struct v4l2_clip __user *)win->clips;
 		retval = setup_window(fh, btv, &w2, 0);
 		if (0 == retval) {
 			/* on v4l1 this ioctl affects the read() size too */
@@ -2819,7 +2821,7 @@ static int bttv_ioctl(struct inode *inode, struct file *file,
 	}
 }
 
-static ssize_t bttv_read(struct file *file, char *data,
+static ssize_t bttv_read(struct file *file, char __user *data,
 			 size_t count, loff_t *ppos)
 {
 	struct bttv_fh *fh = file->private_data;
@@ -3203,8 +3205,8 @@ static void bttv_print_riscaddr(struct bttv *btv)
 	printk("  main: %08Lx\n",
 	       (unsigned long long)btv->main.dma);
 	printk("  vbi : o=%08Lx e=%08Lx\n",
-	       btv->curr.vbi ? (unsigned long long)btv->curr.vbi->top.dma : 0,
-	       btv->curr.vbi ? (unsigned long long)btv->curr.vbi->bottom.dma : 0);
+	       btv->cvbi ? (unsigned long long)btv->cvbi->top.dma : 0,
+	       btv->cvbi ? (unsigned long long)btv->cvbi->bottom.dma : 0);
 	printk("  cap : o=%08Lx e=%08Lx\n",
 	       btv->curr.top    ? (unsigned long long)btv->curr.top->top.dma : 0,
 	       btv->curr.bottom ? (unsigned long long)btv->curr.bottom->bottom.dma : 0);
@@ -3224,7 +3226,7 @@ static void bttv_irq_debug_low_latency(struct bttv *btv, u32 rc)
 
 	if (0 == (btread(BT848_DSTATUS) & BT848_DSTATUS_HLOC)) {
 		printk("bttv%d: Oh, there (temporarely?) is no input signal. "
-		       "Ok, then this is harmless, don't worry ;)",
+		       "Ok, then this is harmless, don't worry ;)\n",
 		       btv->c.nr);
 		return;
 	}
@@ -3236,18 +3238,12 @@ static void bttv_irq_debug_low_latency(struct bttv *btv, u32 rc)
 }
 
 static int
-bttv_irq_next_set(struct bttv *btv, struct bttv_buffer_set *set)
+bttv_irq_next_video(struct bttv *btv, struct bttv_buffer_set *set)
 {
 	struct bttv_buffer *item;
 
 	memset(set,0,sizeof(*set));
 
-	/* vbi request ? */
-	if (!list_empty(&btv->vcapture)) {
-		set->irqflags = 1;
-		set->vbi = list_entry(btv->vcapture.next, struct bttv_buffer, vb.queue);
-	}
-
 	/* capture request ? */
 	if (!list_empty(&btv->capture)) {
 		set->irqflags = 1;
@@ -3295,27 +3291,20 @@ bttv_irq_next_set(struct bttv *btv, struct bttv_buffer_set *set)
 		}
 	}
 
-	dprintk("bttv%d: next set: top=%p bottom=%p vbi=%p "
-		"[screen=%p,irq=%d,%d]\n",
-		btv->c.nr,set->top, set->bottom, set->vbi,
+	dprintk("bttv%d: next set: top=%p bottom=%p [screen=%p,irq=%d,%d]\n",
+		btv->c.nr,set->top, set->bottom,
 		btv->screen,set->irqflags,set->topirq);
 	return 0;
 }
 
 static void
-bttv_irq_wakeup_set(struct bttv *btv, struct bttv_buffer_set *wakeup,
-		    struct bttv_buffer_set *curr, unsigned int state)
+bttv_irq_wakeup_video(struct bttv *btv, struct bttv_buffer_set *wakeup,
+		      struct bttv_buffer_set *curr, unsigned int state)
 {
 	struct timeval ts;
 
 	do_gettimeofday(&ts);
 
-	if (NULL != wakeup->vbi) {
-		wakeup->vbi->vb.ts = ts;
-		wakeup->vbi->vb.field_count = btv->field_count;
-		wakeup->vbi->vb.state = state;
-		wake_up(&wakeup->vbi->vb.done);
-	}
 	if (wakeup->top == wakeup->bottom) {
 		if (NULL != wakeup->top && curr->top != wakeup->top) {
 			if (irq_debug > 1)
@@ -3345,10 +3334,27 @@ bttv_irq_wakeup_set(struct bttv *btv, struct bttv_buffer_set *wakeup,
 	}
 }
 
+static void
+bttv_irq_wakeup_vbi(struct bttv *btv, struct bttv_buffer *wakeup,
+		    unsigned int state)
+{
+	struct timeval ts;
+
+	if (NULL == wakeup)
+		return;
+
+	do_gettimeofday(&ts);
+	wakeup->vb.ts = ts;
+	wakeup->vb.field_count = btv->field_count;
+	wakeup->vb.state = state;
+	wake_up(&wakeup->vb.done);
+}
+
 static void bttv_irq_timeout(unsigned long data)
 {
 	struct bttv *btv = (struct bttv *)data;
 	struct bttv_buffer_set old,new;
+	struct bttv_buffer *ovbi;
 	struct bttv_buffer *item;
 	unsigned long flags;
 	
@@ -3364,13 +3370,17 @@ static void bttv_irq_timeout(unsigned long data)
 	
 	/* deactivate stuff */
 	memset(&new,0,sizeof(new));
-	old = btv->curr;
+	old  = btv->curr;
+	ovbi = btv->cvbi;
 	btv->curr = new;
-	bttv_buffer_set_activate(btv, &new);
+	btv->cvbi = NULL;
+	bttv_buffer_activate_video(btv, &new);
+	bttv_buffer_activate_vbi(btv,   NULL);
 	bttv_set_dma(btv, 0, 0);
 
 	/* wake up */
-	bttv_irq_wakeup_set(btv, &old, &new, STATE_ERROR);
+	bttv_irq_wakeup_video(btv, &old, &new, STATE_ERROR);
+	bttv_irq_wakeup_vbi(btv, ovbi, STATE_ERROR);
 
 	/* cancel all outstanding capture / vbi requests */
 	while (!list_empty(&btv->capture)) {
@@ -3410,8 +3420,17 @@ bttv_irq_wakeup_top(struct bttv *btv)
 	spin_unlock(&btv->s_lock);
 }
 
+static inline int is_active(struct btcx_riscmem *risc, u32 rc)
+{
+	if (rc < risc->dma)
+		return 0;
+	if (rc > risc->dma + risc->size)
+		return 0;
+	return 1;
+}
+
 static void
-bttv_irq_switch_fields(struct bttv *btv)
+bttv_irq_switch_video(struct bttv *btv)
 {
 	struct bttv_buffer_set new;
 	struct bttv_buffer_set old;
@@ -3420,9 +3439,10 @@ bttv_irq_switch_fields(struct bttv *btv)
 	spin_lock(&btv->s_lock);
 
 	/* new buffer set */
-	bttv_irq_next_set(btv, &new);
+	bttv_irq_next_video(btv, &new);
 	rc = btread(BT848_RISC_COUNT);
-	if (rc < btv->main.dma || rc > btv->main.dma + 0x100) {
+	if ((btv->curr.top    && is_active(&btv->curr.top->top,       rc)) ||
+	    (btv->curr.bottom && is_active(&btv->curr.bottom->bottom, rc))) {
 		btv->framedrop++;
 		if (debug_latency)
 			bttv_irq_debug_low_latency(btv, rc);
@@ -3433,7 +3453,7 @@ bttv_irq_switch_fields(struct bttv *btv)
 	/* switch over */
 	old = btv->curr;
 	btv->curr = new;
-	bttv_buffer_set_activate(btv, &new);
+	bttv_buffer_activate_video(btv, &new);
 	bttv_set_dma(btv, 0, new.irqflags);
 
 	/* switch input */
@@ -3443,7 +3463,39 @@ bttv_irq_switch_fields(struct bttv *btv)
 	}
 
 	/* wake up finished buffers */
-	bttv_irq_wakeup_set(btv, &old, &new, STATE_DONE);
+	bttv_irq_wakeup_video(btv, &old, &new, STATE_DONE);
+	spin_unlock(&btv->s_lock);
+}
+
+static void
+bttv_irq_switch_vbi(struct bttv *btv)
+{
+	struct bttv_buffer *new = NULL;
+	struct bttv_buffer *old;
+	u32 rc;
+
+	spin_lock(&btv->s_lock);
+
+	if (!list_empty(&btv->vcapture))
+		new = list_entry(btv->vcapture.next, struct bttv_buffer, vb.queue);
+	old = btv->cvbi;
+
+	rc = btread(BT848_RISC_COUNT);
+	if (NULL != old && (is_active(&old->top,    rc) ||
+			    is_active(&old->bottom, rc))) {
+		btv->framedrop++;
+		if (debug_latency)
+			bttv_irq_debug_low_latency(btv, rc);
+		spin_unlock(&btv->s_lock);
+		return;
+	}
+
+	/* switch */
+	btv->cvbi = new;
+	bttv_buffer_activate_vbi(btv, new);
+	bttv_set_dma(btv, 0, btv->curr.irqflags);
+
+	bttv_irq_wakeup_vbi(btv, old, STATE_DONE);
 	spin_unlock(&btv->s_lock);
 }
 
@@ -3500,11 +3552,14 @@ static irqreturn_t bttv_irq(int irq, void *dev_id, struct pt_regs * regs)
 			wake_up(&btv->i2c_queue);
 		}
 
+                if ((astat & BT848_INT_RISCI)  &&  (stat & (4<<28)))
+			bttv_irq_switch_vbi(btv);
+
                 if ((astat & BT848_INT_RISCI)  &&  (stat & (2<<28)))
 			bttv_irq_wakeup_top(btv);
 
                 if ((astat & BT848_INT_RISCI)  &&  (stat & (1<<28)))
-			bttv_irq_switch_fields(btv);
+			bttv_irq_switch_video(btv);
 
 		if ((astat & BT848_INT_HLOCK)  &&  btv->opt_automute)
 			audio_mux(btv, -1);
@@ -3872,9 +3927,11 @@ static int bttv_suspend(struct pci_dev *pci_dev, u32 state)
 	/* stop dma + irqs */
 	spin_lock_irqsave(&btv->s_lock,flags);
 	memset(&idle, 0, sizeof(idle));
-	btv->state.set = btv->curr;
+	btv->state.video = btv->curr;
+	btv->state.vbi   = btv->cvbi;
 	btv->curr = idle;
-	bttv_buffer_set_activate(btv, &idle);
+	bttv_buffer_activate_video(btv, &idle);
+	bttv_buffer_activate_vbi(btv, NULL);
 	bttv_set_dma(btv, 0, 0);
 	btwrite(0, BT848_INT_MASK);
 	spin_unlock_irqrestore(&btv->s_lock,flags);
@@ -3914,8 +3971,10 @@ static int bttv_resume(struct pci_dev *pci_dev)
 
 	/* restart dma */
 	spin_lock_irqsave(&btv->s_lock,flags);
-	btv->curr = btv->state.set;
-	bttv_buffer_set_activate(btv, &btv->curr);
+	btv->curr = btv->state.video;
+	btv->cvbi = btv->state.vbi;
+	bttv_buffer_activate_video(btv, &btv->curr);
+	bttv_buffer_activate_vbi(btv, btv->cvbi);
 	bttv_set_dma(btv, 0, btv->curr.irqflags);
 	spin_unlock_irqrestore(&btv->s_lock,flags);
 	return 0;
diff --git a/drivers/media/video/bttv-risc.c b/drivers/media/video/bttv-risc.c
index c512416a0..769c7e365 100644
--- a/drivers/media/video/bttv-risc.c
+++ b/drivers/media/video/bttv-risc.c
@@ -379,7 +379,7 @@ bttv_set_dma(struct bttv *btv, int override, int irqflags)
 	btv->cap_ctl = 0;
 	if (NULL != btv->curr.top)      btv->cap_ctl |= 0x02;
 	if (NULL != btv->curr.bottom)   btv->cap_ctl |= 0x01;
-	if (NULL != btv->curr.vbi)      btv->cap_ctl |= 0x0c;
+	if (NULL != btv->cvbi)          btv->cap_ctl |= 0x0c;
 
 	capctl  = 0;
 	capctl |= (btv->cap_ctl & 0x03) ? 0x03 : 0x00;  /* capture  */
@@ -389,9 +389,9 @@ bttv_set_dma(struct bttv *btv, int override, int irqflags)
 	d2printk(KERN_DEBUG
 		 "bttv%d: capctl=%x irq=%d top=%08Lx/%08Lx even=%08Lx/%08Lx\n",
 		 btv->c.nr,capctl,irqflags,
-		 btv->curr.vbi     ? (unsigned long long)btv->curr.vbi->top.dma        : 0,
+		 btv->cvbi         ? (unsigned long long)btv->cvbi->top.dma            : 0,
 		 btv->curr.top     ? (unsigned long long)btv->curr.top->top.dma        : 0,
-		 btv->curr.vbi     ? (unsigned long long)btv->curr.vbi->bottom.dma     : 0,
+		 btv->cvbi         ? (unsigned long long)btv->cvbi->bottom.dma         : 0,
 		 btv->curr.bottom  ? (unsigned long long)btv->curr.bottom->bottom.dma  : 0);
 	
 	cmd = BT848_RISC_JUMP;
@@ -399,6 +399,8 @@ bttv_set_dma(struct bttv *btv, int override, int irqflags)
 		cmd |= BT848_RISC_IRQ;
 		cmd |= (irqflags  & 0x0f) << 16;
 		cmd |= (~irqflags & 0x0f) << 20;
+	}
+	if (irqflags || btv->cvbi) {
 		mod_timer(&btv->timeout, jiffies+BTTV_TIMEOUT);
 	} else {
 		del_timer(&btv->timeout);
@@ -501,20 +503,26 @@ bttv_dma_free(struct bttv *btv, struct bttv_buffer *buf)
 }
 
 int
-bttv_buffer_set_activate(struct bttv *btv,
-			 struct bttv_buffer_set *set)
+bttv_buffer_activate_vbi(struct bttv *btv,
+			 struct bttv_buffer *vbi)
 {
 	/* vbi capture */
-	if (set->vbi) {
-		set->vbi->vb.state = STATE_ACTIVE;
-		list_del(&set->vbi->vb.queue);
-		bttv_risc_hook(btv, RISC_SLOT_O_VBI, &set->vbi->top,    0);
-		bttv_risc_hook(btv, RISC_SLOT_E_VBI, &set->vbi->bottom, 0);
+	if (vbi) {
+		vbi->vb.state = STATE_ACTIVE;
+		list_del(&vbi->vb.queue);
+		bttv_risc_hook(btv, RISC_SLOT_O_VBI, &vbi->top,    0);
+		bttv_risc_hook(btv, RISC_SLOT_E_VBI, &vbi->bottom, 4);
 	} else {
 		bttv_risc_hook(btv, RISC_SLOT_O_VBI, NULL, 0);
 		bttv_risc_hook(btv, RISC_SLOT_E_VBI, NULL, 0);
 	}
+	return 0;
+}
 
+int
+bttv_buffer_activate_video(struct bttv *btv,
+			   struct bttv_buffer_set *set)
+{
 	/* video capture */
 	if (NULL != set->top  &&  NULL != set->bottom) {
 		if (set->top == set->bottom) {
diff --git a/drivers/media/video/bttv-vbi.c b/drivers/media/video/bttv-vbi.c
index f3d12cde0..ad655c8aa 100644
--- a/drivers/media/video/bttv-vbi.c
+++ b/drivers/media/video/bttv-vbi.c
@@ -114,7 +114,10 @@ vbi_buffer_queue(struct file *file, struct videobuf_buffer *vb)
 	dprintk("queue %p\n",vb);
 	buf->vb.state = STATE_QUEUED;
 	list_add_tail(&buf->vb.queue,&btv->vcapture);
-	bttv_set_dma(btv,0x0c,1);
+	if (NULL == btv->cvbi) {
+		fh->btv->curr.irqflags |= 4;
+		bttv_set_dma(btv,0x0c,fh->btv->curr.irqflags);
+	}
 }
 
 static void vbi_buffer_release(struct file *file, struct videobuf_buffer *vb)
diff --git a/drivers/media/video/bttv.h b/drivers/media/video/bttv.h
index 99df391fb..33d56aa9d 100644
--- a/drivers/media/video/bttv.h
+++ b/drivers/media/video/bttv.h
@@ -124,6 +124,8 @@
 #define BTTV_SIMUS_GVC1100  0x74
 #define BTTV_NGSTV_PLUS     0x75
 #define BTTV_LMLBT4         0x76
+#define BTTV_PICOLO_TETRA_CHIP 0x79
+#define BTTV_AVDVBT_771     0x7b
 
 /* i2c address list */
 #define I2C_TSA5522        0xc2
diff --git a/drivers/media/video/bttvp.h b/drivers/media/video/bttvp.h
index 2257381fd..fae428ea4 100644
--- a/drivers/media/video/bttvp.h
+++ b/drivers/media/video/bttvp.h
@@ -25,7 +25,7 @@
 #define _BTTVP_H_
 
 #include <linux/version.h>
-#define BTTV_VERSION_CODE KERNEL_VERSION(0,9,14)
+#define BTTV_VERSION_CODE KERNEL_VERSION(0,9,15)
 
 #include <linux/types.h>
 #include <linux/wait.h>
@@ -127,7 +127,6 @@ struct bttv_buffer {
 struct bttv_buffer_set {
 	struct bttv_buffer     *top;       /* top field buffer    */
 	struct bttv_buffer     *bottom;    /* bottom field buffer */
-	struct bttv_buffer     *vbi;       /* vbi buffer */
 	unsigned int           irqflags;
 	unsigned int           topirq;
 };
@@ -197,8 +196,10 @@ int bttv_risc_hook(struct bttv *btv, int slot, struct btcx_riscmem *risc,
 
 /* capture buffer handling */
 int bttv_buffer_risc(struct bttv *btv, struct bttv_buffer *buf);
-int bttv_buffer_set_activate(struct bttv *btv,
-			     struct bttv_buffer_set *set);
+int bttv_buffer_activate_video(struct bttv *btv,
+			       struct bttv_buffer_set *set);
+int bttv_buffer_activate_vbi(struct bttv *btv,
+			     struct bttv_buffer *vbi);
 void bttv_dma_free(struct bttv *btv, struct bttv_buffer *buf);
 
 /* overlay handling */
@@ -279,7 +280,8 @@ struct bttv_suspend_state {
 	u32  gpio_enable;
 	u32  gpio_data;
 	int  disabled;
-	struct bttv_buffer_set set;
+	struct bttv_buffer_set video;
+	struct bttv_buffer     *vbi;
 };
 
 struct bttv {
@@ -377,6 +379,7 @@ struct bttv {
 	struct list_head        capture;    /* video capture queue */
 	struct list_head        vcapture;   /* vbi capture queue   */
 	struct bttv_buffer_set  curr;       /* active buffers      */
+	struct bttv_buffer      *cvbi;      /* active vbi buffer   */
 	int                     new_input;
 
 	unsigned long cap_ctl;
diff --git a/drivers/media/video/bw-qcam.c b/drivers/media/video/bw-qcam.c
index c90ec3be7..31412e8d3 100644
--- a/drivers/media/video/bw-qcam.c
+++ b/drivers/media/video/bw-qcam.c
@@ -599,7 +599,7 @@ static inline int qc_readbytes(struct qcam_device *q, char buffer[])
  * n=2^(bit depth)-1.  Ask me for more details if you don't understand
  * this. */
 
-long qc_capture(struct qcam_device * q, char *buf, unsigned long len)
+long qc_capture(struct qcam_device * q, char __user *buf, unsigned long len)
 {
 	int i, j, k, yield;
 	int bytes;
@@ -660,7 +660,7 @@ long qc_capture(struct qcam_device * q, char *buf, unsigned long len)
 			}
 			pixels_read += bytes;
 		}
-		(void) qc_readbytes(q, 0);	/* reset state machine */
+		(void) qc_readbytes(q, NULL);	/* reset state machine */
 		
 		/* Grabbing an entire frame from the quickcam is a lengthy
 		   process. We don't (usually) want to busy-block the
@@ -855,7 +855,7 @@ static int qcam_ioctl(struct inode *inode, struct file *file,
 	return video_usercopy(inode, file, cmd, arg, qcam_do_ioctl);
 }
 
-static ssize_t qcam_read(struct file *file, char *buf,
+static ssize_t qcam_read(struct file *file, char __user *buf,
 			 size_t count, loff_t *ppos)
 {
 	struct video_device *v = video_devdata(file);
diff --git a/drivers/media/video/c-qcam.c b/drivers/media/video/c-qcam.c
index ee9711000..bd9fef419 100644
--- a/drivers/media/video/c-qcam.c
+++ b/drivers/media/video/c-qcam.c
@@ -358,7 +358,7 @@ get_fragment:
 
 #define BUFSZ	150
 
-static long qc_capture(struct qcam_device *q, char *buf, unsigned long len)
+static long qc_capture(struct qcam_device *q, char __user *buf, unsigned long len)
 {
 	unsigned lines, pixelsperline, bitsperxfer;
 	unsigned int is_bi_dir = q->bidirectional;
@@ -667,7 +667,7 @@ static int qcam_ioctl(struct inode *inode, struct file *file,
 	return video_usercopy(inode, file, cmd, arg, qcam_do_ioctl);
 }
 
-static ssize_t qcam_read(struct file *file, char *buf,
+static ssize_t qcam_read(struct file *file, char __user *buf,
 			 size_t count, loff_t *ppos)
 {
 	struct video_device *v = video_devdata(file);
diff --git a/drivers/media/video/cpia.c b/drivers/media/video/cpia.c
index 38d75f388..02c012dbc 100644
--- a/drivers/media/video/cpia.c
+++ b/drivers/media/video/cpia.c
@@ -585,7 +585,7 @@ static unsigned long int value(char **buffer, unsigned long *count, int *err)
 	return ret;
 }
 
-static int cpia_write_proc(struct file *file, const char *buf,
+static int cpia_write_proc(struct file *file, const char __user *buf,
                            unsigned long count, void *data)
 {
 	struct cam_data *cam = data;
@@ -1400,7 +1400,7 @@ static void destroy_proc_cpia_cam(struct cam_data *cam)
 
 static void proc_cpia_create(void)
 {
-	cpia_proc_root = create_proc_entry("cpia", S_IFDIR, 0);
+	cpia_proc_root = create_proc_entry("cpia", S_IFDIR, NULL);
 
 	if (cpia_proc_root)
 		cpia_proc_root->owner = THIS_MODULE;
@@ -1410,7 +1410,7 @@ static void proc_cpia_create(void)
 
 static void __exit proc_cpia_destroy(void)
 {
-	remove_proc_entry("cpia", 0);
+	remove_proc_entry("cpia", NULL);
 }
 #endif /* CONFIG_PROC_FS */
 
@@ -1624,7 +1624,7 @@ static int free_frame_buf(struct cam_data *cam)
 	int i;
 	
 	rvfree(cam->frame_buf, FRAME_NUM*CPIA_MAX_FRAME_SIZE);
-	cam->frame_buf = 0;
+	cam->frame_buf = NULL;
 	for (i=0; i < FRAME_NUM; i++)
 		cam->frame[i].data = NULL;
 
@@ -3299,7 +3299,7 @@ static int cpia_close(struct inode *inode, struct file *file)
 	return 0;
 }
 
-static ssize_t cpia_read(struct file *file, char *buf,
+static ssize_t cpia_read(struct file *file, char __user *buf,
 			 size_t count, loff_t *ppos)
 {
 	struct video_device *dev = file->private_data;
diff --git a/drivers/media/video/cx88/cx88-cards.c b/drivers/media/video/cx88/cx88-cards.c
index 3807ef98b..1e183aae0 100644
--- a/drivers/media/video/cx88/cx88-cards.c
+++ b/drivers/media/video/cx88/cx88-cards.c
@@ -99,6 +99,10 @@ struct cx88_board cx88_boards[] = {
 		.input          = {{
 			.type   = CX88_VMUX_TELEVISION,
 			.vmux   = 0,
+                        .gpio0  = 0x000003ff,
+                        .gpio1  = 0x000000ff,
+                        .gpio2  = 0x000000ff,
+                        .gpio3  = 0x00000000,
 		},{
 			.type   = CX88_VMUX_COMPOSITE1,
 			.vmux   = 1,
@@ -111,6 +115,7 @@ struct cx88_board cx88_boards[] = {
         [CX88_BOARD_WINFAST2000XP] = {
                 .name           = "Leadtek Winfast 2000XP Expert",
                 .tuner_type     = 44,
+		.needs_tda9887  = 1,
                 .input          = {{
                         .type   = CX88_VMUX_TELEVISION,
                         .vmux   = 0,
@@ -149,22 +154,33 @@ struct cx88_board cx88_boards[] = {
 			.vmux   = 0,
 		}},
 	},
-	[CX88_BOARD_MSI_TVANYWHERE] = {
+	[CX88_BOARD_MSI_TVANYWHERE_MASTER] = {
+		//added gpio values thanks to Torsten Seeboth
+		//values for PAL from DScaler
 		.name           = "MSI TV-@nywhere Master",
 		.tuner_type     = 33,
+		.needs_tda9887	= 1,
 		.input          = {{
 			.type   = CX88_VMUX_TELEVISION,
 			.vmux   = 0,
+			.gpio0  = 0x000040bf,
+			.gpio1  = 0x000080c0,
+			.gpio2  = 0x0000ff40,
+                   	.gpio3  = 0x00000000,
 		},{
                         .type   = CX88_VMUX_COMPOSITE1,
                         .vmux   = 1,
-		},{
-			 // temporarly for testing ...
-                        .type   = CX88_VMUX_COMPOSITE2,
-                        .vmux   = 2,
+			.gpio0  = 0x000040bf,
+			.gpio1  = 0x000080c0,
+			.gpio2  = 0x0000ff40,
+			.gpio3  = 0x00000000,
 		},{
                         .type   = CX88_VMUX_SVIDEO,
                         .vmux   = 2,
+			.gpio0  = 0x000040bf,
+			.gpio1  = 0x000080c0,
+			.gpio2  = 0x0000ff40,
+			.gpio3  = 0x00000000,
                 }},
                 .radio = {
                         .type   = CX88_RADIO,
@@ -199,8 +215,97 @@ struct cx88_board cx88_boards[] = {
                         .type   = CX88_RADIO,
                 },
         },
-
-
+	[CX88_BOARD_IODATA_GVVCP3PCI] = {
+ 		.name		= "IODATA GV-VCP3/PCI",
+		.tuner_type     = TUNER_ABSENT,
+		.needs_tda9887  = 0,
+ 		.input          = {{
+ 			.type   = CX88_VMUX_COMPOSITE1,
+ 			.vmux   = 0,
+ 		},{
+ 			.type   = CX88_VMUX_COMPOSITE2,
+ 			.vmux   = 1,
+ 		},{
+ 			.type   = CX88_VMUX_SVIDEO,
+ 			.vmux   = 2,
+ 		}},
+ 	},
+	[CX88_BOARD_PROLINK_PLAYTVPVR] = {
+                .name           = "Prolink PlayTV PVR",
+                .tuner_type     = 43,
+		.needs_tda9887	= 1,
+		.input          = {{
+			.type   = CX88_VMUX_TELEVISION,
+			.vmux   = 0,
+			.gpio0  = 0xff00,
+		},{
+			.type   = CX88_VMUX_COMPOSITE1,
+			.vmux   = 1,
+			.gpio0  = 0xff03,
+		},{
+			.type   = CX88_VMUX_SVIDEO,
+			.vmux   = 2,
+			.gpio0  = 0xff03,
+		}},
+		.radio = {
+			.type   = CX88_RADIO,
+			.gpio0  = 0xff00,
+		},
+	},
+	[CX88_BOARD_ASUS_PVR_416] = {
+		.name		= "ASUS PVR-416",
+		.tuner_type     = 43,
+                .needs_tda9887  = 1,
+		.input          = {{
+			.type   = CX88_VMUX_TELEVISION,
+			.vmux   = 0,
+			.gpio0  = 0x0000fde6,
+			.gpio1  = 0x00000000, // possibly for mpeg data
+			.gpio2  = 0x000000e9,
+                   	.gpio3  = 0x00000000,
+ 		},{
+			.type   = CX88_VMUX_SVIDEO,
+			.vmux   = 2,
+			.gpio0  = 0x0000fde6, // 0x0000fda6 L,R RCA audio in?
+			.gpio1  = 0x00000000, // possibly for mpeg data
+			.gpio2  = 0x000000e9,
+                   	.gpio3  = 0x00000000,
+		}},
+                .radio = {
+                        .type   = CX88_RADIO,
+			.gpio0  = 0x0000fde2,
+			.gpio1  = 0x00000000,
+			.gpio2  = 0x000000e9,
+                   	.gpio3  = 0x00000000,
+                },
+	},
+	[CX88_BOARD_MSI_TVANYWHERE] = {
+		.name           = "MSI TV-@nywhere",
+		.tuner_type     = 33,
+		.needs_tda9887  = 1,
+		.input          = {{
+			.type   = CX88_VMUX_TELEVISION,
+			.vmux   = 0,
+			.gpio0  = 0x00000fbf,
+			.gpio1  = 0x000000c0,
+			.gpio2  = 0x0000fc08,
+			.gpio3  = 0x00000000,
+		},{
+  			.type   = CX88_VMUX_COMPOSITE1,
+  			.vmux   = 1,
+			.gpio0  = 0x00000fbf,
+			.gpio1  = 0x000000c0,
+			.gpio2  = 0x0000fc68,
+			.gpio3  = 0x00000000,
+		},{
+  			.type   = CX88_VMUX_SVIDEO,
+  			.vmux   = 2,
+			.gpio0  = 0x00000fbf,
+			.gpio1  = 0x000000c0,
+			.gpio2  = 0x0000fc68,
+			.gpio3  = 0x00000000,
+  		}},
+	},
 };
 const unsigned int cx88_bcount = ARRAY_SIZE(cx88_boards);
 
@@ -240,6 +345,10 @@ struct cx88_subid cx88_subids[] = {
 		.subvendor = 0x107d,
                 .subdevice = 0x6620,
                 .card      = CX88_BOARD_WINFAST_DV2000,
+        },{
+                .subvendor = 0x107d,
+                .subdevice = 0x663b,
+                .card      = CX88_BOARD_LEADTEK_PVR2000,
         },{
                 .subvendor = 0x107d,
                 .subdevice = 0x663C,
@@ -251,12 +360,19 @@ struct cx88_subid cx88_subids[] = {
 	},{
 		.subvendor = 0x1462,
 		.subdevice = 0x8606,
-		.card      = CX88_BOARD_MSI_TVANYWHERE,
-	}
+		.card      = CX88_BOARD_MSI_TVANYWHERE_MASTER,
+	},{
+ 		.subvendor = 0x10fc,
+ 		.subdevice = 0xd003,
+ 		.card      = CX88_BOARD_IODATA_GVVCP3PCI,
+	},{
+ 		.subvendor = 0x1043,
+ 		.subdevice = 0x4823,  /* with mpeg encoder */
+ 		.card      = CX88_BOARD_ASUS_PVR_416,
+ 	}
 };
 const unsigned int cx88_idcount = ARRAY_SIZE(cx88_subids);
 
-
 /* ----------------------------------------------------------------------- */
 /* some leadtek specific stuff                                             */
 
@@ -386,20 +502,22 @@ static struct {
 	[ 0x02 ] = { .id   = TUNER_ABSENT,
 		     .name = "PAL_B" },
 	[ 0x03 ] = { .id   = TUNER_ABSENT,
-		     .name = "BAL_I" },
+		     .name = "PAL_I" },
 	[ 0x04 ] = { .id   = TUNER_ABSENT,
 		     .name = "PAL_D" },
 	[ 0x05 ] = { .id   = TUNER_ABSENT,
 		     .name = "SECAM" },
 
-	[ 0x10 ] = { .id   = TUNER_ABSENT, .fm = 1, 
+	[ 0x10 ] = { .id   = TUNER_ABSENT,
+		     .fm   = 1,
 		     .name = "TEMIC_4049" },
 	[ 0x11 ] = { .id   = TUNER_TEMIC_4136FY5,
 		     .name = "TEMIC_4136" },
 	[ 0x12 ] = { .id   = TUNER_ABSENT,
 		     .name = "TEMIC_4146" },
 
-	[ 0x20 ] = { .id   = TUNER_PHILIPS_FQ1216ME, .fm = 1,
+	[ 0x20 ] = { .id   = TUNER_PHILIPS_FQ1216ME,
+		     .fm   = 1,
 		     .name = "PHILIPS_FQ1216_MK3" },
 	[ 0x21 ] = { .id   = TUNER_ABSENT, .fm = 1,
 		     .name = "PHILIPS_FQ1236_MK3" },
@@ -454,7 +572,33 @@ i2c_eeprom(struct i2c_client *c, unsigned char *eedata, int len)
 	return 0;
 }
 
-void __devinit cx88_card_setup(struct cx8800_dev *dev)
+void cx88_card_list(struct cx8800_dev *dev)
+{
+	int i;
+
+	if (0 == dev->pci->subsystem_vendor &&
+	    0 == dev->pci->subsystem_device) {
+		printk("%s: Your board has no valid PCI Subsystem ID and thus can't\n"
+		       "%s: be autodetected.  Please pass card=<n> insmod option to\n"
+		       "%s: workaround that.  Redirect complaints to the vendor of\n"
+		       "%s: the TV card.  Best regards,\n"
+		       "%s:         -- tux\n",
+		       dev->name,dev->name,dev->name,dev->name,dev->name);
+	} else {
+		printk("%s: Your board isn't known (yet) to the driver.  You can\n"
+		       "%s: try to pick one of the existing card configs via\n"
+		       "%s: card=<n> insmod option.  Updating to the latest\n"
+		       "%s: version might help as well.\n",
+		       dev->name,dev->name,dev->name,dev->name);
+	}
+	printk("%s: Here is a list of valid choices for the card=<n> insmod option:\n",
+	       dev->name);
+	for (i = 0; i < cx88_bcount; i++)
+		printk("%s:    card=%d -> %s\n",
+		       dev->name, i, cx88_boards[i].name);
+}
+
+void cx88_card_setup(struct cx8800_dev *dev)
 {
 	static u8 eeprom[128];
 		
@@ -474,6 +618,9 @@ void __devinit cx88_card_setup(struct cx8800_dev *dev)
 			i2c_eeprom(&dev->i2c_client,eeprom,sizeof(eeprom));
 		leadtek_eeprom(dev,eeprom);
 		break;
+        case CX88_BOARD_ASUS_PVR_416:
+		dev->has_radio = 1;
+                break;
 	}
 }
 
@@ -483,6 +630,7 @@ EXPORT_SYMBOL(cx88_boards);
 EXPORT_SYMBOL(cx88_bcount);
 EXPORT_SYMBOL(cx88_subids);
 EXPORT_SYMBOL(cx88_idcount);
+EXPORT_SYMBOL(cx88_card_list);
 EXPORT_SYMBOL(cx88_card_setup);
 
 /*
diff --git a/drivers/media/video/cx88/cx88-i2c.c b/drivers/media/video/cx88/cx88-i2c.c
index 9396ec27c..a04aad36c 100644
--- a/drivers/media/video/cx88/cx88-i2c.c
+++ b/drivers/media/video/cx88/cx88-i2c.c
@@ -22,8 +22,6 @@
     
 */
 
-#define __NO_VERSION__ 1
-
 #include <linux/module.h>
 #include <linux/init.h>
 
diff --git a/drivers/media/video/cx88/cx88-reg.h b/drivers/media/video/cx88/cx88-reg.h
index 4ecce88a8..a80b7519e 100644
--- a/drivers/media/video/cx88/cx88-reg.h
+++ b/drivers/media/video/cx88/cx88-reg.h
@@ -599,10 +599,20 @@
 #define EN_I2SIN_STR2DAC        0x00004000
 #define EN_I2SIN_ENABLE         0x00008000
 
+#if 0
+/* old */
 #define EN_DMTRX_SUMDIFF        0x00000800
 #define EN_DMTRX_SUMR           0x00000880
 #define EN_DMTRX_LR             0x00000900
 #define EN_DMTRX_MONO           0x00000980
+#else
+/* dscaler cvs */
+#define EN_DMTRX_SUMDIFF        (0 << 7)
+#define EN_DMTRX_SUMR           (1 << 7)
+#define EN_DMTRX_LR             (2 << 7)
+#define EN_DMTRX_MONO           (3 << 7)
+#define EN_DMTRX_BYPASS         (1 << 11)
+#endif
 
 // Video 
 #define VID_CAPTURE_CONTROL		0x310180
diff --git a/drivers/media/video/cx88/cx88-tvaudio.c b/drivers/media/video/cx88/cx88-tvaudio.c
index 6b57e4518..f6def3df9 100644
--- a/drivers/media/video/cx88/cx88-tvaudio.c
+++ b/drivers/media/video/cx88/cx88-tvaudio.c
@@ -48,6 +48,7 @@
 #include <linux/interrupt.h>
 #include <linux/vmalloc.h>
 #include <linux/init.h>
+#include <linux/smp_lock.h>
 
 #include "cx88.h"
 
@@ -60,6 +61,33 @@ MODULE_PARM_DESC(audio_debug,"enable debug messages [audio]");
 
 /* ----------------------------------------------------------- */
 
+static char *aud_ctl_names[64] =
+{
+	[ EN_BTSC_FORCE_MONO       ] = "BTSC_FORCE_MONO",
+	[ EN_BTSC_FORCE_STEREO     ] = "BTSC_FORCE_STEREO",
+	[ EN_BTSC_FORCE_SAP        ] = "BTSC_FORCE_SAP",
+	[ EN_BTSC_AUTO_STEREO      ] = "BTSC_AUTO_STEREO",
+	[ EN_BTSC_AUTO_SAP         ] = "BTSC_AUTO_SAP",
+	[ EN_A2_FORCE_MONO1        ] = "A2_FORCE_MONO1",
+	[ EN_A2_FORCE_MONO2        ] = "A2_FORCE_MONO2",
+	[ EN_A2_FORCE_STEREO       ] = "A2_FORCE_STEREO",
+	[ EN_A2_AUTO_MONO2         ] = "A2_AUTO_MONO2",
+	[ EN_A2_AUTO_STEREO        ] = "A2_AUTO_STEREO",
+	[ EN_EIAJ_FORCE_MONO1      ] = "EIAJ_FORCE_MONO1",
+	[ EN_EIAJ_FORCE_MONO2      ] = "EIAJ_FORCE_MONO2",
+	[ EN_EIAJ_FORCE_STEREO     ] = "EIAJ_FORCE_STEREO",
+	[ EN_EIAJ_AUTO_MONO2       ] = "EIAJ_AUTO_MONO2",
+	[ EN_EIAJ_AUTO_STEREO      ] = "EIAJ_AUTO_STEREO",
+	[ EN_NICAM_FORCE_MONO1     ] = "NICAM_FORCE_MONO1",
+	[ EN_NICAM_FORCE_MONO2     ] = "NICAM_FORCE_MONO2",
+	[ EN_NICAM_FORCE_STEREO    ] = "NICAM_FORCE_STEREO",
+	[ EN_NICAM_AUTO_MONO2      ] = "NICAM_AUTO_MONO2",
+	[ EN_NICAM_AUTO_STEREO     ] = "NICAM_AUTO_STEREO",
+	[ EN_FMRADIO_FORCE_MONO    ] = "FMRADIO_FORCE_MONO",
+	[ EN_FMRADIO_FORCE_STEREO  ] = "FMRADIO_FORCE_STEREO",
+	[ EN_FMRADIO_AUTO_STEREO   ] = "FMRADIO_AUTO_STEREO",
+};
+
 struct rlist {
 	u32 reg;
 	u32 val;
@@ -125,26 +153,116 @@ static void set_audio_finish(struct cx8800_dev *dev)
 static void set_audio_standard_BTSC(struct cx8800_dev *dev, unsigned int sap)
 {
 	static const struct rlist btsc[] = {
-		/* Magic stuff from leadtek driver + datasheet.*/
-		{ AUD_DBX_IN_GAIN,   0x4734 },
-		{ AUD_DBX_WBE_GAIN,  0x4640 },
-		{ AUD_DBX_SE_GAIN,   0x8D31 },
-		{ AUD_DEEMPH0_G0,    0x1604 },
-		{ AUD_PHASE_FIX_CTL, 0x0020 },
-
+		/* from dscaler */
+		{ AUD_OUT1_SEL,                0x00000013 },
+		{ AUD_OUT1_SHIFT,              0x00000000 },
+		{ AUD_POLY0_DDS_CONSTANT,      0x0012010c },
+		{ AUD_DMD_RA_DDS,              0x00c3e7aa },
+		{ AUD_DBX_IN_GAIN,             0x00004734 },
+		{ AUD_DBX_WBE_GAIN,            0x00004640 },
+		{ AUD_DBX_SE_GAIN,             0x00008d31 },
+		{ AUD_DCOC_0_SRC,              0x0000001a },
+		{ AUD_IIR1_4_SEL,              0x00000021 },
+		{ AUD_DCOC_PASS_IN,            0x00000003 },
+		{ AUD_DCOC_0_SHIFT_IN0,        0x0000000a },
+		{ AUD_DCOC_0_SHIFT_IN1,        0x00000008 },
+		{ AUD_DCOC_1_SHIFT_IN0,        0x0000000a },
+		{ AUD_DCOC_1_SHIFT_IN1,        0x00000008 },
+		{ AUD_DN0_FREQ,                0x0000283b },
+		{ AUD_DN2_SRC_SEL,             0x00000008 },
+		{ AUD_DN2_FREQ,                0x00003000 },
+		{ AUD_DN2_AFC,                 0x00000002 },
+		{ AUD_DN2_SHFT,                0x00000000 },
+		{ AUD_IIR2_2_SEL,              0x00000020 },
+		{ AUD_IIR2_2_SHIFT,            0x00000000 },
+		{ AUD_IIR2_3_SEL,              0x0000001f },
+		{ AUD_IIR2_3_SHIFT,            0x00000000 },
+		{ AUD_CRDC1_SRC_SEL,           0x000003ce },
+		{ AUD_CRDC1_SHIFT,             0x00000000 },
+		{ AUD_CORDIC_SHIFT_1,          0x00000007 },
+		{ AUD_DCOC_1_SRC,              0x0000001b },
+		{ AUD_DCOC1_SHIFT,             0x00000000 },
+		{ AUD_RDSI_SEL,                0x00000008 },
+		{ AUD_RDSQ_SEL,                0x00000008 },
+		{ AUD_RDSI_SHIFT,              0x00000000 },
+		{ AUD_RDSQ_SHIFT,              0x00000000 },
+		{ AUD_POLYPH80SCALEFAC,        0x00000003 },
+                { /* end of list */ },
+	};
+	static const struct rlist btsc_sap[] = {
+		{ AUD_DBX_IN_GAIN,             0x00007200 },
+		{ AUD_DBX_WBE_GAIN,            0x00006200 },
+		{ AUD_DBX_SE_GAIN,             0x00006200 },
+		{ AUD_IIR1_1_SEL,              0x00000000 },
+		{ AUD_IIR1_3_SEL,              0x00000001 },
+		{ AUD_DN1_SRC_SEL,             0x00000007 },
+		{ AUD_IIR1_4_SHIFT,            0x00000006 },
+		{ AUD_IIR2_1_SHIFT,            0x00000000 },
+		{ AUD_IIR2_2_SHIFT,            0x00000000 },
+		{ AUD_IIR3_0_SHIFT,            0x00000000 },
+		{ AUD_IIR3_1_SHIFT,            0x00000000 },
+		{ AUD_IIR3_0_SEL,              0x0000000d },
+		{ AUD_IIR3_1_SEL,              0x0000000e },
+		{ AUD_DEEMPH1_SRC_SEL,         0x00000014 },
+		{ AUD_DEEMPH1_SHIFT,           0x00000000 },
+		{ AUD_DEEMPH1_G0,              0x00004000 },
+		{ AUD_DEEMPH1_A0,              0x00000000 },
+		{ AUD_DEEMPH1_B0,              0x00000000 },
+		{ AUD_DEEMPH1_A1,              0x00000000 },
+		{ AUD_DEEMPH1_B1,              0x00000000 },
+		{ AUD_OUT0_SEL,                0x0000003f },
+		{ AUD_OUT1_SEL,                0x0000003f },
+		{ AUD_DN1_AFC,                 0x00000002 },
+		{ AUD_DCOC_0_SHIFT_IN0,        0x0000000a },
+		{ AUD_DCOC_0_SHIFT_IN1,        0x00000008 },
+		{ AUD_DCOC_1_SHIFT_IN0,        0x0000000a },
+		{ AUD_DCOC_1_SHIFT_IN1,        0x00000008 },
+		{ AUD_IIR1_0_SEL,              0x0000001d },
+		{ AUD_IIR1_2_SEL,              0x0000001e },
+		{ AUD_IIR2_1_SEL,              0x00000002 },
+		{ AUD_IIR2_2_SEL,              0x00000004 },
+		{ AUD_IIR3_2_SEL,              0x0000000f },
+		{ AUD_DCOC2_SHIFT,             0x00000001 },
+		{ AUD_IIR3_2_SHIFT,            0x00000001 },
+		{ AUD_DEEMPH0_SRC_SEL,         0x00000014 },
+		{ AUD_CORDIC_SHIFT_1,          0x00000006 },
+		{ AUD_POLY0_DDS_CONSTANT,      0x000e4db2 },
+		{ AUD_DMD_RA_DDS,              0x00f696e6 },
+		{ AUD_IIR2_3_SEL,              0x00000025 },
+		{ AUD_IIR1_4_SEL,              0x00000021 },
+		{ AUD_DN1_FREQ,                0x0000c965 },
+		{ AUD_DCOC_PASS_IN,            0x00000003 },
+		{ AUD_DCOC_0_SRC,              0x0000001a },
+		{ AUD_DCOC_1_SRC,              0x0000001b },
+		{ AUD_DCOC1_SHIFT,             0x00000000 },
+		{ AUD_RDSI_SEL,                0x00000009 },
+		{ AUD_RDSQ_SEL,                0x00000009 },
+		{ AUD_RDSI_SHIFT,              0x00000000 },
+		{ AUD_RDSQ_SHIFT,              0x00000000 },
+		{ AUD_POLYPH80SCALEFAC,        0x00000003 },
                 { /* end of list */ },
 	};
 
-	dprintk("%s (status: unknown)\n",__FUNCTION__);
-	set_audio_start(dev, 0x0001,
-			EN_BTSC_AUTO_STEREO);
-        set_audio_registers(dev, btsc);
+	// dscaler: exactly taken from driver,
+	// dscaler: don't know why to set EN_FMRADIO_EN_RDS
+	if (sap) {
+		dprintk("%s SAP (status: unknown)\n",__FUNCTION__);
+		set_audio_start(dev, 0x0001,
+				EN_FMRADIO_EN_RDS | EN_BTSC_FORCE_SAP);
+		set_audio_registers(dev, btsc_sap);
+	} else {
+		dprintk("%s (status: known-good)\n",__FUNCTION__);
+		set_audio_start(dev, 0x0001,
+				EN_FMRADIO_EN_RDS | EN_BTSC_AUTO_STEREO);
+		set_audio_registers(dev, btsc);
+	}
 	set_audio_finish(dev);
 }
 
 static void set_audio_standard_NICAM(struct cx8800_dev *dev)
 {
-	static const struct rlist nicam[] = {
+	static const struct rlist nicam_common[] = {
+		/* from dscaler */
     		{ AUD_RATE_ADJ1,           0x00000010 },
     		{ AUD_RATE_ADJ2,           0x00000040 },
     		{ AUD_RATE_ADJ3,           0x00000100 },
@@ -152,21 +270,64 @@ static void set_audio_standard_NICAM(struct cx8800_dev *dev)
     		{ AUD_RATE_ADJ5,           0x00001000 },
     //		{ AUD_DMD_RA_DDS,          0x00c0d5ce },
 
+		// Deemphasis 1:
+		{ AUD_DEEMPHGAIN_R,        0x000023c2 },
+		{ AUD_DEEMPHNUMER1_R,      0x0002a7bc },
+		{ AUD_DEEMPHNUMER2_R,      0x0003023e },
+		{ AUD_DEEMPHDENOM1_R,      0x0000f3d0 },
+		{ AUD_DEEMPHDENOM2_R,      0x00000000 },
+
+#if 0
+		// Deemphasis 2: (other tv norm?)
+		{ AUD_DEEMPHGAIN_R,        0x0000c600 },
+		{ AUD_DEEMPHNUMER1_R,      0x00066738 },
+		{ AUD_DEEMPHNUMER2_R,      0x00066739 },
+		{ AUD_DEEMPHDENOM1_R,      0x0001e88c },
+		{ AUD_DEEMPHDENOM2_R,      0x0001e88c },
+#endif
+
+		{ AUD_DEEMPHDENOM2_R,      0x00000000 },
+		{ AUD_ERRLOGPERIOD_R,      0x00000fff },
+		{ AUD_ERRINTRPTTHSHLD1_R,  0x000003ff },
+		{ AUD_ERRINTRPTTHSHLD2_R,  0x000000ff },
+		{ AUD_ERRINTRPTTHSHLD3_R,  0x0000003f },
+		{ AUD_POLYPH80SCALEFAC,    0x00000003 },
+
 		// setup QAM registers
 		{ AUD_PDF_DDS_CNST_BYTE2,  0x06 },
 		{ AUD_PDF_DDS_CNST_BYTE1,  0x82 },
 		{ AUD_PDF_DDS_CNST_BYTE0,  0x16 },
 		{ AUD_QAM_MODE,            0x05 },
+
+                { /* end of list */ },
+        };
+	static const struct rlist nicam_pal_i[] = {
+		{ AUD_PDF_DDS_CNST_BYTE0,  0x12 },
+		{ AUD_PHACC_FREQ_8MSB,     0x3a },
+		{ AUD_PHACC_FREQ_8LSB,     0x93 },
+
+                { /* end of list */ },
+	};
+	static const struct rlist nicam_default[] = {
+		{ AUD_PDF_DDS_CNST_BYTE0,  0x16 },
 		{ AUD_PHACC_FREQ_8MSB,     0x34 },
 		{ AUD_PHACC_FREQ_8LSB,     0x4c },
 
                 { /* end of list */ },
-        };
+	};
 
-	dprintk("%s (status: unknown)\n",__FUNCTION__);
         set_audio_start(dev, 0x0010,
-			EN_DMTRX_LR | EN_NICAM_FORCE_STEREO);
-        set_audio_registers(dev, nicam);
+			EN_DMTRX_LR | EN_DMTRX_BYPASS | EN_NICAM_AUTO_STEREO);
+        set_audio_registers(dev, nicam_common);
+	switch (dev->tvaudio) {
+	case WW_NICAM_I:
+		dprintk("%s PAL-I NICAM (status: unknown)\n",__FUNCTION__);
+		set_audio_registers(dev, nicam_pal_i);
+	case WW_NICAM_BGDKL:
+		dprintk("%s PAL NICAM (status: unknown)\n",__FUNCTION__);
+		set_audio_registers(dev, nicam_default);
+		break;
+	};
         set_audio_finish(dev);
 }
 
@@ -297,7 +458,7 @@ static void set_audio_standard_NICAM_L(struct cx8800_dev *dev)
 static void set_audio_standard_A2(struct cx8800_dev *dev)
 {
 	/* from dscaler cvs */
-	static const struct rlist a2[] = {
+	static const struct rlist a2_common[] = {
 		{ AUD_PDF_DDS_CNST_BYTE2,     0x06 },
 		{ AUD_PDF_DDS_CNST_BYTE1,     0x82 },
 		{ AUD_PDF_DDS_CNST_BYTE0,     0x12 },
@@ -347,16 +508,20 @@ static void set_audio_standard_A2(struct cx8800_dev *dev)
 		{ AUD_RDSQ_SHIFT,	0x00000000 },
 		{ AUD_POLYPH80SCALEFAC,	0x00000001 },
 
-		// Table 1
+		{ /* end of list */ },
+	};
+
+	static const struct rlist a2_table1[] = {
+		// PAL-BG
 		{ AUD_DMD_RA_DDS,	0x002a73bd },
 		{ AUD_C1_UP_THR,	0x00007000 },
 		{ AUD_C1_LO_THR,	0x00005400 },
 		{ AUD_C2_UP_THR,	0x00005400 },
 		{ AUD_C2_LO_THR,	0x00003000 },
-
-#if 0
-		// found this in WDM-driver for A2, must country spec.
-		// Table 2
+		{ /* end of list */ },
+	};
+	static const struct rlist a2_table2[] = {
+		// PAL-DK
 		{ AUD_DMD_RA_DDS,	0x002a73bd },
 		{ AUD_C1_UP_THR,	0x00007000 },
 		{ AUD_C1_LO_THR,	0x00005400 },
@@ -364,8 +529,10 @@ static void set_audio_standard_A2(struct cx8800_dev *dev)
 		{ AUD_C2_LO_THR,	0x00003000 },
 		{ AUD_DN0_FREQ,		0x00003a1c },
 		{ AUD_DN2_FREQ,		0x0000d2e0 },
-
-		// Table 3
+		{ /* end of list */ },
+	};
+	static const struct rlist a2_table3[] = {
+		// unknown, probably NTSC-M
 		{ AUD_DMD_RA_DDS,	0x002a2873 },
 		{ AUD_C1_UP_THR,	0x00003c00 },
 		{ AUD_C1_LO_THR,	0x00003000 },
@@ -375,140 +542,26 @@ static void set_audio_standard_A2(struct cx8800_dev *dev)
 		{ AUD_DN1_FREQ,		0x00003418 },
 		{ AUD_DN2_FREQ,		0x000029c7 },
 		{ AUD_POLY0_DDS_CONSTANT, 0x000a7540 },
-#endif
-
 		{ /* end of list */ },
 	};
 
-	static const struct rlist a2_old[] = {
-		{ AUD_DN0_FREQ,            0x0000312b },
-		{ AUD_POLY0_DDS_CONSTANT,  0x000a62b4 },
-		{ AUD_IIR1_0_SEL,          0x00000000 },
-		{ AUD_IIR1_1_SEL,          0x00000001 },
-		{ AUD_IIR1_2_SEL,          0x0000001f },
-		{ AUD_IIR1_3_SEL,          0x00000020 },
-		{ AUD_IIR1_4_SEL,          0x00000023 },
-		{ AUD_IIR1_5_SEL,          0x00000007 },
-		{ AUD_IIR1_0_SHIFT,        0x00000000 },
-		{ AUD_IIR1_1_SHIFT,        0x00000000 },
-		{ AUD_IIR1_2_SHIFT,        0x00000007 },
-		{ AUD_IIR1_3_SHIFT,        0x00000007 },
-		{ AUD_IIR1_4_SHIFT,        0x00000007 },
-		{ AUD_IIR1_5_SHIFT,        0x00000000 },
-		{ AUD_IIR2_0_SEL,          0x00000002 },
-		{ AUD_IIR2_1_SEL,          0x00000003 },
-		{ AUD_IIR2_2_SEL,          0x00000004 },
-		{ AUD_IIR2_3_SEL,          0x00000005 },
-		{ AUD_IIR3_0_SEL,          0x00000021 },
-		{ AUD_IIR3_1_SEL,          0x00000023 },
-		{ AUD_IIR3_2_SEL,          0x00000016 },
-		{ AUD_IIR3_0_SHIFT,        0x00000000 },
-		{ AUD_IIR3_1_SHIFT,        0x00000000 },
-		{ AUD_IIR3_2_SHIFT,        0x00000000 },
-		{ AUD_IIR4_0_SEL,          0x0000001d },
-		{ AUD_IIR4_1_SEL,          0x00000019 },
-		{ AUD_IIR4_2_SEL,          0x00000008 },
-		{ AUD_IIR4_0_SHIFT,        0x00000000 },
-		{ AUD_IIR4_1_SHIFT,        0x00000000 },
-		{ AUD_IIR4_2_SHIFT,        0x00000001 },
-		{ AUD_IIR4_0_CA0,          0x0003e57e },
-		{ AUD_IIR4_0_CA1,          0x00005e11 },
-		{ AUD_IIR4_0_CA2,          0x0003a7cf },
-		{ AUD_IIR4_0_CB0,          0x00002368 },
-		{ AUD_IIR4_0_CB1,          0x0003bf1b },
-		{ AUD_IIR4_1_CA0,          0x00006349 },
-		{ AUD_IIR4_1_CA1,          0x00006f27 },
-		{ AUD_IIR4_1_CA2,          0x0000e7a3 },
-		{ AUD_IIR4_1_CB0,          0x00005653 },
-		{ AUD_IIR4_1_CB1,          0x0000cf97 },
-		{ AUD_IIR4_2_CA0,          0x00006349 },
-		{ AUD_IIR4_2_CA1,          0x00006f27 },
-		{ AUD_IIR4_2_CA2,          0x0000e7a3 },
-		{ AUD_IIR4_2_CB0,          0x00005653 },
-		{ AUD_IIR4_2_CB1,          0x0000cf97 },
-		{ AUD_HP_MD_IIR4_1,        0x00000001 },
-		{ AUD_HP_PROG_IIR4_1,      0x00000017 },
-		{ AUD_DN1_FREQ,            0x00003618 },
-		{ AUD_DN1_SRC_SEL,         0x00000017 },
-		{ AUD_DN1_SHFT,            0x00000007 },
-		{ AUD_DN1_AFC,             0x00000000 },
-		{ AUD_DN1_FREQ_SHIFT,      0x00000000 },
-		{ AUD_DN2_SRC_SEL,         0x00000040 },
-		{ AUD_DN2_SHFT,            0x00000000 },
-		{ AUD_DN2_AFC,             0x00000002 },
-		{ AUD_DN2_FREQ,            0x0000caaf },
-		{ AUD_DN2_FREQ_SHIFT,      0x00000000 },
-		{ AUD_PDET_SRC,            0x00000014 },
-		{ AUD_PDET_SHIFT,          0x00000000 },
-		{ AUD_DEEMPH0_SRC_SEL,     0x00000011 },
-		{ AUD_DEEMPH1_SRC_SEL,     0x00000013 },
-		{ AUD_DEEMPH0_SHIFT,       0x00000000 },
-		{ AUD_DEEMPH1_SHIFT,       0x00000000 },
-		{ AUD_DEEMPH0_G0,          0x000004da },
-		{ AUD_DEEMPH0_A0,          0x0000777a },
-		{ AUD_DEEMPH0_B0,          0x00000000 },
-		{ AUD_DEEMPH0_A1,          0x0003f062 },
-		{ AUD_DEEMPH0_B1,          0x00000000 },
-		{ AUD_DEEMPH1_G0,          0x000004da },
-		{ AUD_DEEMPH1_A0,          0x0000777a },
-		{ AUD_DEEMPH1_B0,          0x00000000 },
-		{ AUD_DEEMPH1_A1,          0x0003f062 },
-		{ AUD_DEEMPH1_B1,          0x00000000 },
-		{ AUD_PLL_EN,              0x00000000 },
-		{ AUD_DMD_RA_DDS,          0x002a4efb },
-		{ AUD_RATE_ADJ1,           0x00001000 },
-		{ AUD_RATE_ADJ2,           0x00002000 },
-		{ AUD_RATE_ADJ3,           0x00003000 },
-		{ AUD_RATE_ADJ4,           0x00004000 },
-		{ AUD_RATE_ADJ5,           0x00005000 },
-		{ AUD_C2_UP_THR,           0x0000ffff },
-		{ AUD_C2_LO_THR,           0x0000e800 },
-		{ AUD_C1_UP_THR,           0x00008c00 },
-		{ AUD_C1_LO_THR,           0x00006c00 },
-
-		//   ; Completely ditch AFC feedback
-		{ AUD_DCOC_0_SRC,          0x00000021 },
-		{ AUD_DCOC_1_SRC,          0x0000001a },
-		{ AUD_DCOC1_SHIFT,         0x00000000 },
-		{ AUD_DCOC_1_SHIFT_IN0,    0x0000000a },
-		{ AUD_DCOC_1_SHIFT_IN1,    0x00000008 },
-		{ AUD_DCOC_PASS_IN,        0x00000000 },
-		{ AUD_IIR4_0_SEL,          0x00000023 },
-
-		//  ; Completely ditc FM-2 AFC feedback
-		{ AUD_DN1_AFC,             0x00000000 },
-		{ AUD_DCOC_2_SRC,          0x0000001b },
-		{ AUD_IIR4_1_SEL,          0x00000025 },
-
-		// ; WARNING!!! THIS CHANGE WAS NOT EXPECTED!!!
-		// ; Swap I & Q inputs into second rotator
-		// ; to reverse frequency and therefor invert
-		// ; phase from the cordic FM demodulator
-		// ; (frequency rotation must also be reversed
-		{ AUD_DN2_SRC_SEL,         0x00000001 },
-		{ AUD_DN2_FREQ,            0x00003551 },
-
-		//  setup Audio PLL
-		{ AUD_PLL_PRESCALE,        0x00000002 },
-		{ AUD_PLL_INT,             0x0000001f },
-
-		{ /* end of list */ },
+	set_audio_start(dev, 0x0004, EN_DMTRX_SUMDIFF | EN_A2_AUTO_STEREO);
+	set_audio_registers(dev, a2_common);
+	switch (dev->tvaudio) {
+	case WW_A2_BG:
+		dprintk("%s PAL-BG A2 (status: known-good)\n",__FUNCTION__);
+		set_audio_registers(dev, a2_table1);
+		break;
+	case WW_A2_DK:
+		dprintk("%s PAL-DK A2 (status: known-good)\n",__FUNCTION__);
+		set_audio_registers(dev, a2_table2);
+		break;
+	case WW_A2_M:
+		dprintk("%s NTSC-M A2 (status: unknown)\n",__FUNCTION__);
+		set_audio_registers(dev, a2_table3);
+		break;
 	};
-
-
-	dprintk("%s (status: WorksForMe[tm])\n",__FUNCTION__);
-
-	if (0) {
-		/* old code */
-		set_audio_start(dev, 0x0004, EN_DMTRX_SUMR | EN_A2_AUTO_STEREO);
-		set_audio_registers(dev, a2_old);
-		set_audio_finish(dev);
-	} else {
-		/* new code */
-		set_audio_start(dev, 0x0004, EN_DMTRX_LR | EN_A2_AUTO_STEREO);
-		set_audio_registers(dev, a2);
-		set_audio_finish(dev);
-	}
+	set_audio_finish(dev);
 }
 
 static void set_audio_standard_EIAJ(struct cx8800_dev *dev)
@@ -617,9 +670,9 @@ void cx88_get_stereo(struct cx8800_dev *dev, struct v4l2_tuner *t)
 	reg   = cx_read(AUD_STATUS);
 	mode  = reg & 0x03;
 	pilot = (reg >> 2) & 0x03;
-	dprintk("AUD_STATUS: %s / %s [status=0x%x,ctl=0x%x,vol=0x%x]\n",
-		m[mode], p[pilot], reg,
-		cx_read(AUD_CTL), cx_sread(SHADOW_AUD_VOL_CTL));
+	dprintk("AUD_STATUS: 0x%x [%s/%s] ctl=%s\n",
+		reg, m[mode], p[pilot],
+		aud_ctl_names[cx_read(AUD_CTL) & 63]);
 
 	t->capability = V4L2_TUNER_CAP_STEREO | V4L2_TUNER_CAP_SAP |
 		V4L2_TUNER_CAP_LANG1 | V4L2_TUNER_CAP_LANG2;
@@ -628,6 +681,8 @@ void cx88_get_stereo(struct cx8800_dev *dev, struct v4l2_tuner *t)
 
 	switch (dev->tvaudio) {
 	case WW_A2_BG:
+	case WW_A2_DK:
+	case WW_A2_M:
  		if (1 == pilot) {
 			/* stereo */
 			t->rxsubchans = V4L2_TUNER_SUB_MONO | V4L2_TUNER_SUB_STEREO;
@@ -659,6 +714,8 @@ void cx88_set_stereo(struct cx8800_dev *dev, u32 mode)
 
 	switch (dev->tvaudio) {
 	case WW_A2_BG:
+	case WW_A2_DK:
+	case WW_A2_M:
 		switch (mode) {
 		case V4L2_TUNER_MODE_MONO:   
 		case V4L2_TUNER_MODE_LANG1:
@@ -717,6 +774,32 @@ void cx88_set_stereo(struct cx8800_dev *dev, u32 mode)
 	return;
 }
 
+/* just monitor the audio status for now ... */
+int cx88_audio_thread(void *data)
+{
+	struct cx8800_dev *dev = data;
+	struct v4l2_tuner t;
+
+	daemonize("msp3400");
+	allow_signal(SIGTERM);
+	dprintk("cx88: tvaudio thread started\n");
+
+	for (;;) {
+		set_current_state(TASK_INTERRUPTIBLE);
+		schedule_timeout(HZ*3);
+		if (signal_pending(current))
+			break;
+		if (dev->shutdown)
+			break;
+
+		memset(&t,0,sizeof(t));
+		cx88_get_stereo(dev,&t);
+	}
+
+	dprintk("cx88: tvaudio thread exiting\n");
+        complete_and_exit(&dev->texit, 0);
+}
+
 /*
  * Local variables:
  * c-basic-offset: 8
diff --git a/drivers/media/video/cx88/cx88-vbi.c b/drivers/media/video/cx88/cx88-vbi.c
index 5379e2373..3c3806ebc 100644
--- a/drivers/media/video/cx88/cx88-vbi.c
+++ b/drivers/media/video/cx88/cx88-vbi.c
@@ -28,17 +28,14 @@ void cx8800_vbi_fmt(struct cx8800_dev *dev, struct v4l2_format *f)
 	f->fmt.vbi.count[0] = VBI_LINE_COUNT;
 	f->fmt.vbi.count[1] = VBI_LINE_COUNT;
 
-	switch (dev->tvnorm->id) {
-	case V4L2_STD_NTSC_M:
-	case V4L2_STD_NTSC_M_JP:
+	if (dev->tvnorm->id & V4L2_STD_525_60) {
+		/* ntsc */
 		f->fmt.vbi.sampling_rate = 28636363;
 		f->fmt.vbi.start[0] = 10 -1;
 		f->fmt.vbi.start[1] = 273 -1;
-		break;
-	case V4L2_STD_PAL_BG:
-	case V4L2_STD_PAL_DK:
-	case V4L2_STD_PAL_I:
-	case V4L2_STD_SECAM:
+
+	} else if (V4L2_STD_625_50) {
+		/* pal */
 		f->fmt.vbi.sampling_rate = 35468950;
 		f->fmt.vbi.start[0] = 7 -1;
 		f->fmt.vbi.start[1] = 319 -1;
diff --git a/drivers/media/video/cx88/cx88-video.c b/drivers/media/video/cx88/cx88-video.c
index b1e5ddc68..e73b8ce4e 100644
--- a/drivers/media/video/cx88/cx88-video.c
+++ b/drivers/media/video/cx88/cx88-video.c
@@ -2,7 +2,7 @@
  * device driver for Conexant 2388x based TV cards
  * video4linux video interface
  *
- * (c) 2003 Gerd Knorr <kraxel@bytesex.org> [SuSE Labs]
+ * (c) 2003-04 Gerd Knorr <kraxel@bytesex.org> [SuSE Labs]
  *
  *  This program is free software; you can redistribute it and/or modify
  *  it under the terms of the GNU General Public License as published by
@@ -19,8 +19,6 @@
  *  Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
  */
 
-#define __NO_VERSION__ 1
-
 #include <linux/init.h>
 #include <linux/list.h>
 #include <linux/module.h>
@@ -32,6 +30,8 @@
 
 #include "cx88.h"
 
+#define V4L2_I2C_CLIENTS 1
+
 MODULE_DESCRIPTION("v4l2 driver module for cx2388x based TV cards");
 MODULE_AUTHOR("Gerd Knorr <kraxel@bytesex.org> [SuSE Labs]");
 MODULE_LICENSE("GPL");
@@ -194,8 +194,13 @@ static struct cx8800_tvnorm tvnorms[] = {
 		.cxiformat = VideoFormatPAL60,
 		.cxoformat = 0x181f0008,
 	},{
-		.name      = "SECAM",
-		.id        = V4L2_STD_SECAM,
+		.name      = "SECAM-L",
+		.id        = V4L2_STD_SECAM_L,
+		.cxiformat = VideoFormatSECAM,
+		.cxoformat = 0x181f0008,
+	},{
+		.name      = "SECAM-DK",
+		.id        = V4L2_STD_SECAM_DK,
 		.cxiformat = VideoFormatSECAM,
 		.cxoformat = 0x181f0008,
 	}
@@ -483,35 +488,38 @@ static int set_tvaudio(struct cx8800_dev *dev)
 	if (CX88_VMUX_TELEVISION != INPUT(dev->input)->type)
 		return 0;
 
-	switch (dev->tvnorm->id) {
-	case V4L2_STD_PAL_BG:
+	if (V4L2_STD_PAL_BG & dev->tvnorm->id) {
 		dev->tvaudio = nicam ? WW_NICAM_BGDKL : WW_A2_BG;
-		break;
-	case V4L2_STD_PAL_DK:
+
+	} else if (V4L2_STD_PAL_DK & dev->tvnorm->id) {
 		dev->tvaudio = nicam ? WW_NICAM_BGDKL : WW_A2_DK;
-		break;
-	case V4L2_STD_PAL_I:
+
+	} else if (V4L2_STD_PAL_I & dev->tvnorm->id) {
 		dev->tvaudio = WW_NICAM_I;
-		break;
-	case V4L2_STD_SECAM:
-		dev->tvaudio = WW_SYSTEM_L_AM;  /* FIXME: fr != ru */
-		break;
-	case V4L2_STD_NTSC_M:
+
+	} else if (V4L2_STD_SECAM_L & dev->tvnorm->id) {
+		dev->tvaudio = WW_SYSTEM_L_AM;
+
+	} else if (V4L2_STD_SECAM_DK & dev->tvnorm->id) {
+		dev->tvaudio = WW_A2_DK;
+
+	} else if ((V4L2_STD_NTSC_M & dev->tvnorm->id) ||
+		   (V4L2_STD_PAL_M  & dev->tvnorm->id)) {
 		dev->tvaudio = WW_BTSC;
-		break;
-	case V4L2_STD_NTSC_M_JP:
+
+	} else if (V4L2_STD_NTSC_M_JP & dev->tvnorm->id) {
 		dev->tvaudio = WW_EIAJ;
-		break;
-	default:
-		dprintk(1,"tvaudio support needs work for this tv norm [%s], sorry\n",
-			dev->tvnorm->name);
+
+	} else {
+		printk("%s: tvaudio support needs work for this tv norm [%s], sorry\n",
+		       dev->name, dev->tvnorm->name);
 		dev->tvaudio = 0;
 		return 0;
 	}
 
 	cx_andor(MO_AFECFG_IO, 0x1f, 0x0);
 	cx88_set_tvaudio(dev);
-	cx88_set_stereo(dev,V4L2_TUNER_MODE_STEREO);
+	// cx88_set_stereo(dev,V4L2_TUNER_MODE_STEREO);
 
 	cx_write(MO_AUDD_LNGTH, 128/8);  /* fifo size */
 	cx_write(MO_AUDR_LNGTH, 128/8);  /* fifo size */
@@ -526,7 +534,6 @@ static int set_tvnorm(struct cx8800_dev *dev, struct cx8800_tvnorm *norm)
 	u32 vdec_clock;
 	u64 tmp64;
 	u32 bdelay,agcdelay,htotal;
-	struct video_channel c;
 	
 	dev->tvnorm = norm;
 	fsc8       = norm_fsc8(norm);
@@ -592,30 +599,43 @@ static int set_tvnorm(struct cx8800_dev *dev, struct cx8800_tvnorm *norm)
 	set_tvaudio(dev);
 
 	// tell i2c chips
-	memset(&c,0,sizeof(c));
-	c.channel = dev->input;
-	c.norm = VIDEO_MODE_PAL;
-	if ((norm->id & (V4L2_STD_NTSC_M|V4L2_STD_NTSC_M_JP)))
-		c.norm = VIDEO_MODE_NTSC;
-	if (norm->id & V4L2_STD_SECAM)
-		c.norm = VIDEO_MODE_SECAM;
-	cx8800_call_i2c_clients(dev,VIDIOCSCHAN,&c);
+#ifdef V4L2_I2C_CLIENTS
+	cx8800_call_i2c_clients(dev,VIDIOC_S_STD,&norm->id);
+#else
+	{
+		struct video_channel c;
+		memset(&c,0,sizeof(c));
+		c.channel = dev->input;
+		c.norm = VIDEO_MODE_PAL;
+		if ((norm->id & (V4L2_STD_NTSC_M|V4L2_STD_NTSC_M_JP)))
+			c.norm = VIDEO_MODE_NTSC;
+		if (norm->id & V4L2_STD_SECAM)
+			c.norm = VIDEO_MODE_SECAM;
+		cx8800_call_i2c_clients(dev,VIDIOCSCHAN,&c);
+	}
+#endif
 
 	// done
 	return 0;
 }
 
 static int set_scale(struct cx8800_dev *dev, unsigned int width, unsigned int height,
-		     int interlaced)
+		     enum v4l2_field field)
 {
 	unsigned int swidth  = norm_swidth(dev->tvnorm);
 	unsigned int sheight = norm_maxh(dev->tvnorm);
 	u32 value;
 
-	dprintk(1,"set_scale: %dx%d [%s]\n", width, height, dev->tvnorm->name);
+	dprintk(1,"set_scale: %dx%d [%s%s,%s]\n", width, height,
+		V4L2_FIELD_HAS_TOP(field)    ? "T" : "",
+		V4L2_FIELD_HAS_BOTTOM(field) ? "B" : "",
+		dev->tvnorm->name);
+	if (!V4L2_FIELD_HAS_BOTH(field))
+		height *= 2;
 
 	// recalc H delay and scale registers
 	value = (width * norm_hdelay(dev->tvnorm)) / swidth;
+	value &= 0x3fe;
 	cx_write(MO_HDELAY_EVEN,  value);
 	cx_write(MO_HDELAY_ODD,   value);
 	dprintk(1,"set_scale: hdelay  0x%04x\n", value);
@@ -646,7 +666,7 @@ static int set_scale(struct cx8800_dev *dev, unsigned int width, unsigned int he
 	// setup filters
 	value = 0;
 	value |= (1 << 19);        // CFILT (default)
-	if (interlaced)
+	if (V4L2_FIELD_INTERLACED == field)
 		value |= (1 << 3); // VINT (interlaced vertical scaling)
 	if (width < 385)
 		value |= (1 << 0); // 3-tap interpolation
@@ -675,10 +695,12 @@ static int video_mux(struct cx8800_dev *dev, unsigned int input)
 
 	switch (INPUT(input)->type) {
 	case CX88_VMUX_SVIDEO:
-		cx_andor(MO_AFECFG_IO, 0x01, 0x01);
+		cx_set(MO_AFECFG_IO,    0x00000001);
+		cx_set(MO_INPUT_FORMAT, 0x00010010);
 		break;
 	default:
-		cx_andor(MO_AFECFG_IO, 0x01, 0x00);
+		cx_clear(MO_AFECFG_IO,    0x00000001);
+		cx_clear(MO_INPUT_FORMAT, 0x00010010);
 		break;
 	}
 	return 0;
@@ -693,7 +715,7 @@ static int start_video_dma(struct cx8800_dev    *dev,
 	/* setup fifo + format */
 	cx88_sram_channel_setup(dev, &cx88_sram_channels[SRAM_CH21],
 				buf->bpl, buf->risc.dma);
-	set_scale(dev, buf->vb.width, buf->vb.height, 1);
+	set_scale(dev, buf->vb.width, buf->vb.height, buf->vb.field);
 	cx_write(MO_COLOR_CTRL, buf->fmt->cxformat | ColorFormatGamma);
 
 	/* reset counter */
@@ -1257,7 +1279,7 @@ static int video_open(struct inode *inode, struct file *file)
 }
 
 static ssize_t
-video_read(struct file *file, char *data, size_t count, loff_t *ppos)
+video_read(struct file *file, char __user *data, size_t count, loff_t *ppos)
 {
 	struct cx8800_fh *fh = file->private_data;
 
@@ -1350,6 +1372,9 @@ static int get_control(struct cx8800_dev *dev, struct v4l2_control *ctl)
 	case V4L2_CID_AUDIO_BALANCE:
 		ctl->value = (value & 0x40) ? (value & 0x3f) : (0x40 - (value & 0x3f));
 		break;
+	case V4L2_CID_AUDIO_VOLUME:
+		ctl->value = 0x3f - (value & 0x3f);
+		break;
 	default:
 		ctl->value = ((value + (c->off << c->shift)) & c->mask) >> c->shift;
 		break;
@@ -1378,6 +1403,9 @@ static int set_control(struct cx8800_dev *dev, struct v4l2_control *ctl)
 	case V4L2_CID_AUDIO_BALANCE:
 		value = (ctl->value < 0x40) ? (0x40 - ctl->value) : ctl->value;
 		break;
+	case V4L2_CID_AUDIO_VOLUME:
+		value = 0x3f - (ctl->value & 0x3f);
+		break;
 	case V4L2_CID_SATURATION:
 		/* special v_sat handling */
 		v_sat_value = ctl->value - (0x7f - 0x5a);
@@ -1409,7 +1437,7 @@ static void init_controls(struct cx8800_dev *dev)
 	};
 	static struct v4l2_control volume = {
 		.id    = V4L2_CID_AUDIO_VOLUME,
-		.value = 0,
+		.value = 0x3f,
 	};
 
 	set_control(dev,&mute);
@@ -1459,15 +1487,12 @@ static int cx8800_try_fmt(struct cx8800_dev *dev, struct cx8800_fh *fh,
 		maxw  = norm_maxw(dev->tvnorm);
 		maxh  = norm_maxh(dev->tvnorm);
 
-#if 0
 		if (V4L2_FIELD_ANY == field) {
 			field = (f->fmt.pix.height > maxh/2)
 				? V4L2_FIELD_INTERLACED
 				: V4L2_FIELD_BOTTOM;
 		}
-#else
-		field = V4L2_FIELD_INTERLACED;
-#endif
+
 		switch (field) {
 		case V4L2_FIELD_TOP:
 		case V4L2_FIELD_BOTTOM:
@@ -1480,14 +1505,15 @@ static int cx8800_try_fmt(struct cx8800_dev *dev, struct cx8800_fh *fh,
 		}
 
 		f->fmt.pix.field = field;
-		if (f->fmt.pix.width < 48)
-			f->fmt.pix.width = 48;
 		if (f->fmt.pix.height < 32)
 			f->fmt.pix.height = 32;
-		if (f->fmt.pix.width > maxw)
-			f->fmt.pix.width = maxw;
 		if (f->fmt.pix.height > maxh)
 			f->fmt.pix.height = maxh;
+		if (f->fmt.pix.width < 48)
+			f->fmt.pix.width = 48;
+		if (f->fmt.pix.width > maxw)
+			f->fmt.pix.width = maxw;
+		f->fmt.pix.width &= ~0x03;
 		f->fmt.pix.bytesperline =
 			(f->fmt.pix.width * fmt->depth) >> 3;
 		f->fmt.pix.sizeimage =
@@ -1783,7 +1809,11 @@ static int video_do_ioctl(struct inode *inode, struct file *file,
 			return -EINVAL;
 		down(&dev->lock);
 		dev->freq = f->frequency;
+#ifdef V4L2_I2C_CLIENTS
+		cx8800_call_i2c_clients(dev,VIDIOC_S_FREQUENCY,f);
+#else
 		cx8800_call_i2c_clients(dev,VIDIOCSFREQ,&dev->freq);
+#endif
 		up(&dev->lock);
 		return 0;
 	}
@@ -1885,7 +1915,6 @@ static int radio_do_ioctl(struct inode *inode, struct file *file,
 	case VIDIOC_G_TUNER:
 	{
 		struct v4l2_tuner *t = arg;
-		struct video_tuner vt;
 
 		if (t->index > 0)
 			return -EINVAL;
@@ -1895,9 +1924,16 @@ static int radio_do_ioctl(struct inode *inode, struct file *file,
                 t->rangelow  = (int)(65*16);
                 t->rangehigh = (int)(108*16);
 		
-		memset(&vt,0,sizeof(vt));
-		cx8800_call_i2c_clients(dev,VIDIOCGTUNER,&vt);
-		t->signal = vt.signal;
+#ifdef V4L2_I2C_CLIENTS
+		cx8800_call_i2c_clients(dev,VIDIOC_G_TUNER,t);
+#else
+		{
+			struct video_tuner vt;
+			memset(&vt,0,sizeof(vt));
+			cx8800_call_i2c_clients(dev,VIDIOCGTUNER,&vt);
+			t->signal = vt.signal;
+		}
+#endif
 		return 0;
 	}
 	case VIDIOC_ENUMINPUT:
@@ -2281,11 +2317,6 @@ static void cx8800_unregister_video(struct cx8800_dev *dev)
 	}
 }
 
-/* debug that damn oops ... */
-static unsigned int oops = 0;
-MODULE_PARM(oops,"i");
-#define OOPS(msg) if (oops) printk("%s: %s\n",__FUNCTION__,msg);
-
 static int __devinit cx8800_initdev(struct pci_dev *pci_dev,
 				    const struct pci_device_id *pci_id)
 {
@@ -2299,7 +2330,6 @@ static int __devinit cx8800_initdev(struct pci_dev *pci_dev,
 	memset(dev,0,sizeof(*dev));
 
 	/* pci init */
-	OOPS("pci init");
 	dev->pci = pci_dev;
 	if (pci_enable_device(pci_dev)) {
 		err = -EIO;
@@ -2308,7 +2338,6 @@ static int __devinit cx8800_initdev(struct pci_dev *pci_dev,
 	sprintf(dev->name,"cx%x[%d]",pci_dev->device,cx8800_devcount);
 
 	/* pci quirks */
-	OOPS("pci quirks");
 	cx88_pci_quirks(dev->name, dev->pci, &latency);
 	if (UNSET != latency) {
 		printk(KERN_INFO "%s: setting pci latency timer to %d\n",
@@ -2317,7 +2346,6 @@ static int __devinit cx8800_initdev(struct pci_dev *pci_dev,
 	}
 
 	/* print pci info */
-	OOPS("pci info");
 	pci_read_config_byte(pci_dev, PCI_CLASS_REVISION, &dev->pci_rev);
         pci_read_config_byte(pci_dev, PCI_LATENCY_TIMER,  &dev->pci_lat);
         printk(KERN_INFO "%s: found at %s, rev: %d, irq: %d, "
@@ -2333,14 +2361,15 @@ static int __devinit cx8800_initdev(struct pci_dev *pci_dev,
 	}
 
 	/* board config */
-	OOPS("board config");
 	dev->board = card[cx8800_devcount];
 	for (i = 0; UNSET == dev->board  &&  i < cx88_idcount; i++) 
 		if (pci_dev->subsystem_vendor == cx88_subids[i].subvendor &&
 		    pci_dev->subsystem_device == cx88_subids[i].subdevice)
 			dev->board = cx88_subids[i].card;
-	if (UNSET == dev->board)
+	if (UNSET == dev->board) {
 		dev->board = CX88_BOARD_UNKNOWN;
+		cx88_card_list(dev);
+	}
         printk(KERN_INFO "%s: subsystem: %04x:%04x, board: %s [card=%d,%s]\n",
 	       dev->name,pci_dev->subsystem_vendor,
 	       pci_dev->subsystem_device,cx88_boards[dev->board].name,
@@ -2352,7 +2381,6 @@ static int __devinit cx8800_initdev(struct pci_dev *pci_dev,
 		dev->tuner_type = cx88_boards[dev->board].tuner_type;
 
 	/* get mmio */
-	OOPS("get mmio");
 	if (!request_mem_region(pci_resource_start(pci_dev,0),
 				pci_resource_len(pci_dev,0),
 				dev->name)) {
@@ -2366,7 +2394,6 @@ static int __devinit cx8800_initdev(struct pci_dev *pci_dev,
 	dev->bmmio = (u8*)dev->lmmio;
 
 	/* initialize driver struct */
-	OOPS("init structs");
         init_MUTEX(&dev->lock);
 	dev->slock = SPIN_LOCK_UNLOCKED;
 	dev->tvnorm = tvnorms;
@@ -2390,11 +2417,9 @@ static int __devinit cx8800_initdev(struct pci_dev *pci_dev,
 			  MO_VID_DMACNTRL,0x88,0x00);
 
 	/* initialize hardware */
-	OOPS("reset hardware");
 	cx8800_reset(dev);
 
 	/* get irq */
-	OOPS("install irq handler");
 	err = request_irq(pci_dev->irq, cx8800_irq,
 			  SA_SHIRQ | SA_INTERRUPT, dev->name, dev);
 	if (err < 0) {
@@ -2404,13 +2429,10 @@ static int __devinit cx8800_initdev(struct pci_dev *pci_dev,
 	}
 
 	/* register i2c bus + load i2c helpers */
-	OOPS("i2c setup");
 	cx8800_i2c_init(dev);
-	OOPS("card setup");
 	cx88_card_setup(dev);
 
 	/* load and configure helper modules */
-	OOPS("configure i2c clients");
 	if (TUNER_ABSENT != dev->tuner_type)
 		request_module("tuner");
 	if (cx88_boards[dev->board].needs_tda9887)
@@ -2419,7 +2441,6 @@ static int __devinit cx8800_initdev(struct pci_dev *pci_dev,
 		cx8800_call_i2c_clients(dev,TUNER_SET_TYPE,&dev->tuner_type);
 
 	/* register v4l devices */
-	OOPS("register video");
 	dev->video_dev = vdev_init(dev,&cx8800_video_template,"video");
 	err = video_register_device(dev->video_dev,VFL_TYPE_GRABBER,
 				    video_nr[cx8800_devcount]);
@@ -2431,7 +2452,6 @@ static int __devinit cx8800_initdev(struct pci_dev *pci_dev,
 	printk(KERN_INFO "%s: registered device video%d [v4l2]\n",
 	       dev->name,dev->video_dev->minor & 0x1f);
 
-	OOPS("register vbi");
 	dev->vbi_dev = vdev_init(dev,&cx8800_vbi_template,"vbi");
 	err = video_register_device(dev->vbi_dev,VFL_TYPE_VBI,
 				    vbi_nr[cx8800_devcount]);
@@ -2444,7 +2464,6 @@ static int __devinit cx8800_initdev(struct pci_dev *pci_dev,
 	       dev->name,dev->vbi_dev->minor & 0x1f);
 
 	if (dev->has_radio) {
-		OOPS("register radio");
 		dev->radio_dev = vdev_init(dev,&cx8800_radio_template,"radio");
 		err = video_register_device(dev->radio_dev,VFL_TYPE_RADIO,
 					    radio_nr[cx8800_devcount]);
@@ -2458,32 +2477,31 @@ static int __devinit cx8800_initdev(struct pci_dev *pci_dev,
 	}
 
 	/* everything worked */
-	OOPS("finalize");
 	list_add_tail(&dev->devlist,&cx8800_devlist);
 	pci_set_drvdata(pci_dev,dev);
 	cx8800_devcount++;
 
 	/* initial device configuration */
-	OOPS("init device");
 	down(&dev->lock);
 	init_controls(dev);
 	set_tvnorm(dev,tvnorms);
 	video_mux(dev,0);
 	up(&dev->lock);
+
+	/* start tvaudio thread */
+	init_completion(&dev->texit);
+	dev->tpid = kernel_thread(cx88_audio_thread, dev, 0);
 	return 0;
 
  fail3:
-	OOPS("fail3");
 	cx8800_unregister_video(dev);
 	if (0 == dev->i2c_rc)
 		i2c_bit_del_bus(&dev->i2c_adap);
 	free_irq(pci_dev->irq, dev);
  fail2:
-	OOPS("fail2");
 	release_mem_region(pci_resource_start(pci_dev,0),
 			   pci_resource_len(pci_dev,0));
  fail1:
-	OOPS("fail1");
 	kfree(dev);
 	return err;
 }
@@ -2492,6 +2510,11 @@ static void __devexit cx8800_finidev(struct pci_dev *pci_dev)
 {
         struct cx8800_dev *dev = pci_get_drvdata(pci_dev);
 
+	/* stop thread */
+	dev->shutdown = 1;
+	if (dev->tpid >= 0)
+		wait_for_completion(&dev->texit);
+
 	cx8800_shutdown(dev);
 	pci_disable_device(pci_dev);
 
diff --git a/drivers/media/video/cx88/cx88.h b/drivers/media/video/cx88/cx88.h
index cf77b6d9b..f7e6f0b7e 100644
--- a/drivers/media/video/cx88/cx88.h
+++ b/drivers/media/video/cx88/cx88.h
@@ -32,7 +32,7 @@
 #include "cx88-reg.h"
 
 #include <linux/version.h>
-#define CX88_VERSION_CODE KERNEL_VERSION(0,0,3)
+#define CX88_VERSION_CODE KERNEL_VERSION(0,0,4)
 
 #ifndef TRUE
 # define TRUE (1==1)
@@ -114,17 +114,20 @@ extern struct sram_channel cx88_sram_channels[];
 /* card configuration                                          */
 
 #define CX88_BOARD_NOAUTO        UNSET
-#define CX88_BOARD_UNKNOWN           0
-#define CX88_BOARD_HAUPPAUGE         1
-#define CX88_BOARD_GDI               2
-#define CX88_BOARD_PIXELVIEW         3
-#define CX88_BOARD_ATI_WONDER_PRO    4
-#define CX88_BOARD_WINFAST2000XP     5
-#define CX88_BOARD_AVERTV_303        6
-#define CX88_BOARD_MSI_TVANYWHERE    7
-#define CX88_BOARD_WINFAST_DV2000    8
-#define CX88_BOARD_LEADTEK_PVR2000   9
-
+#define CX88_BOARD_UNKNOWN               0
+#define CX88_BOARD_HAUPPAUGE             1
+#define CX88_BOARD_GDI                   2
+#define CX88_BOARD_PIXELVIEW             3
+#define CX88_BOARD_ATI_WONDER_PRO        4
+#define CX88_BOARD_WINFAST2000XP         5
+#define CX88_BOARD_AVERTV_303            6
+#define CX88_BOARD_MSI_TVANYWHERE_MASTER 7
+#define CX88_BOARD_WINFAST_DV2000        8
+#define CX88_BOARD_LEADTEK_PVR2000       9
+#define CX88_BOARD_IODATA_GVVCP3PCI      10
+#define CX88_BOARD_PROLINK_PLAYTVPVR     11
+#define CX88_BOARD_ASUS_PVR_416          12
+#define CX88_BOARD_MSI_TVANYWHERE        13
 
 enum cx88_itype {
 	CX88_VMUX_COMPOSITE1 = 1,
@@ -263,6 +266,9 @@ struct cx8800_dev {
 
 	/* other global state info */
 	u32                         shadow[SHADOW_MAX];
+	int                         shutdown;
+	pid_t                       tpid;
+	struct completion           texit;
 	struct cx8800_suspend_state state;
 };
 
@@ -351,7 +357,8 @@ extern const unsigned int cx88_bcount;
 extern struct cx88_subid cx88_subids[];
 extern const unsigned int cx88_idcount;
 
-extern void __devinit cx88_card_setup(struct cx8800_dev *dev);
+extern void cx88_card_list(struct cx8800_dev *dev);
+extern void cx88_card_setup(struct cx8800_dev *dev);
 
 /* ----------------------------------------------------------- */
 /* cx88-tvaudio.c                                              */
@@ -372,6 +379,7 @@ extern void __devinit cx88_card_setup(struct cx8800_dev *dev);
 void cx88_set_tvaudio(struct cx8800_dev *dev);
 void cx88_get_stereo(struct cx8800_dev *dev, struct v4l2_tuner *t);
 void cx88_set_stereo(struct cx8800_dev *dev, u32 mode);
+int cx88_audio_thread(void *data);
 
 /*
  * Local variables:
diff --git a/drivers/media/video/dpc7146.c b/drivers/media/video/dpc7146.c
index 7fb4ae734..3944f3f6a 100644
--- a/drivers/media/video/dpc7146.c
+++ b/drivers/media/video/dpc7146.c
@@ -91,7 +91,7 @@ struct dpc
 /* fixme: add vbi stuff here */
 static int dpc_probe(struct saa7146_dev* dev)
 {
-	struct dpc* dpc = 0;	
+	struct dpc* dpc = NULL;	
 	struct i2c_client *client;
 	struct list_head *item;
 
diff --git a/drivers/media/video/hexium_orion.c b/drivers/media/video/hexium_orion.c
index 1a3bbb6d3..8a577d718 100644
--- a/drivers/media/video/hexium_orion.c
+++ b/drivers/media/video/hexium_orion.c
@@ -212,7 +212,7 @@ static struct saa7146_standard hexium_standards[] = {
    without eeprom */
 static int hexium_probe(struct saa7146_dev *dev)
 {
-	struct hexium *hexium = 0;
+	struct hexium *hexium = NULL;
 	union i2c_smbus_data data;
 	int err = 0;
 
diff --git a/drivers/media/video/ir-kbd-gpio.c b/drivers/media/video/ir-kbd-gpio.c
index 0298392e7..30cce6bec 100644
--- a/drivers/media/video/ir-kbd-gpio.c
+++ b/drivers/media/video/ir-kbd-gpio.c
@@ -1,3 +1,4 @@
+
 /*
  * Copyright (c) 2003 Gerd Knorr
  * Copyright (c) 2003 Pavel Machek
@@ -32,47 +33,45 @@
 /* ---------------------------------------------------------------------- */
 
 static IR_KEYTAB_TYPE ir_codes_avermedia[IR_KEYTAB_SIZE] = {
-	[ 17 ] = KEY_KP0, 
-	[ 20 ] = KEY_KP1, 
-	[ 12 ] = KEY_KP2, 
-	[ 28 ] = KEY_KP3, 
-	[ 18 ] = KEY_KP4, 
-	[ 10 ] = KEY_KP5, 
-	[ 26 ] = KEY_KP6, 
-	[ 22 ] = KEY_KP7, 
-	[ 14 ] = KEY_KP8, 
-	[ 30 ] = KEY_KP9, 
-
-	[ 24 ] = KEY_EJECTCD,     // Unmarked on my controller
+	[ 34 ] = KEY_KP0,
+	[ 40 ] = KEY_KP1,
+	[ 24 ] = KEY_KP2,
+	[ 56 ] = KEY_KP3,
+	[ 36 ] = KEY_KP4,
+	[ 20 ] = KEY_KP5,
+	[ 52 ] = KEY_KP6,
+	[ 44 ] = KEY_KP7,
+	[ 28 ] = KEY_KP8,
+	[ 60 ] = KEY_KP9,
+
+	[ 48 ] = KEY_EJECTCD,     // Unmarked on my controller
 	[  0 ] = KEY_POWER, 
-	[  9 ] = BTN_LEFT,        // DISPLAY/L
-	[ 25 ] = BTN_RIGHT,       // LOOP/R
-	[  5 ] = KEY_MUTE, 
-	[ 19 ] = KEY_RECORD, 
-	[ 11 ] = KEY_PAUSE, 
-	[ 27 ] = KEY_STOP, 
-	[ 15 ] = KEY_VOLUMEDOWN, 
-	[ 31 ] = KEY_VOLUMEUP, 
-
-	[ 16 ] = KEY_TUNER,       // TV/FM
-	[  8 ] = KEY_CD, 
-	[  4 ] = KEY_VIDEO, 
-	[  2 ] = KEY_AUDIO, 
-	[  6 ] = KEY_ZOOM,        // full screen
-	[  1 ] = KEY_INFO,        // preview 
-	[ 21 ] = KEY_SEARCH,      // autoscan
-	[ 13 ] = KEY_STOP,        // freeze 
-	[ 29 ] = KEY_RECORD,      // capture 
-	[  3 ] = KEY_PLAY,        // unmarked
-	[ 23 ] = KEY_RED,         // unmarked
-	[  7 ] = KEY_GREEN,       // unmarked
-
-#if 0
-	[ 16 ] = KEY_YELLOW,      // unmarked
-	[  8 ] = KEY_CHANNELDOWN, 
-	[ 24 ] = KEY_CHANNELUP, 
-	[  0 ] = KEY_BLUE,        // unmarked
-#endif
+	[ 18 ] = BTN_LEFT,        // DISPLAY/L
+	[ 50 ] = BTN_RIGHT,       // LOOP/R
+	[ 10 ] = KEY_MUTE,
+	[ 38 ] = KEY_RECORD,
+	[ 22 ] = KEY_PAUSE,
+	[ 54 ] = KEY_STOP,
+	[ 30 ] = KEY_VOLUMEDOWN,
+	[ 62 ] = KEY_VOLUMEUP,
+
+	[ 32 ] = KEY_TUNER,       // TV/FM
+	[ 16 ] = KEY_CD,
+	[  8 ] = KEY_VIDEO,
+	[  4 ] = KEY_AUDIO,
+	[ 12 ] = KEY_ZOOM,        // full screen
+	[  2 ] = KEY_INFO,        // preview
+	[ 42 ] = KEY_SEARCH,      // autoscan
+	[ 26 ] = KEY_STOP,        // freeze
+	[ 58 ] = KEY_RECORD,      // capture
+	[  6 ] = KEY_PLAY,        // unmarked
+	[ 46 ] = KEY_RED,         // unmarked
+	[ 14 ] = KEY_GREEN,       // unmarked
+
+	[ 33 ] = KEY_YELLOW,      // unmarked
+	[ 17 ] = KEY_CHANNELDOWN,
+	[ 49 ] = KEY_CHANNELUP,
+	[  1 ] = KEY_BLUE,        // unmarked
 };
 
 static IR_KEYTAB_TYPE winfast_codes[IR_KEYTAB_SIZE] = {
@@ -280,8 +279,9 @@ static int ir_probe(struct device *dev)
 	case BTTV_AVPHONE98:
 	case BTTV_AVERMEDIA98:
 		ir_codes         = ir_codes_avermedia;
-		ir->mask_keycode = 0xf80000;
+		ir->mask_keycode = 0xf88000;
 		ir->mask_keydown = 0x010000;
+		ir->polling      = 50; // ms
 		break;
 
 	case BTTV_PXELVWPLTVPAK:
@@ -300,7 +300,7 @@ static int ir_probe(struct device *dev)
 
 	case BTTV_WINFAST2000:
 		ir_codes         = winfast_codes;
-		ir->mask_keycode = 0x8f8;
+		ir->mask_keycode = 0x1f8;
 		break;
 	case BTTV_MAGICTVIEW061:
 	case BTTV_MAGICTVIEW063:
diff --git a/drivers/media/video/ir-kbd-i2c.c b/drivers/media/video/ir-kbd-i2c.c
index 8b4f0f5f2..958906373 100644
--- a/drivers/media/video/ir-kbd-i2c.c
+++ b/drivers/media/video/ir-kbd-i2c.c
@@ -77,6 +77,56 @@ static IR_KEYTAB_TYPE ir_codes_pv951[IR_KEYTAB_SIZE] = {
 	[ 15 ] = KEY_SELECT, 		// SOURCE
 	[ 10 ] = KEY_KPPLUS,		// +100
 	[ 20 ] = KEY_KPEQUAL,		// SYNC
+	[ 28 ] = KEY_MEDIA,             // PC/TV
+};
+
+static IR_KEYTAB_TYPE ir_codes_purpletv[IR_KEYTAB_SIZE] = {
+	[ 0x3  ] = KEY_POWER,
+	[ 0x6f ] = KEY_MUTE,
+	[ 0x10 ] = KEY_BACKSPACE,	// Recall
+
+	[ 0x11 ] = KEY_KP0,
+	[ 0x4  ] = KEY_KP1,
+	[ 0x5  ] = KEY_KP2,
+	[ 0x6  ] = KEY_KP3,
+	[ 0x8  ] = KEY_KP4,
+	[ 0x9  ] = KEY_KP5,
+	[ 0xa  ] = KEY_KP6,
+	[ 0xc  ] = KEY_KP7,
+	[ 0xd  ] = KEY_KP8,
+	[ 0xe  ] = KEY_KP9,
+	[ 0x12 ] = KEY_KPDOT,		// 100+
+
+	[ 0x7  ] = KEY_VOLUMEUP,
+	[ 0xb  ] = KEY_VOLUMEDOWN,
+	[ 0x1a ] = KEY_KPPLUS,
+	[ 0x18 ] = KEY_KPMINUS,
+	[ 0x15 ] = KEY_UP,
+	[ 0x1d ] = KEY_DOWN,
+	[ 0xf  ] = KEY_CHANNELUP,
+	[ 0x13 ] = KEY_CHANNELDOWN,
+	[ 0x48 ] = KEY_ZOOM,
+
+	[ 0x1b ] = KEY_VIDEO,		// Video source
+#if 0
+	[ 0x1f ] = KEY_S,       	// Snapshot
+#endif
+	[ 0x49 ] = KEY_LANGUAGE,	// MTS Select
+	[ 0x19 ] = KEY_SEARCH,		// Auto Scan
+
+	[ 0x4b ] = KEY_RECORD,
+	[ 0x46 ] = KEY_PLAY,
+	[ 0x45 ] = KEY_PAUSE,   	// Pause
+	[ 0x44 ] = KEY_STOP,
+#if 0
+	[ 0x43 ] = KEY_T,    		// Time Shift
+	[ 0x47 ] = KEY_Y,    		// Time Shift OFF
+	[ 0x4a ] = KEY_O,    		// TOP
+	[ 0x17 ] = KEY_F,    		// SURF CH
+#endif
+	[ 0x40 ] = KEY_FORWARD,   	// Forward ?
+	[ 0x42 ] = KEY_REWIND,   	// Backward ?
+
 };
 
 struct IR;
@@ -202,11 +252,33 @@ static int get_key_knc1(struct IR *ir, u32 *ir_key, u32 *ir_raw)
 	return 1;
 }
 
+static int get_key_purpletv(struct IR *ir, u32 *ir_key, u32 *ir_raw)
+{
+        unsigned char b;
+
+	/* poll IR chip */
+	if (1 != i2c_master_recv(&ir->c,&b,1)) {
+		dprintk(1,"read error\n");
+		return -EIO;
+	}
+
+	/* no button press */
+	if (b==0)
+		return 0;
+
+	/* repeating */
+	if (b & 0x80)
+		return 1;
+
+	*ir_key = b;
+	*ir_raw = b;
+	return 1;
+}
 /* ----------------------------------------------------------------------- */
 
 static void ir_key_poll(struct IR *ir)
 {
-	u32 ir_key, ir_raw;
+	static u32 ir_key, ir_raw;
 	int rc;
 
 	dprintk(2,"ir_poll_key\n");
@@ -300,6 +372,12 @@ static int ir_attach(struct i2c_adapter *adap, int addr,
 		ir_type     = IR_TYPE_OTHER;
 		ir_codes    = ir_codes_empty;
 		break;
+	case 0x7a:
+		name        = "Purple TV";
+		ir->get_key = get_key_purpletv;
+		ir_type     = IR_TYPE_OTHER;
+		ir_codes    = ir_codes_purpletv;
+		break;
 	default:
 		/* shouldn't happen */
 		printk(DEVNAME ": Huh? unknown i2c address (0x%02x)?\n",addr);
@@ -320,7 +398,8 @@ static int ir_attach(struct i2c_adapter *adap, int addr,
 	ir->input.name       = ir->c.name;
 	ir->input.phys       = ir->phys;
 	input_register_device(&ir->input);
-	printk(DEVNAME ": %s detected at %s\n",ir->input.name,ir->input.phys);
+	printk(DEVNAME ": %s detected at %s [%s]\n",
+	       ir->input.name,ir->input.phys,adap->name);
 	       
 	/* start polling via eventd */
 	INIT_WORK(&ir->work, ir_work, ir);
@@ -361,22 +440,33 @@ static int ir_probe(struct i2c_adapter *adap)
 	   That's why we probe 0x1a (~0x34) first. CB 
 	*/
 	
-	static const int probe[] = { 0x1a, 0x18, 0x4b, 0x64, 0x30, -1};
+	static const int probe_bttv[] = { 0x1a, 0x18, 0x4b, 0x64, 0x30, -1};
+	static const int probe_saa7134[] = { 0x7a, -1};
+	const int *probe = NULL;
 	struct i2c_client c; char buf; int i,rc;
 
-	if (adap->id == (I2C_ALGO_BIT | I2C_HW_B_BT848)) {
-		memset(&c,0,sizeof(c));
-		c.adapter = adap;
-		for (i = 0; -1 != probe[i]; i++) {
-			c.addr = probe[i];
-			rc = i2c_master_recv(&c,&buf,1);
-			dprintk(1,"probe 0x%02x @ %s: %s\n",
-				probe[i], adap->name, 
-				(1 == rc) ? "yes" : "no");
-			if (1 == rc) {
-				ir_attach(adap,probe[i],0,0);
-				break;
-			}
+	switch (adap->id) {
+	case I2C_ALGO_BIT | I2C_HW_B_BT848:
+		probe = probe_bttv;
+		break;
+	case I2C_ALGO_SAA7134:
+		probe = probe_saa7134;
+		break;
+	}
+	if (NULL == probe)
+		return 0;
+
+	memset(&c,0,sizeof(c));
+	c.adapter = adap;
+	for (i = 0; -1 != probe[i]; i++) {
+		c.addr = probe[i];
+		rc = i2c_master_recv(&c,&buf,1);
+		dprintk(1,"probe 0x%02x @ %s: %s\n",
+			probe[i], adap->name,
+			(1 == rc) ? "yes" : "no");
+		if (1 == rc) {
+			ir_attach(adap,probe[i],0,0);
+			break;
 		}
 	}
 	return 0;
diff --git a/drivers/media/video/meye.c b/drivers/media/video/meye.c
index bb6e40dcb..6f3fe234e 100644
--- a/drivers/media/video/meye.c
+++ b/drivers/media/video/meye.c
@@ -203,7 +203,7 @@ static int ptable_alloc(void) {
 					  PAGE_SIZE,
 					  meye.mchip_ptable_toc,
 					  meye.mchip_dmahandle);
-			meye.mchip_ptable_toc = 0;
+			meye.mchip_ptable_toc = NULL;
 			meye.mchip_dmahandle = 0;
 			return -1;
 		}
@@ -232,7 +232,7 @@ static void ptable_free(void) {
 				  meye.mchip_dmahandle);
 
 	memset(meye.mchip_ptable, 0, sizeof(meye.mchip_ptable));
-	meye.mchip_ptable_toc = 0;
+	meye.mchip_ptable_toc = NULL;
 	meye.mchip_dmahandle = 0;
 }
 
@@ -473,16 +473,6 @@ static u16 *jpeg_huffman_tables(int *size) {
 /* MCHIP low-level functions                                                */
 /****************************************************************************/
 
-/* waits for the specified miliseconds */
-static inline void wait_ms(unsigned int ms) {
-	if (!in_interrupt()) {
-		set_current_state(TASK_UNINTERRUPTIBLE);
-		schedule_timeout(1 + ms * HZ / 1000);
-	}
-	else
-		mdelay(ms);
-}
-
 /* returns the horizontal capture size */
 static inline int mchip_hsize(void) {
 	return meye.params.subsample ? 320 : 640;
@@ -640,12 +630,12 @@ static void mchip_hic_stop(void) {
 		for (j = 0; j < 100; ++j) {
 			if (mchip_delay(MCHIP_HIC_STATUS, MCHIP_HIC_STATUS_IDLE))
 				return;
-			wait_ms(1);
+			msleep(1);
 		}
 		printk(KERN_ERR "meye: need to reset HIC!\n");
 	
 		mchip_set(MCHIP_HIC_CTL, MCHIP_HIC_CTL_SOFT_RESET);
-		wait_ms(250);
+		msleep(250);
 	}
 	printk(KERN_ERR "meye: resetting HIC hanged!\n");
 }
@@ -741,7 +731,7 @@ static void mchip_take_picture(void) {
 	for (i = 0; i < 100; ++i) {
 		if (mchip_delay(MCHIP_HIC_STATUS, MCHIP_HIC_STATUS_IDLE))
 			break;
-		wait_ms(1);
+		msleep(1);
 	}
 }
 
@@ -757,7 +747,7 @@ static void mchip_get_picture(u8 *buf, int bufsize) {
 	for (i = 0; i < 100; ++i) {
 		if (mchip_delay(MCHIP_HIC_STATUS, MCHIP_HIC_STATUS_IDLE))
 			break;
-		wait_ms(1);
+		msleep(1);
 	}
 	for (i = 0; i < 4 ; ++i) {
 		v = mchip_get_frame();
@@ -799,7 +789,7 @@ static int mchip_compress_frame(u8 *buf, int bufsize) {
 	for (i = 0; i < 100; ++i) {
 		if (mchip_delay(MCHIP_HIC_STATUS, MCHIP_HIC_STATUS_IDLE))
 			break;
-		wait_ms(1);
+		msleep(1);
 	}
 
 	for (i = 0; i < 4 ; ++i) {
@@ -1260,11 +1250,11 @@ static int meye_resume(struct pci_dev *pdev)
 
 	mchip_delay(MCHIP_HIC_CMD, 0);
 	mchip_delay(MCHIP_HIC_STATUS, MCHIP_HIC_STATUS_IDLE);
-	wait_ms(1);
+	msleep(1);
 	mchip_set(MCHIP_VRJ_SOFT_RESET, 1);
-	wait_ms(1);
+	msleep(1);
 	mchip_set(MCHIP_MM_PCI_MODE, 5);
-	wait_ms(1);
+	msleep(1);
 	mchip_set(MCHIP_MM_INTA, MCHIP_MM_INTA_HIC_1_MASK);
 
 	switch (meye.pm_mchip_mode) {
@@ -1349,13 +1339,13 @@ static int __devinit meye_probe(struct pci_dev *pcidev,
 	mchip_delay(MCHIP_HIC_CMD, 0);
 	mchip_delay(MCHIP_HIC_STATUS, MCHIP_HIC_STATUS_IDLE);
 
-	wait_ms(1);
+	msleep(1);
 	mchip_set(MCHIP_VRJ_SOFT_RESET, 1);
 
-	wait_ms(1);
+	msleep(1);
 	mchip_set(MCHIP_MM_PCI_MODE, 5);
 
-	wait_ms(1);
+	msleep(1);
 	mchip_set(MCHIP_MM_INTA, MCHIP_MM_INTA_HIC_1_MASK);
 
 	if (video_register_device(meye.video_dev, VFL_TYPE_GRABBER, video_nr) < 0) {
diff --git a/drivers/media/video/meye.h b/drivers/media/video/meye.h
index 2a2f79ed4..0983b8e57 100644
--- a/drivers/media/video/meye.h
+++ b/drivers/media/video/meye.h
@@ -31,7 +31,7 @@
 #define _MEYE_PRIV_H_
 
 #define MEYE_DRIVER_MAJORVERSION	1
-#define MEYE_DRIVER_MINORVERSION	9
+#define MEYE_DRIVER_MINORVERSION	10
 
 #include <linux/config.h>
 #include <linux/types.h>
diff --git a/drivers/media/video/msp3400.c b/drivers/media/video/msp3400.c
index e2ecf212c..41adfef5c 100644
--- a/drivers/media/video/msp3400.c
+++ b/drivers/media/video/msp3400.c
@@ -51,6 +51,7 @@
 #include <asm/pgtable.h>
 
 #include <media/audiochip.h>
+#include <media/id.h>
 #include "msp3400.h"
 
 /* insmod parameters */
@@ -80,7 +81,7 @@ struct msp3400c {
 	int input;
 
 	int muted;
-	int left, right;	/* volume */
+	int volume, balance;
 	int bass, treble;
 
 	/* shadow register set */
@@ -378,26 +379,24 @@ static void msp3400c_setcarrier(struct i2c_client *client, int cdo1, int cdo2)
 }
 
 static void msp3400c_setvolume(struct i2c_client *client,
-			       int muted, int left, int right)
+			       int muted, int volume, int balance)
 {
-	int vol = 0,val = 0,balance = 0;
+	int val = 0, bal = 0;
 
 	if (!muted) {
-		vol     = (left > right) ? left : right;
-		val     = (vol * 0x73 / 65535) << 8;
+		val = (volume * 0x73 / 65535) << 8;
 	}
-	if (vol > 0) {
-		balance = ((right-left) * 127) / vol;
+	if (val) {
+		bal = (balance / 256) - 128;
 	}
-
 	dprintk(KERN_DEBUG
 		"msp34xx: setvolume: mute=%s %d:%d  v=0x%02x b=0x%02x\n",
-		muted ? "on" : "off", left, right, val>>8, balance);
+		muted ? "on" : "off", volume, balance, val>>8, bal);
 	msp3400c_write(client,I2C_MSP3400C_DFP, 0x0000, val); /* loudspeaker */
 	msp3400c_write(client,I2C_MSP3400C_DFP, 0x0006, val); /* headphones  */
 	/* scart - on/off only */
 	msp3400c_write(client,I2C_MSP3400C_DFP, 0x0007, val ? 0x4000 : 0);
-	msp3400c_write(client,I2C_MSP3400C_DFP, 0x0001, balance << 8);
+	msp3400c_write(client,I2C_MSP3400C_DFP, 0x0001, bal << 8);
 }
 
 static void msp3400c_setbass(struct i2c_client *client, int bass)
@@ -815,7 +814,7 @@ static int msp3400c_thread(void *data)
 			/* no carrier scan, just unmute */
 			printk("msp3400: thread: no carrier scan\n");
 			msp3400c_setvolume(client, msp->muted,
-					   msp->left, msp->right);
+					   msp->volume, msp->balance);
 			continue;
 		}
 		msp->restart = 0;
@@ -960,7 +959,8 @@ static int msp3400c_thread(void *data)
 		}
 
 		/* unmute + restore dfp registers */
-		msp3400c_setvolume(client, msp->muted, msp->left, msp->right);
+		msp3400c_setvolume(client, msp->muted,
+				   msp->volume, msp->balance);
 		msp3400c_restore_dfp(client);
 
 		if (msp->watch_stereo)
@@ -1042,7 +1042,7 @@ static int msp3410d_thread(void *data)
 			/* no carrier scan needed, just unmute */
 			dprintk(KERN_DEBUG "msp3410: thread: no carrier scan\n");
 			msp3400c_setvolume(client, msp->muted,
-					   msp->left, msp->right);
+					   msp->volume, msp->balance);
 			continue;
 		}
 		msp->restart = 0;
@@ -1194,7 +1194,8 @@ static int msp3410d_thread(void *data)
 		/* unmute + restore dfp registers */
 		msp3400c_setbass(client, msp->bass);
 		msp3400c_settreble(client, msp->treble);
-		msp3400c_setvolume(client, msp->muted, msp->left, msp->right);
+		msp3400c_setvolume(client, msp->muted,
+				    msp->volume, msp->balance);
 		msp3400c_restore_dfp(client);
 
 		if (msp->watch_stereo)
@@ -1257,8 +1258,8 @@ static int msp_attach(struct i2c_adapter *adap, int addr, int kind)
 	}
 	
 	memset(msp,0,sizeof(struct msp3400c));
-	msp->left   = 65535;
-	msp->right  = 65535;
+	msp->volume = 65535;
+	msp->balance = 32768;
 	msp->bass   = 32768;
 	msp->treble = 32768;
 	msp->input  = -1;
@@ -1290,7 +1291,7 @@ static int msp_attach(struct i2c_adapter *adap, int addr, int kind)
 	/* this will turn on a 1kHz beep - might be useful for debugging... */
 	msp3400c_write(c,I2C_MSP3400C_DFP, 0x0014, 0x1040);
 #endif
-	msp3400c_setvolume(c,msp->muted,msp->left,msp->right);
+	msp3400c_setvolume(c, msp->muted, msp->volume, msp->balance);
 
 	snprintf(c->name, sizeof(c->name), "MSP34%02d%c-%c%d",
 		 (msp->rev2>>8)&0xff, (msp->rev1&0xff)+'@',
@@ -1440,8 +1441,10 @@ static int msp_command(struct i2c_client *client, unsigned int cmd, void *arg)
 		} else {
 			/* set msp3400 to FM radio mode */
 			msp3400c_setmode(client,MSP_MODE_FM_RADIO);
-			msp3400c_setcarrier(client, MSP_CARRIER(10.7),MSP_CARRIER(10.7));
-			msp3400c_setvolume(client,msp->muted,msp->left,msp->right);			
+			msp3400c_setcarrier(client, MSP_CARRIER(10.7),
+					    MSP_CARRIER(10.7));
+			msp3400c_setvolume(client, msp->muted,
+					   msp->volume, msp->balance);
 		}
 		if (msp->active)
 			msp->restart = 1;
@@ -1488,16 +1491,9 @@ static int msp_command(struct i2c_client *client, unsigned int cmd, void *arg)
 			VIDEO_AUDIO_MUTABLE;
 		if (msp->muted)
 			va->flags |= VIDEO_AUDIO_MUTE;
-		va->volume=max(msp->left,msp->right);
 
-		if (0 == va->volume) {
-			va->balance = 32768;
-		} else {
-			va->balance = (32768 * min(msp->left,msp->right))
-				/ va->volume;
-			va->balance = (msp->left<msp->right) ?
-				(65535 - va->balance) : va->balance;
-		}
+		va->volume = msp->volume;
+		va->balance = (va->volume) ? msp->balance : 32768;
 		va->bass = msp->bass;
 		va->treble = msp->treble;
 
@@ -1513,13 +1509,13 @@ static int msp_command(struct i2c_client *client, unsigned int cmd, void *arg)
 
 		dprintk(KERN_DEBUG "msp34xx: VIDIOCSAUDIO\n");
 		msp->muted = (va->flags & VIDEO_AUDIO_MUTE);
-		msp->left = (min(65536 - va->balance,32768) *
-			     va->volume) / 32768;
-		msp->right = (min(va->balance,(__u16)32768) *
-			      va->volume) / 32768;
+		msp->volume = va->volume;
+		msp->balance = va->balance;
 		msp->bass = va->bass;
 		msp->treble = va->treble;
-		msp3400c_setvolume(client,msp->muted,msp->left,msp->right);
+
+		msp3400c_setvolume(client, msp->muted,
+				   msp->volume, msp->balance);
 		msp3400c_setbass(client,msp->bass);
 		msp3400c_settreble(client,msp->treble);
 
diff --git a/drivers/media/video/mxb.c b/drivers/media/video/mxb.c
index 56b42fde4..121d626f0 100644
--- a/drivers/media/video/mxb.c
+++ b/drivers/media/video/mxb.c
@@ -150,7 +150,7 @@ static struct saa7146_extension extension;
 
 static int mxb_probe(struct saa7146_dev* dev)
 {
-	struct mxb* mxb = 0;
+	struct mxb* mxb = NULL;
 	struct i2c_client *client;
 	struct list_head *item;
 	int result;
diff --git a/drivers/media/video/pms.c b/drivers/media/video/pms.c
index 82119dc9b..d127e291f 100644
--- a/drivers/media/video/pms.c
+++ b/drivers/media/video/pms.c
@@ -625,7 +625,7 @@ static void pms_vcrinput(short input)
 }
 
 
-static int pms_capture(struct pms_device *dev, char *buf, int rgb555, int count)
+static int pms_capture(struct pms_device *dev, char __user *buf, int rgb555, int count)
 {
 	int y;
 	int dw = 2*dev->width;
@@ -865,7 +865,7 @@ static int pms_ioctl(struct inode *inode, struct file *file,
 	return video_usercopy(inode, file, cmd, arg, pms_do_ioctl);
 }
 
-static int pms_read(struct file *file, char *buf,
+static int pms_read(struct file *file, char __user *buf,
 		    size_t count, loff_t *ppos)
 {
 	struct video_device *v = video_devdata(file);
diff --git a/drivers/media/video/saa5246a.c b/drivers/media/video/saa5246a.c
index eecc102db..c2fb64d57 100644
--- a/drivers/media/video/saa5246a.c
+++ b/drivers/media/video/saa5246a.c
@@ -1,9 +1,10 @@
 /*
- * Driver for the SAA5246A videotext decoder chip from Philips.
+ * Driver for the SAA5246A or SAA5281 Teletext (=Videotext) decoder chips from
+ * Philips.
  *
- * Only capturing of videotext pages is tested. The SAA5246A chip also has
- * a TV output but my hardware doesn't use it. For this reason this driver
- * does not support changing any TV display settings.
+ * Only capturing of Teletext pages is tested. The videotext chips also have a
+ * TV output but my hardware doesn't use it. For this reason this driver does
+ * not support changing any TV display settings.
  *
  * Copyright (C) 2004 Michael Geng <linux@MichaelGeng.de>
  *
@@ -47,6 +48,10 @@
 #include <linux/videodev.h>
 #include "saa5246a.h"
 
+MODULE_AUTHOR("Michael Geng <linux@MichaelGeng.de>");
+MODULE_DESCRIPTION("Philips SAA5246A, SAA5281 Teletext decoder driver");
+MODULE_LICENSE("GPL");
+
 struct saa5246a_device
 {
 	u8     pgbuf[NUM_DAUS][VTX_VIRTUALSIZE];
@@ -480,73 +485,76 @@ static inline int saa5246a_get_status(struct saa5246a_device *t,
 static inline int saa5246a_get_page(struct saa5246a_device *t,
 	vtx_pagereq_t *req)
 {
-	int start, end;
+	int start, end, size;
+	char *buf;
+	int err;
 
 	if (req->pgbuf < 0 || req->pgbuf >= NUM_DAUS ||
 	    req->start < 0 || req->start > req->end || req->end >= VTX_PAGESIZE)
 		return -EINVAL;
-	/* Read "normal" part of page */
-	end = min(req->end, VTX_PAGESIZE - 1);
-	if (i2c_senddata(t, SAA5246A_REGISTER_R8,
 
-		req->pgbuf |
-		R8_DO_NOT_CLEAR_MEMORY,
+	buf = kmalloc(VTX_PAGESIZE, GFP_KERNEL);
+	if (!buf)
+		return -ENOMEM;
 
-		ROW(req->start),
+	/* Read "normal" part of page */
+	err = -EIO;
 
-		COLUMN(req->start),
+	end = min(req->end, VTX_PAGESIZE - 1);
+	if (i2c_senddata(t, SAA5246A_REGISTER_R8,
+			req->pgbuf | R8_DO_NOT_CLEAR_MEMORY,
+			ROW(req->start), COLUMN(req->start), COMMAND_END))
+		goto out;
+	if (i2c_getdata(t, end - req->start + 1, buf))
+		goto out;
+	err = -EFAULT;
+	if (copy_to_user(req->buffer, buf, end - req->start + 1))
+		goto out;
 
-		COMMAND_END) ||
-		i2c_getdata(t, end - req->start + 1, req->buffer))
-	{
-		return -EIO;
-	}
 	/* Always get the time from buffer 4, since this stupid SAA5246A only
 	 * updates the currently displayed buffer...
 	 */
-	if (REQ_CONTAINS_TIME(req))
-	{
+	if (REQ_CONTAINS_TIME(req)) {
 		start = max(req->start, POS_TIME_START);
 		end   = min(req->end,   POS_TIME_END);
+		size = end - start + 1;
+		err = -EINVAL;
+		if (size < 0)
+			goto out;
+		err = -EIO;
 		if (i2c_senddata(t, SAA5246A_REGISTER_R8,
-
-			R8_ACTIVE_CHAPTER_4 |
-			R8_DO_NOT_CLEAR_MEMORY,
-
-			R9_CURSER_ROW_0,
-
-			start,
-
-			COMMAND_END) ||
-			i2c_getdata(t, end - start + 1,
-				req->buffer + start - req->start))
-		{
-			return -EIO;
-		}
+				R8_ACTIVE_CHAPTER_4 | R8_DO_NOT_CLEAR_MEMORY,
+				R9_CURSER_ROW_0, start, COMMAND_END))
+			goto out;
+		if (i2c_getdata(t, size, buf))
+			goto out;
+		err = -EFAULT;
+		if (copy_to_user(req->buffer + start - req->start, buf, size))
+			goto out;
 	}
 	/* Insert the header from buffer 4 only, if acquisition circuit is still searching for a page */
-	if (REQ_CONTAINS_HEADER(req) && t->is_searching[req->pgbuf])
-	{
+	if (REQ_CONTAINS_HEADER(req) && t->is_searching[req->pgbuf]) {
 		start = max(req->start, POS_HEADER_START);
 		end   = min(req->end,   POS_HEADER_END);
+		size = end - start + 1;
+		err = -EINVAL;
+		if (size < 0)
+			goto out;
+		err = -EIO;
 		if (i2c_senddata(t, SAA5246A_REGISTER_R8,
-
-			R8_ACTIVE_CHAPTER_4 |
-			R8_DO_NOT_CLEAR_MEMORY,
-
-			R9_CURSER_ROW_0,
-
-			start,
-
-			COMMAND_END) ||
-			i2c_getdata(t, end - start + 1,
-				req->buffer + start - req->start))
-		{
-			return -EIO;
-		}
+				R8_ACTIVE_CHAPTER_4 | R8_DO_NOT_CLEAR_MEMORY,
+				R9_CURSER_ROW_0, start, COMMAND_END))
+			goto out;
+		if (i2c_getdata(t, end - start + 1, buf))
+			goto out;
+		err = -EFAULT;
+		if (copy_to_user(req->buffer + start - req->start, buf, size))
+			goto out;
 	}
-
-	return 0;
+	err = 0;
+out:
+	kfree(buf);
+	return err;
 }
 
 /* Stops the acquisition circuit given in dau_no. The page buffer associated
@@ -764,8 +772,8 @@ static int saa5246a_release(struct inode *inode, struct file *file)
 
 static int __init init_saa_5246a (void)
 {
-	printk(KERN_INFO "SAA5246A driver (" IF_NAME
-		" interface) for VideoText version %d.%d\n",
+	printk(KERN_INFO
+		"SAA5246A (or compatible) Teletext decoder driver version %d.%d\n",
 		MAJOR_VERSION, MINOR_VERSION);
 	return i2c_add_driver(&i2c_driver_videotext);
 }
@@ -796,5 +804,3 @@ static struct video_device saa_template =
 	.release  = video_device_release,
 	.minor    = -1,
 };
-
-MODULE_LICENSE("GPL");
diff --git a/drivers/media/video/saa5246a.h b/drivers/media/video/saa5246a.h
index e8f1adf9a..70b98a430 100644
--- a/drivers/media/video/saa5246a.h
+++ b/drivers/media/video/saa5246a.h
@@ -1,5 +1,7 @@
 /*
-   Driver for the SAA5246A videotext decoder chip from Philips.
+   Driver for the SAA5246A or SAA5281 Teletext (=Videotext) decoder chips from
+   Philips.
+
    Copyright (C) 2004 Michael Geng (linux@MichaelGeng.de)
 
    This program is free software; you can redistribute it and/or modify
@@ -21,7 +23,7 @@
 #define __SAA5246A_H__
 
 #define MAJOR_VERSION 1		/* driver major version number */
-#define MINOR_VERSION 6		/* driver minor version number */
+#define MINOR_VERSION 7		/* driver minor version number */
 
 #define IF_NAME "SAA5246A"
 
diff --git a/drivers/media/video/saa7134/saa6752hs.c b/drivers/media/video/saa7134/saa6752hs.c
index 5ea367e0e..3343e4133 100644
--- a/drivers/media/video/saa7134/saa6752hs.c
+++ b/drivers/media/video/saa7134/saa6752hs.c
@@ -337,7 +337,6 @@ static int saa6752hs_probe(struct i2c_adapter *adap)
 {
 	if (adap->class & I2C_CLASS_TV_ANALOG)
 		return i2c_probe(adap, &addr_data, saa6752hs_attach);
-
 	return 0;
 }
 
diff --git a/drivers/media/video/saa7134/saa7134-cards.c b/drivers/media/video/saa7134/saa7134-cards.c
index cee199e59..5bb99d716 100644
--- a/drivers/media/video/saa7134/saa7134-cards.c
+++ b/drivers/media/video/saa7134/saa7134-cards.c
@@ -420,20 +420,14 @@ struct saa7134_board saa7134_boards[] = {
 			.vmux   = 1,
 			.amux   = TV,
 			.tv     = 1,
-#if 0
 		},{
 			.name   = name_comp1,
 			.vmux   = 0,
 			.amux   = LINE2,
-		},{
-			.name   = name_comp2,
-			.vmux   = 3,
-			.amux   = LINE2,
 		},{
 			.name   = name_svideo,
 			.vmux   = 8,
 			.amux   = LINE2,
-#endif
 		}},
 		.radio = {
 			.name   = name_radio,
@@ -515,24 +509,14 @@ struct saa7134_board saa7134_boards[] = {
                         .vmux = 1,
                         .amux = TV,
                         .tv   = 1,
-#if 0 /* untested */
                 },{
                         .name = name_comp1,
                         .vmux = 4,
                         .amux = LINE2,
-                },{
-                        .name = name_comp2,
-                        .vmux = 2,
-                        .amux = LINE2,
                 },{
                         .name = name_svideo,
                         .vmux = 6,
                         .amux = LINE2,
-                },{
-                        .name = "S-Video2",
-                        .vmux = 7,
-                        .amux = LINE2,
-#endif
                 }},
                 .radio = {
                         .name = name_radio,
@@ -679,7 +663,7 @@ struct saa7134_board saa7134_boards[] = {
                 }},
         },
 	[SAA7134_BOARD_MD2819] = {
-		.name           = "Medion 2819/ AverMedia M156",
+		.name           = "AverMedia M156 / Medion 2819",
 		.audio_clock    = 0x00187de7,
 		.tuner_type     = TUNER_PHILIPS_FM1216ME_MK3,
 		.need_tda9887   = 1,
@@ -951,6 +935,96 @@ struct saa7134_board saa7134_boards[] = {
 			.vmux = 3,
 		}},
 	},
+        [SAA7134_BOARD_NOVAC_PRIMETV7133] = {
+                /* toshii@netbsd.org */
+                .name           = "Noval Prime TV 7133",
+                .audio_clock    = 0x00200000,
+                .tuner_type     = TUNER_ALPS_TSBH1_NTSC,
+                .inputs         = {{
+                        .name = name_comp1,
+                        .vmux = 3,
+                },{
+                        .name = name_tv,
+                        .vmux = 1,
+                        .amux = TV,
+                        .tv   = 1,
+                },{
+                        .name = name_svideo,
+                        .vmux = 8,
+                }},
+        },
+	[SAA7134_BOARD_AVERMEDIA_305] = {
+		.name           = "AverMedia 305",
+		.audio_clock    = 0x00187de7,
+		.tuner_type     = TUNER_PHILIPS_FM1216ME_MK3,
+		.need_tda9887   = 1,
+		.inputs         = {{
+			.name = name_tv,
+			.vmux = 1,
+			.amux = LINE2,
+			.tv   = 1,
+		},{
+			.name = name_comp1,
+			.vmux = 0,
+			.amux = LINE2,
+		},{
+			.name = name_comp2,
+			.vmux = 3,
+			.amux = LINE2,
+		},{
+			.name = name_svideo,
+			.vmux = 8,
+			.amux = LINE2,
+		}},
+		.radio = {
+			 .name = name_radio,
+			 .amux = LINE2,
+		 },
+		.mute = {
+			 .name = name_mute,
+			 .amux = LINE1,
+		},
+	},
+  	[SAA7133_BOARD_UPMOST_PURPLE_TV] = {
+  		.name           = "UPMOST PURPLE TV",
+  		.audio_clock    = 0x00187de7,
+  		.tuner_type     = TUNER_PHILIPS_FM1236_MK3,
+  		.need_tda9887   = 1,
+  		.inputs         = {{
+  			.name = name_tv,
+  			.vmux = 7,
+  			.amux = TV,
+  			.tv   = 1,
+  		},{
+  			.name = name_svideo,
+  			.vmux = 7,
+  			.amux = LINE1,
+  		}},
+          },
+	[SAA7134_BOARD_ITEMS_MTV005] = {
+		/* Norman Jonas <normanjonas@arcor.de> */
+		.name           = "Items MuchTV Plus / IT-005",
+		.audio_clock    = 0x00187de7,
+		.tuner_type     = TUNER_PHILIPS_PAL,
+		.inputs         = {{
+			.name = name_tv,
+			.vmux = 3,
+			.amux = TV,
+			.tv   = 1,
+		},{
+			.name   = name_comp1,
+			.vmux   = 1,
+			.amux   = LINE1,
+		},{
+			.name = name_svideo,
+			.vmux = 8,
+			.amux = LINE1,
+		}},
+		.radio = {
+			.name = name_radio,
+			.amux = LINE2,
+		},
+	},
 };
 const unsigned int saa7134_bcount = ARRAY_SIZE(saa7134_boards);
 
@@ -1103,12 +1177,11 @@ struct pci_device_id saa7134_pci_tbl[] = {
                 .subdevice    = 0xa70b,
 		.driver_data  = SAA7134_BOARD_MD2819,
 	},{
-		/* AverMedia Studio 305, using AverMedia M156 entry for now */
 		.vendor       = PCI_VENDOR_ID_PHILIPS,
-		.device       = PCI_DEVICE_ID_PHILIPS_SAA7134,
+		.device       = PCI_DEVICE_ID_PHILIPS_SAA7130,
                 .subvendor    = 0x1461, /* Avermedia Technologies Inc */
                 .subdevice    = 0x2115,
-		.driver_data  = SAA7134_BOARD_MD2819,
+		.driver_data  = SAA7134_BOARD_AVERMEDIA_305,
 	},{
 		.vendor       = PCI_VENDOR_ID_PHILIPS,
 		.device       = PCI_DEVICE_ID_PHILIPS_SAA7130,
@@ -1141,7 +1214,13 @@ struct pci_device_id saa7134_pci_tbl[] = {
                 .subdevice    = 0x4cb5,
                 .driver_data  = SAA7134_BOARD_ECS_TVP3XP_4CB5,
         },{
+		.vendor       = PCI_VENDOR_ID_PHILIPS,
+ 		.device       = PCI_DEVICE_ID_PHILIPS_SAA7133,
+                .subvendor    = 0x12ab,
+                .subdevice    = 0x0800,
+ 		.driver_data  = SAA7133_BOARD_UPMOST_PURPLE_TV,
 		
+ 	},{
 		/* --- boards without eeprom + subsystem ID --- */
                 .vendor       = PCI_VENDOR_ID_PHILIPS,
                 .device       = PCI_DEVICE_ID_PHILIPS_SAA7134,
@@ -1251,6 +1330,9 @@ int saa7134_board_init(struct saa7134_dev *dev)
 	case SAA7134_BOARD_ECS_TVP3XP_4CB5:
 		dev->has_remote = 1;
 		break;
+	case SAA7134_BOARD_AVACSSMARTTV:
+		dev->has_remote = 1;
+		break;
 	}
 	return 0;
 }
diff --git a/drivers/media/video/saa7134/saa7134-core.c b/drivers/media/video/saa7134/saa7134-core.c
index d343d1e93..cf87dda32 100644
--- a/drivers/media/video/saa7134/saa7134-core.c
+++ b/drivers/media/video/saa7134/saa7134-core.c
@@ -324,7 +324,7 @@ int saa7134_buffer_queue(struct saa7134_dev *dev,
 			 struct saa7134_buf *buf)
 {
 	struct saa7134_buf *next = NULL;
-#if DEBUG_SPINLOCKS
+#ifdef DEBUG_SPINLOCKS
 	BUG_ON(!spin_is_locked(&dev->slock));
 #endif
 	
@@ -353,7 +353,7 @@ void saa7134_buffer_finish(struct saa7134_dev *dev,
 			   struct saa7134_dmaqueue *q,
 			   unsigned int state)
 {
-#if DEBUG_SPINLOCKS
+#ifdef DEBUG_SPINLOCKS
 	BUG_ON(!spin_is_locked(&dev->slock));
 #endif
 	dprintk("buffer_finish %p\n",q->curr);
@@ -370,7 +370,7 @@ void saa7134_buffer_next(struct saa7134_dev *dev,
 {
 	struct saa7134_buf *buf,*next = NULL;
 
-#if DEBUG_SPINLOCKS
+#ifdef DEBUG_SPINLOCKS
 	BUG_ON(!spin_is_locked(&dev->slock));
 #endif
 	BUG_ON(NULL != q->curr);
@@ -427,7 +427,7 @@ int saa7134_set_dmabits(struct saa7134_dev *dev)
 	enum v4l2_field cap = V4L2_FIELD_ANY;
 	enum v4l2_field ov  = V4L2_FIELD_ANY;
 
-#if DEBUG_SPINLOCKS
+#ifdef DEBUG_SPINLOCKS
 	BUG_ON(!spin_is_locked(&dev->slock));
 #endif
 
@@ -607,10 +607,18 @@ static irqreturn_t saa7134_irq(int irq, void *dev_id, struct pt_regs *regs)
 	};
 	if (10 == loop) {
 		print_irqstatus(dev,loop,report,status);
-		printk(KERN_WARNING "%s/irq: looping -- clearing enable bits\n",dev->name);
-		/* disable all irqs */
-		saa_writel(SAA7134_IRQ1,0);
-		saa_writel(SAA7134_IRQ2,0);
+		if (report & SAA7134_IRQ_REPORT_PE) {
+			/* disable all parity error */
+			printk(KERN_WARNING "%s/irq: looping -- "
+			       "clearing PE (parity error!) enable bit\n",dev->name);
+			saa_clearl(SAA7134_IRQ2,SAA7134_IRQ2_INTE_PE);
+		} else {
+			/* disable all irqs */
+			printk(KERN_WARNING "%s/irq: looping -- "
+			       "clearing all enable bits\n",dev->name);
+			saa_writel(SAA7134_IRQ1,0);
+			saa_writel(SAA7134_IRQ2,0);
+		}
 	}
 
  out:
diff --git a/drivers/media/video/saa7134/saa7134-input.c b/drivers/media/video/saa7134/saa7134-input.c
index e5ff0e5b6..a34447d6b 100644
--- a/drivers/media/video/saa7134/saa7134-input.c
+++ b/drivers/media/video/saa7134/saa7134-input.c
@@ -20,12 +20,24 @@
 #include <linux/module.h>
 #include <linux/init.h>
 #include <linux/delay.h>
+#include <linux/sched.h>
 #include <linux/interrupt.h>
 #include <linux/input.h>
 
 #include "saa7134-reg.h"
 #include "saa7134.h"
 
+static unsigned int disable_ir = 0;
+MODULE_PARM(disable_ir,"i");
+MODULE_PARM_DESC(disable_ir,"disable infrared remote support");
+
+static unsigned int ir_debug = 0;
+MODULE_PARM(ir_debug,"i");
+MODULE_PARM_DESC(ir_debug,"enable debug messages [IR]");
+
+#define dprintk(fmt, arg...)	if (ir_debug) \
+	printk(KERN_DEBUG "%s/ir: " fmt, dev->name , ## arg)
+
 /* ---------------------------------------------------------------------- */
 
 static IR_KEYTAB_TYPE flyvideo_codes[IR_KEYTAB_SIZE] = {
@@ -156,6 +168,47 @@ static IR_KEYTAB_TYPE eztv_codes[IR_KEYTAB_SIZE] = {
         [ 33 ] = KEY_KPDOT,          // . (decimal dot)
 };
 
+static IR_KEYTAB_TYPE avacssmart_codes[IR_KEYTAB_SIZE] = {
+        [ 30 ] = KEY_POWER,		// power
+	[ 28 ] = KEY_SEARCH,		// scan
+        [  7 ] = KEY_SELECT,		// source
+
+	[ 22 ] = KEY_VOLUMEUP,
+	[ 20 ] = KEY_VOLUMEDOWN,
+        [ 31 ] = KEY_CHANNELUP,
+	[ 23 ] = KEY_CHANNELDOWN,
+	[ 24 ] = KEY_MUTE,
+
+	[  2 ] = KEY_KP0,
+        [  1 ] = KEY_KP1,
+        [ 11 ] = KEY_KP2,
+        [ 27 ] = KEY_KP3,
+        [  5 ] = KEY_KP4,
+        [  9 ] = KEY_KP5,
+        [ 21 ] = KEY_KP6,
+	[  6 ] = KEY_KP7,
+        [ 10 ] = KEY_KP8,
+	[ 18 ] = KEY_KP9,
+	[ 16 ] = KEY_KPDOT,
+
+	[  3 ] = KEY_TUNER,		// tv/fm
+        [  4 ] = KEY_REWIND,		// fm tuning left or function left
+        [ 12 ] = KEY_FORWARD,		// fm tuning right or function right
+
+	[  0 ] = KEY_RECORD,
+        [  8 ] = KEY_STOP,
+        [ 17 ] = KEY_PLAY,
+
+	[ 25 ] = KEY_ZOOM,
+	[ 14 ] = KEY_MENU,		// function
+	[ 19 ] = KEY_AGAIN,		// recall
+	[ 29 ] = KEY_RESTART,		// reset
+
+// FIXME
+	[ 13 ] = KEY_F21,		// mts
+        [ 15 ] = KEY_F22,		// min
+	[ 26 ] = KEY_F23,		// freeze
+};
 /* ---------------------------------------------------------------------- */
 
 static int build_key(struct saa7134_dev *dev)
@@ -175,8 +228,8 @@ static int build_key(struct saa7134_dev *dev)
         }
 
  	data = ir_extract_bits(gpio, ir->mask_keycode);
-	printk("%s: build_key gpio=0x%x mask=0x%x data=%d\n",
-	       dev->name, gpio, ir->mask_keycode, data);
+	dprintk("build_key gpio=0x%x mask=0x%x data=%d\n",
+		gpio, ir->mask_keycode, data);
 
 	if ((ir->mask_keydown  &&  (0 != (gpio & ir->mask_keydown))) ||
 	    (ir->mask_keyup    &&  (0 == (gpio & ir->mask_keyup)))) {
@@ -218,9 +271,12 @@ int saa7134_input_init1(struct saa7134_dev *dev)
 	int polling      = 0;
 	int ir_type      = IR_TYPE_OTHER;
 
-	/* detect & configure */
 	if (!dev->has_remote)
 		return -ENODEV;
+	if (disable_ir)
+		return -ENODEV;
+
+	/* detect & configure */
 	switch (dev->board) {
 	case SAA7134_BOARD_FLYVIDEO2000:
 	case SAA7134_BOARD_FLYVIDEO3000:
@@ -241,6 +297,12 @@ int saa7134_input_init1(struct saa7134_dev *dev)
                 mask_keyup   = 0x000002;
 		polling      = 50; // ms
                 break;
+	case SAA7134_BOARD_AVACSSMARTTV:
+	        ir_codes     = avacssmart_codes;
+		mask_keycode = 0x00001F;
+		mask_keyup   = 0x000020;
+		polling      = 50; // ms
+		break;
 	}
 	if (NULL == ir_codes) {
 		printk("%s: Oops: IR config error [card=%d]\n",
diff --git a/drivers/media/video/saa7134/saa7134-oss.c b/drivers/media/video/saa7134/saa7134-oss.c
index ffa675b91..63b32ab17 100644
--- a/drivers/media/video/saa7134/saa7134-oss.c
+++ b/drivers/media/video/saa7134/saa7134-oss.c
@@ -50,7 +50,7 @@ static int dsp_buffer_conf(struct saa7134_dev *dev, int blksize, int blocks)
 	if (blksize < 0x100)
 		blksize = 0x100;
 	if (blksize > 0x10000)
-		blksize = 0x100;
+		blksize = 0x10000;
 
 	if (blocks < 2)
 		blocks = 2;
@@ -74,6 +74,7 @@ static int dsp_buffer_init(struct saa7134_dev *dev)
 
 	if (!dev->oss.bufsize)
 		BUG();
+	videobuf_dma_init(&dev->oss.dma);
 	err = videobuf_dma_init_kernel(&dev->oss.dma, PCI_DMA_FROMDEVICE,
 				       dev->oss.bufsize >> PAGE_SHIFT);
 	if (0 != err)
@@ -172,7 +173,7 @@ static int dsp_rec_start(struct saa7134_dev *dev)
 			fmt |= (2 << 4);
 		if (!sign)
 			fmt |= 0x04;
-		saa_writel(0x588 >> 2, dev->oss.blksize);
+		saa_writel(0x588 >> 2, dev->oss.blksize -4);
 		saa_writel(0x58c >> 2, 0x543210 | (fmt << 24));
 		break;
 	}
@@ -280,7 +281,7 @@ static int dsp_release(struct inode *inode, struct file *file)
 	return 0;
 }
 
-static ssize_t dsp_read(struct file *file, char *buffer,
+static ssize_t dsp_read(struct file *file, char __user *buffer,
 			size_t count, loff_t *ppos)
 {
 	struct saa7134_dev *dev = file->private_data;
@@ -353,7 +354,7 @@ static ssize_t dsp_read(struct file *file, char *buffer,
 	return ret;
 }
 
-static ssize_t dsp_write(struct file *file, const char *buffer,
+static ssize_t dsp_write(struct file *file, const char __user *buffer,
 			 size_t count, loff_t *ppos)
 {
 	return -EINVAL;
@@ -363,25 +364,27 @@ static int dsp_ioctl(struct inode *inode, struct file *file,
 		     unsigned int cmd, unsigned long arg)
 {
 	struct saa7134_dev *dev = file->private_data;
+	void __user *argp = (void __user *) arg;
+	int __user *p = argp;
 	int val = 0;
 	
 	if (oss_debug > 1)
 		saa7134_print_ioctl(dev->name,cmd);
         switch (cmd) {
         case OSS_GETVERSION:
-                return put_user(SOUND_VERSION, (int *)arg);
+                return put_user(SOUND_VERSION, p);
         case SNDCTL_DSP_GETCAPS:
 		return 0;
 
         case SNDCTL_DSP_SPEED:
-		if (get_user(val, (int*)arg))
+		if (get_user(val, p))
 			return -EFAULT;
 		/* fall through */
         case SOUND_PCM_READ_RATE:
-		return put_user(dev->oss.rate, (int*)arg);
+		return put_user(dev->oss.rate, p);
 
         case SNDCTL_DSP_STEREO:
-		if (get_user(val, (int*)arg))
+		if (get_user(val, p))
 			return -EFAULT;
 		down(&dev->oss.lock);
 		dev->oss.channels = val ? 2 : 1;
@@ -390,10 +393,10 @@ static int dsp_ioctl(struct inode *inode, struct file *file,
 			dsp_rec_start(dev);
 		}
 		up(&dev->oss.lock);
-		return put_user(dev->oss.channels-1, (int *)arg);
+		return put_user(dev->oss.channels-1, p);
 
         case SNDCTL_DSP_CHANNELS:
-		if (get_user(val, (int*)arg))
+		if (get_user(val, p))
 			return -EFAULT;
 		if (val != 1 && val != 2)
 			return -EINVAL;
@@ -406,15 +409,15 @@ static int dsp_ioctl(struct inode *inode, struct file *file,
 		up(&dev->oss.lock);
 		/* fall through */
         case SOUND_PCM_READ_CHANNELS:
-		return put_user(dev->oss.channels, (int *)arg);
+		return put_user(dev->oss.channels, p);
 		
         case SNDCTL_DSP_GETFMTS: /* Returns a mask */
 		return put_user(AFMT_U8     | AFMT_S8     |
 				AFMT_U16_LE | AFMT_U16_BE |
-				AFMT_S16_LE | AFMT_S16_BE, (int*)arg);
+				AFMT_S16_LE | AFMT_S16_BE, p);
 
         case SNDCTL_DSP_SETFMT: /* Selects ONE fmt */
-		if (get_user(val, (int*)arg))
+		if (get_user(val, p))
 			return -EFAULT;
 		switch (val) {
 		case AFMT_QUERY:
@@ -433,7 +436,7 @@ static int dsp_ioctl(struct inode *inode, struct file *file,
 				dsp_rec_start(dev);
 			}
 			up(&dev->oss.lock);
-			return put_user(dev->oss.afmt,(int*)arg);
+			return put_user(dev->oss.afmt, p);
 		default:
 			return -EINVAL;
 		}
@@ -442,12 +445,12 @@ static int dsp_ioctl(struct inode *inode, struct file *file,
 		switch (dev->oss.afmt) {
 		case AFMT_U8:
 		case AFMT_S8:
-			return put_user(8, (int*)arg);
+			return put_user(8, p);
 		case AFMT_U16_LE:
 		case AFMT_U16_BE:
 		case AFMT_S16_LE:
 		case AFMT_S16_BE:
-			return put_user(16, (int*)arg);
+			return put_user(16, p);
 		default:
 			return -EINVAL;
 		}
@@ -463,15 +466,16 @@ static int dsp_ioctl(struct inode *inode, struct file *file,
 		up(&dev->oss.lock);
 		return 0;
         case SNDCTL_DSP_GETBLKSIZE:
-		return put_user(dev->oss.blksize,(int*)arg);
+		return put_user(dev->oss.blksize, p);
 
         case SNDCTL_DSP_SETFRAGMENT:
-		if (get_user(val, (int*)arg))
+		if (get_user(val, p))
 			return -EFAULT;
 		if (dev->oss.recording_on)
 			return -EBUSY;
 		dsp_buffer_free(dev);
-		dsp_buffer_conf(dev,1 << (val & 0xffff), (arg >> 16) & 0xffff);
+		/* used to be arg >> 16 instead of val >> 16; fixed */
+		dsp_buffer_conf(dev,1 << (val & 0xffff), (val >> 16) & 0xffff);
 		dsp_buffer_init(dev);
 		return 0;
 
@@ -486,7 +490,7 @@ static int dsp_ioctl(struct inode *inode, struct file *file,
 		info.fragstotal = dev->oss.blocks;
 		info.bytes      = dev->oss.read_count;
 		info.fragments  = info.bytes / info.fragsize;
-		if (copy_to_user((void *)arg, &info, sizeof(info)))
+		if (copy_to_user(argp, &info, sizeof(info)))
 			return -EFAULT;
 		return 0;
 	}
@@ -647,12 +651,14 @@ static int mixer_ioctl(struct inode *inode, struct file *file,
 	struct saa7134_dev *dev = file->private_data;
 	enum saa7134_audio_in input;
 	int val,ret;
+	void __user *argp = (void __user *) arg;
+	int __user *p = argp;
 	
 	if (oss_debug > 1)
 		saa7134_print_ioctl(dev->name,cmd);
         switch (cmd) {
         case OSS_GETVERSION:
-                return put_user(SOUND_VERSION, (int *)arg);
+                return put_user(SOUND_VERSION, p);
 	case SOUND_MIXER_INFO:
 	{
 		mixer_info info;
@@ -660,7 +666,7 @@ static int mixer_ioctl(struct inode *inode, struct file *file,
                 strlcpy(info.id,   "TV audio", sizeof(info.id));
                 strlcpy(info.name, dev->name,  sizeof(info.name));
                 info.modify_counter = dev->oss.count;
-                if (copy_to_user((void *)arg, &info, sizeof(info)))
+                if (copy_to_user(argp, &info, sizeof(info)))
                         return -EFAULT;
 		return 0;
 	}
@@ -670,23 +676,23 @@ static int mixer_ioctl(struct inode *inode, struct file *file,
 		memset(&info,0,sizeof(info));
                 strlcpy(info.id,   "TV audio", sizeof(info.id));
                 strlcpy(info.name, dev->name,  sizeof(info.name));
-                if (copy_to_user((void *)arg, &info, sizeof(info)))
+                if (copy_to_user(argp, &info, sizeof(info)))
                         return -EFAULT;
 		return 0;
 	}
 	case MIXER_READ(SOUND_MIXER_CAPS):
-		return put_user(SOUND_CAP_EXCL_INPUT,(int*)arg);
+		return put_user(SOUND_CAP_EXCL_INPUT, p);
 	case MIXER_READ(SOUND_MIXER_STEREODEVS):
-		return put_user(0,(int*)arg);
+		return put_user(0, p);
 	case MIXER_READ(SOUND_MIXER_RECMASK):
 	case MIXER_READ(SOUND_MIXER_DEVMASK):
 		val = SOUND_MASK_LINE1 | SOUND_MASK_LINE2;
 		if (32000 == dev->oss.rate)
 			val |= SOUND_MASK_VIDEO;
-		return put_user(val,(int*)arg);
+		return put_user(val, p);
 
 	case MIXER_WRITE(SOUND_MIXER_RECSRC):
-		if (get_user(val, (int *)arg))
+		if (get_user(val, p))
 			return -EFAULT;
 		input = dev->oss.input;
 		if (32000 == dev->oss.rate  &&
@@ -706,16 +712,16 @@ static int mixer_ioctl(struct inode *inode, struct file *file,
 		case LINE2: ret = SOUND_MASK_LINE2; break;
 		default:    ret = 0;
 		}
-		return put_user(ret,(int*)arg);
+		return put_user(ret, p);
 
 	case MIXER_WRITE(SOUND_MIXER_VIDEO):
 	case MIXER_READ(SOUND_MIXER_VIDEO):
 		if (32000 != dev->oss.rate)
 			return -EINVAL;
-		return put_user(100 | 100 << 8,(int*)arg);
+		return put_user(100 | 100 << 8, p);
 
 	case MIXER_WRITE(SOUND_MIXER_LINE1):
-		if (get_user(val, (int *)arg))
+		if (get_user(val, p))
 			return -EFAULT;
 		val &= 0xff;
 		val = (val <= 50) ? 50 : 100;
@@ -723,11 +729,10 @@ static int mixer_ioctl(struct inode *inode, struct file *file,
 		mixer_level(dev,LINE1,dev->oss.line1);
 		/* fall throuth */
 	case MIXER_READ(SOUND_MIXER_LINE1):
-		return put_user(dev->oss.line1 | dev->oss.line1 << 8,
-				(int*)arg);
+		return put_user(dev->oss.line1 | dev->oss.line1 << 8, p);
 
 	case MIXER_WRITE(SOUND_MIXER_LINE2):
-		if (get_user(val, (int *)arg))
+		if (get_user(val, p))
 			return -EFAULT;
 		val &= 0xff;
 		val = (val <= 50) ? 50 : 100;
@@ -735,8 +740,7 @@ static int mixer_ioctl(struct inode *inode, struct file *file,
 		mixer_level(dev,LINE2,dev->oss.line2);
 		/* fall throuth */
 	case MIXER_READ(SOUND_MIXER_LINE2):
-		return put_user(dev->oss.line2 | dev->oss.line2 << 8,
-				(int*)arg);
+		return put_user(dev->oss.line2 | dev->oss.line2 << 8, p);
 
 	default:
 		return -EINVAL;
diff --git a/drivers/media/video/saa7134/saa7134-ts.c b/drivers/media/video/saa7134/saa7134-ts.c
index a14bf622d..f969b2747 100644
--- a/drivers/media/video/saa7134/saa7134-ts.c
+++ b/drivers/media/video/saa7134/saa7134-ts.c
@@ -33,6 +33,8 @@
 
 /* ------------------------------------------------------------------ */
 
+#define TS_PACKET_SIZE 188 /* TS packets 188 bytes */
+
 static unsigned int ts_debug  = 0;
 MODULE_PARM(ts_debug,"i");
 MODULE_PARM_DESC(ts_debug,"enable debug messages [ts]");
@@ -41,8 +43,9 @@ static unsigned int tsbufs = 4;
 MODULE_PARM(tsbufs,"i");
 MODULE_PARM_DESC(tsbufs,"number of ts buffers, range 2-32");
 
-#define TS_PACKET_SIZE 188 /* TS packets 188 bytes */
-#define TS_NR_PACKETS 312
+static unsigned int ts_nr_packets = 30;
+MODULE_PARM(ts_nr_packets,"i");
+MODULE_PARM_DESC(ts_nr_packets,"size of a ts buffers (in ts packets)");
 
 #define dprintk(fmt, arg...)	if (ts_debug) \
 	printk(KERN_DEBUG "%s/ts: " fmt, dev->name , ## arg)
@@ -96,7 +99,7 @@ static int buffer_prepare(struct file *file, struct videobuf_buffer *vb,
 	dprintk("buffer_prepare [%p,%s]\n",buf,v4l2_field_names[field]);
 
 	llength = TS_PACKET_SIZE;
-	lines = TS_NR_PACKETS;
+	lines = ts_nr_packets;
 	
 	size = lines * llength;
 	if (0 != buf->vb.baddr  &&  buf->vb.bsize < size)
@@ -135,7 +138,7 @@ static int buffer_prepare(struct file *file, struct videobuf_buffer *vb,
 static int
 buffer_setup(struct file *file, unsigned int *count, unsigned int *size)
 {
-	*size = TS_PACKET_SIZE * TS_NR_PACKETS;
+	*size = TS_PACKET_SIZE * ts_nr_packets;
 	if (0 == *count)
 		*count = tsbufs;
 	*count = saa7134_buffer_count(*size,*count);
@@ -238,7 +241,7 @@ static int ts_release(struct inode *inode, struct file *file)
 }
 
 static ssize_t
-ts_read(struct file *file, char *data, size_t count, loff_t *ppos)
+ts_read(struct file *file, char __user *data, size_t count, loff_t *ppos)
 {
 	struct saa7134_dev *dev = file->private_data;
 
@@ -353,7 +356,7 @@ static int ts_do_ioctl(struct inode *inode, struct file *file,
 		f->fmt.pix.width        = 720; /* D1 */
 		f->fmt.pix.height       = 576;
 		f->fmt.pix.pixelformat  = V4L2_PIX_FMT_MPEG;
-		f->fmt.pix.sizeimage    = TS_PACKET_SIZE*TS_NR_PACKETS;
+		f->fmt.pix.sizeimage    = TS_PACKET_SIZE*ts_nr_packets;
 		return 0;
 	}
 	
@@ -379,7 +382,7 @@ static int ts_do_ioctl(struct inode *inode, struct file *file,
 		f->fmt.pix.width        = 720; /* D1 */
 		f->fmt.pix.height       = 576;
 		f->fmt.pix.pixelformat  = V4L2_PIX_FMT_MPEG;
-		f->fmt.pix.sizeimage    = TS_PACKET_SIZE*TS_NR_PACKETS;
+		f->fmt.pix.sizeimage    = TS_PACKET_SIZE*ts_nr_packets;
 		return 0;
 	}
 
@@ -408,7 +411,7 @@ static int ts_do_ioctl(struct inode *inode, struct file *file,
 
 	case MPEG_SETPARAMS:
 		return ts_init_encoder(dev, arg);
-	  
+
 	default:
 		return -ENOIOCTLCMD;
 	}
@@ -455,6 +458,10 @@ int saa7134_ts_init1(struct saa7134_dev *dev)
 		tsbufs = 2;
 	if (tsbufs > VIDEO_MAX_FRAME)
 		tsbufs = VIDEO_MAX_FRAME;
+	if (ts_nr_packets < 4)
+		ts_nr_packets = 4;
+	if (ts_nr_packets > 312)
+		ts_nr_packets = 312;
 
 	INIT_LIST_HEAD(&dev->ts_q.queue);
 	init_timer(&dev->ts_q.timeout);
@@ -472,9 +479,9 @@ int saa7134_ts_init1(struct saa7134_dev *dev)
 	saa_writeb(SAA7134_TS_SERIAL1, 0x00);  /* deactivate TS softreset */
 	saa_writeb(SAA7134_TS_PARALLEL, 0xec); /* TSSOP high active, TSVAL high active, TSLOCK ignored */
 	saa_writeb(SAA7134_TS_PARALLEL_SERIAL, (TS_PACKET_SIZE-1));
-	saa_writeb(SAA7134_TS_DMA0, ((TS_NR_PACKETS-1)&0xff));
-	saa_writeb(SAA7134_TS_DMA1, (((TS_NR_PACKETS-1)>>8)&0xff));
-	saa_writeb(SAA7134_TS_DMA2, ((((TS_NR_PACKETS-1)>>16)&0x3f) | 0x00)); /* TSNOPIT=0, TSCOLAP=0 */	 
+	saa_writeb(SAA7134_TS_DMA0, ((ts_nr_packets-1)&0xff));
+	saa_writeb(SAA7134_TS_DMA1, (((ts_nr_packets-1)>>8)&0xff));
+	saa_writeb(SAA7134_TS_DMA2, ((((ts_nr_packets-1)>>16)&0x3f) | 0x00)); /* TSNOPIT=0, TSCOLAP=0 */
  
 	return 0;
 }
diff --git a/drivers/media/video/saa7134/saa7134-tvaudio.c b/drivers/media/video/saa7134/saa7134-tvaudio.c
index a896cd83d..261d92040 100644
--- a/drivers/media/video/saa7134/saa7134-tvaudio.c
+++ b/drivers/media/video/saa7134/saa7134-tvaudio.c
@@ -37,10 +37,6 @@ static unsigned int audio_debug = 0;
 MODULE_PARM(audio_debug,"i");
 MODULE_PARM_DESC(audio_debug,"enable debug messages [tv audio]");
 
-static unsigned int audio_carrier = 0;
-MODULE_PARM(audio_carrier,"i");
-MODULE_PARM_DESC(audio_carrier,"audio carrier location");
-
 static unsigned int audio_ddep = 0;
 MODULE_PARM(audio_ddep,"i");
 MODULE_PARM_DESC(audio_ddep,"audio ddep overwrite");
@@ -67,6 +63,30 @@ MODULE_PARM_DESC(audio_clock_tweak, "Audio clock tick fine tuning for cards with
 /* ------------------------------------------------------------------ */
 /* saa7134 code                                                       */
 
+static struct mainscan {
+	char         *name;
+	v4l2_std_id  std;
+	int          carr;
+} mainscan[] = {
+	{
+		.name = "M",
+		.std  = V4L2_STD_NTSC | V4L2_STD_PAL_M,
+		.carr = 4500,
+	},{
+		.name = "BG",
+		.std  = V4L2_STD_PAL_BG,
+		.carr = 5500,
+	},{
+		.name = "I",
+		.std  = V4L2_STD_PAL_I,
+		.carr = 6000,
+	},{
+		.name = "DKL",
+		.std  = V4L2_STD_PAL_DK | V4L2_STD_SECAM,
+		.carr = 6500,
+	}
+};
+
 static struct saa7134_tvaudio tvaudio[] = {
 	{
 		.name          = "PAL-B/G FM-stereo",
@@ -314,15 +334,15 @@ static int tvaudio_sleep(struct saa7134_dev *dev, int timeout)
 	return dev->thread.scan1 != dev->thread.scan2;
 }
 
-static int tvaudio_checkcarrier(struct saa7134_dev *dev, int carrier)
+static int tvaudio_checkcarrier(struct saa7134_dev *dev, struct mainscan *scan)
 {
 	__s32 left,right,value;
 
 	if (audio_debug > 1) {
 		int i;
-		dprintk("debug %d:",carrier);
+		dprintk("debug %d:",scan->carr);
 		for (i = -150; i <= 150; i += 30) {
-			tvaudio_setcarrier(dev,carrier+i,carrier+i);
+			tvaudio_setcarrier(dev,scan->carr+i,scan->carr+i);
 			saa_readl(SAA7134_LEVEL_READOUT1 >> 2);
 			if (tvaudio_sleep(dev,SCAN_SAMPLE_DELAY))
 				return -1;
@@ -334,24 +354,31 @@ static int tvaudio_checkcarrier(struct saa7134_dev *dev, int carrier)
 		}
 		printk("\n");
 	}
-	
-	tvaudio_setcarrier(dev,carrier-90,carrier-90);
-	saa_readl(SAA7134_LEVEL_READOUT1 >> 2);
-	if (tvaudio_sleep(dev,SCAN_SAMPLE_DELAY))
-		return -1;
-	left = saa_readl(SAA7134_LEVEL_READOUT1 >> 2);
-
-	tvaudio_setcarrier(dev,carrier+90,carrier+90);
-	saa_readl(SAA7134_LEVEL_READOUT1 >> 2);
-	if (tvaudio_sleep(dev,SCAN_SAMPLE_DELAY))
-		return -1;
-	right = saa_readl(SAA7134_LEVEL_READOUT1 >> 2);
-
-	left >>= 16;
-        right >>= 16;
-	value = left > right ? left - right : right - left;
-	dprintk("scanning %d.%03d MHz =>  dc is %5d [%d/%d]\n",
-		carrier/1000,carrier%1000,value,left,right);
+
+	if (dev->tvnorm->id & scan->std) {
+		tvaudio_setcarrier(dev,scan->carr-90,scan->carr-90);
+		saa_readl(SAA7134_LEVEL_READOUT1 >> 2);
+		if (tvaudio_sleep(dev,SCAN_SAMPLE_DELAY))
+			return -1;
+		left = saa_readl(SAA7134_LEVEL_READOUT1 >> 2);
+
+		tvaudio_setcarrier(dev,scan->carr+90,scan->carr+90);
+		saa_readl(SAA7134_LEVEL_READOUT1 >> 2);
+		if (tvaudio_sleep(dev,SCAN_SAMPLE_DELAY))
+			return -1;
+		right = saa_readl(SAA7134_LEVEL_READOUT1 >> 2);
+
+		left >>= 16;
+		right >>= 16;
+		value = left > right ? left - right : right - left;
+		dprintk("scanning %d.%03d MHz [%4s] =>  dc is %5d [%d/%d]\n",
+			scan->carr / 1000, scan->carr % 1000,
+			scan->name, value, left, right);
+	} else {
+		value = 0;
+		dprintk("skipping %d.%03d MHz [%4s]\n",
+			scan->carr / 1000, scan->carr % 1000, scan->name);
+	}
 	return value;
 }
 
@@ -384,6 +411,7 @@ static int tvaudio_getstereo(struct saa7134_dev *dev, struct saa7134_tvaudio *au
 	case TVAUDIO_FM_K_STEREO:
 	case TVAUDIO_FM_BG_STEREO:
 		idp = (saa_readb(SAA7134_IDENT_SIF) & 0xe0) >> 5;
+		dprintk("getstereo: fm/stereo: idp=0x%x\n",idp);
 		if (0x03 == (idp & 0x03))
 			retval = V4L2_TUNER_SUB_LANG1 | V4L2_TUNER_SUB_LANG2;
 		else if (0x05 == (idp & 0x05))
@@ -397,6 +425,7 @@ static int tvaudio_getstereo(struct saa7134_dev *dev, struct saa7134_tvaudio *au
 	case TVAUDIO_NICAM_FM:
 	case TVAUDIO_NICAM_AM:
 		nicam = saa_readb(SAA7134_NICAM_STATUS);
+		dprintk("getstereo: nicam=0x%x\n",nicam);
 		switch (nicam & 0x0b) {
 		case 0x08:
 			retval = V4L2_TUNER_SUB_MONO;
@@ -458,16 +487,10 @@ static int tvaudio_setstereo(struct saa7134_dev *dev, struct saa7134_tvaudio *au
 
 static int tvaudio_thread(void *data)
 {
-#define MAX_SCAN 4
-	static const int carr_pal[MAX_SCAN]     = { 5500, 6000, 6500 };
-	static const int carr_ntsc[MAX_SCAN]    = { 4500 };
-	static const int carr_secam[MAX_SCAN]   = { 6500 };
-	static const int carr_default[MAX_SCAN] = { 4500, 5500, 6000, 6500 };
 	struct saa7134_dev *dev = data;
-	const int *carr_scan;
-	int carr_vals[4];
-	unsigned int i, audio;
-	int max1,max2,carrier,rx,mode,lastmode;
+	int carr_vals[ARRAY_SIZE(mainscan)];
+	unsigned int i, audio, nscan;
+	int max1,max2,carrier,rx,mode,lastmode,default_carrier;
 
 	daemonize("%s", dev->name);
 	allow_signal(SIGTERM);
@@ -488,32 +511,40 @@ static int tvaudio_thread(void *data)
 		if (tvaudio_sleep(dev,SCAN_INITIAL_DELAY))
 			goto restart;
 
-		/* find the main carrier */
-		carr_scan = carr_default;
-		if (dev->tvnorm->id & V4L2_STD_PAL)
-			carr_scan = carr_pal;
-		if (dev->tvnorm->id & V4L2_STD_NTSC)
-			carr_scan = carr_ntsc;
-		if (dev->tvnorm->id & V4L2_STD_SECAM)
-			carr_scan = carr_secam;
-		saa_writeb(SAA7134_MONITOR_SELECT,0x00);
-		tvaudio_setmode(dev,&tvaudio[0],NULL);
-		for (i = 0; i < MAX_SCAN; i++) {
-			if (!carr_scan[i])
+		max1 = 0;
+		max2 = 0;
+		nscan = 0;
+		carrier = 0;
+		default_carrier = 0;
+		for (i = 0; i < ARRAY_SIZE(mainscan); i++) {
+			if (!(dev->tvnorm->id & mainscan[i].std))
 				continue;
-			carr_vals[i] = tvaudio_checkcarrier(dev,carr_scan[i]);
-			if (dev->thread.scan1 != dev->thread.scan2)
-				goto restart;
+			if (!default_carrier)
+				default_carrier = mainscan[i].carr;
+			nscan++;
 		}
-		for (carrier = 0, max1 = 0, max2 = 0, i = 0; i < MAX_SCAN; i++) {
-			if (!carr_scan[i])
-				continue;
-			if (max1 < carr_vals[i]) {
-				max2 = max1;
-				max1 = carr_vals[i];
-				carrier = carr_scan[i];
-			} else if (max2 < carr_vals[i]) {
-				max2 = carr_vals[i];
+
+		if (1 == nscan) {
+			/* only one candidate -- skip scan ;) */
+			max1 = 12345;
+			carrier = default_carrier;
+		} else {
+			/* scan for the main carrier */
+			saa_writeb(SAA7134_MONITOR_SELECT,0x00);
+			tvaudio_setmode(dev,&tvaudio[0],NULL);
+			for (i = 0; i < ARRAY_SIZE(mainscan); i++) {
+				carr_vals[i] = tvaudio_checkcarrier(dev, mainscan+i);
+				if (dev->thread.scan1 != dev->thread.scan2)
+					goto restart;
+			}
+			for (max1 = 0, max2 = 0, i = 0; i < ARRAY_SIZE(mainscan); i++) {
+				if (max1 < carr_vals[i]) {
+					max2 = max1;
+					max1 = carr_vals[i];
+					carrier = mainscan[i].carr;
+				} else if (max2 < carr_vals[i]) {
+					max2 = carr_vals[i];
+				}
 			}
 		}
 
@@ -523,21 +554,17 @@ static int tvaudio_thread(void *data)
 				dev->tvnorm->name, carrier/1000, carrier%1000,
 				max1, max2);
 			dev->last_carrier = carrier;
-		} else if (0 != audio_carrier) {
-			/* no carrier -- try insmod option as fallback */
-			carrier = audio_carrier;
-			printk(KERN_WARNING "%s/audio: audio carrier scan failed, "
-			       "using %d.%03d MHz [insmod option]\n",
-			       dev->name, carrier/1000, carrier%1000);
+
 		} else if (0 != dev->last_carrier) {
 			/* no carrier -- try last detected one as fallback */
 			carrier = dev->last_carrier;
 			printk(KERN_WARNING "%s/audio: audio carrier scan failed, "
 			       "using %d.%03d MHz [last detected]\n",
 			       dev->name, carrier/1000, carrier%1000);
+
 		} else {
-			/* no carrier + no fallback -- try first in list */
-			carrier = carr_scan[0];
+			/* no carrier + no fallback -- use default */
+			carrier = default_carrier;
 			printk(KERN_WARNING "%s/audio: audio carrier scan failed, "
 			       "using %d.%03d MHz [default]\n",
 			       dev->name, carrier/1000, carrier%1000);
@@ -550,7 +577,7 @@ static int tvaudio_thread(void *data)
 		/* find the exact tv audio norm */
 		for (audio = UNSET, i = 0; i < TVAUDIO; i++) {
 			if (dev->tvnorm->id != UNSET &&
-			    dev->tvnorm->id != tvaudio[i].std)
+			    !(dev->tvnorm->id & tvaudio[i].std))
 				continue;
 			if (tvaudio[i].carr1 != carrier)
 				continue;
@@ -722,11 +749,16 @@ static int mute_input_7133(struct saa7134_dev *dev)
 static int tvaudio_thread_ddep(void *data)
 {
 	struct saa7134_dev *dev = data;
-	u32 value, norms;
+	u32 value, norms, clock;
 
 	daemonize("%s", dev->name);
 	allow_signal(SIGTERM);
 
+	clock = saa7134_boards[dev->board].audio_clock;
+	if (UNSET != audio_clock_override)
+		clock = audio_clock_override;
+	saa_writel(0x598 >> 2, clock);
+
 	/* unmute */
 	saa_dsp_writel(dev, 0x474 >> 2, 0x00);
 	saa_dsp_writel(dev, 0x450 >> 2, 0x00);
@@ -769,9 +801,11 @@ static int tvaudio_thread_ddep(void *data)
 				(norms & 0x40) ? " M"    : "");
 		}
 
-		/* quick & dirty -- to be fixed up later ... */
+		/* kick automatic standard detection */
 		saa_dsp_writel(dev, 0x454 >> 2, 0);
 		saa_dsp_writel(dev, 0x454 >> 2, norms | 0x80);
+
+		/* setup crossbars */
 		saa_dsp_writel(dev, 0x464 >> 2, 0x000000);
 		saa_dsp_writel(dev, 0x470 >> 2, 0x101010);
 
diff --git a/drivers/media/video/saa7134/saa7134-video.c b/drivers/media/video/saa7134/saa7134-video.c
index 4b70156a6..ec4c286df 100644
--- a/drivers/media/video/saa7134/saa7134-video.c
+++ b/drivers/media/video/saa7134/saa7134-video.c
@@ -28,13 +28,15 @@
 #include "saa7134-reg.h"
 #include "saa7134.h"
 
+#define V4L2_I2C_CLIENTS 1
+
 /* ------------------------------------------------------------------ */
 
 static unsigned int video_debug   = 0;
 static unsigned int gbuffers      = 8;
 static unsigned int noninterlaced = 0;
-static unsigned int gbufsize      = 768*576*4;
-static unsigned int gbufsize_max  = 768*576*4;
+static unsigned int gbufsize      = 720*576*4;
+static unsigned int gbufsize_max  = 720*576*4;
 MODULE_PARM(video_debug,"i");
 MODULE_PARM_DESC(video_debug,"enable debug messages [video]");
 MODULE_PARM(gbuffers,"i");
@@ -148,10 +150,65 @@ static struct saa7134_format formats[] = {
 };
 #define FORMATS ARRAY_SIZE(formats)
 
+#define NORM_625_50			\
+		.h_start       = 0,	\
+		.h_stop        = 719,	\
+		.video_v_start = 24,	\
+		.video_v_stop  = 311,	\
+		.vbi_v_start   = 7,	\
+		.vbi_v_stop    = 22,	\
+		.src_timing    = 4
+
+#define NORM_525_60			\
+		.h_start       = 0,	\
+		.h_stop        = 703,	\
+		.video_v_start = 22,	\
+		.video_v_stop  = 22+239, \
+		.vbi_v_start   = 10, /* FIXME */ \
+		.vbi_v_stop    = 21, /* FIXME */ \
+		.src_timing    = 1
+
 static struct saa7134_tvnorm tvnorms[] = {
 	{
-		.name          = "PAL",
+		.name          = "PAL", /* autodetect */
 		.id            = V4L2_STD_PAL,
+		NORM_625_50,
+
+		.sync_control  = 0x18,
+		.luma_control  = 0x40,
+		.chroma_ctrl1  = 0x81,
+		.chroma_gain   = 0x2a,
+		.chroma_ctrl2  = 0x06,
+		.vgate_misc    = 0x1c,
+
+	},{
+		.name          = "PAL-BG",
+		.id            = V4L2_STD_PAL_BG,
+		NORM_625_50,
+
+		.sync_control  = 0x18,
+		.luma_control  = 0x40,
+		.chroma_ctrl1  = 0x81,
+		.chroma_gain   = 0x2a,
+		.chroma_ctrl2  = 0x06,
+		.vgate_misc    = 0x1c,
+
+	},{
+		.name          = "PAL-I",
+		.id            = V4L2_STD_PAL_I,
+		NORM_625_50,
+
+		.sync_control  = 0x18,
+		.luma_control  = 0x40,
+		.chroma_ctrl1  = 0x81,
+		.chroma_gain   = 0x2a,
+		.chroma_ctrl2  = 0x06,
+		.vgate_misc    = 0x1c,
+
+	},{
+		.name          = "PAL-DK",
+		.id            = V4L2_STD_PAL_DK,
+		NORM_625_50,
 
 		.sync_control  = 0x18,
 		.luma_control  = 0x40,
@@ -160,16 +217,10 @@ static struct saa7134_tvnorm tvnorms[] = {
 		.chroma_ctrl2  = 0x06,
 		.vgate_misc    = 0x1c,
 
-		.h_start       = 0,
-		.h_stop        = 719,
-		.video_v_start = 24,
-		.video_v_stop  = 311,
-		.vbi_v_start   = 7,
-		.vbi_v_stop    = 22,
-		.src_timing    = 4,
 	},{
 		.name          = "NTSC",
 		.id            = V4L2_STD_NTSC,
+		NORM_525_60,
 
 		.sync_control  = 0x59,
 		.luma_control  = 0x40,
@@ -178,16 +229,10 @@ static struct saa7134_tvnorm tvnorms[] = {
 		.chroma_ctrl2  = 0x0e,
 		.vgate_misc    = 0x18,
 
-		.h_start       = 0,
-		.h_stop        = 719,
-		.video_v_start = 22,
-		.video_v_stop  = 22+240,
-		.vbi_v_start   = 10, /* FIXME */
-		.vbi_v_stop    = 21, /* FIXME */
-		.src_timing    = 1,
 	},{
 		.name          = "SECAM",
 		.id            = V4L2_STD_SECAM,
+		NORM_625_50,
 
 		.sync_control  = 0x18, /* old: 0x58, */
 		.luma_control  = 0x1b,
@@ -196,16 +241,10 @@ static struct saa7134_tvnorm tvnorms[] = {
 		.chroma_ctrl2  = 0x00,
 		.vgate_misc    = 0x1c,
 
-		.h_start       = 0,
-		.h_stop        = 719,
-		.video_v_start = 24,
-		.video_v_stop  = 311,
-		.vbi_v_start   = 7,
-		.vbi_v_stop    = 22,
-		.src_timing    = 4,
 	},{
 		.name          = "PAL-M",
 		.id            = V4L2_STD_PAL_M,
+		NORM_525_60,
 
 		.sync_control  = 0x59,
 		.luma_control  = 0x40,
@@ -214,16 +253,10 @@ static struct saa7134_tvnorm tvnorms[] = {
 		.chroma_ctrl2  = 0x0e,
 		.vgate_misc    = 0x18,
 
-		.h_start       = 0,
-		.h_stop        = 719,
-		.video_v_start = 22,
-		.video_v_stop  = 22+240,
-		.vbi_v_start   = 10, /* FIXME */
-		.vbi_v_stop    = 21, /* FIXME */
-		.src_timing    = 1,
 	},{
 		.name          = "PAL-Nc",
 		.id            = V4L2_STD_PAL_Nc,
+		NORM_625_50,
 
 		.sync_control  = 0x18,
 		.luma_control  = 0x40,
@@ -232,35 +265,6 @@ static struct saa7134_tvnorm tvnorms[] = {
 		.chroma_ctrl2  = 0x06,
 		.vgate_misc    = 0x1c,
 
-		.h_start       = 0,
-		.h_stop        = 719,
-		.video_v_start = 24,
-		.video_v_stop  = 311,
-		.vbi_v_start   = 7,
-		.vbi_v_stop    = 22,
-		.src_timing    = 4,
-#if 0
-	},{
-		.name          = "AUTO",
-		.id            = V4L2_STD_PAL|V4L2_STD_NTSC|V4L2_STD_SECAM,
-		.width         = 768,
-		.height        = 576,
-
-		.sync_control  = 0x98,
-		.luma_control  = 0x40,
-		.chroma_ctrl1  = 0x8b,
-		.chroma_gain   = 0x00,
-		.chroma_ctrl2  = 0x00,
-		.vgate_misc    = 0x18,
-
-		.h_start       = 0,
-		.h_stop        = 719,
-		.video_v_start = 24,
-		.video_v_stop  = 311,
-		.vbi_v_start   = 7,
-		.vbi_v_stop    = 22,
-		.src_timing    = 4,
-#endif
 	}
 };
 #define TVNORMS ARRAY_SIZE(tvnorms)
@@ -429,7 +433,6 @@ void res_free(struct saa7134_dev *dev, struct saa7134_fh *fh, unsigned int bits)
 
 static void set_tvnorm(struct saa7134_dev *dev, struct saa7134_tvnorm *norm)
 {
-	struct video_channel c;
 	int luma_control,sync_control,mux;
 
 	dprintk("set tv norm = %s\n",norm->name);
@@ -489,15 +492,22 @@ static void set_tvnorm(struct saa7134_dev *dev, struct saa7134_tvnorm *norm)
 	saa_writeb(SAA7134_RAW_DATA_GAIN,         0x40);
 	saa_writeb(SAA7134_RAW_DATA_OFFSET,       0x80);
 
-	/* pass down info to the i2c chips (v4l1) */
-	memset(&c,0,sizeof(c));
-	c.channel = dev->ctl_input;
-	c.norm = VIDEO_MODE_PAL;
-	if (norm->id & V4L2_STD_NTSC)
-		c.norm = VIDEO_MODE_NTSC;
-	if (norm->id & V4L2_STD_SECAM)
-		c.norm = VIDEO_MODE_SECAM;
-	saa7134_i2c_call_clients(dev,VIDIOCSCHAN,&c);
+#ifdef V4L2_I2C_CLIENTS
+	saa7134_i2c_call_clients(dev,VIDIOC_S_STD,&norm->id);
+#else
+	{
+		/* pass down info to the i2c chips (v4l1) */
+		struct video_channel c;
+		memset(&c,0,sizeof(c));
+		c.channel = dev->ctl_input;
+		c.norm = VIDEO_MODE_PAL;
+		if (norm->id & V4L2_STD_NTSC)
+			c.norm = VIDEO_MODE_NTSC;
+		if (norm->id & V4L2_STD_SECAM)
+			c.norm = VIDEO_MODE_SECAM;
+		saa7134_i2c_call_clients(dev,VIDIOCSCHAN,&c);
+	}
+#endif
 }
 
 static void video_mux(struct saa7134_dev *dev, int input)
@@ -593,11 +603,11 @@ static void set_size(struct saa7134_dev *dev, int task,
 	saa_writeb(SAA7134_VIDEO_V_STOP1(task),  v_stop  &  0xff);
 	saa_writeb(SAA7134_VIDEO_V_STOP2(task),  v_stop  >> 8);
 
-	prescale = dev->crop_defrect.width / width;
+	prescale = dev->crop_current.width / width;
 	if (0 == prescale)
 		prescale = 1;
-	xscale = 1024 * dev->crop_defrect.width / prescale / width;
-	yscale = 512 * div * dev->crop_defrect.height / height;
+	xscale = 1024 * dev->crop_current.width / prescale / width;
+	yscale = 512 * div * dev->crop_current.height / height;
        	dprintk("prescale=%d xscale=%d yscale=%d\n",prescale,xscale,yscale);
 	set_h_prescale(dev,task,prescale);
 	saa_writeb(SAA7134_H_SCALE_INC1(task),      xscale &  0xff);
@@ -909,10 +919,12 @@ static int buffer_prepare(struct file *file, struct videobuf_buffer *vb,
 	/* sanity checks */
 	if (NULL == fh->fmt)
 		return -EINVAL;
-	if (fh->width  < 48 ||
-	    fh->height < 32 ||
-	    fh->width  > dev->crop_current.width ||
-	    fh->height > dev->crop_current.height)
+	if (fh->width    < 48 ||
+	    fh->height   < 32 ||
+	    fh->width/4  > dev->crop_current.width  ||
+	    fh->height/4 > dev->crop_current.height ||
+	    fh->width    > dev->crop_bounds.width  ||
+	    fh->height   > dev->crop_bounds.height)
 		return -EINVAL;
 	size = (fh->width * fh->height * fh->fmt->depth) >> 3;
 	if (0 != buf->vb.baddr  &&  buf->vb.bsize < size)
@@ -1192,7 +1204,7 @@ static int video_open(struct inode *inode, struct file *file)
 	fh->radio    = radio;
 	fh->type     = type;
 	fh->fmt      = format_by_fourcc(V4L2_PIX_FMT_BGR24);
-	fh->width    = 768;
+	fh->width    = 720;
 	fh->height   = 576;
 #ifdef VIDIOC_G_PRIORITY
 	v4l2_prio_open(&dev->prio,&fh->prio);
@@ -1226,7 +1238,7 @@ static int video_open(struct inode *inode, struct file *file)
 }
 
 static ssize_t
-video_read(struct file *file, char *data, size_t count, loff_t *ppos)
+video_read(struct file *file, char __user *data, size_t count, loff_t *ppos)
 {
 	struct saa7134_fh *fh = file->private_data;
 
@@ -1409,8 +1421,8 @@ int saa7134_try_fmt(struct saa7134_dev *dev, struct saa7134_fh *fh,
 			return -EINVAL;
 
 		field = f->fmt.pix.field;
-		maxw  = dev->crop_current.width;
-		maxh  = dev->crop_current.height;
+		maxw  = min(dev->crop_current.width*4,  dev->crop_bounds.width);
+		maxh  = min(dev->crop_current.height*4, dev->crop_bounds.height);
 		
 		if (V4L2_FIELD_ANY == field) {
 			field = (f->fmt.pix.height > maxh/2)
@@ -1670,9 +1682,13 @@ static int video_do_ioctl(struct inode *inode, struct file *file,
 		v4l2_std_id *id = arg;
 		unsigned int i;
 
-		for(i = 0; i < TVNORMS; i++)
-			if (*id & tvnorms[i].id)
+		for (i = 0; i < TVNORMS; i++)
+			if (*id == tvnorms[i].id)
 				break;
+		if (i == TVNORMS)
+			for (i = 0; i < TVNORMS; i++)
+				if (*id & tvnorms[i].id)
+					break;
 		if (i == TVNORMS)
 			return -EINVAL;
 
@@ -1685,6 +1701,7 @@ static int video_do_ioctl(struct inode *inode, struct file *file,
 			spin_unlock_irqrestore(&dev->slock,flags);
 		} else 
 			set_tvnorm(dev,&tvnorms[i]);
+		saa7134_tvaudio_do_scan(dev);
 		up(&dev->lock);
 		return 0;
 	}
@@ -1817,7 +1834,11 @@ static int video_do_ioctl(struct inode *inode, struct file *file,
 			return -EINVAL;
 		down(&dev->lock);
 		dev->ctl_freq = f->frequency;
+#ifdef V4L2_I2C_CLIENTS
+		saa7134_i2c_call_clients(dev,VIDIOC_S_FREQUENCY,f);
+#else
 		saa7134_i2c_call_clients(dev,VIDIOCSFREQ,&dev->ctl_freq);
+#endif
 		saa7134_tvaudio_do_scan(dev);
 		up(&dev->lock);
 		return 0;
@@ -2064,7 +2085,6 @@ static int radio_do_ioctl(struct inode *inode, struct file *file,
 	case VIDIOC_G_TUNER:
 	{
 		struct v4l2_tuner *t = arg;
-		struct video_tuner vt;
 
 		if (0 != t->index)
 			return -EINVAL;
@@ -2073,10 +2093,17 @@ static int radio_do_ioctl(struct inode *inode, struct file *file,
 		strcpy(t->name, "Radio");
                 t->rangelow  = (int)(65*16);
                 t->rangehigh = (int)(108*16);
-		
-		memset(&vt,0,sizeof(vt));
-		saa7134_i2c_call_clients(dev,VIDIOCGTUNER,&vt);
-		t->signal = vt.signal;
+
+#ifdef V4L2_I2C_CLIENTS
+		saa7134_i2c_call_clients(dev,VIDIOC_G_TUNER,t);
+#else
+		{
+			struct video_tuner vt;
+			memset(&vt,0,sizeof(vt));
+			saa7134_i2c_call_clients(dev,VIDIOCGTUNER,&vt);
+			t->signal = vt.signal;
+		}
+#endif
 		return 0;
 	}
 	case VIDIOC_ENUMINPUT:
diff --git a/drivers/media/video/saa7134/saa7134.h b/drivers/media/video/saa7134/saa7134.h
index 2eccffc67..f4d346949 100644
--- a/drivers/media/video/saa7134/saa7134.h
+++ b/drivers/media/video/saa7134/saa7134.h
@@ -19,7 +19,7 @@
  */
 
 #include <linux/version.h>
-#define SAA7134_VERSION_CODE KERNEL_VERSION(0,2,11)
+#define SAA7134_VERSION_CODE KERNEL_VERSION(0,2,12)
 
 #include <linux/pci.h>
 #include <linux/i2c.h>
@@ -152,6 +152,10 @@ struct saa7134_format {
 #define SAA7134_BOARD_ECS_TVP3XP_4CB5  31
 #define SAA7134_BOARD_AVACSSMARTTV     32
 #define SAA7134_BOARD_AVERMEDIA_DVD_EZMAKER 33
+#define SAA7134_BOARD_NOVAC_PRIMETV7133 34
+#define SAA7134_BOARD_AVERMEDIA_305    35
+#define SAA7133_BOARD_UPMOST_PURPLE_TV 36
+#define SAA7134_BOARD_ITEMS_MTV005     37
 
 #define SAA7134_INPUT_MAX 8
 
diff --git a/drivers/media/video/stradis.c b/drivers/media/video/stradis.c
index 10e4c56bf..37545acdb 100644
--- a/drivers/media/video/stradis.c
+++ b/drivers/media/video/stradis.c
@@ -1322,7 +1322,7 @@ static int saa_ioctl(struct inode *inode, struct file *file,
 		     unsigned int cmd, unsigned long argl)
 {
 	struct saa7146 *saa = file->private_data;
-	void *arg = (void *)argl;
+	void __user *arg = (void __user *)argl;
 
 	switch (cmd) {
 	case VIDIOCGCAP:
@@ -1580,7 +1580,7 @@ static int saa_ioctl(struct inode *inode, struct file *file,
 			vu.radio = VIDEO_NO_UNIT;
 			vu.audio = VIDEO_NO_UNIT;
 			vu.teletext = VIDEO_NO_UNIT;
-			if (copy_to_user((void *) arg, (void *) &vu, sizeof(vu)))
+			if (copy_to_user(arg, &vu, sizeof(vu)))
 				return -EFAULT;
 			return 0;
 		}
@@ -1754,16 +1754,14 @@ static int saa_ioctl(struct inode *inode, struct file *file,
 			struct video_code ucode;
 			__u8 *udata;
 			int i;
-			if (copy_from_user((void *) &ucode, arg,
-			    sizeof(ucode)))
+			if (copy_from_user(&ucode, arg, sizeof(ucode)))
 				return -EFAULT;
 			if (ucode.datasize > 65536 || ucode.datasize < 1024 ||
 			    strncmp(ucode.loadwhat, "dec", 3))
 				return -EINVAL;
 			if ((udata = vmalloc(ucode.datasize)) == NULL)
 				return -ENOMEM;
-			if (copy_from_user((void *) udata, ucode.data,
-			    ucode.datasize)) {
+			if (copy_from_user(udata, ucode.data, ucode.datasize)) {
 				vfree(udata);
 				return -EFAULT;
 			}
@@ -1814,13 +1812,13 @@ static int saa_mmap(struct file *file, struct vm_area_struct *vma)
 	return -EINVAL;
 }
 
-static ssize_t saa_read(struct file *file, char *buf,
+static ssize_t saa_read(struct file *file, char __user *buf,
 			size_t count, loff_t *ppos)
 {
 	return -EINVAL;
 }
 
-static ssize_t saa_write(struct file *file, const char *buf,
+static ssize_t saa_write(struct file *file, const char __user *buf,
 			 size_t count, loff_t *ppos)
 {
 	struct saa7146 *saa = file->private_data;
diff --git a/drivers/media/video/tda9840.c b/drivers/media/video/tda9840.c
index d1e74ecf2..fd8ac116c 100644
--- a/drivers/media/video/tda9840.c
+++ b/drivers/media/video/tda9840.c
@@ -268,13 +268,12 @@ static struct i2c_driver driver = {
         .command	= tda9840_command,
 };
 
-static int tda9840_init_module(void)
+static int __init tda9840_init_module(void)
 {
-        i2c_add_driver(&driver);
-        return 0;
+        return i2c_add_driver(&driver);
 }
 
-static void tda9840_cleanup_module(void)
+static void __exit tda9840_cleanup_module(void)
 {
         i2c_del_driver(&driver);
 }
@@ -285,4 +284,3 @@ module_exit(tda9840_cleanup_module);
 MODULE_AUTHOR("Michael Hunold <michael@mihu.de>");
 MODULE_DESCRIPTION("tda9840 driver");
 MODULE_LICENSE("GPL");
-
diff --git a/drivers/media/video/tda9887.c b/drivers/media/video/tda9887.c
index ddc380e1a..9768829bd 100644
--- a/drivers/media/video/tda9887.c
+++ b/drivers/media/video/tda9887.c
@@ -21,7 +21,7 @@
       Note: OP2 of tda988x must be set to 1, else MT2032 is disabled!
    - KNC One TV-Station RDS (saa7134)
 */
-    
+
 
 /* Addresses to scan */
 static unsigned short normal_i2c[] = {
@@ -33,22 +33,30 @@ static unsigned short normal_i2c_range[] = {I2C_CLIENT_END,I2C_CLIENT_END};
 I2C_CLIENT_INSMOD;
 
 /* insmod options */
-static int debug =  0;
-static char *pal =  "b";
-static char *secam =  "l";
+static unsigned int debug = 0;
 MODULE_PARM(debug,"i");
-MODULE_PARM(pal,"s");
-MODULE_PARM(secam,"s");
 MODULE_LICENSE("GPL");
 
 /* ---------------------------------------------------------------------- */
 
+#define UNSET       (-1U)
+#define PREFIX      "tda9885/6/7: "
 #define dprintk     if (debug) printk
 
 struct tda9887 {
-	struct i2c_client client;
-	int radio,tvnorm;
-	int pinnacle_id;
+	struct i2c_client  client;
+	v4l2_std_id        std;
+	unsigned int       radio;
+	unsigned int       pinnacle_id;
+	unsigned int       using_v4l2;
+};
+
+struct tvnorm {
+	v4l2_std_id       std;
+	char              *name;
+	unsigned char     b;
+	unsigned char     c;
+	unsigned char     e;
 };
 
 static struct i2c_driver driver;
@@ -60,7 +68,7 @@ static struct i2c_client client_template;
 // TDA defines
 //
 
-//// first reg
+//// first reg (b)
 #define cVideoTrapBypassOFF     0x00    // bit b0
 #define cVideoTrapBypassON      0x01    // bit b0
 
@@ -85,7 +93,7 @@ static struct i2c_client client_template;
 #define cOutputPort2Inactive    0x80    // bit b7
 
 
-//// second reg
+//// second reg (c)
 #define cDeemphasisOFF          0x00    // bit c5
 #define cDeemphasisON           0x20    // bit c5
 
@@ -96,7 +104,7 @@ static struct i2c_client client_template;
 #define cAudioGain6             0x80    // bit c7
 
 
-//// third reg
+//// third reg (e)
 #define cAudioIF_4_5             0x00    // bit e0:1
 #define cAudioIF_5_5             0x01    // bit e0:1
 #define cAudioIF_6_0             0x02    // bit e0:1
@@ -122,126 +130,287 @@ static struct i2c_client client_template;
 #define cAgcOutON                0x80    // bit e7
 #define cAgcOutOFF               0x00    // bit e7
 
-static int tda9887_miro(struct tda9887 *t)
+/* ---------------------------------------------------------------------- */
+
+static struct tvnorm tvnorms[] = {
+	{
+		.std   = V4L2_STD_PAL_BG,
+		.name  = "PAL-BG",
+		.b     = ( cNegativeFmTV  |
+			   cQSS           ),
+		.c     = ( cDeemphasisON  |
+			   cDeemphasis50  ),
+		.e     = ( cAudioIF_5_5   |
+			   cVideoIF_38_90 ),
+	},{
+		.std   = V4L2_STD_PAL_I,
+		.name  = "PAL-I",
+		.b     = ( cNegativeFmTV  |
+			   cQSS           ),
+		.c     = ( cDeemphasisON  |
+			   cDeemphasis50  ),
+		.e     = ( cAudioIF_6_0   |
+			   cVideoIF_38_90 ),
+	},{
+		.std   = V4L2_STD_PAL_DK,
+		.name  = "PAL-DK",
+		.b     = ( cNegativeFmTV  |
+			   cQSS           ),
+		.c     = ( cDeemphasisON  |
+			   cDeemphasis50  ),
+		.e     = ( cAudioIF_6_5   |
+			   cVideoIF_38_00 ),
+	},{
+		.std   = V4L2_STD_PAL_M | V4L2_STD_PAL_N,
+		.name  = "PAL-M/N",
+		.b     = ( cNegativeFmTV  |
+			   cQSS           ),
+		.c     = ( cDeemphasisON  |
+			   cDeemphasis75  ),
+		.e     = ( cAudioIF_4_5   |
+			   cVideoIF_45_75 ),
+	},{
+		.std   = V4L2_STD_SECAM_L,
+		.name  = "SECAM-L",
+		.b     = ( cPositiveAmTV  |
+			   cQSS           ),
+		.e     = ( cAudioIF_6_5   |
+			   cVideoIF_38_90 ),
+	},{
+		.std   = V4L2_STD_SECAM_DK,
+		.name  = "SECAM-DK",
+		.b     = ( cNegativeFmTV  |
+			   cQSS           ),
+		.c     = ( cDeemphasisON  |
+			   cDeemphasis50  ),
+		.e     = ( cAudioIF_6_5   |
+			   cVideoIF_38_00 ),
+	},{
+		.std   = V4L2_STD_NTSC_M,
+		.name  = "NTSC-M",
+		.b     = ( cNegativeFmTV  |
+			   cQSS           ),
+		.c     = ( cDeemphasisON  |
+			   cDeemphasis50  ),
+		.e     = ( cGating_36     |
+			   cAudioIF_4_5   |
+			   cVideoIF_45_75 ),
+	},{
+		.std   = V4L2_STD_NTSC_M_JP,
+		.name  = "NTSC-JP",
+		.b     = ( cNegativeFmTV  |
+			   cQSS           ),
+		.c     = ( cDeemphasisON  |
+			   cDeemphasis50  ),
+		.e     = ( cGating_36     |
+			   cAudioIF_4_5   |
+			   cVideoIF_58_75 ),
+	}
+};
+
+static struct tvnorm radio = {
+	.name = "radio",
+	.b    = ( cFmRadio       |
+		  cQSS           ),
+	.c    = ( cDeemphasisON  |
+		  cDeemphasis50  ),
+	.e    = ( cAudioIF_5_5   |
+		  cRadioIF_38_90 ),
+};
+
+/* ---------------------------------------------------------------------- */
+
+static void dump_read_message(unsigned char *buf)
 {
-	int rc;
-	u8   bData[4]     = { 0 };
-	u8   bVideoIF     = 0;
-	u8   bAudioIF     = 0;
-	u8   bDeEmphasis  = 0;
-	u8   bDeEmphVal   = 0;
-	u8   bModulation  = 0;
-	u8   bCarrierMode = 0;
-	u8   bOutPort1    = cOutputPort1Inactive;
-#if 0
-	u8   bOutPort2    = cOutputPort2Inactive & mbTADState; // store i2c tuner state
-#else
-	u8   bOutPort2    = cOutputPort2Inactive;
-#endif
-	u8   bVideoTrap   = cVideoTrapBypassOFF;
-#if 1
-	u8   bTopAdjust   = 0x0e /* -2dB */;
-#else
-	u8   bTopAdjust   = 0;
-#endif
+	static char *afc[16] = {
+		"- 12.5 kHz",
+		"- 37.5 kHz",
+		"- 62.5 kHz",
+		"- 87.5 kHz",
+		"-112.5 kHz",
+		"-137.5 kHz",
+		"-162.5 kHz",
+		"-187.5 kHz [min]",
+		"+187.5 kHz [max]",
+		"+162.5 kHz",
+		"+137.5 kHz",
+		"+112.5 kHz",
+		"+ 87.5 kHz",
+		"+ 62.5 kHz",
+		"+ 37.5 kHz",
+		"+ 12.5 kHz",
+	};
+	printk(PREFIX "read: 0x%2x\n", buf[0]);
+	printk("  after power on : %s\n", (buf[0] & 0x01) ? "yes" : "no");
+	printk("  afc            : %s\n", afc[(buf[0] >> 1) & 0x0f]);
+	printk("  afc window     : %s\n", (buf[0] & 0x40) ? "in" : "out");
+	printk("  vfi level      : %s\n", (buf[0] & 0x80) ? "high" : "low");
+}
 
-#if 0
-	if (mParams.fVideoTrap)
-		bVideoTrap   = cVideoTrapBypassON;
-#endif
+static void dump_write_message(unsigned char *buf)
+{
+	static char *sound[4] = {
+		"AM/TV",
+		"FM/radio",
+		"FM/TV",
+		"FM/radio"
+	};
+	static char *adjust[32] = {
+		"-16", "-15", "-14", "-13", "-12", "-11", "-10", "-9",
+		"-8",  "-7",  "-6",  "-5",  "-4",  "-3",  "-2",  "-1",
+		"0",   "+1",  "+2",  "+3",  "+4",  "+5",  "+6",  "+7",
+		"+8",  "+9",  "+10", "+11", "+12", "+13", "+14", "+15"
+	};
+	static char *deemph[4] = {
+		"no", "no", "75", "50"
+	};
+	static char *carrier[4] = {
+		"4.5 MHz",
+		"5.5 MHz",
+		"6.0 MHz",
+		"6.5 MHz / AM"
+	};
+	static char *vif[8] = {
+		"58.75 MHz",
+		"45.75 MHz",
+		"38.9 MHz",
+		"38.0 MHz",
+		"33.9 MHz",
+		"33.4 MHz",
+		"45.75 MHz + pin13",
+		"38.9 MHz + pin13",
+	};
+	static char *rif[4] = {
+		"44 MHz",
+		"52 MHz",
+		"52 MHz",
+		"44 MHz",
+	};
+
+	printk(PREFIX "write: byte B 0x%02x\n",buf[1]);
+	printk("  B0   video mode      : %s\n",
+	       (buf[1] & 0x01) ? "video trap" : "sound trap");
+	printk("  B1   auto mute fm    : %s\n",
+	       (buf[1] & 0x02) ? "yes" : "no");
+	printk("  B2   carrier mode    : %s\n",
+	       (buf[1] & 0x04) ? "QSS" : "Intercarrier");
+	printk("  B3-4 tv sound/radio  : %s\n",
+	       sound[(buf[1] & 0x18) >> 3]);
+	printk("  B5   force mute audio: %s\n",
+	       (buf[1] & 0x20) ? "yes" : "no");
+	printk("  B6   output port 1   : %s\n",
+	       (buf[1] & 0x40) ? "high" : "low");
+	printk("  B7   output port 2   : %s\n",
+	       (buf[1] & 0x80) ? "high" : "low");
+
+	printk(PREFIX "write: byte C 0x%02x\n",buf[2]);
+	printk("  C0-4 top adjustment  : %s dB\n", adjust[buf[2] & 0x1f]);
+	printk("  C5-6 de-emphasis     : %s\n", deemph[(buf[2] & 0x60) >> 5]);
+	printk("  C7   audio gain      : %s\n",
+	       (buf[2] & 0x80) ? "-6" : "0");
+
+	printk(PREFIX "write: byte E 0x%02x\n",buf[3]);
+	printk("  E0-1 sound carrier   : %s\n",
+	       carrier[(buf[3] & 0x03)]);
+	printk("  E6   l pll ganting   : %s\n",
+	       (buf[3] & 0x40) ? "36" : "13");
+
+	if (buf[1] & 0x08) {
+		/* radio */
+		printk("  E2-4 video if        : %s\n",
+		       rif[(buf[3] & 0x0c) >> 2]);
+		printk("  E7   vif agc output  : %s\n",
+		       (buf[3] & 0x80)
+		       ? ((buf[3] & 0x10) ? "fm-agc radio" : "sif-agc radio")
+		       : "fm radio carrier afc");
+	} else {
+		/* video */
+		printk("  E2-4 video if        : %s\n",
+		       vif[(buf[3] & 0x1c) >> 2]);
+		printk("  E5   tuner gain      : %s\n",
+		       (buf[3] & 0x80)
+		       ? ((buf[3] & 0x20) ? "external" : "normal")
+		       : ((buf[3] & 0x20) ? "minimum"  : "normal"));
+		printk("  E7   vif agc output  : %s\n",
+		       (buf[3] & 0x80)
+		       ? ((buf[3] & 0x20)
+			  ? "pin3 port, pin22 vif agc out"
+			  : "pin22 port, pin3 vif acg ext in")
+		       : "pin3+pin22 port");
+	}
+	printk("--\n");
+}
+
+/* ---------------------------------------------------------------------- */
+
+static int tda9887_set_tvnorm(struct tda9887 *t, char *buf)
+{
+	struct tvnorm *norm = NULL;
+	int i;
 
 	if (t->radio) {
-		bVideoTrap   = cVideoTrapBypassOFF;
-		bCarrierMode = cQSS;
-		bModulation  = cFmRadio;
-		bOutPort1    = cOutputPort1Inactive;
-		bDeEmphasis  = cDeemphasisON;
-		if (3 == t->pinnacle_id) {
-			/* ntsc */
-			bDeEmphVal   = cDeemphasis75;
-			bAudioIF     = cAudioIF_4_5;
-			bVideoIF     = cRadioIF_45_75;
-		} else {
-			/* pal */
-			bAudioIF     = cAudioIF_5_5;
-			bVideoIF     = cRadioIF_38_90;
-			bDeEmphVal   = cDeemphasis50;
+		norm = &radio;
+	} else {
+		for (i = 0; i < ARRAY_SIZE(tvnorms); i++) {
+			if (tvnorms[i].std & t->std) {
+				norm = tvnorms+i;
+				break;
+			}
 		}
+	}
+	if (NULL == norm) {
+		dprintk(PREFIX "Oops: no tvnorm entry found\n");
+		return -1;
+	}
+
+	dprintk(PREFIX "configure for: %s\n",norm->name);
+	buf[1] = norm->b;
+	buf[2] = norm->c;
+	buf[3] = norm->e;
+	return 0;
+}
+
+static unsigned int port1  = 1;
+static unsigned int port2  = 1;
+static unsigned int qss    = UNSET;
+static unsigned int adjust = 0x10;
+MODULE_PARM(port1,"i");
+MODULE_PARM(port2,"i");
+MODULE_PARM(qss,"i");
+MODULE_PARM(adjust,"i");
+
+static int tda9887_set_insmod(struct tda9887 *t, char *buf)
+{
+	if (port1)
+		buf[1] |= cOutputPort1Inactive;
+	if (port2)
+		buf[1] |= cOutputPort2Inactive;
+	if (UNSET != qss) {
+		if (qss)
+			buf[1] |= cQSS;
+		else
+			buf[1] &= ~cQSS;
+	}
+
+	if (adjust >= 0x00 && adjust < 0x20)
+		buf[2] |= adjust;
+	return 0;
+}
+
+/* ---------------------------------------------------------------------- */
 
-	} else if (t->tvnorm == VIDEO_MODE_PAL) {
-		bDeEmphasis  = cDeemphasisON;
-		bDeEmphVal   = cDeemphasis50;
-		bModulation  = cNegativeFmTV;
-		bOutPort1    = cOutputPort1Inactive;
+static int tda9887_set_pinnacle(struct tda9887 *t, char *buf)
+{
+	unsigned int bCarrierMode = UNSET;
+
+	if (t->std & V4L2_STD_PAL) {
 		if ((1 == t->pinnacle_id) || (7 == t->pinnacle_id)) {
 			bCarrierMode = cIntercarrier;
 		} else {
-			// stereo boards
 			bCarrierMode = cQSS;
 		}
-		switch (pal[0]) {
-		case 'b':
-		case 'g':
-		case 'h':
-			bVideoIF     = cVideoIF_38_90;
-			bAudioIF     = cAudioIF_5_5;
-			break;
-		case 'd':
-			bVideoIF     = cVideoIF_38_00;
-			bAudioIF     = cAudioIF_6_5;
-			break;
-		case 'i':
-			bVideoIF     = cVideoIF_38_90;
-			bAudioIF     = cAudioIF_6_0;
-			break;
-		case 'm':
-		case 'n':
-			bVideoIF     = cVideoIF_45_75;
-			bAudioIF     = cAudioIF_4_5;
-			bDeEmphVal   = cDeemphasis75;
-			if ((5 == t->pinnacle_id) || (6 == t->pinnacle_id)) {
-				bCarrierMode = cIntercarrier;
-			} else {
-				bCarrierMode = cQSS;
-			}
-			break;
-		}
-
-	} else if (t->tvnorm == VIDEO_MODE_SECAM) {
-		bAudioIF     = cAudioIF_6_5;
-		bDeEmphasis  = cDeemphasisON;
-		bDeEmphVal   = cDeemphasis50;
-		bModulation  = cNegativeFmTV;
-		bCarrierMode = cQSS;
-		bOutPort1    = cOutputPort1Inactive;                
-		switch (secam[0]) {
-		case 'd':
-			bVideoIF     = cVideoIF_38_00;
-			break;
-		case 'k':
-			bVideoIF     = cVideoIF_38_90;
-			break;
-		case 'l':
-			bVideoIF     = cVideoIF_38_90;
-			bDeEmphasis  = cDeemphasisOFF;
-			bDeEmphVal   = cDeemphasis75;
-			bModulation  = cPositiveAmTV;
-			break;
-		case 'L' /* L1 */:
-			bVideoIF     = cVideoIF_33_90;
-			bDeEmphasis  = cDeemphasisOFF;
-			bDeEmphVal   = cDeemphasis75;
-			bModulation  = cPositiveAmTV;
-			break;
-		}
-
-	} else if (t->tvnorm == VIDEO_MODE_NTSC) {
-                bVideoIF     = cVideoIF_45_75;
-                bAudioIF     = cAudioIF_4_5;
-                bDeEmphasis  = cDeemphasisON;
-                bDeEmphVal   = cDeemphasis75;
-                bModulation  = cNegativeFmTV;                
-                bOutPort1    = cOutputPort1Inactive;
+	}
+	if (t->std & V4L2_STD_NTSC) {
                 if ((5 == t->pinnacle_id) || (6 == t->pinnacle_id)) {
 			bCarrierMode = cIntercarrier;
 		} else {
@@ -249,99 +418,102 @@ static int tda9887_miro(struct tda9887 *t)
                 }
 	}
 
-	bData[1] = bVideoTrap        |  // B0: video trap bypass
-		cAutoMuteFmInactive  |  // B1: auto mute
-		bCarrierMode         |  // B2: InterCarrier for PAL else QSS 
-		bModulation          |  // B3 - B4: positive AM TV for SECAM only
-		cForcedMuteAudioOFF  |  // B5: forced Audio Mute (off)
-		bOutPort1            |  // B6: Out Port 1 
-		bOutPort2;              // B7: Out Port 2 
-	bData[2] = bTopAdjust |   // C0 - C4: Top Adjust 0 == -16dB  31 == 15dB
-		bDeEmphasis   |   // C5: De-emphasis on/off
-		bDeEmphVal    |   // C6: De-emphasis 50/75 microsec
-		cAudioGain0;      // C7: normal audio gain
-	bData[3] = bAudioIF      |  // E0 - E1: Sound IF
-		bVideoIF         |  // E2 - E4: Video IF
-		cTunerGainNormal |  // E5: Tuner gain (normal)
-		cGating_18       |  // E6: Gating (18%)
-		cAgcOutOFF;         // E7: VAGC  (off)
-	
-	dprintk("tda9885/6/7: 0x%02x 0x%02x 0x%02x [pinnacle_id=%d]\n",
-		bData[1],bData[2],bData[3],t->pinnacle_id);
-	if (4 != (rc = i2c_master_send(&t->client,bData,4)))
-		printk("tda9885/6/7: i2c i/o error: rc == %d (should be 4)\n",rc);
+	if (bCarrierMode != UNSET) {
+		buf[1] &= ~0x04;
+		buf[1] |= bCarrierMode;
+	}
 	return 0;
 }
 
 /* ---------------------------------------------------------------------- */
 
-#if 0
-/* just for reference: old knc-one saa7134 stuff */
-static unsigned char buf_pal_bg[]    = { 0x00, 0x16, 0x70, 0x49 };
-static unsigned char buf_pal_i[]     = { 0x00, 0x16, 0x70, 0x4a };
-static unsigned char buf_pal_dk[]    = { 0x00, 0x16, 0x70, 0x4b };
-static unsigned char buf_pal_l[]     = { 0x00, 0x06, 0x50, 0x4b };
-static unsigned char buf_fm_stereo[] = { 0x00, 0x0e, 0x0d, 0x77 };
-#endif
-
-static unsigned char buf_pal_bg[]    = { 0x00, 0x96, 0x70, 0x49 };
-static unsigned char buf_pal_i[]     = { 0x00, 0x96, 0x70, 0x4a };
-static unsigned char buf_pal_dk[]    = { 0x00, 0x96, 0x70, 0x4b };
-static unsigned char buf_pal_l[]     = { 0x00, 0x86, 0x50, 0x4b };
-static unsigned char buf_fm_stereo[] = { 0x00, 0x8e, 0x0d, 0x77 };
-static unsigned char buf_ntsc[]	     = { 0x00, 0x96, 0x70, 0x44 };
-static unsigned char buf_ntsc_jp[]   = { 0x00, 0x96, 0x70, 0x40 };
+static char *pal = "-";
+MODULE_PARM(pal,"s");
+static char *secam = "-";
+MODULE_PARM(secam,"s");
 
-static int tda9887_configure(struct tda9887 *t)
+static int tda9887_fixup_std(struct tda9887 *t)
 {
-	unsigned char *buf = NULL;
-	int rc;
-
-	if (t->radio) {
-		dprintk("tda9885/6/7: FM Radio mode\n");
-		buf = buf_fm_stereo;
-
-	} else if (t->tvnorm == VIDEO_MODE_PAL) {
-		dprintk("tda9885/6/7: PAL-%c mode\n",pal[0]);
+	/* get more precise norm info from insmod option */
+	if ((t->std & V4L2_STD_PAL) == V4L2_STD_PAL) {
 		switch (pal[0]) {
 		case 'b':
+		case 'B':
 		case 'g':
-			buf = buf_pal_bg;
+		case 'G':
+			dprintk(PREFIX "insmod fixup: PAL => PAL-BG\n");
+			t->std = V4L2_STD_PAL_BG;
 			break;
 		case 'i':
-			buf = buf_pal_i;
+		case 'I':
+			dprintk(PREFIX "insmod fixup: PAL => PAL-I\n");
+			t->std = V4L2_STD_PAL_I;
+			break;
+		case 'd':
+		case 'D':
+		case 'k':
+		case 'K':
+			dprintk(PREFIX "insmod fixup: PAL => PAL-DK\n");
+			t->std = V4L2_STD_PAL_DK;
 			break;
+		}
+	}
+	if ((t->std & V4L2_STD_SECAM) == V4L2_STD_SECAM) {
+		switch (secam[0]) {
 		case 'd':
+		case 'D':
 		case 'k':
-			buf = buf_pal_dk;
+		case 'K':
+			dprintk(PREFIX "insmod fixup: SECAM => SECAM-DK\n");
+			t->std = V4L2_STD_SECAM_DK;
 			break;
 		case 'l':
-			buf = buf_pal_l;
+		case 'L':
+			dprintk(PREFIX "insmod fixup: SECAM => SECAM-L\n");
+			t->std = V4L2_STD_SECAM_L;
 			break;
 		}
+	}
+	return 0;
+}
 
-	} else if (t->tvnorm == VIDEO_MODE_NTSC) {
-		dprintk("tda9885/6/7: NTSC mode\n");
-		buf = buf_ntsc;
+static int tda9887_status(struct tda9887 *t)
+{
+	unsigned char buf[1];
+	int rc;
 
-	} else if (t->tvnorm == VIDEO_MODE_SECAM) {
-		dprintk("tda9885/6/7: SECAM mode\n");
-                buf = buf_pal_l;
+	memset(buf,0,sizeof(buf));
+        if (1 != (rc = i2c_master_recv(&t->client,buf,1)))
+                printk(PREFIX "i2c i/o error: rc == %d (should be 1)\n",rc);
+	dump_read_message(buf);
+	return 0;
+}
 
-        } else if (t->tvnorm == 6 /* BTTV hack */) {
-		dprintk("tda9885/6/7: NTSC-Japan mode\n");
-                buf = buf_ntsc_jp;
-        }
+static int tda9887_configure(struct tda9887 *t)
+{
+	unsigned char buf[4];
+	int rc;
 
-	if (NULL == buf) {
-		printk("tda9885/6/7 unknown norm=%d\n",t->tvnorm);
-		return 0;
+	memset(buf,0,sizeof(buf));
+	tda9887_set_tvnorm(t,buf);
+	if (UNSET != t->pinnacle_id) {
+		tda9887_set_pinnacle(t,buf);
 	}
+	tda9887_set_insmod(t,buf);
 
-	dprintk("tda9885/6/7: 0x%02x 0x%02x 0x%02x\n",
+	dprintk(PREFIX "writing: b=0x%02x c=0x%02x e=0x%02x\n",
 		buf[1],buf[2],buf[3]);
+	if (debug > 1)
+		dump_write_message(buf);
+
         if (4 != (rc = i2c_master_send(&t->client,buf,4)))
-                printk("tda9885/6/7: i2c i/o error: rc == %d (should be 4)\n",rc);
+                printk(PREFIX "i2c i/o error: rc == %d (should be 4)\n",rc);
+
+	if (debug > 2) {
+		set_current_state(TASK_INTERRUPTIBLE);
+		schedule_timeout(HZ);
+		tda9887_status(t);
+	}
 	return 0;
 }
 
@@ -354,14 +526,14 @@ static int tda9887_attach(struct i2c_adapter *adap, int addr, int kind)
         client_template.adapter = adap;
         client_template.addr    = addr;
 
-        printk("tda9887: chip found @ 0x%x\n", addr<<1);
+        printk(PREFIX "chip found @ 0x%x\n", addr<<1);
 
         if (NULL == (t = kmalloc(sizeof(*t), GFP_KERNEL)))
                 return -ENOMEM;
 	memset(t,0,sizeof(*t));
-	t->client = client_template;
-	t->pinnacle_id = -1;
-	t->tvnorm=VIDEO_MODE_PAL;
+	t->client      = client_template;
+	t->std         = 0;;
+	t->pinnacle_id = UNSET;
         i2c_set_clientdata(&t->client, t);
         i2c_attach_client(&t->client);
         
@@ -394,6 +566,13 @@ static int tda9887_detach(struct i2c_client *client)
 	return 0;
 }
 
+#define SWITCH_V4L2	if (!t->using_v4l2 && debug) \
+		          printk(PREFIX "switching to v4l2\n"); \
+	                  t->using_v4l2 = 1;
+#define CHECK_V4L2	if (t->using_v4l2) { if (debug) \
+			  printk(PREFIX "ignore v4l1 call\n"); \
+		          return 0; }
+
 static int
 tda9887_command(struct i2c_client *client, unsigned int cmd, void *arg)
 {
@@ -404,10 +583,7 @@ tda9887_command(struct i2c_client *client, unsigned int cmd, void *arg)
 	/* --- configuration --- */
 	case AUDC_SET_RADIO:
 		t->radio = 1;
-		if (-1 != t->pinnacle_id)
-			tda9887_miro(t);
-		else
-			tda9887_configure(t);
+		tda9887_configure(t);
 		break;
 		
 	case AUDC_CONFIG_PINNACLE:
@@ -415,7 +591,7 @@ tda9887_command(struct i2c_client *client, unsigned int cmd, void *arg)
 		int *i = arg;
 
 		t->pinnacle_id = *i;
-		tda9887_miro(t);
+		tda9887_configure(t);
 		break;
 	}
 	/* --- v4l ioctls --- */
@@ -423,16 +599,52 @@ tda9887_command(struct i2c_client *client, unsigned int cmd, void *arg)
 	   kernel pointer here... */
 	case VIDIOCSCHAN:
 	{
+		static const v4l2_std_id map[] = {
+			[ VIDEO_MODE_PAL   ] = V4L2_STD_PAL,
+			[ VIDEO_MODE_NTSC  ] = V4L2_STD_NTSC_M,
+			[ VIDEO_MODE_SECAM ] = V4L2_STD_SECAM,
+			[ 4 /* bttv */     ] = V4L2_STD_PAL_M,
+			[ 5 /* bttv */     ] = V4L2_STD_PAL_N,
+			[ 6 /* bttv */     ] = V4L2_STD_NTSC_M_JP,
+		};
 		struct video_channel *vc = arg;
 
-		t->radio  = 0;
-		t->tvnorm = vc->norm;
-		if (-1 != t->pinnacle_id)
-			tda9887_miro(t);
-		else
-			tda9887_configure(t);
+		CHECK_V4L2;
+		t->radio = 0;
+		if (vc->norm < ARRAY_SIZE(map))
+			t->std = map[vc->norm];
+		tda9887_fixup_std(t);
+		tda9887_configure(t);
+		break;
+	}
+	case VIDIOC_S_STD:
+	{
+		v4l2_std_id *id = arg;
+
+		SWITCH_V4L2;
+		t->radio = 0;
+		t->std   = *id;
+		tda9887_fixup_std(t);
+		tda9887_configure(t);
 		break;
 	}
+	case VIDIOC_S_FREQUENCY:
+	{
+		struct v4l2_frequency *f = arg;
+
+		SWITCH_V4L2;
+		if (V4L2_TUNER_ANALOG_TV == f->type) {
+			if (t->radio == 0)
+				return 0;
+			t->radio = 0;
+		}
+		if (V4L2_TUNER_RADIO == f->type) {
+			if (t->radio == 1)
+				return 0;
+			t->radio = 1;
+		}
+		tda9887_configure(t);
+	}
 	default:
 		/* nothing */
 		break;
diff --git a/drivers/media/video/tea6415c.c b/drivers/media/video/tea6415c.c
index 4673dfca6..fe64e64e3 100644
--- a/drivers/media/video/tea6415c.c
+++ b/drivers/media/video/tea6415c.c
@@ -57,7 +57,7 @@ static int tea6415c_id = 0;
 /* this function is called by i2c_probe */
 static int tea6415c_detect(struct i2c_adapter *adapter, int address, int kind)
 {
-	struct	i2c_client *client = 0;
+	struct	i2c_client *client = NULL;
 	int err = 0;
 
 	/* let's see whether this adapter can support what we need */
@@ -217,13 +217,12 @@ static struct i2c_driver driver = {
         .command	= tea6415c_command,
 };
 
-static int tea6415c_init_module(void)
+static int __init tea6415c_init_module(void)
 {
-	i2c_add_driver(&driver);
-	return 0;
+	return i2c_add_driver(&driver);
 }
 
-static void tea6415c_cleanup_module(void)
+static void __exit tea6415c_cleanup_module(void)
 {
         i2c_del_driver(&driver);
 }
diff --git a/drivers/media/video/tea6420.c b/drivers/media/video/tea6420.c
index eca450354..93acdc635 100644
--- a/drivers/media/video/tea6420.c
+++ b/drivers/media/video/tea6420.c
@@ -197,13 +197,12 @@ static struct i2c_driver driver = {
         .command	= tea6420_command,
 };
 
-static int tea6420_init_module(void)
+static int __init tea6420_init_module(void)
 {
-	i2c_add_driver(&driver);
-	return 0;
+	return i2c_add_driver(&driver);
 }
 
-static void tea6420_cleanup_module(void)
+static void __exit tea6420_cleanup_module(void)
 {
         i2c_del_driver(&driver);
 }
diff --git a/drivers/media/video/tuner.c b/drivers/media/video/tuner.c
index ab7030447..18e1118df 100644
--- a/drivers/media/video/tuner.c
+++ b/drivers/media/video/tuner.c
@@ -26,15 +26,17 @@ I2C_CLIENT_INSMOD;
 static unsigned int debug =  0;
 static unsigned int type  =  UNSET;
 static unsigned int addr  =  0;
-static char *pal =  "b";
 static unsigned int tv_range[2]    = { 44, 958 };
 static unsigned int radio_range[2] = { 65, 108 };
+static unsigned int tv_antenna = 1;
+static unsigned int radio_antenna = 0;
 MODULE_PARM(debug,"i");
 MODULE_PARM(type,"i");
 MODULE_PARM(addr,"i");
 MODULE_PARM(tv_range,"2i");
 MODULE_PARM(radio_range,"2i");
-MODULE_PARM(pal,"s");
+MODULE_PARM(tv_antenna,"i");
+MODULE_PARM(radio_antenna,"i");
 
 #define optimize_vco 1
 
@@ -48,10 +50,10 @@ static int this_adap;
 struct tuner {
 	unsigned int type;            /* chip type */
 	unsigned int freq;            /* keep track of the current settings */
-	unsigned int std;
+	v4l2_std_id  std;
+	int          using_v4l2;
 	
 	unsigned int radio;
-	unsigned int mode;            /* current norm for multi-norm tuners */
 	unsigned int input;
 	
 	// only for MT2032
@@ -537,15 +539,16 @@ static void mt2032_set_tv_freq(struct i2c_client *c, unsigned int freq)
 	int if2,from,to;
 
 	// signal bandwidth and picture carrier
-	if (t->mode == VIDEO_MODE_NTSC) {
-		from=40750*1000;
-		to=46750*1000;
-		if2=45750*1000; 
+	if (t->std & V4L2_STD_525_60) {
+		// NTSC
+		from = 40750*1000;
+		to   = 46750*1000;
+		if2  = 45750*1000;
 	} else {
-		// Pal 
-		from=32900*1000;
-		to=39900*1000;
-		if2=38900*1000;
+		// PAL
+		from = 32900*1000;
+		to   = 39900*1000;
+		if2  = 38900*1000;
 	}
 
         mt2032_set_if_freq(c, freq*62500 /* freq*1000*1000/16 */,
@@ -619,6 +622,17 @@ static int mt2032_init(struct i2c_client *c)
         return(1);
 }
 
+static void mt2050_set_antenna(struct i2c_client *c, unsigned char antenna)
+{
+       unsigned char buf[2];
+       int ret;
+
+       buf[0] = 6;
+       buf[1] = antenna ? 0x11 : 0x10;
+       ret=i2c_master_send(c,buf,2);
+       dprintk("mt2050: enabled antenna connector %d\n", antenna);
+}
+
 static void mt2050_set_if_freq(struct i2c_client *c,unsigned int freq, unsigned int if2)
 {
 	unsigned int if1=1218*1000*1000;
@@ -683,13 +697,15 @@ static void mt2050_set_tv_freq(struct i2c_client *c, unsigned int freq)
 	struct tuner *t = i2c_get_clientdata(c);
 	unsigned int if2;
 	
-	if (t->mode == VIDEO_MODE_NTSC) {
-                if2=45750*1000;
+	if (t->std & V4L2_STD_525_60) {
+		// NTSC
+                if2 = 45750*1000;
         } else {
-                // Pal
-                if2=38900*1000;
+                // PAL
+                if2 = 38900*1000;
         }
-	mt2050_set_if_freq(c,freq*62500,if2);
+	mt2050_set_if_freq(c, freq*62500, if2);
+	mt2050_set_antenna(c, tv_antenna);
 }
 
 static void mt2050_set_radio_freq(struct i2c_client *c, unsigned int freq)
@@ -698,6 +714,7 @@ static void mt2050_set_radio_freq(struct i2c_client *c, unsigned int freq)
 	int if2 = t->radio_if2;
 	
 	mt2050_set_if_freq(c, freq*62500, if2);
+	mt2050_set_antenna(c, radio_antenna);
 }
 
 static int mt2050_init(struct i2c_client *c)
@@ -731,8 +748,8 @@ static int microtune_init(struct i2c_client *c)
         unsigned char buf[21];
 	int company_code;
 	
-        buf[0] = 0;
-	t->tv_freq = NULL;
+	memset(buf,0,sizeof(buf));
+	t->tv_freq    = NULL;
 	t->radio_freq = NULL;
 	name = "unknown";
 
@@ -751,6 +768,9 @@ static int microtune_init(struct i2c_client *c)
 	company_code = buf[0x11] << 8 | buf[0x12];
         printk("tuner: microtune: companycode=%04x part=%02x rev=%02x\n",
 	       company_code,buf[0x13],buf[0x14]);
+
+#if 0
+	/* seems to cause more problems than it solves ... */
 	switch (company_code) {
 	case 0x30bf:
 	case 0x3cbf:
@@ -764,6 +784,7 @@ static int microtune_init(struct i2c_client *c)
 		printk("tuner: microtune: unknown companycode\n");
 		return 0;
 	}
+#endif
 
 	if (buf[0x13] < ARRAY_SIZE(microtune_part) &&
 	    NULL != microtune_part[buf[0x13]])
@@ -811,54 +832,40 @@ static void default_set_tv_freq(struct i2c_client *c, unsigned int freq)
 		/* 0x02 -> PAL BDGHI / SECAM L */
 		/* 0x04 -> ??? PAL others / SECAM others ??? */
 		config &= ~0x02;
-		if (t->mode == VIDEO_MODE_SECAM)
+		if (t->std & V4L2_STD_SECAM)
 			config |= 0x02;
 		break;
 
 	case TUNER_TEMIC_4046FM5:
 		config &= ~0x0f;
-		switch (pal[0]) {
-		case 'i':
-		case 'I':
+
+		if (t->std & V4L2_STD_PAL_BG) {
+			config |= TEMIC_SET_PAL_BG;
+
+		} else if (t->std & V4L2_STD_PAL_I) {
 			config |= TEMIC_SET_PAL_I;
-			break;
-		case 'd':
-		case 'D':
+
+		} else if (t->std & V4L2_STD_PAL_DK) {
 			config |= TEMIC_SET_PAL_DK;
-			break;
-		case 'l':
-		case 'L':
+
+		} else if (t->std & V4L2_STD_SECAM_L) {
 			config |= TEMIC_SET_PAL_L;
-			break;
-		case 'b':
-		case 'B':
-		case 'g':
-		case 'G':
-		default:
-			config |= TEMIC_SET_PAL_BG;
-			break;
+
 		}
 		break;
 
 	case TUNER_PHILIPS_FQ1216ME:
 		config &= ~0x0f;
-		switch (pal[0]) {
-		case 'i':
-		case 'I':
+
+		if (t->std & (V4L2_STD_PAL_BG|V4L2_STD_PAL_DK)) {
+			config |= PHILIPS_SET_PAL_BGDK;
+
+		} else if (t->std & V4L2_STD_PAL_I) {
 			config |= PHILIPS_SET_PAL_I;
-			break;
-		case 'l':
-		case 'L':
+
+		} else if (t->std & V4L2_STD_SECAM_L) {
 			config |= PHILIPS_SET_PAL_L;
-			break;
-		case 'd':
-		case 'D':
-		case 'b':
-		case 'B':
-		case 'g':
-		case 'G':
-			config |= PHILIPS_SET_PAL_BGDK;
-			break;
+
 		}
 		break;
 
@@ -867,12 +874,9 @@ static void default_set_tv_freq(struct i2c_client *c, unsigned int freq)
 		/* 0x01 -> ATSC antenna input 2 */
 		/* 0x02 -> NTSC antenna input 1 */
 		/* 0x03 -> NTSC antenna input 2 */
-		
 		config &= ~0x03;
-#ifdef VIDEO_MODE_ATSC
-		if (VIDEO_MODE_ATSC != t->mode)
+		if (t->std & V4L2_STD_ATSC)
 			config |= 2;
-#endif
 		/* FIXME: input */
 		break;
 	}
@@ -990,6 +994,22 @@ static void set_radio_freq(struct i2c_client *c, unsigned int freq)
 	t->radio_freq(c,freq);
 }
 
+static void set_freq(struct i2c_client *c, unsigned long freq)
+{
+	struct tuner *t = i2c_get_clientdata(c);
+
+	if (t->radio) {
+		dprintk("tuner: radio freq set to %lu.%02lu\n",
+			freq/16,freq%16*100/16);
+		set_radio_freq(c,freq);
+	} else {
+		dprintk("tuner: tv freq set to %lu.%02lu\n",
+			freq/16,freq%16*100/16);
+		set_tv_freq(c, freq);
+	}
+	t->freq = freq;
+}
+
 static void set_type(struct i2c_client *c, unsigned int type, char *source)
 {
 	struct tuner *t = i2c_get_clientdata(c);
@@ -1019,6 +1039,38 @@ static void set_type(struct i2c_client *c, unsigned int type, char *source)
 	}
 }
 
+static char *pal = "-";
+MODULE_PARM(pal,"s");
+
+static int tuner_fixup_std(struct tuner *t)
+{
+	if ((t->std & V4L2_STD_PAL) == V4L2_STD_PAL) {
+		/* get more precise norm info from insmod option */
+		switch (pal[0]) {
+		case 'b':
+		case 'B':
+		case 'g':
+		case 'G':
+			dprintk("insmod fixup: PAL => PAL-BG\n");
+			t->std = V4L2_STD_PAL_BG;
+			break;
+		case 'i':
+		case 'I':
+			dprintk("insmod fixup: PAL => PAL-I\n");
+			t->std = V4L2_STD_PAL_I;
+			break;
+		case 'd':
+		case 'D':
+		case 'k':
+		case 'K':
+			dprintk("insmod fixup: PAL => PAL-DK\n");
+			t->std = V4L2_STD_PAL_DK;
+			break;
+		}
+	}
+	return 0;
+}
+
 /* ---------------------------------------------------------------------- */
 
 static int tuner_attach(struct i2c_adapter *adap, int addr, int kind)
@@ -1054,7 +1106,7 @@ static int tuner_attach(struct i2c_adapter *adap, int addr, int kind)
 		set_type(client, type, "insmod option");
 		printk("tuner: The type=<n> insmod option will go away soon.\n");
 		printk("tuner: Please use the tuner=<n> option provided by\n");
-		printk("tuner: tv card core driver (bttv, saa7134, ...) instead.\n");
+		printk("tuner: tv aard core driver (bttv, saa7134, ...) instead.\n");
 	}
 	return 0;
 }
@@ -1094,6 +1146,13 @@ static int tuner_detach(struct i2c_client *client)
 	return 0;
 }
 
+#define SWITCH_V4L2	if (!t->using_v4l2 && debug) \
+		          printk("tuner: switching to v4l2\n"); \
+	                  t->using_v4l2 = 1;
+#define CHECK_V4L2	if (t->using_v4l2) { if (debug) \
+			  printk("tuner: ignore v4l1 call\n"); \
+		          return 0; }
+
 static int
 tuner_command(struct i2c_client *client, unsigned int cmd, void *arg)
 {
@@ -1130,10 +1189,21 @@ tuner_command(struct i2c_client *client, unsigned int cmd, void *arg)
 	   kernel pointer here... */
 	case VIDIOCSCHAN:
 	{
+		static const v4l2_std_id map[] = {
+			[ VIDEO_MODE_PAL   ] = V4L2_STD_PAL,
+			[ VIDEO_MODE_NTSC  ] = V4L2_STD_NTSC_M,
+			[ VIDEO_MODE_SECAM ] = V4L2_STD_SECAM,
+			[ 4 /* bttv */     ] = V4L2_STD_PAL_M,
+			[ 5 /* bttv */     ] = V4L2_STD_PAL_N,
+			[ 6 /* bttv */     ] = V4L2_STD_NTSC_M_JP,
+		};
 		struct video_channel *vc = arg;
 
+		CHECK_V4L2;
 		t->radio = 0;
-		t->mode = vc->norm;
+		if (vc->norm < ARRAY_SIZE(map))
+			t->std = map[vc->norm];
+		tuner_fixup_std(t);
 		if (t->freq)
 			set_tv_freq(client,t->freq);
 		return 0;
@@ -1142,22 +1212,15 @@ tuner_command(struct i2c_client *client, unsigned int cmd, void *arg)
 	{
 		unsigned long *v = arg;
 
-		if (t->radio) {
-			dprintk("tuner: radio freq set to %lu.%02lu\n",
-				(*v)/16,(*v)%16*100/16);
-			set_radio_freq(client,*v);
-		} else {
-			dprintk("tuner: tv freq set to %lu.%02lu\n",
-				(*v)/16,(*v)%16*100/16);
-			set_tv_freq(client,*v);
-		}
-		t->freq = *v;
+		CHECK_V4L2;
+		set_freq(client,*v);
 		return 0;
 	}
 	case VIDIOCGTUNER:
 	{
 		struct video_tuner *vt = arg;
 
+		CHECK_V4L2;
 		if (t->radio)
 			vt->signal = tuner_signal(client);
 		return 0;
@@ -1165,10 +1228,52 @@ tuner_command(struct i2c_client *client, unsigned int cmd, void *arg)
 	case VIDIOCGAUDIO:
 	{
 		struct video_audio *va = arg;
+
+		CHECK_V4L2;
 		if (t->radio)
 			va->mode = (tuner_stereo(client) ? VIDEO_SOUND_STEREO : VIDEO_SOUND_MONO);
 		return 0;
 	}
+
+	case VIDIOC_S_STD:
+	{
+		v4l2_std_id *id = arg;
+
+		SWITCH_V4L2;
+		t->radio = 0;
+		t->std = *id;
+		tuner_fixup_std(t);
+		if (t->freq)
+			set_freq(client,t->freq);
+		break;
+	}
+	case VIDIOC_S_FREQUENCY:
+	{
+		struct v4l2_frequency *f = arg;
+
+		SWITCH_V4L2;
+		if (V4L2_TUNER_ANALOG_TV == f->type) {
+			t->radio = 0;
+		}
+		if (V4L2_TUNER_RADIO == f->type) {
+			if (!t->radio) {
+				set_tv_freq(client,400*16);
+				t->radio = 1;
+			}
+		}
+		t->freq  = f->frequency;
+		set_freq(client,t->freq);
+		break;
+	}
+	case VIDIOC_G_TUNER:
+	{
+		struct v4l2_tuner *tuner = arg;
+
+		SWITCH_V4L2;
+		if (t->radio)
+			tuner->signal = tuner_signal(client);
+		break;
+	}
 	default:
 		/* nothing */
 		break;
diff --git a/drivers/media/video/tvmixer.c b/drivers/media/video/tvmixer.c
index f690126f0..48b2f822e 100644
--- a/drivers/media/video/tvmixer.c
+++ b/drivers/media/video/tvmixer.c
@@ -77,6 +77,8 @@ static int tvmixer_ioctl(struct inode *inode, struct file *file, unsigned int cm
 	int left,right,ret,val = 0;
         struct TVMIXER *mix = file->private_data;
 	struct i2c_client *client = mix->dev;
+	void __user *argp = (void __user *)arg;
+	int __user *p = argp;
 
 	if (NULL == client)
 		return -ENODEV;
@@ -86,7 +88,7 @@ static int tvmixer_ioctl(struct inode *inode, struct file *file, unsigned int cm
                 strlcpy(info.id, "tv card", sizeof(info.id));
                 strlcpy(info.name, i2c_clientname(client), sizeof(info.name));
                 info.modify_counter = 42 /* FIXME */;
-                if (copy_to_user((void *)arg, &info, sizeof(info)))
+                if (copy_to_user(argp, &info, sizeof(info)))
                         return -EFAULT;
                 return 0;
         }
@@ -94,15 +96,15 @@ static int tvmixer_ioctl(struct inode *inode, struct file *file, unsigned int cm
                 _old_mixer_info info;
                 strlcpy(info.id, "tv card", sizeof(info.id));
                 strlcpy(info.name, i2c_clientname(client), sizeof(info.name));
-                if (copy_to_user((void *)arg, &info, sizeof(info)))
+                if (copy_to_user(argp, &info, sizeof(info)))
                         return -EFAULT;
                 return 0;
         }
         if (cmd == OSS_GETVERSION)
-                return put_user(SOUND_VERSION, (int *)arg);
+                return put_user(SOUND_VERSION, p);
 
 	if (_SIOC_DIR(cmd) & _SIOC_WRITE)
-		if (get_user(val, (int *)arg))
+		if (get_user(val, p))
 			return -EFAULT;
 
 	/* read state */
@@ -168,7 +170,7 @@ static int tvmixer_ioctl(struct inode *inode, struct file *file, unsigned int cm
 	default:
 		return -EINVAL;
 	}
-	if (put_user(ret, (int *)arg))
+	if (put_user(ret, p))
 		return -EFAULT;
 	return 0;
 }
diff --git a/drivers/media/video/v4l1-compat.c b/drivers/media/video/v4l1-compat.c
index 441733d0b..c75ca87b0 100644
--- a/drivers/media/video/v4l1-compat.c
+++ b/drivers/media/video/v4l1-compat.c
@@ -490,7 +490,7 @@ v4l_compat_translate_ioctl(struct inode         *inode,
 		fmt2->fmt.win.w.width   = win->width;
 		fmt2->fmt.win.w.height  = win->height;
 		fmt2->fmt.win.chromakey = win->chromakey;
-		fmt2->fmt.win.clips     = (void *)win->clips;
+		fmt2->fmt.win.clips     = (void __user *)win->clips;
 		fmt2->fmt.win.clipcount = win->clipcount;
 		err2 = drv(inode, file, VIDIOC_S_FMT, fmt2);
 		if (err2 < 0)
diff --git a/drivers/media/video/video-buf.c b/drivers/media/video/video-buf.c
index f541a06df..c7c746550 100644
--- a/drivers/media/video/video-buf.c
+++ b/drivers/media/video/video-buf.c
@@ -5,10 +5,10 @@
  * The functions expect the hardware being able to scatter gatter
  * (i.e. the buffers are not linear in physical memory, but fragmented
  * into PAGE_SIZE chunks).  They also assume the driver does not need
- * to touch the video data (thus it is probably not useful for USB as
- * data often must be uncompressed by the drivers).
+ * to touch the video data (thus it is probably not useful for USB 1.1
+ * as data often must be uncompressed by the drivers).
  * 
- * (c) 2001,02 Gerd Knorr <kraxel@bytesex.org>
+ * (c) 2001-2004 Gerd Knorr <kraxel@bytesex.org> [SUSE Labs]
  *
  * This program is free software; you can redistribute it and/or modify
  * it under the terms of the GNU General Public License as published by
@@ -28,6 +28,11 @@
 
 #include <media/video-buf.h>
 
+#define MAGIC_DMABUF 0x19721112
+#define MAGIC_BUFFER 0x20040302
+#define MAGIC_CHECK(is,should)	if (unlikely((is) != (should))) \
+	{ printk(KERN_ERR "magic mismatch: %x (expected %x)\n",is,should); BUG(); }
+
 static int debug = 0;
 
 MODULE_DESCRIPTION("helper module to manage video4linux pci dma buffers");
@@ -109,6 +114,12 @@ videobuf_pages_to_sg(struct page **pages, int nr_pages, int offset)
 
 /* --------------------------------------------------------------------- */
 
+void videobuf_dma_init(struct videobuf_dmabuf *dma)
+{
+	memset(dma,0,sizeof(*dma));
+	dma->magic = MAGIC_DMABUF;
+}
+
 int videobuf_dma_init_user(struct videobuf_dmabuf *dma, int direction,
 			   unsigned long data, unsigned long size)
 {
@@ -178,8 +189,8 @@ int videobuf_dma_init_overlay(struct videobuf_dmabuf *dma, int direction,
 
 int videobuf_dma_pci_map(struct pci_dev *dev, struct videobuf_dmabuf *dma)
 {
-	if (0 == dma->nr_pages)
-		BUG();
+	MAGIC_CHECK(dma->magic,MAGIC_DMABUF);
+	BUG_ON(0 == dma->nr_pages);
 	
 	if (dma->pages) {
 		dma->sglist = videobuf_pages_to_sg(dma->pages, dma->nr_pages,
@@ -211,8 +222,8 @@ int videobuf_dma_pci_map(struct pci_dev *dev, struct videobuf_dmabuf *dma)
 
 int videobuf_dma_pci_sync(struct pci_dev *dev, struct videobuf_dmabuf *dma)
 {
-	if (!dma->sglen)
-		BUG();
+	MAGIC_CHECK(dma->magic,MAGIC_DMABUF);
+	BUG_ON(!dma->sglen);
 
 	if (!dma->bus_addr)
 		pci_dma_sync_sg_for_cpu(dev,dma->sglist,dma->nr_pages,dma->direction);
@@ -221,6 +232,7 @@ int videobuf_dma_pci_sync(struct pci_dev *dev, struct videobuf_dmabuf *dma)
 
 int videobuf_dma_pci_unmap(struct pci_dev *dev, struct videobuf_dmabuf *dma)
 {
+	MAGIC_CHECK(dma->magic,MAGIC_DMABUF);
 	if (!dma->sglen)
 		return 0;
 
@@ -234,8 +246,8 @@ int videobuf_dma_pci_unmap(struct pci_dev *dev, struct videobuf_dmabuf *dma)
 
 int videobuf_dma_free(struct videobuf_dmabuf *dma)
 {
-	if (dma->sglen)
-		BUG();
+	MAGIC_CHECK(dma->magic,MAGIC_DMABUF);
+	BUG_ON(dma->sglen);
 
 	if (dma->pages) {
 		int i;
@@ -264,7 +276,9 @@ void* videobuf_alloc(unsigned int size)
 	vb = kmalloc(size,GFP_KERNEL);
 	if (NULL != vb) {
 		memset(vb,0,size);
+		videobuf_dma_init(&vb->dma);
 		init_waitqueue_head(&vb->done);
+		vb->magic     = MAGIC_BUFFER;
 	}
 	return vb;
 }
@@ -274,6 +288,7 @@ int videobuf_waiton(struct videobuf_buffer *vb, int non_blocking, int intr)
 	int retval = 0;
 	DECLARE_WAITQUEUE(wait, current);
 	
+	MAGIC_CHECK(vb->magic,MAGIC_BUFFER);
 	add_wait_queue(&vb->done, &wait);
 	while (vb->state == STATE_ACTIVE || vb->state == STATE_QUEUED) {
 		if (non_blocking) {
@@ -302,6 +317,7 @@ videobuf_iolock(struct pci_dev *pci, struct videobuf_buffer *vb,
 	int err,pages;
 	dma_addr_t bus;
 
+	MAGIC_CHECK(vb->magic,MAGIC_BUFFER);
 	switch (vb->memory) {
 	case V4L2_MEMORY_MMAP:
 	case V4L2_MEMORY_USERPTR:
@@ -453,6 +469,8 @@ void
 videobuf_status(struct v4l2_buffer *b, struct videobuf_buffer *vb,
 		enum v4l2_buf_type type)
 {
+	MAGIC_CHECK(vb->magic,MAGIC_BUFFER);
+
 	b->index    = vb->i;
 	b->type     = type;
 
@@ -491,6 +509,11 @@ videobuf_status(struct v4l2_buffer *b, struct videobuf_buffer *vb,
 		break;
 	}
 
+	if (vb->input != UNSET) {
+		b->flags |= V4L2_BUF_FLAG_INPUT;
+		b->input  = vb->input;
+	}
+
 	b->field     = vb->field;
 	b->timestamp = vb->ts;
 	b->bytesused = vb->size;
@@ -513,6 +536,11 @@ videobuf_reqbufs(struct file *file, struct videobuf_queue *q,
 	    req->memory != V4L2_MEMORY_OVERLAY)
 		return -EINVAL;
 
+	if (q->streaming)
+		return -EBUSY;
+	if (!list_empty(&q->stream))
+		return -EBUSY;
+
 	down(&q->lock);
 	count = req->count;
 	if (count > VIDEO_MAX_FRAME)
@@ -568,12 +596,21 @@ videobuf_qbuf(struct file *file, struct videobuf_queue *q,
 	buf = q->bufs[b->index];
 	if (NULL == buf)
 		goto done;
+	MAGIC_CHECK(buf->magic,MAGIC_BUFFER);
 	if (buf->memory != b->memory)
 		goto done;
 	if (buf->state == STATE_QUEUED ||
 	    buf->state == STATE_ACTIVE)
 		goto done;
 
+	if (b->flags & V4L2_BUF_FLAG_INPUT) {
+		if (b->input >= q->inputs)
+			goto done;
+		buf->input = b->input;
+	} else {
+		buf->input = UNSET;
+	}
+
 	switch (b->memory) {
 	case V4L2_MEMORY_MMAP:
 		if (0 == buf->baddr)
@@ -582,6 +619,8 @@ videobuf_qbuf(struct file *file, struct videobuf_queue *q,
 	case V4L2_MEMORY_USERPTR:
 		if (b->length < buf->bsize)
 			goto done;
+		if (STATE_NEEDS_INIT != buf->state && buf->baddr != b->m.userptr)
+			q->ops->buf_release(file,buf);
 		buf->baddr = b->m.userptr;
 		break;
 	case V4L2_MEMORY_OVERLAY:
@@ -696,7 +735,7 @@ int videobuf_streamoff(struct file *file, struct videobuf_queue *q)
 
 static ssize_t
 videobuf_read_zerocopy(struct file *file, struct videobuf_queue *q,
-		       char *data, size_t count, loff_t *ppos)
+		       char __user *data, size_t count, loff_t *ppos)
 {
 	enum v4l2_field field;
 	unsigned long flags;
@@ -738,7 +777,7 @@ videobuf_read_zerocopy(struct file *file, struct videobuf_queue *q,
 }
 
 ssize_t videobuf_read_one(struct file *file, struct videobuf_queue *q,
-			  char *data, size_t count, loff_t *ppos)
+			  char __user *data, size_t count, loff_t *ppos)
 {
 	enum v4l2_field field;
 	unsigned long flags;
@@ -862,7 +901,7 @@ void videobuf_read_stop(struct file *file, struct videobuf_queue *q)
 }
 
 ssize_t videobuf_read_stream(struct file *file, struct videobuf_queue *q,
-			     char *data, size_t count, loff_t *ppos,
+			     char __user *data, size_t count, loff_t *ppos,
 			     int vbihack)
 {
 	unsigned int *fc, bytes;
@@ -1075,6 +1114,7 @@ int videobuf_mmap_setup(struct file *file, struct videobuf_queue *q,
 	for (i = 0; i < bcount; i++) {
 		q->bufs[i] = videobuf_alloc(q->msize);
 		q->bufs[i]->i      = i;
+		q->bufs[i]->input  = UNSET;
 		q->bufs[i]->memory = memory;
 		q->bufs[i]->bsize  = bsize;
 		switch (memory) {
@@ -1085,7 +1125,7 @@ int videobuf_mmap_setup(struct file *file, struct videobuf_queue *q,
 		case V4L2_MEMORY_OVERLAY:
 			/* nothing */
 			break;
-		};
+		}
 	}
 	dprintk(1,"mmap setup: %d buffers, %d bytes each\n",
 		bcount,bsize);
@@ -1192,6 +1232,7 @@ int videobuf_mmap_mapper(struct vm_area_struct *vma,
 
 EXPORT_SYMBOL_GPL(videobuf_vmalloc_to_sg);
 
+EXPORT_SYMBOL_GPL(videobuf_dma_init);
 EXPORT_SYMBOL_GPL(videobuf_dma_init_user);
 EXPORT_SYMBOL_GPL(videobuf_dma_init_kernel);
 EXPORT_SYMBOL_GPL(videobuf_dma_init_overlay);
diff --git a/drivers/media/video/videocodec.c b/drivers/media/video/videocodec.c
index f7700bbf4..081eb06a4 100644
--- a/drivers/media/video/videocodec.c
+++ b/drivers/media/video/videocodec.c
@@ -458,7 +458,7 @@ videocodec_init (void)
 	videocodec_buf = NULL;
 	videocodec_bufsize = 0;
 
-	videocodec_proc_entry = create_proc_entry("videocodecs", 0, 0);
+	videocodec_proc_entry = create_proc_entry("videocodecs", 0, NULL);
 	if (videocodec_proc_entry) {
 		videocodec_proc_entry->read_proc = videocodec_info;
 		videocodec_proc_entry->write_proc = NULL;
@@ -475,7 +475,7 @@ static void __exit
 videocodec_exit (void)
 {
 #ifdef CONFIG_PROC_FS
-	remove_proc_entry("videocodecs", 0);
+	remove_proc_entry("videocodecs", NULL);
 	if (videocodec_buf)
 		kfree(videocodec_buf);
 #endif
diff --git a/drivers/media/video/videodev.c b/drivers/media/video/videodev.c
index afaf612fc..fbc5cb1e2 100644
--- a/drivers/media/video/videodev.c
+++ b/drivers/media/video/videodev.c
@@ -183,7 +183,7 @@ video_usercopy(struct inode *inode, struct file *file,
 	/*  Copy arguments into temp kernel buffer  */
 	switch (_IOC_DIR(cmd)) {
 	case _IOC_NONE:
-		parg = (void *)arg;
+		parg = NULL;
 		break;
 	case _IOC_READ:
 	case _IOC_WRITE:
@@ -200,7 +200,7 @@ video_usercopy(struct inode *inode, struct file *file,
 		
 		err = -EFAULT;
 		if (_IOC_DIR(cmd) & _IOC_WRITE)
-			if (copy_from_user(parg, (void *)arg, _IOC_SIZE(cmd)))
+			if (copy_from_user(parg, (void __user *)arg, _IOC_SIZE(cmd)))
 				goto out;
 		break;
 	}
@@ -217,7 +217,7 @@ video_usercopy(struct inode *inode, struct file *file,
 	{
 	case _IOC_READ:
 	case (_IOC_WRITE | _IOC_READ):
-		if (copy_to_user((void *)arg, parg, _IOC_SIZE(cmd)))
+		if (copy_to_user((void __user *)arg, parg, _IOC_SIZE(cmd)))
 			err = -EFAULT;
 		break;
 	}
@@ -231,7 +231,7 @@ out:
 /*
  * open/release helper functions -- handle exclusive opens
  */
-extern int video_exclusive_open(struct inode *inode, struct file *file)
+int video_exclusive_open(struct inode *inode, struct file *file)
 {
 	struct  video_device *vfl = video_devdata(file);
 	int retval = 0;
@@ -246,7 +246,7 @@ extern int video_exclusive_open(struct inode *inode, struct file *file)
 	return retval;
 }
 
-extern int video_exclusive_release(struct inode *inode, struct file *file)
+int video_exclusive_release(struct inode *inode, struct file *file)
 {
 	struct  video_device *vfl = video_devdata(file);
 	
diff --git a/drivers/media/video/w9966.c b/drivers/media/video/w9966.c
index 4c0a5bfb2..4ab1267e1 100644
--- a/drivers/media/video/w9966.c
+++ b/drivers/media/video/w9966.c
@@ -179,7 +179,7 @@ static int w9966_i2c_rbyte(struct w9966_dev* cam);
 
 static int w9966_v4l_ioctl(struct inode *inode, struct file *file,
 			   unsigned int cmd, unsigned long arg);
-static ssize_t w9966_v4l_read(struct file *file, char *buf,
+static ssize_t w9966_v4l_read(struct file *file, char __user *buf,
 			      size_t count, loff_t *ppos);
 
 static struct file_operations w9966_fops = {
@@ -555,6 +555,14 @@ static inline void w9966_i2c_setsda(struct w9966_dev* cam, int state)
 	udelay(5);
 }
 
+// Get peripheral clock line
+// Expects a claimed pdev.
+static inline int w9966_i2c_getscl(struct w9966_dev* cam)
+{
+	const unsigned char state = w9966_rReg(cam, 0x18);
+	return ((state & W9966_I2C_R_CLOCK) > 0);
+}
+
 // Sets the clock line on the i2c bus.
 // Expects a claimed pdev. -1 on error
 static inline int w9966_i2c_setscl(struct w9966_dev* cam, int state)
@@ -588,14 +596,6 @@ static inline int w9966_i2c_getsda(struct w9966_dev* cam)
 	return ((state & W9966_I2C_R_DATA) > 0);
 }
 
-// Get peripheral clock line
-// Expects a claimed pdev.
-static inline int w9966_i2c_getscl(struct w9966_dev* cam)
-{
-	const unsigned char state = w9966_rReg(cam, 0x18);
-	return ((state & W9966_I2C_R_CLOCK) > 0);
-}
-
 // Write a byte with ack to the i2c bus.
 // Expects a claimed pdev. -1 on error
 static int w9966_i2c_wbyte(struct w9966_dev* cam, int data)
@@ -867,13 +867,13 @@ static int w9966_v4l_ioctl(struct inode *inode, struct file *file,
 }
 
 // Capture data
-static ssize_t w9966_v4l_read(struct file *file, char *buf,
+static ssize_t w9966_v4l_read(struct file *file, char  __user *buf,
 			      size_t count, loff_t *ppos)
 {
 	struct video_device *vdev = video_devdata(file);
 	struct w9966_dev *cam = (struct w9966_dev *)vdev->priv;
 	unsigned char addr = 0xa0;	// ECP, read, CCD-transfer, 00000
-	unsigned char* dest = (unsigned char*)buf;
+	unsigned char __user *dest = (unsigned char __user *)buf;
 	unsigned long dleft = count;
 	unsigned char *tbuf;
 	
diff --git a/drivers/media/video/zoran_driver.c b/drivers/media/video/zoran_driver.c
index 6785211e0..28f1a8d05 100644
--- a/drivers/media/video/zoran_driver.c
+++ b/drivers/media/video/zoran_driver.c
@@ -424,17 +424,15 @@ v4l_fbuffer_alloc (struct file *file)
 						ZR_DEVNAME(zr), size >> 10);
 					return -ENOBUFS;
 				}
-				fh->v4l_buffers.buffer[0].fbuffer = 0;
-				fh->v4l_buffers.buffer[0].fbuffer_phys =
-				    pmem;
-				fh->v4l_buffers.buffer[0].fbuffer_bus =
-				    pmem;
+				fh->v4l_buffers.buffer[0].fbuffer = NULL;
+				fh->v4l_buffers.buffer[0].fbuffer_phys = pmem;
+				fh->v4l_buffers.buffer[0].fbuffer_bus = pmem;
 				dprintk(4,
 					KERN_INFO
 					"%s: v4l_fbuffer_alloc() - using %d KB high memory\n",
 					ZR_DEVNAME(zr), size >> 10);
 			} else {
-				fh->v4l_buffers.buffer[i].fbuffer = 0;
+				fh->v4l_buffers.buffer[i].fbuffer = NULL;
 				fh->v4l_buffers.buffer[i].fbuffer_phys =
 				    pmem + i * fh->v4l_buffers.buffer_size;
 				fh->v4l_buffers.buffer[i].fbuffer_bus =
@@ -1472,7 +1470,7 @@ zoran_close (struct inode *inode,
 
 static ssize_t
 zoran_read (struct file *file,
-	    char        *data,
+	    char        __user *data,
 	    size_t       count,
 	    loff_t      *ppos)
 {
@@ -1483,7 +1481,7 @@ zoran_read (struct file *file,
 
 static ssize_t
 zoran_write (struct file *file,
-	     const char  *data,
+	     const char  __user *data,
 	     size_t       count,
 	     loff_t      *ppos)
 {
@@ -1569,9 +1567,9 @@ setup_window (struct file       *file,
 	      int                y,
 	      int                width,
 	      int                height,
-	      struct video_clip *clips,
+	      struct video_clip __user *clips,
 	      int                clipcount,
-	      void              *bitmap)
+	      void              __user *bitmap)
 {
 	struct zoran_fh *fh = file->private_data;
 	struct zoran *zr = fh->zr;
@@ -2873,7 +2871,7 @@ zoran_do_ioctl (struct inode *inode,
 					 fmt->fmt.win.w.top,
 					 fmt->fmt.win.w.width,
 					 fmt->fmt.win.w.height,
-					 (struct video_clip *)
+					 (struct video_clip __user *)
 					   fmt->fmt.win.clips,
 					 fmt->fmt.win.clipcount,
 					 fmt->fmt.win.bitmap);
diff --git a/drivers/media/video/zoran_procfs.c b/drivers/media/video/zoran_procfs.c
index 703d6bf8e..f0d9b13c3 100644
--- a/drivers/media/video/zoran_procfs.c
+++ b/drivers/media/video/zoran_procfs.c
@@ -40,6 +40,7 @@
 #include <linux/videodev.h>
 #include <linux/spinlock.h>
 #include <linux/sem.h>
+#include <linux/seq_file.h>
 
 #include <linux/ctype.h>
 #include <asm/io.h>
@@ -93,14 +94,6 @@ static const struct procfs_params_zr36067 zr67[] = {
 	{NULL, 0, 0, 0},
 };
 
-struct procfs_io {
-	char *buffer;
-	char *end;
-	int neof;
-	int count;
-	int count_current;
-};
-
 static void
 setparam (struct zoran *zr,
 	  char         *name,
@@ -130,85 +123,34 @@ setparam (struct zoran *zr,
 	}
 }
 
-static int
-print_procfs (struct procfs_io *io,
-	      const char       *fmt,
-	      ...)
-{
-	va_list args;
-	int i;
-
-	if (io->buffer >= io->end) {
-		io->neof++;
-		return 0;
-	}
-	if (io->count > io->count_current++)
-		return 0;
-	va_start(args, fmt);
-	i = vsprintf(io->buffer, fmt, args);
-	io->buffer += i;
-	va_end(args);
-	return i;
-}
-
-static void
-zoran_procfs_output (struct procfs_io *io,
-		     void             *data)
+static int zoran_show(struct seq_file *p, void *v)
 {
+	struct zoran *zr = p->private;
 	int i;
-	struct zoran *zr;
-	zr = (struct zoran *) data;
 
-	print_procfs(io, "ZR36067 registers:");
-	for (i = 0; i < 0x130; i += 4) {
-		if (!(i % 16)) {
-			print_procfs(io, "\n%03X", i);
-		};
-		print_procfs(io, " %08X ", btread(i));
-	};
-	print_procfs(io, "\n");
+	seq_printf(p, "ZR36067 registers:\n");
+	for (i = 0; i < 0x130; i += 16)
+		seq_printf(p, "%03X %08X  %08X  %08X  %08X \n", i,
+			   btread(i), btread(i+4), btread(i+8), btread(i+12));
+	return 0;
 }
 
-static int
-zoran_read_proc (char  *buffer,
-		 char **start,
-		 off_t  offset,
-		 int    size,
-		 int   *eof,
-		 void  *data)
+static int zoran_open(struct inode *inode, struct file *file)
 {
-	struct procfs_io io;
-	int nbytes;
-
-	io.buffer = buffer;
-	io.end = buffer + size - 128;	// Just to make it a little bit safer
-	io.count = offset;
-	io.count_current = 0;
-	io.neof = 0;
-	zoran_procfs_output(&io, data);
-	*start = (char *) (io.count_current - io.count);
-	nbytes = (int) (io.buffer - buffer);
-	*eof = !io.neof;
-	return nbytes;
-
-	return 0;
+	struct zoran *data = PDE(inode)->data;
+	return single_open(file, zoran_show, data);
 }
 
-static int
-zoran_write_proc (struct file   *file,
-		  const char    *buffer,
-		  unsigned long  count,
-		  void          *data)
+static ssize_t zoran_write(struct file *file, const char __user *buffer,
+			size_t count, loff_t *ppos)
 {
+	struct zoran *zr = PDE(file->f_dentry->d_inode)->data;
 	char *string, *sp;
 	char *line, *ldelim, *varname, *svar, *tdelim;
-	struct zoran *zr;
 
 	if (count > 32768)	/* Stupidity filter */
 		return -EINVAL;
 
-	zr = (struct zoran *) data;
-
 	string = sp = vmalloc(count + 1);
 	if (!string) {
 		dprintk(1,
@@ -222,8 +164,8 @@ zoran_write_proc (struct file   *file,
 		return -EFAULT;
 	}
 	string[count] = 0;
-	dprintk(4, KERN_INFO "%s: write_proc: name=%s count=%lu data=%x\n",
-		ZR_DEVNAME(zr), file->f_dentry->d_name.name, count, (int) data);
+	dprintk(4, KERN_INFO "%s: write_proc: name=%s count=%zu zr=%p\n",
+		ZR_DEVNAME(zr), file->f_dentry->d_name.name, count, zr);
 	ldelim = " \t\n";
 	tdelim = "=";
 	line = strpbrk(sp, ldelim);
@@ -243,6 +185,14 @@ zoran_write_proc (struct file   *file,
 
 	return count;
 }
+
+static struct file_operations zoran_operations = {
+	.open		= zoran_open,
+	.read		= seq_read,
+	.write		= zoran_write,
+	.llseek		= seq_lseek,
+	.release	= single_release,
+};
 #endif
 
 int
@@ -252,11 +202,10 @@ zoran_proc_init (struct zoran *zr)
 	char name[8];
 
 	snprintf(name, 7, "zoran%d", zr->id);
-	if ((zr->zoran_proc = create_proc_entry(name, 0, 0))) {
-		zr->zoran_proc->read_proc = zoran_read_proc;
-		zr->zoran_proc->write_proc = zoran_write_proc;
+	if ((zr->zoran_proc = create_proc_entry(name, 0, NULL))) {
 		zr->zoran_proc->data = zr;
 		zr->zoran_proc->owner = THIS_MODULE;
+		zr->zoran_proc->proc_fops = &zoran_operations;
 		dprintk(2,
 			KERN_INFO
 			"%s: procfs entry /proc/%s allocated. data=%p\n",
@@ -277,9 +226,8 @@ zoran_proc_cleanup (struct zoran *zr)
 	char name[8];
 
 	snprintf(name, 7, "zoran%d", zr->id);
-	if (zr->zoran_proc) {
-		remove_proc_entry(name, 0);
-	}
+	if (zr->zoran_proc)
+		remove_proc_entry(name, NULL);
 	zr->zoran_proc = NULL;
 #endif
 }
diff --git a/drivers/message/fusion/isense.c b/drivers/message/fusion/isense.c
index 5933adff1..53b5a0f22 100644
--- a/drivers/message/fusion/isense.c
+++ b/drivers/message/fusion/isense.c
@@ -56,14 +56,6 @@
 #include <linux/errno.h>
 #include <linux/init.h>
 #include <asm/io.h>
-#if defined (__sparc__)
-#include <linux/timer.h>
-#endif
-
-/* Hmmm, avoid undefined spinlock_t on lk-2.2.14-5.0 */
-#if LINUX_VERSION_CODE < KERNEL_VERSION(2,3,0)
-#include <asm/spinlock.h>
-#endif
 
 #define MODULEAUTHOR "Steven J. Ralston"
 #define COPYRIGHT "Copyright (c) 2001-2004 " MODULEAUTHOR
diff --git a/drivers/message/fusion/linux_compat.h b/drivers/message/fusion/linux_compat.h
index 37b761862..048b5b861 100644
--- a/drivers/message/fusion/linux_compat.h
+++ b/drivers/message/fusion/linux_compat.h
@@ -2,196 +2,17 @@
 
 #ifndef FUSION_LINUX_COMPAT_H
 #define FUSION_LINUX_COMPAT_H
-/*{-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=*/
 
 #include <linux/version.h>
-#include <linux/config.h>
-#include <linux/kernel.h>
-#include <linux/pci.h>
+#include <scsi/scsi_device.h>
 
-/*=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=*/
-
-#ifndef rwlock_init
-#define rwlock_init(x) do { *(x) = RW_LOCK_UNLOCKED; } while(0)
-#endif
-
-#define SET_NICE(current,x) do {(current)->nice = (x);} while (0)
-
-#if LINUX_VERSION_CODE < KERNEL_VERSION(2,3,0)
-#	if LINUX_VERSION_CODE < KERNEL_VERSION(2,2,18)
-		typedef unsigned int dma_addr_t;
-#	endif
-#else
-#	if LINUX_VERSION_CODE < KERNEL_VERSION(2,3,42)
-		typedef unsigned int dma_addr_t;
-#	endif
-#endif
-
-#if LINUX_VERSION_CODE < KERNEL_VERSION(2,2,18)
-/*{-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=*/
-
-/* This block snipped from lk-2.2.18/include/linux/init.h { */
-/*
- * Used for initialization calls..
- */
-typedef int (*initcall_t)(void);
-typedef void (*exitcall_t)(void);
-
-#define __init_call	__attribute__ ((unused,__section__ (".initcall.init")))
-#define __exit_call	__attribute__ ((unused,__section__ (".exitcall.exit")))
-
-extern initcall_t __initcall_start, __initcall_end;
-
-#define __initcall(fn)								\
-	static initcall_t __initcall_##fn __init_call = fn
-#define __exitcall(fn)								\
-	static exitcall_t __exitcall_##fn __exit_call = fn
-
-#ifdef MODULE
-/* These macros create a dummy inline: gcc 2.9x does not count alias
- as usage, hence the `unused function' warning when __init functions
- are declared static. We use the dummy __*_module_inline functions
- both to kill the warning and check the type of the init/cleanup
- function. */
-typedef int (*__init_module_func_t)(void);
-typedef void (*__cleanup_module_func_t)(void);
-#define module_init(x) \
-	int init_module(void) __attribute__((alias(#x))); \
-	static inline __init_module_func_t __init_module_inline(void) \
-	{ return x; }
-#define module_exit(x) \
-	void cleanup_module(void) __attribute__((alias(#x))); \
-	static inline __cleanup_module_func_t __cleanup_module_inline(void) \
-	{ return x; }
-
-#else
-#define module_init(x)	__initcall(x);
-#define module_exit(x)	__exitcall(x);
-#endif
-/* } block snipped from lk-2.2.18/include/linux/init.h */
-
-/* This block snipped from lk-2.2.18/include/linux/sched.h { */
-/*
- * Used prior to schedule_timeout calls..
- */
-#define __set_current_state(state_value)	do { current->state = state_value; } while (0)
-#ifdef CONFIG_SMP
-#define set_current_state(state_value)		do { __set_current_state(state_value); mb(); } while (0)
-#else
-#define set_current_state(state_value)		__set_current_state(state_value)
-#endif
-/* } block snipped from lk-2.2.18/include/linux/sched.h */
-
-/* procfs compat stuff... */
-#define proc_mkdir(x,y)			create_proc_entry(x, S_IFDIR, y)
-
-/* MUTEX compat stuff... */
-#define DECLARE_MUTEX(name)		struct semaphore name=MUTEX
-#define DECLARE_MUTEX_LOCKED(name)	struct semaphore name=MUTEX_LOCKED
-#define init_MUTEX(x)			*(x)=MUTEX
-#define init_MUTEX_LOCKED(x)		*(x)=MUTEX_LOCKED
-
-/* Wait queues. */
-#define DECLARE_WAIT_QUEUE_HEAD(name)	\
-	struct wait_queue * (name) = NULL
-#define DECLARE_WAITQUEUE(name, task)	\
-	struct wait_queue (name) = { (task), NULL }
-
-#if defined(__sparc__) && defined(__sparc_v9__)
-/* The sparc64 ioremap implementation is wrong in 2.2.x,
- * but fixing it would break all of the drivers which
- * workaround it.  Fixed in 2.3.x onward. -DaveM
- */
-#define ARCH_IOREMAP(base)	((unsigned long) (base))
-#else
-#define ARCH_IOREMAP(base)	ioremap(base)
-#endif
-
-/*=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=*/
-#else		/* LINUX_VERSION_CODE must be >= KERNEL_VERSION(2,2,18) */
-
-/* No ioremap bugs in >2.3.x kernels. */
-#define ARCH_IOREMAP(base)	ioremap(base)
-
-/*}-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=*/
-#endif		/* LINUX_VERSION_CODE < KERNEL_VERSION(2,2,18) */
-
-
-/*
- * Inclined to use:
- *   #if LINUX_VERSION_CODE < KERNEL_VERSION(2,4,10)
- * here, but MODULE_LICENSE defined in 2.4.9-6 and 2.4.9-13
- * breaks the rule:-(
- */
-#ifndef MODULE_LICENSE
-#define MODULE_LICENSE(license)
-#endif
-
-
-/* PCI/driver subsystem { */
-#define PCI_BASEADDR_FLAGS(idx)         resource[idx].flags
-#define PCI_BASEADDR_START(idx)         resource[idx].start
-#define PCI_BASEADDR_SIZE(dev,idx)      (dev)->resource[idx].end - (dev)->resource[idx].start + 1
-
-/* Compatability for the 2.3.x PCI DMA API. */
-#ifndef PCI_DMA_BIDIRECTIONAL
-/*{-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=*/
-
-#define PCI_DMA_BIDIRECTIONAL	0
-#define PCI_DMA_TODEVICE	1
-#define PCI_DMA_FROMDEVICE	2
-#define PCI_DMA_NONE		3
-
-#ifdef __KERNEL__
-#include <asm/page.h>
-/* Pure 2^n version of get_order */
-static __inline__ int __get_order(unsigned long size)
+#if (LINUX_VERSION_CODE < KERNEL_VERSION(2,6,6))
+static int inline scsi_device_online(struct scsi_device *sdev)
 {
-	int order;
-
-	size = (size-1) >> (PAGE_SHIFT-1);
-	order = -1;
-	do {
-		size >>= 1;
-		order++;
-	} while (size);
-	return order;
+	return sdev->online;
 }
 #endif
 
-#define pci_alloc_consistent(hwdev, size, dma_handle) \
-({	void *__ret = (void *)__get_free_pages(GFP_ATOMIC, __get_order(size)); \
-	if (__ret != NULL) { \
-		memset(__ret, 0, size); \
-		*(dma_handle) = virt_to_bus(__ret); \
-	} \
-	__ret; \
-})
-
-#define pci_free_consistent(hwdev, size, vaddr, dma_handle) \
-	free_pages((unsigned long)vaddr, __get_order(size))
-
-#define pci_map_single(hwdev, ptr, size, direction) \
-	virt_to_bus(ptr);
-
-#define pci_unmap_single(hwdev, dma_addr, size, direction) \
-	do { /* Nothing to do */ } while (0)
-
-#define pci_map_sg(hwdev, sg, nents, direction)	(nents)
-#define pci_unmap_sg(hwdev, sg, nents, direction) \
-	do { /* Nothing to do */ } while(0)
-
-#define sg_dma_address(sg)	(virt_to_bus((sg)->address))
-#define sg_dma_len(sg)		((sg)->length)
-
-/*}-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=*/
-#endif /* PCI_DMA_BIDIRECTIONAL */
-
-
-#define mpt_work_struct work_struct
-#define MPT_INIT_WORK(_task, _func, _data) INIT_WORK(_task, _func, _data)
-#define mpt_sync_irq(_irq) synchronize_irq(_irq)
 
 /*}-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=*/
 #endif /* _LINUX_COMPAT_H */
-
diff --git a/drivers/message/fusion/lsi/mpi_type.h b/drivers/message/fusion/lsi/mpi_type.h
index 755732c47..239328a76 100644
--- a/drivers/message/fusion/lsi/mpi_type.h
+++ b/drivers/message/fusion/lsi/mpi_type.h
@@ -47,18 +47,13 @@ typedef signed   short  S16;
 typedef unsigned short  U16;
 
 
-#if defined(unix) || defined(__arm) || defined(ALPHA)
-
-    typedef signed   int   S32;
-    typedef unsigned int   U32;
-
-#else
-
-    typedef signed   long  S32;
-    typedef unsigned long  U32;
-
-#endif
+typedef int32_t   S32;
+typedef u_int32_t U32;
 
+/*
+ *  The only way crap below could work on big-endian boxen would be if it
+ *  wasn't used at all.
+ */
 
 typedef struct _S64
 {
diff --git a/drivers/message/fusion/mptbase.c b/drivers/message/fusion/mptbase.c
index fba96eb6d..75c07f89e 100644
--- a/drivers/message/fusion/mptbase.c
+++ b/drivers/message/fusion/mptbase.c
@@ -150,9 +150,8 @@ int mpt_ASCQ_TableSz;
 /*
  *  Private data...
  */
-					/* Adapter lookup table */
-       MPT_ADAPTER		*mpt_adapters[MPT_MAX_ADAPTERS];
-static MPT_ADAPTER_TRACKER	 MptAdapters;
+					/* Adapter link list */
+LIST_HEAD(ioc_list);
 					/* Callback lookup table */
 static MPT_CALLBACK		 MptCallbacks[MPT_MAX_PROTOCOL_DRIVERS];
 					/* Protocol driver class lookup table */
@@ -210,8 +209,6 @@ static int	SendEventNotification(MPT_ADAPTER *ioc, u8 EvSwitch);
 static int	SendEventAck(MPT_ADAPTER *ioc, EventNotificationReply_t *evnp);
 
 #ifdef CONFIG_PROC_FS
-static int	procmpt_create(void);
-static int	procmpt_destroy(void);
 static int	procmpt_summary_read(char *buf, char **start, off_t offset,
 				int request, int *eof, void *data);
 static int	procmpt_version_read(char *buf, char **start, off_t offset,
@@ -234,31 +231,6 @@ static void mptbase_shutdown(struct device * );
 static int  __init    fusion_init  (void);
 static void __exit    fusion_exit  (void);
 
-/*=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=*/
-/*
- *  more Private data...
- */
-#ifdef CONFIG_PROC_FS
-struct _mpt_proc_list {
-	const char	*name;
-	int		(*f)(char *, char **, off_t, int, int *, void *);
-} mpt_proc_list[] = {
-	{ "summary", procmpt_summary_read},
-	{ "version", procmpt_version_read},
-};
-#define MPT_PROC_ENTRIES (sizeof(mpt_proc_list)/sizeof(mpt_proc_list[0]))
-
-struct _mpt_ioc_proc_list {
-	const char	*name;
-	int		(*f)(char *, char **, off_t, int, int *, void *);
-} mpt_ioc_proc_list[] = {
-	{ "info", procmpt_iocinfo_read},
-	{ "summary", procmpt_summary_read},
-};
-#define MPT_IOC_PROC_ENTRIES (sizeof(mpt_ioc_proc_list)/sizeof(mpt_ioc_proc_list[0]))
-
-#endif
-
 /****************************************************************************
  * Supported hardware
  */
@@ -282,7 +254,8 @@ static struct pci_device_id mptbase_pci_table[] = {
 };
 MODULE_DEVICE_TABLE(pci, mptbase_pci_table);
 
-#define CHIPREG_READ32(addr) 		readl(addr)
+#define CHIPREG_READ32(addr) 		readl_relaxed(addr)
+#define CHIPREG_READ32_dmasync(addr)	readl(addr)
 #define CHIPREG_WRITE32(addr,val) 	writel(val, addr)
 #define CHIPREG_PIO_WRITE32(addr,val)	outl(val, (unsigned long)addr)
 #define CHIPREG_PIO_READ32(addr) 	inl((unsigned long)addr)
@@ -320,23 +293,6 @@ mpt_interrupt(int irq, void *bus_id, struct pt_regs *r)
 
 	ioc = bus_id;
 
-#ifdef MPT_DEBUG_IRQ
-	/*
-	 * Verify ioc pointer is ok
-	 */
-	{
-		MPT_ADAPTER	*iocCmp;
-		iocCmp = mpt_adapter_find_first();
-		while ((ioc != iocCmp)  && iocCmp)
-			iocCmp = mpt_adapter_find_next(iocCmp);
-
-		if (!iocCmp) {
-			printk(KERN_WARNING "mpt_interrupt: Invalid ioc!\n");
-			return IRQ_NONE;
-		}
-	}
-#endif
-
 	/*
 	 *  Drain the reply FIFO!
 	 *
@@ -347,7 +303,7 @@ mpt_interrupt(int irq, void *bus_id, struct pt_regs *r)
 	 */
 	while (1) {
 
-		if ((pa = CHIPREG_READ32(&ioc->chip->ReplyFifo)) == 0xFFFFFFFF)
+		if ((pa = CHIPREG_READ32_dmasync(&ioc->chip->ReplyFifo)) == 0xFFFFFFFF)
 			return IRQ_HANDLED;
 
 		cb_idx = 0;
@@ -806,8 +762,7 @@ mpt_device_driver_register(struct mpt_pci_driver * dd_cbfunc, int cb_idx)
 	MptDeviceDriverHandlers[cb_idx] = dd_cbfunc;
 
 	/* call per pci device probe entry point */
-	for(ioc = mpt_adapter_find_first(); ioc != NULL;
-	  ioc = mpt_adapter_find_next(ioc)) {
+	list_for_each_entry(ioc, &ioc_list, list) {
 		if(dd_cbfunc->probe) {
 			error = dd_cbfunc->probe(ioc->pcidev,
 			  ioc->pcidev->driver->id_table);
@@ -826,9 +781,19 @@ mpt_device_driver_register(struct mpt_pci_driver * dd_cbfunc, int cb_idx)
 void
 mpt_device_driver_deregister(int cb_idx)
 {
+	struct mpt_pci_driver *dd_cbfunc;
+	MPT_ADAPTER	*ioc;
+
 	if (cb_idx < 1 || cb_idx >= MPT_MAX_PROTOCOL_DRIVERS)
 		return;
 
+	dd_cbfunc = MptDeviceDriverHandlers[cb_idx];
+
+	list_for_each_entry(ioc, &ioc_list, list) {
+		if (dd_cbfunc->remove)
+			dd_cbfunc->remove(ioc->pcidev);
+	}
+	
 	MptDeviceDriverHandlers[cb_idx] = NULL;
 }
 
@@ -844,15 +809,11 @@ mpt_device_driver_deregister(int cb_idx)
  *	or IOC is not active.
  */
 MPT_FRAME_HDR*
-mpt_get_msg_frame(int handle, int iocid)
+mpt_get_msg_frame(int handle, MPT_ADAPTER *iocp)
 {
 	MPT_FRAME_HDR *mf;
-	MPT_ADAPTER *iocp;
 	unsigned long flags;
 
-	/* validate handle and ioc identifier */
-	iocp = mpt_adapters[iocid];
-
 #ifdef MFCNT
 	if (!iocp->active)
 		printk(KERN_WARNING "IOC Not Active! mpt_get_msg_frame returning NULL!\n");
@@ -907,48 +868,39 @@ mpt_get_msg_frame(int handle, int iocid)
  *	specific MPT adapter.
  */
 void
-mpt_put_msg_frame(int handle, int iocid, MPT_FRAME_HDR *mf)
+mpt_put_msg_frame(int handle, MPT_ADAPTER *iocp, MPT_FRAME_HDR *mf)
 {
-	MPT_ADAPTER *iocp;
-
-	iocp = mpt_adapters[iocid];
-	if (iocp != NULL) {
-		u32 mf_dma_addr;
-		int req_offset;
+	u32 mf_dma_addr;
+	int req_offset;
 
-		/* ensure values are reset properly! */
-		mf->u.frame.hwhdr.msgctxu.fld.cb_idx = handle;		/* byte */
-		req_offset = (u8 *)mf - (u8 *)iocp->req_frames;
+	/* ensure values are reset properly! */
+	mf->u.frame.hwhdr.msgctxu.fld.cb_idx = handle;		/* byte */
+	req_offset = (u8 *)mf - (u8 *)iocp->req_frames;
 									/* u16! */
-		mf->u.frame.hwhdr.msgctxu.fld.req_idx = cpu_to_le16(req_offset / iocp->req_sz);
-		mf->u.frame.hwhdr.msgctxu.fld.rsvd = 0;
+	mf->u.frame.hwhdr.msgctxu.fld.req_idx = cpu_to_le16(req_offset / iocp->req_sz);
+	mf->u.frame.hwhdr.msgctxu.fld.rsvd = 0;
 
 #ifdef MPT_DEBUG_MSG_FRAME
-		{
-			u32	*m = mf->u.frame.hwhdr.__hdr;
-			int	 ii, n;
-
-			printk(KERN_INFO MYNAM ": %s: About to Put msg frame @ %p:\n" KERN_INFO " ",
-					iocp->name, m);
-			n = iocp->req_sz/4 - 1;
-			while (m[n] == 0)
-				n--;
-			for (ii=0; ii<=n; ii++) {
-				if (ii && ((ii%8)==0))
-					printk("\n" KERN_INFO " ");
-				printk(" %08x", le32_to_cpu(m[ii]));
-			}
-			printk("\n");
+	{
+		u32	*m = mf->u.frame.hwhdr.__hdr;
+		int	 ii, n;
+
+		printk(KERN_INFO MYNAM ": %s: About to Put msg frame @ %p:\n" KERN_INFO " ",
+				iocp->name, m);
+		n = iocp->req_sz/4 - 1;
+		while (m[n] == 0)
+			n--;
+		for (ii=0; ii<=n; ii++) {
+			if (ii && ((ii%8)==0))
+				printk("\n" KERN_INFO " ");
+			printk(" %08x", le32_to_cpu(m[ii]));
 		}
-#endif
-
-		mf_dma_addr = iocp->req_frames_low_dma + req_offset;
-		CHIPREG_WRITE32(&iocp->chip->RequestFifo, mf_dma_addr);
-	} else {
-		printk (KERN_ERR
-		    "mpt_put_msg_frame: Invalid iocid=%d\n", iocid);
+		printk("\n");
 	}
+#endif
 
+	mf_dma_addr = iocp->req_frames_low_dma + req_offset;
+	CHIPREG_WRITE32(&iocp->chip->RequestFifo, mf_dma_addr);
 }
 
 /*=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=*/
@@ -962,21 +914,17 @@ mpt_put_msg_frame(int handle, int iocid, MPT_FRAME_HDR *mf)
  *	FreeQ.
  */
 void
-mpt_free_msg_frame(int handle, int iocid, MPT_FRAME_HDR *mf)
+mpt_free_msg_frame(int handle, MPT_ADAPTER *iocp, MPT_FRAME_HDR *mf)
 {
-	MPT_ADAPTER *iocp;
 	unsigned long flags;
 
-	iocp = mpt_adapters[iocid];
-	if (iocp != NULL) {
-		/*  Put Request back on FreeQ!  */
-		spin_lock_irqsave(&iocp->FreeQlock, flags);
-		Q_ADD_TAIL(&iocp->FreeQ, &mf->u.frame.linkage, MPT_FRAME_HDR);
+	/*  Put Request back on FreeQ!  */
+	spin_lock_irqsave(&iocp->FreeQlock, flags);
+	Q_ADD_TAIL(&iocp->FreeQ, &mf->u.frame.linkage, MPT_FRAME_HDR);
 #ifdef MFCNT
-		iocp->mfcnt--;
+	iocp->mfcnt--;
 #endif
-		spin_unlock_irqrestore(&iocp->FreeQlock, flags);
-	}
+	spin_unlock_irqrestore(&iocp->FreeQlock, flags);
 }
 
 /*=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=*/
@@ -1062,127 +1010,80 @@ mpt_add_chain(char *pAddr, u8 next, u16 length, dma_addr_t dma_addr)
  *	Returns 0 for success, non-zero for failure.
  */
 int
-mpt_send_handshake_request(int handle, int iocid, int reqBytes, u32 *req, int sleepFlag)
+mpt_send_handshake_request(int handle, MPT_ADAPTER *iocp, int reqBytes, u32 *req, int sleepFlag)
 {
-	MPT_ADAPTER	*iocp;
 	int		 r = 0;
+	u8	*req_as_bytes;
+	int	 ii;
 
-	iocp = mpt_adapters[iocid];
-	if (iocp != NULL) {
-		u8	*req_as_bytes;
-		int	 ii;
-
-		/* State is known to be good upon entering
-		 * this function so issue the bus reset
-		 * request.
-		 */
-
-		/*
-		 * Emulate what mpt_put_msg_frame() does /wrt to sanity
-		 * setting cb_idx/req_idx.  But ONLY if this request
-		 * is in proper (pre-alloc'd) request buffer range...
-		 */
-		ii = MFPTR_2_MPT_INDEX(iocp,(MPT_FRAME_HDR*)req);
-		if (reqBytes >= 12 && ii >= 0 && ii < iocp->req_depth) {
-			MPT_FRAME_HDR *mf = (MPT_FRAME_HDR*)req;
-			mf->u.frame.hwhdr.msgctxu.fld.req_idx = cpu_to_le16(ii);
-			mf->u.frame.hwhdr.msgctxu.fld.cb_idx = handle;
-		}
+	/* State is known to be good upon entering
+	 * this function so issue the bus reset
+	 * request.
+	 */
 
-		/* Make sure there are no doorbells */
-		CHIPREG_WRITE32(&iocp->chip->IntStatus, 0);
+	/*
+	 * Emulate what mpt_put_msg_frame() does /wrt to sanity
+	 * setting cb_idx/req_idx.  But ONLY if this request
+	 * is in proper (pre-alloc'd) request buffer range...
+	 */
+	ii = MFPTR_2_MPT_INDEX(iocp,(MPT_FRAME_HDR*)req);
+	if (reqBytes >= 12 && ii >= 0 && ii < iocp->req_depth) {
+		MPT_FRAME_HDR *mf = (MPT_FRAME_HDR*)req;
+		mf->u.frame.hwhdr.msgctxu.fld.req_idx = cpu_to_le16(ii);
+		mf->u.frame.hwhdr.msgctxu.fld.cb_idx = handle;
+	}
 
-		CHIPREG_WRITE32(&iocp->chip->Doorbell,
-				((MPI_FUNCTION_HANDSHAKE<<MPI_DOORBELL_FUNCTION_SHIFT) |
-				 ((reqBytes/4)<<MPI_DOORBELL_ADD_DWORDS_SHIFT)));
+	/* Make sure there are no doorbells */
+	CHIPREG_WRITE32(&iocp->chip->IntStatus, 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 ((ii = WaitForDoorbellInt(iocp, 5, sleepFlag)) < 0) {
-			return ii;
-		}
+	/* Wait for IOC doorbell int */
+	ii = WaitForDoorbellInt(iocp, 5, sleepFlag);
+	if (ii < 0)
+		return ii;
 
-		/* Read doorbell and check for active bit */
-		if (!(CHIPREG_READ32(&iocp->chip->Doorbell) & MPI_DOORBELL_ACTIVE))
-				return -5;
+	/* Read doorbell and check for active bit */
+	if (!(CHIPREG_READ32(&iocp->chip->Doorbell) & MPI_DOORBELL_ACTIVE))
+		return -5;
 
-		dhsprintk((KERN_INFO MYNAM ": %s: mpt_send_handshake_request start, WaitCnt=%d\n",
-				iocp->name, ii));
+	dhsprintk((KERN_INFO MYNAM ": %s: mpt_send_handshake_request start, WaitCnt=%d\n",
+			iocp->name, ii));
 
-		CHIPREG_WRITE32(&iocp->chip->IntStatus, 0);
+	CHIPREG_WRITE32(&iocp->chip->IntStatus, 0);
 
-		if ((r = WaitForDoorbellAck(iocp, 5, sleepFlag)) < 0) {
-			return -2;
-		}
+	r = WaitForDoorbellAck(iocp, 5, sleepFlag);
+	if (r < 0)
+		return -2;
 
-		/* Send request via doorbell handshake */
-		req_as_bytes = (u8 *) req;
-		for (ii = 0; ii < reqBytes/4; ii++) {
-			u32 word;
-
-			word = ((req_as_bytes[(ii*4) + 0] <<  0) |
-				(req_as_bytes[(ii*4) + 1] <<  8) |
-				(req_as_bytes[(ii*4) + 2] << 16) |
-				(req_as_bytes[(ii*4) + 3] << 24));
-			CHIPREG_WRITE32(&iocp->chip->Doorbell, word);
-			if ((r = WaitForDoorbellAck(iocp, 5, sleepFlag)) < 0) {
-				r = -3;
-				break;
-			}
+	/* Send request via doorbell handshake */
+	req_as_bytes = (u8 *) req;
+	for (ii = 0; ii < reqBytes/4; ii++) {
+		u32 word;
+
+		word = ((req_as_bytes[(ii*4) + 0] <<  0) |
+			(req_as_bytes[(ii*4) + 1] <<  8) |
+			(req_as_bytes[(ii*4) + 2] << 16) |
+			(req_as_bytes[(ii*4) + 3] << 24));
+		CHIPREG_WRITE32(&iocp->chip->Doorbell, word);
+		r = WaitForDoorbellAck(iocp, 5, sleepFlag);
+		if (r < 0) {
+			r = -3;
+			break;
 		}
-
-		if (r >= 0 && WaitForDoorbellInt(iocp, 10, sleepFlag) >= 0)
-			r = 0;
-		else
-			r = -4;
-
-		/* Make sure there are no doorbells */
-		CHIPREG_WRITE32(&iocp->chip->IntStatus, 0);
 	}
 
-	return r;
-}
-
-/*=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=*/
-/**
- *	mpt_adapter_find_first - Find first MPT adapter pointer.
- *
- *	Returns first MPT adapter pointer or %NULL if no MPT adapters
- *	are present.
- */
-MPT_ADAPTER *
-mpt_adapter_find_first(void)
-{
-	MPT_ADAPTER *this;
-
-	if (! Q_IS_EMPTY(&MptAdapters))
-		this = MptAdapters.head;
+	if (r >= 0 && WaitForDoorbellInt(iocp, 10, sleepFlag) >= 0)
+		r = 0;
 	else
-		this = NULL;
+		r = -4;
 
-	return this;
-}
-
-/*=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=*/
-/**
- *	mpt_adapter_find_next - Find next MPT adapter pointer.
- *	@prev: Pointer to previous MPT adapter
- *
- *	Returns next MPT adapter pointer or %NULL if there are no more.
- */
-MPT_ADAPTER *
-mpt_adapter_find_next(MPT_ADAPTER *prev)
-{
-	MPT_ADAPTER *next;
-
-	if (prev && (prev->forw != (MPT_ADAPTER*)&MptAdapters.head))
-		next = prev->forw;
-	else
-		next = NULL;
-
-	return next;
+	/* Make sure there are no doorbells */
+	CHIPREG_WRITE32(&iocp->chip->IntStatus, 0);
+	return r;
 }
 
-
 /*=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=*/
 /**
  *	mpt_verify_adapter - Given a unique IOC identifier, set pointer to
@@ -1195,18 +1096,17 @@ mpt_adapter_find_next(MPT_ADAPTER *prev)
 int
 mpt_verify_adapter(int iocid, MPT_ADAPTER **iocpp)
 {
-	MPT_ADAPTER *p;
+	MPT_ADAPTER *ioc;
 
+	list_for_each_entry(ioc,&ioc_list,list) {
+		if (ioc->id == iocid) {
+			*iocpp =ioc;
+			return iocid;
+		} 
+	}
+	
 	*iocpp = NULL;
-	if (iocid >= MPT_MAX_ADAPTERS)
-		return -1;
-
-	p = mpt_adapters[iocid];
-	if (p == NULL)
-		return -1;
-
-	*iocpp = p;
-	return iocid;
+	return -1;
 }
 
 /*=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=*/
@@ -1240,6 +1140,8 @@ mptbase_probe(struct pci_dev *pdev, const struct pci_device_id *id)
 	u64		 mask = 0xffffffffffffffffULL;
 	u8		 revision;
 	u8		 pcixcmd;
+	static int	 mpt_ids = 0;
+	struct proc_dir_entry *dent, *ent;
 
 	if (pci_enable_device(pdev))
 		return r;
@@ -1296,29 +1198,20 @@ mptbase_probe(struct pci_dev *pdev, const struct pci_device_id *id)
 	Q_INIT(&ioc->configQ, Q_ITEM);
 
 	/* Find lookup slot. */
-	for (ii=0; ii < MPT_MAX_ADAPTERS; ii++) {
-		if (mpt_adapters[ii] == NULL) {
-			ioc->id = ii;		/* Assign adapter unique id (lookup) */
-			break;
-		}
-	}
-	if (ii == MPT_MAX_ADAPTERS) {
-		printk(KERN_ERR MYNAM ": ERROR - mpt_adapters[%d] table overflow!\n", ii);
-		kfree(ioc);
-		return -ENFILE;
-	}
-
+	INIT_LIST_HEAD(&ioc->list);
+	ioc->id = mpt_ids++;
+	
 	mem_phys = msize = 0;
 	port = psize = 0;
 	for (ii=0; ii < DEVICE_COUNT_RESOURCE; ii++) {
-		if (pdev->PCI_BASEADDR_FLAGS(ii) & PCI_BASE_ADDRESS_SPACE_IO) {
+		if (pci_resource_flags(pdev, ii) & PCI_BASE_ADDRESS_SPACE_IO) {
 			/* Get I/O space! */
-			port = pdev->PCI_BASEADDR_START(ii);
-			psize = PCI_BASEADDR_SIZE(pdev,ii);
+			port = pci_resource_start(pdev, ii);
+			psize = pci_resource_len(pdev,ii);
 		} else {
 			/* Get memmap */
-			mem_phys = pdev->PCI_BASEADDR_START(ii);
-			msize = PCI_BASEADDR_SIZE(pdev,ii);
+			mem_phys = pci_resource_start(pdev, ii);
+			msize = pci_resource_len(pdev,ii);
 			break;
 		}
 	}
@@ -1429,11 +1322,8 @@ mptbase_probe(struct pci_dev *pdev, const struct pci_device_id *id)
 	ioc->active = 0;
 	CHIPREG_WRITE32(&ioc->chip->IntStatus, 0);
 
-	/* tack onto tail of our MPT adapter list */
-	Q_ADD_TAIL(&MptAdapters, ioc, MPT_ADAPTER);
-
 	/* Set lookup ptr. */
-	mpt_adapters[ioc->id] = ioc;
+	list_add_tail(&ioc->list, &ioc_list);
 
 	ioc->pci_irq = -1;
 	if (pdev->irq) {
@@ -1448,7 +1338,7 @@ mptbase_probe(struct pci_dev *pdev, const struct pci_device_id *id)
 					ioc->name, __irq_itoa(pdev->irq));
 #endif
 			Q_DEL_ITEM(ioc);
-			mpt_adapters[ioc->id] = NULL;
+			list_del(&ioc->list);
 			iounmap(mem);
 			kfree(ioc);
 			return -EBUSY;
@@ -1480,7 +1370,7 @@ mptbase_probe(struct pci_dev *pdev, const struct pci_device_id *id)
 		  ioc->name, r);
 
 		Q_DEL_ITEM(ioc);
-		mpt_adapters[ioc->id] = NULL;
+		list_del(&ioc->list);
 		free_irq(ioc->pci_irq, ioc);
 		iounmap(mem);
 		kfree(ioc);
@@ -1496,6 +1386,23 @@ mptbase_probe(struct pci_dev *pdev, const struct pci_device_id *id)
 		}
 	}
 
+	/*
+	 *  Create "/proc/mpt/iocN" subdirectory entry for each MPT adapter.
+	 */
+	dent = proc_mkdir(ioc->name, mpt_proc_root_dir);
+	if (dent) {
+		ent = create_proc_entry("info", S_IFREG|S_IRUGO, dent);
+		if (ent) {
+			ent->read_proc = procmpt_iocinfo_read;
+			ent->data = ioc;
+		}
+		ent = create_proc_entry("summary", S_IFREG|S_IRUGO, dent);
+		if (ent) {
+			ent->read_proc = procmpt_summary_read;
+			ent->data = ioc;
+		}
+	}
+
 	return 0;
 }
 
@@ -1510,8 +1417,16 @@ static void __devexit
 mptbase_remove(struct pci_dev *pdev)
 {
 	MPT_ADAPTER 	*ioc = pci_get_drvdata(pdev);
+	char pname[32];
 	int ii;
 
+	sprintf(pname, MPT_PROCFS_MPTBASEDIR "/%s/summary", ioc->name);
+	remove_proc_entry(pname, NULL);
+	sprintf(pname, MPT_PROCFS_MPTBASEDIR "/%s/info", ioc->name);
+	remove_proc_entry(pname, NULL);
+	sprintf(pname, MPT_PROCFS_MPTBASEDIR "/%s", ioc->name);
+	remove_proc_entry(pname, NULL);
+	
 	/* call per device driver remove entry point */
 	for(ii=0; ii<MPT_MAX_PROTOCOL_DRIVERS; ii++) {
 		if(MptDeviceDriverHandlers[ii] &&
@@ -1519,19 +1434,18 @@ mptbase_remove(struct pci_dev *pdev)
 			MptDeviceDriverHandlers[ii]->remove(pdev);
 		}
 	}
-
+	
 	/* Disable interrupts! */
 	CHIPREG_WRITE32(&ioc->chip->IntMask, 0xFFFFFFFF);
 
 	ioc->active = 0;
-	mpt_sync_irq(pdev->irq);
+	synchronize_irq(pdev->irq);
 
 	/* Clear any lingering interrupt */
 	CHIPREG_WRITE32(&ioc->chip->IntStatus, 0);
 
 	CHIPREG_READ32(&ioc->chip->IntStatus);
 
-	Q_DEL_ITEM(ioc);
 	mpt_adapter_dispose(ioc);
 
 	pci_set_drvdata(pdev, NULL);
@@ -1769,11 +1683,17 @@ mpt_do_ioc_recovery(MPT_ADAPTER *ioc, u32 reason, int sleepFlag)
 					ioc->alt_ioc->name, r);
 	}
 
-	/* Get IOC facts! Allow 1 retry */
-	if ((r = GetIocFacts(ioc, sleepFlag, reason)) != 0)
-		r = GetIocFacts(ioc, sleepFlag, reason);
+	for (ii=0; ii<5; ii++) {
+		/* Get IOC facts! Allow 1 retry */
+		if ((r = GetIocFacts(ioc, sleepFlag, reason)) != 0) {
+			dinitprintk((MYIOC_s_INFO_FMT 
+			     "ii=%d IocFacts failed r=%x\n", ioc->name, ii, r));
+		} else
+			break;
+	}
 
 	if (r) {
+		dinitprintk((MYIOC_s_INFO_FMT "Retry IocFacts failed r=%x\n", ioc->name, r));
 		ret = -2;
 	} else if (reason == MPT_HOSTEVENT_IOC_BRINGUP) {
 		MptDisplayIocCapabilities(ioc);
@@ -1781,11 +1701,13 @@ mpt_do_ioc_recovery(MPT_ADAPTER *ioc, u32 reason, int sleepFlag)
 
 	if (alt_ioc_ready) {
 		if ((r = GetIocFacts(ioc->alt_ioc, sleepFlag, reason)) != 0) {
+			dinitprintk((MYIOC_s_INFO_FMT "Initial Alt IocFacts failed r=%x\n", ioc->name, r));
 			/* Retry - alt IOC was initialized once
 			 */
 			r = GetIocFacts(ioc->alt_ioc, sleepFlag, reason);
 		}
 		if (r) {
+			dinitprintk((MYIOC_s_INFO_FMT "Retry Alt IocFacts failed r=%x\n", ioc->name, r));
 			alt_ioc_ready = 0;
 			reset_alt_ioc_active = 0;
 		} else if (reason == MPT_HOSTEVENT_IOC_BRINGUP) {
@@ -1973,15 +1895,15 @@ mpt_do_ioc_recovery(MPT_ADAPTER *ioc, u32 reason, int sleepFlag)
 static void
 mpt_detect_bound_ports(MPT_ADAPTER *ioc, struct pci_dev *pdev)
 {
-	MPT_ADAPTER *ioc_srch = mpt_adapter_find_first();
 	unsigned int match_lo, match_hi;
+	MPT_ADAPTER *ioc_srch;
 
 	match_lo = pdev->devfn-1;
 	match_hi = pdev->devfn+1;
 	dprintk((MYIOC_s_INFO_FMT "PCI bus/devfn=%x/%x, searching for devfn match on %x or %x\n",
 			ioc->name, pdev->bus->number, pdev->devfn, match_lo, match_hi));
 
-	while (ioc_srch != NULL) {
+	list_for_each_entry(ioc_srch, &ioc_list, list) {
 		struct pci_dev *_pcidev = ioc_srch->pcidev;
 
 		if ((_pcidev->device == pdev->device) &&
@@ -2003,7 +1925,6 @@ mpt_detect_bound_ports(MPT_ADAPTER *ioc, struct pci_dev *pdev)
 			ioc->alt_ioc = ioc_srch;
 			break;
 		}
-		ioc_srch = mpt_adapter_find_next(ioc_srch);
 	}
 }
 
@@ -2018,15 +1939,8 @@ mpt_adapter_disable(MPT_ADAPTER *this, int freeup)
 {
 	if (this != NULL) {
 		int sz=0;
-		u32 state;
 		int ret;
 
-		/* Disable the FW */
-		state = mpt_GetIocState(this, 1);
-		if (state == MPI_IOC_STATE_OPERATIONAL) {
-			SendIocReset(this, MPI_FUNCTION_IOC_MESSAGE_UNIT_RESET, NO_SLEEP);
-		}
-
 		if (this->cached_fw != NULL) {
 			ddlprintk((KERN_INFO MYNAM ": Pushing FW onto adapter\n"));
 
@@ -2070,25 +1984,11 @@ mpt_adapter_disable(MPT_ADAPTER *this, int freeup)
 		}
 
 		if (freeup && this->cached_fw != NULL) {
-			int ii = 0;
-
-			while ((ii < this->num_fw_frags) && (this->cached_fw[ii]!= NULL)) {
-				sz = this->cached_fw[ii]->size;
-				pci_free_consistent(this->pcidev, sz,
-					this->cached_fw[ii]->fw, this->cached_fw[ii]->fw_dma);
-				this->cached_fw[ii]->fw = NULL;
-				this->alloc_total -= sz;
-
-				kfree(this->cached_fw[ii]);
-				this->cached_fw[ii] = NULL;
-				this->alloc_total -= sizeof(fw_image_t);
-
-				ii++;
-			}
 
-			kfree(this->cached_fw);
+			sz = this->facts.FWImageSize;
+			pci_free_consistent(this->pcidev, sz,
+				this->cached_fw, this->cached_fw_dma);
 			this->cached_fw = NULL;
-			sz = this->num_fw_frags * sizeof(void *);
 			this->alloc_total -= sz;
 		}
 
@@ -2130,11 +2030,6 @@ mpt_adapter_dispose(MPT_ADAPTER *this)
 
 		sz_first = this->alloc_total;
 
-		if (this->alt_ioc != NULL) {
-			this->alt_ioc->alt_ioc = NULL;
-			this->alt_ioc = NULL;
-		}
-
 		mpt_adapter_disable(this, 1);
 
 		if (this->pci_irq != -1) {
@@ -2153,7 +2048,7 @@ mpt_adapter_dispose(MPT_ADAPTER *this)
 #endif
 
 		/*  Zap the adapter lookup ptr!  */
-		mpt_adapters[this->id] = NULL;
+		list_del(&this->list);
 
 		sz_last = this->alloc_total;
 		dprintk((KERN_INFO MYNAM ": %s: free'd %d of %d bytes\n",
@@ -2250,13 +2145,14 @@ MakeIocReady(MPT_ADAPTER *ioc, int force, int sleepFlag)
 		if ((int)ioc->chip_type <= (int)FC929)
 			return 0;
 		else {
+			return 0;
 			/* Workaround from broken 1030 FW.
 			 * Force a diagnostic reset if fails.
 			 */
-			if ((r = SendIocReset(ioc, MPI_FUNCTION_IOC_MESSAGE_UNIT_RESET, sleepFlag)) == 0)
+/*			if ((r = SendIocReset(ioc, MPI_FUNCTION_IOC_MESSAGE_UNIT_RESET, sleepFlag)) == 0)
 				return 0;
 			else
-				statefault = 4;
+				statefault = 4; */
 		}
 	}
 
@@ -2275,7 +2171,7 @@ MakeIocReady(MPT_ADAPTER *ioc, int force, int sleepFlag)
 	 *	Hmmm...  Did it get left operational?
 	 */
 	if ((ioc_state & MPI_IOC_STATE_MASK) == MPI_IOC_STATE_OPERATIONAL) {
-		dprintk((MYIOC_s_WARN_FMT "IOC operational unexpected\n",
+		dinitprintk((MYIOC_s_WARN_FMT "IOC operational unexpected\n",
 				ioc->name));
 
 		/* Check WhoInit.
@@ -2419,7 +2315,7 @@ GetIocFacts(MPT_ADAPTER *ioc, int sleepFlag, int reason)
 	get_facts.Function = MPI_FUNCTION_IOC_FACTS;
 	/* Assert: All other get_facts fields are zero! */
 
-	dprintk((MYIOC_s_INFO_FMT "Sending get IocFacts request\n", ioc->name));
+	dinitprintk((MYIOC_s_INFO_FMT "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.
@@ -2519,8 +2415,10 @@ GetIocFacts(MPT_ADAPTER *ioc, int sleepFlag, int reason)
 				return r;
 		}
 	} else {
-		printk(MYIOC_s_ERR_FMT "Invalid IOC facts reply!\n",
-				ioc->name);
+		printk(MYIOC_s_ERR_FMT 
+		     "Invalid IOC facts reply, msgLength=%d offsetof=%d!\n",
+		     ioc->name, facts->MsgLength, (offsetof(IOCFactsReply_t,
+		     RequestFrameSize)/sizeof(u32)));
 		return -66;
 	}
 
@@ -2665,7 +2563,7 @@ SendIocInit(MPT_ADAPTER *ioc, int sleepFlag)
 	ioc->facts.CurrentHostMfaHighAddr = ioc_init.HostMfaHighAddr;
 	ioc->facts.CurrentSenseBufferHighAddr = ioc_init.SenseBufferHighAddr;
 
-	dprintk((MYIOC_s_INFO_FMT "Sending IOCInit (req @ %p)\n",
+	dhsprintk((MYIOC_s_INFO_FMT "Sending IOCInit (req @ %p)\n",
 			ioc->name, &ioc_init));
 
 	r = mpt_handshake_req_reply_wait(ioc, sizeof(IOCInit_t), (u32*)&ioc_init,
@@ -2677,6 +2575,9 @@ SendIocInit(MPT_ADAPTER *ioc, int sleepFlag)
 	 * since we don't even look at it's contents.
 	 */
 
+	dhsprintk((MYIOC_s_INFO_FMT "Sending PortEnable (req @ %p)\n",
+			ioc->name, &ioc_init));
+	
 	if ((r = SendPortEnable(ioc, 0, sleepFlag)) != 0)
 		return r;
 
@@ -2771,86 +2672,14 @@ SendPortEnable(MPT_ADAPTER *ioc, int portnum, int sleepFlag)
  * Outputs: frags - number of fragments needed
  * Return NULL if failed.
  */
-void *
-mpt_alloc_fw_memory(MPT_ADAPTER *ioc, int size, int *frags, int *alloc_sz)
+void
+mpt_alloc_fw_memory(MPT_ADAPTER *ioc, int size)
 {
-	fw_image_t	**cached_fw;
-	u8		*mem;
-	dma_addr_t	fw_dma;
-	int		alloc_total = 0;
-	int		bytes_left, bytes, num_frags;
-	int		sz, ii;
-
 	/* cached_fw
 	 */
-	sz = ioc->num_fw_frags * sizeof(void *);
-	mem = kmalloc(sz, GFP_ATOMIC);
-	if (mem == NULL)
-		return NULL;
-
-	memset(mem, 0, sz);
-	cached_fw = (fw_image_t **)mem;
-	alloc_total += sz;
-
-	/* malloc fragment memory
-	 * fw_image_t struct and dma for fw data
-	 */
-	bytes_left = size;
-	ii = 0;
-	num_frags = 0;
-	bytes = bytes_left;
-	while((bytes_left) && (num_frags < ioc->num_fw_frags)) {
-		if (cached_fw[ii] == NULL) {
-			mem = kmalloc(sizeof(fw_image_t), GFP_ATOMIC);
-			if (mem == NULL)
-				break;
-
-			memset(mem, 0, sizeof(fw_image_t));
-			cached_fw[ii] = (fw_image_t *)mem;
-			alloc_total += sizeof(fw_image_t);
-		}
-
-		mem = pci_alloc_consistent(ioc->pcidev, bytes, &fw_dma);
-		if (mem == NULL) {
-			if (bytes > 0x10000)
-				bytes = 0x10000;
-			else if (bytes > 0x8000)
-				bytes = 0x8000;
-			else if (bytes > 0x4000)
-				bytes = 0x4000;
-			else if (bytes > 0x2000)
-				bytes = 0x2000;
-			else if (bytes > 0x1000)
-				bytes = 0x1000;
-			else
-				break;
-
-			continue;
-		}
-
-		cached_fw[ii]->fw = mem;
-		cached_fw[ii]->fw_dma = fw_dma;
-		cached_fw[ii]->size = bytes;
-		memset(mem, 0, bytes);
-		alloc_total += bytes;
-
-		bytes_left -= bytes;
-
-		num_frags++;
-		ii++;
-	}
-
-	if (bytes_left ) {
-		/* Major Failure.
-		 */
-		mpt_free_fw_memory(ioc, cached_fw);
-		return NULL;
-	}
-
-	*frags = num_frags;
-	*alloc_sz = alloc_total;
 
-	return (void *) cached_fw;
+	if ( (ioc->cached_fw = pci_alloc_consistent(ioc->pcidev, size, &ioc->cached_fw_dma) ) )
+		ioc->alloc_total += size;
 }
 
 /*
@@ -2858,45 +2687,14 @@ mpt_alloc_fw_memory(MPT_ADAPTER *ioc, int size, int *frags, int *alloc_sz)
  * Else, delete a secondary image in same format.
  */
 void
-mpt_free_fw_memory(MPT_ADAPTER *ioc, fw_image_t **alt_img)
+mpt_free_fw_memory(MPT_ADAPTER *ioc)
 {
-	fw_image_t **cached_fw;
-	int ii;
 	int sz;
-	int alloc_freed = 0;
-
-	if (alt_img != NULL)
-		cached_fw = alt_img;
-	else
-		cached_fw = ioc->cached_fw;
-
-	if (cached_fw == NULL)
-		return;
-
-	ii = 0;
-	while ((ii < ioc->num_fw_frags) && (cached_fw[ii]!= NULL)) {
-		sz = cached_fw[ii]->size;
-		if (sz > 0) {
-			pci_free_consistent(ioc->pcidev, sz,
-						cached_fw[ii]->fw, cached_fw[ii]->fw_dma);
-		}
-		cached_fw[ii]->fw = NULL;
-		alloc_freed += sz;
-
-		kfree(cached_fw[ii]);
-		cached_fw[ii] = NULL;
-		alloc_freed += sizeof(fw_image_t);
 
-		ii++;
-	}
-
-	kfree(cached_fw);
-	cached_fw = NULL;
-	sz = ioc->num_fw_frags * sizeof(void *);
-	alloc_freed += sz;
-
-	if (alt_img == NULL)
-		ioc->alloc_total -= alloc_freed;
+	sz = ioc->facts.FWImageSize;
+	pci_free_consistent(ioc->pcidev, sz,
+			ioc->cached_fw, ioc->cached_fw_dma);
+	ioc->cached_fw = NULL;
 
 	return;
 }
@@ -2925,9 +2723,9 @@ mpt_do_upload(MPT_ADAPTER *ioc, int sleepFlag)
 	FWUploadReply_t		*preply;
 	FWUploadTCSGE_t		*ptcsge;
 	int			 sgeoffset;
+	u32			 flagsLength;
 	int			 ii, sz, reply_sz;
 	int			 cmdStatus, freeMem = 0;
-	int			 num_frags, alloc_sz;
 
 	/* If the image size is 0 or if the pointer is
 	 * not NULL (error), we are done.
@@ -2935,24 +2733,21 @@ mpt_do_upload(MPT_ADAPTER *ioc, int sleepFlag)
 	if (((sz = ioc->facts.FWImageSize) == 0) || ioc->cached_fw)
 		return 0;
 
-	ioc->num_fw_frags = ioc->req_sz - sizeof(FWUpload_t) + sizeof(dma_addr_t) + sizeof(u32) -1;
-	ioc->num_fw_frags /= sizeof(dma_addr_t) + sizeof(u32);
+	if ( sz & 0x01 )
+		sz += 1;
+	if ( sz & 0x02 )
+		sz += 2;
 
-	ioc->cached_fw = (fw_image_t **) mpt_alloc_fw_memory(ioc,
-			ioc->facts.FWImageSize, &num_frags, &alloc_sz);
+	mpt_alloc_fw_memory(ioc, sz);
 
 	if (ioc->cached_fw == NULL) {
 		/* Major Failure.
 		 */
-		mpt_free_fw_memory(ioc, NULL);
-		ioc->cached_fw = NULL;
-		
 		return -ENOMEM;
 	}
-	ioc->alloc_total += alloc_sz;
 
-	ddlprintk((KERN_INFO MYNAM ": FW Image  @ %p, sz=%d bytes\n",
-		 (void *)(ulong)ioc->cached_fw, ioc->facts.FWImageSize));
+	dinitprintk((KERN_WARNING MYNAM ": FW Image  @ %p[%p], sz=%d[%x] bytes\n",
+		 ioc->cached_fw, (void *)(ulong)ioc->cached_fw_dma, sz, sz));
 
 	prequest = (FWUpload_t *)&request;
 	preply = (FWUploadReply_t *)&reply;
@@ -2965,39 +2760,27 @@ mpt_do_upload(MPT_ADAPTER *ioc, int sleepFlag)
 
 	prequest->ImageType = MPI_FW_UPLOAD_ITYPE_FW_IOC_MEM;
 	prequest->Function = MPI_FUNCTION_FW_UPLOAD;
-	prequest->MsgContext = 0;		/* anything */
 
 	ptcsge = (FWUploadTCSGE_t *) &prequest->SGL;
-	ptcsge->Reserved = 0;
-	ptcsge->ContextSize = 0;
 	ptcsge->DetailsLength = 12;
 	ptcsge->Flags = MPI_SGE_FLAGS_TRANSACTION_ELEMENT;
-	ptcsge->Reserved1 = 0;
-	ptcsge->ImageOffset = 0;
 	ptcsge->ImageSize = cpu_to_le32(sz);
 
 	sgeoffset = sizeof(FWUpload_t) - sizeof(SGE_MPI_UNION) + sizeof(FWUploadTCSGE_t);
 
-	for (ii = 0; ii < (num_frags-1); ii++) {
-		mpt_add_sge(&request[sgeoffset], MPT_SGE_FLAGS_SIMPLE_ELEMENT |	
-			MPT_SGE_FLAGS_ADDRESSING | MPT_TRANSFER_IOC_TO_HOST |
-			(u32) ioc->cached_fw[ii]->size, ioc->cached_fw[ii]->fw_dma);
-
-		sgeoffset += sizeof(u32) + sizeof(dma_addr_t);
-	}
-
-	mpt_add_sge(&request[sgeoffset],
-			MPT_SGE_FLAGS_SSIMPLE_READ |(u32) ioc->cached_fw[ii]->size,
-			ioc->cached_fw[ii]->fw_dma);
+	flagsLength = MPT_SGE_FLAGS_SSIMPLE_READ | sz;
+	mpt_add_sge(&request[sgeoffset], flagsLength, ioc->cached_fw_dma);
 
 	sgeoffset += sizeof(u32) + sizeof(dma_addr_t);
-
-	dprintk((MYIOC_s_INFO_FMT "Sending FW Upload (req @ %p) size %d \n",
-			ioc->name, prequest, sgeoffset));
+	dinitprintk((KERN_WARNING MYNAM "Sending FW Upload (req @ %p) sgeoffset=%d \n",
+			prequest, sgeoffset));
+	DBG_DUMP_FW_REQUEST_FRAME(prequest)
 
 	ii = mpt_handshake_req_reply_wait(ioc, sgeoffset, (u32*)prequest,
 				reply_sz, (u16*)preply, 65 /*seconds*/, sleepFlag);
 
+	dinitprintk((KERN_WARNING MYNAM "FW Upload completed rc=%x \n", ii));
+
 	cmdStatus = -EFAULT;
 	if (ii == 0) {
 		/* Handshake transfer was complete and successful.
@@ -3011,7 +2794,7 @@ mpt_do_upload(MPT_ADAPTER *ioc, int sleepFlag)
 				cmdStatus = 0;
 		}
 	}
-	ddlprintk((MYIOC_s_INFO_FMT ": do_upload status %d \n",
+	dinitprintk((MYIOC_s_INFO_FMT ": do_upload status %d \n",
 			ioc->name, cmdStatus));
 
 	/* Check to see if we have a copy of this image in
@@ -3031,8 +2814,7 @@ mpt_do_upload(MPT_ADAPTER *ioc, int sleepFlag)
 
 		ddlprintk((MYIOC_s_INFO_FMT ": do_upload freeing %s image \n",
 			ioc->name, cmdStatus ? "incomplete" : "duplicate"));
-		mpt_free_fw_memory(ioc, NULL);
-		ioc->cached_fw = NULL;
+		mpt_free_fw_memory(ioc);
 	}
 
 	return cmdStatus;
@@ -3055,241 +2837,138 @@ mpt_do_upload(MPT_ADAPTER *ioc, int sleepFlag)
 static int
 mpt_downloadboot(MPT_ADAPTER *ioc, int sleepFlag)
 {
-	MpiFwHeader_t		*FwHdr;
-	MpiExtImageHeader_t 	*ExtHdr;
-	fw_image_t		**pCached=NULL;
-	int			 fw_sz;
+	MpiFwHeader_t		*pFwHeader;
+	MpiExtImageHeader_t	*pExtImage;
+	u32			 fwSize;
 	u32			 diag0val;
 #ifdef MPT_DEBUG
 	u32			 diag1val = 0;
 #endif
 	int			 count = 0;
-	u32			*ptru32;
+	u32			*ptrFw;
 	u32			 diagRwData;
 	u32			 nextImage;
-	u32			 ext_offset;
 	u32			 load_addr;
-	int			 max_idx, fw_idx, ext_idx;
-	int			 left_u32s;
+	u32 			 ioc_state;
 
-	ddlprintk((MYIOC_s_INFO_FMT "DbGb0: downloadboot entered.\n",
-				ioc->name));
-#ifdef MPT_DEBUG
-	diag0val = CHIPREG_READ32(&ioc->chip->Diagnostic);
-	if (ioc->alt_ioc)
-		diag1val = CHIPREG_READ32(&ioc->alt_ioc->chip->Diagnostic);
-	ddlprintk((MYIOC_s_INFO_FMT "DbGb1: diag0=%08x, diag1=%08x\n",
-				ioc->name, diag0val, diag1val));
-#endif
-
-	ddlprintk((MYIOC_s_INFO_FMT "fw size 0x%x, ioc FW Ptr %p\n",
+	ddlprintk((MYIOC_s_INFO_FMT "downloadboot: fw size 0x%x, ioc FW Ptr %p\n",
 				ioc->name, ioc->facts.FWImageSize, ioc->cached_fw));
-	if (ioc->alt_ioc)
-		ddlprintk((MYIOC_s_INFO_FMT "alt ioc FW Ptr %p\n",
-				ioc->name, ioc->alt_ioc->cached_fw));
 
 	/* Get dma_addr and data transfer size.
 	 */
-	if ((fw_sz = ioc->facts.FWImageSize) == 0)
+	if ( ioc->facts.FWImageSize == 0 )
 		return -1;
 
 	/* Get the DMA from ioc or ioc->alt_ioc */
-	if (ioc->cached_fw != NULL)
-		pCached = (fw_image_t **)ioc->cached_fw;
-	else if (ioc->alt_ioc && (ioc->alt_ioc->cached_fw != NULL))
-		pCached = (fw_image_t **)ioc->alt_ioc->cached_fw;
-	else
+	if (ioc->cached_fw == NULL)
 		return -2;
 
-	ddlprintk((MYIOC_s_INFO_FMT "DbGb2: FW Image @ %p\n",
-			ioc->name, pCached));
+	CHIPREG_WRITE32(&ioc->chip->WriteSequence, 0xFF);
+	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);
 
-	/* Write magic sequence to WriteSequence register
-	 * until enter diagnostic mode
-	 */
 	diag0val = CHIPREG_READ32(&ioc->chip->Diagnostic);
-	while ((diag0val & MPI_DIAG_DRWE) == 0) {
-		CHIPREG_WRITE32(&ioc->chip->WriteSequence, 0xFF);
-		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);
+	diag0val |= (MPI_DIAG_PREVENT_IOC_BOOT | MPI_DIAG_DISABLE_ARM);
+	CHIPREG_WRITE32(&ioc->chip->Diagnostic, diag0val);
 
-		/* wait 100 msec */
+	/* wait 100 msec */
+	if (sleepFlag == CAN_SLEEP) {
+		set_current_state(TASK_INTERRUPTIBLE);
+		schedule_timeout(100 * HZ / 1000);
+	} else {
+		mdelay (100);
+	}
+
+	CHIPREG_WRITE32(&ioc->chip->Diagnostic, diag0val | MPI_DIAG_RESET_ADAPTER);
+
+	for (count = 0; count < 30; count ++) {
+		diag0val = CHIPREG_READ32(&ioc->chip->Diagnostic);
+		if (!(diag0val & MPI_DIAG_RESET_ADAPTER)) {
+			ddlprintk((MYIOC_s_INFO_FMT "RESET_ADAPTER cleared, count=%d\n",
+				ioc->name, count));
+			break;
+		}
+		/* wait 1 sec */
 		if (sleepFlag == CAN_SLEEP) {
 			set_current_state(TASK_INTERRUPTIBLE);
-			schedule_timeout(100 * HZ / 1000);
+			schedule_timeout(HZ);
 		} else {
-			mdelay (100);
-		}
-
-		count++;
-		if (count > 20) {
-			printk(MYIOC_s_ERR_FMT "Enable Diagnostic mode FAILED! (%02xh)\n",
-					ioc->name, diag0val);
-			return -EFAULT;
-
+			mdelay (1000);
 		}
-
-		diag0val = CHIPREG_READ32(&ioc->chip->Diagnostic);
-#ifdef MPT_DEBUG
-		if (ioc->alt_ioc)
-			diag1val = CHIPREG_READ32(&ioc->alt_ioc->chip->Diagnostic);
-		ddlprintk((MYIOC_s_INFO_FMT "DbGb3: diag0=%08x, diag1=%08x\n",
-				ioc->name, diag0val, diag1val));
-#endif
-		ddlprintk((MYIOC_s_INFO_FMT "Wrote magic DiagWriteEn sequence (%x)\n",
-				ioc->name, diag0val));
 	}
 
-	/* Set the DiagRwEn and Disable ARM bits */
-	diag0val |= (MPI_DIAG_RW_ENABLE | MPI_DIAG_DISABLE_ARM);
-	CHIPREG_WRITE32(&ioc->chip->Diagnostic, diag0val);
-
-#ifdef MPT_DEBUG
-	if (ioc->alt_ioc)
-		diag1val = CHIPREG_READ32(&ioc->alt_ioc->chip->Diagnostic);
+	if ( count == 30 ) {
+		ddlprintk((MYIOC_s_INFO_FMT "downloadboot failed! Unable to RESET_ADAPTER diag0val=%x\n",
+		ioc->name, diag0val));
+		return -3;
+	}
 
-	ddlprintk((MYIOC_s_INFO_FMT "DbGb3: diag0=%08x, diag1=%08x\n",
-			ioc->name, diag0val, diag1val));
-#endif
+	CHIPREG_WRITE32(&ioc->chip->WriteSequence, 0xFF);
+	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);
 
-	/* max_idx = 1 + maximum valid buffer index
-	 */
-	max_idx = 0;
-	while (pCached[max_idx])
-		max_idx++;
+	/* Set the DiagRwEn and Disable ARM bits */
+	diag0val = CHIPREG_READ32(&ioc->chip->Diagnostic);
+	CHIPREG_WRITE32(&ioc->chip->Diagnostic, (diag0val | MPI_DIAG_RW_ENABLE | MPI_DIAG_DISABLE_ARM));
 
-	fw_idx = 0;
-	FwHdr = (MpiFwHeader_t *) pCached[fw_idx]->fw;
-	ptru32 = (u32 *) FwHdr;
-	count = (FwHdr->ImageSize + 3)/4;
-	nextImage = FwHdr->NextImageHeaderOffset;
+	pFwHeader = (MpiFwHeader_t *) ioc->cached_fw;
+	fwSize = (pFwHeader->ImageSize + 3)/4;
+	ptrFw = (u32 *) pFwHeader;
 
 	/* Write the LoadStartAddress to the DiagRw Address Register
 	 * using Programmed IO
 	 */
-	CHIPREG_PIO_WRITE32(&ioc->pio_chip->DiagRwAddress, FwHdr->LoadStartAddress);
+	CHIPREG_PIO_WRITE32(&ioc->pio_chip->DiagRwAddress, pFwHeader->LoadStartAddress);
 	ddlprintk((MYIOC_s_INFO_FMT "LoadStart addr written 0x%x \n",
-		ioc->name, FwHdr->LoadStartAddress));
-
-	ddlprintk((MYIOC_s_INFO_FMT "Write FW Image: 0x%x u32's @ %p\n",
-				ioc->name, count, ptru32));
-	left_u32s = pCached[fw_idx]->size/4;
-	while (count--) {
-		if (left_u32s == 0) {
-			fw_idx++;
-			if (fw_idx >= max_idx) {
-				/* FIXME
-				ERROR CASE
-				*/
-				;
-			}
-			ptru32 = (u32 *) pCached[fw_idx]->fw;
-			left_u32s = pCached[fw_idx]->size / 4;
-		}
-		left_u32s--;
-		CHIPREG_PIO_WRITE32(&ioc->pio_chip->DiagRwData, *ptru32);
-		ptru32++;
+		ioc->name, pFwHeader->LoadStartAddress));
+
+	ddlprintk((MYIOC_s_INFO_FMT "Write FW Image: 0x%x bytes @ %p\n",
+				ioc->name, fwSize*4, ptrFw));
+	while (fwSize--) {
+		CHIPREG_PIO_WRITE32(&ioc->pio_chip->DiagRwData, *ptrFw++);
 	}
 
-	/* left_u32s, fw_idx and ptru32 are all valid
-	 */
+	nextImage = pFwHeader->NextImageHeaderOffset;
 	while (nextImage) {
-		ext_idx = 0;
-		ext_offset = nextImage;
-		while (ext_offset > pCached[ext_idx]->size) {
-			ext_idx++;
-			if (ext_idx >= max_idx) {
-				/* FIXME
-				ERROR CASE
-				*/
-				;
-			}
-			ext_offset -= pCached[ext_idx]->size;
-		}
-		ptru32 = (u32 *) ((char *)pCached[ext_idx]->fw + ext_offset);
-		left_u32s = pCached[ext_idx]->size - ext_offset;
-
-		if ((left_u32s * 4) >= sizeof(MpiExtImageHeader_t)) {
-			ExtHdr = (MpiExtImageHeader_t *) ptru32;
-			count = (ExtHdr->ImageSize + 3 )/4;
-			nextImage = ExtHdr->NextImageHeaderOffset;
-			load_addr = ExtHdr->LoadStartAddress;
-		} else {
-			u32 * ptmp = (u32 *)pCached[ext_idx+1]->fw;
+		pExtImage = (MpiExtImageHeader_t *) ((char *)pFwHeader + nextImage);
 
-			switch (left_u32s) {
-			case 5:
-				count = *(ptru32 + 2);
-				nextImage = *(ptru32 + 3);
-				load_addr = *(ptru32 + 4);
-				break;
-			case 4:
-				count = *(ptru32 + 2);
-				nextImage = *(ptru32 + 3);
-				load_addr = *ptmp;
-				break;
-			case 3:
-				count = *(ptru32 + 2);
-				nextImage = *ptmp;
-				load_addr = *(ptmp + 1);
-				break;
-			case 2:
-				count = *ptmp;
-				nextImage = *(ptmp + 1);
-				load_addr = *(ptmp + 2);
-				break;
+		load_addr = pExtImage->LoadStartAddress;
 
-			case 1:
-				count = *(ptmp + 1);
-				nextImage = *(ptmp + 2);
-				load_addr = *(ptmp + 3);
-				break;
+		fwSize = (pExtImage->ImageSize + 3) >> 2;
+		ptrFw = (u32 *)pExtImage;
 
-			default:
-				count = 0;
-				nextImage = 0;
-				load_addr = 0;
-				/* FIXME
-				ERROR CASE
-				*/
-				;
-
-			}
-			count = (count +3)/4;
-		}
-
-		ddlprintk((MYIOC_s_INFO_FMT "Write Ext Image: 0x%x u32's @ %p\n",
-						ioc->name, count, ptru32));
+		ddlprintk((MYIOC_s_INFO_FMT "Write Ext Image: 0x%x bytes @ %p load_addr=%x\n",
+						ioc->name, fwSize*4, ptrFw, load_addr));
 		CHIPREG_PIO_WRITE32(&ioc->pio_chip->DiagRwAddress, load_addr);
 
-		while (count--) {
-			if (left_u32s == 0) {
-				fw_idx++;
-				if (fw_idx >= max_idx) {
-					/* FIXME
-					ERROR CASE
-					*/
-					;
-				}
-				ptru32 = (u32 *) pCached[fw_idx]->fw;
-				left_u32s = pCached[fw_idx]->size / 4;
-			}
-			left_u32s--;
-			CHIPREG_PIO_WRITE32(&ioc->pio_chip->DiagRwData, *ptru32);
-			ptru32++;
+		while (fwSize--) {
+			CHIPREG_PIO_WRITE32(&ioc->pio_chip->DiagRwData, *ptrFw++);
 		}
+		nextImage = pExtImage->NextImageHeaderOffset;
 	}
 
 	/* Write the IopResetVectorRegAddr */
-	ddlprintk((MYIOC_s_INFO_FMT "Write IopResetVector Addr! \n", ioc->name));
-	CHIPREG_PIO_WRITE32(&ioc->pio_chip->DiagRwAddress, FwHdr->IopResetRegAddr);
+	ddlprintk((MYIOC_s_INFO_FMT "Write IopResetVector Addr=%x! \n", ioc->name, 	pFwHeader->IopResetRegAddr));
+	CHIPREG_PIO_WRITE32(&ioc->pio_chip->DiagRwAddress, pFwHeader->IopResetRegAddr);
 
 	/* Write the IopResetVectorValue */
-	ddlprintk((MYIOC_s_INFO_FMT "Write IopResetVector Value! \n", ioc->name));
-	CHIPREG_PIO_WRITE32(&ioc->pio_chip->DiagRwData, FwHdr->IopResetVectorValue);
+	ddlprintk((MYIOC_s_INFO_FMT "Write IopResetVector Value=%x! \n", ioc->name, pFwHeader->IopResetVectorValue));
+	CHIPREG_PIO_WRITE32(&ioc->pio_chip->DiagRwData, pFwHeader->IopResetVectorValue);
+
+	/* clear the PREVENT_IOC_BOOT bit */
+	diag0val = CHIPREG_READ32(&ioc->chip->Diagnostic);
+	ddlprintk((MYIOC_s_INFO_FMT "downloadboot diag0val=%x, turning off PREVENT_IOC_BOOT\n",
+		ioc->name, diag0val));
+	diag0val &= ~(MPI_DIAG_PREVENT_IOC_BOOT);
+	ddlprintk((MYIOC_s_INFO_FMT "downloadboot now diag0val=%x\n",
+		ioc->name, diag0val));
+	CHIPREG_WRITE32(&ioc->chip->Diagnostic, diag0val);
 
 	/* Clear the internal flash bad bit - autoincrementing register,
 	 * so must do two writes.
@@ -3300,15 +2979,63 @@ mpt_downloadboot(MPT_ADAPTER *ioc, int sleepFlag)
 	CHIPREG_PIO_WRITE32(&ioc->pio_chip->DiagRwAddress, 0x3F000000);
 	CHIPREG_PIO_WRITE32(&ioc->pio_chip->DiagRwData, diagRwData);
 
-	/* clear the RW enable and DISARM bits */
 	diag0val = CHIPREG_READ32(&ioc->chip->Diagnostic);
-	diag0val &= ~(MPI_DIAG_DISABLE_ARM | MPI_DIAG_RW_ENABLE | MPI_DIAG_FLASH_BAD_SIG);
+	ddlprintk((MYIOC_s_INFO_FMT "downloadboot diag0val=%x, turning off DISABLE_ARM, RW_ENABLE, RESET_HISTORY\n",
+		ioc->name, diag0val));
+	diag0val &= ~(MPI_DIAG_DISABLE_ARM | MPI_DIAG_RW_ENABLE | MPI_DIAG_RESET_HISTORY);
+	ddlprintk((MYIOC_s_INFO_FMT "downloadboot now diag0val=%x\n",
+		ioc->name, diag0val));
 	CHIPREG_WRITE32(&ioc->chip->Diagnostic, diag0val);
 
+	/* wait 100 msec */
+	if (sleepFlag == CAN_SLEEP) {
+		ddlprintk((MYIOC_s_INFO_FMT "CAN_SLEEP 100 msec before reset the sequencer\n", ioc->name));
+		set_current_state(TASK_INTERRUPTIBLE);
+		schedule_timeout(100 * HZ / 1000);
+	} else {
+		ddlprintk((MYIOC_s_INFO_FMT "mdelay 100 msec before reset the sequencer\n", ioc->name));
+		mdelay (100);
+	}
+
+	diag0val = CHIPREG_READ32(&ioc->chip->Diagnostic);
+	if ( diag0val & (MPI_DIAG_FLASH_BAD_SIG | MPI_DIAG_DISABLE_ARM) ) {
+		ddlprintk((MYIOC_s_INFO_FMT "downloadboot failed, diag0val=%x FLASH_BAD_SIG | DISABLE_ARM on\n ",
+			ioc->name, diag0val));
+	}
 	/* Write 0xFF to reset the sequencer */
 	CHIPREG_WRITE32(&ioc->chip->WriteSequence, 0xFF);
 
-	return 0;
+	for (count=0; count<HZ*20; count++) {
+		if ((ioc_state = mpt_GetIocState(ioc, 0)) & MPI_IOC_STATE_READY) {
+			ddlprintk((MYIOC_s_INFO_FMT "downloadboot successful! (count=%d) IocState=%x\n",
+					ioc->name, count, ioc_state));
+/*			if ((r = GetIocFacts(ioc, sleepFlag, MPT_HOSTEVENT_IOC_BRINGUP)) != 0) {
+				if ((r = GetIocFacts(ioc, sleepFlag, MPT_HOSTEVENT_IOC_BRINGUP)) != 0) {
+					ddlprintk((MYIOC_s_INFO_FMT "GetIocFacts failed\n",
+						ioc->name));
+						return -EFAULT;
+				}
+			} */
+			/* wait 2 sec */
+/*			if (sleepFlag == CAN_SLEEP) {
+				set_current_state(TASK_INTERRUPTIBLE);
+				schedule_timeout(5000 * HZ / 1000);
+			} else {
+				mdelay (5000);
+			} */
+
+			return 0;
+		}
+		if (sleepFlag == CAN_SLEEP) {
+			set_current_state(TASK_INTERRUPTIBLE);
+			schedule_timeout(1);
+		} else {
+			mdelay (10);
+		}
+	}
+	ddlprintk((MYIOC_s_INFO_FMT "downloadboot failed! IocState=%x\n",
+		ioc->name, ioc_state));
+	return -EFAULT;
 }
 
 /*=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=*/
@@ -3344,7 +3071,7 @@ KickStart(MPT_ADAPTER *ioc, int force, int sleepFlag)
 	u32 ioc_state;
 	int cntdn, cnt = 0;
 
-	dprintk((KERN_WARNING MYNAM ": KickStarting %s!\n", ioc->name));
+	dinitprintk((KERN_WARNING MYNAM ": KickStarting %s!\n", ioc->name));
 	if ((int)ioc->chip_type > (int)FC929) {
 		/* Always issue a Msg Unit Reset first. This will clear some
 		 * SCSI bus hang conditions.
@@ -3593,6 +3320,7 @@ mpt_diag_reset(MPT_ADAPTER *ioc, int ignore, int sleepFlag)
 		/* Write magic sequence to WriteSequence register
 		 * Loop until in diagnostic mode
 		 */
+		CHIPREG_WRITE32(&ioc->chip->WriteSequence, 0xFF);
 		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);
@@ -3672,7 +3400,7 @@ SendIocReset(MPT_ADAPTER *ioc, u8 reset_type, int sleepFlag)
 	u32 state;
 	int cntdn, count;
 
-	dprintk((KERN_WARNING MYNAM ": %s: Sending IOC reset(0x%02x)!\n",
+	drsprintk((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, 5, sleepFlag)) < 0)
@@ -3799,7 +3527,8 @@ PrimeIocFifos(MPT_ADAPTER *ioc)
 
 		/*  Prime reply FIFO...  */
 		dprintk((KERN_INFO MYNAM ": %s.reply_alloc  @ %p[%p], sz=%d bytes\n",
-			 	ioc->name, mem, (void *)(ulong)ioc->reply_alloc_dma, reply_buffer_sz));
+			ioc->name, ioc->reply_alloc, 
+			(void *)(ulong)ioc->reply_alloc_dma, reply_buffer_sz));
 
 		b = (unsigned long) ioc->reply_alloc;
 		b = (b + (0x80UL - 1UL)) & ~(0x80UL - 1UL); /* round up to 128-byte boundary */
@@ -3812,7 +3541,8 @@ PrimeIocFifos(MPT_ADAPTER *ioc)
 	
 		/*  Request FIFO - WE manage this!  */
 		dprintk((KERN_INFO MYNAM ": %s.req_alloc    @ %p[%p], sz=%d bytes\n",
-			 	ioc->name, mem, (void *)(ulong)ioc->req_alloc_dma, request_buffer_sz));
+			ioc->name, ioc->req_alloc,
+			(void *)(ulong)ioc->req_alloc_dma, request_buffer_sz));
 
 		b = (unsigned long) ioc->req_alloc;
 		b = (b + (0x80UL - 1UL)) & ~(0x80UL - 1UL); /* round up to 128-byte boundary */
@@ -4009,6 +3739,9 @@ mpt_handshake_req_reply_wait(MPT_ADAPTER *ioc, int reqBytes, u32 *req,
 		 */
 		if (!failcnt && (t = WaitForDoorbellReply(ioc, maxwait, sleepFlag)) < 0)
 			failcnt++;
+		
+		dhsprintk((MYIOC_s_INFO_FMT "HandShake reply count=%d%s\n",
+				ioc->name, t, failcnt ? " - MISSING DOORBELL REPLY!" : ""));
 
 		/*
 		 * Copy out the cached reply...
@@ -4040,7 +3773,7 @@ WaitForDoorbellAck(MPT_ADAPTER *ioc, int howlong, int sleepFlag)
 {
 	int cntdn;
 	int count = 0;
-	u32 intstat;
+	u32 intstat=0;
 
 	cntdn = ((sleepFlag == CAN_SLEEP) ? HZ : 1000) * howlong;
 
@@ -4064,13 +3797,13 @@ WaitForDoorbellAck(MPT_ADAPTER *ioc, int howlong, int sleepFlag)
 	}
 
 	if (cntdn) {
-		dhsprintk((MYIOC_s_INFO_FMT "WaitForDoorbell ACK (cnt=%d)\n",
+		dprintk((MYIOC_s_INFO_FMT "WaitForDoorbell ACK (count=%d)\n",
 				ioc->name, count));
 		return count;
 	}
 
-	printk(MYIOC_s_ERR_FMT "Doorbell ACK timeout(%d)!\n",
-			ioc->name, (count+5)/HZ);
+	printk(MYIOC_s_ERR_FMT "Doorbell ACK timeout (count=%d), IntStatus=%x!\n",
+			ioc->name, count, intstat);
 	return -1;
 }
 
@@ -4091,7 +3824,7 @@ WaitForDoorbellInt(MPT_ADAPTER *ioc, int howlong, int sleepFlag)
 {
 	int cntdn;
 	int count = 0;
-	u32 intstat;
+	u32 intstat=0;
 
 	cntdn = ((sleepFlag == CAN_SLEEP) ? HZ : 1000) * howlong;
 	if (sleepFlag == CAN_SLEEP) {
@@ -4114,13 +3847,13 @@ WaitForDoorbellInt(MPT_ADAPTER *ioc, int howlong, int sleepFlag)
 	}
 
 	if (cntdn) {
-		dhsprintk((MYIOC_s_INFO_FMT "WaitForDoorbell INT (cnt=%d)\n",
-				ioc->name, count));
+		dprintk((MYIOC_s_INFO_FMT "WaitForDoorbell INT (cnt=%d) howlong=%d\n",
+				ioc->name, count, howlong));
 		return count;
 	}
 
-	printk(MYIOC_s_ERR_FMT "Doorbell INT timeout(%d)!\n",
-			ioc->name, (count+5)/HZ);
+	printk(MYIOC_s_ERR_FMT "Doorbell INT timeout (count=%d), IntStatus=%x!\n",
+			ioc->name, count, intstat);
 	return -1;
 }
 
@@ -4166,8 +3899,8 @@ WaitForDoorbellReply(MPT_ADAPTER *ioc, int howlong, int sleepFlag)
 		}
 	}
 
-	dhsprintk((MYIOC_s_INFO_FMT "First handshake reply word=%08x%s\n",
-			ioc->name, le32_to_cpu(*(u32 *)hs_reply),
+	dhsprintk((MYIOC_s_INFO_FMT "WaitCnt=%d First handshake reply word=%08x%s\n",
+			ioc->name, t, le32_to_cpu(*(u32 *)hs_reply), 
 			failcnt ? " - MISSING DOORBELL HANDSHAKE!" : ""));
 
 	/*
@@ -4205,8 +3938,8 @@ WaitForDoorbellReply(MPT_ADAPTER *ioc, int howlong, int sleepFlag)
 	dmfprintk((MYIOC_s_INFO_FMT "Got Handshake reply:\n", ioc->name));
 	DBG_DUMP_REPLY_FRAME(mptReply)
 
-	dhsprintk((MYIOC_s_INFO_FMT "WaitForDoorbell REPLY (sz=%d)\n",
-			ioc->name, u16cnt/2));
+	dhsprintk((MYIOC_s_INFO_FMT "WaitForDoorbell REPLY WaitCnt=%d (sz=%d)\n",
+			ioc->name, t, u16cnt/2));
 	return u16cnt/2;
 }
 
@@ -4998,7 +4731,7 @@ SendEventNotification(MPT_ADAPTER *ioc, u8 EvSwitch)
 {
 	EventNotification_t	*evnp;
 
-	evnp = (EventNotification_t *) mpt_get_msg_frame(mpt_base_index, ioc->id);
+	evnp = (EventNotification_t *) mpt_get_msg_frame(mpt_base_index, ioc);
 	if (evnp == NULL) {
 		dprintk((MYIOC_s_WARN_FMT "Unable to allocate event request frame!\n",
 				ioc->name));
@@ -5013,7 +4746,7 @@ SendEventNotification(MPT_ADAPTER *ioc, u8 EvSwitch)
 	evnp->MsgFlags = 0;
 	evnp->Switch = EvSwitch;
 
-	mpt_put_msg_frame(mpt_base_index, ioc->id, (MPT_FRAME_HDR *)evnp);
+	mpt_put_msg_frame(mpt_base_index, ioc, (MPT_FRAME_HDR *)evnp);
 
 	return 0;
 }
@@ -5029,7 +4762,7 @@ SendEventAck(MPT_ADAPTER *ioc, EventNotificationReply_t *evnp)
 {
 	EventAck_t	*pAck;
 
-	if ((pAck = (EventAck_t *) mpt_get_msg_frame(mpt_base_index, ioc->id)) == NULL) {
+	if ((pAck = (EventAck_t *) mpt_get_msg_frame(mpt_base_index, ioc)) == NULL) {
 		printk(MYIOC_s_WARN_FMT "Unable to allocate event ACK request frame!\n",
 				ioc->name);
 		return -1;
@@ -5044,7 +4777,7 @@ SendEventAck(MPT_ADAPTER *ioc, EventNotificationReply_t *evnp)
 	pAck->Event        = evnp->Event;
 	pAck->EventContext = evnp->EventContext;
 
-	mpt_put_msg_frame(mpt_base_index, ioc->id, (MPT_FRAME_HDR *)pAck);
+	mpt_put_msg_frame(mpt_base_index, ioc, (MPT_FRAME_HDR *)pAck);
 
 	return 0;
 }
@@ -5070,7 +4803,7 @@ mpt_config(MPT_ADAPTER *ioc, CONFIGPARMS *pCfg)
 	MPT_FRAME_HDR	*mf;
 	unsigned long	 flags;
 	int		 ii, rc;
-	int		 flagsLength;
+	u32		 flagsLength;
 	int		 in_isr;
 
 	/* (Bugzilla:fibrebugs, #513)
@@ -5087,7 +4820,7 @@ mpt_config(MPT_ADAPTER *ioc, CONFIGPARMS *pCfg)
 
 	/* Get and Populate a free Frame
 	 */
-	if ((mf = mpt_get_msg_frame(mpt_base_index, ioc->id)) == NULL) {
+	if ((mf = mpt_get_msg_frame(mpt_base_index, ioc)) == NULL) {
 		dcprintk((MYIOC_s_WARN_FMT "mpt_config: no msg frames!\n",
 				ioc->name));
 		return -EAGAIN;
@@ -5146,7 +4879,7 @@ mpt_config(MPT_ADAPTER *ioc, CONFIGPARMS *pCfg)
 	spin_unlock_irqrestore(&ioc->FreeQlock, flags);
 
 	add_timer(&pCfg->timer);
-	mpt_put_msg_frame(mpt_base_index, ioc->id, mf);
+	mpt_put_msg_frame(mpt_base_index, ioc, mf);
 	wait_event(mpt_waitq, pCfg->wait_done);
 
 	/* mf has been freed - do not access */
@@ -5174,10 +4907,11 @@ int
 mpt_toolbox(MPT_ADAPTER *ioc, CONFIGPARMS *pCfg)
 {
 	ToolboxIstwiReadWriteRequest_t	*pReq;
+	struct pci_dev	*pdev;
 	MPT_FRAME_HDR	*mf;
 	unsigned long	 flags;
 	int		 rc;
-	int		 flagsLength;
+	u32		 flagsLength;
 	int		 in_isr;
 
 	/* (Bugzilla:fibrebugs, #513)
@@ -5194,7 +4928,7 @@ mpt_toolbox(MPT_ADAPTER *ioc, CONFIGPARMS *pCfg)
 
 	/* Get and Populate a free Frame
 	 */
-	if ((mf = mpt_get_msg_frame(mpt_base_index, ioc->id)) == NULL) {
+	if ((mf = mpt_get_msg_frame(mpt_base_index, ioc)) == NULL) {
 		dcprintk((MYIOC_s_WARN_FMT "mpt_toolbox: no msg frames!\n",
 				ioc->name));
 		return -EAGAIN;
@@ -5213,7 +4947,11 @@ mpt_toolbox(MPT_ADAPTER *ioc, CONFIGPARMS *pCfg)
 	pReq->NumAddressBytes = 0x01;
 	pReq->Reserved4 = 0;
 	pReq->DataLength = 0x04;
-	pReq->DeviceAddr = 0xB0;
+	pdev = (struct pci_dev *) ioc->pcidev;
+	if (pdev->devfn & 1)
+		pReq->DeviceAddr = 0xB2;
+	else
+		pReq->DeviceAddr = 0xB0;
 	pReq->Addr1 = 0;
 	pReq->Addr2 = 0;
 	pReq->Addr3 = 0;
@@ -5252,7 +4990,7 @@ mpt_toolbox(MPT_ADAPTER *ioc, CONFIGPARMS *pCfg)
 	spin_unlock_irqrestore(&ioc->FreeQlock, flags);
 
 	add_timer(&pCfg->timer);
-	mpt_put_msg_frame(mpt_base_index, ioc->id, mf);
+	mpt_put_msg_frame(mpt_base_index, ioc, mf);
 	wait_event(mpt_waitq, pCfg->wait_done);
 
 	/* mf has been freed - do not access */
@@ -5366,61 +5104,19 @@ mpt_ioc_reset(MPT_ADAPTER *ioc, int reset_phase)
 static int
 procmpt_create(void)
 {
-	MPT_ADAPTER		*ioc;
 	struct proc_dir_entry	*ent;
-	int	 ii;
 
-	/*
-	 *	BEWARE: If/when MPT_PROCFS_MPTBASEDIR changes from "mpt"
-	 *	(single level) to multi level (e.g. "driver/message/fusion")
-	 *	something here needs to change.  -sralston
-	 */
 	mpt_proc_root_dir = proc_mkdir(MPT_PROCFS_MPTBASEDIR, NULL);
 	if (mpt_proc_root_dir == NULL)
 		return -ENOTDIR;
 
-	for (ii=0; ii < MPT_PROC_ENTRIES; ii++) {
-		ent = create_proc_entry(mpt_proc_list[ii].name,
-				S_IFREG|S_IRUGO, mpt_proc_root_dir);
-		if (!ent) {
-			printk(KERN_WARNING MYNAM
-					": WARNING - Could not create /proc/mpt/%s entry\n",
-					mpt_proc_list[ii].name);
-			continue;
-		}
-		ent->read_proc = mpt_proc_list[ii].f;
-		ent->data      = NULL;
-	}
+	ent = create_proc_entry("summary", S_IFREG|S_IRUGO, mpt_proc_root_dir);
+	if (ent)
+		ent->read_proc = procmpt_summary_read;
 
-	ioc = mpt_adapter_find_first();
-	while (ioc != NULL) {
-		struct proc_dir_entry	*dent;
-		/*
-		 *  Create "/proc/mpt/iocN" subdirectory entry for each MPT adapter.
-		 */
-		if ((dent = proc_mkdir(ioc->name, mpt_proc_root_dir)) != NULL) {
-			/*
-			 *  And populate it with mpt_ioc_proc_list[] entries.
-			 */
-			for (ii=0; ii < MPT_IOC_PROC_ENTRIES; ii++) {
-				ent = create_proc_entry(mpt_ioc_proc_list[ii].name,
-						S_IFREG|S_IRUGO, dent);
-				if (!ent) {
-					printk(KERN_WARNING MYNAM
-							": WARNING - Could not create /proc/mpt/%s/%s entry!\n",
-							ioc->name,
-							mpt_ioc_proc_list[ii].name);
-					continue;
-				}
-				ent->read_proc = mpt_ioc_proc_list[ii].f;
-				ent->data      = ioc;
-			}
-		} else {
-			printk(MYIOC_s_WARN_FMT "Could not create /proc/mpt/%s subdir entry!\n",
-					ioc->name, mpt_ioc_proc_list[ii].name);
-		}
-		ioc = mpt_adapter_find_next(ioc);
-	}
+	ent = create_proc_entry("version", S_IFREG|S_IRUGO, mpt_proc_root_dir);
+	if (ent)
+		ent->read_proc = procmpt_version_read;
 
 	return 0;
 }
@@ -5431,49 +5127,12 @@ procmpt_create(void)
  *
  *	Returns 0 for success, non-zero for failure.
  */
-static int
+static void
 procmpt_destroy(void)
 {
-	MPT_ADAPTER	*ioc;
-	int		 ii;
-
-	if (!mpt_proc_root_dir)
-		return 0;
-
-	/*
-	 *	BEWARE: If/when MPT_PROCFS_MPTBASEDIR changes from "mpt"
-	 *	(single level) to multi level (e.g. "driver/message/fusion")
-	 *	something here needs to change.  -sralston
-	 */
-
-	ioc = mpt_adapter_find_first();
-	while (ioc != NULL) {
-		char pname[32];
-		int namelen;
-
-		namelen = sprintf(pname, MPT_PROCFS_MPTBASEDIR "/%s", ioc->name);
-
-		/*
-		 *  Tear down each "/proc/mpt/iocN" subdirectory.
-		 */
-		for (ii=0; ii < MPT_IOC_PROC_ENTRIES; ii++) {
-			(void) sprintf(pname+namelen, "/%s", mpt_ioc_proc_list[ii].name);
-			remove_proc_entry(pname, NULL);
-		}
-		remove_proc_entry(ioc->name, mpt_proc_root_dir);
-		ioc = mpt_adapter_find_next(ioc);
-	}
-
-	for (ii=0; ii < MPT_PROC_ENTRIES; ii++)
-		remove_proc_entry(mpt_proc_list[ii].name, mpt_proc_root_dir);
-
-	if (atomic_read((atomic_t *)&mpt_proc_root_dir->count) == 0) {
-		remove_proc_entry(MPT_PROCFS_MPTBASEDIR, NULL);
-		mpt_proc_root_dir = NULL;
-		return 0;
-	}
-
-	return -1;
+	remove_proc_entry("version", mpt_proc_root_dir);
+	remove_proc_entry("summary", mpt_proc_root_dir);
+	remove_proc_entry(MPT_PROCFS_MPTBASEDIR, NULL);
 }
 
 /*=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=*/
@@ -5496,26 +5155,25 @@ procmpt_summary_read(char *buf, char **start, off_t offset, int request, int *eo
 	char *out = buf;
 	int len;
 
-	if (data == NULL)
-		ioc = mpt_adapter_find_first();
-	else
-		ioc = data;
-
-	while (ioc) {
-		int	more = 0;
+	if (data) {
+		int more = 0;
 
+		ioc = data;
 		mpt_print_ioc_summary(ioc, out, &more, 0, 1);
 
 		out += more;
-		if ((out-buf) >= request) {
-			break;
-		}
+	} else {
+		list_for_each_entry(ioc, &ioc_list, list) {
+			int	more = 0;
 
-		if (data == NULL)
-			ioc = mpt_adapter_find_next(ioc);
-		else
-			ioc = NULL;		/* force exit for iocN */
+			mpt_print_ioc_summary(ioc, out, &more, 0, 1);
+
+			out += more;
+			if ((out-buf) >= request)
+				break;
+		}
 	}
+
 	len = out - buf;
 
 	MPT_PROC_READ_RETURN(buf,start,offset,request,eof,len);
@@ -6293,7 +5951,7 @@ mpt_deregister_ascqops_strings(void)
 
 /*=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=*/
 
-EXPORT_SYMBOL(mpt_adapters);
+EXPORT_SYMBOL(ioc_list);
 EXPORT_SYMBOL(mpt_proc_root_dir);
 EXPORT_SYMBOL(DmpService);
 EXPORT_SYMBOL(mpt_register);
@@ -6311,8 +5969,6 @@ EXPORT_SYMBOL(mpt_add_sge);
 EXPORT_SYMBOL(mpt_add_chain);
 EXPORT_SYMBOL(mpt_send_handshake_request);
 EXPORT_SYMBOL(mpt_handshake_req_reply_wait);
-EXPORT_SYMBOL(mpt_adapter_find_first);
-EXPORT_SYMBOL(mpt_adapter_find_next);
 EXPORT_SYMBOL(mpt_verify_adapter);
 EXPORT_SYMBOL(mpt_GetIocState);
 EXPORT_SYMBOL(mpt_print_ioc_summary);
@@ -6367,7 +6023,6 @@ fusion_init(void)
 	show_mptmod_ver(my_NAME, my_VERSION);
 	printk(KERN_INFO COPYRIGHT "\n");
 
-	Q_INIT(&MptAdapters, MPT_ADAPTER);			/* set to empty */
 	for (i = 0; i < MPT_MAX_PROTOCOL_DRIVERS; i++) {
 		MptCallbacks[i] = NULL;
 		MptDriverClass[i] = MPTUNKNOWN_DRIVER;
@@ -6391,13 +6046,12 @@ fusion_init(void)
 		/* FIXME! */
 	}
 
-	r = pci_module_init(&mptbase_driver);
-	if(r)
-		return(r);
-
 #ifdef CONFIG_PROC_FS
 	(void) procmpt_create();
 #endif
+	r = pci_module_init(&mptbase_driver);
+	if(r)
+		return(r);
 
 	return r;
 }
@@ -6413,16 +6067,14 @@ static void __exit
 fusion_exit(void)
 {
 
-	dprintk((KERN_INFO MYNAM ": fusion_exit() called!\n"));
+	dexitprintk((KERN_INFO MYNAM ": fusion_exit() called!\n"));
 
-	/* Whups?  20010120 -sralston
-	 *  Moved this *above* removal of all MptAdapters!
-	 */
-#ifdef CONFIG_PROC_FS
-	(void) procmpt_destroy();
-#endif
 	pci_unregister_driver(&mptbase_driver);
 	mpt_reset_deregister(mpt_base_index);
+
+#ifdef CONFIG_PROC_FS
+	procmpt_destroy();
+#endif
 }
 
 
diff --git a/drivers/message/fusion/mptbase.h b/drivers/message/fusion/mptbase.h
index 8b4484404..8a84b72a3 100644
--- a/drivers/message/fusion/mptbase.h
+++ b/drivers/message/fusion/mptbase.h
@@ -55,7 +55,11 @@
 #define MPTBASE_H_INCLUDED
 /*{-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=*/
 
-#include "linux_compat.h"	/* linux-2.2.x (vs. -2.4.x) tweaks */
+#include <linux/version.h>
+#include <linux/config.h>
+#include <linux/kernel.h>
+#include <linux/pci.h>
+
 #include "scsi3.h"		/* SCSI defines */
 
 #include "lsi/mpi_type.h"
@@ -81,8 +85,8 @@
 #define COPYRIGHT	"Copyright (c) 1999-2004 " MODULEAUTHOR
 #endif
 
-#define MPT_LINUX_VERSION_COMMON	"3.01.06"
-#define MPT_LINUX_PACKAGE_NAME		"@(#)mptlinux-3.01.06"
+#define MPT_LINUX_VERSION_COMMON	"3.01.09"
+#define MPT_LINUX_PACKAGE_NAME		"@(#)mptlinux-3.01.09"
 #define WHAT_MAGIC_STRING		"@" "(" "#" ")"
 
 #define show_mptmod_ver(s,ver)  \
@@ -577,13 +581,6 @@ typedef	struct _ScsiCfgData {
 	u8		 rsvd[1];
 } ScsiCfgData;
 
-typedef struct _fw_image {
-	char		*fw;
-	dma_addr_t	 fw_dma;
-	u32		 size;
-	u32		 rsvd;
-} fw_image_t;
-
 /*
  *  Adapter Structure - pci_dev specific. Maximum: MPT_MAX_ADAPTERS
  */
@@ -655,9 +652,9 @@ typedef struct _MPT_ADAPTER
 	int			timeout_maxcnt;
 #endif
 	struct _mpt_ioctl_events *events;	/* pointer to event log */
-	fw_image_t		**cached_fw;	/* Pointer to FW SG List */
+	u8			*cached_fw;	/* Pointer to FW */
+	dma_addr_t	 	cached_fw_dma;
 	Q_TRACKER		 configQ;	/* linked list of config. requests */
-	int			 num_fw_frags;	/* Number of SGE in FW SG List */
 	int			 hs_reply_idx;
 #ifndef MFCNT
 	u32			 pad0;
@@ -678,6 +675,7 @@ typedef struct _MPT_ADAPTER
 	u8			 upload_fw;	/* If set, do a fw upload */
 	u8			 reload_fw;	/* Force a FW Reload on next reset */
 	u8			 pad1[5];
+	struct list_head	 list; 
 } MPT_ADAPTER;
 
 
@@ -738,6 +736,33 @@ typedef struct _mpt_sge {
 #define dprintk(x)
 #endif
 
+#ifdef MPT_DEBUG_INIT
+#define dinitprintk(x)  printk x
+#define DBG_DUMP_FW_REQUEST_FRAME(mfp) \
+	{	int  i, n = 10;						\
+		u32 *m = (u32 *)(mfp);					\
+		printk(KERN_INFO " ");					\
+		for (i=0; i<n; i++)					\
+			printk(" %08x", le32_to_cpu(m[i]));		\
+		printk("\n");						\
+	}
+#else
+#define dinitprintk(x)
+#define DBG_DUMP_FW_REQUEST_FRAME(mfp)
+#endif
+
+#ifdef MPT_DEBUG_EXIT
+#define dexitprintk(x)  printk x
+#else
+#define dexitprintk(x)
+#endif
+
+#ifdef MPT_DEBUG_RESET
+#define drsprintk(x)  printk x
+#else
+#define drsprintk(x)
+#endif
+
 #ifdef MPT_DEBUG_HANDSHAKE
 #define dhsprintk(x)  printk x
 #else
@@ -971,19 +996,6 @@ typedef struct _MPT_SCSI_HOST {
 	ushort			  sel_timeout[MPT_MAX_FC_DEVICES];
 } MPT_SCSI_HOST;
 
-/*
- *	Structure for overlaying onto scsi_cmnd->SCp area
- *	NOTE: SCp area is 36 bytes min, 44 bytes max?
- */
-typedef struct _scPrivate {
-	struct scsi_cmnd	*forw;
-	struct scsi_cmnd	*back;
-	void			*p1;
-	void			*p2;
-	u8			 io_path_id;	/* DMP */
-	u8			 pad[7];
-} scPrivate;
-
 /*=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=*/
 /*
  *	More Dynamic Multi-Pathing stuff...
@@ -1045,31 +1057,29 @@ extern int	 mpt_device_driver_register(struct mpt_pci_driver * dd_cbfunc, int cb
 extern void	 mpt_device_driver_deregister(int cb_idx);
 extern int	 mpt_register_ascqops_strings(void *ascqTable, int ascqtbl_sz, const char **opsTable);
 extern void	 mpt_deregister_ascqops_strings(void);
-extern MPT_FRAME_HDR	*mpt_get_msg_frame(int handle, int iocid);
-extern void	 mpt_free_msg_frame(int handle, int iocid, MPT_FRAME_HDR *mf);
-extern void	 mpt_put_msg_frame(int handle, int iocid, MPT_FRAME_HDR *mf);
+extern MPT_FRAME_HDR	*mpt_get_msg_frame(int handle, MPT_ADAPTER *ioc);
+extern void	 mpt_free_msg_frame(int handle, MPT_ADAPTER *ioc, MPT_FRAME_HDR *mf);
+extern void	 mpt_put_msg_frame(int handle, MPT_ADAPTER *ioc, MPT_FRAME_HDR *mf);
 extern void	 mpt_add_sge(char *pAddr, u32 flagslength, dma_addr_t dma_addr);
 extern void	 mpt_add_chain(char *pAddr, u8 next, u16 length, dma_addr_t dma_addr);
 
-extern int	 mpt_send_handshake_request(int handle, int iocid, int reqBytes, u32 *req, int sleepFlag);
+extern int	 mpt_send_handshake_request(int handle, MPT_ADAPTER *ioc, int reqBytes, u32 *req, int sleepFlag);
 extern int	 mpt_handshake_req_reply_wait(MPT_ADAPTER *ioc, int reqBytes, u32 *req, int replyBytes, u16 *u16reply, int maxwait, int sleepFlag);
 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 u32	 mpt_GetIocState(MPT_ADAPTER *ioc, int cooked);
 extern void	 mpt_print_ioc_summary(MPT_ADAPTER *ioc, char *buf, int *size, int len, int showlan);
 extern int	 mpt_HardResetHandler(MPT_ADAPTER *ioc, int sleepFlag);
 extern int	 mpt_config(MPT_ADAPTER *ioc, CONFIGPARMS *cfg);
 extern int	 mpt_toolbox(MPT_ADAPTER *ioc, CONFIGPARMS *cfg);
-extern void	*mpt_alloc_fw_memory(MPT_ADAPTER *ioc, int size, int *frags, int *alloc_sz);
-extern void	 mpt_free_fw_memory(MPT_ADAPTER *ioc, fw_image_t **alt_img);
+extern void	 mpt_alloc_fw_memory(MPT_ADAPTER *ioc, int size);
+extern void	 mpt_free_fw_memory(MPT_ADAPTER *ioc);
 extern int	 mpt_findImVolumes(MPT_ADAPTER *ioc);
 extern int	 mpt_read_ioc_pg_3(MPT_ADAPTER *ioc);
 
 /*
  *  Public data decl's...
  */
-extern MPT_ADAPTER	 	*mpt_adapters[MPT_MAX_ADAPTERS];
+extern struct list_head	  ioc_list;
 extern struct proc_dir_entry	*mpt_proc_root_dir;
 extern DmpServices_t		*DmpService;
 
diff --git a/drivers/message/fusion/mptctl.c b/drivers/message/fusion/mptctl.c
index 434ceb1ca..c6163a424 100644
--- a/drivers/message/fusion/mptctl.c
+++ b/drivers/message/fusion/mptctl.c
@@ -83,14 +83,16 @@
 #include <linux/pci.h>
 #include <linux/miscdevice.h>
 #include <linux/smp_lock.h>
+#include <linux/compat.h>
 
 #include <asm/io.h>
 #include <asm/uaccess.h>
 
-#include <linux/kdev_t.h>	/* needed for access to Scsi_Host struct */
-#include <linux/blkdev.h>
-#include "../../scsi/scsi.h"
-#include "../../scsi/hosts.h"
+#include <scsi/scsi.h>
+#include <scsi/scsi_cmnd.h>
+#include <scsi/scsi_device.h>
+#include <scsi/scsi_host.h>
+#include <scsi/scsi_tcq.h>
 
 #define COPYRIGHT	"Copyright (c) 1999-2004 LSI Logic Corporation"
 #define MODULEAUTHOR	"Steven J. Ralston, Noah Romer, Pamela Delaney"
@@ -102,9 +104,6 @@
 #define my_VERSION	MPT_LINUX_VERSION_COMMON
 #define MYNAM		"mptctl"
 
-#if LINUX_VERSION_CODE < KERNEL_VERSION(2,5,62)
-EXPORT_NO_SYMBOLS;
-#endif
 MODULE_AUTHOR(MODULEAUTHOR);
 MODULE_DESCRIPTION(my_NAME);
 MODULE_LICENSE("GPL");
@@ -144,8 +143,8 @@ static int mptctl_hp_targetinfo(unsigned long arg);
 /*
  * Private function calls.
  */
-static int mptctl_do_mpt_command (struct mpt_ioctl_command karg, char *mfPtr, int local);
-static int mptctl_do_fw_download(int ioc, char *ufwbuf, size_t fwlen);
+static int mptctl_do_mpt_command (struct mpt_ioctl_command karg, void __user *mfPtr);
+static int mptctl_do_fw_download(int ioc, char __user *ufwbuf, size_t fwlen);
 static MptSge_t *kbuf_alloc_2_sgl( int bytes, u32 dir, int sge_offset, int *frags,
 		struct buflist **blp, dma_addr_t *sglbuf_dma, MPT_ADAPTER *ioc);
 static void kfree_sgl( MptSge_t *sgl, dma_addr_t sgl_dma,
@@ -402,7 +401,7 @@ static int mptctl_bus_reset(MPT_IOCTL *ioctl)
 
 	/* Send request
 	 */
-	if ((mf = mpt_get_msg_frame(mptctl_id, ioctl->ioc->id)) == NULL) {
+	if ((mf = mpt_get_msg_frame(mptctl_id, ioctl->ioc)) == NULL) {
 		dctlprintk((MYIOC_s_WARN_FMT "IssueTaskMgmt, no msg frames!!\n",
 				ioctl->ioc->name));
 
@@ -437,7 +436,7 @@ static int mptctl_bus_reset(MPT_IOCTL *ioctl)
 	ioctl->status |= MPT_IOCTL_STATUS_TMTIMER_ACTIVE;
 	add_timer(&ioctl->TMtimer);
 
-	retval = mpt_send_handshake_request(mptctl_id, ioctl->ioc->id,
+	retval = mpt_send_handshake_request(mptctl_id, ioctl->ioc,
 			sizeof(SCSITaskMgmt_t), (u32*)pScsiTm, NO_SLEEP);
 
 	if (retval != 0) {
@@ -446,7 +445,7 @@ static int mptctl_bus_reset(MPT_IOCTL *ioctl)
 
 		mptctl_free_tm_flags(ioctl->ioc);
 		del_timer(&ioctl->TMtimer);
-		mpt_free_msg_frame(mptctl_id, ioctl->ioc->id, mf);
+		mpt_free_msg_frame(mptctl_id, ioctl->ioc, mf);
 		ioctl->tmPtr = NULL;
 	}
 
@@ -521,7 +520,7 @@ mptctl_ioc_reset(MPT_ADAPTER *ioc, int reset_phase)
 		if (ioctl && (ioctl->status & MPT_IOCTL_STATUS_TMTIMER_ACTIVE)){
 			ioctl->status &= ~MPT_IOCTL_STATUS_TMTIMER_ACTIVE;
 			del_timer(&ioctl->TMtimer);
-			mpt_free_msg_frame(mptctl_id, ioc->id, ioctl->tmPtr);
+			mpt_free_msg_frame(mptctl_id, ioc, ioctl->tmPtr);
 		}
 
 	} else {
@@ -545,38 +544,6 @@ mptctl_ioc_reset(MPT_ADAPTER *ioc, int reset_phase)
 	return 1;
 }
 
-/*=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=*/
-/*
- *  struct file_operations functionality.
- *  Members:
- *	llseek, write, read, ioctl, open, release
- */
-/*=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=*/
-#if LINUX_VERSION_CODE < KERNEL_VERSION(2,4,9)
-static loff_t
-mptctl_llseek(struct file *file, loff_t offset, int origin)
-{
-	return -ESPIPE;
-}
-#define no_llseek mptctl_llseek
-#endif
-
-/*=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=*/
-static ssize_t
-mptctl_write(struct file *file, const char *buf, size_t count, loff_t *ppos)
-{
-	printk(KERN_ERR MYNAM ": ioctl WRITE not yet supported\n");
-	return 0;
-}
-
-/*=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=*/
-static ssize_t
-mptctl_read(struct file *file, char *buf, size_t count, loff_t *ptr)
-{
-	printk(KERN_ERR MYNAM ": ioctl READ not yet supported\n");
-	return 0;
-}
-
 /*=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=*/
 /*
  *  MPT ioctl handler
@@ -586,7 +553,7 @@ mptctl_read(struct file *file, char *buf, size_t count, loff_t *ptr)
 static int
 mptctl_ioctl(struct inode *inode, struct file *file, unsigned int cmd, unsigned long arg)
 {
-	mpt_ioctl_header	*uhdr = (mpt_ioctl_header *) arg;
+	mpt_ioctl_header __user *uhdr = (void __user *) arg;
 	mpt_ioctl_header	 khdr;
 	int iocnum;
 	unsigned iocnumX;
@@ -599,7 +566,7 @@ mptctl_ioctl(struct inode *inode, struct file *file, unsigned int cmd, unsigned
 	if (copy_from_user(&khdr, uhdr, sizeof(khdr))) {
 		printk(KERN_ERR "%s::mptctl_ioctl() @%d - "
 				"Unable to copy mpt_ioctl_header data @ %p\n",
-				__FILE__, __LINE__, (void*)uhdr);
+				__FILE__, __LINE__, uhdr);
 		return -EFAULT;
 	}
 	ret = -ENXIO;				/* (-6) No such device or address */
@@ -671,7 +638,7 @@ mptctl_ioctl(struct inode *inode, struct file *file, unsigned int cmd, unsigned
 
 static int mptctl_do_reset(unsigned long arg)
 {
-	struct mpt_ioctl_diag_reset *urinfo = (struct mpt_ioctl_diag_reset *) arg;
+	struct mpt_ioctl_diag_reset __user *urinfo = (void __user *) arg;
 	struct mpt_ioctl_diag_reset krinfo;
 	MPT_ADAPTER		*iocp;
 
@@ -680,7 +647,7 @@ static int mptctl_do_reset(unsigned long arg)
 	if (copy_from_user(&krinfo, urinfo, sizeof(struct mpt_ioctl_diag_reset))) {
 		printk(KERN_ERR "%s@%d::mptctl_do_reset - "
 				"Unable to copy mpt_ioctl_diag_reset struct @ %p\n",
-				__FILE__, __LINE__, (void*)urinfo);
+				__FILE__, __LINE__, urinfo);
 		return -EFAULT;
 	}
 
@@ -699,21 +666,6 @@ static int mptctl_do_reset(unsigned long arg)
 	return 0;
 }
 
-/*=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=*/
-static int mptctl_open(struct inode *inode, struct file *file)
-{
-	/*
-	 * Should support multiple management users
-	 */
-	return 0;
-}
-
-/*=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=*/
-static int mptctl_release(struct inode *inode, struct file *file)
-{
-	return 0;
-}
-
 /*=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=*/
 /*
  * MPT FW download function.  Cast the arg into the mpt_fw_xfer structure.
@@ -734,14 +686,14 @@ static int mptctl_release(struct inode *inode, struct file *file)
 static int
 mptctl_fw_download(unsigned long arg)
 {
-	struct mpt_fw_xfer	*ufwdl = (struct mpt_fw_xfer *) arg;
+	struct mpt_fw_xfer __user *ufwdl = (void __user *) arg;
 	struct mpt_fw_xfer	 kfwdl;
 
 	dctlprintk((KERN_INFO "mptctl_fwdl called. mptctl_id = %xh\n", mptctl_id)); //tc
 	if (copy_from_user(&kfwdl, ufwdl, sizeof(struct mpt_fw_xfer))) {
 		printk(KERN_ERR "%s@%d::_ioctl_fwdl - "
 				"Unable to copy mpt_fw_xfer struct @ %p\n",
-				__FILE__, __LINE__, (void*)ufwdl);
+				__FILE__, __LINE__, ufwdl);
 		return -EFAULT;
 	}
 
@@ -763,7 +715,7 @@ mptctl_fw_download(unsigned long arg)
  *		-ENOMSG if FW upload returned bad status
  */
 static int
-mptctl_do_fw_download(int ioc, char *ufwbuf, size_t fwlen)
+mptctl_do_fw_download(int ioc, char __user *ufwbuf, size_t fwlen)
 {
 	FWDownload_t		*dlmsg;
 	MPT_FRAME_HDR		*mf;
@@ -800,7 +752,7 @@ mptctl_do_fw_download(int ioc, char *ufwbuf, size_t fwlen)
 
 	/*  Valid device. Get a message frame and construct the FW download message.
 	 */
-	if ((mf = mpt_get_msg_frame(mptctl_id, ioc)) == NULL)
+	if ((mf = mpt_get_msg_frame(mptctl_id, iocp)) == NULL)
 		return -EAGAIN;
 	dlmsg = (FWDownload_t*) mf;
 	ptsge = (FWDownloadTCSGE_t *) &dlmsg->SGL;
@@ -892,7 +844,7 @@ mptctl_do_fw_download(int ioc, char *ufwbuf, size_t fwlen)
 			if (copy_from_user(bl->kptr, ufwbuf+fw_bytes_copied, bl->len)) {
 				printk(KERN_ERR "%s@%d::_ioctl_fwdl - "
 						"Unable to copy f/w buffer hunk#%d @ %p\n",
-						__FILE__, __LINE__, n, (void*)ufwbuf);
+						__FILE__, __LINE__, n, ufwbuf);
 				goto fwdl_out;
 			}
 			fw_bytes_copied += bl->len;
@@ -916,7 +868,7 @@ mptctl_do_fw_download(int ioc, char *ufwbuf, size_t fwlen)
 	 * Finally, perform firmware download.
 	 */
 	ReplyMsg = NULL;
-	mpt_put_msg_frame(mptctl_id, ioc, mf);
+	mpt_put_msg_frame(mptctl_id, iocp, mf);
 
 	/*
 	 *  Wait until the reply has been received
@@ -1198,7 +1150,7 @@ kfree_sgl(MptSge_t *sgl, dma_addr_t sgl_dma, struct buflist *buflist, MPT_ADAPTE
 static int
 mptctl_getiocinfo (unsigned long arg, unsigned int data_size)
 {
-	struct mpt_ioctl_iocinfo *uarg = (struct mpt_ioctl_iocinfo *) arg;
+	struct mpt_ioctl_iocinfo __user *uarg = (void __user *) arg;
 	struct mpt_ioctl_iocinfo *karg;
 	MPT_ADAPTER		*ioc;
 	struct pci_dev		*pdev;
@@ -1238,7 +1190,7 @@ mptctl_getiocinfo (unsigned long arg, unsigned int data_size)
 	if (copy_from_user(karg, uarg, data_size)) {
 		printk(KERN_ERR "%s@%d::mptctl_getiocinfo - "
 			"Unable to read in mpt_ioctl_iocinfo struct @ %p\n",
-				__FILE__, __LINE__, (void*)uarg);
+				__FILE__, __LINE__, uarg);
 		kfree(karg);
 		return -EFAULT;
 	}
@@ -1278,10 +1230,8 @@ mptctl_getiocinfo (unsigned long arg, unsigned int data_size)
 	karg->pciId = pdev->device;
 	pci_read_config_byte(pdev, PCI_CLASS_REVISION, &revision);
 	karg->hwRev = revision;
-#if LINUX_VERSION_CODE >= KERNEL_VERSION(2,4,0)
 	karg->subSystemDevice = pdev->subsystem_device;
 	karg->subSystemVendor = pdev->subsystem_vendor;
-#endif
 
 	if (cim_rev == 1) {
 		/* Get the PCI bus, device, and function numbers for the IOC
@@ -1335,10 +1285,10 @@ mptctl_getiocinfo (unsigned long arg, unsigned int data_size)
 
 	/* Copy the data from kernel memory to user memory
 	 */
-	if (copy_to_user((char *)arg, karg, data_size)) {
+	if (copy_to_user((char __user *)arg, karg, data_size)) {
 		printk(KERN_ERR "%s@%d::mptctl_getiocinfo - "
 			"Unable to write out mpt_ioctl_iocinfo struct @ %p\n",
-				__FILE__, __LINE__, (void*)uarg);
+				__FILE__, __LINE__, uarg);
 		kfree(karg);
 		return -EFAULT;
 	}
@@ -1360,7 +1310,7 @@ mptctl_getiocinfo (unsigned long arg, unsigned int data_size)
 static int
 mptctl_gettargetinfo (unsigned long arg)
 {
-	struct mpt_ioctl_targetinfo *uarg = (struct mpt_ioctl_targetinfo *) arg;
+	struct mpt_ioctl_targetinfo __user *uarg = (void __user *) arg;
 	struct mpt_ioctl_targetinfo karg;
 	MPT_ADAPTER		*ioc;
 	struct Scsi_Host	*sh;
@@ -1369,6 +1319,7 @@ mptctl_gettargetinfo (unsigned long arg)
 	char			*pmem;
 	int			*pdata;
 	IOCPage2_t		*pIoc2;
+	IOCPage3_t		*pIoc3;
 	int			iocnum;
 	int			numDevices = 0;
 	unsigned int		max_id;
@@ -1382,7 +1333,7 @@ mptctl_gettargetinfo (unsigned long arg)
 	if (copy_from_user(&karg, uarg, sizeof(struct mpt_ioctl_targetinfo))) {
 		printk(KERN_ERR "%s@%d::mptctl_gettargetinfo - "
 			"Unable to read in mpt_ioctl_targetinfo struct @ %p\n",
-				__FILE__, __LINE__, (void*)uarg);
+				__FILE__, __LINE__, uarg);
 		return -EFAULT;
 	}
 
@@ -1445,53 +1396,57 @@ mptctl_gettargetinfo (unsigned long arg)
 		if (hd && hd->Targets) {
 			mpt_findImVolumes(ioc);
 			pIoc2 = ioc->spi_data.pIocPg2;
-			for ( id = 0; id <= max_id; id++ ) {
-				if ( pIoc2 && pIoc2->NumActiveVolumes &&
-					( id == pIoc2->RaidVolume[0].VolumeID ) ) {
-					if (maxWordsLeft <= 0) {
-						printk(KERN_ERR "mptctl_gettargetinfo - "
+			for ( id = 0; id <= max_id; ) {
+				if ( pIoc2 && pIoc2->NumActiveVolumes ) {
+					if ( id == pIoc2->RaidVolume[0].VolumeID ) {
+						if (maxWordsLeft <= 0) {
+							printk(KERN_ERR "mptctl_gettargetinfo - "
 			"buffer is full but volume is available on ioc %d\n, numDevices=%d", iocnum, numDevices);
-						goto data_space_full;
-					}
-                    			if ( ( pIoc2->RaidVolume[0].Flags & MPI_IOCPAGE2_FLAG_VOLUME_INACTIVE ) == 0 )
-                        			devType = 0x80;
-                    			else
-                        			devType = 0xC0;
-					bus_id = pIoc2->RaidVolume[0].VolumeBus;
-	            			numDevices++;
-                    			*pdata = ( (devType << 24) | (bus_id << 8) | id );
-					dctlprintk((KERN_ERR "mptctl_gettargetinfo - "
+							goto data_space_full;
+						}
+						if ( ( pIoc2->RaidVolume[0].Flags & MPI_IOCPAGE2_FLAG_VOLUME_INACTIVE ) == 0 )
+                        				devType = 0x80;
+                    				else
+                        				devType = 0xC0;
+						bus_id = pIoc2->RaidVolume[0].VolumeBus;
+	            				numDevices++;
+                    				*pdata = ( (devType << 24) | (bus_id << 8) | id );
+						dctlprintk((KERN_ERR "mptctl_gettargetinfo - "
 		"volume ioc=%d target=%x numDevices=%d pdata=%p\n", iocnum, *pdata, numDevices, pdata));
-                    			pdata++;
-					--maxWordsLeft;
-            			} else {
-					vdev = hd->Targets[id];
-					if (vdev) {
-						for (jj = 0; jj <= MPT_LAST_LUN; jj++) {
-							lun_index = (jj >> 5);
-							indexed_lun = (jj % 32);
-							lun = (1 << indexed_lun);
-							if (vdev->luns[lun_index] & lun) {
-								if (maxWordsLeft <= 0) {
-									printk(KERN_ERR
-									"mptctl_gettargetinfo - "
-									"buffer is full but more targets are available on ioc %d numDevices=%d\n",
-									iocnum, numDevices);
-									goto data_space_full;
-								}
-								bus_id = vdev->bus_id;
-								numDevices++;
-                            					*pdata = ( (jj << 16) | (bus_id << 8) | id );
-								dctlprintk((KERN_ERR
-								 "mptctl_gettargetinfo - "
-								 "target ioc=%d target=%x numDevices=%d pdata=%p\n",
-								 iocnum, *pdata, numDevices, pdata));
-								pdata++;
-								--maxWordsLeft;
+                    				pdata++;
+						--maxWordsLeft;
+						goto next_id;
+					} else {
+						pIoc3 = ioc->spi_data.pIocPg3;
+            					for ( jj = 0; jj < pIoc3->NumPhysDisks; jj++ ) {
+                    					if ( pIoc3->PhysDisk[jj].PhysDiskID == id )
+								goto next_id;
+						}
+					}
+				}
+				if ( (vdev = hd->Targets[id]) ) {
+					for (jj = 0; jj <= MPT_LAST_LUN; jj++) {
+						lun_index = (jj >> 5);
+						indexed_lun = (jj % 32);
+						lun = (1 << indexed_lun);
+						if (vdev->luns[lun_index] & lun) {
+							if (maxWordsLeft <= 0) {
+								printk(KERN_ERR "mptctl_gettargetinfo - "
+			"buffer is full but more targets are available on ioc %d numDevices=%d\n", iocnum, numDevices);
+								goto data_space_full;
 							}
+							bus_id = vdev->bus_id;
+							numDevices++;
+                            				*pdata = ( (jj << 16) | (bus_id << 8) | id );
+							dctlprintk((KERN_ERR "mptctl_gettargetinfo - "
+		"target ioc=%d target=%x numDevices=%d pdata=%p\n", iocnum, *pdata, numDevices, pdata));
+							pdata++;
+							--maxWordsLeft;
 						}
 					}
 				}
+next_id:
+				id++;
 			}
 		}
 	}
@@ -1500,21 +1455,21 @@ data_space_full:
 
 	/* Copy part of the data from kernel memory to user memory
 	 */
-	if (copy_to_user((char *)arg, &karg,
+	if (copy_to_user((char __user *)arg, &karg,
 				sizeof(struct mpt_ioctl_targetinfo))) {
 		printk(KERN_ERR "%s@%d::mptctl_gettargetinfo - "
 			"Unable to write out mpt_ioctl_targetinfo struct @ %p\n",
-				__FILE__, __LINE__, (void*)uarg);
+				__FILE__, __LINE__, uarg);
 		kfree(pmem);
 		return -EFAULT;
 	}
 
 	/* Copy the remaining data from kernel memory to user memory
 	 */
-	if (copy_to_user((char *) uarg->targetInfo, pmem, numBytes)) {
+	if (copy_to_user(uarg->targetInfo, pmem, numBytes)) {
 		printk(KERN_ERR "%s@%d::mptctl_gettargetinfo - "
 			"Unable to write out mpt_ioctl_targetinfo struct @ %p\n",
-				__FILE__, __LINE__, (void*)pdata);
+				__FILE__, __LINE__, pdata);
 		kfree(pmem);
 		return -EFAULT;
 	}
@@ -1535,7 +1490,7 @@ data_space_full:
 static int
 mptctl_readtest (unsigned long arg)
 {
-	struct mpt_ioctl_test	*uarg = (struct mpt_ioctl_test *) arg;
+	struct mpt_ioctl_test __user *uarg = (void __user *) arg;
 	struct mpt_ioctl_test	 karg;
 	MPT_ADAPTER *ioc;
 	int iocnum;
@@ -1544,7 +1499,7 @@ mptctl_readtest (unsigned long arg)
 	if (copy_from_user(&karg, uarg, sizeof(struct mpt_ioctl_test))) {
 		printk(KERN_ERR "%s@%d::mptctl_readtest - "
 			"Unable to read in mpt_ioctl_test struct @ %p\n",
-				__FILE__, __LINE__, (void*)uarg);
+				__FILE__, __LINE__, uarg);
 		return -EFAULT;
 	}
 
@@ -1571,10 +1526,10 @@ mptctl_readtest (unsigned long arg)
 
 	/* Copy the data from kernel memory to user memory
 	 */
-	if (copy_to_user((char *)arg, &karg, sizeof(struct mpt_ioctl_test))) {
+	if (copy_to_user((char __user *)arg, &karg, sizeof(struct mpt_ioctl_test))) {
 		printk(KERN_ERR "%s@%d::mptctl_readtest - "
 			"Unable to write out mpt_ioctl_test struct @ %p\n",
-				__FILE__, __LINE__, (void*)uarg);
+				__FILE__, __LINE__, uarg);
 		return -EFAULT;
 	}
 
@@ -1595,7 +1550,7 @@ mptctl_readtest (unsigned long arg)
 static int
 mptctl_eventquery (unsigned long arg)
 {
-	struct mpt_ioctl_eventquery	*uarg = (struct mpt_ioctl_eventquery *) arg;
+	struct mpt_ioctl_eventquery __user *uarg = (void __user *) arg;
 	struct mpt_ioctl_eventquery	 karg;
 	MPT_ADAPTER *ioc;
 	int iocnum;
@@ -1604,7 +1559,7 @@ mptctl_eventquery (unsigned long arg)
 	if (copy_from_user(&karg, uarg, sizeof(struct mpt_ioctl_eventquery))) {
 		printk(KERN_ERR "%s@%d::mptctl_eventquery - "
 			"Unable to read in mpt_ioctl_eventquery struct @ %p\n",
-				__FILE__, __LINE__, (void*)uarg);
+				__FILE__, __LINE__, uarg);
 		return -EFAULT;
 	}
 
@@ -1620,10 +1575,10 @@ mptctl_eventquery (unsigned long arg)
 
 	/* Copy the data from kernel memory to user memory
 	 */
-	if (copy_to_user((char *)arg, &karg, sizeof(struct mpt_ioctl_eventquery))) {
+	if (copy_to_user((char __user *)arg, &karg, sizeof(struct mpt_ioctl_eventquery))) {
 		printk(KERN_ERR "%s@%d::mptctl_eventquery - "
 			"Unable to write out mpt_ioctl_eventquery struct @ %p\n",
-				__FILE__, __LINE__, (void*)uarg);
+				__FILE__, __LINE__, uarg);
 		return -EFAULT;
 	}
 	return 0;
@@ -1633,7 +1588,7 @@ mptctl_eventquery (unsigned long arg)
 static int
 mptctl_eventenable (unsigned long arg)
 {
-	struct mpt_ioctl_eventenable	*uarg = (struct mpt_ioctl_eventenable *) arg;
+	struct mpt_ioctl_eventenable __user *uarg = (void __user *) arg;
 	struct mpt_ioctl_eventenable	 karg;
 	MPT_ADAPTER *ioc;
 	int iocnum;
@@ -1642,7 +1597,7 @@ mptctl_eventenable (unsigned long arg)
 	if (copy_from_user(&karg, uarg, sizeof(struct mpt_ioctl_eventenable))) {
 		printk(KERN_ERR "%s@%d::mptctl_eventenable - "
 			"Unable to read in mpt_ioctl_eventenable struct @ %p\n",
-				__FILE__, __LINE__, (void*)uarg);
+				__FILE__, __LINE__, uarg);
 		return -EFAULT;
 	}
 
@@ -1680,7 +1635,7 @@ mptctl_eventenable (unsigned long arg)
 static int
 mptctl_eventreport (unsigned long arg)
 {
-	struct mpt_ioctl_eventreport	*uarg = (struct mpt_ioctl_eventreport *) arg;
+	struct mpt_ioctl_eventreport __user *uarg = (void __user *) arg;
 	struct mpt_ioctl_eventreport	 karg;
 	MPT_ADAPTER		 *ioc;
 	int			 iocnum;
@@ -1690,7 +1645,7 @@ mptctl_eventreport (unsigned long arg)
 	if (copy_from_user(&karg, uarg, sizeof(struct mpt_ioctl_eventreport))) {
 		printk(KERN_ERR "%s@%d::mptctl_eventreport - "
 			"Unable to read in mpt_ioctl_eventreport struct @ %p\n",
-				__FILE__, __LINE__, (void*)uarg);
+				__FILE__, __LINE__, uarg);
 		return -EFAULT;
 	}
 
@@ -1716,10 +1671,10 @@ mptctl_eventreport (unsigned long arg)
 	/* Copy the data from kernel memory to user memory
 	 */
 	numBytes = max * sizeof(MPT_IOCTL_EVENTS);
-	if (copy_to_user((char *) uarg->eventData, ioc->events, numBytes)) {
+	if (copy_to_user(uarg->eventData, ioc->events, numBytes)) {
 		printk(KERN_ERR "%s@%d::mptctl_eventreport - "
 			"Unable to write out mpt_ioctl_eventreport struct @ %p\n",
-				__FILE__, __LINE__, (void*)ioc->events);
+				__FILE__, __LINE__, ioc->events);
 		return -EFAULT;
 	}
 
@@ -1730,21 +1685,17 @@ mptctl_eventreport (unsigned long arg)
 static int
 mptctl_replace_fw (unsigned long arg)
 {
-	struct mpt_ioctl_replace_fw	*uarg = (struct mpt_ioctl_replace_fw *) arg;
+	struct mpt_ioctl_replace_fw __user *uarg = (void __user *) arg;
 	struct mpt_ioctl_replace_fw	 karg;
 	MPT_ADAPTER		 *ioc;
-	fw_image_t		 **fwmem = NULL;
 	int			 iocnum;
 	int			 newFwSize;
-	int			 num_frags, alloc_sz;
-	int			 ii;
-	u32			 offset;
 
 	dctlprintk(("mptctl_replace_fw called.\n"));
 	if (copy_from_user(&karg, uarg, sizeof(struct mpt_ioctl_replace_fw))) {
 		printk(KERN_ERR "%s@%d::mptctl_replace_fw - "
 			"Unable to read in mpt_ioctl_replace_fw struct @ %p\n",
-				__FILE__, __LINE__, (void*)uarg);
+				__FILE__, __LINE__, uarg);
 		return -EFAULT;
 	}
 
@@ -1755,52 +1706,39 @@ mptctl_replace_fw (unsigned long arg)
 		return -ENODEV;
 	}
 
-	/* If not caching FW, return 0
+	/* If caching FW, Free the old FW image
 	 */
-	if ((ioc->cached_fw == NULL) && (ioc->alt_ioc) && (ioc->alt_ioc->cached_fw == NULL))
+	if (ioc->cached_fw == NULL)
 		return 0;
 
+	mpt_free_fw_memory(ioc);
+
 	/* Allocate memory for the new FW image
 	 */
 	newFwSize = karg.newImageSize;
-	fwmem = mpt_alloc_fw_memory(ioc, newFwSize, &num_frags, &alloc_sz);
-	if (fwmem == NULL)
-		return -ENOMEM;
 
-	offset = 0;
-	for (ii = 0; ii < num_frags; ii++) {
-		/* Copy the data from user memory to kernel space
-		 */
-		if (copy_from_user(fwmem[ii]->fw, uarg->newImage + offset, fwmem[ii]->size)) {
-			printk(KERN_ERR "%s@%d::mptctl_replace_fw - "
-				"Unable to read in mpt_ioctl_replace_fw image @ %p\n",
-					__FILE__, __LINE__, (void*)uarg);
-
-			mpt_free_fw_memory(ioc, fwmem);
-			return -EFAULT;
-		}
-		offset += fwmem[ii]->size;
-	}
+	if (newFwSize & 0x01)
+		newFwSize += 1;
+	if (newFwSize & 0x02)
+		newFwSize += 2;
 
+	mpt_alloc_fw_memory(ioc, newFwSize);
+	if (ioc->cached_fw == NULL)
+		return -ENOMEM;
 
-	/* Free the old FW image
+	/* Copy the data from user memory to kernel space
 	 */
-	if (ioc->cached_fw) {
-		mpt_free_fw_memory(ioc, 0);
-		ioc->cached_fw = fwmem;
-		ioc->alloc_total += alloc_sz;
-	} else if ((ioc->alt_ioc) && (ioc->alt_ioc->cached_fw)) {
-		mpt_free_fw_memory(ioc->alt_ioc, 0);
-		ioc->alt_ioc->cached_fw = fwmem;
-		ioc->alt_ioc->alloc_total += alloc_sz;
+	if (copy_from_user(ioc->cached_fw, uarg->newImage, newFwSize)) {
+		printk(KERN_ERR "%s@%d::mptctl_replace_fw - "
+				"Unable to read in mpt_ioctl_replace_fw image "
+				"@ %p\n", __FILE__, __LINE__, uarg);
+		mpt_free_fw_memory(ioc);
+		return -EFAULT;
 	}
 
 	/* Update IOCFactsReply
 	 */
 	ioc->facts.FWImageSize = newFwSize;
-	if (ioc->alt_ioc)
-		ioc->alt_ioc->facts.FWImageSize = newFwSize;
-
 	return 0;
 }
 
@@ -1819,7 +1757,7 @@ mptctl_replace_fw (unsigned long arg)
 static int
 mptctl_mpt_command (unsigned long arg)
 {
-	struct mpt_ioctl_command *uarg = (struct mpt_ioctl_command *) arg;
+	struct mpt_ioctl_command __user *uarg = (void __user *) arg;
 	struct mpt_ioctl_command  karg;
 	MPT_ADAPTER	*ioc;
 	int		iocnum;
@@ -1830,7 +1768,7 @@ mptctl_mpt_command (unsigned long arg)
 	if (copy_from_user(&karg, uarg, sizeof(struct mpt_ioctl_command))) {
 		printk(KERN_ERR "%s@%d::mptctl_mpt_command - "
 			"Unable to read in mpt_ioctl_command struct @ %p\n",
-				__FILE__, __LINE__, (void*)uarg);
+				__FILE__, __LINE__, uarg);
 		return -EFAULT;
 	}
 
@@ -1841,7 +1779,7 @@ mptctl_mpt_command (unsigned long arg)
 		return -ENODEV;
 	}
 
-	rc = mptctl_do_mpt_command (karg, (char *) &uarg->MF, 0);
+	rc = mptctl_do_mpt_command (karg, &uarg->MF);
 
 	return rc;
 }
@@ -1859,7 +1797,7 @@ mptctl_mpt_command (unsigned long arg)
  *		-EPERM if SCSI I/O and target is untagged
  */
 static int
-mptctl_do_mpt_command (struct mpt_ioctl_command karg, char *mfPtr, int local)
+mptctl_do_mpt_command (struct mpt_ioctl_command karg, void __user *mfPtr)
 {
 	MPT_ADAPTER	*ioc;
 	MPT_FRAME_HDR	*mf = NULL;
@@ -1914,7 +1852,7 @@ mptctl_do_mpt_command (struct mpt_ioctl_command karg, char *mfPtr, int local)
 
 	/* Get a free request frame and save the message context.
 	 */
-        if ((mf = mpt_get_msg_frame(mptctl_id, ioc->id)) == NULL)
+        if ((mf = mpt_get_msg_frame(mptctl_id, ioc)) == NULL)
                 return -EAGAIN;
 
 	hdr = (MPIHeader_t *) mf;
@@ -1923,23 +1861,15 @@ mptctl_do_mpt_command (struct mpt_ioctl_command karg, char *mfPtr, int local)
 
 	/* Copy the request frame
 	 * Reset the saved message context.
+	 * Request frame in user space
 	 */
-        if (local) {
-		/* Request frame in kernel space
-		 */
-		memcpy((char *)mf, (char *) mfPtr, karg.dataSgeOffset * 4);
-        } else {
-		/* Request frame in user space
-		 */
-		if (copy_from_user((char *)mf, (char *) mfPtr,
-					karg.dataSgeOffset * 4)){
-			printk(KERN_ERR "%s@%d::mptctl_do_mpt_command - "
-				"Unable to read MF from mpt_ioctl_command struct @ %p\n",
-				__FILE__, __LINE__, (void*)mfPtr);
-			rc = -EFAULT;
-			goto done_free_mem;
-		}
-        }
+	if (copy_from_user(mf, mfPtr, karg.dataSgeOffset * 4)) {
+		printk(KERN_ERR "%s@%d::mptctl_do_mpt_command - "
+			"Unable to read MF from mpt_ioctl_command struct @ %p\n",
+			__FILE__, __LINE__, mfPtr);
+		rc = -EFAULT;
+		goto done_free_mem;
+	}
 	hdr->MsgContext = cpu_to_le32(msgContext);
 
 
@@ -2220,7 +2150,7 @@ mptctl_do_mpt_command (struct mpt_ioctl_command karg, char *mfPtr, int local)
 						"%s@%d::mptctl_do_mpt_command - Unable "
 						"to read user data "
 						"struct @ %p\n",
-						__FILE__, __LINE__,(void*)karg.dataOutBufPtr);
+						__FILE__, __LINE__,karg.dataOutBufPtr);
 					rc =  -EFAULT;
 					goto done_free_mem;
 				}
@@ -2266,7 +2196,7 @@ mptctl_do_mpt_command (struct mpt_ioctl_command karg, char *mfPtr, int local)
 	add_timer(&ioc->ioctl->timer);
 
 	if (hdr->Function == MPI_FUNCTION_SCSI_TASK_MGMT) {
-		rc = mpt_send_handshake_request(mptctl_id, ioc->id,
+		rc = mpt_send_handshake_request(mptctl_id, ioc,
 				sizeof(SCSITaskMgmt_t), (u32*)mf, CAN_SLEEP);
 		if (rc == 0) {
 			wait_event(mptctl_wait, ioc->ioctl->wait_done);
@@ -2276,10 +2206,10 @@ mptctl_do_mpt_command (struct mpt_ioctl_command karg, char *mfPtr, int local)
 			del_timer(&ioc->ioctl->timer);
 			ioc->ioctl->status &= ~MPT_IOCTL_STATUS_TIMER_ACTIVE;
 			ioc->ioctl->status |= MPT_IOCTL_STATUS_TM_FAILED;
-			mpt_free_msg_frame(mptctl_id, ioc->id, mf);
+			mpt_free_msg_frame(mptctl_id, ioc, mf);
 		}
 	} else {
-		mpt_put_msg_frame(mptctl_id, ioc->id, mf);
+		mpt_put_msg_frame(mptctl_id, ioc, mf);
 		wait_event(mptctl_wait, ioc->ioctl->wait_done);
 	}
 
@@ -2321,12 +2251,12 @@ mptctl_do_mpt_command (struct mpt_ioctl_command karg, char *mfPtr, int local)
 			}
 
 			if (sz > 0) {
-				if (copy_to_user((char *)karg.replyFrameBufPtr,
+				if (copy_to_user(karg.replyFrameBufPtr,
 					 &ioc->ioctl->ReplyFrame, sz)){
 
 					 printk(KERN_ERR "%s@%d::mptctl_do_mpt_command - "
 					 "Unable to write out reply frame %p\n",
-					 __FILE__, __LINE__, (void*)karg.replyFrameBufPtr);
+					 __FILE__, __LINE__, karg.replyFrameBufPtr);
 					 rc =  -ENODATA;
 					 goto done_free_mem;
 				}
@@ -2338,11 +2268,11 @@ mptctl_do_mpt_command (struct mpt_ioctl_command karg, char *mfPtr, int local)
 		if (ioc->ioctl->status & MPT_IOCTL_STATUS_SENSE_VALID) {
 			sz = min(karg.maxSenseBytes, MPT_SENSE_BUFFER_SIZE);
 			if (sz > 0) {
-				if (copy_to_user((char *)karg.senseDataPtr, ioc->ioctl->sense, sz)) {
+				if (copy_to_user(karg.senseDataPtr, ioc->ioctl->sense, sz)) {
 					printk(KERN_ERR "%s@%d::mptctl_do_mpt_command - "
 					"Unable to write sense data to user %p\n",
 					__FILE__, __LINE__,
-					(void*)karg.senseDataPtr);
+					karg.senseDataPtr);
 					rc =  -ENODATA;
 					goto done_free_mem;
 				}
@@ -2355,12 +2285,12 @@ mptctl_do_mpt_command (struct mpt_ioctl_command karg, char *mfPtr, int local)
 		if ((ioc->ioctl->status & MPT_IOCTL_STATUS_COMMAND_GOOD) &&
 					(karg.dataInSize > 0) && (bufIn.kptr)) {
 
-			if (copy_to_user((char *)karg.dataInBufPtr,
+			if (copy_to_user(karg.dataInBufPtr,
 					 bufIn.kptr, karg.dataInSize)) {
 				printk(KERN_ERR "%s@%d::mptctl_do_mpt_command - "
 					"Unable to write data to user %p\n",
 					__FILE__, __LINE__,
-					(void*)karg.dataInBufPtr);
+					karg.dataInBufPtr);
 				rc =  -ENODATA;
 			}
 		}
@@ -2394,7 +2324,7 @@ done_free_mem:
 	 * otherwise, failure occured after mf acquired.
 	 */
 	if (mf)
-		mpt_free_msg_frame(mptctl_id, ioc->id, mf);
+		mpt_free_msg_frame(mptctl_id, ioc, mf);
 
 	return rc;
 }
@@ -2413,7 +2343,7 @@ done_free_mem:
 static int
 mptctl_hp_hostinfo(unsigned long arg, unsigned int data_size)
 {
-	hp_host_info_t	*uarg = (hp_host_info_t *) arg;
+	hp_host_info_t	__user *uarg = (void __user *) arg;
 	MPT_ADAPTER		*ioc;
 	struct pci_dev		*pdev;
 	char			*pbuf;
@@ -2437,7 +2367,7 @@ mptctl_hp_hostinfo(unsigned long arg, unsigned int data_size)
 	if (copy_from_user(&karg, uarg, sizeof(hp_host_info_t))) {
 		printk(KERN_ERR "%s@%d::mptctl_hp_host_info - "
 			"Unable to read in hp_host_info struct @ %p\n",
-				__FILE__, __LINE__, (void*)uarg);
+				__FILE__, __LINE__, uarg);
 		return -EFAULT;
 	}
 
@@ -2455,10 +2385,8 @@ mptctl_hp_hostinfo(unsigned long arg, unsigned int data_size)
 
 	karg.vendor = pdev->vendor;
 	karg.device = pdev->device;
-#if LINUX_VERSION_CODE >= KERNEL_VERSION(2,4,0)
 	karg.subsystem_id = pdev->subsystem_device;
 	karg.subsystem_vendor = pdev->subsystem_vendor;
-#endif
 	karg.devfn = pdev->devfn;
 	karg.bus = pdev->bus->number;
 
@@ -2540,7 +2468,7 @@ mptctl_hp_hostinfo(unsigned long arg, unsigned int data_size)
 		break;
 	}
 
-	karg.base_io_addr = pdev->PCI_BASEADDR_START(0);
+	karg.base_io_addr = pci_resource_start(pdev, 0);
 
 	if ((int)ioc->chip_type <= (int) FC929)
 		karg.bus_phys_width = HP_BUS_WIDTH_UNK;
@@ -2576,11 +2504,10 @@ mptctl_hp_hostinfo(unsigned long arg, unsigned int data_size)
 
 	/* Copy the data from kernel memory to user memory
 	 */
-	if (copy_to_user((char *)arg, &karg,
-				sizeof(hp_host_info_t))) {
+	if (copy_to_user((char __user *)arg, &karg, sizeof(hp_host_info_t))) {
 		printk(KERN_ERR "%s@%d::mptctl_hpgethostinfo - "
 			"Unable to write out hp_host_info @ %p\n",
-				__FILE__, __LINE__, (void*)uarg);
+				__FILE__, __LINE__, uarg);
 		return -EFAULT;
 	}
 
@@ -2602,7 +2529,7 @@ mptctl_hp_hostinfo(unsigned long arg, unsigned int data_size)
 static int
 mptctl_hp_targetinfo(unsigned long arg)
 {
-	hp_target_info_t	*uarg = (hp_target_info_t *) arg;
+	hp_target_info_t __user *uarg = (void __user *) arg;
 	SCSIDevicePage0_t	*pg0_alloc;
 	SCSIDevicePage3_t	*pg3_alloc;
 	MPT_ADAPTER		*ioc;
@@ -2619,7 +2546,7 @@ mptctl_hp_targetinfo(unsigned long arg)
 	if (copy_from_user(&karg, uarg, sizeof(hp_target_info_t))) {
 		printk(KERN_ERR "%s@%d::mptctl_hp_targetinfo - "
 			"Unable to read in hp_host_targetinfo struct @ %p\n",
-				__FILE__, __LINE__, (void*)uarg);
+				__FILE__, __LINE__, uarg);
 		return -EFAULT;
 	}
 	
@@ -2727,10 +2654,10 @@ mptctl_hp_targetinfo(unsigned long arg)
 
 	/* Copy the data from kernel memory to user memory
 	 */
-	if (copy_to_user((char *)arg, &karg, sizeof(hp_target_info_t))) {
+	if (copy_to_user((char __user *)arg, &karg, sizeof(hp_target_info_t))) {
 		printk(KERN_ERR "%s@%d::mptctl_hp_target_info - "
 			"Unable to write out mpt_ioctl_targetinfo struct @ %p\n",
-				__FILE__, __LINE__, (void*)uarg);
+				__FILE__, __LINE__, uarg);
 		return -EFAULT;
 	}
 
@@ -2739,20 +2666,10 @@ mptctl_hp_targetinfo(unsigned long arg)
 
 /*=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=*/
 
-#if LINUX_VERSION_CODE >= KERNEL_VERSION(2,3,51)
-#define	owner_THIS_MODULE  .owner = THIS_MODULE,
-#else
-#define	owner_THIS_MODULE
-#endif
-
 static struct file_operations mptctl_fops = {
-	owner_THIS_MODULE
+	.owner =	THIS_MODULE,
 	.llseek =	no_llseek,
-	.read =		mptctl_read,
-	.write =	mptctl_write,
 	.ioctl =	mptctl_ioctl,
-	.open =		mptctl_open,
-	.release =	mptctl_release,
 };
 
 static struct miscdevice mptctl_miscdev = {
@@ -2800,7 +2717,7 @@ compat_mptfwxfer_ioctl(unsigned int fd, unsigned int cmd,
 
 	dctlprintk((KERN_INFO MYNAM "::compat_mptfwxfer_ioctl() called\n"));
 
-	if (copy_from_user(&kfw32, (char *)arg, sizeof(kfw32)))
+	if (copy_from_user(&kfw32, (char __user *)arg, sizeof(kfw32)))
 		return -EFAULT;
 
 	/* Verify intended MPT adapter */
@@ -2817,7 +2734,7 @@ compat_mptfwxfer_ioctl(unsigned int fd, unsigned int cmd,
 
 	kfw.iocnum = iocnum;
 	kfw.fwlen = kfw32.fwlen;
-	kfw.bufp = (void *)(unsigned long)kfw32.bufp;
+	kfw.bufp = compat_ptr(kfw32.bufp);
 
 	ret = mptctl_do_fw_download(kfw.iocnum, kfw.bufp, kfw.fwlen);
 
@@ -2831,7 +2748,7 @@ compat_mpt_command(unsigned int fd, unsigned int cmd,
 			unsigned long arg, struct file *filp)
 {
 	struct mpt_ioctl_command32 karg32;
-	struct mpt_ioctl_command32 *uarg = (struct mpt_ioctl_command32 *) arg;
+	struct mpt_ioctl_command32 __user *uarg = (struct mpt_ioctl_command32 __user *) arg;
 	struct mpt_ioctl_command karg;
 	MPT_ADAPTER *iocp = NULL;
 	int iocnum, iocnumX;
@@ -2840,7 +2757,7 @@ compat_mpt_command(unsigned int fd, unsigned int cmd,
 
 	dctlprintk((KERN_INFO MYNAM "::compat_mpt_command() called\n"));
 
-	if (copy_from_user(&karg32, (char *)arg, sizeof(karg32)))
+	if (copy_from_user(&karg32, (char __user *)arg, sizeof(karg32)))
 		return -EFAULT;
 
 	/* Verify intended MPT adapter */
@@ -2866,14 +2783,14 @@ compat_mpt_command(unsigned int fd, unsigned int cmd,
 	karg.maxSenseBytes = karg32.maxSenseBytes;
 	karg.dataSgeOffset = karg32.dataSgeOffset;
 
-	karg.replyFrameBufPtr = (char *)(unsigned long)karg32.replyFrameBufPtr;
-	karg.dataInBufPtr = (char *)(unsigned long)karg32.dataInBufPtr;
-	karg.dataOutBufPtr = (char *)(unsigned long)karg32.dataOutBufPtr;
-	karg.senseDataPtr = (char *)(unsigned long)karg32.senseDataPtr;
+	karg.replyFrameBufPtr = (char __user *)(unsigned long)karg32.replyFrameBufPtr;
+	karg.dataInBufPtr = (char __user *)(unsigned long)karg32.dataInBufPtr;
+	karg.dataOutBufPtr = (char __user *)(unsigned long)karg32.dataOutBufPtr;
+	karg.senseDataPtr = (char __user *)(unsigned long)karg32.senseDataPtr;
 
 	/* Pass new structure to do_mpt_command
 	 */
-	ret = mptctl_do_mpt_command (karg, (char *) &uarg->MF, 0);
+	ret = mptctl_do_mpt_command (karg, &uarg->MF);
 
 	up(&mptctl_syscall_sem_ioc[iocp->id]);
 
diff --git a/drivers/message/fusion/mptctl.h b/drivers/message/fusion/mptctl.h
index 47ffd977d..cc4ecf038 100644
--- a/drivers/message/fusion/mptctl.h
+++ b/drivers/message/fusion/mptctl.h
@@ -115,7 +115,7 @@
 struct mpt_fw_xfer {
 	unsigned int	 iocnum;	/* IOC unit number */
 	unsigned int	 fwlen;
-	void		*bufp;		/* Pointer to firmware buffer */
+	void		__user *bufp;	/* Pointer to firmware buffer */
 };
 
 #if defined(__KERNEL__) && defined(CONFIG_COMPAT)
@@ -332,10 +332,10 @@ typedef struct mpt_ioctl_replace_fw {
 struct mpt_ioctl_command {
 	mpt_ioctl_header hdr;
 	int		timeout;	/* optional (seconds) */
-	char		*replyFrameBufPtr;
-	char		*dataInBufPtr;
-	char		*dataOutBufPtr;
-	char		*senseDataPtr;
+	char		__user *replyFrameBufPtr;
+	char		__user *dataInBufPtr;
+	char		__user *dataOutBufPtr;
+	char		__user *senseDataPtr;
 	int		maxReplyBytes;
 	int		dataInSize;
 	int		dataOutSize;
diff --git a/drivers/message/fusion/mptlan.c b/drivers/message/fusion/mptlan.c
index ae94f4376..80c9b97eb 100644
--- a/drivers/message/fusion/mptlan.c
+++ b/drivers/message/fusion/mptlan.c
@@ -133,7 +133,7 @@ struct mpt_lan_priv {
 	u32 total_received;
 	struct net_device_stats stats;	/* Per device statistics */
 
-	struct mpt_work_struct post_buckets_task;
+	struct work_struct post_buckets_task;
 	unsigned long post_buckets_active;
 };
 
@@ -502,7 +502,7 @@ mpt_lan_reset(struct net_device *dev)
 	LANResetRequest_t *pResetReq;
 	struct mpt_lan_priv *priv = netdev_priv(dev);
 
-	mf = mpt_get_msg_frame(LanCtx, priv->mpt_dev->id);
+	mf = mpt_get_msg_frame(LanCtx, priv->mpt_dev);
 
 	if (mf == NULL) {
 /*		dlprintk((KERN_ERR MYNAM "/reset: Evil funkiness abounds! "
@@ -520,7 +520,7 @@ mpt_lan_reset(struct net_device *dev)
 	pResetReq->MsgFlags	= 0;
 	pResetReq->Reserved2	= 0;
 
-	mpt_put_msg_frame(LanCtx, priv->mpt_dev->id, mf);
+	mpt_put_msg_frame(LanCtx, priv->mpt_dev, mf);
 
 	return 0;
 }
@@ -754,7 +754,7 @@ mpt_lan_sdu_send (struct sk_buff *skb, struct net_device *dev)
 		return 1;
 	}
 
-	mf = mpt_get_msg_frame(LanCtx, mpt_dev->id);
+	mf = mpt_get_msg_frame(LanCtx, mpt_dev);
 	if (mf == NULL) {
 		netif_stop_queue(dev);
 		spin_unlock_irqrestore(&priv->txfidx_lock, flags);
@@ -859,7 +859,7 @@ mpt_lan_sdu_send (struct sk_buff *skb, struct net_device *dev)
 	else
 		pSimple->Address.High = 0;
 
-	mpt_put_msg_frame (LanCtx, mpt_dev->id, mf);
+	mpt_put_msg_frame (LanCtx, mpt_dev, mf);
 	dev->trans_start = jiffies;
 
 	dioprintk((KERN_INFO MYNAM ": %s/%s: Sending packet. FlagsLength = %08x.\n",
@@ -880,18 +880,9 @@ mpt_lan_wake_post_buckets_task(struct net_device *dev, int priority)
 	
 	if (test_and_set_bit(0, &priv->post_buckets_active) == 0) {
 		if (priority) {
-#if LINUX_VERSION_CODE >= KERNEL_VERSION(2,5,41)
 			schedule_work(&priv->post_buckets_task);
-#else
-			queue_task(&priv->post_buckets_task, &tq_immediate);
-			mark_bh(IMMEDIATE_BH);
-#endif
 		} else {
-#if LINUX_VERSION_CODE >= KERNEL_VERSION(2,5,41)
 			schedule_delayed_work(&priv->post_buckets_task, 1);
-#else
-			queue_task(&priv->post_buckets_task, &tq_timer);
-#endif
 			dioprintk((KERN_INFO MYNAM ": post_buckets queued on "
 				   "timer.\n"));
 		}
@@ -1253,7 +1244,7 @@ mpt_lan_post_receive_buckets(void *dev_id)
 			(MPT_LAN_TRANSACTION32_SIZE + sizeof(SGESimple64_t));
 
 	while (buckets) {
-		mf = mpt_get_msg_frame(LanCtx, mpt_dev->id);
+		mf = mpt_get_msg_frame(LanCtx, mpt_dev);
 		if (mf == NULL) {
 			printk (KERN_ERR "%s: Unable to alloc request frame\n",
 				__FUNCTION__);
@@ -1343,7 +1334,7 @@ mpt_lan_post_receive_buckets(void *dev_id)
 		if (pSimple == NULL) {
 /**/			printk (KERN_WARNING MYNAM "/%s: No buckets posted\n",
 /**/				__FUNCTION__);
-			mpt_free_msg_frame(LanCtx, mpt_dev->id, mf);
+			mpt_free_msg_frame(LanCtx, mpt_dev, mf);
 			goto out;
 		}
 
@@ -1357,7 +1348,7 @@ mpt_lan_post_receive_buckets(void *dev_id)
  *	printk ("\n");
  */
 
-		mpt_put_msg_frame(LanCtx, mpt_dev->id, mf);
+		mpt_put_msg_frame(LanCtx, mpt_dev, mf);
 
 		priv->total_posted += i;
 		buckets -= i;
@@ -1391,8 +1382,8 @@ mpt_register_lan_device (MPT_ADAPTER *mpt_dev, int pnum)
 	priv->mpt_dev = mpt_dev;
 	priv->pnum = pnum;
 
-	memset(&priv->post_buckets_task, 0, sizeof(struct mpt_work_struct));
-	MPT_INIT_WORK(&priv->post_buckets_task, mpt_lan_post_receive_buckets, dev);
+	memset(&priv->post_buckets_task, 0, sizeof(struct work_struct));
+	INIT_WORK(&priv->post_buckets_task, mpt_lan_post_receive_buckets, dev);
 	priv->post_buckets_active = 0;
 
 	dlprintk((KERN_INFO MYNAM "@%d: bucketlen = %d\n",
@@ -1498,7 +1489,7 @@ static int __init mpt_lan_init (void)
 		mpt_landev[j] = NULL;
 	}
 
-	for (p = mpt_adapter_find_first(); p; p = mpt_adapter_find_next(p)) {
+	list_for_each_entry(p, &ioc_list, list) {
 		for (i = 0; i < p->facts.NumberOfPorts; i++) {
 			printk (KERN_INFO MYNAM ": %s: PortNum=%x, ProtocolFlags=%02Xh (%c%c%c%c)\n",
 					p->name,
@@ -1566,10 +1557,6 @@ static void __exit mpt_lan_exit(void)
 }
 
 /*=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=*/
-#if LINUX_VERSION_CODE < KERNEL_VERSION(2,5,59)
-MODULE_PARM(tx_max_out_p, "i");
-MODULE_PARM(max_buckets_out, "i"); // Debug stuff. FIXME!
-#endif
 
 module_init(mpt_lan_init);
 module_exit(mpt_lan_exit);
diff --git a/drivers/message/fusion/mptscsih.c b/drivers/message/fusion/mptscsih.c
index ce66f4176..8c82254b4 100644
--- a/drivers/message/fusion/mptscsih.c
+++ b/drivers/message/fusion/mptscsih.c
@@ -65,6 +65,7 @@
 */
 /*=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=*/
 
+#include "linux_compat.h"	/* linux-2.6 tweaks */
 #include <linux/module.h>
 #include <linux/kernel.h>
 #include <linux/init.h>
@@ -74,9 +75,14 @@
 #include <linux/delay.h>	/* for mdelay */
 #include <linux/interrupt.h>	/* needed for in_interrupt() proto */
 #include <linux/reboot.h>	/* notifier code */
-#include "../../scsi/scsi.h"
-#include <scsi/scsi_host.h>
+#include <linux/sched.h>
+#include <linux/workqueue.h>
 
+#include <scsi/scsi.h>
+#include <scsi/scsi_cmnd.h>
+#include <scsi/scsi_device.h>
+#include <scsi/scsi_host.h>
+#include <scsi/scsi_tcq.h>
 
 #include "mptbase.h"
 #include "mptscsih.h"
@@ -93,7 +99,7 @@ MODULE_LICENSE("GPL");
 
 /* Set string for command line args from insmod */
 #ifdef MODULE
-char *mptscsih = 0;
+char *mptscsih = NULL;
 #endif
 
 /*=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=*/
@@ -152,16 +158,16 @@ typedef struct _dv_parameters {
  *  Other private/forward protos...
  */
 static int	mptscsih_io_done(MPT_ADAPTER *ioc, MPT_FRAME_HDR *mf, MPT_FRAME_HDR *r);
-static void	mptscsih_report_queue_full(Scsi_Cmnd *sc, SCSIIOReply_t *pScsiReply, SCSIIORequest_t *pScsiReq);
+static void	mptscsih_report_queue_full(struct scsi_cmnd *sc, SCSIIOReply_t *pScsiReply, SCSIIORequest_t *pScsiReq);
 static int	mptscsih_taskmgmt_complete(MPT_ADAPTER *ioc, MPT_FRAME_HDR *mf, MPT_FRAME_HDR *r);
 
-static int	mptscsih_AddSGE(MPT_SCSI_HOST *hd, Scsi_Cmnd *SCpnt,
+static int	mptscsih_AddSGE(MPT_SCSI_HOST *hd, struct scsi_cmnd *SCpnt,
 				 SCSIIORequest_t *pReq, int req_idx);
 static void	mptscsih_freeChainBuffers(MPT_SCSI_HOST *hd, int req_idx);
 static int	mptscsih_initChainBuffers (MPT_SCSI_HOST *hd, int init);
-static void	copy_sense_data(Scsi_Cmnd *sc, MPT_SCSI_HOST *hd, MPT_FRAME_HDR *mf, SCSIIOReply_t *pScsiReply);
+static void	copy_sense_data(struct scsi_cmnd *sc, MPT_SCSI_HOST *hd, MPT_FRAME_HDR *mf, SCSIIOReply_t *pScsiReply);
 static int	mptscsih_tm_pending_wait(MPT_SCSI_HOST * hd);
-static u32	SCPNT_TO_LOOKUP_IDX(Scsi_Cmnd *sc);
+static u32	SCPNT_TO_LOOKUP_IDX(struct scsi_cmnd *sc);
 static MPT_FRAME_HDR *mptscsih_search_pendingQ(MPT_SCSI_HOST *hd, int scpnt_idx);
 static void	post_pendingQ_commands(MPT_SCSI_HOST *hd);
 
@@ -185,7 +191,7 @@ static void	mptscsih_schedule_reset(void *hd);
 static int	mptscsih_do_cmd(MPT_SCSI_HOST *hd, INTERNAL_CMD *iocmd);
 static int	mptscsih_synchronize_cache(MPT_SCSI_HOST *hd, int portnum);
 
-static struct mpt_work_struct   mptscsih_rstTask;
+static struct work_struct   mptscsih_rstTask;
 
 #ifdef MPTSCSIH_ENABLE_DOMAIN_VALIDATION
 static int	mptscsih_do_raid(MPT_SCSI_HOST *hd, u8 action, INTERNAL_CMD *io);
@@ -231,7 +237,7 @@ static int	ScsiScanDvCtx = -1; /* Used only for bus scan and dv */
 static spinlock_t dvtaskQ_lock = SPIN_LOCK_UNLOCKED;
 static int dvtaskQ_active = 0;
 static int dvtaskQ_release = 0;
-static struct mpt_work_struct	mptscsih_dvTask;
+static struct work_struct	mptscsih_dvTask;
 #endif
 
 /*
@@ -246,127 +252,10 @@ static struct mptscsih_driver_setup
 	driver_setup = MPTSCSIH_DRIVER_SETUP;
 
 #ifdef MPTSCSIH_DBG_TIMEOUT
-static Scsi_Cmnd *foo_to[8];
+static struct scsi_cmnd *foo_to[8];
 #endif
 
-/*=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=*/
-
-/* see mptscsih.h */
-
-static struct scsi_host_template driver_template = {
-	.proc_name			= "mptscsih",
-	.proc_info			= x_scsi_proc_info,
-	.name				= "MPT SCSI Host",
-	.info				= x_scsi_info,
-	.queuecommand			= x_scsi_queuecommand,
-	.slave_alloc			= x_scsi_slave_alloc,
-	.slave_configure		= x_scsi_slave_configure,
-	.slave_destroy			= x_scsi_slave_destroy,
-	.eh_abort_handler		= x_scsi_abort,
-	.eh_device_reset_handler	= x_scsi_dev_reset,
-	.eh_bus_reset_handler		= x_scsi_bus_reset,
-	.eh_host_reset_handler		= x_scsi_host_reset,
-	.bios_param			= x_scsi_bios_param,
-	.can_queue			= MPT_SCSI_CAN_QUEUE,
-	.this_id			= -1,
-	.sg_tablesize			= MPT_SCSI_SG_DEPTH,
-	.max_sectors			= MPT_SCSI_MAX_SECTORS,
-	.cmd_per_lun			= MPT_SCSI_CMD_PER_LUN,
-	.use_clustering			= ENABLE_CLUSTERING,
-};
-
-/*=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=*/
-/*
- *  Private inline routines...
- */
-/*=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=*/
-/* 19991030 -sralston
- *  Return absolute SCSI data direction:
- *     1 = _DATA_OUT
- *     0 = _DIR_NONE
- *    -1 = _DATA_IN
- *
- * Changed: 3-20-2002 pdelaney to use the default data
- * direction and the defines set up in the
- * 2.4 kernel series
- *     1 = _DATA_OUT	changed to SCSI_DATA_WRITE (1)
- *     0 = _DIR_NONE	changed to SCSI_DATA_NONE (3)
- *    -1 = _DATA_IN	changed to SCSI_DATA_READ (2)
- * If the direction is unknown, fall through to original code.
- *
- * Mid-layer bug fix(): sg interface generates the wrong data
- * direction in some cases. Set the direction the hard way for
- * the most common commands.
- */
-static inline int
-mptscsih_io_direction(Scsi_Cmnd *cmd)
-{
-	switch (cmd->cmnd[0]) {
-	case WRITE_6:
-	case WRITE_10:
-	case WRITE_16:
-		return SCSI_DATA_WRITE;
-		break;
-	case READ_6:
-	case READ_10:
-	case READ_16:
-		return SCSI_DATA_READ;
-		break;
-	}
-
-	if (cmd->sc_data_direction != SCSI_DATA_UNKNOWN)
-		return cmd->sc_data_direction;
-
-	switch (cmd->cmnd[0]) {
-	/*  _DATA_OUT commands	*/
-	case WRITE_6:		case WRITE_10:		case WRITE_12:
-	case WRITE_16:
-	case WRITE_LONG:	case WRITE_SAME:	case WRITE_BUFFER:
-	case WRITE_VERIFY:	case WRITE_VERIFY_12:
-	case COMPARE:		case COPY:		case COPY_VERIFY:
-	case SEARCH_EQUAL:	case SEARCH_HIGH:	case SEARCH_LOW:
-	case SEARCH_EQUAL_12:	case SEARCH_HIGH_12:	case SEARCH_LOW_12:
-	case MODE_SELECT:	case MODE_SELECT_10:	case LOG_SELECT:
-	case SEND_DIAGNOSTIC:	case CHANGE_DEFINITION: case UPDATE_BLOCK:
-	case SET_WINDOW:	case MEDIUM_SCAN:	case SEND_VOLUME_TAG:
-	case REASSIGN_BLOCKS:
-	case PERSISTENT_RESERVE_OUT:
-	case 0xea:
-	case 0xa3:
-		return SCSI_DATA_WRITE;
-
-	/*  No data transfer commands  */
-	case SEEK_6:		case SEEK_10:
-	case RESERVE:		case RELEASE:
-	case TEST_UNIT_READY:
-	case START_STOP:
-	case ALLOW_MEDIUM_REMOVAL:
-		return SCSI_DATA_NONE;
-
-	/*  Conditional data transfer commands	*/
-	case FORMAT_UNIT:
-		if (cmd->cmnd[1] & 0x10)	/* FmtData (data out phase)? */
-			return SCSI_DATA_WRITE;
-		else
-			return SCSI_DATA_NONE;
-
-	case VERIFY:
-		if (cmd->cmnd[1] & 0x02)	/* VERIFY:BYTCHK (data out phase)? */
-			return SCSI_DATA_WRITE;
-		else
-			return SCSI_DATA_NONE;
-
-	case RESERVE_10:
-		if (cmd->cmnd[1] & 0x03)	/* RESERVE:{LongID|Extent} (data out phase)? */
-			return SCSI_DATA_WRITE;
-		else
-			return SCSI_DATA_NONE;
-
-	/*  Must be data _IN!  */
-	default:
-		return SCSI_DATA_READ;
-	}
-} /* mptscsih_io_direction() */
+static struct scsi_host_template driver_template;
 
 /*=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=*/
 /**
@@ -480,13 +369,13 @@ mptscsih_getFreeChainBuffer(MPT_SCSI_HOST *hd, int *retIndex)
  *	mptscsih_AddSGE - Add a SGE (plus chain buffers) to the
  *	SCSIIORequest_t Message Frame.
  *	@hd: Pointer to MPT_SCSI_HOST structure
- *	@SCpnt: Pointer to Scsi_Cmnd structure
+ *	@SCpnt: Pointer to scsi_cmnd structure
  *	@pReq: Pointer to SCSIIORequest_t structure
  *
  *	Returns ...
  */
 static int
-mptscsih_AddSGE(MPT_SCSI_HOST *hd, Scsi_Cmnd *SCpnt,
+mptscsih_AddSGE(MPT_SCSI_HOST *hd, struct scsi_cmnd *SCpnt,
 		SCSIIORequest_t *pReq, int req_idx)
 {
 	char 	*psge;
@@ -519,29 +408,20 @@ mptscsih_AddSGE(MPT_SCSI_HOST *hd, Scsi_Cmnd *SCpnt,
 	if ( (sges_left = SCpnt->use_sg) ) {
 		sges_left = pci_map_sg(hd->ioc->pcidev,
 			       (struct scatterlist *) SCpnt->request_buffer,
-			       SCpnt->use_sg,
-			       scsi_to_pci_dma_dir(SCpnt->sc_data_direction));
+ 			       SCpnt->use_sg,
+			       SCpnt->sc_data_direction);
 		if (sges_left == 0)
 			return FAILED;
 	} else if (SCpnt->request_bufflen) {
-		dma_addr_t	 buf_dma_addr;
-		scPrivate	*my_priv;
-
-		buf_dma_addr = pci_map_single(hd->ioc->pcidev,
+		SCpnt->SCp.dma_handle = pci_map_single(hd->ioc->pcidev,
 				      SCpnt->request_buffer,
 				      SCpnt->request_bufflen,
-				      scsi_to_pci_dma_dir(SCpnt->sc_data_direction));
-
-		/* We hide it here for later unmap. */
-		my_priv = (scPrivate *) &SCpnt->SCp;
-		my_priv->p1 = (void *)(ulong) buf_dma_addr;
-
+				      SCpnt->sc_data_direction);
 		dsgprintk((MYIOC_s_INFO_FMT "SG: non-SG for %p, len=%d\n",
 				hd->ioc->name, SCpnt, SCpnt->request_bufflen));
-
 		mptscsih_add_sge((char *) &pReq->SGL,
 			0xD1000000|MPT_SGE_FLAGS_ADDRESSING|sgdir|SCpnt->request_bufflen,
-			buf_dma_addr);
+			SCpnt->SCp.dma_handle);
 
 		return SUCCESS;
 	}
@@ -730,7 +610,7 @@ nextSGEset:
 static int
 mptscsih_io_done(MPT_ADAPTER *ioc, MPT_FRAME_HDR *mf, MPT_FRAME_HDR *mr)
 {
-	Scsi_Cmnd	*sc;
+	struct scsi_cmnd	*sc;
 	MPT_SCSI_HOST	*hd;
 	SCSIIORequest_t	*pScsiReq;
 	SCSIIOReply_t	*pScsiReply;
@@ -851,6 +731,15 @@ mptscsih_io_done(MPT_ADAPTER *ioc, MPT_FRAME_HDR *mf, MPT_FRAME_HDR *mr)
 			break;
 
 		case MPI_IOCSTATUS_SCSI_RESIDUAL_MISMATCH:	/* 0x0049 */
+			sc->result = (DRIVER_SENSE << 24) | (DID_OK << 16) | 
+					(CHECK_CONDITION << 1);
+			sc->sense_buffer[0] = 0x70;
+			sc->sense_buffer[2] = NO_SENSE;
+			sc->sense_buffer[12] = 0;
+			sc->sense_buffer[13] = 0;
+			dprintk((KERN_NOTICE "RESIDUAL_MISMATCH: result=%x on id=%d\n", sc->result, sc->target));
+			break;
+		
 		case MPI_IOCSTATUS_SCSI_DATA_UNDERRUN:		/* 0x0045 */
 			/*
 			 *  Do upfront check for valid SenseData and give it
@@ -968,14 +857,10 @@ mptscsih_io_done(MPT_ADAPTER *ioc, MPT_FRAME_HDR *mf, MPT_FRAME_HDR *mr)
 	/* Unmap the DMA buffers, if any. */
 	if (sc->use_sg) {
 		pci_unmap_sg(ioc->pcidev, (struct scatterlist *) sc->request_buffer,
-			    sc->use_sg, scsi_to_pci_dma_dir(sc->sc_data_direction));
+			    sc->use_sg, sc->sc_data_direction);
 	} else if (sc->request_bufflen) {
-		scPrivate	*my_priv;
-
-		my_priv = (scPrivate *) &sc->SCp;
-		pci_unmap_single(ioc->pcidev, (dma_addr_t)(ulong)my_priv->p1,
-			   sc->request_bufflen,
-			   scsi_to_pci_dma_dir(sc->sc_data_direction));
+		pci_unmap_single(ioc->pcidev, sc->SCp.dma_handle,
+				sc->request_bufflen, sc->sc_data_direction);
 	}
 
 	hd->ScsiLookup[req_idx] = NULL;
@@ -996,7 +881,7 @@ static void
 flush_doneQ(MPT_SCSI_HOST *hd)
 {
 	MPT_DONE_Q	*buffer;
-	Scsi_Cmnd	*SCpnt;
+	struct scsi_cmnd	*SCpnt;
 	unsigned long	 flags;
 
 	/* Flush the doneQ.
@@ -1014,9 +899,9 @@ flush_doneQ(MPT_SCSI_HOST *hd)
 		 */
 		Q_DEL_ITEM(buffer);
 
-		/* Set the Scsi_Cmnd pointer
+		/* Set the struct scsi_cmnd pointer
 		 */
-		SCpnt = (Scsi_Cmnd *) buffer->argp;
+		SCpnt = (struct scsi_cmnd *) buffer->argp;
 		buffer->argp = NULL;
 
 		/* Add to the freeQ
@@ -1037,7 +922,7 @@ flush_doneQ(MPT_SCSI_HOST *hd)
  * Calling function will finish processing.
  */
 static void
-search_doneQ_for_cmd(MPT_SCSI_HOST *hd, Scsi_Cmnd *SCpnt)
+search_doneQ_for_cmd(MPT_SCSI_HOST *hd, struct scsi_cmnd *SCpnt)
 {
 	unsigned long	 flags;
 	MPT_DONE_Q	*buffer;
@@ -1046,12 +931,12 @@ search_doneQ_for_cmd(MPT_SCSI_HOST *hd, Scsi_Cmnd *SCpnt)
 	if (!Q_IS_EMPTY(&hd->doneQ)) {
 		buffer = hd->doneQ.head;
 		do {
-			Scsi_Cmnd *sc = (Scsi_Cmnd *) buffer->argp;
+			struct scsi_cmnd *sc = (struct scsi_cmnd *) buffer->argp;
 			if (SCpnt == sc) {
 				Q_DEL_ITEM(buffer);
 				SCpnt->result = sc->result;
 
-				/* Set the Scsi_Cmnd pointer
+				/* Set the struct scsi_cmnd pointer
 				 */
 				buffer->argp = NULL;
 
@@ -1079,7 +964,7 @@ search_doneQ_for_cmd(MPT_SCSI_HOST *hd, Scsi_Cmnd *SCpnt)
 static void
 mptscsih_flush_running_cmds(MPT_SCSI_HOST *hd)
 {
-	Scsi_Cmnd	*SCpnt;
+	struct scsi_cmnd	*SCpnt;
 	MPT_FRAME_HDR	*mf;
 	MPT_DONE_Q	*buffer;
 	int		 ii;
@@ -1115,15 +1000,12 @@ mptscsih_flush_running_cmds(MPT_SCSI_HOST *hd)
 					pci_unmap_sg(hd->ioc->pcidev,
 						(struct scatterlist *) SCpnt->request_buffer,
 						SCpnt->use_sg,
-						scsi_to_pci_dma_dir(SCpnt->sc_data_direction));
+						SCpnt->sc_data_direction);
 				} else if (SCpnt->request_bufflen) {
-					scPrivate	*my_priv;
-
-					my_priv = (scPrivate *) &SCpnt->SCp;
 					pci_unmap_single(hd->ioc->pcidev,
-						(dma_addr_t)(ulong)my_priv->p1,
+						SCpnt->SCp.dma_handle,
 						SCpnt->request_bufflen,
-						scsi_to_pci_dma_dir(SCpnt->sc_data_direction));
+						SCpnt->sc_data_direction);
 				}
 			}
 			SCpnt->result = DID_RESET << 16;
@@ -1133,7 +1015,7 @@ mptscsih_flush_running_cmds(MPT_SCSI_HOST *hd)
 			mptscsih_freeChainBuffers(hd, ii);
 
 			/* Free Message frames */
-			mpt_free_msg_frame(ScsiDoneCtx, hd->ioc->id, mf);
+			mpt_free_msg_frame(ScsiDoneCtx, hd->ioc, mf);
 
 #if 1
 			/* Post to doneQ, do not reply until POST phase
@@ -1145,7 +1027,7 @@ mptscsih_flush_running_cmds(MPT_SCSI_HOST *hd)
 				buffer = hd->freeQ.head;
 				Q_DEL_ITEM(buffer);
 
-				/* Set the Scsi_Cmnd pointer
+				/* Set the struct scsi_cmnd pointer
 				 */
 				buffer->argp = (void *)SCpnt;
 
@@ -1171,7 +1053,7 @@ mptscsih_flush_running_cmds(MPT_SCSI_HOST *hd)
  *	mptscsih_search_running_cmds - Delete any commands associated
  *		with the specified target and lun. Function called only
  *		when a lun is disable by mid-layer.
- *		Do NOT access the referenced Scsi_Cmnd structure or
+ *		Do NOT access the referenced scsi_cmnd structure or
  *		members. Will cause either a paging or NULL ptr error.
  *	@hd: Pointer to a SCSI HOST structure
  *	@target: target id
@@ -1206,7 +1088,7 @@ mptscsih_search_running_cmds(MPT_SCSI_HOST *hd, uint target, uint lun)
 			 */
 			hd->ScsiLookup[ii] = NULL;
 			mptscsih_freeChainBuffers(hd, ii);
-			mpt_free_msg_frame(ScsiDoneCtx, hd->ioc->id, (MPT_FRAME_HDR *)mf);
+			mpt_free_msg_frame(ScsiDoneCtx, hd->ioc, (MPT_FRAME_HDR *)mf);
 		}
 	}
 
@@ -1329,7 +1211,7 @@ static long last_queue_full = 0;
 /*
  *	mptscsih_report_queue_full - Report QUEUE_FULL status returned
  *	from a SCSI target device.
- *	@sc: Pointer to Scsi_Cmnd structure
+ *	@sc: Pointer to scsi_cmnd structure
  *	@pScsiReply: Pointer to SCSIIOReply_t
  *	@pScsiReq: Pointer to original SCSI request
  *
@@ -1338,7 +1220,7 @@ static long last_queue_full = 0;
  *	printk() API call, not more than once every 10 seconds.
  */
 static void
-mptscsih_report_queue_full(Scsi_Cmnd *sc, SCSIIOReply_t *pScsiReply, SCSIIORequest_t *pScsiReq)
+mptscsih_report_queue_full(struct scsi_cmnd *sc, SCSIIOReply_t *pScsiReply, SCSIIORequest_t *pScsiReq)
 {
 	long time = jiffies;
 
@@ -1459,7 +1341,6 @@ mptscsih_probe(struct pci_dev *pdev, const struct pci_device_id *id)
 	}
 		
 	sh->max_lun = MPT_LAST_LUN + 1;
-	sh->max_sectors = MPT_SCSI_MAX_SECTORS;
 	sh->max_channel = 0;
 	sh->this_id = ioc->pfacts[0].PortSCSIID;
 		
@@ -1515,7 +1396,7 @@ mptscsih_probe(struct pci_dev *pdev, const struct pci_device_id *id)
 		hd->is_multipath = 1;
 	}
 
-	/* SCSI needs Scsi_Cmnd lookup table!
+	/* SCSI needs scsi_cmnd lookup table!
 	 * (with size equal to req_depth*PtrSz!)
 	 */
 	sz = hd->ioc->req_depth * sizeof(void *);
@@ -1800,8 +1681,8 @@ mptscsih_remove(struct pci_dev *pdev)
 		}
 
 		dprintk((MYIOC_s_INFO_FMT
-		  "Free'd ScsiLookup (%d), chain (%d) and Target (%d+%d) memory\n",
-		  hd->ioc->name, sz1, szchain, sz3, sztarget));
+		  "Free'd ScsiLookup (%d) Target (%d+%d) memory\n",
+		  hd->ioc->name, sz1, sz3, sztarget));
 		dprintk(("Free'd done and free Q (%d) memory\n", szQ));
 
 		/* NULL the Scsi_Host pointer
@@ -1879,9 +1760,9 @@ mptscsih_resume(struct pci_dev *pdev)
 	if (!dvtaskQ_active) {
 		dvtaskQ_active = 1;
 		spin_unlock_irqrestore(&dvtaskQ_lock, lflags);
-		MPT_INIT_WORK(&mptscsih_dvTask,
+		INIT_WORK(&mptscsih_dvTask,
 		  mptscsih_domainValidation, (void *) hd);
-		SCHEDULE_TASK(&mptscsih_dvTask);
+		schedule_work(&mptscsih_dvTask);
 	} else {
 		spin_unlock_irqrestore(&dvtaskQ_lock, lflags);
 	}
@@ -1902,7 +1783,6 @@ static struct mpt_pci_driver mptscsih_driver = {
 #endif
 };
 
-
 /*  SCSI host fops start here...  */
 /*=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=*/
 /**
@@ -1956,16 +1836,7 @@ mptscsih_init(void)
 static void __exit
 mptscsih_exit(void)
 {
-	MPT_ADAPTER	*ioc;
-
-	/* removing devices */
-	for(ioc = mpt_adapter_find_first(); ioc != NULL;
-	  ioc = mpt_adapter_find_next(ioc)) {
-		if ((ioc->last_state != MPI_IOC_STATE_OPERATIONAL) ||
-		  (ioc->sh == NULL))
-			continue;
-		mptscsih_remove(ioc->pcidev);
-	}
+	mpt_device_driver_deregister(MPTSCSIH_DRIVER);
 
 	mpt_reset_deregister(ScsiDoneCtx);
 	dprintk((KERN_INFO MYNAM
@@ -1975,7 +1846,6 @@ mptscsih_exit(void)
 	dprintk((KERN_INFO MYNAM
 	  ": Deregistered for IOC event notifications\n"));
 
-	mpt_device_driver_deregister(MPTSCSIH_DRIVER);
 	mpt_deregister(ScsiScanDvCtx);
 	mpt_deregister(ScsiTaskCtx);
 	mpt_deregister(ScsiDoneCtx);
@@ -1990,7 +1860,7 @@ mptscsih_exit(void)
  *	mptscsih_info - Return information about MPT adapter
  *	@SChost: Pointer to Scsi_Host structure
  *
- *	(linux Scsi_Host_Template.info routine)
+ *	(linux scsi_host_template.info routine)
  *
  *	Returns pointer to buffer where information was written.
  */
@@ -2200,7 +2070,7 @@ static int mptscsih_user_command(MPT_ADAPTER *ioc, char *buffer, int length)
 /**
  *	mptscsih_proc_info - Return information about MPT adapter
  *
- *	(linux Scsi_Host_Template.info routine)
+ *	(linux scsi_host_template.info routine)
  *
  * 	buffer: if write, user data; if read, buffer for user
  * 	length: if write, return length;
@@ -2212,23 +2082,10 @@ static int mptscsih_user_command(MPT_ADAPTER *ioc, char *buffer, int length)
 int mptscsih_proc_info(struct Scsi_Host *host, char *buffer, char **start, off_t offset,
 			int length, int func)
 {
-	MPT_ADAPTER	*ioc;
-	MPT_SCSI_HOST	*hd = NULL;
+	MPT_SCSI_HOST	*hd = (MPT_SCSI_HOST *)host->hostdata;
+	MPT_ADAPTER	*ioc = hd->ioc;
 	int size = 0;
 
-	dprintk(("Called mptscsih_proc_info: hostno=%d, func=%d\n", host->host_no, func));
-	dprintk(("buffer %p, start=%p (%p) offset=%ld length = %d\n",
-			buffer, start, *start, offset, length));
-
-	for (ioc = mpt_adapter_find_first(); ioc != NULL; ioc = mpt_adapter_find_next(ioc)) {
-		if ((ioc->sh) && (ioc->sh == host)) {
-			hd = (MPT_SCSI_HOST *)ioc->sh->hostdata;
-			break;
-		}
-	}
-	if ((ioc == NULL) || (ioc->sh == NULL) || (hd == NULL))
-		return 0;
-
 	if (func) {
 		size = mptscsih_user_command(ioc, buffer, length);
 	} else {
@@ -2248,17 +2105,17 @@ int mptscsih_proc_info(struct Scsi_Host *host, char *buffer, char **start, off_t
 /*=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=*/
 /**
  *	mptscsih_qcmd - Primary Fusion MPT SCSI initiator IO start routine.
- *	@SCpnt: Pointer to Scsi_Cmnd structure
+ *	@SCpnt: Pointer to scsi_cmnd structure
  *	@done: Pointer SCSI mid-layer IO completion function
  *
- *	(linux Scsi_Host_Template.queuecommand routine)
+ *	(linux scsi_host_template.queuecommand routine)
  *	This is the primary SCSI IO start routine.  Create a MPI SCSIIORequest
- *	from a linux Scsi_Cmnd request and send it to the IOC.
+ *	from a linux scsi_cmnd request and send it to the IOC.
  *
  *	Returns 0. (rtn value discarded by linux scsi mid-layer)
  */
 int
-mptscsih_qcmd(Scsi_Cmnd *SCpnt, void (*done)(Scsi_Cmnd *))
+mptscsih_qcmd(struct scsi_cmnd *SCpnt, void (*done)(struct scsi_cmnd *))
 {
 	MPT_SCSI_HOST		*hd;
 	MPT_FRAME_HDR		*mf;
@@ -2268,7 +2125,6 @@ mptscsih_qcmd(Scsi_Cmnd *SCpnt, void (*done)(Scsi_Cmnd *))
 	unsigned long		 flags;
 	int	 target;
 	int	 lun;
-	int	 datadir;
 	u32	 datalen;
 	u32	 scsictl;
 	u32	 scsidir;
@@ -2306,7 +2162,7 @@ mptscsih_qcmd(Scsi_Cmnd *SCpnt, void (*done)(Scsi_Cmnd *))
 	/*
 	 *  Put together a MPT SCSI request...
 	 */
-	if ((mf = mpt_get_msg_frame(ScsiDoneCtx, hd->ioc->id)) == NULL) {
+	if ((mf = mpt_get_msg_frame(ScsiDoneCtx, hd->ioc)) == NULL) {
 		dprintk((MYIOC_s_WARN_FMT "QueueCmd, no msg frames!!\n",
 				hd->ioc->name));
 		did_errcode = 2;
@@ -2319,21 +2175,15 @@ mptscsih_qcmd(Scsi_Cmnd *SCpnt, void (*done)(Scsi_Cmnd *))
 
 	ADD_INDEX_LOG(my_idx);
 
-	/*
-	 *  The scsi layer should be handling this stuff
-	 *  (In 2.3.x it does -DaveM)
-	 */
-
 	/*  BUG FIX!  19991030 -sralston
 	 *    TUR's being issued with scsictl=0x02000000 (DATA_IN)!
 	 *    Seems we may receive a buffer (datalen>0) even when there
 	 *    will be no data transfer!  GRRRRR...
 	 */
-	datadir = mptscsih_io_direction(SCpnt);
-	if (datadir == SCSI_DATA_READ) {
+	if (SCpnt->sc_data_direction == DMA_FROM_DEVICE) {
 		datalen = SCpnt->request_bufflen;
 		scsidir = MPI_SCSIIO_CONTROL_READ;	/* DATA IN  (host<--ioc<--dev) */
-	} else if (datadir == SCSI_DATA_WRITE) {
+	} else if (SCpnt->sc_data_direction == DMA_TO_DEVICE) {
 		datalen = SCpnt->request_bufflen;
 		scsidir = MPI_SCSIIO_CONTROL_WRITE;	/* DATA OUT (host-->ioc-->dev) */
 	} else {
@@ -2414,17 +2264,6 @@ mptscsih_qcmd(Scsi_Cmnd *SCpnt, void (*done)(Scsi_Cmnd *))
 
 			if (dvStatus || hd->ioc->spi_data.forceDv) {
 
-				/* Write SDP1 on this I/O to this target */
-				if (dvStatus & MPT_SCSICFG_NEGOTIATE) {
-					mptscsih_writeSDP1(hd, 0, target, hd->negoNvram);
-					dvStatus &= ~MPT_SCSICFG_NEGOTIATE;
-					hd->ioc->spi_data.dvStatus[target] =  dvStatus;
-				} else if (dvStatus & MPT_SCSICFG_BLK_NEGO) {
-					mptscsih_writeSDP1(hd, 0, target, MPT_SCSICFG_BLK_NEGO);
-					dvStatus &= ~MPT_SCSICFG_BLK_NEGO;
-					hd->ioc->spi_data.dvStatus[target] =  dvStatus;
-				}
-
 #ifdef MPTSCSIH_ENABLE_DOMAIN_VALIDATION
 				if ((dvStatus & MPT_SCSICFG_NEED_DV) ||
 					(hd->ioc->spi_data.forceDv & MPT_SCSICFG_NEED_DV)) {
@@ -2434,9 +2273,9 @@ mptscsih_qcmd(Scsi_Cmnd *SCpnt, void (*done)(Scsi_Cmnd *))
 					if (!dvtaskQ_active) {
 						dvtaskQ_active = 1;
 						spin_unlock_irqrestore(&dvtaskQ_lock, lflags);
-						MPT_INIT_WORK(&mptscsih_dvTask, mptscsih_domainValidation, (void *) hd);
+						INIT_WORK(&mptscsih_dvTask, mptscsih_domainValidation, (void *) hd);
 
-						SCHEDULE_TASK(&mptscsih_dvTask);
+						schedule_work(&mptscsih_dvTask);
 					} else {
 						spin_unlock_irqrestore(&dvtaskQ_lock, lflags);
 					}
@@ -2472,7 +2311,7 @@ mptscsih_qcmd(Scsi_Cmnd *SCpnt, void (*done)(Scsi_Cmnd *))
 #endif
 
 		if (issueCmd) {
-			mpt_put_msg_frame(ScsiDoneCtx, hd->ioc->id, mf);
+			mpt_put_msg_frame(ScsiDoneCtx, hd->ioc, mf);
 			dmfprintk((MYIOC_s_INFO_FMT "Issued SCSI cmd (%p) mf=%p idx=%d\n",
 					hd->ioc->name, SCpnt, mf, my_idx));
 		} else {
@@ -2500,7 +2339,7 @@ mptscsih_qcmd(Scsi_Cmnd *SCpnt, void (*done)(Scsi_Cmnd *))
 		}
 	} else {
 		mptscsih_freeChainBuffers(hd, my_idx);
-		mpt_free_msg_frame(ScsiDoneCtx, hd->ioc->id, mf);
+		mpt_free_msg_frame(ScsiDoneCtx, hd->ioc, mf);
 		did_errcode = 3;
 		goto did_error;
 	}
@@ -2519,7 +2358,7 @@ did_error:
 		buffer = hd->freeQ.head;
 		Q_DEL_ITEM(buffer);
 
-		/* Set the Scsi_Cmnd pointer
+		/* Set the scsi_cmnd pointer
 		 */
 		buffer->argp = (void *)SCpnt;
 
@@ -2753,7 +2592,7 @@ mptscsih_IssueTaskMgmt(MPT_SCSI_HOST *hd, u8 type, u8 channel, u8 target, u8 lun
 
 	/* Return Fail to calling function if no message frames available.
 	 */
-	if ((mf = mpt_get_msg_frame(ScsiTaskCtx, hd->ioc->id)) == NULL) {
+	if ((mf = mpt_get_msg_frame(ScsiTaskCtx, hd->ioc)) == NULL) {
 		dtmprintk((MYIOC_s_WARN_FMT "IssueTaskMgmt, no msg frames!!\n",
 				hd->ioc->name));
 		//return FAILED;
@@ -2797,7 +2636,7 @@ mptscsih_IssueTaskMgmt(MPT_SCSI_HOST *hd, u8 type, u8 channel, u8 target, u8 lun
 	hd->TMtimer.expires = jiffies + timeout;
 	add_timer(&hd->TMtimer);
 
-	if ((retval = mpt_send_handshake_request(ScsiTaskCtx, hd->ioc->id,
+	if ((retval = mpt_send_handshake_request(ScsiTaskCtx, hd->ioc,
 				sizeof(SCSITaskMgmt_t), (u32*)pScsiTm, sleepFlag))
 	!= 0) {
 		dtmprintk((MYIOC_s_WARN_FMT "_send_handshake FAILED!"
@@ -2805,7 +2644,7 @@ mptscsih_IssueTaskMgmt(MPT_SCSI_HOST *hd, u8 type, u8 channel, u8 target, u8 lun
 		hd->numTMrequests--;
 		hd->tmPtr = NULL;
 		del_timer(&hd->TMtimer);
-		mpt_free_msg_frame(ScsiTaskCtx, hd->ioc->id, mf);
+		mpt_free_msg_frame(ScsiTaskCtx, hd->ioc, mf);
 	}
 
 	return retval;
@@ -2813,15 +2652,15 @@ mptscsih_IssueTaskMgmt(MPT_SCSI_HOST *hd, u8 type, u8 channel, u8 target, u8 lun
 
 /*=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=*/
 /**
- *	mptscsih_abort - Abort linux Scsi_Cmnd routine, new_eh variant
- *	@SCpnt: Pointer to Scsi_Cmnd structure, IO to be aborted
+ *	mptscsih_abort - Abort linux scsi_cmnd routine, new_eh variant
+ *	@SCpnt: Pointer to scsi_cmnd structure, IO to be aborted
  *
- *	(linux Scsi_Host_Template.eh_abort_handler routine)
+ *	(linux scsi_host_template.eh_abort_handler routine)
  *
  *	Returns SUCCESS or FAILED.
  */
 int
-mptscsih_abort(Scsi_Cmnd * SCpnt)
+mptscsih_abort(struct scsi_cmnd * SCpnt)
 {
 	MPT_SCSI_HOST	*hd;
 	MPT_FRAME_HDR	*mf;
@@ -2869,7 +2708,7 @@ mptscsih_abort(Scsi_Cmnd * SCpnt)
 	 * and then following up with the reset request.
 	 */
 	if ((mf = mptscsih_search_pendingQ(hd, scpnt_idx)) != NULL) {
-		mpt_put_msg_frame(ScsiDoneCtx, hd->ioc->id, mf);
+		mpt_put_msg_frame(ScsiDoneCtx, hd->ioc, mf);
 		post_pendingQ_commands(hd);
 		dtmprintk((KERN_WARNING MYNAM ": %s: mptscsih_abort: "
 			   "Posting pended cmd! (sc=%p)\n",
@@ -2916,14 +2755,14 @@ mptscsih_abort(Scsi_Cmnd * SCpnt)
 /*=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=*/
 /**
  *	mptscsih_dev_reset - Perform a SCSI TARGET_RESET!  new_eh variant
- *	@SCpnt: Pointer to Scsi_Cmnd structure, IO which reset is due to
+ *	@SCpnt: Pointer to scsi_cmnd structure, IO which reset is due to
  *
- *	(linux Scsi_Host_Template.eh_dev_reset_handler routine)
+ *	(linux scsi_host_template.eh_dev_reset_handler routine)
  *
  *	Returns SUCCESS or FAILED.
  */
 int
-mptscsih_dev_reset(Scsi_Cmnd * SCpnt)
+mptscsih_dev_reset(struct scsi_cmnd * SCpnt)
 {
 	MPT_SCSI_HOST	*hd;
 	spinlock_t	*host_lock = SCpnt->device->host->host_lock;
@@ -2971,14 +2810,14 @@ mptscsih_dev_reset(Scsi_Cmnd * SCpnt)
 /*=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=*/
 /**
  *	mptscsih_bus_reset - Perform a SCSI BUS_RESET!	new_eh variant
- *	@SCpnt: Pointer to Scsi_Cmnd structure, IO which reset is due to
+ *	@SCpnt: Pointer to scsi_cmnd structure, IO which reset is due to
  *
- *	(linux Scsi_Host_Template.eh_bus_reset_handler routine)
+ *	(linux scsi_host_template.eh_bus_reset_handler routine)
  *
  *	Returns SUCCESS or FAILED.
  */
 int
-mptscsih_bus_reset(Scsi_Cmnd * SCpnt)
+mptscsih_bus_reset(struct scsi_cmnd * SCpnt)
 {
 	MPT_SCSI_HOST	*hd;
 	spinlock_t	*host_lock = SCpnt->device->host->host_lock;
@@ -3026,14 +2865,14 @@ mptscsih_bus_reset(Scsi_Cmnd * SCpnt)
 /**
  *	mptscsih_host_reset - Perform a SCSI host adapter RESET!
  *	new_eh variant
- *	@SCpnt: Pointer to Scsi_Cmnd structure, IO which reset is due to
+ *	@SCpnt: Pointer to scsi_cmnd structure, IO which reset is due to
  *
- *	(linux Scsi_Host_Template.eh_host_reset_handler routine)
+ *	(linux scsi_host_template.eh_host_reset_handler routine)
  *
  *	Returns SUCCESS or FAILED.
  */
 int
-mptscsih_host_reset(Scsi_Cmnd *SCpnt)
+mptscsih_host_reset(struct scsi_cmnd *SCpnt)
 {
 	MPT_SCSI_HOST *  hd;
 	int              status = SUCCESS;
@@ -3269,7 +3108,7 @@ mptscsih_bios_param(struct scsi_device * sdev, struct block_device *bdev,
  *	Init memory once per id (not LUN).
  */
 int
-mptscsih_slave_alloc(Scsi_Device *device)
+mptscsih_slave_alloc(struct scsi_device *device)
 {
 	struct Scsi_Host	*host = device->host;
 	MPT_SCSI_HOST		*hd;
@@ -3309,7 +3148,7 @@ mptscsih_slave_alloc(Scsi_Device *device)
  *	Called if no device present or device being unloaded
  */
 void
-mptscsih_slave_destroy(Scsi_Device *device)
+mptscsih_slave_destroy(struct scsi_device *device)
 {
 	struct Scsi_Host	*host = device->host;
 	MPT_SCSI_HOST		*hd;
@@ -3374,7 +3213,7 @@ mptscsih_slave_destroy(Scsi_Device *device)
  *	Return non-zero if fails.
  */
 int
-mptscsih_slave_configure(Scsi_Device *device)
+mptscsih_slave_configure(struct scsi_device *device)
 {
 	struct Scsi_Host	*sh = device->host;
 	VirtDevice		*pTarget;
@@ -3457,7 +3296,7 @@ slave_configure_exit:
  *
  */
 static void
-copy_sense_data(Scsi_Cmnd *sc, MPT_SCSI_HOST *hd, MPT_FRAME_HDR *mf, SCSIIOReply_t *pScsiReply)
+copy_sense_data(struct scsi_cmnd *sc, MPT_SCSI_HOST *hd, MPT_FRAME_HDR *mf, SCSIIOReply_t *pScsiReply)
 {
 	VirtDevice	*target;
 	SCSIIORequest_t	*pReq;
@@ -3535,7 +3374,7 @@ copy_sense_data(Scsi_Cmnd *sc, MPT_SCSI_HOST *hd, MPT_FRAME_HDR *mf, SCSIIOReply
 }
 
 static u32
-SCPNT_TO_LOOKUP_IDX(Scsi_Cmnd *sc)
+SCPNT_TO_LOOKUP_IDX(struct scsi_cmnd *sc)
 {
 	MPT_SCSI_HOST *hd;
 	int i;
@@ -3632,12 +3471,12 @@ post_pendingQ_commands(MPT_SCSI_HOST *hd)
 			continue;
 		}
 
-		mpt_put_msg_frame(ScsiDoneCtx, hd->ioc->id, mf);
+		mpt_put_msg_frame(ScsiDoneCtx, hd->ioc, mf);
 
 #if defined(MPT_DEBUG_DV) || defined(MPT_DEBUG_DV_TINY)
 		{
 			u16		 req_idx = le16_to_cpu(mf->u.frame.hwhdr.msgctxu.fld.req_idx);
-			Scsi_Cmnd	*sc = hd->ScsiLookup[req_idx];
+			struct scsi_cmnd	*sc = hd->ScsiLookup[req_idx];
 			printk(MYIOC_s_INFO_FMT "Issued SCSI cmd (sc=%p) idx=%d (mf=%p)\n",
 					hd->ioc->name, sc, req_idx, mf);
 		}
@@ -3699,7 +3538,7 @@ mptscsih_ioc_reset(MPT_ADAPTER *ioc, int reset_phase)
 		 */
 		if (hd->cmdPtr) {
 			del_timer(&hd->timer);
-			mpt_free_msg_frame(ScsiScanDvCtx, ioc->id, hd->cmdPtr);
+			mpt_free_msg_frame(ScsiScanDvCtx, ioc, hd->cmdPtr);
 		}
 
 		/* 2d. If a task management has not completed,
@@ -3707,7 +3546,7 @@ mptscsih_ioc_reset(MPT_ADAPTER *ioc, int reset_phase)
 		 */
 		if (hd->tmPtr) {
 			del_timer(&hd->TMtimer);
-			mpt_free_msg_frame(ScsiTaskCtx, ioc->id, hd->tmPtr);
+			mpt_free_msg_frame(ScsiTaskCtx, ioc, hd->tmPtr);
 		}
 
 #ifdef MPTSCSIH_DBG_TIMEOUT
@@ -3905,6 +3744,29 @@ mptscsih_event_process(MPT_ADAPTER *ioc, EventNotificationReply_t *pEvReply)
 	return 1;		/* currently means nothing really */
 }
 
+static struct scsi_host_template driver_template = {
+	.proc_name			= "mptscsih",
+	.proc_info			= mptscsih_proc_info,
+	.name				= "MPT SCSI Host",
+	.info				= mptscsih_info,
+	.queuecommand			= mptscsih_qcmd,
+	.slave_alloc			= mptscsih_slave_alloc,
+	.slave_configure		= mptscsih_slave_configure,
+	.slave_destroy			= mptscsih_slave_destroy,
+	.eh_abort_handler		= mptscsih_abort,
+	.eh_device_reset_handler	= mptscsih_dev_reset,
+	.eh_bus_reset_handler		= mptscsih_bus_reset,
+	.eh_host_reset_handler		= mptscsih_host_reset,
+	.bios_param			= mptscsih_bios_param,
+	.can_queue			= MPT_SCSI_CAN_QUEUE,
+	.this_id			= -1,
+	.sg_tablesize			= MPT_SCSI_SG_DEPTH,
+	.max_sectors			= 8192,
+	.cmd_per_lun			= 7,
+	.use_clustering			= ENABLE_CLUSTERING,
+};
+
+
 /*=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=*/
 /*
  *  Private data...
@@ -4378,7 +4240,7 @@ mptscsih_initTarget(MPT_SCSI_HOST *hd, int bus_id, int target_id, u8 lun, char *
 			}
 		}
 
-		data_56 = 0;
+		data_56 = 0x0F;  /* Default to full capabilities if Inq data length is < 57 */
 		if (dlen > 56) {
 			if ( (!(vdev->tflags & MPT_TARGET_FLAGS_VALID_56))) {
 			/* Update the target capabilities
@@ -4443,14 +4305,16 @@ void mptscsih_setTargetNegoParms(MPT_SCSI_HOST *hd, VirtDevice *target, char byt
 			}
 
 			if (target->inq_data[7] & 0x10) {
-				/* bits 2 & 3 show DT support
+				/* bits 2 & 3 show Clocking support
 				 */
-				if ((byte56 & 0x04) == 0)
+				if ((byte56 & 0x0C) == 0)
 					factor = MPT_ULTRA2;
-				else if ((byte56 & 0x03) == 0)
-					factor = MPT_ULTRA160;
-				else
-					factor = MPT_ULTRA320;
+				else {
+					if ((byte56 & 0x03) == 0)
+						factor = MPT_ULTRA160;
+					else
+						factor = MPT_ULTRA320;
+				}
 				offset = pspi_data->maxSyncOffset;
 
 				/* If RAID, never disable QAS
@@ -4459,8 +4323,9 @@ void mptscsih_setTargetNegoParms(MPT_SCSI_HOST *hd, VirtDevice *target, char byt
 				 * bit 1 QAS support, non-raid only
 				 * bit 0 IU support
 				 */
-				if ((target->raidVolume == 1) || ((byte56 & 0x02) != 0))
+				if ((target->raidVolume == 1) || (byte56 & 0x02)) {
 					noQas = 0;
+				}
 			} else {
 				factor = MPT_ASYNC;
 				offset = 0;
@@ -4539,7 +4404,7 @@ void mptscsih_setTargetNegoParms(MPT_SCSI_HOST *hd, VirtDevice *target, char byt
 				/* Disable QAS in a mixed configuration case
 		 		*/
 
-//				ddvtprintk((KERN_INFO "Disabling QAS!\n"));
+				ddvtprintk((KERN_INFO "Disabling QAS due to noQas=%02x on id=%d!\n", noQas, id));
 				for (ii = 0; ii < id; ii++) {
 					if ( (vdev = hd->Targets[ii]) ) {
 						vdev->negoFlags |= MPT_TARGET_NO_NEGO_QAS;
@@ -4547,6 +4412,15 @@ void mptscsih_setTargetNegoParms(MPT_SCSI_HOST *hd, VirtDevice *target, char byt
 				}
 			}
 		}
+		
+		/* Write SDP1 on this I/O to this target */
+		if (pspi_data->dvStatus[id] & MPT_SCSICFG_NEGOTIATE) {
+			mptscsih_writeSDP1(hd, 0, id, hd->negoNvram);
+			pspi_data->dvStatus[id] &= ~MPT_SCSICFG_NEGOTIATE;
+		} else if (pspi_data->dvStatus[id] & MPT_SCSICFG_BLK_NEGO) {
+			mptscsih_writeSDP1(hd, 0, id, MPT_SCSICFG_BLK_NEGO);
+			pspi_data->dvStatus[id] &= ~MPT_SCSICFG_BLK_NEGO;
+		}
 	}
 
 	return;
@@ -4779,7 +4653,7 @@ mptscsih_writeSDP1(MPT_SCSI_HOST *hd, int portnum, int target_id, int flags)
 
 		/* Get a MF for this command.
 		 */
-		if ((mf = mpt_get_msg_frame(ScsiDoneCtx, ioc->id)) == NULL) {
+		if ((mf = mpt_get_msg_frame(ScsiDoneCtx, ioc)) == NULL) {
 			dprintk((MYIOC_s_WARN_FMT "write SDP1: no msg frames!\n",
 						ioc->name));
 			return -EAGAIN;
@@ -4843,7 +4717,7 @@ mptscsih_writeSDP1(MPT_SCSI_HOST *hd, int portnum, int target_id, int flags)
 				ioc->name, id, (id | (bus<<8)),
 				requested, configuration));
 
-		mpt_put_msg_frame(ScsiDoneCtx, ioc->id, mf);
+		mpt_put_msg_frame(ScsiDoneCtx, ioc, mf);
 	}
 
 	return 0;
@@ -4874,7 +4748,7 @@ mptscsih_writeIOCPage4(MPT_SCSI_HOST *hd, int target_id, int bus)
 
 	/* Get a MF for this command.
 	 */
-	if ((mf = mpt_get_msg_frame(ScsiDoneCtx, ioc->id)) == NULL) {
+	if ((mf = mpt_get_msg_frame(ScsiDoneCtx, ioc)) == NULL) {
 		dprintk((MYIOC_s_WARN_FMT "writeIOCPage4 : no msg frames!\n",
 					ioc->name));
 		return -EAGAIN;
@@ -4923,7 +4797,7 @@ mptscsih_writeIOCPage4(MPT_SCSI_HOST *hd, int target_id, int bus)
 		"writeIOCPage4: pgaddr 0x%x\n",
 			ioc->name, (target_id | (bus<<8))));
 
-	mpt_put_msg_frame(ScsiDoneCtx, ioc->id, mf);
+	mpt_put_msg_frame(ScsiDoneCtx, ioc, mf);
 
 	return 0;
 }
@@ -4950,8 +4824,8 @@ static void mptscsih_taskmgmt_timeout(unsigned long data)
 	/* Call the reset handler. Already had a TM request
 	 * timeout - so issue a diagnostic reset
 	 */
-	MPT_INIT_WORK(&mptscsih_rstTask, mptscsih_schedule_reset, (void *)hd);
-	SCHEDULE_TASK(&mptscsih_rstTask);
+	INIT_WORK(&mptscsih_rstTask, mptscsih_schedule_reset, (void *)hd);
+	schedule_work(&mptscsih_rstTask);
 	return;
 }
 
@@ -5235,7 +5109,7 @@ mptscsih_do_raid(MPT_SCSI_HOST *hd, u8 action, INTERNAL_CMD *io)
 
 	/* Get and Populate a free Frame
 	 */
-	if ((mf = mpt_get_msg_frame(ScsiScanDvCtx, hd->ioc->id)) == NULL) {
+	if ((mf = mpt_get_msg_frame(ScsiScanDvCtx, hd->ioc)) == NULL) {
 		ddvprintk((MYIOC_s_WARN_FMT "_do_raid: no msg frames!\n",
 					hd->ioc->name));
 		return -EAGAIN;
@@ -5260,7 +5134,7 @@ mptscsih_do_raid(MPT_SCSI_HOST *hd, u8 action, INTERNAL_CMD *io)
 			hd->ioc->name, action, io->id));
 
 	hd->pLocal = NULL;
-	hd->timer.expires = jiffies + HZ*2; /* 2 second timeout */
+	hd->timer.expires = jiffies + HZ*10; /* 10 second timeout */
 	scandv_wait_done = 0;
 
 	/* Save cmd pointer, for resource free if timeout or
@@ -5269,7 +5143,7 @@ mptscsih_do_raid(MPT_SCSI_HOST *hd, u8 action, INTERNAL_CMD *io)
 	hd->cmdPtr = mf;
 
 	add_timer(&hd->timer);
-	mpt_put_msg_frame(ScsiScanDvCtx, hd->ioc->id, mf);
+	mpt_put_msg_frame(ScsiScanDvCtx, hd->ioc, mf);
 	wait_event(scandv_waitq, scandv_wait_done);
 
 	if ((hd->pLocal == NULL) || (hd->pLocal->completion != MPT_SCANDV_GOOD))
@@ -5416,7 +5290,7 @@ mptscsih_do_cmd(MPT_SCSI_HOST *hd, INTERNAL_CMD *io)
 
 	/* Get and Populate a free Frame
 	 */
-	if ((mf = mpt_get_msg_frame(ScsiScanDvCtx, hd->ioc->id)) == NULL) {
+	if ((mf = mpt_get_msg_frame(ScsiScanDvCtx, hd->ioc)) == NULL) {
 		ddvprintk((MYIOC_s_WARN_FMT "No msg frames!\n",
 					hd->ioc->name));
 		return -EBUSY;
@@ -5506,7 +5380,7 @@ mptscsih_do_cmd(MPT_SCSI_HOST *hd, INTERNAL_CMD *io)
 	hd->cmdPtr = mf;
 
 	add_timer(&hd->timer);
-	mpt_put_msg_frame(ScsiScanDvCtx, hd->ioc->id, mf);
+	mpt_put_msg_frame(ScsiScanDvCtx, hd->ioc, mf);
 	wait_event(scandv_waitq, scandv_wait_done);
 
 	if (hd->pLocal) {
@@ -5714,7 +5588,7 @@ mptscsih_domainValidation(void *arg)
 	did = 1;
 	while (did) {
 		did = 0;
-		for (ioc = mpt_adapter_find_first(); ioc != NULL; ioc = mpt_adapter_find_next(ioc)) {
+		list_for_each_entry(ioc, &ioc_list, list) {
 			spin_lock_irqsave(&dvtaskQ_lock, flags);
 			if (dvtaskQ_release) {
 				dvtaskQ_active = 0;
diff --git a/drivers/message/fusion/mptscsih.h b/drivers/message/fusion/mptscsih.h
index 5ab0726e8..2c002b537 100644
--- a/drivers/message/fusion/mptscsih.h
+++ b/drivers/message/fusion/mptscsih.h
@@ -108,75 +108,4 @@ struct mptscsih_driver_setup
         MPTSCSIH_SAF_TE,                        \
 }
 
-
-
-/*=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=*/
-/*
- *	Various bits and pieces broke within the lk-2.4.0-testN series:-(
- *	So here are various HACKS to work around them.
- */
-
-/*
- *	tq_scheduler disappeared @ lk-2.4.0-test12
- *	(right when <linux/sched.h> newly defined TQ_ACTIVE)
- *	tq_struct reworked in 2.5.41. Include workqueue.h.
- */
-#	include <linux/sched.h>
-#	include <linux/workqueue.h>
-#define SCHEDULE_TASK(x)		\
-	if (schedule_work(x) == 0) {	\
-		/*MOD_DEC_USE_COUNT*/;	\
-	}
-
-/*=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=*/
-
-#define x_scsi_info		mptscsih_info
-#define x_scsi_queuecommand	mptscsih_qcmd
-#define x_scsi_abort		mptscsih_abort
-#define x_scsi_bus_reset	mptscsih_bus_reset
-#define x_scsi_dev_reset	mptscsih_dev_reset
-#define x_scsi_host_reset	mptscsih_host_reset
-#define x_scsi_bios_param	mptscsih_bios_param
-
-#define x_scsi_slave_alloc	mptscsih_slave_alloc
-#define x_scsi_slave_configure	mptscsih_slave_configure
-#define x_scsi_slave_destroy	mptscsih_slave_destroy
-#define x_scsi_proc_info	mptscsih_proc_info
-
-/*=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=*/
-/*
- *	MPT SCSI Host / Initiator decls...
- */
-extern	const char	*x_scsi_info(struct Scsi_Host *);
-extern	int		 x_scsi_queuecommand(Scsi_Cmnd *, void (*done)(Scsi_Cmnd *));
-extern	int		 x_scsi_abort(Scsi_Cmnd *);
-extern	int		 x_scsi_bus_reset(Scsi_Cmnd *);
-extern	int		 x_scsi_dev_reset(Scsi_Cmnd *);
-extern	int		 x_scsi_host_reset(Scsi_Cmnd *);
-extern int		 x_scsi_bios_param(struct scsi_device * sdev, struct block_device *bdev,
-				sector_t capacity, int geom[]);
-extern	int		 x_scsi_slave_alloc(Scsi_Device *);
-extern	int		 x_scsi_slave_configure(Scsi_Device *);
-extern	void		 x_scsi_slave_destroy(Scsi_Device *);
-extern	int		 x_scsi_proc_info(struct Scsi_Host *, char *, char **, off_t, int, int);
-
-/*=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=*/
-
-/*  include/scsi/scsi.h may not be quite complete...  */
-#ifndef RESERVE_10
-#define RESERVE_10		0x56
-#endif
-#ifndef RELEASE_10
-#define RELEASE_10		0x57
-#endif
-#ifndef PERSISTENT_RESERVE_IN
-#define PERSISTENT_RESERVE_IN	0x5e
 #endif
-#ifndef PERSISTENT_RESERVE_OUT
-#define PERSISTENT_RESERVE_OUT	0x5f
-#endif
-
-/*=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=*/
-
-#endif
-
diff --git a/drivers/message/i2o/i2o_block.c b/drivers/message/i2o/i2o_block.c
index 76de2d7ae..36dc0e9d1 100644
--- a/drivers/message/i2o/i2o_block.c
+++ b/drivers/message/i2o/i2o_block.c
@@ -280,8 +280,8 @@ static int i2ob_send(u32 m, struct i2ob_device *dev, struct i2ob_request *ireq,
 {
 	struct i2o_controller *c = dev->controller;
 	int tid = dev->tid;
-	unsigned long msg;
-	unsigned long mptr;
+	void *msg;
+	void *mptr;
 	u64 offset;
 	struct request *req = ireq->req;
 	int count = req->nr_sectors<<9;
@@ -291,7 +291,7 @@ static int i2ob_send(u32 m, struct i2ob_device *dev, struct i2ob_request *ireq,
 
 	// printk(KERN_INFO "i2ob_send called\n");
 	/* Map the message to a virtual address */
-	msg = c->mem_offset + m;
+	msg = c->msg_virt + m;
 	
 	sgnum = i2ob_build_sglist(dev, ireq);
 	
@@ -479,7 +479,7 @@ static void i2o_block_reply(struct i2o_handler *h, struct i2o_controller *c, str
 		/* Now flush the message by making it a NOP */
 		m[0]&=0x00FFFFFF;
 		m[0]|=(I2O_CMD_UTIL_NOP)<<24;
-		i2o_post_message(c, ((unsigned long)m) - c->mem_offset);
+		i2o_post_message(c, (unsigned long) m - (unsigned long) c->msg_virt);
 
 		return;
 	}
@@ -861,6 +861,7 @@ static int i2ob_ioctl(struct inode *inode, struct file *file,
 {
 	struct gendisk *disk = inode->i_bdev->bd_disk;
 	struct i2ob_device *dev = disk->private_data;
+	void __user *argp = (void __user *)arg;
 
 	/* Anyone capable of this syscall can do *real bad* things */
 
@@ -873,13 +874,13 @@ static int i2ob_ioctl(struct inode *inode, struct file *file,
 			i2o_block_biosparam(get_capacity(disk), 
 					&g.cylinders, &g.heads, &g.sectors);
 			g.start = get_start_sect(inode->i_bdev);
-			return copy_to_user((void *)arg,&g, sizeof(g))?-EFAULT:0;
+			return copy_to_user(argp, &g, sizeof(g))?-EFAULT:0;
 		}
 		
 		case BLKI2OGRSTRAT:
-			return put_user(dev->rcache, (int *)arg);
+			return put_user(dev->rcache, (int __user *)argp);
 		case BLKI2OGWSTRAT:
-			return put_user(dev->wcache, (int *)arg);
+			return put_user(dev->wcache, (int __user *)argp);
 		case BLKI2OSRSTRAT:
 			if(arg<0||arg>CACHE_SMARTFETCH)
 				return -EINVAL;
diff --git a/drivers/message/i2o/i2o_config.c b/drivers/message/i2o/i2o_config.c
index f417bac42..a28c4423b 100644
--- a/drivers/message/i2o/i2o_config.c
+++ b/drivers/message/i2o/i2o_config.c
@@ -97,7 +97,7 @@ static void i2o_cfg_reply(struct i2o_handler *h, struct i2o_controller *c, struc
 	u32 *msg = (u32 *)m;
 
 	if (msg[0] & MSG_FAIL) {
-		u32 *preserved_msg = (u32*)(c->mem_offset + msg[7]);
+		u32 *preserved_msg = (u32*)(c->msg_virt + msg[7]);
 
 		printk(KERN_ERR "i2o_config: IOP failed to process the msg.\n");
 
@@ -194,7 +194,7 @@ struct i2o_handler cfg_handler=
 	0xffffffff	// All classes
 };
 
-static ssize_t cfg_write(struct file *file, const char *buf, size_t count, loff_t *ppos)
+static ssize_t cfg_write(struct file *file, const char __user *buf, size_t count, loff_t *ppos)
 {
 	printk(KERN_INFO "i2o_config write not yet supported\n");
 
@@ -202,7 +202,7 @@ static ssize_t cfg_write(struct file *file, const char *buf, size_t count, loff_
 }
 
 
-static ssize_t cfg_read(struct file *file, char *buf, size_t count, loff_t *ptr)
+static ssize_t cfg_read(struct file *file, char __user *buf, size_t count, loff_t *ptr)
 {
 	return 0;
 }
@@ -278,7 +278,7 @@ static int cfg_ioctl(struct inode *inode, struct file *fp, unsigned int cmd,
 
 int ioctl_getiops(unsigned long arg)
 {
-	u8 *user_iop_table = (u8*)arg;
+	u8  __user *user_iop_table = (void __user *)arg;
 	struct i2o_controller *c = NULL;
 	int i;
 	u8 foo[MAX_I2O_CONTROLLERS];
@@ -314,7 +314,7 @@ int ioctl_getiops(unsigned long arg)
 int ioctl_gethrt(unsigned long arg)
 {
 	struct i2o_controller *c;
-	struct i2o_cmd_hrtlct *cmd = (struct i2o_cmd_hrtlct*)arg;
+	struct i2o_cmd_hrtlct __user *cmd = (void __user *)arg;
 	struct i2o_cmd_hrtlct kcmd;
 	i2o_hrt *hrt;
 	int len;
@@ -353,7 +353,7 @@ int ioctl_gethrt(unsigned long arg)
 int ioctl_getlct(unsigned long arg)
 {
 	struct i2o_controller *c;
-	struct i2o_cmd_hrtlct *cmd = (struct i2o_cmd_hrtlct*)arg;
+	struct i2o_cmd_hrtlct __user *cmd = (void __user *)arg;
 	struct i2o_cmd_hrtlct kcmd;
 	i2o_lct *lct;
 	int len;
@@ -390,7 +390,7 @@ static int ioctl_parms(unsigned long arg, unsigned int type)
 {
 	int ret = 0;
 	struct i2o_controller *c;
-	struct i2o_cmd_psetget *cmd = (struct i2o_cmd_psetget*)arg;
+	struct i2o_cmd_psetget __user *cmd = (void __user *)arg;
 	struct i2o_cmd_psetget kcmd;
 	u32 reslen;
 	u8 *ops;
@@ -460,7 +460,7 @@ static int ioctl_parms(unsigned long arg, unsigned int type)
 
 int ioctl_html(unsigned long arg)
 {
-	struct i2o_html *cmd = (struct i2o_html*)arg;
+	struct i2o_html __user *cmd = (void __user *)arg;
 	struct i2o_html kcmd;
 	struct i2o_controller *c;
 	u8 *res = NULL;
@@ -573,7 +573,7 @@ int ioctl_html(unsigned long arg)
 int ioctl_swdl(unsigned long arg)
 {
 	struct i2o_sw_xfer kxfer;
-	struct i2o_sw_xfer *pxfer = (struct i2o_sw_xfer *)arg;
+	struct i2o_sw_xfer __user *pxfer = (void __user *)arg;
 	unsigned char maxfrag = 0, curfrag = 1;
 	unsigned char *buffer;
 	u32 msg[9];
@@ -642,7 +642,7 @@ int ioctl_swdl(unsigned long arg)
 int ioctl_swul(unsigned long arg)
 {
 	struct i2o_sw_xfer kxfer;
-	struct i2o_sw_xfer *pxfer = (struct i2o_sw_xfer *)arg;
+	struct i2o_sw_xfer __user *pxfer = (void __user *)arg;
 	unsigned char maxfrag = 0, curfrag = 1;
 	unsigned char *buffer;
 	u32 msg[9];
@@ -709,7 +709,8 @@ int ioctl_swul(unsigned long arg)
 int ioctl_swdel(unsigned long arg)
 {
 	struct i2o_controller *c;
-	struct i2o_sw_xfer kxfer, *pxfer = (struct i2o_sw_xfer *)arg;
+	struct i2o_sw_xfer kxfer;
+	struct i2o_sw_xfer __user *pxfer = (void __user *)arg;
 	u32 msg[7];
 	unsigned int swlen;
 	int token;
@@ -776,7 +777,7 @@ int ioctl_validate(unsigned long arg)
 static int ioctl_evt_reg(unsigned long arg, struct file *fp)
 {
 	u32 msg[5];
-	struct i2o_evt_id *pdesc = (struct i2o_evt_id *)arg;
+	struct i2o_evt_id __user *pdesc = (void __user *)arg;
 	struct i2o_evt_id kdesc;
 	struct i2o_controller *iop;
 	struct i2o_device *d;
@@ -813,7 +814,7 @@ static int ioctl_evt_get(unsigned long arg, struct file *fp)
 {
 	u32 id = (u32)fp->private_data;
 	struct i2o_cfg_info *p = NULL;
-	struct i2o_evt_get *uget = (struct i2o_evt_get*)arg;
+	struct i2o_evt_get __user *uget = (void __user *)arg;
 	struct i2o_evt_get kget;
 	unsigned long flags;
 
@@ -842,24 +843,28 @@ static int ioctl_evt_get(unsigned long arg, struct file *fp)
 
 static int ioctl_passthru(unsigned long arg)
 {
-	struct i2o_cmd_passthru *cmd = (struct i2o_cmd_passthru *) arg;
+	struct i2o_cmd_passthru __user *cmd = (void __user *) arg;
 	struct i2o_controller *c;
 	u32 msg[MSG_FRAME_SIZE];
-	u32 *user_msg = (u32*)cmd->msg;
+	u32 __user *user_msg;
 	u32 *reply = NULL;
-	u32 *user_reply = NULL;
+	u32 __user *user_reply = NULL;
 	u32 size = 0;
 	u32 reply_size = 0;
 	u32 rcode = 0;
-	ulong sg_list[SG_TABLESIZE];
+	void *sg_list[SG_TABLESIZE];
 	u32 sg_offset = 0;
 	u32 sg_count = 0;
 	int sg_index = 0;
 	u32 i = 0;
-	ulong p = 0;
+	void *p = NULL;
+	unsigned int iop;
 
-	c = i2o_find_controller(cmd->iop);
-	if(!c)
+	if (get_user(iop, &cmd->iop) || get_user(user_msg, &cmd->msg))
+		return -EFAULT;
+
+	c = i2o_find_controller(iop);
+	if (!c)
                 return -ENXIO;
 
 	memset(&msg, 0, MSG_FRAME_SIZE*4);
@@ -873,7 +878,7 @@ static int ioctl_passthru(unsigned long arg)
 	size *= 4; // Convert to bytes
 
 	/* Copy in the user's I2O command */
-	if(copy_from_user((void*)msg, (void*)user_msg, size))
+	if(copy_from_user(msg, user_msg, size))
 		return -EFAULT;
 	if(get_user(reply_size, &user_reply[0]) < 0)
 		return -EFAULT;
@@ -916,7 +921,7 @@ static int ioctl_passthru(unsigned long arg)
 			}
 			sg_size = sg[i].flag_count & 0xffffff;
 			/* Allocate memory for the transfer */
-			p = (ulong)kmalloc(sg_size, GFP_KERNEL);
+			p = kmalloc(sg_size, GFP_KERNEL);
 			if (!p) {
 				printk(KERN_DEBUG"%s: Could not allocate SG buffer - size = %d buffer number %d of %d\n", c->name,sg_size,i,sg_count);
 				rcode = -ENOMEM;
@@ -926,14 +931,14 @@ static int ioctl_passthru(unsigned long arg)
 			/* 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)) {
+			        if (copy_from_user(p,(void __user *)sg[i].addr_bus, sg_size)) {
 					printk(KERN_DEBUG"%s: Could not copy SG buf %d FROM user\n",c->name,i);
 					rcode = -EFAULT;
 					goto cleanup;
 				}
 			}
 			//TODO 64bit fix
-			sg[i].addr_bus = (u32)virt_to_bus((void*)p);
+			sg[i].addr_bus = (u32)virt_to_bus(p);
 		}
 	}
 
@@ -958,7 +963,7 @@ static int ioctl_passthru(unsigned long arg)
 		size = size>>16;
 		size *= 4;
 		/* Copy in the user's I2O command */
-		if (copy_from_user ((void*)msg, (void*)user_msg, size)) {
+		if (copy_from_user (msg, user_msg, size)) {
 			rcode = -EFAULT;
 			goto cleanup;
 		}
@@ -971,8 +976,8 @@ static int ioctl_passthru(unsigned long arg)
 			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",c->name, sg_list[j], sg[j].addr_bus);
+				if (copy_to_user((void __user *)sg[j].addr_bus,sg_list[j], sg_size)) {
+					printk(KERN_WARNING"%s: Could not copy %p TO user %x\n",c->name, sg_list[j], sg[j].addr_bus);
 					rcode = -EFAULT;
 					goto cleanup;
 				}
diff --git a/drivers/message/i2o/i2o_core.c b/drivers/message/i2o/i2o_core.c
index e5afe8dc2..66fa24b3f 100644
--- a/drivers/message/i2o/i2o_core.c
+++ b/drivers/message/i2o/i2o_core.c
@@ -354,7 +354,7 @@ static void i2o_core_reply(struct i2o_handler *h, struct i2o_controller *c,
 
 	if (msg[0] & MSG_FAIL) // Fail bit is set
 	{
-		u32 *preserved_msg = (u32*)(c->mem_offset + msg[7]);
+		u32 *preserved_msg = (u32*)(c->msg_virt + msg[7]);
 
 		i2o_report_status(KERN_INFO, "i2o_core", msg);
 		i2o_dump_message(preserved_msg);
@@ -831,12 +831,14 @@ static int i2o_issue_claim(u32 cmd, struct i2o_controller *c, int tid, u32 type)
  
 int i2o_claim_device(struct i2o_device *d, struct i2o_handler *h)
 {
+	int ret = 0;
+
 	down(&i2o_configuration_lock);
 	if (d->owner) {
 		printk(KERN_INFO "Device claim called, but dev already owned by %s!",
 		       h->name);
-		up(&i2o_configuration_lock);
-		return -EBUSY;
+		ret = -EBUSY;
+		goto out;
 	}
 	d->owner=h;
 
@@ -844,10 +846,11 @@ int i2o_claim_device(struct i2o_device *d, struct i2o_handler *h)
 			   I2O_CLAIM_PRIMARY))
 	{
 		d->owner = NULL;
-		return -EBUSY;
+		ret = -EBUSY;
 	}
+out:
 	up(&i2o_configuration_lock);
-	return 0;
+	return ret;
 }
 
 /**
@@ -1794,7 +1797,7 @@ static int i2o_reset_controller(struct i2o_controller *c)
 	m=i2o_wait_message(c, "AdapterReset");
 	if(m==0xFFFFFFFF)	
 		return -ETIMEDOUT;
-	msg=(u32 *)(c->mem_offset+m);
+	msg=(u32 *)(c->msg_virt+m);
 	
 	status = pci_alloc_consistent(c->pdev, 4, &status_phys);
 	if(status == NULL) {
@@ -1923,7 +1926,7 @@ int i2o_status_get(struct i2o_controller *c)
 	m=i2o_wait_message(c, "StatusGet");
 	if(m==0xFFFFFFFF)
 		return -ETIMEDOUT;	
-	msg=(u32 *)(c->mem_offset+m);
+	msg=(u32 *)(c->msg_virt+m);
 
 	msg[0]=NINE_WORD_MSG_SIZE|SGL_OFFSET_0;
 	msg[1]=I2O_CMD_STATUS_GET<<24|HOST_TID<<12|ADAPTER_TID;
@@ -2344,7 +2347,7 @@ int i2o_init_outbound_q(struct i2o_controller *c)
 	m=i2o_wait_message(c, "OutboundInit");
 	if(m==0xFFFFFFFF)
 		return -ETIMEDOUT;
-	msg=(u32 *)(c->mem_offset+m);
+	msg=(u32 *)(c->msg_virt+m);
 
 	status = pci_alloc_consistent(c->pdev, 4, &status_phys);
 	if (status==NULL) {
@@ -2618,7 +2621,7 @@ static int i2o_build_sys_table(void)
 		sys_tbl->iops[count].last_changed = sys_tbl_ind - 1; // ??
 		sys_tbl->iops[count].iop_capabilities = 
 				iop->status_block->iop_capabilities;
-		sys_tbl->iops[count].inbound_low = iop->post_port;
+		sys_tbl->iops[count].inbound_low = (u32)iop->post_port;
 		sys_tbl->iops[count].inbound_high = 0;	// FIXME: 64-bit support
 
 		count++;
@@ -2666,7 +2669,7 @@ int i2o_post_this(struct i2o_controller *c, u32 *data, int len)
 		       c->name);
 		return -ETIMEDOUT;
 	}
-	msg = (u32 *)(c->mem_offset + m);
+	msg = (u32 *)(c->msg_virt + m);
  	memcpy_toio(msg, data, len);
 	i2o_post_message(c,m);
 	return 0;
@@ -3592,7 +3595,9 @@ static void i2o_pci_dispose(struct i2o_controller *c)
 	I2O_IRQ_WRITE32(c,0xFFFFFFFF);
 	if(c->irq > 0)
 		free_irq(c->irq, c);
-	iounmap(((u8 *)c->post_port)-0x40);
+	iounmap(c->base_virt);
+	if(c->raptor)
+		iounmap(c->msg_virt);
 
 #ifdef CONFIG_MTRR
 	if(c->mtrr_reg0 > 0)
@@ -3633,9 +3638,12 @@ int __init i2o_pci_install(struct pci_dev *dev)
 {
 	struct i2o_controller *c=kmalloc(sizeof(struct i2o_controller),
 						GFP_KERNEL);
-	unsigned long mem;
-	u32 memptr = 0;
-	u32 size;
+	void *bar0_virt;
+	void *bar1_virt;
+	unsigned long bar0_phys = 0;
+	unsigned long bar1_phys = 0;
+	unsigned long bar0_size = 0;
+	unsigned long bar1_size = 0;
 	
 	int i;
 
@@ -3646,37 +3654,9 @@ int __init i2o_pci_install(struct pci_dev *dev)
 	}
 	memset(c, 0, sizeof(*c));
 
-	for(i=0; i<6; i++)
-	{
-		/* Skip I/O spaces */
-		if(!(pci_resource_flags(dev, i) & IORESOURCE_IO))
-		{
-			memptr = pci_resource_start(dev, i);
-			break;
-		}
-	}
-	
-	if(i==6)
-	{
-		printk(KERN_ERR "i2o: I2O controller has no memory regions defined.\n");
-		kfree(c);
-		return -EINVAL;
-	}
-	
-	size = dev->resource[i].end-dev->resource[i].start+1;	
-	/* Map the I2O controller */
-	
-	printk(KERN_INFO "i2o: PCI I2O controller at 0x%08X size=%d\n", memptr, size);
-	mem = (unsigned long)ioremap(memptr, size);
-	if(mem==0)
-	{
-		printk(KERN_ERR "i2o: Unable to map controller.\n");
-		kfree(c);
-		return -EINVAL;
-	}
-
 	c->irq = -1;
 	c->dpt = 0;
+	c->raptor = 0;
 	c->short_req = 0;
 	c->pdev = dev;
 
@@ -3684,13 +3664,6 @@ int __init i2o_pci_install(struct pci_dev *dev)
 	c->context_list_lock = SPIN_LOCK_UNLOCKED;
 #endif
 
-	c->irq_mask = mem+0x34;
-	c->post_port = mem+0x40;
-	c->reply_port = mem+0x44;
-
-	c->mem_phys = memptr;
-	c->mem_offset = mem;
-	
 	/*
 	 *	Cards that fall apart if you hit them with large I/O
 	 *	loads...
@@ -3701,6 +3674,7 @@ int __init i2o_pci_install(struct pci_dev *dev)
 		c->short_req = 1;
 		printk(KERN_INFO "I2O: Symbios FC920 workarounds activated.\n");
 	}
+
 	if(dev->subsystem_vendor == PCI_VENDOR_ID_PROMISE)
 	{
 		c->promise = 1;
@@ -3712,15 +3686,85 @@ int __init i2o_pci_install(struct pci_dev *dev)
 	 *	them
 	 */
 	 
-	if(dev->vendor == PCI_VENDOR_ID_DPT)
+	if(dev->vendor == PCI_VENDOR_ID_DPT) {
 		c->dpt=1;
+		if(dev->device == 0xA511)
+			c->raptor=1;
+	}
+
+	for(i=0; i<6; i++)
+	{
+		/* Skip I/O spaces */
+		if(!(pci_resource_flags(dev, i) & IORESOURCE_IO))
+		{
+			if(!bar0_phys)
+			{
+				bar0_phys = pci_resource_start(dev, i);
+				bar0_size = pci_resource_len(dev, i);
+				if(!c->raptor)
+					break;
+			}
+			else
+			{
+				bar1_phys = pci_resource_start(dev, i);
+				bar1_size = pci_resource_len(dev, i);
+				break;
+			}
+		}
+	}
+
+	if(i==6)
+	{
+		printk(KERN_ERR "i2o: I2O controller has no memory regions defined.\n");
+		kfree(c);
+		return -EINVAL;
+	}
+
+
+	/* Map the I2O controller */
+	if(!c->raptor)
+		printk(KERN_INFO "i2o: PCI I2O controller at %08lX size=%ld\n", bar0_phys, bar0_size);
+	else
+		printk(KERN_INFO "i2o: PCI I2O controller\n    BAR0 at 0x%08lX size=%ld\n    BAR1 at 0x%08lX size=%ld\n", bar0_phys, bar0_size, bar1_phys, bar1_size);
+
+	bar0_virt = ioremap(bar0_phys, bar0_size);
+	if(bar0_virt==0)
+	{
+		printk(KERN_ERR "i2o: Unable to map controller.\n");
+		kfree(c);
+		return -EINVAL;
+	}
+
+	if(c->raptor)
+	{
+		bar1_virt = ioremap(bar1_phys, bar1_size);
+		if(bar1_virt==0)
+		{
+			printk(KERN_ERR "i2o: Unable to map controller.\n");
+			kfree(c);
+			iounmap(bar0_virt);
+			return -EINVAL;
+		}
+	} else {
+		bar1_virt = bar0_virt;
+		bar1_phys = bar0_phys;
+		bar1_size = bar0_size;
+	}
+
+	c->irq_mask = bar0_virt+0x34;
+	c->post_port = bar0_virt+0x40;
+	c->reply_port = bar0_virt+0x44;
+
+	c->base_phys = bar0_phys;
+	c->base_virt = bar0_virt;
+	c->msg_phys = bar1_phys;
+	c->msg_virt = bar1_virt;
 	
 	/* 
 	 * Enable Write Combining MTRR for IOP's memory region
 	 */
 #ifdef CONFIG_MTRR
-	c->mtrr_reg0 =
-		mtrr_add(c->mem_phys, size, MTRR_TYPE_WRCOMB, 1);
+	c->mtrr_reg0 = mtrr_add(c->base_phys, bar0_size, MTRR_TYPE_WRCOMB, 1);
 	/*
 	 * If it is an INTEL i960 I/O processor then set the first 64K to
 	 * Uncacheable since the region contains the Messaging unit which
@@ -3730,14 +3774,16 @@ int __init i2o_pci_install(struct pci_dev *dev)
 	if(dev->vendor == PCI_VENDOR_ID_INTEL || dev->vendor == PCI_VENDOR_ID_DPT)
 	{
 		printk(KERN_INFO "I2O: MTRR workaround for Intel i960 processor\n"); 
-		c->mtrr_reg1 =	mtrr_add(c->mem_phys, 65536, MTRR_TYPE_UNCACHABLE, 1);
+		c->mtrr_reg1 =	mtrr_add(c->base_phys, 65536, MTRR_TYPE_UNCACHABLE, 1);
 		if(c->mtrr_reg1< 0)
 		{
 			printk(KERN_INFO "i2o_pci: Error in setting MTRR_TYPE_UNCACHABLE\n");
-			mtrr_del(c->mtrr_reg0, c->mem_phys, size);
+			mtrr_del(c->mtrr_reg0, c->msg_phys, bar1_size);
 			c->mtrr_reg0 = -1;
 		}
 	}
+	if(c->raptor)
+		c->mtrr_reg1 = mtrr_add(c->msg_phys, bar1_size, MTRR_TYPE_WRCOMB, 1);
 
 #endif
 
@@ -3749,7 +3795,9 @@ int __init i2o_pci_install(struct pci_dev *dev)
 	{
 		printk(KERN_ERR "i2o: Unable to install controller.\n");
 		kfree(c);
-		iounmap((void *)mem);
+		iounmap(bar0_virt);
+		if(c->raptor)
+			iounmap(bar1_virt);
 		return i;
 	}
 
@@ -3764,7 +3812,9 @@ int __init i2o_pci_install(struct pci_dev *dev)
 				c->name, dev->irq);
 			c->irq = -1;
 			i2o_delete_controller(c);
-			iounmap((void *)mem);
+			iounmap(bar0_virt);
+			if(c->raptor)
+				iounmap(bar1_virt);
 			return -EBUSY;
 		}
 	}
@@ -3797,10 +3847,12 @@ int __init i2o_pci_scan(void)
 
 	while ((dev = pci_find_device(PCI_ANY_ID, PCI_ANY_ID, dev)) != NULL)
 	{
-		if((dev->class>>8)!=PCI_CLASS_INTELLIGENT_I2O)
+		if((dev->class>>8)!=PCI_CLASS_INTELLIGENT_I2O &&
+		   (dev->vendor!=PCI_VENDOR_ID_DPT || dev->device!=0xA511))
 			continue;
 
-		if((dev->class&0xFF)>1)
+		if((dev->class>>8)==PCI_CLASS_INTELLIGENT_I2O &&
+		   (dev->class&0xFF)>1)
 		{
 			printk(KERN_INFO "i2o: I2O Controller found but does not support I2O 1.5 (skipping).\n");
 			continue;
diff --git a/drivers/message/i2o/i2o_proc.c b/drivers/message/i2o/i2o_proc.c
index 7622e0aa3..db85e21b9 100644
--- a/drivers/message/i2o/i2o_proc.c
+++ b/drivers/message/i2o/i2o_proc.c
@@ -3337,7 +3337,7 @@ static int create_i2o_procfs(void)
 	struct i2o_controller *pctrl = NULL;
 	int i;
 
-	i2o_proc_dir_root = proc_mkdir("i2o", 0);
+	i2o_proc_dir_root = proc_mkdir("i2o", NULL);
 	if(!i2o_proc_dir_root)
 		return -1;
 	i2o_proc_dir_root->owner = THIS_MODULE;
@@ -3371,7 +3371,7 @@ static int __exit destroy_i2o_procfs(void)
 	}
 
 	if(!atomic_read(&i2o_proc_dir_root->count))
-		remove_proc_entry("i2o", 0);
+		remove_proc_entry("i2o", NULL);
 	else
 		return -1;
 
diff --git a/drivers/message/i2o/i2o_scsi.c b/drivers/message/i2o/i2o_scsi.c
index a0f99f6e8..ba121fc85 100644
--- a/drivers/message/i2o/i2o_scsi.c
+++ b/drivers/message/i2o/i2o_scsi.c
@@ -59,9 +59,11 @@
 #include <asm/atomic.h>
 #include <linux/blkdev.h>
 #include <linux/i2o.h>
-#include "../../scsi/scsi.h"
-#include "../../scsi/hosts.h"
 
+#include <scsi/scsi.h>
+#include <scsi/scsi_cmnd.h>
+#include <scsi/scsi_device.h>
+#include <scsi/scsi_host.h>
 
 
 #define VERSION_STRING        "Version 0.1.2"
@@ -186,7 +188,7 @@ static void flush_pending(void)
 
 static void i2o_scsi_reply(struct i2o_handler *h, struct i2o_controller *c, struct i2o_message *msg)
 {
-	Scsi_Cmnd *current_command;
+	struct scsi_cmnd *current_command;
 	spinlock_t *lock;
 	u32 *m = (u32 *)msg;
 	u8 as,ds,st;
@@ -230,7 +232,7 @@ static void i2o_scsi_reply(struct i2o_handler *h, struct i2o_controller *c, stru
 		{
 			spin_unlock_irqrestore(&retry_lock, flags);
 			/* Create a scsi error for this */
-			current_command = (Scsi_Cmnd *)i2o_context_list_get(m[3], c);
+			current_command = (struct scsi_cmnd *)i2o_context_list_get(m[3], c);
 			if(!current_command)
 				return;
 
@@ -277,7 +279,7 @@ static void i2o_scsi_reply(struct i2o_handler *h, struct i2o_controller *c, stru
 		return;
 	}
 
-	current_command = (Scsi_Cmnd *)i2o_context_list_get(m[3], c);
+	current_command = (struct scsi_cmnd *)i2o_context_list_get(m[3], c);
 	
 	/*
 	 *	Is this a control request coming back - eg an abort ?
@@ -330,10 +332,17 @@ static void i2o_scsi_reply(struct i2o_handler *h, struct i2o_controller *c, stru
 		 */		
 		current_command->result = DID_OK << 16 | ds;
 
-	if (current_command->use_sg)
-		pci_unmap_sg(c->pdev, (struct scatterlist *)current_command->buffer, current_command->use_sg, scsi_to_pci_dma_dir(current_command->sc_data_direction));
-	else if (current_command->request_bufflen)
-		pci_unmap_single(c->pdev, (dma_addr_t)((long)current_command->SCp.ptr), current_command->request_bufflen, scsi_to_pci_dma_dir(current_command->sc_data_direction));
+	if (current_command->use_sg) {
+		pci_unmap_sg(c->pdev,
+			(struct scatterlist *)current_command->buffer,
+			current_command->use_sg,
+			current_command->sc_data_direction);
+	} else if (current_command->request_bufflen) {
+		pci_unmap_single(c->pdev,
+			(dma_addr_t)((long)current_command->SCp.ptr),
+			current_command->request_bufflen,
+			current_command->sc_data_direction);
+	}
 
 	lock = current_command->device->host->host_lock;
 	spin_lock_irqsave(lock, flags);
@@ -461,7 +470,7 @@ static void i2o_scsi_init(struct i2o_controller *c, struct i2o_device *d, struct
  *	scsi controller and then let the enumeration fake up the rest
  */
  
-static int i2o_scsi_detect(Scsi_Host_Template * tpnt)
+static int i2o_scsi_detect(struct scsi_host_template * tpnt)
 {
 	struct Scsi_Host *shpnt = NULL;
 	int i;
@@ -592,12 +601,13 @@ static const char *i2o_scsi_info(struct Scsi_Host *SChost)
  *	Locks: takes the controller lock on error path only
  */
  
-static int i2o_scsi_queuecommand(Scsi_Cmnd * SCpnt, void (*done) (Scsi_Cmnd *))
+static int i2o_scsi_queuecommand(struct scsi_cmnd *SCpnt,
+				 void (*done) (struct scsi_cmnd *))
 {
 	int i;
 	int tid;
 	struct i2o_controller *c;
-	Scsi_Cmnd *current_command;
+	struct scsi_cmnd *current_command;
 	struct Scsi_Host *host;
 	struct i2o_scsi_host *hostdata;
 	u32 *msg, *mptr;
@@ -659,7 +669,7 @@ static int i2o_scsi_queuecommand(Scsi_Cmnd * SCpnt, void (*done) (Scsi_Cmnd *))
 	if(m==0xFFFFFFFF)
 		return 1;
 
-	msg = (u32 *)(c->mem_offset + m);
+	msg = (u32 *)(c->msg_virt + m);
 	
 	/*
 	 *	Put together a scsi execscb message
@@ -668,19 +678,14 @@ static int i2o_scsi_queuecommand(Scsi_Cmnd * SCpnt, void (*done) (Scsi_Cmnd *))
 	len = SCpnt->request_bufflen;
 	direction = 0x00000000;			// SGL IN  (osm<--iop)
 	
-	if(SCpnt->sc_data_direction == SCSI_DATA_NONE)
+	if (SCpnt->sc_data_direction == DMA_NONE) {
 		scsidir = 0x00000000;			// DATA NO XFER
-	else if(SCpnt->sc_data_direction == SCSI_DATA_WRITE)
-	{
-		direction=0x04000000;	// SGL OUT  (osm-->iop)
-		scsidir  =0x80000000;	// DATA OUT (iop-->dev)
-	}
-	else if(SCpnt->sc_data_direction == SCSI_DATA_READ)
-	{
-		scsidir  =0x40000000;	// DATA IN  (iop<--dev)
-	}
-	else
-	{
+	} else if (SCpnt->sc_data_direction == DMA_TO_DEVICE) {
+		direction = 0x04000000;	// SGL OUT  (osm-->iop)
+		scsidir = 0x80000000;	// DATA OUT (iop-->dev)
+	} else if(SCpnt->sc_data_direction == DMA_FROM_DEVICE) {
+		scsidir = 0x40000000;	// DATA IN  (iop<--dev)
+	} else {
 		/* Unknown - kill the command */
 		SCpnt->result = DID_NO_CONNECT << 16;
 		
@@ -768,7 +773,7 @@ static int i2o_scsi_queuecommand(Scsi_Cmnd * SCpnt, void (*done) (Scsi_Cmnd *))
 		len = 0;
 
 		sg_count = pci_map_sg(c->pdev, sg, SCpnt->use_sg,
-				      scsi_to_pci_dma_dir(SCpnt->sc_data_direction));
+				SCpnt->sc_data_direction);
 
 		/* FIXME: handle fail */
 		if(!sg_count)
@@ -840,7 +845,7 @@ static int i2o_scsi_queuecommand(Scsi_Cmnd * SCpnt, void (*done) (Scsi_Cmnd *))
 			dma_addr = pci_map_single(c->pdev,
 					       SCpnt->request_buffer,
 					       SCpnt->request_bufflen,
-					       scsi_to_pci_dma_dir(SCpnt->sc_data_direction));
+					       SCpnt->sc_data_direction);
 			if(dma_addr == 0)
 				BUG();	/* How to handle ?? */
 			SCpnt->SCp.ptr = (char *)(unsigned long) dma_addr;
@@ -883,7 +888,7 @@ static int i2o_scsi_queuecommand(Scsi_Cmnd * SCpnt, void (*done) (Scsi_Cmnd *))
  *	Locks: no locks are held or needed
  */
  
-int i2o_scsi_abort(Scsi_Cmnd * SCpnt)
+static int i2o_scsi_abort(struct scsi_cmnd * SCpnt)
 {
 	struct i2o_controller *c;
 	struct Scsi_Host *host;
@@ -929,14 +934,14 @@ int i2o_scsi_abort(Scsi_Cmnd * SCpnt)
  *	Locks: called with no lock held, requires no locks.
  */
  
-static int i2o_scsi_bus_reset(Scsi_Cmnd * SCpnt)
+static int i2o_scsi_bus_reset(struct scsi_cmnd * SCpnt)
 {
 	int tid;
 	struct i2o_controller *c;
 	struct Scsi_Host *host;
 	struct i2o_scsi_host *hostdata;
 	u32 m;
-	unsigned long msg;
+	void *msg;
 	unsigned long timeout;
 
 	
@@ -974,7 +979,7 @@ static int i2o_scsi_bus_reset(Scsi_Cmnd * SCpnt)
 	while(time_before(jiffies, timeout));
 	
 	
-	msg = c->mem_offset + m;
+	msg = c->msg_virt + m;
 	i2o_raw_writel(FOUR_WORD_MSG_SIZE|SGL_OFFSET_0, msg);
 	i2o_raw_writel(I2O_CMD_SCSI_BUSRESET<<24|HOST_TID<<12|tid, msg+4);
 	i2o_raw_writel(scsi_context|0x80000000, msg+8);
@@ -991,32 +996,6 @@ static int i2o_scsi_bus_reset(Scsi_Cmnd * SCpnt)
 	return SUCCESS;
 }
 
-/**
- *	i2o_scsi_host_reset	-	host reset callback
- *	@SCpnt: command causing the reset
- *
- *	An I2O controller can be many things at once. While we can
- *	reset a controller the potential mess from doing so is vast, and
- *	it's better to simply hold on and pray
- */
- 
-static int i2o_scsi_host_reset(Scsi_Cmnd * SCpnt)
-{
-	return FAILED;
-}
-
-/**
- *	i2o_scsi_device_reset	-	device reset callback
- *	@SCpnt: command causing the reset
- *
- *	I2O does not (AFAIK) support doing a device reset
- */
- 
-static int i2o_scsi_device_reset(Scsi_Cmnd * SCpnt)
-{
-	return FAILED;
-}
-
 /**
  *	i2o_scsi_bios_param	-	Invent disk geometry
  *	@sdev: scsi device 
@@ -1048,7 +1027,7 @@ MODULE_AUTHOR("Red Hat Software");
 MODULE_LICENSE("GPL");
 
 
-static Scsi_Host_Template driver_template = {
+static struct scsi_host_template driver_template = {
 	.proc_name		= "i2o_scsi",
 	.name			= "I2O SCSI Layer",
 	.detect			= i2o_scsi_detect,
@@ -1057,8 +1036,6 @@ static Scsi_Host_Template driver_template = {
 	.queuecommand		= i2o_scsi_queuecommand,
 	.eh_abort_handler	= i2o_scsi_abort,
 	.eh_bus_reset_handler	= i2o_scsi_bus_reset,
-	.eh_device_reset_handler= i2o_scsi_device_reset,
-	.eh_host_reset_handler	= i2o_scsi_host_reset,
 	.bios_param		= i2o_scsi_bios_param,
 	.can_queue		= I2O_SCSI_CAN_QUEUE,
 	.this_id		= 15,
diff --git a/drivers/misc/ibmasm/ibmasmfs.c b/drivers/misc/ibmasm/ibmasmfs.c
index a01fe0859..e604925df 100644
--- a/drivers/misc/ibmasm/ibmasmfs.c
+++ b/drivers/misc/ibmasm/ibmasmfs.c
@@ -224,12 +224,12 @@ static struct dentry *ibmasmfs_create_dir (struct super_block *sb,
 	return dentry;
 }
 
-int ibmasmfs_register()
+int ibmasmfs_register(void)
 {
 	return register_filesystem(&ibmasmfs_type);
 }
 
-void ibmasmfs_unregister()
+void ibmasmfs_unregister(void)
 {
 	unregister_filesystem(&ibmasmfs_type);
 }
@@ -287,7 +287,7 @@ static int command_file_close(struct inode *inode, struct file *file)
 	return 0;
 }
 
-static ssize_t command_file_read(struct file *file, char *buf, size_t count, loff_t *offset)
+static ssize_t command_file_read(struct file *file, char __user *buf, size_t count, loff_t *offset)
 {
 	struct ibmasmfs_command_data *command_data = file->private_data;
 	struct command *cmd;
@@ -324,7 +324,7 @@ static ssize_t command_file_read(struct file *file, char *buf, size_t count, lof
 	return len;
 }
 
-static ssize_t command_file_write(struct file *file, const char *ubuff, size_t count, loff_t *offset)
+static ssize_t command_file_write(struct file *file, const char __user *ubuff, size_t count, loff_t *offset)
 {
 	struct ibmasmfs_command_data *command_data = file->private_data;
 	struct command *cmd;
@@ -345,7 +345,7 @@ static ssize_t command_file_write(struct file *file, const char *ubuff, size_t c
 	if (!cmd)
 		return -ENOMEM;
 
-	if (copy_from_user((void *)cmd->buffer, (void *)ubuff, count)) {
+	if (copy_from_user(cmd->buffer, ubuff, count)) {
 		command_put(cmd);
 		return -EFAULT;
 	}
@@ -395,7 +395,7 @@ static int event_file_close(struct inode *inode, struct file *file)
 	return 0;
 }
 
-static ssize_t event_file_read(struct file *file, char *buf, size_t count, loff_t *offset)
+static ssize_t event_file_read(struct file *file, char __user *buf, size_t count, loff_t *offset)
 {
 	struct ibmasmfs_event_data *event_data = file->private_data;
 	struct event_reader *reader = &event_data->reader;
@@ -421,7 +421,7 @@ static ssize_t event_file_read(struct file *file, char *buf, size_t count, loff_
 	return reader->data_size;
 }
 
-static ssize_t event_file_write(struct file *file, const char *buf, size_t count, loff_t *offset)
+static ssize_t event_file_write(struct file *file, const char __user *buf, size_t count, loff_t *offset)
 {
 	struct ibmasmfs_event_data *event_data = file->private_data;
 
@@ -462,7 +462,7 @@ static int r_heartbeat_file_close(struct inode *inode, struct file *file)
 	return 0;
 }
 
-static ssize_t r_heartbeat_file_read(struct file *file, char *buf, size_t count, loff_t *offset)
+static ssize_t r_heartbeat_file_read(struct file *file, char __user *buf, size_t count, loff_t *offset)
 {
 	struct ibmasmfs_heartbeat_data *rhbeat = file->private_data;
 	unsigned long flags;
@@ -490,7 +490,7 @@ static ssize_t r_heartbeat_file_read(struct file *file, char *buf, size_t count,
 	return result;
 }
 
-static ssize_t r_heartbeat_file_write(struct file *file, const char *buf, size_t count, loff_t *offset)
+static ssize_t r_heartbeat_file_write(struct file *file, const char __user *buf, size_t count, loff_t *offset)
 {
 	struct ibmasmfs_heartbeat_data *rhbeat = file->private_data;
 
@@ -518,7 +518,7 @@ static int remote_settings_file_close(struct inode *inode, struct file *file)
 	return 0;
 }
 
-static ssize_t remote_settings_file_read(struct file *file, char *buf, size_t count, loff_t *offset)
+static ssize_t remote_settings_file_read(struct file *file, char __user *buf, size_t count, loff_t *offset)
 {
 	unsigned long address = (unsigned long)file->private_data;
 	unsigned char *page;
@@ -552,7 +552,7 @@ exit:
 	return retval;
 }
 
-static ssize_t remote_settings_file_write(struct file *file, const char *ubuff, size_t count, loff_t *offset)
+static ssize_t remote_settings_file_write(struct file *file, const char __user *ubuff, size_t count, loff_t *offset)
 {
 	unsigned long address = (unsigned long)file->private_data;
 	char *buff;
@@ -571,7 +571,7 @@ static ssize_t remote_settings_file_write(struct file *file, const char *ubuff,
 
 	memset(buff, 0x0, count + 1);
 
-	if (copy_from_user((void *)buff, (void *)ubuff, count)) {
+	if (copy_from_user(buff, ubuff, count)) {
 		kfree(buff);
 		return -EFAULT;
 	}
@@ -618,7 +618,7 @@ static int remote_event_file_close(struct inode *inode, struct file *file)
 	return 0;
 }
 
-static ssize_t remote_event_file_read(struct file *file, char *buf, size_t count, loff_t *offset)
+static ssize_t remote_event_file_read(struct file *file, char __user *buf, size_t count, loff_t *offset)
 {
 	struct service_processor *sp = file->private_data;
 	struct remote_queue *q = &sp->remote_queue;
@@ -663,7 +663,7 @@ static struct file_operations event_fops = {
 	.open =		event_file_open,
 	.release =	event_file_close,
 	.read =		event_file_read,
-	.write 		event_file_write,
+	.write =	event_file_write,
 };
 
 static struct file_operations r_heartbeat_fops = {
diff --git a/drivers/mtd/Kconfig b/drivers/mtd/Kconfig
index 5fb011c37..f0aaaa225 100644
--- a/drivers/mtd/Kconfig
+++ b/drivers/mtd/Kconfig
@@ -1,4 +1,4 @@
-# $Id: Kconfig,v 1.3 2003/05/28 11:02:23 dwmw2 Exp $
+# $Id: Kconfig,v 1.6 2004/08/09 13:19:42 dwmw2 Exp $
 
 menu "Memory Technology Devices (MTD)"
 
@@ -28,7 +28,7 @@ config MTD_DEBUG_VERBOSE
 	  Determines the verbosity level of the MTD debugging messages.
 
 config MTD_PARTITIONS
-	tristate "MTD partitioning support"
+	bool "MTD partitioning support"
 	depends on MTD
 	help
 	  If you have a device which needs to divide its flash chip(s) up
@@ -68,9 +68,23 @@ config MTD_REDBOOT_PARTS
 	  SA1100 map driver (CONFIG_MTD_SA1100) has an option for this, for 
 	  example.
 
+config MTD_REDBOOT_PARTS_UNALLOCATED
+	bool "  Include unallocated flash regions"
+	depends on MTD_REDBOOT_PARTS
+	help
+	  If you need to register each unallocated flash region as a MTD
+	  'partition', enable this option.
+
+config MTD_REDBOOT_PARTS_READONLY
+	bool "  Force read-only for RedBoot system images"
+	depends on MTD_REDBOOT_PARTS
+	help
+	  If you need to force read-only for 'RedBoot', 'RedBoot Config' and
+	  'FIS directory' images, enable this option.
+
 config MTD_CMDLINE_PARTS
-	tristate "Command line partition table parsing"
-	depends on MTD_PARTITIONS
+	bool "Command line partition table parsing"
+	depends on MTD_PARTITIONS = "y"
 	---help---
 	  Allow generic configuration of the MTD paritition tables via the kernel
 	  command line. Multiple flash resources are supported for hardware where
diff --git a/drivers/mtd/Makefile b/drivers/mtd/Makefile
index 2915a535d..e4ad58832 100644
--- a/drivers/mtd/Makefile
+++ b/drivers/mtd/Makefile
@@ -1,28 +1,14 @@
 #
 # Makefile for the memory technology device drivers.
 #
-# $Id: Makefile.common,v 1.2 2003/05/23 11:38:29 dwmw2 Exp $
-
-#                       *** BIG UGLY NOTE ***
-#
-# The shiny new inter_module_xxx has introduced yet another ugly link
-# order dependency, which I'd previously taken great care to avoid.
-# We now have to ensure that the chip drivers are initialised before the
-# map drivers, and that the doc200[01] drivers are initialised before
-# docprobe.
-#
-# We'll hopefully merge the doc200[01] drivers and docprobe back into
-# a single driver some time soon, but the CFI drivers are going to have
-# to stay like that.
-#
-# Urgh.
-# 
-# dwmw2 21/11/0
+# $Id: Makefile.common,v 1.5 2004/08/10 20:51:49 dwmw2 Exp $
 
 # Core functionality.
-obj-$(CONFIG_MTD)		+= mtdcore.o
+mtd-y				:= mtdcore.o
+mtd-$(CONFIG_MTD_PARTITIONS)	+= mtdpart.o
+obj-$(CONFIG_MTD)		+= $(mtd-y)
+
 obj-$(CONFIG_MTD_CONCAT)	+= mtdconcat.o
-obj-$(CONFIG_MTD_PARTITIONS)	+= mtdpart.o
 obj-$(CONFIG_MTD_REDBOOT_PARTS) += redboot.o
 obj-$(CONFIG_MTD_CMDLINE_PARTS) += cmdlinepart.o
 obj-$(CONFIG_MTD_AFS_PARTS)	+= afs.o
diff --git a/drivers/mtd/afs.c b/drivers/mtd/afs.c
index 4ea08f5e9..801e6c7d0 100644
--- a/drivers/mtd/afs.c
+++ b/drivers/mtd/afs.c
@@ -21,7 +21,7 @@
    This is access code for flashes using ARM's flash partitioning 
    standards.
 
-   $Id: afs.c,v 1.12 2003/06/13 15:31:06 rmk Exp $
+   $Id: afs.c,v 1.13 2004/02/27 22:09:59 rmk Exp $
 
 ======================================================================*/
 
diff --git a/drivers/mtd/chips/Kconfig b/drivers/mtd/chips/Kconfig
index e1c40ec77..2d2b7d467 100644
--- a/drivers/mtd/chips/Kconfig
+++ b/drivers/mtd/chips/Kconfig
@@ -1,5 +1,5 @@
 # drivers/mtd/chips/Kconfig
-# $Id: Kconfig,v 1.3 2003/05/28 15:13:24 dwmw2 Exp $
+# $Id: Kconfig,v 1.9 2004/07/16 15:32:14 dwmw2 Exp $
 
 menu "RAM/ROM/Flash chip drivers"
 	depends on MTD!=n
@@ -85,59 +85,72 @@ config MTD_CFI_GEOMETRY
 	  arrangements of CFI chips. If unsure, say 'N' and all options 
 	  which are supported by the current code will be enabled.
 
-config MTD_CFI_B1
-	bool "Support  8-bit buswidth"
-	depends on MTD_CFI_GEOMETRY
+config MTD_MAP_BANK_WIDTH_1
+	bool "Support  8-bit buswidth" if MTD_CFI_GEOMETRY
+	default y
 	help
 	  If you wish to support CFI devices on a physical bus which is
 	  8 bits wide, say 'Y'.
 
-config MTD_CFI_B2
-	bool "Support 16-bit buswidth"
-	depends on MTD_CFI_GEOMETRY
+config MTD_MAP_BANK_WIDTH_2
+	bool "Support 16-bit buswidth" if MTD_CFI_GEOMETRY
+	default y
 	help
 	  If you wish to support CFI devices on a physical bus which is
 	  16 bits wide, say 'Y'.
 
-config MTD_CFI_B4
-	bool "Support 32-bit buswidth"
-	depends on MTD_CFI_GEOMETRY
+config MTD_MAP_BANK_WIDTH_4
+	bool "Support 32-bit buswidth" if MTD_CFI_GEOMETRY
+	default y
 	help
 	  If you wish to support CFI devices on a physical bus which is
 	  32 bits wide, say 'Y'.
 
-config MTD_CFI_B8
-	bool "Support 64-bit buswidth"
-	depends on MTD_CFI_GEOMETRY
+config MTD_MAP_BANK_WIDTH_8
+	bool "Support 64-bit buswidth" if MTD_CFI_GEOMETRY
+	default n
 	help
 	  If you wish to support CFI devices on a physical bus which is
 	  64 bits wide, say 'Y'.
 
+config MTD_MAP_BANK_WIDTH_16
+	bool "Support 128-bit buswidth" if MTD_CFI_GEOMETRY
+	default n
+	help
+	  If you wish to support CFI devices on a physical bus which is
+	  128 bits wide, say 'Y'.
+
+config MTD_MAP_BANK_WIDTH_32
+	bool "Support 256-bit buswidth" if MTD_CFI_GEOMETRY
+	default n
+	help
+	  If you wish to support CFI devices on a physical bus which is
+	  256 bits wide, say 'Y'.
+
 config MTD_CFI_I1
-	bool "Support 1-chip flash interleave" if !MTD_CFI_B1
-	depends on MTD_CFI_GEOMETRY
-	default y if MTD_CFI_B1
+	bool "Support 1-chip flash interleave" if MTD_CFI_GEOMETRY
+	default y
 	help
 	  If your flash chips are not interleaved - i.e. you only have one
 	  flash chip addressed by each bus cycle, then say 'Y'.
 
 config MTD_CFI_I2
-	bool "Support 2-chip flash interleave"
-	depends on MTD_CFI_GEOMETRY
+	bool "Support 2-chip flash interleave" if MTD_CFI_GEOMETRY
+	default y
 	help
 	  If your flash chips are interleaved in pairs - i.e. you have two
 	  flash chips addressed by each bus cycle, then say 'Y'.
 
 config MTD_CFI_I4
-	bool "Support 4-chip flash interleave"
-	depends on MTD_CFI_GEOMETRY
+	bool "Support 4-chip flash interleave" if MTD_CFI_GEOMETRY
+	default n
 	help
 	  If your flash chips are interleaved in fours - i.e. you have four
 	  flash chips addressed by each bus cycle, then say 'Y'.
 
 config MTD_CFI_I8
-	bool "Support 8-chip flash interleave"
-	depends on MTD_CFI_GEOMETRY
+	bool "Support 8-chip flash interleave" if MTD_CFI_GEOMETRY
+	default n
 	help
 	  If your flash chips are interleaved in eights - i.e. you have eight
 	  flash chips addressed by each bus cycle, then say 'Y'.
@@ -160,6 +173,27 @@ config MTD_CFI_AMDSTD
 	  provides support for one of those command sets, used on chips 
 	  including the AMD Am29LV320.
 
+config MTD_CFI_AMDSTD_RETRY
+	int "Retry failed commands (erase/program)"
+	depends on MTD_CFI_AMDSTD
+	default "0"
+	help
+	  Some chips, when attached to a shared bus, don't properly filter
+	  bus traffic that is destined to other devices.  This broken
+	  behavior causes erase and program sequences to be aborted when
+	  the sequences are mixed with traffic for other devices.
+
+	  SST49LF040 (and related) chips are know to be broken.
+
+config MTD_CFI_AMDSTD_RETRY_MAX
+	int "Max retries of failed commands (erase/program)"
+	depends on MTD_CFI_AMDSTD_RETRY
+	default "0"
+	help
+	  If you have an SST49LF040 (or related chip) then this value should
+	  be set to at least 1.  This can also be adjusted at driver load
+	  time with the retry_cmd_max module parameter.
+
 config MTD_CFI_STAA
 	tristate "Support for ST (Advanced Architecture) flash chips"
 	depends on MTD_GEN_PROBE
@@ -168,6 +202,11 @@ config MTD_CFI_STAA
 	  sets which a CFI-compliant chip may claim to implement. This code
 	  provides support for one of those command sets.
 
+config MTD_CFI_UTIL
+	tristate
+	default y if MTD_CFI_INTELEXT=y || MTD_CFI_AMDSTD=y || MTD_CFI_STAA=y
+	default m if MTD_CFI_INTELEXT=m || MTD_CFI_AMDSTD=m || MTD_CFI_STAA=m
+
 config MTD_RAM
 	tristate "Support for RAM chips in bus mapping"
 	depends on MTD
@@ -194,6 +233,7 @@ config MTD_ABSENT
 	  with this driver will return -ENODEV upon access.
 
 config MTD_OBSOLETE_CHIPS
+	depends on MTD && BROKEN
 	bool "Older (theoretically obsoleted now) drivers for non-CFI chips"
 	help
 	  This option does not enable any code directly, but will allow you to
diff --git a/drivers/mtd/chips/Makefile b/drivers/mtd/chips/Makefile
index 7293717af..683048982 100644
--- a/drivers/mtd/chips/Makefile
+++ b/drivers/mtd/chips/Makefile
@@ -1,18 +1,19 @@
 #
 # linux/drivers/chips/Makefile
 #
-# $Id: Makefile.common,v 1.1 2003/05/21 15:00:01 dwmw2 Exp $
+# $Id: Makefile.common,v 1.4 2004/07/12 16:07:30 dwmw2 Exp $
 
 #                       *** BIG UGLY NOTE ***
 #
 # The removal of get_module_symbol() and replacement with
 # inter_module_register() et al has introduced a link order dependency
 # here where previously there was none.  We now have to ensure that
-# the CFI command set drivers are linked before cfi_probe.o
+# the CFI command set drivers are linked before gen_probe.o
 
 obj-$(CONFIG_MTD)		+= chipreg.o
 obj-$(CONFIG_MTD_AMDSTD)	+= amd_flash.o 
 obj-$(CONFIG_MTD_CFI)		+= cfi_probe.o
+obj-$(CONFIG_MTD_CFI_UTIL)	+= cfi_util.o
 obj-$(CONFIG_MTD_CFI_STAA)	+= cfi_cmdset_0020.o
 obj-$(CONFIG_MTD_CFI_AMDSTD)	+= cfi_cmdset_0002.o
 obj-$(CONFIG_MTD_CFI_INTELEXT)	+= cfi_cmdset_0001.o
diff --git a/drivers/mtd/chips/amd_flash.c b/drivers/mtd/chips/amd_flash.c
index 6606b9373..1c1640ebe 100644
--- a/drivers/mtd/chips/amd_flash.c
+++ b/drivers/mtd/chips/amd_flash.c
@@ -3,7 +3,7 @@
  *
  * Author: Jonas Holmberg <jonas.holmberg@axis.com>
  *
- * $Id: amd_flash.c,v 1.23 2003/06/12 09:24:13 dwmw2 Exp $
+ * $Id: amd_flash.c,v 1.25 2004/08/09 13:19:43 dwmw2 Exp $
  *
  * Copyright (c) 2001 Axis Communications AB
  *
@@ -718,7 +718,7 @@ static struct mtd_info *amd_flash_probe(struct map_info *map)
 		       "memory for MTD erase region info\n", map->name);
 		kfree(mtd);
 		map->fldrv_priv = NULL;
-		return 0;
+		return NULL;
 	}
 
 	reg_idx = 0;
@@ -1307,9 +1307,7 @@ static int amd_flash_erase(struct mtd_info *mtd, struct erase_info *instr)
 	}
 		
 	instr->state = MTD_ERASE_DONE;
-	if (instr->callback) {
-		instr->callback(instr);
-	}
+	mtd_erase_callback(instr);
 	
 	return 0;
 }
diff --git a/drivers/mtd/chips/cfi_cmdset_0001.c b/drivers/mtd/chips/cfi_cmdset_0001.c
index 18cc31d39..e71624edb 100644
--- a/drivers/mtd/chips/cfi_cmdset_0001.c
+++ b/drivers/mtd/chips/cfi_cmdset_0001.c
@@ -4,7 +4,7 @@
  *
  * (C) 2000 Red Hat. GPL'd
  *
- * $Id: cfi_cmdset_0001.c,v 1.126 2003/06/23 07:45:48 dwmw2 Exp $
+ * $Id: cfi_cmdset_0001.c,v 1.154 2004/08/09 13:19:43 dwmw2 Exp $
  *
  * 
  * 10/10/2000	Nicolas Pitre <nico@cam.org>
@@ -34,12 +34,14 @@
 #include <linux/mtd/compatmac.h>
 #include <linux/mtd/cfi.h>
 
+/* #define CMDSET0001_DISABLE_ERASE_SUSPEND_ON_WRITE */
+
 // debugging, turns off buffer write mode if set to 1
 #define FORCE_WORD_WRITE 0
 
 static int cfi_intelext_read (struct mtd_info *, loff_t, size_t, size_t *, u_char *);
-static int cfi_intelext_read_user_prot_reg (struct mtd_info *, loff_t, size_t, size_t *, u_char *);
-static int cfi_intelext_read_fact_prot_reg (struct mtd_info *, loff_t, size_t, size_t *, u_char *);
+//static int cfi_intelext_read_user_prot_reg (struct mtd_info *, loff_t, size_t, size_t *, u_char *);
+//static int cfi_intelext_read_fact_prot_reg (struct mtd_info *, loff_t, size_t, size_t *, u_char *);
 static int cfi_intelext_write_words(struct mtd_info *, loff_t, size_t, size_t *, const u_char *);
 static int cfi_intelext_write_buffers(struct mtd_info *, loff_t, size_t, size_t *, const u_char *);
 static int cfi_intelext_erase_varsize(struct mtd_info *, struct erase_info *);
@@ -54,6 +56,7 @@ static void cfi_intelext_destroy(struct mtd_info *);
 struct mtd_info *cfi_cmdset_0001(struct map_info *, int);
 
 static struct mtd_info *cfi_intelext_setup (struct map_info *);
+static int cfi_intelext_partition_fixup(struct map_info *, struct cfi_private **);
 
 static int cfi_intelext_point (struct mtd_info *mtd, loff_t from, size_t len,
 		     size_t *retlen, u_char **mtdbuf);
@@ -79,17 +82,18 @@ static struct mtd_chip_driver cfi_intelext_chipdrv = {
 static void cfi_tell_features(struct cfi_pri_intelext *extp)
 {
 	int i;
-	printk("  Feature/Command Support: %4.4X\n", extp->FeatureSupport);
-	printk("     - Chip Erase:         %s\n", extp->FeatureSupport&1?"supported":"unsupported");
-	printk("     - Suspend Erase:      %s\n", extp->FeatureSupport&2?"supported":"unsupported");
-	printk("     - Suspend Program:    %s\n", extp->FeatureSupport&4?"supported":"unsupported");
-	printk("     - Legacy Lock/Unlock: %s\n", extp->FeatureSupport&8?"supported":"unsupported");
-	printk("     - Queued Erase:       %s\n", extp->FeatureSupport&16?"supported":"unsupported");
-	printk("     - Instant block lock: %s\n", extp->FeatureSupport&32?"supported":"unsupported");
-	printk("     - Protection Bits:    %s\n", extp->FeatureSupport&64?"supported":"unsupported");
-	printk("     - Page-mode read:     %s\n", extp->FeatureSupport&128?"supported":"unsupported");
-	printk("     - Synchronous read:   %s\n", extp->FeatureSupport&256?"supported":"unsupported");
-	for (i=9; i<32; i++) {
+	printk("  Feature/Command Support:      %4.4X\n", extp->FeatureSupport);
+	printk("     - Chip Erase:              %s\n", extp->FeatureSupport&1?"supported":"unsupported");
+	printk("     - Suspend Erase:           %s\n", extp->FeatureSupport&2?"supported":"unsupported");
+	printk("     - Suspend Program:         %s\n", extp->FeatureSupport&4?"supported":"unsupported");
+	printk("     - Legacy Lock/Unlock:      %s\n", extp->FeatureSupport&8?"supported":"unsupported");
+	printk("     - Queued Erase:            %s\n", extp->FeatureSupport&16?"supported":"unsupported");
+	printk("     - Instant block lock:      %s\n", extp->FeatureSupport&32?"supported":"unsupported");
+	printk("     - Protection Bits:         %s\n", extp->FeatureSupport&64?"supported":"unsupported");
+	printk("     - Page-mode read:          %s\n", extp->FeatureSupport&128?"supported":"unsupported");
+	printk("     - Synchronous read:        %s\n", extp->FeatureSupport&256?"supported":"unsupported");
+	printk("     - Simultaneous operations: %s\n", extp->FeatureSupport&512?"supported":"unsupported");
+	for (i=10; i<32; i++) {
 		if (extp->FeatureSupport & (1<<i)) 
 			printk("     - Unknown Bit %X:      supported\n", i);
 	}
@@ -110,12 +114,62 @@ static void cfi_tell_features(struct cfi_pri_intelext *extp)
 	}
 	
 	printk("  Vcc Logic Supply Optimum Program/Erase Voltage: %d.%d V\n", 
-	       extp->VccOptimal >> 8, extp->VccOptimal & 0xf);
+	       extp->VccOptimal >> 4, extp->VccOptimal & 0xf);
 	if (extp->VppOptimal)
 		printk("  Vpp Programming Supply Optimum Program/Erase Voltage: %d.%d V\n", 
-		       extp->VppOptimal >> 8, extp->VppOptimal & 0xf);
+		       extp->VppOptimal >> 4, extp->VppOptimal & 0xf);
+}
+#endif
+
+#ifdef CMDSET0001_DISABLE_ERASE_SUSPEND_ON_WRITE
+/* Some Intel Strata Flash prior to FPO revision C has bugs in this area */ 
+static void fixup_intel_strataflash(struct map_info *map, void* param)
+{
+	struct cfi_private *cfi = map->fldrv_priv;
+	struct cfi_pri_amdstd *extp = cfi->cmdset_priv;
+
+	printk(KERN_WARNING "cfi_cmdset_0001: Suspend "
+	                    "erase on write disabled.\n");
+	extp->SuspendCmdSupport &= ~1;
+}
+#endif
+
+static void fixup_st_m28w320ct(struct map_info *map, void* param)
+{
+	struct cfi_private *cfi = map->fldrv_priv;
+	
+	cfi->cfiq->BufWriteTimeoutTyp = 0;	/* Not supported */
+	cfi->cfiq->BufWriteTimeoutMax = 0;	/* Not supported */
 }
+
+static void fixup_st_m28w320cb(struct map_info *map, void* param)
+{
+	struct cfi_private *cfi = map->fldrv_priv;
+	
+	/* Note this is done after the region info is endian swapped */
+	cfi->cfiq->EraseRegionInfo[1] =
+		(cfi->cfiq->EraseRegionInfo[1] & 0xffff0000) | 0x3e;
+};
+
+static struct cfi_fixup fixup_table[] = {
+#ifdef CMDSET0001_DISABLE_ERASE_SUSPEND_ON_WRITE
+	{
+		CFI_MFR_ANY, CFI_ID_ANY,
+		fixup_intel_strataflash, NULL
+	}, 
 #endif
+	{
+		0x0020,	/* STMicroelectronics */
+		0x00ba,	/* M28W320CT */
+		fixup_st_m28w320ct, NULL
+	}, {
+		0x0020,	/* STMicroelectronics */
+		0x00bb,	/* M28W320CB */
+		fixup_st_m28w320cb, NULL
+	}, {
+		0, 0, NULL, NULL
+	}
+};
 
 /* This routine is made available to other mtd code via
  * inter_module_register.  It must only be accessed through
@@ -128,7 +182,6 @@ struct mtd_info *cfi_cmdset_0001(struct map_info *map, int primary)
 {
 	struct cfi_private *cfi = map->fldrv_priv;
 	int i;
-	__u32 base = cfi->chips[0].start;
 
 	if (cfi->cfi_mode == CFI_MODE_CFI) {
 		/* 
@@ -138,40 +191,20 @@ struct mtd_info *cfi_cmdset_0001(struct map_info *map, int primary)
 		 */
 		__u16 adr = primary?cfi->cfiq->P_ADR:cfi->cfiq->A_ADR;
 		struct cfi_pri_intelext *extp;
-		int ofs_factor = cfi->interleave * cfi->device_type;
 
-		//printk(" Intel/Sharp Extended Query Table at 0x%4.4X\n", adr);
-		if (!adr)
+		extp = (struct cfi_pri_intelext*)cfi_read_pri(map, adr, sizeof(*extp), "Intel/Sharp");
+		if (!extp)
 			return NULL;
-
-		/* Switch it into Query Mode */
-		cfi_send_gen_cmd(0x98, 0x55, base, map, cfi, cfi->device_type, NULL);
-
-		extp = kmalloc(sizeof(*extp), GFP_KERNEL);
-		if (!extp) {
-			printk(KERN_ERR "Failed to allocate memory\n");
-			return NULL;
-		}
-		
-		/* Read in the Extended Query Table */
-		for (i=0; i<sizeof(*extp); i++) {
-			((unsigned char *)extp)[i] = 
-				cfi_read_query(map, (base+((adr+i)*ofs_factor)));
-		}
-		
-		if (extp->MajorVersion != '1' || 
-		    (extp->MinorVersion < '0' || extp->MinorVersion > '3')) {
-			printk(KERN_WARNING "  Unknown IntelExt Extended Query "
-			       "version %c.%c.\n",  extp->MajorVersion,
-			       extp->MinorVersion);
-			kfree(extp);
-			return NULL;
-		}
 		
 		/* Do some byteswapping if necessary */
 		extp->FeatureSupport = le32_to_cpu(extp->FeatureSupport);
 		extp->BlkStatusRegMask = le16_to_cpu(extp->BlkStatusRegMask);
 		extp->ProtRegAddr = le16_to_cpu(extp->ProtRegAddr);
+
+		/* Install our own private info structure */
+		cfi->cmdset_priv = extp;	
+
+		cfi_fixup(map, fixup_table);
 			
 #ifdef DEBUG_CFI_FEATURES
 		/* Tell the user about it in lots of lovely detail */
@@ -179,18 +212,8 @@ struct mtd_info *cfi_cmdset_0001(struct map_info *map, int primary)
 #endif	
 
 		if(extp->SuspendCmdSupport & 1) {
-//#define CMDSET0001_DISABLE_ERASE_SUSPEND_ON_WRITE
-#ifdef CMDSET0001_DISABLE_ERASE_SUSPEND_ON_WRITE
-/* Some Intel Strata Flash prior to FPO revision C has bugs in this area */ 
-			printk(KERN_WARNING "cfi_cmdset_0001: Suspend "
-			       "erase on write disabled.\n");
-			extp->SuspendCmdSupport &= ~1;
-#else
 			printk(KERN_NOTICE "cfi_cmdset_0001: Erase suspend on write enabled\n");
-#endif
 		}
-		/* Install our own private info structure */
-		cfi->cmdset_priv = extp;	
 	}
 
 	for (i=0; i< cfi->numchips; i++) {
@@ -202,8 +225,6 @@ struct mtd_info *cfi_cmdset_0001(struct map_info *map, int primary)
 
 	map->fldrv = &cfi_intelext_chipdrv;
 	
-	/* Make sure it's in read mode */
-	cfi_send_gen_cmd(0xff, 0x55, base, map, cfi, cfi->device_type, NULL);
 	return cfi_intelext_setup(map);
 }
 
@@ -281,8 +302,10 @@ static struct mtd_info *cfi_intelext_setup(struct map_info *map)
 		printk(KERN_INFO "Using word write method\n" );
 		mtd->write = cfi_intelext_write_words;
 	}
+#if 0
 	mtd->read_user_prot_reg = cfi_intelext_read_user_prot_reg;
 	mtd->read_fact_prot_reg = cfi_intelext_read_fact_prot_reg;
+#endif
 	mtd->sync = cfi_intelext_sync;
 	mtd->lock = cfi_intelext_lock;
 	mtd->unlock = cfi_intelext_unlock;
@@ -291,6 +314,12 @@ static struct mtd_info *cfi_intelext_setup(struct map_info *map)
 	mtd->flags = MTD_CAP_NORFLASH;
 	map->fldrv = &cfi_intelext_chipdrv;
 	mtd->name = map->name;
+
+	/* This function has the potential to distort the reality
+	   a bit and therefore should be called last. */
+	if (cfi_intelext_partition_fixup(map, &cfi) != 0)
+		goto setup_err;
+
 	__module_get(THIS_MODULE);
 	return mtd;
 
@@ -301,10 +330,87 @@ static struct mtd_info *cfi_intelext_setup(struct map_info *map)
 		kfree(mtd);
 	}
 	kfree(cfi->cmdset_priv);
-	kfree(cfi->cfiq);
 	return NULL;
 }
 
+static int cfi_intelext_partition_fixup(struct map_info *map,
+					struct cfi_private **pcfi)
+{
+	struct cfi_private *cfi = *pcfi;
+	struct cfi_pri_intelext *extp = cfi->cmdset_priv;
+
+	/*
+	 * Probing of multi-partition flash ships.
+	 *
+	 * This is extremely crude at the moment and should probably be
+	 * extracted entirely from the Intel extended query data instead.
+	 * Right now a L18 flash is assumed if multiple operations is
+	 * detected.
+	 *
+	 * To support multiple partitions when available, we simply arrange
+	 * for each of them to have their own flchip structure even if they
+	 * are on the same physical chip.  This means completely recreating
+	 * a new cfi_private structure right here which is a blatent code
+	 * layering violation, but this is still the least intrusive
+	 * arrangement at this point. This can be rearranged in the future
+	 * if someone feels motivated enough.  --nico
+	 */
+	if (extp && extp->FeatureSupport & (1 << 9)) {
+		struct cfi_private *newcfi;
+		struct flchip *chip;
+		struct flchip_shared *shared;
+		int numparts, partshift, numvirtchips, i, j;
+
+		/*
+		 * The L18 flash memory array is divided
+		 * into multiple 8-Mbit partitions.
+		 */
+		numparts = 1 << (cfi->cfiq->DevSize - 20);
+		partshift = 20 + __ffs(cfi->interleave);
+		numvirtchips = cfi->numchips * numparts;
+
+		newcfi = kmalloc(sizeof(struct cfi_private) + numvirtchips * sizeof(struct flchip), GFP_KERNEL);
+		if (!newcfi)
+			return -ENOMEM;
+		shared = kmalloc(sizeof(struct flchip_shared) * cfi->numchips, GFP_KERNEL);
+		if (!shared) {
+			kfree(newcfi);
+			return -ENOMEM;
+		}
+		memcpy(newcfi, cfi, sizeof(struct cfi_private));
+		newcfi->numchips = numvirtchips;
+		newcfi->chipshift = partshift;
+
+		chip = &newcfi->chips[0];
+		for (i = 0; i < cfi->numchips; i++) {
+			shared[i].writing = shared[i].erasing = NULL;
+			spin_lock_init(&shared[i].lock);
+			for (j = 0; j < numparts; j++) {
+				*chip = cfi->chips[i];
+				chip->start += j << partshift;
+				chip->priv = &shared[i];
+				/* those should be reset too since
+				   they create memory references. */
+				init_waitqueue_head(&chip->wq);
+				spin_lock_init(&chip->_spinlock);
+				chip->mutex = &chip->_spinlock;
+				chip++;
+			}
+		}
+
+		printk(KERN_DEBUG "%s: %d sets of %d interleaved chips "
+				  "--> %d partitions of %#x bytes\n",
+				  map->name, cfi->numchips, cfi->interleave,
+				  newcfi->numchips, 1<<newcfi->chipshift);
+
+		map->fldrv_priv = newcfi;
+		*pcfi = newcfi;
+		kfree(cfi);
+	}
+
+	return 0;
+}
+
 /*
  *  *********** CHIP ACCESS FUNCTIONS ***********
  */
@@ -313,25 +419,87 @@ static int get_chip(struct map_info *map, struct flchip *chip, unsigned long adr
 {
 	DECLARE_WAITQUEUE(wait, current);
 	struct cfi_private *cfi = map->fldrv_priv;
-	cfi_word status, status_OK = CMD(0x80);
+	map_word status, status_OK = CMD(0x80), status_PWS = CMD(0x01);
 	unsigned long timeo;
-	struct cfi_pri_intelext *cfip = (struct cfi_pri_intelext *)cfi->cmdset_priv;
+	struct cfi_pri_intelext *cfip = cfi->cmdset_priv;
 
  resettime:
 	timeo = jiffies + HZ;
  retry:
+	if (chip->priv && (mode == FL_WRITING || mode == FL_ERASING)) {
+		/*
+		 * OK. We have possibility for contension on the write/erase
+		 * operations which are global to the real chip and not per
+		 * partition.  So let's fight it over in the partition which
+		 * currently has authority on the operation.
+		 *
+		 * The rules are as follows:
+		 *
+		 * - any write operation must own shared->writing.
+		 *
+		 * - any erase operation must own _both_ shared->writing and
+		 *   shared->erasing.
+		 *
+		 * - contension arbitration is handled in the owner's context.
+		 *
+		 * The 'shared' struct can be read when its lock is taken.
+		 * However any writes to it can only be made when the current
+		 * owner's lock is also held.
+		 */
+		struct flchip_shared *shared = chip->priv;
+		struct flchip *contender;
+		spin_lock(&shared->lock);
+		contender = shared->writing;
+		if (contender && contender != chip) {
+			/*
+			 * The engine to perform desired operation on this
+			 * partition is already in use by someone else.
+			 * Let's fight over it in the context of the chip
+			 * currently using it.  If it is possible to suspend,
+			 * that other partition will do just that, otherwise
+			 * it'll happily send us to sleep.  In any case, when
+			 * get_chip returns success we're clear to go ahead.
+			 */
+			int ret = spin_trylock(contender->mutex);
+			spin_unlock(&shared->lock);
+			if (!ret)
+				goto retry;
+			spin_unlock(chip->mutex);
+			ret = get_chip(map, contender, contender->start, mode);
+			spin_lock(chip->mutex);
+			if (ret) {
+				spin_unlock(contender->mutex);
+				return ret;
+			}
+			timeo = jiffies + HZ;
+			spin_lock(&shared->lock);
+		}
+
+		/* We now own it */
+		shared->writing = chip;
+		if (mode == FL_ERASING)
+			shared->erasing = chip;
+		if (contender && contender != chip)
+			spin_unlock(contender->mutex);
+		spin_unlock(&shared->lock);
+	}
+
 	switch (chip->state) {
 
 	case FL_STATUS:
 		for (;;) {
-			status = cfi_read(map, adr);
-			if ((status & status_OK) == status_OK)
+			status = map_read(map, adr);
+			if (map_word_andequal(map, status, status_OK, status_OK))
+				break;
+
+			/* At this point we're fine with write operations
+			   in other partitions as they don't conflict. */
+			if (chip->priv && map_word_andequal(map, status, status_PWS, status_PWS))
 				break;
 
 			if (time_after(jiffies, timeo)) {
-				printk(KERN_ERR "Waiting for chip to be ready timed out. Status %llx\n", 
-				       (long long)status);
-				spin_unlock(chip->mutex);
+				printk(KERN_ERR "Waiting for chip to be ready timed out. Status %lx\n", 
+				       status.x[0]);
 				return -EIO;
 			}
 			spin_unlock(chip->mutex);
@@ -354,31 +522,31 @@ static int get_chip(struct map_info *map, struct flchip *chip, unsigned long adr
 
 
 		/* Erase suspend */
-		cfi_write(map, CMD(0xB0), adr);
+		map_write(map, CMD(0xB0), adr);
 
 		/* If the flash has finished erasing, then 'erase suspend'
 		 * appears to make some (28F320) flash devices switch to
 		 * 'read' mode.  Make sure that we switch to 'read status'
 		 * mode so we get the right data. --rmk
 		 */
-		cfi_write(map, CMD(0x70), adr);
+		map_write(map, CMD(0x70), adr);
 		chip->oldstate = FL_ERASING;
 		chip->state = FL_ERASE_SUSPENDING;
 		chip->erase_suspended = 1;
 		for (;;) {
-			status = cfi_read(map, adr);
-			if ((status & status_OK) == status_OK)
+			status = map_read(map, adr);
+			if (map_word_andequal(map, status, status_OK, status_OK))
 			        break;
 
 			if (time_after(jiffies, timeo)) {
 				/* Urgh. Resume and pretend we weren't here.  */
-				cfi_write(map, CMD(0xd0), adr);
+				map_write(map, CMD(0xd0), adr);
 				/* Make sure we're in 'read status' mode if it had finished */
-				cfi_write(map, CMD(0x70), adr);
+				map_write(map, CMD(0x70), adr);
 				chip->state = FL_ERASING;
 				chip->oldstate = FL_READY;
 				printk(KERN_ERR "Chip not ready after erase "
-				       "suspended: status = 0x%x\n", status);
+				       "suspended: status = 0x%lx\n", status.x[0]);
 				return -EIO;
 			}
 
@@ -412,6 +580,32 @@ static void put_chip(struct map_info *map, struct flchip *chip, unsigned long ad
 {
 	struct cfi_private *cfi = map->fldrv_priv;
 
+	if (chip->priv) {
+		struct flchip_shared *shared = chip->priv;
+		spin_lock(&shared->lock);
+		if (shared->writing == chip) {
+			/* We own the ability to write, but we're done */
+			shared->writing = shared->erasing;
+			if (shared->writing && shared->writing != chip) {
+				/* give back ownership to who we loaned it from */
+				struct flchip *loaner = shared->writing;
+				spin_lock(loaner->mutex);
+				spin_unlock(&shared->lock);
+				spin_unlock(chip->mutex);
+				put_chip(map, loaner, loaner->start);
+				spin_lock(chip->mutex);
+				spin_unlock(loaner->mutex);
+			} else {
+				if (chip->oldstate != FL_ERASING) {
+					shared->erasing = NULL;
+					if (chip->oldstate != FL_WRITING)
+						shared->writing = NULL;
+				}
+				spin_unlock(&shared->lock);
+			}
+		}
+	}
+
 	switch(chip->oldstate) {
 	case FL_ERASING:
 		chip->state = chip->oldstate;
@@ -424,14 +618,15 @@ static void put_chip(struct map_info *map, struct flchip *chip, unsigned long ad
 		   sending the 0x70 (Read Status) command to an erasing
 		   chip and expecting it to be ignored, that's what we 
 		   do. */
-		cfi_write(map, CMD(0xd0), adr);
-		cfi_write(map, CMD(0x70), adr);
+		map_write(map, CMD(0xd0), adr);
+		map_write(map, CMD(0x70), adr);
 		chip->oldstate = FL_READY;
 		chip->state = FL_ERASING;
 		break;
 
 	case FL_READY:
 	case FL_STATUS:
+	case FL_JEDEC_QUERY:
 		/* We should really make set_vpp() count, rather than doing this */
 		DISABLE_VPP(map);
 		break;
@@ -450,7 +645,7 @@ static int do_point_onechip (struct map_info *map, struct flchip *chip, loff_t a
 	adr += chip->start;
 
 	/* Ensure cmd read/writes are aligned. */ 
-	cmd_addr = adr & ~(CFIDEV_BUSWIDTH-1); 
+	cmd_addr = adr & ~(map_bankwidth(map)-1); 
 
 	spin_lock(chip->mutex);
 
@@ -458,7 +653,7 @@ static int do_point_onechip (struct map_info *map, struct flchip *chip, loff_t a
 
 	if (!ret) {
 		if (chip->state != FL_POINT && chip->state != FL_READY)
-			cfi_write(map, CMD(0xff), cmd_addr);
+			map_write(map, CMD(0xff), cmd_addr);
 
 		chip->state = FL_POINT;
 		chip->ref_point_counter++;
@@ -476,12 +671,10 @@ static int cfi_intelext_point (struct mtd_info *mtd, loff_t from, size_t len, si
 	int chipnum;
 	int ret = 0;
 
-	if (from + len > mtd->size)
+	if (!map->virt || (from + len > mtd->size))
 		return -EINVAL;
 	
 	*mtdbuf = (void *)map->virt + from;
-	if(*mtdbuf == NULL)
-		return -EINVAL; /* can not point this region */
 	*retlen = 0;
 
 	/* Now lock the chip(s) to POINT state */
@@ -566,7 +759,7 @@ static inline int do_read_onechip(struct map_info *map, struct flchip *chip, lof
 	adr += chip->start;
 
 	/* Ensure cmd read/writes are aligned. */ 
-	cmd_addr = adr & ~(CFIDEV_BUSWIDTH-1); 
+	cmd_addr = adr & ~(map_bankwidth(map)-1); 
 
 	spin_lock(chip->mutex);
 	ret = get_chip(map, chip, cmd_addr, FL_READY);
@@ -576,7 +769,7 @@ static inline int do_read_onechip(struct map_info *map, struct flchip *chip, lof
 	}
 
 	if (chip->state != FL_POINT && chip->state != FL_READY) {
-		cfi_write(map, CMD(0xff), cmd_addr);
+		map_write(map, CMD(0xff), cmd_addr);
 
 		chip->state = FL_READY;
 	}
@@ -627,7 +820,7 @@ static int cfi_intelext_read (struct mtd_info *mtd, loff_t from, size_t len, siz
 	}
 	return ret;
 }
-
+#if 0
 static int cfi_intelext_read_prot_reg (struct mtd_info *mtd, loff_t from, size_t len, size_t *retlen, u_char *buf, int base_offst, int reg_sz)
 {
 	struct map_info *map = mtd->priv;
@@ -658,7 +851,7 @@ static int cfi_intelext_read_prot_reg (struct mtd_info *mtd, loff_t from, size_t
 		}
 
 		if (chip->state != FL_JEDEC_QUERY) {
-			cfi_write(map, CMD(0x90), chip->start);
+			map_write(map, CMD(0x90), chip->start);
 			chip->state = FL_JEDEC_QUERY;
 		}
 
@@ -718,12 +911,12 @@ static int cfi_intelext_read_fact_prot_reg (struct mtd_info *mtd, loff_t from, s
 
 	return cfi_intelext_read_prot_reg(mtd, from, len, retlen, buf, base_offst, reg_sz);
 }
+#endif
 
-
-static int do_write_oneword(struct map_info *map, struct flchip *chip, unsigned long adr, cfi_word datum)
+static int do_write_oneword(struct map_info *map, struct flchip *chip, unsigned long adr, map_word datum)
 {
 	struct cfi_private *cfi = map->fldrv_priv;
-	cfi_word status, status_OK;
+	map_word status, status_OK;
 	unsigned long timeo;
 	int z, ret=0;
 
@@ -740,11 +933,12 @@ static int do_write_oneword(struct map_info *map, struct flchip *chip, unsigned
 	}
 
 	ENABLE_VPP(map);
-	cfi_write(map, CMD(0x40), adr);
-	cfi_write(map, datum, adr);
+	map_write(map, CMD(0x40), adr);
+	map_write(map, datum, adr);
 	chip->state = FL_WRITING;
 
 	spin_unlock(chip->mutex);
+	INVALIDATE_CACHED_RANGE(map, adr, map_bankwidth(map));
 	cfi_udelay(chip->word_write_time);
 	spin_lock(chip->mutex);
 
@@ -765,8 +959,8 @@ static int do_write_oneword(struct map_info *map, struct flchip *chip, unsigned
 			continue;
 		}
 
-		status = cfi_read(map, adr);
-		if ((status & status_OK) == status_OK)
+		status = map_read(map, adr);
+		if (map_word_andequal(map, status, status_OK, status_OK))
 			break;
 		
 		/* OK Still waiting */
@@ -794,11 +988,11 @@ static int do_write_oneword(struct map_info *map, struct flchip *chip, unsigned
 	/* Done and happy. */
 	chip->state = FL_STATUS;
 	/* check for lock bit */
-	if (status & CMD(0x02)) {
+	if (map_word_bitsset(map, status, CMD(0x02))) {
 		/* clear status */
-		cfi_write(map, CMD(0x50), adr);
+		map_write(map, CMD(0x50), adr);
 		/* put back into read status register mode */
-		cfi_write(map, CMD(0x70), adr);
+		map_write(map, CMD(0x70), adr);
 		ret = -EROFS;
 	}
  out:
@@ -825,35 +1019,22 @@ static int cfi_intelext_write_words (struct mtd_info *mtd, loff_t to , size_t le
 	ofs = to  - (chipnum << cfi->chipshift);
 
 	/* If it's not bus-aligned, do the first byte write */
-	if (ofs & (CFIDEV_BUSWIDTH-1)) {
-		unsigned long bus_ofs = ofs & ~(CFIDEV_BUSWIDTH-1);
+	if (ofs & (map_bankwidth(map)-1)) {
+		unsigned long bus_ofs = ofs & ~(map_bankwidth(map)-1);
 		int gap = ofs - bus_ofs;
-		int i = 0, n = 0;
-		u_char tmp_buf[8];
-		cfi_word datum;
-
-		while (gap--)
-			tmp_buf[i++] = 0xff;
-		while (len && i < CFIDEV_BUSWIDTH)
-			tmp_buf[i++] = buf[n++], len--;
-		while (i < CFIDEV_BUSWIDTH)
-			tmp_buf[i++] = 0xff;
-
-		if (cfi_buswidth_is_2()) {
-			datum = *(__u16*)tmp_buf;
-		} else if (cfi_buswidth_is_4()) {
-			datum = *(__u32*)tmp_buf;
-		} else if (cfi_buswidth_is_8()) {
-			datum = *(__u64*)tmp_buf;
-		} else {
-			return -EINVAL;  /* should never happen, but be safe */
-		}
+		int n;
+		map_word datum;
+
+		n = min_t(int, len, map_bankwidth(map)-gap);
+		datum = map_word_ff(map);
+		datum = map_word_load_partial(map, datum, buf, gap, n);
 
 		ret = do_write_oneword(map, &cfi->chips[chipnum],
 					       bus_ofs, datum);
 		if (ret) 
 			return ret;
-		
+
+		len -= n;
 		ofs += n;
 		buf += n;
 		(*retlen) += n;
@@ -866,30 +1047,18 @@ static int cfi_intelext_write_words (struct mtd_info *mtd, loff_t to , size_t le
 		}
 	}
 	
-	while(len >= CFIDEV_BUSWIDTH) {
-		cfi_word datum;
-
-		if (cfi_buswidth_is_1()) {
-			datum = *(__u8*)buf;
-		} else if (cfi_buswidth_is_2()) {
-			datum = *(__u16*)buf;
-		} else if (cfi_buswidth_is_4()) {
-			datum = *(__u32*)buf;
-		} else if (cfi_buswidth_is_8()) {
-			datum = *(__u64*)buf;
-		} else {
-			return -EINVAL;
-		}
+	while(len >= map_bankwidth(map)) {
+		map_word datum = map_word_load(map, buf);
 
 		ret = do_write_oneword(map, &cfi->chips[chipnum],
 				ofs, datum);
 		if (ret)
 			return ret;
 
-		ofs += CFIDEV_BUSWIDTH;
-		buf += CFIDEV_BUSWIDTH;
-		(*retlen) += CFIDEV_BUSWIDTH;
-		len -= CFIDEV_BUSWIDTH;
+		ofs += map_bankwidth(map);
+		buf += map_bankwidth(map);
+		(*retlen) += map_bankwidth(map);
+		len -= map_bankwidth(map);
 
 		if (ofs >> cfi->chipshift) {
 			chipnum ++; 
@@ -899,32 +1068,18 @@ static int cfi_intelext_write_words (struct mtd_info *mtd, loff_t to , size_t le
 		}
 	}
 
-	if (len & (CFIDEV_BUSWIDTH-1)) {
-		int i = 0, n = 0;
-		u_char tmp_buf[8];
-		cfi_word datum;
-
-		while (len--)
-			tmp_buf[i++] = buf[n++];
-		while (i < CFIDEV_BUSWIDTH)
-			tmp_buf[i++] = 0xff;
-
-		if (cfi_buswidth_is_2()) {
-			datum = *(__u16*)tmp_buf;
-		} else if (cfi_buswidth_is_4()) {
-			datum = *(__u32*)tmp_buf;
-		} else if (cfi_buswidth_is_8()) {
-			datum = *(__u64*)tmp_buf;
-		} else {
-			return -EINVAL;  /* should never happen, but be safe */
-		}
+	if (len & (map_bankwidth(map)-1)) {
+		map_word datum;
+
+		datum = map_word_ff(map);
+		datum = map_word_load_partial(map, datum, buf, 0, len);
 
 		ret = do_write_oneword(map, &cfi->chips[chipnum],
 					       ofs, datum);
 		if (ret) 
 			return ret;
 		
-		(*retlen) += n;
+		(*retlen) += len;
 	}
 
 	return 0;
@@ -935,11 +1090,11 @@ static inline int do_write_buffer(struct map_info *map, struct flchip *chip,
 				  unsigned long adr, const u_char *buf, int len)
 {
 	struct cfi_private *cfi = map->fldrv_priv;
-	cfi_word status, status_OK;
+	map_word status, status_OK;
 	unsigned long cmd_adr, timeo;
 	int wbufsize, z, ret=0, bytes, words;
 
-	wbufsize = CFIDEV_INTERLEAVE << cfi->cfiq->MaxBufWriteSize;
+	wbufsize = cfi_interleave(cfi) << cfi->cfiq->MaxBufWriteSize;
 	adr += chip->start;
 	cmd_adr = adr & ~(wbufsize-1);
 	
@@ -953,29 +1108,28 @@ static inline int do_write_buffer(struct map_info *map, struct flchip *chip,
 		return ret;
 	}
 
-	if (chip->state != FL_STATUS)
-		cfi_write(map, CMD(0x70), cmd_adr);
-
-	status = cfi_read(map, cmd_adr);
-
 	/* §4.8 of the 28FxxxJ3A datasheet says "Any time SR.4 and/or SR.5 is set
 	   [...], the device will not accept any more Write to Buffer commands". 
 	   So we must check here and reset those bits if they're set. Otherwise
 	   we're just pissing in the wind */
-	if (status & CMD(0x30)) {
-		printk(KERN_WARNING "SR.4 or SR.5 bits set in buffer write (status %x). Clearing.\n", status);
-		cfi_write(map, CMD(0x50), cmd_adr);
-		cfi_write(map, CMD(0x70), cmd_adr);
+	if (chip->state != FL_STATUS)
+		map_write(map, CMD(0x70), cmd_adr);
+	status = map_read(map, cmd_adr);
+	if (map_word_bitsset(map, status, CMD(0x30))) {
+		printk(KERN_WARNING "SR.4 or SR.5 bits set in buffer write (status %lx). Clearing.\n", status.x[0]);
+		map_write(map, CMD(0x50), cmd_adr);
+		map_write(map, CMD(0x70), cmd_adr);
 	}
+
 	ENABLE_VPP(map);
 	chip->state = FL_WRITING_TO_BUFFER;
 
 	z = 0;
 	for (;;) {
-		cfi_write(map, CMD(0xe8), cmd_adr);
+		map_write(map, CMD(0xe8), cmd_adr);
 
-		status = cfi_read(map, cmd_adr);
-		if ((status & status_OK) == status_OK)
+		status = map_read(map, cmd_adr);
+		if (map_word_andequal(map, status, status_OK, status_OK))
 			break;
 
 		spin_unlock(chip->mutex);
@@ -984,84 +1138,47 @@ static inline int do_write_buffer(struct map_info *map, struct flchip *chip,
 
 		if (++z > 20) {
 			/* Argh. Not ready for write to buffer */
-			cfi_write(map, CMD(0x70), cmd_adr);
+			map_write(map, CMD(0x70), cmd_adr);
 			chip->state = FL_STATUS;
-			printk(KERN_ERR "Chip not ready for buffer write. Xstatus = %llx, status = %llx\n", (__u64)status, (__u64)cfi_read(map, cmd_adr));
+			printk(KERN_ERR "Chip not ready for buffer write. Xstatus = %lx, status = %lx\n",
+			       status.x[0], map_read(map, cmd_adr).x[0]);
 			/* Odd. Clear status bits */
-			cfi_write(map, CMD(0x50), cmd_adr);
-			cfi_write(map, CMD(0x70), cmd_adr);
+			map_write(map, CMD(0x50), cmd_adr);
+			map_write(map, CMD(0x70), cmd_adr);
 			ret = -EIO;
 			goto out;
 		}
 	}
 
 	/* Write length of data to come */
-	bytes = len & (CFIDEV_BUSWIDTH-1);
-	words = len / CFIDEV_BUSWIDTH;
-	cfi_write(map, CMD(words - !bytes), cmd_adr );
+	bytes = len & (map_bankwidth(map)-1);
+	words = len / map_bankwidth(map);
+	map_write(map, CMD(words - !bytes), cmd_adr );
 
 	/* Write data */
 	z = 0;
-	while(z < words * CFIDEV_BUSWIDTH) {
-		if (cfi_buswidth_is_1()) {
-			u8 *b = (u8 *)buf;
-
-			map_write8 (map, *b++, adr+z);
-			buf = (const u_char *)b;
-		} else if (cfi_buswidth_is_2()) {
-			u16 *b = (u16 *)buf;
-
-			map_write16 (map, *b++, adr+z);
-			buf = (const u_char *)b;
-		} else if (cfi_buswidth_is_4()) {
-			u32 *b = (u32 *)buf;
-
-			map_write32 (map, *b++, adr+z);
-			buf = (const u_char *)b;
-		} else if (cfi_buswidth_is_8()) {
-			u64 *b = (u64 *)buf;
-
-			map_write64 (map, *b++, adr+z);
-			buf = (const u_char *)b;
-		} else {
-			ret = -EINVAL;
-			goto out;
-		}
-		z += CFIDEV_BUSWIDTH;
+	while(z < words * map_bankwidth(map)) {
+		map_word datum = map_word_load(map, buf);
+		map_write(map, datum, adr+z);
+
+		z += map_bankwidth(map);
+		buf += map_bankwidth(map);
 	}
+
 	if (bytes) {
-		int i = 0, n = 0;
-		u_char tmp_buf[8], *tmp_p = tmp_buf;
-
-		while (bytes--)
-			tmp_buf[i++] = buf[n++];
-		while (i < CFIDEV_BUSWIDTH)
-			tmp_buf[i++] = 0xff;
-		if (cfi_buswidth_is_2()) {
-			u16 *b = (u16 *)tmp_p;
-
-			map_write16 (map, *b++, adr+z);
-			tmp_p = (u_char *)b;
-		} else if (cfi_buswidth_is_4()) {
-			u32 *b = (u32 *)tmp_p;
-
-			map_write32 (map, *b++, adr+z);
-			tmp_p = (u_char *)b;
-		} else if (cfi_buswidth_is_8()) {
-			u64 *b = (u64 *)tmp_p;
-
-			map_write64 (map, *b++, adr+z);
-			tmp_p = (u_char *)b;
-		} else {
-			ret = -EINVAL;
-			goto out;
-		}
+		map_word datum;
+
+		datum = map_word_ff(map);
+		datum = map_word_load_partial(map, datum, buf, 0, bytes);
+		map_write(map, datum, adr+z);
 	}
+
 	/* GO GO GO */
-	cfi_write(map, CMD(0xd0), cmd_adr);
+	map_write(map, CMD(0xd0), cmd_adr);
 	chip->state = FL_WRITING;
 
 	spin_unlock(chip->mutex);
+	INVALIDATE_CACHED_RANGE(map, adr, len);
 	cfi_udelay(chip->buffer_write_time);
 	spin_lock(chip->mutex);
 
@@ -1081,8 +1198,8 @@ static inline int do_write_buffer(struct map_info *map, struct flchip *chip,
 			continue;
 		}
 
-		status = cfi_read(map, cmd_adr);
-		if ((status & status_OK) == status_OK)
+		status = map_read(map, cmd_adr);
+		if (map_word_andequal(map, status, status_OK, status_OK))
 			break;
 
 		/* OK Still waiting */
@@ -1111,11 +1228,11 @@ static inline int do_write_buffer(struct map_info *map, struct flchip *chip,
  	chip->state = FL_STATUS;
 
 	/* check for lock bit */
-	if (status & CMD(0x02)) {
+	if (map_word_bitsset(map, status, CMD(0x02))) {
 		/* clear status */
-		cfi_write(map, CMD(0x50), cmd_adr);
+		map_write(map, CMD(0x50), cmd_adr);
 		/* put back into read status register mode */
-		cfi_write(map, CMD(0x70), adr);
+		map_write(map, CMD(0x70), adr);
 		ret = -EROFS;
 	}
 
@@ -1130,7 +1247,7 @@ static int cfi_intelext_write_buffers (struct mtd_info *mtd, loff_t to,
 {
 	struct map_info *map = mtd->priv;
 	struct cfi_private *cfi = map->fldrv_priv;
-	int wbufsize = CFIDEV_INTERLEAVE << cfi->cfiq->MaxBufWriteSize;
+	int wbufsize = cfi_interleave(cfi) << cfi->cfiq->MaxBufWriteSize;
 	int ret = 0;
 	int chipnum;
 	unsigned long ofs;
@@ -1143,8 +1260,8 @@ static int cfi_intelext_write_buffers (struct mtd_info *mtd, loff_t to,
 	ofs = to  - (chipnum << cfi->chipshift);
 
 	/* If it's not bus-aligned, do the first word write */
-	if (ofs & (CFIDEV_BUSWIDTH-1)) {
-		size_t local_len = (-ofs)&(CFIDEV_BUSWIDTH-1);
+	if (ofs & (map_bankwidth(map)-1)) {
+		size_t local_len = (-ofs)&(map_bankwidth(map)-1);
 		if (local_len > len)
 			local_len = len;
 		ret = cfi_intelext_write_words(mtd, to, local_len,
@@ -1163,7 +1280,6 @@ static int cfi_intelext_write_buffers (struct mtd_info *mtd, loff_t to,
 		}
 	}
 
-	/* Write buffer is worth it only if more than one word to write... */
 	while(len) {
 		/* We must not cross write block boundaries */
 		int size = wbufsize - (ofs & (wbufsize-1));
@@ -1191,7 +1307,7 @@ static int cfi_intelext_write_buffers (struct mtd_info *mtd, loff_t to,
 }
 
 typedef int (*varsize_frob_t)(struct map_info *map, struct flchip *chip,
-			      unsigned long adr, void *thunk);
+			      unsigned long adr, int len, void *thunk);
 
 static int cfi_intelext_varsize_frob(struct mtd_info *mtd, varsize_frob_t frob,
 				     loff_t ofs, size_t len, void *thunk)
@@ -1258,15 +1374,19 @@ static int cfi_intelext_varsize_frob(struct mtd_info *mtd, varsize_frob_t frob,
 	i=first;
 
 	while(len) {
-		ret = (*frob)(map, &cfi->chips[chipnum], adr, thunk);
+		unsigned long chipmask;
+		int size = regions[i].erasesize;
+
+		ret = (*frob)(map, &cfi->chips[chipnum], adr, size, thunk);
 		
 		if (ret)
 			return ret;
 
-		adr += regions[i].erasesize;
-		len -= regions[i].erasesize;
+		adr += size;
+		len -= size;
 
-		if (adr % (1<< cfi->chipshift) == ((regions[i].offset + (regions[i].erasesize * regions[i].numblocks)) %( 1<< cfi->chipshift)))
+		chipmask = (1 << cfi->chipshift) - 1;
+		if ((adr & chipmask) == ((regions[i].offset + size * regions[i].numblocks) & chipmask))
 			i++;
 
 		if (adr >> cfi->chipshift) {
@@ -1282,10 +1402,11 @@ static int cfi_intelext_varsize_frob(struct mtd_info *mtd, varsize_frob_t frob,
 }
 
 
-static int do_erase_oneblock(struct map_info *map, struct flchip *chip, unsigned long adr, void *thunk)
+static int do_erase_oneblock(struct map_info *map, struct flchip *chip,
+			     unsigned long adr, int len, void *thunk)
 {
 	struct cfi_private *cfi = map->fldrv_priv;
-	cfi_word status, status_OK;
+	map_word status, status_OK;
 	unsigned long timeo;
 	int retries = 3;
 	DECLARE_WAITQUEUE(wait, current);
@@ -1306,15 +1427,16 @@ static int do_erase_oneblock(struct map_info *map, struct flchip *chip, unsigned
 
 	ENABLE_VPP(map);
 	/* Clear the status register first */
-	cfi_write(map, CMD(0x50), adr);
+	map_write(map, CMD(0x50), adr);
 
 	/* Now erase */
-	cfi_write(map, CMD(0x20), adr);
-	cfi_write(map, CMD(0xD0), adr);
+	map_write(map, CMD(0x20), adr);
+	map_write(map, CMD(0xD0), adr);
 	chip->state = FL_ERASING;
 	chip->erase_suspended = 0;
 
 	spin_unlock(chip->mutex);
+	INVALIDATE_CACHED_RANGE(map, adr, len);
 	set_current_state(TASK_UNINTERRUPTIBLE);
 	schedule_timeout((chip->erase_time*HZ)/(2*1000));
 	spin_lock(chip->mutex);
@@ -1341,19 +1463,19 @@ static int do_erase_oneblock(struct map_info *map, struct flchip *chip, unsigned
 			chip->erase_suspended = 0;
 		}
 
-		status = cfi_read(map, adr);
-		if ((status & status_OK) == status_OK)
+		status = map_read(map, adr);
+		if (map_word_andequal(map, status, status_OK, status_OK))
 			break;
 		
 		/* OK Still waiting */
 		if (time_after(jiffies, timeo)) {
-			cfi_write(map, CMD(0x70), adr);
+			map_write(map, CMD(0x70), adr);
 			chip->state = FL_STATUS;
-			printk(KERN_ERR "waiting for erase at %08lx to complete timed out. Xstatus = %llx, status = %llx.\n",
-			       adr, (__u64)status, (__u64)cfi_read(map, adr));
+			printk(KERN_ERR "waiting for erase at %08lx to complete timed out. Xstatus = %lx, status = %lx.\n",
+			       adr, status.x[0], map_read(map, adr).x[0]);
 			/* Clear status bits */
-			cfi_write(map, CMD(0x50), adr);
-			cfi_write(map, CMD(0x70), adr);
+			map_write(map, CMD(0x50), adr);
+			map_write(map, CMD(0x70), adr);
 			DISABLE_VPP(map);
 			spin_unlock(chip->mutex);
 			return -EIO;
@@ -1370,43 +1492,46 @@ static int do_erase_oneblock(struct map_info *map, struct flchip *chip, unsigned
 	ret = 0;
 
 	/* We've broken this before. It doesn't hurt to be safe */
-	cfi_write(map, CMD(0x70), adr);
+	map_write(map, CMD(0x70), adr);
 	chip->state = FL_STATUS;
-	status = cfi_read(map, adr);
+	status = map_read(map, adr);
 
 	/* check for lock bit */
-	if (status & CMD(0x3a)) {
-		unsigned char chipstatus = status;
-		if (status != CMD(status & 0xff)) {
-			int i;
-			for (i = 1; i<CFIDEV_INTERLEAVE; i++) {
-				      chipstatus |= status >> (cfi->device_type * 8);
+	if (map_word_bitsset(map, status, CMD(0x3a))) {
+		unsigned char chipstatus = status.x[0];
+		if (!map_word_equal(map, status, CMD(chipstatus))) {
+			int i, w;
+			for (w=0; w<map_words(map); w++) {
+				for (i = 0; i<cfi_interleave(cfi); i++) {
+					chipstatus |= status.x[w] >> (cfi->device_type * 8);
+				}
 			}
-			printk(KERN_WARNING "Status is not identical for all chips: 0x%llx. Merging to give 0x%02x\n", (__u64)status, chipstatus);
+			printk(KERN_WARNING "Status is not identical for all chips: 0x%lx. Merging to give 0x%02x\n",
+			       status.x[0], chipstatus);
 		}
 		/* Reset the error bits */
-		cfi_write(map, CMD(0x50), adr);
-		cfi_write(map, CMD(0x70), adr);
+		map_write(map, CMD(0x50), adr);
+		map_write(map, CMD(0x70), adr);
 		
 		if ((chipstatus & 0x30) == 0x30) {
-			printk(KERN_NOTICE "Chip reports improper command sequence: status 0x%llx\n", (__u64)status);
+			printk(KERN_NOTICE "Chip reports improper command sequence: status 0x%x\n", chipstatus);
 			ret = -EIO;
 		} else if (chipstatus & 0x02) {
 			/* Protection bit set */
 			ret = -EROFS;
 		} else if (chipstatus & 0x8) {
 			/* Voltage */
-			printk(KERN_WARNING "Chip reports voltage low on erase: status 0x%llx\n", (__u64)status);
+			printk(KERN_WARNING "Chip reports voltage low on erase: status 0x%x\n", chipstatus);
 			ret = -EIO;
 		} else if (chipstatus & 0x20) {
 			if (retries--) {
-				printk(KERN_DEBUG "Chip erase failed at 0x%08lx: status 0x%llx. Retrying...\n", adr, (__u64)status);
+				printk(KERN_DEBUG "Chip erase failed at 0x%08lx: status 0x%x. Retrying...\n", adr, chipstatus);
 				timeo = jiffies + HZ;
 				chip->state = FL_STATUS;
 				spin_unlock(chip->mutex);
 				goto retry;
 			}
-			printk(KERN_DEBUG "Chip erase failed at 0x%08lx: status 0x%llx\n", adr, (__u64)status);
+			printk(KERN_DEBUG "Chip erase failed at 0x%08lx: status 0x%x\n", adr, chipstatus);
 			ret = -EIO;
 		}
 	}
@@ -1424,13 +1549,12 @@ int cfi_intelext_erase_varsize(struct mtd_info *mtd, struct erase_info *instr)
 	ofs = instr->addr;
 	len = instr->len;
 
-	ret = cfi_intelext_varsize_frob(mtd, do_erase_oneblock, ofs, len, 0);
+	ret = cfi_intelext_varsize_frob(mtd, do_erase_oneblock, ofs, len, NULL);
 	if (ret)
 		return ret;
 
 	instr->state = MTD_ERASE_DONE;
-	if (instr->callback)
-		instr->callback(instr);
+	mtd_erase_callback(instr);
 	
 	return 0;
 }
@@ -1476,7 +1600,8 @@ static void cfi_intelext_sync (struct mtd_info *mtd)
 }
 
 #ifdef DEBUG_LOCK_BITS
-static int do_printlockstatus_oneblock(struct map_info *map, struct flchip *chip, unsigned long adr, void *thunk)
+static int do_printlockstatus_oneblock(struct map_info *map, struct flchip *chip,
+				       unsigned long adr, int len, void *thunk)
 {
 	struct cfi_private *cfi = map->fldrv_priv;
 	int ofs_factor = cfi->interleave * cfi->device_type;
@@ -1484,8 +1609,7 @@ static int do_printlockstatus_oneblock(struct map_info *map, struct flchip *chip
 	cfi_send_gen_cmd(0x90, 0x55, 0, map, cfi, cfi->device_type, NULL);
 	printk(KERN_DEBUG "block status register for 0x%08lx is %x\n",
 	       adr, cfi_read_query(map, adr+(2*ofs_factor)));
-	cfi_send_gen_cmd(0xff, 0x55, 0, map, cfi, cfi->device_type, NULL);
-	
+	chip->state = FL_JEDEC_QUERY;
 	return 0;
 }
 #endif
@@ -1493,10 +1617,11 @@ static int do_printlockstatus_oneblock(struct map_info *map, struct flchip *chip
 #define DO_XXLOCK_ONEBLOCK_LOCK		((void *) 1)
 #define DO_XXLOCK_ONEBLOCK_UNLOCK	((void *) 2)
 
-static int do_xxlock_oneblock(struct map_info *map, struct flchip *chip, unsigned long adr, void *thunk)
+static int do_xxlock_oneblock(struct map_info *map, struct flchip *chip,
+			      unsigned long adr, int len, void *thunk)
 {
 	struct cfi_private *cfi = map->fldrv_priv;
-	cfi_word status, status_OK;
+	map_word status, status_OK;
 	unsigned long timeo = jiffies + HZ;
 	int ret;
 
@@ -1513,13 +1638,13 @@ static int do_xxlock_oneblock(struct map_info *map, struct flchip *chip, unsigne
 	}
 
 	ENABLE_VPP(map);
-	cfi_write(map, CMD(0x60), adr);
+	map_write(map, CMD(0x60), adr);
 
 	if (thunk == DO_XXLOCK_ONEBLOCK_LOCK) {
-		cfi_write(map, CMD(0x01), adr);
+		map_write(map, CMD(0x01), adr);
 		chip->state = FL_LOCKING;
 	} else if (thunk == DO_XXLOCK_ONEBLOCK_UNLOCK) {
-		cfi_write(map, CMD(0xD0), adr);
+		map_write(map, CMD(0xD0), adr);
 		chip->state = FL_UNLOCKING;
 	} else
 		BUG();
@@ -1534,15 +1659,16 @@ static int do_xxlock_oneblock(struct map_info *map, struct flchip *chip, unsigne
 	timeo = jiffies + (HZ*20);
 	for (;;) {
 
-		status = cfi_read(map, adr);
-		if ((status & status_OK) == status_OK)
+		status = map_read(map, adr);
+		if (map_word_andequal(map, status, status_OK, status_OK))
 			break;
 		
 		/* OK Still waiting */
 		if (time_after(jiffies, timeo)) {
-			cfi_write(map, CMD(0x70), adr);
+			map_write(map, CMD(0x70), adr);
 			chip->state = FL_STATUS;
-			printk(KERN_ERR "waiting for unlock to complete timed out. Xstatus = %llx, status = %llx.\n", (__u64)status, (__u64)cfi_read(map, adr));
+			printk(KERN_ERR "waiting for unlock to complete timed out. Xstatus = %lx, status = %lx.\n",
+			       status.x[0], map_read(map, adr).x[0]);
 			DISABLE_VPP(map);
 			spin_unlock(chip->mutex);
 			return -EIO;
@@ -1576,8 +1702,8 @@ static int cfi_intelext_lock(struct mtd_info *mtd, loff_t ofs, size_t len)
 					ofs, len, DO_XXLOCK_ONEBLOCK_LOCK);
 	
 #ifdef DEBUG_LOCK_BITS
-	printk(KERN_DEBUG
-	       "%s: lock status after, ret=%d\n", __FUNCTION__, ret);
+	printk(KERN_DEBUG "%s: lock status after, ret=%d\n",
+	       __FUNCTION__, ret);
 	cfi_intelext_varsize_frob(mtd, do_printlockstatus_oneblock,
 				  ofs, len, 0);
 #endif
@@ -1600,7 +1726,8 @@ static int cfi_intelext_unlock(struct mtd_info *mtd, loff_t ofs, size_t len)
 					ofs, len, DO_XXLOCK_ONEBLOCK_UNLOCK);
 	
 #ifdef DEBUG_LOCK_BITS
-	printk(KERN_DEBUG "%s: lock status after, ret=%d\n", __FUNCTION__, ret);
+	printk(KERN_DEBUG "%s: lock status after, ret=%d\n",
+	       __FUNCTION__, ret);
 	cfi_intelext_varsize_frob(mtd, do_printlockstatus_oneblock, 
 				  ofs, len, 0);
 #endif
@@ -1680,7 +1807,7 @@ static void cfi_intelext_resume(struct mtd_info *mtd)
 		
 		/* Go to known state. Chip may have been power cycled */
 		if (chip->state == FL_PM_SUSPENDED) {
-			cfi_write(map, CMD(0xFF), 0);
+			map_write(map, CMD(0xFF), cfi->chips[i].start);
 			chip->state = FL_READY;
 			wake_up(&chip->wq);
 		}
@@ -1695,6 +1822,7 @@ static void cfi_intelext_destroy(struct mtd_info *mtd)
 	struct cfi_private *cfi = map->fldrv_priv;
 	kfree(cfi->cmdset_priv);
 	kfree(cfi->cfiq);
+	kfree(cfi->chips[0].priv);
 	kfree(cfi);
 	kfree(mtd->eraseregions);
 }
diff --git a/drivers/mtd/chips/cfi_cmdset_0002.c b/drivers/mtd/chips/cfi_cmdset_0002.c
index df3309048..5bd15f548 100644
--- a/drivers/mtd/chips/cfi_cmdset_0002.c
+++ b/drivers/mtd/chips/cfi_cmdset_0002.c
@@ -3,15 +3,21 @@
  *   AMD & Fujitsu Standard Vendor Command Set (ID 0x0002)
  *
  * Copyright (C) 2000 Crossnet Co. <info@crossnet.co.jp>
+ * Copyright (C) 2004 Arcom Control Systems Ltd <linux@arcom.com>
  *
  * 2_by_8 routines added by Simon Munton
  *
+ * 4_by_16 work by Carolyn J. Smith
+ *
+ * Occasionally maintained by Thayne Harbaugh tharbaugh at lnxi dot com
+ *
  * This code is GPL
  *
- * $Id: cfi_cmdset_0002.c,v 1.74 2003/05/28 12:51:48 dwmw2 Exp $
+ * $Id: cfi_cmdset_0002.c,v 1.106 2004/08/09 14:02:32 dwmw2 Exp $
  *
  */
 
+#include <linux/config.h>
 #include <linux/module.h>
 #include <linux/types.h>
 #include <linux/kernel.h>
@@ -24,18 +30,23 @@
 #include <linux/slab.h>
 #include <linux/delay.h>
 #include <linux/interrupt.h>
+#include <linux/mtd/compatmac.h>
 #include <linux/mtd/map.h>
 #include <linux/mtd/mtd.h>
 #include <linux/mtd/cfi.h>
-#include <linux/mtd/compatmac.h>
 
 #define AMD_BOOTLOC_BUG
+#define FORCE_WORD_WRITE 0
+
+#define MAX_WORD_RETRIES 3
 
 static int cfi_amdstd_read (struct mtd_info *, loff_t, size_t, size_t *, u_char *);
-static int cfi_amdstd_write(struct mtd_info *, loff_t, size_t, size_t *, const u_char *);
+static int cfi_amdstd_write_words(struct mtd_info *, loff_t, size_t, size_t *, const u_char *);
+static int cfi_amdstd_write_buffers(struct mtd_info *, loff_t, size_t, size_t *, const u_char *);
 static int cfi_amdstd_erase_chip(struct mtd_info *, struct erase_info *);
-static int cfi_amdstd_erase_onesize(struct mtd_info *, struct erase_info *);
 static int cfi_amdstd_erase_varsize(struct mtd_info *, struct erase_info *);
+static int cfi_amdstd_lock_varsize(struct mtd_info *, loff_t, size_t);
+static int cfi_amdstd_unlock_varsize(struct mtd_info *, loff_t, size_t);
 static void cfi_amdstd_sync (struct mtd_info *);
 static int cfi_amdstd_suspend (struct mtd_info *);
 static void cfi_amdstd_resume (struct mtd_info *);
@@ -55,50 +66,129 @@ static struct mtd_chip_driver cfi_amdstd_chipdrv = {
 };
 
 
+/* #define DEBUG_LOCK_BITS */
+/* #define DEBUG_CFI_FEATURES */
+
+
+#ifdef DEBUG_CFI_FEATURES
+static void cfi_tell_features(struct cfi_pri_amdstd *extp)
+{
+	const char* erase_suspend[3] = {
+		"Not supported", "Read only", "Read/write"
+	};
+	const char* top_bottom[6] = {
+		"No WP", "8x8KiB sectors at top & bottom, no WP",
+		"Bottom boot", "Top boot",
+		"Uniform, Bottom WP", "Uniform, Top WP"
+	};
+
+	printk("  Silicon revision: %d\n", extp->SiliconRevision >> 1);
+	printk("  Address sensitive unlock: %s\n", 
+	       (extp->SiliconRevision & 1) ? "Not required" : "Required");
+
+	if (extp->EraseSuspend < ARRAY_SIZE(erase_suspend))
+		printk("  Erase Suspend: %s\n", erase_suspend[extp->EraseSuspend]);
+	else
+		printk("  Erase Suspend: Unknown value %d\n", extp->EraseSuspend);
+
+	if (extp->BlkProt == 0)
+		printk("  Block protection: Not supported\n");
+	else
+		printk("  Block protection: %d sectors per group\n", extp->BlkProt);
+
+
+	printk("  Temporary block unprotect: %s\n",
+	       extp->TmpBlkUnprotect ? "Supported" : "Not supported");
+	printk("  Block protect/unprotect scheme: %d\n", extp->BlkProtUnprot);
+	printk("  Number of simultaneous operations: %d\n", extp->SimultaneousOps);
+	printk("  Burst mode: %s\n",
+	       extp->BurstMode ? "Supported" : "Not supported");
+	if (extp->PageMode == 0)
+		printk("  Page mode: Not supported\n");
+	else
+		printk("  Page mode: %d word page\n", extp->PageMode << 2);
+
+	printk("  Vpp Supply Minimum Program/Erase Voltage: %d.%d V\n", 
+	       extp->VppMin >> 4, extp->VppMin & 0xf);
+	printk("  Vpp Supply Maximum Program/Erase Voltage: %d.%d V\n", 
+	       extp->VppMax >> 4, extp->VppMax & 0xf);
+
+	if (extp->TopBottom < ARRAY_SIZE(top_bottom))
+		printk("  Top/Bottom Boot Block: %s\n", top_bottom[extp->TopBottom]);
+	else
+		printk("  Top/Bottom Boot Block: Unknown value %d\n", extp->TopBottom);
+}
+#endif
+
+#ifdef AMD_BOOTLOC_BUG
+/* Wheee. Bring me the head of someone at AMD. */
+static void fixup_amd_bootblock(struct map_info *map, void* param)
+{
+	struct cfi_private *cfi = map->fldrv_priv;
+	struct cfi_pri_amdstd *extp = cfi->cmdset_priv;
+	__u8 major = extp->MajorVersion;
+	__u8 minor = extp->MinorVersion;
+
+	if (((major << 8) | minor) < 0x3131) {
+		/* CFI version 1.0 => don't trust bootloc */
+		if (cfi->id & 0x80) {
+			printk(KERN_WARNING "%s: JEDEC Device ID is 0x%02X. Assuming broken CFI table.\n", map->name, cfi->id);
+			extp->TopBottom = 3;	/* top boot */
+		} else {
+			extp->TopBottom = 2;	/* bottom boot */
+		}
+	}
+}
+#endif
+
+static struct cfi_fixup fixup_table[] = {
+#ifdef AMD_BOOTLOC_BUG
+	{
+		0x0001,		/* AMD */
+		CFI_ID_ANY,
+		fixup_amd_bootblock, NULL
+	},
+#endif
+	{ 0, 0, NULL, NULL }
+};
+
+
 struct mtd_info *cfi_cmdset_0002(struct map_info *map, int primary)
 {
 	struct cfi_private *cfi = map->fldrv_priv;
 	unsigned char bootloc;
-	int ofs_factor = cfi->interleave * cfi->device_type;
 	int i;
-	__u8 major, minor;
-	__u32 base = cfi->chips[0].start;
 
 	if (cfi->cfi_mode==CFI_MODE_CFI){
+		/* 
+		 * It's a real CFI chip, not one for which the probe
+		 * routine faked a CFI structure. So we read the feature
+		 * table from it.
+		 */
 		__u16 adr = primary?cfi->cfiq->P_ADR:cfi->cfiq->A_ADR;
+		struct cfi_pri_amdstd *extp;
+
+		extp = (struct cfi_pri_amdstd*)cfi_read_pri(map, adr, sizeof(*extp), "Amd/Fujitsu");
+		if (!extp)
+			return NULL;
+
+		/* Install our own private info structure */
+		cfi->cmdset_priv = extp;	
+
+		cfi_fixup(map, fixup_table);
+
+#ifdef DEBUG_CFI_FEATURES
+		/* Tell the user about it in lots of lovely detail */
+		cfi_tell_features(extp);
+#endif	
+
+		bootloc = extp->TopBottom;
+		if ((bootloc != 2) && (bootloc != 3)) {
+			printk(KERN_WARNING "%s: CFI does not contain boot "
+			       "bank location. Assuming top.\n", map->name);
+			bootloc = 2;
+		}
 
-		cfi_send_gen_cmd(0x98, 0x55, base, map, cfi, cfi->device_type, NULL);
-		
-		major = cfi_read_query(map, base + (adr+3)*ofs_factor);
-		minor = cfi_read_query(map, base + (adr+4)*ofs_factor);
-		
-		printk(KERN_NOTICE " Amd/Fujitsu Extended Query Table v%c.%c at 0x%4.4X\n",
-		       major, minor, adr);
-				cfi_send_gen_cmd(0xf0, 0x55, base, map, cfi, cfi->device_type, NULL);
-		
-		cfi_send_gen_cmd(0xaa, 0x555, base, map, cfi, cfi->device_type, NULL);
-		cfi_send_gen_cmd(0x55, 0x2aa, base, map, cfi, cfi->device_type, NULL);
-		cfi_send_gen_cmd(0x90, 0x555, base, map, cfi, cfi->device_type, NULL);
-		/* FIXME - should have a delay before continuing */
-		cfi->mfr = cfi_read_query(map, base);
-		cfi->id = cfi_read_query(map, base + ofs_factor);    
-
-		/* Wheee. Bring me the head of someone at AMD. */
-#ifdef AMD_BOOTLOC_BUG
-		if (((major << 8) | minor) < 0x3131) {
-			/* CFI version 1.0 => don't trust bootloc */
-			if (cfi->id & 0x80) {
-				printk(KERN_WARNING "%s: JEDEC Device ID is 0x%02X. Assuming broken CFI table.\n", map->name, cfi->id);
-				bootloc = 3;	/* top boot */
-			} else {
-				bootloc = 2;	/* bottom boot */
-			}
-		} else
-#endif
-			{
-				cfi_send_gen_cmd(0x98, 0x55, base, map, cfi, cfi->device_type, NULL);
-				bootloc = cfi_read_query(map, base + (adr+15)*ofs_factor);
-			}
 		if (bootloc == 3 && cfi->cfiq->NumEraseRegions > 1) {
 			printk(KERN_WARNING "%s: Swapping erase regions for broken CFI table.\n", map->name);
 			
@@ -112,31 +202,41 @@ struct mtd_info *cfi_cmdset_0002(struct map_info *map, int primary)
 			}
 		}
 		/*
-		 * FIXME - These might already be setup (more correctly)
-		 * buy jedec_probe.c.
+		 * These might already be setup (more correctly) by
+		 * jedec_probe.c - still need it for cfi_probe.c path.
 		 */
-		switch (cfi->device_type) {
-		case CFI_DEVICETYPE_X8:
-			cfi->addr_unlock1 = 0x555; 
-			cfi->addr_unlock2 = 0x2aa; 
-			break;
-		case CFI_DEVICETYPE_X16:
-			cfi->addr_unlock1 = 0xaaa;
-			if (map->buswidth == cfi->interleave) {
-				/* X16 chip(s) in X8 mode */
-				cfi->addr_unlock2 = 0x555;
-			} else {
-				cfi->addr_unlock2 = 0x554;
+		if ( ! (cfi->addr_unlock1 && cfi->addr_unlock2) ) {
+			switch (cfi->device_type) {
+			case CFI_DEVICETYPE_X8:
+				cfi->addr_unlock1 = 0x555; 
+				cfi->addr_unlock2 = 0x2aa; 
+				break;
+			case CFI_DEVICETYPE_X16:
+				cfi->addr_unlock1 = 0xaaa;
+				if (map_bankwidth(map) == cfi_interleave(cfi)) {
+					/* X16 chip(s) in X8 mode */
+					cfi->addr_unlock2 = 0x555;
+				} else {
+					cfi->addr_unlock2 = 0x554;
+				}
+				break;
+			case CFI_DEVICETYPE_X32:
+				cfi->addr_unlock1 = 0x1554;
+				if (map_bankwidth(map) == cfi_interleave(cfi)*2) {
+					/* X32 chip(s) in X16 mode */
+					cfi->addr_unlock1 = 0xaaa;
+				} else {
+					cfi->addr_unlock2 = 0xaa8; 
+				}
+				break;
+			default:
+				printk(KERN_WARNING
+				       "MTD %s(): Unsupported device type %d\n",
+				       __func__, cfi->device_type);
+				return NULL;
 			}
-			break;
-		case CFI_DEVICETYPE_X32:
-			cfi->addr_unlock1 = 0x1555; 
-			cfi->addr_unlock2 = 0xaaa; 
-			break;
-		default:
-			printk(KERN_NOTICE "Eep. Unknown cfi_cmdset_0002 device type %d\n", cfi->device_type);
-			return NULL;
 		}
+
 	} /* CFI mode */
 
 	for (i=0; i< cfi->numchips; i++) {
@@ -147,23 +247,25 @@ struct mtd_info *cfi_cmdset_0002(struct map_info *map, int primary)
 	
 	map->fldrv = &cfi_amdstd_chipdrv;
 
-	cfi_send_gen_cmd(0xf0, 0x55, base, map, cfi, cfi->device_type, NULL);
 	return cfi_amdstd_setup(map);
 }
 
+
 static struct mtd_info *cfi_amdstd_setup(struct map_info *map)
 {
 	struct cfi_private *cfi = map->fldrv_priv;
 	struct mtd_info *mtd;
 	unsigned long devsize = (1<<cfi->cfiq->DevSize) * cfi->interleave;
+	unsigned long offset = 0;
+	int i,j;
 
 	mtd = kmalloc(sizeof(*mtd), GFP_KERNEL);
 	printk(KERN_NOTICE "number of %s chips: %d\n", 
-		(cfi->cfi_mode == CFI_MODE_CFI)?"CFI":"JEDEC",cfi->numchips);
+	       (cfi->cfi_mode == CFI_MODE_CFI)?"CFI":"JEDEC",cfi->numchips);
 
 	if (!mtd) {
-	  printk(KERN_WARNING "Failed to allocate memory for MTD device\n");
-	  goto setup_err;
+		printk(KERN_WARNING "Failed to allocate memory for MTD device\n");
+		goto setup_err;
 	}
 
 	memset(mtd, 0, sizeof(*mtd));
@@ -171,86 +273,69 @@ static struct mtd_info *cfi_amdstd_setup(struct map_info *map)
 	mtd->type = MTD_NORFLASH;
 	/* Also select the correct geometry setup too */ 
 	mtd->size = devsize * cfi->numchips;
-	
-	if (cfi->cfiq->NumEraseRegions == 1) {
-		/* No need to muck about with multiple erase sizes */
-		mtd->erasesize = ((cfi->cfiq->EraseRegionInfo[0] >> 8) & ~0xff) * cfi->interleave;
-	} else {
-		unsigned long offset = 0;
-		int i,j;
-
-		mtd->numeraseregions = cfi->cfiq->NumEraseRegions * cfi->numchips;
-		mtd->eraseregions = kmalloc(sizeof(struct mtd_erase_region_info) * mtd->numeraseregions, GFP_KERNEL);
-		if (!mtd->eraseregions) { 
-			printk(KERN_WARNING "Failed to allocate memory for MTD erase region info\n");
-			goto setup_err;
-		}
+
+	mtd->numeraseregions = cfi->cfiq->NumEraseRegions * cfi->numchips;
+	mtd->eraseregions = kmalloc(sizeof(struct mtd_erase_region_info)
+				    * mtd->numeraseregions, GFP_KERNEL);
+	if (!mtd->eraseregions) { 
+		printk(KERN_WARNING "Failed to allocate memory for MTD erase region info\n");
+		goto setup_err;
+	}
 			
-		for (i=0; i<cfi->cfiq->NumEraseRegions; i++) {
-			unsigned long ernum, ersize;
-			ersize = ((cfi->cfiq->EraseRegionInfo[i] >> 8) & ~0xff) * cfi->interleave;
-			ernum = (cfi->cfiq->EraseRegionInfo[i] & 0xffff) + 1;
+	for (i=0; i<cfi->cfiq->NumEraseRegions; i++) {
+		unsigned long ernum, ersize;
+		ersize = ((cfi->cfiq->EraseRegionInfo[i] >> 8) & ~0xff) * cfi->interleave;
+		ernum = (cfi->cfiq->EraseRegionInfo[i] & 0xffff) + 1;
 			
-			if (mtd->erasesize < ersize) {
-				mtd->erasesize = ersize;
-			}
-			for (j=0; j<cfi->numchips; j++) {
-				mtd->eraseregions[(j*cfi->cfiq->NumEraseRegions)+i].offset = (j*devsize)+offset;
-				mtd->eraseregions[(j*cfi->cfiq->NumEraseRegions)+i].erasesize = ersize;
-				mtd->eraseregions[(j*cfi->cfiq->NumEraseRegions)+i].numblocks = ernum;
-			}
-			offset += (ersize * ernum);
+		if (mtd->erasesize < ersize) {
+			mtd->erasesize = ersize;
 		}
-		if (offset != devsize) {
-			/* Argh */
-			printk(KERN_WARNING "Sum of regions (%lx) != total size of set of interleaved chips (%lx)\n", offset, devsize);
-			goto setup_err;
+		for (j=0; j<cfi->numchips; j++) {
+			mtd->eraseregions[(j*cfi->cfiq->NumEraseRegions)+i].offset = (j*devsize)+offset;
+			mtd->eraseregions[(j*cfi->cfiq->NumEraseRegions)+i].erasesize = ersize;
+			mtd->eraseregions[(j*cfi->cfiq->NumEraseRegions)+i].numblocks = ernum;
 		}
+		offset += (ersize * ernum);
+	}
+	if (offset != devsize) {
+		/* Argh */
+		printk(KERN_WARNING "Sum of regions (%lx) != total size of set of interleaved chips (%lx)\n", offset, devsize);
+		goto setup_err;
+	}
 #if 0
-		// debug
-		for (i=0; i<mtd->numeraseregions;i++){
-			printk("%d: offset=0x%x,size=0x%x,blocks=%d\n",
-			       i,mtd->eraseregions[i].offset,
-			       mtd->eraseregions[i].erasesize,
-			       mtd->eraseregions[i].numblocks);
-		}
-#endif
+	// debug
+	for (i=0; i<mtd->numeraseregions;i++){
+		printk("%d: offset=0x%x,size=0x%x,blocks=%d\n",
+		       i,mtd->eraseregions[i].offset,
+		       mtd->eraseregions[i].erasesize,
+		       mtd->eraseregions[i].numblocks);
 	}
-
-	switch (CFIDEV_BUSWIDTH)
-	{
-	case 1:
-	case 2:
-	case 4:
-#if 1
-		if (mtd->numeraseregions > 1)
-			mtd->erase = cfi_amdstd_erase_varsize;
-		else
 #endif
-		if (((cfi->cfiq->EraseRegionInfo[0] & 0xffff) + 1) == 1)
-			mtd->erase = cfi_amdstd_erase_chip;
-		else
-			mtd->erase = cfi_amdstd_erase_onesize;
-		mtd->read = cfi_amdstd_read;
-		mtd->write = cfi_amdstd_write;
-		break;
 
-	default:
-	        printk(KERN_WARNING "Unsupported buswidth\n");
-		goto setup_err;
-		break;
+	if (mtd->numeraseregions == 1
+	    && ((cfi->cfiq->EraseRegionInfo[0] & 0xffff) + 1) == 1) {
+		mtd->erase = cfi_amdstd_erase_chip;
+	} else {
+		mtd->erase = cfi_amdstd_erase_varsize;
+		mtd->lock = cfi_amdstd_lock_varsize;
+		mtd->unlock = cfi_amdstd_unlock_varsize;
 	}
-	if (cfi->fast_prog) {
-		/* In cfi_amdstd_write() we frob the protection stuff
-		   without paying any attention to the state machine.
-		   This upsets in-progress erases. So we turn this flag
-		   off for now till the code gets fixed. */
-		printk(KERN_NOTICE "cfi_cmdset_0002: Disabling fast programming due to code brokenness.\n");
-		cfi->fast_prog = 0;
+
+	if ( cfi->cfiq->BufWriteTimeoutTyp && !FORCE_WORD_WRITE) {
+		DEBUG(MTD_DEBUG_LEVEL1, "Using buffer write method\n" );
+		mtd->write = cfi_amdstd_write_buffers;
+	} else {
+		DEBUG(MTD_DEBUG_LEVEL1, "Using word write method\n" );
+		mtd->write = cfi_amdstd_write_words;
 	}
 
+	mtd->read = cfi_amdstd_read;
 
-        /* does this chip have a secsi area? */
+	/* FIXME: erase-suspend-program is broken.  See
+	   http://lists.infradead.org/pipermail/linux-mtd/2003-December/009001.html */
+	printk(KERN_NOTICE "cfi_cmdset_0002: Disabling erase-suspend-program due to code brokenness.\n");
+
+	/* does this chip have a secsi area? */
 	if(cfi->mfr==1){
 		
 		switch(cfi->id){
@@ -289,46 +374,181 @@ static struct mtd_info *cfi_amdstd_setup(struct map_info *map)
 	return NULL;
 }
 
-static inline int do_read_onechip(struct map_info *map, struct flchip *chip, loff_t adr, size_t len, u_char *buf)
+/*
+ * Return true if the chip is ready.
+ *
+ * Ready is one of: read mode, query mode, erase-suspend-read mode (in any
+ * non-suspended sector) and is indicated by no toggle bits toggling.
+ *
+ * Note that anything more complicated than checking if no bits are toggling
+ * (including checking DQ5 for an error status) is tricky to get working
+ * correctly and is therefore not done	(particulary with interleaved chips
+ * as each chip must be checked independantly of the others).
+ */
+static int chip_ready(struct map_info *map, unsigned long addr)
+{
+	map_word d, t;
+
+	d = map_read(map, addr);
+	t = map_read(map, addr);
+
+	return map_word_equal(map, d, t);
+}
+
+static int get_chip(struct map_info *map, struct flchip *chip, unsigned long adr, int mode)
 {
 	DECLARE_WAITQUEUE(wait, current);
-	unsigned long timeo = jiffies + HZ;
+	struct cfi_private *cfi = map->fldrv_priv;
+	unsigned long timeo;
+	struct cfi_pri_amdstd *cfip = (struct cfi_pri_amdstd *)cfi->cmdset_priv;
 
+ resettime:
+	timeo = jiffies + HZ;
  retry:
-	cfi_spin_lock(chip->mutex);
+	switch (chip->state) {
 
-	if (chip->state != FL_READY){
-#if 0
-	        printk(KERN_DEBUG "Waiting for chip to read, status = %d\n", chip->state);
-#endif
+	case FL_STATUS:
+		for (;;) {
+			if (chip_ready(map, adr))
+				break;
+
+			if (time_after(jiffies, timeo)) {
+				printk(KERN_ERR "Waiting for chip to be ready timed out.\n");
+				cfi_spin_unlock(chip->mutex);
+				return -EIO;
+			}
+			cfi_spin_unlock(chip->mutex);
+			cfi_udelay(1);
+			cfi_spin_lock(chip->mutex);
+			/* Someone else might have been playing with it. */
+			goto retry;
+		}
+				
+	case FL_READY:
+	case FL_CFI_QUERY:
+	case FL_JEDEC_QUERY:
+		return 0;
+
+	case FL_ERASING:
+		if (mode == FL_WRITING) /* FIXME: Erase-suspend-program appears broken. */
+			goto sleep;
+
+		if (!(mode == FL_READY || mode == FL_POINT
+		      || (mode == FL_WRITING && (cfip->EraseSuspend & 0x2))
+		      || (mode == FL_WRITING && (cfip->EraseSuspend & 0x1))))
+			goto sleep;
+
+		/* We could check to see if we're trying to access the sector
+		 * that is currently being erased. However, no user will try
+		 * anything like that so we just wait for the timeout. */
+
+		/* Erase suspend */
+		/* It's harmless to issue the Erase-Suspend and Erase-Resume
+		 * commands when the erase algorithm isn't in progress. */
+		map_write(map, CMD(0xB0), chip->in_progress_block_addr);
+		chip->oldstate = FL_ERASING;
+		chip->state = FL_ERASE_SUSPENDING;
+		chip->erase_suspended = 1;
+		for (;;) {
+			if (chip_ready(map, adr))
+				break;
+
+			if (time_after(jiffies, timeo)) {
+				/* Should have suspended the erase by now.
+				 * Send an Erase-Resume command as either
+				 * there was an error (so leave the erase
+				 * routine to recover from it) or we trying to
+				 * use the erase-in-progress sector. */
+				map_write(map, CMD(0x30), chip->in_progress_block_addr);
+				chip->state = FL_ERASING;
+				chip->oldstate = FL_READY;
+				printk(KERN_ERR "MTD %s(): chip not ready after erase suspend\n", __func__);
+				return -EIO;
+			}
+			
+			cfi_spin_unlock(chip->mutex);
+			cfi_udelay(1);
+			cfi_spin_lock(chip->mutex);
+			/* Nobody will touch it while it's in state FL_ERASE_SUSPENDING.
+			   So we can just loop here. */
+		}
+		chip->state = FL_READY;
+		return 0;
+
+	case FL_POINT:
+		/* Only if there's no operation suspended... */
+		if (mode == FL_READY && chip->oldstate == FL_READY)
+			return 0;
+
+	default:
+	sleep:
 		set_current_state(TASK_UNINTERRUPTIBLE);
 		add_wait_queue(&chip->wq, &wait);
-                
 		cfi_spin_unlock(chip->mutex);
-
 		schedule();
 		remove_wait_queue(&chip->wq, &wait);
-#if 0
-		if(signal_pending(current))
-			return -EINTR;
-#endif
-		timeo = jiffies + HZ;
+		cfi_spin_lock(chip->mutex);
+		goto resettime;
+	}
+}
 
-		goto retry;
-	}	
+
+static void put_chip(struct map_info *map, struct flchip *chip, unsigned long adr)
+{
+	struct cfi_private *cfi = map->fldrv_priv;
+
+	switch(chip->oldstate) {
+	case FL_ERASING:
+		chip->state = chip->oldstate;
+		map_write(map, CMD(0x30), chip->in_progress_block_addr);
+		chip->oldstate = FL_READY;
+		chip->state = FL_ERASING;
+		break;
+
+	case FL_READY:
+	case FL_STATUS:
+		/* We should really make set_vpp() count, rather than doing this */
+		DISABLE_VPP(map);
+		break;
+	default:
+		printk(KERN_ERR "MTD: put_chip() called with oldstate %d!!\n", chip->oldstate);
+	}
+	wake_up(&chip->wq);
+}
+
+
+static inline int do_read_onechip(struct map_info *map, struct flchip *chip, loff_t adr, size_t len, u_char *buf)
+{
+	unsigned long cmd_addr;
+	struct cfi_private *cfi = map->fldrv_priv;
+	int ret;
 
 	adr += chip->start;
 
-	chip->state = FL_READY;
+	/* Ensure cmd read/writes are aligned. */ 
+	cmd_addr = adr & ~(map_bankwidth(map)-1); 
+
+	cfi_spin_lock(chip->mutex);
+	ret = get_chip(map, chip, cmd_addr, FL_READY);
+	if (ret) {
+		cfi_spin_unlock(chip->mutex);
+		return ret;
+	}
+
+	if (chip->state != FL_POINT && chip->state != FL_READY) {
+		map_write(map, CMD(0xf0), cmd_addr);
+		chip->state = FL_READY;
+	}
 
 	map_copy_from(map, buf, adr, len);
 
-	wake_up(&chip->wq);
-	cfi_spin_unlock(chip->mutex);
+	put_chip(map, chip, cmd_addr);
 
+	cfi_spin_unlock(chip->mutex);
 	return 0;
 }
 
+
 static int cfi_amdstd_read (struct mtd_info *mtd, loff_t from, size_t len, size_t *retlen, u_char *buf)
 {
 	struct map_info *map = mtd->priv;
@@ -370,6 +590,7 @@ static int cfi_amdstd_read (struct mtd_info *mtd, loff_t from, size_t len, size_
 	return ret;
 }
 
+
 static inline int do_read_secsi_onechip(struct map_info *map, struct flchip *chip, loff_t adr, size_t len, u_char *buf)
 {
 	DECLARE_WAITQUEUE(wait, current);
@@ -381,11 +602,11 @@ static inline int do_read_secsi_onechip(struct map_info *map, struct flchip *chi
 
 	if (chip->state != FL_READY){
 #if 0
-	        printk(KERN_DEBUG "Waiting for chip to read, status = %d\n", chip->state);
+		printk(KERN_DEBUG "Waiting for chip to read, status = %d\n", chip->state);
 #endif
 		set_current_state(TASK_UNINTERRUPTIBLE);
 		add_wait_queue(&chip->wq, &wait);
-                
+		
 		cfi_spin_unlock(chip->mutex);
 
 		schedule();
@@ -402,13 +623,15 @@ static inline int do_read_secsi_onechip(struct map_info *map, struct flchip *chi
 	adr += chip->start;
 
 	chip->state = FL_READY;
-	
+
+	/* should these be CFI_DEVICETYPE_X8 instead of cfi->device_type? */
 	cfi_send_gen_cmd(0xAA, cfi->addr_unlock1, chip->start, map, cfi, cfi->device_type, NULL);
 	cfi_send_gen_cmd(0x55, cfi->addr_unlock2, chip->start, map, cfi, cfi->device_type, NULL);
 	cfi_send_gen_cmd(0x88, cfi->addr_unlock1, chip->start, map, cfi, cfi->device_type, NULL);
 	
 	map_copy_from(map, buf, adr, len);
 
+	/* should these be CFI_DEVICETYPE_X8 instead of cfi->device_type? */
 	cfi_send_gen_cmd(0xAA, cfi->addr_unlock1, chip->start, map, cfi, cfi->device_type, NULL);
 	cfi_send_gen_cmd(0x55, cfi->addr_unlock2, chip->start, map, cfi, cfi->device_type, NULL);
 	cfi_send_gen_cmd(0x90, cfi->addr_unlock1, chip->start, map, cfi, cfi->device_type, NULL);
@@ -463,215 +686,136 @@ static int cfi_amdstd_secsi_read (struct mtd_info *mtd, loff_t from, size_t len,
 	return ret;
 }
 
-static int do_write_oneword(struct map_info *map, struct flchip *chip, unsigned long adr, cfi_word datum, int fast)
+
+static int do_write_oneword(struct map_info *map, struct flchip *chip, unsigned long adr, map_word datum)
 {
-	unsigned long timeo = jiffies + HZ;
-	unsigned int oldstatus, status, prev_oldstatus, prev_status;
-	unsigned int dq6;
 	struct cfi_private *cfi = map->fldrv_priv;
-    /* We use a 1ms + 1 jiffies generic timeout for writes (most devices have
-       a max write time of a few hundreds usec). However, we should use the
-       maximum timeout value given by the chip at probe time instead. 
-       Unfortunately, struct flchip does have a field for maximum timeout, 
-       only for typical which can be far too short depending of the conditions.
-       The ' + 1' is to avoid having a timeout of 0 jiffies if HZ is smaller
-       than 1000. Using a static variable allows makes us save the costly
-       divide operation at each word write.*/ 
-    static unsigned long uWriteTimeout = ( HZ / 1000 ) + 1;
-	DECLARE_WAITQUEUE(wait, current);
+	unsigned long timeo = jiffies + HZ;
+	/*
+	 * We use a 1ms + 1 jiffies generic timeout for writes (most devices
+	 * have a max write time of a few hundreds usec). However, we should
+	 * use the maximum timeout value given by the chip at probe time
+	 * instead.  Unfortunately, struct flchip does have a field for
+	 * maximum timeout, only for typical which can be far too short
+	 * depending of the conditions.	 The ' + 1' is to avoid having a
+	 * timeout of 0 jiffies if HZ is smaller than 1000.
+	 */
+	unsigned long uWriteTimeout = ( HZ / 1000 ) + 1;
 	int ret = 0;
-	int ta = 0;
+	map_word oldd, curd;
+	int retry_cnt = 0;
 
- retry:
-	cfi_spin_lock(chip->mutex);
+	adr += chip->start;
 
-	if (chip->state != FL_READY) {
-#if 0
-	        printk(KERN_DEBUG "Waiting for chip to write, status = %d\n", chip->state);
-#endif
-		set_current_state(TASK_UNINTERRUPTIBLE);
-		add_wait_queue(&chip->wq, &wait);
-                
+	cfi_spin_lock(chip->mutex);
+	ret = get_chip(map, chip, adr, FL_WRITING);
+	if (ret) {
 		cfi_spin_unlock(chip->mutex);
+		return ret;
+	}
 
-		schedule();
-		remove_wait_queue(&chip->wq, &wait);
-#if 0
-		printk(KERN_DEBUG "Wake up to write:\n");
-		if(signal_pending(current))
-			return -EINTR;
-#endif
-		timeo = jiffies + HZ;
-
-		goto retry;
-	}	
-
-	chip->state = FL_WRITING;
+	DEBUG( MTD_DEBUG_LEVEL3, "MTD %s(): WRITE 0x%.8lx(0x%.8lx)\n",
+	       __func__, adr, datum.x[0] );
 
-	adr += chip->start;
-	DEBUG( MTD_DEBUG_LEVEL3, "MTD %s(): WRITE 0x%.8lx(0x%.8x)\n",
-	       __func__, adr, datum );
+	/*
+	 * Check for a NOP for the case when the datum to write is already
+	 * present - it saves time and works around buggy chips that corrupt
+	 * data at other locations when 0xff is written to a location that
+	 * already contains 0xff.
+	 */
+	oldd = map_read(map, adr);
+	if (map_word_equal(map, oldd, datum)) {
+		DEBUG( MTD_DEBUG_LEVEL3, "MTD %s(): NOP\n",
+		       __func__);
+		goto op_done;
+	}
 
 	ENABLE_VPP(map);
-	if (fast) { /* Unlock bypass */
-		cfi_send_gen_cmd(0xA0, 0, chip->start, map, cfi, cfi->device_type, NULL);
-	}
-	else {
-	        cfi_send_gen_cmd(0xAA, cfi->addr_unlock1, chip->start, map, cfi, CFI_DEVICETYPE_X8, NULL);
-	        cfi_send_gen_cmd(0x55, cfi->addr_unlock2, chip->start, map, cfi, CFI_DEVICETYPE_X8, NULL);
-	        cfi_send_gen_cmd(0xA0, cfi->addr_unlock1, chip->start, map, cfi, CFI_DEVICETYPE_X8, NULL);
-	}
-	cfi_write(map, datum, adr);
+ retry:
+	/*
+	 * The CFI_DEVICETYPE_X8 argument is needed even when
+	 * cfi->device_type != CFI_DEVICETYPE_X8.  The addresses for
+	 * command sequences don't scale even when the device is
+	 * wider.  This is the case for many of the cfi_send_gen_cmd()
+	 * below.  I'm not sure, however, why some use
+	 * cfi->device_type.
+	 */
+	cfi_send_gen_cmd(0xAA, cfi->addr_unlock1, chip->start, map, cfi, CFI_DEVICETYPE_X8, NULL);
+	cfi_send_gen_cmd(0x55, cfi->addr_unlock2, chip->start, map, cfi, CFI_DEVICETYPE_X8, NULL);
+	cfi_send_gen_cmd(0xA0, cfi->addr_unlock1, chip->start, map, cfi, CFI_DEVICETYPE_X8, NULL);
+	map_write(map, datum, adr);
+	chip->state = FL_WRITING;
 
 	cfi_spin_unlock(chip->mutex);
 	cfi_udelay(chip->word_write_time);
 	cfi_spin_lock(chip->mutex);
 
-	/*
-	 * Polling toggle bits instead of reading back many times
-	 * This ensures that write operation is really completed,
-	 * or tells us why it failed.
-	 *
-	 * It appears tha the polling and decoding of error state might
-	 * be simplified.  Don't do it unless you really know what you
-	 * are doing.  You must remember that JESD21-C 3.5.3 states that
-	 * the status must be read back an _additional_ two times before
-	 * a failure is determined.  This is because these devices have
-	 * internal state machines that are asynchronous to the external
-	 * data bus.  During an erase or write the read-back status of the
-	 * polling bits might be transitioning internaly when the external
-	 * read-back occurs.  This means that the bits aren't in the final
-	 * state and they might appear to report an error as they transition
-	 * and are in a weird state.  This will produce infrequent errors
-	 * that will usually disappear the next time an erase or write
-	 * happens (Try tracking those errors down!).  To ensure that
-	 * the bits are not in transition the location must be read-back
-	 * two more times and compared against what was written - BOTH reads
-	 * MUST match what was written - don't think this can be simplified
-	 * to only the last read matching.  If the comparison fails, error
-	 * state can then be decoded.
-	 *
-	 * - Thayne Harbaugh
-	 */
-	dq6 = CMD(1<<6);
 	/* See comment above for timeout value. */
 	timeo = jiffies + uWriteTimeout; 
-		
-	oldstatus = cfi_read(map, adr);
-	status = cfi_read(map, adr);
-	DEBUG( MTD_DEBUG_LEVEL3, "MTD %s(): Check 0x%.8x 0x%.8x\n",
-	       __func__, oldstatus, status );
-
-	/*
-	 * This only checks if dq6 is still toggling and that our
-	 * timer hasn't expired.  We purposefully ignore the chips
-	 * internal timer that will assert dq5 and leave dq6 toggling.
-	 * This is done for a variety of reasons:
-	 * 1) Not all chips support dq5.
-	 * 2) Dealing with asynchronous status bit and data updates
-	 *    and reading a device two more times creates _messy_
-	 *    logic when trying to deal with interleaved devices -
-	 *    some may be changing while others are still busy.
-	 * 3) Checking dq5 only helps to optimize an error case that
-	 *    should at worst be infrequent and at best non-existent.
-	 *
-	 * If our timeout occurs _then_ we will check dq5 to see
-	 * if the device also had an internal timeout.
-	 */
-	while( ( ( status ^ oldstatus ) & dq6 )
-	       && ! ( ta = time_after(jiffies, timeo) ) ) {
+	for (;;) {
+		if (chip->state != FL_WRITING) {
+			/* Someone's suspended the write. Sleep */
+			DECLARE_WAITQUEUE(wait, current);
 
-		if (need_resched()) {
+			set_current_state(TASK_UNINTERRUPTIBLE);
+			add_wait_queue(&chip->wq, &wait);
 			cfi_spin_unlock(chip->mutex);
-			yield();
+			schedule();
+			remove_wait_queue(&chip->wq, &wait);
+			timeo = jiffies + (HZ / 2); /* FIXME */
 			cfi_spin_lock(chip->mutex);
-		} else 
-			udelay(1);
-
-		oldstatus = cfi_read( map, adr );
-		status = cfi_read( map, adr );
-		DEBUG( MTD_DEBUG_LEVEL3, "MTD %s(): Check 0x%.8x 0x%.8x\n",
-		       __func__, oldstatus, status );
-	}
+			continue;
+		}
 
-	/*
-	 * Something kicked us out of the read-back loop.  We'll
-	 * check success befor checking failure.
-	 * Even though dq6 might be true data, it is unkown if
-	 * all of the other bits have changed to true data due to
-	 * the asynchronous nature of the internal state machine.
-	 * We will read two more times and use this to either
-	 * verify that the write completed successfully or
-	 * that something really went wrong.  BOTH reads
-	 * must match what was written - this certifies that
-	 * bits aren't still changing  and that the status
-	 * bits erroneously match the datum that was written.
-	 */
-	prev_oldstatus = oldstatus;
-	prev_status = status;
-	oldstatus = cfi_read(map, adr);
-	status = cfi_read(map, adr);
-	DEBUG( MTD_DEBUG_LEVEL3, "MTD %s(): Check 0x%.8x 0x%.8x\n",
-	       __func__, oldstatus, status );
-
-	if ( oldstatus == datum && status == datum ) {
-		/* success - do nothing */
-		goto write_done;
-	}
+		/* Test to see if toggling has stopped. */
+		oldd = map_read(map, adr);
+		curd = map_read(map, adr);
+		if (map_word_equal(map, curd, oldd)) {
+			/* Do we have the correct value? */
+			if (map_word_equal(map, curd, datum)) {
+				goto op_done;
+			}
+			/* Nope something has gone wrong. */
+			break;
+		}
 
-	if ( ta ) {
-		int dq5mask = ( ( status ^ oldstatus ) & dq6 ) >> 1;
-		if ( status & dq5mask ) {
-			/* dq5 asserted - decode interleave chips */
-			printk( KERN_WARNING
-				"MTD %s(): FLASH internal timeout: 0x%.8x\n",
-				__func__,
-				status & dq5mask );
-		} else {
-			printk( KERN_WARNING
-				"MTD %s(): Software timed out during write.\n",
+		if (time_after(jiffies, timeo)) {
+			printk(KERN_WARNING "MTD %s(): software timeout\n",
 				__func__ );
+			break;
 		}
-		goto write_failed;
-	}
-
-	/*
-	 * If we get to here then it means that something
-	 * is wrong and it's not a timeout.  Something
-	 * is seriously wacky!  Dump some debug info.
-	 */
-	printk(KERN_WARNING
-	       "MTD %s(): Wacky!  Unable to decode failure status\n",
-	       __func__ );
 
-	printk(KERN_WARNING
-	       "MTD %s(): 0x%.8lx(0x%.8x): 0x%.8x 0x%.8x 0x%.8x 0x%.8x\n",
-	       __func__, adr, datum,
-	       prev_oldstatus, prev_status,
-	       oldstatus, status);
+		/* Latency issues. Drop the lock, wait a while and retry */
+		cfi_spin_unlock(chip->mutex);
+		cfi_udelay(1);
+		cfi_spin_lock(chip->mutex);
+	}
 
- write_failed:
-	ret = -EIO;
 	/* reset on all failures. */
-	cfi_write( map, CMD(0xF0), chip->start );
+	map_write( map, CMD(0xF0), chip->start );
 	/* FIXME - should have reset delay before continuing */
+	if (++retry_cnt <= MAX_WORD_RETRIES) 
+		goto retry;
 
- write_done:
-	DISABLE_VPP(map);
+	ret = -EIO;
+ op_done:
 	chip->state = FL_READY;
-	wake_up(&chip->wq);
+	put_chip(map, chip, adr);
 	cfi_spin_unlock(chip->mutex);
 
 	return ret;
 }
 
-static int cfi_amdstd_write (struct mtd_info *mtd, loff_t to , size_t len, size_t *retlen, const u_char *buf)
+
+static int cfi_amdstd_write_words(struct mtd_info *mtd, loff_t to, size_t len,
+				  size_t *retlen, const u_char *buf)
 {
 	struct map_info *map = mtd->priv;
 	struct cfi_private *cfi = map->fldrv_priv;
 	int ret = 0;
 	int chipnum;
 	unsigned long ofs, chipstart;
+	DECLARE_WAITQUEUE(wait, current);
 
 	*retlen = 0;
 	if (!len)
@@ -682,33 +826,52 @@ static int cfi_amdstd_write (struct mtd_info *mtd, loff_t to , size_t len, size_
 	chipstart = cfi->chips[chipnum].start;
 
 	/* If it's not bus-aligned, do the first byte write */
-	if (ofs & (CFIDEV_BUSWIDTH-1)) {
-		unsigned long bus_ofs = ofs & ~(CFIDEV_BUSWIDTH-1);
+	if (ofs & (map_bankwidth(map)-1)) {
+		unsigned long bus_ofs = ofs & ~(map_bankwidth(map)-1);
 		int i = ofs - bus_ofs;
 		int n = 0;
-		u_char tmp_buf[8];
-		cfi_word datum;
+		map_word tmp_buf;
 
-		map_copy_from(map, tmp_buf, bus_ofs + cfi->chips[chipnum].start, CFIDEV_BUSWIDTH);
-		while (len && i < CFIDEV_BUSWIDTH)
-			tmp_buf[i++] = buf[n++], len--;
+ retry:
+		cfi_spin_lock(cfi->chips[chipnum].mutex);
 
-		if (cfi_buswidth_is_2()) {
-			datum = *(__u16*)tmp_buf;
-		} else if (cfi_buswidth_is_4()) {
-			datum = *(__u32*)tmp_buf;
-		} else {
-			return -EINVAL;  /* should never happen, but be safe */
+		if (cfi->chips[chipnum].state != FL_READY) {
+#if 0
+			printk(KERN_DEBUG "Waiting for chip to write, status = %d\n", cfi->chips[chipnum].state);
+#endif
+			set_current_state(TASK_UNINTERRUPTIBLE);
+			add_wait_queue(&cfi->chips[chipnum].wq, &wait);
+
+			cfi_spin_unlock(cfi->chips[chipnum].mutex);
+
+			schedule();
+			remove_wait_queue(&cfi->chips[chipnum].wq, &wait);
+#if 0
+			if(signal_pending(current))
+				return -EINTR;
+#endif
+			goto retry;
 		}
 
+		/* Load 'tmp_buf' with old contents of flash */
+		tmp_buf = map_read(map, bus_ofs+chipstart);
+
+		cfi_spin_unlock(cfi->chips[chipnum].mutex);
+
+		/* Number of bytes to copy from buffer */
+		n = min_t(int, len, map_bankwidth(map)-i);
+		
+		tmp_buf = map_word_load_partial(map, tmp_buf, buf, i, n);
+
 		ret = do_write_oneword(map, &cfi->chips[chipnum], 
-				       bus_ofs, datum, 0);
+				       bus_ofs, tmp_buf);
 		if (ret) 
 			return ret;
 		
 		ofs += n;
 		buf += n;
 		(*retlen) += n;
+		len -= n;
 
 		if (ofs >> cfi->chipshift) {
 			chipnum ++; 
@@ -718,315 +881,286 @@ static int cfi_amdstd_write (struct mtd_info *mtd, loff_t to , size_t len, size_
 		}
 	}
 	
-	if (cfi->fast_prog) {
-		/* Go into unlock bypass mode */
-		cfi_send_gen_cmd(0xAA, cfi->addr_unlock1, chipstart, map, cfi, CFI_DEVICETYPE_X8, NULL);
-		cfi_send_gen_cmd(0x55, cfi->addr_unlock2, chipstart, map, cfi, CFI_DEVICETYPE_X8, NULL);
-		cfi_send_gen_cmd(0x20, cfi->addr_unlock1, chipstart, map, cfi, CFI_DEVICETYPE_X8, NULL);
-	}
-
 	/* We are now aligned, write as much as possible */
-	while(len >= CFIDEV_BUSWIDTH) {
-		cfi_word datum;
-
-		if (cfi_buswidth_is_1()) {
-			datum = *(__u8*)buf;
-		} else if (cfi_buswidth_is_2()) {
-			datum = *(__u16*)buf;
-		} else if (cfi_buswidth_is_4()) {
-			datum = *(__u32*)buf;
-		} else {
-			return -EINVAL;
-		}
-		ret = do_write_oneword(map, &cfi->chips[chipnum],
-				       ofs, datum, cfi->fast_prog);
-		if (ret) {
-			if (cfi->fast_prog){
-				/* Get out of unlock bypass mode */
-				cfi_send_gen_cmd(0x90, 0, chipstart, map, cfi, cfi->device_type, NULL);
-				cfi_send_gen_cmd(0x00, 0, chipstart, map, cfi, cfi->device_type, NULL);
-			}
-			return ret;
-		}
+	while(len >= map_bankwidth(map)) {
+		map_word datum;
 
-		ofs += CFIDEV_BUSWIDTH;
-		buf += CFIDEV_BUSWIDTH;
-		(*retlen) += CFIDEV_BUSWIDTH;
-		len -= CFIDEV_BUSWIDTH;
+		datum = map_word_load(map, buf);
 
-		if (ofs >> cfi->chipshift) {
-			if (cfi->fast_prog){
-				/* Get out of unlock bypass mode */
-				cfi_send_gen_cmd(0x90, 0, chipstart, map, cfi, cfi->device_type, NULL);
-				cfi_send_gen_cmd(0x00, 0, chipstart, map, cfi, cfi->device_type, NULL);
-			}
+		ret = do_write_oneword(map, &cfi->chips[chipnum],
+				       ofs, datum);
+		if (ret)
+			return ret;
+
+		ofs += map_bankwidth(map);
+		buf += map_bankwidth(map);
+		(*retlen) += map_bankwidth(map);
+		len -= map_bankwidth(map);
 
+		if (ofs >> cfi->chipshift) {
 			chipnum ++; 
 			ofs = 0;
 			if (chipnum == cfi->numchips)
 				return 0;
 			chipstart = cfi->chips[chipnum].start;
-			if (cfi->fast_prog){
-				/* Go into unlock bypass mode for next set of chips */
-				cfi_send_gen_cmd(0xAA, cfi->addr_unlock1, chipstart, map, cfi, CFI_DEVICETYPE_X8, NULL);
-				cfi_send_gen_cmd(0x55, cfi->addr_unlock2, chipstart, map, cfi, CFI_DEVICETYPE_X8, NULL);
-				cfi_send_gen_cmd(0x20, cfi->addr_unlock1, chipstart, map, cfi, CFI_DEVICETYPE_X8, NULL);
-			}
 		}
 	}
 
-	if (cfi->fast_prog){
-		/* Get out of unlock bypass mode */
-		cfi_send_gen_cmd(0x90, 0, chipstart, map, cfi, cfi->device_type, NULL);
-		cfi_send_gen_cmd(0x00, 0, chipstart, map, cfi, cfi->device_type, NULL);
-	}
-
 	/* Write the trailing bytes if any */
-	if (len & (CFIDEV_BUSWIDTH-1)) {
-		int i = 0, n = 0;
-		u_char tmp_buf[8];
-		cfi_word datum;
-
-		map_copy_from(map, tmp_buf, ofs + cfi->chips[chipnum].start, CFIDEV_BUSWIDTH);
-		while (len--)
-			tmp_buf[i++] = buf[n++];
-
-		if (cfi_buswidth_is_2()) {
-			datum = *(__u16*)tmp_buf;
-		} else if (cfi_buswidth_is_4()) {
-			datum = *(__u32*)tmp_buf;
-		} else {
-			return -EINVAL;  /* should never happen, but be safe */
+	if (len & (map_bankwidth(map)-1)) {
+		map_word tmp_buf;
+
+ retry1:
+		cfi_spin_lock(cfi->chips[chipnum].mutex);
+
+		if (cfi->chips[chipnum].state != FL_READY) {
+#if 0
+			printk(KERN_DEBUG "Waiting for chip to write, status = %d\n", cfi->chips[chipnum].state);
+#endif
+			set_current_state(TASK_UNINTERRUPTIBLE);
+			add_wait_queue(&cfi->chips[chipnum].wq, &wait);
+
+			cfi_spin_unlock(cfi->chips[chipnum].mutex);
+
+			schedule();
+			remove_wait_queue(&cfi->chips[chipnum].wq, &wait);
+#if 0
+			if(signal_pending(current))
+				return -EINTR;
+#endif
+			goto retry1;
 		}
 
+		tmp_buf = map_read(map, ofs + chipstart);
+
+		cfi_spin_unlock(cfi->chips[chipnum].mutex);
+
+		tmp_buf = map_word_load_partial(map, tmp_buf, buf, 0, len);
+	
 		ret = do_write_oneword(map, &cfi->chips[chipnum], 
-				ofs, datum, 0);
+				ofs, tmp_buf);
 		if (ret) 
 			return ret;
 		
-		(*retlen) += n;
+		(*retlen) += len;
 	}
 
 	return 0;
 }
 
-static inline int do_erase_chip(struct map_info *map, struct flchip *chip)
+
+/*
+ * FIXME: interleaved mode not tested, and probably not supported!
+ */
+static inline int do_write_buffer(struct map_info *map, struct flchip *chip, 
+				  unsigned long adr, const u_char *buf, int len)
 {
-	unsigned int oldstatus, status, prev_oldstatus, prev_status;
-	unsigned int dq6;
-	unsigned long timeo = jiffies + HZ;
-	unsigned long int adr;
 	struct cfi_private *cfi = map->fldrv_priv;
-	DECLARE_WAITQUEUE(wait, current);
-	int ret = 0;
-	int ta = 0;
-	cfi_word ones = 0;
+	unsigned long timeo = jiffies + HZ;
+	/* see comments in do_write_oneword() regarding uWriteTimeo. */
+	static unsigned long uWriteTimeout = ( HZ / 1000 ) + 1;
+	int ret = -EIO;
+	unsigned long cmd_adr;
+	int z, words;
+	map_word datum;
 
- retry:
-	cfi_spin_lock(chip->mutex);
+	adr += chip->start;
+	cmd_adr = adr;
 
-	if (chip->state != FL_READY){
-		set_current_state(TASK_UNINTERRUPTIBLE);
-		add_wait_queue(&chip->wq, &wait);
-                
+	cfi_spin_lock(chip->mutex);
+	ret = get_chip(map, chip, adr, FL_WRITING);
+	if (ret) {
 		cfi_spin_unlock(chip->mutex);
+		return ret;
+	}
 
-		schedule();
-		remove_wait_queue(&chip->wq, &wait);
-#if 0
-		if(signal_pending(current))
-			return -EINTR;
-#endif
-		timeo = jiffies + HZ;
+	datum = map_word_load(map, buf);
 
-		goto retry;
-	}	
+	DEBUG( MTD_DEBUG_LEVEL3, "MTD %s(): WRITE 0x%.8lx(0x%.8lx)\n",
+	       __func__, adr, datum.x[0] );
 
-	chip->state = FL_ERASING;
-	DEBUG( MTD_DEBUG_LEVEL3, "MTD %s(): ERASE 0x%.8lx\n",
-	       __func__, chip->start );
-	
-	/* Handle devices with one erase region, that only implement
-	 * the chip erase command.
-	 */
 	ENABLE_VPP(map);
 	cfi_send_gen_cmd(0xAA, cfi->addr_unlock1, chip->start, map, cfi, CFI_DEVICETYPE_X8, NULL);
 	cfi_send_gen_cmd(0x55, cfi->addr_unlock2, chip->start, map, cfi, CFI_DEVICETYPE_X8, NULL);
-	cfi_send_gen_cmd(0x80, cfi->addr_unlock1, chip->start, map, cfi, CFI_DEVICETYPE_X8, NULL);
-	cfi_send_gen_cmd(0xAA, cfi->addr_unlock1, chip->start, map, cfi, CFI_DEVICETYPE_X8, NULL);
-	cfi_send_gen_cmd(0x55, cfi->addr_unlock2, chip->start, map, cfi, CFI_DEVICETYPE_X8, NULL);
-	cfi_send_gen_cmd(0x10, cfi->addr_unlock1, chip->start, map, cfi, CFI_DEVICETYPE_X8, NULL);
-	timeo = jiffies + (HZ*20);
-	adr = cfi->addr_unlock1;
+	//cfi_send_gen_cmd(0xA0, cfi->addr_unlock1, chip->start, map, cfi, CFI_DEVICETYPE_X8, NULL);
 
-	/* Wait for the end of programing/erasure by using the toggle method.
-	 * As long as there is a programming procedure going on, bit 6
-	 * is toggling it's state with each consecutive read.
-	 * The toggling stops as soon as the procedure is completed.
-	 *
-	 * If the process has gone on for too long on the chip bit 5 gets.
-	 * After bit5 is set you can kill the operation by sending a reset
-	 * command to the chip.
-	 */
-	/* see comments in do_write_oneword */
-	dq6 = CMD(1<<6);
+	/* Write Buffer Load */
+	map_write(map, CMD(0x25), cmd_adr);
 
-	oldstatus = cfi_read(map, adr);
-	status = cfi_read(map, adr);
-	DEBUG( MTD_DEBUG_LEVEL3, "MTD %s(): Check 0x%.8x 0x%.8x\n",
-	       __func__, oldstatus, status );
+	chip->state = FL_WRITING_TO_BUFFER;
 
-	while( ( ( status ^ oldstatus ) & dq6 )
-	       && ! ( ta = time_after(jiffies, timeo) ) ) {
-		int wait_reps;
+	/* Write length of data to come */
+	words = len / map_bankwidth(map);
+	map_write(map, CMD(words - 1), cmd_adr);
+	/* Write data */
+	z = 0;
+	while(z < words * map_bankwidth(map)) {
+		datum = map_word_load(map, buf);
+		map_write(map, datum, adr + z);
 
-		/* an initial short sleep */
-		cfi_spin_unlock(chip->mutex);
-		schedule_timeout(HZ/100);
-		cfi_spin_lock(chip->mutex);
+		z += map_bankwidth(map);
+		buf += map_bankwidth(map);
+	}
+	z -= map_bankwidth(map);
+
+	adr += z;
+
+	/* Write Buffer Program Confirm: GO GO GO */
+	map_write(map, CMD(0x29), cmd_adr);
+	chip->state = FL_WRITING;
+
+	cfi_spin_unlock(chip->mutex);
+	cfi_udelay(chip->buffer_write_time);
+	cfi_spin_lock(chip->mutex);
+
+	timeo = jiffies + uWriteTimeout; 
 		
-		if (chip->state != FL_ERASING) {
-			/* Someone's suspended the erase. Sleep */
+	for (;;) {
+		if (chip->state != FL_WRITING) {
+			/* Someone's suspended the write. Sleep */
+			DECLARE_WAITQUEUE(wait, current);
+
 			set_current_state(TASK_UNINTERRUPTIBLE);
 			add_wait_queue(&chip->wq, &wait);
-			
 			cfi_spin_unlock(chip->mutex);
-			printk("erase suspended. Sleeping\n");
-			
 			schedule();
 			remove_wait_queue(&chip->wq, &wait);
-#if 0			
-			if (signal_pending(current))
-				return -EINTR;
-#endif			
-			timeo = jiffies + (HZ*2); /* FIXME */
+			timeo = jiffies + (HZ / 2); /* FIXME */
 			cfi_spin_lock(chip->mutex);
 			continue;
 		}
 
-		/* Busy wait for 1/10 of a milisecond */
-		for(wait_reps = 0;
-		    (wait_reps < 100)
-			    && ( ( status ^ oldstatus ) & dq6 );
-		    wait_reps++) {
-			
-			/* Latency issues. Drop the lock, wait a while and retry */
-			cfi_spin_unlock(chip->mutex);
-
-			cfi_udelay(1);
-
-			cfi_spin_lock(chip->mutex);
-			oldstatus = cfi_read(map, adr);
-			status = cfi_read(map, adr);
-			DEBUG( MTD_DEBUG_LEVEL3, "MTD %s(): Check 0x%.8x 0x%.8x\n",
-			       __func__, oldstatus, status );
-		}
-		oldstatus = cfi_read(map, adr);
-		status = cfi_read(map, adr);
-		DEBUG( MTD_DEBUG_LEVEL3, "MTD %s(): Check 0x%.8x 0x%.8x\n",
-		       __func__, oldstatus, status );
-	}
-
-	prev_oldstatus = oldstatus;
-	prev_status = status;
-	oldstatus = cfi_read(map, adr);
-	status = cfi_read(map, adr);
-	DEBUG( MTD_DEBUG_LEVEL3, "MTD %s(): Check 0x%.8x 0x%.8x\n",
-	       __func__, oldstatus, status );
-
-	if ( cfi_buswidth_is_1() ) {
-		ones =  (__u8)~0;
-	} else if ( cfi_buswidth_is_2() ) {
-		ones = (__u16)~0;
-	} else if ( cfi_buswidth_is_4() ) {
-		ones = (__u32)~0;
-	} else {
-		printk(KERN_WARNING "Unsupported buswidth\n");
-		goto erase_failed;
-	}
-	
-	if ( oldstatus == ones && status == ones ) {
-		/* success - do nothing */
-		goto erase_done;
-	}
+		if (chip_ready(map, adr))
+			goto op_done;
+		    
+		if( time_after(jiffies, timeo))
+			break;
 
-	if ( ta ) {
-		int dq5mask = ( ( status ^ oldstatus ) & dq6 ) >> 1;
-		if ( status & dq5mask ) {
-			/* dq5 asserted - decode interleave chips */
-			printk( KERN_WARNING
-				"MTD %s(): FLASH internal timeout: 0x%.8x\n",
-				__func__,
-				status & dq5mask );
-		} else {
-			printk( KERN_WARNING
-				"MTD %s(): Software timed out during write.\n",
-				__func__ );
-		}
-		goto erase_failed;
+		/* Latency issues. Drop the lock, wait a while and retry */
+		cfi_spin_unlock(chip->mutex);
+		cfi_udelay(1);
+		cfi_spin_lock(chip->mutex);
 	}
 
-	printk(KERN_WARNING
-	       "MTD %s(): Wacky!  Unable to decode failure status\n",
+	printk(KERN_WARNING "MTD %s(): software timeout\n",
 	       __func__ );
 
-	printk(KERN_WARNING
-	       "MTD %s(): 0x%.8lx(0x%.8x): 0x%.8x 0x%.8x 0x%.8x 0x%.8x\n",
-	       __func__, adr, ones,
-	       prev_oldstatus, prev_status,
-	       oldstatus, status);
-
- erase_failed:
-	ret = -EIO;
 	/* reset on all failures. */
-	cfi_write( map, CMD(0xF0), chip->start );
+	map_write( map, CMD(0xF0), chip->start );
 	/* FIXME - should have reset delay before continuing */
 
- erase_done:
-	DISABLE_VPP(map);
+	ret = -EIO;
+ op_done:
 	chip->state = FL_READY;
-	wake_up(&chip->wq);
+	put_chip(map, chip, adr);
 	cfi_spin_unlock(chip->mutex);
+
 	return ret;
 }
 
 
-static inline int do_erase_oneblock(struct map_info *map, struct flchip *chip, unsigned long adr)
+static int cfi_amdstd_write_buffers(struct mtd_info *mtd, loff_t to, size_t len,
+				    size_t *retlen, const u_char *buf)
 {
-	unsigned int oldstatus, status, prev_oldstatus, prev_status;
-	unsigned int dq6;
-	unsigned long timeo = jiffies + HZ;
+	struct map_info *map = mtd->priv;
 	struct cfi_private *cfi = map->fldrv_priv;
-	DECLARE_WAITQUEUE(wait, current);
+	int wbufsize = cfi_interleave(cfi) << cfi->cfiq->MaxBufWriteSize;
 	int ret = 0;
-	int ta = 0;
-	cfi_word ones = 0;
+	int chipnum;
+	unsigned long ofs;
 
- retry:
-	cfi_spin_lock(chip->mutex);
+	*retlen = 0;
+	if (!len)
+		return 0;
 
-	if (chip->state != FL_READY){
-		set_current_state(TASK_UNINTERRUPTIBLE);
-		add_wait_queue(&chip->wq, &wait);
-                
-		cfi_spin_unlock(chip->mutex);
+	chipnum = to >> cfi->chipshift;
+	ofs = to  - (chipnum << cfi->chipshift);
 
-		schedule();
-		remove_wait_queue(&chip->wq, &wait);
-#if 0
-		if(signal_pending(current))
-			return -EINTR;
-#endif
-		timeo = jiffies + HZ;
+	/* If it's not bus-aligned, do the first word write */
+	if (ofs & (map_bankwidth(map)-1)) {
+		size_t local_len = (-ofs)&(map_bankwidth(map)-1);
+		if (local_len > len)
+			local_len = len;
+		ret = cfi_amdstd_write_words(mtd, to, local_len,
+					       retlen, buf);
+		if (ret)
+			return ret;
+		ofs += local_len;
+		buf += local_len;
+		len -= local_len;
 
-		goto retry;
-	}	
+		if (ofs >> cfi->chipshift) {
+			chipnum ++;
+			ofs = 0;
+			if (chipnum == cfi->numchips)
+				return 0;
+		}
+	}
 
-	chip->state = FL_ERASING;
+	/* Write buffer is worth it only if more than one word to write... */
+	while (len >= map_bankwidth(map) * 2) {
+		/* We must not cross write block boundaries */
+		int size = wbufsize - (ofs & (wbufsize-1));
+
+		if (size > len)
+			size = len;
+		if (size % map_bankwidth(map))
+			size -= size % map_bankwidth(map);
+
+		ret = do_write_buffer(map, &cfi->chips[chipnum], 
+				      ofs, buf, size);
+		if (ret)
+			return ret;
+
+		ofs += size;
+		buf += size;
+		(*retlen) += size;
+		len -= size;
+
+		if (ofs >> cfi->chipshift) {
+			chipnum ++; 
+			ofs = 0;
+			if (chipnum == cfi->numchips)
+				return 0;
+		}
+	}
+
+	if (len) {
+		size_t retlen_dregs = 0;
+
+		ret = cfi_amdstd_write_words(mtd, to, len, &retlen_dregs, buf);
+
+		*retlen += retlen_dregs;
+		return ret;
+	}
+
+	return 0;
+}
+
+
+/*
+ * Handle devices with one erase region, that only implement
+ * the chip erase command.
+ */
+static inline int do_erase_chip(struct map_info *map, struct flchip *chip)
+{
+	struct cfi_private *cfi = map->fldrv_priv;
+	unsigned long timeo = jiffies + HZ;
+	unsigned long int adr;
+	DECLARE_WAITQUEUE(wait, current);
+	int ret = 0;
+
+	adr = cfi->addr_unlock1;
+
+	cfi_spin_lock(chip->mutex);
+	ret = get_chip(map, chip, adr, FL_WRITING);
+	if (ret) {
+		cfi_spin_unlock(chip->mutex);
+		return ret;
+	}
 
-	adr += chip->start;
 	DEBUG( MTD_DEBUG_LEVEL3, "MTD %s(): ERASE 0x%.8lx\n",
-	       __func__, adr );
+	       __func__, chip->start );
 
 	ENABLE_VPP(map);
 	cfi_send_gen_cmd(0xAA, cfi->addr_unlock1, chip->start, map, cfi, CFI_DEVICETYPE_X8, NULL);
@@ -1034,155 +1168,85 @@ static inline int do_erase_oneblock(struct map_info *map, struct flchip *chip, u
 	cfi_send_gen_cmd(0x80, cfi->addr_unlock1, chip->start, map, cfi, CFI_DEVICETYPE_X8, NULL);
 	cfi_send_gen_cmd(0xAA, cfi->addr_unlock1, chip->start, map, cfi, CFI_DEVICETYPE_X8, NULL);
 	cfi_send_gen_cmd(0x55, cfi->addr_unlock2, chip->start, map, cfi, CFI_DEVICETYPE_X8, NULL);
+	cfi_send_gen_cmd(0x10, cfi->addr_unlock1, chip->start, map, cfi, CFI_DEVICETYPE_X8, NULL);
 
-	cfi_write(map, CMD(0x30), adr);
-	
-	timeo = jiffies + (HZ*20);
-
-	/* Wait for the end of programing/erasure by using the toggle method.
-	 * As long as there is a programming procedure going on, bit 6
-	 * is toggling it's state with each consecutive read.
-	 * The toggling stops as soon as the procedure is completed.
-	 *
-	 * If the process has gone on for too long on the chip bit 5 gets.
-	 * After bit5 is set you can kill the operation by sending a reset
-	 * command to the chip.
-	 */
-	/* see comments in do_write_oneword */
-	dq6 = CMD(1<<6);
+	chip->state = FL_ERASING;
+	chip->erase_suspended = 0;
+	chip->in_progress_block_addr = adr;
 
-	oldstatus = cfi_read(map, adr);
-	status = cfi_read(map, adr);
-	DEBUG( MTD_DEBUG_LEVEL3, "MTD %s(): Check 0x%.8x 0x%.8x\n",
-	       __func__, oldstatus, status );
+	cfi_spin_unlock(chip->mutex);
+	set_current_state(TASK_UNINTERRUPTIBLE);
+	schedule_timeout((chip->erase_time*HZ)/(2*1000));
+	cfi_spin_lock(chip->mutex);
 
-	while( ( ( status ^ oldstatus ) & dq6 )
-	       && ! ( ta = time_after(jiffies, timeo) ) ) {
-		int wait_reps;
+	timeo = jiffies + (HZ*20);
 
-		/* an initial short sleep */
-		cfi_spin_unlock(chip->mutex);
-		schedule_timeout(HZ/100);
-		cfi_spin_lock(chip->mutex);
-		
+	for (;;) {
 		if (chip->state != FL_ERASING) {
 			/* Someone's suspended the erase. Sleep */
 			set_current_state(TASK_UNINTERRUPTIBLE);
 			add_wait_queue(&chip->wq, &wait);
-			
 			cfi_spin_unlock(chip->mutex);
-			printk(KERN_DEBUG "erase suspended. Sleeping\n");
-			
 			schedule();
 			remove_wait_queue(&chip->wq, &wait);
-#if 0			
-			if (signal_pending(current))
-				return -EINTR;
-#endif			
-			timeo = jiffies + (HZ*2); /* FIXME */
 			cfi_spin_lock(chip->mutex);
 			continue;
 		}
-
-		/* Busy wait for 1/10 of a milisecond */
-		for(wait_reps = 0;
-		    (wait_reps < 100)
-			    && ( ( status ^ oldstatus ) & dq6 );
-		    wait_reps++) {
-			
-			/* Latency issues. Drop the lock, wait a while and retry */
-			cfi_spin_unlock(chip->mutex);
-			
-			cfi_udelay(1);
-		
-			cfi_spin_lock(chip->mutex);
-			oldstatus = cfi_read(map, adr);
-			status = cfi_read(map, adr);
-			DEBUG( MTD_DEBUG_LEVEL3, "MTD %s(): Check 0x%.8x 0x%.8x\n",
-			       __func__, oldstatus, status );
+		if (chip->erase_suspended) {
+			/* This erase was suspended and resumed.
+			   Adjust the timeout */
+			timeo = jiffies + (HZ*20); /* FIXME */
+			chip->erase_suspended = 0;
 		}
-		oldstatus = cfi_read(map, adr);
-		status = cfi_read(map, adr);
-		DEBUG( MTD_DEBUG_LEVEL3, "MTD %s(): Check 0x%.8x 0x%.8x\n",
-		       __func__, oldstatus, status );
-	}
 
-	prev_oldstatus = oldstatus;
-	prev_status = status;
-	oldstatus = cfi_read(map, adr);
-	status = cfi_read(map, adr);
-	DEBUG( MTD_DEBUG_LEVEL3, "MTD %s(): Check 0x%.8x 0x%.8x\n",
-	       __func__, oldstatus, status );
-
-	if ( cfi_buswidth_is_1() ) {
-		ones =  (__u8)~0;
-	} else if ( cfi_buswidth_is_2() ) {
-		ones = (__u16)~0;
-	} else if ( cfi_buswidth_is_4() ) {
-		ones = (__u32)~0;
-	} else {
-		printk(KERN_WARNING "Unsupported buswidth\n");
-		goto erase_failed;
-	}
+		if (chip_ready(map, adr))
+			goto op_done;
 
-	if ( oldstatus == ones && status == ones ) {
-		/* success - do nothing */
-		goto erase_done;
-	}
+		if (time_after(jiffies, timeo))
+			break;
 
-	if ( ta ) {
-		int dq5mask = ( ( status ^ oldstatus ) & dq6 ) >> 1;
-		if ( status & dq5mask ) {
-			/* dq5 asserted - decode interleave chips */
-			printk( KERN_WARNING
-				"MTD %s(): FLASH internal timeout: 0x%.8x\n",
-				__func__,
-				status & dq5mask );
-		} else {
-			printk( KERN_WARNING
-				"MTD %s(): Software timed out during write.\n",
-				__func__ );
-		}
-		goto erase_failed;
+		/* Latency issues. Drop the lock, wait a while and retry */
+		cfi_spin_unlock(chip->mutex);
+		set_current_state(TASK_UNINTERRUPTIBLE);
+		schedule_timeout(1);
+		cfi_spin_lock(chip->mutex);
 	}
 
-	printk(KERN_WARNING
-	       "MTD %s(): Wacky!  Unable to decode failure status\n",
+	printk(KERN_WARNING "MTD %s(): software timeout\n",
 	       __func__ );
 
-	printk(KERN_WARNING
-	       "MTD %s(): 0x%.8lx(0x%.8x): 0x%.8x 0x%.8x 0x%.8x 0x%.8x\n",
-	       __func__, adr, ones,
-	       prev_oldstatus, prev_status,
-	       oldstatus, status);
-
- erase_failed:
-	ret = -EIO;
 	/* reset on all failures. */
-	cfi_write( map, CMD(0xF0), chip->start );
+	map_write( map, CMD(0xF0), chip->start );
 	/* FIXME - should have reset delay before continuing */
 
- erase_done:
-	DISABLE_VPP(map);
+	ret = -EIO;
+ op_done:
 	chip->state = FL_READY;
-	wake_up(&chip->wq);
+	put_chip(map, chip, adr);
 	cfi_spin_unlock(chip->mutex);
+
 	return ret;
 }
 
-static int cfi_amdstd_erase_varsize(struct mtd_info *mtd, struct erase_info *instr)
+
+typedef int (*frob_t)(struct map_info *map, struct flchip *chip,
+		      unsigned long adr, void *thunk);
+
+
+static int cfi_amdstd_varsize_frob(struct mtd_info *mtd, frob_t frob,
+				   loff_t ofs, size_t len, void *thunk)
 {
 	struct map_info *map = mtd->priv;
 	struct cfi_private *cfi = map->fldrv_priv;
-	unsigned long adr, len;
+	unsigned long adr;
 	int chipnum, ret = 0;
 	int i, first;
 	struct mtd_erase_region_info *regions = mtd->eraseregions;
 
-	if (instr->addr > mtd->size)
+	if (ofs > mtd->size)
 		return -EINVAL;
 
-	if ((instr->len + instr->addr) > mtd->size)
+	if ((len + ofs) > mtd->size)
 		return -EINVAL;
 
 	/* Check that both start and end of the requested erase are
@@ -1197,7 +1261,7 @@ static int cfi_amdstd_erase_varsize(struct mtd_info *mtd, struct erase_info *ins
 	   start of the requested erase, and then go back one.
 	*/
 	
-	while (i < mtd->numeraseregions && instr->addr >= regions[i].offset)
+	while (i < mtd->numeraseregions && ofs >= regions[i].offset)
 	       i++;
 	i--;
 
@@ -1207,7 +1271,7 @@ static int cfi_amdstd_erase_varsize(struct mtd_info *mtd, struct erase_info *ins
 	   effect here.
 	*/
 
-	if (instr->addr & (regions[i].erasesize-1))
+	if (ofs & (regions[i].erasesize-1))
 		return -EINVAL;
 
 	/* Remember the erase region we start on */
@@ -1217,7 +1281,7 @@ static int cfi_amdstd_erase_varsize(struct mtd_info *mtd, struct erase_info *ins
 	 * with the erase region at that address.
 	 */
 
-	while (i<mtd->numeraseregions && (instr->addr + instr->len) >= regions[i].offset)
+	while (i<mtd->numeraseregions && (ofs + len) >= regions[i].offset)
 		i++;
 
 	/* As before, drop back one to point at the region in which
@@ -1225,18 +1289,17 @@ static int cfi_amdstd_erase_varsize(struct mtd_info *mtd, struct erase_info *ins
 	*/
 	i--;
 	
-	if ((instr->addr + instr->len) & (regions[i].erasesize-1))
+	if ((ofs + len) & (regions[i].erasesize-1))
 		return -EINVAL;
-	
-	chipnum = instr->addr >> cfi->chipshift;
-	adr = instr->addr - (chipnum << cfi->chipshift);
-	len = instr->len;
 
-	i=first;
+	chipnum = ofs >> cfi->chipshift;
+	adr = ofs - (chipnum << cfi->chipshift);
 
-	while(len) {
-		ret = do_erase_oneblock(map, &cfi->chips[chipnum], adr);
+	i=first;
 
+	while (len) {
+		ret = (*frob)(map, &cfi->chips[chipnum], adr, thunk);
+		
 		if (ret)
 			return ret;
 
@@ -1255,58 +1318,114 @@ static int cfi_amdstd_erase_varsize(struct mtd_info *mtd, struct erase_info *ins
 		}
 	}
 
-	instr->state = MTD_ERASE_DONE;
-	if (instr->callback)
-		instr->callback(instr);
-	
 	return 0;
 }
 
-static int cfi_amdstd_erase_onesize(struct mtd_info *mtd, struct erase_info *instr)
+
+static inline int do_erase_oneblock(struct map_info *map, struct flchip *chip, unsigned long adr, void *thunk)
 {
-	struct map_info *map = mtd->priv;
 	struct cfi_private *cfi = map->fldrv_priv;
-	unsigned long adr, len;
-	int chipnum, ret = 0;
+	unsigned long timeo = jiffies + HZ;
+	DECLARE_WAITQUEUE(wait, current);
+	int ret = 0;
 
-	if (instr->addr & (mtd->erasesize - 1))
-		return -EINVAL;
+	adr += chip->start;
 
-	if (instr->len & (mtd->erasesize -1))
-		return -EINVAL;
+	cfi_spin_lock(chip->mutex);
+	ret = get_chip(map, chip, adr, FL_ERASING);
+	if (ret) {
+		cfi_spin_unlock(chip->mutex);
+		return ret;
+	}
 
-	if ((instr->len + instr->addr) > mtd->size)
-		return -EINVAL;
+	DEBUG( MTD_DEBUG_LEVEL3, "MTD %s(): ERASE 0x%.8lx\n",
+	       __func__, adr );
 
-	chipnum = instr->addr >> cfi->chipshift;
-	adr = instr->addr - (chipnum << cfi->chipshift);
-	len = instr->len;
+	ENABLE_VPP(map);
+	cfi_send_gen_cmd(0xAA, cfi->addr_unlock1, chip->start, map, cfi, CFI_DEVICETYPE_X8, NULL);
+	cfi_send_gen_cmd(0x55, cfi->addr_unlock2, chip->start, map, cfi, CFI_DEVICETYPE_X8, NULL);
+	cfi_send_gen_cmd(0x80, cfi->addr_unlock1, chip->start, map, cfi, CFI_DEVICETYPE_X8, NULL);
+	cfi_send_gen_cmd(0xAA, cfi->addr_unlock1, chip->start, map, cfi, CFI_DEVICETYPE_X8, NULL);
+	cfi_send_gen_cmd(0x55, cfi->addr_unlock2, chip->start, map, cfi, CFI_DEVICETYPE_X8, NULL);
+	map_write(map, CMD(0x30), adr);
 
-	while(len) {
-		ret = do_erase_oneblock(map, &cfi->chips[chipnum], adr);
+	chip->state = FL_ERASING;
+	chip->erase_suspended = 0;
+	chip->in_progress_block_addr = adr;
+	
+	cfi_spin_unlock(chip->mutex);
+	set_current_state(TASK_UNINTERRUPTIBLE);
+	schedule_timeout((chip->erase_time*HZ)/(2*1000));
+	cfi_spin_lock(chip->mutex);
 
-		if (ret)
-			return ret;
+	timeo = jiffies + (HZ*20);
 
-		adr += mtd->erasesize;
-		len -= mtd->erasesize;
+	for (;;) {
+		if (chip->state != FL_ERASING) {
+			/* Someone's suspended the erase. Sleep */
+			set_current_state(TASK_UNINTERRUPTIBLE);
+			add_wait_queue(&chip->wq, &wait);
+			cfi_spin_unlock(chip->mutex);
+			schedule();
+			remove_wait_queue(&chip->wq, &wait);
+			cfi_spin_lock(chip->mutex);
+			continue;
+		}
+		if (chip->erase_suspended) {
+			/* This erase was suspended and resumed.
+			   Adjust the timeout */
+			timeo = jiffies + (HZ*20); /* FIXME */
+			chip->erase_suspended = 0;
+		}
 
-		if (adr >> cfi->chipshift) {
-			adr = 0;
-			chipnum++;
-			
-			if (chipnum >= cfi->numchips)
+		if (chip_ready(map, adr))
+			goto op_done;
+
+		if (time_after(jiffies, timeo))
 			break;
-		}
+
+		/* Latency issues. Drop the lock, wait a while and retry */
+		cfi_spin_unlock(chip->mutex);
+		set_current_state(TASK_UNINTERRUPTIBLE);
+		schedule_timeout(1);
+		cfi_spin_lock(chip->mutex);
 	}
-		
+	
+	printk(KERN_WARNING "MTD %s(): software timeout\n",
+	       __func__ );
+	
+	/* reset on all failures. */
+	map_write( map, CMD(0xF0), chip->start );
+	/* FIXME - should have reset delay before continuing */
+
+	ret = -EIO;
+ op_done:
+	chip->state = FL_READY;
+	put_chip(map, chip, adr);
+	cfi_spin_unlock(chip->mutex);
+	return ret;
+}
+
+
+int cfi_amdstd_erase_varsize(struct mtd_info *mtd, struct erase_info *instr)
+{
+	unsigned long ofs, len;
+	int ret;
+
+	ofs = instr->addr;
+	len = instr->len;
+
+	ret = cfi_amdstd_varsize_frob(mtd, do_erase_oneblock, ofs, len, NULL);
+	if (ret)
+		return ret;
+
 	instr->state = MTD_ERASE_DONE;
-	if (instr->callback)
-		instr->callback(instr);
+	mtd_erase_callback(instr);
 	
 	return 0;
 }
 
+
 static int cfi_amdstd_erase_chip(struct mtd_info *mtd, struct erase_info *instr)
 {
 	struct map_info *map = mtd->priv;
@@ -1324,12 +1443,12 @@ static int cfi_amdstd_erase_chip(struct mtd_info *mtd, struct erase_info *instr)
 		return ret;
 
 	instr->state = MTD_ERASE_DONE;
-	if (instr->callback)
-		instr->callback(instr);
+	mtd_erase_callback(instr);
 	
 	return 0;
 }
 
+
 static void cfi_amdstd_sync (struct mtd_info *mtd)
 {
 	struct map_info *map = mtd->priv;
@@ -1368,7 +1487,7 @@ static void cfi_amdstd_sync (struct mtd_info *mtd)
 
 			schedule();
 
-		        remove_wait_queue(&chip->wq, &wait);
+			remove_wait_queue(&chip->wq, &wait);
 			
 			goto retry;
 		}
@@ -1427,7 +1546,7 @@ static int cfi_amdstd_suspend(struct mtd_info *mtd)
 	/* Unlock the chips again */
 
 	if (ret) {
-    		for (i--; i >=0; i--) {
+		for (i--; i >=0; i--) {
 			chip = &cfi->chips[i];
 
 			cfi_spin_lock(chip->mutex);
@@ -1443,6 +1562,7 @@ static int cfi_amdstd_suspend(struct mtd_info *mtd)
 	return ret;
 }
 
+
 static void cfi_amdstd_resume(struct mtd_info *mtd)
 {
 	struct map_info *map = mtd->priv;
@@ -1458,7 +1578,7 @@ static void cfi_amdstd_resume(struct mtd_info *mtd)
 		
 		if (chip->state == FL_PM_SUSPENDED) {
 			chip->state = FL_READY;
-			cfi_write(map, CMD(0xF0), chip->start);
+			map_write(map, CMD(0xF0), chip->start);
 			wake_up(&chip->wq);
 		}
 		else
@@ -1468,6 +1588,137 @@ static void cfi_amdstd_resume(struct mtd_info *mtd)
 	}
 }
 
+
+#ifdef DEBUG_LOCK_BITS
+
+static int do_printlockstatus_oneblock(struct map_info *map,
+				       struct flchip *chip,
+				       unsigned long adr,
+				       void *thunk)
+{
+	struct cfi_private *cfi = map->fldrv_priv;
+	int ofs_factor = cfi->interleave * cfi->device_type;
+
+	cfi_send_gen_cmd(0x90, 0x55, 0, map, cfi, cfi->device_type, NULL);
+	printk(KERN_DEBUG "block status register for 0x%08lx is %x\n",
+	       adr, cfi_read_query(map, adr+(2*ofs_factor)));
+	cfi_send_gen_cmd(0xff, 0x55, 0, map, cfi, cfi->device_type, NULL);
+	
+	return 0;
+}
+
+
+#define debug_dump_locks(mtd, frob, ofs, len, thunk) \
+	cfi_amdstd_varsize_frob((mtd), (frob), (ofs), (len), (thunk))
+
+#else
+
+#define debug_dump_locks(...)
+
+#endif /* DEBUG_LOCK_BITS */
+
+
+struct xxlock_thunk {
+	uint8_t val;
+	flstate_t state;
+};
+
+
+#define DO_XXLOCK_ONEBLOCK_LOCK   ((struct xxlock_thunk){0x01, FL_LOCKING})
+#define DO_XXLOCK_ONEBLOCK_UNLOCK ((struct xxlock_thunk){0x00, FL_UNLOCKING})
+
+
+/*
+ * FIXME - this is *very* specific to a particular chip.  It likely won't
+ * work for all chips that require unlock.  It also hasn't been tested
+ * with interleaved chips.
+ */
+static int do_xxlock_oneblock(struct map_info *map, struct flchip *chip, unsigned long adr, void *thunk)
+{
+	struct cfi_private *cfi = map->fldrv_priv;
+	struct xxlock_thunk *xxlt = (struct xxlock_thunk *)thunk;
+	int ret;
+
+	/*
+	 * This is easy because these are writes to registers and not writes
+	 * to flash memory - that means that we don't have to check status
+	 * and timeout.
+	 */
+
+	adr += chip->start;
+	/*
+	 * lock block registers:
+	 * - on 64k boundariesand
+	 * - bit 1 set high
+	 * - block lock registers are 4MiB lower - overflow subtract (danger)
+	 */
+	adr = ((adr & ~0xffff) | 0x2) + ~0x3fffff;
+
+	cfi_spin_lock(chip->mutex);
+	ret = get_chip(map, chip, adr, FL_LOCKING);
+	if (ret) {
+		cfi_spin_unlock(chip->mutex);
+		return ret;
+	}
+
+	chip->state = xxlt->state;
+	map_write(map, CMD(xxlt->val), adr);
+	
+	/* Done and happy. */
+	chip->state = FL_READY;
+	put_chip(map, chip, adr);
+	cfi_spin_unlock(chip->mutex);
+	return 0;
+}
+
+
+static int cfi_amdstd_lock_varsize(struct mtd_info *mtd,
+				   loff_t ofs,
+				   size_t len)
+{
+	int ret;
+
+	DEBUG(MTD_DEBUG_LEVEL3,
+	      "%s: lock status before, ofs=0x%08llx, len=0x%08zX\n",
+	      __func__, ofs, len);
+	debug_dump_locks(mtd, do_printlockstatus_oneblock, ofs, len, 0);
+
+	ret = cfi_amdstd_varsize_frob(mtd, do_xxlock_oneblock, ofs, len,
+				      (void *)&DO_XXLOCK_ONEBLOCK_LOCK);
+	
+	DEBUG(MTD_DEBUG_LEVEL3,
+	      "%s: lock status after, ret=%d\n",
+	      __func__, ret);
+
+	debug_dump_locks(mtd, do_printlockstatus_oneblock, ofs, len, 0);
+
+	return ret;
+}
+
+
+static int cfi_amdstd_unlock_varsize(struct mtd_info *mtd,
+				     loff_t ofs,
+				     size_t len)
+{
+	int ret;
+
+	DEBUG(MTD_DEBUG_LEVEL3,
+	      "%s: lock status before, ofs=0x%08llx, len=0x%08zX\n",
+	      __func__, ofs, len);
+	debug_dump_locks(mtd, do_printlockstatus_oneblock, ofs, len, 0);
+
+	ret = cfi_amdstd_varsize_frob(mtd, do_xxlock_oneblock, ofs, len,
+				      (void *)&DO_XXLOCK_ONEBLOCK_UNLOCK);
+	
+	DEBUG(MTD_DEBUG_LEVEL3,
+	      "%s: lock status after, ret=%d\n",
+	      __func__, ret);
+	debug_dump_locks(mtd, do_printlockstatus_oneblock, ofs, len, 0);
+	
+	return ret;
+}
+
+
 static void cfi_amdstd_destroy(struct mtd_info *mtd)
 {
 	struct map_info *map = mtd->priv;
@@ -1480,21 +1731,23 @@ static void cfi_amdstd_destroy(struct mtd_info *mtd)
 
 static char im_name[]="cfi_cmdset_0002";
 
+
 int __init cfi_amdstd_init(void)
 {
 	inter_module_register(im_name, THIS_MODULE, &cfi_cmdset_0002);
 	return 0;
 }
 
+
 static void __exit cfi_amdstd_exit(void)
 {
 	inter_module_unregister(im_name);
 }
 
+
 module_init(cfi_amdstd_init);
 module_exit(cfi_amdstd_exit);
 
 MODULE_LICENSE("GPL");
 MODULE_AUTHOR("Crossnet Co. <info@crossnet.co.jp> et al.");
 MODULE_DESCRIPTION("MTD chip driver for AMD/Fujitsu flash chips");
-
diff --git a/drivers/mtd/chips/cfi_cmdset_0020.c b/drivers/mtd/chips/cfi_cmdset_0020.c
index 98e58b426..326eaf7a2 100644
--- a/drivers/mtd/chips/cfi_cmdset_0020.c
+++ b/drivers/mtd/chips/cfi_cmdset_0020.c
@@ -4,6 +4,7 @@
  *
  * (C) 2000 Red Hat. GPL'd
  *
+ * $Id: cfi_cmdset_0020.c,v 1.15 2004/08/09 13:19:43 dwmw2 Exp $
  * 
  * 10/10/2000	Nicolas Pitre <nico@cam.org>
  * 	- completely revamped method functions so they are aware and
@@ -38,7 +39,7 @@
 
 static int cfi_staa_read(struct mtd_info *, loff_t, size_t, size_t *, u_char *);
 static int cfi_staa_write_buffers(struct mtd_info *, loff_t, size_t, size_t *, const u_char *);
-static int cfi_staa_writev(struct mtd_info *mtd, const struct iovec *vecs,
+static int cfi_staa_writev(struct mtd_info *mtd, const struct kvec *vecs,
 		unsigned long count, loff_t to, size_t *retlen);
 static int cfi_staa_erase_varsize(struct mtd_info *, struct erase_info *);
 static void cfi_staa_sync (struct mtd_info *);
@@ -116,7 +117,6 @@ struct mtd_info *cfi_cmdset_0020(struct map_info *map, int primary)
 {
 	struct cfi_private *cfi = map->fldrv_priv;
 	int i;
-	__u32 base = cfi->chips[0].start;
 
 	if (cfi->cfi_mode) {
 		/* 
@@ -126,36 +126,11 @@ struct mtd_info *cfi_cmdset_0020(struct map_info *map, int primary)
 		 */
 		__u16 adr = primary?cfi->cfiq->P_ADR:cfi->cfiq->A_ADR;
 		struct cfi_pri_intelext *extp;
-		int ofs_factor = cfi->interleave * cfi->device_type;
 
-                printk(" ST Microelectronics Extended Query Table at 0x%4.4X\n", adr);
-		if (!adr)
+		extp = (struct cfi_pri_intelext*)cfi_read_pri(map, adr, sizeof(*extp), "ST Microelectronics");
+		if (!extp)
 			return NULL;
 
-		/* Switch it into Query Mode */
-		cfi_send_gen_cmd(0x98, 0x55, base, map, cfi, cfi->device_type, NULL);
-
-		extp = kmalloc(sizeof(*extp), GFP_KERNEL);
-		if (!extp) {
-			printk(KERN_ERR "Failed to allocate memory\n");
-			return NULL;
-		}
-		
-		/* Read in the Extended Query Table */
-		for (i=0; i<sizeof(*extp); i++) {
-			((unsigned char *)extp)[i] = 
-				cfi_read_query(map, (base+((adr+i)*ofs_factor)));
-		}
-		
-		if (extp->MajorVersion != '1' || 
-                    (extp->MinorVersion < '0' || extp->MinorVersion > '2')) {
-                    printk(KERN_WARNING "  Unknown staa Extended Query "
-                           "version %c.%c.\n",  extp->MajorVersion,
-                           extp->MinorVersion);
-                    kfree(extp);
-                    return NULL;
-		}
-		
 		/* Do some byteswapping if necessary */
 		extp->FeatureSupport = cfi32_to_cpu(extp->FeatureSupport);
 		extp->BlkStatusRegMask = cfi32_to_cpu(extp->BlkStatusRegMask);
@@ -175,8 +150,6 @@ struct mtd_info *cfi_cmdset_0020(struct map_info *map, int primary)
 		cfi->chips[i].erase_time = 1024;
 	}		
 
-	/* Make sure it's in read mode */
-	cfi_send_gen_cmd(0xff, 0x55, base, map, cfi, cfi->device_type, NULL);
 	return cfi_staa_setup(map);
 }
 
@@ -266,7 +239,7 @@ static struct mtd_info *cfi_staa_setup(struct map_info *map)
 
 static inline int do_read_onechip(struct map_info *map, struct flchip *chip, loff_t adr, size_t len, u_char *buf)
 {
-	__u32 status, status_OK;
+	map_word status, status_OK;
 	unsigned long timeo;
 	DECLARE_WAITQUEUE(wait, current);
 	int suspended = 0;
@@ -276,7 +249,7 @@ static inline int do_read_onechip(struct map_info *map, struct flchip *chip, lof
 	adr += chip->start;
 
 	/* Ensure cmd read/writes are aligned. */ 
-	cmd_addr = adr & ~(CFIDEV_BUSWIDTH-1); 
+	cmd_addr = adr & ~(map_bankwidth(map)-1); 
 
 	/* Let's determine this according to the interleave only once */
 	status_OK = CMD(0x80);
@@ -290,33 +263,33 @@ static inline int do_read_onechip(struct map_info *map, struct flchip *chip, lof
 	 */
 	switch (chip->state) {
 	case FL_ERASING:
-		if (!((struct cfi_pri_intelext *)cfi->cmdset_priv)->FeatureSupport & 2)
+		if (!(((struct cfi_pri_intelext *)cfi->cmdset_priv)->FeatureSupport & 2))
 			goto sleep; /* We don't support erase suspend */
 		
-		cfi_write (map, CMD(0xb0), cmd_addr);
+		map_write (map, CMD(0xb0), cmd_addr);
 		/* If the flash has finished erasing, then 'erase suspend'
 		 * appears to make some (28F320) flash devices switch to
 		 * 'read' mode.  Make sure that we switch to 'read status'
 		 * mode so we get the right data. --rmk
 		 */
-		cfi_write(map, CMD(0x70), cmd_addr);
+		map_write(map, CMD(0x70), cmd_addr);
 		chip->oldstate = FL_ERASING;
 		chip->state = FL_ERASE_SUSPENDING;
 		//		printk("Erase suspending at 0x%lx\n", cmd_addr);
 		for (;;) {
-			status = cfi_read(map, cmd_addr);
-			if ((status & status_OK) == status_OK)
+			status = map_read(map, cmd_addr);
+			if (map_word_andequal(map, status, status_OK, status_OK))
 				break;
 			
 			if (time_after(jiffies, timeo)) {
 				/* Urgh */
-				cfi_write(map, CMD(0xd0), cmd_addr);
+				map_write(map, CMD(0xd0), cmd_addr);
 				/* make sure we're in 'read status' mode */
-				cfi_write(map, CMD(0x70), cmd_addr);
+				map_write(map, CMD(0x70), cmd_addr);
 				chip->state = FL_ERASING;
 				spin_unlock_bh(chip->mutex);
 				printk(KERN_ERR "Chip not ready after erase "
-				       "suspended: status = 0x%x\n", status);
+				       "suspended: status = 0x%lx\n", status.x[0]);
 				return -EIO;
 			}
 			
@@ -326,7 +299,7 @@ static inline int do_read_onechip(struct map_info *map, struct flchip *chip, lof
 		}
 		
 		suspended = 1;
-		cfi_write(map, CMD(0xff), cmd_addr);
+		map_write(map, CMD(0xff), cmd_addr);
 		chip->state = FL_READY;
 		break;
 	
@@ -340,13 +313,13 @@ static inline int do_read_onechip(struct map_info *map, struct flchip *chip, lof
 
 	case FL_CFI_QUERY:
 	case FL_JEDEC_QUERY:
-		cfi_write(map, CMD(0x70), cmd_addr);
+		map_write(map, CMD(0x70), cmd_addr);
 		chip->state = FL_STATUS;
 
 	case FL_STATUS:
-		status = cfi_read(map, cmd_addr);
-		if ((status & status_OK) == status_OK) {
-			cfi_write(map, CMD(0xff), cmd_addr);
+		status = map_read(map, cmd_addr);
+		if (map_word_andequal(map, status, status_OK, status_OK)) {
+			map_write(map, CMD(0xff), cmd_addr);
 			chip->state = FL_READY;
 			break;
 		}
@@ -354,7 +327,7 @@ static inline int do_read_onechip(struct map_info *map, struct flchip *chip, lof
 		/* Urgh. Chip not yet ready to talk to us. */
 		if (time_after(jiffies, timeo)) {
 			spin_unlock_bh(chip->mutex);
-			printk(KERN_ERR "waiting for chip to be ready timed out in read. WSM status = %x\n", status);
+			printk(KERN_ERR "waiting for chip to be ready timed out in read. WSM status = %lx\n", status.x[0]);
 			return -EIO;
 		}
 
@@ -389,8 +362,8 @@ static inline int do_read_onechip(struct map_info *map, struct flchip *chip, lof
 		   sending the 0x70 (Read Status) command to an erasing
 		   chip and expecting it to be ignored, that's what we 
 		   do. */
-		cfi_write(map, CMD(0xd0), cmd_addr);
-		cfi_write(map, CMD(0x70), cmd_addr);		
+		map_write(map, CMD(0xd0), cmd_addr);
+		map_write(map, CMD(0x70), cmd_addr);		
 	}
 
 	wake_up(&chip->wq);
@@ -441,16 +414,16 @@ static inline int do_write_buffer(struct map_info *map, struct flchip *chip,
 				  unsigned long adr, const u_char *buf, int len)
 {
 	struct cfi_private *cfi = map->fldrv_priv;
-	__u32 status, status_OK;
+	map_word status, status_OK;
 	unsigned long cmd_adr, timeo;
 	DECLARE_WAITQUEUE(wait, current);
 	int wbufsize, z;
         
         /* M58LW064A requires bus alignment for buffer wriets -- saw */
-        if (adr & (CFIDEV_BUSWIDTH-1))
+        if (adr & (map_bankwidth(map)-1))
             return -EINVAL;
 
-        wbufsize = CFIDEV_INTERLEAVE << cfi->cfiq->MaxBufWriteSize;
+        wbufsize = cfi_interleave(cfi) << cfi->cfiq->MaxBufWriteSize;
         adr += chip->start;
 	cmd_adr = adr & ~(wbufsize-1);
 	
@@ -476,21 +449,21 @@ static inline int do_write_buffer(struct map_info *map, struct flchip *chip,
 		
 	case FL_CFI_QUERY:
 	case FL_JEDEC_QUERY:
-		cfi_write(map, CMD(0x70), cmd_adr);
+		map_write(map, CMD(0x70), cmd_adr);
                 chip->state = FL_STATUS;
 #ifdef DEBUG_CFI_FEATURES
-        printk("%s: 1 status[%x]\n", __FUNCTION__, cfi_read(map, cmd_adr));
+        printk("%s: 1 status[%x]\n", __FUNCTION__, map_read(map, cmd_adr));
 #endif
 
 	case FL_STATUS:
-		status = cfi_read(map, cmd_adr);
-		if ((status & status_OK) == status_OK)
+		status = map_read(map, cmd_adr);
+		if (map_word_andequal(map, status, status_OK, status_OK))
 			break;
 		/* Urgh. Chip not yet ready to talk to us. */
 		if (time_after(jiffies, timeo)) {
 			spin_unlock_bh(chip->mutex);
-                        printk(KERN_ERR "waiting for chip to be ready timed out in buffer write Xstatus = %x, status = %x\n",
-                               status, cfi_read(map, cmd_adr));
+                        printk(KERN_ERR "waiting for chip to be ready timed out in buffer write Xstatus = %lx, status = %lx\n",
+                               status.x[0], map_read(map, cmd_adr).x[0]);
 			return -EIO;
 		}
 
@@ -512,13 +485,13 @@ static inline int do_write_buffer(struct map_info *map, struct flchip *chip,
 	}
 
 	ENABLE_VPP(map);
-	cfi_write(map, CMD(0xe8), cmd_adr);
+	map_write(map, CMD(0xe8), cmd_adr);
 	chip->state = FL_WRITING_TO_BUFFER;
 
 	z = 0;
 	for (;;) {
-		status = cfi_read(map, cmd_adr);
-		if ((status & status_OK) == status_OK)
+		status = map_read(map, cmd_adr);
+		if (map_word_andequal(map, status, status_OK, status_OK))
 			break;
 
 		spin_unlock_bh(chip->mutex);
@@ -528,41 +501,26 @@ static inline int do_write_buffer(struct map_info *map, struct flchip *chip,
 		if (++z > 100) {
 			/* Argh. Not ready for write to buffer */
 			DISABLE_VPP(map);
-                        cfi_write(map, CMD(0x70), cmd_adr);
+                        map_write(map, CMD(0x70), cmd_adr);
 			chip->state = FL_STATUS;
 			spin_unlock_bh(chip->mutex);
-			printk(KERN_ERR "Chip not ready for buffer write. Xstatus = %x\n", status);
+			printk(KERN_ERR "Chip not ready for buffer write. Xstatus = %lx\n", status.x[0]);
 			return -EIO;
 		}
 	}
 
 	/* Write length of data to come */
-	cfi_write(map, CMD(len/CFIDEV_BUSWIDTH-1), cmd_adr );
+	map_write(map, CMD(len/map_bankwidth(map)-1), cmd_adr );
         
 	/* Write data */
-	for (z = 0; z < len; z += CFIDEV_BUSWIDTH) {
-		if (cfi_buswidth_is_1()) {
-			u8 *b = (u8 *)buf;
-
-			map_write8 (map, *b++, adr+z);
-			buf = (const u_char *)b;
-		} else if (cfi_buswidth_is_2()) {
-			u16 *b = (u16 *)buf;
-
-			map_write16 (map, *b++, adr+z);
-			buf = (const u_char *)b;
-		} else if (cfi_buswidth_is_4()) {
-			u32 *b = (u32 *)buf;
-
-			map_write32 (map, *b++, adr+z);
-			buf = (const u_char *)b;
-		} else {
-			DISABLE_VPP(map);
-			return -EINVAL;
-		}
+	for (z = 0; z < len;
+	     z += map_bankwidth(map), buf += map_bankwidth(map)) {
+		map_word d;
+		d = map_word_load(map, buf);
+		map_write(map, d, adr+z);
 	}
 	/* GO GO GO */
-	cfi_write(map, CMD(0xd0), cmd_adr);
+	map_write(map, CMD(0xd0), cmd_adr);
 	chip->state = FL_WRITING;
 
 	spin_unlock_bh(chip->mutex);
@@ -584,16 +542,16 @@ static inline int do_write_buffer(struct map_info *map, struct flchip *chip,
 			continue;
 		}
 
-		status = cfi_read(map, cmd_adr);
-		if ((status & status_OK) == status_OK)
+		status = map_read(map, cmd_adr);
+		if (map_word_andequal(map, status, status_OK, status_OK))
 			break;
 
 		/* OK Still waiting */
 		if (time_after(jiffies, timeo)) {
                         /* clear status */
-                        cfi_write(map, CMD(0x50), cmd_adr);
+                        map_write(map, CMD(0x50), cmd_adr);
                         /* put back into read status register mode */
-                        cfi_write(map, CMD(0x70), adr);
+                        map_write(map, CMD(0x70), adr);
 			chip->state = FL_STATUS;
 			DISABLE_VPP(map);
 			spin_unlock_bh(chip->mutex);
@@ -620,19 +578,18 @@ static inline int do_write_buffer(struct map_info *map, struct flchip *chip,
 	chip->state = FL_STATUS;
 
         /* check for errors: 'lock bit', 'VPP', 'dead cell'/'unerased cell' or 'incorrect cmd' -- saw */
-        if ((status & CMD(0x02)) || (status & CMD(0x08)) ||
-            (status & CMD(0x10)) || (status & CMD(0x20))) {
+        if (map_word_bitsset(map, status, CMD(0x3a))) {
 #ifdef DEBUG_CFI_FEATURES
-            printk("%s: 2 status[%x]\n", __FUNCTION__, status);
+		printk("%s: 2 status[%lx]\n", __FUNCTION__, status.x[0]);
 #endif
-            /* clear status */
-            cfi_write(map, CMD(0x50), cmd_adr);
-            /* put back into read status register mode */
-            cfi_write(map, CMD(0x70), adr);
-            wake_up(&chip->wq);
-            spin_unlock_bh(chip->mutex);
-            return (status & CMD(0x02)) ? -EROFS : -EIO;
-        }
+		/* clear status */
+		map_write(map, CMD(0x50), cmd_adr);
+		/* put back into read status register mode */
+		map_write(map, CMD(0x70), adr);
+		wake_up(&chip->wq);
+		spin_unlock_bh(chip->mutex);
+		return map_word_bitsset(map, status, CMD(0x02)) ? -EROFS : -EIO;
+	}
 	wake_up(&chip->wq);
 	spin_unlock_bh(chip->mutex);
 
@@ -644,7 +601,7 @@ static int cfi_staa_write_buffers (struct mtd_info *mtd, loff_t to,
 {
 	struct map_info *map = mtd->priv;
 	struct cfi_private *cfi = map->fldrv_priv;
-	int wbufsize = CFIDEV_INTERLEAVE << cfi->cfiq->MaxBufWriteSize;
+	int wbufsize = cfi_interleave(cfi) << cfi->cfiq->MaxBufWriteSize;
 	int ret = 0;
 	int chipnum;
 	unsigned long ofs;
@@ -657,7 +614,7 @@ static int cfi_staa_write_buffers (struct mtd_info *mtd, loff_t to,
 	ofs = to  - (chipnum << cfi->chipshift);
 
 #ifdef DEBUG_CFI_FEATURES
-        printk("%s: CFIDEV_BUSWIDTH[%x]\n", __FUNCTION__, CFIDEV_BUSWIDTH);
+        printk("%s: map_bankwidth(map)[%x]\n", __FUNCTION__, map_bankwidth(map));
         printk("%s: chipnum[%x] wbufsize[%x]\n", __FUNCTION__, chipnum, wbufsize);
         printk("%s: ofs[%x] len[%x]\n", __FUNCTION__, ofs, len);
 #endif
@@ -700,7 +657,7 @@ static int cfi_staa_write_buffers (struct mtd_info *mtd, loff_t to,
 #define ECCBUF_DIV(x) ((x) & ~(ECCBUF_SIZE - 1))
 #define ECCBUF_MOD(x) ((x) &  (ECCBUF_SIZE - 1))
 static int
-cfi_staa_writev(struct mtd_info *mtd, const struct iovec *vecs,
+cfi_staa_writev(struct mtd_info *mtd, const struct kvec *vecs,
 		unsigned long count, loff_t to, size_t *retlen)
 {
 	unsigned long i;
@@ -769,7 +726,7 @@ write_error:
 static inline int do_erase_oneblock(struct map_info *map, struct flchip *chip, unsigned long adr)
 {
 	struct cfi_private *cfi = map->fldrv_priv;
-	__u32 status, status_OK;
+	map_word status, status_OK;
 	unsigned long timeo;
 	int retries = 3;
 	DECLARE_WAITQUEUE(wait, current);
@@ -789,12 +746,12 @@ retry:
 	case FL_CFI_QUERY:
 	case FL_JEDEC_QUERY:
 	case FL_READY:
-		cfi_write(map, CMD(0x70), adr);
+		map_write(map, CMD(0x70), adr);
 		chip->state = FL_STATUS;
 
 	case FL_STATUS:
-		status = cfi_read(map, adr);
-		if ((status & status_OK) == status_OK)
+		status = map_read(map, adr);
+		if (map_word_andequal(map, status, status_OK, status_OK))
 			break;
 		
 		/* Urgh. Chip not yet ready to talk to us. */
@@ -823,11 +780,11 @@ retry:
 
 	ENABLE_VPP(map);
 	/* Clear the status register first */
-	cfi_write(map, CMD(0x50), adr);
+	map_write(map, CMD(0x50), adr);
 
 	/* Now erase */
-	cfi_write(map, CMD(0x20), adr);
-	cfi_write(map, CMD(0xD0), adr);
+	map_write(map, CMD(0x20), adr);
+	map_write(map, CMD(0xD0), adr);
 	chip->state = FL_ERASING;
 	
 	spin_unlock_bh(chip->mutex);
@@ -851,15 +808,15 @@ retry:
 			continue;
 		}
 
-		status = cfi_read(map, adr);
-		if ((status & status_OK) == status_OK)
+		status = map_read(map, adr);
+		if (map_word_andequal(map, status, status_OK, status_OK))
 			break;
 		
 		/* OK Still waiting */
 		if (time_after(jiffies, timeo)) {
-			cfi_write(map, CMD(0x70), adr);
+			map_write(map, CMD(0x70), adr);
 			chip->state = FL_STATUS;
-			printk(KERN_ERR "waiting for erase to complete timed out. Xstatus = %x, status = %x.\n", status, cfi_read(map, adr));
+			printk(KERN_ERR "waiting for erase to complete timed out. Xstatus = %lx, status = %lx.\n", status.x[0], map_read(map, adr).x[0]);
 			DISABLE_VPP(map);
 			spin_unlock_bh(chip->mutex);
 			return -EIO;
@@ -875,43 +832,46 @@ retry:
 	ret = 0;
 
 	/* We've broken this before. It doesn't hurt to be safe */
-	cfi_write(map, CMD(0x70), adr);
+	map_write(map, CMD(0x70), adr);
 	chip->state = FL_STATUS;
-	status = cfi_read(map, adr);
+	status = map_read(map, adr);
 
 	/* check for lock bit */
-	if (status & CMD(0x3a)) {
-		unsigned char chipstatus = status;
-		if (status != CMD(status & 0xff)) {
-			int i;
-			for (i = 1; i<CFIDEV_INTERLEAVE; i++) {
-				      chipstatus |= status >> (cfi->device_type * 8);
+	if (map_word_bitsset(map, status, CMD(0x3a))) {
+		unsigned char chipstatus = status.x[0];
+		if (!map_word_equal(map, status, CMD(chipstatus))) {
+			int i, w;
+			for (w=0; w<map_words(map); w++) {
+				for (i = 0; i<cfi_interleave(cfi); i++) {
+					chipstatus |= status.x[w] >> (cfi->device_type * 8);
+				}
 			}
-			printk(KERN_WARNING "Status is not identical for all chips: 0x%x. Merging to give 0x%02x\n", status, chipstatus);
+			printk(KERN_WARNING "Status is not identical for all chips: 0x%lx. Merging to give 0x%02x\n",
+			       status.x[0], chipstatus);
 		}
 		/* Reset the error bits */
-		cfi_write(map, CMD(0x50), adr);
-		cfi_write(map, CMD(0x70), adr);
+		map_write(map, CMD(0x50), adr);
+		map_write(map, CMD(0x70), adr);
 		
 		if ((chipstatus & 0x30) == 0x30) {
-			printk(KERN_NOTICE "Chip reports improper command sequence: status 0x%x\n", status);
+			printk(KERN_NOTICE "Chip reports improper command sequence: status 0x%x\n", chipstatus);
 			ret = -EIO;
 		} else if (chipstatus & 0x02) {
 			/* Protection bit set */
 			ret = -EROFS;
 		} else if (chipstatus & 0x8) {
 			/* Voltage */
-			printk(KERN_WARNING "Chip reports voltage low on erase: status 0x%x\n", status);
+			printk(KERN_WARNING "Chip reports voltage low on erase: status 0x%x\n", chipstatus);
 			ret = -EIO;
 		} else if (chipstatus & 0x20) {
 			if (retries--) {
-				printk(KERN_DEBUG "Chip erase failed at 0x%08lx: status 0x%x. Retrying...\n", adr, status);
+				printk(KERN_DEBUG "Chip erase failed at 0x%08lx: status 0x%x. Retrying...\n", adr, chipstatus);
 				timeo = jiffies + HZ;
 				chip->state = FL_STATUS;
 				spin_unlock_bh(chip->mutex);
 				goto retry;
 			}
-			printk(KERN_DEBUG "Chip erase failed at 0x%08lx: status 0x%x\n", adr, status);
+			printk(KERN_DEBUG "Chip erase failed at 0x%08lx: status 0x%x\n", adr, chipstatus);
 			ret = -EIO;
 		}
 	}
@@ -1006,8 +966,7 @@ int cfi_staa_erase_varsize(struct mtd_info *mtd, struct erase_info *instr)
 	}
 		
 	instr->state = MTD_ERASE_DONE;
-	if (instr->callback)
-		instr->callback(instr);
+	mtd_erase_callback(instr);
 	
 	return 0;
 }
@@ -1072,7 +1031,7 @@ static void cfi_staa_sync (struct mtd_info *mtd)
 static inline int do_lock_oneblock(struct map_info *map, struct flchip *chip, unsigned long adr)
 {
 	struct cfi_private *cfi = map->fldrv_priv;
-	__u32 status, status_OK;
+	map_word status, status_OK;
 	unsigned long timeo = jiffies + HZ;
 	DECLARE_WAITQUEUE(wait, current);
 
@@ -1090,12 +1049,12 @@ retry:
 	case FL_CFI_QUERY:
 	case FL_JEDEC_QUERY:
 	case FL_READY:
-		cfi_write(map, CMD(0x70), adr);
+		map_write(map, CMD(0x70), adr);
 		chip->state = FL_STATUS;
 
 	case FL_STATUS:
-		status = cfi_read(map, adr);
-		if ((status & status_OK) == status_OK) 
+		status = map_read(map, adr);
+		if (map_word_andequal(map, status, status_OK, status_OK)) 
 			break;
 		
 		/* Urgh. Chip not yet ready to talk to us. */
@@ -1123,8 +1082,8 @@ retry:
 	}
 
 	ENABLE_VPP(map);
-	cfi_write(map, CMD(0x60), adr);
-	cfi_write(map, CMD(0x01), adr);
+	map_write(map, CMD(0x60), adr);
+	map_write(map, CMD(0x01), adr);
 	chip->state = FL_LOCKING;
 	
 	spin_unlock_bh(chip->mutex);
@@ -1137,15 +1096,15 @@ retry:
 	timeo = jiffies + (HZ*2);
 	for (;;) {
 
-		status = cfi_read(map, adr);
-		if ((status & status_OK) == status_OK)
+		status = map_read(map, adr);
+		if (map_word_andequal(map, status, status_OK, status_OK))
 			break;
 		
 		/* OK Still waiting */
 		if (time_after(jiffies, timeo)) {
-			cfi_write(map, CMD(0x70), adr);
+			map_write(map, CMD(0x70), adr);
 			chip->state = FL_STATUS;
-			printk(KERN_ERR "waiting for lock to complete timed out. Xstatus = %x, status = %x.\n", status, cfi_read(map, adr));
+			printk(KERN_ERR "waiting for lock to complete timed out. Xstatus = %lx, status = %lx.\n", status.x[0], map_read(map, adr).x[0]);
 			DISABLE_VPP(map);
 			spin_unlock_bh(chip->mutex);
 			return -EIO;
@@ -1221,7 +1180,7 @@ static int cfi_staa_lock(struct mtd_info *mtd, loff_t ofs, size_t len)
 static inline int do_unlock_oneblock(struct map_info *map, struct flchip *chip, unsigned long adr)
 {
 	struct cfi_private *cfi = map->fldrv_priv;
-	__u32 status, status_OK;
+	map_word status, status_OK;
 	unsigned long timeo = jiffies + HZ;
 	DECLARE_WAITQUEUE(wait, current);
 
@@ -1239,12 +1198,12 @@ retry:
 	case FL_CFI_QUERY:
 	case FL_JEDEC_QUERY:
 	case FL_READY:
-		cfi_write(map, CMD(0x70), adr);
+		map_write(map, CMD(0x70), adr);
 		chip->state = FL_STATUS;
 
 	case FL_STATUS:
-		status = cfi_read(map, adr);
-		if ((status & status_OK) == status_OK)
+		status = map_read(map, adr);
+		if (map_word_andequal(map, status, status_OK, status_OK))
 			break;
 		
 		/* Urgh. Chip not yet ready to talk to us. */
@@ -1272,8 +1231,8 @@ retry:
 	}
 
 	ENABLE_VPP(map);
-	cfi_write(map, CMD(0x60), adr);
-	cfi_write(map, CMD(0xD0), adr);
+	map_write(map, CMD(0x60), adr);
+	map_write(map, CMD(0xD0), adr);
 	chip->state = FL_UNLOCKING;
 	
 	spin_unlock_bh(chip->mutex);
@@ -1286,15 +1245,15 @@ retry:
 	timeo = jiffies + (HZ*2);
 	for (;;) {
 
-		status = cfi_read(map, adr);
-		if ((status & status_OK) == status_OK)
+		status = map_read(map, adr);
+		if (map_word_andequal(map, status, status_OK, status_OK))
 			break;
 		
 		/* OK Still waiting */
 		if (time_after(jiffies, timeo)) {
-			cfi_write(map, CMD(0x70), adr);
+			map_write(map, CMD(0x70), adr);
 			chip->state = FL_STATUS;
-			printk(KERN_ERR "waiting for unlock to complete timed out. Xstatus = %x, status = %x.\n", status, cfi_read(map, adr));
+			printk(KERN_ERR "waiting for unlock to complete timed out. Xstatus = %lx, status = %lx.\n", status.x[0], map_read(map, adr).x[0]);
 			DISABLE_VPP(map);
 			spin_unlock_bh(chip->mutex);
 			return -EIO;
@@ -1423,7 +1382,7 @@ static void cfi_staa_resume(struct mtd_info *mtd)
 		
 		/* Go to known state. Chip may have been power cycled */
 		if (chip->state == FL_PM_SUSPENDED) {
-			cfi_write(map, CMD(0xFF), 0);
+			map_write(map, CMD(0xFF), 0);
 			chip->state = FL_READY;
 			wake_up(&chip->wq);
 		}
@@ -1440,11 +1399,6 @@ static void cfi_staa_destroy(struct mtd_info *mtd)
 	kfree(cfi);
 }
 
-#if LINUX_VERSION_CODE < 0x20212 && defined(MODULE)
-#define cfi_staa_init init_module
-#define cfi_staa_exit cleanup_module
-#endif
-
 static char im_name[]="cfi_cmdset_0020";
 
 int __init cfi_staa_init(void)
diff --git a/drivers/mtd/chips/cfi_probe.c b/drivers/mtd/chips/cfi_probe.c
index fba4ddf0f..071be4220 100644
--- a/drivers/mtd/chips/cfi_probe.c
+++ b/drivers/mtd/chips/cfi_probe.c
@@ -1,7 +1,7 @@
 /* 
    Common Flash Interface probe code.
    (C) 2000 Red Hat. GPL'd.
-   $Id: cfi_probe.c,v 1.71 2003/05/28 12:51:48 dwmw2 Exp $
+   $Id: cfi_probe.c,v 1.77 2004/07/14 08:38:44 dwmw2 Exp $
 */
 
 #include <linux/config.h>
@@ -26,7 +26,7 @@ static void print_cfi_ident(struct cfi_ident *);
 #endif
 
 static int cfi_probe_chip(struct map_info *map, __u32 base,
-			  struct flchip *chips, struct cfi_private *cfi);
+			  unsigned long *chip_map, struct cfi_private *cfi);
 static int cfi_chip_setup(struct map_info *map, struct cfi_private *cfi);
 
 struct mtd_info *cfi_probe(struct map_info *map);
@@ -35,21 +35,36 @@ struct mtd_info *cfi_probe(struct map_info *map);
    in: interleave,type,mode
    ret: table index, <0 for error
  */
-static inline int qry_present(struct map_info *map, __u32 base,
+static int qry_present(struct map_info *map, __u32 base,
 				struct cfi_private *cfi)
 {
 	int osf = cfi->interleave * cfi->device_type;	// scale factor
+	map_word val;
+	map_word qry;
 
-	if (cfi_read(map,base+osf*0x10)==cfi_build_cmd('Q',map,cfi) &&
-	    cfi_read(map,base+osf*0x11)==cfi_build_cmd('R',map,cfi) &&
-	    cfi_read(map,base+osf*0x12)==cfi_build_cmd('Y',map,cfi))
-		return 1;	// ok !
+	qry =  cfi_build_cmd('Q', map, cfi);
+	val = map_read(map, base + osf*0x10);
 
-	return 0; 	// nothing found
+	if (!map_word_equal(map, qry, val))
+		return 0;
+
+	qry =  cfi_build_cmd('R', map, cfi);
+	val = map_read(map, base + osf*0x11);
+
+	if (!map_word_equal(map, qry, val))
+		return 0;
+
+	qry =  cfi_build_cmd('Y', map, cfi);
+	val = map_read(map, base + osf*0x12);
+
+	if (!map_word_equal(map, qry, val))
+		return 0;
+
+	return 1; 	// nothing found
 }
 
 static int cfi_probe_chip(struct map_info *map, __u32 base,
-			  struct flchip *chips, struct cfi_private *cfi)
+			  unsigned long *chip_map, struct cfi_private *cfi)
 {
 	int i;
 	
@@ -66,6 +81,7 @@ static int cfi_probe_chip(struct map_info *map, __u32 base,
 		return 0;
 	}
 	cfi_send_gen_cmd(0xF0, 0, base, map, cfi, cfi->device_type, NULL);
+	cfi_send_gen_cmd(0xFF, 0, base, map, cfi, cfi->device_type, NULL);
 	cfi_send_gen_cmd(0x98, 0x55, base, map, cfi, cfi->device_type, NULL);
 
 	if (!qry_present(map,base,cfi))
@@ -78,18 +94,25 @@ static int cfi_probe_chip(struct map_info *map, __u32 base,
 	}
 
 	/* Check each previous chip to see if it's an alias */
-	for (i=0; i<cfi->numchips; i++) {
+ 	for (i=0; i < (base >> cfi->chipshift); i++) {
+ 		unsigned long start;
+ 		if(!test_bit(i, chip_map)) {
+			/* Skip location; no valid chip at this address */
+ 			continue; 
+ 		}
+ 		start = i << cfi->chipshift;
 		/* This chip should be in read mode if it's one
 		   we've already touched. */
-		if (qry_present(map,chips[i].start,cfi)) {
+		if (qry_present(map, start, cfi)) {
 			/* Eep. This chip also had the QRY marker. 
 			 * Is it an alias for the new one? */
-			cfi_send_gen_cmd(0xF0, 0, chips[i].start, map, cfi, cfi->device_type, NULL);
+			cfi_send_gen_cmd(0xF0, 0, start, map, cfi, cfi->device_type, NULL);
+			cfi_send_gen_cmd(0xFF, 0, start, map, cfi, cfi->device_type, NULL);
 
 			/* If the QRY marker goes away, it's an alias */
-			if (!qry_present(map, chips[i].start, cfi)) {
+			if (!qry_present(map, start, cfi)) {
 				printk(KERN_DEBUG "%s: Found an alias at 0x%x for the chip at 0x%lx\n",
-				       map->name, base, chips[i].start);
+				       map->name, base, start);
 				return 0;
 			}
 			/* Yes, it's actually got QRY for data. Most 
@@ -97,10 +120,11 @@ static int cfi_probe_chip(struct map_info *map, __u32 base,
 			 * too and if it's the same, assume it's an alias. */
 			/* FIXME: Use other modes to do a proper check */
 			cfi_send_gen_cmd(0xF0, 0, base, map, cfi, cfi->device_type, NULL);
+			cfi_send_gen_cmd(0xFF, 0, start, map, cfi, cfi->device_type, NULL);
 			
 			if (qry_present(map, base, cfi)) {
 				printk(KERN_DEBUG "%s: Found an alias at 0x%x for the chip at 0x%lx\n",
-				       map->name, base, chips[i].start);
+				       map->name, base, start);
 				return 0;
 			}
 		}
@@ -108,21 +132,16 @@ static int cfi_probe_chip(struct map_info *map, __u32 base,
 	
 	/* OK, if we got to here, then none of the previous chips appear to
 	   be aliases for the current one. */
-	if (cfi->numchips == MAX_CFI_CHIPS) {
-		printk(KERN_WARNING"%s: Too many flash chips detected. Increase MAX_CFI_CHIPS from %d.\n", map->name, MAX_CFI_CHIPS);
-		/* Doesn't matter about resetting it to Read Mode - we're not going to talk to it anyway */
-		return -1;
-	}
-	chips[cfi->numchips].start = base;
-	chips[cfi->numchips].state = FL_READY;
+	set_bit((base >> cfi->chipshift), chip_map); /* Update chip map */
 	cfi->numchips++;
 	
 	/* Put it back into Read Mode */
 	cfi_send_gen_cmd(0xF0, 0, base, map, cfi, cfi->device_type, NULL);
+	cfi_send_gen_cmd(0xFF, 0, base, map, cfi, cfi->device_type, NULL);
 
-	printk(KERN_INFO "%s: Found %d x%d devices at 0x%x in %d-bit mode\n",
+	printk(KERN_INFO "%s: Found %d x%d devices at 0x%x in %d-bit bank\n",
 	       map->name, cfi->interleave, cfi->device_type*8, base,
-	       map->buswidth*8);
+	       map->bankwidth*8);
 	
 	return 1;
 }
@@ -150,7 +169,6 @@ static int cfi_chip_setup(struct map_info *map,
 	memset(cfi->cfiq,0,sizeof(struct cfi_ident));	
 	
 	cfi->cfi_mode = CFI_MODE_CFI;
-	cfi->fast_prog=1;		/* CFI supports fast programming */
 	
 	/* Read the CFI info structure */
 	for (i=0; i<(sizeof(struct cfi_ident) + num_erase_regions * 4); i++) {
@@ -180,8 +198,29 @@ static int cfi_chip_setup(struct map_info *map,
 		       (cfi->cfiq->EraseRegionInfo[i] & 0xffff) + 1);
 #endif
 	}
+
+	/* Note we put the device back into Read Mode BEFORE going into Auto
+	 * Select Mode, as some devices support nesting of modes, others
+	 * don't. This way should always work.
+	 * On cmdset 0001 the writes of 0xaa and 0x55 are not needed, and
+	 * so should be treated as nops or illegal (and so put the device
+	 * back into Read Mode, which is a nop in this case).
+	 */
+	cfi_send_gen_cmd(0xf0,     0, base, map, cfi, cfi->device_type, NULL);
+	cfi_send_gen_cmd(0xaa, 0x555, base, map, cfi, cfi->device_type, NULL);
+	cfi_send_gen_cmd(0x55, 0x2aa, base, map, cfi, cfi->device_type, NULL);
+	cfi_send_gen_cmd(0x90, 0x555, base, map, cfi, cfi->device_type, NULL);
+	cfi->mfr = cfi_read_query(map, base);
+	cfi->id = cfi_read_query(map, base + ofs_factor);    
+
 	/* Put it back into Read Mode */
 	cfi_send_gen_cmd(0xF0, 0, base, map, cfi, cfi->device_type, NULL);
+	/* ... even if it's an Intel chip */
+	cfi_send_gen_cmd(0xFF, 0, base, map, cfi, cfi->device_type, NULL);
+
+	printk(KERN_INFO "%s: Found %d x%d devices at 0x%x in %d-bit bank\n",
+	       map->name, cfi->interleave, cfi->device_type*8, base,
+	       map->bankwidth*8);
 
 	return 1;
 }
@@ -241,11 +280,11 @@ static void print_cfi_ident(struct cfi_ident *cfip)
 		printk("No Alternate Algorithm Table\n");
 		
 		
-	printk("Vcc Minimum: %x.%x V\n", cfip->VccMin >> 4, cfip->VccMin & 0xf);
-	printk("Vcc Maximum: %x.%x V\n", cfip->VccMax >> 4, cfip->VccMax & 0xf);
+	printk("Vcc Minimum: %2d.%d V\n", cfip->VccMin >> 4, cfip->VccMin & 0xf);
+	printk("Vcc Maximum: %2d.%d V\n", cfip->VccMax >> 4, cfip->VccMax & 0xf);
 	if (cfip->VppMin) {
-		printk("Vpp Minimum: %x.%x V\n", cfip->VppMin >> 4, cfip->VppMin & 0xf);
-		printk("Vpp Maximum: %x.%x V\n", cfip->VppMax >> 4, cfip->VppMax & 0xf);
+		printk("Vpp Minimum: %2d.%d V\n", cfip->VppMin >> 4, cfip->VppMin & 0xf);
+		printk("Vpp Maximum: %2d.%d V\n", cfip->VppMax >> 4, cfip->VppMax & 0xf);
 	}
 	else
 		printk("No Vpp line\n");
diff --git a/drivers/mtd/chips/chipreg.c b/drivers/mtd/chips/chipreg.c
index 3bc9199d2..1e45df074 100644
--- a/drivers/mtd/chips/chipreg.c
+++ b/drivers/mtd/chips/chipreg.c
@@ -1,5 +1,5 @@
 /*
- * $Id: chipreg.c,v 1.15 2003/05/21 15:15:05 dwmw2 Exp $
+ * $Id: chipreg.c,v 1.16 2003/05/29 09:36:15 dwmw2 Exp $
  *
  * Registration for chip drivers
  *
diff --git a/drivers/mtd/chips/gen_probe.c b/drivers/mtd/chips/gen_probe.c
index bae2fb569..3615fd815 100644
--- a/drivers/mtd/chips/gen_probe.c
+++ b/drivers/mtd/chips/gen_probe.c
@@ -2,7 +2,7 @@
  * Routines common to all CFI-type probes.
  * (C) 2001-2003 Red Hat, Inc.
  * GPL'd
- * $Id: gen_probe.c,v 1.13 2003/06/25 11:50:37 dwmw2 Exp $
+ * $Id: gen_probe.c,v 1.19 2004/07/13 22:33:32 dwmw2 Exp $
  */
 
 #include <linux/kernel.h>
@@ -50,16 +50,15 @@ struct mtd_info *mtd_do_chip_probe(struct map_info *map, struct chip_probe *cp)
 EXPORT_SYMBOL(mtd_do_chip_probe);
 
 
-struct cfi_private *genprobe_ident_chips(struct map_info *map, struct chip_probe *cp)
+static struct cfi_private *genprobe_ident_chips(struct map_info *map, struct chip_probe *cp)
 {
-	unsigned long base=0;
 	struct cfi_private cfi;
 	struct cfi_private *retcfi;
-	struct flchip chip[MAX_CFI_CHIPS];
-	int i;
+	unsigned long *chip_map;
+	int i, j, mapsize;
+	int max_chips;
 
 	memset(&cfi, 0, sizeof(cfi));
-	memset(&chip[0], 0, sizeof(chip));
 
 	/* Call the probetype-specific code with all permutations of 
 	   interleave and device type, etc. */
@@ -80,46 +79,47 @@ struct cfi_private *genprobe_ident_chips(struct map_info *map, struct chip_probe
 		return NULL;
 	}
 #endif
-	chip[0].start = 0;
-	chip[0].state = FL_READY;
 	cfi.chipshift = cfi.cfiq->DevSize;
 
-	switch(cfi.interleave) {
-#ifdef CFIDEV_INTERLEAVE_1
-	case 1:
-		break;
-#endif
-#ifdef CFIDEV_INTERLEAVE_2
-	case 2:
+	if (cfi_interleave_is_1(&cfi)) {
+		;
+	} else if (cfi_interleave_is_2(&cfi)) {
 		cfi.chipshift++;
-		break;
-#endif
-#ifdef CFIDEV_INTERLEAVE_4
-	case 4:
-		cfi.chipshift+=2;
-		break;
-#endif
-	default:
+	} else if (cfi_interleave_is_4((&cfi))) {
+		cfi.chipshift += 2;
+	} else if (cfi_interleave_is_8(&cfi)) {
+		cfi.chipshift += 3;
+	} else {
 		BUG();
 	}
 		
 	cfi.numchips = 1;
 
+	/* 
+	 * Allocate memory for bitmap of valid chips. 
+	 * Align bitmap storage size to full byte. 
+	 */ 
+	max_chips = map->size >> cfi.chipshift;
+	mapsize = (max_chips / 8) + ((max_chips % 8) ? 1 : 0);
+	chip_map = kmalloc(mapsize, GFP_KERNEL);
+	if (!chip_map) {
+		printk(KERN_WARNING "%s: kmalloc failed for CFI chip map\n", map->name);
+		kfree(cfi.cfiq);
+		return NULL;
+	}
+	memset (chip_map, 0, mapsize);
+
+	set_bit(0, chip_map); /* Mark first chip valid */
+
 	/*
 	 * Now probe for other chips, checking sensibly for aliases while
 	 * we're at it. The new_chip probe above should have let the first
 	 * chip in read mode.
-	 *
-	 * NOTE: Here, we're checking if there is room for another chip
-	 *       the same size within the mapping. Therefore, 
-	 *       base + chipsize <= map->size is the correct thing to do, 
-	 *       because, base + chipsize would be the  _first_ byte of the
-	 *       next chip, not the one we're currently pondering.
 	 */
 
-	for (base = (1<<cfi.chipshift); base + (1<<cfi.chipshift) <= map->size;
-	     base += (1<<cfi.chipshift))
-		cp->probe_chip(map, base, &chip[0], &cfi);
+	for (i = 1; i < max_chips; i++) {
+		cp->probe_chip(map, i << cfi.chipshift, chip_map, &cfi);
+	}
 
 	/*
 	 * Now allocate the space for the structures we need to return to 
@@ -131,19 +131,26 @@ struct cfi_private *genprobe_ident_chips(struct map_info *map, struct chip_probe
 	if (!retcfi) {
 		printk(KERN_WARNING "%s: kmalloc failed for CFI private structure\n", map->name);
 		kfree(cfi.cfiq);
+		kfree(chip_map);
 		return NULL;
 	}
 
 	memcpy(retcfi, &cfi, sizeof(cfi));
-	memcpy(&retcfi->chips[0], chip, sizeof(struct flchip) * cfi.numchips);
-
-	/* Fix up the stuff that breaks when you move it */
-	for (i=0; i< retcfi->numchips; i++) {
-		init_waitqueue_head(&retcfi->chips[i].wq);
-		spin_lock_init(&retcfi->chips[i]._spinlock);
-		retcfi->chips[i].mutex = &retcfi->chips[i]._spinlock;
+	memset(&retcfi->chips[0], 0, sizeof(struct flchip) * cfi.numchips);
+
+	for (i = 0, j = 0; (j < cfi.numchips) && (i < max_chips); i++) {
+		if(test_bit(i, chip_map)) {
+			struct flchip *pchip = &retcfi->chips[j++];
+
+			pchip->start = (i << cfi.chipshift);
+			pchip->state = FL_READY;
+			init_waitqueue_head(&pchip->wq);
+			spin_lock_init(&pchip->_spinlock);
+			pchip->mutex = &pchip->_spinlock;
+		}
 	}
 
+	kfree(chip_map);
 	return retcfi;
 }
 
@@ -151,131 +158,27 @@ struct cfi_private *genprobe_ident_chips(struct map_info *map, struct chip_probe
 static int genprobe_new_chip(struct map_info *map, struct chip_probe *cp,
 			     struct cfi_private *cfi)
 {
-	switch (map->buswidth) {
-#ifdef CFIDEV_BUSWIDTH_1		
-	case CFIDEV_BUSWIDTH_1:
-		cfi->interleave = CFIDEV_INTERLEAVE_1;
-
-		cfi->device_type = CFI_DEVICETYPE_X8;
-		if (cp->probe_chip(map, 0, NULL, cfi))
-			return 1;
-
-		cfi->device_type = CFI_DEVICETYPE_X16;
-		if (cp->probe_chip(map, 0, NULL, cfi))
-			return 1;
-		break;			
-#endif /* CFIDEV_BUSWITDH_1 */
-
-#ifdef CFIDEV_BUSWIDTH_2		
-	case CFIDEV_BUSWIDTH_2:
-#ifdef CFIDEV_INTERLEAVE_1
-		cfi->interleave = CFIDEV_INTERLEAVE_1;
-
-		cfi->device_type = CFI_DEVICETYPE_X16;
-		if (cp->probe_chip(map, 0, NULL, cfi))
-			return 1;
-#endif /* CFIDEV_INTERLEAVE_1 */
-#ifdef CFIDEV_INTERLEAVE_2
-		cfi->interleave = CFIDEV_INTERLEAVE_2;
-
-		cfi->device_type = CFI_DEVICETYPE_X8;
-		if (cp->probe_chip(map, 0, NULL, cfi))
-			return 1;
-
-		cfi->device_type = CFI_DEVICETYPE_X16;
-		if (cp->probe_chip(map, 0, NULL, cfi))
-			return 1;
-#endif /* CFIDEV_INTERLEAVE_2 */
-		break;			
-#endif /* CFIDEV_BUSWIDTH_2 */
-
-#ifdef CFIDEV_BUSWIDTH_4
-	case CFIDEV_BUSWIDTH_4:
-#if defined(CFIDEV_INTERLEAVE_1) && defined(SOMEONE_ACTUALLY_MAKES_THESE)
-                cfi->interleave = CFIDEV_INTERLEAVE_1;
-
-                cfi->device_type = CFI_DEVICETYPE_X32;
-		if (cp->probe_chip(map, 0, NULL, cfi))
-			return 1;
-#endif /* CFIDEV_INTERLEAVE_1 */
-#ifdef CFIDEV_INTERLEAVE_2
-		cfi->interleave = CFIDEV_INTERLEAVE_2;
-
-#ifdef SOMEONE_ACTUALLY_MAKES_THESE
-		cfi->device_type = CFI_DEVICETYPE_X32;
-		if (cp->probe_chip(map, 0, NULL, cfi))
-			return 1;
-#endif
-		cfi->device_type = CFI_DEVICETYPE_X16;
-		if (cp->probe_chip(map, 0, NULL, cfi))
-			return 1;
-
-		cfi->device_type = CFI_DEVICETYPE_X8;
-		if (cp->probe_chip(map, 0, NULL, cfi))
-			return 1;
-#endif /* CFIDEV_INTERLEAVE_2 */
-#ifdef CFIDEV_INTERLEAVE_4
-		cfi->interleave = CFIDEV_INTERLEAVE_4;
-
-#ifdef SOMEONE_ACTUALLY_MAKES_THESE
-		cfi->device_type = CFI_DEVICETYPE_X32;
-		if (cp->probe_chip(map, 0, NULL, cfi))
-			return 1;
-#endif
-		cfi->device_type = CFI_DEVICETYPE_X16;
-		if (cp->probe_chip(map, 0, NULL, cfi))
-			return 1;
-
-		cfi->device_type = CFI_DEVICETYPE_X8;
-		if (cp->probe_chip(map, 0, NULL, cfi))
-			return 1;
-#endif /* CFIDEV_INTERLEAVE_4 */
-		break;
-#endif /* CFIDEV_BUSWIDTH_4 */
-
-#ifdef CFIDEV_BUSWIDTH_8
-	case CFIDEV_BUSWIDTH_8:
-#if defined(CFIDEV_INTERLEAVE_2) && defined(SOMEONE_ACTUALLY_MAKES_THESE)
-                cfi->interleave = CFIDEV_INTERLEAVE_2;
-
-                cfi->device_type = CFI_DEVICETYPE_X32;
-		if (cp->probe_chip(map, 0, NULL, cfi))
-			return 1;
-#endif /* CFIDEV_INTERLEAVE_2 */
-#ifdef CFIDEV_INTERLEAVE_4
-		cfi->interleave = CFIDEV_INTERLEAVE_4;
-
-#ifdef SOMEONE_ACTUALLY_MAKES_THESE
-		cfi->device_type = CFI_DEVICETYPE_X32;
-		if (cp->probe_chip(map, 0, NULL, cfi))
-			return 1;
-#endif
-		cfi->device_type = CFI_DEVICETYPE_X16;
-		if (cp->probe_chip(map, 0, NULL, cfi))
-			return 1;
-#endif /* CFIDEV_INTERLEAVE_4 */
-#ifdef CFIDEV_INTERLEAVE_8
-		cfi->interleave = CFIDEV_INTERLEAVE_8;
-
-		cfi->device_type = CFI_DEVICETYPE_X16;
-		if (cp->probe_chip(map, 0, NULL, cfi))
-			return 1;
-
-		cfi->device_type = CFI_DEVICETYPE_X8;
-		if (cp->probe_chip(map, 0, NULL, cfi))
-			return 1;
-#endif /* CFIDEV_INTERLEAVE_8 */
-		break;
-#endif /* CFIDEV_BUSWIDTH_8 */
-
-	default:
-		printk(KERN_WARNING "genprobe_new_chip called with unsupported buswidth %d\n", map->buswidth);
-		return 0;
+	int min_chips = (map_bankwidth(map)/4?:1); /* At most 4-bytes wide. */
+	int max_chips = map_bankwidth(map); /* And minimum 1 */
+	int nr_chips, type;
+
+	for (nr_chips = min_chips; nr_chips <= max_chips; nr_chips <<= 1) {
+
+		if (!cfi_interleave_supported(nr_chips))
+		    continue;
+
+		cfi->interleave = nr_chips;
+
+		for (type = 0; type < 3; type++) {
+			cfi->device_type = 1<<type;
+
+			if (cp->probe_chip(map, 0, NULL, cfi))
+				return 1;
+		}
 	}
 	return 0;
 }
 
-
 typedef struct mtd_info *cfi_cmdset_fn_t(struct map_info *, int);
 
 extern cfi_cmdset_fn_t cfi_cmdset_0001;
diff --git a/drivers/mtd/chips/jedec.c b/drivers/mtd/chips/jedec.c
index a66563541..2dfd53ed3 100644
--- a/drivers/mtd/chips/jedec.c
+++ b/drivers/mtd/chips/jedec.c
@@ -11,7 +11,7 @@
  * not going to guess how to send commands to them, plus I expect they will
  * all speak CFI..
  *
- * $Id: jedec.c,v 1.19 2003/05/29 09:25:23 dwmw2 Exp $
+ * $Id: jedec.c,v 1.21 2004/08/09 13:19:43 dwmw2 Exp $
  */
 
 #include <linux/init.h>
@@ -128,7 +128,7 @@ static struct mtd_info *jedec_probe(struct map_info *map)
    {
       printk("mtd: Increase MAX_JEDEC_CHIPS, too many banks.\n");
       kfree(MTD);
-      return 0;
+      return NULL;
    }
    
    for (Base = 0; Base < map->size; Base += my_bank_size)
@@ -141,7 +141,7 @@ static struct mtd_info *jedec_probe(struct map_info *map)
 	 if (jedec_probe8(map,Base,priv) == 0) {
 		 printk("did recognize jedec chip\n");
 		 kfree(MTD);
-	         return 0;
+	         return NULL;
 	 }
       }
       if (map->buswidth == 2)
@@ -167,7 +167,7 @@ static struct mtd_info *jedec_probe(struct map_info *map)
       {
 	 printk("mtd: Failed. Device has incompatible mixed sector sizes\n");
 	 kfree(MTD);
-	 return 0;
+	 return NULL;
       }      
    }
    
@@ -193,7 +193,7 @@ static struct mtd_info *jedec_probe(struct map_info *map)
       {
 	 printk("mtd: Internal Error, JEDEC not set\n");
 	 kfree(MTD);
-	 return 0;
+	 return NULL;
       }
       
       if (Uniq != 0)
@@ -221,7 +221,7 @@ static struct mtd_info *jedec_probe(struct map_info *map)
    if (!priv->size) {
 	   printk("priv->size is zero\n");
 	   kfree(MTD);
-	   return 0;
+	   return NULL;
    }
    if (priv->size/my_bank_size) {
 	   if (priv->size/my_bank_size == 1) {
@@ -240,7 +240,7 @@ static struct mtd_info *jedec_probe(struct map_info *map)
 		      {
 			 printk("mtd: Failed. Cannot handle unsymmetric banking\n");
 			 kfree(MTD);
-			 return 0;
+			 return NULL;
 		      }      
 		   }
 	   }
@@ -385,7 +385,7 @@ static const struct JEDECTable *jedec_idtoinf(__u8 mfr,__u8 id)
    for (I = 0; JEDEC_table[I].jedec != 0; I++)
       if (JEDEC_table[I].jedec == Id)
 	 return JEDEC_table + I;
-   return 0;
+   return NULL;
 }
 
 // Look for flash using an 8 bit bus interface
@@ -780,8 +780,7 @@ static int flash_erase(struct mtd_info *mtd, struct erase_info *instr)
        	    
    //printk("done\n");
    instr->state = MTD_ERASE_DONE;
-   if (instr->callback)
-	instr->callback(instr);
+   mtd_erase_callback(instr);
    return 0;
    
    #undef flread
diff --git a/drivers/mtd/chips/jedec_probe.c b/drivers/mtd/chips/jedec_probe.c
index 159ccc0b6..daf554c00 100644
--- a/drivers/mtd/chips/jedec_probe.c
+++ b/drivers/mtd/chips/jedec_probe.c
@@ -1,9 +1,11 @@
 /* 
    Common Flash Interface probe code.
    (C) 2000 Red Hat. GPL'd.
-   $Id: jedec_probe.c,v 1.29 2003/05/28 13:57:46 dwmw2 Exp $
+   $Id: jedec_probe.c,v 1.51 2004/07/14 14:44:30 thayne Exp $
    See JEDEC (http://www.jedec.org/) standard JESD21C (section 3.5)
    for the standard this probe goes back to.
+
+   Occasionally maintained by Thayne Harbaugh tharbaugh at lnxi dot com
 */
 
 #include <linux/config.h>
@@ -16,6 +18,7 @@
 #include <linux/errno.h>
 #include <linux/slab.h>
 #include <linux/interrupt.h>
+#include <linux/init.h>
 
 #include <linux/mtd/mtd.h>
 #include <linux/mtd/map.h>
@@ -36,8 +39,13 @@
 
 
 /* AMD */
+#define AM29DL800BB	0x22C8
+#define AM29DL800BT	0x224A
+
 #define AM29F800BB	0x2258
 #define AM29F800BT	0x22D6
+#define AM29LV400BB	0x22BA
+#define AM29LV400BT	0x22B9
 #define AM29LV800BB	0x225B
 #define AM29LV800BT	0x22DA
 #define AM29LV160DT	0x22C4
@@ -58,6 +66,7 @@
 #define AT49BV32XT	0x00C9
 
 /* Fujitsu */
+#define MBM29F040C	0x00A4
 #define MBM29LV650UE	0x22D7
 #define MBM29LV320TE	0x22F6
 #define MBM29LV320BE	0x22F9
@@ -65,6 +74,9 @@
 #define MBM29LV160BE	0x2249
 #define MBM29LV800BA	0x225B
 #define MBM29LV800TA	0x22DA
+#define MBM29LV400TC	0x22B9
+#define MBM29LV400BC	0x22BA
+
 
 /* Intel */
 #define I28F004B3T	0x00d4
@@ -113,6 +125,8 @@
 #define M50FW016	0x002E
 
 /* SST */
+#define SST29EE020	0x0010
+#define SST29LE020	0x0012
 #define SST29EE512	0x005d
 #define SST29LE512	0x003d
 #define SST39LF800	0x2781
@@ -123,6 +137,8 @@
 #define SST39LF040	0x00D7
 #define SST39SF010A	0x00B5
 #define SST39SF020A	0x00B6
+#define SST49LF004B	0x0060
+#define SST49LF008A	0x005a
 #define SST49LF030A	0x001C
 #define SST49LF040A	0x0051
 #define SST49LF080A	0x005B
@@ -213,11 +229,10 @@ struct amd_flash_info {
 	const __u16 dev_id;
 	const char *name;
 	const int DevSize;
-	const int InterfaceDesc;
 	const int NumEraseRegions;
 	const int CmdSet;
-	const __u8 uaddr[3];		/* unlock addrs for 8, 16, 32 modes */
-	const ulong regions[4];
+	const __u8 uaddr[4];		/* unlock addrs for 8, 16, 32, 64 */
+	const ulong regions[6];
 };
 
 #define ERASEINFO(size,blocks) (size<<8)|(blocks-1)
@@ -285,6 +300,40 @@ static const struct amd_flash_info jedec_table[] = {
 			ERASEINFO(0x08000,1),
 			ERASEINFO(0x10000,31)
 		}
+	}, {
+		.mfr_id		= MANUFACTURER_AMD,
+		.dev_id		= AM29LV400BB,
+		.name		= "AMD AM29LV400BB",
+		.uaddr		= {
+			[0] = MTD_UADDR_0x0AAA_0x0555,  /* x8 */
+			[1] = MTD_UADDR_0x0555_0x02AA,  /* x16 */
+		},
+		.DevSize	= SIZE_512KiB,
+		.CmdSet		= P_ID_AMD_STD,
+		.NumEraseRegions= 4,
+		.regions	= {
+			ERASEINFO(0x04000,1),
+			ERASEINFO(0x02000,2),
+			ERASEINFO(0x08000,1),
+			ERASEINFO(0x10000,7)
+		}
+	}, {
+		.mfr_id		= MANUFACTURER_AMD,
+		.dev_id		= AM29LV400BT,
+		.name		= "AMD AM29LV400BT",
+		.uaddr		= {
+			[0] = MTD_UADDR_0x0AAA_0x0555,  /* x8 */
+			[1] = MTD_UADDR_0x0555_0x02AA,  /* x16 */
+		},
+		.DevSize	= SIZE_512KiB,
+		.CmdSet		= P_ID_AMD_STD,
+		.NumEraseRegions= 4,
+		.regions	= {
+			ERASEINFO(0x10000,7),
+			ERASEINFO(0x08000,1),
+			ERASEINFO(0x02000,2),
+			ERASEINFO(0x04000,1)
+		}
 	}, {
 		.mfr_id		= MANUFACTURER_AMD,
 		.dev_id		= AM29LV800BB,
@@ -303,6 +352,45 @@ static const struct amd_flash_info jedec_table[] = {
 			ERASEINFO(0x10000,15),
 		}
 	}, {
+/* add DL */
+		.mfr_id		= MANUFACTURER_AMD,
+		.dev_id		= AM29DL800BB,
+		.name		= "AMD AM29DL800BB",
+		.uaddr		= {
+			[0] = MTD_UADDR_0x0AAA_0x0555,  /* x8 */
+			[1] = MTD_UADDR_0x0555_0x02AA,  /* x16 */
+		},
+		.DevSize	= SIZE_1MiB,
+		.CmdSet		= P_ID_AMD_STD,
+		.NumEraseRegions= 6,
+		.regions	= {
+			ERASEINFO(0x04000,1),
+			ERASEINFO(0x08000,1),
+			ERASEINFO(0x02000,4),
+			ERASEINFO(0x08000,1),
+			ERASEINFO(0x04000,1),
+			ERASEINFO(0x10000,14)
+		}
+	}, {
+		.mfr_id		= MANUFACTURER_AMD,
+		.dev_id		= AM29DL800BT,
+		.name		= "AMD AM29DL800BT",
+		.uaddr		= {
+			[0] = MTD_UADDR_0x0AAA_0x0555,  /* x8 */
+			[1] = MTD_UADDR_0x0555_0x02AA,  /* x16 */
+		},
+		.DevSize	= SIZE_1MiB,
+		.CmdSet		= P_ID_AMD_STD,
+		.NumEraseRegions= 6,
+		.regions	= {
+			ERASEINFO(0x10000,14),
+			ERASEINFO(0x04000,1),
+			ERASEINFO(0x08000,1),
+			ERASEINFO(0x02000,4),
+			ERASEINFO(0x08000,1),
+			ERASEINFO(0x04000,1)
+		}
+	}, {
 		.mfr_id		= MANUFACTURER_AMD,
 		.dev_id		= AM29F800BB,
 		.name		= "AMD AM29F800BB",
@@ -505,6 +593,19 @@ static const struct amd_flash_info jedec_table[] = {
 			ERASEINFO(0x10000,63),
 			ERASEINFO(0x02000,8)
 		}
+	}, {
+		.mfr_id		= MANUFACTURER_FUJITSU,
+		.dev_id		= MBM29F040C,
+		.name		= "Fujitsu MBM29F040C",
+		.uaddr		= {
+			[0] = MTD_UADDR_0x0AAA_0x0555, /* x8 */
+		},
+		.DevSize	= SIZE_512KiB,
+		.CmdSet		= P_ID_AMD_STD,
+		.NumEraseRegions= 1,
+		.regions	= {
+			ERASEINFO(0x10000,8)
+		}
 	}, {
 		.mfr_id		= MANUFACTURER_FUJITSU,
 		.dev_id		= MBM29LV650UE,
@@ -616,6 +717,40 @@ static const struct amd_flash_info jedec_table[] = {
 			ERASEINFO(0x02000,2),
 			ERASEINFO(0x04000,1)
 		}
+	}, {
+		.mfr_id		= MANUFACTURER_FUJITSU,
+		.dev_id		= MBM29LV400BC,
+		.name		= "Fujitsu MBM29LV400BC",
+		.uaddr		= {
+			[0] = MTD_UADDR_0x0AAA_0x0555,  /* x8 */
+			[1] = MTD_UADDR_0x0555_0x02AA,  /* x16 */
+		},
+		.DevSize	= SIZE_512KiB,
+		.CmdSet		= P_ID_AMD_STD,
+		.NumEraseRegions= 4,
+		.regions	= {
+			ERASEINFO(0x04000,1),
+			ERASEINFO(0x02000,2),
+			ERASEINFO(0x08000,1),
+			ERASEINFO(0x10000,7)
+		}
+	}, {
+		.mfr_id		= MANUFACTURER_FUJITSU,
+		.dev_id		= MBM29LV400TC,
+		.name		= "Fujitsu MBM29LV400TC",
+		.uaddr		= {
+			[0] = MTD_UADDR_0x0AAA_0x0555,  /* x8 */
+			[1] = MTD_UADDR_0x0555_0x02AA,  /* x16 */
+		},
+		.DevSize	= SIZE_512KiB,
+		.CmdSet		= P_ID_AMD_STD,
+		.NumEraseRegions= 4,
+		.regions	= {
+			ERASEINFO(0x10000,7),
+			ERASEINFO(0x08000,1),
+			ERASEINFO(0x02000,2),
+			ERASEINFO(0x04000,1)
+		}
 	}, {
 		.mfr_id		= MANUFACTURER_INTEL,
 		.dev_id		= I28F004B3B,
@@ -1065,6 +1200,30 @@ static const struct amd_flash_info jedec_table[] = {
 			ERASEINFO(0x01000,32),
 		}
         }, {
+		.mfr_id		= MANUFACTURER_SST,
+ 		.dev_id 	= SST29EE020,
+		.name		= "SST 29EE020",
+ 		.uaddr		= {
+			[0] = MTD_UADDR_0x5555_0x2AAA /* x8 */
+		},
+ 		.DevSize	= SIZE_256KiB,
+ 		.CmdSet		= P_ID_SST_PAGE,
+ 		.NumEraseRegions= 1,
+ 		regions: {ERASEINFO(0x01000,64),
+ 		}
+         }, {
+ 		.mfr_id		= MANUFACTURER_SST,
+		.dev_id		= SST29LE020,
+ 		.name		= "SST 29LE020",
+ 		.uaddr		= {
+			[0] = MTD_UADDR_0x5555_0x2AAA /* x8 */
+		},
+ 		.DevSize	= SIZE_256KiB,
+ 		.CmdSet		= P_ID_SST_PAGE,
+ 		.NumEraseRegions= 1,
+ 		regions: {ERASEINFO(0x01000,64),
+ 		}
+	}, {
 		.mfr_id		= MANUFACTURER_SST,
 		.dev_id		= SST39LF020,
 		.name		= "SST 39LF020",
@@ -1116,6 +1275,32 @@ static const struct amd_flash_info jedec_table[] = {
 		.regions	= {
 			ERASEINFO(0x01000,64),
 		}
+	}, {
+		.mfr_id		= MANUFACTURER_SST,
+		.dev_id		= SST49LF004B,
+		.name		= "SST 49LF004B",
+ 		.uaddr		= {
+			[0] = MTD_UADDR_0x5555_0x2AAA /* x8 */
+		},
+		.DevSize	= SIZE_512KiB,
+		.CmdSet		= P_ID_AMD_STD,
+		.NumEraseRegions= 1,
+		.regions	= {
+			ERASEINFO(0x01000,128),
+		}
+	}, {
+		.mfr_id		= MANUFACTURER_SST,
+		.dev_id		= SST49LF008A,
+		.name		= "SST 49LF008A",
+ 		.uaddr		= {
+			[0] = MTD_UADDR_0x5555_0x2AAA /* x8 */
+		},
+		.DevSize	= SIZE_1MiB,
+		.CmdSet		= P_ID_AMD_STD,
+		.NumEraseRegions= 1,
+		.regions	= {
+			ERASEINFO(0x01000,256),
+		}
 	}, {
 		.mfr_id		= MANUFACTURER_SST,
 		.dev_id		= SST49LF030A,
@@ -1392,37 +1577,50 @@ static const struct amd_flash_info jedec_table[] = {
 static int cfi_jedec_setup(struct cfi_private *p_cfi, int index);
 
 static int jedec_probe_chip(struct map_info *map, __u32 base,
-			    struct flchip *chips, struct cfi_private *cfi);
+			    unsigned long *chip_map, struct cfi_private *cfi);
 
 struct mtd_info *jedec_probe(struct map_info *map);
 
 static inline u32 jedec_read_mfr(struct map_info *map, __u32 base, 
 	struct cfi_private *cfi)
 {
-	u32 result, mask;
+	map_word result;
+	unsigned long mask;
 	mask = (1 << (cfi->device_type * 8)) -1;
-	result = cfi_read(map, base);
-	result &= mask;
-	return result;
+	result = map_read(map, base);
+	return result.x[0] & mask;
 }
 
 static inline u32 jedec_read_id(struct map_info *map, __u32 base, 
 	struct cfi_private *cfi)
 {
 	int osf;
-	u32 result, mask;
+	map_word result;
+	unsigned long mask;
 	osf = cfi->interleave *cfi->device_type;
 	mask = (1 << (cfi->device_type * 8)) -1;
-	result = cfi_read(map, base + osf);
-	result &= mask;
-	return result;
+	result = map_read(map, base + osf);
+	return result.x[0] & mask;
 }
 
 static inline void jedec_reset(u32 base, struct map_info *map, 
 	struct cfi_private *cfi)
 {
 	/* Reset */
-	cfi_send_gen_cmd(0xF0, 0, base, map, cfi, cfi->device_type, NULL);
+
+	/* after checking the datasheets for SST, MACRONIX and ATMEL
+	 * (oh and incidentaly the jedec spec - 3.5.3.3) the reset
+	 * sequence is *supposed* to be 0xaa at 0x5555, 0x55 at
+	 * 0x2aaa, 0xF0 at 0x5555 this will not affect the AMD chips
+	 * as they will ignore the writes and dont care what address
+	 * the F0 is written to */
+	if(cfi->addr_unlock1) {
+		/*printk("reset unlock called %x %x \n",cfi->addr_unlock1,cfi->addr_unlock2);*/
+		cfi_send_gen_cmd(0xaa, cfi->addr_unlock1, base, map, cfi, CFI_DEVICETYPE_X8, NULL);
+		cfi_send_gen_cmd(0x55, cfi->addr_unlock2, base, map, cfi, CFI_DEVICETYPE_X8, NULL);
+	}
+
+	cfi_send_gen_cmd(0xF0, cfi->addr_unlock1, base, map, cfi, cfi->device_type, NULL);
 	/* Some misdesigned intel chips do not respond for 0xF0 for a reset,
 	 * so ensure we're in read mode.  Send both the Intel and the AMD command
 	 * for this.  Intel uses 0xff for this, AMD uses 0xff for NOP, so
@@ -1450,6 +1648,12 @@ static inline __u8 finfo_uaddr(const struct amd_flash_info *finfo, int device_ty
 
 	uaddr = finfo->uaddr[uaddr_idx];
 
+	if (uaddr != MTD_UADDR_NOT_SUPPORTED ) {
+		/* ASSERT("The unlock addresses for non-8-bit mode
+		   are bollocks. We don't really need an array."); */
+		uaddr = finfo->uaddr[0];
+	}
+
  uaddr_done:
 	return uaddr;
 }
@@ -1458,6 +1662,7 @@ static inline __u8 finfo_uaddr(const struct amd_flash_info *finfo, int device_ty
 static int cfi_jedec_setup(struct cfi_private *p_cfi, int index)
 {
 	int i,num_erase_regions;
+	unsigned long mask;
 	__u8 uaddr;
 
 	printk("Found: %s\n",jedec_table[index].name);
@@ -1480,19 +1685,22 @@ static int cfi_jedec_setup(struct cfi_private *p_cfi, int index)
 	for (i=0; i<num_erase_regions; i++){
 		p_cfi->cfiq->EraseRegionInfo[i] = jedec_table[index].regions[i];
 	}
-	p_cfi->cmdset_priv = 0;
+	p_cfi->cmdset_priv = NULL;
 
 	/* This may be redundant for some cases, but it doesn't hurt */
 	p_cfi->mfr = jedec_table[index].mfr_id;
 	p_cfi->id = jedec_table[index].dev_id;
 
 	uaddr = finfo_uaddr(&jedec_table[index], p_cfi->device_type);
-	if ( MTD_UADDR_NOT_SUPPORTED ) {
+	if ( uaddr == MTD_UADDR_NOT_SUPPORTED ) {
 		kfree( p_cfi->cfiq );
 		return 0;
 	}
-	p_cfi->addr_unlock1 = unlock_addrs[uaddr].addr1;
-	p_cfi->addr_unlock2 = unlock_addrs[uaddr].addr2;
+
+	/* Mask out address bits which are smaller than the device type */
+	mask = ~(p_cfi->device_type-1);
+	p_cfi->addr_unlock1 = unlock_addrs[uaddr].addr1 & mask;
+	p_cfi->addr_unlock2 = unlock_addrs[uaddr].addr2 & mask;
 
 	return 1; 	/* ok */
 }
@@ -1513,9 +1721,37 @@ static inline int jedec_match( __u32 base,
 	int rc = 0;           /* failure until all tests pass */
 	u32 mfr, id;
 	__u8 uaddr;
+	unsigned long mask;
 
-	/* The ID's must match */
-	if ( cfi->mfr != finfo->mfr_id || cfi->id != finfo->dev_id ) {
+	/*
+	 * The IDs must match.  For X16 and X32 devices operating in
+	 * a lower width ( X8 or X16 ), the device ID's are usually just
+	 * the lower byte(s) of the larger device ID for wider mode.  If
+	 * a part is found that doesn't fit this assumption (device id for
+	 * smaller width mode is completely unrealated to full-width mode)
+	 * then the jedec_table[] will have to be augmented with the IDs
+	 * for different widths.
+	 */
+	switch (cfi->device_type) {
+	case CFI_DEVICETYPE_X8:
+		mfr = (__u8)finfo->mfr_id;
+		id = (__u8)finfo->dev_id;
+		break;
+	case CFI_DEVICETYPE_X16:
+		mfr = (__u16)finfo->mfr_id;
+		id = (__u16)finfo->dev_id;
+		break;
+	case CFI_DEVICETYPE_X32:
+		mfr = (__u16)finfo->mfr_id;
+		id = (__u32)finfo->dev_id;
+		break;
+	default:
+		printk(KERN_WARNING
+		       "MTD %s(): Unsupported device type %d\n",
+		       __func__, cfi->device_type);
+		goto match_done;
+	}
+	if ( cfi->mfr != mfr || cfi->id != id ) {
 		goto match_done;
 	}
 
@@ -1523,7 +1759,7 @@ static inline int jedec_match( __u32 base,
 	DEBUG( MTD_DEBUG_LEVEL3,
 	       "MTD %s(): Check fit 0x%.8x + 0x%.8x = 0x%.8x\n",
 	       __func__, base, 1 << finfo->DevSize, base + (1 << finfo->DevSize) );
-	if ( base + ( 1 << finfo->DevSize ) > map->size ) {
+	if ( base + cfi->interleave * ( 1 << finfo->DevSize ) > map->size ) {
 		DEBUG( MTD_DEBUG_LEVEL3,
 		       "MTD %s(): 0x%.4x 0x%.4x %dKiB doesn't fit\n",
 		       __func__, finfo->mfr_id, finfo->dev_id,
@@ -1532,20 +1768,22 @@ static inline int jedec_match( __u32 base,
 	}
 
 	uaddr = finfo_uaddr(finfo, cfi->device_type);
-	if ( MTD_UADDR_NOT_SUPPORTED ) {
+	if ( uaddr == MTD_UADDR_NOT_SUPPORTED ) {
 		goto match_done;
 	}
 
+	mask = ~(cfi->device_type-1);
+
 	DEBUG( MTD_DEBUG_LEVEL3, "MTD %s(): check unlock addrs 0x%.4x 0x%.4x\n",
 	       __func__, cfi->addr_unlock1, cfi->addr_unlock2 );
 	if ( MTD_UADDR_UNNECESSARY != uaddr && MTD_UADDR_DONT_CARE != uaddr
-	     && ( unlock_addrs[uaddr].addr1 != cfi->addr_unlock1
-		  || unlock_addrs[uaddr].addr2 != cfi->addr_unlock2 ) ) {
+	     && ( (unlock_addrs[uaddr].addr1 & mask) != cfi->addr_unlock1 ||
+		  (unlock_addrs[uaddr].addr2 & mask) != cfi->addr_unlock2 ) ) {
 		DEBUG( MTD_DEBUG_LEVEL3,
-		       "MTD %s(): 0x%.4x 0x%.4x did not match\n",
+		       "MTD %s(): 0x%.4lx 0x%.4lx did not match\n",
 		       __func__,
-		       unlock_addrs[uaddr].addr1,
-		       unlock_addrs[uaddr].addr2 );
+		       unlock_addrs[uaddr].addr1 & mask,
+		       unlock_addrs[uaddr].addr2 & mask);
 		goto match_done;
 	}
 
@@ -1593,41 +1831,25 @@ static inline int jedec_match( __u32 base,
 
 
 static int jedec_probe_chip(struct map_info *map, __u32 base,
-			      struct flchip *chips, struct cfi_private *cfi)
+			    unsigned long *chip_map, struct cfi_private *cfi)
 {
 	int i;
-	int unlockpass = 0;
+	enum uaddr uaddr_idx = MTD_UADDR_NOT_SUPPORTED;
 
-	/*
-	 * FIXME - eventually replace these unlock address seeds with
-	 * information from unlock_addrs[].
-	 */
+ retry:
 	if (!cfi->numchips) {
-		switch (cfi->device_type) {
-		case CFI_DEVICETYPE_X8:
-			cfi->addr_unlock1 = 0x555;
-			cfi->addr_unlock2 = 0x2aa;
-			break;
-		case CFI_DEVICETYPE_X16:
-			cfi->addr_unlock1 = 0xaaa;
-			if (map->buswidth == cfi->interleave) {
-				/* X16 chip(s) in X8 mode */
-				cfi->addr_unlock2 = 0x555;
-			} else {
-				cfi->addr_unlock2 = 0x554;
-			}
-			break;
-		case CFI_DEVICETYPE_X32:
-			cfi->addr_unlock1 = 0x1555; 
-			cfi->addr_unlock2 = 0xaaa; 
-			break;
-		default:
-			printk(KERN_NOTICE "Eep. Unknown jedec_probe device type %d\n", cfi->device_type);
-		return 0;
-		}
+		unsigned long mask = ~(cfi->device_type-1);
+
+		uaddr_idx++;
+
+		if (MTD_UADDR_UNNECESSARY == uaddr_idx)
+			return 0;
+
+		/* Mask out address bits which are smaller than the device type */
+		cfi->addr_unlock1 = unlock_addrs[uaddr_idx].addr1 & mask;
+		cfi->addr_unlock2 = unlock_addrs[uaddr_idx].addr2 & mask;
 	}
 
- retry:
 	/* Make certain we aren't probing past the end of map */
 	if (base >= map->size) {
 		printk(KERN_NOTICE
@@ -1668,7 +1890,8 @@ static int jedec_probe_chip(struct map_info *map, __u32 base,
 		
 		cfi->mfr = jedec_read_mfr(map, base, cfi);
 		cfi->id = jedec_read_id(map, base, cfi);
-		printk(KERN_INFO "Search for id:(%02x %02x) interleave(%d) type(%d)\n", 
+		DEBUG(MTD_DEBUG_LEVEL3,
+		      "Search for id:(%02x %02x) interleave(%d) type(%d)\n", 
 			cfi->mfr, cfi->id, cfi->interleave, cfi->device_type);
 		for (i=0; i<sizeof(jedec_table)/sizeof(jedec_table[0]); i++) {
 			if ( jedec_match( base, map, cfi, &jedec_table[i] ) ) {
@@ -1681,16 +1904,7 @@ static int jedec_probe_chip(struct map_info *map, __u32 base,
 				goto ok_out;
 			}
 		}
-		switch(unlockpass++) {
-		case 0:
-			cfi->addr_unlock1 |= cfi->addr_unlock1 << 4;
-			cfi->addr_unlock2 |= cfi->addr_unlock2 << 4;
-			goto retry;
-		case 1:
-			cfi->addr_unlock1 = cfi->addr_unlock2 = 0;
-			goto retry;
-		}
-		return 0;
+		goto retry;
 	} else {
 		__u16 mfr;
 		__u16 id;
@@ -1707,21 +1921,24 @@ static int jedec_probe_chip(struct map_info *map, __u32 base,
 		}
 	}
 	
-	/* Check each previous chip to see if it's an alias */
-	for (i=0; i<cfi->numchips; i++) {
-		/* This chip should be in read mode if it's one
-		   we've already touched. */
-		if (jedec_read_mfr(map, chips[i].start, cfi) == cfi->mfr &&
-		    jedec_read_id(map, chips[i].start, cfi) == cfi->id) {
+	/* Check each previous chip locations to see if it's an alias */
+	for (i=0; i < (base >> cfi->chipshift); i++) {
+		unsigned long start;
+		if(!test_bit(i, chip_map)) {
+			continue; /* Skip location; no valid chip at this address */
+		}
+		start = i << cfi->chipshift;
+		if (jedec_read_mfr(map, start, cfi) == cfi->mfr &&
+		    jedec_read_id(map, start, cfi) == cfi->id) {
 			/* Eep. This chip also looks like it's in autoselect mode.
 			   Is it an alias for the new one? */
-			jedec_reset(chips[i].start, map, cfi);
+			jedec_reset(start, map, cfi);
 
 			/* If the device IDs go away, it's an alias */
 			if (jedec_read_mfr(map, base, cfi) != cfi->mfr ||
 			    jedec_read_id(map, base, cfi) != cfi->id) {
 				printk(KERN_DEBUG "%s: Found an alias at 0x%x for the chip at 0x%lx\n",
-				       map->name, base, chips[i].start);
+				       map->name, base, start);
 				return 0;
 			}
 			
@@ -1733,7 +1950,7 @@ static int jedec_probe_chip(struct map_info *map, __u32 base,
 			if (jedec_read_mfr(map, base, cfi) == cfi->mfr &&
 			    jedec_read_id(map, base, cfi) == cfi->id) {
 				printk(KERN_DEBUG "%s: Found an alias at 0x%x for the chip at 0x%lx\n",
-				       map->name, base, chips[i].start);
+				       map->name, base, start);
 				return 0;
 			}
 		}
@@ -1741,22 +1958,16 @@ static int jedec_probe_chip(struct map_info *map, __u32 base,
 		
 	/* OK, if we got to here, then none of the previous chips appear to
 	   be aliases for the current one. */
-	if (cfi->numchips == MAX_CFI_CHIPS) {
-		printk(KERN_WARNING"%s: Too many flash chips detected. Increase MAX_CFI_CHIPS from %d.\n", map->name, MAX_CFI_CHIPS);
-		/* Doesn't matter about resetting it to Read Mode - we're not going to talk to it anyway */
-		return -1;
-	}
-	chips[cfi->numchips].start = base;
-	chips[cfi->numchips].state = FL_READY;
+	set_bit((base >> cfi->chipshift), chip_map); /* Update chip map */
 	cfi->numchips++;
 		
 ok_out:
 	/* Put it back into Read Mode */
 	jedec_reset(base, map, cfi);
 
-	printk(KERN_INFO "%s: Found %d x%d devices at 0x%x in %d-bit mode\n",
+	printk(KERN_INFO "%s: Found %d x%d devices at 0x%x in %d-bit bank\n",
 	       map->name, cfi->interleave, cfi->device_type*8, base, 
-	       map->buswidth*8);
+	       map->bankwidth*8);
 	
 	return 1;
 }
diff --git a/drivers/mtd/chips/map_ram.c b/drivers/mtd/chips/map_ram.c
index 7e17b452e..283be02dc 100644
--- a/drivers/mtd/chips/map_ram.c
+++ b/drivers/mtd/chips/map_ram.c
@@ -1,7 +1,7 @@
 /*
  * Common code to handle map devices which are simple RAM
  * (C) 2000 Red Hat. GPL'd.
- * $Id: map_ram.c,v 1.17 2003/05/28 12:51:49 dwmw2 Exp $
+ * $Id: map_ram.c,v 1.20 2004/08/09 13:19:43 dwmw2 Exp $
  */
 
 #include <linux/module.h>
@@ -104,13 +104,17 @@ static int mapram_erase (struct mtd_info *mtd, struct erase_info *instr)
 	/* Yeah, it's inefficient. Who cares? It's faster than a _real_
 	   flash erase. */
 	struct map_info *map = (struct map_info *)mtd->priv;
+	map_word allff;
 	unsigned long i;
 
-	for (i=0; i<instr->len; i++)
-		map_write8(map, 0xFF, instr->addr + i);
+	allff = map_word_ff(map);
 
-	if (instr->callback)
-		instr->callback(instr);
+	for (i=0; i<instr->len; i += map_bankwidth(map))
+		map_write(map, allff, instr->addr + i);
+
+	instr->state = MTD_ERASE_DONE;
+
+	mtd_erase_callback(instr);
 
 	return 0;
 }
diff --git a/drivers/mtd/chips/map_rom.c b/drivers/mtd/chips/map_rom.c
index 8ccf91753..db2e2c6a1 100644
--- a/drivers/mtd/chips/map_rom.c
+++ b/drivers/mtd/chips/map_rom.c
@@ -1,7 +1,7 @@
 /*
  * Common code to handle map devices which are simple ROM
  * (C) 2000 Red Hat. GPL'd.
- * $Id: map_rom.c,v 1.20 2003/05/28 12:51:49 dwmw2 Exp $
+ * $Id: map_rom.c,v 1.21 2004/07/12 14:06:01 dwmw2 Exp $
  */
 
 #include <linux/module.h>
diff --git a/drivers/mtd/chips/sharp.c b/drivers/mtd/chips/sharp.c
index bd0ed8905..c3cf0f63b 100644
--- a/drivers/mtd/chips/sharp.c
+++ b/drivers/mtd/chips/sharp.c
@@ -4,7 +4,7 @@
  * Copyright 2000,2001 David A. Schleef <ds@schleef.org>
  *           2000,2001 Lineo, Inc.
  *
- * $Id: sharp.c,v 1.12 2003/05/28 15:39:52 dwmw2 Exp $
+ * $Id: sharp.c,v 1.14 2004/08/09 13:19:43 dwmw2 Exp $
  *
  * Devices supported:
  *   LH28F016SCT Symmetrical block flash memory, 2Mx8
@@ -425,8 +425,7 @@ static int sharp_erase(struct mtd_info *mtd, struct erase_info *instr)
 	}
 
 	instr->state = MTD_ERASE_DONE;
-	if(instr->callback)
-		instr->callback(instr);
+	mtd_erase_callback(instr);
 
 	return 0;
 }
diff --git a/drivers/mtd/cmdlinepart.c b/drivers/mtd/cmdlinepart.c
index 99d4c4080..4e0f1a7a0 100644
--- a/drivers/mtd/cmdlinepart.c
+++ b/drivers/mtd/cmdlinepart.c
@@ -1,5 +1,5 @@
 /*
- * $Id: cmdlinepart.c,v 1.9 2003/05/16 17:08:24 dwmw2 Exp $
+ * $Id: cmdlinepart.c,v 1.14 2004/07/12 12:34:23 dwmw2 Exp $
  *
  * Read flash partition table from command line
  *
@@ -10,7 +10,7 @@
  * mtdparts=<mtddef>[;<mtddef]
  * <mtddef>  := <mtd-id>:<partdef>[,<partdef>]
  * <partdef> := <size>[@offset][<name>][ro]
- * <mtd-id>  := unique id used in mapping driver/device
+ * <mtd-id>  := unique name used in mapping driver/device (mtd->name)
  * <size>    := standard linux memsize OR "-" to denote all remaining space
  * <name>    := '(' NAME ')'
  * 
@@ -94,7 +94,7 @@ static struct mtd_partition * newpart(char *s,
 		if (size < PAGE_SIZE)
 		{
 			printk(KERN_ERR ERRP "partition size too small (%lx)\n", size);
-			return 0;
+			return NULL;
 		}
 	}
 
@@ -121,7 +121,7 @@ static struct mtd_partition * newpart(char *s,
 		if ((p = strchr(name, delim)) == 0)
 		{
 			printk(KERN_ERR ERRP "no closing %c found in partition name\n", delim);
-			return 0;
+			return NULL;
 		}
 		name_len = p - name;
 		s = p + 1;
@@ -148,12 +148,12 @@ static struct mtd_partition * newpart(char *s,
 		if (size == SIZE_REMAINING)
 		{
 			printk(KERN_ERR ERRP "no partitions allowed after a fill-up partition\n");
-			return 0;
+			return NULL;
 		}
 		/* more partitions follow, parse them */
 		if ((parts = newpart(s + 1, &s, num_parts, 
 		                     this_part + 1, &extra_mem, extra_mem_size)) == 0)
-		  return 0;
+		  return NULL;
 	}
 	else
 	{	/* this is the last partition: allocate space for all */
@@ -166,7 +166,7 @@ static struct mtd_partition * newpart(char *s,
 		if (!parts)
 		{
 			printk(KERN_ERR ERRP "out of memory\n");
-			return 0;
+			return NULL;
 		}
 		memset(parts, 0, alloc_size);
 		extra_mem = (unsigned char *)(parts + *num_parts);
@@ -358,14 +358,7 @@ static int __init cmdline_parser_init(void)
 	return register_mtd_parser(&cmdline_parser);
 }
 
-static void __exit cmdline_parser_exit(void)
-{
-	deregister_mtd_parser(&cmdline_parser);
-}
-
 module_init(cmdline_parser_init);
-module_exit(cmdline_parser_exit);
-
 
 MODULE_LICENSE("GPL");
 MODULE_AUTHOR("Marius Groeger <mag@sysgo.de>");
diff --git a/drivers/mtd/devices/Kconfig b/drivers/mtd/devices/Kconfig
index 1556a1209..ec8cd5bcb 100644
--- a/drivers/mtd/devices/Kconfig
+++ b/drivers/mtd/devices/Kconfig
@@ -1,5 +1,5 @@
 # drivers/mtd/maps/Kconfig
-# $Id: Kconfig,v 1.4 2003/05/28 15:18:54 dwmw2 Exp $
+# $Id: Kconfig,v 1.12 2004/08/10 13:12:18 dwmw2 Exp $
 
 menu "Self-contained MTD device drivers"
 	depends on MTD!=n
@@ -9,9 +9,9 @@ config MTD_PMC551
 	depends on MTD && PCI
 	---help---
 	  This provides a MTD device driver for the Ramix PMC551 RAM PCI card
-	  from Ramix Inc. <http://www.ramix.com/products/>. These devices come
-	  in memory configurations from 32M - 1G.  If you have one, you
-	  probably want to enable this.
+	  from Ramix Inc. <http://www.ramix.com/products/memory/pmc551.html>.
+	  These devices come in memory configurations from 32M - 1G.  If you
+	  have one, you probably want to enable this.
 
 	  If this driver is compiled as a module you get the ability to select
 	  the size of the aperture window pointing into the devices memory.
@@ -40,9 +40,12 @@ config MTD_PMC551_DEBUG
 
 config MTD_MS02NV
 	tristate "DEC MS02-NV NVRAM module support"
-	depends on CONFIG_DECSTATION
+	depends on MTD && MACH_DECSTATION
 	help
-	  Support for NVRAM module on DECstation.
+	  This is an MTD driver for the DEC's MS02-NV (54-20948-01) battery
+	  backed-up NVRAM module.  The module was originally meant as an NFS
+	  accelerator.  Say Y here if you have a DECstation 5000/2x0 or a
+	  DECsystem 5900 equipped with such a module.
 
 config MTD_SLRAM
 	tristate "Uncached system RAM"
@@ -52,6 +55,16 @@ config MTD_SLRAM
 	  you can still use it for storage or swap by using this driver to
 	  present it to the system as a Memory Technology Device.
 
+config MTD_PHRAM
+	tristate "Physical system RAM"
+	depends on MTD
+	help
+	  This is a re-implementation of the slram driver above.
+
+	  Use this driver to access physical memory that the kernel proper
+	  doesn't have access to, memory beyond the mem=xxx limit, nvram,
+	  memory on the video card, etc...
+
 config MTD_LART
 	tristate "28F160xx flash driver for LART"
 	depends on SA1100_LART && MTD
@@ -115,7 +128,7 @@ config MTD_BLKMTD
 comment "Disk-On-Chip Device Drivers"
 
 config MTD_DOC2000
-	tristate "M-Systems Disk-On-Chip 2000 and Millennium"
+	tristate "M-Systems Disk-On-Chip 2000 and Millennium (DEPRECATED)"
 	depends on MTD
 	---help---
 	  This provides an MTD device driver for the M-Systems DiskOnChip
@@ -131,8 +144,12 @@ config MTD_DOC2000
 	  emulate a block device by using a kind of file system on the flash
 	  chips.
 
+	  NOTE: This driver is deprecated and will probably be removed soon.
+	  Please try the new DiskOnChip driver under "NAND Flash Device
+	  Drivers".
+
 config MTD_DOC2001
-	tristate "M-Systems Disk-On-Chip Millennium-only alternative driver (see help)"
+	tristate "M-Systems Disk-On-Chip Millennium-only alternative driver (DEPRECATED)"
 	depends on MTD
 	---help---
 	  This provides an alternative MTD device driver for the M-Systems 
@@ -147,6 +164,10 @@ config MTD_DOC2001
 	  emulate a block device by using a kind of file system on the flash
 	  chips.
 
+	  NOTE: This driver is deprecated and will probably be removed soon.
+	  Please try the new DiskOnChip driver under "NAND Flash Device
+	  Drivers".
+
 config MTD_DOC2001PLUS
 	tristate "M-Systems Disk-On-Chip Millennium Plus"
 	depends on MTD
@@ -159,12 +180,23 @@ config MTD_DOC2001PLUS
 	  to emulate a block device by using a kind of file system on the 
 	  flash chips.
 
+	  NOTE: This driver will soon be replaced by the new DiskOnChip driver
+	  under "NAND Flash Device Drivers" (currently that driver does not
+	  support all Millennium Plus devices).
+
 config MTD_DOCPROBE
 	tristate
-	default m if MTD_DOC2001!=y && MTD_DOC2000!=y && MTD_DOC2001PLUS!=y && (MTD_DOC2001=m || MTD_DOC2000=m || MOD_DOC2001PLUS=m)
+	default m if MTD_DOC2001!=y && MTD_DOC2000!=y && MTD_DOC2001PLUS!=y && (MTD_DOC2001=m || MTD_DOC2000=m || MTD_DOC2001PLUS=m)
 	default y if MTD_DOC2001=y || MTD_DOC2000=y || MTD_DOC2001PLUS=y
 	help
-	  This isn't a real config option, it's derived.
+	  This isn't a real config option; it's derived.
+
+config MTD_DOCECC
+	tristate
+	default m if MTD_DOCPROBE!=y && MTD_NAND_DISKONCHIP!=y && (MTD_DOCPROBE=m || MTD_NAND_DISKONCHIP=m)
+	default y if MTD_DOCPROBE=y || MTD_NAND_DISKONCHIP=y
+	help
+	  This isn't a real config option; it's derived.
 
 config MTD_DOCPROBE_ADVANCED
 	bool "Advanced detection options for DiskOnChip"
diff --git a/drivers/mtd/devices/Makefile b/drivers/mtd/devices/Makefile
index 8ab580b91..3bb872eda 100644
--- a/drivers/mtd/devices/Makefile
+++ b/drivers/mtd/devices/Makefile
@@ -1,7 +1,7 @@
 #
 # linux/drivers/devices/Makefile
 #
-# $Id: Makefile.common,v 1.3 2003/05/28 10:54:23 dwmw2 Exp $
+# $Id: Makefile.common,v 1.6 2004/07/12 16:07:30 dwmw2 Exp $
 
 #                       *** BIG UGLY NOTE ***
 #
@@ -13,8 +13,10 @@
 obj-$(CONFIG_MTD_DOC2000)	+= doc2000.o
 obj-$(CONFIG_MTD_DOC2001)	+= doc2001.o
 obj-$(CONFIG_MTD_DOC2001PLUS)	+= doc2001plus.o
-obj-$(CONFIG_MTD_DOCPROBE)	+= docprobe.o docecc.o
+obj-$(CONFIG_MTD_DOCPROBE)	+= docprobe.o
+obj-$(CONFIG_MTD_DOCECC)	+= docecc.o
 obj-$(CONFIG_MTD_SLRAM)		+= slram.o
+obj-$(CONFIG_MTD_PHRAM)		+= phram.o
 obj-$(CONFIG_MTD_PMC551)	+= pmc551.o
 obj-$(CONFIG_MTD_MS02NV)	+= ms02-nv.o
 obj-$(CONFIG_MTD_MTDRAM)	+= mtdram.o
diff --git a/drivers/mtd/devices/blkmtd.c b/drivers/mtd/devices/blkmtd.c
index 4bd5d3219..a3eb97a94 100644
--- a/drivers/mtd/devices/blkmtd.c
+++ b/drivers/mtd/devices/blkmtd.c
@@ -1,5 +1,5 @@
 /*
- * $Id: blkmtd-25.c,v 1.5 2003/07/16 06:48:27 spse Exp $
+ * $Id: blkmtd.c,v 1.23 2004/08/09 14:03:19 dwmw2 Exp $
  *
  * blkmtd.c - use a block device as a fake MTD
  *
@@ -39,7 +39,7 @@
 
 /* Default erase size in K, always make it a multiple of PAGE_SIZE */
 #define CONFIG_MTD_BLKDEV_ERASESIZE (128 << 10)	/* 128KiB */
-#define VERSION "$Revision: 1.5 $"
+#define VERSION "$Revision: 1.23 $"
 
 /* Info for the block device */
 struct blkmtd_dev {
@@ -246,7 +246,7 @@ static int write_pages(struct blkmtd_dev *dev, const u_char *buf, loff_t to,
 	pagenr = to >> PAGE_SHIFT;
 	offset = to & ~PAGE_MASK;
 
-	DEBUG(2, "blkmtd: write_pages: buf = %p to = %ld len = %d pagenr = %d offset = %d\n",
+	DEBUG(2, "blkmtd: write_pages: buf = %p to = %ld len = %zd pagenr = %d offset = %d\n",
 	      buf, (long)to, len, pagenr, offset);
 
 	/* see if we have to do a partial write at the start */
@@ -270,21 +270,21 @@ static int write_pages(struct blkmtd_dev *dev, const u_char *buf, loff_t to,
 
 	down(&dev->wrbuf_mutex);
 
-	DEBUG(3, "blkmtd: write: start_len = %d len = %d end_len = %d pagecnt = %d\n",
+	DEBUG(3, "blkmtd: write: start_len = %zd len = %zd end_len = %zd pagecnt = %d\n",
 	      start_len, len, end_len, pagecnt);
 
 	if(start_len) {
 		/* do partial start region */
 		struct page *page;
 
-		DEBUG(3, "blkmtd: write: doing partial start, page = %d len = %d offset = %d\n",
+		DEBUG(3, "blkmtd: write: doing partial start, page = %d len = %zd offset = %d\n",
 		      pagenr, start_len, offset);
 
 		BUG_ON(!buf);
 		page = read_cache_page(dev->blkdev->bd_inode->i_mapping, pagenr, (filler_t *)blkmtd_readpage, dev);
 		lock_page(page);
 		if(PageDirty(page)) {
-			err("to = %lld start_len = %d len = %d end_len = %d pagenr = %d\n",
+			err("to = %lld start_len = %zd len = %zd end_len = %zd pagenr = %d\n",
 			    to, start_len, len, end_len, pagenr);
 			BUG();
 		}
@@ -346,13 +346,13 @@ static int write_pages(struct blkmtd_dev *dev, const u_char *buf, loff_t to,
 	if(end_len) {
 		/* do the third region */
 		struct page *page;
-		DEBUG(3, "blkmtd: write: doing partial end, page = %d len = %d\n",
+		DEBUG(3, "blkmtd: write: doing partial end, page = %d len = %zd\n",
 		      pagenr, end_len);
 		BUG_ON(!buf);
 		page = read_cache_page(dev->blkdev->bd_inode->i_mapping, pagenr, (filler_t *)blkmtd_readpage, dev);
 		lock_page(page);
 		if(PageDirty(page)) {
-			err("to = %lld start_len = %d len = %d end_len = %d pagenr = %d\n",
+			err("to = %lld start_len = %zd len = %zd end_len = %zd pagenr = %d\n",
 			    to, start_len, len, end_len, pagenr);
 			BUG();
 		}
@@ -375,7 +375,7 @@ static int write_pages(struct blkmtd_dev *dev, const u_char *buf, loff_t to,
 	if(bio)
 		blkmtd_write_out(bio);
 
-	DEBUG(2, "blkmtd: write: end, retlen = %d, err = %d\n", *retlen, err);
+	DEBUG(2, "blkmtd: write: end, retlen = %zd, err = %d\n", *retlen, err);
 	up(&dev->wrbuf_mutex);
 
 	if(retlen)
@@ -393,14 +393,14 @@ static int blkmtd_erase(struct mtd_info *mtd, struct erase_info *instr)
 	size_t from;
 	u_long len;
 	int err = -EIO;
-	int retlen;
+	size_t retlen;
 
 	instr->state = MTD_ERASING;
 	from = instr->addr;
 	len = instr->len;
 
 	/* check erase region has valid start and length */
-	DEBUG(2, "blkmtd: erase: dev = `%s' from = 0x%x len = 0x%lx\n",
+	DEBUG(2, "blkmtd: erase: dev = `%s' from = 0x%zx len = 0x%lx\n",
 	      mtd->name+9, from, len);
 	while(numregions) {
 		DEBUG(3, "blkmtd: checking erase region = 0x%08X size = 0x%X num = 0x%x\n",
@@ -417,14 +417,14 @@ static int blkmtd_erase(struct mtd_info *mtd, struct erase_info *instr)
 
 	if(!numregions) {
 		/* Not a valid erase block */
-		err("erase: invalid erase request 0x%lX @ 0x%08X", len, from);
+		err("erase: invalid erase request 0x%lX @ 0x%08zX", len, from);
 		instr->state = MTD_ERASE_FAILED;
 		err = -EIO;
 	}
 
 	if(instr->state != MTD_ERASE_FAILED) {
 		/* do the erase */
-		DEBUG(3, "Doing erase from = %d len = %ld\n", from, len);
+		DEBUG(3, "Doing erase from = %zd len = %ld\n", from, len);
 		err = write_pages(dev, NULL, from, len, &retlen);
 		if(err || retlen != len) {
 			err("erase failed err = %d", err);
@@ -435,9 +435,7 @@ static int blkmtd_erase(struct mtd_info *mtd, struct erase_info *instr)
 	}
 
 	DEBUG(3, "blkmtd: erase: checking callback\n");
-	if (instr->callback) {
-		(*(instr->callback))(instr);
-	}
+	mtd_erase_callback(instr);
 	DEBUG(2, "blkmtd: erase: finished (err = %d)\n", err);
 	return err;
 }
@@ -453,8 +451,8 @@ static int blkmtd_read(struct mtd_info *mtd, loff_t from, size_t len,
 	int pagenr, pages;
 	size_t thislen = 0;
 
-	DEBUG(2, "blkmtd: read: dev = `%s' from = %ld len = %d buf = %p\n",
-	      mtd->name+9, (long int)from, len, buf);
+	DEBUG(2, "blkmtd: read: dev = `%s' from = %lld len = %zd buf = %p\n",
+	      mtd->name+9, from, len, buf);
 
 	if(from > mtd->size)
 		return -EINVAL;
@@ -496,7 +494,7 @@ static int blkmtd_read(struct mtd_info *mtd, loff_t from, size_t len,
  readerr:
 	if(retlen)
 		*retlen = thislen;
-	DEBUG(2, "blkmtd: end read: retlen = %d, err = %d\n", thislen, err);
+	DEBUG(2, "blkmtd: end read: retlen = %zd, err = %d\n", thislen, err);
 	return err;
 }
 
@@ -511,8 +509,8 @@ static int blkmtd_write(struct mtd_info *mtd, loff_t to, size_t len,
 	if(!len)
 		return 0;
 
-	DEBUG(2, "blkmtd: write: dev = `%s' to = %ld len = %d buf = %p\n",
-	      mtd->name+9, (long int)to, len, buf);
+	DEBUG(2, "blkmtd: write: dev = `%s' to = %lld len = %zd buf = %p\n",
+	      mtd->name+9, to, len, buf);
 
 	if(to >= mtd->size) {
 		return -ENOSPC;
@@ -565,7 +563,7 @@ static struct mtd_erase_region_info *calc_erase_regions(
 {
 	struct mtd_erase_region_info *info = NULL;
 
-	DEBUG(2, "calc_erase_regions, es = %d size = %d regions = %d\n",
+	DEBUG(2, "calc_erase_regions, es = %zd size = %zd regions = %d\n",
 	      erase_size, total_size, *regions);
 	/* Make any user specified erasesize be a power of 2
 	   and at least PAGE_SIZE */
@@ -613,7 +611,7 @@ static struct mtd_erase_region_info *calc_erase_regions(
 				break;
 		}
 	} while(!(*regions));
-	DEBUG(2, "calc_erase_regions done, es = %d size = %d regions = %d\n",
+	DEBUG(2, "calc_erase_regions done, es = %zd size = %zd regions = %d\n",
 	      erase_size, total_size, *regions);
 	return info;
 }
diff --git a/drivers/mtd/devices/doc2000.c b/drivers/mtd/devices/doc2000.c
index 5cb921d21..fefbf5eaf 100644
--- a/drivers/mtd/devices/doc2000.c
+++ b/drivers/mtd/devices/doc2000.c
@@ -4,7 +4,7 @@
  * (c) 1999 Machine Vision Holdings, Inc.
  * (c) 1999, 2000 David Woodhouse <dwmw2@infradead.org>
  *
- * $Id: doc2000.c,v 1.53 2003/06/11 09:45:19 dwmw2 Exp $
+ * $Id: doc2000.c,v 1.62 2004/08/09 14:04:02 dwmw2 Exp $
  */
 
 #include <linux/kernel.h>
@@ -19,12 +19,14 @@
 #include <linux/sched.h>
 #include <linux/init.h>
 #include <linux/types.h>
+#include <linux/bitops.h>
 
 #include <linux/mtd/mtd.h>
 #include <linux/mtd/nand.h>
 #include <linux/mtd/doc2000.h>
 
 #define DOC_SUPPORT_2000
+#define DOC_SUPPORT_2000TSOP
 #define DOC_SUPPORT_MILLENNIUM
 
 #ifdef DOC_SUPPORT_2000
@@ -33,7 +35,7 @@
 #define DoC_is_2000(doc) (0)
 #endif
 
-#ifdef DOC_SUPPORT_MILLENNIUM
+#if defined(DOC_SUPPORT_2000TSOP) || defined(DOC_SUPPORT_MILLENNIUM)
 #define DoC_is_Millennium(doc) (doc->ChipID == DOC_ChipID_DocMil)
 #else
 #define DoC_is_Millennium(doc) (0)
@@ -53,9 +55,12 @@ static int doc_read(struct mtd_info *mtd, loff_t from, size_t len,
 static int doc_write(struct mtd_info *mtd, loff_t to, size_t len,
 		     size_t *retlen, const u_char *buf);
 static int doc_read_ecc(struct mtd_info *mtd, loff_t from, size_t len,
-			size_t *retlen, u_char *buf, u_char *eccbuf, int oobsel);
+			size_t *retlen, u_char *buf, u_char *eccbuf, struct nand_oobinfo *oobsel);
 static int doc_write_ecc(struct mtd_info *mtd, loff_t to, size_t len,
-			 size_t *retlen, const u_char *buf, u_char *eccbuf, int oobsel);
+			 size_t *retlen, const u_char *buf, u_char *eccbuf, struct nand_oobinfo *oobsel);
+static int doc_writev_ecc(struct mtd_info *mtd, const struct kvec *vecs, 
+			  unsigned long count, loff_t to, size_t *retlen,
+			  u_char *eccbuf, struct nand_oobinfo *oobsel);
 static int doc_read_oob(struct mtd_info *mtd, loff_t ofs, size_t len,
 			size_t *retlen, u_char *buf);
 static int doc_write_oob(struct mtd_info *mtd, loff_t ofs, size_t len,
@@ -92,6 +97,10 @@ static int _DoC_WaitReady(struct DiskOnChip *doc)
 
 	/* Out-of-line routine to wait for chip response */
 	while (!(ReadDOC(docptr, CDSNControl) & CDSN_CTRL_FR_B)) {
+		/* issue 2 read from NOP register after reading from CDSNControl register
+	   	see Software Requirement 11.4 item 2. */
+		DoC_Delay(doc, 2);
+
 		if (time_after(jiffies, timeo)) {
 			DEBUG(MTD_DEBUG_LEVEL2, "_DoC_WaitReady timed out.\n");
 			return -EIO;
@@ -145,6 +154,8 @@ static inline int DoC_Command(struct DiskOnChip *doc, unsigned char command,
 
 	/* Send the command */
 	WriteDOC_(command, docptr, doc->ioreg);
+	if (DoC_is_Millennium(doc))
+		WriteDOC(command, docptr, WritePipeTerm);
 
 	/* Lower the CLE line */
 	WriteDOC(xtraflags | CDSN_CTRL_CE, docptr, CDSNControl);
@@ -206,6 +217,9 @@ static int DoC_Address(struct DiskOnChip *doc, int numbytes, unsigned long ofs,
 		}
 	}
 
+	if (DoC_is_Millennium(doc))
+		WriteDOC(ofs & 0xff, docptr, WritePipeTerm);
+
 	DoC_Delay(doc, 2);	/* Needed for some slow flash chips. mf. */
 	
 	/* FIXME: The SlowIO's for millennium could be replaced by 
@@ -344,15 +358,25 @@ static int DoC_IdentChip(struct DiskOnChip *doc, int floor, int chip)
 
 	/* Read the manufacturer and device id codes from the device */
 
-	/* CDSN Slow IO register see Software Requirement 11.4 item 5. */
-	dummy = ReadDOC(doc->virtadr, CDSNSlowIO);
-	DoC_Delay(doc, 2);
-	mfr = ReadDOC_(doc->virtadr, doc->ioreg);
+	if (DoC_is_Millennium(doc)) {
+		DoC_Delay(doc, 2);
+		dummy = ReadDOC(doc->virtadr, ReadPipeInit);
+		mfr = ReadDOC(doc->virtadr, LastDataRead);
 
-	/* CDSN Slow IO register see Software Requirement 11.4 item 5. */
-	dummy = ReadDOC(doc->virtadr, CDSNSlowIO);
-	DoC_Delay(doc, 2);
-	id = ReadDOC_(doc->virtadr, doc->ioreg);
+		DoC_Delay(doc, 2);
+		dummy = ReadDOC(doc->virtadr, ReadPipeInit);
+		id = ReadDOC(doc->virtadr, LastDataRead);
+	} else {
+		/* CDSN Slow IO register see Software Req 11.4 item 5. */
+		dummy = ReadDOC(doc->virtadr, CDSNSlowIO);
+		DoC_Delay(doc, 2);
+		mfr = ReadDOC_(doc->virtadr, doc->ioreg);
+
+		/* CDSN Slow IO register see Software Req 11.4 item 5. */
+		dummy = ReadDOC(doc->virtadr, CDSNSlowIO);
+		DoC_Delay(doc, 2);
+		id = ReadDOC_(doc->virtadr, doc->ioreg);
+	}
 
 	/* No response - return failure */
 	if (mfr == 0xff || mfr == 0)
@@ -386,11 +410,10 @@ static int DoC_IdentChip(struct DiskOnChip *doc, int floor, int chip)
 			if (!doc->mfr) {
 				doc->mfr = mfr;
 				doc->id = id;
-				doc->chipshift =
-				    nand_flash_ids[i].chipshift;
-				doc->page256 = nand_flash_ids[i].page256;
-				doc->pageadrlen =
-				    nand_flash_ids[i].chipshift > 25 ? 3 : 2;
+				doc->chipshift = 
+					ffs((nand_flash_ids[i].chipsize << 20)) - 1;
+				doc->page256 = (nand_flash_ids[i].pagesize == 256) ? 1 : 0;
+				doc->pageadrlen = doc->chipshift > 25 ? 3 : 2;
 				doc->erasesize =
 				    nand_flash_ids[i].erasesize;
 				return 1;
@@ -410,20 +433,16 @@ static int DoC_IdentChip(struct DiskOnChip *doc, int floor, int chip)
 
 /* DoC_ScanChips: Find all NAND chips present in a DiskOnChip, and identify them */
 
-static void DoC_ScanChips(struct DiskOnChip *this)
+static void DoC_ScanChips(struct DiskOnChip *this, int maxchips)
 {
 	int floor, chip;
 	int numchips[MAX_FLOORS];
-	int maxchips = MAX_CHIPS;
 	int ret = 1;
 
 	this->numchips = 0;
 	this->mfr = 0;
 	this->id = 0;
 
-	if (DoC_is_Millennium(this))
-		maxchips = MAX_CHIPS_MIL;
-
 	/* For each floor, find the number of valid chips it contains */
 	for (floor = 0; floor < MAX_FLOORS; floor++) {
 		ret = 1;
@@ -515,6 +534,7 @@ static void DoC2k_init(struct mtd_info *mtd)
 {
 	struct DiskOnChip *this = (struct DiskOnChip *) mtd->priv;
 	struct DiskOnChip *old = NULL;
+	int maxchips;
 
 	/* We must avoid being called twice for the same device. */
 
@@ -538,14 +558,28 @@ static void DoC2k_init(struct mtd_info *mtd)
 
 
 	switch (this->ChipID) {
+	case DOC_ChipID_Doc2kTSOP:
+		mtd->name = "DiskOnChip 2000 TSOP";
+		this->ioreg = DoC_Mil_CDSN_IO;
+		/* Pretend it's a Millennium */
+		this->ChipID = DOC_ChipID_DocMil;
+		maxchips = MAX_CHIPS;
+		break;
 	case DOC_ChipID_Doc2k:
 		mtd->name = "DiskOnChip 2000";
 		this->ioreg = DoC_2k_CDSN_IO;
+		maxchips = MAX_CHIPS;
 		break;
 	case DOC_ChipID_DocMil:
 		mtd->name = "DiskOnChip Millennium";
 		this->ioreg = DoC_Mil_CDSN_IO;
+		maxchips = MAX_CHIPS_MIL;
 		break;
+	default:
+		printk("Unknown ChipID 0x%02x\n", this->ChipID);
+		kfree(mtd);
+		iounmap((void *) this->virtadr);
+		return;
 	}
 
 	printk(KERN_NOTICE "%s found at address 0x%lX\n", mtd->name,
@@ -566,6 +600,7 @@ static void DoC2k_init(struct mtd_info *mtd)
 	mtd->write = doc_write;
 	mtd->read_ecc = doc_read_ecc;
 	mtd->write_ecc = doc_write_ecc;
+	mtd->writev_ecc = doc_writev_ecc;
 	mtd->read_oob = doc_read_oob;
 	mtd->write_oob = doc_write_oob;
 	mtd->sync = NULL;
@@ -578,7 +613,7 @@ static void DoC2k_init(struct mtd_info *mtd)
 	init_MUTEX(&this->lock);
 
 	/* Ident all the chips present. */
-	DoC_ScanChips(this);
+	DoC_ScanChips(this, maxchips);
 
 	if (!this->totlen) {
 		kfree(mtd);
@@ -597,11 +632,11 @@ static int doc_read(struct mtd_info *mtd, loff_t from, size_t len,
 		    size_t * retlen, u_char * buf)
 {
 	/* Just a special case of doc_read_ecc */
-	return doc_read_ecc(mtd, from, len, retlen, buf, NULL, 0);
+	return doc_read_ecc(mtd, from, len, retlen, buf, NULL, NULL);
 }
 
 static int doc_read_ecc(struct mtd_info *mtd, loff_t from, size_t len,
-			size_t * retlen, u_char * buf, u_char * eccbuf, int oobsel)
+			size_t * retlen, u_char * buf, u_char * eccbuf, struct nand_oobinfo *oobsel)
 {
 	struct DiskOnChip *this = (struct DiskOnChip *) mtd->priv;
 	unsigned long docptr;
@@ -609,6 +644,7 @@ static int doc_read_ecc(struct mtd_info *mtd, loff_t from, size_t len,
 	unsigned char syndrome[6];
 	volatile char dummy;
 	int i, len256 = 0, ret=0;
+	size_t left = len;
 
 	docptr = this->virtadr;
 
@@ -618,122 +654,131 @@ static int doc_read_ecc(struct mtd_info *mtd, loff_t from, size_t len,
 
 	down(&this->lock);
 
-	/* Don't allow a single read to cross a 512-byte block boundary */
-	if (from + len > ((from | 0x1ff) + 1))
-		len = ((from | 0x1ff) + 1) - from;
-
-	/* The ECC will not be calculated correctly if less than 512 is read */
-	if (len != 0x200 && eccbuf)
-		printk(KERN_WARNING
-		       "ECC needs a full sector read (adr: %lx size %lx)\n",
-		       (long) from, (long) len);
-
-	/* printk("DoC_Read (adr: %lx size %lx)\n", (long) from, (long) len); */
+	*retlen = 0;
+	while (left) {
+		len = left;
 
+		/* Don't allow a single read to cross a 512-byte block boundary */
+		if (from + len > ((from | 0x1ff) + 1))
+			len = ((from | 0x1ff) + 1) - from;
 
-	/* Find the chip which is to be used and select it */
-	mychip = &this->chips[from >> (this->chipshift)];
+		/* The ECC will not be calculated correctly if less than 512 is read */
+		if (len != 0x200 && eccbuf)
+			printk(KERN_WARNING
+			       "ECC needs a full sector read (adr: %lx size %lx)\n",
+			       (long) from, (long) len);
 
-	if (this->curfloor != mychip->floor) {
-		DoC_SelectFloor(this, mychip->floor);
-		DoC_SelectChip(this, mychip->chip);
-	} else if (this->curchip != mychip->chip) {
-		DoC_SelectChip(this, mychip->chip);
-	}
+		/* printk("DoC_Read (adr: %lx size %lx)\n", (long) from, (long) len); */
 
-	this->curfloor = mychip->floor;
-	this->curchip = mychip->chip;
 
-	DoC_Command(this,
-		    (!this->page256
-		     && (from & 0x100)) ? NAND_CMD_READ1 : NAND_CMD_READ0,
-		    CDSN_CTRL_WP);
-	DoC_Address(this, ADDR_COLUMN_PAGE, from, CDSN_CTRL_WP,
-		    CDSN_CTRL_ECC_IO);
-
-	if (eccbuf) {
-		/* Prime the ECC engine */
-		WriteDOC(DOC_ECC_RESET, docptr, ECCConf);
-		WriteDOC(DOC_ECC_EN, docptr, ECCConf);
-	} else {
-		/* disable the ECC engine */
-		WriteDOC(DOC_ECC_RESET, docptr, ECCConf);
-		WriteDOC(DOC_ECC_DIS, docptr, ECCConf);
-	}
+		/* Find the chip which is to be used and select it */
+		mychip = &this->chips[from >> (this->chipshift)];
 
-	/* treat crossing 256-byte sector for 2M x 8bits devices */
-	if (this->page256 && from + len > (from | 0xff) + 1) {
-		len256 = (from | 0xff) + 1 - from;
-		DoC_ReadBuf(this, buf, len256);
+		if (this->curfloor != mychip->floor) {
+			DoC_SelectFloor(this, mychip->floor);
+			DoC_SelectChip(this, mychip->chip);
+		} else if (this->curchip != mychip->chip) {
+			DoC_SelectChip(this, mychip->chip);
+		}
 
-		DoC_Command(this, NAND_CMD_READ0, CDSN_CTRL_WP);
-		DoC_Address(this, ADDR_COLUMN_PAGE, from + len256,
-			    CDSN_CTRL_WP, CDSN_CTRL_ECC_IO);
-	}
+		this->curfloor = mychip->floor;
+		this->curchip = mychip->chip;
 
-	DoC_ReadBuf(this, &buf[len256], len - len256);
+		DoC_Command(this,
+			    (!this->page256
+			     && (from & 0x100)) ? NAND_CMD_READ1 : NAND_CMD_READ0,
+			    CDSN_CTRL_WP);
+		DoC_Address(this, ADDR_COLUMN_PAGE, from, CDSN_CTRL_WP,
+			    CDSN_CTRL_ECC_IO);
 
-	/* Let the caller know we completed it */
-	*retlen = len;
+		if (eccbuf) {
+			/* Prime the ECC engine */
+			WriteDOC(DOC_ECC_RESET, docptr, ECCConf);
+			WriteDOC(DOC_ECC_EN, docptr, ECCConf);
+		} else {
+			/* disable the ECC engine */
+			WriteDOC(DOC_ECC_RESET, docptr, ECCConf);
+			WriteDOC(DOC_ECC_DIS, docptr, ECCConf);
+		}
 
-	if (eccbuf) {
-		/* Read the ECC data through the DiskOnChip ECC logic */
-		/* Note: this will work even with 2M x 8bit devices as   */
-		/*       they have 8 bytes of OOB per 256 page. mf.      */
-		DoC_ReadBuf(this, eccbuf, 6);
+		/* treat crossing 256-byte sector for 2M x 8bits devices */
+		if (this->page256 && from + len > (from | 0xff) + 1) {
+			len256 = (from | 0xff) + 1 - from;
+			DoC_ReadBuf(this, buf, len256);
 
-		/* Flush the pipeline */
-		if (DoC_is_Millennium(this)) {
-			dummy = ReadDOC(docptr, ECCConf);
-			dummy = ReadDOC(docptr, ECCConf);
-			i = ReadDOC(docptr, ECCConf);
-		} else {
-			dummy = ReadDOC(docptr, 2k_ECCStatus);
-			dummy = ReadDOC(docptr, 2k_ECCStatus);
-			i = ReadDOC(docptr, 2k_ECCStatus);
+			DoC_Command(this, NAND_CMD_READ0, CDSN_CTRL_WP);
+			DoC_Address(this, ADDR_COLUMN_PAGE, from + len256,
+				    CDSN_CTRL_WP, CDSN_CTRL_ECC_IO);
 		}
 
-		/* Check the ECC Status */
-		if (i & 0x80) {
-			int nb_errors;
-			/* There was an ECC error */
+		DoC_ReadBuf(this, &buf[len256], len - len256);
+
+		/* Let the caller know we completed it */
+		*retlen += len;
+
+		if (eccbuf) {
+			/* Read the ECC data through the DiskOnChip ECC logic */
+			/* Note: this will work even with 2M x 8bit devices as   */
+			/*       they have 8 bytes of OOB per 256 page. mf.      */
+			DoC_ReadBuf(this, eccbuf, 6);
+
+			/* Flush the pipeline */
+			if (DoC_is_Millennium(this)) {
+				dummy = ReadDOC(docptr, ECCConf);
+				dummy = ReadDOC(docptr, ECCConf);
+				i = ReadDOC(docptr, ECCConf);
+			} else {
+				dummy = ReadDOC(docptr, 2k_ECCStatus);
+				dummy = ReadDOC(docptr, 2k_ECCStatus);
+				i = ReadDOC(docptr, 2k_ECCStatus);
+			}
+
+			/* Check the ECC Status */
+			if (i & 0x80) {
+				int nb_errors;
+				/* There was an ECC error */
 #ifdef ECC_DEBUG
-			printk(KERN_ERR "DiskOnChip ECC Error: Read at %lx\n", (long)from);
+				printk(KERN_ERR "DiskOnChip ECC Error: Read at %lx\n", (long)from);
 #endif
-			/* Read the ECC syndrom through the DiskOnChip ECC logic.
-			   These syndrome will be all ZERO when there is no error */
-			for (i = 0; i < 6; i++) {
-				syndrome[i] =
-				    ReadDOC(docptr, ECCSyndrome0 + i);
-			}
-                        nb_errors = doc_decode_ecc(buf, syndrome);
+				/* Read the ECC syndrom through the DiskOnChip ECC logic.
+				   These syndrome will be all ZERO when there is no error */
+				for (i = 0; i < 6; i++) {
+					syndrome[i] =
+					    ReadDOC(docptr, ECCSyndrome0 + i);
+				}
+	                        nb_errors = doc_decode_ecc(buf, syndrome);
 
 #ifdef ECC_DEBUG
-			printk(KERN_ERR "Errors corrected: %x\n", nb_errors);
+				printk(KERN_ERR "Errors corrected: %x\n", nb_errors);
 #endif
-                        if (nb_errors < 0) {
-				/* We return error, but have actually done the read. Not that
-				   this can be told to user-space, via sys_read(), but at least
-				   MTD-aware stuff can know about it by checking *retlen */
-				ret = -EIO;
-                        }
-		}
+	                        if (nb_errors < 0) {
+					/* We return error, but have actually done the read. Not that
+					   this can be told to user-space, via sys_read(), but at least
+					   MTD-aware stuff can know about it by checking *retlen */
+					ret = -EIO;
+	                        }
+			}
 
 #ifdef PSYCHO_DEBUG
-		printk(KERN_DEBUG "ECC DATA at %lxB: %2.2X %2.2X %2.2X %2.2X %2.2X %2.2X\n",
-			     (long)from, eccbuf[0], eccbuf[1], eccbuf[2],
-			     eccbuf[3], eccbuf[4], eccbuf[5]);
+			printk(KERN_DEBUG "ECC DATA at %lxB: %2.2X %2.2X %2.2X %2.2X %2.2X %2.2X\n",
+				     (long)from, eccbuf[0], eccbuf[1], eccbuf[2],
+				     eccbuf[3], eccbuf[4], eccbuf[5]);
 #endif
 		
-		/* disable the ECC engine */
-		WriteDOC(DOC_ECC_DIS, docptr , ECCConf);
-	}
+			/* disable the ECC engine */
+			WriteDOC(DOC_ECC_DIS, docptr , ECCConf);
+		}
 
-	/* according to 11.4.1, we need to wait for the busy line 
-         * drop if we read to the end of the page.  */
-	if(0 == ((from + *retlen) & 0x1ff))
-	{
-	    DoC_WaitReady(this);
+		/* according to 11.4.1, we need to wait for the busy line 
+	         * drop if we read to the end of the page.  */
+		if(0 == ((from + len) & 0x1ff))
+		{
+		    DoC_WaitReady(this);
+		}
+
+		from += len;
+		left -= len;
+		buf += len;
 	}
 
 	up(&this->lock);
@@ -745,12 +790,12 @@ static int doc_write(struct mtd_info *mtd, loff_t to, size_t len,
 		     size_t * retlen, const u_char * buf)
 {
 	char eccbuf[6];
-	return doc_write_ecc(mtd, to, len, retlen, buf, eccbuf, 0);
+	return doc_write_ecc(mtd, to, len, retlen, buf, eccbuf, NULL);
 }
 
 static int doc_write_ecc(struct mtd_info *mtd, loff_t to, size_t len,
 			 size_t * retlen, const u_char * buf,
-			 u_char * eccbuf, int oobsel)
+			 u_char * eccbuf, struct nand_oobinfo *oobsel)
 {
 	struct DiskOnChip *this = (struct DiskOnChip *) mtd->priv;
 	int di; /* Yes, DI is a hangover from when I was disassembling the binary driver */
@@ -758,6 +803,8 @@ static int doc_write_ecc(struct mtd_info *mtd, loff_t to, size_t len,
 	volatile char dummy;
 	int len256 = 0;
 	struct Nand *mychip;
+	size_t left = len;
+	int status;
 
 	docptr = this->virtadr;
 
@@ -767,65 +814,133 @@ static int doc_write_ecc(struct mtd_info *mtd, loff_t to, size_t len,
 
 	down(&this->lock);
 
-	/* Don't allow a single write to cross a 512-byte block boundary */
-	if (to + len > ((to | 0x1ff) + 1))
-		len = ((to | 0x1ff) + 1) - to;
+	*retlen = 0;
+	while (left) {
+		len = left;
 
-	/* The ECC will not be calculated correctly if less than 512 is written */
-	if (len != 0x200 && eccbuf)
-		printk(KERN_WARNING
-		       "ECC needs a full sector write (adr: %lx size %lx)\n",
-		       (long) to, (long) len);
+		/* Don't allow a single write to cross a 512-byte block boundary */
+		if (to + len > ((to | 0x1ff) + 1))
+			len = ((to | 0x1ff) + 1) - to;
 
-	/* printk("DoC_Write (adr: %lx size %lx)\n", (long) to, (long) len); */
+		/* The ECC will not be calculated correctly if less than 512 is written */
+/* DBB-
+		if (len != 0x200 && eccbuf)
+			printk(KERN_WARNING
+			       "ECC needs a full sector write (adr: %lx size %lx)\n",
+			       (long) to, (long) len);
+   -DBB */
 
-	/* Find the chip which is to be used and select it */
-	mychip = &this->chips[to >> (this->chipshift)];
+		/* printk("DoC_Write (adr: %lx size %lx)\n", (long) to, (long) len); */
 
-	if (this->curfloor != mychip->floor) {
-		DoC_SelectFloor(this, mychip->floor);
-		DoC_SelectChip(this, mychip->chip);
-	} else if (this->curchip != mychip->chip) {
-		DoC_SelectChip(this, mychip->chip);
-	}
+		/* Find the chip which is to be used and select it */
+		mychip = &this->chips[to >> (this->chipshift)];
 
-	this->curfloor = mychip->floor;
-	this->curchip = mychip->chip;
+		if (this->curfloor != mychip->floor) {
+			DoC_SelectFloor(this, mychip->floor);
+			DoC_SelectChip(this, mychip->chip);
+		} else if (this->curchip != mychip->chip) {
+			DoC_SelectChip(this, mychip->chip);
+		}
 
-	/* Set device to main plane of flash */
-	DoC_Command(this, NAND_CMD_RESET, CDSN_CTRL_WP);
-	DoC_Command(this,
-		    (!this->page256
-		     && (to & 0x100)) ? NAND_CMD_READ1 : NAND_CMD_READ0,
-		    CDSN_CTRL_WP);
+		this->curfloor = mychip->floor;
+		this->curchip = mychip->chip;
 
-	DoC_Command(this, NAND_CMD_SEQIN, 0);
-	DoC_Address(this, ADDR_COLUMN_PAGE, to, 0, CDSN_CTRL_ECC_IO);
+		/* Set device to main plane of flash */
+		DoC_Command(this, NAND_CMD_RESET, CDSN_CTRL_WP);
+		DoC_Command(this,
+			    (!this->page256
+			     && (to & 0x100)) ? NAND_CMD_READ1 : NAND_CMD_READ0,
+			    CDSN_CTRL_WP);
 
-	if (eccbuf) {
-		/* Prime the ECC engine */
-		WriteDOC(DOC_ECC_RESET, docptr, ECCConf);
-		WriteDOC(DOC_ECC_EN | DOC_ECC_RW, docptr, ECCConf);
-	} else {
-		/* disable the ECC engine */
-		WriteDOC(DOC_ECC_RESET, docptr, ECCConf);
-		WriteDOC(DOC_ECC_DIS, docptr, ECCConf);
-	}
+		DoC_Command(this, NAND_CMD_SEQIN, 0);
+		DoC_Address(this, ADDR_COLUMN_PAGE, to, 0, CDSN_CTRL_ECC_IO);
 
-	/* treat crossing 256-byte sector for 2M x 8bits devices */
-	if (this->page256 && to + len > (to | 0xff) + 1) {
-		len256 = (to | 0xff) + 1 - to;
-		DoC_WriteBuf(this, buf, len256);
+		if (eccbuf) {
+			/* Prime the ECC engine */
+			WriteDOC(DOC_ECC_RESET, docptr, ECCConf);
+			WriteDOC(DOC_ECC_EN | DOC_ECC_RW, docptr, ECCConf);
+		} else {
+			/* disable the ECC engine */
+			WriteDOC(DOC_ECC_RESET, docptr, ECCConf);
+			WriteDOC(DOC_ECC_DIS, docptr, ECCConf);
+		}
+
+		/* treat crossing 256-byte sector for 2M x 8bits devices */
+		if (this->page256 && to + len > (to | 0xff) + 1) {
+			len256 = (to | 0xff) + 1 - to;
+			DoC_WriteBuf(this, buf, len256);
+
+			DoC_Command(this, NAND_CMD_PAGEPROG, 0);
+
+			DoC_Command(this, NAND_CMD_STATUS, CDSN_CTRL_WP);
+			/* There's an implicit DoC_WaitReady() in DoC_Command */
+
+			dummy = ReadDOC(docptr, CDSNSlowIO);
+			DoC_Delay(this, 2);
+
+			if (ReadDOC_(docptr, this->ioreg) & 1) {
+				printk(KERN_ERR "Error programming flash\n");
+				/* Error in programming */
+				*retlen = 0;
+				up(&this->lock);
+				return -EIO;
+			}
+
+			DoC_Command(this, NAND_CMD_SEQIN, 0);
+			DoC_Address(this, ADDR_COLUMN_PAGE, to + len256, 0,
+				    CDSN_CTRL_ECC_IO);
+		}
+
+		DoC_WriteBuf(this, &buf[len256], len - len256);
+
+		if (eccbuf) {
+			WriteDOC(CDSN_CTRL_ECC_IO | CDSN_CTRL_CE, docptr,
+				 CDSNControl);
+
+			if (DoC_is_Millennium(this)) {
+				WriteDOC(0, docptr, NOP);
+				WriteDOC(0, docptr, NOP);
+				WriteDOC(0, docptr, NOP);
+			} else {
+				WriteDOC_(0, docptr, this->ioreg);
+				WriteDOC_(0, docptr, this->ioreg);
+				WriteDOC_(0, docptr, this->ioreg);
+			}
+
+			WriteDOC(CDSN_CTRL_ECC_IO | CDSN_CTRL_FLASH_IO | CDSN_CTRL_CE, docptr,
+				 CDSNControl);
+
+			/* Read the ECC data through the DiskOnChip ECC logic */
+			for (di = 0; di < 6; di++) {
+				eccbuf[di] = ReadDOC(docptr, ECCSyndrome0 + di);
+			}
+
+			/* Reset the ECC engine */
+			WriteDOC(DOC_ECC_DIS, docptr, ECCConf);
+
+#ifdef PSYCHO_DEBUG
+			printk
+			    ("OOB data at %lx is %2.2X %2.2X %2.2X %2.2X %2.2X %2.2X\n",
+			     (long) to, eccbuf[0], eccbuf[1], eccbuf[2], eccbuf[3],
+			     eccbuf[4], eccbuf[5]);
+#endif
+		}
 
 		DoC_Command(this, NAND_CMD_PAGEPROG, 0);
 
 		DoC_Command(this, NAND_CMD_STATUS, CDSN_CTRL_WP);
 		/* There's an implicit DoC_WaitReady() in DoC_Command */
 
-		dummy = ReadDOC(docptr, CDSNSlowIO);
-		DoC_Delay(this, 2);
+		if (DoC_is_Millennium(this)) {
+			ReadDOC(docptr, ReadPipeInit);
+			status = ReadDOC(docptr, LastDataRead);
+		} else {
+			dummy = ReadDOC(docptr, CDSNSlowIO);
+			DoC_Delay(this, 2);
+			status = ReadDOC_(docptr, this->ioreg);
+		}
 
-		if (ReadDOC_(docptr, this->ioreg) & 1) {
+		if (status & 1) {
 			printk(KERN_ERR "Error programming flash\n");
 			/* Error in programming */
 			*retlen = 0;
@@ -833,82 +948,97 @@ static int doc_write_ecc(struct mtd_info *mtd, loff_t to, size_t len,
 			return -EIO;
 		}
 
-		DoC_Command(this, NAND_CMD_SEQIN, 0);
-		DoC_Address(this, ADDR_COLUMN_PAGE, to + len256, 0,
-			    CDSN_CTRL_ECC_IO);
+		/* Let the caller know we completed it */
+		*retlen += len;
+		
+		if (eccbuf) {
+			unsigned char x[8];
+			size_t dummy;
+			int ret;
+
+			/* Write the ECC data to flash */
+			for (di=0; di<6; di++)
+				x[di] = eccbuf[di];
+		
+			x[6]=0x55;
+			x[7]=0x55;
+		
+			ret = doc_write_oob_nolock(mtd, to, 8, &dummy, x);
+			if (ret) {
+				up(&this->lock);
+				return ret;
+			}
+		}
+
+		to += len;
+		left -= len;
+		buf += len;
 	}
 
-	DoC_WriteBuf(this, &buf[len256], len - len256);
+	up(&this->lock);
+	return 0;
+}
 
-	if (eccbuf) {
-		WriteDOC(CDSN_CTRL_ECC_IO | CDSN_CTRL_CE, docptr,
-			 CDSNControl);
+static int doc_writev_ecc(struct mtd_info *mtd, const struct kvec *vecs, 
+			  unsigned long count, loff_t to, size_t *retlen,
+			  u_char *eccbuf, struct nand_oobinfo *oobsel)
+{
+	static char static_buf[512];
+	static DECLARE_MUTEX(writev_buf_sem);
 
-		if (DoC_is_Millennium(this)) {
-			WriteDOC(0, docptr, NOP);
-			WriteDOC(0, docptr, NOP);
-			WriteDOC(0, docptr, NOP);
-		} else {
-			WriteDOC_(0, docptr, this->ioreg);
-			WriteDOC_(0, docptr, this->ioreg);
-			WriteDOC_(0, docptr, this->ioreg);
-		}
+	size_t totretlen = 0;
+	size_t thisvecofs = 0;
+	int ret= 0;
 
-		/* Read the ECC data through the DiskOnChip ECC logic */
-		for (di = 0; di < 6; di++) {
-			eccbuf[di] = ReadDOC(docptr, ECCSyndrome0 + di);
-		}
+	down(&writev_buf_sem);
 
-		/* Reset the ECC engine */
-		WriteDOC(DOC_ECC_DIS, docptr, ECCConf);
+	while(count) {
+		size_t thislen, thisretlen;
+		unsigned char *buf;
 
-#ifdef PSYCHO_DEBUG
-		printk
-		    ("OOB data at %lx is %2.2X %2.2X %2.2X %2.2X %2.2X %2.2X\n",
-		     (long) to, eccbuf[0], eccbuf[1], eccbuf[2], eccbuf[3],
-		     eccbuf[4], eccbuf[5]);
-#endif
-	}
+		buf = vecs->iov_base + thisvecofs;
+		thislen = vecs->iov_len - thisvecofs;
 
-	DoC_Command(this, NAND_CMD_PAGEPROG, 0);
 
-	DoC_Command(this, NAND_CMD_STATUS, CDSN_CTRL_WP);
-	/* There's an implicit DoC_WaitReady() in DoC_Command */
+		if (thislen >= 512) {
+			thislen = thislen & ~(512-1);
+			thisvecofs += thislen;
+		} else {
+			/* Not enough to fill a page. Copy into buf */
+			memcpy(static_buf, buf, thislen);
+			buf = &static_buf[thislen];
+
+			while(count && thislen < 512) {
+				vecs++;
+				count--;
+				thisvecofs = min((512-thislen), vecs->iov_len);
+				memcpy(buf, vecs->iov_base, thisvecofs);
+				thislen += thisvecofs;
+				buf += thisvecofs;
+			}
+			buf = static_buf;
+		}
+		if (count && thisvecofs == vecs->iov_len) {
+			thisvecofs = 0;
+			vecs++;
+			count--;
+		}
+		ret = doc_write_ecc(mtd, to, thislen, &thisretlen, buf, eccbuf, oobsel);
 
-	dummy = ReadDOC(docptr, CDSNSlowIO);
-	DoC_Delay(this, 2);
+		totretlen += thisretlen;
 
-	if (ReadDOC_(docptr, this->ioreg) & 1) {
-		printk(KERN_ERR "Error programming flash\n");
-		/* Error in programming */
-		*retlen = 0;
-		up(&this->lock);
-		return -EIO;
-	}
+		if (ret || thisretlen != thislen)
+			break;
 
-	/* Let the caller know we completed it */
-	*retlen = len;
-		
-	if (eccbuf) {
-		unsigned char x[8];
-		size_t dummy;
-		int ret;
-
-		/* Write the ECC data to flash */
-		for (di=0; di<6; di++)
-			x[di] = eccbuf[di];
-		
-		x[6]=0x55;
-		x[7]=0x55;
-		
-		ret = doc_write_oob_nolock(mtd, to, 8, &dummy, x);
-		up(&this->lock);
-		return ret;
-	}
-	up(&this->lock);
-	return 0;
+		to += thislen;
+	}		
+
+	up(&writev_buf_sem);
+	*retlen = totretlen;
+	return ret;
 }
 
+
 static int doc_read_oob(struct mtd_info *mtd, loff_t ofs, size_t len,
 			size_t * retlen, u_char * buf)
 {
@@ -978,6 +1108,7 @@ static int doc_write_oob_nolock(struct mtd_info *mtd, loff_t ofs, size_t len,
 	unsigned long docptr = this->virtadr;
 	struct Nand *mychip = &this->chips[ofs >> this->chipshift];
 	volatile int dummy;
+	int status;
 
 	//      printk("doc_write_oob(%lx, %d): %2.2X %2.2X %2.2X %2.2X ... %2.2X %2.2X .. %2.2X %2.2X\n",(long)ofs, len,
 	//   buf[0], buf[1], buf[2], buf[3], buf[8], buf[9], buf[14],buf[15]);
@@ -1026,10 +1157,16 @@ static int doc_write_oob_nolock(struct mtd_info *mtd, loff_t ofs, size_t len,
 		DoC_Command(this, NAND_CMD_STATUS, 0);
 		/* DoC_WaitReady() is implicit in DoC_Command */
 
-		dummy = ReadDOC(docptr, CDSNSlowIO);
-		DoC_Delay(this, 2);
+		if (DoC_is_Millennium(this)) {
+			ReadDOC(docptr, ReadPipeInit);
+			status = ReadDOC(docptr, LastDataRead);
+		} else {
+			dummy = ReadDOC(docptr, CDSNSlowIO);
+			DoC_Delay(this, 2);
+			status = ReadDOC_(docptr, this->ioreg);
+		}
 
-		if (ReadDOC_(docptr, this->ioreg) & 1) {
+		if (status & 1) {
 			printk(KERN_ERR "Error programming oob data\n");
 			/* There was an error */
 			*retlen = 0;
@@ -1045,10 +1182,16 @@ static int doc_write_oob_nolock(struct mtd_info *mtd, loff_t ofs, size_t len,
 	DoC_Command(this, NAND_CMD_STATUS, 0);
 	/* DoC_WaitReady() is implicit in DoC_Command */
 
-	dummy = ReadDOC(docptr, CDSNSlowIO);
-	DoC_Delay(this, 2);
+	if (DoC_is_Millennium(this)) {
+		ReadDOC(docptr, ReadPipeInit);
+		status = ReadDOC(docptr, LastDataRead);
+	} else {
+		dummy = ReadDOC(docptr, CDSNSlowIO);
+		DoC_Delay(this, 2);
+		status = ReadDOC_(docptr, this->ioreg);
+	}
 
-	if (ReadDOC_(docptr, this->ioreg) & 1) {
+	if (status & 1) {
 		printk(KERN_ERR "Error programming oob data\n");
 		/* There was an error */
 		*retlen = 0;
@@ -1081,6 +1224,7 @@ static int doc_erase(struct mtd_info *mtd, struct erase_info *instr)
 	volatile int dummy;
 	unsigned long docptr;
 	struct Nand *mychip;
+	int status;
 
  	down(&this->lock);
 
@@ -1112,10 +1256,16 @@ static int doc_erase(struct mtd_info *mtd, struct erase_info *instr)
 
 		DoC_Command(this, NAND_CMD_STATUS, CDSN_CTRL_WP);
 
-		dummy = ReadDOC(docptr, CDSNSlowIO);
-		DoC_Delay(this, 2);
-		
-		if (ReadDOC_(docptr, this->ioreg) & 1) {
+		if (DoC_is_Millennium(this)) {
+			ReadDOC(docptr, ReadPipeInit);
+			status = ReadDOC(docptr, LastDataRead);
+		} else {
+			dummy = ReadDOC(docptr, CDSNSlowIO);
+			DoC_Delay(this, 2);
+			status = ReadDOC_(docptr, this->ioreg);
+		}
+
+		if (status & 1) {
 			printk(KERN_ERR "Error erasing at 0x%x\n", ofs);
 			/* There was an error */
 			instr->state = MTD_ERASE_FAILED;
@@ -1127,8 +1277,7 @@ static int doc_erase(struct mtd_info *mtd, struct erase_info *instr)
 	instr->state = MTD_ERASE_DONE;
 
  callback:
-	if (instr->callback)
-		instr->callback(instr);
+	mtd_erase_callback(instr);
 
 	up(&this->lock);
 	return 0;
diff --git a/drivers/mtd/devices/doc2001.c b/drivers/mtd/devices/doc2001.c
index 25eea68ad..df588ac65 100644
--- a/drivers/mtd/devices/doc2001.c
+++ b/drivers/mtd/devices/doc2001.c
@@ -4,7 +4,7 @@
  * (c) 1999 Machine Vision Holdings, Inc.
  * (c) 1999, 2000 David Woodhouse <dwmw2@infradead.org>
  *
- * $Id: doc2001.c,v 1.41 2003/06/11 09:45:19 dwmw2 Exp $
+ * $Id: doc2001.c,v 1.44 2004/08/09 14:04:24 dwmw2 Exp $
  */
 
 #include <linux/kernel.h>
@@ -19,6 +19,7 @@
 #include <linux/sched.h>
 #include <linux/init.h>
 #include <linux/types.h>
+#include <linux/bitops.h>
 
 #include <linux/mtd/mtd.h>
 #include <linux/mtd/nand.h>
@@ -37,9 +38,11 @@ static int doc_read(struct mtd_info *mtd, loff_t from, size_t len,
 static int doc_write(struct mtd_info *mtd, loff_t to, size_t len,
 		     size_t *retlen, const u_char *buf);
 static int doc_read_ecc(struct mtd_info *mtd, loff_t from, size_t len,
-			size_t *retlen, u_char *buf, u_char *eccbuf, int oobsel);
+			size_t *retlen, u_char *buf, u_char *eccbuf,
+			struct nand_oobinfo *oobsel);
 static int doc_write_ecc(struct mtd_info *mtd, loff_t to, size_t len,
-			 size_t *retlen, const u_char *buf, u_char *eccbuf, int oobsel);
+			 size_t *retlen, const u_char *buf, u_char *eccbuf,
+			 struct nand_oobinfo *oobsel);
 static int doc_read_oob(struct mtd_info *mtd, loff_t ofs, size_t len,
 			size_t *retlen, u_char *buf);
 static int doc_write_oob(struct mtd_info *mtd, loff_t ofs, size_t len,
@@ -226,7 +229,7 @@ static int DoC_IdentChip(struct DiskOnChip *doc, int floor, int chip)
 			       mfr, id, nand_manuf_ids[j].name, nand_flash_ids[i].name);
 			doc->mfr = mfr;
 			doc->id = id;
-			doc->chipshift = nand_flash_ids[i].chipshift;
+			doc->chipshift = ffs((nand_flash_ids[i].chipsize << 20)) - 1;
 			break;
 		}
 	}
@@ -403,11 +406,12 @@ static int doc_read (struct mtd_info *mtd, loff_t from, size_t len,
 		     size_t *retlen, u_char *buf)
 {
 	/* Just a special case of doc_read_ecc */
-	return doc_read_ecc(mtd, from, len, retlen, buf, NULL, 0);
+	return doc_read_ecc(mtd, from, len, retlen, buf, NULL, NULL);
 }
 
 static int doc_read_ecc (struct mtd_info *mtd, loff_t from, size_t len,
-			 size_t *retlen, u_char *buf, u_char *eccbuf, int oobsel)
+			 size_t *retlen, u_char *buf, u_char *eccbuf,
+			 struct nand_oobinfo *oobsel)
 {
 	int i, ret;
 	volatile char dummy;
@@ -529,11 +533,12 @@ static int doc_write (struct mtd_info *mtd, loff_t to, size_t len,
 		      size_t *retlen, const u_char *buf)
 {
 	char eccbuf[6];
-	return doc_write_ecc(mtd, to, len, retlen, buf, eccbuf, 0);
+	return doc_write_ecc(mtd, to, len, retlen, buf, eccbuf, NULL);
 }
 
 static int doc_write_ecc (struct mtd_info *mtd, loff_t to, size_t len,
-			  size_t *retlen, const u_char *buf, u_char *eccbuf, int oobsel)
+			  size_t *retlen, const u_char *buf, u_char *eccbuf,
+			 struct nand_oobinfo *oobsel)
 {
 	int i,ret = 0;
 	volatile char dummy;
@@ -840,8 +845,7 @@ int doc_erase (struct mtd_info *mtd, struct erase_info *instr)
 		instr->state = MTD_ERASE_DONE;
 	dummy = ReadDOC(docptr, LastDataRead);
 
-	if (instr->callback) 
-		instr->callback(instr);
+	mtd_erase_callback(instr);
 
 	return 0;
 }
diff --git a/drivers/mtd/devices/doc2001plus.c b/drivers/mtd/devices/doc2001plus.c
index e5e5fdaeb..d30ba118f 100644
--- a/drivers/mtd/devices/doc2001plus.c
+++ b/drivers/mtd/devices/doc2001plus.c
@@ -6,7 +6,9 @@
  * (c) 1999 Machine Vision Holdings, Inc.
  * (c) 1999, 2000 David Woodhouse <dwmw2@infradead.org>
  *
- * $Id: doc2001plus.c,v 1.5 2003/06/11 09:45:19 dwmw2 Exp $
+ * $Id: doc2001plus.c,v 1.9 2004/08/09 13:19:44 dwmw2 Exp $
+ *
+ * Released under GPL
  */
 
 #include <linux/kernel.h>
@@ -21,6 +23,7 @@
 #include <linux/sched.h>
 #include <linux/init.h>
 #include <linux/types.h>
+#include <linux/bitops.h>
 
 #include <linux/mtd/mtd.h>
 #include <linux/mtd/nand.h>
@@ -183,24 +186,35 @@ static int DoC_SelectFloor(unsigned long docptr, int floor)
  *  | Data 0    | ECC 0 |Flags0 |Flags1 | Data 1       |ECC 1    | OOB 1 + 2 |
  *  +-----------+-------+-------+-------+--------------+---------+-----------+
  */
+/* FIXME: This lives in INFTL not here. Other users of flash devices
+   may not want it */
 static unsigned int DoC_GetDataOffset(struct mtd_info *mtd, loff_t *from)
 {
-	unsigned int ofs = *from & 0x3ff;
-	unsigned int cmd;
+	struct DiskOnChip *this = (struct DiskOnChip *)mtd->priv;
 
-	if (ofs < 512) {
-		cmd = NAND_CMD_READ0;
-		ofs &= 0x1ff;
-	} else if (ofs < 1014) {
-		cmd = NAND_CMD_READ1;
-		ofs = (ofs & 0x1ff) + 10;
+	if (this->interleave) {
+		unsigned int ofs = *from & 0x3ff;
+		unsigned int cmd;
+
+		if (ofs < 512) {
+			cmd = NAND_CMD_READ0;
+			ofs &= 0x1ff;
+		} else if (ofs < 1014) {
+			cmd = NAND_CMD_READ1;
+			ofs = (ofs & 0x1ff) + 10;
+		} else {
+			cmd = NAND_CMD_READOOB;
+			ofs = ofs - 1014;
+		}
+
+		*from = (*from & ~0x3ff) | ofs;
+		return cmd;
 	} else {
-		cmd = NAND_CMD_READOOB;
-		ofs = ofs - 1014;
+		/* No interleave */
+		if ((*from) & 0x100)
+			return NAND_CMD_READ1;
+		return NAND_CMD_READ0;
 	}
-
-	*from = (*from & ~0x3ff) | ofs;
-	return cmd;
 }
 
 static unsigned int DoC_GetECCOffset(struct mtd_info *mtd, loff_t *from)
@@ -294,10 +308,12 @@ static int DoC_IdentChip(struct DiskOnChip *doc, int floor, int chip)
 	dummy = ReadDOC(docptr, Mplus_ReadPipeInit);
 
 	mfr = ReadDOC(docptr, Mil_CDSN_IO);
-	dummy = ReadDOC(docptr, Mil_CDSN_IO); /* 2 way interleave */
+	if (doc->interleave)
+		dummy = ReadDOC(docptr, Mil_CDSN_IO); /* 2 way interleave */
 
 	id  = ReadDOC(docptr, Mil_CDSN_IO);
-	dummy = ReadDOC(docptr, Mil_CDSN_IO); /* 2 way interleave */
+	if (doc->interleave)
+		dummy = ReadDOC(docptr, Mil_CDSN_IO); /* 2 way interleave */
 
 	dummy = ReadDOC(docptr, Mplus_LastDataRead);
 	dummy = ReadDOC(docptr, Mplus_LastDataRead);
@@ -321,10 +337,7 @@ static int DoC_IdentChip(struct DiskOnChip *doc, int floor, int chip)
 			       nand_manuf_ids[j].name, nand_flash_ids[i].name);
 			doc->mfr = mfr;
 			doc->id = id;
-			doc->interleave = 0;
-			if (doc->ChipID == DOC_ChipID_DocMilPlus32)
-				doc->interleave = 1;
-			doc->chipshift = nand_flash_ids[i].chipshift;
+			doc->chipshift = ffs((nand_flash_ids[i].chipsize << 20)) - 1;
 			doc->erasesize = nand_flash_ids[i].erasesize << doc->interleave;
 			break;
 		}
@@ -346,6 +359,21 @@ static void DoC_ScanChips(struct DiskOnChip *this)
 	this->mfr = 0;
 	this->id = 0;
 
+	/* Work out the intended interleave setting */
+	this->interleave = 0;
+	if (this->ChipID == DOC_ChipID_DocMilPlus32)
+		this->interleave = 1;
+
+	/* Check the ASIC agrees */
+	if ( (this->interleave << 2) != 
+	     (ReadDOC(this->virtadr, Mplus_Configuration) & 4)) {
+		u_char conf = ReadDOC(this->virtadr, Mplus_Configuration);
+		printk(KERN_NOTICE "Setting DiskOnChip Millennium Plus interleave to %s\n",
+		       this->interleave?"on (16-bit)":"off (8-bit)");
+		conf ^= 4;
+		WriteDOC(this->virtadr, conf, Mplus_Configuration);
+	}
+
 	/* For each floor, find the number of valid chips it contains */
 	for (floor = 0,ret = 1; floor < MAX_FLOORS_MPLUS; floor++) {
 		numchips[floor] = 0;
@@ -739,7 +767,7 @@ static int doc_write_ecc(struct mtd_info *mtd, loff_t to, size_t len,
 		return -EINVAL;
 
 	/* Determine position of OOB flags, before or after data */
-	before = to & 0x200;
+	before = (this->interleave && (to & 0x200));
 
 	DoC_CheckASIC(docptr);
 
@@ -886,7 +914,10 @@ static int doc_read_oob(struct mtd_info *mtd, loff_t ofs, size_t len,
 		/* Figure out which region we are accessing... */
 		fofs = ofs;
 		base = ofs & 0xf;
-		if (base < 6) {
+		if (!this->interleave) {
+			DoC_Command(docptr, NAND_CMD_READOOB, 0);
+			size = 16 - base;
+		} else if (base < 6) {
 			DoC_Command(docptr, DoC_GetECCOffset(mtd, &fofs), 0);
 			size = 6 - base;
 		} else if (base < 8) {
@@ -963,7 +994,10 @@ static int doc_write_oob(struct mtd_info *mtd, loff_t ofs, size_t len,
 		/* Figure out which region we are accessing... */
 		fofs = ofs;
 		base = ofs & 0x0f;
-		if (base < 6) {
+		if (!this->interleave) {
+			WriteDOC(NAND_CMD_READOOB, docptr, Mplus_FlashCmd);
+			size = 16 - base;
+		} else if (base < 6) {
 			WriteDOC(DoC_GetECCOffset(mtd, &fofs), docptr, Mplus_FlashCmd);
 			size = 6 - base;
 		} else if (base < 8) {
@@ -1077,8 +1111,7 @@ int doc_erase(struct mtd_info *mtd, struct erase_info *instr)
 	/* Disable flash internally */
 	WriteDOC(0, docptr, Mplus_FlashSelect);
 
-	if (instr->callback) 
-		instr->callback(instr);
+	mtd_erase_callback(instr);
 
 	return 0;
 }
diff --git a/drivers/mtd/devices/docprobe.c b/drivers/mtd/devices/docprobe.c
index f7a91fa86..cb8b8a51e 100644
--- a/drivers/mtd/devices/docprobe.c
+++ b/drivers/mtd/devices/docprobe.c
@@ -4,7 +4,7 @@
 /* (C) 1999 Machine Vision Holdings, Inc.			*/
 /* (C) 1999-2003 David Woodhouse <dwmw2@infradead.org>		*/
 
-/* $Id: docprobe.c,v 1.36 2003/05/23 11:29:34 dwmw2 Exp $	*/
+/* $Id: docprobe.c,v 1.41 2003/12/03 10:19:57 dwmw2 Exp $	*/
 
 
 
@@ -135,6 +135,9 @@ static inline int __init doccheck(unsigned long potential, unsigned long physadr
 		 window, DOCControl);
 #endif /* !DOC_PASSIVE_PROBE */	
 
+	/* We need to read the ChipID register four times. For some
+	   newer DiskOnChip 2000 units, the first three reads will
+	   return the DiskOnChip Millennium ident. Don't ask. */
 	ChipID = ReadDOC(window, ChipID);
   
 	switch (ChipID) {
@@ -148,6 +151,12 @@ static inline int __init doccheck(unsigned long potential, unsigned long physadr
 		break;
 		
 	case DOC_ChipID_DocMil:
+		/* Check for the new 2000 with Millennium ASIC */
+		ReadDOC(window, ChipID);
+		ReadDOC(window, ChipID);
+		if (ReadDOC(window, ChipID) != DOC_ChipID_DocMil)
+			ChipID = DOC_ChipID_Doc2kTSOP;
+
 		/* Check the TOGGLE bit in the ECC register */
 		tmp  = ReadDOC(window, ECCConf) & DOC_TOGGLE_BIT;
 		tmpb = ReadDOC(window, ECCConf) & DOC_TOGGLE_BIT;
@@ -191,7 +200,6 @@ static inline int __init doccheck(unsigned long potential, unsigned long physadr
 			tmpc = ReadDOC(window, Mplus_Toggle) & DOC_TOGGLE_BIT;
 			if (tmp != tmpb && tmp == tmpc)
 					return ChipID;
-			break;
 		default:
 			break;
 		}
@@ -199,8 +207,8 @@ static inline int __init doccheck(unsigned long potential, unsigned long physadr
 
 	default:
 
-#ifndef CONFIG_MTD_DOCPROBE_55AA
-		printk(KERN_WARNING "Possible DiskOnChip with unknown ChipID %2.2X found at 0x%lx\n",
+#ifdef CONFIG_MTD_DOCPROBE_55AA
+		printk(KERN_DEBUG "Possible DiskOnChip with unknown ChipID %2.2X found at 0x%lx\n",
 		       ChipID, physadr);
 #endif
 #ifndef DOC_PASSIVE_PROBE
@@ -241,6 +249,12 @@ static void __init DoC_Probe(unsigned long physadr)
 		return;
 	
 	if ((ChipID = doccheck(docptr, physadr))) {
+		if (ChipID == DOC_ChipID_Doc2kTSOP) {
+			/* Remove this at your own peril. The hardware driver works but nothing prevents you from erasing bad blocks */
+			printk(KERN_NOTICE "Refusing to drive DiskOnChip 2000 TSOP until Bad Block Table is correctly supported by INFTL\n");
+			iounmap((void *)docptr);
+			return;
+		}
 		docfound = 1;
 		mtd = kmalloc(sizeof(struct DiskOnChip) + sizeof(struct mtd_info), GFP_KERNEL);
 
@@ -262,6 +276,12 @@ static void __init DoC_Probe(unsigned long physadr)
 		sprintf(namebuf, "with ChipID %2.2X", ChipID);
 
 		switch(ChipID) {
+		case DOC_ChipID_Doc2kTSOP:
+			name="2000 TSOP";
+			im_funcname = "DoC2k_init";
+			im_modname = "doc2000";
+			break;
+			
 		case DOC_ChipID_Doc2k:
 			name="2000";
 			im_funcname = "DoC2k_init";
diff --git a/drivers/mtd/devices/lart.c b/drivers/mtd/devices/lart.c
index f60195ec5..dfd335e4a 100644
--- a/drivers/mtd/devices/lart.c
+++ b/drivers/mtd/devices/lart.c
@@ -2,7 +2,7 @@
 /*
  * MTD driver for the 28F160F3 Flash Memory (non-CFI) on LART.
  *
- * $Id: lart.c,v 1.5 2003/05/20 21:03:07 dwmw2 Exp $
+ * $Id: lart.c,v 1.7 2004/08/09 13:19:44 dwmw2 Exp $
  *
  * Author: Abraham vd Merwe <abraham@2d3d.co.za>
  *
@@ -433,7 +433,7 @@ static int flash_erase (struct mtd_info *mtd,struct erase_info *instr)
 	 }
 
    instr->state = MTD_ERASE_DONE;
-   if (instr->callback) instr->callback (instr);
+   mtd_erase_callback(instr);
 
    return (0);
 }
diff --git a/drivers/mtd/devices/ms02-nv.c b/drivers/mtd/devices/ms02-nv.c
index e7f49a5ca..42417b054 100644
--- a/drivers/mtd/devices/ms02-nv.c
+++ b/drivers/mtd/devices/ms02-nv.c
@@ -1,12 +1,12 @@
 /*
- *      Copyright (c) 2001 Maciej W. Rozycki
+ *	Copyright (c) 2001 Maciej W. Rozycki
  *
- *      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 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.
  *
- *	$Id: ms02-nv.c,v 1.4 2003/05/20 21:03:07 dwmw2 Exp $
+ *	$Id: ms02-nv.c,v 1.7 2004/07/29 14:16:45 macro Exp $
  */
 
 #include <linux/init.h>
@@ -29,18 +29,18 @@
 
 
 static char version[] __initdata =
-        "ms02-nv.c: v.1.0.0  13 Aug 2001  Maciej W. Rozycki.\n";
+	"ms02-nv.c: v.1.0.0  13 Aug 2001  Maciej W. Rozycki.\n";
 
-MODULE_AUTHOR("Maciej W. Rozycki <macro@ds2.pg.gda.pl>");
+MODULE_AUTHOR("Maciej W. Rozycki <macro@linux-mips.org>");
 MODULE_DESCRIPTION("DEC MS02-NV NVRAM module driver");
 MODULE_LICENSE("GPL");
 
 
 /*
  * Addresses we probe for an MS02-NV at.  Modules may be located
- * at any 8MB boundary within a 0MB up to 112MB range or at any 32MB
- * boundary within a 0MB up to 448MB range.  We don't support a module
- * at 0MB, though.
+ * at any 8MiB boundary within a 0MiB up to 112MiB range or at any 32MiB
+ * boundary within a 0MiB up to 448MiB range.  We don't support a module
+ * at 0MiB, though.
  */
 static ulong ms02nv_addrs[] __initdata = {
 	0x07000000, 0x06800000, 0x06000000, 0x05800000, 0x05000000,
@@ -130,7 +130,7 @@ static int __init ms02nv_init_one(ulong addr)
 
 	int ret = -ENODEV;
 
-	/* The module decodes 8MB of address space. */
+	/* The module decodes 8MiB of address space. */
 	mod_res = kmalloc(sizeof(*mod_res), GFP_KERNEL);
 	if (!mod_res)
 		return -ENOMEM;
@@ -233,7 +233,7 @@ static int __init ms02nv_init_one(ulong addr)
 		goto err_out_csr_res;
 	}
 
-	printk(KERN_INFO "mtd%d: %s at 0x%08lx, size %uMB.\n",
+	printk(KERN_INFO "mtd%d: %s at 0x%08lx, size %uMiB.\n",
 		mtd->index, ms02nv_name, addr, size >> 20);
 
 	mp->next = root_ms02nv_mtd;
@@ -293,12 +293,12 @@ static int __init ms02nv_init(void)
 
 	switch (mips_machtype) {
 	case MACH_DS5000_200:
-		csr = (volatile u32 *)KN02_CSR_ADDR;
+		csr = (volatile u32 *)KN02_CSR_BASE;
 		if (*csr & KN02_CSR_BNK32M)
 			stride = 2;
 		break;
 	case MACH_DS5000_2X0:
-	case MACH_DS5000:
+	case MACH_DS5900:
 		csr = (volatile u32 *)KN03_MCR_BASE;
 		if (*csr & KN03_MCR_BNK32M)
 			stride = 2;
diff --git a/drivers/mtd/devices/ms02-nv.h b/drivers/mtd/devices/ms02-nv.h
index fb1ec1056..8a6eef7cf 100644
--- a/drivers/mtd/devices/ms02-nv.h
+++ b/drivers/mtd/devices/ms02-nv.h
@@ -1,34 +1,96 @@
 /*
- *      Copyright (c) 2001 Maciej W. Rozycki
+ *	Copyright (c) 2001, 2003  Maciej W. Rozycki
  *
- *      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.
+ *	DEC MS02-NV (54-20948-01) battery backed-up NVRAM module for
+ *	DECstation/DECsystem 5000/2x0 and DECsystem 5900 and 5900/260
+ *	systems.
  *
- *	$Id: ms02-nv.h,v 1.1 2002/09/13 13:46:55 dwmw2 Exp $
+ *	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.
+ *
+ *	$Id: ms02-nv.h,v 1.3 2003/08/19 09:25:36 dwmw2 Exp $
  */
 
 #include <linux/ioport.h>
 #include <linux/mtd/mtd.h>
 
+/*
+ * Addresses are decoded as follows:
+ *
+ * 0x000000 - 0x3fffff	SRAM
+ * 0x400000 - 0x7fffff	CSR
+ *
+ * Within the SRAM area the following ranges are forced by the system
+ * firmware:
+ *
+ * 0x000000 - 0x0003ff	diagnostic area, destroyed upon a reboot
+ * 0x000400 - ENDofRAM	storage area, available to operating systems
+ *
+ * but we can't really use the available area right from 0x000400 as
+ * the first word is used by the firmware as a status flag passed
+ * from an operating system.  If anything but the valid data magic
+ * ID value is found, the firmware considers the SRAM clean, i.e.
+ * containing no valid data, and disables the battery resulting in
+ * data being erased as soon as power is switched off.  So the choice
+ * for the start address of the user-available is 0x001000 which is
+ * nicely page aligned.  The area between 0x000404 and 0x000fff may
+ * be used by the driver for own needs.
+ *
+ * The diagnostic area defines two status words to be read by an
+ * operating system, a magic ID to distinguish a MS02-NV board from
+ * anything else and a status information providing results of tests
+ * as well as the size of SRAM available, which can be 1MiB or 2MiB
+ * (that's what the firmware handles; no idea if 2MiB modules ever
+ * existed).
+ *
+ * The firmware only handles the MS02-NV board if installed in the
+ * last (15th) slot, so for any other location the status information
+ * stored in the SRAM cannot be relied upon.  But from the hardware
+ * point of view there is no problem using up to 14 such boards in a
+ * system -- only the 1st slot needs to be filled with a DRAM module.
+ * The MS02-NV board is ECC-protected, like other MS02 memory boards.
+ *
+ * The state of the battery as provided by the CSR is reflected on
+ * the two onboard LEDs.  When facing the battery side of the board,
+ * with the LEDs at the top left and the battery at the bottom right
+ * (i.e. looking from the back side of the system box), their meaning
+ * is as follows (the system has to be powered on):
+ *
+ * left LED		battery disable status: lit = enabled
+ * right LED		battery condition status: lit = OK
+ */
+
 /* MS02-NV iomem register offsets. */
 #define MS02NV_CSR		0x400000	/* control & status register */
 
+/* MS02-NV CSR status bits. */
+#define MS02NV_CSR_BATT_OK	0x01		/* battery OK */
+#define MS02NV_CSR_BATT_OFF	0x02		/* battery disabled */
+
+
 /* MS02-NV memory offsets. */
 #define MS02NV_DIAG		0x0003f8	/* diagnostic status */
 #define MS02NV_MAGIC		0x0003fc	/* MS02-NV magic ID */
-#define MS02NV_RAM		0x000400	/* general-purpose RAM start */
+#define MS02NV_VALID		0x000400	/* valid data magic ID */
+#define MS02NV_RAM		0x001000	/* user-exposed RAM start */
 
-/* MS02-NV diagnostic status constants. */
-#define MS02NV_DIAG_SIZE_MASK	0xf0		/* RAM size mask */
-#define MS02NV_DIAG_SIZE_SHIFT	0x10		/* RAM size shift (left) */
+/* MS02-NV diagnostic status bits. */
+#define MS02NV_DIAG_TEST	0x01		/* SRAM test done (?) */
+#define MS02NV_DIAG_RO		0x02		/* SRAM r/o test done */
+#define MS02NV_DIAG_RW		0x04		/* SRAM r/w test done */
+#define MS02NV_DIAG_FAIL	0x08		/* SRAM test failed */
+#define MS02NV_DIAG_SIZE_MASK	0xf0		/* SRAM size mask */
+#define MS02NV_DIAG_SIZE_SHIFT	0x10		/* SRAM size shift (left) */
 
 /* MS02-NV general constants. */
 #define MS02NV_ID		0x03021966	/* MS02-NV magic ID value */
+#define MS02NV_VALID_ID		0xbd100248	/* valid data magic ID value */
 #define MS02NV_SLOT_SIZE	0x800000	/* size of the address space
 						   decoded by the module */
 
+
 typedef volatile u32 ms02nv_uint;
 
 struct ms02nv_private {
diff --git a/drivers/mtd/devices/mtdram.c b/drivers/mtd/devices/mtdram.c
index 64397ddf8..5fe0a0865 100644
--- a/drivers/mtd/devices/mtdram.c
+++ b/drivers/mtd/devices/mtdram.c
@@ -1,6 +1,6 @@
 /*
  * mtdram - a test mtd device
- * $Id: mtdram.c,v 1.32 2003/05/21 15:15:07 dwmw2 Exp $
+ * $Id: mtdram.c,v 1.33 2004/08/09 13:19:44 dwmw2 Exp $
  * Author: Alexander Larsson <alex@cendio.se>
  *
  * Copyright (c) 1999 Alexander Larsson <alex@cendio.se>
@@ -57,9 +57,8 @@ ram_erase(struct mtd_info *mtd, struct erase_info *instr)
   memset((char *)mtd->priv + instr->addr, 0xff, instr->len);
 	
   instr->state = MTD_ERASE_DONE;
+  mtd_erase_callback(instr);
 
-  if (instr->callback)
-    (*(instr->callback))(instr);
   return 0;
 }
 
diff --git a/drivers/mtd/devices/phram.c b/drivers/mtd/devices/phram.c
index 5f66e9bfb..03a955cdf 100644
--- a/drivers/mtd/devices/phram.c
+++ b/drivers/mtd/devices/phram.c
@@ -1,6 +1,6 @@
 /**
  *
- * $Id: phram.c,v 1.1 2003/08/21 17:52:30 joern Exp $
+ * $Id: phram.c,v 1.2 2004/08/09 13:19:44 dwmw2 Exp $
  *
  * Copyright (c) Jochen Schaeuble <psionic@psionic.de>
  * 07/2003	rewritten by Joern Engel <joern@wh.fh-wedel.de>
@@ -55,10 +55,7 @@ int phram_erase(struct mtd_info *mtd, struct erase_info *instr)
 
 	instr->state = MTD_ERASE_DONE;
 
-	if (instr->callback)
-		(*(instr->callback))(instr);
-	else
-		kfree(instr);
+	mtd_erase_callback(instr);
 
 	return 0;
 }
diff --git a/drivers/mtd/devices/pmc551.c b/drivers/mtd/devices/pmc551.c
index 14308850a..c2c2a3c36 100644
--- a/drivers/mtd/devices/pmc551.c
+++ b/drivers/mtd/devices/pmc551.c
@@ -1,5 +1,5 @@
 /*
- * $Id: pmc551.c,v 1.24 2003/05/20 21:03:08 dwmw2 Exp $
+ * $Id: pmc551.c,v 1.28 2004/08/09 13:19:44 dwmw2 Exp $
  *
  * PMC551 PCI Mezzanine Ram Device
  *
@@ -109,12 +109,6 @@
 #include <linux/mtd/pmc551.h>
 #include <linux/mtd/compatmac.h>
 
-#if LINUX_VERSION_CODE > 0x20300
-#define PCI_BASE_ADDRESS(dev) (dev->resource[0].start)
-#else
-#define PCI_BASE_ADDRESS(dev) (dev->base_address[0])
-#endif
-
 static struct mtd_info *pmc551list;
 
 static int pmc551_erase (struct mtd_info *mtd, struct erase_info *instr)
@@ -175,9 +169,7 @@ out:
 	printk(KERN_DEBUG "pmc551_erase() done\n");
 #endif
 
-        if (instr->callback) {
-                (*(instr->callback))(instr);
-	}
+        mtd_erase_callback(instr);
         return 0;
 }
 
@@ -564,7 +556,7 @@ static u32 fixup_pmc551 (struct pci_dev *dev)
 	       (size<1024)?size:(size<1048576)?size>>10:size>>20,
                (size<1024)?'B':(size<1048576)?'K':'M',
 	       size, ((dcmd&(0x1<<3)) == 0)?"non-":"",
-               PCI_BASE_ADDRESS(dev)&PCI_BASE_ADDRESS_MEM_MASK );
+               (dev->resource[0].start)&PCI_BASE_ADDRESS_MEM_MASK );
 
         /*
          * Check to see the state of the memory
@@ -694,7 +686,7 @@ int __init init_pmc551(void)
                 }
 
                 printk(KERN_NOTICE "pmc551: Found PCI V370PDC at 0x%lX\n",
-				    PCI_BASE_ADDRESS(PCI_Device));
+				    PCI_Device->resource[0].start);
 
                 /*
                  * The PMC551 device acts VERY weird if you don't init it
@@ -748,7 +740,7 @@ int __init init_pmc551(void)
 			printk(KERN_NOTICE "pmc551: Using specified aperture size %dM\n", asize>>20);
 			priv->asize = asize;
 		}
-                priv->start = ioremap((PCI_BASE_ADDRESS(PCI_Device)
+                priv->start = ioremap(((PCI_Device->resource[0].start)
                                        & PCI_BASE_ADDRESS_MEM_MASK),
                                       priv->asize);
 		
diff --git a/drivers/mtd/devices/slram.c b/drivers/mtd/devices/slram.c
index 4dbcfcfd6..fd579ae45 100644
--- a/drivers/mtd/devices/slram.c
+++ b/drivers/mtd/devices/slram.c
@@ -1,6 +1,6 @@
 /*======================================================================
 
-  $Id: slram.c,v 1.30 2003/05/20 21:03:08 dwmw2 Exp $
+  $Id: slram.c,v 1.31 2004/08/09 13:19:44 dwmw2 Exp $
 
   This driver provides a method to access memory not used by the kernel
   itself (i.e. if the kernel commandline mem=xxx is used). To actually
@@ -98,12 +98,7 @@ int slram_erase(struct mtd_info *mtd, struct erase_info *instr)
 
 	instr->state = MTD_ERASE_DONE;
 
-	if (instr->callback) {
-		(*(instr->callback))(instr);
-	}
-	else {
-		kfree(instr);
-	}
+	mtd_erase_callback(instr);
 
 	return(0);
 }
diff --git a/drivers/mtd/ftl.c b/drivers/mtd/ftl.c
index 4e2d14ce4..f298aee18 100644
--- a/drivers/mtd/ftl.c
+++ b/drivers/mtd/ftl.c
@@ -1,5 +1,5 @@
 /* This version ported to the Linux-MTD system by dwmw2@infradead.org
- * $Id: ftl.c,v 1.51 2003/06/23 12:00:08 dwmw2 Exp $
+ * $Id: ftl.c,v 1.53 2004/08/09 13:55:43 dwmw2 Exp $
  *
  * Fixes: Arnaldo Carvalho de Melo <acme@conectiva.com.br>
  * - fixes some leaks on failure in build_maps and ftl_notify_add, cleanups
@@ -167,7 +167,8 @@ static int scan_header(partition_t *part)
 {
     erase_unit_header_t header;
     loff_t offset, max_offset;
-    int ret;
+    size_t ret;
+    int err;
     part->header.FormattedSize = 0;
     max_offset = (0x100000<part->mbd.mtd->size)?0x100000:part->mbd.mtd->size;
     /* Search first megabyte for a valid FTL header */
@@ -175,11 +176,11 @@ static int scan_header(partition_t *part)
 	 (offset + sizeof(header)) < max_offset;
 	 offset += part->mbd.mtd->erasesize ? : 0x2000) {
 
-	ret = part->mbd.mtd->read(part->mbd.mtd, offset, sizeof(header), &ret, 
+	err = part->mbd.mtd->read(part->mbd.mtd, offset, sizeof(header), &ret, 
 			      (unsigned char *)&header);
 	
-	if (ret) 
-	    return ret;
+	if (err) 
+	    return err;
 
 	if (strcmp(header.DataOrgTuple+3, "FTL100") == 0) break;
     }
@@ -958,7 +959,7 @@ static int ftl_write(partition_t *part, caddr_t buffer,
 	if (ret) {
 	    printk(KERN_NOTICE "ftl_cs: block write failed!\n");
 	    printk(KERN_NOTICE "ftl_cs:   log_addr = 0x%x, virt_addr"
-		   " = 0x%x, Offset = 0x%x\n", log_addr, virt_addr,
+		   " = 0x%x, Offset = 0x%zx\n", log_addr, virt_addr,
 		   offset);
 	    return -EIO;
 	}
@@ -1093,7 +1094,7 @@ struct mtd_blktrans_ops ftl_tr = {
 
 int init_ftl(void)
 {
-	DEBUG(0, "$Id: ftl.c,v 1.51 2003/06/23 12:00:08 dwmw2 Exp $\n");
+	DEBUG(0, "$Id: ftl.c,v 1.53 2004/08/09 13:55:43 dwmw2 Exp $\n");
 
 	return register_mtd_blktrans(&ftl_tr);
 }
diff --git a/drivers/mtd/inftlcore.c b/drivers/mtd/inftlcore.c
index 2417fba1b..ea32c03e6 100644
--- a/drivers/mtd/inftlcore.c
+++ b/drivers/mtd/inftlcore.c
@@ -7,7 +7,7 @@
  * (c) 1999 Machine Vision Holdings, Inc.
  * Author: David Woodhouse <dwmw2@infradead.org>
  *
- * $Id: inftlcore.c,v 1.14 2003/06/26 08:28:26 dwmw2 Exp $
+ * $Id: inftlcore.c,v 1.17 2004/08/09 13:56:48 dwmw2 Exp $
  *
  * 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
@@ -55,9 +55,19 @@ static void inftl_add_mtd(struct mtd_blktrans_ops *tr, struct mtd_info *mtd)
 	struct INFTLrecord *inftl;
 	unsigned long temp;
 
-	if (mtd->ecctype != MTD_ECC_RS_DiskOnChip)
+	if (mtd->type != MTD_NANDFLASH)
+		return;
+	/* OK, this is moderately ugly.  But probably safe.  Alternatives? */
+	if (memcmp(mtd->name, "DiskOnChip", 10))
 		return;
 
+	if (!mtd->block_isbad) {
+		printk(KERN_ERR
+"INFTL no longer supports the old DiskOnChip drivers loaded via docprobe.\n"
+"Please use the new diskonchip driver under the NAND subsystem.\n");
+		return;
+	}
+
 	DEBUG(MTD_DEBUG_LEVEL3, "INFTL: add_mtd for %s\n", mtd->name);
 
 	inftl = kmalloc(sizeof(*inftl), GFP_KERNEL);
@@ -72,6 +82,8 @@ static void inftl_add_mtd(struct mtd_blktrans_ops *tr, struct mtd_info *mtd)
 	inftl->mbd.devnum = -1;
 	inftl->mbd.blksize = 512;
 	inftl->mbd.tr = tr;
+	memcpy(&inftl->oobinfo, &mtd->oobinfo, sizeof(struct nand_oobinfo));
+	inftl->oobinfo.useecc = MTD_NANDECC_PLACEONLY;
 
         if (INFTL_mount(inftl) < 0) {
 		printk(KERN_WARNING "INFTL: could not mount device\n");
@@ -155,8 +167,8 @@ static u16 INFTL_findfreeblock(struct INFTLrecord *inftl, int desperate)
 	u16 pot = inftl->LastFreeEUN;
 	int silly = inftl->nb_blocks;
 
-	DEBUG(MTD_DEBUG_LEVEL3, "INFTL: INFTL_findfreeblock(inftl=0x%x,"
-		"desperate=%d)\n", (int)inftl, desperate);
+	DEBUG(MTD_DEBUG_LEVEL3, "INFTL: INFTL_findfreeblock(inftl=%p,"
+		"desperate=%d)\n", inftl, desperate);
 
 	/*
 	 * Normally, we force a fold to happen before we run out of free
@@ -198,8 +210,8 @@ static u16 INFTL_foldchain(struct INFTLrecord *inftl, unsigned thisVUC, unsigned
 	struct inftl_oob oob;
         size_t retlen;
 
-	DEBUG(MTD_DEBUG_LEVEL3, "INFTL: INFTL_foldchain(inftl=0x%x,thisVUC=%d,"
-		"pending=%d)\n", (int)inftl, thisVUC, pendingblock);
+	DEBUG(MTD_DEBUG_LEVEL3, "INFTL: INFTL_foldchain(inftl=%p,thisVUC=%d,"
+		"pending=%d)\n", inftl, thisVUC, pendingblock);
 
 	memset(BlockMap, 0xff, sizeof(BlockMap));
 	memset(BlockDeleted, 0, sizeof(BlockDeleted));
@@ -284,21 +296,22 @@ static u16 INFTL_foldchain(struct INFTLrecord *inftl, unsigned thisVUC, unsigned
                 if (BlockMap[block] == BLOCK_NIL)
                         continue;
                 
-                ret = MTD_READECC(inftl->mbd.mtd, (inftl->EraseSize *
+                ret = MTD_READ(inftl->mbd.mtd, (inftl->EraseSize *
 			BlockMap[block]) + (block * SECTORSIZE), SECTORSIZE,
-			&retlen, movebuf, (char *)&oob, NULL); 
+			&retlen, movebuf); 
                 if (ret < 0) {
-			ret = MTD_READECC(inftl->mbd.mtd, (inftl->EraseSize *
+			ret = MTD_READ(inftl->mbd.mtd, (inftl->EraseSize *
 				BlockMap[block]) + (block * SECTORSIZE),
-				SECTORSIZE, &retlen, movebuf, (char *)&oob,
-				NULL); 
+				SECTORSIZE, &retlen, movebuf);
 			if (ret != -EIO) 
                         	DEBUG(MTD_DEBUG_LEVEL1, "INFTL: error went "
 					"away on retry?\n");
                 }
+                memset(&oob, 0xff, sizeof(struct inftl_oob));
+                oob.b.Status = oob.b.Status1 = SECTOR_USED;
                 MTD_WRITEECC(inftl->mbd.mtd, (inftl->EraseSize * targetEUN) +
 			(block * SECTORSIZE), SECTORSIZE, &retlen,
-			movebuf, (char *)&oob, NULL);
+			movebuf, (char *)&oob, &inftl->oobinfo);
 	}
 
 	/*
@@ -326,7 +339,6 @@ static u16 INFTL_foldchain(struct INFTLrecord *inftl, unsigned thisVUC, unsigned
                 if (INFTL_formatblock(inftl, thisEUN) < 0) {
 			/*
 			 * Could not erase : mark block as reserved.
-			 * FixMe: Update Bad Unit Table on disk.
 			 */
 			inftl->PUtable[thisEUN] = BLOCK_RESERVED;
                 } else {
@@ -354,8 +366,8 @@ u16 INFTL_makefreeblock(struct INFTLrecord *inftl, unsigned pendingblock)
 	u16 ChainLength = 0, thislen;
 	u16 chain, EUN;
 
-	DEBUG(MTD_DEBUG_LEVEL3, "INFTL: INFTL_makefreeblock(inftl=0x%x,"
-		"pending=%d)\n", (int)inftl, pendingblock);
+	DEBUG(MTD_DEBUG_LEVEL3, "INFTL: INFTL_makefreeblock(inftl=%p,"
+		"pending=%d)\n", inftl, pendingblock);
 
 	for (chain = 0; chain < inftl->nb_blocks; chain++) {
 		EUN = inftl->VUtable[chain];
@@ -416,8 +428,8 @@ static inline u16 INFTL_findwriteunit(struct INFTLrecord *inftl, unsigned block)
 	size_t retlen;
 	int silly, silly2 = 3;
 
-	DEBUG(MTD_DEBUG_LEVEL3, "INFTL: INFTL_findwriteunit(inftl=0x%x,"
-		"block=%d)\n", (int)inftl, block);
+	DEBUG(MTD_DEBUG_LEVEL3, "INFTL: INFTL_findwriteunit(inftl=%p,"
+		"block=%d)\n", inftl, block);
 
 	do {
 		/*
@@ -578,8 +590,8 @@ static void INFTL_trydeletechain(struct INFTLrecord *inftl, unsigned thisVUC)
 	struct inftl_bci bci;
 	size_t retlen;
 
-	DEBUG(MTD_DEBUG_LEVEL3, "INFTL: INFTL_trydeletechain(inftl=0x%x,"
-		"thisVUC=%d)\n", (int)inftl, thisVUC);
+	DEBUG(MTD_DEBUG_LEVEL3, "INFTL: INFTL_trydeletechain(inftl=%p,"
+		"thisVUC=%d)\n", inftl, thisVUC);
 
 	memset(BlockUsed, 0, sizeof(BlockUsed));
 	memset(BlockDeleted, 0, sizeof(BlockDeleted));
@@ -668,7 +680,6 @@ static void INFTL_trydeletechain(struct INFTLrecord *inftl, unsigned thisVUC)
                 if (INFTL_formatblock(inftl, thisEUN) < 0) {
 			/*
 			 * Could not erase : mark block as reserved.
-			 * FixMe: Update Bad Unit Table on medium.
 			 */
 			inftl->PUtable[thisEUN] = BLOCK_RESERVED;
                 } else {
@@ -698,8 +709,8 @@ static int INFTL_deleteblock(struct INFTLrecord *inftl, unsigned block)
 	size_t retlen;
 	struct inftl_bci bci;
 
-	DEBUG(MTD_DEBUG_LEVEL3, "INFTL: INFTL_deleteblock(inftl=0x%x,"
-		"block=%d)\n", (int)inftl, block);
+	DEBUG(MTD_DEBUG_LEVEL3, "INFTL: INFTL_deleteblock(inftl=%p,"
+		"block=%d)\n", inftl, block);
 
 	while (thisEUN < inftl->nb_blocks) {
 		if (MTD_READOOB(inftl->mbd.mtd, (thisEUN * inftl->EraseSize) +
@@ -754,11 +765,11 @@ static int inftl_writeblock(struct mtd_blktrans_dev *mbd, unsigned long block,
 	unsigned int writeEUN;
 	unsigned long blockofs = (block * SECTORSIZE) & (inftl->EraseSize - 1);
 	size_t retlen;
-	u8 eccbuf[6];
+	struct inftl_oob oob;
 	char *p, *pend;
 
-	DEBUG(MTD_DEBUG_LEVEL3, "INFTL: inftl_writeblock(inftl=0x%x,block=%ld,"
-		"buffer=0x%x)\n", (int)inftl, block, (int)buffer);
+	DEBUG(MTD_DEBUG_LEVEL3, "INFTL: inftl_writeblock(inftl=%p,block=%ld,"
+		"buffer=%p)\n", inftl, block, buffer);
 
 	/* Is block all zero? */
 	pend = buffer + SECTORSIZE;
@@ -778,11 +789,13 @@ static int inftl_writeblock(struct mtd_blktrans_dev *mbd, unsigned long block,
 			return 1;
 		}
 
+		memset(&oob, 0xff, sizeof(struct inftl_oob));
+		oob.b.Status = oob.b.Status1 = SECTOR_USED;
 		MTD_WRITEECC(inftl->mbd.mtd, (writeEUN * inftl->EraseSize) +
 			blockofs, SECTORSIZE, &retlen, (char *)buffer,
-			(char *)eccbuf, NULL);
+			(char *)&oob, &inftl->oobinfo);
 		/*
-		 * No need to write SECTOR_USED flags since they are written
+		 * need to write SECTOR_USED flags since they are not written
 		 * in mtd_writeecc
 		 */
 	} else {
@@ -803,8 +816,8 @@ static int inftl_readblock(struct mtd_blktrans_dev *mbd, unsigned long block,
         struct inftl_bci bci;
 	size_t retlen;
 
-	DEBUG(MTD_DEBUG_LEVEL3, "INFTL: inftl_readblock(inftl=0x%x,block=%ld,"
-		"buffer=0x%x)\n", (int)inftl, block, (int)buffer);
+	DEBUG(MTD_DEBUG_LEVEL3, "INFTL: inftl_readblock(inftl=%p,block=%ld,"
+		"buffer=%p)\n", inftl, block, buffer);
 
 	while (thisEUN < inftl->nb_blocks) {
 		if (MTD_READOOB(inftl->mbd.mtd, (thisEUN * inftl->EraseSize) +
@@ -846,9 +859,8 @@ foundit:
 	} else {
         	size_t retlen;
 		loff_t ptr = (thisEUN * inftl->EraseSize) + blockofs;
-		u_char eccbuf[6];
-		if (MTD_READECC(inftl->mbd.mtd, ptr, SECTORSIZE, &retlen,
-		    buffer, eccbuf, NULL))
+		if (MTD_READ(inftl->mbd.mtd, ptr, SECTORSIZE, &retlen,
+		    buffer))
 			return -EIO;
 	}
 	return 0;
@@ -881,7 +893,7 @@ extern char inftlmountrev[];
 
 int __init init_inftl(void)
 {
-	printk(KERN_INFO "INFTL: inftlcore.c $Revision: 1.14 $, "
+	printk(KERN_INFO "INFTL: inftlcore.c $Revision: 1.17 $, "
 		"inftlmount.c %s\n", inftlmountrev);
 
 	return register_mtd_blktrans(&inftl_tr);
diff --git a/drivers/mtd/inftlmount.c b/drivers/mtd/inftlmount.c
index 042c4eead..64cc97ca7 100644
--- a/drivers/mtd/inftlmount.c
+++ b/drivers/mtd/inftlmount.c
@@ -8,7 +8,7 @@
  * Author: Fabrice Bellard (fabrice.bellard@netgem.com) 
  * Copyright (C) 2000 Netgem S.A.
  *
- * $Id: inftlmount.c,v 1.11 2003/06/23 07:39:21 dwmw2 Exp $
+ * $Id: inftlmount.c,v 1.14 2004/08/09 13:57:42 dwmw2 Exp $
  *
  * 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
@@ -41,7 +41,7 @@
 #include <linux/mtd/inftl.h>
 #include <linux/mtd/compatmac.h>
 
-char inftlmountrev[]="$Revision: 1.11 $";
+char inftlmountrev[]="$Revision: 1.14 $";
 
 /*
  * find_boot_record: Find the INFTL Media Header and its Spare copy which
@@ -54,14 +54,13 @@ static int find_boot_record(struct INFTLrecord *inftl)
 {
 	struct inftl_unittail h1;
 	//struct inftl_oob oob;
-	unsigned int i, block, boot_record_count = 0;
+	unsigned int i, block;
 	u8 buf[SECTORSIZE];
 	struct INFTLMediaHeader *mh = &inftl->MediaHdr;
 	struct INFTLPartition *ip;
-	int retlen;
+	size_t retlen;
 
-	DEBUG(MTD_DEBUG_LEVEL3, "INFTL: find_boot_record(inftl=0x%x)\n",
-		(int)inftl);
+	DEBUG(MTD_DEBUG_LEVEL3, "INFTL: find_boot_record(inftl=%p)\n", inftl);
 
         /*
 	 * Assume logical EraseSize == physical erasesize for starting the
@@ -72,7 +71,6 @@ static int find_boot_record(struct INFTLrecord *inftl)
         inftl->nb_blocks = inftl->mbd.mtd->size / inftl->EraseSize;
 
 	inftl->MediaUnit = BLOCK_NIL;
-	inftl->SpareMediaUnit = BLOCK_NIL;
 
 	/* Search for a valid boot record */
 	for (block = 0; block < inftl->nb_blocks; block++) {
@@ -82,8 +80,11 @@ static int find_boot_record(struct INFTLrecord *inftl)
 		 * Check for BNAND header first. Then whinge if it's found
 		 * but later checks fail.
 		 */
-		if ((ret = MTD_READ(inftl->mbd.mtd, block * inftl->EraseSize,
-		    SECTORSIZE, &retlen, buf))) {
+		ret = MTD_READ(inftl->mbd.mtd, block * inftl->EraseSize,
+		    SECTORSIZE, &retlen, buf);
+		/* We ignore ret in case the ECC of the MediaHeader is invalid
+		   (which is apparently acceptable) */
+		if (retlen != SECTORSIZE) {
 			static int warncount = 5;
 
 			if (warncount) {
@@ -114,36 +115,28 @@ static int find_boot_record(struct INFTLrecord *inftl)
 			continue;
 		}
 
-		if (boot_record_count) {
-			/*
-			 * We've already processed one. So we just check if
-			 * this one is the same as the first one we found.
-			 */
-			if (memcmp(mh, buf, sizeof(struct INFTLMediaHeader))) {
-				printk(KERN_WARNING "INFTL: Media Headers at "
-					"0x%x and 0x%x disagree.\n",
-					inftl->MediaUnit * inftl->EraseSize,
-					block * inftl->EraseSize);
-				return -1;
-			}
-			if (boot_record_count == 1)
-				inftl->SpareMediaUnit = block;
-
-			/*
-			 * Mark this boot record (INFTL MediaHeader) block as
-			 * reserved.
-			 */
-			inftl->PUtable[block] = BLOCK_RESERVED;
-
-			boot_record_count++;
-			continue;
-		}
 
 		/*
 		 * This is the first we've seen.
 		 * Copy the media header structure into place.
 		 */
 		memcpy(mh, buf, sizeof(struct INFTLMediaHeader));
+
+		/* Read the spare media header at offset 4096 */
+		MTD_READ(inftl->mbd.mtd, block * inftl->EraseSize + 4096,
+		    SECTORSIZE, &retlen, buf);
+		if (retlen != SECTORSIZE) {
+			printk(KERN_WARNING "INFTL: Unable to read spare "
+			       "Media Header\n");
+			return -1;
+		}
+		/* Check if this one is the same as the first one we found. */
+		if (memcmp(mh, buf, sizeof(struct INFTLMediaHeader))) {
+			printk(KERN_WARNING "INFTL: Primary and spare Media "
+			       "Headers disagree.\n");
+			return -1;
+		}
+
 		mh->NoOfBootImageBlocks = le32_to_cpu(mh->NoOfBootImageBlocks);
 		mh->NoOfBinaryPartitions = le32_to_cpu(mh->NoOfBinaryPartitions);
 		mh->NoOfBDTLPartitions = le32_to_cpu(mh->NoOfBDTLPartitions);
@@ -197,8 +190,9 @@ static int find_boot_record(struct INFTLrecord *inftl)
 				"UnitSizeFactor 0x%02x is experimental\n",
 				mh->BlockMultiplierBits);
 			inftl->EraseSize = inftl->mbd.mtd->erasesize <<
-				(0xff - mh->BlockMultiplierBits);
+				mh->BlockMultiplierBits;
 			inftl->nb_blocks = inftl->mbd.mtd->size / inftl->EraseSize;
+			block >>= mh->BlockMultiplierBits;
 		}
 
 		/* Scan the partitions */
@@ -293,7 +287,7 @@ static int find_boot_record(struct INFTLrecord *inftl)
 		inftl->PUtable = kmalloc(inftl->nb_blocks * sizeof(u16), GFP_KERNEL);
 		if (!inftl->PUtable) {
 			printk(KERN_WARNING "INFTL: allocation of PUtable "
-				"failed (%d bytes)\n",
+				"failed (%zd bytes)\n",
 				inftl->nb_blocks * sizeof(u16));
 			return -ENOMEM;
 		}
@@ -302,7 +296,7 @@ static int find_boot_record(struct INFTLrecord *inftl)
 		if (!inftl->VUtable) {
 			kfree(inftl->PUtable);
 			printk(KERN_WARNING "INFTL: allocation of VUtable "
-				"failed (%d bytes)\n",
+				"failed (%zd bytes)\n",
 				inftl->nb_blocks * sizeof(u16));
 			return -ENOMEM;
 		}
@@ -317,34 +311,23 @@ static int find_boot_record(struct INFTLrecord *inftl)
 		/* Mark this boot record (NFTL MediaHeader) block as reserved */
 		inftl->PUtable[block] = BLOCK_RESERVED;
 
-#if 0
 		/* Read Bad Erase Unit Table and modify PUtable[] accordingly */
 		for (i = 0; i < inftl->nb_blocks; i++) {
-			if ((i & (SECTORSIZE - 1)) == 0) {
-				/* read one sector for every SECTORSIZE of blocks */
-				if ((ret = MTD_READECC(inftl->mbd.mtd,
-				    block * inftl->EraseSize + i + SECTORSIZE,
-				    SECTORSIZE, &retlen, buf,
-				    (char *)&oob, NULL)) < 0) {
-					printk(KERN_WARNING "INFTL: read of "
-						"bad sector table failed "
-						"(err %d)\n", ret);
-					kfree(inftl->VUtable);
-					kfree(inftl->PUtable);
-					return -1;
-				}
+			int physblock;
+			/* If any of the physical eraseblocks are bad, don't
+			   use the unit. */
+			for (physblock = 0; physblock < inftl->EraseSize; physblock += inftl->mbd.mtd->erasesize) {
+				if (inftl->mbd.mtd->block_isbad(inftl->mbd.mtd, i * inftl->EraseSize + physblock))
+					inftl->PUtable[i] = BLOCK_RESERVED;
 			}
-			/* Mark the Bad Erase Unit as RESERVED in PUtable */
-			if (buf[i & (SECTORSIZE - 1)] != 0xff)
-				inftl->PUtable[i] = BLOCK_RESERVED;
 		}
-#endif
 
 		inftl->MediaUnit = block;
-		boot_record_count++;
+		return 0;
 	}
-		
-	return boot_record_count ? 0 : -1;
+
+	/* Not found. */
+	return -1;
 }
 
 static int memcmpb(void *a, int c, int n)
@@ -364,28 +347,22 @@ static int memcmpb(void *a, int c, int n)
 static int check_free_sectors(struct INFTLrecord *inftl, unsigned int address,
 	int len, int check_oob)
 {
-	int i, retlen;
-	u8 buf[SECTORSIZE];
+	u8 buf[SECTORSIZE + inftl->mbd.mtd->oobsize];
+	size_t retlen;
+	int i;
 
-	DEBUG(MTD_DEBUG_LEVEL3, "INFTL: check_free_sectors(inftl=0x%x,"
-		"address=0x%x,len=%d,check_oob=%d)\n", (int)inftl,
+	DEBUG(MTD_DEBUG_LEVEL3, "INFTL: check_free_sectors(inftl=%p,"
+		"address=0x%x,len=%d,check_oob=%d)\n", inftl,
 		address, len, check_oob);
 
 	for (i = 0; i < len; i += SECTORSIZE) {
-		/*
-		 * We want to read the sector without ECC check here since a
-		 * free sector does not have ECC syndrome on it yet.
-		 */
-		if (MTD_READ(inftl->mbd.mtd, address, SECTORSIZE, &retlen, buf) < 0)
+		if (MTD_READECC(inftl->mbd.mtd, address, SECTORSIZE, &retlen, buf, &buf[SECTORSIZE], &inftl->oobinfo) < 0)
 			return -1;
 		if (memcmpb(buf, 0xff, SECTORSIZE) != 0)
 			return -1;
 
 		if (check_oob) {
-			if (MTD_READOOB(inftl->mbd.mtd, address,
-			    inftl->mbd.mtd->oobsize, &retlen, buf) < 0)
-				return -1;
-			if (memcmpb(buf, 0xff, inftl->mbd.mtd->oobsize) != 0)
+			if (memcmpb(buf + SECTORSIZE, 0xff, inftl->mbd.mtd->oobsize) != 0)
 				return -1;
 		}
 		address += SECTORSIZE;
@@ -402,52 +379,62 @@ static int check_free_sectors(struct INFTLrecord *inftl, unsigned int address,
  * Return: 0 when succeed, -1 on error.
  *
  * ToDo: 1. Is it neceressary to check_free_sector after erasing ?? 
- *       2. UnitSizeFactor != 0xFF
  */
 int INFTL_formatblock(struct INFTLrecord *inftl, int block)
 {
-	int retlen;
+	size_t retlen;
 	struct inftl_unittail uci;
 	struct erase_info *instr = &inftl->instr;
+	int physblock;
 
-	DEBUG(MTD_DEBUG_LEVEL3, "INFTL: INFTL_formatblock(inftl=0x%x,"
-		"block=%d)\n", (int)inftl, block);
+	DEBUG(MTD_DEBUG_LEVEL3, "INFTL: INFTL_formatblock(inftl=%p,"
+		"block=%d)\n", inftl, block);
 
 	memset(instr, 0, sizeof(struct erase_info));
 
+	/* FIXME: Shouldn't we be setting the 'discarded' flag to zero
+	   _first_? */
+
 	/* Use async erase interface, test return code */
 	instr->addr = block * inftl->EraseSize;
-	instr->len = inftl->EraseSize;
-	MTD_ERASE(inftl->mbd.mtd, instr);
+	instr->len = inftl->mbd.mtd->erasesize;
+	/* Erase one physical eraseblock at a time, even though the NAND api
+	   allows us to group them.  This way we if we have a failure, we can
+	   mark only the failed block in the bbt. */
+	for (physblock = 0; physblock < inftl->EraseSize; physblock += instr->len, instr->addr += instr->len) {
+		MTD_ERASE(inftl->mbd.mtd, instr);
+
+		if (instr->state == MTD_ERASE_FAILED) {
+			printk(KERN_WARNING "INFTL: error while formatting block %d\n",
+				block);
+			goto fail;
+		}
 
-	if (instr->state == MTD_ERASE_FAILED) {
 		/*
-		 * Could not format, FixMe: We should update the BadUnitTable 
-		 * both in memory and on disk.
-		 */
-		printk(KERN_WARNING "INFTL: error while formatting block %d\n",
-			block);
-		return -1;
+	 	* Check the "freeness" of Erase Unit before updating metadata.
+	 	* FixMe: is this check really necessary? Since we have check the
+	 	*        return code after the erase operation.
+	 	*/
+		if (check_free_sectors(inftl, instr->addr, instr->len, 1) != 0)
+			goto fail;
 	}
 
-	/*
-	 * Check the "freeness" of Erase Unit before updating metadata.
-	 * FixMe: is this check really necessary? Since we have check the
-	 *        return code after the erase operation.
-	 */
-	if (check_free_sectors(inftl, instr->addr, inftl->EraseSize, 1) != 0)
-		return -1;
-
 	uci.EraseMark = cpu_to_le16(ERASE_MARK);
 	uci.EraseMark1 = cpu_to_le16(ERASE_MARK);
 	uci.Reserved[0] = 0;
 	uci.Reserved[1] = 0;
 	uci.Reserved[2] = 0;
 	uci.Reserved[3] = 0;
-	if (MTD_WRITEOOB(inftl->mbd.mtd, block * inftl->EraseSize + SECTORSIZE * 2 +
+	instr->addr = block * inftl->EraseSize + SECTORSIZE * 2;
+	if (MTD_WRITEOOB(inftl->mbd.mtd, instr->addr +
 	    8, 8, &retlen, (char *)&uci) < 0)
-		return -1;
+		goto fail;
 	return 0;
+fail:
+	/* could not format, update the bad block table (caller is responsible
+	   for setting the PUtable to BLOCK_RESERVED on failure) */
+	inftl->mbd.mtd->block_markbad(inftl->mbd.mtd, instr->addr);
+	return -1;
 }
 
 /*
@@ -472,7 +459,6 @@ static void format_chain(struct INFTLrecord *inftl, unsigned int first_block)
 		if (INFTL_formatblock(inftl, block) < 0) {
 			/*
 			 * Cannot format !!!! Mark it as Bad Unit,
-			 * FixMe: update the BadUnitTable on disk.
 			 */
 			inftl->PUtable[block] = BLOCK_RESERVED;
 		} else {
@@ -565,10 +551,11 @@ int INFTL_mount(struct INFTLrecord *s)
 	int chain_length, do_format_chain;
 	struct inftl_unithead1 h0;
 	struct inftl_unittail h1;
-	int i, retlen;
+	size_t retlen;
+	int i;
 	u8 *ANACtable, ANAC;
 
-	DEBUG(MTD_DEBUG_LEVEL3, "INFTL: INFTL_mount(inftl=0x%x)\n", (int)s);
+	DEBUG(MTD_DEBUG_LEVEL3, "INFTL: INFTL_mount(inftl=%p)\n", s);
 
 	/* Search for INFTL MediaHeader and Spare INFTL Media Header */
 	if (find_boot_record(s) < 0) {
diff --git a/drivers/mtd/maps/Kconfig b/drivers/mtd/maps/Kconfig
index 03d39d703..cdc5bbd16 100644
--- a/drivers/mtd/maps/Kconfig
+++ b/drivers/mtd/maps/Kconfig
@@ -1,5 +1,5 @@
 # drivers/mtd/maps/Kconfig
-# $Id: Kconfig,v 1.12 2003/06/23 07:38:11 dwmw2 Exp $
+# $Id: Kconfig,v 1.30 2004/07/21 00:16:14 jwboyer Exp $
 
 menu "Mapping drivers for chip access"
 	depends on MTD!=n
@@ -19,7 +19,8 @@ config MTD_PHYSMAP
 	  command set driver code to communicate with flash chips which
 	  are mapped physically into the CPU's memory. You will need to
 	  configure the physical address and size of the flash chips on
-	  your particular board as well as the bus width.
+	  your particular board as well as the bus width, either statically
+	  with config options or at run-time.
 
 config MTD_PHYSMAP_START
 	hex "Physical start address of flash mapping"
@@ -30,6 +31,8 @@ config MTD_PHYSMAP_START
 	  are mapped on your particular target board. Refer to the
 	  memory map which should hopefully be in the documentation for
 	  your board.
+	  Ignore this option if you use run-time physmap configuration
+	  (i.e., run-time calling physmap_configure()).
 
 config MTD_PHYSMAP_LEN
 	hex "Physical length of flash mapping"
@@ -42,9 +45,11 @@ config MTD_PHYSMAP_LEN
 	  than the total amount of flash present. Refer to the memory
 	  map which should hopefully be in the documentation for your
 	  board.
+	  Ignore this option if you use run-time physmap configuration
+	  (i.e., run-time calling physmap_configure()).
 
-config MTD_PHYSMAP_BUSWIDTH
-	int "Bus width in octets"
+config MTD_PHYSMAP_BANKWIDTH
+	int "Bank width in octets"
 	depends on MTD_PHYSMAP
 	default "2"
 	help
@@ -52,6 +57,8 @@ config MTD_PHYSMAP_BUSWIDTH
 	  in octets. For example, if you have a data bus width of 32
 	  bits, you would set the bus width octect value to 4. This is
 	  used internally by the CFI drivers.
+	  Ignore this option if you use run-time physmap configuration
+	  (i.e., run-time calling physmap_configure()).
 
 config MTD_SUN_UFLASH
 	tristate "Sun Microsystems userflash support"
@@ -151,11 +158,11 @@ config MTD_AMD76XROM
 
 	  BE VERY CAREFUL.
 
-config MTD_ICH2ROM
-	tristate "BIOS flash chip on Intel Hub Controller 2"
+config MTD_ICHXROM
+	tristate "BIOS flash chip on Intel Controller Hub 2/3/4/5"
 	depends on X86 && MTD_JEDECPROBE && MTD_COMPLEX_MAPPINGS
 	help
-	  Support for treating the BIOS flash chip on ICH2 motherboards
+	  Support for treating the BIOS flash chip on ICHX motherboards
 	  as an MTD device - with this you can reprogram your BIOS.
 
 	  BE VERY CAREFUL.
@@ -177,7 +184,7 @@ config MTD_TSUNAMI
 
 config MTD_LASAT
 	tristate "Flash chips on LASAT board"
-	depends on LASAT && MTD_CFI
+	depends on LASAT
 	help
 	  Support for the flash chips on the Lasat 100 and 200 boards.
 
@@ -210,6 +217,52 @@ config MTD_PB1XXX_USER
 	  You can say 'Y' to both this and 'MTD_PB1XXX_BOOT' above, to use
 	  both banks.
 
+config MTD_PB1550
+	tristate "Flash devices on Alchemy PB1550 board"
+	depends on MIPS && MIPS_PB1550
+	help
+	  Flash memory access on Alchemy Pb1550 board
+
+config MTD_PB1550_BOOT
+	bool "PB1550 boot flash device"
+	depends on MTD_PB1550
+	help
+	  Use the first of the two 64MiB flash banks on Pb1550 board.
+	  You can say 'Y' to both this and 'MTD_PB1550_USER' below, to use
+	  both banks.
+
+config MTD_PB1550_USER
+	bool "PB1550 user flash device"
+	depends on MTD_PB1550
+	default y if MTD_PB1550_BOOT = n
+	help
+	  Use the second of the two 64MiB flash banks on Pb1550 board.
+	  You can say 'Y' to both this and 'MTD_PB1550_BOOT' above, to use
+	  both banks.
+
+config MTD_DB1550
+	tristate "Flash devices on Alchemy DB1550 board"
+	depends on MIPS && MIPS_DB1550
+	help
+	  Flash memory access on Alchemy Db1550 board
+
+config MTD_DB1550_BOOT
+	bool "DB1550 boot flash device"
+	depends on MTD_DB1550
+	help
+	  Use the first of the two 64MiB flash banks on Db1550 board.
+	  You can say 'Y' to both this and 'MTD_DB1550_USER' below, to use
+	  both banks.
+
+config MTD_DB1550_USER
+	bool "DB1550 user flash device"
+	depends on MTD_DB1550
+	default y if MTD_DB1550_BOOT = n
+	help
+	  Use the second of the two 64MiB flash banks on Db1550 board.
+	  You can say 'Y' to both this and 'MTD_DB1550_BOOT' above, to use
+	  both banks.
+
 config MTD_DILNETPC
 	tristate "CFI Flash device mapped on DIL/Net PC"
 	depends on X86 && MTD_CONCAT && MTD_PARTITIONS && MTD_CFI_INTELEXT
@@ -235,6 +288,13 @@ config MTD_L440GX
 
 	  BE VERY CAREFUL.
 
+config MTD_SBC8240
+	tristate "Flash device on SBC8240"
+	depends on PPC32 && MTD_JEDECPROBE && 6xx && 8260
+	help
+          Flash access on the SBC8240 board from Wind River.  See
+          <http://www.windriver.com/products/sbc8240/>
+
 config MTD_TQM8XXL
 	tristate "CFI Flash device mapped on TQM8XXL"
 	depends on MTD_CFI && PPC32 && 8xx && TQM8xxL
@@ -265,7 +325,7 @@ config MTD_MBX860
 
 config MTD_DBOX2
 	tristate "CFI Flash device mapped on D-Box2"
-	depends on PPC32 && 8xx && MTD_CFI_INTELSTD && MTD_CFI_INTELEXT && MTD_CFI_AMDSTD
+	depends on PPC32 && 8xx && DBOX2 && MTD_CFI_INTELSTD && MTD_CFI_INTELEXT && MTD_CFI_AMDSTD
 	help
 	  This enables access routines for the flash chips on the Nokia/Sagem
 	  D-Box 2 board. If you have one of these boards and would like to use
@@ -457,6 +517,13 @@ config MTD_CEIVA
 	  PhotoMax Digital Picture Frame.
 	  If you have such a device, say 'Y'.
 
+config MTD_NOR_TOTO
+	tristate "NOR Flash device on TOTO board"
+	depends on ARM && ARCH_OMAP && OMAP_TOTO
+	help
+	  This enables access to the NOR flash on the Texas Instruments
+	  TOTO board.
+
 config MTD_H720X
 	tristate "Hynix evaluation board mappings"
 	depends on ARM && MTD_CFI && ( ARCH_H7201 || ARCH_H7202 )
@@ -464,6 +531,13 @@ config MTD_H720X
 	  This enables access to the flash chips on the Hynix evaluation boards.
 	  If you have such a board, say 'Y'.
 
+config MTD_MPC1211
+	tristate "CFI Flash device mapped on Interface MPC-1211"
+	depends on SUPERH && SH_MPC1211 && MTD_CFI
+	help
+	  This enables access to the flash chips on the Interface MPC-1211(CTP/PCI/MPC-SH02).
+	  If you have such a board, say 'Y'.
+
 # This needs CFI or JEDEC, depending on the cards found.
 config MTD_PCI
 	tristate "PCI MTD driver"
@@ -491,11 +565,26 @@ config MTD_UCLINUX
 
 config MTD_WRSBC8260
 	tristate "Map driver for WindRiver PowerQUICC II MPC82xx board"
-	depends on MTD_PARTITIONS && SBC82xx
+	depends on (SBC82xx || SBC8560)
+	select MTD_PARTITIONS
+	select MTD_MAP_BANK_WIDTH_4
+	select MTD_MAP_BANK_WIDTH_1
+	select MTD_CFI_I1
+	select MTD_CFI_I4
 	help
 	  Map driver for WindRiver PowerQUICC II MPC82xx board. Drives
 	  all three flash regions on CS0, CS1 and CS6 if they are configured
 	  correctly by the boot loader.
 
+config MTD_DMV182
+        tristate "Map driver for Dy-4 SVME/DMV-182 board."
+        depends on DMV182
+        select MTD_PARTITIONS
+	select MTD_MAP_BANK_WIDTH_32
+	select MTD_CFI_I8
+	select MTD_CFI_AMDSTD
+        help
+          Map driver for Dy-4 SVME/DMV-182 board.
+
 endmenu
 
diff --git a/drivers/mtd/maps/Makefile b/drivers/mtd/maps/Makefile
index 929d66861..505178f36 100644
--- a/drivers/mtd/maps/Makefile
+++ b/drivers/mtd/maps/Makefile
@@ -1,7 +1,7 @@
 #
 # linux/drivers/maps/Makefile
 #
-# $Id: Makefile.common,v 1.2 2003/05/28 10:48:41 dwmw2 Exp $
+# $Id: Makefile.common,v 1.14 2004/07/12 16:07:31 dwmw2 Exp $
 
 ifeq ($(CONFIG_MTD_COMPLEX_MAPPINGS),y)
 obj-$(CONFIG_MTD)		+= map_funcs.o
@@ -19,7 +19,7 @@ obj-$(CONFIG_MTD_EPXA10DB)	+= epxa10db-flash.o
 obj-$(CONFIG_MTD_IQ80310)	+= iq80310.o
 obj-$(CONFIG_MTD_L440GX)	+= l440gx.o
 obj-$(CONFIG_MTD_AMD76XROM)	+= amd76xrom.o
-obj-$(CONFIG_MTD_ICH2ROM)	+= ich2rom.o
+obj-$(CONFIG_MTD_ICHXROM)	+= ichxrom.o
 obj-$(CONFIG_MTD_TSUNAMI)	+= tsunami_flash.o
 obj-$(CONFIG_MTD_LUBBOCK)	+= lubbock-flash.o
 obj-$(CONFIG_MTD_MBX860)	+= mbx860.o
@@ -42,6 +42,9 @@ obj-$(CONFIG_MTD_OCELOT)	+= ocelot.o
 obj-$(CONFIG_MTD_SOLUTIONENGINE)+= solutionengine.o
 obj-$(CONFIG_MTD_PCI)		+= pci.o
 obj-$(CONFIG_MTD_PB1XXX)	+= pb1xxx-flash.o
+obj-$(CONFIG_MTD_DB1X00)        += db1x00-flash.o
+obj-$(CONFIG_MTD_PB1550)        += pb1550-flash.o
+obj-$(CONFIG_MTD_DB1550)        += db1550-flash.o
 obj-$(CONFIG_MTD_LASAT)		+= lasat.o
 obj-$(CONFIG_MTD_AUTCPU12)	+= autcpu12-nvram.o
 obj-$(CONFIG_MTD_EDB7312)	+= edb7312.o
@@ -55,5 +58,9 @@ obj-$(CONFIG_MTD_EBONY)		+= ebony.o
 obj-$(CONFIG_MTD_BEECH)		+= beech-mtd.o
 obj-$(CONFIG_MTD_ARCTIC)	+= arctic-mtd.o
 obj-$(CONFIG_MTD_H720X)		+= h720x-flash.o
+obj-$(CONFIG_MTD_SBC8240)	+= sbc8240.o
+obj-$(CONFIG_MTD_NOR_TOTO)	+= omap-toto-flash.o
+obj-$(CONFIG_MTD_MPC1211)	+= mpc1211.o
 obj-$(CONFIG_MTD_IXP4XX)	+= ixp4xx.o
 obj-$(CONFIG_MTD_WRSBC8260)	+= wr_sbc82xx_flash.o
+obj-$(CONFIG_MTD_DMV182)	+= dmv182.o
diff --git a/drivers/mtd/maps/amd76xrom.c b/drivers/mtd/maps/amd76xrom.c
index 60ca04b5f..7f3ab3768 100644
--- a/drivers/mtd/maps/amd76xrom.c
+++ b/drivers/mtd/maps/amd76xrom.c
@@ -2,7 +2,7 @@
  * amd76xrom.c
  *
  * Normal mappings of chips in physical memory
- * $Id: amd76xrom.c,v 1.8 2003/05/28 15:44:28 dwmw2 Exp $
+ * $Id: amd76xrom.c,v 1.12 2004/07/14 14:44:31 thayne Exp $
  */
 
 #include <linux/module.h>
@@ -17,25 +17,60 @@
 #include <linux/pci_ids.h>
 
 
+#define xstr(s) str(s)
+#define str(s) #s
+#define MOD_NAME xstr(KBUILD_BASENAME)
+
+#define MTD_DEV_NAME_LENGTH 16
+
 struct amd76xrom_map_info {
 	struct map_info map;
 	struct mtd_info *mtd;
 	unsigned long window_addr;
 	u32 window_start, window_size;
 	struct pci_dev *pdev;
+	struct resource window_rsrc;
+	struct resource rom_rsrc;
+	char mtd_name[MTD_DEV_NAME_LENGTH];
 };
 
 
 static struct amd76xrom_map_info amd76xrom_map = {
 	.map = {
-		.name = "AMD76X rom",
+		.name = MOD_NAME,
 		.size = 0,
-		.buswidth = 1,
-	},
-	.mtd = 0,
-	.window_addr = 0,
+		.bankwidth = 1,
+	}
+	/* remaining fields of structure are initialized to 0 */
 };
 
+
+static void amd76xrom_cleanup(struct amd76xrom_map_info *info)
+{
+	u8 byte;
+
+	/* Disable writes through the rom window */
+	pci_read_config_byte(info->pdev, 0x40, &byte);
+	pci_write_config_byte(info->pdev, 0x40, byte & ~1);
+
+	if (info->mtd) {
+		del_mtd_device(info->mtd);
+		map_destroy(info->mtd);
+		info->mtd = NULL;
+		info->map.virt = 0;
+	}
+	if (info->rom_rsrc.parent)
+		release_resource(&info->rom_rsrc);
+	if (info->window_rsrc.parent)
+		release_resource(&info->window_rsrc);
+
+	if (info->window_addr) {
+		iounmap((void *)(info->window_addr));
+		info->window_addr = 0;
+	}
+}
+
+
 static int __devinit amd76xrom_init_one (struct pci_dev *pdev,
 	const struct pci_device_id *ent)
 {
@@ -45,6 +80,10 @@ static int __devinit amd76xrom_init_one (struct pci_dev *pdev,
 		u8 segen_bits;
 	};
 	static struct rom_window rom_window[] = {
+		/*
+		 * Need the 5MiB window for chips that have block lock/unlock
+		 * registers located below 4MiB window.
+		 */
 		{ 0xffb00000, 5*1024*1024, (1<<7) | (1<<6), },
 		{ 0xffc00000, 4*1024*1024, (1<<7), },
 		{ 0xffff0000, 64*1024,     0 },
@@ -53,87 +92,141 @@ static int __devinit amd76xrom_init_one (struct pci_dev *pdev,
 	static const u32 rom_probe_sizes[] = { 
 		5*1024*1024, 4*1024*1024, 2*1024*1024, 1024*1024, 512*1024, 
 		256*1024, 128*1024, 64*1024, 0};
-	static char *rom_probe_types[] = { "cfi_probe", "jedec_probe", 0 };
+	static char *rom_probe_types[] = { "cfi_probe", "jedec_probe", NULL };
 	u8 byte;
 	struct amd76xrom_map_info *info = &amd76xrom_map;
 	struct rom_window *window;
 	int i;
 	u32 rom_size;
 
+	info->pdev = pdev;
 	window = &rom_window[0];
 
-	/* disabled because it fights with BIOS reserved regions */
-#define REQUEST_MEM_REGION 0
-#if REQUEST_MEM_REGION
-	while(window->size) {
-		if (request_mem_region(window->start, window->size, "amd76xrom")) {
-			break;
+	while (window->size) {
+		/*
+		 * Try to reserve the window mem region.  If this fails then
+		 * it is likely due to a fragment of the window being
+		 * "reseved" by the BIOS.  In the case that the
+		 * request_mem_region() fails then once the rom size is
+		 * discovered we will try to reserve the unreserved fragment.
+		 */
+		info->window_rsrc.name = MOD_NAME;
+		info->window_rsrc.start = window->start;
+		info->window_rsrc.end = window->start + window->size - 1;
+		info->window_rsrc.flags = IORESOURCE_MEM | IORESOURCE_BUSY;
+		if (request_resource(&iomem_resource, &info->window_rsrc)) {
+			info->window_rsrc.parent = NULL;
+			printk(KERN_ERR MOD_NAME
+			       " %s(): Unable to register resource"
+			       " 0x%.08lx-0x%.08lx - kernel bug?\n",
+			       __func__,
+			       info->window_rsrc.start, info->window_rsrc.end);
 		}
-		window++;
-	}
-	if (!window->size) {
-		printk(KERN_ERR "amd76xrom: cannot reserve rom window\n");
-		goto err_out_none;
-	}
-#endif /* REQUEST_MEM_REGION */
 
-	/* Enable the selected rom window */
-	pci_read_config_byte(pdev, 0x43, &byte);
-	pci_write_config_byte(pdev, 0x43, byte | window->segen_bits);
+		/* Enable the selected rom window */
+		pci_read_config_byte(pdev, 0x43, &byte);
+		pci_write_config_byte(pdev, 0x43, byte | window->segen_bits);
 
-	/* Enable writes through the rom window */
-	pci_read_config_byte(pdev, 0x40, &byte);
-	pci_write_config_byte(pdev, 0x40, byte | 1);
+		/* Enable writes through the rom window */
+		pci_read_config_byte(pdev, 0x40, &byte);
+		pci_write_config_byte(pdev, 0x40, byte | 1);
 
-	/* FIXME handle registers 0x80 - 0x8C the bios region locks */
+		/* FIXME handle registers 0x80 - 0x8C the bios region locks */
 
-	printk(KERN_NOTICE "amd76xrom window : %x at %x\n", 
-		window->size, window->start);
-	/* For write accesses caches are useless */
-	info->window_addr = (unsigned long)ioremap_nocache(window->start, window->size);
+		printk(KERN_NOTICE MOD_NAME " window : %x at %x\n", 
+		       window->size, window->start);
+		/* For write accesses caches are useless */
+		info->window_addr =
+			(unsigned long)ioremap_nocache(window->start,
+						       window->size);
 
-	if (!info->window_addr) {
-		printk(KERN_ERR "Failed to ioremap\n");
-		goto err_out_free_mmio_region;
-	}
-	info->mtd = 0;
-	for(i = 0; (rom_size = rom_probe_sizes[i]); i++) {
-		char **chip_type;
-		if (rom_size > window->size) {
+		if (!info->window_addr) {
+			printk(KERN_ERR "Failed to ioremap\n");
 			continue;
 		}
-		info->map.phys = window->start + window->size - rom_size;
-		info->map.virt = 
-			info->window_addr + window->size - rom_size;
-		info->map.size = rom_size;
-		simple_map_init(&info->map);
-		chip_type = rom_probe_types;
-		for(; !info->mtd && *chip_type; chip_type++) {
-			info->mtd = do_map_probe(*chip_type, &amd76xrom_map.map);
-		}
-		if (info->mtd) {
-			break;
+
+		info->mtd = NULL;
+
+		for(i = 0; (rom_size = rom_probe_sizes[i]); i++) {
+			char **chip_type;
+			if (rom_size > window->size) {
+				continue;
+			}
+			info->map.phys = window->start + window->size - rom_size;
+			info->map.virt = 
+				info->window_addr + window->size - rom_size;
+			info->map.size = rom_size;
+			simple_map_init(&info->map);
+			chip_type = rom_probe_types;
+			for(; !info->mtd && *chip_type; chip_type++) {
+				info->mtd = do_map_probe(*chip_type, &amd76xrom_map.map);
+			}
+			if (info->mtd) goto found_mtd;
 		}
+		iounmap((void *)(info->window_addr));
+		info->window_addr = 0;
+
+		/* Disable writes through the rom window */
+		pci_read_config_byte(pdev, 0x40, &byte);
+		pci_write_config_byte(pdev, 0x40, byte & ~1);
+
+		window++;
 	}
-	if (!info->mtd) {
-		goto err_out_iounmap;
-	}
-	printk(KERN_NOTICE "amd76xrom chip at offset: 0x%x\n",
+	goto failed;
+
+ found_mtd:
+	printk(KERN_NOTICE MOD_NAME " chip at offset: 0x%x\n",
 		window->size - rom_size);
-		
+
 	info->mtd->owner = THIS_MODULE;
+
+	if (!info->window_rsrc.parent) {
+		/* failed to reserve entire window - try fragments */
+		info->window_rsrc.name = MOD_NAME;
+		info->window_rsrc.start = window->start;
+		info->window_rsrc.end = window->start + window->size - rom_size - 1;
+		info->window_rsrc.flags = IORESOURCE_MEM | IORESOURCE_BUSY;
+		if (request_resource(&iomem_resource, &info->window_rsrc)) {
+			printk(KERN_ERR MOD_NAME
+			       ": cannot reserve window resource fragment\n");
+#if 0
+			/*
+			 * The BIOS e820 usually reserves this so it isn't
+			 * usually an error.
+			 */
+			goto failed;
+#endif
+		}
+	}
+
 	add_mtd_device(info->mtd);
 	info->window_start = window->start;
 	info->window_size = window->size;
+
+	if (info->window_rsrc.parent) {
+		/*
+		 * Registering the MTD device in iomem may not be possible
+		 * if there is a BIOS "reserved" and BUSY range.  If this
+		 * fails then continue anyway.
+		 */
+		snprintf(info->mtd_name, MTD_DEV_NAME_LENGTH,
+			 "mtd%d", info->mtd->index);
+
+		info->rom_rsrc.name = info->mtd_name;
+		info->rom_rsrc.start = window->start + window->size - rom_size;
+		info->rom_rsrc.end = window->start + window->size - 1;
+		info->rom_rsrc.flags = IORESOURCE_MEM | IORESOURCE_BUSY;
+		if (request_resource(&info->window_rsrc, &info->rom_rsrc)) {
+			printk(KERN_ERR MOD_NAME
+			       ": cannot reserve MTD resource\n");
+			info->rom_rsrc.parent = NULL;
+		}
+	}
+
 	return 0;
 
-err_out_iounmap:
-	iounmap((void *)(info->window_addr));
-err_out_free_mmio_region:
-#if REQUEST_MEM_REGION
-	release_mem_region(window->start, window->size);
-err_out_none:
-#endif /* REQUEST_MEM_REGION */
+ failed:
+	amd76xrom_cleanup(info);
 	return -ENODEV;
 }
 
@@ -141,23 +234,8 @@ err_out_none:
 static void __devexit amd76xrom_remove_one (struct pci_dev *pdev)
 {
 	struct amd76xrom_map_info *info = &amd76xrom_map;
-	u8 byte;
-
-	del_mtd_device(info->mtd);
-	map_destroy(info->mtd);
-	info->mtd = 0;
-	info->map.virt = 0;
-
-	iounmap((void *)(info->window_addr));
-	info->window_addr = 0;
-
-	/* Disable writes through the rom window */
-	pci_read_config_byte(pdev, 0x40, &byte);
-	pci_write_config_byte(pdev, 0x40, byte & ~1);
 
-#if REQUEST_MEM_REGION
-	release_mem_region(info->window_start, info->window_size);
-#endif /* REQUEST_MEM_REGION */
+	amd76xrom_cleanup(info);
 }
 
 static struct pci_device_id amd76xrom_pci_tbl[] = {
@@ -173,7 +251,7 @@ MODULE_DEVICE_TABLE(pci, amd76xrom_pci_tbl);
 
 #if 0
 static struct pci_driver amd76xrom_driver = {
-	.name =		"amd76xrom",
+	.name =		MOD_NAME,
 	.id_table =	amd76xrom_pci_tbl,
 	.probe =	amd76xrom_init_one,
 	.remove =	amd76xrom_remove_one,
@@ -184,9 +262,9 @@ int __init init_amd76xrom(void)
 {
 	struct pci_dev *pdev;
 	struct pci_device_id *id;
-	pdev = 0;
+	pdev = NULL;
 	for(id = amd76xrom_pci_tbl; id->vendor; id++) {
-		pdev = pci_find_device(id->vendor, id->device, 0);
+		pdev = pci_find_device(id->vendor, id->device, NULL);
 		if (pdev) {
 			break;
 		}
diff --git a/drivers/mtd/maps/arctic-mtd.c b/drivers/mtd/maps/arctic-mtd.c
index c111b2d1f..2acf5b0b8 100644
--- a/drivers/mtd/maps/arctic-mtd.c
+++ b/drivers/mtd/maps/arctic-mtd.c
@@ -1,5 +1,5 @@
 /*
- * $Id: arctic-mtd.c,v 1.10 2003/06/02 16:37:59 trini Exp $
+ * $Id: arctic-mtd.c,v 1.11 2004/07/12 21:59:43 dwmw2 Exp $
  * 
  * drivers/mtd/maps/arctic-mtd.c MTD mappings and partition tables for 
  *                              IBM 405LP Arctic boards.
@@ -72,7 +72,7 @@
 static struct map_info arctic_mtd_map = {
 	.name		= NAME,
 	.size		= SIZE,
-	.buswidth	= BUSWIDTH,
+	.bankwidth	= BUSWIDTH,
 	.phys		= PADDR,
 };
 
diff --git a/drivers/mtd/maps/autcpu12-nvram.c b/drivers/mtd/maps/autcpu12-nvram.c
index f4c27c415..31e9df662 100644
--- a/drivers/mtd/maps/autcpu12-nvram.c
+++ b/drivers/mtd/maps/autcpu12-nvram.c
@@ -2,7 +2,7 @@
  * NV-RAM memory access on autcpu12 
  * (C) 2002 Thomas Gleixner (gleixner@autronix.de)
  *
- * $Id: autcpu12-nvram.c,v 1.5 2003/05/21 12:45:18 dwmw2 Exp $ 
+ * $Id: autcpu12-nvram.c,v 1.6 2004/07/12 21:59:43 dwmw2 Exp $ 
  *
  * 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
@@ -39,7 +39,7 @@ static struct mtd_info *sram_mtd;
 struct map_info autcpu12_sram_map = {
 	.name = "SRAM",
 	.size = 32768,
-	.buswidth = 4,
+	.bankwidth = 4,
 	.phys = 0x12000000,
 };
 
diff --git a/drivers/mtd/maps/beech-mtd.c b/drivers/mtd/maps/beech-mtd.c
index 61e21970d..d8f737aa7 100644
--- a/drivers/mtd/maps/beech-mtd.c
+++ b/drivers/mtd/maps/beech-mtd.c
@@ -1,5 +1,5 @@
 /*
- * $Id: beech-mtd.c,v 1.7 2003/05/21 12:45:18 dwmw2 Exp $
+ * $Id: beech-mtd.c,v 1.8 2004/07/12 21:59:43 dwmw2 Exp $
  * 
  * drivers/mtd/maps/beech-mtd.c MTD mappings and partition tables for 
  *                              IBM 405LP Beech boards.
@@ -51,7 +51,7 @@
 static struct map_info beech_mtd_map = {
 	.name =		NAME,
 	.size =		SIZE,
-	.buswidth =	BUSWIDTH,
+	.bankwidth =	BUSWIDTH,
 	.phys =		PADDR
 };
 
diff --git a/drivers/mtd/maps/cdb89712.c b/drivers/mtd/maps/cdb89712.c
index 119968944..e8c984ee1 100644
--- a/drivers/mtd/maps/cdb89712.c
+++ b/drivers/mtd/maps/cdb89712.c
@@ -1,7 +1,7 @@
 /*
  * Flash on Cirrus CDB89712
  *
- * $Id: cdb89712.c,v 1.7 2003/05/21 12:45:18 dwmw2 Exp $
+ * $Id: cdb89712.c,v 1.8 2004/07/12 21:59:43 dwmw2 Exp $
  */
 
 #include <linux/module.h>
@@ -23,7 +23,7 @@ static struct mtd_info *flash_mtd;
 struct map_info cdb89712_flash_map = {
 	.name = "flash",
 	.size = FLASH_SIZE,
-	.buswidth = FLASH_WIDTH,
+	.bankwidth = FLASH_WIDTH,
 	.phys = FLASH_START,
 };
 
@@ -93,7 +93,7 @@ static struct mtd_info *sram_mtd;
 struct map_info cdb89712_sram_map = {
 	.name = "SRAM",
 	.size = SRAM_SIZE,
-	.buswidth = SRAM_WIDTH,
+	.bankwidth = SRAM_WIDTH,
 	.phys = SRAM_START,
 };
 
@@ -161,7 +161,7 @@ static struct mtd_info *bootrom_mtd;
 struct map_info cdb89712_bootrom_map = {
 	.name = "BootROM",
 	.size = BOOTROM_SIZE,
-	.buswidth = BOOTROM_WIDTH,
+	.bankwidth = BOOTROM_WIDTH,
 	.phys = BOOTROM_START,
 };
 
diff --git a/drivers/mtd/maps/ceiva.c b/drivers/mtd/maps/ceiva.c
index 01b867c1b..8475505f0 100644
--- a/drivers/mtd/maps/ceiva.c
+++ b/drivers/mtd/maps/ceiva.c
@@ -11,7 +11,7 @@
  *
  * (C) 2000 Nicolas Pitre <nico@cam.org>
  *
- * $Id: ceiva.c,v 1.8 2003/05/21 12:45:18 dwmw2 Exp $
+ * $Id: ceiva.c,v 1.10 2004/07/12 21:59:43 dwmw2 Exp $
  */
 
 #include <linux/config.h>
@@ -151,7 +151,7 @@ static int __init clps_setup_mtd(struct clps_info *clps, int nr, struct mtd_info
 		}
 
 		clps[i].map->virt = (unsigned long)clps[i].vbase;
-		clps[i].map->buswidth = clps[i].width;
+		clps[i].map->bankwidth = clps[i].width;
 		clps[i].map->size = clps[i].size;
 
 		simple_map_init(&clps[i].map);
diff --git a/drivers/mtd/maps/cfi_flagadm.c b/drivers/mtd/maps/cfi_flagadm.c
index ff08d851f..28d59ff77 100644
--- a/drivers/mtd/maps/cfi_flagadm.c
+++ b/drivers/mtd/maps/cfi_flagadm.c
@@ -1,7 +1,7 @@
 /*
  *  Copyright © 2001 Flaga hf. Medical Devices, Kári Davíðsson <kd@flaga.is>
  *
- *  $Id: cfi_flagadm.c,v 1.11 2003/05/21 12:45:18 dwmw2 Exp $
+ *  $Id: cfi_flagadm.c,v 1.12 2004/07/12 21:59:43 dwmw2 Exp $
  *  
  *  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
@@ -60,7 +60,7 @@
 struct map_info flagadm_map = {
 		.name =		"FlagaDM flash device",
 		.size =		FLASH_SIZE,
-		.buswidth =	2,
+		.bankwidth =	2,
 };
 
 struct mtd_partition flagadm_parts[] = {
diff --git a/drivers/mtd/maps/cstm_mips_ixx.c b/drivers/mtd/maps/cstm_mips_ixx.c
index 38f7e1183..773b1ba9a 100644
--- a/drivers/mtd/maps/cstm_mips_ixx.c
+++ b/drivers/mtd/maps/cstm_mips_ixx.c
@@ -1,5 +1,5 @@
 /*
- * $Id: cstm_mips_ixx.c,v 1.9 2003/05/21 12:45:18 dwmw2 Exp $
+ * $Id: cstm_mips_ixx.c,v 1.10 2004/07/12 21:59:43 dwmw2 Exp $
  *
  * Mapping of a custom board with both AMD CFI and JEDEC flash in partitions.
  * Config with both CFI and JEDEC device support.
@@ -104,7 +104,7 @@ struct cstm_mips_ixx_info {
 	char *name;
 	unsigned long window_addr;
 	unsigned long window_size;
-	int buswidth;
+	int bankwidth;
 	int num_partitions;
 };
 
@@ -116,7 +116,7 @@ const struct cstm_mips_ixx_info cstm_mips_ixx_board_desc[PHYSMAP_NUMBER] =
         "big flash",     // name
 	0x08000000,      // window_addr
 	0x02000000,      // window_size
-        4,               // buswidth
+        4,               // bankwidth
 	1,               // num_partitions
     }
 
@@ -138,7 +138,7 @@ const struct cstm_mips_ixx_info cstm_mips_ixx_board_desc[PHYSMAP_NUMBER] =
         "MTD flash",                   // name
 	CONFIG_MTD_CSTM_MIPS_IXX_START,      // window_addr
 	CONFIG_MTD_CSTM_MIPS_IXX_LEN,        // window_size
-        CONFIG_MTD_CSTM_MIPS_IXX_BUSWIDTH,   // buswidth
+        CONFIG_MTD_CSTM_MIPS_IXX_BUSWIDTH,   // bankwidth
 	1,                             // num_partitions
     },
 
@@ -177,7 +177,7 @@ int __init init_cstm_mips_ixx(void)
 	        }
 		cstm_mips_ixx_map[i].name = cstm_mips_ixx_board_desc[i].name;
 		cstm_mips_ixx_map[i].size = cstm_mips_ixx_board_desc[i].window_size;
-		cstm_mips_ixx_map[i].buswidth = cstm_mips_ixx_board_desc[i].buswidth;
+		cstm_mips_ixx_map[i].bankwidth = cstm_mips_ixx_board_desc[i].bankwidth;
 #if defined(CONFIG_MIPS_ITE8172) || defined(CONFIG_MIPS_IVR)
                 cstm_mips_ixx_map[i].set_vpp = cstm_mips_ixx_set_vpp;
 #endif
diff --git a/drivers/mtd/maps/dbox2-flash.c b/drivers/mtd/maps/dbox2-flash.c
index 6565afb17..7c4de43c0 100644
--- a/drivers/mtd/maps/dbox2-flash.c
+++ b/drivers/mtd/maps/dbox2-flash.c
@@ -1,5 +1,5 @@
 /*
- * $Id: dbox2-flash.c,v 1.9 2003/05/21 12:45:18 dwmw2 Exp $
+ * $Id: dbox2-flash.c,v 1.11 2004/07/12 21:59:43 dwmw2 Exp $
  *
  * D-Box 2 flash driver
  */
@@ -13,6 +13,7 @@
 #include <linux/mtd/map.h>
 #include <linux/mtd/partitions.h>
 #include <linux/config.h>
+#include <linux/errno.h>
 
 /* partition_info gives details on the logical partitions that the split the
  * single flash device into. If the size if zero we use up to the end of the
@@ -25,31 +26,31 @@ static struct mtd_partition partition_info[]= {
 	.mask_flags	= MTD_WRITEABLE
 	},
 	{
-	.name		= "flfs (ppcboot)",
+	.name		= "FLFS (U-Boot)",
 	.size		= 128 * 1024, 
 	.offset		= MTDPART_OFS_APPEND, 
 	.mask_flags	= 0
 	},
 	{
-	.name		= "root (cramfs)",	
+	.name		= "Root (SquashFS)",	
 	.size		= 7040 * 1024, 
 	.offset		= MTDPART_OFS_APPEND, 
 	.mask_flags	= 0
 	},
 	{
-	.name		= "var (jffs2)",
+	.name		= "var (JFFS2)",
 	.size		= 896 * 1024, 
 	.offset		= MTDPART_OFS_APPEND, 
 	.mask_flags	= 0
 	},
 	{
-	.name		= "flash without bootloader",	
+	.name		= "Flash without bootloader",	
 	.size		= MTDPART_SIZ_FULL, 
 	.offset		= 128 * 1024, 
 	.mask_flags	= 0
 	},
 	{
-	.name		= "complete flash",	
+	.name		= "Complete Flash",	
 	.size		= MTDPART_SIZ_FULL, 
 	.offset		= 0, 
 	.mask_flags	= MTD_WRITEABLE
@@ -67,7 +68,7 @@ static struct mtd_info *mymtd;
 struct map_info dbox2_flash_map = {
 	.name		= "D-Box 2 flash memory",
 	.size		= WINDOW_SIZE,
-	.buswidth	= 4,
+	.bankwidth	= 4,
 	.phys		= WINDOW_ADDR,
 };
 
@@ -86,7 +87,7 @@ int __init init_dbox2_flash(void)
 	mymtd = do_map_probe("cfi_probe", &dbox2_flash_map);
 	if (!mymtd) {
 	    // Probe for single Intel 28F640
-	    dbox2_flash_map.buswidth = 2;
+	    dbox2_flash_map.bankwidth = 2;
 	
 	    mymtd = do_map_probe("cfi_probe", &dbox2_flash_map);
 	}
diff --git a/drivers/mtd/maps/dc21285.c b/drivers/mtd/maps/dc21285.c
index 8230cc5cd..fc72bb5c5 100644
--- a/drivers/mtd/maps/dc21285.c
+++ b/drivers/mtd/maps/dc21285.c
@@ -5,13 +5,14 @@
  *
  * This code is GPL
  * 
- * $Id: dc21285.c,v 1.15 2003/05/21 12:45:18 dwmw2 Exp $
+ * $Id: dc21285.c,v 1.20 2004/07/12 22:38:29 dwmw2 Exp $
  */
 #include <linux/config.h>
 #include <linux/module.h>
 #include <linux/types.h>
 #include <linux/kernel.h>
 #include <linux/init.h>
+#include <linux/delay.h>
 
 #include <linux/mtd/mtd.h>
 #include <linux/mtd/map.h>
@@ -19,91 +20,117 @@
 
 #include <asm/io.h>
 #include <asm/hardware/dec21285.h>
+#include <asm/mach-types.h>
 
 
-static struct mtd_info *mymtd;
+static struct mtd_info *dc21285_mtd;
 
-__u8 dc21285_read8(struct map_info *map, unsigned long ofs)
+#ifdef CONFIG_ARCH_NETWINDER
+/* 
+ * This is really ugly, but it seams to be the only
+ * realiable way to do it, as the cpld state machine 
+ * is unpredictible. So we have a 25us penalty per
+ * write access.
+ */
+static void nw_en_write(void) {
+	extern spinlock_t gpio_lock;
+	unsigned long flags;
+
+	/*
+	 * we want to write a bit pattern XXX1 to Xilinx to enable
+	 * the write gate, which will be open for about the next 2ms.
+	 */
+	spin_lock_irqsave(&gpio_lock, flags);
+	cpld_modify(1, 1);
+	spin_unlock_irqrestore(&gpio_lock, flags);
+
+	/*
+	 * let the ISA bus to catch on...
+	 */
+	udelay(25);
+}
+#else
+#define nw_en_write() do { } while (0)
+#endif
+
+static map_word dc21285_read8(struct map_info *map, unsigned long ofs)
 {
-	return *(__u8*)(map->map_priv_1 + ofs);
+	return *(uint8_t*)(map->map_priv_1 + ofs);
 }
 
-__u16 dc21285_read16(struct map_info *map, unsigned long ofs)
+static map_word dc21285_read16(struct map_info *map, unsigned long ofs)
 {
-	return *(__u16*)(map->map_priv_1 + ofs);
+	return *(uint16_t*)(map->map_priv_1 + ofs);
 }
 
-__u32 dc21285_read32(struct map_info *map, unsigned long ofs)
+static map_word dc21285_read32(struct map_info *map, unsigned long ofs)
 {
-	return *(__u32*)(map->map_priv_1 + ofs);
+	return *(uint32_t*)(map->map_priv_1 + ofs);
 }
 
-void dc21285_copy_from(struct map_info *map, void *to, unsigned long from, ssize_t len)
+static void dc21285_copy_from(struct map_info *map, void *to, unsigned long from, ssize_t len)
 {
 	memcpy(to, (void*)(map->map_priv_1 + from), len);
 }
 
-void dc21285_write8(struct map_info *map, __u8 d, unsigned long adr)
+static void dc21285_write(struct map_info *map, map_word d, unsigned long adr)
 {
+	if (machine_is_netwinder())
+		nw_en_write();
 	*CSR_ROMWRITEREG = adr & 3;
 	adr &= ~3;
-	*(__u8*)(map->map_priv_1 + adr) = d;
+	*(uint8_t*)(map->map_priv_1 + adr) = d.x[0];
 }
 
-void dc21285_write16(struct map_info *map, __u16 d, unsigned long adr)
+static void dc21285_write16(struct map_info *map, map_word d, unsigned long adr)
 {
+	if (machine_is_netwinder())
+		nw_en_write();
 	*CSR_ROMWRITEREG = adr & 3;
 	adr &= ~3;
-	*(__u16*)(map->map_priv_1 + adr) = d;
+	*(uint16_t*)(map->map_priv_1 + adr) = d.x[0];
 }
 
-void dc21285_write32(struct map_info *map, __u32 d, unsigned long adr)
+static void dc21285_write32(struct map_info *map, map_word d, unsigned long adr)
 {
-	*(__u32*)(map->map_priv_1 + adr) = d;
+	if (machine_is_netwinder())
+		nw_en_write();
+	*(uint32_t*)(map->map_priv_1 + adr) = d.x[0];
 }
 
-void dc21285_copy_to(struct map_info *map, unsigned long to, const void *from, ssize_t len)
+static void dc21285_copy_to_32(struct map_info *map, unsigned long to, const void *from, ssize_t len)
 {
-	switch (map->buswidth) {
-		case 4:
-			while (len > 0) {
-				__u32 d = *((__u32*)from)++;
-				dc21285_write32(map, d, to);
-				to += 4;
-				len -= 4;
-			}
-			break;
-		case 2:
-			while (len > 0) {
-				__u16 d = *((__u16*)from)++;
-				dc21285_write16(map, d, to);
-				to += 2;
-				len -= 2;
-			}
-			break;
-		case 1:
-			while (len > 0) {
-				__u8 d = *((__u8*)from)++;
-				dc21285_write8(map, d, to);
-				to++;
-				len--;
-			}
-			break;
+	while (len > 0) {
+		uint32_t d = *((uint32_t*)from)++;
+		dc21285_write32(map, d, to);
+		to += 4;
+		len -= 4;
+	}
+}
+
+static void dc21285_copy_to_16(struct map_info *map, unsigned long to, const void *from, ssize_t len)
+{
+	while (len > 0) {
+		uint16_t d = *((uint16_t*)from)++;
+		dc21285_write16(map, d, to);
+		to += 2;
+		len -= 2;
 	}
 }
 
-struct map_info dc21285_map = {
+static void dc21285_copy_to_8(struct map_info *map, unsigned long to, const void *from, ssize_t len)
+{
+	uint8_t d = *((uint8_t*)from)++;
+	dc21285_write8(map, d, to);
+	to++;
+	len--;
+}
+
+static struct map_info dc21285_map = {
 	.name = "DC21285 flash",
 	.phys = NO_XIP,
 	.size = 16*1024*1024,
-	.read8 = dc21285_read8,
-	.read16 = dc21285_read16,
-	.read32 = dc21285_read32,
 	.copy_from = dc21285_copy_from,
-	.write8 = dc21285_write8,
-	.write16 = dc21285_write16,
-	.write32 = dc21285_write32,
-	.copy_to = dc21285_copy_to
 };
 
 
@@ -113,39 +140,39 @@ static struct mtd_partition *dc21285_parts;
 static const char *probes[] = { "RedBoot", "cmdlinepart", NULL };
 #endif
   
-int __init init_dc21285(void)
+static int __init init_dc21285(void)
 {
 
-	/* 
-	 * Flash timing is determined with bits 19-16 of the
-	 * CSR_SA110_CNTL.  The value is the number of wait cycles, or
-	 * 0 for 16 cycles (the default).  Cycles are 20 ns.
-	 * Here we use 7 for 140 ns flash chips.
-	 */
-	/* access time */
-	*CSR_SA110_CNTL = ((*CSR_SA110_CNTL & ~0x000f0000) | (7 << 16));
-	/* burst time */
-	*CSR_SA110_CNTL = ((*CSR_SA110_CNTL & ~0x00f00000) | (7 << 20));
-	/* tristate time */
-	*CSR_SA110_CNTL = ((*CSR_SA110_CNTL & ~0x0f000000) | (7 << 24));
-
-	/* Determine buswidth */
+#ifdef CONFIG_MTD_PARTITIONS
+	int nrparts;
+#endif
+
+	/* Determine bankwidth */
 	switch (*CSR_SA110_CNTL & (3<<14)) {
 		case SA110_CNTL_ROMWIDTH_8: 
-			dc21285_map.buswidth = 1;
+			dc21285_map.bankwidth = 1;
+			dc21285_map.read = dc21285_read8;
+			dc21285_map.write = dc21285_write8;
+			dc21285_map.copy_to = dc21285_copy_to_8;
 			break;
 		case SA110_CNTL_ROMWIDTH_16: 
-			dc21285_map.buswidth = 2; 
+			dc21285_map.bankwidth = 2; 
+			dc21285_map.read = dc21285_read16;
+			dc21285_map.write = dc21285_write16;
+			dc21285_map.copy_to = dc21285_copy_to_16;
 			break;
 		case SA110_CNTL_ROMWIDTH_32: 
-			dc21285_map.buswidth = 4; 
+			dc21285_map.bankwidth = 4; 
 			break;
+			dc21285_map.read = dc21285_read32;
+			dc21285_map.write = dc21285_write32;
+			dc21285_map.copy_to = dc21285_copy_to_32;
 		default:
-			printk (KERN_ERR "DC21285 flash: undefined buswidth\n");
+			printk (KERN_ERR "DC21285 flash: undefined bankwidth\n");
 			return -ENXIO;
 	}
-	printk (KERN_NOTICE "DC21285 flash support (%d-bit buswidth)\n",
-		dc21285_map.buswidth*8);
+	printk (KERN_NOTICE "DC21285 flash support (%d-bit bankwidth)\n",
+		dc21285_map.bankwidth*8);
 
 	/* Let's map the flash area */
 	dc21285_map.map_priv_1 = (unsigned long)ioremap(DC21285_FLASH, 16*1024*1024);
@@ -154,40 +181,56 @@ int __init init_dc21285(void)
 		return -EIO;
 	}
 
-	mymtd = do_map_probe("cfi_probe", &dc21285_map);
-	if (mymtd) {
-		int nrparts = 0;
+	if (machine_is_ebsa285()) {
+		dc21285_mtd = do_map_probe("cfi_probe", &dc21285_map);
+	} else {
+		dc21285_mtd = do_map_probe("jedec_probe", &dc21285_map);
+	}
 
-		mymtd->owner = THIS_MODULE;
-			
-		/* partition fixup */
+	if (!dc21285_mtd) {
+		iounmap((void *)dc21285_map.map_priv_1);
+		return -ENXIO;
+	}	
+	
+	dc21285_mtd->owner = THIS_MODULE;
 
 #ifdef CONFIG_MTD_PARTITIONS
-		nrparts = parse_mtd_partitions(mymtd, probes, &dc21285_parts, (void *)0);
-		if (nrparts > 0) {
-			add_mtd_partitions(mymtd, dc21285_parts, nrparts);
-			return 0;
-		}
-#endif
-		add_mtd_device(mymtd);
-		return 0;
+	nrparts = parse_mtd_partitions(dc21285_mtd, probes, &dc21285_parts, (void *)0);
+	if (nrparts > 0)
+		add_mtd_partitions(dc21285_mtd, dc21285_parts, nrparts);
+	else	
+#endif	
+		add_mtd_device(dc21285_mtd);
+			
+	if(machine_is_ebsa285()) {
+		/* 
+		 * Flash timing is determined with bits 19-16 of the
+		 * CSR_SA110_CNTL.  The value is the number of wait cycles, or
+		 * 0 for 16 cycles (the default).  Cycles are 20 ns.
+		 * Here we use 7 for 140 ns flash chips.
+		 */
+		/* access time */
+		*CSR_SA110_CNTL = ((*CSR_SA110_CNTL & ~0x000f0000) | (7 << 16));
+		/* burst time */
+		*CSR_SA110_CNTL = ((*CSR_SA110_CNTL & ~0x00f00000) | (7 << 20));
+		/* tristate time */
+		*CSR_SA110_CNTL = ((*CSR_SA110_CNTL & ~0x0f000000) | (7 << 24));
 	}
-
-	iounmap((void *)dc21285_map.map_priv_1);
-	return -ENXIO;
+	
+	return 0;
 }
 
 static void __exit cleanup_dc21285(void)
 {
 #ifdef CONFIG_MTD_PARTITIONS
 	if (dc21285_parts) {
-		del_mtd_partitions(mymtd);
+		del_mtd_partitions(dc21285_mtd);
 		kfree(dc21285_parts);
 	} else
 #endif
-		del_mtd_device(mymtd);
+		del_mtd_device(dc21285_mtd);
 
-	map_destroy(mymtd);
+	map_destroy(dc21285_mtd);
 	iounmap((void *)dc21285_map.map_priv_1);
 }
 
diff --git a/drivers/mtd/maps/dilnetpc.c b/drivers/mtd/maps/dilnetpc.c
index d7521b39c..feb38ba14 100644
--- a/drivers/mtd/maps/dilnetpc.c
+++ b/drivers/mtd/maps/dilnetpc.c
@@ -14,7 +14,7 @@
  * along with this program; if not, write to the Free Software
  * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA
  *
- * $Id: dilnetpc.c,v 1.12 2003/05/21 12:45:18 dwmw2 Exp $
+ * $Id: dilnetpc.c,v 1.13 2004/07/12 21:59:44 dwmw2 Exp $
  *
  * The DIL/Net PC is a tiny embedded PC board made by SSV Embedded Systems
  * featuring the AMD Elan SC410 processor. There are two variants of this
@@ -252,7 +252,7 @@ static void adnp_set_vpp(struct map_info *not_used, int on)
 static struct map_info dnpc_map = {
 	.name = "ADNP Flash Bank",
 	.size = ADNP_WINDOW_SIZE,
-	.buswidth = 1,
+	.bankwidth = 1,
 	.set_vpp = adnp_set_vpp,
 	.phys = WINDOW_ADDR
 };
diff --git a/drivers/mtd/maps/ebony.c b/drivers/mtd/maps/ebony.c
index 00e87e211..7add7b8f2 100644
--- a/drivers/mtd/maps/ebony.c
+++ b/drivers/mtd/maps/ebony.c
@@ -1,5 +1,5 @@
 /*
- * $Id: ebony.c,v 1.8 2003/06/23 11:48:18 dwmw2 Exp $
+ * $Id: ebony.c,v 1.10 2004/07/12 21:59:44 dwmw2 Exp $
  * 
  * Mapping for Ebony user flash
  *
@@ -22,7 +22,7 @@
 #include <linux/mtd/partitions.h>
 #include <linux/config.h>
 #include <asm/io.h>
-#include <asm/ibm440.h>
+#include <asm/ibm44x.h>
 #include <platforms/ebony.h>
 
 static struct mtd_info *flash;
@@ -30,13 +30,13 @@ static struct mtd_info *flash;
 static struct map_info ebony_small_map = {
 	.name =		"Ebony small flash",
 	.size =		EBONY_SMALL_FLASH_SIZE,
-	.buswidth =	1,
+	.bankwidth =	1,
 };
 
 static struct map_info ebony_large_map = {
 	.name =		"Ebony large flash",
 	.size =		EBONY_LARGE_FLASH_SIZE,
-	.buswidth =	1,
+	.bankwidth =	1,
 };
 
 static struct mtd_partition ebony_small_partitions[] = {
@@ -71,7 +71,7 @@ int __init init_ebony(void)
 		return -ENOMEM;
 
 	fpga0_reg = readb(fpga0_adr);
-	iounmap64(fpga0_adr);
+	iounmap(fpga0_adr);
 
 	if (EBONY_BOOT_SMALL_FLASH(fpga0_reg) &&
 			!EBONY_FLASH_SEL(fpga0_reg))
diff --git a/drivers/mtd/maps/edb7312.c b/drivers/mtd/maps/edb7312.c
index 0ecac2071..842f1b046 100644
--- a/drivers/mtd/maps/edb7312.c
+++ b/drivers/mtd/maps/edb7312.c
@@ -1,5 +1,5 @@
 /*
- * $Id: edb7312.c,v 1.9 2003/06/23 11:48:18 dwmw2 Exp $
+ * $Id: edb7312.c,v 1.11 2004/07/14 09:52:55 dwmw2 Exp $
  *
  * Handle mapping of the NOR flash on Cogent EDB7312 boards
  *
@@ -28,8 +28,8 @@
 #define BUSWIDTH    2
 #define FLASH_BLOCKSIZE_MAIN	0x20000
 #define FLASH_NUMBLOCKS_MAIN	128
-/* can be "cfi_probe", "jedec_probe", "map_rom", 0 }; */
-#define PROBETYPES { "cfi_probe", 0 }
+/* can be "cfi_probe", "jedec_probe", "map_rom", NULL }; */
+#define PROBETYPES { "cfi_probe", NULL }
 
 #define MSG_PREFIX "EDB7312-NOR:"   /* prefix for our printk()'s */
 #define MTDID      "edb7312-nor"    /* for mtdparts= partitioning */
@@ -39,7 +39,7 @@ static struct mtd_info *mymtd;
 struct map_info edb7312nor_map = {
 	.name = "NOR flash on EDB7312",
 	.size = WINDOW_SIZE,
-	.buswidth = BUSWIDTH,
+	.bankwidth = BUSWIDTH,
 	.phys = WINDOW_ADDR,
 };
 
diff --git a/drivers/mtd/maps/elan-104nc.c b/drivers/mtd/maps/elan-104nc.c
index 326e9cc66..9410e1fb2 100644
--- a/drivers/mtd/maps/elan-104nc.c
+++ b/drivers/mtd/maps/elan-104nc.c
@@ -16,7 +16,7 @@
    along with this program; if not, write to the Free Software
    Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA
 
-   $Id: elan-104nc.c,v 1.18 2003/06/23 07:37:02 dwmw2 Exp $
+   $Id: elan-104nc.c,v 1.21 2004/07/12 22:38:29 dwmw2 Exp $
 
 The ELAN-104NC has up to 8 Mibyte of Intel StrataFlash (28F320/28F640) in x16
 mode.  This drivers uses the CFI probe and Intel Extended Command Set drivers.
@@ -107,39 +107,19 @@ static inline void elan_104nc_page(struct map_info *map, unsigned long ofs)
 }
 
 
-static __u8 elan_104nc_read8(struct map_info *map, unsigned long ofs)
+static map_word elan_104nc_read16(struct map_info *map, unsigned long ofs)
 {
-	__u8 ret;
+	map_word ret;
 	spin_lock(&elan_104nc_spin);
 	elan_104nc_page(map, ofs);
-	ret = readb(iomapadr + (ofs & WINDOW_MASK));
-	spin_unlock(&elan_104nc_spin);
-	return ret;
-}
-
-static __u16 elan_104nc_read16(struct map_info *map, unsigned long ofs)
-{
-	__u16 ret;
-	spin_lock(&elan_104nc_spin);
-	elan_104nc_page(map, ofs);
-	ret = readw(iomapadr + (ofs & WINDOW_MASK));
-	spin_unlock(&elan_104nc_spin);
-	return ret;
-}
-
-static __u32 elan_104nc_read32(struct map_info *map, unsigned long ofs)
-{
-	__u32 ret;
-	spin_lock(&elan_104nc_spin);
-	elan_104nc_page(map, ofs);
-	ret = readl(iomapadr + (ofs & WINDOW_MASK));
+	ret.x[0] = readw(iomapadr + (ofs & WINDOW_MASK));
 	spin_unlock(&elan_104nc_spin);
 	return ret;
 }
 
 static void elan_104nc_copy_from(struct map_info *map, void *to, unsigned long from, ssize_t len)
 {
-	while(len) {
+	while (len) {
 		unsigned long thislen = len;
 		if (len > (WINDOW_LENGTH - (from & WINDOW_MASK)))
 			thislen = WINDOW_LENGTH-(from & WINDOW_MASK);
@@ -154,27 +134,11 @@ static void elan_104nc_copy_from(struct map_info *map, void *to, unsigned long f
 	}
 }
 
-static void elan_104nc_write8(struct map_info *map, __u8 d, unsigned long adr)
-{
-	spin_lock(&elan_104nc_spin);
-	elan_104nc_page(map, adr);
-	writeb(d, iomapadr + (adr & WINDOW_MASK));
-	spin_unlock(&elan_104nc_spin);
-}
-
-static void elan_104nc_write16(struct map_info *map, __u16 d, unsigned long adr)
-{
-	spin_lock(&elan_104nc_spin);
-	elan_104nc_page(map, adr);
-	writew(d, iomapadr + (adr & WINDOW_MASK));
-	spin_unlock(&elan_104nc_spin);
-}
-
-static void elan_104nc_write32(struct map_info *map, __u32 d, unsigned long adr)
+static void elan_104nc_write16(struct map_info *map, map_word d, unsigned long adr)
 {
 	spin_lock(&elan_104nc_spin);
 	elan_104nc_page(map, adr);
-	writel(d, iomapadr + (adr & WINDOW_MASK));
+	writew(d.x[0], iomapadr + (adr & WINDOW_MASK));
 	spin_unlock(&elan_104nc_spin);
 }
 
@@ -201,14 +165,10 @@ static struct map_info elan_104nc_map = {
 	.size = 8*1024*1024, /* this must be set to a maximum possible amount
 			of flash so the cfi probe routines find all
 			the chips */
-	.buswidth = 2,
-	.read8 = elan_104nc_read8,
-	.read16 = elan_104nc_read16,
-	.read32 = elan_104nc_read32,
+	.bankwidth = 2,
+	.read = elan_104nc_read16,
 	.copy_from = elan_104nc_copy_from,
-	.write8 = elan_104nc_write8,
-	.write16 = elan_104nc_write16,
-	.write32 = elan_104nc_write32,
+	.write = elan_104nc_write16,
 	.copy_to = elan_104nc_copy_to
 };
 
diff --git a/drivers/mtd/maps/epxa10db-flash.c b/drivers/mtd/maps/epxa10db-flash.c
index 5b83d5fd8..545a398c4 100644
--- a/drivers/mtd/maps/epxa10db-flash.c
+++ b/drivers/mtd/maps/epxa10db-flash.c
@@ -5,7 +5,7 @@
  *  Copyright (C) 2001 Altera Corporation
  *  Copyright (C) 2001 Red Hat, Inc.
  *
- * $Id: epxa10db-flash.c,v 1.10 2003/05/21 12:45:18 dwmw2 Exp $ 
+ * $Id: epxa10db-flash.c,v 1.11 2004/07/12 21:59:44 dwmw2 Exp $ 
  *
  * 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
@@ -50,7 +50,7 @@ static int epxa_default_partitions(struct mtd_info *master, struct mtd_partition
 static struct map_info epxa_map = {
 	.name =		"EPXA flash",
 	.size =		FLASH_SIZE,
-	.buswidth =	2,
+	.bankwidth =	2,
 	.phys =		FLASH_START,
 };
 
diff --git a/drivers/mtd/maps/fortunet.c b/drivers/mtd/maps/fortunet.c
index 0cc00cdd2..50409efda 100644
--- a/drivers/mtd/maps/fortunet.c
+++ b/drivers/mtd/maps/fortunet.c
@@ -1,6 +1,6 @@
 /* fortunet.c memory map
  *
- * $Id: fortunet.c,v 1.6 2003/05/21 12:45:18 dwmw2 Exp $
+ * $Id: fortunet.c,v 1.7 2004/07/12 21:59:44 dwmw2 Exp $
  */
 
 #include <linux/module.h>
@@ -25,7 +25,7 @@
 struct map_region
 {
 	int			window_addr_physical;
-	int			altbuswidth;
+	int			altbankwidth;
 	struct map_info		map_info;
 	struct mtd_info		*mymtd;
 	struct mtd_partition	parts[MAX_NUM_PARTITIONS];
@@ -41,7 +41,7 @@ static int			map_regions_parts[MAX_NUM_REGIONS] = {0,0,0,0};
 
 struct map_info default_map = {
 	.size = DEF_WINDOW_SIZE,
-	.buswidth = 4,
+	.bankwidth = 4,
 };
 
 static char * __init get_string_option(char *dest,int dest_size,char *sor)
@@ -102,7 +102,7 @@ static int __init MTD_New_Region(char *line)
 	if(params[0]<1)
 	{
 		printk(MTD_FORTUNET_PK "Bad parameters for MTD Region "
-			" name,region-number[,base,size,buswidth,altbuswidth]\n");
+			" name,region-number[,base,size,bankwidth,altbankwidth]\n");
 		return 1;
 	}
 	if((params[1]<0)||(params[1]>=MAX_NUM_REGIONS))
@@ -116,7 +116,7 @@ static int __init MTD_New_Region(char *line)
 		&default_map,sizeof(map_regions[params[1]].map_info));
         map_regions_set[params[1]] = 1;
         map_regions[params[1]].window_addr_physical = DEF_WINDOW_ADDR_PHY;
-        map_regions[params[1]].altbuswidth = 2;
+        map_regions[params[1]].altbankwidth = 2;
         map_regions[params[1]].mymtd = NULL;
 	map_regions[params[1]].map_info.name = map_regions[params[1]].map_name;
 	strcpy(map_regions[params[1]].map_info.name,string);
@@ -130,11 +130,11 @@ static int __init MTD_New_Region(char *line)
 	}
 	if(params[0]>3)
 	{
-		map_regions[params[1]].map_info.buswidth = params[4];
+		map_regions[params[1]].map_info.bankwidth = params[4];
 	}
 	if(params[0]>4)
 	{
-		map_regions[params[1]].altbuswidth = params[5];
+		map_regions[params[1]].altbankwidth = params[5];
 	}
 	return 1;
 }
@@ -193,7 +193,7 @@ int __init init_fortunet(void)
 				sizeof(map_regions[ix].map_info));
 			map_regions_set[ix] = 1;
 			map_regions[ix].window_addr_physical = DEF_WINDOW_ADDR_PHY;
-			map_regions[ix].altbuswidth = 2;
+			map_regions[ix].altbankwidth = 2;
 			map_regions[ix].mymtd = NULL;
 			map_regions[ix].map_info.name = map_regions[ix].map_name;
 			strcpy(map_regions[ix].map_info.name,"FORTUNET");
@@ -227,13 +227,13 @@ int __init init_fortunet(void)
 			map_regions[ix].mymtd = do_map_probe("cfi_probe",
 				&map_regions[ix].map_info);
 			if((!map_regions[ix].mymtd)&&(
-				map_regions[ix].altbuswidth!=map_regions[ix].map_info.buswidth))
+				map_regions[ix].altbankwidth!=map_regions[ix].map_info.bankwidth))
 			{
-				printk(KERN_NOTICE MTD_FORTUNET_PK "Trying alternate buswidth "
+				printk(KERN_NOTICE MTD_FORTUNET_PK "Trying alternate bankwidth "
 					"for %s flash.\n",
 					map_regions[ix].map_info.name);
-				map_regions[ix].map_info.buswidth =
-					map_regions[ix].altbuswidth;
+				map_regions[ix].map_info.bankwidth =
+					map_regions[ix].altbankwidth;
 				map_regions[ix].mymtd = do_map_probe("cfi_probe",
 					&map_regions[ix].map_info);
 			}
diff --git a/drivers/mtd/maps/h720x-flash.c b/drivers/mtd/maps/h720x-flash.c
index 3a0c58db2..e7cd7b022 100644
--- a/drivers/mtd/maps/h720x-flash.c
+++ b/drivers/mtd/maps/h720x-flash.c
@@ -2,9 +2,11 @@
  * Flash memory access on Hynix GMS30C7201/HMS30C7202 based 
  * evaluation boards
  * 
+ * $Id: h720x-flash.c,v 1.9 2004/07/14 17:45:40 dwmw2 Exp $
+ *
  * (C) 2002 Jungjun Kim <jungjun.kim@hynix.com>
  *     2003 Thomas Gleixner <tglx@linutronix.de>	
-*/
+ */
 
 #include <linux/config.h>
 #include <linux/module.h>
@@ -24,7 +26,7 @@ static struct mtd_info *mymtd;
 
 static struct map_info h720x_map = {
 	.name =		"H720X",
-	.buswidth =	4,
+	.bankwidth =	4,
 	.size =		FLASH_SIZE,
 	.phys =		FLASH_PHYS,
 };
@@ -80,13 +82,13 @@ int __init h720x_mtd_init(void)
 
 	simple_map_init(&h720x_map);
 
-	// Probe for flash buswidth 4
+	// Probe for flash bankwidth 4
 	printk (KERN_INFO "H720x-MTD probing 32bit FLASH\n");
 	mymtd = do_map_probe("cfi_probe", &h720x_map);
 	if (!mymtd) {
 		printk (KERN_INFO "H720x-MTD probing 16bit FLASH\n");
-	    // Probe for buswidth 2
-	    h720x_map.buswidth = 2;
+	    // Probe for bankwidth 2
+	    h720x_map.bankwidth = 2;
 	    mymtd = do_map_probe("cfi_probe", &h720x_map);
 	}
 	    
diff --git a/drivers/mtd/maps/ich2rom.c b/drivers/mtd/maps/ich2rom.c
index a13d76a11..2f3e9e2f2 100644
--- a/drivers/mtd/maps/ich2rom.c
+++ b/drivers/mtd/maps/ich2rom.c
@@ -109,7 +109,7 @@ static struct ich2rom_map_info ich2rom_map = {
 		 * needs to use a different method.
 		 */
 	},
-	.mtd = 0,
+	.mtd = NULL,
 	.window_addr = 0,
 };
 
@@ -205,7 +205,7 @@ static int __devinit ich2rom_init_one (struct pci_dev *pdev,
 
 	/* FIXME select the firmware hub and enable a window to it. */
 
-	info->mtd = 0;
+	info->mtd = NULL;
 	info->map.map_priv_1 = 	info->window_addr;
 
 	map_size = ICH2_FWH_REGION_SIZE;
@@ -245,7 +245,7 @@ static void __devexit ich2rom_remove_one (struct pci_dev *pdev)
 
 	del_mtd_device(info->mtd);
 	map_destroy(info->mtd);
-	info->mtd = 0;
+	info->mtd = NULL;
 	info->map.map_priv_1 = 0;
 
 	iounmap((void *)(info->window_addr));
@@ -286,9 +286,9 @@ int __init init_ich2rom(void)
 {
 	struct pci_dev *pdev;
 	struct pci_device_id *id;
-	pdev = 0;
+	pdev = NULL;
 	for(id = ich2rom_pci_tbl; id->vendor; id++) {
-		pdev = pci_find_device(id->vendor, id->device, 0);
+		pdev = pci_find_device(id->vendor, id->device, NULL);
 		if (pdev) {
 			break;
 		}
diff --git a/drivers/mtd/maps/ichxrom.c b/drivers/mtd/maps/ichxrom.c
index ec2612b0d..a26cc3af5 100644
--- a/drivers/mtd/maps/ichxrom.c
+++ b/drivers/mtd/maps/ichxrom.c
@@ -2,7 +2,7 @@
  * ichxrom.c
  *
  * Normal mappings of chips in physical memory
- * $Id: ichxrom.c,v 1.7 2004/07/14 18:14:09 eric Exp $
+ * $Id: ichxrom.c,v 1.8 2004/07/16 17:43:11 dwmw2 Exp $
  */
 
 #include <linux/module.h>
@@ -286,7 +286,7 @@ static int __devinit ichxrom_init_one (struct pci_dev *pdev,
 		info->mtd->unlock = ichxrom_unlock;
 	}
 	if (info->mtd->size > info->map.size) {
-		printk(KERN_WARNING MOD_NAME " rom(%u) larger than window(%u). fixing...\n",
+		printk(KERN_WARNING MOD_NAME " rom(%u) larger than window(%lu). fixing...\n",
 		       info->mtd->size, info->map.size);
 		info->mtd->size = info->map.size;
 	}
diff --git a/drivers/mtd/maps/impa7.c b/drivers/mtd/maps/impa7.c
index fdf0dca3f..a05fc01b9 100644
--- a/drivers/mtd/maps/impa7.c
+++ b/drivers/mtd/maps/impa7.c
@@ -1,5 +1,5 @@
 /*
- * $Id: impa7.c,v 1.9 2003/06/23 11:47:43 dwmw2 Exp $
+ * $Id: impa7.c,v 1.11 2004/07/14 09:52:55 dwmw2 Exp $
  *
  * Handle mapping of the NOR flash on implementa A7 boards
  *
@@ -30,25 +30,25 @@
 #define NUM_FLASHBANKS 2
 #define BUSWIDTH     4
 
-/* can be { "cfi_probe", "jedec_probe", "map_rom", 0 }; */
-#define PROBETYPES { "jedec_probe", 0 }
+/* can be { "cfi_probe", "jedec_probe", "map_rom", NULL } */
+#define PROBETYPES { "jedec_probe", NULL }
 
 #define MSG_PREFIX "impA7:"   /* prefix for our printk()'s */
 #define MTDID      "impa7-%d"  /* for mtdparts= partitioning */
 
-static struct mtd_info *impa7_mtd[NUM_FLASHBANKS] = { 0 };
+static struct mtd_info *impa7_mtd[NUM_FLASHBANKS];
 
 
 static struct map_info impa7_map[NUM_FLASHBANKS] = {
 	{
 		.name = "impA7 NOR Flash Bank #0",
 		.size = WINDOW_SIZE0,
-		.buswidth = BUSWIDTH,
+		.bankwidth = BUSWIDTH,
 	},
 	{
 		.name = "impA7 NOR Flash Bank #1",
 		.size = WINDOW_SIZE1,
-		.buswidth = BUSWIDTH,
+		.bankwidth = BUSWIDTH,
 	},
 };
 
diff --git a/drivers/mtd/maps/integrator-flash.c b/drivers/mtd/maps/integrator-flash.c
index b05dda1b3..1f23ab1cd 100644
--- a/drivers/mtd/maps/integrator-flash.c
+++ b/drivers/mtd/maps/integrator-flash.c
@@ -22,7 +22,7 @@
    This is access code for flashes using ARM's flash partitioning 
    standards.
 
-   $Id: integrator-flash.c,v 1.15 2004/02/27 22:37:39 rmk Exp $
+   $Id: integrator-flash.c,v 1.16 2004/07/12 21:59:44 dwmw2 Exp $
 
 ======================================================================*/
 
@@ -108,7 +108,7 @@ static int armflash_probe(struct device *_dev)
 	 * look for CFI based flash parts fitted to this board
 	 */
 	info->map.size		= size;
-	info->map.buswidth	= plat->width;
+	info->map.bankwidth	= plat->width;
 	info->map.phys		= res->start;
 	info->map.virt		= (unsigned long) base;
 	info->map.name		= dev->dev.bus_id;
diff --git a/drivers/mtd/maps/iq80310.c b/drivers/mtd/maps/iq80310.c
index f0b7b4dab..17d7c7759 100644
--- a/drivers/mtd/maps/iq80310.c
+++ b/drivers/mtd/maps/iq80310.c
@@ -1,5 +1,5 @@
 /*
- * $Id: iq80310.c,v 1.17 2003/06/23 11:48:18 dwmw2 Exp $
+ * $Id: iq80310.c,v 1.18 2004/07/12 21:59:44 dwmw2 Exp $
  *
  * Mapping for the Intel XScale IQ80310 evaluation board
  *
@@ -31,7 +31,7 @@ static struct mtd_info *mymtd;
 static struct map_info iq80310_map = {
 	.name = "IQ80310 flash",
 	.size = WINDOW_SIZE,
-	.buswidth = BUSWIDTH,
+	.bankwidth = BUSWIDTH,
 	.phys = WINDOW_ADDR
 };
 
diff --git a/drivers/mtd/maps/ixp4xx.c b/drivers/mtd/maps/ixp4xx.c
index a10f92126..7ebc8cc5b 100644
--- a/drivers/mtd/maps/ixp4xx.c
+++ b/drivers/mtd/maps/ixp4xx.c
@@ -1,5 +1,5 @@
 /*
- * $Id: ixp4xx.c,v 1.1 2004/05/13 22:21:26 dsaxena Exp $
+ * $Id: ixp4xx.c,v 1.3 2004/07/12 22:38:29 dwmw2 Exp $
  *
  * drivers/mtd/maps/ixp4xx.c
  *
@@ -39,10 +39,11 @@
 #define	BYTE1(h)	((h) & 0xFF)
 #endif
 
-static __u16
-ixp4xx_read16(struct map_info *map, unsigned long ofs)
+static map_word ixp4xx_read16(struct map_info *map, unsigned long ofs)
 {
-	return *(__u16 *) (map->map_priv_1 + ofs);
+	map_word val;
+	val.x[0] = *(__u16 *) (map->map_priv_1 + ofs);
+	return val;
 }
 
 /*
@@ -50,9 +51,8 @@ ixp4xx_read16(struct map_info *map, unsigned long ofs)
  * when attached to a 16-bit wide device (such as the 28F128J3A),
  * so we can't just memcpy_fromio().
  */
-static void
-ixp4xx_copy_from(struct map_info *map, void *to,
-		 unsigned long from, ssize_t len)
+static void ixp4xx_copy_from(struct map_info *map, void *to,
+			     unsigned long from, ssize_t len)
 {
 	int i;
 	u8 *dest = (u8 *) to;
@@ -69,10 +69,9 @@ ixp4xx_copy_from(struct map_info *map, void *to,
 		dest[len - 1] = BYTE0(src[i]);
 }
 
-static void
-ixp4xx_write16(struct map_info *map, __u16 d, unsigned long adr)
+static void ixp4xx_write16(struct map_info *map, map_word d, unsigned long adr)
 {
-	*(__u16 *) (map->map_priv_1 + adr) = d;
+	*(__u16 *) (map->map_priv_1 + adr) = d.x[0];
 }
 
 struct ixp4xx_flash_info {
@@ -84,8 +83,7 @@ struct ixp4xx_flash_info {
 
 static const char *probes[] = { "RedBoot", "cmdlinepart", NULL };
 
-static int
-ixp4xx_flash_remove(struct device *_dev)
+static int ixp4xx_flash_remove(struct device *_dev)
 {
 	struct platform_device *dev = to_platform_device(_dev);
 	struct flash_platform_data *plat = dev->dev.platform_data;
@@ -168,10 +166,10 @@ static int ixp4xx_flash_probe(struct device *_dev)
 	 * any board use 8-bit access, we'll fixup the driver to
 	 * handle that.
 	 */
-	info->map.buswidth = 2;
+	info->map.bankwidth = 2;
 	info->map.name = dev->dev.bus_id;
-	info->map.read16 = ixp4xx_read16,
-	info->map.write16 = ixp4xx_write16,
+	info->map.read = ixp4xx_read16,
+	info->map.write = ixp4xx_write16,
 	info->map.copy_from = ixp4xx_copy_from,
 
 	info->res = request_mem_region(dev->resource->start, 
diff --git a/drivers/mtd/maps/l440gx.c b/drivers/mtd/maps/l440gx.c
index 2e410ef55..046f7efbd 100644
--- a/drivers/mtd/maps/l440gx.c
+++ b/drivers/mtd/maps/l440gx.c
@@ -1,5 +1,5 @@
 /*
- * $Id: l440gx.c,v 1.12 2003/05/21 12:45:19 dwmw2 Exp $
+ * $Id: l440gx.c,v 1.13 2004/07/12 21:59:44 dwmw2 Exp $
  *
  * BIOS Flash chip on Intel 440GX board.
  *
@@ -46,7 +46,7 @@ void l440gx_set_vpp(struct map_info *map, int vpp)
 struct map_info l440gx_map = {
 	.name = "L440GX BIOS",
 	.size = WINDOW_SIZE,
-	.buswidth = BUSWIDTH,
+	.bankwidth = BUSWIDTH,
 	.phys = WINDOW_ADDR,
 #if 0
 	/* FIXME verify that this is the 
diff --git a/drivers/mtd/maps/lasat.c b/drivers/mtd/maps/lasat.c
index 36a14d6a4..2a2efaa42 100644
--- a/drivers/mtd/maps/lasat.c
+++ b/drivers/mtd/maps/lasat.c
@@ -1,14 +1,13 @@
 /*
- * Flash device on lasat 100 and 200 boards
+ * Flash device on Lasat 100 and 200 boards
  *
- * Presumably (C) 2002 Brian Murphy <brian@murphy.dk> or whoever he
- * works for.
+ * (C) 2002 Brian Murphy <brian@murphy.dk>
  *
  * 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.
  *
- * $Id: lasat.c,v 1.5 2003/05/21 12:45:19 dwmw2 Exp $
+ * $Id: lasat.c,v 1.7 2004/07/12 21:59:44 dwmw2 Exp $
  *
  */
 
@@ -22,44 +21,53 @@
 #include <linux/mtd/partitions.h>
 #include <linux/config.h>
 #include <asm/lasat/lasat.h>
-#include <asm/lasat/lasat_mtd.h>
 
-static struct mtd_info *mymtd;
-
-static struct map_info sp_map = {
-	.name = "SP flash",
-	.buswidth = 4,
-};
+static struct mtd_info *lasat_mtd;
 
 static struct mtd_partition partition_info[LASAT_MTD_LAST];
 static char *lasat_mtd_partnames[] = {"Bootloader", "Service", "Normal", "Filesystem", "Config"};
 
-static int __init init_sp(void)
+static void lasat_set_vpp(struct map_info *map, int vpp)
 {
-	int i;
-	/* this does not play well with the old flash code which 
-	 * protects and uprotects the flash when necessary */
-	/* FIXME: Implement set_vpp() */
-       	printk(KERN_NOTICE "Unprotecting flash\n");
-	*lasat_misc->flash_wp_reg |= 1 << lasat_misc->flash_wp_bit;
+	if (vpp)
+	    *lasat_misc->flash_wp_reg |= 1 << lasat_misc->flash_wp_bit;
+	else
+	    *lasat_misc->flash_wp_reg &= ~(1 << lasat_misc->flash_wp_bit);
+}
+
+static struct map_info lasat_map = {
+	.name = "LASAT flash",
+	.bankwidth = 4,
+	.set_vpp = lasat_set_vpp
+};
 
-	sp_map.virt = lasat_flash_partition_start(LASAT_MTD_BOOTLOADER);
-	sp_map.phys = virt_to_phys(sp_map.virt);
-	sp_map.size = lasat_board_info.li_flash_size;
+static int __init init_lasat(void)
+{
+	int i;
+	/* since we use AMD chips and set_vpp is not implimented
+	 * for these (yet) we still have to permanently enable flash write */
+	printk(KERN_NOTICE "Unprotecting flash\n");
+	ENABLE_VPP((&lasat_map));
 
-	simple_map_init(&sp_map);
+	lasat_map.phys = lasat_flash_partition_start(LASAT_MTD_BOOTLOADER);
+	lasat_map.virt = (unsigned long)ioremap_nocache(
+		        lasat_map.phys, lasat_board_info.li_flash_size);
+	lasat_map.size = lasat_board_info.li_flash_size;
 
-       	printk(KERN_NOTICE "sp flash device: %lx at %lx\n", 
-			sp_map.size, sp_map.phys);
+	simple_map_init(&lasat_map);
 
 	for (i=0; i < LASAT_MTD_LAST; i++)
 		partition_info[i].name = lasat_mtd_partnames[i];
 
-	mymtd = do_map_probe("cfi_probe", &sp_map);
-	if (mymtd) {
+	lasat_mtd = do_map_probe("cfi_probe", &lasat_map);
+
+	if (!lasat_mtd)
+	    lasat_mtd = do_map_probe("jedec_probe", &lasat_map);
+
+	if (lasat_mtd) {
 		u32 size, offset = 0;
 
-		mymtd->owner = THIS_MODULE;
+		lasat_mtd->owner = THIS_MODULE;
 
 		for (i=0; i < LASAT_MTD_LAST; i++) {
 			size = lasat_flash_partition_size(i);
@@ -68,26 +76,26 @@ static int __init init_sp(void)
 			offset += size;
 		}
 
-		add_mtd_partitions( mymtd, partition_info, LASAT_MTD_LAST );
+		add_mtd_partitions( lasat_mtd, partition_info, LASAT_MTD_LAST );
 		return 0;
 	}
 
 	return -ENXIO;
 }
 
-static void __exit cleanup_sp(void)
+static void __exit cleanup_lasat(void)
 {
-	if (mymtd) {
-		del_mtd_partitions(mymtd);
-		map_destroy(mymtd);
+	if (lasat_mtd) {
+		del_mtd_partitions(lasat_mtd);
+		map_destroy(lasat_mtd);
 	}
-	if (sp_map.virt) {
-		sp_map.virt = 0;
+	if (lasat_map.virt) {
+		lasat_map.virt = 0;
 	}
 }
 
-module_init(init_sp);
-module_exit(cleanup_sp);
+module_init(init_lasat);
+module_exit(cleanup_lasat);
 
 MODULE_LICENSE("GPL");
 MODULE_AUTHOR("Brian Murphy <brian@murphy.dk>");
diff --git a/drivers/mtd/maps/lubbock-flash.c b/drivers/mtd/maps/lubbock-flash.c
index 5f7bdd883..53e708b2e 100644
--- a/drivers/mtd/maps/lubbock-flash.c
+++ b/drivers/mtd/maps/lubbock-flash.c
@@ -1,5 +1,5 @@
 /*
- * $Id: lubbock-flash.c,v 1.9 2003/06/23 11:48:18 dwmw2 Exp $
+ * $Id: lubbock-flash.c,v 1.15 2004/07/12 21:59:44 dwmw2 Exp $
  *
  * Map driver for the Lubbock developer platform.
  *
@@ -28,12 +28,19 @@
 
 #define WINDOW_SIZE 	64*1024*1024
 
+static void lubbock_map_inval_cache(struct map_info *map, unsigned long from, ssize_t len)
+{
+	consistent_sync((char *)map->cached + from, len, DMA_FROM_DEVICE);
+}
+
 static struct map_info lubbock_maps[2] = { {
 	.size =		WINDOW_SIZE,
 	.phys =		0x00000000,
+	.inval_cache = 	lubbock_map_inval_cache,
 }, {
 	.size =		WINDOW_SIZE,
 	.phys =		0x04000000,
+	.inval_cache = 	lubbock_map_inval_cache,
 } };
 
 static struct mtd_partition lubbock_partitions[] = {
@@ -64,7 +71,7 @@ static int __init init_lubbock(void)
 	int flashboot = (LUB_CONF_SWITCHES & 1);
 	int ret = 0, i;
 
-	lubbock_maps[0].buswidth = lubbock_maps[1].buswidth = 
+	lubbock_maps[0].bankwidth = lubbock_maps[1].bankwidth = 
 		(BOOT_DEF & 1) ? 2 : 4;
 
 	/* Compensate for the nROMBT switch which swaps the flash banks */
@@ -82,16 +89,23 @@ static int __init init_lubbock(void)
 				ret = -ENOMEM;
 			continue;
 		}
+		lubbock_maps[i].cached = __ioremap(lubbock_maps[i].phys,
+						   WINDOW_SIZE,
+						   L_PTE_CACHEABLE, 1);
+		if (!lubbock_maps[i].cached)
+			printk(KERN_WARNING "Failed to ioremap cached %s\n", lubbock_maps[i].name);
 		simple_map_init(&lubbock_maps[i]);
 
-		printk(KERN_NOTICE "Probing %s at physical address 0x%08lx (%d-bit buswidth)\n",
+		printk(KERN_NOTICE "Probing %s at physical address 0x%08lx (%d-bit bankwidth)\n",
 		       lubbock_maps[i].name, lubbock_maps[i].phys, 
-		       lubbock_maps[i].buswidth * 8);
+		       lubbock_maps[i].bankwidth * 8);
 
 		mymtds[i] = do_map_probe("cfi_probe", &lubbock_maps[i]);
 		
 		if (!mymtds[i]) {
 			iounmap((void *)lubbock_maps[i].virt);
+			if (lubbock_maps[i].cached)
+				iounmap(lubbock_maps[i].cached);
 			if (!ret)
 				ret = -EIO;
 			continue;
@@ -138,6 +152,8 @@ static void __exit cleanup_lubbock(void)
 
 		map_destroy(mymtds[i]);
 		iounmap((void *)lubbock_maps[i].virt);
+		if (lubbock_maps[i].cached)
+			iounmap(lubbock_maps[i].cached);
 
 		if (parsed_parts[i])
 			kfree(parsed_parts[i]);
diff --git a/drivers/mtd/maps/map_funcs.c b/drivers/mtd/maps/map_funcs.c
index 4bb4af6c8..38f6a7af5 100644
--- a/drivers/mtd/maps/map_funcs.c
+++ b/drivers/mtd/maps/map_funcs.c
@@ -1,5 +1,5 @@
 /*
- * $Id: map_funcs.c,v 1.2 2003/05/21 15:15:07 dwmw2 Exp $
+ * $Id: map_funcs.c,v 1.9 2004/07/13 22:33:15 dwmw2 Exp $
  *
  * Out-of-line map I/O functions for simple maps when CONFIG_COMPLEX_MAPPINGS
  * is enabled.
@@ -7,87 +7,35 @@
 
 #include <linux/kernel.h>
 #include <linux/module.h>
-#include <linux/config.h>
-#include <linux/types.h>
-#include <linux/string.h>
-#include <asm/io.h>
 
 #include <linux/mtd/map.h>
-#include <linux/mtd/cfi.h>
 
-static u8 simple_map_read8(struct map_info *map, unsigned long ofs)
+static map_word simple_map_read(struct map_info *map, unsigned long ofs)
 {
-	return __raw_readb(map->virt + ofs);
+	return inline_map_read(map, ofs);
 }
 
-static u16 simple_map_read16(struct map_info *map, unsigned long ofs)
+static void simple_map_write(struct map_info *map, const map_word datum, unsigned long ofs)
 {
-	return __raw_readw(map->virt + ofs);
-}
-
-static u32 simple_map_read32(struct map_info *map, unsigned long ofs)
-{
-	return __raw_readl(map->virt + ofs);
-}
-
-static u64 simple_map_read64(struct map_info *map, unsigned long ofs)
-{
-#ifndef CONFIG_MTD_CFI_B8 /* 64-bit mappings */
-	BUG();
-	return 0;
-#else
-	return __raw_readll(map->virt + ofs);
-#endif
-}
-
-static void simple_map_write8(struct map_info *map, u8 datum, unsigned long ofs)
-{
-	__raw_writeb(datum, map->virt + ofs);
-	mb();
-}
-
-static void simple_map_write16(struct map_info *map, u16 datum, unsigned long ofs)
-{
-	__raw_writew(datum, map->virt + ofs);
-	mb();
-}
-
-static void simple_map_write32(struct map_info *map, u32 datum, unsigned long ofs)
-{
-	__raw_writel(datum, map->virt + ofs);
-	mb();
-}
-
-static void simple_map_write64(struct map_info *map, u64 datum, unsigned long ofs)
-{
-#ifndef CONFIG_MTD_CFI_B8 /* 64-bit mappings */
-	BUG();
-#else
-	__raw_writell(datum, map->virt + ofs);
-	mb();
-#endif /* CFI_B8 */
+	inline_map_write(map, datum, ofs);
 }
 
 static void simple_map_copy_from(struct map_info *map, void *to, unsigned long from, ssize_t len)
 {
-	memcpy_fromio(to, map->virt + from, len);
+	inline_map_copy_from(map, to, from, len);
 }
 
 static void simple_map_copy_to(struct map_info *map, unsigned long to, const void *from, ssize_t len)
 {
-	memcpy_toio(map->virt + to, from, len);
+	inline_map_copy_to(map, to, from, len);
 }
 
 void simple_map_init(struct map_info *map)
 {
-	map->read8 = simple_map_read8;
-	map->read16 = simple_map_read16;
-	map->read32 = simple_map_read32;
-	map->read64 = simple_map_read64;
-	map->write8 = simple_map_write8;
-	map->write16 = simple_map_write16;
-	map->write32 = simple_map_write32;
-	map->write64 = simple_map_write64;
+	BUG_ON(!map_bankwidth_supported(map->bankwidth));
+
+	map->read = simple_map_read;
+	map->write = simple_map_write;
 	map->copy_from = simple_map_copy_from;
 	map->copy_to = simple_map_copy_to;
 }
diff --git a/drivers/mtd/maps/mbx860.c b/drivers/mtd/maps/mbx860.c
index 5adbec880..4c0f9e967 100644
--- a/drivers/mtd/maps/mbx860.c
+++ b/drivers/mtd/maps/mbx860.c
@@ -1,5 +1,5 @@
 /*
- * $Id: mbx860.c,v 1.5 2003/05/21 12:45:19 dwmw2 Exp $
+ * $Id: mbx860.c,v 1.6 2004/07/12 21:59:44 dwmw2 Exp $
  *
  * Handle mapping of the flash on MBX860 boards
  *
@@ -54,7 +54,7 @@ struct map_info mbx_map = {
 	.name = "MBX flash",
 	.size = WINDOW_SIZE,
 	.phys = WINDOW_ADDR,
-	.buswidth = 4,
+	.bankwidth = 4,
 };
 
 int __init init_mbx(void)
diff --git a/drivers/mtd/maps/netsc520.c b/drivers/mtd/maps/netsc520.c
index caaac71cc..afdf6589b 100644
--- a/drivers/mtd/maps/netsc520.c
+++ b/drivers/mtd/maps/netsc520.c
@@ -3,7 +3,7 @@
  * Copyright (C) 2001 Mark Langsdorf (mark.langsdorf@amd.com)
  *	based on sc520cdp.c by Sysgo Real-Time Solutions GmbH
  *
- * $Id: netsc520.c,v 1.9 2003/05/21 12:45:19 dwmw2 Exp $
+ * $Id: netsc520.c,v 1.10 2004/07/12 21:59:44 dwmw2 Exp $
  *
  * 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
@@ -84,7 +84,7 @@ static struct mtd_partition partition_info[]={
 static struct map_info netsc520_map = {
 	.name = "netsc520 Flash Bank",
 	.size = WINDOW_SIZE,
-	.buswidth = 4,
+	.bankwidth = 4,
 	.phys = WINDOW_ADDR,
 };
 
diff --git a/drivers/mtd/maps/nettel.c b/drivers/mtd/maps/nettel.c
index 53a9934fb..e06b07351 100644
--- a/drivers/mtd/maps/nettel.c
+++ b/drivers/mtd/maps/nettel.c
@@ -6,7 +6,7 @@
  *      (C) Copyright 2000-2001, Greg Ungerer (gerg@snapgear.com)
  *      (C) Copyright 2001-2002, SnapGear (www.snapgear.com)
  *
- *	$Id: nettel.c,v 1.4 2003/05/20 20:59:30 dwmw2 Exp $
+ *	$Id: nettel.c,v 1.5 2004/07/12 21:59:44 dwmw2 Exp $
  */
 
 /****************************************************************************/
@@ -65,7 +65,7 @@ static struct mtd_info *amd_mtd;
 static struct map_info nettel_intel_map = {
 	.name = "SnapGear Intel",
 	.size = 0,
-	.buswidth = INTEL_BUSWIDTH,
+	.bankwidth = INTEL_BUSWIDTH,
 };
 
 static struct mtd_partition nettel_intel_partitions[] = {
@@ -103,7 +103,7 @@ static struct mtd_partition nettel_intel_partitions[] = {
 static struct map_info nettel_amd_map = {
 	.name = "SnapGear AMD",
 	.size = AMD_WINDOW_MAXSIZE,
-	.buswidth = AMD_BUSWIDTH,
+	.bankwidth = AMD_BUSWIDTH,
 };
 
 static struct mtd_partition nettel_amd_partitions[] = {
diff --git a/drivers/mtd/maps/ocelot.c b/drivers/mtd/maps/ocelot.c
index 201f67a40..40c524d62 100644
--- a/drivers/mtd/maps/ocelot.c
+++ b/drivers/mtd/maps/ocelot.c
@@ -1,5 +1,5 @@
 /*
- * $Id: ocelot.c,v 1.12 2003/05/21 12:45:19 dwmw2 Exp $
+ * $Id: ocelot.c,v 1.13 2004/07/12 21:59:44 dwmw2 Exp $
  *
  * Flash on Momenco Ocelot
  */
@@ -49,14 +49,14 @@ static struct mtd_partition *parsed_parts;
 struct map_info ocelot_flash_map = {
 	.name = "Ocelot boot flash",
 	.size = FLASH_WINDOW_SIZE,
-	.buswidth = FLASH_BUSWIDTH,
+	.bankwidth = FLASH_BUSWIDTH,
 	.phys = FLASH_WINDOW_ADDR,
 };
 
 struct map_info ocelot_nvram_map = {
 	.name = "Ocelot NVRAM",
 	.size = NVRAM_WINDOW_SIZE,
-	.buswidth = NVRAM_BUSWIDTH,
+	.bankwidth = NVRAM_BUSWIDTH,
 	.phys = NVRAM_WINDOW_ADDR,
 };
 
diff --git a/drivers/mtd/maps/octagon-5066.c b/drivers/mtd/maps/octagon-5066.c
index 176890b9b..10bd8901e 100644
--- a/drivers/mtd/maps/octagon-5066.c
+++ b/drivers/mtd/maps/octagon-5066.c
@@ -1,4 +1,4 @@
-// $Id: octagon-5066.c,v 1.24 2003/05/21 15:15:07 dwmw2 Exp $
+// $Id: octagon-5066.c,v 1.26 2004/07/12 22:38:29 dwmw2 Exp $
 /* ######################################################################
 
    Octagon 5066 MTD Driver. 
@@ -62,32 +62,12 @@ static inline void oct5066_page(struct map_info *map, unsigned long ofs)
 }
 
 
-static __u8 oct5066_read8(struct map_info *map, unsigned long ofs)
+static map_word oct5066_read8(struct map_info *map, unsigned long ofs)
 {
-	__u8 ret;
+	map_word ret;
 	spin_lock(&oct5066_spin);
 	oct5066_page(map, ofs);
-	ret = readb(iomapadr + (ofs & WINDOW_MASK));
-	spin_unlock(&oct5066_spin);
-	return ret;
-}
-
-static __u16 oct5066_read16(struct map_info *map, unsigned long ofs)
-{
-	__u16 ret;
-	spin_lock(&oct5066_spin);
-	oct5066_page(map, ofs);
-	ret = readw(iomapadr + (ofs & WINDOW_MASK));
-	spin_unlock(&oct5066_spin);
-	return ret;
-}
-
-static __u32 oct5066_read32(struct map_info *map, unsigned long ofs)
-{
-	__u32 ret;
-	spin_lock(&oct5066_spin);
-	oct5066_page(map, ofs);
-	ret = readl(iomapadr + (ofs & WINDOW_MASK));
+	ret.x[0] = readb(iomapadr + (ofs & WINDOW_MASK));
 	spin_unlock(&oct5066_spin);
 	return ret;
 }
@@ -109,27 +89,11 @@ static void oct5066_copy_from(struct map_info *map, void *to, unsigned long from
 	}
 }
 
-static void oct5066_write8(struct map_info *map, __u8 d, unsigned long adr)
-{
-	spin_lock(&oct5066_spin);
-	oct5066_page(map, adr);
-	writeb(d, iomapadr + (adr & WINDOW_MASK));
-	spin_unlock(&oct5066_spin);
-}
-
-static void oct5066_write16(struct map_info *map, __u16 d, unsigned long adr)
-{
-	spin_lock(&oct5066_spin);
-	oct5066_page(map, adr);
-	writew(d, iomapadr + (adr & WINDOW_MASK));
-	spin_unlock(&oct5066_spin);
-}
-
-static void oct5066_write32(struct map_info *map, __u32 d, unsigned long adr)
+static void oct5066_write8(struct map_info *map, map_word d, unsigned long adr)
 {
 	spin_lock(&oct5066_spin);
 	oct5066_page(map, adr);
-	writel(d, iomapadr + (adr & WINDOW_MASK));
+	writeb(d.x[0], iomapadr + (adr & WINDOW_MASK));
 	spin_unlock(&oct5066_spin);
 }
 
@@ -155,14 +119,10 @@ static struct map_info oct5066_map[2] = {
 		.name = "Octagon 5066 Socket",
 		.phys = NO_XIP,
 		.size = 512 * 1024,
-		.buswidth = 1,
-		.read8 = oct5066_read8,
-		.read16 = oct5066_read16,
-		.read32 = oct5066_read32,
+		.bankwidth = 1,
+		.read = oct5066_read8,
 		.copy_from = oct5066_copy_from,
-		.write8 = oct5066_write8,
-		.write16 = oct5066_write16,
-		.write32 = oct5066_write32,
+		.write = oct5066_write8,
 		.copy_to = oct5066_copy_to,
 		.map_priv_1 = 1<<6
 	},
@@ -170,14 +130,10 @@ static struct map_info oct5066_map[2] = {
 		.name = "Octagon 5066 Internal Flash",
 		.phys = NO_XIP,
 		.size = 2 * 1024 * 1024,
-		.buswidth = 1,
-		.read8 = oct5066_read8,
-		.read16 = oct5066_read16,
-		.read32 = oct5066_read32,
+		.bankwidth = 1,
+		.read = oct5066_read8,
 		.copy_from = oct5066_copy_from,
-		.write8 = oct5066_write8,
-		.write16 = oct5066_write16,
-		.write32 = oct5066_write32,
+		.write = oct5066_write8,
 		.copy_to = oct5066_copy_to,
 		.map_priv_1 = 2<<6
 	}
diff --git a/drivers/mtd/maps/pb1xxx-flash.c b/drivers/mtd/maps/pb1xxx-flash.c
index 713c52b0e..b6b8ccf48 100644
--- a/drivers/mtd/maps/pb1xxx-flash.c
+++ b/drivers/mtd/maps/pb1xxx-flash.c
@@ -3,14 +3,14 @@
  * 
  * (C) 2001 Pete Popov <ppopov@mvista.com>
  * 
- * $Id: pb1xxx-flash.c,v 1.9 2003/06/23 11:48:18 dwmw2 Exp $
+ * $Id: pb1xxx-flash.c,v 1.11 2004/07/12 21:59:44 dwmw2 Exp $
  */
 
 #include <linux/config.h>
 #include <linux/module.h>
 #include <linux/types.h>
-#include <linux/kernel.h>
 #include <linux/init.h>
+#include <linux/kernel.h>
 
 #include <linux/mtd/mtd.h>
 #include <linux/mtd/map.h>
@@ -26,102 +26,87 @@
 #endif
 
 #ifdef CONFIG_MIPS_PB1000
+
 #define WINDOW_ADDR 0x1F800000
 #define WINDOW_SIZE 0x800000
-#endif
-
-
-static struct map_info pb1xxx_map = {
-	.name =	"Pb1xxx flash",
-};
-
-
-#ifdef CONFIG_MIPS_PB1000
 
-static unsigned long flash_size = 0x00800000;
-static unsigned char flash_buswidth = 4;
 static struct mtd_partition pb1xxx_partitions[] = {
         {
-                .name = "yamon env",
-                .size = 0x00020000,
-                .offset = 0,
-                .mask_flags = MTD_WRITEABLE
-        },{
-                .name = "User FS",
-                .size = 0x003e0000,
-                .offset = 0x20000,
-        },{
-                .name = "boot code",
-                .size = 0x100000,
-                .offset = 0x400000,
-                .mask_flags = MTD_WRITEABLE
-        },{
-                .name = "raw/kernel",
-                .size = 0x300000,
-                .offset = 0x500000
-        }
+                .name         =  "yamon env",
+                .size         =   0x00020000,
+                .offset       =   0,
+                .mask_flags   =   MTD_WRITEABLE},
+	{
+                .name         =   "User FS",
+                .size         =   0x003e0000,
+                .offset       =   0x20000,},
+	{
+                .name         =   "boot code",
+                .size         =   0x100000,
+                .offset       =   0x400000,
+                .mask_flags   =   MTD_WRITEABLE},
+	{
+                .name         =   "raw/kernel",
+                .size         =   0x300000,
+                .offset       =   0x500000}
 };
 
 #elif defined(CONFIG_MIPS_PB1500) || defined(CONFIG_MIPS_PB1100)
 
-static unsigned char flash_buswidth = 4;
 #if defined(CONFIG_MTD_PB1500_BOOT) && defined(CONFIG_MTD_PB1500_USER)
-/* both 32MiB banks will be used. Combine the first 32MiB bank and the
- * first 28MiB of the second bank together into a single jffs/jffs2
+/* both 32MB banks will be used. Combine the first 32MB bank and the
+ * first 28MB of the second bank together into a single jffs/jffs2
  * partition.
  */
-static unsigned long flash_size = 0x04000000;
 #define WINDOW_ADDR 0x1C000000
 #define WINDOW_SIZE 0x4000000
 static struct mtd_partition pb1xxx_partitions[] = {
         {
-                .name = "User FS",
-                .size =   0x3c00000,
-                .offset = 0x0000000
+                .name         =   "User FS",
+                .size         =   0x3c00000,
+                .offset       =   0x0000000
         },{
-                .name = "yamon",
-                .size = 0x0100000,
-                .offset = 0x3c00000,
-                .mask_flags = MTD_WRITEABLE
+                .name         =   "yamon",
+                .size         =   0x0100000,
+                .offset       =   0x3c00000,
+                .mask_flags   =   MTD_WRITEABLE
         },{
-                .name = "raw kernel",
-                .size = 0x02c0000,
-                .offset = 0x3d00000
+                .name         =   "raw kernel",
+                .size         =   0x02c0000,
+                .offset       =   0x3d00000
         }
 };
 #elif defined(CONFIG_MTD_PB1500_BOOT) && !defined(CONFIG_MTD_PB1500_USER)
-static unsigned long flash_size = 0x02000000;
 #define WINDOW_ADDR 0x1E000000
 #define WINDOW_SIZE 0x2000000
 static struct mtd_partition pb1xxx_partitions[] = {
         {
-                .name = "User FS",
-                .size =   0x1c00000,
-                .offset = 0x0000000
+                .name         =   "User FS",
+                .size         =   0x1c00000,
+                .offset       =   0x0000000
         },{
-                .name = "yamon",
-                .size = 0x0100000,
-                .offset = 0x1c00000,
-                .mask_flags = MTD_WRITEABLE
+                .name         =   "yamon",
+                .size         =   0x0100000,
+                .offset       =   0x1c00000,
+                .mask_flags   =   MTD_WRITEABLE
         },{
-                .name = "raw kernel",
-                .size = 0x02c0000,
-                .offset = 0x1d00000
+                .name         =   "raw kernel",
+                .size         =   0x02c0000,
+                .offset       =   0x1d00000
         }
 };
 #elif !defined(CONFIG_MTD_PB1500_BOOT) && defined(CONFIG_MTD_PB1500_USER)
-static unsigned long flash_size = 0x02000000;
 #define WINDOW_ADDR 0x1C000000
 #define WINDOW_SIZE 0x2000000
 static struct mtd_partition pb1xxx_partitions[] = {
         {
-                .name = "User FS",
-                .size =   0x1e00000,
-                .offset = 0x0000000
+                .name         =   "User FS",
+                .size         =    0x1e00000,
+                .offset       =    0x0000000
         },{
-                .name = "raw kernel",
-                .size = 0x0200000,
-                .offset = 0x1e00000,
+                .name         =    "raw kernel",
+                .size         =    0x0200000,
+                .offset       =    0x1e00000,
         }
 };
 #else
@@ -131,8 +116,20 @@ static struct mtd_partition pb1xxx_partitions[] = {
 #error Unsupported board
 #endif
 
-static struct mtd_partition *parsed_parts;
-static struct mtd_info *mymtd;
+#define NAME     	"Pb1x00 Linux Flash"
+#define PADDR    	WINDOW_ADDR
+#define BUSWIDTH	4
+#define SIZE		WINDOW_SIZE
+#define PARTITIONS	4
+
+static struct map_info pb1xxx_mtd_map = {
+	.name		= NAME,
+	.size		= SIZE,
+	.bankwidth	= BUSWIDTH,
+	.phys		= PADDR,
+};
+
+static struct mtd_info *pb1xxx_mtd;
 
 int __init pb1xxx_mtd_init(void)
 {
@@ -140,49 +137,38 @@ int __init pb1xxx_mtd_init(void)
 	int nb_parts = 0;
 	char *part_type;
 	
-	/* Default flash buswidth */
-	pb1xxx_map.buswidth = flash_buswidth;
-
 	/*
 	 * Static partition definition selection
 	 */
 	part_type = "static";
 	parts = pb1xxx_partitions;
 	nb_parts = ARRAY_SIZE(pb1xxx_partitions);
-	pb1xxx_map.size = flash_size;
 
 	/*
 	 * Now let's probe for the actual flash.  Do it here since
 	 * specific machine settings might have been set above.
 	 */
 	printk(KERN_NOTICE "Pb1xxx flash: probing %d-bit flash bus\n", 
-			pb1xxx_map.buswidth*8);
-	pb1xxx_map.phys = WINDOW_ADDR;
-	pb1xxx_map.virt = (unsigned long)ioremap(WINDOW_ADDR, WINDOW_SIZE);
+			BUSWIDTH*8);
+	pb1xxx_mtd_map.virt = (unsigned long)ioremap(WINDOW_ADDR, WINDOW_SIZE);
 
-	simple_map_init(&pb1xxx_map);
+	simple_map_init(&pb1xxx_mtd_map);
 
-	mymtd = do_map_probe("cfi_probe", &pb1xxx_map);
-	if (!mymtd) {
-		iounmap(pb1xxx_map.virt);
-		return -ENXIO;
-	}
-	mymtd->owner = THIS_MODULE;
+	pb1xxx_mtd = do_map_probe("cfi_probe", &pb1xxx_mtd_map);
+	if (!pb1xxx_mtd) return -ENXIO;
+	pb1xxx_mtd->owner = THIS_MODULE;
 
-	add_mtd_partitions(mymtd, parts, nb_parts);
+	add_mtd_partitions(pb1xxx_mtd, parts, nb_parts);
 	return 0;
 }
 
 static void __exit pb1xxx_mtd_cleanup(void)
 {
-	if (mymtd) {
-		del_mtd_partitions(mymtd);
-		map_destroy(mymtd);
-		if (parsed_parts)
-			kfree(parsed_parts);
+	if (pb1xxx_mtd) {
+		del_mtd_partitions(pb1xxx_mtd);
+		map_destroy(pb1xxx_mtd);
+		iounmap((void *) pb1xxx_mtd_map.virt);
 	}
-	if (pb1xxx_map.virt)
-		iounmap(pb1xxx_map.virt);
 }
 
 module_init(pb1xxx_mtd_init);
diff --git a/drivers/mtd/maps/pci.c b/drivers/mtd/maps/pci.c
index 8baca24cb..8b5d1ff45 100644
--- a/drivers/mtd/maps/pci.c
+++ b/drivers/mtd/maps/pci.c
@@ -7,7 +7,7 @@
  * it under the terms of the GNU General Public License version 2 as
  * published by the Free Software Foundation.
  *
- *  $Id: pci.c,v 1.5 2003/05/20 20:59:31 dwmw2 Exp $
+ *  $Id: pci.c,v 1.8 2004/07/12 22:38:29 dwmw2 Exp $
  * 
  * Generic PCI memory map driver.  We support the following boards:
  *  - Intel IQ80310 ATU.
@@ -39,6 +39,74 @@ struct map_pci_info {
 	struct pci_dev *dev;
 };	
 
+static map_word mtd_pci_read8(struct map_info *_map, unsigned long ofs)
+{
+	struct map_pci_info *map = (struct map_pci_info *)_map;
+	map_word val;
+	val.x[0]= readb(map->base + map->translate(map, ofs));
+//	printk("read8 : %08lx => %02x\n", ofs, val.x[0]);
+	return val;
+}
+
+#if 0
+static map_word mtd_pci_read16(struct map_info *_map, unsigned long ofs)
+{
+	struct map_pci_info *map = (struct map_pci_info *)_map;
+	map_word val;
+	val.x[0] = readw(map->base + map->translate(map, ofs));
+//	printk("read16: %08lx => %04x\n", ofs, val.x[0]);
+	return val;
+}
+#endif
+static map_word mtd_pci_read32(struct map_info *_map, unsigned long ofs)
+{
+	struct map_pci_info *map = (struct map_pci_info *)_map;
+	map_word val;
+	val.x[0] = readl(map->base + map->translate(map, ofs));
+//	printk("read32: %08lx => %08x\n", ofs, val.x[0]);
+	return val;
+}
+
+static void mtd_pci_copyfrom(struct map_info *_map, void *to, unsigned long from, ssize_t len)
+{
+	struct map_pci_info *map = (struct map_pci_info *)_map;
+	memcpy_fromio(to, map->base + map->translate(map, from), len);
+}
+
+static void mtd_pci_write8(struct map_info *_map, map_word val, unsigned long ofs)
+{
+	struct map_pci_info *map = (struct map_pci_info *)_map;
+//	printk("write8 : %08lx <= %02x\n", ofs, val.x[0]);
+	writeb(val.x[0], map->base + map->translate(map, ofs));
+}
+
+#if 0
+static void mtd_pci_write16(struct map_info *_map, map_word val, unsigned long ofs)
+{
+	struct map_pci_info *map = (struct map_pci_info *)_map;
+//	printk("write16: %08lx <= %04x\n", ofs, val.x[0]);
+	writew(val.x[0], map->base + map->translate(map, ofs));
+}
+#endif
+static void mtd_pci_write32(struct map_info *_map, map_word val, unsigned long ofs)
+{
+	struct map_pci_info *map = (struct map_pci_info *)_map;
+//	printk("write32: %08lx <= %08x\n", ofs, val.x[0]);
+	writel(val.x[0], map->base + map->translate(map, ofs));
+}
+
+static void mtd_pci_copyto(struct map_info *_map, unsigned long to, const void *from, ssize_t len)
+{
+	struct map_pci_info *map = (struct map_pci_info *)_map;
+	memcpy_toio(map->base + map->translate(map, to), from, len);
+}
+
+static struct map_info mtd_pci_map = {
+	.phys =		NO_XIP,
+	.copy_from =	mtd_pci_copyfrom,
+	.copy_to =	mtd_pci_copyto,
+};
+
 /*
  * Intel IOP80310 Flash driver
  */
@@ -48,7 +116,10 @@ intel_iq80310_init(struct pci_dev *dev, struct map_pci_info *map)
 {
 	u32 win_base;
 
-	map->map.buswidth = 1;
+	map->map.bankwidth = 1;
+	map->map.read = mtd_pci_read8,
+	map->map.write = mtd_pci_write8,
+
 	map->map.size     = 0x00800000;
 	map->base         = ioremap_nocache(pci_resource_start(dev, 0),
 					    pci_resource_len(dev, 0));
@@ -147,7 +218,9 @@ intel_dc21285_init(struct pci_dev *dev, struct map_pci_info *map)
 	if (!len || !base)
 		return -ENXIO;
 
-	map->map.buswidth = 4;
+	map->map.bankwidth = 4;
+	map->map.read = mtd_pci_read32,
+	map->map.write = mtd_pci_write32,
 	map->map.size     = len;
 	map->base         = ioremap_nocache(base, len);
 
@@ -215,75 +288,6 @@ static struct pci_device_id mtd_pci_ids[] = {
  * Generic code follows.
  */
 
-static u8 mtd_pci_read8(struct map_info *_map, unsigned long ofs)
-{
-	struct map_pci_info *map = (struct map_pci_info *)_map;
-	u8 val = readb(map->base + map->translate(map, ofs));
-//	printk("read8 : %08lx => %02x\n", ofs, val);
-	return val;
-}
-
-static u16 mtd_pci_read16(struct map_info *_map, unsigned long ofs)
-{
-	struct map_pci_info *map = (struct map_pci_info *)_map;
-	u16 val = readw(map->base + map->translate(map, ofs));
-//	printk("read16: %08lx => %04x\n", ofs, val);
-	return val;
-}
-
-static u32 mtd_pci_read32(struct map_info *_map, unsigned long ofs)
-{
-	struct map_pci_info *map = (struct map_pci_info *)_map;
-	u32 val = readl(map->base + map->translate(map, ofs));
-//	printk("read32: %08lx => %08x\n", ofs, val);
-	return val;
-}
-
-static void mtd_pci_copyfrom(struct map_info *_map, void *to, unsigned long from, ssize_t len)
-{
-	struct map_pci_info *map = (struct map_pci_info *)_map;
-	memcpy_fromio(to, map->base + map->translate(map, from), len);
-}
-
-static void mtd_pci_write8(struct map_info *_map, u8 val, unsigned long ofs)
-{
-	struct map_pci_info *map = (struct map_pci_info *)_map;
-//	printk("write8 : %08lx <= %02x\n", ofs, val);
-	writeb(val, map->base + map->translate(map, ofs));
-}
-
-static void mtd_pci_write16(struct map_info *_map, u16 val, unsigned long ofs)
-{
-	struct map_pci_info *map = (struct map_pci_info *)_map;
-//	printk("write16: %08lx <= %04x\n", ofs, val);
-	writew(val, map->base + map->translate(map, ofs));
-}
-
-static void mtd_pci_write32(struct map_info *_map, u32 val, unsigned long ofs)
-{
-	struct map_pci_info *map = (struct map_pci_info *)_map;
-//	printk("write32: %08lx <= %08x\n", ofs, val);
-	writel(val, map->base + map->translate(map, ofs));
-}
-
-static void mtd_pci_copyto(struct map_info *_map, unsigned long to, const void *from, ssize_t len)
-{
-	struct map_pci_info *map = (struct map_pci_info *)_map;
-	memcpy_toio(map->base + map->translate(map, to), from, len);
-}
-
-static struct map_info mtd_pci_map = {
-	.phys =		NO_XIP,
-	.read8 =	mtd_pci_read8,
-	.read16 =	mtd_pci_read16,
-	.read32 =	mtd_pci_read32,
-	.copy_from =	mtd_pci_copyfrom,
-	.write8 =	mtd_pci_write8,
-	.write16 =	mtd_pci_write16,
-	.write32 =	mtd_pci_write32,
-	.copy_to =	mtd_pci_copyto,
-};
-
 static int __devinit
 mtd_pci_probe(struct pci_dev *dev, const struct pci_device_id *id)
 {
diff --git a/drivers/mtd/maps/pcmciamtd.c b/drivers/mtd/maps/pcmciamtd.c
index 4453a2707..ec63e3b6f 100644
--- a/drivers/mtd/maps/pcmciamtd.c
+++ b/drivers/mtd/maps/pcmciamtd.c
@@ -1,5 +1,5 @@
 /*
- * $Id: pcmciamtd.c,v 1.48 2003/06/24 07:14:38 spse Exp $
+ * $Id: pcmciamtd.c,v 1.51 2004/07/12 22:38:29 dwmw2 Exp $
  *
  * pcmciamtd.c - MTD driver for PCMCIA flash memory cards
  *
@@ -49,7 +49,7 @@ static const int debug = 0;
 
 
 #define DRIVER_DESC	"PCMCIA Flash memory card driver"
-#define DRIVER_VERSION	"$Revision: 1.48 $"
+#define DRIVER_VERSION	"$Revision: 1.51 $"
 
 /* Size of the PCMCIA address space: 26 bits = 64 MB */
 #define MAX_PCMCIA_ADDR	0x4000000
@@ -73,7 +73,7 @@ static dev_link_t *dev_list;
 /* Module parameters */
 
 /* 2 = do 16-bit transfers, 1 = do 8-bit transfers */
-static int buswidth = 2;
+static int bankwidth = 2;
 
 /* Speed of memory accesses, in ns */
 static int mem_speed;
@@ -93,8 +93,8 @@ static int mem_type;
 MODULE_LICENSE("GPL");
 MODULE_AUTHOR("Simon Evans <spse@secret.org.uk>");
 MODULE_DESCRIPTION(DRIVER_DESC);
-MODULE_PARM(buswidth, "i");
-MODULE_PARM_DESC(buswidth, "Set buswidth (1=8 bit, 2=16 bit, default=2)");
+MODULE_PARM(bankwidth, "i");
+MODULE_PARM_DESC(bankwidth, "Set bankwidth (1=8 bit, 2=16 bit, default=2)");
 MODULE_PARM(mem_speed, "i");
 MODULE_PARM_DESC(mem_speed, "Set memory access speed in ns");
 MODULE_PARM(force_size, "i");
@@ -135,32 +135,32 @@ static caddr_t remap_window(struct map_info *map, unsigned long to)
 }
 
 
-static u8 pcmcia_read8_remap(struct map_info *map, unsigned long ofs)
+static map_word pcmcia_read8_remap(struct map_info *map, unsigned long ofs)
 {
 	caddr_t addr;
-	u8 d;
+	map_word d = {{0}};
 
 	addr = remap_window(map, ofs);
 	if(!addr)
-		return 0;
+		return d;
 
-	d = readb(addr);
-	DEBUG(3, "ofs = 0x%08lx (%p) data = 0x%02x", ofs, addr, d);
+	d.x[0] = readb(addr);
+	DEBUG(3, "ofs = 0x%08lx (%p) data = 0x%02x", ofs, addr, d.x[0]);
 	return d;
 }
 
 
-static u16 pcmcia_read16_remap(struct map_info *map, unsigned long ofs)
+static map_word pcmcia_read16_remap(struct map_info *map, unsigned long ofs)
 {
 	caddr_t addr;
-	u16 d;
+	map_word d = {{0}};
 
 	addr = remap_window(map, ofs);
 	if(!addr)
-		return 0;
+		return d;
 
-	d = readw(addr);
-	DEBUG(3, "ofs = 0x%08lx (%p) data = 0x%04x", ofs, addr, d);
+	d.x[0] = readw(addr);
+	DEBUG(3, "ofs = 0x%08lx (%p) data = 0x%04x", ofs, addr, d.x[0]);
 	return d;
 }
 
@@ -191,26 +191,26 @@ static void pcmcia_copy_from_remap(struct map_info *map, void *to, unsigned long
 }
 
 
-static void pcmcia_write8_remap(struct map_info *map, u8 d, unsigned long adr)
+static void pcmcia_write8_remap(struct map_info *map, map_word d, unsigned long adr)
 {
 	caddr_t addr = remap_window(map, adr);
 
 	if(!addr)
 		return;
 
-	DEBUG(3, "adr = 0x%08lx (%p)  data = 0x%02x", adr, addr, d);
-	writeb(d, addr);
+	DEBUG(3, "adr = 0x%08lx (%p)  data = 0x%02x", adr, addr, d.x[0]);
+	writeb(d.x[0], addr);
 }
 
 
-static void pcmcia_write16_remap(struct map_info *map, u16 d, unsigned long adr)
+static void pcmcia_write16_remap(struct map_info *map, map_word d, unsigned long adr)
 {
 	caddr_t addr = remap_window(map, adr);
 	if(!addr)
 		return;
 
-	DEBUG(3, "adr = 0x%08lx (%p)  data = 0x%04x", adr, addr, d);
-	writew(d, addr);
+	DEBUG(3, "adr = 0x%08lx (%p)  data = 0x%04x", adr, addr, d.x[0]);
+	writew(d.x[0], addr);
 }
 
 
@@ -244,30 +244,30 @@ static void pcmcia_copy_to_remap(struct map_info *map, unsigned long to, const v
 
 #define DEV_REMOVED(x)  (!(*(u_int *)x->map_priv_1 & DEV_PRESENT))
 
-static u8 pcmcia_read8(struct map_info *map, unsigned long ofs)
+static map_word pcmcia_read8(struct map_info *map, unsigned long ofs)
 {
 	caddr_t win_base = (caddr_t)map->map_priv_2;
-	u8 d;
+	map_word d = {{0}};
 
 	if(DEV_REMOVED(map))
-		return 0;
+		return d;
 
-	d = readb(win_base + ofs);
-	DEBUG(3, "ofs = 0x%08lx (%p) data = 0x%02x", ofs, win_base + ofs, d);
+	d.x[0] = readb(win_base + ofs);
+	DEBUG(3, "ofs = 0x%08lx (%p) data = 0x%02x", ofs, win_base + ofs, d.x[0]);
 	return d;
 }
 
 
-static u16 pcmcia_read16(struct map_info *map, unsigned long ofs)
+static map_word pcmcia_read16(struct map_info *map, unsigned long ofs)
 {
 	caddr_t win_base = (caddr_t)map->map_priv_2;
-	u16 d;
+	map_word d = {{0}};
 
 	if(DEV_REMOVED(map))
-		return 0;
+		return d;
 
-	d = readw(win_base + ofs);
-	DEBUG(3, "ofs = 0x%08lx (%p) data = 0x%04x", ofs, win_base + ofs, d);
+	d.x[0] = readw(win_base + ofs);
+	DEBUG(3, "ofs = 0x%08lx (%p) data = 0x%04x", ofs, win_base + ofs, d.x[0]);
 	return d;
 }
 
@@ -439,9 +439,9 @@ static void card_settings(struct pcmciamtd_dev *dev, dev_link_t *link, int *new_
 		case CISTPL_DEVICE_GEO: {
 			cistpl_device_geo_t *t = &parse.device_geo;
 			int i;
-			dev->pcmcia_map.buswidth = t->geo[0].buswidth;
+			dev->pcmcia_map.bankwidth = t->geo[0].buswidth;
 			for(i = 0; i < t->ngeo; i++) {
-				DEBUG(2, "region: %d buswidth = %u", i, t->geo[i].buswidth);
+				DEBUG(2, "region: %d bankwidth = %u", i, t->geo[i].buswidth);
 				DEBUG(2, "region: %d erase_block = %u", i, t->geo[i].erase_block);
 				DEBUG(2, "region: %d read_block = %u", i, t->geo[i].read_block);
 				DEBUG(2, "region: %d write_block = %u", i, t->geo[i].write_block);
@@ -460,17 +460,17 @@ static void card_settings(struct pcmciamtd_dev *dev, dev_link_t *link, int *new_
 	if(!dev->pcmcia_map.size)
 		dev->pcmcia_map.size = MAX_PCMCIA_ADDR;
 
-	if(!dev->pcmcia_map.buswidth)
-		dev->pcmcia_map.buswidth = 2;
+	if(!dev->pcmcia_map.bankwidth)
+		dev->pcmcia_map.bankwidth = 2;
 
 	if(force_size) {
 		dev->pcmcia_map.size = force_size << 20;
 		DEBUG(2, "size forced to %dM", force_size);
 	}
 
-	if(buswidth) {
-		dev->pcmcia_map.buswidth = buswidth;
-		DEBUG(2, "buswidth forced to %d", buswidth);
+	if(bankwidth) {
+		dev->pcmcia_map.bankwidth = bankwidth;
+		DEBUG(2, "bankwidth forced to %d", bankwidth);
 	}		
 
 	dev->pcmcia_map.name = dev->mtd_name;
@@ -480,7 +480,7 @@ static void card_settings(struct pcmciamtd_dev *dev, dev_link_t *link, int *new_
 	}
 
 	DEBUG(1, "Device: Size: %lu Width:%d Name: %s",
-	      dev->pcmcia_map.size, dev->pcmcia_map.buswidth << 3, dev->mtd_name);
+	      dev->pcmcia_map.size, dev->pcmcia_map.bankwidth << 3, dev->mtd_name);
 }
 
 
@@ -522,12 +522,15 @@ static void pcmciamtd_config(dev_link_t *link)
 	card_settings(dev, link, &new_name);
 
 	dev->pcmcia_map.phys = NO_XIP;
-	dev->pcmcia_map.read8 = pcmcia_read8_remap;
-	dev->pcmcia_map.read16 = pcmcia_read16_remap;
 	dev->pcmcia_map.copy_from = pcmcia_copy_from_remap;
-	dev->pcmcia_map.write8 = pcmcia_write8_remap;
-	dev->pcmcia_map.write16 = pcmcia_write16_remap;
 	dev->pcmcia_map.copy_to = pcmcia_copy_to_remap;
+	if (dev->pcmcia_map.bankwidth == 1) {
+		dev->pcmcia_map.read = pcmcia_read8_remap;
+		dev->pcmcia_map.write = pcmcia_write8_remap;
+	} else {
+		dev->pcmcia_map.read = pcmcia_read16_remap;
+		dev->pcmcia_map.write = pcmcia_write16_remap;
+	}
 	if(setvpp == 1)
 		dev->pcmcia_map.set_vpp = pcmciamtd_set_vpp;
 
@@ -536,7 +539,7 @@ static void pcmciamtd_config(dev_link_t *link)
 	   whole card - otherwise we try smaller windows until we succeed */
 
 	req.Attributes =  WIN_MEMORY_TYPE_CM | WIN_ENABLE;
-	req.Attributes |= (dev->pcmcia_map.buswidth == 1) ? WIN_DATA_WIDTH_8 : WIN_DATA_WIDTH_16;
+	req.Attributes |= (dev->pcmcia_map.bankwidth == 1) ? WIN_DATA_WIDTH_8 : WIN_DATA_WIDTH_16;
 	req.Base = 0;
 	req.AccessSpeed = mem_speed;
 	link->win = (window_handle_t)link->handle;
@@ -657,11 +660,14 @@ static void pcmciamtd_config(dev_link_t *link)
 		DEBUG(1, "Using non remapping memory functions");
 		dev->pcmcia_map.map_priv_1 = (unsigned long)&(dev->link.state);
 		dev->pcmcia_map.map_priv_2 = (unsigned long)dev->win_base;
-		dev->pcmcia_map.read8 = pcmcia_read8;
-		dev->pcmcia_map.read16 = pcmcia_read16;
+		if (dev->pcmcia_map.bankwidth == 1) {
+			dev->pcmcia_map.read = pcmcia_read8;
+			dev->pcmcia_map.write = pcmcia_write8;
+		} else {
+			dev->pcmcia_map.read = pcmcia_read16;
+			dev->pcmcia_map.write = pcmcia_write16;
+		}
 		dev->pcmcia_map.copy_from = pcmcia_copy_from;
-		dev->pcmcia_map.write8 = pcmcia_write8;
-		dev->pcmcia_map.write16 = pcmcia_write16;
 		dev->pcmcia_map.copy_to = pcmcia_copy_to;
 	}
 
@@ -828,9 +834,9 @@ static int __init init_pcmciamtd(void)
 {
 	info(DRIVER_DESC " " DRIVER_VERSION);
 
-	if(buswidth && buswidth != 1 && buswidth != 2) {
-		info("bad buswidth (%d), using default", buswidth);
-		buswidth = 2;
+	if(bankwidth && bankwidth != 1 && bankwidth != 2) {
+		info("bad bankwidth (%d), using default", bankwidth);
+		bankwidth = 2;
 	}
 	if(force_size && (force_size < 1 || force_size > 64)) {
 		info("bad force_size (%d), using default", force_size);
diff --git a/drivers/mtd/maps/physmap.c b/drivers/mtd/maps/physmap.c
index 5c505fb57..5822ba99c 100644
--- a/drivers/mtd/maps/physmap.c
+++ b/drivers/mtd/maps/physmap.c
@@ -1,7 +1,12 @@
 /*
- * $Id: physmap.c,v 1.29 2003/05/29 09:24:10 dwmw2 Exp $
+ * $Id: physmap.c,v 1.34 2004/07/21 00:16:14 jwboyer Exp $
  *
  * Normal mappings of chips in physical memory
+ *
+ * Copyright (C) 2003 MontaVista Software Inc.
+ * Author: Jun Sun, jsun@mvista.com or jsun@junsun.net
+ *
+ * 031022 - [jsun] add run-time configure and partition setup
  */
 
 #include <linux/module.h>
@@ -15,62 +20,38 @@
 #include <linux/config.h>
 #include <linux/mtd/partitions.h>
 
-#define WINDOW_ADDR CONFIG_MTD_PHYSMAP_START
-#define WINDOW_SIZE CONFIG_MTD_PHYSMAP_LEN
-#define BUSWIDTH CONFIG_MTD_PHYSMAP_BUSWIDTH
-
 static struct mtd_info *mymtd;
 
-
 struct map_info physmap_map = {
-	.name = "Physically mapped flash",
-	.size = WINDOW_SIZE,
-	.buswidth = BUSWIDTH,
-	.phys = WINDOW_ADDR,
+	.name = "phys_mapped_flash",
+	.phys = CONFIG_MTD_PHYSMAP_START,
+	.size = CONFIG_MTD_PHYSMAP_LEN,
+	.bankwidth = CONFIG_MTD_PHYSMAP_BANKWIDTH,
 };
 
 #ifdef CONFIG_MTD_PARTITIONS
 static struct mtd_partition *mtd_parts;
 static int                   mtd_parts_nb;
 
-static struct mtd_partition physmap_partitions[] = {
-#if 0
-/* Put your own partition definitions here */
-	{
-		.name =		"bootROM",
-		.size =		0x80000,
-		.offset =	0,
-		.mask_flags =	MTD_WRITEABLE,  /* force read-only */
-	}, {
-		.name =		"zImage",
-		.size =		0x100000,
-		.offset =	MTDPART_OFS_APPEND,
-		.mask_flags =	MTD_WRITEABLE,  /* force read-only */
-	}, {
-		.name =		"ramdisk.gz",
-		.size =		0x300000,
-		.offset =	MTDPART_OFS_APPEND,
-		.mask_flags =	MTD_WRITEABLE,  /* force read-only */
-	}, {
-		.name =		"User FS",
-		.size =		MTDPART_SIZ_FULL,
-		.offset =	MTDPART_OFS_APPEND,
-	}
-#endif
-};
+static int num_physmap_partitions;
+static struct mtd_partition *physmap_partitions;
 
-#define NUM_PARTITIONS	(sizeof(physmap_partitions)/sizeof(struct mtd_partition))
-const char *part_probes[] = {"cmdlinepart", "RedBoot", NULL};
+static const char *part_probes[] __initdata = {"cmdlinepart", "RedBoot", NULL};
 
+void physmap_set_partitions(struct mtd_partition *parts, int num_parts)
+{
+	physmap_partitions=parts;
+	num_physmap_partitions=num_parts;
+}
 #endif /* CONFIG_MTD_PARTITIONS */
 
-int __init init_physmap(void)
+static int __init init_physmap(void)
 {
-	static const char *rom_probe_types[] = { "cfi_probe", "jedec_probe", "map_rom", 0 };
+	static const char *rom_probe_types[] = { "cfi_probe", "jedec_probe", "map_rom", NULL };
 	const char **type;
 
-       	printk(KERN_NOTICE "physmap flash device: %x at %x\n", WINDOW_SIZE, WINDOW_ADDR);
-	physmap_map.virt = (unsigned long)ioremap(WINDOW_ADDR, WINDOW_SIZE);
+       	printk(KERN_NOTICE "physmap flash device: %lx at %lx\n", physmap_map.size, physmap_map.phys);
+	physmap_map.virt = (unsigned long)ioremap(physmap_map.phys, physmap_map.size);
 
 	if (!physmap_map.virt) {
 		printk("Failed to ioremap\n");
@@ -79,7 +60,7 @@ int __init init_physmap(void)
 
 	simple_map_init(&physmap_map);
 
-	mymtd = 0;
+	mymtd = NULL;
 	type = rom_probe_types;
 	for(; !mymtd && *type; type++) {
 		mymtd = do_map_probe(*type, &physmap_map);
@@ -97,11 +78,11 @@ int __init init_physmap(void)
 			return 0;
 		}
 
-		if (NUM_PARTITIONS != 0) 
+		if (num_physmap_partitions != 0) 
 		{
 			printk(KERN_NOTICE 
 			       "Using physmap partition definition\n");
-			add_mtd_partitions (mymtd, physmap_partitions, NUM_PARTITIONS);
+			add_mtd_partitions (mymtd, physmap_partitions, num_physmap_partitions);
 			return 0;
 		}
 
@@ -121,7 +102,7 @@ static void __exit cleanup_physmap(void)
 	if (mtd_parts_nb) {
 		del_mtd_partitions(mymtd);
 		kfree(mtd_parts);
-	} else if (NUM_PARTITIONS) {
+	} else if (num_physmap_partitions) {
 		del_mtd_partitions(mymtd);
 	} else {
 		del_mtd_device(mymtd);
diff --git a/drivers/mtd/maps/pnc2000.c b/drivers/mtd/maps/pnc2000.c
index dcf68f2aa..b204786d5 100644
--- a/drivers/mtd/maps/pnc2000.c
+++ b/drivers/mtd/maps/pnc2000.c
@@ -5,7 +5,7 @@
  *
  * This code is GPL
  *
- * $Id: pnc2000.c,v 1.14 2003/05/21 12:45:19 dwmw2 Exp $
+ * $Id: pnc2000.c,v 1.15 2004/07/12 21:59:44 dwmw2 Exp $
  */
 
 #include <linux/module.h>
@@ -29,7 +29,7 @@
 struct map_info pnc_map = {
 	.name = "PNC-2000",
 	.size = WINDOW_SIZE,
-	.buswidth = 4,
+	.bankwidth = 4,
 	.phys = 0xFFFFFFFF,
 	.virt = WINDOW_ADDR,
 };
diff --git a/drivers/mtd/maps/redwood.c b/drivers/mtd/maps/redwood.c
index 4ece1c883..acc3af90a 100644
--- a/drivers/mtd/maps/redwood.c
+++ b/drivers/mtd/maps/redwood.c
@@ -1,14 +1,13 @@
 /*
- * $Id: redwood.c,v 1.6 2003/05/21 12:45:19 dwmw2 Exp $
+ * $Id: redwood.c,v 1.8 2004/07/12 21:59:44 dwmw2 Exp $
  *
  * drivers/mtd/maps/redwood.c
  *
  * FLASH map for the IBM Redwood 4/5/6 boards.
  *
+ * Author: MontaVista Software, Inc. <source@mvista.com>
  *
- * Author: Armin Kuster <akuster@mvista.com>
- *
- * 2001-2002 (c) MontaVista, Software, Inc. This file is licensed under
+ * 2001-2003 (c) MontaVista, Software, Inc. This file is licensed under
  * the terms of the GNU General Public License version 2. This program
  * is licensed "as is" without any warranty of any kind, whether express
  * or implied.
@@ -89,7 +88,7 @@ static struct mtd_partition redwood_flash_partitions[] = {
 
 static struct mtd_partition redwood_flash_partitions[] = {
 	{
-		.name = "Redwood kernel",
+		.name = "Redwood filesystem",
 		.offset = RW_PART0_OF,
 		.size = RW_PART0_SZ
 	},
@@ -100,7 +99,7 @@ static struct mtd_partition redwood_flash_partitions[] = {
 		.mask_flags = MTD_WRITEABLE	/* force read-only */
 	},
 	{
-		.name = "Redwood filesystem",
+		.name = "Redwood kernel",
 		.offset = RW_PART2_OF,
 		.size = RW_PART2_SZ
 	},
@@ -117,7 +116,7 @@ static struct mtd_partition redwood_flash_partitions[] = {
 struct map_info redwood_flash_map = {
 	.name = "IBM Redwood",
 	.size = WINDOW_SIZE,
-	.buswidth = 2,
+	.bankwidth = 2,
 	.phys = WINDOW_ADDR,
 };
 
@@ -167,5 +166,5 @@ module_init(init_redwood_flash);
 module_exit(cleanup_redwood_flash);
 
 MODULE_LICENSE("GPL");
-MODULE_AUTHOR("Armin Kuster <akuster@mvista.com>");
+MODULE_AUTHOR("MontaVista Software <source@mvista.com>");
 MODULE_DESCRIPTION("MTD map driver for the IBM Redwood reference boards");
diff --git a/drivers/mtd/maps/rpxlite.c b/drivers/mtd/maps/rpxlite.c
index 9c3e7da44..837089a8f 100644
--- a/drivers/mtd/maps/rpxlite.c
+++ b/drivers/mtd/maps/rpxlite.c
@@ -1,5 +1,5 @@
 /*
- * $Id: rpxlite.c,v 1.19 2003/05/21 12:45:19 dwmw2 Exp $
+ * $Id: rpxlite.c,v 1.20 2004/07/12 21:59:44 dwmw2 Exp $
  *
  * Handle mapping of the flash on the RPX Lite and CLLF boards
  */
@@ -21,7 +21,7 @@ static struct mtd_info *mymtd;
 static struct map_info rpxlite_map = {
 	.name = "RPX",
 	.size = WINDOW_SIZE,
-	.buswidth = 4,
+	.bankwidth = 4,
 	.phys = WINDOW_ADDR,
 };
 
diff --git a/drivers/mtd/maps/sa1100-flash.c b/drivers/mtd/maps/sa1100-flash.c
index 3ffedfa6a..c42ca6f96 100644
--- a/drivers/mtd/maps/sa1100-flash.c
+++ b/drivers/mtd/maps/sa1100-flash.c
@@ -3,7 +3,7 @@
  * 
  * (C) 2000 Nicolas Pitre <nico@cam.org>
  * 
- * $Id: sa1100-flash.c,v 1.36 2003/05/29 08:59:35 dwmw2 Exp $
+ * $Id: sa1100-flash.c,v 1.39 2004/07/12 21:59:44 dwmw2 Exp $
  */
 
 #include <linux/config.h>
@@ -935,7 +935,7 @@ static int __init sa1100_setup_mtd(struct sa_info *sa, int nr, struct mtd_info *
 		sa[i].map->virt = (unsigned long)sa[i].vbase;
 		sa[i].map->phys = sa[i].base;
 		sa[i].map->set_vpp = sa[i].set_vpp;
-		sa[i].map->buswidth = sa[i].width;
+		sa[i].map->bankwidth = sa[i].width;
 		sa[i].map->size = sa[i].size;
 
 		simple_map_init(sa[i].map);
@@ -1066,7 +1066,7 @@ static void __init sa1100_probe_one_cs(unsigned int msc, unsigned long phys)
 		return;
 	}
 
-	sa1100_probe_map.buswidth = msc & MSC_RBW ? 2 : 4;
+	sa1100_probe_map.bankwidth = msc & MSC_RBW ? 2 : 4;
 	sa1100_probe_map.size = SZ_1M;
 	sa1100_probe_map.phys = phys;
 	sa1100_probe_map.virt = (unsigned long)ioremap(phys, SZ_1M);
@@ -1253,7 +1253,7 @@ static int __init sa1100_locate_flash(void)
 		return nr;
 
 	/*
-	 * Retrieve the buswidth from the MSC registers.
+	 * Retrieve the bankwidth from the MSC registers.
 	 * We currently only implement CS0 and CS1 here.
 	 */
 	for (i = 0; i < nr; i++) {
diff --git a/drivers/mtd/maps/sbc_gxx.c b/drivers/mtd/maps/sbc_gxx.c
index 4a1477f12..7a9cb1d45 100644
--- a/drivers/mtd/maps/sbc_gxx.c
+++ b/drivers/mtd/maps/sbc_gxx.c
@@ -17,7 +17,7 @@
    along with this program; if not, write to the Free Software
    Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA
 
-   $Id: sbc_gxx.c,v 1.26 2003/05/26 08:50:36 dwmw2 Exp $
+   $Id: sbc_gxx.c,v 1.29 2004/07/12 22:38:29 dwmw2 Exp $
 
 The SBC-MediaGX / SBC-GXx has up to 16 MiB of 
 Intel StrataFlash (28F320/28F640) in x8 mode.  
@@ -114,32 +114,12 @@ static inline void sbc_gxx_page(struct map_info *map, unsigned long ofs)
 }
 
 
-static __u8 sbc_gxx_read8(struct map_info *map, unsigned long ofs)
+static map_word sbc_gxx_read8(struct map_info *map, unsigned long ofs)
 {
-	__u8 ret;
+	map_word ret;
 	spin_lock(&sbc_gxx_spin);
 	sbc_gxx_page(map, ofs);
-	ret = readb(iomapadr + (ofs & WINDOW_MASK));
-	spin_unlock(&sbc_gxx_spin);
-	return ret;
-}
-
-static __u16 sbc_gxx_read16(struct map_info *map, unsigned long ofs)
-{
-	__u16 ret;
-	spin_lock(&sbc_gxx_spin);
-	sbc_gxx_page(map, ofs);
-	ret = readw(iomapadr + (ofs & WINDOW_MASK));
-	spin_unlock(&sbc_gxx_spin);
-	return ret;
-}
-
-static __u32 sbc_gxx_read32(struct map_info *map, unsigned long ofs)
-{
-	__u32 ret;
-	spin_lock(&sbc_gxx_spin);
-	sbc_gxx_page(map, ofs);
-	ret = readl(iomapadr + (ofs & WINDOW_MASK));
+	ret.x[0] = readb(iomapadr + (ofs & WINDOW_MASK));
 	spin_unlock(&sbc_gxx_spin);
 	return ret;
 }
@@ -161,27 +141,11 @@ static void sbc_gxx_copy_from(struct map_info *map, void *to, unsigned long from
 	}
 }
 
-static void sbc_gxx_write8(struct map_info *map, __u8 d, unsigned long adr)
-{
-	spin_lock(&sbc_gxx_spin);
-	sbc_gxx_page(map, adr);
-	writeb(d, iomapadr + (adr & WINDOW_MASK));
-	spin_unlock(&sbc_gxx_spin);
-}
-
-static void sbc_gxx_write16(struct map_info *map, __u16 d, unsigned long adr)
-{
-	spin_lock(&sbc_gxx_spin);
-	sbc_gxx_page(map, adr);
-	writew(d, iomapadr + (adr & WINDOW_MASK));
-	spin_unlock(&sbc_gxx_spin);
-}
-
-static void sbc_gxx_write32(struct map_info *map, __u32 d, unsigned long adr)
+static void sbc_gxx_write8(struct map_info *map, map_word d, unsigned long adr)
 {
 	spin_lock(&sbc_gxx_spin);
 	sbc_gxx_page(map, adr);
-	writel(d, iomapadr + (adr & WINDOW_MASK));
+	writeb(d.x[0], iomapadr + (adr & WINDOW_MASK));
 	spin_unlock(&sbc_gxx_spin);
 }
 
@@ -208,14 +172,10 @@ static struct map_info sbc_gxx_map = {
 	.size = MAX_SIZE_KiB*1024, /* this must be set to a maximum possible amount
 			 of flash so the cfi probe routines find all
 			 the chips */
-	.buswidth = 1,
-	.read8 = sbc_gxx_read8,
-	.read16 = sbc_gxx_read16,
-	.read32 = sbc_gxx_read32,
+	.bankwidth = 1,
+	.read = sbc_gxx_read8,
 	.copy_from = sbc_gxx_copy_from,
-	.write8 = sbc_gxx_write8,
-	.write16 = sbc_gxx_write16,
-	.write32 = sbc_gxx_write32,
+	.write = sbc_gxx_write8,
 	.copy_to = sbc_gxx_copy_to
 };
 
diff --git a/drivers/mtd/maps/sc520cdp.c b/drivers/mtd/maps/sc520cdp.c
index d446d55ed..8269b6029 100644
--- a/drivers/mtd/maps/sc520cdp.c
+++ b/drivers/mtd/maps/sc520cdp.c
@@ -16,7 +16,7 @@
  * along with this program; if not, write to the Free Software
  * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA
  *
- * $Id: sc520cdp.c,v 1.15 2003/05/21 12:45:20 dwmw2 Exp $
+ * $Id: sc520cdp.c,v 1.16 2004/07/12 21:59:45 dwmw2 Exp $
  *
  *
  * The SC520CDP is an evaluation board for the Elan SC520 processor available
@@ -90,19 +90,19 @@ static struct map_info sc520cdp_map[] = {
 	{
 		.name = "SC520CDP Flash Bank #0",
 		.size = WINDOW_SIZE_0,
-		.buswidth = 4,
+		.bankwidth = 4,
 		.phys = WINDOW_ADDR_0
 	},
 	{
 		.name = "SC520CDP Flash Bank #1",
 		.size = WINDOW_SIZE_1,
-		.buswidth = 4,
+		.bankwidth = 4,
 		.phys = WINDOW_ADDR_1
 	},
 	{
 		.name = "SC520CDP DIL Flash",
 		.size = WINDOW_SIZE_2,
-		.buswidth = 1,
+		.bankwidth = 1,
 		.phys = WINDOW_ADDR_2
 	},
 };
diff --git a/drivers/mtd/maps/scb2_flash.c b/drivers/mtd/maps/scb2_flash.c
index d6d175f49..ff2328dbb 100644
--- a/drivers/mtd/maps/scb2_flash.c
+++ b/drivers/mtd/maps/scb2_flash.c
@@ -1,6 +1,6 @@
 /*
  * MTD map driver for BIOS Flash on Intel SCB2 boards
- * $Id: scb2_flash.c,v 1.6 2003/05/21 12:45:20 dwmw2 Exp $
+ * $Id: scb2_flash.c,v 1.8 2004/07/12 21:59:45 dwmw2 Exp $
  * Copyright (C) 2002 Sun Microsystems, Inc.
  * Tim Hockin <thockin@sun.com>
  *
@@ -67,7 +67,7 @@ static struct mtd_info *scb2_mtd;
 struct map_info scb2_map = {
 	.name =      "SCB2 BIOS Flash",
 	.size =      0,
-	.buswidth =  1,
+	.bankwidth =  1,
 };
 static int region_fail;
 
diff --git a/drivers/mtd/maps/scx200_docflash.c b/drivers/mtd/maps/scx200_docflash.c
index c909f4bda..58855a15e 100644
--- a/drivers/mtd/maps/scx200_docflash.c
+++ b/drivers/mtd/maps/scx200_docflash.c
@@ -2,7 +2,7 @@
 
    Copyright (c) 2001,2002 Christer Weinigel <wingel@nano-system.com>
 
-   $Id: scx200_docflash.c,v 1.5 2003/05/21 12:45:20 dwmw2 Exp $ 
+   $Id: scx200_docflash.c,v 1.6 2004/07/12 21:59:45 dwmw2 Exp $ 
 
    National Semiconductor SCx200 flash mapped with DOCCS
 */
@@ -173,9 +173,9 @@ int __init init_scx200_docflash(void)
 
 	scx200_docflash_map.size = size;
 	if (width == 8)
-		scx200_docflash_map.buswidth = 1;
+		scx200_docflash_map.bankwidth = 1;
 	else
-		scx200_docflash_map.buswidth = 2;
+		scx200_docflash_map.bankwidth = 2;
 
 	simple_map_init(&scx200_docflash_map);
 
diff --git a/drivers/mtd/maps/solutionengine.c b/drivers/mtd/maps/solutionengine.c
index ea2b7af95..9b2eebe1b 100644
--- a/drivers/mtd/maps/solutionengine.c
+++ b/drivers/mtd/maps/solutionengine.c
@@ -1,5 +1,5 @@
 /*
- * $Id: solutionengine.c,v 1.10 2003/05/21 12:45:20 dwmw2 Exp $
+ * $Id: solutionengine.c,v 1.13 2004/07/12 21:59:45 dwmw2 Exp $
  *
  * Flash and EPROM on Hitachi Solution Engine and similar boards.
  *
@@ -17,7 +17,7 @@
 #include <linux/mtd/map.h>
 #include <linux/mtd/partitions.h>
 #include <linux/config.h>
-
+#include <linux/errno.h>
 
 static struct mtd_info *flash_mtd;
 static struct mtd_info *eprom_mtd;
@@ -27,13 +27,13 @@ static struct mtd_partition *parsed_parts;
 struct map_info soleng_eprom_map = {
 	.name = "Solution Engine EPROM",
 	.size = 0x400000,
-	.buswidth = 4,
+	.bankwidth = 4,
 };
 
 struct map_info soleng_flash_map = {
 	.name = "Solution Engine FLASH",
 	.size = 0x400000,
-	.buswidth = 4,
+	.bankwidth = 4,
 };
 
 static const char *probes[] = { "RedBoot", "cmdlinepart", NULL };
diff --git a/drivers/mtd/maps/sun_uflash.c b/drivers/mtd/maps/sun_uflash.c
index b676e0554..2a9932c50 100644
--- a/drivers/mtd/maps/sun_uflash.c
+++ b/drivers/mtd/maps/sun_uflash.c
@@ -1,4 +1,4 @@
-/* $Id: sun_uflash.c,v 1.7 2003/05/20 20:59:32 dwmw2 Exp $
+/* $Id: sun_uflash.c,v 1.9 2004/07/12 21:59:45 dwmw2 Exp $
  *
  * sun_uflash - Driver implementation for user-programmable flash
  * present on many Sun Microsystems SME boardsets.
@@ -51,7 +51,7 @@ struct uflash_dev {
 struct map_info uflash_map_templ = {
 		.name =		"SUNW,???-????",
 		.size =		UFLASH_WINDOW_SIZE,
-		.buswidth =	UFLASH_BUSWIDTH,
+		.bankwidth =	UFLASH_BUSWIDTH,
 };
 
 int uflash_devinit(struct linux_ebus_device* edev)
diff --git a/drivers/mtd/maps/tqm8xxl.c b/drivers/mtd/maps/tqm8xxl.c
index 8ba73f107..496c9857f 100644
--- a/drivers/mtd/maps/tqm8xxl.c
+++ b/drivers/mtd/maps/tqm8xxl.c
@@ -2,7 +2,7 @@
  * Handle mapping of the flash memory access routines 
  * on TQM8xxL based devices.
  *
- * $Id: tqm8xxl.c,v 1.9 2003/06/23 11:48:18 dwmw2 Exp $
+ * $Id: tqm8xxl.c,v 1.11 2004/07/12 21:59:45 dwmw2 Exp $
  *
  * based on rpxlite.c
  *
@@ -151,7 +151,7 @@ int __init init_tqm_mtd(void)
 		sprintf(map_banks[idx]->name, "TQM8xxL%d", idx);
 
 		map_banks[idx]->size = flash_size;
-		map_banks[idx]->buswidth = 4;
+		map_banks[idx]->bankwidth = 4;
 
 		simple_map_init(map_banks[idx]);
 
diff --git a/drivers/mtd/maps/tsunami_flash.c b/drivers/mtd/maps/tsunami_flash.c
index d4c9d28e2..170d71239 100644
--- a/drivers/mtd/maps/tsunami_flash.c
+++ b/drivers/mtd/maps/tsunami_flash.c
@@ -2,7 +2,7 @@
  * tsunami_flash.c
  *
  * flash chip on alpha ds10...
- * $Id: tsunami_flash.c,v 1.6 2003/05/21 15:15:08 dwmw2 Exp $
+ * $Id: tsunami_flash.c,v 1.9 2004/07/14 09:52:55 dwmw2 Exp $
  */
 #include <asm/io.h>
 #include <asm/core_tsunami.h>
@@ -15,14 +15,16 @@
 #define FLASH_DISABLE_BYTE 0x00
 
 #define MAX_TIG_FLASH_SIZE (12*1024*1024)
-static inline  __u8 tsunami_flash_read8(struct map_info *map, unsigned long offset)
+static inline map_word tsunami_flash_read8(struct map_info *map, unsigned long offset)
 {
-	return tsunami_tig_readb(offset);
+	map_word val;
+	val.x[0] = tsunami_tig_readb(offset);
+	return val;
 }
 
-static void tsunami_flash_write8(struct map_info *map, __u8 value, unsigned long offset)
+static void tsunami_flash_write8(struct map_info *map, map_word value, unsigned long offset)
 {
-	tsunami_tig_writeb(value, offset);
+	tsunami_tig_writeb(value.x[0], offset);
 }
 
 static void tsunami_flash_copy_from(
@@ -61,10 +63,10 @@ static struct map_info tsunami_flash_map = {
 	.name = "flash chip on the Tsunami TIG bus",
 	.size = MAX_TIG_FLASH_SIZE,
 	.phys = NO_XIP;
-	.buswidth = 1,
-	.read8 = tsunami_flash_read8,
+	.bankwidth = 1,
+	.read = tsunami_flash_read8,
 	.copy_from = tsunami_flash_copy_from,
-	.write8 = tsunami_flash_write8,
+	.write = tsunami_flash_write8,
 	.copy_to = tsunami_flash_copy_to,
 };
 
@@ -84,7 +86,7 @@ static void __exit  cleanup_tsunami_flash(void)
 
 static int __init init_tsunami_flash(void)
 {
-	static const char *rom_probe_types[] = { "cfi_probe", "jedec_probe", "map_rom", 0 };
+	static const char *rom_probe_types[] = { "cfi_probe", "jedec_probe", "map_rom", NULL };
 	char **type;
 
 	tsunami_tig_writeb(FLASH_ENABLE_BYTE, FLASH_ENABLE_PORT);
diff --git a/drivers/mtd/maps/uclinux.c b/drivers/mtd/maps/uclinux.c
index 44d13f561..c5cd70bdb 100644
--- a/drivers/mtd/maps/uclinux.c
+++ b/drivers/mtd/maps/uclinux.c
@@ -5,7 +5,7 @@
  *
  *	(C) Copyright 2002, Greg Ungerer (gerg@snapgear.com)
  *
- * 	$Id: uclinux.c,v 1.5 2003/05/20 20:59:32 dwmw2 Exp $
+ * 	$Id: uclinux.c,v 1.7 2004/07/12 21:59:45 dwmw2 Exp $
  */
 
 /****************************************************************************/
@@ -64,7 +64,7 @@ int __init uclinux_mtd_init(void)
 	mapp = &uclinux_ram_map;
 	mapp->phys = (unsigned long) &_ebss;
 	mapp->size = PAGE_ALIGN(*((unsigned long *)((&_ebss) + 8)));
-	mapp->buswidth = 4;
+	mapp->bankwidth = 4;
 
 	printk("uclinux[mtd]: RAM probe address=0x%x size=0x%x\n",
 	       	(int) mapp->map_priv_2, (int) mapp->size);
diff --git a/drivers/mtd/maps/vmax301.c b/drivers/mtd/maps/vmax301.c
index a649609fd..9cf2629b8 100644
--- a/drivers/mtd/maps/vmax301.c
+++ b/drivers/mtd/maps/vmax301.c
@@ -1,4 +1,4 @@
-// $Id: vmax301.c,v 1.28 2003/05/21 15:15:08 dwmw2 Exp $
+// $Id: vmax301.c,v 1.30 2004/07/12 22:38:29 dwmw2 Exp $
 /* ######################################################################
 
    Tempustech VMAX SBC301 MTD Driver.
@@ -54,32 +54,12 @@ static inline void vmax301_page(struct map_info *map,
 		__vmax301_page(map, page);
 }
 
-static __u8 vmax301_read8(struct map_info *map, unsigned long ofs)
+static map_word vmax301_read8(struct map_info *map, unsigned long ofs)
 {
-	__u8 ret;
+	map_word ret;
 	spin_lock(&vmax301_spin);
 	vmax301_page(map, ofs);
-	ret = readb(map->map_priv_2 + (ofs & WINDOW_MASK));
-	spin_unlock(&vmax301_spin);
-	return ret;
-}
-
-static __u16 vmax301_read16(struct map_info *map, unsigned long ofs)
-{
-	__u16 ret;
-	spin_lock(&vmax301_spin);
-	vmax301_page(map, ofs);
-	ret = readw(map->map_priv_2 + (ofs & WINDOW_MASK));
-	spin_unlock(&vmax301_spin);
-	return ret;
-}
-
-static __u32 vmax301_read32(struct map_info *map, unsigned long ofs)
-{
-	__u32 ret;
-	spin_lock(&vmax301_spin);
-	vmax301_page(map, ofs);
-	ret =  readl(map->map_priv_2 + (ofs & WINDOW_MASK));
+	ret.x[0] = readb(map->map_priv_2 + (ofs & WINDOW_MASK));
 	spin_unlock(&vmax301_spin);
 	return ret;
 }
@@ -100,27 +80,11 @@ static void vmax301_copy_from(struct map_info *map, void *to, unsigned long from
 	}
 }
 
-static void vmax301_write8(struct map_info *map, __u8 d, unsigned long adr)
-{
-	spin_lock(&vmax301_spin);
-	vmax301_page(map, adr);
-	writeb(d, map->map_priv_2 + (adr & WINDOW_MASK));
-	spin_unlock(&vmax301_spin);
-}
-
-static void vmax301_write16(struct map_info *map, __u16 d, unsigned long adr)
-{
-	spin_lock(&vmax301_spin);
-	vmax301_page(map, adr);
-	writew(d, map->map_priv_2 + (adr & WINDOW_MASK));
-	spin_unlock(&vmax301_spin);
-}
-
-static void vmax301_write32(struct map_info *map, __u32 d, unsigned long adr)
+static void vmax301_write8(struct map_info *map, map_word d, unsigned long adr)
 {
 	spin_lock(&vmax301_spin);
 	vmax301_page(map, adr);
-	writel(d, map->map_priv_2 + (adr & WINDOW_MASK));
+	writeb(d.x[0], map->map_priv_2 + (adr & WINDOW_MASK));
 	spin_unlock(&vmax301_spin);
 }
 
@@ -146,14 +110,10 @@ static struct map_info vmax_map[2] = {
 		.name = "VMAX301 Internal Flash",
 		.phys = NO_XIP,
 		.size = 3*2*1024*1024,
-		.buswidth = 1,
-		.read8 = vmax301_read8,
-		.read16 = vmax301_read16,
-		.read32 = vmax301_read32,
+		.bankwidth = 1,
+		.read = vmax301_read8,
 		.copy_from = vmax301_copy_from,
-		.write8 = vmax301_write8,
-		.write16 = vmax301_write16,
-		.write32 = vmax301_write32,
+		.write = vmax301_write8,
 		.copy_to = vmax301_copy_to,
 		.map_priv_1 = WINDOW_START + WINDOW_LENGTH,
 		.map_priv_2 = 0xFFFFFFFF
@@ -162,14 +122,10 @@ static struct map_info vmax_map[2] = {
 		.name = "VMAX301 Socket",
 		.phys = NO_XIP,
 		.size = 0,
-		.buswidth = 1,
-		.read8 = vmax301_read8,
-		.read16 = vmax301_read16,
-		.read32 = vmax301_read32,
+		.bankwidth = 1,
+		.read = vmax301_read8,
 		.copy_from = vmax301_copy_from,
-		.write8 = vmax301_write8,
-		.write16 = vmax301_write16,
-		.write32 = vmax301_write32,
+		.write = vmax301_write8,
 		.copy_to = vmax301_copy_to,
 		.map_priv_1 = WINDOW_START + (3*WINDOW_LENGTH),
 		.map_priv_2 = 0xFFFFFFFF
diff --git a/drivers/mtd/maps/wr_sbc82xx_flash.c b/drivers/mtd/maps/wr_sbc82xx_flash.c
index 1901302d4..b7fdece51 100644
--- a/drivers/mtd/maps/wr_sbc82xx_flash.c
+++ b/drivers/mtd/maps/wr_sbc82xx_flash.c
@@ -1,5 +1,5 @@
 /*
- * $Id: wr_sbc82xx_flash.c,v 1.1 2004/06/07 10:21:32 dwmw2 Exp $
+ * $Id: wr_sbc82xx_flash.c,v 1.5 2004/07/15 14:52:02 dwmw2 Exp $
  *
  * Map for flash chips on Wind River PowerQUICC II SBC82xx board.
  *
@@ -20,7 +20,7 @@
 #include <linux/config.h>
 #include <linux/mtd/partitions.h>
 
-#include <asm/immap_8260.h>
+#include <asm/immap_cpm2.h>
 
 static struct mtd_info *sbcmtd[3];
 static struct mtd_partition *sbcmtd_parts[3];
@@ -46,55 +46,69 @@ static struct mtd_partition smallflash_parts[] = {
 static struct mtd_partition bigflash_parts[] = {
 	{
 		.name =		"bootloader",
-		.size =		0x80000,
+		.size =		0x00100000,
 		.offset =	0,
 	}, {
 		.name =		"file system",
-		.size =		MTDPART_SIZ_FULL,
+		.size =		0x01f00000,
+		.offset =	MTDPART_OFS_APPEND,
+	}, {
+		.name =		"boot config",
+		.size =		0x00100000,
+		.offset =	MTDPART_OFS_APPEND,
+	}, {
+		.name =		"space",
+		.size =		0x01f00000,
 		.offset =	MTDPART_OFS_APPEND,
 	}
 };
 
 static const char *part_probes[] __initdata = {"cmdlinepart", "RedBoot", NULL};
 
+#define init_sbc82xx_one_flash(map, br, or)			\
+do {								\
+	(map).phys = (br & 1) ? (br & 0xffff8000) : 0;		\
+	(map).size = (br & 1) ? (~(or & 0xffff8000) + 1) : 0;	\
+	switch (br & 0x00001800) {				\
+	case 0x00000000:					\
+	case 0x00000800:	(map).bankwidth = 1;	break;	\
+	case 0x00001000:	(map).bankwidth = 2;	break;	\
+	case 0x00001800:	(map).bankwidth = 4;	break;	\
+	}							\
+} while (0);
+
 int __init init_sbc82xx_flash(void)
 {
-	volatile  memctl8260_t *mc = &immr->im_memctl;
+	volatile memctl_cpm2_t *mc = &cpm2_immr->im_memctl;
 	int bigflash;
 	int i;
 
-	/* First, register the boot flash, whichever we're booting from */
-	if ((mc->memc_br0 & 0x00001800) == 0x00001800) {
-		bigflash = 0;
-	} else if ((mc->memc_br0 & 0x00001800) == 0x00000800) {
-		bigflash = 1;
-	} else {
-		printk(KERN_WARNING "Bus Controller register BR0 is %08x. Cannot determine flash configuration\n", mc->memc_br0);
-		return 1;
-	}
+#ifdef CONFIG_SBC8560
+	mc = ioremap(0xff700000 + 0x5000, sizeof(memctl_cpm2_t));
+#else
+	mc = &cpm2_immr->im_memctl;
+#endif
 
-	/* Set parameters for the big flash chip (CS6 or CS0) */
-	sbc82xx_flash_map[bigflash].buswidth = 4;
-	sbc82xx_flash_map[bigflash].size = 0x4000000;
-
-	/* Set parameters for the small flash chip (CS0 or CS6) */
-	sbc82xx_flash_map[!bigflash].buswidth = 1;
-	sbc82xx_flash_map[!bigflash].size = 0x200000;
+	bigflash = 1;
+	if ((mc->memc_br0 & 0x00001800) == 0x00001800)
+		bigflash = 0;
 
-	/* Set parameters for the user flash chip (CS1) */
-	sbc82xx_flash_map[2].buswidth = 4;
-	sbc82xx_flash_map[2].size = 0x4000000;
+	init_sbc82xx_one_flash(sbc82xx_flash_map[0], mc->memc_br0, mc->memc_or0);
+	init_sbc82xx_one_flash(sbc82xx_flash_map[1], mc->memc_br6, mc->memc_or6);
+	init_sbc82xx_one_flash(sbc82xx_flash_map[2], mc->memc_br1, mc->memc_or1);
 
-	sbc82xx_flash_map[0].phys = mc->memc_br0 & 0xffff8000;
-	sbc82xx_flash_map[1].phys = mc->memc_br6 & 0xffff8000;
-	sbc82xx_flash_map[2].phys = mc->memc_br1 & 0xffff8000;
+#ifdef CONFIG_SBC8560
+	iounmap((void *) mc);
+#endif
 
 	for (i=0; i<3; i++) {
 		int8_t flashcs[3] = { 0, 6, 1 };
 		int nr_parts;
 
 		printk(KERN_NOTICE "PowerQUICC II %s (%ld MiB on CS%d",
-		       sbc82xx_flash_map[i].name, sbc82xx_flash_map[i].size >> 20, flashcs[i]);
+		       sbc82xx_flash_map[i].name,
+		       (sbc82xx_flash_map[i].size >> 20),
+		       flashcs[i]);
 		if (!sbc82xx_flash_map[i].phys) {
 			/* We know it can't be at zero. */
 			printk("): disabled by bootloader.\n");
diff --git a/drivers/mtd/mtd_blkdevs.c b/drivers/mtd/mtd_blkdevs.c
index 4a0f2ea7c..b134315ab 100644
--- a/drivers/mtd/mtd_blkdevs.c
+++ b/drivers/mtd/mtd_blkdevs.c
@@ -1,5 +1,5 @@
 /*
- * $Id: mtd_blkdevs.c,v 1.16 2003/06/23 13:34:43 dwmw2 Exp $
+ * $Id: mtd_blkdevs.c,v 1.22 2004/07/12 12:35:28 dwmw2 Exp $
  *
  * (C) 2003 David Woodhouse <dwmw2@infradead.org>
  *
@@ -220,7 +220,7 @@ static int blktrans_ioctl(struct inode *inode, struct file *file,
 				return ret;
 
 			g.start = get_start_sect(inode->i_bdev);
-			if (copy_to_user((void *)arg, &g, sizeof(g)))
+			if (copy_to_user((void __user *)arg, &g, sizeof(g)))
 				return -EFAULT;
 			return 0;
 		} /* else */
@@ -295,7 +295,10 @@ int add_mtd_blktrans_dev(struct mtd_blktrans_dev *new)
 	snprintf(gd->devfs_name, sizeof(gd->devfs_name),
 		 "%s/%c", tr->name, (tr->part_bits?'a':'0') + new->devnum);
 
-	set_capacity(gd, new->size);
+	/* 2.5 has capacity in units of 512 bytes while still
+	   having BLOCK_SIZE_BITS set to 10. Just to keep us amused. */
+	set_capacity(gd, (new->size * new->blksize) >> 9);
+
 	gd->private_data = new;
 	new->blkcore_priv = gd;
 	gd->queue = tr->blkcore_priv->rq;
diff --git a/drivers/mtd/mtdblock.c b/drivers/mtd/mtdblock.c
index 965c5954d..c91d9701e 100644
--- a/drivers/mtd/mtdblock.c
+++ b/drivers/mtd/mtdblock.c
@@ -1,7 +1,7 @@
 /* 
  * Direct MTD block device access
  *
- * $Id: mtdblock.c,v 1.63 2003/06/23 12:00:08 dwmw2 Exp $
+ * $Id: mtdblock.c,v 1.64 2003/10/04 17:14:14 dwmw2 Exp $
  *
  * (C) 2000-2003 Nicolas Pitre <nico@cam.org>
  * (C) 1999-2003 David Woodhouse <dwmw2@infradead.org>
@@ -275,7 +275,7 @@ static int mtdblock_open(struct mtd_blktrans_dev *mbd)
 	
 	/* OK, it's not open. Create cache info for it */
 	mtdblk = kmalloc(sizeof(struct mtdblk_dev), GFP_KERNEL);
-	if (!mtdblks)
+	if (!mtdblk)
 		return -ENOMEM;
 
 	memset(mtdblk, 0, sizeof(*mtdblk));
diff --git a/drivers/mtd/mtdchar.c b/drivers/mtd/mtdchar.c
index 801bcc8f0..3db73d8c2 100644
--- a/drivers/mtd/mtdchar.c
+++ b/drivers/mtd/mtdchar.c
@@ -1,5 +1,5 @@
 /*
- * $Id: mtdchar.c,v 1.54 2003/05/21 10:50:43 dwmw2 Exp $
+ * $Id: mtdchar.c,v 1.64 2004/08/09 13:59:46 dwmw2 Exp $
  *
  * Character-device access to raw MTD devices.
  *
@@ -9,6 +9,7 @@
 #include <linux/kernel.h>
 #include <linux/module.h>
 #include <linux/mtd/mtd.h>
+#include <linux/mtd/compatmac.h>
 #include <linux/slab.h>
 #include <linux/init.h>
 #include <linux/fs.h>
@@ -16,14 +17,46 @@
 
 #ifdef CONFIG_DEVFS_FS
 #include <linux/devfs_fs_kernel.h>
-static void mtd_notify_add(struct mtd_info* mtd);
-static void mtd_notify_remove(struct mtd_info* mtd);
+
+static void mtd_notify_add(struct mtd_info* mtd)
+{
+	if (!mtd)
+		return;
+
+	devfs_mk_cdev(MKDEV(MTD_CHAR_MAJOR, mtd->index*2),
+		      S_IFCHR | S_IRUGO | S_IWUGO, "mtd/%d", mtd->index);
+		
+	devfs_mk_cdev(MKDEV(MTD_CHAR_MAJOR, mtd->index*2+1),
+		      S_IFCHR | S_IRUGO, "mtd/%dro", mtd->index);
+}
+
+static void mtd_notify_remove(struct mtd_info* mtd)
+{
+	if (!mtd)
+		return;
+	devfs_remove("mtd/%d", mtd->index);
+	devfs_remove("mtd/%dro", mtd->index);
+}
 
 static struct mtd_notifier notifier = {
 	.add	= mtd_notify_add,
 	.remove	= mtd_notify_remove,
 };
 
+static inline void mtdchar_devfs_init(void)
+{
+	devfs_mk_dir("mtd");
+	register_mtd_user(&notifier);
+}
+
+static inline void mtdchar_devfs_exit(void)
+{
+	unregister_mtd_user(&notifier);
+	devfs_remove("mtd");
+}
+#else /* !DEVFS */
+#define mtdchar_devfs_init() do { } while(0)
+#define mtdchar_devfs_exit() do { } while(0)
 #endif
 
 static loff_t mtd_lseek (struct file *file, loff_t offset, int orig)
@@ -116,7 +149,7 @@ static int mtd_close(struct inode *inode, struct file *file)
 */
 #define MAX_KMALLOC_SIZE 0x20000
 
-static ssize_t mtd_read(struct file *file, char *buf, size_t count,loff_t *ppos)
+static ssize_t mtd_read(struct file *file, char __user *buf, size_t count,loff_t *ppos)
 {
 	struct mtd_info *mtd = (struct mtd_info *)file->private_data;
 	size_t retlen=0;
@@ -169,7 +202,7 @@ static ssize_t mtd_read(struct file *file, char *buf, size_t count,loff_t *ppos)
 	return total_retlen;
 } /* mtd_read */
 
-static ssize_t mtd_write(struct file *file, const char *buf, size_t count,loff_t *ppos)
+static ssize_t mtd_write(struct file *file, const char __user *buf, size_t count,loff_t *ppos)
 {
 	struct mtd_info *mtd = (struct mtd_info *)file->private_data;
 	char *kbuf;
@@ -229,7 +262,7 @@ static ssize_t mtd_write(struct file *file, const char *buf, size_t count,loff_t
     IOCTL calls for getting device parameters.
 
 ======================================================================*/
-static void mtd_erase_callback (struct erase_info *instr)
+static void mtdchar_erase_callback (struct erase_info *instr)
 {
 	wake_up((wait_queue_head_t *)instr->priv);
 }
@@ -238,6 +271,7 @@ static int mtd_ioctl(struct inode *inode, struct file *file,
 		     u_int cmd, u_long arg)
 {
 	struct mtd_info *mtd = (struct mtd_info *)file->private_data;
+	void __user *argp = (void __user *)arg;
 	int ret = 0;
 	u_long size;
 	
@@ -245,17 +279,17 @@ static int mtd_ioctl(struct inode *inode, struct file *file,
 
 	size = (cmd & IOCSIZE_MASK) >> IOCSIZE_SHIFT;
 	if (cmd & IOC_IN) {
-		ret = verify_area(VERIFY_READ, (char *)arg, size);
+		ret = verify_area(VERIFY_READ, argp, size);
 		if (ret) return ret;
 	}
 	if (cmd & IOC_OUT) {
-		ret = verify_area(VERIFY_WRITE, (char *)arg, size);
+		ret = verify_area(VERIFY_WRITE, argp, size);
 		if (ret) return ret;
 	}
 	
 	switch (cmd) {
 	case MEMGETREGIONCOUNT:
-		if (copy_to_user((int *) arg, &(mtd->numeraseregions), sizeof(int)))
+		if (copy_to_user(argp, &(mtd->numeraseregions), sizeof(int)))
 			return -EFAULT;
 		break;
 
@@ -263,24 +297,19 @@ static int mtd_ioctl(struct inode *inode, struct file *file,
 	{
 		struct region_info_user ur;
 
-		if (copy_from_user(	&ur, 
-					(struct region_info_user *)arg, 
-					sizeof(struct region_info_user))) {
+		if (copy_from_user(&ur, argp, sizeof(struct region_info_user)))
 			return -EFAULT;
-		}
 
 		if (ur.regionindex >= mtd->numeraseregions)
 			return -EINVAL;
-		if (copy_to_user((struct mtd_erase_region_info *) arg, 
-				&(mtd->eraseregions[ur.regionindex]),
+		if (copy_to_user(argp, &(mtd->eraseregions[ur.regionindex]),
 				sizeof(struct mtd_erase_region_info)))
 			return -EFAULT;
 		break;
 	}
 
 	case MEMGETINFO:
-		if (copy_to_user((struct mtd_info *)arg, mtd,
-				 sizeof(struct mtd_info_user)))
+		if (copy_to_user(argp, mtd, sizeof(struct mtd_info_user)))
 			return -EFAULT;
 		break;
 
@@ -301,13 +330,13 @@ static int mtd_ioctl(struct inode *inode, struct file *file,
 			init_waitqueue_head(&waitq);
 
 			memset (erase,0,sizeof(struct erase_info));
-			if (copy_from_user(&erase->addr, (u_long *)arg,
-					   2 * sizeof(u_long))) {
+			if (copy_from_user(&erase->addr, argp,
+				    sizeof(struct erase_info_user))) {
 				kfree(erase);
 				return -EFAULT;
 			}
 			erase->mtd = mtd;
-			erase->callback = mtd_erase_callback;
+			erase->callback = mtdchar_erase_callback;
 			erase->priv = (unsigned long)&waitq;
 			
 			/*
@@ -345,7 +374,7 @@ static int mtd_ioctl(struct inode *inode, struct file *file,
 		if(!(file->f_mode & 2))
 			return -EPERM;
 
-		if (copy_from_user(&buf, (struct mtd_oob_buf *)arg, sizeof(struct mtd_oob_buf)))
+		if (copy_from_user(&buf, argp, sizeof(struct mtd_oob_buf)))
 			return -EFAULT;
 		
 		if (buf.length > 0x4096)
@@ -354,7 +383,7 @@ static int mtd_ioctl(struct inode *inode, struct file *file,
 		if (!mtd->write_oob)
 			ret = -EOPNOTSUPP;
 		else
-			ret = verify_area(VERIFY_READ, (char *)buf.ptr, buf.length);
+			ret = verify_area(VERIFY_READ, buf.ptr, buf.length);
 
 		if (ret)
 			return ret;
@@ -370,7 +399,7 @@ static int mtd_ioctl(struct inode *inode, struct file *file,
 
 		ret = (mtd->write_oob)(mtd, buf.start, buf.length, &retlen, databuf);
 
-		if (copy_to_user((void *)arg + sizeof(u_int32_t), &retlen, sizeof(u_int32_t)))
+		if (copy_to_user(argp + sizeof(uint32_t), &retlen, sizeof(uint32_t)))
 			ret = -EFAULT;
 
 		kfree(databuf);
@@ -384,7 +413,7 @@ static int mtd_ioctl(struct inode *inode, struct file *file,
 		void *databuf;
 		ssize_t retlen;
 
-		if (copy_from_user(&buf, (struct mtd_oob_buf *)arg, sizeof(struct mtd_oob_buf)))
+		if (copy_from_user(&buf, argp, sizeof(struct mtd_oob_buf)))
 			return -EFAULT;
 		
 		if (buf.length > 0x4096)
@@ -393,7 +422,7 @@ static int mtd_ioctl(struct inode *inode, struct file *file,
 		if (!mtd->read_oob)
 			ret = -EOPNOTSUPP;
 		else
-			ret = verify_area(VERIFY_WRITE, (char *)buf.ptr, buf.length);
+			ret = verify_area(VERIFY_WRITE, buf.ptr, buf.length);
 
 		if (ret)
 			return ret;
@@ -404,7 +433,7 @@ static int mtd_ioctl(struct inode *inode, struct file *file,
 		
 		ret = (mtd->read_oob)(mtd, buf.start, buf.length, &retlen, databuf);
 
-		if (copy_to_user((void *)arg + sizeof(u_int32_t), &retlen, sizeof(u_int32_t)))
+		if (put_user(retlen, (uint32_t __user *)argp))
 			ret = -EFAULT;
 		else if (retlen && copy_to_user(buf.ptr, databuf, retlen))
 			ret = -EFAULT;
@@ -415,41 +444,73 @@ static int mtd_ioctl(struct inode *inode, struct file *file,
 
 	case MEMLOCK:
 	{
-		unsigned long adrs[2];
+		struct erase_info_user info;
 
-		if (copy_from_user(adrs ,(void *)arg, 2* sizeof(unsigned long)))
+		if (copy_from_user(&info, argp, sizeof(info)))
 			return -EFAULT;
 
 		if (!mtd->lock)
 			ret = -EOPNOTSUPP;
 		else
-			ret = mtd->lock(mtd, adrs[0], adrs[1]);
+			ret = mtd->lock(mtd, info.start, info.length);
 		break;
 	}
 
 	case MEMUNLOCK:
 	{
-		unsigned long adrs[2];
+		struct erase_info_user info;
 
-		if (copy_from_user(adrs, (void *)arg, 2* sizeof(unsigned long)))
+		if (copy_from_user(&info, argp, sizeof(info)))
 			return -EFAULT;
 
 		if (!mtd->unlock)
 			ret = -EOPNOTSUPP;
 		else
-			ret = mtd->unlock(mtd, adrs[0], adrs[1]);
+			ret = mtd->unlock(mtd, info.start, info.length);
 		break;
 	}
 
 	case MEMSETOOBSEL:
 	{
-		if (copy_from_user(&mtd->oobinfo ,(void *)arg, sizeof(struct nand_oobinfo)))
+		if (copy_from_user(&mtd->oobinfo, argp, sizeof(struct nand_oobinfo)))
 			return -EFAULT;
 		break;
 	}
+
+	case MEMGETOOBSEL:
+	{
+		if (copy_to_user(argp, &(mtd->oobinfo), sizeof(struct nand_oobinfo)))
+			return -EFAULT;
+		break;
+	}
+
+	case MEMGETBADBLOCK:
+	{
+		loff_t offs;
 		
+		if (copy_from_user(&offs, argp, sizeof(loff_t)))
+			return -EFAULT;
+		if (!mtd->block_isbad)
+			ret = -EOPNOTSUPP;
+		else
+			return mtd->block_isbad(mtd, offs);
+		break;
+	}
+
+	case MEMSETBADBLOCK:
+	{
+		loff_t offs;
+
+		if (copy_from_user(&offs, argp, sizeof(loff_t)))
+			return -EFAULT;
+		if (!mtd->block_markbad)
+			ret = -EOPNOTSUPP;
+		else
+			return mtd->block_markbad(mtd, offs);
+		break;
+	}
+
 	default:
-		DEBUG(MTD_DEBUG_LEVEL0, "Invalid ioctl %x (MEMGETINFO = %x)\n", cmd, MEMGETINFO);
 		ret = -ENOTTY;
 	}
 
@@ -466,30 +527,6 @@ static struct file_operations mtd_fops = {
 	.release	= mtd_close,
 };
 
-
-#ifdef CONFIG_DEVFS_FS
-/* Notification that a new device has been added. Create the devfs entry for
- * it. */
-
-static void mtd_notify_add(struct mtd_info* mtd)
-{
-	if (!mtd)
-		return;
-	devfs_mk_cdev(MKDEV(MTD_CHAR_MAJOR, mtd->index*2),
-			S_IFCHR | S_IRUGO | S_IWUGO, "mtd/%d", mtd->index);
-	devfs_mk_cdev(MKDEV(MTD_CHAR_MAJOR, mtd->index*2+1),
-			S_IFCHR | S_IRUGO | S_IWUGO, "mtd/%dro", mtd->index);
-}
-
-static void mtd_notify_remove(struct mtd_info* mtd)
-{
-	if (!mtd)
-		return;
-	devfs_remove("mtd/%d", mtd->index);
-	devfs_remove("mtd/%dro", mtd->index);
-}
-#endif
-
 static int __init init_mtdchar(void)
 {
 	if (register_chrdev(MTD_CHAR_MAJOR, "mtd", &mtd_fops)) {
@@ -498,20 +535,13 @@ static int __init init_mtdchar(void)
 		return -EAGAIN;
 	}
 
-#ifdef CONFIG_DEVFS_FS
-	devfs_mk_dir("mtd");
-
-	register_mtd_user(&notifier);
-#endif
+	mtdchar_devfs_init();
 	return 0;
 }
 
 static void __exit cleanup_mtdchar(void)
 {
-#ifdef CONFIG_DEVFS_FS
-	unregister_mtd_user(&notifier);
-	devfs_remove("mtd");
-#endif
+	mtdchar_devfs_exit();
 	unregister_chrdev(MTD_CHAR_MAJOR, "mtd");
 }
 
diff --git a/drivers/mtd/mtdconcat.c b/drivers/mtd/mtdconcat.c
index 5a4f02cc1..8f66d093c 100644
--- a/drivers/mtd/mtdconcat.c
+++ b/drivers/mtd/mtdconcat.c
@@ -7,7 +7,7 @@
  *
  * This code is GPL
  *
- * $Id: mtdconcat.c,v 1.8 2003/06/30 11:01:26 dwmw2 Exp $
+ * $Id: mtdconcat.c,v 1.9 2004/06/30 15:17:41 dbrown Exp $
  */
 
 #include <linux/module.h>
@@ -391,7 +391,7 @@ static int concat_erase(struct mtd_info *mtd, struct erase_info *instr)
 	struct mtd_concat *concat = CONCAT(mtd);
 	struct mtd_info *subdev;
 	int i, err;
-	u_int32_t length;
+	u_int32_t length, offset = 0;
 	struct erase_info *erase;
 
 	if (!(mtd->flags & MTD_WRITEABLE))
@@ -450,6 +450,8 @@ static int concat_erase(struct mtd_info *mtd, struct erase_info *instr)
 			return -EINVAL;
 	}
 
+	instr->fail_addr = 0xffffffff;
+
 	/* make a local copy of instr to avoid modifying the caller's struct */
 	erase = kmalloc(sizeof (struct erase_info), GFP_KERNEL);
 
@@ -465,10 +467,12 @@ static int concat_erase(struct mtd_info *mtd, struct erase_info *instr)
 	 */
 	for (i = 0; i < concat->num_subdev; i++) {
 		subdev = concat->subdev[i];
-		if (subdev->size <= erase->addr)
+		if (subdev->size <= erase->addr) {
 			erase->addr -= subdev->size;
-		else
+			offset += subdev->size;
+		} else {
 			break;
+		}
 	}
 
 	/* must never happen since size limit has been verified above */
@@ -497,6 +501,8 @@ static int concat_erase(struct mtd_info *mtd, struct erase_info *instr)
 			 * block alignment has been checked above */
 			if (err == -EINVAL)
 				BUG();
+			if (erase->fail_addr != 0xffffffff)
+				instr->fail_addr = erase->fail_addr + offset;
 			break;
 		}
 		/*
@@ -508,12 +514,13 @@ static int concat_erase(struct mtd_info *mtd, struct erase_info *instr)
 		 * current subdevice, i.e. at offset zero.
 		 */
 		erase->addr = 0;
+		offset += subdev->size;
 	}
+	instr->state = erase->state;
 	kfree(erase);
 	if (err)
 		return err;
 
-	instr->state = MTD_ERASE_DONE;
 	if (instr->callback)
 		instr->callback(instr);
 	return 0;
diff --git a/drivers/mtd/mtdcore.c b/drivers/mtd/mtdcore.c
index 054648e3b..842e7412f 100644
--- a/drivers/mtd/mtdcore.c
+++ b/drivers/mtd/mtdcore.c
@@ -1,12 +1,11 @@
 /*
- * $Id: mtdcore.c,v 1.39 2003/05/21 15:15:03 dwmw2 Exp $
+ * $Id: mtdcore.c,v 1.43 2004/07/23 15:20:46 dwmw2 Exp $
  *
  * Core registration and callback routines for MTD
  * drivers and users.
  *
  */
 
-#include <linux/version.h>
 #include <linux/config.h>
 #include <linux/module.h>
 #include <linux/kernel.h>
@@ -232,7 +231,7 @@ void put_mtd_device(struct mtd_info *mtd)
  *			dont implement their own
  */
 
-int default_mtd_writev(struct mtd_info *mtd, const struct iovec *vecs,
+int default_mtd_writev(struct mtd_info *mtd, const struct kvec *vecs,
 		       unsigned long count, loff_t to, size_t *retlen)
 {
 	unsigned long i;
@@ -262,7 +261,7 @@ int default_mtd_writev(struct mtd_info *mtd, const struct iovec *vecs,
  *		       implement their own
  */
 
-int default_mtd_readv(struct mtd_info *mtd, struct iovec *vecs,
+int default_mtd_readv(struct mtd_info *mtd, struct kvec *vecs,
 		      unsigned long count, loff_t from, size_t *retlen)
 {
 	unsigned long i;
@@ -334,10 +333,7 @@ static int mtd_pm_callback(struct pm_dev *dev, pm_request_t rqst, void *data)
 /* Support for /proc/mtd */
 
 #ifdef CONFIG_PROC_FS
-
-#if LINUX_VERSION_CODE >= KERNEL_VERSION(2,2,0)
 static struct proc_dir_entry *proc_mtd;
-#endif
 
 static inline int mtd_proc_info (char *buf, int i)
 {
@@ -350,13 +346,8 @@ static inline int mtd_proc_info (char *buf, int i)
 		       this->erasesize, this->name);
 }
 
-static int mtd_read_proc ( char *page, char **start, off_t off,int count
-#if LINUX_VERSION_CODE >= KERNEL_VERSION(2,2,0)
-                       ,int *eof, void *data_unused
-#else
-                        ,int unused
-#endif
-			)
+static int mtd_read_proc (char *page, char **start, off_t off, int count,
+			  int *eof, void *data_unused)
 {
 	int len, l, i;
         off_t   begin = 0;
@@ -376,9 +367,7 @@ static int mtd_read_proc ( char *page, char **start, off_t off,int count
                 }
         }
 
-#if LINUX_VERSION_CODE >= KERNEL_VERSION(2,2,0)
         *eof = 1;
-#endif
 
 done:
 	up(&mtd_table_mutex);
@@ -388,18 +377,6 @@ done:
         return ((count < begin+len-off) ? count : begin+len-off);
 }
 
-#if LINUX_VERSION_CODE < KERNEL_VERSION(2,2,0)
-struct proc_dir_entry mtd_proc_entry = {
-        0,                 /* low_ino: the inode -- dynamic */
-        3, "mtd",     /* len of name and name */
-        S_IFREG | S_IRUGO, /* mode */
-        1, 0, 0,           /* nlinks, owner, group */
-        0, NULL,           /* size - unused; operations -- use default */
-        &mtd_read_proc,   /* function used to read data */
-        /* nothing more */
-    };
-#endif
-
 #endif /* CONFIG_PROC_FS */
 
 /*====================================================================*/
@@ -408,16 +385,8 @@ struct proc_dir_entry mtd_proc_entry = {
 int __init init_mtd(void)
 {
 #ifdef CONFIG_PROC_FS
-#if LINUX_VERSION_CODE >= KERNEL_VERSION(2,2,0)
-	if ((proc_mtd = create_proc_entry( "mtd", 0, 0 )))
-	  proc_mtd->read_proc = mtd_read_proc;
-#else
-        proc_register_dynamic(&proc_root,&mtd_proc_entry);
-#endif
-#endif
-
-#if LINUX_VERSION_CODE < 0x20212
-	init_mtd_devices();
+	if ((proc_mtd = create_proc_entry( "mtd", 0, NULL )))
+		proc_mtd->read_proc = mtd_read_proc;
 #endif
 
 #ifdef CONFIG_PM
@@ -436,12 +405,8 @@ static void __exit cleanup_mtd(void)
 #endif
 
 #ifdef CONFIG_PROC_FS
-#if LINUX_VERSION_CODE >= KERNEL_VERSION(2,2,0)
         if (proc_mtd)
-          remove_proc_entry( "mtd", 0);
-#else
-        proc_unregister(&proc_root,mtd_proc_entry.low_ino);
-#endif
+		remove_proc_entry( "mtd", NULL);
 #endif
 }
 
diff --git a/drivers/mtd/mtdpart.c b/drivers/mtd/mtdpart.c
index 460d56f70..c3369e0aa 100644
--- a/drivers/mtd/mtdpart.c
+++ b/drivers/mtd/mtdpart.c
@@ -5,7 +5,7 @@
  *
  * This code is GPL
  *
- * $Id: mtdpart.c,v 1.41 2003/06/18 14:53:02 dwmw2 Exp $
+ * $Id: mtdpart.c,v 1.50 2004/08/10 16:18:34 dwmw2 Exp $
  *
  * 	02-21-2002	Thomas Gleixner <gleixner@autronix.de>
  *			added support for read_oob, write_oob
@@ -182,7 +182,7 @@ static int part_write_user_prot_reg (struct mtd_info *mtd, loff_t from, size_t l
 					len, retlen, buf);
 }
 
-static int part_writev (struct mtd_info *mtd,  const struct iovec *vecs,
+static int part_writev (struct mtd_info *mtd,  const struct kvec *vecs,
 			 unsigned long count, loff_t to, size_t *retlen)
 {
 	struct mtd_part *part = PART(mtd);
@@ -197,7 +197,7 @@ static int part_writev (struct mtd_info *mtd,  const struct iovec *vecs,
 					NULL, &mtd->oobinfo);
 }
 
-static int part_readv (struct mtd_info *mtd,  struct iovec *vecs,
+static int part_readv (struct mtd_info *mtd,  struct kvec *vecs,
 			 unsigned long count, loff_t from, size_t *retlen)
 {
 	struct mtd_part *part = PART(mtd);
@@ -210,7 +210,7 @@ static int part_readv (struct mtd_info *mtd,  struct iovec *vecs,
 					NULL, &mtd->oobinfo);
 }
 
-static int part_writev_ecc (struct mtd_info *mtd,  const struct iovec *vecs,
+static int part_writev_ecc (struct mtd_info *mtd,  const struct kvec *vecs,
 			 unsigned long count, loff_t to, size_t *retlen,
 			 u_char *eccbuf,  struct nand_oobinfo *oobsel)
 {
@@ -224,7 +224,7 @@ static int part_writev_ecc (struct mtd_info *mtd,  const struct iovec *vecs,
 					eccbuf, oobsel);
 }
 
-static int part_readv_ecc (struct mtd_info *mtd,  struct iovec *vecs,
+static int part_readv_ecc (struct mtd_info *mtd,  struct kvec *vecs,
 			 unsigned long count, loff_t from, size_t *retlen,
 			 u_char *eccbuf,  struct nand_oobinfo *oobsel)
 {
@@ -239,13 +239,29 @@ static int part_readv_ecc (struct mtd_info *mtd,  struct iovec *vecs,
 static int part_erase (struct mtd_info *mtd, struct erase_info *instr)
 {
 	struct mtd_part *part = PART(mtd);
+	int ret;
 	if (!(mtd->flags & MTD_WRITEABLE))
 		return -EROFS;
 	if (instr->addr >= mtd->size)
 		return -EINVAL;
 	instr->addr += part->offset;
-	return part->master->erase(part->master, instr);
+	ret = part->master->erase(part->master, instr);
+	return ret;
+}
+
+void mtd_erase_callback(struct erase_info *instr)
+{
+	if (instr->mtd->erase == part_erase) {
+		struct mtd_part *part = PART(instr->mtd);
+
+		if (instr->fail_addr != 0xffffffff)
+			instr->fail_addr -= part->offset;
+		instr->addr -= part->offset;
+	}
+	if (instr->callback)
+		instr->callback(instr);
 }
+EXPORT_SYMBOL_GPL(mtd_erase_callback);
 
 static int part_lock (struct mtd_info *mtd, loff_t ofs, size_t len)
 {
@@ -281,6 +297,26 @@ static void part_resume(struct mtd_info *mtd)
 	part->master->resume(part->master);
 }
 
+static int part_block_isbad (struct mtd_info *mtd, loff_t ofs)
+{
+	struct mtd_part *part = PART(mtd);
+	if (ofs >= mtd->size)
+		return -EINVAL;
+	ofs += part->offset;
+	return part->master->block_isbad(part->master, ofs);
+}
+
+static int part_block_markbad (struct mtd_info *mtd, loff_t ofs)
+{
+	struct mtd_part *part = PART(mtd);
+	if (!(mtd->flags & MTD_WRITEABLE))
+		return -EROFS;
+	if (ofs >= mtd->size)
+		return -EINVAL;
+	ofs += part->offset;
+	return part->master->block_markbad(part->master, ofs);
+}
+
 /* 
  * This function unregisters and destroy all slave MTD objects which are 
  * attached to the given master MTD object.
@@ -316,7 +352,7 @@ int del_mtd_partitions(struct mtd_info *master)
  */
 
 int add_mtd_partitions(struct mtd_info *master, 
-		       struct mtd_partition *parts,
+		       const struct mtd_partition *parts,
 		       int nbparts)
 {
 	struct mtd_part *slave;
@@ -391,6 +427,10 @@ int add_mtd_partitions(struct mtd_info *master,
 			slave->mtd.lock = part_lock;
 		if (master->unlock)
 			slave->mtd.unlock = part_unlock;
+		if (master->block_isbad)
+			slave->mtd.block_isbad = part_block_isbad;
+		if (master->block_markbad)
+			slave->mtd.block_markbad = part_block_markbad;
 		slave->mtd.erase = part_erase;
 		slave->master = master;
 		slave->offset = parts[i].offset;
@@ -461,6 +501,9 @@ int add_mtd_partitions(struct mtd_info *master,
 				parts[i].name);
 		}
 
+		/* copy oobinfo from master */ 
+		memcpy(&slave->mtd.oobinfo, &master->oobinfo, sizeof(slave->mtd.oobinfo));
+
 		if(parts[i].mtdp)
 		{	/* store the object pointer (caller may or may not register it */
 			*parts[i].mtdp = &slave->mtd;
diff --git a/drivers/mtd/nand/Kconfig b/drivers/mtd/nand/Kconfig
index f6ab47241..ed085292c 100644
--- a/drivers/mtd/nand/Kconfig
+++ b/drivers/mtd/nand/Kconfig
@@ -1,5 +1,5 @@
 # drivers/mtd/nand/Kconfig
-# $Id: Kconfig,v 1.4 2003/05/28 10:04:23 dwmw2 Exp $
+# $Id: Kconfig,v 1.17 2004/08/10 14:24:07 dwmw2 Exp $
 
 menu "NAND Flash Device Drivers"
 	depends on MTD!=n
@@ -9,7 +9,7 @@ config MTD_NAND
 	depends on MTD
 	help
 	  This enables support for accessing all type of NAND flash
-	  devices with an 8-bit data bus interface. For further information see
+	  devices. For further information see
 	  <http://www.linux-mtd.infradead.org/tech/nand.html>.
 
 config MTD_NAND_VERIFY_WRITE
@@ -42,10 +42,109 @@ config MTD_NAND_SPIA
 	help
 	  If you had to ask, you don't have one. Say 'N'.
 
+config MTD_NAND_TOTO
+	tristate "NAND Flash device on TOTO board"
+	depends on ARM && ARCH_OMAP && MTD_NAND
+	help
+	  Support for NAND flash on Texas Instruments Toto platform.
+
 config MTD_NAND_IDS
 	tristate
 	default y if MTD_NAND = y || MTD_DOC2000 = y || MTD_DOC2001 = y || MTD_DOC2001PLUS = y
 	default m if MTD_NAND = m || MTD_DOC2000 = m || MTD_DOC2001 = m || MTD_DOC2001PLUS = m
-	
-endmenu
 
+config MTD_NAND_TX4925NDFMC
+	tristate "SmartMedia Card on Toshiba RBTX4925 reference board"
+	depends on TOSHIBA_RBTX4925 && MTD_NAND && TOSHIBA_RBTX4925_MPLEX_NAND
+	help
+	  This enables the driver for the NAND flash device found on the
+	  Toshiba RBTX4925 reference board, which is a SmartMediaCard.
+
+config MTD_NAND_TX4938NDFMC
+	tristate "NAND Flash device on Toshiba RBTX4938 reference board"
+	depends on TOSHIBA_RBTX4938 && MTD_NAND && TOSHIBA_RBTX4938_MPLEX_NAND 
+	help
+	  This enables the driver for the NAND flash device found on the
+	  Toshiba RBTX4938 reference board.
+
+config MTD_NAND_AU1550
+	tristate "Au1550 NAND support"
+	depends on SOC_AU1550 && MTD_NAND
+	help
+	  This enables the driver for the NAND flash controller on the
+	  AMD/Alchemy 1550 SOC.
+
+config MTD_NAND_PPCHAMELEONEVB
+	tristate "NAND Flash device on PPChameleonEVB board"
+	depends on PPCHAMELEONEVB && MTD_NAND
+	help
+	  This enables the NAND flash driver on the PPChameleon EVB Board.	
+
+config MTD_NAND_DISKONCHIP
+	tristate "DiskOnChip 2000, Millennium and Millennium Plus (NAND reimplementation) (EXPERIMENTAL)"
+	depends on MTD_NAND && EXPERIMENTAL
+	help
+	  This is a reimplementation of M-Systems DiskOnChip 2000,
+	  Millennium and Millennium Plus as a standard NAND device driver,
+	  as opposed to the earlier self-contained MTD device drivers.
+	  This should enable, among other things, proper JFFS2 operation on
+	  these devices.
+
+config MTD_NAND_DISKONCHIP_PROBE_ADVANCED
+        bool "Advanced detection options for DiskOnChip"
+        depends on MTD_NAND_DISKONCHIP
+        help
+          This option allows you to specify nonstandard address at which to
+          probe for a DiskOnChip, or to change the detection options.  You
+          are unlikely to need any of this unless you are using LinuxBIOS.
+          Say 'N'.
+
+config MTD_NAND_DISKONCHIP_PROBE_ADDRESS
+        hex "Physical address of DiskOnChip" if MTD_NAND_DISKONCHIP_PROBE_ADVANCED
+        depends on MTD_NAND_DISKONCHIP
+        default "0"
+        ---help---
+        By default, the probe for DiskOnChip devices will look for a
+        DiskOnChip at every multiple of 0x2000 between 0xC8000 and 0xEE000.
+        This option allows you to specify a single address at which to probe
+        for the device, which is useful if you have other devices in that
+        range which get upset when they are probed.
+
+        (Note that on PowerPC, the normal probe will only check at
+        0xE4000000.)
+
+        Normally, you should leave this set to zero, to allow the probe at
+        the normal addresses.
+
+config MTD_NAND_DISKONCHIP_PROBE_HIGH
+        bool "Probe high addresses"
+        depends on MTD_NAND_DISKONCHIP_PROBE_ADVANCED
+        help
+          By default, the probe for DiskOnChip devices will look for a
+          DiskOnChip at every multiple of 0x2000 between 0xC8000 and 0xEE000.
+          This option changes to make it probe between 0xFFFC8000 and
+          0xFFFEE000.  Unless you are using LinuxBIOS, this is unlikely to be
+          useful to you.  Say 'N'.
+
+config MTD_NAND_DISKONCHIP_BBTWRITE
+	bool "Allow BBT writes on DiskOnChip Millennium and 2000TSOP"
+	depends on MTD_NAND_DISKONCHIP
+	help
+	  On DiskOnChip devices shipped with the INFTL filesystem (Millennium
+	  and 2000 TSOP/Alon), Linux reserves some space at the end of the
+	  device for the Bad Block Table (BBT).  If you have existing INFTL
+	  data on your device (created by non-Linux tools such as M-Systems'
+	  DOS drivers), your data might overlap the area Linux wants to use for
+	  the BBT.  If this is a concern for you, leave this option disabled and
+	  Linux will not write BBT data into this area.
+	  The downside of leaving this option disabled is that if bad blocks
+	  are detected by Linux, they will not be recorded in the BBT, which
+	  could cause future problems.
+	  Once you enable this option, new filesystems (INFTL or others, created
+	  in Linux or other operating systems) will not use the reserved area.
+	  The only reason not to enable this option is to prevent damage to
+	  preexisting filesystems.
+	  Even if you leave this disabled, you can enable BBT writes at module
+	  load time (assuming you build diskonchip as a module) with the module
+	  parameter "inftl_bbt_write=1".
+endmenu
diff --git a/drivers/mtd/nand/Makefile b/drivers/mtd/nand/Makefile
index dfc4c1f98..db1939939 100644
--- a/drivers/mtd/nand/Makefile
+++ b/drivers/mtd/nand/Makefile
@@ -1,10 +1,19 @@
 #
 # linux/drivers/nand/Makefile
 #
-# $Id: Makefile.common,v 1.2 2003/05/28 11:38:54 dwmw2 Exp $
+# $Id: Makefile.common,v 1.9 2004/07/12 16:07:31 dwmw2 Exp $
 
-obj-$(CONFIG_MTD_NAND)		+= nand.o nand_ecc.o
-obj-$(CONFIG_MTD_NAND_SPIA)	+= spia.o
-obj-$(CONFIG_MTD_NAND_AUTCPU12)	+= autcpu12.o
-obj-$(CONFIG_MTD_NAND_EDB7312)  += edb7312.o
-obj-$(CONFIG_MTD_NAND_IDS)	+= nand_ids.o
+obj-$(CONFIG_MTD_NAND)			+= nand.o nand_ecc.o
+obj-$(CONFIG_MTD_NAND_IDS)		+= nand_ids.o
+
+obj-$(CONFIG_MTD_NAND_SPIA)		+= spia.o
+obj-$(CONFIG_MTD_NAND_TOTO)		+= toto.o
+obj-$(CONFIG_MTD_NAND_AUTCPU12)		+= autcpu12.o
+obj-$(CONFIG_MTD_NAND_EDB7312)		+= edb7312.o
+obj-$(CONFIG_MTD_NAND_TX4925NDFMC)	+= tx4925ndfmc.o
+obj-$(CONFIG_MTD_NAND_TX4938NDFMC)	+= tx4938ndfmc.o
+obj-$(CONFIG_MTD_NAND_AU1550)		+= au1550nd.o
+obj-$(CONFIG_MTD_NAND_PPCHAMELEONEVB)	+= ppchameleonevb.o
+obj-$(CONFIG_MTD_NAND_DISKONCHIP)	+= diskonchip.o
+
+nand-objs = nand_base.o nand_bbt.o
diff --git a/drivers/mtd/nand/autcpu12.c b/drivers/mtd/nand/autcpu12.c
index dc6df46ad..33779a8da 100644
--- a/drivers/mtd/nand/autcpu12.c
+++ b/drivers/mtd/nand/autcpu12.c
@@ -6,7 +6,7 @@
  *  Derived from drivers/mtd/spia.c
  * 	 Copyright (C) 2000 Steven J. Hill (sjhill@realitydiluted.com)
  * 
- * $Id: autcpu12.c,v 1.11 2003/06/04 17:04:09 gleixner Exp $
+ * $Id: autcpu12.c,v 1.20 2004/07/20 02:44:26 dwmw2 Exp $
  *
  * 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
@@ -15,7 +15,7 @@
  *  Overview:
  *   This is a device driver for the NAND flash device found on the
  *   autronix autcpu12 board, which is a SmartMediaCard. It supports 
- *   16MB, 32MB and 64MB cards.
+ *   16MiB, 32MiB and 64MiB cards.
  *
  *
  *	02-12-2002 TG	Cleanup of module params
@@ -44,14 +44,6 @@
  */
 static struct mtd_info *autcpu12_mtd = NULL;
 
-/*
- * Module stuff
- */
-#if LINUX_VERSION_CODE < 0x20212 && defined(MODULE)
-#define autcpu12_init init_module
-#define autcpu12_cleanup cleanup_module
-#endif
-
 static int autcpu12_io_base = CS89712_VIRT_BASE;
 static int autcpu12_fio_pbase = AUTCPU12_PHYS_SMC;
 static int autcpu12_fio_ctrl = AUTCPU12_SMC_SELECT_OFFSET;
@@ -71,42 +63,40 @@ __setup("autcpu12_pedr=",autcpu12_pedr);
 /*
  * Define partitions for flash devices
  */
-extern struct nand_oobinfo jffs2_oobinfo;
-
 static struct mtd_partition partition_info16k[] = {
-	{ .name = "AUTCPU12 flash partition 1",
-	  .offset  = 0,
-	  .size =    8 * SZ_1M },
-	{ .name = "AUTCPU12 flash partition 2",
-	  .offset =  8 * SZ_1M,
-	  .size =    8 * SZ_1M },
+	{ .name		= "AUTCPU12 flash partition 1",
+	  .offset	= 0,
+	  .size		= 8 * SZ_1M },
+	{ .name		= "AUTCPU12 flash partition 2",
+	  .offset	= 8 * SZ_1M,
+	  .size		= 8 * SZ_1M },
 };
 
 static struct mtd_partition partition_info32k[] = {
-	{ .name = "AUTCPU12 flash partition 1",
-	  .offset  = 0,
-	  .size =    8 * SZ_1M },
-	{ .name = "AUTCPU12 flash partition 2",
-	  .offset =  8 * SZ_1M,
-	  .size =   24 * SZ_1M },
+	{ .name		= "AUTCPU12 flash partition 1",
+	  .offset	= 0,
+	  .size		= 8 * SZ_1M },
+	{ .name		= "AUTCPU12 flash partition 2",
+	  .offset	= 8 * SZ_1M,
+	  .size		= 24 * SZ_1M },
 };
 
 static struct mtd_partition partition_info64k[] = {
-	{ .name = "AUTCPU12 flash partition 1",
-	  .offset  = 0,
-	  .size =   16 * SZ_1M },
-	{ .name = "AUTCPU12 flash partition 2",
-	  .offset = 16 * SZ_1M,
-	  .size =   48 * SZ_1M },
+	{ .name		= "AUTCPU12 flash partition 1",
+	  .offset	= 0,
+	  .size		= 16 * SZ_1M },
+	{ .name		= "AUTCPU12 flash partition 2",
+	  .offset	= 16 * SZ_1M,
+	  .size		= 48 * SZ_1M },
 };
 
 static struct mtd_partition partition_info128k[] = {
-	{ .name = "AUTCPU12 flash partition 1",
-	  .offset  = 0,
-	  .size =   16 * SZ_1M },
-	{ .name = "AUTCPU12 flash partition 2",
-	  .offset = 16 * SZ_1M,
-	  .size =   112 * SZ_1M },
+	{ .name		= "AUTCPU12 flash partition 1",
+	  .offset	= 0,
+	  .size		= 16 * SZ_1M },
+	{ .name		= "AUTCPU12 flash partition 2",
+	  .offset	= 16 * SZ_1M,
+	  .size		= 112 * SZ_1M },
 };
 
 #define NUM_PARTITIONS16K 2
@@ -116,7 +106,7 @@ static struct mtd_partition partition_info128k[] = {
 /* 
  *	hardware specific access to control-lines
 */
-void autcpu12_hwcontrol(int cmd)
+static void autcpu12_hwcontrol(struct mtd_info *mtd, int cmd)
 {
 
 	switch(cmd){
@@ -135,12 +125,13 @@ void autcpu12_hwcontrol(int cmd)
 /*
 *	read device ready pin
 */
-int autcpu12_device_ready(void)
+int autcpu12_device_ready(struct mtd_info *mtd)
 {
 
 	return ( (*(volatile unsigned char *) (autcpu12_io_base + autcpu12_pedr)) & AUTCPU12_SMC_RDY) ? 1 : 0;
 
 }
+
 /*
  * Main initialization routine
  */
@@ -185,20 +176,18 @@ int __init autcpu12_init (void)
 	this->chip_delay = 20;		
 	this->eccmode = NAND_ECC_SOFT;
 
+	/* Enable the following for a flash based bad block table */
+	/*
+	this->options = NAND_USE_FLASH_BBT;
+	*/
+	this->options = NAND_USE_FLASH_BBT;
+	
 	/* Scan to find existance of the device */
-	if (nand_scan (autcpu12_mtd)) {
+	if (nand_scan (autcpu12_mtd, 1)) {
 		err = -ENXIO;
 		goto out_ior;
 	}
-
-	/* Allocate memory for internal data buffer */
-	this->data_buf = kmalloc (sizeof(u_char) * (autcpu12_mtd->oobblock + autcpu12_mtd->oobsize), GFP_KERNEL);
-	if (!this->data_buf) {
-		printk ("Unable to allocate NAND data buffer for AUTCPU12.\n");
-		err = -ENOMEM;
-		goto out_ior;
-	}
-
+	
 	/* Register the partitions */
 	switch(autcpu12_mtd->size){
 		case SZ_16M: add_mtd_partitions(autcpu12_mtd, partition_info16k, NUM_PARTITIONS16K); break;
@@ -208,13 +197,11 @@ int __init autcpu12_init (void)
 		default: {
 			printk ("Unsupported SmartMedia device\n"); 
 			err = -ENXIO;
-			goto out_buf;
+			goto out_ior;
 		}
 	}
 	goto out;
 
-out_buf:
-	kfree (this->data_buf);    
 out_ior:
 	iounmap((void *)autcpu12_fio_base);
 out_mtd:
@@ -231,20 +218,12 @@ module_init(autcpu12_init);
 #ifdef MODULE
 static void __exit autcpu12_cleanup (void)
 {
-	struct nand_chip *this = (struct nand_chip *) &autcpu12_mtd[1];
-
-	/* Unregister partitions */
-	del_mtd_partitions(autcpu12_mtd);
-	
-	/* Unregister the device */
-	del_mtd_device (autcpu12_mtd);
-
-	/* Free internal data buffers */
-	kfree (this->data_buf);
+	/* Release resources, unregister device */
+	nand_release (autcpu12_mtd);
 
 	/* unmap physical adress */
 	iounmap((void *)autcpu12_fio_base);
-
+	
 	/* Free the MTD device structure */
 	kfree (autcpu12_mtd);
 }
diff --git a/drivers/mtd/nand/diskonchip.c b/drivers/mtd/nand/diskonchip.c
index 677c21685..0f7dedd6b 100644
--- a/drivers/mtd/nand/diskonchip.c
+++ b/drivers/mtd/nand/diskonchip.c
@@ -2,12 +2,16 @@
  * drivers/mtd/nand/diskonchip.c
  *
  * (C) 2003 Red Hat, Inc.
+ * (C) 2004 Dan Brown <dan_brown@ieee.org>
+ * (C) 2004 Kalev Lember <kalev@smartlink.ee>
  *
  * Author: David Woodhouse <dwmw2@infradead.org>
+ * Additional Diskonchip 2000 and Millennium support by Dan Brown <dan_brown@ieee.org>
+ * Diskonchip Millennium Plus support by Kalev Lember <kalev@smartlink.ee>
  *
  * Interface to generic NAND code for M-Systems DiskOnChip devices
  *
- * $Id: diskonchip.c,v 1.23 2004/07/13 00:14:35 dbrown Exp $
+ * $Id: diskonchip.c,v 1.34 2004/08/09 19:41:12 dbrown Exp $
  */
 
 #include <linux/kernel.h>
@@ -24,13 +28,13 @@
 #include <linux/mtd/inftl.h>
 
 /* Where to look for the devices? */
-#ifndef CONFIG_MTD_DOCPROBE_ADDRESS
-#define CONFIG_MTD_DOCPROBE_ADDRESS 0
+#ifndef CONFIG_MTD_DISKONCHIP_PROBE_ADDRESS
+#define CONFIG_MTD_DISKONCHIP_PROBE_ADDRESS 0
 #endif
 
 static unsigned long __initdata doc_locations[] = {
 #if defined (__alpha__) || defined(__i386__) || defined(__x86_64__)
-#ifdef CONFIG_MTD_DOCPROBE_HIGH
+#ifdef CONFIG_MTD_DISKONCHIP_PROBE_HIGH
 	0xfffc8000, 0xfffca000, 0xfffcc000, 0xfffce000, 
 	0xfffd0000, 0xfffd2000, 0xfffd4000, 0xfffd6000,
 	0xfffd8000, 0xfffda000, 0xfffdc000, 0xfffde000, 
@@ -84,6 +88,7 @@ static u_char empty_write_ecc[6] = { 0x4b, 0x00, 0xe2, 0x0e, 0x93, 0xf7 };
 
 #define INFTL_BBT_RESERVED_BLOCKS 4
 
+#define DoC_is_MillenniumPlus(doc) ((doc)->ChipID == DOC_ChipID_DocMilPlus16 || (doc)->ChipID == DOC_ChipID_DocMilPlus32)
 #define DoC_is_Millennium(doc) ((doc)->ChipID == DOC_ChipID_DocMil)
 #define DoC_is_2000(doc) ((doc)->ChipID == DOC_ChipID_Doc2k)
 
@@ -109,7 +114,7 @@ static int inftl_bbt_write=0;
 #endif
 MODULE_PARM(inftl_bbt_write, "i");
 
-static unsigned long doc_config_location = CONFIG_MTD_DOCPROBE_ADDRESS;
+static unsigned long doc_config_location = CONFIG_MTD_DISKONCHIP_PROBE_ADDRESS;
 MODULE_PARM(doc_config_location, "l");
 MODULE_PARM_DESC(doc_config_location, "Physical memory address at which to probe for DiskOnChip");
 
@@ -121,11 +126,16 @@ static void DoC_Delay(struct doc_priv *doc, unsigned short cycles)
 	for (i = 0; i < cycles; i++) {
 		if (DoC_is_Millennium(doc))
 			dummy = ReadDOC(doc->virtadr, NOP);
+		else if (DoC_is_MillenniumPlus(doc))
+			dummy = ReadDOC(doc->virtadr, Mplus_NOP);
 		else
 			dummy = ReadDOC(doc->virtadr, DOCStatus);
 	}
 	
 }
+
+#define CDSN_CTRL_FR_B_MASK	(CDSN_CTRL_FR_B0 | CDSN_CTRL_FR_B1)
+
 /* DOC_WaitReady: Wait for RDY line to be asserted by the flash chip */
 static int _DoC_WaitReady(struct doc_priv *doc)
 {
@@ -134,13 +144,24 @@ static int _DoC_WaitReady(struct doc_priv *doc)
 
 	if(debug) printk("_DoC_WaitReady...\n");
 	/* Out-of-line routine to wait for chip response */
-	while (!(ReadDOC(docptr, CDSNControl) & CDSN_CTRL_FR_B)) {
-		if (time_after(jiffies, timeo)) {
-			printk("_DoC_WaitReady timed out.\n");
-			return -EIO;
+	if (DoC_is_MillenniumPlus(doc)) {
+		while ((ReadDOC(docptr, Mplus_FlashControl) & CDSN_CTRL_FR_B_MASK) != CDSN_CTRL_FR_B_MASK) {
+			if (time_after(jiffies, timeo)) {
+				printk("_DoC_WaitReady timed out.\n");
+				return -EIO;
+			}
+			udelay(1);
+			cond_resched();
+		}
+	} else {
+		while (!(ReadDOC(docptr, CDSNControl) & CDSN_CTRL_FR_B)) {
+			if (time_after(jiffies, timeo)) {
+				printk("_DoC_WaitReady timed out.\n");
+				return -EIO;
+			}
+			udelay(1);
+			cond_resched();
 		}
-		udelay(1);
-		cond_resched();
 	}
 
 	return 0;
@@ -151,13 +172,21 @@ static inline int DoC_WaitReady(struct doc_priv *doc)
 	unsigned long docptr = doc->virtadr;
 	int ret = 0;
 
-	DoC_Delay(doc, 4);
+	if (DoC_is_MillenniumPlus(doc)) {
+		DoC_Delay(doc, 4);
 
-	if (!(ReadDOC(docptr, CDSNControl) & CDSN_CTRL_FR_B))
-		/* Call the out-of-line routine to wait */
-		ret = _DoC_WaitReady(doc);
+		if ((ReadDOC(docptr, Mplus_FlashControl) & CDSN_CTRL_FR_B_MASK) != CDSN_CTRL_FR_B_MASK)
+			/* Call the out-of-line routine to wait */
+			ret = _DoC_WaitReady(doc);
+	} else {
+		DoC_Delay(doc, 4);
+
+		if (!(ReadDOC(docptr, CDSNControl) & CDSN_CTRL_FR_B))
+			/* Call the out-of-line routine to wait */
+			ret = _DoC_WaitReady(doc);
+		DoC_Delay(doc, 2);
+	}
 
-	DoC_Delay(doc, 2);
 	if(debug) printk("DoC_WaitReady OK\n");
 	return ret;
 }
@@ -382,7 +411,7 @@ static void doc2001_readbuf(struct mtd_info *mtd,
 	ReadDOC(docptr, ReadPipeInit);
 
 	for (i=0; i < len-1; i++)
-		buf[i] = ReadDOC(docptr, Mil_CDSN_IO);
+		buf[i] = ReadDOC(docptr, Mil_CDSN_IO + (i & 0xff));
 
 	/* Terminate read pipeline */
 	buf[i] = ReadDOC(docptr, LastDataRead);
@@ -409,15 +438,126 @@ static int doc2001_verifybuf(struct mtd_info *mtd,
 	return 0;
 }
 
-static void doc200x_select_chip(struct mtd_info *mtd, int chip)
+static u_char doc2001plus_read_byte(struct mtd_info *mtd)
+{
+	struct nand_chip *this = mtd->priv;
+	struct doc_priv *doc = (void *)this->priv;
+	unsigned long docptr = doc->virtadr;
+	u_char ret;
+
+        ReadDOC(docptr, Mplus_ReadPipeInit);
+        ReadDOC(docptr, Mplus_ReadPipeInit);
+        ret = ReadDOC(docptr, Mplus_LastDataRead);
+	if (debug) printk("read_byte returns %02x\n", ret);
+	return ret;
+}
+
+static void doc2001plus_writebuf(struct mtd_info *mtd, 
+			     const u_char *buf, int len)
+{
+	struct nand_chip *this = mtd->priv;
+	struct doc_priv *doc = (void *)this->priv;
+	unsigned long docptr = doc->virtadr;
+	int i;
+
+	if (debug)printk("writebuf of %d bytes: ", len);
+	for (i=0; i < len; i++) {
+		WriteDOC_(buf[i], docptr, DoC_Mil_CDSN_IO + i);
+		if (debug && i < 16)
+			printk("%02x ", buf[i]);
+	}
+	if (debug) printk("\n");
+}
+
+static void doc2001plus_readbuf(struct mtd_info *mtd, 
+			    u_char *buf, int len)
+{
+	struct nand_chip *this = mtd->priv;
+	struct doc_priv *doc = (void *)this->priv;
+	unsigned long docptr = doc->virtadr;
+	int i;
+
+	if (debug)printk("readbuf of %d bytes: ", len);
+
+	/* Start read pipeline */
+	ReadDOC(docptr, Mplus_ReadPipeInit);
+	ReadDOC(docptr, Mplus_ReadPipeInit);
+
+	for (i=0; i < len-2; i++) {
+		buf[i] = ReadDOC(docptr, Mil_CDSN_IO);
+		if (debug && i < 16)
+			printk("%02x ", buf[i]);
+	}
+
+	/* Terminate read pipeline */
+	buf[len-2] = ReadDOC(docptr, Mplus_LastDataRead);
+	if (debug && i < 16)
+		printk("%02x ", buf[len-2]);
+	buf[len-1] = ReadDOC(docptr, Mplus_LastDataRead);
+	if (debug && i < 16)
+		printk("%02x ", buf[len-1]);
+	if (debug) printk("\n");
+}
+
+static int doc2001plus_verifybuf(struct mtd_info *mtd, 
+			     const u_char *buf, int len)
+{
+	struct nand_chip *this = mtd->priv;
+	struct doc_priv *doc = (void *)this->priv;
+	unsigned long docptr = doc->virtadr;
+	int i;
+
+	if (debug)printk("verifybuf of %d bytes: ", len);
+
+	/* Start read pipeline */
+	ReadDOC(docptr, Mplus_ReadPipeInit);
+	ReadDOC(docptr, Mplus_ReadPipeInit);
+
+	for (i=0; i < len-2; i++)
+		if (buf[i] != ReadDOC(docptr, Mil_CDSN_IO)) {
+			ReadDOC(docptr, Mplus_LastDataRead);
+			ReadDOC(docptr, Mplus_LastDataRead);
+			return i;
+		}
+	if (buf[len-2] != ReadDOC(docptr, Mplus_LastDataRead))
+		return len-2;
+	if (buf[len-1] != ReadDOC(docptr, Mplus_LastDataRead))
+		return len-1;
+	return 0;
+}
+
+static void doc2001plus_select_chip(struct mtd_info *mtd, int chip)
 {
 	struct nand_chip *this = mtd->priv;
 	struct doc_priv *doc = (void *)this->priv;
 	unsigned long docptr = doc->virtadr;
 	int floor = 0;
 
-	/* 11.4.4 -- deassert CE before changing chip */
-	doc200x_hwcontrol(mtd, NAND_CTL_CLRNCE);
+	if(debug)printk("select chip (%d)\n", chip);
+
+	if (chip == -1) {
+		/* Disable flash internally */
+		WriteDOC(0, docptr, Mplus_FlashSelect);
+		return;
+	}
+
+	floor = chip / doc->chips_per_floor;
+	chip -= (floor *  doc->chips_per_floor);
+
+	/* Assert ChipEnable and deassert WriteProtect */
+	WriteDOC((DOC_FLASH_CE), docptr, Mplus_FlashSelect);
+	this->cmdfunc(mtd, NAND_CMD_RESET, -1, -1);
+
+	doc->curchip = chip;
+	doc->curfloor = floor;
+}
+
+static void doc200x_select_chip(struct mtd_info *mtd, int chip)
+{
+	struct nand_chip *this = mtd->priv;
+	struct doc_priv *doc = (void *)this->priv;
+	unsigned long docptr = doc->virtadr;
+	int floor = 0;
 
 	if(debug)printk("select chip (%d)\n", chip);
 
@@ -427,6 +567,9 @@ static void doc200x_select_chip(struct mtd_info *mtd, int chip)
 	floor = chip / doc->chips_per_floor;
 	chip -= (floor *  doc->chips_per_floor);
 
+	/* 11.4.4 -- deassert CE before changing chip */
+	doc200x_hwcontrol(mtd, NAND_CTL_CLRNCE);
+
 	WriteDOC(floor, docptr, FloorSelect);
 	WriteDOC(chip, docptr, CDSNDeviceSelect);
 
@@ -474,24 +617,140 @@ static void doc200x_hwcontrol(struct mtd_info *mtd, int cmd)
 	DoC_Delay(doc, 4);
 }
 
+static void doc2001plus_command (struct mtd_info *mtd, unsigned command, int column, int page_addr)
+{
+	struct nand_chip *this = mtd->priv;
+	struct doc_priv *doc = (void *)this->priv;
+	unsigned long docptr = doc->virtadr;
+
+	/*
+	 * Must terminate write pipeline before sending any commands
+	 * to the device.
+	 */
+	if (command == NAND_CMD_PAGEPROG) {
+		WriteDOC(0x00, docptr, Mplus_WritePipeTerm);
+		WriteDOC(0x00, docptr, Mplus_WritePipeTerm);
+	}
+
+	/*
+	 * Write out the command to the device.
+	 */
+	if (command == NAND_CMD_SEQIN) {
+		int readcmd;
+
+		if (column >= mtd->oobblock) {
+			/* OOB area */
+			column -= mtd->oobblock;
+			readcmd = NAND_CMD_READOOB;
+		} else if (column < 256) {
+			/* First 256 bytes --> READ0 */
+			readcmd = NAND_CMD_READ0;
+		} else {
+			column -= 256;
+			readcmd = NAND_CMD_READ1;
+		}
+		WriteDOC(readcmd, docptr, Mplus_FlashCmd);
+	}
+	WriteDOC(command, docptr, Mplus_FlashCmd);
+	WriteDOC(0, docptr, Mplus_WritePipeTerm);
+	WriteDOC(0, docptr, Mplus_WritePipeTerm);
+
+	if (column != -1 || page_addr != -1) {
+		/* Serially input address */
+		if (column != -1) {
+			/* Adjust columns for 16 bit buswidth */
+			if (this->options & NAND_BUSWIDTH_16)
+				column >>= 1;
+			WriteDOC(column, docptr, Mplus_FlashAddress);
+		}
+		if (page_addr != -1) {
+			WriteDOC((unsigned char) (page_addr & 0xff), docptr, Mplus_FlashAddress);
+			WriteDOC((unsigned char) ((page_addr >> 8) & 0xff), docptr, Mplus_FlashAddress);
+			/* One more address cycle for higher density devices */
+			if (this->chipsize & 0x0c000000) {
+				WriteDOC((unsigned char) ((page_addr >> 16) & 0x0f), docptr, Mplus_FlashAddress);
+				printk("high density\n");
+			}
+		}
+		WriteDOC(0, docptr, Mplus_WritePipeTerm);
+		WriteDOC(0, docptr, Mplus_WritePipeTerm);
+		/* deassert ALE */
+		if (command == NAND_CMD_READ0 || command == NAND_CMD_READ1 || command == NAND_CMD_READOOB || command == NAND_CMD_READID)
+			WriteDOC(0, docptr, Mplus_FlashControl);
+	}
+
+	/* 
+	 * program and erase have their own busy handlers
+	 * status and sequential in needs no delay
+	*/
+	switch (command) {
+
+	case NAND_CMD_PAGEPROG:
+	case NAND_CMD_ERASE1:
+	case NAND_CMD_ERASE2:
+	case NAND_CMD_SEQIN:
+	case NAND_CMD_STATUS:
+		return;
+
+	case NAND_CMD_RESET:
+		if (this->dev_ready)
+			break;
+		udelay(this->chip_delay);
+		WriteDOC(NAND_CMD_STATUS, docptr, Mplus_FlashCmd);
+		WriteDOC(0, docptr, Mplus_WritePipeTerm);
+		WriteDOC(0, docptr, Mplus_WritePipeTerm);
+		while ( !(this->read_byte(mtd) & 0x40));
+		return;
+
+	/* This applies to read commands */
+	default:
+		/* 
+		 * If we don't have access to the busy pin, we apply the given
+		 * command delay
+		*/
+		if (!this->dev_ready) {
+			udelay (this->chip_delay);
+			return;
+		}
+	}
+
+	/* Apply this short delay always to ensure that we do wait tWB in
+	 * any case on any machine. */
+	ndelay (100);
+	/* wait until command is processed */
+	while (!this->dev_ready(mtd));
+}
+
 static int doc200x_dev_ready(struct mtd_info *mtd)
 {
 	struct nand_chip *this = mtd->priv;
 	struct doc_priv *doc = (void *)this->priv;
 	unsigned long docptr = doc->virtadr;
 
-	/* 11.4.2 -- must NOP four times before checking FR/B# */
-	DoC_Delay(doc, 4);
-	if (!(ReadDOC(docptr, CDSNControl) & CDSN_CTRL_FR_B)) {
-		if(debug)
-			printk("not ready\n");
-		return 0;
+	if (DoC_is_MillenniumPlus(doc)) {
+		/* 11.4.2 -- must NOP four times before checking FR/B# */
+		DoC_Delay(doc, 4);
+		if ((ReadDOC(docptr, Mplus_FlashControl) & CDSN_CTRL_FR_B_MASK) != CDSN_CTRL_FR_B_MASK) {
+			if(debug)
+				printk("not ready\n");
+			return 0;
+		}
+		if (debug)printk("was ready\n");
+		return 1;
+	} else {
+		/* 11.4.2 -- must NOP four times before checking FR/B# */
+		DoC_Delay(doc, 4);
+		if (!(ReadDOC(docptr, CDSNControl) & CDSN_CTRL_FR_B)) {
+			if(debug)
+				printk("not ready\n");
+			return 0;
+		}
+		/* 11.4.2 -- Must NOP twice if it's ready */
+		DoC_Delay(doc, 2);
+		if (debug)printk("was ready\n");
+		return 1;
 	}
-	/* 11.4.2 -- Must NOP twice if it's ready */
-	DoC_Delay(doc, 2);
-	if (debug)printk("was ready\n");
-	return 1; 
-}	
+}
 
 static int doc200x_block_bad(struct mtd_info *mtd, loff_t ofs, int getchip)
 {
@@ -516,7 +775,26 @@ static void doc200x_enable_hwecc(struct mtd_info *mtd, int mode)
 		WriteDOC(DOC_ECC_RESET, docptr, ECCConf);
 		WriteDOC(DOC_ECC_EN | DOC_ECC_RW, docptr, ECCConf);
 		break;
-	}	
+	}
+}
+
+static void doc2001plus_enable_hwecc(struct mtd_info *mtd, int mode)
+{
+	struct nand_chip *this = mtd->priv;
+	struct doc_priv *doc = (void *)this->priv;
+	unsigned long docptr = doc->virtadr;
+
+	/* Prime the ECC engine */
+	switch(mode) {
+	case NAND_ECC_READ:
+		WriteDOC(DOC_ECC_RESET, docptr, Mplus_ECCConf);
+		WriteDOC(DOC_ECC_EN, docptr, Mplus_ECCConf);
+		break;
+	case NAND_ECC_WRITE:
+		WriteDOC(DOC_ECC_RESET, docptr, Mplus_ECCConf);
+		WriteDOC(DOC_ECC_EN | DOC_ECC_RW, docptr, Mplus_ECCConf);
+		break;
+	}
 }
 
 /* This code is only called on write */
@@ -536,6 +814,10 @@ static int doc200x_calculate_ecc(struct mtd_info *mtd, const u_char *dat,
 		WriteDOC(0, docptr, 2k_CDSN_IO);
 		WriteDOC(0, docptr, 2k_CDSN_IO);
 		WriteDOC(doc->CDSNControl, docptr, CDSNControl);
+	} else if (DoC_is_MillenniumPlus(doc)) {
+		WriteDOC(0, docptr, Mplus_NOP);
+		WriteDOC(0, docptr, Mplus_NOP);
+		WriteDOC(0, docptr, Mplus_NOP);
 	} else {
 		WriteDOC(0, docptr, NOP);
 		WriteDOC(0, docptr, NOP);
@@ -543,11 +825,17 @@ static int doc200x_calculate_ecc(struct mtd_info *mtd, const u_char *dat,
 	}
 
 	for (i = 0; i < 6; i++) {
-		ecc_code[i] = ReadDOC_(docptr, DoC_ECCSyndrome0 + i);
+		if (DoC_is_MillenniumPlus(doc))
+			ecc_code[i] = ReadDOC_(docptr, DoC_Mplus_ECCSyndrome0 + i);
+		else 
+			ecc_code[i] = ReadDOC_(docptr, DoC_ECCSyndrome0 + i);
 		if (ecc_code[i] != empty_write_ecc[i])
 			emptymatch = 0;
 	}
-	WriteDOC(DOC_ECC_DIS, docptr, ECCConf);
+	if (DoC_is_MillenniumPlus(doc))
+		WriteDOC(DOC_ECC_DIS, docptr, Mplus_ECCConf);
+	else
+		WriteDOC(DOC_ECC_DIS, docptr, ECCConf);
 #if 0
 	/* If emptymatch=1, we might have an all-0xff data buffer.  Check. */
 	if (emptymatch) {
@@ -582,6 +870,10 @@ static int doc200x_correct_data(struct mtd_info *mtd, u_char *dat, u_char *read_
 		dummy = ReadDOC(docptr, 2k_ECCStatus);
 		dummy = ReadDOC(docptr, 2k_ECCStatus);
 		dummy = ReadDOC(docptr, 2k_ECCStatus);
+	} else if (DoC_is_MillenniumPlus(doc)) {
+		dummy = ReadDOC(docptr, Mplus_ECCConf);
+		dummy = ReadDOC(docptr, Mplus_ECCConf);
+		dummy = ReadDOC(docptr, Mplus_ECCConf);
 	} else {
 		dummy = ReadDOC(docptr, ECCConf);
 		dummy = ReadDOC(docptr, ECCConf);
@@ -591,7 +883,10 @@ static int doc200x_correct_data(struct mtd_info *mtd, u_char *dat, u_char *read_
 	/* Error occured ? */
 	if (dummy & 0x80) {
 		for (i = 0; i < 6; i++) {
-			calc_ecc[i] = ReadDOC_(docptr, DoC_ECCSyndrome0 + i);
+			if (DoC_is_MillenniumPlus(doc))
+				calc_ecc[i] = ReadDOC_(docptr, DoC_Mplus_ECCSyndrome0 + i);
+			else
+				calc_ecc[i] = ReadDOC_(docptr, DoC_ECCSyndrome0 + i);
 			if (calc_ecc[i] != empty_read_syndrome[i])
 				emptymatch = 0;
 		}
@@ -623,7 +918,10 @@ static int doc200x_correct_data(struct mtd_info *mtd, u_char *dat, u_char *read_
 		if (ret > 0)
 			printk(KERN_ERR "doc200x_correct_data corrected %d errors\n", ret);
 	}	
-	WriteDOC(DOC_ECC_DIS, docptr, ECCConf);
+	if (DoC_is_MillenniumPlus(doc))
+		WriteDOC(DOC_ECC_DIS, docptr, Mplus_ECCConf);
+	else
+		WriteDOC(DOC_ECC_DIS, docptr, ECCConf);
 	if (no_ecc_failures && (ret == -1)) {
 		printk(KERN_ERR "suppressing ECC failure\n");
 		ret = 0;
@@ -651,8 +949,9 @@ static int __init find_media_headers(struct mtd_info *mtd, u_char *buf,
 {
 	struct nand_chip *this = mtd->priv;
 	struct doc_priv *doc = (void *)this->priv;
-	int offs, end = (MAX_MEDIAHEADER_SCAN << this->phys_erase_shift);
-	int ret, retlen;
+	unsigned offs, end = (MAX_MEDIAHEADER_SCAN << this->phys_erase_shift);
+	int ret;
+	size_t retlen;
 
 	end = min(end, mtd->size); // paranoia
 	for (offs = 0; offs < end; offs += mtd->erasesize) {
@@ -693,13 +992,20 @@ static inline int __init nftl_partscan(struct mtd_info *mtd,
 {
 	struct nand_chip *this = mtd->priv;
 	struct doc_priv *doc = (void *)this->priv;
-	u_char *buf = this->data_buf;
-	struct NFTLMediaHeader *mh = (struct NFTLMediaHeader *) buf;
-	const int psize = 1 << this->page_shift;
-	int blocks, maxblocks;
+	int ret = 0;
+	u_char *buf;
+	struct NFTLMediaHeader *mh;
+	const unsigned psize = 1 << this->page_shift;
+	unsigned blocks, maxblocks;
 	int offs, numheaders;
 
-	if (!(numheaders=find_media_headers(mtd, buf, "ANAND", 1))) return 0;
+	buf = kmalloc(mtd->oobblock, GFP_KERNEL);
+	if (!buf) {
+		printk(KERN_ERR "DiskOnChip mediaheader kmalloc failed!\n");
+		return 0;
+	}
+	if (!(numheaders=find_media_headers(mtd, buf, "ANAND", 1))) goto out;
+	mh = (struct NFTLMediaHeader *) buf;
 
 //#ifdef CONFIG_MTD_DEBUG_VERBOSE
 //	if (CONFIG_MTD_DEBUG_VERBOSE >= 2)
@@ -714,7 +1020,7 @@ static inline int __init nftl_partscan(struct mtd_info *mtd,
 //#endif
 
 	blocks = mtd->size >> this->phys_erase_shift;
-	maxblocks = min(32768, mtd->erasesize - psize);
+	maxblocks = min(32768U, mtd->erasesize - psize);
 
 	if (mh->UnitSizeFactor == 0x00) {
 		/* Auto-determine UnitSizeFactor.  The constraints are:
@@ -725,7 +1031,7 @@ static inline int __init nftl_partscan(struct mtd_info *mtd,
 		mh->UnitSizeFactor = 0xff;
 		while (blocks > maxblocks) {
 			blocks >>= 1;
-			maxblocks = min(32768, (maxblocks << 1) + psize);
+			maxblocks = min(32768U, (maxblocks << 1) + psize);
 			mh->UnitSizeFactor--;
 		}
 		printk(KERN_WARNING "UnitSizeFactor=0x00 detected.  Correct value is assumed to be 0x%02x.\n", mh->UnitSizeFactor);
@@ -741,12 +1047,12 @@ static inline int __init nftl_partscan(struct mtd_info *mtd,
 		mtd->erasesize <<= (0xff - mh->UnitSizeFactor);
 		printk(KERN_INFO "Setting virtual erase size to %d\n", mtd->erasesize);
 		blocks = mtd->size >> this->bbt_erase_shift;
-		maxblocks = min(32768, mtd->erasesize - psize);
+		maxblocks = min(32768U, mtd->erasesize - psize);
 	}
 
 	if (blocks > maxblocks) {
 		printk(KERN_ERR "UnitSizeFactor of 0x%02x is inconsistent with device size.  Aborting.\n", mh->UnitSizeFactor);
-		return 0;
+		goto out;
 	}
 
 	/* Skip past the media headers. */
@@ -767,9 +1073,13 @@ static inline int __init nftl_partscan(struct mtd_info *mtd,
 		parts[1].name = " DiskOnChip Remainder partition";
 		parts[1].offset = offs;
 		parts[1].size = mtd->size - offs;
-		return 2;
+		ret = 2;
+		goto out;
 	}
-	return 1;
+	ret = 1;
+out:
+	kfree(buf);
+	return ret;
 }
 
 /* This is a stripped-down copy of the code in inftlmount.c */
@@ -778,8 +1088,9 @@ static inline int __init inftl_partscan(struct mtd_info *mtd,
 {
 	struct nand_chip *this = mtd->priv;
 	struct doc_priv *doc = (void *)this->priv;
-	u_char *buf = this->data_buf;
-	struct INFTLMediaHeader *mh = (struct INFTLMediaHeader *) buf;
+	int ret = 0;
+	u_char *buf;
+	struct INFTLMediaHeader *mh;
 	struct INFTLPartition *ip;
 	int numparts = 0;
 	int blocks;
@@ -790,8 +1101,15 @@ static inline int __init inftl_partscan(struct mtd_info *mtd,
 	if (inftl_bbt_write)
 		end -= (INFTL_BBT_RESERVED_BLOCKS << this->phys_erase_shift);
 
-	if (!find_media_headers(mtd, buf, "BNAND", 0)) return 0;
+	buf = kmalloc(mtd->oobblock, GFP_KERNEL);
+	if (!buf) {
+		printk(KERN_ERR "DiskOnChip mediaheader kmalloc failed!\n");
+		return 0;
+	}
+
+	if (!find_media_headers(mtd, buf, "BNAND", 0)) goto out;
 	doc->mh1_page = doc->mh0_page + (4096 >> this->page_shift);
+	mh = (struct INFTLMediaHeader *) buf;
 
 	mh->NoOfBootImageBlocks = le32_to_cpu(mh->NoOfBootImageBlocks);
 	mh->NoOfBinaryPartitions = le32_to_cpu(mh->NoOfBinaryPartitions);
@@ -808,13 +1126,17 @@ static inline int __init inftl_partscan(struct mtd_info *mtd,
 			 "    NoOfBDTLPartitions    = %d\n"
 			 "    BlockMultiplerBits    = %d\n"
 			 "    FormatFlgs            = %d\n"
-			 "    OsakVersion           = 0x%x\n"
+			 "    OsakVersion           = %d.%d.%d.%d\n"
 			 "    PercentUsed           = %d\n",
 		mh->bootRecordID, mh->NoOfBootImageBlocks,
 		mh->NoOfBinaryPartitions,
 		mh->NoOfBDTLPartitions,
 		mh->BlockMultiplierBits, mh->FormatFlags,
-		mh->OsakVersion, mh->PercentUsed);
+		((unsigned char *) &mh->OsakVersion)[0] & 0xf,
+		((unsigned char *) &mh->OsakVersion)[1] & 0xf,
+		((unsigned char *) &mh->OsakVersion)[2] & 0xf,
+		((unsigned char *) &mh->OsakVersion)[3] & 0xf,
+		mh->PercentUsed);
 //#endif
 
 	vshift = this->phys_erase_shift + mh->BlockMultiplierBits;
@@ -822,13 +1144,13 @@ static inline int __init inftl_partscan(struct mtd_info *mtd,
 	blocks = mtd->size >> vshift;
 	if (blocks > 32768) {
 		printk(KERN_ERR "BlockMultiplierBits=%d is inconsistent with device size.  Aborting.\n", mh->BlockMultiplierBits);
-		return 0;
+		goto out;
 	}
 
 	blocks = doc->chips_per_floor << (this->chip_shift - this->phys_erase_shift);
 	if (inftl_bbt_write && (blocks > mtd->erasesize)) {
 		printk(KERN_ERR "Writeable BBTs spanning more than one erase block are not yet supported.  FIX ME!\n");
-		return 0;
+		goto out;
 	}
 
 	/* Scan the partitions */
@@ -880,7 +1202,10 @@ static inline int __init inftl_partscan(struct mtd_info *mtd,
 		parts[numparts].size = end - parts[numparts].offset;
 		numparts++;
 	}
-	return numparts;
+	ret = numparts;
+out:
+	kfree(buf);
+	return ret;
 }
 
 static int __init nftl_scan_bbt(struct mtd_info *mtd)
@@ -915,8 +1240,9 @@ static int __init nftl_scan_bbt(struct mtd_info *mtd)
 	if ((ret = nand_scan_bbt(mtd, NULL)))
 		return ret;
 	add_mtd_device(mtd);
-#if defined(CONFIG_MTD_PARTITIONS) || defined(CONFIG_MTD_PARTITIONS_MODULE)
-	if (!no_autopart) add_mtd_partitions(mtd, parts, numparts);
+#ifdef CONFIG_MTD_PARTITIONS
+	if (!no_autopart)
+		add_mtd_partitions(mtd, parts, numparts);
 #endif
 	return 0;
 }
@@ -933,39 +1259,36 @@ static int __init inftl_scan_bbt(struct mtd_info *mtd)
 		return -EIO;
 	}
 
-	if (mtd->size == (8<<20)) {
-#if 0
-/* This doesn't seem to work for me.  I get ECC errors on every page. */
-		/* The Millennium 8MiB is actually an NFTL device! */
-		mtd->name = "DiskOnChip Millennium 8MiB (NFTL)";
-		return nftl_scan_bbt(mtd);
-#endif
-		printk(KERN_ERR "DiskOnChip Millennium 8MiB is not supported.\n");
-		return -EIO;
+	if (DoC_is_MillenniumPlus(doc)) {
+		this->bbt_td->options = NAND_BBT_2BIT | NAND_BBT_ABSPAGE;
+		if (inftl_bbt_write)
+			this->bbt_td->options |= NAND_BBT_WRITE;
+		this->bbt_td->pages[0] = 2;
+		this->bbt_md = NULL;
+	} else {
+		this->bbt_td->options = NAND_BBT_LASTBLOCK | NAND_BBT_8BIT |
+					NAND_BBT_VERSION;
+		if (inftl_bbt_write)
+			this->bbt_td->options |= NAND_BBT_WRITE;
+		this->bbt_td->offs = 8;
+		this->bbt_td->len = 8;
+		this->bbt_td->veroffs = 7;
+		this->bbt_td->maxblocks = INFTL_BBT_RESERVED_BLOCKS;
+		this->bbt_td->reserved_block_code = 0x01;
+		this->bbt_td->pattern = "MSYS_BBT";
+
+		this->bbt_md->options = NAND_BBT_LASTBLOCK | NAND_BBT_8BIT |
+					NAND_BBT_VERSION;
+		if (inftl_bbt_write)
+			this->bbt_md->options |= NAND_BBT_WRITE;
+		this->bbt_md->offs = 8;
+		this->bbt_md->len = 8;
+		this->bbt_md->veroffs = 7;
+		this->bbt_md->maxblocks = INFTL_BBT_RESERVED_BLOCKS;
+		this->bbt_md->reserved_block_code = 0x01;
+		this->bbt_md->pattern = "TBB_SYSM";
 	}
 
-	this->bbt_td->options = NAND_BBT_LASTBLOCK | NAND_BBT_8BIT |
-				NAND_BBT_VERSION;
-	if (inftl_bbt_write)
-		this->bbt_td->options |= NAND_BBT_WRITE;
-	this->bbt_td->offs = 8;
-	this->bbt_td->len = 8;
-	this->bbt_td->veroffs = 7;
-	this->bbt_td->maxblocks = INFTL_BBT_RESERVED_BLOCKS;
-	this->bbt_td->reserved_block_code = 0x01;
-	this->bbt_td->pattern = "MSYS_BBT";
-
-	this->bbt_md->options = NAND_BBT_LASTBLOCK | NAND_BBT_8BIT |
-				NAND_BBT_VERSION;
-	if (inftl_bbt_write)
-		this->bbt_md->options |= NAND_BBT_WRITE;
-	this->bbt_md->offs = 8;
-	this->bbt_md->len = 8;
-	this->bbt_md->veroffs = 7;
-	this->bbt_md->maxblocks = INFTL_BBT_RESERVED_BLOCKS;
-	this->bbt_md->reserved_block_code = 0x01;
-	this->bbt_md->pattern = "TBB_SYSM";
-
 	/* It's safe to set bd=NULL below because NAND_BBT_CREATE is not set.
 	   At least as nand_bbt.c is currently written. */
 	if ((ret = nand_scan_bbt(mtd, NULL)))
@@ -977,8 +1300,9 @@ static int __init inftl_scan_bbt(struct mtd_info *mtd)
 	   autopartitioning, but I want to give it more thought. */
 	if (!numparts) return -EIO;
 	add_mtd_device(mtd);
-#if defined(CONFIG_MTD_PARTITIONS) || defined(CONFIG_MTD_PARTITIONS_MODULE)
-	if (!no_autopart) add_mtd_partitions(mtd, parts, numparts);
+#ifdef CONFIG_MTD_PARTITIONS
+	if (!no_autopart)
+		add_mtd_partitions(mtd, parts, numparts);
 #endif
 	return 0;
 }
@@ -1011,7 +1335,6 @@ static inline int __init doc2001_init(struct mtd_info *mtd)
 	this->write_buf = doc2001_writebuf;
 	this->read_buf = doc2001_readbuf;
 	this->verify_buf = doc2001_verifybuf;
-	this->scan_bbt = inftl_scan_bbt;
 
 	ReadDOC(doc->virtadr, ChipID);
 	ReadDOC(doc->virtadr, ChipID);
@@ -1023,15 +1346,39 @@ static inline int __init doc2001_init(struct mtd_info *mtd)
 		   can have multiple chips. */
 		doc2000_count_chips(mtd);
 		mtd->name = "DiskOnChip 2000 (INFTL Model)";
+		this->scan_bbt = inftl_scan_bbt;
 		return (4 * doc->chips_per_floor);
 	} else {
 		/* Bog-standard Millennium */
 		doc->chips_per_floor = 1;
 		mtd->name = "DiskOnChip Millennium";
+		this->scan_bbt = nftl_scan_bbt;
 		return 1;
 	}
 }
 
+static inline int __init doc2001plus_init(struct mtd_info *mtd)
+{
+	struct nand_chip *this = mtd->priv;
+	struct doc_priv *doc = (void *)this->priv;
+
+	this->write_byte = NULL;
+	this->read_byte = doc2001plus_read_byte;
+	this->write_buf = doc2001plus_writebuf;
+	this->read_buf = doc2001plus_readbuf;
+	this->verify_buf = doc2001plus_verifybuf;
+	this->scan_bbt = inftl_scan_bbt;
+	this->hwcontrol = NULL;
+	this->select_chip = doc2001plus_select_chip;
+	this->cmdfunc = doc2001plus_command;
+	this->enable_hwecc = doc2001plus_enable_hwecc;
+
+	doc->chips_per_floor = 1;
+	mtd->name = "DiskOnChip Millennium Plus";
+
+	return 1;
+}
+
 static inline int __init doc_probe(unsigned long physadr)
 {
 	unsigned char ChipID;
@@ -1081,6 +1428,42 @@ static inline int __init doc_probe(unsigned long physadr)
 	case DOC_ChipID_DocMil:
 		reg = DoC_ECCConf;
 		break;
+	case DOC_ChipID_DocMilPlus16:
+	case DOC_ChipID_DocMilPlus32:
+	case 0:
+		/* Possible Millennium Plus, need to do more checks */
+		/* Possibly release from power down mode */
+		for (tmp = 0; (tmp < 4); tmp++)
+			ReadDOC(virtadr, Mplus_Power);
+
+		/* Reset the Millennium Plus ASIC */
+		tmp = DOC_MODE_RESET | DOC_MODE_MDWREN | DOC_MODE_RST_LAT |
+			DOC_MODE_BDECT;
+		WriteDOC(tmp, virtadr, Mplus_DOCControl);
+		WriteDOC(~tmp, virtadr, Mplus_CtrlConfirm);
+
+		mdelay(1);
+		/* Enable the Millennium Plus ASIC */
+		tmp = DOC_MODE_NORMAL | DOC_MODE_MDWREN | DOC_MODE_RST_LAT |
+			DOC_MODE_BDECT;
+		WriteDOC(tmp, virtadr, Mplus_DOCControl);
+		WriteDOC(~tmp, virtadr, Mplus_CtrlConfirm);
+		mdelay(1);
+
+		ChipID = ReadDOC(virtadr, ChipID);
+
+		switch (ChipID) {
+		case DOC_ChipID_DocMilPlus16:
+			reg = DoC_Mplus_Toggle;
+			break;
+		case DOC_ChipID_DocMilPlus32:
+			printk(KERN_ERR "DiskOnChip Millennium Plus 32MB is not supported, ignoring.\n");
+		default:
+			ret = -ENODEV;
+			goto notfound;
+		}
+		break;
+
 	default:
 		ret = -ENODEV;
 		goto notfound;
@@ -1096,22 +1479,35 @@ static inline int __init doc_probe(unsigned long physadr)
 	}
 
 	for (mtd = doclist; mtd; mtd = doc->nextdoc) {
+		unsigned char oldval;
+		unsigned char newval;
 		nand = mtd->priv;
 		doc = (void *)nand->priv;
 		/* Use the alias resolution register to determine if this is
 		   in fact the same DOC aliased to a new address.  If writes
 		   to one chip's alias resolution register change the value on
 		   the other chip, they're the same chip. */
-		unsigned char oldval = ReadDOC(doc->virtadr, AliasResolution);
-		unsigned char newval = ReadDOC(virtadr, AliasResolution);
+		if (ChipID == DOC_ChipID_DocMilPlus16) {
+			oldval = ReadDOC(doc->virtadr, Mplus_AliasResolution);
+			newval = ReadDOC(virtadr, Mplus_AliasResolution);
+		} else {
+			oldval = ReadDOC(doc->virtadr, AliasResolution);
+			newval = ReadDOC(virtadr, AliasResolution);
+		}
 		if (oldval != newval)
 			continue;
-		WriteDOC(~newval, virtadr, AliasResolution);
-		oldval = ReadDOC(doc->virtadr, AliasResolution);
-		WriteDOC(newval, virtadr, AliasResolution); // restore it
+		if (ChipID == DOC_ChipID_DocMilPlus16) {
+			WriteDOC(~newval, virtadr, Mplus_AliasResolution);
+			oldval = ReadDOC(doc->virtadr, Mplus_AliasResolution);
+			WriteDOC(newval, virtadr, Mplus_AliasResolution); // restore it
+		} else {
+			WriteDOC(~newval, virtadr, AliasResolution);
+			oldval = ReadDOC(doc->virtadr, AliasResolution);
+			WriteDOC(newval, virtadr, AliasResolution); // restore it
+		}
 		newval = ~newval;
 		if (oldval == newval) {
-			//printk(KERN_DEBUG "Found alias of DOC at 0x%lx to 0x%lx\n", doc->physadr, physadr);
+			printk(KERN_DEBUG "Found alias of DOC at 0x%lx to 0x%lx\n", doc->physadr, physadr);
 			goto notfound;
 		}
 	}
@@ -1163,6 +1559,8 @@ static inline int __init doc_probe(unsigned long physadr)
 
 	if (ChipID == DOC_ChipID_Doc2k)
 		numchips = doc2000_init(mtd);
+	else if (ChipID == DOC_ChipID_DocMilPlus16)
+		numchips = doc2001plus_init(mtd);
 	else
 		numchips = doc2001_init(mtd);
 
@@ -1228,10 +1626,10 @@ void __exit cleanup_nanddoc(void)
 		kfree(mtd);
 	}
 }
-	
+
 module_init(init_nanddoc);
 module_exit(cleanup_nanddoc);
 
 MODULE_LICENSE("GPL");
 MODULE_AUTHOR("David Woodhouse <dwmw2@infradead.org>");
-MODULE_DESCRIPTION("M-Systems DiskOnChip 2000 and Millennium device driver\n");
+MODULE_DESCRIPTION("M-Systems DiskOnChip 2000, Millennium and Millennium Plus device driver\n");
diff --git a/drivers/mtd/nand/edb7312.c b/drivers/mtd/nand/edb7312.c
index db678bfb4..797794069 100644
--- a/drivers/mtd/nand/edb7312.c
+++ b/drivers/mtd/nand/edb7312.c
@@ -6,7 +6,7 @@
  *  Derived from drivers/mtd/nand/autcpu12.c
  *       Copyright (c) 2001 Thomas Gleixner (gleixner@autronix.de)
  *
- * $Id: edb7312.c,v 1.5 2003/04/20 07:24:40 gleixner Exp $
+ * $Id: edb7312.c,v 1.8 2004/07/12 15:03:26 dwmw2 Exp $
  *
  * 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
@@ -20,6 +20,7 @@
 
 #include <linux/slab.h>
 #include <linux/module.h>
+#include <linux/init.h>
 #include <linux/mtd/mtd.h>
 #include <linux/mtd/nand.h>
 #include <linux/mtd/partitions.h>
@@ -83,7 +84,7 @@ static struct mtd_partition partition_info[] = {
 /* 
  *	hardware specific access to control-lines
  */
-static void ep7312_hwcontrol(int cmd) 
+static void ep7312_hwcontrol(struct mtd_info *mtd, int cmd) 
 {
 	switch(cmd) {
 		
@@ -113,10 +114,13 @@ static void ep7312_hwcontrol(int cmd)
 /*
  *	read device ready pin
  */
-static int ep7312_device_ready(void)
+static int ep7312_device_ready(struct mtd_info *mtd)
 {
 	return 1;
 }
+#ifdef CONFIG_MTD_PARTITIONS
+const char *part_probes[] = { "cmdlinepart", NULL };
+#endif
 
 /*
  * Main initialization routine
@@ -171,7 +175,7 @@ static int __init ep7312_init (void)
 	this->chip_delay = 15;
 	
 	/* Scan to find existence of the device */
-	if (nand_scan (ep7312_mtd)) {
+	if (nand_scan (ep7312_mtd, 1)) {
 		iounmap((void *)ep7312_fio_base);
 		kfree (ep7312_mtd);
 		return -ENXIO;
@@ -186,16 +190,16 @@ static int __init ep7312_init (void)
 		return -ENOMEM;
 	}
 	
-#ifdef CONFIG_MTD_CMDLINE_PARTS
-	mtd_parts_nb = parse_cmdline_partitions(ep7312_mtd, &mtd_parts, 
-						"edb7312-nand");
+#ifdef CONFIG_PARTITIONS
+	ep7312_mtd->name = "edb7312-nand";
+	mtd_parts_nb = parse_mtd_partitions(ep7312_mtd, part_probes,
+					    &mtd_parts, 0);
 	if (mtd_parts_nb > 0)
-	  part_type = "command line";
+		part_type = "command line";
 	else
-	  mtd_parts_nb = 0;
+		mtd_parts_nb = 0;
 #endif
-	if (mtd_parts_nb == 0)
-	{
+	if (mtd_parts_nb == 0) {
 		mtd_parts = partition_info;
 		mtd_parts_nb = NUM_PARTITIONS;
 		part_type = "static";
diff --git a/drivers/mtd/nand/nand_base.c b/drivers/mtd/nand/nand_base.c
index 596bc8f70..ff6adf43f 100644
--- a/drivers/mtd/nand/nand_base.c
+++ b/drivers/mtd/nand/nand_base.c
@@ -37,7 +37,7 @@
  *	The AG-AND chips have nice features for speed improvement,
  *	which are not supported yet. Read / program 4 pages in one go.
  *
- * $Id: nand_base.c,v 1.113 2004/07/14 16:31:31 gleixner Exp $
+ * $Id: nand_base.c,v 1.115 2004/08/09 13:19:45 dwmw2 Exp $
  *
  * 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
@@ -58,7 +58,7 @@
 #include <linux/bitops.h>
 #include <asm/io.h>
 
-#if defined(CONFIG_MTD_PARTITIONS) || defined(CONFIG_MTD_PARTITIONS_MODULE)
+#ifdef CONFIG_MTD_PARTITIONS
 #include <linux/mtd/partitions.h>
 #endif
 
@@ -1284,12 +1284,12 @@ static int nand_read_ecc (struct mtd_info *mtd, loff_t from, size_t len,
 	nand_release_chip(mtd);
 
 	/*
-	 * Return success, if no ECC failures, else -EIO
+	 * Return success, if no ECC failures, else -EBADMSG
 	 * fs driver will take care of that, because
-	 * retlen == desired len and result == -EIO
+	 * retlen == desired len and result == -EBADMSG
 	 */
 	*retlen = read;
-	return ecc_failed ? -EIO : 0;
+	return ecc_failed ? -EBADMSG : 0;
 }
 
 /**
@@ -2108,8 +2108,8 @@ erase_exit:
 
 	ret = instr->state == MTD_ERASE_DONE ? 0 : -EIO;
 	/* Do call back function */
-	if (!ret && instr->callback)
-		instr->callback (instr);
+	if (!ret)
+		mtd_erase_callback(instr);
 
 	/* Deselect and wake up anyone waiting on the device */
 	nand_release_chip(mtd);
@@ -2555,11 +2555,11 @@ void nand_release (struct mtd_info *mtd)
 {
 	struct nand_chip *this = mtd->priv;
 
-#if defined(CONFIG_MTD_PARTITIONS) || defined(CONFIG_MTD_PARTITIONS_MODULE)
-	/* Unregister partitions */
+#ifdef CONFIG_MTD_PARTITIONS
+	/* Deregister partitions */
 	del_mtd_partitions (mtd);
 #endif
-	/* Unregister the device */
+	/* Deregister the device */
 	del_mtd_device (mtd);
 
 	/* Free bad block table memory, if allocated */
diff --git a/drivers/mtd/nand/nand_ecc.c b/drivers/mtd/nand/nand_ecc.c
index bb57398b3..2e341b754 100644
--- a/drivers/mtd/nand/nand_ecc.c
+++ b/drivers/mtd/nand/nand_ecc.c
@@ -1,22 +1,44 @@
 /*
- *  drivers/mtd/nand_ecc.c
+ * This file contains an ECC algorithm from Toshiba that detects and
+ * corrects 1 bit errors in a 256 byte block of data.
  *
- *  Copyright (C) 2000 Steven J. Hill (sjhill@realitydiluted.com)
- *                     Toshiba America Electronics Components, Inc.
+ * drivers/mtd/nand/nand_ecc.c
  *
- * $Id: nand_ecc.c,v 1.9 2003/02/20 13:34:19 sjhill Exp $
+ * Copyright (C) 2000-2004 Steven J. Hill (sjhill@realitydiluted.com)
+ *                         Toshiba America Electronics Components, Inc.
  *
- * This program is free software; you can redistribute it and/or
- * modify it under the terms of the GNU Lesser General Public License
- * version 2.1 as published by the Free Software Foundation.
+ * $Id: nand_ecc.c,v 1.14 2004/06/16 15:34:37 gleixner Exp $
  *
- * This file contains an ECC algorithm from Toshiba that detects and
- * corrects 1 bit errors in a 256 byte block of data.
+ * This file is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU General Public License as published by the
+ * Free Software Foundation; either version 2 or (at your option) any
+ * later version.
+ * 
+ * This file 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 file; if not, write to the Free Software Foundation, Inc.,
+ * 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA.
+ * 
+ * As a special exception, if other files instantiate templates or use
+ * macros or inline functions from these files, or you compile these
+ * files and link them with other works to produce a work based on these
+ * files, these files do not by themselves cause the resulting work to be
+ * covered by the GNU General Public License. However the source code for
+ * these files must still be made available in accordance with section (3)
+ * of the GNU General Public License.
+ * 
+ * This exception does not invalidate any other reasons why a work based on
+ * this file might be covered by the GNU General Public License.
  */
 
 #include <linux/types.h>
 #include <linux/kernel.h>
 #include <linux/module.h>
+#include <linux/mtd/nand_ecc.h>
 
 /*
  * Pre-calculated 256-way 1 byte column parity
@@ -41,7 +63,12 @@ static const u_char nand_ecc_precalc_table[] = {
 };
 
 
-/*
+/**
+ * nand_trans_result - [GENERIC] create non-inverted ECC
+ * @reg2:	line parity reg 2
+ * @reg3:	line parity reg 3
+ * @ecc_code:	ecc 
+ *
  * Creates non-inverted ECC code from line parity
  */
 static void nand_trans_result(u_char reg2, u_char reg3,
@@ -81,10 +108,13 @@ static void nand_trans_result(u_char reg2, u_char reg3,
 	ecc_code[1] = tmp2;
 }
 
-/*
- * Calculate 3 byte ECC code for 256 byte block
+/**
+ * nand_calculate_ecc - [NAND Interface] Calculate 3 byte ECC code for 256 byte block
+ * @mtd:	MTD block structure
+ * @dat:	raw data
+ * @ecc_code:	buffer for ECC
  */
-void nand_calculate_ecc (const u_char *dat, u_char *ecc_code)
+int nand_calculate_ecc(struct mtd_info *mtd, const u_char *dat, u_char *ecc_code)
 {
 	u_char idx, reg1, reg2, reg3;
 	int j;
@@ -114,12 +144,19 @@ void nand_calculate_ecc (const u_char *dat, u_char *ecc_code)
 	ecc_code[0] = ~ecc_code[0];
 	ecc_code[1] = ~ecc_code[1];
 	ecc_code[2] = ((~reg1) << 2) | 0x03;
+	return 0;
 }
 
-/*
+/**
+ * nand_correct_data - [NAND Interface] Detect and correct bit error(s)
+ * @mtd:	MTD block structure
+ * @dat:	raw data read from the chip
+ * @read_ecc:	ECC from the chip
+ * @calc_ecc:	the ECC calculated from raw data
+ *
  * Detect and correct a 1 bit error for 256 byte block
  */
-int nand_correct_data (u_char *dat, u_char *read_ecc, u_char *calc_ecc)
+int nand_correct_data(struct mtd_info *mtd, u_char *dat, u_char *read_ecc, u_char *calc_ecc)
 {
 	u_char a, b, c, d1, d2, d3, add, bit, i;
 	
diff --git a/drivers/mtd/nand/nand_ids.c b/drivers/mtd/nand/nand_ids.c
index 5a5518fe3..2d8c43212 100644
--- a/drivers/mtd/nand/nand_ids.c
+++ b/drivers/mtd/nand/nand_ids.c
@@ -2,9 +2,8 @@
  *  drivers/mtd/nandids.c
  *
  *  Copyright (C) 2002 Thomas Gleixner (tglx@linutronix.de)
- *
- *
- * $Id: nand_ids.c,v 1.4 2003/05/21 15:15:08 dwmw2 Exp $
+  *
+ * $Id: nand_ids.c,v 1.10 2004/05/26 13:40:12 gleixner Exp $
  *
  * 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
@@ -13,26 +12,99 @@
  */
 #include <linux/module.h>
 #include <linux/mtd/nand.h>
-
 /*
 *	Chip ID list
+*	
+*	Name. ID code, pagesize, chipsize in MegaByte, eraseblock size,
+*	options
+* 
+* 	Pagesize; 0, 256, 512
+*	0 	get this information from the extended chip ID
++	256	256 Byte page size
+*	512	512 Byte page size	
 */
 struct nand_flash_dev nand_flash_ids[] = {
-	{"NAND 1MiB 5V", 0x6e, 20, 0x1000, 1},
-	{"NAND 2MiB 5V", 0x64, 21, 0x1000, 1},
-	{"NAND 4MiB 5V", 0x6b, 22, 0x2000, 0},
-	{"NAND 1MiB 3,3V", 0xe8, 20, 0x1000, 1},
-	{"NAND 1MiB 3,3V", 0xec, 20, 0x1000, 1},
-	{"NAND 2MiB 3,3V", 0xea, 21, 0x1000, 1},
-	{"NAND 4MiB 3,3V", 0xd5, 22, 0x2000, 0},
-	{"NAND 4MiB 3,3V", 0xe3, 22, 0x2000, 0},
-	{"NAND 4MiB 3,3V", 0xe5, 22, 0x2000, 0},
-	{"NAND 8MiB 3,3V", 0xd6, 23, 0x2000, 0},
-	{"NAND 8MiB 3,3V", 0xe6, 23, 0x2000, 0},
-	{"NAND 16MiB 3,3V", 0x73, 24, 0x4000, 0},
-	{"NAND 32MiB 3,3V", 0x75, 25, 0x4000, 0},
-	{"NAND 64MiB 3,3V", 0x76, 26, 0x4000, 0},
-	{"NAND 128MiB 3,3V", 0x79, 27, 0x4000, 0},
+	{"NAND 1MiB 5V 8-bit", 		0x6e, 256, 1, 0x1000, 0},
+	{"NAND 2MiB 5V 8-bit", 		0x64, 256, 2, 0x1000, 0},
+	{"NAND 4MiB 5V 8-bit", 		0x6b, 512, 4, 0x2000, 0},
+	{"NAND 1MiB 3,3V 8-bit", 	0xe8, 256, 1, 0x1000, 0},
+	{"NAND 1MiB 3,3V 8-bit", 	0xec, 256, 1, 0x1000, 0},
+	{"NAND 2MiB 3,3V 8-bit", 	0xea, 256, 2, 0x1000, 0},
+	{"NAND 4MiB 3,3V 8-bit", 	0xd5, 512, 4, 0x2000, 0},
+	{"NAND 4MiB 3,3V 8-bit", 	0xe3, 512, 4, 0x2000, 0},
+	{"NAND 4MiB 3,3V 8-bit", 	0xe5, 512, 4, 0x2000, 0},
+	{"NAND 8MiB 3,3V 8-bit", 	0xd6, 512, 8, 0x2000, 0},
+	
+	{"NAND 8MiB 1,8V 8-bit", 	0x39, 512, 8, 0x2000, 0},
+	{"NAND 8MiB 3,3V 8-bit", 	0xe6, 512, 8, 0x2000, 0},
+	{"NAND 8MiB 1,8V 16-bit", 	0x49, 512, 8, 0x2000, NAND_BUSWIDTH_16},
+	{"NAND 8MiB 3,3V 16-bit", 	0x59, 512, 8, 0x2000, NAND_BUSWIDTH_16},
+	
+	{"NAND 16MiB 1,8V 8-bit", 	0x33, 512, 16, 0x4000, 0},
+	{"NAND 16MiB 3,3V 8-bit", 	0x73, 512, 16, 0x4000, 0},
+	{"NAND 16MiB 1,8V 16-bit", 	0x43, 512, 16, 0x4000, NAND_BUSWIDTH_16},
+	{"NAND 16MiB 3,3V 16-bit", 	0x53, 512, 16, 0x4000, NAND_BUSWIDTH_16},
+	
+	{"NAND 32MiB 1,8V 8-bit", 	0x35, 512, 32, 0x4000, 0},
+	{"NAND 32MiB 3,3V 8-bit", 	0x75, 512, 32, 0x4000, 0},
+	{"NAND 32MiB 1,8V 16-bit", 	0x45, 512, 32, 0x4000, NAND_BUSWIDTH_16},
+	{"NAND 32MiB 3,3V 16-bit", 	0x55, 512, 32, 0x4000, NAND_BUSWIDTH_16},
+	
+	{"NAND 64MiB 1,8V 8-bit", 	0x36, 512, 64, 0x4000, 0},
+	{"NAND 64MiB 3,3V 8-bit", 	0x76, 512, 64, 0x4000, 0},
+	{"NAND 64MiB 1,8V 16-bit", 	0x46, 512, 64, 0x4000, NAND_BUSWIDTH_16},
+	{"NAND 64MiB 3,3V 16-bit", 	0x56, 512, 64, 0x4000, NAND_BUSWIDTH_16},
+	
+	{"NAND 128MiB 1,8V 8-bit", 	0x78, 512, 128, 0x4000, 0},
+	{"NAND 128MiB 3,3V 8-bit", 	0x79, 512, 128, 0x4000, 0},
+	{"NAND 128MiB 1,8V 16-bit", 	0x72, 512, 128, 0x4000, NAND_BUSWIDTH_16},
+	{"NAND 128MiB 3,3V 16-bit", 	0x74, 512, 128, 0x4000, NAND_BUSWIDTH_16},
+	
+	{"NAND 256MiB 3,3V 8-bit", 	0x71, 512, 256, 0x4000, 0},
+
+	{"NAND 512MiB 3,3V 8-bit", 	0xDC, 512, 512, 0x4000, 0},
+	
+	/* These are the new chips with large page size. The pagesize
+	* and the erasesize is determined from the extended id bytes
+	*/
+	/* 1 Gigabit */
+	{"NAND 128MiB 1,8V 8-bit", 	0xA1, 0, 128, 0, NAND_SAMSUNG_LP_OPTIONS | NAND_NO_AUTOINCR},
+	{"NAND 128MiB 3,3V 8-bit", 	0xF1, 0, 128, 0, NAND_SAMSUNG_LP_OPTIONS | NAND_NO_AUTOINCR},
+	{"NAND 128MiB 1,8V 16-bit", 	0xB1, 0, 128, 0, NAND_SAMSUNG_LP_OPTIONS | NAND_BUSWIDTH_16 | NAND_NO_AUTOINCR},
+	{"NAND 128MiB 3,3V 16-bit", 	0xC1, 0, 128, 0, NAND_SAMSUNG_LP_OPTIONS | NAND_BUSWIDTH_16 | NAND_NO_AUTOINCR},
+
+	/* 2 Gigabit */
+	{"NAND 256MiB 1,8V 8-bit", 	0xAA, 0, 256, 0, NAND_SAMSUNG_LP_OPTIONS | NAND_NO_AUTOINCR},
+	{"NAND 256MiB 3,3V 8-bit", 	0xDA, 0, 256, 0, NAND_SAMSUNG_LP_OPTIONS | NAND_NO_AUTOINCR},
+	{"NAND 256MiB 1,8V 16-bit", 	0xBA, 0, 256, 0, NAND_SAMSUNG_LP_OPTIONS | NAND_BUSWIDTH_16 | NAND_NO_AUTOINCR},
+	{"NAND 256MiB 3,3V 16-bit", 	0xCA, 0, 256, 0, NAND_SAMSUNG_LP_OPTIONS | NAND_BUSWIDTH_16 | NAND_NO_AUTOINCR},
+	
+	/* 4 Gigabit */
+	{"NAND 512MiB 1,8V 8-bit", 	0xAC, 0, 512, 0, NAND_SAMSUNG_LP_OPTIONS | NAND_NO_AUTOINCR},
+	{"NAND 512MiB 3,3V 8-bit", 	0xDC, 0, 512, 0, NAND_SAMSUNG_LP_OPTIONS | NAND_NO_AUTOINCR},
+	{"NAND 512MiB 1,8V 16-bit", 	0xBC, 0, 512, 0, NAND_SAMSUNG_LP_OPTIONS | NAND_BUSWIDTH_16 | NAND_NO_AUTOINCR},
+	{"NAND 512MiB 3,3V 16-bit", 	0xCC, 0, 512, 0, NAND_SAMSUNG_LP_OPTIONS | NAND_BUSWIDTH_16 | NAND_NO_AUTOINCR},
+	
+	/* 8 Gigabit */
+	{"NAND 1GiB 1,8V 8-bit", 	0xA3, 0, 1024, 0, NAND_SAMSUNG_LP_OPTIONS | NAND_NO_AUTOINCR},
+	{"NAND 1GiB 3,3V 8-bit", 	0xD3, 0, 1024, 0, NAND_SAMSUNG_LP_OPTIONS | NAND_NO_AUTOINCR},
+	{"NAND 1GiB 1,8V 16-bit", 	0xB3, 0, 1024, 0, NAND_SAMSUNG_LP_OPTIONS | NAND_BUSWIDTH_16 | NAND_NO_AUTOINCR},
+	{"NAND 1GiB 3,3V 16-bit", 	0xC3, 0, 1024, 0, NAND_SAMSUNG_LP_OPTIONS | NAND_BUSWIDTH_16 | NAND_NO_AUTOINCR},
+
+	/* 16 Gigabit */
+	{"NAND 2GiB 1,8V 8-bit", 	0xA5, 0, 2048, 0, NAND_SAMSUNG_LP_OPTIONS | NAND_NO_AUTOINCR},
+	{"NAND 2GiB 3,3V 8-bit", 	0xD5, 0, 2048, 0, NAND_SAMSUNG_LP_OPTIONS | NAND_NO_AUTOINCR},
+	{"NAND 2GiB 1,8V 16-bit", 	0xB5, 0, 2048, 0, NAND_SAMSUNG_LP_OPTIONS | NAND_BUSWIDTH_16 | NAND_NO_AUTOINCR},
+	{"NAND 2GiB 3,3V 16-bit", 	0xC5, 0, 2048, 0, NAND_SAMSUNG_LP_OPTIONS | NAND_BUSWIDTH_16 | NAND_NO_AUTOINCR},
+
+	/* Renesas AND 1 Gigabit. Those chips do not support extended id and have a strange page/block layout ! 
+	 * The chosen minimum erasesize is 4 * 2 * 2048 = 16384 Byte, as those chips have an array of 4 page planes
+	 * 1 block = 2 pages, but due to plane arrangement the blocks 0-3 consists of page 0 + 4,1 + 5, 2 + 6, 3 + 7
+	 * Anyway JFFS2 would increase the eraseblock size so we chose a combined one which can be erased in one go
+	 * There are more speed improvements for reads and writes possible, but not implemented now 
+	 */
+	{"AND 128MiB 3,3V 8-bit",	0x01, 2048, 128, 0x4000, NAND_IS_AND | NAND_NO_AUTOINCR | NAND_4PAGE_ARRAY},
+
 	{NULL,}
 };
 
@@ -44,10 +116,11 @@ struct nand_manufacturers nand_manuf_ids[] = {
 	{NAND_MFR_SAMSUNG, "Samsung"},
 	{NAND_MFR_FUJITSU, "Fujitsu"},
 	{NAND_MFR_NATIONAL, "National"},
+	{NAND_MFR_RENESAS, "Renesas"},
+	{NAND_MFR_STMICRO, "ST Micro"},
 	{0x0, "Unknown"}
 };
 
-
 EXPORT_SYMBOL (nand_manuf_ids);
 EXPORT_SYMBOL (nand_flash_ids);
 
diff --git a/drivers/mtd/nand/spia.c b/drivers/mtd/nand/spia.c
index e5e25eb36..acf6fc808 100644
--- a/drivers/mtd/nand/spia.c
+++ b/drivers/mtd/nand/spia.c
@@ -8,7 +8,7 @@
  *			to controllines	(due to change in nand.c)
  *			page_cache added
  *
- * $Id: spia.c,v 1.19 2003/04/20 07:24:40 gleixner Exp $
+ * $Id: spia.c,v 1.21 2003/07/11 15:12:29 dwmw2 Exp $
  *
  * 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
@@ -20,6 +20,8 @@
  *   a 64Mibit (8MiB x 8 bits) NAND flash device.
  */
 
+#include <linux/kernel.h>
+#include <linux/init.h>
 #include <linux/slab.h>
 #include <linux/module.h>
 #include <linux/mtd/mtd.h>
@@ -35,14 +37,14 @@ static struct mtd_info *spia_mtd = NULL;
 /*
  * Values specific to the SPIA board (used with EP7212 processor)
  */
-#define SPIA_IO_ADDR	= 0xd0000000	/* Start of EP7212 IO address space */
-#define SPIA_FIO_ADDR	= 0xf0000000	/* Address where flash is mapped */
-#define SPIA_PEDR	= 0x0080	/*
+#define SPIA_IO_BASE	0xd0000000	/* Start of EP7212 IO address space */
+#define SPIA_FIO_BASE	0xf0000000	/* Address where flash is mapped */
+#define SPIA_PEDR	0x0080		/*
 					 * IO offset to Port E data register
 					 * where the CLE, ALE and NCE pins
 					 * are wired to.
 					 */
-#define SPIA_PEDDR	= 0x00c0	/*
+#define SPIA_PEDDR	0x00c0		/*
 					 * IO offset to Port E data direction
 					 * register so we can control the IO
 					 * lines.
@@ -62,11 +64,6 @@ MODULE_PARM(spia_fio_base, "i");
 MODULE_PARM(spia_pedr, "i");
 MODULE_PARM(spia_peddr, "i");
 
-__setup("spia_io_base=",spia_io_base);
-__setup("spia_fio_base=",spia_fio_base);
-__setup("spia_pedr=",spia_pedr);
-__setup("spia_peddr=",spia_peddr);
-
 /*
  * Define partitions for flash device
  */
@@ -88,7 +85,7 @@ const static struct mtd_partition partition_info[] = {
 /* 
  *	hardware specific access to control-lines
 */
-void spia_hwcontrol(int cmd){
+static void spia_hwcontrol(struct mtd_info *mtd, int cmd){
 
     switch(cmd){
 
@@ -143,7 +140,7 @@ int __init spia_init (void)
 	this->chip_delay = 15;		
 
 	/* Scan to find existence of the device */
-	if (nand_scan (spia_mtd)) {
+	if (nand_scan (spia_mtd, 1)) {
 		kfree (spia_mtd);
 		return -ENXIO;
 	}
diff --git a/drivers/mtd/nand/tx4925ndfmc.c b/drivers/mtd/nand/tx4925ndfmc.c
index 94a616561..5f6a2f5ed 100644
--- a/drivers/mtd/nand/tx4925ndfmc.c
+++ b/drivers/mtd/nand/tx4925ndfmc.c
@@ -11,7 +11,7 @@
  * Derived from drivers/mtd/autcpu12.c
  *       Copyright (c) 2001 Thomas Gleixner (gleixner@autronix.de)
  *
- * $Id: tx4925ndfmc.c,v 1.2 2004/03/27 19:55:53 gleixner Exp $
+ * $Id: tx4925ndfmc.c,v 1.3 2004/07/20 02:44:26 dwmw2 Exp $
  *
  * Copyright (C) 2001 Toshiba Corporation 
  * 
@@ -39,14 +39,6 @@ extern struct nand_oobinfo jffs2_oobinfo;
  */
 static struct mtd_info *tx4925ndfmc_mtd = NULL;
 
-/*
- * Module stuff
- */
-#if LINUX_VERSION_CODE < 0x20212 && defined(MODULE)
-#define tx4925ndfmc_init init_module
-#define tx4925ndfmc_cleanup cleanup_module
-#endif
-
 /*
  * Define partitions for flash devices
  */
diff --git a/drivers/mtd/nftlcore.c b/drivers/mtd/nftlcore.c
index ea709d7cf..4102a6797 100644
--- a/drivers/mtd/nftlcore.c
+++ b/drivers/mtd/nftlcore.c
@@ -1,7 +1,7 @@
 /* Linux driver for NAND Flash Translation Layer      */
 /* (c) 1999 Machine Vision Holdings, Inc.             */
 /* Author: David Woodhouse <dwmw2@infradead.org>      */
-/* $Id: nftlcore.c,v 1.94 2003/06/23 12:00:08 dwmw2 Exp $ */
+/* $Id: nftlcore.c,v 1.96 2004/06/28 13:52:55 dbrown Exp $ */
 
 /*
   The contents of this file are distributed under the GNU General
@@ -43,9 +43,19 @@ static void nftl_add_mtd(struct mtd_blktrans_ops *tr, struct mtd_info *mtd)
 	struct NFTLrecord *nftl;
 	unsigned long temp;
 
-	if (mtd->ecctype != MTD_ECC_RS_DiskOnChip)
+	if (mtd->type != MTD_NANDFLASH)
+		return;
+	/* OK, this is moderately ugly.  But probably safe.  Alternatives? */
+	if (memcmp(mtd->name, "DiskOnChip", 10))
 		return;
 
+	if (!mtd->block_isbad) {
+		printk(KERN_ERR
+"NFTL no longer supports the old DiskOnChip drivers loaded via docprobe.\n"
+"Please use the new diskonchip driver under the NAND subsystem.\n");
+		return;
+	}
+
 	DEBUG(MTD_DEBUG_LEVEL1, "NFTL: add_mtd for %s\n", mtd->name);
 
 	nftl = kmalloc(sizeof(struct NFTLrecord), GFP_KERNEL);
@@ -60,6 +70,8 @@ static void nftl_add_mtd(struct mtd_blktrans_ops *tr, struct mtd_info *mtd)
 	nftl->mbd.devnum = -1;
 	nftl->mbd.blksize = 512;
 	nftl->mbd.tr = tr;
+	memcpy(&nftl->oobinfo, &mtd->oobinfo, sizeof(struct nand_oobinfo));
+	nftl->oobinfo.useecc = MTD_NANDECC_PLACEONLY;
 
         if (NFTL_mount(nftl) < 0) {
 		printk(KERN_WARNING "NFTL: could not mount device\n");
@@ -350,17 +362,19 @@ static u16 NFTL_foldchain (struct NFTLrecord *nftl, unsigned thisVUC, unsigned p
                 if (BlockMap[block] == BLOCK_NIL)
                         continue;
                 
-                ret = MTD_READECC(nftl->mbd.mtd, (nftl->EraseSize * BlockMap[block]) + (block * 512),
-				  512, &retlen, movebuf, (char *)&oob, NAND_ECC_DISKONCHIP); 
+                ret = MTD_READ(nftl->mbd.mtd, (nftl->EraseSize * BlockMap[block]) + (block * 512),
+				  512, &retlen, movebuf); 
                 if (ret < 0) {
-                    ret = MTD_READECC(nftl->mbd.mtd, (nftl->EraseSize * BlockMap[block])
+                    ret = MTD_READ(nftl->mbd.mtd, (nftl->EraseSize * BlockMap[block])
                                       + (block * 512), 512, &retlen,
-                                      movebuf, (char *)&oob, NAND_ECC_DISKONCHIP); 
+                                      movebuf); 
                     if (ret != -EIO) 
                         printk("Error went away on retry.\n");
                 }
+		memset(&oob, 0xff, sizeof(struct nftl_oob));
+		oob.b.Status = oob.b.Status1 = SECTOR_USED;
                 MTD_WRITEECC(nftl->mbd.mtd, (nftl->EraseSize * targetEUN) + (block * 512),
-                             512, &retlen, movebuf, (char *)&oob, NAND_ECC_DISKONCHIP);
+                             512, &retlen, movebuf, (char *)&oob, &nftl->oobinfo);
 	}
         
         /* add the header so that it is now a valid chain */
@@ -390,7 +404,6 @@ static u16 NFTL_foldchain (struct NFTLrecord *nftl, unsigned thisVUC, unsigned p
 
                 if (NFTL_formatblock(nftl, thisEUN) < 0) {
 			/* could not erase : mark block as reserved
-			 * FixMe: Update Bad Unit Table on disk
 			 */
 			nftl->ReplUnitTable[thisEUN] = BLOCK_RESERVED;
                 } else {
@@ -617,7 +630,7 @@ static int nftl_writeblock(struct mtd_blktrans_dev *mbd, unsigned long block,
 	u16 writeEUN;
 	unsigned long blockofs = (block * 512) & (nftl->EraseSize - 1);
 	size_t retlen;
-	u8 eccbuf[6];
+	struct nftl_oob oob;
 
 	writeEUN = NFTL_findwriteunit(nftl, block);
 
@@ -628,9 +641,11 @@ static int nftl_writeblock(struct mtd_blktrans_dev *mbd, unsigned long block,
 		return 1;
 	}
 
+	memset(&oob, 0xff, sizeof(struct nftl_oob));
+	oob.b.Status = oob.b.Status1 = SECTOR_USED;
 	MTD_WRITEECC(nftl->mbd.mtd, (writeEUN * nftl->EraseSize) + blockofs,
-		     512, &retlen, (char *)buffer, (char *)eccbuf, NAND_ECC_DISKONCHIP);
-        /* no need to write SECTOR_USED flags since they are written in mtd_writeecc */
+		     512, &retlen, (char *)buffer, (char *)&oob, &nftl->oobinfo);
+        /* need to write SECTOR_USED flags since they are not written in mtd_writeecc */
 
 	return 0;
 }
@@ -692,8 +707,7 @@ static int nftl_readblock(struct mtd_blktrans_dev *mbd, unsigned long block,
 	} else {
 		loff_t ptr = (lastgoodEUN * nftl->EraseSize) + blockofs;
 		size_t retlen;
-		u_char eccbuf[6];
-		if (MTD_READECC(nftl->mbd.mtd, ptr, 512, &retlen, buffer, eccbuf, NAND_ECC_DISKONCHIP))
+		if (MTD_READ(nftl->mbd.mtd, ptr, 512, &retlen, buffer))
 			return -EIO;
 	}
 	return 0;
@@ -735,7 +749,7 @@ extern char nftlmountrev[];
 
 int __init init_nftl(void)
 {
-	printk(KERN_INFO "NFTL driver: nftlcore.c $Revision: 1.94 $, nftlmount.c %s\n", nftlmountrev);
+	printk(KERN_INFO "NFTL driver: nftlcore.c $Revision: 1.96 $, nftlmount.c %s\n", nftlmountrev);
 
 	return register_mtd_blktrans(&nftl_tr);
 }
diff --git a/drivers/mtd/nftlmount.c b/drivers/mtd/nftlmount.c
index 394a0a115..a8a4e1ac8 100644
--- a/drivers/mtd/nftlmount.c
+++ b/drivers/mtd/nftlmount.c
@@ -4,7 +4,7 @@
  * Author: Fabrice Bellard (fabrice.bellard@netgem.com) 
  * Copyright (C) 2000 Netgem S.A.
  *
- * $Id: nftlmount.c,v 1.34 2003/05/21 10:54:10 dwmw2 Exp $
+ * $Id: nftlmount.c,v 1.36 2004/06/28 13:52:55 dbrown Exp $
  *
  * 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
@@ -31,7 +31,7 @@
 
 #define SECTORSIZE 512
 
-char nftlmountrev[]="$Revision: 1.34 $";
+char nftlmountrev[]="$Revision: 1.36 $";
 
 /* find_boot_record: Find the NFTL Media Header and its Spare copy which contains the
  *	various device information of the NFTL partition and Bad Unit Table. Update
@@ -50,6 +50,10 @@ static int find_boot_record(struct NFTLrecord *nftl)
 
         /* Assume logical EraseSize == physical erasesize for starting the scan. 
 	   We'll sort it out later if we find a MediaHeader which says otherwise */
+	/* Actually, we won't.  The new DiskOnChip driver has already scanned
+	   the MediaHeader and adjusted the virtual erasesize it presents in
+	   the mtd device accordingly.  We could even get rid of
+	   nftl->EraseSize if there were any point in doing so. */
 	nftl->EraseSize = nftl->mbd.mtd->erasesize;
         nftl->nb_blocks = nftl->mbd.mtd->size / nftl->EraseSize;
 
@@ -62,7 +66,10 @@ static int find_boot_record(struct NFTLrecord *nftl)
 
 		/* Check for ANAND header first. Then can whinge if it's found but later
 		   checks fail */
-		if ((ret = MTD_READ(nftl->mbd.mtd, block * nftl->EraseSize, SECTORSIZE, &retlen, buf))) {
+		ret = MTD_READ(nftl->mbd.mtd, block * nftl->EraseSize, SECTORSIZE, &retlen, buf);
+		/* We ignore ret in case the ECC of the MediaHeader is invalid
+		   (which is apparently acceptable) */
+		if (retlen != SECTORSIZE) {
 			static int warncount = 5;
 
 			if (warncount) {
@@ -104,7 +111,7 @@ static int find_boot_record(struct NFTLrecord *nftl)
 
 		/* Finally reread to check ECC */
 		if ((ret = MTD_READECC(nftl->mbd.mtd, block * nftl->EraseSize, SECTORSIZE,
-				&retlen, buf, (char *)&oob, NAND_ECC_DISKONCHIP) < 0)) {
+				&retlen, buf, (char *)&oob, NULL) < 0)) {
 			printk(KERN_NOTICE "ANAND header found at 0x%x in mtd%d, but ECC read failed (err %d)\n",
 			       block * nftl->EraseSize, nftl->mbd.mtd->index, ret);
 			continue;
@@ -149,6 +156,10 @@ static int find_boot_record(struct NFTLrecord *nftl)
 		memcpy(mh, buf, sizeof(struct NFTLMediaHeader));
 
 		/* Do some sanity checks on it */
+#if 0
+The new DiskOnChip driver scans the MediaHeader itself, and presents a virtual
+erasesize based on UnitSizeFactor.  So the erasesize we read from the mtd
+device is already correct.
 		if (mh->UnitSizeFactor == 0) {
 			printk(KERN_NOTICE "NFTL: UnitSizeFactor 0x00 detected. This violates the spec but we think we know what it means...\n");
 		} else if (mh->UnitSizeFactor < 0xfc) {
@@ -161,6 +172,7 @@ static int find_boot_record(struct NFTLrecord *nftl)
 			nftl->EraseSize = nftl->mbd.mtd->erasesize << (0xff - mh->UnitSizeFactor);
 			nftl->nb_blocks = nftl->mbd.mtd->size / nftl->EraseSize;
 		}
+#endif
 		nftl->nb_boot_blocks = le16_to_cpu(mh->FirstPhysicalEUN);
 		if ((nftl->nb_boot_blocks + 2) >= nftl->nb_blocks) {
 			printk(KERN_NOTICE "NFTL Media Header sanity check failed:\n");
@@ -213,11 +225,13 @@ static int find_boot_record(struct NFTLrecord *nftl)
 
 		/* read the Bad Erase Unit Table and modify ReplUnitTable[] accordingly */
 		for (i = 0; i < nftl->nb_blocks; i++) {
+#if 0
+The new DiskOnChip driver already scanned the bad block table.  Just query it.
 			if ((i & (SECTORSIZE - 1)) == 0) {
 				/* read one sector for every SECTORSIZE of blocks */
 				if ((ret = MTD_READECC(nftl->mbd.mtd, block * nftl->EraseSize +
 						       i + SECTORSIZE, SECTORSIZE, &retlen, buf,
-						       (char *)&oob, NAND_ECC_DISKONCHIP)) < 0) {
+						       (char *)&oob, NULL)) < 0) {
 					printk(KERN_NOTICE "Read of bad sector table failed (err %d)\n",
 					       ret);
 					kfree(nftl->ReplUnitTable);
@@ -228,6 +242,9 @@ static int find_boot_record(struct NFTLrecord *nftl)
 			/* mark the Bad Erase Unit as RESERVED in ReplUnitTable */
 			if (buf[i & (SECTORSIZE - 1)] != 0xff)
 				nftl->ReplUnitTable[i] = BLOCK_RESERVED;
+#endif
+			if (nftl->mbd.mtd->block_isbad(nftl->mbd.mtd, i * nftl->EraseSize))
+				nftl->ReplUnitTable[i] = BLOCK_RESERVED;
 		}
 		
 		nftl->MediaUnit = block;
@@ -253,21 +270,16 @@ static int check_free_sectors(struct NFTLrecord *nftl, unsigned int address, int
 			      int check_oob)
 {
 	int i, retlen;
-	u8 buf[SECTORSIZE];
+	u8 buf[SECTORSIZE + nftl->mbd.mtd->oobsize];
 
 	for (i = 0; i < len; i += SECTORSIZE) {
-		/* we want to read the sector without ECC check here since a free
-		   sector does not have ECC syndrome on it yet */
-		if (MTD_READ(nftl->mbd.mtd, address, SECTORSIZE, &retlen, buf) < 0)
+		if (MTD_READECC(nftl->mbd.mtd, address, SECTORSIZE, &retlen, buf, &buf[SECTORSIZE], &nftl->oobinfo) < 0)
 			return -1;
 		if (memcmpb(buf, 0xff, SECTORSIZE) != 0)
 			return -1;
 
 		if (check_oob) {
-			if (MTD_READOOB(nftl->mbd.mtd, address, nftl->mbd.mtd->oobsize,
-					&retlen, buf) < 0)
-				return -1;
-			if (memcmpb(buf, 0xff, nftl->mbd.mtd->oobsize) != 0)
+			if (memcmpb(buf + SECTORSIZE, 0xff, nftl->mbd.mtd->oobsize) != 0)
 				return -1;
 		}
 		address += SECTORSIZE;
@@ -282,7 +294,6 @@ static int check_free_sectors(struct NFTLrecord *nftl, unsigned int address, int
  * Return: 0 when succeed, -1 on error.
  *
  *  ToDo: 1. Is it neceressary to check_free_sector after erasing ?? 
- *        2. UnitSizeFactor != 0xFF
  */
 int NFTL_formatblock(struct NFTLrecord *nftl, int block)
 {
@@ -312,11 +323,10 @@ int NFTL_formatblock(struct NFTLrecord *nftl, int block)
 	MTD_ERASE(nftl->mbd.mtd, instr);
 
 	if (instr->state == MTD_ERASE_FAILED) {
-		/* could not format, FixMe: We should update the BadUnitTable 
-		   both in memory and on disk */
 		printk("Error while formatting block %d\n", block);
-		return -1;
-	} else {
+		goto fail;
+	}
+
 		/* increase and write Wear-Leveling info */
 		nb_erases = le32_to_cpu(uci.WearInfo);
 		nb_erases++;
@@ -329,14 +339,18 @@ int NFTL_formatblock(struct NFTLrecord *nftl, int block)
 		 * FixMe:  is this check really necessary ? since we have check the
 		 *         return code after the erase operation. */
 		if (check_free_sectors(nftl, instr->addr, nftl->EraseSize, 1) != 0)
-			return -1;
+			goto fail;
 
 		uci.WearInfo = le32_to_cpu(nb_erases);
 		if (MTD_WRITEOOB(nftl->mbd.mtd, block * nftl->EraseSize + SECTORSIZE + 8, 8,
 				 &retlen, (char *)&uci) < 0)
-			return -1;
+			goto fail;
 		return 0;
-	}
+fail:
+	/* could not format, update the bad block table (caller is responsible
+	   for setting the ReplUnitTable to BLOCK_RESERVED on failure) */
+	nftl->mbd.mtd->block_markbad(nftl->mbd.mtd, instr->addr);
+	return -1;
 }
 
 /* check_sectors_in_chain: Check that each sector of a Virtual Unit Chain is correct.
@@ -441,8 +455,7 @@ static void format_chain(struct NFTLrecord *nftl, unsigned int first_block)
 
 		printk("Formatting block %d\n", block);
 		if (NFTL_formatblock(nftl, block) < 0) {
-			/* cannot format !!!! Mark it as Bad Unit,
-			   FixMe: update the BadUnitTable on disk */
+			/* cannot format !!!! Mark it as Bad Unit */
 			nftl->ReplUnitTable[block] = BLOCK_RESERVED;
 		} else {
 			nftl->ReplUnitTable[block] = BLOCK_FREE;
diff --git a/drivers/mtd/redboot.c b/drivers/mtd/redboot.c
index 3e279992f..0212a7df8 100644
--- a/drivers/mtd/redboot.c
+++ b/drivers/mtd/redboot.c
@@ -1,5 +1,5 @@
 /*
- * $Id: redboot.c,v 1.11 2003/05/21 10:39:26 dwmw2 Exp $
+ * $Id: redboot.c,v 1.15 2004/08/10 07:55:16 dwmw2 Exp $
  *
  * Parse RedBoot-style Flash Image System (FIS) tables and
  * produce a Linux partition array to match.
@@ -8,6 +8,7 @@
 #include <linux/kernel.h>
 #include <linux/slab.h>
 #include <linux/init.h>
+#include <linux/vmalloc.h>
 
 #include <linux/mtd/mtd.h>
 #include <linux/mtd/partitions.h>
@@ -48,21 +49,24 @@ static int parse_redboot_partitions(struct mtd_info *master,
 	char *names;
 	char *nullname;
 	int namelen = 0;
+	int nulllen = 0;
+#ifdef CONFIG_MTD_REDBOOT_PARTS_UNALLOCATED
 	static char nullstring[] = "unallocated";
+#endif
 
-	buf = kmalloc(PAGE_SIZE, GFP_KERNEL);
+	buf = vmalloc(master->erasesize);
 
 	if (!buf)
 		return -ENOMEM;
 
 	/* Read the start of the last erase block */
 	ret = master->read(master, master->size - master->erasesize,
-			   PAGE_SIZE, &retlen, (void *)buf);
+			   master->erasesize, &retlen, (void *)buf);
 
 	if (ret)
 		goto out;
 
-	if (retlen != PAGE_SIZE) {
+	if (retlen != master->erasesize) {
 		ret = -EIO;
 		goto out;
 	}
@@ -80,7 +84,7 @@ static int parse_redboot_partitions(struct mtd_info *master,
 		goto out;
 	}
 
-	for (i = 0; i < PAGE_SIZE / sizeof(struct fis_image_desc); i++) {
+	for (i = 0; i < master->erasesize / sizeof(struct fis_image_desc); i++) {
 		struct fis_list *new_fl, **prev;
 
 		if (buf[i].name[0] == 0xff)
@@ -112,48 +116,69 @@ static int parse_redboot_partitions(struct mtd_info *master,
 
 		nrparts++;
 	}
-	if (fl->img->flash_base)
+#ifdef CONFIG_MTD_REDBOOT_PARTS_UNALLOCATED
+	if (fl->img->flash_base) {
 		nrparts++;
+		nulllen = sizeof(nullstring);
+	}
 
 	for (tmp_fl = fl; tmp_fl->next; tmp_fl = tmp_fl->next) {
-		if (tmp_fl->img->flash_base + tmp_fl->img->size + master->erasesize < tmp_fl->next->img->flash_base)
+		if (tmp_fl->img->flash_base + tmp_fl->img->size + master->erasesize <= tmp_fl->next->img->flash_base) {
 			nrparts++;
+			nulllen = sizeof(nullstring);
+		}
 	}
-	parts = kmalloc(sizeof(*parts)*nrparts + sizeof(nullstring) + namelen, GFP_KERNEL);
+#endif
+	parts = kmalloc(sizeof(*parts)*nrparts + nulllen + namelen, GFP_KERNEL);
 
 	if (!parts) {
 		ret = -ENOMEM;
 		goto out;
 	}
 
-	memset(parts, 0, sizeof(*parts)*nrparts + namelen);
+	memset(parts, 0, sizeof(*parts)*nrparts + nulllen + namelen);
 
-	/* FIXME: Include nullname only if it's used */
 	nullname = (char *)&parts[nrparts];
-	sprintf(nullname, nullstring);
-	names = nullname + sizeof(nullstring);
+#ifdef CONFIG_MTD_REDBOOT_PARTS_UNALLOCATED
+	if (nulllen > 0) {
+		strcpy(nullname, nullstring);
+	}
+#endif
+	names = nullname + nulllen;
 
 	i=0;
 
+#ifdef CONFIG_MTD_REDBOOT_PARTS_UNALLOCATED
 	if (fl->img->flash_base) {
 	       parts[0].name = nullname;
 	       parts[0].size = fl->img->flash_base;
 	       parts[0].offset = 0;
+		i++;
 	}
+#endif
 	for ( ; i<nrparts; i++) {
 		parts[i].size = fl->img->size;
 		parts[i].offset = fl->img->flash_base;
 		parts[i].name = names;
 
 		strcpy(names, fl->img->name);
+#ifdef CONFIG_MTD_REDBOOT_PARTS_READONLY
+		if (!memcmp(names, "RedBoot", 8) ||
+				!memcmp(names, "RedBoot config", 15) ||
+				!memcmp(names, "FIS directory", 14)) {
+			parts[i].mask_flags = MTD_WRITEABLE;
+		}
+#endif
 		names += strlen(names)+1;
 
-		if(fl->next && fl->img->flash_base + fl->img->size + master->erasesize < fl->next->img->flash_base) {
+#ifdef CONFIG_MTD_REDBOOT_PARTS_UNALLOCATED
+		if(fl->next && fl->img->flash_base + fl->img->size + master->erasesize <= fl->next->img->flash_base) {
 			i++;
 			parts[i].offset = parts[i-1].size + parts[i-1].offset;
 			parts[i].size = fl->next->img->flash_base - parts[i].offset;
 			parts[i].name = nullname;
 		}
+#endif
 		tmp_fl = fl;
 		fl = fl->next;
 		kfree(tmp_fl);
@@ -166,7 +191,7 @@ static int parse_redboot_partitions(struct mtd_info *master,
 		fl = fl->next;
 		kfree(old);
 	}
-	kfree(buf);
+	vfree(buf);
 	return ret;
 }
 
diff --git a/drivers/net/3c501.c b/drivers/net/3c501.c
index 3c731e15c..0c9911563 100644
--- a/drivers/net/3c501.c
+++ b/drivers/net/3c501.c
@@ -225,7 +225,7 @@ static int __init el1_probe1(struct net_device *dev, int ioaddr)
 	 *	Reserve I/O resource for exclusive use by this driver
 	 */
 
-	if (!request_region(ioaddr, EL1_IO_EXTENT, dev->name))
+	if (!request_region(ioaddr, EL1_IO_EXTENT, DRV_NAME))
 		return -ENODEV;
 
 	/*
diff --git a/drivers/net/3c503.c b/drivers/net/3c503.c
index 66644b0eb..c4524decb 100644
--- a/drivers/net/3c503.c
+++ b/drivers/net/3c503.c
@@ -147,6 +147,7 @@ static void cleanup_card(struct net_device *dev)
 	release_region(dev->base_addr, EL2_IO_EXTENT);
 }
 
+#ifndef MODULE
 struct net_device * __init el2_probe(int unit)
 {
 	struct net_device *dev = alloc_ei_netdev();
@@ -171,6 +172,7 @@ out:
 	free_netdev(dev);
 	return ERR_PTR(err);
 }
+#endif
 
 /* Probe for the Etherlink II card at I/O port base IOADDR,
    returning non-zero on success.  If found, set the station
@@ -182,10 +184,10 @@ el2_probe1(struct net_device *dev, int ioaddr)
     static unsigned version_printed;
     unsigned long vendor_id;
 
-    if (!request_region(ioaddr, EL2_IO_EXTENT, dev->name))
+    if (!request_region(ioaddr, EL2_IO_EXTENT, DRV_NAME))
 	return -EBUSY;
 
-    if (!request_region(ioaddr + 0x400, 8, dev->name)) {
+    if (!request_region(ioaddr + 0x400, 8, DRV_NAME)) {
 	retval = -EBUSY;
 	goto out;
     }
diff --git a/drivers/net/3c505.c b/drivers/net/3c505.c
index 9c81e7ba8..3aa8409fe 100644
--- a/drivers/net/3c505.c
+++ b/drivers/net/3c505.c
@@ -1614,6 +1614,7 @@ out:
 	return err;
 }
 
+#ifndef MODULE
 struct net_device * __init elplus_probe(int unit)
 {
 	struct net_device *dev = alloc_etherdev(sizeof(elp_device));
@@ -1632,7 +1633,7 @@ struct net_device * __init elplus_probe(int unit)
 	return dev;
 }
 
-#ifdef MODULE
+#else
 static struct net_device *dev_3c505[ELP_MAX_CARDS];
 static int io[ELP_MAX_CARDS];
 static int irq[ELP_MAX_CARDS];
diff --git a/drivers/net/3c507.c b/drivers/net/3c507.c
index bfd4ad080..ca0d71d63 100644
--- a/drivers/net/3c507.c
+++ b/drivers/net/3c507.c
@@ -373,7 +373,7 @@ static int __init el16_probe1(struct net_device *dev, int ioaddr)
 		init_ID_done = 1;
 	}
 
-	if (!request_region(ioaddr, EL16_IO_EXTENT, dev->name))
+	if (!request_region(ioaddr, EL16_IO_EXTENT, DRV_NAME))
 		return -ENODEV;
 
 	if ((inb(ioaddr) != '*') || (inb(ioaddr + 1) != '3') || 
@@ -392,7 +392,7 @@ static int __init el16_probe1(struct net_device *dev, int ioaddr)
 
 	irq = inb(ioaddr + IRQ_CONFIG) & 0x0f;
 
-	irqval = request_irq(irq, &el16_interrupt, 0, dev->name, dev);
+	irqval = request_irq(irq, &el16_interrupt, 0, DRV_NAME, dev);
 	if (irqval) {
 		printk ("unable to get IRQ %d (irqval=%d).\n", irq, irqval);
 		retval = -EAGAIN;
diff --git a/drivers/net/3c509.c b/drivers/net/3c509.c
index ab7ee8837..388929551 100644
--- a/drivers/net/3c509.c
+++ b/drivers/net/3c509.c
@@ -56,10 +56,6 @@
 		v1.19b 08Nov2002 Marc Zyngier <maz@wild-wind.fr.eu.org>
 		    - Introduce driver model for EISA cards.
 */
-/*
-  FIXES for PC-9800:
-  Shu Iwanaga: 3c569B(PC-9801 C-bus) support
-*/
 
 #define DRV_NAME	"3c509"
 #define DRV_VERSION	"1.19b"
@@ -265,7 +261,7 @@ static struct mca_driver el3_mca_driver = {
 };
 #endif /* CONFIG_MCA */
 
-#if defined(__ISAPNP__) && !defined(CONFIG_X86_PC9800)
+#if defined(__ISAPNP__)
 static struct isapnp_device_id el3_isapnp_adapters[] __initdata = {
 	{	ISAPNP_ANY_ID, ISAPNP_ANY_ID,
 		ISAPNP_VENDOR('T', 'C', 'M'), ISAPNP_FUNCTION(0x5090),
@@ -362,7 +358,7 @@ static void el3_common_remove (struct net_device *dev)
 	if (lp->pmdev)
 		pm_unregister(lp->pmdev);
 #endif
-#if defined(__ISAPNP__) && !defined(CONFIG_X86_PC9800)
+#if defined(__ISAPNP__)
 	if (lp->type == EL3_PNP)
 		pnp_device_detach(to_pnp_dev(lp->dev));
 #endif
@@ -381,7 +377,7 @@ static int __init el3_probe(int card_idx)
 	u16 phys_addr[3];
 	static int current_tag;
 	int err = -ENODEV;
-#if defined(__ISAPNP__) && !defined(CONFIG_X86_PC9800)
+#if defined(__ISAPNP__)
 	static int pnp_cards;
 	struct pnp_dev *idev = NULL;
 
@@ -436,9 +432,6 @@ __again:
 no_pnp:
 #endif /* __ISAPNP__ */
 
-#ifdef CONFIG_X86_PC9800
-	id_port = 0x71d0;
-#else
 	/* Select an open I/O location at 0x1*0 to do contention select. */
 	for ( ; id_port < 0x200; id_port += 0x10) {
 		if (!request_region(id_port, 1, "3c509"))
@@ -456,7 +449,7 @@ no_pnp:
 		printk(" WARNING: No I/O port available for 3c509 activation.\n");
 		return -ENODEV;
 	}
-#endif /* CONFIG_X86_PC9800 */
+
 	/* Next check for all ISA bus boards by sending the ID sequence to the
 	   ID_PORT.  We find cards past the first by setting the 'current_tag'
 	   on cards as they are found.  Cards with their tag set will not
@@ -487,7 +480,7 @@ no_pnp:
 		phys_addr[i] = htons(id_read_eeprom(i));
 	}
 
-#if defined(__ISAPNP__) && !defined(CONFIG_X86_PC9800)
+#if defined(__ISAPNP__)
 	if (nopnp == 0) {
 		/* The ISA PnP 3c509 cards respond to the ID sequence.
 		   This check is needed in order not to register them twice. */
@@ -512,19 +505,9 @@ no_pnp:
 	{
 		unsigned int iobase = id_read_eeprom(8);
 		if_port = iobase >> 14;
-#ifdef CONFIG_X86_PC9800
-		ioaddr = 0x40d0 + ((iobase & 0x1f) << 8);
-#else
 		ioaddr = 0x200 + ((iobase & 0x1f) << 4);
-#endif
 	}
 	irq = id_read_eeprom(9) >> 12;
-#ifdef CONFIG_X86_PC9800
-	if (irq == 7)
-		irq = 6;
-	else if (irq == 15)
-		irq = 13;
-#endif
 
 	dev = alloc_etherdev(sizeof (struct el3_private));
 	if (!dev)
@@ -555,11 +538,7 @@ no_pnp:
 	outb(0xd0 + ++current_tag, id_port);
 
 	/* Activate the adaptor at the EEPROM location. */
-#ifdef CONFIG_X86_PC9800
-	outb((ioaddr >> 8) | 0xe0, id_port);
-#else
 	outb((ioaddr >> 4) | 0xe0, id_port);
-#endif
 
 	EL3WINDOW(0);
 	if (inw(ioaddr) != 0x6d50)
@@ -568,7 +547,7 @@ no_pnp:
 	/* Free the interrupt so that some other card can use it. */
 	outw(0x0f00, ioaddr + WN0_IRQ);
 
-#if defined(__ISAPNP__) && !defined(CONFIG_X86_PC9800)
+#if defined(__ISAPNP__)
  found:							/* PNP jumps here... */
 #endif /* __ISAPNP__ */
 
@@ -577,7 +556,7 @@ no_pnp:
 	dev->irq = irq;
 	dev->if_port = if_port;
 	lp = netdev_priv(dev);
-#if defined(__ISAPNP__) && !defined(CONFIG_X86_PC9800)
+#if defined(__ISAPNP__)
 	lp->dev = &idev->dev;
 #endif
 	err = el3_common_init(dev);
@@ -601,7 +580,7 @@ no_pnp:
 	return 0;
 
 out1:
-#if defined(__ISAPNP__) && !defined(CONFIG_X86_PC9800)
+#if defined(__ISAPNP__)
 	if (idev)
 		pnp_device_detach(idev);
 #endif
@@ -1461,12 +1440,6 @@ el3_up(struct net_device *dev)
 	outw(0x0001, ioaddr + 4);
 
 	/* Set the IRQ line. */
-#ifdef CONFIG_X86_PC9800
-	if (dev->irq == 6)
-		dev->irq = 7;
-	else if (dev->irq == 13)
-		dev->irq = 15;
-#endif
 	outw((dev->irq << 12) | 0x0f00, ioaddr + WN0_IRQ);
 
 	/* Set the station address in window 2 each time opened. */
@@ -1629,7 +1602,7 @@ MODULE_PARM_DESC(debug, "debug level (0-6)");
 MODULE_PARM_DESC(irq, "IRQ number(s) (assigned)");
 MODULE_PARM_DESC(xcvr,"transceiver(s) (0=internal, 1=external)");
 MODULE_PARM_DESC(max_interrupt_work, "maximum events handled per interrupt");
-#if defined(__ISAPNP__) && !defined(CONFIG_X86_PC9800)
+#if defined(__ISAPNP__)
 MODULE_PARM(nopnp, "i");
 MODULE_PARM_DESC(nopnp, "disable ISA PnP support (0-1)");
 MODULE_DEVICE_TABLE(isapnp, el3_isapnp_adapters);
diff --git a/drivers/net/3c515.c b/drivers/net/3c515.c
index fc86a3538..bcdc0d608 100644
--- a/drivers/net/3c515.c
+++ b/drivers/net/3c515.c
@@ -831,7 +831,7 @@ static int corkscrew_open(struct net_device *dev)
 		outb(PKT_BUF_SZ >> 8, ioaddr + TxFreeThreshold);	/* Room for a packet. */
 		/* Clear the Tx ring. */
 		for (i = 0; i < TX_RING_SIZE; i++)
-			vp->tx_skbuff[i] = 0;
+			vp->tx_skbuff[i] = NULL;
 		outl(0, ioaddr + DownListPtr);
 	}
 	/* Set receiver mode: presumably accept b-case and phys addr only. */
@@ -1174,7 +1174,7 @@ static irqreturn_t corkscrew_interrupt(int irq, void *dev_id,
 					break;	/* It still hasn't been processed. */
 				if (lp->tx_skbuff[entry]) {
 					dev_kfree_skb_irq(lp->tx_skbuff[entry]);
-					lp->tx_skbuff[entry] = 0;
+					lp->tx_skbuff[entry] = NULL;
 				}
 				dirty_tx++;
 			}
@@ -1458,7 +1458,7 @@ static int corkscrew_close(struct net_device *dev)
 		for (i = 0; i < RX_RING_SIZE; i++)
 			if (vp->rx_skbuff[i]) {
 				dev_kfree_skb(vp->rx_skbuff[i]);
-				vp->rx_skbuff[i] = 0;
+				vp->rx_skbuff[i] = NULL;
 			}
 	}
 	if (vp->full_bus_master_tx) {	/* Free Boomerang bus master Tx buffers. */
@@ -1466,7 +1466,7 @@ static int corkscrew_close(struct net_device *dev)
 		for (i = 0; i < TX_RING_SIZE; i++)
 			if (vp->tx_skbuff[i]) {
 				dev_kfree_skb(vp->tx_skbuff[i]);
-				vp->tx_skbuff[i] = 0;
+				vp->tx_skbuff[i] = NULL;
 			}
 	}
 
diff --git a/drivers/net/3c523.c b/drivers/net/3c523.c
index d47922321..1902f7921 100644
--- a/drivers/net/3c523.c
+++ b/drivers/net/3c523.c
@@ -445,7 +445,7 @@ static int __init do_elmc_probe(struct net_device *dev)
 			slot = mca_find_adapter(ELMC_MCA_ID, slot + 1);
 			continue;
 		}
-		if (!request_region(dev->base_addr, ELMC_IO_EXTENT, dev->name)) {
+		if (!request_region(dev->base_addr, ELMC_IO_EXTENT, DRV_NAME)) {
 			slot = mca_find_adapter(ELMC_MCA_ID, slot + 1);
 			continue;
 		}
@@ -585,6 +585,7 @@ static void cleanup_card(struct net_device *dev)
 	release_region(dev->base_addr, ELMC_IO_EXTENT);
 }
 
+#ifndef MODULE
 struct net_device * __init elmc_probe(int unit)
 {
 	struct net_device *dev = alloc_etherdev(sizeof(struct priv));
@@ -609,6 +610,7 @@ out:
 	free_netdev(dev);
 	return ERR_PTR(err);
 }
+#endif
 
 /**********************************************
  * init the chip (elmc-interrupt should be disabled?!)
diff --git a/drivers/net/3c527.c b/drivers/net/3c527.c
index a3b67aef2..c6f1995e0 100644
--- a/drivers/net/3c527.c
+++ b/drivers/net/3c527.c
@@ -435,10 +435,10 @@ static int __init mc32_probe1(struct net_device *dev, int slot)
 	 *	Grab the IRQ
 	 */
 
-	err = request_irq(dev->irq, &mc32_interrupt, SA_SHIRQ | SA_SAMPLE_RANDOM, dev->name, dev);
+	err = request_irq(dev->irq, &mc32_interrupt, SA_SHIRQ | SA_SAMPLE_RANDOM, DRV_NAME, dev);
 	if (err) {
 		release_region(dev->base_addr, MC32_IO_EXTENT);
-		printk(KERN_ERR "%s: unable to get IRQ %d.\n", dev->name, dev->irq);
+		printk(KERN_ERR "%s: unable to get IRQ %d.\n", DRV_NAME, dev->irq);
 		goto err_exit_ports;
 	}
 
diff --git a/drivers/net/3c59x.c b/drivers/net/3c59x.c
index a450864a9..ab2e61a9d 100644
--- a/drivers/net/3c59x.c
+++ b/drivers/net/3c59x.c
@@ -238,12 +238,6 @@ static int vortex_debug = VORTEX_DEBUG;
 static int vortex_debug = 1;
 #endif
 
-#ifndef __OPTIMIZE__
-#error You must compile this file with the correct options!
-#error See the last lines of the source file.
-#error You must compile this driver with "-O".
-#endif
-
 #include <linux/config.h>
 #include <linux/module.h>
 #include <linux/kernel.h>
@@ -446,6 +440,7 @@ enum vortex_chips {
 	CH_3C905B_2,
 	CH_3C905B_FX,
 	CH_3C905C,
+	CH_3C9202,
 	CH_3C980,
 	CH_3C9805,
 
@@ -520,12 +515,14 @@ static struct vortex_chip_info {
 	{"3c905B-FX Cyclone 100baseFx",
 	 PCI_USES_IO|PCI_USES_MASTER, IS_CYCLONE|HAS_HWCKSM, 128, },
 	{"3c905C Tornado",
-	 PCI_USES_IO|PCI_USES_MASTER, IS_TORNADO|HAS_NWAY|HAS_HWCKSM, 128, },
+	PCI_USES_IO|PCI_USES_MASTER, IS_TORNADO|HAS_NWAY|HAS_HWCKSM|EXTRA_PREAMBLE, 128, },
+	{"3c920B-EMB-WNM (ATI Radeon 9100 IGP)",
+	 PCI_USES_IO|PCI_USES_MASTER, IS_TORNADO|HAS_MII|HAS_HWCKSM, 128, },
 	{"3c980 Cyclone",
 	 PCI_USES_IO|PCI_USES_MASTER, IS_CYCLONE|HAS_HWCKSM, 128, },
+
 	{"3c980C Python-T",
 	 PCI_USES_IO|PCI_USES_MASTER, IS_CYCLONE|HAS_NWAY|HAS_HWCKSM, 128, },
-
 	{"3cSOHO100-TX Hurricane",
 	 PCI_USES_IO|PCI_USES_MASTER, IS_CYCLONE|HAS_NWAY|HAS_HWCKSM, 128, },
 	{"3c555 Laptop Hurricane",
@@ -536,9 +533,9 @@ static struct vortex_chip_info {
 	{"3c556B Laptop Hurricane",
 	 PCI_USES_IO|PCI_USES_MASTER, IS_TORNADO|HAS_NWAY|EEPROM_OFFSET|HAS_CB_FNS|INVERT_MII_PWR|
 	                                WNO_XCVR_PWR|HAS_HWCKSM, 128, },
+
 	{"3c575 [Megahertz] 10/100 LAN 	CardBus",
 	PCI_USES_IO|PCI_USES_MASTER, IS_BOOMERANG|HAS_MII|EEPROM_8BIT, 128, },
-
 	{"3c575 Boomerang CardBus",
 	 PCI_USES_IO|PCI_USES_MASTER, IS_BOOMERANG|HAS_MII|EEPROM_8BIT, 128, },
 	{"3CCFE575BT Cyclone CardBus",
@@ -550,10 +547,10 @@ static struct vortex_chip_info {
 	{"3CCFE656 Cyclone CardBus",
 	 PCI_USES_IO|PCI_USES_MASTER, IS_CYCLONE|HAS_NWAY|HAS_CB_FNS|EEPROM_8BIT|INVERT_MII_PWR|
 									INVERT_LED_PWR|HAS_HWCKSM, 128, },
+
 	{"3CCFEM656B Cyclone+Winmodem CardBus",
 	 PCI_USES_IO|PCI_USES_MASTER, IS_CYCLONE|HAS_NWAY|HAS_CB_FNS|EEPROM_8BIT|INVERT_MII_PWR|
 									INVERT_LED_PWR|HAS_HWCKSM, 128, },
-
 	{"3CXFEM656C Tornado+Winmodem CardBus",			/* From pcmcia-cs-3.1.5 */
 	 PCI_USES_IO|PCI_USES_MASTER, IS_TORNADO|HAS_NWAY|HAS_CB_FNS|EEPROM_8BIT|INVERT_MII_PWR|
 									MAX_COLLISION_RESET|HAS_HWCKSM, 128, },
@@ -563,15 +560,15 @@ static struct vortex_chip_info {
 	 PCI_USES_IO|PCI_USES_MASTER, IS_TORNADO|HAS_NWAY|HAS_HWCKSM, 128, },
 	{"3c982 Hydra Dual Port A",
 	 PCI_USES_IO|PCI_USES_MASTER, IS_TORNADO|HAS_HWCKSM|HAS_NWAY, 128, },
+
 	{"3c982 Hydra Dual Port B",
 	 PCI_USES_IO|PCI_USES_MASTER, IS_TORNADO|HAS_HWCKSM|HAS_NWAY, 128, },
-
 	{"3c905B-T4",
 	 PCI_USES_IO|PCI_USES_MASTER, IS_CYCLONE|HAS_NWAY|HAS_HWCKSM|EXTRA_PREAMBLE, 128, },
 	{"3c920B-EMB-WNM Tornado",
 	 PCI_USES_IO|PCI_USES_MASTER, IS_TORNADO|HAS_NWAY|HAS_HWCKSM, 128, },
 
-	{0,}, /* 0 terminated list. */
+	{NULL,}, /* NULL terminated list. */
 };
 
 
@@ -597,6 +594,7 @@ static struct pci_device_id vortex_pci_tbl[] = {
 	{ 0x10B7, 0x9058, PCI_ANY_ID, PCI_ANY_ID, 0, 0, CH_3C905B_2 },
 	{ 0x10B7, 0x905A, PCI_ANY_ID, PCI_ANY_ID, 0, 0, CH_3C905B_FX },
 	{ 0x10B7, 0x9200, PCI_ANY_ID, PCI_ANY_ID, 0, 0, CH_3C905C },
+	{ 0x10B7, 0x9202, PCI_ANY_ID, PCI_ANY_ID, 0, 0, CH_3C9202 },
 	{ 0x10B7, 0x9800, PCI_ANY_ID, PCI_ANY_ID, 0, 0, CH_3C980 },
 	{ 0x10B7, 0x9805, PCI_ANY_ID, PCI_ANY_ID, 0, 0, CH_3C9805 },
 
@@ -884,7 +882,7 @@ static struct media_table {
 static int vortex_probe1(struct device *gendev, long ioaddr, int irq,
 				   int chip_idx, int card_idx);
 static void vortex_up(struct net_device *dev);
-static void vortex_down(struct net_device *dev);
+static void vortex_down(struct net_device *dev, int final);
 static int vortex_open(struct net_device *dev);
 static void mdio_sync(long ioaddr, int bits);
 static int mdio_read(struct net_device *dev, int phy_id, int location);
@@ -948,7 +946,7 @@ static int vortex_suspend (struct pci_dev *pdev, u32 state)
 	if (dev && dev->priv) {
 		if (netif_running(dev)) {
 			netif_device_detach(dev);
-			vortex_down(dev);
+			vortex_down(dev, 1);
 		}
 	}
 	return 0;
@@ -1697,7 +1695,7 @@ vortex_up(struct net_device *dev)
 		for (i = 0; i < RX_RING_SIZE; i++)	/* AKPM: this is done in vortex_open, too */
 			vp->rx_ring[i].status = 0;
 		for (i = 0; i < TX_RING_SIZE; i++)
-			vp->tx_skbuff[i] = 0;
+			vp->tx_skbuff[i] = NULL;
 		outl(0, ioaddr + DownListPtr);
 	}
 	/* Set receiver mode: presumably accept b-case and phys addr only. */
@@ -1762,7 +1760,7 @@ vortex_open(struct net_device *dev)
 			for (j = 0; j < i; j++) {
 				if (vp->rx_skbuff[j]) {
 					dev_kfree_skb(vp->rx_skbuff[j]);
-					vp->rx_skbuff[j] = 0;
+					vp->rx_skbuff[j] = NULL;
 				}
 			}
 			retval = -ENOMEM;
@@ -1940,9 +1938,9 @@ static void vortex_tx_timeout(struct net_device *dev)
 			unsigned long flags;
 			local_irq_save(flags);
 			if (vp->full_bus_master_tx)
-				boomerang_interrupt(dev->irq, dev, 0);
+				boomerang_interrupt(dev->irq, dev, NULL);
 			else
-				vortex_interrupt(dev->irq, dev, 0);
+				vortex_interrupt(dev->irq, dev, NULL);
 			local_irq_restore(flags);
 		}
 	}
@@ -2059,7 +2057,8 @@ vortex_error(struct net_device *dev, int status)
 				printk(KERN_ERR "%s: PCI bus error, bus status %8.8x\n", dev->name, bus_status);
 
 			/* In this case, blow the card away */
-			vortex_down(dev);
+			/* Must not enter D3 or we can't legally issue the reset! */
+			vortex_down(dev, 0);
 			issue_and_wait(dev, TotalReset | 0xff);
 			vortex_up(dev);		/* AKPM: bug.  vortex_up() assumes that the rx ring is full. It may not be. */
 		} else if (fifo_diag & 0x0400)
@@ -2420,7 +2419,7 @@ boomerang_interrupt(int irq, void *dev_id, struct pt_regs *regs)
 						le32_to_cpu(vp->tx_ring[entry].addr), skb->len, PCI_DMA_TODEVICE);
 #endif
 					dev_kfree_skb_irq(skb);
-					vp->tx_skbuff[entry] = 0;
+					vp->tx_skbuff[entry] = NULL;
 				} else {
 					printk(KERN_DEBUG "boomerang_interrupt: no skb!\n");
 				}
@@ -2656,7 +2655,7 @@ rx_oom_timer(unsigned long arg)
 }
 
 static void
-vortex_down(struct net_device *dev)
+vortex_down(struct net_device *dev, int final_down)
 {
 	struct vortex_private *vp = netdev_priv(dev);
 	long ioaddr = dev->base_addr;
@@ -2685,7 +2684,7 @@ vortex_down(struct net_device *dev)
 	if (vp->full_bus_master_tx)
 		outl(0, ioaddr + DownListPtr);
 
-	if (VORTEX_PCI(vp) && vp->enable_wol) {
+	if (final_down && VORTEX_PCI(vp) && vp->enable_wol) {
 		pci_save_state(VORTEX_PCI(vp), vp->power_state);
 		acpi_set_WOL(dev);
 	}
@@ -2699,7 +2698,7 @@ vortex_close(struct net_device *dev)
 	int i;
 
 	if (netif_device_present(dev))
-		vortex_down(dev);
+		vortex_down(dev, 1);
 
 	if (vortex_debug > 1) {
 		printk(KERN_DEBUG"%s: vortex_close() status %4.4x, Tx status %2.2x.\n",
@@ -2725,7 +2724,7 @@ vortex_close(struct net_device *dev)
 				pci_unmap_single(	VORTEX_PCI(vp), le32_to_cpu(vp->rx_ring[i].addr),
 									PKT_BUF_SZ, PCI_DMA_FROMDEVICE);
 				dev_kfree_skb(vp->rx_skbuff[i]);
-				vp->rx_skbuff[i] = 0;
+				vp->rx_skbuff[i] = NULL;
 			}
 	}
 	if (vp->full_bus_master_tx) { /* Free Boomerang bus master Tx buffers. */
@@ -2744,7 +2743,7 @@ vortex_close(struct net_device *dev)
 				pci_unmap_single(VORTEX_PCI(vp), le32_to_cpu(vp->tx_ring[i].addr), skb->len, PCI_DMA_TODEVICE);
 #endif
 				dev_kfree_skb(skb);
-				vp->tx_skbuff[i] = 0;
+				vp->tx_skbuff[i] = NULL;
 			}
 		}
 	}
@@ -2869,7 +2868,7 @@ static struct ethtool_ops vortex_ethtool_ops = {
 	.get_drvinfo =		vortex_get_drvinfo,
 };
 
-static int vortex_ioctl(struct net_device *dev, struct ifreq *rq, int cmd)
+static int vortex_do_ioctl(struct net_device *dev, struct ifreq *rq, int cmd)
 {
 	struct vortex_private *vp = netdev_priv(dev);
 	long ioaddr = dev->base_addr;
@@ -2904,6 +2903,30 @@ static int vortex_ioctl(struct net_device *dev, struct ifreq *rq, int cmd)
 	return retval;
 }
 
+/*
+ *	Must power the device up to do MDIO operations
+ */
+static int vortex_ioctl(struct net_device *dev, struct ifreq *rq, int cmd)
+{
+	int err;
+	struct vortex_private *vp = netdev_priv(dev);
+	int state = 0;
+
+	if(VORTEX_PCI(vp))
+		state = VORTEX_PCI(vp)->current_state;
+
+	/* The kernel core really should have pci_get_power_state() */
+
+	if(state != 0)
+		pci_set_power_state(VORTEX_PCI(vp), 0);
+	err = vortex_do_ioctl(dev, rq, cmd);
+	if(state != 0)
+		pci_set_power_state(VORTEX_PCI(vp), state);
+
+	return err;
+}
+
+
 /* Pre-Cyclone chips have no documented multicast filter, so the only
    multicast setting is to receive all multicast frames.  At least
    the chip has a very clean way to set the mode, unlike many others. */
@@ -3059,14 +3082,14 @@ static void __devexit vortex_remove_one (struct pci_dev *pdev)
 	 * here
 	 */
 	unregister_netdev(dev);
-	/* Should really use issue_and_wait() here */
-	outw(TotalReset|0x14, dev->base_addr + EL3_CMD);
 
 	if (VORTEX_PCI(vp) && vp->enable_wol) {
 		pci_set_power_state(VORTEX_PCI(vp), 0);	/* Go active */
 		if (vp->pm_state_valid)
 			pci_restore_state(VORTEX_PCI(vp), vp->power_state);
 	}
+	/* Should really use issue_and_wait() here */
+	outw(TotalReset|0x14, dev->base_addr + EL3_CMD);
 
 	pci_free_consistent(pdev,
 						sizeof(struct boom_rx_desc) * RX_RING_SIZE
diff --git a/drivers/net/8139too.c b/drivers/net/8139too.c
index 83a1bd11b..58290c5bb 100644
--- a/drivers/net/8139too.c
+++ b/drivers/net/8139too.c
@@ -87,8 +87,6 @@
 		"rtl8139-diag -mmmaaavvveefN" output
 		enable RTL8139_DEBUG below, and look at 'dmesg' or kernel log
 
-		See 8139too.txt for more details.
-
 */
 
 #define DRV_NAME	"8139too"
@@ -779,7 +777,7 @@ static int __devinit rtl8139_init_board (struct pci_dev *pdev,
 	u8 tmp8;
 	int rc;
 	unsigned int i;
-	u32 pio_start, pio_end, pio_flags, pio_len;
+	unsigned long pio_start, pio_end, pio_flags, pio_len;
 	unsigned long mmio_start, mmio_end, mmio_flags, mmio_len;
 	u32 version;
 
diff --git a/drivers/net/82596.c b/drivers/net/82596.c
index 92cf5e0d7..c835712ed 100644
--- a/drivers/net/82596.c
+++ b/drivers/net/82596.c
@@ -58,11 +58,12 @@
 #include <asm/io.h>
 #include <asm/dma.h>
 #include <asm/pgtable.h>
-#include <asm/pgalloc.h>
 
 static char version[] __initdata =
 	"82596.c $Revision: 1.5 $\n";
 
+#define DRV_NAME	"82596"
+
 /* DEBUG flags
  */
 
@@ -618,7 +619,7 @@ static int init_i596_mem(struct net_device *dev)
 #endif
 	unsigned long flags;
 
-	MPU_PORT(dev, PORT_RESET, 0);
+	MPU_PORT(dev, PORT_RESET, NULL);
 
 	udelay(100);		/* Wait 100us - seems to help */
 
@@ -759,7 +760,7 @@ static int init_i596_mem(struct net_device *dev)
 
 failed:
 	printk(KERN_CRIT "%s: Failed to initialise 82596\n", dev->name);
-	MPU_PORT(dev, PORT_RESET, 0);
+	MPU_PORT(dev, PORT_RESET, NULL);
 	return -1;
 }
 
@@ -1191,7 +1192,7 @@ struct net_device * __init i82596_probe(int unit)
 		/* this is easy the ethernet interface can only be at 0x300 */
 		/* first check nothing is already registered here */
 
-		if (!request_region(ioaddr, I596_TOTAL_SIZE, dev->name)) {
+		if (!request_region(ioaddr, I596_TOTAL_SIZE, DRV_NAME)) {
 			printk(KERN_ERR "82596: IO address 0x%04x in use\n", ioaddr);
 			err = -EBUSY;
 			goto out;
diff --git a/drivers/net/Kconfig b/drivers/net/Kconfig
index 23ae50c44..882837793 100644
--- a/drivers/net/Kconfig
+++ b/drivers/net/Kconfig
@@ -234,7 +234,7 @@ config BMAC
 
 config OAKNET
 	tristate "National DP83902AV (Oak ethernet) support"
-	depends on NET_ETHERNET && PPC
+	depends on NET_ETHERNET && PPC && BROKEN
 	select CRC32
 	help
 	  Say Y if your machine has this type of Ethernet network card.
@@ -666,7 +666,7 @@ config 3C515
 
 config ELMC
 	tristate "3c523 \"EtherLink/MC\" support"
-	depends on NET_VENDOR_3COM && MCA
+	depends on NET_VENDOR_3COM && MCA_LEGACY
 	help
 	  If you have a network (Ethernet) card of this type, say Y and read
 	  the Ethernet-HOWTO, available from
@@ -813,6 +813,24 @@ config ULTRA32
 	  <file:Documentation/networking/net-modules.txt>. The module
 	  will be called smc-ultra32.
 
+config SMC91X
+	tristate "SMC 91C9x/91C1xxx support"
+	select CRC32
+	select MII
+	depends on NET_ETHERNET && (ARM || REDWOOD_5 || REDWOOD_6)
+	help
+	  This is a driver for SMC's 91x series of Ethernet chipsets,
+	  including the SMC91C94 and the SMC91C111. Say Y if you want it
+	  compiled into the kernel, and read the file
+	  <file:Documentation/networking/smc9.txt>  and the Ethernet-HOWTO,
+	  available from  <http://www.linuxdoc.org/docs.html#howto>.
+
+	  This driver 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 smc91x.  If you want to compile it as a
+	  module, say M here and read <file:Documentation/modules.txt> as well
+	  as <file:Documentation/networking/net-modules.txt>.
+
 config SMC9194
 	tristate "SMC 9194 support"
 	depends on NET_VENDOR_SMC && (ISA || MAC && BROKEN)
@@ -883,7 +901,7 @@ source "drivers/net/tulip/Kconfig"
 
 config AT1700
 	tristate "AT1700/1720/RE1000Plus(C-Bus) support (EXPERIMENTAL)"
-	depends on NET_ETHERNET && (ISA || MCA) && EXPERIMENTAL
+	depends on NET_ETHERNET && (ISA || MCA_LEGACY) && EXPERIMENTAL
 	select CRC32
 	---help---
 	  If you have a network (Ethernet) card of this type, say Y and read
@@ -922,7 +940,7 @@ config HP100
 
 config NET_ISA
 	bool "Other ISA cards"
-	depends on NET_ETHERNET && ISA && !X86_PC9800
+	depends on NET_ETHERNET && ISA
 	---help---
 	  If your network (Ethernet) card hasn't been mentioned yet and its
 	  bus system (that's the way the cards talks to the other components
@@ -1105,56 +1123,6 @@ config SK_G16
 	  the Ethernet-HOWTO, available from
 	  <http://www.tldp.org/docs.html#howto>.
 
-config NET_CBUS
-	bool "NEC PC-9800 C-bus cards"
-	depends on NET_ETHERNET && ISA && X86_PC9800
-	---help---
-	  If your network (Ethernet) card hasn't been mentioned yet and its
-	  bus system (that's the way the cards talks to the other components
-	  of your computer) is NEC PC-9800 C-Bus, say Y.
-
-config NE2K_CBUS
-	tristate "Most NE2000-based Ethernet support"
-	depends on NET_CBUS
-	select CRC32
-
-config NE2K_CBUS_EGY98
-	bool "Melco EGY-98 support"
-	depends on NE2K_CBUS
-
-config NE2K_CBUS_LGY98
-	bool "Melco LGY-98 support"
-	depends on NE2K_CBUS
-
-config NE2K_CBUS_ICM
-	bool "ICM IF-27xxET support"
-	depends on NE2K_CBUS
-
-config NE2K_CBUS_IOLA98
-	bool "I-O DATA LA-98 support"
-	depends on NE2K_CBUS
-
-config NE2K_CBUS_CNET98EL
-	bool "Contec C-NET(98)E/L support"
-	depends on NE2K_CBUS
-
-config NE2K_CBUS_CNET98EL_IO_BASE
-	hex "C-NET(98)E/L I/O base address (0xaaed or 0x55ed)"
-	depends on NE2K_CBUS_CNET98EL
-	default "0xaaed"
-
-config NE2K_CBUS_ATLA98
-	bool "Allied Telesis LA-98 Support"
-	depends on NE2K_CBUS
-
-config NE2K_CBUS_BDN
-	bool "ELECOM Laneed LD-BDN[123]A Support"
-	depends on NE2K_CBUS
-
-config NE2K_CBUS_NEC108
-	bool "NEC PC-9801-108 Support"
-	depends on NE2K_CBUS
-
 config SKMC
 	tristate "SKnet MCA support"
 	depends on NET_ETHERNET && MCA && BROKEN
@@ -1172,7 +1140,7 @@ config SKMC
 
 config NE2_MCA
 	tristate "NE/2 (ne2000 MCA version) support"
-	depends on NET_ETHERNET && MCA
+	depends on NET_ETHERNET && MCA_LEGACY
 	select CRC32
 	help
 	  If you have a network (Ethernet) card of this type, say Y and read
@@ -1287,6 +1255,19 @@ config AMD8111_ETH
 config AMD8111E_NAPI
 	bool "Enable NAPI support"
 	depends on AMD8111_ETH
+	help
+	  NAPI is a new driver API designed to reduce CPU and interrupt load
+	  when the driver is receiving lots of packets from the card. It is
+	  still somewhat experimental and thus not yet enabled by default.
+
+	  If your estimated Rx load is 10kpps or more, or if the card will be
+	  deployed on potentially unfriendly networks (e.g. in a firewall),
+	  then say Y here.
+
+	  See <file:Documentation/networking/NAPI_HOWTO.txt> for more
+	  information.
+
+	  If in doubt, say N.
 
 config ADAPTEC_STARFIRE
 	tristate "Adaptec Starfire/DuraLAN support"
@@ -1314,6 +1295,11 @@ config ADAPTEC_STARFIRE_NAPI
 	  deployed on potentially unfriendly networks (e.g. in a firewall),
 	  then say Y here.
 
+	  See <file:Documentation/networking/NAPI_HOWTO.txt> for more
+	  information.
+
+	  If in doubt, say N.
+
 config AC3200
 	tristate "Ansel Communications EISA 3200 support (EXPERIMENTAL)"
 	depends on NET_PCI && (ISA || EISA) && EXPERIMENTAL
@@ -1501,6 +1487,19 @@ config E100
 config E100_NAPI
 	bool "Use Rx Polling (NAPI)"
 	depends on E100
+	help
+	  NAPI is a new driver API designed to reduce CPU and interrupt load
+	  when the driver is receiving lots of packets from the card. It is
+	  still somewhat experimental and thus not yet enabled by default.
+
+	  If your estimated Rx load is 10kpps or more, or if the card will be
+	  deployed on potentially unfriendly networks (e.g. in a firewall),
+	  then say Y here.
+
+	  See <file:Documentation/networking/NAPI_HOWTO.txt> for more
+	  information.
+
+	  If in doubt, say N.
 
 config LNE390
 	tristate "Mylex EISA LNE390A/B support (EXPERIMENTAL)"
@@ -1605,9 +1604,7 @@ config 8139TOO
 	---help---
 	  This is a driver for the Fast Ethernet PCI network cards based on
 	  the RTL8139 chips. If you have one of those, say Y and read
-	  <file:Documentation/networking/8139too.txt> as well as the
-	  Ethernet-HOWTO, available from
-	  <http://www.tldp.org/docs.html#howto>.
+	  the Ethernet-HOWTO <http://www.tldp.org/docs.html#howto>.
 
 	  To compile this driver as a module, choose M here: the module
 	  will be called 8139too.  This is recommended.
@@ -1745,6 +1742,17 @@ config VIA_RHINE_MMIO
 
 	  If unsure, say Y.
 
+config VIA_VELOCITY
+	tristate "VIA Velocity support"
+	depends on NET_PCI && PCI
+	select CRC32
+	select MII
+	help
+	  If you have a VIA "Velocity" based network card say Y here.
+
+	  To compile this driver as a module, choose M here. The module
+	  will be called via-rhine.
+
 config LAN_SAA9730
 	bool "Philips SAA9730 Ethernet support (EXPERIMENTAL)"
 	depends on NET_PCI && EXPERIMENTAL && MIPS
@@ -1868,6 +1876,8 @@ config NE_H8300
 	  Say Y here if you want to use the NE2000 compatible
 	  controller on the Renesas H8/300 processor.
 
+source "drivers/net/fec_8xx/Kconfig"
+
 endmenu
 
 #
@@ -1963,6 +1973,19 @@ config E1000
 config E1000_NAPI
 	bool "Use Rx Polling (NAPI)"
 	depends on E1000
+	help
+	  NAPI is a new driver API designed to reduce CPU and interrupt load
+	  when the driver is receiving lots of packets from the card. It is
+	  still somewhat experimental and thus not yet enabled by default.
+
+	  If your estimated Rx load is 10kpps or more, or if the card will be
+	  deployed on potentially unfriendly networks (e.g. in a firewall),
+	  then say Y here.
+
+	  See <file:Documentation/networking/NAPI_HOWTO.txt> for more
+	  information.
+
+	  If in doubt, say N.
 
 config MYRI_SBUS
 	tristate "MyriCOM Gigabit Ethernet support"
@@ -2148,6 +2171,19 @@ config IXGB
 config IXGB_NAPI
 	bool "Use Rx Polling (NAPI) (EXPERIMENTAL)"
 	depends on IXGB && EXPERIMENTAL
+	help
+	  NAPI is a new driver API designed to reduce CPU and interrupt load
+	  when the driver is receiving lots of packets from the card. It is
+	  still somewhat experimental and thus not yet enabled by default.
+
+	  If your estimated Rx load is 10kpps or more, or if the card will be
+	  deployed on potentially unfriendly networks (e.g. in a firewall),
+	  then say Y here.
+
+	  See <file:Documentation/networking/NAPI_HOWTO.txt> for more
+	  information.
+
+	  If in doubt, say N.
 
 config S2IO
 	tristate "S2IO 10Gbe XFrame NIC"
@@ -2160,6 +2196,19 @@ config S2IO
 config S2IO_NAPI
 	bool "Use Rx Polling (NAPI) (EXPERIMENTAL)"
 	depends on S2IO && EXPERIMENTAL
+	help
+	  NAPI is a new driver API designed to reduce CPU and interrupt load
+	  when the driver is receiving lots of packets from the card. It is
+	  still somewhat experimental and thus not yet enabled by default.
+
+	  If your estimated Rx load is 10kpps or more, or if the card will be
+	  deployed on potentially unfriendly networks (e.g. in a firewall),
+	  then say Y here.
+
+	  See <file:Documentation/networking/NAPI_HOWTO.txt> for more
+	  information.
+
+	  If in doubt, say N.
 
 endmenu
 
@@ -2356,6 +2405,7 @@ config PPP_FILTER
 config PPP_ASYNC
 	tristate "PPP support for async serial ports"
 	depends on PPP
+	select CRC_CCITT
 	---help---
 	  Say Y (or M) here if you want to be able to use PPP over standard
 	  asynchronous serial ports, such as COM1 or COM2 on a PC.  If you use
@@ -2547,3 +2597,4 @@ config NETCONSOLE
 	---help---
 	If you want to log kernel messages over the network, enable this.
 	See Documentation/networking/netconsole.txt for details.
+
diff --git a/drivers/net/Makefile b/drivers/net/Makefile
index d8d8d90c0..2ae71cf8b 100644
--- a/drivers/net/Makefile
+++ b/drivers/net/Makefile
@@ -52,6 +52,7 @@ obj-$(CONFIG_TC35815) += tc35815.o
 obj-$(CONFIG_SK98LIN) += sk98lin/
 obj-$(CONFIG_SKFP) += skfp/
 obj-$(CONFIG_VIA_RHINE) += via-rhine.o
+obj-$(CONFIG_VIA_VELOCITY) += via-velocity.o
 obj-$(CONFIG_ADAPTEC_STARFIRE) += starfire.o
 
 #
@@ -79,7 +80,6 @@ obj-$(CONFIG_ARM_ETHERH) += 8390.o
 obj-$(CONFIG_WD80x3) += wd.o 8390.o
 obj-$(CONFIG_EL2) += 3c503.o 8390.o
 obj-$(CONFIG_NE2000) += ne.o 8390.o
-obj-$(CONFIG_NE2K_CBUS) += ne2k_cbus.o 8390.o
 obj-$(CONFIG_NE2_MCA) += ne2.o 8390.o
 obj-$(CONFIG_HPLAN) += hp.o 8390.o
 obj-$(CONFIG_HPLAN_PLUS) += hp-plus.o 8390.o
@@ -175,6 +175,8 @@ obj-$(CONFIG_R8169) += r8169.o
 obj-$(CONFIG_AMD8111_ETH) += amd8111e.o
 obj-$(CONFIG_IBMVETH) += ibmveth.o
 obj-$(CONFIG_S2IO) += s2io.o
+obj-$(CONFIG_SMC91X) += smc91x.o
+obj-$(CONFIG_FEC_8XX) += fec_8xx/
 
 obj-$(CONFIG_ARM) += arm/
 obj-$(CONFIG_NET_FC) += fc/
diff --git a/drivers/net/Space.c b/drivers/net/Space.c
index 7df6debfd..797e93da6 100644
--- a/drivers/net/Space.c
+++ b/drivers/net/Space.c
@@ -191,8 +191,8 @@ static struct devprobe2 isa_probes[] __initdata = {
 #ifdef CONFIG_E2100		/* Cabletron E21xx series. */
 	{e2100_probe, 0},
 #endif
-#if defined(CONFIG_NE2000) || defined(CONFIG_NE2K_CBUS)	|| \
-    defined(CONFIG_NE_H8300)  /* ISA & PC-9800 CBUS (use ne2k-pci for PCI cards) */
+#if defined(CONFIG_NE2000) || \
+    defined(CONFIG_NE_H8300)  /* ISA (use ne2k-pci for PCI cards) */
 	{ne_probe, 0},
 #endif
 #ifdef CONFIG_LANCE		/* ISA/VLB (use pcnet32 for PCI cards) */
diff --git a/drivers/net/ac3200.c b/drivers/net/ac3200.c
index 22e1856d6..6f2e92f09 100644
--- a/drivers/net/ac3200.c
+++ b/drivers/net/ac3200.c
@@ -39,6 +39,8 @@ static const char version[] =
 
 #include "8390.h"
 
+#define DRV_NAME	"ac3200"
+
 /* Offsets from the base address. */
 #define AC_NIC_BASE	0x00
 #define AC_SA_PROM	0x16			/* The station address PROM. */
@@ -130,6 +132,7 @@ static void cleanup_card(struct net_device *dev)
 		iounmap((void *)dev->mem_start);
 }
 
+#ifndef MODULE
 struct net_device * __init ac3200_probe(int unit)
 {
 	struct net_device *dev = alloc_ei_netdev();
@@ -154,12 +157,13 @@ out:
 	free_netdev(dev);
 	return ERR_PTR(err);
 }
+#endif
 
 static int __init ac_probe1(int ioaddr, struct net_device *dev)
 {
 	int i, retval;
 
-	if (!request_region(ioaddr, AC_IO_EXTENT, dev->name))
+	if (!request_region(ioaddr, AC_IO_EXTENT, DRV_NAME))
 		return -EBUSY;
 
 	if (inb_p(ioaddr + AC_ID_PORT) == 0xff) {
@@ -203,7 +207,7 @@ static int __init ac_probe1(int ioaddr, struct net_device *dev)
 		printk(", assigning");
 	}
 
-	retval = request_irq(dev->irq, ei_interrupt, 0, dev->name, dev);
+	retval = request_irq(dev->irq, ei_interrupt, 0, DRV_NAME, dev);
 	if (retval) {
 		printk (" nothing! Unable to get IRQ %d.\n", dev->irq);
 		goto out1;
diff --git a/drivers/net/acenic.c b/drivers/net/acenic.c
index 51cf16430..90ed3329a 100644
--- a/drivers/net/acenic.c
+++ b/drivers/net/acenic.c
@@ -85,6 +85,8 @@
 #include <asm/uaccess.h>
 
 
+#define DRV_NAME "acenic"
+
 #undef INDEX_DEBUG
 
 #ifdef CONFIG_ACENIC_OMIT_TIGON_I
@@ -367,9 +369,9 @@ MODULE_DEVICE_TABLE(pci, acenic_pci_tbl);
  */
 #define ACE_MINI_SIZE		100
 
-#define ACE_MINI_BUFSIZE	(ACE_MINI_SIZE + 2 + 16)
-#define ACE_STD_BUFSIZE		(ACE_STD_MTU + ETH_HLEN + 2+4+16)
-#define ACE_JUMBO_BUFSIZE	(ACE_JUMBO_MTU + ETH_HLEN + 2+4+16)
+#define ACE_MINI_BUFSIZE	ACE_MINI_SIZE
+#define ACE_STD_BUFSIZE		(ACE_STD_MTU + ETH_HLEN + 4)
+#define ACE_JUMBO_BUFSIZE	(ACE_JUMBO_MTU + ETH_HLEN + 4)
 
 /*
  * There seems to be a magic difference in the effect between 995 and 996
@@ -443,6 +445,16 @@ static char version[] __initdata =
   "acenic.c: v0.92 08/05/2002  Jes Sorensen, linux-acenic@SunSITE.dk\n"
   "                            http://home.cern.ch/~jes/gige/acenic.html\n";
 
+static int ace_get_settings(struct net_device *, struct ethtool_cmd *);
+static int ace_set_settings(struct net_device *, struct ethtool_cmd *);
+static void ace_get_drvinfo(struct net_device *, struct ethtool_drvinfo *);
+
+static struct ethtool_ops ace_ethtool_ops = {
+	.get_settings = ace_get_settings,
+	.set_settings = ace_set_settings,
+	.get_drvinfo = ace_get_drvinfo,
+};
+
 static int __devinit acenic_probe_one(struct pci_dev *pdev,
 		const struct pci_device_id *id)
 {
@@ -480,7 +492,7 @@ static int __devinit acenic_probe_one(struct pci_dev *pdev,
 	dev->hard_start_xmit = &ace_start_xmit;
 	dev->get_stats = &ace_get_stats;
 	dev->set_multicast_list = &ace_set_multicast_list;
-	dev->do_ioctl = &ace_ioctl;
+	SET_ETHTOOL_OPS(dev, &ace_ethtool_ops);
 	dev->set_mac_address = &ace_set_mac_addr;
 	dev->change_mtu = &ace_change_mtu;
 
@@ -666,7 +678,7 @@ static void __devexit acenic_remove_one(struct pci_dev *pdev)
 			ringp = &ap->skb->rx_std_skbuff[i];
 			mapping = pci_unmap_addr(ringp, mapping);
 			pci_unmap_page(ap->pdev, mapping,
-				       ACE_STD_BUFSIZE - (2 + 16),
+				       ACE_STD_BUFSIZE,
 				       PCI_DMA_FROMDEVICE);
 
 			ap->rx_std_ring[i].size = 0;
@@ -686,7 +698,7 @@ static void __devexit acenic_remove_one(struct pci_dev *pdev)
 				ringp = &ap->skb->rx_mini_skbuff[i];
 				mapping = pci_unmap_addr(ringp,mapping);
 				pci_unmap_page(ap->pdev, mapping,
-					       ACE_MINI_BUFSIZE - (2 + 16),
+					       ACE_MINI_BUFSIZE,
 					       PCI_DMA_FROMDEVICE);
 
 				ap->rx_mini_ring[i].size = 0;
@@ -705,7 +717,7 @@ static void __devexit acenic_remove_one(struct pci_dev *pdev)
 			ringp = &ap->skb->rx_jumbo_skbuff[i];
 			mapping = pci_unmap_addr(ringp, mapping);
 			pci_unmap_page(ap->pdev, mapping,
-				       ACE_JUMBO_BUFSIZE - (2 + 16),
+				       ACE_JUMBO_BUFSIZE,
 				       PCI_DMA_FROMDEVICE);
 
 			ap->rx_jumbo_ring[i].size = 0;
@@ -1195,10 +1207,10 @@ static int __init ace_init(struct net_device *dev)
 	}
 
 	ecode = request_irq(pdev->irq, ace_interrupt, SA_SHIRQ,
-			    dev->name, dev);
+			    DRV_NAME, dev);
 	if (ecode) {
 		printk(KERN_WARNING "%s: Requested IRQ %d is busy\n",
-		       dev->name, pdev->irq);
+		       DRV_NAME, pdev->irq);
 		goto init_error;
 	} else
 		dev->irq = pdev->irq;
@@ -1245,7 +1257,7 @@ static int __init ace_init(struct net_device *dev)
 	set_aceaddr(&info->stats2_ptr, (dma_addr_t) tmp_ptr);
 
 	set_aceaddr(&info->rx_std_ctrl.rngptr, ap->rx_ring_base_dma);
-	info->rx_std_ctrl.max_len = ACE_STD_MTU + ETH_HLEN + 4;
+	info->rx_std_ctrl.max_len = ACE_STD_BUFSIZE;
 	info->rx_std_ctrl.flags =
 	  RCB_FLG_TCP_UDP_SUM | RCB_FLG_NO_PSEUDO_HDR | ACE_RCB_VLAN_FLAG;
 
@@ -1622,7 +1634,7 @@ static void ace_tasklet(unsigned long dev)
 	cur_size = atomic_read(&ap->cur_rx_bufs);
 	if ((cur_size < RX_LOW_STD_THRES) &&
 	    !test_and_set_bit(0, &ap->std_refill_busy)) {
-#if DEBUG
+#ifdef DEBUG
 		printk("refilling buffers (current %i)\n", cur_size);
 #endif
 		ace_load_std_rx_ring(ap, RX_RING_SIZE - cur_size);
@@ -1632,7 +1644,7 @@ static void ace_tasklet(unsigned long dev)
 		cur_size = atomic_read(&ap->cur_mini_bufs);
 		if ((cur_size < RX_LOW_MINI_THRES) &&
 		    !test_and_set_bit(0, &ap->mini_refill_busy)) {
-#if DEBUG
+#ifdef DEBUG
 			printk("refilling mini buffers (current %i)\n",
 			       cur_size);
 #endif
@@ -1643,7 +1655,7 @@ static void ace_tasklet(unsigned long dev)
 	cur_size = atomic_read(&ap->cur_jumbo_bufs);
 	if (ap->jumbo && (cur_size < RX_LOW_JUMBO_THRES) &&
 	    !test_and_set_bit(0, &ap->jumbo_refill_busy)) {
-#if DEBUG
+#ifdef DEBUG
 		printk("refilling jumbo buffers (current %i)\n", cur_size);
 #endif
 		ace_load_jumbo_rx_ring(ap, RX_JUMBO_SIZE - cur_size);
@@ -1688,17 +1700,14 @@ static void ace_load_std_rx_ring(struct ace_private *ap, int nr_bufs)
 		struct rx_desc *rd;
 		dma_addr_t mapping;
 
-		skb = alloc_skb(ACE_STD_BUFSIZE, GFP_ATOMIC);
+		skb = alloc_skb(ACE_STD_BUFSIZE + NET_IP_ALIGN, GFP_ATOMIC);
 		if (!skb)
 			break;
 
-		/*
-		 * Make sure IP header starts on a fresh cache line.
-		 */
-		skb_reserve(skb, 2 + 16);
+		skb_reserve(skb, NET_IP_ALIGN);
 		mapping = pci_map_page(ap->pdev, virt_to_page(skb->data),
 				       offset_in_page(skb->data),
-				       ACE_STD_BUFSIZE - (2 + 16),
+				       ACE_STD_BUFSIZE,
 				       PCI_DMA_FROMDEVICE);
 		ap->skb->rx_std_skbuff[idx].skb = skb;
 		pci_unmap_addr_set(&ap->skb->rx_std_skbuff[idx],
@@ -1706,7 +1715,7 @@ static void ace_load_std_rx_ring(struct ace_private *ap, int nr_bufs)
 
 		rd = &ap->rx_std_ring[idx];
 		set_aceaddr(&rd->addr, mapping);
-		rd->size = ACE_STD_MTU + ETH_HLEN + 4;
+		rd->size = ACE_STD_BUFSIZE;
 		rd->idx = idx;
 		idx = (idx + 1) % RX_STD_RING_ENTRIES;
 	}
@@ -1754,17 +1763,14 @@ static void ace_load_mini_rx_ring(struct ace_private *ap, int nr_bufs)
 		struct rx_desc *rd;
 		dma_addr_t mapping;
 
-		skb = alloc_skb(ACE_MINI_BUFSIZE, GFP_ATOMIC);
+		skb = alloc_skb(ACE_MINI_BUFSIZE + NET_IP_ALIGN, GFP_ATOMIC);
 		if (!skb)
 			break;
 
-		/*
-		 * Make sure the IP header ends up on a fresh cache line
-		 */
-		skb_reserve(skb, 2 + 16);
+		skb_reserve(skb, NET_IP_ALIGN);
 		mapping = pci_map_page(ap->pdev, virt_to_page(skb->data),
 				       offset_in_page(skb->data),
-				       ACE_MINI_BUFSIZE - (2 + 16),
+				       ACE_MINI_BUFSIZE,
 				       PCI_DMA_FROMDEVICE);
 		ap->skb->rx_mini_skbuff[idx].skb = skb;
 		pci_unmap_addr_set(&ap->skb->rx_mini_skbuff[idx],
@@ -1772,7 +1778,7 @@ static void ace_load_mini_rx_ring(struct ace_private *ap, int nr_bufs)
 
 		rd = &ap->rx_mini_ring[idx];
 		set_aceaddr(&rd->addr, mapping);
-		rd->size = ACE_MINI_SIZE;
+		rd->size = ACE_MINI_BUFSIZE;
 		rd->idx = idx;
 		idx = (idx + 1) % RX_MINI_RING_ENTRIES;
 	}
@@ -1815,17 +1821,14 @@ static void ace_load_jumbo_rx_ring(struct ace_private *ap, int nr_bufs)
 		struct rx_desc *rd;
 		dma_addr_t mapping;
 
-		skb = alloc_skb(ACE_JUMBO_BUFSIZE, GFP_ATOMIC);
+		skb = alloc_skb(ACE_JUMBO_BUFSIZE + NET_IP_ALIGN, GFP_ATOMIC);
 		if (!skb)
 			break;
 
-		/*
-		 * Make sure the IP header ends up on a fresh cache line
-		 */
-		skb_reserve(skb, 2 + 16);
+		skb_reserve(skb, NET_IP_ALIGN);
 		mapping = pci_map_page(ap->pdev, virt_to_page(skb->data),
 				       offset_in_page(skb->data),
-				       ACE_JUMBO_BUFSIZE - (2 + 16),
+				       ACE_JUMBO_BUFSIZE,
 				       PCI_DMA_FROMDEVICE);
 		ap->skb->rx_jumbo_skbuff[idx].skb = skb;
 		pci_unmap_addr_set(&ap->skb->rx_jumbo_skbuff[idx],
@@ -1833,7 +1836,7 @@ static void ace_load_jumbo_rx_ring(struct ace_private *ap, int nr_bufs)
 
 		rd = &ap->rx_jumbo_ring[idx];
 		set_aceaddr(&rd->addr, mapping);
-		rd->size = ACE_JUMBO_MTU + ETH_HLEN + 4;
+		rd->size = ACE_JUMBO_BUFSIZE;
 		rd->idx = idx;
 		idx = (idx + 1) % RX_JUMBO_RING_ENTRIES;
 	}
@@ -1995,6 +1998,11 @@ static void ace_rx_int(struct net_device *dev, u32 rxretprd, u32 rxretcsm)
 		int bd_flags, desc_type, mapsize;
 		u16 csum;
 
+
+		/* make sure the rx descriptor isn't read before rxretprd */
+		if (idx == rxretcsm) 
+			rmb();
+
 		retdesc = &ap->rx_return_ring[idx];
 		skbidx = retdesc->idx;
 		bd_flags = retdesc->flags;
@@ -2010,19 +2018,19 @@ static void ace_rx_int(struct net_device *dev, u32 rxretprd, u32 rxretcsm)
 			 */
 		case 0:
 			rip = &ap->skb->rx_std_skbuff[skbidx];
-			mapsize = ACE_STD_BUFSIZE - (2 + 16);
+			mapsize = ACE_STD_BUFSIZE;
 			rxdesc = &ap->rx_std_ring[skbidx];
 			std_count++;
 			break;
 		case BD_FLG_JUMBO:
 			rip = &ap->skb->rx_jumbo_skbuff[skbidx];
-			mapsize = ACE_JUMBO_BUFSIZE - (2 + 16);
+			mapsize = ACE_JUMBO_BUFSIZE;
 			rxdesc = &ap->rx_jumbo_ring[skbidx];
 			atomic_dec(&ap->cur_jumbo_bufs);
 			break;
 		case BD_FLG_MINI:
 			rip = &ap->skb->rx_mini_skbuff[skbidx];
-			mapsize = ACE_MINI_BUFSIZE - (2 + 16);
+			mapsize = ACE_MINI_BUFSIZE;
 			rxdesc = &ap->rx_mini_ring[skbidx];
 			mini_count++; 
 			break;
@@ -2243,7 +2251,7 @@ static irqreturn_t ace_interrupt(int irq, void *dev_id, struct pt_regs *ptregs)
 		if (cur_size < RX_LOW_STD_THRES) {
 			if ((cur_size < RX_PANIC_STD_THRES) &&
 			    !test_and_set_bit(0, &ap->std_refill_busy)) {
-#if DEBUG
+#ifdef DEBUG
 				printk("low on std buffers %i\n", cur_size);
 #endif
 				ace_load_std_rx_ring(ap,
@@ -2258,7 +2266,7 @@ static irqreturn_t ace_interrupt(int irq, void *dev_id, struct pt_regs *ptregs)
 				if ((cur_size < RX_PANIC_MINI_THRES) &&
 				    !test_and_set_bit(0,
 						      &ap->mini_refill_busy)) {
-#if DEBUG
+#ifdef DEBUG
 					printk("low on mini buffers %i\n",
 					       cur_size);
 #endif
@@ -2274,7 +2282,7 @@ static irqreturn_t ace_interrupt(int irq, void *dev_id, struct pt_regs *ptregs)
 				if ((cur_size < RX_PANIC_JUMBO_THRES) &&
 				    !test_and_set_bit(0,
 						      &ap->jumbo_refill_busy)){
-#if DEBUG
+#ifdef DEBUG
 					printk("low on jumbo buffers %i\n",
 					       cur_size);
 #endif
@@ -2688,146 +2696,136 @@ static int ace_change_mtu(struct net_device *dev, int new_mtu)
 	return 0;
 }
 
-
-static int ace_ioctl(struct net_device *dev, struct ifreq *ifr, int cmd)
+static int ace_get_settings(struct net_device *dev, struct ethtool_cmd *ecmd)
 {
 	struct ace_private *ap = dev->priv;
 	struct ace_regs *regs = ap->regs;
-#ifdef SIOCETHTOOL
-	struct ethtool_cmd ecmd;
-	u32 link, speed;
+	u32 link;
 
-	if (cmd != SIOCETHTOOL)
-		return -EOPNOTSUPP;
-	if (copy_from_user(&ecmd, ifr->ifr_data, sizeof(ecmd)))
-		return -EFAULT;
-	switch (ecmd.cmd) {
-	case ETHTOOL_GSET:
-		ecmd.supported =
-			(SUPPORTED_10baseT_Half | SUPPORTED_10baseT_Full |
-			 SUPPORTED_100baseT_Half | SUPPORTED_100baseT_Full |
-			 SUPPORTED_1000baseT_Half | SUPPORTED_1000baseT_Full |
-			 SUPPORTED_Autoneg | SUPPORTED_FIBRE);
-
-		ecmd.port = PORT_FIBRE;
-		ecmd.transceiver = XCVR_INTERNAL;
-		ecmd.phy_address = 0;
-
-		link = readl(&regs->GigLnkState);
-		if (link & LNK_1000MB)
-			ecmd.speed = SPEED_1000;
-		else {
-			link = readl(&regs->FastLnkState);
-			if (link & LNK_100MB)
-				ecmd.speed = SPEED_100;
-			else if (link & LNK_100MB)
-				ecmd.speed = SPEED_10;
-			else
-				ecmd.speed = 0;
-		}
-		if (link & LNK_FULL_DUPLEX)
-			ecmd.duplex = DUPLEX_FULL;
-		else
-			ecmd.duplex = DUPLEX_HALF;
+	memset(ecmd, 0, sizeof(struct ethtool_cmd));
+	ecmd->supported =
+		(SUPPORTED_10baseT_Half | SUPPORTED_10baseT_Full |
+		 SUPPORTED_100baseT_Half | SUPPORTED_100baseT_Full |
+		 SUPPORTED_1000baseT_Half | SUPPORTED_1000baseT_Full |
+		 SUPPORTED_Autoneg | SUPPORTED_FIBRE);
+
+	ecmd->port = PORT_FIBRE;
+	ecmd->transceiver = XCVR_INTERNAL;
 
-		if (link & LNK_NEGOTIATE)
-			ecmd.autoneg = AUTONEG_ENABLE;
+	link = readl(&regs->GigLnkState);
+	if (link & LNK_1000MB)
+		ecmd->speed = SPEED_1000;
+	else {
+		link = readl(&regs->FastLnkState);
+		if (link & LNK_100MB)
+			ecmd->speed = SPEED_100;
+		else if (link & LNK_10MB)
+			ecmd->speed = SPEED_10;
 		else
-			ecmd.autoneg = AUTONEG_DISABLE;
+			ecmd->speed = 0;
+	}
+	if (link & LNK_FULL_DUPLEX)
+		ecmd->duplex = DUPLEX_FULL;
+	else
+		ecmd->duplex = DUPLEX_HALF;
+
+	if (link & LNK_NEGOTIATE)
+		ecmd->autoneg = AUTONEG_ENABLE;
+	else
+		ecmd->autoneg = AUTONEG_DISABLE;
 
 #if 0
-		/*
-		 * Current struct ethtool_cmd is insufficient
-		 */
-		ecmd.trace = readl(&regs->TuneTrace);
+	/*
+	 * Current struct ethtool_cmd is insufficient
+	 */
+	ecmd->trace = readl(&regs->TuneTrace);
 
-		ecmd.txcoal = readl(&regs->TuneTxCoalTicks);
-		ecmd.rxcoal = readl(&regs->TuneRxCoalTicks);
+	ecmd->txcoal = readl(&regs->TuneTxCoalTicks);
+	ecmd->rxcoal = readl(&regs->TuneRxCoalTicks);
 #endif
-		ecmd.maxtxpkt = readl(&regs->TuneMaxTxDesc);
-		ecmd.maxrxpkt = readl(&regs->TuneMaxRxDesc);
+	ecmd->maxtxpkt = readl(&regs->TuneMaxTxDesc);
+	ecmd->maxrxpkt = readl(&regs->TuneMaxRxDesc);
 
-		if(copy_to_user(ifr->ifr_data, &ecmd, sizeof(ecmd)))
-			return -EFAULT;
-		return 0;
+	return 0;
+}
 
-	case ETHTOOL_SSET:
-		link = readl(&regs->GigLnkState);
-		if (link & LNK_1000MB)
-			speed = SPEED_1000;
-		else {
-			link = readl(&regs->FastLnkState);
-			if (link & LNK_100MB)
-				speed = SPEED_100;
-			else if (link & LNK_100MB)
-				speed = SPEED_10;
-			else
-				speed = SPEED_100;
-		}
+static int ace_set_settings(struct net_device *dev, struct ethtool_cmd *ecmd)
+{
+	struct ace_private *ap = dev->priv;
+	struct ace_regs *regs = ap->regs;
+	u32 link, speed;
 
-		link = LNK_ENABLE | LNK_1000MB | LNK_100MB | LNK_10MB |
-			LNK_RX_FLOW_CTL_Y | LNK_NEG_FCTL;
-		if (!ACE_IS_TIGON_I(ap))
-			link |= LNK_TX_FLOW_CTL_Y;
-		if (ecmd.autoneg == AUTONEG_ENABLE)
-			link |= LNK_NEGOTIATE;
-		if (ecmd.speed != speed) {
-			link &= ~(LNK_1000MB | LNK_100MB | LNK_10MB);
-			switch (speed) {
-			case SPEED_1000:
-				link |= LNK_1000MB;
-				break;
-			case SPEED_100:
-				link |= LNK_100MB;
-				break;
-			case SPEED_10:
-				link |= LNK_10MB;
-				break;
-			}
+	link = readl(&regs->GigLnkState);
+	if (link & LNK_1000MB)
+		speed = SPEED_1000;
+	else {
+		link = readl(&regs->FastLnkState);
+		if (link & LNK_100MB)
+			speed = SPEED_100;
+		else if (link & LNK_10MB)
+			speed = SPEED_10;
+		else
+			speed = SPEED_100;
+	}
+
+	link = LNK_ENABLE | LNK_1000MB | LNK_100MB | LNK_10MB |
+		LNK_RX_FLOW_CTL_Y | LNK_NEG_FCTL;
+	if (!ACE_IS_TIGON_I(ap))
+		link |= LNK_TX_FLOW_CTL_Y;
+	if (ecmd->autoneg == AUTONEG_ENABLE)
+		link |= LNK_NEGOTIATE;
+	if (ecmd->speed != speed) {
+		link &= ~(LNK_1000MB | LNK_100MB | LNK_10MB);
+		switch (speed) {
+		case SPEED_1000:
+			link |= LNK_1000MB;
+			break;
+		case SPEED_100:
+			link |= LNK_100MB;
+			break;
+		case SPEED_10:
+			link |= LNK_10MB;
+			break;
 		}
-		if (ecmd.duplex == DUPLEX_FULL)
-			link |= LNK_FULL_DUPLEX;
+	}
 
-		if (link != ap->link) {
-			struct cmd cmd;
-			printk(KERN_INFO "%s: Renegotiating link state\n",
-			       dev->name);
+	if (ecmd->duplex == DUPLEX_FULL)
+		link |= LNK_FULL_DUPLEX;
 
-			ap->link = link;
-			writel(link, &regs->TuneLink);
-			if (!ACE_IS_TIGON_I(ap))
-				writel(link, &regs->TuneFastLink);
-			wmb();
+	if (link != ap->link) {
+		struct cmd cmd;
+		printk(KERN_INFO "%s: Renegotiating link state\n",
+		       dev->name);
 
-			cmd.evt = C_LNK_NEGOTIATION;
-			cmd.code = 0;
-			cmd.idx = 0;
-			ace_issue_cmd(regs, &cmd);
-		}
-		return 0;
-
-	case ETHTOOL_GDRVINFO: {
-		struct ethtool_drvinfo info = {ETHTOOL_GDRVINFO};
-		strncpy(info.driver, "acenic", sizeof(info.driver) - 1);
-		sprintf(info.fw_version, "%i.%i.%i", 
-			 tigonFwReleaseMajor, tigonFwReleaseMinor,
-			 tigonFwReleaseFix);
-		strncpy(info.version, version, sizeof(info.version) - 1);
-		if (ap && ap->pdev)
-			strcpy(info.bus_info, pci_name(ap->pdev));
-		if (copy_to_user(ifr->ifr_data, &info, sizeof(info)))
-			return -EFAULT;
-		return 0;
-	}
-	default:
-		break;
-	}
-	
-#endif
+		ap->link = link;
+		writel(link, &regs->TuneLink);
+		if (!ACE_IS_TIGON_I(ap))
+			writel(link, &regs->TuneFastLink);
+		wmb();
 
-	return -EOPNOTSUPP;
+		cmd.evt = C_LNK_NEGOTIATION;
+		cmd.code = 0;
+		cmd.idx = 0;
+		ace_issue_cmd(regs, &cmd);
+	}
+	return 0;
 }
 
+static void ace_get_drvinfo(struct net_device *dev, 
+			    struct ethtool_drvinfo *info)
+{
+	struct ace_private *ap = dev->priv;
+
+	strlcpy(info->driver, "acenic", sizeof(info->driver));
+	snprintf(info->version, sizeof(info->version), "%i.%i.%i", 
+		tigonFwReleaseMajor, tigonFwReleaseMinor,
+		tigonFwReleaseFix);
+
+	if (ap->pdev)
+		strlcpy(info->bus_info, pci_name(ap->pdev), 
+			sizeof(info->bus_info));
+
+}
 
 /*
  * Set the hardware MAC address.
diff --git a/drivers/net/acenic.h b/drivers/net/acenic.h
index eb516e155..c4624b85d 100644
--- a/drivers/net/acenic.h
+++ b/drivers/net/acenic.h
@@ -790,7 +790,6 @@ static void ace_tasklet(unsigned long dev);
 static void ace_dump_trace(struct ace_private *ap);
 static void ace_set_multicast_list(struct net_device *dev);
 static int ace_change_mtu(struct net_device *dev, int new_mtu);
-static int ace_ioctl(struct net_device *dev, struct ifreq *ifr, int cmd);
 static int ace_set_mac_addr(struct net_device *dev, void *p);
 static void ace_set_rxtx_parms(struct net_device *dev, int jumbo);
 static int ace_allocate_descriptors(struct net_device *dev);
diff --git a/drivers/net/acenic_firmware.h b/drivers/net/acenic_firmware.h
index d028378b1..3fbfb7ad1 100644
--- a/drivers/net/acenic_firmware.h
+++ b/drivers/net/acenic_firmware.h
@@ -18,9 +18,9 @@
 #define tigonFwBssAddr 0x00015dd0
 #define tigonFwBssLen 0x2080
 #ifdef CONFIG_ACENIC_OMIT_TIGON_I
-#define tigonFwText 0
-#define tigonFwData 0
-#define tigonFwRodata 0
+#define tigonFwText NULL
+#define tigonFwData NULL
+#define tigonFwRodata NULL
 #else
 /* Generated by genfw.c */
 static u32 tigonFwText[(MAX_TEXT_LEN/4) + 1] __initdata = {
diff --git a/drivers/net/amd8111e.c b/drivers/net/amd8111e.c
index 7b96c017d..ca57a7a53 100755
--- a/drivers/net/amd8111e.c
+++ b/drivers/net/amd8111e.c
@@ -701,7 +701,7 @@ static int amd8111e_tx(struct net_device *dev)
 				  	lp->tx_skbuff[tx_index]->len,
 					PCI_DMA_TODEVICE);
 			dev_kfree_skb_irq (lp->tx_skbuff[tx_index]);
-			lp->tx_skbuff[tx_index] = 0;
+			lp->tx_skbuff[tx_index] = NULL;
 			lp->tx_dma_addr[tx_index] = 0;
 		}
 		lp->tx_complete_idx++;
@@ -1544,7 +1544,7 @@ static void amd8111e_set_multicast_list(struct net_device *dev)
 	if( dev->mc_count == 0 ){
 		/* get only own packets */
 		mc_filter[1] = mc_filter[0] = 0;
-		lp->mc_list = 0;
+		lp->mc_list = NULL;
 		lp->options &= ~OPTION_MULTICAST_ENABLE;
 		amd8111e_writeq(*(u64*)mc_filter,lp->mmio + LADRF);
 		/* disable promiscous mode */
diff --git a/drivers/net/apne.c b/drivers/net/apne.c
index 1b49b8526..a94216b87 100644
--- a/drivers/net/apne.c
+++ b/drivers/net/apne.c
@@ -49,6 +49,8 @@
 
 /* ---- No user-serviceable parts below ---- */
 
+#define DRV_NAME "apne"
+
 #define NE_BASE	 (dev->base_addr)
 #define NE_CMD	 		0x00
 #define NE_DATAPORT		0x10            /* NatSemi-defined port window offset. */
@@ -168,7 +170,7 @@ struct net_device * __init apne_probe(int unit)
 		return ERR_PTR(-ENODEV);
 	}
 
-	if (!request_region(IOBASE, 0x20, dev->name)) {
+	if (!request_region(IOBASE, 0x20, DRV_NAME)) {
 		free_netdev(dev);
 		return ERR_PTR(-EBUSY);
 	}
@@ -310,7 +312,7 @@ static int __init apne_probe1(struct net_device *dev, int ioaddr)
     dev->base_addr = ioaddr;
 
     /* Install the Interrupt handler */
-    i = request_irq(IRQ_AMIGA_PORTS, apne_interrupt, SA_SHIRQ, dev->name, dev);
+    i = request_irq(IRQ_AMIGA_PORTS, apne_interrupt, SA_SHIRQ, DRV_NAME, dev);
     if (i) return i;
 
     for(i = 0; i < ETHER_ADDR_LEN; i++) {
diff --git a/drivers/net/appletalk/ltpc.c b/drivers/net/appletalk/ltpc.c
index cc7476f1c..70a7a181b 100644
--- a/drivers/net/appletalk/ltpc.c
+++ b/drivers/net/appletalk/ltpc.c
@@ -501,7 +501,7 @@ static void idle(struct net_device *dev)
 	/* FIXME This is initialized to shut the warning up, but I need to
 	 * think this through again.
 	 */
-	struct xmitQel *q=0;
+	struct xmitQel *q = NULL;
 	int oops;
 	int i;
 	int base = dev->base_addr;
@@ -1203,7 +1203,7 @@ struct net_device * __init ltpc_probe(void)
 	if (err)
 		goto out4;
 
-	return 0;
+	return NULL;
 out4:
 	del_timer_sync(&ltpc_timer);
 	if (dev->irq)
diff --git a/drivers/net/arcnet/arcnet.c b/drivers/net/arcnet/arcnet.c
index 57c1b7d2d..5912a24a3 100644
--- a/drivers/net/arcnet/arcnet.c
+++ b/drivers/net/arcnet/arcnet.c
@@ -479,7 +479,7 @@ static int arcnet_header(struct sk_buff *skb, struct net_device *dev,
 		*(uint16_t *) skb_push(skb, 2) = type;
 		if (skb->nh.raw - skb->mac.raw != 2)
 			BUGMSG(D_NORMAL, "arcnet_header: Yikes!  diff (%d) is not 2!\n",
-			       skb->nh.raw - skb->mac.raw);
+			       (int)(skb->nh.raw - skb->mac.raw));
 		return -2;	/* return error -- can't transmit yet! */
 	}
 	/* otherwise, we can just add the header as usual. */
@@ -514,7 +514,7 @@ static int arcnet_rebuild_header(struct sk_buff *skb)
 	if (skb->nh.raw - skb->mac.raw != 2) {
 		BUGMSG(D_NORMAL,
 		     "rebuild_header: shouldn't be here! (hdrsize=%d)\n",
-		       skb->nh.raw - skb->mac.raw);
+		     (int)(skb->nh.raw - skb->mac.raw));
 		return 0;
 	}
 	type = *(uint16_t *) skb_pull(skb, 2);
diff --git a/drivers/net/arm/Kconfig b/drivers/net/arm/Kconfig
index 06c134606..470364ded 100644
--- a/drivers/net/arm/Kconfig
+++ b/drivers/net/arm/Kconfig
@@ -44,4 +44,3 @@ config ARM_ETHER00
 	  will generate a suitable hw address based on the board serial
 	  number (MTD support is required for this). Otherwise you will
 	  need to set a suitable hw address using ifconfig.
-
diff --git a/drivers/net/arm/etherh.c b/drivers/net/arm/etherh.c
index 464119ee1..d861c54a7 100644
--- a/drivers/net/arm/etherh.c
+++ b/drivers/net/arm/etherh.c
@@ -574,7 +574,7 @@ etherh_probe(struct expansion_card *ec, const struct ecard_id *id)
 	if (ret)
 		goto out;
 
-	dev = alloc_ei_netdev();
+	dev = __alloc_ei_netdev(sizeof(struct etherh_priv));
 	if (!dev) {
 		ret = -ENOMEM;
 		goto release;
diff --git a/drivers/net/at1700.c b/drivers/net/at1700.c
index 9981968a8..a3e7e63c3 100644
--- a/drivers/net/at1700.c
+++ b/drivers/net/at1700.c
@@ -65,6 +65,8 @@
 static char version[] __initdata =
 	"at1700.c:v1.15 4/7/98  Donald Becker (becker@cesdis.gsfc.nasa.gov)\n";
 
+#define DRV_NAME "at1700"
+
 /* Tunable parameters. */
 
 /* When to switch from the 64-entry multicast filter to Rx-all-multicast. */
@@ -80,21 +82,14 @@ static int fmv18x_probe_list[] __initdata = {
  *	ISA
  */
 
-#ifndef CONFIG_X86_PC9800
 static unsigned at1700_probe_list[] __initdata = {
 	0x260, 0x280, 0x2a0, 0x240, 0x340, 0x320, 0x380, 0x300, 0
 };
 
-#else /* CONFIG_X86_PC9800 */
-static unsigned at1700_probe_list[] __initdata = {
-	0x1d6, 0x1d8, 0x1da, 0x1d4, 0xd4, 0xd2, 0xd8, 0xd0, 0
-};
-
-#endif /* CONFIG_X86_PC9800 */
 /*
  *	MCA
  */
-#ifdef CONFIG_MCA	
+#ifdef CONFIG_MCA_LEGACY
 static int at1700_ioaddr_pattern[] __initdata = {
 	0x00, 0x04, 0x01, 0x05, 0x02, 0x06, 0x03, 0x07
 };
@@ -133,7 +128,6 @@ struct net_local {
 
 
 /* Offsets from the base address. */
-#ifndef CONFIG_X86_PC9800
 #define STATUS			0
 #define TX_STATUS		0
 #define RX_STATUS		1
@@ -161,34 +155,6 @@ struct net_local {
 #define RESET			31		/* Write to reset some parts of the chip. */
 #define AT1700_IO_EXTENT	32
 #define PORT_OFFSET(o) (o)
-#else /* CONFIG_X86_PC9800 */
-#define STATUS			(0x0000)
-#define TX_STATUS		(0x0000)
-#define RX_STATUS		(0x0001)
-#define TX_INTR			(0x0200)/* Bit-mapped interrupt enable registers. */
-#define RX_INTR			(0x0201)
-#define TX_MODE			(0x0400)
-#define RX_MODE			(0x0401)
-#define CONFIG_0		(0x0600)/* Misc. configuration settings. */
-#define CONFIG_1		(0x0601)
-/* Run-time register bank 2 definitions. */
-#define DATAPORT		(0x0800)/* Word-wide DMA or programmed-I/O dataport. */
-#define TX_START		(0x0a00)
-#define COL16CNTL		(0x0a01)/* Controll Reg for 16 collisions */
-#define MODE13			(0x0c01)
-#define RX_CTRL			(0x0e00)
-/* Configuration registers only on the '865A/B chips. */
-#define EEPROM_Ctrl 	(0x1000)
-#define EEPROM_Data 	(0x1200)
-#define CARDSTATUS	16			/* FMV-18x Card Status */
-#define CARDSTATUS1	17			/* FMV-18x Card Status */
-#define IOCONFIG		(0x1400)/* Either read the jumper, or move the I/O. */
-#define IOCONFIG1		(0x1600)
-#define	SAPROM			20		/* The station address PROM, if no EEPROM. */
-#define	MODE24			(0x1800)/* The station address PROM, if no EEPROM. */
-#define RESET			(0x1e01)/* Write to reset some parts of the chip. */
-#define PORT_OFFSET(o) ({ int _o_ = (o); (_o_ & ~1) * 0x100 + (_o_ & 1); })
-#endif /* CONFIG_X86_PC9800 */
 
 
 #define TX_TIMEOUT		10
@@ -208,7 +174,7 @@ static void set_rx_mode(struct net_device *dev);
 static void net_tx_timeout (struct net_device *dev);
 
 
-#ifdef CONFIG_MCA
+#ifdef CONFIG_MCA_LEGACY
 struct at1720_mca_adapters_struct {
 	char* name;
 	int id;
@@ -230,31 +196,19 @@ static struct at1720_mca_adapters_struct at1720_mca_adapters[] __initdata = {
    (detachable devices only).
    */
 
-#ifndef CONFIG_X86_PC9800
 static int io = 0x260;
-#else
-static int io = 0xd0;
-#endif
 
 static int irq;
 
 static void cleanup_card(struct net_device *dev)
 {
-#ifdef CONFIG_MCA	
+#ifdef CONFIG_MCA_LEGACY
 	struct net_local *lp = netdev_priv(dev);
 	if (lp->mca_slot >= 0)
 		mca_mark_as_unused(lp->mca_slot);
 #endif	
 	free_irq(dev->irq, NULL);
-#ifndef CONFIG_X86_PC9800
 	release_region(dev->base_addr, AT1700_IO_EXTENT);
-#else
-	{
-		int i;
-		for (i = 0; i < 0x2000; i += 0x200)
-			release_region(dev->base_addr + i, 2);
-	}
-#endif
 }
 
 struct net_device * __init at1700_probe(int unit)
@@ -321,20 +275,8 @@ static int __init at1700_probe1(struct net_device *dev, int ioaddr)
 	int slot, ret = -ENODEV;
 	struct net_local *lp = netdev_priv(dev);
 
-#ifndef CONFIG_X86_PC9800
-	if (!request_region(ioaddr, AT1700_IO_EXTENT, dev->name))
+	if (!request_region(ioaddr, AT1700_IO_EXTENT, DRV_NAME))
 		return -EBUSY;
-#else
-	for (i = 0; i < 0x2000; i += 0x0200) {
-		if (!request_region(ioaddr + i, 2, dev->name)) {
-			while (i > 0) {
-				i -= 0x0200;
-				release_region(ioaddr + i, 2);
-			}
-			return -EBUSY;
-		}
-	}
-#endif
 
 	/* Resetting the chip doesn't reset the ISA interface, so don't bother.
 	   That means we have to be careful with the register values we probe
@@ -346,7 +288,7 @@ static int __init at1700_probe1(struct net_device *dev, int ioaddr)
 		   read_eeprom(ioaddr, 6), inw(ioaddr + EEPROM_Ctrl));
 #endif
 
-#ifdef CONFIG_MCA
+#ifdef CONFIG_MCA_LEGACY
 	/* rEnE (rene@bss.lu): got this from 3c509 driver source , adapted for AT1720 */
 
     /* Based on Erik Nygren's (nygren@mit.edu) 3c529 patch, heavily
@@ -417,7 +359,7 @@ static int __init at1700_probe1(struct net_device *dev, int ioaddr)
 		goto err_out;
 	}
 			
-#ifdef CONFIG_MCA
+#ifdef CONFIG_MCA_LEGACY
 found:
 #endif
 
@@ -425,15 +367,8 @@ found:
 	outb(0, ioaddr + RESET);
 
 	if (is_at1700) {
-#ifndef CONFIG_X86_PC9800
 		irq = at1700_irqmap[(read_eeprom(ioaddr, 12)&0x04)
 						   | (read_eeprom(ioaddr, 0)>>14)];
-#else
-		{
-			char re1000plus_irqmap[4] = {3, 5, 6, 12};
-			irq = re1000plus_irqmap[inb(ioaddr + IOCONFIG1) >> 6];
-		}
-#endif
 	} else {
 		/* Check PnP mode for FMV-183/184/183A/184A. */
 		/* This PnP routine is very poor. IO and IRQ should be known. */
@@ -517,11 +452,7 @@ found:
 	/* Switch to bank 2 */
 	/* Lock our I/O address, and set manual processing mode for 16 collisions. */
 	outb(0x08, ioaddr + CONFIG_1);
-#ifndef CONFIG_X86_PC9800
 	outb(dev->if_port, ioaddr + MODE13);
-#else
-	outb(0, ioaddr + MODE13);
-#endif
 	outb(0x00, ioaddr + COL16CNTL);
 
 	if (net_debug)
@@ -542,7 +473,7 @@ found:
 	lp->jumpered = is_fmv18x;
 	lp->mca_slot = slot;
 	/* Snarf the interrupt vector now. */
-	ret = request_irq(irq, &net_interrupt, 0, dev->name, dev);
+	ret = request_irq(irq, &net_interrupt, 0, DRV_NAME, dev);
 	if (ret) {
 		printk ("  AT1700 at %#3x is unusable due to a conflict on"
 				"IRQ %d.\n", ioaddr, irq);
@@ -552,17 +483,12 @@ found:
 	return 0;
 
 err_mca:
-#ifdef CONFIG_MCA
+#ifdef CONFIG_MCA_LEGACY
 	if (slot >= 0)
 		mca_mark_as_unused(slot);
 #endif
 err_out:
-#ifndef CONFIG_X86_PC9800
 	release_region(ioaddr, AT1700_IO_EXTENT);
-#else
-	for (i = 0; i < 0x2000; i += 0x0200)
-		release_region(ioaddr + i, 2);
-#endif
 	return ret;
 }
 
@@ -573,13 +499,6 @@ err_out:
 #define EE_DATA_WRITE	0x80	/* EEPROM chip data in, in reg. 17. */
 #define EE_DATA_READ	0x80	/* EEPROM chip data out, in reg. 17. */
 
-/* Delay between EEPROM clock transitions. */
-#ifndef CONFIG_X86_PC9800
-#define eeprom_delay()	do { } while (0)
-#else
-#define eeprom_delay()	__asm__ ("out%B0 %%al,%0" :: "N"(0x5f))
-#endif
-
 /* The EEPROM commands include the alway-set leading bit. */
 #define EE_WRITE_CMD	(5 << 6)
 #define EE_READ_CMD		(6 << 6)
@@ -598,22 +517,17 @@ static int __init read_eeprom(long ioaddr, int location)
 		short dataval = (read_cmd & (1 << i)) ? EE_DATA_WRITE : 0;
 		outb(EE_CS, ee_addr);
 		outb(dataval, ee_daddr);
-		eeprom_delay();
 		outb(EE_CS | EE_SHIFT_CLK, ee_addr);	/* EEPROM clock tick. */
-		eeprom_delay();
 	}
 	outb(EE_DATA_WRITE, ee_daddr);
 	for (i = 16; i > 0; i--) {
 		outb(EE_CS, ee_addr);
-		eeprom_delay();
 		outb(EE_CS | EE_SHIFT_CLK, ee_addr);
-		eeprom_delay();
 		retval = (retval << 1) | ((inb(ee_daddr) & EE_DATA_READ) ? 1 : 0);
 	}
 
 	/* Terminate the EEPROM access. */
 	outb(EE_CS, ee_addr);
-	eeprom_delay();
 	outb(EE_SHIFT_CLK, ee_addr);
 	outb(0, ee_addr);
 	return retval;
diff --git a/drivers/net/bonding/bond_main.c b/drivers/net/bonding/bond_main.c
index 6e57c1434..6917b665b 100644
--- a/drivers/net/bonding/bond_main.c
+++ b/drivers/net/bonding/bond_main.c
@@ -4214,13 +4214,6 @@ out:
 	return 0;
 }
 
-#ifdef CONFIG_NET_FASTROUTE
-static int bond_accept_fastpath(struct net_device *bond_dev, struct dst_entry *dst)
-{
-	return -1;
-}
-#endif
-
 /*------------------------- Device initialization ---------------------------*/
 
 /*
@@ -4294,9 +4287,6 @@ static int __init bond_init(struct net_device *bond_dev, struct bond_params *par
 	bond_set_mode_ops(bond_dev, bond->params.mode);
 
 	bond_dev->destructor = free_netdev;
-#ifdef CONFIG_NET_FASTROUTE
-	bond_dev->accept_fastpath = bond_accept_fastpath;
-#endif
 
 	/* Initialize the device options */
 	bond_dev->tx_queue_len = 0;
diff --git a/drivers/net/cs89x0.c b/drivers/net/cs89x0.c
index 9745bf6a9..b04bf5e72 100644
--- a/drivers/net/cs89x0.c
+++ b/drivers/net/cs89x0.c
@@ -141,6 +141,8 @@
 static char version[] __initdata =
 "cs89x0.c: v2.4.3-pre1 Russell Nelson <nelson@crynwr.com>, Andrew Morton <andrewm@uow.edu.au>\n";
 
+#define DRV_NAME "cs89x0"
+
 /* First, a few definitions that the brave might change.
    A zero-terminated list of I/O addresses to be probed. Some special flags..
       Addr & 1 = Read back the address port, look for signature and reset
@@ -261,7 +263,6 @@ static int __init media_fn(char *str)
 }
 
 __setup("cs89x0_media=", media_fn);
-#endif
 
 
 /* Check for a network adaptor of this type, and return '0' iff one exists.
@@ -318,6 +319,7 @@ out:
 	printk(KERN_WARNING "cs89x0: no cs8900 or cs8920 detected.  Be sure to disable PnP with SETUP\n");
 	return ERR_PTR(err);
 }
+#endif
 
 static int
 readreg(struct net_device *dev, int portno)
@@ -425,9 +427,9 @@ cs89x0_probe1(struct net_device *dev, int ioaddr, int modular)
 
 	/* Grab the region so we can find another board if autoIRQ fails. */
 	/* WTF is going on here? */
-	if (!request_region(ioaddr & ~3, NETCARD_IO_EXTENT, dev->name)) {
+	if (!request_region(ioaddr & ~3, NETCARD_IO_EXTENT, DRV_NAME)) {
 		printk(KERN_ERR "%s: request_region(0x%x, 0x%x) failed\n",
-				dev->name, ioaddr, NETCARD_IO_EXTENT);
+				DRV_NAME, ioaddr, NETCARD_IO_EXTENT);
 		retval = -EBUSY;
 		goto out1;
 	}
@@ -1564,7 +1566,7 @@ static void release_dma_buff(struct net_local *lp)
 {
 	if (lp->dma_buff) {
 		free_pages((unsigned long)(lp->dma_buff), get_order(lp->dmasize * 1024));
-		lp->dma_buff = 0;
+		lp->dma_buff = NULL;
 	}
 }
 #endif
diff --git a/drivers/net/defxx.c b/drivers/net/defxx.c
index cada0c669..9ef9f3944 100644
--- a/drivers/net/defxx.c
+++ b/drivers/net/defxx.c
@@ -219,6 +219,8 @@
 static char version[] __devinitdata =
 	"defxx.c:v1.06 2003/08/04  Lawrence V. Stefani and others\n";
 
+#define DRV_NAME "defxx"
+
 #define DYNAMIC_BUFFERS 1
 
 #define SKBUFF_RX_COPYBREAK 200
@@ -435,9 +437,9 @@ static int __devinit dfx_init_one_pci_or_eisa(struct pci_dev *pdev, long ioaddr)
 
 	bp = dev->priv;
 
-	if (!request_region (ioaddr, pdev ? PFI_K_CSR_IO_LEN : PI_ESIC_K_CSR_IO_LEN, dev->name)) {
+	if (!request_region (ioaddr, pdev ? PFI_K_CSR_IO_LEN : PI_ESIC_K_CSR_IO_LEN, DRV_NAME)) {
 		printk (KERN_ERR "%s: Cannot reserve I/O resource 0x%x @ 0x%lx, aborting\n",
-			dev->name, PFI_K_CSR_IO_LEN, ioaddr);
+			DRV_NAME, PFI_K_CSR_IO_LEN, ioaddr);
 		err = -EBUSY;
 		goto err_out;
 	}
diff --git a/drivers/net/dgrs.c b/drivers/net/dgrs.c
index 45492c1ad..c496ebfc8 100644
--- a/drivers/net/dgrs.c
+++ b/drivers/net/dgrs.c
@@ -1311,8 +1311,8 @@ dgrs_found_device(
 		*privN = *priv;
 
 			/* ... and zero out VM areas */
-		privN->vmem = 0;
-		privN->vplxdma = 0;
+		privN->vmem = NULL;
+		privN->vplxdma = NULL;
 			/* ... and zero out IRQ */
 		devN->irq = 0;
 			/* ... and base MAC address off address of 1st port */
diff --git a/drivers/net/dgrs.h b/drivers/net/dgrs.h
index c9f99e90f..c347cd117 100644
--- a/drivers/net/dgrs.h
+++ b/drivers/net/dgrs.h
@@ -26,7 +26,7 @@
 typedef struct dgrs_ioctl {
 	unsigned short cmd;	/* Command to run */
 	unsigned short len;	/* Length of the data buffer */
-	unsigned char  *data;	/* Pointer to the data buffer */
+	unsigned char  __user *data;	/* Pointer to the data buffer */
 	unsigned short	port;	/* port number for command, if needed */
 	unsigned short	filter;	/* filter number for command, if needed */
 } DGRS_IOCTL;
diff --git a/drivers/net/dgrs_asstruct.h b/drivers/net/dgrs_asstruct.h
index 3ffe5431a..a8e5bb5ef 100644
--- a/drivers/net/dgrs_asstruct.h
+++ b/drivers/net/dgrs_asstruct.h
@@ -4,7 +4,7 @@
  *	$Id: asstruct.h,v 1.1.1.1 1994/10/23 05:08:32 rick Exp $
  */
 
-#if ASSEMBLER
+#ifdef ASSEMBLER
 
 #	define MO(t,a)		(a)
 #	define VMO(t,a)		(a)
diff --git a/drivers/net/dgrs_i82596.h b/drivers/net/dgrs_i82596.h
index b1c83b5b9..c7a38c16a 100644
--- a/drivers/net/dgrs_i82596.h
+++ b/drivers/net/dgrs_i82596.h
@@ -95,7 +95,7 @@ typedef volatile struct
 /************************************************************************/
 typedef volatile struct _I596_RBD
 {
-#if INTEL_RETENTIVE
+#ifdef INTEL_RETENTIVE
 	ushort			count;	/* Length of data in buf */
 	ushort			offset;
 #else
@@ -103,7 +103,7 @@ typedef volatile struct _I596_RBD
 #endif
 	vol struct _I596_RBD	*next;	/* Next buffer descriptor in list */
 	uchar			*buf;	/* Data buffer */
-#if INTEL_RETENTIVE
+#ifdef INTEL_RETENTIVE
 	ushort			size;	/* Size of buf (constant) */
 	ushort			zero;
 #else
diff --git a/drivers/net/dl2k.c b/drivers/net/dl2k.c
index 39cabaf80..53f01d51c 100644
--- a/drivers/net/dl2k.c
+++ b/drivers/net/dl2k.c
@@ -583,7 +583,7 @@ alloc_list (struct net_device *dev)
 
 	/* Initialize Tx descriptors, TFDListPtr leaves in start_xmit(). */
 	for (i = 0; i < TX_RING_SIZE; i++) {
-		np->tx_skbuff[i] = 0;
+		np->tx_skbuff[i] = NULL;
 		np->tx_ring[i].status = cpu_to_le64 (TFDDone);
 		np->tx_ring[i].next_desc = cpu_to_le64 (np->tx_ring_dma +
 					      ((i+1)%TX_RING_SIZE) *
@@ -597,7 +597,7 @@ alloc_list (struct net_device *dev)
 						sizeof (struct netdev_desc));
 		np->rx_ring[i].status = 0;
 		np->rx_ring[i].fraginfo = 0;
-		np->rx_skbuff[i] = 0;
+		np->rx_skbuff[i] = NULL;
 	}
 
 	/* Allocate the rx buffers */
@@ -770,7 +770,7 @@ rio_free_tx (struct net_device *dev, int irq)
 		else
 			dev_kfree_skb (skb);
 
-		np->tx_skbuff[entry] = 0;
+		np->tx_skbuff[entry] = NULL;
 		entry = (entry + 1) % TX_RING_SIZE;
 		tx_use++;
 	}
@@ -1818,7 +1818,7 @@ rio_close (struct net_device *dev)
 			pci_unmap_single (np->pdev, np->rx_ring[i].fraginfo,
 					  skb->len, PCI_DMA_FROMDEVICE);
 			dev_kfree_skb (skb);
-			np->rx_skbuff[i] = 0;
+			np->rx_skbuff[i] = NULL;
 		}
 	}
 	for (i = 0; i < TX_RING_SIZE; i++) {
@@ -1827,7 +1827,7 @@ rio_close (struct net_device *dev)
 			pci_unmap_single (np->pdev, np->tx_ring[i].fraginfo,
 					  skb->len, PCI_DMA_TODEVICE);
 			dev_kfree_skb (skb);
-			np->tx_skbuff[i] = 0;
+			np->tx_skbuff[i] = NULL;
 		}
 	}
 
diff --git a/drivers/net/dummy.c b/drivers/net/dummy.c
index 37068c810..7e15c51af 100644
--- a/drivers/net/dummy.c
+++ b/drivers/net/dummy.c
@@ -57,13 +57,6 @@ static void set_multicast_list(struct net_device *dev)
 {
 }
 
-#ifdef CONFIG_NET_FASTROUTE
-static int dummy_accept_fastpath(struct net_device *dev, struct dst_entry *dst)
-{
-	return -1;
-}
-#endif
-
 static void __init dummy_setup(struct net_device *dev)
 {
 	/* Initialize the device structure. */
@@ -71,13 +64,11 @@ static void __init dummy_setup(struct net_device *dev)
 	dev->hard_start_xmit = dummy_xmit;
 	dev->set_multicast_list = set_multicast_list;
 	dev->set_mac_address = dummy_set_address;
-#ifdef CONFIG_NET_FASTROUTE
-	dev->accept_fastpath = dummy_accept_fastpath;
-#endif
 
 	/* Fill in device structure with ethernet-generic values. */
 	ether_setup(dev);
 	dev->tx_queue_len = 0;
+	dev->change_mtu = NULL;
 	dev->flags |= IFF_NOARP;
 	dev->flags &= ~IFF_MULTICAST;
 	SET_MODULE_OWNER(dev);
diff --git a/drivers/net/e1000/e1000.h b/drivers/net/e1000/e1000.h
index d9225b32e..067bb099e 100644
--- a/drivers/net/e1000/e1000.h
+++ b/drivers/net/e1000/e1000.h
@@ -82,7 +82,7 @@ struct e1000_adapter;
 
 #include "e1000_hw.h"
 
-#if DBG
+#ifdef DBG
 #define E1000_DBG(args...) printk(KERN_DEBUG "e1000: " args)
 #else
 #define E1000_DBG(args...)
@@ -196,6 +196,7 @@ struct e1000_adapter {
 	uint32_t part_num;
 	uint32_t wol;
 	uint32_t smartspeed;
+	uint32_t en_mng_pt;
 	uint16_t link_speed;
 	uint16_t link_duplex;
 	spinlock_t stats_lock;
diff --git a/drivers/net/e1000/e1000_ethtool.c b/drivers/net/e1000/e1000_ethtool.c
index 0394fd28c..9ca716eab 100644
--- a/drivers/net/e1000/e1000_ethtool.c
+++ b/drivers/net/e1000/e1000_ethtool.c
@@ -1004,11 +1004,12 @@ e1000_setup_desc_rings(struct e1000_adapter *adapter)
 		struct e1000_rx_desc *rx_desc = E1000_RX_DESC(*rxdr, i);
 		struct sk_buff *skb;
 
-		if(!(skb = alloc_skb(E1000_RXBUFFER_2048 + 2, GFP_KERNEL))) {
+		if(!(skb = alloc_skb(E1000_RXBUFFER_2048 + NET_IP_ALIGN,
+				     GFP_KERNEL))) {
 			ret_val = 6;
 			goto err_nomem;
 		}
-		skb_reserve(skb, 2);
+		skb_reserve(skb, NET_IP_ALIGN);
 		rxdr->buffer_info[i].skb = skb;
 		rxdr->buffer_info[i].length = E1000_RXBUFFER_2048;
 		rxdr->buffer_info[i].dma =
diff --git a/drivers/net/e1000/e1000_hw.c b/drivers/net/e1000/e1000_hw.c
index a4d68616c..41c05e5c3 100644
--- a/drivers/net/e1000/e1000_hw.c
+++ b/drivers/net/e1000/e1000_hw.c
@@ -265,6 +265,17 @@ e1000_set_mac_type(struct e1000_hw *hw)
         return -E1000_ERR_MAC_TYPE;
     }
 
+    switch(hw->mac_type) {
+    case e1000_82541:
+    case e1000_82547:
+    case e1000_82541_rev_2:
+    case e1000_82547_rev_2:
+        hw->asf_firmware_present = TRUE;
+        break;
+    default:
+        break;
+    }
+
     return E1000_SUCCESS;
 }
 
@@ -5189,3 +5200,27 @@ e1000_set_vco_speed(struct e1000_hw *hw)
     return E1000_SUCCESS;
 }
 
+/******************************************************************************
+ * Verifies the hardware needs to allow ARPs to be processed by the host
+ *
+ * hw - Struct containing variables accessed by shared code
+ *
+ * returns: - TRUE/FALSE
+ *
+ *****************************************************************************/
+uint32_t
+e1000_enable_mng_pass_thru(struct e1000_hw *hw)
+{
+    uint32_t manc;
+
+    if (hw->asf_firmware_present) {
+        manc = E1000_READ_REG(hw, MANC);
+
+        if (!(manc & E1000_MANC_RCV_TCO_EN) ||
+            !(manc & E1000_MANC_EN_MAC_ADDR_FILTER))
+            return FALSE;
+        if ((manc & E1000_MANC_SMBUS_EN) && !(manc & E1000_MANC_ASF_EN))
+            return TRUE;
+    }
+    return FALSE;
+}
diff --git a/drivers/net/e1000/e1000_hw.h b/drivers/net/e1000/e1000_hw.h
index da964359d..c9ee93a0d 100644
--- a/drivers/net/e1000/e1000_hw.h
+++ b/drivers/net/e1000/e1000_hw.h
@@ -307,6 +307,7 @@ int32_t e1000_led_off(struct e1000_hw *hw);
 /* Adaptive IFS Functions */
 
 /* Everything else */
+uint32_t e1000_enable_mng_pass_thru(struct e1000_hw *hw);
 void e1000_clear_hw_cntrs(struct e1000_hw *hw);
 void e1000_reset_adaptive(struct e1000_hw *hw);
 void e1000_update_adaptive(struct e1000_hw *hw);
@@ -983,6 +984,7 @@ struct e1000_hw {
     e1000_ms_type master_slave;
     e1000_ms_type original_master_slave;
     e1000_ffe_config ffe_config_state;
+    uint32_t asf_firmware_present;
     unsigned long io_base;
     uint32_t phy_id;
     uint32_t phy_revision;
diff --git a/drivers/net/e1000/e1000_main.c b/drivers/net/e1000/e1000_main.c
index 256e86c1b..4b9b77567 100644
--- a/drivers/net/e1000/e1000_main.c
+++ b/drivers/net/e1000/e1000_main.c
@@ -299,7 +299,7 @@ e1000_down(struct e1000_adapter *adapter)
 void
 e1000_reset(struct e1000_adapter *adapter)
 {
-	uint32_t pba;
+	uint32_t pba, manc;
 	/* Repartition Pba for greater than 9k mtu
 	 * To take effect CTRL.RST is required.
 	 */
@@ -341,6 +341,12 @@ e1000_reset(struct e1000_adapter *adapter)
 
 	e1000_reset_adaptive(&adapter->hw);
 	e1000_phy_get_info(&adapter->hw, &adapter->phy_info);
+
+	if(adapter->en_mng_pt) {
+		manc = E1000_READ_REG(&adapter->hw, MANC);
+		manc |= (E1000_MANC_ARP_EN | E1000_MANC_EN_MNG2HOST);
+		E1000_WRITE_REG(&adapter->hw, MANC, manc);
+	}
 }
 
 /**
@@ -483,6 +489,8 @@ e1000_probe(struct pci_dev *pdev,
 	if(pci_using_dac)
 		netdev->features |= NETIF_F_HIGHDMA;
 
+	adapter->en_mng_pt = e1000_enable_mng_pass_thru(&adapter->hw);
+
 	/* before reading the EEPROM, reset the controller to 
 	 * put the device in a known good starting state */
 	
@@ -2367,7 +2375,6 @@ e1000_alloc_rx_buffers(struct e1000_adapter *adapter)
 	struct e1000_rx_desc *rx_desc;
 	struct e1000_buffer *buffer_info;
 	struct sk_buff *skb;
-	int reserve_len = 2;
 	unsigned int i;
 
 	i = rx_ring->next_to_use;
@@ -2376,7 +2383,7 @@ e1000_alloc_rx_buffers(struct e1000_adapter *adapter)
 	while(!buffer_info->skb) {
 		rx_desc = E1000_RX_DESC(*rx_ring, i);
 
-		skb = dev_alloc_skb(adapter->rx_buffer_len + reserve_len);
+		skb = dev_alloc_skb(adapter->rx_buffer_len + NET_IP_ALIGN);
 
 		if(!skb) {
 			/* Better luck next round */
@@ -2387,7 +2394,7 @@ e1000_alloc_rx_buffers(struct e1000_adapter *adapter)
 		 * this will result in a 16 byte aligned IP header after
 		 * the 14 byte MAC header is removed
 		 */
-		skb_reserve(skb, reserve_len);
+		skb_reserve(skb, NET_IP_ALIGN);
 
 		skb->dev = netdev;
 
diff --git a/drivers/net/e1000/e1000_osdep.h b/drivers/net/e1000/e1000_osdep.h
index d5bd04398..9e2086896 100644
--- a/drivers/net/e1000/e1000_osdep.h
+++ b/drivers/net/e1000/e1000_osdep.h
@@ -63,7 +63,7 @@ typedef enum {
 
 #define MSGOUT(S, A, B)	printk(KERN_DEBUG S "\n", A, B)
 
-#if DBG
+#ifdef DBG
 #define DEBUGOUT(S)		printk(KERN_DEBUG S "\n")
 #define DEBUGOUT1(S, A...)	printk(KERN_DEBUG S "\n", A)
 #else
diff --git a/drivers/net/e2100.c b/drivers/net/e2100.c
index 71c632b17..7fc98601c 100644
--- a/drivers/net/e2100.c
+++ b/drivers/net/e2100.c
@@ -51,6 +51,8 @@ static const char version[] =
 
 #include "8390.h"
 
+#define DRV_NAME "e2100"
+
 static int e21_probe_list[] = {0x300, 0x280, 0x380, 0x220, 0};
 
 /* Offsets from the base_addr.
@@ -144,6 +146,7 @@ static void cleanup_card(struct net_device *dev)
 	release_region(dev->base_addr, E21_IO_EXTENT);
 }
 
+#ifndef MODULE
 struct net_device * __init e2100_probe(int unit)
 {
 	struct net_device *dev = alloc_ei_netdev();
@@ -168,6 +171,7 @@ out:
 	free_netdev(dev);
 	return ERR_PTR(err);
 }
+#endif
 
 static int __init e21_probe1(struct net_device *dev, int ioaddr)
 {
@@ -175,7 +179,7 @@ static int __init e21_probe1(struct net_device *dev, int ioaddr)
 	unsigned char *station_addr = dev->dev_addr;
 	static unsigned version_printed;
 
-	if (!request_region(ioaddr, E21_IO_EXTENT, dev->name))
+	if (!request_region(ioaddr, E21_IO_EXTENT, DRV_NAME))
 		return -EBUSY;
 
 	/* First check the station address for the Ctron prefix. */
diff --git a/drivers/net/eepro.c b/drivers/net/eepro.c
index 785daf68d..9f5ea6075 100644
--- a/drivers/net/eepro.c
+++ b/drivers/net/eepro.c
@@ -151,6 +151,8 @@ static const char version[] =
 #include <asm/io.h>
 #include <asm/dma.h>
 
+#define DRV_NAME "eepro"
+
 #define compat_dev_kfree_skb( skb, mode ) dev_kfree_skb( (skb) )
 /* I had reports of looong delays with SLOW_DOWN defined as udelay(2) */
 #define SLOW_DOWN inb(0x80)
@@ -577,6 +579,7 @@ static int __init do_eepro_probe(struct net_device *dev)
 	return -ENODEV;
 }
 
+#ifndef MODULE
 struct net_device * __init eepro_probe(int unit)
 {
 	struct net_device *dev = alloc_etherdev(sizeof(struct eepro_local));
@@ -603,6 +606,7 @@ out:
 	free_netdev(dev);
 	return ERR_PTR(err);
 }
+#endif
 
 static void __init printEEPROMInfo(short ioaddr, struct net_device *dev)
 {
@@ -745,7 +749,7 @@ static int __init eepro_probe1(struct net_device *dev, int autoprobe)
 	int ioaddr = dev->base_addr;
 
 	/* Grab the region so we can find another board if autoIRQ fails. */
-	if (!request_region(ioaddr, EEPRO_IO_EXTENT, dev->name)) { 
+	if (!request_region(ioaddr, EEPRO_IO_EXTENT, DRV_NAME)) { 
 		if (!autoprobe)
 			printk(KERN_WARNING "EEPRO: io-port 0x%04x in use \n",
 				ioaddr);
diff --git a/drivers/net/eepro100.c b/drivers/net/eepro100.c
index 56fc87881..36b5508f4 100644
--- a/drivers/net/eepro100.c
+++ b/drivers/net/eepro100.c
@@ -87,12 +87,6 @@ static int options[] = {-1, -1, -1, -1, -1, -1, -1, -1};
 /* Size of an pre-allocated Rx buffer: <Ethernet MTU> + slack.*/
 #define PKT_BUF_SZ		1536
 
-#if !defined(__OPTIMIZE__)  ||  !defined(__KERNEL__)
-#warning  You must compile this file with the correct options!
-#warning  See the last lines of the source file.
-#error You must compile this driver with "-O".
-#endif
-
 #include <linux/config.h>
 #include <linux/version.h>
 #include <linux/module.h>
@@ -1027,7 +1021,7 @@ speedo_open(struct net_device *dev)
 	/* Set up the Tx queue early.. */
 	sp->cur_tx = 0;
 	sp->dirty_tx = 0;
-	sp->last_cmd = 0;
+	sp->last_cmd = NULL;
 	sp->tx_full = 0;
 	sp->in_interrupt = 0;
 
@@ -1361,7 +1355,7 @@ static void speedo_purge_tx(struct net_device *dev)
 					le32_to_cpu(sp->tx_ring[entry].tx_buf_addr0),
 					sp->tx_skbuff[entry]->len, PCI_DMA_TODEVICE);
 			dev_kfree_skb_irq(sp->tx_skbuff[entry]);
-			sp->tx_skbuff[entry] = 0;
+			sp->tx_skbuff[entry] = NULL;
 		}
 		sp->dirty_tx++;
 	}
@@ -1565,7 +1559,7 @@ static void speedo_tx_buffer_gc(struct net_device *dev)
 					le32_to_cpu(sp->tx_ring[entry].tx_buf_addr0),
 					sp->tx_skbuff[entry]->len, PCI_DMA_TODEVICE);
 			dev_kfree_skb_irq(sp->tx_skbuff[entry]);
-			sp->tx_skbuff[entry] = 0;
+			sp->tx_skbuff[entry] = NULL;
 		}
 		dirty_tx++;
 	}
@@ -1938,7 +1932,7 @@ speedo_close(struct net_device *dev)
     /* Free all the skbuffs in the Rx and Tx queues. */
 	for (i = 0; i < RX_RING_SIZE; i++) {
 		struct sk_buff *skb = sp->rx_skbuff[i];
-		sp->rx_skbuff[i] = 0;
+		sp->rx_skbuff[i] = NULL;
 		/* Clear the Rx descriptors. */
 		if (skb) {
 			pci_unmap_single(sp->pdev,
@@ -1950,7 +1944,7 @@ speedo_close(struct net_device *dev)
 
 	for (i = 0; i < TX_RING_SIZE; i++) {
 		struct sk_buff *skb = sp->tx_skbuff[i];
-		sp->tx_skbuff[i] = 0;
+		sp->tx_skbuff[i] = NULL;
 		/* Clear the Tx descriptors. */
 		if (skb) {
 			pci_unmap_single(sp->pdev,
@@ -2180,7 +2174,7 @@ static void set_rx_mode(struct net_device *dev)
 		last_cmd = sp->last_cmd;
 		sp->last_cmd = (struct descriptor *)&sp->tx_ring[entry];
 
-		sp->tx_skbuff[entry] = 0;			/* Redundant. */
+		sp->tx_skbuff[entry] = NULL;			/* Redundant. */
 		sp->tx_ring[entry].status = cpu_to_le32(CmdSuspend | CmdConfigure);
 		sp->tx_ring[entry].link =
 			cpu_to_le32(TX_RING_ELEM_DMA(sp, (entry + 1) % TX_RING_SIZE));
@@ -2223,7 +2217,7 @@ static void set_rx_mode(struct net_device *dev)
 		last_cmd = sp->last_cmd;
 		sp->last_cmd = (struct descriptor *)&sp->tx_ring[entry];
 
-		sp->tx_skbuff[entry] = 0;
+		sp->tx_skbuff[entry] = NULL;
 		sp->tx_ring[entry].status = cpu_to_le32(CmdSuspend | CmdMulticastList);
 		sp->tx_ring[entry].link =
 			cpu_to_le32(TX_RING_ELEM_DMA(sp, (entry + 1) % TX_RING_SIZE));
@@ -2304,7 +2298,7 @@ static void set_rx_mode(struct net_device *dev)
 		sp->last_cmd = mc_setup_frm;
 
 		/* Change the command to a NoOp, pointing to the CmdMulti command. */
-		sp->tx_skbuff[entry] = 0;
+		sp->tx_skbuff[entry] = NULL;
 		sp->tx_ring[entry].status = cpu_to_le32(CmdNOp);
 		sp->tx_ring[entry].link = cpu_to_le32(mc_blk->frame_dma);
 
diff --git a/drivers/net/eexpress.c b/drivers/net/eexpress.c
index 24663cb1c..1880fc0ba 100644
--- a/drivers/net/eexpress.c
+++ b/drivers/net/eexpress.c
@@ -230,7 +230,7 @@ static unsigned short start_code[] = {
 /* maps irq number to EtherExpress magic value */
 static char irqrmap[] = { 0,0,1,2,3,4,0,0,0,1,5,6,0,0,0,0 };
 
-#ifdef CONFIG_MCA
+#ifdef CONFIG_MCA_LEGACY
 /* mapping of the first four bits of the second POS register */
 static unsigned short mca_iomap[] = {
 	0x270, 0x260, 0x250, 0x240, 0x230, 0x220, 0x210, 0x200,
@@ -345,7 +345,7 @@ static int __init do_express_probe(struct net_device *dev)
 
 	dev->if_port = 0xff; /* not set */
 
-#ifdef CONFIG_MCA
+#ifdef CONFIG_MCA_LEGACY
 	if (MCA_bus) {
 		int slot = 0;
 
@@ -423,6 +423,7 @@ static int __init do_express_probe(struct net_device *dev)
 	return -ENODEV;
 }
 
+#ifndef MODULE
 struct net_device * __init express_probe(int unit)
 {
 	struct net_device *dev = alloc_etherdev(sizeof(struct net_local));
@@ -443,6 +444,7 @@ struct net_device * __init express_probe(int unit)
 	free_netdev(dev);
 	return ERR_PTR(err);
 }
+#endif
 
 /*
  * open and initialize the adapter, ready for use
diff --git a/drivers/net/epic100.c b/drivers/net/epic100.c
index 64e4aeb63..771bfc672 100644
--- a/drivers/net/epic100.c
+++ b/drivers/net/epic100.c
@@ -116,12 +116,6 @@ static int rx_copybreak;
 #define TX_FIFO_THRESH 256
 #define RX_FIFO_THRESH 1		/* 0-3, 0==32, 64,96, or 3==128 bytes  */
 
-#if !defined(__OPTIMIZE__)
-#warning  You must compile this file with the correct options!
-#warning  See the last lines of the source file.
-#error You must compile this driver with "-O".
-#endif
-
 #include <linux/config.h>
 #include <linux/module.h>
 #include <linux/kernel.h>
@@ -943,7 +937,7 @@ static void epic_init_ring(struct net_device *dev)
 		ep->rx_ring[i].buflength = cpu_to_le32(ep->rx_buf_sz);
 		ep->rx_ring[i].next = ep->rx_ring_dma + 
 				      (i+1)*sizeof(struct epic_rx_desc);
-		ep->rx_skbuff[i] = 0;
+		ep->rx_skbuff[i] = NULL;
 	}
 	/* Mark the last entry as wrapping the ring. */
 	ep->rx_ring[i-1].next = ep->rx_ring_dma;
@@ -965,7 +959,7 @@ static void epic_init_ring(struct net_device *dev)
 	/* The Tx buffer descriptor is filled in as needed, but we
 	   do need to clear the ownership bit. */
 	for (i = 0; i < TX_RING_SIZE; i++) {
-		ep->tx_skbuff[i] = 0;
+		ep->tx_skbuff[i] = NULL;
 		ep->tx_ring[i].txstatus = 0x0000;
 		ep->tx_ring[i].next = ep->tx_ring_dma + 
 			(i+1)*sizeof(struct epic_tx_desc);
@@ -1099,7 +1093,7 @@ static irqreturn_t epic_interrupt(int irq, void *dev_instance, struct pt_regs *r
 				pci_unmap_single(ep->pci_dev, ep->tx_ring[entry].bufaddr, 
 						 skb->len, PCI_DMA_TODEVICE);
 				dev_kfree_skb_irq(skb);
-				ep->tx_skbuff[entry] = 0;
+				ep->tx_skbuff[entry] = NULL;
 			}
 
 #ifndef final_version
@@ -1218,13 +1212,8 @@ static int epic_rx(struct net_device *dev)
 							    ep->rx_ring[entry].bufaddr,
 							    ep->rx_buf_sz,
 							    PCI_DMA_FROMDEVICE);
-#if 1 /* HAS_IP_COPYSUM */
 				eth_copy_and_sum(skb, ep->rx_skbuff[entry]->tail, pkt_len, 0);
 				skb_put(skb, pkt_len);
-#else
-				memcpy(skb_put(skb, pkt_len), ep->rx_skbuff[entry]->tail,
-					   pkt_len);
-#endif
 				pci_dma_sync_single_for_device(ep->pci_dev,
 							       ep->rx_ring[entry].bufaddr,
 							       ep->rx_buf_sz,
@@ -1285,7 +1274,7 @@ static int epic_close(struct net_device *dev)
 	/* Free all the skbuffs in the Rx queue. */
 	for (i = 0; i < RX_RING_SIZE; i++) {
 		skb = ep->rx_skbuff[i];
-		ep->rx_skbuff[i] = 0;
+		ep->rx_skbuff[i] = NULL;
 		ep->rx_ring[i].rxstatus = 0;		/* Not owned by Epic chip. */
 		ep->rx_ring[i].buflength = 0;
 		if (skb) {
@@ -1297,7 +1286,7 @@ static int epic_close(struct net_device *dev)
 	}
 	for (i = 0; i < TX_RING_SIZE; i++) {
 		skb = ep->tx_skbuff[i];
-		ep->tx_skbuff[i] = 0;
+		ep->tx_skbuff[i] = NULL;
 		if (!skb)
 			continue;
 		pci_unmap_single(ep->pci_dev, ep->tx_ring[i].bufaddr, 
diff --git a/drivers/net/eql.c b/drivers/net/eql.c
index 816534011..a53574b0e 100644
--- a/drivers/net/eql.c
+++ b/drivers/net/eql.c
@@ -389,7 +389,7 @@ static inline int eql_is_full(slave_queue_t *queue)
 static int __eql_insert_slave(slave_queue_t *queue, slave_t *slave)
 {
 	if (!eql_is_full(queue)) {
-		slave_t *duplicate_slave = 0;
+		slave_t *duplicate_slave = NULL;
 
 		duplicate_slave = __eql_find_slave_dev(queue, slave->dev);
 		if (duplicate_slave != 0)
@@ -495,8 +495,12 @@ static int eql_g_slave_cfg(struct net_device *dev, slave_config_t __user *scp)
 		return -EFAULT;
 
 	slave_dev = dev_get_by_name(sc.slave_name);
+	if (!slave_dev)
+		return -ENODEV;
 
 	ret = -EINVAL;
+	if (!slave_dev)
+		return ret;
 
 	spin_lock_bh(&eql->queue.lock);
 	if (eql_is_slave(slave_dev)) {
@@ -527,11 +531,15 @@ static int eql_s_slave_cfg(struct net_device *dev, slave_config_t __user *scp)
 	if (copy_from_user(&sc, scp, sizeof (slave_config_t)))
 		return -EFAULT;
 
-	eql = dev->priv;
 	slave_dev = dev_get_by_name(sc.slave_name);
+	if (!slave_dev)
+		return -ENODEV;
 
 	ret = -EINVAL;
+	if (!slave_dev)
+		return ret;
 
+	eql = dev->priv;
 	spin_lock_bh(&eql->queue.lock);
 	if (eql_is_slave(slave_dev)) {
 		slave = __eql_find_slave_dev(&eql->queue, slave_dev);
diff --git a/drivers/net/es3210.c b/drivers/net/es3210.c
index ca21905b6..50d8aadbb 100644
--- a/drivers/net/es3210.c
+++ b/drivers/net/es3210.c
@@ -161,6 +161,7 @@ static void cleanup_card(struct net_device *dev)
 	release_region(dev->base_addr, ES_IO_EXTENT);
 }
 
+#ifndef MODULE
 struct net_device * __init es_probe(int unit)
 {
 	struct net_device *dev = alloc_ei_netdev();
@@ -185,6 +186,7 @@ out:
 	free_netdev(dev);
 	return ERR_PTR(err);
 }
+#endif
 
 static int __init es_probe1(struct net_device *dev, int ioaddr)
 {
diff --git a/drivers/net/eth16i.c b/drivers/net/eth16i.c
index 88b441f85..5a9ae260f 100644
--- a/drivers/net/eth16i.c
+++ b/drivers/net/eth16i.c
@@ -458,6 +458,7 @@ static int __init do_eth16i_probe(struct net_device *dev)
 	return -ENODEV;
 }
 
+#ifndef MODULE
 struct net_device * __init eth16i_probe(int unit)
 {
 	struct net_device *dev = alloc_etherdev(sizeof(struct eth16i_local));
@@ -483,6 +484,7 @@ out:
 	free_netdev(dev);
 	return ERR_PTR(err);
 }
+#endif
 
 static int __init eth16i_probe1(struct net_device *dev, int ioaddr)
 {
@@ -491,7 +493,7 @@ static int __init eth16i_probe1(struct net_device *dev, int ioaddr)
 	int retval;
 
 	/* Let's grab the region */
-	if (!request_region(ioaddr, ETH16I_IO_EXTENT, dev->name))
+	if (!request_region(ioaddr, ETH16I_IO_EXTENT, cardname))
 		return -EBUSY;
 
 	/*
@@ -538,9 +540,9 @@ static int __init eth16i_probe1(struct net_device *dev, int ioaddr)
 
 	/* Try to obtain interrupt vector */
 
-	if ((retval = request_irq(dev->irq, (void *)&eth16i_interrupt, 0, dev->name, dev))) {
-		printk(KERN_WARNING "%s: %s at %#3x, but is unusable due conflicting IRQ %d.\n", 
-		       dev->name, cardname, ioaddr, dev->irq);
+	if ((retval = request_irq(dev->irq, (void *)&eth16i_interrupt, 0, cardname, dev))) {
+		printk(KERN_WARNING "%s at %#3x, but is unusable due to conflicting IRQ %d.\n", 
+		       cardname, ioaddr, dev->irq);
 		goto out;
 	}
 
diff --git a/drivers/net/ethertap.c b/drivers/net/ethertap.c
index c8f31fb4c..ef47c5c9a 100644
--- a/drivers/net/ethertap.c
+++ b/drivers/net/ethertap.c
@@ -13,7 +13,7 @@
  
 #include <linux/config.h>
 #include <linux/module.h>
-
+#include <linux/moduleparam.h>
 #include <linux/kernel.h>
 #include <linux/jiffies.h>
 #include <linux/slab.h>
@@ -45,7 +45,7 @@ static void set_multicast_list(struct net_device *dev);
 static int ethertap_debug;
 
 static int max_taps = 1;
-MODULE_PARM(max_taps, "i");
+module_param(max_taps, int, 0);
 MODULE_PARM_DESC(max_taps,"Max number of ethernet tap devices");
 
 static struct net_device **tap_map;	/* Returns the tap device for a given netlink */
diff --git a/drivers/net/ewrk3.c b/drivers/net/ewrk3.c
index eb9f346d1..d896baa2e 100644
--- a/drivers/net/ewrk3.c
+++ b/drivers/net/ewrk3.c
@@ -341,6 +341,7 @@ static int num_ewrks3s;
     mdelay(1);\
 }
 
+#ifndef MODULE
 struct net_device * __init ewrk3_probe(int unit)
 {
 	struct net_device *dev = alloc_etherdev(sizeof(struct ewrk3_private));
@@ -364,6 +365,7 @@ out:
 	return ERR_PTR(err);
 	
 }
+#endif
 
 static int __init ewrk3_probe1(struct net_device *dev, u_long iobase, int irq)
 {
@@ -1269,7 +1271,7 @@ static int __init isa_probe(struct net_device *dev, u_long ioaddr)
 	for (; (i < maxSlots) && (dev != NULL);
 	     iobase += EWRK3_IOP_INC, i++)
 	{
-		if (request_region(iobase, EWRK3_TOTAL_SIZE, dev->name)) {
+		if (request_region(iobase, EWRK3_TOTAL_SIZE, DRV_NAME)) {
 			if (DevicePresent(iobase) == 0) {
 				int irq = dev->irq;
 				ret = ewrk3_hw_init(dev, iobase);
@@ -1310,7 +1312,7 @@ static int __init eisa_probe(struct net_device *dev, u_long ioaddr)
 
 	for (i = 1; (i < maxSlots) && (dev != NULL); i++, iobase += EISA_SLOT_INC) {
 		if (EISA_signature(name, EISA_ID) == 0) {
-			if (request_region(iobase, EWRK3_TOTAL_SIZE, dev->name) &&
+			if (request_region(iobase, EWRK3_TOTAL_SIZE, DRV_NAME) &&
 			    DevicePresent(iobase) == 0) {
 				int irq = dev->irq;
 				ret = ewrk3_hw_init(dev, iobase);
diff --git a/drivers/net/fc/iph5526.c b/drivers/net/fc/iph5526.c
index ec3fff4e6..a5e12b2af 100644
--- a/drivers/net/fc/iph5526.c
+++ b/drivers/net/fc/iph5526.c
@@ -52,7 +52,7 @@ static const char *version =
 			       others + includes if_fcdevice.h */
 
 #include "../../scsi/scsi.h"
-#include "../../scsi/hosts.h"
+#include <scsi/scsi_host.h>
 #include "../../fc4/fcp.h"
 
 #include <asm/system.h>
diff --git a/drivers/net/fealnx.c b/drivers/net/fealnx.c
index b0fbb861c..9112ca037 100644
--- a/drivers/net/fealnx.c
+++ b/drivers/net/fealnx.c
@@ -858,12 +858,17 @@ static int netdev_open(struct net_device *dev)
 {
 	struct netdev_private *np = dev->priv;
 	long ioaddr = dev->base_addr;
+	int i;
 
 	writel(0x00000001, ioaddr + BCR);	/* Reset */
 
 	if (request_irq(dev->irq, &intr_handler, SA_SHIRQ, dev->name, dev))
 		return -EAGAIN;
 
+	for (i = 0; i < 3; i++)
+		writew(((unsigned short*)dev->dev_addr)[i],
+				ioaddr + PAR0 + i*2);
+
 	init_ring(dev);
 
 	writel(np->rx_ring_dma, ioaddr + RXLBA);
diff --git a/drivers/net/fmv18x.c b/drivers/net/fmv18x.c
index 8bfb50fff..f0b6f9c9d 100644
--- a/drivers/net/fmv18x.c
+++ b/drivers/net/fmv18x.c
@@ -57,6 +57,8 @@ static const char version[] =
 #include <asm/io.h>
 #include <asm/dma.h>
 
+#define DRV_NAME "fmv18x"
+
 static unsigned fmv18x_probe_list[] __initdata = {
 	0x220, 0x240, 0x260, 0x280, 0x2a0, 0x2c0, 0x300, 0x340, 0
 };
@@ -192,7 +194,7 @@ static int __init fmv18x_probe1(struct net_device *dev, short ioaddr)
 	   That means we have to be careful with the register values we probe for.
 	   */
 
-	if (!request_region(ioaddr, FMV18X_IO_EXTENT, dev->name))
+	if (!request_region(ioaddr, FMV18X_IO_EXTENT, DRV_NAME))
 		return -EBUSY;
 
 	dev->irq = irq;
@@ -224,7 +226,7 @@ static int __init fmv18x_probe1(struct net_device *dev, short ioaddr)
 	}
 
 	/* Snarf the interrupt vector now. */
-	retval = request_irq(dev->irq, &net_interrupt, 0, dev->name, dev);
+	retval = request_irq(dev->irq, &net_interrupt, 0, DRV_NAME, dev);
 	if (retval) {
 		printk ("FMV-18x found at %#3x, but it's unusable due to a conflict on"
 				"IRQ %d.\n", ioaddr, dev->irq);
diff --git a/drivers/net/forcedeth.c b/drivers/net/forcedeth.c
index 503e8f6c9..0ead66f20 100644
--- a/drivers/net/forcedeth.c
+++ b/drivers/net/forcedeth.c
@@ -10,8 +10,11 @@
  * trademarks of NVIDIA Corporation in the United States and other
  * countries.
  *
- * Copyright (C) 2003 Manfred Spraul
+ * Copyright (C) 2003,4 Manfred Spraul
  * Copyright (C) 2004 Andrew de Quincey (wol support)
+ * Copyright (C) 2004 Carl-Daniel Hailfinger (invalid MAC handling, insane
+ *		IRQ rate fixes, bigendian fixes, cleanups, verification)
+ * Copyright (c) 2004 NVIDIA Corporation
  *
  * This program is free software; you can redistribute it and/or modify
  * it under the terms of the GNU General Public License as published by
@@ -60,15 +63,18 @@
  * 	0.19: 29 Nov 2003: Handle RxNoBuf, detect & handle invalid mac
  * 			   addresses, really stop rx if already running
  * 			   in nv_start_rx, clean up a bit.
- * 				(C) Carl-Daniel Hailfinger
  * 	0.20: 07 Dec 2003: alloc fixes
  * 	0.21: 12 Jan 2004: additional alloc fix, nic polling fix.
  *	0.22: 19 Jan 2004: reprogram timer to a sane rate, avoid lockup
- * 			   on close.
- * 				(C) Carl-Daniel Hailfinger, Manfred Spraul
+ *			   on close.
  *	0.23: 26 Jan 2004: various small cleanups
  *	0.24: 27 Feb 2004: make driver even less anonymous in backtraces
  *	0.25: 09 Mar 2004: wol support
+ *	0.26: 03 Jun 2004: netdriver specific annotation, sparse-related fixes
+ *	0.27: 19 Jun 2004: Gigabit support, new descriptor rings,
+ *			   added CK804/MCP04 device IDs, code fixes
+ *			   for registers, link status and other minor fixes.
+ *	0.28: 21 Jun 2004: Big cleanup, making driver mostly endian safe
  *
  * Known bugs:
  * We suspect that on some hardware no TX done interrupts are generated.
@@ -80,7 +86,8 @@
  * DEV_NEED_TIMERIRQ will not harm you on sane hardware, only generating a few
  * superfluous timer interrupts from the nic.
  */
-#define FORCEDETH_VERSION		"0.25"
+#define FORCEDETH_VERSION		"0.28"
+#define DRV_NAME			"forcedeth"
 
 #include <linux/module.h>
 #include <linux/types.h>
@@ -123,6 +130,7 @@ enum {
 #define NVREG_IRQSTAT_MIIEVENT	0x040
 #define NVREG_IRQSTAT_MASK		0x1ff
 	NvRegIrqMask = 0x004,
+#define NVREG_IRQ_RX_ERROR		0x0001
 #define NVREG_IRQ_RX			0x0002
 #define NVREG_IRQ_RX_NOBUF		0x0004
 #define NVREG_IRQ_TX_ERR		0x0008
@@ -132,7 +140,7 @@ enum {
 #define NVREG_IRQ_TX1			0x0100
 #define NVREG_IRQMASK_WANTED_1		0x005f
 #define NVREG_IRQMASK_WANTED_2		0x0147
-#define NVREG_IRQ_UNKNOWN		(~(NVREG_IRQ_RX|NVREG_IRQ_RX_NOBUF|NVREG_IRQ_TX_ERR|NVREG_IRQ_TX2|NVREG_IRQ_TIMER|NVREG_IRQ_LINK|NVREG_IRQ_TX1))
+#define NVREG_IRQ_UNKNOWN		(~(NVREG_IRQ_RX_ERROR|NVREG_IRQ_RX|NVREG_IRQ_RX_NOBUF|NVREG_IRQ_TX_ERR|NVREG_IRQ_TX2|NVREG_IRQ_TIMER|NVREG_IRQ_LINK|NVREG_IRQ_TX1))
 
 	NvRegUnknownSetupReg6 = 0x008,
 #define NVREG_UNKSETUP6_VAL		3
@@ -159,7 +167,7 @@ enum {
 
 	NvRegOffloadConfig = 0x90,
 #define NVREG_OFFLOAD_HOMEPHY	0x601
-#define NVREG_OFFLOAD_NORMAL	0x5ee
+#define NVREG_OFFLOAD_NORMAL	RX_NIC_BUFSIZE
 	NvRegReceiverControl = 0x094,
 #define NVREG_RCVCTL_START	0x01
 	NvRegReceiverStatus = 0x98,
@@ -168,6 +176,8 @@ enum {
 	NvRegRandomSeed = 0x9c,
 #define NVREG_RNDSEED_MASK	0x00ff
 #define NVREG_RNDSEED_FORCE	0x7f00
+#define NVREG_RNDSEED_FORCE2	0x2d00
+#define NVREG_RNDSEED_FORCE3	0x7400
 
 	NvRegUnknownSetupReg1 = 0xA0,
 #define NVREG_UNKSETUP1_VAL	0x16070f
@@ -181,6 +191,9 @@ enum {
 	NvRegMulticastMaskA = 0xB8,
 	NvRegMulticastMaskB = 0xBC,
 
+	NvRegPhyInterface = 0xC0,
+#define PHY_RGMII		0x10000000
+
 	NvRegTxRingPhysAddr = 0x100,
 	NvRegRxRingPhysAddr = 0x104,
 	NvRegRingSizes = 0x108,
@@ -189,12 +202,12 @@ enum {
 	NvRegUnknownTransmitterReg = 0x10c,
 	NvRegLinkSpeed = 0x110,
 #define NVREG_LINKSPEED_FORCE 0x10000
-#define NVREG_LINKSPEED_10	10
+#define NVREG_LINKSPEED_10	1000
 #define NVREG_LINKSPEED_100	100
-#define NVREG_LINKSPEED_1000	1000
+#define NVREG_LINKSPEED_1000	50
 	NvRegUnknownSetupReg5 = 0x130,
 #define NVREG_UNKSETUP5_BIT31	(1<<31)
-	NvRegUnknownSetupReg3 = 0x134,
+	NvRegUnknownSetupReg3 = 0x13c,
 #define NVREG_UNKSETUP3_VAL1	0x200010
 	NvRegTxRxControl = 0x144,
 #define NVREG_TXRXCTL_KICK	0x0001
@@ -213,15 +226,15 @@ enum {
 	NvRegAdapterControl = 0x188,
 #define NVREG_ADAPTCTL_START	0x02
 #define NVREG_ADAPTCTL_LINKUP	0x04
-#define NVREG_ADAPTCTL_PHYVALID	0x4000
+#define NVREG_ADAPTCTL_PHYVALID	0x40000
 #define NVREG_ADAPTCTL_RUNNING	0x100000
 #define NVREG_ADAPTCTL_PHYSHIFT	24
 	NvRegMIISpeed = 0x18c,
 #define NVREG_MIISPEED_BIT8	(1<<8)
 #define NVREG_MIIDELAY	5
 	NvRegMIIControl = 0x190,
-#define NVREG_MIICTL_INUSE	0x10000
-#define NVREG_MIICTL_WRITE	0x08000
+#define NVREG_MIICTL_INUSE	0x08000
+#define NVREG_MIICTL_WRITE	0x00400
 #define NVREG_MIICTL_ADDRSHIFT	5
 	NvRegMIIData = 0x194,
 	NvRegWakeUpFlags = 0x200,
@@ -253,34 +266,63 @@ enum {
 #define NVREG_POWERSTATE_D3		0x0003
 };
 
+/* Big endian: should work, but is untested */
 struct ring_desc {
 	u32 PacketBuffer;
-	u16 Length;
-	u16 Flags;
+	u32 FlagLen;
 };
 
-#define NV_TX_LASTPACKET	(1<<0)
-#define NV_TX_RETRYERROR	(1<<3)
-#define NV_TX_LASTPACKET1	(1<<8)
-#define NV_TX_DEFERRED		(1<<10)
-#define NV_TX_CARRIERLOST	(1<<11)
-#define NV_TX_LATECOLLISION	(1<<12)
-#define NV_TX_UNDERFLOW		(1<<13)
-#define NV_TX_ERROR		(1<<14)
-#define NV_TX_VALID		(1<<15)
-
-#define NV_RX_DESCRIPTORVALID	(1<<0)
-#define NV_RX_MISSEDFRAME	(1<<1)
-#define NV_RX_SUBSTRACT1	(1<<3)
-#define NV_RX_ERROR1		(1<<7)
-#define NV_RX_ERROR2		(1<<8)
-#define NV_RX_ERROR3		(1<<9)
-#define NV_RX_ERROR4		(1<<10)
-#define NV_RX_CRCERR		(1<<11)
-#define NV_RX_OVERFLOW		(1<<12)
-#define NV_RX_FRAMINGERR	(1<<13)
-#define NV_RX_ERROR		(1<<14)
-#define NV_RX_AVAIL		(1<<15)
+#define FLAG_MASK_V1 0xffff0000
+#define FLAG_MASK_V2 0xffffc000
+#define LEN_MASK_V1 (0xffffffff ^ FLAG_MASK_V1)
+#define LEN_MASK_V2 (0xffffffff ^ FLAG_MASK_V2)
+
+#define NV_TX_LASTPACKET	(1<<16)
+#define NV_TX_RETRYERROR	(1<<19)
+#define NV_TX_LASTPACKET1	(1<<24)
+#define NV_TX_DEFERRED		(1<<26)
+#define NV_TX_CARRIERLOST	(1<<27)
+#define NV_TX_LATECOLLISION	(1<<28)
+#define NV_TX_UNDERFLOW		(1<<29)
+#define NV_TX_ERROR		(1<<30)
+#define NV_TX_VALID		(1<<31)
+
+#define NV_TX2_LASTPACKET	(1<<29)
+#define NV_TX2_RETRYERROR	(1<<18)
+#define NV_TX2_LASTPACKET1	(1<<23)
+#define NV_TX2_DEFERRED		(1<<25)
+#define NV_TX2_CARRIERLOST	(1<<26)
+#define NV_TX2_LATECOLLISION	(1<<27)
+#define NV_TX2_UNDERFLOW	(1<<28)
+/* error and valid are the same for both */
+#define NV_TX2_ERROR		(1<<30)
+#define NV_TX2_VALID		(1<<31)
+
+#define NV_RX_DESCRIPTORVALID	(1<<16)
+#define NV_RX_MISSEDFRAME	(1<<17)
+#define NV_RX_SUBSTRACT1	(1<<18)
+#define NV_RX_ERROR1		(1<<23)
+#define NV_RX_ERROR2		(1<<24)
+#define NV_RX_ERROR3		(1<<25)
+#define NV_RX_ERROR4		(1<<26)
+#define NV_RX_CRCERR		(1<<27)
+#define NV_RX_OVERFLOW		(1<<28)
+#define NV_RX_FRAMINGERR	(1<<29)
+#define NV_RX_ERROR		(1<<30)
+#define NV_RX_AVAIL		(1<<31)
+
+#define NV_RX2_DESCRIPTORVALID	(1<<29)
+#define NV_RX2_SUBSTRACT1	(1<<25)
+#define NV_RX2_ERROR1		(1<<18)
+#define NV_RX2_ERROR2		(1<<19)
+#define NV_RX2_ERROR3		(1<<20)
+#define NV_RX2_ERROR4		(1<<21)
+#define NV_RX2_CRCERR		(1<<22)
+#define NV_RX2_OVERFLOW		(1<<23)
+#define NV_RX2_FRAMINGERR	(1<<24)
+/* error and avail are the same for both */
+#define NV_RX2_ERROR		(1<<30)
+#define NV_RX2_AVAIL		(1<<31)
 
 /* Miscelaneous hardware related defines: */
 #define NV_PCI_REGSZ		0x270
@@ -306,28 +348,66 @@ struct ring_desc {
 
 /* General driver defaults */
 #define NV_WATCHDOG_TIMEO	(5*HZ)
-#define DEFAULT_MTU		1500	/* also maximum supported, at least for now */
 
 #define RX_RING		128
-#define TX_RING		16
-/* limited to 1 packet until we understand NV_TX_LASTPACKET */
-#define TX_LIMIT_STOP	10
-#define TX_LIMIT_START	5
+#define TX_RING		64
+/* 
+ * If your nic mysteriously hangs then try to reduce the limits
+ * to 1/0: It might be required to set NV_TX_LASTPACKET in the
+ * last valid ring entry. But this would be impossible to
+ * implement - probably a disassembly error.
+ */
+#define TX_LIMIT_STOP	63
+#define TX_LIMIT_START	62
 
 /* rx/tx mac addr + type + vlan + align + slack*/
-#define RX_NIC_BUFSIZE		(DEFAULT_MTU + 64)
+#define RX_NIC_BUFSIZE		(ETH_DATA_LEN + 64)
 /* even more slack */
-#define RX_ALLOC_BUFSIZE	(DEFAULT_MTU + 128)
+#define RX_ALLOC_BUFSIZE	(ETH_DATA_LEN + 128)
 
 #define OOM_REFILL	(1+HZ/20)
 #define POLL_WAIT	(1+HZ/100)
 
+#define DESC_VER_1	0x0
+#define DESC_VER_2	0x02100
+
+/* PHY defines */
+#define PHY_OUI_MARVELL	0x5043
+#define PHY_OUI_CICADA	0x03f1
+#define PHYID1_OUI_MASK	0x03ff
+#define PHYID1_OUI_SHFT	6
+#define PHYID2_OUI_MASK	0xfc00
+#define PHYID2_OUI_SHFT	10
+#define PHY_INIT1	0x0f000
+#define PHY_INIT2	0x0e00
+#define PHY_INIT3	0x01000
+#define PHY_INIT4	0x0200
+#define PHY_INIT5	0x0004
+#define PHY_INIT6	0x02000
+#define PHY_GIGABIT	0x0100
+
+#define PHY_TIMEOUT	0x1
+#define PHY_ERROR	0x2
+
+#define PHY_100	0x1
+#define PHY_1000	0x2
+#define PHY_HALF	0x100
+
+/* FIXME: MII defines that should be added to <linux/mii.h> */
+#define MII_1000BT_CR	0x09
+#define MII_1000BT_SR	0x0a
+#define ADVERTISE_1000FULL	0x0200
+#define ADVERTISE_1000HALF	0x0100
+#define LPA_1000FULL	0x0800
+#define LPA_1000HALF	0x0400
+
+
 /*
  * SMP locking:
  * All hardware access under dev->priv->lock, except the performance
  * critical parts:
  * - rx is (pseudo-) lockless: it relies on the single-threading provided
- * 	by the arch code for interrupts.
+ *	by the arch code for interrupts.
  * - tx setup is lockless: it relies on dev->xmit_lock. Actual submission
  *	needs dev->priv->lock :-(
  * - set_multicast_list: preparation lockless, relies on dev->xmit_lock.
@@ -345,12 +425,15 @@ struct fe_priv {
 	int duplex;
 	int phyaddr;
 	int wolenabled;
+	unsigned int phy_oui;
+	u16 gigabit;
 
 	/* General data: RO fields */
 	dma_addr_t ring_addr;
 	struct pci_dev *pci_dev;
 	u32 orig_mac[2];
 	u32 irqmask;
+	u32 desc_ver;
 
 	/* rx specific fields.
 	 * Locking: Within irq hander or disable_irq+spin_lock(&np->lock);
@@ -370,7 +453,7 @@ struct fe_priv {
 	unsigned int next_tx, nic_tx;
 	struct sk_buff *tx_skbuff[TX_RING];
 	dma_addr_t tx_dma[TX_RING];
-	u16 tx_flags;
+	u32 tx_flags;
 };
 
 /*
@@ -395,6 +478,12 @@ static inline void pci_push(u8 * base)
 	readl(base);
 }
 
+static inline u32 nv_descr_getlength(struct ring_desc *prd, u32 v)
+{
+	return le32_to_cpu(prd->FlagLen)
+		& ((v == DESC_VER_1) ? LEN_MASK_V1 : LEN_MASK_V2);
+}
+
 static int reg_delay(struct net_device *dev, int offset, u32 mask, u32 target,
 				int delay, int delaymax, const char *msg)
 {
@@ -421,24 +510,18 @@ static int reg_delay(struct net_device *dev, int offset, u32 mask, u32 target,
 static int mii_rw(struct net_device *dev, int addr, int miireg, int value)
 {
 	u8 *base = get_hwbase(dev);
-	int was_running;
 	u32 reg;
 	int retval;
 
 	writel(NVREG_MIISTAT_MASK, base + NvRegMIIStatus);
-	was_running = 0;
-	reg = readl(base + NvRegAdapterControl);
-	if (reg & NVREG_ADAPTCTL_RUNNING) {
-		was_running = 1;
-		writel(reg & ~NVREG_ADAPTCTL_RUNNING, base + NvRegAdapterControl);
-	}
+
 	reg = readl(base + NvRegMIIControl);
 	if (reg & NVREG_MIICTL_INUSE) {
 		writel(NVREG_MIICTL_INUSE, base + NvRegMIIControl);
 		udelay(NV_MIIBUSY_DELAY);
 	}
 
-	reg = NVREG_MIICTL_INUSE | (addr << NVREG_MIICTL_ADDRSHIFT) | miireg;
+	reg = (addr << NVREG_MIICTL_ADDRSHIFT) | miireg;
 	if (value != MII_READ) {
 		writel(value, base + NvRegMIIData);
 		reg |= NVREG_MIICTL_WRITE;
@@ -460,19 +543,117 @@ static int mii_rw(struct net_device *dev, int addr, int miireg, int value)
 				dev->name, miireg, addr);
 		retval = -1;
 	} else {
-		/* FIXME: why is that required? */
-		udelay(50);
 		retval = readl(base + NvRegMIIData);
 		dprintk(KERN_DEBUG "%s: mii_rw read from reg %d at PHY %d: 0x%x.\n",
 				dev->name, miireg, addr, retval);
 	}
-	if (was_running) {
-		reg = readl(base + NvRegAdapterControl);
-		writel(reg | NVREG_ADAPTCTL_RUNNING, base + NvRegAdapterControl);
-	}
+
 	return retval;
 }
 
+static int phy_reset(struct net_device *dev)
+{
+	struct fe_priv *np = get_nvpriv(dev);
+	u32 miicontrol;
+	unsigned int tries = 0;
+
+	miicontrol = mii_rw(dev, np->phyaddr, MII_BMCR, MII_READ);
+	miicontrol |= BMCR_RESET;
+	if (mii_rw(dev, np->phyaddr, MII_BMCR, miicontrol)) {
+		return -1;
+	}
+
+	/* wait for 500ms */
+	msleep(500);
+
+	/* must wait till reset is deasserted */
+	while (miicontrol & BMCR_RESET) {
+		msleep(10);
+		miicontrol = mii_rw(dev, np->phyaddr, MII_BMCR, MII_READ);
+		/* FIXME: 100 tries seem excessive */
+		if (tries++ > 100)
+			return -1;
+	}
+	return 0;
+}
+
+static int phy_init(struct net_device *dev)
+{
+	struct fe_priv *np = get_nvpriv(dev);
+	u8 *base = get_hwbase(dev);
+	u32 phyinterface, phy_reserved, mii_status, mii_control, mii_control_1000,reg;
+
+	/* set advertise register */
+	reg = mii_rw(dev, np->phyaddr, MII_ADVERTISE, MII_READ);
+	reg |= (ADVERTISE_10HALF|ADVERTISE_10FULL|ADVERTISE_100HALF|ADVERTISE_100FULL|0x800|0x400);
+	if (mii_rw(dev, np->phyaddr, MII_ADVERTISE, reg)) {
+		printk(KERN_INFO "%s: phy write to advertise failed.\n", pci_name(np->pci_dev));
+		return PHY_ERROR;
+	}
+
+	/* get phy interface type */
+	phyinterface = readl(base + NvRegPhyInterface);
+
+	/* see if gigabit phy */
+	mii_status = mii_rw(dev, np->phyaddr, MII_BMSR, MII_READ);
+	if (mii_status & PHY_GIGABIT) {
+		np->gigabit = PHY_GIGABIT;
+		mii_control_1000 = mii_rw(dev, np->phyaddr, MII_1000BT_CR, MII_READ);
+		mii_control_1000 &= ~ADVERTISE_1000HALF;
+		if (phyinterface & PHY_RGMII)
+			mii_control_1000 |= ADVERTISE_1000FULL;
+		else
+			mii_control_1000 &= ~ADVERTISE_1000FULL;
+
+		if (mii_rw(dev, np->phyaddr, MII_1000BT_CR, mii_control_1000)) {
+			printk(KERN_INFO "%s: phy init failed.\n", pci_name(np->pci_dev));
+			return PHY_ERROR;
+		}
+	}
+	else
+		np->gigabit = 0;
+
+	/* reset the phy */
+	if (phy_reset(dev)) {
+		printk(KERN_INFO "%s: phy reset failed\n", pci_name(np->pci_dev));
+		return PHY_ERROR;
+	}
+
+	/* phy vendor specific configuration */
+	if ((np->phy_oui == PHY_OUI_CICADA) && (phyinterface & PHY_RGMII) ) {
+		phy_reserved = mii_rw(dev, np->phyaddr, MII_RESV1, MII_READ);
+		phy_reserved &= ~(PHY_INIT1 | PHY_INIT2);
+		phy_reserved |= (PHY_INIT3 | PHY_INIT4);
+		if (mii_rw(dev, np->phyaddr, MII_RESV1, phy_reserved)) {
+			printk(KERN_INFO "%s: phy init failed.\n", pci_name(np->pci_dev));
+			return PHY_ERROR;
+		}
+		phy_reserved = mii_rw(dev, np->phyaddr, MII_NCONFIG, MII_READ);
+		phy_reserved |= PHY_INIT5;
+		if (mii_rw(dev, np->phyaddr, MII_NCONFIG, phy_reserved)) {
+			printk(KERN_INFO "%s: phy init failed.\n", pci_name(np->pci_dev));
+			return PHY_ERROR;
+		}
+	}
+	if (np->phy_oui == PHY_OUI_CICADA) {
+		phy_reserved = mii_rw(dev, np->phyaddr, MII_SREVISION, MII_READ);
+		phy_reserved |= PHY_INIT6;
+		if (mii_rw(dev, np->phyaddr, MII_SREVISION, phy_reserved)) {
+			printk(KERN_INFO "%s: phy init failed.\n", pci_name(np->pci_dev));
+			return PHY_ERROR;
+		}
+	}
+
+	/* restart auto negotiation */
+	mii_control = mii_rw(dev, np->phyaddr, MII_BMCR, MII_READ);
+	mii_control |= (BMCR_ANRESTART | BMCR_ANENABLE);
+	if (mii_rw(dev, np->phyaddr, MII_BMCR, mii_control)) {
+		return PHY_ERROR;
+	}
+
+	return 0;
+}
+
 static void nv_start_rx(struct net_device *dev)
 {
 	struct fe_priv *np = get_nvpriv(dev);
@@ -487,6 +668,8 @@ static void nv_start_rx(struct net_device *dev)
 	writel(np->linkspeed, base + NvRegLinkSpeed);
 	pci_push(base);
 	writel(NVREG_RCVCTL_START, base + NvRegReceiverControl);
+	dprintk(KERN_DEBUG "%s: nv_start_rx to duplex %d, speed 0x%08x.\n",
+				dev->name, np->duplex, np->linkspeed);
 	pci_push(base);
 }
 
@@ -497,8 +680,8 @@ static void nv_stop_rx(struct net_device *dev)
 	dprintk(KERN_DEBUG "%s: nv_stop_rx\n", dev->name);
 	writel(0, base + NvRegReceiverControl);
 	reg_delay(dev, NvRegReceiverStatus, NVREG_RCVSTAT_BUSY, 0,
-		       NV_RXSTOP_DELAY1, NV_RXSTOP_DELAY1MAX,
-		       KERN_INFO "nv_stop_rx: ReceiverStatus remained busy");
+			NV_RXSTOP_DELAY1, NV_RXSTOP_DELAY1MAX,
+			KERN_INFO "nv_stop_rx: ReceiverStatus remained busy");
 
 	udelay(NV_RXSTOP_DELAY2);
 	writel(0, base + NvRegLinkSpeed);
@@ -520,8 +703,8 @@ static void nv_stop_tx(struct net_device *dev)
 	dprintk(KERN_DEBUG "%s: nv_stop_tx\n", dev->name);
 	writel(0, base + NvRegTransmitterControl);
 	reg_delay(dev, NvRegTransmitterStatus, NVREG_XMITSTAT_BUSY, 0,
-		       NV_TXSTOP_DELAY1, NV_TXSTOP_DELAY1MAX,
-		       KERN_INFO "nv_stop_tx: TransmitterStatus remained busy");
+			NV_TXSTOP_DELAY1, NV_TXSTOP_DELAY1MAX,
+			KERN_INFO "nv_stop_tx: TransmitterStatus remained busy");
 
 	udelay(NV_TXSTOP_DELAY2);
 	writel(0, base + NvRegUnknownTransmitterReg);
@@ -529,13 +712,14 @@ static void nv_stop_tx(struct net_device *dev)
 
 static void nv_txrx_reset(struct net_device *dev)
 {
+	struct fe_priv *np = get_nvpriv(dev);
 	u8 *base = get_hwbase(dev);
 
 	dprintk(KERN_DEBUG "%s: nv_txrx_reset\n", dev->name);
-	writel(NVREG_TXRXCTL_BIT2 | NVREG_TXRXCTL_RESET, base + NvRegTxRxControl);
+	writel(NVREG_TXRXCTL_BIT2 | NVREG_TXRXCTL_RESET | np->desc_ver, base + NvRegTxRxControl);
 	pci_push(base);
 	udelay(NV_TXRX_RESET_DELAY);
-	writel(NVREG_TXRXCTL_BIT2, base + NvRegTxRxControl);
+	writel(NVREG_TXRXCTL_BIT2 | np->desc_ver, base + NvRegTxRxControl);
 	pci_push(base);
 }
 
@@ -650,11 +834,12 @@ static int nv_alloc_rx(struct net_device *dev)
 {
 	struct fe_priv *np = get_nvpriv(dev);
 	unsigned int refill_rx = np->refill_rx;
+	int nr;
 
 	while (np->cur_rx != refill_rx) {
-		int nr = refill_rx % RX_RING;
 		struct sk_buff *skb;
 
+		nr = refill_rx % RX_RING;
 		if (np->rx_skbuff[nr] == NULL) {
 
 			skb = dev_alloc_skb(RX_ALLOC_BUFSIZE);
@@ -669,10 +854,9 @@ static int nv_alloc_rx(struct net_device *dev)
 		np->rx_dma[nr] = pci_map_single(np->pci_dev, skb->data, skb->len,
 						PCI_DMA_FROMDEVICE);
 		np->rx_ring[nr].PacketBuffer = cpu_to_le32(np->rx_dma[nr]);
-		np->rx_ring[nr].Length = cpu_to_le16(RX_NIC_BUFSIZE);
 		wmb();
-		np->rx_ring[nr].Flags = cpu_to_le16(NV_RX_AVAIL);
-		dprintk(KERN_DEBUG "%s: nv_alloc_rx: Packet  %d marked as Available\n",
+		np->rx_ring[nr].FlagLen = cpu_to_le32(RX_NIC_BUFSIZE | NV_RX_AVAIL);
+		dprintk(KERN_DEBUG "%s: nv_alloc_rx: Packet %d marked as Available\n",
 					dev->name, refill_rx);
 		refill_rx++;
 	}
@@ -703,15 +887,13 @@ static int nv_init_ring(struct net_device *dev)
 	int i;
 
 	np->next_tx = np->nic_tx = 0;
-	for (i = 0; i < TX_RING; i++) {
-		np->tx_ring[i].Flags = 0;
-	}
+	for (i = 0; i < TX_RING; i++)
+		np->tx_ring[i].FlagLen = 0;
 
 	np->cur_rx = RX_RING;
 	np->refill_rx = 0;
-	for (i = 0; i < RX_RING; i++) {
-		np->rx_ring[i].Flags = 0;
-	}
+	for (i = 0; i < RX_RING; i++)
+		np->rx_ring[i].FlagLen = 0;
 	return nv_alloc_rx(dev);
 }
 
@@ -720,7 +902,7 @@ static void nv_drain_tx(struct net_device *dev)
 	struct fe_priv *np = get_nvpriv(dev);
 	int i;
 	for (i = 0; i < TX_RING; i++) {
-		np->tx_ring[i].Flags = 0;
+		np->tx_ring[i].FlagLen = 0;
 		if (np->tx_skbuff[i]) {
 			pci_unmap_single(np->pci_dev, np->tx_dma[i],
 						np->tx_skbuff[i]->len,
@@ -737,7 +919,7 @@ static void nv_drain_rx(struct net_device *dev)
 	struct fe_priv *np = get_nvpriv(dev);
 	int i;
 	for (i = 0; i < RX_RING; i++) {
-		np->rx_ring[i].Flags = 0;
+		np->rx_ring[i].FlagLen = 0;
 		wmb();
 		if (np->rx_skbuff[i]) {
 			pci_unmap_single(np->pci_dev, np->rx_dma[i],
@@ -769,11 +951,10 @@ static int nv_start_xmit(struct sk_buff *skb, struct net_device *dev)
 					PCI_DMA_TODEVICE);
 
 	np->tx_ring[nr].PacketBuffer = cpu_to_le32(np->tx_dma[nr]);
-	np->tx_ring[nr].Length = cpu_to_le16(skb->len-1);
 
 	spin_lock_irq(&np->lock);
 	wmb();
-	np->tx_ring[nr].Flags = np->tx_flags;
+	np->tx_ring[nr].FlagLen = cpu_to_le32( (skb->len-1) | np->tx_flags );
 	dprintk(KERN_DEBUG "%s: nv_start_xmit: packet packet %d queued for transmission.\n",
 				dev->name, np->next_tx);
 	{
@@ -792,7 +973,7 @@ static int nv_start_xmit(struct sk_buff *skb, struct net_device *dev)
 	if (np->next_tx - np->nic_tx >= TX_LIMIT_STOP)
 		netif_stop_queue(dev);
 	spin_unlock_irq(&np->lock);
-	writel(NVREG_TXRXCTL_KICK, get_hwbase(dev) + NvRegTxRxControl);
+	writel(NVREG_TXRXCTL_KICK|np->desc_ver, get_hwbase(dev) + NvRegTxRxControl);
 	pci_push(get_hwbase(dev));
 	return 0;
 }
@@ -805,27 +986,42 @@ static int nv_start_xmit(struct sk_buff *skb, struct net_device *dev)
 static void nv_tx_done(struct net_device *dev)
 {
 	struct fe_priv *np = get_nvpriv(dev);
+	u32 Flags;
+	int i;
 
-	while (np->nic_tx < np->next_tx) {
-		struct ring_desc *prd;
-		int i = np->nic_tx % TX_RING;
+	while (np->nic_tx != np->next_tx) {
+		i = np->nic_tx % TX_RING;
 
-		prd = &np->tx_ring[i];
+		Flags = le32_to_cpu(np->tx_ring[i].FlagLen);
 
 		dprintk(KERN_DEBUG "%s: nv_tx_done: looking at packet %d, Flags 0x%x.\n",
-					dev->name, np->nic_tx, prd->Flags);
-		if (prd->Flags & cpu_to_le16(NV_TX_VALID))
+					dev->name, np->nic_tx, Flags);
+		if (Flags & NV_TX_VALID)
 			break;
-		if (prd->Flags & cpu_to_le16(NV_TX_RETRYERROR|NV_TX_CARRIERLOST|NV_TX_LATECOLLISION|
-						NV_TX_UNDERFLOW|NV_TX_ERROR)) {
-			if (prd->Flags & cpu_to_le16(NV_TX_UNDERFLOW))
-				np->stats.tx_fifo_errors++;
-			if (prd->Flags & cpu_to_le16(NV_TX_CARRIERLOST))
-				np->stats.tx_carrier_errors++;
-			np->stats.tx_errors++;
+		if (np->desc_ver == DESC_VER_1) {
+			if (Flags & (NV_TX_RETRYERROR|NV_TX_CARRIERLOST|NV_TX_LATECOLLISION|
+							NV_TX_UNDERFLOW|NV_TX_ERROR)) {
+				if (Flags & NV_TX_UNDERFLOW)
+					np->stats.tx_fifo_errors++;
+				if (Flags & NV_TX_CARRIERLOST)
+					np->stats.tx_carrier_errors++;
+				np->stats.tx_errors++;
+			} else {
+				np->stats.tx_packets++;
+				np->stats.tx_bytes += np->tx_skbuff[i]->len;
+			}
 		} else {
-			np->stats.tx_packets++;
-			np->stats.tx_bytes += np->tx_skbuff[i]->len;
+			if (Flags & (NV_TX2_RETRYERROR|NV_TX2_CARRIERLOST|NV_TX2_LATECOLLISION|
+							NV_TX2_UNDERFLOW|NV_TX2_ERROR)) {
+				if (Flags & NV_TX2_UNDERFLOW)
+					np->stats.tx_fifo_errors++;
+				if (Flags & NV_TX2_CARRIERLOST)
+					np->stats.tx_carrier_errors++;
+				np->stats.tx_errors++;
+			} else {
+				np->stats.tx_packets++;
+				np->stats.tx_bytes += np->tx_skbuff[i]->len;
+			}
 		}
 		pci_unmap_single(np->pci_dev, np->tx_dma[i],
 					np->tx_skbuff[i]->len,
@@ -875,9 +1071,9 @@ static void nv_tx_timeout(struct net_device *dev)
 static void nv_rx_process(struct net_device *dev)
 {
 	struct fe_priv *np = get_nvpriv(dev);
+	u32 Flags;
 
 	for (;;) {
-		struct ring_desc *prd;
 		struct sk_buff *skb;
 		int len;
 		int i;
@@ -885,11 +1081,13 @@ static void nv_rx_process(struct net_device *dev)
 			break;	/* we scanned the whole ring - do not continue */
 
 		i = np->cur_rx % RX_RING;
-		prd = &np->rx_ring[i];
+		Flags = le32_to_cpu(np->rx_ring[i].FlagLen);
+		len = nv_descr_getlength(&np->rx_ring[i], np->desc_ver);
+
 		dprintk(KERN_DEBUG "%s: nv_rx_process: looking at packet %d, Flags 0x%x.\n",
-					dev->name, np->cur_rx, prd->Flags);
+					dev->name, np->cur_rx, Flags);
 
-		if (prd->Flags & cpu_to_le16(NV_RX_AVAIL))
+		if (Flags & NV_RX_AVAIL)
 			break;	/* still owned by hardware, */
 
 		/*
@@ -903,7 +1101,7 @@ static void nv_rx_process(struct net_device *dev)
 
 		{
 			int j;
-			dprintk(KERN_DEBUG "Dumping packet (flags 0x%x).",prd->Flags);
+			dprintk(KERN_DEBUG "Dumping packet (flags 0x%x).",Flags);
 			for (j=0; j<64; j++) {
 				if ((j%16) == 0)
 					dprintk("\n%03x:", j);
@@ -912,41 +1110,69 @@ static void nv_rx_process(struct net_device *dev)
 			dprintk("\n");
 		}
 		/* look at what we actually got: */
-		if (!(prd->Flags & cpu_to_le16(NV_RX_DESCRIPTORVALID)))
-			goto next_pkt;
-
-
-		len = le16_to_cpu(prd->Length);
+		if (np->desc_ver == DESC_VER_1) {
+			if (!(Flags & NV_RX_DESCRIPTORVALID))
+				goto next_pkt;
 
-		if (prd->Flags & cpu_to_le16(NV_RX_MISSEDFRAME)) {
-			np->stats.rx_missed_errors++;
-			np->stats.rx_errors++;
-			goto next_pkt;
-		}
-		if (prd->Flags & cpu_to_le16(NV_RX_ERROR1|NV_RX_ERROR2|NV_RX_ERROR3|NV_RX_ERROR4)) {
-			np->stats.rx_errors++;
-			goto next_pkt;
-		}
-		if (prd->Flags & cpu_to_le16(NV_RX_CRCERR)) {
-			np->stats.rx_crc_errors++;
-			np->stats.rx_errors++;
-			goto next_pkt;
-		}
-		if (prd->Flags & cpu_to_le16(NV_RX_OVERFLOW)) {
-			np->stats.rx_over_errors++;
-			np->stats.rx_errors++;
-			goto next_pkt;
-		}
-		if (prd->Flags & cpu_to_le16(NV_RX_ERROR)) {
-			/* framing errors are soft errors, the rest is fatal. */
-			if (prd->Flags & cpu_to_le16(NV_RX_FRAMINGERR)) {
-				if (prd->Flags & cpu_to_le16(NV_RX_SUBSTRACT1)) {
-					len--;
+			if (Flags & NV_RX_MISSEDFRAME) {
+				np->stats.rx_missed_errors++;
+				np->stats.rx_errors++;
+				goto next_pkt;
+			}
+			if (Flags & (NV_RX_ERROR1|NV_RX_ERROR2|NV_RX_ERROR3|NV_RX_ERROR4)) {
+				np->stats.rx_errors++;
+				goto next_pkt;
+			}
+			if (Flags & NV_RX_CRCERR) {
+				np->stats.rx_crc_errors++;
+				np->stats.rx_errors++;
+				goto next_pkt;
+			}
+			if (Flags & NV_RX_OVERFLOW) {
+				np->stats.rx_over_errors++;
+				np->stats.rx_errors++;
+				goto next_pkt;
+			}
+			if (Flags & NV_RX_ERROR) {
+				/* framing errors are soft errors, the rest is fatal. */
+				if (Flags & NV_RX_FRAMINGERR) {
+					if (Flags & NV_RX_SUBSTRACT1) {
+						len--;
+					}
+				} else {
+					np->stats.rx_errors++;
+					goto next_pkt;
 				}
-			} else {
+			}
+		} else {
+			if (!(Flags & NV_RX2_DESCRIPTORVALID))
+				goto next_pkt;
+
+			if (Flags & (NV_RX2_ERROR1|NV_RX2_ERROR2|NV_RX2_ERROR3|NV_RX2_ERROR4)) {
+				np->stats.rx_errors++;
+				goto next_pkt;
+			}
+			if (Flags & NV_RX2_CRCERR) {
+				np->stats.rx_crc_errors++;
 				np->stats.rx_errors++;
 				goto next_pkt;
 			}
+			if (Flags & NV_RX2_OVERFLOW) {
+				np->stats.rx_over_errors++;
+				np->stats.rx_errors++;
+				goto next_pkt;
+			}
+			if (Flags & NV_RX2_ERROR) {
+				/* framing errors are soft errors, the rest is fatal. */
+				if (Flags & NV_RX2_FRAMINGERR) {
+					if (Flags & NV_RX2_SUBSTRACT1) {
+						len--;
+					}
+				} else {
+					np->stats.rx_errors++;
+					goto next_pkt;
+				}
+			}
 		}
 		/* got a valid packet - forward it to the network core */
 		skb = np->rx_skbuff[i];
@@ -971,7 +1197,7 @@ next_pkt:
  */
 static int nv_change_mtu(struct net_device *dev, int new_mtu)
 {
-	if (new_mtu > DEFAULT_MTU)
+	if (new_mtu > ETH_DATA_LEN)
 		return -EINVAL;
 	dev->mtu = new_mtu;
 	return 0;
@@ -1035,6 +1261,8 @@ static void nv_set_multicast(struct net_device *dev)
 	writel(mask[0], base + NvRegMulticastMaskA);
 	writel(mask[1], base + NvRegMulticastMaskB);
 	writel(pff, base + NvRegPacketFilterFlags);
+	dprintk(KERN_INFO "%s: reconfiguration for multicast lists.\n",
+		dev->name);
 	nv_start_rx(dev);
 	spin_unlock_irq(&np->lock);
 }
@@ -1042,16 +1270,62 @@ static void nv_set_multicast(struct net_device *dev)
 static int nv_update_linkspeed(struct net_device *dev)
 {
 	struct fe_priv *np = get_nvpriv(dev);
-	int adv, lpa, newls, newdup;
+	u8 *base = get_hwbase(dev);
+	int adv, lpa;
+	int newls = np->linkspeed;
+	int newdup = np->duplex;
+	int mii_status;
+	int retval = 0;
+	u32 control_1000, status_1000, phyreg;
+
+	/* BMSR_LSTATUS is latched, read it twice:
+	 * we want the current value.
+	 */
+	mii_rw(dev, np->phyaddr, MII_BMSR, MII_READ);
+	mii_status = mii_rw(dev, np->phyaddr, MII_BMSR, MII_READ);
+
+	if (!(mii_status & BMSR_LSTATUS)) {
+		dprintk(KERN_DEBUG "%s: no link detected by phy - falling back to 10HD.\n",
+				dev->name);
+		newls = NVREG_LINKSPEED_FORCE|NVREG_LINKSPEED_10;
+		newdup = 0;
+		retval = 0;
+		goto set_speed;
+	}
+
+	/* check auto negotiation is complete */
+	if (!(mii_status & BMSR_ANEGCOMPLETE)) {
+		/* still in autonegotiation - configure nic for 10 MBit HD and wait. */
+		newls = NVREG_LINKSPEED_FORCE|NVREG_LINKSPEED_10;
+		newdup = 0;
+		retval = 0;
+		dprintk(KERN_DEBUG "%s: autoneg not completed - falling back to 10HD.\n", dev->name);
+		goto set_speed;
+	}
+
+	retval = 1;
+	if (np->gigabit == PHY_GIGABIT) {
+		control_1000 = mii_rw(dev, np->phyaddr, MII_1000BT_CR, MII_READ);
+		status_1000 = mii_rw(dev, np->phyaddr, MII_1000BT_SR, MII_READ);
+
+		if ((control_1000 & ADVERTISE_1000FULL) &&
+			(status_1000 & LPA_1000FULL)) {
+		dprintk(KERN_DEBUG "%s: nv_update_linkspeed: GBit ethernet detected.\n",
+				dev->name);
+			newls = NVREG_LINKSPEED_FORCE|NVREG_LINKSPEED_1000;
+			newdup = 1;
+			goto set_speed;
+		}
+	}
 
 	adv = mii_rw(dev, np->phyaddr, MII_ADVERTISE, MII_READ);
 	lpa = mii_rw(dev, np->phyaddr, MII_LPA, MII_READ);
 	dprintk(KERN_DEBUG "%s: nv_update_linkspeed: PHY advertises 0x%04x, lpa 0x%04x.\n",
 				dev->name, adv, lpa);
 
-	/* FIXME: handle parallel detection properly, handle gigabit ethernet */
+	/* FIXME: handle parallel detection properly */
 	lpa = lpa & adv;
-	if (lpa  & LPA_100FULL) {
+	if (lpa & LPA_100FULL) {
 		newls = NVREG_LINKSPEED_FORCE|NVREG_LINKSPEED_100;
 		newdup = 1;
 	} else if (lpa & LPA_100HALF) {
@@ -1068,47 +1342,75 @@ static int nv_update_linkspeed(struct net_device *dev)
 		newls = NVREG_LINKSPEED_FORCE|NVREG_LINKSPEED_10;
 		newdup = 0;
 	}
-	if (np->duplex != newdup || np->linkspeed != newls) {
-		np->duplex = newdup;
-		np->linkspeed = newls;
-		return 1;
+
+set_speed:
+	if (np->duplex == newdup && np->linkspeed == newls)
+		return retval;
+
+	dprintk(KERN_INFO "%s: changing link setting from %d/%d to %d/%d.\n",
+			dev->name, np->linkspeed, np->duplex, newls, newdup);
+
+	np->duplex = newdup;
+	np->linkspeed = newls;
+
+	if (np->gigabit == PHY_GIGABIT) {
+		phyreg = readl(base + NvRegRandomSeed);
+		phyreg &= ~(0x3FF00);
+		if ((np->linkspeed & 0xFFF) == NVREG_LINKSPEED_10)
+			phyreg |= NVREG_RNDSEED_FORCE3;
+		else if ((np->linkspeed & 0xFFF) == NVREG_LINKSPEED_100)
+			phyreg |= NVREG_RNDSEED_FORCE2;
+		else if ((np->linkspeed & 0xFFF) == NVREG_LINKSPEED_1000)
+			phyreg |= NVREG_RNDSEED_FORCE;
+		writel(phyreg, base + NvRegRandomSeed);
 	}
-	return 0;
+
+	phyreg = readl(base + NvRegPhyInterface);
+	phyreg &= ~(PHY_HALF|PHY_100|PHY_1000);
+	if (np->duplex == 0)
+		phyreg |= PHY_HALF;
+	if ((np->linkspeed & 0xFFF) == NVREG_LINKSPEED_100)
+		phyreg |= PHY_100;
+	else if ((np->linkspeed & 0xFFF) == NVREG_LINKSPEED_1000)
+		phyreg |= PHY_1000;
+	writel(phyreg, base + NvRegPhyInterface);
+
+	writel(NVREG_MISC1_FORCE | ( np->duplex ? 0 : NVREG_MISC1_HD),
+		base + NvRegMisc1);
+	pci_push(base);
+	writel(np->linkspeed, base + NvRegLinkSpeed);
+	pci_push(base);
+
+	return retval;
 }
 
 static void nv_link_irq(struct net_device *dev)
 {
-	struct fe_priv *np = get_nvpriv(dev);
 	u8 *base = get_hwbase(dev);
 	u32 miistat;
-	int miival;
 
 	miistat = readl(base + NvRegMIIStatus);
 	writel(NVREG_MIISTAT_MASK, base + NvRegMIIStatus);
-	printk(KERN_DEBUG "%s: link change notification, status 0x%x.\n", dev->name, miistat);
-
-	miival = mii_rw(dev, np->phyaddr, MII_BMSR, MII_READ);
-	if (miival & BMSR_ANEGCOMPLETE) {
-		nv_update_linkspeed(dev);
+	dprintk(KERN_DEBUG "%s: link change notification, status 0x%x.\n", dev->name, miistat);
 
-		if (netif_carrier_ok(dev)) {
-			nv_stop_rx(dev);
+	if (miistat & (NVREG_MIISTAT_LINKCHANGE)) {
+		if (nv_update_linkspeed(dev)) {
+			if (netif_carrier_ok(dev)) {
+				nv_stop_rx(dev);
+			} else {
+				netif_carrier_on(dev);
+				printk(KERN_INFO "%s: link up.\n", dev->name);
+			}
+			nv_start_rx(dev);
 		} else {
-			netif_carrier_on(dev);
-			printk(KERN_INFO "%s: link up.\n", dev->name);
-		}
-		writel(NVREG_MISC1_FORCE | ( np->duplex ? 0 : NVREG_MISC1_HD),
-					base + NvRegMisc1);
-		nv_start_rx(dev);
-	} else {
-		if (netif_carrier_ok(dev)) {
-			netif_carrier_off(dev);
-			printk(KERN_INFO "%s: link down.\n", dev->name);
-			nv_stop_rx(dev);
+			if (netif_carrier_ok(dev)) {
+				netif_carrier_off(dev);
+				printk(KERN_INFO "%s: link down.\n", dev->name);
+				nv_stop_rx(dev);
+			}
 		}
-		writel(np->linkspeed, base + NvRegLinkSpeed);
-		pci_push(base);
 	}
+	dprintk(KERN_DEBUG "%s: link change notification done.\n", dev->name);
 }
 
 static irqreturn_t nv_nic_irq(int foo, void *data, struct pt_regs *regs)
@@ -1135,7 +1437,7 @@ static irqreturn_t nv_nic_irq(int foo, void *data, struct pt_regs *regs)
 			spin_unlock(&np->lock);
 		}
 
-		if (events & (NVREG_IRQ_RX|NVREG_IRQ_RX_NOBUF)) {
+		if (events & (NVREG_IRQ_RX_ERROR|NVREG_IRQ_RX|NVREG_IRQ_RX_NOBUF)) {
 			nv_rx_process(dev);
 			if (nv_alloc_rx(dev)) {
 				spin_lock(&np->lock);
@@ -1157,7 +1459,7 @@ static irqreturn_t nv_nic_irq(int foo, void *data, struct pt_regs *regs)
 		if (events & (NVREG_IRQ_UNKNOWN)) {
 			printk(KERN_DEBUG "%s: received irq with unknown events 0x%x. Please report\n",
 						dev->name, events);
- 		}
+		}
 		if (i > max_interrupt_work) {
 			spin_lock(&np->lock);
 			/* disable interrupts on the nic */
@@ -1210,21 +1512,27 @@ static int nv_open(struct net_device *dev)
 	writel(0, base + NvRegMulticastMaskA);
 	writel(0, base + NvRegMulticastMaskB);
 	writel(0, base + NvRegPacketFilterFlags);
+
+	writel(0, base + NvRegTransmitterControl);
+	writel(0, base + NvRegReceiverControl);
+
 	writel(0, base + NvRegAdapterControl);
+
+	/* 2) initialize descriptor rings */
+	oom = nv_init_ring(dev);
+
 	writel(0, base + NvRegLinkSpeed);
 	writel(0, base + NvRegUnknownTransmitterReg);
 	nv_txrx_reset(dev);
 	writel(0, base + NvRegUnknownSetupReg6);
 
-	/* 2) initialize descriptor rings */
 	np->in_shutdown = 0;
-	oom = nv_init_ring(dev);
 
 	/* 3) set mac address */
 	{
 		u32 mac[2];
 
-		mac[0] = (dev->dev_addr[0] <<  0) + (dev->dev_addr[1] <<  8) +
+		mac[0] = (dev->dev_addr[0] << 0) + (dev->dev_addr[1] << 8) +
 				(dev->dev_addr[2] << 16) + (dev->dev_addr[3] << 24);
 		mac[1] = (dev->dev_addr[4] << 0) + (dev->dev_addr[5] << 8);
 
@@ -1232,53 +1540,31 @@ static int nv_open(struct net_device *dev)
 		writel(mac[1], base + NvRegMacAddrB);
 	}
 
-	/* 4) continue setup */
+	/* 4) give hw rings */
+	writel((u32) np->ring_addr, base + NvRegRxRingPhysAddr);
+	writel((u32) (np->ring_addr + RX_RING*sizeof(struct ring_desc)), base + NvRegTxRingPhysAddr);
+	writel( ((RX_RING-1) << NVREG_RINGSZ_RXSHIFT) + ((TX_RING-1) << NVREG_RINGSZ_TXSHIFT),
+		base + NvRegRingSizes);
+
+	/* 5) continue setup */
 	np->linkspeed = NVREG_LINKSPEED_FORCE|NVREG_LINKSPEED_10;
 	np->duplex = 0;
+
+	writel(np->linkspeed, base + NvRegLinkSpeed);
 	writel(NVREG_UNKSETUP3_VAL1, base + NvRegUnknownSetupReg3);
-	writel(0, base + NvRegTxRxControl);
+	writel(np->desc_ver, base + NvRegTxRxControl);
 	pci_push(base);
-	writel(NVREG_TXRXCTL_BIT1, base + NvRegTxRxControl);
+	writel(NVREG_TXRXCTL_BIT1|np->desc_ver, base + NvRegTxRxControl);
 	reg_delay(dev, NvRegUnknownSetupReg5, NVREG_UNKSETUP5_BIT31, NVREG_UNKSETUP5_BIT31,
 			NV_SETUP5_DELAY, NV_SETUP5_DELAYMAX,
 			KERN_INFO "open: SetupReg5, Bit 31 remained off\n");
-	writel(0, base + NvRegUnknownSetupReg4);
-
-	/* 5) Find a suitable PHY */
-	writel(NVREG_MIISPEED_BIT8|NVREG_MIIDELAY, base + NvRegMIISpeed);
-	for (i = 1; i < 32; i++) {
-		int id1, id2;
 
-		spin_lock_irq(&np->lock);
-		id1 = mii_rw(dev, i, MII_PHYSID1, MII_READ);
-		spin_unlock_irq(&np->lock);
-		if (id1 < 0 || id1 == 0xffff)
-			continue;
-		spin_lock_irq(&np->lock);
-		id2 = mii_rw(dev, i, MII_PHYSID2, MII_READ);
-		spin_unlock_irq(&np->lock);
-		if (id2 < 0 || id2 == 0xffff)
-			continue;
-		dprintk(KERN_DEBUG "%s: open: Found PHY %04x:%04x at address %d.\n",
-				dev->name, id1, id2, i);
-		np->phyaddr = i;
-
-		spin_lock_irq(&np->lock);
-		nv_update_linkspeed(dev);
-		spin_unlock_irq(&np->lock);
-
-		break;
-	}
-	if (i == 32) {
-		printk(KERN_INFO "%s: open: failing due to lack of suitable PHY.\n",
-				dev->name);
-		ret = -EINVAL;
-		goto out_drain;
-	}
+	writel(0, base + NvRegUnknownSetupReg4);
+	writel(NVREG_IRQSTAT_MASK, base + NvRegIrqStatus);
+	writel(NVREG_MIISTAT_MASK2, base + NvRegMIIStatus);
 
 	/* 6) continue setup */
-	writel(NVREG_MISC1_FORCE | ( np->duplex ? 0 : NVREG_MISC1_HD),
-				base + NvRegMisc1);
+	writel(NVREG_MISC1_FORCE | NVREG_MISC1_HD, base + NvRegMisc1);
 	writel(readl(base + NvRegTransmitterStatus), base + NvRegTransmitterStatus);
 	writel(NVREG_PFF_ALWAYS, base + NvRegPacketFilterFlags);
 	writel(NVREG_OFFLOAD_NORMAL, base + NvRegOffloadConfig);
@@ -1290,17 +1576,12 @@ static int nv_open(struct net_device *dev)
 	writel(NVREG_UNKSETUP2_VAL, base + NvRegUnknownSetupReg2);
 	writel(NVREG_POLL_DEFAULT, base + NvRegPollingInterval);
 	writel(NVREG_UNKSETUP6_VAL, base + NvRegUnknownSetupReg6);
-	writel((np->phyaddr << NVREG_ADAPTCTL_PHYSHIFT)|NVREG_ADAPTCTL_PHYVALID,
+	writel((np->phyaddr << NVREG_ADAPTCTL_PHYSHIFT)|NVREG_ADAPTCTL_PHYVALID|NVREG_ADAPTCTL_RUNNING,
 			base + NvRegAdapterControl);
+	writel(NVREG_MIISPEED_BIT8|NVREG_MIIDELAY, base + NvRegMIISpeed);
 	writel(NVREG_UNKSETUP4_VAL, base + NvRegUnknownSetupReg4);
 	writel(NVREG_WAKEUPFLAGS_VAL, base + NvRegWakeUpFlags);
 
-	/* 7) start packet processing */
-	writel((u32) np->ring_addr, base + NvRegRxRingPhysAddr);
-	writel((u32) (np->ring_addr + RX_RING*sizeof(struct ring_desc)), base + NvRegTxRingPhysAddr);
-	writel( ((RX_RING-1) << NVREG_RINGSZ_RXSHIFT) + ((TX_RING-1) << NVREG_RINGSZ_TXSHIFT),
-			base + NvRegRingSizes);
-
 	i = readl(base + NvRegPowerState);
 	if ( (i & NVREG_POWERSTATE_POWEREDUP) == 0)
 		writel(NVREG_POWERSTATE_POWEREDUP|i, base + NvRegPowerState);
@@ -1308,13 +1589,9 @@ static int nv_open(struct net_device *dev)
 	pci_push(base);
 	udelay(10);
 	writel(readl(base + NvRegPowerState) | NVREG_POWERSTATE_VALID, base + NvRegPowerState);
-	writel(NVREG_ADAPTCTL_RUNNING, base + NvRegAdapterControl);
-
 
 	writel(0, base + NvRegIrqMask);
 	pci_push(base);
-	writel(NVREG_IRQSTAT_MASK, base + NvRegIrqStatus);
-	pci_push(base);
 	writel(NVREG_MIISTAT_MASK2, base + NvRegMIIStatus);
 	writel(NVREG_IRQSTAT_MASK, base + NvRegIrqStatus);
 	pci_push(base);
@@ -1323,6 +1600,7 @@ static int nv_open(struct net_device *dev)
 	if (ret)
 		goto out_drain;
 
+	/* ask for interrupts */
 	writel(np->irqmask, base + NvRegIrqMask);
 
 	spin_lock_irq(&np->lock);
@@ -1331,18 +1609,27 @@ static int nv_open(struct net_device *dev)
 	writel(0, base + NvRegMulticastMaskA);
 	writel(0, base + NvRegMulticastMaskB);
 	writel(NVREG_PFF_ALWAYS|NVREG_PFF_MYADDR, base + NvRegPacketFilterFlags);
+	/* One manual link speed update: Interrupts are enabled, future link
+	 * speed changes cause interrupts and are handled by nv_link_irq().
+	 */
+	{
+		u32 miistat;
+		miistat = readl(base + NvRegMIIStatus);
+		writel(NVREG_MIISTAT_MASK, base + NvRegMIIStatus);
+		dprintk(KERN_INFO "startup: got 0x%08x.\n", miistat);
+	}
+	ret = nv_update_linkspeed(dev);
 	nv_start_rx(dev);
 	nv_start_tx(dev);
 	netif_start_queue(dev);
-	if (oom)
-		mod_timer(&np->oom_kick, jiffies + OOM_REFILL);
-	if (mii_rw(dev, np->phyaddr, MII_BMSR, MII_READ) & BMSR_ANEGCOMPLETE) {
+	if (ret) {
 		netif_carrier_on(dev);
 	} else {
 		printk("%s: no link during initialization.\n", dev->name);
 		netif_carrier_off(dev);
 	}
-
+	if (oom)
+		mod_timer(&np->oom_kick, jiffies + OOM_REFILL);
 	spin_unlock_irq(&np->lock);
 
 	return 0;
@@ -1424,7 +1711,7 @@ static int __devinit nv_probe(struct pci_dev *pci_dev, const struct pci_device_i
 
 	pci_set_master(pci_dev);
 
-	err = pci_request_regions(pci_dev, dev->name);
+	err = pci_request_regions(pci_dev, DRV_NAME);
 	if (err < 0)
 		goto out_disable;
 
@@ -1447,6 +1734,14 @@ static int __devinit nv_probe(struct pci_dev *pci_dev, const struct pci_device_i
 		goto out_relreg;
 	}
 
+	/* handle different descriptor versions */
+	if (pci_dev->device == PCI_DEVICE_ID_NVIDIA_NVENET_1 ||
+		pci_dev->device == PCI_DEVICE_ID_NVIDIA_NVENET_2 ||
+		pci_dev->device == PCI_DEVICE_ID_NVIDIA_NVENET_3)
+		np->desc_ver = DESC_VER_1;
+	else
+		np->desc_ver = DESC_VER_2;
+
 	err = -ENOMEM;
 	dev->base_addr = (unsigned long) ioremap(addr, NV_PCI_REGSZ);
 	if (!dev->base_addr)
@@ -1506,9 +1801,15 @@ static int __devinit nv_probe(struct pci_dev *pci_dev, const struct pci_device_i
 	writel(0, base + NvRegWakeUpFlags);
 	np->wolenabled = 0;
 
-	np->tx_flags = cpu_to_le16(NV_TX_LASTPACKET|NV_TX_LASTPACKET1|NV_TX_VALID);
-	if (id->driver_data & DEV_NEED_LASTPACKET1)
-		np->tx_flags |= cpu_to_le16(NV_TX_LASTPACKET1);
+	if (np->desc_ver == DESC_VER_1) {
+		np->tx_flags = NV_TX_LASTPACKET|NV_TX_VALID;
+		if (id->driver_data & DEV_NEED_LASTPACKET1)
+			np->tx_flags |= NV_TX_LASTPACKET1;
+	} else {
+		np->tx_flags = NV_TX2_LASTPACKET|NV_TX2_VALID;
+		if (id->driver_data & DEV_NEED_LASTPACKET1)
+			np->tx_flags |= NV_TX2_LASTPACKET1;
+	}
 	if (id->driver_data & DEV_IRQMASK_1)
 		np->irqmask = NVREG_IRQMASK_WANTED_1;
 	if (id->driver_data & DEV_IRQMASK_2)
@@ -1516,6 +1817,42 @@ static int __devinit nv_probe(struct pci_dev *pci_dev, const struct pci_device_i
 	if (id->driver_data & DEV_NEED_TIMERIRQ)
 		np->irqmask |= NVREG_IRQ_TIMER;
 
+	/* find a suitable phy */
+	for (i = 1; i < 32; i++) {
+		int id1, id2;
+
+		spin_lock_irq(&np->lock);
+		id1 = mii_rw(dev, i, MII_PHYSID1, MII_READ);
+		spin_unlock_irq(&np->lock);
+		if (id1 < 0 || id1 == 0xffff)
+			continue;
+		spin_lock_irq(&np->lock);
+		id2 = mii_rw(dev, i, MII_PHYSID2, MII_READ);
+		spin_unlock_irq(&np->lock);
+		if (id2 < 0 || id2 == 0xffff)
+			continue;
+
+		id1 = (id1 & PHYID1_OUI_MASK) << PHYID1_OUI_SHFT;
+		id2 = (id2 & PHYID2_OUI_MASK) >> PHYID2_OUI_SHFT;
+		dprintk(KERN_DEBUG "%s: open: Found PHY %04x:%04x at address %d.\n",
+				pci_name(pci_dev), id1, id2, i);
+		np->phyaddr = i;
+		np->phy_oui = id1 | id2;
+		break;
+	}
+	if (i == 32) {
+		/* PHY in isolate mode? No phy attached and user wants to
+		 * test loopback? Very odd, but can be correct.
+		 */
+		printk(KERN_INFO "%s: open: Could not find a valid PHY.\n",
+				pci_name(pci_dev));
+	}
+
+	if (i != 32) {
+		/* reset it */
+		phy_init(dev);
+	}
+
 	err = register_netdev(dev);
 	if (err) {
 		printk(KERN_INFO "forcedeth: unable to register netdev: %d\n", err);
@@ -1569,21 +1906,77 @@ static void __devexit nv_remove(struct pci_dev *pci_dev)
 static struct pci_device_id pci_tbl[] = {
 	{	/* nForce Ethernet Controller */
 		.vendor = PCI_VENDOR_ID_NVIDIA,
-		.device = 0x1C3,
+		.device = PCI_DEVICE_ID_NVIDIA_NVENET_1,
 		.subvendor = PCI_ANY_ID,
 		.subdevice = PCI_ANY_ID,
 		.driver_data = DEV_IRQMASK_1|DEV_NEED_TIMERIRQ,
 	},
 	{	/* nForce2 Ethernet Controller */
 		.vendor = PCI_VENDOR_ID_NVIDIA,
-		.device = 0x0066,
+		.device = PCI_DEVICE_ID_NVIDIA_NVENET_2,
+		.subvendor = PCI_ANY_ID,
+		.subdevice = PCI_ANY_ID,
+		.driver_data = DEV_NEED_LASTPACKET1|DEV_IRQMASK_2|DEV_NEED_TIMERIRQ,
+	},
+	{	/* nForce3 Ethernet Controller */
+		.vendor = PCI_VENDOR_ID_NVIDIA,
+		.device = PCI_DEVICE_ID_NVIDIA_NVENET_3,
+		.subvendor = PCI_ANY_ID,
+		.subdevice = PCI_ANY_ID,
+		.driver_data = DEV_NEED_LASTPACKET1|DEV_IRQMASK_2|DEV_NEED_TIMERIRQ,
+	},
+	{	/* nForce3 Ethernet Controller */
+		.vendor = PCI_VENDOR_ID_NVIDIA,
+		.device = PCI_DEVICE_ID_NVIDIA_NVENET_4,
+		.subvendor = PCI_ANY_ID,
+		.subdevice = PCI_ANY_ID,
+		.driver_data = DEV_NEED_LASTPACKET1|DEV_IRQMASK_2|DEV_NEED_TIMERIRQ,
+	},
+	{	/* nForce3 Ethernet Controller */
+		.vendor = PCI_VENDOR_ID_NVIDIA,
+		.device = PCI_DEVICE_ID_NVIDIA_NVENET_5,
+		.subvendor = PCI_ANY_ID,
+		.subdevice = PCI_ANY_ID,
+		.driver_data = DEV_NEED_LASTPACKET1|DEV_IRQMASK_2|DEV_NEED_TIMERIRQ,
+	},
+	{	/* nForce3 Ethernet Controller */
+		.vendor = PCI_VENDOR_ID_NVIDIA,
+		.device = PCI_DEVICE_ID_NVIDIA_NVENET_6,
 		.subvendor = PCI_ANY_ID,
 		.subdevice = PCI_ANY_ID,
 		.driver_data = DEV_NEED_LASTPACKET1|DEV_IRQMASK_2|DEV_NEED_TIMERIRQ,
 	},
 	{	/* nForce3 Ethernet Controller */
 		.vendor = PCI_VENDOR_ID_NVIDIA,
-		.device = 0x00D6,
+		.device = PCI_DEVICE_ID_NVIDIA_NVENET_7,
+		.subvendor = PCI_ANY_ID,
+		.subdevice = PCI_ANY_ID,
+		.driver_data = DEV_NEED_LASTPACKET1|DEV_IRQMASK_2|DEV_NEED_TIMERIRQ,
+	},
+	{	/* CK804 Ethernet Controller */
+		.vendor = PCI_VENDOR_ID_NVIDIA,
+		.device = PCI_DEVICE_ID_NVIDIA_NVENET_8,
+		.subvendor = PCI_ANY_ID,
+		.subdevice = PCI_ANY_ID,
+		.driver_data = DEV_NEED_LASTPACKET1|DEV_IRQMASK_2|DEV_NEED_TIMERIRQ,
+	},
+	{	/* CK804 Ethernet Controller */
+		.vendor = PCI_VENDOR_ID_NVIDIA,
+		.device = PCI_DEVICE_ID_NVIDIA_NVENET_9,
+		.subvendor = PCI_ANY_ID,
+		.subdevice = PCI_ANY_ID,
+		.driver_data = DEV_NEED_LASTPACKET1|DEV_IRQMASK_2|DEV_NEED_TIMERIRQ,
+	},
+	{	/* MCP04 Ethernet Controller */
+		.vendor = PCI_VENDOR_ID_NVIDIA,
+		.device = PCI_DEVICE_ID_NVIDIA_NVENET_10,
+		.subvendor = PCI_ANY_ID,
+		.subdevice = PCI_ANY_ID,
+		.driver_data = DEV_NEED_LASTPACKET1|DEV_IRQMASK_2|DEV_NEED_TIMERIRQ,
+	},
+	{	/* MCP04 Ethernet Controller */
+		.vendor = PCI_VENDOR_ID_NVIDIA,
+		.device = PCI_DEVICE_ID_NVIDIA_NVENET_11,
 		.subvendor = PCI_ANY_ID,
 		.subdevice = PCI_ANY_ID,
 		.driver_data = DEV_NEED_LASTPACKET1|DEV_IRQMASK_2|DEV_NEED_TIMERIRQ,
@@ -1610,9 +2003,9 @@ static void __exit exit_nic(void)
 	pci_unregister_driver(&driver);
 }
 
-MODULE_PARM(max_interrupt_work, "i");
+module_param(max_interrupt_work, int, 0);
 MODULE_PARM_DESC(max_interrupt_work, "forcedeth maximum events handled per interrupt");
- 
+
 MODULE_AUTHOR("Manfred Spraul <manfred@colorfullife.com>");
 MODULE_DESCRIPTION("Reverse Engineered nForce ethernet driver");
 MODULE_LICENSE("GPL");
diff --git a/drivers/net/hamachi.c b/drivers/net/hamachi.c
index f1ec80665..b5169e849 100644
--- a/drivers/net/hamachi.c
+++ b/drivers/net/hamachi.c
@@ -207,10 +207,8 @@ KERN_INFO "   Further modifications by Keith Underwood <keithu@parl.clemson.edu>
 /* Condensed bus+endian portability operations. */
 #if ADDRLEN == 64
 #define cpu_to_leXX(addr)	cpu_to_le64(addr)
-#define desc_to_virt(addr) bus_to_virt(le64_to_cpu(addr))
 #else 
 #define cpu_to_leXX(addr)	cpu_to_le32(addr)
-#define desc_to_virt(addr) bus_to_virt(le32_to_cpu(addr))
 #endif   
 
 
@@ -1019,7 +1017,7 @@ static inline int hamachi_tx(struct net_device *dev)
 				hmp->tx_ring[entry].addr, skb->len, 
 				PCI_DMA_TODEVICE);
 			dev_kfree_skb(skb);
-			hmp->tx_skbuff[entry] = 0;
+			hmp->tx_skbuff[entry] = NULL;
 		}
 		hmp->tx_ring[entry].status_n_length = 0;
 		if (entry >= TX_RING_SIZE-1) 
@@ -1107,7 +1105,7 @@ static void hamachi_tx_timeout(struct net_device *dev)
 			pci_unmap_single(hmp->pci_dev, hmp->tx_ring[i].addr, 
 				skb->len, PCI_DMA_TODEVICE);
 			dev_kfree_skb(skb);
-			hmp->tx_skbuff[i] = 0;
+			hmp->tx_skbuff[i] = NULL;
 		}
 	}
 
@@ -1129,7 +1127,7 @@ static void hamachi_tx_timeout(struct net_device *dev)
 			pci_unmap_single(hmp->pci_dev, hmp->rx_ring[i].addr, 
 				hmp->rx_buf_sz, PCI_DMA_FROMDEVICE);
 			dev_kfree_skb(skb);
-			hmp->rx_skbuff[i] = 0;
+			hmp->rx_skbuff[i] = NULL;
 		}
 	}
 	/* Fill in the Rx buffers.  Handle allocation failure gracefully. */
@@ -1191,7 +1189,7 @@ static void hamachi_init_ring(struct net_device *dev)
 	/* Initialize all Rx descriptors. */
 	for (i = 0; i < RX_RING_SIZE; i++) {
 		hmp->rx_ring[i].status_n_length = 0;
-		hmp->rx_skbuff[i] = 0;
+		hmp->rx_skbuff[i] = NULL;
 	}
 	/* Fill in the Rx buffers.  Handle allocation failure gracefully. */
 	for (i = 0; i < RX_RING_SIZE; i++) {
@@ -1211,7 +1209,7 @@ static void hamachi_init_ring(struct net_device *dev)
 	hmp->rx_ring[RX_RING_SIZE-1].status_n_length |= cpu_to_le32(DescEndRing);
 
 	for (i = 0; i < TX_RING_SIZE; i++) {
-		hmp->tx_skbuff[i] = 0;
+		hmp->tx_skbuff[i] = NULL;
 		hmp->tx_ring[i].status_n_length = 0;
 	}
 	/* Mark the last entry of the ring */
@@ -1423,7 +1421,7 @@ static irqreturn_t hamachi_interrupt(int irq, void *dev_instance, struct pt_regs
 							skb->len,
 							PCI_DMA_TODEVICE);
 						dev_kfree_skb_irq(skb);
-						hmp->tx_skbuff[entry] = 0;
+						hmp->tx_skbuff[entry] = NULL;
 					}
 					hmp->tx_ring[entry].status_n_length = 0;
 					if (entry >= TX_RING_SIZE-1)  
@@ -1502,7 +1500,7 @@ static int hamachi_rx(struct net_device *dev)
 					    desc->addr,
 					    hmp->rx_buf_sz,
 					    PCI_DMA_FROMDEVICE);
-		buf_addr = desc_to_virt(desc->addr);
+		buf_addr = (u8 *) hmp->rx_skbuff[entry]->tail;
 		frame_status = le32_to_cpu(get_unaligned((s32*)&(buf_addr[data_size - 12])));
 		if (hamachi_debug > 4)
 			printk(KERN_DEBUG "  hamachi_rx() status was %8.8x.\n",
@@ -1793,7 +1791,7 @@ static int hamachi_close(struct net_device *dev)
 				hmp->rx_ring[i].addr, hmp->rx_buf_sz, 
 				PCI_DMA_FROMDEVICE);
 			dev_kfree_skb(skb);
-			hmp->rx_skbuff[i] = 0;
+			hmp->rx_skbuff[i] = NULL;
 		}
 	}
 	for (i = 0; i < TX_RING_SIZE; i++) {
@@ -1803,7 +1801,7 @@ static int hamachi_close(struct net_device *dev)
 				hmp->tx_ring[i].addr, skb->len, 
 				PCI_DMA_TODEVICE);
 			dev_kfree_skb(skb);
-			hmp->tx_skbuff[i] = 0;
+			hmp->tx_skbuff[i] = NULL;
 		}
 	}
 
diff --git a/drivers/net/hamradio/6pack.c b/drivers/net/hamradio/6pack.c
index f5b9af0ae..e6dba5623 100644
--- a/drivers/net/hamradio/6pack.c
+++ b/drivers/net/hamradio/6pack.c
@@ -731,7 +731,7 @@ static void sixpack_close(struct tty_struct *tty)
 
 	write_lock(&disc_data_lock);
 	sp = tty->disc_data;
-	tty->disc_data = 0;
+	tty->disc_data = NULL;
 	write_unlock(&disc_data_lock);
 	if (sp == 0)
 		return;
@@ -750,7 +750,7 @@ static void sixpack_close(struct tty_struct *tty)
 	unregister_netdev(sp->dev);
 }
 
-static int sp_set_mac_address(struct net_device *dev, void *addr)
+static int sp_set_mac_address(struct net_device *dev, void __user *addr)
 {
 	return copy_from_user(dev->dev_addr, addr, AX25_ADDR_LEN) ? -EFAULT : 0;
 }
@@ -767,16 +767,16 @@ static int sixpack_ioctl(struct tty_struct *tty, struct file *file,
 
 	switch(cmd) {
 	case SIOCGIFNAME:
-		err = copy_to_user((void *) arg, sp->dev->name,
+		err = copy_to_user((void __user *) arg, sp->dev->name,
 		                   strlen(sp->dev->name) + 1) ? -EFAULT : 0;
 		break;
 
 	case SIOCGIFENCAP:
-		err = put_user(0, (int *)arg);
+		err = put_user(0, (int __user *)arg);
 		break;
 
 	case SIOCSIFENCAP:
-		if (get_user(tmp, (int *) arg)) {
+		if (get_user(tmp, (int __user *) arg)) {
 			err = -EFAULT;
 			break;
 		}
@@ -790,7 +790,7 @@ static int sixpack_ioctl(struct tty_struct *tty, struct file *file,
 		break;
 
 	 case SIOCSIFHWADDR:
-		err = sp_set_mac_address(sp->dev, (void *) arg);
+		err = sp_set_mac_address(sp->dev, (void __user *) arg);
 		break;
 
 	/* Allow stty to read, but not set, the serial port */
diff --git a/drivers/net/hamradio/Kconfig b/drivers/net/hamradio/Kconfig
index 71e1873fb..34068f81d 100644
--- a/drivers/net/hamradio/Kconfig
+++ b/drivers/net/hamradio/Kconfig
@@ -113,6 +113,7 @@ config SCC_TRXECHO
 config BAYCOM_SER_FDX
 	tristate "BAYCOM ser12 fullduplex driver for AX.25"
 	depends on AX25
+	select CRC_CCITT
 	---help---
 	  This is one of two drivers for Baycom style simple amateur radio
 	  modems that connect to a serial interface. The driver supports the
@@ -132,6 +133,7 @@ config BAYCOM_SER_FDX
 config BAYCOM_SER_HDX
 	tristate "BAYCOM ser12 halfduplex driver for AX.25"
 	depends on AX25
+	select CRC_CCITT
 	---help---
 	  This is one of two drivers for Baycom style simple amateur radio
 	  modems that connect to a serial interface. The driver supports the
@@ -149,6 +151,7 @@ config BAYCOM_SER_HDX
 config BAYCOM_PAR
 	tristate "BAYCOM picpar and par96 driver for AX.25"
 	depends on PARPORT && AX25
+	select CRC_CCITT
 	---help---
 	  This is a driver for Baycom style simple amateur radio modems that
 	  connect to a parallel interface. The driver supports the picpar and
@@ -163,6 +166,7 @@ config BAYCOM_PAR
 config BAYCOM_EPP
 	tristate "BAYCOM epp driver for AX.25"
 	depends on PARPORT && AX25 && !64BIT
+	select CRC_CCITT
 	---help---
 	  This is a driver for Baycom style simple amateur radio modems that
 	  connect to a parallel interface. The driver supports the EPP
diff --git a/drivers/net/hamradio/baycom_epp.c b/drivers/net/hamradio/baycom_epp.c
index d5b7db1bd..b3f64f722 100644
--- a/drivers/net/hamradio/baycom_epp.c
+++ b/drivers/net/hamradio/baycom_epp.c
@@ -58,6 +58,7 @@
 /* prototypes for ax25_encapsulate and ax25_rebuild_header */
 #include <net/ax25.h> 
 #endif /* CONFIG_AX25 || CONFIG_AX25_MODULE */
+#include <linux/crc-ccitt.h>
 
 /* --------------------------------------------------------------------- */
 
@@ -260,40 +261,6 @@ struct baycom_state {
  * by Dieter Deyke
  */
 
-static const unsigned short crc_ccitt_table[] = {
-	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
-};
 
 /*---------------------------------------------------------------------------*/
 
@@ -314,23 +281,14 @@ static inline void append_crc_ccitt(unsigned char *buffer, int len)
 
 static inline int check_crc_ccitt(const unsigned char *buf, int cnt)
 {
-	unsigned int crc = 0xffff;
-
-	for (; cnt > 0; cnt--)
-		crc = (crc >> 8) ^ crc_ccitt_table[(crc ^ *buf++) & 0xff];
-	return (crc & 0xffff) == 0xf0b8;
+	return (crc_ccitt(0xffff, buf, cnt) & 0xffff) == 0xf0b8;
 }
 
 /*---------------------------------------------------------------------------*/
 
 static inline int calc_crc_ccitt(const unsigned char *buf, int cnt)
 {
-	unsigned int crc = 0xffff;
-
-	for (; cnt > 0; cnt--)
-		crc = (crc >> 8) ^ crc_ccitt_table[(crc ^ *buf++) & 0xff];
-	crc ^= 0xffff;
-	return (crc & 0xffff);
+	return (crc_ccitt(0xffff, buf, cnt) ^ 0xffff) & 0xffff;
 }
 
 /* ---------------------------------------------------------------------- */
diff --git a/drivers/net/hamradio/hdlcdrv.c b/drivers/net/hamradio/hdlcdrv.c
index 103baaff1..86deb5210 100644
--- a/drivers/net/hamradio/hdlcdrv.c
+++ b/drivers/net/hamradio/hdlcdrv.c
@@ -66,6 +66,7 @@
 #include <linux/ip.h>
 #include <linux/udp.h>
 #include <linux/tcp.h>
+#include <linux/crc-ccitt.h>
 
 /* --------------------------------------------------------------------- */
 
@@ -99,50 +100,12 @@ static char ax25_nocall[AX25_ADDR_LEN] =
  * by Dieter Deyke
  */
 
-static const unsigned short crc_ccitt_table[] = {
-	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
-};
 
 /*---------------------------------------------------------------------------*/
 
 static inline void append_crc_ccitt(unsigned char *buffer, int len)
 {
- 	unsigned int crc = 0xffff;
-
-	for (;len>0;len--)
-		crc = (crc >> 8) ^ crc_ccitt_table[(crc ^ *buffer++) & 0xff];
-	crc ^= 0xffff;
+ 	unsigned int crc = crc_ccitt(0xffff, buffer, len) ^ 0xffff;
 	*buffer++ = crc;
 	*buffer++ = crc >> 8;
 }
@@ -151,11 +114,7 @@ static inline void append_crc_ccitt(unsigned char *buffer, int len)
 
 static inline int check_crc_ccitt(const unsigned char *buf, int cnt)
 {
-	unsigned int crc = 0xffff;
-
-	for (; cnt > 0; cnt--)
-		crc = (crc >> 8) ^ crc_ccitt_table[(crc ^ *buf++) & 0xff];
-	return (crc & 0xffff) == 0xf0b8;
+	return (crc_ccitt(0xffff, buf, cnt) & 0xffff) == 0xf0b8;
 }
 
 /*---------------------------------------------------------------------------*/
@@ -588,6 +547,8 @@ static int hdlcdrv_close(struct net_device *dev)
 		return -EINVAL;
 	s = (struct hdlcdrv_state *)dev->priv;
 
+	netif_stop_queue(dev);
+
 	if (s->ops && s->ops->close)
 		i = s->ops->close(dev);
 	if (s->skb)
diff --git a/drivers/net/hamradio/mkiss.c b/drivers/net/hamradio/mkiss.c
index 4d29cf4d5..c7076aa0b 100644
--- a/drivers/net/hamradio/mkiss.c
+++ b/drivers/net/hamradio/mkiss.c
@@ -626,7 +626,7 @@ static void ax25_close(struct tty_struct *tty)
 
 	unregister_netdev(ax->dev);
 
-	tty->disc_data = 0;
+	tty->disc_data = NULL;
 	ax->tty        = NULL;
 
 	ax_free(ax);
@@ -774,7 +774,7 @@ static void kiss_unesc(struct ax_disp *ax, unsigned char s)
 }
 
 
-static int ax_set_mac_address(struct net_device *dev, void *addr)
+static int ax_set_mac_address(struct net_device *dev, void __user *addr)
 {
 	if (copy_from_user(dev->dev_addr, addr, AX25_ADDR_LEN))
 		return -EFAULT;
@@ -792,7 +792,7 @@ static int ax_set_dev_mac_address(struct net_device *dev, void *addr)
 
 
 /* Perform I/O control on an active ax25 channel. */
-static int ax25_disp_ioctl(struct tty_struct *tty, void *file, int cmd, void *arg)
+static int ax25_disp_ioctl(struct tty_struct *tty, void *file, int cmd, void __user *arg)
 {
 	struct ax_disp *ax = (struct ax_disp *) tty->disc_data;
 	unsigned int tmp;
@@ -808,10 +808,10 @@ static int ax25_disp_ioctl(struct tty_struct *tty, void *file, int cmd, void *ar
 			return 0;
 
 		case SIOCGIFENCAP:
-			return put_user(4, (int *)arg);
+			return put_user(4, (int __user *)arg);
 
 		case SIOCSIFENCAP:
-			if (get_user(tmp, (int *)arg))
+			if (get_user(tmp, (int __user *)arg))
 				return -EFAULT;
 			ax->mode = tmp;
 			ax->dev->addr_len        = AX25_ADDR_LEN;	  /* sizeof an AX.25 addr */
diff --git a/drivers/net/hamradio/scc.c b/drivers/net/hamradio/scc.c
index f7fc3b9c0..2049556d1 100644
--- a/drivers/net/hamradio/scc.c
+++ b/drivers/net/hamradio/scc.c
@@ -7,7 +7,7 @@
  *            ------------------
  *
  * You can find a subset of the documentation in 
- * linux/Documentation/networking/z8530drv.txt.
+ * Documentation/networking/z8530drv.txt.
  */
 
 /*
diff --git a/drivers/net/hp-plus.c b/drivers/net/hp-plus.c
index 0e60de808..4b6c01aa2 100644
--- a/drivers/net/hp-plus.c
+++ b/drivers/net/hp-plus.c
@@ -37,6 +37,8 @@ static const char version[] =
 
 #include "8390.h"
 
+#define DRV_NAME "hp-plus"
+
 /* A zero-terminated list of I/O addresses to be probed. */
 static unsigned int hpplus_portlist[] __initdata =
 {0x200, 0x240, 0x280, 0x2C0, 0x300, 0x320, 0x340, 0};
@@ -142,6 +144,7 @@ static void cleanup_card(struct net_device *dev)
 	release_region(dev->base_addr - NIC_OFFSET, HP_IO_EXTENT);
 }
 
+#ifndef MODULE
 struct net_device * __init hp_plus_probe(int unit)
 {
 	struct net_device *dev = alloc_ei_netdev();
@@ -166,6 +169,7 @@ out:
 	free_netdev(dev);
 	return ERR_PTR(err);
 }
+#endif
 
 /* Do the interesting part of the probe at a single address. */
 static int __init hpp_probe1(struct net_device *dev, int ioaddr)
@@ -176,7 +180,7 @@ static int __init hpp_probe1(struct net_device *dev, int ioaddr)
 	int mem_start;
 	static unsigned version_printed;
 
-	if (!request_region(ioaddr, HP_IO_EXTENT, dev->name))
+	if (!request_region(ioaddr, HP_IO_EXTENT, DRV_NAME))
 		return -EBUSY;
 
 	/* Check for the HP+ signature, 50 48 0x 53. */
@@ -229,7 +233,7 @@ static int __init hpp_probe1(struct net_device *dev, int ioaddr)
 	}
 
 	/* Set the wrap registers for string I/O reads.   */
-	outw((HP_START_PG + TX_2X_PAGES) | ((HP_STOP_PG - 1) << 8), ioaddr + 14);
+	outw((HP_START_PG + TX_PAGES/2) | ((HP_STOP_PG - 1) << 8), ioaddr + 14);
 
 	/* Set the base address to point to the NIC, not the "real" base! */
 	dev->base_addr = ioaddr + NIC_OFFSET;
@@ -243,7 +247,7 @@ static int __init hpp_probe1(struct net_device *dev, int ioaddr)
 	ei_status.name = name;
 	ei_status.word16 = 0;		/* Agggghhhhh! Debug time: 2 days! */
 	ei_status.tx_start_page = HP_START_PG;
-	ei_status.rx_start_page = HP_START_PG + TX_2X_PAGES;
+	ei_status.rx_start_page = HP_START_PG + TX_PAGES/2;
 	ei_status.stop_page = HP_STOP_PG;
 
 	ei_status.reset_8390 = &hpp_reset_8390;
@@ -257,7 +261,7 @@ static int __init hpp_probe1(struct net_device *dev, int ioaddr)
 		ei_status.block_output = &hpp_mem_block_output;
 		ei_status.get_8390_hdr = &hpp_mem_get_8390_hdr;
 		dev->mem_start = mem_start;
-		ei_status.rmem_start = dev->mem_start + TX_2X_PAGES*256;
+		ei_status.rmem_start = dev->mem_start + TX_PAGES/2*256;
 		dev->mem_end = ei_status.rmem_end
 			= dev->mem_start + (HP_STOP_PG - HP_START_PG)*256;
 	}
@@ -293,7 +297,7 @@ hpp_open(struct net_device *dev)
 
 	/* Set the wrap registers for programmed-I/O operation.   */
 	outw(HW_Page, ioaddr + HP_PAGING);
-	outw((HP_START_PG + TX_2X_PAGES) | ((HP_STOP_PG - 1) << 8), ioaddr + 14);
+	outw((HP_START_PG + TX_PAGES/2) | ((HP_STOP_PG - 1) << 8), ioaddr + 14);
 
 	/* Select the operational page. */
 	outw(Perf_Page, ioaddr + HP_PAGING);
diff --git a/drivers/net/hp.c b/drivers/net/hp.c
index 2f48a7fc0..00358a927 100644
--- a/drivers/net/hp.c
+++ b/drivers/net/hp.c
@@ -37,6 +37,8 @@ static const char version[] =
 
 #include "8390.h"
 
+#define DRV_NAME "hp"
+
 /* A zero-terminated list of I/O addresses to be probed. */
 static unsigned int hppclan_portlist[] __initdata =
 { 0x300, 0x320, 0x340, 0x280, 0x2C0, 0x200, 0x240, 0};
@@ -106,6 +108,7 @@ static void cleanup_card(struct net_device *dev)
 	release_region(dev->base_addr - NIC_OFFSET, HP_IO_EXTENT);
 }
 
+#ifndef MODULE
 struct net_device * __init hp_probe(int unit)
 {
 	struct net_device *dev = alloc_ei_netdev();
@@ -130,6 +133,7 @@ out:
 	free_netdev(dev);
 	return ERR_PTR(err);
 }
+#endif
 
 static int __init hp_probe1(struct net_device *dev, int ioaddr)
 {
@@ -137,7 +141,7 @@ static int __init hp_probe1(struct net_device *dev, int ioaddr)
 	const char *name;
 	static unsigned version_printed;
 
-	if (!request_region(ioaddr, HP_IO_EXTENT, dev->name))
+	if (!request_region(ioaddr, HP_IO_EXTENT, DRV_NAME))
 		return -EBUSY;
 
 	/* Check for the HP physical address, 08 00 09 xx xx xx. */
@@ -182,7 +186,7 @@ static int __init hp_probe1(struct net_device *dev, int ioaddr)
 				outb_p(irqmap[irq] | HP_RUN, ioaddr + HP_CONFIGURE);
 				outb_p( 0x00 | HP_RUN, ioaddr + HP_CONFIGURE);
 				if (irq == probe_irq_off(cookie)		 /* It's a good IRQ line! */
-					&& request_irq (irq, ei_interrupt, 0, dev->name, dev) == 0) {
+					&& request_irq (irq, ei_interrupt, 0, DRV_NAME, dev) == 0) {
 					printk(" selecting IRQ %d.\n", irq);
 					dev->irq = *irqp;
 					break;
@@ -197,7 +201,7 @@ static int __init hp_probe1(struct net_device *dev, int ioaddr)
 	} else {
 		if (dev->irq == 2)
 			dev->irq = 9;
-		if ((retval = request_irq(dev->irq, ei_interrupt, 0, dev->name, dev))) {
+		if ((retval = request_irq(dev->irq, ei_interrupt, 0, DRV_NAME, dev))) {
 			printk (" unable to get IRQ %d.\n", dev->irq);
 			goto out;
 		}
diff --git a/drivers/net/hp100.c b/drivers/net/hp100.c
index a845c1171..78ae4b2ac 100644
--- a/drivers/net/hp100.c
+++ b/drivers/net/hp100.c
@@ -386,6 +386,7 @@ static int  __init hp100_isa_probe(struct net_device *dev, int addr)
 }
 
 
+#ifndef MODULE
 struct net_device * __init hp100_probe(int unit)
 {
 	struct net_device *dev = alloc_etherdev(sizeof(struct hp100_private));
@@ -420,6 +421,7 @@ struct net_device * __init hp100_probe(int unit)
 	free_netdev(dev);
 	return ERR_PTR(err);
 }
+#endif
 
 static int __init hp100_probe1(struct net_device *dev, int ioaddr,
 			       u_char bus, struct pci_dev *pci_dev)
diff --git a/drivers/net/ibmlana.c b/drivers/net/ibmlana.c
index a0eaa80aa..0aa0a8261 100644
--- a/drivers/net/ibmlana.c
+++ b/drivers/net/ibmlana.c
@@ -98,6 +98,8 @@ History:
 
 #undef DEBUG
 
+#define DRV_NAME "ibmlana"
+
 /* ------------------------------------------------------------------------
  * global static data - not more since we can handle multiple boards and
  * have to pack all state info into the device struct!
@@ -952,8 +954,8 @@ static int ibmlana_probe(struct net_device *dev)
 	printk(KERN_INFO "%s: IBM LAN Adapter/A found in slot %d\n", dev->name, slot + 1);
 
 	/* try to obtain I/O range */
-	if (!request_region(iobase, IBM_LANA_IORANGE, dev->name)) {
-		printk(KERN_ERR "%s: cannot allocate I/O range at %#x!\n", dev->name, iobase);
+	if (!request_region(iobase, IBM_LANA_IORANGE, DRV_NAME)) {
+		printk(KERN_ERR "%s: cannot allocate I/O range at %#x!\n", DRV_NAME, iobase);
 		startslot = slot + 1;
 		return -EBUSY;
 	}
diff --git a/drivers/net/irda/Kconfig b/drivers/net/irda/Kconfig
index e052547ca..a464841da 100644
--- a/drivers/net/irda/Kconfig
+++ b/drivers/net/irda/Kconfig
@@ -333,7 +333,7 @@ config WINBOND_FIR
 
 config TOSHIBA_FIR
 	tristate "Toshiba Type-O IR Port"
-	depends on IRDA
+	depends on IRDA && PCI && !64BIT
 	help
 	  Say Y here if you want to build support for the Toshiba Type-O IR
 	  and Donau oboe chipsets. These chipsets are used by the Toshiba
@@ -385,7 +385,7 @@ config SA1100_FIR
 
 config VIA_FIR
 	tristate "VIA VT8231/VT1211 SIR/MIR/FIR"
-	depends on IRDA && ISA
+	depends on IRDA && ISA && PCI
 	help
 	  Say Y here if you want to build support for the VIA VT8231
 	  and VIA VT1211 IrDA controllers, found on the motherboards using
diff --git a/drivers/net/irda/ali-ircc.c b/drivers/net/irda/ali-ircc.c
index ad4ab63b4..6a10d9643 100644
--- a/drivers/net/irda/ali-ircc.c
+++ b/drivers/net/irda/ali-ircc.c
@@ -33,6 +33,7 @@
 #include <linux/init.h>
 #include <linux/rtnetlink.h>
 #include <linux/serial_reg.h>
+#include <linux/dma-mapping.h>
 
 #include <asm/io.h>
 #include <asm/dma.h>
@@ -304,16 +305,18 @@ static int ali_ircc_open(int i, chipio_t *info)
 	self->tx_buff.truesize = 14384;
 
 	/* Allocate memory if needed */
-	self->rx_buff.head = (__u8 *) kmalloc(self->rx_buff.truesize,
-					      GFP_KERNEL |GFP_DMA); 
+	self->rx_buff.head =
+		dma_alloc_coherent(NULL, self->rx_buff.truesize,
+				   &self->rx_buff_dma, GFP_KERNEL);
 	if (self->rx_buff.head == NULL) {
 		err = -ENOMEM;
 		goto err_out2;
 	}
 	memset(self->rx_buff.head, 0, self->rx_buff.truesize);
 	
-	self->tx_buff.head = (__u8 *) kmalloc(self->tx_buff.truesize, 
-					      GFP_KERNEL|GFP_DMA); 
+	self->tx_buff.head =
+		dma_alloc_coherent(NULL, self->tx_buff.truesize,
+				   &self->tx_buff_dma, GFP_KERNEL);
 	if (self->tx_buff.head == NULL) {
 		err = -ENOMEM;
 		goto err_out3;
@@ -362,9 +365,11 @@ static int ali_ircc_open(int i, chipio_t *info)
 	return 0;
 
  err_out4:
-	kfree(self->tx_buff.head);
+	dma_free_coherent(NULL, self->tx_buff.truesize,
+			  self->tx_buff.head, self->tx_buff_dma);
  err_out3:
-	kfree(self->rx_buff.head);
+	dma_free_coherent(NULL, self->rx_buff.truesize,
+			  self->rx_buff.head, self->rx_buff_dma);
  err_out2:
 	release_region(self->io.fir_base, self->io.fir_ext);
  err_out1:
@@ -398,10 +403,12 @@ static int __exit ali_ircc_close(struct ali_ircc_cb *self)
 	release_region(self->io.fir_base, self->io.fir_ext);
 
 	if (self->tx_buff.head)
-		kfree(self->tx_buff.head);
+		dma_free_coherent(NULL, self->tx_buff.truesize,
+				  self->tx_buff.head, self->tx_buff_dma);
 	
 	if (self->rx_buff.head)
-		kfree(self->rx_buff.head);
+		dma_free_coherent(NULL, self->rx_buff.truesize,
+				  self->rx_buff.head, self->rx_buff_dma);
 
 	dev_self[self->index] = NULL;
 	free_netdev(self->netdev);
@@ -1572,7 +1579,8 @@ static void ali_ircc_dma_xmit(struct ali_ircc_cb *self)
 	self->io.direction = IO_XMIT;
 	
 	irda_setup_dma(self->io.dma, 
-		       self->tx_fifo.queue[self->tx_fifo.ptr].start, 
+		       ((u8 *)self->tx_fifo.queue[self->tx_fifo.ptr].start -
+			self->tx_buff.head) + self->tx_buff_dma,
 		       self->tx_fifo.queue[self->tx_fifo.ptr].len, 
 		       DMA_TX_MODE);
 		
@@ -1724,8 +1732,8 @@ static int ali_ircc_dma_receive(struct ali_ircc_cb *self)
 	self->st_fifo.len = self->st_fifo.pending_bytes = 0;
 	self->st_fifo.tail = self->st_fifo.head = 0;
 		
-	irda_setup_dma(self->io.dma, self->rx_buff.data, 
-		       self->rx_buff.truesize, DMA_RX_MODE);	
+	irda_setup_dma(self->io.dma, self->rx_buff_dma, self->rx_buff.truesize,
+		       DMA_RX_MODE);
 	 
 	/* Set Receive Mode,Brick Wall */
 	//switch_bank(iobase, BANK0);
diff --git a/drivers/net/irda/ali-ircc.h b/drivers/net/irda/ali-ircc.h
index dc5edd12b..e489c6661 100644
--- a/drivers/net/irda/ali-ircc.h
+++ b/drivers/net/irda/ali-ircc.h
@@ -26,6 +26,7 @@
 
 #include <linux/spinlock.h>
 #include <linux/pm.h>
+#include <linux/types.h>
 #include <asm/io.h>
 
 /* SIR Register */
@@ -198,6 +199,8 @@ struct ali_ircc_cb {
 	chipio_t io;               /* IrDA controller information */
 	iobuff_t tx_buff;          /* Transmit buffer */
 	iobuff_t rx_buff;          /* Receive buffer */
+	dma_addr_t tx_buff_dma;
+	dma_addr_t rx_buff_dma;
 
 	__u8 ier;                  /* Interrupt enable register */
 	
diff --git a/drivers/net/irda/donauboe.c b/drivers/net/irda/donauboe.c
index 49f6d5308..4cc3f5c1e 100644
--- a/drivers/net/irda/donauboe.c
+++ b/drivers/net/irda/donauboe.c
@@ -1622,6 +1622,10 @@ toshoboe_open (struct pci_dev *pci_dev, const struct pci_device_id *pdid)
       goto freeregion;
     }
 
+#if (BITS_PER_LONG == 64)
+#error broken on 64-bit:  casts pointer to 32-bit, and then back to pointer.
+#endif
+
   /*We need to align the taskfile on a taskfile size boundary */
   {
     unsigned long addr;
diff --git a/drivers/net/irda/irtty-sir.c b/drivers/net/irda/irtty-sir.c
index 035da952e..b67441d0a 100644
--- a/drivers/net/irda/irtty-sir.c
+++ b/drivers/net/irda/irtty-sir.c
@@ -438,7 +438,6 @@ static int irtty_ioctl(struct tty_struct *tty, struct file *file, unsigned int c
 	struct irtty_info { char name[6]; } info;
 	struct sir_dev *dev;
 	struct sirtty_cb *priv = tty->disc_data;
-	int size = _IOC_SIZE(cmd);
 	int err = 0;
 
 	ASSERT(priv != NULL, return -ENODEV;);
@@ -449,13 +448,6 @@ static int irtty_ioctl(struct tty_struct *tty, struct file *file, unsigned int c
 	dev = priv->dev;
 	ASSERT(dev != NULL, return -1;);
 
-	if (_IOC_DIR(cmd) & _IOC_READ)
-		err = verify_area(VERIFY_WRITE, (void *) arg, size);
-	else if (_IOC_DIR(cmd) & _IOC_WRITE)
-		err = verify_area(VERIFY_READ, (void *) arg, size);
-	if (err)
-		return err;
-	
 	switch (cmd) {
 	case TCGETS:
 	case TCGETA:
@@ -473,7 +465,7 @@ static int irtty_ioctl(struct tty_struct *tty, struct file *file, unsigned int c
 		memset(&info, 0, sizeof(info)); 
 		strncpy(info.name, dev->netdev->name, sizeof(info.name)-1);
 
-		if (copy_to_user((void *)arg, &info, sizeof(info)))
+		if (copy_to_user((void __user *)arg, &info, sizeof(info)))
 			err = -EFAULT;
 		break;
 	default:
@@ -592,7 +584,7 @@ static void irtty_close(struct tty_struct *tty)
 	 */
 
 	/* we are dead now */
-	tty->disc_data = 0;
+	tty->disc_data = NULL;
 
 	sirdev_put_instance(priv->dev);
 
diff --git a/drivers/net/irda/nsc-ircc.c b/drivers/net/irda/nsc-ircc.c
index 2248e661f..c1e79f516 100644
--- a/drivers/net/irda/nsc-ircc.c
+++ b/drivers/net/irda/nsc-ircc.c
@@ -52,6 +52,7 @@
 #include <linux/slab.h>
 #include <linux/init.h>
 #include <linux/rtnetlink.h>
+#include <linux/dma-mapping.h>
 
 #include <asm/io.h>
 #include <asm/dma.h>
@@ -307,8 +308,9 @@ static int __init nsc_ircc_open(int i, chipio_t *info)
 	self->tx_buff.truesize = 14384;
 
 	/* Allocate memory if needed */
-	self->rx_buff.head = (__u8 *) kmalloc(self->rx_buff.truesize,
-					      GFP_KERNEL|GFP_DMA);
+	self->rx_buff.head =
+		dma_alloc_coherent(NULL, self->rx_buff.truesize,
+				   &self->rx_buff_dma, GFP_KERNEL);
 	if (self->rx_buff.head == NULL) {
 		err = -ENOMEM;
 		goto out2;
@@ -316,8 +318,9 @@ static int __init nsc_ircc_open(int i, chipio_t *info)
 	}
 	memset(self->rx_buff.head, 0, self->rx_buff.truesize);
 	
-	self->tx_buff.head = (__u8 *) kmalloc(self->tx_buff.truesize, 
-					      GFP_KERNEL|GFP_DMA);
+	self->tx_buff.head =
+		dma_alloc_coherent(NULL, self->tx_buff.truesize,
+				   &self->tx_buff_dma, GFP_KERNEL);
 	if (self->tx_buff.head == NULL) {
 		err = -ENOMEM;
 		goto out3;
@@ -368,9 +371,11 @@ static int __init nsc_ircc_open(int i, chipio_t *info)
 
 	return 0;
  out4:
-	kfree(self->tx_buff.head);
+	dma_free_coherent(NULL, self->tx_buff.truesize,
+			  self->tx_buff.head, self->tx_buff_dma);
  out3:
-	kfree(self->rx_buff.head);
+	dma_free_coherent(NULL, self->rx_buff.truesize,
+			  self->rx_buff.head, self->rx_buff_dma);
  out2:
 	release_region(self->io.fir_base, self->io.fir_ext);
  out1:
@@ -404,10 +409,12 @@ static int __exit nsc_ircc_close(struct nsc_ircc_cb *self)
 	release_region(self->io.fir_base, self->io.fir_ext);
 
 	if (self->tx_buff.head)
-		kfree(self->tx_buff.head);
+		dma_free_coherent(NULL, self->tx_buff.truesize,
+				  self->tx_buff.head, self->tx_buff_dma);
 	
 	if (self->rx_buff.head)
-		kfree(self->rx_buff.head);
+		dma_free_coherent(NULL, self->rx_buff.truesize,
+				  self->rx_buff.head, self->rx_buff_dma);
 
 	dev_self[self->index] = NULL;
 	free_netdev(self->netdev);
@@ -1409,7 +1416,8 @@ static void nsc_ircc_dma_xmit(struct nsc_ircc_cb *self, int iobase)
 	outb(ECR1_DMASWP|ECR1_DMANF|ECR1_EXT_SL, iobase+ECR1);
 	
 	irda_setup_dma(self->io.dma, 
-		       self->tx_fifo.queue[self->tx_fifo.ptr].start, 
+		       ((u8 *)self->tx_fifo.queue[self->tx_fifo.ptr].start -
+			self->tx_buff.head) + self->tx_buff_dma,
 		       self->tx_fifo.queue[self->tx_fifo.ptr].len, 
 		       DMA_TX_MODE);
 
@@ -1566,8 +1574,8 @@ static int nsc_ircc_dma_receive(struct nsc_ircc_cb *self)
 	self->st_fifo.len = self->st_fifo.pending_bytes = 0;
 	self->st_fifo.tail = self->st_fifo.head = 0;
 	
-	irda_setup_dma(self->io.dma, self->rx_buff.data, 
-		       self->rx_buff.truesize, DMA_RX_MODE);
+	irda_setup_dma(self->io.dma, self->rx_buff_dma, self->rx_buff.truesize,
+		       DMA_RX_MODE);
 
 	/* Enable DMA */
 	switch_bank(iobase, BANK0);
diff --git a/drivers/net/irda/nsc-ircc.h b/drivers/net/irda/nsc-ircc.h
index 0f541aa71..6edf7e514 100644
--- a/drivers/net/irda/nsc-ircc.h
+++ b/drivers/net/irda/nsc-ircc.h
@@ -32,6 +32,7 @@
 
 #include <linux/spinlock.h>
 #include <linux/pm.h>
+#include <linux/types.h>
 #include <asm/io.h>
 
 /* DMA modes needed */
@@ -255,6 +256,8 @@ struct nsc_ircc_cb {
 	chipio_t io;               /* IrDA controller information */
 	iobuff_t tx_buff;          /* Transmit buffer */
 	iobuff_t rx_buff;          /* Receive buffer */
+	dma_addr_t tx_buff_dma;
+	dma_addr_t rx_buff_dma;
 
 	__u8 ier;                  /* Interrupt enable register */
 
diff --git a/drivers/net/irda/smsc-ircc2.c b/drivers/net/irda/smsc-ircc2.c
index e360323c2..fc3580ae1 100644
--- a/drivers/net/irda/smsc-ircc2.c
+++ b/drivers/net/irda/smsc-ircc2.c
@@ -52,6 +52,7 @@
 #include <linux/init.h>
 #include <linux/rtnetlink.h>
 #include <linux/serial_reg.h>
+#include <linux/dma-mapping.h>
 
 #include <asm/io.h>
 #include <asm/dma.h>
@@ -112,6 +113,8 @@ struct smsc_ircc_cb {
 	chipio_t io;               /* IrDA controller information */
 	iobuff_t tx_buff;          /* Transmit buffer */
 	iobuff_t rx_buff;          /* Receive buffer */
+	dma_addr_t tx_buff_dma;
+	dma_addr_t rx_buff_dma;
 
 	struct qos_info qos;       /* QoS capabilities for this device */
 
@@ -413,16 +416,18 @@ static int __init smsc_ircc_open(unsigned int fir_base, unsigned int sir_base, u
 	self->rx_buff.truesize = SMSC_IRCC2_RX_BUFF_TRUESIZE; 
 	self->tx_buff.truesize = SMSC_IRCC2_TX_BUFF_TRUESIZE;
 
-	self->rx_buff.head = (u8 *) kmalloc(self->rx_buff.truesize,
-					      GFP_KERNEL|GFP_DMA);
+	self->rx_buff.head =
+		dma_alloc_coherent(NULL, self->rx_buff.truesize,
+				   &self->rx_buff_dma, GFP_KERNEL);
 	if (self->rx_buff.head == NULL) {
 		ERROR("%s, Can't allocate memory for receive buffer!\n",
                       driver_name);
 		goto err_out2;
 	}
 
-	self->tx_buff.head = (u8 *) kmalloc(self->tx_buff.truesize, 
-					      GFP_KERNEL|GFP_DMA);
+	self->tx_buff.head =
+		dma_alloc_coherent(NULL, self->tx_buff.truesize,
+				   &self->tx_buff_dma, GFP_KERNEL);
 	if (self->tx_buff.head == NULL) {
 		ERROR("%s, Can't allocate memory for transmit buffer!\n",
                       driver_name);
@@ -464,9 +469,11 @@ static int __init smsc_ircc_open(unsigned int fir_base, unsigned int sir_base, u
 
 	return 0;
  err_out4:
-	kfree(self->tx_buff.head);
+	dma_free_coherent(NULL, self->tx_buff.truesize,
+			  self->tx_buff.head, self->tx_buff_dma);
  err_out3:
-	kfree(self->rx_buff.head);
+	dma_free_coherent(NULL, self->rx_buff.truesize,
+			  self->rx_buff.head, self->rx_buff_dma);
  err_out2:
 	free_netdev(self->netdev);
 	dev_self[--dev_count] = NULL;
@@ -1159,7 +1166,7 @@ static void smsc_ircc_dma_xmit(struct smsc_ircc_cb *self, int iobase, int bofs)
 	     IRCC_CFGB_DMA_BURST, iobase+IRCC_SCE_CFGB);
 
 	/* Setup DMA controller (must be done after enabling chip DMA) */
-	irda_setup_dma(self->io.dma, self->tx_buff.data, self->tx_buff.len, 
+	irda_setup_dma(self->io.dma, self->tx_buff_dma, self->tx_buff.len,
 		       DMA_TX_MODE);
 
 	/* Enable interrupt */
@@ -1249,8 +1256,8 @@ static int smsc_ircc_dma_receive(struct smsc_ircc_cb *self, int iobase)
 	outb(2050 & 0xff, iobase+IRCC_RX_SIZE_LO);
 
 	/* Setup DMA controller */
-	irda_setup_dma(self->io.dma, self->rx_buff.data,
-		       self->rx_buff.truesize, DMA_RX_MODE);
+	irda_setup_dma(self->io.dma, self->rx_buff_dma, self->rx_buff.truesize,
+		       DMA_RX_MODE);
 
 	/* Enable burst mode chip Rx DMA */
 	register_bank(iobase, 1);
@@ -1717,10 +1724,12 @@ static int __exit smsc_ircc_close(struct smsc_ircc_cb *self)
 	release_region(self->io.sir_base, self->io.sir_ext);
 
 	if (self->tx_buff.head)
-		kfree(self->tx_buff.head);
+		dma_free_coherent(NULL, self->tx_buff.truesize,
+				  self->tx_buff.head, self->tx_buff_dma);
 	
 	if (self->rx_buff.head)
-		kfree(self->rx_buff.head);
+		dma_free_coherent(NULL, self->rx_buff.truesize,
+				  self->rx_buff.head, self->rx_buff_dma);
 
 	free_netdev(self->netdev);
 
diff --git a/drivers/net/irda/via-ircc.c b/drivers/net/irda/via-ircc.c
index 95b9c3251..4d1000efe 100644
--- a/drivers/net/irda/via-ircc.c
+++ b/drivers/net/irda/via-ircc.c
@@ -39,6 +39,7 @@ F02 Oct/28/02: Add SB device ID for 3147 and 3177.
 #include <linux/init.h>
 #include <linux/rtnetlink.h>
 #include <linux/pci.h>
+#include <linux/dma-mapping.h>
 
 #include <asm/io.h>
 #include <asm/dma.h>
@@ -383,7 +384,8 @@ static __devinit int via_ircc_open(int i, chipio_t * info, unsigned int id)
 
 	/* Allocate memory if needed */
 	self->rx_buff.head =
-	    (__u8 *) kmalloc(self->rx_buff.truesize, GFP_KERNEL | GFP_DMA);
+		dma_alloc_coherent(NULL, self->rx_buff.truesize,
+				   &self->rx_buff_dma, GFP_KERNEL);
 	if (self->rx_buff.head == NULL) {
 		err = -ENOMEM;
 		goto err_out2;
@@ -391,7 +393,8 @@ static __devinit int via_ircc_open(int i, chipio_t * info, unsigned int id)
 	memset(self->rx_buff.head, 0, self->rx_buff.truesize);
 
 	self->tx_buff.head =
-	    (__u8 *) kmalloc(self->tx_buff.truesize, GFP_KERNEL | GFP_DMA);
+		dma_alloc_coherent(NULL, self->tx_buff.truesize,
+				   &self->tx_buff_dma, GFP_KERNEL);
 	if (self->tx_buff.head == NULL) {
 		err = -ENOMEM;
 		goto err_out3;
@@ -432,9 +435,11 @@ static __devinit int via_ircc_open(int i, chipio_t * info, unsigned int id)
 
 	return 0;
  err_out4:
-	kfree(self->tx_buff.head);
+	dma_free_coherent(NULL, self->tx_buff.truesize,
+			  self->tx_buff.head, self->tx_buff_dma);
  err_out3:
-	kfree(self->rx_buff.head);
+	dma_free_coherent(NULL, self->rx_buff.truesize,
+			  self->rx_buff.head, self->rx_buff_dma);
  err_out2:
 	release_region(self->io.fir_base, self->io.fir_ext);
  err_out1:
@@ -468,9 +473,11 @@ static int __exit via_ircc_close(struct via_ircc_cb *self)
 		   __FUNCTION__, self->io.fir_base);
 	release_region(self->io.fir_base, self->io.fir_ext);
 	if (self->tx_buff.head)
-		kfree(self->tx_buff.head);
+		dma_free_coherent(NULL, self->tx_buff.truesize,
+				  self->tx_buff.head, self->tx_buff_dma);
 	if (self->rx_buff.head)
-		kfree(self->rx_buff.head);
+		dma_free_coherent(NULL, self->rx_buff.truesize,
+				  self->rx_buff.head, self->rx_buff_dma);
 	dev_self[self->index] = NULL;
 
 	free_netdev(self->netdev);
@@ -816,7 +823,7 @@ static int via_ircc_hard_xmit_sir(struct sk_buff *skb,
 	EnTXDMA(iobase, ON);
 	EnRXDMA(iobase, OFF);
 
-	irda_setup_dma(self->io.dma, self->tx_buff.data, self->tx_buff.len,
+	irda_setup_dma(self->io.dma, self->tx_buff_dma, self->tx_buff.len,
 		       DMA_TX_MODE);
 
 	SetSendByte(iobase, self->tx_buff.len);
@@ -897,7 +904,8 @@ static int via_ircc_dma_xmit(struct via_ircc_cb *self, u16 iobase)
 	EnTXDMA(iobase, ON);
 	EnRXDMA(iobase, OFF);
 	irda_setup_dma(self->io.dma,
-		       self->tx_fifo.queue[self->tx_fifo.ptr].start,
+		       ((u8 *)self->tx_fifo.queue[self->tx_fifo.ptr].start -
+			self->tx_buff.head) + self->tx_buff_dma,
 		       self->tx_fifo.queue[self->tx_fifo.ptr].len, DMA_TX_MODE);
 #ifdef	DBGMSG
 	DBG(printk
@@ -1022,8 +1030,8 @@ static int via_ircc_dma_receive(struct via_ircc_cb *self)
 	EnAllInt(iobase, ON);
 	EnTXDMA(iobase, OFF);
 	EnRXDMA(iobase, ON);
-	irda_setup_dma(self->io.dma2, self->rx_buff.data,
-		       self->rx_buff.truesize, DMA_RX_MODE);
+	irda_setup_dma(self->io.dma2, self->rx_buff_dma,
+		  self->rx_buff.truesize, DMA_RX_MODE);
 	TXStart(iobase, OFF);
 	RXStart(iobase, ON);
 
diff --git a/drivers/net/irda/via-ircc.h b/drivers/net/irda/via-ircc.h
index c3568b6c2..dcb5c3d33 100644
--- a/drivers/net/irda/via-ircc.h
+++ b/drivers/net/irda/via-ircc.h
@@ -33,6 +33,7 @@ this program; if not, write to the Free Software Foundation, Inc.,
 #include <linux/time.h>
 #include <linux/spinlock.h>
 #include <linux/pm.h>
+#include <linux/types.h>
 #include <asm/io.h>
 
 #define MAX_TX_WINDOW 7
@@ -102,6 +103,8 @@ struct via_ircc_cb {
 	chipio_t io;		/* IrDA controller information */
 	iobuff_t tx_buff;	/* Transmit buffer */
 	iobuff_t rx_buff;	/* Receive buffer */
+	dma_addr_t tx_buff_dma;
+	dma_addr_t rx_buff_dma;
 
 	__u8 ier;		/* Interrupt enable register */
 
diff --git a/drivers/net/irda/vlsi_ir.c b/drivers/net/irda/vlsi_ir.c
index f7416342b..eda2d01a5 100644
--- a/drivers/net/irda/vlsi_ir.c
+++ b/drivers/net/irda/vlsi_ir.c
@@ -1876,7 +1876,7 @@ static int __init vlsi_mod_init(void)
 	 * Failure to create the procfs entry is handled like running
 	 * without procfs - it's not required for the driver to work.
 	 */
-	vlsi_proc_root = create_proc_entry(PROC_DIR, S_IFDIR, 0);
+	vlsi_proc_root = create_proc_entry(PROC_DIR, S_IFDIR, NULL);
 	if (vlsi_proc_root) {
 		/* protect registered procdir against module removal.
 		 * Because we are in the module init path there's no race
@@ -1888,7 +1888,7 @@ static int __init vlsi_mod_init(void)
 	ret = pci_module_init(&vlsi_irda_driver);
 
 	if (ret && vlsi_proc_root)
-		remove_proc_entry(PROC_DIR, 0);
+		remove_proc_entry(PROC_DIR, NULL);
 	return ret;
 
 }
@@ -1897,7 +1897,7 @@ static void __exit vlsi_mod_exit(void)
 {
 	pci_unregister_driver(&vlsi_irda_driver);
 	if (vlsi_proc_root)
-		remove_proc_entry(PROC_DIR, 0);
+		remove_proc_entry(PROC_DIR, NULL);
 }
 
 module_init(vlsi_mod_init);
diff --git a/drivers/net/irda/w83977af_ir.c b/drivers/net/irda/w83977af_ir.c
index 1d4382b3f..64d8d3fc9 100644
--- a/drivers/net/irda/w83977af_ir.c
+++ b/drivers/net/irda/w83977af_ir.c
@@ -50,6 +50,7 @@
 #include <linux/slab.h>
 #include <linux/init.h>
 #include <linux/rtnetlink.h>
+#include <linux/dma-mapping.h>
 
 #include <asm/io.h>
 #include <asm/dma.h>
@@ -207,8 +208,9 @@ int w83977af_open(int i, unsigned int iobase, unsigned int irq,
 	self->tx_buff.truesize = 4000;
 	
 	/* Allocate memory if needed */
-	self->rx_buff.head = (__u8 *) kmalloc(self->rx_buff.truesize,
-					      GFP_KERNEL|GFP_DMA);
+	self->rx_buff.head =
+		dma_alloc_coherent(NULL, self->rx_buff.truesize,
+				   &self->rx_buff_dma, GFP_KERNEL);
 	if (self->rx_buff.head == NULL) {
 		err = -ENOMEM;
 		goto err_out1;
@@ -216,8 +218,9 @@ int w83977af_open(int i, unsigned int iobase, unsigned int irq,
 
 	memset(self->rx_buff.head, 0, self->rx_buff.truesize);
 	
-	self->tx_buff.head = (__u8 *) kmalloc(self->tx_buff.truesize, 
-					      GFP_KERNEL|GFP_DMA);
+	self->tx_buff.head =
+		dma_alloc_coherent(NULL, self->tx_buff.truesize,
+				   &self->tx_buff_dma, GFP_KERNEL);
 	if (self->tx_buff.head == NULL) {
 		err = -ENOMEM;
 		goto err_out2;
@@ -252,9 +255,11 @@ int w83977af_open(int i, unsigned int iobase, unsigned int irq,
 	
 	return 0;
 err_out3:
-	kfree(self->tx_buff.head);
+	dma_free_coherent(NULL, self->tx_buff.truesize,
+			  self->tx_buff.head, self->tx_buff_dma);
 err_out2:	
-	kfree(self->rx_buff.head);
+	dma_free_coherent(NULL, self->rx_buff.truesize,
+			  self->rx_buff.head, self->rx_buff_dma);
 err_out1:
 	free_netdev(dev);
 err_out:
@@ -297,10 +302,12 @@ static int w83977af_close(struct w83977af_ir *self)
 	release_region(self->io.fir_base, self->io.fir_ext);
 
 	if (self->tx_buff.head)
-		kfree(self->tx_buff.head);
+		dma_free_coherent(NULL, self->tx_buff.truesize,
+				  self->tx_buff.head, self->tx_buff_dma);
 	
 	if (self->rx_buff.head)
-		kfree(self->rx_buff.head);
+		dma_free_coherent(NULL, self->rx_buff.truesize,
+				  self->rx_buff.head, self->rx_buff_dma);
 
 	free_netdev(self->netdev);
 
@@ -606,10 +613,10 @@ static void w83977af_dma_write(struct w83977af_ir *self, int iobase)
 	disable_dma(self->io.dma);
 	clear_dma_ff(self->io.dma);
 	set_dma_mode(self->io.dma, DMA_MODE_READ);
-	set_dma_addr(self->io.dma, isa_virt_to_bus(self->tx_buff.data));
+	set_dma_addr(self->io.dma, self->tx_buff_dma);
 	set_dma_count(self->io.dma, self->tx_buff.len);
 #else
-	irda_setup_dma(self->io.dma, self->tx_buff.data, self->tx_buff.len, 
+	irda_setup_dma(self->io.dma, self->tx_buff_dma, self->tx_buff.len,
 		       DMA_MODE_WRITE);	
 #endif
 	self->io.direction = IO_XMIT;
@@ -763,10 +770,10 @@ int w83977af_dma_receive(struct w83977af_ir *self)
 	disable_dma(self->io.dma);
 	clear_dma_ff(self->io.dma);
 	set_dma_mode(self->io.dma, DMA_MODE_READ);
-	set_dma_addr(self->io.dma, isa_virt_to_bus(self->rx_buff.data));
+	set_dma_addr(self->io.dma, self->rx_buff_dma);
 	set_dma_count(self->io.dma, self->rx_buff.truesize);
 #else
-	irda_setup_dma(self->io.dma, self->rx_buff.data, self->rx_buff.truesize, 
+	irda_setup_dma(self->io.dma, self->rx_buff_dma, self->rx_buff.truesize,
 		       DMA_MODE_READ);
 #endif
 	/* 
diff --git a/drivers/net/irda/w83977af_ir.h b/drivers/net/irda/w83977af_ir.h
index c578ddc1a..0b7661dea 100644
--- a/drivers/net/irda/w83977af_ir.h
+++ b/drivers/net/irda/w83977af_ir.h
@@ -26,6 +26,7 @@
 #define W83977AF_IR_H
 
 #include <asm/io.h>
+#include <linux/types.h>
 
 /* Flags for configuration register CRF0 */
 #define ENBNKSEL	0x01
@@ -179,6 +180,8 @@ struct w83977af_ir {
 	chipio_t io;               /* IrDA controller information */
 	iobuff_t tx_buff;          /* Transmit buffer */
 	iobuff_t rx_buff;          /* Receive buffer */
+	dma_addr_t tx_buff_dma;
+	dma_addr_t rx_buff_dma;
 
 	/* Note : currently locking is *very* incomplete, but this
 	 * will get you started. Check in nsc-ircc.c for a proper
diff --git a/drivers/net/isa-skeleton.c b/drivers/net/isa-skeleton.c
index 8df84e9bb..650943395 100644
--- a/drivers/net/isa-skeleton.c
+++ b/drivers/net/isa-skeleton.c
@@ -161,6 +161,7 @@ static void cleanup_card(struct net_device *dev)
 	release_region(dev->base_addr, NETCARD_IO_EXTENT);
 }
 
+#ifndef MODULE
 struct net_device * __init netcard_probe(int unit)
 {
 	struct net_device *dev = alloc_etherdev(sizeof(struct net_local));
@@ -185,6 +186,7 @@ out:
 	free_netdev(dev);
 	return ERR_PTR(err);
 }
+#endif
 
 /*
  * This is the real probe routine. Linux has a history of friendly device
diff --git a/drivers/net/iseries_veth.c b/drivers/net/iseries_veth.c
index 634cb049c..e62ca7b1b 100644
--- a/drivers/net/iseries_veth.c
+++ b/drivers/net/iseries_veth.c
@@ -81,8 +81,6 @@
 
 #include "iseries_veth.h"
 
-extern struct vio_dev *iSeries_veth_dev;
-
 MODULE_AUTHOR("Kyle Lucke <klucke@us.ibm.com>");
 MODULE_DESCRIPTION("iSeries Virtual ethernet driver");
 MODULE_LICENSE("GPL");
@@ -119,6 +117,7 @@ struct veth_msg {
 	int token;
 	unsigned long in_use;
 	struct sk_buff *skb;
+	struct device *dev;
 };
 
 struct veth_lpar_connection {
@@ -147,6 +146,7 @@ struct veth_lpar_connection {
 };
 
 struct veth_port {
+	struct device *dev;
 	struct net_device_stats stats;
 	u64 mac_addr;
 	HvLpIndexMap lpar_map;
@@ -843,7 +843,7 @@ static void veth_tx_timeout(struct net_device *dev)
 	spin_unlock_irqrestore(&port->pending_gate, flags);
 }
 
-struct net_device * __init veth_probe_one(int vlan)
+static struct net_device * __init veth_probe_one(int vlan, struct device *vdev)
 {
 	struct net_device *dev;
 	struct veth_port *port;
@@ -869,6 +869,7 @@ struct net_device * __init veth_probe_one(int vlan)
 		if (map & (0x8000 >> vlan))
 			port->lpar_map |= (1 << i);
 	}
+	port->dev = vdev;
 
 	dev->dev_addr[0] = 0x02;
 	dev->dev_addr[1] = 0x01;
@@ -893,6 +894,8 @@ struct net_device * __init veth_probe_one(int vlan)
 	dev->watchdog_timeo = 2 * (VETH_ACKTIMEOUT * HZ / 1000000);
 	dev->tx_timeout = veth_tx_timeout;
 
+	SET_NETDEV_DEV(dev, vdev);
+
 	rc = register_netdev(dev);
 	if (rc != 0) {
 		veth_printk(KERN_ERR,
@@ -945,7 +948,7 @@ static int veth_transmit_to_one(struct sk_buff *skb, HvLpIndex rlp,
 	}
 
 	dma_length = skb->len;
-	dma_address = vio_map_single(iSeries_veth_dev, skb->data,
+	dma_address = dma_map_single(port->dev, skb->data,
 				     dma_length, DMA_TO_DEVICE);
 
 	if (dma_mapping_error(dma_address))
@@ -954,6 +957,7 @@ static int veth_transmit_to_one(struct sk_buff *skb, HvLpIndex rlp,
 	/* Is it really necessary to check the length and address
 	 * fields of the first entry here? */
 	msg->skb = skb;
+	msg->dev = port->dev;
 	msg->data.addr[0] = dma_address;
 	msg->data.len[0] = dma_length;
 	msg->data.eofmask = 1 << VETH_EOF_SHIFT;
@@ -1059,7 +1063,7 @@ static void veth_recycle_msg(struct veth_lpar_connection *cnx,
 		dma_address = msg->data.addr[0];
 		dma_length = msg->data.len[0];
 
-		vio_unmap_single(iSeries_veth_dev, dma_address, dma_length,
+		dma_unmap_single(msg->dev, dma_address, dma_length,
 				 DMA_TO_DEVICE);
 
 		if (msg->skb) {
@@ -1327,6 +1331,58 @@ static void veth_timed_ack(unsigned long ptr)
 	spin_unlock_irqrestore(&cnx->lock, flags);
 }
 
+static int veth_remove(struct vio_dev *vdev)
+{
+	int i = vdev->unit_address;
+	struct net_device *dev;
+
+	dev = veth_dev[i];
+	if (dev != NULL) {
+		veth_dev[i] = NULL;
+		unregister_netdev(dev);
+		free_netdev(dev);
+	}
+	return 0;
+}
+
+static int veth_probe(struct vio_dev *vdev, const struct vio_device_id *id)
+{
+	int i = vdev->unit_address;
+	struct net_device *dev;
+
+	dev = veth_probe_one(i, &vdev->dev);
+	if (dev == NULL) {
+		veth_remove(vdev);
+		return 1;
+	}
+	veth_dev[i] = dev;
+
+	/* Start the state machine on each connection, to commence
+	 * link negotiation */
+	for (i = 0; i < HVMAXARCHITECTEDLPS; i++)
+		if (veth_cnx[i])
+			veth_kick_statemachine(veth_cnx[i]);
+
+	return 0;
+}
+
+/**
+ * veth_device_table: Used by vio.c to match devices that we
+ * support.
+ */
+static struct vio_device_id veth_device_table[] __devinitdata = {
+	{ "vlan", "" },
+	{ NULL, NULL }
+};
+MODULE_DEVICE_TABLE(vio, veth_device_table);
+
+static struct vio_driver veth_driver = {
+	.name = "iseries_veth",
+	.id_table = veth_device_table,
+	.probe = veth_probe,
+	.remove = veth_remove
+};
+
 /*
  * Module initialization/cleanup
  */
@@ -1335,27 +1391,17 @@ void __exit veth_module_cleanup(void)
 {
 	int i;
 
+	vio_unregister_driver(&veth_driver);
+
 	for (i = 0; i < HVMAXARCHITECTEDLPS; ++i)
 		veth_destroy_connection(i);
 
 	HvLpEvent_unregisterHandler(HvLpEvent_Type_VirtualLan);
-
-	for (i = 0; i < HVMAXARCHITECTEDVIRTUALLANS; ++i) {
-		struct net_device *dev = veth_dev[i];
-
-		if (! dev)
-			continue;
-
-		veth_dev[i] = NULL;
-		unregister_netdev(dev);
-		free_netdev(dev);
-	}
 }
 module_exit(veth_module_cleanup);
 
 int __init veth_module_init(void)
 {
-	HvLpIndexMap vlan_map = HvLpConfig_getVirtualLanIndexMap();
 	int i;
 	int rc;
 
@@ -1369,31 +1415,9 @@ int __init veth_module_init(void)
 		}
 	}
 
-	for (i = 0; i < HVMAXARCHITECTEDVIRTUALLANS; ++i) {
-		struct net_device *dev;
-
-		if (! (vlan_map & (0x8000 >> i)))
-			continue;
-
-		dev = veth_probe_one(i);
-
-		if (! dev) {
-			veth_module_cleanup();
-			return rc;
-		}
-
-		veth_dev[i] = dev;
-	}
-
 	HvLpEvent_registerHandler(HvLpEvent_Type_VirtualLan,
 				  &veth_handle_event);
 
-	/* Start the state machine on each connection, to commence
-	 * link negotiation */
-	for (i = 0; i < HVMAXARCHITECTEDLPS; i++)
-		if (veth_cnx[i])
-			veth_kick_statemachine(veth_cnx[i]);
-
-	return 0;
+	return vio_register_driver(&veth_driver);
 }
 module_init(veth_module_init);
diff --git a/drivers/net/iseries_veth.h b/drivers/net/iseries_veth.h
index 078d898fc..d9370f79b 100644
--- a/drivers/net/iseries_veth.h
+++ b/drivers/net/iseries_veth.h
@@ -43,6 +43,4 @@ struct VethLpEvent {
 
 };
 
-#define HVMAXARCHITECTEDVIRTUALLANS (16)
-
 #endif	/* _ISERIES_VETH_H */
diff --git a/drivers/net/ixgb/ixgb.h b/drivers/net/ixgb/ixgb.h
index d6c008b26..5111c8e6b 100644
--- a/drivers/net/ixgb/ixgb.h
+++ b/drivers/net/ixgb/ixgb.h
@@ -77,7 +77,7 @@ struct ixgb_adapter;
 #include "ixgb_ee.h"
 #include "ixgb_ids.h"
 
-#if _DEBUG_DRIVER_
+#ifdef _DEBUG_DRIVER_
 #define IXGB_DBG(args...) printk(KERN_DEBUG "ixgb: " args)
 #else
 #define IXGB_DBG(args...)
diff --git a/drivers/net/ixgb/ixgb_hw.c b/drivers/net/ixgb/ixgb_hw.c
index 590873328..b9998af78 100644
--- a/drivers/net/ixgb/ixgb_hw.c
+++ b/drivers/net/ixgb/ixgb_hw.c
@@ -67,7 +67,7 @@ uint32_t ixgb_mac_reset(struct ixgb_hw *hw)
 	/* Delay a few ms just to allow the reset to complete */
 	msec_delay(IXGB_DELAY_AFTER_RESET);
 	ctrl_reg = IXGB_READ_REG(hw, CTRL0);
-#if DBG
+#ifdef DBG
 	/* Make sure the self-clearing global reset bit did self clear */
 	ASSERT(!(ctrl_reg & IXGB_CTRL0_RST));
 #endif
diff --git a/drivers/net/ixgb/ixgb_main.c b/drivers/net/ixgb/ixgb_main.c
index 0bd434898..f28ab3346 100644
--- a/drivers/net/ixgb/ixgb_main.c
+++ b/drivers/net/ixgb/ixgb_main.c
@@ -1876,7 +1876,6 @@ static void ixgb_alloc_rx_buffers(struct ixgb_adapter *adapter)
 	struct ixgb_rx_desc *rx_desc;
 	struct ixgb_buffer *buffer_info;
 	struct sk_buff *skb;
-	int reserve_len = 2;
 	unsigned int i;
 	int num_group_tail_writes;
 	long cleancount;
@@ -1895,7 +1894,7 @@ static void ixgb_alloc_rx_buffers(struct ixgb_adapter *adapter)
 	while (--cleancount > 0) {
 		rx_desc = IXGB_RX_DESC(*rx_ring, i);
 
-		skb = dev_alloc_skb(adapter->rx_buffer_len + reserve_len);
+		skb = dev_alloc_skb(adapter->rx_buffer_len + NET_IP_ALIGN);
 
 		if (unlikely(!skb)) {
 			/* Better luck next round */
@@ -1906,7 +1905,7 @@ static void ixgb_alloc_rx_buffers(struct ixgb_adapter *adapter)
 		 * this will result in a 16 byte aligned IP header after
 		 * the 14 byte MAC header is removed
 		 */
-		skb_reserve(skb, reserve_len);
+		skb_reserve(skb, NET_IP_ALIGN);
 
 		skb->dev = netdev;
 
diff --git a/drivers/net/ixgb/ixgb_osdep.h b/drivers/net/ixgb/ixgb_osdep.h
index f1184e412..892f86cae 100644
--- a/drivers/net/ixgb/ixgb_osdep.h
+++ b/drivers/net/ixgb/ixgb_osdep.h
@@ -64,7 +64,7 @@ typedef enum {
 #define ASSERT(x)	if(!(x)) BUG()
 #define MSGOUT(S, A, B)	printk(KERN_DEBUG S "\n", A, B)
 
-#if DBG
+#ifdef DBG
 #define DEBUGOUT(S)		printk(KERN_DEBUG S "\n")
 #define DEBUGOUT1(S, A...)	printk(KERN_DEBUG S "\n", A)
 #else
diff --git a/drivers/net/jazzsonic.c b/drivers/net/jazzsonic.c
index 20f757c46..8624bfc49 100644
--- a/drivers/net/jazzsonic.c
+++ b/drivers/net/jazzsonic.c
@@ -37,6 +37,8 @@
 #include <asm/jazz.h>
 #include <asm/jazzdma.h>
 
+#define DRV_NAME "jazzsonic"
+
 #define SREGS_PAD(n)    u16 n;
 
 #include "sonic.h"
@@ -151,7 +153,7 @@ static int __init sonic_probe1(struct net_device *dev, unsigned int base_addr,
 	int err = -ENODEV;
 	int i;
 
-	if (!request_region(base_addr, 0x100, dev->name))
+	if (!request_region(base_addr, 0x100, DRV_NAME))
 		return -EBUSY;
 	/*
 	 * get the Silicon Revision ID. If this is one of the known
diff --git a/drivers/net/lance.c b/drivers/net/lance.c
index a39f7a7fc..f04d0a82c 100644
--- a/drivers/net/lance.c
+++ b/drivers/net/lance.c
@@ -432,6 +432,7 @@ static int __init do_lance_probe(struct net_device *dev)
 	return -ENODEV;
 }
 
+#ifndef MODULE
 struct net_device * __init lance_probe(int unit)
 {
 	struct net_device *dev = alloc_etherdev(0);
@@ -456,6 +457,7 @@ out:
 	free_netdev(dev);
 	return ERR_PTR(err);
 }
+#endif
 
 static int __init lance_probe1(struct net_device *dev, int ioaddr, int irq, int options)
 {
@@ -832,7 +834,7 @@ lance_purge_ring(struct net_device *dev)
 	/* Free all the skbuffs in the Rx and Tx queues. */
 	for (i = 0; i < RX_RING_SIZE; i++) {
 		struct sk_buff *skb = lp->rx_skbuff[i];
-		lp->rx_skbuff[i] = 0;
+		lp->rx_skbuff[i] = NULL;
 		lp->rx_ring[i].base = 0;		/* Not owned by LANCE chip. */
 		if (skb)
 			dev_kfree_skb_any(skb);
@@ -876,7 +878,7 @@ lance_init_ring(struct net_device *dev, int gfp)
 	/* The Tx buffer address is filled in as needed, but we do need to clear
 	   the upper ownership bit. */
 	for (i = 0; i < TX_RING_SIZE; i++) {
-		lp->tx_skbuff[i] = 0;
+		lp->tx_skbuff[i] = NULL;
 		lp->tx_ring[i].base = 0;
 	}
 
@@ -1081,7 +1083,7 @@ lance_interrupt(int irq, void *dev_id, struct pt_regs * regs)
 				   in the bounce buffer. */
 				if (lp->tx_skbuff[entry]) {
 					dev_kfree_skb_irq(lp->tx_skbuff[entry]);
-					lp->tx_skbuff[entry] = 0;
+					lp->tx_skbuff[entry] = NULL;
 				}
 				dirty_tx++;
 			}
diff --git a/drivers/net/lasi_82596.c b/drivers/net/lasi_82596.c
index 46483262f..4957de6d8 100644
--- a/drivers/net/lasi_82596.c
+++ b/drivers/net/lasi_82596.c
@@ -87,14 +87,12 @@
 #include <asm/bitops.h>
 #include <asm/io.h>
 #include <asm/pgtable.h>
-#include <asm/pgalloc.h>
 #include <asm/irq.h>
 #include <asm/pdc.h>
 #include <asm/cache.h>
 #include <asm/parisc-device.h>
 
-static char version[] __devinitdata =
-	"82596.c $Revision: 1.29 $\n";
+#define LASI_82596_DRIVER_VERSION "LASI 82596 driver - Revision: 1.30"
 
 /* DEBUG flags
  */
@@ -125,10 +123,10 @@ static char version[] __devinitdata =
 	do { dma_cache_sync((void *)addr, len, DMA_TO_DEVICE); } while (0)
 
 #define  CHECK_INV(addr,len) \
-	do { dma_cache_sync((void *)addr,len, DMA_FROM_DEVICE); } while(0)
+	do { dma_cache_sync((void *)addr, len, DMA_FROM_DEVICE); } while(0)
 
 #define  CHECK_WBACK_INV(addr,len) \
-	do { dma_cache_sync((void *)addr,len, DMA_BIDIRECTIONAL); } while (0)
+	do { dma_cache_sync((void *)addr, len, DMA_BIDIRECTIONAL); } while (0)
 
 
 #define PA_I82596_RESET		0	/* Offsets relative to LASI-LAN-Addr.*/
@@ -507,7 +505,7 @@ static void i596_display_data(struct net_device *dev)
 	rfd = lp->rfd_head;
 	printk("rfd_head = %p\n", rfd);
 	do {
-		printk ("   %p .stat %04x, .cmd %04x, b_next %08x, rbd %08x,"
+		printk("   %p .stat %04x, .cmd %04x, b_next %08x, rbd %08x,"
                         " count %04x\n",
 			rfd, rfd->stat, rfd->cmd, rfd->b_next, rfd->rbd,
 			rfd->count);
@@ -553,7 +551,7 @@ static inline void init_rx_bufs(struct net_device *dev)
 		struct sk_buff *skb = dev_alloc_skb(PKT_BUF_SZ + 4);
 
 		if (skb == NULL)
-			panic("82596: alloc_skb() failed");
+			panic("%s: alloc_skb() failed", __FILE__);
 		skb_reserve(skb, 2);
 		dma_addr = dma_map_single(lp->dev, skb->tail,PKT_BUF_SZ,
 					  DMA_FROM_DEVICE);
@@ -638,8 +636,8 @@ static int init_i596_mem(struct net_device *dev)
 
 	disable_irq(dev->irq);	/* disable IRQs from LAN */
 	DEB(DEB_INIT,
-		printk("RESET 82596 port: %08lX (with IRQ%d disabled)\n",
-		       dev->base_addr + PA_I82596_RESET,
+		printk("RESET 82596 port: %p (with IRQ %d disabled)\n",
+		       (void*)(dev->base_addr + PA_I82596_RESET),
 		       dev->irq));
 	
 	gsc_writel(0, (void*)(dev->base_addr + PA_I82596_RESET)); /* Hard Reset */
@@ -659,7 +657,7 @@ static int init_i596_mem(struct net_device *dev)
 	lp->cmd_head = NULL;
         lp->scb.cmd = I596_NULL;
 
-	DEB(DEB_INIT,printk("%s: starting i82596.\n", dev->name));
+	DEB(DEB_INIT, printk("%s: starting i82596.\n", dev->name));
 
 	CHECK_WBACK(&(lp->scp), sizeof(struct i596_scp));
 	CHECK_WBACK(&(lp->iscp), sizeof(struct i596_iscp));
@@ -668,9 +666,9 @@ static int init_i596_mem(struct net_device *dev)
 
 	CA(dev);
 
-	if (wait_istat(dev,lp,1000,"initialization timed out"))
+	if (wait_istat(dev, lp, 1000, "initialization timed out"))
 		goto failed;
-	DEB(DEB_INIT,printk("%s: i82596 initialization successful\n", dev->name));
+	DEB(DEB_INIT, printk("%s: i82596 initialization successful\n", dev->name));
 
 	/* Ensure rx frame/buffer descriptors are tidy */
 	rebuild_rx_bufs(dev);
@@ -680,30 +678,30 @@ static int init_i596_mem(struct net_device *dev)
 
 	enable_irq(dev->irq);	/* enable IRQs from LAN */
 
-	DEB(DEB_INIT,printk("%s: queuing CmdConfigure\n", dev->name));
+	DEB(DEB_INIT, printk("%s: queuing CmdConfigure\n", dev->name));
 	memcpy(lp->cf_cmd.i596_config, init_setup, 14);
 	lp->cf_cmd.cmd.command = CmdConfigure;
 	CHECK_WBACK(&(lp->cf_cmd), sizeof(struct cf_cmd));
 	i596_add_cmd(dev, &lp->cf_cmd.cmd);
 
-	DEB(DEB_INIT,printk("%s: queuing CmdSASetup\n", dev->name));
+	DEB(DEB_INIT, printk("%s: queuing CmdSASetup\n", dev->name));
 	memcpy(lp->sa_cmd.eth_addr, dev->dev_addr, 6);
 	lp->sa_cmd.cmd.command = CmdSASetup;
 	CHECK_WBACK(&(lp->sa_cmd), sizeof(struct sa_cmd));
 	i596_add_cmd(dev, &lp->sa_cmd.cmd);
 
-	DEB(DEB_INIT,printk("%s: queuing CmdTDR\n", dev->name));
+	DEB(DEB_INIT, printk("%s: queuing CmdTDR\n", dev->name));
 	lp->tdr_cmd.cmd.command = CmdTDR;
 	CHECK_WBACK(&(lp->tdr_cmd), sizeof(struct tdr_cmd));
 	i596_add_cmd(dev, &lp->tdr_cmd.cmd);
 
 	spin_lock_irqsave (&lp->lock, flags);
 
-	if (wait_cmd(dev,lp,1000,"timed out waiting to issue RX_START")) {
+	if (wait_cmd(dev, lp, 1000, "timed out waiting to issue RX_START")) {
 		spin_unlock_irqrestore (&lp->lock, flags);
 		goto failed;
 	}
-	DEB(DEB_INIT,printk("%s: Issuing RX_START\n", dev->name));
+	DEB(DEB_INIT, printk("%s: Issuing RX_START\n", dev->name));
 	lp->scb.command = RX_START;
 	lp->scb.rfd = WSWAPrfd(virt_to_dma(lp,lp->rfds));
 	CHECK_WBACK(&(lp->scb), sizeof(struct i596_scb));
@@ -712,9 +710,9 @@ static int init_i596_mem(struct net_device *dev)
 
 	spin_unlock_irqrestore (&lp->lock, flags);
 
-	if (wait_cmd(dev,lp,1000,"RX_START not processed"))
+	if (wait_cmd(dev, lp, 1000, "RX_START not processed"))
 		goto failed;
-	DEB(DEB_INIT,printk("%s: Receive unit started OK\n", dev->name));
+	DEB(DEB_INIT, printk("%s: Receive unit started OK\n", dev->name));
 
 	return 0;
 
@@ -732,7 +730,7 @@ static inline int i596_rx(struct net_device *dev)
 	struct i596_rbd *rbd;
 	int frames = 0;
 
-	DEB(DEB_RXFRAME,printk ("i596_rx(), rfd_head %p, rbd_head %p\n",
+	DEB(DEB_RXFRAME, printk("i596_rx(), rfd_head %p, rbd_head %p\n",
 			lp->rfd_head, lp->rbd_head));
 
 
@@ -795,7 +793,7 @@ static inline int i596_rx(struct net_device *dev)
 memory_squeeze:
 			if (skb == NULL) {
 				/* XXX tulip.c can defer packets here!! */
-				printk ("%s: i596_rx Memory squeeze, dropping packet.\n", dev->name);
+				printk("%s: i596_rx Memory squeeze, dropping packet.\n", dev->name);
 				lp->stats.rx_dropped++;
 			}
 			else {
@@ -864,7 +862,7 @@ memory_squeeze:
 		CHECK_INV(rfd, sizeof(struct i596_rfd));
 	}
 
-	DEB(DEB_RXFRAME,printk ("frames %d\n", frames));
+	DEB(DEB_RXFRAME, printk("frames %d\n", frames));
 
 	return 0;
 }
@@ -903,7 +901,7 @@ static inline void i596_cleanup_cmd(struct net_device *dev, struct i596_private
 		CHECK_WBACK_INV(ptr, sizeof(struct i596_cmd));
 	}
 
-	wait_cmd(dev,lp,100,"i596_cleanup_cmd timed out");
+	wait_cmd(dev, lp, 100, "i596_cleanup_cmd timed out");
 	lp->scb.cmd = I596_NULL;
 	CHECK_WBACK(&(lp->scb), sizeof(struct i596_scb));
 }
@@ -913,11 +911,11 @@ static inline void i596_reset(struct net_device *dev, struct i596_private *lp)
 {
 	unsigned long flags;
 
-	DEB(DEB_RESET,printk("i596_reset\n"));
+	DEB(DEB_RESET, printk("i596_reset\n"));
 
 	spin_lock_irqsave (&lp->lock, flags);
 
-	wait_cmd(dev,lp,100,"i596_reset timed out");
+	wait_cmd(dev, lp, 100, "i596_reset timed out");
 
 	netif_stop_queue(dev);
 
@@ -927,7 +925,7 @@ static inline void i596_reset(struct net_device *dev, struct i596_private *lp)
 	CA(dev);
 
 	/* wait for shutdown */
-	wait_cmd(dev,lp,1000,"i596_reset 2 timed out");
+	wait_cmd(dev, lp, 1000, "i596_reset 2 timed out");
 	spin_unlock_irqrestore (&lp->lock, flags);
 
 	i596_cleanup_cmd(dev,lp);
@@ -943,7 +941,7 @@ static void i596_add_cmd(struct net_device *dev, struct i596_cmd *cmd)
 	struct i596_private *lp = dev->priv;
 	unsigned long flags;
 
-	DEB(DEB_ADDCMD,printk("i596_add_cmd cmd_head %p\n", lp->cmd_head));
+	DEB(DEB_ADDCMD, printk("i596_add_cmd cmd_head %p\n", lp->cmd_head));
 
 	cmd->status = 0;
 	cmd->command |= (CMD_EOL | CMD_INTR);
@@ -959,7 +957,7 @@ static void i596_add_cmd(struct net_device *dev, struct i596_cmd *cmd)
 		CHECK_WBACK(lp->cmd_tail, sizeof(struct i596_cmd));
 	} else {
 		lp->cmd_head = cmd;
-		wait_cmd(dev,lp,100,"i596_add_cmd timed out");
+		wait_cmd(dev, lp, 100, "i596_add_cmd timed out");
 		lp->scb.cmd = WSWAPcmd(virt_to_dma(lp,&cmd->status));
 		lp->scb.command = CUC_START;
 		CHECK_WBACK(&(lp->scb), sizeof(struct i596_scb));
@@ -1015,7 +1013,7 @@ static int i596_test(struct net_device *dev)
 
 static int i596_open(struct net_device *dev)
 {
-	DEB(DEB_OPEN,printk("%s: i596_open() irq %d.\n", dev->name, dev->irq));
+	DEB(DEB_OPEN, printk("%s: i596_open() irq %d.\n", dev->name, dev->irq));
 
 	if (request_irq(dev->irq, &i596_interrupt, 0, "i82596", dev)) {
 		printk("%s: IRQ %d not free\n", dev->name, dev->irq);
@@ -1045,19 +1043,19 @@ static void i596_tx_timeout (struct net_device *dev)
 	struct i596_private *lp = dev->priv;
 
 	/* Transmitter timeout, serious problems. */
-	DEB(DEB_ERRORS,printk("%s: transmit timed out, status resetting.\n",
+	DEB(DEB_ERRORS, printk("%s: transmit timed out, status resetting.\n",
 			dev->name));
 
 	lp->stats.tx_errors++;
 
 	/* Try to restart the adaptor */
 	if (lp->last_restart == lp->stats.tx_packets) {
-		DEB(DEB_ERRORS,printk ("Resetting board.\n"));
+		DEB(DEB_ERRORS, printk("Resetting board.\n"));
 		/* Shutdown and restart */
 		i596_reset (dev, lp);
 	} else {
 		/* Issue a channel attention signal */
-		DEB(DEB_ERRORS,printk ("Kicking board.\n"));
+		DEB(DEB_ERRORS, printk("Kicking board.\n"));
 		lp->scb.command = CUC_START | RX_START;
 		CHECK_WBACK_INV(&(lp->scb), sizeof(struct i596_scb));
 		CA (dev);
@@ -1077,7 +1075,7 @@ static int i596_start_xmit(struct sk_buff *skb, struct net_device *dev)
 	short length = skb->len;
 	dev->trans_start = jiffies;
 
-	DEB(DEB_STARTTX,printk("%s: i596_start_xmit(%x,%p) called\n", dev->name,
+	DEB(DEB_STARTTX, printk("%s: i596_start_xmit(%x,%p) called\n", dev->name,
 				skb->len, skb->data));
 
 	if (length < ETH_ZLEN) {
@@ -1093,7 +1091,7 @@ static int i596_start_xmit(struct sk_buff *skb, struct net_device *dev)
 	tbd = lp->tbds + lp->next_tx_cmd;
 
 	if (tx_cmd->cmd.command) {
-		DEB(DEB_ERRORS,printk ("%s: xmit ring full, dropping packet.\n",
+		DEB(DEB_ERRORS, printk("%s: xmit ring full, dropping packet.\n",
 				dev->name));
 		lp->stats.tx_dropped++;
 
@@ -1157,28 +1155,28 @@ static int __devinit i82596_probe(struct net_device *dev,
 	/* This lot is ensure things have been cache line aligned. */
 	if (sizeof(struct i596_rfd) != 32) {
 	    printk("82596: sizeof(struct i596_rfd) = %d\n",
-			    sizeof(struct i596_rfd));
+			    (int)sizeof(struct i596_rfd));
 	    return -ENODEV;
 	}
 	if ((sizeof(struct i596_rbd) % 32) != 0) {
 	    printk("82596: sizeof(struct i596_rbd) = %d\n",
-			    sizeof(struct i596_rbd));
+			    (int)sizeof(struct i596_rbd));
 	    return -ENODEV;
 	}
 	if ((sizeof(struct tx_cmd) % 32) != 0) {
 	    printk("82596: sizeof(struct tx_cmd) = %d\n",
-			    sizeof(struct tx_cmd));
+			    (int)sizeof(struct tx_cmd));
 	    return -ENODEV;
 	}
 	if (sizeof(struct i596_tbd) != 32) {
 	    printk("82596: sizeof(struct i596_tbd) = %d\n",
-			    sizeof(struct i596_tbd));
+			    (int)sizeof(struct i596_tbd));
 	    return -ENODEV;
 	}
 #ifndef __LP64__
 	if (sizeof(struct i596_private) > 4096) {
 	    printk("82596: sizeof(struct i596_private) = %d\n",
-			    sizeof(struct i596_private));
+			    (int)sizeof(struct i596_private));
 	    return -ENODEV;
 	}
 #endif
@@ -1190,24 +1188,18 @@ static int __devinit i82596_probe(struct net_device *dev,
 		for (i=0; i < 6; i++) {
 			eth_addr[i] = gsc_readb(LAN_PROM_ADDR + i);
 		}
-		printk("82596.c: MAC of HP700 LAN read from EEPROM\n");
+		printk(KERN_INFO "%s: MAC of HP700 LAN read from EEPROM\n", __FILE__);
 	}
 
 	dev->mem_start = (unsigned long) dma_alloc_noncoherent(gen_dev, 
 		sizeof(struct i596_private), &dma_addr, GFP_KERNEL);
 	if (!dev->mem_start) {
-		printk("%s: Couldn't get shared memory\n", dev->name);
+		printk(KERN_ERR "%s: Couldn't get shared memory\n", __FILE__);
 		return -ENOMEM;
 	}
 
-	DEB(DEB_PROBE,printk("%s: 82596 at %#3lx,", dev->name, dev->base_addr));
-
 	for (i = 0; i < 6; i++)
-		DEB(DEB_PROBE,printk(" %2.2X", dev->dev_addr[i] = eth_addr[i]));
-
-	DEB(DEB_PROBE,printk(" IRQ %d.\n", dev->irq));
-
-	DEB(DEB_PROBE,printk(version));
+		dev->dev_addr[i] = eth_addr[i];
 
 	/* The 82596-specific entries in the device structure. */
 	dev->open = i596_open;
@@ -1221,9 +1213,6 @@ static int __devinit i82596_probe(struct net_device *dev,
 	dev->priv = (void *)(dev->mem_start);
 
 	lp = dev->priv;
-	DEB(DEB_INIT,printk ("%s: lp at 0x%08lx (%d bytes), lp->scb at 0x%08lx\n",
-		dev->name, (unsigned long)lp,
-		sizeof(struct i596_private), (unsigned long)&lp->scb));
 	memset(lp, 0, sizeof(struct i596_private));
 
 	lp->scb.command = 0;
@@ -1235,6 +1224,21 @@ static int __devinit i82596_probe(struct net_device *dev,
 
 	CHECK_WBACK_INV(dev->mem_start, sizeof(struct i596_private));
 
+	i = register_netdev(dev);
+	if (i) {
+		lp = dev->priv;
+		dma_free_noncoherent(lp->dev, sizeof(struct i596_private), 
+				    (void *)dev->mem_start, lp->dma_addr);
+		return i;
+	};
+
+	DEB(DEB_PROBE, printk(KERN_INFO "%s: 82596 at %#3lx,", dev->name, dev->base_addr));
+	for (i = 0; i < 6; i++)
+		DEB(DEB_PROBE, printk(" %2.2X", dev->dev_addr[i]));
+	DEB(DEB_PROBE, printk(" IRQ %d.\n", dev->irq));
+	DEB(DEB_INIT, printk(KERN_INFO "%s: lp at 0x%p (%d bytes), lp->scb at 0x%p\n",
+		dev->name, lp, (int)sizeof(struct i596_private), &lp->scb));
+
 	return 0;
 }
 
@@ -1246,7 +1250,7 @@ static irqreturn_t i596_interrupt(int irq, void *dev_id, struct pt_regs *regs)
 	unsigned short status, ack_cmd = 0;
 
 	if (dev == NULL) {
-		printk("i596_interrupt(): irq %d for unknown device.\n", irq);
+		printk("%s: irq %d for unknown device.\n", __FUNCTION__, irq);
 		return IRQ_NONE;
 	}
 
@@ -1254,10 +1258,10 @@ static irqreturn_t i596_interrupt(int irq, void *dev_id, struct pt_regs *regs)
 
 	spin_lock (&lp->lock);
 
-	wait_cmd(dev,lp,100,"i596 interrupt, timeout");
+	wait_cmd(dev, lp, 100, "i596 interrupt, timeout");
 	status = lp->scb.status;
 
-	DEB(DEB_INTS,printk("%s: i596 interrupt, IRQ %d, status %4.4x.\n",
+	DEB(DEB_INTS, printk("%s: i596 interrupt, IRQ %d, status %4.4x.\n",
 			dev->name, irq, status));
 
 	ack_cmd = status & 0xf000;
@@ -1272,9 +1276,9 @@ static irqreturn_t i596_interrupt(int irq, void *dev_id, struct pt_regs *regs)
 		struct i596_cmd *ptr;
 
 		if ((status & 0x8000))
-			DEB(DEB_INTS,printk("%s: i596 interrupt completed command.\n", dev->name));
+			DEB(DEB_INTS, printk("%s: i596 interrupt completed command.\n", dev->name));
 		if ((status & 0x2000))
-			DEB(DEB_INTS,printk("%s: i596 interrupt command unit inactive %x.\n", dev->name, status & 0x0700));
+			DEB(DEB_INTS, printk("%s: i596 interrupt command unit inactive %x.\n", dev->name, status & 0x0700));
 
 		while (lp->cmd_head != NULL) {
 			CHECK_INV(lp->cmd_head, sizeof(struct i596_cmd));
@@ -1283,7 +1287,7 @@ static irqreturn_t i596_interrupt(int irq, void *dev_id, struct pt_regs *regs)
 
 			ptr = lp->cmd_head;
 
-			DEB(DEB_STATUS,printk("cmd_head->status = %04x, ->command = %04x\n",
+			DEB(DEB_STATUS, printk("cmd_head->status = %04x, ->command = %04x\n",
 				       lp->cmd_head->status, lp->cmd_head->command));
 			lp->cmd_head = ptr->v_next;
 			lp->cmd_backlog--;
@@ -1295,7 +1299,7 @@ static irqreturn_t i596_interrupt(int irq, void *dev_id, struct pt_regs *regs)
 				struct sk_buff *skb = tx_cmd->skb;
 
 				if ((ptr->status) & STAT_OK) {
-					DEB(DEB_TXADDR,print_eth(skb->data, "tx-done"));
+					DEB(DEB_TXADDR, print_eth(skb->data, "tx-done"));
 				} else {
 					lp->stats.tx_errors++;
 					if ((ptr->status) & 0x0020)
@@ -1320,7 +1324,7 @@ static irqreturn_t i596_interrupt(int irq, void *dev_id, struct pt_regs *regs)
 				unsigned short status = ((struct tdr_cmd *)ptr)->status;
 
 				if (status & 0x8000) {
-					DEB(DEB_ANY,printk("%s: link ok.\n", dev->name));
+					DEB(DEB_ANY, printk("%s: link ok.\n", dev->name));
 				} else {
 					if (status & 0x4000)
 						printk("%s: Transceiver problem.\n", dev->name);
@@ -1329,7 +1333,7 @@ static irqreturn_t i596_interrupt(int irq, void *dev_id, struct pt_regs *regs)
 					if (status & 0x1000)
 						printk("%s: Short circuit.\n", dev->name);
 
-					DEB(DEB_TDR,printk("%s: Time %d.\n", dev->name, status & 0x07ff));
+					DEB(DEB_TDR, printk("%s: Time %d.\n", dev->name, status & 0x07ff));
 				}
 				break;
 			    }
@@ -1364,12 +1368,12 @@ static irqreturn_t i596_interrupt(int irq, void *dev_id, struct pt_regs *regs)
 	}
 	if ((status & 0x1000) || (status & 0x4000)) {
 		if ((status & 0x4000))
-			DEB(DEB_INTS,printk("%s: i596 interrupt received a frame.\n", dev->name));
+			DEB(DEB_INTS, printk("%s: i596 interrupt received a frame.\n", dev->name));
 		i596_rx(dev);
 		/* Only RX_START if stopped - RGH 07-07-96 */
 		if (status & 0x1000) {
 			if (netif_running(dev)) {
-				DEB(DEB_ERRORS,printk("%s: i596 interrupt receive unit inactive, status 0x%x\n", dev->name, status));
+				DEB(DEB_ERRORS, printk("%s: i596 interrupt receive unit inactive, status 0x%x\n", dev->name, status));
 				ack_cmd |= RX_START;
 				lp->stats.rx_errors++;
 				lp->stats.rx_fifo_errors++;
@@ -1377,7 +1381,7 @@ static irqreturn_t i596_interrupt(int irq, void *dev_id, struct pt_regs *regs)
 			}
 		}
 	}
-	wait_cmd(dev,lp,100,"i596 interrupt, timeout");
+	wait_cmd(dev, lp, 100, "i596 interrupt, timeout");
 	lp->scb.command = ack_cmd;
 	CHECK_WBACK(&lp->scb, sizeof(struct i596_scb));
 
@@ -1387,8 +1391,8 @@ static irqreturn_t i596_interrupt(int irq, void *dev_id, struct pt_regs *regs)
 
 	CA(dev);
 
-	wait_cmd(dev,lp,100,"i596 interrupt, exit timeout");
-	DEB(DEB_INTS,printk("%s: exiting interrupt.\n", dev->name));
+	wait_cmd(dev, lp, 100, "i596 interrupt, exit timeout");
+	DEB(DEB_INTS, printk("%s: exiting interrupt.\n", dev->name));
 
 	spin_unlock (&lp->lock);
 	return IRQ_HANDLED;
@@ -1401,18 +1405,18 @@ static int i596_close(struct net_device *dev)
 
 	netif_stop_queue(dev);
 
-	DEB(DEB_INIT,printk("%s: Shutting down ethercard, status was %4.4x.\n",
+	DEB(DEB_INIT, printk("%s: Shutting down ethercard, status was %4.4x.\n",
 		       dev->name, lp->scb.status));
 
 	spin_lock_irqsave(&lp->lock, flags);
 
-	wait_cmd(dev,lp,100,"close1 timed out");
+	wait_cmd(dev, lp, 100, "close1 timed out");
 	lp->scb.command = CUC_ABORT | RX_ABORT;
 	CHECK_WBACK(&lp->scb, sizeof(struct i596_scb));
 
 	CA(dev);
 
-	wait_cmd(dev,lp,100,"close2 timed out");
+	wait_cmd(dev, lp, 100, "close2 timed out");
 	spin_unlock_irqrestore(&lp->lock, flags);
 	DEB(DEB_STRUCT,i596_display_data(dev));
 	i596_cleanup_cmd(dev,lp);
@@ -1444,7 +1448,9 @@ static void set_multicast_list(struct net_device *dev)
 	struct i596_private *lp = dev->priv;
 	int config = 0, cnt;
 
-	DEB(DEB_MULTI,printk("%s: set multicast list, %d entries, promisc %s, allmulti %s\n", dev->name, dev->mc_count, dev->flags & IFF_PROMISC ? "ON" : "OFF", dev->flags & IFF_ALLMULTI ? "ON" : "OFF"));
+	DEB(DEB_MULTI, printk("%s: set multicast list, %d entries, promisc %s, allmulti %s\n",
+		dev->name, dev->mc_count, dev->flags & IFF_PROMISC ? "ON" : "OFF",
+		dev->flags & IFF_ALLMULTI ? "ON" : "OFF"));
 
 	if ((dev->flags & IFF_PROMISC) && !(lp->cf_cmd.i596_config[8] & 0x01)) {
 		lp->cf_cmd.i596_config[8] |= 0x01;
@@ -1493,7 +1499,7 @@ static void set_multicast_list(struct net_device *dev)
 		for (dmi = dev->mc_list; cnt && dmi != NULL; dmi = dmi->next, cnt--, cp += 6) {
 			memcpy(cp, dmi->dmi_addr, 6);
 			if (i596_debug > 1)
-				DEB(DEB_MULTI,printk("%s: Adding address %02x:%02x:%02x:%02x:%02x:%02x\n",
+				DEB(DEB_MULTI, printk("%s: Adding address %02x:%02x:%02x:%02x:%02x:%02x\n",
 						dev->name, cp[0],cp[1],cp[2],cp[3],cp[4],cp[5]));
 		}
 		CHECK_WBACK_INV(&lp->mc_cmd, sizeof(struct mc_cmd));
@@ -1516,11 +1522,15 @@ lan_init_chip(struct parisc_device *dev)
 
 	if (num_drivers >= MAX_DRIVERS) {
 		/* max count of possible i82596 drivers reached */
-		return -ENODEV;
+		return -ENOMEM;
 	}
+
+	if (num_drivers == 0)
+		printk(KERN_INFO LASI_82596_DRIVER_VERSION "\n");
 	
 	if (!dev->irq) {
-		printk(KERN_ERR __FILE__ ": IRQ not found for i82596 at 0x%lx\n", dev->hpa);
+		printk(KERN_ERR "%s: IRQ not found for i82596 at 0x%lx\n",
+			__FILE__, dev->hpa);
 		return -ENODEV;
 	}
 
@@ -1539,15 +1549,6 @@ lan_init_chip(struct parisc_device *dev)
 		return -ENODEV;
 	}
 
-	retval = register_netdev(netdevice);
-	if (retval) {
-		struct i596_private *lp = netdevice->priv;
-		printk(KERN_WARNING __FILE__ ": register_netdevice ret'd %d\n", retval);
-		dma_free_noncoherent(lp->dev, sizeof(struct i596_private), 
-				    (void *)netdevice->mem_start, lp->dma_addr);
-		free_netdev(netdevice);
-		return -ENODEV;
-	};
 	if (dev->id.sversion == 0x72) {
 		((struct i596_private *)netdevice->priv)->options = OPT_SWAP_PORT;
 	}
@@ -1600,6 +1601,7 @@ static void __exit lasi_82596_exit(void)
 				       (void *)netdevice->mem_start, lp->dma_addr);
 		free_netdev(netdevice);
 	}
+	num_drivers = 0;
 
 	unregister_parisc_driver(&lan_driver);
 }
diff --git a/drivers/net/lne390.c b/drivers/net/lne390.c
index 4a21b1cd3..0aa574b10 100644
--- a/drivers/net/lne390.c
+++ b/drivers/net/lne390.c
@@ -49,6 +49,8 @@ static const char *version =
 
 #include "8390.h"
 
+#define DRV_NAME "lne390"
+
 static int lne390_probe1(struct net_device *dev, int ioaddr);
 
 static int lne390_open(struct net_device *dev);
@@ -112,7 +114,7 @@ static int __init do_lne390_probe(struct net_device *dev)
 	SET_MODULE_OWNER(dev);
 
 	if (ioaddr > 0x1ff) {		/* Check a single specified location. */
-		if (!request_region(ioaddr, LNE390_IO_EXTENT, dev->name))
+		if (!request_region(ioaddr, LNE390_IO_EXTENT, DRV_NAME))
 			return -EBUSY;
 		ret = lne390_probe1(dev, ioaddr);
 		if (ret)
@@ -131,7 +133,7 @@ static int __init do_lne390_probe(struct net_device *dev)
 
 	/* EISA spec allows for up to 16 slots, but 8 is typical. */
 	for (ioaddr = 0x1000; ioaddr < 0x9000; ioaddr += 0x1000) {
-		if (!request_region(ioaddr, LNE390_IO_EXTENT, dev->name))
+		if (!request_region(ioaddr, LNE390_IO_EXTENT, DRV_NAME))
 			continue;
 		if (lne390_probe1(dev, ioaddr) == 0)
 			return 0;
@@ -151,6 +153,7 @@ static void cleanup_card(struct net_device *dev)
 		iounmap((void *)dev->mem_start);
 }
 
+#ifndef MODULE
 struct net_device * __init lne390_probe(int unit)
 {
 	struct net_device *dev = alloc_ei_netdev();
@@ -175,6 +178,7 @@ out:
 	free_netdev(dev);
 	return ERR_PTR(err);
 }
+#endif
 
 static int __init lne390_probe1(struct net_device *dev, int ioaddr)
 {
@@ -228,7 +232,7 @@ static int __init lne390_probe1(struct net_device *dev, int ioaddr)
 	}
 	printk(" IRQ %d,", dev->irq);
 
-	if ((ret = request_irq(dev->irq, ei_interrupt, 0, dev->name, dev))) {
+	if ((ret = request_irq(dev->irq, ei_interrupt, 0, DRV_NAME, dev))) {
 		printk (" unable to get IRQ %d.\n", dev->irq);
 		return ret;
 	}
diff --git a/drivers/net/loopback.c b/drivers/net/loopback.c
index 1885bfe3c..8ffa894c3 100644
--- a/drivers/net/loopback.c
+++ b/drivers/net/loopback.c
@@ -55,7 +55,9 @@
 #include <linux/if_arp.h>	/* For ARPHRD_ETHER */
 #include <linux/ip.h>
 #include <linux/tcp.h>
+#include <linux/percpu.h>
 
+static DEFINE_PER_CPU(struct net_device_stats, loopback_stats);
 
 #define LOOPBACK_OVERHEAD (128 + MAX_HEADER + 16 + 16)
 
@@ -123,7 +125,7 @@ static void emulate_large_send_offload(struct sk_buff *skb)
  */
 static int loopback_xmit(struct sk_buff *skb, struct net_device *dev)
 {
-	struct net_device_stats *stats = dev->priv;
+	struct net_device_stats *lb_stats;
 
 	skb_orphan(skb);
 
@@ -142,12 +144,13 @@ static int loopback_xmit(struct sk_buff *skb, struct net_device *dev)
 	}
 
 	dev->last_rx = jiffies;
-	if (likely(stats)) {
-		stats->rx_bytes+=skb->len;
-		stats->tx_bytes+=skb->len;
-		stats->rx_packets++;
-		stats->tx_packets++;
-	}
+
+	lb_stats = &per_cpu(loopback_stats, get_cpu());
+	lb_stats->rx_bytes += skb->len;
+	lb_stats->tx_bytes += skb->len;
+	lb_stats->rx_packets++;
+	lb_stats->tx_packets++;
+	put_cpu();
 
 	netif_rx(skb);
 
@@ -156,7 +159,28 @@ static int loopback_xmit(struct sk_buff *skb, struct net_device *dev)
 
 static struct net_device_stats *get_stats(struct net_device *dev)
 {
-	return (struct net_device_stats *)dev->priv;
+	struct net_device_stats *stats = dev->priv;
+	int i;
+
+	if (!stats) {
+		return NULL;
+	}
+
+	memset(stats, 0, sizeof(struct net_device_stats));
+
+	for (i=0; i < NR_CPUS; i++) {
+		struct net_device_stats *lb_stats;
+
+		if (!cpu_possible(i)) 
+			continue;
+		lb_stats = &per_cpu(loopback_stats, i);
+		stats->rx_bytes   += lb_stats->rx_bytes;
+		stats->tx_bytes   += lb_stats->tx_bytes;
+		stats->rx_packets += lb_stats->rx_packets;
+		stats->tx_packets += lb_stats->tx_packets;
+	}
+				
+	return stats;
 }
 
 struct net_device loopback_dev = {
@@ -173,7 +197,8 @@ struct net_device loopback_dev = {
 	.rebuild_header		= eth_rebuild_header,
 	.flags			= IFF_LOOPBACK,
 	.features 		= NETIF_F_SG|NETIF_F_FRAGLIST
-				  |NETIF_F_NO_CSUM|NETIF_F_HIGHDMA,
+				  |NETIF_F_NO_CSUM|NETIF_F_HIGHDMA
+				  |NETIF_F_LLTX,
 };
 
 /* Setup and register the of the LOOPBACK device. */
diff --git a/drivers/net/lp486e.c b/drivers/net/lp486e.c
index 7dda5dd05..c87d90a83 100644
--- a/drivers/net/lp486e.c
+++ b/drivers/net/lp486e.c
@@ -75,6 +75,8 @@ All other communication is through memory!
 #include <asm/io.h>
 #include <asm/dma.h>
 
+#define DRV_NAME "lp486e"
+
 /* debug print flags */
 #define LOG_SRCDST    0x80000000
 #define LOG_STATINT   0x40000000
@@ -477,7 +479,7 @@ remove_rx_bufs(struct net_device *dev) {
 		kfree(rfd);
 	} while (rfd != lp->rx_tail);
 
-	lp->rx_tail = 0;
+	lp->rx_tail = NULL;
 
 #if 0
 	for (lp->rbd_list) {
@@ -970,7 +972,7 @@ int __init lp486e_probe(struct net_device *dev) {
 		return -ENODEV;
 	probed++;
 
-	if (!request_region(IOADDR, LP486E_TOTAL_SIZE, dev->name)) {
+	if (!request_region(IOADDR, LP486E_TOTAL_SIZE, DRV_NAME)) {
 		printk(KERN_ERR "lp486e: IO address 0x%x in use\n", IOADDR);
 		return -EBUSY;
 	}
diff --git a/drivers/net/mace.c b/drivers/net/mace.c
index cde3ee348..fab5607bd 100644
--- a/drivers/net/mace.c
+++ b/drivers/net/mace.c
@@ -432,7 +432,7 @@ static inline void mace_clean_rings(struct mace_data *mp)
     for (i = 0; i < N_RX_RING; ++i) {
 	if (mp->rx_bufs[i] != 0) {
 	    dev_kfree_skb(mp->rx_bufs[i]);
-	    mp->rx_bufs[i] = 0;
+	    mp->rx_bufs[i] = NULL;
 	}
     }
     for (i = mp->tx_empty; i != mp->tx_fill; ) {
@@ -475,7 +475,7 @@ static int mace_open(struct net_device *dev)
 	cp->xfer_status = 0;
 	++cp;
     }
-    mp->rx_bufs[i] = 0;
+    mp->rx_bufs[i] = NULL;
     st_le16(&cp->command, DBDMA_STOP);
     mp->rx_fill = i;
     mp->rx_empty = 0;
@@ -959,7 +959,7 @@ static irqreturn_t mace_rxdma_intr(int irq, void *dev_id, struct pt_regs *regs)
 		mp->stats.rx_bytes += skb->len;
 		netif_rx(skb);
 		dev->last_rx = jiffies;
-		mp->rx_bufs[i] = 0;
+		mp->rx_bufs[i] = NULL;
 		++mp->stats.rx_packets;
 	    }
 	} else {
diff --git a/drivers/net/macsonic.c b/drivers/net/macsonic.c
index 73b1bbe38..e67bf67f1 100644
--- a/drivers/net/macsonic.c
+++ b/drivers/net/macsonic.c
@@ -53,7 +53,6 @@
 #include <asm/macintosh.h>
 #include <asm/macints.h>
 #include <asm/mac_via.h>
-#include <asm/pgalloc.h>
 
 #define SREGS_PAD(n)    u16 n;
 
@@ -613,7 +612,6 @@ static struct net_device *dev_macsonic;
 
 MODULE_PARM(sonic_debug, "i");
 MODULE_PARM_DESC(sonic_debug, "macsonic debug level (1-4)");
-MODULE_LICENSE("GPL");
 
 int
 init_module(void)
diff --git a/drivers/net/myri_sbus.c b/drivers/net/myri_sbus.c
index 14a14f353..c4c9cb22a 100644
--- a/drivers/net/myri_sbus.c
+++ b/drivers/net/myri_sbus.c
@@ -1129,7 +1129,7 @@ static int __init myri_sbus_match(struct sbus_dev *sdev)
 static int __init myri_sbus_probe(void)
 {
 	struct sbus_bus *bus;
-	struct sbus_dev *sdev = 0;
+	struct sbus_dev *sdev = NULL;
 	static int called;
 	int cards = 0, v;
 
diff --git a/drivers/net/natsemi.c b/drivers/net/natsemi.c
index 8c45911fe..88c626afe 100644
--- a/drivers/net/natsemi.c
+++ b/drivers/net/natsemi.c
@@ -139,12 +139,6 @@
 	* NAPI
 */
 
-#if !defined(__OPTIMIZE__)
-#warning  You must compile this file with the correct options!
-#warning  See the last lines of the source file.
-#error You must compile this driver with "-O".
-#endif
-
 #include <linux/config.h>
 #include <linux/module.h>
 #include <linux/kernel.h>
@@ -236,7 +230,14 @@ static int full_duplex[MAX_UNITS];
 #define NATSEMI_REGS_SIZE	(NATSEMI_NREGS * sizeof(u32))
 #define NATSEMI_EEPROM_SIZE	24 /* 12 16-bit values */
 
-#define PKT_BUF_SZ		1536 /* Size of each temporary Rx buffer. */
+/* Buffer sizes:
+ * The nic writes 32-bit values, even if the upper bytes of
+ * a 32-bit value are beyond the end of the buffer.
+ */
+#define NATSEMI_HEADERS		22	/* 2*mac,type,vlan,crc */
+#define NATSEMI_PADDING		16	/* 2 bytes should be sufficient */
+#define NATSEMI_LONGPKT		1518	/* limit for normal packets */
+#define NATSEMI_RX_LIMIT	2046	/* maximum supported by hardware */
 
 /* These identify the driver base version and may not be removed. */
 static char version[] __devinitdata =
@@ -360,6 +361,18 @@ enum pcistuff {
 #define PCI_IOTYPE (PCI_USES_MASTER | PCI_USES_MEM | PCI_ADDR1)
 
 
+/*
+ * Support for fibre connections on Am79C874:
+ * This phy needs a special setup when connected to a fibre cable.
+ * http://www.amd.com/files/connectivitysolutions/networking/archivednetworking/22235.pdf
+ */
+#define PHYID_AM79C874	0x0022561b
+
+#define MII_MCTRL	0x15	/* mode control register */
+#define MII_FX_SEL	0x0001	/* 100BASE-FX (fiber) */
+#define MII_EN_SCRM	0x0004	/* enable scrambler (tp) */
+
+ 
 /* array of board data directly indexed by pci_tbl[x].driver_data */
 static struct {
 	const char *name;
@@ -463,6 +476,9 @@ enum EECtrl_bits {
 	EE_DataIn		= 0x01,
 	EE_ChipSelect		= 0x08,
 	EE_DataOut		= 0x02,
+	MII_Data 		= 0x10,
+	MII_Write		= 0x20,
+	MII_ShiftClk		= 0x40,
 };
 
 enum PCIBusCfg_bits {
@@ -524,6 +540,22 @@ enum TxConfig_bits {
 	TxCarrierIgn		= 0x80000000
 };
 
+/* 
+ * Tx Configuration:
+ * - 256 byte DMA burst length
+ * - fill threshold 512 bytes (i.e. restart DMA when 512 bytes are free)
+ * - 64 bytes initial drain threshold (i.e. begin actual transmission
+ *   when 64 byte are in the fifo)
+ * - on tx underruns, increase drain threshold by 64.
+ * - at most use a drain threshold of 1472 bytes: The sum of the fill
+ *   threshold and the drain threshold must be less than 2016 bytes.
+ *
+ */
+#define TX_FLTH_VAL		((512/32) << 8)
+#define TX_DRTH_VAL_START	(64/32)
+#define TX_DRTH_VAL_INC		2
+#define TX_DRTH_VAL_LIMIT	(1472/32)
+
 enum RxConfig_bits {
 	RxDrthMask		= 0x3e,
 	RxMxdmaMask		= 0x700000,
@@ -540,6 +572,7 @@ enum RxConfig_bits {
 	RxAcceptRunt		= 0x40000000,
 	RxAcceptErr		= 0x80000000
 };
+#define RX_DRTH_VAL		(128/8)
 
 enum ClkRun_bits {
 	PMEEnable		= 0x100,
@@ -594,9 +627,12 @@ enum MIntrCtrl_bits {
 };
 
 enum PhyCtrl_bits {
-	PhyAddrMask		= 0xf,
+	PhyAddrMask		= 0x1f,
 };
 
+#define PHY_ADDR_NONE		32
+#define PHY_ADDR_INTERNAL	1
+
 /* values we might find in the silicon revision register */
 #define SRR_DP83815_C	0x0302
 #define SRR_DP83815_D	0x0403
@@ -656,7 +692,9 @@ struct netdev_private {
 	int oom;
 	/* Do not touch the nic registers */
 	int hands_off;
-	/* These values are keep track of the transceiver/media in use */
+	/* external phy that is used: only valid if dev->if_port != PORT_TP */
+	int mii;
+	int phy_addr_external;
 	unsigned int full_duplex;
 	/* Rx filter */
 	u32 cur_rx_mode;
@@ -669,6 +707,10 @@ struct netdev_private {
 	u32 srr;
 	/* expected DSPCFG value */
 	u16 dspcfg;
+	/* parms saved in ethtool format */
+	u16	speed;		/* The forced speed, 10Mb, 100Mb, gigabit */
+	u8	duplex;		/* Duplex, half or full */
+	u8	autoneg;	/* Autonegotiation enabled */
 	/* MII transceiver section */
 	u16 advertising;
 	unsigned int iosize;
@@ -676,9 +718,14 @@ struct netdev_private {
 	u32 msg_enable;
 };
 
+static void move_int_phy(struct net_device *dev, int addr);
 static int eeprom_read(long ioaddr, int location);
-static int mdio_read(struct net_device *dev, int phy_id, int reg);
-static void mdio_write(struct net_device *dev, int phy_id, int reg, u16 data);
+static int mdio_read(struct net_device *dev, int reg);
+static void mdio_write(struct net_device *dev, int reg, u16 data);
+static void init_phy_fixup(struct net_device *dev);
+static int miiport_read(struct net_device *dev, int phy_id, int reg);
+static void miiport_write(struct net_device *dev, int phy_id, int reg, u16 data);
+static int find_mii(struct net_device *dev);
 static void natsemi_reset(struct net_device *dev);
 static void natsemi_reload_eeprom(struct net_device *dev);
 static void natsemi_stop_rxtx(struct net_device *dev);
@@ -702,6 +749,7 @@ static irqreturn_t intr_handler(int irq, void *dev_instance, struct pt_regs *reg
 static void netdev_error(struct net_device *dev, int intr_status);
 static void netdev_rx(struct net_device *dev);
 static void netdev_tx_done(struct net_device *dev);
+static int natsemi_change_mtu(struct net_device *dev, int new_mtu);
 static void __set_rx_mode(struct net_device *dev);
 static void set_rx_mode(struct net_device *dev);
 static void __get_stats(struct net_device *dev);
@@ -718,6 +766,29 @@ static int netdev_close(struct net_device *dev);
 static int netdev_get_regs(struct net_device *dev, u8 *buf);
 static int netdev_get_eeprom(struct net_device *dev, u8 *buf);
 
+static void move_int_phy(struct net_device *dev, int addr)
+{
+	struct netdev_private *np = netdev_priv(dev);
+	int target = 31;
+
+	/* 
+	 * The internal phy is visible on the external mii bus. Therefore we must
+	 * move it away before we can send commands to an external phy.
+	 * There are two addresses we must avoid:
+	 * - the address on the external phy that is used for transmission.
+	 * - the address that we want to access. User space can access phys
+	 *   on the mii bus with SIOCGMIIREG/SIOCSMIIREG, independant from the
+	 *   phy that is used for transmission.
+	 */
+
+	if (target == addr)
+		target--;
+	if (target == np->phy_addr_external)
+		target--;
+	writew(target, dev->base_addr + PhyCtrl);
+	readw(dev->base_addr + PhyCtrl);
+	udelay(1);
+}
 
 static int __devinit natsemi_probe1 (struct pci_dev *pdev,
 	const struct pci_device_id *ent)
@@ -766,7 +837,7 @@ static int __devinit natsemi_probe1 (struct pci_dev *pdev,
 	SET_MODULE_OWNER(dev);
 	SET_NETDEV_DEV(dev, &pdev->dev);
 
-	i = pci_request_regions(pdev, dev->name);
+	i = pci_request_regions(pdev, DRV_NAME);
 	if (i)
 		goto err_pci_request_regions;
 
@@ -788,7 +859,7 @@ static int __devinit natsemi_probe1 (struct pci_dev *pdev,
 	dev->base_addr = ioaddr;
 	dev->irq = irq;
 
-	np = dev->priv;
+	np = netdev_priv(dev);
 
 	np->pci_dev = pdev;
 	pci_set_drvdata(pdev, dev);
@@ -797,10 +868,32 @@ static int __devinit natsemi_probe1 (struct pci_dev *pdev,
 	np->msg_enable = (debug >= 0) ? (1<<debug)-1 : NATSEMI_DEF_MSG;
 	np->hands_off = 0;
 
+	/* Initial port:
+	 * - If the nic was configured to use an external phy and if find_mii
+	 *   finds a phy: use external port, first phy that replies.
+	 * - Otherwise: internal port.
+	 * Note that the phy address for the internal phy doesn't matter:
+	 * The address would be used to access a phy over the mii bus, but
+	 * the internal phy is accessed through mapped registers.
+	 */
+	if (readl(dev->base_addr + ChipConfig) & CfgExtPhy)
+		dev->if_port = PORT_MII;
+	else
+		dev->if_port = PORT_TP;
 	/* Reset the chip to erase previous misconfiguration. */
 	natsemi_reload_eeprom(dev);
 	natsemi_reset(dev);
 
+	if (dev->if_port != PORT_TP) {
+		np->phy_addr_external = find_mii(dev);
+		if (np->phy_addr_external == PHY_ADDR_NONE) {
+			dev->if_port = PORT_TP;
+			np->phy_addr_external = PHY_ADDR_INTERNAL;
+		}
+	} else {
+		np->phy_addr_external = PHY_ADDR_INTERNAL;
+	}
+
 	option = find_cnt < MAX_UNITS ? options[find_cnt] : 0;
 	if (dev->mem_start)
 		option = dev->mem_start;
@@ -811,8 +904,8 @@ static int __devinit natsemi_probe1 (struct pci_dev *pdev,
 			np->full_duplex = 1;
 		if (option & 15)
 			printk(KERN_INFO
-				"%s: ignoring user supplied media type %d",
-				dev->name, option & 15);
+				"natsemi %s: ignoring user supplied media type %d",
+				pci_name(np->pci_dev), option & 15);
 	}
 	if (find_cnt < MAX_UNITS  &&  full_duplex[find_cnt])
 		np->full_duplex = 1;
@@ -823,6 +916,7 @@ static int __devinit natsemi_probe1 (struct pci_dev *pdev,
 	dev->stop = &netdev_close;
 	dev->get_stats = &get_stats;
 	dev->set_multicast_list = &set_rx_mode;
+	dev->change_mtu = &natsemi_change_mtu;
 	dev->do_ioctl = &netdev_ioctl;
 	dev->tx_timeout = &tx_timeout;
 	dev->watchdog_timeo = TX_TIMEOUT;
@@ -830,45 +924,57 @@ static int __devinit natsemi_probe1 (struct pci_dev *pdev,
 	if (mtu)
 		dev->mtu = mtu;
 
-	i = register_netdev(dev);
-	if (i)
-		goto err_register_netdev;
-
 	netif_carrier_off(dev);
 
-	if (netif_msg_drv(np)) {
-		printk(KERN_INFO "%s: %s at %#08lx, ",
-			dev->name, natsemi_pci_info[chip_idx].name, ioaddr);
-		for (i = 0; i < ETH_ALEN-1; i++)
-				printk("%02x:", dev->dev_addr[i]);
-		printk("%02x, IRQ %d.\n", dev->dev_addr[i], irq);
-	}
+	/* get the initial settings from hardware */
+	tmp            = mdio_read(dev, MII_BMCR);
+	np->speed      = (tmp & BMCR_SPEED100)? SPEED_100     : SPEED_10;
+	np->duplex     = (tmp & BMCR_FULLDPLX)? DUPLEX_FULL   : DUPLEX_HALF;
+	np->autoneg    = (tmp & BMCR_ANENABLE)? AUTONEG_ENABLE: AUTONEG_DISABLE;
+	np->advertising= mdio_read(dev, MII_ADVERTISE);
 
-	np->advertising = mdio_read(dev, 1, MII_ADVERTISE);
-	if ((readl(ioaddr + ChipConfig) & 0xe000) != 0xe000
+	if ((np->advertising & ADVERTISE_ALL) != ADVERTISE_ALL
 	 && netif_msg_probe(np)) {
-		u32 chip_config = readl(ioaddr + ChipConfig);
-		printk(KERN_INFO "%s: Transceiver default autonegotiation %s "
+		printk(KERN_INFO "natsemi %s: Transceiver default autonegotiation %s "
 			"10%s %s duplex.\n",
-			dev->name,
-			chip_config & CfgAnegEnable ?
+			pci_name(np->pci_dev),
+			(mdio_read(dev, MII_BMCR) & BMCR_ANENABLE)?
 			  "enabled, advertise" : "disabled, force",
-			chip_config & CfgAneg100 ? "0" : "",
-			chip_config & CfgAnegFull ? "full" : "half");
+			(np->advertising &
+			  (ADVERTISE_100FULL|ADVERTISE_100HALF))?
+			    "0" : "",
+			(np->advertising &
+			  (ADVERTISE_100FULL|ADVERTISE_10FULL))?
+			    "full" : "half");
 	}
 	if (netif_msg_probe(np))
 		printk(KERN_INFO
-			"%s: Transceiver status %#04x advertising %#04x.\n",
-			dev->name, mdio_read(dev, 1, MII_BMSR),
+			"natsemi %s: Transceiver status %#04x advertising %#04x.\n",
+			pci_name(np->pci_dev), mdio_read(dev, MII_BMSR),
 			np->advertising);
 
 	/* save the silicon revision for later querying */
 	np->srr = readl(ioaddr + SiliconRev);
 	if (netif_msg_hw(np))
-		printk(KERN_INFO "%s: silicon revision %#04x.\n",
-				dev->name, np->srr);
+		printk(KERN_INFO "natsemi %s: silicon revision %#04x.\n",
+				pci_name(np->pci_dev), np->srr);
 
+	i = register_netdev(dev);
+	if (i)
+		goto err_register_netdev;
 
+	if (netif_msg_drv(np)) {
+		printk(KERN_INFO "natsemi %s: %s at %#08lx (%s), ",
+			dev->name, natsemi_pci_info[chip_idx].name, ioaddr,
+			pci_name(np->pci_dev));
+		for (i = 0; i < ETH_ALEN-1; i++)
+				printk("%02x:", dev->dev_addr[i]);
+		printk("%02x, IRQ %d", dev->dev_addr[i], irq);
+		if (dev->if_port == PORT_TP)
+			printk(", port TP.\n");
+		else
+			printk(", port MII, phy ad %d.\n", np->phy_addr_external);
+	}
 	return 0;
 
  err_register_netdev:
@@ -939,25 +1045,335 @@ static int eeprom_read(long addr, int location)
 
 /* MII transceiver control section.
  * The 83815 series has an internal transceiver, and we present the
- * management registers as if they were MII connected. */
+ * internal management registers as if they were MII connected.
+ * External Phy registers are referenced through the MII interface.
+ */
+
+/* clock transitions >= 20ns (25MHz)
+ * One readl should be good to PCI @ 100MHz
+ */
+#define mii_delay(dev)  readl(dev->base_addr + EECtrl)
+
+static int mii_getbit (struct net_device *dev)
+{
+	int data;
+
+	writel(MII_ShiftClk, dev->base_addr + EECtrl);
+	data = readl(dev->base_addr + EECtrl);
+	writel(0, dev->base_addr + EECtrl);
+	mii_delay(dev);
+	return (data & MII_Data)? 1 : 0;
+}
+
+static void mii_send_bits (struct net_device *dev, u32 data, int len)
+{
+	u32 i;
+
+	for (i = (1 << (len-1)); i; i >>= 1)
+	{
+		u32 mdio_val = MII_Write | ((data & i)? MII_Data : 0);
+		writel(mdio_val, dev->base_addr + EECtrl);
+		mii_delay(dev);
+		writel(mdio_val | MII_ShiftClk, dev->base_addr + EECtrl);
+		mii_delay(dev);
+	}
+	writel(0, dev->base_addr + EECtrl);
+	mii_delay(dev);
+}
+
+static int miiport_read(struct net_device *dev, int phy_id, int reg)
+{
+	u32 cmd;
+	int i;
+	u32 retval = 0;
+
+	/* Ensure sync */
+	mii_send_bits (dev, 0xffffffff, 32);
+	/* ST(2), OP(2), ADDR(5), REG#(5), TA(2), Data(16) total 32 bits */
+	/* ST,OP = 0110'b for read operation */
+	cmd = (0x06 << 10) | (phy_id << 5) | reg;
+	mii_send_bits (dev, cmd, 14);
+	/* Turnaround */
+	if (mii_getbit (dev))
+		return 0;
+	/* Read data */
+	for (i = 0; i < 16; i++) {
+		retval <<= 1;
+		retval |= mii_getbit (dev);
+	}
+	/* End cycle */
+	mii_getbit (dev);
+	return retval;
+}
 
-static int mdio_read(struct net_device *dev, int phy_id, int reg)
+static void miiport_write(struct net_device *dev, int phy_id, int reg, u16 data)
 {
-	if (phy_id == 1 && reg < 32)
-		return readl(dev->base_addr+BasicControl+(reg<<2))&0xffff;
+	u32 cmd;
+
+	/* Ensure sync */
+	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 = 0x5002 for write */
+	cmd = (0x5002 << 16) | (phy_id << 23) | (reg << 18) | data;
+	mii_send_bits (dev, cmd, 32);
+	/* End cycle */
+	mii_getbit (dev);
+}
+
+static int mdio_read(struct net_device *dev, int reg)
+{
+	struct netdev_private *np = netdev_priv(dev);
+
+	/* The 83815 series has two ports:
+	 * - an internal transceiver
+	 * - an external mii bus
+	 */
+	if (dev->if_port == PORT_TP)
+		return readw(dev->base_addr+BasicControl+(reg<<2));
 	else
-		return 0xffff;
+		return miiport_read(dev, np->phy_addr_external, reg);
 }
 
-static void mdio_write(struct net_device *dev, int phy_id, int reg, u16 data)
+static void mdio_write(struct net_device *dev, int reg, u16 data)
 {
-	struct netdev_private *np = dev->priv;
-	if (phy_id == 1 && reg < 32) {
+	struct netdev_private *np = netdev_priv(dev);
+
+	/* The 83815 series has an internal transceiver; handle separately */
+	if (dev->if_port == PORT_TP)
 		writew(data, dev->base_addr+BasicControl+(reg<<2));
-		switch (reg) {
-			case MII_ADVERTISE: np->advertising = data; break;
+	else
+		miiport_write(dev, np->phy_addr_external, reg, data);
+}
+
+static void init_phy_fixup(struct net_device *dev)
+{
+	struct netdev_private *np = netdev_priv(dev);
+	long ioaddr = dev->base_addr;
+	int i;
+	u32 cfg;
+	u16 tmp;
+
+	/* restore stuff lost when power was out */
+	tmp = mdio_read(dev, MII_BMCR);
+	if (np->autoneg == AUTONEG_ENABLE) {
+		/* renegotiate if something changed */
+		if ((tmp & BMCR_ANENABLE) == 0
+		 || np->advertising != mdio_read(dev, MII_ADVERTISE))
+		{
+			/* turn on autonegotiation and force negotiation */
+			tmp |= (BMCR_ANENABLE | BMCR_ANRESTART);
+			mdio_write(dev, MII_ADVERTISE, np->advertising);
+		}
+	} else {
+		/* turn off auto negotiation, set speed and duplexity */
+		tmp &= ~(BMCR_ANENABLE | BMCR_SPEED100 | BMCR_FULLDPLX);
+		if (np->speed == SPEED_100)
+			tmp |= BMCR_SPEED100;
+		if (np->duplex == DUPLEX_FULL)
+			tmp |= BMCR_FULLDPLX;
+		/* 
+		 * Note: there is no good way to inform the link partner
+		 * that our capabilities changed. The user has to unplug
+		 * and replug the network cable after some changes, e.g.
+		 * after switching from 10HD, autoneg off to 100 HD,
+		 * autoneg off.
+		 */
+	}
+	mdio_write(dev, MII_BMCR, tmp);
+	readl(dev->base_addr + ChipConfig);
+	udelay(1);
+
+	/* find out what phy this is */
+	np->mii = (mdio_read(dev, MII_PHYSID1) << 16)
+				+ mdio_read(dev, MII_PHYSID2);
+
+	/* handle external phys here */
+	switch (np->mii) {
+	case PHYID_AM79C874:
+		/* phy specific configuration for fibre/tp operation */
+		tmp = mdio_read(dev, MII_MCTRL);
+		tmp &= ~(MII_FX_SEL | MII_EN_SCRM);
+		if (dev->if_port == PORT_FIBRE)
+			tmp |= MII_FX_SEL;
+		else
+			tmp |= MII_EN_SCRM;
+		mdio_write(dev, MII_MCTRL, tmp);
+		break;
+	default:
+		break;
+	}
+	cfg = readl(dev->base_addr + ChipConfig);
+	if (cfg & CfgExtPhy)
+		return;
+
+	/* On page 78 of the spec, they recommend some settings for "optimum
+	   performance" to be done in sequence.  These settings optimize some
+	   of the 100Mbit autodetection circuitry.  They say we only want to
+	   do this for rev C of the chip, but engineers at NSC (Bradley
+	   Kennedy) recommends always setting them.  If you don't, you get
+	   errors on some autonegotiations that make the device unusable.
+
+	   It seems that the DSP needs a few usec to reinitialize after
+	   the start of the phy. Just retry writing these values until they
+	   stick.
+	*/
+	for (i=0;i<NATSEMI_HW_TIMEOUT;i++) {
+
+		int dspcfg;
+		writew(1, ioaddr + PGSEL);
+		writew(PMDCSR_VAL, ioaddr + PMDCSR);
+		writew(TSTDAT_VAL, ioaddr + TSTDAT);
+		np->dspcfg = DSPCFG_VAL;
+		writew(np->dspcfg, ioaddr + DSPCFG);
+		writew(SDCFG_VAL, ioaddr + SDCFG);
+		writew(0, ioaddr + PGSEL);
+		readl(ioaddr + ChipConfig);
+		udelay(10);
+
+		writew(1, ioaddr + PGSEL);
+		dspcfg = readw(ioaddr + DSPCFG);
+		writew(0, ioaddr + PGSEL);
+		if (np->dspcfg == dspcfg)
+			break;
+	}
+
+	if (netif_msg_link(np)) {
+		if (i==NATSEMI_HW_TIMEOUT) {
+			printk(KERN_INFO
+				"%s: DSPCFG mismatch after retrying for %d usec.\n",
+				dev->name, i*10);
+		} else {
+			printk(KERN_INFO
+				"%s: DSPCFG accepted after %d usec.\n",
+				dev->name, i*10);
 		}
 	}
+	/*
+	 * Enable PHY Specific event based interrupts.  Link state change
+	 * and Auto-Negotiation Completion are among the affected.
+	 * Read the intr status to clear it (needed for wake events).
+	 */
+	readw(ioaddr + MIntrStatus);
+	writew(MICRIntEn, ioaddr + MIntrCtrl);
+}
+
+static int switch_port_external(struct net_device *dev)
+{
+	struct netdev_private *np = netdev_priv(dev);
+	u32 cfg;
+
+	cfg = readl(dev->base_addr + ChipConfig);
+	if (cfg & CfgExtPhy)
+		return 0;
+
+	if (netif_msg_link(np)) {
+		printk(KERN_INFO "%s: switching to external transceiver.\n",
+				dev->name);
+	}
+
+	/* 1) switch back to external phy */
+	writel(cfg | (CfgExtPhy | CfgPhyDis), dev->base_addr + ChipConfig);
+	readl(dev->base_addr + ChipConfig);
+	udelay(1);
+
+	/* 2) reset the external phy: */
+	/* resetting the external PHY has been known to cause a hub supplying
+	 * power over Ethernet to kill the power.  We don't want to kill
+	 * power to this computer, so we avoid resetting the phy.
+	 */
+
+	/* 3) reinit the phy fixup, it got lost during power down. */
+	move_int_phy(dev, np->phy_addr_external);
+	init_phy_fixup(dev);
+
+	return 1;
+}
+
+static int switch_port_internal(struct net_device *dev)
+{
+	struct netdev_private *np = netdev_priv(dev);
+	int i;
+	u32 cfg;
+	u16 bmcr;
+
+	cfg = readl(dev->base_addr + ChipConfig);
+	if (!(cfg &CfgExtPhy))
+		return 0;
+
+	if (netif_msg_link(np)) {
+		printk(KERN_INFO "%s: switching to internal transceiver.\n",
+				dev->name);
+	}
+	/* 1) switch back to internal phy: */
+	cfg = cfg & ~(CfgExtPhy | CfgPhyDis);
+	writel(cfg, dev->base_addr + ChipConfig);
+	readl(dev->base_addr + ChipConfig);
+	udelay(1);
+	
+	/* 2) reset the internal phy: */
+	bmcr = readw(dev->base_addr+BasicControl+(MII_BMCR<<2));
+	writel(bmcr | BMCR_RESET, dev->base_addr+BasicControl+(MII_BMCR<<2));
+	readl(dev->base_addr + ChipConfig);
+	udelay(10);
+	for (i=0;i<NATSEMI_HW_TIMEOUT;i++) {
+		bmcr = readw(dev->base_addr+BasicControl+(MII_BMCR<<2));
+		if (!(bmcr & BMCR_RESET))
+			break;
+		udelay(10);
+	}
+	if (i==NATSEMI_HW_TIMEOUT && netif_msg_link(np)) {
+		printk(KERN_INFO
+			"%s: phy reset did not complete in %d usec.\n",
+			dev->name, i*10);
+	}
+	/* 3) reinit the phy fixup, it got lost during power down. */
+	init_phy_fixup(dev);
+
+	return 1;
+}
+
+/* Scan for a PHY on the external mii bus.
+ * There are two tricky points:
+ * - Do not scan while the internal phy is enabled. The internal phy will
+ *   crash: e.g. reads from the DSPCFG register will return odd values and
+ *   the nasty random phy reset code will reset the nic every few seconds.
+ * - The internal phy must be moved around, an external phy could
+ *   have the same address as the internal phy.
+ */
+static int find_mii(struct net_device *dev)
+{
+	struct netdev_private *np = netdev_priv(dev);
+	int tmp;
+	int i;
+	int did_switch;
+
+	/* Switch to external phy */
+	did_switch = switch_port_external(dev);
+		
+	/* Scan the possible phy addresses:
+	 *
+	 * PHY address 0 means that the phy is in isolate mode. Not yet
+	 * supported due to lack of test hardware. User space should
+	 * handle it through ethtool.
+	 */
+	for (i = 1; i <= 31; i++) {
+		move_int_phy(dev, i);
+		tmp = miiport_read(dev, i, MII_BMSR);
+		if (tmp != 0xffff && tmp != 0x0000) {
+			/* found something! */
+			np->mii = (mdio_read(dev, MII_PHYSID1) << 16)
+					+ mdio_read(dev, MII_PHYSID2);
+	 		if (netif_msg_probe(np)) {
+				printk(KERN_INFO "natsemi %s: found external phy %08x at address %d.\n",
+						pci_name(np->pci_dev), np->mii, i);
+			}
+			break;
+		}
+	}
+	/* And switch back to internal phy: */
+	if (did_switch)
+		switch_port_internal(dev);
+	return i;
 }
 
 /* CFG bits [13:16] [18:23] */
@@ -975,7 +1391,7 @@ static void natsemi_reset(struct net_device *dev)
 	u32 rfcr;
 	u16 pmatch[3];
 	u16 sopass[3];
-	struct netdev_private *np = dev->priv;
+	struct netdev_private *np = netdev_priv(dev);
 
 	/*
 	 * Resetting the chip causes some registers to be lost.
@@ -1019,6 +1435,11 @@ static void natsemi_reset(struct net_device *dev)
 
 	/* restore CFG */
 	cfg |= readl(dev->base_addr + ChipConfig) & ~CFG_RESET_SAVE;
+	/* turn on external phy if it was selected */
+	if (dev->if_port == PORT_TP)
+		cfg &= ~(CfgExtPhy | CfgPhyDis);
+	else
+		cfg |= (CfgExtPhy | CfgPhyDis);
 	writel(cfg, dev->base_addr + ChipConfig);
 	/* restore WCSR */
 	wcsr |= readl(dev->base_addr + WOLCmd) & ~WCSR_RESET_SAVE;
@@ -1040,7 +1461,7 @@ static void natsemi_reset(struct net_device *dev)
 
 static void natsemi_reload_eeprom(struct net_device *dev)
 {
-	struct netdev_private *np = dev->priv;
+	struct netdev_private *np = netdev_priv(dev);
 	int i;
 
 	writel(EepromReload, dev->base_addr + PCIBusCfg);
@@ -1050,18 +1471,18 @@ static void natsemi_reload_eeprom(struct net_device *dev)
 			break;
 	}
 	if (i==NATSEMI_HW_TIMEOUT) {
-		printk(KERN_WARNING "%s: EEPROM did not reload in %d usec.\n",
-			dev->name, i*50);
+		printk(KERN_WARNING "natsemi %s: EEPROM did not reload in %d usec.\n",
+			pci_name(np->pci_dev), i*50);
 	} else if (netif_msg_hw(np)) {
-		printk(KERN_DEBUG "%s: EEPROM reloaded in %d usec.\n",
-			dev->name, i*50);
+		printk(KERN_DEBUG "natsemi %s: EEPROM reloaded in %d usec.\n",
+			pci_name(np->pci_dev), i*50);
 	}
 }
 
 static void natsemi_stop_rxtx(struct net_device *dev)
 {
 	long ioaddr = dev->base_addr;
-	struct netdev_private *np = dev->priv;
+	struct netdev_private *np = netdev_priv(dev);
 	int i;
 
 	writel(RxOff | TxOff, ioaddr + ChipCmd);
@@ -1081,7 +1502,7 @@ static void natsemi_stop_rxtx(struct net_device *dev)
 
 static int netdev_open(struct net_device *dev)
 {
-	struct netdev_private *np = dev->priv;
+	struct netdev_private *np = netdev_priv(dev);
 	long ioaddr = dev->base_addr;
 	int i;
 
@@ -1130,7 +1551,10 @@ static int netdev_open(struct net_device *dev)
 
 static void do_cable_magic(struct net_device *dev)
 {
-	struct netdev_private *np = dev->priv;
+	struct netdev_private *np = netdev_priv(dev);
+
+	if (dev->if_port != PORT_TP)
+		return;
 
 	if (np->srr >= SRR_DP83816_A5)
 		return;
@@ -1155,7 +1579,7 @@ static void do_cable_magic(struct net_device *dev)
 		 * (these values all come from National)
 		 */
 		if (!(data & 0x80) || ((data >= 0xd8) && (data <= 0xff))) {
-			struct netdev_private *np = dev->priv;
+			struct netdev_private *np = netdev_priv(dev);
 
 			/* the bug has been triggered - fix the coefficient */
 			writew(TSTDAT_FIXED, dev->base_addr + TSTDAT);
@@ -1171,7 +1595,10 @@ static void do_cable_magic(struct net_device *dev)
 static void undo_cable_magic(struct net_device *dev)
 {
 	u16 data;
-	struct netdev_private *np = dev->priv;
+	struct netdev_private *np = netdev_priv(dev);
+
+	if (dev->if_port != PORT_TP)
+		return;
 
 	if (np->srr >= SRR_DP83816_A5)
 		return;
@@ -1186,12 +1613,19 @@ static void undo_cable_magic(struct net_device *dev)
 
 static void check_link(struct net_device *dev)
 {
-	struct netdev_private *np = dev->priv;
+	struct netdev_private *np = netdev_priv(dev);
 	long ioaddr = dev->base_addr;
 	int duplex;
-	int chipcfg = readl(ioaddr + ChipConfig);
+	u16 bmsr;
+       
+	/* The link status field is latched: it remains low after a temporary
+	 * link failure until it's read. We need the current link status,
+	 * thus read twice.
+	 */
+	mdio_read(dev, MII_BMSR);
+	bmsr = mdio_read(dev, MII_BMSR);
 
-	if (!(chipcfg & CfgLink)) {
+	if (!(bmsr & BMSR_LSTATUS)) {
 		if (netif_carrier_ok(dev)) {
 			if (netif_msg_link(np))
 				printk(KERN_NOTICE "%s: link down.\n",
@@ -1208,7 +1642,16 @@ static void check_link(struct net_device *dev)
 		do_cable_magic(dev);
 	}
 
-	duplex = np->full_duplex || (chipcfg & CfgFullDuplex ? 1 : 0);
+	duplex = np->full_duplex;
+	if (!duplex) {
+		if (bmsr & BMSR_ANEGCOMPLETE) {
+			int tmp = mii_nway_result(
+				np->advertising & mdio_read(dev, MII_LPA));
+			if (tmp == LPA_100FULL || tmp == LPA_10FULL)
+				duplex = 1;
+		} else if (mdio_read(dev, MII_BMCR) & BMCR_FULLDPLX)
+			duplex = 1;
+	}
 
 	/* if duplex is set then bit 28 must be set, too */
 	if (duplex ^ !!(np->rx_config & RxAcceptTx)) {
@@ -1231,42 +1674,10 @@ static void check_link(struct net_device *dev)
 
 static void init_registers(struct net_device *dev)
 {
-	struct netdev_private *np = dev->priv;
+	struct netdev_private *np = netdev_priv(dev);
 	long ioaddr = dev->base_addr;
-	int i;
-
-	for (i=0;i<NATSEMI_HW_TIMEOUT;i++) {
-		if (readl(dev->base_addr + ChipConfig) & CfgAnegDone)
-			break;
-		udelay(10);
-	}
-	if (i==NATSEMI_HW_TIMEOUT && netif_msg_link(np)) {
-		printk(KERN_INFO
-			"%s: autonegotiation did not complete in %d usec.\n",
-			dev->name, i*10);
-	}
 
-	/* On page 78 of the spec, they recommend some settings for "optimum
-	   performance" to be done in sequence.  These settings optimize some
-	   of the 100Mbit autodetection circuitry.  They say we only want to
-	   do this for rev C of the chip, but engineers at NSC (Bradley
-	   Kennedy) recommends always setting them.  If you don't, you get
-	   errors on some autonegotiations that make the device unusable.
-	*/
-	writew(1, ioaddr + PGSEL);
-	writew(PMDCSR_VAL, ioaddr + PMDCSR);
-	writew(TSTDAT_VAL, ioaddr + TSTDAT);
-	writew(DSPCFG_VAL, ioaddr + DSPCFG);
-	writew(SDCFG_VAL, ioaddr + SDCFG);
-	writew(0, ioaddr + PGSEL);
-	np->dspcfg = DSPCFG_VAL;
-
-	/* Enable PHY Specific event based interrupts.  Link state change
-	   and Auto-Negotiation Completion are among the affected.
-	   Read the intr status to clear it (needed for wake events).
-	*/
-	readw(ioaddr + MIntrStatus);
-	writew(MICRIntEn, ioaddr + MIntrCtrl);
+	init_phy_fixup(dev);
 
 	/* clear any interrupts that are pending, such as wake events */
 	readl(ioaddr + IntrStatus);
@@ -1289,13 +1700,18 @@ static void init_registers(struct net_device *dev)
 	 * ECRETRY=1
 	 * ATP=1
 	 */
-	np->tx_config = TxAutoPad | TxCollRetry | TxMxdma_256 | (0x1002);
+	np->tx_config = TxAutoPad | TxCollRetry | TxMxdma_256 |
+				TX_FLTH_VAL | TX_DRTH_VAL_START;
 	writel(np->tx_config, ioaddr + TxConfig);
 
 	/* DRTH 0x10: start copying to memory if 128 bytes are in the fifo
 	 * MXDMA 0: up to 256 byte bursts
 	 */
-	np->rx_config = RxMxdma_256 | 0x20;
+	np->rx_config = RxMxdma_256 | RX_DRTH_VAL;
+	/* if receive ring now has bigger buffers than normal, enable jumbo */
+	if (np->rx_buf_sz > NATSEMI_LONGPKT)
+		np->rx_config |= RxAcceptLong;
+
 	writel(np->rx_config, ioaddr + RxConfig);
 
 	/* Disable PME:
@@ -1337,10 +1753,8 @@ static void init_registers(struct net_device *dev)
 static void netdev_timer(unsigned long data)
 {
 	struct net_device *dev = (struct net_device *)data;
-	struct netdev_private *np = dev->priv;
+	struct netdev_private *np = netdev_priv(dev);
 	int next_tick = 5*HZ;
-	long ioaddr = dev->base_addr;
-	u16 dspcfg;
 
 	if (netif_msg_timer(np)) {
 		/* DO NOT read the IntrStatus register,
@@ -1350,33 +1764,41 @@ static void netdev_timer(unsigned long data)
 			dev->name);
 	}
 
-	spin_lock_irq(&np->lock);
+	if (dev->if_port == PORT_TP) {
+		long ioaddr = dev->base_addr;
+		u16 dspcfg;
 
-	/* check for a nasty random phy-reset - use dspcfg as a flag */
-	writew(1, ioaddr+PGSEL);
-	dspcfg = readw(ioaddr+DSPCFG);
-	writew(0, ioaddr+PGSEL);
-	if (dspcfg != np->dspcfg) {
-		if (!netif_queue_stopped(dev)) {
-			spin_unlock_irq(&np->lock);
-			if (netif_msg_hw(np))
-				printk(KERN_NOTICE "%s: possible phy reset: "
-					"re-initializing\n", dev->name);
-			disable_irq(dev->irq);
-			spin_lock_irq(&np->lock);
-			natsemi_stop_rxtx(dev);
-			dump_ring(dev);
-			reinit_ring(dev);
-			init_registers(dev);
-			spin_unlock_irq(&np->lock);
-			enable_irq(dev->irq);
+		spin_lock_irq(&np->lock);
+		/* check for a nasty random phy-reset - use dspcfg as a flag */
+		writew(1, ioaddr+PGSEL);
+		dspcfg = readw(ioaddr+DSPCFG);
+		writew(0, ioaddr+PGSEL);
+		if (dspcfg != np->dspcfg) {
+			if (!netif_queue_stopped(dev)) {
+				spin_unlock_irq(&np->lock);
+				if (netif_msg_hw(np))
+					printk(KERN_NOTICE "%s: possible phy reset: "
+						"re-initializing\n", dev->name);
+				disable_irq(dev->irq);
+				spin_lock_irq(&np->lock);
+				natsemi_stop_rxtx(dev);
+				dump_ring(dev);
+				reinit_ring(dev);
+				init_registers(dev);
+				spin_unlock_irq(&np->lock);
+				enable_irq(dev->irq);
+			} else {
+				/* hurry back */
+				next_tick = HZ;
+				spin_unlock_irq(&np->lock);
+			}
 		} else {
-			/* hurry back */
-			next_tick = HZ;
+			/* init_registers() calls check_link() for the above case */
+			check_link(dev);
 			spin_unlock_irq(&np->lock);
 		}
 	} else {
-		/* init_registers() calls check_link() for the above case */
+		spin_lock_irq(&np->lock);
 		check_link(dev);
 		spin_unlock_irq(&np->lock);
 	}
@@ -1396,7 +1818,7 @@ static void netdev_timer(unsigned long data)
 
 static void dump_ring(struct net_device *dev)
 {
-	struct netdev_private *np = dev->priv;
+	struct netdev_private *np = netdev_priv(dev);
 
 	if (netif_msg_pktdata(np)) {
 		int i;
@@ -1419,7 +1841,7 @@ static void dump_ring(struct net_device *dev)
 
 static void tx_timeout(struct net_device *dev)
 {
-	struct netdev_private *np = dev->priv;
+	struct netdev_private *np = netdev_priv(dev);
 	long ioaddr = dev->base_addr;
 
 	disable_irq(dev->irq);
@@ -1450,7 +1872,7 @@ static void tx_timeout(struct net_device *dev)
 
 static int alloc_ring(struct net_device *dev)
 {
-	struct netdev_private *np = dev->priv;
+	struct netdev_private *np = netdev_priv(dev);
 	np->rx_ring = pci_alloc_consistent(np->pci_dev,
 		sizeof(struct netdev_desc) * (RX_RING_SIZE+TX_RING_SIZE),
 		&np->ring_dma);
@@ -1462,14 +1884,14 @@ static int alloc_ring(struct net_device *dev)
 
 static void refill_rx(struct net_device *dev)
 {
-	struct netdev_private *np = dev->priv;
+	struct netdev_private *np = netdev_priv(dev);
 
 	/* Refill the Rx ring buffers. */
 	for (; np->cur_rx - np->dirty_rx > 0; np->dirty_rx++) {
 		struct sk_buff *skb;
 		int entry = np->dirty_rx % RX_RING_SIZE;
 		if (np->rx_skbuff[entry] == NULL) {
-			unsigned int buflen = np->rx_buf_sz + RX_OFFSET;
+			unsigned int buflen = np->rx_buf_sz+NATSEMI_PADDING;
 			skb = dev_alloc_skb(buflen);
 			np->rx_skbuff[entry] = skb;
 			if (skb == NULL)
@@ -1488,10 +1910,19 @@ static void refill_rx(struct net_device *dev)
 	}
 }
 
+static void set_bufsize(struct net_device *dev)
+{
+	struct netdev_private *np = netdev_priv(dev);
+	if (dev->mtu <= ETH_DATA_LEN)
+		np->rx_buf_sz = ETH_DATA_LEN + NATSEMI_HEADERS;
+	else
+		np->rx_buf_sz = dev->mtu + NATSEMI_HEADERS;
+}
+
 /* Initialize the Rx and Tx rings, along with various 'dev' bits. */
 static void init_ring(struct net_device *dev)
 {
-	struct netdev_private *np = dev->priv;
+	struct netdev_private *np = netdev_priv(dev);
 	int i;
 
 	/* 1) TX ring */
@@ -1507,8 +1938,9 @@ static void init_ring(struct net_device *dev)
 	/* 2) RX ring */
 	np->dirty_rx = 0;
 	np->cur_rx = RX_RING_SIZE;
-	np->rx_buf_sz = (dev->mtu <= 1500 ? PKT_BUF_SZ : dev->mtu + 32);
 	np->oom = 0;
+	set_bufsize(dev);
+
 	np->rx_head_desc = &np->rx_ring[0];
 
 	/* Please be carefull before changing this loop - at least gcc-2.95.1
@@ -1528,7 +1960,7 @@ static void init_ring(struct net_device *dev)
 
 static void drain_tx(struct net_device *dev)
 {
-	struct netdev_private *np = dev->priv;
+	struct netdev_private *np = netdev_priv(dev);
 	int i;
 
 	for (i = 0; i < TX_RING_SIZE; i++) {
@@ -1543,10 +1975,10 @@ static void drain_tx(struct net_device *dev)
 	}
 }
 
-static void drain_ring(struct net_device *dev)
+static void drain_rx(struct net_device *dev)
 {
-	struct netdev_private *np = dev->priv;
-	unsigned int buflen = np->rx_buf_sz + RX_OFFSET;
+	struct netdev_private *np = netdev_priv(dev);
+	unsigned int buflen = np->rx_buf_sz;
 	int i;
 
 	/* Free all the skbuffs in the Rx queue. */
@@ -1561,28 +1993,27 @@ static void drain_ring(struct net_device *dev)
 		}
 		np->rx_skbuff[i] = NULL;
 	}
+}
+
+static void drain_ring(struct net_device *dev)
+{
+	drain_rx(dev);
 	drain_tx(dev);
 }
 
 static void free_ring(struct net_device *dev)
 {
-	struct netdev_private *np = dev->priv;
+	struct netdev_private *np = netdev_priv(dev);
 	pci_free_consistent(np->pci_dev,
 		sizeof(struct netdev_desc) * (RX_RING_SIZE+TX_RING_SIZE),
 		np->rx_ring, np->ring_dma);
 }
 
-static void reinit_ring(struct net_device *dev)
+static void reinit_rx(struct net_device *dev)
 {
-	struct netdev_private *np = dev->priv;
+	struct netdev_private *np = netdev_priv(dev);
 	int i;
 
-	/* drain TX ring */
-	drain_tx(dev);
-	np->dirty_tx = np->cur_tx = 0;
-	for (i=0;i<TX_RING_SIZE;i++)
-		np->tx_ring[i].cmd_status = 0;
-
 	/* RX Ring */
 	np->dirty_rx = 0;
 	np->cur_rx = RX_RING_SIZE;
@@ -1594,9 +2025,23 @@ static void reinit_ring(struct net_device *dev)
 	refill_rx(dev);
 }
 
+static void reinit_ring(struct net_device *dev)
+{
+	struct netdev_private *np = netdev_priv(dev);
+	int i;
+
+	/* drain TX ring */
+	drain_tx(dev);
+	np->dirty_tx = np->cur_tx = 0;
+	for (i=0;i<TX_RING_SIZE;i++)
+		np->tx_ring[i].cmd_status = 0;
+
+	reinit_rx(dev);
+}
+
 static int start_tx(struct sk_buff *skb, struct net_device *dev)
 {
-	struct netdev_private *np = dev->priv;
+	struct netdev_private *np = netdev_priv(dev);
 	unsigned entry;
 
 	/* Note: Ordering is important here, set the field with the
@@ -1643,7 +2088,7 @@ static int start_tx(struct sk_buff *skb, struct net_device *dev)
 
 static void netdev_tx_done(struct net_device *dev)
 {
-	struct netdev_private *np = dev->priv;
+	struct netdev_private *np = netdev_priv(dev);
 
 	for (; np->cur_tx - np->dirty_tx > 0; np->dirty_tx++) {
 		int entry = np->dirty_tx % TX_RING_SIZE;
@@ -1689,7 +2134,7 @@ static void netdev_tx_done(struct net_device *dev)
 static irqreturn_t intr_handler(int irq, void *dev_instance, struct pt_regs *rgs)
 {
 	struct net_device *dev = dev_instance;
-	struct netdev_private *np = dev->priv;
+	struct netdev_private *np = netdev_priv(dev);
 	long ioaddr = dev->base_addr;
 	int boguscnt = max_interrupt_work;
 	unsigned int handled = 0;
@@ -1747,20 +2192,22 @@ static irqreturn_t intr_handler(int irq, void *dev_instance, struct pt_regs *rgs
    for clarity and better register allocation. */
 static void netdev_rx(struct net_device *dev)
 {
-	struct netdev_private *np = dev->priv;
+	struct netdev_private *np = netdev_priv(dev);
 	int entry = np->cur_rx % RX_RING_SIZE;
 	int boguscnt = np->dirty_rx + RX_RING_SIZE - np->cur_rx;
 	s32 desc_status = le32_to_cpu(np->rx_head_desc->cmd_status);
-	unsigned int buflen = np->rx_buf_sz + RX_OFFSET;
+	unsigned int buflen = np->rx_buf_sz;
 
 	/* If the driver owns the next entry it's a new packet. Send it up. */
 	while (desc_status < 0) { /* e.g. & DescOwn */
+		int pkt_len;
 		if (netif_msg_rx_status(np))
 			printk(KERN_DEBUG
 				"  netdev_rx() entry %d status was %#08x.\n",
 				entry, desc_status);
 		if (--boguscnt < 0)
 			break;
+		pkt_len = (desc_status & DescSizeMask) - 4;
 		if ((desc_status&(DescMore|DescPktOK|DescRxLong)) != DescPktOK){
 			if (desc_status & DescMore) {
 				if (netif_msg_rx_err(np))
@@ -1783,10 +2230,14 @@ static void netdev_rx(struct net_device *dev)
 				if (desc_status & DescRxCRC)
 					np->stats.rx_crc_errors++;
 			}
+		} else if (pkt_len > np->rx_buf_sz) {
+			/* if this is the tail of a double buffer
+			 * packet, we've already counted the error
+			 * on the first part.  Ignore the second half.
+			 */
 		} else {
 			struct sk_buff *skb;
 			/* Omit CRC size. */
-			int pkt_len = (desc_status & DescSizeMask) - 4;
 			/* Check if the packet is long enough to accept
 			 * without copying to a minimally-sized skbuff. */
 			if (pkt_len < rx_copybreak
@@ -1798,14 +2249,9 @@ static void netdev_rx(struct net_device *dev)
 					np->rx_dma[entry],
 					buflen,
 					PCI_DMA_FROMDEVICE);
-#if HAS_IP_COPYSUM
 				eth_copy_and_sum(skb,
 					np->rx_skbuff[entry]->tail, pkt_len, 0);
 				skb_put(skb, pkt_len);
-#else
-				memcpy(skb_put(skb, pkt_len),
-					np->rx_skbuff[entry]->tail, pkt_len);
-#endif
 				pci_dma_sync_single_for_device(np->pci_dev,
 					np->rx_dma[entry],
 					buflen,
@@ -1837,19 +2283,18 @@ static void netdev_rx(struct net_device *dev)
 
 static void netdev_error(struct net_device *dev, int intr_status)
 {
-	struct netdev_private *np = dev->priv;
+	struct netdev_private *np = netdev_priv(dev);
 	long ioaddr = dev->base_addr;
 
 	spin_lock(&np->lock);
 	if (intr_status & LinkChange) {
-		u16 adv = mdio_read(dev, 1, MII_ADVERTISE);
-		u16 lpa = mdio_read(dev, 1, MII_LPA);
-		if (mdio_read(dev, 1, MII_BMCR) & BMCR_ANENABLE
+		u16 lpa = mdio_read(dev, MII_LPA);
+		if (mdio_read(dev, MII_BMCR) & BMCR_ANENABLE
 		 && netif_msg_link(np)) {
 			printk(KERN_INFO
 				"%s: Autonegotiation advertising"
 				" %#04x  partner %#04x.\n", dev->name,
-				adv, lpa);
+				np->advertising, lpa);
 		}
 
 		/* read MII int status to clear the flag */
@@ -1860,12 +2305,18 @@ static void netdev_error(struct net_device *dev, int intr_status)
 		__get_stats(dev);
 	}
 	if (intr_status & IntrTxUnderrun) {
-		if ((np->tx_config & TxDrthMask) < 62)
-			np->tx_config += 2;
-		if (netif_msg_tx_err(np))
-			printk(KERN_NOTICE
-				"%s: increased Tx threshold, txcfg %#08x.\n",
-				dev->name, np->tx_config);
+		if ((np->tx_config & TxDrthMask) < TX_DRTH_VAL_LIMIT) {
+			np->tx_config += TX_DRTH_VAL_INC;
+			if (netif_msg_tx_err(np))
+				printk(KERN_NOTICE
+					"%s: increased tx threshold, txcfg %#08x.\n",
+					dev->name, np->tx_config);
+		} else {
+			if (netif_msg_tx_err(np))
+				printk(KERN_NOTICE
+					"%s: tx underrun with maximum tx threshold, txcfg %#08x.\n",
+					dev->name, np->tx_config);
+		}
 		writel(np->tx_config, ioaddr + TxConfig);
 	}
 	if (intr_status & WOLPkt && netif_msg_wol(np)) {
@@ -1893,7 +2344,7 @@ static void netdev_error(struct net_device *dev, int intr_status)
 static void __get_stats(struct net_device *dev)
 {
 	long ioaddr = dev->base_addr;
-	struct netdev_private *np = dev->priv;
+	struct netdev_private *np = netdev_priv(dev);
 
 	/* The chip only need report frame silently dropped. */
 	np->stats.rx_crc_errors	+= readl(ioaddr + RxCRCErrs);
@@ -1902,7 +2353,7 @@ static void __get_stats(struct net_device *dev)
 
 static struct net_device_stats *get_stats(struct net_device *dev)
 {
-	struct netdev_private *np = dev->priv;
+	struct netdev_private *np = netdev_priv(dev);
 
 	/* The chip only need report frame silently dropped. */
 	spin_lock_irq(&np->lock);
@@ -1917,7 +2368,7 @@ static struct net_device_stats *get_stats(struct net_device *dev)
 static void __set_rx_mode(struct net_device *dev)
 {
 	long ioaddr = dev->base_addr;
-	struct netdev_private *np = dev->priv;
+	struct netdev_private *np = netdev_priv(dev);
 	u8 mc_filter[64]; /* Multicast hash filter */
 	u32 rx_mode;
 
@@ -1952,9 +2403,39 @@ static void __set_rx_mode(struct net_device *dev)
 	np->cur_rx_mode = rx_mode;
 }
 
+static int natsemi_change_mtu(struct net_device *dev, int new_mtu)
+{
+	if (new_mtu < 64 || new_mtu > NATSEMI_RX_LIMIT-NATSEMI_HEADERS)
+		return -EINVAL;
+
+	dev->mtu = new_mtu;
+
+	/* synchronized against open : rtnl_lock() held by caller */
+	if (netif_running(dev)) {
+		struct netdev_private *np = netdev_priv(dev);
+		long ioaddr = dev->base_addr;
+
+		disable_irq(dev->irq);
+		spin_lock(&np->lock);
+		/* stop engines */
+		natsemi_stop_rxtx(dev);
+		/* drain rx queue */
+		drain_rx(dev);
+		/* change buffers */
+		set_bufsize(dev);
+		reinit_rx(dev);
+		writel(np->ring_dma, ioaddr + RxRingPtr);
+		/* restart engines */
+		writel(RxOn | TxOn, ioaddr + ChipCmd);
+		spin_unlock(&np->lock);
+		enable_irq(dev->irq);
+	}
+	return 0;
+}
+
 static void set_rx_mode(struct net_device *dev)
 {
-	struct netdev_private *np = dev->priv;
+	struct netdev_private *np = netdev_priv(dev);
 	spin_lock_irq(&np->lock);
 	if (!np->hands_off)
 		__set_rx_mode(dev);
@@ -1963,7 +2444,7 @@ static void set_rx_mode(struct net_device *dev)
 
 static int netdev_ethtool_ioctl(struct net_device *dev, void __user *useraddr)
 {
-	struct netdev_private *np = dev->priv;
+	struct netdev_private *np = netdev_priv(dev);
 	u32 cmd;
 
 	if (get_user(cmd, (u32 __user *)useraddr))
@@ -2077,10 +2558,10 @@ static int netdev_ethtool_ioctl(struct net_device *dev, void __user *useraddr)
 		int tmp;
 		int r = -EINVAL;
 		/* if autoneg is off, it's an error */
-		tmp = mdio_read(dev, 1, MII_BMCR);
+		tmp = mdio_read(dev, MII_BMCR);
 		if (tmp & BMCR_ANENABLE) {
 			tmp |= (BMCR_ANRESTART);
-			mdio_write(dev, 1, MII_BMCR, tmp);
+			mdio_write(dev, MII_BMCR, tmp);
 			r = 0;
 		}
 		return r;
@@ -2089,8 +2570,8 @@ static int netdev_ethtool_ioctl(struct net_device *dev, void __user *useraddr)
 	case ETHTOOL_GLINK: {
 		struct ethtool_value edata = {ETHTOOL_GLINK};
 		/* LSTATUS is latched low until a read - so read twice */
-		mdio_read(dev, 1, MII_BMSR);
-		edata.data = (mdio_read(dev, 1, MII_BMSR)&BMSR_LSTATUS) ? 1:0;
+		mdio_read(dev, MII_BMSR);
+		edata.data = (mdio_read(dev, MII_BMSR)&BMSR_LSTATUS) ? 1:0;
 		if (copy_to_user(useraddr, &edata, sizeof(edata)))
 			return -EFAULT;
 		return 0;
@@ -2134,7 +2615,7 @@ static int netdev_ethtool_ioctl(struct net_device *dev, void __user *useraddr)
 
 static int netdev_set_wol(struct net_device *dev, u32 newval)
 {
-	struct netdev_private *np = dev->priv;
+	struct netdev_private *np = netdev_priv(dev);
 	u32 data = readl(dev->base_addr + WOLCmd) & ~WakeOptsSummary;
 
 	/* translate to bitmasks this chip understands */
@@ -2163,7 +2644,7 @@ static int netdev_set_wol(struct net_device *dev, u32 newval)
 
 static int netdev_get_wol(struct net_device *dev, u32 *supported, u32 *cur)
 {
-	struct netdev_private *np = dev->priv;
+	struct netdev_private *np = netdev_priv(dev);
 	u32 regval = readl(dev->base_addr + WOLCmd);
 
 	*supported = (WAKE_PHY | WAKE_UCAST | WAKE_MCAST | WAKE_BCAST
@@ -2198,7 +2679,7 @@ static int netdev_get_wol(struct net_device *dev, u32 *supported, u32 *cur)
 
 static int netdev_set_sopass(struct net_device *dev, u8 *newval)
 {
-	struct netdev_private *np = dev->priv;
+	struct netdev_private *np = netdev_priv(dev);
 	u16 *sval = (u16 *)newval;
 	u32 addr;
 
@@ -2229,7 +2710,7 @@ static int netdev_set_sopass(struct net_device *dev, u8 *newval)
 
 static int netdev_get_sopass(struct net_device *dev, u8 *data)
 {
-	struct netdev_private *np = dev->priv;
+	struct netdev_private *np = netdev_priv(dev);
 	u16 *sval = (u16 *)data;
 	u32 addr;
 
@@ -2257,56 +2738,75 @@ static int netdev_get_sopass(struct net_device *dev, u8 *data)
 
 static int netdev_get_ecmd(struct net_device *dev, struct ethtool_cmd *ecmd)
 {
+	struct netdev_private *np = netdev_priv(dev);
 	u32 tmp;
 
-	ecmd->supported =
-		(SUPPORTED_10baseT_Half | SUPPORTED_10baseT_Full |
-		SUPPORTED_100baseT_Half | SUPPORTED_100baseT_Full |
-		SUPPORTED_Autoneg | SUPPORTED_TP | SUPPORTED_MII);
-
-	/* only supports twisted-pair or MII */
-	tmp = readl(dev->base_addr + ChipConfig);
-	if (tmp & CfgExtPhy)
-		ecmd->port = PORT_MII;
-	else
-		ecmd->port = PORT_TP;
-
-	/* only supports internal transceiver */
-	ecmd->transceiver = XCVR_INTERNAL;
-
-	/* not sure what this is for */
-	ecmd->phy_address = readw(dev->base_addr + PhyCtrl) & PhyAddrMask;
-
-	ecmd->advertising = ADVERTISED_TP | ADVERTISED_MII;
-	tmp = mdio_read(dev, 1, MII_ADVERTISE);
-	if (tmp & ADVERTISE_10HALF)
+	ecmd->port        = dev->if_port;
+	ecmd->speed       = np->speed;
+	ecmd->duplex      = np->duplex;
+	ecmd->autoneg     = np->autoneg;
+	ecmd->advertising = 0;
+	if (np->advertising & ADVERTISE_10HALF)
 		ecmd->advertising |= ADVERTISED_10baseT_Half;
-	if (tmp & ADVERTISE_10FULL)
+	if (np->advertising & ADVERTISE_10FULL)
 		ecmd->advertising |= ADVERTISED_10baseT_Full;
-	if (tmp & ADVERTISE_100HALF)
+	if (np->advertising & ADVERTISE_100HALF)
 		ecmd->advertising |= ADVERTISED_100baseT_Half;
-	if (tmp & ADVERTISE_100FULL)
+	if (np->advertising & ADVERTISE_100FULL)
 		ecmd->advertising |= ADVERTISED_100baseT_Full;
+	ecmd->supported   = (SUPPORTED_Autoneg |
+		SUPPORTED_10baseT_Half  | SUPPORTED_10baseT_Full  |
+		SUPPORTED_100baseT_Half | SUPPORTED_100baseT_Full |
+		SUPPORTED_TP | SUPPORTED_MII | SUPPORTED_FIBRE);
+	ecmd->phy_address = np->phy_addr_external;
+	/*
+	 * We intentionally report the phy address of the external
+	 * phy, even if the internal phy is used. This is necessary
+	 * to work around a deficiency of the ethtool interface:
+	 * It's only possible to query the settings of the active
+	 * port. Therefore 
+	 * # ethtool -s ethX port mii
+	 * actually sends an ioctl to switch to port mii with the
+	 * settings that are used for the current active port.
+	 * If we would report a different phy address in this
+	 * command, then
+	 * # ethtool -s ethX port tp;ethtool -s ethX port mii
+	 * would unintentionally change the phy address.
+	 *
+	 * Fortunately the phy address doesn't matter with the
+	 * internal phy...
+	 */
 
-	tmp = mdio_read(dev, 1, MII_BMCR);
-	if (tmp & BMCR_ANENABLE) {
+	/* set information based on active port type */
+	switch (ecmd->port) {
+	default:
+	case PORT_TP:
+		ecmd->advertising |= ADVERTISED_TP;
+		ecmd->transceiver = XCVR_INTERNAL;
+		break;
+	case PORT_MII:
+		ecmd->advertising |= ADVERTISED_MII;
+		ecmd->transceiver = XCVR_EXTERNAL;
+		break;
+	case PORT_FIBRE:
+		ecmd->advertising |= ADVERTISED_FIBRE;
+		ecmd->transceiver = XCVR_EXTERNAL;
+		break;
+	}
+
+	/* if autonegotiation is on, try to return the active speed/duplex */
+	if (ecmd->autoneg == AUTONEG_ENABLE) {
 		ecmd->advertising |= ADVERTISED_Autoneg;
-		ecmd->autoneg = AUTONEG_ENABLE;
-	} else {
-		ecmd->autoneg = AUTONEG_DISABLE;
-	}
-
-	tmp = readl(dev->base_addr + ChipConfig);
-	if (tmp & CfgSpeed100) {
-		ecmd->speed = SPEED_100;
-	} else {
-		ecmd->speed = SPEED_10;
-	}
-
-	if (tmp & CfgFullDuplex) {
-		ecmd->duplex = DUPLEX_FULL;
-	} else {
-		ecmd->duplex = DUPLEX_HALF;
+		tmp = mii_nway_result(
+			np->advertising & mdio_read(dev, MII_LPA));
+		if (tmp == LPA_100FULL || tmp == LPA_100HALF)
+			ecmd->speed  = SPEED_100;
+		else
+			ecmd->speed  = SPEED_10;
+		if (tmp == LPA_100FULL || tmp == LPA_10FULL)
+			ecmd->duplex = DUPLEX_FULL;
+		else
+			ecmd->duplex = DUPLEX_HALF;
 	}
 
 	/* ignore maxtxpkt, maxrxpkt for now */
@@ -2316,39 +2816,75 @@ static int netdev_get_ecmd(struct net_device *dev, struct ethtool_cmd *ecmd)
 
 static int netdev_set_ecmd(struct net_device *dev, struct ethtool_cmd *ecmd)
 {
-	struct netdev_private *np = dev->priv;
-	u32 tmp;
+	struct netdev_private *np = netdev_priv(dev);
 
-	if (ecmd->speed != SPEED_10 && ecmd->speed != SPEED_100)
-		return -EINVAL;
-	if (ecmd->duplex != DUPLEX_HALF && ecmd->duplex != DUPLEX_FULL)
+	if (ecmd->port != PORT_TP && ecmd->port != PORT_MII && ecmd->port != PORT_FIBRE)
 		return -EINVAL;
-	if (ecmd->port != PORT_TP && ecmd->port != PORT_MII)
+	if (ecmd->transceiver != XCVR_INTERNAL && ecmd->transceiver != XCVR_EXTERNAL)
 		return -EINVAL;
-	if (ecmd->transceiver != XCVR_INTERNAL)
-		return -EINVAL;
-	if (ecmd->autoneg != AUTONEG_DISABLE && ecmd->autoneg != AUTONEG_ENABLE)
+	if (ecmd->autoneg == AUTONEG_ENABLE) {
+		if ((ecmd->advertising & (ADVERTISED_10baseT_Half |
+					  ADVERTISED_10baseT_Full |
+					  ADVERTISED_100baseT_Half |
+					  ADVERTISED_100baseT_Full)) == 0) {
+			return -EINVAL;
+		}
+	} else if (ecmd->autoneg == AUTONEG_DISABLE) {
+		if (ecmd->speed != SPEED_10 && ecmd->speed != SPEED_100)
+			return -EINVAL;
+		if (ecmd->duplex != DUPLEX_HALF && ecmd->duplex != DUPLEX_FULL)
+			return -EINVAL;
+	} else {
 		return -EINVAL;
-	/* ignore phy_address, maxtxpkt, maxrxpkt for now */
+	}
+
+	/*
+	 * maxtxpkt, maxrxpkt: ignored for now.
+	 *
+	 * transceiver:
+	 * PORT_TP is always XCVR_INTERNAL, PORT_MII and PORT_FIBRE are always
+	 * XCVR_EXTERNAL. The implementation thus ignores ecmd->transceiver and
+	 * selects based on ecmd->port.
+	 *
+	 * Actually PORT_FIBRE is nearly identical to PORT_MII: it's for fibre
+	 * phys that are connected to the mii bus. It's used to apply fibre
+	 * specific updates.
+	 */
 
 	/* WHEW! now lets bang some bits */
 
-	tmp = mdio_read(dev, 1, MII_BMCR);
-	if (ecmd->autoneg == AUTONEG_ENABLE) {
-		/* turn on autonegotiation */
-		tmp |= BMCR_ANENABLE;
-		np->advertising = mdio_read(dev, 1, MII_ADVERTISE);
+	/* save the parms */
+	dev->if_port          = ecmd->port;
+	np->autoneg           = ecmd->autoneg;
+	np->phy_addr_external = ecmd->phy_address & PhyAddrMask;
+	if (np->autoneg == AUTONEG_ENABLE) {
+		/* advertise only what has been requested */
+		np->advertising &= ~(ADVERTISE_ALL | ADVERTISE_100BASE4);
+		if (ecmd->advertising & ADVERTISED_10baseT_Half)
+			np->advertising |= ADVERTISE_10HALF;
+		if (ecmd->advertising & ADVERTISED_10baseT_Full)
+			np->advertising |= ADVERTISE_10FULL;
+		if (ecmd->advertising & ADVERTISED_100baseT_Half)
+			np->advertising |= ADVERTISE_100HALF;
+		if (ecmd->advertising & ADVERTISED_100baseT_Full)
+			np->advertising |= ADVERTISE_100FULL;
 	} else {
-		/* turn off auto negotiation, set speed and duplexity */
-		tmp &= ~(BMCR_ANENABLE | BMCR_SPEED100 | BMCR_FULLDPLX);
-		if (ecmd->speed == SPEED_100)
-			tmp |= BMCR_SPEED100;
-		if (ecmd->duplex == DUPLEX_FULL)
-			tmp |= BMCR_FULLDPLX;
-		else
+		np->speed  = ecmd->speed;
+		np->duplex = ecmd->duplex;
+		/* user overriding the initial full duplex parm? */
+		if (np->duplex == DUPLEX_HALF)
 			np->full_duplex = 0;
 	}
-	mdio_write(dev, 1, MII_BMCR, tmp);
+
+	/* get the right phy enabled */
+	if (ecmd->port == PORT_TP)
+		switch_port_internal(dev);
+	else
+		switch_port_external(dev);
+
+	/* set parms and see how this affected our link status */
+	init_phy_fixup(dev);
+	check_link(dev);
 	return 0;
 }
 
@@ -2359,11 +2895,15 @@ static int netdev_get_regs(struct net_device *dev, u8 *buf)
 	u32 rfcr;
 	u32 *rbuf = (u32 *)buf;
 
-	/* read all of page 0 of registers */
-	for (i = 0; i < NATSEMI_PG0_NREGS; i++) {
+	/* read non-mii page 0 of registers */
+	for (i = 0; i < NATSEMI_PG0_NREGS/2; i++) {
 		rbuf[i] = readl(dev->base_addr + i*4);
 	}
 
+	/* read current mii registers */
+	for (i = NATSEMI_PG0_NREGS/2; i < NATSEMI_PG0_NREGS; i++)
+		rbuf[i] = mdio_read(dev, i & 0x1f);
+
 	/* read only the 'magic' registers from page 1 */
 	writew(1, dev->base_addr + PGSEL);
 	rbuf[i++] = readw(dev->base_addr + PMDCSR);
@@ -2418,27 +2958,56 @@ static int netdev_get_eeprom(struct net_device *dev, u8 *buf)
 static int netdev_ioctl(struct net_device *dev, struct ifreq *rq, int cmd)
 {
 	struct mii_ioctl_data *data = if_mii(rq);
+	struct netdev_private *np = netdev_priv(dev);
 
 	switch(cmd) {
 	case SIOCETHTOOL:
 		return netdev_ethtool_ioctl(dev, rq->ifr_data);
 	case SIOCGMIIPHY:		/* Get address of MII PHY in use. */
 	case SIOCDEVPRIVATE:		/* for binary compat, remove in 2.5 */
-		data->phy_id = 1;
+		data->phy_id = np->phy_addr_external;
 		/* Fall Through */
 
 	case SIOCGMIIREG:		/* Read MII PHY register. */
 	case SIOCDEVPRIVATE+1:		/* for binary compat, remove in 2.5 */
-		data->val_out = mdio_read(dev, data->phy_id & 0x1f,
-			data->reg_num & 0x1f);
+		/* The phy_id is not enough to uniquely identify
+		 * the intended target. Therefore the command is sent to
+		 * the given mii on the current port.
+		 */
+		if (dev->if_port == PORT_TP) {
+			if ((data->phy_id & 0x1f) == np->phy_addr_external)
+				data->val_out = mdio_read(dev,
+							data->reg_num & 0x1f);
+			else
+				data->val_out = 0;
+		} else {
+			move_int_phy(dev, data->phy_id & 0x1f);
+			data->val_out = miiport_read(dev, data->phy_id & 0x1f,
+							data->reg_num & 0x1f);
+		}
 		return 0;
 
 	case SIOCSMIIREG:		/* Write MII PHY register. */
 	case SIOCDEVPRIVATE+2:		/* for binary compat, remove in 2.5 */
 		if (!capable(CAP_NET_ADMIN))
 			return -EPERM;
-		mdio_write(dev, data->phy_id & 0x1f, data->reg_num & 0x1f,
-			data->val_in);
+		if (dev->if_port == PORT_TP) {
+			if ((data->phy_id & 0x1f) == np->phy_addr_external) {
+ 				if ((data->reg_num & 0x1f) == MII_ADVERTISE)
+					np->advertising = data->val_in;
+				mdio_write(dev, data->reg_num & 0x1f,
+							data->val_in);
+			}
+		} else {
+			if ((data->phy_id & 0x1f) == np->phy_addr_external) {
+ 				if ((data->reg_num & 0x1f) == MII_ADVERTISE)
+					np->advertising = data->val_in;
+			}
+			move_int_phy(dev, data->phy_id & 0x1f);
+			miiport_write(dev, data->phy_id & 0x1f,
+						data->reg_num & 0x1f,
+						data->val_in);
+		}
 		return 0;
 	default:
 		return -EOPNOTSUPP;
@@ -2448,7 +3017,7 @@ static int netdev_ioctl(struct net_device *dev, struct ifreq *rq, int cmd)
 static void enable_wol_mode(struct net_device *dev, int enable_intr)
 {
 	long ioaddr = dev->base_addr;
-	struct netdev_private *np = dev->priv;
+	struct netdev_private *np = netdev_priv(dev);
 
 	if (netif_msg_wol(np))
 		printk(KERN_INFO "%s: remaining active for wake-on-lan\n",
@@ -2481,7 +3050,7 @@ static void enable_wol_mode(struct net_device *dev, int enable_intr)
 static int netdev_close(struct net_device *dev)
 {
 	long ioaddr = dev->base_addr;
-	struct netdev_private *np = dev->priv;
+	struct netdev_private *np = netdev_priv(dev);
 
 	if (netif_msg_ifdown(np))
 		printk(KERN_DEBUG
@@ -2593,7 +3162,7 @@ static void __devexit natsemi_remove1 (struct pci_dev *pdev)
 static int natsemi_suspend (struct pci_dev *pdev, u32 state)
 {
 	struct net_device *dev = pci_get_drvdata (pdev);
-	struct netdev_private *np = dev->priv;
+	struct netdev_private *np = netdev_priv(dev);
 	long ioaddr = dev->base_addr;
 
 	rtnl_lock();
@@ -2640,7 +3209,7 @@ static int natsemi_suspend (struct pci_dev *pdev, u32 state)
 static int natsemi_resume (struct pci_dev *pdev)
 {
 	struct net_device *dev = pci_get_drvdata (pdev);
-	struct netdev_private *np = dev->priv;
+	struct netdev_private *np = netdev_priv(dev);
 
 	rtnl_lock();
 	if (netif_device_present(dev))
diff --git a/drivers/net/ne-h8300.c b/drivers/net/ne-h8300.c
index 86f34b5ec..84e291e24 100644
--- a/drivers/net/ne-h8300.c
+++ b/drivers/net/ne-h8300.c
@@ -34,6 +34,8 @@ static const char version1[] =
 
 #include "8390.h"
 
+#define DRV_NAME "ne-h8300"
+
 /* Some defines that people can play with if so inclined. */
 
 /* Do we perform extra sanity checks on stuff ? */
@@ -156,6 +158,7 @@ static void cleanup_card(struct net_device *dev)
 	release_region(dev->base_addr, NE_IO_EXTENT);
 }
 
+#ifndef MODULE
 struct net_device * __init ne_probe(int unit)
 {
 	struct net_device *dev = alloc_ei_netdev();
@@ -187,6 +190,7 @@ out:
 	free_netdev(dev);
 	return ERR_PTR(err);
 }
+#endif
 
 static int __init ne_probe1(struct net_device *dev, int ioaddr)
 {
@@ -200,7 +204,7 @@ static int __init ne_probe1(struct net_device *dev, int ioaddr)
 	struct ei_device *ei_local = (struct ei_device *) netdev_priv(dev);
 	unsigned char bus_width;
 
-	if (!request_region(ioaddr, NE_IO_EXTENT, dev->name))
+	if (!request_region(ioaddr, NE_IO_EXTENT, DRV_NAME))
 		return -EBUSY;
 
 	reg0 = inb_p(ioaddr);
diff --git a/drivers/net/ne.c b/drivers/net/ne.c
index 9de5cccf5..a4116f136 100644
--- a/drivers/net/ne.c
+++ b/drivers/net/ne.c
@@ -55,6 +55,8 @@ static const char version2[] =
 
 #include "8390.h"
 
+#define DRV_NAME "ne"
+
 /* Some defines that people can play with if so inclined. */
 
 /* Do we support clones that don't adhere to 14,15 of the SAprom ? */
@@ -109,7 +111,7 @@ bad_clone_list[] __initdata = {
     {"PCM-4823", "PCM-4823", {0x00, 0xc0, 0x6c}}, /* Broken Advantech MoBo */
     {"REALTEK", "RTL8019", {0x00, 0x00, 0xe8}}, /* no-name with Realtek chip */
     {"LCS-8834", "LCS-8836", {0x04, 0x04, 0x37}}, /* ShinyNet (SET) */
-    {0,}
+    {NULL,}
 };
 #endif
 
@@ -203,6 +205,7 @@ static void cleanup_card(struct net_device *dev)
 	release_region(dev->base_addr, NE_IO_EXTENT);
 }
 
+#ifndef MODULE
 struct net_device * __init ne_probe(int unit)
 {
 	struct net_device *dev = alloc_ei_netdev();
@@ -227,6 +230,7 @@ out:
 	free_netdev(dev);
 	return ERR_PTR(err);
 }
+#endif
 
 static int __init ne_probe_isapnp(struct net_device *dev)
 {
@@ -284,7 +288,7 @@ static int __init ne_probe1(struct net_device *dev, int ioaddr)
 	int reg0, ret;
 	static unsigned version_printed;
 
-	if (!request_region(ioaddr, NE_IO_EXTENT, dev->name))
+	if (!request_region(ioaddr, NE_IO_EXTENT, DRV_NAME))
 		return -EBUSY;
 
 	reg0 = inb_p(ioaddr);
diff --git a/drivers/net/ne2.c b/drivers/net/ne2.c
index 739f92ab1..5d690c9f1 100644
--- a/drivers/net/ne2.c
+++ b/drivers/net/ne2.c
@@ -82,6 +82,8 @@ static const char *version = "ne2.c:v0.91 Nov 16 1998 Wim Dumon <wimpie@kotnet.o
 
 #include "8390.h"
 
+#define DRV_NAME "ne2"
+
 /* Some defines that people can play with if so inclined. */
 
 /* Do we perform extra sanity checks on stuff ? */
@@ -284,6 +286,7 @@ static void cleanup_card(struct net_device *dev)
 	release_region(dev->base_addr, NE_IO_EXTENT);
 }
 
+#ifndef MODULE
 struct net_device * __init ne2_probe(int unit)
 {
 	struct net_device *dev = alloc_ei_netdev();
@@ -308,6 +311,7 @@ out:
 	free_netdev(dev);
 	return ERR_PTR(err);
 }
+#endif
 
 static int ne2_procinfo(char *buf, int slot, struct net_device *dev)
 {
@@ -368,7 +372,7 @@ static int __init ne2_probe1(struct net_device *dev, int slot)
 		irq = irqs[(POS & 0x60)>>5];
 	}
 
-	if (!request_region(base_addr, NE_IO_EXTENT, dev->name))
+	if (!request_region(base_addr, NE_IO_EXTENT, DRV_NAME))
 		return -EBUSY;
 
 #ifdef DEBUG
@@ -470,7 +474,7 @@ static int __init ne2_probe1(struct net_device *dev, int slot)
 
 	/* Snarf the interrupt now.  There's no point in waiting since we cannot
 	   share and the board will usually be enabled. */
-	retval = request_irq(dev->irq, ei_interrupt, 0, dev->name, dev);
+	retval = request_irq(dev->irq, ei_interrupt, 0, DRV_NAME, dev);
 	if (retval) {
 		printk (" unable to get IRQ %d (irqval=%d).\n", 
 				dev->irq, retval);
@@ -772,14 +776,12 @@ static int irq[MAX_NE_CARDS];
 static int bad[MAX_NE_CARDS];	/* 0xbad = bad sig or no reset ack */
 MODULE_LICENSE("GPL");
 
-#ifdef MODULE_PARM
 MODULE_PARM(io, "1-" __MODULE_STRING(MAX_NE_CARDS) "i");
 MODULE_PARM(irq, "1-" __MODULE_STRING(MAX_NE_CARDS) "i");
 MODULE_PARM(bad, "1-" __MODULE_STRING(MAX_NE_CARDS) "i");
 MODULE_PARM_DESC(io, "(ignored)");
 MODULE_PARM_DESC(irq, "(ignored)");
 MODULE_PARM_DESC(bad, "(ignored)");
-#endif
 
 /* Module code fixed by David Weinehall */
 
diff --git a/drivers/net/ne2k-pci.c b/drivers/net/ne2k-pci.c
index 31859c6bc..ed15b19eb 100644
--- a/drivers/net/ne2k-pci.c
+++ b/drivers/net/ne2k-pci.c
@@ -132,7 +132,7 @@ static struct {
 	{"Holtek HT80232", ONLY_16BIT_IO | HOLTEK_FDX},
 	{"Holtek HT80229", ONLY_32BIT_IO | HOLTEK_FDX | STOP_PG_0x60 },
 	{"Winbond W89C940(misprogrammed)", 0},
-	{0,}
+	{NULL,}
 };
 
 
diff --git a/drivers/net/ne3210.c b/drivers/net/ne3210.c
index ec77fcad2..7228ba29a 100644
--- a/drivers/net/ne3210.c
+++ b/drivers/net/ne3210.c
@@ -45,6 +45,8 @@ static const char *version =
 
 #include "8390.h"
 
+#define DRV_NAME "ne3210"
+
 static int ne3210_open(struct net_device *dev);
 static int ne3210_close(struct net_device *dev);
 
@@ -111,13 +113,13 @@ static int __init ne3210_eisa_probe (struct device *device)
 	device->driver_data = dev;
 	ioaddr = edev->base_addr;
 
-	if (!request_region(ioaddr, NE3210_IO_EXTENT, dev->name)) {
+	if (!request_region(ioaddr, NE3210_IO_EXTENT, DRV_NAME)) {
 		retval = -EBUSY;
 		goto out;
 	}
 
 	if (!request_region(ioaddr + NE3210_CFG1,
-			    NE3210_CFG_EXTENT, dev->name)) {
+			    NE3210_CFG_EXTENT, DRV_NAME)) {
 		retval = -EBUSY;
 		goto out1;
 	}
@@ -140,7 +142,7 @@ static int __init ne3210_eisa_probe (struct device *device)
 	dev->irq = irq_map[(inb(ioaddr + NE3210_CFG2) >> 3) & 0x07];
 	printk(".\nne3210.c: using IRQ %d, ", dev->irq);
 
-	retval = request_irq(dev->irq, ei_interrupt, 0, dev->name, dev);
+	retval = request_irq(dev->irq, ei_interrupt, 0, DRV_NAME, dev);
 	if (retval) {
 		printk (" unable to get IRQ %d.\n", dev->irq);
 		goto out2;
@@ -163,7 +165,7 @@ static int __init ne3210_eisa_probe (struct device *device)
 		}
 	}
 	
-	if (!request_mem_region (phys_mem, NE3210_STOP_PG*0x100, dev->name)) {
+	if (!request_mem_region (phys_mem, NE3210_STOP_PG*0x100, DRV_NAME)) {
 		printk ("ne3210.c: Unable to request shared memory at physical address %#lx\n",
 			phys_mem);
 		goto out3;
diff --git a/drivers/net/ni52.c b/drivers/net/ni52.c
index 714d9705b..234709ded 100644
--- a/drivers/net/ni52.c
+++ b/drivers/net/ni52.c
@@ -124,6 +124,8 @@ static int fifo=0x8;	/* don't change */
 
 #include "ni52.h"
 
+#define DRV_NAME "ni52"
+
 #define DEBUG       /* debug on */
 #define SYSBUSVAL 1 /* 8 Bit */
 
@@ -424,7 +426,7 @@ static int __init ni52_probe1(struct net_device *dev,int ioaddr)
 	dev->mem_start = memstart;
 	dev->mem_end = memend;
 
-	if (!request_region(ioaddr, NI52_TOTAL_SIZE, dev->name))
+	if (!request_region(ioaddr, NI52_TOTAL_SIZE, DRV_NAME))
 		return -EBUSY;
 
 	if( !(inb(ioaddr+NI52_MAGIC1) == NI52_MAGICVAL1) ||
diff --git a/drivers/net/ns83820.c b/drivers/net/ns83820.c
index 0ff2d4223..c2551c5fb 100644
--- a/drivers/net/ns83820.c
+++ b/drivers/net/ns83820.c
@@ -113,6 +113,8 @@
 #include <asm/uaccess.h>
 #include <asm/system.h>
 
+#define DRV_NAME "ns83820"
+
 /* Global parameters.  See MODULE_PARM near the bottom. */
 static int ihr = 2;
 static int reset_phy = 0;
@@ -1087,7 +1089,7 @@ again:
 
 	frag = skb_shinfo(skb)->frags;
 	if (!nr_frags)
-		frag = 0;
+		frag = NULL;
 	extsts = 0;
 	if (skb->ip_summed == CHECKSUM_HW) {
 		extsts |= EXTSTS_IPPKT;
@@ -1851,7 +1853,7 @@ static int __devinit ns83820_init_one(struct pci_dev *pci_dev, const struct pci_
 		0);
 
 	err = request_irq(pci_dev->irq, ns83820_irq, SA_SHIRQ,
-			  ndev->name, ndev);
+			  DRV_NAME, ndev);
 	if (err) {
 		printk(KERN_INFO "ns83820: unable to register irq %d\n",
 			pci_dev->irq);
diff --git a/drivers/net/oaknet.c b/drivers/net/oaknet.c
index c241b7a3c..62167a29d 100644
--- a/drivers/net/oaknet.c
+++ b/drivers/net/oaknet.c
@@ -164,7 +164,7 @@ static int __init oaknet_init(void)
 	ret = -EAGAIN;
 	if (request_irq(dev->irq, ei_interrupt, 0, name, dev)) {
 		printk("%s: unable to request interrupt %d.\n",
-		       dev->name, dev->irq);
+		       name, dev->irq);
 		goto out_region;
 	}
 
diff --git a/drivers/net/pci-skeleton.c b/drivers/net/pci-skeleton.c
index 238538660..f93124898 100644
--- a/drivers/net/pci-skeleton.c
+++ b/drivers/net/pci-skeleton.c
@@ -481,6 +481,7 @@ struct netdrv_private {
 	unsigned int mediasense:1;	/* Media sensing in progress. */
 	spinlock_t lock;
 	chip_t chipset;
+	u32 pci_state[16];	/* Data saved during suspend */
 };
 
 MODULE_AUTHOR ("Jeff Garzik <jgarzik@pobox.com>");
@@ -488,12 +489,10 @@ MODULE_DESCRIPTION ("Skeleton for a PCI Fast Ethernet driver");
 MODULE_LICENSE("GPL");
 MODULE_PARM (multicast_filter_limit, "i");
 MODULE_PARM (max_interrupt_work, "i");
-MODULE_PARM (debug, "i");
 MODULE_PARM (media, "1-" __MODULE_STRING(8) "i");
 MODULE_PARM_DESC (multicast_filter_limit, "pci-skeleton maximum number of filtered multicast addresses");
 MODULE_PARM_DESC (max_interrupt_work, "pci-skeleton maximum events handled per interrupt");
 MODULE_PARM_DESC (media, "pci-skeleton: Bits 0-3: media type, bit 17: full duplex");
-MODULE_PARM_DESC (debug, "(unused)");
 
 static int read_eeprom (void *ioaddr, int location, int addr_len);
 static int netdrv_open (struct net_device *dev);
@@ -588,7 +587,6 @@ static int __devinit netdrv_init_board (struct pci_dev *pdev,
 	void *ioaddr = NULL;
 	struct net_device *dev;
 	struct netdrv_private *tp;
-	u8 tmp8;
 	int rc, i;
 	u32 pio_start, pio_end, pio_flags, pio_len;
 	unsigned long mmio_start, mmio_end, mmio_flags, mmio_len;
@@ -744,7 +742,6 @@ static int __devinit netdrv_init_one (struct pci_dev *pdev,
 	int i, addr_len, option;
 	void *ioaddr = NULL;
 	static int board_idx = -1;
-	u8 tmp;
 
 /* when built into the kernel, we only print version if device is found */
 #ifndef MODULE
@@ -868,7 +865,7 @@ static void __devexit netdrv_remove_one (struct pci_dev *pdev)
 
 	pci_set_drvdata (pdev, NULL);
 
-	pci_power_off (pdev, -1);
+	pci_disable_device (pdev);
 
 	DPRINTK ("EXIT\n");
 }
@@ -1136,7 +1133,6 @@ static void netdrv_hw_start (struct net_device *dev)
 	struct netdrv_private *tp = dev->priv;
 	void *ioaddr = tp->mmio_addr;
 	u32 i;
-	u8 tmp;
 
 	DPRINTK ("ENTER\n");
 
@@ -1875,9 +1871,11 @@ static void netdrv_set_rx_mode (struct net_device *dev)
 		rx_mode = AcceptBroadcast | AcceptMulticast | AcceptMyPhys;
 		mc_filter[1] = mc_filter[0] = 0;
 		for (i = 0, mclist = dev->mc_list; mclist && i < dev->mc_count;
-		     i++, mclist = mclist->next)
-			set_bit (ether_crc (ETH_ALEN, mclist->dmi_addr) >> 26,
-				 mc_filter);
+		     i++, mclist = mclist->next) {
+			int bit_nr = ether_crc(ETH_ALEN, mclist->dmi_addr) >> 26;
+
+			mc_filter[bit_nr >> 5] |= 1 << (bit_nr & 31);
+		}
 	}
 
 	/* if called from irq handler, lock already acquired */
@@ -1908,7 +1906,7 @@ static int netdrv_suspend (struct pci_dev *pdev, u32 state)
 	unsigned long flags;
 
 	if (!netif_running(dev))
-		return;
+		return 0;
 	netif_device_detach (dev);
 
 	spin_lock_irqsave (&tp->lock, flags);
@@ -1923,7 +1921,8 @@ static int netdrv_suspend (struct pci_dev *pdev, u32 state)
 
 	spin_unlock_irqrestore (&tp->lock, flags);
 
-	pci_power_off (pdev, -1);
+	pci_save_state (pdev, tp->pci_state);
+	pci_set_power_state (pdev, 3);
 
 	return 0;
 }
@@ -1932,10 +1931,12 @@ static int netdrv_suspend (struct pci_dev *pdev, u32 state)
 static int netdrv_resume (struct pci_dev *pdev)
 {
 	struct net_device *dev = pci_get_drvdata (pdev);
+	struct netdrv_private *tp = dev->priv;
 
 	if (!netif_running(dev))
-		return;
-	pci_power_on (pdev);
+		return 0;
+	pci_set_power_state (pdev, 0);
+	pci_restore_state (pdev, tp->pci_state);
 	netif_device_attach (dev);
 	netdrv_hw_start (dev);
 
diff --git a/drivers/net/pcmcia/3c574_cs.c b/drivers/net/pcmcia/3c574_cs.c
index 59d80ebbe..7c4ed0ddd 100644
--- a/drivers/net/pcmcia/3c574_cs.c
+++ b/drivers/net/pcmcia/3c574_cs.c
@@ -360,7 +360,10 @@ static void tc574_detach(dev_link_t *link)
 	for (linkp = &dev_list; *linkp; linkp = &(*linkp)->next)
 		if (*linkp == link) break;
 	if (*linkp == NULL)
-	return;
+		return;
+
+	if (link->dev)
+		unregister_netdev(dev);
 
 	if (link->state & DEV_CONFIG)
 		tc574_release(link);
@@ -370,8 +373,6 @@ static void tc574_detach(dev_link_t *link)
 
 	/* Unlink device structure, free bits */
 	*linkp = link->next;
-	if (link->dev)
-		unregister_netdev(dev);
 	free_netdev(dev);
 } /* tc574_detach */
 
@@ -580,10 +581,8 @@ static int tc574_event(event_t event, int priority,
 	switch (event) {
 	case CS_EVENT_CARD_REMOVAL:
 		link->state &= ~DEV_PRESENT;
-		if (link->state & DEV_CONFIG) {
+		if (link->state & DEV_CONFIG)
 			netif_device_detach(dev);
-			tc574_release(link);
-		}
 		break;
 	case CS_EVENT_CARD_INSERTION:
 		link->state |= DEV_PRESENT | DEV_CONFIG_PENDING;
diff --git a/drivers/net/pcmcia/3c589_cs.c b/drivers/net/pcmcia/3c589_cs.c
index be997bd29..2e0135dad 100644
--- a/drivers/net/pcmcia/3c589_cs.c
+++ b/drivers/net/pcmcia/3c589_cs.c
@@ -276,6 +276,9 @@ static void tc589_detach(dev_link_t *link)
     if (*linkp == NULL)
 	return;
 
+    if (link->dev)
+	unregister_netdev(dev);
+
     if (link->state & DEV_CONFIG)
 	tc589_release(link);
     
@@ -284,8 +287,6 @@ static void tc589_detach(dev_link_t *link)
     
     /* Unlink device structure, free bits */
     *linkp = link->next;
-    if (link->dev)
-	unregister_netdev(dev);
     free_netdev(dev);
 } /* tc589_detach */
 
@@ -456,10 +457,8 @@ static int tc589_event(event_t event, int priority,
     switch (event) {
     case CS_EVENT_CARD_REMOVAL:
 	link->state &= ~DEV_PRESENT;
-	if (link->state & DEV_CONFIG) {
+	if (link->state & DEV_CONFIG)
 	    netif_device_detach(dev);
-	    tc589_release(link);
-	}
 	break;
     case CS_EVENT_CARD_INSERTION:
 	link->state |= DEV_PRESENT | DEV_CONFIG_PENDING;
diff --git a/drivers/net/pcmcia/axnet_cs.c b/drivers/net/pcmcia/axnet_cs.c
index ea5a88cf7..0d9a06f8c 100644
--- a/drivers/net/pcmcia/axnet_cs.c
+++ b/drivers/net/pcmcia/axnet_cs.c
@@ -231,6 +231,9 @@ static void axnet_detach(dev_link_t *link)
     if (*linkp == NULL)
 	return;
 
+    if (link->dev)
+	unregister_netdev(dev);
+
     if (link->state & DEV_CONFIG)
 	axnet_release(link);
 
@@ -239,8 +242,6 @@ static void axnet_detach(dev_link_t *link)
 
     /* Unlink device structure, free bits */
     *linkp = link->next;
-    if (link->dev)
-	unregister_netdev(dev);
     free_netdev(dev);
 } /* axnet_detach */
 
@@ -525,10 +526,8 @@ static int axnet_event(event_t event, int priority,
     switch (event) {
     case CS_EVENT_CARD_REMOVAL:
 	link->state &= ~DEV_PRESENT;
-	if (link->state & DEV_CONFIG) {
+	if (link->state & DEV_CONFIG)
 	    netif_device_detach(dev);
-	    axnet_release(link);
-	}
 	break;
     case CS_EVENT_CARD_INSERTION:
 	link->state |= DEV_PRESENT | DEV_CONFIG_PENDING;
@@ -1179,7 +1178,7 @@ static int ei_start_xmit(struct sk_buff *skb, struct net_device *dev)
 	}
 	else if (ei_local->tx2 == 0) 
 	{
-		output_page = ei_local->tx_start_page + TX_1X_PAGES;
+		output_page = ei_local->tx_start_page + TX_PAGES/2;
 		ei_local->tx2 = send_length;
 		if (ei_debug  &&  ei_local->tx1 > 0)
 			printk(KERN_DEBUG "%s: idle transmitter, tx1=%d, lasttx=%d, txing=%d.\n",
diff --git a/drivers/net/pcmcia/com20020_cs.c b/drivers/net/pcmcia/com20020_cs.c
index 9ce8df6f2..a82454838 100644
--- a/drivers/net/pcmcia/com20020_cs.c
+++ b/drivers/net/pcmcia/com20020_cs.c
@@ -262,6 +262,19 @@ static void com20020_detach(dev_link_t *link)
 
     dev = info->dev;
 
+    if (link->dev) {
+	DEBUG(1,"unregister...\n");
+
+	unregister_netdev(dev);
+	    
+	/*
+	 * this is necessary because we register our IRQ separately
+	 * from card services.
+	 */
+	if (dev->irq)
+	    free_irq(dev->irq, dev);
+    }
+
     if (link->state & DEV_CONFIG)
         com20020_release(link);
 
@@ -276,21 +289,6 @@ static void com20020_detach(dev_link_t *link)
 	dev = info->dev;
 	if (dev)
 	{
-	    if (link->dev)
-	    {
-		DEBUG(1,"unregister...\n");
-
-		unregister_netdev(dev);
-	    
-		/*
-		 * this is necessary because we register our IRQ separately
-		 * from card services.
-		 */
-		if (dev->irq)
-		    free_irq(dev->irq, dev);
-		/* ...but I/O ports are done automatically by card services */
-	    }
-	    
 	    DEBUG(1,"kfree...\n");
 	    free_netdev(dev);
 	}
@@ -461,10 +459,8 @@ static int com20020_event(event_t event, int priority,
     switch (event) {
     case CS_EVENT_CARD_REMOVAL:
         link->state &= ~DEV_PRESENT;
-        if (link->state & DEV_CONFIG) {
+        if (link->state & DEV_CONFIG)
             netif_device_detach(dev);
-            link->state |= DEV_RELEASE_PENDING;
-        }
         break;
     case CS_EVENT_CARD_INSERTION:
         link->state |= DEV_PRESENT;
diff --git a/drivers/net/pcmcia/fmvj18x_cs.c b/drivers/net/pcmcia/fmvj18x_cs.c
index 580af3709..9c40e61fa 100644
--- a/drivers/net/pcmcia/fmvj18x_cs.c
+++ b/drivers/net/pcmcia/fmvj18x_cs.c
@@ -332,6 +332,9 @@ static void fmvj18x_detach(dev_link_t *link)
     if (*linkp == NULL)
 	return;
 
+    if (link->dev)
+	unregister_netdev(dev);
+
     if (link->state & DEV_CONFIG)
 	fmvj18x_release(link);
 
@@ -341,8 +344,6 @@ static void fmvj18x_detach(dev_link_t *link)
     
     /* Unlink device structure, free pieces */
     *linkp = link->next;
-    if (link->dev)
-	unregister_netdev(dev);
     free_netdev(dev);
 } /* fmvj18x_detach */
 
@@ -741,10 +742,8 @@ static int fmvj18x_event(event_t event, int priority,
     switch (event) {
     case CS_EVENT_CARD_REMOVAL:
 	link->state &= ~DEV_PRESENT;
-	if (link->state & DEV_CONFIG) {
+	if (link->state & DEV_CONFIG)
 	    netif_device_detach(dev);
-	    fmvj18x_release(link);
-	}
 	break;
     case CS_EVENT_CARD_INSERTION:
 	link->state |= DEV_PRESENT | DEV_CONFIG_PENDING;
diff --git a/drivers/net/pcmcia/ibmtr_cs.c b/drivers/net/pcmcia/ibmtr_cs.c
index beccf9e95..884ee94ea 100644
--- a/drivers/net/pcmcia/ibmtr_cs.c
+++ b/drivers/net/pcmcia/ibmtr_cs.c
@@ -446,7 +446,6 @@ static int ibmtr_event(event_t event, int priority,
 	    struct tok_info *priv = netdev_priv(dev);
 	    priv->sram_virt |= 1;
 	    netif_device_detach(dev);
-	    ibmtr_release(link);
         }
         break;
     case CS_EVENT_CARD_INSERTION:
diff --git a/drivers/net/pcmcia/nmclan_cs.c b/drivers/net/pcmcia/nmclan_cs.c
index bcf284bbb..947dad4ca 100644
--- a/drivers/net/pcmcia/nmclan_cs.c
+++ b/drivers/net/pcmcia/nmclan_cs.c
@@ -551,6 +551,9 @@ static void nmclan_detach(dev_link_t *link)
     if (*linkp == NULL)
 	return;
 
+    if (link->dev)
+	unregister_netdev(dev);
+
     if (link->state & DEV_CONFIG)
 	nmclan_release(link);
 
@@ -559,8 +562,6 @@ static void nmclan_detach(dev_link_t *link)
 
     /* Unlink device structure, free bits */
     *linkp = link->next;
-    if (link->dev)
-	unregister_netdev(dev);
     free_netdev(dev);
 } /* nmclan_detach */
 
@@ -834,10 +835,8 @@ static int nmclan_event(event_t event, int priority,
   switch (event) {
     case CS_EVENT_CARD_REMOVAL:
       link->state &= ~DEV_PRESENT;
-      if (link->state & DEV_CONFIG) {
+      if (link->state & DEV_CONFIG)
 	netif_device_detach(dev);
-	nmclan_release(link);
-      }
       break;
     case CS_EVENT_CARD_INSERTION:
       link->state |= DEV_PRESENT | DEV_CONFIG_PENDING;
@@ -1473,7 +1472,7 @@ updateCRC
 	Modified from Am79C90 data sheet.
 ---------------------------------------------------------------------------- */
 
-#if BROKEN_MULTICAST
+#ifdef BROKEN_MULTICAST
 
 static void updateCRC(int *CRC, int bit)
 {
diff --git a/drivers/net/pcmcia/pcnet_cs.c b/drivers/net/pcmcia/pcnet_cs.c
index b53f5fcf5..2db4baabe 100644
--- a/drivers/net/pcmcia/pcnet_cs.c
+++ b/drivers/net/pcmcia/pcnet_cs.c
@@ -326,6 +326,9 @@ static void pcnet_detach(dev_link_t *link)
     if (*linkp == NULL)
 	return;
 
+    if (link->dev)
+	unregister_netdev(dev);
+
     if (link->state & DEV_CONFIG)
 	pcnet_release(link);
 
@@ -334,8 +337,6 @@ static void pcnet_detach(dev_link_t *link)
 
     /* Unlink device structure, free bits */
     *linkp = link->next;
-    if (link->dev)
-	unregister_netdev(dev);
     free_netdev(dev);
 } /* pcnet_detach */
 
@@ -806,10 +807,8 @@ static int pcnet_event(event_t event, int priority,
     switch (event) {
     case CS_EVENT_CARD_REMOVAL:
 	link->state &= ~DEV_PRESENT;
-	if (link->state & DEV_CONFIG) {
+	if (link->state & DEV_CONFIG)
 	    netif_device_detach(dev);
-	    pcnet_release(link);
-	}
 	break;
     case CS_EVENT_CARD_INSERTION:
 	link->state |= DEV_PRESENT | DEV_CONFIG_PENDING;
diff --git a/drivers/net/pcmcia/smc91c92_cs.c b/drivers/net/pcmcia/smc91c92_cs.c
index 7c1bd346e..49d60d9ca 100644
--- a/drivers/net/pcmcia/smc91c92_cs.c
+++ b/drivers/net/pcmcia/smc91c92_cs.c
@@ -411,6 +411,9 @@ static void smc91c92_detach(dev_link_t *link)
     if (*linkp == NULL)
 	return;
 
+    if (link->dev)
+	unregister_netdev(dev);
+
     if (link->state & DEV_CONFIG)
 	smc91c92_release(link);
 
@@ -419,8 +422,6 @@ static void smc91c92_detach(dev_link_t *link)
 
     /* Unlink device structure, free bits */
     *linkp = link->next;
-    if (link->dev)
-	unregister_netdev(dev);
     free_netdev(dev);
 } /* smc91c92_detach */
 
@@ -1112,10 +1113,8 @@ static int smc91c92_event(event_t event, int priority,
     switch (event) {
     case CS_EVENT_CARD_REMOVAL:
 	link->state &= ~DEV_PRESENT;
-	if (link->state & DEV_CONFIG) {
+	if (link->state & DEV_CONFIG)
 	    netif_device_detach(dev);
-	    smc91c92_release(link);
-	}
 	break;
     case CS_EVENT_CARD_INSERTION:
 	link->state |= DEV_PRESENT | DEV_CONFIG_PENDING;
@@ -1273,7 +1272,7 @@ static int smc_open(struct net_device *dev)
     link->open++;
 
     netif_start_queue(dev);
-    smc->saved_skb = 0;
+    smc->saved_skb = NULL;
     smc->packets_waiting = 0;
 
     smc_reset(dev);
diff --git a/drivers/net/pcmcia/xirc2ps_cs.c b/drivers/net/pcmcia/xirc2ps_cs.c
index d4cc26902..5be2ba3b0 100644
--- a/drivers/net/pcmcia/xirc2ps_cs.c
+++ b/drivers/net/pcmcia/xirc2ps_cs.c
@@ -668,6 +668,9 @@ xirc2ps_detach(dev_link_t * link)
 	return;
     }
 
+    if (link->dev)
+	unregister_netdev(dev);
+
     /*
      * If the device is currently configured and active, we won't
      * actually delete it yet.	Instead, it is marked so that when
@@ -683,8 +686,6 @@ xirc2ps_detach(dev_link_t * link)
 
     /* Unlink device structure, free it */
     *linkp = link->next;
-    if (link->dev)
-	unregister_netdev(dev);
     free_netdev(dev);
 } /* xirc2ps_detach */
 
@@ -814,7 +815,7 @@ xirc2ps_config(dev_link_t * link)
     cistpl_lan_node_id_t *node_id = (cistpl_lan_node_id_t*)parse.funce.data;
     cistpl_cftable_entry_t *cf = &parse.cftable_entry;
 
-    local->dingo_ccr = 0;
+    local->dingo_ccr = NULL;
 
     DEBUG(0, "config(0x%p)\n", link);
 
@@ -1203,10 +1204,8 @@ xirc2ps_event(event_t event, int priority,
 	break;
     case CS_EVENT_CARD_REMOVAL:
 	link->state &= ~DEV_PRESENT;
-	if (link->state & DEV_CONFIG) {
+	if (link->state & DEV_CONFIG)
 	    netif_device_detach(dev);
-	    xirc2ps_release(link);
-	}
 	break;
     case CS_EVENT_CARD_INSERTION:
 	link->state |= DEV_PRESENT | DEV_CONFIG_PENDING;
diff --git a/drivers/net/pcnet32.c b/drivers/net/pcnet32.c
index bdf90d4e6..effbad31d 100644
--- a/drivers/net/pcnet32.c
+++ b/drivers/net/pcnet32.c
@@ -22,8 +22,8 @@
  *************************************************************************/
 
 #define DRV_NAME	"pcnet32"
-#define DRV_VERSION	"1.30c"
-#define DRV_RELDATE	"05.25.2004"
+#define DRV_VERSION	"1.30i"
+#define DRV_RELDATE	"06.28.2004"
 #define PFX		DRV_NAME ": "
 
 static const char *version =
@@ -46,6 +46,7 @@ DRV_NAME ".c:v" DRV_VERSION " " DRV_RELDATE " tsbogend@alpha.franken.de\n";
 #include <linux/etherdevice.h>
 #include <linux/skbuff.h>
 #include <linux/spinlock.h>
+#include <linux/moduleparam.h>
 
 #include <asm/bitops.h>
 #include <asm/dma.h>
@@ -137,6 +138,7 @@ static const char pcnet32_gstrings_test[][ETH_GSTRING_LEN] = {
 #define MAX_UNITS 8	/* More are supported, limit only on options */
 static int options[MAX_UNITS];
 static int full_duplex[MAX_UNITS];
+static int homepna[MAX_UNITS];
 
 /*
  *				Theory of Operation
@@ -245,6 +247,15 @@ static int full_duplex[MAX_UNITS];
  * v1.30b  24 May 2004 Don Fry fix bogus tx carrier errors with 79c973,
  *	   assisted by Bruce Penrod <bmpenrod@endruntechnologies.com>.
  * v1.30c  25 May 2004 Don Fry added netif_wake_queue after pcnet32_restart.
+ * v1.30d  01 Jun 2004 Don Fry discard oversize rx packets.
+ * v1.30e  11 Jun 2004 Don Fry recover after fifo error and rx hang.
+ * v1.30f  16 Jun 2004 Don Fry cleanup IRQ to allow 0 and 1 for PCI,
+ * 	   expanding on suggestions from Ralf Baechle <ralf@linux-mips.org>,
+ * 	   and Brian Murphy <brian@murphy.dk>.
+ * v1.30g  22 Jun 2004 Patrick Simmons <psimmons@flash.net> added option
+ *	   homepna for selecting HomePNA mode for PCNet/Home 79C978.
+ * v1.30h  24 Jun 2004 Don Fry correctly select auto, speed, duplex in bcr32.
+ * v1.30i  28 Jun 2004 Don Fry change to use module_param.
  */
 
 
@@ -360,7 +371,7 @@ struct pcnet32_private {
 
 static void pcnet32_probe_vlbus(void);
 static int  pcnet32_probe_pci(struct pci_dev *, const struct pci_device_id *);
-static int  pcnet32_probe1(unsigned long, unsigned int, int, struct pci_dev *);
+static int  pcnet32_probe1(unsigned long, int, struct pci_dev *);
 static int  pcnet32_open(struct net_device *);
 static int  pcnet32_init_ring(struct net_device *);
 static int  pcnet32_start_xmit(struct sk_buff *, struct net_device *);
@@ -958,7 +969,7 @@ pcnet32_probe_vlbus(void)
 	if (request_region(ioaddr, PCNET32_TOTAL_SIZE, "pcnet32_probe_vlbus")) {
 	    /* check if there is really a pcnet chip on that ioaddr */
 	    if ((inb(ioaddr + 14) == 0x57) && (inb(ioaddr + 15) == 0x57)) {
-		pcnet32_probe1(ioaddr, 0, 0, NULL);
+		pcnet32_probe1(ioaddr, 0, NULL);
 	    } else {
 		release_region(ioaddr, PCNET32_TOTAL_SIZE);
 	    }
@@ -999,7 +1010,7 @@ pcnet32_probe_pci(struct pci_dev *pdev, const struct pci_device_id *ent)
 	return -EBUSY;
     }
 
-    return pcnet32_probe1(ioaddr, pdev->irq, 1, pdev);
+    return pcnet32_probe1(ioaddr, 1, pdev);
 }
 
 
@@ -1008,8 +1019,7 @@ pcnet32_probe_pci(struct pci_dev *pdev, const struct pci_device_id *ent)
  *  pdev will be NULL when called from pcnet32_probe_vlbus.
  */
 static int __devinit
-pcnet32_probe1(unsigned long ioaddr, unsigned int irq_line, int shared,
-		struct pci_dev *pdev)
+pcnet32_probe1(unsigned long ioaddr, int shared, struct pci_dev *pdev)
 {
     struct pcnet32_private *lp;
     dma_addr_t lp_dma_addr;
@@ -1080,15 +1090,17 @@ pcnet32_probe1(unsigned long ioaddr, unsigned int irq_line, int shared,
 	fdx = 1;
 	/*
 	 * This is based on specs published at www.amd.com.  This section
-	 * assumes that a card with a 79C978 wants to go into 1Mb HomePNA
-	 * mode.  The 79C978 can also go into standard ethernet, and there
-	 * probably should be some sort of module option to select the
-	 * mode by which the card should operate
+	 * assumes that a card with a 79C978 wants to go into standard
+	 * ethernet mode.  The 79C978 can also go into 1Mb HomePNA mode,
+	 * and the module option homepna=1 can select this instead.
 	 */
-	/* switch to home wiring mode */
 	media = a->read_bcr(ioaddr, 49);
+	media &= ~3;		/* default to 10Mb ethernet */
+	if (cards_found < MAX_UNITS && homepna[cards_found])
+	    media |= 1; 	/* switch to home wiring mode */
 	if (pcnet32_debug & NETIF_MSG_PROBE)
-	    printk(KERN_DEBUG PFX "media reset to %#x.\n",  media);
+	    printk(KERN_DEBUG PFX "media set to %sMbit mode.\n", 
+		    (media & 1) ? "1" : "10");
 	a->write_bcr(ioaddr, 49, media);
 	break;
     case 0x2627:
@@ -1270,11 +1282,8 @@ pcnet32_probe1(unsigned long ioaddr, unsigned int irq_line, int shared,
     a->write_csr(ioaddr, 2, (lp->dma_addr + offsetof(struct pcnet32_private,
 		    init_block)) >> 16);
 
-    if (irq_line) {
-	dev->irq = irq_line;
-    }
-
-    if (dev->irq >= 2) {
+    if (pdev) {		/* use the IRQ provided by PCI */
+	dev->irq = pdev->irq;
 	if (pcnet32_debug & NETIF_MSG_PROBE)
 	    printk(" assigned IRQ %d.\n", dev->irq);
     } else {
@@ -1362,8 +1371,7 @@ pcnet32_open(struct net_device *dev)
     int rc;
     unsigned long flags;
 
-    if (dev->irq == 0 ||
-	request_irq(dev->irq, &pcnet32_interrupt,
+    if (request_irq(dev->irq, &pcnet32_interrupt,
 		    lp->shared_irq ? SA_SHIRQ : 0, dev->name, (void *)dev)) {
 	return -EAGAIN;
     }
@@ -1417,9 +1425,13 @@ pcnet32_open(struct net_device *dev)
 	val |= 0x10;
     lp->a.write_csr (ioaddr, 124, val);
 
+    /* 24 Jun 2004 according AMD, in order to change the PHY,
+     * DANAS (or DISPM for 79C976) must be set; then select the speed,
+     * duplex, and/or enable auto negotiation, and clear DANAS */
     if (lp->mii && !(lp->options & PCNET32_PORT_ASEL)) {
+	lp->a.write_bcr(ioaddr, 32, lp->a.read_bcr(ioaddr, 32) | 0x0080);
 	/* disable Auto Negotiation, set 10Mpbs, HD */
-	val = lp->a.read_bcr (ioaddr, 32) & ~0x38;
+	val = lp->a.read_bcr(ioaddr, 32) & ~0xb8;
 	if (lp->options & PCNET32_PORT_FD)
 	    val |= 0x10;
 	if (lp->options & PCNET32_PORT_100)
@@ -1427,6 +1439,7 @@ pcnet32_open(struct net_device *dev)
 	lp->a.write_bcr (ioaddr, 32, val);
     } else {
 	if (lp->options & PCNET32_PORT_ASEL) {
+	    lp->a.write_bcr(ioaddr, 32, lp->a.read_bcr(ioaddr, 32) | 0x0080);
 	    /* enable auto negotiate, setup, disable fd */
 	    val = lp->a.read_bcr(ioaddr, 32) & ~0x98;
 	    val |= 0x20;
@@ -1531,13 +1544,15 @@ pcnet32_purge_tx_ring(struct net_device *dev)
     int i;
 
     for (i = 0; i < TX_RING_SIZE; i++) {
+	lp->tx_ring[i].status = 0;	/* CPU owns buffer */
+	wmb();	/* Make sure adapter sees owner change */
 	if (lp->tx_skbuff[i]) {
 	    pci_unmap_single(lp->pci_dev, lp->tx_dma_addr[i],
 		    lp->tx_skbuff[i]->len, PCI_DMA_TODEVICE);
 	    dev_kfree_skb_any(lp->tx_skbuff[i]);
-	    lp->tx_skbuff[i] = NULL;
-	    lp->tx_dma_addr[i] = 0;
 	}
+	lp->tx_skbuff[i] = NULL;
+	lp->tx_dma_addr[i] = 0;
     }
 }
 
@@ -1566,21 +1581,23 @@ pcnet32_init_ring(struct net_device *dev)
 	    skb_reserve (rx_skbuff, 2);
 	}
 
+	rmb();
 	if (lp->rx_dma_addr[i] == 0)
 	    lp->rx_dma_addr[i] = pci_map_single(lp->pci_dev, rx_skbuff->tail,
 		    PKT_BUF_SZ-2, PCI_DMA_FROMDEVICE);
 	lp->rx_ring[i].base = (u32)le32_to_cpu(lp->rx_dma_addr[i]);
 	lp->rx_ring[i].buf_length = le16_to_cpu(2-PKT_BUF_SZ);
+	wmb();	/* Make sure owner changes after all others are visible */
 	lp->rx_ring[i].status = le16_to_cpu(0x8000);
     }
     /* The Tx buffer address is filled in as needed, but we do need to clear
      * the upper ownership bit. */
     for (i = 0; i < TX_RING_SIZE; i++) {
+	lp->tx_ring[i].status = 0;	/* CPU owns buffer */
+	wmb();	/* Make sure adapter sees owner change */
 	lp->tx_ring[i].base = 0;
-	lp->tx_ring[i].status = 0;
 	lp->tx_dma_addr[i] = 0;
     }
-    wmb(); /* Make sure all changes are visible */
 
     lp->init_block.tlen_rlen = le16_to_cpu(TX_RING_LEN_BITS | RX_RING_LEN_BITS);
     for (i = 0; i < 6; i++)
@@ -1589,9 +1606,14 @@ pcnet32_init_ring(struct net_device *dev)
 	    offsetof(struct pcnet32_private, rx_ring));
     lp->init_block.tx_ring = (u32)le32_to_cpu(lp->dma_addr +
 	    offsetof(struct pcnet32_private, tx_ring));
+    wmb();	/* Make sure all changes are visible */
     return 0;
 }
 
+/* the pcnet32 has been issued a stop or reset.  Wait for the stop bit
+ * then flush the pending transmit operations, re-initialize the ring,
+ * and tell the chip to initialize.
+ */
 static void
 pcnet32_restart(struct net_device *dev, unsigned int csr0_bits)
 {
@@ -1599,6 +1621,15 @@ pcnet32_restart(struct net_device *dev, unsigned int csr0_bits)
     unsigned long ioaddr = dev->base_addr;
     int i;
 
+    /* wait for stop */
+    for (i=0; i<100; i++)
+	if (lp->a.read_csr(ioaddr, 0) & 0x0004)
+	   break;
+
+    if (i >= 100 && netif_msg_drv(lp))
+	printk(KERN_ERR "%s: pcnet32_restart timed out waiting for stop.\n",
+		dev->name);
+
     pcnet32_purge_tx_ring(dev);
     if (pcnet32_init_ring(dev))
 	return;
@@ -1735,7 +1766,7 @@ pcnet32_interrupt(int irq, void *dev_id, struct pt_regs * regs)
     spin_lock(&lp->lock);
 
     rap = lp->a.read_rap(ioaddr);
-    while ((csr0 = lp->a.read_csr (ioaddr, 0)) & 0x8600 && --boguscnt >= 0) {
+    while ((csr0 = lp->a.read_csr (ioaddr, 0)) & 0x8f00 && --boguscnt >= 0) {
 	if (csr0 == 0xffff) {
 	    break;			/* PCMCIA remove happened */
 	}
@@ -1808,7 +1839,7 @@ pcnet32_interrupt(int irq, void *dev_id, struct pt_regs * regs)
 		    pci_unmap_single(lp->pci_dev, lp->tx_dma_addr[entry],
 			lp->tx_skbuff[entry]->len, PCI_DMA_TODEVICE);
 		    dev_kfree_skb_irq(lp->tx_skbuff[entry]);
-		    lp->tx_skbuff[entry] = 0;
+		    lp->tx_skbuff[entry] = NULL;
 		    lp->tx_dma_addr[entry] = 0;
 		}
 		dirty_tx++;
@@ -1857,15 +1888,16 @@ pcnet32_interrupt(int irq, void *dev_id, struct pt_regs * regs)
 	}
 
 	if (must_restart) {
-	    /* stop the chip to clear the error condition, then restart */
-	    lp->a.write_csr (ioaddr, 0, 0x0004);
+	    /* reset the chip to clear the error condition, then restart */
+	    lp->a.reset(ioaddr);
+	    lp->a.write_csr(ioaddr, 4, 0x0915);
 	    pcnet32_restart(dev, 0x0002);
 	    netif_wake_queue(dev);
 	}
     }
 
-    /* Clear any other interrupt, and set interrupt enable. */
-    lp->a.write_csr (ioaddr, 0, 0x7940);
+    /* Set interrupt enable. */
+    lp->a.write_csr (ioaddr, 0, 0x0040);
     lp->a.write_rap (ioaddr,rap);
 
     if (netif_msg_intr(lp))
@@ -1907,7 +1939,13 @@ pcnet32_rx(struct net_device *dev)
 	    short pkt_len = (le32_to_cpu(lp->rx_ring[entry].msg_length) & 0xfff)-4;
 	    struct sk_buff *skb;
 
-	    if (pkt_len < 60) {
+	    /* Discard oversize frames. */
+	    if (unlikely(pkt_len > PKT_BUF_SZ - 2)) {
+		if (netif_msg_drv(lp))
+		    printk(KERN_ERR "%s: Impossible packet size %d!\n",
+			    dev->name, pkt_len);
+		lp->stats.rx_errors++;
+	    } else if (pkt_len < 60) {
 		if (netif_msg_rx_err(lp))
 		    printk(KERN_ERR "%s: Runt packet!\n", dev->name);
 		lp->stats.rx_errors++;
@@ -2222,20 +2260,29 @@ static struct pci_driver pcnet32_driver = {
     .id_table	= pcnet32_pci_tbl,
 };
 
-MODULE_PARM(debug, "i");
+/* An additional parameter that may be passed in... */
+static int debug = -1;
+static int tx_start_pt = -1;
+static int pcnet32_have_pci;
+static int num_params;
+
+module_param(debug, int, 0);
 MODULE_PARM_DESC(debug, DRV_NAME " debug level");
-MODULE_PARM(max_interrupt_work, "i");
+module_param(max_interrupt_work, int, 0);
 MODULE_PARM_DESC(max_interrupt_work, DRV_NAME " maximum events handled per interrupt");
-MODULE_PARM(rx_copybreak, "i");
+module_param(rx_copybreak, int, 0);
 MODULE_PARM_DESC(rx_copybreak, DRV_NAME " copy breakpoint for copy-only-tiny-frames");
-MODULE_PARM(tx_start_pt, "i");
+module_param(tx_start_pt, int, 0);
 MODULE_PARM_DESC(tx_start_pt, DRV_NAME " transmit start point (0-3)");
-MODULE_PARM(pcnet32vlb, "i");
+module_param(pcnet32vlb, int, 0);
 MODULE_PARM_DESC(pcnet32vlb, DRV_NAME " Vesa local bus (VLB) support (0/1)");
-MODULE_PARM(options, "1-" __MODULE_STRING(MAX_UNITS) "i");
+module_param_array(options, int, num_params, 0);
 MODULE_PARM_DESC(options, DRV_NAME " initial option setting(s) (0-15)");
-MODULE_PARM(full_duplex, "1-" __MODULE_STRING(MAX_UNITS) "i");
+module_param_array(full_duplex, int, num_params, 0);
 MODULE_PARM_DESC(full_duplex, DRV_NAME " full duplex setting(s) (1)");
+/* Module Parameter for HomePNA cards added by Patrick Simmons, 2004 */
+module_param_array(homepna, int, num_params, 0);
+MODULE_PARM_DESC(homepna, DRV_NAME " mode for 79C978 cards (1 for HomePNA, 0 for Ethernet, default Ethernet");
 
 MODULE_AUTHOR("Thomas Bogendoerfer");
 MODULE_DESCRIPTION("Driver for PCnet32 and PCnetPCI based ethercards");
@@ -2243,11 +2290,6 @@ MODULE_LICENSE("GPL");
 
 #define PCNET32_MSG_DEFAULT (NETIF_MSG_DRV | NETIF_MSG_PROBE | NETIF_MSG_LINK)
 
-/* An additional parameter that may be passed in... */
-static int debug = -1;
-static int tx_start_pt = -1;
-static int pcnet32_have_pci;
-
 static int __init pcnet32_init_module(void)
 {
     printk(KERN_INFO "%s", version);
diff --git a/drivers/net/ppp_async.c b/drivers/net/ppp_async.c
index 0394ee0ad..e44b189c6 100644
--- a/drivers/net/ppp_async.c
+++ b/drivers/net/ppp_async.c
@@ -24,6 +24,7 @@
 #include <linux/tty.h>
 #include <linux/netdevice.h>
 #include <linux/poll.h>
+#include <linux/crc-ccitt.h>
 #include <linux/ppp_defs.h>
 #include <linux/if_ppp.h>
 #include <linux/ppp_channel.h>
@@ -207,7 +208,7 @@ ppp_asynctty_close(struct tty_struct *tty)
 
 	write_lock_irq(&disc_data_lock);
 	ap = tty->disc_data;
-	tty->disc_data = 0;
+	tty->disc_data = NULL;
 	write_unlock_irq(&disc_data_lock);
 	if (ap == 0)
 		return;
@@ -238,7 +239,7 @@ ppp_asynctty_close(struct tty_struct *tty)
  */
 static ssize_t
 ppp_asynctty_read(struct tty_struct *tty, struct file *file,
-		  unsigned char *buf, size_t count)
+		  unsigned char __user *buf, size_t count)
 {
 	return -EAGAIN;
 }
@@ -249,7 +250,7 @@ ppp_asynctty_read(struct tty_struct *tty, struct file *file,
  */
 static ssize_t
 ppp_asynctty_write(struct tty_struct *tty, struct file *file,
-		   const unsigned char *buf, size_t count)
+		   const unsigned char __user *buf, size_t count)
 {
 	return -EAGAIN;
 }
@@ -260,6 +261,7 @@ ppp_asynctty_ioctl(struct tty_struct *tty, struct file *file,
 {
 	struct asyncppp *ap = ap_get(tty);
 	int err, val;
+	int __user *p = (int __user *)arg;
 
 	if (ap == 0)
 		return -ENXIO;
@@ -270,7 +272,7 @@ ppp_asynctty_ioctl(struct tty_struct *tty, struct file *file,
 		if (ap == 0)
 			break;
 		err = -EFAULT;
-		if (put_user(ppp_channel_index(&ap->chan), (int *) arg))
+		if (put_user(ppp_channel_index(&ap->chan), p))
 			break;
 		err = 0;
 		break;
@@ -280,7 +282,7 @@ ppp_asynctty_ioctl(struct tty_struct *tty, struct file *file,
 		if (ap == 0)
 			break;
 		err = -EFAULT;
-		if (put_user(ppp_unit_number(&ap->chan), (int *) arg))
+		if (put_user(ppp_unit_number(&ap->chan), p))
 			break;
 		err = 0;
 		break;
@@ -299,7 +301,7 @@ ppp_asynctty_ioctl(struct tty_struct *tty, struct file *file,
 
 	case FIONREAD:
 		val = 0;
-		if (put_user(val, (int *) arg))
+		if (put_user(val, p))
 			break;
 		err = 0;
 		break;
@@ -397,6 +399,8 @@ static int
 ppp_async_ioctl(struct ppp_channel *chan, unsigned int cmd, unsigned long arg)
 {
 	struct asyncppp *ap = chan->private;
+	void __user *argp = (void __user *)arg;
+	int __user *p = argp;
 	int err, val;
 	u32 accm[8];
 
@@ -404,12 +408,12 @@ ppp_async_ioctl(struct ppp_channel *chan, unsigned int cmd, unsigned long arg)
 	switch (cmd) {
 	case PPPIOCGFLAGS:
 		val = ap->flags | ap->rbits;
-		if (put_user(val, (int *) arg))
+		if (put_user(val, p))
 			break;
 		err = 0;
 		break;
 	case PPPIOCSFLAGS:
-		if (get_user(val, (int *) arg))
+		if (get_user(val, p))
 			break;
 		ap->flags = val & ~SC_RCV_BITS;
 		spin_lock_irq(&ap->recv_lock);
@@ -419,34 +423,34 @@ ppp_async_ioctl(struct ppp_channel *chan, unsigned int cmd, unsigned long arg)
 		break;
 
 	case PPPIOCGASYNCMAP:
-		if (put_user(ap->xaccm[0], (u32 *) arg))
+		if (put_user(ap->xaccm[0], (u32 __user *)argp))
 			break;
 		err = 0;
 		break;
 	case PPPIOCSASYNCMAP:
-		if (get_user(ap->xaccm[0], (u32 *) arg))
+		if (get_user(ap->xaccm[0], (u32 __user *)argp))
 			break;
 		err = 0;
 		break;
 
 	case PPPIOCGRASYNCMAP:
-		if (put_user(ap->raccm, (u32 *) arg))
+		if (put_user(ap->raccm, (u32 __user *)argp))
 			break;
 		err = 0;
 		break;
 	case PPPIOCSRASYNCMAP:
-		if (get_user(ap->raccm, (u32 *) arg))
+		if (get_user(ap->raccm, (u32 __user *)argp))
 			break;
 		err = 0;
 		break;
 
 	case PPPIOCGXASYNCMAP:
-		if (copy_to_user((void __user *) arg, ap->xaccm, sizeof(ap->xaccm)))
+		if (copy_to_user(argp, ap->xaccm, sizeof(ap->xaccm)))
 			break;
 		err = 0;
 		break;
 	case PPPIOCSXASYNCMAP:
-		if (copy_from_user(accm, (void __user *) arg, sizeof(accm)))
+		if (copy_from_user(accm, argp, sizeof(accm)))
 			break;
 		accm[2] &= ~0x40000000U;	/* can't escape 0x5e */
 		accm[3] |= 0x60000000U;		/* must escape 0x7d, 0x7e */
@@ -455,12 +459,12 @@ ppp_async_ioctl(struct ppp_channel *chan, unsigned int cmd, unsigned long arg)
 		break;
 
 	case PPPIOCGMRU:
-		if (put_user(ap->mru, (int *) arg))
+		if (put_user(ap->mru, p))
 			break;
 		err = 0;
 		break;
 	case PPPIOCSMRU:
-		if (get_user(val, (int *) arg))
+		if (get_user(val, p))
 			break;
 		if (val < PPP_MRU)
 			val = PPP_MRU;
@@ -501,43 +505,6 @@ static void ppp_async_process(unsigned long arg)
  * Procedures for encapsulation and framing.
  */
 
-u16 ppp_crc16_table[256] = {
-	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
-};
-EXPORT_SYMBOL(ppp_crc16_table);
-#define fcstab	ppp_crc16_table		/* for PPP_FCS macro */
-
 /*
  * Procedure to encode the data for async serial transmission.
  * Does octet stuffing (escaping), puts the address/control bytes
@@ -639,7 +606,7 @@ ppp_async_encode(struct asyncppp *ap)
 	ap->olim = buf;
 
 	kfree_skb(ap->tpkt);
-	ap->tpkt = 0;
+	ap->tpkt = NULL;
 	return 1;
 }
 
@@ -738,7 +705,7 @@ flush:
 	clear_bit(XMIT_BUSY, &ap->xmit_flags);
 	if (ap->tpkt != 0) {
 		kfree_skb(ap->tpkt);
-		ap->tpkt = 0;
+		ap->tpkt = NULL;
 		clear_bit(XMIT_FULL, &ap->xmit_flags);
 		done = 1;
 	}
@@ -760,7 +727,7 @@ ppp_async_flush_output(struct asyncppp *ap)
 	ap->optr = ap->olim;
 	if (ap->tpkt != NULL) {
 		kfree_skb(ap->tpkt);
-		ap->tpkt = 0;
+		ap->tpkt = NULL;
 		clear_bit(XMIT_FULL, &ap->xmit_flags);
 		done = 1;
 	}
@@ -838,7 +805,7 @@ process_input_packet(struct asyncppp *ap)
 	/* queue the frame to be processed */
 	skb->cb[0] = ap->state;
 	skb_queue_tail(&ap->rqueue, skb);
-	ap->rpkt = 0;
+	ap->rpkt = NULL;
 	ap->state = 0;
 	return;
 
diff --git a/drivers/net/ppp_generic.c b/drivers/net/ppp_generic.c
index ffd5ac3a8..651601105 100644
--- a/drivers/net/ppp_generic.c
+++ b/drivers/net/ppp_generic.c
@@ -129,8 +129,9 @@ struct ppp {
 #endif /* CONFIG_PPP_MULTILINK */
 	struct net_device_stats stats;	/* statistics */
 #ifdef CONFIG_PPP_FILTER
-	struct sock_fprog pass_filter;	/* filter for packets to pass */
-	struct sock_fprog active_filter;/* filter for pkts to reset idle */
+	struct sock_filter *pass_filter;	/* filter for packets to pass */
+	struct sock_filter *active_filter;/* filter for pkts to reset idle */
+	unsigned pass_len, active_len;
 #endif /* CONFIG_PPP_FILTER */
 };
 
@@ -370,7 +371,7 @@ static int ppp_release(struct inode *inode, struct file *file)
 	struct ppp *ppp;
 
 	if (pf != 0) {
-		file->private_data = 0;
+		file->private_data = NULL;
 		if (pf->kind == INTERFACE) {
 			ppp = PF_TO_PPP(pf);
 			if (file == ppp->owner)
@@ -396,7 +397,7 @@ static ssize_t ppp_read(struct file *file, char __user *buf,
 	struct ppp_file *pf = file->private_data;
 	DECLARE_WAITQUEUE(wait, current);
 	ssize_t ret;
-	struct sk_buff *skb = 0;
+	struct sk_buff *skb = NULL;
 
 	ret = count;
 
@@ -493,6 +494,45 @@ static unsigned int ppp_poll(struct file *file, poll_table *wait)
 	return mask;
 }
 
+#ifdef CONFIG_PPP_FILTER
+static int get_filter(void __user *arg, struct sock_filter **p)
+{
+	struct sock_fprog uprog;
+	struct sock_filter *code = NULL;
+	int len, err;
+
+	if (copy_from_user(&uprog, arg, sizeof(uprog)))
+		return -EFAULT;
+
+	if (uprog.len > BPF_MAXINSNS)
+		return -EINVAL;
+
+	if (!uprog.len) {
+		*p = NULL;
+		return 0;
+	}
+
+	len = uprog.len * sizeof(struct sock_filter);
+	code = kmalloc(len, GFP_KERNEL);
+	if (code == NULL)
+		return -ENOMEM;
+
+	if (copy_from_user(code, uprog.filter, len)) {
+		kfree(code);
+		return -EFAULT;
+	}
+
+	err = sk_chk_filter(code, uprog.len);
+	if (err) {
+		kfree(code);
+		return err;
+	}
+
+	*p = code;
+	return uprog.len;
+}
+#endif /* CONFIG_PPP_FILTER */
+
 static int ppp_ioctl(struct inode *inode, struct file *file,
 		     unsigned int cmd, unsigned long arg)
 {
@@ -503,6 +543,8 @@ static int ppp_ioctl(struct inode *inode, struct file *file,
 	struct npioctl npi;
 	int unit, cflags;
 	struct slcompress *vj;
+	void __user *argp = (void __user *)arg;
+	int __user *p = argp;
 
 	if (pf == 0)
 		return ppp_unattached_ioctl(pf, file, cmd, arg);
@@ -540,7 +582,7 @@ static int ppp_ioctl(struct inode *inode, struct file *file,
 
 		switch (cmd) {
 		case PPPIOCCONNECT:
-			if (get_user(unit, (int *) arg))
+			if (get_user(unit, p))
 				break;
 			err = ppp_connect_channel(pch, unit);
 			break;
@@ -569,14 +611,14 @@ static int ppp_ioctl(struct inode *inode, struct file *file,
 	ppp = PF_TO_PPP(pf);
 	switch (cmd) {
 	case PPPIOCSMRU:
-		if (get_user(val, (int *) arg))
+		if (get_user(val, p))
 			break;
 		ppp->mru = val;
 		err = 0;
 		break;
 
 	case PPPIOCSFLAGS:
-		if (get_user(val, (int *) arg))
+		if (get_user(val, p))
 			break;
 		ppp_lock(ppp);
 		cflags = ppp->flags & ~val;
@@ -589,7 +631,7 @@ static int ppp_ioctl(struct inode *inode, struct file *file,
 
 	case PPPIOCGFLAGS:
 		val = ppp->flags | ppp->xstate | ppp->rstate;
-		if (put_user(val, (int *) arg))
+		if (put_user(val, p))
 			break;
 		err = 0;
 		break;
@@ -599,20 +641,20 @@ static int ppp_ioctl(struct inode *inode, struct file *file,
 		break;
 
 	case PPPIOCGUNIT:
-		if (put_user(ppp->file.index, (int *) arg))
+		if (put_user(ppp->file.index, p))
 			break;
 		err = 0;
 		break;
 
 	case PPPIOCSDEBUG:
-		if (get_user(val, (int *) arg))
+		if (get_user(val, p))
 			break;
 		ppp->debug = val;
 		err = 0;
 		break;
 
 	case PPPIOCGDEBUG:
-		if (put_user(ppp->debug, (int *) arg))
+		if (put_user(ppp->debug, p))
 			break;
 		err = 0;
 		break;
@@ -620,13 +662,13 @@ static int ppp_ioctl(struct inode *inode, struct file *file,
 	case PPPIOCGIDLE:
 		idle.xmit_idle = (jiffies - ppp->last_xmit) / HZ;
 		idle.recv_idle = (jiffies - ppp->last_recv) / HZ;
-		if (copy_to_user((void __user *) arg, &idle, sizeof(idle)))
+		if (copy_to_user(argp, &idle, sizeof(idle)))
 			break;
 		err = 0;
 		break;
 
 	case PPPIOCSMAXCID:
-		if (get_user(val, (int *) arg))
+		if (get_user(val, p))
 			break;
 		val2 = 15;
 		if ((val >> 16) != 0) {
@@ -649,7 +691,7 @@ static int ppp_ioctl(struct inode *inode, struct file *file,
 
 	case PPPIOCGNPMODE:
 	case PPPIOCSNPMODE:
-		if (copy_from_user(&npi, (void __user *) arg, sizeof(npi)))
+		if (copy_from_user(&npi, argp, sizeof(npi)))
 			break;
 		err = proto_to_npindex(npi.protocol);
 		if (err < 0)
@@ -658,7 +700,7 @@ static int ppp_ioctl(struct inode *inode, struct file *file,
 		if (cmd == PPPIOCGNPMODE) {
 			err = -EFAULT;
 			npi.mode = ppp->npmode[i];
-			if (copy_to_user((void __user *) arg, &npi, sizeof(npi)))
+			if (copy_to_user(argp, &npi, sizeof(npi)))
 				break;
 		} else {
 			ppp->npmode[i] = npi.mode;
@@ -670,49 +712,38 @@ static int ppp_ioctl(struct inode *inode, struct file *file,
 
 #ifdef CONFIG_PPP_FILTER
 	case PPPIOCSPASS:
+	{
+		struct sock_filter *code;
+		err = get_filter(argp, &code);
+		if (err >= 0) {
+			ppp_lock(ppp);
+			kfree(ppp->pass_filter);
+			ppp->pass_filter = code;
+			ppp->pass_len = err;
+			ppp_unlock(ppp);
+			err = 0;
+		}
+		break;
+	}
 	case PPPIOCSACTIVE:
 	{
-		struct sock_fprog uprog, *filtp;
-		struct sock_filter *code = NULL;
-		int len;
-
-		if (copy_from_user(&uprog, (void __user *) arg, sizeof(uprog)))
-			break;
-		err = -EINVAL;
-		if (uprog.len > BPF_MAXINSNS)
-			break;
-		err = -ENOMEM;
-		if (uprog.len > 0) {
-			len = uprog.len * sizeof(struct sock_filter);
-			code = kmalloc(len, GFP_KERNEL);
-			if (code == NULL)
-				break;
-			err = -EFAULT;
-			if (copy_from_user(code, (void __user *) uprog.filter, len)) {
-				kfree(code);
-				break;
-			}
-			err = sk_chk_filter(code, uprog.len);
-			if (err) {
-				kfree(code);
-				break;
-			}
+		struct sock_filter *code;
+		err = get_filter(argp, &code);
+		if (err >= 0) {
+			ppp_lock(ppp);
+			kfree(ppp->active_filter);
+			ppp->active_filter = code;
+			ppp->active_len = err;
+			ppp_unlock(ppp);
+			err = 0;
 		}
-		filtp = (cmd == PPPIOCSPASS)? &ppp->pass_filter: &ppp->active_filter;
-		ppp_lock(ppp);
-		if (filtp->filter)
-			kfree(filtp->filter);
-		filtp->filter = code;
-		filtp->len = uprog.len;
-		ppp_unlock(ppp);
-		err = 0;
 		break;
 	}
 #endif /* CONFIG_PPP_FILTER */
 
 #ifdef CONFIG_PPP_MULTILINK
 	case PPPIOCSMRRU:
-		if (get_user(val, (int *) arg))
+		if (get_user(val, p))
 			break;
 		ppp_recv_lock(ppp);
 		ppp->mrru = val;
@@ -734,11 +765,12 @@ static int ppp_unattached_ioctl(struct ppp_file *pf, struct file *file,
 	int unit, err = -EFAULT;
 	struct ppp *ppp;
 	struct channel *chan;
+	int __user *p = (int __user *)arg;
 
 	switch (cmd) {
 	case PPPIOCNEWUNIT:
 		/* Create a new ppp unit */
-		if (get_user(unit, (int *) arg))
+		if (get_user(unit, p))
 			break;
 		ppp = ppp_create_interface(unit, &err);
 		if (ppp == 0)
@@ -746,14 +778,14 @@ static int ppp_unattached_ioctl(struct ppp_file *pf, struct file *file,
 		file->private_data = &ppp->file;
 		ppp->owner = file;
 		err = -EFAULT;
-		if (put_user(ppp->file.index, (int *) arg))
+		if (put_user(ppp->file.index, p))
 			break;
 		err = 0;
 		break;
 
 	case PPPIOCATTACH:
 		/* Attach to an existing ppp unit */
-		if (get_user(unit, (int *) arg))
+		if (get_user(unit, p))
 			break;
 		down(&all_ppp_sem);
 		err = -ENXIO;
@@ -767,7 +799,7 @@ static int ppp_unattached_ioctl(struct ppp_file *pf, struct file *file,
 		break;
 
 	case PPPIOCATTCHAN:
-		if (get_user(unit, (int *) arg))
+		if (get_user(unit, p))
 			break;
 		spin_lock_bh(&all_channels_lock);
 		err = -ENXIO;
@@ -994,23 +1026,19 @@ ppp_send_frame(struct ppp *ppp, struct sk_buff *skb)
 		/* check if we should pass this packet */
 		/* the filter instructions are constructed assuming
 		   a four-byte PPP header on each packet */
-		{
-			u_int16_t *p = (u_int16_t *) skb_push(skb, 2);
-
-			*p = htons(4); /* indicate outbound in DLT_LINUX_SLL */;
-		}
-		if (ppp->pass_filter.filter
-		    && sk_run_filter(skb, ppp->pass_filter.filter,
-				     ppp->pass_filter.len) == 0) {
+		*skb_push(skb, 2) = 1;
+		if (ppp->pass_filter
+		    && sk_run_filter(skb, ppp->pass_filter,
+				     ppp->pass_len) == 0) {
 			if (ppp->debug & 1)
 				printk(KERN_DEBUG "PPP: outbound frame not passed\n");
 			kfree_skb(skb);
 			return;
 		}
 		/* if this packet passes the active filter, record the time */
-		if (!(ppp->active_filter.filter
-		      && sk_run_filter(skb, ppp->active_filter.filter,
-				       ppp->active_filter.len) == 0))
+		if (!(ppp->active_filter
+		      && sk_run_filter(skb, ppp->active_filter,
+				       ppp->active_len) == 0))
 			ppp->last_xmit = jiffies;
 		skb_pull(skb, 2);
 #else
@@ -1129,7 +1157,7 @@ ppp_push(struct ppp *ppp)
 	list = &ppp->channels;
 	if (list_empty(list)) {
 		/* nowhere to send the packet, just drop it */
-		ppp->xmit_pending = 0;
+		ppp->xmit_pending = NULL;
 		kfree_skb(skb);
 		return;
 	}
@@ -1142,11 +1170,11 @@ ppp_push(struct ppp *ppp)
 		spin_lock_bh(&pch->downl);
 		if (pch->chan) {
 			if (pch->chan->ops->start_xmit(pch->chan, skb))
-				ppp->xmit_pending = 0;
+				ppp->xmit_pending = NULL;
 		} else {
 			/* channel got unregistered */
 			kfree_skb(skb);
-			ppp->xmit_pending = 0;
+			ppp->xmit_pending = NULL;
 		}
 		spin_unlock_bh(&pch->downl);
 		return;
@@ -1159,7 +1187,7 @@ ppp_push(struct ppp *ppp)
 		return;
 #endif /* CONFIG_PPP_MULTILINK */
 
-	ppp->xmit_pending = 0;
+	ppp->xmit_pending = NULL;
 	kfree_skb(skb);
 }
 
@@ -1541,22 +1569,18 @@ ppp_receive_nonmp_frame(struct ppp *ppp, struct sk_buff *skb)
 		/* check if the packet passes the pass and active filters */
 		/* the filter instructions are constructed assuming
 		   a four-byte PPP header on each packet */
-		{
-			u_int16_t *p = (u_int16_t *) skb_push(skb, 2);
-
-			*p = 0; /* indicate inbound in DLT_LINUX_SLL */
-		}
-		if (ppp->pass_filter.filter
-		    && sk_run_filter(skb, ppp->pass_filter.filter,
-				     ppp->pass_filter.len) == 0) {
+		*skb_push(skb, 2) = 0;
+		if (ppp->pass_filter
+		    && sk_run_filter(skb, ppp->pass_filter,
+				     ppp->pass_len) == 0) {
 			if (ppp->debug & 1)
 				printk(KERN_DEBUG "PPP: inbound frame not passed\n");
 			kfree_skb(skb);
 			return;
 		}
-		if (!(ppp->active_filter.filter
-		      && sk_run_filter(skb, ppp->active_filter.filter,
-				       ppp->active_filter.len) == 0))
+		if (!(ppp->active_filter
+		      && sk_run_filter(skb, ppp->active_filter,
+				       ppp->active_len) == 0))
 			ppp->last_recv = jiffies;
 		skb_pull(skb, 2);
 #else
@@ -1944,7 +1968,7 @@ ppp_unregister_channel(struct ppp_channel *chan)
 
 	if (pch == 0)
 		return;		/* should never happen */
-	chan->ppp = 0;
+	chan->ppp = NULL;
 
 	/*
 	 * This ensures that we have returned from any calls into the
@@ -1952,7 +1976,7 @@ ppp_unregister_channel(struct ppp_channel *chan)
 	 */
 	down_write(&pch->chan_sem);
 	spin_lock_bh(&pch->downl);
-	pch->chan = 0;
+	pch->chan = NULL;
 	spin_unlock_bh(&pch->downl);
 	up_write(&pch->chan_sem);
 	ppp_disconnect_channel(pch);
@@ -2155,11 +2179,11 @@ ppp_ccp_closed(struct ppp *ppp)
 	ppp->xstate = 0;
 	xcomp = ppp->xcomp;
 	xstate = ppp->xc_state;
-	ppp->xc_state = 0;
+	ppp->xc_state = NULL;
 	ppp->rstate = 0;
 	rcomp = ppp->rcomp;
 	rstate = ppp->rc_state;
-	ppp->rc_state = 0;
+	ppp->rc_state = NULL;
 	ppp_unlock(ppp);
 
 	if (xstate) {
@@ -2192,7 +2216,7 @@ find_comp_entry(int proto)
 		if (ce->comp->compress_proto == proto)
 			return ce;
 	}
-	return 0;
+	return NULL;
 }
 
 /* Register a compressor */
@@ -2237,7 +2261,7 @@ static struct compressor *
 find_compressor(int type)
 {
 	struct compressor_entry *ce;
-	struct compressor *cp = 0;
+	struct compressor *cp = NULL;
 
 	spin_lock(&compressor_list_lock);
 	ce = find_comp_entry(type);
@@ -2381,7 +2405,7 @@ static void ppp_shutdown_interface(struct ppp *ppp)
 	down(&all_ppp_sem);
 	ppp_lock(ppp);
 	dev = ppp->dev;
-	ppp->dev = 0;
+	ppp->dev = NULL;
 	ppp_unlock(ppp);
 	/* This will call dev_close() for us. */
 	if (dev) {
@@ -2415,7 +2439,7 @@ static void ppp_destroy_interface(struct ppp *ppp)
 	ppp_ccp_closed(ppp);
 	if (ppp->vj) {
 		slhc_free(ppp->vj);
-		ppp->vj = 0;
+		ppp->vj = NULL;
 	}
 	skb_queue_purge(&ppp->file.xq);
 	skb_queue_purge(&ppp->file.rq);
@@ -2423,13 +2447,13 @@ static void ppp_destroy_interface(struct ppp *ppp)
 	skb_queue_purge(&ppp->mrq);
 #endif /* CONFIG_PPP_MULTILINK */
 #ifdef CONFIG_PPP_FILTER
-	if (ppp->pass_filter.filter) {
-		kfree(ppp->pass_filter.filter);
-		ppp->pass_filter.filter = NULL;
+	if (ppp->pass_filter) {
+		kfree(ppp->pass_filter);
+		ppp->pass_filter = NULL;
 	}
-	if (ppp->active_filter.filter) {
-		kfree(ppp->active_filter.filter);
-		ppp->active_filter.filter = 0;
+	if (ppp->active_filter) {
+		kfree(ppp->active_filter);
+		ppp->active_filter = NULL;
 	}
 #endif /* CONFIG_PPP_FILTER */
 
@@ -2475,7 +2499,7 @@ ppp_find_channel(int unit)
 		if (pch->file.index == unit)
 			return pch;
 	}
-	return 0;
+	return NULL;
 }
 
 /*
diff --git a/drivers/net/ppp_synctty.c b/drivers/net/ppp_synctty.c
index 0e1e057a8..a8f890858 100644
--- a/drivers/net/ppp_synctty.c
+++ b/drivers/net/ppp_synctty.c
@@ -29,7 +29,7 @@
  * PPP driver, written by Michael Callahan and Al Longyear, and
  * subsequently hacked by Paul Mackerras.
  *
- * ==FILEVERSION 20020125==
+ * ==FILEVERSION 20040616==
  */
 
 #include <linux/module.h>
@@ -65,7 +65,9 @@ struct syncppp {
 	struct sk_buff	*tpkt;
 	unsigned long	last_xmit;
 
-	struct sk_buff	*rpkt;
+	struct sk_buff_head rqueue;
+
+	struct tasklet_struct tsk;
 
 	atomic_t	refcnt;
 	struct semaphore dead_sem;
@@ -88,6 +90,7 @@ static struct sk_buff* ppp_sync_txmunge(struct syncppp *ap, struct sk_buff *);
 static int ppp_sync_send(struct ppp_channel *chan, struct sk_buff *skb);
 static int ppp_sync_ioctl(struct ppp_channel *chan, unsigned int cmd,
 			  unsigned long arg);
+static void ppp_sync_process(unsigned long arg);
 static int ppp_sync_push(struct syncppp *ap);
 static void ppp_sync_flush_output(struct syncppp *ap);
 static void ppp_sync_input(struct syncppp *ap, const unsigned char *buf,
@@ -217,6 +220,9 @@ ppp_sync_open(struct tty_struct *tty)
 	ap->xaccm[3] = 0x60000000U;
 	ap->raccm = ~0U;
 
+	skb_queue_head_init(&ap->rqueue);
+	tasklet_init(&ap->tsk, ppp_sync_process, (unsigned long) ap);
+
 	atomic_set(&ap->refcnt, 1);
 	init_MUTEX_LOCKED(&ap->dead_sem);
 
@@ -253,7 +259,7 @@ ppp_sync_close(struct tty_struct *tty)
 
 	write_lock_irq(&disc_data_lock);
 	ap = tty->disc_data;
-	tty->disc_data = 0;
+	tty->disc_data = NULL;
 	write_unlock_irq(&disc_data_lock);
 	if (ap == 0)
 		return;
@@ -267,10 +273,10 @@ ppp_sync_close(struct tty_struct *tty)
 	 */
 	if (!atomic_dec_and_test(&ap->refcnt))
 		down(&ap->dead_sem);
+	tasklet_kill(&ap->tsk);
 
 	ppp_unregister_channel(&ap->chan);
-	if (ap->rpkt != 0)
-		kfree_skb(ap->rpkt);
+	skb_queue_purge(&ap->rqueue);
 	if (ap->tpkt != 0)
 		kfree_skb(ap->tpkt);
 	kfree(ap);
@@ -282,7 +288,7 @@ ppp_sync_close(struct tty_struct *tty)
  */
 static ssize_t
 ppp_sync_read(struct tty_struct *tty, struct file *file,
-	       unsigned char *buf, size_t count)
+	       unsigned char __user *buf, size_t count)
 {
 	return -EAGAIN;
 }
@@ -293,7 +299,7 @@ ppp_sync_read(struct tty_struct *tty, struct file *file,
  */
 static ssize_t
 ppp_sync_write(struct tty_struct *tty, struct file *file,
-		const unsigned char *buf, size_t count)
+		const unsigned char __user *buf, size_t count)
 {
 	return -EAGAIN;
 }
@@ -303,6 +309,7 @@ ppp_synctty_ioctl(struct tty_struct *tty, struct file *file,
 		  unsigned int cmd, unsigned long arg)
 {
 	struct syncppp *ap = sp_get(tty);
+	int __user *p = (int __user *)arg;
 	int err, val;
 
 	if (ap == 0)
@@ -314,7 +321,7 @@ ppp_synctty_ioctl(struct tty_struct *tty, struct file *file,
 		if (ap == 0)
 			break;
 		err = -EFAULT;
-		if (put_user(ppp_channel_index(&ap->chan), (int *) arg))
+		if (put_user(ppp_channel_index(&ap->chan), p))
 			break;
 		err = 0;
 		break;
@@ -324,7 +331,7 @@ ppp_synctty_ioctl(struct tty_struct *tty, struct file *file,
 		if (ap == 0)
 			break;
 		err = -EFAULT;
-		if (put_user(ppp_unit_number(&ap->chan), (int *) arg))
+		if (put_user(ppp_unit_number(&ap->chan), p))
 			break;
 		err = 0;
 		break;
@@ -343,7 +350,7 @@ ppp_synctty_ioctl(struct tty_struct *tty, struct file *file,
 
 	case FIONREAD:
 		val = 0;
-		if (put_user(val, (int *) arg))
+		if (put_user(val, p))
 			break;
 		err = 0;
 		break;
@@ -369,17 +376,24 @@ ppp_sync_room(struct tty_struct *tty)
 	return 65535;
 }
 
+/*
+ * This can now be called from hard interrupt level as well
+ * as soft interrupt level or mainline.
+ */
 static void
 ppp_sync_receive(struct tty_struct *tty, const unsigned char *buf,
-		  char *flags, int count)
+		  char *cflags, int count)
 {
 	struct syncppp *ap = sp_get(tty);
+	unsigned long flags;
 
 	if (ap == 0)
 		return;
-	spin_lock_bh(&ap->recv_lock);
-	ppp_sync_input(ap, buf, flags, count);
-	spin_unlock_bh(&ap->recv_lock);
+	spin_lock_irqsave(&ap->recv_lock, flags);
+	ppp_sync_input(ap, buf, cflags, count);
+	spin_unlock_irqrestore(&ap->recv_lock, flags);
+	if (skb_queue_len(&ap->rqueue))
+		tasklet_schedule(&ap->tsk);
 	sp_put(ap);
 	if (test_and_clear_bit(TTY_THROTTLED, &tty->flags)
 	    && tty->driver->unthrottle)
@@ -394,8 +408,8 @@ ppp_sync_wakeup(struct tty_struct *tty)
 	clear_bit(TTY_DO_WRITE_WAKEUP, &tty->flags);
 	if (ap == 0)
 		return;
-	if (ppp_sync_push(ap))
-		ppp_output_wakeup(&ap->chan);
+	set_bit(XMIT_WAKEUP, &ap->xmit_flags);
+	tasklet_schedule(&ap->tsk);
 	sp_put(ap);
 }
 
@@ -436,54 +450,56 @@ ppp_sync_ioctl(struct ppp_channel *chan, unsigned int cmd, unsigned long arg)
 	struct syncppp *ap = chan->private;
 	int err, val;
 	u32 accm[8];
+	void __user *argp = (void __user *)arg;
+	u32 __user *p = argp;
 
 	err = -EFAULT;
 	switch (cmd) {
 	case PPPIOCGFLAGS:
 		val = ap->flags | ap->rbits;
-		if (put_user(val, (int *) arg))
+		if (put_user(val, (int __user *) argp))
 			break;
 		err = 0;
 		break;
 	case PPPIOCSFLAGS:
-		if (get_user(val, (int *) arg))
+		if (get_user(val, (int __user *) argp))
 			break;
 		ap->flags = val & ~SC_RCV_BITS;
-		spin_lock_bh(&ap->recv_lock);
+		spin_lock_irq(&ap->recv_lock);
 		ap->rbits = val & SC_RCV_BITS;
-		spin_unlock_bh(&ap->recv_lock);
+		spin_unlock_irq(&ap->recv_lock);
 		err = 0;
 		break;
 
 	case PPPIOCGASYNCMAP:
-		if (put_user(ap->xaccm[0], (u32 *) arg))
+		if (put_user(ap->xaccm[0], p))
 			break;
 		err = 0;
 		break;
 	case PPPIOCSASYNCMAP:
-		if (get_user(ap->xaccm[0], (u32 *) arg))
+		if (get_user(ap->xaccm[0], p))
 			break;
 		err = 0;
 		break;
 
 	case PPPIOCGRASYNCMAP:
-		if (put_user(ap->raccm, (u32 *) arg))
+		if (put_user(ap->raccm, p))
 			break;
 		err = 0;
 		break;
 	case PPPIOCSRASYNCMAP:
-		if (get_user(ap->raccm, (u32 *) arg))
+		if (get_user(ap->raccm, p))
 			break;
 		err = 0;
 		break;
 
 	case PPPIOCGXASYNCMAP:
-		if (copy_to_user((void *) arg, ap->xaccm, sizeof(ap->xaccm)))
+		if (copy_to_user(argp, ap->xaccm, sizeof(ap->xaccm)))
 			break;
 		err = 0;
 		break;
 	case PPPIOCSXASYNCMAP:
-		if (copy_from_user(accm, (void *) arg, sizeof(accm)))
+		if (copy_from_user(accm, argp, sizeof(accm)))
 			break;
 		accm[2] &= ~0x40000000U;	/* can't escape 0x5e */
 		accm[3] |= 0x60000000U;		/* must escape 0x7d, 0x7e */
@@ -492,12 +508,12 @@ ppp_sync_ioctl(struct ppp_channel *chan, unsigned int cmd, unsigned long arg)
 		break;
 
 	case PPPIOCGMRU:
-		if (put_user(ap->mru, (int *) arg))
+		if (put_user(ap->mru, (int __user *) argp))
 			break;
 		err = 0;
 		break;
 	case PPPIOCSMRU:
-		if (get_user(val, (int *) arg))
+		if (get_user(val, (int __user *) argp))
 			break;
 		if (val < PPP_MRU)
 			val = PPP_MRU;
@@ -511,6 +527,32 @@ ppp_sync_ioctl(struct ppp_channel *chan, unsigned int cmd, unsigned long arg)
 	return err;
 }
 
+/*
+ * This is called at softirq level to deliver received packets
+ * to the ppp_generic code, and to tell the ppp_generic code
+ * if we can accept more output now.
+ */
+static void ppp_sync_process(unsigned long arg)
+{
+	struct syncppp *ap = (struct syncppp *) arg;
+	struct sk_buff *skb;
+
+	/* process received packets */
+	while ((skb = skb_dequeue(&ap->rqueue)) != NULL) {
+		if (skb->len == 0) {
+			/* zero length buffers indicate error */
+			ppp_input_error(&ap->chan, 0);
+			kfree_skb(skb);
+		}
+		else
+			ppp_input(&ap->chan, skb);
+	}
+
+	/* try to push more stuff out */
+	if (test_bit(XMIT_WAKEUP, &ap->xmit_flags) && ppp_sync_push(ap))
+		ppp_output_wakeup(&ap->chan);
+}
+
 /*
  * Procedures for encapsulation and framing.
  */
@@ -600,7 +642,6 @@ ppp_sync_push(struct syncppp *ap)
 	struct tty_struct *tty = ap->tty;
 	int tty_stuffed = 0;
 
-	set_bit(XMIT_WAKEUP, &ap->xmit_flags);
 	if (!spin_trylock_bh(&ap->xmit_lock))
 		return 0;
 	for (;;) {
@@ -615,7 +656,7 @@ ppp_sync_push(struct syncppp *ap)
 				tty_stuffed = 1;
 			} else {
 				kfree_skb(ap->tpkt);
-				ap->tpkt = 0;
+				ap->tpkt = NULL;
 				clear_bit(XMIT_FULL, &ap->xmit_flags);
 				done = 1;
 			}
@@ -634,7 +675,7 @@ ppp_sync_push(struct syncppp *ap)
 flush:
 	if (ap->tpkt != 0) {
 		kfree_skb(ap->tpkt);
-		ap->tpkt = 0;
+		ap->tpkt = NULL;
 		clear_bit(XMIT_FULL, &ap->xmit_flags);
 		done = 1;
 	}
@@ -654,7 +695,7 @@ ppp_sync_flush_output(struct syncppp *ap)
 	spin_lock_bh(&ap->xmit_lock);
 	if (ap->tpkt != NULL) {
 		kfree_skb(ap->tpkt);
-		ap->tpkt = 0;
+		ap->tpkt = NULL;
 		clear_bit(XMIT_FULL, &ap->xmit_flags);
 		done = 1;
 	}
@@ -667,15 +708,44 @@ ppp_sync_flush_output(struct syncppp *ap)
  * Receive-side routines.
  */
 
-static inline void
-process_input_packet(struct syncppp *ap)
+/* called when the tty driver has data for us.
+ *
+ * Data is frame oriented: each call to ppp_sync_input is considered
+ * a whole frame. If the 1st flag byte is non-zero then the whole
+ * frame is considered to be in error and is tossed.
+ */
+static void
+ppp_sync_input(struct syncppp *ap, const unsigned char *buf,
+		char *flags, int count)
 {
 	struct sk_buff *skb;
 	unsigned char *p;
-	int code = 0;
 
-	skb = ap->rpkt;
-	ap->rpkt = 0;
+	if (count == 0)
+		return;
+
+	if (ap->flags & SC_LOG_INPKT)
+		ppp_print_buffer ("receive buffer", buf, count);
+
+	/* stuff the chars in the skb */
+	if ((skb = dev_alloc_skb(ap->mru + PPP_HDRLEN + 2)) == 0) {
+		printk(KERN_ERR "PPPsync: no memory (input pkt)\n");
+		goto err;
+	}
+	/* Try to get the payload 4-byte aligned */
+	if (buf[0] != PPP_ALLSTATIONS)
+		skb_reserve(skb, 2 + (buf[0] & 1));
+
+	if (flags != 0 && *flags) {
+		/* error flag set, ignore frame */
+		goto err;
+	} else if (count > skb_tailroom(skb)) {
+		/* packet overflowed MRU */
+		goto err;
+	}
+
+	p = skb_put(skb, count);
+	memcpy(p, buf, count);
 
 	/* strip address/control field if present */
 	p = skb->data;
@@ -693,59 +763,15 @@ process_input_packet(struct syncppp *ap)
 	} else if (skb->len < 2)
 		goto err;
 
-	/* pass to generic layer */
-	ppp_input(&ap->chan, skb);
+	/* queue the frame to be processed */
+	skb_queue_tail(&ap->rqueue, skb);
 	return;
 
- err:
-	kfree_skb(skb);
-	ppp_input_error(&ap->chan, code);
-}
-
-/* called when the tty driver has data for us. 
- *
- * Data is frame oriented: each call to ppp_sync_input is considered
- * a whole frame. If the 1st flag byte is non-zero then the whole
- * frame is considered to be in error and is tossed.
- */
-static void
-ppp_sync_input(struct syncppp *ap, const unsigned char *buf,
-		char *flags, int count)
-{
-	struct sk_buff *skb;
-	unsigned char *sp;
-
-	if (count == 0)
-		return;
-
-	/* if flag set, then error, ignore frame */
-	if (flags != 0 && *flags) {
-		ppp_input_error(&ap->chan, *flags);
-		return;
-	}
-
-	if (ap->flags & SC_LOG_INPKT)
-		ppp_print_buffer ("receive buffer", buf, count);
-
-	/* stuff the chars in the skb */
-	if ((skb = ap->rpkt) == 0) {
-		if ((skb = dev_alloc_skb(ap->mru + PPP_HDRLEN + 2)) == 0) {
-			printk(KERN_ERR "PPPsync: no memory (input pkt)\n");
-			ppp_input_error(&ap->chan, 0);
-			return;
-		}
-		/* Try to get the payload 4-byte aligned */
-		if (buf[0] != PPP_ALLSTATIONS)
-			skb_reserve(skb, 2 + (buf[0] & 1));
-		ap->rpkt = skb;
-	}
-	if (count > skb_tailroom(skb)) {
-		/* packet overflowed MRU */
-		ppp_input_error(&ap->chan, 1);
-	} else {
-		sp = skb_put(skb, count);
-		memcpy(sp, buf, count);
-		process_input_packet(ap);
+err:
+	/* queue zero length packet as error indication */
+	if (skb || (skb = dev_alloc_skb(0))) {
+		skb_trim(skb, 0);
+		skb_queue_tail(&ap->rqueue, skb);
 	}
 }
 
diff --git a/drivers/net/pppoe.c b/drivers/net/pppoe.c
index 6f4f64da7..64b35cc25 100644
--- a/drivers/net/pppoe.c
+++ b/drivers/net/pppoe.c
@@ -79,6 +79,8 @@
 #define PPPOE_HASH_BITS 4
 #define PPPOE_HASH_SIZE (1<<PPPOE_HASH_BITS)
 
+static struct ppp_channel_ops pppoe_chan_ops;
+
 static int pppoe_ioctl(struct socket *sock, unsigned int cmd, unsigned long arg);
 static int pppoe_xmit(struct ppp_channel *chan, struct sk_buff *skb);
 static int __pppoe_xmit(struct sock *sk, struct sk_buff *skb);
@@ -86,6 +88,7 @@ static int __pppoe_xmit(struct sock *sk, struct sk_buff *skb);
 static struct proto_ops pppoe_ops;
 static rwlock_t pppoe_hash_lock = RW_LOCK_UNLOCKED;
 
+static struct ppp_channel_ops pppoe_chan_ops;
 
 static inline int cmp_2_addr(struct pppoe_addr *a, struct pppoe_addr *b)
 {
@@ -691,7 +694,7 @@ static int pppoe_ioctl(struct socket *sock, unsigned int cmd,
 		if (put_user(po->pppoe_dev->mtu -
 			     sizeof(struct pppoe_hdr) -
 			     PPP_HDRLEN,
-			     (int *) arg))
+			     (int __user *) arg))
 			break;
 		err = 0;
 		break;
@@ -702,7 +705,7 @@ static int pppoe_ioctl(struct socket *sock, unsigned int cmd,
 			break;
 
 		err = -EFAULT;
-		if (get_user(val,(int *) arg))
+		if (get_user(val,(int __user *) arg))
 			break;
 
 		if (val < (po->pppoe_dev->mtu
@@ -715,7 +718,7 @@ static int pppoe_ioctl(struct socket *sock, unsigned int cmd,
 
 	case PPPIOCSFLAGS:
 		err = -EFAULT;
-		if (get_user(val, (int *) arg))
+		if (get_user(val, (int __user *) arg))
 			break;
 		err = 0;
 		break;
@@ -736,7 +739,7 @@ static int pppoe_ioctl(struct socket *sock, unsigned int cmd,
 		   PPPoE address to which frames are forwarded to */
 		err = -EFAULT;
 		if (copy_from_user(&po->pppoe_relay,
-				   (void*)arg,
+				   (void __user *)arg,
 				   sizeof(struct sockaddr_pppox)))
 			break;
 
diff --git a/drivers/net/pppox.c b/drivers/net/pppox.c
index 9a2915847..0a585bc36 100644
--- a/drivers/net/pppox.c
+++ b/drivers/net/pppox.c
@@ -86,7 +86,7 @@ static int pppox_ioctl(struct socket* sock, unsigned int cmd,
 
 		rc = -EINVAL;
 		index = ppp_channel_index(&po->chan);
-		if (put_user(index , (int *) arg))
+		if (put_user(index , (int __user *) arg))
 			break;
 
 		rc = 0;
diff --git a/drivers/net/r8169.c b/drivers/net/r8169.c
index 0e270770c..e686cb440 100644
--- a/drivers/net/r8169.c
+++ b/drivers/net/r8169.c
@@ -716,7 +716,7 @@ rtl8169_init_board(struct pci_dev *pdev, struct net_device **dev_out,
 		goto err_out_disable;
 	}
 
-	rc = pci_request_regions(pdev, dev->name);
+	rc = pci_request_regions(pdev, MODULENAME);
 	if (rc) {
 		printk(KERN_ERR PFX "%s: Could not request regions.\n", pdev->slot_name);
 		goto err_out_disable;
diff --git a/drivers/net/rrunner.c b/drivers/net/rrunner.c
index d77314518..059f1a68a 100644
--- a/drivers/net/rrunner.c
+++ b/drivers/net/rrunner.c
@@ -197,7 +197,8 @@ static int __devinit rr_init_one(struct pci_dev *pdev,
 	 * Don't access any register before this point!
 	 */
 #ifdef __BIG_ENDIAN
-	writel(readl(&regs->HostCtrl) | NO_SWAP, &regs->HostCtrl);
+	writel(readl(&rrpriv->regs->HostCtrl) | NO_SWAP,
+		&rrpriv->regs->HostCtrl);
 #endif
 	/*
 	 * Need to add a case for little-endian 64-bit hosts here.
@@ -633,7 +634,7 @@ static int rr_init1(struct net_device *dev)
 	for (i = 0; i < TX_RING_ENTRIES; i++) {
 		rrpriv->tx_ring[i].size = 0;
 		set_rraddr(&rrpriv->tx_ring[i].addr, 0);
-		rrpriv->tx_skbuff[i] = 0;
+		rrpriv->tx_skbuff[i] = NULL;
 	}
 	rrpriv->info->tx_ctrl.entry_size = sizeof(struct tx_desc);
 	rrpriv->info->tx_ctrl.entries = TX_RING_ENTRIES;
@@ -743,7 +744,7 @@ static int rr_init1(struct net_device *dev)
 			rrpriv->rx_ring[i].size = 0;
 			set_rraddr(&rrpriv->rx_ring[i].addr, 0);
 			dev_kfree_skb(skb);
-			rrpriv->rx_skbuff[i] = 0;
+			rrpriv->rx_skbuff[i] = NULL;
 		}
 	}
 	return ecode;
@@ -1335,10 +1336,10 @@ static void rr_dump(struct net_device *dev)
 	if (rrpriv->tx_skbuff[cons]){
 		len = min_t(int, 0x80, rrpriv->tx_skbuff[cons]->len);
 		printk("skbuff for cons %i is valid - dumping data (0x%x bytes - skbuff len 0x%x)\n", cons, len, rrpriv->tx_skbuff[cons]->len);
-		printk("mode 0x%x, size 0x%x,\n phys %08x, skbuff-addr %08lx, truesize 0x%x\n",
+		printk("mode 0x%x, size 0x%x,\n phys %08Lx, skbuff-addr %08lx, truesize 0x%x\n",
 		       rrpriv->tx_ring[cons].mode,
 		       rrpriv->tx_ring[cons].size,
-		       rrpriv->tx_ring[cons].addr.addrlo,
+		       (unsigned long long) rrpriv->tx_ring[cons].addr.addrlo,
 		       (unsigned long)rrpriv->tx_skbuff[cons]->data,
 		       (unsigned int)rrpriv->tx_skbuff[cons]->truesize);
 		for (i = 0; i < len; i++){
@@ -1351,10 +1352,10 @@ static void rr_dump(struct net_device *dev)
 
 	printk("dumping TX ring info:\n");
 	for (i = 0; i < TX_RING_ENTRIES; i++)
-		printk("mode 0x%x, size 0x%x, phys-addr %08x\n",
+		printk("mode 0x%x, size 0x%x, phys-addr %08Lx\n",
 		       rrpriv->tx_ring[i].mode,
 		       rrpriv->tx_ring[i].size,
-		       rrpriv->tx_ring[i].addr.addrlo);
+		       (unsigned long long) rrpriv->tx_ring[i].addr.addrlo);
 
 }
 
diff --git a/drivers/net/s2io.c b/drivers/net/s2io.c
index 14dc145e0..c4bd1793f 100644
--- a/drivers/net/s2io.c
+++ b/drivers/net/s2io.c
@@ -1425,13 +1425,13 @@ int fill_rx_buffers(struct s2io_nic *nic, int ring_no)
 			goto end;
 		}
 
-		skb = dev_alloc_skb(size + HEADER_ALIGN_LAYER_3);
+		skb = dev_alloc_skb(size + NET_IP_ALIGN);
 		if (!skb) {
 			DBG_PRINT(ERR_DBG, "%s: Out of ", dev->name);
 			DBG_PRINT(ERR_DBG, "memory to allocate SKBs\n");
 			return -ENOMEM;
 		}
-		skb_reserve(skb, HEADER_ALIGN_LAYER_3);
+		skb_reserve(skb, NET_IP_ALIGN);
 		memset(rxdp, 0, sizeof(RxD_t));
 		rxdp->Buffer0_ptr = pci_map_single
 		    (nic->pdev, skb->data, size, PCI_DMA_FROMDEVICE);
diff --git a/drivers/net/s2io.h b/drivers/net/s2io.h
index 41cb60f55..e9a166450 100644
--- a/drivers/net/s2io.h
+++ b/drivers/net/s2io.h
@@ -411,7 +411,6 @@ struct config_param {
 #define HEADER_802_2_SIZE              3
 #define HEADER_SNAP_SIZE               5
 #define HEADER_VLAN_SIZE               4
-#define HEADER_ALIGN_LAYER_3           2
 
 #define MIN_MTU                       46
 #define MAX_PYLD                    1500
diff --git a/drivers/net/sb1000.c b/drivers/net/sb1000.c
index 8ac2d8109..03f28fdc0 100644
--- a/drivers/net/sb1000.c
+++ b/drivers/net/sb1000.c
@@ -799,7 +799,7 @@ skipped_frame:
 			skb ? session_id : session_id | 0x40, frame_id);
 	if (skb) {
 		dev_kfree_skb(skb);
-		skb = 0;
+		skb = NULL;
 	}
 
 good_frame:
@@ -875,7 +875,7 @@ printk("cm0: IP identification: %02x%02x  fragment offset: %02x%02x\n", buffer[3
 	dev->last_rx = jiffies;
 	stats->rx_bytes+=dlen;
 	stats->rx_packets++;
-	lp->rx_skb[ns] = 0;
+	lp->rx_skb[ns] = NULL;
 	lp->rx_session_id[ns] |= 0x40;
 	return 0;
 
@@ -893,7 +893,7 @@ dropped_frame:
 	if (ns < NPIDS) {
 		if ((skb = lp->rx_skb[ns])) {
 			dev_kfree_skb(skb);
-			lp->rx_skb[ns] = 0;
+			lp->rx_skb[ns] = NULL;
 		}
 		lp->rx_session_id[ns] |= 0x40;
 	}
diff --git a/drivers/net/sb1250-mac.c b/drivers/net/sb1250-mac.c
index 7914167ac..e0f88fbd3 100644
--- a/drivers/net/sb1250-mac.c
+++ b/drivers/net/sb1250-mac.c
@@ -55,12 +55,6 @@ static int int_timeout = 0;
 /* Time in jiffies before concluding the transmitter is hung. */
 #define TX_TIMEOUT  (2*HZ)
 
-#if !defined(__OPTIMIZE__)  ||  !defined(__KERNEL__)
-#warning  You must compile this file with the correct options!
-#warning  See the last lines of the source file.
-#error  You must compile this driver with "-O".
-#endif
-
 #include <linux/module.h>
 #include <linux/kernel.h>
 #include <linux/string.h>
@@ -2900,15 +2894,15 @@ static void __exit
 sbmac_cleanup_module(void)
 {
 	struct net_device *dev;
-	sbmac_port_t port;
 	int idx;
 
 	for (idx = 0; idx < MAX_UNITS; idx++) {
+		struct sbmac_softc *sc;
 		dev = dev_sbmac[idx];
 		if (!dev)
 			continue;
 
-		struct sbmac_softc *sc = netdev_priv(dev);
+		sc = netdev_priv(dev);
 		unregister_netdev(dev);
 		sbmac_uninitctx(sc);
 		free_netdev(dev);
diff --git a/drivers/net/seeq8005.c b/drivers/net/seeq8005.c
index 06a93835c..0f237b54d 100644
--- a/drivers/net/seeq8005.c
+++ b/drivers/net/seeq8005.c
@@ -414,6 +414,27 @@ static int seeq8005_send_packet(struct sk_buff *skb, struct net_device *dev)
 	return 0;
 }
 
+/*
+ * wait_for_buffer
+ *
+ * This routine waits for the SEEQ chip to assert that the FIFO is ready
+ * by checking for a window interrupt, and then clearing it. This has to
+ * occur in the interrupt handler!
+ */
+inline void wait_for_buffer(struct net_device * dev)
+{
+	int ioaddr = dev->base_addr;
+	unsigned long tmp;
+	int status;
+	
+	tmp = jiffies + HZ;
+	while ( ( ((status=inw(SEEQ_STATUS)) & SEEQSTAT_WINDOW_INT) != SEEQSTAT_WINDOW_INT) && time_before(jiffies, tmp))
+		cpu_relax();
+		
+	if ( (status & SEEQSTAT_WINDOW_INT) == SEEQSTAT_WINDOW_INT)
+		outw( SEEQCMD_WINDOW_INT_ACK | (status & SEEQCMD_INT_MASK), SEEQ_CMD);
+}
+
 /* The typical workload of the driver:
    Handle the network interface interrupts. */
 static irqreturn_t seeq8005_interrupt(int irq, void *dev_id, struct pt_regs * regs)
@@ -712,27 +733,6 @@ static void hardware_send_packet(struct net_device * dev, char *buf, int length)
 }
 
 
-/*
- * wait_for_buffer
- *
- * This routine waits for the SEEQ chip to assert that the FIFO is ready
- * by checking for a window interrupt, and then clearing it. This has to
- * occur in the interrupt handler!
- */
-inline void wait_for_buffer(struct net_device * dev)
-{
-	int ioaddr = dev->base_addr;
-	unsigned long tmp;
-	int status;
-	
-	tmp = jiffies + HZ;
-	while ( ( ((status=inw(SEEQ_STATUS)) & SEEQSTAT_WINDOW_INT) != SEEQSTAT_WINDOW_INT) && time_before(jiffies, tmp))
-		cpu_relax();
-		
-	if ( (status & SEEQSTAT_WINDOW_INT) == SEEQSTAT_WINDOW_INT)
-		outw( SEEQCMD_WINDOW_INT_ACK | (status & SEEQCMD_INT_MASK), SEEQ_CMD);
-}
-	
 #ifdef MODULE
 
 static struct net_device *dev_seeq;
diff --git a/drivers/net/sgiseeq.c b/drivers/net/sgiseeq.c
index 3493b7974..b71f45f5c 100644
--- a/drivers/net/sgiseeq.c
+++ b/drivers/net/sgiseeq.c
@@ -64,13 +64,13 @@ static char *sgiseeqstr = "SGI Seeq8003";
 #define DEBUG
 
 struct sgiseeq_rx_desc {
-	struct hpc_dma_desc rdma;
-	signed int buf_vaddr;
+	volatile struct hpc_dma_desc rdma;
+	volatile signed int buf_vaddr;
 };
 
 struct sgiseeq_tx_desc {
-	struct hpc_dma_desc tdma;
-	signed int buf_vaddr;
+	volatile struct hpc_dma_desc tdma;
+	volatile signed int buf_vaddr;
 };
 
 /*
@@ -79,17 +79,17 @@ struct sgiseeq_tx_desc {
  *          some care.
  */
 struct sgiseeq_init_block { /* Note the name ;-) */
-	/* Ptrs to the descriptors in KSEG1 uncached space. */
-	struct sgiseeq_rx_desc *rx_desc;
-	struct sgiseeq_tx_desc *tx_desc;
-	unsigned int _padding[30]; /* Pad out to largest cache line size. */
-
 	struct sgiseeq_rx_desc rxvector[SEEQ_RX_BUFFERS];
 	struct sgiseeq_tx_desc txvector[SEEQ_TX_BUFFERS];
 };
 
 struct sgiseeq_private {
-	volatile struct sgiseeq_init_block srings;
+	struct sgiseeq_init_block *srings;
+
+	/* Ptrs to the descriptors in uncached space. */
+	struct sgiseeq_rx_desc *rx_desc;
+	struct sgiseeq_tx_desc *tx_desc;
+
 	char *name;
 	struct hpc3_ethregs *hregs;
 	struct sgiseeq_regs *sregs;
@@ -152,8 +152,7 @@ static inline void seeq_load_eaddr(struct net_device *dev,
 
 static int seeq_init_ring(struct net_device *dev)
 {
-	struct sgiseeq_private *sp = dev->priv;
-	volatile struct sgiseeq_init_block *ib = &sp->srings;
+	struct sgiseeq_private *sp = netdev_priv(dev);
 	int i;
 
 	netif_stop_queue(dev);
@@ -170,32 +169,32 @@ static int seeq_init_ring(struct net_device *dev)
 
 	/* Setup tx ring. */
 	for(i = 0; i < SEEQ_TX_BUFFERS; i++) {
-		if (!ib->tx_desc[i].tdma.pbuf) {
+		if (!sp->tx_desc[i].tdma.pbuf) {
 			unsigned long buffer;
 
 			buffer = (unsigned long) kmalloc(PKT_BUF_SZ, GFP_KERNEL);
 			if (!buffer)
 				return -ENOMEM;
-			ib->tx_desc[i].buf_vaddr = KSEG1ADDR(buffer);
-			ib->tx_desc[i].tdma.pbuf = CPHYSADDR(buffer);
+			sp->tx_desc[i].buf_vaddr = KSEG1ADDR(buffer);
+			sp->tx_desc[i].tdma.pbuf = CPHYSADDR(buffer);
 		}
-		ib->tx_desc[i].tdma.cntinfo = TCNTINFO_INIT;
+		sp->tx_desc[i].tdma.cntinfo = TCNTINFO_INIT;
 	}
 
 	/* And now the rx ring. */
 	for (i = 0; i < SEEQ_RX_BUFFERS; i++) {
-		if (!ib->rx_desc[i].rdma.pbuf) {
+		if (!sp->rx_desc[i].rdma.pbuf) {
 			unsigned long buffer;
 
 			buffer = (unsigned long) kmalloc(PKT_BUF_SZ, GFP_KERNEL);
 			if (!buffer)
 				return -ENOMEM;
-			ib->rx_desc[i].buf_vaddr = KSEG1ADDR(buffer);
-			ib->rx_desc[i].rdma.pbuf = CPHYSADDR(buffer);
+			sp->rx_desc[i].buf_vaddr = KSEG1ADDR(buffer);
+			sp->rx_desc[i].rdma.pbuf = CPHYSADDR(buffer);
 		}
-		ib->rx_desc[i].rdma.cntinfo = RCNTINFO_INIT;
+		sp->rx_desc[i].rdma.cntinfo = RCNTINFO_INIT;
 	}
-	ib->rx_desc[i - 1].rdma.cntinfo |= HPCDMA_EOR;
+	sp->rx_desc[i - 1].rdma.cntinfo |= HPCDMA_EOR;
 	return 0;
 }
 
@@ -206,8 +205,8 @@ static struct net_device *gdev;
 void sgiseeq_dump_rings(void)
 {
 	static int once;
-	struct sgiseeq_rx_desc *r = gpriv->srings.rx_desc;
-	struct sgiseeq_tx_desc *t = gpriv->srings.tx_desc;
+	struct sgiseeq_rx_desc *r = gpriv->rx_desc;
+	struct sgiseeq_tx_desc *t = gpriv->tx_desc;
 	struct hpc3_ethregs *hregs = gpriv->hregs;
 	int i;
 
@@ -268,8 +267,8 @@ static int init_seeq(struct net_device *dev, struct sgiseeq_private *sp,
 
 	hregs->rx_dconfig |= RDMACFG_INIT;
 
-	hregs->rx_ndptr = CPHYSADDR(sp->srings.rx_desc);
-	hregs->tx_ndptr = CPHYSADDR(sp->srings.tx_desc);
+	hregs->rx_ndptr = CPHYSADDR(sp->rx_desc);
+	hregs->tx_ndptr = CPHYSADDR(sp->tx_desc);
 
 	seeq_go(sp, hregs, sregs);
 	return 0;
@@ -294,14 +293,14 @@ static inline void rx_maybe_restart(struct sgiseeq_private *sp,
 				    struct sgiseeq_regs *sregs)
 {
 	if (!(hregs->rx_ctrl & HPC3_ERXCTRL_ACTIVE)) {
-		hregs->rx_ndptr = CPHYSADDR(sp->srings.rx_desc + sp->rx_new);
+		hregs->rx_ndptr = CPHYSADDR(sp->rx_desc + sp->rx_new);
 		seeq_go(sp, hregs, sregs);
 	}
 }
 
-#define for_each_rx(rd, sp) for((rd) = &(sp)->srings.rx_desc[(sp)->rx_new]; \
+#define for_each_rx(rd, sp) for((rd) = &(sp)->rx_desc[(sp)->rx_new]; \
 				!((rd)->rdma.cntinfo & HPCDMA_OWN); \
-				(rd) = &(sp)->srings.rx_desc[(sp)->rx_new])
+				(rd) = &(sp)->rx_desc[(sp)->rx_new])
 
 static inline void sgiseeq_rx(struct net_device *dev, struct sgiseeq_private *sp,
 			      struct hpc3_ethregs *hregs,
@@ -349,8 +348,8 @@ static inline void sgiseeq_rx(struct net_device *dev, struct sgiseeq_private *sp
 		rd->rdma.cntinfo = RCNTINFO_INIT;
 		sp->rx_new = NEXT_RX(sp->rx_new);
 	}
-	sp->srings.rx_desc[orig_end].rdma.cntinfo &= ~(HPCDMA_EOR);
-	sp->srings.rx_desc[PREV_RX(sp->rx_new)].rdma.cntinfo |= HPCDMA_EOR;
+	sp->rx_desc[orig_end].rdma.cntinfo &= ~(HPCDMA_EOR);
+	sp->rx_desc[PREV_RX(sp->rx_new)].rdma.cntinfo |= HPCDMA_EOR;
 	rx_maybe_restart(sp, hregs, sregs);
 }
 
@@ -403,7 +402,7 @@ static inline void sgiseeq_tx(struct net_device *dev, struct sgiseeq_private *sp
 
 	/* Ack 'em... */
 	for (j = sp->tx_old; j != sp->tx_new; j = NEXT_TX(j)) {
-		td = &sp->srings.tx_desc[j];
+		td = &sp->tx_desc[j];
 
 		if (!(td->tdma.cntinfo & (HPCDMA_XIU)))
 			break;
@@ -424,7 +423,7 @@ static inline void sgiseeq_tx(struct net_device *dev, struct sgiseeq_private *sp
 static irqreturn_t sgiseeq_interrupt(int irq, void *dev_id, struct pt_regs *regs)
 {
 	struct net_device *dev = (struct net_device *) dev_id;
-	struct sgiseeq_private *sp = dev->priv;
+	struct sgiseeq_private *sp = netdev_priv(dev);
 	struct hpc3_ethregs *hregs = sp->hregs;
 	struct sgiseeq_regs *sregs = sp->sregs;
 
@@ -450,21 +449,33 @@ static irqreturn_t sgiseeq_interrupt(int irq, void *dev_id, struct pt_regs *regs
 
 static int sgiseeq_open(struct net_device *dev)
 {
-	struct sgiseeq_private *sp = dev->priv;
+	struct sgiseeq_private *sp = netdev_priv(dev);
 	struct sgiseeq_regs *sregs = sp->sregs;
+	unsigned int irq = dev->irq;
+	int err;
 
-	int err = init_seeq(dev, sp, sregs);
+	if (request_irq(irq, sgiseeq_interrupt, 0, sgiseeqstr, dev)) {
+		printk(KERN_ERR "Seeq8003: Can't get irq %d\n", dev->irq);
+		err = -EAGAIN;
+	}
+
+	err = init_seeq(dev, sp, sregs);
 	if (err)
-		return err;
+		goto out_free_irq;
 
 	netif_start_queue(dev);
 
 	return 0;
+
+out_free_irq:
+	free_irq(irq, dev);
+
+	return err;
 }
 
 static int sgiseeq_close(struct net_device *dev)
 {
-	struct sgiseeq_private *sp = dev->priv;
+	struct sgiseeq_private *sp = netdev_priv(dev);
 	struct sgiseeq_regs *sregs = sp->sregs;
 
 	netif_stop_queue(dev);
@@ -477,7 +488,7 @@ static int sgiseeq_close(struct net_device *dev)
 
 static inline int sgiseeq_reset(struct net_device *dev)
 {
-	struct sgiseeq_private *sp = dev->priv;
+	struct sgiseeq_private *sp = netdev_priv(dev);
 	struct sgiseeq_regs *sregs = sp->sregs;
 	int err;
 
@@ -499,7 +510,7 @@ void sgiseeq_my_reset(void)
 
 static int sgiseeq_start_xmit(struct sk_buff *skb, struct net_device *dev)
 {
-	struct sgiseeq_private *sp = dev->priv;
+	struct sgiseeq_private *sp = netdev_priv(dev);
 	struct hpc3_ethregs *hregs = sp->hregs;
 	unsigned long flags;
 	struct sgiseeq_tx_desc *td;
@@ -512,7 +523,7 @@ static int sgiseeq_start_xmit(struct sk_buff *skb, struct net_device *dev)
 	len = (skblen <= ETH_ZLEN) ? ETH_ZLEN : skblen;
 	sp->stats.tx_bytes += len;
 	entry = sp->tx_new;
-	td = &sp->srings.tx_desc[entry];
+	td = &sp->tx_desc[entry];
 
 	/* Create entry.  There are so many races with adding a new
 	 * descriptor to the chain:
@@ -535,14 +546,14 @@ static int sgiseeq_start_xmit(struct sk_buff *skb, struct net_device *dev)
 	if (sp->tx_old != sp->tx_new) {
 		struct sgiseeq_tx_desc *backend;
 
-		backend = &sp->srings.tx_desc[PREV_TX(sp->tx_new)];
+		backend = &sp->tx_desc[PREV_TX(sp->tx_new)];
 		backend->tdma.cntinfo &= ~HPCDMA_EOX;
 	}
 	sp->tx_new = NEXT_TX(sp->tx_new); /* Advance. */
 
 	/* Maybe kick the HPC back into motion. */
 	if (!(hregs->tx_ctrl & HPC3_ETXCTRL_ACTIVE))
-		kick_tx(&sp->srings.tx_desc[sp->tx_old], hregs);
+		kick_tx(&sp->tx_desc[sp->tx_old], hregs);
 
 	dev->trans_start = jiffies;
 	dev_kfree_skb(skb);
@@ -565,7 +576,7 @@ static void timeout(struct net_device *dev)
 
 static struct net_device_stats *sgiseeq_get_stats(struct net_device *dev)
 {
-	struct sgiseeq_private *sp = dev->priv;
+	struct sgiseeq_private *sp = netdev_priv(dev);
 
 	return &sp->stats;
 }
@@ -601,31 +612,29 @@ static inline void setup_rx_ring(struct sgiseeq_rx_desc *buf, int nbufs)
 
 #define ALIGNED(x)  ((((unsigned long)(x)) + 0xf) & ~(0xf))
 
-int sgiseeq_init(struct hpc3_regs* regs, int irq)
+static int sgiseeq_init(struct hpc3_regs* regs, int irq)
 {
-	struct net_device *dev;
+	struct sgiseeq_init_block *sr;
 	struct sgiseeq_private *sp;
+	struct net_device *dev;
 	int err, i;
 
-	dev = alloc_etherdev(0);
+	dev = alloc_etherdev(sizeof (struct sgiseeq_private));
 	if (!dev) {
 		printk(KERN_ERR "Sgiseeq: Etherdev alloc failed, aborting.\n");
 		err = -ENOMEM;
 		goto err_out;
 	}
+	sp = netdev_priv(dev);
+
 	/* Make private data page aligned */
-	sp = (struct sgiseeq_private *) get_zeroed_page(GFP_KERNEL); 	 
-	if (!sp) {
+	sr = (struct sgiseeq_init_block *) get_zeroed_page(GFP_KERNEL);
+	if (!sr) {
 		printk(KERN_ERR "Sgiseeq: Page alloc failed, aborting.\n");
 		err = -ENOMEM;
 		goto err_out_free_dev;
 	}
-
-	if (request_irq(irq, sgiseeq_interrupt, 0, sgiseeqstr, dev)) {
-		printk(KERN_ERR "Seeq8003: Can't get irq %d\n", dev->irq);
-		err = -EAGAIN;
-		goto err_out_free_page;
-	}
+	sp->srings = sr;
 
 #define EADDR_NVOFS     250
 	for (i = 0; i < 3; i++) {
@@ -643,18 +652,18 @@ int sgiseeq_init(struct hpc3_regs* regs, int irq)
 	sp->hregs = &hpc3c0->ethregs;
 	sp->name = sgiseeqstr;
 
-	sp->srings.rx_desc = (struct sgiseeq_rx_desc *)
-	                     KSEG1ADDR(ALIGNED(&sp->srings.rxvector[0]));
-	dma_cache_wback_inv((unsigned long)&sp->srings.rxvector,
-	                    sizeof(sp->srings.rxvector));
-	sp->srings.tx_desc = (struct sgiseeq_tx_desc *)
-	                     KSEG1ADDR(ALIGNED(&sp->srings.txvector[0]));
-	dma_cache_wback_inv((unsigned long)&sp->srings.txvector,
-	                    sizeof(sp->srings.txvector));
+	sp->rx_desc = (struct sgiseeq_rx_desc *)
+	              KSEG1ADDR(ALIGNED(&sp->srings->rxvector[0]));
+	dma_cache_wback_inv((unsigned long)&sp->srings->rxvector,
+	                    sizeof(sp->srings->rxvector));
+	sp->tx_desc = (struct sgiseeq_tx_desc *)
+	              KSEG1ADDR(ALIGNED(&sp->srings->txvector[0]));
+	dma_cache_wback_inv((unsigned long)&sp->srings->txvector,
+	                    sizeof(sp->srings->txvector));
 
 	/* A couple calculations now, saves many cycles later. */
-	setup_rx_ring(sp->srings.rx_desc, SEEQ_RX_BUFFERS);
-	setup_tx_ring(sp->srings.tx_desc, SEEQ_TX_BUFFERS);
+	setup_rx_ring(sp->rx_desc, SEEQ_RX_BUFFERS);
+	setup_tx_ring(sp->tx_desc, SEEQ_TX_BUFFERS);
 
 	/* Reset the chip. */
 	hpc3_eth_reset(sp->hregs);
@@ -673,14 +682,12 @@ int sgiseeq_init(struct hpc3_regs* regs, int irq)
 	dev->get_stats		= sgiseeq_get_stats;
 	dev->set_multicast_list	= sgiseeq_set_multicast;
 	dev->irq		= irq;
-	dev->dma		= 0;
-	dev->priv		= sp;
 
 	if (register_netdev(dev)) {
 		printk(KERN_ERR "Sgiseeq: Cannot register net device, "
 		       "aborting.\n");
 		err = -ENODEV;
-		goto err_out_free_irq;
+		goto err_out_free_page;
 	}
 
 	printk(KERN_INFO "%s: SGI Seeq8003 ", dev->name);
@@ -692,8 +699,6 @@ int sgiseeq_init(struct hpc3_regs* regs, int irq)
 
 	return 0;
 
-err_out_free_irq:
-	free_irq(irq, dev);
 err_out_free_page:
 	free_page((unsigned long) sp);
 err_out_free_dev:
@@ -718,12 +723,12 @@ static void __exit sgiseeq_exit(void)
 	int irq;
 
 	for (dev = root_sgiseeq_dev; dev; dev = next) {
-		sp = (struct sgiseeq_private *) dev->priv;
+		sp = (struct sgiseeq_private *) netdev_priv(dev);
 		next = sp->next_module;
 		irq = dev->irq;
 		unregister_netdev(dev);
 		free_irq(irq, dev);
-		free_page((unsigned long) dev->priv);
+		free_page((unsigned long) sp);
 		free_netdev(dev);
 	}
 }
diff --git a/drivers/net/sis900.c b/drivers/net/sis900.c
index aa045b62c..425e89fe2 100644
--- a/drivers/net/sis900.c
+++ b/drivers/net/sis900.c
@@ -116,6 +116,7 @@ static struct mii_chip_info {
 #define	HOME 	0x0001
 #define LAN	0x0002
 #define MIX	0x0003
+#define UNKNOWN	0x0
 } mii_chip_table[] = {
 	{ "SiS 900 Internal MII PHY", 		0x001d, 0x8000, LAN },
 	{ "SiS 7014 Physical Layer Solution", 	0x0016, 0xf830, LAN },
@@ -125,7 +126,7 @@ static struct mii_chip_info {
 	{ "NS 83851 PHY",			0x2000, 0x5C20, MIX },
 	{ "Realtek RTL8201 PHY",		0x0000, 0x8200, LAN },
 	{ "VIA 6103 PHY",			0x0101, 0x8f20, LAN },
-	{0,},
+	{NULL,},
 };
 
 struct mii_phy {
@@ -577,9 +578,11 @@ static int __init sis900_mii_probe (struct net_device * net_dev)
 				break;
 			}
 			
-		if( !mii_chip_table[i].phy_id1 )
+		if( !mii_chip_table[i].phy_id1 ) {
 			printk(KERN_INFO "%s: Unknown PHY transceiver found at address %d.\n",
-			       net_dev->name, phy_addr);			
+			       net_dev->name, phy_addr);
+			mii_phy->phy_types = UNKNOWN;
+		}
 	}
 	
 	if (sis_priv->mii == NULL) {
@@ -644,15 +647,15 @@ static int __init sis900_mii_probe (struct net_device * net_dev)
 static u16 sis900_default_phy(struct net_device * net_dev)
 {
 	struct sis900_private * sis_priv = net_dev->priv;
- 	struct mii_phy *phy = NULL, *phy_home = NULL, *default_phy = NULL;
+ 	struct mii_phy *phy = NULL, *phy_home = NULL, *default_phy = NULL, *phy_lan = NULL;
 	u16 status;
 
         for( phy=sis_priv->first_mii; phy; phy=phy->next ){
 		status = mdio_read(net_dev, phy->phy_addr, MII_STATUS);
 		status = mdio_read(net_dev, phy->phy_addr, MII_STATUS);
 
-		/* Link ON & Not select deafalut PHY */
-		 if ( (status & MII_STAT_LINK) && !(default_phy) )
+		/* Link ON & Not select default PHY & not ghost PHY */
+		 if ( (status & MII_STAT_LINK) && !default_phy && (phy->phy_types != UNKNOWN) )
 		 	default_phy = phy;
 		 else{
 			status = mdio_read(net_dev, phy->phy_addr, MII_CONTROL);
@@ -660,12 +663,16 @@ static u16 sis900_default_phy(struct net_device * net_dev)
 				status | MII_CNTL_AUTO | MII_CNTL_ISOLATE);
 			if( phy->phy_types == HOME )
 				phy_home = phy;
+			else if (phy->phy_types == LAN)
+				phy_lan = phy;
 		 }
 	}
 
-	if( (!default_phy) && phy_home )
+	if( !default_phy && phy_home )
 		default_phy = phy_home;
-	else if(!default_phy)
+	else if( !default_phy && phy_lan )
+		default_phy = phy_lan;
+	else if ( !default_phy )
 		default_phy = sis_priv->first_mii;
 
 	if( sis_priv->mii != default_phy ){
@@ -1445,7 +1452,7 @@ static void sis900_tx_timeout(struct net_device *net_dev)
 				sis_priv->tx_ring[i].bufptr, skb->len,
 				PCI_DMA_TODEVICE);
 			dev_kfree_skb_irq(skb);
-			sis_priv->tx_skbuff[i] = 0;
+			sis_priv->tx_skbuff[i] = NULL;
 			sis_priv->tx_ring[i].cmdsts = 0;
 			sis_priv->tx_ring[i].bufptr = 0;
 			sis_priv->stats.tx_dropped++;
@@ -1840,7 +1847,7 @@ sis900_close(struct net_device *net_dev)
 				sis_priv->rx_ring[i].bufptr,
 				RX_BUF_SIZE, PCI_DMA_FROMDEVICE);
 			dev_kfree_skb(skb);
-			sis_priv->rx_skbuff[i] = 0;
+			sis_priv->rx_skbuff[i] = NULL;
 		}
 	}
 	for (i = 0; i < NUM_TX_DESC; i++) {
@@ -1850,7 +1857,7 @@ sis900_close(struct net_device *net_dev)
 				sis_priv->tx_ring[i].bufptr, skb->len,
 				PCI_DMA_TODEVICE);
 			dev_kfree_skb(skb);
-			sis_priv->tx_skbuff[i] = 0;
+			sis_priv->tx_skbuff[i] = NULL;
 		}
 	}
 
diff --git a/drivers/net/sk98lin/h/skdrv1st.h b/drivers/net/sk98lin/h/skdrv1st.h
index 652775ecb..a4ed1a7e6 100644
--- a/drivers/net/sk98lin/h/skdrv1st.h
+++ b/drivers/net/sk98lin/h/skdrv1st.h
@@ -58,13 +58,6 @@ typedef struct s_AC	SK_AC;
 
 #define SK_ADDR_EQUAL(a1,a2)		(!memcmp(a1,a2,6))
 
-#if !defined(__OPTIMIZE__)  ||  !defined(__KERNEL__)
-#warning  You must compile this file with the correct options!
-#warning  See the last lines of the source file.
-#error You must compile this driver with "-O".
-#endif
-
-#include <linux/version.h>
 #include <linux/types.h>
 #include <linux/kernel.h>
 #include <linux/string.h>
diff --git a/drivers/net/sk98lin/h/skdrv2nd.h b/drivers/net/sk98lin/h/skdrv2nd.h
index e3e83ed0f..0790e7b7a 100644
--- a/drivers/net/sk98lin/h/skdrv2nd.h
+++ b/drivers/net/sk98lin/h/skdrv2nd.h
@@ -58,7 +58,8 @@
     /* 3Com (0x10b7) */     \
     if (pdev->vendor == 0x10b7) {     \
         /* Gigabit Ethernet Adapter (0x1700) */     \
-        if ((pdev->device == 0x1700)) { \
+        if ((pdev->device == 0x1700) || \
+            (pdev->device == 0x80eb)) { \
             result = SK_TRUE;     \
         }     \
     /* SysKonnect (0x1148) */     \
@@ -169,7 +170,7 @@ struct s_DrvRlmtMbuf {
 typedef struct s_IOCTL	SK_GE_IOCTL;
 
 struct s_IOCTL {
-	char*		pData;
+	char __user *	pData;
 	unsigned int	Len;
 };
 
diff --git a/drivers/net/sk98lin/skge.c b/drivers/net/sk98lin/skge.c
index 53da48163..503fdff54 100644
--- a/drivers/net/sk98lin/skge.c
+++ b/drivers/net/sk98lin/skge.c
@@ -1927,6 +1927,7 @@ struct sk_buff	*pMessage)	/* pointer to send-message              */
 	*/
 	if (BytesSend < C_LEN_ETHERNET_MINSIZE) {
 		if ((pMessage = skb_padto(pMessage, C_LEN_ETHERNET_MINSIZE)) == NULL) {
+			spin_unlock_irqrestore(&pTxPort->TxDesRingLock, Flags);
 			return 0;
 		}
 		pMessage->len = C_LEN_ETHERNET_MINSIZE;
diff --git a/drivers/net/sk98lin/sktimer.c b/drivers/net/sk98lin/sktimer.c
index 68117a412..4e462955e 100644
--- a/drivers/net/sk98lin/sktimer.c
+++ b/drivers/net/sk98lin/sktimer.c
@@ -62,7 +62,7 @@ int		Level)		/* Init Level */
 {
 	switch (Level) {
 	case SK_INIT_DATA:
-		pAC->Tim.StQueue = 0;
+		pAC->Tim.StQueue = NULL;
 		break;
 	case SK_INIT_IO:
 		SkHwtInit(pAC, Ioc);
@@ -145,7 +145,7 @@ SK_EVPARA	Para)		/* Event Parameter for this timer */
 	if (!pAC->Tim.StQueue) {
 		/* First Timer to be started */
 		pAC->Tim.StQueue = pTimer;
-		pTimer->TmNext = 0;
+		pTimer->TmNext = NULL;
 		pTimer->TmDelta = Time;
 		
 		SkHwtStart(pAC, Ioc, Time);
@@ -228,7 +228,7 @@ int		Restart)	/* Do we need to restart the Hardware timer ? */
 			Done = 1;
 		}
 	}
-	*ppLast = 0;
+	*ppLast = NULL;
 	/*
 	 * pTm points to the first Timer that did not run out.
 	 * StQueue points to the first Timer that run out.
diff --git a/drivers/net/sk98lin/skvpd.c b/drivers/net/sk98lin/skvpd.c
index 83ac42c82..eb3c8988c 100644
--- a/drivers/net/sk98lin/skvpd.c
+++ b/drivers/net/sk98lin/skvpd.c
@@ -556,7 +556,7 @@ SK_VPD_PARA *p)		/* parameter description struct */
 	if (*v != (char)RES_ID) {
 		SK_DBG_MSG(pAC, SK_DBGMOD_VPD, SK_DBGCAT_ERR | SK_DBGCAT_FATAL,
 			("Error: 0x%x missing\n", RES_ID));
-		return(0);
+		return NULL;
 	}
 
 	if (strcmp(key, VPD_NAME) == 0) {
@@ -600,7 +600,7 @@ SK_VPD_PARA *p)		/* parameter description struct */
 			("Key/Len Encoding error\n"));
 	}
 #endif /* DEBUG */
-	return(0);
+	return NULL;
 }
 
 /*
@@ -751,7 +751,7 @@ int		op)			/* operation to do: ADD_KEY or OWR_KEY */
 	vpd_size = pAC->vpd.vpd_size;
 
 	rtv = 0;
-	ip = 0;
+	ip = NULL;
 	if (type == VPD_RW_KEY) {
 		/* end tag is "RW" */
 		free = pAC->vpd.v.vpd_free_rw;
diff --git a/drivers/net/skfp/cfm.c b/drivers/net/skfp/cfm.c
index 91eb36f3e..4c8aaa762 100644
--- a/drivers/net/skfp/cfm.c
+++ b/drivers/net/skfp/cfm.c
@@ -96,14 +96,13 @@ static const u_char cf_to_ptype[] = {
 /*
  * function declarations
  */
-static void cfm_fsm() ;
+static void cfm_fsm(struct s_smc *smc, int cmd);
 
 /*
 	init CFM state machine
 	clear all CFM vars and flags
 */
-void cfm_init(smc)
-struct s_smc *smc ;
+void cfm_init(struct s_smc *smc)
 {
 	smc->mib.fddiSMTCF_State = ACTIONS(SC0_ISOLATED) ;
 	smc->r.rm_join = 0 ;
@@ -118,9 +117,7 @@ struct s_smc *smc ;
 #define THRU_ENABLED(smc)	(smc->y[PA].pc_mode != PM_TREE && \
 				 smc->y[PB].pc_mode != PM_TREE)
 /* Selection criteria for the ports */
-static void	selection_criteria (smc,phy)
-struct s_smc	*smc ;
-struct s_phy	*phy ;
+static void selection_criteria (struct s_smc *smc, struct s_phy *phy)
 {
 
 	switch (phy->mib->fddiPORTMy_Type) {
@@ -146,8 +143,7 @@ struct s_phy	*phy ;
 
 }
 
-void	all_selection_criteria (smc)
-struct s_smc *smc ;
+void all_selection_criteria(struct s_smc *smc)
 {
 	struct s_phy	*phy ;
 	int		p ;
@@ -158,9 +154,7 @@ struct s_smc *smc ;
 	}
 }
 
-static void	cem_priv_state (smc, event)
-struct s_smc *smc ;
-int event ;
+static void cem_priv_state(struct s_smc *smc, int event)
 /* State machine for private PORT states: used to optimize dual homing */
 {
 	int	np;	/* Number of the port */
@@ -216,9 +210,7 @@ int event ;
 		process event
 	until SM is stable
 */
-void cfm(smc,event)
-struct s_smc *smc ;
-int event ;
+void cfm(struct s_smc *smc, int event)
 {
 	int	state ;		/* remember last state */
 	int	cond ;
@@ -290,9 +282,7 @@ int event ;
 	process CFM event
 */
 /*ARGSUSED1*/
-static void cfm_fsm(smc,cmd)
-struct s_smc *smc ;
-int cmd ;
+static void cfm_fsm(struct s_smc *smc, int cmd)
 {
 	switch(smc->mib.fddiSMTCF_State) {
 	case ACTIONS(SC0_ISOLATED) :
@@ -550,8 +540,7 @@ int cmd ;
  *	return :
  *		PA or PB
  */
-int cfm_get_mac_input(smc)
-struct s_smc *smc ;
+int cfm_get_mac_input(struct s_smc *smc)
 {
 	return((smc->mib.fddiSMTCF_State == SC10_C_WRAP_B ||
 		smc->mib.fddiSMTCF_State == SC5_THRU_B) ? PB : PA) ;
@@ -562,8 +551,7 @@ struct s_smc *smc ;
  *	return :
  *		PA or PB
  */
-int cfm_get_mac_output(smc)
-struct s_smc *smc ;
+int cfm_get_mac_output(struct s_smc *smc)
 {
 	return((smc->mib.fddiSMTCF_State == SC10_C_WRAP_B ||
 		smc->mib.fddiSMTCF_State == SC4_THRU_A) ? PB : PA) ;
@@ -603,10 +591,7 @@ static char path_iso_s[] = {
 	0,0,	0,RES_MAC,	0,INDEX_MAC,		0,PATH_ISO,
 } ;
 
-int cem_build_path(smc,to,path_index)
-struct s_smc *smc ;
-char *to ;
-int path_index ;
+int cem_build_path(struct s_smc *smc, char *to, int path_index)
 {
 	char	*path ;
 	int	len ;
diff --git a/drivers/net/skfp/drvfbi.c b/drivers/net/skfp/drvfbi.c
index 0f473dd93..052e841ba 100644
--- a/drivers/net/skfp/drvfbi.c
+++ b/drivers/net/skfp/drvfbi.c
@@ -100,14 +100,13 @@ const struct s_oem_ids oem_ids[] = {
 #endif	/* MULT_OEM */
 
 /* Prototypes of external functions */
-extern void hwt_restart() ;
 #ifdef AIX
 extern int AIX_vpdReadByte() ;
 #endif
 
 
 /* Prototypes of local functions. */
-void smt_stop_watchdog() ;
+void smt_stop_watchdog(struct s_smc *smc);
 
 #ifdef MCA
 static int read_card_id() ;
@@ -129,8 +128,7 @@ extern int AIX_vpdReadByte() ;
 /*
  * FDDI card reset
  */
-static void card_start(smc)
-struct s_smc *smc ;
+static void card_start(struct s_smc *smc)
 {
 	int i ;
 #ifdef	PCI
@@ -250,8 +248,7 @@ struct s_smc *smc ;
 	GET_PAGE(0) ;		/* necessary for BOOT */
 }
 
-void card_stop(smc)
-struct s_smc *smc ;
+void card_stop(struct s_smc *smc)
 {
 	smt_stop_watchdog(smc) ;
 	smc->hw.mac_ring_is_up = 0 ;		/* ring down */
@@ -282,14 +279,11 @@ struct s_smc *smc ;
 }
 /*--------------------------- ISR handling ----------------------------------*/
 
-#ifndef PCI
-void mac1_irq(smc,stu, stl)
-struct s_smc *smc ;
-u_short stu;
-u_short stl;
+void mac1_irq(struct s_smc *smc, u_short stu, u_short stl)
 {
 	int	restart_tx = 0 ;
 again:
+#ifndef PCI
 #ifndef ISA
 /*
  * FORMAC+ bug modified the queue pointer if many read/write accesses happens!?
@@ -344,14 +338,6 @@ again:
 }
 #else	/* PCI */
 
-void mac1_irq(smc,stu, stl)
-struct s_smc *smc ;
-u_short stu;
-u_short stl;
-{
-	int	restart_tx = 0 ;
-again:
-
 	/*
 	 * parity error: note encoding error is not possible in tag mode
 	 */
@@ -396,8 +382,7 @@ again:
  * interrupt source= plc1
  * this function is called in nwfbisr.asm
  */
-void plc1_irq(smc)
-struct s_smc *smc ;
+void plc1_irq(struct s_smc *smc)
 {
 	u_short	st = inpw(PLC(PB,PL_INTR_EVENT)) ;
 
@@ -412,8 +397,7 @@ struct s_smc *smc ;
  * interrupt source= plc2
  * this function is called in nwfbisr.asm
  */
-void plc2_irq(smc)
-struct s_smc *smc ;
+void plc2_irq(struct s_smc *smc)
 {
 	u_short	st = inpw(PLC(PA,PL_INTR_EVENT)) ;
 
@@ -428,8 +412,7 @@ struct s_smc *smc ;
 /*
  * interrupt source= timer
  */
-void timer_irq(smc)
-struct s_smc *smc ;
+void timer_irq(struct s_smc *smc)
 {
 	hwt_restart(smc);
 	smc->hw.t_stop = smc->hw.t_start;
@@ -439,8 +422,7 @@ struct s_smc *smc ;
 /*
  * return S-port (PA or PB)
  */
-int pcm_get_s_port(smc)
-struct s_smc *smc ;
+int pcm_get_s_port(struct s_smc *smc)
 {
 	SK_UNUSED(smc) ;
 	return(PS) ;
@@ -457,9 +439,7 @@ struct s_smc *smc ;
 #define STATION_LABEL_PMD_OFFSET	6
 #define STATION_LABEL_PORT_OFFSET	7
 
-void read_address(smc,mac_addr)
-struct s_smc *smc ;
-u_char *mac_addr ;
+void read_address(struct s_smc *smc, u_char *mac_addr)
 {
 	char ConnectorType ;
 	char PmdType ;
@@ -528,9 +508,7 @@ u_char *mac_addr ;
 /*
  * FDDI card soft reset
  */
-void init_board(smc,mac_addr)
-struct s_smc *smc ;
-u_char *mac_addr ;
+void init_board(struct s_smc *smc, u_char *mac_addr)
 {
 	card_start(smc) ;
 	read_address(smc,mac_addr) ;
@@ -559,9 +537,7 @@ u_char *mac_addr ;
 /*
  * insert or deinsert optical bypass (called by ECM)
  */
-void sm_pm_bypass_req(smc,mode)
-struct s_smc *smc ;
-int mode;
+void sm_pm_bypass_req(struct s_smc *smc, int mode)
 {
 #if	(defined(ISA) || defined(EISA))
 	int csra_v ;
@@ -614,8 +590,7 @@ int mode;
 /*
  * check if bypass connected
  */
-int sm_pm_bypass_present(smc)
-struct s_smc *smc ;
+int sm_pm_bypass_present(struct s_smc *smc)
 {
 #ifndef	PCI
 	return(	(inpw(CSR_A) & CS_BYSTAT) ? FALSE : TRUE ) ;
@@ -624,9 +599,7 @@ struct s_smc *smc ;
 #endif
 }
 
-void plc_clear_irq(smc,p)
-struct s_smc *smc ;
-int p ;
+void plc_clear_irq(struct s_smc *smc, int p)
 {
 	SK_UNUSED(p) ;
 
@@ -658,9 +631,7 @@ int p ;
  *	LED_Y_OFF	just switch yellow LED off
  *	LED_Y_ON	just switch yello LED on
  */
-void led_indication(smc,led_event)
-struct s_smc	*smc ;
-int		led_event;
+void led_indication(struct s_smc *smc, int led_event)
 {
 	/* use smc->hw.mac_ring_is_up == TRUE 
 	 * as indication for Ring Operational
@@ -754,10 +725,7 @@ int		led_event;
 }
 
 
-void pcm_state_change(smc,plc,p_state)
-struct s_smc *smc;
-int plc;
-int p_state;
+void pcm_state_change(struct s_smc *smc, int plc, int p_state)
 {
 	/*
 	 * the current implementation of pcm_state_change() in the driver
@@ -770,9 +738,7 @@ int p_state;
 }
 
 
-void rmt_indication(smc,i)
-struct s_smc *smc ;
-int i;
+void rmt_indication(struct s_smc *smc, int i)
 {
 	/* Call a driver special function if defined */
 	DRV_RMT_INDICATION(smc,i) ;
@@ -784,8 +750,7 @@ int i;
 /*
  * llc_recover_tx called by init_tx (fplus.c)
  */
-void llc_recover_tx(smc)
-struct s_smc *smc ;
+void llc_recover_tx(struct s_smc *smc)
 {
 #ifdef	LOAD_GEN
 	extern	int load_gen_flag ;
@@ -805,9 +770,7 @@ struct s_smc *smc ;
 /*
  * init DMA
  */
-void init_dma(smc,dma)
-struct s_smc *smc;
-int	dma;
+void init_dma(struct s_smc *smc, int dma)
 {
 	SK_UNUSED(smc) ;
 
@@ -828,9 +791,7 @@ int	dma;
 /*
  * disable DMA
  */
-void dis_dma(smc,dma)
-struct s_smc *smc ;
-int	dma;
+void dis_dma(struct s_smc *smc, int dma)
 {
 	SK_UNUSED(smc) ;
 
@@ -854,9 +815,7 @@ static const int cntr[8] = { 0x001,0x003,0x005,0x007,0,0x0c6,0x0ca,0x0ce } ;
 static const int base[8] = { 0x000,0x002,0x004,0x006,0,0x0c4,0x0c8,0x0cc } ;
 static const int page[8] = { 0x087,0x083,0x081,0x082,0,0x08b,0x089,0x08a } ;
 
-void init_dma(smc,dma)
-struct s_smc *smc ;
-int	dma;
+void init_dma(struct s_smc *smc, int dma)
 {
 	/*
 	 * extended mode register
@@ -885,9 +844,7 @@ int	dma;
 
 }
 
-void dis_dma(smc,dma)
-struct s_smc *smc ;
-int	dma;
+void dis_dma(struct s_smc *smc, int dma)
 {
 	SK_UNUSED(smc) ;
 
@@ -896,16 +853,13 @@ int	dma;
 #endif	/* EISA */
 
 #ifdef	MCA
-void init_dma(smc,dma)
-struct s_smc *smc;
-int	dma;
+void init_dma(struct s_smc *smc, int dma)
 {
 	SK_UNUSED(smc) ;
 	SK_UNUSED(dma) ;
 }
-void dis_dma(smc,dma)
-struct s_smc *smc;
-int	dma;
+
+void dis_dma(struct s_smc *smc, int dma)
 {
 	SK_UNUSED(smc) ;
 	SK_UNUSED(dma) ;
@@ -913,16 +867,13 @@ int	dma;
 #endif
 
 #ifdef	PCI
-void init_dma(smc,dma)
-struct s_smc *smc;
-int	dma;
+void init_dma(struct s_smc *smc, int dma)
 {
 	SK_UNUSED(smc) ;
 	SK_UNUSED(dma) ;
 }
-void dis_dma(smc,dma)
-struct s_smc *smc;
-int	dma;
+
+void dis_dma(struct s_smc *smc, int dma)
 {
 	SK_UNUSED(smc) ;
 	SK_UNUSED(dma) ;
@@ -930,10 +881,7 @@ int	dma;
 #endif
 
 #ifdef MULT_OEM
-static int is_equal_num(comp1,comp2,num)
-char comp1[] ;
-char comp2[] ;
-int num ;
+static int is_equal_num(char comp1[], char comp2[], int num)
 {
 	int i ;
 
@@ -954,8 +902,7 @@ int num ;
  *		2	data base empty
  *		3	no active entry	
  */
-int set_oi_id_def(smc)
-struct s_smc *smc ;
+int set_oi_id_def(struct s_smc *smc)
 {
 	int sel_id ;
 	int i ;
@@ -1029,9 +976,7 @@ struct s_smc *smc ;
  *
  ************************/
 #define LONG_CARD_ID(lo, hi)	((((hi) & 0xff) << 8) | ((lo) & 0xff))
-int exist_board(smc,slot)
-struct s_smc *smc ;
-int	slot ;
+int exist_board(struct s_smc *smc, int slot)
 {
 #ifdef MULT_OEM
 	SK_LOC_DECL(u_char,id[2]) ;
@@ -1081,9 +1026,8 @@ int	slot ;
  *	number is specified, the function returns zero.
  *
  ************************/
-static int read_card_id(smc,slot)
-struct s_smc *smc ;	/* Do not use. */
-int slot ;
+static int read_card_id(struct s_smc *smc, int slot)
+/* struct s_smc *smc ;	Do not use. */
 {
 	int card_id ;
 
@@ -1126,9 +1070,7 @@ int slot ;
  * END_MANUAL_ENTRY()
  *
  ************************/
-int get_board_para(smc,slot)
-struct s_smc *smc ;
-int slot ;
+int get_board_para(struct s_smc *smc, int slot)
 {
 	int val ;
 	int i ;
@@ -1175,9 +1117,7 @@ int slot ;
 }
 
 /* Enable access to specified MCA slot. */
-static void EnableSlotAccess(smc,slot)
-struct s_smc *smc ;
-int slot ;
+static void EnableSlotAccess(struct s_smc *smc, int slot)
 {
 	SK_UNUSED(slot) ;
 
@@ -1195,8 +1135,7 @@ int slot ;
 }
 
 /* Disable access to MCA slot formerly enabled via EnableSlotAccess(). */
-static void DisableSlotAccess(smc)
-struct s_smc *smc ;
+static void DisableSlotAccess(struct s_smc *smc)
 {
 #ifndef AIX
 	SK_UNUSED(smc) ;
@@ -1245,9 +1184,7 @@ struct s_smc *smc ;
  *	The smc pointer must be valid now.
  *
  ************************/
-int exist_board(smc,slot)
-struct s_smc *smc ;
-int	slot ;
+int exist_board(struct s_smc *smc, int slot)
 {
 	int i ;
 #ifdef MULT_OEM
@@ -1284,9 +1221,7 @@ int	slot ;
 }
 
 
-int get_board_para(smc,slot)
-struct s_smc *smc ;
-int	slot ;
+int get_board_para(struct s_smc *smc, int slot)
 {
 	int	i ;
 
@@ -1327,9 +1262,7 @@ const u_char sklogo[6] = SKLOGO_STR ;
 #endif	/* MULT_OEM */
 
 
-int exist_board(smc,port)
-struct s_smc *smc ;
-HW_PTR	port ;
+int exist_board(struct s_smc *smc, HW_PTR port)
 {
 	int	i ;
 #ifdef MULT_OEM
@@ -1400,9 +1333,7 @@ HW_PTR	port ;
 #endif	/* MULT_OEM */
 }
 
-int get_board_para(smc,slot)
-struct s_smc *smc ;
-int	slot ;
+int get_board_para(struct s_smc *smc, int slot)
 {
 	SK_UNUSED(smc) ;
 	SK_UNUSED(slot) ;
@@ -1412,9 +1343,7 @@ int	slot ;
 
 #ifdef PCI
 #ifdef USE_BIOS_FUN
-int exist_board(smc,slot)
-struct s_smc *smc ;
-int	slot ;
+int exist_board(struct s_smc *smc, int slot)
 {
 	u_short dev_id ;
 	u_short ven_id ;
@@ -1452,9 +1381,7 @@ int	slot ;
 #endif	/* PCI */
 #endif	/* USE_BIOS_FUNC */
 
-void driver_get_bia(smc, bia_addr)
-struct s_smc *smc ;
-struct fddi_addr *bia_addr ;
+void driver_get_bia(struct s_smc *smc, struct fddi_addr *bia_addr)
 {
 	int i ;
 
@@ -1465,8 +1392,7 @@ struct fddi_addr *bia_addr ;
 	}
 }
 
-void smt_start_watchdog(smc)
-struct s_smc *smc ;
+void smt_start_watchdog(struct s_smc *smc)
 {
 	SK_UNUSED(smc) ;	/* Make LINT happy. */
 
@@ -1481,8 +1407,7 @@ struct s_smc *smc ;
 #endif	/* DEBUG */
 }
 
-void smt_stop_watchdog(smc)
-struct s_smc *smc ;
+void smt_stop_watchdog(struct s_smc *smc)
 {
 	SK_UNUSED(smc) ;	/* Make LINT happy. */
 #ifndef	DEBUG
@@ -1497,9 +1422,7 @@ struct s_smc *smc ;
 }
 
 #ifdef	PCI
-static char get_rom_byte(smc,addr)
-struct s_smc *smc ;
-u_short	addr ;
+static char get_rom_byte(struct s_smc *smc, u_short addr)
 {
 	GET_PAGE(addr) ;
 	return (READ_PROM(ADDR(B2_FDP))) ;
@@ -1544,11 +1467,7 @@ u_short	addr ;
  *
  *	END_MANUAL_ENTRY
  */
-int mac_drv_vpd_read(smc,buf,size,image)
-struct s_smc *smc ;
-char *buf ;
-int size ;
-char image ;
+int mac_drv_vpd_read(struct s_smc *smc, char *buf, int size, char image)
 {
 	u_short	ibase ;
 	u_short pci_base ;
@@ -1597,16 +1516,14 @@ char image ;
 	return(len) ;
 }
 
-void mac_drv_pci_fix(smc,fix_value)
-struct s_smc *smc ;
-u_long fix_value ;
+void mac_drv_pci_fix(struct s_smc *smc, u_long fix_value)
 {
 	smc->hw.pci_fix_value = fix_value ;
 }
 
-void mac_do_pci_fix(smc)
-struct s_smc *smc ;
+void mac_do_pci_fix(struct s_smc *smc)
 {
 	SK_UNUSED(smc) ;
 }
 #endif	/* PCI */
+
diff --git a/drivers/net/skfp/ecm.c b/drivers/net/skfp/ecm.c
index 7eaab1c3f..47d922cb3 100644
--- a/drivers/net/skfp/ecm.c
+++ b/drivers/net/skfp/ecm.c
@@ -94,17 +94,16 @@ static const char * const ecm_events[] = {
  * function declarations
  */
 
-static void ecm_fsm() ;
-static void start_ecm_timer() ;
-static void stop_ecm_timer() ;
-static void prop_actions() ;
+static void ecm_fsm(struct s_smc *smc, int cmd);
+static void start_ecm_timer(struct s_smc *smc, u_long value, int event);
+static void stop_ecm_timer(struct s_smc *smc);
+static void prop_actions(struct s_smc *smc);
 
 /*
 	init ECM state machine
 	clear all ECM vars and flags
 */
-void ecm_init(smc)
-struct s_smc *smc ;
+void ecm_init(struct s_smc *smc)
 {
 	smc->e.path_test = PT_PASSED ;
 	smc->e.trace_prop = 0 ;
@@ -122,9 +121,7 @@ struct s_smc *smc ;
 		process event
 	until SM is stable
 */
-void ecm(smc,event)
-struct s_smc *smc ;
-int event ;
+void ecm(struct s_smc *smc, int event)
 {
 	int	state ;
 
@@ -143,9 +140,7 @@ int event ;
 /*
 	process ECM event
 */
-static void ecm_fsm(smc,cmd)
-struct s_smc *smc ;
-int cmd ;
+static void ecm_fsm(struct s_smc *smc, int cmd)
 {
 	int ls_a ;			/* current line state PHY A */
 	int ls_b ;			/* current line state PHY B */
@@ -429,8 +424,7 @@ int cmd ;
 /*
  * trace propagation actions for SAS & DAS
  */
-static void prop_actions(smc)
-struct s_smc *smc ;
+static void prop_actions(struct s_smc *smc)
 {
 	int	port_in = 0 ;
 	int	port_out = 0 ;
@@ -480,8 +474,7 @@ struct s_smc *smc ;
 /*
  * trace propagation actions for Concentrator
  */
-static void prop_actions(smc)
-struct s_smc *smc ;
+static void prop_actions(struct s_smc *smc)
 {
 	int	initiator ;
 	int	upstream ;
@@ -527,10 +520,7 @@ struct s_smc *smc ;
  * SMT timer interface
  *	start ECM timer
  */
-static void start_ecm_timer(smc,value,event)
-struct s_smc *smc ;
-u_long value;
-int event ;
+static void start_ecm_timer(struct s_smc *smc, u_long value, int event)
 {
 	smt_timer_start(smc,&smc->e.ecm_timer,value,EV_TOKEN(EVENT_ECM,event));
 }
@@ -539,8 +529,7 @@ int event ;
  * SMT timer interface
  *	stop ECM timer
  */
-static void stop_ecm_timer(smc)
-struct s_smc *smc ;
+static void stop_ecm_timer(struct s_smc *smc)
 {
 	if (smc->e.ecm_timer.tm_active)
 		smt_timer_stop(smc,&smc->e.ecm_timer) ;
diff --git a/drivers/net/skfp/ess.c b/drivers/net/skfp/ess.c
index e5fecf8f9..fd39b4b2e 100644
--- a/drivers/net/skfp/ess.c
+++ b/drivers/net/skfp/ess.c
@@ -80,8 +80,11 @@ static const struct fddi_addr null_addr = {{0,0,0,0,0,0}} ;
 	-------------------------------------------------------------
 */
 
-static	void	ess_send_response(),		ess_config_fifo(),
-		ess_send_alc_req(),		ess_send_frame() ;
+static void ess_send_response(struct s_smc *smc, struct smt_header *sm,
+			      int sba_cmd);
+static void ess_config_fifo(struct s_smc *smc);
+static void ess_send_alc_req(struct s_smc *smc);
+static void ess_send_frame(struct s_smc *smc, SMbuf *mb);
 
 /*
 	-------------------------------------------------------------
@@ -89,26 +92,17 @@ static	void	ess_send_response(),		ess_config_fifo(),
 	-------------------------------------------------------------
 */
 
-extern	void	*sm_to_para() ;
-
-extern	void	smt_send_frame(),	smt_free_mbuf(),
-		set_formac_tsync(),	formac_reinit_tx() ;
-
-extern	int	smt_check_para() ;
-
-extern	SMbuf	*smt_get_mbuf(),	*smt_build_frame() ;
-
-extern	u_long	smt_get_tid() ;
-
 /*
 	-------------------------------------------------------------
 	PUBLIC FUNCTIONS:
 	-------------------------------------------------------------
 */
 
-	void	ess_timer_poll(),		ess_para_change() ;
-
-	int	ess_raf_received_pack(),	process_bw_alloc() ;
+void ess_timer_poll(struct s_smc *smc);
+void ess_para_change(struct s_smc *smc);
+int ess_raf_received_pack(struct s_smc *smc, SMbuf *mb, struct smt_header *sm,
+			  int fs);
+int process_bw_alloc(struct s_smc *smc, long int payload, long int overhead);
 
 
 /*
@@ -120,11 +114,8 @@ extern	u_long	smt_get_tid() ;
 /*
  * evaluate the RAF frame
  */
-int ess_raf_received_pack(smc,mb,sm,fs)
-struct s_smc *smc ;
-SMbuf *mb ;
-struct smt_header *sm ;
-int fs ;
+int ess_raf_received_pack(struct s_smc *smc, SMbuf *mb, struct smt_header *sm,
+			  int fs)
 {
 	void			*p ;		/* universal pointer */
 	struct smt_p_0016	*cmd ;		/* para: command for the ESS */
@@ -384,10 +375,7 @@ int fs ;
  * determines the synchronous bandwidth, set the TSYNC register and the
  * mib variables SBAPayload, SBAOverhead and fddiMACT-NEG.
  */
-int process_bw_alloc(smc,payload,overhead)
-struct s_smc *smc ;
-long payload ;
-long overhead ;
+int process_bw_alloc(struct s_smc *smc, long int payload, long int overhead)
 {
 	/*
 	 * determine the synchronous bandwidth (sync_bw) in bytes per T-NEG,
@@ -483,10 +471,8 @@ long overhead ;
 	return(TRUE) ;
 }
 
-static void ess_send_response(smc,sm,sba_cmd)
-struct s_smc *smc ;
-struct smt_header *sm ;
-int sba_cmd ;
+static void ess_send_response(struct s_smc *smc, struct smt_header *sm,
+			      int sba_cmd)
 {
 	struct smt_sba_chg	*chg ;
 	SMbuf			*mb ;
@@ -550,9 +536,7 @@ int sba_cmd ;
 	ess_send_frame(smc,mb) ;
 }
 
-
-void ess_timer_poll(smc)
-struct s_smc *smc ;
+void ess_timer_poll(struct s_smc *smc)
 {
 	if (!smc->ess.raf_act_timer_poll)
 		return ;
@@ -566,8 +550,7 @@ struct s_smc *smc ;
 	}
 }
 
-static void ess_send_alc_req(smc)
-struct s_smc *smc ;
+static void ess_send_alc_req(struct s_smc *smc)
 {
 	struct smt_sba_alc_req *req ;
 	SMbuf	*mb ;
@@ -675,9 +658,7 @@ struct s_smc *smc ;
 	ess_send_frame(smc,mb) ;
 }
 
-static void ess_send_frame(smc,mb)
-struct s_smc *smc ;
-SMbuf *mb ;
+static void ess_send_frame(struct s_smc *smc, SMbuf *mb)
 {
 	/*
 	 * check if the frame must be send to the own ESS
@@ -703,15 +684,13 @@ SMbuf *mb ;
 	}
 }
 
-void ess_para_change(smc)
-struct s_smc *smc ;
+void ess_para_change(struct s_smc *smc)
 {
 	(void)process_bw_alloc(smc,(long)smc->mib.a[PATH0].fddiPATHSbaPayload,
 		(long)smc->mib.a[PATH0].fddiPATHSbaOverhead) ;
 }
 
-static void ess_config_fifo(smc)
-struct s_smc *smc ;
+static void ess_config_fifo(struct s_smc *smc)
 {
 	/*
 	 * if nothing to do exit 
@@ -738,3 +717,4 @@ struct s_smc *smc ;
 #endif /* ESS */
 
 #endif	/* no SLIM_SMT */
+
diff --git a/drivers/net/skfp/fplustm.c b/drivers/net/skfp/fplustm.c
index 834100b97..76e78442f 100644
--- a/drivers/net/skfp/fplustm.c
+++ b/drivers/net/skfp/fplustm.c
@@ -43,10 +43,10 @@ static const char ID_sccs[] = "@(#)fplustm.c	1.32 99/02/23 (C) SK " ;
 /*
  * prototypes for static function
  */
-static void build_claim_beacon() ;
-static int init_mac() ;
-static void rtm_init() ;
-static void smt_split_up_fifo() ;
+static void build_claim_beacon(struct s_smc *smc, u_long t_request);
+static int init_mac(struct s_smc *smc, int all);
+static void rtm_init(struct s_smc *smc);
+static void smt_split_up_fifo(struct s_smc *smc);
 
 #if (!defined(NO_SMT_PANIC) || defined(DEBUG))
 static	char write_mdr_warning [] = "E350 write_mdr() FM_SNPPND is set\n";
@@ -107,8 +107,7 @@ static int mac_beacon_imsk2u = FM_SOTRBEC | FM_SMYBEC | FM_SBEC |
 			FM_SLOCLM | FM_SHICLM | FM_SMYCLM | FM_SCLM ;
 
 
-static u_long mac_get_tneg(smc)
-struct s_smc *smc ;
+static u_long mac_get_tneg(struct s_smc *smc)
 {
 	u_long	tneg ;
 
@@ -117,8 +116,7 @@ struct s_smc *smc ;
 		0xffe00000L)) ;
 }
 
-void mac_update_counter(smc)
-struct s_smc *smc ;
+void mac_update_counter(struct s_smc *smc)
 {
 	smc->mib.m[MAC0].fddiMACFrame_Ct =
 		(smc->mib.m[MAC0].fddiMACFrame_Ct & 0xffff0000L)
@@ -143,20 +141,17 @@ struct s_smc *smc ;
 /*
  * write long value into buffer memory over memory data register (MDR),
  */
-void	write_mdr(smc,val)
-struct s_smc *smc ;
-u_long val;
+static void write_mdr(struct s_smc *smc, u_long val)
 {
 	CHECK_NPP() ;
 	MDRW(val) ;
 }
 
+#if 0
 /*
  * read long value from buffer memory over memory data register (MDR),
  */
-u_long read_mdr(smc,addr)
-struct s_smc *smc ;
-unsigned int addr;
+static u_long read_mdr(struct s_smc *smc, unsigned int addr)
 {
 	long p ;
 	CHECK_NPP() ;
@@ -170,11 +165,12 @@ unsigned int addr;
 	p += (u_long)inpw(FM_A(FM_MDRL)) ;
 	return(p) ;
 }
+#endif
+
 /*
  * clear buffer memory
  */
-static void init_ram(smc)
-struct s_smc *smc ;
+static void init_ram(struct s_smc *smc)
 {
 	u_short i ;
 
@@ -193,8 +189,7 @@ struct s_smc *smc ;
 /*
  * set receive FIFO pointer
  */
-static void set_recvptr(smc)
-struct s_smc *smc ;
+static void set_recvptr(struct s_smc *smc)
 {
 	/*
 	 * initialize the pointer for receive queue 1
@@ -224,8 +219,7 @@ struct s_smc *smc ;
 /*
  * set transmit FIFO pointer
  */
-static void set_txptr(smc)
-struct s_smc *smc ;
+static void set_txptr(struct s_smc *smc)
 {
 	outpw(FM_A(FM_CMDREG2),FM_IRSTQ) ;	/* reset transmit queues */
 
@@ -257,8 +251,7 @@ struct s_smc *smc ;
 /*
  * init memory buffer management registers
  */
-static void init_rbc(smc)
-struct s_smc *smc ;
+static void init_rbc(struct s_smc *smc)
 {
 	u_short	rbc_ram_addr ;
 
@@ -279,8 +272,7 @@ struct s_smc *smc ;
 /*
  * init rx pointer
  */
-static void init_rx(smc)
-struct s_smc *smc ;
+static void init_rx(struct s_smc *smc)
 {
 	struct s_smt_rx_queue	*queue ;
 
@@ -302,9 +294,7 @@ struct s_smc *smc ;
 /*
  * set the TSYNC register of the FORMAC to regulate synchronous transmission
  */
-void set_formac_tsync(smc,sync_bw)
-struct s_smc *smc ;
-long sync_bw ;
+void set_formac_tsync(struct s_smc *smc, long sync_bw)
 {
 	outpw(FM_A(FM_TSYNC),(unsigned int) (((-sync_bw) >> 5) & 0xffff) ) ;
 }
@@ -312,8 +302,7 @@ long sync_bw ;
 /*
  * init all tx data structures
  */
-static void init_tx(smc)
-struct s_smc *smc ;
+static void init_tx(struct s_smc *smc)
 {
 	struct s_smt_tx_queue	*queue ;
 
@@ -339,8 +328,7 @@ struct s_smc *smc ;
 	llc_recover_tx(smc) ;
 }
 
-static void mac_counter_init(smc)
-struct s_smc *smc ;
+static void mac_counter_init(struct s_smc *smc)
 {
 	int i ;
 	u_long *ec ;
@@ -363,8 +351,7 @@ struct s_smc *smc ;
 /*
  * set FORMAC address, and t_request
  */
-static	void set_formac_addr(smc)
-struct s_smc *smc ;
+static	void set_formac_addr(struct s_smc *smc)
 {
 	long	t_requ = smc->mib.m[MAC0].fddiMACT_Req ;
 
@@ -390,9 +377,7 @@ struct s_smc *smc ;
 	outpw(FM_A(FM_TREQ0),(unsigned)t_requ) ;
 }
 
-static void set_int(p,l)
-char *p;
-int l;
+static void set_int(char *p, int l)
 {
 	p[0] = (char)(l >> 24) ;
 	p[1] = (char)(l >> 16) ;
@@ -408,12 +393,12 @@ int l;
  * else
  *	append 'end of chain' pointer
  */
-static void copy_tx_mac(smc,td,mac,off,len)
-struct s_smc *smc ;
-u_long td;		/* transmit descriptor */
-struct fddi_mac *mac;	/* mac frame pointer */
-unsigned off;		/* start address within buffer memory */
-int len ;		/* lenght of the frame including the FC */
+static void copy_tx_mac(struct s_smc *smc, u_long td, struct fddi_mac *mac,
+			unsigned off, int len)
+/* u_long td;		 transmit descriptor */
+/* struct fddi_mac *mac; mac frame pointer */
+/* unsigned off;	 start address within buffer memory */
+/* int len ;		 lenght of the frame including the FC */
 {
 	int	i ;
 	u_int	*p ;
@@ -457,8 +442,7 @@ int len ;		/* lenght of the frame including the FC */
 
 	END_MANUAL_ENTRY
  */
-static void directed_beacon(smc)
-struct s_smc *smc ;
+static void directed_beacon(struct s_smc *smc)
 {
 	SK_LOC_DECL(u_int,a[2]) ;
 
@@ -487,9 +471,7 @@ struct s_smc *smc ;
 		special frame packets end with a pointer to their own
 		descriptor, and the MORE bit is set in the descriptor
 */
-static void build_claim_beacon(smc,t_request)
-struct s_smc *smc ;
-u_long t_request;
+static void build_claim_beacon(struct s_smc *smc, u_long t_request)
 {
 	u_int	td ;
 	int	len ;
@@ -550,8 +532,7 @@ u_long t_request;
 	outpw(FM_A(FM_RPXSF),0) ;
 }
 
-void formac_rcv_restart(smc)
-struct s_smc *smc ;
+static void formac_rcv_restart(struct s_smc *smc)
 {
 	/* enable receive function */
 	SETMASK(FM_A(FM_MDREG1),smc->hw.fp.rx_mode,FM_ADDRX) ;
@@ -559,15 +540,13 @@ struct s_smc *smc ;
 	outpw(FM_A(FM_CMDREG1),FM_ICLLR) ;	/* clear receive lock */
 }
 
-void formac_tx_restart(smc)
-struct s_smc *smc ;
+void formac_tx_restart(struct s_smc *smc)
 {
 	outpw(FM_A(FM_CMDREG1),FM_ICLLS) ;	/* clear s-frame lock */
 	outpw(FM_A(FM_CMDREG1),FM_ICLLA0) ;	/* clear a-frame lock */
 }
 
-static void enable_formac(smc)
-struct s_smc *smc ;
+static void enable_formac(struct s_smc *smc)
 {
 	/* set formac IMSK : 0 enables irq */
 	outpw(FM_A(FM_IMSK1U),~mac_imsk1u) ;
@@ -607,9 +586,8 @@ Note	After any ring operational change the transmit complete
 
 	END_MANUAL_ENTRY
  */
-void enable_tx_irq(smc, queue)
-struct s_smc *smc ;
-u_short	queue ;		/* 0 = synchronous queue, 1 = asynchronous queue 0 */
+void enable_tx_irq(struct s_smc *smc, u_short queue)
+/* u_short queue; 0 = synchronous queue, 1 = asynchronous queue 0 */
 {
 	u_short	imask ;
 
@@ -643,9 +621,8 @@ Note	The operating system dependent module should disable
 
 	END_MANUAL_ENTRY
  */
-void disable_tx_irq(smc, queue)
-struct s_smc *smc ;
-u_short	queue ;		/* 0 = synchronous queue, 1 = asynchronous queue 0 */
+void disable_tx_irq(struct s_smc *smc, u_short queue)
+/* u_short queue; 0 = synchronous queue, 1 = asynchronous queue 0 */
 {
 	u_short	imask ;
 
@@ -660,8 +637,7 @@ u_short	queue ;		/* 0 = synchronous queue, 1 = asynchronous queue 0 */
 }
 #endif
 
-static void disable_formac(smc)
-struct s_smc *smc ;
+static void disable_formac(struct s_smc *smc)
 {
 	/* clear formac IMSK : 1 disables irq */
 	outpw(FM_A(FM_IMSK1U),MW) ;
@@ -673,9 +649,7 @@ struct s_smc *smc ;
 }
 
 
-static void mac_ring_up(smc,up)
-struct s_smc *smc ;
-int up;
+static void mac_ring_up(struct s_smc *smc, int up)
 {
 	if (up) {
 		formac_rcv_restart(smc) ;	/* enable receive function */
@@ -702,10 +676,7 @@ int up;
  * mac2_irq:	status bits for the receive queue 1, and ring status
  * 		ring status indication bits
  */
-void mac2_irq(smc,code_s2u,code_s2l)
-struct s_smc *smc ;
-u_short code_s2u ;
-u_short code_s2l ;
+void mac2_irq(struct s_smc *smc, u_short code_s2u, u_short code_s2l)
 {
 	u_short	change_s2l ;
 	u_short	change_s2u ;
@@ -831,10 +802,7 @@ mac2_end:
 /*
  * mac3_irq:	receive queue 2 bits and address detection bits
  */
-void mac3_irq(smc,code_s3u,code_s3l)
-struct s_smc *smc ;
-u_short code_s3u ;
-u_short code_s3l ;
+void mac3_irq(struct s_smc *smc, u_short code_s3u, u_short code_s3l)
 {
 	UNUSED(code_s3l) ;
 
@@ -857,8 +825,7 @@ u_short code_s3l ;
 /*
  * take formac offline
  */
-static void formac_offline(smc)
-struct s_smc *smc ;
+static void formac_offline(struct s_smc *smc)
 {
 	outpw(FM_A(FM_CMDREG2),FM_IACTR) ;/* abort current transmit activity */
 
@@ -876,8 +843,7 @@ struct s_smc *smc ;
 /*
  * bring formac online
  */
-static void formac_online(smc)
-struct s_smc *smc ;
+static void formac_online(struct s_smc *smc)
 {
 	enable_formac(smc) ;
 	SETMASK(FM_A(FM_MDREG1),FM_MONLINE | FM_SELRA | MDR1INIT |
@@ -887,8 +853,7 @@ struct s_smc *smc ;
 /*
  * FORMAC+ full init. (tx, rx, timer, counter, claim & beacon)
  */
-int init_fplus(smc)
-struct s_smc *smc ;
+int init_fplus(struct s_smc *smc)
 {
 	smc->hw.fp.nsa_mode = FM_MRNNSAFNMA ;
 	smc->hw.fp.rx_mode = FM_MDAMA ;
@@ -926,9 +891,7 @@ struct s_smc *smc ;
 	/* enable_formac(smc) ; */
 }
 
-static int init_mac(smc,all)
-struct s_smc *smc ;
-int all ;
+static int init_mac(struct s_smc *smc, int all)
 {
 	u_short	t_max,x ;
 	u_long	time=0 ;
@@ -1033,9 +996,7 @@ int all ;
 /*
  * called by CFM
  */
-void config_mux(smc,mux)
-struct s_smc *smc ;
-int mux;
+void config_mux(struct s_smc *smc, int mux)
 {
 	plc_config_mux(smc,mux) ;
 
@@ -1049,8 +1010,7 @@ int mux;
  * the interrupt must not be permanently enabled
  * RMT calls this function periodically (timer driven polling)
  */
-void sm_mac_check_beacon_claim(smc)
-struct s_smc *smc ;
+void sm_mac_check_beacon_claim(struct s_smc *smc)
 {
 	/* set formac IMSK : 0 enables irq */
 	outpw(FM_A(FM_IMSK2U),~(mac_imsk2u | mac_beacon_imsk2u)) ;
@@ -1060,33 +1020,10 @@ struct s_smc *smc ;
 }
 
 /*-------------------------- interface functions ----------------------------*/
-/*
- * control ODL output
- */
-void sm_pm_control(smc,mode)
-struct s_smc *smc ;
-int mode;
-{
-	SK_UNUSED(smc) ;
-
-	/*
-	 * if PCM logic has set LS_REQUEST = Transmit QUIET Line State
-	 *	/FOTOFF signal turn activ -> ODL disable
-	 */
-	switch(mode) {
-	case PM_TRANSMIT_DISABLE :
-		break ;
-	case PM_TRANSMIT_ENABLE :
-		break ;
-	}
-}
-
 /*
  * control MAC layer	(called by RMT)
  */
-void sm_ma_control(smc,mode)
-struct s_smc *smc ;
-int mode;
+void sm_ma_control(struct s_smc *smc, int mode)
 {
 	switch(mode) {
 	case MA_OFFLINE :
@@ -1110,8 +1047,7 @@ int mode;
 	}
 }
 
-int sm_mac_get_tx_state(smc)
-struct s_smc *smc ;
+int sm_mac_get_tx_state(struct s_smc *smc)
 {
 	return((inpw(FM_A(FM_STMCHN))>>4)&7) ;
 }
@@ -1120,12 +1056,10 @@ struct s_smc *smc ;
  * multicast functions
  */
 
-static struct s_fpmc	*mac_get_mc_table(smc,user,own,del,can)
-struct s_smc *smc ;
-struct fddi_addr *user ;
-struct fddi_addr *own ;
-int del ;
-int can ;
+static struct s_fpmc* mac_get_mc_table(struct s_smc *smc,
+				       struct fddi_addr *user,
+				       struct fddi_addr *own,
+				       int del, int can)
 {
 	struct s_fpmc	*tb ;
 	struct s_fpmc	*slot ;
@@ -1141,7 +1075,7 @@ int can ;
 		for (i = 0 ; i < 6 ; i++, p++)
 			*p = canonical[*p] ;
 	}
-	slot = 0 ;
+	slot = NULL;
 	for (i = 0, tb = smc->hw.fp.mc.table ; i < FPMAX_MULTICAST ; i++, tb++){
 		if (!tb->n) {		/* not used */
 			if (!del && !slot)	/* if !del save first free */
@@ -1166,8 +1100,7 @@ Function	DOWNCALL	(SMT, fplustm.c)
 
 	END_MANUAL_ENTRY()
  */
-void mac_clear_multicast(smc)
-struct s_smc *smc ;
+void mac_clear_multicast(struct s_smc *smc)
 {
 	struct s_fpmc	*tb ;
 	int i ;
@@ -1198,9 +1131,7 @@ Returns	0: always success
 
 	END_MANUAL_ENTRY()
  */
-int mac_set_func_addr(smc,f_addr)
-struct s_smc *smc ;
-u_long f_addr ;
+int mac_set_func_addr(struct s_smc *smc, u_long f_addr)
 {
 	smc->hw.fp.func_addr = f_addr ;
 	return(0) ;
@@ -1235,10 +1166,7 @@ Note	After a 'driver reset' or a 'station set address' all
 
 	END_MANUAL_ENTRY()
  */
-int mac_add_multicast(smc,addr,can)
-struct s_smc *smc ;
-struct fddi_addr *addr ;
-int can ;
+int mac_add_multicast(struct s_smc *smc, struct fddi_addr *addr, int can)
 {
 	SK_LOC_DECL(struct fddi_addr,own) ;
 	struct s_fpmc	*tb ;
@@ -1292,10 +1220,7 @@ Para	addr	pointer to a multicast address
 
 	END_MANUAL_ENTRY()
  */
-void mac_del_multicast(smc,addr,can)
-struct s_smc *smc ;
-struct fddi_addr *addr ;
-int can ;
+void mac_del_multicast(struct s_smc *smc, struct fddi_addr *addr, int can)
 {
 	SK_LOC_DECL(struct fddi_addr,own) ;
 	struct s_fpmc	*tb ;
@@ -1341,8 +1266,7 @@ Function	DOWNCALL	(SMT, fplustm.c)
 
 	END_MANUAL_ENTRY()
  */
-void mac_update_multicast(smc)
-struct s_smc *smc ;
+void mac_update_multicast(struct s_smc *smc)
 {
 	struct s_fpmc	*tb ;
 	u_char	*fu ;
@@ -1418,9 +1342,7 @@ Note	The selected receive modes will be lost after 'driver reset'
 
 	END_MANUAL_ENTRY
  */
-void mac_set_rx_mode(smc,mode)
-struct s_smc *smc ;
-int mode ;
+void mac_set_rx_mode(struct s_smc *smc, int mode)
 {
 	switch (mode) {
 	case RX_ENABLE_ALLMULTI :
@@ -1476,8 +1398,7 @@ int mode ;
 
 	END_MANUAL_ENTRY
  */
-void rtm_irq(smc)
-struct s_smc *smc ;
+void rtm_irq(struct s_smc *smc)
 {
 	outpw(ADDR(B2_RTM_CRTL),TIM_CL_IRQ) ;		/* clear IRQ */
 	if (inpw(ADDR(B2_RTM_CRTL)) & TIM_RES_TOK) {
@@ -1490,15 +1411,13 @@ struct s_smc *smc ;
 	outpw(ADDR(B2_RTM_CRTL),TIM_START) ;	/* enable RTM monitoring */
 }
 
-static void rtm_init(smc)
-struct s_smc *smc ;
+static void rtm_init(struct s_smc *smc)
 {
 	outpd(ADDR(B2_RTM_INI),0) ;		/* timer = 0 */
 	outpw(ADDR(B2_RTM_CRTL),TIM_START) ;	/* enable IRQ */
 }
 
-void rtm_set_timer(smc)
-struct s_smc *smc ;
+void rtm_set_timer(struct s_smc *smc)
 {
 	/*
 	 * MIB timer and hardware timer have the same resolution of 80nS
@@ -1508,8 +1427,7 @@ struct s_smc *smc ;
 	outpd(ADDR(B2_RTM_INI),smc->mib.a[PATH0].fddiPATHT_Rmode) ;
 }
 
-static void smt_split_up_fifo(smc)
-struct s_smc *smc ;
+static void smt_split_up_fifo(struct s_smc *smc)
 {
 
 /*
@@ -1629,8 +1547,7 @@ struct s_smc *smc ;
 		smc->hw.fp.fifo.tx_a0_start, smc->hw.fp.fifo.rx2_fifo_start) ;
 }
 
-void formac_reinit_tx(smc)
-struct s_smc *smc ;
+void formac_reinit_tx(struct s_smc *smc)
 {
 	/*
 	 * Split up the FIFO and reinitialize the MAC if synchronous
@@ -1642,4 +1559,3 @@ struct s_smc *smc ;
 	}
 }
 
-
diff --git a/drivers/net/skfp/h/cmtdef.h b/drivers/net/skfp/h/cmtdef.h
index f4e6c4826..603982deb 100644
--- a/drivers/net/skfp/h/cmtdef.h
+++ b/drivers/net/skfp/h/cmtdef.h
@@ -418,7 +418,6 @@ struct s_pcon {
 	void	*pc_p ;
 } ;
 
-
 /*
  * link error monitor
  */
@@ -444,7 +443,6 @@ struct lem_counter {
 
 #define NUMBITS	10
 
-
 #ifdef	AMDPLC
 
 /*
@@ -480,216 +478,180 @@ struct s_plc {
  * function prototypes
  */
 #include "h/mbuf.h"	/* Type definitions for MBUFs */
-void hwt_restart(                       /* hwt.c */
-#ifdef ANSIC
-        struct s_smc *smc
-#endif
-	) ;
-
-SMbuf *smt_build_frame(                 /* smt.c */
-#ifdef ANSIC
-        struct s_smc *smc,
-        int class,
-        int type,
-        int length
-#endif
-	) ;
+#include "h/smtstate.h"	/* struct smt_state */
 
-SMbuf *smt_get_mbuf(                     /* drvsr.c */
-#ifdef ANSIC
-        struct s_smc *smc
-#endif
-	) ;
-
-void *sm_to_para(                       /* smt.c */
-#ifdef ANSIC
-	struct s_smc *smc,
-        struct smt_header *sm,
-        int para
-#endif
-	) ;
+void hwt_restart(struct s_smc *smc);	/* hwt.c */
+SMbuf *smt_build_frame(struct s_smc *smc, int class, int type,
+		       int length);	/* smt.c */
+SMbuf *smt_get_mbuf(struct s_smc *smc);	/* drvsr.c */
+void *sm_to_para(struct s_smc *smc, struct smt_header *sm,
+		 int para);		/* smt.c */
 
 #ifndef SK_UNUSED
 #define SK_UNUSED(var)		(void)(var)
 #endif
 
-void queue_event() ;
-void ecm() ;
-void ecm_init() ;
-void rmt() ;
-void rmt_init() ;
-void pcm() ;
-void pcm_init() ;
-void cfm() ;
-void cfm_init() ;
-void smt_timer_start() ;
-void smt_timer_stop() ;
-void pcm_status_state() ;
-void plc_config_mux() ;
-void sm_lem_evaluate() ;
-void smt_clear_una_dna() ;
-void mac_status_para() ;
-void mac_update_counter() ;
-void sm_pm_ls_latch() ;
-void sm_ma_control() ;
-void sm_mac_check_beacon_claim() ;
-void config_mux() ;
-void smt_agent_init() ;
-void smt_timer_init() ;
-void smt_received_pack() ;
-void smt_add_para() ;
-void smt_swap_para() ;
-void ev_init() ;
-void hwt_init() ;
-u_long hwt_read() ;
-void hwt_stop() ;
-void hwt_start() ;
-void smt_send_mbuf() ;
-void smt_free_mbuf() ;
-void sm_pm_bypass_req() ;
-void rmt_indication() ;
-void cfm_state_change() ;
-void rx_indication() ;
-void tx_indication() ;
-#ifndef NO_SMT_PANIC
-void smt_panic() ;
-#else
-#ifdef	DEBUG
-void smt_panic() ;
+void queue_event(struct s_smc *smc, int class, int event);
+void ecm(struct s_smc *smc, int event);
+void ecm_init(struct s_smc *smc);
+void rmt(struct s_smc *smc, int event);
+void rmt_init(struct s_smc *smc);
+void pcm(struct s_smc *smc, const int np, int event);
+void pcm_init(struct s_smc *smc);
+void cfm(struct s_smc *smc, int event);
+void cfm_init(struct s_smc *smc);
+void smt_timer_start(struct s_smc *smc, struct smt_timer *timer, u_long time,
+		     u_long token);
+void smt_timer_stop(struct s_smc *smc, struct smt_timer *timer);
+void pcm_status_state(struct s_smc *smc, int np, int *type, int *state,
+		      int *remote, int *mac);
+void plc_config_mux(struct s_smc *smc, int mux);
+void sm_lem_evaluate(struct s_smc *smc);
+void smt_clear_una_dna(struct s_smc *smc);
+void mac_update_counter(struct s_smc *smc);
+void sm_pm_ls_latch(struct s_smc *smc, int phy, int on_off);
+void sm_ma_control(struct s_smc *smc, int mode);
+void sm_mac_check_beacon_claim(struct s_smc *smc);
+void config_mux(struct s_smc *smc, int mux);
+void smt_agent_init(struct s_smc *smc);
+void smt_timer_init(struct s_smc *smc);
+void smt_received_pack(struct s_smc *smc, SMbuf *mb, int fs);
+void smt_add_para(struct s_smc *smc, struct s_pcon *pcon, u_short para,
+		  int index, int local);
+void smt_swap_para(struct smt_header *sm, int len, int direction);
+void ev_init(struct s_smc *smc);
+void hwt_init(struct s_smc *smc);
+u_long hwt_read(struct s_smc *smc);
+void hwt_stop(struct s_smc *smc);
+void hwt_start(struct s_smc *smc, u_long time);
+void smt_send_mbuf(struct s_smc *smc, SMbuf *mb, int fc);
+void smt_free_mbuf(struct s_smc *smc, SMbuf *mb);
+void sm_pm_bypass_req(struct s_smc *smc, int mode);
+void rmt_indication(struct s_smc *smc, int i);
+void cfm_state_change(struct s_smc *smc, int c_state);
+
+#if defined(DEBUG) || !defined(NO_SMT_PANIC)
+void smt_panic(struct s_smc *smc, char *text);
 #else
 #define	smt_panic(smc,text)
-#endif	/* DEBUG */
-#endif	/* NO_SMT_PANIC */
-void smt_stat_counter() ;
-void smt_timer_poll() ;
-u_long smt_get_time() ;
-u_long smt_get_tid() ;
-void smt_timer_done() ;
-void smt_set_defaults() ;
-void smt_fixup_mib() ;
-void smt_reset_defaults() ;
-void smt_agent_task() ;
-void smt_please_reconnect() ;
-int smt_check_para() ;
-void driver_get_bia() ;
-#ifdef	SUPERNET_3
-void drv_reset_indication() ;
+#endif /* DEBUG || !NO_SMT_PANIC */
+
+void smt_stat_counter(struct s_smc *smc, int stat);
+void smt_timer_poll(struct s_smc *smc);
+u_long smt_get_time(void);
+u_long smt_get_tid(struct s_smc *smc);
+void smt_timer_done(struct s_smc *smc);
+void smt_set_defaults(struct s_smc *smc);
+void smt_fixup_mib(struct s_smc *smc);
+void smt_reset_defaults(struct s_smc *smc, int level);
+void smt_agent_task(struct s_smc *smc);
+void smt_please_reconnect(struct s_smc *smc, int reconn_time);
+int smt_check_para(struct s_smc *smc, struct smt_header *sm,
+		   const u_short list[]);
+void driver_get_bia(struct s_smc *smc, struct fddi_addr *bia_addr);
+
+#ifdef SUPERNET_3
+void drv_reset_indication(struct s_smc *smc);
 #endif	/* SUPERNET_3 */
-void smt_start_watchdog() ;
-
-void smt_event() ;
-void pcm_event() ;
-void rmt_event() ;
-void cfm_event() ;
-void timer_event() ;
-void ev_dispatcher() ;
-
-void smt_get_state() ;
-void ecm_get_state() ;
-void pcm_get_state() ;
-void rmt_get_state() ;
-
-void ecm_state_change() ;
-int sm_pm_bypass_present() ;
-void pcm_state_change() ;
-void rmt_state_change() ;
-int sm_pm_get_ls() ;
-int pcm_get_s_port() ;
-int pcm_rooted_station() ;
-int cfm_get_mac_input() ;
-int cfm_get_mac_output() ;
-int port_to_mib() ;
-int cem_build_path() ;
-int sm_mac_get_tx_state() ;
-int is_individual() ;
-int is_my_addr() ;
-int is_broadcast() ;
-int is_equal() ;
-char *get_pcmstate() ;
-
-int smt_action() ;
-u_short smt_online() ;
-void smt_force_irq() ;
-void smt_pmf_received_pack() ;
-void smt_send_frame() ;
-void smt_set_timestamp() ;
-void mac_set_rx_mode() ;
-int mac_add_multicast() ;
-int mac_set_func_addr() ;
-void mac_del_multicast() ;
-void mac_update_multicast() ;
-void mac_clear_multicast() ;
-void mac_rx_directed_beacon() ;
-void set_formac_tsync() ;
-void formac_reinit_tx() ;
-void formac_tx_restart() ;
-void process_receive() ;
-void init_driver_fplus() ;
-
-void rtm_irq() ;
-void rtm_set_timer() ;
-void ring_status_indication() ;
-void llc_recover_tx() ;
-void llc_restart_tx() ;
-void plc_clear_irq() ;
-void plc_irq() ;
-int smt_set_mac_opvalues() ;
-#ifdef	TAG_MODE
-void mac_drv_pci_fix() ;
-void mac_do_pci_fix() ;
-void mac_drv_clear_tx_queue() ;
-void mac_drv_repair_descr() ;
-u_long hwt_quick_read() ;
-void hwt_wait_time() ;
+
+void smt_start_watchdog(struct s_smc *smc);
+void smt_event(struct s_smc *smc, int event);
+void timer_event(struct s_smc *smc, u_long token);
+void ev_dispatcher(struct s_smc *smc);
+void pcm_get_state(struct s_smc *smc, struct smt_state *state);
+void ecm_state_change(struct s_smc *smc, int e_state);
+int sm_pm_bypass_present(struct s_smc *smc);
+void pcm_state_change(struct s_smc *smc, int plc, int p_state);
+void rmt_state_change(struct s_smc *smc, int r_state);
+int sm_pm_get_ls(struct s_smc *smc, int phy);
+int pcm_get_s_port(struct s_smc *smc);
+int pcm_rooted_station(struct s_smc *smc);
+int cfm_get_mac_input(struct s_smc *smc);
+int cfm_get_mac_output(struct s_smc *smc);
+int port_to_mib(struct s_smc *smc, int p);
+int cem_build_path(struct s_smc *smc, char *to, int path_index);
+int sm_mac_get_tx_state(struct s_smc *smc);
+char *get_pcmstate(struct s_smc *smc, int np);
+int smt_action(struct s_smc *smc, int class, int code, int index);
+u_short smt_online(struct s_smc *smc, int on);
+void smt_force_irq(struct s_smc *smc);
+void smt_pmf_received_pack(struct s_smc *smc, SMbuf *mb, int local);
+void smt_send_frame(struct s_smc *smc, SMbuf *mb, int fc, int local);
+void smt_set_timestamp(struct s_smc *smc, u_char *p);
+void mac_set_rx_mode(struct s_smc *smc,	int mode);
+int mac_add_multicast(struct s_smc *smc, struct fddi_addr *addr, int can);
+int mac_set_func_addr(struct s_smc *smc, u_long f_addr);
+void mac_del_multicast(struct s_smc *smc, struct fddi_addr *addr, int can);
+void mac_update_multicast(struct s_smc *smc);
+void mac_clear_multicast(struct s_smc *smc);
+void set_formac_tsync(struct s_smc *smc, long sync_bw);
+void formac_reinit_tx(struct s_smc *smc);
+void formac_tx_restart(struct s_smc *smc);
+void process_receive(struct s_smc *smc);
+void init_driver_fplus(struct s_smc *smc);
+void rtm_irq(struct s_smc *smc);
+void rtm_set_timer(struct s_smc *smc);
+void ring_status_indication(struct s_smc *smc, u_long status);
+void llc_recover_tx(struct s_smc *smc);
+void llc_restart_tx(struct s_smc *smc);
+void plc_clear_irq(struct s_smc *smc, int p);
+void plc_irq(struct s_smc *smc,	int np,	unsigned int cmd);
+int smt_set_mac_opvalues(struct s_smc *smc);
+
+#ifdef TAG_MODE
+void mac_drv_pci_fix(struct s_smc *smc, u_long fix_value);
+void mac_do_pci_fix(struct s_smc *smc);
+void mac_drv_clear_tx_queue(struct s_smc *smc);
+void mac_drv_repair_descr(struct s_smc *smc);
+u_long hwt_quick_read(struct s_smc *smc);
+void hwt_wait_time(struct s_smc *smc, u_long start, long duration);
 #endif
 
 #ifdef SMT_PNMI
-#ifdef ANSIC
-int pnmi_init (struct s_smc* smc);
-int pnmi_process_ndis_id (struct s_smc* smc, u_long ndis_oid, void* buf,
-		int len, int* BytesAccessed, int* BytesNeeded, u_char action);
-#else
-int pnmi_init ();
-int pnmi_process_ndis_id ();
-#endif
+int pnmi_init(struct s_smc* smc);
+int pnmi_process_ndis_id(struct s_smc *smc, u_long ndis_oid, void *buf, int len,
+			 int *BytesAccessed, int *BytesNeeded, u_char action);
 #endif
 
 #ifdef	SBA
 #ifndef _H2INC
-void sba() ;
+void sba();
 #endif
-void sba_raf_received_pack() ;
-void sba_timer_poll() ;
-void smt_init_sba() ;
+void sba_raf_received_pack();
+void sba_timer_poll();
+void smt_init_sba();
 #endif
+
 #ifdef	ESS
-int ess_raf_received_pack() ;
-void ess_timer_poll() ;
-void ess_para_change() ;
+int ess_raf_received_pack(struct s_smc *smc, SMbuf *mb, struct smt_header *sm,
+			  int fs);
+void ess_timer_poll(struct s_smc *smc);
+void ess_para_change(struct s_smc *smc);
 #endif
 
-#ifdef	BOOT
-#define smt_srf_event(a,b,c,d)
-#define smt_init_evc(a)
+#ifndef	BOOT
+void smt_init_evc(struct s_smc *smc);
+void smt_srf_event(struct s_smc *smc, int code, int index, int cond);
 #else
-void smt_init_evc() ;
-void smt_srf_event() ;
+#define smt_init_evc(smc)
+#define smt_srf_event(smc,code,index,cond)
 #endif
 
 #ifndef SMT_REAL_TOKEN_CT
-void smt_emulate_token_ct();
+void smt_emulate_token_ct(struct s_smc *smc, int mac_index);
 #endif
 
 #if defined(DEBUG) && !defined(BOOT)
-void dump_smt() ;
+void dump_smt(struct s_smc *smc, struct smt_header *sm, char *text);
 #else
 #define	dump_smt(smc,sm,text)
 #endif
 
 #ifdef	DEBUG
-char	*addr_to_string() ;
-void	dump_hex() ;
+char* addr_to_string(struct fddi_addr *addr);
+void dump_hex(char *p, int len);
 #endif
+
 #endif	/* PROTOTYP_INC */
 
 /* PNMI default defines */
diff --git a/drivers/net/skfp/h/smtstate.h b/drivers/net/skfp/h/smtstate.h
index 689fa25dc..62fe69507 100644
--- a/drivers/net/skfp/h/smtstate.h
+++ b/drivers/net/skfp/h/smtstate.h
@@ -12,6 +12,9 @@
  *
  ******************************************************************************/
 
+#ifndef _SKFP_H_SMTSTATE_H_
+#define _SKFP_H_SMTSTATE_H_
+
 /*
  *	SMT state definitions
  */
@@ -98,3 +101,6 @@ struct pcm_state {
 struct smt_state {
 	struct pcm_state pcm_state[NUMPHYS] ;	/* port A & port B */
 } ;
+
+#endif
+
diff --git a/drivers/net/skfp/h/targetos.h b/drivers/net/skfp/h/targetos.h
index 94a81eede..59de39e29 100644
--- a/drivers/net/skfp/h/targetos.h
+++ b/drivers/net/skfp/h/targetos.h
@@ -110,7 +110,7 @@
 struct s_skfp_ioctl {
 	unsigned short cmd;                /* Command to run */
 	unsigned short len;                /* Length of the data buffer */
-	unsigned char  *data;              /* Pointer to the data buffer */
+	unsigned char __user *data;        /* Pointer to the data buffer */
 };
 
 /* 
diff --git a/drivers/net/skfp/hwmtm.c b/drivers/net/skfp/hwmtm.c
index ea5f5e090..6a74332f0 100644
--- a/drivers/net/skfp/hwmtm.c
+++ b/drivers/net/skfp/hwmtm.c
@@ -75,15 +75,17 @@ extern	u_char	force_irq_pending ;
 	-------------------------------------------------------------
 */
 
-static	void	queue_llc_rx(),		smt_to_llc(),
-		init_txd_ring(),	init_rxd_ring(),
-		queue_txd_mb() ;
-
-static	u_long	init_descr_ring(),	repair_txd_ring(),
-		repair_rxd_ring() ;
-
-static	SMbuf	*get_llc_rx(),		*get_txd_mb() ;
-
+static void queue_llc_rx(struct s_smc *smc, SMbuf *mb);
+static void smt_to_llc(struct s_smc *smc, SMbuf *mb);
+static void init_txd_ring(struct s_smc *smc);
+static void init_rxd_ring(struct s_smc *smc);
+static void queue_txd_mb(struct s_smc *smc, SMbuf *mb);
+static u_long init_descr_ring(struct s_smc *smc, union s_fp_descr volatile *start,
+			      int count);
+static u_long repair_txd_ring(struct s_smc *smc, struct s_smt_tx_queue *queue);
+static u_long repair_rxd_ring(struct s_smc *smc, struct s_smt_rx_queue *queue);
+static SMbuf* get_llc_rx(struct s_smc *smc);
+static SMbuf* get_txd_mb(struct s_smc *smc);
 
 /*
 	-------------------------------------------------------------
@@ -92,55 +94,81 @@ static	SMbuf	*get_llc_rx(),		*get_txd_mb() ;
 */
 /*	The external SMT functions are listed in cmtdef.h */
 
-extern	void	*mac_drv_get_space(),	*mac_drv_get_desc_mem(),
-		init_board(),		mac_drv_fill_rxd(),
-		plc1_irq(),		mac_drv_tx_complete(),
-		plc2_irq(),		mac1_irq(),
-		mac2_irq(),		mac3_irq(),
-		timer_irq(),		mac_drv_rx_complete(),
-		mac_drv_requeue_rxd(),	init_plc(),
-		mac_drv_clear_rxd(),	llc_restart_tx(),
-		ev_dispatcher(),	smt_force_irq() ;
+extern void* mac_drv_get_space(struct s_smc *smc, unsigned int size);
+extern void* mac_drv_get_desc_mem(struct s_smc *smc, unsigned int size);
+extern void init_board(struct s_smc *smc, u_char *mac_addr);
+extern void mac_drv_fill_rxd(struct s_smc *smc);
+extern void plc1_irq(struct s_smc *smc);
+extern void mac_drv_tx_complete(struct s_smc *smc,
+				volatile struct s_smt_fp_txd *txd);
+extern void plc2_irq(struct s_smc *smc);
+extern void mac1_irq(struct s_smc *smc, u_short stu, u_short stl);
+extern void mac2_irq(struct s_smc *smc, u_short code_s2u, u_short code_s2l);
+extern void mac3_irq(struct s_smc *smc, u_short code_s3u, u_short code_s3l);
+extern void timer_irq(struct s_smc *smc);
+extern void mac_drv_rx_complete(struct s_smc *smc,
+				volatile struct s_smt_fp_rxd *rxd,
+				int frag_count, int len);
+extern void mac_drv_requeue_rxd(struct s_smc *smc, 
+				volatile struct s_smt_fp_rxd *rxd,
+				int frag_count);
+extern void init_plc(struct s_smc *smc);
+extern void mac_drv_clear_rxd(struct s_smc *smc,
+			      volatile struct s_smt_fp_rxd *rxd, int frag_count);
 
 #ifdef	USE_OS_CPY
-extern	void	hwm_cpy_rxd2mb(),	hwm_cpy_txd2mb() ;
+extern void hwm_cpy_rxd2mb(void);
+extern void hwm_cpy_txd2mb(void);
 #endif
+
 #ifdef	ALL_RX_COMPLETE
-extern	void	mac_drv_all_receives_complete() ;
+extern void mac_drv_all_receives_complete(void);
 #endif
 
-extern	u_long	mac_drv_virt2phys(),	dma_master() ;
+extern u_long mac_drv_virt2phys(struct s_smc *smc, void *virt);
+extern u_long dma_master(struct s_smc *smc, void *virt, int len, int flag);
 
 #ifdef	NDIS_OS2
-extern	void	post_proc() ;
+extern void post_proc(void);
 #else
-extern	void	dma_complete() ;
+extern void dma_complete(struct s_smc *smc, volatile union s_fp_descr *descr,
+			 int flag);
 #endif
 
-extern	int	init_fplus(),		mac_drv_rx_init() ;
+extern int init_fplus(struct s_smc *smc);
+extern int mac_drv_rx_init(struct s_smc *smc, int len, int fc, char *look_ahead,
+			   int la_len);
 
 /*
 	-------------------------------------------------------------
 	PUBLIC FUNCTIONS:
 	-------------------------------------------------------------
 */
-	void	process_receive(),	smt_send_mbuf(),
-		fddi_isr(),		mac_drv_clear_txd(),
-		smt_free_mbuf(),	init_driver_fplus(),
-		mac_drv_rx_mode(),	init_fddi_driver(),
-		mac_drv_clear_tx_queue(),
-		mac_drv_clear_rx_queue(),
-		hwm_tx_frag(),		hwm_rx_frag() ;
-
-	int	mac_drv_rx_frag(),	mac_drv_init(),
-		hwm_tx_init() ;
-
-	u_int	mac_drv_check_space() ;
-
-	SMbuf 	*smt_get_mbuf() ;
+void process_receive(struct s_smc *smc);
+void fddi_isr(struct s_smc *smc);
+void mac_drv_clear_txd(struct s_smc *smc);
+void smt_free_mbuf(struct s_smc *smc, SMbuf *mb);
+void init_driver_fplus(struct s_smc *smc);
+void mac_drv_rx_mode(struct s_smc *smc, int mode);
+void init_fddi_driver(struct s_smc *smc, u_char *mac_addr);
+void mac_drv_clear_tx_queue(struct s_smc *smc);
+void mac_drv_clear_rx_queue(struct s_smc *smc);
+void hwm_tx_frag(struct s_smc *smc, char far *virt, u_long phys, int len,
+		 int frame_status);
+void hwm_rx_frag(struct s_smc *smc, char far *virt, u_long phys, int len,
+		 int frame_status);
+
+int mac_drv_rx_frag(struct s_smc *smc, void far *virt, int len);
+int mac_drv_init(struct s_smc *smc);
+int hwm_tx_init(struct s_smc *smc, u_char fc, int frag_count, int frame_len,
+		int frame_status);
+
+u_int mac_drv_check_space(void);
+
+SMbuf* smt_get_mbuf(struct s_smc *smc);
 
 #ifdef DEBUG
-	void	mac_drv_debug_lev() ;
+	void mac_drv_debug_lev(void);
 #endif
 
 /*
@@ -208,7 +236,7 @@ extern	int	init_fplus(),		mac_drv_rx_init() ;
  *
  *	END_MANUAL_ENTRY
  */
-u_int mac_drv_check_space()
+u_int mac_drv_check_space(void)
 {
 #ifdef	MB_OUTSIDE_SMC
 #ifdef	COMMON_MB_POOL
@@ -238,8 +266,7 @@ u_int mac_drv_check_space()
  *			mac_drv_init once, after the adatper is detected.
  *	END_MANUAL_ENTRY
  */
-int mac_drv_init(smc)
-struct s_smc *smc ;
+int mac_drv_init(struct s_smc *smc)
 {
 	if (sizeof(struct s_smt_fp_rxd) % 16) {
 		SMT_PANIC(smc,HWM_E0001,HWM_E0001_MSG) ;
@@ -289,8 +316,7 @@ struct s_smc *smc ;
  *	 least significant byte etc.)
  *	END_MANUAL_ENTRY
  */
-void init_driver_fplus(smc)
-struct s_smc *smc ;
+void init_driver_fplus(struct s_smc *smc)
 {
 	smc->hw.fp.mdr2init = FM_LSB | FM_BMMODE | FM_ENNPRQ | FM_ENHSRQ | 3 ;
 
@@ -305,10 +331,9 @@ struct s_smc *smc ;
 #endif
 }
 
-static u_long init_descr_ring(smc,start,count)
-struct s_smc *smc ;
-union s_fp_descr volatile *start;
-int count ;
+static u_long init_descr_ring(struct s_smc *smc,
+			      union s_fp_descr volatile *start,
+			      int count)
 {
 	int i ;
 	union s_fp_descr volatile *d1 ;
@@ -337,8 +362,7 @@ int count ;
 	return(phys) ;
 }
 
-static void init_txd_ring(smc)
-struct s_smc *smc ;
+static void init_txd_ring(struct s_smc *smc)
 {
 	struct s_smt_fp_txd volatile *ds ;
 	struct s_smt_tx_queue *queue ;
@@ -375,8 +399,7 @@ struct s_smc *smc ;
 	outpd(ADDR(B5_XS_DA),phys) ;
 }
 
-static void init_rxd_ring(smc)
-struct s_smc *smc ;
+static void init_rxd_ring(struct s_smc *smc)
 {
 	struct s_smt_fp_rxd volatile *ds ;
 	struct s_smt_rx_queue *queue ;
@@ -406,9 +429,7 @@ struct s_smc *smc ;
  *
  *	END_MANUAL_ENTRY
  */
-void init_fddi_driver(smc,mac_addr)
-struct	s_smc	*smc ;
-u_char		*mac_addr ;	/* canonical address */
+void init_fddi_driver(struct s_smc *smc, u_char *mac_addr)
 {
 	SMbuf	*mb ;
 	int	i ;
@@ -472,8 +493,7 @@ u_char		*mac_addr ;	/* canonical address */
 }
 
 
-SMbuf *smt_get_mbuf(smc)
-struct s_smc *smc ;
+SMbuf *smt_get_mbuf(struct s_smc *smc)
 {
 	register SMbuf	*mb ;
 
@@ -495,9 +515,7 @@ struct s_smc *smc ;
 	return (mb) ;	/* May be NULL */
 }
 
-void smt_free_mbuf(smc, mb)
-struct s_smc	*smc ;
-SMbuf		*mb;
+void smt_free_mbuf(struct s_smc *smc, SMbuf *mb)
 {
 
 	if (mb) {
@@ -543,8 +561,7 @@ SMbuf		*mb;
  *
  *	END_MANUAL_ENTRY
  */
-void mac_drv_repair_descr(smc)
-struct s_smc *smc ;
+void mac_drv_repair_descr(struct s_smc *smc)
 {
 	u_long	phys ;
 
@@ -576,9 +593,7 @@ struct s_smc *smc ;
 	outpd(ADDR(B0_R1_CSR),CSR_START) ;
 }
 
-static u_long repair_txd_ring(smc,queue)
-struct s_smc *smc ;
-struct s_smt_tx_queue *queue ;
+static u_long repair_txd_ring(struct s_smc *smc, struct s_smt_tx_queue *queue)
 {
 	int i ;
 	int tx_used ;
@@ -630,9 +645,7 @@ struct s_smt_tx_queue *queue ;
  *	  RxDs with an OWN bit set but with a reset STF bit should be
  *	  skipped and owned by the driver (OWN = 0). 
  */
-static u_long repair_rxd_ring(smc,queue)
-struct s_smc *smc ;
-struct s_smt_rx_queue *queue ;
+static u_long repair_rxd_ring(struct s_smc *smc, struct s_smt_rx_queue *queue)
 {
 	int i ;
 	int rx_used ;
@@ -703,8 +716,7 @@ struct s_smt_rx_queue *queue ;
  *
  *	END_MANUAL_ENTRY
  */
-void fddi_isr(smc)
-struct s_smc *smc ;
+void fddi_isr(struct s_smc *smc)
 {
 	u_long		is ;		/* ISR source */
 	u_short		stu, stl ;
@@ -987,9 +999,7 @@ struct s_smc *smc ;
  *
  *	END_MANUAL_ENTRY
  */
-void mac_drv_rx_mode(smc,mode)
-struct s_smc *smc ;
-int mode ;
+void mac_drv_rx_mode(struct s_smc *smc, int mode)
 {
 	switch(mode) {
 	case RX_ENABLE_PASS_SMT:
@@ -1038,8 +1048,7 @@ int mode ;
 /*
  * process receive queue
  */
-void process_receive(smc)
-struct s_smc *smc ;
+void process_receive(struct s_smc *smc)
 {
 	int i ;
 	int n ;
@@ -1379,9 +1388,7 @@ rx_end:
 	return ;	/* lint bug: needs return detect end of function */
 }
 
-static void smt_to_llc(smc,mb)
-struct s_smc *smc ;
-SMbuf *mb ;
+static void smt_to_llc(struct s_smc *smc, SMbuf *mb)
 {
 	u_char	fc ;
 
@@ -1416,12 +1423,8 @@ SMbuf *mb ;
  *
  *	END_MANUAL_ENTRY
  */
-void hwm_rx_frag(smc,virt,phys,len,frame_status)
-struct s_smc *smc ;
-char far *virt ;
-u_long phys ;
-int len ;
-int frame_status ;
+void hwm_rx_frag(struct s_smc *smc, char far *virt, u_long phys, int len,
+		 int frame_status)
 {
 	struct s_smt_fp_rxd volatile *r ;
 	u_int	rbctrl ;
@@ -1460,10 +1463,7 @@ int frame_status ;
  *
  *	END_MANUAL_ENTRY
  */
-int mac_drv_rx_frag(smc,virt,len)
-struct s_smc *smc ;
-void far *virt ;
-int len ;
+int mac_drv_rx_frag(struct s_smc *smc, void far *virt, int len)
 {
 	NDD_TRACE("RHSB",virt,len,smc->os.hwm.r.mb_pos) ;
 
@@ -1500,8 +1500,7 @@ int len ;
  *
  *	END_MANUAL_ENTRY
  */
-void mac_drv_clear_rx_queue(smc)
-struct s_smc *smc ;
+void mac_drv_clear_rx_queue(struct s_smc *smc)
 {
 	struct s_smt_fp_rxd volatile *r ;
 	struct s_smt_fp_rxd volatile *next_rxd ;
@@ -1588,12 +1587,8 @@ struct s_smc *smc ;
  *
  *	END_MANUAL_ENTRY
  */
-int hwm_tx_init(smc,fc,frag_count,frame_len,frame_status)
-struct	s_smc *smc ;
-u_char fc ;
-int frag_count ;
-int frame_len ;
-int frame_status ;
+int hwm_tx_init(struct s_smc *smc, u_char fc, int frag_count, int frame_len,
+		int frame_status)
 {
 	NDD_TRACE("THiB",fc,frag_count,frame_len) ;
 	smc->os.hwm.tx_p = smc->hw.fp.tx[frame_status & QUEUE_A0] ;
@@ -1670,12 +1665,8 @@ int frame_status ;
  *
  *	END_MANUAL_ENTRY
  */
-void hwm_tx_frag(smc,virt,phys,len,frame_status)
-struct	s_smc *smc ;
-char far *virt ;
-u_long phys ;
-int len ;
-int frame_status ;
+void hwm_tx_frag(struct s_smc *smc, char far *virt, u_long phys, int len,
+		 int frame_status)
 {
 	struct s_smt_fp_txd volatile *t ;
 	struct s_smt_tx_queue *queue ;
@@ -1780,9 +1771,7 @@ int frame_status ;
 /*
  * queues a receive for later send
  */
-static void queue_llc_rx(smc,mb)
-struct	s_smc *smc ;
-SMbuf	*mb ;
+static void queue_llc_rx(struct s_smc *smc, SMbuf *mb)
 {
 	DB_GEN("queue_llc_rx: mb = %x",(void *)mb,0,4) ;
 	smc->os.hwm.queued_rx_frames++ ;
@@ -1806,8 +1795,7 @@ SMbuf	*mb ;
 /*
  * get a SMbuf from the llc_rx_queue
  */
-static SMbuf *get_llc_rx(smc)
-struct	s_smc *smc ;
+static SMbuf *get_llc_rx(struct s_smc *smc)
 {
 	SMbuf	*mb ;
 
@@ -1823,9 +1811,7 @@ struct	s_smc *smc ;
  * queues a transmit SMT MBuf during the time were the MBuf is
  * queued the TxD ring
  */
-static void queue_txd_mb(smc,mb)
-struct	s_smc *smc ;
-SMbuf	*mb ;
+static void queue_txd_mb(struct s_smc *smc, SMbuf *mb)
 {
 	DB_GEN("_rx: queue_txd_mb = %x",(void *)mb,0,4) ;
 	smc->os.hwm.queued_txd_mb++ ;
@@ -1842,8 +1828,7 @@ SMbuf	*mb ;
 /*
  * get a SMbuf from the txd_tx_queue
  */
-static SMbuf *get_txd_mb(smc)
-struct	s_smc *smc ;
+static SMbuf *get_txd_mb(struct s_smc *smc)
 {
 	SMbuf *mb ;
 
@@ -1858,10 +1843,7 @@ struct	s_smc *smc ;
 /*
  *	SMT Send function
  */
-void smt_send_mbuf(smc,mb,fc)
-struct s_smc	*smc;
-SMbuf		*mb;
-int		fc;
+void smt_send_mbuf(struct s_smc *smc, SMbuf *mb, int fc)
 {
 	char far *data ;
 	int	len ;
@@ -1995,12 +1977,11 @@ int		fc;
  *
  *	END_MANUAL_ENTRY
  */
-void mac_drv_clear_txd(smc)
-struct s_smc *smc ;
+void mac_drv_clear_txd(struct s_smc *smc)
 {
 	struct s_smt_tx_queue *queue ;
 	struct s_smt_fp_txd volatile *t1 ;
-	struct s_smt_fp_txd volatile *t2=0 ;
+	struct s_smt_fp_txd volatile *t2 = NULL ;
 	SMbuf *mb ;
 	u_long	tbctrl ;
 	int i ;
@@ -2087,8 +2068,7 @@ free_next_queue: ;
  *
  *	END_MANUAL_ENTRY
  */
-void mac_drv_clear_tx_queue(smc)
-struct s_smc *smc ;
+void mac_drv_clear_tx_queue(struct s_smc *smc)
 {
 	struct s_smt_fp_txd volatile *t ;
 	struct s_smt_tx_queue *queue ;
@@ -2180,10 +2160,7 @@ struct s_smc *smc ;
  *
  *	END_MANUAL_ENTRY
  */
-void mac_drv_debug_lev(smc,flag,lev)
-struct s_smc *smc ;
-int flag ;
-int lev ;
+void mac_drv_debug_lev(struct s_smc *smc, int flag, int lev)
 {
 	switch(flag) {
 	case (int)NULL:
diff --git a/drivers/net/skfp/hwt.c b/drivers/net/skfp/hwt.c
index 50755ba8a..e01f8a0f3 100644
--- a/drivers/net/skfp/hwt.c
+++ b/drivers/net/skfp/hwt.c
@@ -39,7 +39,7 @@ static const char ID_sccs[] = "@(#)hwt.c	1.13 97/04/23 (C) SK " ;
  * Prototypes of local functions.
  */
 /* 28-Jun-1994 sw - Note: hwt_restart() is also used in module 'drvfbi.c'. */
-/*static*/ void hwt_restart() ;
+/*static void hwt_restart() ; */
 
 /************************
  *
@@ -60,9 +60,7 @@ static const char ID_sccs[] = "@(#)hwt.c	1.13 97/04/23 (C) SK " ;
  ************************/
 #define	HWT_MAX	(65000)
 
-void hwt_start(smc, time)
-struct s_smc *smc ;
-u_long time ;
+void hwt_start(struct s_smc *smc, u_long time)
 {
 	u_short	cnt ;
 
@@ -115,8 +113,7 @@ u_long time ;
  *	Nothing.
  *
  ************************/
-void hwt_stop(smc)
-struct s_smc *smc ;
+void hwt_stop(struct s_smc *smc)
 {
 #ifndef PCI
 	/* stop counter 0 by switching to mode 0 */
@@ -145,8 +142,7 @@ struct s_smc *smc ;
  *	Nothing.
  *
  ************************/
-void hwt_init(smc)
-struct s_smc *smc ;
+void hwt_init(struct s_smc *smc)
 {
 	smc->hw.t_start = 0 ;
 	smc->hw.t_stop	= 0 ;
@@ -169,8 +165,7 @@ struct s_smc *smc ;
  *	Nothing.
  *
  ************************/
-void hwt_restart(smc)
-struct s_smc *smc ;
+void hwt_restart(struct s_smc *smc)
 {
 	hwt_stop(smc) ;
 #ifndef	PCI
@@ -193,8 +188,7 @@ struct s_smc *smc ;
  *	The elapsed time since last start in units of 16us.
  *
  ************************/
-u_long hwt_read(smc)
-struct s_smc *smc ;
+u_long hwt_read(struct s_smc *smc)
 {
 	u_short	tr ;
 #ifndef	PCI
@@ -238,8 +232,7 @@ struct s_smc *smc ;
  *	current timer value in units of 80ns.
  *
  ************************/
-u_long hwt_quick_read(smc)
-struct s_smc *smc ;
+u_long hwt_quick_read(struct s_smc *smc)
 {
 	u_long interval ;
 	u_long time ;
@@ -267,10 +260,7 @@ struct s_smc *smc ;
  * NOTE: The fuction will return immediately, if the timer is not 
  *	 started
  ************************/
-void hwt_wait_time(smc,start,duration)
-struct s_smc *smc ;
-u_long	start ;
-long	duration ;
+void hwt_wait_time(struct s_smc *smc, u_long start, long int duration)
 {
 	long	diff ;
 	long	interval ;
@@ -312,3 +302,4 @@ long	duration ;
 	}
 }
 #endif
+
diff --git a/drivers/net/skfp/lnkstat.c b/drivers/net/skfp/lnkstat.c
index 7d2d94eae..00a248044 100644
--- a/drivers/net/skfp/lnkstat.c
+++ b/drivers/net/skfp/lnkstat.c
@@ -52,8 +52,7 @@ Return	smt_error_word	These bits are supported:
 
 	END_MANUAL_ENTRY()
  */
-u_long smt_get_error_word(smc)
-struct s_smc *smc ;
+u_long smt_get_error_word(struct s_smc *smc)
 {
 	u_long	st;
 
@@ -92,8 +91,7 @@ Return	smt_event_word	always 0
 
 	END_MANUAL_ENTRY()
  */
-u_long smt_get_event_word(smc)
-struct s_smc *smc ;
+u_long smt_get_event_word(struct s_smc *smc)
 {
 	return (u_long) 0;
 }
@@ -111,8 +109,7 @@ Return	smt_port_event_word	always 0
 
 	END_MANUAL_ENTRY()
  */
-u_long smt_get_port_event_word(smc)
-struct s_smc *smc ;
+u_long smt_get_port_event_word(struct s_smc *smc)
 {
 	return (u_long) 0;
 }
@@ -135,10 +132,7 @@ Return	len	used len of the error log field
 
 	END_MANUAL_ENTRY()
  */
-int smt_read_errorlog(smc,p,len)
-struct s_smc *smc ;
-char _far *p ;
-int len ;
+int smt_read_errorlog(struct s_smc *smc, char _far *p, int len)
 {
 	int			i ;
 	int			st ;
@@ -207,3 +201,4 @@ int len ;
 		er->ucode_version_level = 0x0101 ;
 	return(len) ;
 }
+
diff --git a/drivers/net/skfp/pcmplc.c b/drivers/net/skfp/pcmplc.c
index 4be8f3a9e..571f055c0 100644
--- a/drivers/net/skfp/pcmplc.c
+++ b/drivers/net/skfp/pcmplc.c
@@ -199,28 +199,25 @@ static int plc_imsk_act = PL_PCM_CODE | PL_TRACE_PROP | PL_PCM_BREAK |
 			PL_PCM_ENABLED | PL_SELF_TEST | PL_EBUF_ERR;
 
 /* external functions */
-void	all_selection_criteria ();
+void all_selection_criteria(struct s_smc *smc);
 
 /* internal functions */
-static void pcm_fsm() ;
-static void pc_rcode_actions() ;
-static void pc_tcode_actions() ;
-static void reset_lem_struct() ;
-static void plc_init() ;
-static void sm_ph_lem_start() ;
-static void sm_ph_lem_stop() ;
-static void sm_ph_linestate() ;
-static void real_init_plc() ;
+static void pcm_fsm(struct s_smc *smc, struct s_phy *phy, int cmd);
+static void pc_rcode_actions(struct s_smc *smc, int bit, struct s_phy *phy);
+static void pc_tcode_actions(struct s_smc *smc, const int bit, struct s_phy *phy);
+static void reset_lem_struct(struct s_phy *phy);
+static void plc_init(struct s_smc *smc, int p);
+static void sm_ph_lem_start(struct s_smc *smc, int np, int threshold);
+static void sm_ph_lem_stop(struct s_smc *smc, int np);
+static void sm_ph_linestate(struct s_smc *smc, int phy, int ls);
+static void real_init_plc(struct s_smc *smc);
 
 /*
  * SMT timer interface
  *      start PCM timer 0
  */
-static void start_pcm_timer0(smc,value,event,phy)
-struct s_smc *smc ;
-u_long value;
-int event;
-struct s_phy *phy;
+static void start_pcm_timer0(struct s_smc *smc, u_long value, int event,
+			     struct s_phy *phy)
 {
 	phy->timer0_exp = FALSE ;       /* clear timer event flag */
 	smt_timer_start(smc,&phy->pcm_timer0,value,
@@ -230,9 +227,7 @@ struct s_phy *phy;
  * SMT timer interface
  *      stop PCM timer 0
  */
-static void stop_pcm_timer0(smc,phy)
-struct s_smc *smc ;
-struct s_phy *phy;
+static void stop_pcm_timer0(struct s_smc *smc, struct s_phy *phy)
 {
 	if (phy->pcm_timer0.tm_active)
 		smt_timer_stop(smc,&phy->pcm_timer0) ;
@@ -242,8 +237,7 @@ struct s_phy *phy;
 	init PCM state machine (called by driver)
 	clear all PCM vars and flags
 */
-void pcm_init(smc)
-struct s_smc *smc ;
+void pcm_init(struct s_smc *smc)
 {
 	int		i ;
 	int		np ;
@@ -407,8 +401,7 @@ struct s_smc *smc ;
 	real_init_plc(smc) ;
 }
 
-void init_plc(smc)
-struct s_smc *smc ;
+void init_plc(struct s_smc *smc)
 {
 	SK_UNUSED(smc) ;
 
@@ -421,8 +414,7 @@ struct s_smc *smc ;
 	 */
 }
 
-static void real_init_plc(smc)
-struct s_smc *smc ;
+static void real_init_plc(struct s_smc *smc)
 {
 	int	p ;
 
@@ -430,9 +422,7 @@ struct s_smc *smc ;
 		plc_init(smc,p) ;
 }
 
-static void plc_init(smc,p)
-struct s_smc *smc ;
-int p;
+static void plc_init(struct s_smc *smc, int p)
 {
 	int	i ;
 #ifndef	MOT_ELM
@@ -495,10 +485,7 @@ int p;
 /*
  * control PCM state machine
  */
-static void plc_go_state(smc,p,state)
-struct s_smc *smc ;
-int p;
-int state;
+static void plc_go_state(struct s_smc *smc, int p, int state)
 {
 	HW_PTR port ;
 	int val ;
@@ -514,9 +501,7 @@ int state;
 /*
  * read current line state (called by ECM & PCM)
  */
-int sm_pm_get_ls(smc,phy)
-struct s_smc *smc ;
-int phy;
+int sm_pm_get_ls(struct s_smc *smc, int phy)
 {
 	int	state ;
 
@@ -549,10 +534,7 @@ int phy;
 	return(state) ;
 }
 
-static int plc_send_bits(smc,phy,len)
-struct s_smc *smc ;
-struct s_phy *phy;
-int len;
+static int plc_send_bits(struct s_smc *smc, struct s_phy *phy, int len)
 {
 	int np = phy->np ;		/* PHY index */
 	int	n ;
@@ -589,9 +571,7 @@ int len;
 /*
  * config plc muxes
  */
-void plc_config_mux(smc,mux)
-struct s_smc *smc ;
-int mux ;
+void plc_config_mux(struct s_smc *smc, int mux)
 {
 	if (smc->s.sas != SMT_DAS)
 		return ;
@@ -615,10 +595,7 @@ int mux ;
 		process event
 	until SM is stable
 */
-void pcm(smc,np,event)
-struct s_smc *smc ;
-const int np;
-int event;
+void pcm(struct s_smc *smc, const int np, int event)
 {
 	int	state ;
 	int	oldstate ;
@@ -697,10 +674,7 @@ int event;
 /*
  * PCM state machine
  */
-static void pcm_fsm(smc,phy,cmd)
-struct s_smc *smc ;
-struct s_phy *phy;
-int cmd;
+static void pcm_fsm(struct s_smc *smc, struct s_phy *phy, int cmd)
 {
 	int	i ;
 	int	np = phy->np ;		/* PHY index */
@@ -1063,10 +1037,7 @@ int cmd;
 /*
  * force line state on a PHY output	(only in MAINT state)
  */
-static void sm_ph_linestate(smc,phy,ls)
-struct s_smc *smc ;
-int phy;
-int ls;
+static void sm_ph_linestate(struct s_smc *smc, int phy, int ls)
 {
 	int	cntrl ;
 
@@ -1095,9 +1066,7 @@ int ls;
 	outpw(PLC(phy,PL_CNTRL_B),cntrl) ;
 }
 
-
-static void reset_lem_struct(phy)
-struct s_phy *phy;
+static void reset_lem_struct(struct s_phy *phy)
 {
 	struct lem_counter *lem = &phy->lem ;
 
@@ -1108,9 +1077,7 @@ struct s_phy *phy;
 /*
  * link error monitor
  */
-static void lem_evaluate(smc,phy)
-struct s_smc *smc ;
-struct s_phy *phy;
+static void lem_evaluate(struct s_smc *smc, struct s_phy *phy)
 {
 	int ber ;
 	u_long errors ;
@@ -1210,8 +1177,7 @@ struct s_phy *phy;
 /*
  * called by SMT to calculate LEM bit error rate
  */
-void sm_lem_evaluate(smc)
-struct s_smc *smc ;
+void sm_lem_evaluate(struct s_smc *smc)
 {
 	int np ;
 
@@ -1219,9 +1185,7 @@ struct s_smc *smc ;
 		lem_evaluate(smc,&smc->y[np]) ;
 }
 
-static void lem_check_lct(smc,phy)
-struct s_smc *smc ;
-struct s_phy	*phy ;
+static void lem_check_lct(struct s_smc *smc, struct s_phy *phy)
 {
 	struct lem_counter	*lem = &phy->lem ;
 	struct fddi_mib_p	*mib ;
@@ -1265,10 +1229,7 @@ struct s_phy	*phy ;
 /*
  * LEM functions
  */
-static void sm_ph_lem_start(smc,np,threshold)
-struct s_smc *smc ;
-int np;
-int threshold;
+static void sm_ph_lem_start(struct s_smc *smc, int np, int threshold)
 {
 	struct lem_counter *lem = &smc->y[np].lem ;
 
@@ -1286,9 +1247,7 @@ int threshold;
 	SETMASK(PLC(np,PL_INTR_MASK),PL_LE_CTR,PL_LE_CTR) ;
 }
 
-static void sm_ph_lem_stop(smc,np)
-struct s_smc *smc ;
-int np;
+static void sm_ph_lem_stop(struct s_smc *smc, int np)
 {
 	struct lem_counter *lem = &smc->y[np].lem ;
 
@@ -1297,10 +1256,8 @@ int np;
 }
 
 /* ARGSUSED */
-void sm_pm_ls_latch(smc,phy,on_off)
-struct s_smc *smc ;
-int phy;
-int on_off;		/* en- or disable ident. ls */
+void sm_pm_ls_latch(struct s_smc *smc, int phy, int on_off)
+/* int on_off;	en- or disable ident. ls */
 {
 	SK_UNUSED(smc) ;
 
@@ -1317,10 +1274,7 @@ int on_off;		/* en- or disable ident. ls */
 /*
  * PCM pseudo code 5.1 .. 6.1
  */
-static void pc_rcode_actions(smc,bit,phy)
-struct s_smc *smc ;
-int bit;
-struct s_phy *phy;
+static void pc_rcode_actions(struct s_smc *smc, int bit, struct s_phy *phy)
 {
 	struct fddi_mib_p	*mib ;
 
@@ -1456,10 +1410,7 @@ struct s_phy *phy;
 /*
  * PCM pseudo code 5.1 .. 6.1
  */
-static void pc_tcode_actions(smc,bit,phy)
-struct s_smc *smc ;
-const int bit;
-struct s_phy *phy;
+static void pc_tcode_actions(struct s_smc *smc, const int bit, struct s_phy *phy)
 {
 	int	np = phy->np ;
 	struct fddi_mib_p	*mib ;
@@ -1638,8 +1589,7 @@ struct s_phy *phy;
 /*
  * return status twisted (called by SMT)
  */
-int pcm_status_twisted(smc)
-struct s_smc *smc ;
+int pcm_status_twisted(struct s_smc *smc)
 {
 	int	twist = 0 ;
 	if (smc->s.sas != SMT_DAS)
@@ -1658,13 +1608,8 @@ struct s_smc *smc ;
  *	remote phy type
  *	remote mac yes/no
  */
-void pcm_status_state(smc,np,type,state,remote,mac)
-struct s_smc *smc ;
-int np;
-int *type;
-int *state;
-int *remote;
-int *mac;
+void pcm_status_state(struct s_smc *smc, int np, int *type, int *state,
+		      int *remote, int *mac)
 {
 	struct s_phy	*phy = &smc->y[np] ;
 	struct fddi_mib_p	*mib ;
@@ -1687,8 +1632,7 @@ int *mac;
 /*
  * return rooted station status (called by SMT)
  */
-int pcm_rooted_station(smc)
-struct s_smc *smc ;
+int pcm_rooted_station(struct s_smc *smc)
 {
 	int	n ;
 
@@ -1703,10 +1647,8 @@ struct s_smc *smc ;
 /*
  * Interrupt actions for PLC & PCM events
  */
-void plc_irq(smc,np,cmd)
-struct s_smc *smc ;
-int np;			/* PHY index */
-unsigned int cmd;
+void plc_irq(struct s_smc *smc, int np, unsigned int cmd)
+/* int np;	PHY index */
 {
 	struct s_phy *phy = &smc->y[np] ;
 	struct s_plc *plc = &phy->plc ;
@@ -1919,9 +1861,7 @@ unsigned int cmd;
 #endif
 }
 
-void pcm_set_lct_short(smc,n)
-struct s_smc *smc ;
-int n ;
+void pcm_set_lct_short(struct s_smc *smc, int n)
 {
 	if (n <= 0 || n > 1000)
 		return ;
@@ -1932,9 +1872,7 @@ int n ;
 /*
  * fill state struct
  */
-void pcm_get_state(smc,state)
-struct s_smc *smc ;
-struct smt_state *state ;
+void pcm_get_state(struct s_smc *smc, struct smt_state *state)
 {
 	struct s_phy	*phy ;
 	struct pcm_state *pcs ;
@@ -1968,9 +1906,7 @@ struct smt_state *state ;
 	}
 }
 
-int get_pcm_state(smc,np)
-struct s_smc *smc ;
-int np;
+int get_pcm_state(struct s_smc *smc, int np)
 {
 	int pcs ;
 
@@ -1992,9 +1928,7 @@ int np;
 	return(pcs) ;
 }
 
-char *get_linestate(smc,np)
-struct s_smc *smc ;
-int np;
+char *get_linestate(struct s_smc *smc, int np)
 {
 	char *ls = "" ;
 
@@ -2016,9 +1950,7 @@ int np;
 	return(ls) ;
 }
 
-char *get_pcmstate(smc,np)
-struct s_smc *smc ;
-int np;
+char *get_pcmstate(struct s_smc *smc, int np)
 {
 	char *pcs ;
 	
@@ -2040,8 +1972,7 @@ int np;
 	return(pcs) ;
 }
 
-void list_phy(smc)
-struct s_smc *smc ;
+void list_phy(struct s_smc *smc)
 {
 	struct s_plc *plc ;
 	int np ;
@@ -2069,8 +2000,7 @@ struct s_smc *smc ;
 
 
 #ifdef	CONCENTRATOR
-void pcm_lem_dump(smc)
-struct s_smc *smc ;
+void pcm_lem_dump(struct s_smc *smc)
 {
 	int		i ;
 	struct s_phy	*phy ;
diff --git a/drivers/net/skfp/pmf.c b/drivers/net/skfp/pmf.c
index ee0a8c58b..f2b446d8b 100644
--- a/drivers/net/skfp/pmf.c
+++ b/drivers/net/skfp/pmf.c
@@ -32,12 +32,16 @@
 static const char ID_sccs[] = "@(#)pmf.c	1.37 97/08/04 (C) SK " ;
 #endif
 
-static int smt_authorize() ;
-static int smt_check_set_count() ;
-static const struct s_p_tab *smt_get_ptab() ;
-static int smt_mib_phys() ;
-int smt_set_para() ;
-void smt_add_para() ;
+static int smt_authorize(struct s_smc *smc, struct smt_header *sm);
+static int smt_check_set_count(struct s_smc *smc, struct smt_header *sm);
+static const struct s_p_tab* smt_get_ptab(u_short para);
+static int smt_mib_phys(struct s_smc *smc);
+int smt_set_para(struct s_smc *smc, struct smt_para *pa, int index, int local,
+		 int set);
+void smt_add_para(struct s_smc *smc, struct s_pcon *pcon, u_short para,
+		  int index, int local);
+static SMbuf *smt_build_pmf_response(struct s_smc *smc, struct smt_header *req,
+				     int set, int local);
 
 #define MOFFSS(e)	((int)&(((struct fddi_mib *)0)->e))
 #define MOFFSA(e)	((int) (((struct fddi_mib *)0)->e))
@@ -280,13 +284,7 @@ static const struct s_p_tab {
 	{ 0 }
 } ;
 
-
-static SMbuf *smt_build_pmf_response() ;
-
-void smt_pmf_received_pack(smc,mb,local)
-struct s_smc *smc ;
-SMbuf *mb ;
-int local ;
+void smt_pmf_received_pack(struct s_smc *smc, SMbuf *mb, int local)
 {
 	struct smt_header	*sm ;
 	SMbuf		*reply ;
@@ -316,13 +314,8 @@ int local ;
 	}
 }
 
-extern	SMbuf	*smt_get_mbuf() ;
-
-static SMbuf *smt_build_pmf_response(smc,req,set,local)
-struct s_smc *smc ;
-struct smt_header *req ;
-int	set ;
-int	local ;
+static SMbuf *smt_build_pmf_response(struct s_smc *smc, struct smt_header *req,
+				     int set, int local)
 {
 	SMbuf			*mb ;
 	struct smt_header	*smt ;
@@ -509,11 +502,7 @@ int	local ;
 	return(mb) ;
 }
 
-extern void *sm_to_para() ;
-
-static int smt_authorize(smc,sm)
-struct s_smc *smc ;
-struct smt_header *sm ;
+static int smt_authorize(struct s_smc *smc, struct smt_header *sm)
 {
 	struct smt_para	*pa ;
 	int		i ;
@@ -548,9 +537,7 @@ struct smt_header *sm ;
 	return(0) ;
 }
 
-static int smt_check_set_count(smc,sm)
-struct s_smc *smc ;
-struct smt_header *sm ;
+static int smt_check_set_count(struct s_smc *smc, struct smt_header *sm)
 {
 	struct smt_para	*pa ;
 	struct smt_p_setcount	*sc ;
@@ -566,17 +553,13 @@ struct smt_header *sm ;
 	return(0) ;
 }
 
-void smt_add_para(smc,pcon,para,index,local)
-struct s_smc *smc ;
-struct s_pcon *pcon ;
-u_short para ;
-int index ;
-int local ;
+void smt_add_para(struct s_smc *smc, struct s_pcon *pcon, u_short para,
+		  int index, int local)
 {
 	struct smt_para	*pa ;
 	const struct s_p_tab	*pt ;
-	struct fddi_mib_m *mib_m = 0 ;
-	struct fddi_mib_p *mib_p = 0 ;
+	struct fddi_mib_m *mib_m = NULL;
+	struct fddi_mib_p *mib_p = NULL;
 	int		len ;
 	int		plen ;
 	char		*from ;
@@ -661,7 +644,7 @@ int local ;
 	/*
 	 * check special paras
 	 */
-	swap = 0 ;
+	swap = NULL;
 	switch (para) {
 	case SMT_P10F0 :
 	case SMT_P10F1 :
@@ -1095,12 +1078,8 @@ wrong_error:
 /*
  * set parameter
  */
-int smt_set_para(smc,pa,index,local,set)
-struct s_smc *smc ;
-struct smt_para	*pa ;
-int index ;
-int local ;
-int set ;
+int smt_set_para(struct s_smc *smc, struct smt_para *pa, int index, int local,
+		 int set)
 {
 #define IFSET(x)	if (set) (x)
 
@@ -1112,9 +1091,9 @@ int set ;
 	char		c ;
 	char		*mib_addr ;
 	struct fddi_mib	*mib ;
-	struct fddi_mib_m	*mib_m = 0 ;
-	struct fddi_mib_a	*mib_a = 0 ;
-	struct fddi_mib_p	*mib_p = 0 ;
+	struct fddi_mib_m	*mib_m = NULL;
+	struct fddi_mib_a	*mib_a = NULL;
+	struct fddi_mib_p	*mib_p = NULL;
 	int		mac ;
 	int		path ;
 	int		port ;
@@ -1549,17 +1528,15 @@ no_author_error:
 #endif
 }
 
-static const struct s_p_tab *smt_get_ptab(para)
-u_short para ;
+static const struct s_p_tab *smt_get_ptab(u_short para)
 {
 	const struct s_p_tab	*pt ;
 	for (pt = p_tab ; pt->p_num && pt->p_num != para ; pt++)
 		;
-	return(pt->p_num ? pt : 0) ;
+	return(pt->p_num ? pt : NULL) ;
 }
 
-static int smt_mib_phys(smc)
-struct s_smc *smc ;
+static int smt_mib_phys(struct s_smc *smc)
 {
 #ifdef	CONCENTRATOR
 	SK_UNUSED(smc) ;
@@ -1572,9 +1549,7 @@ struct s_smc *smc ;
 #endif
 }
 
-int port_to_mib(smc,p)
-struct s_smc *smc ;
-int p ;
+int port_to_mib(struct s_smc *smc, int p)
 {
 #ifdef	CONCENTRATOR
 	SK_UNUSED(smc) ;
@@ -1590,10 +1565,7 @@ int p ;
 
 #ifdef	DEBUG
 #ifndef	BOOT
-void dump_smt(smc,sm,text)
-struct s_smc *smc ;
-struct smt_header *sm ;
-char *text ;
+void dump_smt(struct s_smc *smc, struct smt_header *sm, char *text)
 {
 	int	len ;
 	struct smt_para	*pa ;
@@ -1680,9 +1652,7 @@ char *text ;
 	printf("-------------------------------------------------\n\n") ;
 }
 
-void dump_hex(p,len)
-char *p ;
-int len ;
+void dump_hex(char *p, int len)
 {
 	int	n = 0 ;
 	while (len--) {
diff --git a/drivers/net/skfp/queue.c b/drivers/net/skfp/queue.c
index e54b544ff..09adb3d68 100644
--- a/drivers/net/skfp/queue.c
+++ b/drivers/net/skfp/queue.c
@@ -31,8 +31,7 @@ static const char ID_sccs[] = "@(#)queue.c	2.9 97/08/04 (C) SK " ;
 /*
  * init event queue management
  */
-void ev_init(smc)
-struct s_smc *smc ;
+void ev_init(struct s_smc *smc)
 {
 	smc->q.ev_put = smc->q.ev_get = smc->q.ev_queue ;
 }
@@ -40,10 +39,7 @@ struct s_smc *smc ;
 /*
  * add event to queue
  */
-void queue_event(smc,class,event)
-struct s_smc *smc ;
-int class ;
-int event ;
+void queue_event(struct s_smc *smc, int class, int event)
 {
 	PRINTF("queue class %d event %d\n",class,event) ;
 	smc->q.ev_put->class = class ;
@@ -59,9 +55,7 @@ int event ;
 /*
  * timer_event is called from HW timer package.
  */
-void timer_event(smc,token)
-struct s_smc *smc ;
-u_long token ;
+void timer_event(struct s_smc *smc, u_long token)
 {
 	PRINTF("timer event class %d token %d\n",
 		EV_T_CLASS(token),
@@ -76,8 +70,7 @@ u_long token ;
  *		send command to state machine
  *	end
  */
-void ev_dispatcher(smc)
-struct s_smc *smc ;
+void ev_dispatcher(struct s_smc *smc)
 {
 	struct event_queue *ev ;	/* pointer into queue */
 	int		class ;
@@ -131,9 +124,7 @@ struct s_smc *smc ;
  *	on	0	disconnect
  *	on	1	connect
  */
-u_short smt_online(smc,on)
-struct s_smc *smc ;
-int on ;
+u_short smt_online(struct s_smc *smc, int on)
 {
 	queue_event(smc,EVENT_ECM,on ? EC_CONNECT : EC_DISCONNECT) ;
 	ev_dispatcher(smc) ;
@@ -147,10 +138,7 @@ int on ;
  * dump current flag setting
  */
 #ifdef	CONCENTRATOR
-void do_smt_flag(smc,flag,value)
-struct s_smc *smc ;
-char *flag ;
-int value ;
+void do_smt_flag(struct s_smc *smc, char *flag, int value)
 {
 #ifdef	DEBUG
 	struct smt_debug	*deb;
diff --git a/drivers/net/skfp/rmt.c b/drivers/net/skfp/rmt.c
index 5771dc42c..ef8d5672d 100644
--- a/drivers/net/skfp/rmt.c
+++ b/drivers/net/skfp/rmt.c
@@ -102,17 +102,17 @@ static const char * const rmt_events[] = {
 /*
  * function declarations
  */
-static void rmt_fsm() ;
-static void start_rmt_timer0() ;
-static void start_rmt_timer1() ;
-static void start_rmt_timer2() ;
-static void stop_rmt_timer0() ;
-static void stop_rmt_timer1() ;
-static void stop_rmt_timer2() ;
-static void rmt_dup_actions() ;
-static void rmt_reinsert_actions() ;
-static void rmt_leave_actions() ;
-static void rmt_new_dup_actions() ;
+static void rmt_fsm(struct s_smc *smc, int cmd);
+static void start_rmt_timer0(struct s_smc *smc, u_long value, int event);
+static void start_rmt_timer1(struct s_smc *smc, u_long value, int event);
+static void start_rmt_timer2(struct s_smc *smc, u_long value, int event);
+static void stop_rmt_timer0(struct s_smc *smc);
+static void stop_rmt_timer1(struct s_smc *smc);
+static void stop_rmt_timer2(struct s_smc *smc);
+static void rmt_dup_actions(struct s_smc *smc);
+static void rmt_reinsert_actions(struct s_smc *smc);
+static void rmt_leave_actions(struct s_smc *smc);
+static void rmt_new_dup_actions(struct s_smc *smc);
 
 #ifndef SUPERNET_3
 extern void restart_trt_for_dbcn() ;
@@ -122,8 +122,7 @@ extern void restart_trt_for_dbcn() ;
 	init RMT state machine
 	clear all RMT vars and flags
 */
-void rmt_init(smc)
-struct s_smc *smc ;
+void rmt_init(struct s_smc *smc)
 {
 	smc->mib.m[MAC0].fddiMACRMTState = ACTIONS(RM0_ISOLATED) ;
 	smc->r.dup_addr_test = DA_NONE ;
@@ -145,9 +144,7 @@ struct s_smc *smc ;
 		process event
 	until SM is stable
 */
-void rmt(smc,event)
-struct s_smc *smc ;
-int event ;
+void rmt(struct s_smc *smc, int event)
 {
 	int	state ;
 
@@ -166,9 +163,7 @@ int event ;
 /*
 	process RMT event
 */
-static void rmt_fsm(smc,cmd)
-struct s_smc *smc ;
-int cmd ;
+static void rmt_fsm(struct s_smc *smc, int cmd)
 {
 	/*
 	 * RM00-RM70 : from all states
@@ -535,8 +530,7 @@ int cmd ;
  * (jd) RMT duplicate address actions
  * leave the ring or reinsert just as configured
  */
-static void rmt_dup_actions(smc)
-struct s_smc *smc ;
+static void rmt_dup_actions(struct s_smc *smc)
 {
 	if (smc->r.jm_flag) {
 	}
@@ -555,8 +549,7 @@ struct s_smc *smc ;
 /*
  * Reconnect to the Ring
  */
-static void rmt_reinsert_actions(smc)
-struct s_smc *smc ;
+static void rmt_reinsert_actions(struct s_smc *smc)
 {
 	queue_event(smc,EVENT_ECM,EC_DISCONNECT) ;
 	queue_event(smc,EVENT_ECM,EC_CONNECT) ;
@@ -565,8 +558,7 @@ struct s_smc *smc ;
 /*
  * duplicate address detected
  */
-static void rmt_new_dup_actions(smc)
-struct s_smc *smc ;
+static void rmt_new_dup_actions(struct s_smc *smc)
 {
 	smc->r.da_flag = TRUE ;
 	smc->r.bn_flag = FALSE ;
@@ -591,8 +583,7 @@ struct s_smc *smc ;
 /*
  * leave the ring
  */
-static void rmt_leave_actions(smc)
-struct s_smc *smc ;
+static void rmt_leave_actions(struct s_smc *smc)
 {
 	queue_event(smc,EVENT_ECM,EC_DISCONNECT) ;
 	/*
@@ -605,10 +596,7 @@ struct s_smc *smc ;
  * SMT timer interface
  *	start RMT timer 0
  */
-static void start_rmt_timer0(smc,value,event)
-struct s_smc *smc ;
-u_long value ;
-int event ;
+static void start_rmt_timer0(struct s_smc *smc, u_long value, int event)
 {
 	smc->r.timer0_exp = FALSE ;		/* clear timer event flag */
 	smt_timer_start(smc,&smc->r.rmt_timer0,value,EV_TOKEN(EVENT_RMT,event));
@@ -618,10 +606,7 @@ int event ;
  * SMT timer interface
  *	start RMT timer 1
  */
-static void start_rmt_timer1(smc,value,event)
-struct s_smc *smc ;
-u_long value ;
-int event ;
+static void start_rmt_timer1(struct s_smc *smc, u_long value, int event)
 {
 	smc->r.timer1_exp = FALSE ;	/* clear timer event flag */
 	smt_timer_start(smc,&smc->r.rmt_timer1,value,EV_TOKEN(EVENT_RMT,event));
@@ -631,10 +616,7 @@ int event ;
  * SMT timer interface
  *	start RMT timer 2
  */
-static void start_rmt_timer2(smc,value,event)
-struct s_smc *smc ;
-u_long value ;
-int event ;
+static void start_rmt_timer2(struct s_smc *smc, u_long value, int event)
 {
 	smc->r.timer2_exp = FALSE ;		/* clear timer event flag */
 	smt_timer_start(smc,&smc->r.rmt_timer2,value,EV_TOKEN(EVENT_RMT,event));
@@ -644,8 +626,7 @@ int event ;
  * SMT timer interface
  *	stop RMT timer 0
  */
-static void stop_rmt_timer0(smc)
-struct s_smc *smc ;
+static void stop_rmt_timer0(struct s_smc *smc)
 {
 	if (smc->r.rmt_timer0.tm_active)
 		smt_timer_stop(smc,&smc->r.rmt_timer0) ;
@@ -655,8 +636,7 @@ struct s_smc *smc ;
  * SMT timer interface
  *	stop RMT timer 1
  */
-static void stop_rmt_timer1(smc)
-struct s_smc *smc ;
+static void stop_rmt_timer1(struct s_smc *smc)
 {
 	if (smc->r.rmt_timer1.tm_active)
 		smt_timer_stop(smc,&smc->r.rmt_timer1) ;
@@ -666,9 +646,9 @@ struct s_smc *smc ;
  * SMT timer interface
  *	stop RMT timer 2
  */
-static void stop_rmt_timer2(smc)
-struct s_smc *smc ;
+static void stop_rmt_timer2(struct s_smc *smc)
 {
 	if (smc->r.rmt_timer2.tm_active)
 		smt_timer_stop(smc,&smc->r.rmt_timer2) ;
 }
+
diff --git a/drivers/net/skfp/skfddi.c b/drivers/net/skfp/skfddi.c
index 24032c79c..1eee9d37f 100644
--- a/drivers/net/skfp/skfddi.c
+++ b/drivers/net/skfp/skfddi.c
@@ -131,20 +131,10 @@ void mac_drv_clear_rxd(struct s_smc *smc, volatile struct s_smt_fp_rxd *rxd,
 		       int frag_count);
 int mac_drv_rx_init(struct s_smc *smc, int len, int fc, char *look_ahead,
 		    int la_len);
-void smt_timer_poll(struct s_smc *smc);
-void ring_status_indication(struct s_smc *smc, u_long status);
-unsigned long smt_get_time(void);
-void smt_stat_counter(struct s_smc *smc, int stat);
-void cfm_state_change(struct s_smc *smc, int c_state);
-void ecm_state_change(struct s_smc *smc, int e_state);
-void pcm_state_change(struct s_smc *smc, int plc, int p_state);
-void rmt_state_change(struct s_smc *smc, int r_state);
-void drv_reset_indication(struct s_smc *smc);
 void dump_data(unsigned char *Data, int length);
 
-
 // External functions from the hardware module
-extern u_int mac_drv_check_space();
+extern u_int mac_drv_check_space(void);
 extern void read_address(struct s_smc *smc, u_char * mac_addr);
 extern void card_stop(struct s_smc *smc);
 extern int mac_drv_init(struct s_smc *smc);
@@ -157,9 +147,7 @@ extern void fddi_isr(struct s_smc *smc);
 extern void hwm_rx_frag(struct s_smc *smc, char far * virt, u_long phys,
 			int len, int frame_status);
 extern void mac_drv_rx_mode(struct s_smc *smc, int mode);
-extern void mac_drv_clear_tx_queue(struct s_smc *smc);
 extern void mac_drv_clear_rx_queue(struct s_smc *smc);
-extern void mac_clear_multicast(struct s_smc *smc);
 extern void enable_tx_irq(struct s_smc *smc, u_short queue);
 extern void mac_drv_clear_txd(struct s_smc *smc);
 
@@ -921,8 +909,10 @@ static void skfp_ctl_set_multicast_list_wo_lock(struct net_device *dev)
 				dmi = dev->mc_list;
 
 				for (i = 0; i < dev->mc_count; i++) {
-					mac_add_multicast(smc,
-							  dmi->dmi_addr, 1);
+					mac_add_multicast(smc, 
+							  (struct fddi_addr *)dmi->dmi_addr, 
+							  1);
+
 					PRINTK(KERN_INFO "ENABLE MC ADDRESS:");
 					PRINTK(" %02x %02x %02x ",
 					       dmi->dmi_addr[0],
diff --git a/drivers/net/skfp/smt.c b/drivers/net/skfp/smt.c
index bfb61dfe6..721569b5e 100644
--- a/drivers/net/skfp/smt.c
+++ b/drivers/net/skfp/smt.c
@@ -62,72 +62,106 @@ extern const struct fddi_addr fddi_broadcast ;
 /*
  * external functions
  */
-int pcm_status_twisted() ;
-void pcm_status_state() ;
-int pcm_status_type() ;
+int pcm_status_twisted(struct s_smc *smc);
 
-extern SMbuf *smt_get_mbuf() ;
-
-#define EXPORT_PMF
 /*
  * function prototypes
  */
-u_long smt_get_tid() ;
-EXPORT_PMF SMbuf *smt_build_frame() ;
-EXPORT_PMF void *sm_to_para() ;
 #ifdef	LITTLE_ENDIAN
-static int smt_swap_short() ;
+static int smt_swap_short(u_short s);
 #endif
-static int mac_index() ;
-static int phy_index() ;
-static int mac_con_resource_index() ;
-static int phy_con_resource_index() ;
-EXPORT_PMF void smt_send_frame() ;
-EXPORT_PMF void smt_set_timestamp() ;
-static void smt_send_rdf() ;
-static void smt_send_nif() ;
-static void smt_send_ecf() ;
-static void smt_echo_test() ;
-static void smt_send_sif_config() ;
-static void smt_send_sif_operation() ;
-EXPORT_PMF void smt_swap_para() ;
+static int mac_index(struct s_smc *smc, int mac);
+static int phy_index(struct s_smc *smc, int phy);
+static int mac_con_resource_index(struct s_smc *smc, int mac);
+static int phy_con_resource_index(struct s_smc *smc, int phy);
+static void smt_send_rdf(struct s_smc *smc, SMbuf *rej, int fc, int reason,
+			 int local);
+static void smt_send_nif(struct s_smc *smc, const struct fddi_addr *dest, 
+			 int fc, u_long tid, int type, int local);
+static void smt_send_ecf(struct s_smc *smc, struct fddi_addr *dest, int fc,
+                         u_long tid, int type, int len);
+static void smt_echo_test(struct s_smc *smc, int dna);
+static void smt_send_sif_config(struct s_smc *smc, struct fddi_addr *dest,
+				u_long tid, int local);
+static void smt_send_sif_operation(struct s_smc *smc, struct fddi_addr *dest,
+				   u_long tid, int local);
 #ifdef LITTLE_ENDIAN
-static void smt_string_swap() ;
+static void smt_string_swap(void);
 #endif
-static void smt_add_frame_len() ;
-static void smt_fill_una() ;
-static void smt_fill_sde() ;
-static void smt_fill_state() ;
-static void smt_fill_timestamp() ;
-static void smt_fill_policy() ;
-static void smt_fill_latency() ;
-static void smt_fill_neighbor() ;
-static int  smt_fill_path() ;
-static void smt_fill_mac_status() ;
-static void smt_fill_lem() ;
-static void smt_fill_version() ;
-static void smt_fill_fsc() ;
-static void smt_fill_mac_counter() ;
-static void smt_fill_mac_fnc() ;
-static void smt_fill_manufacturer() ;
-static void smt_fill_user() ;
-static void smt_fill_setcount() ;
-static void smt_fill_echo() ;
-int smt_check_para() ;
-
-void smt_clear_una_dna() ;
-static void smt_clear_old_una_dna() ;
+static void smt_add_frame_len(SMbuf *mb, int len);
+static void smt_fill_una(struct s_smc *smc, struct smt_p_una *una);
+static void smt_fill_sde(struct s_smc *smc, struct smt_p_sde *sde);
+static void smt_fill_state(struct s_smc *smc, struct smt_p_state *state);
+static void smt_fill_timestamp(struct s_smc *smc, struct smt_p_timestamp *ts);
+static void smt_fill_policy(struct s_smc *smc, struct smt_p_policy *policy);
+static void smt_fill_latency(struct s_smc *smc, struct smt_p_latency *latency);
+static void smt_fill_neighbor(struct s_smc *smc, struct smt_p_neighbor *neighbor);
+static int smt_fill_path(struct s_smc *smc, struct smt_p_path *path);
+static void smt_fill_mac_status(struct s_smc *smc, struct smt_p_mac_status *st);
+static void smt_fill_lem(struct s_smc *smc, struct smt_p_lem *lem, int phy);
+static void smt_fill_version(struct s_smc *smc, struct smt_p_version *vers);
+static void smt_fill_fsc(struct s_smc *smc, struct smt_p_fsc *fsc);
+static void smt_fill_mac_counter(struct s_smc *smc, struct smt_p_mac_counter *mc);
+static void smt_fill_mac_fnc(struct s_smc *smc, struct smt_p_mac_fnc *fnc);
+static void smt_fill_manufacturer(struct s_smc *smc, 
+				  struct smp_p_manufacturer *man);
+static void smt_fill_user(struct s_smc *smc, struct smp_p_user *user);
+static void smt_fill_setcount(struct s_smc *smc, struct smt_p_setcount *setcount);
+static void smt_fill_echo(struct s_smc *smc, struct smt_p_echo *echo, u_long seed,
+			  int len);
+
+void smt_clear_una_dna(struct s_smc *smc);
+static void smt_clear_old_una_dna(struct s_smc *smc);
 #ifdef	CONCENTRATOR
-static int entity_to_index() ;
+static int entity_to_index(void);
 #endif
-static void update_dac() ;
-static int div_ratio() ;
+static void update_dac(struct s_smc *smc, int report);
+static int div_ratio(u_long upper, u_long lower);
 #ifdef  USE_CAN_ADDR
-void	hwm_conv_can() ;
+void	hwm_conv_can(struct s_smc *smc, char *data, int len);
 #else
 #define		hwm_conv_can(smc,data,len)
 #endif
 
+
+static inline int is_my_addr(const struct s_smc *smc, 
+			     const struct fddi_addr *addr)
+{
+	return(*(short *)(&addr->a[0]) ==
+		*(short *)(&smc->mib.m[MAC0].fddiMACSMTAddress.a[0])
+	  && *(short *)(&addr->a[2]) ==
+		*(short *)(&smc->mib.m[MAC0].fddiMACSMTAddress.a[2])
+	  && *(short *)(&addr->a[4]) ==
+		*(short *)(&smc->mib.m[MAC0].fddiMACSMTAddress.a[4])) ;
+}
+
+static inline int is_zero(const struct fddi_addr *addr)
+{
+	return(*(short *)(&addr->a[0]) == 0 &&
+	       *(short *)(&addr->a[2]) == 0 &&
+	       *(short *)(&addr->a[4]) == 0 ) ;
+}
+
+static inline int is_broadcast(const struct fddi_addr *addr)
+{
+	return(*(u_short *)(&addr->a[0]) == 0xffff &&
+	       *(u_short *)(&addr->a[2]) == 0xffff &&
+	       *(u_short *)(&addr->a[4]) == 0xffff ) ;
+}
+
+static inline int is_individual(const struct fddi_addr *addr)
+{
+	return(!(addr->a[0] & GROUP_ADDR)) ;
+}
+
+static inline int is_equal(const struct fddi_addr *addr1, 
+			   const struct fddi_addr *addr2)
+{
+	return(*(u_short *)(&addr1->a[0]) == *(u_short *)(&addr2->a[0]) &&
+	       *(u_short *)(&addr1->a[2]) == *(u_short *)(&addr2->a[2]) &&
+	       *(u_short *)(&addr1->a[4]) == *(u_short *)(&addr2->a[4]) ) ;
+}
+
 /*
  * list of mandatory paras in frames
  */
@@ -136,8 +170,7 @@ static const u_short plist_nif[] = { SMT_P_UNA,SMT_P_SDE,SMT_P_STATE,0 } ;
 /*
  * init SMT agent
  */
-void smt_agent_init(smc)
-struct s_smc *smc ;
+void smt_agent_init(struct s_smc *smc)
 {
 	int		i ;
 
@@ -183,17 +216,16 @@ struct s_smc *smc ;
  *	check tvu & tvd
  * end
  */
-void smt_agent_task(smc)
-struct s_smc *smc ;
+void smt_agent_task(struct s_smc *smc)
 {
 	smt_timer_start(smc,&smc->sm.smt_timer, (u_long)1000000L,
 		EV_TOKEN(EVENT_SMT,SM_TIMER)) ;
 	DB_SMT("SMT agent task\n",0,0) ;
 }
 
-void smt_please_reconnect(smc,reconn_time)
-struct s_smc	*smc ;		/* Pointer to SMT context */
-int		reconn_time ;	/* Wait for reconnect time in seconds */
+void smt_please_reconnect(struct s_smc *smc, int reconn_time)
+/* struct s_smc	*smc;  Pointer to SMT context */
+/* int reconn_time;    Wait for reconnect time in seconds */
 {
 	/*
 	 * The please reconnect variable is used as a timer.
@@ -210,9 +242,7 @@ int		reconn_time ;	/* Wait for reconnect time in seconds */
 }
 
 #ifndef SMT_REAL_TOKEN_CT
-void smt_emulate_token_ct(smc, mac_index)
-struct s_smc	*smc;
-int		mac_index;
+void smt_emulate_token_ct(struct s_smc *smc, int mac_index)
 {
 	u_long	count;
 	u_long	time;
@@ -239,9 +269,7 @@ int		mac_index;
 #endif
 
 /*ARGSUSED1*/
-void smt_event(smc,event)
-struct s_smc *smc ;
-int event ;
+void smt_event(struct s_smc *smc, int event)
 {
 	u_long		time ;
 #ifndef SMT_REAL_TOKEN_CT
@@ -393,7 +421,7 @@ int event ;
 		 */
 		if (!smc->sm.pend[SMT_TID_NIF])
 			smc->sm.pend[SMT_TID_NIF] = smt_get_tid(smc) ;
-		smt_send_nif(smc,&fddi_broadcast,FC_SMT_NSA,
+		smt_send_nif(smc,&fddi_broadcast, FC_SMT_NSA,
 			smc->sm.pend[SMT_TID_NIF], SMT_REQUEST,0) ;
 		smc->sm.smt_last_notify = time ;
 	}
@@ -457,9 +485,7 @@ int event ;
 		EV_TOKEN(EVENT_SMT,SM_TIMER)) ;
 }
 
-static int div_ratio(upper,lower)
-u_long upper ;
-u_long lower ;
+static int div_ratio(u_long upper, u_long lower)
 {
 	if ((upper<<16L) < upper)
 		upper = 0xffff0000L ;
@@ -475,10 +501,8 @@ u_long lower ;
 /*
  * receive packet handler
  */
-void smt_received_pack(smc,mb,fs)
-struct s_smc *smc ;
-SMbuf *mb ;
-int fs ;			/* frame status */
+void smt_received_pack(struct s_smc *smc, SMbuf *mb, int fs)
+/* int fs;  frame status */
 {
 	struct smt_header	*sm ;
 	int			local ;
@@ -823,9 +847,7 @@ int fs ;			/* frame status */
 	smt_free_mbuf(smc,mb) ;
 }
 
-static void update_dac(smc,report)
-struct s_smc *smc ;
-int report ;
+static void update_dac(struct s_smc *smc, int report)
 {
 	int	cond ;
 
@@ -843,11 +865,9 @@ int report ;
  *	set station ID
  *	send frame
  */
-EXPORT_PMF void smt_send_frame(smc,mb,fc,local)
-struct s_smc *smc ;
-SMbuf *mb ;			/* buffer to send */
-int fc ;			/* FC value */
-int local ;
+void smt_send_frame(struct s_smc *smc, SMbuf *mb, int fc, int local)
+/* SMbuf *mb;	buffer to send */
+/* int fc;	FC value */
 {
 	struct smt_header	*sm ;
 
@@ -868,12 +888,11 @@ int local ;
 /*
  * generate and send RDF
  */
-static void smt_send_rdf(smc,rej,fc,reason,local)
-struct s_smc *smc ;
-SMbuf	*rej ;			/* mbuf of offending frame */
-int	fc ;			/* FC of denied frame */
-int reason ;			/* reason code */
-int local ;
+static void smt_send_rdf(struct s_smc *smc, SMbuf *rej, int fc, int reason,
+			 int local)
+/* SMbuf *rej;	mbuf of offending frame */
+/* int fc;	FC of denied frame */
+/* int reason;	reason code */
 {
 	SMbuf	*mb ;
 	struct smt_header	*sm ;	/* header of offending frame */
@@ -946,13 +965,12 @@ int local ;
 /*
  * generate and send NIF
  */
-static void smt_send_nif(smc,dest,fc,tid,type,local)
-struct s_smc *smc ;
-struct fddi_addr *dest ;		/* dest address */
-int fc ;				/* frame control */
-u_long tid ;				/* transaction id */
-int type ;				/* frame type */
-int local ;
+static void smt_send_nif(struct s_smc *smc, const struct fddi_addr *dest, 
+			 int fc, u_long tid, int type, int local)
+/* struct fddi_addr *dest;	dest address */
+/* int fc;			frame control */
+/* u_long tid;			transaction id */
+/* int type;			frame type */
 {
 	struct smt_nif	*nif ;
 	SMbuf		*mb ;
@@ -976,9 +994,7 @@ int local ;
 /*
  * send NIF request (test purpose)
  */
-static void smt_send_nif_request(smc,dest)
-struct s_smc *smc ;
-struct fddi_addr *dest ;
+static void smt_send_nif_request(struct s_smc *smc, struct fddi_addr *dest)
 {
 	smc->sm.pend[SMT_TID_NIF_TEST] = smt_get_tid(smc) ;
 	smt_send_nif(smc,dest, FC_SMT_INFO, smc->sm.pend[SMT_TID_NIF_TEST],
@@ -988,10 +1004,8 @@ struct fddi_addr *dest ;
 /*
  * send ECF request (test purpose)
  */
-static void smt_send_ecf_request(smc,dest,len)
-struct s_smc *smc ;
-struct fddi_addr *dest ;
-int len ;
+static void smt_send_ecf_request(struct s_smc *smc, struct fddi_addr *dest,
+				 int len)
 {
 	smc->sm.pend[SMT_TID_ECF] = smt_get_tid(smc) ;
 	smt_send_ecf(smc,dest, FC_SMT_INFO, smc->sm.pend[SMT_TID_ECF],
@@ -1002,9 +1016,7 @@ int len ;
 /*
  * echo test
  */
-static void smt_echo_test(smc,dna)
-struct s_smc *smc ;
-int dna ;
+static void smt_echo_test(struct s_smc *smc, int dna)
 {
 	u_long	tid ;
 
@@ -1019,13 +1031,13 @@ int dna ;
 /*
  * generate and send ECF
  */
-static void smt_send_ecf(smc,dest,fc,tid,type,len)
-struct s_smc *smc ;
-struct fddi_addr *dest ;		/* dest address */
-int fc ;				/* frame control */
-u_long tid ;				/* transaction id */
-int type ;				/* frame type */
-int len ;				/* frame length */
+static void smt_send_ecf(struct s_smc *smc, struct fddi_addr *dest, int fc,
+			 u_long tid, int type, int len)
+/* struct fddi_addr *dest;	dest address */
+/* int fc;			frame control */
+/* u_long tid;			transaction id */
+/* int type;			frame type */
+/* int len;			frame length */
 {
 	struct smt_ecf	*ecf ;
 	SMbuf		*mb ;
@@ -1045,11 +1057,10 @@ int len ;				/* frame length */
  * generate and send SIF config response
  */
 
-static void smt_send_sif_config(smc,dest,tid,local)
-struct s_smc *smc ;
-struct fddi_addr *dest ;		/* dest address */
-u_long tid ;				/* transaction id */
-int local ;
+static void smt_send_sif_config(struct s_smc *smc, struct fddi_addr *dest,
+				u_long tid, int local)
+/* struct fddi_addr *dest;	dest address */
+/* u_long tid;			transaction id */
 {
 	struct smt_sif_config	*sif ;
 	SMbuf			*mb ;
@@ -1079,11 +1090,10 @@ int local ;
  * generate and send SIF operation response
  */
 
-static void smt_send_sif_operation(smc,dest,tid,local)
-struct s_smc *smc ;
-struct fddi_addr *dest ;		/* dest address */
-u_long tid ;				/* transaction id */
-int local ;
+static void smt_send_sif_operation(struct s_smc *smc, struct fddi_addr *dest,
+				   u_long tid, int local)
+/* struct fddi_addr *dest;	dest address */
+/* u_long tid;			transaction id */
 {
 	struct smt_sif_operation *sif ;
 	SMbuf			*mb ;
@@ -1128,11 +1138,8 @@ int local ;
 /*
  * get and initialize SMT frame
  */
-EXPORT_PMF SMbuf *smt_build_frame(smc,class,type,length)
-struct s_smc *smc ;
-int class ;
-int type ;
-int length ;
+SMbuf *smt_build_frame(struct s_smc *smc, int class, int type,
+				  int length)
 {
 	SMbuf			*mb ;
 	struct smt_header	*smt ;
@@ -1167,9 +1174,7 @@ int length ;
 	return(mb) ;
 }
 
-static void smt_add_frame_len(mb,len)
-SMbuf *mb ;
-int len ;
+static void smt_add_frame_len(SMbuf *mb, int len)
 {
 	struct smt_header	*smt ;
 
@@ -1183,9 +1188,7 @@ int len ;
 /*
  * fill values in UNA parameter
  */
-static void smt_fill_una(smc,una)
-struct s_smc *smc ;
-struct smt_p_una *una ;
+static void smt_fill_una(struct s_smc *smc, struct smt_p_una *una)
 {
 	SMTSETPARA(una,SMT_P_UNA) ;
 	una->una_pad = 0 ;
@@ -1195,9 +1198,7 @@ struct smt_p_una *una ;
 /*
  * fill values in SDE parameter
  */
-static void smt_fill_sde(smc,sde)
-struct s_smc *smc ;
-struct smt_p_sde *sde ;
+static void smt_fill_sde(struct s_smc *smc, struct smt_p_sde *sde)
 {
 	SMTSETPARA(sde,SMT_P_SDE) ;
 	sde->sde_non_master = smc->mib.fddiSMTNonMaster_Ct ;
@@ -1213,9 +1214,7 @@ struct smt_p_sde *sde ;
 /*
  * fill in values in station state parameter
  */
-static void smt_fill_state(smc,state)
-struct s_smc *smc ;
-struct smt_p_state *state ;
+static void smt_fill_state(struct s_smc *smc, struct smt_p_state *state)
 {
 	int	top ;
 	int	twist ;
@@ -1255,18 +1254,14 @@ struct smt_p_state *state ;
 /*
  * fill values in timestamp parameter
  */
-static void smt_fill_timestamp(smc,ts)
-struct s_smc *smc ;
-struct smt_p_timestamp *ts ;
+static void smt_fill_timestamp(struct s_smc *smc, struct smt_p_timestamp *ts)
 {
 
 	SMTSETPARA(ts,SMT_P_TIMESTAMP) ;
 	smt_set_timestamp(smc,ts->ts_time) ;
 }
 
-EXPORT_PMF void smt_set_timestamp(smc,p)
-struct s_smc *smc ;
-u_char *p ;
+void smt_set_timestamp(struct s_smc *smc, u_char *p)
 {
 	u_long	time ;
 	u_long	utime ;
@@ -1300,9 +1295,7 @@ u_char *p ;
 /*
  * fill values in station policy parameter
  */
-static void smt_fill_policy(smc,policy)
-struct s_smc *smc ;
-struct smt_p_policy *policy ;
+static void smt_fill_policy(struct s_smc *smc, struct smt_p_policy *policy)
 {
 	int	i ;
 	u_char	*map ;
@@ -1333,9 +1326,7 @@ struct smt_p_policy *policy ;
 /*
  * fill values in latency equivalent parameter
  */
-static void smt_fill_latency(smc,latency)
-struct s_smc *smc ;
-struct smt_p_latency *latency ;
+static void smt_fill_latency(struct s_smc *smc, struct smt_p_latency *latency)
 {
 	SMTSETPARA(latency,SMT_P_LATENCY) ;
 
@@ -1358,9 +1349,7 @@ struct smt_p_latency *latency ;
 /*
  * fill values in MAC neighbors parameter
  */
-static void smt_fill_neighbor(smc,neighbor)
-struct s_smc *smc ;
-struct smt_p_neighbor *neighbor ;
+static void smt_fill_neighbor(struct s_smc *smc, struct smt_p_neighbor *neighbor)
 {
 	SMTSETPARA(neighbor,SMT_P_NEIGHBORS) ;
 
@@ -1379,9 +1368,7 @@ struct smt_p_neighbor *neighbor ;
 #define ALLPHYS	((smc->s.sas == SMT_SAS) ? 1 : 2)
 #endif
 
-static int smt_fill_path(smc,path)
-struct s_smc *smc ;
-struct smt_p_path *path ;
+static int smt_fill_path(struct s_smc *smc, struct smt_p_path *path)
 {
 	SK_LOC_DECL(int,type) ;
 	SK_LOC_DECL(int,state) ;
@@ -1429,9 +1416,7 @@ struct smt_p_path *path ;
 /*
  * fill values in mac status
  */
-static void smt_fill_mac_status(smc,st)
-struct s_smc *smc ;
-struct smt_p_mac_status *st ;
+static void smt_fill_mac_status(struct s_smc *smc, struct smt_p_mac_status *st)
 {
 	SMTSETPARA(st,SMT_P_MAC_STATUS) ;
 
@@ -1458,11 +1443,7 @@ struct smt_p_mac_status *st ;
 /*
  * fill values in LEM status
  */
-
-static void smt_fill_lem(smc,lem,phy)
-struct s_smc *smc ;
-struct smt_p_lem *lem ;
-int phy ;
+static void smt_fill_lem(struct s_smc *smc, struct smt_p_lem *lem, int phy)
 {
 	struct fddi_mib_p	*mib ;
 
@@ -1484,9 +1465,7 @@ int phy ;
 /*
  * fill version parameter
  */
-static void smt_fill_version(smc,vers)
-struct s_smc *smc ;
-struct smt_p_version *vers ;
+static void smt_fill_version(struct s_smc *smc, struct smt_p_version *vers)
 {
 	SK_UNUSED(smc) ;
 	SMTSETPARA(vers,SMT_P_VERSION) ;
@@ -1505,9 +1484,7 @@ struct smt_p_version *vers ;
  * note: this para 200B is NOT in swap table, because it's also set in
  * PMF add_para
  */
-static void smt_fill_fsc(smc,fsc)
-struct s_smc *smc ;
-struct smt_p_fsc *fsc ;
+static void smt_fill_fsc(struct s_smc *smc, struct smt_p_fsc *fsc)
 {
 	SK_UNUSED(smc) ;
 	SMTSETPARA(fsc,SMT_P_FSC) ;
@@ -1527,9 +1504,7 @@ struct smt_p_fsc *fsc ;
 /*
  * fill mac counter field
  */
-static void smt_fill_mac_counter(smc,mc)
-struct s_smc *smc ;
-struct smt_p_mac_counter *mc ;
+static void smt_fill_mac_counter(struct s_smc *smc, struct smt_p_mac_counter *mc)
 {
 	SMTSETPARA(mc,SMT_P_MAC_COUNTER) ;
 	mc->mc_mib_index = INDEX_MAC ;
@@ -1541,9 +1516,7 @@ struct smt_p_mac_counter *mc ;
 /*
  * fill mac frame not copied counter
  */
-static void smt_fill_mac_fnc(smc,fnc)
-struct s_smc *smc ;
-struct smt_p_mac_fnc *fnc ;
+static void smt_fill_mac_fnc(struct s_smc *smc, struct smt_p_mac_fnc *fnc)
 {
 	SMTSETPARA(fnc,SMT_P_MAC_FNC) ;
 	fnc->nc_mib_index = INDEX_MAC ;
@@ -1555,9 +1528,8 @@ struct smt_p_mac_fnc *fnc ;
 /*
  * fill manufacturer field
  */
-static void smt_fill_manufacturer(smc,man)
-struct s_smc *smc ;
-struct smp_p_manufacturer *man ;
+static void smt_fill_manufacturer(struct s_smc *smc, 
+				  struct smp_p_manufacturer *man)
 {
 	SMTSETPARA(man,SMT_P_MANUFACTURER) ;
 	memcpy((char *) man->mf_data,
@@ -1568,9 +1540,7 @@ struct smp_p_manufacturer *man ;
 /*
  * fill user field
  */
-static void smt_fill_user(smc,user)
-struct s_smc *smc ;
-struct smp_p_user *user ;
+static void smt_fill_user(struct s_smc *smc, struct smp_p_user *user)
 {
 	SMTSETPARA(user,SMT_P_USER) ;
 	memcpy((char *) user->us_data,
@@ -1578,14 +1548,10 @@ struct smp_p_user *user ;
 		sizeof(user->us_data)) ;
 }
 
-
-
 /*
  * fill set count
  */
-static void smt_fill_setcount(smc,setcount)
-struct s_smc *smc ;
-struct smt_p_setcount *setcount ;
+static void smt_fill_setcount(struct s_smc *smc, struct smt_p_setcount *setcount)
 {
 	SK_UNUSED(smc) ;
 	SMTSETPARA(setcount,SMT_P_SETCOUNT) ;
@@ -1597,13 +1563,9 @@ struct smt_p_setcount *setcount ;
 /*
  * fill echo data
  */
-static void smt_fill_echo(smc,echo,seed,len)
-struct s_smc *smc ;
-struct smt_p_echo *echo ;
-u_long seed ;
-int len ;
+static void smt_fill_echo(struct s_smc *smc, struct smt_p_echo *echo, u_long seed,
+			  int len)
 {
-
 	u_char	*p ;
 
 	SK_UNUSED(smc) ;
@@ -1619,22 +1581,19 @@ int len ;
  * clear DNA and UNA
  * called from CFM if configuration changes
  */
-void smt_clear_una_dna(smc)
-struct s_smc *smc ;
+void smt_clear_una_dna(struct s_smc *smc)
 {
 	smc->mib.m[MAC0].fddiMACUpstreamNbr = SMT_Unknown ;
 	smc->mib.m[MAC0].fddiMACDownstreamNbr = SMT_Unknown ;
 }
 
-static void smt_clear_old_una_dna(smc)
-struct s_smc *smc ;
+static void smt_clear_old_una_dna(struct s_smc *smc)
 {
 	smc->mib.m[MAC0].fddiMACOldUpstreamNbr = SMT_Unknown ;
 	smc->mib.m[MAC0].fddiMACOldDownstreamNbr = SMT_Unknown ;
 }
 
-u_long smt_get_tid(smc)
-struct s_smc *smc ;
+u_long smt_get_tid(struct s_smc *smc)
 {
 	u_long	tid ;
 	while ((tid = ++(smc->sm.smt_tid) ^ SMT_TID_MAGIC) == 0)
@@ -1723,10 +1682,8 @@ static const struct smt_pdef {
 
 #define N_SMT_PLEN	(sizeof(smt_pdef)/sizeof(smt_pdef[0]))
 
-int smt_check_para(smc,sm,list)
-struct s_smc *smc ;
-struct smt_header	*sm ;
-const u_short		list[] ;
+int smt_check_para(struct s_smc *smc, struct smt_header	*sm,
+		   const u_short list[])
 {
 	const u_short		*p = list ;
 	while (*p) {
@@ -1739,15 +1696,12 @@ const u_short		list[] ;
 	return(0) ;
 }
 
-EXPORT_PMF void *sm_to_para(smc,sm,para)
-struct s_smc *smc ;
-struct smt_header	*sm ;
-int para ;
+void *sm_to_para(struct s_smc *smc, struct smt_header *sm, int para)
 {
 	char	*p ;
 	int	len ;
 	int	plen ;
-	void	*found = 0 ;
+	void	*found = NULL;
 
 	SK_UNUSED(smc) ;
 
@@ -1761,69 +1715,23 @@ int para ;
 		len -= plen ;
 		if (len < 0) {
 			DB_SMT("SMT : sm_to_para - length error %d\n",plen,0) ;
-			return(0) ;
+			return NULL;
 		}
 		if ((plen & 3) && (para != SMT_P_ECHODATA)) {
 			DB_SMT("SMT : sm_to_para - odd length %d\n",plen,0) ;
-			return(0) ;
+			return NULL;
 		}
 		if (found)
 			return(found) ;
 	}
-	return(0) ;
-}
-
-int is_my_addr(smc,addr)
-struct s_smc *smc ;
-struct fddi_addr *addr ;
-{
-	return(*(short *)(&addr->a[0]) ==
-		*(short *)(&smc->mib.m[MAC0].fddiMACSMTAddress.a[0])
-	  && *(short *)(&addr->a[2]) ==
-		*(short *)(&smc->mib.m[MAC0].fddiMACSMTAddress.a[2])
-	  && *(short *)(&addr->a[4]) ==
-		*(short *)(&smc->mib.m[MAC0].fddiMACSMTAddress.a[4])) ;
+	return NULL;
 }
 
-int is_zero(addr)
-struct fddi_addr *addr ;
-{
-	return(*(short *)(&addr->a[0]) == 0 &&
-	       *(short *)(&addr->a[2]) == 0 &&
-	       *(short *)(&addr->a[4]) == 0 ) ;
-}
-
-int is_broadcast(addr)
-struct fddi_addr *addr ;
-{
-	return(*(u_short *)(&addr->a[0]) == 0xffff &&
-	       *(u_short *)(&addr->a[2]) == 0xffff &&
-	       *(u_short *)(&addr->a[4]) == 0xffff ) ;
-}
-
-int is_individual(addr)
-struct fddi_addr *addr ;
-{
-	return(!(addr->a[0] & GROUP_ADDR)) ;
-}
-
-int is_equal(addr1,addr2)
-struct fddi_addr *addr1 ;
-struct fddi_addr *addr2 ;
-{
-	return(*(u_short *)(&addr1->a[0]) == *(u_short *)(&addr2->a[0]) &&
-	       *(u_short *)(&addr1->a[2]) == *(u_short *)(&addr2->a[2]) &&
-	       *(u_short *)(&addr1->a[4]) == *(u_short *)(&addr2->a[4]) ) ;
-}
-
-
 #if	0
 /*
  * send ANTC data test frame
  */
-void fddi_send_antc(smc,dest)
-struct s_smc *smc ;
-struct fddi_addr *dest ;
+void fddi_send_antc(struct s_smc *smc, struct fddi_addr *dest)
 {
 	SK_UNUSED(smc) ;
 	SK_UNUSED(dest) ;
@@ -1850,8 +1758,7 @@ struct fddi_addr *dest ;
 #ifdef	DEBUG
 #define hextoasc(x)	"0123456789abcdef"[x]
 
-char *addr_to_string(addr)
-struct fddi_addr *addr ;
+char *addr_to_string(struct fddi_addr *addr)
 {
 	int	i ;
 	static char	string[6*3] = "****" ;
@@ -1867,9 +1774,7 @@ struct fddi_addr *addr ;
 #endif
 
 #ifdef	AM29K
-smt_ifconfig(argc,argv)
-int argc ;
-char *argv[] ;
+smt_ifconfig(int argc, char *argv[])
 {
 	if (argc >= 2 && !strcmp(argv[0],"opt_bypass") &&
 	    !strcmp(argv[1],"yes")) {
@@ -1883,9 +1788,7 @@ char *argv[] ;
 /*
  * return static mac index
  */
-static int mac_index(smc,mac)
-struct s_smc *smc ;
-int mac ;
+static int mac_index(struct s_smc *smc, int mac)
 {
 	SK_UNUSED(mac) ;
 #ifdef	CONCENTRATOR
@@ -1899,9 +1802,7 @@ int mac ;
 /*
  * return static phy index
  */
-static int phy_index(smc,phy)
-struct s_smc *smc ;
-int phy ;
+static int phy_index(struct s_smc *smc, int phy)
 {
 	SK_UNUSED(smc) ;
 	return(phy+1);
@@ -1910,9 +1811,7 @@ int phy ;
 /*
  * return dynamic mac connection resource index
  */
-static int mac_con_resource_index(smc,mac)
-struct s_smc *smc ;
-int mac ;
+static int mac_con_resource_index(struct s_smc *smc, int mac)
 {
 #ifdef	CONCENTRATOR
 	SK_UNUSED(smc) ;
@@ -1936,9 +1835,7 @@ int mac ;
 /*
  * return dynamic phy connection resource index
  */
-static int phy_con_resource_index(smc,phy)
-struct s_smc *smc ;
-int phy ;
+static int phy_con_resource_index(struct s_smc *smc, int phy)
 {
 #ifdef	CONCENTRATOR
 	return(entity_to_index(smc,cem_get_downstream(smc,ENTITY_PHY(phy)))) ;
@@ -1960,9 +1857,7 @@ int phy ;
 }
 
 #ifdef	CONCENTRATOR
-static int entity_to_index(smc,e)
-struct s_smc *smc ;
-int e ;
+static int entity_to_index(struct s_smc *smc, int e)
 {
 	if (e == ENTITY_MAC)
 		return(mac_index(smc,1)) ;
@@ -1972,16 +1867,13 @@ int e ;
 #endif
 
 #ifdef	LITTLE_ENDIAN
-static int smt_swap_short(s)
-u_short s ;
+static int smt_swap_short(u_short s)
 {
 	return(((s>>8)&0xff)|((s&0xff)<<8)) ;
 }
 
-void smt_swap_para(sm,len,direction)
-struct smt_header *sm ;
-int len ;
-int direction ;			/* 0 encode 1 decode */
+void smt_swap_para(struct smt_header *sm, int len, int direction)
+/* int direction;	0 encode 1 decode */
 {
 	struct smt_para	*pa ;
 	const  struct smt_pdef	*pd ;
@@ -2027,10 +1919,7 @@ int direction ;			/* 0 encode 1 decode */
 	}
 }
 
-static void smt_string_swap(data,format,len)
-char *data ;
-const char *format ;
-int len ;
+static void smt_string_swap(char *data, const char *format, int len)
 {
 	const char	*open_paren = 0 ;
 	int	x ;
@@ -2081,10 +1970,8 @@ int len ;
 	}
 }
 #else
-void smt_swap_para(sm,len,direction)
-struct smt_header *sm ;
-int len ;
-int direction ;			/* 0 encode 1 decode */
+void smt_swap_para(struct smt_header *sm, int len, int direction)
+/* int direction;	0 encode 1 decode */
 {
 	SK_UNUSED(sm) ;
 	SK_UNUSED(len) ;
@@ -2095,11 +1982,7 @@ int direction ;			/* 0 encode 1 decode */
 /*
  * PMF actions
  */
-int smt_action(smc,class,code,index)
-struct s_smc *smc ;
-int class ;
-int code ;
-int index ;
+int smt_action(struct s_smc *smc, int class, int code, int index)
 {
 	int	event ;
 	int	port ;
@@ -2190,9 +2073,7 @@ int index ;
  *		set reconnect
  *	end
  */
-void smt_change_t_neg(smc,tneg)
-struct s_smc *smc ;
-u_long tneg ;
+void smt_change_t_neg(struct s_smc *smc, u_long tneg)
 {
 	smc->mib.a[PATH0].fddiPATHMaxT_Req = tneg ;
 
@@ -2207,10 +2088,7 @@ u_long tneg ;
  * canonical conversion of <len> bytes beginning form *data
  */
 #ifdef  USE_CAN_ADDR
-void hwm_conv_can(smc,data,len)
-struct s_smc *smc ;
-char *data ;
-int len ;
+void hwm_conv_can(struct s_smc *smc, char *data, int len)
 {
 	int i ;
 
@@ -2223,3 +2101,4 @@ int len ;
 #endif
 
 #endif	/* no SLIM_SMT */
+
diff --git a/drivers/net/skfp/smtdef.c b/drivers/net/skfp/smtdef.c
index beaed26b5..5a0c8db81 100644
--- a/drivers/net/skfp/smtdef.c
+++ b/drivers/net/skfp/smtdef.c
@@ -72,13 +72,11 @@ static const char ID_sccs[] = "@(#)smtdef.c	2.53 99/08/11 (C) SK " ;
 #define DEFAULT_LCT_EXTEND	50
 
 /* Forward declarations */
-extern  void	smt_reset_defaults ();
-static	void	smt_init_mib ();
+void smt_reset_defaults(struct s_smc *smc, int level);
+static void smt_init_mib(struct s_smc *smc, int level);
+static int set_min_max(int maxflag, u_long mib, u_long limit, u_long *oper);
 
-static int set_min_max() ;
-
-void smt_set_defaults(smc)
-struct s_smc *smc ;
+void smt_set_defaults(struct s_smc *smc)
 {
 	smt_reset_defaults(smc,0) ;
 }
@@ -86,9 +84,7 @@ struct s_smc *smc ;
 #define MS2BCLK(x)	((x)*12500L)
 #define US2BCLK(x)	((x)*1250L)
 
-void smt_reset_defaults(smc,level)
-struct s_smc *smc ;
-int level ;
+void smt_reset_defaults(struct s_smc *smc, int level)
 {
 	struct smt_config	*smt ;
 	int			i ;
@@ -170,9 +166,7 @@ static const char man_data[32] =
 /*	 01234567890123456789012345678901	*/
 	"xxxSK-NET FDDI SMT 7.3 - V2.8.8" ;
 
-static void smt_init_mib(smc,level)
-struct s_smc *smc ;
-int level ;
+static void smt_init_mib(struct s_smc *smc, int level)
 {
 	struct fddi_mib		*mib ;
 	struct fddi_mib_p	*pm ;
@@ -268,7 +262,7 @@ int level ;
 		 */
 		/* Attention: don't initialize mib pointer here! */
 		/*  It must be initialized during phase 2 */
-		smc->y[port].mib = 0 ;
+		smc->y[port].mib = NULL;
 		mib->fddiSMTPORTIndexes[port] = port+INDEX_PORT ;
 
 		pm->fddiPORTIndex = port+INDEX_PORT ;
@@ -292,8 +286,7 @@ int level ;
 	(void) smt_set_mac_opvalues(smc) ;
 }
 
-int smt_set_mac_opvalues(smc)
-struct s_smc *smc ;
+int smt_set_mac_opvalues(struct s_smc *smc)
 {
 	int	st ;
 	int	st2 ;
@@ -318,8 +311,7 @@ struct s_smc *smc ;
 	return(st) ;
 }
 
-void smt_fixup_mib(smc)
-struct s_smc *smc ;
+void smt_fixup_mib(struct s_smc *smc)
 {
 #ifdef	CONCENTRATOR
 	switch (smc->s.sas) {
@@ -355,11 +347,7 @@ struct s_smc *smc ;
  *	use mib
  * NOTE : numbers are negative, negate comparison !
  */
-static int set_min_max(maxflag,mib,limit,oper)
-int maxflag ;
-u_long mib ;
-u_long limit ;
-u_long *oper ;
+static int set_min_max(int maxflag, u_long mib, u_long limit, u_long *oper)
 {
 	u_long	old ;
 	old = *oper ;
@@ -369,3 +357,4 @@ u_long *oper ;
 		*oper = mib ;
 	return(old != *oper) ;
 }
+
diff --git a/drivers/net/skfp/smtinit.c b/drivers/net/skfp/smtinit.c
index c4b5af9b5..3c8964ce1 100644
--- a/drivers/net/skfp/smtinit.c
+++ b/drivers/net/skfp/smtinit.c
@@ -27,7 +27,7 @@
 static const char ID_sccs[] = "@(#)smtinit.c	1.15 97/05/06 (C) SK " ;
 #endif
 
-extern void init_fddi_driver() ;
+void init_fddi_driver(struct s_smc *smc, u_char *mac_addr);
 
 /* define global debug variable */
 #if defined(DEBUG) && !defined(DEBUG_BRD)
@@ -48,8 +48,7 @@ struct smt_debug debug;
  * Can not be called in smt_reset_defaults, because it is not sure that
  * the OEM ID is already defined.
  */
-static void set_oem_spec_val(smc)
-struct s_smc *smc ;
+static void set_oem_spec_val(struct s_smc *smc)
 {
 	struct fddi_mib *mib ;
 
@@ -66,9 +65,8 @@ struct s_smc *smc ;
 /*
  * Init SMT
  */
-int init_smt(smc,mac_addr)
-struct s_smc *smc ;
-u_char *mac_addr ;		/* canonical address or NULL */
+int init_smt(struct s_smc *smc, u_char *mac_addr)
+/* u_char *mac_addr;	canonical address or NULL */
 {
 	int	p ;
 
@@ -124,3 +122,4 @@ u_char *mac_addr ;		/* canonical address or NULL */
 
 	return(0) ;
 }
+
diff --git a/drivers/net/skfp/smtparse.c b/drivers/net/skfp/smtparse.c
index 0b4a2274d..d5779e414 100644
--- a/drivers/net/skfp/smtparse.c
+++ b/drivers/net/skfp/smtparse.c
@@ -73,7 +73,7 @@ static struct s_ptab {
 	{ "SBACOMMAND",16,	0 } ,
 	{ "SBAAVAILABLE",17,	1,	0,	100	} ,
 #endif
-	{ 0 }
+	{ NULL }
 } ;
 
 /* Define maximum string size for values and keybuffer */
@@ -82,8 +82,9 @@ static struct s_ptab {
 /*
  * local function declarations
  */
-static u_long parse_num() ;
-static int parse_word() ;
+static u_long parse_num(int type, char _far *value, char *v, u_long mn,
+			u_long mx, int scale);
+static int parse_word(char *buf, char _far *text);
 
 #ifdef SIM
 #define DB_MAIN(a,b,c)	printf(a,b,c)
@@ -117,11 +118,8 @@ static int parse_word() ;
  *
  * END_MANUAL_ENTRY()
  */
-int smt_parse_arg(smc,keyword,type,value)
-struct s_smc *smc ;
-char _far *keyword ;
-int type ;
-char _far *value ;
+int smt_parse_arg(struct s_smc *smc, char _far *keyword, int type,
+		  char _far *value)
 {
 	char		keybuf[MAX_VAL+1];
 	char		valbuf[MAX_VAL+1];
@@ -287,9 +285,7 @@ char _far *value ;
 	return(0) ;
 }
 
-static int parse_word(buf,text)
-char *buf ;
-char _far *text ;
+static int parse_word(char *buf, char _far *text)
 {
 	char		c ;
 	char 		*p ;
@@ -364,13 +360,8 @@ char _far *text ;
 	return(0) ;
 }
 
-static u_long parse_num(type,value,v,mn,mx,scale)
-int type ;
-char _far *value ;
-char *v ;
-u_long mn ;
-u_long mx ;
-int scale ;
+static u_long parse_num(int type, char _far *value, char *v, u_long mn,
+			u_long mx, int scale)
 {
 	u_long	x = 0 ;
 	char	c ;
@@ -473,3 +464,4 @@ main()
 	exit(0) ;
 }
 #endif
+
diff --git a/drivers/net/skfp/smttimer.c b/drivers/net/skfp/smttimer.c
index 9d7b71e26..531795e98 100644
--- a/drivers/net/skfp/smttimer.c
+++ b/drivers/net/skfp/smttimer.c
@@ -26,28 +26,17 @@
 static const char ID_sccs[] = "@(#)smttimer.c	2.4 97/08/04 (C) SK " ;
 #endif
 
-/*
- * external function declarations
- */
-extern u_long hwt_read() ;
-extern void hwt_stop() ;
-extern void hwt_start() ;
-
-static void timer_done() ;
+static void timer_done(struct s_smc *smc, int restart);
 
-
-void smt_timer_init(smc)
-struct s_smc *smc ;
+void smt_timer_init(struct s_smc *smc)
 {
-	smc->t.st_queue = 0 ;
+	smc->t.st_queue = NULL;
 	smc->t.st_fast.tm_active = FALSE ;
-	smc->t.st_fast.tm_next = 0 ;
+	smc->t.st_fast.tm_next = NULL;
 	hwt_init(smc) ;
 }
 
-void smt_timer_stop(smc,timer)
-struct s_smc *smc ;
-struct smt_timer *timer ;
+void smt_timer_stop(struct s_smc *smc, struct smt_timer *timer)
 {
 	struct smt_timer	**prev ;
 	struct smt_timer	*tm ;
@@ -70,11 +59,8 @@ struct smt_timer *timer ;
 	}
 }
 
-void smt_timer_start(smc,timer,time,token)
-struct s_smc *smc ;
-struct smt_timer *timer ;
-u_long		time ;
-u_long		token ;
+void smt_timer_start(struct s_smc *smc, struct smt_timer *timer, u_long time,
+		     u_long token)
 {
 	struct smt_timer	**prev ;
 	struct smt_timer	*tm ;
@@ -89,7 +75,7 @@ u_long		token ;
 	timer->tm_active = TRUE ;
 	if (!smc->t.st_queue) {
 		smc->t.st_queue = timer ;
-		timer->tm_next = 0 ;
+		timer->tm_next = NULL;
 		timer->tm_delta = time ;
 		hwt_start(smc,time) ;
 		return ;
@@ -121,21 +107,17 @@ u_long		token ;
 	hwt_start(smc,smc->t.st_queue->tm_delta) ;
 }
 
-void smt_force_irq(smc)
-struct s_smc *smc ;
+void smt_force_irq(struct s_smc *smc)
 {
 	smt_timer_start(smc,&smc->t.st_fast,32L, EV_TOKEN(EVENT_SMT,SM_FAST)); 
 }
 
-void smt_timer_done(smc)
-struct s_smc *smc ;
+void smt_timer_done(struct s_smc *smc)
 {
 	timer_done(smc,1) ;
 }
 
-static void timer_done(smc,restart)
-struct s_smc *smc ;
-int restart ;
+static void timer_done(struct s_smc *smc, int restart)
 {
 	u_long			delta ;
 	struct smt_timer	*tm ;
@@ -159,7 +141,7 @@ int restart ;
 			done = 1 ;
 		}
 	}
-	*last = 0 ;
+	*last = NULL;
 	next = smc->t.st_queue ;
 	smc->t.st_queue = tm ;
 
@@ -171,3 +153,4 @@ int restart ;
 	if (restart && smc->t.st_queue)
 		hwt_start(smc,smc->t.st_queue->tm_delta) ;
 }
+
diff --git a/drivers/net/skfp/srf.c b/drivers/net/skfp/srf.c
index ce757a19f..16573aca8 100644
--- a/drivers/net/skfp/srf.c
+++ b/drivers/net/skfp/srf.c
@@ -38,10 +38,10 @@ static const char ID_sccs[] = "@(#)srf.c	1.18 97/08/04 (C) SK " ;
 /*
  * function declarations
  */
-static void clear_all_rep() ;
-static void clear_reported() ;
-static void smt_send_srf() ;
-static struct s_srf_evc *smt_get_evc() ;
+static void clear_all_rep(struct s_smc *smc);
+static void clear_reported(struct s_smc *smc);
+static void smt_send_srf(struct s_smc *smc);
+static struct s_srf_evc *smt_get_evc(struct s_smc *smc, int code, int index);
 
 #define MAX_EVCS	(sizeof(smc->evcs)/sizeof(smc->evcs[0]))
 
@@ -69,8 +69,7 @@ static const struct evc_init evc_inits[] = {
 
 #define MAX_INIT_EVC	(sizeof(evc_inits)/sizeof(evc_inits[0]))
 
-void smt_init_evc(smc)
-struct s_smc *smc ;
+void smt_init_evc(struct s_smc *smc)
 {
 	struct s_srf_evc	*evc ;
 	const struct evc_init 	*init ;
@@ -159,10 +158,7 @@ struct s_smc *smc ;
 	smc->srf.sr_state = SR0_WAIT ;
 }
 
-static struct s_srf_evc *smt_get_evc(smc,code,index)
-struct s_smc *smc ;
-int code ;
-int index ;
+static struct s_srf_evc *smt_get_evc(struct s_smc *smc, int code, int index)
 {
 	int			i ;
 	struct s_srf_evc	*evc ;
@@ -171,7 +167,7 @@ int index ;
 		if (evc->evc_code == code && evc->evc_index == index)
 			return(evc) ;
 	}
-	return(0) ;
+	return NULL;
 }
 
 #define THRESHOLD_2	(2*TICKS_PER_SECOND)
@@ -188,11 +184,7 @@ static const char * const srf_names[] = {
 } ;
 #endif
 
-void smt_srf_event(smc,code,index,cond)
-struct s_smc *smc ;
-int code ;
-int index ;
-int cond ;
+void smt_srf_event(struct s_smc *smc, int code, int index, int cond)
 {
 	struct s_srf_evc	*evc ;
 	int			cond_asserted = 0 ;
@@ -340,8 +332,7 @@ int cond ;
 	}
 }
 
-static void clear_all_rep(smc)
-struct s_smc *smc ;
+static void clear_all_rep(struct s_smc *smc)
 {
 	struct s_srf_evc	*evc ;
 	int			i ;
@@ -354,8 +345,7 @@ struct s_smc *smc ;
 	smc->srf.any_report = FALSE ;
 }
 
-static void clear_reported(smc)
-struct s_smc *smc ;
+static void clear_reported(struct s_smc *smc)
 {
 	struct s_srf_evc	*evc ;
 	int			i ;
@@ -375,13 +365,10 @@ struct s_smc *smc ;
 	}
 }
 
-extern SMbuf *smt_build_frame() ;
-
 /*
  * build and send SMT SRF frame
  */
-static void smt_send_srf(smc)
-struct s_smc *smc ;
+static void smt_send_srf(struct s_smc *smc)
 {
 
 	struct smt_header	*smt ;
@@ -439,3 +426,4 @@ struct s_smc *smc ;
 
 #endif	/* no BOOT */
 #endif	/* no SLIM_SMT */
+
diff --git a/drivers/net/slip.c b/drivers/net/slip.c
index a8967112f..6209a35aa 100644
--- a/drivers/net/slip.c
+++ b/drivers/net/slip.c
@@ -954,7 +954,7 @@ slip_close(struct tty_struct *tty)
 	if (!sl || sl->magic != SLIP_MAGIC || sl->tty != tty)
 		return;
 
-	tty->disc_data = 0;
+	tty->disc_data = NULL;
 	sl->tty = NULL;
 	if (!sl->leased)
 		sl->line = 0;
diff --git a/drivers/net/smc-mca.c b/drivers/net/smc-mca.c
index b67fcc029..c176df6c2 100644
--- a/drivers/net/smc-mca.c
+++ b/drivers/net/smc-mca.c
@@ -51,6 +51,8 @@
 #include "8390.h"
 #include "smc-mca.h"
 
+#define DRV_NAME "smc-mca"
+
 static int ultramca_open(struct net_device *dev);
 static void ultramca_reset_8390(struct net_device *dev);
 static void ultramca_get_8390_hdr(struct net_device *dev,
@@ -265,7 +267,7 @@ int __init ultramca_probe(struct device *gen_dev)
 		goto err_unclaim;
 	}
 
-	if (!request_region(ioaddr, ULTRA_IO_EXTENT, dev->name)) {
+	if (!request_region(ioaddr, ULTRA_IO_EXTENT, DRV_NAME)) {
 		rc = -ENODEV;
 		goto err_unclaim;
 	}
diff --git a/drivers/net/smc-ultra.c b/drivers/net/smc-ultra.c
index 5d71ed2e6..ce4628f62 100644
--- a/drivers/net/smc-ultra.c
+++ b/drivers/net/smc-ultra.c
@@ -72,6 +72,8 @@ static const char version[] =
 
 #include "8390.h"
 
+#define DRV_NAME "smc-ultra"
+
 /* A zero-terminated list of I/O addresses to be probed. */
 static unsigned int ultra_portlist[] __initdata =
 {0x200, 0x220, 0x240, 0x280, 0x300, 0x340, 0x380, 0};
@@ -178,6 +180,7 @@ static void cleanup_card(struct net_device *dev)
 	release_region(dev->base_addr - ULTRA_NIC_OFFSET, ULTRA_IO_EXTENT);
 }
 
+#ifndef MODULE
 struct net_device * __init ultra_probe(int unit)
 {
 	struct net_device *dev = alloc_ei_netdev();
@@ -202,6 +205,7 @@ out:
 	free_netdev(dev);
 	return ERR_PTR(err);
 }
+#endif
 
 static int __init ultra_probe1(struct net_device *dev, int ioaddr)
 {
@@ -215,7 +219,7 @@ static int __init ultra_probe1(struct net_device *dev, int ioaddr)
 	unsigned char idreg = inb(ioaddr + 7);
 	unsigned char reg4 = inb(ioaddr + 4) & 0x7f;
 
-	if (!request_region(ioaddr, ULTRA_IO_EXTENT, dev->name))
+	if (!request_region(ioaddr, ULTRA_IO_EXTENT, DRV_NAME))
 		return -EBUSY;
 
 	/* Check the ID nibble. */
diff --git a/drivers/net/smc-ultra32.c b/drivers/net/smc-ultra32.c
index b26e0f887..8080a3767 100644
--- a/drivers/net/smc-ultra32.c
+++ b/drivers/net/smc-ultra32.c
@@ -61,6 +61,8 @@ static const char *version = "smc-ultra32.c: 06/97 v1.00\n";
 
 #include "8390.h"
 
+#define DRV_NAME "smc-ultra32"
+
 static int ultra32_probe1(struct net_device *dev, int ioaddr);
 static int ultra32_open(struct net_device *dev);
 static void ultra32_reset_8390(struct net_device *dev);
@@ -163,7 +165,7 @@ static int __init ultra32_probe1(struct net_device *dev, int ioaddr)
 	unsigned char reg4;
 	const char *ifmap[] = {"UTP No Link", "", "UTP/AUI", "UTP/BNC"};
 
-	if (!request_region(ioaddr, ULTRA32_IO_EXTENT, dev->name))
+	if (!request_region(ioaddr, ULTRA32_IO_EXTENT, DRV_NAME))
 		return -EBUSY;
 
 	if (inb(ioaddr + ULTRA32_IDPORT) == 0xff ||
diff --git a/drivers/net/smc9194.c b/drivers/net/smc9194.c
index d2a2fe9bd..8ee249a38 100644
--- a/drivers/net/smc9194.c
+++ b/drivers/net/smc9194.c
@@ -78,6 +78,8 @@ static const char version[] =
 
 #include "smc9194.h"
 
+#define DRV_NAME "smc9194"
+
 /*------------------------------------------------------------------------
  .
  . Configuration options, for the experienced user to change.
@@ -94,16 +96,51 @@ static const char version[] =
 #define USE_32_BIT 1
 #endif
 
+#if defined(__H8300H__) || defined(__H8300S__)
+#define NO_AUTOPROBE
+#undef insl
+#undef outsl
+#define insl(a,b,l)  io_insl_noswap(a,b,l)
+#define outsl(a,b,l) io_outsl_noswap(a,b,l)
+#endif
+
 /*
  .the SMC9194 can be at any of the following port addresses.  To change,
  .for a slightly different card, you can add it to the array.  Keep in
  .mind that the array must end in zero.
 */
-static unsigned int smc_portlist[] __initdata = { 
-	0x200, 0x220, 0x240, 0x260, 0x280, 0x2A0, 0x2C0, 0x2E0,
-	0x300, 0x320, 0x340, 0x360, 0x380, 0x3A0, 0x3C0, 0x3E0, 0
+
+struct devlist {
+	unsigned int port;
+	unsigned int irq;
 };
 
+#if defined(CONFIG_H8S_EDOSK2674)
+static struct devlist smc_devlist[] __initdata = {
+	{.port = 0xf80000, .irq = 16},
+	{.port = 0,        .irq = 0 },
+};
+#else
+static struct devlist smc_devlist[] __initdata = {
+	{.port = 0x200, .irq = 0},
+	{.port = 0x220, .irq = 0},
+	{.port = 0x240, .irq = 0},
+	{.port = 0x260, .irq = 0},
+	{.port = 0x280, .irq = 0},
+	{.port = 0x2A0, .irq = 0},
+	{.port = 0x2C0, .irq = 0},
+	{.port = 0x2E0, .irq = 0},
+	{.port = 0x300, .irq = 0},
+	{.port = 0x320, .irq = 0},
+	{.port = 0x340, .irq = 0},
+	{.port = 0x360, .irq = 0},
+	{.port = 0x380, .irq = 0},
+	{.port = 0x3A0, .irq = 0},
+	{.port = 0x3C0, .irq = 0},
+	{.port = 0x3E0, .irq = 0},
+	{.port = 0,     .irq = 0},
+};
+#endif
 /*
  . Wait time for memory to be free.  This probably shouldn't be
  . tuned that much, as waiting for this means nothing else happens
@@ -466,7 +503,7 @@ static void smc_setmulticast( int ioaddr, int count, struct dev_mc_list * addrs
 static int smc_wait_to_send_packet( struct sk_buff * skb, struct net_device * dev )
 {
 	struct smc_local *lp = netdev_priv(dev);
-	unsigned short ioaddr 	= dev->base_addr;
+	unsigned int ioaddr 	= dev->base_addr;
 	word 			length;
 	unsigned short 		numPages;
 	word			time_out;
@@ -580,7 +617,7 @@ static void smc_hardware_send_packet( struct net_device * dev )
 	byte	 		packet_no;
 	struct sk_buff * 	skb = lp->saved_skb;
 	word			length;
-	unsigned short		ioaddr;
+	unsigned int		ioaddr;
 	byte			* buf;
 
 	ioaddr = dev->base_addr;
@@ -635,7 +672,11 @@ static void smc_hardware_send_packet( struct net_device * dev )
 #ifdef USE_32_BIT
 	if ( length & 0x2  ) {
 		outsl(ioaddr + DATA_1, buf,  length >> 2 );
+#if !defined(__H8300H__) && !defined(__H8300S__)
 		outw( *((word *)(buf + (length & 0xFFFFFFFC))),ioaddr +DATA_1);
+#else
+		ctrl_outw( *((word *)(buf + (length & 0xFFFFFFFC))),ioaddr +DATA_1);
+#endif
 	}
 	else
 		outsl(ioaddr + DATA_1, buf,  length >> 2 );
@@ -691,9 +732,12 @@ static int ifport;
 struct net_device * __init smc_init(int unit)
 {
 	struct net_device *dev = alloc_etherdev(sizeof(struct smc_local));
-	unsigned *port;
+	static struct devlist *smcdev = smc_devlist;
 	int err = 0;
 
+#ifndef NO_AUTOPROBE
+	smcdev = smc_devlist;
+#endif
 	if (!dev)
 		return ERR_PTR(-ENODEV);
 
@@ -711,11 +755,11 @@ struct net_device * __init smc_init(int unit)
 	} else if (io != 0) {	/* Don't probe at all. */
 		err = -ENXIO;
 	} else {
-		for (port = smc_portlist; *port; port++) {
-			if (smc_probe(dev, *port) == 0)
+		for (;smcdev->port; smcdev++) {
+			if (smc_probe(dev, smcdev->port) == 0)
 				break;
 		}
-		if (!*port)
+		if (!smcdev->port)
 			err = -ENODEV;
 	}
 	if (err)
@@ -741,6 +785,7 @@ out:
 */
 int __init smc_findirq( int ioaddr )
 {
+#ifndef NO_AUTOPROBE
 	int	timeout = 20;
 	unsigned long cookie;
 
@@ -795,6 +840,14 @@ int __init smc_findirq( int ioaddr )
 
 	/* and return what I found */
 	return probe_irq_off(cookie);
+#else /* NO_AUTOPROBE */
+	struct devlist *smcdev;
+	for (smcdev = smc_devlist; smcdev->port; smcdev++) {
+		if (smcdev->port == ioaddr)
+			return smcdev->irq;
+	}
+	return 0;
+#endif
 }
 
 /*----------------------------------------------------------------------
@@ -843,7 +896,7 @@ static int __init smc_probe(struct net_device *dev, int ioaddr)
 	word memory_cfg_register;
 
 	/* Grab the region so that no one else tries to probe our ioports. */
-	if (!request_region(ioaddr, SMC_IO_EXTENT, dev->name))
+	if (!request_region(ioaddr, SMC_IO_EXTENT, DRV_NAME))
 		return -EBUSY;
 
 	dev->irq = irq;
@@ -863,6 +916,7 @@ static int __init smc_probe(struct net_device *dev, int ioaddr)
 		retval = -ENODEV;
 		goto err_out;
 	}
+#if !defined(CONFIG_H8S_EDOSK2674)
 	/* well, we've already written once, so hopefully another time won't
  	   hurt.  This time, I need to switch the bank register to bank 1,
 	   so I can access the base address register */
@@ -877,6 +931,10 @@ static int __init smc_probe(struct net_device *dev, int ioaddr)
 		retval = -ENODEV;
 		goto err_out;
 	}
+#else
+	(void)base_address_register; /* Warning suppression */
+#endif
+
 
 	/*  check if the revision register is something that I recognize.
 	    These might need to be added to later, as future revisions
@@ -1001,9 +1059,9 @@ static int __init smc_probe(struct net_device *dev, int ioaddr)
 	memset(dev->priv, 0, sizeof(struct smc_local));
 
 	/* Grab the IRQ */
-      	retval = request_irq(dev->irq, &smc_interrupt, 0, dev->name, dev);
+      	retval = request_irq(dev->irq, &smc_interrupt, 0, DRV_NAME, dev);
       	if (retval) {
-		printk("%s: unable to get IRQ %d (irqval=%d).\n", dev->name,
+		printk("%s: unable to get IRQ %d (irqval=%d).\n", DRV_NAME,
 			dev->irq, retval);
   	  	goto err_out;
       	}
diff --git a/drivers/net/starfire.c b/drivers/net/starfire.c
index 0eb660aa7..793201d3f 100644
--- a/drivers/net/starfire.c
+++ b/drivers/net/starfire.c
@@ -880,7 +880,7 @@ static int __devinit starfire_init_one(struct pci_dev *pdev,
 
 	irq = pdev->irq;
 
-	if (pci_request_regions (pdev, dev->name)) {
+	if (pci_request_regions (pdev, DRV_NAME)) {
 		printk(KERN_ERR DRV_NAME " %d: cannot reserve PCI resources, aborting\n", card_idx);
 		goto err_out_free_netdev;
 	}
diff --git a/drivers/net/stnic.c b/drivers/net/stnic.c
index 8346de427..b6dfdf8f4 100644
--- a/drivers/net/stnic.c
+++ b/drivers/net/stnic.c
@@ -28,6 +28,8 @@
 
 #include "8390.h"
 
+#define DRV_NAME "stnic"
+
 #define byte	unsigned char
 #define half	unsigned short
 #define word	unsigned int
@@ -130,7 +132,7 @@ static int __init stnic_probe(void)
 
   /* Snarf the interrupt now.  There's no point in waiting since we cannot
      share and the board will usually be enabled. */
-  err = request_irq (dev->irq, ei_interrupt, 0, dev->name, dev);
+  err = request_irq (dev->irq, ei_interrupt, 0, DRV_NAME, dev);
   if (err)  {
       printk (KERN_EMERG " unable to get IRQ %d.\n", dev->irq);
       free_netdev(dev);
diff --git a/drivers/net/sun3_82586.c b/drivers/net/sun3_82586.c
index 669a02fb7..053fcaf1c 100644
--- a/drivers/net/sun3_82586.c
+++ b/drivers/net/sun3_82586.c
@@ -53,6 +53,8 @@ static int fifo=0x8;	/* don't change */
 
 #include "sun3_82586.h"
 
+#define DRV_NAME "sun3_82586"
+
 #define DEBUG       /* debug on */
 #define SYSBUSVAL 0 /* 16 Bit */
 #define SUN3_82586_TOTAL_SIZE	PAGE_SIZE
@@ -336,7 +338,7 @@ static int __init sun3_82586_probe1(struct net_device *dev,int ioaddr)
 {
 	int i, size, retval;
 
-	if (!request_region(ioaddr, SUN3_82586_TOTAL_SIZE, dev->name))
+	if (!request_region(ioaddr, SUN3_82586_TOTAL_SIZE, DRV_NAME))
 		return -EBUSY;
 
 	/* copy in the ethernet address from the prom */
diff --git a/drivers/net/sun3lance.c b/drivers/net/sun3lance.c
index f0512a498..6faef842d 100644
--- a/drivers/net/sun3lance.c
+++ b/drivers/net/sun3lance.c
@@ -42,7 +42,6 @@ static char *version = "sun3lance.c: v1.2 1/12/2001  Sam Creasey (sammy@sammy.ne
 #include <asm/bitops.h>
 #include <asm/io.h>
 #include <asm/pgtable.h>
-#include <asm/pgalloc.h>
 #include <asm/dvma.h>
 #include <asm/idprom.h>
 #include <asm/machines.h>
diff --git a/drivers/net/sunbmac.c b/drivers/net/sunbmac.c
index 100a4f7f3..ec05d1bd1 100644
--- a/drivers/net/sunbmac.c
+++ b/drivers/net/sunbmac.c
@@ -1274,7 +1274,7 @@ static int __init bigmac_match(struct sbus_dev *sdev)
 static int __init bigmac_probe(void)
 {
 	struct sbus_bus *sbus;
-	struct sbus_dev *sdev = 0;
+	struct sbus_dev *sdev = NULL;
 	static int called;
 	int cards = 0, v;
 
diff --git a/drivers/net/sundance.c b/drivers/net/sundance.c
index e5069fca1..849b57634 100644
--- a/drivers/net/sundance.c
+++ b/drivers/net/sundance.c
@@ -148,15 +148,6 @@ static char *media[MAX_UNITS];
 #define TX_TIMEOUT  (4*HZ)
 #define PKT_BUF_SZ		1536	/* Size of each temporary Rx buffer.*/
 
-#ifndef __KERNEL__
-#define __KERNEL__
-#endif
-#if !defined(__OPTIMIZE__)
-#warning  You must compile this file with the correct options!
-#warning  See the last lines of the source file.
-#error You must compile this driver with "-O".
-#endif
-
 /* Include files, designed to support most kernel versions 2.0.0 and later. */
 #include <linux/module.h>
 #include <linux/kernel.h>
@@ -309,7 +300,7 @@ static struct pci_id_info pci_id_tbl[] = {
 	{"D-Link DFE-530TXS FAST Ethernet Adapter"},
 	{"D-Link DL10050-based FAST Ethernet Adapter"},
 	{"Sundance Technology Alta"},
-	{0,},			/* 0 terminated list. */
+	{NULL,},			/* 0 terminated list. */
 };
 
 /* This driver was written to use PCI memory space, however x86-oriented
@@ -1039,7 +1030,7 @@ static void init_ring(struct net_device *dev)
 			((i+1)%RX_RING_SIZE)*sizeof(*np->rx_ring));
 		np->rx_ring[i].status = 0;
 		np->rx_ring[i].frag[0].length = 0;
-		np->rx_skbuff[i] = 0;
+		np->rx_skbuff[i] = NULL;
 	}
 
 	/* Fill in the Rx buffers.  Handle allocation failure gracefully. */
@@ -1058,7 +1049,7 @@ static void init_ring(struct net_device *dev)
 	np->dirty_rx = (unsigned int)(i - RX_RING_SIZE);
 
 	for (i = 0; i < TX_RING_SIZE; i++) {
-		np->tx_skbuff[i] = 0;
+		np->tx_skbuff[i] = NULL;
 		np->tx_ring[i].status = 0;
 	}
 	return;
@@ -1162,7 +1153,7 @@ reset_tx (struct net_device *dev)
 				dev_kfree_skb_irq (skb);
 			else
 				dev_kfree_skb (skb);
-			np->tx_skbuff[i] = 0;
+			np->tx_skbuff[i] = NULL;
 			np->stats.tx_dropped++;
 		}
 	}
@@ -1265,7 +1256,7 @@ static irqreturn_t intr_handler(int irq, void *dev_instance, struct pt_regs *rgs
 					np->tx_ring[entry].frag[0].addr,
 					skb->len, PCI_DMA_TODEVICE);
 				dev_kfree_skb_irq (np->tx_skbuff[entry]);
-				np->tx_skbuff[entry] = 0;
+				np->tx_skbuff[entry] = NULL;
 				np->tx_ring[entry].frag[0].addr = 0;
 				np->tx_ring[entry].frag[0].length = 0;
 			}
@@ -1284,7 +1275,7 @@ static irqreturn_t intr_handler(int irq, void *dev_instance, struct pt_regs *rgs
 					np->tx_ring[entry].frag[0].addr,
 					skb->len, PCI_DMA_TODEVICE);
 				dev_kfree_skb_irq (np->tx_skbuff[entry]);
-				np->tx_skbuff[entry] = 0;
+				np->tx_skbuff[entry] = NULL;
 				np->tx_ring[entry].frag[0].addr = 0;
 				np->tx_ring[entry].frag[0].length = 0;
 			}
@@ -1762,7 +1753,7 @@ static int netdev_close(struct net_device *dev)
 				np->rx_ring[i].frag[0].addr, np->rx_buf_sz,
 				PCI_DMA_FROMDEVICE);
 			dev_kfree_skb(skb);
-			np->rx_skbuff[i] = 0;
+			np->rx_skbuff[i] = NULL;
 		}
 	}
 	for (i = 0; i < TX_RING_SIZE; i++) {
@@ -1772,7 +1763,7 @@ static int netdev_close(struct net_device *dev)
 				np->tx_ring[i].frag[0].addr, skb->len,
 				PCI_DMA_TODEVICE);
 			dev_kfree_skb(skb);
-			np->tx_skbuff[i] = 0;
+			np->tx_skbuff[i] = NULL;
 		}
 	}
 
diff --git a/drivers/net/sungem.c b/drivers/net/sungem.c
index cb890cd3e..e48ec3421 100644
--- a/drivers/net/sungem.c
+++ b/drivers/net/sungem.c
@@ -33,6 +33,7 @@
 #include <linux/crc32.h>
 #include <linux/random.h>
 #include <linux/workqueue.h>
+#include <linux/if_vlan.h>
 
 #include <asm/system.h>
 #include <asm/bitops.h>
@@ -742,7 +743,7 @@ static void gem_rx(struct gem *gp)
 				       PCI_DMA_FROMDEVICE);
 			gp->rx_skbs[entry] = new_skb;
 			new_skb->dev = gp->dev;
-			skb_put(new_skb, (ETH_FRAME_LEN + RX_OFFSET));
+			skb_put(new_skb, (gp->rx_buf_sz + RX_OFFSET));
 			rxd->buffer = cpu_to_le64(pci_map_page(gp->pdev,
 							       virt_to_page(new_skb->data),
 							       offset_in_page(new_skb->data),
@@ -1482,6 +1483,9 @@ static void gem_init_rings(struct gem *gp)
 
 	gem_clean_rings(gp);
 
+	gp->rx_buf_sz = max(dev->mtu + ETH_HLEN + VLAN_HLEN,
+			    (unsigned)VLAN_ETH_FRAME_LEN);
+
 	for (i = 0; i < RX_RING_SIZE; i++) {
 		struct sk_buff *skb;
 		struct gem_rxd *rxd = &gb->rxd[i];
@@ -1495,7 +1499,7 @@ static void gem_init_rings(struct gem *gp)
 
 		gp->rx_skbs[i] = skb;
 		skb->dev = dev;
-		skb_put(skb, (ETH_FRAME_LEN + RX_OFFSET));
+		skb_put(skb, (gp->rx_buf_sz + RX_OFFSET));
 		dma_addr = pci_map_page(gp->pdev,
 					virt_to_page(skb->data),
 					offset_in_page(skb->data),
@@ -1750,7 +1754,7 @@ static void gem_init_mac(struct gem *gp)
 	writel(0x40, gp->regs + MAC_MINFSZ);
 
 	/* Ethernet payload + header + FCS + optional VLAN tag. */
-	writel(0x20000000 | (gp->dev->mtu + ETH_HLEN + 4 + 4), gp->regs + MAC_MAXFSZ);
+	writel(0x20000000 | (gp->rx_buf_sz + 4), gp->regs + MAC_MAXFSZ);
 
 	writel(0x07, gp->regs + MAC_PASIZE);
 	writel(0x04, gp->regs + MAC_JAMSIZE);
@@ -1827,7 +1831,7 @@ static void gem_init_pause_thresholds(struct gem *gp)
 	if (gp->rx_fifo_sz <= (2 * 1024)) {
 		gp->rx_pause_off = gp->rx_pause_on = gp->rx_fifo_sz;
 	} else {
-		int max_frame = (gp->dev->mtu + ETH_HLEN + 4 + 4 + 64) & ~63;
+		int max_frame = (gp->rx_buf_sz + 4 + 64) & ~63;
 		int off = (gp->rx_fifo_sz - (max_frame * 2));
 		int on = off - max_frame;
 
@@ -2020,8 +2024,7 @@ static void gem_stop_phy(struct gem *gp)
 	/* Let the chip settle down a bit, it seems that helps
 	 * for sleep mode on some models
 	 */
-	set_current_state(TASK_UNINTERRUPTIBLE);
-	schedule_timeout(HZ/100);
+	msleep(10);
 
 	/* Make sure we aren't polling PHY status change. We
 	 * don't currently use that feature though
@@ -2039,8 +2042,7 @@ static void gem_stop_phy(struct gem *gp)
 		 * dont wait a bit here, looks like the chip takes
 		 * some time to really shut down
 		 */
-		set_current_state(TASK_UNINTERRUPTIBLE);
-		schedule_timeout(HZ/100);
+		msleep(10);
 	}
 
 	writel(0, gp->regs + MAC_TXCFG);
@@ -2717,7 +2719,7 @@ static int __devinit gem_init_one(struct pci_dev *pdev,
 
 	gp = dev->priv;
 
-	err = pci_request_regions(pdev, dev->name);
+	err = pci_request_regions(pdev, DRV_NAME);
 	if (err) {
 		printk(KERN_ERR PFX "Cannot obtain PCI resources, "
 		       "aborting.\n");
diff --git a/drivers/net/sungem.h b/drivers/net/sungem.h
index ab83530f2..eed77bfe1 100644
--- a/drivers/net/sungem.h
+++ b/drivers/net/sungem.h
@@ -911,7 +911,7 @@ struct gem_rxd {
 	  (GP)->tx_old - (GP)->tx_new - 1)
 
 #define RX_OFFSET          2
-#define RX_BUF_ALLOC_SIZE(gp)	((gp)->dev->mtu + 46 + RX_OFFSET + 64)
+#define RX_BUF_ALLOC_SIZE(gp)	((gp)->rx_buf_sz + 28 + RX_OFFSET + 64)
 
 #define RX_COPY_THRESHOLD  256
 
@@ -979,6 +979,7 @@ struct gem {
 	int			rx_fifo_sz;
 	int			rx_pause_off;
 	int			rx_pause_on;
+	int			rx_buf_sz;
 	int			mii_phy_addr;
 
 	u32			mac_rx_cfg;
diff --git a/drivers/net/sunhme.c b/drivers/net/sunhme.c
index 5c2917c6d..13fdcca49 100644
--- a/drivers/net/sunhme.c
+++ b/drivers/net/sunhme.c
@@ -68,6 +68,8 @@ static char version[] =
 #include "sunhme.h"
 
 
+#define DRV_NAME "sunhme"
+
 static int macaddr[6];
 
 /* accept MAC address of the form macaddr=0x08,0x00,0x20,0x30,0x40,0x50 */
@@ -526,8 +528,10 @@ static void happy_meal_tcvr_write(struct happy_meal *hp,
 	ASD(("happy_meal_tcvr_write: reg=0x%02x value=%04x\n", reg, value));
 
 	/* Welcome to Sun Microsystems, can I take your order please? */
-	if (!(hp->happy_flags & HFLAG_FENABLE))
-		return happy_meal_bb_write(hp, tregs, reg, value);
+	if (!(hp->happy_flags & HFLAG_FENABLE)) {
+		happy_meal_bb_write(hp, tregs, reg, value);
+		return;
+	}
 
 	/* Would you like fries with that? */
 	hme_write32(hp, tregs + TCVR_FRAME,
@@ -2920,7 +2924,8 @@ static int is_quattro_p(struct pci_dev *pdev)
 	struct list_head *tmp;
 	int n_hmes;
 
-	if (busdev->vendor != PCI_VENDOR_ID_DEC ||
+	if (busdev == NULL ||
+	    busdev->vendor != PCI_VENDOR_ID_DEC ||
 	    busdev->device != PCI_DEVICE_ID_DEC_21153)
 		return 0;
 
@@ -3085,7 +3090,7 @@ static int __init happy_meal_pci_init(struct pci_dev *pdev)
 		printk(KERN_ERR "happymeal(PCI): Cannot find proper PCI device base address.\n");
 		goto err_out_clear_quattro;
 	}
-	if (pci_request_regions(pdev, dev->name)) {
+	if (pci_request_regions(pdev, DRV_NAME)) {
 		printk(KERN_ERR "happymeal(PCI): Cannot obtain PCI resources, "
 		       "aborting.\n");
 		goto err_out_clear_quattro;
diff --git a/drivers/net/sunlance.c b/drivers/net/sunlance.c
index b8e133682..e80311524 100644
--- a/drivers/net/sunlance.c
+++ b/drivers/net/sunlance.c
@@ -911,7 +911,7 @@ static void build_fake_packet(struct lance_private *lp)
 	lp->tx_new = TX_NEXT(entry);
 }
 
-struct net_device *last_dev = 0;
+struct net_device *last_dev;
 
 static int lance_open(struct net_device *dev)
 {
@@ -1550,8 +1550,8 @@ static int __init sparc_lance_probe(void)
 static int __init sparc_lance_probe(void)
 {
 	struct sbus_bus *bus;
-	struct sbus_dev *sdev = 0;
-	struct sbus_dma *ledma = 0;
+	struct sbus_dev *sdev = NULL;
+	struct sbus_dma *ledma = NULL;
 	static int called;
 	int cards = 0, v;
 
@@ -1565,7 +1565,7 @@ static int __init sparc_lance_probe(void)
 		for_each_sbusdev (sdev, bus) {
 			if (strcmp(sdev->prom_name, "le") == 0) {
 				cards++;
-				if ((v = sparc_lance_init(sdev, 0, 0)))
+				if ((v = sparc_lance_init(sdev, NULL, NULL)))
 					return v;
 				continue;
 			}
@@ -1573,14 +1573,14 @@ static int __init sparc_lance_probe(void)
 				cards++;
 				ledma = find_ledma(sdev);
 				if ((v = sparc_lance_init(sdev->child,
-							  ledma, 0)))
+							  ledma, NULL)))
 					return v;
 				continue;
 			}
 			if (strcmp(sdev->prom_name, "lebuffer") == 0){
 				cards++;
 				if ((v = sparc_lance_init(sdev->child,
-							  0, sdev)))
+							  NULL, sdev)))
 					return v;
 				continue;
 			}
diff --git a/drivers/net/sunqe.c b/drivers/net/sunqe.c
index 5116b5152..39a4b40b4 100644
--- a/drivers/net/sunqe.c
+++ b/drivers/net/sunqe.c
@@ -981,7 +981,7 @@ static int __init qec_probe(void)
 {
 	struct net_device *dev = NULL;
 	struct sbus_bus *bus;
-	struct sbus_dev *sdev = 0;
+	struct sbus_dev *sdev = NULL;
 	static int called;
 	int cards = 0, v;
 
diff --git a/drivers/net/tc35815.c b/drivers/net/tc35815.c
index cd494d3d1..952ef8177 100644
--- a/drivers/net/tc35815.c
+++ b/drivers/net/tc35815.c
@@ -1717,7 +1717,7 @@ tc35815_killall(void)
 }
 
 static struct pci_driver tc35815_driver = {
-	.name =TC35815_MODULE_NAME,
+	.name = TC35815_MODULE_NAME,
 	.probe = tc35815_probe,
 	.remove = NULL,
 	.id_table = tc35815_pci_tbl,
diff --git a/drivers/net/tg3.c b/drivers/net/tg3.c
index 6b2a16825..0e4615472 100644
--- a/drivers/net/tg3.c
+++ b/drivers/net/tg3.c
@@ -1,8 +1,9 @@
 /*
  * tg3.c: Broadcom Tigon3 ethernet driver.
  *
- * Copyright (C) 2001, 2002, 2003 David S. Miller (davem@redhat.com)
+ * Copyright (C) 2001, 2002, 2003, 2004 David S. Miller (davem@redhat.com)
  * Copyright (C) 2001, 2002, 2003 Jeff Garzik (jgarzik@pobox.com)
+ * Copyright (C) 2004 Sun Microsystems Inc.
  */
 
 #include <linux/config.h>
@@ -56,8 +57,8 @@
 
 #define DRV_MODULE_NAME		"tg3"
 #define PFX DRV_MODULE_NAME	": "
-#define DRV_MODULE_VERSION	"3.6"
-#define DRV_MODULE_RELDATE	"June 12, 2004"
+#define DRV_MODULE_VERSION	"3.8"
+#define DRV_MODULE_RELDATE	"July 14, 2004"
 
 #define TG3_DEF_MAC_MODE	0
 #define TG3_DEF_RX_MODE		0
@@ -1961,6 +1962,67 @@ static int tg3_fiber_aneg_smachine(struct tg3 *tp,
 	return ret;
 }
 
+static int fiber_autoneg(struct tg3 *tp, u32 *flags)
+{
+	int res = 0;
+
+	if (tp->tg3_flags2 & TG3_FLG2_HW_AUTONEG) {
+		u32 dig_status;
+
+		dig_status = tr32(SG_DIG_STATUS);
+		*flags = 0;
+		if (dig_status & SG_DIG_PARTNER_ASYM_PAUSE)
+			*flags |= MR_LP_ADV_ASYM_PAUSE;
+		if (dig_status & SG_DIG_PARTNER_PAUSE_CAPABLE)
+			*flags |= MR_LP_ADV_SYM_PAUSE;
+
+		if ((dig_status & SG_DIG_AUTONEG_COMPLETE) &&
+		    !(dig_status & (SG_DIG_AUTONEG_ERROR |
+				    SG_DIG_PARTNER_FAULT_MASK)))
+			res = 1;
+	} else {
+		struct tg3_fiber_aneginfo aninfo;
+		int status = ANEG_FAILED;
+		unsigned int tick;
+		u32 tmp;
+
+		tw32_f(MAC_TX_AUTO_NEG, 0);
+
+		tmp = tp->mac_mode & ~MAC_MODE_PORT_MODE_MASK;
+		tw32_f(MAC_MODE, tmp | MAC_MODE_PORT_MODE_GMII);
+		udelay(40);
+
+		tw32_f(MAC_MODE, tp->mac_mode | MAC_MODE_SEND_CONFIGS);
+		udelay(40);
+
+		memset(&aninfo, 0, sizeof(aninfo));
+		aninfo.flags |= MR_AN_ENABLE;
+		aninfo.state = ANEG_STATE_UNKNOWN;
+		aninfo.cur_time = 0;
+		tick = 0;
+		while (++tick < 195000) {
+			status = tg3_fiber_aneg_smachine(tp, &aninfo);
+			if (status == ANEG_DONE || status == ANEG_FAILED)
+				break;
+
+			udelay(1);
+		}
+
+		tp->mac_mode &= ~MAC_MODE_SEND_CONFIGS;
+		tw32_f(MAC_MODE, tp->mac_mode);
+		udelay(40);
+
+		*flags = aninfo.flags;
+
+		if (status == ANEG_DONE &&
+		    (aninfo.flags & (MR_AN_COMPLETE | MR_LINK_OK |
+				     MR_LP_ADV_FULL_DUPLEX)))
+			res = 1;
+	}
+
+	return res;
+}
+
 static int tg3_setup_fiber_phy(struct tg3 *tp, int force_reset)
 {
 	u32 orig_pause_cfg;
@@ -1980,6 +2042,20 @@ static int tg3_setup_fiber_phy(struct tg3 *tp, int force_reset)
 	tw32_f(MAC_MODE, tp->mac_mode);
 	udelay(40);
 
+	if (tp->tg3_flags2 & TG3_FLG2_HW_AUTONEG) {
+		/* Allow time for the hardware to auto-negotiate (195ms) */
+		unsigned int tick = 0;
+
+		while (++tick < 195000) { 
+			if (tr32(SG_DIG_STATUS) & SG_DIG_AUTONEG_COMPLETE)
+				break;
+			udelay(1);
+		}
+		if (tick >= 195000)
+			printk(KERN_INFO PFX "%s: HW autoneg failed !\n",
+			    tp->dev->name);
+	}
+
 	/* Reset when initting first time or we have a link. */
 	if (!(tp->tg3_flags & TG3_FLAG_INIT_COMPLETE) ||
 	    (tr32(MAC_STATUS) & MAC_STATUS_PCS_SYNCED)) {
@@ -2031,53 +2107,18 @@ static int tg3_setup_fiber_phy(struct tg3 *tp, int force_reset)
 	udelay(40);
 
 	current_link_up = 0;
-	if (tr32(MAC_STATUS) & MAC_STATUS_PCS_SYNCED) {
-		if (tp->link_config.autoneg == AUTONEG_ENABLE &&
-		    !(tp->tg3_flags & TG3_FLAG_GOT_SERDES_FLOWCTL)) {
-			struct tg3_fiber_aneginfo aninfo;
-			int status = ANEG_FAILED;
-			unsigned int tick;
-			u32 tmp;
-
-			memset(&aninfo, 0, sizeof(aninfo));
-			aninfo.flags |= (MR_AN_ENABLE);
-
-			tw32(MAC_TX_AUTO_NEG, 0);
-
-			tmp = tp->mac_mode & ~MAC_MODE_PORT_MODE_MASK;
-			tw32_f(MAC_MODE, tmp | MAC_MODE_PORT_MODE_GMII);
-			udelay(40);
-
-			tw32_f(MAC_MODE, tp->mac_mode | MAC_MODE_SEND_CONFIGS);
-			udelay(40);
-
-			aninfo.state = ANEG_STATE_UNKNOWN;
-			aninfo.cur_time = 0;
-			tick = 0;
-			while (++tick < 195000) {
-				status = tg3_fiber_aneg_smachine(tp, &aninfo);
-				if (status == ANEG_DONE ||
-				    status == ANEG_FAILED)
-					break;
-
-				udelay(1);
-			}
-
-			tp->mac_mode &= ~MAC_MODE_SEND_CONFIGS;
-			tw32_f(MAC_MODE, tp->mac_mode);
-			udelay(40);
-
-			if (status == ANEG_DONE &&
-			    (aninfo.flags &
-			     (MR_AN_COMPLETE | MR_LINK_OK |
-			      MR_LP_ADV_FULL_DUPLEX))) {
+ 	if (tr32(MAC_STATUS) & MAC_STATUS_PCS_SYNCED) {
+		if (tp->link_config.autoneg == AUTONEG_ENABLE) {
+			u32 flags;
+  
+			if (fiber_autoneg(tp, &flags)) {
 				u32 local_adv, remote_adv;
 
 				local_adv = ADVERTISE_PAUSE_CAP;
 				remote_adv = 0;
-				if (aninfo.flags & MR_LP_ADV_SYM_PAUSE)
-					remote_adv |= LPA_PAUSE_CAP;
-				if (aninfo.flags & MR_LP_ADV_ASYM_PAUSE)
+				if (flags & MR_LP_ADV_SYM_PAUSE)
+  					remote_adv |= LPA_PAUSE_CAP;
+				if (flags & MR_LP_ADV_ASYM_PAUSE)
 					remote_adv |= LPA_PAUSE_ASYM;
 
 				tg3_setup_flow_control(tp, local_adv, remote_adv);
@@ -2104,8 +2145,10 @@ static int tg3_setup_fiber_phy(struct tg3 *tp, int force_reset)
 		} else {
 			/* Forcing 1000FD link up. */
 			current_link_up = 1;
+			tp->tg3_flags |= TG3_FLAG_GOT_SERDES_FLOWCTL;
 		}
-	}
+	} else
+		tp->tg3_flags &= ~TG3_FLAG_GOT_SERDES_FLOWCTL;
 
 	tp->mac_mode &= ~MAC_MODE_LINK_POLARITY;
 	tw32_f(MAC_MODE, tp->mac_mode);
@@ -2412,6 +2455,11 @@ static int tg3_rx(struct tg3 *tp, int budget)
 	int received;
 
 	hw_idx = tp->hw_status->idx[0].rx_producer;
+	/*
+	 * We need to order the read of hw_idx and the read of
+	 * the opaque cookie.
+	 */
+	rmb();
 	sw_idx = rx_rcb_ptr % TG3_RX_RCB_RING_SIZE(tp);
 	work_mask = 0;
 	received = 0;
@@ -2811,11 +2859,10 @@ static inline int tg3_4g_overflow_test(dma_addr_t mapping, int len)
 	u32 base = (u32) mapping & 0xffffffff;
 
 	return ((base > 0xffffdcc0) &&
-		((u64) mapping >> 32) == 0 &&
 		(base + len + 8 < base));
 }
 
-static int tg3_start_xmit_4gbug(struct sk_buff *skb, struct net_device *dev)
+static int tg3_start_xmit(struct sk_buff *skb, struct net_device *dev)
 {
 	struct tg3 *tp = netdev_priv(dev);
 	dma_addr_t mapping;
@@ -3019,165 +3066,6 @@ out_unlock:
 	return 0;
 }
 
-static int tg3_start_xmit(struct sk_buff *skb, struct net_device *dev)
-{
-	struct tg3 *tp = netdev_priv(dev);
-	dma_addr_t mapping;
-	u32 len, entry, base_flags, mss;
-	unsigned long flags;
-
-	len = skb_headlen(skb);
-
-	/* No BH disabling for tx_lock here.  We are running in BH disabled
-	 * context and TX reclaim runs via tp->poll inside of a software
-	 * interrupt.  Rejoice!
-	 *
-	 * Actually, things are not so simple.  If we are to take a hw
-	 * IRQ here, we can deadlock, consider:
-	 *
-	 *       CPU1		CPU2
-	 *   tg3_start_xmit
-	 *   take tp->tx_lock
-	 *			tg3_timer
-	 *			take tp->lock
-	 *   tg3_interrupt
-	 *   spin on tp->lock
-	 *			spin on tp->tx_lock
-	 *
-	 * So we really do need to disable interrupts when taking
-	 * tx_lock here.
-	 */
-	spin_lock_irqsave(&tp->tx_lock, flags);
-
-	/* This is a hard error, log it. */
-	if (unlikely(TX_BUFFS_AVAIL(tp) <= (skb_shinfo(skb)->nr_frags + 1))) {
-		netif_stop_queue(dev);
-		spin_unlock_irqrestore(&tp->tx_lock, flags);
-		printk(KERN_ERR PFX "%s: BUG! Tx Ring full when queue awake!\n",
-		       dev->name);
-		return 1;
-	}
-
-	entry = tp->tx_prod;
-	base_flags = 0;
-	if (skb->ip_summed == CHECKSUM_HW)
-		base_flags |= TXD_FLAG_TCPUDP_CSUM;
-#if TG3_TSO_SUPPORT != 0
-	mss = 0;
-	if (skb->len > (tp->dev->mtu + ETH_HLEN) &&
-	    (mss = skb_shinfo(skb)->tso_size) != 0) {
-		int tcp_opt_len, ip_tcp_len;
-
-		tcp_opt_len = ((skb->h.th->doff - 5) * 4);
-		ip_tcp_len = (skb->nh.iph->ihl * 4) + sizeof(struct tcphdr);
-
-		base_flags |= (TXD_FLAG_CPU_PRE_DMA |
-			       TXD_FLAG_CPU_POST_DMA);
-
-		skb->nh.iph->check = 0;
-		skb->nh.iph->tot_len = ntohs(mss + ip_tcp_len + tcp_opt_len);
-		skb->h.th->check = ~csum_tcpudp_magic(skb->nh.iph->saddr,
-						      skb->nh.iph->daddr,
-						      0, IPPROTO_TCP, 0);
-
-		if (GET_ASIC_REV(tp->pci_chip_rev_id) == ASIC_REV_5705) {
-			if (tcp_opt_len || skb->nh.iph->ihl > 5) {
-				int tsflags;
-
-				tsflags = ((skb->nh.iph->ihl - 5) +
-					   (tcp_opt_len >> 2));
-				mss |= (tsflags << 11);
-			}
-		} else {
-			if (tcp_opt_len || skb->nh.iph->ihl > 5) {
-				int tsflags;
-
-				tsflags = ((skb->nh.iph->ihl - 5) +
-					   (tcp_opt_len >> 2));
-				base_flags |= tsflags << 12;
-			}
-		}
-	}
-#else
-	mss = 0;
-#endif
-#if TG3_VLAN_TAG_USED
-	if (tp->vlgrp != NULL && vlan_tx_tag_present(skb))
-		base_flags |= (TXD_FLAG_VLAN |
-			       (vlan_tx_tag_get(skb) << 16));
-#endif
-
-	/* Queue skb data, a.k.a. the main skb fragment. */
-	mapping = pci_map_single(tp->pdev, skb->data, len, PCI_DMA_TODEVICE);
-
-	tp->tx_buffers[entry].skb = skb;
-	pci_unmap_addr_set(&tp->tx_buffers[entry], mapping, mapping);
-
-	tg3_set_txd(tp, entry, mapping, len, base_flags,
-		    (skb_shinfo(skb)->nr_frags == 0) | (mss << 1));
-
-	entry = NEXT_TX(entry);
-
-	/* Now loop through additional data fragments, and queue them. */
-	if (skb_shinfo(skb)->nr_frags > 0) {
-		unsigned int i, last;
-
-		last = skb_shinfo(skb)->nr_frags - 1;
-		for (i = 0; i <= last; i++) {
-			skb_frag_t *frag = &skb_shinfo(skb)->frags[i];
-
-
-			len = frag->size;
-			mapping = pci_map_page(tp->pdev,
-					       frag->page,
-					       frag->page_offset,
-					       len, PCI_DMA_TODEVICE);
-
-			tp->tx_buffers[entry].skb = NULL;
-			pci_unmap_addr_set(&tp->tx_buffers[entry], mapping, mapping);
-
-			if (GET_ASIC_REV(tp->pci_chip_rev_id) == ASIC_REV_5750)
-				tg3_set_txd(tp, entry, mapping, len,
-					    base_flags, (i == last)|(mss << 1));
-			else
-				tg3_set_txd(tp, entry, mapping, len,
-					    base_flags, (i == last));
-
-			entry = NEXT_TX(entry);
-		}
-	}
-
-	/* Packets are ready, update Tx producer idx local and on card.
-	 * We know this is not a 5700 (by virtue of not being a chip
-	 * requiring the 4GB overflow workaround) so we can safely omit
-	 * the double-write bug tests.
-	 */
-	if (tp->tg3_flags & TG3_FLAG_HOST_TXDS) {
-		tw32_tx_mbox((MAILBOX_SNDHOST_PROD_IDX_0 +
-			      TG3_64BIT_REG_LOW), entry);
-	} else {
-		/* First, make sure tg3 sees last descriptor fully
-		 * in SRAM.
-		 */
-		if (tp->tg3_flags & TG3_FLAG_MBOX_WRITE_REORDER)
-			tr32(MAILBOX_SNDNIC_PROD_IDX_0 +
-			     TG3_64BIT_REG_LOW);
-
-		tw32_tx_mbox((MAILBOX_SNDNIC_PROD_IDX_0 +
-			      TG3_64BIT_REG_LOW), entry);
-	}
-
-	tp->tx_prod = entry;
-	if (TX_BUFFS_AVAIL(tp) <= (MAX_SKB_FRAGS + 1))
-		netif_stop_queue(dev);
-
-	spin_unlock_irqrestore(&tp->tx_lock, flags);
-
-	dev->trans_start = jiffies;
-
-	return 0;
-}
-
 static inline void tg3_set_mtu(struct net_device *dev, struct tg3 *tp,
 			       int new_mtu)
 {
@@ -3747,9 +3635,25 @@ static int tg3_chip_reset(struct tg3 *tp)
 	/* restore 5701 hardware bug workaround flag */
 	tp->tg3_flags = flags_save;
 
+	/* Unfortunately, we have to delay before the PCI read back.
+	 * Some 575X chips even will not respond to a PCI cfg access
+	 * when the reset command is given to the chip.
+	 *
+	 * How do these hardware designers expect things to work
+	 * properly if the PCI write is posted for a long period
+	 * of time?  It is always necessary to have some method by
+	 * which a register read back can occur to push the write
+	 * out which does the reset.
+	 *
+	 * For most tg3 variants the trick below was working.
+	 * Ho hum...
+	 */
+	udelay(120);
+
 	/* Flush PCI posted writes.  The normal MMIO registers
 	 * are inaccessible at this time so this is the only
-	 * way to make this reliably.  I tried to use indirect
+	 * way to make this reliably (actually, this is no longer
+	 * the case, see above).  I tried to use indirect
 	 * register read/write but this upset some 5701 variants.
 	 */
 	pci_read_config_dword(tp->pdev, PCI_COMMAND, &val);
@@ -5363,6 +5267,26 @@ static int tg3_reset_hw(struct tg3 *tp)
 	 */
 	tw32_f(MAC_LOW_WMARK_MAX_RX_FRAME, 2);
 
+	if (GET_ASIC_REV(tp->pci_chip_rev_id) == ASIC_REV_5704 &&
+	    tp->phy_id == PHY_ID_SERDES) {
+		/* Enable hardware link auto-negotiation */
+		u32 digctrl, txctrl;
+
+		digctrl = SG_DIG_USING_HW_AUTONEG | SG_DIG_CRC16_CLEAR_N |
+		    SG_DIG_LOCAL_DUPLEX_STATUS | SG_DIG_LOCAL_LINK_STATUS |
+		    (2 << SG_DIG_SPEED_STATUS_SHIFT) | SG_DIG_FIBER_MODE |
+		    SG_DIG_GBIC_ENABLE;
+
+		txctrl = tr32(MAC_SERDES_CFG);
+		tw32_f(MAC_SERDES_CFG, txctrl | MAC_SERDES_CFG_EDGE_SELECT);
+		tw32_f(SG_DIG_CTRL, digctrl | SG_DIG_SOFT_RESET);
+		tr32(SG_DIG_CTRL);
+		udelay(5);
+		tw32_f(SG_DIG_CTRL, digctrl);
+
+		tp->tg3_flags2 |= TG3_FLG2_HW_AUTONEG;
+	}
+
 	err = tg3_setup_phy(tp, 1);
 	if (err)
 		return err;
@@ -6696,6 +6620,9 @@ static int tg3_ioctl(struct net_device *dev, struct ifreq *ifr, int cmd)
 	case SIOCGMIIREG: {
 		u32 mii_regval;
 
+		if (tp->phy_id == PHY_ID_SERDES)
+			break;			/* We have no PHY */
+
 		spin_lock_irq(&tp->lock);
 		err = tg3_readphy(tp, data->reg_num & 0x1f, &mii_regval);
 		spin_unlock_irq(&tp->lock);
@@ -6706,6 +6633,9 @@ static int tg3_ioctl(struct net_device *dev, struct ifreq *ifr, int cmd)
 	}
 
 	case SIOCSMIIREG:
+		if (tp->phy_id == PHY_ID_SERDES)
+			break;			/* We have no PHY */
+
 		if (!capable(CAP_NET_ADMIN))
 			return -EPERM;
 
@@ -7636,13 +7566,10 @@ static int __devinit tg3_get_invariants(struct tg3 *tp)
 	else
 		tp->tg3_flags &= ~TG3_FLAG_TXD_MBOX_HWBUG;
 
-	/* 5700 chips can get confused if TX buffers straddle the
-	 * 4GB address boundary in some cases.
+	/* It seems all chips can get confused if TX buffers
+	 * straddle the 4GB address boundary in some cases.
 	 */
-	if (GET_ASIC_REV(tp->pci_chip_rev_id) == ASIC_REV_5700)
-		tp->dev->hard_start_xmit = tg3_start_xmit_4gbug;
-	else
-		tp->dev->hard_start_xmit = tg3_start_xmit;
+	tp->dev->hard_start_xmit = tg3_start_xmit;
 
 	tp->rx_offset = 2;
 	if (GET_ASIC_REV(tp->pci_chip_rev_id) == ASIC_REV_5701 &&
diff --git a/drivers/net/tg3.h b/drivers/net/tg3.h
index fabc65f7a..5c0c104f4 100644
--- a/drivers/net/tg3.h
+++ b/drivers/net/tg3.h
@@ -1,8 +1,9 @@
 /* $Id: tg3.h,v 1.37.2.32 2002/03/11 12:18:18 davem Exp $
  * tg3.h: Definitions for Broadcom Tigon3 ethernet driver.
  *
- * Copyright (C) 2001, 2002 David S. Miller (davem@redhat.com)
+ * Copyright (C) 2001, 2002, 2003, 2004 David S. Miller (davem@redhat.com)
  * Copyright (C) 2001 Jeff Garzik (jgarzik@pobox.com)
+ * Copyright (C) 2004 Sun Microsystems Inc.
  */
 
 #ifndef _T3_H
@@ -116,6 +117,7 @@
 #define  CHIPREV_ID_5704_A0		 0x2000
 #define  CHIPREV_ID_5704_A1		 0x2001
 #define  CHIPREV_ID_5704_A2		 0x2002
+#define  CHIPREV_ID_5704_A3		 0x2003
 #define  CHIPREV_ID_5705_A0		 0x3000
 #define  CHIPREV_ID_5705_A1		 0x3001
 #define  CHIPREV_ID_5705_A2		 0x3002
@@ -518,8 +520,50 @@
 #define MAC_EXTADDR_11_HIGH		0x00000588
 #define MAC_EXTADDR_11_LOW		0x0000058c
 #define MAC_SERDES_CFG			0x00000590
+#define  MAC_SERDES_CFG_EDGE_SELECT	 0x00001000
 #define MAC_SERDES_STAT			0x00000594
-/* 0x598 --> 0x600 unused */
+/* 0x598 --> 0x5b0 unused */
+#define SG_DIG_CTRL			0x000005b0
+#define  SG_DIG_USING_HW_AUTONEG	 0x80000000
+#define  SG_DIG_SOFT_RESET		 0x40000000
+#define  SG_DIG_DISABLE_LINKRDY		 0x20000000
+#define  SG_DIG_CRC16_CLEAR_N		 0x01000000
+#define  SG_DIG_EN10B			 0x00800000
+#define  SG_DIG_CLEAR_STATUS		 0x00400000
+#define  SG_DIG_LOCAL_DUPLEX_STATUS	 0x00200000
+#define  SG_DIG_LOCAL_LINK_STATUS	 0x00100000
+#define  SG_DIG_SPEED_STATUS_MASK	 0x000c0000
+#define  SG_DIG_SPEED_STATUS_SHIFT	 18
+#define  SG_DIG_JUMBO_PACKET_DISABLE	 0x00020000
+#define  SG_DIG_RESTART_AUTONEG		 0x00010000
+#define  SG_DIG_FIBER_MODE		 0x00008000
+#define  SG_DIG_REMOTE_FAULT_MASK	 0x00006000
+#define  SG_DIG_PAUSE_MASK		 0x00001800
+#define  SG_DIG_GBIC_ENABLE		 0x00000400
+#define  SG_DIG_CHECK_END_ENABLE	 0x00000200
+#define  SG_DIG_SGMII_AUTONEG_TIMER	 0x00000100
+#define  SG_DIG_CLOCK_PHASE_SELECT	 0x00000080
+#define  SG_DIG_GMII_INPUT_SELECT	 0x00000040
+#define  SG_DIG_MRADV_CRC16_SELECT	 0x00000020
+#define  SG_DIG_COMMA_DETECT_ENABLE	 0x00000010
+#define  SG_DIG_AUTONEG_TIMER_REDUCE	 0x00000008
+#define  SG_DIG_AUTONEG_LOW_ENABLE	 0x00000004
+#define  SG_DIG_REMOTE_LOOPBACK		 0x00000002
+#define  SG_DIG_LOOPBACK		 0x00000001
+#define SG_DIG_STATUS			0x000005b4
+#define  SG_DIG_CRC16_BUS_MASK		 0xffff0000
+#define  SG_DIG_PARTNER_FAULT_MASK	 0x00600000 /* If !MRADV_CRC16_SELECT */
+#define  SG_DIG_PARTNER_ASYM_PAUSE	 0x00100000 /* If !MRADV_CRC16_SELECT */
+#define  SG_DIG_PARTNER_PAUSE_CAPABLE	 0x00080000 /* If !MRADV_CRC16_SELECT */
+#define  SG_DIG_PARTNER_HALF_DUPLEX	 0x00040000 /* If !MRADV_CRC16_SELECT */
+#define  SG_DIG_PARTNER_FULL_DUPLEX	 0x00020000 /* If !MRADV_CRC16_SELECT */
+#define  SG_DIG_PARTNER_NEXT_PAGE	 0x00010000 /* If !MRADV_CRC16_SELECT */
+#define  SG_DIG_AUTONEG_STATE_MASK	 0x00000ff0
+#define  SG_DIG_COMMA_DETECTOR		 0x00000008
+#define  SG_DIG_MAC_ACK_STATUS		 0x00000004
+#define  SG_DIG_AUTONEG_COMPLETE	 0x00000002
+#define  SG_DIG_AUTONEG_ERROR		 0x00000001
+/* 0x5b8 --> 0x600 unused */
 #define MAC_TX_MAC_STATE_BASE		0x00000600 /* 16 bytes */
 #define MAC_RX_MAC_STATE_BASE		0x00000610 /* 20 bytes */
 /* 0x624 --> 0x800 unused */
@@ -2044,6 +2088,7 @@ struct tg3 {
 #define TG3_FLG2_PHY_BER_BUG		0x00000100
 #define TG3_FLG2_PCI_EXPRESS		0x00000200
 #define TG3_FLG2_ASF_NEW_HANDSHAKE	0x00000400
+#define TG3_FLG2_HW_AUTONEG		0x00000800
 
 	u32				split_mode_max_reqs;
 #define SPLIT_MODE_5704_MAX_REQ		3
diff --git a/drivers/net/tlan.c b/drivers/net/tlan.c
index 4c57ab290..645433109 100644
--- a/drivers/net/tlan.c
+++ b/drivers/net/tlan.c
@@ -212,7 +212,7 @@ MODULE_PARM_DESC(bbuf, "ThunderLAN use big buffer (0-1)");
 /* Define this to enable Link beat monitoring */
 #undef MONITOR
 
-/* Turn on debugging. See linux/Documentation/networking/tlan.txt for details */
+/* Turn on debugging. See Documentation/networking/tlan.txt for details */
 static  int		debug;
 
 static	int		bbuf;
@@ -225,7 +225,7 @@ static  int tlan_have_eisa;
 
 const char *media[] = {
 	"10BaseT-HD ", "10BaseT-FD ","100baseTx-HD ", 
-	"100baseTx-FD", "100baseT4", 0
+	"100baseTx-FD", "100baseT4", NULL
 };
 
 int media_map[] = { 0x0020, 0x0040, 0x0080, 0x0100, 0x0200,};
diff --git a/drivers/net/tokenring/Kconfig b/drivers/net/tokenring/Kconfig
index 90cd1f285..f34e40e8f 100644
--- a/drivers/net/tokenring/Kconfig
+++ b/drivers/net/tokenring/Kconfig
@@ -54,7 +54,7 @@ config IBMOL
 
 config IBMLS
 	tristate "IBM Lanstreamer chipset PCI adapter support"
-	depends on TR && PCI
+	depends on TR && PCI && !64BIT
 	help
 	  This is support for IBM Lanstreamer PCI Token Ring Cards.
 
@@ -157,7 +157,7 @@ config ABYSS
 
 config MADGEMC
 	tristate "Madge Smart 16/4 Ringnode MicroChannel"
-	depends on TR && TMS380TR && MCA
+	depends on TR && TMS380TR && MCA_LEGACY
 	help
 	  This tms380 module supports the Madge Smart 16/4 MC16 and MC32
 	  MicroChannel adapters.
@@ -167,7 +167,7 @@ config MADGEMC
 
 config SMCTR
 	tristate "SMC ISA/MCA adapter support"
-	depends on TR && (ISA || MCA)
+	depends on TR && (ISA || MCA_LEGACY) && (BROKEN || !64BIT)
 	---help---
 	  This is support for the ISA and MCA SMC Token Ring cards,
 	  specifically SMC TokenCard Elite (8115T) and SMC TokenCard Elite/A
diff --git a/drivers/net/tokenring/ibmtr.c b/drivers/net/tokenring/ibmtr.c
index 10fa8e79d..69e9246d8 100644
--- a/drivers/net/tokenring/ibmtr.c
+++ b/drivers/net/tokenring/ibmtr.c
@@ -127,6 +127,7 @@ in the event that chatty debug messages are desired - jjs 12/30/98 */
 
 #include <linux/ioport.h>
 #include <linux/netdevice.h>
+#include <linux/ip.h>
 #include <linux/trdevice.h>
 #include <linux/ibmtr.h>
 
@@ -382,7 +383,7 @@ static int __devinit ibmtr_probe1(struct net_device *dev, int PIOaddr)
 {
 
 	unsigned char segment, intr=0, irq=0, i, j, cardpresent=NOTOK, temp=0;
-	void * t_mmio = 0;
+	void * t_mmio = NULL;
 	struct tok_info *ti = dev->priv;
 	void *cd_chanid;
 	unsigned char *tchanid, ctemp;
diff --git a/drivers/net/tokenring/lanstreamer.c b/drivers/net/tokenring/lanstreamer.c
index 3eee45440..dcf7f3e8c 100644
--- a/drivers/net/tokenring/lanstreamer.c
+++ b/drivers/net/tokenring/lanstreamer.c
@@ -129,6 +129,11 @@
 
 #include "lanstreamer.h"
 
+#if (BITS_PER_LONG == 64)
+#error broken on 64-bit: stores pointer to rx_ring->buffer in 32-bit int
+#endif
+
+
 /* I've got to put some intelligence into the version number so that Peter and I know
  * which version of the code somebody has got. 
  * Version Number = a.b.c.d  where a.b.c is the level of code and d is the latest author.
@@ -441,7 +446,7 @@ static int streamer_reset(struct net_device *dev)
 	__u8 *streamer_mmio;
 	unsigned long t;
 	unsigned int uaa_addr;
-	struct sk_buff *skb = 0;
+	struct sk_buff *skb = NULL;
 	__u16 misr;
 
 	streamer_priv = (struct streamer_private *) dev->priv;
diff --git a/drivers/net/tokenring/olympic.c b/drivers/net/tokenring/olympic.c
index e8ff967b6..ea82d131a 100644
--- a/drivers/net/tokenring/olympic.c
+++ b/drivers/net/tokenring/olympic.c
@@ -268,7 +268,7 @@ static int __devinit olympic_probe(struct pci_dev *pdev, const struct pci_device
 		char proc_name[20] ; 
 		strcpy(proc_name,"net/olympic_") ; 
 		strcat(proc_name,dev->name) ; 
-		create_proc_read_entry(proc_name,0,0,olympic_proc_info,(void *)dev) ; 
+		create_proc_read_entry(proc_name,0,NULL,olympic_proc_info,(void *)dev) ; 
 		printk("Olympic: Network Monitor information: /proc/%s\n",proc_name); 
 	}
 	return  0 ;
diff --git a/drivers/net/tokenring/smctr.c b/drivers/net/tokenring/smctr.c
index a39d7ee4f..599057ac3 100644
--- a/drivers/net/tokenring/smctr.c
+++ b/drivers/net/tokenring/smctr.c
@@ -69,7 +69,7 @@ static const char cardname[] = "smctr";
 
 #define SMCTR_IO_EXTENT   20
 
-#ifdef CONFIG_MCA
+#ifdef CONFIG_MCA_LEGACY
 static unsigned int smctr_posid = 0x6ec6;
 #endif
 
@@ -479,7 +479,7 @@ static int smctr_checksum_firmware(struct net_device *dev)
 
 static int __init smctr_chk_mca(struct net_device *dev)
 {
-#ifdef CONFIG_MCA
+#ifdef CONFIG_MCA_LEGACY
 	struct net_local *tp = netdev_priv(dev);
 	int current_slot;
 	__u8 r1, r2, r3, r4, r5;
@@ -626,7 +626,7 @@ static int __init smctr_chk_mca(struct net_device *dev)
 	return (0);
 #else
 	return (-1);
-#endif /* CONFIG_MCA */
+#endif /* CONFIG_MCA_LEGACY */
 }
 
 static int smctr_chg_rx_mask(struct net_device *dev)
@@ -3617,7 +3617,7 @@ struct net_device __init *smctr_probe(int unit)
 		goto out1;
 	return dev;
 out1:
-#ifdef CONFIG_MCA
+#ifdef CONFIG_MCA_LEGACY
 	{ struct net_local *tp = netdev_priv(dev);
 	  if (tp->slot_num)
 		mca_mark_as_unused(tp->slot_num);
@@ -4939,7 +4939,7 @@ static int smctr_send_rq_init(struct net_device *dev)
                 tmf->dc_sc = DC_RPS | SC_RS;
                 tmf->vl    = 4;
 
-                smctr_make_8025_hdr(dev, 0L, tmf, AC_FC_RQ_INIT);
+                smctr_make_8025_hdr(dev, NULL, tmf, AC_FC_RQ_INIT);
 
                 tsv = (MAC_SUB_VECTOR *)((__u32)tmf + sizeof(MAC_HEADER));
                 smctr_make_product_id(dev, tsv);
@@ -5685,7 +5685,7 @@ static struct net_device *setup_card(int n)
 		goto out1;
 	return dev;
  out1:
-#ifdef CONFIG_MCA
+#ifdef CONFIG_MCA_LEGACY
 	{ struct net_local *tp = netdev_priv(dev);
 	  if (tp->slot_num)
 		mca_mark_as_unused(tp->slot_num);
@@ -5725,7 +5725,7 @@ void cleanup_module(void)
 		if (dev) {
 
 			unregister_netdev(dev);
-#ifdef CONFIG_MCA
+#ifdef CONFIG_MCA_LEGACY
 			{ struct net_local *tp = netdev_priv(dev);
 			if (tp->slot_num)
 				mca_mark_as_unused(tp->slot_num);
diff --git a/drivers/net/tokenring/tms380tr.c b/drivers/net/tokenring/tms380tr.c
index afd1dc2a6..9d121890b 100644
--- a/drivers/net/tokenring/tms380tr.c
+++ b/drivers/net/tokenring/tms380tr.c
@@ -252,6 +252,7 @@ int tms380tr_open(struct net_device *dev)
 
 	/* Reset the hardware here. Don't forget to set the station address. */
 
+#ifdef CONFIG_ISA
 	if(dev->dma > 0) 
 	{
 		unsigned long flags=claim_dma_lock();
@@ -260,6 +261,7 @@ int tms380tr_open(struct net_device *dev)
 		enable_dma(dev->dma);
 		release_dma_lock(flags);
 	}
+#endif
 	
 	err = tms380tr_chipset_init(dev);
   	if(err)
@@ -1149,12 +1151,14 @@ int tms380tr_close(struct net_device *dev)
 	del_timer(&tp->timer);
 	tms380tr_disable_interrupts(dev);
    
+#ifdef CONFIG_ISA
 	if(dev->dma > 0) 
 	{
 		unsigned long flags=claim_dma_lock();
 		disable_dma(dev->dma);
 		release_dma_lock(flags);
 	}
+#endif
 	
 	SIFWRITEW(0xFF00, SIFCMD);
 #if 0
diff --git a/drivers/net/tulip/Kconfig b/drivers/net/tulip/Kconfig
index 02bc6d39b..6182cf4e3 100644
--- a/drivers/net/tulip/Kconfig
+++ b/drivers/net/tulip/Kconfig
@@ -71,10 +71,17 @@ config TULIP_MMIO
 config TULIP_NAPI
 	bool "Use NAPI RX polling "
 	depends on TULIP
-	---help---
-	  This is of useful for servers and routers dealing with high network loads.
- 
-	  See <file:Documentation/networking/NAPI_HOWTO.txt>.
+	help
+	  NAPI is a new driver API designed to reduce CPU and interrupt load
+	  when the driver is receiving lots of packets from the card. It is
+	  still somewhat experimental and thus not yet enabled by default.
+
+	  If your estimated Rx load is 10kpps or more, or if the card will be
+	  deployed on potentially unfriendly networks (e.g. in a firewall),
+	  then say Y here.
+
+	  See <file:Documentation/networking/NAPI_HOWTO.txt> for more
+	  information.
 
 	  If in doubt, say N.
 
diff --git a/drivers/net/tulip/de4x5.c b/drivers/net/tulip/de4x5.c
index d59d46ecd..962138008 100644
--- a/drivers/net/tulip/de4x5.c
+++ b/drivers/net/tulip/de4x5.c
@@ -4721,8 +4721,8 @@ type1_infoblock(struct net_device *dev, u_char count, u_char *p)
     if (lp->state == INITIALISED) {
         lp->ibn = 1;
 	lp->active = *p++;
-	lp->phy[lp->active].gep = (*p ? p : 0); p += (*p + 1);
-	lp->phy[lp->active].rst = (*p ? p : 0); p += (*p + 1);
+	lp->phy[lp->active].gep = (*p ? p : NULL); p += (*p + 1);
+	lp->phy[lp->active].rst = (*p ? p : NULL); p += (*p + 1);
 	lp->phy[lp->active].mc  = TWIDDLE(p); p += 2;
 	lp->phy[lp->active].ana = TWIDDLE(p); p += 2;
 	lp->phy[lp->active].fdx = TWIDDLE(p); p += 2;
@@ -4802,8 +4802,8 @@ type3_infoblock(struct net_device *dev, u_char count, u_char *p)
         lp->ibn = 3;
         lp->active = *p++;
 	if (MOTO_SROM_BUG) lp->active = 0;
-	lp->phy[lp->active].gep = (*p ? p : 0); p += (2 * (*p) + 1);
-	lp->phy[lp->active].rst = (*p ? p : 0); p += (2 * (*p) + 1);
+	lp->phy[lp->active].gep = (*p ? p : NULL); p += (2 * (*p) + 1);
+	lp->phy[lp->active].rst = (*p ? p : NULL); p += (2 * (*p) + 1);
 	lp->phy[lp->active].mc  = TWIDDLE(p); p += 2;
 	lp->phy[lp->active].ana = TWIDDLE(p); p += 2;
 	lp->phy[lp->active].fdx = TWIDDLE(p); p += 2;
diff --git a/drivers/net/tulip/dmfe.c b/drivers/net/tulip/dmfe.c
index 666f926e9..f3298d161 100644
--- a/drivers/net/tulip/dmfe.c
+++ b/drivers/net/tulip/dmfe.c
@@ -1971,7 +1971,6 @@ static struct pci_device_id dmfe_pci_tbl[] = {
 	{ 0x1282, 0x9102, PCI_ANY_ID, PCI_ANY_ID, 0, 0, PCI_DM9102_ID },
 	{ 0x1282, 0x9100, PCI_ANY_ID, PCI_ANY_ID, 0, 0, PCI_DM9100_ID },
 	{ 0x1282, 0x9009, PCI_ANY_ID, PCI_ANY_ID, 0, 0, PCI_DM9009_ID },
-	{ 0x10B9, 0x5261, PCI_ANY_ID, PCI_ANY_ID, 0, 0, PCI_DM9102_ID },
 	{ 0, }
 };
 MODULE_DEVICE_TABLE(pci, dmfe_pci_tbl);
diff --git a/drivers/net/tulip/eeprom.c b/drivers/net/tulip/eeprom.c
index b266bfec3..512debab8 100644
--- a/drivers/net/tulip/eeprom.c
+++ b/drivers/net/tulip/eeprom.c
@@ -62,7 +62,7 @@ static struct eeprom_fixup eeprom_fixups[] __devinitdata = {
 	 */
 	{ 0x1e00, 0x0000, 0x000b, 0x8f01, 0x0103, 0x0300, 0x0821, 0x000, 0x0001, 0x0000, 0x01e1 }
   },
-  {0, 0, 0, 0, {}}};
+  {NULL}};
 
 
 static const char *block_name[] __devinitdata = {
@@ -136,7 +136,7 @@ void __devinit tulip_parse_eeprom(struct net_device *dev)
 	unsigned char *ee_data = tp->eeprom;
 	int i;
 
-	tp->mtable = 0;
+	tp->mtable = NULL;
 	/* Detect an old-style (SA only) EEPROM layout:
 	   memcmp(eedata, eedata+16, 8). */
 	for (i = 0; i < 8; i ++)
diff --git a/drivers/net/tulip/tulip_core.c b/drivers/net/tulip/tulip_core.c
index 498f612cf..cff6f977c 100644
--- a/drivers/net/tulip/tulip_core.c
+++ b/drivers/net/tulip/tulip_core.c
@@ -1535,7 +1535,7 @@ static int __devinit tulip_init_one (struct pci_dev *pdev,
 		}
 	}
 	/* Lite-On boards have the address byte-swapped. */
-	if ((dev->dev_addr[0] == 0xA0  ||  dev->dev_addr[0] == 0xC0)
+	if ((dev->dev_addr[0] == 0xA0  ||  dev->dev_addr[0] == 0xC0 || dev->dev_addr[0] == 0x02)
 		&&  dev->dev_addr[1] == 0x00)
 		for (i = 0; i < 6; i+=2) {
 			char tmp = dev->dev_addr[i];
diff --git a/drivers/net/tulip/winbond-840.c b/drivers/net/tulip/winbond-840.c
index f5aeb3dda..d3efcadca 100644
--- a/drivers/net/tulip/winbond-840.c
+++ b/drivers/net/tulip/winbond-840.c
@@ -111,15 +111,6 @@ static int full_duplex[MAX_UNITS] = {-1, -1, -1, -1, -1, -1, -1, -1};
 
 #define PKT_BUF_SZ		1536			/* Size of each temporary Rx buffer.*/
 
-#ifndef __KERNEL__
-#define __KERNEL__
-#endif
-#if !defined(__OPTIMIZE__)
-#warning  You must compile this file with the correct options!
-#warning  See the last lines of the source file.
-#error You must compile this driver with "-O".
-#endif
-
 /* Include files, designed to support most kernel versions 2.0.0 and later. */
 #include <linux/module.h>
 #include <linux/kernel.h>
@@ -260,7 +251,7 @@ static struct pci_id_info pci_id_tbl[] = {
 	 W840_FLAGS, 128, CanHaveMII | HasBrokenTx},
 	{"Compex RL100-ATX", { 0x201111F6, 0xffffffff,},
 	 W840_FLAGS, 128, CanHaveMII | HasBrokenTx},
-	{0,},						/* 0 terminated list. */
+	{NULL,},					/* 0 terminated list. */
 };
 
 /* This driver was written to use PCI memory space, however some x86 systems
@@ -860,7 +851,7 @@ static void init_rxtx_rings(struct net_device *dev)
 	for (i = 0; i < RX_RING_SIZE; i++) {
 		np->rx_ring[i].length = np->rx_buf_sz;
 		np->rx_ring[i].status = 0;
-		np->rx_skbuff[i] = 0;
+		np->rx_skbuff[i] = NULL;
 	}
 	/* Mark the last entry as wrapping the ring. */
 	np->rx_ring[i-1].length |= DescEndRing;
@@ -884,7 +875,7 @@ static void init_rxtx_rings(struct net_device *dev)
 
 	/* Initialize the Tx descriptors */
 	for (i = 0; i < TX_RING_SIZE; i++) {
-		np->tx_skbuff[i] = 0;
+		np->tx_skbuff[i] = NULL;
 		np->tx_ring[i].status = 0;
 	}
 	np->tx_full = 0;
@@ -909,7 +900,7 @@ static void free_rxtx_rings(struct netdev_private* np)
 						PCI_DMA_FROMDEVICE);
 			dev_kfree_skb(np->rx_skbuff[i]);
 		}
-		np->rx_skbuff[i] = 0;
+		np->rx_skbuff[i] = NULL;
 	}
 	for (i = 0; i < TX_RING_SIZE; i++) {
 		if (np->tx_skbuff[i]) {
@@ -919,7 +910,7 @@ static void free_rxtx_rings(struct netdev_private* np)
 						PCI_DMA_TODEVICE);
 			dev_kfree_skb(np->tx_skbuff[i]);
 		}
-		np->tx_skbuff[i] = 0;
+		np->tx_skbuff[i] = NULL;
 	}
 }
 
@@ -1154,7 +1145,7 @@ static void netdev_tx_done(struct net_device *dev)
 					PCI_DMA_TODEVICE);
 		np->tx_q_bytes -= np->tx_skbuff[entry]->len;
 		dev_kfree_skb_irq(np->tx_skbuff[entry]);
-		np->tx_skbuff[entry] = 0;
+		np->tx_skbuff[entry] = NULL;
 	}
 	if (np->tx_full &&
 		np->cur_tx - np->dirty_tx < TX_QUEUE_LEN_RESTART &&
@@ -1292,14 +1283,8 @@ static int netdev_rx(struct net_device *dev)
 				pci_dma_sync_single_for_cpu(np->pci_dev,np->rx_addr[entry],
 							    np->rx_skbuff[entry]->len,
 							    PCI_DMA_FROMDEVICE);
-				/* Call copy + cksum if available. */
-#if HAS_IP_COPYSUM
 				eth_copy_and_sum(skb, np->rx_skbuff[entry]->tail, pkt_len, 0);
 				skb_put(skb, pkt_len);
-#else
-				memcpy(skb_put(skb, pkt_len), np->rx_skbuff[entry]->tail,
-					   pkt_len);
-#endif
 				pci_dma_sync_single_for_device(np->pci_dev,np->rx_addr[entry],
 							       np->rx_skbuff[entry]->len,
 							       PCI_DMA_FROMDEVICE);
diff --git a/drivers/net/tulip/xircom_cb.c b/drivers/net/tulip/xircom_cb.c
index c39b3f7d5..6e6589039 100644
--- a/drivers/net/tulip/xircom_cb.c
+++ b/drivers/net/tulip/xircom_cb.c
@@ -337,7 +337,7 @@ static irqreturn_t xircom_interrupt(int irq, void *dev_instance, struct pt_regs
 	spin_lock(&card->lock);
 	status = inl(card->io_port+CSR5);
 
-#if DEBUG	
+#ifdef DEBUG	
 	print_binary(status);
 	printk("tx status 0x%08x 0x%08x \n",card->tx_buffer[0],card->tx_buffer[4]);
 	printk("rx status 0x%08x 0x%08x \n",card->rx_buffer[0],card->rx_buffer[4]);
diff --git a/drivers/net/tulip/xircom_tulip_cb.c b/drivers/net/tulip/xircom_tulip_cb.c
index a01cc1b09..62417cc98 100644
--- a/drivers/net/tulip/xircom_tulip_cb.c
+++ b/drivers/net/tulip/xircom_tulip_cb.c
@@ -756,7 +756,7 @@ xircom_up(struct net_device *dev)
 	xircom_init_ring(dev);
 	/* Clear the tx ring */
 	for (i = 0; i < TX_RING_SIZE; i++) {
-		tp->tx_skbuff[i] = 0;
+		tp->tx_skbuff[i] = NULL;
 		tp->tx_ring[i].status = 0;
 	}
 
@@ -904,7 +904,7 @@ static void xircom_init_ring(struct net_device *dev)
 	/* The Tx buffer descriptor is filled in as needed, but we
 	   do need to clear the ownership bit. */
 	for (i = 0; i < TX_RING_SIZE; i++) {
-		tp->tx_skbuff[i] = 0;
+		tp->tx_skbuff[i] = NULL;
 		tp->tx_ring[i].status = 0;
 		tp->tx_ring[i].buffer2 = virt_to_bus(&tp->tx_ring[i+1]);
 #ifdef CARDBUS
@@ -1128,7 +1128,7 @@ static irqreturn_t xircom_interrupt(int irq, void *dev_instance, struct pt_regs
 
 				/* Free the original skb. */
 				dev_kfree_skb_irq(tp->tx_skbuff[entry]);
-				tp->tx_skbuff[entry] = 0;
+				tp->tx_skbuff[entry] = NULL;
 			}
 
 #ifndef final_version
@@ -1338,7 +1338,7 @@ xircom_close(struct net_device *dev)
 	/* Free all the skbuffs in the Rx queue. */
 	for (i = 0; i < RX_RING_SIZE; i++) {
 		struct sk_buff *skb = tp->rx_skbuff[i];
-		tp->rx_skbuff[i] = 0;
+		tp->rx_skbuff[i] = NULL;
 		tp->rx_ring[i].status = 0;		/* Not owned by Xircom chip. */
 		tp->rx_ring[i].length = 0;
 		tp->rx_ring[i].buffer1 = 0xBADF00D0; /* An invalid address. */
@@ -1349,7 +1349,7 @@ xircom_close(struct net_device *dev)
 	for (i = 0; i < TX_RING_SIZE; i++) {
 		if (tp->tx_skbuff[i])
 			dev_kfree_skb(tp->tx_skbuff[i]);
-		tp->tx_skbuff[i] = 0;
+		tp->tx_skbuff[i] = NULL;
 	}
 
 	tp->open = 0;
@@ -1629,7 +1629,7 @@ static void set_rx_mode(struct net_device *dev)
 
 		if (entry != 0) {
 			/* Avoid a chip errata by prefixing a dummy entry. */
-			tp->tx_skbuff[entry] = 0;
+			tp->tx_skbuff[entry] = NULL;
 			tp->tx_ring[entry].length =
 				(entry == TX_RING_SIZE - 1) ? Tx1RingWrap : 0;
 			tp->tx_ring[entry].buffer1 = 0;
@@ -1638,7 +1638,7 @@ static void set_rx_mode(struct net_device *dev)
 			entry = tp->cur_tx++ % TX_RING_SIZE;
 		}
 
-		tp->tx_skbuff[entry] = 0;
+		tp->tx_skbuff[entry] = NULL;
 		/* Put the setup frame on the Tx list. */
 		if (entry == TX_RING_SIZE - 1)
 			tx_flags |= Tx1RingWrap;		/* Wrap ring. */
diff --git a/drivers/net/typhoon.c b/drivers/net/typhoon.c
index 45ab1999d..142f5f52f 100644
--- a/drivers/net/typhoon.c
+++ b/drivers/net/typhoon.c
@@ -90,12 +90,6 @@ static const int multicast_filter_limit = 32;
 #define PFX			DRV_MODULE_NAME ": "
 #define ERR_PFX			KERN_ERR PFX
 
-#if !defined(__OPTIMIZE__)  ||  !defined(__KERNEL__)
-#warning  You must compile this file with the correct options!
-#warning  See the last lines of the source file.
-#error  You must compile this driver with "-O".
-#endif
-
 #include <linux/module.h>
 #include <linux/kernel.h>
 #include <linux/string.h>
diff --git a/drivers/net/via-rhine.c b/drivers/net/via-rhine.c
index 721e92f49..6c9206301 100644
--- a/drivers/net/via-rhine.c
+++ b/drivers/net/via-rhine.c
@@ -183,12 +183,6 @@ static const int multicast_filter_limit = 32;
 
 #define PKT_BUF_SZ	1536	/* Size of each temporary Rx buffer.*/
 
-#if !defined(__OPTIMIZE__)  ||  !defined(__KERNEL__)
-#warning  You must compile this file with the correct options!
-#warning  See the last lines of the source file.
-#error  You must compile this driver with "-O".
-#endif
-
 #include <linux/module.h>
 #include <linux/kernel.h>
 #include <linux/string.h>
@@ -354,59 +348,46 @@ The chip does not pad to minimum transmit length.
    second only the 1234 card.
 */
 
-enum pci_flags_bit {
-	PCI_USES_IO=1, PCI_USES_MEM=2, PCI_USES_MASTER=4,
-	PCI_ADDR0=0x10<<0, PCI_ADDR1=0x10<<1, PCI_ADDR2=0x10<<2, PCI_ADDR3=0x10<<3,
+enum rhine_revs {
+	VT86C100A	= 0x00,
+	VT6102		= 0x40,
+	VT8231		= 0x50,	/* Integrated MAC */
+	VT8233		= 0x60,	/* Integrated MAC */
+	VT8235		= 0x74,	/* Integrated MAC */
+	VT8237		= 0x78,	/* Integrated MAC */
+	VTunknown0	= 0x7C,
+	VT6105		= 0x80,
+	VT6105_B0	= 0x83,
+	VT6105L		= 0x8A,
+	VT6107		= 0x8C,
+	VTunknown1	= 0x8E,
+	VT6105M		= 0x90,
 };
 
-enum rhine_chips {
-	VT86C100A = 0,
-	VT6102,
-	VT6105,
-	VT6105M
-};
-
-struct rhine_chip_info {
-	const char *name;
-	u16 pci_flags;
-	int io_size;
-	int drv_flags;
-};
-
-
-enum chip_capability_flags {
-	CanHaveMII=1, HasESIPhy=2, HasDavicomPhy=4,
-	ReqTxAlign=0x10, HasWOL=0x20,
+enum rhine_quirks {
+	rqWOL		= 0x0001,	/* Wake-On-LAN support */
+	rqForceReset	= 0x0002,
+	rqDavicomPhy	= 0x0020,
+	rq6patterns	= 0x0040,	/* 6 instead of 4 patterns for WOL */
+	rqStatusWBRace	= 0x0080,	/* Tx Status Writeback Error possible */
+	rqRhineI	= 0x0100,	/* See comment below */
 };
+/*
+ * rqRhineI: VT86C100A (aka Rhine-I) uses different bits to enable
+ * MMIO as well as for the collision counter and the Tx FIFO underflow
+ * indicator. In addition, Tx and Rx buffers need to 4 byte aligned.
+ */
 
-#ifdef USE_MMIO
-#define RHINE_IOTYPE (PCI_USES_MEM | PCI_USES_MASTER | PCI_ADDR1)
-#else
-#define RHINE_IOTYPE (PCI_USES_IO  | PCI_USES_MASTER | PCI_ADDR0)
-#endif
 /* Beware of PCI posted writes */
 #define IOSYNC	do { readb(dev->base_addr + StationAddr); } while (0)
 
-/* directly indexed by enum rhine_chips, above */
-static struct rhine_chip_info rhine_chip_info[] __devinitdata =
-{
-	{ "VIA VT86C100A Rhine", RHINE_IOTYPE, 128,
-	  CanHaveMII | ReqTxAlign | HasDavicomPhy },
-	{ "VIA VT6102 Rhine-II", RHINE_IOTYPE, 256,
-	  CanHaveMII | HasWOL },
-	{ "VIA VT6105 Rhine-III", RHINE_IOTYPE, 256,
-	  CanHaveMII | HasWOL },
-	{ "VIA VT6105M Rhine-III", RHINE_IOTYPE, 256,
-	  CanHaveMII | HasWOL },
-};
-
 static struct pci_device_id rhine_pci_tbl[] =
 {
-	{0x1106, 0x3043, PCI_ANY_ID, PCI_ANY_ID, 0, 0, VT86C100A},
-	{0x1106, 0x3065, PCI_ANY_ID, PCI_ANY_ID, 0, 0, VT6102},
-	{0x1106, 0x3106, PCI_ANY_ID, PCI_ANY_ID, 0, 0, VT6105}, /* 6105{,L,LOM} */
-	{0x1106, 0x3053, PCI_ANY_ID, PCI_ANY_ID, 0, 0, VT6105M},
-	{0,}	/* terminate list */
+	{0x1106, 0x3043, PCI_ANY_ID, PCI_ANY_ID, 0, 0, }, /* VT86C100A */
+	{0x1106, 0x3065, PCI_ANY_ID, PCI_ANY_ID, 0, 0, }, /* VT6102 */
+	{0x1106, 0x3106, PCI_ANY_ID, PCI_ANY_ID, 0, 0, }, /* 6105{,L,LOM} */
+	{0x1106, 0x3053, PCI_ANY_ID, PCI_ANY_ID, 0, 0, }, /* VT6105M */
+	{ }	/* terminate list */
 };
 MODULE_DEVICE_TABLE(pci, rhine_pci_tbl);
 
@@ -421,8 +402,10 @@ enum register_offsets {
 	MIICmd=0x70, MIIRegAddr=0x71, MIIData=0x72, MACRegEEcsr=0x74,
 	ConfigA=0x78, ConfigB=0x79, ConfigC=0x7A, ConfigD=0x7B,
 	RxMissed=0x7C, RxCRCErrs=0x7E, MiscCmd=0x81,
-	StickyHW=0x83, IntrStatus2=0x84, WOLcrClr=0xA4, WOLcgClr=0xA7,
-	PwrcsrClr=0xAC,
+	StickyHW=0x83, IntrStatus2=0x84,
+	WOLcrSet=0xA0, WOLcrClr=0xA4, WOLcrClr1=0xA6,
+	WOLcgClr=0xA7,
+	PwrcsrSet=0xA8, PwrcsrSet1=0xA9, PwrcsrClr=0xAC, PwrcsrClr1=0xAD,
 };
 
 /* Bits in ConfigD */
@@ -514,7 +497,7 @@ struct rhine_private {
 	spinlock_t lock;
 
 	/* Frequently used values: keep some adjacent for cache effect. */
-	int chip_id, drv_flags;
+	u32 quirks;
 	struct rx_desc *rx_head_desc;
 	unsigned int cur_rx, dirty_rx;	/* Producer/consumer ring indices */
 	unsigned int cur_tx, dirty_tx;
@@ -522,7 +505,6 @@ struct rhine_private {
 	u16 chip_cmd;			/* Current setting for ChipCmd */
 
 	/* These values are keep track of the transceiver/media in use. */
-	unsigned int default_port:4;	/* Last dev->if_port value. */
 	u8 tx_thresh, rx_thresh;
 
 	/* MII transceiver section. */
@@ -557,12 +539,41 @@ static inline u32 get_intr_status(struct net_device *dev)
 
 	intr_status = readw(ioaddr + IntrStatus);
 	/* On Rhine-II, Bit 3 indicates Tx descriptor write-back race. */
-	if (rp->chip_id == VT6102)
+	if (rp->quirks & rqStatusWBRace)
 		intr_status |= readb(ioaddr + IntrStatus2) << 16;
 	return intr_status;
 }
 
-static void wait_for_reset(struct net_device *dev, int chip_id, char *name)
+/*
+ * Get power related registers into sane state.
+ * Returns content of power-event (WOL) registers.
+ */
+static void rhine_power_init(struct net_device *dev)
+{
+	long ioaddr = dev->base_addr;
+	struct rhine_private *rp = netdev_priv(dev);
+
+	if (rp->quirks & rqWOL) {
+		/* Make sure chip is in power state D0 */
+		writeb(readb(ioaddr + StickyHW) & 0xFC, ioaddr + StickyHW);
+
+		/* Disable "force PME-enable" */
+		writeb(0x80, ioaddr + WOLcgClr);
+
+		/* Clear power-event config bits (WOL) */
+		writeb(0xFF, ioaddr + WOLcrClr);
+		/* More recent cards can manage two additional patterns */
+		if (rp->quirks & rq6patterns)
+			writeb(0x03, ioaddr + WOLcrClr1);
+
+		/* Clear power-event status bits */
+		writeb(0xFF, ioaddr + PwrcsrClr);
+		if (rp->quirks & rq6patterns)
+			writeb(0x03, ioaddr + PwrcsrClr1);
+	}
+}
+
+static void wait_for_reset(struct net_device *dev, u32 quirks, char *name)
 {
 	long ioaddr = dev->base_addr;
 	int boguscnt = 20;
@@ -574,7 +585,7 @@ static void wait_for_reset(struct net_device *dev, int chip_id, char *name)
 			"Trying harder.\n", name);
 
 		/* Rhine-II needs to be forced sometimes */
-		if (chip_id == VT6102)
+		if (quirks & rqForceReset)
 			writeb(0x40, ioaddr + MiscCmd);
 
 		/* VT86C100A may need long delay after reset (dlink) */
@@ -590,10 +601,10 @@ static void wait_for_reset(struct net_device *dev, int chip_id, char *name)
 }
 
 #ifdef USE_MMIO
-static void __devinit enable_mmio(long ioaddr, int chip_id)
+static void __devinit enable_mmio(long ioaddr, u32 quirks)
 {
 	int n;
-	if (chip_id == VT86C100A) {
+	if (quirks & rqRhineI) {
 		/* More recent docs say that this bit is reserved ... */
 		n = inb(ioaddr + ConfigA) | 0x20;
 		outb(n, ioaddr + ConfigA);
@@ -628,16 +639,18 @@ static int __devinit rhine_init_one(struct pci_dev *pdev,
 {
 	struct net_device *dev;
 	struct rhine_private *rp;
-	int i, option;
-	int chip_id = (int) ent->driver_data;
+	int i, option, rc;
+	u8 pci_rev;
+	u32 quirks;
 	static int card_idx = -1;
 	long ioaddr;
 	long memaddr;
 	int io_size;
-	int pci_flags;
+	int phy, phy_idx = 0;
 #ifdef USE_MMIO
 	long ioaddr0;
 #endif
+	const char *name;
 
 /* when built into the kernel, we only print version if device is found */
 #ifndef MODULE
@@ -648,14 +661,34 @@ static int __devinit rhine_init_one(struct pci_dev *pdev,
 
 	card_idx++;
 	option = card_idx < MAX_UNITS ? options[card_idx] : 0;
-	io_size = rhine_chip_info[chip_id].io_size;
-	pci_flags = rhine_chip_info[chip_id].pci_flags;
+	pci_read_config_byte(pdev, PCI_REVISION_ID, &pci_rev);
 
-	if (pci_enable_device(pdev))
+	io_size = 256;
+	if (pci_rev < VT6102) {
+		quirks = rqRhineI | rqDavicomPhy;
+		io_size = 128;
+		name = "VT86C100A Rhine";
+	}
+	else {
+		quirks = rqWOL | rqForceReset;
+		if (pci_rev < VT6105) {
+			name = "Rhine II";
+			quirks |= rqStatusWBRace;	/* Rhine-II exclusive */
+		}
+		else {
+			name = "Rhine III";
+			if (pci_rev >= VT6105_B0)
+				quirks |= rq6patterns;
+		}
+	}
+
+	rc = pci_enable_device(pdev);
+	if (rc)
 		goto err_out;
 
 	/* this should always be supported */
-	if (pci_set_dma_mask(pdev, 0xffffffff)) {
+	rc = pci_set_dma_mask(pdev, 0xffffffff);
+	if (rc) {
 		printk(KERN_ERR "32-bit PCI DMA addresses not supported by "
 		       "the card!?\n");
 		goto err_out;
@@ -664,6 +697,7 @@ static int __devinit rhine_init_one(struct pci_dev *pdev,
 	/* sanity check */
 	if ((pci_resource_len(pdev, 0) < io_size) ||
 	    (pci_resource_len(pdev, 1) < io_size)) {
+		rc = -EIO;
 		printk(KERN_ERR "Insufficient PCI resources, aborting\n");
 		goto err_out;
 	}
@@ -671,11 +705,11 @@ static int __devinit rhine_init_one(struct pci_dev *pdev,
 	ioaddr = pci_resource_start(pdev, 0);
 	memaddr = pci_resource_start(pdev, 1);
 
-	if (pci_flags & PCI_USES_MASTER)
-		pci_set_master(pdev);
+	pci_set_master(pdev);
 
 	dev = alloc_etherdev(sizeof(*rp));
 	if (dev == NULL) {
+		rc = -ENOMEM;
 		printk(KERN_ERR "init_ethernet failed for card #%d\n",
 		       card_idx);
 		goto err_out;
@@ -683,15 +717,17 @@ static int __devinit rhine_init_one(struct pci_dev *pdev,
 	SET_MODULE_OWNER(dev);
 	SET_NETDEV_DEV(dev, &pdev->dev);
 
-	if (pci_request_regions(pdev, shortname))
+	rc = pci_request_regions(pdev, shortname);
+	if (rc)
 		goto err_out_free_netdev;
 
 #ifdef USE_MMIO
 	ioaddr0 = ioaddr;
-	enable_mmio(ioaddr0, chip_id);
+	enable_mmio(ioaddr0, quirks);
 
 	ioaddr = (long) ioremap(memaddr, io_size);
 	if (!ioaddr) {
+		rc = -EIO;
 		printk(KERN_ERR "ioremap failed for device %s, region 0x%X "
 		       "@ 0x%lX\n", pci_name(pdev), io_size, memaddr);
 		goto err_out_free_res;
@@ -704,36 +740,23 @@ static int __devinit rhine_init_one(struct pci_dev *pdev,
 		unsigned char a = inb(ioaddr0+reg);
 		unsigned char b = readb(ioaddr+reg);
 		if (a != b) {
+			rc = -EIO;
 			printk(KERN_ERR "MMIO do not match PIO [%02x] "
 			       "(%02x != %02x)\n", reg, a, b);
 			goto err_out_unmap;
 		}
 	}
 #endif /* USE_MMIO */
+	dev->base_addr = ioaddr;
+	rp = netdev_priv(dev);
+	rp->quirks = quirks;
 
-	/* D-Link provided reset code (with comment additions) */
-	if (rhine_chip_info[chip_id].drv_flags & HasWOL) {
-		unsigned char byOrgValue;
-
-		/* clear sticky bit before reset & read ethernet address */
-		byOrgValue = readb(ioaddr + StickyHW);
-		byOrgValue = byOrgValue & 0xFC;
-		writeb(byOrgValue, ioaddr + StickyHW);
-
-		/* (bits written are cleared?) */
-		/* disable force PME-enable */
-		writeb(0x80, ioaddr + WOLcgClr);
-		/* disable power-event config bit */
-		writeb(0xFF, ioaddr + WOLcrClr);
-		/* clear power status (undocumented in vt6102 docs?) */
-		writeb(0xFF, ioaddr + PwrcsrClr);
-	}
+	rhine_power_init(dev);
 
 	/* Reset the chip to erase previous misconfiguration. */
 	writew(CmdReset, ioaddr + ChipCmd);
 
-	dev->base_addr = ioaddr;
-	wait_for_reset(dev, chip_id, shortname);
+	wait_for_reset(dev, quirks, shortname);
 
 	/* Reload the station address from the EEPROM. */
 #ifdef USE_MMIO
@@ -741,7 +764,7 @@ static int __devinit rhine_init_one(struct pci_dev *pdev,
 	/* Reloading from eeprom overwrites cfgA-D, so we must re-enable MMIO.
 	   If reload_eeprom() was done first this could be avoided, but it is
 	   not known if that still works with the "win98-reboot" problem. */
-	enable_mmio(ioaddr0, chip_id);
+	enable_mmio(ioaddr0, quirks);
 #else
 	reload_eeprom(ioaddr);
 #endif
@@ -750,11 +773,12 @@ static int __devinit rhine_init_one(struct pci_dev *pdev,
 		dev->dev_addr[i] = readb(ioaddr + StationAddr + i);
 
 	if (!is_valid_ether_addr(dev->dev_addr)) {
+		rc = -EIO;
 		printk(KERN_ERR "Invalid MAC address for card #%d\n", card_idx);
 		goto err_out_unmap;
 	}
 
-	if (chip_id == VT6102) {
+	if (quirks & rqWOL) {
 		/*
 		 * for 3065D, EEPROM reloaded will cause bit 0 in MAC_REG_CFGA
 		 * turned on. it makes MAC receive magic packet
@@ -770,10 +794,7 @@ static int __devinit rhine_init_one(struct pci_dev *pdev,
 
 	dev->irq = pdev->irq;
 
-	rp = netdev_priv(dev);
 	spin_lock_init(&rp->lock);
-	rp->chip_id = chip_id;
-	rp->drv_flags = rhine_chip_info[chip_id].drv_flags;
 	rp->pdev = pdev;
 	rp->mii_if.dev = dev;
 	rp->mii_if.mdio_read = mdio_read;
@@ -797,19 +818,18 @@ static int __devinit rhine_init_one(struct pci_dev *pdev,
 #ifdef CONFIG_NET_POLL_CONTROLLER
 	dev->poll_controller = rhine_poll;
 #endif
-	if (rp->drv_flags & ReqTxAlign)
+	if (rp->quirks & rqRhineI)
 		dev->features |= NETIF_F_SG|NETIF_F_HW_CSUM;
 
 	/* dev->name not defined before register_netdev()! */
-	i = register_netdev(dev);
-	if (i)
+	rc = register_netdev(dev);
+	if (rc)
 		goto err_out_unmap;
 
 	/* The lower four bits are the media type. */
 	if (option > 0) {
 		if (option & 0x220)
 			rp->mii_if.full_duplex = 1;
-		rp->default_port = option & 15;
 	}
 	if (card_idx < MAX_UNITS && full_duplex[card_idx] > 0)
 		rp->mii_if.full_duplex = 1;
@@ -820,9 +840,14 @@ static int __devinit rhine_init_one(struct pci_dev *pdev,
 		rp->mii_if.force_media = 1;
 	}
 
-	printk(KERN_INFO "%s: %s at 0x%lx, ",
-	       dev->name, rhine_chip_info[chip_id].name,
-	       (pci_flags & PCI_USES_IO) ? ioaddr : memaddr);
+	printk(KERN_INFO "%s: VIA %s at 0x%lx, ",
+	       dev->name, name,
+#ifdef USE_MMIO
+		memaddr
+#else
+		ioaddr
+#endif
+		 );
 
 	for (i = 0; i < 5; i++)
 		printk("%2.2x:", dev->dev_addr[i]);
@@ -830,41 +855,35 @@ static int __devinit rhine_init_one(struct pci_dev *pdev,
 
 	pci_set_drvdata(pdev, dev);
 
-	if (rp->drv_flags & CanHaveMII) {
-		int phy, phy_idx = 0;
-		rp->phys[0] = 1;		/* Standard for this chip. */
-		for (phy = 1; phy < 32 && phy_idx < MAX_MII_CNT; phy++) {
-			int mii_status = mdio_read(dev, phy, 1);
-			if (mii_status != 0xffff && mii_status != 0x0000) {
-				rp->phys[phy_idx++] = phy;
-				rp->mii_if.advertising = mdio_read(dev, phy, 4);
-				printk(KERN_INFO "%s: MII PHY found at address "
-				       "%d, status 0x%4.4x advertising %4.4x "
-				       "Link %4.4x.\n", dev->name, phy,
-				       mii_status, rp->mii_if.advertising,
-				       mdio_read(dev, phy, 5));
-
-				/* set IFF_RUNNING */
-				if (mii_status & BMSR_LSTATUS)
-					netif_carrier_on(dev);
-				else
-					netif_carrier_off(dev);
-
-				break;
-			}
+	rp->phys[0] = 1;		/* Standard for this chip. */
+	for (phy = 1; phy < 32 && phy_idx < MAX_MII_CNT; phy++) {
+		int mii_status = mdio_read(dev, phy, 1);
+		if (mii_status != 0xffff && mii_status != 0x0000) {
+			rp->phys[phy_idx++] = phy;
+			rp->mii_if.advertising = mdio_read(dev, phy, 4);
+			printk(KERN_INFO "%s: MII PHY found at address "
+			       "%d, status 0x%4.4x advertising %4.4x "
+			       "Link %4.4x.\n", dev->name, phy,
+			       mii_status, rp->mii_if.advertising,
+			       mdio_read(dev, phy, 5));
+
+			/* set IFF_RUNNING */
+			if (mii_status & BMSR_LSTATUS)
+				netif_carrier_on(dev);
+			else
+				netif_carrier_off(dev);
+
+			break;
 		}
-		rp->mii_cnt = phy_idx;
-		rp->mii_if.phy_id = rp->phys[0];
 	}
+	rp->mii_cnt = phy_idx;
+	rp->mii_if.phy_id = rp->phys[0];
 
 	/* Allow forcing the media type. */
 	if (option > 0) {
 		if (option & 0x220)
 			rp->mii_if.full_duplex = 1;
-		rp->default_port = option & 0x3ff;
 		if (option & 0x330) {
-			/* FIXME: shouldn't someone check this variable? */
-			/* rp->medialock = 1; */
 			printk(KERN_INFO " Forcing %dMbs %s-duplex "
 				"operation.\n",
 			       (option & 0x300 ? 100 : 10),
@@ -887,7 +906,7 @@ err_out_free_res:
 err_out_free_netdev:
 	free_netdev(dev);
 err_out:
-	return -ENODEV;
+	return rc;
 }
 
 static int alloc_ring(struct net_device* dev)
@@ -904,7 +923,7 @@ static int alloc_ring(struct net_device* dev)
 		printk(KERN_ERR "Could not allocate DMA memory.\n");
 		return -ENOMEM;
 	}
-	if (rp->drv_flags & ReqTxAlign) {
+	if (rp->quirks & rqRhineI) {
 		rp->tx_bufs = pci_alloc_consistent(rp->pdev,
 						   PKT_BUF_SZ * TX_RING_SIZE,
 						   &rp->tx_bufs_dma);
@@ -961,7 +980,7 @@ static void alloc_rbufs(struct net_device *dev)
 		rp->rx_ring[i].desc_length = cpu_to_le32(rp->rx_buf_sz);
 		next += sizeof(struct rx_desc);
 		rp->rx_ring[i].next_desc = cpu_to_le32(next);
-		rp->rx_skbuff[i] = 0;
+		rp->rx_skbuff[i] = NULL;
 	}
 	/* Mark the last entry as wrapping the ring. */
 	rp->rx_ring[i-1].next_desc = cpu_to_le32(rp->rx_ring_dma);
@@ -999,7 +1018,7 @@ static void free_rbufs(struct net_device* dev)
 					 rp->rx_buf_sz, PCI_DMA_FROMDEVICE);
 			dev_kfree_skb(rp->rx_skbuff[i]);
 		}
-		rp->rx_skbuff[i] = 0;
+		rp->rx_skbuff[i] = NULL;
 	}
 }
 
@@ -1012,7 +1031,7 @@ static void alloc_tbufs(struct net_device* dev)
 	rp->dirty_tx = rp->cur_tx = 0;
 	next = rp->tx_ring_dma;
 	for (i = 0; i < TX_RING_SIZE; i++) {
-		rp->tx_skbuff[i] = 0;
+		rp->tx_skbuff[i] = NULL;
 		rp->tx_ring[i].tx_status = 0;
 		rp->tx_ring[i].desc_length = cpu_to_le32(TXDESC);
 		next += sizeof(struct tx_desc);
@@ -1041,8 +1060,8 @@ static void free_tbufs(struct net_device* dev)
 			}
 			dev_kfree_skb(rp->tx_skbuff[i]);
 		}
-		rp->tx_skbuff[i] = 0;
-		rp->tx_buf[i] = 0;
+		rp->tx_skbuff[i] = NULL;
+		rp->tx_buf[i] = NULL;
 	}
 }
 
@@ -1063,9 +1082,6 @@ static void init_registers(struct net_device *dev)
 	rp->rx_thresh = 0x60;		/* Written in rhine_set_rx_mode(). */
 	rp->mii_if.full_duplex = 0;
 
-	if (dev->if_port == 0)
-		dev->if_port = rp->default_port;
-
 	writel(rp->rx_ring_dma, ioaddr + RxRingPtr);
 	writel(rp->tx_ring_dma, ioaddr + TxRingPtr);
 
@@ -1087,9 +1103,8 @@ static void init_registers(struct net_device *dev)
 
 	/* The LED outputs of various MII xcvrs should be configured. */
 	/* For NS or Mison phys, turn on bit 1 in register 0x17 */
-	/* For ESI phys, turn on bit 7 in register 0x17. */
 	mdio_write(dev, rp->phys[0], 0x17, mdio_read(dev, rp->phys[0], 0x17) |
-		   (rp->drv_flags & HasESIPhy) ? 0x0080 : 0x0001);
+		   0x0001);
 }
 
 /* Read and write over the MII Management Data I/O (MDIO) interface. */
@@ -1166,7 +1181,7 @@ static int rhine_open(struct net_device *dev)
 		return i;
 	alloc_rbufs(dev);
 	alloc_tbufs(dev);
-	wait_for_reset(dev, rp->chip_id, dev->name);
+	wait_for_reset(dev, rp->quirks, dev->name);
 	init_registers(dev);
 	if (debug > 2)
 		printk(KERN_DEBUG "%s: Done rhine_open(), status %4.4x "
@@ -1257,8 +1272,6 @@ static void rhine_tx_timeout(struct net_device *dev)
 	       dev->name, readw(ioaddr + IntrStatus),
 	       mdio_read(dev, rp->phys[0], MII_BMSR));
 
-	dev->if_port = 0;
-
 	/* protect against concurrent rx interrupts */
 	disable_irq(rp->pdev->irq);
 
@@ -1274,7 +1287,7 @@ static void rhine_tx_timeout(struct net_device *dev)
 	alloc_rbufs(dev);
 
 	/* Reinitialize the hardware. */
-	wait_for_reset(dev, rp->chip_id, dev->name);
+	wait_for_reset(dev, rp->quirks, dev->name);
 	init_registers(dev);
 
 	spin_unlock(&rp->lock);
@@ -1305,7 +1318,7 @@ static int rhine_start_tx(struct sk_buff *skb, struct net_device *dev)
 
 	rp->tx_skbuff[entry] = skb;
 
-	if ((rp->drv_flags & ReqTxAlign) &&
+	if ((rp->quirks & rqRhineI) &&
 	    (((long)skb->data & 3) || skb_shinfo(skb)->nr_frags != 0 || skb->ip_summed == CHECKSUM_HW)) {
 		/* Must use alignment buffer. */
 		if (skb->len > PKT_BUF_SZ) {
@@ -1454,7 +1467,7 @@ static void rhine_tx(struct net_device *dev)
 			if (txstatus & 0x0200) rp->stats.tx_window_errors++;
 			if (txstatus & 0x0100) rp->stats.tx_aborted_errors++;
 			if (txstatus & 0x0080) rp->stats.tx_heartbeat_errors++;
-			if (((rp->chip_id == VT86C100A) && txstatus & 0x0002) ||
+			if (((rp->quirks & rqRhineI) && txstatus & 0x0002) ||
 			    (txstatus & 0x0800) || (txstatus & 0x1000)) {
 				rp->stats.tx_fifo_errors++;
 				rp->tx_ring[entry].tx_status = cpu_to_le32(DescOwn);
@@ -1462,7 +1475,7 @@ static void rhine_tx(struct net_device *dev)
 			}
 			/* Transmitter restarted in 'abnormal' handler. */
 		} else {
-			if (rp->chip_id == VT86C100A)
+			if (rp->quirks & rqRhineI)
 				rp->stats.collisions += (txstatus >> 3) & 0x0F;
 			else
 				rp->stats.collisions += txstatus & 0x0F;
@@ -1563,15 +1576,10 @@ static void rhine_rx(struct net_device *dev)
 				   eth_copy_and_sum is memcpy for all archs so
 				   this is kind of pointless right now
 				   ... or? */
-#if HAS_IP_COPYSUM		/* Call copy + cksum if available. */
 				eth_copy_and_sum(skb,
 						 rp->rx_skbuff[entry]->tail,
 						 pkt_len, 0);
 				skb_put(skb, pkt_len);
-#else
-				memcpy(skb_put(skb, pkt_len),
-				       rp->rx_skbuff[entry]->tail, pkt_len);
-#endif
 				pci_dma_sync_single_for_device(rp->pdev,
 							       rp->rx_skbuff_dma[entry],
 							       rp->rx_buf_sz,
@@ -1679,7 +1687,7 @@ static void rhine_error(struct net_device *dev, int intr_status)
 	if (intr_status & (IntrLinkChange)) {
 		if (readb(ioaddr + MIIStatus) & 0x02) {
 			/* Link failed, restart autonegotiation. */
-			if (rp->drv_flags & HasDavicomPhy)
+			if (rp->quirks & rqRhineI)
 				mdio_write(dev, rp->phys[0], MII_BMCR, 0x3300);
 		} else
 			rhine_check_duplex(dev);
@@ -1805,9 +1813,6 @@ static int netdev_get_settings(struct net_device *dev, struct ethtool_cmd *cmd)
 	struct rhine_private *rp = netdev_priv(dev);
 	int rc;
 
-	if (!(rp->drv_flags & CanHaveMII))
-		return -EINVAL;
-
 	spin_lock_irq(&rp->lock);
 	rc = mii_ethtool_gset(&rp->mii_if, cmd);
 	spin_unlock_irq(&rp->lock);
@@ -1820,9 +1825,6 @@ static int netdev_set_settings(struct net_device *dev, struct ethtool_cmd *cmd)
 	struct rhine_private *rp = netdev_priv(dev);
 	int rc;
 
-	if (!(rp->drv_flags & CanHaveMII))
-		return -EINVAL;
-
 	spin_lock_irq(&rp->lock);
 	rc = mii_ethtool_sset(&rp->mii_if, cmd);
 	spin_unlock_irq(&rp->lock);
@@ -1834,9 +1836,6 @@ static int netdev_nway_reset(struct net_device *dev)
 {
 	struct rhine_private *rp = netdev_priv(dev);
 
-	if (!(rp->drv_flags & CanHaveMII))
-		return -EINVAL;
-
 	return mii_nway_restart(&rp->mii_if);
 }
 
@@ -1844,9 +1843,6 @@ static u32 netdev_get_link(struct net_device *dev)
 {
 	struct rhine_private *rp = netdev_priv(dev);
 
-	if (!(rp->drv_flags & CanHaveMII))
-		return 0;	/* -EINVAL */
-
 	return mii_link_ok(&rp->mii_if);
 }
 
diff --git a/drivers/net/via-velocity.c b/drivers/net/via-velocity.c
index 3356fd8de..f053d2a9e 100644
--- a/drivers/net/via-velocity.c
+++ b/drivers/net/via-velocity.c
@@ -2892,7 +2892,7 @@ static int velocity_mii_ioctl(struct net_device *dev, struct ifreq *ifr, int cmd
 	struct velocity_info *vptr = dev->priv;
 	struct mac_regs * regs = vptr->mac_regs;
 	unsigned long flags;
-	struct mii_ioctl_data *miidata = (struct mii_ioctl_data *) &(ifr->ifr_data);
+	struct mii_ioctl_data *miidata = if_mii(ifr);
 	int err;
 	
 	switch (cmd) {
diff --git a/drivers/net/wan/Kconfig b/drivers/net/wan/Kconfig
index 4d5844f75..03eeaebbf 100644
--- a/drivers/net/wan/Kconfig
+++ b/drivers/net/wan/Kconfig
@@ -248,7 +248,7 @@ config WANXL
 
 config WANXL_BUILD_FIRMWARE
 	bool "rebuild wanXL firmware"
-	depends on WANXL
+	depends on WANXL && !PREVENT_FIRMWARE_BUILD
 	help
 	  Allows you to rebuild firmware run by the QUICC processor.
 	  It requires as68k, ld68k and hexdump programs.
diff --git a/drivers/net/wan/c101.c b/drivers/net/wan/c101.c
index 7f4718040..e8cfa4fc9 100644
--- a/drivers/net/wan/c101.c
+++ b/drivers/net/wan/c101.c
@@ -220,7 +220,8 @@ static int c101_close(struct net_device *dev)
 static int c101_ioctl(struct net_device *dev, struct ifreq *ifr, int cmd)
 {
 	const size_t size = sizeof(sync_serial_settings);
-	sync_serial_settings new_line, *line = ifr->ifr_settings.ifs_ifsu.sync;
+	sync_serial_settings new_line;
+	sync_serial_settings __user *line = ifr->ifr_settings.ifs_ifsu.sync;
 	port_t *port = dev_to_port(dev);
 
 #ifdef DEBUG_RINGS
diff --git a/drivers/net/wan/cosa.c b/drivers/net/wan/cosa.c
index a4d0452c3..dbd790168 100644
--- a/drivers/net/wan/cosa.c
+++ b/drivers/net/wan/cosa.c
@@ -301,9 +301,9 @@ static char *chrdev_setup_rx(struct channel_data *channel, int size);
 static int chrdev_rx_done(struct channel_data *channel);
 static int chrdev_tx_done(struct channel_data *channel, int size);
 static ssize_t cosa_read(struct file *file,
-	char *buf, size_t count, loff_t *ppos);
+	char __user *buf, size_t count, loff_t *ppos);
 static ssize_t cosa_write(struct file *file,
-	const char *buf, size_t count, loff_t *ppos);
+	const char __user *buf, size_t count, loff_t *ppos);
 static unsigned int cosa_poll(struct file *file, poll_table *poll);
 static int cosa_open(struct inode *inode, struct file *file);
 static int cosa_release(struct inode *inode, struct file *file);
@@ -330,13 +330,13 @@ static struct file_operations cosa_fops = {
 /* Ioctls */
 static int cosa_start(struct cosa_data *cosa, int address);
 static int cosa_reset(struct cosa_data *cosa);
-static int cosa_download(struct cosa_data *cosa, unsigned long a);
-static int cosa_readmem(struct cosa_data *cosa, unsigned long a);
+static int cosa_download(struct cosa_data *cosa, void __user *a);
+static int cosa_readmem(struct cosa_data *cosa, void __user *a);
 
 /* COSA/SRP ROM monitor */
-static int download(struct cosa_data *cosa, const char *data, int addr, int len);
+static int download(struct cosa_data *cosa, const char __user *data, int addr, int len);
 static int startmicrocode(struct cosa_data *cosa, int address);
-static int readmem(struct cosa_data *cosa, char *data, int addr, int len);
+static int readmem(struct cosa_data *cosa, char __user *data, int addr, int len);
 static int cosa_reset_and_read_id(struct cosa_data *cosa, char *id);
 
 /* Auxilliary functions */
@@ -729,7 +729,7 @@ static void cosa_sppp_timeout(struct net_device *dev)
 	cosa_kick(chan->cosa);
 	if (chan->tx_skb) {
 		dev_kfree_skb(chan->tx_skb);
-		chan->tx_skb = 0;
+		chan->tx_skb = NULL;
 	}
 	netif_wake_queue(dev);
 }
@@ -745,11 +745,11 @@ static int cosa_sppp_close(struct net_device *d)
 	spin_lock_irqsave(&chan->cosa->lock, flags);
 	if (chan->rx_skb) {
 		kfree_skb(chan->rx_skb);
-		chan->rx_skb = 0;
+		chan->rx_skb = NULL;
 	}
 	if (chan->tx_skb) {
 		kfree_skb(chan->tx_skb);
-		chan->tx_skb = 0;
+		chan->tx_skb = NULL;
 	}
 	chan->usage=0;
 	chan->cosa->usage--;
@@ -791,7 +791,7 @@ static int sppp_rx_done(struct channel_data *chan)
 	chan->stats.rx_packets++;
 	chan->stats.rx_bytes += chan->cosa->rxsize;
 	netif_rx(chan->rx_skb);
-	chan->rx_skb = 0;
+	chan->rx_skb = NULL;
 	chan->pppdev.dev->last_rx = jiffies;
 	return 0;
 }
@@ -807,7 +807,7 @@ static int sppp_tx_done(struct channel_data *chan, int size)
 		return 1;
 	}
 	dev_kfree_skb_irq(chan->tx_skb);
-	chan->tx_skb = 0;
+	chan->tx_skb = NULL;
 	chan->stats.tx_packets++;
 	chan->stats.tx_bytes += size;
 	netif_wake_queue(chan->pppdev.dev);
@@ -830,7 +830,7 @@ static void chardev_channel_init(struct channel_data *chan)
 }
 
 static ssize_t cosa_read(struct file *file,
-	char *buf, size_t count, loff_t *ppos)
+	char __user *buf, size_t count, loff_t *ppos)
 {
 	DECLARE_WAITQUEUE(wait, current);
 	unsigned long flags;
@@ -905,7 +905,7 @@ static int chrdev_rx_done(struct channel_data *chan)
 
 
 static ssize_t cosa_write(struct file *file,
-	const char *buf, size_t count, loff_t *ppos)
+	const char __user *buf, size_t count, loff_t *ppos)
 {
 	DECLARE_WAITQUEUE(wait, current);
 	struct channel_data *chan = file->private_data;
@@ -1066,7 +1066,7 @@ static inline int cosa_reset(struct cosa_data *cosa)
 }
 
 /* High-level function to download data into COSA memory. Calls download() */
-static inline int cosa_download(struct cosa_data *cosa, unsigned long arg)
+static inline int cosa_download(struct cosa_data *cosa, void __user *arg)
 {
 	struct cosa_download d;
 	int i;
@@ -1080,7 +1080,7 @@ static inline int cosa_download(struct cosa_data *cosa, unsigned long arg)
 		return -EPERM;
 	}
 	
-	if (copy_from_user(&d, (void __user *) arg, sizeof(d)))
+	if (copy_from_user(&d, arg, sizeof(d)))
 		return -EFAULT;
 
 	if (d.addr < 0 || d.addr > COSA_MAX_FIRMWARE_SIZE)
@@ -1105,7 +1105,7 @@ static inline int cosa_download(struct cosa_data *cosa, unsigned long arg)
 }
 
 /* High-level function to read COSA memory. Calls readmem() */
-static inline int cosa_readmem(struct cosa_data *cosa, unsigned long arg)
+static inline int cosa_readmem(struct cosa_data *cosa, void __user *arg)
 {
 	struct cosa_download d;
 	int i;
@@ -1120,7 +1120,7 @@ static inline int cosa_readmem(struct cosa_data *cosa, unsigned long arg)
 		return -EPERM;
 	}
 
-	if (copy_from_user(&d, (void __user *) arg, sizeof(d)))
+	if (copy_from_user(&d, arg, sizeof(d)))
 		return -EFAULT;
 
 	/* If something fails, force the user to reset the card */
@@ -1167,7 +1167,7 @@ static inline int cosa_start(struct cosa_data *cosa, int address)
 }
 		
 /* Buffer of size at least COSA_MAX_ID_STRING is expected */
-static inline int cosa_getidstr(struct cosa_data *cosa, char *string)
+static inline int cosa_getidstr(struct cosa_data *cosa, char __user *string)
 {
 	int l = strlen(cosa->id_string)+1;
 	if (copy_to_user(string, cosa->id_string, l))
@@ -1176,7 +1176,7 @@ static inline int cosa_getidstr(struct cosa_data *cosa, char *string)
 }
 
 /* Buffer of size at least COSA_MAX_ID_STRING is expected */
-static inline int cosa_gettype(struct cosa_data *cosa, char *string)
+static inline int cosa_gettype(struct cosa_data *cosa, char __user *string)
 {
 	int l = strlen(cosa->type)+1;
 	if (copy_to_user(string, cosa->type, l))
@@ -1187,6 +1187,7 @@ static inline int cosa_gettype(struct cosa_data *cosa, char *string)
 static int cosa_ioctl_common(struct cosa_data *cosa,
 	struct channel_data *channel, unsigned int cmd, unsigned long arg)
 {
+	void __user *argp = (void __user *)arg;
 	switch(cmd) {
 	case COSAIORSET:	/* Reset the device */
 		if (!capable(CAP_NET_ADMIN))
@@ -1200,15 +1201,15 @@ static int cosa_ioctl_common(struct cosa_data *cosa,
 		if (!capable(CAP_SYS_RAWIO))
 			return -EACCES;
 		
-		return cosa_download(cosa, arg);
+		return cosa_download(cosa, argp);
 	case COSAIORMEM:
 		if (!capable(CAP_SYS_RAWIO))
 			return -EACCES;
-		return cosa_readmem(cosa, arg);
+		return cosa_readmem(cosa, argp);
 	case COSAIORTYPE:
-		return cosa_gettype(cosa, (char *)arg);
+		return cosa_gettype(cosa, argp);
 	case COSAIORIDSTR:
-		return cosa_getidstr(cosa, (char *)arg);
+		return cosa_getidstr(cosa, argp);
 	case COSAIONRCARDS:
 		return nr_cards;
 	case COSAIONRCHANS:
@@ -1434,7 +1435,7 @@ static int cosa_dma_able(struct channel_data *chan, char *buf, int len)
  * by a single space. Monitor has to reply with a space. Now the download
  * begins. After the download monitor replies with "\r\n." (CR LF dot).
  */
-static int download(struct cosa_data *cosa, const char *microcode, int length, int address)
+static int download(struct cosa_data *cosa, const char __user *microcode, int length, int address)
 {
 	int i;
 
@@ -1508,7 +1509,7 @@ static int startmicrocode(struct cosa_data *cosa, int address)
  * This routine is not needed during the normal operation and serves
  * for debugging purposes only.
  */
-static int readmem(struct cosa_data *cosa, char *microcode, int length, int address)
+static int readmem(struct cosa_data *cosa, char __user *microcode, int length, int address)
 {
 	if (put_wait_data(cosa, 'r') == -1) return -1;
 	if ((get_wait_data(cosa)) != 'r') return -2;
diff --git a/drivers/net/wan/cosa.h b/drivers/net/wan/cosa.h
index b59e3efff..63a8a5c42 100644
--- a/drivers/net/wan/cosa.h
+++ b/drivers/net/wan/cosa.h
@@ -66,7 +66,7 @@
 /* ioctls */
 struct cosa_download {
 	int addr, len;
-	char *code;
+	char __user *code;
 };
 
 /* Reset the device */
diff --git a/drivers/net/wan/dscc4.c b/drivers/net/wan/dscc4.c
index b98f27e99..4cbda752b 100644
--- a/drivers/net/wan/dscc4.c
+++ b/drivers/net/wan/dscc4.c
@@ -1296,7 +1296,7 @@ done:
 
 static int dscc4_ioctl(struct net_device *dev, struct ifreq *ifr, int cmd)
 {
-	sync_serial_settings *line = ifr->ifr_settings.ifs_ifsu.sync;
+	sync_serial_settings __user *line = ifr->ifr_settings.ifs_ifsu.sync;
 	struct dscc4_dev_priv *dpriv = dscc4_priv(dev);
 	const size_t size = sizeof(dpriv->settings);
 	int ret = 0;
diff --git a/drivers/net/wan/farsync.c b/drivers/net/wan/farsync.c
index d805ac786..543ac7900 100644
--- a/drivers/net/wan/farsync.c
+++ b/drivers/net/wan/farsync.c
@@ -1636,7 +1636,7 @@ fst_intr(int irq, void *dev_id, struct pt_regs *regs)
 			 */
 			dbg(DBG_TX, "Tx underflow port %d\n", port->index);
                         hdlc_stats(port_to_dev(port))->tx_errors++;
-                        hdlc_stats(port_to_dev(port))->tx_fifo_errors;
+                        hdlc_stats(port_to_dev(port))->tx_fifo_errors++;
 			dbg(DBG_ASS, "Tx underflow on card %d port %d\n",
 			    card->card_no, port->index);
 			break;
diff --git a/drivers/net/wan/hdlc_cisco.c b/drivers/net/wan/hdlc_cisco.c
index 31b379da2..c1b6896d7 100644
--- a/drivers/net/wan/hdlc_cisco.c
+++ b/drivers/net/wan/hdlc_cisco.c
@@ -272,7 +272,7 @@ static void cisco_stop(struct net_device *dev)
 
 int hdlc_cisco_ioctl(struct net_device *dev, struct ifreq *ifr)
 {
-	cisco_proto *cisco_s = ifr->ifr_settings.ifs_ifsu.cisco;
+	cisco_proto __user *cisco_s = ifr->ifr_settings.ifs_ifsu.cisco;
 	const size_t size = sizeof(cisco_proto);
 	cisco_proto new_settings;
 	hdlc_device *hdlc = dev_to_hdlc(dev);
diff --git a/drivers/net/wan/hdlc_fr.c b/drivers/net/wan/hdlc_fr.c
index 8feed459c..7f450b51a 100644
--- a/drivers/net/wan/hdlc_fr.c
+++ b/drivers/net/wan/hdlc_fr.c
@@ -1137,7 +1137,7 @@ static void fr_destroy(hdlc_device *hdlc)
 
 int hdlc_fr_ioctl(struct net_device *dev, struct ifreq *ifr)
 {
-	fr_proto *fr_s = ifr->ifr_settings.ifs_ifsu.fr;
+	fr_proto __user *fr_s = ifr->ifr_settings.ifs_ifsu.fr;
 	const size_t size = sizeof(fr_proto);
 	fr_proto new_settings;
 	hdlc_device *hdlc = dev_to_hdlc(dev);
diff --git a/drivers/net/wan/hdlc_raw.c b/drivers/net/wan/hdlc_raw.c
index 42690658b..c41fb70b6 100644
--- a/drivers/net/wan/hdlc_raw.c
+++ b/drivers/net/wan/hdlc_raw.c
@@ -34,7 +34,7 @@ static unsigned short raw_type_trans(struct sk_buff *skb,
 
 int hdlc_raw_ioctl(struct net_device *dev, struct ifreq *ifr)
 {
-	raw_hdlc_proto *raw_s = ifr->ifr_settings.ifs_ifsu.raw_hdlc;
+	raw_hdlc_proto __user *raw_s = ifr->ifr_settings.ifs_ifsu.raw_hdlc;
 	const size_t size = sizeof(raw_hdlc_proto);
 	raw_hdlc_proto new_settings;
 	hdlc_device *hdlc = dev_to_hdlc(dev);
diff --git a/drivers/net/wan/hdlc_raw_eth.c b/drivers/net/wan/hdlc_raw_eth.c
index 4ddc2e08c..b1285cc8f 100644
--- a/drivers/net/wan/hdlc_raw_eth.c
+++ b/drivers/net/wan/hdlc_raw_eth.c
@@ -46,7 +46,7 @@ static int eth_tx(struct sk_buff *skb, struct net_device *dev)
 
 int hdlc_raw_eth_ioctl(struct net_device *dev, struct ifreq *ifr)
 {
-	raw_hdlc_proto *raw_s = ifr->ifr_settings.ifs_ifsu.raw_hdlc;
+	raw_hdlc_proto __user *raw_s = ifr->ifr_settings.ifs_ifsu.raw_hdlc;
 	const size_t size = sizeof(raw_hdlc_proto);
 	raw_hdlc_proto new_settings;
 	hdlc_device *hdlc = dev_to_hdlc(dev);
diff --git a/drivers/net/wan/lmc/lmc_ioctl.h b/drivers/net/wan/lmc/lmc_ioctl.h
index 38f3c1bca..57dd861cd 100644
--- a/drivers/net/wan/lmc/lmc_ioctl.h
+++ b/drivers/net/wan/lmc/lmc_ioctl.h
@@ -234,7 +234,7 @@ typedef struct lmc_st1f_control {
   int command;
   int address;
   int value;
-  char *data;
+  char __user *data;
 } lmc_t1f_control;
 
 enum lmc_xilinx_c {
@@ -246,7 +246,7 @@ enum lmc_xilinx_c {
 struct lmc_xilinx_control {
     enum lmc_xilinx_c command;
     int len;
-    char *data;
+    char __user *data;
 };
 
 /* ------------------ end T1 defs ------------------- */
diff --git a/drivers/net/wan/lmc/lmc_main.c b/drivers/net/wan/lmc/lmc_main.c
index 332202ba0..b9800715d 100644
--- a/drivers/net/wan/lmc/lmc_main.c
+++ b/drivers/net/wan/lmc/lmc_main.c
@@ -1250,7 +1250,7 @@ static int lmc_ifdown (struct net_device *dev) /*fold00*/
     for (i = 0; i < LMC_RXDESCS; i++)
     {
         struct sk_buff *skb = sc->lmc_rxq[i];
-        sc->lmc_rxq[i] = 0;
+        sc->lmc_rxq[i] = NULL;
         sc->lmc_rxring[i].status = 0;
         sc->lmc_rxring[i].length = 0;
         sc->lmc_rxring[i].buffer1 = 0xDEADBEEF;
@@ -1394,7 +1394,7 @@ static irqreturn_t lmc_interrupt (int irq, void *dev_instance, struct pt_regs *r
                 
                 //                dev_kfree_skb(sc->lmc_txq[i]);
                 dev_kfree_skb_irq(sc->lmc_txq[i]);
-                sc->lmc_txq[i] = 0;
+                sc->lmc_txq[i] = NULL;
 
                 badtx++;
                 i = badtx % LMC_TXDESCS;
@@ -1667,7 +1667,7 @@ static int lmc_rx (struct net_device *dev) /*fold00*/
              */
         give_it_anyways:
 
-            sc->lmc_rxq[i] = 0x0;
+            sc->lmc_rxq[i] = NULL;
             sc->lmc_rxring[i].buffer1 = 0x0;
 
             skb_put (skb, len);
@@ -1965,7 +1965,7 @@ static void lmc_softreset (lmc_softc_t * const sc) /*fold00*/
             dev_kfree_skb(sc->lmc_txq[i]);	/* free it */
             sc->stats.tx_dropped++;      /* We just dropped a packet */
         }
-        sc->lmc_txq[i] = 0;
+        sc->lmc_txq[i] = NULL;
         sc->lmc_txring[i].status = 0x00000000;
         sc->lmc_txring[i].buffer2 = virt_to_bus (&sc->lmc_txring[i + 1]);
     }
diff --git a/drivers/net/wan/lmc/lmc_proto.c b/drivers/net/wan/lmc/lmc_proto.c
index de2e2258c..bb9f1eab7 100644
--- a/drivers/net/wan/lmc/lmc_proto.c
+++ b/drivers/net/wan/lmc/lmc_proto.c
@@ -112,7 +112,7 @@ void lmc_proto_attach(lmc_softc_t *sc) /*FOLD00*/
              * They set a few basics because they don't use sync_ppp
              */
             dev->flags |= IFF_POINTOPOINT;
-            dev->hard_header = 0;
+            dev->hard_header = NULL;
             dev->hard_header_len = 0;
             dev->addr_len = 0;
         }
diff --git a/drivers/net/wan/n2.c b/drivers/net/wan/n2.c
index 179b750cc..9dc4a8db2 100644
--- a/drivers/net/wan/n2.c
+++ b/drivers/net/wan/n2.c
@@ -254,7 +254,8 @@ static int n2_close(struct net_device *dev)
 static int n2_ioctl(struct net_device *dev, struct ifreq *ifr, int cmd)
 {
 	const size_t size = sizeof(sync_serial_settings);
-	sync_serial_settings new_line, *line = ifr->ifr_settings.ifs_ifsu.sync;
+	sync_serial_settings new_line;
+	sync_serial_settings __user *line = ifr->ifr_settings.ifs_ifsu.sync;
 	port_t *port = dev_to_port(dev);
 
 #ifdef DEBUG_RINGS
diff --git a/drivers/net/wan/pc300_tty.c b/drivers/net/wan/pc300_tty.c
index d8e3f537c..79d6894ac 100644
--- a/drivers/net/wan/pc300_tty.c
+++ b/drivers/net/wan/pc300_tty.c
@@ -264,7 +264,7 @@ void cpc_tty_init(pc300dev_t *pc300dev)
 	INIT_WORK(&cpc_tty->tty_tx_work, cpc_tty_tx_work, (void *)cpc_tty);
 	INIT_WORK(&cpc_tty->tty_rx_work, cpc_tty_rx_work, (void *)port);
 	
-	cpc_tty->buf_rx.first = cpc_tty->buf_rx.last = 0;
+	cpc_tty->buf_rx.first = cpc_tty->buf_rx.last = NULL;
 
 	pc300dev->cpc_tty = (void *)cpc_tty; 
 	
@@ -878,7 +878,7 @@ void cpc_tty_receive(pc300dev_t *pc300dev)
 				cpc_tty_trace(pc300dev, new->data,rx_len, 'R'); 
 			} 
 			new->size = rx_len;
-			new->next = 0;
+			new->next = NULL;
 			if (cpc_tty->buf_rx.first == 0) {
 				cpc_tty->buf_rx.first = new;
 				cpc_tty->buf_rx.last = new;
diff --git a/drivers/net/wan/pci200syn.c b/drivers/net/wan/pci200syn.c
index 899034164..0ea4b239e 100644
--- a/drivers/net/wan/pci200syn.c
+++ b/drivers/net/wan/pci200syn.c
@@ -204,7 +204,8 @@ static int pci200_close(struct net_device *dev)
 static int pci200_ioctl(struct net_device *dev, struct ifreq *ifr, int cmd)
 {
 	const size_t size = sizeof(sync_serial_settings);
-	sync_serial_settings new_line, *line = ifr->ifr_settings.ifs_ifsu.sync;
+	sync_serial_settings new_line;
+	sync_serial_settings __user *line = ifr->ifr_settings.ifs_ifsu.sync;
 	port_t *port = dev_to_port(dev);
 
 #ifdef DEBUG_RINGS
diff --git a/drivers/net/wan/sbni.c b/drivers/net/wan/sbni.c
index 311ac346f..8b1ef3e69 100644
--- a/drivers/net/wan/sbni.c
+++ b/drivers/net/wan/sbni.c
@@ -349,7 +349,7 @@ sbni_probe1( struct net_device  *dev,  unsigned long  ioaddr,  int  irq )
 
 	if( sbni_card_probe( ioaddr ) ) {
 		release_region( ioaddr, SBNI_IO_EXTENT );
-		return  0;
+		return NULL;
 	}
 
 	outb( 0, ioaddr + CSR0 );
@@ -368,7 +368,7 @@ sbni_probe1( struct net_device  *dev,  unsigned long  ioaddr,  int  irq )
 			printk( KERN_ERR "%s: can't detect device irq!\n",
 				dev->name );
 			release_region( ioaddr, SBNI_IO_EXTENT );
-			return  0;
+			return NULL;
 		}
 	} else if( irq == 2 )
 		irq = 9;
@@ -381,7 +381,7 @@ sbni_probe1( struct net_device  *dev,  unsigned long  ioaddr,  int  irq )
 	if( !nl ) {
 		printk( KERN_ERR "%s: unable to get memory!\n", dev->name );
 		release_region( ioaddr, SBNI_IO_EXTENT );
-		return  0;
+		return NULL;
 	}
 
 	dev->priv = nl;
@@ -1578,7 +1578,7 @@ calc_crc32( u32  crc,  u8  *p,  u32  len )
 	register u32  _crc;
 	_crc = crc;
 	
-	__asm __volatile (
+	__asm__ __volatile__ (
 		"xorl	%%ebx, %%ebx\n"
 		"movl	%2, %%esi\n" 
 		"movl	%3, %%ecx\n" 
diff --git a/drivers/net/wan/sbni.h b/drivers/net/wan/sbni.h
index 8e83e2748..27715e70f 100644
--- a/drivers/net/wan/sbni.h
+++ b/drivers/net/wan/sbni.h
@@ -6,7 +6,7 @@
 #ifndef SBNI_H
 #define SBNI_H
 
-#if SBNI_DEBUG
+#ifdef SBNI_DEBUG
 #define DP( A ) A
 #else
 #define DP( A )
diff --git a/drivers/net/wan/syncppp.c b/drivers/net/wan/syncppp.c
index 8cceec11d..f7442d52d 100644
--- a/drivers/net/wan/syncppp.c
+++ b/drivers/net/wan/syncppp.c
@@ -643,7 +643,7 @@ badreq:
 	case LCP_TERM_REQ:
 		sppp_clear_timeout (sp);
 		/* Send Terminate-Ack packet. */
-		sppp_cp_send (sp, PPP_LCP, LCP_TERM_ACK, h->ident, 0, 0);
+		sppp_cp_send (sp, PPP_LCP, LCP_TERM_ACK, h->ident, 0, NULL);
 		/* Go to closed state. */
 		sp->lcp.state = LCP_STATE_CLOSED;
 		sp->ipcp.state = IPCP_STATE_CLOSED;
@@ -1262,7 +1262,7 @@ static void sppp_ipcp_input (struct sppp *sp, struct sk_buff *skb)
 		} else {
 			/* Send Configure-Ack packet. */
 			sppp_cp_send (sp, PPP_IPCP, IPCP_CONF_ACK, h->ident,
-				0, 0);
+				0, NULL);
 			/* Change the state. */
 			if (sp->ipcp.state == IPCP_STATE_ACK_RCVD)
 				sp->ipcp.state = IPCP_STATE_OPENED;
@@ -1297,7 +1297,7 @@ static void sppp_ipcp_input (struct sppp *sp, struct sk_buff *skb)
 		break;
 	case IPCP_TERM_REQ:
 		/* Send Terminate-Ack packet. */
-		sppp_cp_send (sp, PPP_IPCP, IPCP_TERM_ACK, h->ident, 0, 0);
+		sppp_cp_send (sp, PPP_IPCP, IPCP_TERM_ACK, h->ident, 0, NULL);
 		/* Go to closed state. */
 		sp->ipcp.state = IPCP_STATE_CLOSED;
 		/* Initiate renegotiation. */
@@ -1332,7 +1332,7 @@ static void sppp_lcp_open (struct sppp *sp)
 static void sppp_ipcp_open (struct sppp *sp)
 {
 	sp->ipcp.confid = ++sp->pp_seq;
-	sppp_cp_send (sp, PPP_IPCP, IPCP_CONF_REQ, sp->ipcp.confid, 0, 0);
+	sppp_cp_send (sp, PPP_IPCP, IPCP_CONF_REQ, sp->ipcp.confid, 0, NULL);
 	sppp_set_timeout (sp, 2);
 }
 
diff --git a/drivers/net/wan/x25_asy.c b/drivers/net/wan/x25_asy.c
index 4243fea53..467ad7b8c 100644
--- a/drivers/net/wan/x25_asy.c
+++ b/drivers/net/wan/x25_asy.c
@@ -627,7 +627,7 @@ static void x25_asy_close_tty(struct tty_struct *tty)
 		(void) dev_close(sl->dev);
 	}
 
-	tty->disc_data = 0;
+	tty->disc_data = NULL;
 	sl->tty = NULL;
 	x25_asy_free(sl);
 }
@@ -733,7 +733,7 @@ static int x25_asy_ioctl(struct tty_struct *tty, struct file *file,
 
 	switch(cmd) {
 	case SIOCGIFNAME:
-		if (copy_to_user((void *)arg, sl->dev->name,
+		if (copy_to_user((void __user *)arg, sl->dev->name,
 					strlen(sl->dev->name) + 1))
 			return -EFAULT;
 		return 0;
diff --git a/drivers/net/wd.c b/drivers/net/wd.c
index e3fe0a70d..1f7a27c38 100644
--- a/drivers/net/wd.c
+++ b/drivers/net/wd.c
@@ -43,6 +43,8 @@ static const char version[] =
 
 #include "8390.h"
 
+#define DRV_NAME "wd"
+
 /* A zero-terminated list of I/O addresses to be probed. */
 static unsigned int wd_portlist[] __initdata =
 {0x300, 0x280, 0x380, 0x240, 0};
@@ -131,6 +133,7 @@ static void cleanup_card(struct net_device *dev)
 	release_region(dev->base_addr - WD_NIC_OFFSET, WD_IO_EXTENT);
 }
 
+#ifndef MODULE
 struct net_device * __init wd_probe(int unit)
 {
 	struct net_device *dev = alloc_ei_netdev();
@@ -155,6 +158,7 @@ out:
 	free_netdev(dev);
 	return ERR_PTR(err);
 }
+#endif
 
 static int __init wd_probe1(struct net_device *dev, int ioaddr)
 {
@@ -300,7 +304,7 @@ static int __init wd_probe1(struct net_device *dev, int ioaddr)
 
 	/* Snarf the interrupt now.  There's no point in waiting since we cannot
 	   share and the board will usually be enabled. */
-	i = request_irq(dev->irq, ei_interrupt, 0, dev->name, dev);
+	i = request_irq(dev->irq, ei_interrupt, 0, DRV_NAME, dev);
 	if (i) {
 		printk (" unable to get IRQ %d.\n", dev->irq);
 		return i;
diff --git a/drivers/net/wireless/Kconfig b/drivers/net/wireless/Kconfig
index baf531eb2..b1a30eeba 100644
--- a/drivers/net/wireless/Kconfig
+++ b/drivers/net/wireless/Kconfig
@@ -58,7 +58,7 @@ config STRIP
 
 config ARLAN
 	tristate "Aironet Arlan 655 & IC2200 DS support"
-	depends on NET_RADIO && ISA
+	depends on NET_RADIO && ISA && !64BIT
 	---help---
 	  Aironet makes Arlan, a class of wireless LAN adapters. These use the
 	  www.Telxon.com chip, which is also used on several similar cards.
@@ -139,7 +139,7 @@ comment "Wireless 802.11b ISA/PCI cards support"
 
 config AIRO
 	tristate "Cisco/Aironet 34X/35X/4500/4800 ISA and PCI cards"
-	depends on NET_RADIO && (ISA || PCI)
+	depends on NET_RADIO && ISA && (PCI || BROKEN)
 	---help---
 	  This is the standard Linux driver to support Cisco/Aironet ISA and
 	  PCI 802.11 wireless cards.
diff --git a/drivers/net/wireless/airo.c b/drivers/net/wireless/airo.c
index 57ef2ac72..8d38c1803 100644
--- a/drivers/net/wireless/airo.c
+++ b/drivers/net/wireless/airo.c
@@ -101,7 +101,7 @@ static struct pci_driver airo_driver = {
    infront of the label, that statistic will not be included in the list
    of statistics in the /proc filesystem */
 
-#define IGNLABEL(comment) 0
+#define IGNLABEL(comment) NULL
 static char *statsLabels[] = {
 	"RxOverrun",
 	IGNLABEL("RxPlcpCrcErr"),
@@ -1209,6 +1209,8 @@ struct airo_info {
 	SsidRid			*SSID;
 	APListRid		*APList;
 #define	PCI_SHARED_LEN		2*MPI_MAX_FIDS*PKTSIZE+RIDSIZE
+	u32			pci_state[16];
+	char			proc_name[IFNAMSIZ];
 };
 
 static inline int bap_read(struct airo_info *ai, u16 *pu16Dst, int bytelen,
@@ -1963,7 +1965,7 @@ static int mpi_send_packet (struct net_device *dev)
 
 	if ((skb = skb_dequeue(&ai->txq)) == 0) {
 		printk (KERN_ERR
-			"airo_mpi: %s: Dequeue'd zero in send_packet()\n",
+			"airo: %s: Dequeue'd zero in send_packet()\n",
 			__FUNCTION__);
 		return 0;
 	}
@@ -2345,7 +2347,7 @@ void stop_airo_card( struct net_device *dev, int freeres )
 		if (ai->wifidev) {
 			unregister_netdev(ai->wifidev);
 			free_netdev(ai->wifidev);
-			ai->wifidev = 0;
+			ai->wifidev = NULL;
 		}
 		clear_bit(FLAG_REGISTERED, &ai->flags);
 	}
@@ -2357,7 +2359,7 @@ void stop_airo_card( struct net_device *dev, int freeres )
 	 * Clean out tx queue
 	 */
 	if (test_bit(FLAG_MPI, &ai->flags) && skb_queue_len (&ai->txq) > 0) {
-		struct sk_buff *skb = 0;
+		struct sk_buff *skb = NULL;
 		for (;(skb = skb_dequeue(&ai->txq));)
 			dev_kfree_skb(skb);
 	}
@@ -2613,10 +2615,10 @@ static int mpi_map_card(struct airo_info *ai, struct pci_dev *pci,
 
 static void wifi_setup(struct net_device *dev)
 {
-	dev->hard_header        = 0;
-	dev->rebuild_header     = 0;
-	dev->hard_header_cache  = 0;
-	dev->header_cache_update= 0;
+	dev->hard_header        = NULL;
+	dev->rebuild_header     = NULL;
+	dev->hard_header_cache  = NULL;
+	dev->header_cache_update= NULL;
 
 	dev->hard_header_parse  = wll_header_parse;
 	dev->hard_start_xmit = &airo_start_xmit11;
@@ -2697,7 +2699,7 @@ struct net_device *_init_airo_card( unsigned short irq, int port,
 	}
 
 	ai = dev->priv;
-	ai->wifidev = 0;
+	ai->wifidev = NULL;
 	ai->flags = 0;
 	if (pci && (pci->device == 0x5000 || pci->device == 0xa504)) {
 		printk(KERN_DEBUG "airo: Found an MPI350 card\n");
@@ -2745,6 +2747,9 @@ struct net_device *_init_airo_card( unsigned short irq, int port,
 		SET_NETDEV_DEV(dev, &pci->dev);
 	}
 
+	if (test_bit(FLAG_MPI,&ai->flags))
+		reset_card (dev, 1);
+
 	rc = request_irq( dev->irq, airo_interrupt, SA_SHIRQ, dev->name, dev );
 	if (rc) {
 		printk(KERN_ERR "airo: register interrupt %d failed, rc %d\n", irq, rc );
@@ -2824,7 +2829,7 @@ err_out_free:
 
 struct net_device *init_airo_card( unsigned short irq, int port, int is_pcmcia )
 {
-	return _init_airo_card ( irq, port, is_pcmcia, 0);
+	return _init_airo_card ( irq, port, is_pcmcia, NULL);
 }
 
 EXPORT_SYMBOL(init_airo_card);
@@ -3158,11 +3163,12 @@ static irqreturn_t airo_interrupt ( int irq, void* dev_id, struct pt_regs *regs)
 			} else
 				hdrlen = ETH_ALEN * 2;
 
-			skb = dev_alloc_skb( len + hdrlen + 2 );
+			skb = dev_alloc_skb( len + hdrlen + 2 + 2 );
 			if ( !skb ) {
 				apriv->stats.rx_dropped++;
 				goto badrx;
 			}
+			skb_reserve(skb, 2); /* This way the IP header is aligned */
 			buffer = (u16*)skb_put (skb, len + hdrlen);
 			if (test_bit(FLAG_802_11, &apriv->flags)) {
 				buffer[0] = fc;
@@ -4047,7 +4053,8 @@ static int PC4500_writerid(struct airo_info *ai, u16 rid,
 		Resp rsp;
 
 		if (test_bit(FLAG_ENABLED, &ai->flags))
-			printk(KERN_ERR "%s: MAC should be disabled (rid=%d)\n",
+			printk(KERN_ERR
+				"%s: MAC should be disabled (rid=%04x)\n",
 				__FUNCTION__, rid);
 		memset(&cmd, 0, sizeof(cmd));
 		memset(&rsp, 0, sizeof(rsp));
@@ -4344,7 +4351,7 @@ static struct file_operations proc_wepkey_ops = {
 	.release	= proc_close
 };
 
-static struct proc_dir_entry *airo_entry = 0;
+static struct proc_dir_entry *airo_entry;
 
 struct proc_data {
 	int release_buffer;
@@ -4364,7 +4371,8 @@ static int setup_proc_entry( struct net_device *dev,
 			     struct airo_info *apriv ) {
 	struct proc_dir_entry *entry;
 	/* First setup the device directory */
-	apriv->proc_entry = create_proc_entry(dev->name,
+	strcpy(apriv->proc_name,dev->name);
+	apriv->proc_entry = create_proc_entry(apriv->proc_name,
 					      S_IFDIR|airo_perm,
 					      airo_entry);
         apriv->proc_entry->uid = proc_uid;
@@ -4465,7 +4473,7 @@ static int takedown_proc_entry( struct net_device *dev,
 	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);
+	remove_proc_entry(apriv->proc_name,airo_entry);
 	return 0;
 }
 
@@ -4500,6 +4508,8 @@ static ssize_t proc_read( struct file *file,
 		len = priv->readlen - pos;
 	if (copy_to_user(buffer, priv->rbuffer + pos, len))
 		return -EFAULT;
+	if (pos + len > priv->writelen)
+		priv->writelen = pos + len;
 	*offset = pos + len;
 	return len;
 }
@@ -4527,6 +4537,8 @@ static ssize_t proc_write( struct file *file,
 		len = priv->maxwritelen - pos;
 	if (copy_from_user(priv->wbuffer + pos, buffer, len))
 		return -EFAULT;
+	if ( pos + len > priv->writelen )
+		priv->writelen = len + file->f_pos;
 	*offset = pos + len;
 	return len;
 }
@@ -5127,7 +5139,7 @@ static void proc_wepkey_on_close( struct inode *inode, struct file *file ) {
 	    (data->wbuffer[1] == ' ' || data->wbuffer[1] == '\n')) {
 		index = data->wbuffer[0] - '0';
 		if (data->wbuffer[1] == '\n') {
-			set_wep_key(ai, index, 0, 0, 1, 1);
+			set_wep_key(ai, index, NULL, 0, 1, 1);
 			return;
 		}
 		j = 2;
@@ -5312,8 +5324,8 @@ static int proc_BSSList_open( struct inode *inode, struct file *file ) {
 	}
 	data->writelen = 0;
 	data->maxwritelen = 0;
-	data->wbuffer = 0;
-	data->on_close = 0;
+	data->wbuffer = NULL;
+	data->on_close = NULL;
 
 	if (file->f_mode & FMODE_WRITE) {
 		if (!(file->f_mode & FMODE_READ)) {
@@ -5374,7 +5386,7 @@ static int proc_close( struct inode *inode, struct file *file )
 static struct net_device_list {
 	struct net_device *dev;
 	struct net_device_list *next;
-} *airo_devices = 0;
+} *airo_devices;
 
 /* Since the card doesn't automatically switch to the right WEP mode,
    we will make it do it.  If the card isn't associated, every secs we
@@ -5395,13 +5407,13 @@ static void timer_func( struct net_device *dev ) {
 			break;
 		case AUTH_SHAREDKEY:
 			if (apriv->keyindex < auto_wep) {
-				set_wep_key(apriv, apriv->keyindex, 0, 0, 0, 0);
+				set_wep_key(apriv, apriv->keyindex, NULL, 0, 0, 0);
 				apriv->config.authType = AUTH_SHAREDKEY;
 				apriv->keyindex++;
 			} else {
 			        /* Drop to ENCRYPT */
 				apriv->keyindex = 0;
-				set_wep_key(apriv, apriv->defindex, 0, 0, 0, 0);
+				set_wep_key(apriv, apriv->defindex, NULL, 0, 0, 0);
 				apriv->config.authType = AUTH_ENCRYPT;
 			}
 			break;
@@ -5470,9 +5482,6 @@ static int airo_pci_suspend(struct pci_dev *pdev, u32 state)
 	Cmd cmd;
 	Resp rsp;
 
-	printk(KERN_DEBUG "%s: airo_mpi entering sleep mode (state=%d)\n",
-	       dev->name, state);
-
 	if ((ai->APList == NULL) &&
 		(ai->APList = kmalloc(sizeof(APListRid), GFP_KERNEL)) == NULL)
 		return -ENOMEM;
@@ -5490,7 +5499,10 @@ static int airo_pci_suspend(struct pci_dev *pdev, u32 state)
 	ai->power = state;
 	cmd.cmd=HOSTSLEEP;
 	issuecommand(ai, &cmd, &rsp);
-	return 0;
+
+	pci_enable_wake(pdev, state, 1);
+	pci_save_state(pdev, ai->pci_state);
+	return pci_set_power_state(pdev, state);
 }
 
 static int airo_pci_resume(struct pci_dev *pdev)
@@ -5499,12 +5511,12 @@ static int airo_pci_resume(struct pci_dev *pdev)
 	struct airo_info *ai = dev->priv;
 	Resp rsp;
 
-	printk(KERN_DEBUG "%s: airo_mpi waking up\n", dev->name);
-
-	if (!ai->power)
-		return 0;
+	pci_set_power_state(pdev, 0);
+	pci_restore_state(pdev, ai->pci_state);
+	pci_enable_wake(pdev, ai->power, 0);
 
 	if (ai->power > 1) {
+		reset_card(dev, 0);
 		mpi_init_descriptors(ai);
 		setup_card(ai, dev->dev_addr, 0);
 		clear_bit(FLAG_RADIO_OFF, &ai->flags);
@@ -6195,7 +6207,7 @@ static int airo_set_encode(struct net_device *dev,
 		/* Do we want to just set the transmit key index ? */
 		int index = (dwrq->flags & IW_ENCODE_INDEX) - 1;
 		if ((index >= 0) && (index < ((cap_rid.softCap & 0x80)?4:1))) {
-			set_wep_key(local, index, 0, 0, 1, 1);
+			set_wep_key(local, index, NULL, 0, 1, 1);
 		} else
 			/* Don't complain if only change the mode */
 			if(!dwrq->flags & IW_ENCODE_MODE) {
@@ -7166,6 +7178,7 @@ static int readrids(struct net_device *dev, aironet_ioctl *comp) {
 	unsigned char *iobuf;
 	int len;
 	struct airo_info *ai = dev->priv;
+	Resp rsp;
 
 	if (test_bit(FLAG_FLASHING, &ai->flags))
 		return -EIO;
@@ -7173,8 +7186,11 @@ static int readrids(struct net_device *dev, aironet_ioctl *comp) {
 	switch(comp->command)
 	{
 	case AIROGCAP:      ridcode = RID_CAPABILITIES; break;
-	case AIROGCFG: writeConfigRid (ai, 1);
-			    ridcode = RID_CONFIG;       break;
+	case AIROGCFG:      ridcode = RID_CONFIG;
+		disable_MAC (ai, 1);
+		writeConfigRid (ai, 1);
+		enable_MAC (ai, &rsp, 1);
+		break;
 	case AIROGSLIST:    ridcode = RID_SSID;         break;
 	case AIROGVLIST:    ridcode = RID_APLIST;       break;
 	case AIROGDRVNAM:   ridcode = RID_DRVNAME;      break;
@@ -7562,6 +7578,11 @@ int flashrestart(struct airo_info *ai,struct net_device *dev){
 	set_current_state (TASK_UNINTERRUPTIBLE);
 	schedule_timeout (HZ);          /* Added 12/7/00 */
 	clear_bit (FLAG_FLASHING, &ai->flags);
+	if (test_bit(FLAG_MPI, &ai->flags)) {
+		status = mpi_init_descriptors(ai);
+		if (status != SUCCESS)
+			return status;
+	}
 	status = setup_card(ai, dev->dev_addr, 1);
 
 	if (!test_bit(FLAG_MPI,&ai->flags))
diff --git a/drivers/net/wireless/airo_cs.c b/drivers/net/wireless/airo_cs.c
index 0c26c8124..6f3d7c25a 100644
--- a/drivers/net/wireless/airo_cs.c
+++ b/drivers/net/wireless/airo_cs.c
@@ -270,7 +270,7 @@ static void airo_detach(dev_link_t *link)
 	if ( ((local_info_t*)link->priv)->eth_dev ) {
 		stop_airo_card( ((local_info_t*)link->priv)->eth_dev, 0 );
 	}
-	((local_info_t*)link->priv)->eth_dev = 0;   
+	((local_info_t*)link->priv)->eth_dev = NULL;   
 	
 	/* Break the link with Card Services */
 	if (link->handle)
diff --git a/drivers/net/wireless/airport.c b/drivers/net/wireless/airport.c
index b2ad9cd94..20bd0dfef 100644
--- a/drivers/net/wireless/airport.c
+++ b/drivers/net/wireless/airport.c
@@ -139,7 +139,7 @@ airport_detach(struct macio_dev *mdev)
 
 	if (card->vaddr)
 		iounmap(card->vaddr);
-	card->vaddr = 0;
+	card->vaddr = NULL;
 
 	macio_release_resource(mdev, 0);
 
diff --git a/drivers/net/wireless/arlan-proc.c b/drivers/net/wireless/arlan-proc.c
index 7fa36627d..86da31cac 100644
--- a/drivers/net/wireless/arlan-proc.c
+++ b/drivers/net/wireless/arlan-proc.c
@@ -399,7 +399,7 @@ static int arlan_setup_card_by_book(struct net_device *dev)
 static char arlan_drive_info[ARLAN_STR_SIZE] = "A655\n\0";
 
 static int arlan_sysctl_info(ctl_table * ctl, int write, struct file *filp,
-		      void *buffer, size_t * lenp)
+		      void __user *buffer, size_t * lenp, loff_t *ppos)
 {
 	int i;
 	int retv, pos, devnum;
@@ -625,7 +625,7 @@ final:
 	*lenp = pos;
 
 	if (!write)
-		retv = proc_dostring(ctl, write, filp, buffer, lenp);
+		retv = proc_dostring(ctl, write, filp, buffer, lenp, ppos);
 	else
 	{
 		*lenp = 0;
@@ -636,7 +636,7 @@ final:
 
 
 static int arlan_sysctl_info161719(ctl_table * ctl, int write, struct file *filp,
-			    void *buffer, size_t * lenp)
+			    void __user *buffer, size_t * lenp, loff_t *ppos)
 {
 	int i;
 	int retv, pos, devnum;
@@ -665,12 +665,12 @@ static int arlan_sysctl_info161719(ctl_table * ctl, int write, struct file *filp
 
 final:
 	*lenp = pos;
-	retv = proc_dostring(ctl, write, filp, buffer, lenp);
+	retv = proc_dostring(ctl, write, filp, buffer, lenp, ppos);
 	return retv;
 }
 
 static int arlan_sysctl_infotxRing(ctl_table * ctl, int write, struct file *filp,
-			    void *buffer, size_t * lenp)
+			    void __user *buffer, size_t * lenp, loff_t *ppos)
 {
 	int i;
 	int retv, pos, devnum;
@@ -694,12 +694,12 @@ static int arlan_sysctl_infotxRing(ctl_table * ctl, int write, struct file *filp
 	SARLBNpln(u_char, txBuffer, 0x800);
 final:
 	*lenp = pos;
-	retv = proc_dostring(ctl, write, filp, buffer, lenp);
+	retv = proc_dostring(ctl, write, filp, buffer, lenp, ppos);
 	return retv;
 }
 
 static int arlan_sysctl_inforxRing(ctl_table * ctl, int write, struct file *filp,
-			    void *buffer, size_t * lenp)
+			    void __user *buffer, size_t * lenp, loff_t *ppos)
 {
 	int i;
 	int retv, pos, devnum;
@@ -722,12 +722,12 @@ static int arlan_sysctl_inforxRing(ctl_table * ctl, int write, struct file *filp
 	SARLBNpln(u_char, rxBuffer, 0x800);
 final:
 	*lenp = pos;
-	retv = proc_dostring(ctl, write, filp, buffer, lenp);
+	retv = proc_dostring(ctl, write, filp, buffer, lenp, ppos);
 	return retv;
 }
 
 static int arlan_sysctl_info18(ctl_table * ctl, int write, struct file *filp,
-			void *buffer, size_t * lenp)
+			void __user *buffer, size_t * lenp, loff_t *ppos)
 {
 	int i;
 	int retv, pos, devnum;
@@ -752,7 +752,7 @@ static int arlan_sysctl_info18(ctl_table * ctl, int write, struct file *filp,
 
 final:
 	*lenp = pos;
-	retv = proc_dostring(ctl, write, filp, buffer, lenp);
+	retv = proc_dostring(ctl, write, filp, buffer, lenp, ppos);
 	return retv;
 }
 
@@ -763,7 +763,7 @@ final:
 static char conf_reset_result[200];
 
 static int arlan_configure(ctl_table * ctl, int write, struct file *filp,
-		    void *buffer, size_t * lenp)
+		    void __user *buffer, size_t * lenp, loff_t *ppos)
 {
 	int pos = 0;
 	int devnum = ctl->procname[6] - '0';
@@ -784,11 +784,11 @@ static int arlan_configure(ctl_table * ctl, int write, struct file *filp,
 		return -1;
 
 	*lenp = pos;
-	return proc_dostring(ctl, write, filp, buffer, lenp);
+	return proc_dostring(ctl, write, filp, buffer, lenp, ppos);
 }
 
 static int arlan_sysctl_reset(ctl_table * ctl, int write, struct file *filp,
-		       void *buffer, size_t * lenp)
+		       void __user *buffer, size_t * lenp, loff_t *ppos)
 {
 	int pos = 0;
 	int devnum = ctl->procname[5] - '0';
@@ -807,7 +807,7 @@ static int arlan_sysctl_reset(ctl_table * ctl, int write, struct file *filp,
 	} else
 		return -1;
 	*lenp = pos + 3;
-	return proc_dostring(ctl, write, filp, buffer, lenp);
+	return proc_dostring(ctl, write, filp, buffer, lenp, ppos);
 }
 
 
diff --git a/drivers/net/wireless/arlan.h b/drivers/net/wireless/arlan.h
index eacf37fdd..a48af699c 100644
--- a/drivers/net/wireless/arlan.h
+++ b/drivers/net/wireless/arlan.h
@@ -52,7 +52,6 @@ extern int	arlan_debug;
 extern int	arlan_entry_debug;
 extern int	arlan_exit_debug;
 extern int	testMemory;
-extern const char* arlan_version;
 extern int     arlan_command(struct net_device * dev, int command);
  
 #define SIDUNKNOWN -1
diff --git a/drivers/net/wireless/atmel.c b/drivers/net/wireless/atmel.c
index 67cbbb71a..cde68a443 100644
--- a/drivers/net/wireless/atmel.c
+++ b/drivers/net/wireless/atmel.c
@@ -1599,7 +1599,7 @@ struct net_device *init_atmel_card( unsigned short irq, int port, char *firmware
 	
 	netif_carrier_off(dev);
 	
-	create_proc_read_entry ("driver/atmel", 0, 0, atmel_read_proc, priv);	
+	create_proc_read_entry ("driver/atmel", 0, NULL, atmel_read_proc, priv);	
 	
 	printk(KERN_INFO "%s: Atmel at76c50x wireless. Version %d.%d simon@thekelleys.org.uk\n",
 	       dev->name, DRIVER_MAJOR, DRIVER_MINOR);
@@ -2360,7 +2360,7 @@ static const iw_handler		atmel_private_handler[] =
 
 typedef struct atmel_priv_ioctl {
 	char id[32];
-	unsigned char *data;		
+	unsigned char __user *data;		
 	unsigned short len;		
 } atmel_priv_ioctl;
 
@@ -2647,12 +2647,12 @@ static void send_authentication_request(struct atmel_private *priv, u8 *challeng
 	memcpy(header.addr3, priv->CurrentBSSID, 6);
 	
 	if (priv->wep_is_on) {
-		auth.alg = C80211_MGMT_AAN_SHAREDKEY; 
+		auth.alg = cpu_to_le16(C80211_MGMT_AAN_SHAREDKEY); 
 		/* no WEP for authentication frames with TrSeqNo 1 */
 		if (priv->CurrentAuthentTransactionSeqNum != 1)
 			header.frame_ctl |=  cpu_to_le16(IEEE802_11_FCTL_WEP); 
 	} else {
-		auth.alg = C80211_MGMT_AAN_OPENSYSTEM;
+		auth.alg = cpu_to_le16(C80211_MGMT_AAN_OPENSYSTEM);
 	}
 
 	auth.status = 0;
diff --git a/drivers/net/wireless/atmel_cs.c b/drivers/net/wireless/atmel_cs.c
index 06b09a032..c3c561fd9 100644
--- a/drivers/net/wireless/atmel_cs.c
+++ b/drivers/net/wireless/atmel_cs.c
@@ -348,9 +348,19 @@ static struct {
 };
 
 /* This is strictly temporary, until PCMCIA devices get integrated into the device model. */
-static struct device atmel_device = {
-        .bus_id    = "pcmcia",
-};
+static struct device *atmel_device(void)
+{
+	static char *kobj_name = "atmel_cs";
+
+	static struct device dev = {
+		.bus_id    = "pcmcia",
+	};
+	dev.kobj.k_name = kmalloc(strlen(kobj_name)+1, GFP_KERNEL);
+	strcpy(dev.kobj.k_name, kobj_name);
+	kobject_init(&dev.kobj);
+	
+	return &dev;
+}
 
 static void atmel_config(dev_link_t *link)
 {
@@ -537,12 +547,12 @@ static void atmel_config(dev_link_t *link)
 		       "atmel: cannot assign IRQ: check that CONFIG_ISA is set in kernel config.");
 		goto cs_failed;
 	}
-	
+       
 	((local_info_t*)link->priv)->eth_dev = 
 		init_atmel_card(link->irq.AssignedIRQ,
 				link->io.BasePort1,
 				card_index == -1 ? NULL :  card_table[card_index].firmware,
-				&atmel_device,
+				atmel_device(),
 				card_present, 
 				link);
 	if (!((local_info_t*)link->priv)->eth_dev) 
@@ -602,7 +612,7 @@ static void atmel_release(dev_link_t *link)
 	
 	if (dev) 
 		stop_atmel_card(dev, 0);
-	((local_info_t*)link->priv)->eth_dev = 0; 
+	((local_info_t*)link->priv)->eth_dev = NULL; 
 	
 	/* Don't bother checking to see if these succeed or not */
 	pcmcia_release_configuration(link->handle);
diff --git a/drivers/net/wireless/orinoco.c b/drivers/net/wireless/orinoco.c
index 11af4300a..8161a1c00 100644
--- a/drivers/net/wireless/orinoco.c
+++ b/drivers/net/wireless/orinoco.c
@@ -1519,7 +1519,8 @@ static void __orinoco_ev_wterr(struct net_device *dev, hermes_t *hw)
 
 static void __orinoco_ev_infdrop(struct net_device *dev, hermes_t *hw)
 {
-	printk(KERN_WARNING "%s: Information frame lost.\n", dev->name);
+	if (net_ratelimit())
+		printk(KERN_WARNING "%s: Information frame lost.\n", dev->name);
 }
 
 static void print_linkstatus(struct net_device *dev, u16 status)
diff --git a/drivers/net/wireless/orinoco_pci.c b/drivers/net/wireless/orinoco_pci.c
index fb1ebf409..23222b951 100644
--- a/drivers/net/wireless/orinoco_pci.c
+++ b/drivers/net/wireless/orinoco_pci.c
@@ -384,7 +384,7 @@ static int __init orinoco_pci_init(void)
 	return pci_module_init(&orinoco_pci_driver);
 }
 
-extern void __exit orinoco_pci_exit(void)
+void __exit orinoco_pci_exit(void)
 {
 	pci_unregister_driver(&orinoco_pci_driver);
 }
diff --git a/drivers/net/wireless/orinoco_plx.c b/drivers/net/wireless/orinoco_plx.c
index 0fcf84689..b5660defd 100644
--- a/drivers/net/wireless/orinoco_plx.c
+++ b/drivers/net/wireless/orinoco_plx.c
@@ -324,8 +324,6 @@ static struct pci_driver orinoco_plx_driver = {
 	.id_table	= orinoco_plx_pci_id_table,
 	.probe		= orinoco_plx_init_one,
 	.remove		= __devexit_p(orinoco_plx_remove_one),
-	.suspend	= 0,
-	.resume		= 0,
 };
 
 static char version[] __initdata = "orinoco_plx.c 0.13e (Daniel Barlow <dan@telent.net>, David Gibson <hermes@gibson.dropbear.id.au>)";
@@ -341,7 +339,7 @@ static int __init orinoco_plx_init(void)
 	return pci_module_init(&orinoco_plx_driver);
 }
 
-extern void __exit orinoco_plx_exit(void)
+void __exit orinoco_plx_exit(void)
 {
 	pci_unregister_driver(&orinoco_plx_driver);
 	current->state = TASK_UNINTERRUPTIBLE;
diff --git a/drivers/net/wireless/orinoco_tmd.c b/drivers/net/wireless/orinoco_tmd.c
index 6e5ca46e8..56ab51cf5 100644
--- a/drivers/net/wireless/orinoco_tmd.c
+++ b/drivers/net/wireless/orinoco_tmd.c
@@ -202,8 +202,6 @@ static struct pci_driver orinoco_tmd_driver = {
 	.id_table	= orinoco_tmd_pci_id_table,
 	.probe		= orinoco_tmd_init_one,
 	.remove		= __devexit_p(orinoco_tmd_remove_one),
-	.suspend	= 0,
-	.resume		= 0,
 };
 
 static char version[] __initdata = "orinoco_tmd.c 0.01 (Joerg Dorchain <joerg@dorchain.net>)";
@@ -219,7 +217,7 @@ static int __init orinoco_tmd_init(void)
 	return pci_module_init(&orinoco_tmd_driver);
 }
 
-extern void __exit orinoco_tmd_exit(void)
+void __exit orinoco_tmd_exit(void)
 {
 	pci_unregister_driver(&orinoco_tmd_driver);
 	current->state = TASK_UNINTERRUPTIBLE;
diff --git a/drivers/net/wireless/prism54/isl_38xx.c b/drivers/net/wireless/prism54/isl_38xx.c
index 2e669a643..3ee31021f 100644
--- a/drivers/net/wireless/prism54/isl_38xx.c
+++ b/drivers/net/wireless/prism54/isl_38xx.c
@@ -18,24 +18,16 @@
  *
  */
 
-#define __KERNEL_SYSCALLS__
-
 #include <linux/version.h>
 #include <linux/module.h>
 #include <linux/types.h>
 #include <linux/delay.h>
 
-#include "isl_38xx.h"
-#include <linux/firmware.h>
-
 #include <asm/uaccess.h>
 #include <asm/io.h>
 
-#include <linux/config.h>
-#if !defined(CONFIG_FW_LOADER) && !defined(CONFIG_FW_LOADER_MODULE)
-#error No Firmware Loading configured in the kernel !
-#endif
-
+#include "prismcompat.h"
+#include "isl_38xx.h"
 #include "islpci_dev.h"
 #include "islpci_mgt.h"
 
@@ -235,130 +227,6 @@ isl38xx_enable_common_interrupts(void *device_base) {
 	udelay(ISL38XX_WRITEIO_DELAY);
 }
 
-int
-isl38xx_upload_firmware(char *fw_id, _REQ_FW_DEV_T dev, void *device_base,
-			dma_addr_t host_address)
-{
-	u32 reg, rc;
-
-#if VERBOSE > SHOW_ERROR_MESSAGES
-	DEBUG(SHOW_ERROR_MESSAGES, "isl38xx_upload_firmware(0x%lx, 0x%lx)\n",
-	      (long) device_base, (long) host_address);
-#endif
-
-	/* clear the RAMBoot and the Reset bit */
-	reg = readl(device_base + ISL38XX_CTRL_STAT_REG);
-	reg &= ~ISL38XX_CTRL_STAT_RESET;
-	reg &= ~ISL38XX_CTRL_STAT_RAMBOOT;
-	writel(reg, device_base + ISL38XX_CTRL_STAT_REG);
-	wmb();
-	udelay(ISL38XX_WRITEIO_DELAY);
-
-	/* set the Reset bit without reading the register ! */
-	reg |= ISL38XX_CTRL_STAT_RESET;
-	writel(reg, device_base + ISL38XX_CTRL_STAT_REG);
-	wmb();
-	udelay(ISL38XX_WRITEIO_DELAY);
-
-	/* clear the Reset bit */
-	reg &= ~ISL38XX_CTRL_STAT_RESET;
-	writel(reg, device_base + ISL38XX_CTRL_STAT_REG);
-	wmb();
-
-	/* wait a while for the device to reboot */
-	mdelay(50);
-
-	{
-		const struct firmware *fw_entry = 0;
-		long fw_len;
-		const u32 *fw_ptr;
-
-		rc = request_firmware(&fw_entry, fw_id, dev);
-		if (rc) {
-			printk(KERN_ERR
-			       "%s: request_firmware() failed for '%s'\n",
-			       "prism54", fw_id);
-			return rc;
-		}
-		/* prepare the Direct Memory Base register */
-		reg = ISL38XX_DEV_FIRMWARE_ADDRES;
-
-		fw_ptr = (u32 *) fw_entry->data;
-		fw_len = fw_entry->size;
-
-		if (fw_len % 4) {
-			printk(KERN_ERR
-			       "%s: firmware '%s' size is not multiple of 32bit, aborting!\n",
-			       "prism54", fw_id);
-			release_firmware(fw_entry);
-			return EILSEQ; /* Illegal byte sequence  */;
-		}
-
-		while (fw_len > 0) {
-			long _fw_len =
-			    (fw_len >
-			     ISL38XX_MEMORY_WINDOW_SIZE) ?
-			    ISL38XX_MEMORY_WINDOW_SIZE : fw_len;
-			u32 *dev_fw_ptr = device_base + ISL38XX_DIRECT_MEM_WIN;
-
-			/* set the cards base address for writting the data */
-			isl38xx_w32_flush(device_base, reg,
-					  ISL38XX_DIR_MEM_BASE_REG);
-			wmb();	/* be paranoid */
-
-			/* increment the write address for next iteration */
-			reg += _fw_len;
-			fw_len -= _fw_len;
-
-			/* write the data to the Direct Memory Window 32bit-wise */
-			/* memcpy_toio() doesn't guarantee 32bit writes :-| */
-			while (_fw_len > 0) {
-				/* use non-swapping writel() */
-				__raw_writel(*fw_ptr, dev_fw_ptr);
-				fw_ptr++, dev_fw_ptr++;
-				_fw_len -= 4;
-			}
-
-			/* flush PCI posting */
-			(void) readl(device_base + ISL38XX_PCI_POSTING_FLUSH);
-			wmb();	/* be paranoid again */
-
-			BUG_ON(_fw_len != 0);
-		}
-
-		BUG_ON(fw_len != 0);
-
-		release_firmware(fw_entry);
-	}
-
-	/* now reset the device
-	 * clear the Reset & ClkRun bit, set the RAMBoot bit */
-	reg = readl(device_base + ISL38XX_CTRL_STAT_REG);
-	reg &= ~ISL38XX_CTRL_STAT_CLKRUN;
-	reg &= ~ISL38XX_CTRL_STAT_RESET;
-	reg |= ISL38XX_CTRL_STAT_RAMBOOT;
-	isl38xx_w32_flush(device_base, reg, ISL38XX_CTRL_STAT_REG);
-	wmb();
-	udelay(ISL38XX_WRITEIO_DELAY);
-
-	/* set the reset bit latches the host override and RAMBoot bits
-	 * into the device for operation when the reset bit is reset */
-	reg |= ISL38XX_CTRL_STAT_RESET;
-	writel(reg, device_base + ISL38XX_CTRL_STAT_REG);
-	/* don't do flush PCI posting here! */
-	wmb();
-	udelay(ISL38XX_WRITEIO_DELAY);
-
-	/* clear the reset bit should start the whole circus */
-	reg &= ~ISL38XX_CTRL_STAT_RESET;
-	writel(reg, device_base + ISL38XX_CTRL_STAT_REG);
-	/* don't do flush PCI posting here! */
-	wmb();
-	udelay(ISL38XX_WRITEIO_DELAY);
-
-	return 0;
-}
-
 int
 isl38xx_in_queue(isl38xx_control_block *cb, int queue)
 {
diff --git a/drivers/net/wireless/prism54/isl_38xx.h b/drivers/net/wireless/prism54/isl_38xx.h
index 5f644836f..0bd5ff6ad 100644
--- a/drivers/net/wireless/prism54/isl_38xx.h
+++ b/drivers/net/wireless/prism54/isl_38xx.h
@@ -22,14 +22,6 @@
 
 #include <linux/version.h>
 #include <asm/io.h>
-
-#if (LINUX_VERSION_CODE > KERNEL_VERSION(2,5,75))
-#include <linux/device.h>
-# define _REQ_FW_DEV_T struct device *
-#else
-# define _REQ_FW_DEV_T char *
-#endif
-
 #include <asm/byteorder.h>
 
 #define ISL38XX_CB_RX_QSIZE                     8
@@ -174,6 +166,4 @@ void isl38xx_handle_wakeup(isl38xx_control_block *, int *, void *);
 void isl38xx_trigger_device(int, void *);
 void isl38xx_interface_reset(void *, dma_addr_t);
 
-int isl38xx_upload_firmware(char *, _REQ_FW_DEV_T, void *, dma_addr_t);
-
 #endif				/* _ISL_38XX_H */
diff --git a/drivers/net/wireless/prism54/isl_ioctl.c b/drivers/net/wireless/prism54/isl_ioctl.c
index 426fc2e3e..7924b36a7 100644
--- a/drivers/net/wireless/prism54/isl_ioctl.c
+++ b/drivers/net/wireless/prism54/isl_ioctl.c
@@ -25,10 +25,10 @@
 #include <linux/kernel.h>
 #include <linux/if_arp.h>
 #include <linux/pci.h>
-#include <linux/moduleparam.h>
 
 #include <asm/uaccess.h>
 
+#include "prismcompat.h"
 #include "isl_ioctl.h"
 #include "islpci_mgt.h"
 #include "isl_oid.h"		/* additional types and defs for isl38xx fw */
@@ -166,21 +166,13 @@ prism54_mib_init(islpci_private *priv)
 	 * for it save old values */
 	if (init_mode > IW_MODE_MONITOR || init_mode < IW_MODE_AUTO) {
 		printk(KERN_DEBUG "%s(): You passed a non-valid init_mode. "
-				"Using default mode\n", __FUNCTION__);
+		       "Using default mode\n", __FUNCTION__);
 		init_mode = CARD_DEFAULT_IW_MODE;
 	}
 	/* This sets all of the mode-dependent values */
 	prism54_mib_mode_helper(priv, init_mode);
 }
 
-void
-prism54_mib_init_work(islpci_private *priv)
-{
-	down_write(&priv->mib_sem);
-	mgt_commit(priv);
-	up_write(&priv->mib_sem);
-}
-
 /* this will be executed outside of atomic context thanks to
  * schedule_work(), thus we can as well use sleeping semaphore
  * locking */
@@ -195,16 +187,9 @@ prism54_update_stats(islpci_private *priv)
 	if (down_interruptible(&priv->stats_sem))
 		return;
 
-/* missing stats are :
- *  iwstatistics.qual.updated
- *  iwstatistics.discard.nwid	    
- *  iwstatistics.discard.fragment	    
- *  iwstatistics.discard.misc
- *  iwstatistics.miss.beacon */
-
 /* Noise floor.
  * I'm not sure if the unit is dBm.
- * Note : If we are not connected, this value seems to be irrevelant. */
+ * Note : If we are not connected, this value seems to be irrelevant. */
 
 	mgt_get_request(priv, DOT11_OID_NOISEFLOOR, 0, NULL, &r);
 	priv->local_iwstatistics.qual.noise = r.u;
@@ -216,8 +201,7 @@ prism54_update_stats(islpci_private *priv)
 	data = r.ptr;
 
 	/* copy this MAC to the bss */
-	for (j = 0; j < 6; j++)
-		bss.address[j] = data[j];
+	memcpy(bss.address, data, 6);
 	kfree(data);
 
 	/* now ask for the corresponding bss */
@@ -426,7 +410,6 @@ prism54_set_sens(struct net_device *ndev, struct iw_request_info *info,
 	/* by default  the card sets this to 20. */
 	sens = vwrq->disabled ? 20 : vwrq->value;
 
-	/* set the ed threshold. */
 	return mgt_set_request(priv, DOT11_OID_EDTHRESHOLD, 0, &sens);
 }
 
@@ -453,7 +436,7 @@ prism54_get_range(struct net_device *ndev, struct iw_request_info *info,
 {
 	struct iw_range *range = (struct iw_range *) extra;
 	islpci_private *priv = netdev_priv(ndev);
-	char *data;
+	u8 *data;
 	int i, m, rvalue;
 	struct obj_frequencies *freq;
 	union oid_res_t r;
@@ -505,7 +488,7 @@ prism54_get_range(struct net_device *ndev, struct iw_request_info *info,
 		return 0;
 
 	/* Request the device for the supported frequencies
-	 * not really revelant since some devices will report the 5 GHz band
+	 * not really relevant since some devices will report the 5 GHz band
 	 * frequencies even if they don't support them.
 	 */
 	rvalue =
@@ -515,21 +498,12 @@ prism54_get_range(struct net_device *ndev, struct iw_request_info *info,
 	range->num_channels = freq->nr;
 	range->num_frequency = freq->nr;
 
-	/* Frequencies are not listed in the right order. The reordering is probably
-	 * firmware dependant and thus should work for everyone.
-	 */
 	m = min(IW_MAX_FREQUENCIES, (int) freq->nr);
-	for (i = 0; i < m - 12; i++) {
-		range->freq[i].m = freq->mhz[12 + i];
-		range->freq[i].e = 6;
-		range->freq[i].i = i + 1;
-	}
-	for (i = m - 12; i < m; i++) {
-		range->freq[i].m = freq->mhz[i - m + 12];
+	for (i = 0; i < m; i++) {
+		range->freq[i].m = freq->mhz[i];
 		range->freq[i].e = 6;
-		range->freq[i].i = i + 23;
+		range->freq[i].i = channel_of_freq(freq->mhz[i]);
 	}
-
 	kfree(freq);
 
 	rvalue |= mgt_get_request(priv, DOT11_OID_SUPPORTEDRATES, 0, NULL, &r);
@@ -539,14 +513,11 @@ prism54_get_range(struct net_device *ndev, struct iw_request_info *info,
 	i = 0;
 	while ((i < IW_MAX_BITRATES) && (*data != 0)) {
 		/*       the result must be in bps. The card gives us 500Kbps */
-		range->bitrate[i] = (__s32) (*data >> 1);
-		range->bitrate[i] *= 1000000;
+		range->bitrate[i] = *data * 500000;
 		i++;
 		data++;
 	}
-
 	range->num_bitrates = i;
-
 	kfree(r.ptr);
 
 	return rvalue;
@@ -585,7 +556,6 @@ prism54_get_wap(struct net_device *ndev, struct iw_request_info *info,
 	int rvalue;
 
 	rvalue = mgt_get_request(priv, DOT11_OID_BSSID, 0, NULL, &r);
-
 	memcpy(awrq->sa_data, r.ptr, 6);
 	awrq->sa_family = ARPHRD_ETHER;
 	kfree(r.ptr);
@@ -606,7 +576,7 @@ prism54_set_scan(struct net_device *dev, struct iw_request_info *info,
  * the "Aironet driver for 4500 and 4800 series cards" (GPL)
  */
 
-inline char *
+static char *
 prism54_translate_bss(struct net_device *ndev, char *current_ev,
 		      char *end_buf, struct obj_bss *bss, char noise)
 {
@@ -658,8 +628,8 @@ prism54_translate_bss(struct net_device *ndev, char *current_ev,
 	current_ev = iwe_stream_add_point(current_ev, end_buf, &iwe, NULL);
 
 	/* Add frequency. (short) bss->channel is the frequency in MHz */
-	iwe.u.freq.m = bss->channel;
-	iwe.u.freq.e = 6;
+	iwe.u.freq.m = channel_of_freq(bss->channel);
+	iwe.u.freq.e = 0;
 	iwe.cmd = SIOCGIWFREQ;
 	current_ev =
 	    iwe_stream_add_event(current_ev, end_buf, &iwe, IW_EV_FREQ_LEN);
@@ -695,7 +665,6 @@ prism54_translate_bss(struct net_device *ndev, char *current_ev,
 			kfree(buf);
 		}
 	}
-
 	return current_ev;
 }
 
@@ -722,7 +691,7 @@ prism54_get_scan(struct net_device *ndev, struct iw_request_info *info,
 
 	/* Ask the device for a list of known bss. We can report at most
 	 * IW_MAX_AP=64 to the range struct. But the device won't repport anything
-	 * if you change the value of MAXBSS=24. Anyway 24 AP It is probably enough.
+	 * if you change the value of IWMAX_BSS=24.
 	 */
 	rvalue |= mgt_get_request(priv, DOT11_OID_BSSLIST, 0, NULL, &r);
 	bsslist = r.ptr;
@@ -757,7 +726,7 @@ prism54_set_essid(struct net_device *ndev, struct iw_request_info *info,
 		memcpy(essid.octets, extra, dwrq->length);
 	} else
 		essid.length = 0;
-	
+
 	if (priv->iw_mode != IW_MODE_MONITOR)
 		return mgt_set_request(priv, DOT11_OID_SSID, 0, &essid);
 
@@ -843,21 +812,23 @@ prism54_set_rate(struct net_device *ndev,
 	char *data;
 	int ret, i;
 	union oid_res_t r;
-	
+
 	if (vwrq->value == -1) {
 		/* auto mode. No limit. */
 		profile = 1;
 		return mgt_set_request(priv, DOT11_OID_PROFILES, 0, &profile);
 	}
-	
-	if ((ret =
-	     mgt_get_request(priv, DOT11_OID_SUPPORTEDRATES, 0, NULL, &r)))
+
+	ret = mgt_get_request(priv, DOT11_OID_SUPPORTEDRATES, 0, NULL, &r);
+	if (ret) {
+		kfree(r.ptr);
 		return ret;
-		
+	}
+
 	rate = (u32) (vwrq->value / 500000);
 	data = r.ptr;
 	i = 0;
-	
+
 	while (data[i]) {
 		if (rate && (data[i] == rate)) {
 			break;
@@ -868,14 +839,15 @@ prism54_set_rate(struct net_device *ndev,
 		data[i] |= 0x80;
 		i++;
 	}
-		
+
 	if (!data[i]) {
+		kfree(r.ptr);
 		return -EINVAL;
 	}
-	
+
 	data[i] |= 0x80;
 	data[i + 1] = 0;
-	
+
 	/* Now, check if we want a fixed or auto value */
 	if (vwrq->fixed) {
 		data[0] = data[i];
@@ -890,14 +862,14 @@ prism54_set_rate(struct net_device *ndev,
 		i++;
 	}
 	printk("0\n");
-*/	
+*/
 	profile = -1;
 	ret = mgt_set_request(priv, DOT11_OID_PROFILES, 0, &profile);
 	ret |= mgt_set_request(priv, DOT11_OID_EXTENDEDRATES, 0, data);
 	ret |= mgt_set_request(priv, DOT11_OID_RATES, 0, data);
-	
+
 	kfree(r.ptr);
-	
+
 	return ret;
 }
 
@@ -918,12 +890,15 @@ prism54_get_rate(struct net_device *ndev,
 	vwrq->value = r.u * 500000;
 
 	/* request the device for the enabled rates */
-	if ((rvalue = mgt_get_request(priv, DOT11_OID_RATES, 0, NULL, &r)))
+	rvalue = mgt_get_request(priv, DOT11_OID_RATES, 0, NULL, &r);
+	if (rvalue) {
+		kfree(r.ptr);
 		return rvalue;
+	}
 	data = r.ptr;
 	vwrq->fixed = (data[0] != 0) && (data[1] == 0);
 	kfree(r.ptr);
-	
+
 	return 0;
 }
 
@@ -979,8 +954,6 @@ prism54_get_frag(struct net_device *ndev, struct iw_request_info *info,
  * small frame <=>  smaller than the rts threshold
  * This is not really the behavior expected by the wireless tool but it seems
  * to be a common behavior in other drivers.
- * 
- * It seems that playing with this tends to hang the card -> DISABLED
  */
 
 static int
@@ -1012,18 +985,16 @@ prism54_set_retry(struct net_device *ndev, struct iw_request_info *info,
 		lifetime = vwrq->value / 1024;
 
 	/* now set what is requested */
-
-	if (slimit != 0)
+	if (slimit)
 		rvalue =
 		    mgt_set_request(priv, DOT11_OID_SHORTRETRIES, 0, &slimit);
-	if (llimit != 0)
+	if (llimit)
 		rvalue |=
 		    mgt_set_request(priv, DOT11_OID_LONGRETRIES, 0, &llimit);
-	if (lifetime != 0)
+	if (lifetime)
 		rvalue |=
 		    mgt_set_request(priv, DOT11_OID_MAXTXLIFETIME, 0,
 				    &lifetime);
-
 	return rvalue;
 }
 
@@ -1119,8 +1090,7 @@ prism54_set_encode(struct net_device *ndev, struct iw_request_info *info,
 			}
 		}
 	}
-
-	/* now read the flags     */
+	/* now read the flags */
 	if (dwrq->flags & IW_ENCODE_DISABLED) {
 		/* Encoding disabled, 
 		 * authen = DOT11_AUTH_OS;
@@ -1269,13 +1239,8 @@ prism54_get_oid(struct net_device *ndev, struct iw_request_info *info,
 
 static int
 prism54_set_u32(struct net_device *ndev, struct iw_request_info *info,
-		   __u32 * uwrq, char *extra)
+		__u32 * uwrq, char *extra)
 {
-	/*
-	   u32 *i = (int *) extra;
-	   int param = *i;
-	   int u = *(i + 1);
-	 */
 	u32 oid = uwrq[0], u = uwrq[1];
 
 	return mgt_set_request((islpci_private *) ndev->priv, oid, 0, &u);
@@ -1542,7 +1507,7 @@ prism54_kick_mac(struct net_device *ndev, struct iw_request_info *info,
 
 /* Translate a TRAP oid into a wireless event. Called in islpci_mgt_receive. */
 
-static inline void
+static void
 format_event(islpci_private *priv, char *dest, const char *str,
 	     const struct obj_mlme *mlme, u16 *length, int error)
 {
@@ -1846,9 +1811,7 @@ prism54_process_trap_helper(islpci_private *priv, enum oid_num_t oid,
 				     0);
 		break;
 
-		/* Note : the following should never happen since we don't run the card in
-		 * extended mode.
-		 * Note : "mlme" is actually a "struct obj_mlmeex *" here, but this
+		/* Note : "mlme" is actually a "struct obj_mlmeex *" here, but this
 		 * is backward compatible layout-wise with "struct obj_mlme".
 		 */
 
@@ -1893,7 +1856,8 @@ prism54_process_trap(void *data)
 	struct net_device *ndev = frame->ndev;
 	enum oid_num_t n = mgt_oidtonum(frame->header->oid);
 
-	prism54_process_trap_helper(netdev_priv(ndev), n, frame->data);
+	if (n != OID_NUM_LAST)
+		prism54_process_trap_helper(netdev_priv(ndev), n, frame->data);
 	islpci_mgt_release(frame);
 }
 
@@ -1965,66 +1929,12 @@ prism54_get_prismhdr(struct net_device *ndev, struct iw_request_info *info,
 	return 0;
 }
 
-int
-prism54_set_maxframeburst(struct net_device *ndev, struct iw_request_info *info,
-			  __u32 * uwrq, char *extra)
-{
-	islpci_private *priv = netdev_priv(ndev);
-	u32 max_burst;
-
-	max_burst = (*uwrq) ? *uwrq : CARD_DEFAULT_MAXFRAMEBURST;
-	mgt_set_request(priv, DOT11_OID_MAXFRAMEBURST, 0, &max_burst);
-
-	return -EINPROGRESS; /* Call commit handler */
-}
-
-int
-prism54_get_maxframeburst(struct net_device *ndev, struct iw_request_info *info,
-			  __u32 * uwrq, char *extra)
-{
-	islpci_private *priv = netdev_priv(ndev);
-	union oid_res_t r;
-	int rvalue;
-	
-	rvalue = mgt_get_request(priv, DOT11_OID_MAXFRAMEBURST, 0, NULL, &r);
-	*uwrq = r.u;
-	
-	return rvalue;
-}
-
-int
-prism54_set_profile(struct net_device *ndev, struct iw_request_info *info,
-		    __u32 * uwrq, char *extra)
-{
-	islpci_private *priv = netdev_priv(ndev);
-	u32 profile;
-
-	profile = (*uwrq) ? *uwrq : CARD_DEFAULT_PROFILE;
-	mgt_set_request(priv, DOT11_OID_PROFILES, 0, &profile);
-	
-	return -EINPROGRESS; /* Call commit handler */
-}
-
-int
-prism54_get_profile(struct net_device *ndev, struct iw_request_info *info,
-		    __u32 * uwrq, char *extra)
-{
-	islpci_private *priv = netdev_priv(ndev);
-	union oid_res_t r;
-	int rvalue;
-
-	rvalue = mgt_get_request(priv, DOT11_OID_PROFILES, 0, NULL, &r);
-	*uwrq = r.u;
-
-	return rvalue;
-}
-
 int
 prism54_debug_oid(struct net_device *ndev, struct iw_request_info *info,
 		  __u32 * uwrq, char *extra)
 {
 	islpci_private *priv = netdev_priv(ndev);
-	
+
 	priv->priv_oid = *uwrq;
 	printk("%s: oid 0x%08X\n", ndev->name, *uwrq);
 
@@ -2033,23 +1943,21 @@ prism54_debug_oid(struct net_device *ndev, struct iw_request_info *info,
 
 int
 prism54_debug_get_oid(struct net_device *ndev, struct iw_request_info *info,
-		struct iw_point *data, char *extra)
+		      struct iw_point *data, char *extra)
 {
 	islpci_private *priv = netdev_priv(ndev);
 	struct islpci_mgmtframe *response = NULL;
-	int ret = -EIO, response_op = PIMFOR_OP_ERROR;
-	
+	int ret = -EIO;
+
 	printk("%s: get_oid 0x%08X\n", ndev->name, priv->priv_oid);
 	data->length = 0;
-	
+
 	if (islpci_get_state(priv) >= PRV_STATE_INIT) {
 		ret =
 		    islpci_mgt_transaction(priv->ndev, PIMFOR_OP_GET,
 					   priv->priv_oid, extra, 256,
 					   &response);
-		response_op = response->header->operation;
 		printk("%s: ret: %i\n", ndev->name, ret);
-		printk("%s: response_op: %i\n", ndev->name, response_op);
 		if (ret || !response
 		    || response->header->operation == PIMFOR_OP_ERROR) {
 			if (response) {
@@ -2065,40 +1973,44 @@ prism54_debug_get_oid(struct net_device *ndev, struct iw_request_info *info,
 			printk("%s: len: %i\n", ndev->name, data->length);
 		}
 	}
-	
+
 	return ret;
 }
 
 int
 prism54_debug_set_oid(struct net_device *ndev, struct iw_request_info *info,
-		struct iw_point *data, char *extra)
+		      struct iw_point *data, char *extra)
 {
 	islpci_private *priv = netdev_priv(ndev);
 	struct islpci_mgmtframe *response = NULL;
 	int ret = 0, response_op = PIMFOR_OP_ERROR;
-	
+
 	printk("%s: set_oid 0x%08X\tlen: %d\n", ndev->name, priv->priv_oid,
 	       data->length);
-	
+
 	if (islpci_get_state(priv) >= PRV_STATE_INIT) {
 		ret =
 		    islpci_mgt_transaction(priv->ndev, PIMFOR_OP_SET,
 					   priv->priv_oid, extra, data->length,
 					   &response);
 		printk("%s: ret: %i\n", ndev->name, ret);
+		if (ret || !response
+		    || response->header->operation == PIMFOR_OP_ERROR) {
+			if (response) {
+				islpci_mgt_release(response);
+			}
+			printk("%s: EIO\n", ndev->name);
+			ret = -EIO;
+		}
 		if (!ret) {
 			response_op = response->header->operation;
 			printk("%s: response_op: %i\n", ndev->name,
 			       response_op);
 			islpci_mgt_release(response);
 		}
-		if (ret || response_op == PIMFOR_OP_ERROR) {
-			printk("%s: EIO\n", ndev->name);
-		        ret = -EIO;
-		}
 	}
-	
-	return ret;
+
+	return (ret ? ret : -EINPROGRESS);
 }
 
 static int
@@ -2196,7 +2108,7 @@ static const iw_handler prism54_handler[] = {
 #define PRISM54_DBG_GET_OID	SIOCIWFIRSTPRIV+15
 #define PRISM54_DBG_SET_OID	SIOCIWFIRSTPRIV+16
 
-#define PRISM54_GET_OID	   SIOCIWFIRSTPRIV+17
+#define PRISM54_GET_OID		SIOCIWFIRSTPRIV+17
 #define PRISM54_SET_OID_U32	SIOCIWFIRSTPRIV+18
 #define	PRISM54_SET_OID_STR	SIOCIWFIRSTPRIV+20
 #define	PRISM54_SET_OID_ADDR	SIOCIWFIRSTPRIV+22
@@ -2204,16 +2116,16 @@ static const iw_handler prism54_handler[] = {
 #define PRISM54_GET_PRISMHDR	SIOCIWFIRSTPRIV+23
 #define PRISM54_SET_PRISMHDR	SIOCIWFIRSTPRIV+24
 
-#define IWPRIV_SET_U32(n,x)	{ n, IW_PRIV_TYPE_INT | IW_PRIV_SIZE_FIXED | 1, 0, "set_"x }
-#define IWPRIV_SET_SSID(n,x)	{ n, IW_PRIV_TYPE_CHAR | IW_PRIV_SIZE_FIXED | 1, 0, "set_"x }
-#define IWPRIV_SET_ADDR(n,x)	{ n, IW_PRIV_TYPE_ADDR | IW_PRIV_SIZE_FIXED | 1, 0, "set_"x }
-#define IWPRIV_GET(n,x)	{ n, 0, IW_PRIV_TYPE_CHAR | IW_PRIV_SIZE_FIXED | PRIV_STR_SIZE, "get_"x }
+#define IWPRIV_SET_U32(n,x)	{ n, IW_PRIV_TYPE_INT | IW_PRIV_SIZE_FIXED | 1, 0, "s_"x }
+#define IWPRIV_SET_SSID(n,x)	{ n, IW_PRIV_TYPE_CHAR | IW_PRIV_SIZE_FIXED | 1, 0, "s_"x }
+#define IWPRIV_SET_ADDR(n,x)	{ n, IW_PRIV_TYPE_ADDR | IW_PRIV_SIZE_FIXED | 1, 0, "s_"x }
+#define IWPRIV_GET(n,x)	{ n, 0, IW_PRIV_TYPE_CHAR | IW_PRIV_SIZE_FIXED | PRIV_STR_SIZE, "g_"x }
 
 #define IWPRIV_U32(n,x)		IWPRIV_SET_U32(n,x), IWPRIV_GET(n,x)
 #define IWPRIV_SSID(n,x)	IWPRIV_SET_SSID(n,x), IWPRIV_GET(n,x)
 #define IWPRIV_ADDR(n,x)	IWPRIV_SET_ADDR(n,x), IWPRIV_GET(n,x)
 
-/* Note : limited to 128 private ioctls */
+/* Note : limited to 128 private ioctls (wireless tools 26) */
 
 static const struct iw_priv_args prism54_private_args[] = {
 /*{ cmd, set_args, get_args, name } */
@@ -2241,7 +2153,7 @@ static const struct iw_priv_args prism54_private_args[] = {
 	{PRISM54_DBG_OID, IW_PRIV_TYPE_INT | IW_PRIV_SIZE_FIXED | 1, 0,
 	 "dbg_oid"},
 	{PRISM54_DBG_GET_OID, 0, IW_PRIV_TYPE_BYTE | 256, "dbg_get_oid"},
-	{PRISM54_DBG_SET_OID, IW_PRIV_TYPE_BYTE | 256, 0, "dbg_get_oid"},
+	{PRISM54_DBG_SET_OID, IW_PRIV_TYPE_BYTE | 256, 0, "dbg_set_oid"},
 	/* --- sub-ioctls handlers --- */
 	{PRISM54_GET_OID,
 	 0, IW_PRIV_TYPE_CHAR | IW_PRIV_SIZE_FIXED | PRIV_STR_SIZE, ""},
@@ -2268,7 +2180,7 @@ static const struct iw_priv_args prism54_private_args[] = {
 	IWPRIV_U32(DOT11_OID_AUTHENABLE, "authenable"),
 	IWPRIV_U32(DOT11_OID_PRIVACYINVOKED, "privinvok"),
 	IWPRIV_U32(DOT11_OID_EXUNENCRYPTED, "exunencrypt"),
-	
+
 	IWPRIV_U32(DOT11_OID_REKEYTHRESHOLD, "rekeythresh"),
 
 	IWPRIV_U32(DOT11_OID_MAXTXLIFETIME, "maxtxlife"),
@@ -2351,5 +2263,6 @@ const struct iw_handler_def prism54_handler_def = {
 int
 prism54_ioctl(struct net_device *ndev, struct ifreq *rq, int cmd)
 {
+
 	return -EOPNOTSUPP;
 }
diff --git a/drivers/net/wireless/prism54/isl_ioctl.h b/drivers/net/wireless/prism54/isl_ioctl.h
index d5170c478..3320338e2 100644
--- a/drivers/net/wireless/prism54/isl_ioctl.h
+++ b/drivers/net/wireless/prism54/isl_ioctl.h
@@ -30,7 +30,6 @@
 #define SUPPORTED_WIRELESS_EXT                  16
 
 void prism54_mib_init(islpci_private *);
-void prism54_mib_init_work(islpci_private *);
 
 struct iw_statistics *prism54_get_wireless_stats(struct net_device *);
 void prism54_update_stats(islpci_private *);
diff --git a/drivers/net/wireless/prism54/islpci_dev.c b/drivers/net/wireless/prism54/islpci_dev.c
index 157193918..d96d621f1 100644
--- a/drivers/net/wireless/prism54/islpci_dev.c
+++ b/drivers/net/wireless/prism54/islpci_dev.c
@@ -30,6 +30,7 @@
 
 #include <asm/io.h>
 
+#include "prismcompat.h"
 #include "isl_38xx.h"
 #include "isl_ioctl.h"
 #include "islpci_dev.h"
@@ -37,15 +38,13 @@
 #include "islpci_eth.h"
 #include "oid_mgt.h"
 
-#if LINUX_VERSION_CODE <= KERNEL_VERSION(2,5,0)
-#define prism54_synchronize_irq(irq) synchronize_irq()
-#else
-#define prism54_synchronize_irq(irq) synchronize_irq(irq)
-#endif
-
 #define ISL3877_IMAGE_FILE	"isl3877"
+#define ISL3886_IMAGE_FILE	"isl3886"
 #define ISL3890_IMAGE_FILE	"isl3890"
 
+static int prism54_bring_down(islpci_private *);
+static int islpci_alloc_memory(islpci_private *);
+
 /* Temporary dummy MAC address to use until firmware is loaded.
  * The idea there is that some tools (such as nameif) may query
  * the MAC address before the netdev is 'open'. By using a valid
@@ -55,6 +54,125 @@
  * ndev->set_mac_address. Jean II */
 const unsigned char	dummy_mac[6] = { 0x00, 0x30, 0xB4, 0x00, 0x00, 0x00 };
 
+static int
+isl_upload_firmware(islpci_private *priv)
+{
+	u32 reg, rc;
+	void *device_base = priv->device_base;
+
+	/* clear the RAMBoot and the Reset bit */
+	reg = readl(device_base + ISL38XX_CTRL_STAT_REG);
+	reg &= ~ISL38XX_CTRL_STAT_RESET;
+	reg &= ~ISL38XX_CTRL_STAT_RAMBOOT;
+	writel(reg, device_base + ISL38XX_CTRL_STAT_REG);
+	wmb();
+	udelay(ISL38XX_WRITEIO_DELAY);
+
+	/* set the Reset bit without reading the register ! */
+	reg |= ISL38XX_CTRL_STAT_RESET;
+	writel(reg, device_base + ISL38XX_CTRL_STAT_REG);
+	wmb();
+	udelay(ISL38XX_WRITEIO_DELAY);
+
+	/* clear the Reset bit */
+	reg &= ~ISL38XX_CTRL_STAT_RESET;
+	writel(reg, device_base + ISL38XX_CTRL_STAT_REG);
+	wmb();
+
+	/* wait a while for the device to reboot */
+	mdelay(50);
+
+	{
+		const struct firmware *fw_entry = NULL;
+		long fw_len;
+		const u32 *fw_ptr;
+
+		rc = request_firmware(&fw_entry, priv->firmware, PRISM_FW_PDEV);
+		if (rc) {
+			printk(KERN_ERR
+			       "%s: request_firmware() failed for '%s'\n",
+			       "prism54", priv->firmware);
+			return rc;
+		}
+		/* prepare the Direct Memory Base register */
+		reg = ISL38XX_DEV_FIRMWARE_ADDRES;
+
+		fw_ptr = (u32 *) fw_entry->data;
+		fw_len = fw_entry->size;
+
+		if (fw_len % 4) {
+			printk(KERN_ERR
+			       "%s: firmware '%s' size is not multiple of 32bit, aborting!\n",
+			       "prism54", priv->firmware);
+			release_firmware(fw_entry);
+			return EILSEQ; /* Illegal byte sequence  */;
+		}
+
+		while (fw_len > 0) {
+			long _fw_len =
+			    (fw_len >
+			     ISL38XX_MEMORY_WINDOW_SIZE) ?
+			    ISL38XX_MEMORY_WINDOW_SIZE : fw_len;
+			u32 *dev_fw_ptr = device_base + ISL38XX_DIRECT_MEM_WIN;
+
+			/* set the cards base address for writting the data */
+			isl38xx_w32_flush(device_base, reg,
+					  ISL38XX_DIR_MEM_BASE_REG);
+			wmb();	/* be paranoid */
+
+			/* increment the write address for next iteration */
+			reg += _fw_len;
+			fw_len -= _fw_len;
+
+			/* write the data to the Direct Memory Window 32bit-wise */
+			/* memcpy_toio() doesn't guarantee 32bit writes :-| */
+			while (_fw_len > 0) {
+				/* use non-swapping writel() */
+				__raw_writel(*fw_ptr, dev_fw_ptr);
+				fw_ptr++, dev_fw_ptr++;
+				_fw_len -= 4;
+			}
+
+			/* flush PCI posting */
+			(void) readl(device_base + ISL38XX_PCI_POSTING_FLUSH);
+			wmb();	/* be paranoid again */
+
+			BUG_ON(_fw_len != 0);
+		}
+
+		BUG_ON(fw_len != 0);
+
+		release_firmware(fw_entry);
+	}
+
+	/* now reset the device
+	 * clear the Reset & ClkRun bit, set the RAMBoot bit */
+	reg = readl(device_base + ISL38XX_CTRL_STAT_REG);
+	reg &= ~ISL38XX_CTRL_STAT_CLKRUN;
+	reg &= ~ISL38XX_CTRL_STAT_RESET;
+	reg |= ISL38XX_CTRL_STAT_RAMBOOT;
+	isl38xx_w32_flush(device_base, reg, ISL38XX_CTRL_STAT_REG);
+	wmb();
+	udelay(ISL38XX_WRITEIO_DELAY);
+
+	/* set the reset bit latches the host override and RAMBoot bits
+	 * into the device for operation when the reset bit is reset */
+	reg |= ISL38XX_CTRL_STAT_RESET;
+	writel(reg, device_base + ISL38XX_CTRL_STAT_REG);
+	/* don't do flush PCI posting here! */
+	wmb();
+	udelay(ISL38XX_WRITEIO_DELAY);
+
+	/* clear the reset bit should start the whole circus */
+	reg &= ~ISL38XX_CTRL_STAT_RESET;
+	writel(reg, device_base + ISL38XX_CTRL_STAT_REG);
+	/* don't do flush PCI posting here! */
+	wmb();
+	udelay(ISL38XX_WRITEIO_DELAY);
+
+	return 0;
+}
+
 /******************************************************************************
     Device Interrupt Handler
 ******************************************************************************/
@@ -68,21 +186,22 @@ islpci_interrupt(int irq, void *config, struct pt_regs *regs)
 	void *device = priv->device_base;
 	int powerstate = ISL38XX_PSM_POWERSAVE_STATE;
 
+	/* lock the interrupt handler */
+	spin_lock(&priv->slock);
+
 	/* received an interrupt request on a shared IRQ line
 	 * first check whether the device is in sleep mode */
 	reg = readl(device + ISL38XX_CTRL_STAT_REG);
 	if (reg & ISL38XX_CTRL_STAT_SLEEPMODE)
 		/* device is in sleep mode, IRQ was generated by someone else */
 	{
-		printk(KERN_DEBUG "Assuming someone else called the IRQ\n");
+#if VERBOSE > SHOW_ERROR_MESSAGES
+		DEBUG(SHOW_TRACING, "Assuming someone else called the IRQ\n");
+#endif
+		spin_unlock(&priv->slock);
 		return IRQ_NONE;
 	}
 
-	if (islpci_get_state(priv) != PRV_STATE_SLEEP)
-		powerstate = ISL38XX_PSM_ACTIVE_STATE;
-
-	/* lock the interrupt handler */
-	spin_lock(&priv->slock);
 
 	/* check whether there is any source of interrupt on the device */
 	reg = readl(device + ISL38XX_INT_IDENT_REG);
@@ -93,6 +212,9 @@ islpci_interrupt(int irq, void *config, struct pt_regs *regs)
 	reg &= ISL38XX_INT_SOURCES;
 
 	if (reg != 0) {
+		if (islpci_get_state(priv) != PRV_STATE_SLEEP)
+			powerstate = ISL38XX_PSM_ACTIVE_STATE;
+
 		/* reset the request bits in the Identification register */
 		isl38xx_w32_flush(device, reg, ISL38XX_INT_ACK_REG);
 
@@ -220,6 +342,12 @@ islpci_interrupt(int irq, void *config, struct pt_regs *regs)
 			isl38xx_handle_wakeup(priv->control_block,
 					      &powerstate, priv->device_base);
 		}
+	} else {
+#if VERBOSE > SHOW_ERROR_MESSAGES
+		DEBUG(SHOW_TRACING, "Assuming someone else called the IRQ\n");
+#endif
+		spin_unlock(&priv->slock);
+		return IRQ_NONE;
 	}
 
 	/* sleep -> ready */
@@ -274,7 +402,7 @@ islpci_close(struct net_device *ndev)
 	return prism54_bring_down(priv);
 }
 
-int
+static int
 prism54_bring_down(islpci_private *priv)
 {
 	void *device_base = priv->device_base;
@@ -324,14 +452,7 @@ islpci_upload_fw(islpci_private *priv)
 
 	printk(KERN_DEBUG "%s: uploading firmware...\n", priv->ndev->name);
 
-	rc = isl38xx_upload_firmware(priv->firmware,
-#if (LINUX_VERSION_CODE > KERNEL_VERSION(2,5,75))
-		&priv->pdev->dev,
-#else
-		pci_name(priv->pdev),
-#endif
-		priv->device_base,
-		priv->device_host_address);
+	rc = isl_upload_firmware(priv);
 	if (rc) {
 		/* error uploading the firmware */
 		printk(KERN_ERR "%s: could not upload firmware ('%s')\n",
@@ -357,15 +478,8 @@ islpci_reset_if(islpci_private *priv)
 	int result = -ETIME;
 	int count;
 
-#if LINUX_VERSION_CODE >= KERNEL_VERSION(2,6,0)
-	/* This is 2.6 specific, nicer, shorter, but not in 2.4 yet */
 	DEFINE_WAIT(wait);
 	prepare_to_wait(&priv->reset_done, &wait, TASK_UNINTERRUPTIBLE);
-#else
-	DECLARE_WAITQUEUE(wait, current);
-	set_current_state(TASK_UNINTERRUPTIBLE);
-	add_wait_queue(&priv->reset_done, &wait);
-#endif
 	
 	/* now the last step is to reset the interface */
 	isl38xx_interface_reset(priv->device_base, priv->device_host_address);
@@ -390,13 +504,7 @@ islpci_reset_if(islpci_private *priv)
 
 	}
 
-#if LINUX_VERSION_CODE >= KERNEL_VERSION(2,6,0)
-	/* 2.6 specific too */
 	finish_wait(&priv->reset_done, &wait);
-#else
-	remove_wait_queue(&priv->reset_done, &wait);
-	set_current_state(TASK_RUNNING);
-#endif
 
 	if(result)
 		return result;
@@ -410,7 +518,9 @@ islpci_reset_if(islpci_private *priv)
 	 * the IRQ line until we know for sure the reset went through */
 	isl38xx_enable_common_interrupts(priv->device_base);
 
-	prism54_mib_init_work(priv);
+	down_write(&priv->mib_sem);
+	mgt_commit(priv);
+	up_write(&priv->mib_sem);
 
 	islpci_set_state(priv, PRV_STATE_READY);
 
@@ -448,9 +558,9 @@ islpci_reset(islpci_private *priv, int reload_firmware)
 	/* reset the mgmt receive queue */
 	for (counter = 0; counter < ISL38XX_CB_MGMT_QSIZE; counter++) {
 		isl38xx_fragment *frag = &cb->rx_data_mgmt[counter];
-		frag->size = MGMT_FRAME_SIZE;
+		frag->size = cpu_to_le16(MGMT_FRAME_SIZE);
 		frag->flags = 0;
-		frag->address = priv->mgmt_rx[counter].pci_addr;
+		frag->address = cpu_to_le32(priv->mgmt_rx[counter].pci_addr);
 	}
 
 	for (counter = 0; counter < ISL38XX_CB_RX_QSIZE; counter++) {
@@ -503,7 +613,7 @@ islpci_statistics(struct net_device *ndev)
 /******************************************************************************
     Network device configuration functions
 ******************************************************************************/
-int
+static int
 islpci_alloc_memory(islpci_private *priv)
 {
 	int counter;
@@ -580,6 +690,7 @@ islpci_alloc_memory(islpci_private *priv)
 			skb = NULL;
 			goto out_free;
 		}
+		skb_reserve(skb, (4 - (long) skb->data) & 0x03);
 		/* add the new allocated sk_buff to the buffer array */
 		priv->data_low_rx[counter] = skb;
 
@@ -614,7 +725,7 @@ islpci_free_memory(islpci_private *priv)
 
 	if (priv->device_base)
 		iounmap(priv->device_base);
-	priv->device_base = 0;
+	priv->device_base = NULL;
 
 	/* free consistent DMA area... */
 	if (priv->driver_mem_address)
@@ -623,10 +734,10 @@ islpci_free_memory(islpci_private *priv)
 				    priv->device_host_address);
 
 	/* clear some dangling pointers */
-	priv->driver_mem_address = 0;
+	priv->driver_mem_address = NULL;
 	priv->device_host_address = 0;
 	priv->device_psm_buffer = 0;
-	priv->control_block = 0;
+	priv->control_block = NULL;
 
         /* clean up mgmt rx buffers */
         for (counter = 0; counter < ISL38XX_CB_MGMT_QSIZE; counter++) {
@@ -652,7 +763,7 @@ islpci_free_memory(islpci_private *priv)
 
 		if (priv->data_low_rx[counter])
 			dev_kfree_skb(priv->data_low_rx[counter]);
-		priv->data_low_rx[counter] = 0;
+		priv->data_low_rx[counter] = NULL;
 	}
 
 	/* Free the acces control list and the WPA list */
@@ -754,14 +865,14 @@ islpci_setup(struct pci_dev *pdev)
 
 	/* select the firmware file depending on the device id */
 	switch (pdev->device) {
-	case PCIDEVICE_ISL3890:
-	case PCIDEVICE_3COM6001:
-		strcpy(priv->firmware, ISL3890_IMAGE_FILE);
-		break;
-	case PCIDEVICE_ISL3877:
+	case 0x3877:
 		strcpy(priv->firmware, ISL3877_IMAGE_FILE);
 		break;
 
+	case 0x3886:
+		strcpy(priv->firmware, ISL3886_IMAGE_FILE);
+		break;
+
 	default:
 		strcpy(priv->firmware, ISL3890_IMAGE_FILE);
 		break;
@@ -778,9 +889,9 @@ islpci_setup(struct pci_dev *pdev)
       do_islpci_free_memory:
 	islpci_free_memory(priv);
       do_free_netdev:
-	pci_set_drvdata(pdev, 0);
+	pci_set_drvdata(pdev, NULL);
 	free_netdev(ndev);
-	priv = 0;
+	priv = NULL;
 	return NULL;
 }
 
diff --git a/drivers/net/wireless/prism54/islpci_dev.h b/drivers/net/wireless/prism54/islpci_dev.h
index de92b4ea6..e0ec5de03 100644
--- a/drivers/net/wireless/prism54/islpci_dev.h
+++ b/drivers/net/wireless/prism54/islpci_dev.h
@@ -29,20 +29,6 @@
 #include <net/iw_handler.h>
 #include <linux/list.h>
 
-#if LINUX_VERSION_CODE > KERNEL_VERSION(2,5,41)
-# include <linux/workqueue.h>
-#else
-# include <linux/tqueue.h>
-# define work_struct tq_struct
-# define INIT_WORK INIT_TQUEUE
-# define schedule_work schedule_task
-#endif
-
-#if LINUX_VERSION_CODE < KERNEL_VERSION(2,4,23)
-#define free_netdev(x) kfree(x) 
-#define pci_name(x) x->slot_name 
-#endif
-
 #include "isl_38xx.h"
 #include "isl_oid.h"
 #include "islpci_mgt.h"
@@ -187,7 +173,7 @@ typedef struct {
 	islpci_state_t state;
 	int state_off;		/* enumeration of off-state, if 0 then
 				 * we're not in any off-state */
-	
+
 	/* WPA stuff */
 	int wpa; /* WPA mode enabled */
 	struct list_head bss_wpa_list;
@@ -210,12 +196,6 @@ islpci_state_t islpci_set_state(islpci_private *priv, islpci_state_t new_state);
 
 #define ISLPCI_TX_TIMEOUT               (2*HZ)
 
-#if (LINUX_VERSION_CODE <= KERNEL_VERSION(2,5,75))
-# define irqreturn_t void
-# define IRQ_HANDLED
-# define IRQ_NONE
-#endif
-
 irqreturn_t islpci_interrupt(int, void *, struct pt_regs *);
 
 int prism54_post_setup(islpci_private *, int);
@@ -230,8 +210,6 @@ islpci_trigger(islpci_private *priv)
 
 struct net_device_stats *islpci_statistics(struct net_device *);
 
-int prism54_bring_down(islpci_private *);
-int islpci_alloc_memory(islpci_private *);
 int islpci_free_memory(islpci_private *);
 struct net_device *islpci_setup(struct pci_dev *);
 #endif				/* _ISLPCI_DEV_H */
diff --git a/drivers/net/wireless/prism54/islpci_eth.c b/drivers/net/wireless/prism54/islpci_eth.c
index c18c42d0c..9ae71e92b 100644
--- a/drivers/net/wireless/prism54/islpci_eth.c
+++ b/drivers/net/wireless/prism54/islpci_eth.c
@@ -26,6 +26,7 @@
 #include <linux/etherdevice.h>
 #include <linux/if_arp.h>
 
+#include "prismcompat.h"
 #include "isl_38xx.h"
 #include "islpci_eth.h"
 #include "islpci_mgt.h"
@@ -104,7 +105,7 @@ islpci_eth_transmit(struct sk_buff *skb, struct net_device *ndev)
 
 	/* check whether the destination queue has enough fragments for the frame */
 	curr_frag = le32_to_cpu(cb->driver_curr_frag[ISL38XX_CB_TX_DATA_LQ]);
-	if (curr_frag - priv->free_data_tx >= ISL38XX_CB_TX_QSIZE) {
+	if (unlikely(curr_frag - priv->free_data_tx >= ISL38XX_CB_TX_QSIZE)) {
 		printk(KERN_ERR "%s: transmit device queue full when awake\n",
 		       ndev->name);
 		netif_stop_queue(ndev);
@@ -120,7 +121,7 @@ islpci_eth_transmit(struct sk_buff *skb, struct net_device *ndev)
 	/* Check alignment and WDS frame formatting. The start of the packet should
 	 * be aligned on a 4-byte boundary. If WDS is enabled add another 6 bytes
 	 * and add WDS address information */
-	if (((long) skb->data & 0x03) | init_wds) {
+	if (likely(((long) skb->data & 0x03) | init_wds)) {
 		/* get the number of bytes to add and re-allign */
 		offset = (4 - (long) skb->data) & 0x03;
 		offset += init_wds ? 6 : 0;
@@ -155,6 +156,12 @@ islpci_eth_transmit(struct sk_buff *skb, struct net_device *ndev)
 		} else {
 			newskb =
 			    dev_alloc_skb(init_wds ? skb->len + 6 : skb->len);
+			if (unlikely(newskb == NULL)) {
+				printk(KERN_ERR "%s: Cannot allocate skb\n",
+				       ndev->name);
+				err = -ENOMEM;
+				goto drop_free;
+			}
 			newskb_offset = (4 - (long) newskb->data) & 0x03;
 
 			/* Check if newskb->data is aligned */
@@ -191,7 +198,7 @@ islpci_eth_transmit(struct sk_buff *skb, struct net_device *ndev)
 	pci_map_address = pci_map_single(priv->pdev,
 					 (void *) skb->data, skb->len,
 					 PCI_DMA_TODEVICE);
-	if (pci_map_address == 0) {
+	if (unlikely(pci_map_address == 0)) {
 		printk(KERN_WARNING "%s: cannot map buffer to PCI\n",
 		       ndev->name);
 
@@ -207,7 +214,7 @@ islpci_eth_transmit(struct sk_buff *skb, struct net_device *ndev)
 	priv->data_low_tx[index] = skb;
 	/* set the proper fragment start address and size information */
 	fragment->size = cpu_to_le16(frame_size);
-	fragment->flags = cpu_to_le16(0);  /* set to 1 if more fragments */
+	fragment->flags = cpu_to_le16(0);	/* set to 1 if more fragments */
 	fragment->address = cpu_to_le32(pci_map_address);
 	curr_frag++;
 
@@ -217,7 +224,7 @@ islpci_eth_transmit(struct sk_buff *skb, struct net_device *ndev)
 	cb->driver_curr_frag[ISL38XX_CB_TX_DATA_LQ] = cpu_to_le32(curr_frag);
 
 	if (curr_frag - priv->free_data_tx + ISL38XX_MIN_QTHRESHOLD
-	                                           > ISL38XX_CB_TX_QSIZE) {
+	    > ISL38XX_CB_TX_QSIZE) {
 		/* stop sends from upper layers */
 		netif_stop_queue(ndev);
 
@@ -238,7 +245,7 @@ islpci_eth_transmit(struct sk_buff *skb, struct net_device *ndev)
 
 	return 0;
 
- drop_free:
+      drop_free:
 	/* free the skbuf structure before aborting */
 	dev_kfree_skb(skb);
 	skb = NULL;
@@ -261,9 +268,9 @@ islpci_monitor_rx(islpci_private *priv, struct sk_buff **skb)
 	if (priv->ndev->type == ARPHRD_IEEE80211_PRISM) {
 		struct avs_80211_1_header *avs;
 		/* extract the relevant data from the header */
-		u32 clock = hdr->clock;
+		u32 clock = le32_to_cpu(hdr->clock);
 		u8 rate = hdr->rate;
-		u16 freq = be16_to_cpu(hdr->freq);
+		u16 freq = le16_to_cpu(hdr->freq);
 		u8 rssi = hdr->rssi;
 
 		skb_pull(*skb, sizeof (struct rfmon_header));
@@ -274,7 +281,7 @@ islpci_monitor_rx(islpci_private *priv, struct sk_buff **skb)
 									 avs_80211_1_header),
 								 0, GFP_ATOMIC);
 			if (newskb) {
-				kfree_skb(*skb);
+				dev_kfree_skb_irq(*skb);
 				*skb = newskb;
 			} else
 				return -1;
@@ -286,21 +293,21 @@ islpci_monitor_rx(islpci_private *priv, struct sk_buff **skb)
 		    (struct avs_80211_1_header *) skb_push(*skb,
 							   sizeof (struct
 								   avs_80211_1_header));
-
-		avs->version = htonl(P80211CAPTURE_VERSION);
-		avs->length = htonl(sizeof (struct avs_80211_1_header));
-		avs->mactime = __cpu_to_be64(clock);
-		avs->hosttime = __cpu_to_be64(jiffies);
-		avs->phytype = htonl(6);	/*OFDM: 6 for (g), 8 for (a) */
-		avs->channel = htonl(channel_of_freq(freq));
-		avs->datarate = htonl(rate * 5);
-		avs->antenna = htonl(0);	/*unknown */
-		avs->priority = htonl(0);	/*unknown */
-		avs->ssi_type = htonl(2);	/*2: dBm, 3: raw RSSI */
-		avs->ssi_signal = htonl(rssi);
-		avs->ssi_noise = htonl(priv->local_iwstatistics.qual.noise);	/*better than 'undefined', I assume */
-		avs->preamble = htonl(0);	/*unknown */
-		avs->encoding = htonl(0);	/*unknown */
+		
+		avs->version = cpu_to_be32(P80211CAPTURE_VERSION);
+		avs->length = cpu_to_be32(sizeof (struct avs_80211_1_header));
+		avs->mactime = cpu_to_be64(le64_to_cpu(clock));
+		avs->hosttime = cpu_to_be64(jiffies);
+		avs->phytype = cpu_to_be32(6);	/*OFDM: 6 for (g), 8 for (a) */
+		avs->channel = cpu_to_be32(channel_of_freq(freq));
+		avs->datarate = cpu_to_be32(rate * 5);
+		avs->antenna = cpu_to_be32(0);	/*unknown */
+		avs->priority = cpu_to_be32(0);	/*unknown */
+		avs->ssi_type = cpu_to_be32(3);	/*2: dBm, 3: raw RSSI */
+		avs->ssi_signal = cpu_to_be32(rssi & 0x7f);
+		avs->ssi_noise = cpu_to_be32(priv->local_iwstatistics.qual.noise);	/*better than 'undefined', I assume */
+		avs->preamble = cpu_to_be32(0);	/*unknown */
+		avs->encoding = cpu_to_be32(0);	/*unknown */
 	} else
 		skb_pull(*skb, sizeof (struct rfmon_header));
 
@@ -381,10 +388,10 @@ islpci_eth_receive(islpci_private *priv)
 	skb->dev = ndev;
 
 	/* take care of monitor mode and spy monitoring. */
-	if (priv->iw_mode == IW_MODE_MONITOR)
+	if (unlikely(priv->iw_mode == IW_MODE_MONITOR))
 		discard = islpci_monitor_rx(priv, &skb);
 	else {
-		if (skb->data[2 * ETH_ALEN] == 0) {
+		if (unlikely(skb->data[2 * ETH_ALEN] == 0)) {
 			/* The packet has a rx_annex. Read it for spy monitoring, Then
 			 * remove it, while keeping the 2 leading MAC addr.
 			 */
@@ -417,8 +424,8 @@ islpci_eth_receive(islpci_private *priv)
 	     skb->data[0], skb->data[1], skb->data[2], skb->data[3],
 	     skb->data[4], skb->data[5]);
 #endif
-	if (discard) {
-		dev_kfree_skb(skb);
+	if (unlikely(discard)) {
+		dev_kfree_skb_irq(skb);
 		skb = NULL;
 	} else
 		netif_rx(skb);
@@ -433,11 +440,13 @@ islpci_eth_receive(islpci_private *priv)
 	       index - priv->free_data_rx < ISL38XX_CB_RX_QSIZE) {
 		/* allocate an sk_buff for received data frames storage
 		 * include any required allignment operations */
-		if (skb = dev_alloc_skb(MAX_FRAGMENT_SIZE_RX + 2), skb == NULL) {
+		skb = dev_alloc_skb(MAX_FRAGMENT_SIZE_RX + 2);
+		if (unlikely(skb == NULL)) {
 			/* error allocating an sk_buff structure elements */
 			DEBUG(SHOW_ERROR_MESSAGES, "Error allocating skb \n");
 			break;
 		}
+		skb_reserve(skb, (4 - (long) skb->data) & 0x03);
 		/* store the new skb structure pointer */
 		index = index % ISL38XX_CB_RX_QSIZE;
 		priv->data_low_rx[index] = skb;
@@ -453,13 +462,13 @@ islpci_eth_receive(islpci_private *priv)
 		    pci_map_single(priv->pdev, (void *) skb->data,
 				   MAX_FRAGMENT_SIZE_RX + 2,
 				   PCI_DMA_FROMDEVICE);
-		if (priv->pci_map_rx_address[index] == (dma_addr_t) NULL) {
+		if (unlikely(priv->pci_map_rx_address[index] == (dma_addr_t) NULL)) {
 			/* error mapping the buffer to device accessable memory address */
 			DEBUG(SHOW_ERROR_MESSAGES,
 			      "Error mapping DMA address\n");
 
 			/* free the skbuf structure before aborting */
-			dev_kfree_skb((struct sk_buff *) skb);
+			dev_kfree_skb_irq((struct sk_buff *) skb);
 			skb = NULL;
 			break;
 		}
@@ -484,10 +493,10 @@ islpci_eth_receive(islpci_private *priv)
 void
 islpci_do_reset_and_wake(void *data)
 {
-       islpci_private *priv = (islpci_private *) data;
-       islpci_reset(priv, 1);
-       netif_wake_queue(priv->ndev);
-       priv->reset_task_pending = 0;
+	islpci_private *priv = (islpci_private *) data;
+	islpci_reset(priv, 1);
+	netif_wake_queue(priv->ndev);
+	priv->reset_task_pending = 0;
 }
 
 void
diff --git a/drivers/net/wireless/prism54/islpci_hotplug.c b/drivers/net/wireless/prism54/islpci_hotplug.c
index 34b3b59fe..11b315ba1 100644
--- a/drivers/net/wireless/prism54/islpci_hotplug.c
+++ b/drivers/net/wireless/prism54/islpci_hotplug.c
@@ -24,94 +24,56 @@
 #include <linux/delay.h>
 #include <linux/init.h> /* For __init, __exit */
 
+#include "prismcompat.h"
 #include "islpci_dev.h"
 #include "islpci_mgt.h"		/* for pc_debug */
 #include "isl_oid.h"
 
 #define DRV_NAME	"prism54"
-#define DRV_VERSION	"1.1"
+#define DRV_VERSION	"1.2"
 
 MODULE_AUTHOR("[Intersil] R.Bastings and W.Termorshuizen, The prism54.org Development Team <prism54-devel@prism54.org>");
 MODULE_DESCRIPTION("The Prism54 802.11 Wireless LAN adapter");
 MODULE_LICENSE("GPL");
 
+static int	init_pcitm = 0;
+module_param(init_pcitm, int, 0);
+
 /* In this order: vendor, device, subvendor, subdevice, class, class_mask,
  * driver_data 
- * Note: for driver_data we put the device's name 
  * If you have an update for this please contact prism54-devel@prism54.org 
  * The latest list can be found at http://prism54.org/supported_cards.php */
 static const struct pci_device_id prism54_id_tbl[] = {
+	/* Intersil PRISM Duette/Prism GT Wireless LAN adapter */
 	{
-	 PCIVENDOR_3COM, PCIDEVICE_3COM6001,
-	 PCIVENDOR_3COM, PCIDEVICE_3COM6001,
-	 0, 0,
-	 (unsigned long) "3COM 3CRWE154G72 Wireless LAN adapter"},
-	{
-	 PCIVENDOR_INTERSIL, PCIDEVICE_ISL3890,
-	 PCIVENDOR_DLINK, 0x3202UL, 
-	 0, 0,
-	 (unsigned long) "D-Link Air Plus Xtreme G A1 - DWL-g650 A1"},
-	{
-	 PCIVENDOR_INTERSIL, PCIDEVICE_ISL3890,
-	 PCIVENDOR_IODATA, 0xd019UL, 
-	 0, 0,
-	 (unsigned long) "I-O Data WN-G54/CB - WN-G54/CB"},
-	{
-	 PCIVENDOR_INTERSIL, PCIDEVICE_ISL3890,
-	 PCIVENDOR_NETGEAR, 0x4800UL,
-	 0, 0,
-	 (unsigned long) "Netgear WG511"},
-	{
-	 PCIVENDOR_INTERSIL, PCIDEVICE_ISL3890,
-	 PCIVENDOR_I4, 0x0020UL,
-	 0, 0,
-	 (unsigned long) "PLANEX GW-DS54G"},
-	{
-	 PCIVENDOR_INTERSIL, PCIDEVICE_ISL3890,
-	 PCIVENDOR_SMC, 0x2802UL,
-	 0, 0,
-	 (unsigned long) "EZ Connect g 2.4GHz 54 Mbps Wireless PCI Card - SMC2802W"},
-	{
-	 PCIVENDOR_INTERSIL, PCIDEVICE_ISL3890,
-	 PCIVENDOR_SMC, 0x2835UL,
-	 0, 0,
-	 (unsigned long) "EZ Connect g 2.4GHz 54 Mbps Wireless Cardbus Adapter - SMC2835W"},
-	{
-	 PCIVENDOR_INTERSIL, PCIDEVICE_ISL3890,
-	 PCIVENDOR_INTERSIL, 0x0000UL, /* This was probably a bogus reading... */
-	 0, 0,
-	 (unsigned long) "SparkLAN WL-850F"},
-	{
-	 PCIVENDOR_INTERSIL, PCIDEVICE_ISL3890,
-	 PCIVENDOR_I4, 0x0014UL,
-	 0, 0,
-	 (unsigned long) "I4 Z-Com XG-600"},
-	{
-	 PCIVENDOR_INTERSIL, PCIDEVICE_ISL3890,
-	 PCIVENDOR_I4, 0x0020UL,
-	 0, 0,
-	 (unsigned long) "I4 Z-Com XG-900/PLANEX GW-DS54G"},
-	{
-	 PCIVENDOR_INTERSIL, PCIDEVICE_ISL3890,
-	 PCIVENDOR_ACCTON, 0xee03UL,
-	 0, 0,
-	 (unsigned long) "SMC 2802Wv2"},
+	 0x1260, 0x3890,
+	 PCI_ANY_ID, PCI_ANY_ID,
+	 0, 0, 0
+	},
+
+	/* 3COM 3CRWE154G72 Wireless LAN adapter */
 	{
-	 PCIVENDOR_INTERSIL, PCIDEVICE_ISL3890,
-	 PCIVENDOR_SMC, 0xa835UL,
-	 0, 0,
-	 (unsigned long) "SMC 2835Wv2"},
+	 0x10b7, 0x6001,
+	 PCI_ANY_ID, PCI_ANY_ID,
+	 0, 0, 0
+	},
+
+	/* Intersil PRISM Indigo Wireless LAN adapter */
 	{
-	 PCIVENDOR_INTERSIL, PCIDEVICE_ISL3877,
+	 0x1260, 0x3877,
 	 PCI_ANY_ID, PCI_ANY_ID,
-	 0, 0,
-	 (unsigned long) "Intersil PRISM Indigo Wireless LAN adapter"},
-	{ /* Default */
-	 PCIVENDOR_INTERSIL, PCIDEVICE_ISL3890,
+	 0, 0, 0
+	},
+
+	/* Intersil PRISM Javelin/Xbow Wireless LAN adapter */
+	{
+	 0x1260, 0x3886,
 	 PCI_ANY_ID, PCI_ANY_ID,
-	 0, 0,
-	 (unsigned long) "Intersil PRISM Duette/Prism GT Wireless LAN adapter"},
-	{0,}
+	 0, 0, 0
+	},
+
+	/* End of list */
+	{0,0,0,0,0,0,0}
 };
 
 /* register the device with the Hotplug facilities of the kernel */
@@ -132,69 +94,6 @@ static struct pci_driver prism54_driver = {
 	/* .enable_wake ; we don't support this yet */
 };
 
-static void
-prism54_get_card_model(struct net_device *ndev)
-{
-	islpci_private	*priv;
-	char		*modelp;
-
-	priv = netdev_priv(ndev);
-	switch (priv->pdev->subsystem_device) {
-	case PCIDEVICE_ISL3877:
-		modelp = "PRISM Indigo";
-		break;
-	case PCIDEVICE_3COM6001:
-		modelp = "3COM 3CRWE154G72";
-		break;
-	case 0x3202UL:
-		modelp = "D-Link DWL-g650 A1";
-		break;
-	case 0xd019UL:
-		modelp = "WN-G54/CB";
-		break;
-	case 0x4800UL:
-		modelp = "Netgear WG511";
-		break;
-	case 0x2802UL:
-		modelp = "SMC2802W";
-		break;
-	case 0xee03UL:
-		modelp = "SMC2802W V2";
-		break;
-	case 0x2835UL:
-		modelp = "SMC2835W";
-		break;
-	case 0xa835UL:
-		modelp = "SMC2835W V2";
-		break;
-	/* Let's leave this one out for now since it seems bogus/wrong 
-	 * Even if the manufacturer did use 0x0000UL it may not be correct
-	 * by their part, therefore deserving no name ;) */
-	/*      case 0x0000UL: 
-	 *              modelp = "SparkLAN WL-850F";
-	 *              break;*/
-
-	/* We have two reported for the one below :( */
-	case 0x0014UL:
-		modelp = "XG-600";
-		break;
-	case 0x0020UL:
-		modelp = "XG-900/GW-DS54G";
-		break;
-/* Default it */
-/*
-	case PCIDEVICE_ISL3890:
-		modelp = "PRISM Duette/GT";
-		break;
-*/
-	default:
-		modelp = "PRISM Duette/GT";
-	}
-	printk(KERN_DEBUG "%s: %s driver detected card model: %s\n",
-			ndev->name, DRV_NAME, modelp);
-	return;
-}
-
 /******************************************************************************
     Module initialization functions
 ******************************************************************************/
@@ -245,9 +144,14 @@ prism54_probe(struct pci_dev *pdev, const struct pci_device_id *id)
 	 *
 	 * 	Writing zero to both these two registers will disable both timeouts and
 	 * 	*can* solve problems caused by devices that are slow to respond.
+	 *	Make this configurable - MSW
 	 */
-	pci_write_config_byte(pdev, 0x40, 0);
-	pci_write_config_byte(pdev, 0x41, 0);
+	if ( init_pcitm >= 0 ) {
+		pci_write_config_byte(pdev, 0x40, (u8)init_pcitm);
+		pci_write_config_byte(pdev, 0x41, (u8)init_pcitm);
+	} else {
+		printk(KERN_INFO "PCI TRDY/RETRY unchanged\n");
+	}
 
 	/* request the pci device I/O regions */
 	rvalue = pci_request_regions(pdev, DRV_NAME);
@@ -269,6 +173,9 @@ prism54_probe(struct pci_dev *pdev, const struct pci_device_id *id)
 	DEBUG(SHOW_TRACING, "%s: pci_set_master(pdev)\n", DRV_NAME);
 	pci_set_master(pdev);
 
+	/* enable MWI */
+	pci_set_mwi(pdev);
+
 	/* setup the network device interface and its structure */
 	if (!(ndev = islpci_setup(pdev))) {
 		/* error configuring the driver as a network device */
@@ -296,17 +203,14 @@ prism54_probe(struct pci_dev *pdev, const struct pci_device_id *id)
 
 	/* firmware upload is triggered in islpci_open */
 
-	/* Pretty card model discovery output */
-	prism54_get_card_model(ndev);
-
 	return 0;
 
       do_unregister_netdev:
 	unregister_netdev(ndev);
 	islpci_free_memory(priv);
-	pci_set_drvdata(pdev, 0);
+	pci_set_drvdata(pdev, NULL);
 	free_netdev(ndev);
-	priv = 0;
+	priv = NULL;
       do_pci_release_regions:
 	pci_release_regions(pdev);
       do_pci_disable_device:
@@ -322,7 +226,7 @@ void
 prism54_remove(struct pci_dev *pdev)
 {
 	struct net_device *ndev = pci_get_drvdata(pdev);
-	islpci_private *priv = ndev ? netdev_priv(ndev) : 0;
+	islpci_private *priv = ndev ? netdev_priv(ndev) : NULL;
 	BUG_ON(!priv);
 
 	if (!__in_cleanup_module) {
@@ -350,9 +254,9 @@ prism54_remove(struct pci_dev *pdev)
 	/* free the PCI memory and unmap the remapped page */
 	islpci_free_memory(priv);
 
-	pci_set_drvdata(pdev, 0);
+	pci_set_drvdata(pdev, NULL);
 	free_netdev(ndev);
-	priv = 0;
+	priv = NULL;
 
 	pci_release_regions(pdev);
 
@@ -363,7 +267,7 @@ int
 prism54_suspend(struct pci_dev *pdev, u32 state)
 {
 	struct net_device *ndev = pci_get_drvdata(pdev);
-	islpci_private *priv = ndev ? netdev_priv(ndev) : 0;
+	islpci_private *priv = ndev ? netdev_priv(ndev) : NULL;
 	BUG_ON(!priv);
 
 	printk(KERN_NOTICE "%s: got suspend request (state %d)\n",
@@ -388,7 +292,7 @@ int
 prism54_resume(struct pci_dev *pdev)
 {
 	struct net_device *ndev = pci_get_drvdata(pdev);
-	islpci_private *priv = ndev ? netdev_priv(ndev) : 0;
+	islpci_private *priv = ndev ? netdev_priv(ndev) : NULL;
 	BUG_ON(!priv);
 
 	printk(KERN_NOTICE "%s: got resume request\n", ndev->name);
diff --git a/drivers/net/wireless/prism54/islpci_mgt.c b/drivers/net/wireless/prism54/islpci_mgt.c
index bdf77d6c5..95b709c90 100644
--- a/drivers/net/wireless/prism54/islpci_mgt.c
+++ b/drivers/net/wireless/prism54/islpci_mgt.c
@@ -22,12 +22,12 @@
 #include <linux/netdevice.h>
 #include <linux/module.h>
 #include <linux/pci.h>
-#include <linux/moduleparam.h>
 
 #include <asm/io.h>
 #include <asm/system.h>
 #include <linux/if_arp.h>
 
+#include "prismcompat.h"
 #include "isl_38xx.h"
 #include "islpci_mgt.h"
 #include "isl_oid.h"		/* additional types and defs for isl38xx fw */
@@ -63,7 +63,6 @@ display_buffer(char *buffer, int length)
     Queue handling for management frames
 ******************************************************************************/
 
-  
 /*
  * Helper function to create a PIMFOR management frame header.
  */
@@ -86,8 +85,8 @@ pimfor_decode_header(void *data, int len)
 {
 	pimfor_header_t *h = data;
 
-        while ((void *) h < data + len) {
-		if(h->flags & PIMFOR_FLAG_LITTLE_ENDIAN) {
+	while ((void *) h < data + len) {
+		if (h->flags & PIMFOR_FLAG_LITTLE_ENDIAN) {
 			le32_to_cpus(&h->oid);
 			le32_to_cpus(&h->length);
 		} else {
@@ -108,8 +107,8 @@ int
 islpci_mgmt_rx_fill(struct net_device *ndev)
 {
 	islpci_private *priv = netdev_priv(ndev);
-	isl38xx_control_block *cb =    /* volatile not needed */
-		(isl38xx_control_block *) priv->control_block;
+	isl38xx_control_block *cb =	/* volatile not needed */
+	    (isl38xx_control_block *) priv->control_block;
 	u32 curr = le32_to_cpu(cb->driver_curr_frag[ISL38XX_CB_RX_MGMTQ]);
 
 #if VERBOSE > SHOW_ERROR_MESSAGES
@@ -124,7 +123,8 @@ islpci_mgmt_rx_fill(struct net_device *ndev)
 		if (buf->mem == NULL) {
 			buf->mem = kmalloc(MGMT_FRAME_SIZE, GFP_ATOMIC);
 			if (!buf->mem) {
-				printk(KERN_WARNING "Error allocating management frame.\n");
+				printk(KERN_WARNING
+				       "Error allocating management frame.\n");
 				return -ENOMEM;
 			}
 			buf->size = MGMT_FRAME_SIZE;
@@ -133,24 +133,24 @@ islpci_mgmt_rx_fill(struct net_device *ndev)
 			buf->pci_addr = pci_map_single(priv->pdev, buf->mem,
 						       MGMT_FRAME_SIZE,
 						       PCI_DMA_FROMDEVICE);
-			if(!buf->pci_addr) {
-				printk(KERN_WARNING "Failed to make memory DMA'able\n.");
+			if (!buf->pci_addr) {
+				printk(KERN_WARNING
+				       "Failed to make memory DMA'able\n.");
 				return -ENOMEM;
 			}
 		}
 
-                /* be safe: always reset control block information */
+		/* be safe: always reset control block information */
 		frag->size = cpu_to_le16(MGMT_FRAME_SIZE);
 		frag->flags = 0;
 		frag->address = cpu_to_le32(buf->pci_addr);
 		curr++;
 
-                /* The fragment address in the control block must have
-                 * been written before announcing the frame buffer to
-                 * device */
+		/* The fragment address in the control block must have
+		 * been written before announcing the frame buffer to
+		 * device */
 		wmb();
-		cb->driver_curr_frag[ISL38XX_CB_RX_MGMTQ] =
-			cpu_to_le32(curr);
+		cb->driver_curr_frag[ISL38XX_CB_RX_MGMTQ] = cpu_to_le32(curr);
 	}
 	return 0;
 }
@@ -168,7 +168,7 @@ islpci_mgt_transmit(struct net_device *ndev, int operation, unsigned long oid,
 {
 	islpci_private *priv = netdev_priv(ndev);
 	isl38xx_control_block *cb =
-		(isl38xx_control_block *) priv->control_block;
+	    (isl38xx_control_block *) priv->control_block;
 	void *p;
 	int err = -EINVAL;
 	unsigned long flags;
@@ -242,25 +242,25 @@ islpci_mgt_transmit(struct net_device *ndev, int operation, unsigned long oid,
 	priv->mgmt_tx[index] = buf;
 	frag = &cb->tx_data_mgmt[index];
 	frag->size = cpu_to_le16(frag_len);
-	frag->flags = 0;   /* for any other than the last fragment, set to 1 */
+	frag->flags = 0;	/* for any other than the last fragment, set to 1 */
 	frag->address = cpu_to_le32(buf.pci_addr);
 
 	/* The fragment address in the control block must have
 	 * been written before announcing the frame buffer to
 	 * device */
 	wmb();
-	cb->driver_curr_frag[ISL38XX_CB_TX_MGMTQ] = cpu_to_le32(curr_frag+1);
+	cb->driver_curr_frag[ISL38XX_CB_TX_MGMTQ] = cpu_to_le32(curr_frag + 1);
 	spin_unlock_irqrestore(&priv->slock, flags);
 
 	/* trigger the device */
 	islpci_trigger(priv);
 	return 0;
 
- error_unlock:
+      error_unlock:
 	spin_unlock_irqrestore(&priv->slock, flags);
- error_free:
+      error_free:
 	kfree(buf.mem);
- error:
+      error:
 	return err;
 }
 
@@ -274,50 +274,49 @@ islpci_mgt_receive(struct net_device *ndev)
 {
 	islpci_private *priv = netdev_priv(ndev);
 	isl38xx_control_block *cb =
-		(isl38xx_control_block *) priv->control_block;
+	    (isl38xx_control_block *) priv->control_block;
 	u32 curr_frag;
 
 #if VERBOSE > SHOW_ERROR_MESSAGES
 	DEBUG(SHOW_FUNCTION_CALLS, "islpci_mgt_receive \n");
 #endif
 
-
-        /* Only once per interrupt, determine fragment range to
-         * process.  This avoids an endless loop (i.e. lockup) if
-         * frames come in faster than we can process them. */
+	/* Only once per interrupt, determine fragment range to
+	 * process.  This avoids an endless loop (i.e. lockup) if
+	 * frames come in faster than we can process them. */
 	curr_frag = le32_to_cpu(cb->device_curr_frag[ISL38XX_CB_RX_MGMTQ]);
 	barrier();
 
-	for ( ; priv->index_mgmt_rx < curr_frag; priv->index_mgmt_rx++) {
+	for (; priv->index_mgmt_rx < curr_frag; priv->index_mgmt_rx++) {
 		pimfor_header_t *header;
 		u32 index = priv->index_mgmt_rx % ISL38XX_CB_MGMT_QSIZE;
 		struct islpci_membuf *buf = &priv->mgmt_rx[index];
 		u16 frag_len;
 		int size;
 		struct islpci_mgmtframe *frame;
-              
-                /* I have no idea (and no documentation) if flags != 0
-                 * is possible.  Drop the frame, reuse the buffer. */
-                if(le16_to_cpu(cb->rx_data_mgmt[index].flags) != 0) {
-                        printk(KERN_WARNING "%s: unknown flags 0x%04x\n",
-                               ndev->name,
-                               le16_to_cpu(cb->rx_data_mgmt[index].flags));
-                        continue;
-                }
+
+		/* I have no idea (and no documentation) if flags != 0
+		 * is possible.  Drop the frame, reuse the buffer. */
+		if (le16_to_cpu(cb->rx_data_mgmt[index].flags) != 0) {
+			printk(KERN_WARNING "%s: unknown flags 0x%04x\n",
+			       ndev->name,
+			       le16_to_cpu(cb->rx_data_mgmt[index].flags));
+			continue;
+		}
 
 		/* The device only returns the size of the header(s) here. */
 		frag_len = le16_to_cpu(cb->rx_data_mgmt[index].size);
 
 		/*
-                 * We appear to have no way to tell the device the
-                 * size of a receive buffer.  Thus, if this check
-                 * triggers, we likely have kernel heap corruption. */
-                if (frag_len > MGMT_FRAME_SIZE) {
-                        printk(KERN_WARNING "%s: Bogus packet size of %d (%#x).\
-n",
-                               ndev->name, frag_len, frag_len);
-                        frag_len = MGMT_FRAME_SIZE;
-                }
+		 * We appear to have no way to tell the device the
+		 * size of a receive buffer.  Thus, if this check
+		 * triggers, we likely have kernel heap corruption. */
+		if (frag_len > MGMT_FRAME_SIZE) {
+			printk(KERN_WARNING
+				"%s: Bogus packet size of %d (%#x).\n",
+				ndev->name, frag_len, frag_len);
+			frag_len = MGMT_FRAME_SIZE;
+		}
 
 		/* Ensure the results of device DMA are visible to the CPU. */
 		pci_dma_sync_single(priv->pdev, buf->pci_addr,
@@ -339,30 +338,32 @@ n",
 #if VERBOSE > SHOW_ERROR_MESSAGES
 		DEBUG(SHOW_PIMFOR_FRAMES,
 		      "PIMFOR: op %i, oid 0x%08x, device %i, flags 0x%x length 0x%x \n",
-		      header->operation, header->oid, header->device_id, 
+		      header->operation, header->oid, header->device_id,
 		      header->flags, header->length);
 
 		/* display the buffer contents for debugging */
 		display_buffer((char *) header, PIMFOR_HEADER_SIZE);
-		display_buffer((char *) header + PIMFOR_HEADER_SIZE, header->length);
+		display_buffer((char *) header + PIMFOR_HEADER_SIZE,
+			       header->length);
 #endif
 
 		/* nobody sends these */
 		if (header->flags & PIMFOR_FLAG_APPLIC_ORIGIN) {
-			printk(KERN_DEBUG "%s: errant PIMFOR application frame\n",
+			printk(KERN_DEBUG
+			       "%s: errant PIMFOR application frame\n",
 			       ndev->name);
 			continue;
 		}
 
 		/* Determine frame size, skipping OID_INL_TUNNEL headers. */
 		size = PIMFOR_HEADER_SIZE + header->length;
-		frame = kmalloc(sizeof(struct islpci_mgmtframe) + size,
+		frame = kmalloc(sizeof (struct islpci_mgmtframe) + size,
 				GFP_ATOMIC);
 		if (!frame) {
-			printk(KERN_WARNING "%s: Out of memory, cannot handle oid 0x%08x\n",
-
+			printk(KERN_WARNING
+			       "%s: Out of memory, cannot handle oid 0x%08x\n",
 			       ndev->name, header->oid);
-			continue;        
+			continue;
 		}
 		frame->ndev = ndev;
 		memcpy(&frame->buf, header, size);
@@ -382,7 +383,7 @@ n",
 			       header->oid, header->device_id, header->flags,
 			       header->length);
 #endif
-                      
+
 			/* Create work to handle trap out of interrupt
 			 * context. */
 			INIT_WORK(&frame->ws, prism54_process_trap, frame);
@@ -392,14 +393,13 @@ n",
 			/* Signal the one waiting process that a response
 			 * has been received. */
 			if ((frame = xchg(&priv->mgmt_received, frame)) != NULL) {
-				printk(KERN_WARNING "%s: mgmt response not collected\n",
+				printk(KERN_WARNING
+				       "%s: mgmt response not collected\n",
 				       ndev->name);
 				kfree(frame);
 			}
-                              
 #if VERBOSE > SHOW_ERROR_MESSAGES
-			DEBUG(SHOW_TRACING,
-			      "Wake up Mgmt Queue\n");
+			DEBUG(SHOW_TRACING, "Wake up Mgmt Queue\n");
 #endif
 			wake_up(&priv->mgmt_wqueue);
 		}
@@ -416,22 +416,22 @@ void
 islpci_mgt_cleanup_transmit(struct net_device *ndev)
 {
 	islpci_private *priv = netdev_priv(ndev);
-	isl38xx_control_block *cb =    /* volatile not needed */
-		(isl38xx_control_block *) priv->control_block;
+	isl38xx_control_block *cb =	/* volatile not needed */
+	    (isl38xx_control_block *) priv->control_block;
 	u32 curr_frag;
 
 #if VERBOSE > SHOW_ERROR_MESSAGES
-        DEBUG(SHOW_FUNCTION_CALLS, "islpci_mgt_cleanup_transmit\n");
+	DEBUG(SHOW_FUNCTION_CALLS, "islpci_mgt_cleanup_transmit\n");
 #endif
 
 	/* Only once per cleanup, determine fragment range to
 	 * process.  This avoids an endless loop (i.e. lockup) if
 	 * the device became confused, incrementing device_curr_frag
 	 * rapidly. */
-	curr_frag = le32_to_cpu(cb->device_curr_frag[ISL38XX_CB_TX_MGMTQ]); 
+	curr_frag = le32_to_cpu(cb->device_curr_frag[ISL38XX_CB_TX_MGMTQ]);
 	barrier();
 
-	for ( ; priv->index_mgmt_tx < curr_frag; priv->index_mgmt_tx++) {
+	for (; priv->index_mgmt_tx < curr_frag; priv->index_mgmt_tx++) {
 		int index = priv->index_mgmt_tx % ISL38XX_CB_MGMT_QSIZE;
 		struct islpci_membuf *buf = &priv->mgmt_tx[index];
 		pci_unmap_single(priv->pdev, buf->pci_addr, buf->size,
@@ -456,23 +456,16 @@ islpci_mgt_transaction(struct net_device *ndev,
 	const long wait_cycle_jiffies = (ISL38XX_WAIT_CYCLE * 10 * HZ) / 1000;
 	long timeout_left = ISL38XX_MAX_WAIT_CYCLES * wait_cycle_jiffies;
 	int err;
-#if LINUX_VERSION_CODE >= KERNEL_VERSION(2,6,0)
 	DEFINE_WAIT(wait);
-#else
-	DECLARE_WAITQUEUE(wait, current);
-#endif
+
+	*recvframe = NULL;
 
 	if (down_interruptible(&priv->mgmt_sem))
 		return -ERESTARTSYS;
 
-#if LINUX_VERSION_CODE >= KERNEL_VERSION(2,6,0)
 	prepare_to_wait(&priv->mgmt_wqueue, &wait, TASK_UNINTERRUPTIBLE);
-#else
-	set_current_state(TASK_UNINTERRUPTIBLE);
-	add_wait_queue(&priv->mgmt_wqueue, &wait);
-#endif
 	err = islpci_mgt_transmit(ndev, operation, oid, senddata, sendlen);
-	if(err)
+	if (err)
 		goto out;
 
 	err = -ETIMEDOUT;
@@ -483,13 +476,24 @@ islpci_mgt_transaction(struct net_device *ndev,
 		timeleft = schedule_timeout(wait_cycle_jiffies);
 		frame = xchg(&priv->mgmt_received, NULL);
 		if (frame) {
-			*recvframe = frame;
-			err = 0;
-			goto out;
+			if (frame->header->oid == oid) {
+				*recvframe = frame;
+				err = 0;
+				goto out;
+			} else {
+				printk(KERN_DEBUG
+				       "%s: expecting oid 0x%x, received 0x%x.\n",
+				       ndev->name, (unsigned int) oid,
+				       frame->header->oid);
+				kfree(frame);
+				frame = NULL;
+			}
 		}
-		if(timeleft == 0) {
-			printk(KERN_DEBUG "%s: timeout waiting for mgmt response %lu, trigging device\n",
-			       ndev->name, timeout_left);
+		if (timeleft == 0) {
+			printk(KERN_DEBUG
+				"%s: timeout waiting for mgmt response %lu, "
+				"triggering device\n",
+				ndev->name, timeout_left);
 			islpci_trigger(priv);
 		}
 		timeout_left += timeleft - wait_cycle_jiffies;
@@ -499,12 +503,7 @@ islpci_mgt_transaction(struct net_device *ndev,
 
 	/* TODO: we should reset the device here */     
  out:
-#if LINUX_VERSION_CODE >= KERNEL_VERSION(2,6,0)
 	finish_wait(&priv->mgmt_wqueue, &wait);
-#else
-	remove_wait_queue(&priv->mgmt_wqueue, &wait);
-	set_current_state(TASK_RUNNING);
-#endif
 	up(&priv->mgmt_sem);
 	return err;
 }
diff --git a/drivers/net/wireless/prism54/islpci_mgt.h b/drivers/net/wireless/prism54/islpci_mgt.h
index 80337f926..21303fc05 100644
--- a/drivers/net/wireless/prism54/islpci_mgt.h
+++ b/drivers/net/wireless/prism54/islpci_mgt.h
@@ -24,15 +24,6 @@
 #include <linux/wireless.h>
 #include <linux/skbuff.h>
 
-#if LINUX_VERSION_CODE > KERNEL_VERSION(2,5,41)
-# include <linux/workqueue.h>
-#else
-# include <linux/tqueue.h>
-# define work_struct tq_struct
-# define INIT_WORK INIT_TQUEUE
-# define schedule_work schedule_task
-#endif
-
 /*
  *  Function definitions
  */
@@ -43,22 +34,10 @@
 #define TRACE(devname)   K_DEBUG(SHOW_TRACING, VERBOSE, "%s:  -> " __FUNCTION__ "()\n", devname)
 
 extern int pc_debug;
-static const int init_wds = 0;	/* help compiler optimize away dead code */
+#define init_wds 0	/* help compiler optimize away dead code */
 
 
 /* General driver definitions */
-#define PCIVENDOR_INTERSIL                      0x1260UL
-#define PCIVENDOR_3COM				0x10b7UL
-#define PCIVENDOR_DLINK				0x1186UL
-#define PCIVENDOR_I4				0x17cfUL
-#define PCIVENDOR_IODATA			0x10fcUL
-#define PCIVENDOR_NETGEAR			0x1385UL
-#define PCIVENDOR_SMC				0x10b8UL
-#define PCIVENDOR_ACCTON			0x1113UL
-
-#define PCIDEVICE_ISL3877                       0x3877UL
-#define PCIDEVICE_ISL3890                       0x3890UL
-#define	PCIDEVICE_3COM6001			0x6001UL
 #define PCIDEVICE_LATENCY_TIMER_MIN 		0x40
 #define PCIDEVICE_LATENCY_TIMER_VAL 		0x50
 
diff --git a/drivers/net/wireless/prism54/oid_mgt.c b/drivers/net/wireless/prism54/oid_mgt.c
index cfa541ca2..333926d32 100644
--- a/drivers/net/wireless/prism54/oid_mgt.c
+++ b/drivers/net/wireless/prism54/oid_mgt.c
@@ -16,6 +16,7 @@
  *
  */
 
+#include "prismcompat.h"
 #include "islpci_dev.h"
 #include "islpci_mgt.h"
 #include "isl_oid.h"
@@ -27,10 +28,6 @@ const int frequency_list_bg[] = { 2412, 2417, 2422, 2427, 2432, 2437, 2442,
 	2447, 2452, 2457, 2462, 2467, 2472, 2484
 };
 
-const int frequency_list_a[] = { 5170, 5180, 5190, 5200, 5210, 5220, 5230,
-	5240, 5260, 5280, 5300, 5320
-};
-
 int
 channel_of_freq(int f)
 {
@@ -39,17 +36,11 @@ channel_of_freq(int f)
 	if ((f >= 2412) && (f <= 2484)) {
 		while ((c < 14) && (f != frequency_list_bg[c]))
 			c++;
-		if (c >= 14)
-			return 0;
-	} else if ((f >= (int) 5170) && (f <= (int) 5320)) {
-		while ((c < 12) && (f != frequency_list_a[c]))
-			c++;
-		if (c >= 12)
-			return 0;
+		return (c >= 14) ? 0 : ++c;
+	} else if ((f >= (int) 5000) && (f <= (int) 6000)) {
+		return ( (f - 5000) / 5 );
 	} else
 		return 0;
-
-	return ++c;
 }
 
 #define OID_STRUCT(name,oid,s,t) [name] = {oid, 0, sizeof(s), t}
@@ -71,7 +62,7 @@ struct oid_t isl_oid[] = {
 
 	/* 802.11 */
 	OID_U32_C(DOT11_OID_BSSTYPE, 0x10000000),
-	OID_STRUCT_C(DOT11_OID_BSSID, 0x10000001, u8[6], OID_TYPE_SSID),
+	OID_STRUCT_C(DOT11_OID_BSSID, 0x10000001, u8[6], OID_TYPE_RAW),
 	OID_STRUCT_C(DOT11_OID_SSID, 0x10000002, struct obj_ssid,
 		     OID_TYPE_SSID),
 	OID_U32(DOT11_OID_STATE, 0x10000003),
@@ -228,7 +219,7 @@ struct oid_t isl_oid[] = {
 	OID_UNKNOWN(OID_INL_MEMORY, 0xFF020002),
 	OID_U32_C(OID_INL_MODE, 0xFF020003),
 	OID_UNKNOWN(OID_INL_COMPONENT_NR, 0xFF020004),
-	OID_UNKNOWN(OID_INL_VERSION, 0xFF020005),
+	OID_STRUCT(OID_INL_VERSION, 0xFF020005, u8[8], OID_TYPE_RAW),
 	OID_UNKNOWN(OID_INL_INTERFACE_ID, 0xFF020006),
 	OID_UNKNOWN(OID_INL_COMPONENT_ID, 0xFF020007),
 	OID_U32_C(OID_INL_CONFIG, 0xFF020008),
@@ -417,7 +408,7 @@ int
 mgt_set_request(islpci_private *priv, enum oid_num_t n, int extra, void *data)
 {
 	int ret = 0;
-	struct islpci_mgmtframe *response;
+	struct islpci_mgmtframe *response = NULL;
 	int response_op = PIMFOR_OP_ERROR;
 	int dlen;
 	void *cache, *_data = data;
@@ -449,7 +440,7 @@ mgt_set_request(islpci_private *priv, enum oid_num_t n, int extra, void *data)
 	if (cache)
 		down_write(&priv->mib_sem);
 
-	if (islpci_get_state(priv) >= PRV_STATE_INIT) {
+	if (islpci_get_state(priv) >= PRV_STATE_READY) {
 		ret = islpci_mgt_transaction(priv->ndev, PIMFOR_OP_SET, oid,
 					     _data, dlen, &response);
 		if (!ret) {
@@ -457,7 +448,7 @@ mgt_set_request(islpci_private *priv, enum oid_num_t n, int extra, void *data)
 			islpci_mgt_release(response);
 		}
 		if (ret || response_op == PIMFOR_OP_ERROR)
-		        ret = -EIO;
+			ret = -EIO;
 	} else if (!cache)
 		ret = -EIO;
 
@@ -482,7 +473,7 @@ mgt_get_request(islpci_private *priv, enum oid_num_t n, int extra, void *data,
 	int ret = -EIO;
 	int reslen = 0;
 	struct islpci_mgmtframe *response = NULL;
-	
+
 	int dlen;
 	void *cache, *_res = NULL;
 	u32 oid;
@@ -490,6 +481,8 @@ mgt_get_request(islpci_private *priv, enum oid_num_t n, int extra, void *data,
 	BUG_ON(OID_NUM_LAST <= n);
 	BUG_ON(extra > isl_oid[n].range);
 
+	res->ptr = NULL;
+
 	if (!priv->mib)
 		/* memory has been freed */
 		return -1;
@@ -503,11 +496,11 @@ mgt_get_request(islpci_private *priv, enum oid_num_t n, int extra, void *data,
 	if (cache)
 		down_read(&priv->mib_sem);
 
-	if (islpci_get_state(priv) >= PRV_STATE_INIT) {
+	if (islpci_get_state(priv) >= PRV_STATE_READY) {
 		ret = islpci_mgt_transaction(priv->ndev, PIMFOR_OP_GET,
 					     oid, data, dlen, &response);
 		if (ret || !response ||
-			response->header->operation == PIMFOR_OP_ERROR) {
+		    response->header->operation == PIMFOR_OP_ERROR) {
 			if (response)
 				islpci_mgt_release(response);
 			ret = -EIO;
@@ -542,9 +535,9 @@ mgt_get_request(islpci_private *priv, enum oid_num_t n, int extra, void *data,
 	if (reslen > isl_oid[n].size)
 		printk(KERN_DEBUG
 		       "mgt_get_request(0x%x): received data length was bigger "
-		       "than expected (%d > %d). Memory is probably corrupted... ",
+		       "than expected (%d > %d). Memory is probably corrupted...",
 		       oid, reslen, isl_oid[n].size);
-	
+
 	return ret;
 }
 
@@ -564,11 +557,11 @@ mgt_commit_list(islpci_private *priv, enum oid_num_t *l, int n)
 		while (j <= t->range) {
 			response = NULL;
 			ret |= islpci_mgt_transaction(priv->ndev, PIMFOR_OP_SET,
-			                              oid, data, t->size,
+						      oid, data, t->size,
 						      &response);
 			if (response) {
 				ret |= (response->header->operation ==
-				        PIMFOR_OP_ERROR);
+					PIMFOR_OP_ERROR);
 				islpci_mgt_release(response);
 			}
 			j++;
@@ -622,15 +615,37 @@ static enum oid_num_t commit_part2[] = {
 	DOT11_OID_DEFKEYID,
 	DOT11_OID_DOT1XENABLE,
 	OID_INL_DOT11D_CONFORMANCE,
+	/* Do not initialize this - fw < 1.0.4.3 rejects it
 	OID_INL_OUTPUTPOWER,
+	*/
 };
 
+/* update the MAC addr. */
+static int
+mgt_update_addr(islpci_private *priv)
+{
+	struct islpci_mgmtframe *res = NULL;
+	int ret;
+
+	ret = islpci_mgt_transaction(priv->ndev, PIMFOR_OP_GET,
+				     isl_oid[GEN_OID_MACADDRESS].oid, NULL,
+				     isl_oid[GEN_OID_MACADDRESS].size, &res);
+
+	if ((ret == 0) && res && (res->header->operation != PIMFOR_OP_ERROR))
+		memcpy(priv->ndev->dev_addr, res->data, 6);
+	else
+		ret = -EIO;
+	if (res)
+		islpci_mgt_release(res);
+
+	return ret;
+}
+
 void
 mgt_commit(islpci_private *priv)
 {
 	int rvalue;
 	u32 u;
-	union oid_res_t r;
 
 	if (islpci_get_state(priv) < PRV_STATE_INIT)
 		return;
@@ -646,26 +661,19 @@ mgt_commit(islpci_private *priv)
 
 	u = OID_INL_MODE;
 	rvalue |= mgt_commit_list(priv, &u, 1);
+	rvalue |= mgt_update_addr(priv);
 
 	if (rvalue) {
 		/* some request have failed. The device might be in an
 		   incoherent state. We should reset it ! */
 		printk(KERN_DEBUG "%s: mgt_commit has failed. Restart the "
-                "device \n", priv->ndev->name);
+		       "device \n", priv->ndev->name);
 	}
-
-	/* update the MAC addr. As it's not cached, no lock will be acquired by
-	 * the mgt_get_request
-	 */
-	mgt_get_request(priv, GEN_OID_MACADDRESS, 0, NULL, &r);
-	memcpy(priv->ndev->dev_addr, r.ptr, 6);
-	kfree(r.ptr);
-
 }
 
 /* This will tell you if you are allowed to answer a mlme(ex) request .*/
 
-inline int
+int
 mgt_mlme_answer(islpci_private *priv)
 {
 	u32 mlmeautolevel;
@@ -682,18 +690,18 @@ mgt_mlme_answer(islpci_private *priv)
 		(mlmeautolevel >= DOT11_MLME_INTERMEDIATE));
 }
 
-inline enum oid_num_t
+enum oid_num_t
 mgt_oidtonum(u32 oid)
 {
 	int i;
 
-	for (i = 0; i < OID_NUM_LAST - 1; i++)
+	for (i = 0; i < OID_NUM_LAST; i++)
 		if (isl_oid[i].oid == oid)
 			return i;
 
 	printk(KERN_DEBUG "looking for an unknown oid 0x%x", oid);
 
-	return 0;
+	return OID_NUM_LAST;
 }
 
 int
@@ -713,8 +721,11 @@ mgt_response_to_str(enum oid_num_t n, union oid_res_t *r, char *str)
 	case OID_TYPE_BSS:{
 			struct obj_bss *bss = r->ptr;
 			return snprintf(str, PRIV_STR_SIZE,
-					"age=%u\nchannel=%u\n\
-				        capinfo=0x%X\nrates=0x%X\nbasic_rates=0x%X\n", bss->age, bss->channel, bss->capinfo, bss->rates, bss->basic_rates);
+					"age=%u\nchannel=%u\n"
+					"capinfo=0x%X\nrates=0x%X\n"
+					"basic_rates=0x%X\n", bss->age,
+					bss->channel, bss->capinfo,
+					bss->rates, bss->basic_rates);
 		}
 		break;
 	case OID_TYPE_BSSLIST:{
@@ -723,7 +734,9 @@ mgt_response_to_str(enum oid_num_t n, union oid_res_t *r, char *str)
 			k = snprintf(str, PRIV_STR_SIZE, "nr=%u\n", list->nr);
 			for (i = 0; i < list->nr; i++)
 				k += snprintf(str + k, PRIV_STR_SIZE - k,
-					      "bss[%u] : \nage=%u\nchannel=%u\ncapinfo=0x%X\nrates=0x%X\nbasic_rates=0x%X\n",
+					      "bss[%u] : \nage=%u\nchannel=%u\n"
+					      "capinfo=0x%X\nrates=0x%X\n"
+					      "basic_rates=0x%X\n",
 					      i, list->bsslist[i].age,
 					      list->bsslist[i].channel,
 					      list->bsslist[i].capinfo,
@@ -745,23 +758,25 @@ mgt_response_to_str(enum oid_num_t n, union oid_res_t *r, char *str)
 		break;
 	case OID_TYPE_MLME:{
 			struct obj_mlme *mlme = r->ptr;
-			return snprintf(str, PRIV_STR_SIZE, "id=0x%X\nstate=0x%X\n\
-			         code=0x%X\n", mlme->id, mlme->state,
-					mlme->code);
+			return snprintf(str, PRIV_STR_SIZE,
+					"id=0x%X\nstate=0x%X\ncode=0x%X\n",
+					mlme->id, mlme->state, mlme->code);
 		}
 		break;
 	case OID_TYPE_MLMEEX:{
 			struct obj_mlmeex *mlme = r->ptr;
-			return snprintf(str, PRIV_STR_SIZE, "id=0x%X\nstate=0x%X\n\
-			         code=0x%X\nsize=0x%X\n", mlme->id, mlme->state,
-					mlme->code, mlme->size);
+			return snprintf(str, PRIV_STR_SIZE,
+					"id=0x%X\nstate=0x%X\n"
+					"code=0x%X\nsize=0x%X\n", mlme->id,
+					mlme->state, mlme->code, mlme->size);
 		}
 		break;
 	case OID_TYPE_SSID:{
 			struct obj_ssid *ssid = r->ptr;
 			return snprintf(str, PRIV_STR_SIZE,
-					"length=%u\noctets=%s\n",
-					ssid->length, ssid->octets);
+					"length=%u\noctets=%.*s\n",
+					ssid->length, ssid->length,
+					ssid->octets);
 		}
 		break;
 	case OID_TYPE_KEY:{
diff --git a/drivers/net/wireless/prism54/oid_mgt.h b/drivers/net/wireless/prism54/oid_mgt.h
index cd8167e29..caf5eb3d5 100644
--- a/drivers/net/wireless/prism54/oid_mgt.h
+++ b/drivers/net/wireless/prism54/oid_mgt.h
@@ -38,7 +38,7 @@ void mgt_le_to_cpu(int, void *);
 int mgt_set_request(islpci_private *, enum oid_num_t, int, void *);
 
 int mgt_get_request(islpci_private *, enum oid_num_t, int, void *,
-                    union oid_res_t *);
+		    union oid_res_t *);
 
 int mgt_commit_list(islpci_private *, enum oid_num_t *, int);
 
diff --git a/drivers/net/wireless/ray_cs.c b/drivers/net/wireless/ray_cs.c
index 09030a4a3..e39bcddc3 100644
--- a/drivers/net/wireless/ray_cs.c
+++ b/drivers/net/wireless/ray_cs.c
@@ -2854,7 +2854,7 @@ static void raycs_write(const char *name, write_proc_t *w, void *data)
 	}
 }
 
-static int write_essid(struct file *file, const char *buffer, unsigned long count, void *data)
+static int write_essid(struct file *file, const char __user *buffer, unsigned long count, void *data)
 {
 	static char proc_essid[33];
 	int len = count;
@@ -2868,7 +2868,7 @@ static int write_essid(struct file *file, const char *buffer, unsigned long coun
 	return count;
 }
 
-static int write_int(struct file *file, const char *buffer, unsigned long count, void *data)
+static int write_int(struct file *file, const char __user *buffer, unsigned long count, void *data)
 {
 	static char proc_number[10];
 	char *p;
@@ -2914,7 +2914,7 @@ static int __init init_ray_cs(void)
     DEBUG(1, "raylink init_module register_pcmcia_driver returns 0x%x\n",rc);
 
 #ifdef CONFIG_PROC_FS
-    proc_mkdir("driver/ray_cs", 0);
+    proc_mkdir("driver/ray_cs", NULL);
 
     create_proc_info_entry("driver/ray_cs/ray_cs", 0, NULL, &ray_cs_proc_read);
     raycs_write("driver/ray_cs/essid", write_essid, NULL);
diff --git a/drivers/net/wireless/strip.c b/drivers/net/wireless/strip.c
index 45a26d94a..98cee21f7 100644
--- a/drivers/net/wireless/strip.c
+++ b/drivers/net/wireless/strip.c
@@ -409,12 +409,12 @@ static const MetricomAddress zero_address;
 static const MetricomAddress broadcast_address =
     { {0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF} };
 
-static const MetricomKey SIP0Key = { {"SIP0"} };
-static const MetricomKey ARP0Key = { {"ARP0"} };
-static const MetricomKey ATR_Key = { {"ATR "} };
-static const MetricomKey ACK_Key = { {"ACK_"} };
-static const MetricomKey INF_Key = { {"INF_"} };
-static const MetricomKey ERR_Key = { {"ERR_"} };
+static const MetricomKey SIP0Key = { "SIP0" };
+static const MetricomKey ARP0Key = { "ARP0" };
+static const MetricomKey ATR_Key = { "ATR " };
+static const MetricomKey ACK_Key = { "ACK_" };
+static const MetricomKey INF_Key = { "INF_" };
+static const MetricomKey ERR_Key = { "ERR_" };
 
 static const long MaxARPInterval = 60 * HZ;	/* One minute */
 
@@ -2707,7 +2707,7 @@ static void strip_close(struct tty_struct *tty)
 
 	unregister_netdev(strip_info->dev);
 
-	tty->disc_data = 0;
+	tty->disc_data = NULL;
 	strip_info->tty = NULL;
 	printk(KERN_INFO "STRIP: device \"%s\" closed down\n",
 	       strip_info->dev->name);
@@ -2733,14 +2733,14 @@ static int strip_ioctl(struct tty_struct *tty, struct file *file,
 
 	switch (cmd) {
 	case SIOCGIFNAME:
-		if(copy_to_user((void *) arg, strip_info->dev->name, strlen(strip_info->dev->name) + 1))
+		if(copy_to_user((void __user *) arg, strip_info->dev->name, strlen(strip_info->dev->name) + 1))
 			return -EFAULT;
 		break;
 	case SIOCSIFHWADDR:
 	{
 		MetricomAddress addr;
 		//printk(KERN_INFO "%s: SIOCSIFHWADDR\n", strip_info->dev->name);
-		if(copy_from_user(&addr, (void *) arg, sizeof(MetricomAddress)))
+		if(copy_from_user(&addr, (void __user *) arg, sizeof(MetricomAddress)))
 			return -EFAULT;
 		return set_mac_address(strip_info, &addr);
 	}
@@ -2750,7 +2750,7 @@ static int strip_ioctl(struct tty_struct *tty, struct file *file,
 
 	case TCGETS:
 	case TCGETA:
-		return n_tty_ioctl(tty, (struct file *) file, cmd, (unsigned long) arg);
+		return n_tty_ioctl(tty, file, cmd, arg);
 		break;
 	default:
 		return -ENOIOCTLCMD;
diff --git a/drivers/net/yellowfin.c b/drivers/net/yellowfin.c
index 81e97947c..814821902 100644
--- a/drivers/net/yellowfin.c
+++ b/drivers/net/yellowfin.c
@@ -65,7 +65,7 @@ static int mtu;
 static int bogus_rx;
 static int dma_ctrl = 0x004A0263; 			/* Constrained by errata */
 static int fifo_cfg = 0x0020;				/* Bypass external Tx FIFO. */
-#elif YF_NEW					/* A future perfect board :->.  */
+#elif defined(YF_NEW)					/* A future perfect board :->.  */
 static int dma_ctrl = 0x00CAC277;			/* Override when loading module! */
 static int fifo_cfg = 0x0028;
 #else
@@ -108,12 +108,6 @@ static int gx_fix;
 
 #define yellowfin_debug debug
 
-#if !defined(__OPTIMIZE__)
-#warning  You must compile this file with the correct options!
-#warning  See the last lines of the source file.
-#error You must compile this driver with "-O".
-#endif
-
 #include <linux/module.h>
 #include <linux/kernel.h>
 #include <linux/string.h>
@@ -292,7 +286,7 @@ static struct pci_id_info pci_id_tbl[] = {
 	 FullTxStatus | IsGigabit | HasMulticastBug | HasMACAddrBug | DontUseEeprom},
 	{"Symbios SYM83C885", { 0x07011000, 0xffffffff},
 	 PCI_IOTYPE, YELLOWFIN_SIZE, HasMII | DontUseEeprom },
-	{0,},
+	{NULL,},
 };
 
 static struct pci_device_id yellowfin_pci_tbl[] = {
@@ -448,7 +442,7 @@ static int __devinit yellowfin_init_one(struct pci_dev *pdev,
 
 	np = dev->priv;
 
-	if (pci_request_regions(pdev, dev->name))
+	if (pci_request_regions(pdev, DRV_NAME))
 		goto err_out_free_netdev;
 
 	pci_set_master (pdev);
@@ -811,7 +805,7 @@ static void yellowfin_init_ring(struct net_device *dev)
 #ifdef NO_TXSTATS
 	/* In this mode the Tx ring needs only a single descriptor. */
 	for (i = 0; i < TX_RING_SIZE; i++) {
-		yp->tx_skbuff[i] = 0;
+		yp->tx_skbuff[i] = NULL;
 		yp->tx_ring[i].dbdma_cmd = cpu_to_le32(CMD_STOP);
 		yp->tx_ring[i].branch_addr = cpu_to_le32(yp->tx_ring_dma +
 			((i+1)%TX_RING_SIZE)*sizeof(struct yellowfin_desc));
@@ -993,7 +987,7 @@ static irqreturn_t yellowfin_interrupt(int irq, void *dev_instance, struct pt_re
 			pci_unmap_single(yp->pci_dev, yp->tx_ring[entry].addr,
 				skb->len, PCI_DMA_TODEVICE);
 			dev_kfree_skb_irq(skb);
-			yp->tx_skbuff[entry] = 0;
+			yp->tx_skbuff[entry] = NULL;
 		}
 		if (yp->tx_full
 			&& yp->cur_tx - yp->dirty_tx < TX_QUEUE_SIZE - 4) {
@@ -1201,13 +1195,8 @@ static int yellowfin_rx(struct net_device *dev)
 					break;
 				skb->dev = dev;
 				skb_reserve(skb, 2);	/* 16 byte align the IP header */
-#if HAS_IP_COPYSUM
 				eth_copy_and_sum(skb, rx_skb->tail, pkt_len, 0);
 				skb_put(skb, pkt_len);
-#else
-				memcpy(skb_put(skb, pkt_len), 
-					rx_skb->tail, pkt_len);
-#endif
 				pci_dma_sync_single_for_device(yp->pci_dev, desc->addr,
 											   yp->rx_buf_sz,
 											   PCI_DMA_FROMDEVICE);
@@ -1331,12 +1320,12 @@ static int yellowfin_close(struct net_device *dev)
 		if (yp->rx_skbuff[i]) {
 			dev_kfree_skb(yp->rx_skbuff[i]);
 		}
-		yp->rx_skbuff[i] = 0;
+		yp->rx_skbuff[i] = NULL;
 	}
 	for (i = 0; i < TX_RING_SIZE; i++) {
 		if (yp->tx_skbuff[i])
 			dev_kfree_skb(yp->tx_skbuff[i]);
-		yp->tx_skbuff[i] = 0;
+		yp->tx_skbuff[i] = NULL;
 	}
 
 #ifdef YF_PROTOTYPE			/* Support for prototype hardware errata. */
diff --git a/drivers/net/zorro8390.c b/drivers/net/zorro8390.c
index d721fc6f4..8ab6e1215 100644
--- a/drivers/net/zorro8390.c
+++ b/drivers/net/zorro8390.c
@@ -36,6 +36,8 @@
 #include "8390.h"
 
 
+#define DRV_NAME	"zorro8390"
+
 #define NE_BASE		(dev->base_addr)
 #define NE_CMD		(0x00*2)
 #define NE_DATAPORT	(0x10*2)	/* NatSemi-defined port window offset. */
@@ -115,7 +117,7 @@ static int __devinit zorro8390_init_one(struct zorro_dev *z,
     if (!dev)
 	return -ENOMEM;
     SET_MODULE_OWNER(dev);
-    if (!request_mem_region(ioaddr, NE_IO_EXTENT*2, dev->name)) {
+    if (!request_mem_region(ioaddr, NE_IO_EXTENT*2, DRV_NAME)) {
 	free_netdev(dev);
 	return -EBUSY;
     }
@@ -198,7 +200,7 @@ static int __devinit zorro8390_init(struct net_device *dev,
     dev->irq = IRQ_AMIGA_PORTS;
 
     /* Install the Interrupt handler */
-    i = request_irq(IRQ_AMIGA_PORTS, ei_interrupt, SA_SHIRQ, dev->name, dev);
+    i = request_irq(IRQ_AMIGA_PORTS, ei_interrupt, SA_SHIRQ, DRV_NAME, dev);
     if (i) return i;
 
     for(i = 0; i < ETHER_ADDR_LEN; i++) {
diff --git a/drivers/oprofile/buffer_sync.c b/drivers/oprofile/buffer_sync.c
index 2dac57b61..e5d06ea62 100644
--- a/drivers/oprofile/buffer_sync.c
+++ b/drivers/oprofile/buffer_sync.c
@@ -35,7 +35,7 @@
 #define DEFAULT_EXPIRE (HZ / 4)
  
 static void wq_sync_buffers(void *);
-static DECLARE_WORK(sync_wq, wq_sync_buffers, 0);
+static DECLARE_WORK(sync_wq, wq_sync_buffers, NULL);
  
 static struct timer_list sync_timer;
 static void timer_ping(unsigned long data);
@@ -425,7 +425,7 @@ static void increment_tail(struct oprofile_cpu_buffer * b)
  */
 static void sync_buffer(struct oprofile_cpu_buffer * cpu_buf)
 {
-	struct mm_struct * mm = 0;
+	struct mm_struct *mm = NULL;
 	struct task_struct * new;
 	unsigned long cookie = 0;
 	int in_kernel = 1;
diff --git a/drivers/oprofile/cpu_buffer.c b/drivers/oprofile/cpu_buffer.c
index 23979d38d..7ee6a3d99 100644
--- a/drivers/oprofile/cpu_buffer.c
+++ b/drivers/oprofile/cpu_buffer.c
@@ -57,7 +57,7 @@ int alloc_cpu_buffers(void)
 		if (!b->buffer)
 			goto fail;
  
-		b->last_task = 0;
+		b->last_task = NULL;
 		b->last_is_kernel = -1;
 		b->buffer_size = buffer_size;
 		b->tail_pos = 0;
@@ -176,5 +176,5 @@ void cpu_buffer_reset(struct oprofile_cpu_buffer * cpu_buf)
 	 * values to initialize the buffer
 	 */
 	cpu_buf->last_is_kernel = -1;
-	cpu_buf->last_task = 0;
+	cpu_buf->last_task = NULL;
 }
diff --git a/drivers/oprofile/oprofile_files.c b/drivers/oprofile/oprofile_files.c
index 381abef6f..b22d4ea3f 100644
--- a/drivers/oprofile/oprofile_files.c
+++ b/drivers/oprofile/oprofile_files.c
@@ -90,7 +90,7 @@ static struct file_operations dump_fops = {
 void oprofile_create_files(struct super_block * sb, struct dentry * root)
 {
 	oprofilefs_create_file(sb, root, "enable", &enable_fops);
-	oprofilefs_create_file(sb, root, "dump", &dump_fops);
+	oprofilefs_create_file_perm(sb, root, "dump", &dump_fops, 0666);
 	oprofilefs_create_file(sb, root, "buffer", &event_buffer_fops);
 	oprofilefs_create_ulong(sb, root, "buffer_size", &fs_buffer_size);
 	oprofilefs_create_ulong(sb, root, "buffer_watershed", &fs_buffer_watershed);
diff --git a/drivers/oprofile/oprofilefs.c b/drivers/oprofile/oprofilefs.c
index 2824c24c7..d9746f1b5 100644
--- a/drivers/oprofile/oprofilefs.c
+++ b/drivers/oprofile/oprofilefs.c
@@ -47,23 +47,7 @@ static struct super_operations s_ops = {
 
 ssize_t oprofilefs_str_to_user(char const * str, char __user * buf, size_t count, loff_t * offset)
 {
-	size_t len = strlen(str);
-
-	if (!count)
-		return 0;
-
-	if (*offset > len)
-		return 0;
-
-	if (count > len - *offset)
-		count = len - *offset;
-
-	if (copy_to_user(buf, str + *offset, count))
-		return -EFAULT;
-
-	*offset += count;
-
-	return count;
+	return simple_read_from_buffer(buf, count, offset, str, strlen(str));
 }
 
 
@@ -72,29 +56,10 @@ ssize_t oprofilefs_str_to_user(char const * str, char __user * buf, size_t count
 ssize_t oprofilefs_ulong_to_user(unsigned long val, char __user * buf, size_t count, loff_t * offset)
 {
 	char tmpbuf[TMPBUFSIZE];
-	size_t maxlen;
-
-	if (!count)
-		return 0;
-
-	spin_lock(&oprofilefs_lock);
-	maxlen = snprintf(tmpbuf, TMPBUFSIZE, "%lu\n", val);
-	spin_unlock(&oprofilefs_lock);
+	size_t maxlen = snprintf(tmpbuf, TMPBUFSIZE, "%lu\n", val);
 	if (maxlen > TMPBUFSIZE)
 		maxlen = TMPBUFSIZE;
-
-	if (*offset > maxlen)
-		return 0;
-
-	if (count > maxlen - *offset)
-		count = maxlen - *offset;
-
-	if (copy_to_user(buf, tmpbuf + *offset, count))
-		return -EFAULT;
-
-	*offset += count;
-
-	return count;
+	return simple_read_from_buffer(buf, count, offset, tmpbuf, maxlen);
 }
 
 
@@ -165,7 +130,8 @@ static struct file_operations ulong_ro_fops = {
 
 
 static struct dentry * __oprofilefs_create_file(struct super_block * sb,
-	struct dentry * root, char const * name, struct file_operations * fops)
+	struct dentry * root, char const * name, struct file_operations * fops,
+	int perm)
 {
 	struct dentry * dentry;
 	struct inode * inode;
@@ -175,11 +141,11 @@ static struct dentry * __oprofilefs_create_file(struct super_block * sb,
 	qname.hash = full_name_hash(qname.name, qname.len);
 	dentry = d_alloc(root, &qname);
 	if (!dentry)
-		return 0;
-	inode = oprofilefs_get_inode(sb, S_IFREG | 0644);
+		return NULL;
+	inode = oprofilefs_get_inode(sb, S_IFREG | perm);
 	if (!inode) {
 		dput(dentry);
-		return 0;
+		return NULL;
 	}
 	inode->i_fop = fops;
 	d_add(dentry, inode);
@@ -190,7 +156,8 @@ static struct dentry * __oprofilefs_create_file(struct super_block * sb,
 int oprofilefs_create_ulong(struct super_block * sb, struct dentry * root,
 	char const * name, unsigned long * val)
 {
-	struct dentry * d = __oprofilefs_create_file(sb, root, name, &ulong_fops);
+	struct dentry * d = __oprofilefs_create_file(sb, root, name,
+						     &ulong_fops, 0644);
 	if (!d)
 		return -EFAULT;
 
@@ -202,7 +169,8 @@ int oprofilefs_create_ulong(struct super_block * sb, struct dentry * root,
 int oprofilefs_create_ro_ulong(struct super_block * sb, struct dentry * root,
 	char const * name, unsigned long * val)
 {
-	struct dentry * d = __oprofilefs_create_file(sb, root, name, &ulong_ro_fops);
+	struct dentry * d = __oprofilefs_create_file(sb, root, name,
+						     &ulong_ro_fops, 0444);
 	if (!d)
 		return -EFAULT;
 
@@ -227,7 +195,8 @@ static struct file_operations atomic_ro_fops = {
 int oprofilefs_create_ro_atomic(struct super_block * sb, struct dentry * root,
 	char const * name, atomic_t * val)
 {
-	struct dentry * d = __oprofilefs_create_file(sb, root, name, &atomic_ro_fops);
+	struct dentry * d = __oprofilefs_create_file(sb, root, name,
+						     &atomic_ro_fops, 0444);
 	if (!d)
 		return -EFAULT;
 
@@ -239,7 +208,16 @@ int oprofilefs_create_ro_atomic(struct super_block * sb, struct dentry * root,
 int oprofilefs_create_file(struct super_block * sb, struct dentry * root,
 	char const * name, struct file_operations * fops)
 {
-	if (!__oprofilefs_create_file(sb, root, name, fops))
+	if (!__oprofilefs_create_file(sb, root, name, fops, 0644))
+		return -EFAULT;
+	return 0;
+}
+
+
+int oprofilefs_create_file_perm(struct super_block * sb, struct dentry * root,
+	char const * name, struct file_operations * fops, int perm)
+{
+	if (!__oprofilefs_create_file(sb, root, name, fops, perm))
 		return -EFAULT;
 	return 0;
 }
@@ -256,11 +234,11 @@ struct dentry * oprofilefs_mkdir(struct super_block * sb,
 	qname.hash = full_name_hash(qname.name, qname.len);
 	dentry = d_alloc(root, &qname);
 	if (!dentry)
-		return 0;
+		return NULL;
 	inode = oprofilefs_get_inode(sb, S_IFDIR | 0755);
 	if (!inode) {
 		dput(dentry);
-		return 0;
+		return NULL;
 	}
 	inode->i_op = &simple_dir_inode_operations;
 	inode->i_fop = &simple_dir_operations;
diff --git a/drivers/parisc/ccio-dma.c b/drivers/parisc/ccio-dma.c
index c4f348241..e853f342a 100644
--- a/drivers/parisc/ccio-dma.c
+++ b/drivers/parisc/ccio-dma.c
@@ -44,7 +44,6 @@
 #include <asm/byteorder.h>
 #include <asm/cache.h>		/* for L1_CACHE_BYTES */
 #include <asm/uaccess.h>
-#include <asm/pgalloc.h>
 #include <asm/page.h>
 #include <asm/dma.h>
 #include <asm/io.h>
diff --git a/drivers/parisc/ccio-rm-dma.c b/drivers/parisc/ccio-rm-dma.c
index bd21c5f4a..57e638597 100644
--- a/drivers/parisc/ccio-rm-dma.c
+++ b/drivers/parisc/ccio-rm-dma.c
@@ -40,7 +40,6 @@
 #include <linux/pci.h>
 
 #include <asm/uaccess.h>
-#include <asm/pgalloc.h>
 
 #include <asm/io.h>
 #include <asm/hardware.h>
diff --git a/drivers/parisc/dino.c b/drivers/parisc/dino.c
index a9ca3c25c..5840219f6 100644
--- a/drivers/parisc/dino.c
+++ b/drivers/parisc/dino.c
@@ -932,13 +932,16 @@ dino_driver_callback(struct parisc_device *dev)
 	struct dino_device *dino_dev;	// Dino specific control struct
 	const char *version = "unknown";
 	const int name_len = 32;
+	char hw_path[64];
 	char *name;
 	int is_cujo = 0;
 	struct pci_bus *bus;
-
+	
 	name = kmalloc(name_len, GFP_KERNEL);
-	if(name)
-		snprintf(name, name_len, "Dino %s", dev->dev.bus_id);
+	if(name) {
+		print_pa_hwpath(dev, hw_path);
+		snprintf(name, name_len, "Dino [%s]", hw_path);
+	} 
 	else
 		name = "Dino";
 
diff --git a/drivers/parisc/iommu-helpers.h b/drivers/parisc/iommu-helpers.h
index a6757b3bb..38d9e1aba 100644
--- a/drivers/parisc/iommu-helpers.h
+++ b/drivers/parisc/iommu-helpers.h
@@ -49,7 +49,15 @@ iommu_fill_pdir(struct ioc *ioc, struct scatterlist *startsg, int nents,
 			sg_dma_len(startsg) = 0;
 			dma_offset = (unsigned long) pide & ~IOVP_MASK;
 			n_mappings++;
+#if defined(ZX1_SUPPORT)
+			/* Pluto IOMMU IO Virt Address is not zero based */
+			sg_dma_address(dma_sg) = pide | ioc->ibase;
+#else
+			/* SBA, ccio, and dino are zero based.
+			 * Trying to save a few CPU cycles for most users.
+			 */
 			sg_dma_address(dma_sg) = pide;
+#endif
 			pdirp = &(ioc->pdir_base[pide >> IOVP_SHIFT]);
 			prefetchw(pdirp);
 		}
diff --git a/drivers/parisc/iosapic.c b/drivers/parisc/iosapic.c
index 60466bd12..33bff2ea9 100644
--- a/drivers/parisc/iosapic.c
+++ b/drivers/parisc/iosapic.c
@@ -169,10 +169,11 @@
 
 #include <asm/byteorder.h>	/* get in-line asm for swab */
 #include <asm/pdc.h>
+#include <asm/pdcpat.h>
 #include <asm/page.h>
 #include <asm/segment.h>
 #include <asm/system.h>
-#include <asm/io.h>		/* gsc_read/write functions */
+#include <asm/io.h>		/* read/write functions */
 #ifdef CONFIG_SUPERIO
 #include <asm/superio.h>
 #endif
@@ -223,19 +224,7 @@ assert_failed (char *a, char *f, int l)
 #endif
 
 
-#define READ_U8(addr)  gsc_readb(addr)
-#define READ_U16(addr) le16_to_cpu(gsc_readw((u16 *) (addr)))
-#define READ_U32(addr) le32_to_cpu(gsc_readl((u32 *) (addr)))
-#define READ_REG16(addr) gsc_readw((u16 *) (addr))
-#define READ_REG32(addr) gsc_readl((u32 *) (addr))
-#define WRITE_U8(value, addr) gsc_writeb(value, addr)
-#define WRITE_U16(value, addr) gsc_writew(cpu_to_le16(value), (u16 *) (addr))
-#define WRITE_U32(value, addr) gsc_writel(cpu_to_le32(value), (u32 *) (addr))
-#define WRITE_REG16(value, addr) gsc_writew(value, (u16 *) (addr))
-#define WRITE_REG32(value, addr) gsc_writel(value, (u32 *) (addr))
-
-
-#define IOSAPIC_REG_SELECT              0
+#define IOSAPIC_REG_SELECT              0x00
 #define IOSAPIC_REG_WINDOW              0x10
 #define IOSAPIC_REG_EOI                 0x40
 
@@ -244,8 +233,19 @@ assert_failed (char *a, char *f, int l)
 #define IOSAPIC_IRDT_ENTRY(idx)		(0x10+(idx)*2)
 #define IOSAPIC_IRDT_ENTRY_HI(idx)	(0x11+(idx)*2)
 
+static inline unsigned int iosapic_read(unsigned long iosapic, unsigned int reg)
+{
+	writel(reg, iosapic + IOSAPIC_REG_SELECT);
+	return readl(iosapic + IOSAPIC_REG_WINDOW);
+}
+
+static inline void iosapic_write(unsigned long iosapic, unsigned int reg, u32 val)
+{
+	writel(reg, iosapic + IOSAPIC_REG_SELECT);
+	writel(val, iosapic + IOSAPIC_REG_WINDOW);
+}
+
 /*
-** FIXME: revisit which GFP flags we should really be using.
 **     GFP_KERNEL includes __GFP_WAIT flag and that may not
 **     be acceptable. Since this is boot time, we shouldn't have
 **     to wait ever and this code should (will?) never get called
@@ -260,16 +260,13 @@ assert_failed (char *a, char *f, int l)
 #define	IOSAPIC_UNLOCK(lck)	spin_unlock_irqrestore(lck, irqflags)
 
 
-#define IOSAPIC_VERSION_MASK            0x000000ff
-#define IOSAPIC_VERSION_SHIFT           0x0
-#define	IOSAPIC_VERSION(ver)				\
-		(int) ((ver & IOSAPIC_VERSION_MASK) >> IOSAPIC_VERSION_SHIFT)
+#define IOSAPIC_VERSION_MASK	0x000000ff
+#define	IOSAPIC_VERSION(ver)	((int) (ver & IOSAPIC_VERSION_MASK))
 
 #define IOSAPIC_MAX_ENTRY_MASK          0x00ff0000
-
 #define IOSAPIC_MAX_ENTRY_SHIFT         0x10
-#define	IOSAPIC_IRDT_MAX_ENTRY(ver)			\
-		(int) ((ver&IOSAPIC_MAX_ENTRY_MASK) >> IOSAPIC_MAX_ENTRY_SHIFT)
+#define	IOSAPIC_IRDT_MAX_ENTRY(ver)	\
+	(int) (((ver) & IOSAPIC_MAX_ENTRY_MASK) >> IOSAPIC_MAX_ENTRY_SHIFT)
 
 /* bits in the "low" I/O Sapic IRdT entry */
 #define IOSAPIC_IRDT_ENABLE       0x10000
@@ -281,9 +278,6 @@ assert_failed (char *a, char *f, int l)
 #define IOSAPIC_IRDT_ID_EID_SHIFT              0x10
 
 
-
-#define	IOSAPIC_EOI(eoi_addr, eoi_data) gsc_writel(eoi_data, eoi_addr)
-
 static struct iosapic_info *iosapic_list;
 static spinlock_t iosapic_lock;
 static int iosapic_count;
@@ -403,14 +397,14 @@ iosapic_load_irt(unsigned long cell_num, struct irt_entry **irt)
 	struct irt_entry *p = table;
 	int i;
 
-	printk(KERN_DEBUG MODULE_NAME " Interrupt Routing Table (cell %ld)\n", cell_num);
-	printk(KERN_DEBUG MODULE_NAME " start = 0x%p num_entries %ld entry_size %d\n",
+	printk(MODULE_NAME " Interrupt Routing Table (cell %ld)\n", cell_num);
+	printk(MODULE_NAME " start = 0x%p num_entries %ld entry_size %d\n",
 		table,
 		num_entries,
 		(int) sizeof(struct irt_entry));
 
 	for (i = 0 ; i < num_entries ; i++, p++) {
-		printk(KERN_DEBUG MODULE_NAME " %02x %02x %02x %02x %02x %02x %02x %02x %08x%08x\n",
+		printk(MODULE_NAME " %02x %02x %02x %02x %02x %02x %02x %02x %08x%08x\n",
 		p->entry_type, p->entry_length, p->interrupt_type,
 		p->polarity_trigger, p->src_bus_irq_devno, p->src_bus_id,
 		p->src_seg_id, p->dest_iosapic_intin,
@@ -608,22 +602,26 @@ iosapic_xlate_pin(struct iosapic_info *isi, struct pci_dev *pcidev)
 static irqreturn_t
 iosapic_interrupt(int irq, void *dev_id, struct pt_regs * regs)
 {
-	struct vector_info *vi = (struct vector_info *)dev_id;
+	struct vector_info *vi = (struct vector_info *) dev_id;
 	extern void do_irq(struct irqaction *a, int i, struct pt_regs *p);
 	int irq_num = vi->iosapic->isi_region->data.irqbase + vi->irqline;
 
-	DBG("iosapic_interrupt(): irq %d line %d eoi %p\n",
-		irq, vi->irqline, vi->eoi_addr);
+	DBG("iosapic_interrupt(): irq %d line %d eoi 0x%p 0x%x\n",
+		irq, vi->irqline, vi->eoi_addr, vi->eoi_data);
+
+	/* Do NOT need to mask/unmask IRQ. processor is already masked. */
 
-/* FIXME: Need to mask/unmask? processor IRQ is already masked... */
 	do_irq(&vi->iosapic->isi_region->action[vi->irqline], irq_num, regs);
 
 	/*
+	** PARISC only supports PCI devices below I/O SAPIC.
 	** PCI only supports level triggered in order to share IRQ lines.
-	** I/O SAPIC must always issue EOI.
+	** ergo I/O SAPIC must always issue EOI on parisc.
+	**
+	** i386/ia64 support ISA devices and have to deal with
+	** edge-triggered interrupts too.
 	*/
-	IOSAPIC_EOI(vi->eoi_addr, vi->eoi_data);
-
+	__raw_writel(vi->eoi_data, vi->eoi_addr);
 	return IRQ_HANDLED;
 }
 
@@ -715,8 +713,7 @@ iosapic_fixup_irq(void *isi_obj, struct pci_dev *pcidev)
 	ASSERT(tmp == 0);
 
 	vi->eoi_addr = (u32 *) (isi->isi_hpa + IOSAPIC_REG_EOI);
-	vi->eoi_data = cpu_to_le32(vi->irqline);
-
+	vi->eoi_data = cpu_to_le32(vi->txn_data);
 	ASSERT(NULL != isi->isi_region);
 
 	DBG_IRT("iosapic_fixup_irq() %d:%d %x %x line %d irq %d\n",
@@ -733,13 +730,8 @@ iosapic_rd_irt_entry(struct vector_info *vi , u32 *dp0, u32 *dp1)
 	struct iosapic_info *isp = vi->iosapic;
 	u8 idx = vi->irqline;
 
-	/* point the window register to the lower word */
-	WRITE_U32(IOSAPIC_IRDT_ENTRY(idx), isp->isi_hpa+IOSAPIC_REG_SELECT);
-	*dp0 = READ_U32(isp->isi_hpa+IOSAPIC_REG_WINDOW);
-
-	/* point the window register to the higher word */
-	WRITE_U32(IOSAPIC_IRDT_ENTRY_HI(idx), isp->isi_hpa+IOSAPIC_REG_SELECT);
-	*dp1 = READ_U32(isp->isi_hpa+IOSAPIC_REG_WINDOW);
+	*dp0 = iosapic_read(isp->isi_hpa, IOSAPIC_IRDT_ENTRY(idx));
+	*dp1 = iosapic_read(isp->isi_hpa, IOSAPIC_IRDT_ENTRY_HI(idx));
 }
 
 
@@ -750,24 +742,20 @@ iosapic_wr_irt_entry(struct vector_info *vi, u32 dp0, u32 dp1)
 
 	ASSERT(NULL != isp);
 	ASSERT(0 != isp->isi_hpa);
-	DBG_IRT("iosapic_wr_irt_entry(): irq %d hpa %p WINDOW %p  0x%x 0x%x\n",
+	DBG_IRT("iosapic_wr_irt_entry(): irq %d hpa %p 0x%x 0x%x\n",
 		vi->irqline,
-		isp->isi_hpa, isp->isi_hpa+IOSAPIC_REG_WINDOW,
+		isp->isi_hpa,
 		dp0, dp1);
 
-	/* point the window register to the lower word */
-	WRITE_U32(IOSAPIC_IRDT_ENTRY(vi->irqline), isp->isi_hpa+IOSAPIC_REG_SELECT);
-	WRITE_U32( dp0, isp->isi_hpa+IOSAPIC_REG_WINDOW);
+	iosapic_write(isp->isi_hpa, IOSAPIC_IRDT_ENTRY(vi->irqline), dp0);
 
 	/* Read the window register to flush the writes down to HW  */
-	dp0 = READ_U32(isp->isi_hpa+IOSAPIC_REG_WINDOW);
+	dp0 = readl(isp->isi_hpa+IOSAPIC_REG_WINDOW);
 
-	/* point the window register to the higher word */
-	WRITE_U32(IOSAPIC_IRDT_ENTRY_HI(vi->irqline), isp->isi_hpa+IOSAPIC_REG_SELECT);
-	WRITE_U32( dp1, isp->isi_hpa+IOSAPIC_REG_WINDOW);
+	iosapic_write(isp->isi_hpa, IOSAPIC_IRDT_ENTRY_HI(vi->irqline), dp1);
 
 	/* Read the window register to flush the writes down to HW  */
-	dp1 = READ_U32(isp->isi_hpa+IOSAPIC_REG_WINDOW);
+	dp1 = readl(isp->isi_hpa+IOSAPIC_REG_WINDOW);
 }
 
 
@@ -882,12 +870,12 @@ iosapic_enable_irq(void *dev, int irq)
 	iosapic_set_irt_data(vi, &d0, &d1);
 	iosapic_wr_irt_entry(vi, d0, d1);
 
-
 #ifdef DEBUG_IOSAPIC_IRT
 {
 	u32 *t = (u32 *) ((ulong) vi->eoi_addr & ~0xffUL);
 	printk("iosapic_enable_irq(): regs %p", vi->eoi_addr);
-	while (t < vi->eoi_addr) printk(" %x", READ_U32(t++));
+	for ( ; t < vi->eoi_addr; t++)
+		printk(" %x", readl(t));
 	printk("\n");
 }
 
@@ -896,11 +884,7 @@ printk("iosapic_enable_irq(): sel ");
 	struct iosapic_info *isp = vi->iosapic;
 
 	for (d0=0x10; d0<0x1e; d0++) {
-		/* point the window register to the lower word */
-		WRITE_U32(d0, isp->isi_hpa+IOSAPIC_REG_SELECT);
-
-		/* read the word */
-		d1 = READ_U32(isp->isi_hpa+IOSAPIC_REG_WINDOW);
+		d1 = iosapic_read(isp->isi_hpa, d0);
 		printk(" %x", d1);
 	}
 }
@@ -908,13 +892,12 @@ printk("\n");
 #endif
 
 	/*
-	** KLUGE: IRQ should not be asserted when Drivers enabling their IRQ.
-	**        PCI supports level triggered in order to share IRQ lines.
-	**
-	** Issueing I/O SAPIC an EOI causes an interrupt iff IRQ line is
-	** asserted.
+	** Issueing I/O SAPIC an EOI causes an interrupt IFF IRQ line is
+	** asserted.  IRQ generally should not be asserted when a driver
+	** enables their IRQ. It can lead to "interesting" race conditions
+	** in the driver initialization sequence.
 	*/
-	IOSAPIC_EOI(vi->eoi_addr, vi->eoi_data);
+	__raw_writel(vi->eoi_data, vi->eoi_addr);
 }
 
 
@@ -949,11 +932,7 @@ iosapic_rd_version(struct iosapic_info *isi)
 	ASSERT(isi);
 	ASSERT(isi->isi_hpa);
 
-	/* point window to the version register */
-	WRITE_U32(IOSAPIC_REG_VERSION, isi->isi_hpa+IOSAPIC_REG_SELECT);
-
-	/* now read the version register */
-	return (READ_U32(isi->isi_hpa+IOSAPIC_REG_WINDOW));
+	return iosapic_read(isi->isi_hpa, IOSAPIC_REG_VERSION);
 }
 
 
diff --git a/drivers/parisc/lba_pci.c b/drivers/parisc/lba_pci.c
index 176e0951b..8126dbdcd 100644
--- a/drivers/parisc/lba_pci.c
+++ b/drivers/parisc/lba_pci.c
@@ -34,7 +34,6 @@
 #include <linux/kernel.h>
 #include <linux/spinlock.h>
 #include <linux/init.h>		/* for __init and __devinit */
-/* #define PCI_DEBUG	enable ASSERT */
 #include <linux/pci.h>
 #include <linux/ioport.h>
 #include <linux/slab.h>
@@ -43,6 +42,7 @@
 #include <asm/byteorder.h>
 #include <asm/irq.h>		/* for struct irq_region support */
 #include <asm/pdc.h>
+#include <asm/pdcpat.h>
 #include <asm/page.h>
 #include <asm/segment.h>
 #include <asm/system.h>
@@ -89,6 +89,19 @@
 #define DBG_PAT(x...)
 #endif
 
+#ifdef DEBUG_LBA
+#undef ASSERT
+#define ASSERT(expr) \
+	if(!(expr)) { \
+		printk("\n%s:%d: Assertion " #expr " failed!\n", \
+				__FILE__, __LINE__); \
+		panic(#expr); \
+	}
+#else
+#define ASSERT(expr)
+#endif
+
+
 /*
 ** Config accessor functions only pass in the 8-bit bus number and not
 ** the 8-bit "PCI Segment" number. Each LBA will be assigned a PCI bus
@@ -159,6 +172,8 @@
 #define LBA_HINT_CFG	0x0310
 #define LBA_HINT_BASE	0x0380	/* 14 registers at every 8 bytes. */
 
+#define LBA_BUS_MODE	0x0620
+
 /* ERROR regs are needed for config cycle kluges */
 #define LBA_ERROR_CONFIG 0x0680
 #define     LBA_SMART_MODE 0x20
@@ -168,12 +183,31 @@
 #define LBA_IOSAPIC_BASE	0x800 /* Offset of IRQ logic */
 
 /* non-postable I/O port space, densely packed */
-#ifdef __LP64__
+#ifdef CONFIG_PARISC64
 #define LBA_ASTRO_PORT_BASE	(0xfffffffffee00000UL)
 #else
 #define LBA_ASTRO_PORT_BASE	(0xfee00000UL)
 #endif
 
+#define ELROY_HVERS	0x782
+#define MERCURY_HVERS	0x783
+#define QUICKSILVER_HVERS	0x784
+
+static inline int IS_ELROY(struct parisc_device *d)
+{
+	return (d->id.hversion == ELROY_HVERS);
+}
+
+static inline int IS_MERCURY(struct parisc_device *d)
+{
+	return (d->id.hversion == MERCURY_HVERS);
+}
+
+static inline int IS_QUICKSILVER(struct parisc_device *d)
+{
+	return (d->id.hversion == QUICKSILVER_HVERS);
+}
+
 
 /*
 ** lba_device: Per instance Elroy data structure
@@ -184,7 +218,7 @@ struct lba_device {
 	spinlock_t	lba_lock;
 	void		*iosapic_obj;
 
-#ifdef __LP64__
+#ifdef CONFIG_PARISC64
 	unsigned long	iop_base;    /* PA_VIEW - for IO port accessor funcs */
 #endif
 
@@ -288,11 +322,6 @@ lba_device_present( u8 bus, u8 dfn, struct lba_device *d)
 {
 	u8 first_bus = d->hba.hba_bus->secondary;
 	u8 last_sub_bus = d->hba.hba_bus->subordinate;
-#if 0
-/* FIXME - see below in this function */
-        u8 dev = PCI_SLOT(dfn);
-        u8 func = PCI_FUNC(dfn);
-#endif
 
 	ASSERT(bus >= first_bus);
 	ASSERT(bus <= last_sub_bus);
@@ -306,19 +335,7 @@ lba_device_present( u8 bus, u8 dfn, struct lba_device *d)
 	    return(FALSE);
 	}
 
-#if 0
-/*
-** FIXME: Need to implement code to fill the devices bitmap based
-** on contents of the local pci_bus tree "data base".
-** pci_register_ops() walks the bus for us and builds the tree.
-** For now, always do the config cycle.
-*/
-	bus -= first_bus;
-
-	return (((d->devices[bus][dev]) >> func) & 0x1);
-#else
 	return TRUE;
-#endif
 }
 
 
@@ -503,6 +520,43 @@ lba_rd_cfg(struct lba_device *d, u32 tok, u8 reg, u32 size)
 	return(data);
 }
 
+#ifdef CONFIG_PARISC64
+#define pat_cfg_addr(bus, devfn, addr) (((bus) << 16) | ((devfn) << 8) | (addr))
+
+static int pat_cfg_read(struct pci_bus *bus, unsigned int devfn, int pos, int size, u32 *data)
+{
+	int tok = pat_cfg_addr(bus->number, devfn, pos);
+	u32 tmp;
+	int ret = pdc_pat_io_pci_cfg_read(tok, size, &tmp);
+
+	DBG_CFG("%s(%d:%d.%d+0x%02x) -> 0x%x %d\n", __FUNCTION__, bus->number, PCI_SLOT(devfn), PCI_FUNC(devfn), pos, tmp, ret);
+
+	switch (size) {
+		case 1: *data = (u8)  tmp; return (tmp == (u8)  ~0);
+		case 2: *data = (u16) tmp; return (tmp == (u16) ~0);
+		case 4: *data = (u32) tmp; return (tmp == (u32) ~0);
+	}
+	*data = ~0;
+	return (ret);
+}
+
+static int pat_cfg_write(struct pci_bus *bus, unsigned int devfn, int pos, int size, u32 data)
+{
+	int tok = pat_cfg_addr(bus->number, devfn, pos);
+	int ret = pdc_pat_io_pci_cfg_write(tok, size, data);
+
+	DBG_CFG("%s(%d:%d.%d+0x%02x, 0x%lx/%d)\n", __FUNCTION__, bus->number, PCI_SLOT(devfn), PCI_FUNC(devfn), pos, data, size);
+	return (ret);
+}
+
+static struct pci_ops pat_cfg_ops = {
+	.read =		pat_cfg_read,
+	.write =	pat_cfg_write,
+};
+#else
+/* keep the compiler from complaining about undeclared variables */
+#define pat_cfg_ops lba_cfg_ops
+#endif
 
 static int lba_cfg_read(struct pci_bus *bus, unsigned int devfn, int pos, int size, u32 *data)
 {
@@ -610,6 +664,7 @@ static int lba_cfg_write(struct pci_bus *bus, unsigned int devfn, int pos, int s
 	}
 
 	DBG_CFG("%s(%x+%2x) = 0x%x (c)\n", __FUNCTION__, tok, pos, data);
+
 	/* Basic Algorithm */
 	LBA_CFG_TR4_ADDR_SETUP(d, tok | pos);
 	switch(size) {
@@ -639,7 +694,7 @@ lba_bios_init(void)
 }
 
 
-#ifdef __LP64__
+#ifdef CONFIG_PARISC64
 
 /*
 ** Determine if a device is already configured.
@@ -677,6 +732,8 @@ lba_claim_dev_resources(struct pci_dev *dev)
 		}
 	}
 }
+#else
+#define lba_claim_dev_resources(dev)
 #endif
 
 
@@ -734,7 +791,7 @@ lba_fixup_bus(struct pci_bus *bus)
 			lba_dump_res(&iomem_resource, 2);
 		}
 
-#ifdef __LP64__
+#ifdef CONFIG_PARISC64
 		if (ldev->hba.gmmio_space.flags) {
 			err = request_resource(&iomem_resource, &(ldev->hba.gmmio_space));
 			if (err < 0) {
@@ -792,12 +849,10 @@ lba_fixup_bus(struct pci_bus *bus)
 		bus->bridge_ctl &= ~(status & PCI_STATUS_FAST_BACK);
 #endif
 
-#ifdef __LP64__
 		if (is_pdc_pat()) {
 			/* Claim resources for PDC's devices */
 			lba_claim_dev_resources(dev);
 		}
-#endif
 
                 /*
 		** P2PB's have no IRQs. ignore them.
@@ -925,7 +980,7 @@ static struct pci_port_ops lba_astro_port_ops = {
 };
 
 
-#ifdef __LP64__
+#ifdef CONFIG_PARISC64
 #define PIOP_TO_GMMIO(lba, addr) \
 	((lba)->iop_base + (((addr)&0xFFFC)<<10) + ((addr)&3))
 
@@ -1093,7 +1148,11 @@ lba_pat_resources(struct parisc_device *pa_dev, struct lba_device *lba_dev)
 		}
 	}
 }
-#endif	/* __LP64__ */
+#else
+/* keep compiler from complaining about missing declarations */
+#define lba_pat_port_ops lba_astro_port_ops
+#define lba_pat_resources(pa_dev, lba_dev)
+#endif	/* CONFIG_PARISC64 */
 
 
 static void
@@ -1103,7 +1162,7 @@ lba_legacy_resources(struct parisc_device *pa_dev, struct lba_device *lba_dev)
 	unsigned long rsize;
 	int lba_num;
 
-#ifdef __LP64__
+#ifdef CONFIG_PARISC64
 	/*
 	** Sign extend all BAR values on "legacy" platforms.
 	** "Sprockets" PDC (Forte/Allegro) initializes everything
@@ -1237,7 +1296,7 @@ lba_hw_init(struct lba_device *d)
 	printk("\n");
 #endif	/* DEBUG_LBA_PAT */
 
-#ifdef __LP64__
+#ifdef CONFIG_PARISC64
 /*
  * FIXME add support for PDC_PAT_IO "Get slot status" - OLAR support
  * Only N-Class and up can really make use of Get slot status.
@@ -1317,7 +1376,7 @@ lba_common_init(struct lba_device *lba_dev)
 ** have work to do.
 */
 static int __init
-lba_driver_callback(struct parisc_device *dev)
+lba_driver_probe(struct parisc_device *dev)
 {
 	struct lba_device *lba_dev;
 	struct pci_bus *lba_bus;
@@ -1327,25 +1386,36 @@ lba_driver_callback(struct parisc_device *dev)
 
 	/* Read HW Rev First */
 	func_class = READ_REG32(dev->hpa + LBA_FCLASS);
-	func_class &= 0xf;
-
-	switch (func_class) {
-	case 0:	version = "TR1.0"; break;
-	case 1:	version = "TR2.0"; break;
-	case 2:	version = "TR2.1"; break;
-	case 3:	version = "TR2.2"; break;
-	case 4:	version = "TR3.0"; break;
-	case 5:	version = "TR4.0"; break;
-	default: version = "TR4+";
-	}
 
-	printk(KERN_INFO "%s version %s (0x%x) found at 0x%lx\n",
-		MODULE_NAME, version, func_class & 0xf, dev->hpa);
+	if (IS_ELROY(dev)) {	
+		func_class &= 0xf;
+		switch (func_class) {
+		case 0:	version = "TR1.0"; break;
+		case 1:	version = "TR2.0"; break;
+		case 2:	version = "TR2.1"; break;
+		case 3:	version = "TR2.2"; break;
+		case 4:	version = "TR3.0"; break;
+		case 5:	version = "TR4.0"; break;
+		default: version = "TR4+";
+		}
+		printk(KERN_INFO "%s version %s (0x%x) found at 0x%lx\n",
+			MODULE_NAME, version, func_class & 0xf, dev->hpa);
+
+		/* Just in case we find some prototypes... */
+	} else if (IS_MERCURY(dev) || IS_QUICKSILVER(dev)) {
+		func_class &= 0xff;
+		version = kmalloc(6, GFP_KERNEL);
+		sprintf(version,"TR%d.%d",(func_class >> 4),(func_class & 0xf));
+		/* We could use one printk for both and have it outside,
+                 * but for the mask for func_class.
+                 */ 
+		printk(KERN_INFO "%s version %s (0x%x) found at 0x%lx\n",
+			MODULE_NAME, version, func_class & 0xff, dev->hpa);
+	}
 
-	/* Just in case we find some prototypes... */
 	if (func_class < 2) {
-		printk(KERN_WARNING "Can't support LBA older than TR2.1 "
-			"- continuing under adversity.\n");
+		printk(KERN_WARNING "Can't support LBA older than TR2.1"
+				" - continuing under adversity.\n");
 	}
 
 	/*
@@ -1388,16 +1458,12 @@ lba_driver_callback(struct parisc_device *dev)
 
 	/* ---------- Third : setup I/O Port and MMIO resources  --------- */
 
-#ifdef __LP64__
 	if (is_pdc_pat()) {
 		/* PDC PAT firmware uses PIOP region of GMMIO space. */
 		pci_port = &lba_pat_port_ops;
-
 		/* Go ask PDC PAT what resources this LBA has */
 		lba_pat_resources(dev, lba_dev);
-	} else
-#endif
-	{
+	} else {
 		/* Sprockets PDC uses NPIOP region */
 		pci_port = &lba_astro_port_ops;
 
@@ -1412,9 +1478,9 @@ lba_driver_callback(struct parisc_device *dev)
 	dev->dev.platform_data = lba_dev;
 	lba_bus = lba_dev->hba.hba_bus =
 		pci_scan_bus_parented(&dev->dev, lba_dev->hba.bus_num.start,
-				      &lba_cfg_ops, NULL);
+				is_pdc_pat() ? &pat_cfg_ops : &lba_cfg_ops,
+				NULL);
 
-#ifdef __LP64__
 	if (is_pdc_pat()) {
 		/* assign resources to un-initialized devices */
 		DBG_PAT("LBA pci_bus_assign_resources()\n");
@@ -1427,7 +1493,6 @@ lba_driver_callback(struct parisc_device *dev)
 		lba_dump_res(&lba_dev->hba.lmmio_space, 2);
 #endif
 	}
-#endif
 
 	/*
 	** Once PCI register ops has walked the bus, access to config
@@ -1443,14 +1508,16 @@ lba_driver_callback(struct parisc_device *dev)
 }
 
 static struct parisc_device_id lba_tbl[] = {
-	{ HPHW_BRIDGE, HVERSION_REV_ANY_ID, 0x782, 0xa },
+	{ HPHW_BRIDGE, HVERSION_REV_ANY_ID, ELROY_HVERS, 0xa },
+	{ HPHW_BRIDGE, HVERSION_REV_ANY_ID, MERCURY_HVERS, 0xa },
+	{ HPHW_BRIDGE, HVERSION_REV_ANY_ID, QUICKSILVER_HVERS, 0xa },
 	{ 0, }
 };
 
 static struct parisc_driver lba_driver = {
 	.name =		MODULE_NAME,
 	.id_table =	lba_tbl,
-	.probe =	lba_driver_callback,
+	.probe =	lba_driver_probe,
 };
 
 /*
diff --git a/drivers/parisc/led.c b/drivers/parisc/led.c
index 7d497802b..c7d2d5d99 100644
--- a/drivers/parisc/led.c
+++ b/drivers/parisc/led.c
@@ -157,13 +157,13 @@ static int led_proc_read(char *page, char **start, off_t off, int count,
 static int led_proc_write(struct file *file, const char *buf, 
 	unsigned long count, void *data)
 {
-	char *cur, lbuf[count];
+	char *cur, lbuf[count + 1];
 	int d;
 
 	if (!capable(CAP_SYS_ADMIN))
 		return -EACCES;
 
-	memset(lbuf, 0, count);
+	memset(lbuf, 0, count + 1);
 
 	if (copy_from_user(lbuf, buf, count))
 		return -EFAULT;
@@ -197,7 +197,7 @@ static int led_proc_write(struct file *file, const char *buf,
 
 		break;
 	case LED_HASLCD:
-		while (*cur && cur[strlen(cur)-1] == '\n')
+		if (*cur && cur[strlen(cur)-1] == '\n')
 			cur[strlen(cur)-1] = 0;
 		if (*cur == 0) 
 			cur = lcd_text_default;
diff --git a/drivers/parisc/sba_iommu.c b/drivers/parisc/sba_iommu.c
index f1c850d20..f3cf291ad 100644
--- a/drivers/parisc/sba_iommu.c
+++ b/drivers/parisc/sba_iommu.c
@@ -27,9 +27,7 @@
 
 #include <linux/mm.h>
 #include <linux/string.h>
-#undef PCI_DEBUG		/* for ASSERT */
 #include <linux/pci.h>
-#undef PCI_DEBUG
 
 #include <asm/byteorder.h>
 #include <asm/io.h>
@@ -40,8 +38,13 @@
 #include <linux/proc_fs.h>
 #include <asm/runway.h>		/* for proc_runway_root */
 #include <asm/pdc.h>		/* for PDC_MODEL_* */
+#include <asm/pdcpat.h>		/* for is_pdc_pat() */
 #include <asm/parisc-device.h>
 
+
+/* declared in arch/parisc/kernel/setup.c */
+extern struct proc_dir_entry * proc_mckinley_root;
+
 #define MODULE_NAME "SBA"
 
 #ifdef CONFIG_PROC_FS
@@ -54,6 +57,7 @@
 ** Don't even think about messing with it unless you have
 ** plenty of 710's to sacrifice to the computer gods. :^)
 */
+#undef DEBUG_SBA_ASSERT
 #undef DEBUG_SBA_INIT
 #undef DEBUG_SBA_RUN
 #undef DEBUG_SBA_RUN_SG
@@ -62,8 +66,6 @@
 #undef DEBUG_LARGE_SG_ENTRIES
 #undef DEBUG_DMB_TRAP
 
-#define SBA_INLINE	__inline__
-
 #ifdef DEBUG_SBA_INIT
 #define DBG_INIT(x...)	printk(x)
 #else
@@ -89,6 +91,27 @@
 #define DBG_RES(x...)
 #endif
 
+#ifdef DEBUG_SBA_ASSERT
+#undef ASSERT
+#define ASSERT(expr) \
+	if(!(expr)) { \
+		printk("\n%s:%d: Assertion " #expr " failed!\n", \
+				__FILE__, __LINE__); \
+		panic(#expr); \
+	}
+#else
+#define ASSERT(expr)
+#endif
+
+
+#if defined(__LP64__) && !defined(CONFIG_PDC_NARROW)
+/* "low end" PA8800 machines use ZX1 chipset */
+#define ZX1_SUPPORT
+#endif
+
+#define SBA_INLINE	__inline__
+
+
 /*
 ** The number of pdir entries to "free" before issueing
 ** a read to PCOM register to flush out PCOM writes.
@@ -112,6 +135,9 @@
 #define REOG_MERCED_PORT	0x805
 #define REOG_ROPES_PORT		0x783
 
+#define PLUTO_MCKINLEY_PORT	0x880
+#define PLUTO_ROPES_PORT	0x784
+
 #define SBA_FUNC_ID	0x0000	/* function id */
 #define SBA_FCLASS	0x0008	/* function class, bist, header, rev... */
 
@@ -121,12 +147,17 @@
 #define IS_IKE(id) \
 (((id)->hversion == IKE_MERCED_PORT) || ((id)->hversion == IKE_ROPES_PORT))
 
+#define IS_PLUTO(id) \
+(((id)->hversion == PLUTO_MCKINLEY_PORT) || ((id)->hversion == PLUTO_ROPES_PORT))
+
 #define SBA_FUNC_SIZE 4096   /* SBA configuration function reg set */
 
 #define ASTRO_IOC_OFFSET 0x20000
 /* Ike's IOC's occupy functions 2 and 3 (not 0 and 1) */
 #define IKE_IOC_OFFSET(p) ((p+2)*SBA_FUNC_SIZE)
 
+#define PLUTO_IOC_OFFSET 0x1000
+
 #define IOC_CTRL          0x8	/* IOC_CTRL offset */
 #define IOC_CTRL_TC       (1 << 0) /* TOC Enable */
 #define IOC_CTRL_CE       (1 << 1) /* Coalesce Enable */
@@ -134,7 +165,7 @@
 #define IOC_CTRL_RM       (1 << 8) /* Real Mode */
 #define IOC_CTRL_NC       (1 << 9) /* Non Coherent Mode */
 
-#define MAX_IOC		2	/* per Ike. Astro only has 1 */
+#define MAX_IOC		2	/* per Ike. Pluto/Astro only have 1. */
 
 
 /*
@@ -170,7 +201,9 @@
 #define IOC_TCNFG	0x318
 #define IOC_PDIR_BASE	0x320
 
-#define IOC_IOVA_SPACE_BASE	0	/* IOVA ranges start at 0 */
+/* AGP GART driver looks for this */
+#define SBA_IOMMU_COOKIE    0x0000badbadc0ffeeUL
+
 
 /*
 ** IOC supports 4/8/16/64KB page sizes (see TCNFG register)
@@ -181,9 +214,7 @@
 ** page since the Virtual Coherence Index has to be generated
 ** and updated for each page.
 **
-** IOVP_SIZE could only be greater than PAGE_SIZE if we are
-** confident the drivers really only touch the next physical
-** page iff that driver instance owns it.
+** PAGE_SIZE could be greater than IOVP_SIZE. But not the inverse.
 */
 #define IOVP_SIZE	PAGE_SIZE
 #define IOVP_SHIFT	PAGE_SHIFT
@@ -207,13 +238,20 @@ struct ioc {
 	unsigned long	ioc_hpa;	/* I/O MMU base address */
 	char	*res_map;	/* resource map, bit == pdir entry */
 	u64	*pdir_base;	/* physical base address */
-
+	unsigned long	ibase;	/* pdir IOV Space base - shared w/lba_pci */
+	unsigned long	imask;	/* pdir IOV Space mask - shared w/lba_pci */
+#ifdef ZX1_SUPPORT
+	unsigned long	iovp_mask;	/* help convert IOVA to IOVP */
+#endif
 	unsigned long	*res_hint;	/* next avail IOVP - circular search */
 	spinlock_t	res_lock;
-	unsigned long	hint_mask_pdir;	/* bits used for DMA hints */
 	unsigned int	res_bitshift;	/* from the LEFT! */
 	unsigned int	res_size;	/* size of resource map in bytes */
+#if SBA_HINT_SUPPORT
+/* FIXME : DMA HINTs not used */
+	unsigned long	hint_mask_pdir;	/* bits used for DMA hints */
 	unsigned int	hint_shift_pdir;
+#endif
 #if DELAYED_RESOURCE_CNT > 0
 	int saved_cnt;
 	struct sba_dma_pair {
@@ -239,8 +277,6 @@ struct ioc {
 
 	/* STUFF We don't need in performance path */
 	unsigned int	pdir_size;	/* in bytes, determined by IOV Space size */
-	unsigned long	ibase;		/* pdir IOV Space base - shared w/lba_pci */
-	unsigned long	imask;		/* pdir IOV Space mask - shared w/lba_pci */
 };
 
 struct sba_device {
@@ -274,6 +310,9 @@ static unsigned long piranha_bad_128k = 0;
 /* Looks nice and keeps the compiler happy */
 #define SBA_DEV(d) ((struct sba_device *) (d))
 
+#if SBA_AGP_SUPPORT
+static int reserve_sba_gart = 1;
+#endif
 
 #define ROUNDUP(x,y) ((x + ((y)-1)) & ~((y)-1))
 
@@ -333,12 +372,15 @@ static void
 sba_dump_tlb(unsigned long hpa)
 {
 	DBG_INIT("IO TLB at 0x%lx\n", hpa);
-	DBG_INIT("IOC_IBASE    : %Lx\n", READ_REG64(hpa+IOC_IBASE));
-	DBG_INIT("IOC_IMASK    : %Lx\n", READ_REG64(hpa+IOC_IMASK));
-	DBG_INIT("IOC_TCNFG    : %Lx\n", READ_REG64(hpa+IOC_TCNFG));
-	DBG_INIT("IOC_PDIR_BASE: %Lx\n", READ_REG64(hpa+IOC_PDIR_BASE));
+	DBG_INIT("IOC_IBASE    : 0x%Lx\n", READ_REG64(hpa+IOC_IBASE));
+	DBG_INIT("IOC_IMASK    : 0x%Lx\n", READ_REG64(hpa+IOC_IMASK));
+	DBG_INIT("IOC_TCNFG    : 0x%Lx\n", READ_REG64(hpa+IOC_TCNFG));
+	DBG_INIT("IOC_PDIR_BASE: 0x%Lx\n", READ_REG64(hpa+IOC_PDIR_BASE));
 	DBG_INIT("\n");
 }
+#else
+#define sba_dump_ranges(x)
+#define sba_dump_tlb(x)
 #endif
 
 
@@ -458,13 +500,18 @@ sba_dump_sg( struct ioc *ioc, struct scatterlist *startsg, int nents)
 #define PAGES_PER_RANGE 1	/* could increase this to 4 or 8 if needed */
 
 /* Convert from IOVP to IOVA and vice versa. */
-#define SBA_IOVA(ioc,iovp,offset,hint_reg) ((iovp) | (offset) | ((hint_reg)<<(ioc->hint_shift_pdir)))
-#define SBA_IOVP(ioc,iova) ((iova) & ioc->hint_mask_pdir)
 
-/* FIXME : review these macros to verify correctness and usage */
+#ifdef ZX1_SUPPORT
+/* Pluto (aka ZX1) boxes need to set or clear the ibase bits appropriately */
+#define SBA_IOVA(ioc,iovp,offset,hint_reg) ((ioc->ibase) | (iovp) | (offset))
+#define SBA_IOVP(ioc,iova) ((iova) & (ioc)->iovp_mask)
+#else
+/* only support Astro and ancestors. Saves a few cycles in key places */
+#define SBA_IOVA(ioc,iovp,offset,hint_reg) ((iovp) | (offset))
+#define SBA_IOVP(ioc,iova) (iova)
+#endif
+
 #define PDIR_INDEX(iovp)   ((iovp)>>IOVP_SHIFT)
-#define MKIOVP(dma_hint,pide)  (dma_addr_t)((long)(dma_hint) | ((long)(pide) << IOVP_SHIFT))
-#define MKIOVA(iovp,offset) (dma_addr_t)((long)iovp | (long)offset)
 
 #define RESMAP_MASK(n)    (~0UL << (BITS_PER_LONG - (n)))
 #define RESMAP_IDX_MASK   (sizeof(unsigned long) - 1)
@@ -661,8 +708,9 @@ sba_free_range(struct ioc *ioc, dma_addr_t iova, size_t size)
 *
 ***************************************************************/
 
+#if SBA_HINT_SUPPORT
 #define SBA_DMA_HINT(ioc, val) ((val) << (ioc)->hint_shift_pdir)
-
+#endif
 
 typedef unsigned long space_t;
 #define KERNEL_SPACE 0
@@ -677,25 +725,33 @@ typedef unsigned long space_t;
  *
  * Given a virtual address (vba, arg2) and space id, (sid, arg1)
  * sba_io_pdir_entry() loads the I/O PDIR entry pointed to by
- * pdir_ptr (arg0). Each IO Pdir entry consists of 8 bytes as
- * shown below (MSB == bit 0):
+ * pdir_ptr (arg0). 
+ * Using the bass-ackwards HP bit numbering, Each IO Pdir entry
+ * for Astro/Ike looks like:
+ *
  *
  *  0                    19                                 51   55       63
  * +-+---------------------+----------------------------------+----+--------+
  * |V|        U            |            PPN[43:12]            | U  |   VI   |
  * +-+---------------------+----------------------------------+----+--------+
  *
- *  V  == Valid Bit
+ * Pluto is basically identical, supports fewer physical address bits:
+ *
+ *  0                       23                              51   55       63
+ * +-+------------------------+-------------------------------+----+--------+
+ * |V|        U               |         PPN[39:12]            | U  |   VI   |
+ * +-+------------------------+-------------------------------+----+--------+
+ *
+ *  V  == Valid Bit  (Most Significant Bit is bit 0)
  *  U  == Unused
  * PPN == Physical Page Number
  * VI  == Virtual Index (aka Coherent Index)
  *
- * The physical address fields are filled with the results of the LPA
- * instruction.  The virtual index field is filled with the results of
- * of the LCI (Load Coherence Index) instruction.  The 8 bits used for
- * the virtual index are bits 12:19 of the value returned by LCI.
+ * LPA instruction output is put into PPN field.
+ * LCI (Load Coherence Index) instruction provides the "VI" bits.
  *
- * We need to pre-swap the bytes since PCX-W is Big Endian.
+ * We pre-swap the bytes since PCX-W is Big Endian and the
+ * IOMMU uses little endian for the pdir.
  */
 
 
@@ -713,7 +769,7 @@ sba_io_pdir_entry(u64 *pdir_ptr, space_t sid, unsigned long vba,
 	ASSERT(sid == KERNEL_SPACE);
 
 	pa = virt_to_phys(vba);
-	pa &= ~4095ULL;			/* clear out offset bits */
+	pa &= IOVP_MASK;
 
 	mtsp(sid,1);
 	asm("lci 0(%%sr1, %1), %0" : "=r" (ci) : "r" (vba));
@@ -800,7 +856,7 @@ sba_mark_invalid(struct ioc *ioc, dma_addr_t iova, size_t byte_cnt)
 		} while (byte_cnt > 0);
 	}
 
-	WRITE_REG(iovp, ioc->ioc_hpa+IOC_PCOM);
+	WRITE_REG( SBA_IOVA(ioc, iovp, 0, 0), ioc->ioc_hpa+IOC_PCOM);
 }
 
 /**
@@ -868,7 +924,7 @@ sba_map_single(struct device *dev, void *addr, size_t size,
 	pide = sba_alloc_range(ioc, size);
 	iovp = (dma_addr_t) pide << IOVP_SHIFT;
 
-	DBG_RUN("%s() 0x%p -> 0x%lx",
+	DBG_RUN("%s() 0x%p -> 0x%lx\n",
 		__FUNCTION__, addr, (long) iovp | offset);
 
 	pdir_start = &(ioc->pdir_base[pide]);
@@ -877,7 +933,7 @@ sba_map_single(struct device *dev, void *addr, size_t size,
 		ASSERT(((u8 *)pdir_start)[7] == 0); /* verify availability */
 		sba_io_pdir_entry(pdir_start, KERNEL_SPACE, (unsigned long) addr, 0);
 
-		DBG_RUN(" pdir 0x%p %02x%02x%02x%02x%02x%02x%02x%02x\n",
+		DBG_RUN("	pdir 0x%p %02x%02x%02x%02x%02x%02x%02x%02x\n",
 			pdir_start,
 			(u8) (((u8 *) pdir_start)[7]),
 			(u8) (((u8 *) pdir_start)[6]),
@@ -941,14 +997,18 @@ sba_unmap_single(struct device *dev, dma_addr_t iova, size_t size,
 	ioc->usingle_pages += size >> IOVP_SHIFT;
 #endif
 
+	sba_mark_invalid(ioc, iova, size);
+
 #if DELAYED_RESOURCE_CNT > 0
+	/* Delaying when we re-use a IO Pdir entry reduces the number
+	 * of MMIO reads needed to flush writes to the PCOM register.
+	 */
 	d = &(ioc->saved[ioc->saved_cnt]);
 	d->iova = iova;
 	d->size = size;
 	if (++(ioc->saved_cnt) >= DELAYED_RESOURCE_CNT) {
 		int cnt = ioc->saved_cnt;
 		while (cnt--) {
-			sba_mark_invalid(ioc, d->iova, d->size);
 			sba_free_range(ioc, d->iova, d->size);
 			d--;
 		}
@@ -956,7 +1016,6 @@ sba_unmap_single(struct device *dev, dma_addr_t iova, size_t size,
 		READ_REG(ioc->ioc_hpa+IOC_PCOM);	/* flush purges */
 	}
 #else /* DELAYED_RESOURCE_CNT == 0 */
-	sba_mark_invalid(ioc, iova, size);
 	sba_free_range(ioc, iova, size);
 	READ_REG(ioc->ioc_hpa+IOC_PCOM);	/* flush purges */
 #endif /* DELAYED_RESOURCE_CNT == 0 */
@@ -1321,6 +1380,142 @@ sba_alloc_pdir(unsigned int pdir_size)
 	return (void *) pdir_base;
 }
 
+static void
+sba_ioc_init_pluto(struct parisc_device *sba, struct ioc *ioc, int ioc_num)
+{
+        /* lba_set_iregs() is in arch/parisc/kernel/lba_pci.c */
+        extern void lba_set_iregs(struct parisc_device *, u32, u32);
+
+	u32 iova_space_mask;
+	u32 iova_space_size;
+	int iov_order, tcnfg;
+	struct parisc_device *lba;
+#if SBA_AGP_SUPPORT
+	int agp_found = 0;
+#endif
+	/*
+	** Firmware programs the base and size of a "safe IOVA space"
+	** (one that doesn't overlap memory or LMMIO space) in the
+	** IBASE and IMASK registers.
+	*/
+	ioc->ibase = READ_REG(ioc->ioc_hpa + IOC_IBASE);
+	iova_space_size = ~(READ_REG(ioc->ioc_hpa + IOC_IMASK) & 0xFFFFFFFFUL) + 1;
+
+	if ((ioc->ibase < 0xfed00000UL) && ((ioc->ibase + iova_space_size) > 0xfee00000UL)) {
+		printk("WARNING: IOV space overlaps local config and interrupt message, truncating\n");
+		iova_space_size /= 2;
+	}
+
+	/*
+	** iov_order is always based on a 1GB IOVA space since we want to
+	** turn on the other half for AGP GART.
+	*/
+	iov_order = get_order(iova_space_size >> (IOVP_SHIFT - PAGE_SHIFT));
+	ioc->pdir_size = (iova_space_size / IOVP_SIZE) * sizeof(u64);
+
+	DBG_INIT("%s() hpa 0x%lx IOV %dMB (%d bits)\n",
+		__FUNCTION__, ioc->ioc_hpa, iova_space_size >> 20,
+		iov_order + PAGE_SHIFT);
+
+	ioc->pdir_base = (void *) __get_free_pages(GFP_KERNEL,
+						   get_order(ioc->pdir_size));
+	if (!ioc->pdir_base)
+		panic("Couldn't allocate I/O Page Table\n");
+
+	memset(ioc->pdir_base, 0, ioc->pdir_size);
+
+	DBG_INIT("%s() pdir %p size %x\n",
+			__FUNCTION__, ioc->pdir_base, ioc->pdir_size);
+
+#if SBA_HINT_SUPPORT
+	ioc->hint_shift_pdir = iov_order + PAGE_SHIFT;
+	ioc->hint_mask_pdir = ~(0x3 << (iov_order + PAGE_SHIFT));
+
+	DBG_INIT("	hint_shift_pdir %x hint_mask_pdir %lx\n",
+		ioc->hint_shift_pdir, ioc->hint_mask_pdir);
+#endif
+
+	ASSERT((((unsigned long) ioc->pdir_base) & PAGE_MASK) == (unsigned long) ioc->pdir_base);
+	WRITE_REG(virt_to_phys(ioc->pdir_base), ioc->ioc_hpa + IOC_PDIR_BASE);
+
+	/* build IMASK for IOC and Elroy */
+	iova_space_mask =  0xffffffff;
+	iova_space_mask <<= (iov_order + PAGE_SHIFT);
+	ioc->imask = iova_space_mask;
+#ifdef ZX1_SUPPORT
+	ioc->iovp_mask = ~(iova_space_mask + PAGE_SIZE - 1);
+#endif
+	sba_dump_tlb(ioc->ioc_hpa);
+
+	/*
+	** setup Mercury IBASE/IMASK registers as well.
+	*/
+	for (lba = sba->child; lba; lba = lba->sibling) {
+		int rope_num = (lba->hpa >> 13) & 0xf;
+		if (rope_num >> 3 == ioc_num)
+			lba_set_iregs(lba, ioc->ibase, ioc->imask);
+	}
+
+	WRITE_REG(ioc->imask, ioc->ioc_hpa + IOC_IMASK);
+
+#ifdef __LP64__
+	/*
+	** Setting the upper bits makes checking for bypass addresses
+	** a little faster later on.
+	*/
+	ioc->imask |= 0xFFFFFFFF00000000UL;
+#endif
+
+	/* Set I/O PDIR Page size to system page size */
+	switch (PAGE_SHIFT) {
+		case 12: tcnfg = 0; break;	/*  4K */
+		case 13: tcnfg = 1; break;	/*  8K */
+		case 14: tcnfg = 2; break;	/* 16K */
+		case 16: tcnfg = 3; break;	/* 64K */
+		default:
+			panic(__FILE__ "Unsupported system page size %d",
+				1 << PAGE_SHIFT);
+			break;
+	}
+	WRITE_REG(tcnfg, ioc->ioc_hpa + IOC_TCNFG);
+
+	/*
+	** Program the IOC's ibase and enable IOVA translation
+	** Bit zero == enable bit.
+	*/
+	WRITE_REG(ioc->ibase | 1, ioc->ioc_hpa + IOC_IBASE);
+
+	/*
+	** Clear I/O TLB of any possible entries.
+	** (Yes. This is a bit paranoid...but so what)
+	*/
+	WRITE_REG(ioc->ibase | 31, ioc->ioc_hpa + IOC_PCOM);
+
+#if SBA_AGP_SUPPORT
+	/*
+	** If an AGP device is present, only use half of the IOV space
+	** for PCI DMA.  Unfortunately we can't know ahead of time
+	** whether GART support will actually be used, for now we
+	** can just key on any AGP device found in the system.
+	** We program the next pdir index after we stop w/ a key for
+	** the GART code to handshake on.
+	*/
+	device=NULL;
+	for (lba = sba->child; lba; lba = lba->sibling) {
+		if (IS_QUICKSILVER(lba))
+			break;
+	}
+
+	if (lba) {
+		DBG_INIT("%s: Reserving half of IOVA space for AGP GART support\n", __FUNCTION__);
+		ioc->pdir_size /= 2;
+		((u64 *)ioc->pdir_base)[PDIR_INDEX(iova_space_size/2)] = SBA_IOMMU_COOKIE;
+	} else {
+		DBG_INIT("%s: No GART needed - no AGP controller found\n", __FUNCTION__);
+	}
+#endif /* 0 */
+
+}
 
 static void
 sba_ioc_init(struct parisc_device *sba, struct ioc *ioc, int ioc_num)
@@ -1381,15 +1576,19 @@ sba_ioc_init(struct parisc_device *sba, struct ioc *ioc, int ioc_num)
 		__FUNCTION__, ioc->ioc_hpa, (int) (physmem>>20),
 		iova_space_size>>20, iov_order + PAGE_SHIFT, pdir_size);
 
+	ioc->pdir_base = sba_alloc_pdir(pdir_size);
+
+	DBG_INIT("%s() pdir %p size %x\n",
+			__FUNCTION__, ioc->pdir_base, pdir_size);
+
+#if SBA_HINT_SUPPORT
 	/* FIXME : DMA HINTs not used */
 	ioc->hint_shift_pdir = iov_order + PAGE_SHIFT;
 	ioc->hint_mask_pdir = ~(0x3 << (iov_order + PAGE_SHIFT));
 
-	ioc->pdir_base = sba_alloc_pdir(pdir_size);
-
-	DBG_INIT("%s() pdir %p size %x hint_shift_pdir %x hint_mask_pdir %lx\n",
-		__FUNCTION__, ioc->pdir_base, pdir_size,
-		ioc->hint_shift_pdir, ioc->hint_mask_pdir);
+	DBG_INIT("	hint_shift_pdir %x hint_mask_pdir %lx\n",
+			ioc->hint_shift_pdir, ioc->hint_mask_pdir);
+#endif
 
 	ASSERT((((unsigned long) ioc->pdir_base) & PAGE_MASK) == (unsigned long) ioc->pdir_base);
 	WRITE_REG64(virt_to_phys(ioc->pdir_base), ioc->ioc_hpa + IOC_PDIR_BASE);
@@ -1402,8 +1601,11 @@ sba_ioc_init(struct parisc_device *sba, struct ioc *ioc, int ioc_num)
 	** On C3000 w/512MB mem, HP-UX 10.20 reports:
 	**     ibase=0, imask=0xFE000000, size=0x2000000.
 	*/
-	ioc->ibase = IOC_IOVA_SPACE_BASE | 1;	/* bit 0 == enable bit */
+	ioc->ibase = 0;
 	ioc->imask = iova_space_mask;	/* save it */
+#ifdef ZX1_SUPPORT
+	ioc->iovp_mask = ~(iova_space_mask + PAGE_SIZE - 1);
+#endif
 
 	DBG_INIT("%s() IOV base 0x%lx mask 0x%0lx\n",
 		__FUNCTION__, ioc->ibase, ioc->imask);
@@ -1426,7 +1628,7 @@ sba_ioc_init(struct parisc_device *sba, struct ioc *ioc, int ioc_num)
 	/*
 	** Program the IOC's ibase and enable IOVA translation
 	*/
-	WRITE_REG(ioc->ibase, ioc->ioc_hpa+IOC_IBASE);
+	WRITE_REG(ioc->ibase | 1, ioc->ioc_hpa+IOC_IBASE);
 	WRITE_REG(ioc->imask, ioc->ioc_hpa+IOC_IMASK);
 
 	/* Set I/O PDIR Page size to 4K */
@@ -1438,6 +1640,8 @@ sba_ioc_init(struct parisc_device *sba, struct ioc *ioc, int ioc_num)
 	*/
 	WRITE_REG(0 | 31, ioc->ioc_hpa+IOC_PCOM);
 
+	ioc->ibase = 0; /* used by SBA_IOVA and related macros */	
+
 	DBG_INIT("%s() DONE\n", __FUNCTION__);
 }
 
@@ -1476,23 +1680,32 @@ sba_hw_init(struct sba_device *sba_dev)
 		*/
 	}
 
-	ioc_ctl = READ_REG(sba_dev->sba_hpa+IOC_CTRL);
-	DBG_INIT("%s() hpa 0x%lx ioc_ctl 0x%Lx ->",
-		__FUNCTION__, sba_dev->sba_hpa, ioc_ctl);
-	ioc_ctl &= ~(IOC_CTRL_RM | IOC_CTRL_NC | IOC_CTRL_CE);
-	ioc_ctl |= IOC_CTRL_TC;	/* Astro: firmware enables this */
+	if (!IS_PLUTO(sba_dev->iodc)) {
+		ioc_ctl = READ_REG(sba_dev->sba_hpa+IOC_CTRL);
+		DBG_INIT("%s() hpa 0x%lx ioc_ctl 0x%Lx ->",
+			__FUNCTION__, sba_dev->sba_hpa, ioc_ctl);
+		ioc_ctl &= ~(IOC_CTRL_RM | IOC_CTRL_NC | IOC_CTRL_CE);
+		ioc_ctl |= IOC_CTRL_TC;	/* Astro: firmware enables this */
 
-	WRITE_REG(ioc_ctl, sba_dev->sba_hpa+IOC_CTRL);
+		WRITE_REG(ioc_ctl, sba_dev->sba_hpa+IOC_CTRL);
 
 #ifdef DEBUG_SBA_INIT
-	ioc_ctl = READ_REG64(sba_dev->sba_hpa+IOC_CTRL);
-	DBG_INIT(" 0x%Lx\n", ioc_ctl);
+		ioc_ctl = READ_REG64(sba_dev->sba_hpa+IOC_CTRL);
+		DBG_INIT(" 0x%Lx\n", ioc_ctl);
 #endif
+	} /* if !PLUTO */
 
 	if (IS_ASTRO(sba_dev->iodc)) {
 		/* PAT_PDC (L-class) also reports the same goofy base */
 		sba_dev->ioc[0].ioc_hpa = ASTRO_IOC_OFFSET;
 		num_ioc = 1;
+	} else if (IS_PLUTO(sba_dev->iodc)) {
+		/* We use a negative value for IOC HPA so it gets 
+                 * corrected when we add it with IKE's IOC offset.
+		 * Doesnt look clean, but fewer code. 
+                 */
+		sba_dev->ioc[0].ioc_hpa = -PLUTO_IOC_OFFSET;
+		num_ioc = 1;
 	} else {
 		sba_dev->ioc[0].ioc_hpa = sba_dev->ioc[1].ioc_hpa = 0;
 		num_ioc = 2;
@@ -1517,7 +1730,11 @@ sba_hw_init(struct sba_device *sba_dev)
 		/* flush out the writes */
 		READ_REG(sba_dev->ioc[i].ioc_hpa + ROPE7_CTL);
 
-		sba_ioc_init(sba_dev->dev, &(sba_dev->ioc[i]), i);
+		if (IS_PLUTO(sba_dev->iodc)) {
+			sba_ioc_init_pluto(sba_dev->dev, &(sba_dev->ioc[i]), i);
+		} else {
+			sba_ioc_init(sba_dev->dev, &(sba_dev->ioc[i]), i);
+		}
 	}
 }
 
@@ -1709,11 +1926,16 @@ static struct parisc_device_id sba_tbl[] = {
 	{ HPHW_BCPORT, HVERSION_REV_ANY_ID, IKE_MERCED_PORT, 0xc },
 	{ HPHW_BCPORT, HVERSION_REV_ANY_ID, REO_MERCED_PORT, 0xc },
 	{ HPHW_BCPORT, HVERSION_REV_ANY_ID, REOG_MERCED_PORT, 0xc },
+	{ HPHW_IOA, HVERSION_REV_ANY_ID, PLUTO_MCKINLEY_PORT, 0xc },
 /* These two entries commented out because we don't find them in a
  * buswalk yet.  If/when we do, they would cause us to think we had
  * many more SBAs then we really do.
  *	{ HPHW_BCPORT, HVERSION_REV_ANY_ID, ASTRO_ROPES_PORT, 0xc },
  *	{ HPHW_BCPORT, HVERSION_REV_ANY_ID, IKE_ROPES_PORT, 0xc },
+ */
+/* We shall also comment out Pluto Ropes Port since bus walk doesnt
+ * report it yet. 
+ *	{ HPHW_BCPORT, HVERSION_REV_ANY_ID, PLUTO_ROPES_PORT, 0xc },
  */
 	{ 0, }
 };
@@ -1739,9 +1961,7 @@ sba_driver_callback(struct parisc_device *dev)
 	int i;
 	char *version;
 
-#ifdef DEBUG_SBA_INIT
 	sba_dump_ranges(dev->hpa);
-#endif
 
 	/* Read HW Rev First */
 	func_class = READ_REG(dev->hpa + SBA_FCLASS);
@@ -1758,13 +1978,16 @@ sba_driver_callback(struct parisc_device *dev)
 		version = astro_rev;
 
 	} else if (IS_IKE(&dev->id)) {
-		static char ike_rev[]="Ike rev ?";
-
+		static char ike_rev[] = "Ike rev ?";
 		ike_rev[8] = '0' + (char) (func_class & 0xff);
 		version = ike_rev;
+	} else if (IS_PLUTO(&dev->id)) {
+		static char pluto_rev[]="Pluto ?.?";
+		pluto_rev[6] = '0' + (char) ((func_class & 0xf0) >> 4); 
+		pluto_rev[8] = '0' + (char) (func_class & 0x0f); 
+		version = pluto_rev;
 	} else {
-		static char reo_rev[]="REO rev ?";
-
+		static char reo_rev[] = "REO rev ?";
 		reo_rev[8] = '0' + (char) (func_class & 0xff);
 		version = reo_rev;
 	}
@@ -1772,18 +1995,14 @@ sba_driver_callback(struct parisc_device *dev)
 	if (!global_ioc_cnt) {
 		global_ioc_cnt = count_parisc_driver(&sba_driver);
 
-		/* Only Astro has one IOC per SBA */
-		if (!IS_ASTRO(&dev->id))
+		/* Astro and Pluto have one IOC per SBA */
+		if ((!IS_ASTRO(&dev->id)) || (!IS_PLUTO(&dev->id)))
 			global_ioc_cnt *= 2;
 	}
 
 	printk(KERN_INFO "%s found %s at 0x%lx\n",
 		MODULE_NAME, version, dev->hpa);
 
-#ifdef DEBUG_SBA_INIT
-	sba_dump_tlb(dev->hpa);
-#endif
-
 	sba_dev = kmalloc(sizeof(struct sba_device), GFP_KERNEL);
 	if (NULL == sba_dev) {
 		printk(KERN_ERR MODULE_NAME " - couldn't alloc sba_device\n");
@@ -1813,6 +2032,8 @@ sba_driver_callback(struct parisc_device *dev)
 		create_proc_info_entry("Astro", 0, proc_runway_root, sba_proc_info);
 	} else if (IS_IKE(&dev->id)) {
 		create_proc_info_entry("Ike", 0, proc_runway_root, sba_proc_info);
+	} else if (IS_PLUTO(&dev->id)) {
+		create_proc_info_entry("Pluto", 0, proc_mckinley_root, sba_proc_info);
 	} else {
 		create_proc_info_entry("Reo", 0, proc_runway_root, sba_proc_info);
 	}
diff --git a/drivers/parisc/superio.c b/drivers/parisc/superio.c
index ad7811509..6357ec10e 100644
--- a/drivers/parisc/superio.c
+++ b/drivers/parisc/superio.c
@@ -419,8 +419,10 @@ superio_serial_init(void)
 {
 #ifdef CONFIG_SERIAL_8250
 	int retval;
+#ifdef CONFIG_SERIAL_8250_CONSOLE
 	extern void serial8250_console_init(void); /* drivers/serial/8250.c */
-	
+#endif        
+        
 	if (!sio_dev.irq_region)
 		return; /* superio not present */
 
@@ -438,8 +440,10 @@ superio_serial_init(void)
 		return;
 	}
 
+#ifdef CONFIG_SERIAL_8250_CONSOLE
 	serial8250_console_init();
-
+#endif
+        
 	serial[1].iobase = sio_dev.sp2_base;
 	serial[1].irq = sio_dev.irq_region->data.irqbase + SP2_IRQ;
 	retval = early_serial_setup(&serial[1]);
diff --git a/drivers/parport/ChangeLog b/drivers/parport/ChangeLog
index 692415edb..db717c1d6 100644
--- a/drivers/parport/ChangeLog
+++ b/drivers/parport/ChangeLog
@@ -1,3 +1,7 @@
+2001-10-11  Tim Waugh  <twaugh@redhat.com>
+	* parport_pc.c, parport_serial.c: Support for NetMos cards.
+	+ Patch originally from Michael Reinelt <reinelt@eunet.at>.
+
 2002-04-25  Tim Waugh  <twaugh@redhat.com>
 
 	* parport_serial.c, parport_pc.c: Move some SIIG cards around.
diff --git a/drivers/parport/parport_pc.c b/drivers/parport/parport_pc.c
index 218eb4fd7..dfc8a8404 100644
--- a/drivers/parport/parport_pc.c
+++ b/drivers/parport/parport_pc.c
@@ -2147,7 +2147,7 @@ struct parport *parport_pc_probe_port (unsigned long int base,
 	priv->ctr_writable = ~0x10;
 	priv->ecr = 0;
 	priv->fifo_depth = 0;
-	priv->dma_buf = 0;
+	priv->dma_buf = NULL;
 	priv->dma_handle = 0;
 	priv->dev = dev;
 	INIT_LIST_HEAD(&priv->list);
@@ -2632,6 +2632,10 @@ enum parport_pc_pci_cards {
 	oxsemi_840,
 	aks_0100,
 	mobility_pp,
+	netmos_9705,
+	netmos_9805,
+	netmos_9815,
+	netmos_9855,
 };
 
 
@@ -2701,6 +2705,10 @@ static struct parport_pc_pci {
 	/* oxsemi_840 */		{ 1, { { 0, -1 }, } },
 	/* aks_0100 */                  { 1, { { 0, -1 }, } },
 	/* mobility_pp */		{ 1, { { 0, 1 }, } },
+	/* netmos_9705 */               { 1, { { 0, -1 }, } }, /* untested */
+	/* netmos_9805 */               { 1, { { 0, -1 }, } }, /* untested */
+	/* netmos_9815 */               { 2, { { 0, -1 }, { 2, -1 }, } }, /* untested */
+	/* netmos_9855 */               { 2, { { 0, -1 }, { 2, -1 }, } }, /* untested */
 };
 
 static struct pci_device_id parport_pc_pci_tbl[] = {
@@ -2769,6 +2777,15 @@ static struct pci_device_id parport_pc_pci_tbl[] = {
 	  PCI_ANY_ID, PCI_ANY_ID, 0, 0, oxsemi_840 },
 	{ PCI_VENDOR_ID_AKS, PCI_DEVICE_ID_AKS_ALADDINCARD,
 	  PCI_ANY_ID, PCI_ANY_ID, 0, 0, aks_0100 },
+	/* NetMos communication controllers */
+	{ PCI_VENDOR_ID_NETMOS, PCI_DEVICE_ID_NETMOS_9705,
+	  PCI_ANY_ID, PCI_ANY_ID, 0, 0, netmos_9705 },
+	{ PCI_VENDOR_ID_NETMOS, PCI_DEVICE_ID_NETMOS_9805,
+	  PCI_ANY_ID, PCI_ANY_ID, 0, 0, netmos_9805 },
+	{ PCI_VENDOR_ID_NETMOS, PCI_DEVICE_ID_NETMOS_9815,
+	  PCI_ANY_ID, PCI_ANY_ID, 0, 0, netmos_9815 },
+	{ PCI_VENDOR_ID_NETMOS, PCI_DEVICE_ID_NETMOS_9855,
+	  PCI_ANY_ID, PCI_ANY_ID, 0, 0, netmos_9855 },
 	{ 0, } /* terminate list */
 };
 MODULE_DEVICE_TABLE(pci,parport_pc_pci_tbl);
diff --git a/drivers/parport/parport_serial.c b/drivers/parport/parport_serial.c
index c29e8ded5..1f17d0124 100644
--- a/drivers/parport/parport_serial.c
+++ b/drivers/parport/parport_serial.c
@@ -33,6 +33,8 @@
 enum parport_pc_pci_cards {
 	titan_110l = 0,
 	titan_210l,
+	netmos_9735,
+	netmos_9835,
 	avlab_1s1p,
 	avlab_1s1p_650,
 	avlab_1s1p_850,
@@ -71,6 +73,8 @@ static struct parport_pc_pci {
 } cards[] __devinitdata = {
 	/* titan_110l */		{ 1, { { 3, -1 }, } },
 	/* titan_210l */		{ 1, { { 3, -1 }, } },
+	/* netmos_9735 (not tested) */	{ 1, { { 2, -1 }, } },
+	/* netmos_9835 */		{ 1, { { 2, -1 }, } },
 	/* avlab_1s1p     */		{ 1, { { 1, 2}, } },
 	/* avlab_1s1p_650 */		{ 1, { { 1, 2}, } },
 	/* avlab_1s1p_850 */		{ 1, { { 1, 2}, } },
@@ -93,6 +97,10 @@ static struct pci_device_id parport_serial_pci_tbl[] = {
 	  PCI_ANY_ID, PCI_ANY_ID, 0, 0, titan_110l },
 	{ PCI_VENDOR_ID_TITAN, PCI_DEVICE_ID_TITAN_210L,
 	  PCI_ANY_ID, PCI_ANY_ID, 0, 0, titan_210l },
+	{ PCI_VENDOR_ID_NETMOS, PCI_DEVICE_ID_NETMOS_9735,
+	  PCI_ANY_ID, PCI_ANY_ID, 0, 0, netmos_9735 },
+	{ PCI_VENDOR_ID_NETMOS, PCI_DEVICE_ID_NETMOS_9835,
+	  PCI_ANY_ID, PCI_ANY_ID, 0, 0, netmos_9835 },
 	/* PCI_VENDOR_ID_AVLAB/Intek21 has another bunch of cards ...*/
 	{ 0x14db, 0x2110, PCI_ANY_ID, PCI_ANY_ID, 0, 0, avlab_1s1p},
 	{ 0x14db, 0x2111, PCI_ANY_ID, PCI_ANY_ID, 0, 0, avlab_1s1p_650},
@@ -172,6 +180,8 @@ static struct pci_board_no_ids pci_boards[] __devinitdata = {
 
 /* titan_110l */	{ SPCI_FL_BASE1 | SPCI_FL_BASE_TABLE, 1, 921600 },
 /* titan_210l */	{ SPCI_FL_BASE1 | SPCI_FL_BASE_TABLE, 2, 921600 },
+/* netmos_9735 (n/t)*/	{ SPCI_FL_BASE0 | SPCI_FL_BASE_TABLE, 2, 115200 },
+/* netmos_9835 */	{ SPCI_FL_BASE0 | SPCI_FL_BASE_TABLE, 2, 115200 },
 /* avlab_1s1p (n/t) */	{ SPCI_FL_BASE0 | SPCI_FL_BASE_TABLE, 1, 115200 },
 /* avlab_1s1p_650 (nt)*/{ SPCI_FL_BASE0 | SPCI_FL_BASE_TABLE, 1, 115200 },
 /* avlab_1s1p_850 (nt)*/{ SPCI_FL_BASE0 | SPCI_FL_BASE_TABLE, 1, 115200 },
diff --git a/drivers/parport/procfs.c b/drivers/parport/procfs.c
index afa6ac45a..061097fd8 100644
--- a/drivers/parport/procfs.c
+++ b/drivers/parport/procfs.c
@@ -33,7 +33,7 @@
 #define PARPORT_MAX_SPINTIME_VALUE 1000
 
 static int do_active_device(ctl_table *table, int write, struct file *filp,
-		      void __user *result, size_t *lenp)
+		      void __user *result, size_t *lenp, loff_t *ppos)
 {
 	struct parport *port = (struct parport *)table->extra1;
 	char buffer[256];
@@ -43,7 +43,7 @@ static int do_active_device(ctl_table *table, int write, struct file *filp,
 	if (write)		/* can't happen anyway */
 		return -EACCES;
 
-	if (filp->f_pos) {
+	if (*ppos) {
 		*lenp = 0;
 		return 0;
 	}
@@ -63,14 +63,14 @@ static int do_active_device(ctl_table *table, int write, struct file *filp,
 	else
 		*lenp = len;
 
-	filp->f_pos += len;
+	*ppos += len;
 
 	return copy_to_user(result, buffer, len) ? -EFAULT : 0;
 }
 
 #ifdef CONFIG_PARPORT_1284
 static int do_autoprobe(ctl_table *table, int write, struct file *filp,
-			void __user *result, size_t *lenp)
+			void __user *result, size_t *lenp, loff_t *ppos)
 {
 	struct parport_device_info *info = table->extra2;
 	const char *str;
@@ -80,7 +80,7 @@ static int do_autoprobe(ctl_table *table, int write, struct file *filp,
 	if (write) /* permissions stop this */
 		return -EACCES;
 
-	if (filp->f_pos) {
+	if (*ppos) {
 		*lenp = 0;
 		return 0;
 	}
@@ -105,7 +105,7 @@ static int do_autoprobe(ctl_table *table, int write, struct file *filp,
 	else
 		*lenp = len;
 
-	filp->f_pos += len;
+	*ppos += len;
 
 	return copy_to_user (result, buffer, len) ? -EFAULT : 0;
 }
@@ -113,13 +113,13 @@ static int do_autoprobe(ctl_table *table, int write, struct file *filp,
 
 static int do_hardware_base_addr (ctl_table *table, int write,
 				  struct file *filp, void __user *result,
-				  size_t *lenp)
+				  size_t *lenp, loff_t *ppos)
 {
 	struct parport *port = (struct parport *)table->extra1;
 	char buffer[20];
 	int len = 0;
 
-	if (filp->f_pos) {
+	if (*ppos) {
 		*lenp = 0;
 		return 0;
 	}
@@ -134,20 +134,20 @@ static int do_hardware_base_addr (ctl_table *table, int write,
 	else
 		*lenp = len;
 
-	filp->f_pos += len;
+	*ppos += len;
 
 	return copy_to_user(result, buffer, len) ? -EFAULT : 0;
 }
 
 static int do_hardware_irq (ctl_table *table, int write,
 			    struct file *filp, void __user *result,
-			    size_t *lenp)
+			    size_t *lenp, loff_t *ppos)
 {
 	struct parport *port = (struct parport *)table->extra1;
 	char buffer[20];
 	int len = 0;
 
-	if (filp->f_pos) {
+	if (*ppos) {
 		*lenp = 0;
 		return 0;
 	}
@@ -162,20 +162,20 @@ static int do_hardware_irq (ctl_table *table, int write,
 	else
 		*lenp = len;
 
-	filp->f_pos += len;
+	*ppos += len;
 
 	return copy_to_user(result, buffer, len) ? -EFAULT : 0;
 }
 
 static int do_hardware_dma (ctl_table *table, int write,
 			    struct file *filp, void __user *result,
-			    size_t *lenp)
+			    size_t *lenp, loff_t *ppos)
 {
 	struct parport *port = (struct parport *)table->extra1;
 	char buffer[20];
 	int len = 0;
 
-	if (filp->f_pos) {
+	if (*ppos) {
 		*lenp = 0;
 		return 0;
 	}
@@ -190,20 +190,20 @@ static int do_hardware_dma (ctl_table *table, int write,
 	else
 		*lenp = len;
 
-	filp->f_pos += len;
+	*ppos += len;
 
 	return copy_to_user(result, buffer, len) ? -EFAULT : 0;
 }
 
 static int do_hardware_modes (ctl_table *table, int write,
 			      struct file *filp, void __user *result,
-			      size_t *lenp)
+			      size_t *lenp, loff_t *ppos)
 {
 	struct parport *port = (struct parport *)table->extra1;
 	char buffer[40];
 	int len = 0;
 
-	if (filp->f_pos) {
+	if (*ppos) {
 		*lenp = 0;
 		return 0;
 	}
@@ -229,7 +229,7 @@ static int do_hardware_modes (ctl_table *table, int write,
 	else
 		*lenp = len;
 
-	filp->f_pos += len;
+	*ppos += len;
 
 	return copy_to_user(result, buffer, len) ? -EFAULT : 0;
 }
diff --git a/drivers/pci/Kconfig b/drivers/pci/Kconfig
index b8f764fd2..929012e60 100644
--- a/drivers/pci/Kconfig
+++ b/drivers/pci/Kconfig
@@ -1,22 +1,15 @@
 #
 # PCI configuration
 #
-config PCI_USE_VECTOR
-	bool "Vector-based interrupt indexing (MSI)"
-	depends on (X86_LOCAL_APIC && X86_IO_APIC && !X86_64) || IA64
+config PCI_MSI
+	bool "Message Signaled Interrupts (MSI and MSI-X)"
+	depends on (X86_LOCAL_APIC && X86_IO_APIC) || IA64
 	default n
 	help
-	   This replaces the current existing IRQ-based index interrupt scheme
-	   with the vector-base index scheme. The advantages of vector base
-	   over IRQ base are listed below:
-	   1) Support MSI implementation.
-	   2) Support future IOxAPIC hotplug
-
-	   Note that this allows the device drivers to enable MSI, Message
-	   Signaled Interrupt, on all MSI capable device functions detected.
-	   Message Signal Interrupt enables an MSI-capable hardware device to
-	   send an inbound Memory Write on its PCI bus instead of asserting
-	   IRQ signal on device IRQ pin.
+	   This allows device drivers to enable MSI (Message Signaled
+	   Interrupts).  Message Signaled Interrupts enable a device to
+	   generate an interrupt using an inbound Memory Write on its
+	   PCI bus instead of asserting a device IRQ pin.
 
 	   If you don't know what to do here, say N.
 
diff --git a/drivers/pci/Makefile b/drivers/pci/Makefile
index 260b12b34..377c7238c 100644
--- a/drivers/pci/Makefile
+++ b/drivers/pci/Makefile
@@ -26,7 +26,7 @@ obj-$(CONFIG_PPC32) += setup-irq.o
 obj-$(CONFIG_PPC64) += setup-bus.o
 obj-$(CONFIG_MIPS) += setup-bus.o setup-irq.o
 obj-$(CONFIG_X86_VISWS) += setup-irq.o
-obj-$(CONFIG_PCI_USE_VECTOR) += msi.o
+obj-$(CONFIG_PCI_MSI) += msi.o
 
 # Cardbus & CompactPCI use setup-bus
 obj-$(CONFIG_HOTPLUG) += setup-bus.o
diff --git a/drivers/pci/hotplug.c b/drivers/pci/hotplug.c
index 213a1a3b4..42b23049a 100644
--- a/drivers/pci/hotplug.c
+++ b/drivers/pci/hotplug.c
@@ -59,7 +59,7 @@ int pci_hotplug (struct device *dev, char **envp, int num_envp,
 	if ((buffer_size - length <= 0) || (i >= num_envp))
 		return -ENOMEM;
 
-	envp[i] = 0;
+	envp[i] = NULL;
 
 	return 0;
 }
diff --git a/drivers/pci/hotplug/acpiphp_glue.c b/drivers/pci/hotplug/acpiphp_glue.c
index 8fa346f6e..d41795bb6 100644
--- a/drivers/pci/hotplug/acpiphp_glue.c
+++ b/drivers/pci/hotplug/acpiphp_glue.c
@@ -1227,7 +1227,7 @@ struct acpiphp_slot *get_slot_from_id(int id)
 	/* should never happen! */
 	err("%s: no object for id %d\n", __FUNCTION__, id);
 	WARN_ON(1);
-	return 0;
+	return NULL;
 }
 
 
diff --git a/drivers/pci/hotplug/cpci_hotplug_core.c b/drivers/pci/hotplug/cpci_hotplug_core.c
index 5b33e965f..868623fd6 100644
--- a/drivers/pci/hotplug/cpci_hotplug_core.c
+++ b/drivers/pci/hotplug/cpci_hotplug_core.c
@@ -614,9 +614,9 @@ cpci_start_thread(void)
 	thread_finished = 0;
 
 	if(controller->irq) {
-		pid = kernel_thread(event_thread, 0, 0);
+		pid = kernel_thread(event_thread, NULL, 0);
 	} else {
-		pid = kernel_thread(poll_thread, 0, 0);
+		pid = kernel_thread(poll_thread, NULL, 0);
 	}
 	if(pid < 0) {
 		err("Can't start up our thread");
diff --git a/drivers/pci/hotplug/cpqphp_ctrl.c b/drivers/pci/hotplug/cpqphp_ctrl.c
index a7913f7e9..7073a4aeb 100644
--- a/drivers/pci/hotplug/cpqphp_ctrl.c
+++ b/drivers/pci/hotplug/cpqphp_ctrl.c
@@ -1829,7 +1829,7 @@ int cpqhp_event_start_thread(void)
 	init_MUTEX_LOCKED(&event_exit);
 	event_finished=0;
 
-	pid = kernel_thread(event_thread, 0, 0);
+	pid = kernel_thread(event_thread, NULL, 0);
 	if (pid < 0) {
 		err ("Can't start up our event thread\n");
 		return -1;
diff --git a/drivers/pci/hotplug/ibmphp_hpc.c b/drivers/pci/hotplug/ibmphp_hpc.c
index 4594fab35..105dc70e6 100644
--- a/drivers/pci/hotplug/ibmphp_hpc.c
+++ b/drivers/pci/hotplug/ibmphp_hpc.c
@@ -1081,7 +1081,7 @@ int __init ibmphp_hpc_start_poll_thread (void)
 
 	debug ("%s - Entry\n", __FUNCTION__);
 
-	tid_poll = kernel_thread (hpc_poll_thread, 0, 0);
+	tid_poll = kernel_thread (hpc_poll_thread, NULL, 0);
 	if (tid_poll < 0) {
 		err ("%s - Error, thread not started\n", __FUNCTION__);
 		rc = -1;
diff --git a/drivers/pci/hotplug/pciehp_ctrl.c b/drivers/pci/hotplug/pciehp_ctrl.c
index 4c5bb2f81..2015af915 100644
--- a/drivers/pci/hotplug/pciehp_ctrl.c
+++ b/drivers/pci/hotplug/pciehp_ctrl.c
@@ -1058,6 +1058,34 @@ static int is_bridge(struct pci_func * func)
    hotplug controller logic
  */
 
+static void set_slot_off(struct controller *ctrl, struct slot * pslot)
+{
+	/* Wait for exclusive access to hardware */
+	down(&ctrl->crit_sect);
+
+	/* turn off slot, turn on Amber LED, turn off Green LED */
+	if (pslot->hpc_ops->power_off_slot(pslot)) {   
+		err("%s: Issue of Slot Power Off command failed\n", __FUNCTION__);
+		up(&ctrl->crit_sect);
+		return;
+	}
+	wait_for_ctrl_irq (ctrl);
+
+	pslot->hpc_ops->green_led_off(pslot);   
+	
+	wait_for_ctrl_irq (ctrl);
+
+	/* turn on Amber LED */
+	if (pslot->hpc_ops->set_attention_status(pslot, 1)) {   
+		err("%s: Issue of Set Attention Led command failed\n", __FUNCTION__);
+		up(&ctrl->crit_sect);
+		return;
+	}
+	wait_for_ctrl_irq (ctrl);
+
+	/* Done with exclusive hardware access */
+	up(&ctrl->crit_sect);
+}
 
 /**
  * board_added - Called after a board has been added to the system.
@@ -1071,7 +1099,7 @@ static u32 board_added(struct pci_func * func, struct controller * ctrl)
 	u8 hp_slot;
 	int index;
 	u32 temp_register = 0xFFFFFFFF;
-	u32 retval, rc = 0;
+	u32 rc = 0;
 	struct pci_func *new_func = NULL;
 	struct slot *p_slot;
 	struct resource_lists res_lists;
@@ -1086,8 +1114,10 @@ static u32 board_added(struct pci_func * func, struct controller * ctrl)
 
 	/* Power on slot */
 	rc = p_slot->hpc_ops->power_on_slot(p_slot);
-	if (rc)
+	if (rc) {
+		up(&ctrl->crit_sect);
 		return -1;
+	}
 
 	/* Wait for the command to complete */
 	wait_for_ctrl_irq (ctrl);
@@ -1105,11 +1135,12 @@ static u32 board_added(struct pci_func * func, struct controller * ctrl)
 	wait_for_ctrl_irq (ctrl);
 	dbg("%s: afterlong_delay\n", __FUNCTION__);
 
-	/*  Make this to check for link training status */
+	/*  Check link training status */
 	rc = p_slot->hpc_ops->check_lnk_status(ctrl);  
 	if (rc) {
 		err("%s: Failed to check link status\n", __FUNCTION__);
-		return -1;
+		set_slot_off(ctrl, p_slot);
+		return rc;
 	}
 
 	dbg("%s: func status = %x\n", __FUNCTION__, func->status);
@@ -1159,36 +1190,7 @@ static u32 board_added(struct pci_func * func, struct controller * ctrl)
 		pciehp_resource_sort_and_combine(&(ctrl->bus_head));
 
 		if (rc) {
-			/* Wait for exclusive access to hardware */
-			down(&ctrl->crit_sect);
-
-			/* turn off slot, turn on Amber LED, turn off Green LED */
-			retval = p_slot->hpc_ops->power_off_slot(p_slot);   
-			/* In PCI Express, just power off slot */
-			if (retval) {
-				err("%s: Issue of Slot Power Off command failed\n", __FUNCTION__);
-				return retval;
-			}
-			/* Wait for the command to complete */
-			wait_for_ctrl_irq (ctrl);
-
-			p_slot->hpc_ops->green_led_off(p_slot);   
-			
-			/* Wait for the command to complete */
-			wait_for_ctrl_irq (ctrl);
-
-			/* turn on Amber LED */
-			retval = p_slot->hpc_ops->set_attention_status(p_slot, 1);   
-			if (retval) {
-				err("%s: Issue of Set Attention Led command failed\n", __FUNCTION__);
-				return retval;
-			}
-			/* Wait for the command to complete */
-			wait_for_ctrl_irq (ctrl);
-
-			/* Done with exclusive hardware access */
-			up(&ctrl->crit_sect);
-
+			set_slot_off(ctrl, p_slot);
 			return rc;
 		}
 		pciehp_save_slot_config(ctrl, func);
@@ -1223,37 +1225,8 @@ static u32 board_added(struct pci_func * func, struct controller * ctrl)
 		up(&ctrl->crit_sect);
 
 	} else {
-		/* Wait for exclusive access to hardware */
-		down(&ctrl->crit_sect);
-
-		/* turn off slot, turn on Amber LED, turn off Green LED */
-		retval = p_slot->hpc_ops->power_off_slot(p_slot);   
-		/* In PCI Express, just power off slot */
-		if (retval) {
-			err("%s: Issue of Slot Power Off command failed\n", __FUNCTION__);
-			return retval;
-		}
-		/* Wait for the command to complete */
-		wait_for_ctrl_irq (ctrl);
-
-		p_slot->hpc_ops->green_led_off(p_slot);   
-		
-		/* Wait for the command to complete */
-		wait_for_ctrl_irq (ctrl);
-
-		/* turn on Amber LED */
-		retval = p_slot->hpc_ops->set_attention_status(p_slot, 1);   
-		if (retval) {
-			err("%s: Issue of Set Attention Led command failed\n", __FUNCTION__);
-			return retval;
-		}
-		/* Wait for the command to complete */
-		wait_for_ctrl_irq (ctrl);
-
-		/* Done with exclusive hardware access */
-		up(&ctrl->crit_sect);
-
-		return rc;
+		set_slot_off(ctrl, p_slot);
+		return -1;
 	}
 	return 0;
 }
@@ -1320,6 +1293,7 @@ static u32 remove_board(struct pci_func *func, struct controller *ctrl)
 	rc = p_slot->hpc_ops->power_off_slot(p_slot);
 	if (rc) {
 		err("%s: Issue of Slot Disable command failed\n", __FUNCTION__);
+		up(&ctrl->crit_sect);
 		return rc;
 	}
 	/* Wait for the command to complete */
@@ -1406,7 +1380,6 @@ static void pciehp_pushbutton_thread(unsigned long slot)
 {
 	struct slot *p_slot = (struct slot *) slot;
 	u8 getstatus;
-	int rc;
 	
 	pushbutton_pending = 0;
 
@@ -1420,23 +1393,7 @@ static void pciehp_pushbutton_thread(unsigned long slot)
 		p_slot->state = POWEROFF_STATE;
 		dbg("In power_down_board, b:d(%x:%x)\n", p_slot->bus, p_slot->device);
 
-		if (pciehp_disable_slot(p_slot)) {
-			/* Wait for exclusive access to hardware */
-			down(&p_slot->ctrl->crit_sect);
-
-			/* Turn on the Attention LED */
-			rc = p_slot->hpc_ops->set_attention_status(p_slot, 1);
-			if (rc) {
-				err("%s: Issue of Set Atten Indicator On command failed\n", __FUNCTION__);
-				return;
-			}
-	
-			/* Wait for the command to complete */
-			wait_for_ctrl_irq (p_slot->ctrl);
-
-			/* Done with exclusive hardware access */
-			up(&p_slot->ctrl->crit_sect);
-		}
+		pciehp_disable_slot(p_slot);
 		p_slot->state = STATIC_STATE;
 	} else {
 		p_slot->state = POWERON_STATE;
@@ -1446,15 +1403,6 @@ static void pciehp_pushbutton_thread(unsigned long slot)
 			/* Wait for exclusive access to hardware */
 			down(&p_slot->ctrl->crit_sect);
 
-			/* Turn off the green LED */
-			rc = p_slot->hpc_ops->set_attention_status(p_slot, 1);
-			if (rc) {
-				err("%s: Issue of Set Atten Indicator On command failed\n", __FUNCTION__);
-				return;
-			}
-			/* Wait for the command to complete */
-			wait_for_ctrl_irq (p_slot->ctrl);
-			
 			p_slot->hpc_ops->green_led_off(p_slot);
 
 			/* Wait for the command to complete */
@@ -1506,7 +1454,7 @@ int pciehp_event_start_thread(void)
 	event_finished=0;
 
 	init_MUTEX_LOCKED(&event_semaphore);
-	pid = kernel_thread(event_thread, 0, 0);
+	pid = kernel_thread(event_thread, NULL, 0);
 
 	if (pid < 0) {
 		err ("Can't start up our event thread\n");
@@ -1664,7 +1612,10 @@ static void interrupt_event_handler(struct controller *ctrl)
 					down(&ctrl->crit_sect);
 
 					p_slot->hpc_ops->set_attention_status(p_slot, 1);
+					wait_for_ctrl_irq (ctrl);
+						
 					p_slot->hpc_ops->green_led_off(p_slot);
+					wait_for_ctrl_irq (ctrl);
 
 					/* Done with exclusive hardware access */
 					up(&ctrl->crit_sect);
@@ -1701,21 +1652,21 @@ int pciehp_enable_slot(struct slot *p_slot)
 	if (rc || !getstatus) {
 		info("%s: no adapter on slot(%x)\n", __FUNCTION__, p_slot->number);
 		up(&p_slot->ctrl->crit_sect);
-		return 0;
+		return 1;
 	}
 	
 	rc = p_slot->hpc_ops->get_latch_status(p_slot, &getstatus);
 	if (rc || getstatus) {
 		info("%s: latch open on slot(%x)\n", __FUNCTION__, p_slot->number);
 		up(&p_slot->ctrl->crit_sect);
-		return 0;
+		return 1;
 	}
 	
 	rc = p_slot->hpc_ops->get_power_status(p_slot, &getstatus);
 	if (rc || getstatus) {
 		info("%s: already enabled on slot(%x)\n", __FUNCTION__, p_slot->number);
 		up(&p_slot->ctrl->crit_sect);
-		return 0;
+		return 1;
 	}
 	up(&p_slot->ctrl->crit_sect);
 
@@ -1788,21 +1739,21 @@ int pciehp_disable_slot(struct slot *p_slot)
 	if (ret || !getstatus) {
 		info("%s: no adapter on slot(%x)\n", __FUNCTION__, p_slot->number);
 		up(&p_slot->ctrl->crit_sect);
-		return 0;
+		return 1;
 	}
 
 	ret = p_slot->hpc_ops->get_latch_status(p_slot, &getstatus);
 	if (ret || getstatus) {
 		info("%s: latch open on slot(%x)\n", __FUNCTION__, p_slot->number);
 		up(&p_slot->ctrl->crit_sect);
-		return 0;
+		return 1;
 	}
 
 	ret = p_slot->hpc_ops->get_power_status(p_slot, &getstatus);
 	if (ret || !getstatus) {
 		info("%s: already disabled slot(%x)\n", __FUNCTION__, p_slot->number);
 		up(&p_slot->ctrl->crit_sect);
-		return 0;
+		return 1;
 	}
 	up(&p_slot->ctrl->crit_sect);
 
diff --git a/drivers/pci/hotplug/pciehp_hpc.c b/drivers/pci/hotplug/pciehp_hpc.c
index 2a68ace53..cb0804b2d 100644
--- a/drivers/pci/hotplug/pciehp_hpc.c
+++ b/drivers/pci/hotplug/pciehp_hpc.c
@@ -237,8 +237,8 @@ struct php_ctlr_state_s {
 static spinlock_t hpc_event_lock;
 
 DEFINE_DBG_BUFFER		/* Debug string buffer for entire HPC defined here */
-static struct php_ctlr_state_s *php_ctlr_list_head = 0;	/* HPC state linked list */
-static int ctlr_seq_num = 0;	/* Controller sequence # */
+static struct php_ctlr_state_s *php_ctlr_list_head;	/* HPC state linked list */
+static int ctlr_seq_num;	/* Controller sequence # */
 static spinlock_t list_lock;
 
 static irqreturn_t pcie_isr(int IRQ, void *dev_id, struct pt_regs *regs);
@@ -349,7 +349,9 @@ static int hpc_check_lnk_status(struct controller *ctrl)
 		return retval;
 	}
 
-	if ( (lnk_status & (LNK_TRN | LNK_TRN_ERR)) == 0x0C00) {
+	dbg("%s: lnk_status = %x\n", __FUNCTION__, lnk_status);
+	if ( (lnk_status & LNK_TRN) || (lnk_status & LNK_TRN_ERR) || 
+		!(lnk_status & NEG_LINK_WD)) {
 		err("%s : Link Training Error occurs \n", __FUNCTION__);
 		retval = -1;
 		return retval;
@@ -742,7 +744,7 @@ static void hpc_release_ctlr(struct controller *ctrl)
 		}
 	}
 	if (php_ctlr->pci_dev) 
-		php_ctlr->pci_dev = 0;
+		php_ctlr->pci_dev = NULL;
 
 	spin_lock(&list_lock);
 	p = php_ctlr_list_head;
@@ -1465,7 +1467,7 @@ int pcie_init(struct controller * ctrl,
 	if (php_ctlr_list_head == 0) {
 		php_ctlr_list_head = php_ctlr;
 		p = php_ctlr_list_head;
-		p->pnext = 0;
+		p->pnext = NULL;
 	} else {
 		p = php_ctlr_list_head;
 
diff --git a/drivers/pci/hotplug/pciehprm_acpi.c b/drivers/pci/hotplug/pciehprm_acpi.c
index ff19a806f..b127575ec 100644
--- a/drivers/pci/hotplug/pciehprm_acpi.c
+++ b/drivers/pci/hotplug/pciehprm_acpi.c
@@ -218,6 +218,10 @@ static void acpi_get__hpp ( struct acpi_bridge	*ab)
 	}
 
 	ab->_hpp = kmalloc (sizeof (struct acpi__hpp), GFP_KERNEL);
+	if (!ab->_hpp) {
+		err ("acpi_pciehprm:%s alloc for _HPP failed\n", path_name);
+		goto free_and_return;
+	}
 	memset(ab->_hpp, 0, sizeof(struct acpi__hpp));
 
 	ab->_hpp->cache_line_size	= nui[0];
@@ -1393,7 +1397,7 @@ static int configure_existing_function(
 
 static int bind_pci_resources_to_slots ( struct controller *ctrl)
 {
-	struct pci_func *func;
+	struct pci_func *func, new_func;
 	int busn = ctrl->slot_bus;
 	int devn, funn;
 	u32	vid;
@@ -1411,11 +1415,19 @@ static int bind_pci_resources_to_slots ( struct controller *ctrl)
 			if (vid != 0xFFFFFFFF) {
 				dbg("%s: vid = %x\n", __FUNCTION__, vid);
 				func = pciehp_slot_find(busn, devn, funn);
-				if (!func)
-					continue;
-				configure_existing_function(ctrl, func);
+				if (!func) {
+					memset(&new_func, 0, sizeof(struct pci_func));
+					new_func.bus = busn;
+					new_func.device = devn;
+					new_func.function = funn;
+					new_func.is_a_board = 1;
+					configure_existing_function(ctrl, &new_func);
+					pciehprm_dump_func_res(&new_func);
+				} else {
+					configure_existing_function(ctrl, func);
+					pciehprm_dump_func_res(func);
+				}
 				dbg("aCCF:existing PCI 0x%x Func ResourceDump\n", ctrl->bus);
-				pciehprm_dump_func_res(func);
 			}
 		}
 	}
diff --git a/drivers/pci/hotplug/pciehprm_nonacpi.c b/drivers/pci/hotplug/pciehprm_nonacpi.c
index 3ace44220..79a0aa623 100644
--- a/drivers/pci/hotplug/pciehprm_nonacpi.c
+++ b/drivers/pci/hotplug/pciehprm_nonacpi.c
@@ -276,7 +276,7 @@ static int pciehprm_delete_resource(
 
 static int bind_pci_resources_to_slots ( struct controller *ctrl)
 {
-	struct pci_func *func;
+	struct pci_func *func, new_func;
 	int busn = ctrl->slot_bus;
 	int devn, funn;
 	u32	vid;
@@ -297,11 +297,19 @@ static int bind_pci_resources_to_slots ( struct controller *ctrl)
 				vid, busn, devn, funn);
 				func = pciehp_slot_find(busn, devn, funn);
 				dbg("%s: func = %p\n", __FUNCTION__,func);
-				if (!func)
-					continue;
-				configure_existing_function(ctrl, func);
+				if (!func) {
+					memset(&new_func, 0, sizeof(struct pci_func));
+					new_func.bus = busn;
+					new_func.device = devn;
+					new_func.function = funn;
+					new_func.is_a_board = 1;
+					configure_existing_function(ctrl, &new_func);
+					phprm_dump_func_res(&new_func);
+				} else {
+					configure_existing_function(ctrl, func);
+					phprm_dump_func_res(func);
+				}
 				dbg("aCCF:existing PCI 0x%x Func ResourceDump\n", ctrl->bus);
-				phprm_dump_func_res(func);
 			}
 		}
 	}
diff --git a/drivers/pci/hotplug/rpadlpar_core.c b/drivers/pci/hotplug/rpadlpar_core.c
index b321b47cf..ed4b23c3c 100644
--- a/drivers/pci/hotplug/rpadlpar_core.c
+++ b/drivers/pci/hotplug/rpadlpar_core.c
@@ -18,31 +18,13 @@
 #include <linux/pci.h>
 #include <asm/pci-bridge.h>
 #include <asm/semaphore.h>
+#include <asm/rtas.h>
 #include "../pci.h"
 #include "rpaphp.h"
 #include "rpadlpar.h"
 
 static DECLARE_MUTEX(rpadlpar_sem);
 
-static inline int is_hotplug_capable(struct device_node *dn)
-{
-	unsigned char *ptr = get_property(dn, "ibm,fw-pci-hot-plug-ctrl", NULL);
-
-	return (int) (ptr != NULL);
-}
-
-static char *get_node_drc_name(struct device_node *dn)
-{
-	char *ptr = NULL;
-	int *drc_names;
-
-	drc_names = (int *) get_property(dn, "ibm,drc-names", NULL);
-	if (drc_names)
-		ptr = (char *) &drc_names[1];
-
-	return ptr;
-}
-
 static struct device_node *find_php_slot_vio_node(char *drc_name)
 {
 	struct device_node *child;
@@ -53,9 +35,9 @@ static struct device_node *find_php_slot_vio_node(char *drc_name)
 		return NULL;
 
 	for (child = of_get_next_child(parent, NULL);
-	     child; child = of_get_next_child(parent, child)) {
+		child; child = of_get_next_child(parent, child)) {
 		loc_code = get_property(child, "ibm,loc-code", NULL);
-		if (loc_code && !strcmp(loc_code, drc_name))
+		if (loc_code && !strncmp(loc_code, drc_name, strlen(drc_name)))
 			return child;
 	}
 
@@ -69,7 +51,7 @@ static struct device_node *find_php_slot_pci_node(char *drc_name)
 
 	while ((np = of_find_node_by_type(np, "pci")))
 		if (is_hotplug_capable(np)) {
-			name = get_node_drc_name(np);
+			name = rpaphp_get_drc_name(np);
 			if (name && (!strcmp(drc_name, name)))
 				break;
 		}
@@ -324,6 +306,7 @@ int dlpar_remove_pci_slot(struct slot *slot, char *drc_name)
 	}
 
 	/* Remove pci bus */
+
 	if (dlpar_pci_remove_bus(bridge_dev)) {
 		printk(KERN_ERR "%s: unable to remove pci bus %s\n",
 			__FUNCTION__, drc_name);
@@ -364,7 +347,7 @@ int dlpar_remove_slot(char *drc_name)
 		rc = -EINVAL;
 		goto exit;
 	}
-
+	
 	switch (slot->dev_type) {
 		case PCI_DEV:
 			rc = dlpar_remove_pci_slot(slot, drc_name);
diff --git a/drivers/pci/hotplug/rpaphp.h b/drivers/pci/hotplug/rpaphp.h
index 3c860e156..e155c4c97 100644
--- a/drivers/pci/hotplug/rpaphp.h
+++ b/drivers/pci/hotplug/rpaphp.h
@@ -30,6 +30,9 @@
 #include <linux/pci.h>
 #include "pci_hotplug.h"
 
+#define	HOTPLUG	1
+#define	EMBEDDED 0
+
 #define DR_INDICATOR 9002
 #define DR_ENTITY_SENSE 9003
 
@@ -73,34 +76,45 @@ extern int debug;
 #define	CONFIGURED	1
 #define	EMPTY		0
 
+struct rpaphp_pci_func {
+	struct pci_dev *pci_dev;
+	struct list_head sibling;
+};
+
 /*
  * struct slot - slot information for each *physical* slot
  */
 struct slot {
+	struct list_head rpaphp_slot_list;
 	int state;
 	u32 index;
 	u32 type;
 	u32 power_domain;
 	char *name;
 	char *location;
+	u8 removable;
+	u8 dev_type;		/* VIO or PCI */
 	struct device_node *dn;	/* slot's device_node in OFDT */
-	/* dn has phb info */
+				/* dn has phb info */
 	struct pci_dev *bridge;	/* slot's pci_dev in pci_devices */
 	union {
-		struct pci_dev *pci_dev;	/* pci_dev of device in this slot */
-		/* it will be used for unconfig */
-		/* NULL if slot is empty */
-		struct vio_dev *vio_dev;	/* vio_dev of the device in this slot */
+		struct list_head pci_funcs; /* pci_devs in PCI slot */ 
+		struct vio_dev *vio_dev; /* vio_dev in VIO slot */
 	} dev;
-	u8 dev_type;		/* VIO or PCI */
 	struct hotplug_slot *hotplug_slot;
-	struct list_head rpaphp_slot_list;
 };
 
 extern struct hotplug_slot_ops rpaphp_hotplug_slot_ops;
 extern struct list_head rpaphp_slot_head;
 extern int num_slots;
 
+static inline int is_hotplug_capable(struct device_node *dn)
+{
+	unsigned char *ptr = get_property(dn, "ibm,fw-pci-hot-plug-ctrl", NULL);
+
+	return (int) (ptr != NULL);
+}
+
 /* function prototypes */
 
 /* rpaphp_pci.c */
@@ -110,10 +124,12 @@ extern int rpaphp_enable_pci_slot(struct slot *slot);
 extern int register_pci_slot(struct slot *slot);
 extern int rpaphp_unconfig_pci_adapter(struct slot *slot);
 extern int rpaphp_get_pci_adapter_status(struct slot *slot, int is_init, u8 * value);
+extern struct hotplug_slot *rpaphp_find_hotplug_slot(struct pci_dev *dev);
 
 /* rpaphp_core.c */
 extern int rpaphp_add_slot(struct device_node *dn);
 extern int rpaphp_remove_slot(struct slot *slot);
+extern char *rpaphp_get_drc_name(struct device_node *dn);
 
 /* rpaphp_vio.c */
 extern int rpaphp_get_vio_adapter_status(struct slot *slot, int is_init, u8 * value);
@@ -125,8 +141,8 @@ extern int rpaphp_enable_vio_slot(struct slot *slot);
 extern void dealloc_slot_struct(struct slot *slot);
 extern struct slot *alloc_slot_struct(struct device_node *dn, int drc_index, char *drc_name, int power_domain);
 extern int register_slot(struct slot *slot);
+extern int deregister_slot(struct slot *slot);
 extern int rpaphp_get_power_status(struct slot *slot, u8 * value);
 extern int rpaphp_set_attention_status(struct slot *slot, u8 status);
-extern void rpaphp_sysfs_remove_attr_location(struct hotplug_slot *slot);
 	
 #endif				/* _PPC64PHP_H */
diff --git a/drivers/pci/hotplug/rpaphp_core.c b/drivers/pci/hotplug/rpaphp_core.c
index 157205428..dd6dcdc73 100644
--- a/drivers/pci/hotplug/rpaphp_core.c
+++ b/drivers/pci/hotplug/rpaphp_core.c
@@ -54,6 +54,8 @@ MODULE_AUTHOR(DRIVER_AUTHOR);
 MODULE_DESCRIPTION(DRIVER_DESC);
 MODULE_LICENSE("GPL");
 
+void eeh_register_disable_func(int (*)(struct pci_dev *));
+
 module_param(debug, bool, 0644);
 
 static int enable_slot(struct hotplug_slot *slot);
@@ -63,6 +65,7 @@ static int get_power_status(struct hotplug_slot *slot, u8 * value);
 static int get_attention_status(struct hotplug_slot *slot, u8 * value);
 static int get_adapter_status(struct hotplug_slot *slot, u8 * value);
 static int get_max_bus_speed(struct hotplug_slot *hotplug_slot, enum pci_bus_speed *value);
+static int rpaphp_disable_slot(struct pci_dev *dev);
 
 struct hotplug_slot_ops rpaphp_hotplug_slot_ops = {
 	.owner = THIS_MODULE,
@@ -89,7 +92,7 @@ static int rpaphp_get_attention_status(struct slot *slot)
  */
 static int set_attention_status(struct hotplug_slot *hotplug_slot, u8 value)
 {
-	int retval;
+	int retval = 0;
 	struct slot *slot = (struct slot *)hotplug_slot->private;
 
 	down(&rpaphp_sem);
@@ -208,47 +211,53 @@ static int get_max_bus_speed(struct hotplug_slot *hotplug_slot, enum pci_bus_spe
 
 int rpaphp_remove_slot(struct slot *slot)
 {
-	int retval = 0;
-	struct hotplug_slot *php_slot = slot->hotplug_slot;
-
-	list_del(&slot->rpaphp_slot_list);
-	
-	/* remove "php_location" file */
-	rpaphp_sysfs_remove_attr_location(php_slot);
-
-	retval = pci_hp_deregister(php_slot);
-	if (retval)
-		err("Problem unregistering a slot %s\n", slot->name);
-
-	num_slots--;
-
-	dbg("%s - Exit: rc[%d]\n", __FUNCTION__, retval);
-	return retval;
+	return deregister_slot(slot);
 }
 
-static int is_php_dn(struct device_node *dn, int **indexes, int **names, int **types,
-	  int **power_domains)
+static int get_dn_properties(struct device_node *dn, int **indexes, int **names, 
+	int **types, int **power_domains)
 {
 	*indexes = (int *) get_property(dn, "ibm,drc-indexes", NULL);
-	if (!*indexes)
-		return 0;
+
 	/* &names[1] contains NULL terminated slot names */
 	*names = (int *) get_property(dn, "ibm,drc-names", NULL);
-	if (!*names)
-		return 0;
+
 	/* &types[1] contains NULL terminated slot types */
 	*types = (int *) get_property(dn, "ibm,drc-types", NULL);
-	if (!*types)
-		return 0;
+
 	/* power_domains[1...n] are the slot power domains */
-	*power_domains = (int *) get_property(dn,
-					      "ibm,drc-power-domains", NULL);
-	if (!*power_domains)
-		return 0;
-	if (strcmp(dn->name, "pci") == 0 &&
-			!get_property(dn, "ibm,fw-pci-hot-plug-ctrl", NULL))
-		return 0;
-	return 1;
+	*power_domains = (int *) get_property(dn, "ibm,drc-power-domains", NULL);
+	
+	if (*indexes && *names && *types && *power_domains) 
+		return (1);
+	
+	return (0);
+}
+
+static int is_php_dn(struct device_node *dn, int **indexes, int **names, int **types,
+	  int **power_domains)
+{
+	if (!is_hotplug_capable(dn))
+		return (0);
+	if (!get_dn_properties(dn, indexes, names, types, power_domains))
+		return (0);
+	return (1);
+}
+
+static int is_dr_dn(struct device_node *dn, int **indexes, int **names, int **types,
+	  int **power_domains, int **my_drc_index)
+{
+	if (!is_hotplug_capable(dn))
+		return (0);
+
+	*my_drc_index = (int *) get_property(dn, "ibm,my-drc-index", NULL);
+	if(!*my_drc_index) 		
+		return (0);
+
+	if (!dn->parent)
+		return (0);
+
+	return get_dn_properties(dn->parent, indexes, names, types, power_domains);
 }
 
 static inline int is_vdevice_root(struct device_node *dn)
@@ -256,15 +265,48 @@ static inline int is_vdevice_root(struct device_node *dn)
 	return !strcmp(dn->name, "vdevice");
 }
 
-/**
- * rpaphp_add_slot: Add  Hot Plug slot(s) to sysfs
- *
- */
+char *rpaphp_get_drc_name(struct device_node *dn)
+{
+	char *name, *ptr = NULL;
+	int *drc_names, *drc_indexes, i;
+	struct device_node *parent = dn->parent;	
+	u32 *my_drc_index;
+
+	if (!parent)
+		return NULL;
+
+	my_drc_index = (u32 *) get_property(dn, "ibm,my-drc-index", NULL);
+	if (!my_drc_index)
+		return NULL;	
+
+	drc_names = (int *) get_property(parent, "ibm,drc-names", NULL);
+	drc_indexes = (int *) get_property(parent, "ibm,drc-indexes", NULL);
+	if (!drc_names || !drc_indexes)
+		return NULL;
+
+	name = (char *) &drc_names[1];
+	for (i = 0; i < drc_indexes[0]; i++, name += (strlen(name) + 1)) {
+		if (drc_indexes[i + 1] == *my_drc_index) {
+			ptr = (char *) name;
+			break;
+		}
+	}
+
+	return ptr;
+}
+
+/****************************************************************
+ *	rpaphp not only registers PCI hotplug slots(HOTPLUG), 
+ *	but also logical DR slots(EMBEDDED).
+ *	HOTPLUG slot: An adapter can be physically added/removed. 
+ *	EMBEDDED slot: An adapter can be logically removed/added
+ *		  from/to a partition with the slot.
+ ***************************************************************/
 int rpaphp_add_slot(struct device_node *dn)
 {
 	struct slot *slot;
 	int retval = 0;
-	int i;
+	int i, *my_drc_index, slot_type;
 	int *indexes, *names, *types, *power_domains;
 	char *name, *type;
 
@@ -277,42 +319,65 @@ int rpaphp_add_slot(struct device_node *dn)
 	}
 
 	/* register PCI devices */
-	if (dn->name != 0 && strcmp(dn->name, "pci") == 0 &&
-	    is_php_dn(dn, &indexes, &names, &types, &power_domains)) {
+	if (dn->name != 0 && strcmp(dn->name, "pci") == 0) {
+		if (is_php_dn(dn, &indexes, &names, &types, &power_domains))  
+			slot_type = HOTPLUG;
+		else if (is_dr_dn(dn, &indexes, &names, &types, &power_domains, &my_drc_index)) 
+			slot_type = EMBEDDED;
+		else goto exit;
 
 		name = (char *) &names[1];
 		type = (char *) &types[1];
-		for (i = 0; i < indexes[0];
-					i++,
-					name += (strlen(name) + 1),
-					type += (strlen(type) + 1)) {
-			if (!(slot = alloc_slot_struct(dn, indexes[i + 1], name,
-						       power_domains[i + 1]))) {
-				retval = -ENOMEM;
-				goto exit;
+		for (i = 0; i < indexes[0]; i++,
+	     		name += (strlen(name) + 1), type += (strlen(type) + 1)) {
+
+			if ( slot_type == HOTPLUG || 
+				(slot_type == EMBEDDED && indexes[i + 1] == my_drc_index[0])) {
+				
+				if (!(slot = alloc_slot_struct(dn, indexes[i + 1], name,
+					       power_domains[i + 1]))) {
+					retval = -ENOMEM;
+					goto exit;
+				}
+				if (slot_type == EMBEDDED)
+					slot->type = EMBEDDED;
+				else
+					slot->type = simple_strtoul(type, NULL, 10);
+				
+				dbg("    Found drc-index:0x%x drc-name:%s drc-type:%s\n",
+					indexes[i + 1], name, type);
+
+				retval = register_pci_slot(slot);
+				if (slot_type == EMBEDDED)
+					goto exit;
 			}
-			slot->type = simple_strtoul(type, NULL, 10);
-			if (slot->type < 1 || slot->type > 16)
-				slot->type = 0;
-			retval = register_pci_slot(slot);
-
-		}		/* for indexes */
-	}			/* end of PCI device_node */
+		}
+	}
 exit:
 	dbg("%s - Exit: num_slots=%d rc[%d]\n",
 	    __FUNCTION__, num_slots, retval);
 	return retval;
 }
 
-static int __init init_rpa(void)
+/*
+ * init_slots - initialize 'struct slot' structures for each slot
+ *
+ */
+static void init_slots(void)
 {
 	struct device_node *dn;
 
+	for (dn = find_all_nodes(); dn; dn = dn->next)
+		rpaphp_add_slot(dn);
+}
+
+static int __init init_rpa(void)
+{
+
 	init_MUTEX(&rpaphp_sem);
 
 	/* initialize internal data structure etc. */
-	for (dn = find_all_nodes(); dn; dn = dn->next)
-		rpaphp_add_slot(dn);
+	init_slots();
 	if (!num_slots)
 		return -ENODEV;
 
@@ -342,12 +407,18 @@ static int __init rpaphp_init(void)
 {
 	info(DRIVER_DESC " version: " DRIVER_VERSION "\n");
 
+	/* let EEH know they can use hotplug */
+	eeh_register_disable_func(&rpaphp_disable_slot);
+
 	/* read all the PRA info from the system */
 	return init_rpa();
 }
 
 static void __exit rpaphp_exit(void)
 {
+	/* let EEH know we are going away */
+	eeh_register_disable_func(NULL);
+
 	cleanup_slots();
 }
 
@@ -374,11 +445,16 @@ static int enable_slot(struct hotplug_slot *hotplug_slot)
 		retval = -EINVAL;
 	}
 	up(&rpaphp_sem);
-      exit:
+exit:
 	dbg("%s - Exit: rc[%d]\n", __FUNCTION__, retval);
 	return retval;
 }
 
+static int rpaphp_disable_slot(struct pci_dev *dev)
+{
+	return disable_slot(rpaphp_find_hotplug_slot(dev));
+}
+
 static int disable_slot(struct hotplug_slot *hotplug_slot)
 {
 	int retval;
@@ -395,9 +471,7 @@ static int disable_slot(struct hotplug_slot *hotplug_slot)
 	down(&rpaphp_sem);
 	switch (slot->dev_type) {
 	case PCI_DEV:
-		rpaphp_set_attention_status(slot, LED_ID);
 		retval = rpaphp_unconfig_pci_adapter(slot);
-		rpaphp_set_attention_status(slot, LED_OFF);
 		break;
 	case VIO_DEV:
 		retval = rpaphp_unconfig_vio_adapter(slot);
@@ -406,7 +480,7 @@ static int disable_slot(struct hotplug_slot *hotplug_slot)
 		retval = -ENODEV;
 	}
 	up(&rpaphp_sem);
-      exit:
+exit:
 	dbg("%s - Exit: rc[%d]\n", __FUNCTION__, retval);
 	return retval;
 }
@@ -417,3 +491,4 @@ module_exit(rpaphp_exit);
 EXPORT_SYMBOL_GPL(rpaphp_add_slot);
 EXPORT_SYMBOL_GPL(rpaphp_remove_slot);
 EXPORT_SYMBOL_GPL(rpaphp_slot_head);
+EXPORT_SYMBOL_GPL(rpaphp_get_drc_name);
diff --git a/drivers/pci/hotplug/rpaphp_pci.c b/drivers/pci/hotplug/rpaphp_pci.c
index 6f5b61b7c..0dd2d2369 100644
--- a/drivers/pci/hotplug/rpaphp_pci.c
+++ b/drivers/pci/hotplug/rpaphp_pci.c
@@ -24,30 +24,25 @@
  */
 #include <linux/pci.h>
 #include <asm/pci-bridge.h>
+#include <asm/rtas.h>
 #include "../pci.h"		/* for pci_add_new_bus */
 
 #include "rpaphp.h"
 
 struct pci_dev *rpaphp_find_pci_dev(struct device_node *dn)
 {
-	struct pci_dev *retval_dev = NULL, *dev;
+	struct pci_dev *retval_dev = NULL, *dev = NULL;
 	char bus_id[BUS_ID_SIZE];
 
 	sprintf(bus_id, "%04x:%02x:%02x.%d",dn->phb->global_number,
 		dn->busno, PCI_SLOT(dn->devfn), PCI_FUNC(dn->devfn));
-
-	dbg("Enter rpaphp_find_pci_dev() full_name=%s bus_id=%s\n", 
-		dn->full_name, bus_id);
-	
 	while ((dev = pci_find_device(PCI_ANY_ID, PCI_ANY_ID, dev)) != NULL) {
-               if (!strcmp(pci_name(dev), bus_id)) {
+		if (!strcmp(pci_name(dev), bus_id)) {
 			retval_dev = dev;
-			dbg("rpaphp_find_pci_dev(): found dev=%p\n\n", dev);
 			break;
 		}
 	}
 	return retval_dev;
-
 }
 
 EXPORT_SYMBOL_GPL(rpaphp_find_pci_dev);
@@ -79,11 +74,6 @@ static struct pci_dev *rpaphp_find_bridge_pdev(struct slot *slot)
 	return rpaphp_find_pci_dev(slot->dn);
 }
 
-static struct pci_dev *rpaphp_find_adapter_pdev(struct slot *slot)
-{
-	return rpaphp_find_pci_dev(slot->dn->child);
-}
-
 static int rpaphp_get_sensor_state(struct slot *slot, int *state)
 {
 	int rc;
@@ -144,7 +134,8 @@ int rpaphp_get_pci_adapter_status(struct slot *slot, int is_init, u8 * value)
 			else if (rpaphp_find_pci_dev(slot->dn->child))
 				*value = CONFIGURED;
 			else {
-				dbg("%s: can't find pdev of adapter in slot[%s]\n", __FUNCTION__, slot->name);
+				err("%s: can't find pdev of adapter in slot[%s]\n", 
+					__FUNCTION__, slot->dn->full_name);
 				*value = NOT_CONFIGURED;
 			}
 		}
@@ -158,7 +149,8 @@ exit:
 }
 
 /* Must be called before pci_bus_add_devices */
-static void rpaphp_fixup_new_pci_devices(struct pci_bus *bus)
+static void 
+rpaphp_fixup_new_pci_devices(struct pci_bus *bus, int fix_bus)
 {
 	struct pci_dev *dev;
 
@@ -169,8 +161,9 @@ static void rpaphp_fixup_new_pci_devices(struct pci_bus *bus)
 		 */
 		if (list_empty(&dev->global_list)) {
 			int i;
-
-			pcibios_fixup_device_resources(dev, bus);
+			
+			if(fix_bus)
+				pcibios_fixup_device_resources(dev, bus);
 			pci_read_irq_line(dev);
 			for (i = 0; i < PCI_NUM_RESOURCES; i++) {
 				struct resource *r = &dev->resource[i];
@@ -183,69 +176,139 @@ static void rpaphp_fixup_new_pci_devices(struct pci_bus *bus)
 	}
 }
 
-static void
-rpaphp_pci_config_device(struct pci_bus *pci_bus, struct device_node *dn)
-{
-	int num;
-
-	num = pci_scan_slot(pci_bus, PCI_DEVFN(PCI_SLOT(dn->devfn), 0));
-	if (num) {
-		rpaphp_fixup_new_pci_devices(pci_bus);
-		pci_bus_add_devices(pci_bus);
-	}
-}
-
-static int rpaphp_pci_config_bridge(struct pci_dev *dev, struct device_node *dn);
+static int rpaphp_pci_config_bridge(struct pci_dev *dev);
 
 /*****************************************************************************
- rpaphp_pci_config_dn() will recursively configure all devices under the 
- given slot->dn and return the dn's pci_dev.
+ rpaphp_pci_config_slot() will  configure all devices under the 
+ given slot->dn and return the the first pci_dev.
  *****************************************************************************/
 static struct pci_dev *
-rpaphp_pci_config_dn(struct device_node *dn, struct pci_bus *bus)
+rpaphp_pci_config_slot(struct device_node *dn, struct pci_bus *bus)
 {
-	struct device_node *local;
+	struct device_node *eads_first_child = dn->child;
 	struct pci_dev *dev;
-
-	for (local = dn->child; local; local = local->sibling) {
-		rpaphp_pci_config_device(bus, local);
-		dev = rpaphp_find_pci_dev(local);
-		if (!rpaphp_pci_config_bridge(dev, local))
+	int num;
+	
+	dbg("Enter %s: dn=%s bus=%s\n", __FUNCTION__, dn->full_name, bus->name);
+
+	if (eads_first_child) {
+		/* pci_scan_slot should find all children of EADs */
+		num = pci_scan_slot(bus, PCI_DEVFN(PCI_SLOT(eads_first_child->devfn), 0));
+		if (num) {
+			rpaphp_fixup_new_pci_devices(bus, 1); 
+			pci_bus_add_devices(bus);
+		}
+		dev = rpaphp_find_pci_dev(eads_first_child);
+		if (!dev) {
+			err("No new device found\n");
 			return NULL;
+		}
+		if (dev->hdr_type == PCI_HEADER_TYPE_BRIDGE) 
+			rpaphp_pci_config_bridge(dev);
 	}
-
 	return dev;
 }
 
-static int rpaphp_pci_config_bridge(struct pci_dev *dev, struct device_node *dn)
+static int rpaphp_pci_config_bridge(struct pci_dev *dev)
+{
+	u8 sec_busno;
+	struct pci_bus *child_bus;
+	struct pci_dev *child_dev;
+
+	dbg("Enter %s:  BRIDGE dev=%s\n", __FUNCTION__, pci_name(dev));
+
+	/* get busno of downstream bus */
+	pci_read_config_byte(dev, PCI_SECONDARY_BUS, &sec_busno);
+		
+	/* add to children of PCI bridge dev->bus */
+	child_bus = pci_add_new_bus(dev->bus, dev, sec_busno);
+	if (!child_bus) {
+		err("%s: could not add second bus\n", __FUNCTION__);
+		return -EIO;
+	}
+	sprintf(child_bus->name, "PCI Bus #%02x", child_bus->number);
+	/* do pci_scan_child_bus */
+	pci_scan_child_bus(child_bus);
+
+	list_for_each_entry(child_dev, &child_bus->devices, bus_list) {
+		eeh_add_device_late(child_dev);
+	}
+
+	 /* fixup new pci devices without touching bus struct */
+	rpaphp_fixup_new_pci_devices(child_bus, 0);
+
+	/* Make the discovered devices available */
+	pci_bus_add_devices(child_bus);
+	return 0;
+}
+
+static void enable_eeh(struct device_node *dn)
+{
+	struct device_node *sib;
+
+	for (sib = dn->child; sib; sib = sib->sibling) 
+		enable_eeh(sib);
+	eeh_add_device_early(dn);
+	return;
+	
+}
+
+#ifdef DEBUG
+static void print_slot_pci_funcs(struct slot *slot)
 {
-	if (dev && dn->child) {	/* dn is a PCI bridge node */
-		struct pci_bus *child;
-		u8 sec_busno;
-
-		/* get busno of downstream bus */
-		pci_read_config_byte(dev, PCI_SECONDARY_BUS, &sec_busno);
-
-		/* add to children of PCI bridge dev->bus */
-		child = pci_add_new_bus(dev->bus, dev, sec_busno);
-		if (!child) {
-			err("%s: could not add second bus\n", __FUNCTION__);
-			return 0;
+	struct list_head *l;
+
+	if (slot->dev_type == PCI_DEV) {
+		printk("pci_funcs of slot[%s]\n", slot->name);
+		if (list_empty(&slot->dev.pci_funcs))
+			printk("	pci_funcs is EMPTY\n");
+
+		list_for_each (l, &slot->dev.pci_funcs) {
+			struct rpaphp_pci_func *func =
+				list_entry(l, struct rpaphp_pci_func, sibling);
+			printk("	FOUND dev=%s\n", pci_name(func->pci_dev));
 		}
-		sprintf(child->name, "PCI Bus #%02x", child->number);
-		/* Fixup subordinate bridge bases and resureces */
-		pcibios_fixup_bus(child);
+	}
+	return;
+}
+#else
+static void print_slot_pci_funcs(struct slot *slot)
+{
+	return;
+}
+#endif
 
-		/* may need do more stuff here */
-		rpaphp_pci_config_dn(dn, dev->subordinate);
+static int init_slot_pci_funcs(struct slot *slot)
+{
+	struct device_node *child;
+
+	for (child = slot->dn->child; child != NULL; child = child->sibling) {
+		struct pci_dev *pdev = rpaphp_find_pci_dev(child);
+
+		if (pdev) {
+			struct rpaphp_pci_func *func;
+			func = kmalloc(sizeof(struct rpaphp_pci_func), GFP_KERNEL);
+			if (!func) 
+				return -ENOMEM;
+			memset(func, 0, sizeof(struct rpaphp_pci_func));
+			INIT_LIST_HEAD(&func->sibling);
+			func->pci_dev = pdev;
+			list_add_tail(&func->sibling, &slot->dev.pci_funcs);
+			print_slot_pci_funcs(slot);
+		} else {
+			err("%s: dn=%s has no pci_dev\n", 
+				__FUNCTION__, child->full_name);
+			return -EIO;
+		}
 	}
-	return 1;
+	return 0;
 }
 
-static struct pci_dev *rpaphp_config_pci_adapter(struct slot *slot)
+static int rpaphp_config_pci_adapter(struct slot *slot)
 {
 	struct pci_bus *pci_bus;
-	struct pci_dev *dev = NULL;
+	struct pci_dev *dev;
+	int rc = -ENODEV;
 
 	dbg("Entry %s: slot[%s]\n", __FUNCTION__, slot->name);
 
@@ -256,38 +319,74 @@ static struct pci_dev *rpaphp_config_pci_adapter(struct slot *slot)
 			err("%s: can't find bus structure\n", __FUNCTION__);
 			goto exit;
 		}
-
-		eeh_add_device_early(slot->dn->child);
-		dev = rpaphp_pci_config_dn(slot->dn, pci_bus);
-		eeh_add_device_late(dev);
+		enable_eeh(slot->dn);
+		dev = rpaphp_pci_config_slot(slot->dn, pci_bus);
+		if (!dev) {
+			err("%s: can't find any devices.\n", __FUNCTION__);
+			goto exit;
+		}
+		/* associate corresponding pci_dev */	
+		rc = init_slot_pci_funcs(slot);
+		if (rc)
+			goto exit;
+		print_slot_pci_funcs(slot);
+		if (!list_empty(&slot->dev.pci_funcs)) 
+			rc = 0;
 	} else {
 		/* slot is not enabled */
 		err("slot doesn't have pci_dev structure\n");
-		dev = NULL;
 	}
-
 exit:
-	dbg("Exit %s: pci_dev %s\n", __FUNCTION__, dev ? "found" : "not found");
-	return dev;
+	dbg("Exit %s:  rc=%d\n", __FUNCTION__, rc);
+	return rc;
+}
+
+
+static void rpaphp_eeh_remove_bus_device(struct pci_dev *dev)
+{
+	eeh_remove_device(dev);
+	if (dev->hdr_type == PCI_HEADER_TYPE_BRIDGE) {
+		struct pci_bus *bus = dev->subordinate;
+		struct list_head *ln;
+		if (!bus)
+			return; 
+		for (ln = bus->devices.next; ln != &bus->devices; ln = ln->next) {
+			struct pci_dev *pdev = pci_dev_b(ln);
+			if (pdev)
+				rpaphp_eeh_remove_bus_device(pdev);
+		}
+
+	}
+	return;
 }
 
 int rpaphp_unconfig_pci_adapter(struct slot *slot)
 {
 	int retval = 0;
+	struct list_head *ln;
 
 	dbg("Entry %s: slot[%s]\n", __FUNCTION__, slot->name);
-	if (!slot->dev.pci_dev) {
-		info("%s: no card in slot[%s]\n", __FUNCTION__, slot->name);
+	if (list_empty(&slot->dev.pci_funcs)) {
+		err("%s: slot[%s] doesn't have any devices.\n", __FUNCTION__, 
+			slot->name);
 
 		retval = -EINVAL;
 		goto exit;
 	}
-	/* remove the device from the pci core */
-	eeh_remove_device(slot->dev.pci_dev);
-	pci_remove_bus_device(slot->dev.pci_dev);
-
+	/* remove the devices from the pci core */
+	list_for_each (ln, &slot->dev.pci_funcs) {
+		struct rpaphp_pci_func *func;
+	
+		func = list_entry(ln, struct rpaphp_pci_func, sibling);
+		if (func->pci_dev) {
+			pci_remove_bus_device(func->pci_dev); 
+			rpaphp_eeh_remove_bus_device(func->pci_dev);
+		}
+		kfree(func);
+	}
+	INIT_LIST_HEAD(&slot->dev.pci_funcs);
 	slot->state = NOT_CONFIGURED;
-	info("%s: adapter in slot[%s] unconfigured.\n", __FUNCTION__,
+	info("%s: devices in slot[%s] unconfigured.\n", __FUNCTION__,
 	     slot->name);
 exit:
 	dbg("Exit %s, rc=0x%x\n", __FUNCTION__, retval);
@@ -303,7 +402,7 @@ static int setup_pci_hotplug_slot_info(struct slot *slot)
 				      &slot->hotplug_slot->info->
 				      adapter_status);
 	if (slot->hotplug_slot->info->adapter_status == NOT_VALID) {
-		dbg("%s: NOT_VALID: skip dn->full_name=%s\n",
+		err("%s: NOT_VALID: skip dn->full_name=%s\n",
 		    __FUNCTION__, slot->dn->full_name);
 		return -1;
 	}
@@ -314,35 +413,41 @@ static int setup_pci_slot(struct slot *slot)
 {
 	slot->bridge = rpaphp_find_bridge_pdev(slot);
 	if (!slot->bridge) {	/* slot being added doesn't have pci_dev yet */
-		dbg("%s: no pci_dev for bridge dn %s\n", __FUNCTION__, slot->name);
-		dealloc_slot_struct(slot);
-		return 1;
+		err("%s: no pci_dev for bridge dn %s\n", __FUNCTION__, slot->name);
+		goto exit_rc;
 	}
-	
+	dbg("%s set slot->name to %s\n",  __FUNCTION__, pci_name(slot->bridge));
 	strcpy(slot->name, pci_name(slot->bridge));
+
 	/* find slot's pci_dev if it's not empty */
 	if (slot->hotplug_slot->info->adapter_status == EMPTY) {
 		slot->state = EMPTY;	/* slot is empty */
-		slot->dev.pci_dev = NULL;
 	} else {
 		/* slot is occupied */
 		if (!(slot->dn->child)) {
 			/* non-empty slot has to have child */
-			err("%s: slot[%s]'s device_node doesn't have child for adapter\n", __FUNCTION__, slot->name);
-			dealloc_slot_struct(slot);
-			return 1;
+			err("%s: slot[%s]'s device_node doesn't have child for adapter\n", 
+				__FUNCTION__, slot->name);
+			goto exit_rc;
 		}
-		slot->dev.pci_dev = rpaphp_find_adapter_pdev(slot);
-		if (slot->dev.pci_dev) {
+		if (init_slot_pci_funcs(slot)) {
+			err("%s: init_slot_pci_funcs failed\n", __FUNCTION__);
+			goto exit_rc;
+		}
+		print_slot_pci_funcs(slot);
+		if (!list_empty(&slot->dev.pci_funcs)) {
 			slot->state = CONFIGURED;
-		
+	
 		} else {
 			/* DLPAR add as opposed to 
-			 * boot time */
+		 	 * boot time */
 			slot->state = NOT_CONFIGURED;
 		}
 	}
 	return 0;
+exit_rc:
+	dealloc_slot_struct(slot);
+	return 1;
 }
 
 int register_pci_slot(struct slot *slot)
@@ -350,14 +455,17 @@ int register_pci_slot(struct slot *slot)
 	int rc = 1;
 
 	slot->dev_type = PCI_DEV;
+	if (slot->type == EMBEDDED)
+		slot->removable = EMBEDDED;
+	else
+		slot->removable = HOTPLUG;
+	INIT_LIST_HEAD(&slot->dev.pci_funcs);
 	if (setup_pci_hotplug_slot_info(slot))
 		goto exit_rc;
 	if (setup_pci_slot(slot))
 		goto exit_rc;
 	rc = register_slot(slot);
 exit_rc:
-	if (rc)
-		dealloc_slot_struct(slot);
 	return rc;
 }
 
@@ -371,12 +479,12 @@ int rpaphp_enable_pci_slot(struct slot *slot)
 	dbg("%s: sensor state[%d]\n", __FUNCTION__, state);
 	/* if slot is not empty, enable the adapter */
 	if (state == PRESENT) {
-		dbg("%s : slot[%s] is occupid.\n", __FUNCTION__, slot->name);
-		if ((slot->dev.pci_dev =
-		     rpaphp_config_pci_adapter(slot)) != NULL) {
+		dbg("%s : slot[%s] is occupied.\n", __FUNCTION__, slot->name);
+		retval = rpaphp_config_pci_adapter(slot);
+		if (!retval) {
 			slot->state = CONFIGURED;
-			dbg("%s: PCI adapter %s in slot[%s] has been configured\n", 
-				__FUNCTION__, pci_name(slot->dev.pci_dev), slot->name);
+			dbg("%s: PCI devices in slot[%s] has been configured\n", 
+				__FUNCTION__, slot->name);
 		} else {
 			slot->state = NOT_CONFIGURED;
 			dbg("%s: no pci_dev struct for adapter in slot[%s]\n",
@@ -392,10 +500,40 @@ int rpaphp_enable_pci_slot(struct slot *slot)
 		retval = -EINVAL;
 	}
 exit:
-	if (slot->state != NOT_VALID)
-		rpaphp_set_attention_status(slot, LED_ON);
-	else
-		rpaphp_set_attention_status(slot, LED_ID);
 	dbg("%s - Exit: rc[%d]\n", __FUNCTION__, retval);
 	return retval;
 }
+
+struct hotplug_slot *rpaphp_find_hotplug_slot(struct pci_dev *dev)
+{
+	struct list_head	*tmp, *n;
+	struct slot		*slot;
+
+	list_for_each_safe(tmp, n, &rpaphp_slot_head) {
+		struct pci_bus *bus;
+		struct list_head *ln;
+
+		slot = list_entry(tmp, struct slot, rpaphp_slot_list);
+		if (slot->bridge == NULL) {
+			if (slot->dev_type == PCI_DEV) {
+				printk(KERN_WARNING "PCI slot missing bridge %s %s \n", 
+				                    slot->name, slot->location);
+			}
+			continue;
+		}
+
+		bus = slot->bridge->subordinate;
+		if (!bus) {
+			continue;  /* should never happen? */
+		}
+		for (ln = bus->devices.next; ln != &bus->devices; ln = ln->next) {
+                                struct pci_dev *pdev = pci_dev_b(ln);
+				if (pdev == dev)
+					return slot->hotplug_slot;
+		}
+	}
+
+	return NULL;
+}
+
+EXPORT_SYMBOL_GPL(rpaphp_find_hotplug_slot);
diff --git a/drivers/pci/hotplug/rpaphp_slot.c b/drivers/pci/hotplug/rpaphp_slot.c
index 0e952c86f..c58541add 100644
--- a/drivers/pci/hotplug/rpaphp_slot.c
+++ b/drivers/pci/hotplug/rpaphp_slot.c
@@ -27,8 +27,38 @@
 #include <linux/kobject.h>
 #include <linux/sysfs.h>
 #include <linux/pci.h>
+#include <asm/rtas.h>
 #include "rpaphp.h"
 
+static ssize_t removable_read_file (struct hotplug_slot *php_slot, char *buf)
+{
+	u8 value;
+	int retval = -ENOENT;
+	struct slot *slot = (struct slot *)php_slot->private;
+
+	if (!slot)
+		return retval;
+
+	value = slot->removable;
+	retval = sprintf (buf, "%d\n", value);
+	return retval;
+}
+
+static struct hotplug_slot_attribute hotplug_slot_attr_removable = {
+	.attr = {.name = "phy_removable", .mode = S_IFREG | S_IRUGO},
+	.show = removable_read_file,
+};
+
+static void rpaphp_sysfs_add_attr_removable (struct hotplug_slot *slot)
+{
+	sysfs_create_file(&slot->kobj, &hotplug_slot_attr_removable.attr);
+}
+
+static void rpaphp_sysfs_remove_attr_removable (struct hotplug_slot *slot)
+{
+	sysfs_remove_file(&slot->kobj, &hotplug_slot_attr_removable.attr);
+}
+
 static ssize_t location_read_file (struct hotplug_slot *php_slot, char *buf)
 {
         char *value;
@@ -53,7 +83,7 @@ static void rpaphp_sysfs_add_attr_location (struct hotplug_slot *slot)
 	sysfs_create_file(&slot->kobj, &hotplug_slot_attr_location.attr);
 }
 
-void rpaphp_sysfs_remove_attr_location (struct hotplug_slot *slot)
+static void rpaphp_sysfs_remove_attr_location (struct hotplug_slot *slot)
 {
 	sysfs_remove_file(&slot->kobj, &hotplug_slot_attr_location.attr);
 }
@@ -68,6 +98,17 @@ static void rpaphp_release_slot(struct hotplug_slot *hotplug_slot)
 
 void dealloc_slot_struct(struct slot *slot)
 {
+	struct list_head *ln, *n;
+
+	if (slot->dev_type == PCI_DEV) {
+		list_for_each_safe (ln, n, &slot->dev.pci_funcs) {
+			struct rpaphp_pci_func *func;
+
+			func = list_entry(ln, struct rpaphp_pci_func, sibling);
+			kfree(func);
+		}
+	}
+
 	kfree(slot->hotplug_slot->info);
 	kfree(slot->hotplug_slot->name);
 	kfree(slot->hotplug_slot);
@@ -86,7 +127,7 @@ struct slot *alloc_slot_struct(struct device_node *dn, int drc_index, char *drc_
 	memset(slot, 0, sizeof (struct slot));
 	slot->hotplug_slot = kmalloc(sizeof (struct hotplug_slot), GFP_KERNEL);
 	if (!slot->hotplug_slot)
-		goto error_slot;
+		goto error_slot;	
 	memset(slot->hotplug_slot, 0, sizeof (struct hotplug_slot));
 	slot->hotplug_slot->info = kmalloc(sizeof (struct hotplug_slot_info),
 					   GFP_KERNEL);
@@ -95,7 +136,7 @@ struct slot *alloc_slot_struct(struct device_node *dn, int drc_index, char *drc_
 	memset(slot->hotplug_slot->info, 0, sizeof (struct hotplug_slot_info));
 	slot->hotplug_slot->name = kmalloc(BUS_ID_SIZE + 1, GFP_KERNEL);
 	if (!slot->hotplug_slot->name)
-		goto error_info;
+		goto error_info;	
 	slot->location = kmalloc(strlen(drc_name) + 1, GFP_KERNEL);
 	if (!slot->location)
 		goto error_name;
@@ -107,9 +148,8 @@ struct slot *alloc_slot_struct(struct device_node *dn, int drc_index, char *drc_
 	slot->hotplug_slot->private = slot;
 	slot->hotplug_slot->ops = &rpaphp_hotplug_slot_ops;
 	slot->hotplug_slot->release = &rpaphp_release_slot;
-	slot->hotplug_slot->info->cur_bus_speed = PCI_SPEED_UNKNOWN;
-
-	return slot;
+	
+	return (slot);
 
 error_name:
 	kfree(slot->hotplug_slot->name);
@@ -123,15 +163,56 @@ error_nomem:
 	return NULL;
 }
 
+static int is_registered(struct slot *slot)
+{
+	struct slot             *tmp_slot;
+
+	list_for_each_entry(tmp_slot, &rpaphp_slot_head, rpaphp_slot_list) {
+		if (!strcmp(tmp_slot->name, slot->name))
+			return 1;
+	}	
+	return 0;
+}
+
+int deregister_slot(struct slot *slot)
+{
+	int retval = 0;
+	struct hotplug_slot *php_slot = slot->hotplug_slot;
+
+	 dbg("%s - Entry: deregistering slot=%s\n",
+		__FUNCTION__, slot->name);
+
+	list_del(&slot->rpaphp_slot_list);
+	
+	/* remove "phy_location" file */
+	rpaphp_sysfs_remove_attr_location(php_slot);
+
+	/* remove "phy_removable" file */
+	rpaphp_sysfs_remove_attr_removable(php_slot);
+
+	retval = pci_hp_deregister(php_slot);
+	if (retval)
+		err("Problem unregistering a slot %s\n", slot->name);
+	else
+		num_slots--;
+
+	dbg("%s - Exit: rc[%d]\n", __FUNCTION__, retval);
+	return retval;
+}
+
 int register_slot(struct slot *slot)
 {
 	int retval;
-	char *vio_uni_addr = NULL;
 
-	dbg("%s registering slot:path[%s] index[%x], name[%s] pdomain[%x] type[%d]\n",
-		__FUNCTION__, slot->dn->full_name, slot->index, slot->name,
+	dbg("%s registering slot:path[%s] index[%x], name[%s] pdomain[%x] type[%d]\n", 
+		__FUNCTION__, slot->dn->full_name, slot->index, slot->name, 
 		slot->power_domain, slot->type);
-
+	/* should not try to register the same slot twice */
+	if (is_registered(slot)) { /* should't be here */
+		err("register_slot: slot[%s] is already registered\n", slot->name);
+		rpaphp_release_slot(slot->hotplug_slot);
+		return 1;
+	}	
 	retval = pci_hp_register(slot->hotplug_slot);
 	if (retval) {
 		err("pci_hp_register failed with error %d\n", retval);
@@ -142,30 +223,40 @@ int register_slot(struct slot *slot)
 	/* create "phy_locatoin" file */
 	rpaphp_sysfs_add_attr_location(slot->hotplug_slot);	
 
+	/* create "phy_removable" file */
+	rpaphp_sysfs_add_attr_removable(slot->hotplug_slot);	
+
 	/* add slot to our internal list */
 	dbg("%s adding slot[%s] to rpaphp_slot_list\n",
 	    __FUNCTION__, slot->name);
 
 	list_add(&slot->rpaphp_slot_list, &rpaphp_slot_head);
 
-	if (vio_uni_addr)
-		info("Slot [%s](vio_uni_addr=%s) registered\n",
-		     slot->name, vio_uni_addr);
+	if (slot->dev_type == VIO_DEV)
+		info("Slot [%s](VIO location=%s) registered\n",
+		     slot->name, slot->location);
 	else
-		info("Slot [%s](bus_id=%s) registered\n",
-		     slot->name, pci_name(slot->bridge));
+		info("Slot [%s](PCI location=%s) registered\n",
+		     slot->name, slot->location);
 	num_slots++;
 	return 0;
 }
 
 int rpaphp_get_power_status(struct slot *slot, u8 * value)
 {
-	int rc;
-
-	rc = rtas_get_power_level(slot->power_domain, (int *) value);
-	if (rc)
-		err("failed to get power-level for slot(%s), rc=0x%x\n",
-		    slot->name, rc);
+	int rc = 0;
+	
+	if (slot->type == EMBEDDED) {
+		dbg("%s set to POWER_ON for EMBEDDED slot %s\n",
+			__FUNCTION__, slot->location);
+		*value = POWER_ON;
+	}
+	else {
+		rc = rtas_get_power_level(slot->power_domain, (int *) value);
+		if (rc)
+			err("failed to get power-level for slot(%s), rc=0x%x\n",
+		    		slot->location, rc);
+	}
 
 	return rc;
 }
@@ -177,8 +268,8 @@ int rpaphp_set_attention_status(struct slot *slot, u8 status)
 	/* status: LED_OFF or LED_ON */
 	rc = rtas_set_indicator(DR_INDICATOR, slot->index, status);
 	if (rc)
-		err("slot(%s) set attention-status(%d) failed! rc=0x%x\n",
-		    slot->name, status, rc);
+		err("slot(name=%s location=%s index=0x%x) set attention-status(%d) failed! rc=0x%x\n",
+		    slot->name, slot->location, slot->index, status, rc);
 
 	return rc;
 }
diff --git a/drivers/pci/hotplug/rpaphp_vio.c b/drivers/pci/hotplug/rpaphp_vio.c
index 29d7ca6ba..d82b6649e 100644
--- a/drivers/pci/hotplug/rpaphp_vio.c
+++ b/drivers/pci/hotplug/rpaphp_vio.c
@@ -74,20 +74,27 @@ int register_vio_slot(struct device_node *dn)
 	int rc = 1;
 	struct slot *slot = NULL;
 	
+	name = rpaphp_get_drc_name(dn);
+	if (!name)
+		goto exit_rc;
 	index = (u32 *) get_property(dn, "ibm,my-drc-index", NULL);
 	if (!index)
 		goto exit_rc;
-	name = get_property(dn, "ibm,loc-code", NULL);
-	if (!name)
-		goto exit_rc;
 	if (!(slot = alloc_slot_struct(dn, *index, name, 0))) {
 		rc = -ENOMEM;
 		goto exit_rc;
 	}
 	slot->dev_type = VIO_DEV;
 	slot->dev.vio_dev = vio_find_node(dn);
-	if (!slot->dev.vio_dev)
-		slot->dev.vio_dev = vio_register_device(dn);
+	if (slot->dev.vio_dev) {
+		/*
+		 * rpaphp is the only owner of vio devices and
+		 * does not need extra reference taken by
+		 * vio_find_node
+		 */
+		put_device(&slot->dev.vio_dev->dev);
+	} else
+		slot->dev.vio_dev = vio_register_device_node(dn);
 	if (slot->dev.vio_dev)
 		slot->state = CONFIGURED;
 	else
@@ -108,7 +115,7 @@ int rpaphp_enable_vio_slot(struct slot *slot)
 {
 	int retval = 0;
 
-	if ((slot->dev.vio_dev = vio_register_device(slot->dn))) {
+	if ((slot->dev.vio_dev = vio_register_device_node(slot->dn))) {
 		info("%s: VIO adapter %s in slot[%s] has been configured\n",
 			__FUNCTION__, slot->dn->name, slot->name);
 		slot->state = CONFIGURED;
diff --git a/drivers/pci/hotplug/shpchp.h b/drivers/pci/hotplug/shpchp.h
index bc890dec0..c68b22efb 100644
--- a/drivers/pci/hotplug/shpchp.h
+++ b/drivers/pci/hotplug/shpchp.h
@@ -61,6 +61,7 @@ struct pci_func {
 	u8 configured;
 	u8 switch_save;
 	u8 presence_save;
+	u8 pwr_save;
 	u32 base_length[0x06];
 	u8 base_type[0x06];
 	u16 reserved2;
diff --git a/drivers/pci/hotplug/shpchp_ctrl.c b/drivers/pci/hotplug/shpchp_ctrl.c
index e92c1e067..7ca8e9369 100644
--- a/drivers/pci/hotplug/shpchp_ctrl.c
+++ b/drivers/pci/hotplug/shpchp_ctrl.c
@@ -137,6 +137,8 @@ u8 shpchp_handle_switch_change(u8 hp_slot, void *inst_id)
 	p_slot = shpchp_find_slot(ctrl, hp_slot + ctrl->slot_device_offset);
 	p_slot->hpc_ops->get_adapter_status(p_slot, &(func->presence_save));
 	p_slot->hpc_ops->get_latch_status(p_slot, &getstatus);
+	dbg("%s: Card present %x Power status %x\n", __FUNCTION__,
+		func->presence_save, func->pwr_save);
 
 	if (getstatus) {
 		/*
@@ -145,6 +147,10 @@ u8 shpchp_handle_switch_change(u8 hp_slot, void *inst_id)
 		info("Latch open on Slot(%d)\n", ctrl->first_slot + hp_slot);
 		func->switch_save = 0;
 		taskInfo->event_type = INT_SWITCH_OPEN;
+		if (func->pwr_save && func->presence_save) {
+			taskInfo->event_type = INT_POWER_FAULT;
+			err("Surprise Removal of card\n");
+		}
 	} else {
 		/*
 		 *  Switch closed
@@ -1427,6 +1433,7 @@ static u32 board_added(struct pci_func * func, struct controller * ctrl)
 					rc = p_slot->hpc_ops->set_bus_speed_mode(p_slot, adapter_speed);
 					if (rc) {
 						err("%s: Issue of set bus speed mode command failed\n", __FUNCTION__);
+						up(&ctrl->crit_sect);
 						return WRONG_BUS_FREQUENCY;
 					}
 				
@@ -1438,6 +1445,7 @@ static u32 board_added(struct pci_func * func, struct controller * ctrl)
 						err("%s: Can't set bus speed/mode in the case of adapter & bus mismatch\n",
 								  __FUNCTION__);
 						err("%s: Error code (%d)\n", __FUNCTION__, rc);
+						up(&ctrl->crit_sect);
 						return WRONG_BUS_FREQUENCY;
 					}
 					/* Done with exclusive hardware access */
@@ -1589,8 +1597,9 @@ static u32 board_added(struct pci_func * func, struct controller * ctrl)
 		func->status = 0;
 		func->switch_save = 0x10;
 		func->is_a_board = 0x01;
+		func->pwr_save = 1;
 
-		/* next, we will instantiate the linux pci_dev structures 
+		/* Next, we will instantiate the linux pci_dev structures 
 		 * (with appropriate driver notification, if already present) 
 		 */
 		index = 0;
@@ -1781,6 +1790,7 @@ static u32 remove_board(struct pci_func *func, struct controller *ctrl)
 		func->function = 0;
 		func->configured = 0;
 		func->switch_save = 0x10;
+		func->pwr_save = 0;
 		func->is_a_board = 0;
 	}
 
@@ -1807,7 +1817,6 @@ static void shpchp_pushbutton_thread (unsigned long slot)
 {
 	struct slot *p_slot = (struct slot *) slot;
 	u8 getstatus;
-	int rc;
 	
 	pushbutton_pending = 0;
 
@@ -1821,23 +1830,7 @@ static void shpchp_pushbutton_thread (unsigned long slot)
 		p_slot->state = POWEROFF_STATE;
 		dbg("In power_down_board, b:d(%x:%x)\n", p_slot->bus, p_slot->device);
 
-		if (shpchp_disable_slot(p_slot)) {
-			/* Wait for exclusive access to hardware */
-			down(&p_slot->ctrl->crit_sect);
-
-			/* Turn on the Attention LED */
-			rc = p_slot->hpc_ops->set_attention_status(p_slot, 1);
-			if (rc) {
-				err("%s: Issue of Set Atten Indicator On command failed\n", __FUNCTION__);
-				return;
-			}
-	
-			/* Wait for the command to complete */
-			wait_for_ctrl_irq (p_slot->ctrl);
-
-			/* Done with exclusive hardware access */
-			up(&p_slot->ctrl->crit_sect);
-		}
+		shpchp_disable_slot(p_slot);
 		p_slot->state = STATIC_STATE;
 	} else {
 		p_slot->state = POWERON_STATE;
@@ -1847,15 +1840,6 @@ static void shpchp_pushbutton_thread (unsigned long slot)
 			/* Wait for exclusive access to hardware */
 			down(&p_slot->ctrl->crit_sect);
 
-			/* Turn off the green LED */
-			rc = p_slot->hpc_ops->set_attention_status(p_slot, 1);
-			if (rc) {
-				err("%s: Issue of Set Atten Indicator On command failed\n", __FUNCTION__);
-				return;
-			}
-			/* Wait for the command to complete */
-			wait_for_ctrl_irq (p_slot->ctrl);
-			
 			p_slot->hpc_ops->green_led_off(p_slot);
 
 			/* Wait for the command to complete */
@@ -1906,7 +1890,7 @@ int shpchp_event_start_thread (void)
 	event_finished=0;
 
 	init_MUTEX_LOCKED(&event_semaphore);
-	pid = kernel_thread(event_thread, 0, 0);
+	pid = kernel_thread(event_thread, NULL, 0);
 
 	if (pid < 0) {
 		err ("Can't start up our event thread\n");
@@ -2096,7 +2080,7 @@ int shpchp_enable_slot (struct slot *p_slot)
 	func = shpchp_slot_find(p_slot->bus, p_slot->device, 0);
 	if (!func) {
 		dbg("%s: Error! slot NULL\n", __FUNCTION__);
-		return (1);
+		return 1;
 	}
 
 	/* Check to see if (latch closed, card present, power off) */
@@ -2105,19 +2089,19 @@ int shpchp_enable_slot (struct slot *p_slot)
 	if (rc || !getstatus) {
 		info("%s: no adapter on slot(%x)\n", __FUNCTION__, p_slot->number);
 		up(&p_slot->ctrl->crit_sect);
-		return (0);
+		return 1;
 	}
 	rc = p_slot->hpc_ops->get_latch_status(p_slot, &getstatus);
 	if (rc || getstatus) {
 		info("%s: latch open on slot(%x)\n", __FUNCTION__, p_slot->number);
 		up(&p_slot->ctrl->crit_sect);
-		return (0);
+		return 1;
 	}
 	rc = p_slot->hpc_ops->get_power_status(p_slot, &getstatus);
 	if (rc || getstatus) {
 		info("%s: already enabled on slot(%x)\n", __FUNCTION__, p_slot->number);
 		up(&p_slot->ctrl->crit_sect);
-		return (0);
+		return 1;
 	}
 	up(&p_slot->ctrl->crit_sect);
 
@@ -2125,7 +2109,7 @@ int shpchp_enable_slot (struct slot *p_slot)
 
 	func = shpchp_slot_create(p_slot->bus);
 	if (func == NULL)
-		return (1);
+		return 1;
 
 	func->bus = p_slot->bus;
 	func->device = p_slot->device;
@@ -2135,6 +2119,8 @@ int shpchp_enable_slot (struct slot *p_slot)
 
 	/* We have to save the presence info for these slots */
 	p_slot->hpc_ops->get_adapter_status(p_slot, &(func->presence_save));
+	p_slot->hpc_ops->get_power_status(p_slot, &(func->pwr_save));
+	dbg("%s: func->pwr_save %x\n", __FUNCTION__, func->pwr_save);
 	p_slot->hpc_ops->get_latch_status(p_slot, &getstatus);
 	func->switch_save = !getstatus? 0x10:0;
 
@@ -2181,7 +2167,7 @@ int shpchp_disable_slot (struct slot *p_slot)
 	struct pci_func *func;
 
 	if (!p_slot->ctrl)
-		return (1);
+		return 1;
 
 	/* Check to see if (latch closed, card present, power on) */
 	down(&p_slot->ctrl->crit_sect);
@@ -2190,19 +2176,19 @@ int shpchp_disable_slot (struct slot *p_slot)
 	if (ret || !getstatus) {
 		info("%s: no adapter on slot(%x)\n", __FUNCTION__, p_slot->number);
 		up(&p_slot->ctrl->crit_sect);
-		return (0);
+		return 1;
 	}
 	ret = p_slot->hpc_ops->get_latch_status(p_slot, &getstatus);
 	if (ret || getstatus) {
 		info("%s: latch open on slot(%x)\n", __FUNCTION__, p_slot->number);
 		up(&p_slot->ctrl->crit_sect);
-		return (0);
+		return 1;
 	}
 	ret = p_slot->hpc_ops->get_power_status(p_slot, &getstatus);
 	if (ret || !getstatus) {
 		info("%s: already disabled slot(%x)\n", __FUNCTION__, p_slot->number);
 		up(&p_slot->ctrl->crit_sect);
-		return (0);
+		return 1;
 	}
 	up(&p_slot->ctrl->crit_sect);
 
diff --git a/drivers/pci/hotplug/shpchp_hpc.c b/drivers/pci/hotplug/shpchp_hpc.c
index 60331cc95..b1fab4532 100644
--- a/drivers/pci/hotplug/shpchp_hpc.c
+++ b/drivers/pci/hotplug/shpchp_hpc.c
@@ -228,7 +228,7 @@
 static spinlock_t hpc_event_lock;
 
 DEFINE_DBG_BUFFER		/* Debug string buffer for entire HPC defined here */
-static struct php_ctlr_state_s *php_ctlr_list_head = 0;	/* HPC state linked list */
+static struct php_ctlr_state_s *php_ctlr_list_head;	/* HPC state linked list */
 static int ctlr_seq_num = 0;	/* Controller sequenc # */
 static spinlock_t list_lock;
 
@@ -799,7 +799,7 @@ static void hpc_release_ctlr(struct controller *ctrl)
 		iounmap(php_ctlr->creg);
 		release_mem_region(pci_resource_start(php_ctlr->pci_dev, 0), pci_resource_len(php_ctlr->pci_dev, 0));
 		dbg("%s: before calling iounmap & release_mem_region\n", __FUNCTION__);
-		php_ctlr->pci_dev = 0;
+		php_ctlr->pci_dev = NULL;
 	}
 
 	spin_lock(&list_lock);
@@ -1572,7 +1572,7 @@ int shpc_init(struct controller * ctrl,
 	if (php_ctlr_list_head == 0) {
 		php_ctlr_list_head = php_ctlr;
 		p = php_ctlr_list_head;
-		p->pnext = 0;
+		p->pnext = NULL;
 	} else {
 		p = php_ctlr_list_head;
 
diff --git a/drivers/pci/hotplug/shpchp_pci.c b/drivers/pci/hotplug/shpchp_pci.c
index 2c9b23f46..90113e9cd 100644
--- a/drivers/pci/hotplug/shpchp_pci.c
+++ b/drivers/pci/hotplug/shpchp_pci.c
@@ -263,6 +263,7 @@ int shpchp_save_config(struct controller *ctrl, int busnumber, int num_ctlr_slot
 				new_slot->function = (u8) function;
 				new_slot->is_a_board = 1;
 				new_slot->switch_save = 0x10;
+				new_slot->pwr_save = 1;
 				/* In case of unsupported board */
 				new_slot->status = DevError;
 				new_slot->pci_dev = pci_find_slot(new_slot->bus,
diff --git a/drivers/pci/hotplug/shpchprm_acpi.c b/drivers/pci/hotplug/shpchprm_acpi.c
index 8b70c0ccf..6ea1703c2 100644
--- a/drivers/pci/hotplug/shpchprm_acpi.c
+++ b/drivers/pci/hotplug/shpchprm_acpi.c
@@ -218,6 +218,10 @@ static void acpi_get__hpp ( struct acpi_bridge	*ab)
 	}
 
 	ab->_hpp = kmalloc (sizeof (struct acpi__hpp), GFP_KERNEL);
+	if (!ab->_hpp) {
+		err ("acpi_shpchprm:%s alloc for _HPP failed\n", path_name);
+		goto free_and_return;
+	}
 	memset(ab->_hpp, 0, sizeof(struct acpi__hpp));
 
 	ab->_hpp->cache_line_size	= nui[0];
@@ -1391,7 +1395,7 @@ static int configure_existing_function(
 
 static int bind_pci_resources_to_slots ( struct controller *ctrl)
 {
-	struct pci_func *func;
+	struct pci_func *func, new_func;
 	int busn = ctrl->bus;
 	int devn, funn;
 	u32	vid;
@@ -1406,11 +1410,19 @@ static int bind_pci_resources_to_slots ( struct controller *ctrl)
 
 			if (vid != 0xFFFFFFFF) {
 				func = shpchp_slot_find(busn, devn, funn);
-				if (!func)
-					continue;
-				configure_existing_function(ctrl, func);
+				if (!func) {
+					memset(&new_func, 0, sizeof(struct pci_func));
+					new_func.bus = busn;
+					new_func.device = devn;
+					new_func.function = funn;
+					new_func.is_a_board = 1;
+					configure_existing_function(ctrl, &new_func);
+					shpchprm_dump_func_res(&new_func);
+				} else {
+					configure_existing_function(ctrl, func);
+					shpchprm_dump_func_res(func);
+				}
 				dbg("aCCF:existing PCI 0x%x Func ResourceDump\n", ctrl->bus);
-				shpchprm_dump_func_res(func);
 			}
 		}
 	}
diff --git a/drivers/pci/hotplug/shpchprm_nonacpi.c b/drivers/pci/hotplug/shpchprm_nonacpi.c
index 673719e06..88f4d9f41 100644
--- a/drivers/pci/hotplug/shpchprm_nonacpi.c
+++ b/drivers/pci/hotplug/shpchprm_nonacpi.c
@@ -208,7 +208,7 @@ static int configure_existing_function(
 
 static int bind_pci_resources_to_slots ( struct controller *ctrl)
 {
-	struct pci_func *func;
+	struct pci_func *func, new_func;
 	int busn = ctrl->slot_bus;
 	int devn, funn;
 	u32	vid;
@@ -226,11 +226,19 @@ static int bind_pci_resources_to_slots ( struct controller *ctrl)
 
 			if (vid != 0xFFFFFFFF) {
 				func = shpchp_slot_find(busn, devn, funn);
-				if (!func)
-					continue;
-				configure_existing_function(ctrl, func);
+				if (!func) {
+					memset(&new_func, 0, sizeof(struct pci_func));
+					new_func.bus = busn;
+					new_func.device = devn;
+					new_func.function = funn;
+					new_func.is_a_board = 1;
+					configure_existing_function(ctrl, &new_func);
+					phprm_dump_func_res(&new_func);
+				} else {
+					configure_existing_function(ctrl, func);
+					phprm_dump_func_res(func);
+				}
 				dbg("aCCF:existing PCI 0x%x Func ResourceDump\n", ctrl->bus);
-				phprm_dump_func_res(func);
 			}
 		}
 	}
diff --git a/drivers/pci/msi.c b/drivers/pci/msi.c
index 132af770d..d4c89d73e 100644
--- a/drivers/pci/msi.c
+++ b/drivers/pci/msi.c
@@ -64,15 +64,13 @@ static void msi_set_mask_bit(unsigned int vector, int flag)
 	case PCI_CAP_ID_MSI:
 	{
 		int		pos;
-		unsigned int	mask_bits;
+		u32		mask_bits;
 
 		pos = entry->mask_base;
-	        entry->dev->bus->ops->read(entry->dev->bus, entry->dev->devfn,
-				pos, 4, &mask_bits);
+		pci_read_config_dword(entry->dev, pos, &mask_bits);
 		mask_bits &= ~(1);
 		mask_bits |= flag;
-	        entry->dev->bus->ops->write(entry->dev->bus, entry->dev->devfn,
-				pos, 4, mask_bits);
+		pci_write_config_dword(entry->dev, pos, mask_bits);
 		break;
 	}
 	case PCI_CAP_ID_MSIX:
@@ -105,15 +103,13 @@ static void set_msi_affinity(unsigned int vector, cpumask_t cpu_mask)
    		if (!(pos = pci_find_capability(entry->dev, PCI_CAP_ID_MSI)))
 			return;
 
-	        entry->dev->bus->ops->read(entry->dev->bus, entry->dev->devfn,
-			msi_lower_address_reg(pos), 4,
+		pci_read_config_dword(entry->dev, msi_lower_address_reg(pos),
 			&address.lo_address.value);
 		address.lo_address.value &= MSI_ADDRESS_DEST_ID_MASK;
 		address.lo_address.value |= (cpu_mask_to_apicid(cpu_mask) <<
 			MSI_TARGET_CPU_SHIFT);
 		entry->msi_attrib.current_cpu = cpu_mask_to_apicid(cpu_mask);
-		entry->dev->bus->ops->write(entry->dev->bus, entry->dev->devfn,
-			msi_lower_address_reg(pos), 4,
+		pci_write_config_dword(entry->dev, msi_lower_address_reg(pos),
 			address.lo_address.value);
 		break;
 	}
@@ -158,13 +154,25 @@ static void unmask_MSI_irq(unsigned int vector)
 
 static unsigned int startup_msi_irq_wo_maskbit(unsigned int vector)
 {
+	struct msi_desc *entry;
+	unsigned long flags;
+
+	spin_lock_irqsave(&msi_lock, flags);
+	entry = msi_desc[vector];
+	if (!entry || !entry->dev) {
+		spin_unlock_irqrestore(&msi_lock, flags);
+		return 0;
+	}
+	entry->msi_attrib.state = 1;	/* Mark it active */
+	spin_unlock_irqrestore(&msi_lock, flags);
+
 	return 0;	/* never anything pending */
 }
 
-static void pci_disable_msi(unsigned int vector);
+static void release_msi(unsigned int vector);
 static void shutdown_msi_irq(unsigned int vector)
 {
-	pci_disable_msi(vector);
+	release_msi(vector);
 }
 
 #define shutdown_msi_irq_wo_maskbit	shutdown_msi_irq
@@ -179,6 +187,18 @@ static void end_msi_irq_wo_maskbit(unsigned int vector)
 
 static unsigned int startup_msi_irq_w_maskbit(unsigned int vector)
 {
+	struct msi_desc *entry;
+	unsigned long flags;
+
+	spin_lock_irqsave(&msi_lock, flags);
+	entry = msi_desc[vector];
+	if (!entry || !entry->dev) {
+		spin_unlock_irqrestore(&msi_lock, flags);
+		return 0;
+	}
+	entry->msi_attrib.state = 1;	/* Mark it active */
+	spin_unlock_irqrestore(&msi_lock, flags);
+
 	unmask_MSI_irq(vector);
 	return 0;	/* never anything pending */
 }
@@ -200,7 +220,7 @@ static void end_msi_irq_w_maskbit(unsigned int vector)
  * which implement the MSI-X Capability Structure.
  */
 static struct hw_interrupt_type msix_irq_type = {
-	.typename	= "PCI MSI-X",
+	.typename	= "PCI-MSI-X",
 	.startup	= startup_msi_irq_w_maskbit,
 	.shutdown	= shutdown_msi_irq_w_maskbit,
 	.enable		= enable_msi_irq_w_maskbit,
@@ -216,7 +236,7 @@ static struct hw_interrupt_type msix_irq_type = {
  * Mask-and-Pending Bits.
  */
 static struct hw_interrupt_type msi_irq_w_maskbit_type = {
-	.typename	= "PCI MSI",
+	.typename	= "PCI-MSI",
 	.startup	= startup_msi_irq_w_maskbit,
 	.shutdown	= shutdown_msi_irq_w_maskbit,
 	.enable		= enable_msi_irq_w_maskbit,
@@ -232,7 +252,7 @@ static struct hw_interrupt_type msi_irq_w_maskbit_type = {
  * Mask-and-Pending Bits.
  */
 static struct hw_interrupt_type msi_irq_wo_maskbit_type = {
-	.typename	= "PCI MSI",
+	.typename	= "PCI-MSI",
 	.startup	= startup_msi_irq_wo_maskbit,
 	.shutdown	= shutdown_msi_irq_wo_maskbit,
 	.enable		= enable_msi_irq_wo_maskbit,
@@ -265,6 +285,7 @@ static void msi_address_init(struct msg_address *msi_address)
 	msi_address->lo_address.value |= (MSI_TARGET_CPU << MSI_TARGET_CPU_SHIFT);
 }
 
+static int msi_free_vector(struct pci_dev* dev, int vector, int reassign);
 static int assign_msi_vector(void)
 {
 	static int new_vector_avail = 1;
@@ -278,6 +299,8 @@ static int assign_msi_vector(void)
 	spin_lock_irqsave(&msi_lock, flags);
 
 	if (!new_vector_avail) {
+		int free_vector = 0;
+
 		/*
 	 	 * vector_irq[] = -1 indicates that this specific vector is:
 	 	 * - assigned for MSI (since MSI have no associated IRQ) or
@@ -294,13 +317,34 @@ static int assign_msi_vector(void)
 		for (vector = FIRST_DEVICE_VECTOR; vector < NR_IRQS; vector++) {
 			if (vector_irq[vector] != 0)
 				continue;
-			vector_irq[vector] = -1;
-			nr_released_vectors--;
+			free_vector = vector;
+			if (!msi_desc[vector])
+			      	break;
+			else
+				continue;
+		}
+		if (!free_vector) {
 			spin_unlock_irqrestore(&msi_lock, flags);
-			return vector;
+			return -EBUSY;
 		}
+		vector_irq[free_vector] = -1;
+		nr_released_vectors--;
 		spin_unlock_irqrestore(&msi_lock, flags);
-		return -EBUSY;
+		if (msi_desc[free_vector] != NULL) {
+			struct pci_dev *dev;
+			int tail;
+
+			/* free all linked vectors before re-assign */
+			do {
+				spin_lock_irqsave(&msi_lock, flags);
+				dev = msi_desc[free_vector]->dev;
+				tail = msi_desc[free_vector]->link.tail;
+				spin_unlock_irqrestore(&msi_lock, flags);
+				msi_free_vector(dev, tail, 1);
+			} while (free_vector != tail);
+		}
+
+		return free_vector;
 	}
 	vector = assign_irq_vector(AUTO_ASSIGN);
 	last_alloc_vector = vector;
@@ -333,6 +377,15 @@ static int msi_init(void)
 		printk(KERN_INFO "WARNING: MSI INIT FAILURE\n");
 		return status;
 	}
+	last_alloc_vector = assign_irq_vector(AUTO_ASSIGN);
+	if (last_alloc_vector < 0) {
+		pci_msi_enable = 0;
+		printk(KERN_INFO "WARNING: ALL VECTORS ARE BUSY\n");
+		status = -EBUSY;
+		return status;
+	}
+	vector_irq[last_alloc_vector] = 0;
+	nr_released_vectors++;
 	printk(KERN_INFO "MSI INIT SUCCESS\n");
 
 	return status;
@@ -383,55 +436,49 @@ static void irq_handler_init(int cap_id, int pos, int mask)
 
 static void enable_msi_mode(struct pci_dev *dev, int pos, int type)
 {
-	u32 control;
+	u16 control;
 
-	dev->bus->ops->read(dev->bus, dev->devfn,
-		msi_control_reg(pos), 2, &control);
+	pci_read_config_word(dev, msi_control_reg(pos), &control);
 	if (type == PCI_CAP_ID_MSI) {
 		/* Set enabled bits to single MSI & enable MSI_enable bit */
 		msi_enable(control, 1);
-	        dev->bus->ops->write(dev->bus, dev->devfn,
-			msi_control_reg(pos), 2, control);
+		pci_write_config_word(dev, msi_control_reg(pos), control);
 	} else {
 		msix_enable(control);
-	        dev->bus->ops->write(dev->bus, dev->devfn,
-			msi_control_reg(pos), 2, control);
+		pci_write_config_word(dev, msi_control_reg(pos), control);
 	}
     	if (pci_find_capability(dev, PCI_CAP_ID_EXP)) {
 		/* PCI Express Endpoint device detected */
-		u32 cmd;
-	        dev->bus->ops->read(dev->bus, dev->devfn, PCI_COMMAND, 2, &cmd);
+		u16 cmd;
+		pci_read_config_word(dev, PCI_COMMAND, &cmd);
 		cmd |= PCI_COMMAND_INTX_DISABLE;
-	        dev->bus->ops->write(dev->bus, dev->devfn, PCI_COMMAND, 2, cmd);
+		pci_write_config_word(dev, PCI_COMMAND, cmd);
 	}
 }
 
 static void disable_msi_mode(struct pci_dev *dev, int pos, int type)
 {
-	u32 control;
+	u16 control;
 
-	dev->bus->ops->read(dev->bus, dev->devfn,
-		msi_control_reg(pos), 2, &control);
+	pci_read_config_word(dev, msi_control_reg(pos), &control);
 	if (type == PCI_CAP_ID_MSI) {
 		/* Set enabled bits to single MSI & enable MSI_enable bit */
 		msi_disable(control);
-	        dev->bus->ops->write(dev->bus, dev->devfn,
-			msi_control_reg(pos), 2, control);
+		pci_write_config_word(dev, msi_control_reg(pos), control);
 	} else {
 		msix_disable(control);
-	        dev->bus->ops->write(dev->bus, dev->devfn,
-			msi_control_reg(pos), 2, control);
+		pci_write_config_word(dev, msi_control_reg(pos), control);
 	}
     	if (pci_find_capability(dev, PCI_CAP_ID_EXP)) {
 		/* PCI Express Endpoint device detected */
-		u32 cmd;
-	        dev->bus->ops->read(dev->bus, dev->devfn, PCI_COMMAND, 2, &cmd);
+		u16 cmd;
+		pci_read_config_word(dev, PCI_COMMAND, &cmd);
 		cmd &= ~PCI_COMMAND_INTX_DISABLE;
-	        dev->bus->ops->write(dev->bus, dev->devfn, PCI_COMMAND, 2, cmd);
+		pci_write_config_word(dev, PCI_COMMAND, cmd);
 	}
 }
 
-static int msi_lookup_vector(struct pci_dev *dev)
+static int msi_lookup_vector(struct pci_dev *dev, int type)
 {
 	int vector;
 	unsigned long flags;
@@ -439,11 +486,11 @@ static int msi_lookup_vector(struct pci_dev *dev)
 	spin_lock_irqsave(&msi_lock, flags);
 	for (vector = FIRST_DEVICE_VECTOR; vector < NR_IRQS; vector++) {
 		if (!msi_desc[vector] || msi_desc[vector]->dev != dev ||
-			msi_desc[vector]->msi_attrib.entry_nr ||
+			msi_desc[vector]->msi_attrib.type != type ||
 			msi_desc[vector]->msi_attrib.default_vector != dev->irq)
-			continue;	/* not entry 0, skip */
+			continue;
 		spin_unlock_irqrestore(&msi_lock, flags);
-		/* This pre-assigned entry-0 MSI vector for this device
+		/* This pre-assigned MSI vector for this device
 		   already exits. Override dev->irq with this vector */
 		dev->irq = vector;
 		return 0;
@@ -458,10 +505,9 @@ void pci_scan_msi_device(struct pci_dev *dev)
 	if (!dev)
 		return;
 
-   	if (pci_find_capability(dev, PCI_CAP_ID_MSIX) > 0) {
-		nr_reserved_vectors++;
+   	if (pci_find_capability(dev, PCI_CAP_ID_MSIX) > 0)
 		nr_msix_devices++;
-	} else if (pci_find_capability(dev, PCI_CAP_ID_MSI) > 0)
+	else if (pci_find_capability(dev, PCI_CAP_ID_MSI) > 0)
 		nr_reserved_vectors++;
 }
 
@@ -480,22 +526,10 @@ static int msi_capability_init(struct pci_dev *dev)
 	struct msg_address address;
 	struct msg_data data;
 	int pos, vector;
-	u32 control;
+	u16 control;
 
    	pos = pci_find_capability(dev, PCI_CAP_ID_MSI);
-	if (!pos)
-		return -EINVAL;
-
-	dev->bus->ops->read(dev->bus, dev->devfn, msi_control_reg(pos),
-		2, &control);
-	if (control & PCI_MSI_FLAGS_ENABLE)
-		return 0;
-
-	if (!msi_lookup_vector(dev)) {
-		/* Lookup Sucess */
-		enable_msi_mode(dev, pos, PCI_CAP_ID_MSI);
-		return 0;
-	}
+	pci_read_config_word(dev, msi_control_reg(pos), &control);
 	/* MSI Entry Initialization */
 	if (!(entry = alloc_msi_entry()))
 		return -ENOMEM;
@@ -504,11 +538,14 @@ static int msi_capability_init(struct pci_dev *dev)
 		kmem_cache_free(msi_cachep, entry);
 		return -EBUSY;
 	}
+	entry->link.head = vector;
+	entry->link.tail = vector;
 	entry->msi_attrib.type = PCI_CAP_ID_MSI;
+	entry->msi_attrib.state = 0;			/* Mark it not active */
 	entry->msi_attrib.entry_nr = 0;
 	entry->msi_attrib.maskbit = is_mask_bit_support(control);
-	entry->msi_attrib.default_vector = dev->irq;
-	dev->irq = vector;	/* save default pre-assigned ioapic vector */
+	entry->msi_attrib.default_vector = dev->irq;	/* Save IOAPIC IRQ */
+	dev->irq = vector;
 	entry->dev = dev;
 	if (is_mask_bit_support(control)) {
 		entry->mask_base = msi_mask_bits_reg(pos,
@@ -521,27 +558,27 @@ static int msi_capability_init(struct pci_dev *dev)
 	msi_data_init(&data, vector);
 	entry->msi_attrib.current_cpu = ((address.lo_address.u.dest_id >>
 				MSI_TARGET_CPU_SHIFT) & MSI_TARGET_CPU_MASK);
-	dev->bus->ops->write(dev->bus, dev->devfn, msi_lower_address_reg(pos),
-				4, address.lo_address.value);
+	pci_write_config_dword(dev, msi_lower_address_reg(pos),
+			address.lo_address.value);
 	if (is_64bit_address(control)) {
-		dev->bus->ops->write(dev->bus, dev->devfn,
-			msi_upper_address_reg(pos), 4, address.hi_address);
-		dev->bus->ops->write(dev->bus, dev->devfn,
-			msi_data_reg(pos, 1), 2, *((u32*)&data));
+		pci_write_config_dword(dev,
+			msi_upper_address_reg(pos), address.hi_address);
+		pci_write_config_word(dev,
+			msi_data_reg(pos, 1), *((u32*)&data));
 	} else
-		dev->bus->ops->write(dev->bus, dev->devfn,
-			msi_data_reg(pos, 0), 2, *((u32*)&data));
+		pci_write_config_word(dev,
+			msi_data_reg(pos, 0), *((u32*)&data));
 	if (entry->msi_attrib.maskbit) {
 		unsigned int maskbits, temp;
 		/* All MSIs are unmasked by default, Mask them all */
-	        dev->bus->ops->read(dev->bus, dev->devfn,
-			msi_mask_bits_reg(pos, is_64bit_address(control)), 4,
+		pci_read_config_dword(dev,
+			msi_mask_bits_reg(pos, is_64bit_address(control)),
 			&maskbits);
 		temp = (1 << multi_msi_capable(control));
 		temp = ((temp - 1) & ~temp);
 		maskbits |= temp;
-		dev->bus->ops->write(dev->bus, dev->devfn,
-			msi_mask_bits_reg(pos, is_64bit_address(control)), 4,
+		pci_write_config_dword(dev,
+			msi_mask_bits_reg(pos, is_64bit_address(control)),
 			maskbits);
 	}
 	attach_msi_entry(entry, vector);
@@ -556,238 +593,219 @@ static int msi_capability_init(struct pci_dev *dev)
  * @dev: pointer to the pci_dev data structure of MSI-X device function
  *
  * Setup the MSI-X capability structure of device funtion with a
- * single MSI-X vector. A return of zero indicates the successful setup
- * of an entry zero with the new MSI-X vector or non-zero for otherwise.
- * To request for additional MSI-X vectors, the device drivers are
- * required to utilize the following supported APIs:
- * 1) msi_alloc_vectors(...) for requesting one or more MSI-X vectors
- * 2) msi_free_vectors(...) for releasing one or more MSI-X vectors
- *    back to PCI subsystem before calling free_irq(...)
+ * single MSI-X vector. A return of zero indicates the successful setup of
+ * requested MSI-X entries with allocated vectors or non-zero for otherwise.
  **/
-static int msix_capability_init(struct pci_dev	*dev)
+static int msix_capability_init(struct pci_dev *dev,
+				struct msix_entry *entries, int nvec)
 {
-	struct msi_desc *entry;
+	struct msi_desc *head = NULL, *tail = NULL, *entry = NULL;
 	struct msg_address address;
 	struct msg_data data;
-	int vector = 0, pos, dev_msi_cap;
+	int vector, pos, i, j, nr_entries, temp = 0;
 	u32 phys_addr, table_offset;
-	u32 control;
+ 	u16 control;
 	u8 bir;
 	void *base;
 
    	pos = pci_find_capability(dev, PCI_CAP_ID_MSIX);
-	if (!pos)
-		return -EINVAL;
-
 	/* Request & Map MSI-X table region */
-	dev->bus->ops->read(dev->bus, dev->devfn, msi_control_reg(pos), 2,
-		&control);
-	if (control & PCI_MSIX_FLAGS_ENABLE)
-		return 0;
-
-	if (!msi_lookup_vector(dev)) {
-		/* Lookup Sucess */
-		enable_msi_mode(dev, pos, PCI_CAP_ID_MSIX);
-		return 0;
-	}
-
-	dev_msi_cap = multi_msix_capable(control);
-	dev->bus->ops->read(dev->bus, dev->devfn,
-		msix_table_offset_reg(pos), 4, &table_offset);
+ 	pci_read_config_word(dev, msi_control_reg(pos), &control);
+	nr_entries = multi_msix_capable(control);
+ 	pci_read_config_dword(dev, msix_table_offset_reg(pos),
+ 		&table_offset);
 	bir = (u8)(table_offset & PCI_MSIX_FLAGS_BIRMASK);
 	phys_addr = pci_resource_start (dev, bir);
 	phys_addr += (u32)(table_offset & ~PCI_MSIX_FLAGS_BIRMASK);
 	if (!request_mem_region(phys_addr,
-		dev_msi_cap * PCI_MSIX_ENTRY_SIZE,
-		"MSI-X iomap Failure"))
+		nr_entries * PCI_MSIX_ENTRY_SIZE,
+		"MSI-X vector table"))
 		return -ENOMEM;
-	base = ioremap_nocache(phys_addr, dev_msi_cap * PCI_MSIX_ENTRY_SIZE);
-	if (base == NULL)
-		goto free_region;
-	/* MSI Entry Initialization */
-	entry = alloc_msi_entry();
-	if (!entry)
-		goto free_iomap;
-	if ((vector = get_msi_vector(dev)) < 0)
-		goto free_entry;
+	base = ioremap_nocache(phys_addr, nr_entries * PCI_MSIX_ENTRY_SIZE);
+	if (base == NULL) {
+		release_mem_region(phys_addr, nr_entries * PCI_MSIX_ENTRY_SIZE);
+		return -ENOMEM;
+	}
+	/* MSI-X Table Initialization */
+	for (i = 0; i < nvec; i++) {
+		entry = alloc_msi_entry();
+		if (!entry)
+			break;
+		if ((vector = get_msi_vector(dev)) < 0)
+			break;
 
-	entry->msi_attrib.type = PCI_CAP_ID_MSIX;
-	entry->msi_attrib.entry_nr = 0;
-	entry->msi_attrib.maskbit = 1;
-	entry->msi_attrib.default_vector = dev->irq;
-	dev->irq = vector;	/* save default pre-assigned ioapic vector */
-	entry->dev = dev;
-	entry->mask_base = (unsigned long)base;
-	/* Replace with MSI handler */
-	irq_handler_init(PCI_CAP_ID_MSIX, vector, 1);
-	/* Configure MSI-X capability structure */
-	msi_address_init(&address);
-	msi_data_init(&data, vector);
-	entry->msi_attrib.current_cpu = ((address.lo_address.u.dest_id >>
-				MSI_TARGET_CPU_SHIFT) & MSI_TARGET_CPU_MASK);
-	writel(address.lo_address.value, base + PCI_MSIX_ENTRY_LOWER_ADDR_OFFSET);
-	writel(address.hi_address, base + PCI_MSIX_ENTRY_UPPER_ADDR_OFFSET);
-	writel(*(u32*)&data, base + PCI_MSIX_ENTRY_DATA_OFFSET);
-	/* Initialize all entries from 1 up to 0 */
-	for (pos = 1; pos < dev_msi_cap; pos++) {
-		writel(0, base + pos * PCI_MSIX_ENTRY_SIZE +
+ 		j = entries[i].entry;
+ 		entries[i].vector = vector;
+		entry->msi_attrib.type = PCI_CAP_ID_MSIX;
+ 		entry->msi_attrib.state = 0;		/* Mark it not active */
+		entry->msi_attrib.entry_nr = j;
+		entry->msi_attrib.maskbit = 1;
+		entry->msi_attrib.default_vector = dev->irq;
+		entry->dev = dev;
+		entry->mask_base = (unsigned long)base;
+		if (!head) {
+			entry->link.head = vector;
+			entry->link.tail = vector;
+			head = entry;
+		} else {
+			entry->link.head = temp;
+			entry->link.tail = tail->link.tail;
+			tail->link.tail = vector;
+			head->link.head = vector;
+		}
+		temp = vector;
+		tail = entry;
+		/* Replace with MSI-X handler */
+		irq_handler_init(PCI_CAP_ID_MSIX, vector, 1);
+		/* Configure MSI-X capability structure */
+		msi_address_init(&address);
+		msi_data_init(&data, vector);
+		entry->msi_attrib.current_cpu =
+			((address.lo_address.u.dest_id >>
+			MSI_TARGET_CPU_SHIFT) & MSI_TARGET_CPU_MASK);
+		writel(address.lo_address.value,
+			base + j * PCI_MSIX_ENTRY_SIZE +
 			PCI_MSIX_ENTRY_LOWER_ADDR_OFFSET);
-		writel(0, base + pos * PCI_MSIX_ENTRY_SIZE +
+		writel(address.hi_address,
+			base + j * PCI_MSIX_ENTRY_SIZE +
 			PCI_MSIX_ENTRY_UPPER_ADDR_OFFSET);
-		writel(0, base + pos * PCI_MSIX_ENTRY_SIZE +
+		writel(*(u32*)&data,
+			base + j * PCI_MSIX_ENTRY_SIZE +
 			PCI_MSIX_ENTRY_DATA_OFFSET);
+		attach_msi_entry(entry, vector);
 	}
-	attach_msi_entry(entry, vector);
-	/* Set MSI enabled bits	 */
+	if (i != nvec) {
+		i--;
+		for (; i >= 0; i--) {
+			vector = (entries + i)->vector;
+			msi_free_vector(dev, vector, 0);
+			(entries + i)->vector = 0;
+		}
+		return -EBUSY;
+	}
+	/* Set MSI-X enabled bits */
 	enable_msi_mode(dev, pos, PCI_CAP_ID_MSIX);
 
 	return 0;
-
-free_entry:
-	kmem_cache_free(msi_cachep, entry);
-free_iomap:
-	iounmap(base);
-free_region:
-	release_mem_region(phys_addr, dev_msi_cap * PCI_MSIX_ENTRY_SIZE);
-
-	return ((vector < 0) ? -EBUSY : -ENOMEM);
 }
 
 /**
- * pci_enable_msi - configure device's MSI(X) capability structure
- * @dev: pointer to the pci_dev data structure of MSI(X) device function
+ * pci_enable_msi - configure device's MSI capability structure
+ * @dev: pointer to the pci_dev data structure of MSI device function
  *
- * Setup the MSI/MSI-X capability structure of device function with
- * a single MSI(X) vector upon its software driver call to request for
- * MSI(X) mode enabled on its hardware device function. A return of zero
- * indicates the successful setup of an entry zero with the new MSI(X)
+ * Setup the MSI capability structure of device function with
+ * a single MSI vector upon its software driver call to request for
+ * MSI mode enabled on its hardware device function. A return of zero
+ * indicates the successful setup of an entry zero with the new MSI
  * vector or non-zero for otherwise.
  **/
 int pci_enable_msi(struct pci_dev* dev)
 {
-	int status = -EINVAL;
+	int pos, temp = dev->irq, status = -EINVAL;
+	u16 control;
 
 	if (!pci_msi_enable || !dev)
  		return status;
 
-	if (msi_init() < 0)
-		return -ENOMEM;
+	if ((status = msi_init()) < 0)
+		return status;
 
-	if ((status = msix_capability_init(dev)) == -EINVAL)
-		status = msi_capability_init(dev);
-	if (!status)
-		nr_reserved_vectors--;
+   	if (!(pos = pci_find_capability(dev, PCI_CAP_ID_MSI)))
+		return -EINVAL;
+
+	pci_read_config_word(dev, msi_control_reg(pos), &control);
+	if (control & PCI_MSI_FLAGS_ENABLE)
+		return 0;			/* Already in MSI mode */
+
+	if (!msi_lookup_vector(dev, PCI_CAP_ID_MSI)) {
+		/* Lookup Sucess */
+		unsigned long flags;
+
+		spin_lock_irqsave(&msi_lock, flags);
+		if (!vector_irq[dev->irq]) {
+			msi_desc[dev->irq]->msi_attrib.state = 0;
+			vector_irq[dev->irq] = -1;
+			nr_released_vectors--;
+			spin_unlock_irqrestore(&msi_lock, flags);
+			enable_msi_mode(dev, pos, PCI_CAP_ID_MSI);
+			return 0;
+		}
+		spin_unlock_irqrestore(&msi_lock, flags);
+		dev->irq = temp;
+	}
+	/* Check whether driver already requested for MSI-X vectors */
+   	if ((pos = pci_find_capability(dev, PCI_CAP_ID_MSIX)) > 0 &&
+		!msi_lookup_vector(dev, PCI_CAP_ID_MSIX)) {
+			printk(KERN_INFO "Can't enable MSI. Device already had MSI-X vectors assigned\n");
+			dev->irq = temp;
+			return -EINVAL;
+	}
+	status = msi_capability_init(dev);
+	if (!status) {
+   		if (!pos)
+			nr_reserved_vectors--;	/* Only MSI capable */
+		else if (nr_msix_devices > 0)
+			nr_msix_devices--;	/* Both MSI and MSI-X capable,
+						   but choose enabling MSI */
+	}
 
 	return status;
 }
 
-static int msi_free_vector(struct pci_dev* dev, int vector);
-static void pci_disable_msi(unsigned int vector)
+void pci_disable_msi(struct pci_dev* dev)
 {
-	int head, tail, type, default_vector;
 	struct msi_desc *entry;
-	struct pci_dev *dev;
+	int pos, default_vector;
+	u16 control;
 	unsigned long flags;
 
+   	if (!dev || !(pos = pci_find_capability(dev, PCI_CAP_ID_MSI)))
+		return;
+
+	pci_read_config_word(dev, msi_control_reg(pos), &control);
+	if (!(control & PCI_MSI_FLAGS_ENABLE))
+		return;
+
 	spin_lock_irqsave(&msi_lock, flags);
-	entry = msi_desc[vector];
-	if (!entry || !entry->dev) {
+	entry = msi_desc[dev->irq];
+	if (!entry || !entry->dev || entry->msi_attrib.type != PCI_CAP_ID_MSI) {
 		spin_unlock_irqrestore(&msi_lock, flags);
 		return;
 	}
-	dev = entry->dev;
-	type = entry->msi_attrib.type;
-	head = entry->link.head;
-	tail = entry->link.tail;
-	default_vector = entry->msi_attrib.default_vector;
-	spin_unlock_irqrestore(&msi_lock, flags);
-
-	disable_msi_mode(dev, pci_find_capability(dev, type), type);
-	/* Restore dev->irq to its default pin-assertion vector */
-	dev->irq = default_vector;
-	if (type == PCI_CAP_ID_MSIX && head != tail) {
-		/* Bad driver, which do not call msi_free_vectors before exit.
-		   We must do a cleanup here */
-		while (1) {
-			spin_lock_irqsave(&msi_lock, flags);
-			entry = msi_desc[vector];
-			head = entry->link.head;
-			tail = entry->link.tail;
-			spin_unlock_irqrestore(&msi_lock, flags);
-			if (tail == head)
-				break;
-			if (msi_free_vector(dev, entry->link.tail))
-				break;
-		}
+	if (entry->msi_attrib.state) {
+		spin_unlock_irqrestore(&msi_lock, flags);
+		printk(KERN_DEBUG "Driver[%d:%d:%d] unloaded wo doing free_irq on vector->%d\n",
+		dev->bus->number, PCI_SLOT(dev->devfn),	PCI_FUNC(dev->devfn),
+		dev->irq);
+		BUG_ON(entry->msi_attrib.state > 0);
+	} else {
+		vector_irq[dev->irq] = 0; /* free it */
+		nr_released_vectors++;
+		default_vector = entry->msi_attrib.default_vector;
+		spin_unlock_irqrestore(&msi_lock, flags);
+		/* Restore dev->irq to its default pin-assertion vector */
+		dev->irq = default_vector;
+		disable_msi_mode(dev, pci_find_capability(dev, PCI_CAP_ID_MSI),
+					PCI_CAP_ID_MSI);
 	}
 }
 
-static int msi_alloc_vector(struct pci_dev* dev, int head)
+static void release_msi(unsigned int vector)
 {
 	struct msi_desc *entry;
-	struct msg_address address;
-	struct msg_data data;
-	int i, offset, pos, dev_msi_cap, vector;
-	u32 low_address, control;
-	unsigned long base = 0L;
 	unsigned long flags;
 
 	spin_lock_irqsave(&msi_lock, flags);
-	entry = msi_desc[dev->irq];
-	if (!entry) {
-		spin_unlock_irqrestore(&msi_lock, flags);
-		return -EINVAL;
-	}
-	base = entry->mask_base;
+	entry = msi_desc[vector];
+	if (entry && entry->dev)
+		entry->msi_attrib.state = 0;	/* Mark it not active */
 	spin_unlock_irqrestore(&msi_lock, flags);
-
-   	pos = pci_find_capability(dev, PCI_CAP_ID_MSIX);
-	dev->bus->ops->read(dev->bus, dev->devfn, msi_control_reg(pos),
-		2, &control);
-	dev_msi_cap = multi_msix_capable(control);
-	for (i = 1; i < dev_msi_cap; i++) {
-		if (!(low_address = readl(base + i * PCI_MSIX_ENTRY_SIZE)))
-			 break;
-	}
-	if (i >= dev_msi_cap)
-		return -EINVAL;
-
-	/* MSI Entry Initialization */
-	if (!(entry = alloc_msi_entry()))
-		return -ENOMEM;
-
-	if ((vector = get_new_vector()) < 0) {
-		kmem_cache_free(msi_cachep, entry);
-		return vector;
-	}
-	entry->msi_attrib.type = PCI_CAP_ID_MSIX;
-	entry->msi_attrib.entry_nr = i;
-	entry->msi_attrib.maskbit = 1;
-	entry->dev = dev;
-	entry->link.head = head;
-	entry->mask_base = base;
-	irq_handler_init(PCI_CAP_ID_MSIX, vector, 1);
-	/* Configure MSI-X capability structure */
-	msi_address_init(&address);
-	msi_data_init(&data, vector);
-	entry->msi_attrib.current_cpu = ((address.lo_address.u.dest_id >>
-				MSI_TARGET_CPU_SHIFT) & MSI_TARGET_CPU_MASK);
-	offset = entry->msi_attrib.entry_nr * PCI_MSIX_ENTRY_SIZE;
-	writel(address.lo_address.value, base + offset +
-		PCI_MSIX_ENTRY_LOWER_ADDR_OFFSET);
-	writel(address.hi_address, base + offset +
-		PCI_MSIX_ENTRY_UPPER_ADDR_OFFSET);
-	writel(*(u32*)&data, base + offset + PCI_MSIX_ENTRY_DATA_OFFSET);
-	writel(1, base + offset + PCI_MSIX_ENTRY_VECTOR_CTRL_OFFSET);
-	attach_msi_entry(entry, vector);
-
-	return vector;
 }
 
-static int msi_free_vector(struct pci_dev* dev, int vector)
+static int msi_free_vector(struct pci_dev* dev, int vector, int reassign)
 {
 	struct msi_desc *entry;
-	int entry_nr, type;
+	int head, entry_nr, type;
 	unsigned long base = 0L;
 	unsigned long flags;
 
@@ -799,66 +817,177 @@ static int msi_free_vector(struct pci_dev* dev, int vector)
 	}
 	type = entry->msi_attrib.type;
 	entry_nr = entry->msi_attrib.entry_nr;
+	head = entry->link.head;
 	base = entry->mask_base;
-	if (entry->link.tail != entry->link.head) {
-		msi_desc[entry->link.head]->link.tail = entry->link.tail;
-		if (entry->link.tail)
-			msi_desc[entry->link.tail]->link.head = entry->link.head;
-	}
+	msi_desc[entry->link.head]->link.tail = entry->link.tail;
+	msi_desc[entry->link.tail]->link.head = entry->link.head;
 	entry->dev = NULL;
-	vector_irq[vector] = 0;
-	nr_released_vectors++;
+	if (!reassign) {
+		vector_irq[vector] = 0;
+		nr_released_vectors++;
+	}
 	msi_desc[vector] = NULL;
 	spin_unlock_irqrestore(&msi_lock, flags);
 
 	kmem_cache_free(msi_cachep, entry);
+
 	if (type == PCI_CAP_ID_MSIX) {
-		int offset;
+		if (!reassign)
+			writel(1, base +
+				entry_nr * PCI_MSIX_ENTRY_SIZE +
+				PCI_MSIX_ENTRY_VECTOR_CTRL_OFFSET);
+
+		if (head == vector) {
+			/*
+			 * Detect last MSI-X vector to be released.
+			 * Release the MSI-X memory-mapped table.
+			 */
+			int pos, nr_entries;
+			u32 phys_addr, table_offset;
+			u16 control;
+			u8 bir;
+
+   			pos = pci_find_capability(dev, PCI_CAP_ID_MSIX);
+			pci_read_config_word(dev, msi_control_reg(pos),
+				&control);
+			nr_entries = multi_msix_capable(control);
+			pci_read_config_dword(dev, msix_table_offset_reg(pos),
+				&table_offset);
+			bir = (u8)(table_offset & PCI_MSIX_FLAGS_BIRMASK);
+			phys_addr = pci_resource_start (dev, bir);
+			phys_addr += (u32)(table_offset &
+				~PCI_MSIX_FLAGS_BIRMASK);
+			iounmap((void*)base);
+			release_mem_region(phys_addr,
+				nr_entries * PCI_MSIX_ENTRY_SIZE);
+		}
+	}
 
-		offset = entry_nr * PCI_MSIX_ENTRY_SIZE;
-		writel(1, base + offset + PCI_MSIX_ENTRY_VECTOR_CTRL_OFFSET);
-		writel(0, base + offset + PCI_MSIX_ENTRY_LOWER_ADDR_OFFSET);
+	return 0;
+}
+
+static int reroute_msix_table(int head, struct msix_entry *entries, int *nvec)
+{
+	int vector = head, tail = 0;
+	int i = 0, j = 0, nr_entries = 0;
+	unsigned long base = 0L;
+	unsigned long flags;
+
+	spin_lock_irqsave(&msi_lock, flags);
+	while (head != tail) {
+		nr_entries++;
+		tail = msi_desc[vector]->link.tail;
+		if (entries[0].entry == msi_desc[vector]->msi_attrib.entry_nr)
+			j = vector;
+		vector = tail;
 	}
+	if (*nvec > nr_entries) {
+		spin_unlock_irqrestore(&msi_lock, flags);
+		*nvec = nr_entries;
+		return -EINVAL;
+	}
+	vector = ((j > 0) ? j : head);
+	for (i = 0; i < *nvec; i++) {
+		j = msi_desc[vector]->msi_attrib.entry_nr;
+		msi_desc[vector]->msi_attrib.state = 0;	/* Mark it not active */
+		vector_irq[vector] = -1;		/* Mark it busy */
+		nr_released_vectors--;
+		entries[i].vector = vector;
+		if (j != (entries + i)->entry) {
+			base = msi_desc[vector]->mask_base;
+			msi_desc[vector]->msi_attrib.entry_nr =
+				(entries + i)->entry;
+			writel( readl(base + j * PCI_MSIX_ENTRY_SIZE +
+				PCI_MSIX_ENTRY_LOWER_ADDR_OFFSET), base +
+				(entries + i)->entry * PCI_MSIX_ENTRY_SIZE +
+				PCI_MSIX_ENTRY_LOWER_ADDR_OFFSET);
+			writel(	readl(base + j * PCI_MSIX_ENTRY_SIZE +
+				PCI_MSIX_ENTRY_UPPER_ADDR_OFFSET), base +
+				(entries + i)->entry * PCI_MSIX_ENTRY_SIZE +
+				PCI_MSIX_ENTRY_UPPER_ADDR_OFFSET);
+			writel( (readl(base + j * PCI_MSIX_ENTRY_SIZE +
+				PCI_MSIX_ENTRY_DATA_OFFSET) & 0xff00) | vector,
+				base + (entries+i)->entry*PCI_MSIX_ENTRY_SIZE +
+				PCI_MSIX_ENTRY_DATA_OFFSET);
+		}
+		vector = msi_desc[vector]->link.tail;
+	}
+	spin_unlock_irqrestore(&msi_lock, flags);
 
 	return 0;
 }
 
 /**
- * msi_alloc_vectors - allocate additional MSI-X vectors
+ * pci_enable_msix - configure device's MSI-X capability structure
  * @dev: pointer to the pci_dev data structure of MSI-X device function
- * @vector: pointer to an array of new allocated MSI-X vectors
+ * @data: pointer to an array of MSI-X entries
  * @nvec: number of MSI-X vectors requested for allocation by device driver
  *
- * Allocate additional MSI-X vectors requested by device driver. A
- * return of zero indicates the successful setup of MSI-X capability
- * structure with new allocated MSI-X vectors or non-zero for otherwise.
+ * Setup the MSI-X capability structure of device function with the number
+ * of requested vectors upon its software driver call to request for
+ * MSI-X mode enabled on its hardware device function. A return of zero
+ * indicates the successful configuration of MSI-X capability structure
+ * with new allocated MSI-X vectors. A return of < 0 indicates a failure.
+ * Or a return of > 0 indicates that driver request is exceeding the number
+ * of vectors available. Driver should use the returned value to re-send
+ * its request.
  **/
-int msi_alloc_vectors(struct pci_dev* dev, int *vector, int nvec)
+int pci_enable_msix(struct pci_dev* dev, struct msix_entry *entries, int nvec)
 {
-	struct msi_desc *entry;
-	int i, head, pos, vec, free_vectors, alloc_vectors;
-	int *vectors = (int *)vector;
-	u32 control;
+	int status, pos, nr_entries, free_vectors;
+	int i, j, temp;
+	u16 control;
 	unsigned long flags;
 
-	if (!pci_msi_enable || !dev)
+	if (!pci_msi_enable || !dev || !entries)
  		return -EINVAL;
 
+	if ((status = msi_init()) < 0)
+		return status;
+
    	if (!(pos = pci_find_capability(dev, PCI_CAP_ID_MSIX)))
  		return -EINVAL;
 
-	dev->bus->ops->read(dev->bus, dev->devfn, msi_control_reg(pos), 			2, &control);
-	if (nvec > multi_msix_capable(control))
+	pci_read_config_word(dev, msi_control_reg(pos), &control);
+	if (control & PCI_MSIX_FLAGS_ENABLE)
+		return -EINVAL;			/* Already in MSI-X mode */
+
+	nr_entries = multi_msix_capable(control);
+	if (nvec > nr_entries)
 		return -EINVAL;
 
-	spin_lock_irqsave(&msi_lock, flags);
-	entry = msi_desc[dev->irq];
-	if (!entry || entry->dev != dev ||		/* legal call */
-	   entry->msi_attrib.type != PCI_CAP_ID_MSIX || /* must be MSI-X */
-	   entry->link.head != entry->link.tail) {	/* already multi */
-		spin_unlock_irqrestore(&msi_lock, flags);
+	/* Check for any invalid entries */
+	for (i = 0; i < nvec; i++) {
+		if (entries[i].entry >= nr_entries)
+			return -EINVAL;		/* invalid entry */
+		for (j = i + 1; j < nvec; j++) {
+			if (entries[i].entry == entries[j].entry)
+				return -EINVAL;	/* duplicate entry */
+		}
+	}
+	temp = dev->irq;
+	if (!msi_lookup_vector(dev, PCI_CAP_ID_MSIX)) {
+		/* Lookup Sucess */
+		nr_entries = nvec;
+		/* Reroute MSI-X table */
+		if (reroute_msix_table(dev->irq, entries, &nr_entries)) {
+			/* #requested > #previous-assigned */
+			dev->irq = temp;
+			return nr_entries;
+		}
+		dev->irq = temp;
+		enable_msi_mode(dev, pos, PCI_CAP_ID_MSIX);
+		return 0;
+	}
+	/* Check whether driver already requested for MSI vector */
+   	if (pci_find_capability(dev, PCI_CAP_ID_MSI) > 0 &&
+		!msi_lookup_vector(dev, PCI_CAP_ID_MSI)) {
+		printk(KERN_INFO "Can't enable MSI-X. Device already had MSI vector assigned\n");
+		dev->irq = temp;
 		return -EINVAL;
 	}
+
+	spin_lock_irqsave(&msi_lock, flags);
 	/*
 	 * msi_lock is provided to ensure that enough vectors resources are
 	 * available before granting.
@@ -874,71 +1003,65 @@ int msi_alloc_vectors(struct pci_dev* dev, int *vector, int nvec)
 		free_vectors /= nr_msix_devices;
 	spin_unlock_irqrestore(&msi_lock, flags);
 
-	if (nvec > free_vectors)
-		return -EBUSY;
-
-	alloc_vectors = 0;
-	head = dev->irq;
-	for (i = 0; i < nvec; i++) {
-		if ((vec = msi_alloc_vector(dev, head)) < 0)
-			break;
-		*(vectors + i) = vec;
-		head = vec;
-		alloc_vectors++;
-	}
-	if (alloc_vectors != nvec) {
-		for (i = 0; i < alloc_vectors; i++) {
-			vec = *(vectors + i);
-			msi_free_vector(dev, vec);
-		}
-		spin_lock_irqsave(&msi_lock, flags);
-		msi_desc[dev->irq]->link.tail = msi_desc[dev->irq]->link.head;
-		spin_unlock_irqrestore(&msi_lock, flags);
-		return -EBUSY;
+	if (nvec > free_vectors) {
+		if (free_vectors > 0)
+			return free_vectors;
+		else
+			return -EBUSY;
 	}
-	if (nr_msix_devices > 0)
+
+	status = msix_capability_init(dev, entries, nvec);
+	if (!status && nr_msix_devices > 0)
 		nr_msix_devices--;
 
-	return 0;
+	return status;
 }
 
-/**
- * msi_free_vectors - reclaim MSI-X vectors to unused state
- * @dev: pointer to the pci_dev data structure of MSI-X device function
- * @vector: pointer to an array of released MSI-X vectors
- * @nvec: number of MSI-X vectors requested for release by device driver
- *
- * Reclaim MSI-X vectors released by device driver to unused state,
- * which may be used later on. A return of zero indicates the
- * success or non-zero for otherwise. Device driver should call this
- * before calling function free_irq.
- **/
-int msi_free_vectors(struct pci_dev* dev, int *vector, int nvec)
+void pci_disable_msix(struct pci_dev* dev)
 {
-	struct msi_desc *entry;
-	int i;
-	unsigned long flags;
+	int pos, temp;
+	u16 control;
 
-	if (!pci_msi_enable)
- 		return -EINVAL;
+   	if (!dev || !(pos = pci_find_capability(dev, PCI_CAP_ID_MSIX)))
+		return;
 
-	spin_lock_irqsave(&msi_lock, flags);
-	entry = msi_desc[dev->irq];
-	if (!entry || entry->dev != dev ||
-	   	entry->msi_attrib.type != PCI_CAP_ID_MSIX ||
-		entry->link.head == entry->link.tail) {	/* Nothing to free */
+	pci_read_config_word(dev, msi_control_reg(pos), &control);
+	if (!(control & PCI_MSIX_FLAGS_ENABLE))
+		return;
+
+	temp = dev->irq;
+	if (!msi_lookup_vector(dev, PCI_CAP_ID_MSIX)) {
+		int state, vector, head, tail = 0, warning = 0;
+		unsigned long flags;
+
+		vector = head = dev->irq;
+		spin_lock_irqsave(&msi_lock, flags);
+		while (head != tail) {
+			state = msi_desc[vector]->msi_attrib.state;
+			if (state)
+				warning = 1;
+			else {
+				vector_irq[vector] = 0; /* free it */
+				nr_released_vectors++;
+			}
+			tail = msi_desc[vector]->link.tail;
+			vector = tail;
+		}
 		spin_unlock_irqrestore(&msi_lock, flags);
-		return -EINVAL;
-	}
-	spin_unlock_irqrestore(&msi_lock, flags);
+		if (warning) {
+			dev->irq = temp;
+			printk(KERN_DEBUG "Driver[%d:%d:%d] unloaded wo doing free_irq on all vectors\n",
+			dev->bus->number, PCI_SLOT(dev->devfn),
+			PCI_FUNC(dev->devfn));
+			BUG_ON(warning > 0);
+		} else {
+			dev->irq = temp;
+			disable_msi_mode(dev,
+				pci_find_capability(dev, PCI_CAP_ID_MSIX),
+				PCI_CAP_ID_MSIX);
 
-	for (i = 0; i < nvec; i++) {
-		if (*(vector + i) == dev->irq)
-			continue;/* Don't free entry 0 if mistaken by driver */
-		msi_free_vector(dev, *(vector + i));
+		}
 	}
-
-	return 0;
 }
 
 /**
@@ -952,62 +1075,73 @@ int msi_free_vectors(struct pci_dev* dev, int *vector, int nvec)
  **/
 void msi_remove_pci_irq_vectors(struct pci_dev* dev)
 {
-	struct msi_desc *entry;
-	int type, temp;
+	int state, pos, temp;
 	unsigned long flags;
 
 	if (!pci_msi_enable || !dev)
  		return;
 
-   	if (!pci_find_capability(dev, PCI_CAP_ID_MSI)) {
-   		if (!pci_find_capability(dev, PCI_CAP_ID_MSIX))
-			return;
-	}
-	temp = dev->irq;
-	if (msi_lookup_vector(dev))
-		return;
-
-	spin_lock_irqsave(&msi_lock, flags);
-	entry = msi_desc[dev->irq];
-	if (!entry || entry->dev != dev) {
+	temp = dev->irq;		/* Save IOAPIC IRQ */
+   	if ((pos = pci_find_capability(dev, PCI_CAP_ID_MSI)) > 0 &&
+		!msi_lookup_vector(dev, PCI_CAP_ID_MSI)) {
+		spin_lock_irqsave(&msi_lock, flags);
+		state = msi_desc[dev->irq]->msi_attrib.state;
 		spin_unlock_irqrestore(&msi_lock, flags);
-		return;
+		if (state) {
+			printk(KERN_DEBUG "Driver[%d:%d:%d] unloaded wo doing free_irq on vector->%d\n",
+			dev->bus->number, PCI_SLOT(dev->devfn),
+			PCI_FUNC(dev->devfn), dev->irq);
+			BUG_ON(state > 0);
+		} else /* Release MSI vector assigned to this device */
+			msi_free_vector(dev, dev->irq, 0);
+		dev->irq = temp;		/* Restore IOAPIC IRQ */
 	}
-	type = entry->msi_attrib.type;
-	spin_unlock_irqrestore(&msi_lock, flags);
+   	if ((pos = pci_find_capability(dev, PCI_CAP_ID_MSIX)) > 0 &&
+		!msi_lookup_vector(dev, PCI_CAP_ID_MSIX)) {
+		int vector, head, tail = 0, warning = 0;
+		unsigned long base = 0L;
 
-	msi_free_vector(dev, dev->irq);
-	if (type == PCI_CAP_ID_MSIX) {
-		int i, pos, dev_msi_cap;
-		u32 phys_addr, table_offset;
-		u32 control;
-		u8 bir;
-
-   		pos = pci_find_capability(dev, PCI_CAP_ID_MSIX);
-		dev->bus->ops->read(dev->bus, dev->devfn, msi_control_reg(pos), 			2, &control);
-		dev_msi_cap = multi_msix_capable(control);
-		dev->bus->ops->read(dev->bus, dev->devfn,
-			msix_table_offset_reg(pos), 4, &table_offset);
-		bir = (u8)(table_offset & PCI_MSIX_FLAGS_BIRMASK);
-		phys_addr = pci_resource_start (dev, bir);
-		phys_addr += (u32)(table_offset & ~PCI_MSIX_FLAGS_BIRMASK);
-		for (i = FIRST_DEVICE_VECTOR; i < NR_IRQS; i++) {
+		vector = head = dev->irq;
+		while (head != tail) {
 			spin_lock_irqsave(&msi_lock, flags);
-			if (!msi_desc[i] || msi_desc[i]->dev != dev) {
-				spin_unlock_irqrestore(&msi_lock, flags);
-				continue;
-			}
+			state = msi_desc[vector]->msi_attrib.state;
+			tail = msi_desc[vector]->link.tail;
+			base = msi_desc[vector]->mask_base;
 			spin_unlock_irqrestore(&msi_lock, flags);
-			msi_free_vector(dev, i);
+			if (state)
+				warning = 1;
+			else if (vector != head) /* Release MSI-X vector */
+				msi_free_vector(dev, vector, 0);
+			vector = tail;
+		}
+		msi_free_vector(dev, vector, 0);
+		if (warning) {
+			/* Force to release the MSI-X memory-mapped table */
+			u32 phys_addr, table_offset;
+			u16 control;
+			u8 bir;
+
+			pci_read_config_word(dev, msi_control_reg(pos),
+				&control);
+			pci_read_config_dword(dev, msix_table_offset_reg(pos),
+				&table_offset);
+			bir = (u8)(table_offset & PCI_MSIX_FLAGS_BIRMASK);
+			phys_addr = pci_resource_start (dev, bir);
+			phys_addr += (u32)(table_offset &
+				~PCI_MSIX_FLAGS_BIRMASK);
+			iounmap((void*)base);
+			release_mem_region(phys_addr, PCI_MSIX_ENTRY_SIZE *
+				multi_msix_capable(control));
+			printk(KERN_DEBUG "Driver[%d:%d:%d] unloaded wo doing free_irq on all vectors\n",
+				dev->bus->number, PCI_SLOT(dev->devfn),
+				PCI_FUNC(dev->devfn));
+			BUG_ON(warning > 0);
 		}
-		writel(1, entry->mask_base + PCI_MSIX_ENTRY_VECTOR_CTRL_OFFSET);
-		iounmap((void*)entry->mask_base);
-		release_mem_region(phys_addr, dev_msi_cap * PCI_MSIX_ENTRY_SIZE);
+		dev->irq = temp;		/* Restore IOAPIC IRQ */
 	}
-	dev->irq = temp;
-	nr_reserved_vectors++;
 }
 
 EXPORT_SYMBOL(pci_enable_msi);
-EXPORT_SYMBOL(msi_alloc_vectors);
-EXPORT_SYMBOL(msi_free_vectors);
+EXPORT_SYMBOL(pci_disable_msi);
+EXPORT_SYMBOL(pci_enable_msix);
+EXPORT_SYMBOL(pci_disable_msix);
diff --git a/drivers/pci/msi.h b/drivers/pci/msi.h
index 524504fdd..3a7a52854 100644
--- a/drivers/pci/msi.h
+++ b/drivers/pci/msi.h
@@ -140,7 +140,8 @@ struct msi_desc {
 	struct {
 		__u8	type	: 5; 	/* {0: unused, 5h:MSI, 11h:MSI-X} */
 		__u8	maskbit	: 1; 	/* mask-pending bit supported ?   */
-		__u8	reserved: 2; 	/* reserved			  */
+		__u8	state	: 1; 	/* {0: free, 1: busy}		  */
+		__u8	reserved: 1; 	/* reserved			  */
 		__u8	entry_nr;    	/* specific enabled entry 	  */
 		__u8	default_vector; /* default pre-assigned vector    */
 		__u8	current_cpu; 	/* current destination cpu	  */
diff --git a/drivers/pci/pci-driver.c b/drivers/pci/pci-driver.c
index 0dea6b1dd..9936879eb 100644
--- a/drivers/pci/pci-driver.c
+++ b/drivers/pci/pci-driver.c
@@ -539,6 +539,7 @@ struct bus_type pci_bus_type = {
 	.hotplug	= pci_hotplug,
 	.suspend	= pci_device_suspend,
 	.resume		= pci_device_resume,
+	.dev_attrs	= pci_dev_attrs,
 };
 
 static int __init pci_driver_init(void)
diff --git a/drivers/pci/pci-sysfs.c b/drivers/pci/pci-sysfs.c
index 34161c9f8..120a441a8 100644
--- a/drivers/pci/pci-sysfs.c
+++ b/drivers/pci/pci-sysfs.c
@@ -23,14 +23,13 @@
 /* show configuration fields */
 #define pci_config_attr(field, format_string)				\
 static ssize_t								\
-show_##field (struct device *dev, char *buf)				\
+field##_show(struct device *dev, char *buf)				\
 {									\
 	struct pci_dev *pdev;						\
 									\
 	pdev = to_pci_dev (dev);					\
 	return sprintf (buf, format_string, pdev->field);		\
-}									\
-static DEVICE_ATTR(field, S_IRUGO, show_##field, NULL);
+}
 
 pci_config_attr(vendor, "0x%04x\n");
 pci_config_attr(device, "0x%04x\n");
@@ -41,7 +40,7 @@ pci_config_attr(irq, "%u\n");
 
 /* show resources */
 static ssize_t
-pci_show_resources(struct device * dev, char * buf)
+resource_show(struct device * dev, char * buf)
 {
 	struct pci_dev * pci_dev = to_pci_dev(dev);
 	char * str = buf;
@@ -60,7 +59,16 @@ pci_show_resources(struct device * dev, char * buf)
 	return (str - buf);
 }
 
-static DEVICE_ATTR(resource,S_IRUGO,pci_show_resources,NULL);
+struct device_attribute pci_dev_attrs[] = {
+	__ATTR_RO(resource),
+	__ATTR_RO(vendor),
+	__ATTR_RO(device),
+	__ATTR_RO(subsystem_vendor),
+	__ATTR_RO(subsystem_device),
+	__ATTR_RO(class),
+	__ATTR_RO(irq),
+	__ATTR_NULL,
+};
 
 static ssize_t
 pci_read_config(struct kobject *kobj, char *buf, loff_t off, size_t count)
@@ -180,21 +188,10 @@ static struct bin_attribute pcie_config_attr = {
 
 void pci_create_sysfs_dev_files (struct pci_dev *pdev)
 {
-	struct device *dev = &pdev->dev;
-
-	/* current configuration's attributes */
-	device_create_file (dev, &dev_attr_vendor);
-	device_create_file (dev, &dev_attr_device);
-	device_create_file (dev, &dev_attr_subsystem_vendor);
-	device_create_file (dev, &dev_attr_subsystem_device);
-	device_create_file (dev, &dev_attr_class);
-	device_create_file (dev, &dev_attr_irq);
-	device_create_file (dev, &dev_attr_resource);
-
 	if (pdev->cfg_size < 4096)
-		sysfs_create_bin_file(&dev->kobj, &pci_config_attr);
+		sysfs_create_bin_file(&pdev->dev.kobj, &pci_config_attr);
 	else
-		sysfs_create_bin_file(&dev->kobj, &pcie_config_attr);
+		sysfs_create_bin_file(&pdev->dev.kobj, &pcie_config_attr);
 
 	/* add platform-specific attributes */
 	pcibios_add_platform_entries(pdev);
diff --git a/drivers/pci/pci.c b/drivers/pci/pci.c
index e3c97d940..05daa8cff 100644
--- a/drivers/pci/pci.c
+++ b/drivers/pci/pci.c
@@ -442,7 +442,7 @@ int pci_enable_wake(struct pci_dev *dev, u32 state, int enable)
 	pci_read_config_word(dev,pm+PCI_PM_PMC,&value);
 
 	value &= PCI_PM_CAP_PME_MASK;
-	value >>= ffs(value);   /* First bit of mask */
+	value >>= ffs(PCI_PM_CAP_PME_MASK) - 1;   /* First bit of mask */
 
 	/* Check if it can generate PME# from requested state. */
 	if (!value || !(value & (1 << state))) 
diff --git a/drivers/pci/pci.h b/drivers/pci/pci.h
index e1985b618..a9b243770 100644
--- a/drivers/pci/pci.h
+++ b/drivers/pci/pci.h
@@ -62,3 +62,4 @@ extern int pci_visit_dev(struct pci_visit *fn,
 extern spinlock_t pci_bus_lock;
 
 extern int pciehp_msi_quirk;
+extern struct device_attribute pci_dev_attrs[];
diff --git a/drivers/pci/pci.ids b/drivers/pci/pci.ids
index 6e4965e66..c1f3d74cc 100644
--- a/drivers/pci/pci.ids
+++ b/drivers/pci/pci.ids
@@ -5535,6 +5535,7 @@
 132d  Integrated Silicon Solution, Inc.
 1330  MMC Networks
 1331  Radisys Corp.
+	0030  ENP-2611
 	8200  82600 Host Bridge
 	8201  82600 IDE
 	8202  82600 USB
diff --git a/drivers/pci/probe.c b/drivers/pci/probe.c
index 736a56f7f..ee7b9feb6 100644
--- a/drivers/pci/probe.c
+++ b/drivers/pci/probe.c
@@ -326,7 +326,7 @@ struct pci_bus * __devinit pci_add_new_bus(struct pci_bus *parent, struct pci_de
 	return child;
 }
 
-static unsigned int __devinit pci_scan_child_bus(struct pci_bus *bus);
+unsigned int __devinit pci_scan_child_bus(struct pci_bus *bus);
 
 /*
  * If it's a bridge, configure it and scan the bus behind it.
@@ -694,7 +694,7 @@ int __devinit pci_scan_slot(struct pci_bus *bus, int devfn)
 	return nr;
 }
 
-static unsigned int __devinit pci_scan_child_bus(struct pci_bus *bus)
+unsigned int __devinit pci_scan_child_bus(struct pci_bus *bus)
 {
 	unsigned int devfn, pass, max = bus->secondary;
 	struct pci_dev *dev;
@@ -801,4 +801,5 @@ EXPORT_SYMBOL(pci_do_scan_bus);
 EXPORT_SYMBOL(pci_scan_slot);
 EXPORT_SYMBOL(pci_scan_bridge);
 EXPORT_SYMBOL(pci_scan_single_device);
+EXPORT_SYMBOL_GPL(pci_scan_child_bus);
 #endif
diff --git a/drivers/pci/quirks.c b/drivers/pci/quirks.c
index b82a1c31e..6e7c35013 100644
--- a/drivers/pci/quirks.c
+++ b/drivers/pci/quirks.c
@@ -694,28 +694,43 @@ static int __initdata asus_hides_smbus = 0;
 
 static void __init asus_hides_smbus_hostbridge(struct pci_dev *dev)
 {
-	if (likely(dev->subsystem_vendor != PCI_VENDOR_ID_ASUSTEK))
-		return;
-
-	if (dev->device == PCI_DEVICE_ID_INTEL_82845_HB)
-		switch(dev->subsystem_device) {
-		case 0x8070: /* P4B */
-	    	case 0x8088: /* P4B533 */
-			asus_hides_smbus = 1;
-		}
-	if (dev->device == PCI_DEVICE_ID_INTEL_82845G_HB)
-		switch(dev->subsystem_device) {
-		case 0x80b2: /* P4PE */
- 		case 0x8093: /* P4B533-V */
-			asus_hides_smbus = 1;
-		}
-	if ((dev->device == PCI_DEVICE_ID_INTEL_82850_HB) &&
-	    (dev->subsystem_device == 0x8030)) /* P4T533 */
-		asus_hides_smbus = 1;
-	if ((dev->device == PCI_DEVICE_ID_INTEL_7205_0) &&
-	    (dev->subsystem_device == 0x8070)) /* P4G8X Deluxe */
-		asus_hides_smbus = 1;
-	return;
+	if (unlikely(dev->subsystem_vendor == PCI_VENDOR_ID_ASUSTEK)) {
+		if (dev->device == PCI_DEVICE_ID_INTEL_82845_HB)
+			switch(dev->subsystem_device) {
+			case 0x8070: /* P4B */
+			case 0x8088: /* P4B533 */
+				asus_hides_smbus = 1;
+			}
+		if (dev->device == PCI_DEVICE_ID_INTEL_82845G_HB)
+			switch(dev->subsystem_device) {
+			case 0x80b1: /* P4GE-V */
+			case 0x80b2: /* P4PE */
+			case 0x8093: /* P4B533-V */
+				asus_hides_smbus = 1;
+			}
+		if (dev->device == PCI_DEVICE_ID_INTEL_82850_HB)
+			switch(dev->subsystem_device) {
+			case 0x8030: /* P4T533 */
+				asus_hides_smbus = 1;
+			}
+		if (dev->device == PCI_DEVICE_ID_INTEL_7205_0)
+			switch (dev->subsystem_device) {
+			case 0x8070: /* P4G8X Deluxe */
+				asus_hides_smbus = 1;
+			}
+		if (dev->device == PCI_DEVICE_ID_INTEL_82855GM_HB)
+			switch (dev->subsystem_device) {
+			case 0x1751: /* M2N notebook */
+				asus_hides_smbus = 1;
+			}
+	} else if (unlikely(dev->subsystem_vendor == PCI_VENDOR_ID_HP)) {
+		if (dev->device ==  PCI_DEVICE_ID_INTEL_82855PM_HB)
+			switch(dev->subsystem_device) {
+			case 0x088C: /* HP Compaq nc8000 */
+			case 0x0890: /* HP Compaq nc6000 */
+				asus_hides_smbus = 1;
+			}
+	}
 }
 
 static void __init asus_hides_smbus_lpc(struct pci_dev *dev)
@@ -816,6 +831,7 @@ static void __init quirk_alder_ioapic(struct pci_dev *pdev)
 static void __init quirk_intel_ide_combined(struct pci_dev *pdev)
 {
 	u8 prog, comb, tmp;
+	int ich = 0;
 
 	/*
 	 * Narrow down to Intel SATA PCI devices.
@@ -826,8 +842,12 @@ static void __init quirk_intel_ide_combined(struct pci_dev *pdev)
 	case 0x24df:
 	case 0x25a3:
 	case 0x25b0:
+		ich = 5;
+		break;
 	case 0x2651:
 	case 0x2652:
+	case 0x2653:
+		ich = 6;
 		break;
 	default:
 		/* we do not handle this PCI device */
@@ -838,13 +858,25 @@ static void __init quirk_intel_ide_combined(struct pci_dev *pdev)
 	 * Read combined mode register.
 	 */
 	pci_read_config_byte(pdev, 0x90, &tmp);	/* combined mode reg */
-	tmp &= 0x6;     /* interesting bits 2:1, PATA primary/secondary */
-	if (tmp == 0x4)		/* bits 10x */
-		comb = (1 << 0);		/* SATA port 0, PATA port 1 */
-	else if (tmp == 0x6)	/* bits 11x */
-		comb = (1 << 2);		/* PATA port 0, SATA port 1 */
-	else
-		return;				/* not in combined mode */
+
+	if (ich == 5) {
+		tmp &= 0x6;  /* interesting bits 2:1, PATA primary/secondary */
+		if (tmp == 0x4)		/* bits 10x */
+			comb = (1 << 0);	/* SATA port 0, PATA port 1 */
+		else if (tmp == 0x6)	/* bits 11x */
+			comb = (1 << 2);	/* PATA port 0, SATA port 1 */
+		else
+			return;			/* not in combined mode */
+	} else {
+		WARN_ON(ich != 6);
+		tmp &= 0x3;  /* interesting bits 1:0 */
+		if (tmp & (1 << 0))
+			comb = (1 << 2);	/* PATA port 0, SATA port 1 */
+		else if (tmp & (1 << 1))
+			comb = (1 << 0);	/* SATA port 0, PATA port 1 */
+		else
+			return;			/* not in combined mode */
+	}
 
 	/*
 	 * Read programming interface register.
@@ -986,13 +1018,17 @@ static struct pci_fixup pci_fixups[] __devinitdata = {
 
 	/*
 	 * on Asus P4B boards, the i801SMBus device is disabled at startup.
+	 * this also goes for boards in HP Compaq nc6000 and nc8000 notebooks.
 	 */
 	{ PCI_FIXUP_HEADER,	PCI_VENDOR_ID_INTEL,	PCI_DEVICE_ID_INTEL_82845_HB,	asus_hides_smbus_hostbridge },
 	{ PCI_FIXUP_HEADER,	PCI_VENDOR_ID_INTEL,	PCI_DEVICE_ID_INTEL_82845G_HB,	asus_hides_smbus_hostbridge },
 	{ PCI_FIXUP_HEADER,	PCI_VENDOR_ID_INTEL,	PCI_DEVICE_ID_INTEL_82850_HB,	asus_hides_smbus_hostbridge },
 	{ PCI_FIXUP_HEADER,	PCI_VENDOR_ID_INTEL,	PCI_DEVICE_ID_INTEL_7205_0,	asus_hides_smbus_hostbridge },
+	{ PCI_FIXUP_HEADER,	PCI_VENDOR_ID_INTEL,	PCI_DEVICE_ID_INTEL_82855PM_HB,	asus_hides_smbus_hostbridge },
+	{ PCI_FIXUP_HEADER,	PCI_VENDOR_ID_INTEL,	PCI_DEVICE_ID_INTEL_82855GM_HB,	asus_hides_smbus_hostbridge },
 	{ PCI_FIXUP_HEADER,	PCI_VENDOR_ID_INTEL,	PCI_DEVICE_ID_INTEL_82801DB_0,	asus_hides_smbus_lpc },
 	{ PCI_FIXUP_HEADER,	PCI_VENDOR_ID_INTEL,	PCI_DEVICE_ID_INTEL_82801BA_0,	asus_hides_smbus_lpc },
+	{ PCI_FIXUP_HEADER,	PCI_VENDOR_ID_INTEL,	PCI_DEVICE_ID_INTEL_82801DB_12,	asus_hides_smbus_lpc },
 
 #ifdef CONFIG_SCSI_SATA
 	/* Fixup BIOSes that configure Parallel ATA (PATA / IDE) and
diff --git a/drivers/pcmcia/Kconfig b/drivers/pcmcia/Kconfig
index 32ed7a0ce..8a4007516 100644
--- a/drivers/pcmcia/Kconfig
+++ b/drivers/pcmcia/Kconfig
@@ -69,6 +69,13 @@ config CARDBUS
 	depends on YENTA
 	default y if YENTA
 
+config PD6729
+	tristate "Cirrus PD6729 compatible bridge support"
+	depends on PCMCIA && PCI
+	help
+	  This provides support for the Cirrus PD6729 PCI-to-PCMCIA bridge
+	  device, found in some older laptops and PCMCIA card readers.
+
 config I82092
 	tristate "i82092 compatible bridge support"
 	depends on PCMCIA && PCI
diff --git a/drivers/pcmcia/Makefile b/drivers/pcmcia/Makefile
index 160f73eef..86acf410a 100644
--- a/drivers/pcmcia/Makefile
+++ b/drivers/pcmcia/Makefile
@@ -9,6 +9,7 @@ endif
 obj-$(CONFIG_PCMCIA)				+= pcmcia_core.o ds.o
 obj-$(CONFIG_YENTA) 				+= yenta_socket.o
 
+obj-$(CONFIG_PD6729)				+= pd6729.o
 obj-$(CONFIG_I82365)				+= i82365.o
 obj-$(CONFIG_I82092)				+= i82092.o
 obj-$(CONFIG_TCIC)				+= tcic.o
@@ -17,7 +18,7 @@ obj-$(CONFIG_PCMCIA_SA1100)			+= sa11xx_core.o sa1100_cs.o
 obj-$(CONFIG_PCMCIA_SA1111)			+= sa11xx_core.o sa1111_cs.o
 obj-$(CONFIG_PCMCIA_PXA2XX)                     += pxa2xx_core.o pxa2xx_cs.o
 
-pcmcia_core-y					+= cistpl.o rsrc_mgr.o bulkmem.o cs.o
+pcmcia_core-y					+= cistpl.o rsrc_mgr.o bulkmem.o cs.o socket_sysfs.o
 pcmcia_core-$(CONFIG_CARDBUS)			+= cardbus.o
 
 sa11xx_core-y					+= soc_common.o sa11xx_base.o
diff --git a/drivers/pcmcia/cardbus.c b/drivers/pcmcia/cardbus.c
index 96700495c..4dab2ffc8 100644
--- a/drivers/pcmcia/cardbus.c
+++ b/drivers/pcmcia/cardbus.c
@@ -118,7 +118,7 @@ static void cb_release_cis_mem(struct pcmcia_socket * s)
 		cs_dbg(s, 1, "cb_release_cis_mem()\n");
 		iounmap(s->cb_cis_virt);
 		s->cb_cis_virt = NULL;
-		s->cb_cis_res = 0;
+		s->cb_cis_res = NULL;
 	}
 }
 
diff --git a/drivers/pcmcia/cistpl.c b/drivers/pcmcia/cistpl.c
index d975ad35a..b78d41a3c 100644
--- a/drivers/pcmcia/cistpl.c
+++ b/drivers/pcmcia/cistpl.c
@@ -85,13 +85,15 @@ INT_MODULE_PARM(cis_width,	0);		/* 16-bit CIS? */
 
 void release_cis_mem(struct pcmcia_socket *s)
 {
-    if (s->cis_mem.sys_start != 0) {
+    if (s->cis_mem.flags & MAP_ACTIVE) {
 	s->cis_mem.flags &= ~MAP_ACTIVE;
 	s->ops->set_mem_map(s, &s->cis_mem);
-	if (!(s->features & SS_CAP_STATIC_MAP))
-	    release_mem_region(s->cis_mem.sys_start, s->map_size);
+	if (s->cis_mem.res) {
+	    release_resource(s->cis_mem.res);
+	    kfree(s->cis_mem.res);
+	    s->cis_mem.res = NULL;
+	}
 	iounmap(s->cis_virt);
-	s->cis_mem.sys_start = 0;
 	s->cis_virt = NULL;
     }
 }
@@ -105,17 +107,16 @@ static unsigned char *
 set_cis_map(struct pcmcia_socket *s, unsigned int card_offset, unsigned int flags)
 {
     pccard_mem_map *mem = &s->cis_mem;
-    if (!(s->features & SS_CAP_STATIC_MAP) &&
-	mem->sys_start == 0) {
-	validate_mem(s);
-	mem->sys_start = 0;
-	if (find_mem_region(&mem->sys_start, s->map_size,
-			    s->map_size, 0, "card services", s)) {
+    if (!(s->features & SS_CAP_STATIC_MAP) && mem->res == NULL) {
+	mem->res = find_mem_region(0, s->map_size, s->map_size, 0,
+				   "card services", s);
+	if (mem->res == NULL) {
 	    printk(KERN_NOTICE "cs: unable to map card memory!\n");
 	    return NULL;
 	}
-	mem->sys_stop = mem->sys_start+s->map_size-1;
-	s->cis_virt = ioremap(mem->sys_start, s->map_size);
+	mem->sys_start = mem->res->start;
+	mem->sys_stop = mem->res->end;
+	s->cis_virt = ioremap(mem->res->start, s->map_size);
     }
     mem->card_start = card_offset;
     mem->flags = flags;
diff --git a/drivers/pcmcia/cs.c b/drivers/pcmcia/cs.c
index 06462389a..f796bc99c 100644
--- a/drivers/pcmcia/cs.c
+++ b/drivers/pcmcia/cs.c
@@ -264,7 +264,10 @@ int pcmcia_register_socket(struct pcmcia_socket *socket)
 		goto err;
 
 	wait_for_completion(&socket->thread_done);
-	BUG_ON(!socket->thread);
+	if(!socket->thread) {
+		printk(KERN_WARNING "PCMCIA: warning: socket thread for socket %p did not start\n", socket);
+		return -EIO;
+	}
 	pcmcia_parse_events(socket, SS_DETECT);
 
 	return 0;
@@ -678,9 +681,8 @@ static int pccardd(void *__skt)
 	int ret;
 
 	daemonize("pccardd");
-	skt->thread = current;
-	complete(&skt->thread_done);
 
+	skt->thread = current;
 	skt->socket = dead_socket;
 	skt->ops->init(skt);
 	skt->ops->set_socket(skt, &skt->socket);
@@ -690,7 +692,10 @@ static int pccardd(void *__skt)
 	if (ret) {
 		printk(KERN_WARNING "PCMCIA: unable to register socket 0x%p\n",
 			skt);
+		skt->thread = NULL;
+		complete_and_exit(&skt->thread_done, 0);
 	}
+	complete(&skt->thread_done);
 
 	add_wait_queue(&skt->thread_wait, &wait);
 	for (;;) {
@@ -1100,8 +1105,8 @@ int pcmcia_get_window(window_handle_t *handle, int idx, win_req_t *req)
     if (w == MAX_WIN)
 	return CS_NO_MORE_ITEMS;
     win = &s->win[w];
-    req->Base = win->ctl.sys_start;
-    req->Size = win->ctl.sys_stop - win->ctl.sys_start + 1;
+    req->Base = win->ctl.res->start;
+    req->Size = win->ctl.res->end - win->ctl.res->start + 1;
     req->AccessSpeed = win->ctl.speed;
     req->Attributes = 0;
     if (win->ctl.flags & MAP_ATTRIB)
@@ -1548,8 +1553,11 @@ int pcmcia_release_window(window_handle_t win)
     s->state &= ~SOCKET_WIN_REQ(win->index);
 
     /* Release system memory */
-    if(!(s->features & SS_CAP_STATIC_MAP))
-	release_mem_region(win->base, win->size);
+    if (win->ctl.res) {
+	release_resource(win->ctl.res);
+	kfree(win->ctl.res);
+	win->ctl.res = NULL;
+    }
     win->handle->state &= ~CLIENT_WIN_REQ(win->index);
 
     win->magic = 0;
@@ -1871,14 +1879,19 @@ int pcmcia_request_window(client_handle_t *handle, win_req_t *req, window_handle
     win->index = w;
     win->handle = *handle;
     win->sock = s;
-    win->base = req->Base;
-    win->size = req->Size;
 
-    if (!(s->features & SS_CAP_STATIC_MAP) &&
-	find_mem_region(&win->base, win->size, align,
-			(req->Attributes & WIN_MAP_BELOW_1MB),
-			(*handle)->dev_info, s))
-	return CS_IN_USE;
+    if (!(s->features & SS_CAP_STATIC_MAP)) {
+	win->ctl.res = find_mem_region(req->Base, req->Size, align,
+				       (req->Attributes & WIN_MAP_BELOW_1MB),
+				       (*handle)->dev_info, s);
+	if (!win->ctl.res)
+	    return CS_IN_USE;
+	win->ctl.sys_start = win->ctl.res->start;
+	win->ctl.sys_stop = win->ctl.res->end;
+    } else {
+	win->ctl.sys_start = req->Base;
+	win->ctl.sys_stop = req->Base + req->Size - 1;
+    }
     (*handle)->state |= CLIENT_WIN_REQ(w);
 
     /* Configure the socket controller */
@@ -1893,8 +1906,6 @@ int pcmcia_request_window(client_handle_t *handle, win_req_t *req, window_handle
 	win->ctl.flags |= MAP_16BIT;
     if (req->Attributes & WIN_USE_WAIT)
 	win->ctl.flags |= MAP_USE_WAIT;
-    win->ctl.sys_start = win->base;
-    win->ctl.sys_stop = win->base + win->size-1;
     win->ctl.card_start = 0;
     if (s->ops->set_mem_map(s, &win->ctl) != 0)
 	return CS_BAD_ARGS;
@@ -2025,16 +2036,18 @@ int pcmcia_eject_card(struct pcmcia_socket *skt)
 	down(&skt->skt_sem);
 	do {
 		if (!(skt->state & SOCKET_PRESENT)) {
-			ret = CS_NO_CARD;
+			ret = -ENODEV;
 			break;
 		}
 
 		ret = send_event(skt, CS_EVENT_EJECTION_REQUEST, CS_EVENT_PRI_LOW);
-		if (ret != 0)
+		if (ret != 0) {
+			ret = -EINVAL;
 			break;
+		}
 
 		socket_remove(skt);
-		ret = CS_SUCCESS;
+		ret = 0;
 	} while (0);
 	up(&skt->skt_sem);
 
@@ -2050,14 +2063,14 @@ int pcmcia_insert_card(struct pcmcia_socket *skt)
 	down(&skt->skt_sem);
 	do {
 		if (skt->state & SOCKET_PRESENT) {
-			ret = CS_IN_USE;
+			ret = -EBUSY;
 			break;
 		}
 		if (socket_insert(skt) == CS_NO_CARD) {
-			ret = CS_NO_CARD;
+			ret = -ENODEV;
 			break;
 		}
-		ret = CS_SUCCESS;
+		ret = 0;
 	} while (0);
 	up(&skt->skt_sem);
 
@@ -2155,16 +2168,21 @@ EXPORT_SYMBOL(pcmcia_socket_class);
 
 static int __init init_pcmcia_cs(void)
 {
-    printk(KERN_INFO "%s\n", release);
-    printk(KERN_INFO "  %s\n", options);
+	int ret;
+	printk(KERN_INFO "%s\n", release);
+	printk(KERN_INFO "  %s\n", options);
 
-    return class_register(&pcmcia_socket_class);
+	ret = class_register(&pcmcia_socket_class);
+	if (ret)
+		return (ret);
+	return class_interface_register(&pccard_sysfs_interface);
 }
 
 static void __exit exit_pcmcia_cs(void)
 {
     printk(KERN_INFO "unloading Kernel Card Services\n");
     release_resource_db();
+    class_interface_unregister(&pccard_sysfs_interface);
     class_unregister(&pcmcia_socket_class);
 }
 
diff --git a/drivers/pcmcia/cs_internal.h b/drivers/pcmcia/cs_internal.h
index 41b94af07..e148fb967 100644
--- a/drivers/pcmcia/cs_internal.h
+++ b/drivers/pcmcia/cs_internal.h
@@ -180,18 +180,22 @@ int write_memory(memory_handle_t handle, mem_op_t *req, caddr_t buf);
 int copy_memory(memory_handle_t handle, copy_op_t *req);
 
 /* In rsrc_mgr */
-void validate_mem(struct pcmcia_socket *s);
+void pcmcia_validate_mem(struct pcmcia_socket *s);
 struct resource *find_io_region(unsigned long base, int num, unsigned long align,
 		   char *name, struct pcmcia_socket *s);
 int adjust_io_region(struct resource *res, unsigned long r_start,
 		     unsigned long r_end, struct pcmcia_socket *s);
-int find_mem_region(u_long *base, u_long num, u_long align,
+struct resource *find_mem_region(u_long base, u_long num, u_long align,
 		    int low, char *name, struct pcmcia_socket *s);
 int try_irq(u_int Attributes, int irq, int specific);
 void undo_irq(u_int Attributes, int irq);
 int adjust_resource_info(client_handle_t handle, adjust_t *adj);
 void release_resource_db(void);
 
+/* In socket_sysfs.c */
+extern struct class_interface pccard_sysfs_interface;
+
+/* In cs.c */
 extern struct rw_semaphore pcmcia_socket_list_rwsem;
 extern struct list_head pcmcia_socket_list;
 
diff --git a/drivers/pcmcia/ds.c b/drivers/pcmcia/ds.c
index d5d487e79..71592c71d 100644
--- a/drivers/pcmcia/ds.c
+++ b/drivers/pcmcia/ds.c
@@ -941,6 +941,7 @@ static int ds_ioctl(struct inode * inode, struct file * file,
 	ret = pcmcia_get_configuration_info(s->handle, &buf.config);
 	break;
     case DS_GET_FIRST_TUPLE:
+	pcmcia_validate_mem(s->parent);
 	ret = pcmcia_get_first_tuple(s->handle, &buf.tuple);
 	break;
     case DS_GET_NEXT_TUPLE:
@@ -962,6 +963,7 @@ static int ds_ioctl(struct inode * inode, struct file * file,
 	ret = pcmcia_get_status(s->handle, &buf.status);
 	break;
     case DS_VALIDATE_CIS:
+	pcmcia_validate_mem(s->parent);
 	ret = pcmcia_validate_cis(s->handle, &buf.cisinfo);
 	break;
     case DS_SUSPEND_CARD:
@@ -971,10 +973,10 @@ static int ds_ioctl(struct inode * inode, struct file * file,
 	ret = pcmcia_resume_card(s->parent);
 	break;
     case DS_EJECT_CARD:
-	ret = pcmcia_eject_card(s->parent);
+	err = pcmcia_eject_card(s->parent);
 	break;
     case DS_INSERT_CARD:
-	ret = pcmcia_insert_card(s->parent);
+	err = pcmcia_insert_card(s->parent);
 	break;
     case DS_ACCESS_CONFIGURATION_REGISTER:
 	if ((buf.conf_reg.Action == CS_WRITE) && !capable(CAP_SYS_ADMIN))
diff --git a/drivers/pcmcia/i82092.c b/drivers/pcmcia/i82092.c
index 69125c3b3..3115eb3bc 100644
--- a/drivers/pcmcia/i82092.c
+++ b/drivers/pcmcia/i82092.c
@@ -420,12 +420,12 @@ static void set_bridge_state(int sock)
 static int i82092aa_init(struct pcmcia_socket *sock)
 {
 	int i;
+	struct resource res = { .start = 0, .end = 0x0fff };
         pccard_io_map io = { 0, 0, 0, 0, 1 };
-        pccard_mem_map mem = { 0, 0, 0, 0, 0, 0 };
+	pccard_mem_map mem = { .res = &res, .sys_stop = 0x0fff, };
         
         enter("i82092aa_init");
                         
-        mem.sys_stop = 0x0fff;
         for (i = 0; i < 2; i++) {
         	io.map = i;
                 i82092aa_set_io_map(sock, &io);
diff --git a/drivers/pcmcia/i82365.c b/drivers/pcmcia/i82365.c
index e98adb10c..b753c3186 100644
--- a/drivers/pcmcia/i82365.c
+++ b/drivers/pcmcia/i82365.c
@@ -65,7 +65,6 @@
 #include "cirrus.h"
 #include "vg468.h"
 #include "ricoh.h"
-#include "o2micro.h"
 
 #ifdef DEBUG
 static const char version[] =
@@ -1308,10 +1307,10 @@ static int pcic_set_mem_map(struct pcmcia_socket *s, struct pccard_mem_map *mem)
 static int pcic_init(struct pcmcia_socket *s)
 {
 	int i;
+	struct resource res = { .start = 0, .end = 0x1000 };
 	pccard_io_map io = { 0, 0, 0, 0, 1 };
-	pccard_mem_map mem = { 0, 0, 0, 0, 0, 0 };
+	pccard_mem_map mem = { .res = &res, .sys_stop = 0x1000, };
 
-	mem.sys_stop = 0x1000;
 	for (i = 0; i < 2; i++) {
 		io.map = i;
 		pcic_set_io_map(s, &io);
@@ -1372,8 +1371,15 @@ static int __init init_i82365(void)
 {
     int i, ret;
 
-    if (driver_register(&i82365_driver))
-	return -1;
+    ret = driver_register(&i82365_driver);
+    if (ret)
+	return ret;
+
+    ret = platform_device_register(&i82365_device);
+    if (ret) {
+	driver_unregister(&i82365_driver);
+	return ret;
+    }
 
     printk(KERN_INFO "Intel ISA PCIC probe: ");
     sockets = 0;
@@ -1382,12 +1388,11 @@ static int __init init_i82365(void)
 
     if (sockets == 0) {
 	printk("not found.\n");
+	platform_device_unregister(&i82365_device);
 	driver_unregister(&i82365_driver);
 	return -ENODEV;
     }
 
-    platform_device_register(&i82365_device);
-
     /* Set up interrupt handler(s) */
     if (grab_irq != 0)
 	request_irq(cs_irq, pcic_interrupt, 0, "i82365", pcic_interrupt);
diff --git a/drivers/pcmcia/o2micro.h b/drivers/pcmcia/o2micro.h
index f4ccd8454..adbe8a724 100644
--- a/drivers/pcmcia/o2micro.h
+++ b/drivers/pcmcia/o2micro.h
@@ -120,4 +120,30 @@
 #define  O2_MODE_E_LED_OUT	0x08
 #define  O2_MODE_E_SKTA_ACTV	0x10
 
+static int o2micro_override(struct yenta_socket *socket)
+{
+	/*
+	 * 'reserved' register at 0x94/D4. chaning it to 0xCA (8 bit) enables
+	 * read prefetching which for example makes the RME Hammerfall DSP
+	 * working. for some bridges it is at 0x94, for others at 0xD4. it's
+	 * ok to write to both registers on all O2 bridges.
+	 * from Eric Still, 02Micro.
+	 */
+	if (PCI_FUNC(socket->dev->devfn) == 0) {
+		config_writeb(socket, 0x94, 0xCA);
+		config_writeb(socket, 0xD4, 0xCA);
+	}
+
+	return 0;
+}
+
+static void o2micro_restore_state(struct yenta_socket *socket)
+{
+	/*
+	 * as long as read prefetch is the only thing in
+	 * o2micro_override, it's safe to call it from here
+	 */
+	o2micro_override(socket);
+}
+
 #endif /* _LINUX_O2MICRO_H */
diff --git a/drivers/pcmcia/pd6729.c b/drivers/pcmcia/pd6729.c
index 694e13f43..57b1bca00 100644
--- a/drivers/pcmcia/pd6729.c
+++ b/drivers/pcmcia/pd6729.c
@@ -28,11 +28,15 @@
 #include "cirrus.h"
 
 MODULE_LICENSE("GPL");
+MODULE_DESCRIPTION("Driver for the Cirrus PD6729 PCI-PCMCIA bridge");
+MODULE_AUTHOR("Jun Komuro <komurojun@mbn.nifty.com>");
 
 #define MAX_SOCKETS 2
 
-/* simple helper functions */
-/* External clock time, in nanoseconds.  120 ns = 8.33 MHz */
+/*
+ * simple helper functions
+ * External clock time, in nanoseconds.  120 ns = 8.33 MHz
+ */
 #define to_cycles(ns)	((ns)/120)
 
 static spinlock_t port_lock = SPIN_LOCK_UNLOCKED;
@@ -225,8 +229,10 @@ static int pd6729_get_status(struct pcmcia_socket *sock, u_int *value)
 		*value |= SS_DETECT;
 	}
 
-	/* IO cards have a different meaning of bits 0,1 */
-	/* Also notice the inverse-logic on the bits */
+	/*
+	 * IO cards have a different meaning of bits 0,1
+	 * Also notice the inverse-logic on the bits
+	 */
 	if (indirect_read(socket, I365_INTCTL) & I365_PC_IOCARD) {
 		/* IO card */
 		if (!(status & I365_CS_STSCHG))
@@ -268,8 +274,10 @@ static int pd6729_get_socket(struct pcmcia_socket *sock, socket_state_t *state)
 	state->io_irq   = 0;
 	state->csc_mask = 0;
 
-	/* First the power status of the socket */
-	/* PCTRL - Power Control Register */
+	/*
+	 * First the power status of the socket
+	 * PCTRL - Power Control Register
+	 */
 	reg = indirect_read(socket, I365_POWER);
 
 	if (reg & I365_PWR_AUTO)
@@ -294,8 +302,10 @@ static int pd6729_get_socket(struct pcmcia_socket *sock, socket_state_t *state)
 			state->Vpp = 120;
 	}
 
-	/* Now the IO card, RESET flags and IO interrupt */
-	/* IGENC, Interrupt and General Control */
+	/*
+	 * Now the IO card, RESET flags and IO interrupt
+	 * IGENC, Interrupt and General Control
+	 */
 	reg = indirect_read(socket, I365_INTCTL);
 
 	if ((reg & I365_PC_RESET) == 0)
@@ -306,8 +316,10 @@ static int pd6729_get_socket(struct pcmcia_socket *sock, socket_state_t *state)
 	/* Set the IRQ number */
 	state->io_irq = socket->socket.pci_irq;
 
-	/* Card status change */
-	/* CSCICR, Card Status Change Interrupt Configuration */
+	/*
+	 * Card status change
+	 * CSCICR, Card Status Change Interrupt Configuration
+	 */
 	reg = indirect_read(socket, I365_CSCINT);
 
 	if (reg & I365_CSC_DETECT)
@@ -610,9 +622,11 @@ static int __devinit pd6729_pci_probe(struct pci_dev *dev, const struct pci_devi
 	printk(KERN_INFO "pd6729: Cirrus PD6729 PCI to PCMCIA Bridge at 0x%lx on irq %d\n",
 		pci_resource_start(dev, 0), dev->irq);
 	printk(KERN_INFO "pd6729: configured as a %d socket device.\n", MAX_SOCKETS);
- 	/* Since we have no memory BARs some firmware we may not
- 	   have had PCI_COMMAND_MEM enabled, yet the device needs
- 	   it. */
+ 	/*
+	 * Since we have no memory BARs some firmware we may not
+	 * have had PCI_COMMAND_MEM enabled, yet the device needs
+	 * it.
+	 */
 	pci_read_config_byte(dev, PCI_COMMAND, &configbyte);
 	if (!(configbyte & PCI_COMMAND_MEMORY)) {
 		printk(KERN_DEBUG "pd6729: Enabling PCI_COMMAND_MEMORY.\n");
diff --git a/drivers/pcmcia/rsrc_mgr.c b/drivers/pcmcia/rsrc_mgr.c
index 2e606be98..6869e209d 100644
--- a/drivers/pcmcia/rsrc_mgr.c
+++ b/drivers/pcmcia/rsrc_mgr.c
@@ -118,7 +118,7 @@ make_resource(unsigned long b, unsigned long n, int flags, char *name)
 		res->name = name;
 		res->start = b;
 		res->end = b + n - 1;
-		res->flags = flags | IORESOURCE_BUSY;
+		res->flags = flags;
 	}
 	return res;
 }
@@ -303,6 +303,7 @@ static int readable(struct pcmcia_socket *s, struct resource *res, cisinfo_t *in
 
 	s->cis_mem.sys_start = res->start;
 	s->cis_mem.sys_stop = res->end;
+	s->cis_mem.res = res;
 	s->cis_virt = ioremap(res->start, s->map_size);
 	if (s->cis_virt) {
 		ret = pcmcia_validate_cis(s->clients, info);
@@ -313,6 +314,7 @@ static int readable(struct pcmcia_socket *s, struct resource *res, cisinfo_t *in
 	}
 	s->cis_mem.sys_start = 0;
 	s->cis_mem.sys_stop = 0;
+	s->cis_mem.res = NULL;
 	if ((ret != 0) || (info->Chains == 0))
 		return 0;
 	return 1;
@@ -332,6 +334,7 @@ static int checksum(struct pcmcia_socket *s, struct resource *res)
 		map.speed = 0;
 		map.sys_start = res->start;
 		map.sys_stop = res->end;
+		map.res = res;
 		map.card_start = 0;
 		s->ops->set_mem_map(s, &map);
 
@@ -454,7 +457,7 @@ static u_long inv_probe(resource_map_t *m, struct pcmcia_socket *s)
     return do_mem_probe(m->base, m->num, s);
 }
 
-void validate_mem(struct pcmcia_socket *s)
+static void validate_mem(struct pcmcia_socket *s)
 {
     resource_map_t *m, mm;
     static u_char order[] = { 0xd0, 0xe0, 0xc0, 0xf0 };
@@ -462,9 +465,6 @@ void validate_mem(struct pcmcia_socket *s)
     u_long b, i, ok = 0;
     int force_low = !(s->features & SS_CAP_PAGE_REGS);
 
-    if (!probe_mem)
-	return;
-
     down(&rsrc_sem);
     /* We do up to four passes through the list */
     if (!force_low) {
@@ -500,12 +500,12 @@ void validate_mem(struct pcmcia_socket *s)
 
 #else /* CONFIG_PCMCIA_PROBE */
 
-void validate_mem(struct pcmcia_socket *s)
+static void validate_mem(struct pcmcia_socket *s)
 {
     resource_map_t *m, mm;
     static int done = 0;
     
-    if (probe_mem && done++ == 0) {
+    if (done++ == 0) {
 	down(&rsrc_sem);
 	for (m = mem_db.next; m != &mem_db; m = mm.next) {
 	    mm = *m;
@@ -518,6 +518,18 @@ void validate_mem(struct pcmcia_socket *s)
 
 #endif /* CONFIG_PCMCIA_PROBE */
 
+void pcmcia_validate_mem(struct pcmcia_socket *s)
+{
+	down(&s->skt_sem);
+
+	if (probe_mem && s->state & SOCKET_PRESENT)
+		validate_mem(s);
+
+	up(&s->skt_sem);
+}
+
+EXPORT_SYMBOL(pcmcia_validate_mem);
+
 struct pcmcia_align_data {
 	unsigned long	mask;
 	unsigned long	offset;
@@ -622,7 +634,7 @@ int adjust_io_region(struct resource *res, unsigned long r_start,
 struct resource *find_io_region(unsigned long base, int num,
 		   unsigned long align, char *name, struct pcmcia_socket *s)
 {
-	struct resource *res = make_resource(0, num, IORESOURCE_IO, name);
+	struct resource *res = make_resource(0, num, IORESOURCE_IO, s->dev.class_id);
 	struct pcmcia_align_data data;
 	unsigned long min = base;
 	int ret;
@@ -641,8 +653,8 @@ struct resource *find_io_region(unsigned long base, int num,
 					     min, 0, pcmcia_align, &data);
 	} else
 #endif
-		ret = allocate_resource(&ioport_resource, res, num, min, ~0UL, 0,
-					pcmcia_align, &data);
+		ret = allocate_resource(&ioport_resource, res, num, min, ~0UL,
+					1, pcmcia_align, &data);
 	up(&rsrc_sem);
 
 	if (ret != 0) {
@@ -652,10 +664,10 @@ struct resource *find_io_region(unsigned long base, int num,
 	return res;
 }
 
-int find_mem_region(u_long *base, u_long num, u_long align,
-		    int low, char *name, struct pcmcia_socket *s)
+struct resource *find_mem_region(u_long base, u_long num, u_long align,
+				 int low, char *name, struct pcmcia_socket *s)
 {
-	struct resource *res = make_resource(0, num, IORESOURCE_MEM, name);
+	struct resource *res = make_resource(0, num, IORESOURCE_MEM, s->dev.class_id);
 	struct pcmcia_align_data data;
 	unsigned long min, max;
 	int ret, i;
@@ -663,16 +675,16 @@ int find_mem_region(u_long *base, u_long num, u_long align,
 	low = low || !(s->features & SS_CAP_PAGE_REGS);
 
 	data.mask = align - 1;
-	data.offset = *base & data.mask;
+	data.offset = base & data.mask;
 	data.map = &mem_db;
 
 	for (i = 0; i < 2; i++) {
 		if (low) {
 			max = 0x100000UL;
-			min = *base < max ? *base : 0;
+			min = base < max ? base : 0;
 		} else {
 			max = ~0UL;
-			min = 0x100000UL + *base;
+			min = 0x100000UL + base;
 		}
 
 		down(&rsrc_sem);
@@ -684,7 +696,7 @@ int find_mem_region(u_long *base, u_long num, u_long align,
 		} else
 #endif
 			ret = allocate_resource(&iomem_resource, res, num, min,
-						max, 0, pcmcia_align, &data);
+						max, 1, pcmcia_align, &data);
 		up(&rsrc_sem);
 		if (ret == 0 || low)
 			break;
@@ -693,10 +705,9 @@ int find_mem_region(u_long *base, u_long num, u_long align,
 
 	if (ret != 0) {
 		kfree(res);
-	} else {
-		*base = res->start;
+		res = NULL;
 	}
-	return ret;
+	return res;
 }
 
 /*======================================================================
diff --git a/drivers/pcmcia/sa1100_generic.c b/drivers/pcmcia/sa1100_generic.c
index ceeed4fb4..0efa9c6e7 100644
--- a/drivers/pcmcia/sa1100_generic.c
+++ b/drivers/pcmcia/sa1100_generic.c
@@ -29,10 +29,6 @@
     file under either the MPL or the GPL.
     
 ======================================================================*/
-/*
- * Please see linux/Documentation/arm/SA1100/PCMCIA for more information
- * on the low-level kernel interface.
- */
 
 #include <linux/module.h>
 #include <linux/init.h>
diff --git a/drivers/pcmcia/tcic.c b/drivers/pcmcia/tcic.c
index 367222170..f3b38e96d 100644
--- a/drivers/pcmcia/tcic.c
+++ b/drivers/pcmcia/tcic.c
@@ -868,10 +868,10 @@ static int tcic_set_mem_map(struct pcmcia_socket *sock, struct pccard_mem_map *m
 static int tcic_init(struct pcmcia_socket *s)
 {
 	int i;
+	struct resource res = { .start = 0, .end = 0x1000 };
 	pccard_io_map io = { 0, 0, 0, 0, 1 };
-	pccard_mem_map mem = { 0, 0, 0, 0, 0, 0 };
+	pccard_mem_map mem = { .res = &res, .sys_stop = 0x1000, };
 
-	mem.sys_stop = 0x1000;
 	for (i = 0; i < 2; i++) {
 		io.map = i;
 		tcic_set_io_map(s, &io);
diff --git a/drivers/pcmcia/yenta_socket.c b/drivers/pcmcia/yenta_socket.c
index 767b2c1a2..4c8a7a572 100644
--- a/drivers/pcmcia/yenta_socket.c
+++ b/drivers/pcmcia/yenta_socket.c
@@ -445,10 +445,10 @@ static void yenta_interrupt_wrapper(unsigned long data)
 static void yenta_clear_maps(struct yenta_socket *socket)
 {
 	int i;
+	struct resource res = { .start = 0, .end = 0x0fff };
 	pccard_io_map io = { 0, 0, 0, 0, 1 };
-	pccard_mem_map mem = { 0, 0, 0, 0, 0, 0 };
+	pccard_mem_map mem = { .res = &res, .sys_stop = 0x0fff, };
 
-	mem.sys_stop = 0x0fff;
 	yenta_set_socket(&socket->socket, &dead_socket);
 	for (i = 0; i < 2; i++) {
 		io.map = i;
@@ -668,6 +668,7 @@ static struct pccard_operations yenta_socket_operations = {
 #include "ti113x.h"
 #include "ricoh.h"
 #include "topic.h"
+#include "o2micro.h"
 
 enum {
 	CARDBUS_TYPE_DEFAULT = -1,
@@ -676,7 +677,8 @@ enum {
 	CARDBUS_TYPE_TI12XX,
 	CARDBUS_TYPE_TI1250,
 	CARDBUS_TYPE_RICOH,
-	CARDBUS_TYPE_TOPIC97
+	CARDBUS_TYPE_TOPIC97,
+	CARDBUS_TYPE_O2MICRO,
 };
 
 /*
@@ -716,6 +718,10 @@ struct cardbus_type cardbus_type[] = {
 	[CARDBUS_TYPE_TOPIC97]	= {
 		.override	= topic97_override,
 	},
+	[CARDBUS_TYPE_O2MICRO]	= {
+		.override	= o2micro_override,
+		.restore_state	= o2micro_restore_state,
+	},
 };
 
 
@@ -1100,6 +1106,8 @@ static struct pci_device_id yenta_table [] = {
 	CB_ID(PCI_VENDOR_ID_TOSHIBA, PCI_DEVICE_ID_TOSHIBA_TOPIC97, TOPIC97),
 	CB_ID(PCI_VENDOR_ID_TOSHIBA, PCI_DEVICE_ID_TOSHIBA_TOPIC100, TOPIC97),
 
+	CB_ID(PCI_VENDOR_ID_O2, PCI_ANY_ID, O2MICRO),
+
 	/* match any cardbus bridge */
 	CB_ID(PCI_ANY_ID, PCI_ANY_ID, DEFAULT),
 	{ /* all zeroes */ }
diff --git a/drivers/pnp/isapnp/core.c b/drivers/pnp/isapnp/core.c
index 5adaac670..ee6d1ed50 100644
--- a/drivers/pnp/isapnp/core.c
+++ b/drivers/pnp/isapnp/core.c
@@ -68,13 +68,8 @@ MODULE_PARM(isapnp_verbose, "i");
 MODULE_PARM_DESC(isapnp_verbose, "ISA Plug & Play verbose mode");
 MODULE_LICENSE("GPL");
 
-#ifdef CONFIG_X86_PC9800
-#define _PIDXR		0x259
-#define _PNPWRP		0xa59
-#else
 #define _PIDXR		0x279
 #define _PNPWRP		0xa79
-#endif
 
 /* short tags */
 #define _STAG_PNPVERNO		0x01
diff --git a/drivers/pnp/pnpbios/bioscalls.c b/drivers/pnp/pnpbios/bioscalls.c
index 2ac20b58b..c224f74fa 100644
--- a/drivers/pnp/pnpbios/bioscalls.c
+++ b/drivers/pnp/pnpbios/bioscalls.c
@@ -260,7 +260,7 @@ static int __pnp_bios_dev_node_info(struct pnp_dev_node_info *data)
 	if (!pnp_bios_present())
 		return PNP_FUNCTION_NOT_SUPPORTED;
 	status = call_pnp_bios(PNP_GET_NUM_SYS_DEV_NODES, 0, PNP_TS1, 2, PNP_TS1, PNP_DS, 0, 0,
-			       data, sizeof(struct pnp_dev_node_info), 0, 0);
+			       data, sizeof(struct pnp_dev_node_info), NULL, 0);
 	data->no_nodes &= 0xff;
 	return status;
 }
@@ -323,7 +323,7 @@ static int __pnp_bios_set_dev_node(u8 nodenum, char boot, struct pnp_bios_node *
 	if ( !boot && pnpbios_dont_use_current_config )
 		return PNP_FUNCTION_NOT_SUPPORTED;
 	status = call_pnp_bios(PNP_SET_SYS_DEV_NODE, nodenum, 0, PNP_TS1, boot ? 2 : 1, PNP_DS, 0, 0,
-			       data, 65536, 0, 0);
+			       data, 65536, NULL, 0);
 	return status;
 }
 
@@ -353,7 +353,7 @@ static int pnp_bios_get_event(u16 *event)
 	if (!pnp_bios_present())
 		return PNP_FUNCTION_NOT_SUPPORTED;
 	status = call_pnp_bios(PNP_GET_EVENT, 0, PNP_TS1, PNP_DS, 0, 0 ,0 ,0,
-			       event, sizeof(u16), 0, 0);
+			       event, sizeof(u16), NULL, 0);
 	return status;
 }
 #endif
@@ -381,7 +381,7 @@ int pnp_bios_dock_station_info(struct pnp_docking_station_info *data)
 	if (!pnp_bios_present())
 		return PNP_FUNCTION_NOT_SUPPORTED;
 	status = call_pnp_bios(PNP_GET_DOCKING_STATION_INFORMATION, 0, PNP_TS1, PNP_DS, 0, 0, 0, 0,
-			       data, sizeof(struct pnp_docking_station_info), 0, 0);
+			       data, sizeof(struct pnp_docking_station_info), NULL, 0);
 	return status;
 }
 
@@ -411,7 +411,7 @@ static int __pnp_bios_get_stat_res(char *info)
 	if (!pnp_bios_present())
 		return PNP_FUNCTION_NOT_SUPPORTED;
 	status = call_pnp_bios(PNP_GET_STATIC_ALLOCED_RES_INFO, 0, PNP_TS1, PNP_DS, 0, 0, 0, 0,
-			       info, 65536, 0, 0);
+			       info, 65536, NULL, 0);
 	return status;
 }
 
@@ -448,7 +448,7 @@ static int __pnp_bios_isapnp_config(struct pnp_isa_config_struc *data)
 	if (!pnp_bios_present())
 		return PNP_FUNCTION_NOT_SUPPORTED;
 	status = call_pnp_bios(PNP_GET_PNP_ISA_CONFIG_STRUC, 0, PNP_TS1, PNP_DS, 0, 0, 0, 0,
-			       data, sizeof(struct pnp_isa_config_struc), 0, 0);
+			       data, sizeof(struct pnp_isa_config_struc), NULL, 0);
 	return status;
 }
 
@@ -470,7 +470,7 @@ static int __pnp_bios_escd_info(struct escd_info_struc *data)
 	if (!pnp_bios_present())
 		return ESCD_FUNCTION_NOT_SUPPORTED;
 	status = call_pnp_bios(PNP_GET_ESCD_INFO, 0, PNP_TS1, 2, PNP_TS1, 4, PNP_TS1, PNP_DS,
-			       data, sizeof(struct escd_info_struc), 0, 0);
+			       data, sizeof(struct escd_info_struc), NULL, 0);
 	return status;
 }
 
diff --git a/drivers/pnp/pnpbios/core.c b/drivers/pnp/pnpbios/core.c
index dd1bbb89c..6c9866346 100644
--- a/drivers/pnp/pnpbios/core.c
+++ b/drivers/pnp/pnpbios/core.c
@@ -59,6 +59,7 @@
 #include <linux/kmod.h>
 #include <linux/completion.h>
 #include <linux/spinlock.h>
+#include <linux/dmi.h>
 
 #include <asm/page.h>
 #include <asm/desc.h>
@@ -129,7 +130,7 @@ static int pnp_dock_event(int dock, struct pnp_docking_station_info *info)
 	/* only one standardized param to hotplug command: type */
 	argv [0] = hotplug_path;
 	argv [1] = "dock";
-	argv [2] = 0;
+	argv [2] = NULL;
 
 	/* minimal command environment */
 	envp [i++] = "HOME=/";
@@ -152,7 +153,7 @@ static int pnp_dock_event(int dock, struct pnp_docking_station_info *info)
 	envp [i++] = scratch;
 	scratch += sprintf (scratch, "DOCK=%x/%x/%x",
 		info->location_id, info->serial, info->capabilities);
-	envp[i] = 0;
+	envp[i] = NULL;
 	
 	value = call_usermodehelper (argv [0], argv, envp, 0);
 	kfree (buf);
@@ -498,10 +499,39 @@ int __init pnpbios_probe_system(void)
 	return 0;
 }
 
+static int __init exploding_pnp_bios(struct dmi_system_id *d)
+{
+	printk(KERN_WARNING "%s detected. Disabling PnPBIOS\n", d->ident);
+	return 0;
+}
+
+static struct dmi_system_id pnpbios_dmi_table[] = {
+	{	/* PnPBIOS GPF on boot */
+		.callback = exploding_pnp_bios,
+		.ident = "Higraded P14H",
+		.matches = {
+			DMI_MATCH(DMI_BIOS_VENDOR, "American Megatrends Inc."),
+			DMI_MATCH(DMI_BIOS_VERSION, "07.00T"),
+			DMI_MATCH(DMI_SYS_VENDOR, "Higraded"),
+			DMI_MATCH(DMI_PRODUCT_NAME, "P14H"),
+		},
+	},
+	{	/* PnPBIOS GPF on boot */
+		.callback = exploding_pnp_bios,
+		.ident = "ASUS P4P800",
+		.matches = {
+			DMI_MATCH(DMI_BOARD_VENDOR, "ASUSTeK Computer Inc."),
+			DMI_MATCH(DMI_BOARD_NAME, "P4P800"),
+		},
+	},
+	{ }
+};
+
 int __init pnpbios_init(void)
 {
 	int ret;
-	if(pnpbios_disabled || (dmi_broken & BROKEN_PNP_BIOS)) {
+
+	if (pnpbios_disabled || dmi_check_system(pnpbios_dmi_table)) {
 		printk(KERN_INFO "PnPBIOS: Disabled\n");
 		return -ENODEV;
 	}
diff --git a/drivers/s390/block/dasd.c b/drivers/s390/block/dasd.c
index 6997d61dc..2249b7848 100644
--- a/drivers/s390/block/dasd.c
+++ b/drivers/s390/block/dasd.c
@@ -7,7 +7,7 @@
  * Bugreports.to..: <Linux390@de.ibm.com>
  * (C) IBM Corporation, IBM Deutschland Entwicklung GmbH, 1999-2001
  *
- * $Revision: 1.142 $
+ * $Revision: 1.147 $
  */
 
 #include <linux/config.h>
@@ -623,8 +623,6 @@ dasd_kfree_request(struct dasd_ccw_req * cqr, struct dasd_device * device)
 		clear_normalized_cda(ccw);
 	} while (ccw++->flags & (CCW_FLAG_CC | CCW_FLAG_DC));
 #endif
-	if (cqr->dstat != NULL)
-		kfree(cqr->dstat);
 	debug_text_event ( dasd_debug_area, 1, "FREE");
 	debug_int_event ( dasd_debug_area, 1, (long) cqr);
 	if (cqr->cpaddr != NULL)
@@ -640,8 +638,6 @@ dasd_sfree_request(struct dasd_ccw_req * cqr, struct dasd_device * device)
 {
 	unsigned long flags;
 
-	if (cqr->dstat != NULL)
-		kfree(cqr->dstat);
 	debug_text_event(dasd_debug_area, 1, "FREE");
 	debug_int_event(dasd_debug_area, 1, (long) cqr);
 	spin_lock_irqsave(&device->mem_lock, flags);
@@ -673,7 +669,8 @@ dasd_check_cqr(struct dasd_ccw_req *cqr)
 }
 
 /*
- * Terminate the current i/o and set the request to failed.
+ * Terminate the current i/o and set the request to clear_pending.
+ * Timer keeps device runnig.
  * ccw_device_clear can fail if the i/o subsystem
  * is in a bad mood.
  */
@@ -695,7 +692,7 @@ dasd_term_IO(struct dasd_ccw_req * cqr)
 		case 0:	/* termination successful */
 		        if (cqr->retries > 0) {
 				cqr->retries--;
-				cqr->status = DASD_CQR_QUEUED;
+				cqr->status = DASD_CQR_CLEAR;
 			} else
 				cqr->status = DASD_CQR_FAILED;
 			cqr->stopclk = get_clock();
@@ -742,8 +739,16 @@ dasd_start_IO(struct dasd_ccw_req * cqr)
 	if (rc)
 		return rc;
 	device = (struct dasd_device *) cqr->device;
+	if (cqr->retries < 0) {
+		DEV_MESSAGE(KERN_DEBUG, device,
+			    "start_IO: request %p (%02x/%i) - no retry left.",
+			    cqr, cqr->status, cqr->retries);
+		cqr->status = DASD_CQR_FAILED;
+		return -EIO;
+	}
 	cqr->startclk = get_clock();
 	cqr->starttime = jiffies;
+	cqr->retries--;
 	rc = ccw_device_start(device->cdev, cqr->cpaddr, (long) cqr,
 			      cqr->lpm, 0);
 	switch (rc) {
@@ -826,41 +831,6 @@ dasd_clear_timer(struct dasd_device *device)
 		del_timer(&device->timer);
 }
 
-/*
- *   Handles the state change pending interrupt.
- */
-static void
-do_state_change_pending(void *data)
-{
-	struct {
-		struct work_struct work;
-		struct dasd_device *device;
-	} *p;
-	struct dasd_device *device;
-	struct dasd_ccw_req *cqr;
-	struct list_head *l, *n;
-	unsigned long flags;
-
-	p = data;
-	device = p->device;
-	DBF_EVENT(DBF_NOTICE, "State change Interrupt for bus_id %s",
-		  device->cdev->dev.bus_id);
-	device->stopped &= ~DASD_STOPPED_PENDING;
-
-        /* restart all 'running' IO on queue */
-	spin_lock_irqsave(get_ccwdev_lock(device->cdev), flags);
-	list_for_each_safe(l, n, &device->ccw_queue) {
-		cqr = list_entry(l, struct dasd_ccw_req, list);
-                if (cqr->status == DASD_CQR_IN_IO)
-                        cqr->status = DASD_CQR_QUEUED;
-        }
-	spin_unlock_irqrestore(get_ccwdev_lock(device->cdev), flags);
-	dasd_set_timer (device, 0);
-	dasd_schedule_bh(device);
-	dasd_put_device(device);
-	kfree(p);
-}
-
 static void
 dasd_handle_killed_request(struct ccw_device *cdev, unsigned long intparm)
 {
@@ -896,19 +866,20 @@ dasd_handle_killed_request(struct ccw_device *cdev, unsigned long intparm)
 static void
 dasd_handle_state_change_pending(struct dasd_device *device)
 {
-	struct {
-		struct work_struct work;
-		struct dasd_device *device;
-	} *p;
+	struct dasd_ccw_req *cqr;
+	struct list_head *l, *n;
 
-	p = kmalloc(sizeof(*p), GFP_ATOMIC);
-	if (p == NULL)
-		/* No memory, let the timeout do the reactivation. */
-		return;
-	INIT_WORK(&p->work, (void *) do_state_change_pending, p);
-	p->device = device;
-	dasd_get_device(device);
-	schedule_work(&p->work);
+	device->stopped &= ~DASD_STOPPED_PENDING;
+
+        /* restart all 'running' IO on queue */
+	list_for_each_safe(l, n, &device->ccw_queue) {
+		cqr = list_entry(l, struct dasd_ccw_req, list);
+                if (cqr->status == DASD_CQR_IN_IO) {
+                        cqr->status = DASD_CQR_QUEUED;
+		}
+        }
+	dasd_clear_timer(device);
+	dasd_schedule_bh(device);
 }
 
 /*
@@ -944,8 +915,9 @@ dasd_int_handler(struct ccw_device *cdev, unsigned long intparm,
 
 	now = get_clock();
 
-	DBF_EVENT(DBF_DEBUG, "Interrupt: stat %02x, bus_id %s",
-		  irb->scsw.dstat, cdev->dev.bus_id);
+	DBF_EVENT(DBF_ERR, "Interrupt: bus_id %s CS/DS %04x ip %08x",
+		  cdev->dev.bus_id, ((irb->scsw.cstat<<8)|irb->scsw.dstat),
+		  (unsigned int) intparm);
 
 	/* first of all check for state change pending interrupt */
 	mask = DEV_STAT_ATTENTION | DEV_STAT_DEV_END | DEV_STAT_UNIT_EXCEP;
@@ -959,14 +931,12 @@ dasd_int_handler(struct ccw_device *cdev, unsigned long intparm,
 	}
 
 	cqr = (struct dasd_ccw_req *) intparm;
-	/*
-	 * check status - the request might have been killed
-	 * because of dyn detach
-	 */
-	if (cqr->status != DASD_CQR_IN_IO) {
+
+	/* check for unsolicited interrupts */
+	if (cqr == NULL) {
 		MESSAGE(KERN_DEBUG,
-			"invalid status: bus_id %s, status %02x",
-			cdev->dev.bus_id, cqr->status);
+			"unsolicited interrupt received: bus_id %s",
+			cdev->dev.bus_id);
 		return;
 	}
 
@@ -978,6 +948,22 @@ dasd_int_handler(struct ccw_device *cdev, unsigned long intparm,
 		return;
 	}
 
+	/* Check for clear pending */
+	if (cqr->status == DASD_CQR_CLEAR &&
+	    irb->scsw.fctl & SCSW_FCTL_CLEAR_FUNC) {
+		cqr->status = DASD_CQR_QUEUED;
+		dasd_clear_timer(device);
+		dasd_schedule_bh(device);
+		return;
+	}
+
+ 	/* check status - the request might have been killed by dyn detach */
+	if (cqr->status != DASD_CQR_IN_IO) {
+		MESSAGE(KERN_DEBUG,
+			"invalid status: bus_id %s, status %02x",
+			cdev->dev.bus_id, cqr->status);
+		return;
+	}
 	DBF_DEV_EVENT(DBF_DEBUG, device, "Int: CS/DS 0x%04x",
 		      ((irb->scsw.cstat << 8) | irb->scsw.dstat));
 
@@ -1015,13 +1001,7 @@ dasd_int_handler(struct ccw_device *cdev, unsigned long intparm,
 			}
 		}
 	} else {		/* error */
-		if (cqr->dstat == NULL)
-			cqr->dstat = kmalloc(sizeof(struct irb), GFP_ATOMIC);
-		if (cqr->dstat)
-			memcpy(cqr->dstat, irb, sizeof (struct irb));
-		else
-			DEV_MESSAGE(KERN_ERR, device, "%s",
-				    "no memory for dstat...ignoring");
+		memcpy(&cqr->irb, irb, sizeof (struct irb));
 #ifdef ERP_DEBUG
 		/* dump sense data */
 		dasd_log_sense(cqr, irb);
@@ -1095,12 +1075,11 @@ restart:
 			break;
 		/*  Process requests with DASD_CQR_ERROR */
 		if (cqr->status == DASD_CQR_ERROR) {
-			cqr->retries--;
-			if (cqr->dstat->scsw.fctl & SCSW_FCTL_HALT_FUNC) {
+			if (cqr->irb.scsw.fctl & SCSW_FCTL_HALT_FUNC) {
 				cqr->status = DASD_CQR_FAILED;
 				cqr->stopclk = get_clock();
 			} else {
-				if (cqr->dstat->esw.esw0.erw.cons) {
+				if (cqr->irb.esw.esw0.erw.cons) {
 					erp_fn = device->discipline->erp_action(cqr);
 					erp_fn(cqr);
 				} else
@@ -1221,8 +1200,8 @@ __dasd_check_expire(struct dasd_device * device)
 	if (cqr->status == DASD_CQR_IN_IO && cqr->expires != 0) {
 		if (time_after_eq(jiffies, cqr->expires + cqr->starttime)) {
 			if (device->discipline->term_IO(cqr) != 0)
-				/* Hmpf, try again in 1/100 sec */
-				dasd_set_timer(device, 1);
+				/* Hmpf, try again in 1/10 sec */
+				dasd_set_timer(device, 10);
 		}
 	}
 }
@@ -1246,9 +1225,9 @@ __dasd_start_head(struct dasd_device * device)
 		rc = device->discipline->start_IO(cqr);
 		if (rc == 0)
 			dasd_set_timer(device, cqr->expires);
-		else if (rc == -EBUSY)
-				/* Hmpf, try again in 1/100 sec */
-			dasd_set_timer(device, 1);
+		else
+			/* Hmpf, try again in 1/2 sec */
+			dasd_set_timer(device, 50);
 	}
 }
 
@@ -1980,7 +1959,7 @@ dasd_init(void)
 
 	init_waitqueue_head(&dasd_init_waitq);
 
-	/* register 'common' DASD debug area, used faor all DBF_XXX calls */
+	/* register 'common' DASD debug area, used for all DBF_XXX calls */
 	dasd_debug_area = debug_register("dasd", 0, 2, 8 * sizeof (long));
 	if (dasd_debug_area == NULL) {
 		rc = -ENOMEM;
diff --git a/drivers/s390/block/dasd_3990_erp.c b/drivers/s390/block/dasd_3990_erp.c
index e90c1c93e..680f2e4d9 100644
--- a/drivers/s390/block/dasd_3990_erp.c
+++ b/drivers/s390/block/dasd_3990_erp.c
@@ -5,7 +5,7 @@
  * Bugreports.to..: <Linux390@de.ibm.com>
  * (C) IBM Corporation, IBM Deutschland Entwicklung GmbH, 2000, 2001
  *
- * $Revision: 1.30 $
+ * $Revision: 1.33 $
  */
 
 #include <linux/timer.h>
@@ -301,15 +301,15 @@ dasd_3990_erp_alternate_path(struct dasd_ccw_req * erp)
 	opm = ccw_device_get_path_mask(device->cdev);
 	//FIXME: start with get_opm ?
 	if (erp->lpm == 0)
-		erp->lpm = LPM_ANYPATH & ~(erp->dstat->esw.esw0.sublog.lpum);
+		erp->lpm = LPM_ANYPATH & ~(erp->irb.esw.esw0.sublog.lpum);
 	else
-		erp->lpm &= ~(erp->dstat->esw.esw0.sublog.lpum);
+		erp->lpm &= ~(erp->irb.esw.esw0.sublog.lpum);
 
 	if ((erp->lpm & opm) != 0x00) {
 
 		DEV_MESSAGE(KERN_DEBUG, device,
 			    "try alternate lpm=%x (lpum=%x / opm=%x)",
-			    erp->lpm, erp->dstat->esw.esw0.sublog.lpum, opm);
+			    erp->lpm, erp->irb.esw.esw0.sublog.lpum, opm);
 
 		/* reset status to queued to handle the request again... */
 		if (erp->status > DASD_CQR_QUEUED)
@@ -319,7 +319,7 @@ dasd_3990_erp_alternate_path(struct dasd_ccw_req * erp)
 		DEV_MESSAGE(KERN_ERR, device,
 			    "No alternate channel path left (lpum=%x / "
 			    "opm=%x) -> permanent error",
-			    erp->dstat->esw.esw0.sublog.lpum, opm);
+			    erp->irb.esw.esw0.sublog.lpum, opm);
 
 		/* post request with permanent error */
 		if (erp->status > DASD_CQR_QUEUED)
@@ -443,6 +443,10 @@ dasd_3990_erp_action_4(struct dasd_ccw_req * erp, char *sense)
 	/* interrupt (this enables easier enqueing of the cqr)	    */
 	if (erp->function != dasd_3990_erp_action_4) {
 
+		DEV_MESSAGE(KERN_INFO, device,
+			    "dasd_3990_erp_action_4: first time retry"
+			    "%s", " ");
+
 		erp->retries = 256;
 		erp->function = dasd_3990_erp_action_4;
 
@@ -1677,7 +1681,7 @@ dasd_3990_erp_action_1B_32(struct dasd_ccw_req * default_erp, char *sense)
 
 	/* determine the address of the CCW to be restarted */
 	/* Imprecise ending is not set -> addr from IRB-SCSW */
-	cpa = default_erp->refers->dstat->scsw.cpa;
+	cpa = default_erp->refers->irb.scsw.cpa;
 
 	if (cpa == 0) {
 
@@ -1763,7 +1767,7 @@ dasd_3990_erp_action_1B_32(struct dasd_ccw_req * default_erp, char *sense)
 	erp->magic = default_erp->magic;
 	erp->expires = 0;
 	erp->retries = 256;
-	cqr->buildclk = get_clock();
+	erp->buildclk = get_clock();
 	erp->status = DASD_CQR_FILLED;
 
 	/* remove the default erp */
@@ -1823,7 +1827,7 @@ dasd_3990_update_1B(struct dasd_ccw_req * previous_erp, char *sense)
 
 	/* determine the address of the CCW to be restarted */
 	/* Imprecise ending is not set -> addr from IRB-SCSW */
-	cpa = previous_erp->dstat->scsw.cpa;
+	cpa = previous_erp->irb.scsw.cpa;
 
 	if (cpa == 0) {
 
@@ -2233,7 +2237,7 @@ dasd_3990_erp_inspect(struct dasd_ccw_req * erp)
 	struct dasd_ccw_req *erp_new = NULL;
 	/* sense data are located in the refers record of the */
 	/* already set up new ERP !			      */
-	char *sense = erp->refers->dstat->ecw;
+	char *sense = erp->refers->irb.ecw;
 
 	/* distinguish between 24 and 32 byte sense data */
 	if (sense[27] & DASD_SENSE_BIT_0) {
@@ -2306,6 +2310,7 @@ dasd_3990_erp_add_erp(struct dasd_ccw_req * cqr)
 	erp->magic    = cqr->magic;
 	erp->expires  = 0;
 	erp->retries  = 256;
+	erp->buildclk = get_clock();
 
 	erp->status = DASD_CQR_FILLED;
 
@@ -2369,14 +2374,14 @@ dasd_3990_erp_error_match(struct dasd_ccw_req *cqr1, struct dasd_ccw_req *cqr2)
 {
 
 	/* check failed CCW */
-	if (cqr1->dstat->scsw.cpa != cqr2->dstat->scsw.cpa) {
+	if (cqr1->irb.scsw.cpa != cqr2->irb.scsw.cpa) {
 		//	return 0;	/* CCW doesn't match */
 	}
 
 	/* check sense data; byte 0-2,25,27 */
-	if (!((memcmp (cqr1->dstat->ecw, cqr2->dstat->ecw, 3) == 0) &&
-	      (cqr1->dstat->ecw[27] == cqr2->dstat->ecw[27]) &&
-	      (cqr1->dstat->ecw[25] == cqr2->dstat->ecw[25]))) {
+	if (!((memcmp (cqr1->irb.ecw, cqr2->irb.ecw, 3) == 0) &&
+	      (cqr1->irb.ecw[27] == cqr2->irb.ecw[27]) &&
+	      (cqr1->irb.ecw[25] == cqr2->irb.ecw[25]))) {
 
 		return 0;	/* sense doesn't match */
 	}
@@ -2449,7 +2454,7 @@ dasd_3990_erp_further_erp(struct dasd_ccw_req *erp)
 {
 
 	struct dasd_device *device = erp->device;
-	char *sense = erp->dstat->ecw;
+	char *sense = erp->irb.ecw;
 
 	/* check for 24 byte sense ERP */
 	if ((erp->function == dasd_3990_erp_bus_out) ||
@@ -2562,7 +2567,7 @@ dasd_3990_erp_handle_match_erp(struct dasd_ccw_req *erp_head,
 
 	if (erp->retries > 0) {
 
-		char *sense = erp->refers->dstat->ecw;
+		char *sense = erp->refers->irb.ecw;
 
 		/* check for special retries */
 		if (erp->function == dasd_3990_erp_action_4) {
@@ -2620,7 +2625,7 @@ dasd_3990_erp_action(struct dasd_ccw_req * cqr)
 
 	struct dasd_ccw_req *erp = NULL;
 	struct dasd_device *device = cqr->device;
-	__u32 cpa = cqr->dstat->scsw.cpa;
+	__u32 cpa = cqr->irb.scsw.cpa;
 
 #ifdef ERP_DEBUG
 	/* print current erp_chain */
@@ -2641,8 +2646,8 @@ dasd_3990_erp_action(struct dasd_ccw_req * cqr)
 #endif				/* ERP_DEBUG */
 
 	/* double-check if current erp/cqr was successfull */
-	if ((cqr->dstat->scsw.cstat == 0x00) &&
-	    (cqr->dstat->scsw.dstat == (DEV_STAT_CHN_END|DEV_STAT_DEV_END))) {
+	if ((cqr->irb.scsw.cstat == 0x00) &&
+	    (cqr->irb.scsw.dstat == (DEV_STAT_CHN_END|DEV_STAT_DEV_END))) {
 
 		DEV_MESSAGE(KERN_DEBUG, device,
 			    "ERP called for successful request %p"
@@ -2653,7 +2658,7 @@ dasd_3990_erp_action(struct dasd_ccw_req * cqr)
 		return cqr;
 	}
 	/* check if sense data are available */
-	if (!cqr->dstat->ecw) {
+	if (!cqr->irb.ecw) {
 		DEV_MESSAGE(KERN_DEBUG, device,
 			    "ERP called witout sense data avail ..."
 			    "request %p - NO ERP possible", cqr);
diff --git a/drivers/s390/block/dasd_devmap.c b/drivers/s390/block/dasd_devmap.c
index 5ea567ee2..812bb0066 100644
--- a/drivers/s390/block/dasd_devmap.c
+++ b/drivers/s390/block/dasd_devmap.c
@@ -11,7 +11,7 @@
  * functions may not be called from interrupt context. In particular
  * dasd_get_device is a no-no from interrupt context.
  *
- * $Revision: 1.28 $
+ * $Revision: 1.30 $
  */
 
 #include <linux/config.h>
@@ -430,16 +430,9 @@ dasd_devmap_from_cdev(struct ccw_device *cdev)
 {
 	struct dasd_devmap *devmap;
 
-	if (cdev->dev.driver_data)
-		return (struct dasd_devmap *) cdev->dev.driver_data;
 	devmap = dasd_find_busid(cdev->dev.bus_id);
-	if (!IS_ERR(devmap)) {
-		cdev->dev.driver_data = devmap;
-		return devmap;
-	}
-	devmap = dasd_add_busid(cdev->dev.bus_id, DASD_FEATURE_DEFAULT);
-	if (!IS_ERR(devmap))
-		cdev->dev.driver_data = devmap;
+	if (IS_ERR(devmap))
+		devmap = dasd_add_busid(cdev->dev.bus_id, DASD_FEATURE_DEFAULT);
 	return devmap;
 }
 
@@ -456,6 +449,7 @@ dasd_create_device(struct ccw_device *cdev)
 	devmap = dasd_devmap_from_cdev(cdev);
 	if (IS_ERR(devmap))
 		return (void *) devmap;
+	cdev->dev.driver_data = devmap;
 
 	device = dasd_alloc_device();
 	if (IS_ERR(device))
diff --git a/drivers/s390/block/dasd_diag.c b/drivers/s390/block/dasd_diag.c
index 888aeb399..cc79775b0 100644
--- a/drivers/s390/block/dasd_diag.c
+++ b/drivers/s390/block/dasd_diag.c
@@ -6,7 +6,7 @@
  * Bugreports.to..: <Linux390@de.ibm.com>
  * (C) IBM Corporation, IBM Deutschland Entwicklung GmbH, 1999,2000
  *
- * $Revision: 1.36 $
+ * $Revision: 1.37 $
  */
 
 #include <linux/config.h>
@@ -158,7 +158,7 @@ dasd_ext_handler(struct pt_regs *regs, __u16 code)
 	unsigned long long expires;
 	unsigned long flags;
 	char status;
-	int ip, cpu;
+	int ip;
 
 	/*
 	 * Get the external interruption subcode. VM stores
@@ -171,8 +171,6 @@ dasd_ext_handler(struct pt_regs *regs, __u16 code)
 	status = *((char *) &S390_lowcore.ext_params + 5);
 	ip = S390_lowcore.ext_params;
 
-	cpu = smp_processor_id();
-
 	if (!ip) {		/* no intparm: unsolicited interrupt */
 		MESSAGE(KERN_DEBUG, "%s", "caught unsolicited interrupt");
 		return;
diff --git a/drivers/s390/block/dasd_eckd.c b/drivers/s390/block/dasd_eckd.c
index 9b667cd5a..27bf674af 100644
--- a/drivers/s390/block/dasd_eckd.c
+++ b/drivers/s390/block/dasd_eckd.c
@@ -7,7 +7,7 @@
  * Bugreports.to..: <Linux390@de.ibm.com>
  * (C) IBM Corporation, IBM Deutschland Entwicklung GmbH, 1999,2000
  *
- * $Revision: 1.55 $
+ * $Revision: 1.57 $
  */
 
 #include <linux/config.h>
@@ -983,8 +983,8 @@ dasd_eckd_build_cp(struct dasd_device * device, struct request *req)
 				return ERR_PTR(-EINVAL);
 			count += bv->bv_len >> (device->s2b_shift + 9);
 #if defined(CONFIG_ARCH_S390X)
-			cidaw += idal_nr_words(page_address(bv->bv_page) +
-					       bv->bv_offset, bv->bv_len);
+			if (idal_is_needed (page_address(bv->bv_page), bv->bv_len))
+				cidaw += bv->bv_len >> (device->s2b_shift + 9);
 #endif
 		}
 	}
diff --git a/drivers/s390/block/dasd_erp.c b/drivers/s390/block/dasd_erp.c
index 9c91710b7..4c7423ac3 100644
--- a/drivers/s390/block/dasd_erp.c
+++ b/drivers/s390/block/dasd_erp.c
@@ -7,7 +7,7 @@
  * Bugreports.to..: <Linux390@de.ibm.com>
  * (C) IBM Corporation, IBM Deutschland Entwicklung GmbH, 1999-2001
  *
- * $Revision: 1.11 $
+ * $Revision: 1.12 $
  */
 
 #include <linux/config.h>
@@ -77,8 +77,6 @@ dasd_free_erp_request(struct dasd_ccw_req * cqr, struct dasd_device * device)
 {
 	unsigned long flags;
 
-	if (cqr->dstat != NULL)
-		kfree(cqr->dstat);
 	debug_text_event(dasd_debug_area, 1, "FREE");
 	debug_int_event(dasd_debug_area, 1, (long) cqr);
 	spin_lock_irqsave(&device->mem_lock, flags);
diff --git a/drivers/s390/block/dasd_fba.c b/drivers/s390/block/dasd_fba.c
index 35b8f37b1..8116381cf 100644
--- a/drivers/s390/block/dasd_fba.c
+++ b/drivers/s390/block/dasd_fba.c
@@ -4,7 +4,7 @@
  * Bugreports.to..: <Linux390@de.ibm.com>
  * (C) IBM Corporation, IBM Deutschland Entwicklung GmbH, 1999,2000
  *
- * $Revision: 1.33 $
+ * $Revision: 1.34 $
  */
 
 #include <linux/config.h>
@@ -270,8 +270,8 @@ dasd_fba_build_cp(struct dasd_device * device, struct request *req)
 				return ERR_PTR(-EINVAL);
 			count += bv->bv_len >> (device->s2b_shift + 9);
 #if defined(CONFIG_ARCH_S390X)
-			cidaw += idal_nr_words(page_address(bv->bv_page) +
-					       bv->bv_offset, bv->bv_len);
+			if (idal_is_needed (page_address(bv->bv_page), bv->bv_len))
+				cidaw += bv->bv_len / blksize;
 #endif
 		}
 	}
diff --git a/drivers/s390/block/dasd_genhd.c b/drivers/s390/block/dasd_genhd.c
index 44b6e73f0..32507131a 100644
--- a/drivers/s390/block/dasd_genhd.c
+++ b/drivers/s390/block/dasd_genhd.c
@@ -9,7 +9,7 @@
  *
  * gendisk related functions for the dasd driver.
  *
- * $Revision: 1.46 $
+ * $Revision: 1.48 $
  */
 
 #include <linux/config.h>
@@ -152,8 +152,9 @@ dasd_destroy_partitions(struct dasd_device * device)
 	memset(&bpart, sizeof(struct blkpg_partition), 0);
 	memset(&barg, sizeof(struct blkpg_ioctl_arg), 0);
 	barg.data = &bpart;
+	barg.op = BLKPG_DEL_PARTITION;
 	for (bpart.pno = device->gdp->minors - 1; bpart.pno > 0; bpart.pno--)
-		ioctl_by_bdev(bdev, BLKPG_DEL_PARTITION, (unsigned long) &barg);
+		ioctl_by_bdev(bdev, BLKPG, (unsigned long) &barg);
 
 	invalidate_partition(device->gdp, 0);
 	/* Matching blkdev_put to the blkdev_get in dasd_scan_partitions. */
diff --git a/drivers/s390/block/dasd_int.h b/drivers/s390/block/dasd_int.h
index b222f9503..9bdf82fca 100644
--- a/drivers/s390/block/dasd_int.h
+++ b/drivers/s390/block/dasd_int.h
@@ -6,7 +6,7 @@
  * Bugreports.to..: <Linux390@de.ibm.com>
  * (C) IBM Corporation, IBM Deutschland Entwicklung GmbH, 1999,2000
  *
- * $Revision: 1.58 $
+ * $Revision: 1.60 $
  */
 
 #ifndef DASD_INT_H
@@ -168,7 +168,7 @@ struct dasd_ccw_req {
 	void *data;			/* pointer to data area */
 
 	/* these are important for recovering erroneous requests          */
-	struct irb *dstat;		/* device status in case of an error */
+	struct irb irb;			/* device status in case of an error */
 	struct dasd_ccw_req *refers;	/* ERP-chain queueing. */
 	void *function; 		/* originating ERP action */
 
@@ -192,6 +192,7 @@ struct dasd_ccw_req {
 #define DASD_CQR_DONE     0x03	/* request is completed successfully */
 #define DASD_CQR_ERROR    0x04	/* request is completed with error */
 #define DASD_CQR_FAILED   0x05	/* request is finally failed */
+#define DASD_CQR_CLEAR    0x06	/* request is clear pending */
 
 /* per dasd_ccw_req flags */
 #define DASD_CQR_FLAGS_USE_ERP   0	/* use ERP for this request */
diff --git a/drivers/s390/char/sclp.c b/drivers/s390/char/sclp.c
index e36307ded..047d305cc 100644
--- a/drivers/s390/char/sclp.c
+++ b/drivers/s390/char/sclp.c
@@ -52,6 +52,9 @@ static char sclp_init_sccb[PAGE_SIZE] __attribute__((__aligned__(PAGE_SIZE)));
 /* Timer for init mask retries. */
 static struct timer_list retry_timer;
 
+/* Timer for busy retries. */
+static struct timer_list sclp_busy_timer;
+
 static volatile unsigned long sclp_status = 0;
 /* some status flags */
 #define SCLP_INIT		0
@@ -59,6 +62,7 @@ static volatile unsigned long sclp_status = 0;
 #define SCLP_READING		2
 
 #define SCLP_INIT_POLL_INTERVAL	1
+#define SCLP_BUSY_POLL_INTERVAL	1
 
 #define SCLP_COMMAND_INITIATED	0
 #define SCLP_BUSY		2
@@ -93,45 +97,61 @@ __service_call(sclp_cmdw_t command, void *sccb)
 	 */
 	if (cc == SCLP_NOT_OPERATIONAL)
 		return -EIO;
-	/*
-	 * We set the SCLP_RUNNING bit for cc 2 as well because if
-	 * service_call returns cc 2 some old request is running
-	 * that has to complete first
-	 */
-	set_bit(SCLP_RUNNING, &sclp_status);
 	if (cc == SCLP_BUSY)
 		return -EBUSY;
 	return 0;
 }
 
-static int
+static void
 sclp_start_request(void)
 {
 	struct sclp_req *req;
 	int rc;
 	unsigned long flags;
 
-	/* quick exit if sclp is already in use */
-	if (test_bit(SCLP_RUNNING, &sclp_status))
-		return -EBUSY;
 	spin_lock_irqsave(&sclp_lock, flags);
-	/* Get first request on queue if available */
-	req = NULL;
-	if (!list_empty(&sclp_req_queue))
+	/* quick exit if sclp is already in use */
+	if (test_bit(SCLP_RUNNING, &sclp_status)) {
+		spin_unlock_irqrestore(&sclp_lock, flags);
+		return;
+	}
+	/* Try to start requests from the request queue. */
+	while (!list_empty(&sclp_req_queue)) {
 		req = list_entry(sclp_req_queue.next, struct sclp_req, list);
-	if (req) {
 		rc = __service_call(req->command, req->sccb);
-		if (rc) {
-			req->status = SCLP_REQ_FAILED;
-			list_del(&req->list);
-		} else
+		if (rc == 0) {
+			/* Sucessfully started request. */
 			req->status = SCLP_REQ_RUNNING;
-	} else
-		rc = -EINVAL;
+			/* Request active. Set running indication. */
+			set_bit(SCLP_RUNNING, &sclp_status);
+			break;
+		}
+		if (rc == -EBUSY) {
+			/**
+			 * SCLP is busy but no request is running.
+			 * Try again later.
+			 */
+			if (!timer_pending(&sclp_busy_timer) ||
+			    !mod_timer(&sclp_busy_timer,
+				       jiffies + SCLP_BUSY_POLL_INTERVAL*HZ)) {
+				sclp_busy_timer.function =
+					(void *) sclp_start_request;
+				sclp_busy_timer.expires =
+					jiffies + SCLP_BUSY_POLL_INTERVAL*HZ;
+				add_timer(&sclp_busy_timer);
+			}
+			break;
+		}
+		/* Request failed. */
+		req->status = SCLP_REQ_FAILED;
+		list_del(&req->list);
+		if (req->callback) {
+			spin_unlock_irqrestore(&sclp_lock, flags);
+			req->callback(req, req->callback_data);
+			spin_lock_irqsave(&sclp_lock, flags);
+		}
+	}
 	spin_unlock_irqrestore(&sclp_lock, flags);
-	if (rc == -EIO && req->callback != NULL)
-		req->callback(req, req->callback_data);
-	return rc;
 }
 
 static int
@@ -474,11 +494,12 @@ static struct sclp_register sclp_state_change_event = {
 static void
 do_load_quiesce_psw(void * __unused)
 {
+	static atomic_t cpuid = ATOMIC_INIT(-1);
 	psw_t quiesce_psw;
-	unsigned long status;
+	__u32 status;
 	int i;
 
-	if (smp_processor_id() != 0)
+	if (atomic_compare_and_swap(-1, smp_processor_id(), &cpuid))
 		signal_processor(smp_processor_id(), sigp_stop);
 	/* Wait for all other cpus to enter stopped state */
 	i = 1;
@@ -491,7 +512,7 @@ do_load_quiesce_psw(void * __unused)
 		case sigp_order_code_accepted:
 		case sigp_status_stored:
 			/* Check for stopped and check stop state */
-			if (test_bit(6, &status) || test_bit(4, &status))
+			if (status & 0x50)
 				i++;
 			break;
 		case sigp_busy:
@@ -613,6 +634,8 @@ sclp_init_mask(void)
 		 */
 		do {
 			rc = __service_call(req->command, req->sccb);
+			if (rc == 0)
+				set_bit(SCLP_RUNNING, &sclp_status);
 			spin_unlock_irqrestore(&sclp_lock, flags);
 			if (rc == -EIO)
 				return -ENOSYS;
@@ -685,6 +708,7 @@ sclp_init(void)
 	ctl_set_bit(0, 9);
 
 	init_timer(&retry_timer);
+	init_timer(&sclp_busy_timer);
 	/* do the initial write event mask */
 	rc = sclp_init_mask();
 	if (rc == 0) {
diff --git a/drivers/s390/char/tape_char.c b/drivers/s390/char/tape_char.c
index 0d0343b87..86262a13f 100644
--- a/drivers/s390/char/tape_char.c
+++ b/drivers/s390/char/tape_char.c
@@ -145,16 +145,6 @@ tapechar_read(struct file *filp, char __user *data, size_t count, loff_t *ppos)
 
 	DBF_EVENT(6, "TCHAR:read\n");
 	device = (struct tape_device *) filp->private_data;
-	/* Check position. */
-	if (ppos != &filp->f_pos) {
-		/*
-		 * "A request was outside the capabilities of the device."
-		 * This check uses internal knowledge about how pread and
-		 * read work...
-		 */
-		DBF_EVENT(6, "TCHAR:ppos wrong\n");
-		return -EOVERFLOW;
-	}
 
 	/*
 	 * If the tape isn't terminated yet, do it now. And since we then
@@ -221,12 +211,6 @@ tapechar_write(struct file *filp, const char __user *data, size_t count, loff_t
 
 	DBF_EVENT(6, "TCHAR:write\n");
 	device = (struct tape_device *) filp->private_data;
-	/* Check position */
-	if (ppos != &filp->f_pos) {
-		/* "A request was outside the capabilities of the device." */
-		DBF_EVENT(6, "TCHAR:ppos wrong\n");
-		return -EOVERFLOW;
-	}
 	/* Find out block size and number of blocks */
 	if (device->char_data.block_size != 0) {
 		if (count < device->char_data.block_size) {
@@ -329,7 +313,7 @@ tapechar_open (struct inode *inode, struct file *filp)
 	rc = tape_open(device);
 	if (rc == 0) {
 		filp->private_data = device;
-		return 0;
+		return nonseekable_open(inode, filp);
 	}
 	tape_put_device(device);
 
diff --git a/drivers/s390/cio/Makefile b/drivers/s390/cio/Makefile
index 321ed179c..c490c2a1c 100644
--- a/drivers/s390/cio/Makefile
+++ b/drivers/s390/cio/Makefile
@@ -2,7 +2,7 @@
 # Makefile for the S/390 common i/o drivers
 #
 
-obj-y += airq.o blacklist.o chsc.o cio.o css.o requestirq.o 
+obj-y += airq.o blacklist.o chsc.o cio.o css.o
 ccw_device-objs += device.o device_fsm.o device_ops.o
 ccw_device-objs += device_id.o device_pgid.o device_status.o
 obj-y += ccw_device.o cmf.o
diff --git a/drivers/s390/cio/chsc.c b/drivers/s390/cio/chsc.c
index 4c8d6df06..de60cfd45 100644
--- a/drivers/s390/cio/chsc.c
+++ b/drivers/s390/cio/chsc.c
@@ -1,7 +1,7 @@
 /*
  *  drivers/s390/cio/chsc.c
  *   S/390 common I/O routines -- channel subsystem call
- *   $Revision: 1.112 $
+ *   $Revision: 1.115 $
  *
  *    Copyright (C) 1999-2002 IBM Deutschland Entwicklung GmbH,
  *			      IBM Corporation
@@ -906,8 +906,6 @@ new_channel_path(int chpid)
 		return -ENOMEM;
 	memset(chp, 0, sizeof(struct channel_path));
 
-	chps[chpid] = chp;
-
 	/* fill in status, etc. */
 	chp->id = chpid;
 	chp->state = 1;
@@ -922,12 +920,17 @@ new_channel_path(int chpid)
 	if (ret) {
 		printk(KERN_WARNING "%s: could not register %02x\n",
 		       __func__, chpid);
-		return ret;
+		goto out_free;
 	}
 	ret = device_create_file(&chp->dev, &dev_attr_status);
-	if (ret)
+	if (ret) {
 		device_unregister(&chp->dev);
-
+		goto out_free;
+	} else
+		chps[chpid] = chp;
+	return ret;
+out_free:
+	kfree(chp);
 	return ret;
 }
 
@@ -942,3 +945,59 @@ chsc_alloc_sei_area(void)
 }
 
 subsys_initcall(chsc_alloc_sei_area);
+
+struct css_general_char css_general_characteristics;
+struct css_chsc_char css_chsc_characteristics;
+
+int __init
+chsc_determine_css_characteristics(void)
+{
+	int result;
+	struct {
+		struct chsc_header request;
+		u32 reserved1;
+		u32 reserved2;
+		u32 reserved3;
+		struct chsc_header response;
+		u32 reserved4;
+		u32 general_char[510];
+		u32 chsc_char[518];
+	} *scsc_area;
+
+	scsc_area = (void *)get_zeroed_page(GFP_KERNEL | GFP_DMA);
+	if (!scsc_area) {
+	        printk(KERN_WARNING"cio: Was not able to determine available" \
+		       "CHSCs due to no memory.\n");
+		return -ENOMEM;
+	}
+
+	scsc_area->request = (struct chsc_header) {
+		.length = 0x0010,
+		.code   = 0x0010,
+	};
+
+	result = chsc(scsc_area);
+	if (result) {
+		printk(KERN_WARNING"cio: Was not able to determine " \
+		       "available CHSCs, cc=%i.\n", result);
+		result = -EIO;
+		goto exit;
+	}
+
+	if (scsc_area->response.code != 1) {
+		printk(KERN_WARNING"cio: Was not able to determine " \
+		       "available CHSCs.\n");
+		result = -EIO;
+		goto exit;
+	}
+	memcpy(&css_general_characteristics, scsc_area->general_char,
+	       sizeof(css_general_characteristics));
+	memcpy(&css_chsc_characteristics, scsc_area->chsc_char,
+	       sizeof(css_chsc_characteristics));
+exit:
+	free_page ((unsigned long) scsc_area);
+	return result;
+}
+
+EXPORT_SYMBOL_GPL(css_general_characteristics);
+EXPORT_SYMBOL_GPL(css_chsc_characteristics);
diff --git a/drivers/s390/cio/chsc.h b/drivers/s390/cio/chsc.h
index 90f5a9e73..a3390f99a 100644
--- a/drivers/s390/cio/chsc.h
+++ b/drivers/s390/cio/chsc.h
@@ -23,4 +23,32 @@ extern struct channel_path *chps[];
 extern void s390_process_css( void );
 extern void chsc_validate_chpids(struct subchannel *);
 extern void chpid_is_actually_online(int);
+
+struct css_general_char {
+	u64 : 41;
+	u32 aif : 1;     /* bit 41 */
+	u32 : 3;
+	u32 mcss : 1;    /* bit 45 */
+	u32 : 2;
+	u32 ext_mb : 1;  /* bit 48 */
+	u32 : 7;
+	u32 aif_tdd : 1; /* bit 56 */
+	u32 : 10;
+	u32 aif_osa : 1; /* bit 67 */
+	u32 : 28;
+}__attribute__((packed));
+
+struct css_chsc_char {
+	u64 res;
+	u64 : 43;
+	u32 scssc : 1;  /* bit 107 */
+	u32 scsscf : 1; /* bit 108 */
+	u32 : 19;
+}__attribute__((packed));
+
+extern struct css_general_char css_general_characteristics;
+extern struct css_chsc_char css_chsc_characteristics;
+
+extern int chsc_determine_css_characteristics(void);
+extern int css_characteristics_avail;
 #endif
diff --git a/drivers/s390/cio/cio.c b/drivers/s390/cio/cio.c
index a16f061fd..38e59dd24 100644
--- a/drivers/s390/cio/cio.c
+++ b/drivers/s390/cio/cio.c
@@ -688,15 +688,15 @@ cio_console_irq(void)
 		if (stsch(console_irq, &console_subchannel.schib) != 0 ||
 		    !console_subchannel.schib.pmcw.dnv)
 			return -1;
-		console_device = console_subchannel.schib.pmcw.dev;
-	} else if (console_device != -1) {
+		console_devno = console_subchannel.schib.pmcw.dev;
+	} else if (console_devno != -1) {
 		/* At least the console device number is known. */
 		for (irq = 0; irq < __MAX_SUBCHANNELS; irq++) {
 			if (stsch(irq, &console_subchannel.schib) != 0)
 				break;
 			if (console_subchannel.schib.pmcw.dnv &&
 			    console_subchannel.schib.pmcw.dev ==
-			    console_device) {
+			    console_devno) {
 				console_irq = irq;
 				break;
 			}
diff --git a/drivers/s390/cio/cio.h b/drivers/s390/cio/cio.h
index f653fe5e8..8e09ce4b5 100644
--- a/drivers/s390/cio/cio.h
+++ b/drivers/s390/cio/cio.h
@@ -127,10 +127,15 @@ extern int cio_set_options (struct subchannel *, int);
 extern int cio_get_options (struct subchannel *);
 extern int cio_modify (struct subchannel *);
 /* Use with care. */
+#ifdef CONFIG_CCW_CONSOLE
 extern struct subchannel *cio_probe_console(void);
 extern void cio_release_console(void);
 extern int cio_is_console(int irq);
 extern struct subchannel *cio_get_console_subchannel(void);
+#else
+#define cio_is_console(irq) 0
+#define cio_get_console_subchannel() NULL
+#endif
 
 extern int cio_show_msg;
 
diff --git a/drivers/s390/cio/cmf.c b/drivers/s390/cio/cmf.c
index 06fb41f38..788ae49c5 100644
--- a/drivers/s390/cio/cmf.c
+++ b/drivers/s390/cio/cmf.c
@@ -1,5 +1,5 @@
 /*
- * linux/drivers/s390/cio/cmf.c ($Revision: 1.13 $)
+ * linux/drivers/s390/cio/cmf.c ($Revision: 1.15 $)
  *
  * Linux on zSeries Channel Measurement Facility support
  *
@@ -39,6 +39,7 @@
 #include "css.h"
 #include "device.h"
 #include "ioasm.h"
+#include "chsc.h"
 
 /* parameter to enable cmf during boot, possible uses are:
  *  "s390cmf" -- enable cmf and allocate 2 MB of ram so measuring can be
@@ -996,7 +997,8 @@ init_cmf(void)
 	   see if we are running on z990 or up, otherwise fall back to basic mode. */
 
 	if (format == CMF_AUTODETECT) {
-		if (!MACHINE_NEW_STIDP) {
+		if (!css_characteristics_avail ||
+		    !css_general_characteristics.ext_mb) {
 			format = CMF_BASIC;
 		} else {
 			format = CMF_EXTENDED;
diff --git a/drivers/s390/cio/css.c b/drivers/s390/cio/css.c
index f99652855..dba1bfb9a 100644
--- a/drivers/s390/cio/css.c
+++ b/drivers/s390/cio/css.c
@@ -1,7 +1,7 @@
 /*
  *  drivers/s390/cio/css.c
  *  driver for channel subsystem
- *   $Revision: 1.77 $
+ *   $Revision: 1.80 $
  *
  *    Copyright (C) 2002 IBM Deutschland Entwicklung GmbH,
  *			 IBM Corporation
@@ -19,11 +19,15 @@
 #include "cio.h"
 #include "cio_debug.h"
 #include "ioasm.h"
+#include "chsc.h"
 
 unsigned int highest_subchannel;
 int need_rescan = 0;
 int css_init_done = 0;
 
+struct pgid global_pgid;
+int css_characteristics_avail = 0;
+
 struct device css_bus_device = {
 	.bus_id = "css0",
 };
@@ -201,6 +205,20 @@ css_evaluate_subchannel(int irq, int slow)
 			ret = 0;
 			break;
 		}
+		if (disc && (event == CIO_NO_PATH)) {
+			/*
+			 * Uargh, hack again. Because we don't get a machine
+			 * check on configure on, our path bookkeeping can
+			 * be out of date here (it's fine while we only do
+			 * logical varying or get chsc machine checks). We
+			 * need to force reprobing or we might miss devices
+			 * coming operational again. It won't do harm in real
+			 * no path situations.
+			 */
+			device_trigger_reprobe(sch);
+			ret = 0;
+			break;
+		}
 		if (sch->driver && sch->driver->notify &&
 		    sch->driver->notify(&sch->dev, event)) {
 			cio_disable_subchannel(sch);
@@ -352,9 +370,26 @@ css_process_crw(int irq)
 	return ret;
 }
 
+static void __init
+css_generate_pgid(void)
+{
+	/* Let's build our path group ID here. */
+	if (css_characteristics_avail && css_general_characteristics.mcss)
+		global_pgid.cpu_addr = 0x8000;
+	else {
+#ifdef CONFIG_SMP
+		global_pgid.cpu_addr = hard_smp_processor_id();
+#else
+		global_pgid.cpu_addr = 0;
+#endif
+	}
+	global_pgid.cpu_id = ((cpuid_t *) __LC_CPUID)->ident;
+	global_pgid.cpu_model = ((cpuid_t *) __LC_CPUID)->machine;
+	global_pgid.tod_high = (__u32) (get_clock() >> 32);
+}
+
 /*
- * some of the initialization has already been done from init_IRQ(),
- * here we do the rest now that the driver core is running.
+ * Now that the driver core is running, we can setup our channel subsystem.
  * The struct subchannel's are created during probing (except for the
  * static console subchannel).
  */
@@ -363,6 +398,11 @@ init_channel_subsystem (void)
 {
 	int ret, irq;
 
+	if (chsc_determine_css_characteristics() == 0)
+		css_characteristics_avail = 1;
+
+	css_generate_pgid();
+
 	if ((ret = bus_register(&css_bus_type)))
 		goto out;
 	if ((ret = device_register (&css_bus_device)))
@@ -517,3 +557,4 @@ MODULE_LICENSE("GPL");
 EXPORT_SYMBOL(css_bus_type);
 EXPORT_SYMBOL(s390_root_dev_register);
 EXPORT_SYMBOL(s390_root_dev_unregister);
+EXPORT_SYMBOL_GPL(css_characteristics_avail);
diff --git a/drivers/s390/cio/device_fsm.c b/drivers/s390/cio/device_fsm.c
index 508f1a7fb..6a8db8450 100644
--- a/drivers/s390/cio/device_fsm.c
+++ b/drivers/s390/cio/device_fsm.c
@@ -165,8 +165,6 @@ ccw_device_handle_oper(struct ccw_device *cdev)
 		return;
 	}
 	cdev->private->flags.donotify = 1;
-	/* Get device online again. */
-	ccw_device_online(cdev);
 }
 
 /*
@@ -233,15 +231,24 @@ ccw_device_recog_done(struct ccw_device *cdev, int state)
 			  cdev->private->devno, sch->irq);
 		break;
 	case DEV_STATE_OFFLINE:
-		if (cdev->private->state == DEV_STATE_DISCONNECTED_SENSE_ID)
+		if (cdev->private->state == DEV_STATE_DISCONNECTED_SENSE_ID) {
+			ccw_device_handle_oper(cdev);
 			notify = 1;
-		else  /* fill out sense information */
-			cdev->id = (struct ccw_device_id) {
-				.cu_type   = cdev->private->senseid.cu_type,
-				.cu_model  = cdev->private->senseid.cu_model,
-				.dev_type  = cdev->private->senseid.dev_type,
-				.dev_model = cdev->private->senseid.dev_model,
-			};
+		}
+		/* fill out sense information */
+		cdev->id = (struct ccw_device_id) {
+			.cu_type   = cdev->private->senseid.cu_type,
+			.cu_model  = cdev->private->senseid.cu_model,
+			.dev_type  = cdev->private->senseid.dev_type,
+			.dev_model = cdev->private->senseid.dev_model,
+		};
+		if (notify) {
+			/* Get device online again. */
+			cdev->private->state = DEV_STATE_OFFLINE;
+			ccw_device_online(cdev);
+			wake_up(&cdev->private->wait_q);
+			return;
+		}
 		/* Issue device info message. */
 		CIO_DEBUG(KERN_INFO, 2, "SenseID : device %04x reports: "
 			  "CU  Type/Mod = %04X/%02X, Dev Type/Mod = "
@@ -256,10 +263,7 @@ ccw_device_recog_done(struct ccw_device *cdev, int state)
 		break;
 	}
 	cdev->private->state = state;
-	if (notify && state == DEV_STATE_OFFLINE)
-		ccw_device_handle_oper(cdev);
-	else
-		io_subchannel_recog_done(cdev);
+	io_subchannel_recog_done(cdev);
 	if (state != DEV_STATE_NOT_OPER)
 		wake_up(&cdev->private->wait_q);
 }
@@ -672,8 +676,20 @@ ccw_device_irq(struct ccw_device *cdev, enum dev_event dev_event)
 
 	irb = (struct irb *) __LC_IRB;
 	/* Check for unsolicited interrupt. */
-	if (irb->scsw.stctl ==
-	    		(SCSW_STCTL_STATUS_PEND | SCSW_STCTL_ALERT_STATUS)) {
+	if ((irb->scsw.stctl ==
+	    		(SCSW_STCTL_STATUS_PEND | SCSW_STCTL_ALERT_STATUS))
+	    && (!irb->scsw.cc)) {
+		if ((irb->scsw.dstat & DEV_STAT_UNIT_CHECK) &&
+		    !irb->esw.esw0.erw.cons) {
+			/* Unit check but no sense data. Need basic sense. */
+			if (ccw_device_do_sense(cdev, irb) != 0)
+				goto call_handler_unsol;
+			memcpy(irb, &cdev->private->irb, sizeof(struct irb));
+			cdev->private->state = DEV_STATE_W4SENSE;
+			cdev->private->intparm = 0;
+			return;
+		}
+call_handler_unsol:
 		if (cdev->handler)
 			cdev->handler (cdev, 0, irb);
 		return;
@@ -735,11 +751,15 @@ ccw_device_w4sense(struct ccw_device *cdev, enum dev_event dev_event)
 	/* Check for unsolicited interrupt. */
 	if (irb->scsw.stctl ==
 	    		(SCSW_STCTL_STATUS_PEND | SCSW_STCTL_ALERT_STATUS)) {
-		if (cdev->handler)
-			cdev->handler (cdev, 0, irb);
 		if (irb->scsw.cc == 1)
 			/* Basic sense hasn't started. Try again. */
 			ccw_device_do_sense(cdev, irb);
+		else {
+			printk("Huh? %s(%s): unsolicited interrupt...\n",
+			       __FUNCTION__, cdev->dev.bus_id);
+			if (cdev->handler)
+				cdev->handler (cdev, 0, irb);
+		}
 		return;
 	}
 	/* Add basic sense info to irb. */
@@ -762,13 +782,6 @@ ccw_device_clear_verify(struct ccw_device *cdev, enum dev_event dev_event)
 	struct irb *irb;
 
 	irb = (struct irb *) __LC_IRB;
-	/* Check for unsolicited interrupt. */
-	if (irb->scsw.stctl ==
-	    		(SCSW_STCTL_STATUS_PEND | SCSW_STCTL_ALERT_STATUS)) {
-		if (cdev->handler)
-			cdev->handler (cdev, 0, irb);
-		return;
-	}
 	/* Accumulate status. We don't do basic sense. */
 	ccw_device_accumulate_irb(cdev, irb);
 	/* Try to start delayed device verification. */
@@ -834,15 +847,6 @@ ccw_device_wait4io_irq(struct ccw_device *cdev, enum dev_event dev_event)
 	struct subchannel *sch;
 
 	irb = (struct irb *) __LC_IRB;
-	/* Check for unsolicited interrupt. */
-	if (irb->scsw.stctl ==
-	    		(SCSW_STCTL_STATUS_PEND | SCSW_STCTL_ALERT_STATUS)) {
-		if (cdev->handler)
-			cdev->handler (cdev, 0, irb);
-		if (irb->scsw.cc == 1)
-			goto call_handler;
-		return;
-	}
 	/*
 	 * Accumulate status and find out if a basic sense is needed.
 	 * This is fine since we have already adapted the lpm.
@@ -854,7 +858,7 @@ ccw_device_wait4io_irq(struct ccw_device *cdev, enum dev_event dev_event)
 		}
 		return;
 	}
-call_handler:
+
 	/* Iff device is idle, reset timeout. */
 	sch = to_subchannel(cdev->dev.parent);
 	if (!stsch(sch->irq, &sch->schib))
@@ -923,8 +927,9 @@ ccw_device_stlck_done(struct ccw_device *cdev, enum dev_event dev_event)
 	case DEV_EVENT_INTERRUPT:
 		irb = (struct irb *) __LC_IRB;
 		/* Check for unsolicited interrupt. */
-		if (irb->scsw.stctl ==
-		    (SCSW_STCTL_STATUS_PEND | SCSW_STCTL_ALERT_STATUS))
+		if ((irb->scsw.stctl ==
+		     (SCSW_STCTL_STATUS_PEND | SCSW_STCTL_ALERT_STATUS)) &&
+		    (!irb->scsw.cc))
 			/* FIXME: we should restart stlck here, but this
 			 * is extremely unlikely ... */
 			goto out_wakeup;
diff --git a/drivers/s390/cio/device_id.c b/drivers/s390/cio/device_id.c
index aae28c3bb..32365959c 100644
--- a/drivers/s390/cio/device_id.c
+++ b/drivers/s390/cio/device_id.c
@@ -303,15 +303,14 @@ ccw_device_sense_id_irq(struct ccw_device *cdev, enum dev_event dev_event)
 
 	sch = to_subchannel(cdev->dev.parent);
 	irb = (struct irb *) __LC_IRB;
-	/*
-	 * Unsolicited interrupts may pertain to an earlier status pending or
-	 * busy condition on the subchannel. Retry sense id.
-	 */
+	/* Retry sense id for cc=1. */
 	if (irb->scsw.stctl ==
 	    (SCSW_STCTL_STATUS_PEND | SCSW_STCTL_ALERT_STATUS)) {
-		ret = __ccw_device_sense_id_start(cdev);
-		if (ret && ret != -EBUSY)
-			ccw_device_sense_id_done(cdev, ret);
+		if (irb->scsw.cc == 1) {
+			ret = __ccw_device_sense_id_start(cdev);
+			if (ret && ret != -EBUSY)
+				ccw_device_sense_id_done(cdev, ret);
+		}
 		return;
 	}
 	if (ccw_device_accumulate_and_sense(cdev, irb) != 0)
diff --git a/drivers/s390/cio/device_ops.c b/drivers/s390/cio/device_ops.c
index 84dc9bb54..07a3d2258 100644
--- a/drivers/s390/cio/device_ops.c
+++ b/drivers/s390/cio/device_ops.c
@@ -1,7 +1,7 @@
 /*
  *  drivers/s390/cio/device_ops.c
  *
- *   $Revision: 1.34 $
+ *   $Revision: 1.50 $
  *
  *    Copyright (C) 2002 IBM Deutschland Entwicklung GmbH,
  *			 IBM Corporation
@@ -15,6 +15,7 @@
 #include <linux/slab.h>
 #include <linux/list.h>
 #include <linux/device.h>
+#include <linux/delay.h>
 
 #include <asm/ccwdev.h>
 #include <asm/idals.h>
@@ -268,7 +269,7 @@ __ccw_device_retry_loop(struct ccw_device *cdev, struct ccw1 *ccw, long magic)
 		if ((ret == -EBUSY) || (ret == -EACCES)) {
 			/* Try again later. */
 			spin_unlock_irq(&sch->lock);
-			schedule_timeout(1);
+			msleep(10);
 			spin_lock_irq(&sch->lock);
 			continue;
 		}
@@ -294,7 +295,7 @@ __ccw_device_retry_loop(struct ccw_device *cdev, struct ccw1 *ccw, long magic)
 			break;
 		/* Try again later. */
 		spin_unlock_irq(&sch->lock);
-		schedule_timeout(1);
+		msleep(10);
 		spin_lock_irq(&sch->lock);
 	} while (1);
 
diff --git a/drivers/s390/cio/device_pgid.c b/drivers/s390/cio/device_pgid.c
index 35ceeac21..7a8080199 100644
--- a/drivers/s390/cio/device_pgid.c
+++ b/drivers/s390/cio/device_pgid.c
@@ -143,15 +143,14 @@ ccw_device_sense_pgid_irq(struct ccw_device *cdev, enum dev_event dev_event)
 	int ret;
 
 	irb = (struct irb *) __LC_IRB;
-	/*
-	 * Unsolicited interrupts may pertain to an earlier status pending or
-	 * busy condition on the subchannel. Retry sense pgid.
-	 */
+	/* Retry sense pgid for cc=1. */
 	if (irb->scsw.stctl ==
 	    (SCSW_STCTL_STATUS_PEND | SCSW_STCTL_ALERT_STATUS)) {
-		ret = __ccw_device_sense_pgid_start(cdev);
-		if (ret && ret != -EBUSY)
-			ccw_device_sense_pgid_done(cdev, ret);
+		if (irb->scsw.cc == 1) {
+			ret = __ccw_device_sense_pgid_start(cdev);
+			if (ret && ret != -EBUSY)
+				ccw_device_sense_pgid_done(cdev, ret);
+		}
 		return;
 	}
 	if (ccw_device_accumulate_and_sense(cdev, irb) != 0)
@@ -310,13 +309,11 @@ ccw_device_verify_irq(struct ccw_device *cdev, enum dev_event dev_event)
 	struct irb *irb;
 
 	irb = (struct irb *) __LC_IRB;
-	/*
-	 * Unsolicited interrupts may pertain to an earlier status pending or
-	 * busy condition on the subchannel. Restart path verification.
-	 */
+	/* Retry set pgid for cc=1. */
 	if (irb->scsw.stctl ==
 	    (SCSW_STCTL_STATUS_PEND | SCSW_STCTL_ALERT_STATUS)) {
-		__ccw_device_verify_start(cdev);
+		if (irb->scsw.cc == 1)
+			__ccw_device_verify_start(cdev);
 		return;
 	}
 	if (ccw_device_accumulate_and_sense(cdev, irb) != 0)
@@ -397,10 +394,13 @@ ccw_device_disband_irq(struct ccw_device *cdev, enum dev_event dev_event)
 	int ret;
 
 	irb = (struct irb *) __LC_IRB;
-	/* Ignore unsolicited interrupts. */
+	/* Retry set pgid for cc=1. */
 	if (irb->scsw.stctl ==
-	    		(SCSW_STCTL_STATUS_PEND | SCSW_STCTL_ALERT_STATUS))
+	    (SCSW_STCTL_STATUS_PEND | SCSW_STCTL_ALERT_STATUS)) {
+		if (irb->scsw.cc == 1)
+			__ccw_device_disband_start(cdev);
 		return;
+	}
 	if (ccw_device_accumulate_and_sense(cdev, irb) != 0)
 		return;
 	sch = to_subchannel(cdev->dev.parent);
diff --git a/drivers/s390/cio/device_status.c b/drivers/s390/cio/device_status.c
index c345e694d..4ab2e0d95 100644
--- a/drivers/s390/cio/device_status.c
+++ b/drivers/s390/cio/device_status.c
@@ -35,7 +35,7 @@ ccw_device_msg_control_check(struct ccw_device *cdev, struct irb *irb)
 		return;
 		
 	CIO_MSG_EVENT(0, "Channel-Check or Interface-Control-Check "
-		      "received\n"
+		      "received"
 		      " ... device %04X on subchannel %04X, dev_stat "
 		      ": %02X sch_stat : %02X\n",
 		      cdev->private->devno, cdev->private->irq,
@@ -216,8 +216,9 @@ ccw_device_accumulate_irb(struct ccw_device *cdev, struct irb *irb)
 	/*
 	 * Don't accumulate unsolicited interrupts.
 	 */
-	if (irb->scsw.stctl ==
-	    (SCSW_STCTL_STATUS_PEND | SCSW_STCTL_ALERT_STATUS))
+	if ((irb->scsw.stctl ==
+	     (SCSW_STCTL_STATUS_PEND | SCSW_STCTL_ALERT_STATUS)) &&
+	    (!irb->scsw.cc))
 		return;
 
 	cdev_irb = &cdev->private->irb;
@@ -347,7 +348,8 @@ ccw_device_accumulate_basic_sense(struct ccw_device *cdev, struct irb *irb)
 	     (irb->scsw.actl & SCSW_ACTL_SUSPENDED)))
 		ccw_device_path_notoper(cdev);
 
-	if (!(irb->scsw.dstat & DEV_STAT_UNIT_CHECK)) {
+	if (!(irb->scsw.dstat & DEV_STAT_UNIT_CHECK) &&
+	    (irb->scsw.dstat & DEV_STAT_CHN_END)) {
 		cdev->private->irb.esw.esw0.erw.cons = 1;
 		cdev->private->flags.dosense = 0;
 	}
diff --git a/drivers/s390/cio/qdio.c b/drivers/s390/cio/qdio.c
index f4c9779d2..bc768b62a 100644
--- a/drivers/s390/cio/qdio.c
+++ b/drivers/s390/cio/qdio.c
@@ -56,7 +56,7 @@
 #include "ioasm.h"
 #include "chsc.h"
 
-#define VERSION_QDIO_C "$Revision: 1.80 $"
+#define VERSION_QDIO_C "$Revision: 1.84 $"
 
 /****************** MODULE PARAMETER VARIABLES ********************/
 MODULE_AUTHOR("Utz Bacher <utz.bacher@de.ibm.com>");
@@ -87,10 +87,10 @@ static debug_info_t *qdio_dbf_setup;
 static debug_info_t *qdio_dbf_sbal;
 static debug_info_t *qdio_dbf_trace;
 static debug_info_t *qdio_dbf_sense;
-#ifdef QDIO_DBF_LIKE_HELL
+#ifdef CONFIG_QDIO_DEBUG
 static debug_info_t *qdio_dbf_slsb_out;
 static debug_info_t *qdio_dbf_slsb_in;
-#endif /* QDIO_DBF_LIKE_HELL */
+#endif /* CONFIG_QDIO_DEBUG */
 
 /* iQDIO stuff: */
 static volatile struct qdio_q *tiq_list=NULL; /* volatile as it could change
@@ -354,7 +354,8 @@ qdio_stop_polling(struct qdio_q *q)
 		 SLSB_P_INPUT_NOT_INIT);
 	/* 
 	 * we don't issue this SYNC_MEMORY, as we trust Rick T and
-	 * moreover will not use the PROCESSING state, so q->polling was 0
+	 * moreover will not use the PROCESSING state under VM, so
+	 * q->polling was 0 anyway
 	 */
 	/*SYNC_MEMORY;*/
 	if (q->slsb.acc.val[gsf]!=SLSB_P_INPUT_PRIMED)
@@ -513,10 +514,13 @@ inline static int
 qdio_is_outbound_q_done(struct qdio_q *q)
 {
 	int no_used;
+#ifdef CONFIG_QDIO_DEBUG
 	char dbf_text[15];
+#endif
 
 	no_used=atomic_read(&q->number_of_buffers_used);
 
+#ifdef CONFIG_QDIO_DEBUG
 	if (no_used) {
 		sprintf(dbf_text,"oqisnt%02x",no_used);
 		QDIO_DBF_TEXT4(0,trace,dbf_text);
@@ -524,6 +528,7 @@ qdio_is_outbound_q_done(struct qdio_q *q)
 		QDIO_DBF_TEXT4(0,trace,"oqisdone");
 	}
 	QDIO_DBF_HEX4(0,trace,&q,sizeof(void*));
+#endif /* CONFIG_QDIO_DEBUG */
 	return (no_used==0);
 }
 
@@ -551,10 +556,12 @@ inline static void
 qdio_kick_outbound_q(struct qdio_q *q)
 {
 	int result;
+#ifdef CONFIG_QDIO_DEBUG
 	char dbf_text[15];
 
 	QDIO_DBF_TEXT4(0,trace,"kickoutq");
 	QDIO_DBF_HEX4(0,trace,&q,sizeof(void*));
+#endif /* CONFIG_QDIO_DEBUG */
 
 	if (!q->siga_out)
 		return;
@@ -592,16 +599,18 @@ qdio_kick_outbound_q(struct qdio_q *q)
 
 		switch (result) {
 		case 0:
-		/* went smooth this time, reset timestamp */
+			/* went smooth this time, reset timestamp */
+#ifdef CONFIG_QDIO_DEBUG
 			QDIO_DBF_TEXT3(0,trace,"cc2reslv");
 			sprintf(dbf_text,"%4x%2x%2x",q->irq,q->q_no,
 				atomic_read(&q->busy_siga_counter));
 			QDIO_DBF_TEXT3(0,trace,dbf_text);
 			q->timing.busy_start=0;
+#endif /* CONFIG_QDIO_DEBUG */
 			break;
 		case (2|QDIO_SIGA_ERROR_B_BIT_SET):
 			/* cc=2 and busy bit: */
-		atomic_inc(&q->busy_siga_counter);
+			atomic_inc(&q->busy_siga_counter);
 
 			/* if the last siga was successful, save
 			 * timestamp here */
@@ -615,9 +624,11 @@ qdio_kick_outbound_q(struct qdio_q *q)
 				break;
 			}
 			QDIO_DBF_TEXT2(0,trace,"cc2REPRT");
+#ifdef CONFIG_QDIO_DEBUG
 			sprintf(dbf_text,"%4x%2x%2x",q->irq,q->q_no,
 				atomic_read(&q->busy_siga_counter));
 			QDIO_DBF_TEXT3(0,trace,dbf_text);
+#endif /* CONFIG_QDIO_DEBUG */
 			/* else fallthrough and report error */
 		default:
 			/* for plain cc=1, 2 or 3: */
@@ -634,7 +645,9 @@ inline static void
 qdio_kick_outbound_handler(struct qdio_q *q)
 {
 	int start, end, real_end, count;
+#ifdef CONFIG_QDIO_DEBUG
 	char dbf_text[15];
+#endif
 
 	start = q->first_element_to_kick;
 	/* last_move_ftc was just updated */
@@ -644,11 +657,13 @@ qdio_kick_outbound_handler(struct qdio_q *q)
 	count = (end+QDIO_MAX_BUFFERS_PER_Q+1-start)&
 		(QDIO_MAX_BUFFERS_PER_Q-1);
 
+#ifdef CONFIG_QDIO_DEBUG
 	QDIO_DBF_TEXT4(0,trace,"kickouth");
 	QDIO_DBF_HEX4(0,trace,&q,sizeof(void*));
 
 	sprintf(dbf_text,"s=%2xc=%2x",start,count);
 	QDIO_DBF_TEXT4(0,trace,dbf_text);
+#endif /* CONFIG_QDIO_DEBUG */
 
 	if (q->state==QDIO_IRQ_STATE_ACTIVE)
 		q->handler(q->cdev,QDIO_STATUS_OUTBOUND_INT|
@@ -731,7 +746,12 @@ qdio_get_inbound_buffer_frontier(struct qdio_q *q)
 	int f,f_mod_no;
 	volatile char *slsb;
 	int first_not_to_check;
+#ifdef CONFIG_QDIO_DEBUG
 	char dbf_text[15];
+#endif /* CONFIG_QDIO_DEBUG */
+#ifdef QDIO_USE_PROCESSING_STATE
+	int last_position=-1;
+#endif /* QDIO_USE_PROCESSING_STATE */
 
 	QDIO_DBF_TEXT4(0,trace,"getibfro");
 	QDIO_DBF_HEX4(0,trace,&q,sizeof(void*));
@@ -774,8 +794,14 @@ check_next:
 		if (q->siga_sync) {
 			set_slsb(&slsb[f_mod_no],SLSB_P_INPUT_NOT_INIT);
 		} else {
-			set_slsb(&slsb[f_mod_no],SLSB_P_INPUT_PROCESSING);
+			/* set the previous buffer to NOT_INIT. The current
+			 * buffer will be set to PROCESSING at the end of
+			 * this function to avoid further interrupts. */
+			if (last_position>=0)
+				set_slsb(&slsb[last_position],
+					 SLSB_P_INPUT_NOT_INIT);
 			atomic_set(&q->polling,1);
+			last_position=f_mod_no;
 		}
 #else /* QDIO_USE_PROCESSING_STATE */
 		set_slsb(&slsb[f_mod_no],SLSB_P_INPUT_NOT_INIT);
@@ -796,8 +822,10 @@ check_next:
 
 	/* P_ERROR means frontier is reached, break and report error */
 	case SLSB_P_INPUT_ERROR:
+#ifdef CONFIG_QDIO_DEBUG
 		sprintf(dbf_text,"inperr%2x",f_mod_no);
 		QDIO_DBF_TEXT3(1,trace,dbf_text);
+#endif /* CONFIG_QDIO_DEBUG */
 		QDIO_DBF_HEX2(1,sbal,q->sbal[f_mod_no],256);
 
 		/* kind of process the buffer */
@@ -814,6 +842,10 @@ check_next:
 		f_mod_no=(f_mod_no+1)&(QDIO_MAX_BUFFERS_PER_Q-1);
 		atomic_dec(&q->number_of_buffers_used);
 
+#ifdef QDIO_USE_PROCESSING_STATE
+		last_position=-1;
+#endif /* QDIO_USE_PROCESSING_STATE */
+
 		break;
 
 	/* everything else means frontier not changed (HALTED or so) */
@@ -823,6 +855,11 @@ check_next:
 out:
 	q->first_to_check=f_mod_no;
 
+#ifdef QDIO_USE_PROCESSING_STATE
+	if (last_position>=0)
+		set_slsb(&slsb[last_position],SLSB_P_INPUT_PROCESSING);
+#endif /* QDIO_USE_PROCESSING_STATE */
+
 	QDIO_DBF_HEX4(0,trace,&q->first_to_check,sizeof(int));
 
 	return q->first_to_check;
@@ -865,13 +902,16 @@ inline static int
 iqdio_is_inbound_q_done(struct qdio_q *q)
 {
 	int no_used;
+#ifdef CONFIG_QDIO_DEBUG
 	char dbf_text[15];
+#endif
 
 	no_used=atomic_read(&q->number_of_buffers_used);
 
 	/* propagate the change from 82 to 80 through VM */
 	SYNC_MEMORY;
 
+#ifdef CONFIG_QDIO_DEBUG
 	if (no_used) {
 		sprintf(dbf_text,"iqisnt%02x",no_used);
 		QDIO_DBF_TEXT4(0,trace,dbf_text);
@@ -879,6 +919,7 @@ iqdio_is_inbound_q_done(struct qdio_q *q)
 		QDIO_DBF_TEXT4(0,trace,"iniqisdo");
 	}
 	QDIO_DBF_HEX4(0,trace,&q,sizeof(void*));
+#endif /* CONFIG_QDIO_DEBUG */
 
 	if (!no_used)
 		return 1;
@@ -914,7 +955,9 @@ inline static int
 qdio_is_inbound_q_done(struct qdio_q *q)
 {
 	int no_used;
+#ifdef CONFIG_QDIO_DEBUG
 	char dbf_text[15];
+#endif
 
 	no_used=atomic_read(&q->number_of_buffers_used);
 
@@ -949,16 +992,20 @@ qdio_is_inbound_q_done(struct qdio_q *q)
 	 * has (probably) not moved (see qdio_inbound_processing) 
 	 */
 	if (NOW>GET_SAVED_TIMESTAMP(q)+q->timing.threshold) {
+#ifdef CONFIG_QDIO_DEBUG
 		QDIO_DBF_TEXT4(0,trace,"inqisdon");
 		QDIO_DBF_HEX4(0,trace,&q,sizeof(void*));
 		sprintf(dbf_text,"pf%02xcn%02x",q->first_to_check,no_used);
 		QDIO_DBF_TEXT4(0,trace,dbf_text);
+#endif /* CONFIG_QDIO_DEBUG */
 		return 1;
 	} else {
+#ifdef CONFIG_QDIO_DEBUG
 		QDIO_DBF_TEXT4(0,trace,"inqisntd");
 		QDIO_DBF_HEX4(0,trace,&q,sizeof(void*));
 		sprintf(dbf_text,"pf%02xcn%02x",q->first_to_check,no_used);
 		QDIO_DBF_TEXT4(0,trace,dbf_text);
+#endif /* CONFIG_QDIO_DEBUG */
 		return 0;
 	}
 }
@@ -967,7 +1014,9 @@ inline static void
 qdio_kick_inbound_handler(struct qdio_q *q)
 {
 	int count, start, end, real_end, i;
+#ifdef CONFIG_QDIO_DEBUG
 	char dbf_text[15];
+#endif
 
 	QDIO_DBF_TEXT4(0,trace,"kickinh");
 	QDIO_DBF_HEX4(0,trace,&q,sizeof(void*));
@@ -985,8 +1034,10 @@ qdio_kick_inbound_handler(struct qdio_q *q)
  		i=(i+1)&(QDIO_MAX_BUFFERS_PER_Q-1);
  	}
 
+#ifdef CONFIG_QDIO_DEBUG
 	sprintf(dbf_text,"s=%2xc=%2x",start,count);
 	QDIO_DBF_TEXT4(0,trace,dbf_text);
+#endif /* CONFIG_QDIO_DEBUG */
 
 	if (likely(q->state==QDIO_IRQ_STATE_ACTIVE))
 		q->handler(q->cdev,
@@ -1160,7 +1211,7 @@ qdio_inbound_processing(struct qdio_q *q)
 
 #ifdef QDIO_USE_PROCESSING_STATE
 static inline int
-tiqdio_do_inbound_checks(struct qdio_q *q, int q_laps)
+tiqdio_reset_processing_state(struct qdio_q *q, int q_laps)
 {
 	if (!q) {
 		tiqdio_sched_tl();
@@ -1247,7 +1298,7 @@ again:
 	do {
 		int ret;
 
-		ret = tiqdio_do_inbound_checks(q, q_laps);
+		ret = tiqdio_reset_processing_state(q, q_laps);
 		switch (ret) {
 		case 0:
 			return;
@@ -1603,11 +1654,13 @@ static void
 qdio_set_state(struct qdio_irq *irq_ptr, enum qdio_irq_states state)
 {
 	int i;
+#ifdef CONFIG_QDIO_DEBUG
 	char dbf_text[15];
 
 	QDIO_DBF_TEXT5(0,trace,"newstate");
 	sprintf(dbf_text,"%4x%4x",irq_ptr->irq,state);
 	QDIO_DBF_TEXT5(0,trace,dbf_text);
+#endif /* CONFIG_QDIO_DEBUG */
 
 	irq_ptr->state=state;
 	for (i=0;i<irq_ptr->no_input_qs;i++)
@@ -1772,9 +1825,11 @@ qdio_handler(struct ccw_device *cdev, unsigned long intparm, struct irb *irb)
 	int cstat,dstat;
 	char dbf_text[15];
 
+#ifdef CONFIG_QDIO_DEBUG
 	QDIO_DBF_TEXT4(0, trace, "qint");
 	sprintf(dbf_text, "%s", cdev->dev.bus_id);
 	QDIO_DBF_TEXT4(0, trace, dbf_text);
+#endif /* CONFIG_QDIO_DEBUG */
 	
 	if (!intparm) {
 		QDIO_PRINT_ERR("got unsolicited interrupt in qdio " \
@@ -1811,8 +1866,10 @@ qdio_handler(struct ccw_device *cdev, unsigned long intparm, struct irb *irb)
 
 	qdio_irq_check_sense(irq_ptr->irq, irb);
 
+#ifdef CONFIG_QDIO_DEBUG
 	sprintf(dbf_text, "state:%d", irq_ptr->state);
 	QDIO_DBF_TEXT4(0, trace, dbf_text);
+#endif /* CONFIG_QDIO_DEBUG */
 
         cstat = irb->scsw.cstat;
         dstat = irb->scsw.dstat;
@@ -1853,18 +1910,22 @@ qdio_synchronize(struct ccw_device *cdev, unsigned int flags,
 	int cc;
 	struct qdio_q *q;
 	struct qdio_irq *irq_ptr;
-	char dbf_text[15]="SyncXXXX";
 	void *ptr;
+#ifdef CONFIG_QDIO_DEBUG
+	char dbf_text[15]="SyncXXXX";
+#endif
 
 	irq_ptr = cdev->private->qdio_data;
 	if (!irq_ptr)
 		return -ENODEV;
 
+#ifdef CONFIG_QDIO_DEBUG
 	*((int*)(&dbf_text[4])) = irq_ptr->irq;
 	QDIO_DBF_HEX4(0,trace,dbf_text,QDIO_DBF_TRACE_LEN);
 	*((int*)(&dbf_text[0]))=flags;
 	*((int*)(&dbf_text[4]))=queue_number;
 	QDIO_DBF_HEX4(0,trace,dbf_text,QDIO_DBF_TRACE_LEN);
+#endif /* CONFIG_QDIO_DEBUG */
 
 	if (flags&QDIO_FLAG_SYNC_INPUT) {
 		q=irq_ptr->input_qs[queue_number];
@@ -1971,77 +2032,36 @@ out:
 static unsigned int
 tiqdio_check_chsc_availability(void)
 {
-	int result;
 	char dbf_text[15];
 
-	struct {
-		struct chsc_header request;
-		u32 reserved1;
-		u32 reserved2;
-		u32 reserved3;
-		struct chsc_header response;
-		u32 reserved4;
-		u32 general_char[510];
-		u32 chsc_char[518];
-	} *scsc_area;
-		
-	scsc_area = (void *)get_zeroed_page(GFP_KERNEL | GFP_DMA);
-	if (!scsc_area) {
-	        QDIO_PRINT_WARN("Was not able to determine available" \
-				"CHSCs due to no memory.\n");
-		return -ENOMEM;
-	}
-
-	scsc_area->request = (struct chsc_header) {
-		.length = 0x0010,
-		.code   = 0x0010,
-	};
-
-	result=chsc(scsc_area);
-	if (result) {
-		QDIO_PRINT_WARN("Was not able to determine " \
-				"available CHSCs, cc=%i.\n",
-				result);
-		result=-EIO;
-		goto exit;
-	}
+	if (!css_characteristics_avail)
+		return -EIO;
 
-	if (scsc_area->response.code != 1) {
-		QDIO_PRINT_WARN("Was not able to determine " \
-				"available CHSCs.\n");
-		result=-EIO;
-		goto exit;
-	}
 	/* Check for bit 41. */
-	if ((scsc_area->general_char[1] & 0x00400000) != 0x00400000) {
+	if (!css_general_characteristics.aif) {
 		QDIO_PRINT_WARN("Adapter interruption facility not " \
 				"installed.\n");
-		result=-ENOENT;
-		goto exit;
+		return -ENOENT;
 	}
 	/* Check for bits 107 and 108. */
-	if ((scsc_area->chsc_char[3] & 0x00180000) != 0x00180000) {
+	if (!css_chsc_characteristics.scssc ||
+	    !css_chsc_characteristics.scsscf) {
 		QDIO_PRINT_WARN("Set Chan Subsys. Char. & Fast-CHSCs " \
 				"not available.\n");
-		result=-ENOENT;
-		goto exit;
+		return -ENOENT;
 	}
 
 	/* Check for OSA/FCP thin interrupts (bit 67). */
-	hydra_thinints = ((scsc_area->general_char[2] & 0x10000000)
-		== 0x10000000);
+	hydra_thinints = css_general_characteristics.aif_osa;
 	sprintf(dbf_text,"hydrati%1x", hydra_thinints);
 	QDIO_DBF_TEXT0(0,setup,dbf_text);
 
 	/* Check for aif time delay disablement fac (bit 56). If installed,
 	 * omit svs even under lpar (good point by rick again) */
-	omit_svs = ((scsc_area->general_char[1] & 0x00000080)
-		== 0x00000080);
+	omit_svs = css_general_characteristics.aif_tdd;
 	sprintf(dbf_text,"omitsvs%1x", omit_svs);
 	QDIO_DBF_TEXT0(0,setup,dbf_text);
-exit:
-	free_page ((unsigned long) scsc_area);
-	return result;
+	return 0;
 }
 
 
@@ -3105,11 +3125,12 @@ do_QDIO(struct ccw_device *cdev,unsigned int callflags,
 	unsigned int count,struct qdio_buffer *buffers)
 {
 	struct qdio_irq *irq_ptr;
-
+#ifdef CONFIG_QDIO_DEBUG
 	char dbf_text[20];
 
 	sprintf(dbf_text,"doQD%04x",cdev->private->irq);
-	QDIO_DBF_TEXT3(0,trace,dbf_text);
+ 	QDIO_DBF_TEXT3(0,trace,dbf_text);
+#endif /* CONFIG_QDIO_DEBUG */
 
 	if ( (qidx>QDIO_MAX_BUFFERS_PER_Q) ||
 	     (count>QDIO_MAX_BUFFERS_PER_Q) ||
@@ -3123,6 +3144,7 @@ do_QDIO(struct ccw_device *cdev,unsigned int callflags,
 	if (!irq_ptr)
 		return -ENODEV;
 
+#ifdef CONFIG_QDIO_DEBUG
 	if (callflags&QDIO_FLAG_SYNC_INPUT)
 		QDIO_DBF_HEX3(0,trace,&irq_ptr->input_qs[queue_number],
 			      sizeof(void*));
@@ -3133,6 +3155,7 @@ do_QDIO(struct ccw_device *cdev,unsigned int callflags,
 	QDIO_DBF_TEXT3(0,trace,dbf_text);
 	sprintf(dbf_text,"qi%02xct%02x",qidx,count);
 	QDIO_DBF_TEXT3(0,trace,dbf_text);
+#endif /* CONFIG_QDIO_DEBUG */
 
 	if (irq_ptr->state!=QDIO_IRQ_STATE_ACTIVE)
 		return -EBUSY;
@@ -3283,12 +3306,12 @@ qdio_unregister_dbf_views(void)
 		debug_unregister(qdio_dbf_sense);
 	if (qdio_dbf_trace)
 		debug_unregister(qdio_dbf_trace);
-#ifdef QDIO_DBF_LIKE_HELL
+#ifdef CONFIG_QDIO_DEBUG
         if (qdio_dbf_slsb_out)
                 debug_unregister(qdio_dbf_slsb_out);
         if (qdio_dbf_slsb_in)
                 debug_unregister(qdio_dbf_slsb_in);
-#endif /* QDIO_DBF_LIKE_HELL */
+#endif /* CONFIG_QDIO_DEBUG */
 }
 
 static int
@@ -3333,7 +3356,7 @@ qdio_register_dbf_views(void)
 	debug_register_view(qdio_dbf_trace,&debug_hex_ascii_view);
 	debug_set_level(qdio_dbf_trace,QDIO_DBF_TRACE_LEVEL);
 
-#ifdef QDIO_DBF_LIKE_HELL
+#ifdef CONFIG_QDIO_DEBUG
         qdio_dbf_slsb_out=debug_register(QDIO_DBF_SLSB_OUT_NAME,
                                          QDIO_DBF_SLSB_OUT_INDEX,
                                          QDIO_DBF_SLSB_OUT_NR_AREAS,
@@ -3351,7 +3374,7 @@ qdio_register_dbf_views(void)
 		goto oom;
         debug_register_view(qdio_dbf_slsb_in,&debug_hex_ascii_view);
         debug_set_level(qdio_dbf_slsb_in,QDIO_DBF_SLSB_IN_LEVEL);
-#endif /* QDIO_DBF_LIKE_HELL */
+#endif /* CONFIG_QDIO_DEBUG */
 	return 0;
 oom:
 	QDIO_PRINT_ERR("not enough memory for dbf.\n");
diff --git a/drivers/s390/cio/qdio.h b/drivers/s390/cio/qdio.h
index 0922d4dac..9ad14db24 100644
--- a/drivers/s390/cio/qdio.h
+++ b/drivers/s390/cio/qdio.h
@@ -1,15 +1,13 @@
 #ifndef _CIO_QDIO_H
 #define _CIO_QDIO_H
 
-#define VERSION_CIO_QDIO_H "$Revision: 1.23 $"
+#define VERSION_CIO_QDIO_H "$Revision: 1.26 $"
 
-//#define QDIO_DBF_LIKE_HELL
-
-#ifdef QDIO_DBF_LIKE_HELL
+#ifdef CONFIG_QDIO_DEBUG
 #define QDIO_VERBOSE_LEVEL 9
-#else /* QDIO_DBF_LIKE_HELL */
+#else /* CONFIG_QDIO_DEBUG */
 #define QDIO_VERBOSE_LEVEL 5
-#endif /* QDIO_DBF_LIKE_HELL */
+#endif /* CONFIG_QDIO_DEBUG */
 
 #define QDIO_USE_PROCESSING_STATE
 
@@ -103,75 +101,75 @@ enum qdio_irq_states {
 #define QDIO_DBF_HEX0(ex,name,addr,len) QDIO_DBF_HEX(ex,name,0,addr,len)
 #define QDIO_DBF_HEX1(ex,name,addr,len) QDIO_DBF_HEX(ex,name,1,addr,len)
 #define QDIO_DBF_HEX2(ex,name,addr,len) QDIO_DBF_HEX(ex,name,2,addr,len)
-#ifdef QDIO_DBF_LIKE_HELL
+#ifdef CONFIG_QDIO_DEBUG
 #define QDIO_DBF_HEX3(ex,name,addr,len) QDIO_DBF_HEX(ex,name,3,addr,len)
 #define QDIO_DBF_HEX4(ex,name,addr,len) QDIO_DBF_HEX(ex,name,4,addr,len)
 #define QDIO_DBF_HEX5(ex,name,addr,len) QDIO_DBF_HEX(ex,name,5,addr,len)
 #define QDIO_DBF_HEX6(ex,name,addr,len) QDIO_DBF_HEX(ex,name,6,addr,len)
-#else /* QDIO_DBF_LIKE_HELL */
+#else /* CONFIG_QDIO_DEBUG */
 #define QDIO_DBF_HEX3(ex,name,addr,len) do {} while (0)
 #define QDIO_DBF_HEX4(ex,name,addr,len) do {} while (0)
 #define QDIO_DBF_HEX5(ex,name,addr,len) do {} while (0)
 #define QDIO_DBF_HEX6(ex,name,addr,len) do {} while (0)
-#endif /* QDIO_DBF_LIKE_HELL */
+#endif /* CONFIG_QDIO_DEBUG */
 
 #define QDIO_DBF_TEXT0(ex,name,text) QDIO_DBF_TEXT(ex,name,0,text)
 #define QDIO_DBF_TEXT1(ex,name,text) QDIO_DBF_TEXT(ex,name,1,text)
 #define QDIO_DBF_TEXT2(ex,name,text) QDIO_DBF_TEXT(ex,name,2,text)
-#ifdef QDIO_DBF_LIKE_HELL
+#ifdef CONFIG_QDIO_DEBUG
 #define QDIO_DBF_TEXT3(ex,name,text) QDIO_DBF_TEXT(ex,name,3,text)
 #define QDIO_DBF_TEXT4(ex,name,text) QDIO_DBF_TEXT(ex,name,4,text)
 #define QDIO_DBF_TEXT5(ex,name,text) QDIO_DBF_TEXT(ex,name,5,text)
 #define QDIO_DBF_TEXT6(ex,name,text) QDIO_DBF_TEXT(ex,name,6,text)
-#else /* QDIO_DBF_LIKE_HELL */
+#else /* CONFIG_QDIO_DEBUG */
 #define QDIO_DBF_TEXT3(ex,name,text) do {} while (0)
 #define QDIO_DBF_TEXT4(ex,name,text) do {} while (0)
 #define QDIO_DBF_TEXT5(ex,name,text) do {} while (0)
 #define QDIO_DBF_TEXT6(ex,name,text) do {} while (0)
-#endif /* QDIO_DBF_LIKE_HELL */
+#endif /* CONFIG_QDIO_DEBUG */
 
 #define QDIO_DBF_SETUP_NAME "qdio_setup"
 #define QDIO_DBF_SETUP_LEN 8
 #define QDIO_DBF_SETUP_INDEX 2
 #define QDIO_DBF_SETUP_NR_AREAS 1
-#ifdef QDIO_DBF_LIKE_HELL
+#ifdef CONFIG_QDIO_DEBUG
 #define QDIO_DBF_SETUP_LEVEL 6
-#else /* QDIO_DBF_LIKE_HELL */
+#else /* CONFIG_QDIO_DEBUG */
 #define QDIO_DBF_SETUP_LEVEL 2
-#endif /* QDIO_DBF_LIKE_HELL */
+#endif /* CONFIG_QDIO_DEBUG */
 
 #define QDIO_DBF_SBAL_NAME "qdio_labs" /* sbal */
 #define QDIO_DBF_SBAL_LEN 256
 #define QDIO_DBF_SBAL_INDEX 2
 #define QDIO_DBF_SBAL_NR_AREAS 2
-#ifdef QDIO_DBF_LIKE_HELL
+#ifdef CONFIG_QDIO_DEBUG
 #define QDIO_DBF_SBAL_LEVEL 6
-#else /* QDIO_DBF_LIKE_HELL */
+#else /* CONFIG_QDIO_DEBUG */
 #define QDIO_DBF_SBAL_LEVEL 2
-#endif /* QDIO_DBF_LIKE_HELL */
+#endif /* CONFIG_QDIO_DEBUG */
 
 #define QDIO_DBF_TRACE_NAME "qdio_trace"
 #define QDIO_DBF_TRACE_LEN 8
 #define QDIO_DBF_TRACE_NR_AREAS 2
-#ifdef QDIO_DBF_LIKE_HELL
+#ifdef CONFIG_QDIO_DEBUG
 #define QDIO_DBF_TRACE_INDEX 4
 #define QDIO_DBF_TRACE_LEVEL 4 /* -------- could be even more verbose here */
-#else /* QDIO_DBF_LIKE_HELL */
+#else /* CONFIG_QDIO_DEBUG */
 #define QDIO_DBF_TRACE_INDEX 2
 #define QDIO_DBF_TRACE_LEVEL 2
-#endif /* QDIO_DBF_LIKE_HELL */
+#endif /* CONFIG_QDIO_DEBUG */
 
 #define QDIO_DBF_SENSE_NAME "qdio_sense"
 #define QDIO_DBF_SENSE_LEN 64
 #define QDIO_DBF_SENSE_INDEX 1
 #define QDIO_DBF_SENSE_NR_AREAS 1
-#ifdef QDIO_DBF_LIKE_HELL
+#ifdef CONFIG_QDIO_DEBUG
 #define QDIO_DBF_SENSE_LEVEL 6
-#else /* QDIO_DBF_LIKE_HELL */
+#else /* CONFIG_QDIO_DEBUG */
 #define QDIO_DBF_SENSE_LEVEL 2
-#endif /* QDIO_DBF_LIKE_HELL */
+#endif /* CONFIG_QDIO_DEBUG */
 
-#ifdef QDIO_DBF_LIKE_HELL
+#ifdef CONFIG_QDIO_DEBUG
 #define QDIO_TRACE_QTYPE QDIO_ZFCP_QFMT
 
 #define QDIO_DBF_SLSB_OUT_NAME "qdio_slsb_out"
@@ -185,7 +183,7 @@ enum qdio_irq_states {
 #define QDIO_DBF_SLSB_IN_INDEX 8
 #define QDIO_DBF_SLSB_IN_NR_AREAS 1
 #define QDIO_DBF_SLSB_IN_LEVEL 6
-#endif /* QDIO_DBF_LIKE_HELL */
+#endif /* CONFIG_QDIO_DEBUG */
 
 #define QDIO_PRINTK_HEADER QDIO_NAME ": "
 
@@ -494,7 +492,7 @@ struct qdio_perf_stats {
 #define QDIO_GET_ADDR(x) ((__u32)(long)x)
 #endif /* CONFIG_ARCH_S390X */
 
-#ifdef QDIO_DBF_LIKE_HELL 
+#ifdef CONFIG_QDIO_DEBUG
 #define set_slsb(x,y) \
   if(q->queue_type==QDIO_TRACE_QTYPE) { \
         if(q->is_input_q) { \
@@ -511,13 +509,15 @@ struct qdio_perf_stats {
             QDIO_DBF_HEX2(0,slsb_out,&q->slsb,QDIO_MAX_BUFFERS_PER_Q); \
         } \
   }
-#else /* QDIO_DBF_LIKE_HELL */
+#else /* CONFIG_QDIO_DEBUG */
 #define set_slsb(x,y) qdio_set_slsb(x,y)
-#endif /* QDIO_DBF_LIKE_HELL */
+#endif /* CONFIG_QDIO_DEBUG */
 
 struct qdio_q {
 	volatile struct slsb slsb;
 
+	char unused[QDIO_MAX_BUFFERS_PER_Q];
+
 	__u32 * volatile dev_st_chg_ind;
 
 	int is_input_q;
diff --git a/drivers/s390/net/Makefile b/drivers/s390/net/Makefile
index 8befcd6ea..2cfd22b2f 100644
--- a/drivers/s390/net/Makefile
+++ b/drivers/s390/net/Makefile
@@ -2,7 +2,7 @@
 # S/390 network devices
 #
 
-ctc-objs := ctcmain.o ctctty.o
+ctc-objs := ctcmain.o ctctty.o ctcdbug.o
 
 obj-$(CONFIG_IUCV) += iucv.o
 obj-$(CONFIG_NETIUCV) += netiucv.o fsm.o
diff --git a/drivers/s390/net/ctcdbug.c b/drivers/s390/net/ctcdbug.c
index ba004e0aa..2c86bfa11 100644
--- a/drivers/s390/net/ctcdbug.c
+++ b/drivers/s390/net/ctcdbug.c
@@ -1,15 +1,15 @@
 /*
  *
- * linux/drivers/s390/net/ctcdbug.c ($Revision: 1.1 $)
+ * linux/drivers/s390/net/ctcdbug.c ($Revision: 1.4 $)
  *
- * Linux on zSeries OSA Express and HiperSockets support
+ * CTC / ESCON network driver - s390 dbf exploit.
  *
  * Copyright 2000,2003 IBM Corporation
  *
  *    Author(s): Original Code written by
  *			  Peter Tiedemann (ptiedem@de.ibm.com)
  *
- *    $Revision: 1.1 $	 $Date: 2004/07/02 16:31:22 $
+ *    $Revision: 1.4 $	 $Date: 2004/08/04 10:11:59 $
  *
  * 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
@@ -31,51 +31,51 @@
 /**
  * Debug Facility Stuff
  */
-debug_info_t *dbf_setup = NULL;
-debug_info_t *dbf_data = NULL;
-debug_info_t *dbf_trace = NULL;
+debug_info_t *ctc_dbf_setup = NULL;
+debug_info_t *ctc_dbf_data = NULL;
+debug_info_t *ctc_dbf_trace = NULL;
 
-DEFINE_PER_CPU(char[256], dbf_txt_buf);
+DEFINE_PER_CPU(char[256], ctc_dbf_txt_buf);
 
 void
-unregister_dbf_views(void)
+ctc_unregister_dbf_views(void)
 {
-	if (dbf_setup)
-		debug_unregister(dbf_setup);
-	if (dbf_data)
-		debug_unregister(dbf_data);
-	if (dbf_trace)
-		debug_unregister(dbf_trace);
+	if (ctc_dbf_setup)
+		debug_unregister(ctc_dbf_setup);
+	if (ctc_dbf_data)
+		debug_unregister(ctc_dbf_data);
+	if (ctc_dbf_trace)
+		debug_unregister(ctc_dbf_trace);
 }
 int
-register_dbf_views(void)
+ctc_register_dbf_views(void)
 {
-	dbf_setup = debug_register(CTC_DBF_SETUP_NAME,
+	ctc_dbf_setup = debug_register(CTC_DBF_SETUP_NAME,
 					CTC_DBF_SETUP_INDEX,
 					CTC_DBF_SETUP_NR_AREAS,
 					CTC_DBF_SETUP_LEN);
-	dbf_data = debug_register(CTC_DBF_DATA_NAME,
+	ctc_dbf_data = debug_register(CTC_DBF_DATA_NAME,
 				       CTC_DBF_DATA_INDEX,
 				       CTC_DBF_DATA_NR_AREAS,
 				       CTC_DBF_DATA_LEN);
-	dbf_trace = debug_register(CTC_DBF_TRACE_NAME,
+	ctc_dbf_trace = debug_register(CTC_DBF_TRACE_NAME,
 					CTC_DBF_TRACE_INDEX,
 					CTC_DBF_TRACE_NR_AREAS,
 					CTC_DBF_TRACE_LEN);
 
-	if ((dbf_setup == NULL) || (dbf_data == NULL) ||
-	    (dbf_trace == NULL)) {
-		unregister_dbf_views();
+	if ((ctc_dbf_setup == NULL) || (ctc_dbf_data == NULL) ||
+	    (ctc_dbf_trace == NULL)) {
+		ctc_unregister_dbf_views();
 		return -ENOMEM;
 	}
-	debug_register_view(dbf_setup, &debug_hex_ascii_view);
-	debug_set_level(dbf_setup, CTC_DBF_SETUP_LEVEL);
+	debug_register_view(ctc_dbf_setup, &debug_hex_ascii_view);
+	debug_set_level(ctc_dbf_setup, CTC_DBF_SETUP_LEVEL);
 
-	debug_register_view(dbf_data, &debug_hex_ascii_view);
-	debug_set_level(dbf_data, CTC_DBF_DATA_LEVEL);
+	debug_register_view(ctc_dbf_data, &debug_hex_ascii_view);
+	debug_set_level(ctc_dbf_data, CTC_DBF_DATA_LEVEL);
 
-	debug_register_view(dbf_trace, &debug_hex_ascii_view);
-	debug_set_level(dbf_trace, CTC_DBF_TRACE_LEVEL);
+	debug_register_view(ctc_dbf_trace, &debug_hex_ascii_view);
+	debug_set_level(ctc_dbf_trace, CTC_DBF_TRACE_LEVEL);
 
 	return 0;
 }
diff --git a/drivers/s390/net/ctcdbug.h b/drivers/s390/net/ctcdbug.h
index 447fd1abf..5c0fcfc05 100644
--- a/drivers/s390/net/ctcdbug.h
+++ b/drivers/s390/net/ctcdbug.h
@@ -1,15 +1,15 @@
 /*
  *
- * linux/drivers/s390/net/ctcdbug.h ($Revision: 1.1 $)
+ * linux/drivers/s390/net/ctcdbug.h ($Revision: 1.3 $)
  *
- * Linux on zSeries OSA Express and HiperSockets support
+ * CTC / ESCON network driver - s390 dbf exploit.
  *
  * Copyright 2000,2003 IBM Corporation
  *
  *    Author(s): Original Code written by
  *			  Peter Tiedemann (ptiedem@de.ibm.com)
  *
- *    $Revision: 1.1 $	 $Date: 2004/07/02 16:31:22 $
+ *    $Revision: 1.3 $	 $Date: 2004/07/28 12:27:54 $
  *
  * 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
@@ -51,38 +51,38 @@
 
 #define DBF_TEXT(name,level,text) \
 	do { \
-		debug_text_event(dbf_##name,level,text); \
+		debug_text_event(ctc_dbf_##name,level,text); \
 	} while (0)
 
 #define DBF_HEX(name,level,addr,len) \
 	do { \
-		debug_event(dbf_##name,level,(void*)(addr),len); \
+		debug_event(ctc_dbf_##name,level,(void*)(addr),len); \
 	} while (0)
 
-extern DEFINE_PER_CPU(char[256], dbf_txt_buf);
-extern debug_info_t *dbf_setup;
-extern debug_info_t *dbf_data;
-extern debug_info_t *dbf_trace;
+extern DEFINE_PER_CPU(char[256], ctc_dbf_txt_buf);
+extern debug_info_t *ctc_dbf_setup;
+extern debug_info_t *ctc_dbf_data;
+extern debug_info_t *ctc_dbf_trace;
 
 
 #define DBF_TEXT_(name,level,text...)				\
 	do {								\
-		char* dbf_txt_buf = get_cpu_var(dbf_txt_buf);	\
-		sprintf(dbf_txt_buf, text);			  	\
-		debug_text_event(dbf_##name,level,dbf_txt_buf);	\
-		put_cpu_var(dbf_txt_buf);				\
+		char* ctc_dbf_txt_buf = get_cpu_var(ctc_dbf_txt_buf);	\
+		sprintf(ctc_dbf_txt_buf, text);			  	\
+		debug_text_event(ctc_dbf_##name,level,ctc_dbf_txt_buf);	\
+		put_cpu_var(ctc_dbf_txt_buf);				\
 	} while (0)
 
 #define DBF_SPRINTF(name,level,text...) \
 	do { \
-		debug_sprintf_event(dbf_trace, level, ##text ); \
-		debug_sprintf_event(dbf_trace, level, text ); \
+		debug_sprintf_event(ctc_dbf_trace, level, ##text ); \
+		debug_sprintf_event(ctc_dbf_trace, level, text ); \
 	} while (0)
 
 
-int register_dbf_views(void);
+int ctc_register_dbf_views(void);
 
-void unregister_dbf_views(void);
+void ctc_unregister_dbf_views(void);
 
 /**
  * some more debug stuff
diff --git a/drivers/s390/net/ctcmain.c b/drivers/s390/net/ctcmain.c
index bb534b7ec..6a1cb3f86 100644
--- a/drivers/s390/net/ctcmain.c
+++ b/drivers/s390/net/ctcmain.c
@@ -1,5 +1,5 @@
 /*
- * $Id: ctcmain.c,v 1.59 2004/04/21 17:10:13 ptiedem Exp $
+ * $Id: ctcmain.c,v 1.63 2004/07/28 12:27:54 ptiedem Exp $
  *
  * CTC / ESCON network driver
  *
@@ -36,7 +36,7 @@
  * along with this program; if not, write to the Free Software
  * Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
  *
- * RELEASE-TAG: CTC/ESCON network driver $Revision: 1.59 $
+ * RELEASE-TAG: CTC/ESCON network driver $Revision: 1.63 $
  *
  */
 
@@ -73,6 +73,7 @@
 #include "ctctty.h"
 #include "fsm.h"
 #include "cu3088.h"
+#include "ctcdbug.h"
 
 MODULE_AUTHOR("(C) 2000 IBM Corp. by Fritz Elfert (felfert@millenux.com)");
 MODULE_DESCRIPTION("Linux for S/390 CTC/Escon Driver");
@@ -319,7 +320,7 @@ static void
 print_banner(void)
 {
 	static int printed = 0;
-	char vbuf[] = "$Revision: 1.59 $";
+	char vbuf[] = "$Revision: 1.63 $";
 	char *version = vbuf;
 
 	if (printed)
@@ -616,8 +617,9 @@ ctc_unpack_skb(struct channel *ch, struct sk_buff *pskb)
 {
 	struct net_device *dev = ch->netdev;
 	struct ctc_priv *privptr = (struct ctc_priv *) dev->priv;
-
 	__u16 len = *((__u16 *) pskb->data);
+
+	DBF_TEXT(trace, 4, __FUNCTION__);
 	skb_put(pskb, 2 + LL_HEADER_LENGTH);
 	skb_pull(pskb, 2);
 	pskb->dev = dev;
@@ -722,7 +724,7 @@ ctc_unpack_skb(struct channel *ch, struct sk_buff *pskb)
 		if (ch->protocol == CTC_PROTO_LINUX_TTY)
 			ctc_tty_netif_rx(skb);
 		else
-			netif_rx(skb);
+			netif_rx_ni(skb);
 		/**
 		 * Successful rx; reset logflags
 		 */
@@ -759,6 +761,7 @@ ctc_unpack_skb(struct channel *ch, struct sk_buff *pskb)
 static void inline
 ccw_check_return_code(struct channel *ch, int return_code, char *msg)
 {
+	DBF_TEXT(trace, 5, __FUNCTION__);
 	switch (return_code) {
 		case 0:
 			fsm_event(ch->fsm, CH_EVENT_IO_SUCCESS, ch);
@@ -793,6 +796,7 @@ ccw_check_return_code(struct channel *ch, int return_code, char *msg)
 static void inline
 ccw_unit_check(struct channel *ch, unsigned char sense)
 {
+	DBF_TEXT(trace, 5, __FUNCTION__);
 	if (sense & SNS0_INTERVENTION_REQ) {
 		if (sense & 0x01) {
 			if (ch->protocol != CTC_PROTO_LINUX_TTY)
@@ -838,6 +842,8 @@ ctc_purge_skb_queue(struct sk_buff_head *q)
 {
 	struct sk_buff *skb;
 
+	DBF_TEXT(trace, 5, __FUNCTION__);
+
 	while ((skb = skb_dequeue(q))) {
 		atomic_dec(&skb->users);
 		dev_kfree_skb_irq(skb);
@@ -847,6 +853,7 @@ ctc_purge_skb_queue(struct sk_buff_head *q)
 static __inline__ int
 ctc_checkalloc_buffer(struct channel *ch, int warn)
 {
+	DBF_TEXT(trace, 5, __FUNCTION__);
 	if ((ch->trans_skb == NULL) ||
 	    (ch->flags & CHANNEL_FLAGS_BUFSIZE_CHANGED)) {
 		if (ch->trans_skb != NULL)
@@ -913,9 +920,12 @@ ch_action_txdone(fsm_instance * fi, int event, void *arg)
 	struct sk_buff *skb;
 	int first = 1;
 	int i;
-
+	unsigned long duration;
 	struct timespec done_stamp = xtime;
-	unsigned long duration =
+
+	DBF_TEXT(trace, 4, __FUNCTION__);
+
+	duration =
 	    (done_stamp.tv_sec - ch->prof.send_stamp.tv_sec) * 1000000 +
 	    (done_stamp.tv_nsec - ch->prof.send_stamp.tv_nsec) / 1000;
 	if (duration > ch->prof.tx_time)
@@ -996,6 +1006,7 @@ ch_action_txidle(fsm_instance * fi, int event, void *arg)
 {
 	struct channel *ch = (struct channel *) arg;
 
+	DBF_TEXT(trace, 4, __FUNCTION__);
 	fsm_deltimer(&ch->timer);
 	fsm_newstate(fi, CH_STATE_TXIDLE);
 	fsm_event(((struct ctc_priv *) ch->netdev->priv)->fsm, DEV_EVENT_TXUP,
@@ -1022,6 +1033,7 @@ ch_action_rx(fsm_instance * fi, int event, void *arg)
 	int check_len;
 	int rc;
 
+	DBF_TEXT(trace, 4, __FUNCTION__);
 	fsm_deltimer(&ch->timer);
 	if (len < 8) {
 		ctc_pr_debug("%s: got packet with length %d < 8\n",
@@ -1092,6 +1104,8 @@ ch_action_firstio(fsm_instance * fi, int event, void *arg)
 	struct channel *ch = (struct channel *) arg;
 	int rc;
 
+	DBF_TEXT(trace, 4, __FUNCTION__);
+
 	if (fsm_getstate(fi) == CH_STATE_TXIDLE)
 		ctc_pr_debug("%s: remote side issued READ?, init ...\n", ch->id);
 	fsm_deltimer(&ch->timer);
@@ -1166,6 +1180,7 @@ ch_action_rxidle(fsm_instance * fi, int event, void *arg)
 	__u16 buflen;
 	int rc;
 
+	DBF_TEXT(trace, 4, __FUNCTION__);
 	fsm_deltimer(&ch->timer);
 	buflen = *((__u16 *) ch->trans_skb->data);
 #ifdef DEBUG
@@ -1205,6 +1220,7 @@ ch_action_setmode(fsm_instance * fi, int event, void *arg)
 	int rc;
 	unsigned long saveflags;
 
+	DBF_TEXT(trace, 4, __FUNCTION__);
 	fsm_deltimer(&ch->timer);
 	fsm_addtimer(&ch->timer, CTC_TIMEOUT_5SEC, CH_EVENT_TIMER, ch);
 	fsm_newstate(fi, CH_STATE_SETUPWAIT);
@@ -1236,6 +1252,7 @@ ch_action_start(fsm_instance * fi, int event, void *arg)
 	int rc;
 	struct net_device *dev;
 
+	DBF_TEXT(trace, 4, __FUNCTION__);
 	if (ch == NULL) {
 		ctc_pr_warn("ch_action_start ch=NULL\n");
 		return;
@@ -1315,6 +1332,7 @@ ch_action_haltio(fsm_instance * fi, int event, void *arg)
 	int rc;
 	int oldstate;
 
+	DBF_TEXT(trace, 3, __FUNCTION__);
 	fsm_deltimer(&ch->timer);
 	fsm_addtimer(&ch->timer, CTC_TIMEOUT_5SEC, CH_EVENT_TIMER, ch);
 	if (event == CH_EVENT_STOP)
@@ -1347,6 +1365,7 @@ ch_action_stopped(fsm_instance * fi, int event, void *arg)
 	struct channel *ch = (struct channel *) arg;
 	struct net_device *dev = ch->netdev;
 
+	DBF_TEXT(trace, 3, __FUNCTION__);
 	fsm_deltimer(&ch->timer);
 	fsm_newstate(fi, CH_STATE_STOPPED);
 	if (ch->trans_skb != NULL) {
@@ -1398,6 +1417,7 @@ ch_action_fail(fsm_instance * fi, int event, void *arg)
 	struct channel *ch = (struct channel *) arg;
 	struct net_device *dev = ch->netdev;
 
+	DBF_TEXT(trace, 3, __FUNCTION__);
 	fsm_deltimer(&ch->timer);
 	fsm_newstate(fi, CH_STATE_NOTOP);
 	if (CHANNEL_DIRECTION(ch->flags) == READ) {
@@ -1428,6 +1448,7 @@ ch_action_setuperr(fsm_instance * fi, int event, void *arg)
 	struct channel *ch = (struct channel *) arg;
 	struct net_device *dev = ch->netdev;
 
+	DBF_TEXT(setup, 3, __FUNCTION__);
 	/**
 	 * Special case: Got UC_RCRESET on setmode.
 	 * This means that remote side isn't setup. In this case
@@ -1480,6 +1501,7 @@ ch_action_restart(fsm_instance * fi, int event, void *arg)
 	struct channel *ch = (struct channel *) arg;
 	struct net_device *dev = ch->netdev;
 
+	DBF_TEXT(trace, 3, __FUNCTION__);
 	fsm_deltimer(&ch->timer);
 	ctc_pr_debug("%s: %s channel restart\n", dev->name,
 		     (CHANNEL_DIRECTION(ch->flags) == READ) ? "RX" : "TX");
@@ -1514,6 +1536,7 @@ ch_action_rxiniterr(fsm_instance * fi, int event, void *arg)
 	struct channel *ch = (struct channel *) arg;
 	struct net_device *dev = ch->netdev;
 
+	DBF_TEXT(setup, 3, __FUNCTION__);
 	if (event == CH_EVENT_TIMER) {
 		fsm_deltimer(&ch->timer);
 		ctc_pr_debug("%s: Timeout during RX init handshake\n", dev->name);
@@ -1542,6 +1565,7 @@ ch_action_rxinitfail(fsm_instance * fi, int event, void *arg)
 	struct channel *ch = (struct channel *) arg;
 	struct net_device *dev = ch->netdev;
 
+	DBF_TEXT(setup, 3, __FUNCTION__);
 	fsm_newstate(fi, CH_STATE_RXERR);
 	ctc_pr_warn("%s: RX initialization failed\n", dev->name);
 	ctc_pr_warn("%s: RX <-> RX connection detected\n", dev->name);
@@ -1562,6 +1586,7 @@ ch_action_rxdisc(fsm_instance * fi, int event, void *arg)
 	struct channel *ch2;
 	struct net_device *dev = ch->netdev;
 
+	DBF_TEXT(trace, 3, __FUNCTION__);
 	fsm_deltimer(&ch->timer);
 	ctc_pr_debug("%s: Got remote disconnect, re-initializing ...\n",
 		     dev->name);
@@ -1593,6 +1618,7 @@ ch_action_txiniterr(fsm_instance * fi, int event, void *arg)
 	struct channel *ch = (struct channel *) arg;
 	struct net_device *dev = ch->netdev;
 
+	DBF_TEXT(setup, 2, __FUNCTION__);
 	if (event == CH_EVENT_TIMER) {
 		fsm_deltimer(&ch->timer);
 		ctc_pr_debug("%s: Timeout during TX init handshake\n", dev->name);
@@ -1621,6 +1647,7 @@ ch_action_txretry(fsm_instance * fi, int event, void *arg)
 	struct net_device *dev = ch->netdev;
 	unsigned long saveflags;
 
+	DBF_TEXT(trace, 4, __FUNCTION__);
 	fsm_deltimer(&ch->timer);
 	if (ch->retry++ > 3) {
 		ctc_pr_debug("%s: TX retry failed, restarting channel\n",
@@ -1678,6 +1705,7 @@ ch_action_iofatal(fsm_instance * fi, int event, void *arg)
 	struct channel *ch = (struct channel *) arg;
 	struct net_device *dev = ch->netdev;
 
+	DBF_TEXT(trace, 3, __FUNCTION__);
 	fsm_deltimer(&ch->timer);
 	if (CHANNEL_DIRECTION(ch->flags) == READ) {
 		ctc_pr_debug("%s: RX I/O error\n", dev->name);
@@ -1699,6 +1727,7 @@ ch_action_reinit(fsm_instance *fi, int event, void *arg)
  	struct net_device *dev = ch->netdev;
  	struct ctc_priv *privptr = dev->priv;
  
+	DBF_TEXT(trace, 4, __FUNCTION__);
  	ch_action_iofatal(fi, event, arg);
  	fsm_addtimer(&privptr->restart_timer, 1000, DEV_EVENT_RESTART, dev);
 }
@@ -1849,6 +1878,7 @@ add_channel(struct ccw_device *cdev, enum channel_types type)
 	struct channel **c = &channels;
 	struct channel *ch;
 
+	DBF_TEXT(trace, 2, __FUNCTION__);
 	if ((ch =
 	     (struct channel *) kmalloc(sizeof (struct channel),
 					GFP_KERNEL)) == NULL) {
@@ -1954,6 +1984,7 @@ channel_remove(struct channel *ch)
 {
 	struct channel **c = &channels;
 
+	DBF_TEXT(trace, 2, __FUNCTION__);
 	if (ch == NULL)
 		return;
 
@@ -1990,6 +2021,7 @@ channel_get(enum channel_types type, char *id, int direction)
 {
 	struct channel *ch = channels;
 
+	DBF_TEXT(trace, 3, __FUNCTION__);
 #ifdef DEBUG
 	ctc_pr_debug("ctc: %s(): searching for ch with id %s and type %d\n",
 		     __func__, id, type);
@@ -2085,6 +2117,7 @@ ctc_irq_handler(struct ccw_device *cdev, unsigned long intparm, struct irb *irb)
 	struct net_device *dev;
 	struct ctc_priv *priv;
 
+	DBF_TEXT(trace, 5, __FUNCTION__);
 	if (__ctc_check_irb_error(cdev, irb))
 		return;
 
@@ -2178,6 +2211,7 @@ dev_action_start(fsm_instance * fi, int event, void *arg)
 	struct ctc_priv *privptr = dev->priv;
 	int direction;
 
+	DBF_TEXT(setup, 3, __FUNCTION__);
 	fsm_deltimer(&privptr->restart_timer);
 	fsm_newstate(fi, DEV_STATE_STARTWAIT_RXTX);
 	for (direction = READ; direction <= WRITE; direction++) {
@@ -2200,6 +2234,7 @@ dev_action_stop(fsm_instance * fi, int event, void *arg)
 	struct ctc_priv *privptr = dev->priv;
 	int direction;
 
+	DBF_TEXT(trace, 3, __FUNCTION__);
 	fsm_newstate(fi, DEV_STATE_STOPWAIT_RXTX);
 	for (direction = READ; direction <= WRITE; direction++) {
 		struct channel *ch = privptr->channel[direction];
@@ -2212,6 +2247,7 @@ dev_action_restart(fsm_instance *fi, int event, void *arg)
 	struct net_device *dev = (struct net_device *)arg;
 	struct ctc_priv *privptr = dev->priv;
 	
+	DBF_TEXT(trace, 3, __FUNCTION__);
 	ctc_pr_debug("%s: Restarting\n", dev->name);
 	dev_action_stop(fi, event, arg);
 	fsm_event(privptr->fsm, DEV_EVENT_STOP, dev);
@@ -2233,6 +2269,7 @@ dev_action_chup(fsm_instance * fi, int event, void *arg)
 	struct net_device *dev = (struct net_device *) arg;
 	struct ctc_priv *privptr = dev->priv;
 
+	DBF_TEXT(trace, 3, __FUNCTION__);
 	switch (fsm_getstate(fi)) {
 		case DEV_STATE_STARTWAIT_RXTX:
 			if (event == DEV_EVENT_RXUP)
@@ -2285,6 +2322,7 @@ dev_action_chdown(fsm_instance * fi, int event, void *arg)
 	struct net_device *dev = (struct net_device *) arg;
 	struct ctc_priv *privptr = dev->priv;
 
+	DBF_TEXT(trace, 3, __FUNCTION__);
 	switch (fsm_getstate(fi)) {
 		case DEV_STATE_RUNNING:
 			if (privptr->protocol == CTC_PROTO_LINUX_TTY)
@@ -2386,6 +2424,7 @@ transmit_skb(struct channel *ch, struct sk_buff *skb)
 	struct ll_header header;
 	int rc = 0;
 
+	DBF_TEXT(trace, 5, __FUNCTION__);
 	if (fsm_getstate(ch->fsm) != CH_STATE_TXIDLE) {
 		int l = skb->len + LL_HEADER_LENGTH;
 
@@ -2522,6 +2561,7 @@ transmit_skb(struct channel *ch, struct sk_buff *skb)
 static int
 ctc_open(struct net_device * dev)
 {
+	DBF_TEXT(trace, 5, __FUNCTION__);
 	fsm_event(((struct ctc_priv *) dev->priv)->fsm, DEV_EVENT_START, dev);
 	return 0;
 }
@@ -2537,6 +2577,7 @@ ctc_open(struct net_device * dev)
 static int
 ctc_close(struct net_device * dev)
 {
+	DBF_TEXT(trace, 5, __FUNCTION__);
 	fsm_event(((struct ctc_priv *) dev->priv)->fsm, DEV_EVENT_STOP, dev);
 	return 0;
 }
@@ -2558,6 +2599,7 @@ ctc_tx(struct sk_buff *skb, struct net_device * dev)
 	int rc = 0;
 	struct ctc_priv *privptr = (struct ctc_priv *) dev->priv;
 
+	DBF_TEXT(trace, 5, __FUNCTION__);
 	/**
 	 * Some sanity checks ...
 	 */
@@ -2615,6 +2657,7 @@ ctc_change_mtu(struct net_device * dev, int new_mtu)
 {
 	struct ctc_priv *privptr = (struct ctc_priv *) dev->priv;
 
+	DBF_TEXT(trace, 3, __FUNCTION__);
 	if ((new_mtu < 576) || (new_mtu > 65527) ||
 	    (new_mtu > (privptr->channel[READ]->max_bufsize -
 			LL_HEADER_LENGTH - 2)))
@@ -2659,6 +2702,7 @@ buffer_write(struct device *dev, const char *buf, size_t count)
 	struct net_device *ndev;
 	int bs1;
 
+	DBF_TEXT(trace, 5, __FUNCTION__);
 	priv = dev->driver_data;
 	if (!priv)
 		return -ENODEV;
@@ -2703,6 +2747,7 @@ loglevel_write(struct device *dev, const char *buf, size_t count)
 	struct ctc_priv *priv;
 	int ll1;
 
+	DBF_TEXT(trace, 5, __FUNCTION__);
 	priv = dev->driver_data;
 	if (!priv)
 		return -ENODEV;
@@ -2720,6 +2765,7 @@ ctc_print_statistics(struct ctc_priv *priv)
 	char *sbuf;
 	char *p;
 
+	DBF_TEXT(trace, 4, __FUNCTION__);
 	if (!priv)
 		return;
 	sbuf = (char *)kmalloc(2048, GFP_KERNEL);
@@ -2849,6 +2895,7 @@ ctc_init_netdevice(struct net_device * dev, int alloc_device,
 	if (!privptr)
 		return NULL;
 
+	DBF_TEXT(setup, 3, __FUNCTION__);
 	if (alloc_device) {
 		dev = kmalloc(sizeof (struct net_device), GFP_KERNEL);
 		if (!dev)
@@ -2900,6 +2947,7 @@ ctc_proto_store(struct device *dev, const char *buf, size_t count)
 	struct ctc_priv *priv;
 	int value;
 
+	DBF_TEXT(trace, 3, __FUNCTION__);
 	pr_debug("%s() called\n", __FUNCTION__);
 
 	priv = dev->driver_data;
@@ -2971,6 +3019,7 @@ ctc_probe_device(struct ccwgroup_device *cgdev)
 	int rc;
 
 	pr_debug("%s() called\n", __FUNCTION__);
+	DBF_TEXT(trace, 3, __FUNCTION__);
 
 	if (!get_device(&cgdev->dev))
 		return -ENODEV;
@@ -3017,6 +3066,7 @@ ctc_new_device(struct ccwgroup_device *cgdev)
 	int ret;
 
 	pr_debug("%s() called\n", __FUNCTION__);
+	DBF_TEXT(setup, 3, __FUNCTION__);
 
 	privptr = cgdev->dev.driver_data;
 	if (!privptr)
@@ -3052,9 +3102,9 @@ ctc_new_device(struct ccwgroup_device *cgdev)
 	}
 
 	if (privptr->protocol == CTC_PROTO_LINUX_TTY)
-		snprintf(dev->name, 8, "ctctty%%d");
+		strlcpy(dev->name, "ctctty%d", IFNAMSIZ);
 	else
-		snprintf(dev->name, 8, "ctc%%d");
+		strlcpy(dev->name, "ctc%d", IFNAMSIZ);
 
 	for (direction = READ; direction <= WRITE; direction++) {
 		privptr->channel[direction] =
@@ -3110,7 +3160,7 @@ ctc_shutdown_device(struct ccwgroup_device *cgdev)
 	struct ctc_priv *priv;
 	struct net_device *ndev;
 		
-
+	DBF_TEXT(trace, 3, __FUNCTION__);
 	pr_debug("%s() called\n", __FUNCTION__);
 
 	priv = cgdev->dev.driver_data;
@@ -3161,6 +3211,7 @@ ctc_remove_device(struct ccwgroup_device *cgdev)
 	struct ctc_priv *priv;
 
 	pr_debug("%s() called\n", __FUNCTION__);
+	DBF_TEXT(trace, 3, __FUNCTION__);
 
 	priv = cgdev->dev.driver_data;
 	if (!priv)
@@ -3199,6 +3250,7 @@ ctc_exit(void)
 {
 	unregister_cu3088_discipline(&ctc_group_driver);
 	ctc_tty_cleanup();
+	ctc_unregister_dbf_views();
 	ctc_pr_info("CTC driver unloaded\n");
 }
 
@@ -3215,10 +3267,17 @@ ctc_init(void)
 
 	print_banner();
 
+	ret = ctc_register_dbf_views();
+	if (ret){
+		ctc_pr_crit("ctc_init failed with ctc_register_dbf_views rc = %d\n", ret);
+		return ret;
+	}
 	ctc_tty_init();
 	ret = register_cu3088_discipline(&ctc_group_driver);
-	if (ret) 
+	if (ret) {
 		ctc_tty_cleanup();
+		ctc_unregister_dbf_views();
+	}
 	return ret;
 }
 
diff --git a/drivers/s390/net/ctctty.c b/drivers/s390/net/ctctty.c
index 3755f9947..6290b5c56 100644
--- a/drivers/s390/net/ctctty.c
+++ b/drivers/s390/net/ctctty.c
@@ -1,5 +1,5 @@
 /*
- * $Id: ctctty.c,v 1.17 2004/03/31 17:06:34 ptiedem Exp $
+ * $Id: ctctty.c,v 1.26 2004/08/04 11:06:55 mschwide Exp $
  *
  * CTC / ESCON network driver, tty interface.
  *
@@ -27,9 +27,11 @@
 #include <linux/tty.h>
 #include <linux/serial_reg.h>
 #include <linux/interrupt.h>
+#include <linux/delay.h>
 #include <asm/uaccess.h>
 #include <linux/devfs_fs_kernel.h>
 #include "ctctty.h"
+#include "ctcdbug.h"
 
 #define CTC_TTY_MAJOR       43
 #define CTC_TTY_MAX_DEVICES 64
@@ -103,6 +105,7 @@ ctc_tty_try_read(ctc_tty_info * info, struct sk_buff *skb)
 	int len;
 	struct tty_struct *tty;
 
+	DBF_TEXT(trace, 5, __FUNCTION__);
 	if ((tty = info->tty)) {
 		if (info->mcr & UART_MCR_RTS) {
 			c = TTY_FLIPBUF_SIZE - tty->flip.count;
@@ -132,6 +135,7 @@ ctc_tty_readmodem(ctc_tty_info *info)
 	int ret = 1;
 	struct tty_struct *tty;
 
+	DBF_TEXT(trace, 5, __FUNCTION__);
 	if ((tty = info->tty)) {
 		if (info->mcr & UART_MCR_RTS) {
 			int c = TTY_FLIPBUF_SIZE - tty->flip.count;
@@ -165,6 +169,7 @@ ctc_tty_setcarrier(struct net_device *netdev, int on)
 {
 	int i;
 
+	DBF_TEXT(trace, 4, __FUNCTION__);
 	if ((!driver) || ctc_tty_shuttingdown)
 		return;
 	for (i = 0; i < CTC_TTY_MAX_DEVICES; i++)
@@ -185,6 +190,7 @@ ctc_tty_netif_rx(struct sk_buff *skb)
 	int i;
 	ctc_tty_info *info = NULL;
 
+	DBF_TEXT(trace, 5, __FUNCTION__);
 	if (!skb)
 		return;
 	if ((!skb->dev) || (!driver) || ctc_tty_shuttingdown) {
@@ -249,6 +255,7 @@ ctc_tty_tint(ctc_tty_info * info)
 	int wake = 1;
 	int rc;
 
+	DBF_TEXT(trace, 4, __FUNCTION__);
 	if (!info->netdev) {
 		if (skb)
 			kfree_skb(skb);
@@ -341,6 +348,7 @@ ctc_tty_inject(ctc_tty_info *info, char c)
 	int skb_res;
 	struct sk_buff *skb;
 	
+	DBF_TEXT(trace, 4, __FUNCTION__);
 	if (ctc_tty_shuttingdown)
 		return;
 	skb_res = info->netdev->hard_header_len + sizeof(info->mcr) +
@@ -361,6 +369,7 @@ ctc_tty_inject(ctc_tty_info *info, char c)
 static void
 ctc_tty_transmit_status(ctc_tty_info *info)
 {
+	DBF_TEXT(trace, 5, __FUNCTION__);
 	if (ctc_tty_shuttingdown)
 		return;
 	info->flags |= CTC_ASYNC_TX_LINESTAT;
@@ -374,6 +383,7 @@ ctc_tty_change_speed(ctc_tty_info * info)
 	unsigned int quot;
 	int i;
 
+	DBF_TEXT(trace, 3, __FUNCTION__);
 	if (!info->tty || !info->tty->termios)
 		return;
 	cflag = info->tty->termios->c_cflag;
@@ -412,6 +422,7 @@ ctc_tty_change_speed(ctc_tty_info * info)
 static int
 ctc_tty_startup(ctc_tty_info * info)
 {
+	DBF_TEXT(trace, 3, __FUNCTION__);
 	if (info->flags & CTC_ASYNC_INITIALIZED)
 		return 0;
 #ifdef CTC_DEBUG_MODEM_OPEN
@@ -454,6 +465,7 @@ ctc_tty_stopdev(unsigned long data)
 static void
 ctc_tty_shutdown(ctc_tty_info * info)
 {
+	DBF_TEXT(trace, 3, __FUNCTION__);
 	if (!(info->flags & CTC_ASYNC_INITIALIZED))
 		return;
 #ifdef CTC_DEBUG_MODEM_OPEN
@@ -486,14 +498,17 @@ ctc_tty_write(struct tty_struct *tty, int from_user, const u_char * buf, int cou
 	int total = 0;
 	ctc_tty_info *info = (ctc_tty_info *) tty->driver_data;
 
+	DBF_TEXT(trace, 5, __FUNCTION__);
 	if (ctc_tty_shuttingdown)
-		return 0;
+		goto ex;
 	if (ctc_tty_paranoia_check(info, tty->name, "ctc_tty_write"))
-		return 0;
+		goto ex;
 	if (!tty)
-		return 0;
-	if (!info->netdev)
-		return -ENODEV;
+		goto ex;
+	if (!info->netdev) {
+		total = -ENODEV;
+		goto ex;
+	}
 	if (from_user)
 		down(&info->write_sem);
 	while (1) {
@@ -530,6 +545,8 @@ ctc_tty_write(struct tty_struct *tty, int from_user, const u_char * buf, int cou
 	}
 	if (from_user)
 		up(&info->write_sem);
+ex:
+	DBF_TEXT(trace, 6, __FUNCTION__);
 	return total;
 }
 
@@ -559,13 +576,14 @@ ctc_tty_flush_buffer(struct tty_struct *tty)
 	ctc_tty_info *info;
 	unsigned long flags;
 
+	DBF_TEXT(trace, 4, __FUNCTION__);
 	if (!tty)
-		return;
+		goto ex;
 	spin_lock_irqsave(&ctc_tty_lock, flags);
 	info = (ctc_tty_info *) tty->driver_data;
 	if (ctc_tty_paranoia_check(info, tty->name, "ctc_tty_flush_buffer")) {
 		spin_unlock_irqrestore(&ctc_tty_lock, flags);
-		return;
+		goto ex;
 	}
 	skb_queue_purge(&info->tx_queue);
 	info->lsr |= UART_LSR_TEMT;
@@ -574,6 +592,9 @@ ctc_tty_flush_buffer(struct tty_struct *tty)
 	if ((tty->flags & (1 << TTY_DO_WRITE_WAKEUP)) &&
 	    tty->ldisc.write_wakeup)
 		(tty->ldisc.write_wakeup) (tty);
+ex:
+	DBF_TEXT_(trace, 2, "ex: %s ", __FUNCTION__);
+	return;
 }
 
 static void
@@ -581,6 +602,7 @@ ctc_tty_flush_chars(struct tty_struct *tty)
 {
 	ctc_tty_info *info = (ctc_tty_info *) tty->driver_data;
 
+	DBF_TEXT(trace, 4, __FUNCTION__);
 	if (ctc_tty_shuttingdown)
 		return;
 	if (ctc_tty_paranoia_check(info, tty->name, "ctc_tty_flush_chars"))
@@ -603,6 +625,7 @@ ctc_tty_throttle(struct tty_struct *tty)
 {
 	ctc_tty_info *info = (ctc_tty_info *) tty->driver_data;
 
+	DBF_TEXT(trace, 4, __FUNCTION__);
 	if (ctc_tty_paranoia_check(info, tty->name, "ctc_tty_throttle"))
 		return;
 	info->mcr &= ~UART_MCR_RTS;
@@ -616,6 +639,7 @@ ctc_tty_unthrottle(struct tty_struct *tty)
 {
 	ctc_tty_info *info = (ctc_tty_info *) tty->driver_data;
 
+	DBF_TEXT(trace, 4, __FUNCTION__);
 	if (ctc_tty_paranoia_check(info, tty->name, "ctc_tty_unthrottle"))
 		return;
 	info->mcr |= UART_MCR_RTS;
@@ -647,6 +671,7 @@ ctc_tty_get_lsr_info(ctc_tty_info * info, uint __user *value)
 	uint result;
 	ulong flags;
 
+	DBF_TEXT(trace, 4, __FUNCTION__);
 	spin_lock_irqsave(&ctc_tty_lock, flags);
 	status = info->lsr;
 	spin_unlock_irqrestore(&ctc_tty_lock, flags);
@@ -664,6 +689,7 @@ static int ctc_tty_tiocmget(struct tty_struct *tty, struct file *file)
 	uint result;
 	ulong flags;
 
+	DBF_TEXT(trace, 4, __FUNCTION__);
 	if (ctc_tty_paranoia_check(info, tty->name, "ctc_tty_ioctl"))
 		return -ENODEV;
 	if (tty->flags & (1 << TTY_IO_ERROR))
@@ -688,6 +714,7 @@ ctc_tty_tiocmset(struct tty_struct *tty, struct file *file,
 {
 	ctc_tty_info *info = (ctc_tty_info *) tty->driver_data;
 
+	DBF_TEXT(trace, 4, __FUNCTION__);
 	if (ctc_tty_paranoia_check(info, tty->name, "ctc_tty_ioctl"))
 		return -ENODEV;
 	if (tty->flags & (1 << TTY_IO_ERROR))
@@ -716,6 +743,7 @@ ctc_tty_ioctl(struct tty_struct *tty, struct file *file,
 	int error;
 	int retval;
 
+	DBF_TEXT(trace, 4, __FUNCTION__);
 	if (ctc_tty_paranoia_check(info, tty->name, "ctc_tty_ioctl"))
 		return -ENODEV;
 	if (tty->flags & (1 << TTY_IO_ERROR))
@@ -784,6 +812,7 @@ ctc_tty_set_termios(struct tty_struct *tty, struct termios *old_termios)
 	ctc_tty_info *info = (ctc_tty_info *) tty->driver_data;
 	unsigned int cflag = tty->termios->c_cflag;
 
+	DBF_TEXT(trace, 4, __FUNCTION__);
 	ctc_tty_change_speed(info);
 
 	/* Handle transition to B0 */
@@ -821,6 +850,7 @@ ctc_tty_block_til_ready(struct tty_struct *tty, struct file *filp, ctc_tty_info
 	unsigned long flags;
 	int retval;
 
+	DBF_TEXT(trace, 4, __FUNCTION__);
 	/*
 	 * If the device is in the middle of being closed, then block
 	 * until it's done, and then try again.
@@ -925,6 +955,7 @@ ctc_tty_open(struct tty_struct *tty, struct file *filp)
 	int retval,
 	 line;
 
+	DBF_TEXT(trace, 3, __FUNCTION__);
 	line = tty->index;
 	if (line < 0 || line > CTC_TTY_MAX_DEVICES)
 		return -ENODEV;
@@ -971,7 +1002,7 @@ ctc_tty_close(struct tty_struct *tty, struct file *filp)
 	ctc_tty_info *info = (ctc_tty_info *) tty->driver_data;
 	ulong flags;
 	ulong timeout;
-
+	DBF_TEXT(trace, 3, __FUNCTION__);
 	if (!info || ctc_tty_paranoia_check(info, tty->name, "ctc_tty_close"))
 		return;
 	spin_lock_irqsave(&ctc_tty_lock, flags);
@@ -1023,17 +1054,18 @@ ctc_tty_close(struct tty_struct *tty, struct file *filp)
 		 */
 		timeout = jiffies + HZ;
 		while (!(info->lsr & UART_LSR_TEMT)) {
-			set_current_state(TASK_INTERRUPTIBLE);
 			spin_unlock_irqrestore(&ctc_tty_lock, flags);
-			schedule_timeout(HZ/2);
+			msleep(500);
 			spin_lock_irqsave(&ctc_tty_lock, flags);
 			if (time_after(jiffies,timeout))
 				break;
 		}
 	}
 	ctc_tty_shutdown(info);
-	if (tty->driver->flush_buffer)
-		tty->driver->flush_buffer(tty);
+	if (tty->driver->flush_buffer) {
+		skb_queue_purge(&info->tx_queue);
+		info->lsr |= UART_LSR_TEMT;
+	}
 	if (tty->ldisc.flush_buffer)
 		tty->ldisc.flush_buffer(tty);
 	info->tty = 0;
@@ -1059,7 +1091,7 @@ ctc_tty_hangup(struct tty_struct *tty)
 {
 	ctc_tty_info *info = (ctc_tty_info *)tty->driver_data;
 	unsigned long saveflags;
-
+	DBF_TEXT(trace, 3, __FUNCTION__);
 	if (ctc_tty_paranoia_check(info, tty->name, "ctc_tty_hangup"))
 		return;
 	ctc_tty_shutdown(info);
@@ -1083,6 +1115,7 @@ ctc_tty_task(unsigned long arg)
 	unsigned long saveflags;
 	int again;
 
+	DBF_TEXT(trace, 3, __FUNCTION__);
 	spin_lock_irqsave(&ctc_tty_lock, saveflags);
 	if ((!ctc_tty_shuttingdown) && info) {
 		again = ctc_tty_tint(info);
@@ -1120,6 +1153,7 @@ ctc_tty_init(void)
 	ctc_tty_info *info;
 	struct tty_driver *device;
 
+	DBF_TEXT(trace, 2, __FUNCTION__);
 	driver = kmalloc(sizeof(ctc_tty_driver), GFP_KERNEL);
 	if (driver == NULL) {
 		printk(KERN_WARNING "Out of memory in ctc_tty_modem_init\n");
@@ -1179,12 +1213,28 @@ ctc_tty_register_netdev(struct net_device *dev) {
 	char *err;
 	char *p;
 
+	DBF_TEXT(trace, 2, __FUNCTION__);
 	if ((!dev) || (!dev->name)) {
 		printk(KERN_WARNING
 		       "ctc_tty_register_netdev called "
 		       "with NULL dev or NULL dev-name\n");
 		return -1;
 	}
+
+	/*
+	 *	If the name is a format string the caller wants us to
+	 *	do a name allocation : format string must end with %d
+	 */
+	if (strchr(dev->name, '%'))
+	{
+		int err = dev_alloc_name(dev, dev->name);	// dev->name is changed by this
+		if (err < 0) {
+			printk(KERN_DEBUG "dev_alloc returned error %d\n", err);
+			return err;
+		}
+
+	}
+
 	for (p = dev->name; p && ((*p < '0') || (*p > '9')); p++);
 	ttynum = simple_strtoul(p, &err, 0);
 	if ((ttynum < 0) || (ttynum >= CTC_TTY_MAX_DEVICES) ||
@@ -1211,6 +1261,7 @@ ctc_tty_unregister_netdev(struct net_device *dev) {
 	unsigned long saveflags;
 	ctc_tty_info *info = NULL;
 
+	DBF_TEXT(trace, 2, __FUNCTION__);
 	spin_lock_irqsave(&ctc_tty_lock, saveflags);
 	for (i = 0; i < CTC_TTY_MAX_DEVICES; i++)
 		if (driver->info[i].netdev == dev) {
@@ -1229,6 +1280,7 @@ void
 ctc_tty_cleanup(void) {
 	unsigned long saveflags;
 	
+	DBF_TEXT(trace, 2, __FUNCTION__);
 	spin_lock_irqsave(&ctc_tty_lock, saveflags);
 	ctc_tty_shuttingdown = 1;
 	spin_unlock_irqrestore(&ctc_tty_lock, saveflags);
diff --git a/drivers/s390/net/cu3088.c b/drivers/s390/net/cu3088.c
index b79d08b42..1b0a9f160 100644
--- a/drivers/s390/net/cu3088.c
+++ b/drivers/s390/net/cu3088.c
@@ -1,5 +1,5 @@
 /*
- * $Id: cu3088.c,v 1.33 2003/10/14 12:10:19 cohuck Exp $
+ * $Id: cu3088.c,v 1.34 2004/06/15 13:16:27 pavlic Exp $
  *
  * CTC / LCS ccw_device driver
  *
@@ -38,7 +38,7 @@ const char *cu3088_type[] = {
 	"ESCON channel",
 	"FICON channel",
 	"P390 LCS card",
-	"OSA2 card",
+	"OSA LCS card",
 	"unknown channel type",
 	"unsupported channel type",
 };
diff --git a/drivers/s390/net/iucv.c b/drivers/s390/net/iucv.c
index 36790af32..8c63753c3 100644
--- a/drivers/s390/net/iucv.c
+++ b/drivers/s390/net/iucv.c
@@ -1,5 +1,5 @@
 /* 
- * $Id: iucv.c,v 1.33 2004/05/24 10:19:18 braunu Exp $
+ * $Id: iucv.c,v 1.40 2004/08/04 12:29:33 cborntra Exp $
  *
  * IUCV network driver
  *
@@ -29,7 +29,7 @@
  * along with this program; if not, write to the Free Software
  * Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
  *
- * RELEASE-TAG: IUCV lowlevel driver $Revision: 1.33 $
+ * RELEASE-TAG: IUCV lowlevel driver $Revision: 1.40 $
  *
  */
 
@@ -53,6 +53,7 @@
 #include <asm/io.h>
 #include <asm/s390_ext.h>
 #include <asm/ebcdic.h>
+#include <asm/smp.h>
 #include <asm/ccwdev.h> //for root device stuff
 
 /* FLAGS:
@@ -177,9 +178,11 @@ static handler **iucv_pathid_table;
 static unsigned long max_connections;
 
 /**
- * declare_flag: is 0 when iucv_declare_buffer has not been called
+ * iucv_cpuid: contains the logical cpu number of the cpu which
+ * has declared the iucv buffer by issuing DECLARE_BUFFER.
+ * If no cpu has done the initialization iucv_cpuid contains -1.
  */
-static int declare_flag;
+static int iucv_cpuid = -1;
 /**
  * register_flag: is 0 when external interrupt has not been registered
  */
@@ -352,7 +355,7 @@ do { \
 static void
 iucv_banner(void)
 {
-	char vbuf[] = "$Revision: 1.33 $";
+	char vbuf[] = "$Revision: 1.40 $";
 	char *version = vbuf;
 
 	if ((version = strchr(version, ':'))) {
@@ -384,7 +387,7 @@ iucv_init(void)
 	}
 
 	ret = bus_register(&iucv_bus);
-	if (ret != 0) {
+	if (ret) {
 		printk(KERN_ERR "IUCV: failed to register bus.\n");
 		return ret;
 	}
@@ -525,7 +528,7 @@ iucv_add_handler (handler *new)
 		 */
 		list_for_each(lh, &iucv_handler_table) {
 			handler *h = list_entry(lh, handler, list);
-			if (memcmp(&new->id, &h->id, sizeof(h->id)) == 0) {
+			if (!memcmp(&new->id, &h->id, sizeof(h->id))) {
 				iucv_debug(1, "ret 1");
 				spin_unlock_irqrestore (&iucv_lock, flags);
 				return 1;
@@ -631,17 +634,15 @@ iucv_remove_pathid(__u16 pathid)
 }
 
 /**
- * iucv_declare_buffer_cpu0
- * Register at VM for subsequent IUCV operations. This is always
- * executed on CPU 0. Called from iucv_declare_buffer().
+ * iucv_declare_buffer_cpuid
+ * Register at VM for subsequent IUCV operations. This is executed
+ * on the reserved CPU iucv_cpuid. Called from iucv_declare_buffer().
  */
 static void
-iucv_declare_buffer_cpu0 (void *result)
+iucv_declare_buffer_cpuid (void *result)
 {
 	iparml_db *parm;
 
-	if (!(result && (smp_processor_id() == 0)))
-		return;
 	parm = (iparml_db *)grab_param();
 	parm->ipbfadr1 = virt_to_phys(iucv_external_int_buffer);
 	if ((*((ulong *)result) = b2f0(DECLARE_BUFFER, parm)) == 1)
@@ -650,17 +651,16 @@ iucv_declare_buffer_cpu0 (void *result)
 }
 
 /**
- * iucv_retrieve_buffer_cpu0:
- * Unregister IUCV usage at VM. This is always executed on CPU 0.
+ * iucv_retrieve_buffer_cpuid:
+ * Unregister IUCV usage at VM. This is always executed on the same
+ * cpu that registered the buffer to VM.
  * Called from iucv_retrieve_buffer().
  */
 static void
-iucv_retrieve_buffer_cpu0 (void *result)
+iucv_retrieve_buffer_cpuid (void *cpu)
 {
 	iparml_control *parm;
 
-	if (smp_processor_id() != 0)
-		return;
 	parm = (iparml_control *)grab_param();
 	b2f0(RETRIEVE_BUFFER, parm);
 	release_param(parm);
@@ -676,18 +676,27 @@ iucv_retrieve_buffer_cpu0 (void *result)
 static int
 iucv_declare_buffer (void)
 {
-	ulong b2f0_result = 0x0deadbeef;
+	unsigned long flags;
+	ulong b2f0_result;
 
 	iucv_debug(1, "entering");
-	preempt_disable();
-	if (smp_processor_id() == 0)
-		iucv_declare_buffer_cpu0(&b2f0_result);
-	else
-		smp_call_function(iucv_declare_buffer_cpu0, &b2f0_result, 0, 1);
-	preempt_enable();
-	iucv_debug(1, "Address of EIB = %p", iucv_external_int_buffer);
-	if (b2f0_result == 0x0deadbeef)
-	    b2f0_result = 0xaa;
+	b2f0_result = -ENODEV;
+	spin_lock_irqsave (&iucv_lock, flags);
+	if (iucv_cpuid == -1) {
+		/* Reserve any cpu for use by iucv. */
+		iucv_cpuid = smp_get_cpu(CPU_MASK_ALL);
+		spin_unlock_irqrestore (&iucv_lock, flags);
+		smp_call_function_on(iucv_declare_buffer_cpuid,
+			&b2f0_result, 0, 1, iucv_cpuid);
+		if (b2f0_result) {
+			smp_put_cpu(iucv_cpuid);
+			iucv_cpuid = -1;
+		}
+		iucv_debug(1, "Address of EIB = %p", iucv_external_int_buffer);
+	} else {
+		spin_unlock_irqrestore (&iucv_lock, flags);
+		b2f0_result = 0;
+	}
 	iucv_debug(1, "exiting");
 	return b2f0_result;
 }
@@ -702,14 +711,12 @@ static int
 iucv_retrieve_buffer (void)
 {
 	iucv_debug(1, "entering");
-	if (declare_flag) {
-		preempt_disable();
-		if (smp_processor_id() == 0)
-			iucv_retrieve_buffer_cpu0(0);
-		else
-			smp_call_function(iucv_retrieve_buffer_cpu0, 0, 0, 1);
-		declare_flag = 0;
-		preempt_enable();
+	if (iucv_cpuid != -1) {
+		smp_call_function_on(iucv_retrieve_buffer_cpuid,
+				     0, 0, 1, iucv_cpuid);
+		/* Release the cpu reserved by iucv_declare_buffer. */
+		smp_put_cpu(iucv_cpuid);
+		iucv_cpuid = -1;
 	}
 	iucv_debug(1, "exiting");
 	return 0;
@@ -862,40 +869,33 @@ iucv_register_program (__u8 pgmname[16],
 		return NULL;
 	}
 
-	if (declare_flag == 0) {
-		rc = iucv_declare_buffer();
-		if (rc) {
-			char *err = "Unknown";
-			iucv_remove_handler(new_handler);
-			kfree(new_handler);
-			switch(rc) {
-				case 0x03:
-					err = "Directory error";
-					break;
-				case 0x0a:
-					err = "Invalid length";
-					break;
-				case 0x13:
-					err = "Buffer already exists";
-					break;
-				case 0x3e:
-					err = "Buffer overlap";
-					break;
-				case 0x5c:
-					err = "Paging or storage error";
-					break;
-				case 0xaa:
-					err = "Function not called";
-					break;
-			}
-			printk(KERN_WARNING "%s: iucv_declare_buffer "
-			       "returned error 0x%02lx (%s)\n", __FUNCTION__, rc,
-			       err);
-			return NULL;
+	rc = iucv_declare_buffer();
+	if (rc) {
+		char *err = "Unknown";
+		iucv_remove_handler(new_handler);
+		kfree(new_handler);
+		switch(rc) {
+		case 0x03:
+			err = "Directory error";
+			break;
+		case 0x0a:
+			err = "Invalid length";
+			break;
+		case 0x13:
+			err = "Buffer already exists";
+			break;
+		case 0x3e:
+			err = "Buffer overlap";
+			break;
+		case 0x5c:
+			err = "Paging or storage error";
+			break;
 		}
-		declare_flag = 1;
+		printk(KERN_WARNING "%s: iucv_declare_buffer "
+		       "returned error 0x%02lx (%s)\n", __FUNCTION__, rc, err);
+		return NULL;
 	}
-	if (register_flag == 0) {
+	if (!register_flag) {
 		/* request the 0x4000 external interrupt */
 		rc = register_external_interrupt (0x4000, iucv_irq_handler);
 		if (rc) {
@@ -1045,7 +1045,7 @@ iucv_accept(__u16 pathid, __u16 msglim_reqstd,
 	parm->ipflags1 = (__u8)flags1;
 	b2f0_result = b2f0(ACCEPT, parm);
 
-	if (b2f0_result == 0) {
+	if (!b2f0_result) {
 		if (msglim)
 			*msglim = parm->ipmsglim;
 		if (pgm_data)
@@ -1185,7 +1185,7 @@ iucv_connect (__u16 *pathid, __u16 msglim_reqstd,
 	memcpy(&local_parm, parm, sizeof(local_parm));
 	release_param(parm);
 	parm = &local_parm;
-	if (b2f0_result == 0)
+	if (!b2f0_result)
 		add_pathid_result = __iucv_add_pathid(parm->ippathid, h);
 	spin_unlock_irqrestore (&iucv_lock, flags);
 
@@ -1245,7 +1245,7 @@ iucv_purge (__u16 pathid, __u32 msgid, __u32 srccls, __u32 *audit)
 	parm->ipflags1 |= (IPSRCCLS | IPFGMID | IPFGPID);
 	b2f0_result = b2f0(PURGE, parm);
 
-	if ((b2f0_result == 0) && audit) {
+	if (!b2f0_result && audit) {
 		memcpy(audit, parm->ipaudit, sizeof(parm->ipaudit));
 		/* parm->ipaudit has only 3 bytes */
 		*audit >>= 8;
@@ -1409,7 +1409,7 @@ iucv_receive (__u16 pathid, __u32 msgid, __u32 trgcls,
 
 	b2f0_result = b2f0(RECEIVE, parm);
 
-	if (b2f0_result == 0 || b2f0_result == 5) {
+	if (!b2f0_result || b2f0_result == 5) {
 		if (flags1_out) {
 			iucv_debug(2, "*flags1_out = %d", *flags1_out);
 			*flags1_out = (parm->ipflags1 & (~0x07));
@@ -1499,7 +1499,7 @@ iucv_receive_array (__u16 pathid,
 
 	b2f0_result = b2f0(RECEIVE, parm);
 
-	if (b2f0_result == 0 || b2f0_result == 5) {
+	if (!b2f0_result || b2f0_result == 5) {
 
 		if (flags1_out) {
 			iucv_debug(2, "*flags1_out = %d", *flags1_out);
@@ -1546,7 +1546,7 @@ iucv_receive_array (__u16 pathid,
 				*residual_length = abs (buflen - 8);
 
 			if (residual_buffer) {
-				if (moved == 0)
+				if (!moved)
 					*residual_buffer = (ulong) buffer;
 				else
 					*residual_buffer =
@@ -1648,7 +1648,7 @@ iucv_reply (__u16 pathid,
 
 	b2f0_result = b2f0(REPLY, parm);
 
-	if ((b2f0_result == 0) || (b2f0_result == 5)) {
+	if ((!b2f0_result) || (b2f0_result == 5)) {
 		if (ipbfadr2)
 			*ipbfadr2 = parm->ipbfadr2;
 		if (ipbfln2f)
@@ -1714,7 +1714,7 @@ iucv_reply_array (__u16 pathid,
 
 	b2f0_result = b2f0(REPLY, parm);
 
-	if ((b2f0_result == 0) || (b2f0_result == 5)) {
+	if ((!b2f0_result) || (b2f0_result == 5)) {
 
 		if (ipbfadr2)
 			*ipbfadr2 = parm->ipbfadr2;
@@ -1840,7 +1840,7 @@ iucv_send (__u16 pathid, __u32 * msgid,
 
 	b2f0_result = b2f0(SEND, parm);
 
-	if ((b2f0_result == 0) && (msgid))
+	if ((!b2f0_result) && (msgid))
 		*msgid = parm->ipmsgid;
 	release_param(parm);
 
@@ -1894,7 +1894,7 @@ iucv_send_array (__u16 pathid,
 	parm->ipflags1 = (IPNORPY | IPBUFLST | flags1);
 	b2f0_result = b2f0(SEND, parm);
 
-	if ((b2f0_result == 0) && (msgid))
+	if ((!b2f0_result) && (msgid))
 		*msgid = parm->ipmsgid;
 	release_param(parm);
 
@@ -1940,7 +1940,7 @@ iucv_send_prmmsg (__u16 pathid,
 
 	b2f0_result = b2f0(SEND, parm);
 
-	if ((b2f0_result == 0) && (msgid))
+	if ((!b2f0_result) && (msgid))
 		*msgid = parm->ipmsgid;
 	release_param(parm);
 
@@ -2001,7 +2001,7 @@ iucv_send2way (__u16 pathid,
 
 	b2f0_result = b2f0(SEND, parm);
 
-	if ((b2f0_result == 0) && (msgid))
+	if ((!b2f0_result) && (msgid))
 		*msgid = parm->ipmsgid;
 	release_param(parm);
 
@@ -2062,7 +2062,7 @@ iucv_send2way_array (__u16 pathid,
 	parm->ipmsgtag = msgtag;
 	parm->ipflags1 = (IPBUFLST | IPANSLST | flags1);
 	b2f0_result = b2f0(SEND, parm);
-	if ((b2f0_result == 0) && (msgid))
+	if ((!b2f0_result) && (msgid))
 		*msgid = parm->ipmsgid;
 	release_param(parm);
 
@@ -2120,7 +2120,7 @@ iucv_send2way_prmmsg (__u16 pathid,
 
 	b2f0_result = b2f0(SEND, parm);
 
-	if ((b2f0_result == 0) && (msgid))
+	if ((!b2f0_result) && (msgid))
 		*msgid = parm->ipmsgid;
 	release_param(parm);
 
@@ -2181,7 +2181,7 @@ iucv_send2way_prmmsg_array (__u16 pathid,
 	parm->ipflags1 = (IPRMDATA | IPANSLST | flags1);
 	memcpy(parm->iprmmsg, prmmsg, sizeof(parm->iprmmsg));
 	b2f0_result = b2f0(SEND, parm);
-	if ((b2f0_result == 0) && (msgid))
+	if ((!b2f0_result) && (msgid))
 		*msgid = parm->ipmsgid;
 	release_param(parm);
 
@@ -2190,13 +2190,10 @@ iucv_send2way_prmmsg_array (__u16 pathid,
 }
 
 void
-iucv_setmask_cpu0 (void *result)
+iucv_setmask_cpuid (void *result)
 {
         iparml_set_mask *parm;
 
-        if (smp_processor_id() != 0)
-                return;
-
         iucv_debug(1, "entering");
         parm = (iparml_set_mask *)grab_param();
         parm->ipmask = *((__u8*)result);
@@ -2228,14 +2225,12 @@ iucv_setmask (int SetMaskFlag)
 		ulong result;
 		__u8  param;
 	} u;
+	int cpu;
 
 	u.param = SetMaskFlag;
-	preempt_disable();
-	if (smp_processor_id() == 0)
-		iucv_setmask_cpu0(&u);
-	else
-		smp_call_function(iucv_setmask_cpu0, &u, 0, 1);
-	preempt_enable();
+	cpu = get_cpu();
+	smp_call_function_on(iucv_setmask_cpuid, &u, 0, 1, iucv_cpuid);
+	put_cpu();
 
 	return u.result;
 }
@@ -2363,7 +2358,7 @@ iucv_do_int(iucv_GeneralInterrupt * int_buf)
 				iucv_dumpit("temp_buff2",
 					    temp_buff2, sizeof(temp_buff2));
 				
-				if (memcmp (temp_buff1, temp_buff2, 24) == 0) {
+				if (!memcmp (temp_buff1, temp_buff2, 24)) {
 					
 					iucv_debug(2,
 						   "found a matching handler");
diff --git a/drivers/s390/net/iucv.h b/drivers/s390/net/iucv.h
index b3f5e2d5e..5c0b29aea 100644
--- a/drivers/s390/net/iucv.h
+++ b/drivers/s390/net/iucv.h
@@ -30,6 +30,94 @@
  */
 
 #include <linux/types.h>
+#include <asm/debug.h>
+
+/**
+ * Debug Facility stuff
+ */
+#define IUCV_DBF_SETUP_NAME "iucv_setup"
+#define IUCV_DBF_SETUP_LEN 32
+#define IUCV_DBF_SETUP_INDEX 1
+#define IUCV_DBF_SETUP_NR_AREAS 1
+#define IUCV_DBF_SETUP_LEVEL 3
+
+#define IUCV_DBF_DATA_NAME "iucv_data"
+#define IUCV_DBF_DATA_LEN 128
+#define IUCV_DBF_DATA_INDEX 1
+#define IUCV_DBF_DATA_NR_AREAS 1
+#define IUCV_DBF_DATA_LEVEL 2
+
+#define IUCV_DBF_TRACE_NAME "iucv_trace"
+#define IUCV_DBF_TRACE_LEN 16
+#define IUCV_DBF_TRACE_INDEX 2
+#define IUCV_DBF_TRACE_NR_AREAS 1
+#define IUCV_DBF_TRACE_LEVEL 3
+
+#define IUCV_DBF_TEXT(name,level,text) \
+	do { \
+		debug_text_event(iucv_dbf_##name,level,text); \
+	} while (0)
+
+#define IUCV_DBF_HEX(name,level,addr,len) \
+	do { \
+		debug_event(iucv_dbf_##name,level,(void*)(addr),len); \
+	} while (0)
+
+extern DEFINE_PER_CPU(char[256], iucv_dbf_txt_buf);
+
+#define IUCV_DBF_TEXT_(name,level,text...)				\
+	do {								\
+		char* iucv_dbf_txt_buf = get_cpu_var(iucv_dbf_txt_buf);	\
+		sprintf(iucv_dbf_txt_buf, text);		  	\
+		debug_text_event(iucv_dbf_##name,level,iucv_dbf_txt_buf); \
+		put_cpu_var(iucv_dbf_txt_buf);				\
+	} while (0)
+
+#define IUCV_DBF_SPRINTF(name,level,text...) \
+	do { \
+		debug_sprintf_event(iucv_dbf_trace, level, ##text ); \
+		debug_sprintf_event(iucv_dbf_trace, level, text ); \
+	} while (0)
+
+/**
+ * some more debug stuff
+ */
+#define IUCV_HEXDUMP16(importance,header,ptr) \
+PRINT_##importance(header "%02x %02x %02x %02x  %02x %02x %02x %02x  " \
+		   "%02x %02x %02x %02x  %02x %02x %02x %02x\n", \
+		   *(((char*)ptr)),*(((char*)ptr)+1),*(((char*)ptr)+2), \
+		   *(((char*)ptr)+3),*(((char*)ptr)+4),*(((char*)ptr)+5), \
+		   *(((char*)ptr)+6),*(((char*)ptr)+7),*(((char*)ptr)+8), \
+		   *(((char*)ptr)+9),*(((char*)ptr)+10),*(((char*)ptr)+11), \
+		   *(((char*)ptr)+12),*(((char*)ptr)+13), \
+		   *(((char*)ptr)+14),*(((char*)ptr)+15)); \
+PRINT_##importance(header "%02x %02x %02x %02x  %02x %02x %02x %02x  " \
+		   "%02x %02x %02x %02x  %02x %02x %02x %02x\n", \
+		   *(((char*)ptr)+16),*(((char*)ptr)+17), \
+		   *(((char*)ptr)+18),*(((char*)ptr)+19), \
+		   *(((char*)ptr)+20),*(((char*)ptr)+21), \
+		   *(((char*)ptr)+22),*(((char*)ptr)+23), \
+		   *(((char*)ptr)+24),*(((char*)ptr)+25), \
+		   *(((char*)ptr)+26),*(((char*)ptr)+27), \
+		   *(((char*)ptr)+28),*(((char*)ptr)+29), \
+		   *(((char*)ptr)+30),*(((char*)ptr)+31));
+
+static inline void
+iucv_hex_dump(unsigned char *buf, size_t len)
+{
+	size_t i;
+
+	for (i = 0; i < len; i++) {
+		if (i && !(i % 16))
+			printk("\n");
+		printk("%02x ", *(buf + i));
+	}
+	printk("\n");
+}
+/**
+ * end of debug stuff
+ */
+
 #define uchar  unsigned char
 #define ushort unsigned short
 #define ulong  unsigned long
diff --git a/drivers/s390/net/lcs.c b/drivers/s390/net/lcs.c
index cd581306d..cac57951a 100644
--- a/drivers/s390/net/lcs.c
+++ b/drivers/s390/net/lcs.c
@@ -11,7 +11,7 @@
  *			  Frank Pavlic (pavlic@de.ibm.com) and
  *		 	  Martin Schwidefsky <schwidefsky@de.ibm.com>
  *
- *    $Revision: 1.81 $	 $Date: 2004/05/14 13:54:33 $
+ *    $Revision: 1.85 $	 $Date: 2004/08/04 11:05:43 $
  *
  * 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
@@ -37,6 +37,7 @@
 #include <linux/inetdevice.h>
 #include <linux/in.h>
 #include <linux/igmp.h>
+#include <linux/delay.h>
 #include <net/arp.h>
 #include <net/ip.h>
 
@@ -58,7 +59,7 @@
 /**
  * initialization string for output
  */
-#define VERSION_LCS_C  "$Revision: 1.81 $"
+#define VERSION_LCS_C  "$Revision: 1.85 $"
 
 static char version[] __initdata = "LCS driver ("VERSION_LCS_C "/" VERSION_LCS_H ")";
 static char debug_buffer[255];
@@ -1046,8 +1047,8 @@ lcs_register_mc_addresses(void *data)
 	}
 	spin_unlock(&card->ipm_lock);
 	read_unlock(&in4_dev->lock);
-	lcs_fix_multicast_list(card);
 	in_dev_put(in4_dev);
+	lcs_fix_multicast_list(card);
 	return 0;
 }
 /**
@@ -1420,7 +1421,7 @@ lcs_resetcard(struct lcs_card *card)
 				   card->dev->name);
 			return 0;
 		}
-		schedule_timeout(3 * HZ);
+		msleep(3000);
 	}
 	PRINT_ERR("Error in Reseting LCS card!\n");
 	return -EIO;
diff --git a/drivers/s390/net/lcs.h b/drivers/s390/net/lcs.h
index 36d9ebd92..44cf99060 100644
--- a/drivers/s390/net/lcs.h
+++ b/drivers/s390/net/lcs.h
@@ -6,7 +6,7 @@
 #include <linux/workqueue.h>
 #include <asm/ccwdev.h>
 
-#define VERSION_LCS_H "$Revision: 1.16 $"
+#define VERSION_LCS_H "$Revision: 1.17 $"
 
 #define LCS_DBF_TEXT(level, name, text) \
 	do { \
@@ -221,8 +221,8 @@ struct lcs_cmd {
 				struct lcs_ip_mac_pair
 				ip_mac_pair[32];
 				__u32	  response_data;
-			} lcs_ipass_ctlmsg;
-		} lcs_qipassist;
+			} lcs_ipass_ctlmsg __attribute ((packed));
+		} lcs_qipassist __attribute__ ((packed));
 #endif /*CONFIG_IP_MULTICAST */
 	} cmd __attribute__ ((packed));
 }  __attribute__ ((packed));
diff --git a/drivers/s390/net/netiucv.c b/drivers/s390/net/netiucv.c
index 570a93b67..e95272f1a 100644
--- a/drivers/s390/net/netiucv.c
+++ b/drivers/s390/net/netiucv.c
@@ -1,5 +1,5 @@
 /*
- * $Id: netiucv.c,v 1.54 2004/05/28 08:04:14 braunu Exp $
+ * $Id: netiucv.c,v 1.63 2004/07/27 13:36:05 mschwide Exp $
  *
  * IUCV network driver
  *
@@ -30,7 +30,7 @@
  * along with this program; if not, write to the Free Software
  * Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
  *
- * RELEASE-TAG: IUCV network driver $Revision: 1.54 $
+ * RELEASE-TAG: IUCV network driver $Revision: 1.63 $
  *
  */
 
@@ -69,6 +69,13 @@ MODULE_AUTHOR
 MODULE_DESCRIPTION ("Linux for S/390 IUCV network driver");
 
 
+#define PRINTK_HEADER " iucv: "       /* for debugging */
+
+static struct device_driver netiucv_driver = {
+	.name = "netiucv",
+	.bus  = &iucv_bus,
+};
+
 /**
  * Per connection profiling data
  */
@@ -98,7 +105,6 @@ struct iucv_connection {
 	spinlock_t                collect_lock;
 	int                       collect_len;
 	int                       max_buffsize;
-	int                       flags;
 	fsm_timer                 timer;
 	fsm_instance              *fsm;
 	struct net_device         *netdev;
@@ -106,12 +112,10 @@ struct iucv_connection {
 	char                      userid[9];
 };
 
-#define CONN_FLAGS_BUFSIZE_CHANGED 1
-
 /**
  * Linked list of all connection structs.
  */
-static struct iucv_connection *connections;
+static struct iucv_connection *iucv_connections;
 
 /**
  * Representation of event-data for the
@@ -131,7 +135,6 @@ struct netiucv_priv {
 	fsm_instance            *fsm;
         struct iucv_connection  *conn;
 	struct device           *dev;
-	fsm_timer               timer;
 };
 
 /**
@@ -176,7 +179,7 @@ static __u8 iucvMagic[16] = {
  * match exactly as specified in order to give connection_pending()
  * control.
  */
-static __u8 mask[] = {
+static __u8 netiucv_mask[] = {
 	0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff,
 	0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff,
 	0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff
@@ -232,7 +235,6 @@ enum dev_events {
 	DEV_EVENT_STOP,
 	DEV_EVENT_CONUP,
 	DEV_EVENT_CONDOWN,
-	DEV_EVENT_TIMER,
 	/**
 	 * MUST be always the last element!!
 	 */
@@ -244,7 +246,6 @@ static const char *dev_event_names[] = {
 	"Stop",
 	"Connection up",
 	"Connection down",
-	"Timer",
 };
 
 /**
@@ -367,6 +368,58 @@ static const char *conn_state_names[] = {
 };
 
 
+/**
+ * Debug Facility Stuff
+ */
+static debug_info_t *iucv_dbf_setup = NULL;
+static debug_info_t *iucv_dbf_data = NULL;
+static debug_info_t *iucv_dbf_trace = NULL;
+
+DEFINE_PER_CPU(char[256], iucv_dbf_txt_buf);
+
+static void
+iucv_unregister_dbf_views(void)
+{
+	if (iucv_dbf_setup)
+		debug_unregister(iucv_dbf_setup);
+	if (iucv_dbf_data)
+		debug_unregister(iucv_dbf_data);
+	if (iucv_dbf_trace)
+		debug_unregister(iucv_dbf_trace);
+}
+static int
+iucv_register_dbf_views(void)
+{
+	iucv_dbf_setup = debug_register(IUCV_DBF_SETUP_NAME,
+					IUCV_DBF_SETUP_INDEX,
+					IUCV_DBF_SETUP_NR_AREAS,
+					IUCV_DBF_SETUP_LEN);
+	iucv_dbf_data = debug_register(IUCV_DBF_DATA_NAME,
+				       IUCV_DBF_DATA_INDEX,
+				       IUCV_DBF_DATA_NR_AREAS,
+				       IUCV_DBF_DATA_LEN);
+	iucv_dbf_trace = debug_register(IUCV_DBF_TRACE_NAME,
+					IUCV_DBF_TRACE_INDEX,
+					IUCV_DBF_TRACE_NR_AREAS,
+					IUCV_DBF_TRACE_LEN);
+
+	if ((iucv_dbf_setup == NULL) || (iucv_dbf_data == NULL) ||
+	    (iucv_dbf_trace == NULL)) {
+		iucv_unregister_dbf_views();
+		return -ENOMEM;
+	}
+	debug_register_view(iucv_dbf_setup, &debug_hex_ascii_view);
+	debug_set_level(iucv_dbf_setup, IUCV_DBF_SETUP_LEVEL);
+
+	debug_register_view(iucv_dbf_data, &debug_hex_ascii_view);
+	debug_set_level(iucv_dbf_data, IUCV_DBF_DATA_LEVEL);
+
+	debug_register_view(iucv_dbf_trace, &debug_hex_ascii_view);
+	debug_set_level(iucv_dbf_trace, IUCV_DBF_TRACE_LEVEL);
+
+	return 0;
+}
+
 /**
  * Callback-wrappers, called from lowlevel iucv layer.
  *****************************************************************************/
@@ -496,7 +549,7 @@ netiucv_unpack_skb(struct iucv_connection *conn, struct sk_buff *pskb)
 		struct sk_buff *skb;
 		ll_header *header = (ll_header *)pskb->data;
 
-		if (header->next == 0)
+		if (!header->next)
 			break;
 
 		skb_pull(pskb, NETIUCV_HDRLEN);
@@ -504,19 +557,21 @@ netiucv_unpack_skb(struct iucv_connection *conn, struct sk_buff *pskb)
 		offset += header->next;
 		header->next -= NETIUCV_HDRLEN;
 		if (skb_tailroom(pskb) < header->next) {
-			printk(KERN_WARNING
-			       "%s: Illegal next field in iucv header: "
+			PRINT_WARN("%s: Illegal next field in iucv header: "
 			       "%d > %d\n",
 			       dev->name, header->next, skb_tailroom(pskb));
+			IUCV_DBF_TEXT_(data, 2, "Illegal next field: %d > %d\n",
+				header->next, skb_tailroom(pskb));
 			return;
 		}
 		skb_put(pskb, header->next);
 		pskb->mac.raw = pskb->data;
 		skb = dev_alloc_skb(pskb->len);
 		if (!skb) {
-			printk(KERN_WARNING
-			       "%s Out of memory in netiucv_unpack_skb\n",
+			PRINT_WARN("%s Out of memory in netiucv_unpack_skb\n",
 			       dev->name);
+			IUCV_DBF_TEXT(data, 2,
+				"Out of memory in netiucv_unpack_skb\n");
 			privptr->stats.rx_dropped++;
 			return;
 		}
@@ -544,31 +599,37 @@ conn_action_rx(fsm_instance *fi, int event, void *arg)
 	struct iucv_event *ev = (struct iucv_event *)arg;
 	struct iucv_connection *conn = ev->conn;
 	iucv_MessagePending *eib = (iucv_MessagePending *)ev->data;
-	struct netiucv_priv *privptr = (struct netiucv_priv *)conn->netdev->priv;
+	struct netiucv_priv *privptr =(struct netiucv_priv *)conn->netdev->priv;
 
 	__u32 msglen = eib->ln1msg2.ipbfln1f;
 	int rc;
 
-	pr_debug("%s() called\n", __FUNCTION__);
+	IUCV_DBF_TEXT(trace, 4, __FUNCTION__);
 
 	if (!conn->netdev) {
 		/* FRITZ: How to tell iucv LL to drop the msg? */
-		printk(KERN_WARNING
-		       "Received data for unlinked connection\n"); 
+		PRINT_WARN("Received data for unlinked connection\n");
+		IUCV_DBF_TEXT(data, 2,
+			"Received data for unlinked connection\n");
 		return;
 	}
 	if (msglen > conn->max_buffsize) {
 		/* FRITZ: How to tell iucv LL to drop the msg? */
 		privptr->stats.rx_dropped++;
+		PRINT_WARN("msglen %d > max_buffsize %d\n",
+			msglen, conn->max_buffsize);
+		IUCV_DBF_TEXT_(data, 2, "msglen %d > max_buffsize %d\n",
+			msglen, conn->max_buffsize);
 		return;
 	}
 	conn->rx_buff->data = conn->rx_buff->tail = conn->rx_buff->head;
 	conn->rx_buff->len = 0;
 	rc = iucv_receive(conn->pathid, eib->ipmsgid, eib->iptrgcls,
 			  conn->rx_buff->data, msglen, NULL, NULL, NULL);
-	if (rc != 0 || msglen < 5) {
+	if (rc || msglen < 5) {
 		privptr->stats.rx_errors++;
-		printk(KERN_INFO "iucv_receive returned %08x\n", rc);
+		PRINT_WARN("iucv_receive returned %08x\n", rc);
+		IUCV_DBF_TEXT_(data, 2, "rc %d from iucv_receive\n", rc);
 		return;
 	}
 	netiucv_unpack_skb(conn, conn->rx_buff);
@@ -590,7 +651,7 @@ conn_action_txdone(fsm_instance *fi, int event, void *arg)
 	unsigned long saveflags;
 	ll_header header;
 
-	pr_debug("%s() called\n", __FUNCTION__);
+	IUCV_DBF_TEXT(trace, 4, __FUNCTION__);
 
 	if (conn && conn->netdev && conn->netdev->priv)
 		privptr = (struct netiucv_priv *)conn->netdev->priv;
@@ -640,13 +701,13 @@ conn_action_txdone(fsm_instance *fi, int event, void *arg)
 		conn->prof.tx_pending++;
 		if (conn->prof.tx_pending > conn->prof.tx_max_pending)
 			conn->prof.tx_max_pending = conn->prof.tx_pending;
-		if (rc != 0) {
+		if (rc) {
 			conn->prof.tx_pending--;
 			fsm_newstate(fi, CONN_STATE_IDLE);
 			if (privptr)
 				privptr->stats.tx_errors += txpackets;
-			printk(KERN_INFO "iucv_send returned %08x\n",
-				rc);
+			PRINT_WARN("iucv_send returned %08x\n",	rc);
+			IUCV_DBF_TEXT_(data, 2, "rc %d from iucv_send\n", rc);
 		} else {
 			if (privptr) {
 				privptr->stats.tx_packets += txpackets;
@@ -671,14 +732,14 @@ conn_action_connaccept(fsm_instance *fi, int event, void *arg)
 	__u16 msglimit;
 	__u8 udata[16];
 
-	pr_debug("%s() called\n", __FUNCTION__);
+	IUCV_DBF_TEXT(trace, 3, __FUNCTION__);
 
 	rc = iucv_accept(eib->ippathid, NETIUCV_QUEUELEN_DEFAULT, udata, 0,
 			 conn->handle, conn, NULL, &msglimit);
-	if (rc != 0) {
-		printk(KERN_WARNING
-		       "%s: IUCV accept failed with error %d\n",
+	if (rc) {
+		PRINT_WARN("%s: IUCV accept failed with error %d\n",
 		       netdev->name, rc);
+		IUCV_DBF_TEXT_(setup, 2, "rc %d from iucv_accept", rc);
 		return;
 	}
 	fsm_newstate(fi, CONN_STATE_IDLE);
@@ -696,13 +757,16 @@ conn_action_connreject(fsm_instance *fi, int event, void *arg)
 	iucv_ConnectionPending *eib = (iucv_ConnectionPending *)ev->data;
 	__u8 udata[16];
 
-	pr_debug("%s() called\n", __FUNCTION__);
+	IUCV_DBF_TEXT(trace, 3, __FUNCTION__);
 
 	iucv_sever(eib->ippathid, udata);
 	if (eib->ippathid != conn->pathid) {
-		printk(KERN_INFO
-			"%s: IR pathid %d does not match original pathid %d\n",
+		PRINT_INFO("%s: IR Connection Pending; "
+			"pathid %d does not match original pathid %d\n",
 			netdev->name, eib->ippathid, conn->pathid);
+		IUCV_DBF_TEXT_(data, 2,
+			"connreject: IR pathid %d, conn. pathid %d\n",
+			eib->ippathid, conn->pathid);
 		iucv_sever(conn->pathid, udata);
 	}
 }
@@ -716,14 +780,17 @@ conn_action_connack(fsm_instance *fi, int event, void *arg)
 	struct net_device *netdev = conn->netdev;
 	struct netiucv_priv *privptr = (struct netiucv_priv *)netdev->priv;
 
-	pr_debug("%s() called\n", __FUNCTION__);
+	IUCV_DBF_TEXT(trace, 3, __FUNCTION__);
 
 	fsm_deltimer(&conn->timer);
 	fsm_newstate(fi, CONN_STATE_IDLE);
 	if (eib->ippathid != conn->pathid) {
-		printk(KERN_INFO
-			"%s: IR pathid %d does not match original pathid %d\n",
+		PRINT_INFO("%s: IR Connection Complete; "
+			"pathid %d does not match original pathid %d\n",
 			netdev->name, eib->ippathid, conn->pathid);
+		IUCV_DBF_TEXT_(data, 2,
+			"connack: IR pathid %d, conn. pathid %d\n",
+			eib->ippathid, conn->pathid);
 		conn->pathid = eib->ippathid;
 	}
 	netdev->tx_queue_len = eib->ipmsglim;
@@ -736,7 +803,7 @@ conn_action_conntimsev(fsm_instance *fi, int event, void *arg)
 	struct iucv_connection *conn = (struct iucv_connection *)arg;
 	__u8 udata[16];
 
-	pr_debug("%s() called\n", __FUNCTION__);
+	IUCV_DBF_TEXT(trace, 3, __FUNCTION__);
 
 	fsm_deltimer(&conn->timer);
 	iucv_sever(conn->pathid, udata);
@@ -752,12 +819,13 @@ conn_action_connsever(fsm_instance *fi, int event, void *arg)
 	struct netiucv_priv *privptr = (struct netiucv_priv *)netdev->priv;
 	__u8 udata[16];
 
-	pr_debug("%s() called\n", __FUNCTION__);
+	IUCV_DBF_TEXT(trace, 3, __FUNCTION__);
 
 	fsm_deltimer(&conn->timer);
 	iucv_sever(conn->pathid, udata);
-	printk(KERN_INFO "%s: Remote dropped connection\n",
-	       netdev->name);
+	PRINT_INFO("%s: Remote dropped connection\n", netdev->name);
+	IUCV_DBF_TEXT(data, 2,
+		"conn_action_connsever: Remote dropped connection\n");
 	fsm_newstate(fi, CONN_STATE_STARTWAIT);
 	fsm_event(privptr->fsm, DEV_EVENT_CONDOWN, netdev);
 }
@@ -770,24 +838,28 @@ conn_action_start(fsm_instance *fi, int event, void *arg)
 	__u16 msglimit;
 	int rc;
 
-	pr_debug("%s() called\n", __FUNCTION__);
+	IUCV_DBF_TEXT(trace, 3, __FUNCTION__);
 
-	if (conn->handle == 0) {
+	if (!conn->handle) {
+		IUCV_DBF_TEXT(trace, 5, "calling iucv_register_program\n");
 		conn->handle =
-			iucv_register_program(iucvMagic, conn->userid, mask,
+			iucv_register_program(iucvMagic, conn->userid,
+					      netiucv_mask,
 					      &netiucv_ops, conn);
 		fsm_newstate(fi, CONN_STATE_STARTWAIT);
-		if (conn->handle <= 0) {
+		if (!conn->handle) {
 			fsm_newstate(fi, CONN_STATE_REGERR);
-			conn->handle = 0;
+			conn->handle = NULL;
+			IUCV_DBF_TEXT(setup, 2,
+				"NULL from iucv_register_program\n");
 			return;
 		}
 
-		pr_debug("%s('%s'): registered successfully\n",
+		PRINT_DEBUG("%s('%s'): registered successfully\n",
 			 conn->netdev->name, conn->userid);
 	}
 
-	pr_debug("%s('%s'): connecting ...\n",
+	PRINT_DEBUG("%s('%s'): connecting ...\n",
 		 conn->netdev->name, conn->userid);
 
 	/* We must set the state before calling iucv_connect because the callback
@@ -796,8 +868,8 @@ conn_action_start(fsm_instance *fi, int event, void *arg)
 
 	fsm_newstate(fi, CONN_STATE_SETUPWAIT);
 	rc = iucv_connect(&(conn->pathid), NETIUCV_QUEUELEN_DEFAULT, iucvMagic,
-			  conn->userid, iucv_host, 0, NULL, &msglimit, conn->handle,
-			  conn);
+			  conn->userid, iucv_host, 0, NULL, &msglimit,
+			  conn->handle, conn);
 	switch (rc) {
 		case 0:
 			conn->netdev->tx_queue_len = msglimit;
@@ -805,47 +877,45 @@ conn_action_start(fsm_instance *fi, int event, void *arg)
 				CONN_EVENT_TIMER, conn);
 			return;
 		case 11:
-			printk(KERN_NOTICE
-			       "%s: User %s is currently not available.\n",
+			PRINT_INFO("%s: User %s is currently not available.\n",
 			       conn->netdev->name,
 			       netiucv_printname(conn->userid));
 			fsm_newstate(fi, CONN_STATE_STARTWAIT);
 			return;
 		case 12:
-			printk(KERN_NOTICE
-			       "%s: User %s is currently not ready.\n",
+			PRINT_INFO("%s: User %s is currently not ready.\n",
 			       conn->netdev->name,
 			       netiucv_printname(conn->userid));
 			fsm_newstate(fi, CONN_STATE_STARTWAIT);
 			return;
 		case 13:
-			printk(KERN_WARNING
-			       "%s: Too many IUCV connections.\n",
+			PRINT_WARN("%s: Too many IUCV connections.\n",
 			       conn->netdev->name);
 			fsm_newstate(fi, CONN_STATE_CONNERR);
 			break;
 		case 14:
-			printk(KERN_WARNING
+			PRINT_WARN(
 			       "%s: User %s has too many IUCV connections.\n",
 			       conn->netdev->name,
 			       netiucv_printname(conn->userid));
 			fsm_newstate(fi, CONN_STATE_CONNERR);
 			break;
 		case 15:
-			printk(KERN_WARNING
+			PRINT_WARN(
 			       "%s: No IUCV authorization in CP directory.\n",
 			       conn->netdev->name);
 			fsm_newstate(fi, CONN_STATE_CONNERR);
 			break;
 		default:
-			printk(KERN_WARNING
-			       "%s: iucv_connect returned error %d\n",
+			PRINT_WARN("%s: iucv_connect returned error %d\n",
 			       conn->netdev->name, rc);
 			fsm_newstate(fi, CONN_STATE_CONNERR);
 			break;
 	}
+	IUCV_DBF_TEXT_(setup, 5, "iucv_connect rc is %d\n", rc);
+	IUCV_DBF_TEXT(trace, 5, "calling iucv_unregister_program\n");
 	iucv_unregister_program(conn->handle);
-	conn->handle = 0;
+	conn->handle = NULL;
 }
 
 static void
@@ -867,14 +937,15 @@ conn_action_stop(fsm_instance *fi, int event, void *arg)
 	struct net_device *netdev = conn->netdev;
 	struct netiucv_priv *privptr = (struct netiucv_priv *)netdev->priv;
 
-	pr_debug("%s() called\n", __FUNCTION__);
+	IUCV_DBF_TEXT(trace, 3, __FUNCTION__);
 
 	fsm_deltimer(&conn->timer);
 	fsm_newstate(fi, CONN_STATE_STOPPED);
 	netiucv_purge_skb_queue(&conn->collect_queue);
 	if (conn->handle)
+		IUCV_DBF_TEXT(trace, 5, "calling iucv_unregister_program\n");
 		iucv_unregister_program(conn->handle);
-	conn->handle = 0;
+	conn->handle = NULL;
 	netiucv_purge_skb_queue(&conn->commit_queue);
 	fsm_event(privptr->fsm, DEV_EVENT_CONDOWN, netdev);
 }
@@ -886,9 +957,9 @@ conn_action_inval(fsm_instance *fi, int event, void *arg)
 	struct iucv_connection *conn = ev->conn;
 	struct net_device *netdev = conn->netdev;
 
-	printk(KERN_WARNING
-	       "%s: Cannot connect without username\n",
+	PRINT_WARN("%s: Cannot connect without username\n",
 	       netdev->name);
+	IUCV_DBF_TEXT(data, 2, "conn_action_inval called\n");
 }
 
 static const fsm_node conn_fsm[] = {
@@ -944,7 +1015,7 @@ dev_action_start(fsm_instance *fi, int event, void *arg)
 	struct netiucv_priv *privptr = dev->priv;
 	struct iucv_event   ev;
 
-	pr_debug("%s() called\n", __FUNCTION__);
+	IUCV_DBF_TEXT(trace, 3, __FUNCTION__);
 
 	ev.conn = privptr->conn;
 	fsm_newstate(fi, DEV_STATE_STARTWAIT);
@@ -965,7 +1036,7 @@ dev_action_stop(fsm_instance *fi, int event, void *arg)
 	struct netiucv_priv *privptr = dev->priv;
 	struct iucv_event   ev;
 
-	pr_debug("%s() called\n", __FUNCTION__);
+	IUCV_DBF_TEXT(trace, 3, __FUNCTION__);
 
 	ev.conn = privptr->conn;
 
@@ -987,19 +1058,22 @@ dev_action_connup(fsm_instance *fi, int event, void *arg)
 	struct net_device   *dev = (struct net_device *)arg;
 	struct netiucv_priv *privptr = dev->priv;
 
-	pr_debug("%s() called\n", __FUNCTION__);
+	IUCV_DBF_TEXT(trace, 3, __FUNCTION__);
 
 	switch (fsm_getstate(fi)) {
 		case DEV_STATE_STARTWAIT:
 			fsm_newstate(fi, DEV_STATE_RUNNING);
-			printk(KERN_INFO
-			       "%s: connected with remote side %s\n",
+			PRINT_INFO("%s: connected with remote side %s\n",
 			       dev->name, privptr->conn->userid);
+			IUCV_DBF_TEXT(setup, 3,
+				"connection is up and running\n");
 			break;
 		case DEV_STATE_STOPWAIT:
-			printk(KERN_INFO
-			       "%s: got connection UP event during shutdown!!\n",
+			PRINT_INFO(
+			       "%s: got connection UP event during shutdown!\n",
 			       dev->name);
+			IUCV_DBF_TEXT(data, 2,
+				"dev_action_connup: in DEV_STATE_STOPWAIT\n");
 			break;
 	}
 }
@@ -1015,7 +1089,7 @@ dev_action_connup(fsm_instance *fi, int event, void *arg)
 static void
 dev_action_conndown(fsm_instance *fi, int event, void *arg)
 {
-	pr_debug("%s() called\n", __FUNCTION__);
+	IUCV_DBF_TEXT(trace, 3, __FUNCTION__);
 
 	switch (fsm_getstate(fi)) {
 		case DEV_STATE_RUNNING:
@@ -1023,6 +1097,7 @@ dev_action_conndown(fsm_instance *fi, int event, void *arg)
 			break;
 		case DEV_STATE_STOPWAIT:
 			fsm_newstate(fi, DEV_STATE_STOPPED);
+			IUCV_DBF_TEXT(setup, 3, "connection is down\n");
 			break;
 	}
 }
@@ -1065,9 +1140,11 @@ netiucv_transmit_skb(struct iucv_connection *conn, struct sk_buff *skb) {
 
 		spin_lock_irqsave(&conn->collect_lock, saveflags);
 		if (conn->collect_len + l >
-		    (conn->max_buffsize - NETIUCV_HDRLEN))
+		    (conn->max_buffsize - NETIUCV_HDRLEN)) {
 			rc = -EBUSY;
-		else {
+			IUCV_DBF_TEXT(data, 2,
+				"EBUSY from netiucv_transmit_skb\n");
+		} else {
 			atomic_inc(&skb->users);
 			skb_queue_tail(&conn->collect_queue, skb);
 			conn->collect_len += l;
@@ -1086,9 +1163,9 @@ netiucv_transmit_skb(struct iucv_connection *conn, struct sk_buff *skb) {
 			nskb = alloc_skb(skb->len + NETIUCV_HDRLEN +
 					 NETIUCV_HDRLEN, GFP_ATOMIC | GFP_DMA);
 			if (!nskb) {
-				printk(KERN_WARNING
-				       "%s: Could not allocate tx_skb\n",
+				PRINT_WARN("%s: Could not allocate tx_skb\n",
 				       conn->netdev->name);
+				IUCV_DBF_TEXT(data, 2, "alloc_skb failed\n");
 				rc = -ENOMEM;
 				return rc;
 			} else {
@@ -1117,7 +1194,7 @@ netiucv_transmit_skb(struct iucv_connection *conn, struct sk_buff *skb) {
 		conn->prof.tx_pending++;
 		if (conn->prof.tx_pending > conn->prof.tx_max_pending)
 			conn->prof.tx_max_pending = conn->prof.tx_pending;
-		if (rc != 0) {
+		if (rc) {
 			struct netiucv_priv *privptr;
 			fsm_newstate(conn->fsm, CONN_STATE_IDLE);
 			conn->prof.tx_pending--;
@@ -1134,8 +1211,8 @@ netiucv_transmit_skb(struct iucv_connection *conn, struct sk_buff *skb) {
 				skb_pull(skb, NETIUCV_HDRLEN);
 				skb_trim(skb, skb->len - NETIUCV_HDRLEN);
 			}
-			printk(KERN_INFO "iucv_send returned %08x\n",
-				rc);
+			PRINT_WARN("iucv_send returned %08x\n",	rc);
+			IUCV_DBF_TEXT_(data, 2, "rc %d from iucv_send\n", rc);
 		} else {
 			if (copied)
 				dev_kfree_skb(skb);
@@ -1161,7 +1238,7 @@ netiucv_transmit_skb(struct iucv_connection *conn, struct sk_buff *skb) {
  */
 static int
 netiucv_open(struct net_device *dev) {
-	fsm_event(((struct netiucv_priv *)dev->priv)->fsm, DEV_EVENT_START, dev);
+	fsm_event(((struct netiucv_priv *)dev->priv)->fsm, DEV_EVENT_START,dev);
 	return 0;
 }
 
@@ -1195,18 +1272,21 @@ static int netiucv_tx(struct sk_buff *skb, struct net_device *dev)
 	int          rc = 0;
 	struct netiucv_priv *privptr = dev->priv;
 
+	IUCV_DBF_TEXT(trace, 4, __FUNCTION__);
 	/**
 	 * Some sanity checks ...
 	 */
 	if (skb == NULL) {
-		printk(KERN_WARNING "%s: NULL sk_buff passed\n", dev->name);
+		PRINT_WARN("%s: NULL sk_buff passed\n", dev->name);
+		IUCV_DBF_TEXT(data, 2, "netiucv_tx: skb is NULL\n");
 		privptr->stats.tx_dropped++;
 		return 0;
 	}
-	if (skb_headroom(skb) < (NETIUCV_HDRLEN)) {
-		printk(KERN_WARNING
-		       "%s: Got sk_buff with head room < %ld bytes\n",
+	if (skb_headroom(skb) < NETIUCV_HDRLEN) {
+		PRINT_WARN("%s: Got sk_buff with head room < %ld bytes\n",
 		       dev->name, NETIUCV_HDRLEN);
+		IUCV_DBF_TEXT(data, 2,
+			"netiucv_tx: skb_headroom < NETIUCV_HDRLEN\n");
 		dev_kfree_skb(skb);
 		privptr->stats.tx_dropped++;
 		return 0;
@@ -1225,11 +1305,12 @@ static int netiucv_tx(struct sk_buff *skb, struct net_device *dev)
 		return 0;
 	}
 
-	if (netiucv_test_and_set_busy(dev))
+	if (netiucv_test_and_set_busy(dev)) {
+		IUCV_DBF_TEXT(data, 2, "EBUSY from netiucv_tx\n");
 		return -EBUSY;
-
+	}
 	dev->trans_start = jiffies;
-	if (netiucv_transmit_skb(privptr->conn, skb) != 0)
+	if (netiucv_transmit_skb(privptr->conn, skb))
 		rc = 1;
 	netiucv_clear_busy(dev);
 	return rc;
@@ -1245,6 +1326,7 @@ static int netiucv_tx(struct sk_buff *skb, struct net_device *dev)
 static struct net_device_stats *
 netiucv_stats (struct net_device * dev)
 {
+	IUCV_DBF_TEXT(trace, 5, __FUNCTION__);
 	return &((struct netiucv_priv *)dev->priv)->stats;
 }
 
@@ -1260,8 +1342,11 @@ netiucv_stats (struct net_device * dev)
 static int
 netiucv_change_mtu (struct net_device * dev, int new_mtu)
 {
-	if ((new_mtu < 576) || (new_mtu > NETIUCV_MTU_MAX))
+	IUCV_DBF_TEXT(trace, 3, __FUNCTION__);
+	if ((new_mtu < 576) || (new_mtu > NETIUCV_MTU_MAX)) {
+		IUCV_DBF_TEXT(setup, 2, "given MTU out of valid range\n");
 		return -EINVAL;
+	}
 	dev->mtu = new_mtu;
 	return 0;
 }
@@ -1275,6 +1360,7 @@ user_show (struct device *dev, char *buf)
 {
 	struct netiucv_priv *priv = dev->driver_data;
 
+	IUCV_DBF_TEXT(trace, 5, __FUNCTION__);
 	return sprintf(buf, "%s\n", netiucv_printname(priv->conn->userid));
 }
 
@@ -1288,9 +1374,11 @@ user_write (struct device *dev, const char *buf, size_t count)
 	char 	username[10];
 	int 	i;
 
+	IUCV_DBF_TEXT(trace, 3, __FUNCTION__);
 	if (count>9) {
-		printk(KERN_WARNING
-			"netiucv: username too long (%d)!\n", (int)count);
+		PRINT_WARN("netiucv: username too long (%d)!\n", (int)count);
+		IUCV_DBF_TEXT_(setup, 2,
+			"%d is length of username\n", (int)count);
 		return -EINVAL;
 	}
 
@@ -1302,8 +1390,11 @@ user_write (struct device *dev, const char *buf, size_t count)
 			/* trailing lf, grr */
 			break;
 		} else {
-			printk(KERN_WARNING
-				"netiucv: Invalid character in username!\n");
+			PRINT_WARN("netiucv: Invalid char %c in username!\n",
+				*p);
+			IUCV_DBF_TEXT_(setup, 2,
+				"username: invalid character %c\n",
+				*p);
 			return -EINVAL;
 		}
 	}
@@ -1311,14 +1402,14 @@ user_write (struct device *dev, const char *buf, size_t count)
 		username[i++] = ' ';
 	username[9] = '\0';
 
-	if (memcmp(username, priv->conn->userid, 8) != 0) {
+	if (memcmp(username, priv->conn->userid, 8)) {
 		/* username changed */
 		if (ndev->flags & (IFF_UP | IFF_RUNNING)) {
-			printk(KERN_WARNING
+			PRINT_WARN(
 				"netiucv: device %s active, connected to %s\n",
 				dev->bus_id, priv->conn->userid);
-			printk(KERN_WARNING
-				"netiucv: user cannot be updated\n");
+			PRINT_WARN("netiucv: user cannot be updated\n");
+			IUCV_DBF_TEXT(setup, 2, "user_write: device active\n");
 			return -EBUSY;
 		}
 	}
@@ -1335,6 +1426,7 @@ buffer_show (struct device *dev, char *buf)
 {
 	struct netiucv_priv *priv = dev->driver_data;
 
+	IUCV_DBF_TEXT(trace, 5, __FUNCTION__);
 	return sprintf(buf, "%d\n", priv->conn->max_buffsize);
 }
 
@@ -1346,33 +1438,46 @@ buffer_write (struct device *dev, const char *buf, size_t count)
 	char         *e;
 	int          bs1;
 
+	IUCV_DBF_TEXT(trace, 3, __FUNCTION__);
 	if (count >= 39)
 		return -EINVAL;
 
 	bs1 = simple_strtoul(buf, &e, 0);
 
 	if (e && (!isspace(*e))) {
-		printk(KERN_WARNING
-			"netiucv: Invalid character in buffer!\n");
+		PRINT_WARN("netiucv: Invalid character in buffer!\n");
+		IUCV_DBF_TEXT_(setup, 2, "buffer_write: invalid char %c\n", *e);
 		return -EINVAL;
 	}
 	if (bs1 > NETIUCV_BUFSIZE_MAX) {
-		printk(KERN_WARNING
-			"netiucv: Given buffer size %d too large.\n",
+		PRINT_WARN("netiucv: Given buffer size %d too large.\n",
+			bs1);
+		IUCV_DBF_TEXT_(setup, 2,
+			"buffer_write: buffer size %d too large\n",
 			bs1);
-
 		return -EINVAL;
 	}
 	if ((ndev->flags & IFF_RUNNING) &&
-	    (bs1 < (ndev->mtu + NETIUCV_HDRLEN + 2)))
+	    (bs1 < (ndev->mtu + NETIUCV_HDRLEN + 2))) {
+		PRINT_WARN("netiucv: Given buffer size %d too small.\n",
+			bs1);
+		IUCV_DBF_TEXT_(setup, 2,
+			"buffer_write: buffer size %d too small\n",
+			bs1);
 		return -EINVAL;
-	if (bs1 < (576 + NETIUCV_HDRLEN + NETIUCV_HDRLEN))
+	}
+	if (bs1 < (576 + NETIUCV_HDRLEN + NETIUCV_HDRLEN)) {
+		PRINT_WARN("netiucv: Given buffer size %d too small.\n",
+			bs1);
+		IUCV_DBF_TEXT_(setup, 2,
+			"buffer_write: buffer size %d too small\n",
+			bs1);
 		return -EINVAL;
+	}
 
 	priv->conn->max_buffsize = bs1;
 	if (!(ndev->flags & IFF_RUNNING))
 		ndev->mtu = bs1 - NETIUCV_HDRLEN - NETIUCV_HDRLEN;
-	priv->conn->flags |= CONN_FLAGS_BUFSIZE_CHANGED;
 
 	return count;
 
@@ -1384,7 +1489,8 @@ static ssize_t
 dev_fsm_show (struct device *dev, char *buf)
 {
 	struct netiucv_priv *priv = dev->driver_data;
-	
+
+	IUCV_DBF_TEXT(trace, 5, __FUNCTION__);
 	return sprintf(buf, "%s\n", fsm_getstate_str(priv->fsm));
 }
 
@@ -1394,7 +1500,8 @@ static ssize_t
 conn_fsm_show (struct device *dev, char *buf)
 {
 	struct netiucv_priv *priv = dev->driver_data;
-	
+
+	IUCV_DBF_TEXT(trace, 5, __FUNCTION__);
 	return sprintf(buf, "%s\n", fsm_getstate_str(priv->conn->fsm));
 }
 
@@ -1404,7 +1511,8 @@ static ssize_t
 maxmulti_show (struct device *dev, char *buf)
 {
 	struct netiucv_priv *priv = dev->driver_data;
-	
+
+	IUCV_DBF_TEXT(trace, 5, __FUNCTION__);
 	return sprintf(buf, "%ld\n", priv->conn->prof.maxmulti);
 }
 
@@ -1412,7 +1520,8 @@ static ssize_t
 maxmulti_write (struct device *dev, const char *buf, size_t count)
 {
 	struct netiucv_priv *priv = dev->driver_data;
-	
+
+	IUCV_DBF_TEXT(trace, 4, __FUNCTION__);
 	priv->conn->prof.maxmulti = 0;
 	return count;
 }
@@ -1423,7 +1532,8 @@ static ssize_t
 maxcq_show (struct device *dev, char *buf)
 {
 	struct netiucv_priv *priv = dev->driver_data;
-	
+
+	IUCV_DBF_TEXT(trace, 5, __FUNCTION__);
 	return sprintf(buf, "%ld\n", priv->conn->prof.maxcqueue);
 }
 
@@ -1432,6 +1542,7 @@ maxcq_write (struct device *dev, const char *buf, size_t count)
 {
 	struct netiucv_priv *priv = dev->driver_data;
 	
+	IUCV_DBF_TEXT(trace, 4, __FUNCTION__);
 	priv->conn->prof.maxcqueue = 0;
 	return count;
 }
@@ -1442,7 +1553,8 @@ static ssize_t
 sdoio_show (struct device *dev, char *buf)
 {
 	struct netiucv_priv *priv = dev->driver_data;
-	
+
+	IUCV_DBF_TEXT(trace, 5, __FUNCTION__);
 	return sprintf(buf, "%ld\n", priv->conn->prof.doios_single);
 }
 
@@ -1451,6 +1563,7 @@ sdoio_write (struct device *dev, const char *buf, size_t count)
 {
 	struct netiucv_priv *priv = dev->driver_data;
 	
+	IUCV_DBF_TEXT(trace, 4, __FUNCTION__);
 	priv->conn->prof.doios_single = 0;
 	return count;
 }
@@ -1461,7 +1574,8 @@ static ssize_t
 mdoio_show (struct device *dev, char *buf)
 {
 	struct netiucv_priv *priv = dev->driver_data;
-	
+
+	IUCV_DBF_TEXT(trace, 5, __FUNCTION__);
 	return sprintf(buf, "%ld\n", priv->conn->prof.doios_multi);
 }
 
@@ -1470,6 +1584,7 @@ mdoio_write (struct device *dev, const char *buf, size_t count)
 {
 	struct netiucv_priv *priv = dev->driver_data;
 	
+	IUCV_DBF_TEXT(trace, 5, __FUNCTION__);
 	priv->conn->prof.doios_multi = 0;
 	return count;
 }
@@ -1480,7 +1595,8 @@ static ssize_t
 txlen_show (struct device *dev, char *buf)
 {
 	struct netiucv_priv *priv = dev->driver_data;
-	
+
+	IUCV_DBF_TEXT(trace, 5, __FUNCTION__);
 	return sprintf(buf, "%ld\n", priv->conn->prof.txlen);
 }
 
@@ -1489,6 +1605,7 @@ txlen_write (struct device *dev, const char *buf, size_t count)
 {
 	struct netiucv_priv *priv = dev->driver_data;
 	
+	IUCV_DBF_TEXT(trace, 4, __FUNCTION__);
 	priv->conn->prof.txlen = 0;
 	return count;
 }
@@ -1499,7 +1616,8 @@ static ssize_t
 txtime_show (struct device *dev, char *buf)
 {
 	struct netiucv_priv *priv = dev->driver_data;
-	
+
+	IUCV_DBF_TEXT(trace, 5, __FUNCTION__);
 	return sprintf(buf, "%ld\n", priv->conn->prof.tx_time);
 }
 
@@ -1508,6 +1626,7 @@ txtime_write (struct device *dev, const char *buf, size_t count)
 {
 	struct netiucv_priv *priv = dev->driver_data;
 	
+	IUCV_DBF_TEXT(trace, 4, __FUNCTION__);
 	priv->conn->prof.tx_time = 0;
 	return count;
 }
@@ -1519,6 +1638,7 @@ txpend_show (struct device *dev, char *buf)
 {
 	struct netiucv_priv *priv = dev->driver_data;
 
+	IUCV_DBF_TEXT(trace, 5, __FUNCTION__);
 	return sprintf(buf, "%ld\n", priv->conn->prof.tx_pending);
 }
 
@@ -1527,6 +1647,7 @@ txpend_write (struct device *dev, const char *buf, size_t count)
 {
 	struct netiucv_priv *priv = dev->driver_data;
 
+	IUCV_DBF_TEXT(trace, 4, __FUNCTION__);
 	priv->conn->prof.tx_pending = 0;
 	return count;
 }
@@ -1538,6 +1659,7 @@ txmpnd_show (struct device *dev, char *buf)
 {
 	struct netiucv_priv *priv = dev->driver_data;
 
+	IUCV_DBF_TEXT(trace, 5, __FUNCTION__);
 	return sprintf(buf, "%ld\n", priv->conn->prof.tx_max_pending);
 }
 
@@ -1546,6 +1668,7 @@ txmpnd_write (struct device *dev, const char *buf, size_t count)
 {
 	struct netiucv_priv *priv = dev->driver_data;
 
+	IUCV_DBF_TEXT(trace, 4, __FUNCTION__);
 	priv->conn->prof.tx_max_pending = 0;
 	return count;
 }
@@ -1586,8 +1709,7 @@ netiucv_add_files(struct device *dev)
 {
 	int ret;
 
-	pr_debug("%s() called\n", __FUNCTION__);
-
+	IUCV_DBF_TEXT(trace, 3, __FUNCTION__);
 	ret = sysfs_create_group(&dev->kobj, &netiucv_attr_group);
 	if (ret)
 		return ret;
@@ -1600,7 +1722,7 @@ netiucv_add_files(struct device *dev)
 static inline void
 netiucv_remove_files(struct device *dev)
 {
-	pr_debug("%s() called\n", __FUNCTION__);
+	IUCV_DBF_TEXT(trace, 3, __FUNCTION__);
 	sysfs_remove_group(&dev->kobj, &netiucv_stat_attr_group);
 	sysfs_remove_group(&dev->kobj, &netiucv_attr_group);
 }
@@ -1613,7 +1735,7 @@ netiucv_register_device(struct net_device *ndev)
 	int ret;
 
 
-	pr_debug("%s() called\n", __FUNCTION__);
+	IUCV_DBF_TEXT(trace, 3, __FUNCTION__);
 
 	if (dev) {
 		memset(dev, 0, sizeof(struct device));
@@ -1628,6 +1750,7 @@ netiucv_register_device(struct net_device *ndev)
 		 * but legitime ...).
 		 */
 		dev->release = (void (*)(struct device *))kfree;
+		dev->driver = &netiucv_driver;
 	} else
 		return -ENOMEM;
 
@@ -1638,8 +1761,8 @@ netiucv_register_device(struct net_device *ndev)
 	ret = netiucv_add_files(dev);
 	if (ret)
 		goto out_unreg;
-	dev->driver_data = priv;
 	priv->dev = dev;
+	dev->driver_data = priv;
 	return 0;
 
 out_unreg:
@@ -1650,19 +1773,19 @@ out_unreg:
 static void
 netiucv_unregister_device(struct device *dev)
 {
-	pr_debug("%s() called\n", __FUNCTION__);
+	IUCV_DBF_TEXT(trace, 3, __FUNCTION__);
 	netiucv_remove_files(dev);
 	device_unregister(dev);
 }
 
 /**
  * Allocate and initialize a new connection structure.
- * Add it to the list of connections;
+ * Add it to the list of netiucv connections;
  */
 static struct iucv_connection *
 netiucv_new_connection(struct net_device *dev, char *username)
 {
-	struct iucv_connection **clist = &connections;
+	struct iucv_connection **clist = &iucv_connections;
 	struct iucv_connection *conn =
 		(struct iucv_connection *)
 		kmalloc(sizeof(struct iucv_connection), GFP_KERNEL);
@@ -1713,23 +1836,22 @@ netiucv_new_connection(struct net_device *dev, char *username)
 
 /**
  * Release a connection structure and remove it from the
- * list of connections.
+ * list of netiucv connections.
  */
 static void
 netiucv_remove_connection(struct iucv_connection *conn)
 {
-	struct iucv_connection **clist = &connections;
-
-	pr_debug("%s() called\n", __FUNCTION__);
+	struct iucv_connection **clist = &iucv_connections;
 
+	IUCV_DBF_TEXT(trace, 3, __FUNCTION__);
 	if (conn == NULL)
 		return;
 	while (*clist) {
 		if (*clist == conn) {
 			*clist = conn->next;
-			if (conn->handle != 0) {
+			if (conn->handle) {
 				iucv_unregister_program(conn->handle);
-				conn->handle = 0;
+				conn->handle = NULL;
 			}
 			fsm_deltimer(&conn->timer);
 			kfree_fsm(conn->fsm);
@@ -1749,20 +1871,18 @@ netiucv_free_netdevice(struct net_device *dev)
 {
 	struct netiucv_priv *privptr;
 
-	pr_debug("%s() called\n", __FUNCTION__);
+	IUCV_DBF_TEXT(trace, 3, __FUNCTION__);
 
 	if (!dev)
 		return;
 
 	privptr = (struct netiucv_priv *)dev->priv;
 	if (privptr) {
-		if (privptr->fsm)
-			fsm_deltimer(&privptr->timer);
 		if (privptr->conn)
 			netiucv_remove_connection(privptr->conn);
 		if (privptr->fsm)
 			kfree_fsm(privptr->fsm);
-		privptr->conn = 0; privptr->fsm = 0;
+		privptr->conn = NULL; privptr->fsm = NULL;
 		/* privptr gets freed by free_netdev() */
 	}
 	free_netdev(dev);
@@ -1804,12 +1924,16 @@ netiucv_init_netdevice(char *username)
 			   netiucv_setup_netdevice);
 	if (!dev)
 		return NULL;
+	if (dev_alloc_name(dev, dev->name) < 0) {
+		free_netdev(dev);
+		return NULL;
+	}
 
-        privptr = (struct netiucv_priv *)dev->priv;
+	privptr = (struct netiucv_priv *)dev->priv;
 	privptr->fsm = init_fsm("netiucvdev", dev_state_names,
 				dev_event_names, NR_DEV_STATES, NR_DEV_EVENTS,
 				dev_fsm, DEV_FSM_LEN, GFP_KERNEL);
-	if (privptr->fsm == NULL) {
+	if (!privptr->fsm) {
 		free_netdev(dev);
 		return NULL;
 	}
@@ -1817,9 +1941,9 @@ netiucv_init_netdevice(char *username)
 	if (!privptr->conn) {
 		kfree_fsm(privptr->fsm);
 		free_netdev(dev);
+		IUCV_DBF_TEXT(setup, 2, "NULL from netiucv_new_connection\n");
 		return NULL;
 	}
-	fsm_settimer(privptr->fsm, &privptr->timer);
 	fsm_newstate(privptr->fsm, DEV_STATE_STOPPED);
 
 	return dev;
@@ -1833,9 +1957,10 @@ conn_write(struct device_driver *drv, const char *buf, size_t count)
 	int i, ret;
 	struct net_device *dev;
 
+	IUCV_DBF_TEXT(trace, 3, __FUNCTION__);
 	if (count>9) {
-		printk(KERN_WARNING
-		       "netiucv: username too long (%d)!\n", (int)count);
+		PRINT_WARN("netiucv: username too long (%d)!\n", (int)count);
+		IUCV_DBF_TEXT(setup, 2, "conn_write: too long\n");
 		return -EINVAL;
 	}
 
@@ -1846,8 +1971,9 @@ conn_write(struct device_driver *drv, const char *buf, size_t count)
 			/* trailing lf, grr */
 			break;
 		} else {
-			printk(KERN_WARNING
-			       "netiucv: Invalid character in username!\n");
+			PRINT_WARN("netiucv: Invalid character in username!\n");
+			IUCV_DBF_TEXT_(setup, 2,
+				"conn_write: invalid character %c\n", *p);
 			return -EINVAL;
 		}
 	}
@@ -1856,30 +1982,36 @@ conn_write(struct device_driver *drv, const char *buf, size_t count)
 	username[9] = '\0';
 	dev = netiucv_init_netdevice(username);
 	if (!dev) {
-		printk(KERN_WARNING
+		PRINT_WARN(
 		       "netiucv: Could not allocate network device structure "
 		       "for user '%s'\n", netiucv_printname(username));
+		IUCV_DBF_TEXT(setup, 2, "NULL from netiucv_init_netdevice\n");
 		return -ENODEV;
 	}
-	
-	if ((ret = register_netdev(dev))) {
-		goto out_free_ndev;
-	}
 
 	if ((ret = netiucv_register_device(dev))) {
-		unregister_netdev(dev);
+		IUCV_DBF_TEXT_(setup, 2,
+			"ret %d from netiucv_register_device\n", ret);
 		goto out_free_ndev;
 	}
 
 	/* sysfs magic */
-	SET_NETDEV_DEV(dev, (struct device*)((struct netiucv_priv*)dev->priv)->dev);
-	printk(KERN_INFO "%s: '%s'\n", dev->name, netiucv_printname(username));
+	SET_NETDEV_DEV(dev,
+			(struct device*)((struct netiucv_priv*)dev->priv)->dev);
+
+	if ((ret = register_netdev(dev))) {
+		netiucv_unregister_device((struct device*)
+			((struct netiucv_priv*)dev->priv)->dev);
+		goto out_free_ndev;
+	}
+
+	PRINT_INFO("%s: '%s'\n", dev->name, netiucv_printname(username));
 	
 	return count;
 
 out_free_ndev:
-	printk(KERN_WARNING
-		       "netiucv: Could not register '%s'\n", dev->name);
+	PRINT_WARN("netiucv: Could not register '%s'\n", dev->name);
+	IUCV_DBF_TEXT(setup, 2, "conn_write: could not register\n");
 	netiucv_free_netdevice(dev);
 	return ret;
 }
@@ -1889,7 +2021,7 @@ DRIVER_ATTR(connection, 0200, NULL, conn_write);
 static ssize_t
 remove_write (struct device_driver *drv, const char *buf, size_t count)
 {
-	struct iucv_connection **clist = &connections;
+	struct iucv_connection **clist = &iucv_connections;
         struct net_device *ndev;
         struct netiucv_priv *priv;
         struct device *dev;
@@ -1897,7 +2029,7 @@ remove_write (struct device_driver *drv, const char *buf, size_t count)
         char *p;
         int i;
 
-        pr_debug("%s() called\n", __FUNCTION__);
+        IUCV_DBF_TEXT(trace, 3, __FUNCTION__);
 
         if (count >= IFNAMSIZ)
                 count = IFNAMSIZ-1;
@@ -1922,34 +2054,29 @@ remove_write (struct device_driver *drv, const char *buf, size_t count)
                         continue;
                 }
                 if (ndev->flags & (IFF_UP | IFF_RUNNING)) {
-                        printk(KERN_WARNING
+                        PRINT_WARN(
                                 "netiucv: net device %s active with peer %s\n",
                                 ndev->name, priv->conn->userid);
-                        printk(KERN_WARNING
-                                "netiucv: %s cannot be removed\n",
+                        PRINT_WARN("netiucv: %s cannot be removed\n",
                                 ndev->name);
+			IUCV_DBF_TEXT(data, 2, "remove_write: still active\n");
                         return -EBUSY;
                 }
                 unregister_netdev(ndev);
                 netiucv_unregister_device(dev);
                 return count;
         }
-        printk(KERN_WARNING
-                "netiucv: net device %s unknown\n", name);
+        PRINT_WARN("netiucv: net device %s unknown\n", name);
+	IUCV_DBF_TEXT(data, 2, "remove_write: unknown device\n");
         return -EINVAL;
 }
 
 DRIVER_ATTR(remove, 0200, NULL, remove_write);
 
-static struct device_driver netiucv_driver = {
-	.name = "netiucv",
-	.bus  = &iucv_bus,
-};
-
 static void
 netiucv_banner(void)
 {
-	char vbuf[] = "$Revision: 1.54 $";
+	char vbuf[] = "$Revision: 1.63 $";
 	char *version = vbuf;
 
 	if ((version = strchr(version, ':'))) {
@@ -1958,14 +2085,15 @@ netiucv_banner(void)
 			*p = '\0';
 	} else
 		version = " ??? ";
-	printk(KERN_INFO "NETIUCV driver Version%s initialized\n", version);
+	PRINT_INFO("NETIUCV driver Version%s initialized\n", version);
 }
 
 static void __exit
 netiucv_exit(void)
 {
-	while (connections) {
-		struct net_device *ndev = connections->netdev;
+	IUCV_DBF_TEXT(trace, 3, __FUNCTION__);
+	while (iucv_connections) {
+		struct net_device *ndev = iucv_connections->netdev;
 		struct netiucv_priv *priv = (struct netiucv_priv*)ndev->priv;
 		struct device *dev = priv->dev;
 
@@ -1976,8 +2104,9 @@ netiucv_exit(void)
 	driver_remove_file(&netiucv_driver, &driver_attr_connection);
 	driver_remove_file(&netiucv_driver, &driver_attr_remove);
 	driver_unregister(&netiucv_driver);
+	iucv_unregister_dbf_views();
 
-	printk(KERN_INFO "NETIUCV driver unloaded\n");
+	PRINT_INFO("NETIUCV driver unloaded\n");
 	return;
 }
 
@@ -1986,20 +2115,31 @@ netiucv_init(void)
 {
 	int ret;
 	
+	ret = iucv_register_dbf_views();
+	if (ret) {
+		PRINT_WARN("netiucv_init failed, "
+			"iucv_register_dbf_views rc = %d\n", ret);
+		return ret;
+	}
+	IUCV_DBF_TEXT(trace, 3, __FUNCTION__);
 	ret = driver_register(&netiucv_driver);
-	if (ret != 0) {
-		printk(KERN_ERR "NETIUCV: failed to register driver.\n");
+	if (ret) {
+		PRINT_ERR("NETIUCV: failed to register driver.\n");
+		IUCV_DBF_TEXT_(setup, 2, "ret %d from driver_register\n", ret);
+		iucv_unregister_dbf_views();
 		return ret;
 	}
 
 	/* Add entry for specifying connections. */
 	ret = driver_create_file(&netiucv_driver, &driver_attr_connection);
-	if (ret == 0) {
+	if (!ret) {
 		ret = driver_create_file(&netiucv_driver, &driver_attr_remove);
 		netiucv_banner();
 	} else {
-		printk(KERN_ERR "NETIUCV: failed to add driver attribute.\n");
+		PRINT_ERR("NETIUCV: failed to add driver attribute.\n");
+		IUCV_DBF_TEXT_(setup, 2, "ret %d from driver_create_file\n", ret);
 		driver_unregister(&netiucv_driver);
+		iucv_unregister_dbf_views();
 	}
 	return ret;
 }
diff --git a/drivers/s390/net/qeth.h b/drivers/s390/net/qeth.h
index 96c4243a2..eaae2afab 100644
--- a/drivers/s390/net/qeth.h
+++ b/drivers/s390/net/qeth.h
@@ -23,7 +23,7 @@
 
 #include "qeth_mpc.h"
 
-#define VERSION_QETH_H 		"$Revision: 1.110 $"
+#define VERSION_QETH_H 		"$Revision: 1.113 $"
 
 #ifdef CONFIG_QETH_IPV6
 #define QETH_VERSION_IPV6 	":IPv6"
@@ -150,6 +150,8 @@ qeth_hex_dump(unsigned char *buf, size_t len)
 #define SENSE_RESETTING_EVENT_BYTE 1
 #define SENSE_RESETTING_EVENT_FLAG 0x80
 
+#define atomic_swap(a,b) xchg((int *)a.counter, b)
+
 /*
  * Common IO related definitions
  */
@@ -425,12 +427,18 @@ struct qeth_qdio_out_buffer {
 
 struct qeth_card;
 
+enum qeth_out_q_states {
+       QETH_OUT_Q_UNLOCKED,
+       QETH_OUT_Q_LOCKED,
+       QETH_OUT_Q_LOCKED_FLUSH,
+};
+
 struct qeth_qdio_out_q {
 	struct qdio_buffer qdio_bufs[QDIO_MAX_BUFFERS_PER_Q];
 	struct qeth_qdio_out_buffer bufs[QDIO_MAX_BUFFERS_PER_Q];
 	int queue_no;
 	struct qeth_card *card;
-	spinlock_t lock;
+	atomic_t state;
 	volatile int do_pack;
 	/*
 	 * index of buffer to be filled by driver; state EMPTY or PACKING
@@ -610,14 +618,14 @@ struct qeth_seqno {
 	__u32 trans_hdr;
 	__u32 pdu_hdr;
 	__u32 pdu_hdr_ack;
-	__u32 ipa;
+	__u16 ipa;
 };
 
 struct qeth_reply {
 	struct list_head list;
 	wait_queue_head_t wait_q;
 	int (*callback)(struct qeth_card *,struct qeth_reply *,unsigned long);
- 	int seqno;
+ 	u32 seqno;
 	unsigned long offset;
 	int received;
 	int rc;
diff --git a/drivers/s390/net/qeth_fs.h b/drivers/s390/net/qeth_fs.h
index 9e45195b3..5c9a51ce9 100644
--- a/drivers/s390/net/qeth_fs.h
+++ b/drivers/s390/net/qeth_fs.h
@@ -12,7 +12,7 @@
 #ifndef __QETH_FS_H__
 #define __QETH_FS_H__
 
-#define VERSION_QETH_FS_H "$Revision: 1.8 $"
+#define VERSION_QETH_FS_H "$Revision: 1.9 $"
 
 extern const char *VERSION_QETH_PROC_C;
 extern const char *VERSION_QETH_SYS_C;
@@ -138,6 +138,8 @@ qeth_get_cardname_short(struct qeth_card *card)
 				return "HSTR";
 			case QETH_LINK_TYPE_GBIT_ETH:
 				return "OSD_1000";
+			case QETH_LINK_TYPE_10GBIT_ETH:
+				return "OSD_10GIG";
 			case QETH_LINK_TYPE_LANE_ETH100:
 				return "OSD_FE_LANE";
 			case QETH_LINK_TYPE_LANE_TR:
diff --git a/drivers/s390/net/qeth_main.c b/drivers/s390/net/qeth_main.c
index 8aefa28c2..17f0f67d8 100644
--- a/drivers/s390/net/qeth_main.c
+++ b/drivers/s390/net/qeth_main.c
@@ -1,6 +1,6 @@
 /*
  *
- * linux/drivers/s390/net/qeth_main.c ($Revision: 1.121 $)
+ * linux/drivers/s390/net/qeth_main.c ($Revision: 1.130 $)
  *
  * Linux on zSeries OSA Express and HiperSockets support
  *
@@ -12,7 +12,7 @@
  *			  Frank Pavlic (pavlic@de.ibm.com) and
  *		 	  Thomas Spatzier <tspat@de.ibm.com>
  *
- *    $Revision: 1.121 $	 $Date: 2004/06/11 16:32:15 $
+ *    $Revision: 1.130 $	 $Date: 2004/08/05 11:21:50 $
  *
  * This program is free software; you can redistribute it and/or modify
  * it under the terms of the GNU General Public License as published by
@@ -78,7 +78,7 @@ qeth_eyecatcher(void)
 #include "qeth_mpc.h"
 #include "qeth_fs.h"
 
-#define VERSION_QETH_C "$Revision: 1.121 $"
+#define VERSION_QETH_C "$Revision: 1.130 $"
 static const char *version = "qeth S/390 OSA-Express driver";
 
 /**
@@ -818,14 +818,20 @@ static void qeth_add_multicast_ipv4(struct qeth_card *);
 static void qeth_add_multicast_ipv6(struct qeth_card *);
 #endif
 
-static void
+static inline int
 qeth_set_thread_start_bit(struct qeth_card *card, unsigned long thread)
 {
 	unsigned long flags;
 
 	spin_lock_irqsave(&card->thread_mask_lock, flags);
+	if ( !(card->thread_allowed_mask & thread) ||
+	      (card->thread_start_mask & thread) ) {
+		spin_unlock_irqrestore(&card->thread_mask_lock, flags);
+		return -EPERM;
+	}
 	card->thread_start_mask |= thread;
 	spin_unlock_irqrestore(&card->thread_mask_lock, flags);
+	return 0;
 }
 
 static void
@@ -952,8 +958,8 @@ qeth_schedule_recovery(struct qeth_card *card)
 {
 	QETH_DBF_TEXT(trace,2,"startrec");
 
-	qeth_set_thread_start_bit(card, QETH_RECOVER_THREAD);
-	schedule_work(&card->kernel_thread_starter);
+	if (qeth_set_thread_start_bit(card, QETH_RECOVER_THREAD) == 0)
+		schedule_work(&card->kernel_thread_starter);
 }
 
 static int
@@ -1568,9 +1574,9 @@ qeth_reset_ip_addresses(struct qeth_card *card)
 	QETH_DBF_TEXT(trace, 2, "rstipadd");
 
 	qeth_clear_ip_list(card, 0, 1);
-	qeth_set_thread_start_bit(card, QETH_SET_IP_THREAD);
-	qeth_set_thread_start_bit(card, QETH_SET_MC_THREAD);
-	schedule_work(&card->kernel_thread_starter);
+	if ( (qeth_set_thread_start_bit(card, QETH_SET_IP_THREAD) == 0) ||
+	     (qeth_set_thread_start_bit(card, QETH_SET_MC_THREAD) == 0) )
+		schedule_work(&card->kernel_thread_starter);
 }
 
 static struct qeth_ipa_cmd *
@@ -1795,7 +1801,7 @@ qeth_send_control_data(struct qeth_card *card, int len,
 	}
 	add_timer(&timer);
 	wait_event(reply->wait_q, reply->received);
-	del_timer(&timer);
+	del_timer_sync(&timer);
 	rc = reply->rc;
 	qeth_put_reply(reply);
 	return rc;
@@ -2099,7 +2105,7 @@ qeth_get_next_skb(struct qeth_card *card, struct qdio_buffer *buffer,
 				QETH_DBF_TEXT(qerr,2,"unexeob");
 				QETH_DBF_TEXT_(qerr,2,"%s",CARD_BUS_ID(card));
 				QETH_DBF_HEX(misc,4,buffer,sizeof(*buffer));
-				dev_kfree_skb_irq(skb);
+				dev_kfree_skb_any(skb);
 				card->stats.rx_errors++;
 				return NULL;
 			}
@@ -2291,7 +2297,7 @@ qeth_process_inbound_buffer(struct qeth_card *card,
 		qeth_rebuild_skb(card, skb, hdr);
 		/* is device UP ? */
 		if (!(card->dev->flags & IFF_UP)){
-			dev_kfree_skb_irq(skb);
+			dev_kfree_skb_any(skb);
 			continue;
 		}
 		skb->dev = card->dev;
@@ -2305,16 +2311,16 @@ qeth_process_inbound_buffer(struct qeth_card *card,
 static inline struct qeth_buffer_pool_entry *
 qeth_get_buffer_pool_entry(struct qeth_card *card)
 {
-	struct qeth_buffer_pool_entry *entry, *tmp;
+	struct qeth_buffer_pool_entry *entry;
 
 	QETH_DBF_TEXT(trace, 6, "gtbfplen");
-	entry = NULL;
-	list_for_each_entry_safe(entry, tmp,
-				 &card->qdio.in_buf_pool.entry_list, list){
+	if (!list_empty(&card->qdio.in_buf_pool.entry_list)) {
+		entry = list_entry(card->qdio.in_buf_pool.entry_list.next,
+				struct qeth_buffer_pool_entry, list);
 		list_del_init(&entry->list);
-		break;
+		return entry;
 	}
-	return entry;
+	return NULL;
 }
 
 static inline void
@@ -2361,7 +2367,7 @@ qeth_clear_output_buffer(struct qeth_qdio_out_q *queue,
 		buf->buffer->element[i].flags = 0;
 		while ((skb = skb_dequeue(&buf->skb_list))){
 			atomic_dec(&skb->users);
-			dev_kfree_skb_irq(skb);
+			dev_kfree_skb_any(skb);
 		}
 	}
 	buf->next_element_to_fill = 0;
@@ -2582,14 +2588,9 @@ qeth_flush_buffers(struct qeth_qdio_out_q *queue, int under_int,
 		QETH_DBF_TEXT(trace, 2, "flushbuf");
 		QETH_DBF_TEXT_(trace, 2, " err%d", rc);
 		queue->card->stats.tx_errors += count;
-		/* ok, since do_QDIO went wrong the buffers have not been given
-		 * to the hardware. they still belong to us, so we can clear
-		 * them and reuse then, i.e. set back next_buf_to_fill*/
-		for (i = index; i < index + count; ++i) {
-			buf = &queue->bufs[i % QDIO_MAX_BUFFERS_PER_Q];
-			qeth_clear_output_buffer(queue, buf);
-		}
-		queue->next_buf_to_fill = index;
+		/* this must not happen under normal circumstances. if it
+		 * happens something is really wrong -> recover */
+		qeth_schedule_recovery(queue->card);
 		return;
 	}
 	atomic_add(count, &queue->used_buffers);
@@ -2599,16 +2600,12 @@ qeth_flush_buffers(struct qeth_qdio_out_q *queue, int under_int,
 }
 
 /*
- * switches between PACKING and non-PACKING state if needed.
- * has to be called holding queue->lock
+ * Switched to packing state if the number of used buffers on a queue
+ * reaches a certain limit.
  */
-static inline int
-qeth_switch_packing_state(struct qeth_qdio_out_q *queue)
+static inline void
+qeth_switch_to_packing_if_needed(struct qeth_qdio_out_q *queue)
 {
-	struct qeth_qdio_out_buffer *buffer;
-	int flush_count = 0;
-
-	QETH_DBF_TEXT(trace, 6, "swipack");
 	if (!queue->do_pack) {
 		if (atomic_read(&queue->used_buffers)
 		    >= QETH_HIGH_WATERMARK_PACK){
@@ -2619,7 +2616,22 @@ qeth_switch_packing_state(struct qeth_qdio_out_q *queue)
 #endif
 			queue->do_pack = 1;
 		}
-	} else {
+	}
+}
+
+/*
+ * Switches from packing to non-packing mode. If there is a packing
+ * buffer on the queue this buffer will be prepared to be flushed.
+ * In that case 1 is returned to inform the caller. If no buffer
+ * has to be flushed, zero is returned.
+ */
+static inline int
+qeth_switch_to_nonpacking_if_needed(struct qeth_qdio_out_q *queue)
+{
+	struct qeth_qdio_out_buffer *buffer;
+	int flush_count = 0;
+
+	if (queue->do_pack) {
 		if (atomic_read(&queue->used_buffers)
 		    <= QETH_LOW_WATERMARK_PACK) {
 			/* switch PACKING -> non-PACKING */
@@ -2644,21 +2656,62 @@ qeth_switch_packing_state(struct qeth_qdio_out_q *queue)
 	return flush_count;
 }
 
-static inline void
-qeth_flush_buffers_on_no_pci(struct qeth_qdio_out_q *queue, int under_int)
+/*
+ * Called to flush a packing buffer if no more pci flags are on the queue.
+ * Checks if there is a packing buffer and prepares it to be flushed.
+ * In that case returns 1, otherwise zero.
+ */
+static inline int
+qeth_flush_buffers_on_no_pci(struct qeth_qdio_out_q *queue)
 {
 	struct qeth_qdio_out_buffer *buffer;
-	int index;
 
-	index = queue->next_buf_to_fill;
-	buffer = &queue->bufs[index];
+	buffer = &queue->bufs[queue->next_buf_to_fill];
 	if((atomic_read(&buffer->state) == QETH_QDIO_BUF_EMPTY) &&
 	   (buffer->next_element_to_fill > 0)){
 		/* it's a packing buffer */
 		atomic_set(&buffer->state, QETH_QDIO_BUF_PRIMED);
 		queue->next_buf_to_fill =
 			(queue->next_buf_to_fill + 1) % QDIO_MAX_BUFFERS_PER_Q;
-		qeth_flush_buffers(queue, under_int, index, 1);
+		return 1;
+	}
+	return 0;
+}
+
+static inline void
+qeth_check_outbound_queue(struct qeth_qdio_out_q *queue)
+{
+	int index;
+	int flush_cnt = 0;
+
+	/*
+	 * check if weed have to switch to non-packing mode or if
+	 * we have to get a pci flag out on the queue
+	 */
+	if ((atomic_read(&queue->used_buffers) <= QETH_LOW_WATERMARK_PACK) ||
+	    !atomic_read(&queue->set_pci_flags_count)){
+		if (atomic_swap(&queue->state, QETH_OUT_Q_LOCKED_FLUSH) ==
+				QETH_OUT_Q_UNLOCKED) {
+			/*
+			 * If we get in here, there was no action in
+			 * do_send_packet. So, we check if there is a
+			 * packing buffer to be flushed here.
+			 */
+			/* TODO: try if we get a performance improvement
+			 * by calling netif_stop_queue here */
+			/* save start index for flushing */
+			index = queue->next_buf_to_fill;
+			flush_cnt += qeth_switch_to_nonpacking_if_needed(queue);
+			if (!flush_cnt &&
+			    !atomic_read(&queue->set_pci_flags_count))
+				flush_cnt +=
+					qeth_flush_buffers_on_no_pci(queue);
+			/* were done with updating critical queue members */
+			atomic_set(&queue->state, QETH_OUT_Q_UNLOCKED);
+			/* flushing can be done outside the lock */
+			if (flush_cnt)
+				qeth_flush_buffers(queue, 1, index, flush_cnt);
+		}
 	}
 }
 
@@ -2704,6 +2757,8 @@ qeth_qdio_output_handler(struct ccw_device * ccwdev, unsigned int status,
 		qeth_clear_output_buffer(queue, buffer);
 	}
 	atomic_sub(count, &queue->used_buffers);
+	/* check if we need to do something on this outbound queue */
+	qeth_check_outbound_queue(queue);
 
 	netif_wake_queue(card->dev);
 #ifdef CONFIG_QETH_PERF_STATS
@@ -2975,7 +3030,8 @@ qeth_init_qdio_queues(struct qeth_card *card)
 		card->qdio.out_qs[i]->do_pack = 0;
 		atomic_set(&card->qdio.out_qs[i]->used_buffers,0);
 		atomic_set(&card->qdio.out_qs[i]->set_pci_flags_count, 0);
-		spin_lock_init(&card->qdio.out_qs[i]->lock);
+		atomic_set(&card->qdio.out_qs[i]->state,
+			   QETH_OUT_Q_UNLOCKED);
 	}
 	return 0;
 }
@@ -3289,12 +3345,12 @@ qeth_hard_start_xmit(struct sk_buff *skb, struct net_device *dev)
 	card->perf_stats.outbound_start_time = qeth_get_micros();
 #endif
 	/*
-	 * dev_queue_xmit should ensure that we are called packet
-	 * after packet
+	 * We only call netif_stop_queue in case of errors. Since we've
+	 * got our own synchronization on queues we can keep the stack's
+	 * queue running.
 	 */
-	netif_stop_queue(dev);
-	if (!(rc = qeth_send_packet(card, skb)))
-		netif_wake_queue(dev);
+	if ((rc = qeth_send_packet(card, skb)))
+		netif_stop_queue(dev);
 
 #ifdef CONFIG_QETH_PERF_STATS
 	card->perf_stats.outbound_time += qeth_get_micros() -
@@ -3708,7 +3764,11 @@ qeth_do_send_packet_fast(struct qeth_card *card, struct qeth_qdio_out_q *queue,
 
 	QETH_DBF_TEXT(trace, 6, "dosndpfa");
 
-	spin_lock(&queue->lock);
+	/* spin until we get the queue ... */
+	while (atomic_compare_and_swap(QETH_OUT_Q_UNLOCKED,
+				       QETH_OUT_Q_LOCKED,
+				       &queue->state));
+	/* ... now we've got the queue */
 	index = queue->next_buf_to_fill;
 	buffer = &queue->bufs[queue->next_buf_to_fill];
 	/*
@@ -3717,14 +3777,14 @@ qeth_do_send_packet_fast(struct qeth_card *card, struct qeth_qdio_out_q *queue,
 	 */
 	if (atomic_read(&buffer->state) != QETH_QDIO_BUF_EMPTY) {
 		card->stats.tx_dropped++;
-		spin_unlock(&queue->lock);
+		atomic_set(&queue->state, QETH_OUT_Q_UNLOCKED);
 		return -EBUSY;
 	}
 	queue->next_buf_to_fill = (queue->next_buf_to_fill + 1) %
 				  QDIO_MAX_BUFFERS_PER_Q;
+	atomic_set(&queue->state, QETH_OUT_Q_UNLOCKED);
 	qeth_fill_buffer(queue, buffer, (char *)hdr, skb);
 	qeth_flush_buffers(queue, 0, index, 1);
-	spin_unlock(&queue->lock);
 	return 0;
 }
 
@@ -3740,7 +3800,10 @@ qeth_do_send_packet(struct qeth_card *card, struct qeth_qdio_out_q *queue,
 
 	QETH_DBF_TEXT(trace, 6, "dosndpkt");
 
-	spin_lock(&queue->lock);
+	/* spin until we get the queue ... */
+	while (atomic_compare_and_swap(QETH_OUT_Q_UNLOCKED,
+				       QETH_OUT_Q_LOCKED,
+				       &queue->state));
 	start_index = queue->next_buf_to_fill;
 	buffer = &queue->bufs[queue->next_buf_to_fill];
 	/*
@@ -3749,9 +3812,11 @@ qeth_do_send_packet(struct qeth_card *card, struct qeth_qdio_out_q *queue,
 	 */
 	if (atomic_read(&buffer->state) != QETH_QDIO_BUF_EMPTY){
 		card->stats.tx_dropped++;
-		spin_unlock(&queue->lock);
+		atomic_set(&queue->state, QETH_OUT_Q_UNLOCKED);
 		return -EBUSY;
 	}
+	/* check if we need to switch packing state of this queue */
+	qeth_switch_to_packing_if_needed(queue);
 	if (queue->do_pack){
 		/* does packet fit in current buffer? */
 		if((QETH_MAX_BUFFER_ELEMENTS(card) -
@@ -3766,11 +3831,10 @@ qeth_do_send_packet(struct qeth_card *card, struct qeth_qdio_out_q *queue,
 			/* we did a step forward, so check buffer state again */
 			if (atomic_read(&buffer->state) != QETH_QDIO_BUF_EMPTY){
 				card->stats.tx_dropped++;
-				qeth_flush_buffers(queue, 0, start_index, 1);
-				spin_unlock(&queue->lock);
 				/* return EBUSY because we sent old packet, not
 				 * the current one */
-				return -EBUSY;
+				rc = -EBUSY;
+				goto out;
 			}
 		}
 	}
@@ -3781,16 +3845,27 @@ qeth_do_send_packet(struct qeth_card *card, struct qeth_qdio_out_q *queue,
 		queue->next_buf_to_fill = (queue->next_buf_to_fill + 1) %
 			QDIO_MAX_BUFFERS_PER_Q;
 	}
-	/* check if we need to switch packing state of this queue */
-	flush_count += qeth_switch_packing_state(queue);
-
+	/*
+	 * queue->state will go from LOCKED -> UNLOCKED or from
+	 * LOCKED_FLUSH -> LOCKED if output_handler wanted to 'notify' us
+	 * (switch packing state or flush buffer to get another pci flag out).
+	 * In that case we will enter this loop
+	 */
+	while (atomic_dec_return(&queue->state)){
+		/* check if we can go back to non-packing state */
+		flush_count += qeth_switch_to_nonpacking_if_needed(queue);
+		/*
+		 * check if we need to flush a packing buffer to get a pci
+		 * flag out on the queue
+		 */
+		if (!flush_count && !atomic_read(&queue->set_pci_flags_count))
+			flush_count += qeth_flush_buffers_on_no_pci(queue);
+	}
+	/* at this point the queue is UNLOCKED again */
+out:
 	if (flush_count)
 		qeth_flush_buffers(queue, 0, start_index, flush_count);
 
-	if (!atomic_read(&queue->set_pci_flags_count))
-		qeth_flush_buffers_on_no_pci(queue, 0);
-
-	spin_unlock(&queue->lock);
 	return rc;
 }
 
@@ -3847,7 +3922,8 @@ qeth_mdio_read(struct net_device *dev, int phy_id, int regnum)
 	switch(regnum){
 	case MII_BMCR: /* Basic mode control register */
 		rc = BMCR_FULLDPLX;
-		if(card->info.link_type != QETH_LINK_TYPE_GBIT_ETH)
+		if ((card->info.link_type != QETH_LINK_TYPE_GBIT_ETH)&&
+		    (card->info.link_type != QETH_LINK_TYPE_10GBIT_ETH))
 			rc |= BMCR_SPEED100;
 		break;
 	case MII_BMSR: /* Basic mode status register */
@@ -4718,10 +4794,9 @@ qeth_vlan_rx_kill_vid(struct net_device *dev, unsigned short vid)
 	if (card->vlangrp)
 		card->vlangrp->vlan_devices[vid] = NULL;
 	spin_unlock_irqrestore(&card->vlanlock, flags);
-	qeth_set_thread_start_bit(card, QETH_SET_IP_THREAD);
-	/* delete mc addresses for this vlan dev */
-	qeth_set_thread_start_bit(card, QETH_SET_MC_THREAD);
-	schedule_work(&card->kernel_thread_starter);
+ 	if ( (qeth_set_thread_start_bit(card, QETH_SET_IP_THREAD) == 0) ||
+	     (qeth_set_thread_start_bit(card, QETH_SET_MC_THREAD) == 0) )
+		schedule_work(&card->kernel_thread_starter);
 }
 #endif
 
@@ -4950,8 +5025,8 @@ qeth_set_multicast_list(struct net_device *dev)
 	QETH_DBF_TEXT(trace,3,"setmulti");
 	card = (struct qeth_card *) dev->priv;
 
-	qeth_set_thread_start_bit(card, QETH_SET_MC_THREAD);
-	schedule_work(&card->kernel_thread_starter);
+	if (qeth_set_thread_start_bit(card, QETH_SET_MC_THREAD) == 0)
+		schedule_work(&card->kernel_thread_starter);
 }
 
 static void
@@ -6422,8 +6497,8 @@ qeth_start_again(struct qeth_card *card)
 	rtnl_lock();
 	dev_open(card->dev);
 	rtnl_unlock();
-	qeth_set_thread_start_bit(card, QETH_SET_MC_THREAD);
-	schedule_work(&card->kernel_thread_starter);
+ 	if (qeth_set_thread_start_bit(card, QETH_SET_MC_THREAD) == 0)
+		schedule_work(&card->kernel_thread_starter);
 }
 
 static int
@@ -6809,8 +6884,8 @@ qeth_add_vipa(struct qeth_card *card, enum qeth_prot_versions proto,
 	}
 	if (!qeth_add_ip(card, ipaddr))
 		kfree(ipaddr);
-	qeth_set_thread_start_bit(card, QETH_SET_IP_THREAD);
-	schedule_work(&card->kernel_thread_starter);
+ 	if (qeth_set_thread_start_bit(card, QETH_SET_IP_THREAD) == 0)
+		schedule_work(&card->kernel_thread_starter);
 	return rc;
 }
 
@@ -6838,8 +6913,8 @@ qeth_del_vipa(struct qeth_card *card, enum qeth_prot_versions proto,
 		return;
 	if (!qeth_delete_ip(card, ipaddr))
 		kfree(ipaddr);
-	qeth_set_thread_start_bit(card, QETH_SET_IP_THREAD);
-	schedule_work(&card->kernel_thread_starter);
+ 	if (qeth_set_thread_start_bit(card, QETH_SET_IP_THREAD) == 0)
+		schedule_work(&card->kernel_thread_starter);
 }
 
 /*
@@ -6882,8 +6957,8 @@ qeth_add_rxip(struct qeth_card *card, enum qeth_prot_versions proto,
 	}
 	if (!qeth_add_ip(card, ipaddr))
 		kfree(ipaddr);
-	qeth_set_thread_start_bit(card, QETH_SET_IP_THREAD);
-	schedule_work(&card->kernel_thread_starter);
+ 	if (qeth_set_thread_start_bit(card, QETH_SET_IP_THREAD) == 0)
+		schedule_work(&card->kernel_thread_starter);
 	return 0;
 }
 
@@ -6911,8 +6986,8 @@ qeth_del_rxip(struct qeth_card *card, enum qeth_prot_versions proto,
 		return;
 	if (!qeth_delete_ip(card, ipaddr))
 		kfree(ipaddr);
-	qeth_set_thread_start_bit(card, QETH_SET_IP_THREAD);
-	schedule_work(&card->kernel_thread_starter);
+ 	if (qeth_set_thread_start_bit(card, QETH_SET_IP_THREAD) == 0)
+		schedule_work(&card->kernel_thread_starter);
 }
 
 /**
@@ -6952,8 +7027,8 @@ qeth_ip_event(struct notifier_block *this,
 	default:
 		break;
 	}
-	qeth_set_thread_start_bit(card, QETH_SET_IP_THREAD);
-	schedule_work(&card->kernel_thread_starter);
+ 	if (qeth_set_thread_start_bit(card, QETH_SET_IP_THREAD) == 0)
+		schedule_work(&card->kernel_thread_starter);
 out:
 	return NOTIFY_DONE;
 }
@@ -7005,8 +7080,8 @@ qeth_ip6_event(struct notifier_block *this,
 	default:
 		break;
 	}
-	qeth_set_thread_start_bit(card, QETH_SET_IP_THREAD);
-	schedule_work(&card->kernel_thread_starter);
+ 	if (qeth_set_thread_start_bit(card, QETH_SET_IP_THREAD) == 0)
+		schedule_work(&card->kernel_thread_starter);
 out:
 	return NOTIFY_DONE;
 }
diff --git a/drivers/s390/net/qeth_mpc.h b/drivers/s390/net/qeth_mpc.h
index b4d0d7b10..a6272361f 100644
--- a/drivers/s390/net/qeth_mpc.h
+++ b/drivers/s390/net/qeth_mpc.h
@@ -14,7 +14,7 @@
 
 #include <asm/qeth.h>
 
-#define VERSION_QETH_MPC_H "$Revision: 1.35 $"
+#define VERSION_QETH_MPC_H "$Revision: 1.36 $"
 
 extern const char *VERSION_QETH_MPC_C;
 
@@ -36,7 +36,7 @@ extern unsigned char IPA_PDU_HEADER[];
 
 #define QETH_TIMEOUT 		(10 * HZ)
 #define QETH_IPA_TIMEOUT 	(45 * HZ)
-#define QETH_IDX_COMMAND_SEQNO 	-1
+#define QETH_IDX_COMMAND_SEQNO 	0xffff0000
 #define SR_INFO_LEN		16
 
 #define QETH_CLEAR_CHANNEL_PARM	-10
diff --git a/drivers/s390/net/qeth_sys.c b/drivers/s390/net/qeth_sys.c
index 910c5f566..902f441f0 100644
--- a/drivers/s390/net/qeth_sys.c
+++ b/drivers/s390/net/qeth_sys.c
@@ -1,6 +1,6 @@
 /*
  *
- * linux/drivers/s390/net/qeth_sys.c ($Revision: 1.32 $)
+ * linux/drivers/s390/net/qeth_sys.c ($Revision: 1.33 $)
  *
  * Linux on zSeries OSA Express and HiperSockets support
  * This file contains code related to sysfs.
@@ -20,7 +20,7 @@
 #include "qeth_mpc.h"
 #include "qeth_fs.h"
 
-const char *VERSION_QETH_SYS_C = "$Revision: 1.32 $";
+const char *VERSION_QETH_SYS_C = "$Revision: 1.33 $";
 
 /*****************************************************************************/
 /*                                                                           */
@@ -476,7 +476,7 @@ qeth_dev_add_hhlen_store(struct device *dev, const char *buf, size_t count)
 	    (card->state != CARD_STATE_RECOVER))
 		return -EPERM;
 
-	i = simple_strtoul(buf, &tmp, 16);
+	i = simple_strtoul(buf, &tmp, 10);
 	if ((i < 0) || (i > MAX_ADD_HHLEN)) {
 		PRINT_WARN("add_hhlen out of range\n");
 		return -EINVAL;
diff --git a/drivers/s390/scsi/zfcp_aux.c b/drivers/s390/scsi/zfcp_aux.c
index 4f4fd5a8e..dad02890e 100644
--- a/drivers/s390/scsi/zfcp_aux.c
+++ b/drivers/s390/scsi/zfcp_aux.c
@@ -29,7 +29,7 @@
  */
 
 /* this drivers version (do not edit !!! generated and updated by cvs) */
-#define ZFCP_AUX_REVISION "$Revision: 1.108 $"
+#define ZFCP_AUX_REVISION "$Revision: 1.115 $"
 
 #include "zfcp_ext.h"
 
@@ -41,8 +41,6 @@ static char *device;
 /* written against the module interface */
 static int __init  zfcp_module_init(void);
 
-int zfcp_reboot_handler(struct notifier_block *, unsigned long, void *);
-
 /* FCP related */
 static void zfcp_ns_gid_pn_handler(unsigned long);
 
@@ -310,6 +308,10 @@ zfcp_module_init(void)
 	/* initialize adapters to be removed list head */
 	INIT_LIST_HEAD(&zfcp_data.adapter_remove_lh);
 
+	zfcp_transport_template = fc_attach_transport(&zfcp_transport_functions);
+	if (!zfcp_transport_template)
+		return -ENODEV;
+
 #ifdef CONFIG_S390_SUPPORT
 	retval = register_ioctl32_conversion(zfcp_ioctl_trans.cmd,
 					     zfcp_ioctl_trans.handler);
@@ -334,9 +336,6 @@ zfcp_module_init(void)
 	/* initialise configuration rw lock */
 	rwlock_init(&zfcp_data.config_lock);
 
-	zfcp_data.reboot_notifier.notifier_call = zfcp_reboot_handler;
-	register_reboot_notifier(&zfcp_data.reboot_notifier);
-
 	/* save address of data structure managing the driver module */
 	zfcp_data.scsi_host_template.module = THIS_MODULE;
 
@@ -353,7 +352,6 @@ zfcp_module_init(void)
 	goto out;
 
  out_ccw_register:
-	unregister_reboot_notifier(&zfcp_data.reboot_notifier);
 	misc_deregister(&zfcp_cfdc_misc);
  out_misc_register:
 #ifdef CONFIG_S390_SUPPORT
@@ -365,23 +363,6 @@ zfcp_module_init(void)
 	return retval;
 }
 
-/*
- * This function is called automatically by the kernel whenever a reboot or a 
- * shut-down is initiated and zfcp is still loaded
- *
- * locks:       zfcp_data.config_sema is taken prior to shutting down the module
- *              and removing all structures
- * returns:     NOTIFY_DONE in all cases
- */
-int
-zfcp_reboot_handler(struct notifier_block *notifier, unsigned long code,
-		    void *ptr)
-{
-	zfcp_ccw_unregister();
-	return NOTIFY_DONE;
-}
-
-
 /*
  * function:    zfcp_cfdc_dev_ioctl
  *
@@ -414,7 +395,7 @@ zfcp_cfdc_dev_ioctl(struct inode *inode, struct file *file,
 		retval = -ENOMEM;
 		goto out;
 	}
-	sg_list->count = 0;
+	memset(sg_list, 0, sizeof(*sg_list));
 
 	if (command != ZFCP_CFDC_IOC) {
 		ZFCP_LOG_INFO("IOC request code 0x%x invalid\n", command);
@@ -599,6 +580,7 @@ zfcp_sg_list_alloc(struct zfcp_sg_list *sg_list, size_t size)
 	sg_list->sg = kmalloc(sg_list->count * sizeof(struct scatterlist),
 			      GFP_KERNEL);
 	if (sg_list->sg == NULL) {
+		sg_list->count = 0;
 		retval = -ENOMEM;
 		goto out;
 	}
@@ -635,11 +617,13 @@ zfcp_sg_list_free(struct zfcp_sg_list *sg_list)
 	unsigned int i;
 	int retval = 0;
 
-	BUG_ON((sg_list->sg == NULL) || (sg_list == NULL));
+	BUG_ON(sg_list == NULL);
 
 	for (i = 0, sg = sg_list->sg; i < sg_list->count; i++, sg++)
 		__free_pages(sg->page, 0);
 
+	kfree(sg_list->sg);
+
 	return retval;
 }
 
diff --git a/drivers/s390/scsi/zfcp_ccw.c b/drivers/s390/scsi/zfcp_ccw.c
index 84a5e37e7..001d8067c 100644
--- a/drivers/s390/scsi/zfcp_ccw.c
+++ b/drivers/s390/scsi/zfcp_ccw.c
@@ -26,7 +26,7 @@
  * Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
  */
 
-#define ZFCP_CCW_C_REVISION "$Revision: 1.55 $"
+#define ZFCP_CCW_C_REVISION "$Revision: 1.56 $"
 
 #include "zfcp_ext.h"
 
@@ -37,6 +37,7 @@ static void zfcp_ccw_remove(struct ccw_device *);
 static int zfcp_ccw_set_online(struct ccw_device *);
 static int zfcp_ccw_set_offline(struct ccw_device *);
 static int zfcp_ccw_notify(struct ccw_device *, int);
+static void zfcp_ccw_shutdown(struct device *);
 
 static struct ccw_device_id zfcp_ccw_device_id[] = {
 	{CCW_DEVICE_DEVTYPE(ZFCP_CONTROL_UNIT_TYPE,
@@ -59,6 +60,9 @@ static struct ccw_driver zfcp_ccw_driver = {
 	.set_online  = zfcp_ccw_set_online,
 	.set_offline = zfcp_ccw_set_offline,
 	.notify      = zfcp_ccw_notify,
+	.driver      = {
+		.shutdown = zfcp_ccw_shutdown,
+	},
 };
 
 MODULE_DEVICE_TABLE(ccw, zfcp_ccw_device_id);
@@ -287,4 +291,19 @@ zfcp_ccw_unregister(void)
 	ccw_driver_unregister(&zfcp_ccw_driver);
 }
 
+/**
+ * zfcp_ccw_shutdown - gets called on reboot/shutdown
+ *
+ * Makes sure that QDIO queues are down when the system gets stopped.
+ */
+static void
+zfcp_ccw_shutdown(struct device *dev)
+{
+	struct zfcp_adapter *adapter;
+
+	adapter = dev_get_drvdata(dev);
+	zfcp_erp_adapter_shutdown(adapter, 0);
+	zfcp_erp_wait(adapter);
+}
+
 #undef ZFCP_LOG_AREA
diff --git a/drivers/s390/scsi/zfcp_def.h b/drivers/s390/scsi/zfcp_def.h
index 65c89d335..dda20bf00 100644
--- a/drivers/s390/scsi/zfcp_def.h
+++ b/drivers/s390/scsi/zfcp_def.h
@@ -33,7 +33,7 @@
 #define ZFCP_DEF_H
 
 /* this drivers version (do not edit !!! generated and updated by cvs) */
-#define ZFCP_DEF_REVISION "$Revision: 1.73 $"
+#define ZFCP_DEF_REVISION "$Revision: 1.81 $"
 
 /*************************** INCLUDES *****************************************/
 
@@ -42,18 +42,20 @@
 #include <linux/miscdevice.h>
 #include <linux/major.h>
 #include <linux/blkdev.h>
+#include <linux/delay.h>
 #include <scsi/scsi.h>
 #include <scsi/scsi_tcq.h>
 #include <scsi/scsi_cmnd.h>
 #include <scsi/scsi_device.h>
 #include <scsi/scsi_host.h>
+#include <scsi/scsi_transport.h>
+#include <scsi/scsi_transport_fc.h>
 #include "../../fc4/fc.h"
 #include "zfcp_fsf.h"
 #include <asm/ccwdev.h>
 #include <asm/qdio.h>
 #include <asm/debug.h>
 #include <asm/ebcdic.h>
-#include <linux/reboot.h>
 #include <linux/mempool.h>
 #include <linux/syscalls.h>
 #include <linux/ioctl.h>
@@ -68,7 +70,7 @@
 /********************* GENERAL DEFINES *********************************/
 
 /* zfcp version number, it consists of major, minor, and patch-level number */
-#define ZFCP_VERSION		"4.0.0"
+#define ZFCP_VERSION		"4.1.3"
 
 static inline void *
 zfcp_sg_to_address(struct scatterlist *list)
@@ -509,14 +511,14 @@ struct zfcp_ls_rnid_acc {
 
 /* all log-level defaults are combined to generate initial log-level */
 #define ZFCP_LOG_LEVEL_DEFAULTS \
-	(ZFCP_SET_LOG_NIBBLE(ZFCP_LOG_LEVEL_INFO, ZFCP_LOG_AREA_OTHER) | \
-	 ZFCP_SET_LOG_NIBBLE(ZFCP_LOG_LEVEL_INFO, ZFCP_LOG_AREA_SCSI) | \
-	 ZFCP_SET_LOG_NIBBLE(ZFCP_LOG_LEVEL_INFO, ZFCP_LOG_AREA_FSF) | \
-	 ZFCP_SET_LOG_NIBBLE(ZFCP_LOG_LEVEL_INFO, ZFCP_LOG_AREA_CONFIG) | \
-	 ZFCP_SET_LOG_NIBBLE(ZFCP_LOG_LEVEL_INFO, ZFCP_LOG_AREA_CIO) | \
-	 ZFCP_SET_LOG_NIBBLE(ZFCP_LOG_LEVEL_INFO, ZFCP_LOG_AREA_QDIO) | \
-	 ZFCP_SET_LOG_NIBBLE(ZFCP_LOG_LEVEL_INFO, ZFCP_LOG_AREA_ERP) | \
-	 ZFCP_SET_LOG_NIBBLE(ZFCP_LOG_LEVEL_INFO, ZFCP_LOG_AREA_FC))
+	(ZFCP_SET_LOG_NIBBLE(ZFCP_LOG_LEVEL_NORMAL, ZFCP_LOG_AREA_OTHER) | \
+	 ZFCP_SET_LOG_NIBBLE(ZFCP_LOG_LEVEL_NORMAL, ZFCP_LOG_AREA_SCSI) | \
+	 ZFCP_SET_LOG_NIBBLE(ZFCP_LOG_LEVEL_NORMAL, ZFCP_LOG_AREA_FSF) | \
+	 ZFCP_SET_LOG_NIBBLE(ZFCP_LOG_LEVEL_NORMAL, ZFCP_LOG_AREA_CONFIG) | \
+	 ZFCP_SET_LOG_NIBBLE(ZFCP_LOG_LEVEL_NORMAL, ZFCP_LOG_AREA_CIO) | \
+	 ZFCP_SET_LOG_NIBBLE(ZFCP_LOG_LEVEL_NORMAL, ZFCP_LOG_AREA_QDIO) | \
+	 ZFCP_SET_LOG_NIBBLE(ZFCP_LOG_LEVEL_NORMAL, ZFCP_LOG_AREA_ERP) | \
+	 ZFCP_SET_LOG_NIBBLE(ZFCP_LOG_LEVEL_NORMAL, ZFCP_LOG_AREA_FC))
 
 /* check whether we have the right level for logging */
 #define ZFCP_LOG_CHECK(level) \
@@ -1072,8 +1074,6 @@ struct zfcp_data {
 						       lists */
 	struct semaphore        config_sema;        /* serialises configuration
 						       changes */
-	struct notifier_block	reboot_notifier;     /* used to register cleanup
-							functions */
 	atomic_t		loglevel;            /* current loglevel */
 	char                    init_busid[BUS_ID_SIZE];
 	wwn_t                   init_wwpn;
@@ -1123,32 +1123,6 @@ extern void _zfcp_hex_dump(char *, int);
 		if (ZFCP_LOG_CHECK(level)) { \
 			_zfcp_hex_dump(addr, count); \
 		}
-/*
- * Not yet optimal but useful:
- * Waits until the condition is met or the timeout occurs.
- * The condition may be a function call. This allows to
- * execute some additional instructions in addition
- * to a simple condition check.
- * The timeout is modified on exit and holds the remaining time.
- * Thus it is zero if a timeout ocurred, i.e. the condition was 
- * not met in the specified interval.
- */
-#define __ZFCP_WAIT_EVENT_TIMEOUT(timeout, condition) \
-do { \
-	set_current_state(TASK_UNINTERRUPTIBLE); \
-	while (!(condition) && timeout) \
-		timeout = schedule_timeout(timeout); \
-	current->state = TASK_RUNNING; \
-} while (0);
-
-#define ZFCP_WAIT_EVENT_TIMEOUT(waitqueue, timeout, condition) \
-do { \
-	wait_queue_t entry; \
-	init_waitqueue_entry(&entry, current); \
-	add_wait_queue(&waitqueue, &entry); \
-	__ZFCP_WAIT_EVENT_TIMEOUT(timeout, condition) \
-	remove_wait_queue(&waitqueue, &entry); \
-} while (0);
 
 #define zfcp_get_busid_by_adapter(adapter) (adapter->ccw_device->dev.bus_id)
 #define zfcp_get_busid_by_port(port) (zfcp_get_busid_by_adapter(port->adapter))
diff --git a/drivers/s390/scsi/zfcp_erp.c b/drivers/s390/scsi/zfcp_erp.c
index 505e16ff5..e0766777e 100644
--- a/drivers/s390/scsi/zfcp_erp.c
+++ b/drivers/s390/scsi/zfcp_erp.c
@@ -31,7 +31,7 @@
 #define ZFCP_LOG_AREA			ZFCP_LOG_AREA_ERP
 
 /* this drivers version (do not edit !!! generated and updated by cvs) */
-#define ZFCP_ERP_REVISION "$Revision: 1.54 $"
+#define ZFCP_ERP_REVISION "$Revision: 1.61 $"
 
 #include "zfcp_ext.h"
 
@@ -435,8 +435,20 @@ zfcp_els_handler(unsigned long data)
 	u8 req_code, resp_code;
 	int retval = 0;
 
-	if (send_els->status != 0)
+	if (send_els->status != 0) {
+		ZFCP_LOG_NORMAL("ELS request timed out, force physical port "
+				"reopen of port 0x%016Lx on adapter %s\n",
+				port->wwpn, zfcp_get_busid_by_port(port));
+		debug_text_event(port->adapter->erp_dbf, 3, "forcreop");
+		retval = zfcp_erp_port_forced_reopen(port, 0);
+		if (retval != 0) {
+			ZFCP_LOG_NORMAL("reopen of remote port 0x%016Lx "
+					"on adapter %s failed\n", port->wwpn,
+					zfcp_get_busid_by_port(port));
+			retval = -EPERM;
+		}
 		goto skip_fsfstatus;
+	}
 
 	req = (void*)((page_to_pfn(send_els->req->page) << PAGE_SHIFT) + send_els->req->offset);
 	resp = (void*)((page_to_pfn(send_els->resp->page) << PAGE_SHIFT) + send_els->resp->offset);
@@ -2158,7 +2170,6 @@ static int
 zfcp_erp_adapter_strategy(struct zfcp_erp_action *erp_action)
 {
 	int retval;
-	unsigned long timeout;
 	struct zfcp_adapter *adapter = erp_action->adapter;
 
 	retval = zfcp_erp_adapter_strategy_close(erp_action);
@@ -2175,14 +2186,7 @@ zfcp_erp_adapter_strategy(struct zfcp_erp_action *erp_action)
 		ZFCP_LOG_INFO("Waiting to allow the adapter %s "
 			      "to recover itself\n",
 			      zfcp_get_busid_by_adapter(adapter));
-		/*
-		 * SUGGESTION: substitute by
-		 * timeout = ZFCP_TYPE2_RECOVERY_TIME;
-		 * __ZFCP_WAIT_EVENT_TIMEOUT(timeout, 0);
-		 */
-		timeout = ZFCP_TYPE2_RECOVERY_TIME;
-		set_current_state(TASK_UNINTERRUPTIBLE);
-		schedule_timeout(timeout);
+		msleep(jiffies_to_msecs(ZFCP_TYPE2_RECOVERY_TIME));
 	}
 
 	return retval;
@@ -2286,7 +2290,6 @@ zfcp_erp_adapter_strategy_open_qdio(struct zfcp_erp_action *erp_action)
 	int i;
 	volatile struct qdio_buffer_element *sbale;
 	struct zfcp_adapter *adapter = erp_action->adapter;
-	int retval_cleanup = 0;
 
 	if (atomic_test_mask(ZFCP_STATUS_ADAPTER_QDIOUP, &adapter->status)) {
 		ZFCP_LOG_NORMAL("bug: second attempt to set up QDIO on "
@@ -2301,7 +2304,7 @@ zfcp_erp_adapter_strategy_open_qdio(struct zfcp_erp_action *erp_action)
 			      zfcp_get_busid_by_adapter(adapter));
 		goto failed_qdio_establish;
 	}
-	ZFCP_LOG_DEBUG("queues established\n");
+	debug_text_event(adapter->erp_dbf, 3, "qdio_est");
 
 	if (qdio_activate(adapter->ccw_device, 0) != 0) {
 		ZFCP_LOG_INFO("error: activation of QDIO queues failed "
@@ -2309,7 +2312,7 @@ zfcp_erp_adapter_strategy_open_qdio(struct zfcp_erp_action *erp_action)
 			      zfcp_get_busid_by_adapter(adapter));
 		goto failed_qdio_activate;
 	}
-	ZFCP_LOG_DEBUG("queues activated\n");
+	debug_text_event(adapter->erp_dbf, 3, "qdio_act");
 
 	/*
 	 * put buffers into response queue,
@@ -2357,19 +2360,13 @@ zfcp_erp_adapter_strategy_open_qdio(struct zfcp_erp_action *erp_action)
 	/* NOP */
 
  failed_qdio_activate:
-	/* DEBUG */
-	//__ZFCP_WAIT_EVENT_TIMEOUT(timeout, 0);
-	/* cleanup queues previously established */
-	retval_cleanup = qdio_shutdown(adapter->ccw_device,
-				       QDIO_FLAG_CLEANUP_USING_CLEAR);
-	if (retval_cleanup) {
-		ZFCP_LOG_NORMAL("bug: shutdown of QDIO queues failed "
-				"(retval=%d)\n", retval_cleanup);
-	}
+	debug_text_event(adapter->erp_dbf, 3, "qdio_down1a");
+	while (qdio_shutdown(adapter->ccw_device,
+			     QDIO_FLAG_CLEANUP_USING_CLEAR) == -EINPROGRESS)
+		msleep(1000);
+	debug_text_event(adapter->erp_dbf, 3, "qdio_down1b");
 
  failed_qdio_establish:
-	atomic_clear_mask(ZFCP_STATUS_ADAPTER_QDIOUP, &adapter->status);
-
  failed_sanity:
 	retval = ZFCP_ERP_FAILED;
 
@@ -2401,42 +2398,20 @@ zfcp_erp_adapter_strategy_close_qdio(struct zfcp_erp_action *erp_action)
 		goto out;
 	}
 
-	/* cleanup queues previously established */
-
 	/*
-	 * MUST NOT LOCK - qdio_cleanup might call schedule
-	 * FIXME: need another way to make cleanup safe
+	 * Get queue_lock and clear QDIOUP flag. Thus it's guaranteed that
+	 * do_QDIO won't be called while qdio_shutdown is in progress.
 	 */
-	/* Note:
-	 * We need the request_queue lock here, otherwise there exists the 
-	 * following race:
-	 * 
-	 * queuecommand calls create_fcp_commmand_task...calls req_create, 
-	 * gets sbal x to x+y - meanwhile adapter reopen is called, completes 
-	 * - req_send calls do_QDIO for sbal x to x+y, i.e. wrong indices.
-	 *
-	 * with lock:
-	 * queuecommand calls create_fcp_commmand_task...calls req_create, 
-	 * gets sbal x to x+y - meanwhile adapter reopen is called, waits 
-	 * - req_send calls do_QDIO for sbal x to x+y, i.e. wrong indices 
-	 * but do_QDIO fails as adapter_reopen is still waiting for the lock
-	 * OR
-	 * queuecommand calls create_fcp_commmand_task...calls req_create 
-	 * - meanwhile adapter reopen is called...completes,
-	 * - gets sbal 0 to 0+y, - req_send calls do_QDIO for sbal 0 to 0+y, 
-	 * i.e. correct indices...though an fcp command is called before 
-	 * exchange config data...that should be fine, however
-	 */
-	if (qdio_shutdown(adapter->ccw_device, QDIO_FLAG_CLEANUP_USING_CLEAR)) {
-		/*
-		 * FIXME(design):
-		 * What went wrong? What to do best? Proper retval?
-		 */
-		ZFCP_LOG_NORMAL("bug: shutdown of QDIO queues failed on "
-				"adapter %s\n",
-				zfcp_get_busid_by_adapter(adapter));
-	} else
-		ZFCP_LOG_DEBUG("queues cleaned up\n");
+
+	write_lock_irq(&adapter->request_queue.queue_lock);
+	atomic_clear_mask(ZFCP_STATUS_ADAPTER_QDIOUP, &adapter->status);
+	write_unlock_irq(&adapter->request_queue.queue_lock);
+
+	debug_text_event(adapter->erp_dbf, 3, "qdio_down2a");
+	while (qdio_shutdown(adapter->ccw_device,
+			     QDIO_FLAG_CLEANUP_USING_CLEAR) == -EINPROGRESS)
+		msleep(1000);
+	debug_text_event(adapter->erp_dbf, 3, "qdio_down2b");
 
 	/*
 	 * First we had to stop QDIO operation.
@@ -2459,8 +2434,6 @@ zfcp_erp_adapter_strategy_close_qdio(struct zfcp_erp_action *erp_action)
 	adapter->request_queue.free_index = 0;
 	atomic_set(&adapter->request_queue.free_count, 0);
 	adapter->request_queue.distance_from_int = 0;
-
-	atomic_clear_mask(ZFCP_STATUS_ADAPTER_QDIOUP, &adapter->status);
  out:
 	return retval;
 }
@@ -2548,8 +2521,7 @@ zfcp_erp_adapter_strategy_open_fsf_xconfig(struct zfcp_erp_action *erp_action)
 			ZFCP_LOG_DEBUG("host connection still initialising... "
 				       "waiting and retrying...\n");
 			/* sleep a little bit before retry */
-			set_current_state(TASK_INTERRUPTIBLE);
-			schedule_timeout(ZFCP_EXCHANGE_CONFIG_DATA_SLEEP);
+			msleep(jiffies_to_msecs(ZFCP_EXCHANGE_CONFIG_DATA_SLEEP));
 		}
 	} while ((retries--) &&
 		 atomic_test_mask(ZFCP_STATUS_ADAPTER_HOST_CON_INIT,
diff --git a/drivers/s390/scsi/zfcp_ext.h b/drivers/s390/scsi/zfcp_ext.h
index 2db169554..d99005c01 100644
--- a/drivers/s390/scsi/zfcp_ext.h
+++ b/drivers/s390/scsi/zfcp_ext.h
@@ -31,7 +31,7 @@
 #ifndef ZFCP_EXT_H
 #define ZFCP_EXT_H
 /* this drivers version (do not edit !!! generated and updated by cvs) */
-#define ZFCP_EXT_REVISION "$Revision: 1.50 $"
+#define ZFCP_EXT_REVISION "$Revision: 1.51 $"
 
 #include "zfcp_def.h"
 
@@ -136,6 +136,8 @@ extern int zfcp_scsi_command_async(struct zfcp_adapter *,struct zfcp_unit *unit,
 				   struct scsi_cmnd *scsi_cmnd);
 extern int zfcp_scsi_command_sync(struct zfcp_unit *unit,
 				  struct scsi_cmnd *scsi_cmnd);
+extern struct scsi_transport_template *zfcp_transport_template;
+extern struct fc_function_template zfcp_transport_functions;
 
 /******************************** ERP ****************************************/
 extern void zfcp_erp_modify_adapter_status(struct zfcp_adapter *, u32, int);
diff --git a/drivers/s390/scsi/zfcp_fsf.c b/drivers/s390/scsi/zfcp_fsf.c
index 85120ce9f..79451af65 100644
--- a/drivers/s390/scsi/zfcp_fsf.c
+++ b/drivers/s390/scsi/zfcp_fsf.c
@@ -29,7 +29,7 @@
  */
 
 /* this drivers version (do not edit !!! generated and updated by cvs) */
-#define ZFCP_FSF_C_REVISION "$Revision: 1.47 $"
+#define ZFCP_FSF_C_REVISION "$Revision: 1.55 $"
 
 #include "zfcp_ext.h"
 
@@ -180,8 +180,7 @@ zfcp_fsf_req_dismiss_all(struct zfcp_adapter *adapter)
 		ZFCP_LOG_DEBUG("fsf req list of adapter %s not yet empty\n",
 			       zfcp_get_busid_by_adapter(adapter));
 		/* wait for woken intiators to clean up their requests */
-		set_current_state(TASK_UNINTERRUPTIBLE);
-		schedule_timeout(ZFCP_FSFREQ_CLEANUP_TIMEOUT);
+		msleep(jiffies_to_msecs(ZFCP_FSFREQ_CLEANUP_TIMEOUT));
 	}
 
 	/* consistency check */
@@ -2620,6 +2619,7 @@ zfcp_fsf_close_physical_port(struct zfcp_erp_action *erp_action)
 {
 	int retval = 0;
 	unsigned long lock_flags;
+	volatile struct qdio_buffer_element *sbale;
 
 	/* setup new FSF request */
 	retval = zfcp_fsf_req_create(erp_action->adapter,
@@ -2636,6 +2636,11 @@ zfcp_fsf_close_physical_port(struct zfcp_erp_action *erp_action)
 		goto out;
 	}
 
+	sbale = zfcp_qdio_sbale_req(erp_action->fsf_req,
+				    erp_action->fsf_req->sbal_curr, 0);
+	sbale[0].flags |= SBAL_FLAGS0_TYPE_READ;
+	sbale[1].flags |= SBAL_FLAGS_LAST_ENTRY;
+
 	/* mark port as being closed */
 	atomic_set_mask(ZFCP_STATUS_PORT_PHYS_CLOSING,
 			&erp_action->port->status);
@@ -3997,15 +4002,14 @@ zfcp_fsf_send_fcp_command_task_handler(struct zfcp_fsf_req *fsf_req)
 	scpnt->result |= fcp_rsp_iu->scsi_status;
 	if (unlikely(fcp_rsp_iu->scsi_status)) {
 		/* DEBUG */
-		ZFCP_LOG_NORMAL("status for SCSI Command:\n");
-		ZFCP_HEX_DUMP(ZFCP_LOG_LEVEL_NORMAL,
+		ZFCP_LOG_DEBUG("status for SCSI Command:\n");
+		ZFCP_HEX_DUMP(ZFCP_LOG_LEVEL_DEBUG,
 			      scpnt->cmnd, scpnt->cmd_len);
-
-		ZFCP_LOG_NORMAL("SCSI status code 0x%x\n",
+		ZFCP_LOG_DEBUG("SCSI status code 0x%x\n",
 				fcp_rsp_iu->scsi_status);
-		ZFCP_HEX_DUMP(ZFCP_LOG_LEVEL_NORMAL,
+		ZFCP_HEX_DUMP(ZFCP_LOG_LEVEL_DEBUG,
 			      (void *) fcp_rsp_iu, sizeof (struct fcp_rsp_iu));
-		ZFCP_HEX_DUMP(ZFCP_LOG_LEVEL_NORMAL,
+		ZFCP_HEX_DUMP(ZFCP_LOG_LEVEL_DEBUG,
 			      zfcp_get_fcp_sns_info_ptr(fcp_rsp_iu),
 			      fcp_rsp_iu->fcp_sns_len);
 	}
@@ -4718,14 +4722,14 @@ zfcp_fsf_req_sbal_get(struct zfcp_adapter *adapter, int req_flags,
 		      unsigned long *lock_flags)
 {
         int condition;
-        unsigned long timeout = ZFCP_SBAL_TIMEOUT;
         struct zfcp_qdio_queue *req_queue = &adapter->request_queue;
 
         if (unlikely(req_flags & ZFCP_WAIT_FOR_SBAL)) {
-                ZFCP_WAIT_EVENT_TIMEOUT(adapter->request_wq, timeout,
-                                        (condition =
-                                         (zfcp_fsf_req_create_sbal_check)
-                                         (lock_flags, req_queue, 1)));
+                wait_event_interruptible_timeout(adapter->request_wq,
+						 (condition =
+						  zfcp_fsf_req_create_sbal_check
+						  (lock_flags, req_queue, 1)),
+						 ZFCP_SBAL_TIMEOUT);
                 if (!condition) {
                         return -EIO;
 		}
@@ -4782,6 +4786,17 @@ zfcp_fsf_req_create(struct zfcp_adapter *adapter, u32 fsf_cmd, int req_flags,
                 goto failed_sbals;
 	}
 
+	/*
+	 * We hold queue_lock here. Check if QDIOUP is set and let request fail
+	 * if it is not set (see also *_open_qdio and *_close_qdio).
+	 */
+
+	if (!atomic_test_mask(ZFCP_STATUS_ADAPTER_QDIOUP, &adapter->status)) {
+		write_unlock_irqrestore(&req_queue->queue_lock, *lock_flags);
+		ret = -EIO;
+		goto failed_sbals;
+	}
+
 	fsf_req->adapter = adapter;	/* pointer to "parent" adapter */
 	fsf_req->fsf_command = fsf_cmd;
 	fsf_req->sbal_number = 1;
diff --git a/drivers/s390/scsi/zfcp_scsi.c b/drivers/s390/scsi/zfcp_scsi.c
index 34a73f2f0..d0a879f0a 100644
--- a/drivers/s390/scsi/zfcp_scsi.c
+++ b/drivers/s390/scsi/zfcp_scsi.c
@@ -31,7 +31,7 @@
 #define ZFCP_LOG_AREA			ZFCP_LOG_AREA_SCSI
 
 /* this drivers version (do not edit !!! generated and updated by cvs) */
-#define ZFCP_SCSI_REVISION "$Revision: 1.62 $"
+#define ZFCP_SCSI_REVISION "$Revision: 1.65 $"
 
 #include "zfcp_ext.h"
 
@@ -51,6 +51,8 @@ static struct zfcp_unit *zfcp_unit_lookup(struct zfcp_adapter *, int, scsi_id_t,
 
 static struct device_attribute *zfcp_sysfs_sdev_attrs[];
 
+struct scsi_transport_template *zfcp_transport_template;
+
 struct zfcp_data zfcp_data = {
 	.scsi_host_template = {
 	      name:	               ZFCP_NAME,
@@ -508,8 +510,7 @@ zfcp_scsi_eh_abort_handler(struct scsi_cmnd *scpnt)
 	ZFCP_LOG_DEBUG("unit 0x%016Lx (%p)\n", unit->fcp_lun, unit);
 
 	/*
-	 * The 'Abort FCP Command' routine may block (call schedule)
-	 * because it may wait for a free SBAL.
+	 * We block (call schedule)
 	 * That's why we must release the lock and enable the
 	 * interrupts before.
 	 * On the other hand we do not need the lock anymore since
@@ -518,8 +519,7 @@ zfcp_scsi_eh_abort_handler(struct scsi_cmnd *scpnt)
 	write_unlock_irqrestore(&adapter->abort_lock, flags);
 	/* call FSF routine which does the abort */
 	new_fsf_req = zfcp_fsf_abort_fcp_command((unsigned long) old_fsf_req,
-						 adapter,
-						 unit, ZFCP_WAIT_FOR_SBAL);
+						 adapter, unit, 0);
 	ZFCP_LOG_DEBUG("new_fsf_req=%p\n", new_fsf_req);
 	if (!new_fsf_req) {
 		retval = FAILED;
@@ -657,7 +657,7 @@ zfcp_task_management_function(struct zfcp_unit *unit, u8 tm_flags)
 
 	/* issue task management function */
 	fsf_req = zfcp_fsf_send_fcp_command_task_management
-	    (adapter, unit, tm_flags, ZFCP_WAIT_FOR_SBAL);
+		(adapter, unit, tm_flags, 0);
 	if (!fsf_req) {
 		ZFCP_LOG_INFO("error: creation of task management request "
 			      "failed for unit 0x%016Lx on port 0x%016Lx on  "
@@ -768,6 +768,7 @@ zfcp_adapter_scsi_register(struct zfcp_adapter *adapter)
 	adapter->scsi_host->max_channel = 0;
 	adapter->scsi_host->unique_id = unique_id++;	/* FIXME */
 	adapter->scsi_host->max_cmd_len = ZFCP_MAX_SCSI_CMND_LENGTH;
+	adapter->scsi_host->transportt = zfcp_transport_template;
 	/*
 	 * Reverse mapping of the host number to avoid race condition
 	 */
@@ -823,6 +824,44 @@ zfcp_fsf_start_scsi_er_timer(struct zfcp_adapter *adapter)
 	add_timer(&adapter->scsi_er_timer);
 }
 
+/*
+ * Support functions for FC transport class
+ */
+static void
+zfcp_get_port_id(struct scsi_device *sdev)
+{
+	struct zfcp_unit *unit;
+
+	unit = (struct zfcp_unit *) sdev->hostdata;
+	fc_port_id(sdev) = unit->port->d_id;
+}
+
+static void
+zfcp_get_port_name(struct scsi_device *sdev)
+{
+	struct zfcp_unit *unit;
+
+	unit = (struct zfcp_unit *) sdev->hostdata;
+	fc_port_name(sdev) = unit->port->wwpn;
+}
+
+static void
+zfcp_get_node_name(struct scsi_device *sdev)
+{
+	struct zfcp_unit *unit;
+
+	unit = (struct zfcp_unit *) sdev->hostdata;
+	fc_node_name(sdev) = unit->port->wwnn;
+}
+
+struct fc_function_template zfcp_transport_functions = {
+	.get_port_id = zfcp_get_port_id,
+	.get_port_name = zfcp_get_port_name,
+	.get_node_name = zfcp_get_node_name,
+	.show_port_id = 1,
+	.show_port_name = 1,
+	.show_node_name = 1,
+};
 
 /**
  * ZFCP_DEFINE_SCSI_ATTR
diff --git a/drivers/s390/scsi/zfcp_sysfs_port.c b/drivers/s390/scsi/zfcp_sysfs_port.c
index e0ace9349..11a27c1ff 100644
--- a/drivers/s390/scsi/zfcp_sysfs_port.c
+++ b/drivers/s390/scsi/zfcp_sysfs_port.c
@@ -26,7 +26,7 @@
  * Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
  */
 
-#define ZFCP_SYSFS_PORT_C_REVISION "$Revision: 1.40 $"
+#define ZFCP_SYSFS_PORT_C_REVISION "$Revision: 1.41 $"
 
 #include "zfcp_ext.h"
 
@@ -125,7 +125,7 @@ zfcp_sysfs_unit_remove_store(struct device *dev, const char *buf, size_t count)
 	struct zfcp_unit *unit;
 	fcp_lun_t fcp_lun;
 	char *endp;
-	int retval = -EINVAL;
+	int retval = 0;
 
 	down(&zfcp_data.config_sema);
 
@@ -136,8 +136,10 @@ zfcp_sysfs_unit_remove_store(struct device *dev, const char *buf, size_t count)
 	}
 
 	fcp_lun = simple_strtoull(buf, &endp, 0);
-	if ((endp + 1) < (buf + count))
+	if ((endp + 1) < (buf + count)) {
+		retval = -EINVAL;
 		goto out;
+	}
 
 	write_lock_irq(&zfcp_data.config_lock);
 	unit = zfcp_get_unit_by_lun(port, fcp_lun);
diff --git a/drivers/sbus/char/Kconfig b/drivers/sbus/char/Kconfig
index bba1c80db..90d8ef1f0 100644
--- a/drivers/sbus/char/Kconfig
+++ b/drivers/sbus/char/Kconfig
@@ -39,7 +39,7 @@ config SUN_BPP
 
 config SUN_VIDEOPIX
 	tristate "Videopix Frame Grabber (EXPERIMENTAL)"
-	depends on EXPERIMENTAL
+	depends on EXPERIMENTAL && (BROKEN || !64BIT)
 	help
 	  Say Y here to support the Videopix Frame Grabber from Sun
 	  Microsystems, commonly found on SPARCstations.  This card, which is
@@ -48,7 +48,7 @@ config SUN_VIDEOPIX
 
 config SUN_AURORA
 	tristate "Aurora Multiboard 1600se (EXPERIMENTAL)"
-	depends on EXPERIMENTAL
+	depends on EXPERIMENTAL && BROKEN
 	help
 	  The Aurora Multiboard is a multi-port high-speed serial controller.
 	  If you have one of these, say Y.
diff --git a/drivers/sbus/char/bbc_envctrl.c b/drivers/sbus/char/bbc_envctrl.c
index f028b154a..37189ef06 100644
--- a/drivers/sbus/char/bbc_envctrl.c
+++ b/drivers/sbus/char/bbc_envctrl.c
@@ -7,6 +7,7 @@
 #include <linux/kernel.h>
 #include <linux/sched.h>
 #include <linux/slab.h>
+#include <linux/delay.h>
 #include <asm/oplib.h>
 #include <asm/ebus.h>
 #define __KERNEL_SYSCALLS__
@@ -622,9 +623,7 @@ void bbc_envctrl_cleanup(void)
 			read_unlock(&tasklist_lock);
 			if (!found)
 				break;
-			current->state = TASK_INTERRUPTIBLE;
-			schedule_timeout(HZ);
-			current->state = TASK_RUNNING;
+			msleep(1000);
 		}
 		kenvctrld_task = NULL;
 	}
diff --git a/drivers/sbus/char/bpp.c b/drivers/sbus/char/bpp.c
index 95d403c55..8067aea1d 100644
--- a/drivers/sbus/char/bpp.c
+++ b/drivers/sbus/char/bpp.c
@@ -482,7 +482,7 @@ static int bpp_release(struct inode *inode, struct file *f)
       return 0;
 }
 
-static long read_nibble(unsigned minor, char *c, unsigned long cnt)
+static long read_nibble(unsigned minor, char __user *c, unsigned long cnt)
 {
       unsigned long remaining = cnt;
       long rc;
@@ -535,7 +535,7 @@ static long read_nibble(unsigned minor, char *c, unsigned long cnt)
       return cnt - remaining;
 }
 
-static long read_ecp(unsigned minor, char *c, unsigned long cnt)
+static long read_ecp(unsigned minor, char __user *c, unsigned long cnt)
 {
       unsigned long remaining;
       long rc;
@@ -630,7 +630,7 @@ static long read_ecp(unsigned minor, char *c, unsigned long cnt)
       return cnt - remaining;
 }
 
-static ssize_t bpp_read(struct file *f, char *c, size_t cnt, loff_t * ppos)
+static ssize_t bpp_read(struct file *f, char __user *c, size_t cnt, loff_t * ppos)
 {
       long rc;
       unsigned minor = iminor(f->f_dentry->d_inode);
@@ -692,7 +692,7 @@ static ssize_t bpp_read(struct file *f, char *c, size_t cnt, loff_t * ppos)
  * Compatibility mode handshaking is a matter of writing data,
  * strobing it, and waiting for the printer to stop being busy.
  */
-static long write_compat(unsigned minor, const char *c, unsigned long cnt)
+static long write_compat(unsigned minor, const char __user *c, unsigned long cnt)
 {
       long rc;
       unsigned short pins = get_pins(minor);
@@ -730,7 +730,7 @@ static long write_compat(unsigned minor, const char *c, unsigned long cnt)
  * Write data using ECP mode. Watch out that the port may be set up
  * for reading. If so, turn the port around.
  */
-static long write_ecp(unsigned minor, const char *c, unsigned long cnt)
+static long write_ecp(unsigned minor, const char __user *c, unsigned long cnt)
 {
       unsigned short pins = get_pins(minor);
       unsigned long remaining = cnt;
@@ -783,7 +783,7 @@ static long write_ecp(unsigned minor, const char *c, unsigned long cnt)
  * that. Otherwise, terminate and do my writing in compat mode. This
  * is the safest course as any device can handle it.
  */
-static ssize_t bpp_write(struct file *f, const char *c, size_t cnt, loff_t * ppos)
+static ssize_t bpp_write(struct file *f, const char __user *c, size_t cnt, loff_t * ppos)
 {
       long errno = 0;
       unsigned minor = iminor(f->f_dentry->d_inode);
diff --git a/drivers/sbus/char/cpwatchdog.c b/drivers/sbus/char/cpwatchdog.c
index e383894df..ad870a300 100644
--- a/drivers/sbus/char/cpwatchdog.c
+++ b/drivers/sbus/char/cpwatchdog.c
@@ -324,7 +324,7 @@ static int wd_open(struct inode *inode, struct file *f)
 		wd_dev.initialized = 1;
 	}
 
-	return(0);
+	return(nonseekable_open(inode, f));
 }
 
 static int wd_release(struct inode *inode, struct file *file)
@@ -337,6 +337,7 @@ static int wd_ioctl(struct inode *inode, struct file *file,
 {
 	int 	setopt 				= 0;
 	struct 	wd_timer* pTimer 	= (struct wd_timer*)file->private_data;
+	void __user *argp = (void __user *)arg;
 	struct 	watchdog_info info 	= {
 		0,
 		0,
@@ -351,22 +352,20 @@ static int wd_ioctl(struct inode *inode, struct file *file,
 	{
 		/* Generic Linux IOCTLs */
 		case WDIOC_GETSUPPORT:
-			if(copy_to_user((struct watchdog_info *)arg, 
-							(struct watchdog_info *)&info, 
-							sizeof(struct watchdog_info))) {
+			if(copy_to_user(argp, &info, sizeof(struct watchdog_info))) {
 				return(-EFAULT);
 			}
 			break;
 		case WDIOC_GETSTATUS:
 		case WDIOC_GETBOOTSTATUS:
-			if (put_user(0, (int *) arg))
+			if (put_user(0, (int __user *)argp))
 				return -EFAULT;
 			break;
 		case WDIOC_KEEPALIVE:
 			wd_pingtimer(pTimer);
 			break;
 		case WDIOC_SETOPTIONS:
-			if(copy_from_user(&setopt, (void*) arg, sizeof(unsigned int))) {
+			if(copy_from_user(&setopt, argp, sizeof(unsigned int))) {
 				return -EFAULT;
 			}
 			if(setopt & WDIOS_DISABLECARD) {
@@ -388,7 +387,7 @@ static int wd_ioctl(struct inode *inode, struct file *file,
 		/* Solaris-compatible IOCTLs */
 		case WIOCGSTAT:
 			setopt = wd_getstatus(pTimer);
-			if(copy_to_user((void*)arg, &setopt, sizeof(unsigned int))) {
+			if(copy_to_user(argp, &setopt, sizeof(unsigned int))) {
 				return(-EFAULT);
 			}
 			break;
@@ -409,10 +408,10 @@ static int wd_ioctl(struct inode *inode, struct file *file,
 	return(0);
 }
 
-static ssize_t wd_write(	struct file 	*file, 
-							const char		*buf, 
-							size_t 			count, 
-							loff_t 			*ppos)
+static ssize_t wd_write(struct file 	*file, 
+			const char	__user *buf, 
+			size_t 		count, 
+			loff_t 		*ppos)
 {
 	struct wd_timer* pTimer = (struct wd_timer*)file->private_data;
 
@@ -420,9 +419,6 @@ static ssize_t wd_write(	struct file 	*file,
 		return(-EINVAL);
 	}
 
-	if (ppos != &file->f_pos)
-		return -ESPIPE;
-
 	if (count) {
 		wd_pingtimer(pTimer);
 		return 1;
@@ -430,7 +426,7 @@ static ssize_t wd_write(	struct file 	*file,
 	return 0;
 }
 
-static ssize_t wd_read(struct file * file, char * buffer,
+static ssize_t wd_read(struct file * file, char __user *buffer,
 		        size_t count, loff_t *ppos)
 {
 #ifdef WD_DEBUG
diff --git a/drivers/sbus/char/display7seg.c b/drivers/sbus/char/display7seg.c
index 8d1a1e1b9..e8ac0b4d3 100644
--- a/drivers/sbus/char/display7seg.c
+++ b/drivers/sbus/char/display7seg.c
@@ -70,7 +70,7 @@ MODULE_SUPPORTED_DEVICE
  * FLIP		- Inverts display for upside-down mounted board
  * bits 0-4	- 7-segment display contents
  */
-volatile u8* d7s_regs = 0;
+volatile u8* d7s_regs = NULL;
 
 static inline void d7s_free(void)
 {
@@ -128,7 +128,7 @@ static int d7s_ioctl(struct inode *inode, struct file *f,
 		/* assign device register values
 		 * we mask-out D7S_FLIP if in sol_compat mode
 		 */
-		if (get_user(ireg, (int *) arg))
+		if (get_user(ireg, (int __user *) arg))
 			return -EFAULT;
 		if (0 != sol_compat) {
 			(regs & D7S_FLIP) ? 
@@ -144,7 +144,7 @@ static int d7s_ioctl(struct inode *inode, struct file *f,
 		 * This driver will not misinform you about the state
 		 * of your hardware while in sol_compat mode
 		 */
-		if (put_user(regs, (int *) arg))
+		if (put_user(regs, (int __user *) arg))
 			return -EFAULT;
 		break;
 
diff --git a/drivers/sbus/char/envctrl.c b/drivers/sbus/char/envctrl.c
index 0c5e0a004..cd6e2d39f 100644
--- a/drivers/sbus/char/envctrl.c
+++ b/drivers/sbus/char/envctrl.c
@@ -556,7 +556,7 @@ static unsigned char envctrl_i2c_voltage_status(struct i2c_child_t *pchild,
  * Return: Number of read bytes. 0 for error.
  */
 static ssize_t
-envctrl_read(struct file *file, char *buf, size_t count, loff_t *ppos)
+envctrl_read(struct file *file, char __user *buf, size_t count, loff_t *ppos)
 {
 	struct i2c_child_t *pchild;
 	unsigned char data[10];
@@ -574,7 +574,7 @@ envctrl_read(struct file *file, char *buf, size_t count, loff_t *ppos)
 
 		data[0] = (unsigned char)(warning_temperature);
 		ret = 1;
-		if (copy_to_user((unsigned char *)buf, data, ret))
+		if (copy_to_user(buf, data, ret))
 			ret = -EFAULT;
 		break;
 
@@ -584,7 +584,7 @@ envctrl_read(struct file *file, char *buf, size_t count, loff_t *ppos)
 
 		data[0] = (unsigned char)(shutdown_temperature);
 		ret = 1;
-		if (copy_to_user((unsigned char *)buf, data, ret))
+		if (copy_to_user(buf, data, ret))
 			ret = -EFAULT;
 		break;
 
@@ -592,7 +592,7 @@ envctrl_read(struct file *file, char *buf, size_t count, loff_t *ppos)
 		if (!(pchild = envctrl_get_i2c_child(ENVCTRL_MTHRBDTEMP_MON)))
 			return 0;
 		ret = envctrl_read_noncpu_info(pchild, ENVCTRL_MTHRBDTEMP_MON, data);
-		if (copy_to_user((unsigned char *)buf, data, ret))
+		if (copy_to_user(buf, data, ret))
 			ret = -EFAULT;
 		break;
 
@@ -602,7 +602,7 @@ envctrl_read(struct file *file, char *buf, size_t count, loff_t *ppos)
 		ret = envctrl_read_cpu_info(read_cpu, pchild, ENVCTRL_CPUTEMP_MON, data);
 
 		/* Reset cpu to the default cpu0. */
-		if (copy_to_user((unsigned char *)buf, data, ret))
+		if (copy_to_user(buf, data, ret))
 			ret = -EFAULT;
 		break;
 
@@ -612,7 +612,7 @@ envctrl_read(struct file *file, char *buf, size_t count, loff_t *ppos)
 		ret = envctrl_read_cpu_info(read_cpu, pchild, ENVCTRL_CPUVOLTAGE_MON, data);
 
 		/* Reset cpu to the default cpu0. */
-		if (copy_to_user((unsigned char *)buf, data, ret))
+		if (copy_to_user(buf, data, ret))
 			ret = -EFAULT;
 		break;
 
@@ -620,7 +620,7 @@ envctrl_read(struct file *file, char *buf, size_t count, loff_t *ppos)
 		if (!(pchild = envctrl_get_i2c_child(ENVCTRL_SCSITEMP_MON)))
 			return 0;
 		ret = envctrl_read_noncpu_info(pchild, ENVCTRL_SCSITEMP_MON, data);
-		if (copy_to_user((unsigned char *)buf, data, ret))
+		if (copy_to_user(buf, data, ret))
 			ret = -EFAULT;
 		break;
 
@@ -628,7 +628,7 @@ envctrl_read(struct file *file, char *buf, size_t count, loff_t *ppos)
 		if (!(pchild = envctrl_get_i2c_child(ENVCTRL_ETHERTEMP_MON)))
 			return 0;
 		ret = envctrl_read_noncpu_info(pchild, ENVCTRL_ETHERTEMP_MON, data);
-		if (copy_to_user((unsigned char *)buf, data, ret))
+		if (copy_to_user(buf, data, ret))
 			ret = -EFAULT;
 		break;
 
@@ -637,7 +637,7 @@ envctrl_read(struct file *file, char *buf, size_t count, loff_t *ppos)
 			return 0;
 		data[0] = envctrl_i2c_read_8574(pchild->addr);
 		ret = envctrl_i2c_fan_status(pchild,data[0], data);
-		if (copy_to_user((unsigned char *)buf, data, ret))
+		if (copy_to_user(buf, data, ret))
 			ret = -EFAULT;
 		break;
 	
@@ -646,7 +646,7 @@ envctrl_read(struct file *file, char *buf, size_t count, loff_t *ppos)
 			return 0;
 		data[0] = envctrl_i2c_read_8574(pchild->addr);
 		ret = envctrl_i2c_globaladdr(pchild, data[0], data);
-		if (copy_to_user((unsigned char *)buf, data, ret))
+		if (copy_to_user(buf, data, ret))
 			ret = -EFAULT;
 		break;
 
@@ -657,7 +657,7 @@ envctrl_read(struct file *file, char *buf, size_t count, loff_t *ppos)
 				return 0;
 		data[0] = envctrl_i2c_read_8574(pchild->addr);
 		ret = envctrl_i2c_voltage_status(pchild, data[0], data);
-		if (copy_to_user((unsigned char *)buf, data, ret))
+		if (copy_to_user(buf, data, ret))
 			ret = -EFAULT;
 		break;
 
@@ -676,7 +676,7 @@ static int
 envctrl_ioctl(struct inode *inode, struct file *file,
 	      unsigned int cmd, unsigned long arg)
 {
-	char *infobuf;
+	char __user *infobuf;
 
 	switch (cmd) {
 	case ENVCTRL_RD_WARNING_TEMPERATURE:
@@ -695,7 +695,7 @@ envctrl_ioctl(struct inode *inode, struct file *file,
 		/* Check to see if application passes in any cpu number,
 		 * the default is cpu0.
 		 */
-		infobuf = (char *) arg;
+		infobuf = (char __user *) arg;
 		if (infobuf == NULL) {
 			read_cpu = 0;
 		}else {
@@ -719,7 +719,7 @@ envctrl_ioctl(struct inode *inode, struct file *file,
 static int
 envctrl_open(struct inode *inode, struct file *file)
 {
-	file->private_data = 0;
+	file->private_data = NULL;
 	return 0;
 }
 
@@ -1181,8 +1181,7 @@ static void __exit envctrl_cleanup(void)
 			if (!found)
 				break;
 
-			current->state = TASK_INTERRUPTIBLE;
-			schedule_timeout(HZ);
+			msleep(1000);
 		}
 		kenvctrld_task = NULL;
 	}
diff --git a/drivers/sbus/char/flash.c b/drivers/sbus/char/flash.c
index 61cf81ff5..f35cb3276 100644
--- a/drivers/sbus/char/flash.c
+++ b/drivers/sbus/char/flash.c
@@ -105,7 +105,7 @@ flash_llseek(struct file *file, long long offset, int origin)
 }
 
 static ssize_t
-flash_read(struct file * file, char * buf,
+flash_read(struct file * file, char __user * buf,
 	   size_t count, loff_t *ppos)
 {
 	unsigned long p = file->f_pos;
@@ -161,10 +161,10 @@ static struct miscdevice flash_dev = { FLASH_MINOR, "flash", &flash_fops };
 static int __init flash_init(void)
 {
 	struct sbus_bus *sbus;
-	struct sbus_dev *sdev = 0;
+	struct sbus_dev *sdev = NULL;
 #ifdef CONFIG_PCI
 	struct linux_ebus *ebus;
-	struct linux_ebus_device *edev = 0;
+	struct linux_ebus_device *edev = NULL;
 	struct linux_prom_registers regs[2];
 	int len, nregs;
 #endif
diff --git a/drivers/sbus/char/openprom.c b/drivers/sbus/char/openprom.c
index c140f63b3..7c23de377 100644
--- a/drivers/sbus/char/openprom.c
+++ b/drivers/sbus/char/openprom.c
@@ -67,7 +67,7 @@ static int options_node = 0;
  * structure will be placed in "*opp_p". Return value is the length
  * of the user supplied buffer.
  */
-static int copyin(struct openpromio *info, struct openpromio **opp_p)
+static int copyin(struct openpromio __user *info, struct openpromio **opp_p)
 {
 	unsigned int bufsize;
 
@@ -98,7 +98,7 @@ static int copyin(struct openpromio *info, struct openpromio **opp_p)
 	return bufsize;
 }
 
-static int getstrings(struct openpromio *info, struct openpromio **opp_p)
+static int getstrings(struct openpromio __user *info, struct openpromio **opp_p)
 {
 	int n, bufsize;
 	char c;
@@ -132,7 +132,7 @@ static int getstrings(struct openpromio *info, struct openpromio **opp_p)
 /*
  * Copy an openpromio structure in kernel space back to user space.
  */
-static int copyout(void *info, struct openpromio *opp, int len)
+static int copyout(void __user *info, struct openpromio *opp, int len)
 {
 	if (copy_to_user(info, opp, len))
 		return -EFAULT;
@@ -149,13 +149,13 @@ static int openprom_sunos_ioctl(struct inode * inode, struct file * file,
 	char buffer[OPROMMAXPARAM+1], *buf;
 	struct openpromio *opp;
 	int bufsize, len, error = 0;
-	extern char saved_command_line[];
 	static int cnt;
+	void __user *argp = (void __user *)arg;
 
 	if (cmd == OPROMSETOPT)
-		bufsize = getstrings((void *)arg, &opp);
+		bufsize = getstrings(argp, &opp);
 	else
-		bufsize = copyin((void *)arg, &opp);
+		bufsize = copyin(argp, &opp);
 
 	if (bufsize < 0)
 		return bufsize;
@@ -166,7 +166,7 @@ static int openprom_sunos_ioctl(struct inode * inode, struct file * file,
 		len = prom_getproplen(node, opp->oprom_array);
 
 		if (len <= 0 || len > bufsize) {
-			error = copyout((void *)arg, opp, sizeof(int));
+			error = copyout(argp, opp, sizeof(int));
 			break;
 		}
 
@@ -176,7 +176,7 @@ static int openprom_sunos_ioctl(struct inode * inode, struct file * file,
 		opp->oprom_array[len] = '\0';
 		opp->oprom_size = len;
 
-		error = copyout((void *)arg, opp, sizeof(int) + bufsize);
+		error = copyout(argp, opp, sizeof(int) + bufsize);
 		break;
 
 	case OPROMNXTOPT:
@@ -185,7 +185,7 @@ static int openprom_sunos_ioctl(struct inode * inode, struct file * file,
 
 		len = strlen(buf);
 		if (len == 0 || len + 1 > bufsize) {
-			error = copyout((void *)arg, opp, sizeof(int));
+			error = copyout(argp, opp, sizeof(int));
 			break;
 		}
 
@@ -193,7 +193,7 @@ static int openprom_sunos_ioctl(struct inode * inode, struct file * file,
 		opp->oprom_array[len] = '\0';
 		opp->oprom_size = ++len;
 
-		error = copyout((void *)arg, opp, sizeof(int) + bufsize);
+		error = copyout(argp, opp, sizeof(int) + bufsize);
 		break;
 
 	case OPROMSETOPT:
@@ -228,7 +228,7 @@ static int openprom_sunos_ioctl(struct inode * inode, struct file * file,
 		*((int *)opp->oprom_array) = node;
 		opp->oprom_size = sizeof(int);
 
-		error = copyout((void *)arg, opp, bufsize + sizeof(int));
+		error = copyout(argp, opp, bufsize + sizeof(int));
 		break;
 
 	case OPROMPCI2NODE:
@@ -247,7 +247,7 @@ static int openprom_sunos_ioctl(struct inode * inode, struct file * file,
 				data->current_node = node;
 				*((int *)opp->oprom_array) = node;
 				opp->oprom_size = sizeof(int);
-				error = copyout((void *)arg, opp, bufsize + sizeof(int));
+				error = copyout(argp, opp, bufsize + sizeof(int));
 			}
 #endif
 		}
@@ -259,7 +259,7 @@ static int openprom_sunos_ioctl(struct inode * inode, struct file * file,
 		*((int *)opp->oprom_array) = node;
 		opp->oprom_size = sizeof(int);
 
-		error = copyout((void *)arg, opp, bufsize + sizeof(int));
+		error = copyout(argp, opp, bufsize + sizeof(int));
 		break;
 
 	case OPROMGETBOOTARGS:
@@ -275,7 +275,7 @@ static int openprom_sunos_ioctl(struct inode * inode, struct file * file,
 		strcpy(opp->oprom_array, buf);
 		opp->oprom_size = len;
 
-		error = copyout((void *)arg, opp, bufsize + sizeof(int));
+		error = copyout(argp, opp, bufsize + sizeof(int));
 		break;
 
 	case OPROMU2P:
@@ -318,7 +318,7 @@ static int goodnode(int n, DATA *data)
 }
 
 /* Copy in a whole string from userspace into kernelspace. */
-static int copyin_string(char *user, size_t len, char **ptr)
+static int copyin_string(char __user *user, size_t len, char **ptr)
 {
 	char *tmp;
 
@@ -348,6 +348,7 @@ static int openprom_bsd_ioctl(struct inode * inode, struct file * file,
 			      unsigned int cmd, unsigned long arg)
 {
 	DATA *data = (DATA *) file->private_data;
+	void __user *argp = (void __user *)arg;
 	struct opiocdesc op;
 	int error, node, len;
 	char *str, *tmp;
@@ -356,7 +357,7 @@ static int openprom_bsd_ioctl(struct inode * inode, struct file * file,
 
 	switch (cmd) {
 	case OPIOCGET:
-		if (copy_from_user(&op, (void *)arg, sizeof(op)))
+		if (copy_from_user(&op, argp, sizeof(op)))
 			return -EFAULT;
 
 		if (!goodnode(op.op_nodeid,data))
@@ -378,7 +379,7 @@ static int openprom_bsd_ioctl(struct inode * inode, struct file * file,
 		if (len <= 0) {
 			kfree(str);
 			/* Verified by the above copy_from_user */
-			if (__copy_to_user((void *)arg, &op,
+			if (__copy_to_user(argp, &op,
 				       sizeof(op)))
 				return -EFAULT;
 			return 0;
@@ -394,7 +395,7 @@ static int openprom_bsd_ioctl(struct inode * inode, struct file * file,
 
 		tmp[len] = '\0';
 
-		if (__copy_to_user((void *)arg, &op, sizeof(op)) != 0
+		if (__copy_to_user(argp, &op, sizeof(op)) != 0
 		    || copy_to_user(op.op_buf, tmp, len) != 0)
 			error = -EFAULT;
 
@@ -404,7 +405,7 @@ static int openprom_bsd_ioctl(struct inode * inode, struct file * file,
 		return error;
 
 	case OPIOCNEXTPROP:
-		if (copy_from_user(&op, (void *)arg, sizeof(op)))
+		if (copy_from_user(&op, argp, sizeof(op)))
 			return -EFAULT;
 
 		if (!goodnode(op.op_nodeid,data))
@@ -426,7 +427,7 @@ static int openprom_bsd_ioctl(struct inode * inode, struct file * file,
 			len = op.op_buflen = 0;
 		}
 
-		error = verify_area(VERIFY_WRITE, (void *)arg, sizeof(op));
+		error = verify_area(VERIFY_WRITE, argp, sizeof(op));
 		if (error) {
 			kfree(str);
 			return error;
@@ -438,7 +439,7 @@ static int openprom_bsd_ioctl(struct inode * inode, struct file * file,
 			return error;
 		}
 
-		error = __copy_to_user((void *)arg, &op, sizeof(op));
+		error = __copy_to_user(argp, &op, sizeof(op));
 		if (!error) error = __copy_to_user(op.op_buf, tmp, len);
 
 		kfree(str);
@@ -446,7 +447,7 @@ static int openprom_bsd_ioctl(struct inode * inode, struct file * file,
 		return error;
 
 	case OPIOCSET:
-		if (copy_from_user(&op, (void *)arg, sizeof(op)))
+		if (copy_from_user(&op, argp, sizeof(op)))
 			return -EFAULT;
 
 		if (!goodnode(op.op_nodeid,data))
@@ -473,13 +474,13 @@ static int openprom_bsd_ioctl(struct inode * inode, struct file * file,
 		return 0;
 
 	case OPIOCGETOPTNODE:
-		if (copy_to_user((void *)arg, &options_node, sizeof(int)))
+		if (copy_to_user(argp, &options_node, sizeof(int)))
 			return -EFAULT;
 		return 0;
 
 	case OPIOCGETNEXT:
 	case OPIOCGETCHILD:
-		if (copy_from_user(&node, (void *)arg, sizeof(int)))
+		if (copy_from_user(&node, argp, sizeof(int)))
 			return -EFAULT;
 
 		if (cmd == OPIOCGETNEXT)
@@ -487,7 +488,7 @@ static int openprom_bsd_ioctl(struct inode * inode, struct file * file,
 		else
 			node = __prom_getchild(node);
 
-		if (__copy_to_user((void *)arg, &node, sizeof(int)))
+		if (__copy_to_user(argp, &node, sizeof(int)))
 			return -EFAULT;
 
 		return 0;
diff --git a/drivers/sbus/char/riowatchdog.c b/drivers/sbus/char/riowatchdog.c
index f34c4a9de..7f8e109f9 100644
--- a/drivers/sbus/char/riowatchdog.c
+++ b/drivers/sbus/char/riowatchdog.c
@@ -116,6 +116,7 @@ static void riowd_starttimer(void)
 
 static int riowd_open(struct inode *inode, struct file *filp)
 {
+	nonseekable_open(inode, filp);
 	return 0;
 }
 
@@ -130,18 +131,19 @@ static int riowd_ioctl(struct inode *inode, struct file *filp,
 	static struct watchdog_info info = {
 	       	WDIOF_SETTIMEOUT, 0, "Natl. Semiconductor PC97317"
 	};
+	void __user *argp = (void __user *)arg;
 	unsigned int options;
 	int new_margin;
 
 	switch (cmd) {
 	case WDIOC_GETSUPPORT:
-		if (copy_to_user((struct watchdog_info *) arg, &info, sizeof(info)))
+		if (copy_to_user(argp, &info, sizeof(info)))
 			return -EFAULT;
 		break;
 
 	case WDIOC_GETSTATUS:
 	case WDIOC_GETBOOTSTATUS:
-		if (put_user(0, (int *) arg))
+		if (put_user(0, (int __user *)argp))
 			return -EFAULT;
 		break;
 
@@ -150,7 +152,7 @@ static int riowd_ioctl(struct inode *inode, struct file *filp,
 		break;
 
 	case WDIOC_SETOPTIONS:
-		if (copy_from_user(&options, (void *) arg, sizeof(options)))
+		if (copy_from_user(&options, argp, sizeof(options)))
 			return -EFAULT;
 
 		if (options & WDIOS_DISABLECARD)
@@ -163,7 +165,7 @@ static int riowd_ioctl(struct inode *inode, struct file *filp,
 		break;
 
 	case WDIOC_SETTIMEOUT:
-		if (get_user(new_margin, (int *)arg))
+		if (get_user(new_margin, (int __user *)argp))
 			return -EFAULT;
 		if ((new_margin < 60) || (new_margin > (255 * 60)))
 		    return -EINVAL;
@@ -172,7 +174,7 @@ static int riowd_ioctl(struct inode *inode, struct file *filp,
 		/* Fall */
 
 	case WDIOC_GETTIMEOUT:
-		return put_user(riowd_timeout * 60, (int *)arg);
+		return put_user(riowd_timeout * 60, (int __user *)argp);
 
 	default:
 		return -EINVAL;
@@ -181,11 +183,8 @@ static int riowd_ioctl(struct inode *inode, struct file *filp,
 	return 0;
 }
 
-static ssize_t riowd_write(struct file *file, const char *buf, size_t count, loff_t *ppos)
+static ssize_t riowd_write(struct file *file, const char __user *buf, size_t count, loff_t *ppos)
 {
-	if (ppos != &file->f_pos)
-		return -ESPIPE;
-
 	if (count) {
 		riowd_pingtimer();
 		return 1;
diff --git a/drivers/sbus/char/rtc.c b/drivers/sbus/char/rtc.c
index 2d6f68477..9e7aec753 100644
--- a/drivers/sbus/char/rtc.c
+++ b/drivers/sbus/char/rtc.c
@@ -85,6 +85,7 @@ static int rtc_ioctl(struct inode *inode, struct file *file, unsigned int cmd,
 	unsigned long arg)
 {
 	struct rtc_time rtc_tm;
+	void __user *argp = (void __user *)arg;
 
 	switch (cmd)
 	{
@@ -92,7 +93,7 @@ static int rtc_ioctl(struct inode *inode, struct file *file, unsigned int cmd,
 		memset(&rtc_tm, 0, sizeof(struct rtc_time));
 		get_rtc_time(&rtc_tm);
 
-		if (copy_to_user((struct rtc_time*)arg, &rtc_tm, sizeof(struct rtc_time)))
+		if (copy_to_user(argp, &rtc_tm, sizeof(struct rtc_time)))
 			return -EFAULT;
 
 		return 0;
@@ -102,7 +103,7 @@ static int rtc_ioctl(struct inode *inode, struct file *file, unsigned int cmd,
 		if (!capable(CAP_SYS_TIME))
 			return -EPERM;
 
-		if (copy_from_user(&rtc_tm, (struct rtc_time*)arg, sizeof(struct rtc_time)))
+		if (copy_from_user(&rtc_tm, argp, sizeof(struct rtc_time)))
 			return -EFAULT;
 
 		set_rtc_time(&rtc_tm);
diff --git a/drivers/sbus/char/vfc_dev.c b/drivers/sbus/char/vfc_dev.c
index 87d992820..ad29b496b 100644
--- a/drivers/sbus/char/vfc_dev.c
+++ b/drivers/sbus/char/vfc_dev.c
@@ -226,7 +226,7 @@ static int vfc_release(struct inode *inode,struct file *file)
 	return 0;
 }
 
-static int vfc_debug(struct vfc_dev *dev, int cmd, unsigned long arg) 
+static int vfc_debug(struct vfc_dev *dev, int cmd, void __user *argp)
 {
 	struct vfc_debug_inout inout;
 	unsigned char *buffer;
@@ -236,15 +236,14 @@ static int vfc_debug(struct vfc_dev *dev, int cmd, unsigned long arg)
 
 	switch(cmd) {
 	case VFC_I2C_SEND:
-		if(copy_from_user(&inout, (void *)arg, sizeof(inout)))
+		if(copy_from_user(&inout, argp, sizeof(inout)))
 			return -EFAULT;
 
-		buffer = kmalloc(inout.len*sizeof(char), GFP_KERNEL);
+		buffer = kmalloc(inout.len, GFP_KERNEL);
 		if (buffer == NULL)
 			return -ENOMEM;
 
-		if(copy_from_user(buffer, inout.buffer, 
-				  inout.len*sizeof(char))) {
+		if(copy_from_user(buffer, inout.buffer, inout.len)) {
 			kfree(buffer);
 			return -EFAULT;
 		}
@@ -253,9 +252,9 @@ static int vfc_debug(struct vfc_dev *dev, int cmd, unsigned long arg)
 		vfc_lock_device(dev);
 		inout.ret=
 			vfc_i2c_sendbuf(dev,inout.addr & 0xff,
-					inout.buffer,inout.len);
+					buffer,inout.len);
 
-		if (copy_to_user((void *)arg,&inout,sizeof(inout))) {
+		if (copy_to_user(argp,&inout,sizeof(inout))) {
 			kfree(buffer);
 			return -EFAULT;
 		}
@@ -263,14 +262,14 @@ static int vfc_debug(struct vfc_dev *dev, int cmd, unsigned long arg)
 
 		break;
 	case VFC_I2C_RECV:
-		if (copy_from_user(&inout, (void *)arg, sizeof(inout)))
+		if (copy_from_user(&inout, argp, sizeof(inout)))
 			return -EFAULT;
 
 		buffer = kmalloc(inout.len, GFP_KERNEL);
 		if (buffer == NULL)
 			return -ENOMEM;
 
-		memset(buffer,0,inout.len*sizeof(char));
+		memset(buffer,0,inout.len);
 		vfc_lock_device(dev);
 		inout.ret=
 			vfc_i2c_recvbuf(dev,inout.addr & 0xff
@@ -281,7 +280,7 @@ static int vfc_debug(struct vfc_dev *dev, int cmd, unsigned long arg)
 			kfree(buffer);
 			return -EFAULT;
 		}
-		if (copy_to_user((void *)arg,&inout,sizeof(inout))) {
+		if (copy_to_user(argp,&inout,sizeof(inout))) {
 			kfree(buffer);
 			return -EFAULT;
 		}
@@ -340,7 +339,7 @@ static int vfc_set_control_ioctl(struct inode *inode, struct file *file,
 {
 	int setcmd, ret = 0;
 
-	if (copy_from_user(&setcmd,(void *)arg,sizeof(unsigned int)))
+	if (copy_from_user(&setcmd,(void __user *)arg,sizeof(unsigned int)))
 		return -EFAULT;
 
 	VFC_IOCTL_DEBUG_PRINTK(("vfc%d: IOCTL(VFCSCTRL) arg=0x%x\n",
@@ -398,7 +397,7 @@ int vfc_port_change_ioctl(struct inode *inode, struct file *file,
 	int ret = 0;
 	int cmd;
 
-	if(copy_from_user(&cmd, (void *)arg, sizeof(unsigned int))) {
+	if(copy_from_user(&cmd, (void __user *)arg, sizeof(unsigned int))) {
 		VFC_IOCTL_DEBUG_PRINTK(("vfc%d: User passed bogus pointer to "
 					"vfc_port_change_ioctl\n",
 					dev->instance));
@@ -468,7 +467,7 @@ int vfc_set_video_ioctl(struct inode *inode, struct file *file,
 	int ret = 0;
 	int cmd;
 
-	if(copy_from_user(&cmd, (void *)arg, sizeof(unsigned int))) {
+	if(copy_from_user(&cmd, (void __user *)arg, sizeof(unsigned int))) {
 		VFC_IOCTL_DEBUG_PRINTK(("vfc%d: User passed bogus pointer to "
 					"vfc_set_video_ioctl\n",
 					dev->instance));
@@ -542,7 +541,7 @@ int vfc_get_video_ioctl(struct inode *inode, struct file *file,
 	VFC_IOCTL_DEBUG_PRINTK(("vfc%d: IOCTL(VFCGVID) returning status 0x%x; "
 				"buf[0]=%x\n", dev->instance, status, buf[0]));
 
-	if (copy_to_user((void *)arg,&status,sizeof(unsigned int))) {
+	if (copy_to_user((void __user *)arg,&status,sizeof(unsigned int))) {
 		VFC_IOCTL_DEBUG_PRINTK(("vfc%d: User passed bogus pointer to "
 					"vfc_get_video_ioctl\n",
 					dev->instance));
@@ -557,6 +556,7 @@ static int vfc_ioctl(struct inode *inode, struct file *file, unsigned int cmd,
 	int ret = 0;
 	unsigned int tmp;
 	struct vfc_dev *dev;
+	void __user *argp = (void __user *)arg;
 
 	dev = vfc_get_dev_ptr(iminor(inode));
 	if(dev == NULL)
@@ -568,7 +568,7 @@ static int vfc_ioctl(struct inode *inode, struct file *file, unsigned int cmd,
 		VFC_IOCTL_DEBUG_PRINTK(("vfc%d: IOCTL(VFCGCTRL)\n", dev->instance));
 #endif
 		tmp = sbus_readl(&dev->regs->control);
-		if(copy_to_user((void *)arg, &tmp, sizeof(unsigned int))) {
+		if(copy_to_user(argp, &tmp, sizeof(unsigned int))) {
 			ret = -EFAULT;
 			break;
 		}
@@ -585,7 +585,7 @@ static int vfc_ioctl(struct inode *inode, struct file *file, unsigned int cmd,
 		break;
 	case VFCHUE:
 		VFC_IOCTL_DEBUG_PRINTK(("vfc%d: IOCTL(VFCHUE)\n", dev->instance));
-		if(copy_from_user(&tmp,(void *)arg,sizeof(unsigned int))) {
+		if(copy_from_user(&tmp,argp,sizeof(unsigned int))) {
 			VFC_IOCTL_DEBUG_PRINTK(("vfc%d: User passed bogus pointer "
 						"to IOCTL(VFCHUE)", dev->instance));
 			ret = -EFAULT;
@@ -603,21 +603,19 @@ static int vfc_ioctl(struct inode *inode, struct file *file, unsigned int cmd,
 		VFC_IOCTL_DEBUG_PRINTK(("vfc%d: IOCTL(VFCRDINFO)\n", dev->instance));
 		break;
 	default:
-		ret = vfc_debug(vfc_get_dev_ptr(iminor(inode)),
-				cmd, arg);
+		ret = vfc_debug(vfc_get_dev_ptr(iminor(inode)), cmd, argp);
 		break;
 	};
 
 	return ret;
 }
 
-static int vfc_mmap(struct inode *inode, struct file *file, 
-		    struct vm_area_struct *vma) 
+static int vfc_mmap(struct file *file, struct vm_area_struct *vma) 
 {
 	unsigned int map_size, ret, map_offset;
 	struct vfc_dev *dev;
 	
-	dev = vfc_get_dev_ptr(iminor(inode));
+	dev = vfc_get_dev_ptr(iminor(file->f_dentry->d_inode));
 	if(dev == NULL)
 		return -ENODEV;
 
diff --git a/drivers/sbus/dvma.c b/drivers/sbus/dvma.c
index f15a3016e..c095308db 100644
--- a/drivers/sbus/dvma.c
+++ b/drivers/sbus/dvma.c
@@ -29,7 +29,7 @@ void __init init_one_dvma(struct sbus_dma *dma, int num_dma)
 {
 	printk("dma%d: ", num_dma);
 	
-	dma->next = 0;
+	dma->next = NULL;
 	dma->running = 0;      /* No transfers going on as of yet */
 	dma->allocated = 0;    /* No one has allocated us yet */
 	switch(sbus_readl(dma->regs + DMA_CSR)&DMA_DEVICE_ID) {
@@ -121,7 +121,6 @@ void __init dvma_init(struct sbus_bus *sbus)
 void __init sun4_dvma_init(void)
 {
 	struct sbus_dma *dma;
-	struct sbus_dma *dchain;
 	struct resource r;
 
 	if(sun4_dma_physaddr) {
diff --git a/drivers/sbus/sbus.c b/drivers/sbus/sbus.c
index 87b18e633..c5c0a91b3 100644
--- a/drivers/sbus/sbus.c
+++ b/drivers/sbus/sbus.c
@@ -192,7 +192,7 @@ static void __init sbus_do_child_siblings(int start_node,
 	while((this_node = prom_getsibling(this_node)) != 0) {
 		this_dev->next = kmalloc(sizeof(struct sbus_dev), GFP_ATOMIC);
 		this_dev = this_dev->next;
-		this_dev->next = 0;
+		this_dev->next = NULL;
 		this_dev->parent = parent;
 
 		this_dev->bus = sbus;
@@ -202,7 +202,7 @@ static void __init sbus_do_child_siblings(int start_node,
 			this_dev->child = kmalloc(sizeof(struct sbus_dev),
 						  GFP_ATOMIC);
 			this_dev->child->bus = sbus;
-			this_dev->child->next = 0;
+			this_dev->child->next = NULL;
 			fill_sbus_device(prom_getchild(this_node), this_dev->child);
 			sbus_do_child_siblings(prom_getchild(this_node),
 					       this_dev->child, this_dev, sbus);
@@ -309,6 +309,10 @@ static void __init sbus_fixup_all_regs(struct sbus_dev *first_sdev)
 extern void register_proc_sparc_ioport(void);
 extern void firetruck_init(void);
 
+#ifdef CONFIG_SUN4
+extern void sun4_dvma_init(void);
+#endif
+
 static int __init sbus_init(void)
 {
 	int nd, this_sbus, sbus_devs, topnd, iommund;
@@ -439,7 +443,7 @@ static int __init sbus_init(void)
 						  GFP_ATOMIC);
 			/* Fill it */
 			this_dev->child->bus = sbus;
-			this_dev->child->next = 0;
+			this_dev->child->next = NULL;
 			fill_sbus_device(prom_getchild(sbus_devs),
 					 this_dev->child);
 			sbus_do_child_siblings(prom_getchild(sbus_devs),
@@ -469,7 +473,7 @@ static int __init sbus_init(void)
 							  GFP_ATOMIC);
 				/* Fill it */
 				this_dev->child->bus = sbus;
-				this_dev->child->next = 0;
+				this_dev->child->next = NULL;
 				fill_sbus_device(prom_getchild(sbus_devs),
 						 this_dev->child);
 				sbus_do_child_siblings(prom_getchild(sbus_devs),
diff --git a/drivers/scsi/3w-9xxx.c b/drivers/scsi/3w-9xxx.c
index 9f75c87c3..2bac40c0e 100644
--- a/drivers/scsi/3w-9xxx.c
+++ b/drivers/scsi/3w-9xxx.c
@@ -619,6 +619,7 @@ static int twa_chrdev_ioctl(struct inode *inode, struct file *file, unsigned int
 	u32 current_time_ms;
 	TW_Device_Extension *tw_dev = twa_device_extension_list[iminor(inode)];
 	int retval = TW_IOCTL_ERROR_OS_EFAULT;
+	void __user *argp = (void __user *)arg;
 
 	/* Only let one of these through at a time */
 	if (down_interruptible(&tw_dev->ioctl_sem)) {
@@ -627,7 +628,7 @@ static int twa_chrdev_ioctl(struct inode *inode, struct file *file, unsigned int
 	}
 
 	/* First copy down the driver command */
-	if (copy_from_user(&driver_command, (void *)arg, sizeof(TW_Ioctl_Driver_Command)))
+	if (copy_from_user(&driver_command, argp, sizeof(TW_Ioctl_Driver_Command)))
 		goto out2;
 
 	/* Check data buffer size */
@@ -649,7 +650,7 @@ static int twa_chrdev_ioctl(struct inode *inode, struct file *file, unsigned int
 	tw_ioctl = (TW_Ioctl_Buf_Apache *)cpu_addr;
 
 	/* Now copy down the entire ioctl */
-	if (copy_from_user(tw_ioctl, (void *)arg, driver_command.buffer_length + sizeof(TW_Ioctl_Buf_Apache) - 1))
+	if (copy_from_user(tw_ioctl, argp, driver_command.buffer_length + sizeof(TW_Ioctl_Buf_Apache) - 1))
 		goto out3;
 
 	/* See which ioctl we are doing */
@@ -659,7 +660,7 @@ static int twa_chrdev_ioctl(struct inode *inode, struct file *file, unsigned int
 		twa_get_request_id(tw_dev, &request_id);
 
 		/* Flag internal command */
-		tw_dev->srb[request_id] = 0;
+		tw_dev->srb[request_id] = NULL;
 
 		/* Flag chrdev ioctl */
 		tw_dev->chrdev_request_id = request_id;
@@ -844,7 +845,7 @@ static int twa_chrdev_ioctl(struct inode *inode, struct file *file, unsigned int
 	}
 
 	/* Now copy the entire response to userspace */
-	if (copy_to_user((void *)arg, tw_ioctl, sizeof(TW_Ioctl_Buf_Apache) + driver_command.buffer_length - 1) == 0)
+	if (copy_to_user(argp, tw_ioctl, sizeof(TW_Ioctl_Buf_Apache) + driver_command.buffer_length - 1) == 0)
 		retval = 0;
 out3:
 	/* Now free ioctl buf memory */
diff --git a/drivers/scsi/3w-xxxx.c b/drivers/scsi/3w-xxxx.c
index e7a540d6e..b8731f204 100644
--- a/drivers/scsi/3w-xxxx.c
+++ b/drivers/scsi/3w-xxxx.c
@@ -220,7 +220,7 @@ MODULE_LICENSE("GPL");
 #define __3W_C			/* let 3w-xxxx.h know it is use */
 
 #include "scsi.h"
-#include "hosts.h"
+#include <scsi/scsi_host.h>
 
 #include "3w-xxxx.h"
 
@@ -650,6 +650,7 @@ static int tw_chrdev_ioctl(struct inode *inode, struct file *file, unsigned int
 	TW_Passthru *passthru;
 	TW_Device_Extension *tw_dev = tw_device_extension_list[iminor(inode)];
 	int retval = -EFAULT;
+	void __user *argp = (void __user *)arg;
 
 	dprintk(KERN_WARNING "3w-xxxx: tw_chrdev_ioctl()\n");
 
@@ -658,7 +659,7 @@ static int tw_chrdev_ioctl(struct inode *inode, struct file *file, unsigned int
 		return -EINTR;
 
 	/* First copy down the buffer length */
-	error = copy_from_user(&data_buffer_length, (void *)arg, sizeof(unsigned int));
+	error = copy_from_user(&data_buffer_length, argp, sizeof(unsigned int));
 	if (error)
 		goto out;
 
@@ -681,7 +682,7 @@ static int tw_chrdev_ioctl(struct inode *inode, struct file *file, unsigned int
 	tw_ioctl = (TW_New_Ioctl *)cpu_addr;
 
 	/* Now copy down the entire ioctl */
-	error = copy_from_user(tw_ioctl, (void *)arg, data_buffer_length + sizeof(TW_New_Ioctl) - 1);
+	error = copy_from_user(tw_ioctl, argp, data_buffer_length + sizeof(TW_New_Ioctl) - 1);
 	if (error)
 		goto out2;
 
@@ -788,7 +789,7 @@ static int tw_chrdev_ioctl(struct inode *inode, struct file *file, unsigned int
 	}
 
 	/* Now copy the response to userspace */
-	error = copy_to_user((void *)arg, tw_ioctl, sizeof(TW_New_Ioctl) + data_buffer_length - 1);
+	error = copy_to_user(argp, tw_ioctl, sizeof(TW_New_Ioctl) + data_buffer_length - 1);
 	if (error == 0)
 		retval = 0;
 out2:
diff --git a/drivers/scsi/53c700.c b/drivers/scsi/53c700.c
index f623d8c39..1495f0f8d 100644
--- a/drivers/scsi/53c700.c
+++ b/drivers/scsi/53c700.c
@@ -125,18 +125,21 @@
 #include <linux/sched.h>
 #include <linux/init.h>
 #include <linux/proc_fs.h>
+#include <linux/blkdev.h>
+#include <linux/module.h>
+#include <linux/interrupt.h>
 #include <asm/dma.h>
 #include <asm/system.h>
 #include <asm/io.h>
 #include <asm/pgtable.h>
 #include <asm/byteorder.h>
-#include <linux/blkdev.h>
-#include <linux/module.h>
-#include <linux/interrupt.h>
-
-#include "scsi.h"
-#include "hosts.h"
 
+#include <scsi/scsi.h>
+#include <scsi/scsi_cmnd.h>
+#include <scsi/scsi_dbg.h>
+#include <scsi/scsi_eh.h>
+#include <scsi/scsi_host.h>
+#include <scsi/scsi_tcq.h>
 #include <scsi/scsi_transport.h>
 #include <scsi/scsi_transport_spi.h>
 
@@ -164,15 +167,15 @@ MODULE_LICENSE("GPL");
 #include "53c700_d.h"
 
 
-STATIC int NCR_700_queuecommand(Scsi_Cmnd *, void (*done)(Scsi_Cmnd *));
-STATIC int NCR_700_abort(Scsi_Cmnd * SCpnt);
-STATIC int NCR_700_bus_reset(Scsi_Cmnd * SCpnt);
-STATIC int NCR_700_dev_reset(Scsi_Cmnd * SCpnt);
-STATIC int NCR_700_host_reset(Scsi_Cmnd * SCpnt);
+STATIC int NCR_700_queuecommand(struct scsi_cmnd *, void (*done)(struct scsi_cmnd *));
+STATIC int NCR_700_abort(struct scsi_cmnd * SCpnt);
+STATIC int NCR_700_bus_reset(struct scsi_cmnd * SCpnt);
+STATIC int NCR_700_dev_reset(struct scsi_cmnd * SCpnt);
+STATIC int NCR_700_host_reset(struct scsi_cmnd * SCpnt);
 STATIC void NCR_700_chip_setup(struct Scsi_Host *host);
 STATIC void NCR_700_chip_reset(struct Scsi_Host *host);
-STATIC int NCR_700_slave_configure(Scsi_Device *SDpnt);
-STATIC void NCR_700_slave_destroy(Scsi_Device *SDpnt);
+STATIC int NCR_700_slave_configure(struct scsi_device *SDpnt);
+STATIC void NCR_700_slave_destroy(struct scsi_device *SDpnt);
 
 STATIC struct device_attribute *NCR_700_dev_attrs[];
 
@@ -279,7 +282,7 @@ NCR_700_offset_period_to_sxfer(struct NCR_700_Host_Parameters *hostdata,
 }
 
 static inline __u8
-NCR_700_get_SXFER(Scsi_Device *SDp)
+NCR_700_get_SXFER(struct scsi_device *SDp)
 {
 	struct NCR_700_Host_Parameters *hostdata = 
 		(struct NCR_700_Host_Parameters *)SDp->host->hostdata[0];
@@ -289,7 +292,7 @@ NCR_700_get_SXFER(Scsi_Device *SDp)
 }
 
 struct Scsi_Host *
-NCR_700_detect(Scsi_Host_Template *tpnt,
+NCR_700_detect(struct scsi_host_template *tpnt,
 	       struct NCR_700_Host_Parameters *hostdata)
 {
 	dma_addr_t pScript, pSlots;
@@ -329,7 +332,7 @@ NCR_700_detect(Scsi_Host_Template *tpnt,
 	tpnt->can_queue = NCR_700_COMMAND_SLOTS_PER_HOST;
 	tpnt->sg_tablesize = NCR_700_SG_SEGMENTS;
 	tpnt->cmd_per_lun = NCR_700_CMD_PER_LUN;
-	tpnt->use_clustering = DISABLE_CLUSTERING;
+	tpnt->use_clustering = ENABLE_CLUSTERING;
 	tpnt->slave_configure = NCR_700_slave_configure;
 	tpnt->slave_destroy = NCR_700_slave_destroy;
 	
@@ -561,7 +564,7 @@ free_slot(struct NCR_700_command_slot *slot,
    the ITL and (if tagged) the ITLQ lists in _queuecommand */
 STATIC void
 save_for_reselection(struct NCR_700_Host_Parameters *hostdata,
-		     Scsi_Cmnd *SCp, __u32 dsp)
+		     struct scsi_cmnd *SCp, __u32 dsp)
 {
 	/* Its just possible that this gets executed twice */
 	if(SCp != NULL) {
@@ -575,27 +578,25 @@ save_for_reselection(struct NCR_700_Host_Parameters *hostdata,
 }
 
 STATIC inline void
-NCR_700_unmap(struct NCR_700_Host_Parameters *hostdata, Scsi_Cmnd *SCp,
+NCR_700_unmap(struct NCR_700_Host_Parameters *hostdata, struct scsi_cmnd *SCp,
 	      struct NCR_700_command_slot *slot)
 {
-	if(SCp->sc_data_direction != SCSI_DATA_NONE &&
-	   SCp->sc_data_direction != SCSI_DATA_UNKNOWN) {
-		enum dma_data_direction direction = SCp->sc_data_direction;
+	if(SCp->sc_data_direction != DMA_NONE &&
+	   SCp->sc_data_direction != DMA_BIDIRECTIONAL) {
 		if(SCp->use_sg) {
 			dma_unmap_sg(hostdata->dev, SCp->buffer,
-				     SCp->use_sg, direction);
+				     SCp->use_sg, SCp->sc_data_direction);
 		} else {
-			dma_unmap_single(hostdata->dev,
-					 slot->dma_handle,
+			dma_unmap_single(hostdata->dev, slot->dma_handle,
 					 SCp->request_bufflen,
-					 direction);
+					 SCp->sc_data_direction);
 		}
 	}
 }
 
 STATIC inline void
 NCR_700_scsi_done(struct NCR_700_Host_Parameters *hostdata,
-	       Scsi_Cmnd *SCp, int result)
+	       struct scsi_cmnd *SCp, int result)
 {
 	hostdata->state = NCR_700_HOST_FREE;
 	hostdata->cmd = NULL;
@@ -611,7 +612,7 @@ NCR_700_scsi_done(struct NCR_700_Host_Parameters *hostdata,
 #ifdef NCR_700_DEBUG
 			printk(" ORIGINAL CMD %p RETURNED %d, new return is %d sense is\n",
 			       SCp, SCp->cmnd[7], result);
-			print_sense("53c700", SCp);
+			scsi_print_sense("53c700", SCp);
 
 #endif
 			/* restore the old result if the request sense was
@@ -780,7 +781,7 @@ NCR_700_chip_reset(struct Scsi_Host *host)
 STATIC __u32
 process_extended_message(struct Scsi_Host *host, 
 			 struct NCR_700_Host_Parameters *hostdata,
-			 Scsi_Cmnd *SCp, __u32 dsp, __u32 dsps)
+			 struct scsi_cmnd *SCp, __u32 dsp, __u32 dsps)
 {
 	__u32 resume_offset = dsp, temp = dsp + 8;
 	__u8 pun = 0xff, lun = 0xff;
@@ -849,7 +850,7 @@ process_extended_message(struct Scsi_Host *host,
 		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);
+		scsi_print_msg(hostdata->msgin);
 		printk("\n");
 		/* just reject it */
 		hostdata->msgout[0] = A_REJECT_MSG;
@@ -865,7 +866,7 @@ process_extended_message(struct Scsi_Host *host,
 
 STATIC __u32
 process_message(struct Scsi_Host *host,	struct NCR_700_Host_Parameters *hostdata,
-		Scsi_Cmnd *SCp, __u32 dsp, __u32 dsps)
+		struct scsi_cmnd *SCp, __u32 dsp, __u32 dsps)
 {
 	/* work out where to return to */
 	__u32 temp = dsp + 8, resume_offset = dsp;
@@ -879,7 +880,7 @@ process_message(struct Scsi_Host *host,	struct NCR_700_Host_Parameters *hostdata
 #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);
+	scsi_print_msg(hostdata->msgin);
 	printk("\n");
 #endif
 
@@ -927,7 +928,7 @@ process_message(struct Scsi_Host *host,	struct NCR_700_Host_Parameters *hostdata
 		       host->host_no, pun, lun,
 		       NCR_700_phase[(dsps & 0xf00) >> 8]);
 
-		print_msg(hostdata->msgin);
+		scsi_print_msg(hostdata->msgin);
 		printk("\n");
 		/* just reject it */
 		hostdata->msgout[0] = A_REJECT_MSG;
@@ -946,7 +947,7 @@ process_message(struct Scsi_Host *host,	struct NCR_700_Host_Parameters *hostdata
 }
 
 STATIC __u32
-process_script_interrupt(__u32 dsps, __u32 dsp, Scsi_Cmnd *SCp,
+process_script_interrupt(__u32 dsps, __u32 dsp, struct scsi_cmnd *SCp,
 			 struct Scsi_Host *host,
 			 struct NCR_700_Host_Parameters *hostdata)
 {
@@ -975,7 +976,7 @@ process_script_interrupt(__u32 dsps, __u32 dsp, Scsi_Cmnd *SCp,
 				NCR_700_scsi_done(hostdata, SCp, hostdata->status[0]);
 			} else {
 #ifdef NCR_DEBUG
-				print_command(SCp->cmnd);
+				scsi_print_command(SCp);
 				printk("  cmd %p has status %d, requesting sense\n",
 				       SCp, hostdata->status[0]);
 #endif
@@ -1004,7 +1005,7 @@ process_script_interrupt(__u32 dsps, __u32 dsp, Scsi_Cmnd *SCp,
 				SCp->cmnd[6] = NCR_700_INTERNAL_SENSE_MAGIC;
 				SCp->cmnd[7] = hostdata->status[0];
 				SCp->use_sg = 0;
-				SCp->sc_data_direction = SCSI_DATA_READ;
+				SCp->sc_data_direction = DMA_FROM_DEVICE;
 				dma_sync_single_for_device(hostdata->dev, slot->pCmd,
 							   SCp->cmd_len, DMA_TO_DEVICE);
 				SCp->request_bufflen = sizeof(SCp->sense_buffer);
@@ -1053,7 +1054,7 @@ process_script_interrupt(__u32 dsps, __u32 dsp, Scsi_Cmnd *SCp,
 		       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);
+		scsi_print_command(SCp);
 
 		NCR_700_internal_bus_reset(host);
 	} else if((dsps & 0xfffff000) == A_FATAL) {
@@ -1080,7 +1081,7 @@ process_script_interrupt(__u32 dsps, __u32 dsp, Scsi_Cmnd *SCp,
 		__u8 lun;
 		struct NCR_700_command_slot *slot;
 		__u8 reselection_id = hostdata->reselection_id;
-		Scsi_Device *SDp;
+		struct scsi_device *SDp;
 
 		lun = hostdata->msgin[0] & 0x1f;
 
@@ -1095,7 +1096,7 @@ process_script_interrupt(__u32 dsps, __u32 dsp, Scsi_Cmnd *SCp,
 			BUG();
 		}
 		if(hostdata->msgin[1] == A_SIMPLE_TAG_MSG) {
-			Scsi_Cmnd *SCp = scsi_find_tag(SDp, hostdata->msgin[2]);
+			struct scsi_cmnd *SCp = scsi_find_tag(SDp, hostdata->msgin[2]);
 			if(unlikely(SCp == NULL)) {
 				printk(KERN_ERR "scsi%d: (%d:%d) no saved request for tag %d\n", 
 				       host->host_no, reselection_id, lun, hostdata->msgin[2]);
@@ -1107,7 +1108,7 @@ process_script_interrupt(__u32 dsps, __u32 dsp, Scsi_Cmnd *SCp,
 			       host->host_no, SDp->id, SDp->lun,
 			       hostdata->msgin[2], slot, slot->tag));
 		} else {
-			Scsi_Cmnd *SCp = scsi_find_tag(SDp, SCSI_NO_TAG);
+			struct scsi_cmnd *SCp = scsi_find_tag(SDp, SCSI_NO_TAG);
 			if(unlikely(SCp == NULL)) {
 				printk(KERN_ERR "scsi%d: (%d:%d) no saved request for untagged cmd\n", 
 				       host->host_no, reselection_id, lun);
@@ -1234,7 +1235,7 @@ process_script_interrupt(__u32 dsps, __u32 dsp, Scsi_Cmnd *SCp,
 		       host->host_no, pun, lun, NCR_700_condition[i],
 		       NCR_700_phase[j], dsp - hostdata->pScript);
 		if(SCp != NULL) {
-			print_command(SCp->cmnd);
+			scsi_print_command(SCp);
 
 			if(SCp->use_sg) {
 				for(i = 0; i < SCp->use_sg + 1; i++) {
@@ -1270,7 +1271,7 @@ process_selection(struct Scsi_Host *host, __u32 dsp)
 	__u32 resume_offset = 0;
 	struct NCR_700_Host_Parameters *hostdata =
 		(struct NCR_700_Host_Parameters *)host->hostdata[0];
-	Scsi_Cmnd *SCp = hostdata->cmd;
+	struct scsi_cmnd *SCp = hostdata->cmd;
 	__u8 sbcl;
 
 	for(count = 0; count < 5; count++) {
@@ -1373,7 +1374,7 @@ NCR_700_flush_fifo(struct Scsi_Host *host) {
 /* The queue lock with interrupts disabled must be held on entry to
  * this function */
 STATIC int
-NCR_700_start_command(Scsi_Cmnd *SCp)
+NCR_700_start_command(struct scsi_cmnd *SCp)
 {
 	struct NCR_700_command_slot *slot =
 		(struct NCR_700_command_slot *)SCp->host_scribble;
@@ -1481,7 +1482,7 @@ NCR_700_intr(int irq, void *dev_id, struct pt_regs *regs)
 		__u32 dsps;
 		__u8 sstat0 = 0, dstat = 0;
 		__u32 dsp;
-		Scsi_Cmnd *SCp = hostdata->cmd;
+		struct scsi_cmnd *SCp = hostdata->cmd;
 		enum NCR_700_Host_State state;
 
 		handled = 1;
@@ -1514,7 +1515,7 @@ NCR_700_intr(int irq, void *dev_id, struct pt_regs *regs)
 		}
 
 		if(sstat0 & SCSI_RESET_DETECTED) {
-			Scsi_Device *SDp;
+			struct scsi_device *SDp;
 			int i;
 
 			hostdata->state = NCR_700_HOST_BUSY;
@@ -1526,11 +1527,11 @@ NCR_700_intr(int irq, void *dev_id, struct pt_regs *regs)
 
 			/* clear all the negotiated parameters */
 			__shost_for_each_device(SDp, host)
-				SDp->hostdata = 0;
+				SDp->hostdata = NULL;
 			
 			/* clear all the slots and their pending commands */
 			for(i = 0; i < NCR_700_COMMAND_SLOTS_PER_HOST; i++) {
-				Scsi_Cmnd *SCp;
+				struct scsi_cmnd *SCp;
 				struct NCR_700_command_slot *slot =
 					&hostdata->slots[i];
 
@@ -1590,7 +1591,7 @@ NCR_700_intr(int irq, void *dev_id, struct pt_regs *regs)
 				printk("scsi%d: (%d:%d) Expected phase mismatch in slot->SG[%d], transferred 0x%x\n",
 				       host->host_no, pun, lun,
 				       SGcount, data_transfer);
-				print_command(SCp->cmnd);
+				scsi_print_command(SCp);
 				if(residual) {
 					printk("scsi%d: (%d:%d) Expected phase mismatch in slot->SG[%d], transferred 0x%x, residual %d\n",
 				       host->host_no, pun, lun,
@@ -1731,7 +1732,7 @@ NCR_700_intr(int irq, void *dev_id, struct pt_regs *regs)
 }
 
 STATIC int
-NCR_700_queuecommand(Scsi_Cmnd *SCp, void (*done)(Scsi_Cmnd *))
+NCR_700_queuecommand(struct scsi_cmnd *SCp, void (*done)(struct scsi_cmnd *))
 {
 	struct NCR_700_Host_Parameters *hostdata = 
 		(struct NCR_700_Host_Parameters *)SCp->device->host->hostdata[0];
@@ -1781,7 +1782,7 @@ NCR_700_queuecommand(Scsi_Cmnd *SCp, void (*done)(Scsi_Cmnd *))
 
 #ifdef NCR_700_DEBUG
 	printk("53c700: scsi%d, command ", SCp->device->host->host_no);
-	print_command(SCp->cmnd);
+	scsi_print_command(SCp);
 #endif
 	if(SCp->device->tagged_supported && !SCp->device->simple_tags
 	   && (hostdata->tag_negotiated &(1<<SCp->device->id)) == 0
@@ -1827,13 +1828,13 @@ NCR_700_queuecommand(Scsi_Cmnd *SCp, void (*done)(Scsi_Cmnd *))
 	/* sanity check: some of the commands generated by the mid-layer
 	 * have an eccentric idea of their sc_data_direction */
 	if(!SCp->use_sg && !SCp->request_bufflen 
-	   && SCp->sc_data_direction != SCSI_DATA_NONE) {
+	   && SCp->sc_data_direction != DMA_NONE) {
 #ifdef NCR_700_DEBUG
 		printk("53c700: Command");
-		print_command(SCp->cmnd);
+		scsi_print_command(SCp);
 		printk("Has wrong data direction %d\n", SCp->sc_data_direction);
 #endif
-		SCp->sc_data_direction = SCSI_DATA_NONE;
+		SCp->sc_data_direction = DMA_NONE;
 	}
 
 	switch (SCp->cmnd[0]) {
@@ -1844,20 +1845,20 @@ NCR_700_queuecommand(Scsi_Cmnd *SCp, void (*done)(Scsi_Cmnd *))
 	default:
 		/* OK, get it from the command */
 		switch(SCp->sc_data_direction) {
-		case SCSI_DATA_UNKNOWN:
+		case DMA_BIDIRECTIONAL:
 		default:
 			printk(KERN_ERR "53c700: Unknown command for data direction ");
-			print_command(SCp->cmnd);
+			scsi_print_command(SCp);
 			
 			move_ins = 0;
 			break;
-		case SCSI_DATA_NONE:
+		case DMA_NONE:
 			move_ins = 0;
 			break;
-		case SCSI_DATA_READ:
+		case DMA_FROM_DEVICE:
 			move_ins = SCRIPT_MOVE_DATA_IN;
 			break;
-		case SCSI_DATA_WRITE:
+		case DMA_TO_DEVICE:
 			move_ins = SCRIPT_MOVE_DATA_OUT;
 			break;
 		}
@@ -1914,13 +1915,13 @@ NCR_700_queuecommand(Scsi_Cmnd *SCp, void (*done)(Scsi_Cmnd *))
 }
 
 STATIC int
-NCR_700_abort(Scsi_Cmnd * SCp)
+NCR_700_abort(struct scsi_cmnd * SCp)
 {
 	struct NCR_700_command_slot *slot;
 
 	printk(KERN_INFO "scsi%d (%d:%d) New error handler wants to abort command\n\t",
 	       SCp->device->host->host_no, SCp->device->id, SCp->device->lun);
-	print_command(SCp->cmnd);
+	scsi_print_command(SCp);
 
 	slot = (struct NCR_700_command_slot *)SCp->host_scribble;
 
@@ -1946,7 +1947,7 @@ NCR_700_abort(Scsi_Cmnd * SCp)
 }
 
 STATIC int
-NCR_700_bus_reset(Scsi_Cmnd * SCp)
+NCR_700_bus_reset(struct scsi_cmnd * SCp)
 {
 	DECLARE_COMPLETION(complete);
 	struct NCR_700_Host_Parameters *hostdata = 
@@ -1954,7 +1955,7 @@ 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->device->host->host_no, SCp->device->id, SCp->device->lun, SCp);
-	print_command(SCp->cmnd);
+	scsi_print_command(SCp);
 	/* In theory, eh_complete should always be null because the
 	 * eh is single threaded, but just in case we're handling a
 	 * reset via sg or something */
@@ -1976,21 +1977,21 @@ NCR_700_bus_reset(Scsi_Cmnd * SCp)
 }
 
 STATIC int
-NCR_700_dev_reset(Scsi_Cmnd * SCp)
+NCR_700_dev_reset(struct scsi_cmnd * SCp)
 {
 	printk(KERN_INFO "scsi%d (%d:%d) New error handler wants device reset\n\t",
 	       SCp->device->host->host_no, SCp->device->id, SCp->device->lun);
-	print_command(SCp->cmnd);
+	scsi_print_command(SCp);
 	
 	return FAILED;
 }
 
 STATIC int
-NCR_700_host_reset(Scsi_Cmnd * SCp)
+NCR_700_host_reset(struct scsi_cmnd * SCp)
 {
 	printk(KERN_INFO "scsi%d (%d:%d) New error handler wants HOST reset\n\t",
 	       SCp->device->host->host_no, SCp->device->id, SCp->device->lun);
-	print_command(SCp->cmnd);
+	scsi_print_command(SCp);
 
 	NCR_700_internal_bus_reset(SCp->device->host);
 	NCR_700_chip_reset(SCp->device->host);
@@ -2043,7 +2044,7 @@ NCR_700_set_offset(struct scsi_device *SDp, int offset)
 
 
 STATIC int
-NCR_700_slave_configure(Scsi_Device *SDp)
+NCR_700_slave_configure(struct scsi_device *SDp)
 {
 	struct NCR_700_Host_Parameters *hostdata = 
 		(struct NCR_700_Host_Parameters *)SDp->host->hostdata[0];
@@ -2066,7 +2067,7 @@ NCR_700_slave_configure(Scsi_Device *SDp)
 }
 
 STATIC void
-NCR_700_slave_destroy(Scsi_Device *SDp)
+NCR_700_slave_destroy(struct scsi_device *SDp)
 {
 	/* to do here: deallocate memory */
 }
diff --git a/drivers/scsi/53c700.h b/drivers/scsi/53c700.h
index c1f0aa3c5..b357a4aeb 100644
--- a/drivers/scsi/53c700.h
+++ b/drivers/scsi/53c700.h
@@ -9,9 +9,11 @@
 #define _53C700_H
 
 #include <linux/interrupt.h>
-
 #include <asm/io.h>
 
+#include <scsi/scsi_device.h>
+
+
 #if defined(CONFIG_53C700_MEM_MAPPED) && defined(CONFIG_53C700_IO_MAPPED)
 #define CONFIG_53C700_BOTH_MAPPED
 #endif
@@ -57,7 +59,8 @@
 struct NCR_700_Host_Parameters;
 
 /* These are the externally used routines */
-struct Scsi_Host *NCR_700_detect(Scsi_Host_Template *, struct NCR_700_Host_Parameters *);
+struct Scsi_Host *NCR_700_detect(struct scsi_host_template *,
+		struct NCR_700_Host_Parameters *);
 int NCR_700_release(struct Scsi_Host *host);
 irqreturn_t NCR_700_intr(int, void *, struct pt_regs *);
 
@@ -102,7 +105,7 @@ struct NCR_700_SG_List {
 #define NCR_700_DEV_PRINT_SYNC_NEGOTIATION (1<<19)
 
 static inline void
-NCR_700_set_depth(Scsi_Device *SDp, __u8 depth)
+NCR_700_set_depth(struct scsi_device *SDp, __u8 depth)
 {
 	long l = (long)SDp->hostdata;
 
@@ -111,27 +114,27 @@ NCR_700_set_depth(Scsi_Device *SDp, __u8 depth)
 	SDp->hostdata = (void *)l;
 }
 static inline __u8
-NCR_700_get_depth(Scsi_Device *SDp)
+NCR_700_get_depth(struct scsi_device *SDp)
 {
 	return ((((unsigned long)SDp->hostdata) & 0xff00)>>8);
 }
 static inline int
-NCR_700_is_flag_set(Scsi_Device *SDp, __u32 flag)
+NCR_700_is_flag_set(struct scsi_device *SDp, __u32 flag)
 {
 	return (((unsigned long)SDp->hostdata) & flag) == flag;
 }
 static inline int
-NCR_700_is_flag_clear(Scsi_Device *SDp, __u32 flag)
+NCR_700_is_flag_clear(struct scsi_device *SDp, __u32 flag)
 {
 	return (((unsigned long)SDp->hostdata) & flag) == 0;
 }
 static inline void
-NCR_700_set_flag(Scsi_Device *SDp, __u32 flag)
+NCR_700_set_flag(struct scsi_device *SDp, __u32 flag)
 {
 	SDp->hostdata = (void *)((long)SDp->hostdata | (flag & 0xffff0000));
 }
 static inline void
-NCR_700_clear_flag(Scsi_Device *SDp, __u32 flag)
+NCR_700_clear_flag(struct scsi_device *SDp, __u32 flag)
 {
 	SDp->hostdata = (void *)((long)SDp->hostdata & ~(flag & 0xffff0000));
 }
@@ -147,7 +150,7 @@ struct NCR_700_command_slot {
 	__u8	state;
 	int	tag;
 	__u32	resume_offset;
-	Scsi_Cmnd	*cmnd;
+	struct scsi_cmnd *cmnd;
 	/* The pci_mapped address of the actual command in cmnd */
 	dma_addr_t	pCmd;
 	__u32		temp;
@@ -185,7 +188,7 @@ struct NCR_700_Host_Parameters {
 	__u32	pScript;		/* physical mem addr of script */
 
 	enum NCR_700_Host_State state; /* protected by state lock */
-	Scsi_Cmnd *cmd;
+	struct scsi_cmnd *cmd;
 	/* Note: pScript contains the single consistent block of
 	 * memory.  All the msgin, msgout and status are allocated in
 	 * this memory too (at separate cache lines).  TOTAL_MEM_SIZE
diff --git a/drivers/scsi/53c7xx.c b/drivers/scsi/53c7xx.c
index 464c26111..8ead55f75 100644
--- a/drivers/scsi/53c7xx.c
+++ b/drivers/scsi/53c7xx.c
@@ -280,7 +280,7 @@
 #endif
 
 #include "scsi.h"
-#include "hosts.h"
+#include <scsi/scsi_host.h>
 #include "53c7xx.h"
 #include <linux/stat.h>
 #include <linux/stddef.h>
diff --git a/drivers/scsi/BusLogic.c b/drivers/scsi/BusLogic.c
index 59cded0a0..e4d60d1d1 100644
--- a/drivers/scsi/BusLogic.c
+++ b/drivers/scsi/BusLogic.c
@@ -48,7 +48,7 @@
 #include <asm/system.h>
 
 #include "scsi.h"
-#include "hosts.h"
+#include <scsi/scsi_host.h>
 #include "BusLogic.h"
 #include "FlashPoint.c"
 
diff --git a/drivers/scsi/Kconfig b/drivers/scsi/Kconfig
index 4390af7a1..711865972 100644
--- a/drivers/scsi/Kconfig
+++ b/drivers/scsi/Kconfig
@@ -227,7 +227,7 @@ config SCSI_DECSII
 	depends on DECSTATION && SCSI
 
 config BLK_DEV_3W_XXXX_RAID
-	tristate "3ware Hardware ATA-RAID support"
+	tristate "3ware 5/6/7/8xxx ATA-RAID support"
 	depends on PCI && SCSI
 	help
 	  3ware is the only hardware ATA-Raid product in Linux to date.
@@ -239,6 +239,17 @@ config BLK_DEV_3W_XXXX_RAID
 	  Please read the comments at the top of
 	  <file:drivers/scsi/3w-xxxx.c>.
 
+config SCSI_3W_9XXX
+	tristate "3ware 9xxx SATA-RAID support"
+	depends on PCI && SCSI
+	help
+	  This driver supports the 9000 series 3ware SATA-RAID cards.
+
+	  <http://www.amcc.com>
+
+	  Please read the comments at the top of
+	  <file:drivers/scsi/3w-9xxx.c>.
+
 config SCSI_7000FASST
 	tristate "7000FASST SCSI support"
 	depends on ISA && SCSI
@@ -363,7 +374,7 @@ config SCSI_DPT_I2O
 
 config SCSI_ADVANSYS
 	tristate "AdvanSys SCSI support"
-	depends on (ISA || EISA || PCI) && SCSI
+	depends on (ISA || EISA || PCI) && SCSI && BROKEN
 	help
 	  This is a driver for all SCSI host adapters manufactured by
 	  AdvanSys. It is documented in the kernel source in
@@ -422,6 +433,14 @@ config SCSI_ATA_PIIX
 
 	  If unsure, say N.
 
+config SCSI_SATA_NV
+	tristate "NVIDIA SATA support"
+	depends on SCSI_SATA && PCI && EXPERIMENTAL
+	help
+	  This option enables support for NVIDIA Serial ATA.
+
+	  If unsure, say N.
+
 config SCSI_SATA_PROMISE
 	tristate "Promise SATA TX2/TX4 support"
 	depends on SCSI_SATA && PCI
@@ -472,15 +491,13 @@ config SCSI_SATA_VITESSE
 
 config SCSI_BUSLOGIC
 	tristate "BusLogic SCSI support"
-	depends on (PCI || ISA || MCA) && SCSI
+	depends on (PCI || ISA || MCA) && SCSI && (BROKEN || !SPARC64)
 	---help---
 	  This is support for BusLogic MultiMaster and FlashPoint SCSI Host
 	  Adapters. Consult the SCSI-HOWTO, available from
 	  <http://www.tldp.org/docs.html#howto>, and the files
 	  <file:Documentation/scsi/BusLogic.txt> and
-	  <file:Documentation/scsi/FlashPoint.txt> for more information. If this
-	  driver does not work correctly without modification, please contact
-	  the author, Leonard N. Zubkoff, by email to lnz@dandelion.com.
+	  <file:Documentation/scsi/FlashPoint.txt> for more information.
 
 	  To compile this driver as a module, choose M here: the
 	  module will be called BusLogic.
@@ -530,7 +547,7 @@ config SCSI_DTC3280
 
 config SCSI_EATA
 	tristate "EATA ISA/EISA/PCI (DPT and generic EATA/DMA-compliant boards) support"
-	depends on (ISA || EISA || PCI) && SCSI
+	depends on (ISA || EISA || PCI) && SCSI && (BROKEN || !SPARC64)
 	---help---
 	  This driver supports all EATA/DMA-compliant SCSI host adapters.  DPT
 	  ISA and all EISA I/O addresses are probed looking for the "EATA"
@@ -611,7 +628,7 @@ config SCSI_FUTURE_DOMAIN
 
 config SCSI_FD_MCS
 	tristate "Future Domain MCS-600/700 SCSI support"
-	depends on MCA && SCSI
+	depends on MCA_LEGACY && SCSI
 	---help---
 	  This is support for Future Domain MCS 600/700 MCA SCSI adapters.
 	  Some PS/2 computers are equipped with IBM Fast SCSI Adapter/A which
@@ -624,7 +641,7 @@ config SCSI_FD_MCS
 
 config SCSI_GDTH
 	tristate "Intel/ICP (former GDT SCSI Disk Array) RAID Controller support"
-	depends on (ISA || EISA || PCI) && SCSI
+	depends on (ISA || EISA || PCI) && SCSI && (BROKEN || !SPARC64)
 	---help---
 	  Formerly called GDT SCSI Disk Array Controller Support.
 
@@ -682,7 +699,7 @@ config SCSI_GENERIC_NCR53C400
 
 config SCSI_IBMMCA
 	tristate "IBMMCA SCSI support"
-	depends on MCA && SCSI
+	depends on MCA_LEGACY && SCSI
 	---help---
 	  This is support for the IBM SCSI adapter found in many of the PS/2
 	  series computers.  These machines have an MCA bus, so you need to
@@ -1716,23 +1733,12 @@ config SCSI_SUNESP
 	  To compile this driver as a module, choose M here: the
 	  module will be called esp.
 
-config SCSI_PC980155
-	tristate "NEC PC-9801-55 SCSI support"
-	depends on X86_PC9800 && SCSI
-	help
-	  If you have the NEC PC-9801-55 SCSI interface card or compatibles
-	  for NEC PC-9801/PC-9821, say Y.
-
-config WD33C93_PIO
-	bool
-	depends on SCSI_PC980155
-	default y
-
 #      bool 'Cyberstorm Mk III SCSI support (EXPERIMENTAL)' CONFIG_CYBERSTORMIII_SCSI
 
 config ZFCP
 	tristate "FCP host bus adapter driver for IBM eServer zSeries"
 	depends on ARCH_S390 && SCSI
+	select SCSI_FC_ATTRS
 	help
           If you want to access SCSI devices attached to your IBM eServer
           zSeries by means of Fibre Channel interfaces say Y.
diff --git a/drivers/scsi/Makefile b/drivers/scsi/Makefile
index 73e462e5d..7aebabba4 100644
--- a/drivers/scsi/Makefile
+++ b/drivers/scsi/Makefile
@@ -34,7 +34,6 @@ obj-$(CONFIG_SCSI_AMIGA7XX)	+= amiga7xx.o	53c7xx.o
 obj-$(CONFIG_A3000_SCSI)	+= a3000.o	wd33c93.o
 obj-$(CONFIG_A2091_SCSI)	+= a2091.o	wd33c93.o
 obj-$(CONFIG_GVP11_SCSI)	+= gvp11.o	wd33c93.o
-obj-$(CONFIG_SCSI_PC980155)	+= pc980155.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
@@ -109,6 +108,7 @@ obj-$(CONFIG_SCSI_MAC53C94)	+= mac53c94.o
 obj-$(CONFIG_SCSI_PLUTO)	+= pluto.o
 obj-$(CONFIG_SCSI_DECNCR)	+= NCR53C9x.o	dec_esp.o
 obj-$(CONFIG_BLK_DEV_3W_XXXX_RAID) += 3w-xxxx.o
+obj-$(CONFIG_SCSI_3W_9XXX)	+= 3w-9xxx.o
 obj-$(CONFIG_SCSI_PPA)		+= ppa.o
 obj-$(CONFIG_SCSI_IMM)		+= imm.o
 obj-$(CONFIG_JAZZ_ESP)		+= NCR53C9x.o	jazz_esp.o
@@ -127,6 +127,7 @@ obj-$(CONFIG_SCSI_SATA_VIA)	+= libata.o sata_via.o
 obj-$(CONFIG_SCSI_SATA_VITESSE)	+= libata.o sata_vsc.o
 obj-$(CONFIG_SCSI_SATA_SIS)	+= libata.o sata_sis.o
 obj-$(CONFIG_SCSI_SATA_SX4)	+= libata.o sata_sx4.o
+obj-$(CONFIG_SCSI_SATA_NV)	+= libata.o sata_nv.o
 
 obj-$(CONFIG_ARM)		+= arm/
 
@@ -142,20 +143,14 @@ scsi_mod-y			+= scsi.o hosts.o scsi_ioctl.o constants.o \
 				   scsi_devinfo.o
 scsi_mod-$(CONFIG_SYSCTL)	+= scsi_sysctl.o
 scsi_mod-$(CONFIG_SCSI_PROC_FS)	+= scsi_proc.o
-scsi_mod-$(CONFIG_X86_PC9800)	+= scsi_pc98.o
 
 sd_mod-objs	:= sd.o
 sr_mod-objs	:= sr.o sr_ioctl.o sr_vendor.o
 initio-objs	:= ini9100u.o i91uscsi.o
 a100u2w-objs	:= inia100.o i60uscsi.o
 ncr53c8xx-flags-$(CONFIG_SCSI_ZALON) \
-		:= -DCONFIG_NCR53C8XX_PREFETCH \
-			-DCONFIG_SCSI_NCR53C8XX_NO_WORD_TRANSFERS \
-			-DCONFIG_SCSI_NCR53C8XX_NO_NVRAM \
-			-DSCSI_NCR_BIG_ENDIAN -DSIMULATED_INTFLY
-ncr53c8xx-flags-$(CONFIG_SCSI_NCR_Q720) \
-		:= -DCONFIG_SCSI_NCR53C8XX_NO_NVRAM \
-			-DSIMULATED_INTFLY
+		:= -DCONFIG_NCR53C8XX_PREFETCH -DSCSI_NCR_BIG_ENDIAN \
+			-DCONFIG_SCSI_NCR53C8XX_NO_WORD_TRANSFERS
 CFLAGS_ncr53c8xx.o	:= $(ncr53c8xx-flags-y) $(ncr53c8xx-flags-m)
 zalon7xx-objs	:= zalon.o ncr53c8xx.o
 NCR_Q720_mod-objs	:= NCR_Q720.o ncr53c8xx.o
diff --git a/drivers/scsi/NCR5380.c b/drivers/scsi/NCR5380.c
index 612d82818..e3bb9dde6 100644
--- a/drivers/scsi/NCR5380.c
+++ b/drivers/scsi/NCR5380.c
@@ -1248,7 +1248,7 @@ static void NCR5380_main(void *p)
 					 * and see if we can do an information transfer,
 					 * with failures we will restart.
 					 */
-					hostdata->selecting = 0;	
+					hostdata->selecting = NULL;
 					/* RvC: have to preset this to indicate a new command is being performed */
 
 					if (!NCR5380_select(instance, tmp,
@@ -1634,7 +1634,7 @@ part2:
 				   to go to sleep */
 	}
 
-	hostdata->selecting = 0;	/* clear this pointer, because we passed the
+	hostdata->selecting = NULL;/* clear this pointer, because we passed the
 					   waiting period */
 	if ((NCR5380_read(STATUS_REG) & (SR_SEL | SR_IO)) == (SR_SEL | SR_IO)) {
 		NCR5380_write(INITIATOR_COMMAND_REG, ICR_BASE);
diff --git a/drivers/scsi/NCR53C9x.c b/drivers/scsi/NCR53C9x.c
index 22ee2db60..9f70a7b0b 100644
--- a/drivers/scsi/NCR53C9x.c
+++ b/drivers/scsi/NCR53C9x.c
@@ -36,7 +36,7 @@
 #include <linux/init.h>
 
 #include "scsi.h"
-#include "hosts.h"
+#include <scsi/scsi_host.h>
 #include "NCR53C9x.h"
 
 #include <asm/system.h>
@@ -3646,4 +3646,15 @@ void esp_release(void)
 }
 #endif
 
+EXPORT_SYMBOL(esp_abort);
+EXPORT_SYMBOL(esp_allocate);
+EXPORT_SYMBOL(esp_deallocate);
+EXPORT_SYMBOL(esp_initialize);
+EXPORT_SYMBOL(esp_intr);
+EXPORT_SYMBOL(esp_queue);
+EXPORT_SYMBOL(esp_reset);
+EXPORT_SYMBOL(esp_slave_alloc);
+EXPORT_SYMBOL(esp_slave_destroy);
+EXPORT_SYMBOL(esps_in_use);
+
 MODULE_LICENSE("GPL");
diff --git a/drivers/scsi/NCR53c406a.c b/drivers/scsi/NCR53c406a.c
index 2abc6e478..3f457dc1b 100644
--- a/drivers/scsi/NCR53c406a.c
+++ b/drivers/scsi/NCR53c406a.c
@@ -54,7 +54,7 @@
 #include <linux/blkdev.h>
 #include <linux/spinlock.h>
 #include "scsi.h"
-#include "hosts.h"
+#include <scsi/scsi_host.h>
 
 /* ============================================================= */
 
diff --git a/drivers/scsi/NCR_D700.c b/drivers/scsi/NCR_D700.c
index 329f0eea1..802f907a5 100644
--- a/drivers/scsi/NCR_D700.c
+++ b/drivers/scsi/NCR_D700.c
@@ -98,9 +98,7 @@
 #include <linux/module.h>
 #include <linux/mca.h>
 #include <asm/io.h>
-
-#include "scsi.h"
-#include "hosts.h"
+#include <scsi/scsi_host.h>
 
 #include "53c700.h"
 #include "NCR_D700.h"
@@ -156,7 +154,7 @@ param_setup(char *string)
 
 /* Host template.  The 53c700 routine NCR_700_detect will
  * fill in all of the missing routines */
-static Scsi_Host_Template NCR_D700_driver_template = {
+static struct scsi_host_template NCR_D700_driver_template = {
 	.module			= THIS_MODULE,
 	.name			= "NCR Dual 700 MCA",
 	.proc_name		= "NCR_D700",
diff --git a/drivers/scsi/NCR_Q720.c b/drivers/scsi/NCR_Q720.c
index c9e3a5fca..d47a86ef5 100644
--- a/drivers/scsi/NCR_Q720.c
+++ b/drivers/scsi/NCR_Q720.c
@@ -16,16 +16,14 @@
 #include <asm/io.h>
 
 #include "scsi.h"
-#include "hosts.h"
+#include <scsi/scsi_host.h>
 
 #include "ncr53c8xx.h"
 
 #include "NCR_Q720.h"
 
-static ncr_chip q720_chip __initdata = {
-	.device_id =	PSEUDO_720_ID,
+static struct ncr_chip q720_chip __initdata = {
 	.revision_id =	0x0f,
-	.name =		"720",
 	.burst_max =	3,
 	.offset_max =	8,
 	.nr_divisor =	4,
@@ -50,7 +48,7 @@ struct NCR_Q720_private {
 	struct Scsi_Host	*hosts[4];
 };
 
-Scsi_Host_Template NCR_Q720_tpnt = {
+struct scsi_host_template NCR_Q720_tpnt = {
 	.module			= THIS_MODULE,
 	.proc_name		= "NCR_Q720",
 };
diff --git a/drivers/scsi/a2091.c b/drivers/scsi/a2091.c
index ecaf2d9c5..9928a2fbc 100644
--- a/drivers/scsi/a2091.c
+++ b/drivers/scsi/a2091.c
@@ -16,7 +16,7 @@
 #include <linux/spinlock.h>
 
 #include "scsi.h"
-#include "hosts.h"
+#include <scsi/scsi_host.h>
 #include "wd33c93.h"
 #include "a2091.h"
 
diff --git a/drivers/scsi/a3000.c b/drivers/scsi/a3000.c
index 23071c15d..f8a89ec25 100644
--- a/drivers/scsi/a3000.c
+++ b/drivers/scsi/a3000.c
@@ -15,7 +15,7 @@
 #include <asm/irq.h>
 
 #include "scsi.h"
-#include "hosts.h"
+#include <scsi/scsi_host.h>
 #include "wd33c93.h"
 #include "a3000.h"
 
diff --git a/drivers/scsi/aacraid/README b/drivers/scsi/aacraid/README
index 4624917b3..6abbe026b 100644
--- a/drivers/scsi/aacraid/README
+++ b/drivers/scsi/aacraid/README
@@ -10,20 +10,22 @@ the original).
 
 Supported Cards/Chipsets
 -------------------------
+	AAR-2410SA SATA
+	Adaptec 2120S
+	Adaptec 2200S
+	Adaptec 2230S
+	Adaptec 3230S
+	Adaptec 3240S
+	Adaptec 5400S
+	ASR-2020S PCI-X
 	Dell PERC 2 Quad Channel
 	Dell PERC 2/Si
 	Dell PERC 3/Si
 	Dell PERC 3/Di
+	Dell CERC 2
 	HP NetRAID-4M
-	ADAPTEC 2120S
-	ADAPTEC 2200S
-	ADAPTEC 5400S
 	Legend S220
 	Legend S230
-	Adaptec 3230S
-	Adaptec 3240S
-	ASR-2020S PCI-X
-	AAR-2410SA SATA
 
 People
 -------------------------
@@ -46,7 +48,7 @@ Adaptec Unix OEM Product Group
 
 Mailing List
 -------------------------
-linux-aacraid-devel@dell.com (Interested parties troll here)
+linux-scsi@vger.kernel.org (Interested parties troll here)
 http://mbserver.adaptec.com/ (Currently more Community Support than Devel Support)
 Also note this is very different to Brian's original driver
 so don't expect him to support it.
diff --git a/drivers/scsi/aacraid/TODO b/drivers/scsi/aacraid/TODO
index 6f7102241..25856a21d 100644
--- a/drivers/scsi/aacraid/TODO
+++ b/drivers/scsi/aacraid/TODO
@@ -2,3 +2,5 @@ o	Testing
 o	More testing
 o	Feature request: display the firmware/bios/etc revisions in the
 	/proc info
+o	Drop irq_mask, basically unused
+o	I/O size increase
diff --git a/drivers/scsi/aacraid/aachba.c b/drivers/scsi/aacraid/aachba.c
index c8801152a..7b02a48a2 100644
--- a/drivers/scsi/aacraid/aachba.c
+++ b/drivers/scsi/aacraid/aachba.c
@@ -53,34 +53,10 @@
 #define	INQD_PDT_DMASK	0x1F	/* Peripheral Device Type Mask */
 #define	INQD_PDT_QMASK	0xE0	/* Peripheral Device Qualifer Mask */
 
-#define	TARGET_LUN_TO_CONTAINER(target, lun)	(target)
-#define CONTAINER_TO_TARGET(cont)		((cont))
-#define CONTAINER_TO_LUN(cont)			(0)
-
 #define MAX_FIB_DATA (sizeof(struct hw_fib) - sizeof(FIB_HEADER))
 
 #define MAX_DRIVER_SG_SEGMENT_COUNT 17
 
-/*
- *	Sense keys
- */
-#define SENKEY_NO_SENSE      0x00	
-#define SENKEY_UNDEFINED     0x01	
-#define SENKEY_NOT_READY     0x02	
-#define SENKEY_MEDIUM_ERR    0x03	
-#define SENKEY_HW_ERR        0x04	
-#define SENKEY_ILLEGAL       0x05	
-#define SENKEY_ATTENTION     0x06	
-#define SENKEY_PROTECTED     0x07	
-#define SENKEY_BLANK         0x08	
-#define SENKEY_V_UNIQUE      0x09	
-#define SENKEY_CPY_ABORT     0x0A	
-#define SENKEY_ABORT         0x0B	
-#define SENKEY_EQUAL         0x0C	
-#define SENKEY_VOL_OVERFLOW  0x0D	
-#define SENKEY_MISCOMP       0x0E	
-#define SENKEY_RESERVED      0x0F	
-
 /*
  *	Sense codes
  */
@@ -195,7 +171,6 @@ struct sense_data {
  *              M O D U L E   G L O B A L S
  */
  
-static struct fsa_scsi_hba *fsa_dev[MAXIMUM_NUM_ADAPTERS];	/*  SCSI Device Instance Pointers */
 static struct sense_data sense_data[MAXIMUM_NUM_CONTAINERS];
 static unsigned long aac_build_sg(struct scsi_cmnd* scsicmd, struct sgmap* sgmap);
 static unsigned long aac_build_sg64(struct scsi_cmnd* scsicmd, struct sgmap64* psg);
@@ -264,7 +239,6 @@ int aac_get_containers(struct aac_dev *dev)
 		}
 	}
 	fib_free(fibptr);
-	fsa_dev[instance] = fsa_dev_ptr;
 	return status;
 }
 
@@ -424,14 +398,14 @@ void set_sense(u8 *sense_buf, u8 sense_key, u8 sense_code,
 	} else
 		sense_buf[2] = sense_key;	/* Sense key */
 
-	if (sense_key == SENKEY_ILLEGAL)
+	if (sense_key == ILLEGAL_REQUEST)
 		sense_buf[7] = 10;	/* Additional sense length */
 	else
 		sense_buf[7] = 6;	/* Additional sense length */
 
 	sense_buf[12] = sense_code;	/* Additional sense code */
 	sense_buf[13] = a_sense_code;	/* Additional sense code qualifier */
-	if (sense_key == SENKEY_ILLEGAL) {
+	if (sense_key == ILLEGAL_REQUEST) {
 		sense_buf[15] = 0;
 
 		if (sense_code == SENCODE_INVALID_PARAM_FIELD)
@@ -514,11 +488,12 @@ int aac_get_adapter_info(struct aac_dev* dev)
 		dev->nondasd_support = (nondasd!=0);
 	}
 	if(dev->nondasd_support != 0){
-		printk(KERN_INFO"%s%d: Non-DASD support enabled\n",dev->name, dev->id);
+		printk(KERN_INFO "%s%d: Non-DASD support enabled.\n",dev->name, dev->id);
 	}
 
 	dev->pae_support = 0;
 	if( (sizeof(dma_addr_t) > 4) && (dev->adapter_info.options & AAC_OPT_SGMAP_HOST64)){
+		printk(KERN_INFO "%s%d: 64bit support enabled.\n", dev->name, dev->id);
 		dev->pae_support = 1;
 	}
 
@@ -548,7 +523,7 @@ static void read_callback(void *context, struct fib * fibptr)
 	scsicmd = (struct scsi_cmnd *) context;
 
 	dev = (struct aac_dev *)scsicmd->device->host->hostdata;
-	cid =TARGET_LUN_TO_CONTAINER(scsicmd->device->id, scsicmd->device->lun);
+	cid = ID_LUN_TO_CONTAINER(scsicmd->device->id, scsicmd->device->lun);
 
 	lba = ((scsicmd->cmnd[1] & 0x1F) << 16) | (scsicmd->cmnd[2] << 8) | scsicmd->cmnd[3];
 	dprintk((KERN_DEBUG "read_callback[cpu %d]: lba = %u, t = %ld.\n", smp_processor_id(), lba, jiffies));
@@ -572,10 +547,11 @@ static void read_callback(void *context, struct fib * fibptr)
 		printk(KERN_WARNING "read_callback: read failed, status = %d\n", readreply->status);
 		scsicmd->result = DID_OK << 16 | COMMAND_COMPLETE << 8 | SAM_STAT_CHECK_CONDITION;
 		set_sense((u8 *) &sense_data[cid],
-				    SENKEY_HW_ERR,
+				    HARDWARE_ERROR,
 				    SENCODE_INTERNAL_TARGET_FAILURE,
 				    ASENCODE_INTERNAL_TARGET_FAILURE, 0, 0,
 				    0, 0);
+		memcpy(scsicmd->sense_buffer, &sense_data[cid], sizeof(struct sense_data));
 	}
 	fib_complete(fibptr);
 	fib_free(fibptr);
@@ -593,7 +569,7 @@ static void write_callback(void *context, struct fib * fibptr)
 
 	scsicmd = (struct scsi_cmnd *) context;
 	dev = (struct aac_dev *)scsicmd->device->host->hostdata;
-	cid = TARGET_LUN_TO_CONTAINER(scsicmd->device->id, scsicmd->device->lun);
+	cid = ID_LUN_TO_CONTAINER(scsicmd->device->id, scsicmd->device->lun);
 
 	lba = ((scsicmd->cmnd[1] & 0x1F) << 16) | (scsicmd->cmnd[2] << 8) | scsicmd->cmnd[3];
 	dprintk((KERN_DEBUG "write_callback[cpu %d]: lba = %u, t = %ld.\n", smp_processor_id(), lba, jiffies));
@@ -617,10 +593,11 @@ static void write_callback(void *context, struct fib * fibptr)
 		printk(KERN_WARNING "write_callback: write failed, status = %d\n", writereply->status);
 		scsicmd->result = DID_OK << 16 | COMMAND_COMPLETE << 8 | SAM_STAT_CHECK_CONDITION;
 		set_sense((u8 *) &sense_data[cid],
-				    SENKEY_HW_ERR,
+				    HARDWARE_ERROR,
 				    SENCODE_INTERNAL_TARGET_FAILURE,
 				    ASENCODE_INTERNAL_TARGET_FAILURE, 0, 0,
 				    0, 0);
+		memcpy(scsicmd->sense_buffer, &sense_data[cid], sizeof(struct sense_data));
 	}
 
 	fib_complete(fibptr);
@@ -644,7 +621,7 @@ int aac_read(struct scsi_cmnd * scsicmd, int cid)
 	 */
 	if (scsicmd->cmnd[0] == READ_6)	/* 6 byte command */
 	{
-		dprintk((KERN_DEBUG "aachba: received a read(6) command on target %d.\n", cid));
+		dprintk((KERN_DEBUG "aachba: received a read(6) command on id %d.\n", cid));
 
 		lba = ((scsicmd->cmnd[1] & 0x1F) << 16) | (scsicmd->cmnd[2] << 8) | scsicmd->cmnd[3];
 		count = scsicmd->cmnd[4];
@@ -652,7 +629,7 @@ int aac_read(struct scsi_cmnd * scsicmd, int cid)
 		if (count == 0)
 			count = 256;
 	} else {
-		dprintk((KERN_DEBUG "aachba: received a read(10) command on target %d.\n", cid));
+		dprintk((KERN_DEBUG "aachba: received a read(10) command on id %d.\n", cid));
 
 		lba = (scsicmd->cmnd[2] << 24) | (scsicmd->cmnd[3] << 16) | (scsicmd->cmnd[4] << 8) | scsicmd->cmnd[5];
 		count = (scsicmd->cmnd[7] << 8) | scsicmd->cmnd[8];
@@ -662,9 +639,7 @@ int aac_read(struct scsi_cmnd * scsicmd, int cid)
 	 *	Alocate and initialize a Fib
 	 */
 	if (!(cmd_fibcontext = fib_alloc(dev))) {
-		scsicmd->result = DID_ERROR << 16;
-		aac_io_done(scsicmd);
-		return (-1);
+		return -1;
 	}
 
 	fib_init(cmd_fibcontext);
@@ -726,7 +701,10 @@ int aac_read(struct scsi_cmnd * scsicmd, int cid)
 	 *	Check that the command queued to the controller
 	 */
 	if (status == -EINPROGRESS) 
+	{
+		dprintk("read queued.\n");
 		return 0;
+	}
 		
 	printk(KERN_WARNING "aac_read: fib_send failed with status: %d.\n", status);
 	/*
@@ -759,7 +737,7 @@ static int aac_write(struct scsi_cmnd * scsicmd, int cid)
 		if (count == 0)
 			count = 256;
 	} else {
-		dprintk((KERN_DEBUG "aachba: received a write(10) command on target %d.\n", cid));
+		dprintk((KERN_DEBUG "aachba: received a write(10) command on id %d.\n", cid));
 		lba = (scsicmd->cmnd[2] << 24) | (scsicmd->cmnd[3] << 16) | (scsicmd->cmnd[4] << 8) | scsicmd->cmnd[5];
 		count = (scsicmd->cmnd[7] << 8) | scsicmd->cmnd[8];
 	}
@@ -832,7 +810,10 @@ static int aac_write(struct scsi_cmnd * scsicmd, int cid)
 	 *	Check that the command queued to the controller
 	 */
 	if (status == -EINPROGRESS)
+	{
+		dprintk("write queued.\n");
 		return 0;
+	}
 
 	printk(KERN_WARNING "aac_write: fib_send failed with status: %d\n", status);
 	/*
@@ -850,7 +831,6 @@ static int aac_write(struct scsi_cmnd * scsicmd, int cid)
 /**
  *	aac_scsi_cmd()		-	Process SCSI command
  *	@scsicmd:		SCSI command block
- *	@wait:			1 if the user wants to await completion
  *
  *	Emulate a SCSI command and queue the required request for the
  *	aacraid firmware.
@@ -859,29 +839,25 @@ static int aac_write(struct scsi_cmnd * scsicmd, int cid)
 int aac_scsi_cmd(struct scsi_cmnd * scsicmd)
 {
 	u32 cid = 0;
-	struct fsa_scsi_hba *fsa_dev_ptr;
-	int cardtype;
 	int ret;
 	struct Scsi_Host *host = scsicmd->device->host;
 	struct aac_dev *dev = (struct aac_dev *)host->hostdata;
+	struct fsa_scsi_hba *fsa_dev_ptr = &dev->fsa_dev;
+	int cardtype = dev->cardtype;
 	
-	cardtype = dev->cardtype;
-
-	fsa_dev_ptr = fsa_dev[host->unique_id];
-
 	/*
-	 *	If the bus, target or lun is out of range, return fail
+	 *	If the bus, id or lun is out of range, return fail
 	 *	Test does not apply to ID 16, the pseudo id for the controller
 	 *	itself.
 	 */
 	if (scsicmd->device->id != host->this_id) {
 		if ((scsicmd->device->channel == 0) ){
-			if( (scsicmd->device->id >= AAC_MAX_TARGET) || (scsicmd->device->lun != 0)){ 
+			if( (scsicmd->device->id >= MAXIMUM_NUM_CONTAINERS) || (scsicmd->device->lun != 0)){ 
 				scsicmd->result = DID_NO_CONNECT << 16;
 				__aac_io_done(scsicmd);
 				return 0;
 			}
-			cid = TARGET_LUN_TO_CONTAINER(scsicmd->device->id, scsicmd->device->lun);
+			cid = ID_LUN_TO_CONTAINER(scsicmd->device->id, scsicmd->device->lun);
 
 			/*
 			 *	If the target container doesn't exist, it may have
@@ -911,7 +887,7 @@ int aac_scsi_cmd(struct scsi_cmnd * scsicmd)
 			if (fsa_dev_ptr->valid[cid] == 0) {
 				scsicmd->result = DID_BAD_TARGET << 16;
 				__aac_io_done(scsicmd);
-				return -1;
+				return 0;
 			}
 		} else {  /* check for physical non-dasd devices */
 			if(dev->nondasd_support == 1){
@@ -932,11 +908,12 @@ int aac_scsi_cmd(struct scsi_cmnd * scsicmd)
 		dprintk((KERN_WARNING "Only INQUIRY & TUR command supported for controller, rcvd = 0x%x.\n", scsicmd->cmnd[0]));
 		scsicmd->result = DID_OK << 16 | COMMAND_COMPLETE << 8 | SAM_STAT_CHECK_CONDITION;
 		set_sense((u8 *) &sense_data[cid],
-			    SENKEY_ILLEGAL,
+			    ILLEGAL_REQUEST,
 			    SENCODE_INVALID_COMMAND,
 			    ASENCODE_INVALID_COMMAND, 0, 0, 0, 0);
 		__aac_io_done(scsicmd);
-		return -1;
+		memcpy(scsicmd->sense_buffer, &sense_data[cid], sizeof(struct sense_data));
+		return 0;
 	}
 
 
@@ -1034,7 +1011,7 @@ int aac_scsi_cmd(struct scsi_cmnd * scsicmd)
 		memset(&sense_data[cid], 0, sizeof (struct sense_data));
 		scsicmd->result = DID_OK << 16 | COMMAND_COMPLETE << 8 | SAM_STAT_GOOD;
 		__aac_io_done(scsicmd);
-		return (0);
+		return 0;
 
 	case ALLOW_MEDIUM_REMOVAL:
 		dprintk((KERN_DEBUG "LOCK command.\n"));
@@ -1058,7 +1035,7 @@ int aac_scsi_cmd(struct scsi_cmnd * scsicmd)
 	case START_STOP:
 		scsicmd->result = DID_OK << 16 | COMMAND_COMPLETE << 8 | SAM_STAT_GOOD;
 		__aac_io_done(scsicmd);
-		return (0);
+		return 0;
 	}
 
 	switch (scsicmd->cmnd[0]) 
@@ -1094,14 +1071,16 @@ int aac_scsi_cmd(struct scsi_cmnd * scsicmd)
 			printk(KERN_WARNING "Unhandled SCSI Command: 0x%x.\n", scsicmd->cmnd[0]);
 			scsicmd->result = DID_OK << 16 | COMMAND_COMPLETE << 8 | SAM_STAT_CHECK_CONDITION;
 			set_sense((u8 *) &sense_data[cid],
-				SENKEY_ILLEGAL, SENCODE_INVALID_COMMAND,
+				ILLEGAL_REQUEST, SENCODE_INVALID_COMMAND,
 			ASENCODE_INVALID_COMMAND, 0, 0, 0, 0);
+			memcpy(scsicmd->sense_buffer, &sense_data[cid],
+				sizeof(struct sense_data));
 			__aac_io_done(scsicmd);
-			return -1;
+			return 0;
 	}
 }
 
-static int query_disk(struct aac_dev *dev, void *arg)
+static int query_disk(struct aac_dev *dev, void __user *arg)
 {
 	struct aac_query_disk qd;
 	struct fsa_scsi_hba *fsa_dev_ptr;
@@ -1110,14 +1089,14 @@ static int query_disk(struct aac_dev *dev, void *arg)
 	if (copy_from_user(&qd, arg, sizeof (struct aac_query_disk)))
 		return -EFAULT;
 	if (qd.cnum == -1)
-		qd.cnum = TARGET_LUN_TO_CONTAINER(qd.target, qd.lun);
-	else if ((qd.bus == -1) && (qd.target == -1) && (qd.lun == -1)) 
+		qd.cnum = ID_LUN_TO_CONTAINER(qd.id, qd.lun);
+	else if ((qd.bus == -1) && (qd.id == -1) && (qd.lun == -1)) 
 	{
 		if (qd.cnum < 0 || qd.cnum >= MAXIMUM_NUM_CONTAINERS)
 			return -EINVAL;
 		qd.instance = dev->scsi_host_ptr->host_no;
 		qd.bus = 0;
-		qd.target = CONTAINER_TO_TARGET(qd.cnum);
+		qd.id = CONTAINER_TO_ID(qd.cnum);
 		qd.lun = CONTAINER_TO_LUN(qd.cnum);
 	}
 	else return -EINVAL;
@@ -1138,7 +1117,7 @@ static int query_disk(struct aac_dev *dev, void *arg)
 	return 0;
 }
 
-static int force_delete_disk(struct aac_dev *dev, void *arg)
+static int force_delete_disk(struct aac_dev *dev, void __user *arg)
 {
 	struct aac_delete_disk dd;
 	struct fsa_scsi_hba *fsa_dev_ptr;
@@ -1161,7 +1140,7 @@ static int force_delete_disk(struct aac_dev *dev, void *arg)
 	return 0;
 }
 
-static int delete_disk(struct aac_dev *dev, void *arg)
+static int delete_disk(struct aac_dev *dev, void __user *arg)
 {
 	struct aac_delete_disk dd;
 	struct fsa_scsi_hba *fsa_dev_ptr;
@@ -1188,7 +1167,7 @@ static int delete_disk(struct aac_dev *dev, void *arg)
 	}
 }
 
-int aac_dev_ioctl(struct aac_dev *dev, int cmd, void *arg)
+int aac_dev_ioctl(struct aac_dev *dev, int cmd, void __user *arg)
 {
 	switch (cmd) {
 	case FSACTL_QUERY_DISK:
@@ -1197,7 +1176,7 @@ int aac_dev_ioctl(struct aac_dev *dev, int cmd, void *arg)
 		return delete_disk(dev, arg);
 	case FSACTL_FORCE_DELETE_DISK:
 		return force_delete_disk(dev, arg);
-	case 2131:
+	case FSACTL_GET_CONTAINERS:
 		return aac_get_containers(dev);
 	default:
 		return -ENOTTY;
@@ -1228,8 +1207,11 @@ static void aac_srb_callback(void *context, struct fib * fibptr)
 
 	srbreply = (struct aac_srb_reply *) fib_data(fibptr);
 
-	scsicmd->sense_buffer[0] = '\0';  // initialize sense valid flag to false
-	// calculate resid for sg 
+	scsicmd->sense_buffer[0] = '\0';  /* Initialize sense valid flag to false */
+	/*
+	 *	Calculate resid for sg 
+	 */
+	 
 	scsicmd->resid = scsicmd->request_bufflen - srbreply->data_xfer_length;
 
 	if(scsicmd->use_sg)
@@ -1376,7 +1358,7 @@ static void aac_srb_callback(void *context, struct fib * fibptr)
 		scsicmd->result |= SAM_STAT_CHECK_CONDITION;
 		len = (srbreply->sense_data_size > sizeof(scsicmd->sense_buffer))?
 				sizeof(scsicmd->sense_buffer):srbreply->sense_data_size;
-		printk(KERN_WARNING "aac_srb_callback: check condition, status = %d len=%d\n", le32_to_cpu(srbreply->status), len);
+		dprintk((KERN_WARNING "aac_srb_callback: check condition, status = %d len=%d\n", le32_to_cpu(srbreply->status), len));
 		memcpy(scsicmd->sense_buffer, srbreply->sense_data, len);
 		
 	}
@@ -1437,8 +1419,6 @@ static int aac_send_srb_fib(struct scsi_cmnd* scsicmd)
 	 *	Allocate and initialize a Fib then setup a BlockWrite command
 	 */
 	if (!(cmd_fibcontext = fib_alloc(dev))) {
-		scsicmd->result = DID_ERROR << 16;
-		__aac_io_done(scsicmd);
 		return -1;
 	}
 	fib_init(cmd_fibcontext);
@@ -1446,7 +1426,7 @@ static int aac_send_srb_fib(struct scsi_cmnd* scsicmd)
 	srbcmd = (struct aac_srb*) fib_data(cmd_fibcontext);
 	srbcmd->function = cpu_to_le32(SRBF_ExecuteScsi);
 	srbcmd->channel  = cpu_to_le32(aac_logical_to_phys(scsicmd->device->channel));
-	srbcmd->target   = cpu_to_le32(scsicmd->device->id);
+	srbcmd->id   = cpu_to_le32(scsicmd->device->id);
 	srbcmd->lun      = cpu_to_le32(scsicmd->device->lun);
 	srbcmd->flags    = cpu_to_le32(flag);
 	timeout = (scsicmd->timeout-jiffies)/HZ;
@@ -1498,12 +1478,6 @@ static int aac_send_srb_fib(struct scsi_cmnd* scsicmd)
 	}
 
 	printk(KERN_WARNING "aac_srb: fib_send failed with status: %d\n", status);
-	/*
-	 *	For some reason, the Fib didn't queue, return QUEUE_FULL
-	 */
-	scsicmd->result = DID_OK << 16 | COMMAND_COMPLETE << 8 | SAM_STAT_TASK_SET_FULL;
-	__aac_io_done(scsicmd);
-
 	fib_complete(cmd_fibcontext);
 	fib_free(cmd_fibcontext);
 
diff --git a/drivers/scsi/aacraid/aacraid.h b/drivers/scsi/aacraid/aacraid.h
index e4164c308..8b077f224 100644
--- a/drivers/scsi/aacraid/aacraid.h
+++ b/drivers/scsi/aacraid/aacraid.h
@@ -6,14 +6,12 @@
  *              D E F I N E S
  *----------------------------------------------------------------------------*/
 
-#define MAXIMUM_NUM_CONTAINERS	31
+#define MAXIMUM_NUM_CONTAINERS	32
 #define MAXIMUM_NUM_ADAPTERS	8
 
-#define AAC_NUM_FIB		578
-//#define AAC_NUM_IO_FIB	512
+#define AAC_NUM_FIB		(256 + 64)
 #define AAC_NUM_IO_FIB		100
 
-#define AAC_MAX_TARGET 		(MAXIMUM_NUM_CONTAINERS+1)
 #define AAC_MAX_LUN		(8)
 
 #define AAC_MAX_HOSTPHYSMEMPAGES (0xfffff)
@@ -21,7 +19,12 @@
 /*
  * These macros convert from physical channels to virtual channels
  */
-#define CONTAINER_CHANNEL	(0)
+#define CONTAINER_CHANNEL		(0)
+#define ID_LUN_TO_CONTAINER(id, lun)	(id)
+#define CONTAINER_TO_CHANNEL(cont)	(CONTAINER_CHANNEL)
+#define CONTAINER_TO_ID(cont)		(cont)
+#define CONTAINER_TO_LUN(cont)		(0)
+
 #define aac_phys_to_logical(x)  (x+1)
 #define aac_logical_to_phys(x)  (x?x-1:0)
 
@@ -73,7 +76,7 @@ struct diskparm
 #define		FT_SOCK		6	/* socket */
 #define		FT_FIFO		7	/* fifo */
 #define		FT_FILESYS	8	/* ADAPTEC's "FSA"(tm) filesystem */
-#define		FT_DRIVE	9	/* physical disk - addressable in scsi by bus/target/lun */
+#define		FT_DRIVE	9	/* physical disk - addressable in scsi by bus/id/lun */
 #define		FT_SLICE	10	/* virtual disk - raw volume - slice */
 #define		FT_PARTITION	11	/* FSA partition - carved out of a slice - building block for containers */
 #define		FT_VOLUME	12	/* Container - Volume Set */
@@ -433,7 +436,7 @@ struct adapter_ops
 
 struct aac_driver_ident
 {
-	int 	(*init)(struct aac_dev *dev, unsigned long num);
+	int 	(*init)(struct aac_dev *dev);
 	char *	name;
 	char *	vname;
 	char *	model;
@@ -596,6 +599,9 @@ struct rx_inbound {
 #define	InboundMailbox2		IndexRegs.Mailbox[2]
 #define	InboundMailbox3		IndexRegs.Mailbox[3]
 #define	InboundMailbox4		IndexRegs.Mailbox[4]
+#define	InboundMailbox5		IndexRegs.Mailbox[5]
+#define	InboundMailbox6		IndexRegs.Mailbox[6]
+#define	InboundMailbox7		IndexRegs.Mailbox[7]
 
 #define	INBOUNDDOORBELL_0	cpu_to_le32(0x00000001)
 #define INBOUNDDOORBELL_1	cpu_to_le32(0x00000002)
@@ -650,6 +656,7 @@ typedef void (*fib_callback)(void *ctxt, struct fib *fibctx);
 struct aac_fib_context {
 	s16	 		type;		// used for verification of structure	
 	s16	 		size;
+	u32			unique;		// unique value representing this context
 	ulong			jiffies;	// used for cleanup - dmb changed to ulong
 	struct list_head	next;		// used to link context's into a linked list
 	struct semaphore 	wait_sem;	// this is used to wait for the next fib to arrive.
@@ -825,9 +832,8 @@ struct aac_dev
 	} regs;
 	u32			OIMR; /* Mask Register Cache */
 	/*
-	 *	The following is the number of the individual adapter
+	 *	AIF thread states
 	 */
-	u32			devnum;
 	u32			aif_thread;
 	struct completion	aif_completion;
 	struct aac_adapter_info adapter_info;
@@ -839,19 +845,19 @@ struct aac_dev
 };
 
 #define AllocateAndMapFibSpace(dev, MapFibContext) \
-	dev->a_ops.AllocateAndMapFibSpace(dev, MapFibContext)
+	(dev)->a_ops.AllocateAndMapFibSpace(dev, MapFibContext)
 
 #define UnmapAndFreeFibSpace(dev, MapFibContext) \
-	dev->a_ops.UnmapAndFreeFibSpace(dev, MapFibContext)
+	(dev)->a_ops.UnmapAndFreeFibSpace(dev, MapFibContext)
 
 #define aac_adapter_interrupt(dev) \
-	dev->a_ops.adapter_interrupt(dev)
+	(dev)->a_ops.adapter_interrupt(dev)
 
 #define aac_adapter_notify(dev, event) \
-	dev->a_ops.adapter_notify(dev, event)
+	(dev)->a_ops.adapter_notify(dev, event)
 
 #define aac_adapter_enable_int(dev, event) \
-	dev->a_ops.adapter_enable_int(dev, event)
+	(dev)->a_ops.adapter_enable_int(dev, event)
 
 #define aac_adapter_disable_int(dev, event) \
 	dev->a_ops.adapter_disable_int(dev, event)
@@ -1023,7 +1029,7 @@ struct aac_srb
 {
 	u32		function;
 	u32		channel;
-	u32		target;
+	u32		id;
 	u32		lun;
 	u32		timeout;
 	u32		flags;
@@ -1212,7 +1218,7 @@ struct aac_query_disk
 {
 	s32	cnum;
 	s32	bus;
-	s32	target;
+	s32	id;
 	s32	lun;
 	u32	valid;
 	u32	locked;
@@ -1226,12 +1232,12 @@ struct aac_delete_disk {
 	u32	disknum;
 	u32	cnum;
 };
-
+ 
 struct fib_ioctl
 {
-	char	*fibctx;
-	int	wait;
-	char	*fib;
+	u32	fibctx;
+	s32	wait;
+	char	__user *fib;
 };
 
 struct revision
@@ -1271,6 +1277,7 @@ struct revision
 #define FSACTL_MINIPORT_REV_CHECK               CTL_CODE(2107, METHOD_BUFFERED)
 #define FSACTL_GET_PCI_INFO               	CTL_CODE(2119, METHOD_BUFFERED)
 #define FSACTL_FORCE_DELETE_DISK		CTL_CODE(2120, METHOD_NEITHER)
+#define FSACTL_GET_CONTAINERS			2131
 
 
 struct aac_common
@@ -1306,7 +1313,7 @@ extern struct aac_common aac_config;
  *	only used for debugging.
  */
  
-#if DBG
+#ifdef DBG
 #define	FIB_COUNTER_INCREMENT(counter)		(counter)++
 #else
 #define	FIB_COUNTER_INCREMENT(counter)		
@@ -1323,6 +1330,7 @@ extern struct aac_common aac_config;
 #define WRITE_PERMANENT_PARAMETERS	cpu_to_le32(0x0000000b)
 #define HOST_CRASHING			cpu_to_le32(0x0000000d)
 #define	SEND_SYNCHRONOUS_FIB		cpu_to_le32(0x0000000c)
+#define	COMMAND_POST_RESULTS		cpu_to_le32(0x00000014)
 #define GET_ADAPTER_PROPERTIES		cpu_to_le32(0x00000019)
 #define RE_INIT_ADAPTER			cpu_to_le32(0x000000ee)
 
@@ -1347,14 +1355,16 @@ extern struct aac_common aac_config;
  *	Phases are bit oriented.  It is NOT valid  to have multiple bits set						
  */					
 
-#define	SELF_TEST_FAILED		cpu_to_le32(0x00000004)
-#define	KERNEL_UP_AND_RUNNING		cpu_to_le32(0x00000080)
-#define	KERNEL_PANIC			cpu_to_le32(0x00000100)
+#define	SELF_TEST_FAILED		(cpu_to_le32(0x00000004))
+#define MONITOR_PANIC			(cpu_to_le32(0x00000020))
+#define	KERNEL_UP_AND_RUNNING		(cpu_to_le32(0x00000080))
+#define	KERNEL_PANIC			(cpu_to_le32(0x00000100))
 
 /*
  *	Doorbell bit defines
  */
 
+#define DoorBellSyncCmdAvailable	cpu_to_le32(1<<0)	// Host -> Adapter
 #define DoorBellPrintfDone		cpu_to_le32(1<<5)	// Host -> Adapter
 #define DoorBellAdapterNormCmdReady	cpu_to_le32(1<<1)	// Adapter -> Host
 #define DoorBellAdapterNormRespReady	cpu_to_le32(1<<2)	// Adapter -> Host
@@ -1368,9 +1378,22 @@ extern struct aac_common aac_config;
  */
  
 #define 	AifCmdEventNotify	1	/* Notify of event */
+#define			AifEnConfigChange	3	/* Adapter configuration change */
+#define			AifEnContainerChange	4	/* Container configuration change */
+#define			AifEnDeviceFailure	5	/* SCSI device failed */
+#define			AifEnAddContainer	15	/* A new array was created */
+#define			AifEnDeleteContainer	16	/* A container was deleted */
+#define			AifEnExpEvent		23	/* Firmware Event Log */
+#define			AifExeFirmwarePanic	3	/* Firmware Event Panic */
+#define			AifHighPriority		3	/* Highest Priority Event */
+
 #define		AifCmdJobProgress	2	/* Progress report */
+#define			AifJobCtrZero	101	/* Array Zero progress */
+#define			AifJobStsSuccess 1	/* Job completes */
 #define		AifCmdAPIReport		3	/* Report from other user of API */
 #define		AifCmdDriverNotify	4	/* Notify host driver of event */
+#define			AifDenMorphComplete 200	/* A morph operation completed */
+#define			AifDenVolumeExtendComplete 201 /* A volume extend completed */
 #define		AifReqJobList		100	/* Gets back complete job list */
 #define		AifReqJobsForCtr	101	/* Gets back jobs for specific container */
 #define		AifReqJobsForScsi	102	/* Gets back jobs for specific SCSI device */ 
@@ -1425,11 +1448,11 @@ int fib_complete(struct fib * context);
 struct aac_dev *aac_init_adapter(struct aac_dev *dev);
 int aac_get_containers(struct aac_dev *dev);
 int aac_scsi_cmd(struct scsi_cmnd *cmd);
-int aac_dev_ioctl(struct aac_dev *dev, int cmd, void *arg);
-int aac_do_ioctl(struct aac_dev * dev, int cmd, void *arg);
-int aac_rx_init(struct aac_dev *dev, unsigned long devNumber);
-int aac_rkt_init(struct aac_dev *dev, unsigned long devNumber);
-int aac_sa_init(struct aac_dev *dev, unsigned long devNumber);
+int aac_dev_ioctl(struct aac_dev *dev, int cmd, void __user *arg);
+int aac_do_ioctl(struct aac_dev * dev, int cmd, void __user *arg);
+int aac_rx_init(struct aac_dev *dev);
+int aac_rkt_init(struct aac_dev *dev);
+int aac_sa_init(struct aac_dev *dev);
 unsigned int aac_response_normal(struct aac_queue * q);
 unsigned int aac_command_normal(struct aac_queue * q);
 int aac_command_thread(struct aac_dev * dev);
diff --git a/drivers/scsi/aacraid/commctrl.c b/drivers/scsi/aacraid/commctrl.c
index 6af1ec0ea..36ae4af39 100644
--- a/drivers/scsi/aacraid/commctrl.c
+++ b/drivers/scsi/aacraid/commctrl.c
@@ -52,7 +52,7 @@
  *	program.
  */
  
-static int ioctl_send_fib(struct aac_dev * dev, void *arg)
+static int ioctl_send_fib(struct aac_dev * dev, void __user *arg)
 {
 	struct hw_fib * kfib;
 	struct fib *fibptr;
@@ -92,11 +92,12 @@ static int ioctl_send_fib(struct aac_dev * dev, void *arg)
 		 */
 		kfib->header.XferState = 0;
 	} else {
-		if (fib_send(kfib->header.Command, fibptr, le32_to_cpu(kfib->header.Size) , FsaNormal,
-			1, 1, NULL, NULL) != 0) 
-		{
+		int retval = fib_send(kfib->header.Command, fibptr,
+				le32_to_cpu(kfib->header.Size) , FsaNormal,
+				1, 1, NULL, NULL);
+		if (retval) {
 			fib_free(fibptr);
-			return -EINVAL;
+			return retval;
 		}
 		if (fib_complete(fibptr) != 0) {
 			fib_free(fibptr);
@@ -126,18 +127,28 @@ static int ioctl_send_fib(struct aac_dev * dev, void *arg)
  *	passed in from the user.
  */
 
-static int open_getadapter_fib(struct aac_dev * dev, void *arg)
+static int open_getadapter_fib(struct aac_dev * dev, void __user *arg)
 {
 	struct aac_fib_context * fibctx;
 	int status;
-	unsigned long flags;
 
 	fibctx = kmalloc(sizeof(struct aac_fib_context), GFP_KERNEL);
 	if (fibctx == NULL) {
 		status = -ENOMEM;
 	} else {
+		unsigned long flags;
+		struct list_head * entry;
+		struct aac_fib_context * context;
+
 		fibctx->type = FSAFS_NTC_GET_ADAPTER_FIB_CONTEXT;
 		fibctx->size = sizeof(struct aac_fib_context);
+ 		/*
+		 *	Yes yes, I know this could be an index, but we have a
+		 * better guarantee of uniqueness for the locked loop below.
+		 * Without the aid of a persistent history, this also helps
+		 * reduce the chance that the opaque context would be reused.
+		 */
+		fibctx->unique = (u32)((ulong)fibctx & 0xFFFFFFFF);
 		/*
 		 *	Initialize the mutex used to wait for the next AIF.
 		 */
@@ -155,9 +166,22 @@ static int open_getadapter_fib(struct aac_dev * dev, void *arg)
 		 *	AdapterFibContext list.
 		 */
 		spin_lock_irqsave(&dev->fib_lock, flags);
+		/* Ensure that we have a unique identifier */
+		entry = dev->fib_list.next;
+		while (entry != &dev->fib_list) {
+			context = list_entry(entry, struct aac_fib_context, next);
+			if (context->unique == fibctx->unique) {
+				/* Not unique (32 bits) */
+				fibctx->unique++;
+				entry = dev->fib_list.next;
+			} else {
+				entry = entry->next;
+			}
+		}
 		list_add_tail(&fibctx->next, &dev->fib_list);
 		spin_unlock_irqrestore(&dev->fib_lock, flags);
-		if (copy_to_user(arg,  &fibctx, sizeof(struct aac_fib_context *))) {
+		if (copy_to_user(arg,  &fibctx->unique, 
+						sizeof(fibctx->unique))) {
 			status = -EFAULT;
 		} else {
 			status = 0;
@@ -175,46 +199,47 @@ static int open_getadapter_fib(struct aac_dev * dev, void *arg)
  *	passed in from the user.
  */
 
-static int next_getadapter_fib(struct aac_dev * dev, void *arg)
+static int next_getadapter_fib(struct aac_dev * dev, void __user *arg)
 {
 	struct fib_ioctl f;
-	struct aac_fib_context *fibctx, *aifcp;
 	struct fib *fib;
+	struct aac_fib_context *fibctx;
 	int status;
 	struct list_head * entry;
-	int found;
 	unsigned long flags;
 	
 	if(copy_from_user((void *)&f, arg, sizeof(struct fib_ioctl)))
 		return -EFAULT;
-	/*
-	 *	Extract the AdapterFibContext from the Input parameters.
-	 */
-	fibctx = (struct aac_fib_context *) f.fibctx;
-
 	/*
 	 *	Verify that the HANDLE passed in was a valid AdapterFibContext
 	 *
 	 *	Search the list of AdapterFibContext addresses on the adapter
 	 *	to be sure this is a valid address
 	 */
-	found = 0;
 	entry = dev->fib_list.next;
+	fibctx = NULL;
 
-	while(entry != &dev->fib_list) {
-		aifcp = list_entry(entry, struct aac_fib_context, next);
-		if(fibctx == aifcp) {   /* We found a winner */
-			found = 1;
+	while (entry != &dev->fib_list) {
+		fibctx = list_entry(entry, struct aac_fib_context, next);
+		/*
+		 *	Extract the AdapterFibContext from the Input parameters.
+		 */
+		if (fibctx->unique == f.fibctx) {   /* We found a winner */
 			break;
 		}
 		entry = entry->next;
+		fibctx = NULL;
 	}
-	if (found == 0)
+	if (!fibctx) {
+		dprintk ((KERN_INFO "Fib Context not found\n"));
 		return -EINVAL;
+	}
 
 	if((fibctx->type != FSAFS_NTC_GET_ADAPTER_FIB_CONTEXT) ||
-		 (fibctx->size != sizeof(struct aac_fib_context)))
+		 (fibctx->size != sizeof(struct aac_fib_context))) {
+		dprintk ((KERN_INFO "Fib Context corrupt?\n"));
 		return -EINVAL;
+	}
 	status = 0;
 	spin_lock_irqsave(&dev->fib_lock, flags);
 	/*
@@ -307,18 +332,12 @@ int aac_close_fib_context(struct aac_dev * dev, struct aac_fib_context * fibctx)
  *	This routine will close down the fibctx passed in from the user.
  */
  
-static int close_getadapter_fib(struct aac_dev * dev, void *arg)
+static int close_getadapter_fib(struct aac_dev * dev, void __user *arg)
 {
-	struct aac_fib_context *fibctx, *aifcp;
+	struct aac_fib_context *fibctx;
 	int status;
 	unsigned long flags;
 	struct list_head * entry;
-	int found;
-
-	/*
-	 *	Extract the fibctx from the input parameters
-	 */
-	fibctx = arg;
 
 	/*
 	 *	Verify that the HANDLE passed in was a valid AdapterFibContext
@@ -327,19 +346,23 @@ static int close_getadapter_fib(struct aac_dev * dev, void *arg)
 	 *	to be sure this is a valid address
 	 */
 
-	found = 0;
 	entry = dev->fib_list.next;
+	fibctx = NULL;
 
 	while(entry != &dev->fib_list) {
-		aifcp = list_entry(entry, struct aac_fib_context, next);
-		if(fibctx == aifcp) {   /* We found a winner */
-			found = 1;
+		fibctx = list_entry(entry, struct aac_fib_context, next);
+		/*
+		 *	Extract the fibctx from the input parameters
+		 */
+		if (fibctx->unique == (u32)(unsigned long)arg) {   
+			/* We found a winner */
 			break;
 		}
 		entry = entry->next;
+		fibctx = NULL;
 	}
 
-	if(found == 0)
+	if (!fibctx)
 		return 0; /* Already gone */
 
 	if((fibctx->type != FSAFS_NTC_GET_ADAPTER_FIB_CONTEXT) ||
@@ -356,11 +379,12 @@ static int close_getadapter_fib(struct aac_dev * dev, void *arg)
  *	@dev: adapter
  *	@arg: ioctl arguments
  *
- *	This routine returns the firmware version.
- *      Under Linux, there have been no version incompatibilities, so this is simple!
+ *	This routine returns the driver version.
+ *      Under Linux, there have been no version incompatibilities, so this is 
+ *      simple!
  */
 
-static int check_revision(struct aac_dev *dev, void *arg)
+static int check_revision(struct aac_dev *dev, void __user *arg)
 {
 	struct revision response;
 
@@ -379,20 +403,20 @@ static int check_revision(struct aac_dev *dev, void *arg)
  *
  */
 
-int aac_send_raw_srb(struct aac_dev* dev, void* arg)
+int aac_send_raw_srb(struct aac_dev* dev, void __user * arg)
 {
 	struct fib* srbfib;
 	int status;
 	struct aac_srb *srbcmd;
-	struct aac_srb *user_srb = arg;
-	struct aac_srb_reply* user_reply;
+	struct aac_srb __user *user_srb = arg;
+	struct aac_srb_reply __user *user_reply;
 	struct aac_srb_reply* reply;
 	u32 fibsize = 0;
 	u32 flags = 0;
 	s32 rcode = 0;
 	u32 data_dir;
-	ulong sg_user[32];
-	ulong sg_list[32];
+	void __user *sg_user[32];
+	void *sg_list[32];
 	u32   sg_indx = 0;
 	u32 byte_count = 0;
 	u32 actual_fibsize = 0;
@@ -413,12 +437,17 @@ int aac_send_raw_srb(struct aac_dev* dev, void* arg)
 
 	srbcmd = (struct aac_srb*) fib_data(srbfib);
 
-	if(copy_from_user((void*)&fibsize, (void*)&user_srb->count,sizeof(u32))){
+	if(copy_from_user(&fibsize, &user_srb->count,sizeof(u32))){
 		printk(KERN_DEBUG"aacraid: Could not copy data size from user\n"); 
 		rcode = -EFAULT;
 		goto cleanup;
 	}
 
+	if (fibsize > FIB_DATA_SIZE_IN_BYTES) {
+		rcode = -EINVAL;
+		goto cleanup;
+	}
+
 	if(copy_from_user(srbcmd, user_srb,fibsize)){
 		printk(KERN_DEBUG"aacraid: Could not copy srb from user\n"); 
 		rcode = -EFAULT;
@@ -431,14 +460,14 @@ int aac_send_raw_srb(struct aac_dev* dev, void* arg)
 	// Fix up srb for endian and force some values
 	srbcmd->function = cpu_to_le32(SRBF_ExecuteScsi);	// Force this
 	srbcmd->channel  = cpu_to_le32(srbcmd->channel);
-	srbcmd->target   = cpu_to_le32(srbcmd->target);
+	srbcmd->id	 = cpu_to_le32(srbcmd->id);
 	srbcmd->lun      = cpu_to_le32(srbcmd->lun);
 	srbcmd->flags    = cpu_to_le32(srbcmd->flags);
 	srbcmd->timeout  = cpu_to_le32(srbcmd->timeout);
 	srbcmd->retry_limit =cpu_to_le32(0); // Obsolete parameter
 	srbcmd->cdb_size = cpu_to_le32(srbcmd->cdb_size);
 	
-	switch(srbcmd->flags){
+	switch (srbcmd->flags & (SRB_DataIn | SRB_DataOut)) {
 	case SRB_DataOut:
 		data_dir = DMA_TO_DEVICE;
 		break;
@@ -451,17 +480,26 @@ int aac_send_raw_srb(struct aac_dev* dev, void* arg)
 	default:
 		data_dir = DMA_NONE;
 	}
-	if( dev->pae_support ==1 ) {
+	if (dev->pae_support == 1) {
 		struct sgmap64* psg = (struct sgmap64*)&srbcmd->sg;
 		byte_count = 0;
 
-		// This should also catch if user used the 32 bit sgmap
-		actual_fibsize = sizeof (struct aac_srb) + (((srbcmd->sg.count & 0xff) - 1) * sizeof (struct sgentry64));
+		/*
+		 * This should also catch if user used the 32 bit sgmap
+		 */
+		actual_fibsize = sizeof(struct aac_srb) - 
+			sizeof(struct sgentry) + ((srbcmd->sg.count & 0xff) * 
+			 	sizeof(struct sgentry64));
 		if(actual_fibsize != fibsize){ // User made a mistake - should not continue
 			printk(KERN_DEBUG"aacraid: Bad Size specified in Raw SRB command\n");
 			rcode = -EINVAL;
 			goto cleanup;
 		}
+		if ((data_dir == DMA_NONE) && psg->count) { 
+			printk(KERN_DEBUG"aacraid: SG with no direction specified in Raw SRB command\n");
+			rcode = -EINVAL;
+			goto cleanup;
+		}
 
 		for (i = 0; i < psg->count; i++) {
 			dma_addr_t addr; 
@@ -474,12 +512,12 @@ int aac_send_raw_srb(struct aac_dev* dev, void* arg)
 				rcode = -ENOMEM;
 				goto cleanup;
 			}
-			sg_user[i] = (ulong)psg->sg[i].addr;
-			sg_list[i] = (ulong)p; // save so we can clean up later
+			sg_user[i] = (void __user *)psg->sg[i].addr;
+			sg_list[i] = p; // save so we can clean up later
 			sg_indx = i;
 
 			if( flags & SRB_DataOut ){
-				if(copy_from_user(p,psg->sg[i].addr,psg->sg[i].count)){
+				if(copy_from_user(p,sg_user[i],psg->sg[i].count)){
 					printk(KERN_DEBUG"aacraid: Could not copy sg data from user\n"); 
 					rcode = -EFAULT;
 					goto cleanup;
@@ -495,7 +533,7 @@ int aac_send_raw_srb(struct aac_dev* dev, void* arg)
 		}
 
 		srbcmd->count = cpu_to_le32(byte_count);
-		status = fib_send(ScsiPortCommand64, srbfib, actual_fibsize, FsaNormal, 1, 1,0,0);
+		status = fib_send(ScsiPortCommand64, srbfib, actual_fibsize, FsaNormal, 1, 1,NULL,NULL);
 	} else {
 		struct sgmap* psg = &srbcmd->sg;
 		byte_count = 0;
@@ -506,6 +544,11 @@ int aac_send_raw_srb(struct aac_dev* dev, void* arg)
 			rcode = -EINVAL;
 			goto cleanup;
 		}
+		if ((data_dir == DMA_NONE) && psg->count) {
+			printk(KERN_DEBUG"aacraid: SG with no direction specified in Raw SRB command\n");
+			rcode = -EINVAL;
+			goto cleanup;
+		}
 		for (i = 0; i < psg->count; i++) {
 			dma_addr_t addr; 
 			void* p;
@@ -516,12 +559,12 @@ int aac_send_raw_srb(struct aac_dev* dev, void* arg)
 				rcode = -ENOMEM;
 				goto cleanup;
 			}
-			sg_user[i] = (ulong)(psg->sg[i].addr);
-			sg_list[i] = (ulong)p; // save so we can clean up later
+			sg_user[i] = (void __user *)(psg->sg[i].addr);
+			sg_list[i] = p; // save so we can clean up later
 			sg_indx = i;
 
 			if( flags & SRB_DataOut ){
-				if(copy_from_user((void*)p,(void*)(ulong)(psg->sg[i].addr),psg->sg[i].count)){
+				if(copy_from_user(p,sg_user[i],psg->sg[i].count)){
 					printk(KERN_DEBUG"aacraid: Could not copy sg data from user\n"); 
 					rcode = -EFAULT;
 					goto cleanup;
@@ -534,7 +577,7 @@ int aac_send_raw_srb(struct aac_dev* dev, void* arg)
 			byte_count += psg->sg[i].count;
 		}
 		srbcmd->count = cpu_to_le32(byte_count);
-		status = fib_send(ScsiPortCommand, srbfib, actual_fibsize, FsaNormal, 1, 1, 0, 0);
+		status = fib_send(ScsiPortCommand, srbfib, actual_fibsize, FsaNormal, 1, 1, NULL, NULL);
 	}
 
 	if (status != 0){
@@ -545,7 +588,7 @@ int aac_send_raw_srb(struct aac_dev* dev, void* arg)
 
 	if( flags & SRB_DataIn ) {
 		for(i = 0 ; i <= sg_indx; i++){
-			if(copy_to_user((void*)(sg_user[i]),(void*)(sg_list[i]),le32_to_cpu(srbcmd->sg.sg[i].count))){
+			if(copy_to_user(sg_user[i],sg_list[i],le32_to_cpu(srbcmd->sg.sg[i].count))){
 				printk(KERN_DEBUG"aacraid: Could not copy sg data to user\n"); 
 				rcode = -EFAULT;
 				goto cleanup;
@@ -563,7 +606,7 @@ int aac_send_raw_srb(struct aac_dev* dev, void* arg)
 
 cleanup:
 	for(i=0; i <= sg_indx; i++){
-		kfree((void*)sg_list[i]);
+		kfree(sg_list[i]);
 	}
 	fib_complete(srbfib);
 	fib_free(srbfib);
@@ -578,14 +621,14 @@ struct aac_pci_info {
 };
 
 
-int aac_get_pci_info(struct aac_dev* dev, void* arg)
+int aac_get_pci_info(struct aac_dev* dev, void __user *arg)
 {
         struct aac_pci_info pci_info;
 
 	pci_info.bus = dev->pdev->bus->number;
 	pci_info.slot = PCI_SLOT(dev->pdev->devfn);
 
-       if(copy_to_user( arg, (void*)&pci_info, sizeof(struct aac_pci_info))){
+       if (copy_to_user(arg, &pci_info, sizeof(struct aac_pci_info))) {
 		printk(KERN_DEBUG "aacraid: Could not copy pci info\n");
                return -EFAULT;
 	}
@@ -593,7 +636,7 @@ int aac_get_pci_info(struct aac_dev* dev, void* arg)
  }
  
 
-int aac_do_ioctl(struct aac_dev * dev, int cmd, void *arg)
+int aac_do_ioctl(struct aac_dev * dev, int cmd, void __user *arg)
 {
 	int status;
 	
diff --git a/drivers/scsi/aacraid/comminit.c b/drivers/scsi/aacraid/comminit.c
index beb561fa0..d3ca7a37e 100644
--- a/drivers/scsi/aacraid/comminit.c
+++ b/drivers/scsi/aacraid/comminit.c
@@ -95,13 +95,18 @@ static int aac_alloc_comm(struct aac_dev *dev, void **commaddr, unsigned long co
 	 * with the math overloading past 32 bits, thus we must limit this
 	 * field.
 	 *
-	 * FIXME: this assumes the memory is mapped zero->n, which isnt
-	 * always true on real computers.
+	 * This assumes the memory is mapped zero->n, which isnt
+	 * always true on real computers. It also has some slight problems
+	 * with the GART on x86-64. I've btw never tried DMA from PCI space
+	 * on this platform but don't be suprised if its problematic.
 	 */
+#ifndef CONFIG_GART_IOMMU
 	if ((num_physpages << (PAGE_SHIFT - 12)) <= AAC_MAX_HOSTPHYSMEMPAGES) {
 		init->HostPhysMemPages = 
 			cpu_to_le32(num_physpages << (PAGE_SHIFT-12));
-	} else {
+	} else 
+#endif	
+	{
 		init->HostPhysMemPages = cpu_to_le32(AAC_MAX_HOSTPHYSMEMPAGES);
 	}
 
diff --git a/drivers/scsi/aacraid/linit.c b/drivers/scsi/aacraid/linit.c
index 8c4ceaeae..c55219142 100644
--- a/drivers/scsi/aacraid/linit.c
+++ b/drivers/scsi/aacraid/linit.c
@@ -27,10 +27,11 @@
  * Abstract: Linux Driver entry module for Adaptec RAID Array Controller
  */
 
-#define AAC_DRIVER_VERSION		"1.1.2-lk1"
+#define AAC_DRIVER_VERSION		"1.1.2-lk2"
 #define AAC_DRIVER_BUILD_DATE		__DATE__
 #define AAC_DRIVERNAME			"aacraid"
 
+#include <linux/compat.h>
 #include <linux/blkdev.h>
 #include <linux/completion.h>
 #include <linux/init.h>
@@ -41,6 +42,8 @@
 #include <linux/pci.h>
 #include <linux/slab.h>
 #include <linux/spinlock.h>
+#include <linux/syscalls.h>
+#include <linux/ioctl32.h>
 #include <asm/semaphore.h>
 
 #include <scsi/scsi.h>
@@ -168,6 +171,28 @@ static struct aac_driver_ident aac_drivers[] = {
 	{ aac_rx_init, "aacraid",  "ADAPTEC ", "ASR-2025SA      ", 1 }, /* ASR-2025SA      (ZCR DIMM SATA) */
 };
 
+#ifdef CONFIG_COMPAT
+/* 
+ * Promote 32 bit apps that call get_next_adapter_fib_ioctl to 64 bit version 
+ */
+static int aac_get_next_adapter_fib_ioctl(unsigned int fd, unsigned int cmd, 
+		unsigned long arg, struct file *file)
+{
+	struct fib_ioctl __user *f;
+
+	f = compat_alloc_user_space(sizeof(*f));
+	if (!access_ok(VERIFY_WRITE, f, sizeof(*f)))
+		return -EFAULT;
+
+	clear_user(f, sizeof(*f));
+	if (copy_in_user(f, (void __user *)arg, sizeof(struct fib_ioctl) - sizeof(u32)))
+		return -EFAULT;
+
+	return sys_ioctl(fd, cmd, (unsigned long)f);
+}
+#endif
+
+
 /**
  *	aac_queuecommand	-	queue a SCSI command
  *	@cmd:		SCSI command to queue
@@ -330,7 +355,7 @@ static int aac_slave_configure(struct scsi_device *sdev)
 	return 0;
 }
 
-static int aac_ioctl(struct scsi_device *sdev, int cmd, void * arg)
+static int aac_ioctl(struct scsi_device *sdev, int cmd, void __user * arg)
 {
 	struct aac_dev *dev = (struct aac_dev *)sdev->host->hostdata;
 	return aac_do_ioctl(dev, cmd, arg);
@@ -355,13 +380,15 @@ static int aac_eh_reset(struct scsi_cmnd* cmd)
 	struct Scsi_Host * host = dev->host;
 	struct scsi_cmnd * command;
 	int count;
+	struct aac_dev * aac;
 	unsigned long flags;
 
 	printk(KERN_ERR "%s: Host adapter reset request. SCSI hang ?\n", 
 					AAC_DRIVERNAME);
 
 
-	if (aac_adapter_check_health((struct aac_dev *)host->hostdata)) {
+	aac = (struct aac_dev *)host->hostdata;
+	if (aac_adapter_check_health(aac)) {
 		printk(KERN_ERR "%s: Host adapter appears dead\n", 
 				AAC_DRIVERNAME);
 		return -ENODEV;
@@ -381,15 +408,13 @@ static int aac_eh_reset(struct scsi_cmnd* cmd)
 				}
 			}
 			spin_unlock_irqrestore(&dev->list_lock, flags);
-			if (active)
-				break;
 
+			/*
+			 * We can exit If all the commands are complete
+			 */
+			if (active == 0)
+				return SUCCESS;
 		}
-		/*
-		 * We can exit If all the commands are complete
-		 */
-		if (active == 0)
-			return SUCCESS;
 		spin_unlock_irq(host->host_lock);
 		scsi_sleep(HZ);
 		spin_lock_irq(host->host_lock);
@@ -437,7 +462,7 @@ static int aac_cfg_open(struct inode *inode, struct file *file)
 static int aac_cfg_ioctl(struct inode *inode,  struct file *file,
 		unsigned int cmd, unsigned long arg)
 {
-	return aac_do_ioctl(file->private_data, cmd, (void *)arg);
+	return aac_do_ioctl(file->private_data, cmd, (void __user *)arg);
 }
 
 static struct file_operations aac_cfg_fops = {
@@ -461,7 +486,11 @@ static struct scsi_host_template aac_driver_template = {
 	.this_id        		= 16,
 	.sg_tablesize   		= 16,
 	.max_sectors    		= 128,
+#if (AAC_NUM_IO_FIB > 256)
+	.cmd_per_lun			= 256,
+#else		
 	.cmd_per_lun    		= AAC_NUM_IO_FIB, 
+#endif	
 	.use_clustering			= ENABLE_CLUSTERING,
 };
 
@@ -521,7 +550,7 @@ static int __devinit aac_probe_one(struct pci_dev *pdev,
 	for (container = 0; container < MAXIMUM_NUM_CONTAINERS; container++)
 		fsa_dev_ptr->devname[container][0] = '\0';
 
-	if ((*aac_drivers[index].init)(aac , shost->unique_id))
+	if ((*aac_drivers[index].init)(aac))
 		goto out_free_fibs;
 
 	/*
@@ -552,7 +581,7 @@ static int __devinit aac_probe_one(struct pci_dev *pdev,
 	 * dmb - we may need to move the setting of these parms somewhere else once
 	 * we get a fib that can report the actual numbers
 	 */
-	shost->max_id = AAC_MAX_TARGET;
+	shost->max_id = MAXIMUM_NUM_CONTAINERS;
 	shost->max_lun = AAC_MAX_LUN;
 
 	error = scsi_add_host(shost, &pdev->dev);
@@ -643,12 +672,39 @@ static int __init aac_init(void)
 		printk(KERN_WARNING
 		       "aacraid: unable to register \"aac\" device.\n");
 	}
+#ifdef CONFIG_COMPAT
+	register_ioctl32_conversion(FSACTL_MINIPORT_REV_CHECK, NULL);
+	register_ioctl32_conversion(FSACTL_SENDFIB, NULL);
+	register_ioctl32_conversion(FSACTL_OPEN_GET_ADAPTER_FIB, NULL);
+	register_ioctl32_conversion(FSACTL_GET_NEXT_ADAPTER_FIB, 
+		aac_get_next_adapter_fib_ioctl);
+	register_ioctl32_conversion(FSACTL_CLOSE_GET_ADAPTER_FIB, NULL);
+	register_ioctl32_conversion(FSACTL_SEND_RAW_SRB, NULL);
+	register_ioctl32_conversion(FSACTL_GET_PCI_INFO, NULL);
+	register_ioctl32_conversion(FSACTL_QUERY_DISK, NULL);
+	register_ioctl32_conversion(FSACTL_DELETE_DISK, NULL);
+	register_ioctl32_conversion(FSACTL_FORCE_DELETE_DISK, NULL);
+	register_ioctl32_conversion(FSACTL_GET_CONTAINERS, NULL);
+#endif
 
 	return 0;
 }
 
 static void __exit aac_exit(void)
 {
+#ifdef CONFIG_COMPAT
+	unregister_ioctl32_conversion(FSACTL_MINIPORT_REV_CHECK);
+	unregister_ioctl32_conversion(FSACTL_SENDFIB);
+	unregister_ioctl32_conversion(FSACTL_OPEN_GET_ADAPTER_FIB);
+	unregister_ioctl32_conversion(FSACTL_GET_NEXT_ADAPTER_FIB);
+	unregister_ioctl32_conversion(FSACTL_CLOSE_GET_ADAPTER_FIB);
+	unregister_ioctl32_conversion(FSACTL_SEND_RAW_SRB);
+	unregister_ioctl32_conversion(FSACTL_GET_PCI_INFO);
+	unregister_ioctl32_conversion(FSACTL_QUERY_DISK);
+	unregister_ioctl32_conversion(FSACTL_DELETE_DISK);
+	unregister_ioctl32_conversion(FSACTL_FORCE_DELETE_DISK);
+	unregister_ioctl32_conversion(FSACTL_GET_CONTAINERS);
+#endif
 	unregister_chrdev(aac_cfg_major, "aac");
 	pci_unregister_driver(&aac_pci_driver);
 }
diff --git a/drivers/scsi/aacraid/rkt.c b/drivers/scsi/aacraid/rkt.c
index 573a0cf24..7a7b3d7bc 100644
--- a/drivers/scsi/aacraid/rkt.c
+++ b/drivers/scsi/aacraid/rkt.c
@@ -38,6 +38,7 @@
 #include <linux/blkdev.h>
 #include <linux/delay.h>
 #include <linux/completion.h>
+#include <linux/time.h>
 #include <linux/interrupt.h>
 #include <asm/semaphore.h>
 
@@ -67,8 +68,8 @@ static irqreturn_t aac_rkt_intr(int irq, void *dev_id, struct pt_regs *regs)
 			rkt_writel(dev, InboundDoorbellReg,DoorBellPrintfDone);
 		}
 		else if (bellbits & DoorBellAdapterNormCmdReady) {
-			aac_command_normal(&dev->queues->queue[HostNormCmdQueue]);
 			rkt_writel(dev, MUnit.ODR, DoorBellAdapterNormCmdReady);
+			aac_command_normal(&dev->queues->queue[HostNormCmdQueue]);
 		}
 		else if (bellbits & DoorBellAdapterNormRespReady) {
 			aac_response_normal(&dev->queues->queue[HostNormRespQueue]);
@@ -305,7 +306,7 @@ static void aac_rkt_start_adapter(struct aac_dev *dev)
 	struct aac_init *init;
 
 	init = dev->init;
-	init->HostElapsedSeconds = cpu_to_le32(jiffies/HZ);
+	init->HostElapsedSeconds = cpu_to_le32(get_seconds());
 	/*
 	 *	Tell the adapter we are back and up and running so it will scan
 	 *	its command queues and enable our interrupts
@@ -341,12 +342,38 @@ static int aac_rkt_check_health(struct aac_dev *dev)
 	if (status & SELF_TEST_FAILED)
 		return -1;
 	/*
-	 *	Check to see if the board panic'd while booting.
+	 *	Check to see if the board panic'd.
 	 */
 	if (status & KERNEL_PANIC)
-		return -2;
+	{
+		char * buffer = kmalloc(512, GFP_KERNEL|__GFP_DMA);
+		struct POSTSTATUS {
+			u32 Post_Command;
+			u32 Post_Address;
+		} * post = kmalloc(sizeof(struct POSTSTATUS), GFP_KERNEL);
+		dma_addr_t paddr = pci_map_single(dev->pdev, post, sizeof(struct POSTSTATUS), 2);
+		dma_addr_t baddr = pci_map_single(dev->pdev, buffer, 512, 1);
+		u32 status = -1;
+		int ret = -2;
+		
+		memset(buffer, 0, 512);
+		post->Post_Command = cpu_to_le32(COMMAND_POST_RESULTS);
+		post->Post_Address = cpu_to_le32(baddr);
+		rkt_writel(dev, MUnit.IMRx[0], cpu_to_le32(paddr));
+		rkt_sync_cmd(dev, COMMAND_POST_RESULTS, baddr, &status);
+		pci_unmap_single(dev->pdev, paddr, sizeof(struct POSTSTATUS),2);
+		kfree(post);
+		if ((buffer[0] == '0') && (buffer[1] == 'x')) {
+			ret = (buffer[2] <= '9') ? (buffer[2] - '0') : (buffer[2] - 'A' + 10);
+			ret <<= 4;
+			ret += (buffer[3] <= '9') ? (buffer[3] - '0') : (buffer[3] - 'A' + 10);
+		}
+		pci_unmap_single(dev->pdev, baddr, 512, 1);
+		kfree(buffer);
+		return ret;
+	}
 	/*
-	 *	Wait for the adapter to be up and running. Wait up to 3 minutes
+	 *	Wait for the adapter to be up and running.
 	 */
 	if (!(status & KERNEL_UP_AND_RUNNING))
 		return -3;
@@ -354,26 +381,24 @@ static int aac_rkt_check_health(struct aac_dev *dev)
 	 *	Everything is OK
 	 */
 	return 0;
-} /* aac_rkt_check_health */
+}
 
 /**
  *	aac_rkt_init	-	initialize an i960 based AAC card
  *	@dev: device to configure
- *	@devnum: adapter number
  *
  *	Allocate and set up resources for the i960 based AAC variants. The 
  *	device_interface in the commregion will be allocated and linked 
  *	to the comm region.
  */
 
-int aac_rkt_init(struct aac_dev *dev, unsigned long num)
+int aac_rkt_init(struct aac_dev *dev)
 {
 	unsigned long start;
 	unsigned long status;
 	int instance;
 	const char * name;
 
-	dev->devnum = num;
 	instance = dev->id;
 	name     = dev->name;
 
@@ -383,33 +408,40 @@ int aac_rkt_init(struct aac_dev *dev, unsigned long num)
 	if((dev->regs.rkt = (struct rkt_registers *)ioremap((unsigned long)dev->scsi_host_ptr->base, 8192))==NULL)
 	{	
 		printk(KERN_WARNING "aacraid: unable to map i960.\n" );
-		return -1;
+		goto error_iounmap;
 	}
 	/*
 	 *	Check to see if the board failed any self tests.
 	 */
-	if (rkt_readl(dev, IndexRegs.Mailbox[7]) & SELF_TEST_FAILED) {
+	if (rkt_readl(dev, MUnit.OMRx[0]) & SELF_TEST_FAILED) {
 		printk(KERN_ERR "%s%d: adapter self-test failed.\n", dev->name, instance);
-		return -1;
+		goto error_iounmap;
+	}
+	/*
+	 *	Check to see if the monitor panic'd while booting.
+	 */
+	if (rkt_readl(dev, MUnit.OMRx[0]) & MONITOR_PANIC) {
+		printk(KERN_ERR "%s%d: adapter monitor panic.\n", dev->name, instance);
+		goto error_iounmap;
 	}
 	/*
 	 *	Check to see if the board panic'd while booting.
 	 */
-	if (rkt_readl(dev, IndexRegs.Mailbox[7]) & KERNEL_PANIC) {
+	if (rkt_readl(dev, MUnit.OMRx[0]) & KERNEL_PANIC) {
 		printk(KERN_ERR "%s%d: adapter kernel panic'd.\n", dev->name, instance);
-		return -1;
+		goto error_iounmap;
 	}
 	start = jiffies;
 	/*
 	 *	Wait for the adapter to be up and running. Wait up to 3 minutes
 	 */
-	while (!(rkt_readl(dev, IndexRegs.Mailbox[7]) & KERNEL_UP_AND_RUNNING)) 
+	while (!(rkt_readl(dev, MUnit.OMRx[0]) & KERNEL_UP_AND_RUNNING))
 	{
 		if(time_after(jiffies, start+180*HZ))
 		{
 			status = rkt_readl(dev, IndexRegs.Mailbox[7]) >> 16;
 			printk(KERN_ERR "%s%d: adapter kernel failed to start, init status = %ld.\n", dev->name, instance, status);
-			return -1;
+			goto error_iounmap;
 		}
 		set_current_state(TASK_UNINTERRUPTIBLE);
 		schedule_timeout(1);
@@ -417,7 +449,7 @@ int aac_rkt_init(struct aac_dev *dev, unsigned long num)
 	if (request_irq(dev->scsi_host_ptr->irq, aac_rkt_intr, SA_SHIRQ|SA_INTERRUPT, "aacraid", (void *)dev)<0) 
 	{
 		printk(KERN_ERR "%s%d: Interrupt unavailable.\n", name, instance);
-		return -1;
+		goto error_iounmap;
 	}
 	/*
 	 *	Fill in the function dispatch table.
@@ -430,7 +462,7 @@ int aac_rkt_init(struct aac_dev *dev, unsigned long num)
 	dev->a_ops.adapter_check_health = aac_rkt_check_health;
 
 	if (aac_init_adapter(dev) == NULL)
-		return -1;
+		goto error_irq;
 	/*
 	 *	Start any kernel threads needed
 	 */
@@ -438,7 +470,7 @@ int aac_rkt_init(struct aac_dev *dev, unsigned long num)
 	if(dev->thread_pid < 0)
 	{
 		printk(KERN_ERR "aacraid: Unable to create rkt thread.\n");
-		return -1;
+		goto error_kfree;
 	}	
 	/*
 	 *	Tell the adapter that all is configured, and it can start
@@ -446,4 +478,15 @@ int aac_rkt_init(struct aac_dev *dev, unsigned long num)
 	 */
 	aac_rkt_start_adapter(dev);
 	return 0;
+
+error_kfree:
+	kfree(dev->queues);
+
+error_irq:
+	free_irq(dev->scsi_host_ptr->irq, (void *)dev);
+
+error_iounmap:
+	iounmap(dev->regs.rkt);
+
+	return -1;
 }
diff --git a/drivers/scsi/aacraid/rx.c b/drivers/scsi/aacraid/rx.c
index 3963287c2..e111087c0 100644
--- a/drivers/scsi/aacraid/rx.c
+++ b/drivers/scsi/aacraid/rx.c
@@ -38,6 +38,7 @@
 #include <linux/blkdev.h>
 #include <linux/delay.h>
 #include <linux/completion.h>
+#include <linux/time.h>
 #include <linux/interrupt.h>
 #include <asm/semaphore.h>
 
@@ -67,8 +68,8 @@ static irqreturn_t aac_rx_intr(int irq, void *dev_id, struct pt_regs *regs)
 			rx_writel(dev, InboundDoorbellReg,DoorBellPrintfDone);
 		}
 		else if (bellbits & DoorBellAdapterNormCmdReady) {
-			aac_command_normal(&dev->queues->queue[HostNormCmdQueue]);
 			rx_writel(dev, MUnit.ODR, DoorBellAdapterNormCmdReady);
+			aac_command_normal(&dev->queues->queue[HostNormCmdQueue]);
 		}
 		else if (bellbits & DoorBellAdapterNormRespReady) {
 			aac_response_normal(&dev->queues->queue[HostNormRespQueue]);
@@ -305,7 +306,7 @@ static void aac_rx_start_adapter(struct aac_dev *dev)
 	struct aac_init *init;
 
 	init = dev->init;
-	init->HostElapsedSeconds = cpu_to_le32(jiffies/HZ);
+	init->HostElapsedSeconds = cpu_to_le32(get_seconds());
 	/*
 	 *	Tell the adapter we are back and up and running so it will scan
 	 *	its command queues and enable our interrupts
@@ -341,12 +342,36 @@ static int aac_rx_check_health(struct aac_dev *dev)
 	if (status & SELF_TEST_FAILED)
 		return -1;
 	/*
-	 *	Check to see if the board panic'd while booting.
+	 *	Check to see if the board panic'd.
 	 */
-	if (status & KERNEL_PANIC)
-		return -2;
+	if (status & KERNEL_PANIC) {
+		char * buffer = kmalloc(512, GFP_KERNEL);
+		struct POSTSTATUS {
+			u32 Post_Command;
+			u32 Post_Address;
+		} * post = kmalloc(sizeof(struct POSTSTATUS), GFP_KERNEL);
+		dma_addr_t paddr = pci_map_single(dev->pdev, post, sizeof(struct POSTSTATUS), 2);
+		dma_addr_t baddr = pci_map_single(dev->pdev, buffer, 512, 1);
+		u32 status = -1;
+		int ret = -2;
+		memset(buffer, 0, 512);
+		post->Post_Command = cpu_to_le32(COMMAND_POST_RESULTS);
+		post->Post_Address = cpu_to_le32(baddr);
+		rx_writel(dev, MUnit.IMRx[0], cpu_to_le32(paddr));
+		rx_sync_cmd(dev, COMMAND_POST_RESULTS, baddr, &status);
+		pci_unmap_single(dev->pdev, paddr, sizeof(struct POSTSTATUS), 2);
+		kfree(post);
+		if ((buffer[0] == '0') && (buffer[1] == 'x')) {
+			ret = (buffer[2] <= '9') ? (buffer[2] - '0') : (buffer[2] - 'A' + 10);
+			ret <<= 4;
+			ret += (buffer[3] <= '9') ? (buffer[3] - '0') : (buffer[3] - 'A' + 10);
+		}
+		pci_unmap_single(dev->pdev, baddr, 512, 1);
+		kfree(buffer);
+		return ret;
+	}
 	/*
-	 *	Wait for the adapter to be up and running. Wait up to 3 minutes
+	 *	Wait for the adapter to be up and running.
 	 */
 	if (!(status & KERNEL_UP_AND_RUNNING))
 		return -3;
@@ -359,21 +384,19 @@ static int aac_rx_check_health(struct aac_dev *dev)
 /**
  *	aac_rx_init	-	initialize an i960 based AAC card
  *	@dev: device to configure
- *	@devnum: adapter number
  *
  *	Allocate and set up resources for the i960 based AAC variants. The 
  *	device_interface in the commregion will be allocated and linked 
  *	to the comm region.
  */
 
-int aac_rx_init(struct aac_dev *dev, unsigned long num)
+int aac_rx_init(struct aac_dev *dev)
 {
 	unsigned long start;
 	unsigned long status;
 	int instance;
 	const char * name;
 
-	dev->devnum = num;
 	instance = dev->id;
 	name     = dev->name;
 
@@ -388,28 +411,36 @@ int aac_rx_init(struct aac_dev *dev, unsigned long num)
 	/*
 	 *	Check to see if the board failed any self tests.
 	 */
-	if (rx_readl(dev, IndexRegs.Mailbox[7]) & SELF_TEST_FAILED) {
+	if (rx_readl(dev, MUnit.OMRx[0]) & SELF_TEST_FAILED) {
 		printk(KERN_ERR "%s%d: adapter self-test failed.\n", dev->name, instance);
-		return -1;
+		goto error_iounmap;
 	}
 	/*
 	 *	Check to see if the board panic'd while booting.
 	 */
-	if (rx_readl(dev, IndexRegs.Mailbox[7]) & KERNEL_PANIC) {
-		printk(KERN_ERR "%s%d: adapter kernel panic'd.\n", dev->name, instance);
-		return -1;
+	if (rx_readl(dev, MUnit.OMRx[0]) & KERNEL_PANIC) {
+		printk(KERN_ERR "%s%d: adapter kernel panic.\n", dev->name, instance);
+		goto error_iounmap;
+	}
+	/*
+	 *	Check to see if the monitor panic'd while booting.
+	 */
+	if (rx_readl(dev, MUnit.OMRx[0]) & MONITOR_PANIC) {
+		printk(KERN_ERR "%s%d: adapter monitor panic.\n", dev->name, instance);
+		goto error_iounmap;
 	}
 	start = jiffies;
 	/*
 	 *	Wait for the adapter to be up and running. Wait up to 3 minutes
 	 */
-	while (!(rx_readl(dev, IndexRegs.Mailbox[7]) & KERNEL_UP_AND_RUNNING)) 
+	while ((!(rx_readl(dev, IndexRegs.Mailbox[7]) & KERNEL_UP_AND_RUNNING))
+		|| (!(rx_readl(dev, MUnit.OMRx[0]) & KERNEL_UP_AND_RUNNING)))
 	{
 		if(time_after(jiffies, start+180*HZ))
 		{
 			status = rx_readl(dev, IndexRegs.Mailbox[7]) >> 16;
 			printk(KERN_ERR "%s%d: adapter kernel failed to start, init status = %ld.\n", dev->name, instance, status);
-			return -1;
+			goto error_iounmap;
 		}
 		set_current_state(TASK_UNINTERRUPTIBLE);
 		schedule_timeout(1);
@@ -417,7 +448,7 @@ int aac_rx_init(struct aac_dev *dev, unsigned long num)
 	if (request_irq(dev->scsi_host_ptr->irq, aac_rx_intr, SA_SHIRQ|SA_INTERRUPT, "aacraid", (void *)dev)<0) 
 	{
 		printk(KERN_ERR "%s%d: Interrupt unavailable.\n", name, instance);
-		return -1;
+		goto error_iounmap;
 	}
 	/*
 	 *	Fill in the function dispatch table.
@@ -430,15 +461,31 @@ int aac_rx_init(struct aac_dev *dev, unsigned long num)
 	dev->a_ops.adapter_check_health = aac_rx_check_health;
 
 	if (aac_init_adapter(dev) == NULL)
-		return -1;
+		goto error_irq;
 	/*
 	 *	Start any kernel threads needed
 	 */
 	dev->thread_pid = kernel_thread((int (*)(void *))aac_command_thread, dev, 0);
+	if(dev->thread_pid < 0)
+	{
+		printk(KERN_ERR "aacraid: Unable to create rx thread.\n");
+		goto error_kfree;
+	}
 	/*
 	 *	Tell the adapter that all is configured, and it can start
 	 *	accepting requests
 	 */
 	aac_rx_start_adapter(dev);
 	return 0;
+
+error_kfree:
+	kfree(dev->queues);
+
+error_irq:
+	free_irq(dev->scsi_host_ptr->irq, (void *)dev);
+
+error_iounmap:
+	iounmap(dev->regs.rx);
+
+	return -1;
 }
diff --git a/drivers/scsi/aacraid/sa.c b/drivers/scsi/aacraid/sa.c
index 494d1fde2..23e3b7644 100644
--- a/drivers/scsi/aacraid/sa.c
+++ b/drivers/scsi/aacraid/sa.c
@@ -38,6 +38,7 @@
 #include <linux/blkdev.h>
 #include <linux/delay.h>
 #include <linux/completion.h>
+#include <linux/time.h>
 #include <linux/interrupt.h>
 #include <asm/semaphore.h>
 
@@ -329,27 +330,24 @@ static int aac_sa_check_health(struct aac_dev *dev)
 	 *	Everything is OK
 	 */
 	return 0;
-} /* aac_sa_check_health */
+}
 
 /**
  *	aac_sa_init	-	initialize an ARM based AAC card
  *	@dev: device to configure
- *	@devnum: adapter number
  *
  *	Allocate and set up resources for the ARM based AAC variants. The 
  *	device_interface in the commregion will be allocated and linked 
  *	to the comm region.
  */
 
-int aac_sa_init(struct aac_dev *dev, unsigned long devnum)
+int aac_sa_init(struct aac_dev *dev)
 {
 	unsigned long start;
 	unsigned long status;
 	int instance;
 	const char *name;
 
-	dev->devnum = devnum;
-
 	dprintk(("PREINST\n"));
 	instance = dev->id;
 	name     = dev->name;
@@ -362,21 +360,21 @@ int aac_sa_init(struct aac_dev *dev, unsigned long devnum)
 	if((dev->regs.sa = (struct sa_registers *)ioremap((unsigned long)dev->scsi_host_ptr->base, 8192))==NULL)
 	{	
 		printk(KERN_WARNING "aacraid: unable to map ARM.\n" );
-		return -1;
+		goto error_iounmap;
 	}
 	/*
 	 *	Check to see if the board failed any self tests.
 	 */
 	if (sa_readl(dev, Mailbox7) & SELF_TEST_FAILED) {
 		printk(KERN_WARNING "%s%d: adapter self-test failed.\n", name, instance);
-		return -1;
+		goto error_iounmap;
 	}
 	/*
 	 *	Check to see if the board panic'd while booting.
 	 */
 	if (sa_readl(dev, Mailbox7) & KERNEL_PANIC) {
 		printk(KERN_WARNING "%s%d: adapter kernel panic'd.\n", name, instance);
-		return -1;
+		goto error_iounmap;
 	}
 	start = jiffies;
 	/*
@@ -386,7 +384,7 @@ int aac_sa_init(struct aac_dev *dev, unsigned long devnum)
 		if (time_after(jiffies, start+180*HZ)) {
 			status = sa_readl(dev, Mailbox7) >> 16;
 			printk(KERN_WARNING "%s%d: adapter kernel failed to start, init status = %d.\n", name, instance, le32_to_cpu(status));
-			return -1;
+			goto error_iounmap;
 		}
 		set_current_state(TASK_UNINTERRUPTIBLE);
 		schedule_timeout(1);
@@ -395,7 +393,7 @@ int aac_sa_init(struct aac_dev *dev, unsigned long devnum)
 	dprintk(("ATIRQ\n"));
 	if (request_irq(dev->scsi_host_ptr->irq, aac_sa_intr, SA_SHIRQ|SA_INTERRUPT, "aacraid", (void *)dev ) < 0) {
 		printk(KERN_WARNING "%s%d: Interrupt unavailable.\n", name, instance);
-		return -1;
+		goto error_iounmap;
 	}
 
 	/*
@@ -412,7 +410,7 @@ int aac_sa_init(struct aac_dev *dev, unsigned long devnum)
 	dprintk(("FUNCDONE\n"));
 
 	if(aac_init_adapter(dev) == NULL)
-		return -1;
+		goto error_irq;
 
 	dprintk(("NEWADAPTDONE\n"));
 	/*
@@ -421,7 +419,7 @@ int aac_sa_init(struct aac_dev *dev, unsigned long devnum)
 	dev->thread_pid = kernel_thread((int (*)(void *))aac_command_thread, dev, 0);
 	if (dev->thread_pid < 0) {
 		printk(KERN_ERR "aacraid: Unable to create command thread.\n");
-		return -1;
+		goto error_kfree;
 	}
 
 	/*
@@ -432,5 +430,17 @@ int aac_sa_init(struct aac_dev *dev, unsigned long devnum)
 	aac_sa_start_adapter(dev);
 	dprintk(("STARTED\n"));
 	return 0;
+
+
+error_kfree:
+	kfree(dev->queues);
+
+error_irq:
+	free_irq(dev->scsi_host_ptr->irq, (void *)dev);
+
+error_iounmap:
+	iounmap(dev->regs.sa);
+
+	return -1;
 }
 
diff --git a/drivers/scsi/advansys.c b/drivers/scsi/advansys.c
index 7b53e02fa..d796cac2a 100644
--- a/drivers/scsi/advansys.c
+++ b/drivers/scsi/advansys.c
@@ -1,4 +1,4 @@
-#define ASC_VERSION "3.3GJ"    /* AdvanSys Driver Version */
+#define ASC_VERSION "3.3K"    /* AdvanSys Driver Version */
 
 /*
  * advansys.c - Linux Host Driver for AdvanSys SCSI Adapters
@@ -677,6 +677,11 @@
          1. change select_queue_depths to slave_configure
 	 2. make cmd_per_lun be sane again
 
+     3.3K [2004/06/24]:
+         1. continuing cleanup for lk 2.6 series
+         2. Fix problem in lk 2.6.7-bk2 that broke PCI wide cards
+         3. Fix problem that oopsed ISA cards
+
   I. Known Problems/Fix List (XXX)
 
      1. Need to add memory mapping workaround. Test the memory mapping.
@@ -756,27 +761,6 @@
 
 */
 
-
-/*
- * --- Linux Version
- */
-
-#ifndef LINUX_VERSION_CODE
-#include <linux/version.h>
-#endif /* LINUX_VERSION_CODE */
-
-/* Convert Linux Version, Patch-level, Sub-level to LINUX_VERSION_CODE. */
-#define ASC_LINUX_VERSION(V, P, S)    (((V) * 65536) + ((P) * 256) + (S))
-#define ASC_LINUX_KERNEL22 (LINUX_VERSION_CODE < ASC_LINUX_VERSION(2,4,0))
-#define ASC_LINUX_KERNEL24 (LINUX_VERSION_CODE >= ASC_LINUX_VERSION(2,4,0))
-
-/* Driver supported only in version 2.2 and version >= 2.4. */
-#if LINUX_VERSION_CODE < ASC_LINUX_VERSION(2,2,0) || \
-    (LINUX_VERSION_CODE > ASC_LINUX_VERSION(2,3,0) && \
-     LINUX_VERSION_CODE < ASC_LINUX_VERSION(2,4,0))
-#error "AdvanSys driver supported only in 2.2 and 2.4 or greater kernels."
-#endif
-
 /*
  * --- Linux Include Files
  */
@@ -801,13 +785,30 @@
 #include <linux/blkdev.h>
 #include <linux/stat.h>
 #include <linux/spinlock.h>
+#include <linux/dma-mapping.h>
 
 #include <asm/io.h>
 #include <asm/system.h>
 #include <asm/dma.h>
 
-#include "scsi.h"
-#include "hosts.h"
+/* FIXME: (by jejb@steeleye.com) This warning is present for two
+ * reasons:
+ *
+ * 1) This driver badly needs converting to the correct driver model
+ *    probing API
+ *
+ * 2) Although all of the necessary command mapping places have the
+ * appropriate dma_map.. APIs, the driver still processes its internal
+ * queue using bus_to_virt() and virt_to_bus() which are illegal under
+ * the API.  The entire queue processing structure will need to be
+ * altered to fix this.
+ */
+#warning this driver is still not properly converted to the DMA API
+
+#include <scsi/scsi_cmnd.h>
+#include <scsi/scsi_device.h>
+#include <scsi/scsi.h>
+#include <scsi/scsi_host.h>
 #include "advansys.h"
 #ifdef CONFIG_PCI
 #include <linux/pci.h>
@@ -874,9 +875,6 @@
 
 typedef unsigned char uchar;
 
-#ifndef NULL
-#define NULL     (0)
-#endif
 #ifndef TRUE
 #define TRUE     (1)
 #endif
@@ -986,49 +984,6 @@ typedef unsigned char uchar;
 #define ASC_MIN_SENSE_LEN   14
 #define ASC_MAX_CDB_LEN     12
 #define ASC_SCSI_RESET_HOLD_TIME_US  60
-#define SCSICMD_TestUnitReady     0x00
-#define SCSICMD_Rewind            0x01
-#define SCSICMD_Rezero            0x01
-#define SCSICMD_RequestSense      0x03
-#define SCSICMD_Format            0x04
-#define SCSICMD_FormatUnit        0x04
-#define SCSICMD_Read6             0x08
-#define SCSICMD_Write6            0x0A
-#define SCSICMD_Seek6             0x0B
-#define SCSICMD_Inquiry           0x12
-#define SCSICMD_Verify6           0x13
-#define SCSICMD_ModeSelect6       0x15
-#define SCSICMD_ModeSense6        0x1A
-#define SCSICMD_StartStopUnit     0x1B
-#define SCSICMD_LoadUnloadTape    0x1B
-#define SCSICMD_ReadCapacity      0x25
-#define SCSICMD_Read10            0x28
-#define SCSICMD_Write10           0x2A
-#define SCSICMD_Seek10            0x2B
-#define SCSICMD_Erase10           0x2C
-#define SCSICMD_WriteAndVerify10  0x2E
-#define SCSICMD_Verify10          0x2F
-#define SCSICMD_WriteBuffer       0x3B
-#define SCSICMD_ReadBuffer        0x3C
-#define SCSICMD_ReadLong          0x3E
-#define SCSICMD_WriteLong         0x3F
-#define SCSICMD_ReadTOC           0x43
-#define SCSICMD_ReadHeader        0x44
-#define SCSICMD_ModeSelect10      0x55
-#define SCSICMD_ModeSense10       0x5A
-
-/* Inquiry Data Peripheral Device Types */
-#define SCSI_TYPE_DASD     0x00
-#define SCSI_TYPE_SASD     0x01
-#define SCSI_TYPE_PRN      0x02
-#define SCSI_TYPE_PROC     0x03
-#define SCSI_TYPE_WORM     0x04
-#define SCSI_TYPE_CDROM    0x05
-#define SCSI_TYPE_SCANNER  0x06
-#define SCSI_TYPE_OPTMEM   0x07
-#define SCSI_TYPE_MED_CHG  0x08
-#define SCSI_TYPE_COMM     0x09
-#define SCSI_TYPE_UNKNOWN  0x1F
 
 #define ADV_INQ_CLOCKING_ST_ONLY    0x0
 #define ADV_INQ_CLOCKING_DT_ONLY    0x1
@@ -1047,36 +1002,11 @@ typedef unsigned char uchar;
 #define ASC_SCSIDIR_T2H      0x08
 #define ASC_SCSIDIR_H2T      0x10
 #define ASC_SCSIDIR_NODATA   0x18
-#define SCSI_SENKEY_NO_SENSE      0x00
-#define SCSI_SENKEY_UNDEFINED     0x01
-#define SCSI_SENKEY_NOT_READY     0x02
-#define SCSI_SENKEY_MEDIUM_ERR    0x03
-#define SCSI_SENKEY_HW_ERR        0x04
-#define SCSI_SENKEY_ILLEGAL       0x05
-#define SCSI_SENKEY_ATTENTION     0x06
-#define SCSI_SENKEY_PROTECTED     0x07
-#define SCSI_SENKEY_BLANK         0x08
-#define SCSI_SENKEY_V_UNIQUE      0x09
-#define SCSI_SENKEY_CPY_ABORT     0x0A
-#define SCSI_SENKEY_ABORT         0x0B
-#define SCSI_SENKEY_EQUAL         0x0C
-#define SCSI_SENKEY_VOL_OVERFLOW  0x0D
-#define SCSI_SENKEY_MISCOMP       0x0E
-#define SCSI_SENKEY_RESERVED      0x0F
 #define SCSI_ASC_NOMEDIA          0x3A
 #define ASC_SRB_HOST(x)  ((uchar)((uchar)(x) >> 4))
 #define ASC_SRB_TID(x)   ((uchar)((uchar)(x) & (uchar)0x0F))
 #define ASC_SRB_LUN(x)   ((uchar)((uint)(x) >> 13))
 #define PUT_CDB1(x)   ((uchar)((uint)(x) >> 8))
-#define SS_GOOD              0x00
-#define SS_CHK_CONDITION     0x02
-#define SS_CONDITION_MET     0x04
-#define SS_TARGET_BUSY       0x08
-#define SS_INTERMID          0x10
-#define SS_INTERMID_COND_MET 0x14
-#define SS_RSERV_CONFLICT    0x18
-#define SS_CMD_TERMINATED    0x22
-#define SS_QUEUE_FULL        0x28
 #define MS_CMD_DONE    0x00
 #define MS_EXTEND      0x01
 #define MS_SDTR_LEN    0x03
@@ -1085,26 +1015,6 @@ typedef unsigned char uchar;
 #define MS_WDTR_CODE   0x03
 #define MS_MDP_LEN    0x05
 #define MS_MDP_CODE   0x00
-#define M1_SAVE_DATA_PTR        0x02
-#define M1_RESTORE_PTRS         0x03
-#define M1_DISCONNECT           0x04
-#define M1_INIT_DETECTED_ERR    0x05
-#define M1_ABORT                0x06
-#define M1_MSG_REJECT           0x07
-#define M1_NO_OP                0x08
-#define M1_MSG_PARITY_ERR       0x09
-#define M1_LINK_CMD_DONE        0x0A
-#define M1_LINK_CMD_DONE_WFLAG  0x0B
-#define M1_BUS_DVC_RESET        0x0C
-#define M1_ABORT_TAG            0x0D
-#define M1_CLR_QUEUE            0x0E
-#define M1_INIT_RECOVERY        0x0F
-#define M1_RELEASE_RECOVERY     0x10
-#define M1_KILL_IO_PROC         0x11
-#define M2_QTAG_MSG_SIMPLE      0x20
-#define M2_QTAG_MSG_HEAD        0x21
-#define M2_QTAG_MSG_ORDERED     0x22
-#define M2_IGNORE_WIDE_RESIDUE  0x23
 
 /*
  * Inquiry data structure and bitfield macros
@@ -1576,7 +1486,7 @@ typedef struct asc_dvc_cfg {
     uchar               sdtr_period_offset[ASC_MAX_TID + 1];
     ushort              pci_slot_info;
     uchar               adapter_info[6];
-    struct pci_dev	*pci_dev;
+    struct device	*dev;
 } ASC_DVC_CFG;
 
 #define ASC_DEF_DVC_CNTL       0xFFFF
@@ -3082,7 +2992,7 @@ typedef struct adv_dvc_cfg {
   ushort serial1;           /* EEPROM serial number word 1 */
   ushort serial2;           /* EEPROM serial number word 2 */
   ushort serial3;           /* EEPROM serial number word 3 */
-  struct pci_dev *pci_dev;  /* pointer to the pci dev structure for this board */
+  struct device *dev;  /* pointer to the pci dev structure for this board */
 } ADV_DVC_CFG;
 
 struct adv_dvc_var;
@@ -3581,19 +3491,6 @@ typedef struct {
 
 #define NO_ISA_DMA              0xff        /* No ISA DMA Channel Used */
 
-/*
- * If the Linux kernel version supports freeing initialization code
- * and data after loading, define macros for this purpose. These macros
- * are not used when the driver is built as a module, cf. linux/init.h.
- */
-#if ASC_LINUX_KERNEL24
-#define ASC_INITFUNC(type, func)        type __init func
-#elif ASC_LINUX_KERNEL22
-#define ASC_INITFUNC(type, func)        __initfunc(type func)
-#endif
-#define ASC_INITDATA                    __initdata
-#define ASC_INIT                        __init
-
 #define ASC_INFO_SIZE           128            /* advansys_info() line size */
 
 #ifdef CONFIG_PROC_FS
@@ -3610,8 +3507,6 @@ typedef struct {
         } \
         cp += len; \
     }
-
-#define ASC_MIN(a, b) (((a) < (b)) ? (a) : (b))
 #endif /* CONFIG_PROC_FS */
 
 /* Asc Library return codes */
@@ -3621,7 +3516,7 @@ typedef struct {
 #define ASC_BUSY        0
 #define ASC_ERROR       (-1)
 
-/* Scsi_Cmnd function return codes */
+/* struct scsi_cmnd function return codes */
 #define STATUS_BYTE(byte)   (byte)
 #define MSG_BYTE(byte)      ((byte) << 8)
 #define HOST_BYTE(byte)     ((byte) << 16)
@@ -3638,7 +3533,7 @@ typedef struct {
  *  REQPTIME(reqp) - reqp's time stamp value
  *  REQTIMESTAMP() - system time stamp value
  */
-typedef Scsi_Cmnd            REQ, *REQP;
+typedef struct scsi_cmnd     REQ, *REQP;
 #define REQPNEXT(reqp)       ((REQP) ((reqp)->host_scribble))
 #define REQPNEXTP(reqp)      ((REQP *) &((reqp)->host_scribble))
 #define REQPTID(reqp)        ((reqp)->device->id)
@@ -3685,53 +3580,6 @@ typedef Scsi_Cmnd            REQ, *REQP;
 /* Return non-zero, if the queue is empty. */
 #define ASC_QUEUE_EMPTY(ascq)    ((ascq)->q_tidmask == 0)
 
-/* PCI configuration declarations */
-
-#define PCI_BASE_CLASS_PREDEFINED               0x00
-#define PCI_BASE_CLASS_MASS_STORAGE             0x01
-#define PCI_BASE_CLASS_NETWORK                  0x02
-#define PCI_BASE_CLASS_DISPLAY                  0x03
-#define PCI_BASE_CLASS_MULTIMEDIA               0x04
-#define PCI_BASE_CLASS_MEMORY_CONTROLLER        0x05
-#define PCI_BASE_CLASS_BRIDGE_DEVICE            0x06
-
-/* MASS STORAGE */
-#define PCI_SUB_CLASS_SCSI_CONTROLLER           0x00
-#define PCI_SUB_CLASS_IDE_CONTROLLER            0x01
-#define PCI_SUB_CLASS_FLOPPY_DISK_CONTROLLER    0x02
-#define PCI_SUB_CLASS_IPI_BUS_CONTROLLER        0x03
-#define PCI_SUB_CLASS_OTHER_MASS_CONTROLLER     0x80
-
-/* NETWORK CONTROLLER */
-#define PCI_SUB_CLASS_ETHERNET_CONTROLLER       0x00
-#define PCI_SUB_CLASS_TOKEN_RING_CONTROLLER     0x01
-#define PCI_SUB_CLASS_FDDI_CONTROLLER           0x02
-#define PCI_SUB_CLASS_OTHER_NETWORK_CONTROLLER  0x80
-
-/* DISPLAY CONTROLLER */
-#define PCI_SUB_CLASS_VGA_CONTROLLER            0x00
-#define PCI_SUB_CLASS_XGA_CONTROLLER            0x01
-#define PCI_SUB_CLASS_OTHER_DISPLAY_CONTROLLER  0x80
-
-/* MULTIMEDIA CONTROLLER */
-#define PCI_SUB_CLASS_VIDEO_DEVICE              0x00
-#define PCI_SUB_CLASS_AUDIO_DEVICE              0x01
-#define PCI_SUB_CLASS_OTHER_MULTIMEDIA_DEVICE   0x80
-
-/* MEMORY CONTROLLER */
-#define PCI_SUB_CLASS_RAM_CONTROLLER            0x00
-#define PCI_SUB_CLASS_FLASH_CONTROLLER          0x01
-#define PCI_SUB_CLASS_OTHER_MEMORY_CONTROLLER   0x80
-
-/* BRIDGE CONTROLLER */
-#define PCI_SUB_CLASS_HOST_BRIDGE_CONTROLLER    0x00
-#define PCI_SUB_CLASS_ISA_BRIDGE_CONTROLLER     0x01
-#define PCI_SUB_CLASS_EISA_BRIDGE_CONTROLLER    0x02
-#define PCI_SUB_CLASS_MC_BRIDGE_CONTROLLER      0x03
-#define PCI_SUB_CLASS_PCI_TO_PCI_BRIDGE_CONTROLLER    0x04
-#define PCI_SUB_CLASS_PCMCIA_BRIDGE_CONTROLLER  0x05
-#define PCI_SUB_CLASS_OTHER_BRIDGE_CONTROLLER   0x80
-
 #define PCI_MAX_SLOT            0x1F
 #define PCI_MAX_BUS             0xFF
 #define PCI_IOADDRESS_MASK      0xFFFE
@@ -3744,25 +3592,6 @@ typedef Scsi_Cmnd            REQ, *REQP;
 #define ASC_PCI_DEVICE_ID_2500  0x2500  /* ASC-38C0800 */
 #define ASC_PCI_DEVICE_ID_2700  0x2700  /* ASC-38C1600 */
 
-/* PCI IO Port Addresses to generate special cycle */
-
-#define PCI_CONFIG_ADDRESS_MECH1          0x0CF8
-#define PCI_CONFIG_DATA_MECH1             0x0CFC
-
-#define PCI_CONFIG_FORWARD_REGISTER       0x0CFA    /* 0=type 0; 1=type 1; */
-
-#define PCI_CONFIG_BUS_NUMBER_MASK        0x00FF0000
-#define PCI_CONFIG_DEVICE_FUNCTION_MASK   0x0000FF00
-#define PCI_CONFIG_REGISTER_NUMBER_MASK   0x000000F8
-
-#define PCI_DEVICE_FOUND                0x0000
-#define PCI_DEVICE_NOT_FOUND            0xffff
-
-#define SUBCLASS_OFFSET         0x0A
-#define CLASSCODE_OFFSET        0x0B
-#define VENDORID_OFFSET         0x00
-#define DEVICEID_OFFSET         0x02
-
 #ifndef ADVANSYS_STATS
 #define ASC_STATS(shp, counter)
 #define ASC_STATS_ADD(shp, counter, count)
@@ -4019,7 +3848,7 @@ typedef struct adv_sgblk {
 typedef struct adv_req {
     ADV_SCSI_REQ_Q      scsi_req_q;   /* Adv Library request structure. */
     uchar               align[32];    /* Request structure padding. */
-    Scsi_Cmnd           *cmndp;       /* Mid-Level SCSI command pointer. */
+    struct scsi_cmnd	*cmndp;       /* Mid-Level SCSI command pointer. */
     adv_sgblk_t         *sgblkp;      /* Adv Library scatter-gather pointer. */
     struct adv_req      *next_reqp;   /* Next Request Structure. */
 } adv_req_t;
@@ -4047,7 +3876,7 @@ typedef struct asc_board {
     asc_queue_t          waiting;               /* Waiting command queue */
     asc_queue_t          done;                  /* Done command queue */
     ADV_SCSI_BIT_ID_TYPE init_tidmask;          /* Target init./valid mask */
-    Scsi_Device          *device[ADV_MAX_TID+1]; /* Mid-Level Scsi Device */
+    struct scsi_device	*device[ADV_MAX_TID+1]; /* Mid-Level Scsi Device */
     ushort               reqcnt[ADV_MAX_TID+1]; /* Starvation request count */
     ADV_SCSI_BIT_ID_TYPE queue_full;            /* Queue full mask */
     ushort               queue_full_cnt[ADV_MAX_TID+1]; /* Queue full count */
@@ -4145,19 +3974,6 @@ typedef struct _PCI_CONFIG_SPACE_
 
 /* Note: All driver global data should be initialized. */
 
-#if ASC_LINUX_KERNEL22
-#ifdef CONFIG_PROC_FS
-struct proc_dir_entry proc_scsi_advansys =
-{
-    PROC_SCSI_ADVANSYS,              /* unsigned short low_ino */
-    8,                               /* unsigned short namelen */
-    "advansys",                      /* const char *name */
-    S_IFDIR | S_IRUGO | S_IXUGO,     /* mode_t mode */
-    2                                /* nlink_t nlink */
-};
-#endif /* CONFIG_PROC_FS */
-#endif /* ASC_LINUX_KERNEL22 */
-
 /* Number of boards detected in system. */
 STATIC int asc_board_count = 0;
 STATIC struct Scsi_Host    *asc_host[ASC_NUM_BOARD_SUPPORTED] = { 0 };
@@ -4172,7 +3988,7 @@ STATIC ASC_SCSI_Q asc_scsi_q = { { 0 } };
 STATIC ASC_SG_HEAD asc_sg_head = { 0 };
 
 /* List of supported bus types. */
-STATIC ushort asc_bus[ASC_NUM_BUS] ASC_INITDATA = {
+STATIC ushort asc_bus[ASC_NUM_BUS] __initdata = {
     ASC_IS_ISA,
     ASC_IS_VL,
     ASC_IS_EISA,
@@ -4209,12 +4025,12 @@ STATIC PortAddr     _asc_def_iop_base[];
  */
 
 STATIC irqreturn_t advansys_interrupt(int, void *, struct pt_regs *);
-STATIC int	  advansys_slave_configure(Scsi_Device *);
-STATIC void       asc_scsi_done_list(Scsi_Cmnd *, int from_isr);
-STATIC int        asc_execute_scsi_cmnd(Scsi_Cmnd *);
-STATIC int        asc_build_req(asc_board_t *, Scsi_Cmnd *);
-STATIC int        adv_build_req(asc_board_t *, Scsi_Cmnd *, ADV_SCSI_REQ_Q **);
-STATIC int        adv_get_sglist(asc_board_t *, adv_req_t *, Scsi_Cmnd *);
+STATIC int	  advansys_slave_configure(struct scsi_device *);
+STATIC void       asc_scsi_done_list(struct scsi_cmnd *);
+STATIC int        asc_execute_scsi_cmnd(struct scsi_cmnd *);
+STATIC int        asc_build_req(asc_board_t *, struct scsi_cmnd *);
+STATIC int        adv_build_req(asc_board_t *, struct scsi_cmnd *, ADV_SCSI_REQ_Q **);
+STATIC int        adv_get_sglist(asc_board_t *, adv_req_t *, struct scsi_cmnd *, int);
 STATIC void       asc_isr_callback(ASC_DVC_VAR *, ASC_QDONE_INFO *);
 STATIC void       adv_isr_callback(ADV_DVC_VAR *, ADV_SCSI_REQ_Q *);
 STATIC void       adv_async_callback(ADV_DVC_VAR *, uchar);
@@ -4251,7 +4067,7 @@ STATIC int          asc_prt_target_stats(struct Scsi_Host *, int, char *, int);
 /* Debug function prototypes. */
 #ifdef ADVANSYS_DEBUG
 STATIC void         asc_prt_scsi_host(struct Scsi_Host *);
-STATIC void         asc_prt_scsi_cmnd(Scsi_Cmnd *);
+STATIC void         asc_prt_scsi_cmnd(struct scsi_cmnd *);
 STATIC void         asc_prt_asc_dvc_cfg(ASC_DVC_CFG *);
 STATIC void         asc_prt_asc_dvc_var(ASC_DVC_VAR *);
 STATIC void         asc_prt_asc_scsi_q(ASC_SCSI_Q *);
@@ -4505,10 +4321,8 @@ advansys_proc_info(struct Scsi_Host *shost, char *buffer, char **start,
  * it must not call SCSI mid-level functions including scsi_malloc()
  * and scsi_free().
  */
-ASC_INITFUNC(
-int,
-advansys_detect(Scsi_Host_Template *tpnt)
-)
+int __init
+advansys_detect(struct scsi_host_template *tpnt)
 {
     static int          detect_called = ASC_FALSE;
     int                 iop;
@@ -4526,6 +4340,7 @@ advansys_detect(Scsi_Host_Template *tpnt)
     struct pci_dev      *pci_devicep[ASC_NUM_BOARD_SUPPORTED];
     int                 pci_card_cnt_max = 0;
     int                 pci_card_cnt = 0;
+    struct device	*dev = NULL;
     struct pci_dev      *pci_devp = NULL;
     int                 pci_device_id_cnt = 0;
     unsigned int        pci_device_id[ASC_PCI_DEVICE_ID_CNT] = {
@@ -4550,12 +4365,6 @@ advansys_detect(Scsi_Host_Template *tpnt)
 
     ASC_DBG(1, "advansys_detect: begin\n");
 
-#if ASC_LINUX_KERNEL24
-    tpnt->proc_name = "advansys";
-#elif ASC_LINUX_KERNEL22
-    tpnt->proc_dir = &proc_scsi_advansys;
-#endif
-
     asc_board_count = 0;
 
     /*
@@ -4681,13 +4490,9 @@ advansys_detect(Scsi_Host_Template *tpnt)
                             NULL) {
                             pci_device_id_cnt++;
                         } else {
-#if ASC_LINUX_KERNEL24
                             if (pci_enable_device(pci_devp) == 0) {
                                 pci_devicep[pci_card_cnt_max++] = pci_devp;
                             }
-#elif ASC_LINUX_KERNEL22
-                            pci_devicep[pci_card_cnt_max++] = pci_devp;
-#endif
                         }
                     }
 
@@ -4724,17 +4529,16 @@ advansys_detect(Scsi_Host_Template *tpnt)
                     ASC_DBG2(2,
                         "advansys_detect: devfn %d, bus number %d\n",
                         pci_devp->devfn, pci_devp->bus->number);
-#if ASC_LINUX_KERNEL24
                     iop = pci_resource_start(pci_devp, 0);
-#elif ASC_LINUX_KERNEL22
-                    iop = pci_devp->base_address[0] & PCI_IOADDRESS_MASK;
-#endif
                     ASC_DBG2(1,
                         "advansys_detect: vendorID %X, deviceID %X\n",
                         pci_devp->vendor, pci_devp->device);
                     ASC_DBG2(2, "advansys_detect: iop %X, irqLine %d\n",
                         iop, pci_devp->irq);
                 }
+		if(pci_devp)
+		    dev = &pci_devp->dev;
+
 #endif /* CONFIG_PCI */
                 break;
 
@@ -4765,7 +4569,7 @@ advansys_detect(Scsi_Host_Template *tpnt)
                 continue;
             }
 
-	    scsi_set_device(shp, &pci_devp->dev);
+	    scsi_set_device(shp, dev);
 
             /* Save a pointer to the Scsi_Host of each board found. */
             asc_host[asc_board_count++] = shp;
@@ -4849,11 +4653,7 @@ advansys_detect(Scsi_Host_Template *tpnt)
                     iolen = ADV_38C1600_IOLEN;
                 }
 #ifdef CONFIG_PCI
-#if ASC_LINUX_KERNEL24
                 pci_memory_address = pci_resource_start(pci_devp, 1);
-#elif ASC_LINUX_KERNEL22
-                pci_memory_address = pci_devp->base_address[1];
-#endif
                 ASC_DBG1(1, "advansys_detect: pci_memory_address: 0x%lx\n",
                     (ulong) pci_memory_address);
                 if ((boardp->ioremap_addr =
@@ -4904,7 +4704,8 @@ advansys_detect(Scsi_Host_Template *tpnt)
 #endif /* CONFIG_PROC_FS */
 
             if (ASC_NARROW_BOARD(boardp)) {
-                /*
+		asc_dvc_varp->cfg->dev = dev;
+		/*
                  * Set the board bus type and PCI IRQ before
                  * calling AscInitGetConfig().
                  */
@@ -4926,7 +4727,6 @@ advansys_detect(Scsi_Host_Template *tpnt)
 #ifdef CONFIG_PCI
                 case ASC_IS_PCI:
                     shp->irq = asc_dvc_varp->irq_no = pci_devp->irq;
-                    asc_dvc_varp->cfg->pci_dev = pci_devp;
                     asc_dvc_varp->cfg->pci_slot_info =
                         ASC_PCI_MKID(pci_devp->bus->number,
                             PCI_SLOT(pci_devp->devfn),
@@ -4944,13 +4744,13 @@ advansys_detect(Scsi_Host_Template *tpnt)
                     break;
                 }
             } else {
+                adv_dvc_varp->cfg->dev = dev;
                 /*
                  * For Wide boards set PCI information before calling
                  * AdvInitGetConfig().
                  */
 #ifdef CONFIG_PCI
                 shp->irq = adv_dvc_varp->irq_no = pci_devp->irq;
-                adv_dvc_varp->cfg->pci_dev = pci_devp;
                 adv_dvc_varp->cfg->pci_slot_info =
                     ASC_PCI_MKID(pci_devp->bus->number,
                         PCI_SLOT(pci_devp->devfn),
@@ -5321,11 +5121,7 @@ advansys_detect(Scsi_Host_Template *tpnt)
 
             /* BIOS start address. */
             if (ASC_NARROW_BOARD(boardp)) {
-#if ASC_LINUX_KERNEL24
                 shp->base =
-#elif ASC_LINUX_KERNEL22
-                shp->base = (char *)
-#endif
                         ((ulong) AscGetChipBiosAddress(
                             asc_dvc_varp->iop_base,
                             asc_dvc_varp->bus_type));
@@ -5360,11 +5156,7 @@ advansys_detect(Scsi_Host_Template *tpnt)
                      * Convert x86 realmode code segment to a linear
                      * address by shifting left 4.
                      */
-                    shp->base =
-#if ASC_LINUX_KERNEL22
-                        (char *)
-#endif
-                        ((ulong) boardp->bios_codeseg << 4);
+                    shp->base = ((ulong) boardp->bios_codeseg << 4);
                 } else {
                     shp->base = 0;
                 }
@@ -5385,7 +5177,6 @@ advansys_detect(Scsi_Host_Template *tpnt)
             ASC_DBG2(2,
                 "advansys_detect: request_region port 0x%lx, len 0x%x\n",
                 (ulong) shp->io_port, boardp->asc_n_io_port);
-#if ASC_LINUX_KERNEL24
             if (request_region(shp->io_port, boardp->asc_n_io_port,
                                "advansys") == NULL) {
                 ASC_PRINT3(
@@ -5398,9 +5189,6 @@ advansys_detect(Scsi_Host_Template *tpnt)
                 asc_board_count--;
                 continue;
             }
-#elif ASC_LINUX_KERNEL22
-            request_region(shp->io_port, boardp->asc_n_io_port, "advansys");
-#endif
 
             /* Register DMA Channel for Narrow boards. */
             shp->dma_channel = NO_ISA_DMA; /* Default to no ISA DMA. */
@@ -5810,12 +5598,12 @@ advansys_info(struct Scsi_Host *shp)
  * in the 'scp' result field.
  */
 int
-advansys_queuecommand(Scsi_Cmnd *scp, void (*done)(Scsi_Cmnd *))
+advansys_queuecommand(struct scsi_cmnd *scp, void (*done)(struct scsi_cmnd *))
 {
     struct Scsi_Host    *shp;
     asc_board_t         *boardp;
     ulong               flags;
-    Scsi_Cmnd           *done_scp;
+    struct scsi_cmnd           *done_scp;
 
     shp = scp->device->host;
     boardp = ASC_BOARDP(shp);
@@ -5880,7 +5668,7 @@ advansys_queuecommand(Scsi_Cmnd *scp, void (*done)(Scsi_Cmnd *))
     default:
         done_scp = asc_dequeue_list(&boardp->done, NULL, ASC_TID_ALL);
         /* Interrupts could be enabled here. */
-        asc_scsi_done_list(done_scp, 0);
+        asc_scsi_done_list(done_scp);
         break;
     }
     spin_unlock_irqrestore(&boardp->lock, flags);
@@ -5898,15 +5686,15 @@ advansys_queuecommand(Scsi_Cmnd *scp, void (*done)(Scsi_Cmnd *))
  * required. Returns SUCCESS or FAILED.
  */
 int
-advansys_reset(Scsi_Cmnd *scp)
+advansys_reset(struct scsi_cmnd *scp)
 {
     struct Scsi_Host     *shp;
     asc_board_t          *boardp;
     ASC_DVC_VAR          *asc_dvc_varp;
     ADV_DVC_VAR          *adv_dvc_varp;
     ulong                flags;
-    Scsi_Cmnd            *done_scp = NULL, *last_scp = NULL;
-    Scsi_Cmnd            *tscp, *new_last_scp;
+    struct scsi_cmnd            *done_scp = NULL, *last_scp = NULL;
+    struct scsi_cmnd            *tscp, *new_last_scp;
     int                  status;
     int                  ret = SUCCESS;
 
@@ -6063,7 +5851,7 @@ advansys_reset(Scsi_Cmnd *scp)
      * Complete all the 'done_scp' requests.
      */
     if (done_scp != NULL) {
-        asc_scsi_done_list(done_scp, 0);
+        asc_scsi_done_list(done_scp);
     }
 
     ASC_DBG1(1, "advansys_reset: ret %d\n", ret);
@@ -6149,10 +5937,8 @@ advansys_biosparam(struct scsi_device *sdev, struct block_device *bdev,
  * ints[2] - second argument
  * ...
  */
-ASC_INITFUNC(
-void,
+void __init
 advansys_setup(char *str, int *ints)
-)
 {
     int    i;
 
@@ -6197,7 +5983,7 @@ advansys_setup(char *str, int *ints)
  * --- Loadable Driver Support
  */
 
-static Scsi_Host_Template driver_template = {
+static struct scsi_host_template driver_template = {
     .proc_name                  = "advansys",
 #ifdef CONFIG_PROC_FS
     .proc_info                  = advansys_proc_info,
@@ -6247,8 +6033,8 @@ advansys_interrupt(int irq, void *dev_id, struct pt_regs *regs)
     ulong           flags;
     int             i;
     asc_board_t     *boardp;
-    Scsi_Cmnd       *done_scp = NULL, *last_scp = NULL;
-    Scsi_Cmnd       *new_last_scp;
+    struct scsi_cmnd       *done_scp = NULL, *last_scp = NULL;
+    struct scsi_cmnd       *new_last_scp;
     struct Scsi_Host *shp;
 
     ASC_DBG(1, "advansys_interrupt: begin\n");
@@ -6328,7 +6114,7 @@ advansys_interrupt(int irq, void *dev_id, struct pt_regs *regs)
      * Complete all requests on the done list.
      */
 
-    asc_scsi_done_list(done_scp, 1);
+    asc_scsi_done_list(done_scp);
 
     ASC_DBG(1, "advansys_interrupt: end\n");
     return IRQ_HANDLED;
@@ -6339,7 +6125,7 @@ advansys_interrupt(int irq, void *dev_id, struct pt_regs *regs)
  * specified host adapter.
  */
 STATIC int
-advansys_slave_configure(Scsi_Device *device)
+advansys_slave_configure(struct scsi_device *device)
 {
     asc_board_t        *boardp;
 
@@ -6374,23 +6160,38 @@ advansys_slave_configure(Scsi_Device *device)
  * Interrupts can be enabled on entry.
  */
 STATIC void
-asc_scsi_done_list(Scsi_Cmnd *scp, int from_isr)
+asc_scsi_done_list(struct scsi_cmnd *scp)
 {
-    Scsi_Cmnd    *tscp;
-    ulong	  flags = 0;
+    struct scsi_cmnd    *tscp;
 
     ASC_DBG(2, "asc_scsi_done_list: begin\n");
     while (scp != NULL) {
+	asc_board_t *boardp;
+	struct device *dev;
+
         ASC_DBG1(3, "asc_scsi_done_list: scp 0x%lx\n", (ulong) scp);
         tscp = REQPNEXT(scp);
         scp->host_scribble = NULL;
+
+	boardp = ASC_BOARDP(scp->device->host);
+
+	if (ASC_NARROW_BOARD(boardp))
+	    dev = boardp->dvc_cfg.asc_dvc_cfg.dev;
+	else
+	    dev = boardp->dvc_cfg.adv_dvc_cfg.dev;
+
+	if (scp->use_sg)
+	    dma_unmap_sg(dev, (struct scatterlist *)scp->request_buffer,
+			 scp->use_sg, scp->sc_data_direction);
+	else if (scp->request_bufflen)
+	    dma_unmap_single(dev, scp->SCp.dma_handle,
+			     scp->request_bufflen, scp->sc_data_direction);
+
         ASC_STATS(scp->device->host, done);
         ASC_ASSERT(scp->scsi_done != NULL);
-	if (from_isr)
-	    spin_lock_irqsave(scp->device->host->host_lock, flags);
+
         scp->scsi_done(scp);
-	if (from_isr)
-	    spin_unlock_irqrestore(scp->device->host->host_lock, flags);
+
         scp = tscp;
     }
     ASC_DBG(2, "asc_scsi_done_list: done\n");
@@ -6431,7 +6232,7 @@ asc_scsi_done_list(Scsi_Cmnd *scp, int from_isr)
  *  host driver fields:
  *    SCp - Scsi_Pointer used for command processing status
  *    scsi_done - used to save caller's done function
- *    host_scribble - used for pointer to another Scsi_Cmnd
+ *    host_scribble - used for pointer to another struct scsi_cmnd
  *
  * If this function returns ASC_NOERROR the request has been enqueued
  * on the board's 'active' queue and will be completed from the
@@ -6444,13 +6245,13 @@ asc_scsi_done_list(Scsi_Cmnd *scp, int from_isr)
  * caller on the target's waiting queue and re-tried later.
  */
 STATIC int
-asc_execute_scsi_cmnd(Scsi_Cmnd *scp)
+asc_execute_scsi_cmnd(struct scsi_cmnd *scp)
 {
     asc_board_t        *boardp;
     ASC_DVC_VAR        *asc_dvc_varp;
     ADV_DVC_VAR        *adv_dvc_varp;
     ADV_SCSI_REQ_Q     *adv_scsiqp;
-    Scsi_Device        *device;
+    struct scsi_device *device;
     int                ret;
 
     ASC_DBG2(1, "asc_execute_scsi_cmnd: scp 0x%lx, done 0x%lx\n",
@@ -6617,8 +6418,10 @@ asc_execute_scsi_cmnd(Scsi_Cmnd *scp)
  * queue and return ASC_ERROR.
  */
 STATIC int
-asc_build_req(asc_board_t *boardp, Scsi_Cmnd *scp)
+asc_build_req(asc_board_t *boardp, struct scsi_cmnd *scp)
 {
+    struct device *dev = boardp->dvc_cfg.asc_dvc_cfg.dev;
+
     /*
      * Mutually exclusive access is required to 'asc_scsi_q' and
      * 'asc_sg_head' until after the request is started.
@@ -6626,7 +6429,7 @@ asc_build_req(asc_board_t *boardp, Scsi_Cmnd *scp)
     memset(&asc_scsi_q, 0, sizeof(ASC_SCSI_Q));
 
     /*
-     * Point the ASC_SCSI_Q to the 'Scsi_Cmnd'.
+     * Point the ASC_SCSI_Q to the 'struct scsi_cmnd'.
      */
     asc_scsi_q.q2.srb_ptr = ASC_VADDR_TO_U32(scp);
 
@@ -6665,9 +6468,9 @@ asc_build_req(asc_board_t *boardp, Scsi_Cmnd *scp)
      */
     if ((boardp->dvc_var.asc_dvc_var.cur_dvc_qng[scp->device->id] > 0) &&
         (boardp->reqcnt[scp->device->id] % 255) == 0) {
-        asc_scsi_q.q2.tag_code = M2_QTAG_MSG_ORDERED;
+        asc_scsi_q.q2.tag_code = MSG_ORDERED_TAG;
     } else {
-        asc_scsi_q.q2.tag_code = M2_QTAG_MSG_SIMPLE;
+        asc_scsi_q.q2.tag_code = MSG_SIMPLE_TAG;
     }
 
     /*
@@ -6679,8 +6482,10 @@ asc_build_req(asc_board_t *boardp, Scsi_Cmnd *scp)
          * CDB request of single contiguous buffer.
          */
         ASC_STATS(scp->device->host, cont_cnt);
-        asc_scsi_q.q1.data_addr =
-            cpu_to_le32(virt_to_bus(scp->request_buffer));
+	scp->SCp.dma_handle = scp->request_bufflen ?
+	    dma_map_single(dev, scp->request_buffer,
+			   scp->request_bufflen, scp->sc_data_direction) : 0;
+	asc_scsi_q.q1.data_addr = cpu_to_le32(scp->SCp.dma_handle);
         asc_scsi_q.q1.data_cnt = cpu_to_le32(scp->request_bufflen);
         ASC_STATS_ADD(scp->device->host, cont_xfer,
                       ASC_CEILING(scp->request_bufflen, 512));
@@ -6691,12 +6496,17 @@ asc_build_req(asc_board_t *boardp, Scsi_Cmnd *scp)
          * CDB scatter-gather request list.
          */
         int                     sgcnt;
+	int			use_sg;
         struct scatterlist      *slp;
 
-        if (scp->use_sg > scp->device->host->sg_tablesize) {
+	slp = (struct scatterlist *)scp->request_buffer;
+	use_sg = dma_map_sg(dev, slp, scp->use_sg, scp->sc_data_direction);
+
+	if (use_sg > scp->device->host->sg_tablesize) {
             ASC_PRINT3(
 "asc_build_req: board %d: use_sg %d > sg_tablesize %d\n",
-                boardp->id, scp->use_sg, scp->device->host->sg_tablesize);
+		boardp->id, use_sg, scp->device->host->sg_tablesize);
+	    dma_unmap_sg(dev, slp, scp->use_sg, scp->sc_data_direction);
             scp->result = HOST_BYTE(DID_ERROR);
             asc_enqueue(&boardp->done, scp, ASC_BACK);
             return ASC_ERROR;
@@ -6715,19 +6525,16 @@ asc_build_req(asc_board_t *boardp, Scsi_Cmnd *scp)
         asc_scsi_q.q1.data_cnt = 0;
         asc_scsi_q.q1.data_addr = 0;
         /* This is a byte value, otherwise it would need to be swapped. */
-        asc_sg_head.entry_cnt = asc_scsi_q.q1.sg_queue_cnt = scp->use_sg;
+	asc_sg_head.entry_cnt = asc_scsi_q.q1.sg_queue_cnt = use_sg;
         ASC_STATS_ADD(scp->device->host, sg_elem, asc_sg_head.entry_cnt);
 
         /*
          * Convert scatter-gather list into ASC_SG_HEAD list.
          */
-        slp = (struct scatterlist *) scp->request_buffer;
-        for (sgcnt = 0; sgcnt < scp->use_sg; sgcnt++, slp++) {
-            asc_sg_head.sg_list[sgcnt].addr =
-                cpu_to_le32(virt_to_bus(
-		(unsigned char *)page_address(slp->page) + slp->offset));
-            asc_sg_head.sg_list[sgcnt].bytes = cpu_to_le32(slp->length);
-            ASC_STATS_ADD(scp->device->host, sg_xfer, ASC_CEILING(slp->length, 512));
+	for (sgcnt = 0; sgcnt < use_sg; sgcnt++, slp++) {
+	    asc_sg_head.sg_list[sgcnt].addr = cpu_to_le32(sg_dma_address(slp));
+	    asc_sg_head.sg_list[sgcnt].bytes = cpu_to_le32(sg_dma_len(slp));
+	    ASC_STATS_ADD(scp->device->host, sg_xfer, ASC_CEILING(sg_dma_len(slp), 512));
         }
     }
 
@@ -6748,13 +6555,14 @@ asc_build_req(asc_board_t *boardp, Scsi_Cmnd *scp)
  * to little-endian order.
  */
 STATIC int
-adv_build_req(asc_board_t *boardp, Scsi_Cmnd *scp,
+adv_build_req(asc_board_t *boardp, struct scsi_cmnd *scp,
     ADV_SCSI_REQ_Q **adv_scsiqpp)
 {
     adv_req_t           *reqp;
     ADV_SCSI_REQ_Q      *scsiqp;
     int                 i;
     int                 ret;
+    struct device	*dev = boardp->dvc_cfg.adv_dvc_cfg.dev;
 
     /*
      * Allocate an adv_req_t structure from the board to execute
@@ -6786,7 +6594,7 @@ adv_build_req(asc_board_t *boardp, Scsi_Cmnd *scp,
     scsiqp->srb_ptr = ASC_VADDR_TO_U32(reqp);
 
     /*
-     * Set the adv_req_t 'cmndp' to point to the Scsi_Cmnd structure.
+     * Set the adv_req_t 'cmndp' to point to the struct scsi_cmnd structure.
      */
     reqp->cmndp = scp;
 
@@ -6827,6 +6635,7 @@ adv_build_req(asc_board_t *boardp, Scsi_Cmnd *scp,
      * Build ADV_SCSI_REQ_Q for a contiguous buffer or a scatter-gather
      * buffer command.
      */
+
     scsiqp->data_cnt = cpu_to_le32(scp->request_bufflen);
     scsiqp->vdata_addr = scp->request_buffer;
     scsiqp->data_addr = cpu_to_le32(virt_to_bus(scp->request_buffer));
@@ -6836,6 +6645,17 @@ adv_build_req(asc_board_t *boardp, Scsi_Cmnd *scp,
          * CDB request of single contiguous buffer.
          */
         reqp->sgblkp = NULL;
+	scsiqp->data_cnt = cpu_to_le32(scp->request_bufflen);
+	if (scp->request_bufflen) {
+	    scsiqp->vdata_addr = scp->request_buffer;
+	    scp->SCp.dma_handle =
+	        dma_map_single(dev, scp->request_buffer,
+			       scp->request_bufflen, scp->sc_data_direction);
+	} else {
+	    scsiqp->vdata_addr = 0;
+	    scp->SCp.dma_handle = 0;
+	}
+	scsiqp->data_addr = cpu_to_le32(scp->SCp.dma_handle);
         scsiqp->sg_list_ptr = NULL;
         scsiqp->sg_real_addr = 0;
         ASC_STATS(scp->device->host, cont_cnt);
@@ -6845,10 +6665,17 @@ adv_build_req(asc_board_t *boardp, Scsi_Cmnd *scp,
         /*
          * CDB scatter-gather request list.
          */
-        if (scp->use_sg > ADV_MAX_SG_LIST) {
+	struct scatterlist *slp;
+	int use_sg;
+
+	slp = (struct scatterlist *)scp->request_buffer;
+	use_sg = dma_map_sg(dev, slp, scp->use_sg, scp->sc_data_direction);
+
+	if (use_sg > ADV_MAX_SG_LIST) {
             ASC_PRINT3(
 "adv_build_req: board %d: use_sg %d > ADV_MAX_SG_LIST %d\n",
-                boardp->id, scp->use_sg, scp->device->host->sg_tablesize);
+		boardp->id, use_sg, scp->device->host->sg_tablesize);
+	    dma_unmap_sg(dev, slp, scp->use_sg, scp->sc_data_direction);
             scp->result = HOST_BYTE(DID_ERROR);
             asc_enqueue(&boardp->done, scp, ASC_BACK);
 
@@ -6862,7 +6689,7 @@ adv_build_req(asc_board_t *boardp, Scsi_Cmnd *scp,
             return ASC_ERROR;
         }
 
-        if ((ret = adv_get_sglist(boardp, reqp, scp)) != ADV_SUCCESS) {
+	if ((ret = adv_get_sglist(boardp, reqp, scp, use_sg)) != ADV_SUCCESS) {
             /*
              * Free the adv_req_t structure by adding it back to the
              * board free list.
@@ -6874,7 +6701,7 @@ adv_build_req(asc_board_t *boardp, Scsi_Cmnd *scp,
         }
 
         ASC_STATS(scp->device->host, sg_cnt);
-        ASC_STATS_ADD(scp->device->host, sg_elem, scp->use_sg);
+	ASC_STATS_ADD(scp->device->host, sg_elem, use_sg);
     }
 
     ASC_DBG_PRT_ADV_SCSI_REQ_Q(2, scsiqp);
@@ -6898,7 +6725,7 @@ adv_build_req(asc_board_t *boardp, Scsi_Cmnd *scp,
  *      ADV_ERROR(-1) - SG List creation failed
  */
 STATIC int
-adv_get_sglist(asc_board_t *boardp, adv_req_t *reqp, Scsi_Cmnd *scp)
+adv_get_sglist(asc_board_t *boardp, adv_req_t *reqp, struct scsi_cmnd *scp, int use_sg)
 {
     adv_sgblk_t         *sgblkp;
     ADV_SCSI_REQ_Q      *scsiqp;
@@ -6910,7 +6737,7 @@ adv_get_sglist(asc_board_t *boardp, adv_req_t *reqp, Scsi_Cmnd *scp)
 
     scsiqp = (ADV_SCSI_REQ_Q *) ADV_32BALIGN(&reqp->scsi_req_q);
     slp = (struct scatterlist *) scp->request_buffer;
-    sg_elem_cnt = scp->use_sg;
+    sg_elem_cnt = use_sg;
     prev_sg_block = NULL;
     reqp->sgblkp = NULL;
 
@@ -6982,11 +6809,9 @@ adv_get_sglist(asc_board_t *boardp, adv_req_t *reqp, Scsi_Cmnd *scp)
 
         for (i = 0; i < NO_OF_SG_PER_BLOCK; i++)
         {
-            sg_block->sg_list[i].sg_addr =
-                cpu_to_le32(virt_to_bus(
-                   (unsigned char *)page_address(slp->page) + slp->offset));
-            sg_block->sg_list[i].sg_count = cpu_to_le32(slp->length);
-            ASC_STATS_ADD(scp->device->host, sg_xfer, ASC_CEILING(slp->length, 512));
+	    sg_block->sg_list[i].sg_addr = cpu_to_le32(sg_dma_address(slp));
+	    sg_block->sg_list[i].sg_count = cpu_to_le32(sg_dma_len(slp));
+	    ASC_STATS_ADD(scp->device->host, sg_xfer, ASC_CEILING(sg_dma_len(slp), 512));
 
             if (--sg_elem_cnt == 0)
             {   /* Last ADV_SG_BLOCK and scatter-gather entry. */
@@ -7012,7 +6837,7 @@ STATIC void
 asc_isr_callback(ASC_DVC_VAR *asc_dvc_varp, ASC_QDONE_INFO *qdonep)
 {
     asc_board_t         *boardp;
-    Scsi_Cmnd           *scp;
+    struct scsi_cmnd           *scp;
     struct Scsi_Host    *shp;
     int                 i;
 
@@ -7021,10 +6846,10 @@ asc_isr_callback(ASC_DVC_VAR *asc_dvc_varp, ASC_QDONE_INFO *qdonep)
     ASC_DBG_PRT_ASC_QDONE_INFO(2, qdonep);
 
     /*
-     * Get the Scsi_Cmnd structure and Scsi_Host structure for the
+     * Get the struct scsi_cmnd structure and Scsi_Host structure for the
      * command that has been completed.
      */
-    scp = (Scsi_Cmnd *) ASC_U32_TO_VADDR(qdonep->d2.srb_ptr);
+    scp = (struct scsi_cmnd *) ASC_U32_TO_VADDR(qdonep->d2.srb_ptr);
     ASC_DBG1(1, "asc_isr_callback: scp 0x%lx\n", (ulong) scp);
 
     if (scp == NULL) {
@@ -7079,14 +6904,13 @@ asc_isr_callback(ASC_DVC_VAR *asc_dvc_varp, ASC_QDONE_INFO *qdonep)
          * If an INQUIRY command completed successfully, then call
          * the AscInquiryHandling() function to set-up the device.
          */
-        if (scp->cmnd[0] == SCSICMD_Inquiry && scp->device->lun == 0 &&
+        if (scp->cmnd[0] == INQUIRY && scp->device->lun == 0 &&
             (scp->request_bufflen - qdonep->remain_bytes) >= 8)
         {
             AscInquiryHandling(asc_dvc_varp, scp->device->id & 0x7,
                 (ASC_SCSI_INQUIRY *) scp->request_buffer);
         }
 
-#if ASC_LINUX_KERNEL24
         /*
          * Check for an underrun condition.
          *
@@ -7099,15 +6923,14 @@ asc_isr_callback(ASC_DVC_VAR *asc_dvc_varp, ASC_QDONE_INFO *qdonep)
             (unsigned) qdonep->remain_bytes);
             scp->resid = qdonep->remain_bytes;
         }
-#endif
         break;
 
     case QD_WITH_ERROR:
         ASC_DBG(2, "asc_isr_callback: QD_WITH_ERROR\n");
         switch (qdonep->d3.host_stat) {
         case QHSTA_NO_ERROR:
-            if (qdonep->d3.scsi_stat == SS_CHK_CONDITION) {
-                ASC_DBG(2, "asc_isr_callback: SS_CHK_CONDITION\n");
+            if (qdonep->d3.scsi_stat == SAM_STAT_CHECK_CONDITION) {
+                ASC_DBG(2, "asc_isr_callback: SAM_STAT_CHECK_CONDITION\n");
                 ASC_DBG_PRT_SENSE(2, scp->sense_buffer,
                     sizeof(scp->sense_buffer));
                 /*
@@ -7161,7 +6984,7 @@ asc_isr_callback(ASC_DVC_VAR *asc_dvc_varp, ASC_QDONE_INFO *qdonep)
     }
 
     /*
-     * Because interrupts may be enabled by the 'Scsi_Cmnd' done
+     * Because interrupts may be enabled by the 'struct scsi_cmnd' done
      * function, add the command to the end of the board's done queue.
      * The done function for the command will be called from
      * advansys_interrupt().
@@ -7182,12 +7005,10 @@ adv_isr_callback(ADV_DVC_VAR *adv_dvc_varp, ADV_SCSI_REQ_Q *scsiqp)
     asc_board_t         *boardp;
     adv_req_t           *reqp;
     adv_sgblk_t         *sgblkp;
-    Scsi_Cmnd           *scp;
+    struct scsi_cmnd           *scp;
     struct Scsi_Host    *shp;
     int                 i;
-#if ASC_LINUX_KERNEL24
     ADV_DCNT            resid_cnt;
-#endif
 
 
     ASC_DBG2(1, "adv_isr_callback: adv_dvc_varp 0x%lx, scsiqp 0x%lx\n",
@@ -7207,7 +7028,7 @@ adv_isr_callback(ADV_DVC_VAR *adv_dvc_varp, ADV_SCSI_REQ_Q *scsiqp)
     }
 
     /*
-     * Get the Scsi_Cmnd structure and Scsi_Host structure for the
+     * Get the struct scsi_cmnd structure and Scsi_Host structure for the
      * command that has been completed.
      *
      * Note: The adv_req_t request structure and adv_sgblk_t structure,
@@ -7270,7 +7091,6 @@ adv_isr_callback(ADV_DVC_VAR *adv_dvc_varp, ADV_SCSI_REQ_Q *scsiqp)
         ASC_DBG(2, "adv_isr_callback: QD_NO_ERROR\n");
         scp->result = 0;
 
-#if ASC_LINUX_KERNEL24
         /*
          * Check for an underrun condition.
          *
@@ -7284,15 +7104,14 @@ adv_isr_callback(ADV_DVC_VAR *adv_dvc_varp, ADV_SCSI_REQ_Q *scsiqp)
                 (ulong) resid_cnt);
             scp->resid = resid_cnt;
         }
-#endif
         break;
 
     case QD_WITH_ERROR:
         ASC_DBG(2, "adv_isr_callback: QD_WITH_ERROR\n");
         switch (scsiqp->host_status) {
         case QHSTA_NO_ERROR:
-            if (scsiqp->scsi_status == SS_CHK_CONDITION) {
-                ASC_DBG(2, "adv_isr_callback: SS_CHK_CONDITION\n");
+            if (scsiqp->scsi_status == SAM_STAT_CHECK_CONDITION) {
+                ASC_DBG(2, "adv_isr_callback: SAM_STAT_CHECK_CONDITION\n");
                 ASC_DBG_PRT_SENSE(2, scp->sense_buffer,
                     sizeof(scp->sense_buffer));
                 /*
@@ -7344,7 +7163,7 @@ adv_isr_callback(ADV_DVC_VAR *adv_dvc_varp, ADV_SCSI_REQ_Q *scsiqp)
     }
 
     /*
-     * Because interrupts may be enabled by the 'Scsi_Cmnd' done
+     * Because interrupts may be enabled by the 'struct scsi_cmnd' done
      * function, add the command to the end of the board's done queue.
      * The done function for the command will be called from
      * advansys_interrupt().
@@ -7668,7 +7487,7 @@ asc_rmqueue(asc_queue_t *ascq, REQP reqp)
 /*
  * Execute as many queued requests as possible for the specified queue.
  *
- * Calls asc_execute_scsi_cmnd() to execute a REQP/Scsi_Cmnd.
+ * Calls asc_execute_scsi_cmnd() to execute a REQP/struct scsi_cmnd.
  */
 STATIC void
 asc_execute_queue(asc_queue_t *ascq)
@@ -7688,7 +7507,7 @@ asc_execute_queue(asc_queue_t *ascq)
             if (scan_tidmask & ADV_TID_TO_TIDMASK(i)) {
                 if ((reqp = asc_dequeue(ascq, i)) == NULL) {
                     scan_tidmask &= ~ADV_TID_TO_TIDMASK(i);
-                } else if (asc_execute_scsi_cmnd((Scsi_Cmnd *) reqp)
+                } else if (asc_execute_scsi_cmnd((struct scsi_cmnd *) reqp)
                             == ASC_BUSY) {
                     scan_tidmask &= ~ADV_TID_TO_TIDMASK(i);
                     /*
@@ -8858,7 +8677,7 @@ asc_proc_copy(off_t advoffset, off_t offset, char *curbuf, int leftlen,
             (unsigned) offset, (unsigned) advoffset, cplen);
     if (offset <= advoffset) {
         /* Read offset below current offset, copy everything. */
-        cnt = ASC_MIN(cplen, leftlen);
+        cnt = min(cplen, leftlen);
         ASC_DBG3(2, "asc_proc_copy: curbuf 0x%lx, cp 0x%lx, cnt %d\n",
                 (ulong) curbuf, (ulong) cp, cnt);
         memcpy(curbuf, cp, cnt);
@@ -8866,7 +8685,7 @@ asc_proc_copy(off_t advoffset, off_t offset, char *curbuf, int leftlen,
         /* Read offset within current range, partial copy. */
         cnt = (advoffset + cplen) - offset;
         cp = (cp + cplen) - cnt;
-        cnt = ASC_MIN(cnt, leftlen);
+        cnt = min(cnt, leftlen);
         ASC_DBG3(2, "asc_proc_copy: curbuf 0x%lx, cp 0x%lx, cnt %d\n",
                 (ulong) curbuf, (ulong) cp, cnt);
         memcpy(curbuf, cp, cnt);
@@ -8899,7 +8718,7 @@ asc_prt_line(char *buf, int buflen, char *fmt, ...)
         (void) printk(s);
         ret = 0;
     } else {
-        ret = ASC_MIN(buflen, ret);
+        ret = min(buflen, ret);
         memcpy(buf, s, ret);
     }
     va_end(args);
@@ -9002,16 +8821,14 @@ DvcGetQinfo(PortAddr iop_base, ushort s_addr, uchar *inbuf, int words)
 /*
  * Read a PCI configuration byte.
  */
-ASC_INITFUNC(
-STATIC uchar,
+STATIC uchar __init
 DvcReadPCIConfigByte(
         ASC_DVC_VAR *asc_dvc,
         ushort offset)
-)
 {
 #ifdef CONFIG_PCI
     uchar byte_data;
-    pci_read_config_byte(asc_dvc->cfg->pci_dev, offset, &byte_data);
+    pci_read_config_byte(to_pci_dev(asc_dvc->cfg->dev), offset, &byte_data);
     return byte_data;
 #else /* !defined(CONFIG_PCI) */
     return 0;
@@ -9021,16 +8838,14 @@ DvcReadPCIConfigByte(
 /*
  * Write a PCI configuration byte.
  */
-ASC_INITFUNC(
-STATIC void,
+STATIC void __init
 DvcWritePCIConfigByte(
         ASC_DVC_VAR *asc_dvc,
         ushort offset,
         uchar  byte_data)
-)
 {
 #ifdef CONFIG_PCI
-    pci_write_config_byte(asc_dvc->cfg->pci_dev, offset, byte_data);
+    pci_write_config_byte(to_pci_dev(asc_dvc->cfg->dev), offset, byte_data);
 #endif /* CONFIG_PCI */
 }
 
@@ -9038,13 +8853,10 @@ DvcWritePCIConfigByte(
  * Return the BIOS address of the adapter at the specified
  * I/O port and with the specified bus type.
  */
-ASC_INITFUNC(
-STATIC ushort,
+STATIC ushort __init
 AscGetChipBiosAddress(
         PortAddr iop_base,
-        ushort bus_type
-)
-)
+        ushort bus_type)
 {
     ushort  cfg_lsw;
     ushort  bios_addr;
@@ -9119,16 +8931,14 @@ DvcGetPhyAddr(ADV_DVC_VAR *asc_dvc, ADV_SCSI_REQ_Q *scsiq,
 /*
  * Read a PCI configuration byte.
  */
-ASC_INITFUNC(
-STATIC uchar,
+STATIC uchar __init
 DvcAdvReadPCIConfigByte(
         ADV_DVC_VAR *asc_dvc,
         ushort offset)
-)
 {
 #ifdef CONFIG_PCI
     uchar byte_data;
-    pci_read_config_byte(asc_dvc->cfg->pci_dev, offset, &byte_data);
+    pci_read_config_byte(to_pci_dev(asc_dvc->cfg->dev), offset, &byte_data);
     return byte_data;
 #else /* CONFIG_PCI */
     return 0;
@@ -9138,16 +8948,14 @@ DvcAdvReadPCIConfigByte(
 /*
  * Write a PCI configuration byte.
  */
-ASC_INITFUNC(
-STATIC void,
+STATIC void __init
 DvcAdvWritePCIConfigByte(
         ADV_DVC_VAR *asc_dvc,
         ushort offset,
         uchar  byte_data)
-)
 {
 #ifdef CONFIG_PCI
-    pci_write_config_byte(asc_dvc->cfg->pci_dev, offset, byte_data);
+    pci_write_config_byte(to_pci_dev(asc_dvc->cfg->dev), offset, byte_data);
 #else /* CONFIG_PCI */
     return 0;
 #endif /* CONFIG_PCI */
@@ -9358,16 +9166,6 @@ asc_prt_scsi_host(struct Scsi_Host *s)
         s->host_busy, s->host_no,
         (unsigned) s->last_reset);
 
-#if ASC_LINUX_KERNEL24
-    printk(
-" hostt 0x%lx\n",
-        (ulong) s->hostt);
-#elif ASC_LINUX_KERNEL22
-    printk(
-" host_queue 0x%lx, hostt 0x%lx, block 0x%lx,\n",
-        (ulong) s->host_queue, (ulong) s->hostt, (ulong) s->block);
-#endif
-
     printk(
 " base 0x%lx, io_port 0x%lx, n_io_port %u, irq 0x%x,\n",
         (ulong) s->base, (ulong) s->io_port, s->n_io_port, s->irq);
@@ -9393,9 +9191,9 @@ asc_prt_scsi_host(struct Scsi_Host *s)
  * asc_prt_scsi_cmnd()
  */
 STATIC void
-asc_prt_scsi_cmnd(Scsi_Cmnd *s)
+asc_prt_scsi_cmnd(struct scsi_cmnd *s)
 {
-    printk("Scsi_Cmnd at addr 0x%lx\n", (ulong) s);
+    printk("struct scsi_cmnd at addr 0x%lx\n", (ulong) s);
 
     printk(
 " host 0x%lx, device 0x%lx, target %u, lun %u, channel %u,\n",
@@ -9404,11 +9202,9 @@ asc_prt_scsi_cmnd(Scsi_Cmnd *s)
 
     asc_prt_hex(" CDB", s->cmnd, s->cmd_len);
 
-#if ASC_LINUX_KERNEL24
     printk (
 "sc_data_direction %u, resid %d\n",
         s->sc_data_direction, s->resid);
-#endif
 
     printk(
 " use_sg %u, sglist_len %u, abort_reason 0x%x\n",
@@ -9423,15 +9219,7 @@ asc_prt_scsi_cmnd(Scsi_Cmnd *s)
 " timeout_per_command %d, timeout_total %d, timeout %d\n",
         s->timeout_per_command, s->timeout_total, s->timeout);
 
-#if ASC_LINUX_KERNEL24
-    printk(
-" internal_timeout %u, flags %u\n",
-        s->internal_timeout, s->flags);
-#elif ASC_LINUX_KERNEL22
-    printk(
-" internal_timeout %u, flags %u, this_count %d\n",
-        s->internal_timeout, s->flags,s->this_count);
-#endif
+    printk(" internal_timeout %u\n", s->internal_timeout);
 
     printk(
 " scsi_done 0x%lx, done 0x%lx, host_scribble 0x%lx, result 0x%x\n",
@@ -9507,7 +9295,8 @@ asc_prt_asc_dvc_cfg(ASC_DVC_CFG *h)
 
     printk(
 " pci_device_id %d, lib_serial_no %u, lib_version %u, mcode_date 0x%x,\n",
-          h->pci_dev->device, h->lib_serial_no, h->lib_version, h->mcode_date);
+	   to_pci_dev(h->dev)->device, h->lib_serial_no, h->lib_version,
+	   h->mcode_date);
 
     printk(
 " mcode_version %d, overrun_buf 0x%lx\n",
@@ -9632,7 +9421,7 @@ asc_prt_adv_dvc_cfg(ADV_DVC_CFG *h)
 
     printk(
 "  mcode_version 0x%x, pci_device_id 0x%x, lib_version %u\n",
-       h->mcode_version, h->pci_dev->device, h->lib_version);
+       h->mcode_version, to_pci_dev(h->dev)->device, h->lib_version);
 
     printk(
 "  control_flag 0x%x, pci_slot_info 0x%x\n",
@@ -9787,12 +9576,9 @@ asc_prt_hex(char *f, uchar *s, int l)
  * --- Asc Library Functions
  */
 
-ASC_INITFUNC(
-STATIC ushort,
+STATIC ushort __init
 AscGetEisaChipCfg(
-                     PortAddr iop_base
-)
-)
+                     PortAddr iop_base)
 {
     PortAddr            eisa_cfg_iop;
 
@@ -9801,13 +9587,11 @@ AscGetEisaChipCfg(
     return (inpw(eisa_cfg_iop));
 }
 
-ASC_INITFUNC(
-STATIC uchar,
+STATIC uchar __init
 AscSetChipScsiID(
                     PortAddr iop_base,
                     uchar new_host_id
 )
-)
 {
     ushort              cfg_lsw;
 
@@ -9821,12 +9605,9 @@ AscSetChipScsiID(
     return (AscGetChipScsiID(iop_base));
 }
 
-ASC_INITFUNC(
-STATIC uchar,
+STATIC uchar __init
 AscGetChipScsiCtrl(
-                      PortAddr iop_base
-)
-)
+		PortAddr iop_base)
 {
     uchar               sc;
 
@@ -9836,13 +9617,11 @@ AscGetChipScsiCtrl(
     return (sc);
 }
 
-ASC_INITFUNC(
-STATIC uchar,
+STATIC uchar __init
 AscGetChipVersion(
                      PortAddr iop_base,
                      ushort bus_type
 )
-)
 {
     if ((bus_type & ASC_IS_EISA) != 0) {
         PortAddr            eisa_iop;
@@ -9855,12 +9634,9 @@ AscGetChipVersion(
     return (AscGetChipVerNo(iop_base));
 }
 
-ASC_INITFUNC(
-STATIC ushort,
+STATIC ushort __init
 AscGetChipBusType(
-                     PortAddr iop_base
-)
-)
+                     PortAddr iop_base)
 {
     ushort              chip_ver;
 
@@ -9940,22 +9716,19 @@ AscFindSignature(
     return (0);
 }
 
-STATIC PortAddr _asc_def_iop_base[ASC_IOADR_TABLE_MAX_IX] ASC_INITDATA =
+STATIC PortAddr _asc_def_iop_base[ASC_IOADR_TABLE_MAX_IX] __initdata =
 {
     0x100, ASC_IOADR_1, 0x120, ASC_IOADR_2, 0x140, ASC_IOADR_3, ASC_IOADR_4,
     ASC_IOADR_5, ASC_IOADR_6, ASC_IOADR_7, ASC_IOADR_8
 };
 
 #ifdef CONFIG_ISA
-STATIC uchar _isa_pnp_inited ASC_INITDATA = 0;
+STATIC uchar _isa_pnp_inited __initdata = 0;
 
-ASC_INITFUNC(
-STATIC PortAddr,
+STATIC PortAddr __init
 AscSearchIOPortAddr(
                        PortAddr iop_beg,
-                       ushort bus_type
-)
-)
+                       ushort bus_type)
 {
     if (bus_type & ASC_IS_VL) {
         while ((iop_beg = AscSearchIOPortAddr11(iop_beg)) != 0) {
@@ -9986,12 +9759,10 @@ AscSearchIOPortAddr(
     return (0);
 }
 
-ASC_INITFUNC(
-STATIC PortAddr,
+STATIC PortAddr __init
 AscSearchIOPortAddr11(
                          PortAddr s_addr
 )
-)
 {
     int                 i;
     PortAddr            iop_base;
@@ -10017,11 +9788,8 @@ AscSearchIOPortAddr11(
     return (0);
 }
 
-ASC_INITFUNC(
-STATIC void,
-AscSetISAPNPWaitForKey(
-    void)
-)
+STATIC void __init
+AscSetISAPNPWaitForKey(void)
 {
     outp(ASC_ISA_PNP_PORT_ADDR, 0x02);
     outp(ASC_ISA_PNP_PORT_WRITE, 0x02);
@@ -10029,25 +9797,20 @@ AscSetISAPNPWaitForKey(
 }
 #endif /* CONFIG_ISA */
 
-ASC_INITFUNC(
-STATIC void,
+STATIC void __init
 AscToggleIRQAct(
                    PortAddr iop_base
 )
-)
 {
     AscSetChipStatus(iop_base, CIW_IRQ_ACT);
     AscSetChipStatus(iop_base, 0);
     return;
 }
 
-ASC_INITFUNC(
-STATIC uchar,
+STATIC uchar __init
 AscGetChipIRQ(
                  PortAddr iop_base,
-                 ushort bus_type
-)
-)
+                 ushort bus_type)
 {
     ushort              cfg_lsw;
     uchar               chip_irq;
@@ -10077,14 +9840,11 @@ AscGetChipIRQ(
     return ((uchar) (chip_irq + ASC_MIN_IRQ_NO));
 }
 
-ASC_INITFUNC(
-STATIC uchar,
+STATIC uchar __init
 AscSetChipIRQ(
                  PortAddr iop_base,
                  uchar irq_no,
-                 ushort bus_type
-)
-)
+                 ushort bus_type)
 {
     ushort              cfg_lsw;
 
@@ -10119,12 +9879,9 @@ AscSetChipIRQ(
 }
 
 #ifdef CONFIG_ISA
-ASC_INITFUNC(
-STATIC void,
+STATIC void __init
 AscEnableIsaDma(
-                   uchar dma_channel
-)
-)
+                   uchar dma_channel)
 {
     if (dma_channel < 4) {
         outp(0x000B, (ushort) (0xC0 | dma_channel));
@@ -10285,7 +10042,7 @@ AscIsrChipHalted(
             return (0);
         } else {
 
-            ext_msg.msg_type = M1_MSG_REJECT;
+            ext_msg.msg_type = MESSAGE_REJECT;
             AscMemWordCopyPtrToLram(iop_base,
                                  ASCV_MSGOUT_BEG,
                                  (uchar *) &ext_msg,
@@ -10385,7 +10142,7 @@ AscIsrChipHalted(
                              (ushort) ASCV_SCSIBUSY_B, scsi_busy);
             asc_dvc->queue_full_or_busy |= target_id;
 
-            if (scsi_status == SS_QUEUE_FULL) {
+            if (scsi_status == SAM_STAT_TASK_SET_FULL) {
                 if (cur_dvc_qng > ASC_MIN_TAGGED_CMD) {
                     cur_dvc_qng -= 1;
                     asc_dvc->max_dvc_qng[tid_no] = cur_dvc_qng;
@@ -10732,7 +10489,7 @@ AscIsrQDone(
             } else {
                 if ((AscReadLramByte(iop_base,
                           (ushort) (q_addr + (ushort) ASC_SCSIQ_CDB_BEG)) ==
-                     SCSICMD_StartStopUnit)) {
+                     START_STOP)) {
                     asc_dvc->unit_not_ready &= ~target_id;
                     if (scsiq->d3.done_stat != QD_NO_ERROR) {
                         asc_dvc->start_motor &= ~target_id;
@@ -11005,14 +10762,14 @@ STATIC ADV_DCNT _asc_mcode_chksum = 0x012C453FUL;
 #define ASC_SYN_OFFSET_ONE_DISABLE_LIST  16
 STATIC uchar _syn_offset_one_disable_cmd[ASC_SYN_OFFSET_ONE_DISABLE_LIST] =
 {
-    SCSICMD_Inquiry,
-    SCSICMD_RequestSense,
-    SCSICMD_ReadCapacity,
-    SCSICMD_ReadTOC,
-    SCSICMD_ModeSelect6,
-    SCSICMD_ModeSense6,
-    SCSICMD_ModeSelect10,
-    SCSICMD_ModeSense10,
+    INQUIRY,
+    REQUEST_SENSE,
+    READ_CAPACITY,
+    READ_TOC,
+    MODE_SELECT,
+    MODE_SENSE,
+    MODE_SELECT_10,
+    MODE_SENSE_10,
     0xFF,
     0xFF,
     0xFF,
@@ -11065,7 +10822,7 @@ AscExeScsiQueue(
     target_ix = scsiq->q2.target_ix;
     tid_no = ASC_TIX_TO_TID(target_ix);
     n_q_required = 1;
-    if (scsiq->cdbptr[0] == SCSICMD_RequestSense) {
+    if (scsiq->cdbptr[0] == REQUEST_SENSE) {
         if ((asc_dvc->init_sdtr & scsiq->q1.target_id) != 0) {
             asc_dvc->sdtr_done &= ~scsiq->q1.target_id;
             sdtr_data = AscGetMCodeInitSDTRAtID(iop_base, tid_no);
@@ -11134,7 +10891,7 @@ AscExeScsiQueue(
         }
     }
     if (disable_syn_offset_one_fix) {
-        scsiq->q2.tag_code &= ~M2_QTAG_MSG_SIMPLE;
+        scsiq->q2.tag_code &= ~MSG_SIMPLE_TAG;
         scsiq->q2.tag_code |= (ASC_TAG_FLAG_DISABLE_ASYN_USE_SYN_FIX |
                                ASC_TAG_FLAG_DISABLE_DISCONNECT);
     } else {
@@ -11143,8 +10900,8 @@ AscExeScsiQueue(
     if ((scsiq->q1.cntl & QC_SG_HEAD) != 0) {
         if (asc_dvc->bug_fix_cntl) {
             if (asc_dvc->bug_fix_cntl & ASC_BUG_FIX_IF_NOT_DWB) {
-                if ((scsi_cmd == SCSICMD_Read6) ||
-                    (scsi_cmd == SCSICMD_Read10)) {
+                if ((scsi_cmd == READ_6) ||
+                    (scsi_cmd == READ_10)) {
                     addr =
                         (ADV_PADDR) le32_to_cpu(
                             sg_head->sg_list[sg_entry_cnt_minus_one].addr) +
@@ -11193,8 +10950,8 @@ AscExeScsiQueue(
     } else {
         if (asc_dvc->bug_fix_cntl) {
             if (asc_dvc->bug_fix_cntl & ASC_BUG_FIX_IF_NOT_DWB) {
-                if ((scsi_cmd == SCSICMD_Read6) ||
-                    (scsi_cmd == SCSICMD_Read10)) {
+                if ((scsi_cmd == READ_6) ||
+                    (scsi_cmd == READ_10)) {
                     addr = le32_to_cpu(scsiq->q1.data_addr) +
                         le32_to_cpu(scsiq->q1.data_cnt);
                     extra_bytes = (uchar) ((ushort) addr & 0x0003);
@@ -11365,7 +11122,7 @@ AscPutReadyQueue(
     }
     q_addr = ASC_QNO_TO_QADDR(q_no);
     if ((scsiq->q1.target_id & asc_dvc->use_tagged_qng) == 0) {
-        scsiq->q2.tag_code &= ~M2_QTAG_MSG_SIMPLE;
+        scsiq->q2.tag_code &= ~MSG_SIMPLE_TAG ;
     }
     scsiq->q1.status = QS_FREE;
     AscMemWordCopyPtrToLram(iop_base,
@@ -11862,12 +11619,9 @@ DvcDelayNanoSecond(ASC_DVC_VAR *asc_dvc, ASC_DCNT nano_sec)
 }
 
 #ifdef CONFIG_ISA
-ASC_INITFUNC(
-STATIC ASC_DCNT,
+STATIC ASC_DCNT __init
 AscGetEisaProductID(
-                       PortAddr iop_base
-)
-)
+                       PortAddr iop_base)
 {
     PortAddr            eisa_iop;
     ushort              product_id_high, product_id_low;
@@ -11881,12 +11635,9 @@ AscGetEisaProductID(
     return (product_id);
 }
 
-ASC_INITFUNC(
-STATIC PortAddr,
+STATIC PortAddr __init
 AscSearchIOPortAddrEISA(
-                           PortAddr iop_base
-)
-)
+                           PortAddr iop_base)
 {
     ASC_DCNT            eisa_product_id;
 
@@ -12080,12 +11831,9 @@ AscResetChipAndScsiBus(
     return (AscIsChipHalted(iop_base));
 }
 
-ASC_INITFUNC(
-STATIC ASC_DCNT,
+STATIC ASC_DCNT __init
 AscGetMaxDmaCount(
-                     ushort bus_type
-)
-)
+                     ushort bus_type)
 {
     if (bus_type & ASC_IS_ISA)
         return (ASC_MAX_ISA_DMA_COUNT);
@@ -12095,12 +11843,9 @@ AscGetMaxDmaCount(
 }
 
 #ifdef CONFIG_ISA
-ASC_INITFUNC(
-STATIC ushort,
+STATIC ushort __init
 AscGetIsaDmaChannel(
-                       PortAddr iop_base
-)
-)
+                       PortAddr iop_base)
 {
     ushort              channel;
 
@@ -12112,13 +11857,10 @@ AscGetIsaDmaChannel(
     return (channel + 4);
 }
 
-ASC_INITFUNC(
-STATIC ushort,
+STATIC ushort __init
 AscSetIsaDmaChannel(
                        PortAddr iop_base,
-                       ushort dma_channel
-)
-)
+                       ushort dma_channel)
 {
     ushort              cfg_lsw;
     uchar               value;
@@ -12136,13 +11878,10 @@ AscSetIsaDmaChannel(
     return (0);
 }
 
-ASC_INITFUNC(
-STATIC uchar,
+STATIC uchar __init
 AscSetIsaDmaSpeed(
                      PortAddr iop_base,
-                     uchar speed_value
-)
-)
+                     uchar speed_value)
 {
     speed_value &= 0x07;
     AscSetBank(iop_base, 1);
@@ -12151,12 +11890,10 @@ AscSetIsaDmaSpeed(
     return (AscGetIsaDmaSpeed(iop_base));
 }
 
-ASC_INITFUNC(
-STATIC uchar,
+STATIC uchar __init
 AscGetIsaDmaSpeed(
                      PortAddr iop_base
 )
-)
 {
     uchar               speed_value;
 
@@ -12168,12 +11905,10 @@ AscGetIsaDmaSpeed(
 }
 #endif /* CONFIG_ISA */
 
-ASC_INITFUNC(
-STATIC ushort,
+STATIC ushort __init
 AscReadPCIConfigWord(
     ASC_DVC_VAR *asc_dvc,
     ushort pci_config_offset)
-)
 {
     uchar       lsb, msb;
 
@@ -12182,12 +11917,10 @@ AscReadPCIConfigWord(
     return ((ushort) ((msb << 8) | lsb));
 }
 
-ASC_INITFUNC(
-STATIC ushort,
+STATIC ushort __init
 AscInitGetConfig(
         ASC_DVC_VAR *asc_dvc
 )
-)
 {
     ushort              warn_code;
     PortAddr            iop_base;
@@ -12267,12 +12000,10 @@ AscInitGetConfig(
     return(warn_code);
 }
 
-ASC_INITFUNC(
-STATIC ushort,
+STATIC ushort __init
 AscInitSetConfig(
                     ASC_DVC_VAR *asc_dvc
 )
-)
 {
     ushort              warn_code = 0;
 
@@ -12288,12 +12019,10 @@ AscInitSetConfig(
     return (warn_code);
 }
 
-ASC_INITFUNC(
-STATIC ushort,
+STATIC ushort __init
 AscInitFromAscDvcVar(
                         ASC_DVC_VAR *asc_dvc
 )
-)
 {
     PortAddr            iop_base;
     ushort              cfg_msw;
@@ -12301,7 +12030,10 @@ AscInitFromAscDvcVar(
     ushort              pci_device_id;
 
     iop_base = asc_dvc->iop_base;
-    pci_device_id = asc_dvc->cfg->pci_dev->device;
+    if (asc_dvc->cfg->dev)
+        pci_device_id = to_pci_dev(asc_dvc->cfg->dev)->device;
+    else
+	pci_device_id = 0;
     warn_code = 0;
     cfg_msw = AscGetChipCfgMsw(iop_base);
     if ((cfg_msw & ASC_CFG_MSW_CLR_MASK) != 0) {
@@ -12393,12 +12125,9 @@ AscInitAsc1000Driver(
     return (warn_code);
 }
 
-ASC_INITFUNC(
-STATIC ushort,
+STATIC ushort __init
 AscInitAscDvcVar(
-                    ASC_DVC_VAR *asc_dvc
-)
-)
+                    ASC_DVC_VAR *asc_dvc)
 {
     int                 i;
     PortAddr            iop_base;
@@ -12508,12 +12237,8 @@ AscInitAscDvcVar(
     return (warn_code);
 }
 
-ASC_INITFUNC(
-STATIC ushort,
-AscInitFromEEP(
-                  ASC_DVC_VAR *asc_dvc
-)
-)
+STATIC ushort __init
+AscInitFromEEP(ASC_DVC_VAR *asc_dvc)
 {
     ASCEEP_CONFIG       eep_config_buf;
     ASCEEP_CONFIG       *eep_config;
@@ -12729,12 +12454,9 @@ AscInitMicroCodeVar(
     return (warn_code);
 }
 
-ASC_INITFUNC(
-STATIC int,
+STATIC int __init
 AscTestExternalLram(
-                       ASC_DVC_VAR *asc_dvc
-)
-)
+                       ASC_DVC_VAR *asc_dvc)
 {
     PortAddr            iop_base;
     ushort              q_addr;
@@ -12756,13 +12478,11 @@ AscTestExternalLram(
     return (sta);
 }
 
-ASC_INITFUNC(
-STATIC int,
+STATIC int __init
 AscWriteEEPCmdReg(
                      PortAddr iop_base,
                      uchar cmd_reg
 )
-)
 {
     uchar               read_back;
     int                 retry;
@@ -12781,13 +12501,11 @@ AscWriteEEPCmdReg(
     }
 }
 
-ASC_INITFUNC(
-STATIC int,
+STATIC int __init
 AscWriteEEPDataReg(
                       PortAddr iop_base,
                       ushort data_reg
 )
-)
 {
     ushort              read_back;
     int                 retry;
@@ -12806,35 +12524,24 @@ AscWriteEEPDataReg(
     }
 }
 
-ASC_INITFUNC(
-STATIC void,
-AscWaitEEPRead(
-                  void
-)
-)
+STATIC void __init
+AscWaitEEPRead(void)
 {
     DvcSleepMilliSecond(1);
     return;
 }
 
-ASC_INITFUNC(
-STATIC void,
-AscWaitEEPWrite(
-                   void
-)
-)
+STATIC void __init
+AscWaitEEPWrite(void)
 {
     DvcSleepMilliSecond(20);
     return;
 }
 
-ASC_INITFUNC(
-STATIC ushort,
+STATIC ushort __init
 AscReadEEPWord(
                   PortAddr iop_base,
-                  uchar addr
-)
-)
+                  uchar addr)
 {
     ushort              read_wval;
     uchar               cmd_reg;
@@ -12849,14 +12556,11 @@ AscReadEEPWord(
     return (read_wval);
 }
 
-ASC_INITFUNC(
-STATIC ushort,
+STATIC ushort __init
 AscWriteEEPWord(
                    PortAddr iop_base,
                    uchar addr,
-                   ushort word_val
-)
-)
+                   ushort word_val)
 {
     ushort              read_wval;
 
@@ -12876,13 +12580,10 @@ AscWriteEEPWord(
     return (read_wval);
 }
 
-ASC_INITFUNC(
-STATIC ushort,
+STATIC ushort __init
 AscGetEEPConfig(
                    PortAddr iop_base,
-                   ASCEEP_CONFIG * cfg_buf, ushort bus_type
-)
-)
+                   ASCEEP_CONFIG * cfg_buf, ushort bus_type)
 {
     ushort              wval;
     ushort              sum;
@@ -12928,13 +12629,10 @@ AscGetEEPConfig(
     return (sum);
 }
 
-ASC_INITFUNC(
-STATIC int,
+STATIC int __init
 AscSetEEPConfigOnce(
                        PortAddr iop_base,
-                       ASCEEP_CONFIG * cfg_buf, ushort bus_type
-)
-)
+                       ASCEEP_CONFIG * cfg_buf, ushort bus_type)
 {
     int                 n_error;
     ushort              *wbuf;
@@ -13026,13 +12724,11 @@ AscSetEEPConfigOnce(
     return (n_error);
 }
 
-ASC_INITFUNC(
-STATIC int,
+STATIC int __init
 AscSetEEPConfig(
                    PortAddr iop_base,
                    ASCEEP_CONFIG * cfg_buf, ushort bus_type
 )
-)
 {
     int            retry;
     int            n_error;
@@ -13066,17 +12762,17 @@ AscAsyncFix(
     {
         if (!(asc_dvc->init_sdtr & tid_bits))
         {
-            if ((dvc_type == SCSI_TYPE_CDROM) &&
+            if ((dvc_type == TYPE_ROM) &&
                 (AscCompareString((uchar *) inq->vendor_id,
                     (uchar *) "HP ", 3) == 0))
             {
                 asc_dvc->pci_fix_asyn_xfer_always |= tid_bits;
             }
             asc_dvc->pci_fix_asyn_xfer |= tid_bits;
-            if ((dvc_type == SCSI_TYPE_PROC) ||
-                (dvc_type == SCSI_TYPE_SCANNER) ||
-                (dvc_type == SCSI_TYPE_CDROM) ||
-                (dvc_type == SCSI_TYPE_SASD))
+            if ((dvc_type == TYPE_PROCESSOR) ||
+                (dvc_type == TYPE_SCANNER) ||
+                (dvc_type == TYPE_ROM) ||
+                (dvc_type == TYPE_TAPE))
             {
                 asc_dvc->pci_fix_asyn_xfer &= ~tid_bits;
             }
@@ -14470,7 +14166,7 @@ STATIC ADV_DCNT _adv_asc38C1600_chksum =
  * unswapped on big-endian platforms.
  */
 STATIC ADVEEP_3550_CONFIG
-Default_3550_EEPROM_Config ASC_INITDATA = {
+Default_3550_EEPROM_Config __initdata = {
     ADV_EEPROM_BIOS_ENABLE,     /* cfg_lsw */
     0x0000,                     /* cfg_msw */
     0xFFFF,                     /* disc_enable */
@@ -14508,7 +14204,7 @@ Default_3550_EEPROM_Config ASC_INITDATA = {
 };
 
 STATIC ADVEEP_3550_CONFIG
-ADVEEP_3550_Config_Field_IsChar ASC_INITDATA = {
+ADVEEP_3550_Config_Field_IsChar __initdata = {
     0,                          /* cfg_lsw */
     0,                          /* cfg_msw */
     0,                          /* -disc_enable */
@@ -14546,7 +14242,7 @@ ADVEEP_3550_Config_Field_IsChar ASC_INITDATA = {
 };
 
 STATIC ADVEEP_38C0800_CONFIG
-Default_38C0800_EEPROM_Config ASC_INITDATA = {
+Default_38C0800_EEPROM_Config __initdata = {
     ADV_EEPROM_BIOS_ENABLE,     /* 00 cfg_lsw */
     0x0000,                     /* 01 cfg_msw */
     0xFFFF,                     /* 02 disc_enable */
@@ -14611,7 +14307,7 @@ Default_38C0800_EEPROM_Config ASC_INITDATA = {
 };
 
 STATIC ADVEEP_38C0800_CONFIG
-ADVEEP_38C0800_Config_Field_IsChar ASC_INITDATA = {
+ADVEEP_38C0800_Config_Field_IsChar __initdata = {
     0,                          /* 00 cfg_lsw */
     0,                          /* 01 cfg_msw */
     0,                          /* 02 disc_enable */
@@ -14676,7 +14372,7 @@ ADVEEP_38C0800_Config_Field_IsChar ASC_INITDATA = {
 };
 
 STATIC ADVEEP_38C1600_CONFIG
-Default_38C1600_EEPROM_Config ASC_INITDATA = {
+Default_38C1600_EEPROM_Config __initdata = {
     ADV_EEPROM_BIOS_ENABLE,     /* 00 cfg_lsw */
     0x0000,                     /* 01 cfg_msw */
     0xFFFF,                     /* 02 disc_enable */
@@ -14741,7 +14437,7 @@ Default_38C1600_EEPROM_Config ASC_INITDATA = {
 };
 
 STATIC ADVEEP_38C1600_CONFIG
-ADVEEP_38C1600_Config_Field_IsChar ASC_INITDATA = {
+ADVEEP_38C1600_Config_Field_IsChar __initdata = {
     0,                          /* 00 cfg_lsw */
     0,                          /* 01 cfg_msw */
     0,                          /* 02 disc_enable */
@@ -14813,10 +14509,8 @@ ADVEEP_38C1600_Config_Field_IsChar ASC_INITDATA = {
  * For a non-fatal error return a warning code. If there are no warnings
  * then 0 is returned.
  */
-ASC_INITFUNC(
-STATIC int,
+STATIC int __init
 AdvInitGetConfig(ADV_DVC_VAR *asc_dvc)
-)
 {
     ushort      warn_code;
     AdvPortAddr iop_base;
@@ -16800,10 +16494,8 @@ AdvInitAsc38C1600Driver(ADV_DVC_VAR *asc_dvc)
  *
  * Note: Chip is stopped on entry.
  */
-ASC_INITFUNC(
-STATIC int,
+STATIC int __init
 AdvInitFrom3550EEP(ADV_DVC_VAR *asc_dvc)
-)
 {
     AdvPortAddr         iop_base;
     ushort              warn_code;
@@ -16974,10 +16666,8 @@ AdvInitFrom3550EEP(ADV_DVC_VAR *asc_dvc)
  *
  * Note: Chip is stopped on entry.
  */
-ASC_INITFUNC(
-STATIC int,
+STATIC int __init
 AdvInitFrom38C0800EEP(ADV_DVC_VAR *asc_dvc)
-)
 {
     AdvPortAddr              iop_base;
     ushort                   warn_code;
@@ -17209,10 +16899,8 @@ AdvInitFrom38C0800EEP(ADV_DVC_VAR *asc_dvc)
  *
  * Note: Chip is stopped on entry.
  */
-ASC_INITFUNC(
-STATIC int,
+STATIC int __init
 AdvInitFrom38C1600EEP(ADV_DVC_VAR *asc_dvc)
-)
 {
     AdvPortAddr              iop_base;
     ushort                   warn_code;
@@ -17477,10 +17165,8 @@ AdvInitFrom38C1600EEP(ADV_DVC_VAR *asc_dvc)
  *
  * Return a checksum based on the EEPROM configuration read.
  */
-ASC_INITFUNC(
-STATIC ushort,
+STATIC ushort __init
 AdvGet3550EEPConfig(AdvPortAddr iop_base, ADVEEP_3550_CONFIG *cfg_buf)
-)
 {
     ushort              wval, chksum;
     ushort              *wbuf;
@@ -17525,11 +17211,9 @@ AdvGet3550EEPConfig(AdvPortAddr iop_base, ADVEEP_3550_CONFIG *cfg_buf)
  *
  * Return a checksum based on the EEPROM configuration read.
  */
-ASC_INITFUNC(
-STATIC ushort,
+STATIC ushort __init
 AdvGet38C0800EEPConfig(AdvPortAddr iop_base,
                        ADVEEP_38C0800_CONFIG *cfg_buf)
-)
 {
     ushort              wval, chksum;
     ushort              *wbuf;
@@ -17574,11 +17258,9 @@ AdvGet38C0800EEPConfig(AdvPortAddr iop_base,
  *
  * Return a checksum based on the EEPROM configuration read.
  */
-ASC_INITFUNC(
-STATIC ushort,
+STATIC ushort __init
 AdvGet38C1600EEPConfig(AdvPortAddr iop_base,
                        ADVEEP_38C1600_CONFIG *cfg_buf)
-)
 {
     ushort              wval, chksum;
     ushort              *wbuf;
@@ -17621,10 +17303,8 @@ AdvGet38C1600EEPConfig(AdvPortAddr iop_base,
 /*
  * Read the EEPROM from specified location
  */
-ASC_INITFUNC(
-STATIC ushort,
+STATIC ushort __init
 AdvReadEEPWord(AdvPortAddr iop_base, int eep_word_addr)
-)
 {
     AdvWriteWordRegister(iop_base, IOPW_EE_CMD,
         ASC_EEP_CMD_READ | eep_word_addr);
@@ -17635,10 +17315,8 @@ AdvReadEEPWord(AdvPortAddr iop_base, int eep_word_addr)
 /*
  * Wait for EEPROM command to complete
  */
-ASC_INITFUNC(
-STATIC void,
+STATIC void __init
 AdvWaitEEPCmd(AdvPortAddr iop_base)
-)
 {
     int eep_delay_ms;
 
@@ -18290,7 +17968,7 @@ AdvISR(ADV_DVC_VAR *asc_dvc)
          * the device, otherwise may erroneously set *_able bits.
          */
         if (scsiq->done_status == QD_NO_ERROR &&
-            scsiq->cdb[0] == SCSICMD_Inquiry &&
+            scsiq->cdb[0] == INQUIRY &&
             scsiq->target_lun == 0 &&
             (scsiq->cdb[1] & ADV_INQ_RTN_VPD_AND_CMDDT)
                 == ADV_INQ_RTN_STD_INQUIRY_DATA)
diff --git a/drivers/scsi/advansys.h b/drivers/scsi/advansys.h
index b88a2f264..5230ba01c 100644
--- a/drivers/scsi/advansys.h
+++ b/drivers/scsi/advansys.h
@@ -47,14 +47,14 @@
 /*
  * Scsi_Host_Template function prototypes.
  */
-int advansys_detect(Scsi_Host_Template *);
+int advansys_detect(struct scsi_host_template *);
 int advansys_release(struct Scsi_Host *);
 const char *advansys_info(struct Scsi_Host *);
-int advansys_queuecommand(Scsi_Cmnd *, void (* done)(Scsi_Cmnd *));
-int advansys_reset(Scsi_Cmnd *);
+int advansys_queuecommand(struct scsi_cmnd *, void (* done)(struct scsi_cmnd *));
+int advansys_reset(struct scsi_cmnd *);
 int advansys_biosparam(struct scsi_device *, struct block_device *,
 		sector_t, int[]);
-static int advansys_slave_configure(Scsi_Device *);
+static int advansys_slave_configure(struct scsi_device *);
 
 /* init/main.c setup function */
 void advansys_setup(char *, int *);
diff --git a/drivers/scsi/aha152x.c b/drivers/scsi/aha152x.c
index 6a5291b65..d11f86948 100644
--- a/drivers/scsi/aha152x.c
+++ b/drivers/scsi/aha152x.c
@@ -257,7 +257,7 @@
 #include <scsi/scsicam.h>
 
 #include "scsi.h"
-#include "hosts.h"
+#include <scsi/scsi_host.h>
 #include "aha152x.h"
 
 
@@ -422,7 +422,7 @@ MODULE_DEVICE_TABLE(isapnp, id_table);
 #endif /* !PCMCIA */
 
 static int registered_count=0;
-static struct Scsi_Host *aha152x_host[2] = {0, 0};
+static struct Scsi_Host *aha152x_host[2];
 static Scsi_Host_Template aha152x_driver_template;
 
 /*
@@ -647,20 +647,20 @@ static struct {
 	void		(*end)(struct Scsi_Host *);
 	int		spio;
 } states[] = {
-	{ "idle",	0,		0,		0,		0},
-	{ "unknown",	0,		0,		0,		0},
-	{ "seldo",	0,		seldo_run,	0,		0},
-	{ "seldi",	0,		seldi_run,	0,		0},
-	{ "selto",	0,		selto_run,	0,		0},
-	{ "busfree",	0,		busfree_run,	0,		0},
+	{ "idle",	NULL,		NULL,		NULL,		0},
+	{ "unknown",	NULL,		NULL,		NULL,		0},
+	{ "seldo",	NULL,		seldo_run,	NULL,		0},
+	{ "seldi",	NULL,		seldi_run,	NULL,		0},
+	{ "selto",	NULL,		selto_run,	NULL,		0},
+	{ "busfree",	NULL,		busfree_run,	NULL,		0},
 	{ "msgo",	msgo_init,	msgo_run,	msgo_end,	1},
 	{ "cmd",	cmd_init,	cmd_run,	cmd_end,	1},
-	{ "msgi",	0,		msgi_run,	msgi_end,	1},
-	{ "status",	0,		status_run,	0,		1},
+	{ "msgi",	NULL,		msgi_run,	msgi_end,	1},
+	{ "status",	NULL,		status_run,	NULL,		1},
 	{ "datai",	datai_init,	datai_run,	datai_end,	0},
 	{ "datao",	datao_init,	datao_run,	datao_end,	0},
-	{ "parerr",	0,		parerr_run,	0,		0},
-	{ "rsti",	0,		rsti_run,	0,		0},
+	{ "parerr",	NULL,		parerr_run,	NULL,		0},
+	{ "rsti",	NULL,		rsti_run,	NULL,		0},
 };
 
 /* setup & interrupt */
@@ -756,7 +756,7 @@ static inline struct Scsi_Host *lookup_irq(int irqno)
 		if(aha152x_host[i] && aha152x_host[i]->irq==irqno)
 			return aha152x_host[i];
 
-	return 0;
+	return NULL;
 }
 
 static irqreturn_t swintr(int irqno, void *dev_id, struct pt_regs *regs)
@@ -892,7 +892,7 @@ struct Scsi_Host *aha152x_probe_one(struct aha152x_setup *setup)
 		goto out_host_put;
 	}
 
-	if( scsi_add_host(shpnt, 0) ) {
+	if( scsi_add_host(shpnt, NULL) ) {
 		free_irq(shpnt->irq, shpnt);
 		printk(KERN_ERR "aha152x%d: failed to add host.\n", shpnt->host_no);
 		goto out_host_put;
@@ -905,10 +905,10 @@ struct Scsi_Host *aha152x_probe_one(struct aha152x_setup *setup)
 	return shpnt;
 
 out_host_put:
-	aha152x_host[registered_count]=0;
+	aha152x_host[registered_count]=NULL;
 	scsi_host_put(shpnt);
 
-	return 0;
+	return NULL;
 }
 
 void aha152x_release(struct Scsi_Host *shpnt)
@@ -1011,7 +1011,7 @@ static int aha152x_internal_queue(Scsi_Cmnd *SCpnt, struct semaphore *sem, int p
 		}
 	}
 
-	SCNEXT(SCpnt)		= 0;
+	SCNEXT(SCpnt)		= NULL;
 	SCSEM(SCpnt)		= sem;
 
 	/* setup scratch area
@@ -1068,7 +1068,7 @@ static int aha152x_queue(Scsi_Cmnd *SCpnt, void (*done)(Scsi_Cmnd *))
 	}
 #endif
 
-	return aha152x_internal_queue(SCpnt, 0, 0, done);
+	return aha152x_internal_queue(SCpnt, NULL, 0, done);
 }
 
 
@@ -1119,7 +1119,7 @@ static int aha152x_abort(Scsi_Cmnd *SCpnt)
 		DO_UNLOCK(flags);
 
 		kfree(SCpnt->host_scribble);
-		SCpnt->host_scribble=0;
+		SCpnt->host_scribble=NULL;
 
 		return SUCCESS;
 	} 
@@ -1184,7 +1184,7 @@ static int aha152x_device_reset(Scsi_Cmnd * SCpnt)
 
 	SCpnt->cmd_len         = 0;
 	SCpnt->use_sg          = 0;
-	SCpnt->request_buffer  = 0;
+	SCpnt->request_buffer  = NULL;
 	SCpnt->request_bufflen = 0;
 
 	init_timer(&timer);
@@ -1209,7 +1209,7 @@ static int aha152x_device_reset(Scsi_Cmnd * SCpnt)
 		if (!HOSTDATA(shpnt)->commands)
 			SETPORT(PORTA, 0);
 		kfree(SCpnt->host_scribble);
-		SCpnt->host_scribble=0;
+		SCpnt->host_scribble=NULL;
 
 		ret = SUCCESS;
 	} else {
@@ -1241,7 +1241,7 @@ static void free_hard_reset_SCs(struct Scsi_Host *shpnt, Scsi_Cmnd **SCs)
 			next = SCNEXT(ptr);
 		} else {
 			printk(DEBUG_LEAD "queue corrupted at %p\n", CMDINFO(ptr), ptr);
-			next = 0;
+			next = NULL;
 		}
 
 		if (!ptr->device->soft_reset) {
@@ -1249,7 +1249,7 @@ static void free_hard_reset_SCs(struct Scsi_Host *shpnt, Scsi_Cmnd **SCs)
 			remove_SC(SCs, ptr);
 			HOSTDATA(shpnt)->commands--;
 			kfree(ptr->host_scribble);
-			ptr->host_scribble=0;
+			ptr->host_scribble=NULL;
 		}
 
 		ptr = next;
@@ -1386,7 +1386,7 @@ static int aha152x_biosparam(struct scsi_device *sdev, struct block_device *bdev
 				       "aha152x: unable to verify geometry for disk with >1GB.\n"
 				       "         Using default translation. Please verify yourself.\n"
 				       "         Perhaps you need to enable extended translation in the driver.\n"
-				       "         See /usr/src/linux/Documentation/scsi/aha152x.txt for details.\n");
+				       "         See Documentation/scsi/aha152x.txt for details.\n");
 			}
 		} else {
 			info_array[0] = info[0];
@@ -1415,7 +1415,7 @@ static void done(struct Scsi_Host *shpnt, int error)
 			printk(ERR_LEAD "there's already a completed command %p - will cause abort\n", CMDINFO(CURRENT_SC), DONE_SC);
 
 		DONE_SC = CURRENT_SC;
-		CURRENT_SC = 0;
+		CURRENT_SC = NULL;
 		DONE_SC->result = error;
 	} else
 		printk(KERN_ERR "aha152x: done() called outside of command\n");
@@ -1538,7 +1538,7 @@ static void busfree_run(struct Scsi_Host *shpnt)
 #endif
 			append_SC(&DISCONNECTED_SC, CURRENT_SC);
 			CURRENT_SC->SCp.phase |= 1 << 16;
-			CURRENT_SC = 0;
+			CURRENT_SC = NULL;
 
 		} else {
 			done(shpnt, DID_ERROR << 16);
@@ -1586,7 +1586,7 @@ static void busfree_run(struct Scsi_Host *shpnt)
 
 			if(!(DONE_SC->SCp.Status & not_issued)) {
 				Scsi_Cmnd *ptr = DONE_SC;
-				DONE_SC=0;
+				DONE_SC=NULL;
 #if 0
 				DPRINTK(debug_eh, ERR_LEAD "requesting sense\n", CMDINFO(ptr));
 #endif
@@ -1603,7 +1603,7 @@ static void busfree_run(struct Scsi_Host *shpnt)
 				ptr->request_bufflen = sizeof(ptr->sense_buffer);
 			
 				DO_UNLOCK(flags);
-				aha152x_internal_queue(ptr, 0, check_condition, ptr->scsi_done);
+				aha152x_internal_queue(ptr, NULL, check_condition, ptr->scsi_done);
 				DO_LOCK(flags);
 #if 0
 			} else {
@@ -1619,7 +1619,7 @@ static void busfree_run(struct Scsi_Host *shpnt)
 			int lun=DONE_SC->device->lun & 0x7;
 #endif
 			Scsi_Cmnd *ptr = DONE_SC;
-			DONE_SC=0;
+			DONE_SC=NULL;
 
 			/* turn led off, when no commands are in the driver */
 			HOSTDATA(shpnt)->commands--;
@@ -1628,7 +1628,7 @@ static void busfree_run(struct Scsi_Host *shpnt)
 
 			if(ptr->scsi_done != reset_done) {
 				kfree(ptr->host_scribble);
-				ptr->host_scribble=0;
+				ptr->host_scribble=NULL;
 			}
 
 			DO_UNLOCK(flags);
@@ -1638,7 +1638,7 @@ static void busfree_run(struct Scsi_Host *shpnt)
 			DO_LOCK(flags);
 		}
 
-		DONE_SC=0;
+		DONE_SC=NULL;
 #if defined(AHA152X_STAT)
 	} else {
 		HOSTDATA(shpnt)->busfree_without_done_command++;
@@ -1780,7 +1780,7 @@ static void seldi_run(struct Scsi_Host *shpnt)
 		append_SC(&ISSUE_SC, CURRENT_SC);
 		DO_UNLOCK(flags);
 
-		CURRENT_SC = 0;
+		CURRENT_SC = NULL;
 	}
 
 	if(!DISCONNECTED_SC) {
@@ -2503,7 +2503,7 @@ static void rsti_run(struct Scsi_Host *shpnt)
 			remove_SC(&DISCONNECTED_SC, ptr);
 
 			kfree(ptr->host_scribble);
-			ptr->host_scribble=0;
+			ptr->host_scribble=NULL;
 
 			ptr->result =  DID_RESET << 16;
 			ptr->scsi_done(ptr);
@@ -2976,7 +2976,7 @@ static void show_queues(struct Scsi_Host *shpnt)
 		printk(KERN_DEBUG "none\n");
 
 	printk(KERN_DEBUG "disconnected_SC:\n");
-	for (ptr = DISCONNECTED_SC; ptr; ptr = SCDATA(ptr) ? SCNEXT(ptr) : 0)
+	for (ptr = DISCONNECTED_SC; ptr; ptr = SCDATA(ptr) ? SCNEXT(ptr) : NULL)
 		show_command(ptr);
 
 	disp_ports(shpnt);
@@ -3454,7 +3454,7 @@ static int aha152x_proc_info(struct Scsi_Host *shpnt, char *buffer, char **start
 
 	if(thislength<0) {
 		DPRINTK(debug_procinfo, KERN_DEBUG "aha152x_proc_info: output too short\n");
-		*start = 0;
+		*start = NULL;
 		return 0;
 	}
 
@@ -3638,7 +3638,7 @@ static int __init aha152x_init(void)
 	aha152x_config conf;
 #endif
 #ifdef __ISAPNP__
-	struct pnp_dev *dev=0, *pnpdev[2] = {0, 0};
+	struct pnp_dev *dev=NULL, *pnpdev[2] = {NULL, NULL};
 #endif
 
 	if ( setup_count ) {
@@ -3901,7 +3901,7 @@ static int __init aha152x_init(void)
 #if defined(__ISAPNP__)
 			} else if( pnpdev[i] ) {
 				HOSTDATA(shpnt)->pnpdev=pnpdev[i];
-				pnpdev[i]=0;
+				pnpdev[i]=NULL;
 #endif
 			}
 		} else {
@@ -3923,7 +3923,7 @@ static void __exit aha152x_exit(void)
 
 	for(i=0; i<ARRAY_SIZE(setup); i++) {
 		aha152x_release(aha152x_host[i]);
-		aha152x_host[i]=0;
+		aha152x_host[i]=NULL;
 	}
 }
 
diff --git a/drivers/scsi/aha1542.c b/drivers/scsi/aha1542.c
index 030c971f5..4c5e9c38f 100644
--- a/drivers/scsi/aha1542.c
+++ b/drivers/scsi/aha1542.c
@@ -47,7 +47,7 @@
 #include <asm/io.h>
 
 #include "scsi.h"
-#include "hosts.h"
+#include <scsi/scsi_host.h>
 #include "aha1542.h"
 
 #define SCSI_BUF_PA(address)	isa_virt_to_bus(address)
@@ -545,7 +545,7 @@ static void aha1542_intr_handle(struct Scsi_Host *shost, void *dev_id, struct pt
 		my_done = SCtmp->scsi_done;
 		if (SCtmp->host_scribble) {
 			kfree(SCtmp->host_scribble);
-			SCtmp->host_scribble = 0;
+			SCtmp->host_scribble = NULL;
 		}
 		/* Fetch the sense data, and tuck it away, in the required slot.  The
 		   Adaptec automatically fetches it, and there is no guarantee that
@@ -1069,7 +1069,7 @@ static int __init aha1542_detect(Scsi_Host_Template * tpnt)
 	/*
 	 *	Find MicroChannel cards (AHA1640)
 	 */
-#ifdef CONFIG_MCA
+#ifdef CONFIG_MCA_LEGACY
 	if(MCA_bus) {
 		int slot = 0;
 		int pos = 0;
diff --git a/drivers/scsi/aha1740.c b/drivers/scsi/aha1740.c
index 0a2ea05ed..73f33e716 100644
--- a/drivers/scsi/aha1740.c
+++ b/drivers/scsi/aha1740.c
@@ -56,7 +56,7 @@
 #include <asm/io.h>
 
 #include "scsi.h"
-#include "hosts.h"
+#include <scsi/scsi_host.h>
 #include "aha1740.h"
 
 /* IF YOU ARE HAVING PROBLEMS WITH THIS DRIVER, AND WANT TO WATCH
diff --git a/drivers/scsi/aic7xxx/aic79xx_core.c b/drivers/scsi/aic7xxx/aic79xx_core.c
index 611d84b67..4440afca5 100644
--- a/drivers/scsi/aic7xxx/aic79xx_core.c
+++ b/drivers/scsi/aic7xxx/aic79xx_core.c
@@ -173,7 +173,7 @@ static void		ahd_handle_devreset(struct ahd_softc *ahd,
 					    struct ahd_devinfo *devinfo,
 					    u_int lun, cam_status status,
 					    char *message, int verbose_level);
-#if AHD_TARGET_MODE
+#ifdef AHD_TARGET_MODE
 static void		ahd_setup_target_msgin(struct ahd_softc *ahd,
 					       struct ahd_devinfo *devinfo,
 					       struct scb *scb);
@@ -1190,7 +1190,7 @@ ahd_handle_seqint(struct ahd_softc *ahd, u_int intstat)
 					ahd->msgin_index = 0;
 				}
 			}
-#if AHD_TARGET_MODE
+#ifdef AHD_TARGET_MODE
 			else {
 				if (bus_phase == P_MESGOUT) {
 					ahd->msg_type =
@@ -5303,7 +5303,7 @@ ahd_free(struct ahd_softc *ahd)
 
 		tstate = ahd->enabled_targets[i];
 		if (tstate != NULL) {
-#if AHD_TARGET_MODE
+#ifdef AHD_TARGET_MODE
 			int j;
 
 			for (j = 0; j < AHD_NUM_LUNS; j++) {
@@ -5319,7 +5319,7 @@ ahd_free(struct ahd_softc *ahd)
 			free(tstate, M_DEVBUF);
 		}
 	}
-#if AHD_TARGET_MODE
+#ifdef AHD_TARGET_MODE
 	if (ahd->black_hole != NULL) {
 		xpt_free_path(ahd->black_hole->path);
 		free(ahd->black_hole, M_DEVBUF);
@@ -6575,7 +6575,7 @@ ahd_chip_init(struct ahd_softc *ahd)
 	ahd_outb(ahd, CLRSINT3, NTRAMPERR|OSRAMPERR);
 	ahd_outb(ahd, CLRINT, CLRSCSIINT);
 
-#if NEEDS_MORE_TESTING
+#ifdef NEEDS_MORE_TESTING
 	/*
 	 * Always enable abort on incoming L_Qs if this feature is
 	 * supported.  We use this to catch invalid SCB references.
@@ -7157,7 +7157,7 @@ ahd_match_scb(struct ahd_softc *ahd, struct scb *scb, int target,
 	if (match != 0)
 		match = ((lun == slun) || (lun == CAM_LUN_WILDCARD));
 	if (match != 0) {
-#if AHD_TARGET_MODE
+#ifdef AHD_TARGET_MODE
 		int group;
 
 		group = XPT_FC_GROUP(scb->io_ctx->ccb_h.func_code);
@@ -7768,7 +7768,7 @@ ahd_reset_channel(struct ahd_softc *ahd, char channel, int initiate_reset)
 	/* Make sure the sequencer is in a safe location. */
 	ahd_clear_critical_section(ahd);
 
-#if AHD_TARGET_MODE
+#ifdef AHD_TARGET_MODE
 	if ((ahd->flags & AHD_TARGETROLE) != 0) {
 		ahd_run_tqinfifo(ahd, /*paused*/TRUE);
 	}
diff --git a/drivers/scsi/aic7xxx/aic79xx_osm.h b/drivers/scsi/aic7xxx/aic79xx_osm.h
index 9d73eb357..f5c284dd4 100644
--- a/drivers/scsi/aic7xxx/aic79xx_osm.h
+++ b/drivers/scsi/aic7xxx/aic79xx_osm.h
@@ -68,7 +68,7 @@
 /* Core SCSI definitions */
 #define AIC_LIB_PREFIX ahd
 #include "scsi.h"
-#include "hosts.h"
+#include <scsi/scsi_host.h>
 
 /* Name space conflict with BSD queue macros */
 #ifdef LIST_HEAD
@@ -788,7 +788,7 @@ ahd_done_unlock(struct ahd_softc *ahd, unsigned long *flags)
 }
 
 static __inline void
-ahd_list_lockinit()
+ahd_list_lockinit(void)
 {
 	spin_lock_init(&ahd_list_spinlock);
 }
diff --git a/drivers/scsi/aic7xxx/aic7xxx_osm.c b/drivers/scsi/aic7xxx/aic7xxx_osm.c
index 0eb01bd3b..3c7a4854d 100644
--- a/drivers/scsi/aic7xxx/aic7xxx_osm.c
+++ b/drivers/scsi/aic7xxx/aic7xxx_osm.c
@@ -844,7 +844,6 @@ ahc_linux_detect(Scsi_Host_Template *template)
 {
 	struct	ahc_softc *ahc;
 	int     found = 0;
-	int	eisa_err, pci_err;
 
 #if LINUX_VERSION_CODE < KERNEL_VERSION(2,5,0)
 	/*
@@ -892,13 +891,10 @@ ahc_linux_detect(Scsi_Host_Template *template)
 	 */
 	ahc_list_lockinit();
 
-	pci_err = ahc_linux_pci_init();
-	eisa_err = ahc_linux_eisa_init();
-
-	if(pci_err && eisa_err)
-		goto out;
-
-
+	found = ahc_linux_pci_init();
+	if (!ahc_linux_eisa_init())
+		found++;
+	
 	/*
 	 * Register with the SCSI layer all
 	 * controllers we've found.
@@ -908,7 +904,6 @@ ahc_linux_detect(Scsi_Host_Template *template)
 		if (ahc_linux_register_host(ahc, template) == 0)
 			found++;
 	}
-out:
 
 #if LINUX_VERSION_CODE < KERNEL_VERSION(2,5,0)
 	spin_lock_irq(&io_request_lock);
diff --git a/drivers/scsi/aic7xxx/aic7xxx_osm.h b/drivers/scsi/aic7xxx/aic7xxx_osm.h
index 4315120ce..f9c21e704 100644
--- a/drivers/scsi/aic7xxx/aic7xxx_osm.h
+++ b/drivers/scsi/aic7xxx/aic7xxx_osm.h
@@ -85,7 +85,7 @@
 /* Core SCSI definitions */
 #define AIC_LIB_PREFIX ahc
 #include "scsi.h"
-#include "hosts.h"
+#include <scsi/scsi_host.h>
 
 /* Name space conflict with BSD queue macros */
 #ifdef LIST_HEAD
@@ -940,7 +940,7 @@ ahc_get_pci_bus(ahc_dev_softc_t pci)
 }
 #else
 static inline int ahc_linux_pci_init(void) {
-	return -ENODEV;
+	return 0;
 }
 static inline void ahc_linux_pci_exit(void) {
 }
diff --git a/drivers/scsi/aic7xxx/aic7xxx_osm_pci.c b/drivers/scsi/aic7xxx/aic7xxx_osm_pci.c
index 1b575add4..2a6fc40a8 100644
--- a/drivers/scsi/aic7xxx/aic7xxx_osm_pci.c
+++ b/drivers/scsi/aic7xxx/aic7xxx_osm_pci.c
@@ -198,7 +198,8 @@ int
 ahc_linux_pci_init(void)
 {
 #if LINUX_VERSION_CODE >= KERNEL_VERSION(2,4,0)
-	return (pci_module_init(&aic7xxx_pci_driver));
+	/* Translate error or zero return into zero or one */
+	return pci_module_init(&aic7xxx_pci_driver) ? 0 : 1;
 #else
 	struct pci_dev *pdev;
 	u_int class;
diff --git a/drivers/scsi/aic7xxx/aiclib.c b/drivers/scsi/aic7xxx/aiclib.c
index 68a163362..79bfd9efd 100644
--- a/drivers/scsi/aic7xxx/aiclib.c
+++ b/drivers/scsi/aic7xxx/aiclib.c
@@ -36,7 +36,7 @@
 
 /* Core SCSI definitions */
 #include "scsi.h"
-#include "hosts.h"
+#include <scsi/scsi_host.h>
 #include "aiclib.h"
 #include "cam.h"
 
diff --git a/drivers/scsi/aic7xxx_old.c b/drivers/scsi/aic7xxx_old.c
index 66069115e..3d6149675 100644
--- a/drivers/scsi/aic7xxx_old.c
+++ b/drivers/scsi/aic7xxx_old.c
@@ -239,7 +239,7 @@
 #include <linux/smp.h>
 #include <linux/interrupt.h>
 #include "scsi.h"
-#include "hosts.h"
+#include <scsi/scsi_host.h>
 #include "aic7xxx_old/aic7xxx.h"
 
 #include "aic7xxx_old/sequencer.h"
@@ -4881,7 +4881,7 @@ aic7xxx_handle_seqint(struct aic7xxx_host *p, unsigned char intstat)
     }
     break;
 
-#if AIC7XXX_NOT_YET 
+#ifdef AIC7XXX_NOT_YET 
     case TRACEPOINT2:
       {
         printk(INFO_LEAD "Tracepoint #2 reached.\n", p->host_no,
@@ -9335,7 +9335,7 @@ aic7xxx_detect(Scsi_Host_Template *template)
                 printk(KERN_INFO "aic7xxx: MMAPed I/O failed, reverting to "
                                  "Programmed I/O.\n");
                 iounmap((void *) (((unsigned long) temp_p->maddr) & PAGE_MASK));
-                temp_p->maddr = 0;
+                temp_p->maddr = NULL;
                 if(temp_p->base == 0)
                 {
                   printk("aic7xxx: <%s> at PCI %d/%d/%d\n", 
@@ -9743,7 +9743,7 @@ skip_pci_controller:
     temp_p->pause = hcntrl | PAUSE | INTEN;
     temp_p->base = base;
     temp_p->mbase = 0;
-    temp_p->maddr = 0;
+    temp_p->maddr = NULL;
     temp_p->pci_bus = 0;
     temp_p->pci_device_fn = slot;
     aic_outb(temp_p, hcntrl | PAUSE, HCNTRL);
diff --git a/drivers/scsi/amiga7xx.c b/drivers/scsi/amiga7xx.c
index 034194e06..5f13546d6 100644
--- a/drivers/scsi/amiga7xx.c
+++ b/drivers/scsi/amiga7xx.c
@@ -25,7 +25,7 @@
 #include <asm/irq.h>
 
 #include "scsi.h"
-#include "hosts.h"
+#include <scsi/scsi_host.h>
 #include "53c7xx.h"
 #include "amiga7xx.h"
 
diff --git a/drivers/scsi/arm/acornscsi.c b/drivers/scsi/arm/acornscsi.c
index 055938fa0..e5e86962f 100644
--- a/drivers/scsi/arm/acornscsi.c
+++ b/drivers/scsi/arm/acornscsi.c
@@ -150,7 +150,7 @@
 #include <asm/ecard.h>
 
 #include "../scsi.h"
-#include "../hosts.h"
+#include <scsi/scsi_host.h>
 #include "acornscsi.h"
 #include "msgqueue.h"
 #include "scsi.h"
diff --git a/drivers/scsi/arm/arxescsi.c b/drivers/scsi/arm/arxescsi.c
index 54de7f5eb..cd5a63ca7 100644
--- a/drivers/scsi/arm/arxescsi.c
+++ b/drivers/scsi/arm/arxescsi.c
@@ -37,7 +37,7 @@
 #include <asm/ecard.h>
 
 #include "../scsi.h"
-#include "../hosts.h"
+#include <scsi/scsi_host.h>
 #include "fas216.h"
 
 struct arxescsi_info {
diff --git a/drivers/scsi/arm/cumana_1.c b/drivers/scsi/arm/cumana_1.c
index aa75d5056..6dad72222 100644
--- a/drivers/scsi/arm/cumana_1.c
+++ b/drivers/scsi/arm/cumana_1.c
@@ -17,7 +17,7 @@
 #include <asm/system.h>
 
 #include "../scsi.h"
-#include "../hosts.h"
+#include <scsi/scsi_host.h>
 
 #include <scsi/scsicam.h>
 
diff --git a/drivers/scsi/arm/cumana_2.c b/drivers/scsi/arm/cumana_2.c
index 89ffb3112..92bfdd9d8 100644
--- a/drivers/scsi/arm/cumana_2.c
+++ b/drivers/scsi/arm/cumana_2.c
@@ -35,7 +35,7 @@
 #include <asm/pgtable.h>
 
 #include "../scsi.h"
-#include "../hosts.h"
+#include <scsi/scsi_host.h>
 #include "fas216.h"
 #include "scsi.h"
 
diff --git a/drivers/scsi/arm/ecoscsi.c b/drivers/scsi/arm/ecoscsi.c
index 7f27e5425..57e79614f 100644
--- a/drivers/scsi/arm/ecoscsi.c
+++ b/drivers/scsi/arm/ecoscsi.c
@@ -33,7 +33,7 @@
 #include <asm/system.h>
 
 #include "../scsi.h"
-#include "../hosts.h"
+#include <scsi/scsi_host.h>
 
 #define NCR5380_implementation_fields	int port, ctrl
 #define NCR5380_local_declare()		struct Scsi_Host *_instance
diff --git a/drivers/scsi/arm/eesox.c b/drivers/scsi/arm/eesox.c
index de4819fe2..530b59c01 100644
--- a/drivers/scsi/arm/eesox.c
+++ b/drivers/scsi/arm/eesox.c
@@ -41,7 +41,7 @@
 #include <asm/pgtable.h>
 
 #include "../scsi.h"
-#include "../hosts.h"
+#include <scsi/scsi_host.h>
 #include "fas216.h"
 #include "scsi.h"
 
diff --git a/drivers/scsi/arm/fas216.c b/drivers/scsi/arm/fas216.c
index 2630125ab..f54b47025 100644
--- a/drivers/scsi/arm/fas216.c
+++ b/drivers/scsi/arm/fas216.c
@@ -52,7 +52,7 @@
 #include <asm/ecard.h>
 
 #include "../scsi.h"
-#include "../hosts.h"
+#include <scsi/scsi_host.h>
 #include "fas216.h"
 #include "scsi.h"
 
diff --git a/drivers/scsi/arm/oak.c b/drivers/scsi/arm/oak.c
index ccca39b69..ecfee930c 100644
--- a/drivers/scsi/arm/oak.c
+++ b/drivers/scsi/arm/oak.c
@@ -17,7 +17,7 @@
 #include <asm/system.h>
 
 #include "../scsi.h"
-#include "../hosts.h"
+#include <scsi/scsi_host.h>
 
 #define AUTOSENSE
 /*#define PSEUDO_DMA*/
diff --git a/drivers/scsi/arm/powertec.c b/drivers/scsi/arm/powertec.c
index e5dd354c4..d53b0c281 100644
--- a/drivers/scsi/arm/powertec.c
+++ b/drivers/scsi/arm/powertec.c
@@ -26,7 +26,7 @@
 #include <asm/pgtable.h>
 
 #include "../scsi.h"
-#include "../hosts.h"
+#include <scsi/scsi_host.h>
 #include "fas216.h"
 #include "scsi.h"
 
diff --git a/drivers/scsi/ata_piix.c b/drivers/scsi/ata_piix.c
index a6588b0f8..c030c0a68 100644
--- a/drivers/scsi/ata_piix.c
+++ b/drivers/scsi/ata_piix.c
@@ -57,6 +57,7 @@ enum {
 	ich5_pata		= 0,
 	ich5_sata		= 1,
 	piix4_pata		= 2,
+	ich6_sata		= 3,
 };
 
 static int piix_init_one (struct pci_dev *pdev,
@@ -91,10 +92,8 @@ static struct pci_device_id piix_pci_tbl[] = {
 	 * and enhanced mode, with queueing and other fancy stuff.
 	 * This is distinguished by PCI class code.
 	 */
-	{ 0x8086, 0x2651, PCI_ANY_ID, PCI_ANY_ID,
-	  PCI_CLASS_STORAGE_IDE << 8, 0xffff00, ich5_sata },
-	{ 0x8086, 0x2652, PCI_ANY_ID, PCI_ANY_ID,
-	  PCI_CLASS_STORAGE_IDE << 8, 0xffff00, ich5_sata },
+	{ 0x8086, 0x2651, PCI_ANY_ID, PCI_ANY_ID, 0, 0, ich6_sata },
+	{ 0x8086, 0x2652, PCI_ANY_ID, PCI_ANY_ID, 0, 0, ich6_sata },
 
 	{ }	/* terminate list */
 };
@@ -138,10 +137,13 @@ static struct ata_port_operations piix_pata_ops = {
 
 	.bmdma_setup		= ata_bmdma_setup_pio,
 	.bmdma_start		= ata_bmdma_start_pio,
-	.fill_sg		= ata_fill_sg,
+	.qc_prep		= ata_qc_prep,
+	.qc_issue		= ata_qc_issue_prot,
+
 	.eng_timeout		= ata_eng_timeout,
 
 	.irq_handler		= ata_interrupt,
+	.irq_clear		= ata_bmdma_irq_clear,
 
 	.port_start		= ata_port_start,
 	.port_stop		= ata_port_stop,
@@ -161,10 +163,13 @@ static struct ata_port_operations piix_sata_ops = {
 
 	.bmdma_setup		= ata_bmdma_setup_pio,
 	.bmdma_start		= ata_bmdma_start_pio,
-	.fill_sg		= ata_fill_sg,
+	.qc_prep		= ata_qc_prep,
+	.qc_issue		= ata_qc_issue_prot,
+
 	.eng_timeout		= ata_eng_timeout,
 
 	.irq_handler		= ata_interrupt,
+	.irq_clear		= ata_bmdma_irq_clear,
 
 	.port_start		= ata_port_start,
 	.port_stop		= ata_port_stop,
@@ -199,6 +204,17 @@ static struct ata_port_info piix_port_info[] = {
 		.udma_mask	= ATA_UDMA_MASK_40C, /* FIXME: cbl det */
 		.port_ops	= &piix_pata_ops,
 	},
+
+	/* ich6_sata */
+	{
+		.sht		= &piix_sht,
+		.host_flags	= ATA_FLAG_SATA | ATA_FLAG_SRST |
+				  PIIX_FLAG_COMBINED | PIIX_FLAG_CHECKINTR |
+				  ATA_FLAG_SLAVE_POSS,
+		.pio_mask	= 0x03,	/* pio3-4 */
+		.udma_mask	= 0x7f,	/* udma0-6 ; FIXME */
+		.port_ops	= &piix_sata_ops,
+	},
 };
 
 static struct pci_bits piix_enable_bits[] = {
@@ -327,13 +343,6 @@ static int piix_sata_probe (struct ata_port *ap)
 
 static void piix_sata_phy_reset(struct ata_port *ap)
 {
-	if (!pci_test_config_bits(ap->host_set->pdev,
-				  &piix_enable_bits[ap->port_no])) {
-		ata_port_disable(ap);
-		printk(KERN_INFO "ata%u: port disabled. ignoring.\n", ap->id);
-		return;
-	}
-
 	if (!piix_sata_probe(ap)) {
 		ata_port_disable(ap);
 		printk(KERN_INFO "ata%u: SATA port has no device.\n", ap->id);
diff --git a/drivers/scsi/atari_scsi.c b/drivers/scsi/atari_scsi.c
index f44a47301..c3d8bc82e 100644
--- a/drivers/scsi/atari_scsi.c
+++ b/drivers/scsi/atari_scsi.c
@@ -102,7 +102,7 @@
 #include <asm/bitops.h>
 
 #include "scsi.h"
-#include "hosts.h"
+#include <scsi/scsi_host.h>
 #include "atari_scsi.h"
 #include "NCR5380.h"
 #include <asm/atari_stdma.h>
diff --git a/drivers/scsi/atp870u.c b/drivers/scsi/atp870u.c
index bd7315824..9cf23b9f2 100644
--- a/drivers/scsi/atp870u.c
+++ b/drivers/scsi/atp870u.c
@@ -1,6 +1,4 @@
-/* $Id: atp870u.c,v 1.0 1997/05/07 15:22:00 root Exp root $
- *  linux/kernel/atp870u.c
- *
+/*
  *  Copyright (C) 1997	Wu Ching Chen
  *  2.1.x update (C) 1998  Krzysztof G. Baranowski
  *  2.5.x update (C) 2002  Red Hat <alan@redhat.com>
@@ -29,20 +27,19 @@
 #include <linux/spinlock.h>
 #include <linux/pci.h>
 #include <linux/blkdev.h>
-#include <linux/stat.h>
-
 #include <asm/system.h>
 #include <asm/io.h>
 
-#include "scsi.h"
-#include "hosts.h"
+#include <scsi/scsi.h>
+#include <scsi/scsi_cmnd.h>
+#include <scsi/scsi_device.h>
+#include <scsi/scsi_host.h>
+
 #include "atp870u.h"
 
-/*
- *   static const char RCSid[] = "$Header: /usr/src/linux/kernel/blk_drv/scsi/RCS/atp870u.c,v 1.0 1997/05/07 15:22:00 root Exp root $";
- */
+static struct scsi_host_template atp870u_template;
+static void send_s870(struct Scsi_Host *host);
 
-static unsigned short int sync_idu;
 
 static irqreturn_t atp870u_intr_handle(int irq, void *dev_id,
 					struct pt_regs *regs)
@@ -51,7 +48,7 @@ static irqreturn_t atp870u_intr_handle(int irq, void *dev_id,
 	unsigned short int tmpcip, id;
 	unsigned char i, j, target_id, lun;
 	unsigned char *prd;
-	Scsi_Cmnd *workrequ;
+	struct scsi_cmnd *workrequ;
 	unsigned int workportu, tmport;
 	unsigned long adrcntu, k;
 	int errstus;
@@ -348,10 +345,18 @@ go_42:
 			 *      Complete the command
 			 */
 			 
-			if(workrequ->use_sg)
-				pci_unmap_sg(dev->pdev, (struct scatterlist *)workrequ->buffer, workrequ->use_sg, scsi_to_pci_dma_dir(workrequ->sc_data_direction));
-			else if(workrequ->request_bufflen && workrequ->sc_data_direction != SCSI_DATA_NONE)
-				pci_unmap_single(dev->pdev, workrequ->SCp.dma_handle, workrequ->request_bufflen, scsi_to_pci_dma_dir(workrequ->sc_data_direction));
+			if (workrequ->use_sg) {
+				pci_unmap_sg(dev->pdev,
+					(struct scatterlist *)workrequ->buffer,
+					workrequ->use_sg,
+					workrequ->sc_data_direction);
+			} else if (workrequ->request_bufflen &&
+					workrequ->sc_data_direction != DMA_NONE) {
+				pci_unmap_single(dev->pdev,
+					workrequ->SCp.dma_handle,
+					workrequ->request_bufflen,
+					workrequ->sc_data_direction);
+			}
 			spin_lock_irqsave(dev->host->host_lock, flags);
 			(*workrequ->scsi_done) (workrequ);
 
@@ -456,7 +461,8 @@ out:
  *	Queue a command to the ATP queue. Called with the host lock held.
  */
  
-static int atp870u_queuecommand(Scsi_Cmnd * req_p, void (*done) (Scsi_Cmnd *))
+static int atp870u_queuecommand(struct scsi_cmnd *req_p,
+		void (*done) (struct scsi_cmnd *))
 {
 	unsigned short int m;
 	unsigned int tmport;
@@ -533,7 +539,7 @@ static int atp870u_queuecommand(Scsi_Cmnd * req_p, void (*done) (Scsi_Cmnd *))
 static void send_s870(struct Scsi_Host *host)
 {
 	unsigned int tmport;
-	Scsi_Cmnd *workrequ;
+	struct scsi_cmnd *workrequ;
 	unsigned int i;
 	unsigned char j, target_id;
 	unsigned char *prd;
@@ -648,7 +654,8 @@ oktosend:
 	if (workrequ->use_sg) {
 		l = 0;
 		sgpnt = (struct scatterlist *) workrequ->request_buffer;
-		sg_count = pci_map_sg(dev->pdev, sgpnt, workrequ->use_sg, scsi_to_pci_dma_dir(workrequ->sc_data_direction));
+		sg_count = pci_map_sg(dev->pdev, sgpnt, workrequ->use_sg,
+				workrequ->sc_data_direction);
 		for (i = 0; i < workrequ->use_sg; i++) {
 			if (sgpnt[i].length == 0 || workrequ->use_sg > ATP870U_SCATTER) {
 				panic("Foooooooood fight!");
@@ -656,7 +663,10 @@ oktosend:
 			l += sgpnt[i].length;
 		}
 	} else if(workrequ->request_bufflen && workrequ->sc_data_direction != PCI_DMA_NONE) {
-		workrequ->SCp.dma_handle = pci_map_single(dev->pdev, workrequ->request_buffer, workrequ->request_bufflen, scsi_to_pci_dma_dir(workrequ->sc_data_direction));
+		workrequ->SCp.dma_handle = pci_map_single(dev->pdev,
+				workrequ->request_buffer,
+				workrequ->request_bufflen,
+				workrequ->sc_data_direction);
 		l = workrequ->request_bufflen;
 	}
 	else l = 0;
@@ -678,7 +688,7 @@ oktosend:
 	/*
 	 *      Check transfer direction
 	 */
-	if (workrequ->sc_data_direction == SCSI_DATA_WRITE) {
+	if (workrequ->sc_data_direction == DMA_TO_DEVICE) {
 		outb((unsigned char) (j | 0x20), tmport++);
 	} else {
 		outb(j, tmport++);
@@ -770,7 +780,7 @@ oktosend:
 	}
 	tmport = workportu + 0x1c;
 
-	if (workrequ->sc_data_direction == SCSI_DATA_WRITE) {
+	if (workrequ->sc_data_direction == DMA_TO_DEVICE) {
 		dev->id[target_id].dirctu = 0x20;
 		if (inb(tmport) == 0) {
 			tmport = workportu + 0x18;
@@ -1089,7 +1099,6 @@ void is870(struct Scsi_Host *host, unsigned int wkport)
 	static unsigned char wide[6] = { 0x80, 1, 2, 3, 1, 0 };
 	struct atp_unit *dev = (struct atp_unit *)&host->hostdata;
 
-	sync_idu = 0;
 	tmport = wkport + 0x3a;
 	outb((unsigned char) (inb(tmport) | 0x10), tmport);
 
@@ -1583,7 +1592,6 @@ static void is880(struct Scsi_Host *host, unsigned int wkport)
 	static unsigned char u3[9] = { 0x80, 1, 6, 4, 0x09, 00, 0x0e, 0x01, 0x02 };
 	struct atp_unit *dev = (struct atp_unit *)&host->hostdata;
 
-	sync_idu = 0;
 	lvdmode = inb(wkport + 0x3f) & 0x40;
 
 	for (i = 0; i < 16; i++) {
@@ -2262,7 +2270,7 @@ static int atp870u_init_tables(struct Scsi_Host *host)
 		dev->sp[k] = 0x04;
 	}
 	return 0;
-}			
+}
 
 /* return non-zero on detection */
 static int atp870u_probe(struct pci_dev *dev, const struct pci_device_id *ent)
@@ -2555,10 +2563,10 @@ unregister:
    it is available to be used again.  Until this gets worked out, we will
    leave it commented out.  */
 
-int atp870u_abort(Scsi_Cmnd * SCpnt)
+static int atp870u_abort(struct scsi_cmnd * SCpnt)
 {
 	unsigned char j, k;
-	Scsi_Cmnd *workrequ;
+	struct scsi_cmnd *workrequ;
 	unsigned int tmport;
 	struct atp_unit *dev = (struct atp_unit *)&SCpnt->device->host->hostdata;
 
@@ -2594,7 +2602,7 @@ int atp870u_abort(Scsi_Cmnd * SCpnt)
 	return SUCCESS;
 }
 
-const char *atp870u_info(struct Scsi_Host *notused)
+static const char *atp870u_info(struct Scsi_Host *notused)
 {
 	static char buffer[128];
 
@@ -2603,13 +2611,9 @@ const char *atp870u_info(struct Scsi_Host *notused)
 	return buffer;
 }
 
-int atp870u_set_info(char *buffer, int length, struct Scsi_Host *HBAptr)
-{
-	return -ENOSYS;		/* Currently this is a no-op */
-}
-
 #define BLS buffer + len + size
-int atp870u_proc_info(struct Scsi_Host *HBAptr, char *buffer, char **start, off_t offset, int length, int inout)
+static int atp870u_proc_info(struct Scsi_Host *HBAptr, char *buffer,
+		char **start, off_t offset, int length, int inout)
 {
 	static u8 buff[512];
 	int size = 0;
@@ -2617,9 +2621,8 @@ int atp870u_proc_info(struct Scsi_Host *HBAptr, char *buffer, char **start, off_
 	off_t begin = 0;
 	off_t pos = 0;
 
-	if (inout == TRUE) {	/* Has data been written to the file? */
-		return (atp870u_set_info(buffer, length, HBAptr));
-	}
+	if (inout)
+		return -ENOSYS;
 	if (offset == 0) {
 		memset(buff, 0, sizeof(buff));
 	}
@@ -2679,7 +2682,7 @@ static void atp870u_remove(struct pci_dev *pdev)
 
 MODULE_LICENSE("GPL");
 
-static Scsi_Host_Template atp870u_template = {
+static struct scsi_host_template atp870u_template = {
 	.module			= THIS_MODULE,
 	.name			= "atp870u",
 	.proc_name		= "atp870u",
@@ -2718,8 +2721,7 @@ static struct pci_driver atp870u_driver = {
 
 static int __init atp870u_init(void)
 {
-	pci_register_driver(&atp870u_driver);
-	return 0;
+	return pci_module_init(&atp870u_driver);
 }
 
 static void __exit atp870u_exit(void)
diff --git a/drivers/scsi/atp870u.h b/drivers/scsi/atp870u.h
index e4fac5e07..ce42a819d 100644
--- a/drivers/scsi/atp870u.h
+++ b/drivers/scsi/atp870u.h
@@ -1,16 +1,6 @@
 #ifndef _ATP870U_H
 #define _ATP870U_H
 
-/* $Id: atp870u.h,v 1.0 1997/05/07 15:09:00 root Exp root $
-
- * Header file for the ACARD 870U/W driver for Linux
- *
- * $Log: atp870u.h,v $
- * Revision 1.0  1997/05/07  15:09:00  root
- * Initial revision
- *
- */
-
 #include <linux/types.h>
 
 /* I/O Port */
@@ -41,7 +31,7 @@ struct atp_unit {
 	unsigned short deviceid;
 	unsigned char ata_cdbu[16];
 	unsigned char sp[16];
-	Scsi_Cmnd *querequ[qcnt];
+	struct scsi_cmnd *querequ[qcnt];
 	struct atp_id {
 		unsigned char dirctu;
 		unsigned char devspu;
@@ -52,20 +42,11 @@ struct atp_unit {
 		unsigned char *prd_posu;
 		unsigned char *prd_tableu;
 		dma_addr_t prd_phys;
-		Scsi_Cmnd *curr_req;
+		struct scsi_cmnd *curr_req;
 	} id[16];
 	struct Scsi_Host *host;
 	struct pci_dev *pdev;
 	unsigned int unit;
 };
 
-static int atp870u_queuecommand(Scsi_Cmnd *, void (*done) (Scsi_Cmnd *));
-static int atp870u_abort(Scsi_Cmnd *);
-static int atp870u_biosparam(struct scsi_device *, struct block_device *,
-		sector_t, int *);
-static void send_s870(struct Scsi_Host *);
-
-extern const char *atp870u_info(struct Scsi_Host *);
-static Scsi_Host_Template atp870u_template;
-
 #endif
diff --git a/drivers/scsi/blz1230.c b/drivers/scsi/blz1230.c
index 195a45084..4cd9fcf4d 100644
--- a/drivers/scsi/blz1230.c
+++ b/drivers/scsi/blz1230.c
@@ -28,7 +28,7 @@
 #include <linux/interrupt.h>
 
 #include "scsi.h"
-#include "hosts.h"
+#include <scsi/scsi_host.h>
 #include "NCR53C9x.h"
 
 #include <linux/zorro.h>
diff --git a/drivers/scsi/blz2060.c b/drivers/scsi/blz2060.c
index 74ea2b794..c5221d0de 100644
--- a/drivers/scsi/blz2060.c
+++ b/drivers/scsi/blz2060.c
@@ -28,7 +28,7 @@
 #include <linux/interrupt.h>
 
 #include "scsi.h"
-#include "hosts.h"
+#include <scsi/scsi_host.h>
 #include "NCR53C9x.h"
 
 #include <linux/zorro.h>
diff --git a/drivers/scsi/bvme6000.c b/drivers/scsi/bvme6000.c
index 2b5a80ce3..29c7ed30c 100644
--- a/drivers/scsi/bvme6000.c
+++ b/drivers/scsi/bvme6000.c
@@ -17,7 +17,7 @@
 #include <asm/irq.h>
 
 #include "scsi.h"
-#include "hosts.h"
+#include <scsi/scsi_host.h>
 #include "53c7xx.h"
 #include "bvme6000.h"
 
diff --git a/drivers/scsi/constants.c b/drivers/scsi/constants.c
index e777bb078..af83e318a 100644
--- a/drivers/scsi/constants.c
+++ b/drivers/scsi/constants.c
@@ -6,13 +6,16 @@
  *   by D. Gilbert and aeb (20020609)
  */
 
-#include <linux/module.h>
-
 #include <linux/config.h>
 #include <linux/blkdev.h>
+#include <linux/module.h>
 #include <linux/kernel.h>
-#include "scsi.h"
-#include "hosts.h"
+
+#include <scsi/scsi.h>
+#include <scsi/scsi_device.h>
+#include <scsi/scsi_host.h>
+#include <scsi/scsi_request.h>
+
 
 #define CONST_COMMAND   0x01
 #define CONST_STATUS    0x02
@@ -154,7 +157,7 @@ static void print_opcode(int opcode) {
 }
 #endif  
 
-void print_command (unsigned char *command) {
+void __scsi_print_command (unsigned char *command) {
     int i,s;
     print_opcode(command[0]);
     for ( i = 1, s = COMMAND_SIZE(command[0]); i < s; ++i) 
@@ -173,7 +176,7 @@ void print_command (unsigned char *command) {
  *	(e.g. "0x2" for Check Condition).
  **/
 void
-print_status(unsigned char scsi_status) {
+scsi_print_status(unsigned char scsi_status) {
 #if (CONSTANTS & CONST_STATUS)
 	const char * ccp;
 
@@ -1014,12 +1017,12 @@ print_sense_internal(const char *devclass,
 #endif
 }
 
-void print_sense(const char *devclass, struct scsi_cmnd *cmd)
+void scsi_print_sense(const char *devclass, struct scsi_cmnd *cmd)
 {
 	print_sense_internal(devclass, cmd->sense_buffer, cmd->request);
 }
 
-void print_req_sense(const char *devclass, struct scsi_request *sreq)
+void scsi_print_req_sense(const char *devclass, struct scsi_request *sreq)
 {
 	print_sense_internal(devclass, sreq->sr_sense_buffer, sreq->sr_request);
 }
@@ -1051,7 +1054,7 @@ static const char *extended_msgs[] = {
 #define NO_EXTENDED_MSGS (sizeof(two_byte_msgs)  / sizeof (const char *))
 #endif /* (CONSTANTS & CONST_MSG) */
 
-int print_msg (const unsigned char *msg) {
+int scsi_print_msg (const unsigned char *msg) {
     int len = 0, i;
     if (msg[0] == EXTENDED_MESSAGE) {
 	len = 3 + msg[1];
@@ -1124,13 +1127,13 @@ int print_msg (const unsigned char *msg) {
     return len;
 }
 
-void print_Scsi_Cmnd(struct scsi_cmnd *cmd) {
+void scsi_print_command(struct scsi_cmnd *cmd) {
     printk("scsi%d : destination target %d, lun %d\n", 
 	   cmd->device->host->host_no, 
 	   cmd->device->id, 
 	   cmd->device->lun);
     printk("        command = ");
-    print_command(cmd->cmnd);
+    __scsi_print_command(cmd->cmnd);
 }
 
 #if (CONSTANTS & CONST_HOST)
@@ -1139,7 +1142,7 @@ static const char * hostbyte_table[]={
 "DID_ABORT", "DID_PARITY", "DID_ERROR", "DID_RESET", "DID_BAD_INTR",
 "DID_PASSTHROUGH", "DID_SOFT_ERROR", "DID_IMM_RETRY", NULL};
 
-void print_hostbyte(int scsiresult)
+void scsi_print_hostbyte(int scsiresult)
 {   static int maxcode=0;
     int i;
    
@@ -1155,7 +1158,7 @@ void print_hostbyte(int scsiresult)
     printk("(%s) ",hostbyte_table[host_byte(scsiresult)]);
 }
 #else
-void print_hostbyte(int scsiresult)
+void scsi_print_hostbyte(int scsiresult)
 {   printk("Hostbyte=0x%02x ",host_byte(scsiresult));
 }
 #endif
@@ -1170,7 +1173,7 @@ static const char * driversuggest_table[]={"SUGGEST_OK",
 unknown,unknown,unknown, "SUGGEST_SENSE",NULL};
 
 
-void print_driverbyte(int scsiresult)
+void scsi_print_driverbyte(int scsiresult)
 {   static int driver_max=0,suggest_max=0;
     int i,dr=driver_byte(scsiresult)&DRIVER_MASK, 
 	su=(driver_byte(scsiresult)&SUGGEST_MASK)>>4;
@@ -1187,7 +1190,7 @@ void print_driverbyte(int scsiresult)
 	su<suggest_max ? driversuggest_table[su]:"invalid");
 }
 #else
-void print_driverbyte(int scsiresult)
+void scsi_print_driverbyte(int scsiresult)
 {   printk("Driverbyte=0x%02x ",driver_byte(scsiresult));
 }
 #endif
diff --git a/drivers/scsi/cpqfcTScontrol.c b/drivers/scsi/cpqfcTScontrol.c
index 9855a8587..a69bd792e 100644
--- a/drivers/scsi/cpqfcTScontrol.c
+++ b/drivers/scsi/cpqfcTScontrol.c
@@ -45,7 +45,7 @@
 #include <linux/spinlock.h>
 
 #include "scsi.h"
-#include "hosts.h"   // Scsi_Host definition for INT handler
+#include <scsi/scsi_host.h>   // Scsi_Host definition for INT handler
 #include "cpqfcTSchip.h"
 #include "cpqfcTSstructs.h"
 
diff --git a/drivers/scsi/cpqfcTSinit.c b/drivers/scsi/cpqfcTSinit.c
index 771c206ea..8778aac34 100644
--- a/drivers/scsi/cpqfcTSinit.c
+++ b/drivers/scsi/cpqfcTSinit.c
@@ -51,7 +51,7 @@
 #include <asm/irq.h>
 #include <linux/spinlock.h>
 #include "scsi.h"
-#include "hosts.h"
+#include <scsi/scsi_host.h>
 #include <scsi/scsi_ioctl.h>
 #include "cpqfcTSchip.h"
 #include "cpqfcTSstructs.h"
@@ -1266,7 +1266,7 @@ static void QueLinkDownCmnd( CPQFCHBA *cpqfcHBAdata, Scsi_Cmnd *Cmnd)
 
 
 
-// The file "hosts.h" says not to call scsi_done from
+// The file <scsi/scsi_host.h> says not to call scsi_done from
 // inside _queuecommand, so we'll do it from the heartbeat timer
 // (clarification: Turns out it's ok to call scsi_done from queuecommand 
 // for cases that don't go to the hardware like scsi cmds destined
diff --git a/drivers/scsi/cpqfcTSworker.c b/drivers/scsi/cpqfcTSworker.c
index 026b613c3..a5fd7427e 100644
--- a/drivers/scsi/cpqfcTSworker.c
+++ b/drivers/scsi/cpqfcTSworker.c
@@ -39,7 +39,7 @@
 #include <asm/dma.h>
 
 #include "scsi.h"
-#include "hosts.h"   // struct Scsi_Host definition for T handler
+#include <scsi/scsi_host.h>   // struct Scsi_Host definition for T handler
 #include "cpqfcTSchip.h"
 #include "cpqfcTSstructs.h"
 #include "cpqfcTStrigger.h"
diff --git a/drivers/scsi/cyberstorm.c b/drivers/scsi/cyberstorm.c
index 61d50bad4..bdbca85d1 100644
--- a/drivers/scsi/cyberstorm.c
+++ b/drivers/scsi/cyberstorm.c
@@ -31,7 +31,7 @@
 #include <linux/interrupt.h>
 
 #include "scsi.h"
-#include "hosts.h"
+#include <scsi/scsi_host.h>
 #include "NCR53C9x.h"
 
 #include <linux/zorro.h>
diff --git a/drivers/scsi/cyberstormII.c b/drivers/scsi/cyberstormII.c
index 0bd553392..845d92598 100644
--- a/drivers/scsi/cyberstormII.c
+++ b/drivers/scsi/cyberstormII.c
@@ -27,7 +27,7 @@
 #include <linux/interrupt.h>
 
 #include "scsi.h"
-#include "hosts.h"
+#include <scsi/scsi_host.h>
 #include "NCR53C9x.h"
 
 #include <linux/zorro.h>
diff --git a/drivers/scsi/dc390.h b/drivers/scsi/dc390.h
index 76fd8b12a..eeaf46a69 100644
--- a/drivers/scsi/dc390.h
+++ b/drivers/scsi/dc390.h
@@ -14,12 +14,9 @@
 #define DC390_H
 
 #include <linux/version.h>
-#ifndef KERNEL_VERSION
-# define KERNEL_VERSION(a,b,c) (((a) << 16) + ((b) << 8) + (c))
-#endif
 
 #define DC390_BANNER "Tekram DC390/AM53C974"
-#define DC390_VERSION "2.1b 2004-04-13"
+#define DC390_VERSION "2.1d 2004-05-27"
 
 /* We don't have eh_abort_handler, eh_device_reset_handler, 
  * eh_bus_reset_handler, eh_host_reset_handler yet! 
@@ -32,14 +29,4 @@
 # define NEW_EH use_new_eh_code: 1,
 # define USE_NEW_EH
 #endif
-
-static int DC390_detect(Scsi_Host_Template *psht);
-static int DC390_queue_command(Scsi_Cmnd *cmd, void (*done)(Scsi_Cmnd *));
-static int DC390_abort(Scsi_Cmnd *cmd);
-static int DC390_reset(Scsi_Cmnd *cmd);
-static int DC390_bios_param(struct scsi_device *sdev, struct block_device *dev,
-		sector_t capacity, int geom[]);
-
-static int DC390_release(struct Scsi_Host *);
-
 #endif /* DC390_H */
diff --git a/drivers/scsi/dc395x.c b/drivers/scsi/dc395x.c
index 2a062f15b..bde847c73 100644
--- a/drivers/scsi/dc395x.c
+++ b/drivers/scsi/dc395x.c
@@ -51,16 +51,20 @@
 #include <linux/delay.h>
 #include <linux/ctype.h>
 #include <linux/blkdev.h>
-#include <asm/io.h>
-#include "scsi.h"
-#include "hosts.h"
-#include "dc395x.h"
-#include <scsi/scsicam.h>	/* needed for scsicam_bios_param */
 #include <linux/interrupt.h>
 #include <linux/init.h>
 #include <linux/spinlock.h>
 #include <linux/pci.h>
 #include <linux/list.h>
+#include <asm/io.h>
+
+#include <scsi/scsi.h>
+#include <scsi/scsicam.h>	/* needed for scsicam_bios_param */
+#include <scsi/scsi_cmnd.h>
+#include <scsi/scsi_device.h>
+#include <scsi/scsi_host.h>
+
+#include "dc395x.h"
 
 #define DC395X_NAME	"dc395x"
 #define DC395X_BANNER	"Tekram DC395(U/UW/F), DC315(U) - ASIC TRM-S1040"
@@ -222,7 +226,7 @@ struct NvRamType {
 struct ScsiReqBlk {
 	struct list_head list;		/* next/prev ptrs for srb lists */
 	struct DeviceCtlBlk *dcb;
-	Scsi_Cmnd *cmd;
+	struct scsi_cmnd *cmd;
 
 	struct SGentry *segment_x;	/* Linear array of hw sg entries (up to 64 entries) */
 	u32 sg_bus_addr;	        /* Bus address of sg list (ie, of segment_x) */
@@ -372,10 +376,10 @@ static void disconnect(struct AdapterCtlBlk *acb);
 static void reselect(struct AdapterCtlBlk *acb);
 static u8 start_scsi(struct AdapterCtlBlk *acb, struct DeviceCtlBlk *dcb,
 		struct ScsiReqBlk *srb);
-static void build_srb(Scsi_Cmnd *cmd, struct DeviceCtlBlk *dcb,
+static void build_srb(struct scsi_cmnd *cmd, struct DeviceCtlBlk *dcb,
 		struct ScsiReqBlk *srb);
 static void doing_srb_done(struct AdapterCtlBlk *acb, u8 did_code,
-		Scsi_Cmnd *cmd, u8 force);
+		struct scsi_cmnd *cmd, u8 force);
 static void scsi_reset_detect(struct AdapterCtlBlk *acb);
 static void pci_unmap_srb(struct AdapterCtlBlk *acb, struct ScsiReqBlk *srb);
 static void pci_unmap_srb_sense(struct AdapterCtlBlk *acb,
@@ -738,7 +742,7 @@ static void free_tag(struct DeviceCtlBlk *dcb, struct ScsiReqBlk *srb)
 
 
 /* Find cmd in SRB list */
-inline static struct ScsiReqBlk *find_cmd(Scsi_Cmnd *cmd, 
+inline static struct ScsiReqBlk *find_cmd(struct scsi_cmnd *cmd, 
 		struct list_head *head)
 {
 	struct ScsiReqBlk *i;
@@ -973,10 +977,10 @@ static void send_srb(struct AdapterCtlBlk *acb, struct ScsiReqBlk *srb)
 
 
 /* Prepare SRB for being sent to Device DCB w/ command *cmd */
-static void build_srb(Scsi_Cmnd *cmd, struct DeviceCtlBlk *dcb,
+static void build_srb(struct scsi_cmnd *cmd, struct DeviceCtlBlk *dcb,
 		struct ScsiReqBlk *srb)
 {
-	int dir = scsi_to_pci_dma_dir(cmd->sc_data_direction);
+	enum dma_data_direction dir = cmd->sc_data_direction;
 	dprintkdbg(DBG_0, "build_srb: (pid#%li) <%02i-%i>\n",
 		cmd->pid, dcb->target_id, dcb->target_lun);
 
@@ -1089,7 +1093,7 @@ static void build_srb(Scsi_Cmnd *cmd, struct DeviceCtlBlk *dcb,
  *        and is expected to be held on return.
  *
  **/
-static int dc395x_queue_command(Scsi_Cmnd *cmd, void (*done)(Scsi_Cmnd *))
+static int dc395x_queue_command(struct scsi_cmnd *cmd, void (*done)(struct scsi_cmnd *))
 {
 	struct DeviceCtlBlk *dcb;
 	struct ScsiReqBlk *srb;
@@ -1304,7 +1308,7 @@ static void reset_dev_param(struct AdapterCtlBlk *acb)
  * @cmd - some command for this host (for fetching hooks)
  * Returns: SUCCESS (0x2002) on success, else FAILED (0x2003).
  */
-static int dc395x_eh_bus_reset(Scsi_Cmnd *cmd)
+static int dc395x_eh_bus_reset(struct scsi_cmnd *cmd)
 {
 	struct AdapterCtlBlk *acb =
 		(struct AdapterCtlBlk *)cmd->device->host->hostdata;
@@ -1356,7 +1360,7 @@ static int dc395x_eh_bus_reset(Scsi_Cmnd *cmd)
  * @cmd - command to be aborted
  * Returns: SUCCESS (0x2002) on success, else FAILED (0x2003).
  */
-static int dc395x_eh_abort(Scsi_Cmnd *cmd)
+static int dc395x_eh_abort(struct scsi_cmnd *cmd)
 {
 	/*
 	 * Look into our command queues: If it has not been sent already,
@@ -1939,7 +1943,7 @@ static void sg_update_list(struct ScsiReqBlk *srb, u32 left)
 {
 	u8 idx;
 	struct scatterlist *sg;
-	Scsi_Cmnd *cmd = srb->cmd;
+	struct scsi_cmnd *cmd = srb->cmd;
 	int segment = cmd->use_sg;
 	u32 xferred = srb->total_xfer_length - left; /* bytes transfered */
 	struct SGentry *psge = srb->segment_x + srb->sg_index;
@@ -3249,8 +3253,8 @@ static void add_dev(struct AdapterCtlBlk *acb, struct DeviceCtlBlk *dcb,
 /* unmap mapped pci regions from SRB */
 static void pci_unmap_srb(struct AdapterCtlBlk *acb, struct ScsiReqBlk *srb)
 {
-	Scsi_Cmnd *cmd = srb->cmd;
-	int dir = scsi_to_pci_dma_dir(cmd->sc_data_direction);
+	struct scsi_cmnd *cmd = srb->cmd;
+	enum dma_data_direction dir = cmd->sc_data_direction;
 	if (cmd->use_sg && dir != PCI_DMA_NONE) {
 		/* unmap DC395x SG list */
 		dprintkdbg(DBG_SG, "pci_unmap_srb: list=%08x(%05x)\n",
@@ -3301,11 +3305,10 @@ static void srb_done(struct AdapterCtlBlk *acb, struct DeviceCtlBlk *dcb,
 		struct ScsiReqBlk *srb)
 {
 	u8 tempcnt, status;
-	Scsi_Cmnd *cmd = srb->cmd;
+	struct scsi_cmnd *cmd = srb->cmd;
 	struct ScsiInqData *ptr;
-	int dir;
+	enum dma_data_direction dir = cmd->sc_data_direction;
 
-	dir = scsi_to_pci_dma_dir(cmd->sc_data_direction);
 	if (cmd->use_sg) {
 		struct scatterlist* sg = (struct scatterlist *)cmd->request_buffer;
 		ptr = (struct ScsiInqData *)(page_address(sg->page) + sg->offset);
@@ -3510,7 +3513,7 @@ static void srb_done(struct AdapterCtlBlk *acb, struct DeviceCtlBlk *dcb,
 
 /* abort all cmds in our queues */
 static void doing_srb_done(struct AdapterCtlBlk *acb, u8 did_flag,
-		Scsi_Cmnd *cmd, u8 force)
+		struct scsi_cmnd *cmd, u8 force)
 {
 	struct DeviceCtlBlk *dcb;
 	dprintkl(KERN_INFO, "doing_srb_done: pids ");
@@ -3518,14 +3521,14 @@ static void doing_srb_done(struct AdapterCtlBlk *acb, u8 did_flag,
 	list_for_each_entry(dcb, &acb->dcb_list, list) {
 		struct ScsiReqBlk *srb;
 		struct ScsiReqBlk *tmp;
-		Scsi_Cmnd *p;
+		struct scsi_cmnd *p;
 
 		list_for_each_entry_safe(srb, tmp, &dcb->srb_going_list, list) {
+			enum dma_data_direction dir;
 			int result;
-			int dir;
 
 			p = srb->cmd;
-			dir = scsi_to_pci_dma_dir(p->sc_data_direction);
+			dir = p->sc_data_direction;
 			result = MK_RES(0, did_flag, 0, 0);
 			printk("G:%li(%02i-%i) ", p->pid,
 			       p->device->id, p->device->lun);
@@ -3665,7 +3668,7 @@ static void scsi_reset_detect(struct AdapterCtlBlk *acb)
 static void request_sense(struct AdapterCtlBlk *acb, struct DeviceCtlBlk *dcb,
 		struct ScsiReqBlk *srb)
 {
-	Scsi_Cmnd *cmd = srb->cmd;
+	struct scsi_cmnd *cmd = srb->cmd;
 	dprintkdbg(DBG_1, "request_sense: (pid#%li) <%02i-%i>\n",
 		cmd->pid, cmd->device->id, cmd->device->lun);
 
@@ -4738,7 +4741,7 @@ static int dc395x_proc_info(struct Scsi_Host *host, char *buffer,
 }
 
 
-static Scsi_Host_Template dc395x_driver_template = {
+static struct scsi_host_template dc395x_driver_template = {
 	.module                 = THIS_MODULE,
 	.proc_name              = DC395X_NAME,
 	.proc_info              = dc395x_proc_info,
diff --git a/drivers/scsi/dec_esp.c b/drivers/scsi/dec_esp.c
index 737b59825..f4bdec16d 100644
--- a/drivers/scsi/dec_esp.c
+++ b/drivers/scsi/dec_esp.c
@@ -29,7 +29,7 @@
 #include <linux/stat.h>
 
 #include "scsi.h"
-#include "hosts.h"
+#include <scsi/scsi_host.h>
 #include "NCR53C9x.h"
 
 #include <asm/irq.h>
diff --git a/drivers/scsi/dmx3191d.c b/drivers/scsi/dmx3191d.c
index ac3b28743..26e060bb8 100644
--- a/drivers/scsi/dmx3191d.c
+++ b/drivers/scsi/dmx3191d.c
@@ -34,7 +34,7 @@
 #include <linux/delay.h>
 
 #include "scsi.h"
-#include "hosts.h"
+#include <scsi/scsi_host.h>
 
 #include "dmx3191d.h"
 
diff --git a/drivers/scsi/dpt_i2o.c b/drivers/scsi/dpt_i2o.c
index 261836da2..77cf39f3b 100644
--- a/drivers/scsi/dpt_i2o.c
+++ b/drivers/scsi/dpt_i2o.c
@@ -68,8 +68,11 @@ MODULE_DESCRIPTION("Adaptec I2O RAID Driver");
 #include <asm/pgtable.h>
 #include <asm/io.h>		/* for virt_to_bus, etc. */
 
-#include "scsi.h"
-#include "hosts.h"
+#include <scsi/scsi.h>
+#include <scsi/scsi_cmnd.h>
+#include <scsi/scsi_device.h>
+#include <scsi/scsi_host.h>
+#include <scsi/scsi_tcq.h>
 
 #include "dpt/dptsig.h"
 #include "dpti.h"
@@ -86,9 +89,9 @@ static dpt_sig_S DPTI_sig = {
 #elif defined(__ia64__)
 	PROC_INTEL, PROC_IA64,
 #elif defined(__sparc__)
-	PROC_ULTRASPARC,
+	PROC_ULTRASPARC, PROC_ULTRASPARC,
 #elif defined(__alpha__)
-	PROC_ALPHA ,
+	PROC_ALPHA, PROC_ALPHA,
 #else
 	(-1),(-1),
 #endif
@@ -173,7 +176,7 @@ static struct pci_device_id dptids[] = {
 };
 MODULE_DEVICE_TABLE(pci,dptids);
 
-static int adpt_detect(Scsi_Host_Template* sht)
+static int adpt_detect(struct scsi_host_template* sht)
 {
 	struct pci_dev *pDev = NULL;
 	adpt_hba* pHba;
@@ -362,7 +365,7 @@ static void adpt_inquiry(adpt_hba* pHba)
 }
 
 
-static int adpt_slave_configure(Scsi_Device * device)
+static int adpt_slave_configure(struct scsi_device * device)
 {
 	struct Scsi_Host *host = device->host;
 	adpt_hba* pHba;
@@ -378,7 +381,7 @@ static int adpt_slave_configure(Scsi_Device * device)
 	return 0;
 }
 
-static int adpt_queue(Scsi_Cmnd * cmd, void (*done) (Scsi_Cmnd *))
+static int adpt_queue(struct scsi_cmnd * cmd, void (*done) (struct scsi_cmnd *))
 {
 	adpt_hba* pHba = NULL;
 	struct adpt_device* pDev = NULL;	/* dpt per device information */
@@ -643,7 +646,7 @@ stop_output:
  *===========================================================================
  */
 
-static int adpt_abort(Scsi_Cmnd * cmd)
+static int adpt_abort(struct scsi_cmnd * cmd)
 {
 	adpt_hba* pHba = NULL;	/* host bus adapter structure */
 	struct adpt_device* dptdevice;	/* dpt per device information */
@@ -683,7 +686,7 @@ static int adpt_abort(Scsi_Cmnd * cmd)
 // This is the same for BLK and SCSI devices
 // NOTE this is wrong in the i2o.h definitions
 // This is not currently supported by our adapter but we issue it anyway
-static int adpt_device_reset(Scsi_Cmnd* cmd)
+static int adpt_device_reset(struct scsi_cmnd* cmd)
 {
 	adpt_hba* pHba;
 	u32 msg[4];
@@ -723,7 +726,7 @@ static int adpt_device_reset(Scsi_Cmnd* cmd)
 
 #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)
+static int adpt_bus_reset(struct scsi_cmnd* cmd)
 {
 	adpt_hba* pHba;
 	u32 msg[4];
@@ -745,7 +748,7 @@ static int adpt_bus_reset(Scsi_Cmnd* cmd)
 }
 
 // This version of reset is called by the eh_error_handler
-static int adpt_reset(Scsi_Cmnd* cmd)
+static int adpt_reset(struct scsi_cmnd* cmd)
 {
 	adpt_hba* pHba;
 	int rcode;
@@ -834,7 +837,7 @@ static void adpt_i2o_sys_shutdown(void)
 		kfree(p1);
 	}
 //	spin_unlock_irqrestore(&adpt_post_wait_lock, flags);
-	adpt_post_wait_queue = 0;
+	adpt_post_wait_queue = NULL;
 
 	 printk(KERN_INFO "Adaptec I2O controllers down.\n");
 }
@@ -860,7 +863,7 @@ static int adpt_reboot_event(struct notifier_block *n, ulong code, void *p)
 #endif
 
 
-static int adpt_install_hba(Scsi_Host_Template* sht, struct pci_dev* pDev) 
+static int adpt_install_hba(struct scsi_host_template* sht, struct pci_dev* pDev) 
 {
 
 	adpt_hba* pHba = NULL;
@@ -1632,21 +1635,21 @@ static int adpt_close(struct inode *inode, struct file *file)
 }
 
 
-static int adpt_i2o_passthru(adpt_hba* pHba, u32* arg)
+static int adpt_i2o_passthru(adpt_hba* pHba, u32 __user *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 __user *user_msg = arg;
+	u32 __user * user_reply = NULL;
+	void *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;
+	void *p = NULL;
 	ulong flags = 0;
 
 	memset(&msg, 0, MAX_MESSAGE_SIZE*4);
@@ -1663,7 +1666,7 @@ static int adpt_i2o_passthru(adpt_hba* pHba, u32* arg)
 	size *= 4; // Convert to bytes
 
 	/* Copy in the user's I2O command */
-	if(copy_from_user((void*)msg, (void*)user_msg, size)) {
+	if(copy_from_user(msg, user_msg, size)) {
 		return -EFAULT;
 	}
 	get_user(reply_size, &user_reply[0]);
@@ -1702,8 +1705,8 @@ static int adpt_i2o_passthru(adpt_hba* pHba, u32* arg)
 			}
 			sg_size = sg[i].flag_count & 0xffffff;      
 			/* Allocate memory for the transfer */
-			p = (ulong)kmalloc(sg_size, GFP_KERNEL|ADDR32);
-			if(p == 0) {
+			p = kmalloc(sg_size, GFP_KERNEL|ADDR32);
+			if(!p) {
 				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;
@@ -1713,14 +1716,14 @@ static int adpt_i2o_passthru(adpt_hba* pHba, u32* arg)
 			/* 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)) {
+				if (copy_from_user(p,(void __user *)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);
+			sg[i].addr_bus = (u32)virt_to_bus(p);
 		}
 	}
 
@@ -1762,7 +1765,7 @@ static int adpt_i2o_passthru(adpt_hba* pHba, u32* arg)
 		size = size>>16;
 		size *= 4;
 		/* Copy in the user's I2O command */
-		if (copy_from_user ((void*)msg, (void*)user_msg, size)) {
+		if (copy_from_user (msg, user_msg, size)) {
 			rcode = -EFAULT;
 			goto cleanup;
 		}
@@ -1775,8 +1778,8 @@ static int adpt_i2o_passthru(adpt_hba* pHba, u32* arg)
 			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);
+				if (copy_to_user((void __user *)sg[j].addr_bus,sg_list[j], sg_size)) {
+					printk(KERN_WARNING"%s: Could not copy %p TO user %x\n",pHba->name, sg_list[j], sg[j].addr_bus);
 					rcode = -EFAULT;
 					goto cleanup;
 				}
@@ -1804,7 +1807,7 @@ cleanup:
 	while(sg_index) {
 		if(sg_list[--sg_index]) {
 			if (rcode != -ETIME && rcode != -EINTR)
-				kfree((void*)(sg_list[sg_index]));
+				kfree(sg_list[sg_index]);
 		}
 	}
 	return rcode;
@@ -1817,7 +1820,7 @@ cleanup:
  */
 
 /* Get all the info we can not get from kernel services */
-static int adpt_system_info(void *buffer)
+static int adpt_system_info(void __user *buffer)
 {
 	sysInfo_S si;
 
@@ -1913,6 +1916,7 @@ static int adpt_ioctl(struct inode *inode, struct file *file, uint cmd,
 	int error = 0;
 	adpt_hba* pHba;
 	ulong flags = 0;
+	void __user *argp = (void __user *)arg;
 
 	minor = iminor(inode);
 	if (minor >= DPTI_MAX_HBA){
@@ -1938,13 +1942,12 @@ static int adpt_ioctl(struct inode *inode, struct file *file, uint cmd,
 	switch (cmd) {
 	// TODO: handle 3 cases
 	case DPT_SIGNATURE:
-		if (copy_to_user((char*)arg, &DPTI_sig, sizeof(DPTI_sig))) {
+		if (copy_to_user(argp, &DPTI_sig, sizeof(DPTI_sig))) {
 			return -EFAULT;
 		}
 		break;
 	case I2OUSRCMD:
-		return	adpt_i2o_passthru(pHba,(u32*)arg);
-		break;
+		return adpt_i2o_passthru(pHba, argp);
 
 	case DPT_CTRLINFO:{
 		drvrHBAinfo_S HbaInfo;
@@ -1960,19 +1963,18 @@ static int adpt_ioctl(struct inode *inode, struct file *file, uint cmd,
 		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))){
+		if(copy_to_user(argp, &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;
+		return adpt_system_info(argp);
 	case DPT_BLINKLED:{
 		u32 value;
 		value = (u32)adpt_read_blink_led(pHba);
-		if (copy_to_user((char*)arg, &value, sizeof(value))) {
+		if (copy_to_user(argp, &value, sizeof(value))) {
 			return -EFAULT;
 		}
 		break;
@@ -1997,7 +1999,7 @@ static int adpt_ioctl(struct inode *inode, struct file *file, uint cmd,
 
 static irqreturn_t adpt_isr(int irq, void *dev_id, struct pt_regs *regs)
 {
-	Scsi_Cmnd* cmd;
+	struct scsi_cmnd* cmd;
 	adpt_hba* pHba = dev_id;
 	u32 m;
 	ulong reply;
@@ -2059,14 +2061,14 @@ static irqreturn_t adpt_isr(int irq, void *dev_id, struct pt_regs *regs)
 				status = I2O_POST_WAIT_OK;
 			}
 			if(!(context & 0x40000000)) {
-				cmd = (Scsi_Cmnd*) readl(reply+12); 
+				cmd = (struct 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); 
+			cmd = (struct scsi_cmnd*) readl(reply+12); 
 			if(cmd != NULL){
 				if(cmd->serial_number != 0) { // If not timedout
 					adpt_i2o_to_scsi(reply, cmd);
@@ -2083,7 +2085,7 @@ out:	if(pHba->host)
 	return IRQ_RETVAL(handled);
 }
 
-static s32 adpt_scsi_to_i2o(adpt_hba* pHba, Scsi_Cmnd* cmd, struct adpt_device* d)
+static s32 adpt_scsi_to_i2o(adpt_hba* pHba, struct scsi_cmnd* cmd, struct adpt_device* d)
 {
 	int i;
 	u32 msg[MAX_MESSAGE_SIZE];
@@ -2108,16 +2110,16 @@ static s32 adpt_scsi_to_i2o(adpt_hba* pHba, Scsi_Cmnd* cmd, struct adpt_device*
 		 * cmd->cmnd[0] is an unsigned char
 		 */
 		switch(cmd->sc_data_direction){
-		case SCSI_DATA_READ:
+		case DMA_FROM_DEVICE:
 			scsidir  =0x40000000;	// DATA IN  (iop<--dev)
 			break;
-		case SCSI_DATA_WRITE:
+		case DMA_TO_DEVICE:
 			direction=0x04000000;	// SGL OUT
 			scsidir  =0x80000000;	// DATA OUT (iop-->dev)
 			break;
-		case SCSI_DATA_NONE:
+		case DMA_NONE:
 			break;
-		case SCSI_DATA_UNKNOWN:
+		case DMA_BIDIRECTIONAL:
 			scsidir  =0x40000000;	// DATA IN  (iop<--dev)
 			// Assume In - and continue;
 			break;
@@ -2156,7 +2158,7 @@ static s32 adpt_scsi_to_i2o(adpt_hba* pHba, Scsi_Cmnd* cmd, struct adpt_device*
 	if(cmd->use_sg) {
 		struct scatterlist *sg = (struct scatterlist *)cmd->request_buffer;
 		int sg_count = pci_map_sg(pHba->pDev, sg, cmd->use_sg,
-                        scsi_to_pci_dma_dir(cmd->sc_data_direction));
+				cmd->sc_data_direction);
 
 
 		len = 0;
@@ -2184,7 +2186,7 @@ static s32 adpt_scsi_to_i2o(adpt_hba* pHba, Scsi_Cmnd* cmd, struct adpt_device*
 			*mptr++ = pci_map_single(pHba->pDev,
 				cmd->request_buffer,
 				cmd->request_bufflen,
-				scsi_to_pci_dma_dir(cmd->sc_data_direction));
+				cmd->sc_data_direction);
 		}
 	}
 	
@@ -2200,7 +2202,7 @@ static s32 adpt_scsi_to_i2o(adpt_hba* pHba, Scsi_Cmnd* cmd, struct adpt_device*
 }
 
 
-static s32 adpt_scsi_register(adpt_hba* pHba,Scsi_Host_Template * sht)
+static s32 adpt_scsi_register(adpt_hba* pHba,struct scsi_host_template * sht)
 {
 	struct Scsi_Host *host = NULL;
 
@@ -2231,7 +2233,7 @@ static s32 adpt_scsi_register(adpt_hba* pHba,Scsi_Host_Template * sht)
 }
 
 
-static s32 adpt_i2o_to_scsi(ulong reply, Scsi_Cmnd* cmd)
+static s32 adpt_i2o_to_scsi(ulong reply, struct scsi_cmnd* cmd)
 {
 	adpt_hba* pHba;
 	u32 hba_status;
@@ -2533,8 +2535,8 @@ static s32 adpt_i2o_reparse_lct(adpt_hba* pHba)
 
 static void adpt_fail_posted_scbs(adpt_hba* pHba)
 {
-	Scsi_Cmnd* 	cmd = NULL;
-	Scsi_Device* 	d = NULL;
+	struct scsi_cmnd* 	cmd = NULL;
+	struct scsi_device* 	d = NULL;
 
 	shost_for_each_device(d, pHba->host) {
 		unsigned long flags;
@@ -3358,7 +3360,7 @@ static static void adpt_delay(int millisec)
 
 #endif
 
-static Scsi_Host_Template driver_template = {
+static struct scsi_host_template driver_template = {
 	.name			= "dpt_i2o",
 	.proc_name		= "dpt_i2o",
 	.proc_info		= adpt_proc_info,
diff --git a/drivers/scsi/dpti.h b/drivers/scsi/dpti.h
index 7f3c028a9..c43673bbe 100644
--- a/drivers/scsi/dpti.h
+++ b/drivers/scsi/dpti.h
@@ -37,19 +37,19 @@
  * SCSI interface function Prototypes
  */
 
-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_detect(struct scsi_host_template * sht);
+static int adpt_queue(struct scsi_cmnd * cmd, void (*cmdcomplete) (struct scsi_cmnd *));
+static int adpt_abort(struct scsi_cmnd * cmd);
+static int adpt_reset(struct scsi_cmnd* cmd);
 static int adpt_release(struct Scsi_Host *host);
-static int adpt_slave_configure(Scsi_Device *);
+static int adpt_slave_configure(struct scsi_device *);
 
 static const char *adpt_info(struct Scsi_Host *pSHost);
 static int adpt_bios_param(struct scsi_device * sdev, struct block_device *dev,
 		sector_t, int geom[]);
 
-static int adpt_bus_reset(Scsi_Cmnd* cmd);
-static int adpt_device_reset(Scsi_Cmnd* cmd);
+static int adpt_bus_reset(struct scsi_cmnd* cmd);
+static int adpt_device_reset(struct scsi_cmnd* cmd);
 
 
 /*
@@ -198,7 +198,7 @@ struct adpt_device {
 	u8	state;
 	u16	tid;
 	struct i2o_device* pI2o_dev;
-	Scsi_Device *pScsi_dev;
+	struct scsi_device *pScsi_dev;
 };
 
 struct adpt_channel {
@@ -296,9 +296,9 @@ 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_scsi_to_i2o(adpt_hba* pHba, struct scsi_cmnd* cmd, struct adpt_device* dptdevice);
+static s32 adpt_i2o_to_scsi(ulong reply, struct scsi_cmnd* cmd);
+static s32 adpt_scsi_register(adpt_hba* pHba,struct 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);
@@ -308,7 +308,7 @@ static void adpt_i2o_delete_hba(adpt_hba* pHba);
 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_install_hba(struct 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);
diff --git a/drivers/scsi/dtc.c b/drivers/scsi/dtc.c
index 820ac1f8b..624c7ee5d 100644
--- a/drivers/scsi/dtc.c
+++ b/drivers/scsi/dtc.c
@@ -84,7 +84,7 @@
 #include <linux/interrupt.h>
 #include <asm/io.h>
 #include "scsi.h"
-#include "hosts.h"
+#include <scsi/scsi_host.h>
 #include "dtc.h"
 #define AUTOPROBE_IRQ
 #include "NCR5380.h"
diff --git a/drivers/scsi/eata.c b/drivers/scsi/eata.c
index 5235f9ed5..0e245e318 100644
--- a/drivers/scsi/eata.c
+++ b/drivers/scsi/eata.c
@@ -495,7 +495,7 @@
 #include <linux/spinlock.h>
 #include <scsi/scsicam.h>
 #include "scsi.h"
-#include "hosts.h"
+#include <scsi/scsi_host.h>
 #include <asm/dma.h>
 #include <asm/irq.h>
 
diff --git a/drivers/scsi/eata_generic.h b/drivers/scsi/eata_generic.h
index 8bac58f82..34bce2c9e 100644
--- a/drivers/scsi/eata_generic.h
+++ b/drivers/scsi/eata_generic.h
@@ -317,7 +317,7 @@ struct eata_ccb {	      /* Send Command Packet structure	    */
     __u8 rw_latency;
     __u8 retries;
     __u8 status;	      /* status of this queueslot		*/
-    Scsi_Cmnd *cmd;	      /* address of cmd				*/
+    struct scsi_cmnd *cmd;    /* address of cmd				*/
     struct eata_sg_list *sg_list;
 };
 
diff --git a/drivers/scsi/eata_pio.c b/drivers/scsi/eata_pio.c
index 28f3e1a02..e2c07fca0 100644
--- a/drivers/scsi/eata_pio.c
+++ b/drivers/scsi/eata_pio.c
@@ -46,6 +46,7 @@
  *  last change: 2002/11/02               OS: Linux 2.5.45  *
  ************************************************************/
 
+#include <linux/config.h>
 #include <linux/module.h>
 #include <linux/kernel.h>
 #include <linux/sched.h>
@@ -56,15 +57,14 @@
 #include <linux/pci.h>
 #include <linux/proc_fs.h>
 #include <linux/interrupt.h>
-#include <linux/stat.h>
-#include <linux/config.h>
 #include <linux/blkdev.h>
 #include <linux/spinlock.h>
 #include <asm/io.h>
 
-#include "scsi.h"
-#include "hosts.h"
-#include <scsi/scsicam.h>
+#include <scsi/scsi.h>
+#include <scsi/scsi_cmnd.h>
+#include <scsi/scsi_device.h>
+#include <scsi/scsi_host.h>
 
 #include "eata_generic.h"
 #include "eata_pio.h"
@@ -91,6 +91,8 @@ static unsigned char reg_IRQL[16];
 static unsigned long int_counter;
 static unsigned long queue_counter;
 
+static struct scsi_host_template driver_template;
+
 /*
  * eata_proc_info
  * inout : decides on the direction of the dataflow and the meaning of the 
@@ -170,15 +172,15 @@ static int eata_pio_release(struct Scsi_Host *sh)
 		if (sh->io_port && sh->n_io_port)
 			release_region(sh->io_port, sh->n_io_port);
 	}
-	return (TRUE);
+	return 1;
 }
 
-static void IncStat(Scsi_Pointer * SCp, uint Increment)
+static void IncStat(struct scsi_pointer *SCp, uint Increment)
 {
 	SCp->ptr += Increment;
 	if ((SCp->this_residual -= Increment) == 0) {
 		if ((--SCp->buffers_residual) == 0)
-			SCp->Status = FALSE;
+			SCp->Status = 0;
 		else {
 			SCp->buffer++;
 			SCp->ptr = page_address(SCp->buffer->page) + SCp->buffer->offset;
@@ -204,7 +206,7 @@ static irqreturn_t do_eata_pio_int_handler(int irq, void *dev_id,
 static void eata_pio_int_handler(int irq, void *dev_id, struct pt_regs *regs)
 {
 	uint eata_stat = 0xfffff;
-	Scsi_Cmnd *cmd;
+	struct scsi_cmnd *cmd;
 	hostdata *hd;
 	struct eata_ccb *cp;
 	uint base;
@@ -233,12 +235,12 @@ static void eata_pio_int_handler(int irq, void *dev_id, struct pt_regs *regs)
 			if (stat & HA_SDRQ) {
 				if (cp->DataIn) {
 					z = 256;
-					odd = FALSE;
+					odd = 0;
 					while ((cmd->SCp.Status) && ((z > 0) || (odd))) {
 						if (odd) {
 							*(cmd->SCp.ptr) = zwickel >> 8;
 							IncStat(&cmd->SCp, 1);
-							odd = FALSE;
+							odd = 0;
 						}
 						x = min_t(unsigned int, z, cmd->SCp.this_residual / 2);
 						insw(base + HA_RDATA, cmd->SCp.ptr, x);
@@ -249,7 +251,7 @@ static void eata_pio_int_handler(int irq, void *dev_id, struct pt_regs *regs)
 							*(cmd->SCp.ptr) = zwickel & 0xff;
 							IncStat(&cmd->SCp, 1);
 							z--;
-							odd = TRUE;
+							odd = 1;
 						}
 					}
 					while (z > 0) {
@@ -258,7 +260,7 @@ static void eata_pio_int_handler(int irq, void *dev_id, struct pt_regs *regs)
 					}
 				} else {	/* cp->DataOut */
 
-					odd = FALSE;
+					odd = 0;
 					z = 256;
 					while ((cmd->SCp.Status) && ((z > 0) || (odd))) {
 						if (odd) {
@@ -266,7 +268,7 @@ static void eata_pio_int_handler(int irq, void *dev_id, struct pt_regs *regs)
 							IncStat(&cmd->SCp, 1);
 							outw(zwickel, base + HA_RDATA);
 							z--;
-							odd = FALSE;
+							odd = 0;
 						}
 						x = min_t(unsigned int, z, cmd->SCp.this_residual / 2);
 						outsw(base + HA_RDATA, cmd->SCp.ptr, x);
@@ -276,13 +278,13 @@ static void eata_pio_int_handler(int irq, void *dev_id, struct pt_regs *regs)
 							zwickel = *(cmd->SCp.ptr);
 							zwickel &= 0xff;
 							IncStat(&cmd->SCp, 1);
-							odd = TRUE;
+							odd = 1;
 						}
 					}
 					while (z > 0 || odd) {
 						outw(zwickel, base + HA_RDATA);
 						z--;
-						odd = FALSE;
+						odd = 0;
 					}
 				}
 			}
@@ -331,7 +333,7 @@ static inline uint eata_pio_send_command(uint base, unsigned char command)
 
 	while (inb(base + HA_RSTATUS) & HA_SBUSY)
 		if (--loop == 0)
-			return (TRUE);
+			return 1;
 
 	/* Enable interrupts for HBA.  It is not the best way to do it at this
 	 * place, but I hope that it doesn't interfere with the IDE driver 
@@ -340,10 +342,11 @@ static inline uint eata_pio_send_command(uint base, unsigned char command)
 	outb(HA_CTRL_8HEADS, base + HA_CTRLREG);
 
 	outb(command, base + HA_WCOMMAND);
-	return (FALSE);
+	return 0;
 }
 
-static int eata_pio_queue(Scsi_Cmnd * cmd, void (*done) (Scsi_Cmnd *))
+static int eata_pio_queue(struct scsi_cmnd *cmd,
+		void (*done)(struct scsi_cmnd *))
 {
 	uint x, y;
 	uint base;
@@ -383,21 +386,21 @@ static int eata_pio_queue(Scsi_Cmnd * cmd, void (*done) (Scsi_Cmnd *))
 
 	cmd->scsi_done = (void *) done;
 
-	if(cmd->sc_data_direction == SCSI_DATA_WRITE)
-		cp->DataOut = TRUE;	/* Output mode */
+	if (cmd->sc_data_direction == DMA_TO_DEVICE)
+		cp->DataOut = 1;	/* Output mode */
 	else
-		cp->DataIn = TRUE;	/* Input mode  */
+		cp->DataIn = 0;	/* Input mode  */
 
 	cp->Interpret = (cmd->device->id == hd->hostid);
 	cp->cp_datalen = htonl((unsigned long) cmd->request_bufflen);
-	cp->Auto_Req_Sen = FALSE;
+	cp->Auto_Req_Sen = 0;
 	cp->cp_reqDMA = htonl(0);
 	cp->reqlen = 0;
 
 	cp->cp_id = cmd->device->id;
 	cp->cp_lun = cmd->device->lun;
-	cp->cp_dispri = FALSE;
-	cp->cp_identify = TRUE;
+	cp->cp_dispri = 0;
+	cp->cp_identify = 1;
 	memcpy(cp->cp_cdb, cmd->cmnd, COMMAND_SIZE(*cmd->cmnd));
 
 	cp->cp_statDMA = htonl(0);
@@ -440,7 +443,7 @@ static int eata_pio_queue(Scsi_Cmnd * cmd, void (*done) (Scsi_Cmnd *))
 	return (0);
 }
 
-static int eata_pio_abort(Scsi_Cmnd * cmd)
+static int eata_pio_abort(struct scsi_cmnd *cmd)
 {
 	uint loop = HZ;
 
@@ -472,11 +475,11 @@ static int eata_pio_abort(Scsi_Cmnd * cmd)
 	panic("eata_pio: abort: invalid slot status\n");
 }
 
-static int eata_pio_host_reset(Scsi_Cmnd * cmd)
+static int eata_pio_host_reset(struct scsi_cmnd *cmd)
 {
 	uint x, limit = 0;
-	unsigned char success = FALSE;
-	Scsi_Cmnd *sp;
+	unsigned char success = 0;
+	struct scsi_cmnd *sp;
 	struct Scsi_Host *host = cmd->device->host;
 
 	DBG(DBG_ABNORM, printk(KERN_WARNING "eata_pio_reset called pid:%ld target:" " %x lun: %x reason %x\n", cmd->pid, cmd->device->id, cmd->device->lun, cmd->abort_reason));
@@ -530,7 +533,7 @@ static int eata_pio_host_reset(Scsi_Cmnd * cmd)
 		sp->scsi_done(sp);
 	}
 
-	HD(cmd)->state = FALSE;
+	HD(cmd)->state = 0;
 
 	if (success) {		/* hmmm... */
 		DBG(DBG_ABNORM, printk(KERN_WARNING "eata_pio_reset: exit, success.\n"));
@@ -550,8 +553,8 @@ static char *get_pio_board_data(unsigned long base, uint irq, uint id, unsigned
 	memset(&cp, 0, sizeof(struct eata_ccb));
 	memset(buff, 0, sizeof(buff));
 
-	cp.DataIn = TRUE;
-	cp.Interpret = TRUE;	/* Interpret command */
+	cp.DataIn = 1;
+	cp.Interpret = 1;	/* Interpret command */
 
 	cp.cp_datalen = htonl(254);
 	cp.cp_dataDMA = htonl(0);
@@ -593,14 +596,14 @@ static int get_pio_conf_PIO(u32 base, struct get_conf *buf)
 	int z;
 	unsigned short *p;
 
-	if (check_region(base, 9))
-		return (FALSE);
+	if (!request_region(base, 9, "eata_pio"))
+		return 0;
 
 	memset(buf, 0, sizeof(struct get_conf));
 
 	while (inb(base + HA_RSTATUS) & HA_SBUSY)
 		if (--loop == 0)
-			return (FALSE);
+			goto fail;
 
 	DBG(DBG_PIO && DBG_PROBE, printk(KERN_DEBUG "Issuing PIO READ CONFIG to HBA at %#x\n", base));
 	eata_pio_send_command(base, EATA_CMD_PIO_READ_CONFIG);
@@ -609,30 +612,40 @@ static int get_pio_conf_PIO(u32 base, struct get_conf *buf)
 	for (p = (unsigned short *) buf; (long) p <= ((long) buf + (sizeof(struct get_conf) / 2)); p++) {
 		while (!(inb(base + HA_RSTATUS) & HA_SDRQ))
 			if (--loop == 0)
-				return (FALSE);
+				goto fail;
 
 		loop = HZ / 2;
 		*p = inw(base + HA_RDATA);
 	}
-	if (!(inb(base + HA_RSTATUS) & HA_SERROR)) {	/* Error ? */
-		if (htonl(EATA_SIGNATURE) == buf->signature) {
-			DBG(DBG_PIO && DBG_PROBE, printk(KERN_NOTICE "EATA Controller found " "at %#4x EATA Level: %x\n", base, (uint) (buf->version)));
-
-			while (inb(base + HA_RSTATUS) & HA_SDRQ)
-				inw(base + HA_RDATA);
-			if (ALLOW_DMA_BOARDS == FALSE) {
-				for (z = 0; z < MAXISA; z++)
-					if (base == ISAbases[z]) {
-						buf->IRQ = ISAirqs[z];
-						break;
-					}
+	if (inb(base + HA_RSTATUS) & HA_SERROR) {
+		DBG(DBG_PROBE, printk("eata_dma: get_conf_PIO, error during "
+					"transfer for HBA at %x\n", base));
+		goto fail;
+	}
+
+	if (htonl(EATA_SIGNATURE) != buf->signature)
+		goto fail;
+
+	DBG(DBG_PIO && DBG_PROBE, printk(KERN_NOTICE "EATA Controller found "
+				"at %#4x EATA Level: %x\n",
+				base, (uint) (buf->version)));
+
+	while (inb(base + HA_RSTATUS) & HA_SDRQ)
+		inw(base + HA_RDATA);
+
+	if (!ALLOW_DMA_BOARDS) {
+		for (z = 0; z < MAXISA; z++)
+			if (base == ISAbases[z]) {
+				buf->IRQ = ISAirqs[z];
+				break;
 			}
-			return (TRUE);
-		}
-	} else {
-		DBG(DBG_PROBE, printk("eata_dma: get_conf_PIO, error during transfer " "for HBA at %x\n", base));
 	}
-	return (FALSE);
+
+	return 1;
+
+ fail:
+	release_region(base, 9);
+	return 0;
 }
 
 static void print_pio_config(struct get_conf *gc)
@@ -670,7 +683,7 @@ static uint print_selftest(uint base)
 	return (!(inb(base + HA_RSTATUS) & HA_SERROR));
 }
 
-static int register_pio_HBA(long base, struct get_conf *gc, Scsi_Host_Template * tpnt)
+static int register_pio_HBA(long base, struct get_conf *gc)
 {
 	unsigned long size = 0;
 	char *buff;
@@ -681,47 +694,41 @@ static int register_pio_HBA(long base, struct get_conf *gc, Scsi_Host_Template *
 
 	DBG(DBG_REGISTER, print_pio_config(gc));
 
-	if (gc->DMA_support == TRUE) {
+	if (gc->DMA_support) {
 		printk("HBA at %#.4lx supports DMA. Please use EATA-DMA driver.\n", base);
-		if (ALLOW_DMA_BOARDS == FALSE)
-			return (FALSE);
+		if (!ALLOW_DMA_BOARDS)
+			return 0;
 	}
 
 	if ((buff = get_pio_board_data((uint) base, gc->IRQ, gc->scsi_id[3], cplen = (htonl(gc->cplen) + 1) / 2, cppadlen = (htons(gc->cppadlen) + 1) / 2)) == NULL) {
 		printk("HBA at %#lx didn't react on INQUIRY. Sorry.\n", (unsigned long) base);
-		return (FALSE);
+		return 0;
 	}
 
-	if (print_selftest(base) == FALSE && ALLOW_DMA_BOARDS == FALSE) {
+	if (!print_selftest(base) && !ALLOW_DMA_BOARDS) {
 		printk("HBA at %#lx failed while performing self test & setup.\n", (unsigned long) base);
-		return (FALSE);
+		return 0;
 	}
 
-	request_region(base, 8, "eata_pio");
-
 	size = sizeof(hostdata) + (sizeof(struct eata_ccb) * ntohs(gc->queuesiz));
 
-	sh = scsi_register(tpnt, size);
-	if (sh == NULL) {
-		release_region(base, 8);
-		return FALSE;
-	}
+	sh = scsi_register(&driver_template, size);
+	if (sh == NULL)
+		return 0;
 
 	if (!reg_IRQ[gc->IRQ]) {	/* Interrupt already registered ? */
 		if (!request_irq(gc->IRQ, do_eata_pio_int_handler, SA_INTERRUPT, "EATA-PIO", sh)) {
 			reg_IRQ[gc->IRQ]++;
 			if (!gc->IRQ_TR)
-				reg_IRQL[gc->IRQ] = TRUE;	/* IRQ is edge triggered */
+				reg_IRQL[gc->IRQ] = 1;	/* IRQ is edge triggered */
 		} else {
 			printk("Couldn't allocate IRQ %d, Sorry.\n", gc->IRQ);
-			release_region(base, 8);
-			return (FALSE);
+			return 0;
 		}
 	} else {		/* More than one HBA on this IRQ */
-		if (reg_IRQL[gc->IRQ] == TRUE) {
+		if (reg_IRQL[gc->IRQ]) {
 			printk("Can't support more than one HBA on this IRQ,\n" "  if the IRQ is edge triggered. Sorry.\n");
-			release_region(base, 8);
-			return (FALSE);
+			return 0;
 		} else
 			reg_IRQ[gc->IRQ]++;
 	}
@@ -757,9 +764,9 @@ static int register_pio_HBA(long base, struct get_conf *gc, Scsi_Host_Template *
 	}
 
 	if (ntohl(gc->len) >= 0x22) {
-		if (gc->is_PCI == TRUE)
+		if (gc->is_PCI)
 			hd->bustype = IS_PCI;
-		else if (gc->is_EISA == TRUE)
+		else if (gc->is_EISA)
 			hd->bustype = IS_EISA;
 		else
 			hd->bustype = IS_ISA;
@@ -780,7 +787,7 @@ static int register_pio_HBA(long base, struct get_conf *gc, Scsi_Host_Template *
 	sh->unique_id = base;
 	sh->base = base;
 	sh->io_port = base;
-	sh->n_io_port = 8;
+	sh->n_io_port = 9;
 	sh->irq = gc->IRQ;
 	sh->dma_channel = PIO;
 	sh->this_id = gc->scsi_id[3];
@@ -794,11 +801,11 @@ static int register_pio_HBA(long base, struct get_conf *gc, Scsi_Host_Template *
 	sh->max_lun = 8;
 
 	if (gc->SECOND)
-		hd->primary = FALSE;
+		hd->primary = 0;
 	else
-		hd->primary = TRUE;
+		hd->primary = 1;
 
-	sh->unchecked_isa_dma = FALSE;	/* We can only do PIO */
+	sh->unchecked_isa_dma = 0;	/* We can only do PIO */
 
 	hd->next = NULL;	/* build a linked list of all HBAs */
 	hd->prev = last_HBA;
@@ -811,35 +818,37 @@ static int register_pio_HBA(long base, struct get_conf *gc, Scsi_Host_Template *
 	return (1);
 }
 
-static void find_pio_ISA(struct get_conf *buf, Scsi_Host_Template * tpnt)
+static void find_pio_ISA(struct get_conf *buf)
 {
 	int i;
 
 	for (i = 0; i < MAXISA; i++) {
-		if (ISAbases[i]) {
-			if (get_pio_conf_PIO(ISAbases[i], buf) == TRUE) {
-				register_pio_HBA(ISAbases[i], buf, tpnt);
-			}
+		if (!ISAbases[i])
+			continue;
+		if (!get_pio_conf_PIO(ISAbases[i], buf))
+			continue;
+		if (!register_pio_HBA(ISAbases[i], buf))
+			release_region(ISAbases[i], 9);
+		else
 			ISAbases[i] = 0;
-		}
 	}
 	return;
 }
 
-static void find_pio_EISA(struct get_conf *buf, Scsi_Host_Template * tpnt)
+static void find_pio_EISA(struct get_conf *buf)
 {
 	u32 base;
 	int i;
 
-#if CHECKPAL
+#ifdef CHECKPAL
 	u8 pal1, pal2, pal3;
 #endif
 
 	for (i = 0; i < MAXEISA; i++) {
-		if (EISAbases[i] == TRUE) {	/* Still a possibility ?          */
+		if (EISAbases[i]) {	/* Still a possibility ?          */
 
 			base = 0x1c88 + (i * 0x1000);
-#if CHECKPAL
+#ifdef CHECKPAL
 			pal1 = inb((u16) base - 8);
 			pal2 = inb((u16) base - 7);
 			pal3 = inb((u16) base - 6);
@@ -847,16 +856,19 @@ static void find_pio_EISA(struct get_conf *buf, Scsi_Host_Template * tpnt)
 			if (((pal1 == 0x12) && (pal2 == 0x14)) || ((pal1 == 0x38) && (pal2 == 0xa3) && (pal3 == 0x82)) || ((pal1 == 0x06) && (pal2 == 0x94) && (pal3 == 0x24))) {
 				DBG(DBG_PROBE, printk(KERN_NOTICE "EISA EATA id tags found: " "%x %x %x \n", (int) pal1, (int) pal2, (int) pal3));
 #endif
-				if (get_pio_conf_PIO(base, buf) == TRUE) {
+				if (get_pio_conf_PIO(base, buf)) {
 					DBG(DBG_PROBE && DBG_EISA, print_pio_config(buf));
 					if (buf->IRQ) {
-						register_pio_HBA(base, buf, tpnt);
-					} else
+						if (!register_pio_HBA(base, buf))
+							release_region(base, 9);
+					} else {
 						printk(KERN_NOTICE "eata_dma: No valid IRQ. HBA " "removed from list\n");
+						release_region(base, 9);
+					}
 				}
 				/* Nothing found here so we take it from the list */
 				EISAbases[i] = 0;
-#if CHECKPAL
+#ifdef CHECKPAL
 			}
 #endif
 		}
@@ -864,7 +876,7 @@ static void find_pio_EISA(struct get_conf *buf, Scsi_Host_Template * tpnt)
 	return;
 }
 
-static void find_pio_PCI(struct get_conf *buf, Scsi_Host_Template * tpnt)
+static void find_pio_PCI(struct get_conf *buf)
 {
 #ifndef CONFIG_PCI
 	printk("eata_dma: kernel PCI support not enabled. Skipping scan for PCI HBAs.\n");
@@ -889,16 +901,21 @@ static void find_pio_PCI(struct get_conf *buf, Scsi_Host_Template * tpnt)
 		base += 0x10;	/* Now, THIS is the real address */
 		if (base != 0x1f8) {
 			/* We didn't find it in the primary search */
-			if (get_pio_conf_PIO(base, buf) == TRUE) {
-				if (buf->FORCADR)	/* If the address is forced */
+			if (get_pio_conf_PIO(base, buf)) {
+				if (buf->FORCADR) {	/* If the address is forced */
+					release_region(base, 9);
 					continue;	/* we'll find it later      */
+				}
 
 				/* OK. We made it till here, so we can go now  
 				 * and register it. We  only have to check and 
 				 * eventually remove it from the EISA and ISA list 
 				 */
 
-				register_pio_HBA(base, buf, tpnt);
+				if (!register_pio_HBA(base, buf)) {
+					release_region(base, 9);
+					continue;
+				}
 
 				if (base < 0x1000) {
 					for (x = 0; x < MAXISA; ++x) {
@@ -912,8 +929,8 @@ static void find_pio_PCI(struct get_conf *buf, Scsi_Host_Template * tpnt)
 					EISAbases[x] = 0;
 				}
 			}
-#if CHECK_BLINK
-			else if (check_blink_state(base) == TRUE) {
+#ifdef CHECK_BLINK
+			else if (check_blink_state(base)) {
 				printk("eata_pio: HBA is in BLINK state.\n" "Consult your HBAs manual to correct this.\n");
 			}
 #endif
@@ -922,20 +939,15 @@ static void find_pio_PCI(struct get_conf *buf, Scsi_Host_Template * tpnt)
 #endif				/* #ifndef CONFIG_PCI */
 }
 
-
-static int eata_pio_detect(Scsi_Host_Template * tpnt)
+static int eata_pio_detect(struct scsi_host_template *tpnt)
 {
 	struct Scsi_Host *HBA_ptr;
 	struct get_conf gc;
 	int i;
 
-	tpnt->proc_name = "eata_pio";
-
-	find_pio_PCI(&gc, tpnt);
-
-	find_pio_EISA(&gc, tpnt);
-
-	find_pio_ISA(&gc, tpnt);
+	find_pio_PCI(&gc);
+	find_pio_EISA(&gc);
+	find_pio_ISA(&gc);
 
 	for (i = 0; i <= MAXIRQ; i++)
 		if (reg_IRQ[i])
@@ -955,16 +967,19 @@ static int eata_pio_detect(Scsi_Host_Template * tpnt)
 			       HBA_ptr->host_no, SD(HBA_ptr)->name, SD(HBA_ptr)->revision,
 			       SD(HBA_ptr)->EATA_revision, (SD(HBA_ptr)->bustype == 'P') ?
 			       "PCI " : (SD(HBA_ptr)->bustype == 'E') ? "EISA" : "ISA ",
-			       (uint) HBA_ptr->base, HBA_ptr->irq, SD(HBA_ptr)->channel, HBA_ptr->this_id, (SD(HBA_ptr)->primary == TRUE) ? 'Y' : 'N', HBA_ptr->can_queue, HBA_ptr->sg_tablesize, HBA_ptr->cmd_per_lun);
+			       (uint) HBA_ptr->base, HBA_ptr->irq, SD(HBA_ptr)->channel, HBA_ptr->this_id,
+			       SD(HBA_ptr)->primary ? 'Y' : 'N', HBA_ptr->can_queue,
+			       HBA_ptr->sg_tablesize, HBA_ptr->cmd_per_lun);
 			HBA_ptr = SD(HBA_ptr)->next;
 		}
 	}
 	return (registered_HBAs);
 }
 
-static Scsi_Host_Template driver_template = {
-	.proc_info         	= eata_pio_proc_info,
+static struct scsi_host_template driver_template = {
+	.proc_name		= "eata_pio",
 	.name              	= "EATA (Extended Attachment) PIO driver",
+	.proc_info         	= eata_pio_proc_info,
 	.detect            	= eata_pio_detect,
 	.release           	= eata_pio_release,
 	.queuecommand      	= eata_pio_queue,
diff --git a/drivers/scsi/fastlane.c b/drivers/scsi/fastlane.c
index b24ef2eda..ae47612b3 100644
--- a/drivers/scsi/fastlane.c
+++ b/drivers/scsi/fastlane.c
@@ -36,7 +36,7 @@
 #include <linux/interrupt.h>
 
 #include "scsi.h"
-#include "hosts.h"
+#include <scsi/scsi_host.h>
 #include "NCR53C9x.h"
 
 #include <linux/zorro.h>
@@ -85,7 +85,6 @@ struct fastlane_dma_registers {
 
 static int  dma_bytes_sent(struct NCR_ESP *esp, int fifo_count);
 static int  dma_can_transfer(struct NCR_ESP *esp, Scsi_Cmnd *sp);
-static inline void dma_clear(struct NCR_ESP *esp);
 static void dma_dump_state(struct NCR_ESP *esp);
 static void dma_init_read(struct NCR_ESP *esp, __u32 addr, int length);
 static void dma_init_write(struct NCR_ESP *esp, __u32 vaddr, int length);
@@ -110,6 +109,21 @@ static volatile unsigned char cmd_buffer[16];
 				 * via PIO.
 				 */
 
+static inline void dma_clear(struct NCR_ESP *esp)
+{
+	struct fastlane_dma_registers *dregs =
+		(struct fastlane_dma_registers *) (esp->dregs);
+	unsigned long *t;
+
+	ctrl_data = (ctrl_data & FASTLANE_DMA_MASK);
+	dregs->ctrl_reg = ctrl_data;
+
+	t = (unsigned long *)(esp->edev);
+
+	dregs->clear_strobe = 0;
+	*t = 0 ;
+}
+
 /***************************************************************** Detection */
 int __init fastlane_esp_detect(Scsi_Host_Template *tpnt)
 {
@@ -297,21 +311,6 @@ static void dma_init_write(struct NCR_ESP *esp, __u32 addr, int length)
 	dregs->ctrl_reg = ctrl_data;
 }
 
-static inline void dma_clear(struct NCR_ESP *esp)
-{
-	struct fastlane_dma_registers *dregs = 
-		(struct fastlane_dma_registers *) (esp->dregs);
-	unsigned long *t;
-
-	ctrl_data = (ctrl_data & FASTLANE_DMA_MASK);
-	dregs->ctrl_reg = ctrl_data;
-
-	t = (unsigned long *)(esp->edev);
-
-	dregs->clear_strobe = 0;
-	*t = 0 ;
-}
-
 
 static void dma_ints_off(struct NCR_ESP *esp)
 {
diff --git a/drivers/scsi/fcal.c b/drivers/scsi/fcal.c
index 7c1bc8a28..0dad89d4c 100644
--- a/drivers/scsi/fcal.c
+++ b/drivers/scsi/fcal.c
@@ -21,7 +21,7 @@
 #include <asm/irq.h>
 
 #include "scsi.h"
-#include "hosts.h"
+#include <scsi/scsi_host.h>
 #include "../fc4/fcp_impl.h"
 #include "fcal.h"
 
diff --git a/drivers/scsi/fd_mcs.c b/drivers/scsi/fd_mcs.c
index 4060e2948..763e33b13 100644
--- a/drivers/scsi/fd_mcs.c
+++ b/drivers/scsi/fd_mcs.c
@@ -87,13 +87,14 @@
 #include <linux/delay.h>
 #include <linux/mca.h>
 #include <linux/spinlock.h>
+#include <scsi/scsicam.h>
 #include <linux/mca-legacy.h>
 
 #include <asm/io.h>
 #include <asm/system.h>
 
 #include "scsi.h"
-#include "hosts.h"
+#include <scsi/scsi_host.h>
 #include "fd_mcs.h"
 
 #define DRIVER_VERSION "v0.2 by ZP Gu<zpg@castle.net>"
@@ -1337,23 +1338,14 @@ static int fd_mcs_bus_reset(Scsi_Cmnd * SCpnt) {
 static int fd_mcs_biosparam(struct scsi_device * disk, struct block_device *bdev,
 			    sector_t capacity, int *info_array) 
 {
-	unsigned char buf[512 + sizeof(int) * 2];
+	unsigned char *p = scsi_bios_ptable(bdev);
 	int size = capacity;
-	int *sizes = (int *) buf;
-	unsigned char *data = (unsigned char *) (sizes + 2);
-	unsigned char do_read[] = { READ_6, 0, 0, 0, 1, 0 };
-	int retcode;
 
 	/* BIOS >= 3.4 for MCA cards */
 	/* This algorithm was provided by Future Domain (much thanks!). */
 
-	sizes[0] = 0;	/* zero bytes out */
-	sizes[1] = 512;	/* one sector in */
-	memcpy(data, do_read, sizeof(do_read));
-	retcode = kernel_scsi_ioctl(disk, SCSI_IOCTL_SEND_COMMAND, (void *) buf);
-	if (!retcode	/* SCSI command ok */
-	    && data[511] == 0xaa && data[510] == 0x55	/* Partition table valid */
-	    && data[0x1c2]) {	/* Partition type */
+	if (p && p[65] == 0xaa && p[64] == 0x55	/* Partition table valid */
+	    && p[4]) {	/* Partition type */
 		/* The partition table layout is as follows:
 
 		   Start: 0x1b3h
@@ -1383,8 +1375,8 @@ static int fd_mcs_biosparam(struct scsi_device * disk, struct block_device *bdev
 		   Future Domain algorithm, but it seemed to be a reasonable thing
 		   to do, especially in the Linux and BSD worlds. */
 
-		info_array[0] = data[0x1c3] + 1;	/* heads */
-		info_array[1] = data[0x1c4] & 0x3f;	/* sectors */
+		info_array[0] = p[5] + 1;	/* heads */
+		info_array[1] = p[6] & 0x3f;	/* sectors */
 	} else {
 		/* Note that this new method guarantees that there will always be
 		   less than 1024 cylinders on a platter.  This is good for drives
@@ -1403,6 +1395,7 @@ static int fd_mcs_biosparam(struct scsi_device * disk, struct block_device *bdev
 	}
 	/* For both methods, compute the cylinders */
 	info_array[2] = (unsigned int) size / (info_array[0] * info_array[1]);
+	kfree(p);
 	return 0;
 }
 
diff --git a/drivers/scsi/fdomain.c b/drivers/scsi/fdomain.c
index 7b53d006c..6529f0c55 100644
--- a/drivers/scsi/fdomain.c
+++ b/drivers/scsi/fdomain.c
@@ -279,12 +279,17 @@
 #include <linux/pci.h>
 #include <linux/stat.h>
 #include <linux/delay.h>
+#include <scsi/scsicam.h>
 
 #include <asm/io.h>
 #include <asm/system.h>
 
-#include "scsi.h"
-#include "hosts.h"
+#include <scsi/scsi.h>
+#include <scsi/scsi_cmnd.h>
+#include <scsi/scsi_device.h>
+#include <scsi/scsi_host.h>
+#include <scsi/scsi_ioctl.h>
+#include "fdomain.h"
 
 MODULE_AUTHOR("Rickard E. Faith");
 MODULE_DESCRIPTION("Future domain SCSI driver");
@@ -385,7 +390,7 @@ static int               PCI_bus;
 static int               Quantum;	/* Quantum board variant */
 static int               interrupt_level;
 static volatile int      in_command;
-static Scsi_Cmnd         *current_SC;
+static struct scsi_cmnd  *current_SC;
 static enum chip_type    chip              = unknown;
 static int               adapter_mask;
 static int               this_id;
@@ -414,8 +419,6 @@ static int               FIFO_Size = 0x2000; /* 8k FIFO for
 
 static irqreturn_t       do_fdomain_16x0_intr( int irq, void *dev_id,
 					    struct pt_regs * regs );
-int		 	fdomain_16x0_bus_reset(Scsi_Cmnd *SCpnt);
-
 /* Allow insmod parameters to be like LILO parameters.  For example:
    insmod fdomain fdomain=0x140,11 */
 static char * fdomain = NULL;
@@ -551,7 +554,7 @@ static void print_banner( struct Scsi_Host *shpnt )
    printk( "\n" );
 }
 
-int __init fdomain_setup(char *str)
+int fdomain_setup(char *str)
 {
 	int ints[4];
 
@@ -678,6 +681,7 @@ static int fdomain_get_irq( int base )
 
 static int fdomain_isa_detect( int *irq, int *iobase )
 {
+#ifndef PCMCIA
    int i, j;
    int base = 0xdeadbeef;
    int flag = 0;
@@ -783,6 +787,9 @@ static int fdomain_isa_detect( int *irq, int *iobase )
    *iobase = base;
 
    return 1;			/* success */
+#else
+   return 0;
+#endif
 }
 
 /* PCI detection function: int fdomain_pci_bios_detect(int* irq, int*
@@ -852,7 +859,7 @@ static int fdomain_pci_bios_detect( int *irq, int *iobase, struct pci_dev **ret_
 }
 #endif
 
-struct Scsi_Host *__fdomain_16x0_detect( Scsi_Host_Template *tpnt )
+struct Scsi_Host *__fdomain_16x0_detect(struct scsi_host_template *tpnt )
 {
    int              retcode;
    struct Scsi_Host *shpnt;
@@ -901,7 +908,7 @@ struct Scsi_Host *__fdomain_16x0_detect( Scsi_Host_Template *tpnt )
    Write_FIFO_port       = port_base + Write_FIFO;
    Write_SCSI_Data_port  = port_base + Write_SCSI_Data;
 
-   fdomain_16x0_bus_reset( NULL);
+   fdomain_16x0_bus_reset(NULL);
 
    if (fdomain_test_loopback()) {
       printk(KERN_ERR  "scsi: <fdomain> Detection failed (loopback test failed at port base 0x%x)\n", port_base);
@@ -970,7 +977,7 @@ struct Scsi_Host *__fdomain_16x0_detect( Scsi_Host_Template *tpnt )
    return shpnt;
 }
 
-static int fdomain_16x0_detect( Scsi_Host_Template *tpnt )
+static int fdomain_16x0_detect(struct scsi_host_template *tpnt)
 {
 	if (fdomain)
 		fdomain_setup(fdomain);
@@ -1254,7 +1261,7 @@ static irqreturn_t do_fdomain_16x0_intr(int irq, void *dev_id,
    if (chip == tmc1800 && !current_SC->SCp.have_data_in
        && (current_SC->SCp.sent_command >= current_SC->cmd_len)) {
       
-      if(scsi_to_pci_dma_dir(current_SC->sc_data_direction)	== PCI_DMA_TODEVICE)
+      if(current_SC->sc_data_direction == DMA_TO_DEVICE)
       {
 	 current_SC->SCp.have_data_in = -1;
 	 outb( 0xd0 | PARITY_MASK, TMC_Cntl_port );
@@ -1387,7 +1394,8 @@ static irqreturn_t do_fdomain_16x0_intr(int irq, void *dev_id,
    return IRQ_HANDLED;
 }
 
-static int fdomain_16x0_queue( Scsi_Cmnd * SCpnt, void (*done)(Scsi_Cmnd *))
+static int fdomain_16x0_queue(struct scsi_cmnd *SCpnt,
+		void (*done)(struct scsi_cmnd *))
 {
    if (in_command) {
       panic( "scsi: <fdomain> fdomain_16x0_queue() NOT REENTRANT!\n" );
@@ -1439,7 +1447,7 @@ static int fdomain_16x0_queue( Scsi_Cmnd * SCpnt, void (*done)(Scsi_Cmnd *))
 }
 
 #if DEBUG_ABORT
-static void print_info(Scsi_Cmnd *SCpnt)
+static void print_info(struct scsi_cmnd *SCpnt)
 {
    unsigned int imr;
    unsigned int irr;
@@ -1510,7 +1518,7 @@ static void print_info(Scsi_Cmnd *SCpnt)
 }
 #endif
 
-static int fdomain_16x0_abort( Scsi_Cmnd *SCpnt)
+static int fdomain_16x0_abort(struct scsi_cmnd *SCpnt)
 {
 #if EVERY_ACCESS || ERRORS_ONLY || DEBUG_ABORT
    printk( "scsi: <fdomain> abort " );
@@ -1536,7 +1544,7 @@ static int fdomain_16x0_abort( Scsi_Cmnd *SCpnt)
    return SUCCESS;
 }
 
-int fdomain_16x0_bus_reset(Scsi_Cmnd *SCpnt)
+int fdomain_16x0_bus_reset(struct scsi_cmnd *SCpnt)
 {
    outb( 1, SCSI_Cntl_port );
    do_pause( 2 );
@@ -1547,29 +1555,12 @@ int fdomain_16x0_bus_reset(Scsi_Cmnd *SCpnt)
    return SUCCESS;
 }
 
-static int fdomain_16x0_host_reset(Scsi_Cmnd *SCpnt)
-{
-  return FAILED;
-}
-
-static int fdomain_16x0_device_reset(Scsi_Cmnd *SCpnt)
-{
-  return FAILED;
-}
-
-#include <scsi/scsi_ioctl.h>
-
 static int fdomain_16x0_biosparam(struct scsi_device *sdev,
 		struct block_device *bdev,
 		sector_t capacity, int *info_array)
 {
    int              drive;
-   unsigned char    buf[512 + sizeof (Scsi_Ioctl_Command)];
-   Scsi_Ioctl_Command *sic = (Scsi_Ioctl_Command *) buf;
    int		    size      = capacity;
-   unsigned char    *data     = sic->data;
-   unsigned char    do_read[] = { READ_6, 0, 0, 0, 1, 0 };
-   int              retcode;
    unsigned long    offset;
    struct drive_info {
       unsigned short cylinders;
@@ -1657,16 +1648,10 @@ static int fdomain_16x0_biosparam(struct scsi_device *sdev,
       info_array[2] = i.cylinders;
    } else {			/* 3.4 BIOS (and up?) */
       /* This algorithm was provided by Future Domain (much thanks!). */
+      unsigned char *p = scsi_bios_ptable(bdev);
 
-      sic->inlen  = 0;		/* zero bytes out */
-      sic->outlen = 512;		/* one sector in */
-      memcpy( data, do_read, sizeof( do_read ) );
-      retcode = kernel_scsi_ioctl( sdev,
-				   SCSI_IOCTL_SEND_COMMAND,
-				   sic );
-      if (!retcode				    /* SCSI command ok */
-	  && data[511] == 0xaa && data[510] == 0x55 /* Partition table valid */
-	  && data[0x1c2]) {			    /* Partition type */
+      if (p && p[65] == 0xaa && p[64] == 0x55 /* Partition table valid */
+	  && p[4]) {			    /* Partition type */
 
 	 /* The partition table layout is as follows:
 
@@ -1697,8 +1682,8 @@ static int fdomain_16x0_biosparam(struct scsi_device *sdev,
 	    Future Domain algorithm, but it seemed to be a reasonable thing
 	    to do, especially in the Linux and BSD worlds. */
 
-	 info_array[0] = data[0x1c3] + 1;	    /* heads */
-	 info_array[1] = data[0x1c4] & 0x3f;	    /* sectors */
+	 info_array[0] = p[5] + 1;	    /* heads */
+	 info_array[1] = p[6] & 0x3f;	    /* sectors */
       } else {
 
  	 /* Note that this new method guarantees that there will always be
@@ -1718,6 +1703,7 @@ static int fdomain_16x0_biosparam(struct scsi_device *sdev,
       }
 				/* For both methods, compute the cylinders */
       info_array[2] = (unsigned int)size / (info_array[0] * info_array[1] );
+      kfree(p);
    }
    
    return 0;
@@ -1732,7 +1718,7 @@ static int fdomain_16x0_release(struct Scsi_Host *shpnt)
 	return 0;
 }
 
-Scsi_Host_Template fdomain_driver_template = {
+struct scsi_host_template fdomain_driver_template = {
 	.module			= THIS_MODULE,
 	.name			= "fdomain",
 	.proc_name		= "fdomain",
@@ -1741,8 +1727,6 @@ Scsi_Host_Template fdomain_driver_template = {
 	.queuecommand		= fdomain_16x0_queue,
 	.eh_abort_handler	= fdomain_16x0_abort,
 	.eh_bus_reset_handler	= fdomain_16x0_bus_reset,
-	.eh_device_reset_handler = fdomain_16x0_device_reset,
-	.eh_host_reset_handler	= fdomain_16x0_host_reset,
 	.bios_param		= fdomain_16x0_biosparam,
 	.release		= fdomain_16x0_release,
 	.can_queue		= 1,
diff --git a/drivers/scsi/g_NCR5380.c b/drivers/scsi/g_NCR5380.c
index f289be23c..bcf97ec03 100644
--- a/drivers/scsi/g_NCR5380.c
+++ b/drivers/scsi/g_NCR5380.c
@@ -107,7 +107,7 @@
 #include <linux/sched.h>
 #include <linux/blkdev.h>
 #include "scsi.h"
-#include "hosts.h"
+#include <scsi/scsi_host.h>
 #include "g_NCR5380.h"
 #include "NCR5380.h"
 #include <linux/stat.h>
@@ -355,7 +355,7 @@ int __init generic_NCR5380_detect(Scsi_Host_Template * tpnt)
 		if (!(overrides[current_override].NCR5380_map_name))
 			continue;
 
-		ports = 0;
+		ports = NULL;
 		switch (overrides[current_override].board) {
 		case BOARD_NCR5380:
 			flags = FLAG_NO_PSEUDO_DMA;
diff --git a/drivers/scsi/gdth.c b/drivers/scsi/gdth.c
index 78b3a5120..6cb8fa2bd 100644
--- a/drivers/scsi/gdth.c
+++ b/drivers/scsi/gdth.c
@@ -410,7 +410,7 @@
 #endif
 
 #include "scsi.h"
-#include "hosts.h"
+#include <scsi/scsi_host.h>
 #include "gdth.h"
 
 static void gdth_delay(int milliseconds);
diff --git a/drivers/scsi/gvp11.c b/drivers/scsi/gvp11.c
index ba5db045e..30cbf73c7 100644
--- a/drivers/scsi/gvp11.c
+++ b/drivers/scsi/gvp11.c
@@ -16,7 +16,7 @@
 #include <linux/spinlock.h>
 
 #include "scsi.h"
-#include "hosts.h"
+#include <scsi/scsi_host.h>
 #include "wd33c93.h"
 #include "gvp11.h"
 
diff --git a/drivers/scsi/hosts.c b/drivers/scsi/hosts.c
index b59a4b051..12c5245c2 100644
--- a/drivers/scsi/hosts.c
+++ b/drivers/scsi/hosts.c
@@ -27,13 +27,11 @@
 #include <linux/string.h>
 #include <linux/mm.h>
 #include <linux/init.h>
-#include <linux/list.h>
 #include <linux/completion.h>
-#include <linux/unistd.h>
 
+#include <scsi/scsi_device.h>
 #include <scsi/scsi_host.h>
 #include <scsi/scsi_transport.h>
-#include "scsi.h"
 
 #include "scsi_priv.h"
 #include "scsi_logging.h"
diff --git a/drivers/scsi/hosts.h b/drivers/scsi/hosts.h
index ac68554c6..c27264bed 100644
--- a/drivers/scsi/hosts.h
+++ b/drivers/scsi/hosts.h
@@ -1,2 +1,2 @@
-// #warning "This file is obsolete, please use <scsi/scsi_host.h> instead"
+#warning "This file is obsolete, please use <scsi/scsi_host.h> instead"
 #include <scsi/scsi_host.h>
diff --git a/drivers/scsi/i60uscsi.c b/drivers/scsi/i60uscsi.c
index 03f6862c4..cfe8d1641 100644
--- a/drivers/scsi/i60uscsi.c
+++ b/drivers/scsi/i60uscsi.c
@@ -81,7 +81,7 @@
 #include <asm/io.h>
 #include <linux/blkdev.h>
 #include "scsi.h"
-#include "hosts.h"
+#include <scsi/scsi_host.h>
 #include "inia100.h"
 
 #define JIFFIES_TO_MS(t) ((t) * 1000 / HZ)
@@ -621,7 +621,7 @@ int orc_device_reset(ORC_HCS * pHCB, Scsi_Cmnd *SCpnt, unsigned int target)
 	pScb->SCB_XferLen = 0;
 	pScb->SCB_SGLen = 0;
 
-	pVirEscb->SCB_Srb = 0;
+	pVirEscb->SCB_Srb = NULL;
 	pVirEscb->SCB_Srb = SCpnt;
 	orc_exec_scb(pHCB, pScb);	/* Start execute SCB            */
 	spin_unlock_irqrestore(&(pHCB->BitAllocFlagLock), flags);
diff --git a/drivers/scsi/ibmmca.c b/drivers/scsi/ibmmca.c
index 9503802d2..917dc2ed9 100644
--- a/drivers/scsi/ibmmca.c
+++ b/drivers/scsi/ibmmca.c
@@ -45,7 +45,7 @@
 #include <asm/io.h>
 
 #include "scsi.h"
-#include "hosts.h"
+#include <scsi/scsi_host.h>
 #include "ibmmca.h"
 
 /* current version of this driver-source: */
diff --git a/drivers/scsi/ide-scsi.c b/drivers/scsi/ide-scsi.c
index 9b110a8e2..4f2a284c2 100644
--- a/drivers/scsi/ide-scsi.c
+++ b/drivers/scsi/ide-scsi.c
@@ -51,7 +51,7 @@
 #include <asm/uaccess.h>
 
 #include "scsi.h"
-#include "hosts.h"
+#include <scsi/scsi_host.h>
 #include <scsi/sg.h>
 
 #define IDESCSI_DEBUG_LOG		0
@@ -735,7 +735,7 @@ static int idescsi_ide_ioctl(struct inode *inode, struct file *file,
 			unsigned int cmd, unsigned long arg)
 {
 	struct block_device *bdev = inode->i_bdev;
-	return generic_ide_ioctl(bdev, cmd, arg);
+	return generic_ide_ioctl(file, bdev, cmd, arg);
 }
 
 static struct block_device_operations idescsi_ops = {
diff --git a/drivers/scsi/imm.c b/drivers/scsi/imm.c
index a4e953bed..915d593fb 100644
--- a/drivers/scsi/imm.c
+++ b/drivers/scsi/imm.c
@@ -793,7 +793,7 @@ static void imm_interrupt(void *data)
 	imm_pb_dismiss(dev);
 
 	spin_lock_irqsave(host->host_lock, flags);
-	dev->cur_cmd = 0;
+	dev->cur_cmd = NULL;
 	cmd->scsi_done(cmd);
 	spin_unlock_irqrestore(host->host_lock, flags);
 	return;
@@ -1118,6 +1118,12 @@ static int device_check(imm_struct *dev)
 	return -ENODEV;
 }
 
+static int imm_adjust_queue(struct scsi_device *device)
+{
+	blk_queue_bounce_limit(device->request_queue, BLK_BOUNCE_HIGH);
+	return 0;
+}
+
 static struct scsi_host_template imm_template = {
 	.module			= THIS_MODULE,
 	.proc_name		= "imm",
@@ -1133,6 +1139,7 @@ static struct scsi_host_template imm_template = {
 	.cmd_per_lun		= 1,
 	.use_clustering		= ENABLE_CLUSTERING,
 	.can_queue		= 1,
+	.slave_alloc		= imm_adjust_queue,
 };
 
 /***************************************************************************
diff --git a/drivers/scsi/imm.h b/drivers/scsi/imm.h
index 4ce6d7675..dc3aebf0e 100644
--- a/drivers/scsi/imm.h
+++ b/drivers/scsi/imm.h
@@ -79,7 +79,7 @@
 #include  <linux/interrupt.h>
 
 #include  <asm/io.h>
-#include  "hosts.h"
+#include  <scsi/scsi_host.h>
 /* batteries not included :-) */
 
 /*
diff --git a/drivers/scsi/in2000.c b/drivers/scsi/in2000.c
index 7bdf75f25..2597da1d2 100644
--- a/drivers/scsi/in2000.c
+++ b/drivers/scsi/in2000.c
@@ -126,7 +126,7 @@
 #include <asm/system.h>
 
 #include "scsi.h"
-#include "hosts.h"
+#include <scsi/scsi_host.h>
 
 #define IN2000_VERSION    "1.33-2.5"
 #define IN2000_DATE       "2002/11/03"
@@ -184,11 +184,9 @@
 static char *setup_args[] = { "", "", "", "", "", "", "", "", "" };
 
 /* filled in by 'insmod' */
-static char *setup_strings = 0;
+static char *setup_strings;
 
-#ifdef MODULE_PARM
 MODULE_PARM(setup_strings, "s");
-#endif
 
 static inline uchar read_3393(struct IN2000_hostdata *hostdata, uchar reg_num)
 {
@@ -470,7 +468,7 @@ static void in2000_execute(struct Scsi_Host *instance)
 	 */
 
 	cmd = (Scsi_Cmnd *) hostdata->input_Q;
-	prev = 0;
+	prev = NULL;
 	while (cmd) {
 		if (!(hostdata->busy[cmd->device->id] & (1 << cmd->device->lun)))
 			break;
@@ -1704,7 +1702,7 @@ static int in2000_abort(Scsi_Cmnd * cmd)
  */
 
 	tmp = (Scsi_Cmnd *) hostdata->input_Q;
-	prev = 0;
+	prev = NULL;
 	while (tmp) {
 		if (tmp == cmd) {
 			if (prev)
@@ -1925,7 +1923,7 @@ static int __init in2000_detect(Scsi_Host_Template * tpnt)
  */
 
 	if (!done_setup && setup_strings)
-		in2000_setup(setup_strings, 0);
+		in2000_setup(setup_strings, NULL);
 
 	detect_count = 0;
 	for (bios = 0; bios_tab[bios]; bios++) {
diff --git a/drivers/scsi/ini9100u.c b/drivers/scsi/ini9100u.c
index e634b66e8..96fa264b8 100644
--- a/drivers/scsi/ini9100u.c
+++ b/drivers/scsi/ini9100u.c
@@ -136,7 +136,7 @@
 #include <asm/io.h>
 
 #include "scsi.h"
-#include "hosts.h"
+#include <scsi/scsi_host.h>
 #include "ini9100u.h"
 
 #ifdef DEBUG_i91u
diff --git a/drivers/scsi/ipr.c b/drivers/scsi/ipr.c
index e9c5098ed..bf3942769 100644
--- a/drivers/scsi/ipr.c
+++ b/drivers/scsi/ipr.c
@@ -448,6 +448,7 @@ static void ipr_init_ipr_cmnd(struct ipr_cmnd *ipr_cmd)
 {
 	ipr_reinit_ipr_cmnd(ipr_cmd);
 	ipr_cmd->u.scratch = 0;
+	ipr_cmd->sibling = NULL;
 	init_timer(&ipr_cmd->timer);
 }
 
@@ -676,8 +677,8 @@ static void ipr_do_req(struct ipr_cmnd *ipr_cmd,
  **/
 static void ipr_internal_cmd_done(struct ipr_cmnd *ipr_cmd)
 {
-	if (ipr_cmd->u.sibling)
-		ipr_cmd->u.sibling = NULL;
+	if (ipr_cmd->sibling)
+		ipr_cmd->sibling = NULL;
 	else
 		complete(&ipr_cmd->completion);
 }
@@ -2884,6 +2885,7 @@ static int ipr_slave_alloc(struct scsi_device *sdev)
 		    (res->cfgte.res_addr.lun == sdev->lun)) {
 			res->sdev = sdev;
 			res->add_to_ml = 0;
+			res->in_erp = 0;
 			sdev->hostdata = res;
 			res->needs_sync_complete = 1;
 			break;
@@ -3014,10 +3016,10 @@ static void ipr_bus_reset_done(struct ipr_cmnd *ipr_cmd)
 	 * If abort has not completed, indicate the reset has, else call the
 	 * abort's done function to wake the sleeping eh thread
 	 */
-	if (ipr_cmd->u.sibling->u.sibling)
-		ipr_cmd->u.sibling->u.sibling = NULL;
+	if (ipr_cmd->sibling->sibling)
+		ipr_cmd->sibling->sibling = NULL;
 	else
-		ipr_cmd->u.sibling->done(ipr_cmd->u.sibling);
+		ipr_cmd->sibling->done(ipr_cmd->sibling);
 
 	list_add_tail(&ipr_cmd->queue, &ioa_cfg->free_q);
 	LEAVE;
@@ -3050,8 +3052,8 @@ static void ipr_abort_timeout(struct ipr_cmnd *ipr_cmd)
 
 	ipr_sdev_err(ipr_cmd->u.sdev, "Abort timed out. Resetting bus\n");
 	reset_cmd = ipr_get_free_ipr_cmnd(ioa_cfg);
-	ipr_cmd->u.sibling = reset_cmd;
-	reset_cmd->u.sibling = ipr_cmd;
+	ipr_cmd->sibling = reset_cmd;
+	reset_cmd->sibling = ipr_cmd;
 	reset_cmd->ioarcb.res_handle = ipr_cmd->ioarcb.res_handle;
 	cmd_pkt = &reset_cmd->ioarcb.cmd_pkt;
 	cmd_pkt->request_type = IPR_RQTYPE_IOACMD;
@@ -3435,8 +3437,10 @@ static void ipr_erp_done(struct ipr_cmnd *ipr_cmd)
 		       SCSI_SENSE_BUFFERSIZE);
 	}
 
-	if (res)
+	if (res) {
 		res->needs_sync_complete = 1;
+		res->in_erp = 0;
+	}
 	ipr_unmap_sglist(ioa_cfg, ipr_cmd);
 	list_add_tail(&ipr_cmd->queue, &ioa_cfg->free_q);
 	scsi_cmd->scsi_done(scsi_cmd);
@@ -3479,6 +3483,12 @@ static void ipr_reinit_ipr_cmnd_for_erp(struct ipr_cmnd *ipr_cmd)
 static void ipr_erp_request_sense(struct ipr_cmnd *ipr_cmd)
 {
 	struct ipr_cmd_pkt *cmd_pkt = &ipr_cmd->ioarcb.cmd_pkt;
+	u32 ioasc = be32_to_cpu(ipr_cmd->ioasa.ioasc);
+
+	if (IPR_IOASC_SENSE_KEY(ioasc) > 0) {
+		ipr_erp_done(ipr_cmd);
+		return;
+	}
 
 	ipr_reinit_ipr_cmnd_for_erp(ipr_cmd);
 
@@ -3525,6 +3535,11 @@ static void ipr_erp_cancel_all(struct ipr_cmnd *ipr_cmd)
 
 	ipr_reinit_ipr_cmnd_for_erp(ipr_cmd);
 
+	if (!res->tcq_active) {
+		ipr_erp_request_sense(ipr_cmd);
+		return;
+	}
+
 	cmd_pkt = &ipr_cmd->ioarcb.cmd_pkt;
 	cmd_pkt->request_type = IPR_RQTYPE_IOACMD;
 	cmd_pkt->cdb[0] = IPR_CANCEL_ALL_REQUESTS;
@@ -3756,6 +3771,7 @@ static void ipr_erp_start(struct ipr_ioa_cfg *ioa_cfg,
 			ipr_erp_cancel_all(ipr_cmd);
 			return;
 		}
+		res->needs_sync_complete = 1;
 		break;
 	case IPR_IOASC_NR_INIT_CMD_REQUIRED:
 		break;
@@ -4808,6 +4824,7 @@ static int ipr_reset_enable_ioa(struct ipr_cmnd *ipr_cmd)
 	ipr_cmd->timer.data = (unsigned long) ipr_cmd;
 	ipr_cmd->timer.expires = jiffies + IPR_OPERATIONAL_TIMEOUT;
 	ipr_cmd->timer.function = (void (*)(unsigned long))ipr_timeout;
+	ipr_cmd->done = ipr_reset_ioa_job;
 	add_timer(&ipr_cmd->timer);
 	list_add_tail(&ipr_cmd->queue, &ioa_cfg->pending_q);
 
diff --git a/drivers/scsi/ipr.h b/drivers/scsi/ipr.h
index 468c80796..6d616ac42 100644
--- a/drivers/scsi/ipr.h
+++ b/drivers/scsi/ipr.h
@@ -36,8 +36,8 @@
 /*
  * Literals
  */
-#define IPR_DRIVER_VERSION "2.0.7"
-#define IPR_DRIVER_DATE "(May 21, 2004)"
+#define IPR_DRIVER_VERSION "2.0.10"
+#define IPR_DRIVER_DATE "(June 7, 2004)"
 
 /*
  * IPR_DBG_TRACE: Setting this to 1 will turn on some general function tracing
@@ -932,13 +932,13 @@ struct ipr_cmnd {
 	dma_addr_t sense_buffer_dma;
 	unsigned short dma_use_sg;
 	dma_addr_t dma_handle;
+	struct ipr_cmnd *sibling;
 	union {
 		enum ipr_shutdown_type shutdown_type;
 		struct ipr_hostrcb *hostrcb;
 		unsigned long time_left;
 		unsigned long scratch;
 		struct ipr_resource_entry *res;
-		struct ipr_cmnd *sibling;
 		struct scsi_device *sdev;
 	} u;
 
diff --git a/drivers/scsi/ips.c b/drivers/scsi/ips.c
index 6f7df0a46..dc110cc80 100644
--- a/drivers/scsi/ips.c
+++ b/drivers/scsi/ips.c
@@ -176,7 +176,7 @@
 #include <scsi/sg.h>
 
 #include "scsi.h"
-#include "hosts.h"
+#include <scsi/scsi_host.h>
 #include "ips.h"
 
 #include <linux/module.h>
diff --git a/drivers/scsi/jazz_esp.c b/drivers/scsi/jazz_esp.c
index f158ec0b9..22f74cf70 100644
--- a/drivers/scsi/jazz_esp.c
+++ b/drivers/scsi/jazz_esp.c
@@ -16,7 +16,7 @@
 #include <linux/stat.h>
 
 #include "scsi.h"
-#include "hosts.h"
+#include <scsi/scsi_host.h>
 #include "NCR53C9x.h"
 
 #include <asm/irq.h>
diff --git a/drivers/scsi/lasi700.c b/drivers/scsi/lasi700.c
index 27f5664f9..874010865 100644
--- a/drivers/scsi/lasi700.c
+++ b/drivers/scsi/lasi700.c
@@ -49,8 +49,7 @@
 #include <asm/parisc-device.h>
 #include <asm/delay.h>
 
-#include "scsi.h"
-#include "hosts.h"
+#include <scsi/scsi_host.h>
 
 #include "lasi700.h"
 #include "53c700.h"
@@ -65,7 +64,7 @@ static struct parisc_device_id lasi700_ids[] = {
 	{ 0 }
 };
 
-static Scsi_Host_Template lasi700_template = {
+static struct scsi_host_template lasi700_template = {
 	.name		= "LASI SCSI 53c700",
 	.proc_name	= "lasi700",
 	.this_id	= 7,
diff --git a/drivers/scsi/libata-core.c b/drivers/scsi/libata-core.c
index 29dee2c25..7f2d11d87 100644
--- a/drivers/scsi/libata-core.c
+++ b/drivers/scsi/libata-core.c
@@ -50,13 +50,11 @@ static unsigned int ata_busy_sleep (struct ata_port *ap,
 				    unsigned long tmout_pat,
 			    	    unsigned long tmout);
 static void __ata_dev_select (struct ata_port *ap, unsigned int device);
-static void ata_dma_complete(struct ata_queued_cmd *qc, u8 host_stat);
 static void ata_host_set_pio(struct ata_port *ap);
 static void ata_host_set_udma(struct ata_port *ap);
 static void ata_dev_set_pio(struct ata_port *ap, unsigned int device);
 static void ata_dev_set_udma(struct ata_port *ap, unsigned int device);
 static void ata_set_mode(struct ata_port *ap);
-static int ata_qc_issue_prot(struct ata_queued_cmd *qc);
 
 static unsigned int ata_unique_id = 1;
 static struct workqueue_struct *ata_wq;
@@ -65,37 +63,6 @@ MODULE_AUTHOR("Jeff Garzik");
 MODULE_DESCRIPTION("Library module for ATA devices");
 MODULE_LICENSE("GPL");
 
-static const char * thr_state_name[] = {
-	"THR_UNKNOWN",
-	"THR_PORT_RESET",
-	"THR_AWAIT_DEATH",
-	"THR_PROBE_FAILED",
-	"THR_IDLE",
-	"THR_PROBE_SUCCESS",
-	"THR_PROBE_START",
-};
-
-/**
- *	ata_thr_state_name - convert thread state enum to string
- *	@thr_state: thread state to be converted to string
- *
- *	Converts the specified thread state id to a constant C string.
- *
- *	LOCKING:
- *	None.
- *
- *	RETURNS:
- *	The THR_xxx-prefixed string naming the specified thread
- *	state id, or the string "<invalid THR_xxx state>".
- */
-
-static const char *ata_thr_state_name(unsigned int thr_state)
-{
-	if (thr_state < ARRAY_SIZE(thr_state_name))
-		return thr_state_name[thr_state];
-	return "<invalid THR_xxx state>";
-}
-
 /**
  *	ata_tf_load_pio - send taskfile registers to host controller
  *	@ap: Port to which output is sent
@@ -1150,13 +1117,16 @@ err_out:
 }
 
 /**
- *	ata_port_reset -
- *	@ap:
+ *	ata_bus_probe - Reset and probe ATA bus
+ *	@ap: Bus to probe
  *
  *	LOCKING:
+ *
+ *	RETURNS:
+ *	Zero on success, non-zero on error.
  */
 
-static void ata_port_reset(struct ata_port *ap)
+static int ata_bus_probe(struct ata_port *ap)
 {
 	unsigned int i, found = 0;
 
@@ -1180,14 +1150,12 @@ static void ata_port_reset(struct ata_port *ap)
 	if (ap->flags & ATA_FLAG_PORT_DISABLED)
 		goto err_out_disable;
 
-	ap->thr_state = THR_PROBE_SUCCESS;
-
-	return;
+	return 0;
 
 err_out_disable:
 	ap->ops->port_disable(ap);
 err_out:
-	ap->thr_state = THR_PROBE_FAILED;
+	return -1;
 }
 
 /**
@@ -1782,37 +1750,35 @@ static void ata_dev_set_pio(struct ata_port *ap, unsigned int device)
 static void ata_sg_clean(struct ata_queued_cmd *qc)
 {
 	struct ata_port *ap = qc->ap;
-	struct scsi_cmnd *cmd = qc->scsicmd;
 	struct scatterlist *sg = qc->sg;
-	int dir = scsi_to_pci_dma_dir(cmd->sc_data_direction);
+	int dir = qc->pci_dma_dir;
 
-	assert(dir == SCSI_DATA_READ || dir == SCSI_DATA_WRITE);
-	assert(qc->flags & ATA_QCFLAG_SG);
+	assert(qc->flags & ATA_QCFLAG_DMAMAP);
 	assert(sg != NULL);
 
-	if (!cmd->use_sg)
+	if (qc->flags & ATA_QCFLAG_SINGLE)
 		assert(qc->n_elem == 1);
 
 	DPRINTK("unmapping %u sg elements\n", qc->n_elem);
 
-	if (cmd->use_sg)
+	if (qc->flags & ATA_QCFLAG_SG)
 		pci_unmap_sg(ap->host_set->pdev, sg, qc->n_elem, dir);
 	else
 		pci_unmap_single(ap->host_set->pdev, sg_dma_address(&sg[0]),
 				 sg_dma_len(&sg[0]), dir);
 
-	qc->flags &= ~ATA_QCFLAG_SG;
+	qc->flags &= ~ATA_QCFLAG_DMAMAP;
 	qc->sg = NULL;
 }
 
 /**
- *	ata_fill_sg -
- *	@qc:
+ *	ata_fill_sg - Fill PCI IDE PRD table
+ *	@qc: Metadata associated with taskfile to be transferred
  *
  *	LOCKING:
  *
  */
-void ata_fill_sg(struct ata_queued_cmd *qc)
+static void ata_fill_sg(struct ata_queued_cmd *qc)
 {
 	struct scatterlist *sg = qc->sg;
 	struct ata_port *ap = qc->ap;
@@ -1853,6 +1819,48 @@ void ata_fill_sg(struct ata_queued_cmd *qc)
 		ap->prd[idx - 1].flags_len |= cpu_to_le32(ATA_PRD_EOT);
 }
 
+/**
+ *	ata_qc_prep - Prepare taskfile for submission
+ *	@qc: Metadata associated with taskfile to be prepared
+ *
+ *	LOCKING:
+ *	spin_lock_irqsave(host_set lock)
+ */
+void ata_qc_prep(struct ata_queued_cmd *qc)
+{
+	if (!(qc->flags & ATA_QCFLAG_DMAMAP))
+		return;
+
+	ata_fill_sg(qc);
+}
+
+void ata_sg_init_one(struct ata_queued_cmd *qc, void *buf, unsigned int buflen)
+{
+	struct scatterlist *sg;
+
+	qc->flags |= ATA_QCFLAG_SINGLE;
+
+	memset(&qc->sgent, 0, sizeof(qc->sgent));
+	qc->sg = &qc->sgent;
+	qc->n_elem = 1;
+	qc->buf_virt = buf;
+
+	sg = qc->sg;
+	sg->page = virt_to_page(buf);
+	sg->offset = (unsigned long) buf & ~PAGE_MASK;
+	sg_dma_len(sg) = buflen;
+
+	WARN_ON(buflen > PAGE_SIZE);
+}
+
+void ata_sg_init(struct ata_queued_cmd *qc, struct scatterlist *sg,
+		 unsigned int n_elem)
+{
+	qc->flags |= ATA_QCFLAG_SG;
+	qc->sg = sg;
+	qc->n_elem = n_elem;
+}
+
 /**
  *	ata_sg_setup_one -
  *	@qc:
@@ -1867,30 +1875,18 @@ void ata_fill_sg(struct ata_queued_cmd *qc)
 static int ata_sg_setup_one(struct ata_queued_cmd *qc)
 {
 	struct ata_port *ap = qc->ap;
-	struct scsi_cmnd *cmd = qc->scsicmd;
-	int dir = scsi_to_pci_dma_dir(cmd->sc_data_direction);
+	int dir = qc->pci_dma_dir;
 	struct scatterlist *sg = qc->sg;
-	unsigned int have_sg = (qc->flags & ATA_QCFLAG_SG);
 	dma_addr_t dma_address;
 
-	assert(sg == &qc->sgent);
-	assert(qc->n_elem == 1);
-
-	sg->page = virt_to_page(cmd->request_buffer);
-	sg->offset = (unsigned long) cmd->request_buffer & ~PAGE_MASK;
-	sg_dma_len(sg) = cmd->request_bufflen;
-
-	if (!have_sg)
-		return 0;
-
-	dma_address = pci_map_single(ap->host_set->pdev, cmd->request_buffer,
-				     cmd->request_bufflen, dir);
+	dma_address = pci_map_single(ap->host_set->pdev, qc->buf_virt,
+				     sg_dma_len(sg), dir);
 	if (pci_dma_mapping_error(dma_address))
 		return -1;
 
 	sg_dma_address(sg) = dma_address;
 
-	DPRINTK("mapped buffer of %d bytes for %s\n", cmd->request_bufflen,
+	DPRINTK("mapped buffer of %d bytes for %s\n", sg_dma_len(sg),
 		qc->tf.flags & ATA_TFLAG_WRITE ? "write" : "read");
 
 	return 0;
@@ -1910,24 +1906,19 @@ static int ata_sg_setup_one(struct ata_queued_cmd *qc)
 static int ata_sg_setup(struct ata_queued_cmd *qc)
 {
 	struct ata_port *ap = qc->ap;
-	struct scsi_cmnd *cmd = qc->scsicmd;
-	struct scatterlist *sg;
-	int n_elem;
-	unsigned int have_sg = (qc->flags & ATA_QCFLAG_SG);
-
-	VPRINTK("ENTER, ata%u, use_sg %d\n", ap->id, cmd->use_sg);
-	assert(cmd->use_sg > 0);
-
-	sg = (struct scatterlist *)cmd->request_buffer;
-	if (have_sg) {
-		int dir = scsi_to_pci_dma_dir(cmd->sc_data_direction);
-		n_elem = pci_map_sg(ap->host_set->pdev, sg, cmd->use_sg, dir);
-		if (n_elem < 1)
-			return -1;
-		DPRINTK("%d sg elements mapped\n", n_elem);
-	} else {
-		n_elem = cmd->use_sg;
-	}
+	struct scatterlist *sg = qc->sg;
+	int n_elem, dir;
+
+	VPRINTK("ENTER, ata%u\n", ap->id);
+	assert(qc->flags & ATA_QCFLAG_SG);
+
+	dir = qc->pci_dma_dir;
+	n_elem = pci_map_sg(ap->host_set->pdev, sg, qc->n_elem, dir);
+	if (n_elem < 1)
+		return -1;
+
+	DPRINTK("%d sg elements mapped\n", n_elem);
+
 	qc->n_elem = n_elem;
 
 	return 0;
@@ -2038,7 +2029,7 @@ static void ata_pio_sector(struct ata_port *ap)
 {
 	struct ata_queued_cmd *qc;
 	struct scatterlist *sg;
-	struct scsi_cmnd *cmd;
+	struct page *page;
 	unsigned char *buf;
 	u8 status;
 
@@ -2070,19 +2061,19 @@ static void ata_pio_sector(struct ata_port *ap)
 	qc = ata_qc_from_tag(ap, ap->active_tag);
 	assert(qc != NULL);
 
-	cmd = qc->scsicmd;
 	sg = qc->sg;
 
 	if (qc->cursect == (qc->nsect - 1))
 		ap->pio_task_state = PIO_ST_LAST;
 
-	buf = kmap(sg[qc->cursg].page) +
+	page = sg[qc->cursg].page;
+	buf = kmap(page) +
 	      sg[qc->cursg].offset + (qc->cursg_ofs * ATA_SECT_SIZE);
 
 	qc->cursect++;
 	qc->cursg_ofs++;
 
-	if (cmd->use_sg)
+	if (qc->flags & ATA_QCFLAG_SG)
 		if ((qc->cursg_ofs * ATA_SECT_SIZE) == sg_dma_len(&sg[qc->cursg])) {
 			qc->cursg++;
 			qc->cursg_ofs = 0;
@@ -2099,7 +2090,7 @@ static void ata_pio_sector(struct ata_port *ap)
 	else
 		insl(ap->ioaddr.data_addr, buf, ATA_SECT_DWORDS);
 
-	kunmap(sg[qc->cursg].page);
+	kunmap(page);
 }
 
 static void ata_pio_task(void *_data)
@@ -2146,8 +2137,8 @@ static void ata_pio_task(void *_data)
 }
 
 /**
- *	ata_eng_timeout - Handle timeout of queued command
- *	@ap: Port on which timed-out command is active
+ *	ata_qc_timeout - Handle timeout of queued command
+ *	@qc: Command that timed out
  *
  *	Some part of the kernel (currently, only the SCSI layer)
  *	has noticed that the active command on port @ap has not
@@ -2161,23 +2152,15 @@ static void ata_pio_task(void *_data)
  *	transaction completed successfully.
  *
  *	LOCKING:
- *	Inherited from SCSI layer (none, can sleep)
  */
 
-void ata_eng_timeout(struct ata_port *ap)
+static void ata_qc_timeout(struct ata_queued_cmd *qc)
 {
-	u8 host_stat, drv_stat;
-	struct ata_queued_cmd *qc;
+	struct ata_port *ap = qc->ap;
+	u8 host_stat = 0, drv_stat;
 
 	DPRINTK("ENTER\n");
 
-	qc = ata_qc_from_tag(ap, ap->active_tag);
-	if (!qc) {
-		printk(KERN_ERR "ata%u: BUG: timeout without command\n",
-		       ap->id);
-		goto out;
-	}
-
 	/* hack alert!  We cannot use the supplied completion
 	 * function from inside the ->eh_strategy_handler() thread.
 	 * libata is the only user of ->eh_strategy_handler() in
@@ -2187,38 +2170,69 @@ void ata_eng_timeout(struct ata_port *ap)
 	qc->scsidone = scsi_finish_command;
 
 	switch (qc->tf.protocol) {
+
 	case ATA_PROT_DMA:
-		if (ap->flags & ATA_FLAG_MMIO) {
-			void *mmio = (void *) ap->ioaddr.bmdma_addr;
-			host_stat = readb(mmio + ATA_DMA_STATUS);
-		} else
-			host_stat = inb(ap->ioaddr.bmdma_addr + ATA_DMA_STATUS);
+	case ATA_PROT_ATAPI_DMA:
+		host_stat = ata_bmdma_status(ap);
 
-		printk(KERN_ERR "ata%u: DMA timeout, stat 0x%x\n",
-		       ap->id, host_stat);
+		/* before we do anything else, clear DMA-Start bit */
+		ata_bmdma_stop(ap);
 
-		ata_dma_complete(qc, host_stat);
-		break;
+		/* fall through */
 
 	case ATA_PROT_NODATA:
-		drv_stat = ata_busy_wait(ap, ATA_BUSY | ATA_DRQ, 1000);
+	default:
+		ata_altstatus(ap);
+		drv_stat = ata_chk_status(ap);
+
+		/* ack bmdma irq events */
+		ata_bmdma_ack_irq(ap);
 
-		printk(KERN_ERR "ata%u: command 0x%x timeout, stat 0x%x\n",
-		       ap->id, qc->tf.command, drv_stat);
+		printk(KERN_ERR "ata%u: command 0x%x timeout, stat 0x%x host_stat 0x%x\n",
+		       ap->id, qc->tf.command, drv_stat, host_stat);
 
+		/* complete taskfile transaction */
 		ata_qc_complete(qc, drv_stat);
 		break;
+	}
 
-	default:
-		drv_stat = ata_busy_wait(ap, ATA_BUSY | ATA_DRQ, 1000);
+	DPRINTK("EXIT\n");
+}
 
-		printk(KERN_ERR "ata%u: unknown timeout, cmd 0x%x stat 0x%x\n",
-		       ap->id, qc->tf.command, drv_stat);
+/**
+ *	ata_eng_timeout - Handle timeout of queued command
+ *	@ap: Port on which timed-out command is active
+ *
+ *	Some part of the kernel (currently, only the SCSI layer)
+ *	has noticed that the active command on port @ap has not
+ *	completed after a specified length of time.  Handle this
+ *	condition by disabling DMA (if necessary) and completing
+ *	transactions, with error if necessary.
+ *
+ *	This also handles the case of the "lost interrupt", where
+ *	for some reason (possibly hardware bug, possibly driver bug)
+ *	an interrupt was not delivered to the driver, even though the
+ *	transaction completed successfully.
+ *
+ *	LOCKING:
+ *	Inherited from SCSI layer (none, can sleep)
+ */
 
-		ata_qc_complete(qc, drv_stat);
-		break;
+void ata_eng_timeout(struct ata_port *ap)
+{
+	struct ata_queued_cmd *qc;
+
+	DPRINTK("ENTER\n");
+
+	qc = ata_qc_from_tag(ap, ap->active_tag);
+	if (!qc) {
+		printk(KERN_ERR "ata%u: BUG: timeout without command\n",
+		       ap->id);
+		goto out;
 	}
 
+	ata_qc_timeout(qc);
+
 out:
 	DPRINTK("EXIT\n");
 }
@@ -2294,29 +2308,25 @@ struct ata_queued_cmd *ata_qc_new_init(struct ata_port *ap,
 void ata_qc_complete(struct ata_queued_cmd *qc, u8 drv_stat)
 {
 	struct ata_port *ap = qc->ap;
-	struct scsi_cmnd *cmd = qc->scsicmd;
 	unsigned int tag, do_clear = 0;
+	int rc;
 
 	assert(qc != NULL);	/* ata_qc_from_tag _might_ return NULL */
 	assert(qc->flags & ATA_QCFLAG_ACTIVE);
 
-	if (likely(qc->flags & ATA_QCFLAG_SG))
+	if (likely(qc->flags & ATA_QCFLAG_DMAMAP))
 		ata_sg_clean(qc);
 
-	if (cmd) {
-		if (unlikely(drv_stat & (ATA_ERR | ATA_BUSY | ATA_DRQ))) {
-			if (is_atapi_taskfile(&qc->tf))
-				cmd->result = SAM_STAT_CHECK_CONDITION;
-			else
-				ata_to_sense_error(qc);
-		} else {
-			cmd->result = SAM_STAT_GOOD;
-		}
+	/* call completion callback */
+	rc = qc->complete_fn(qc, drv_stat);
 
-		qc->scsidone(cmd);
-	}
+	/* if callback indicates not to complete command (non-zero),
+	 * return immediately
+	 */
+	if (rc != 0)
+		return;
 
-	qc->flags &= ~ATA_QCFLAG_ACTIVE;
+	qc->flags = 0;
 	tag = qc->tag;
 	if (likely(ata_tag_valid(tag))) {
 		if (tag == ap->active_tag)
@@ -2351,25 +2361,21 @@ void ata_qc_complete(struct ata_queued_cmd *qc, u8 drv_stat)
 int ata_qc_issue(struct ata_queued_cmd *qc)
 {
 	struct ata_port *ap = qc->ap;
-	struct scsi_cmnd *cmd = qc->scsicmd;
 
 	if (qc->flags & ATA_QCFLAG_SG) {
-		/* set up SG table */
-		if (cmd->use_sg) {
-			if (ata_sg_setup(qc))
-				goto err_out;
-		} else {
-			if (ata_sg_setup_one(qc))
-				goto err_out;
-		}
-
-		ap->ops->fill_sg(qc);
+		if (ata_sg_setup(qc))
+			goto err_out;
+	} else if (qc->flags & ATA_QCFLAG_SINGLE) {
+		if (ata_sg_setup_one(qc))
+			goto err_out;
 	}
 
+	ap->ops->qc_prep(qc);
+
 	qc->ap->active_tag = qc->tag;
 	qc->flags |= ATA_QCFLAG_ACTIVE;
 
-	return ata_qc_issue_prot(qc);
+	return ap->ops->qc_issue(qc);
 
 err_out:
 	return -1;
@@ -2391,7 +2397,7 @@ err_out:
  *	Zero on success, negative on error.
  */
 
-static int ata_qc_issue_prot(struct ata_queued_cmd *qc)
+int ata_qc_issue_prot(struct ata_queued_cmd *qc)
 {
 	struct ata_port *ap = qc->ap;
 
@@ -2446,7 +2452,7 @@ void ata_bmdma_setup_mmio (struct ata_queued_cmd *qc)
 {
 	struct ata_port *ap = qc->ap;
 	unsigned int rw = (qc->tf.flags & ATA_TFLAG_WRITE);
-	u8 host_stat, dmactl;
+	u8 dmactl;
 	void *mmio = (void *) ap->ioaddr.bmdma_addr;
 
 	/* load PRD table addr. */
@@ -2460,10 +2466,6 @@ void ata_bmdma_setup_mmio (struct ata_queued_cmd *qc)
 		dmactl |= ATA_DMA_WR;
 	writeb(dmactl, mmio + ATA_DMA_CMD);
 
-	/* clear interrupt, error bits */
-	host_stat = readb(mmio + ATA_DMA_STATUS);
-	writeb(host_stat | ATA_DMA_INTR | ATA_DMA_ERR, mmio + ATA_DMA_STATUS);
-
 	/* issue r/w command */
 	ap->ops->exec_command(ap, &qc->tf);
 }
@@ -2511,7 +2513,7 @@ void ata_bmdma_setup_pio (struct ata_queued_cmd *qc)
 {
 	struct ata_port *ap = qc->ap;
 	unsigned int rw = (qc->tf.flags & ATA_TFLAG_WRITE);
-	u8 host_stat, dmactl;
+	u8 dmactl;
 
 	/* load PRD table addr. */
 	outl(ap->prd_dma, ap->ioaddr.bmdma_addr + ATA_DMA_TABLE_OFS);
@@ -2523,11 +2525,6 @@ void ata_bmdma_setup_pio (struct ata_queued_cmd *qc)
 		dmactl |= ATA_DMA_WR;
 	outb(dmactl, ap->ioaddr.bmdma_addr + ATA_DMA_CMD);
 
-	/* clear interrupt, error bits */
-	host_stat = inb(ap->ioaddr.bmdma_addr + ATA_DMA_STATUS);
-	outb(host_stat | ATA_DMA_INTR | ATA_DMA_ERR,
-	     ap->ioaddr.bmdma_addr + ATA_DMA_STATUS);
-
 	/* issue r/w command */
 	ap->ops->exec_command(ap, &qc->tf);
 }
@@ -2551,48 +2548,9 @@ void ata_bmdma_start_pio (struct ata_queued_cmd *qc)
 	     ap->ioaddr.bmdma_addr + ATA_DMA_CMD);
 }
 
-/**
- *	ata_dma_complete - Complete an active ATA BMDMA command
- *	@qc: Command to complete
- *	@host_stat: BMDMA status register contents
- *
- *	LOCKING:
- */
-
-static void ata_dma_complete(struct ata_queued_cmd *qc, u8 host_stat)
+void ata_bmdma_irq_clear(struct ata_port *ap)
 {
-	struct ata_port *ap = qc->ap;
-	VPRINTK("ENTER\n");
-
-	if (ap->flags & ATA_FLAG_MMIO) {
-		void *mmio = (void *) ap->ioaddr.bmdma_addr;
-
-		/* clear start/stop bit */
-		writeb(readb(mmio + ATA_DMA_CMD) & ~ATA_DMA_START,
-		       mmio + ATA_DMA_CMD);
-
-		/* ack intr, err bits */
-		writeb(host_stat | ATA_DMA_INTR | ATA_DMA_ERR,
-		       mmio + ATA_DMA_STATUS);
-	} else {
-		/* clear start/stop bit */
-		outb(inb(ap->ioaddr.bmdma_addr + ATA_DMA_CMD) & ~ATA_DMA_START,
-		     ap->ioaddr.bmdma_addr + ATA_DMA_CMD);
-
-		/* ack intr, err bits */
-		outb(host_stat | ATA_DMA_INTR | ATA_DMA_ERR,
-		     ap->ioaddr.bmdma_addr + ATA_DMA_STATUS);
-	}
-
-
-	/* one-PIO-cycle guaranteed wait, per spec, for HDMA1:0 transition */
-	ata_altstatus(ap);		/* dummy read */
-
-	DPRINTK("host %u, host_stat==0x%X, drv_stat==0x%X\n",
-		ap->id, (u32) host_stat, (u32) ata_chk_status(ap));
-
-	/* get drive status; clear intr; complete txn */
-	ata_qc_complete(qc, ata_wait_idle(ap));
+	ata_bmdma_ack_irq(ap);
 }
 
 /**
@@ -2615,59 +2573,61 @@ inline unsigned int ata_host_intr (struct ata_port *ap,
 				   struct ata_queued_cmd *qc)
 {
 	u8 status, host_stat;
-	unsigned int handled = 0;
 
 	switch (qc->tf.protocol) {
 
-	/* BMDMA completion */
 	case ATA_PROT_DMA:
 	case ATA_PROT_ATAPI_DMA:
-		if (ap->flags & ATA_FLAG_MMIO) {
-			void *mmio = (void *) ap->ioaddr.bmdma_addr;
-			host_stat = readb(mmio + ATA_DMA_STATUS);
-		} else
-			host_stat = inb(ap->ioaddr.bmdma_addr + ATA_DMA_STATUS);
+	case ATA_PROT_ATAPI:
+		/* check status of DMA engine */
+		host_stat = ata_bmdma_status(ap);
 		VPRINTK("BUS_DMA (host_stat 0x%X)\n", host_stat);
 
-		if (!(host_stat & ATA_DMA_INTR)) {
-			ap->stats.idle_irq++;
-			break;
-		}
+		/* if it's not our irq... */
+		if (!(host_stat & ATA_DMA_INTR))
+			goto idle_irq;
 
-		ata_dma_complete(qc, host_stat);
-		handled = 1;
-		break;
+		/* before we do anything else, clear DMA-Start bit */
+		ata_bmdma_stop(ap);
+
+		/* fall through */
 
-	/* command completion, but no data xfer */
-	/* FIXME: a shared interrupt _will_ cause a non-data command
-	 * to be completed prematurely, with an error.
-	 *
-	 * This doesn't matter right now, since we aren't sending
-	 * non-data commands down this pipe except in development
-	 * situations.
-	 */
-	case ATA_PROT_ATAPI:
 	case ATA_PROT_NODATA:
-		status = ata_busy_wait(ap, ATA_BUSY | ATA_DRQ, 1000);
-		DPRINTK("BUS_NODATA (drv_stat 0x%X)\n", status);
+		/* check altstatus */
+		status = ata_altstatus(ap);
+		if (status & ATA_BUSY)
+			goto idle_irq;
+
+		/* check main status, clearing INTRQ */
+		status = ata_chk_status(ap);
+		if (unlikely(status & ATA_BUSY))
+			goto idle_irq;
+		DPRINTK("BUS_NODATA (dev_stat 0x%X)\n", status);
+
+		/* ack bmdma irq events */
+		ata_bmdma_ack_irq(ap);
+
+		/* complete taskfile transaction */
 		ata_qc_complete(qc, status);
-		handled = 1;
 		break;
 
 	default:
-		ap->stats.idle_irq++;
+		goto idle_irq;
+	}
+
+	return 1;	/* irq handled */
+
+idle_irq:
+	ap->stats.idle_irq++;
 
 #ifdef ATA_IRQ_TRAP
-		if ((ap->stats.idle_irq % 1000) == 0) {
-			handled = 1;
-			ata_irq_ack(ap, 0); /* debug trap */
-			printk(KERN_WARNING "ata%d: irq trap\n", ap->id);
-		}
-#endif
-		break;
+	if ((ap->stats.idle_irq % 1000) == 0) {
+		handled = 1;
+		ata_irq_ack(ap, 0); /* debug trap */
+		printk(KERN_WARNING "ata%d: irq trap\n", ap->id);
 	}
-
-	return handled;
+#endif
+	return 0;	/* irq not handled */
 }
 
 /**
@@ -2701,7 +2661,7 @@ irqreturn_t ata_interrupt (int irq, void *dev_instance, struct pt_regs *regs)
 
 			qc = ata_qc_from_tag(ap, ap->active_tag);
 			if (qc && (!(qc->tf.ctl & ATA_NIEN)))
-				handled += ata_host_intr(ap, qc);
+				handled |= ata_host_intr(ap, qc);
 		}
 	}
 
@@ -2710,62 +2670,6 @@ irqreturn_t ata_interrupt (int irq, void *dev_instance, struct pt_regs *regs)
 	return IRQ_RETVAL(handled);
 }
 
-/**
- *	ata_thread_iter -
- *	@ap:
- *
- *	LOCKING:
- *
- *	RETURNS:
- *
- */
-
-static unsigned long ata_thread_iter(struct ata_port *ap)
-{
-	long timeout = 0;
-
-	DPRINTK("ata%u: thr_state %s\n",
-		ap->id, ata_thr_state_name(ap->thr_state));
-
-	switch (ap->thr_state) {
-	case THR_UNKNOWN:
-		ap->thr_state = THR_PORT_RESET;
-		break;
-
-	case THR_PROBE_START:
-		ap->thr_state = THR_PORT_RESET;
-		break;
-
-	case THR_PORT_RESET:
-		ata_port_reset(ap);
-		break;
-
-	case THR_PROBE_SUCCESS:
-		up(&ap->probe_sem);
-		ap->thr_state = THR_IDLE;
-		break;
-
-	case THR_PROBE_FAILED:
-		up(&ap->probe_sem);
-		ap->thr_state = THR_AWAIT_DEATH;
-		break;
-
-	case THR_AWAIT_DEATH:
-	case THR_IDLE:
-		timeout = -1;
-		break;
-
-	default:
-		printk(KERN_DEBUG "ata%u: unknown thr state %s\n",
-		       ap->id, ata_thr_state_name(ap->thr_state));
-		break;
-	}
-
-	DPRINTK("ata%u: new thr_state %s, returning %ld\n",
-		ap->id, ata_thr_state_name(ap->thr_state), timeout);
-	return timeout;
-}
-
 /**
  *	atapi_packet_task - Write CDB bytes to hardware
  *	@_data: Port to which ATAPI device is attached.
@@ -2847,21 +2751,6 @@ void ata_port_stop (struct ata_port *ap)
 	pci_free_consistent(pdev, ATA_PRD_TBL_SZ, ap->prd, ap->prd_dma);
 }
 
-static void ata_probe_task(void *_data)
-{
-	struct ata_port *ap = _data;
-	long timeout;
-
-	timeout = ata_thread_iter(ap);
-	if (timeout < 0)
-		return;
-
-	if (timeout > 0)
-		queue_delayed_work(ata_wq, &ap->probe_task, timeout);
-	else
-		queue_work(ata_wq, &ap->probe_task);
-}
-
 /**
  *	ata_host_remove - Unregister SCSI host structure with upper layers
  *	@ap: Port to unregister
@@ -2918,7 +2807,6 @@ static void ata_host_init(struct ata_port *ap, struct Scsi_Host *host,
 	ap->udma_mask = ent->udma_mask;
 	ap->flags |= ent->host_flags;
 	ap->ops = ent->port_ops;
-	ap->thr_state = THR_PROBE_START;
 	ap->cbl = ATA_CBL_NONE;
 	ap->device[0].flags = ATA_DFLAG_MASTER;
 	ap->active_tag = ATA_TAG_POISON;
@@ -2926,13 +2814,10 @@ static void ata_host_init(struct ata_port *ap, struct Scsi_Host *host,
 
 	INIT_WORK(&ap->packet_task, atapi_packet_task, ap);
 	INIT_WORK(&ap->pio_task, ata_pio_task, ap);
-	INIT_WORK(&ap->probe_task, ata_probe_task, ap);
 
 	for (i = 0; i < ATA_MAX_DEVICES; i++)
 		ap->device[i].devno = i;
 
-	init_MUTEX_LOCKED(&ap->probe_sem);
-
 #ifdef ATA_IRQ_TRAP
 	ap->stats.unhandled_irq = 1;
 	ap->stats.idle_irq = 1;
@@ -3011,6 +2896,7 @@ int ata_device_add(struct ata_probe_ent *ent)
 	host_set->irq = ent->irq;
 	host_set->mmio_base = ent->mmio_base;
 	host_set->private_data = ent->private_data;
+	host_set->ops = ent->port_ops;
 
 	/* register each port bound to this device */
 	for (i = 0; i < ent->n_ports; i++) {
@@ -3033,6 +2919,8 @@ int ata_device_add(struct ata_probe_ent *ent)
 	       		ap->ioaddr.bmdma_addr,
 	       		ent->irq);
 
+		ata_chk_status(ap);
+		host_set->ops->irq_clear(ap);
 		count++;
 	}
 
@@ -3055,12 +2943,17 @@ int ata_device_add(struct ata_probe_ent *ent)
 		ap = host_set->ports[i];
 
 		DPRINTK("ata%u: probe begin\n", ap->id);
-		queue_work(ata_wq, &ap->probe_task);	/* start probe */
-
-		DPRINTK("ata%u: probe-wait begin\n", ap->id);
-		down(&ap->probe_sem);	/* wait for end */
+		rc = ata_bus_probe(ap);
+		DPRINTK("ata%u: probe end\n", ap->id);
 
-		DPRINTK("ata%u: probe-wait end\n", ap->id);
+		if (rc) {
+			/* FIXME: do something useful here?
+			 * Current libata behavior will
+			 * tear down everything when
+			 * the module is removed
+			 * or the h/w is unplugged.
+			 */
+		}
 
 		rc = scsi_add_host(ap->host, &pdev->dev);
 		if (rc) {
@@ -3359,10 +3252,10 @@ void ata_pci_remove_one (struct pci_dev *pdev)
 	}
 
 	free_irq(host_set->irq, host_set);
+	if (host_set->ops->host_stop)
+		host_set->ops->host_stop(host_set);
 	if (host_set->mmio_base)
 		iounmap(host_set->mmio_base);
-	if (host_set->ports[0]->ops->host_stop)
-		host_set->ports[0]->ops->host_stop(host_set);
 
 	for (i = 0; i < host_set->n_ports; i++) {
 		ap = host_set->ports[i];
@@ -3465,7 +3358,10 @@ EXPORT_SYMBOL_GPL(pci_test_config_bits);
 EXPORT_SYMBOL_GPL(ata_std_bios_param);
 EXPORT_SYMBOL_GPL(ata_std_ports);
 EXPORT_SYMBOL_GPL(ata_device_add);
+EXPORT_SYMBOL_GPL(ata_sg_init);
+EXPORT_SYMBOL_GPL(ata_sg_init_one);
 EXPORT_SYMBOL_GPL(ata_qc_complete);
+EXPORT_SYMBOL_GPL(ata_qc_issue_prot);
 EXPORT_SYMBOL_GPL(ata_eng_timeout);
 EXPORT_SYMBOL_GPL(ata_tf_load_pio);
 EXPORT_SYMBOL_GPL(ata_tf_load_mmio);
@@ -3480,11 +3376,12 @@ EXPORT_SYMBOL_GPL(ata_exec_command_mmio);
 EXPORT_SYMBOL_GPL(ata_port_start);
 EXPORT_SYMBOL_GPL(ata_port_stop);
 EXPORT_SYMBOL_GPL(ata_interrupt);
-EXPORT_SYMBOL_GPL(ata_fill_sg);
+EXPORT_SYMBOL_GPL(ata_qc_prep);
 EXPORT_SYMBOL_GPL(ata_bmdma_setup_pio);
 EXPORT_SYMBOL_GPL(ata_bmdma_start_pio);
 EXPORT_SYMBOL_GPL(ata_bmdma_setup_mmio);
 EXPORT_SYMBOL_GPL(ata_bmdma_start_mmio);
+EXPORT_SYMBOL_GPL(ata_bmdma_irq_clear);
 EXPORT_SYMBOL_GPL(ata_port_probe);
 EXPORT_SYMBOL_GPL(sata_phy_reset);
 EXPORT_SYMBOL_GPL(ata_bus_reset);
diff --git a/drivers/scsi/libata-scsi.c b/drivers/scsi/libata-scsi.c
index fed311e81..b3340607b 100644
--- a/drivers/scsi/libata-scsi.c
+++ b/drivers/scsi/libata-scsi.c
@@ -182,7 +182,8 @@ int ata_scsi_slave_config(struct scsi_device *sdev)
 		 * 65534 when Jens Axboe's patch for dynamically
 		 * determining max_sectors is merged.
 		 */
-		if (dev->flags & ATA_DFLAG_LBA48) {
+		if ((dev->flags & ATA_DFLAG_LBA48) &&
+		    ((dev->flags & ATA_DFLAG_LOCK_SECTORS) == 0)) {
 			sdev->host->max_sectors = 2048;
 			blk_queue_max_sectors(sdev->request_queue, 2048);
 		}
@@ -334,6 +335,24 @@ static unsigned int ata_scsi_rw_xlat(struct ata_queued_cmd *qc, u8 *scsicmd)
 	return 1;
 }
 
+static int ata_scsi_qc_complete(struct ata_queued_cmd *qc, u8 drv_stat)
+{
+	struct scsi_cmnd *cmd = qc->scsicmd;
+
+	if (unlikely(drv_stat & (ATA_ERR | ATA_BUSY | ATA_DRQ))) {
+		if (is_atapi_taskfile(&qc->tf))
+			cmd->result = SAM_STAT_CHECK_CONDITION;
+		else
+			ata_to_sense_error(qc);
+	} else {
+		cmd->result = SAM_STAT_GOOD;
+	}
+
+	qc->scsidone(cmd);
+
+	return 0;
+}
+
 /**
  *	ata_scsi_translate - Translate then issue SCSI command to ATA device
  *	@ap: ATA port to which the command is addressed
@@ -367,6 +386,7 @@ static void ata_scsi_translate(struct ata_port *ap, struct ata_device *dev,
 	if (!qc)
 		return;
 
+	/* data is present; dma-map it */
 	if (cmd->sc_data_direction == SCSI_DATA_READ ||
 	    cmd->sc_data_direction == SCSI_DATA_WRITE) {
 		if (unlikely(cmd->request_bufflen < 1)) {
@@ -375,9 +395,17 @@ static void ata_scsi_translate(struct ata_port *ap, struct ata_device *dev,
 			goto err_out;
 		}
 
-		qc->flags |= ATA_QCFLAG_SG; /* data is present; dma-map it */
+		if (cmd->use_sg)
+			ata_sg_init(qc, cmd->request_buffer, cmd->use_sg);
+		else
+			ata_sg_init_one(qc, cmd->request_buffer,
+					cmd->request_bufflen);
+
+		qc->pci_dma_dir = scsi_to_pci_dma_dir(cmd->sc_data_direction);
 	}
 
+	qc->complete_fn = ata_scsi_qc_complete;
+
 	if (xlat_func(qc, scsicmd))
 		goto err_out;
 
diff --git a/drivers/scsi/mac_esp.c b/drivers/scsi/mac_esp.c
index 0a42323b3..5b656df5f 100644
--- a/drivers/scsi/mac_esp.c
+++ b/drivers/scsi/mac_esp.c
@@ -26,7 +26,7 @@
 #include <linux/interrupt.h>
 
 #include "scsi.h"
-#include "hosts.h"
+#include <scsi/scsi_host.h>
 #include "NCR53C9x.h"
 
 #include <asm/io.h>
diff --git a/drivers/scsi/mac_scsi.c b/drivers/scsi/mac_scsi.c
index 890484ae6..f343fc704 100644
--- a/drivers/scsi/mac_scsi.c
+++ b/drivers/scsi/mac_scsi.c
@@ -52,7 +52,7 @@
 #include <asm/mac_via.h>
 
 #include "scsi.h"
-#include "hosts.h"
+#include <scsi/scsi_host.h>
 #include "mac_scsi.h"
 #include "NCR5380.h"
 
diff --git a/drivers/scsi/mca_53c9x.c b/drivers/scsi/mca_53c9x.c
index f7b0d5c8c..e64b8ec2f 100644
--- a/drivers/scsi/mca_53c9x.c
+++ b/drivers/scsi/mca_53c9x.c
@@ -43,7 +43,7 @@
 #include <linux/mca-legacy.h>
 
 #include "scsi.h"
-#include "hosts.h"
+#include <scsi/scsi_host.h>
 #include "NCR53C9x.h"
 
 #include <asm/dma.h>
diff --git a/drivers/scsi/megaraid.c b/drivers/scsi/megaraid.c
index 7df9fc663..5fd685e9a 100644
--- a/drivers/scsi/megaraid.c
+++ b/drivers/scsi/megaraid.c
@@ -49,7 +49,7 @@
 #include <scsi/scsicam.h>
 
 #include "scsi.h"
-#include "hosts.h"
+#include <scsi/scsi_host.h>
 
 #include "megaraid.h"
 
@@ -335,6 +335,18 @@ mega_query_adapter(adapter_t *adapter)
 	return 0;
 }
 
+/**
+ * mega_runpendq()
+ * @adapter - pointer to our soft state
+ *
+ * Runs through the list of pending requests.
+ */
+static inline void
+mega_runpendq(adapter_t *adapter)
+{
+	if(!list_empty(&adapter->pending_list))
+		__mega_runpendq(adapter);
+}
 
 /*
  * megaraid_queue()
@@ -384,6 +396,95 @@ megaraid_queue(Scsi_Cmnd *scmd, void (*done)(Scsi_Cmnd *))
 	return busy;
 }
 
+/**
+ * mega_allocate_scb()
+ * @adapter - pointer to our soft state
+ * @cmd - scsi command from the mid-layer
+ *
+ * Allocate a SCB structure. This is the central structure for controller
+ * commands.
+ */
+static inline scb_t *
+mega_allocate_scb(adapter_t *adapter, Scsi_Cmnd *cmd)
+{
+	struct list_head *head = &adapter->free_list;
+	scb_t	*scb;
+
+	/* Unlink command from Free List */
+	if( !list_empty(head) ) {
+
+		scb = list_entry(head->next, scb_t, list);
+
+		list_del_init(head->next);
+
+		scb->state = SCB_ACTIVE;
+		scb->cmd = cmd;
+		scb->dma_type = MEGA_DMA_TYPE_NONE;
+
+		return scb;
+	}
+
+	return NULL;
+}
+
+/**
+ * mega_get_ldrv_num()
+ * @adapter - pointer to our soft state
+ * @cmd - scsi mid layer command
+ * @channel - channel on the controller
+ *
+ * Calculate the logical drive number based on the information in scsi command
+ * and the channel number.
+ */
+static inline int
+mega_get_ldrv_num(adapter_t *adapter, Scsi_Cmnd *cmd, int channel)
+{
+	int		tgt;
+	int		ldrv_num;
+
+	tgt = cmd->device->id;
+	
+	if ( tgt > adapter->this_id )
+		tgt--;	/* we do not get inquires for initiator id */
+
+	ldrv_num = (channel * 15) + tgt;
+
+
+	/*
+	 * If we have a logical drive with boot enabled, project it first
+	 */
+	if( adapter->boot_ldrv_enabled ) {
+		if( ldrv_num == 0 ) {
+			ldrv_num = adapter->boot_ldrv;
+		}
+		else {
+			if( ldrv_num <= adapter->boot_ldrv ) {
+				ldrv_num--;
+			}
+		}
+	}
+
+	/*
+	 * If "delete logical drive" feature is enabled on this controller.
+	 * Do only if at least one delete logical drive operation was done.
+	 *
+	 * Also, after logical drive deletion, instead of logical drive number,
+	 * the value returned should be 0x80+logical drive id.
+	 *
+	 * These is valid only for IO commands.
+	 */
+
+	if (adapter->support_random_del && adapter->read_ldidmap )
+		switch (cmd->cmnd[0]) {
+		case READ_6:	/* fall through */
+		case WRITE_6:	/* fall through */
+		case READ_10:	/* fall through */
+		case WRITE_10:
+			ldrv_num += 0x80;
+		}
+
+	return ldrv_num;
+}
 
 /**
  * mega_build_cmd()
@@ -966,52 +1067,6 @@ mega_prepare_extpassthru(adapter_t *adapter, scb_t *scb, Scsi_Cmnd *cmd,
 	return epthru;
 }
 
-
-/**
- * mega_allocate_scb()
- * @adapter - pointer to our soft state
- * @cmd - scsi command from the mid-layer
- *
- * Allocate a SCB structure. This is the central structure for controller
- * commands.
- */
-static inline scb_t *
-mega_allocate_scb(adapter_t *adapter, Scsi_Cmnd *cmd)
-{
-	struct list_head *head = &adapter->free_list;
-	scb_t	*scb;
-
-	/* Unlink command from Free List */
-	if( !list_empty(head) ) {
-
-		scb = list_entry(head->next, scb_t, list);
-
-		list_del_init(head->next);
-
-		scb->state = SCB_ACTIVE;
-		scb->cmd = cmd;
-		scb->dma_type = MEGA_DMA_TYPE_NONE;
-
-		return scb;
-	}
-
-	return NULL;
-}
-
-
-/**
- * mega_runpendq()
- * @adapter - pointer to our soft state
- *
- * Runs through the list of pending requests.
- */
-static inline void
-mega_runpendq(adapter_t *adapter)
-{
-	if(!list_empty(&adapter->pending_list))
-		__mega_runpendq(adapter);
-}
-
 static void
 __mega_runpendq(adapter_t *adapter)
 {
@@ -1043,7 +1098,7 @@ __mega_runpendq(adapter_t *adapter)
  * busy. We also take the scb from the pending list if the mailbox is
  * available.
  */
-static inline int
+static int
 issue_scb(adapter_t *adapter, scb_t *scb)
 {
 	volatile mbox64_t	*mbox64 = adapter->mbox64;
@@ -1104,6 +1159,16 @@ issue_scb(adapter_t *adapter, scb_t *scb)
 	return 0;
 }
 
+/*
+ * Wait until the controller's mailbox is available
+ */
+static inline int
+mega_busywait_mbox (adapter_t *adapter)
+{
+	if (adapter->mbox->m_in.busy)
+		return __mega_busywait_mbox(adapter);
+	return 0;
+}
 
 /**
  * issue_scb_block()
@@ -1350,7 +1415,7 @@ megaraid_isr_memmapped(int irq, void *devp, struct pt_regs *regs)
  *
  * Complete the comamnds and call the scsi mid-layer callback hooks.
  */
-static inline void
+static void
 mega_cmd_done(adapter_t *adapter, u8 completed[], int nstatus, int status)
 {
 	mega_ext_passthru	*epthru = NULL;
@@ -1671,17 +1736,6 @@ mega_free_scb(adapter_t *adapter, scb_t *scb)
 }
 
 
-/*
- * Wait until the controller's mailbox is available
- */
-static inline int
-mega_busywait_mbox (adapter_t *adapter)
-{
-	if (adapter->mbox->m_in.busy)
-		return __mega_busywait_mbox(adapter);
-	return 0;
-}
-
 static int
 __mega_busywait_mbox (adapter_t *adapter)
 {
@@ -2017,6 +2071,49 @@ megaraid_abort_and_reset(adapter_t *adapter, Scsi_Cmnd *cmd, int aor)
 	return FALSE;
 }
 
+static inline int
+make_local_pdev(adapter_t *adapter, struct pci_dev **pdev)
+{
+	*pdev = kmalloc(sizeof(struct pci_dev), GFP_KERNEL);
+
+	if( *pdev == NULL ) return -1;
+
+	memcpy(*pdev, adapter->dev, sizeof(struct pci_dev));
+
+	if( pci_set_dma_mask(*pdev, 0xffffffff) != 0 ) {
+		kfree(*pdev);
+		return -1;
+	}
+
+	return 0;
+}
+
+static inline void
+free_local_pdev(struct pci_dev *pdev)
+{
+	kfree(pdev);
+}
+
+/**
+ * mega_allocate_inquiry()
+ * @dma_handle - handle returned for dma address
+ * @pdev - handle to pci device
+ *
+ * allocates memory for inquiry structure
+ */
+static inline void *
+mega_allocate_inquiry(dma_addr_t *dma_handle, struct pci_dev *pdev)
+{
+	return pci_alloc_consistent(pdev, sizeof(mega_inquiry3), dma_handle);
+}
+
+
+static inline void
+mega_free_inquiry(void *inquiry, dma_addr_t dma_handle, struct pci_dev *pdev)
+{
+	pci_free_consistent(pdev, sizeof(mega_inquiry3), inquiry, dma_handle);
+}
+
 
 #ifdef CONFIG_PROC_FS
 /* Following code handles /proc fs  */
@@ -3269,13 +3366,13 @@ megadev_ioctl(struct inode *inode, struct file *filep, unsigned int cmd,
 	nitioctl_t	uioc;
 	int		adapno;
 	int		rval;
-	mega_passthru	*upthru;	/* user address for passthru */
+	mega_passthru	__user *upthru;	/* user address for passthru */
 	mega_passthru	*pthru;		/* copy user passthru here */
 	dma_addr_t	pthru_dma_hndl;
 	void		*data = NULL;	/* data to be transferred */
 	dma_addr_t	data_dma_hndl;	/* dma handle for data xfer area */
 	megacmd_t	mc;
-	megastat_t	*ustats;
+	megastat_t	__user *ustats;
 	int		num_ldrv;
 	u32		uxferaddr = 0;
 	struct pci_dev	*pdev;
@@ -3300,20 +3397,20 @@ megadev_ioctl(struct inode *inode, struct file *filep, unsigned int cmd,
 	 * addresses.
 	 */
 	memset(&uioc, 0, sizeof(nitioctl_t));
-	if( (rval = mega_m_to_n( (void *)arg, &uioc)) != 0 )
+	if( (rval = mega_m_to_n( (void __user *)arg, &uioc)) != 0 )
 		return rval;
 
 
 	switch( uioc.opcode ) {
 
 	case GET_DRIVER_VER:
-		if( put_user(driver_ver, (u32 *)uioc.uioc_uaddr) )
+		if( put_user(driver_ver, (u32 __user *)uioc.uioc_uaddr) )
 			return (-EFAULT);
 
 		break;
 
 	case GET_N_ADAP:
-		if( put_user(hba_count, (u32 *)uioc.uioc_uaddr) )
+		if( put_user(hba_count, (u32 __user *)uioc.uioc_uaddr) )
 			return (-EFAULT);
 
 		/*
@@ -3347,7 +3444,7 @@ megadev_ioctl(struct inode *inode, struct file *filep, unsigned int cmd,
 
 		adapter = hba_soft_state[adapno];
 
-		ustats = (megastat_t *)uioc.uioc_uaddr;
+		ustats = uioc.uioc_uaddr;
 
 		if( copy_from_user(&num_ldrv, &ustats->num_ldrv, sizeof(int)) )
 			return (-EFAULT);
@@ -3418,7 +3515,7 @@ megadev_ioctl(struct inode *inode, struct file *filep, unsigned int cmd,
 
 				mc.status = rval;
 
-				rval = mega_n_to_m((void *)arg, &mc);
+				rval = mega_n_to_m((void __user *)arg, &mc);
 			}
 
 			return rval;
@@ -3458,12 +3555,12 @@ megadev_ioctl(struct inode *inode, struct file *filep, unsigned int cmd,
 			/*
 			 * The user passthru structure
 			 */
-			upthru = (mega_passthru *)MBOX(uioc)->xferaddr;
+			upthru = (mega_passthru __user *)MBOX(uioc)->xferaddr;
 
 			/*
 			 * Copy in the user passthru here.
 			 */
-			if( copy_from_user(pthru, (char *)upthru,
+			if( copy_from_user(pthru, upthru,
 						sizeof(mega_passthru)) ) {
 
 				pci_free_consistent(pdev,
@@ -3510,7 +3607,7 @@ megadev_ioctl(struct inode *inode, struct file *filep, unsigned int cmd,
 				/*
 				 * Get the user data
 				 */
-				if( copy_from_user(data, (char *)uxferaddr,
+				if( copy_from_user(data, (char __user *)uxferaddr,
 							pthru->dataxferlen) ) {
 					rval = (-EFAULT);
 					goto freemem_and_return;
@@ -3527,7 +3624,7 @@ megadev_ioctl(struct inode *inode, struct file *filep, unsigned int cmd,
 			 */
 			mega_internal_command(adapter, LOCK_INT, &mc, pthru);
 
-			rval = mega_n_to_m((void *)arg, &mc);
+			rval = mega_n_to_m((void __user *)arg, &mc);
 
 			if( rval ) goto freemem_and_return;
 
@@ -3536,7 +3633,7 @@ megadev_ioctl(struct inode *inode, struct file *filep, unsigned int cmd,
 			 * Is data going up-stream
 			 */
 			if( pthru->dataxferlen && (uioc.flags & UIOC_RD) ) {
-				if( copy_to_user((char *)uxferaddr, data,
+				if( copy_to_user((char __user *)uxferaddr, data,
 							pthru->dataxferlen) ) {
 					rval = (-EFAULT);
 				}
@@ -3588,7 +3685,7 @@ freemem_and_return:
 				/*
 				 * Get the user data
 				 */
-				if( copy_from_user(data, (char *)uxferaddr,
+				if( copy_from_user(data, (char __user *)uxferaddr,
 							uioc.xferlen) ) {
 
 					pci_free_consistent(pdev,
@@ -3610,7 +3707,7 @@ freemem_and_return:
 			 */
 			mega_internal_command(adapter, LOCK_INT, &mc, NULL);
 
-			rval = mega_n_to_m((void *)arg, &mc);
+			rval = mega_n_to_m((void __user *)arg, &mc);
 
 			if( rval ) {
 				if( uioc.xferlen ) {
@@ -3628,7 +3725,7 @@ freemem_and_return:
 			 * Is data going up-stream
 			 */
 			if( uioc.xferlen && (uioc.flags & UIOC_RD) ) {
-				if( copy_to_user((char *)uxferaddr, data,
+				if( copy_to_user((char __user *)uxferaddr, data,
 							uioc.xferlen) ) {
 
 					rval = (-EFAULT);
@@ -3664,7 +3761,7 @@ freemem_and_return:
  * Converts the older mimd ioctl structure to newer NIT structure
  */
 static int
-mega_m_to_n(void *arg, nitioctl_t *uioc)
+mega_m_to_n(void __user *arg, nitioctl_t *uioc)
 {
 	struct uioctl_t	uioc_mimd;
 	char	signature[8] = {0};
@@ -3679,7 +3776,7 @@ mega_m_to_n(void *arg, nitioctl_t *uioc)
 	 * begining of the structure.
 	 */
 
-	if( copy_from_user(signature, (char *)arg, 7) )
+	if( copy_from_user(signature, arg, 7) )
 		return (-EFAULT);
 
 	if( memcmp(signature, "MEGANIT", 7) == 0 ) {
@@ -3692,7 +3789,7 @@ mega_m_to_n(void *arg, nitioctl_t *uioc)
 		 */
 		return -EINVAL;
 #if 0
-		if( copy_from_user(uioc, (char *)arg, sizeof(nitioctl_t)) )
+		if( copy_from_user(uioc, arg, sizeof(nitioctl_t)) )
 			return (-EFAULT);
 		return 0;
 #endif
@@ -3703,7 +3800,7 @@ mega_m_to_n(void *arg, nitioctl_t *uioc)
 	 *
 	 * Get the user ioctl structure
 	 */
-	if( copy_from_user(&uioc_mimd, (char *)arg, sizeof(struct uioctl_t)) )
+	if( copy_from_user(&uioc_mimd, arg, sizeof(struct uioctl_t)) )
 		return (-EFAULT);
 
 
@@ -3790,50 +3887,52 @@ mega_m_to_n(void *arg, nitioctl_t *uioc)
  * conforms to older mimd ioctl interface or newer NIT ioctl interface
  */
 static int
-mega_n_to_m(void *arg, megacmd_t *mc)
+mega_n_to_m(void __user *arg, megacmd_t *mc)
 {
-	nitioctl_t	*uiocp;
-	megacmd_t	*umc;
-	mega_passthru	*upthru;
-	struct uioctl_t	*uioc_mimd;
+	nitioctl_t	__user *uiocp;
+	megacmd_t	__user *umc;
+	mega_passthru	__user *upthru;
+	struct uioctl_t	__user *uioc_mimd;
 	char	signature[8] = {0};
 
 	/*
 	 * check is the application conforms to NIT.
 	 */
-	if( copy_from_user(signature, (char *)arg, 7) )
+	if( copy_from_user(signature, arg, 7) )
 		return -EFAULT;
 
 	if( memcmp(signature, "MEGANIT", 7) == 0 ) {
 
-		uiocp = (nitioctl_t *)arg;
+		uiocp = arg;
 
-		if( put_user(mc->status, (u8 *)&MBOX_P(uiocp)->status) )
+		if( put_user(mc->status, (u8 __user *)&MBOX_P(uiocp)->status) )
 			return (-EFAULT);
 
 		if( mc->cmd == MEGA_MBOXCMD_PASSTHRU ) {
 
 			umc = MBOX_P(uiocp);
 
-			upthru = (mega_passthru *)umc->xferaddr;
+			if (get_user(upthru, (mega_passthru __user * __user *)&umc->xferaddr))
+				return -EFAULT;
 
-			if( put_user(mc->status, (u8 *)&upthru->scsistatus) )
+			if( put_user(mc->status, (u8 __user *)&upthru->scsistatus))
 				return (-EFAULT);
 		}
 	}
 	else {
-		uioc_mimd = (struct uioctl_t *)arg;
+		uioc_mimd = arg;
 
-		if( put_user(mc->status, (u8 *)&uioc_mimd->mbox[17]) )
+		if( put_user(mc->status, (u8 __user *)&uioc_mimd->mbox[17]) )
 			return (-EFAULT);
 
 		if( mc->cmd == MEGA_MBOXCMD_PASSTHRU ) {
 
-			umc = (megacmd_t *)uioc_mimd->mbox;
+			umc = (megacmd_t __user *)uioc_mimd->mbox;
 
-			upthru = (mega_passthru *)umc->xferaddr;
+			if (get_user(upthru, (mega_passthru __user * __user *)&umc->xferaddr))
+				return (-EFAULT);
 
-			if( put_user(mc->status, (u8 *)&upthru->scsistatus) )
+			if( put_user(mc->status, (u8 __user *)&upthru->scsistatus) )
 				return (-EFAULT);
 		}
 	}
@@ -4068,7 +4167,6 @@ mega_support_ext_cdb(adapter_t *adapter)
 static int
 mega_del_logdrv(adapter_t *adapter, int logdrv)
 {
-	DECLARE_WAIT_QUEUE_HEAD(wq);
 	unsigned long flags;
 	scb_t *scb;
 	int rval;
@@ -4083,11 +4181,9 @@ mega_del_logdrv(adapter_t *adapter, int logdrv)
 	 * Wait till all the issued commands are complete and there are no
 	 * commands in the pending queue
 	 */
-	while( atomic_read(&adapter->pend_cmds) > 0 ||
-			!list_empty(&adapter->pending_list) ) {
-
-		sleep_on_timeout( &wq, 1*HZ );	/* sleep for 1s */
-	}
+	while (atomic_read(&adapter->pend_cmds) > 0 ||
+	       !list_empty(&adapter->pending_list))
+		msleep(1000);	/* sleep for 1s */
 
 	rval = mega_do_del_logdrv(adapter, logdrv);
 
@@ -4234,67 +4330,6 @@ mega_support_cluster(adapter_t *adapter)
 }
 
 
-
-/**
- * mega_get_ldrv_num()
- * @adapter - pointer to our soft state
- * @cmd - scsi mid layer command
- * @channel - channel on the controller
- *
- * Calculate the logical drive number based on the information in scsi command
- * and the channel number.
- */
-static inline int
-mega_get_ldrv_num(adapter_t *adapter, Scsi_Cmnd *cmd, int channel)
-{
-	int		tgt;
-	int		ldrv_num;
-
-	tgt = cmd->device->id;
-	
-	if ( tgt > adapter->this_id )
-		tgt--;	/* we do not get inquires for initiator id */
-
-	ldrv_num = (channel * 15) + tgt;
-
-
-	/*
-	 * If we have a logical drive with boot enabled, project it first
-	 */
-	if( adapter->boot_ldrv_enabled ) {
-		if( ldrv_num == 0 ) {
-			ldrv_num = adapter->boot_ldrv;
-		}
-		else {
-			if( ldrv_num <= adapter->boot_ldrv ) {
-				ldrv_num--;
-			}
-		}
-	}
-
-	/*
-	 * If "delete logical drive" feature is enabled on this controller.
-	 * Do only if at least one delete logical drive operation was done.
-	 *
-	 * Also, after logical drive deletion, instead of logical drive number,
-	 * the value returned should be 0x80+logical drive id.
-	 *
-	 * These is valid only for IO commands.
-	 */
-
-	if (adapter->support_random_del && adapter->read_ldidmap )
-		switch (cmd->cmnd[0]) {
-		case READ_6:	/* fall through */
-		case WRITE_6:	/* fall through */
-		case READ_10:	/* fall through */
-		case WRITE_10:
-			ldrv_num += 0x80;
-		}
-
-	return ldrv_num;
-}
-
-
 /**
  * mega_adapinq()
  * @adapter - pointer to our soft state
@@ -4330,27 +4365,6 @@ mega_adapinq(adapter_t *adapter, dma_addr_t dma_handle)
 }
 
 
-/**
- * mega_allocate_inquiry()
- * @dma_handle - handle returned for dma address
- * @pdev - handle to pci device
- *
- * allocates memory for inquiry structure
- */
-static inline caddr_t
-mega_allocate_inquiry(dma_addr_t *dma_handle, struct pci_dev *pdev)
-{
-	return pci_alloc_consistent(pdev, sizeof(mega_inquiry3), dma_handle);
-}
-
-
-static inline void
-mega_free_inquiry(caddr_t inquiry, dma_addr_t dma_handle, struct pci_dev *pdev)
-{
-	pci_free_consistent(pdev, sizeof(mega_inquiry3), inquiry, dma_handle);
-}
-
-
 /** mega_internal_dev_inquiry()
  * @adapter - pointer to our soft state
  * @ch - channel for this device
@@ -4551,29 +4565,6 @@ mega_internal_done(Scsi_Cmnd *scmd)
 }
 
 
-static inline int
-make_local_pdev(adapter_t *adapter, struct pci_dev **pdev)
-{
-	*pdev = kmalloc(sizeof(struct pci_dev), GFP_KERNEL);
-
-	if( *pdev == NULL ) return -1;
-
-	memcpy(*pdev, adapter->dev, sizeof(struct pci_dev));
-
-	if( pci_set_dma_mask(*pdev, 0xffffffff) != 0 ) {
-		kfree(*pdev);
-		return -1;
-	}
-
-	return 0;
-}
-
-static inline void
-free_local_pdev(struct pci_dev *pdev)
-{
-	kfree(pdev);
-}
-
 static struct scsi_host_template megaraid_template = {
 	.module				= THIS_MODULE,
 	.name				= "MegaRAID",
@@ -4611,6 +4602,26 @@ megaraid_probe_one(struct pci_dev *pdev, const struct pci_device_id *id)
 	pci_bus = pdev->bus->number;
 	pci_dev_func = pdev->devfn;
 
+	/*
+	 * The megaraid3 stuff reports the ID of the Intel part which is not
+	 * remotely specific to the megaraid
+	 */
+	if (pdev->vendor == PCI_VENDOR_ID_INTEL) {
+		u16 magic;
+		/*
+		 * Don't fall over the Compaq management cards using the same
+		 * PCI identifier
+		 */
+		if (pdev->subsystem_vendor == PCI_VENDOR_ID_COMPAQ &&
+		    pdev->subsystem_device == 0xC000)
+		   	return -ENODEV;
+		/* Now check the magic signature byte */
+		pci_read_config_word(pdev, PCI_CONF_AMISIG, &magic);
+		if (magic != HBA_SIGNATURE_471 && magic != HBA_SIGNATURE)
+			return -ENODEV;
+		/* Ok it is probably a megaraid */
+	}
+
 	/*
 	 * For these vendor and device ids, signature offsets are not
 	 * valid and 64 bit is implicit
diff --git a/drivers/scsi/megaraid.h b/drivers/scsi/megaraid.h
index 268e9a7aa..e25c4de9e 100644
--- a/drivers/scsi/megaraid.h
+++ b/drivers/scsi/megaraid.h
@@ -522,11 +522,11 @@ struct uioctl_t {
 	u8 mbox[18];		/* 16 bytes + 2 status bytes */
 	mega_passthru pthru;
 #if BITS_PER_LONG == 32
-	char *data;		/* buffer <= 4096 for 0x80 commands */
+	char __user *data;		/* buffer <= 4096 for 0x80 commands */
 	char pad[4];
 #endif
 #if BITS_PER_LONG == 64
-	char *data;
+	char __user *data;
 #endif
 } __attribute__ ((packed));
 
@@ -622,12 +622,12 @@ typedef struct {
 	u32		adapno;		/* adapter number */
 	union {
 		u8	__raw_mbox[18];
-		caddr_t	__uaddr; /* xferaddr for non-mbox cmds */
+		void __user *__uaddr; /* xferaddr for non-mbox cmds */
 	}__ua;
 
 #define uioc_rmbox	__ua.__raw_mbox
 #define MBOX(uioc)	((megacmd_t *)&((uioc).__ua.__raw_mbox[0]))
-#define MBOX_P(uioc)	((megacmd_t *)&((uioc)->__ua.__raw_mbox[0]))
+#define MBOX_P(uioc)	((megacmd_t __user *)&((uioc)->__ua.__raw_mbox[0]))
 #define uioc_uaddr	__ua.__uaddr
 
 	u32		xferlen;	/* xferlen for DCMD and non-mbox
@@ -990,14 +990,12 @@ typedef enum { LOCK_INT, LOCK_EXT } lockscope_t;
 const char *megaraid_info (struct Scsi_Host *);
 
 static int mega_query_adapter(adapter_t *);
-static inline int issue_scb(adapter_t *, scb_t *);
+static int issue_scb(adapter_t *, scb_t *);
 static int mega_setup_mailbox(adapter_t *);
 
 static int megaraid_queue (Scsi_Cmnd *, void (*)(Scsi_Cmnd *));
 static scb_t * mega_build_cmd(adapter_t *, Scsi_Cmnd *, int *);
-static inline scb_t *mega_allocate_scb(adapter_t *, Scsi_Cmnd *);
 static void __mega_runpendq(adapter_t *);
-static inline void mega_runpendq(adapter_t *);
 static int issue_scb_block(adapter_t *, u_char *);
 
 static irqreturn_t megaraid_isr_memmapped(int, void *, struct pt_regs *);
@@ -1014,10 +1012,9 @@ static int mega_print_inquiry(char *, char *);
 
 static int mega_build_sglist (adapter_t *adapter, scb_t *scb,
 			      u32 *buffer, u32 *length);
-static inline int mega_busywait_mbox (adapter_t *);
 static int __mega_busywait_mbox (adapter_t *);
 static void mega_rundoneq (adapter_t *);
-static inline void mega_cmd_done(adapter_t *, u8 [], int, int);
+static void mega_cmd_done(adapter_t *, u8 [], int, int);
 static inline void mega_free_sgl (adapter_t *adapter);
 static void mega_8_to_40ld (mraid_inquiry *inquiry,
 		mega_inquiry3 *enquiry3, mega_product_info *);
@@ -1025,8 +1022,8 @@ static void mega_8_to_40ld (mraid_inquiry *inquiry,
 static int megadev_open (struct inode *, struct file *);
 static int megadev_ioctl (struct inode *, struct file *, unsigned int,
 		unsigned long);
-static int mega_m_to_n(void *, nitioctl_t *);
-static int mega_n_to_m(void *, megacmd_t *);
+static int mega_m_to_n(void __user *, nitioctl_t *);
+static int mega_n_to_m(void __user *, megacmd_t *);
 
 static int mega_init_scb (adapter_t *);
 
@@ -1053,10 +1050,6 @@ static int proc_rdrv(adapter_t *, char *, int, int);
 
 static int mega_adapinq(adapter_t *, dma_addr_t);
 static int mega_internal_dev_inquiry(adapter_t *, u8, u8, dma_addr_t);
-static inline caddr_t mega_allocate_inquiry(dma_addr_t *, struct pci_dev *);
-static inline void mega_free_inquiry(caddr_t, dma_addr_t, struct pci_dev *);
-static inline int make_local_pdev(adapter_t *, struct pci_dev **);
-static inline void free_local_pdev(struct pci_dev *);
 
 static int mega_support_ext_cdb(adapter_t *);
 static mega_passthru* mega_prepare_passthru(adapter_t *, scb_t *,
@@ -1065,7 +1058,6 @@ static mega_ext_passthru* mega_prepare_extpassthru(adapter_t *,
 		scb_t *, Scsi_Cmnd *, int, int);
 static void mega_enum_raid_scsi(adapter_t *);
 static void mega_get_boot_drv(adapter_t *);
-static inline int mega_get_ldrv_num(adapter_t *, Scsi_Cmnd *, int);
 static int mega_support_random_del(adapter_t *);
 static int mega_del_logdrv(adapter_t *, int);
 static int mega_do_del_logdrv(adapter_t *, int);
diff --git a/drivers/scsi/mvme147.c b/drivers/scsi/mvme147.c
index 62ec0569a..e73b33f29 100644
--- a/drivers/scsi/mvme147.c
+++ b/drivers/scsi/mvme147.c
@@ -11,7 +11,7 @@
 #include <asm/irq.h>
 
 #include "scsi.h"
-#include "hosts.h"
+#include <scsi/scsi_host.h>
 #include "wd33c93.h"
 #include "mvme147.h"
 
diff --git a/drivers/scsi/mvme16x.c b/drivers/scsi/mvme16x.c
index 05996fb35..b2d8d8ea1 100644
--- a/drivers/scsi/mvme16x.c
+++ b/drivers/scsi/mvme16x.c
@@ -15,7 +15,7 @@
 #include <asm/irq.h>
 
 #include "scsi.h"
-#include "hosts.h"
+#include <scsi/scsi_host.h>
 #include "53c7xx.h"
 #include "mvme16x.h"
 
diff --git a/drivers/scsi/ncr53c8xx.c b/drivers/scsi/ncr53c8xx.c
index bc51dc60d..3fcefa3d4 100644
--- a/drivers/scsi/ncr53c8xx.c
+++ b/drivers/scsi/ncr53c8xx.c
@@ -83,17 +83,6 @@
 **
 **	Supported NCR/SYMBIOS chips:
 **		53C720		(Wide,   Fast SCSI-2, intfly problems)
-**		53C810		(8 bits, Fast SCSI-2, no rom BIOS) 
-**		53C815		(8 bits, Fast SCSI-2, on board rom BIOS)
-**		53C820		(Wide,   Fast SCSI-2, no rom BIOS)
-**		53C825		(Wide,   Fast SCSI-2, on board rom BIOS)
-**		53C860		(8 bits, Fast 20,     no rom BIOS)
-**		53C875		(Wide,   Fast 20,     on board rom BIOS)
-**		53C895		(Wide,   Fast 40,     on board rom BIOS)
-**		53C895A		(Wide,   Fast 40,     on board rom BIOS)
-**		53C896		(Wide,   Fast 40,     on board rom BIOS)
-**		53C897		(Wide,   Fast 40,     on board rom BIOS)
-**		53C1510D	(Wide,   Fast 40,     on board rom BIOS)
 **
 **	Other features:
 **		Memory mapped IO (linux-1.3.X and above only)
@@ -101,10 +90,8 @@
 **		Shared IRQ (since linux-1.3.72)
 */
 
-/*
-**	Name and version of the driver
-*/
-#define SCSI_NCR_DRIVER_NAME	"ncr53c8xx-3.4.3b-20010512"
+/* Name and version of the driver */
+#define SCSI_NCR_DRIVER_NAME	"ncr53c8xx-3.4.3f"
 
 #define SCSI_NCR_DEBUG_FLAGS	(0)
 
@@ -138,7 +125,7 @@
 #include <asm/system.h>
 
 #include "scsi.h"
-#include "hosts.h"
+#include <scsi/scsi_host.h>
 
 #include "ncr53c8xx.h"
 
@@ -157,11 +144,6 @@
 
 #include "sym53c8xx_comm.h"
 
-int ncr53c8xx_slave_configure(Scsi_Device *device);
-int ncr53c8xx_bus_reset(Scsi_Cmnd *cmd);
-int ncr53c8xx_queue_command (Scsi_Cmnd *cmd, void (* done)(Scsi_Cmnd *));
-const char *ncr53c8xx_info (struct Scsi_Host *host);
-
 
 /*==========================================================
 **
@@ -341,11 +323,6 @@ static int ncr53c8xx_proc_info(struct Scsi_Host *host, char *buffer, char **star
 #define initverbose (driver_setup.verbose)
 #define bootverbose (np->verbose)
 
-#ifdef SCSI_NCR_NVRAM_SUPPORT
-static u_char Tekram_sync[16] __initdata =
-	{25,31,37,43, 50,62,75,125, 12,15,18,21, 6,7,9,10};
-#endif /* SCSI_NCR_NVRAM_SUPPORT */
-
 /*==========================================================
 **
 **	Command control block states.
@@ -483,11 +460,6 @@ struct ccb;
 struct ncb;
 struct script;
 
-typedef struct ncb * ncb_p;
-typedef struct tcb * tcb_p;
-typedef struct lcb * lcb_p;
-typedef struct ccb * ccb_p;
-
 struct link {
 	ncrcmd	l_cmd;
 	ncrcmd	l_paddr;
@@ -558,7 +530,7 @@ struct tcb {
 	**----------------------------------------------------------------
 	*/
 	struct link     jump_lcb[4];	/* JUMPs for reselection	*/
-	lcb_p		lp[MAX_LUN];	/* The lcb's of this tcb	*/
+	struct lcb *	lp[MAX_LUN];	/* The lcb's of this tcb	*/
 	u_char		inq_done;	/* Target capabilities received	*/
 	u_char		inq_byte7;	/* Contains these capabilities	*/
 
@@ -568,7 +540,7 @@ struct tcb {
 	**	when tagged command queuing is enabled.
 	**----------------------------------------------------------------
 	*/
-	ccb_p   nego_cp;
+	struct ccb *   nego_cp;
 
 	/*----------------------------------------------------------------
 	**	statistical data
@@ -582,7 +554,7 @@ struct tcb {
 	**----------------------------------------------------------------
 	*/
 #ifdef SCSI_NCR_BIG_ENDIAN
-/*0*/	u_short	period;
+/*0*/	u16	period;
 /*2*/	u_char	sval;
 /*3*/	u_char	minsync;
 /*0*/	u_char	wval;
@@ -592,7 +564,7 @@ struct tcb {
 #else
 /*0*/	u_char	minsync;
 /*1*/	u_char	sval;
-/*2*/	u_short	period;
+/*2*/	u16	period;
 /*0*/	u_char	maxoffs;
 /*1*/	u_char	quirks;
 /*2*/	u_char	widedone;
@@ -606,11 +578,7 @@ struct tcb {
 	u_char 	ic_done;
 #endif
 
-	/*----------------------------------------------------------------
-	**	User settable limits and options.
-	**	These limits are read from the NVRAM if present.
-	**----------------------------------------------------------------
-	*/
+	/* User settable limits and options.  */
 	u_char	usrsync;
 	u_char	usrwide;
 	u_char	usrtags;
@@ -691,11 +659,11 @@ struct lcb {
 	**	QUEUE FULL and ORDERED tag control.
 	**----------------------------------------------------------------
 	*/
-	u_short		num_good;	/* Nr of GOOD since QUEUE FULL	*/
+	u16		num_good;	/* Nr of GOOD since QUEUE FULL	*/
 	tagmap_t	tags_umap;	/* Used tags bitmap		*/
 	tagmap_t	tags_smap;	/* Tags in use at 'tag_stime'	*/
 	u_long		tags_stime;	/* Last time we set smap=umap	*/
-	ccb_p		held_ccb;	/* CCB held for QUEUE FULL	*/
+	struct ccb *	held_ccb;	/* CCB held for QUEUE FULL	*/
 };
 
 /*========================================================================
@@ -761,7 +729,7 @@ struct head {
 	**	The virtual address of the ccb containing this header.
 	**----------------------------------------------------------------
 	*/
-	ccb_p	cp;
+	struct ccb *	cp;
 
 	/*----------------------------------------------------------------
 	**	Status fields.
@@ -871,7 +839,7 @@ struct dsb {
 	struct scr_tblmove smsg  ;
 	struct scr_tblmove cmd   ;
 	struct scr_tblmove sense ;
-	struct scr_tblmove data [MAX_SCATTER];
+	struct scr_tblmove data[MAX_SCATTER];
 };
 
 
@@ -921,7 +889,7 @@ struct ccb {
 	**	pointer to a control block.
 	**----------------------------------------------------------------
 	*/
-	Scsi_Cmnd	*cmd;		/* SCSI command 		*/
+	struct scsi_cmnd	*cmd;		/* SCSI command 		*/
 	u_char		cdb_buf[16];	/* Copy of CDB			*/
 	u_char		sense_buf[64];
 	int		data_len;	/* Total data length		*/
@@ -951,7 +919,7 @@ struct ccb {
 	u_char		lun;
 	u_char		queued;
 	u_char		auto_sense;
-	ccb_p		link_ccb;	/* Host adapter CCB chain	*/
+	struct ccb *	link_ccb;	/* Host adapter CCB chain	*/
 	XPT_QUEHEAD	link_ccbq;	/* Link to unit CCB queue	*/
 	u32		startp;		/* Initial data pointer		*/
 	u_long		magic;		/* Free / busy  CCB flag	*/
@@ -980,9 +948,9 @@ struct ncb {
 	**	CCBs management queues.
 	**----------------------------------------------------------------
 	*/
-	Scsi_Cmnd	*waiting_list;	/* Commands waiting for a CCB	*/
+	struct scsi_cmnd	*waiting_list;	/* Commands waiting for a CCB	*/
 					/*  when lcb is not allocated.	*/
-	Scsi_Cmnd	*done_list;	/* Commands waiting for done()  */
+	struct scsi_cmnd	*done_list;	/* Commands waiting for done()  */
 					/* callback to be invoked.      */ 
 	spinlock_t	smp_lock;	/* Lock for SMP threading       */
 
@@ -991,7 +959,6 @@ struct ncb {
 	**----------------------------------------------------------------
 	*/
 	int		unit;		/* Unit number			*/
-	char		chip_name[8];	/* Chip name			*/
 	char		inst_name[16];	/* ncb instance name		*/
 
 	/*----------------------------------------------------------------
@@ -1053,13 +1020,9 @@ struct ncb {
 	**----------------------------------------------------------------
 	*/
 	struct device	*dev;
-	u_short		device_id;	/* PCI device id		*/
 	u_char		revision_id;	/* PCI device revision id	*/
-	u_char		bus;		/* PCI BUS number		*/
-	u_char		device_fn;	/* PCI BUS device and function	*/
-	u_long		base_io;	/* IO space base address	*/
-	u_int		irq;		/* IRQ level			*/
-	u_int		features;	/* Chip features map		*/
+	u32		irq;		/* IRQ level			*/
+	u32		features;	/* Chip features map		*/
 	u_char		myaddr;		/* SCSI id of the adapter	*/
 	u_char		maxburst;	/* log base 2 of dwords burst	*/
 	u_char		maxwide;	/* Maximum transfer width	*/
@@ -1076,10 +1039,10 @@ struct ncb {
 	**	SCRIPTS processor in order to start SCSI commands.
 	**----------------------------------------------------------------
 	*/
-	u_short		squeueput;	/* Next free slot of the queue	*/
-	u_short		actccbs;	/* Number of allocated CCBs	*/
-	u_short		queuedccbs;	/* Number of CCBs in start queue*/
-	u_short		queuedepth;	/* Start queue depth		*/
+	u16		squeueput;	/* Next free slot of the queue	*/
+	u16		actccbs;	/* Number of allocated CCBs	*/
+	u16		queuedccbs;	/* Number of CCBs in start queue*/
+	u16		queuedepth;	/* Start queue depth		*/
 
 	/*----------------------------------------------------------------
 	**	Timeout handler.
@@ -1304,65 +1267,59 @@ struct scripth {
 **==========================================================
 */
 
-static	void	ncr_alloc_ccb	(ncb_p np, u_char tn, u_char ln);
-static	void	ncr_complete	(ncb_p np, ccb_p cp);
-static	void	ncr_exception	(ncb_p np);
-static	void	ncr_free_ccb	(ncb_p np, ccb_p cp);
-static	void	ncr_init_ccb	(ncb_p np, ccb_p cp);
-static	void	ncr_init_tcb	(ncb_p np, u_char tn);
-static	lcb_p	ncr_alloc_lcb	(ncb_p np, u_char tn, u_char ln);
-static	lcb_p	ncr_setup_lcb	(ncb_p np, u_char tn, u_char ln,
+static	void	ncr_alloc_ccb	(struct ncb *np, u_char tn, u_char ln);
+static	void	ncr_complete	(struct ncb *np, struct ccb *cp);
+static	void	ncr_exception	(struct ncb *np);
+static	void	ncr_free_ccb	(struct ncb *np, struct ccb *cp);
+static	void	ncr_init_ccb	(struct ncb *np, struct ccb *cp);
+static	void	ncr_init_tcb	(struct ncb *np, u_char tn);
+static	struct lcb *	ncr_alloc_lcb	(struct ncb *np, u_char tn, u_char ln);
+static	struct lcb *	ncr_setup_lcb	(struct ncb *np, u_char tn, u_char ln,
 				 u_char *inq_data);
-static	void	ncr_getclock	(ncb_p np, int mult);
-static	void	ncr_selectclock	(ncb_p np, u_char scntl3);
-static	ccb_p	ncr_get_ccb	(ncb_p np, u_char tn, u_char ln);
-static	void	ncr_chip_reset	(ncb_p np, int delay);
-static	void	ncr_init	(ncb_p np, int reset, char * msg, u_long code);
-static	int	ncr_int_sbmc	(ncb_p np);
-static	int	ncr_int_par	(ncb_p np);
-static	void	ncr_int_ma	(ncb_p np);
-static	void	ncr_int_sir	(ncb_p np);
-static  void    ncr_int_sto     (ncb_p np);
+static	void	ncr_getclock	(struct ncb *np, int mult);
+static	void	ncr_selectclock	(struct ncb *np, u_char scntl3);
+static	struct ccb *ncr_get_ccb	(struct ncb *np, u_char tn, u_char ln);
+static	void	ncr_chip_reset	(struct ncb *np, int delay);
+static	void	ncr_init	(struct ncb *np, int reset, char * msg, u_long code);
+static	int	ncr_int_sbmc	(struct ncb *np);
+static	int	ncr_int_par	(struct ncb *np);
+static	void	ncr_int_ma	(struct ncb *np);
+static	void	ncr_int_sir	(struct ncb *np);
+static  void    ncr_int_sto     (struct ncb *np);
 static	u_long	ncr_lookup	(char* id);
 static	void	ncr_negotiate	(struct ncb* np, struct tcb* tp);
-static	int	ncr_prepare_nego(ncb_p np, ccb_p cp, u_char *msgptr);
+static	int	ncr_prepare_nego(struct ncb *np, struct ccb *cp, u_char *msgptr);
 #ifdef SCSI_NCR_INTEGRITY_CHECKING
-static	int	ncr_ic_nego(ncb_p np, ccb_p cp, Scsi_Cmnd *cmd, u_char *msgptr);
+static	int	ncr_ic_nego(struct ncb *np, struct ccb *cp, struct scsi_cmnd *cmd, u_char *msgptr);
 #endif
 
 static	void	ncr_script_copy_and_bind
-				(ncb_p np, ncrcmd *src, ncrcmd *dst, int len);
+				(struct ncb *np, ncrcmd *src, ncrcmd *dst, int len);
 static  void    ncr_script_fill (struct script * scr, struct scripth * scripth);
-static	int	ncr_scatter	(ncb_p np, ccb_p cp, Scsi_Cmnd *cmd);
-static	void	ncr_getsync	(ncb_p np, u_char sfac, u_char *fakp, u_char *scntl3p);
-static	void	ncr_setsync	(ncb_p np, ccb_p cp, u_char scntl3, u_char sxfer);
-static	void	ncr_setup_tags	(ncb_p np, u_char tn, u_char ln);
-static	void	ncr_setwide	(ncb_p np, ccb_p cp, u_char wide, u_char ack);
+static	int	ncr_scatter	(struct ncb *np, struct ccb *cp, struct scsi_cmnd *cmd);
+static	void	ncr_getsync	(struct ncb *np, u_char sfac, u_char *fakp, u_char *scntl3p);
+static	void	ncr_setsync	(struct ncb *np, struct ccb *cp, u_char scntl3, u_char sxfer);
+static	void	ncr_setup_tags	(struct ncb *np, u_char tn, u_char ln);
+static	void	ncr_setwide	(struct ncb *np, struct ccb *cp, u_char wide, u_char ack);
 static	int	ncr_show_msg	(u_char * msg);
-static  void    ncr_print_msg   (ccb_p cp, char *label, u_char *msg);
-static	int	ncr_snooptest	(ncb_p np);
-static	void	ncr_timeout	(ncb_p np);
-static  void    ncr_wakeup      (ncb_p np, u_long code);
-static  void    ncr_wakeup_done (ncb_p np);
-static	void	ncr_start_next_ccb (ncb_p np, lcb_p lp, int maxn);
-static	void	ncr_put_start_queue(ncb_p np, ccb_p cp);
-static	void	ncr_start_reset	(ncb_p np);
-static	int	ncr_reset_scsi_bus (ncb_p np, int enab_int, int settle_delay);
-
-#ifdef SCSI_NCR_USER_COMMAND_SUPPORT
-static	void	ncr_usercmd	(ncb_p np);
-#endif
-
-static void insert_into_waiting_list(ncb_p np, Scsi_Cmnd *cmd);
-static Scsi_Cmnd *retrieve_from_waiting_list(int to_remove, ncb_p np, Scsi_Cmnd *cmd);
-static void process_waiting_list(ncb_p np, int sts);
+static  void    ncr_print_msg   (struct ccb *cp, char *label, u_char *msg);
+static	int	ncr_snooptest	(struct ncb *np);
+static	void	ncr_timeout	(struct ncb *np);
+static  void    ncr_wakeup      (struct ncb *np, u_long code);
+static  void    ncr_wakeup_done (struct ncb *np);
+static	void	ncr_start_next_ccb (struct ncb *np, struct lcb * lp, int maxn);
+static	void	ncr_put_start_queue(struct ncb *np, struct ccb *cp);
+
+static void insert_into_waiting_list(struct ncb *np, struct scsi_cmnd *cmd);
+static struct scsi_cmnd *retrieve_from_waiting_list(int to_remove, struct ncb *np, struct scsi_cmnd *cmd);
+static void process_waiting_list(struct ncb *np, int sts);
 
 #define remove_from_waiting_list(np, cmd) \
 		retrieve_from_waiting_list(1, (np), (cmd))
 #define requeue_waiting_list(np) process_waiting_list((np), DID_OK)
 #define reset_waiting_list(np) process_waiting_list((np), DID_RESET)
 
-static inline char *ncr_name (ncb_p np)
+static inline char *ncr_name (struct ncb *np)
 {
 	return np->inst_name;
 }
@@ -1851,13 +1808,8 @@ static	struct script script0 __initdata = {
 	/*
 	**	... signal completion to the host
 	*/
-#ifdef SIMULATED_INTFLY
 	SCR_INT,
 		SIR_INTFLY,
-#else
-	SCR_INT_FLY,
-		0,
-#endif
 	/*
 	**	Auf zu neuen Schandtaten!
 	*/
@@ -1876,13 +1828,8 @@ static	struct script script0 __initdata = {
 	SCR_INT,
 		SIR_DONE_OVERFLOW,
 }/*------------------------< DONE_END >---------------------*/,{
-#ifdef SIMULATED_INTFLY
 	SCR_INT,
 		SIR_INTFLY,
-#else
-	SCR_INT_FLY,
-		0,
-#endif
 	SCR_COPY (4),
 		RADDR (temp),
 		PADDR (done_pos),
@@ -2226,7 +2173,7 @@ static	struct scripth scripth0 __initdata = {
 **-----------------------------------------------------------
 **
 **  ##===========< I=0; i<MAX_DONE >===========
-**  ||	SCR_COPY (sizeof(ccb_p)),
+**  ||	SCR_COPY (sizeof(struct ccb *),
 **  ||		NADDR (header.cp),
 **  ||		NADDR (ccb_done[i]),
 **  ||	SCR_CALL,
@@ -2885,7 +2832,7 @@ void __init ncr_script_fill (struct script * scr, struct scripth * scrh)
 
 	p = scrh->done_queue;
 	for (i = 0; i<MAX_DONE; i++) {
-		*p++ =SCR_COPY (sizeof(ccb_p));
+		*p++ =SCR_COPY (sizeof(struct ccb *));
 		*p++ =NADDR (header.cp);
 		*p++ =NADDR (ccb_done[i]);
 		*p++ =SCR_CALL;
@@ -2944,7 +2891,7 @@ void __init ncr_script_fill (struct script * scr, struct scripth * scrh)
 */
 
 static void __init 
-ncr_script_copy_and_bind (ncb_p np, ncrcmd *src, ncrcmd *dst, int len)
+ncr_script_copy_and_bind (struct ncb *np, ncrcmd *src, ncrcmd *dst, int len)
 {
 	ncrcmd  opcode, new, old, tmp1, tmp2;
 	ncrcmd	*start, *end;
@@ -3115,17 +3062,17 @@ struct host_data {
 **	target, lun concerned by a kernel message.
 */
 
-static void PRINT_TARGET(ncb_p np, int target)
+static void PRINT_TARGET(struct ncb *np, int target)
 {
 	printk(KERN_INFO "%s-<%d,*>: ", ncr_name(np), target);
 }
 
-static void PRINT_LUN(ncb_p np, int target, int lun)
+static void PRINT_LUN(struct ncb *np, int target, int lun)
 {
 	printk(KERN_INFO "%s-<%d,%d>: ", ncr_name(np), target, lun);
 }
 
-static void PRINT_ADDR(Scsi_Cmnd *cmd)
+static void PRINT_ADDR(struct scsi_cmnd *cmd)
 {
 	struct host_data *host_data = (struct host_data *) cmd->device->host->hostdata;
 	PRINT_LUN(host_data->ncb, cmd->device->id, cmd->device->lun);
@@ -3164,90 +3111,31 @@ static u_long div_10M[] =
 #define burst_length(bc) (!(bc))? 0 : 1 << (bc)
 
 /*
- *	Burst code from io register bits.  Burst enable is ctest0 for c720,
- *	ctest4 for others.
+ *	Burst code from io register bits.  Burst enable is ctest0 for c720
  */
-#define burst_code(dmode, ctest0, ctest4, ctest5) \
-	(np->device_id == PSEUDO_720_ID) ? \
-	(ctest0) & 0x80? 0 : (((dmode) & 0xc0) >> 6) + 1 : \
-	(ctest4) & 0x80? 0 : (((dmode) & 0xc0) >> 6) + ((ctest5) & 0x04) + 1
+#define burst_code(dmode, ctest0) \
+	(ctest0) & 0x80 ? 0 : (((dmode) & 0xc0) >> 6) + 1
 
 /*
  *	Set initial io register bits from burst code.
  */
-static inline void ncr_init_burst(ncb_p np, u_char bc)
+static inline void ncr_init_burst(struct ncb *np, u_char bc)
 {
-	u_char *be = (np->device_id == PSEUDO_720_ID) ?
-		&np->rv_ctest0 : &np->rv_ctest4;
+	u_char *be = &np->rv_ctest0;
 	*be		&= ~0x80;
 	np->rv_dmode	&= ~(0x3 << 6);
 	np->rv_ctest5	&= ~0x4;
 
 	if (!bc) {
 		*be		|= 0x80;
-	}
-	else {
+	} else {
 		--bc;
 		np->rv_dmode	|= ((bc & 0x3) << 6);
 		np->rv_ctest5	|= (bc & 0x4);
 	}
 }
 
-#ifdef SCSI_NCR_NVRAM_SUPPORT
-
-/*
-**	Get target set-up from Symbios format NVRAM.
-*/
-
-static void __init 
-ncr_Symbios_setup_target(ncb_p np, int target, Symbios_nvram *nvram)
-{
-	tcb_p tp = &np->target[target];
-	Symbios_target *tn = &nvram->target[target];
-
-	tp->usrsync = tn->sync_period ? (tn->sync_period + 3) / 4 : 255;
-	tp->usrwide = tn->bus_width == 0x10 ? 1 : 0;
-	tp->usrtags =
-		(tn->flags & SYMBIOS_QUEUE_TAGS_ENABLED)? MAX_TAGS : 0;
-
-	if (!(tn->flags & SYMBIOS_DISCONNECT_ENABLE))
-		tp->usrflag |= UF_NODISC;
-	if (!(tn->flags & SYMBIOS_SCAN_AT_BOOT_TIME))
-		tp->usrflag |= UF_NOSCAN;
-}
-
-/*
-**	Get target set-up from Tekram format NVRAM.
-*/
-
-static void __init 
-ncr_Tekram_setup_target(ncb_p np, int target, Tekram_nvram *nvram)
-{
-	tcb_p tp = &np->target[target];
-	struct Tekram_target *tn = &nvram->target[target];
-	int i;
-
-	if (tn->flags & TEKRAM_SYNC_NEGO) {
-		i = tn->sync_index & 0xf;
-		tp->usrsync = Tekram_sync[i];
-	}
-
-	tp->usrwide = (tn->flags & TEKRAM_WIDE_NEGO) ? 1 : 0;
-
-	if (tn->flags & TEKRAM_TAGGED_COMMANDS) {
-		tp->usrtags = 2 << nvram->max_tags_index;
-	}
-
-	if (!(tn->flags & TEKRAM_DISCONNECT_ENABLE))
-		tp->usrflag = UF_NODISC;
- 
-	/* If any device does not support parity, we will not use this option */
-	if (!(tn->flags & TEKRAM_PARITY_CHECK))
-		np->rv_scntl0  &= ~0x0a; /* SCSI parity checking disabled */
-}
-#endif /* SCSI_NCR_NVRAM_SUPPORT */
-
-static int __init ncr_prepare_setting(ncb_p np, ncr_nvram *nvram)
+static void __init ncr_prepare_setting(struct ncb *np)
 {
 	u_char	burst_max;
 	u_long	period;
@@ -3278,9 +3166,7 @@ static int __init ncr_prepare_setting(ncb_p np, ncr_nvram *nvram)
  	/*
 	 *  Guess the frequency of the chip's clock.
 	 */
-	if	(np->features & (FE_ULTRA3 | FE_ULTRA2))
-		np->clock_khz = 160000;
-	else if	(np->features & FE_ULTRA)
+	if (np->features & FE_ULTRA)
 		np->clock_khz = 80000;
 	else
 		np->clock_khz = 40000;
@@ -3329,10 +3215,8 @@ static int __init ncr_prepare_setting(ncb_p np, ncr_nvram *nvram)
 	 * Check against chip SCSI standard support (SCSI-2,ULTRA,ULTRA2).
 	 */
 
-	if	(np->minsync < 25 && !(np->features & (FE_ULTRA|FE_ULTRA2)))
+	if	(np->minsync < 25 && !(np->features & FE_ULTRA))
 		np->minsync = 25;
-	else if	(np->minsync < 12 && !(np->features & FE_ULTRA2))
-		np->minsync = 12;
 
 	/*
 	 * Maximum synchronous period factor supported by the chip.
@@ -3352,7 +3236,7 @@ static int __init ncr_prepare_setting(ncb_p np, ncr_nvram *nvram)
 	np->rv_ctest3	= np->sv_ctest3;
 	np->rv_ctest4	= np->sv_ctest4;
 	np->rv_ctest5	= np->sv_ctest5;
-	burst_max	= burst_code(np->sv_dmode, np->sv_ctest0, np->sv_ctest4, np->sv_ctest5);
+	burst_max	= burst_code(np->sv_dmode, np->sv_ctest0);
 #else
 
 	/*
@@ -3360,7 +3244,7 @@ static int __init ncr_prepare_setting(ncb_p np, ncr_nvram *nvram)
 	*/
 	burst_max	= driver_setup.burst_max;
 	if (burst_max == 255)
-		burst_max = burst_code(np->sv_dmode, np->sv_ctest0, np->sv_ctest4, np->sv_ctest5);
+		burst_max = burst_code(np->sv_dmode, np->sv_ctest0);
 	if (burst_max > 7)
 		burst_max = 7;
 	if (burst_max > np->maxburst)
@@ -3398,25 +3282,6 @@ static int __init ncr_prepare_setting(ncb_p np, ncr_nvram *nvram)
 	if (driver_setup.scsi_parity)
 		np->rv_scntl0	|= 0x0a;	/*  full arb., ena parity, par->ATN  */
 
-#ifdef SCSI_NCR_NVRAM_SUPPORT
-	/*
-	**	Get parity checking, host ID and verbose mode from NVRAM
-	**/
-	if (nvram) {
-		switch(nvram->type) {
-		case SCSI_NCR_TEKRAM_NVRAM:
-			np->myaddr = nvram->data.Tekram.host_id & 0x0f;
-			break;
-		case SCSI_NCR_SYMBIOS_NVRAM:
-			if (!(nvram->data.Symbios.flags & SYMBIOS_PARITY_ENABLE))
-				np->rv_scntl0  &= ~0x0a;
-			np->myaddr = nvram->data.Symbios.host_id & 0x0f;
-			if (nvram->data.Symbios.flags & SYMBIOS_VERBOSE_MSGS)
-				np->verbose += 1;
-			break;
-		}
-	}
-#endif
 	/*
 	**  Get SCSI addr of host adapter (set by bios?).
 	*/
@@ -3443,9 +3308,7 @@ static int __init ncr_prepare_setting(ncb_p np, ncr_nvram *nvram)
 	**	  since a 100% safe algorithm is not possible.
 	*/
 	np->scsi_mode = SMODE_SE;
-	if	(np->features & FE_ULTRA2)
-		np->scsi_mode = (np->sv_stest4 & SMODE);
-	else if	(np->features & FE_DIFF) {
+	if (np->features & FE_DIFF) {
 		switch(driver_setup.diff_support) {
 		case 4:	/* Trust previous settings if present, then GPIO3 */
 			if (np->sv_scntl3) {
@@ -3454,8 +3317,6 @@ static int __init ncr_prepare_setting(ncb_p np, ncr_nvram *nvram)
 				break;
 			}
 		case 3:	/* SYMBIOS controllers report HVD through GPIO3 */
-			if (nvram && nvram->type != SCSI_NCR_SYMBIOS_NVRAM)
-				break;
 			if (INB(nc_gpreg) & 0x08)
 				break;
 		case 2:	/* Set HVD unconditionally */
@@ -3478,8 +3339,7 @@ static int __init ncr_prepare_setting(ncb_p np, ncr_nvram *nvram)
 	**	that drive the LED directly.
 	**	Also probe initial setting of GPIO0 as output.
 	*/
-	if ((driver_setup.led_pin ||
-	     (nvram && nvram->type == SCSI_NCR_SYMBIOS_NVRAM)) &&
+	if ((driver_setup.led_pin) &&
 	    !(np->features & FE_LEDC) && !(np->sv_gpcntl & 0x01))
 		np->features |= FE_LED0;
 
@@ -3499,51 +3359,24 @@ static int __init ncr_prepare_setting(ncb_p np, ncr_nvram *nvram)
 
 	/*
 	**	Configure targets according to driver setup.
-	**	If NVRAM present get targets setup from NVRAM.
 	**	Allow to override sync, wide and NOSCAN from 
 	**	boot command line.
 	*/
 	for (i = 0 ; i < MAX_TARGET ; i++) {
-		tcb_p tp = &np->target[i];
-
-		tp->usrsync = 255;
-#ifdef SCSI_NCR_NVRAM_SUPPORT
-		if (nvram) {
-			switch(nvram->type) {
-			case SCSI_NCR_TEKRAM_NVRAM:
-				ncr_Tekram_setup_target(np, i, &nvram->data.Tekram);
-				break;
-			case SCSI_NCR_SYMBIOS_NVRAM:
-				ncr_Symbios_setup_target(np, i, &nvram->data.Symbios);
-				break;
-			}
-			if (driver_setup.use_nvram & 0x2)
-				tp->usrsync = driver_setup.default_sync;
-			if (driver_setup.use_nvram & 0x4)
-				tp->usrwide = driver_setup.max_wide;
-			if (driver_setup.use_nvram & 0x8)
-				tp->usrflag &= ~UF_NOSCAN;
-		}
-		else {
-#else
-		if (1) {
-#endif
-			tp->usrsync = driver_setup.default_sync;
-			tp->usrwide = driver_setup.max_wide;
-			tp->usrtags = MAX_TAGS;
-			if (!driver_setup.disconnection)
-				np->target[i].usrflag = UF_NODISC;
-		}
+		struct tcb *tp = &np->target[i];
+
+		tp->usrsync = driver_setup.default_sync;
+		tp->usrwide = driver_setup.max_wide;
+		tp->usrtags = MAX_TAGS;
+		if (!driver_setup.disconnection)
+			np->target[i].usrflag = UF_NODISC;
 	}
 
 	/*
 	**	Announce all that stuff to user.
 	*/
 
-	i = nvram ? nvram->type : 0;
-	printk(KERN_INFO "%s: %sID %d, Fast-%d%s%s\n", ncr_name(np),
-		i  == SCSI_NCR_SYMBIOS_NVRAM ? "Symbios format NVRAM, " :
-		(i == SCSI_NCR_TEKRAM_NVRAM  ? "Tekram format NVRAM, " : ""),
+	printk(KERN_INFO "%s: ID %d, Fast-%d%s%s\n", ncr_name(np),
 		np->myaddr,
 		np->minsync < 12 ? 40 : (np->minsync < 25 ? 20 : 10),
 		(np->rv_scntl0 & 0xa)	? ", Parity Checking"	: ", NO Parity",
@@ -3564,354 +3397,8 @@ static int __init ncr_prepare_setting(ncb_p np, ncr_nvram *nvram)
 	if (bootverbose && np->paddr2)
 		printk (KERN_INFO "%s: on-chip RAM at 0x%lx\n",
 			ncr_name(np), np->paddr2);
-
-	return 0;
-}
-
-/*
-**	Host attach and initialisations.
-**
-**	Allocate host data and ncb structure.
-**	Request IO region and remap MMIO region.
-**	Do chip initialization.
-**	If all is OK, install interrupt handling and
-**	start the timer daemon.
-*/
-
-struct Scsi_Host * __init 
-ncr_attach (Scsi_Host_Template *tpnt, int unit, struct ncr_device *device)
-{
-        struct host_data *host_data;
-	ncb_p np = 0;
-        struct Scsi_Host *instance = 0;
-	u_long flags = 0;
-	ncr_nvram *nvram = device->nvram;
-	int i;
-
-#ifdef SCSI_NCR_PROC_INFO_SUPPORT
-	tpnt->proc_info		= ncr53c8xx_proc_info,
-#endif
-	tpnt->info 		= ncr53c8xx_info;
-	tpnt->queuecommand	= ncr53c8xx_queue_command;
-	tpnt->slave_configure	= ncr53c8xx_slave_configure;
-	tpnt->eh_bus_reset_handler	= ncr53c8xx_bus_reset;
-	tpnt->can_queue		= SCSI_NCR_CAN_QUEUE;
-	tpnt->this_id		= 7;
-	tpnt->sg_tablesize	= SCSI_NCR_SG_TABLESIZE;
-	tpnt->cmd_per_lun	= SCSI_NCR_CMD_PER_LUN;
-	tpnt->use_clustering	= DISABLE_CLUSTERING;
-
-	if(device->differential)
-		driver_setup.diff_support = device->differential;
-
-	printk(KERN_INFO "ncr53c%s-%d: rev 0x%x on bus %d device %d function %d irq %d\n",
-		device->chip.name, unit, device->chip.revision_id,
-		device->slot.bus, (device->slot.device_fn & 0xf8) >> 3,
-		device->slot.device_fn & 7,
-		device->slot.irq);
-
-	/*
-	**	Allocate host_data structure
-	*/
-        if (!(instance = scsi_host_alloc(tpnt, sizeof(*host_data))))
-	        goto attach_error;
-	host_data = (struct host_data *) instance->hostdata;
-
-	/*
-	**	Allocate the host control block.
-	*/
-	np = __m_calloc_dma(device->dev, sizeof(struct ncb), "NCB");
-	if (!np)
-		goto attach_error;
-	NCR_INIT_LOCK_NCB(np);
-	np->dev  = device->dev;
-	np->p_ncb = vtobus(np);
-	host_data->ncb = np;
-
-	/*
-	**	Allocate the default CCB.
-	*/
-	np->ccb = (ccb_p) m_calloc_dma(sizeof(struct ccb), "CCB");
-	if (!np->ccb)
-		goto attach_error;
-
-	/*
-	**	Store input informations in the host data structure.
-	*/
-	strlcpy(np->chip_name, device->chip.name, sizeof(np->chip_name));
-	np->unit	= unit;
-	np->verbose	= driver_setup.verbose;
-	sprintf(np->inst_name, "ncr53c%s-%d", np->chip_name, np->unit);
-	np->device_id	= device->chip.device_id;
-	np->revision_id	= device->chip.revision_id;
-	np->bus		= device->slot.bus;
-	np->device_fn	= device->slot.device_fn;
-	np->features	= device->chip.features;
-	np->clock_divn	= device->chip.nr_divisor;
-	np->maxoffs	= device->chip.offset_max;
-	np->maxburst	= device->chip.burst_max;
-	np->myaddr	= device->host_id;
-
-	/*
-	**	Allocate SCRIPTS areas.
-	*/
-	np->script0  = (struct script *)
-			m_calloc_dma(sizeof(struct script), "SCRIPT");
-	if (!np->script0)
-		goto attach_error;
-	np->scripth0  = (struct scripth *)
-			m_calloc_dma(sizeof(struct scripth), "SCRIPTH");
-	if (!np->scripth0)
-		goto attach_error;
-
-	/*
-	**    Initialize timer structure
-        **
-        */
-	init_timer(&np->timer);
-	np->timer.data     = (unsigned long) np;
-	np->timer.function = ncr53c8xx_timeout;
-
-	/*
-	**	Try to map the controller chip to
-	**	virtual and physical memory.
-	*/
-
-	np->paddr	= device->slot.base;
-	np->paddr2	= (np->features & FE_RAM)? device->slot.base_2 : 0;
-
-#ifndef SCSI_NCR_IOMAPPED
-	if(device->slot.base_v)
-		np->vaddr = device->slot.base_v;
-	else
-		np->vaddr = (unsigned long)ioremap(device->slot.base_c, 128);
-
-	if (!np->vaddr) {
-		printk(KERN_ERR
-			"%s: can't map memory mapped IO region\n",ncr_name(np));
-		goto attach_error;
-	}
-	else
-		if (bootverbose > 1)
-			printk(KERN_INFO
-				"%s: using memory mapped IO at virtual address 0x%lx\n", ncr_name(np), (u_long) np->vaddr);
-
-	/*
-	**	Make the controller's registers available.
-	**	Now the INB INW INL OUTB OUTW OUTL macros
-	**	can be used safely.
-	*/
-
-	np->reg = (struct ncr_reg*) np->vaddr;
-
-#else
-
-	/*
-	**	Try to map the controller chip into iospace.
-	*/
-
-	np->base_io = device->slot.io_port;
-#endif /* !defined SCSI_NCR_IOMAPPED */
-
-#ifdef SCSI_NCR_NVRAM_SUPPORT
-	if (nvram) {
-		switch(nvram->type) {
-		case SCSI_NCR_SYMBIOS_NVRAM:
-#ifdef SCSI_NCR_DEBUG_NVRAM
-			ncr_display_Symbios_nvram(&nvram->data.Symbios);
-#endif
-			break;
-		case SCSI_NCR_TEKRAM_NVRAM:
-#ifdef SCSI_NCR_DEBUG_NVRAM
-			ncr_display_Tekram_nvram(&nvram->data.Tekram);
-#endif
-			break;
-		default:
-			nvram = 0;
-#ifdef SCSI_NCR_DEBUG_NVRAM
-			printk(KERN_DEBUG "%s: NVRAM: None or invalid data.\n", ncr_name(np));
-#endif
-		}
-	}
-#endif
-
-	/*
-	**	Do chip dependent initialization.
-	*/
-	(void)ncr_prepare_setting(np, nvram);
-
-	if (np->paddr2 && sizeof(struct script) > 4096) {
-		np->paddr2 = 0;
-		printk(KERN_WARNING "%s: script too large, NOT using on chip RAM.\n",
-			ncr_name(np));
-	}
-
-	/*
-	**	Fill Linux host instance structure
-	*/
-	instance->max_channel	= 0;
-	instance->this_id       = np->myaddr;
-	instance->max_id	= np->maxwide ? 16 : 8;
-	instance->max_lun	= SCSI_NCR_MAX_LUN;
-#ifndef SCSI_NCR_IOMAPPED
-	instance->base		= (unsigned long) np->reg;
-#endif
-	instance->irq		= device->slot.irq;
-	instance->unique_id	= device->slot.io_port;
-	instance->io_port	= device->slot.io_port;
-	instance->n_io_port	= 128;
-	instance->dma_channel	= 0;
-	instance->cmd_per_lun	= MAX_TAGS;
-	instance->can_queue	= (MAX_START-4);
-	scsi_set_device(instance, device->dev);
-
-#ifdef SCSI_NCR_INTEGRITY_CHECKING
-	np->check_integrity	  = 0;
-	instance->check_integrity = 0;
-
-#ifdef SCSI_NCR_ENABLE_INTEGRITY_CHECK
-	if ( !(driver_setup.bus_check & 0x04) ) {
-		np->check_integrity	  = 1;
-		instance->check_integrity = 1;
-	}
-#endif
-#endif
-	/*
-	**	Patch script to physical addresses
-	*/
-	ncr_script_fill (&script0, &scripth0);
-
-	np->scripth	= np->scripth0;
-	np->p_scripth	= vtobus(np->scripth);
-
-	np->p_script	= (np->paddr2) ?  np->paddr2 : vtobus(np->script0);
-
-	ncr_script_copy_and_bind (np, (ncrcmd *) &script0, (ncrcmd *) np->script0, sizeof(struct script));
-	ncr_script_copy_and_bind (np, (ncrcmd *) &scripth0, (ncrcmd *) np->scripth0, sizeof(struct scripth));
-	np->ccb->p_ccb		= vtobus (np->ccb);
-
-	/*
-	**    Patch the script for LED support.
-	*/
-
-	if (np->features & FE_LED0) {
-		np->script0->idle[0]  =
-				cpu_to_scr(SCR_REG_REG(gpreg, SCR_OR,  0x01));
-		np->script0->reselected[0] =
-				cpu_to_scr(SCR_REG_REG(gpreg, SCR_AND, 0xfe));
-		np->script0->start[0] =
-				cpu_to_scr(SCR_REG_REG(gpreg, SCR_AND, 0xfe));
-	}
-
-	/*
-	**	Look for the target control block of this nexus.
-	**	For i = 0 to 3
-	**		JUMP ^ IFTRUE (MASK (i, 3)), @(next_lcb)
-	*/
-	for (i = 0 ; i < 4 ; i++) {
-		np->jump_tcb[i].l_cmd   =
-				cpu_to_scr((SCR_JUMP ^ IFTRUE (MASK (i, 3))));
-		np->jump_tcb[i].l_paddr =
-				cpu_to_scr(NCB_SCRIPTH_PHYS (np, bad_target));
-	}
-
-	/*
-	**	Reset chip.
-	*/
-	ncr_chip_reset(np, 100);
-
-	/*
-	**	Now check the cache handling of the chipset.
-	*/
-
-	if (ncr_snooptest (np)) {
-		printk (KERN_ERR "CACHE INCORRECTLY CONFIGURED.\n");
-		goto attach_error;
-	};
-
-	/*
-	**	Install the interrupt handler.
-	*/
-
-	np->irq = device->slot.irq;
-
-	/*
-	**	Initialize the fixed part of the default ccb.
-	*/
-	ncr_init_ccb(np, np->ccb);
-
-	/*
-	**	After SCSI devices have been opened, we cannot
-	**	reset the bus safely, so we do it here.
-	**	Interrupt handler does the real work.
-	**	Process the reset exception,
-	**	if interrupts are not enabled yet.
-	**	Then enable disconnects.
-	*/
-	NCR_LOCK_NCB(np, flags);
-	if (ncr_reset_scsi_bus(np, 0, driver_setup.settle_delay) != 0) {
-		printk(KERN_ERR "%s: FATAL ERROR: CHECK SCSI BUS - CABLES, TERMINATION, DEVICE POWER etc.!\n", ncr_name(np));
-
-		NCR_UNLOCK_NCB(np, flags);
-		goto attach_error;
-	}
-	ncr_exception (np);
-
-	np->disc = 1;
-
-	/*
-	**	The middle-level SCSI driver does not
-	**	wait for devices to settle.
-	**	Wait synchronously if more than 2 seconds.
-	*/
-	if (driver_setup.settle_delay > 2) {
-		printk(KERN_INFO "%s: waiting %d seconds for scsi devices to settle...\n",
-			ncr_name(np), driver_setup.settle_delay);
-		MDELAY (1000 * driver_setup.settle_delay);
-	}
-
-	/*
-	**	Now let the generic SCSI driver
-	**	look for the SCSI devices on the bus ..
-	*/
-
-	/*
-	**	start the timeout daemon
-	*/
-	np->lasttime=0;
-	ncr_timeout (np);
-
-	/*
-	**  use SIMPLE TAG messages by default
-	*/
-#ifdef SCSI_NCR_ALWAYS_SIMPLE_TAG
-	np->order = M_SIMPLE_TAG;
-#endif
-
-	NCR_UNLOCK_NCB(np, flags);
-
-	return instance;
-
-attach_error:
-	if (!instance) return NULL;
-	printk(KERN_INFO "%s: detaching...\n", ncr_name(np));
-	if (!np)
-		goto unregister;
-	if (np->scripth0)
-		m_free_dma(np->scripth0, sizeof(struct scripth), "SCRIPTH");
-	if (np->script0)
-		m_free_dma(np->script0, sizeof(struct script), "SCRIPT");
-	if (np->ccb)
-		m_free_dma(np->ccb, sizeof(struct ccb), "CCB");
-	m_free_dma(np, sizeof(struct ncb), "NCB");
-
-unregister:
-	scsi_host_put(instance);
-
-        return NULL;
 }
 
-
 /*==========================================================
 **
 **
@@ -3931,20 +3418,20 @@ unregister:
 **
 **==========================================================
 */
-static inline void ncr_queue_done_cmd(ncb_p np, Scsi_Cmnd *cmd)
+static inline void ncr_queue_done_cmd(struct ncb *np, struct scsi_cmnd *cmd)
 {
 	unmap_scsi_data(np, cmd);
 	cmd->host_scribble = (char *) np->done_list;
 	np->done_list = cmd;
 }
 
-static inline void ncr_flush_done_cmds(Scsi_Cmnd *lcmd)
+static inline void ncr_flush_done_cmds(struct scsi_cmnd *lcmd)
 {
-	Scsi_Cmnd *cmd;
+	struct scsi_cmnd *cmd;
 
 	while (lcmd) {
 		cmd = lcmd;
-		lcmd = (Scsi_Cmnd *) cmd->host_scribble;
+		lcmd = (struct scsi_cmnd *) cmd->host_scribble;
 		cmd->scsi_done(cmd);
 	}
 }
@@ -3964,9 +3451,9 @@ static inline void ncr_flush_done_cmds(Scsi_Cmnd *lcmd)
 */
 
 #ifdef SCSI_NCR_INTEGRITY_CHECKING
-static int ncr_ic_nego(ncb_p np, ccb_p cp, Scsi_Cmnd *cmd, u_char *msgptr)
+static int ncr_ic_nego(struct ncb *np, struct ccb *cp, struct scsi_cmnd *cmd, u_char *msgptr)
 {
-	tcb_p tp = &np->target[cp->target];
+	struct tcb *tp = &np->target[cp->target];
 	int msglen = 0;
 	int nego = 0;
 	u_char no_increase;
@@ -4018,7 +3505,7 @@ static int ncr_ic_nego(ncb_p np, ccb_p cp, Scsi_Cmnd *cmd, u_char *msgptr)
 		}
 		
 		/* In case of a bus reset, ncr_negotiate will reset 
-                 * the flags tp->widedone and tp->period to 0, forcing
+		 * the flags tp->widedone and tp->period to 0, forcing
 		 * a new negotiation. 
 		 */
 		no_increase = 0;
@@ -4050,7 +3537,7 @@ static int ncr_ic_nego(ncb_p np, ccb_p cp, Scsi_Cmnd *cmd, u_char *msgptr)
 			}
 			else
 				cmd->ic_nego_width &= tp->ic_max_width;
-              
+
 			break;
 
 		case NS_SYNC:
@@ -4139,9 +3626,9 @@ static int ncr_ic_nego(ncb_p np, ccb_p cp, Scsi_Cmnd *cmd, u_char *msgptr)
 */
 
 
-static int ncr_prepare_nego(ncb_p np, ccb_p cp, u_char *msgptr)
+static int ncr_prepare_nego(struct ncb *np, struct ccb *cp, u_char *msgptr)
 {
-	tcb_p tp = &np->target[cp->target];
+	struct tcb *tp = &np->target[cp->target];
 	int msglen = 0;
 	int nego = 0;
 
@@ -4223,16 +3710,16 @@ static int ncr_prepare_nego(ncb_p np, ccb_p cp, u_char *msgptr)
 **
 **==========================================================
 */
-static int ncr_queue_command (ncb_p np, Scsi_Cmnd *cmd)
+static int ncr_queue_command (struct ncb *np, struct scsi_cmnd *cmd)
 {
-/*	Scsi_Device        *device    = cmd->device; */
-	tcb_p tp                      = &np->target[cmd->device->id];
-	lcb_p lp		      = tp->lp[cmd->device->lun];
-	ccb_p cp;
+/*	struct scsi_device        *device    = cmd->device; */
+	struct tcb *tp                      = &np->target[cmd->device->id];
+	struct lcb *lp		      = tp->lp[cmd->device->lun];
+	struct ccb *cp;
 
 	int	segments;
 	u_char	idmsg, *msgptr;
-	u_int  msglen;
+	u32	msglen;
 	int	direction;
 	u32	lastp, goalp;
 
@@ -4246,7 +3733,7 @@ static int ncr_queue_command (ncb_p np, Scsi_Cmnd *cmd)
 		(cmd->device->id >= MAX_TARGET) ||
 		(cmd->device->lun    >= MAX_LUN   )) {
 		return(DID_BAD_TARGET);
-        }
+	}
 
 	/*---------------------------------------------
 	**
@@ -4284,7 +3771,7 @@ static int ncr_queue_command (ncb_p np, Scsi_Cmnd *cmd)
 			np->settle_time = tlimit;
 	}
 
-        if (np->settle_time || !(cp=ncr_get_ccb (np, cmd->device->id, cmd->device->lun))) {
+	if (np->settle_time || !(cp=ncr_get_ccb (np, cmd->device->id, cmd->device->lun))) {
 		insert_into_waiting_list(np, cmd);
 		return(DID_OK);
 	}
@@ -4358,7 +3845,7 @@ static int ncr_queue_command (ncb_p np, Scsi_Cmnd *cmd)
 
 	direction = scsi_data_direction(cmd);
 	if (direction != SCSI_DATA_NONE) {
-		segments = ncr_scatter (np, cp, cp->cmd);
+		segments = ncr_scatter(np, cp, cp->cmd);
 		if (segments < 0) {
 			ncr_free_ccb(np, cp);
 			return(DID_ERROR);
@@ -4388,13 +3875,13 @@ static int ncr_queue_command (ncb_p np, Scsi_Cmnd *cmd)
 	}
 	else if (np->check_integrity && (cmd->ic_in_progress)) { 
 		msglen += ncr_ic_nego (np, cp, cmd, msgptr + msglen);
-        }
+	}
 	else if (np->check_integrity && cmd->ic_complete) {
-                /*
-                 * Midlayer signal to the driver that all of the scsi commands
-                 * for the integrity check have completed. Save the negotiated
-                 * parameters (extracted from sval and wval). 
-                 */ 
+		/*
+		 * Midlayer signal to the driver that all of the scsi commands
+		 * for the integrity check have completed. Save the negotiated
+		 * parameters (extracted from sval and wval). 
+		 */ 
 
 		{
 			u_char idiv;
@@ -4417,8 +3904,8 @@ static int ncr_queue_command (ncb_p np, Scsi_Cmnd *cmd)
 
 
 		/*
-                 * Negotiation for this target it complete.
-                 */
+		 * Negotiation for this target it complete.
+		 */
 		tp->ic_max_width =  (tp->wval & EWS) ? 1: 0;
 		tp->ic_done = 1;
 		tp->widedone = 1;
@@ -4430,17 +3917,17 @@ static int ncr_queue_command (ncb_p np, Scsi_Cmnd *cmd)
 				tp->ic_max_width?"WIDE":"NARROW");
 
 		if (tp->sval&0x1f) {
-                        u_long mbs = 10000 * (tp->ic_max_width + 1);
+			u_long mbs = 10000 * (tp->ic_max_width + 1);
 
-                        printk(" %d.%d  MB/s", 
-                                (int) (mbs / tp->period), (int) (mbs % tp->period));
+			printk(" %d.%d  MB/s", (int) (mbs / tp->period),
+					(int) (mbs % tp->period));
 
 			printk(" (%d ns, %d offset)\n", 
 				  tp->period/10, tp->sval&0x1f);
+		} else {
+			printk(" %d MB/s. \n ", (tp->ic_max_width+1)*5);
 		}
-		else
-                        printk(" %d MB/s. \n ", (tp->ic_max_width+1)*5);
-        }
+	}
 #else
 	if ((!tp->widedone || !tp->period) && !tp->nego_cp && lp) {
 		msglen += ncr_prepare_nego (np, cp, msgptr + msglen);
@@ -4600,10 +4087,10 @@ static int ncr_queue_command (ncb_p np, Scsi_Cmnd *cmd)
 **==========================================================
 */
 
-static void ncr_start_next_ccb(ncb_p np, lcb_p lp, int maxn)
+static void ncr_start_next_ccb(struct ncb *np, struct lcb *lp, int maxn)
 {
 	XPT_QUEHEAD *qp;
-	ccb_p cp;
+	struct ccb *cp;
 
 	if (lp->held_ccb)
 		return;
@@ -4621,9 +4108,9 @@ static void ncr_start_next_ccb(ncb_p np, lcb_p lp, int maxn)
 	}
 }
 
-static void ncr_put_start_queue(ncb_p np, ccb_p cp)
+static void ncr_put_start_queue(struct ncb *np, struct ccb *cp)
 {
-	u_short	qidx;
+	u16	qidx;
 
 	/*
 	**	insert into start queue.
@@ -4645,33 +4132,14 @@ static void ncr_put_start_queue(ncb_p np, ccb_p cp)
 
 	/*
 	**	Script processor may be waiting for reselect.
-	**	Wake it up.
-	*/
-	MEMORY_BARRIER();
-	OUTB (nc_istat, SIGP);
-}
-
-
-/*==========================================================
-**
-**
-**	Start reset process.
-**	If reset in progress do nothing.
-**	The interrupt handler will reinitialize the chip.
-**	The timeout handler will wait for settle_time before 
-**	clearing it and so resuming command processing.
-**
-**
-**==========================================================
-*/
-static void ncr_start_reset(ncb_p np)
-{
-	if (!np->settle_time) {
-		(void) ncr_reset_scsi_bus(np, 1, driver_setup.settle_delay);
- 	}
- }
- 
-static int ncr_reset_scsi_bus(ncb_p np, int enab_int, int settle_delay)
+	**	Wake it up.
+	*/
+	MEMORY_BARRIER();
+	OUTB (nc_istat, SIGP);
+}
+
+
+static int ncr_reset_scsi_bus(struct ncb *np, int enab_int, int settle_delay)
 {
 	u32 term;
 	int retv = 0;
@@ -4692,8 +4160,6 @@ static int ncr_reset_scsi_bus(ncb_p np, int enab_int, int settle_delay)
 	**	properly set IRQ mode, prior to resetting the bus.
 	*/
 	OUTB (nc_stest3, TE);
-	if (np->device_id != PSEUDO_720_ID)
-		OUTB (nc_dcntl, (np->rv_dcntl & IRQM));
 	OUTB (nc_scntl1, CRST);
 	UDELAY (200);
 
@@ -4732,6 +4198,20 @@ out:
 	return retv;
 }
 
+/*
+ * Start reset process.
+ * If reset in progress do nothing.
+ * The interrupt handler will reinitialize the chip.
+ * The timeout handler will wait for settle_time before 
+ * clearing it and so resuming command processing.
+ */
+static void ncr_start_reset(struct ncb *np)
+{
+	if (!np->settle_time) {
+		ncr_reset_scsi_bus(np, 1, driver_setup.settle_delay);
+ 	}
+}
+ 
 /*==========================================================
 **
 **
@@ -4741,10 +4221,10 @@ out:
 **
 **==========================================================
 */
-static int ncr_reset_bus (ncb_p np, Scsi_Cmnd *cmd, int sync_reset)
+static int ncr_reset_bus (struct ncb *np, struct scsi_cmnd *cmd, int sync_reset)
 {
-/*	Scsi_Device        *device    = cmd->device; */
-	ccb_p cp;
+/*	struct scsi_device        *device    = cmd->device; */
+	struct ccb *cp;
 	int found;
 
 /*
@@ -4809,10 +4289,10 @@ static int ncr_reset_bus (ncb_p np, Scsi_Cmnd *cmd, int sync_reset)
 **
 **==========================================================
 */
-static int ncr_abort_command (ncb_p np, Scsi_Cmnd *cmd)
+static int ncr_abort_command (struct ncb *np, struct scsi_cmnd *cmd)
 {
-/*	Scsi_Device        *device    = cmd->device; */
-	ccb_p cp;
+/*	struct scsi_device        *device    = cmd->device; */
+	struct ccb *cp;
 	int found;
 	int retv;
 
@@ -4892,11 +4372,11 @@ static int ncr_abort_command (ncb_p np, Scsi_Cmnd *cmd)
 **==========================================================
 */
 
-static int ncr_detach(ncb_p np)
+static void ncr_detach(struct ncb *np)
 {
-	ccb_p cp;
-	tcb_p tp;
-	lcb_p lp;
+	struct ccb *cp;
+	struct tcb *tp;
+	struct lcb *lp;
 	int target, lun;
 	int i;
 	char inst_name[16];
@@ -4965,9 +4445,7 @@ static int ncr_detach(ncb_p np)
 		m_free_dma(cp, sizeof(*cp), "CCB");
 	}
 
-	/*
-	**	Free allocated tp(s)
-	*/
+	/* Free allocated tp(s) */
 
 	for (target = 0; target < MAX_TARGET ; target++) {
 		tp=&np->target[target];
@@ -4993,8 +4471,6 @@ static int ncr_detach(ncb_p np)
 	m_free_dma(np, sizeof(struct ncb), "NCB");
 
 	printk("%s: host resources successfully released\n", inst_name);
-
-	return 1;
 }
 
 /*==========================================================
@@ -5007,11 +4483,11 @@ static int ncr_detach(ncb_p np)
 **==========================================================
 */
 
-void ncr_complete (ncb_p np, ccb_p cp)
+void ncr_complete (struct ncb *np, struct ccb *cp)
 {
-	Scsi_Cmnd *cmd;
-	tcb_p tp;
-	lcb_p lp;
+	struct scsi_cmnd *cmd;
+	struct tcb *tp;
+	struct lcb *lp;
 
 	/*
 	**	Sanity check
@@ -5044,7 +4520,7 @@ void ncr_complete (ncb_p np, ccb_p cp)
 	*/
 
 	if (cp == tp->nego_cp)
-		tp->nego_cp = 0;
+		tp->nego_cp = NULL;
 
 	/*
 	**	If auto-sense performed, change scsi status.
@@ -5062,7 +4538,7 @@ void ncr_complete (ncb_p np, ccb_p cp)
 		if (cp == lp->held_ccb) {
 			xpt_que_splice(&lp->skip_ccbq, &lp->wait_ccbq);
 			xpt_que_init(&lp->skip_ccbq);
-			lp->held_ccb = 0;
+			lp->held_ccb = NULL;
 		}
 	}
 
@@ -5113,11 +4589,11 @@ void ncr_complete (ncb_p np, ccb_p cp)
 	if (   (cp->host_status == HS_COMPLETE)
 		&& (cp->scsi_status == S_GOOD ||
 		    cp->scsi_status == S_COND_MET)) {
-                /*
-		**	All went well (GOOD status).
-		**	CONDITION MET status is returned on 
-                **	`Pre-Fetch' or `Search data' success.
-                */
+		/*
+		 *	All went well (GOOD status).
+		 *	CONDITION MET status is returned on 
+		 *	`Pre-Fetch' or `Search data' success.
+		 */
 		cmd->result = ScsiResult(DID_OK, cp->scsi_status);
 
 		/*
@@ -5300,10 +4776,10 @@ void ncr_complete (ncb_p np, ccb_p cp)
 **	This CCB has been skipped by the NCR.
 **	Queue it in the correponding unit queue.
 */
-static void ncr_ccb_skipped(ncb_p np, ccb_p cp)
+static void ncr_ccb_skipped(struct ncb *np, struct ccb *cp)
 {
-	tcb_p tp = &np->target[cp->target];
-	lcb_p lp = tp->lp[cp->lun];
+	struct tcb *tp = &np->target[cp->target];
+	struct lcb *lp = tp->lp[cp->lun];
 
 	if (lp && cp != np->ccb) {
 		cp->host_status &= ~HS_SKIPMASK;
@@ -5325,9 +4801,9 @@ static void ncr_ccb_skipped(ncb_p np, ccb_p cp)
 **	The NCR has completed CCBs.
 **	Look at the DONE QUEUE if enabled, otherwise scan all CCBs
 */
-void ncr_wakeup_done (ncb_p np)
+void ncr_wakeup_done (struct ncb *np)
 {
-	ccb_p cp;
+	struct ccb *cp;
 #ifdef SCSI_NCR_CCB_DONE_SUPPORT
 	int i, j;
 
@@ -5341,7 +4817,7 @@ void ncr_wakeup_done (ncb_p np)
 		if (!CCB_DONE_VALID(cp))
 			break;
 
-		np->ccb_done[j] = (ccb_p) CCB_DONE_EMPTY;
+		np->ccb_done[j] = (struct ccb *)CCB_DONE_EMPTY;
 		np->scripth->done_queue[5*j + 4] =
 				cpu_to_scr(NCB_SCRIPT_PHYS (np, done_plug));
 		MEMORY_BARRIER();
@@ -5371,9 +4847,9 @@ void ncr_wakeup_done (ncb_p np)
 /*
 **	Complete all active CCBs.
 */
-void ncr_wakeup (ncb_p np, u_long code)
+void ncr_wakeup (struct ncb *np, u_long code)
 {
-	ccb_p cp = np->ccb;
+	struct ccb *cp = np->ccb;
 
 	while (cp) {
 		if (cp->host_status != HS_IDLE) {
@@ -5392,7 +4868,7 @@ void ncr_wakeup (ncb_p np, u_long code)
  * at least.  EA (dcntl bit 5) isn't set here as it is set once only in
  * the _detect function.
  */
-static void ncr_chip_reset(ncb_p np, int delay)
+static void ncr_chip_reset(struct ncb *np, int delay)
 {
 	OUTB (nc_istat,  SRST);
 	UDELAY (delay);
@@ -5414,7 +4890,7 @@ static void ncr_chip_reset(ncb_p np, int delay)
 **==========================================================
 */
 
-void ncr_init (ncb_p np, int reset, char * msg, u_long code)
+void ncr_init (struct ncb *np, int reset, char * msg, u_long code)
 {
  	int	i;
 
@@ -5456,7 +4932,7 @@ void ncr_init (ncb_p np, int reset, char * msg, u_long code)
 	**	Clear Done Queue
 	*/
 	for (i = 0; i < MAX_DONE; i++) {
-		np->ccb_done[i] = (ccb_p) CCB_DONE_EMPTY;
+		np->ccb_done[i] = (struct ccb *)CCB_DONE_EMPTY;
 		np->scripth0->done_queue[5*i + 4] =
 			cpu_to_scr(NCB_SCRIPT_PHYS (np, done_end));
 	}
@@ -5527,24 +5003,6 @@ void ncr_init (ncb_p np, int reset, char * msg, u_long code)
 	OUTW (nc_sien , STO|HTH|MA|SGE|UDC|RST|PAR);
 	OUTB (nc_dien , MDPE|BF|ABRT|SSI|SIR|IID);
 
-	/*
-	**	For 895/6 enable SBMC interrupt and save current SCSI bus mode.
-	*/
-	if (np->features & FE_ULTRA2) {
-		OUTONW (nc_sien, SBMC);
-		np->scsi_mode = INB (nc_stest4) & SMODE;
-	}
-
-	/*
-	**	DEL 441 - 53C876 Rev 5 - Part Number 609-0392787/2788 - ITEM 2.
-	**	Disable overlapped arbitration.
-	**	All 896 chips are also affected by this errata.
-	*/
-	if (np->device_id == PCI_DEVICE_ID_NCR_53C875)
-		OUTB (nc_ctest0, (1<<5));
-	else if (np->device_id == PCI_DEVICE_ID_NCR_53C896)
-		OUTB (nc_ccntl0, DPR);
-
 	/*
 	**	Fill in target structure.
 	**	Reinitialize usrsync.
@@ -5553,7 +5011,7 @@ void ncr_init (ncb_p np, int reset, char * msg, u_long code)
 	*/
 
 	for (i=0;i<MAX_TARGET;i++) {
-		tcb_p tp = &np->target[i];
+		struct tcb *tp = &np->target[i];
 
 		tp->sval    = 0;
 		tp->wval    = np->rv_scntl3;
@@ -5651,7 +5109,7 @@ static void ncr_negotiate (struct ncb* np, struct tcb* tp)
 **==========================================================
 */
 
-static void ncr_getsync(ncb_p np, u_char sfac, u_char *fakp, u_char *scntl3p)
+static void ncr_getsync(struct ncb *np, u_char sfac, u_char *fakp, u_char *scntl3p)
 {
 	u_long	clk = np->clock_khz;	/* SCSI clock frequency in kHz	*/
 	int	div = np->clock_divn;	/* Number of divisors supported	*/
@@ -5720,10 +5178,10 @@ static void ncr_getsync(ncb_p np, u_char sfac, u_char *fakp, u_char *scntl3p)
 **==========================================================
 */
 
-static void ncr_set_sync_wide_status (ncb_p np, u_char target)
+static void ncr_set_sync_wide_status (struct ncb *np, u_char target)
 {
-	ccb_p cp;
-	tcb_p tp = &np->target[target];
+	struct ccb *cp;
+	struct tcb *tp = &np->target[target];
 
 	/*
 	**	set actual value and sync_status
@@ -5755,10 +5213,10 @@ static void ncr_set_sync_wide_status (ncb_p np, u_char target)
 **==========================================================
 */
 
-static void ncr_setsync (ncb_p np, ccb_p cp, u_char scntl3, u_char sxfer)
+static void ncr_setsync (struct ncb *np, struct ccb *cp, u_char scntl3, u_char sxfer)
 {
-	Scsi_Cmnd *cmd;
-	tcb_p tp;
+	struct scsi_cmnd *cmd;
+	struct tcb *tp;
 	u_char target = INB (nc_sdid) & 0x0f;
 	u_char idiv;
 
@@ -5839,11 +5297,11 @@ static void ncr_setsync (ncb_p np, ccb_p cp, u_char scntl3, u_char sxfer)
 **==========================================================
 */
 
-static void ncr_setwide (ncb_p np, ccb_p cp, u_char wide, u_char ack)
+static void ncr_setwide (struct ncb *np, struct ccb *cp, u_char wide, u_char ack)
 {
-	Scsi_Cmnd *cmd;
-	u_short target = INB (nc_sdid) & 0x0f;
-	tcb_p tp;
+	struct scsi_cmnd *cmd;
+	u16 target = INB (nc_sdid) & 0x0f;
+	struct tcb *tp;
 	u_char	scntl3;
 	u_char	sxfer;
 
@@ -5893,10 +5351,10 @@ static void ncr_setwide (ncb_p np, ccb_p cp, u_char wide, u_char ack)
 **==========================================================
 */
 
-static void ncr_setup_tags (ncb_p np, u_char tn, u_char ln)
+static void ncr_setup_tags (struct ncb *np, u_char tn, u_char ln)
 {
-	tcb_p tp = &np->target[tn];
-	lcb_p lp = tp->lp[ln];
+	struct tcb *tp = &np->target[tn];
+	struct lcb *lp = tp->lp[ln];
 	u_char   reqtags, maxdepth;
 
 	/*
@@ -5989,10 +5447,10 @@ static void ncr_setup_tags (ncb_p np, u_char tn, u_char ln)
 
 #ifdef SCSI_NCR_USER_COMMAND_SUPPORT
 
-static void ncr_usercmd (ncb_p np)
+static void ncr_usercmd (struct ncb *np)
 {
 	u_char t;
-	tcb_p tp;
+	struct tcb *tp;
 
 	switch (np->user.cmd) {
 
@@ -6013,7 +5471,7 @@ static void ncr_usercmd (ncb_p np)
 			if (!((np->user.target>>t)&1)) continue;
 			np->target[t].usrtags = np->user.data;
 			for (ln = 0; ln < MAX_LUN; ln++) {
-				lcb_p lp = np->target[t].lp[ln];
+				struct lcb *lp = np->target[t].lp[ln];
 				if (!lp)
 					continue;
 				lp->maxtags = lp->numtags = np->user.data;
@@ -6074,7 +5532,7 @@ static void ncr_usercmd (ncb_p np)
 **----------------------------------------------------------
 */
 
-static void ncr_timeout (ncb_p np)
+static void ncr_timeout (struct ncb *np)
 {
 	u_long	thistime = ktime_get(0);
 
@@ -6162,7 +5620,7 @@ static void ncr_timeout (ncb_p np)
 **==========================================================
 */
 
-static void ncr_log_hard_error(ncb_p np, u_short sist, u_char dstat)
+static void ncr_log_hard_error(struct ncb *np, u16 sist, u_char dstat)
 {
 	u32	dsp;
 	int	script_ofs;
@@ -6188,7 +5646,7 @@ static void ncr_log_hard_error(ncb_p np, u_short sist, u_char dstat)
 	} else {
 		script_ofs	= dsp;
 		script_size	= 0;
-		script_base	= 0;
+		script_base	= NULL;
 		script_name	= "mem";
 	}
 
@@ -6204,10 +5662,10 @@ static void ncr_log_hard_error(ncb_p np, u_short sist, u_char dstat)
 			scr_to_cpu((int) *(ncrcmd *)(script_base + script_ofs)));
 	}
 
-        printk ("%s: regdump:", ncr_name(np));
-        for (i=0; i<16;i++)
+	printk ("%s: regdump:", ncr_name(np));
+	for (i=0; i<16;i++)
             printk (" %02x", (unsigned)INB_OFF(i));
-        printk (".\n");
+	printk (".\n");
 }
 
 /*============================================================
@@ -6242,10 +5700,10 @@ static void ncr_log_hard_error(ncb_p np, u_short sist, u_char dstat)
 **============================================================
 */
 
-void ncr_exception (ncb_p np)
+void ncr_exception (struct ncb *np)
 {
 	u_char	istat, dstat;
-	u_short	sist;
+	u16	sist;
 	int	i;
 
 	/*
@@ -6425,10 +5883,10 @@ void ncr_exception (ncb_p np)
 **----------------------------------------------------------
 */
 
-void ncr_int_sto (ncb_p np)
+void ncr_int_sto (struct ncb *np)
 {
 	u_long dsa;
-	ccb_p cp;
+	struct ccb *cp;
 	if (DEBUG_FLAGS & DEBUG_TINY) printk ("T");
 
 	/*
@@ -6470,7 +5928,7 @@ void ncr_int_sto (ncb_p np)
 **----------------------------------------------------------
 */
 
-static int ncr_int_sbmc (ncb_p np)
+static int ncr_int_sbmc (struct ncb *np)
 {
 	u_char scsi_mode = INB (nc_stest4) & SMODE;
 
@@ -6502,7 +5960,7 @@ static int ncr_int_sbmc (ncb_p np)
 **----------------------------------------------------------
 */
 
-static int ncr_int_par (ncb_p np)
+static int ncr_int_par (struct ncb *np)
 {
 	u_char	hsts	= INB (HS_PRT);
 	u32	dbc	= INL (nc_dbc);
@@ -6589,7 +6047,7 @@ reset_all:
 **----------------------------------------------------------
 */
 
-static void ncr_int_ma (ncb_p np)
+static void ncr_int_ma (struct ncb *np)
 {
 	u32	dbc;
 	u32	rest;
@@ -6600,9 +6058,9 @@ static void ncr_int_ma (ncb_p np)
 	u32	*vdsp;
 	u32	oadr, olen;
 	u32	*tblp;
-        ncrcmd *newcmd;
+	ncrcmd *newcmd;
 	u_char	cmd, sbcl;
-	ccb_p	cp;
+	struct ccb *cp;
 
 	dsp	= INL (nc_dsp);
 	dbc	= INL (nc_dbc);
@@ -6618,7 +6076,7 @@ static void ncr_int_ma (ncb_p np)
 
 	if ((cmd & 1) == 0) {
 		u_char	ctest5, ss0, ss2;
-		u_short	delta;
+		u16	delta;
 
 		ctest5 = (np->rv_ctest5 & DFS) ? INB (nc_ctest5) : 0;
 		if (ctest5 & DFS)
@@ -6667,7 +6125,7 @@ static void ncr_int_ma (ncb_p np)
 	if (!(cmd & 6)) {
 		cp = np->header.cp;
 		if (CCB_PHYS(cp, phys) != dsa)
-			cp = 0;
+			cp = NULL;
 	} else {
 		cp  = np->ccb;
 		while (cp && (CCB_PHYS (cp, phys) != dsa))
@@ -6678,7 +6136,7 @@ static void ncr_int_ma (ncb_p np)
 	**	try to find the interrupted script command,
 	**	and the address at which to continue.
 	*/
-	vdsp	= 0;
+	vdsp	= NULL;
 	nxtdsp	= 0;
 	if	(dsp >  np->p_script &&
 		 dsp <= np->p_script + sizeof(struct script)) {
@@ -6890,13 +6348,13 @@ reset_all:
 }
 
 
-static void ncr_sir_to_redo(ncb_p np, int num, ccb_p cp)
+static void ncr_sir_to_redo(struct ncb *np, int num, struct ccb *cp)
 {
-	Scsi_Cmnd *cmd	= cp->cmd;
-	tcb_p tp	= &np->target[cmd->device->id];
-	lcb_p lp	= tp->lp[cmd->device->lun];
+	struct scsi_cmnd *cmd	= cp->cmd;
+	struct tcb *tp	= &np->target[cmd->device->id];
+	struct lcb *lp	= tp->lp[cmd->device->lun];
 	XPT_QUEHEAD	*qp;
-	ccb_p		cp2;
+	struct ccb *	cp2;
 	int		disc_cnt = 0;
 	int		busy_cnt = 0;
 	u32		startp;
@@ -7059,7 +6517,7 @@ static int ncr_show_msg (u_char * msg)
 	return (1);
 }
 
-static void ncr_print_msg ( ccb_p cp, char *label, u_char *msg)
+static void ncr_print_msg ( struct ccb *cp, char *label, u_char *msg)
 {
 	if (cp)
 		PRINT_ADDR(cp->cmd);
@@ -7070,15 +6528,15 @@ static void ncr_print_msg ( ccb_p cp, char *label, u_char *msg)
 	printk(".\n");
 }
 
-void ncr_int_sir (ncb_p np)
+void ncr_int_sir (struct ncb *np)
 {
 	u_char scntl3;
 	u_char chg, ofs, per, fak, wide;
 	u_char num = INB (nc_dsps);
-	ccb_p	cp=0;
+	struct ccb *cp=NULL;
 	u_long	dsa    = INL (nc_dsa);
 	u_char	target = INB (nc_sdid) & 0x0f;
-	tcb_p	tp     = &np->target[target];
+	struct tcb *tp     = &np->target[target];
 
 	if (DEBUG_FLAGS & DEBUG_TINY) printk ("I#%d", num);
 
@@ -7548,12 +7006,12 @@ out:
 **==========================================================
 */
 
-static	ccb_p ncr_get_ccb (ncb_p np, u_char tn, u_char ln)
+static	struct ccb *ncr_get_ccb (struct ncb *np, u_char tn, u_char ln)
 {
-	tcb_p tp = &np->target[tn];
-	lcb_p lp = tp->lp[ln];
+	struct tcb *tp = &np->target[tn];
+	struct lcb *lp = tp->lp[ln];
 	u_char tag = NO_TAG;
-	ccb_p cp = (ccb_p) 0;
+	struct ccb *cp = NULL;
 
 	/*
 	**	Lun structure available ?
@@ -7564,7 +7022,7 @@ static	ccb_p ncr_get_ccb (ncb_p np, u_char tn, u_char ln)
 		**	Keep from using more tags than we can handle.
 		*/
 		if (lp->usetags && lp->busyccbs >= lp->maxnxs)
-			return (ccb_p) 0;
+			return NULL;
 
 		/*
 		**	Allocate a new CCB if needed.
@@ -7588,7 +7046,7 @@ static	ccb_p ncr_get_ccb (ncb_p np, u_char tn, u_char ln)
 			if (cp->magic) {
 				PRINT_LUN(np, tn, ln);
 				printk ("ccb free list corrupted (@%p)\n", cp);
-				cp = 0;
+				cp = NULL;
 			}
 			else {
 				xpt_insque_tail(qp, &lp->wait_ccbq);
@@ -7605,7 +7063,7 @@ static	ccb_p ncr_get_ccb (ncb_p np, u_char tn, u_char ln)
 				tag = lp->cb_tags[lp->ia_tag];
 		}
 		else if (lp->actccbs > 0)
-			return (ccb_p) 0;
+			return NULL;
 	}
 
 	/*
@@ -7626,7 +7084,7 @@ static	ccb_p ncr_get_ccb (ncb_p np, u_char tn, u_char ln)
 #endif
 
 	if (cp->magic)
-		return ((ccb_p) 0);
+		return NULL;
 
 	cp->magic = 1;
 
@@ -7666,10 +7124,10 @@ static	ccb_p ncr_get_ccb (ncb_p np, u_char tn, u_char ln)
 **==========================================================
 */
 
-static void ncr_free_ccb (ncb_p np, ccb_p cp)
+static void ncr_free_ccb (struct ncb *np, struct ccb *cp)
 {
-	tcb_p tp = &np->target[cp->target];
-	lcb_p lp = tp->lp[cp->lun];
+	struct tcb *tp = &np->target[cp->target];
+	struct lcb *lp = tp->lp[cp->lun];
 
 	if (DEBUG_FLAGS & DEBUG_TAGS) {
 		PRINT_LUN(np, cp->target, cp->lun);
@@ -7731,7 +7189,7 @@ static void ncr_free_ccb (ncb_p np, ccb_p cp)
 **------------------------------------------------------------------------
 **------------------------------------------------------------------------
 */
-static void ncr_init_ccb(ncb_p np, ccb_p cp)
+static void ncr_init_ccb(struct ncb *np, struct ccb *cp)
 {
 	ncrcmd copy_4 = np->features & FE_PFEN ? SCR_COPY(4) : SCR_COPY_F(4);
 
@@ -7770,11 +7228,11 @@ static void ncr_init_ccb(ncb_p np, ccb_p cp)
 **------------------------------------------------------------------------
 **------------------------------------------------------------------------
 */
-static void ncr_alloc_ccb(ncb_p np, u_char tn, u_char ln)
+static void ncr_alloc_ccb(struct ncb *np, u_char tn, u_char ln)
 {
-	tcb_p tp = &np->target[tn];
-	lcb_p lp = tp->lp[ln];
-	ccb_p cp = 0;
+	struct tcb *tp = &np->target[tn];
+	struct lcb *lp = tp->lp[ln];
+	struct ccb *cp = NULL;
 
 	/*
 	**	Allocate memory for this CCB.
@@ -7820,9 +7278,9 @@ static void ncr_alloc_ccb(ncb_p np, u_char tn, u_char ln)
 **	It contains a SCRIPT that is called on target reselection.
 **------------------------------------------------------------------------
 */
-static void ncr_init_tcb (ncb_p np, u_char tn)
+static void ncr_init_tcb (struct ncb *np, u_char tn)
 {
-	tcb_p tp = &np->target[tn];
+	struct tcb *tp = &np->target[tn];
 	ncrcmd copy_1 = np->features & FE_PFEN ? SCR_COPY(1) : SCR_COPY_F(1);
 	int th = tn & 3;
 	int i;
@@ -7907,10 +7365,10 @@ static void ncr_init_tcb (ncb_p np, u_char tn)
 **	command has been successfully completed for this target/lun.
 **------------------------------------------------------------------------
 */
-static lcb_p ncr_alloc_lcb (ncb_p np, u_char tn, u_char ln)
+static struct lcb *ncr_alloc_lcb (struct ncb *np, u_char tn, u_char ln)
 {
-	tcb_p tp = &np->target[tn];
-	lcb_p lp = tp->lp[ln];
+	struct tcb *tp = &np->target[tn];
+	struct lcb *lp = tp->lp[ln];
 	ncrcmd copy_4 = np->features & FE_PFEN ? SCR_COPY(4) : SCR_COPY_F(4);
 	int lh = ln & 3;
 
@@ -7997,10 +7455,10 @@ fail:
 **	will play with CHANGE DEFINITION commands. :-)
 **------------------------------------------------------------------------
 */
-static lcb_p ncr_setup_lcb (ncb_p np, u_char tn, u_char ln, u_char *inq_data)
+static struct lcb *ncr_setup_lcb (struct ncb *np, u_char tn, u_char ln, u_char *inq_data)
 {
-	tcb_p tp = &np->target[tn];
-	lcb_p lp = tp->lp[ln];
+	struct tcb *tp = &np->target[tn];
+	struct lcb *lp = tp->lp[ln];
 	u_char inq_byte7;
 
 	/*
@@ -8117,44 +7575,57 @@ fail:
 **	sizes to the data segment array.
 */
 
-static	int	ncr_scatter(ncb_p np, ccb_p cp, Scsi_Cmnd *cmd)
+static int ncr_scatter_no_sglist(struct ncb *np, struct ccb *cp, struct scsi_cmnd *cmd)
+{
+	struct scr_tblmove *data = &cp->phys.data[MAX_SCATTER - 1];
+	int segment;
+
+	cp->data_len = cmd->request_bufflen;
+
+	if (cmd->request_bufflen) {
+		dma_addr_t baddr = map_scsi_single_data(np, cmd);
+		if (baddr) {
+			ncr_build_sge(np, data, baddr, cmd->request_bufflen);
+			segment = 1;
+		} else {
+			segment = -2;
+		}
+	} else {
+		segment = 0;
+	}
+
+	return segment;
+}
+
+static int ncr_scatter(struct ncb *np, struct ccb *cp, struct scsi_cmnd *cmd)
 {
-	struct scr_tblmove *data;
 	int segment	= 0;
 	int use_sg	= (int) cmd->use_sg;
 
-	data		= cp->phys.data;
 	cp->data_len	= 0;
 
-	if (!use_sg) {
-		if (cmd->request_bufflen) {
-			u_long baddr = map_scsi_single_data(np, cmd);
+	if (!use_sg)
+		segment = ncr_scatter_no_sglist(np, cp, cmd);
+	else if ((use_sg = map_scsi_sg_data(np, cmd)) > 0) {
+		struct scatterlist *scatter = (struct scatterlist *)cmd->buffer;
+		struct scr_tblmove *data;
 
-			data = &data[MAX_SCATTER - 1];
-			data[0].addr = cpu_to_scr(baddr);
-			data[0].size = cpu_to_scr(cmd->request_bufflen);
-			cp->data_len = cmd->request_bufflen;
-			segment = 1;
+		if (use_sg > MAX_SCATTER) {
+			unmap_scsi_data(np, cmd);
+			return -1;
 		}
-	}
-	else if (use_sg <= MAX_SCATTER) {
-		struct scatterlist *scatter = (struct scatterlist *)cmd->buffer;
 
-		use_sg = map_scsi_sg_data(np, cmd);
-		data = &data[MAX_SCATTER - use_sg];
+		data = &cp->phys.data[MAX_SCATTER - use_sg];
 
-		while (segment < use_sg) {
-			u_long baddr = scsi_sg_dma_address(&scatter[segment]);
-			unsigned int len = scsi_sg_dma_len(&scatter[segment]);
+		for (segment = 0; segment < use_sg; segment++) {
+			dma_addr_t baddr = sg_dma_address(&scatter[segment]);
+			unsigned int len = sg_dma_len(&scatter[segment]);
 
-			data[segment].addr = cpu_to_scr(baddr);
-			data[segment].size = cpu_to_scr(len);
-			cp->data_len	  += len;
-			++segment;
+			ncr_build_sge(np, &data[segment], baddr, len);
+			cp->data_len += len;
 		}
-	}
-	else {
-		return -1;
+	} else {
+		segment = -2;
 	}
 
 	return segment;
@@ -8171,7 +7642,6 @@ static	int	ncr_scatter(ncb_p np, ccb_p cp, Scsi_Cmnd *cmd)
 **==========================================================
 */
 
-#ifndef SCSI_NCR_IOMAPPED
 static int __init ncr_regtest (struct ncb* np)
 {
 	register volatile u32 data;
@@ -8194,21 +7664,18 @@ static int __init ncr_regtest (struct ncb* np)
 	};
 	return (0);
 }
-#endif
 
 static int __init ncr_snooptest (struct ncb* np)
 {
 	u32	ncr_rd, ncr_wr, ncr_bk, host_rd, host_wr, pc;
 	int	i, err=0;
-#ifndef SCSI_NCR_IOMAPPED
 	if (np->reg) {
-            err |= ncr_regtest (np);
-            if (err) return (err);
+		err |= ncr_regtest (np);
+		if (err)
+			return (err);
 	}
-#endif
-	/*
-	**	init
-	*/
+
+	/* init */
 	pc  = NCB_SCRIPTH_PHYS (np, snooptest);
 	host_wr = 1;
 	ncr_wr  = 2;
@@ -8361,7 +7828,7 @@ static u_long ncr_lookup(char * id)
 /*
  *	Select NCR SCSI clock frequency
  */
-static void ncr_selectclock(ncb_p np, u_char scntl3)
+static void ncr_selectclock(struct ncb *np, u_char scntl3)
 {
 	if (np->multiplier < 2) {
 		OUTB(nc_scntl3,	scntl3);
@@ -8390,7 +7857,7 @@ static void ncr_selectclock(ncb_p np, u_char scntl3)
 /*
  *	calculate NCR SCSI clock frequency (in KHz)
  */
-static unsigned __init ncrgetfreq (ncb_p np, int gen)
+static unsigned __init ncrgetfreq (struct ncb *np, int gen)
 {
 	unsigned ms = 0;
 	char count = 0;
@@ -8441,7 +7908,7 @@ static unsigned __init ncrgetfreq (ncb_p np, int gen)
 /*
  *	Get/probe NCR SCSI clock frequency
  */
-static void __init ncr_getclock (ncb_p np, int mult)
+static void __init ncr_getclock (struct ncb *np, int mult)
 {
 	unsigned char scntl3 = INB(nc_scntl3);
 	unsigned char stest1 = INB(nc_stest1);
@@ -8508,12 +7975,12 @@ static void __init ncr_getclock (ncb_p np, int mult)
 **   Linux select queue depths function
 */
 
-int ncr53c8xx_slave_configure(Scsi_Device *device)
+int ncr53c8xx_slave_configure(struct scsi_device *device)
 {
 	struct Scsi_Host *host = device->host;
-	ncb_p np;
-	tcb_p tp;
-	lcb_p lp;
+	struct ncb *np;
+	struct tcb *tp;
+	struct lcb *lp;
 	int numtags, depth_to_use;
 
 	np = ((struct host_data *) host->hostdata)->ncb;
@@ -8565,9 +8032,9 @@ int ncr53c8xx_slave_configure(Scsi_Device *device)
 **   Linux entry point of queuecommand() function
 */
 
-int ncr53c8xx_queue_command (Scsi_Cmnd *cmd, void (* done)(Scsi_Cmnd *))
+int ncr53c8xx_queue_command (struct scsi_cmnd *cmd, void (* done)(struct scsi_cmnd *))
 {
-     ncb_p np = ((struct host_data *) cmd->device->host->hostdata)->ncb;
+     struct ncb *np = ((struct host_data *) cmd->device->host->hostdata)->ncb;
      unsigned long flags;
      int sts;
 
@@ -8577,10 +8044,8 @@ printk("ncr53c8xx_queue_command\n");
 
      cmd->scsi_done     = done;
      cmd->host_scribble = NULL;
-#ifdef SCSI_NCR_DYNAMIC_DMA_MAPPING
      cmd->__data_mapped = 0;
      cmd->__data_mapping = 0;
-#endif
 
      NCR_LOCK_NCB(np, flags);
 
@@ -8618,8 +8083,8 @@ irqreturn_t ncr53c8xx_intr(int irq, void *dev_id, struct pt_regs * regs)
      unsigned long flags;
      struct Scsi_Host *shost = (struct Scsi_Host *)dev_id;
      struct host_data *host_data = (struct host_data *)shost->hostdata;
-     ncb_p np = host_data->ncb;
-     Scsi_Cmnd *done_list;
+     struct ncb *np = host_data->ncb;
+     struct scsi_cmnd *done_list;
 
 #ifdef DEBUG_NCR53C8XX
      printk("ncr53c8xx : interrupt received\n");
@@ -8630,7 +8095,7 @@ irqreturn_t ncr53c8xx_intr(int irq, void *dev_id, struct pt_regs * regs)
      NCR_LOCK_NCB(np, flags);
      ncr_exception(np);
      done_list     = np->done_list;
-     np->done_list = 0;
+     np->done_list = NULL;
      NCR_UNLOCK_NCB(np, flags);
 
      if (DEBUG_FLAGS & DEBUG_TINY) printk ("]\n");
@@ -8649,14 +8114,14 @@ irqreturn_t ncr53c8xx_intr(int irq, void *dev_id, struct pt_regs * regs)
 
 static void ncr53c8xx_timeout(unsigned long npref)
 {
-     ncb_p np = (ncb_p) npref;
+     struct ncb *np = (struct ncb *) npref;
      unsigned long flags;
-     Scsi_Cmnd *done_list;
+     struct scsi_cmnd *done_list;
 
      NCR_LOCK_NCB(np, flags);
-     ncr_timeout((ncb_p) np);
+     ncr_timeout(np);
      done_list     = np->done_list;
-     np->done_list = 0;
+     np->done_list = NULL;
      NCR_UNLOCK_NCB(np, flags);
 
      if (done_list) {
@@ -8670,12 +8135,12 @@ static void ncr53c8xx_timeout(unsigned long npref)
 **   Linux entry point of reset() function
 */
 
-int ncr53c8xx_bus_reset(Scsi_Cmnd *cmd)
+int ncr53c8xx_bus_reset(struct scsi_cmnd *cmd)
 {
-	ncb_p np = ((struct host_data *) cmd->device->host->hostdata)->ncb;
+	struct ncb *np = ((struct host_data *) cmd->device->host->hostdata)->ncb;
 	int sts;
 	unsigned long flags;
-	Scsi_Cmnd *done_list;
+	struct scsi_cmnd *done_list;
 
 	NCR_LOCK_NCB(np, flags);
 
@@ -8689,7 +8154,7 @@ int ncr53c8xx_bus_reset(Scsi_Cmnd *cmd)
 	sts = ncr_reset_bus(np, cmd, 1);
 
 	done_list     = np->done_list;
-	np->done_list = 0;
+	np->done_list = NULL;
 	NCR_UNLOCK_NCB(np, flags);
 
 	ncr_flush_done_cmds(done_list);
@@ -8701,12 +8166,12 @@ int ncr53c8xx_bus_reset(Scsi_Cmnd *cmd)
 **   Linux entry point of abort() function
 */
 
-int ncr53c8xx_abort(Scsi_Cmnd *cmd)
+int ncr53c8xx_abort(struct scsi_cmnd *cmd)
 {
-	ncb_p np = ((struct host_data *) cmd->device->host->hostdata)->ncb;
+	struct ncb *np = ((struct host_data *) cmd->device->host->hostdata)->ncb;
 	int sts;
 	unsigned long flags;
-	Scsi_Cmnd *done_list;
+	struct scsi_cmnd *done_list;
 
 #if defined SCSI_RESET_SYNCHRONOUS && defined SCSI_RESET_ASYNCHRONOUS
 	printk("ncr53c8xx_abort: pid=%lu serial_number=%ld serial_number_at_timeout=%ld\n",
@@ -8730,7 +8195,7 @@ int ncr53c8xx_abort(Scsi_Cmnd *cmd)
 	sts = ncr_abort_command(np, cmd);
 out:
 	done_list     = np->done_list;
-	np->done_list = 0;
+	np->done_list = NULL;
 	NCR_UNLOCK_NCB(np, flags);
 
 	ncr_flush_done_cmds(done_list);
@@ -8739,17 +8204,6 @@ out:
 }
 
 
-int ncr53c8xx_release(struct Scsi_Host *host)
-{
-#ifdef DEBUG_NCR53C8XX
-printk("ncr53c8xx : release\n");
-#endif
-     ncr_detach(((struct host_data *) host->hostdata)->ncb);
-
-     return 1;
-}
-
-
 /*
 **	Scsi command waiting list management.
 **
@@ -8765,55 +8219,55 @@ printk("ncr53c8xx : release\n");
 
 #define next_wcmd host_scribble
 
-static void insert_into_waiting_list(ncb_p np, Scsi_Cmnd *cmd)
+static void insert_into_waiting_list(struct ncb *np, struct scsi_cmnd *cmd)
 {
-	Scsi_Cmnd *wcmd;
+	struct scsi_cmnd *wcmd;
 
 #ifdef DEBUG_WAITING_LIST
 	printk("%s: cmd %lx inserted into waiting list\n", ncr_name(np), (u_long) cmd);
 #endif
-	cmd->next_wcmd = 0;
+	cmd->next_wcmd = NULL;
 	if (!(wcmd = np->waiting_list)) np->waiting_list = cmd;
 	else {
 		while ((wcmd->next_wcmd) != 0)
-			wcmd = (Scsi_Cmnd *) wcmd->next_wcmd;
+			wcmd = (struct scsi_cmnd *) wcmd->next_wcmd;
 		wcmd->next_wcmd = (char *) cmd;
 	}
 }
 
-static Scsi_Cmnd *retrieve_from_waiting_list(int to_remove, ncb_p np, Scsi_Cmnd *cmd)
+static struct scsi_cmnd *retrieve_from_waiting_list(int to_remove, struct ncb *np, struct scsi_cmnd *cmd)
 {
-	Scsi_Cmnd **pcmd = &np->waiting_list;
+	struct scsi_cmnd **pcmd = &np->waiting_list;
 
 	while (*pcmd) {
 		if (cmd == *pcmd) {
 			if (to_remove) {
-				*pcmd = (Scsi_Cmnd *) cmd->next_wcmd;
-				cmd->next_wcmd = 0;
+				*pcmd = (struct scsi_cmnd *) cmd->next_wcmd;
+				cmd->next_wcmd = NULL;
 			}
 #ifdef DEBUG_WAITING_LIST
 	printk("%s: cmd %lx retrieved from waiting list\n", ncr_name(np), (u_long) cmd);
 #endif
 			return cmd;
 		}
-		pcmd = (Scsi_Cmnd **) &(*pcmd)->next_wcmd;
+		pcmd = (struct scsi_cmnd **) &(*pcmd)->next_wcmd;
 	}
-	return 0;
+	return NULL;
 }
 
-static void process_waiting_list(ncb_p np, int sts)
+static void process_waiting_list(struct ncb *np, int sts)
 {
-	Scsi_Cmnd *waiting_list, *wcmd;
+	struct scsi_cmnd *waiting_list, *wcmd;
 
 	waiting_list = np->waiting_list;
-	np->waiting_list = 0;
+	np->waiting_list = NULL;
 
 #ifdef DEBUG_WAITING_LIST
 	if (waiting_list) printk("%s: waiting_list=%lx processing sts=%d\n", ncr_name(np), (u_long) waiting_list, sts);
 #endif
 	while ((wcmd = waiting_list) != 0) {
-		waiting_list = (Scsi_Cmnd *) wcmd->next_wcmd;
-		wcmd->next_wcmd = 0;
+		waiting_list = (struct scsi_cmnd *) wcmd->next_wcmd;
+		wcmd->next_wcmd = NULL;
 		if (sts == DID_OK) {
 #ifdef DEBUG_WAITING_LIST
 	printk("%s: cmd %lx trying to requeue\n", ncr_name(np), (u_long) wcmd);
@@ -8900,7 +8354,7 @@ static int is_keyword(char *ptr, int len, char *verb)
 **	Parse a control command
 */
 
-static int ncr_user_command(ncb_p np, char *buffer, int length)
+static int ncr_user_command(struct ncb *np, char *buffer, int length)
 {
 	char *ptr	= buffer;
 	int len		= length;
@@ -9046,7 +8500,7 @@ printk("ncr_user_command: data=%ld\n", uc->data);
 **	Copy formatted information into the input buffer.
 */
 
-static int ncr_host_info(ncb_p np, char *ptr, off_t offset, int len)
+static int ncr_host_info(struct ncb *np, char *ptr, off_t offset, int len)
 {
 	struct info_str info;
 
@@ -9055,12 +8509,8 @@ static int ncr_host_info(ncb_p np, char *ptr, off_t offset, int len)
 	info.offset	= offset;
 	info.pos	= 0;
 
-	copy_info(&info, "  Chip NCR53C%s, device id 0x%x, "
-			 "revision id 0x%x\n",
-			 np->chip_name, np->device_id,	np->revision_id);
-	copy_info(&info, "  On PCI bus %d, device %d, function %d, IRQ %d\n",
-		np->bus, (np->device_fn & 0xf8) >> 3, np->device_fn & 7,
-		(int) np->irq);
+	copy_info(&info, "  Chip NCR53C720, revision id 0x%x, IRQ %d\n",
+			 np->revision_id, (int) np->irq);
 	copy_info(&info, "  Synchronous period factor %d, "
 			 "max commands per lun %d\n",
 			 (int) np->minsync, MAX_TAGS);
@@ -9085,7 +8535,7 @@ static int ncr53c8xx_proc_info(struct Scsi_Host *host, char *buffer, char **star
 			int length, int func)
 {
 	struct host_data *host_data;
-	ncb_p ncb = 0;
+	struct ncb *ncb = NULL;
 	int retv;
 
 #ifdef DEBUG_PROC_INFO
@@ -9129,7 +8579,7 @@ printk("ncr53c8xx_proc_info: hostno=%d, func=%d\n", host->host_no, func);
 **==========================================================
 */
 #ifdef	MODULE
-char *ncr53c8xx = 0;	/* command line passed by insmod */
+char *ncr53c8xx;	/* command line passed by insmod */
 MODULE_PARM(ncr53c8xx, "s");
 #endif
 
@@ -9152,3 +8602,267 @@ const char *ncr53c8xx_info (struct Scsi_Host *host)
 {
 	return SCSI_NCR_DRIVER_NAME;
 }
+
+
+/*
+ *	Host attach and initialisations.
+ *
+ *	Allocate host data and ncb structure.
+ *	Request IO region and remap MMIO region.
+ *	Do chip initialization.
+ *	If all is OK, install interrupt handling and
+ *	start the timer daemon.
+ */
+struct Scsi_Host * __init ncr_attach(struct scsi_host_template *tpnt,
+					int unit, struct ncr_device *device)
+{
+	struct host_data *host_data;
+	struct ncb *np = NULL;
+	struct Scsi_Host *instance = NULL;
+	u_long flags = 0;
+	int i;
+
+#ifdef SCSI_NCR_PROC_INFO_SUPPORT
+	tpnt->proc_info		= ncr53c8xx_proc_info,
+#endif
+	tpnt->info 		= ncr53c8xx_info;
+	tpnt->queuecommand	= ncr53c8xx_queue_command;
+	tpnt->slave_configure	= ncr53c8xx_slave_configure;
+	tpnt->eh_bus_reset_handler	= ncr53c8xx_bus_reset;
+	tpnt->can_queue		= SCSI_NCR_CAN_QUEUE;
+	tpnt->this_id		= 7;
+	tpnt->sg_tablesize	= SCSI_NCR_SG_TABLESIZE;
+	tpnt->cmd_per_lun	= SCSI_NCR_CMD_PER_LUN;
+	tpnt->use_clustering	= ENABLE_CLUSTERING;
+
+	if (device->differential)
+		driver_setup.diff_support = device->differential;
+
+	printk(KERN_INFO "ncr53c720-%d: rev 0x%x irq %d\n",
+		unit, device->chip.revision_id, device->slot.irq);
+
+	instance = scsi_host_alloc(tpnt, sizeof(*host_data));
+	if (!instance)
+	        goto attach_error;
+	host_data = (struct host_data *) instance->hostdata;
+
+	np = __m_calloc_dma(device->dev, sizeof(struct ncb), "NCB");
+	if (!np)
+		goto attach_error;
+	NCR_INIT_LOCK_NCB(np);
+	np->dev = device->dev;
+	np->p_ncb = vtobus(np);
+	host_data->ncb = np;
+
+	np->ccb = m_calloc_dma(sizeof(struct ccb), "CCB");
+	if (!np->ccb)
+		goto attach_error;
+
+	/* Store input information in the host data structure.  */
+	np->unit	= unit;
+	np->verbose	= driver_setup.verbose;
+	sprintf(np->inst_name, "ncr53c720-%d", np->unit);
+	np->revision_id	= device->chip.revision_id;
+	np->features	= device->chip.features;
+	np->clock_divn	= device->chip.nr_divisor;
+	np->maxoffs	= device->chip.offset_max;
+	np->maxburst	= device->chip.burst_max;
+	np->myaddr	= device->host_id;
+
+	/* Allocate SCRIPTS areas.  */
+	np->script0 = m_calloc_dma(sizeof(struct script), "SCRIPT");
+	if (!np->script0)
+		goto attach_error;
+	np->scripth0 = m_calloc_dma(sizeof(struct scripth), "SCRIPTH");
+	if (!np->scripth0)
+		goto attach_error;
+
+	init_timer(&np->timer);
+	np->timer.data     = (unsigned long) np;
+	np->timer.function = ncr53c8xx_timeout;
+
+	/* Try to map the controller chip to virtual and physical memory. */
+
+	np->paddr	= device->slot.base;
+	np->paddr2	= (np->features & FE_RAM) ? device->slot.base_2 : 0;
+
+	if (device->slot.base_v)
+		np->vaddr = device->slot.base_v;
+	else
+		np->vaddr = (unsigned long)ioremap(device->slot.base_c, 128);
+
+	if (!np->vaddr) {
+		printk(KERN_ERR
+			"%s: can't map memory mapped IO region\n",ncr_name(np));
+		goto attach_error;
+	} else {
+		if (bootverbose > 1)
+			printk(KERN_INFO
+				"%s: using memory mapped IO at virtual address 0x%lx\n", ncr_name(np), (u_long) np->vaddr);
+	}
+
+	/* Make the controller's registers available.  Now the INB INW INL
+	 * OUTB OUTW OUTL macros can be used safely.
+	 */
+
+	np->reg = (struct ncr_reg*) np->vaddr;
+
+	/* Do chip dependent initialization.  */
+	ncr_prepare_setting(np);
+
+	if (np->paddr2 && sizeof(struct script) > 4096) {
+		np->paddr2 = 0;
+		printk(KERN_WARNING "%s: script too large, NOT using on chip RAM.\n",
+			ncr_name(np));
+	}
+
+	/* Fill Linux host instance structure */
+	instance->max_channel	= 0;
+	instance->this_id       = np->myaddr;
+	instance->max_id	= np->maxwide ? 16 : 8;
+	instance->max_lun	= SCSI_NCR_MAX_LUN;
+	instance->base		= (unsigned long) np->reg;
+	instance->irq		= device->slot.irq;
+	instance->unique_id	= device->slot.base;
+	instance->dma_channel	= 0;
+	instance->cmd_per_lun	= MAX_TAGS;
+	instance->can_queue	= (MAX_START-4);
+	scsi_set_device(instance, device->dev);
+
+#ifdef SCSI_NCR_INTEGRITY_CHECKING
+	np->check_integrity	  = 0;
+	instance->check_integrity = 0;
+
+#ifdef SCSI_NCR_ENABLE_INTEGRITY_CHECK
+	if ( !(driver_setup.bus_check & 0x04) ) {
+		np->check_integrity	  = 1;
+		instance->check_integrity = 1;
+	}
+#endif
+#endif
+	/* Patch script to physical addresses */
+	ncr_script_fill(&script0, &scripth0);
+
+	np->scripth	= np->scripth0;
+	np->p_scripth	= vtobus(np->scripth);
+	np->p_script	= (np->paddr2) ?  np->paddr2 : vtobus(np->script0);
+
+	ncr_script_copy_and_bind(np, (ncrcmd *) &script0,
+			(ncrcmd *) np->script0, sizeof(struct script));
+	ncr_script_copy_and_bind(np, (ncrcmd *) &scripth0,
+			(ncrcmd *) np->scripth0, sizeof(struct scripth));
+	np->ccb->p_ccb	= vtobus (np->ccb);
+
+	/* Patch the script for LED support.  */
+
+	if (np->features & FE_LED0) {
+		np->script0->idle[0]  =
+				cpu_to_scr(SCR_REG_REG(gpreg, SCR_OR,  0x01));
+		np->script0->reselected[0] =
+				cpu_to_scr(SCR_REG_REG(gpreg, SCR_AND, 0xfe));
+		np->script0->start[0] =
+				cpu_to_scr(SCR_REG_REG(gpreg, SCR_AND, 0xfe));
+	}
+
+	/*
+	 * Look for the target control block of this nexus.
+	 * For i = 0 to 3
+	 *   JUMP ^ IFTRUE (MASK (i, 3)), @(next_lcb)
+	 */
+	for (i = 0 ; i < 4 ; i++) {
+		np->jump_tcb[i].l_cmd   =
+				cpu_to_scr((SCR_JUMP ^ IFTRUE (MASK (i, 3))));
+		np->jump_tcb[i].l_paddr =
+				cpu_to_scr(NCB_SCRIPTH_PHYS (np, bad_target));
+	}
+
+	ncr_chip_reset(np, 100);
+
+	/* Now check the cache handling of the chipset.  */
+
+	if (ncr_snooptest(np)) {
+		printk(KERN_ERR "CACHE INCORRECTLY CONFIGURED.\n");
+		goto attach_error;
+	};
+
+	/* Install the interrupt handler.  */
+	np->irq = device->slot.irq;
+
+	/* Initialize the fixed part of the default ccb.  */
+	ncr_init_ccb(np, np->ccb);
+
+	/*
+	 * After SCSI devices have been opened, we cannot reset the bus
+	 * safely, so we do it here.  Interrupt handler does the real work.
+	 * Process the reset exception if interrupts are not enabled yet.
+	 * Then enable disconnects.
+	 */
+	NCR_LOCK_NCB(np, flags);
+	if (ncr_reset_scsi_bus(np, 0, driver_setup.settle_delay) != 0) {
+		printk(KERN_ERR "%s: FATAL ERROR: CHECK SCSI BUS - CABLES, TERMINATION, DEVICE POWER etc.!\n", ncr_name(np));
+
+		NCR_UNLOCK_NCB(np, flags);
+		goto attach_error;
+	}
+	ncr_exception(np);
+
+	np->disc = 1;
+
+	/*
+	 * The middle-level SCSI driver does not wait for devices to settle.
+	 * Wait synchronously if more than 2 seconds.
+	 */
+	if (driver_setup.settle_delay > 2) {
+		printk(KERN_INFO "%s: waiting %d seconds for scsi devices to settle...\n",
+			ncr_name(np), driver_setup.settle_delay);
+		MDELAY (1000 * driver_setup.settle_delay);
+	}
+
+	/* start the timeout daemon */
+	np->lasttime=0;
+	ncr_timeout (np);
+
+	/* use SIMPLE TAG messages by default */
+#ifdef SCSI_NCR_ALWAYS_SIMPLE_TAG
+	np->order = M_SIMPLE_TAG;
+#endif
+
+	NCR_UNLOCK_NCB(np, flags);
+
+	return instance;
+
+ attach_error:
+	if (!instance)
+		return NULL;
+	printk(KERN_INFO "%s: detaching...\n", ncr_name(np));
+	if (!np)
+		goto unregister;
+	if (np->scripth0)
+		m_free_dma(np->scripth0, sizeof(struct scripth), "SCRIPTH");
+	if (np->script0)
+		m_free_dma(np->script0, sizeof(struct script), "SCRIPT");
+	if (np->ccb)
+		m_free_dma(np->ccb, sizeof(struct ccb), "CCB");
+	m_free_dma(np, sizeof(struct ncb), "NCB");
+	host_data->ncb = NULL;
+
+ unregister:
+	scsi_host_put(instance);
+
+	return NULL;
+}
+
+
+int ncr53c8xx_release(struct Scsi_Host *host)
+{
+	struct host_data *host_data;
+#ifdef DEBUG_NCR53C8XX
+	printk("ncr53c8xx: release\n");
+#endif
+	if (!host)
+		return 1;
+	host_data = (struct host_data *)host->hostdata;
+	if (host_data && host_data->ncb)
+		ncr_detach(host_data->ncb);
+	return 1;
+}
diff --git a/drivers/scsi/ncr53c8xx.h b/drivers/scsi/ncr53c8xx.h
index b41c6d9df..adbb47c92 100644
--- a/drivers/scsi/ncr53c8xx.h
+++ b/drivers/scsi/ncr53c8xx.h
@@ -42,10 +42,24 @@
 #ifndef NCR53C8XX_H
 #define NCR53C8XX_H
 
+#include <scsi/scsi_host.h>
+
 typedef	u_long		vm_offset_t;
 
 #include "sym53c8xx_defs.h"
 
+/*
+	Build a scatter/gather entry.
+	see sym53c8xx_2/sym_hipd.h for more detailed sym_build_sge()
+	implementation ;)
+ */
+
+#define ncr_build_sge(np, data, badd, len)	\
+do {						\
+	(data)->addr = cpu_to_scr(badd);	\
+	(data)->size = cpu_to_scr(len);		\
+} while (0)
+
 /*==========================================================
 **
 **	Structures used by the detection routine to transmit 
@@ -53,39 +67,17 @@ typedef	u_long		vm_offset_t;
 **
 **==========================================================
 */
-typedef struct {
-	int	bus;
-	u_char	device_fn;
+struct ncr_slot {
 	u_long	base;
 	u_long	base_2;
-	u_long	io_port;
 	u_long	base_c;
 	u_long	base_2_c;
 	u_long	base_v;
 	u_long	base_2_v;
 	int	irq;
 /* port and reg fields to use INB, OUTB macros */
-	u_long	base_io;
 	volatile struct ncr_reg	*reg;
-} ncr_slot;
-
-/*==========================================================
-**
-**	Structure used to store the NVRAM content.
-**
-**==========================================================
-*/
-typedef struct {
-	int type;
-#define	SCSI_NCR_SYMBIOS_NVRAM	(1)
-#define	SCSI_NCR_TEKRAM_NVRAM	(2)
-#ifdef	SCSI_NCR_NVRAM_SUPPORT
-	union {
-		Symbios_nvram Symbios;
-		Tekram_nvram Tekram;
-	} data;
-#endif
-} ncr_nvram;
+};
 
 /*==========================================================
 **
@@ -96,18 +88,13 @@ typedef struct {
 */
 struct ncr_device {
 	struct device  *dev;
-	ncr_slot  slot;
-	ncr_chip  chip;
-	ncr_nvram *nvram;
+	struct ncr_slot  slot;
+	struct ncr_chip  chip;
 	u_char host_id;
-#ifdef	SCSI_NCR_PQS_PDS_SUPPORT
-	u_char pqs_pds;
-#endif
-	__u8 differential;
-	int attach_done;
+	u8 differential;
 };
 
-extern struct Scsi_Host *ncr_attach (Scsi_Host_Template *tpnt, int unit, struct ncr_device *device);
+extern struct Scsi_Host *ncr_attach(struct scsi_host_template *tpnt, int unit, struct ncr_device *device);
 extern int ncr53c8xx_release(struct Scsi_Host *host);
 irqreturn_t ncr53c8xx_intr(int irq, void *dev_id, struct pt_regs * regs);
 
diff --git a/drivers/scsi/nsp32.c b/drivers/scsi/nsp32.c
index 13d5875a2..b43feb93c 100644
--- a/drivers/scsi/nsp32.c
+++ b/drivers/scsi/nsp32.c
@@ -44,7 +44,7 @@
 #include <asm/io.h>
 
 #include "scsi.h"
-#include "hosts.h"
+#include <scsi/scsi_host.h>
 #include <scsi/scsi_ioctl.h>
 #include <scsi/scsi.h>
 
@@ -1604,7 +1604,7 @@ static int nsp32_proc_info(
 	thislength = pos - (buffer + offset);
 
 	if(thislength < 0) {
-		*start = 0;
+		*start = NULL;
                 return 0;
         }
 
@@ -3342,6 +3342,48 @@ static int nsp32_prom_read(nsp32_hw_data *data, int romaddr)
 	return val;
 }
 
+static inline void nsp32_prom_set(nsp32_hw_data *data, int bit, int val)
+{
+	int base = data->BaseAddress;
+	int tmp;
+
+	tmp = nsp32_index_read1(base, SERIAL_ROM_CTL);
+
+	if (val == 0) {
+		tmp &= ~bit;
+	} else {
+		tmp |=  bit;
+	}
+
+	nsp32_index_write1(base, SERIAL_ROM_CTL, tmp);
+
+	udelay(10);
+}
+
+static inline int nsp32_prom_get(nsp32_hw_data *data, int bit)
+{
+	int base = data->BaseAddress;
+	int tmp, ret;
+
+	if (bit != SDA) {
+		nsp32_msg(KERN_ERR, "return value is not appropriate");
+		return 0;
+	}
+
+
+	tmp = nsp32_index_read1(base, SERIAL_ROM_CTL) & bit;
+
+	if (tmp == 0) {
+		ret = 0;
+	} else {
+		ret = 1;
+	}
+
+	udelay(10);
+
+	return ret;
+}
+
 static void nsp32_prom_start (nsp32_hw_data *data)
 {
 	/* start condition */
@@ -3387,48 +3429,6 @@ static int nsp32_prom_read_bit(nsp32_hw_data *data)
 	return val;
 }
 
-static inline void nsp32_prom_set(nsp32_hw_data *data, int bit, int val)
-{
-	int base = data->BaseAddress;
-	int tmp;
-
-	tmp = nsp32_index_read1(base, SERIAL_ROM_CTL);
-
-	if (val == 0) {
-		tmp &= ~bit;
-	} else {
-		tmp |=  bit;
-	}
-
-	nsp32_index_write1(base, SERIAL_ROM_CTL, tmp);
-
-	udelay(10);
-}
-
-static inline int nsp32_prom_get(nsp32_hw_data *data, int bit)
-{
-	int base = data->BaseAddress;
-	int tmp, ret;
-
-	if (bit != SDA) {
-		nsp32_msg(KERN_ERR, "return value is not appropriate");
-		return 0;
-	}
-
-
-	tmp = nsp32_index_read1(base, SERIAL_ROM_CTL) & bit;
-
-	if (tmp == 0) {
-		ret = 0;
-	} else {
-		ret = 1;
-	}
-
-	udelay(10);
-
-	return ret;
-}
-
 
 /**************************************************************************
  * Power Management
diff --git a/drivers/scsi/oktagon_esp.c b/drivers/scsi/oktagon_esp.c
index 10c63ad28..cd9e2c66a 100644
--- a/drivers/scsi/oktagon_esp.c
+++ b/drivers/scsi/oktagon_esp.c
@@ -29,7 +29,7 @@
 
 
 #include "scsi.h"
-#include "hosts.h"
+#include <scsi/scsi_host.h>
 #include "NCR53C9x.h"
 
 #include <linux/zorro.h>
diff --git a/drivers/scsi/osst.c b/drivers/scsi/osst.c
index b26d95ead..fb74a2f64 100644
--- a/drivers/scsi/osst.c
+++ b/drivers/scsi/osst.c
@@ -61,7 +61,7 @@ const char * osst_version = "0.99.1";
 #define OSST_DEB_MSG  KERN_NOTICE
 
 #include "scsi.h"
-#include "hosts.h"
+#include <scsi/scsi_host.h>
 #include <scsi/scsi_driver.h>
 #include <scsi/scsi_ioctl.h>
 
@@ -3185,12 +3185,6 @@ static ssize_t osst_write(struct file * filp, const char __user * buf, size_t co
 		goto out;
 	}
 	
-	if (ppos != &filp->f_pos) {
-	 	/* "A request was outside the capabilities of the device." */
-		retval = (-ENXIO);
-		goto out;
-	}
-
 	if (STp->ready != ST_READY) {
 		if (STp->ready == ST_NO_TAPE)
 			retval = (-ENOMEDIUM);
@@ -3512,12 +3506,6 @@ static ssize_t osst_read(struct file * filp, char __user * buf, size_t count, lo
 		goto out;
 	}
 	
-	if (ppos != &filp->f_pos) {
-		/* "A request was outside the capabilities of the device." */
-		retval = (-ENXIO);
-		goto out;
-	}
-
 	if (STp->ready != ST_READY) {
 		if (STp->ready == ST_NO_TAPE)
 			retval = (-ENOMEDIUM);
@@ -4254,6 +4242,7 @@ static int os_scsi_tape_open(struct inode * inode, struct file * filp)
 	int            dev  = TAPE_NR(inode);
 	int            mode = TAPE_MODE(inode);
 
+	nonseekable_open(inode, filp);
 	write_lock(&os_scsi_tapes_lock);
 	if (dev >= osst_max_dev || os_scsi_tapes == NULL ||
 	    (STp = os_scsi_tapes[dev]) == NULL || !STp->device) {
diff --git a/drivers/scsi/pas16.c b/drivers/scsi/pas16.c
index fe5b7af58..1c9788e2d 100644
--- a/drivers/scsi/pas16.c
+++ b/drivers/scsi/pas16.c
@@ -125,7 +125,7 @@
 #include <linux/init.h>
 
 #include "scsi.h"
-#include "hosts.h"
+#include <scsi/scsi_host.h>
 #include "pas16.h"
 #define AUTOPROBE_IRQ
 #include "NCR5380.h"
diff --git a/drivers/scsi/pci2000.c b/drivers/scsi/pci2000.c
index 14006bc3d..60ce1cce9 100644
--- a/drivers/scsi/pci2000.c
+++ b/drivers/scsi/pci2000.c
@@ -54,7 +54,7 @@
 #include <asm/io.h>
 
 #include "scsi.h"
-#include "hosts.h"
+#include <scsi/scsi_host.h>
 #include "pci2000.h"
 #include "psi_roy.h"
 
diff --git a/drivers/scsi/pci2220i.c b/drivers/scsi/pci2220i.c
index 2ea7c705f..e395e4203 100644
--- a/drivers/scsi/pci2220i.c
+++ b/drivers/scsi/pci2220i.c
@@ -59,7 +59,7 @@
 #include <asm/io.h>
 
 #include "scsi.h"
-#include "hosts.h"
+#include <scsi/scsi_host.h>
 #include "pci2220i.h"
 #include "psi_dale.h"
 
diff --git a/drivers/scsi/pcmcia/aha152x_stub.c b/drivers/scsi/pcmcia/aha152x_stub.c
index f1d2af999..42cdba92b 100644
--- a/drivers/scsi/pcmcia/aha152x_stub.c
+++ b/drivers/scsi/pcmcia/aha152x_stub.c
@@ -47,7 +47,7 @@
 #include <scsi/scsi_ioctl.h>
 
 #include "scsi.h"
-#include "hosts.h"
+#include <scsi/scsi_host.h>
 #include "aha152x.h"
 
 #include <pcmcia/version.h>
diff --git a/drivers/scsi/pcmcia/fdomain_stub.c b/drivers/scsi/pcmcia/fdomain_stub.c
index 344d2b5a2..59aca6b42 100644
--- a/drivers/scsi/pcmcia/fdomain_stub.c
+++ b/drivers/scsi/pcmcia/fdomain_stub.c
@@ -44,7 +44,8 @@
 #include <scsi/scsi_ioctl.h>
 
 #include "scsi.h"
-#include "hosts.h"
+#include <scsi/scsi_host.h>
+#include "fdomain.h"
 
 #include <pcmcia/version.h>
 #include <pcmcia/cs_types.h>
@@ -84,10 +85,6 @@ typedef struct scsi_info_t {
     struct Scsi_Host	*host;
 } scsi_info_t;
 
-extern Scsi_Host_Template fdomain_driver_template;
-extern void fdomain_setup(char *str, int *ints);
-extern struct Scsi_Host *__fdomain_16x0_detect( Scsi_Host_Template *tpnt );
-extern int fdomain_16x0_bus_reset(Scsi_Cmnd *SCpnt);
 
 static void fdomain_release(dev_link_t *link);
 static int fdomain_event(event_t event, int priority,
@@ -189,7 +186,7 @@ static void fdomain_config(dev_link_t *link)
     scsi_info_t *info = link->priv;
     tuple_t tuple;
     cisparse_t parse;
-    int i, last_ret, last_fn, ints[3];
+    int i, last_ret, last_fn;
     u_char tuple_data[64];
     char str[16];
     struct Scsi_Host *host;
@@ -229,11 +226,8 @@ static void fdomain_config(dev_link_t *link)
     release_region(link->io.BasePort1, link->io.NumPorts1);
 
     /* Set configuration options for the fdomain driver */
-    ints[0] = 2;
-    ints[1] = link->io.BasePort1;
-    ints[2] = link->irq.AssignedIRQ;
     sprintf(str, "%d,%d", link->io.BasePort1, link->irq.AssignedIRQ);
-    fdomain_setup(str, ints);
+    fdomain_setup(str);
     
     host = __fdomain_16x0_detect(&fdomain_driver_template);
     if (!host) {
diff --git a/drivers/scsi/pcmcia/nsp_cs.c b/drivers/scsi/pcmcia/nsp_cs.c
index f38faabf9..363d79399 100644
--- a/drivers/scsi/pcmcia/nsp_cs.c
+++ b/drivers/scsi/pcmcia/nsp_cs.c
@@ -46,7 +46,7 @@
 #include <asm/irq.h>
 
 #include <../drivers/scsi/scsi.h>
-#include <../drivers/scsi/hosts.h>
+#include <scsi/scsi_host.h>
 
 #include <scsi/scsi.h>
 #include <scsi/scsi_ioctl.h>
@@ -1936,10 +1936,10 @@ static void nsp_cs_config(dev_link_t *link)
 	nsp_dbg(NSP_DEBUG_INIT, "host=0x%p", host);
 
 	for (dev = host->host_queue; dev != NULL; dev = dev->next) {
-		unsigned long arg[2], id;
-		kernel_scsi_ioctl(dev, SCSI_IOCTL_GET_IDLUN, arg);
-		id = (arg[0] & 0x0f) + ((arg[0] >> 4) & 0xf0) +
-			((arg[0] >> 8) & 0xf00) + ((arg[0] >> 12) & 0xf000);
+		unsigned long id;
+		id = (dev->id & 0x0f) + ((dev->lun & 0x0f) << 4) +
+			((dev->channel & 0x0f) << 8) +
+			((dev->host->host_no & 0x0f) << 12);
 		node = &info->node[info->ndev];
 		node->minor = 0;
 		switch (dev->type) {
diff --git a/drivers/scsi/pcmcia/qlogic_stub.c b/drivers/scsi/pcmcia/qlogic_stub.c
index 2063882b7..9ea9a108b 100644
--- a/drivers/scsi/pcmcia/qlogic_stub.c
+++ b/drivers/scsi/pcmcia/qlogic_stub.c
@@ -46,7 +46,7 @@
 #include <linux/interrupt.h>
 
 #include "scsi.h"
-#include "hosts.h"
+#include <scsi/scsi_host.h>
 #include "../qlogicfas408.h"
 
 #include <pcmcia/version.h>
diff --git a/drivers/scsi/pluto.c b/drivers/scsi/pluto.c
index f7677c977..7bb0a2e56 100644
--- a/drivers/scsi/pluto.c
+++ b/drivers/scsi/pluto.c
@@ -21,7 +21,7 @@
 #include <asm/irq.h>
 
 #include "scsi.h"
-#include "hosts.h"
+#include <scsi/scsi_host.h>
 #include "../fc4/fcp_impl.h"
 #include "pluto.h"
 
diff --git a/drivers/scsi/ppa.c b/drivers/scsi/ppa.c
index 390bbbd39..6733e223a 100644
--- a/drivers/scsi/ppa.c
+++ b/drivers/scsi/ppa.c
@@ -682,7 +682,7 @@ static void ppa_interrupt(void *data)
 
 	ppa_pb_dismiss(dev);
 
-	dev->cur_cmd = 0;
+	dev->cur_cmd = NULL;
 
 	cmd->scsi_done(cmd);
 }
diff --git a/drivers/scsi/ppa.h b/drivers/scsi/ppa.h
index afb614fa8..f6e1a1574 100644
--- a/drivers/scsi/ppa.h
+++ b/drivers/scsi/ppa.h
@@ -86,7 +86,7 @@
 #include  <linux/interrupt.h>
 
 #include  <asm/io.h>
-#include  "hosts.h"
+#include  <scsi/scsi_host.h>
 /* batteries not included :-) */
 
 /*
diff --git a/drivers/scsi/psi240i.c b/drivers/scsi/psi240i.c
index 6bb14acbf..aa505c1ba 100644
--- a/drivers/scsi/psi240i.c
+++ b/drivers/scsi/psi240i.c
@@ -41,7 +41,7 @@
 #include <asm/system.h>
 #include <asm/io.h>
 #include "scsi.h"
-#include "hosts.h"
+#include <scsi/scsi_host.h>
 
 #include "psi240i.h"
 #include "psi_chip.h"
diff --git a/drivers/scsi/qla1280.c b/drivers/scsi/qla1280.c
index dd482a9e6..917a208d1 100644
--- a/drivers/scsi/qla1280.c
+++ b/drivers/scsi/qla1280.c
@@ -357,7 +357,7 @@
 #else
 #include <linux/blk.h>
 #include "scsi.h"
-#include "hosts.h"
+#include <scsi/scsi_host.h>
 #include "sd.h"
 #endif
 
@@ -3119,6 +3119,7 @@ qla1280_marker(struct scsi_qla_host *ha, int bus, int id, int lun, u8 type)
  * Returns:
  *      0 = success, was able to issue command.
  */
+#ifdef QLA_64BIT_PTR
 static int
 qla1280_64bit_start_scsi(struct scsi_qla_host *ha, struct srb * sp)
 {
@@ -3381,9 +3382,8 @@ qla1280_64bit_start_scsi(struct scsi_qla_host *ha, struct srb * sp)
 
 	return status;
 }
+#else /* !QLA_64BIT_PTR */
 
-
-#ifndef QLA_64BIT_PTR
 /*
  * qla1280_32bit_start_scsi
  *      The start SCSI is responsible for building request packets on
@@ -3667,7 +3667,7 @@ static request_t *
 qla1280_req_pkt(struct scsi_qla_host *ha)
 {
 	struct device_reg *reg = ha->iobase;
-	request_t *pkt = 0;
+	request_t *pkt = NULL;
 	int cnt;
 	uint32_t timer;
 
@@ -3774,7 +3774,7 @@ qla1280_isr(struct scsi_qla_host *ha, struct list_head *done_q)
 {
 	struct device_reg *reg = ha->iobase;
 	struct response *pkt;
-	struct srb *sp = 0;
+	struct srb *sp = NULL;
 	uint16_t mailbox[MAILBOX_REGISTER_COUNT];
 	uint16_t *wptr;
 	uint32_t index;
@@ -3832,11 +3832,11 @@ qla1280_isr(struct scsi_qla_host *ha, struct list_head *done_q)
 				if (index < MAX_OUTSTANDING_COMMANDS)
 					sp = ha->outstanding_cmds[index];
 				else
-					sp = 0;
+					sp = NULL;
 
 				if (sp) {
 					/* Free outstanding command slot. */
-					ha->outstanding_cmds[index] = 0;
+					ha->outstanding_cmds[index] = NULL;
 
 					/* Save ISP completion status */
 					CMD_RESULT(sp->cmd) = 0;
@@ -4095,7 +4095,7 @@ qla1280_status_entry(struct scsi_qla_host *ha, struct response *pkt,
 	}
 
 	/* Free outstanding command slot. */
-	ha->outstanding_cmds[handle] = 0;
+	ha->outstanding_cmds[handle] = NULL;
 
 	cmd = sp->cmd;
 
@@ -4188,11 +4188,11 @@ qla1280_error_entry(struct scsi_qla_host *ha, struct response *pkt,
 	if (handle < MAX_OUTSTANDING_COMMANDS)
 		sp = ha->outstanding_cmds[handle];
 	else
-		sp = 0;
+		sp = NULL;
 
 	if (sp) {
 		/* Free outstanding command slot. */
-		ha->outstanding_cmds[handle] = 0;
+		ha->outstanding_cmds[handle] = NULL;
 
 		/* Bad payload or header */
 		if (pkt->entry_status & (BIT_3 + BIT_2)) {
diff --git a/drivers/scsi/qla2xxx/Makefile b/drivers/scsi/qla2xxx/Makefile
index 8736ceb36..df0354fee 100644
--- a/drivers/scsi/qla2xxx/Makefile
+++ b/drivers/scsi/qla2xxx/Makefile
@@ -1,4 +1,4 @@
-EXTRA_CFLAGS += -Idrivers/scsi -DUNIQUE_FW_NAME
+EXTRA_CFLAGS += -DUNIQUE_FW_NAME
 
 qla2xxx-y := qla_os.o qla_init.o qla_mbx.o qla_iocb.o qla_isr.o qla_gs.o \
 		qla_dbg.o qla_sup.o qla_rscn.o
diff --git a/drivers/scsi/qla2xxx/ql2100.c b/drivers/scsi/qla2xxx/ql2100.c
index 7aec9c001..77de0f4f9 100644
--- a/drivers/scsi/qla2xxx/ql2100.c
+++ b/drivers/scsi/qla2xxx/ql2100.c
@@ -10,7 +10,6 @@
 #include <linux/module.h>
 #include <linux/pci.h>
 
-#include "qla_os.h"
 #include "qla_def.h"
 
 static char qla_driver_name[] = "qla2100";
diff --git a/drivers/scsi/qla2xxx/ql2200.c b/drivers/scsi/qla2xxx/ql2200.c
index 662b5d223..c254daaa0 100644
--- a/drivers/scsi/qla2xxx/ql2200.c
+++ b/drivers/scsi/qla2xxx/ql2200.c
@@ -10,7 +10,6 @@
 #include <linux/module.h>
 #include <linux/pci.h>
 
-#include "qla_os.h"
 #include "qla_def.h"
 
 static char qla_driver_name[] = "qla2200";
diff --git a/drivers/scsi/qla2xxx/ql2300.c b/drivers/scsi/qla2xxx/ql2300.c
index 38edfc6d7..177aa3617 100644
--- a/drivers/scsi/qla2xxx/ql2300.c
+++ b/drivers/scsi/qla2xxx/ql2300.c
@@ -10,7 +10,6 @@
 #include <linux/module.h>
 #include <linux/pci.h>
 
-#include "qla_os.h"
 #include "qla_def.h"
 
 static char qla_driver_name[] = "qla2300";
diff --git a/drivers/scsi/qla2xxx/ql2300_fw.c b/drivers/scsi/qla2xxx/ql2300_fw.c
index 1b6fe1871..9563c67cf 100644
--- a/drivers/scsi/qla2xxx/ql2300_fw.c
+++ b/drivers/scsi/qla2xxx/ql2300_fw.c
@@ -18,7 +18,7 @@
  *************************************************************************/
 
 /*
- *	Firmware Version 3.02.28 (13:56 Apr 03, 2004)
+ *	Firmware Version 3.02.30 (07:51 Jun 16, 2004)
  */
 
 #ifdef UNIQUE_FW_NAME
@@ -28,15 +28,15 @@ unsigned short risc_code_version = 3*1024+2;
 #endif
 
 #ifdef UNIQUE_FW_NAME
-unsigned char fw2300ipx_version_str[] = {3, 2,28};
+unsigned char fw2300ipx_version_str[] = {3, 2,30};
 #else
-unsigned char firmware_version[] = {3, 2,28};
+unsigned char firmware_version[] = {3, 2,30};
 #endif
 
 #ifdef UNIQUE_FW_NAME
-#define fw2300ipx_VERSION_STRING "3.02.28"
+#define fw2300ipx_VERSION_STRING "3.02.30"
 #else
-#define FW_VERSION_STRING "3.02.28"
+#define FW_VERSION_STRING "3.02.30"
 #endif
 
 #ifdef UNIQUE_FW_NAME
@@ -50,12 +50,12 @@ unsigned short fw2300ipx_code01[] = {
 #else
 unsigned short risc_code01[] = { 
 #endif
-	0x0470, 0x0000, 0x0000, 0xe9c7, 0x0000, 0x0003, 0x0002, 0x001c,
+	0x0470, 0x0000, 0x0000, 0xe9e8, 0x0000, 0x0003, 0x0002, 0x001e,
 	0x0137, 0x2043, 0x4f50, 0x5952, 0x4947, 0x4854, 0x2032, 0x3030,
 	0x3120, 0x514c, 0x4f47, 0x4943, 0x2043, 0x4f52, 0x504f, 0x5241,
 	0x5449, 0x4f4e, 0x2049, 0x5350, 0x3233, 0x3030, 0x2046, 0x6972,
 	0x6d77, 0x6172, 0x6520, 0x2056, 0x6572, 0x7369, 0x6f6e, 0x2030,
-	0x332e, 0x3032, 0x2e32, 0x3820, 0x2020, 0x2020, 0x2400, 0x20a9,
+	0x332e, 0x3032, 0x2e33, 0x3020, 0x2020, 0x2020, 0x2400, 0x20a9,
 	0x000f, 0x2001, 0x0000, 0x400f, 0x2091, 0x2200, 0x20a9, 0x000f,
 	0x2001, 0x0000, 0x400f, 0x2091, 0x2400, 0x20a9, 0x000f, 0x2001,
 	0x0000, 0x400f, 0x2091, 0x2600, 0x20a9, 0x000f, 0x2001, 0x0000,
@@ -64,175 +64,175 @@ unsigned short risc_code01[] = {
 	0x2c00, 0x20a9, 0x000f, 0x2001, 0x0000, 0x400f, 0x2091, 0x2e00,
 	0x20a9, 0x000f, 0x2001, 0x0000, 0x400f, 0x2091, 0x2000, 0x2001,
 	0x0000, 0x20c1, 0x0004, 0x20c9, 0x1bff, 0x2059, 0x0000, 0x2b78,
-	0x7883, 0x0004, 0x2089, 0x2d29, 0x2051, 0x1800, 0x2a70, 0x20e1,
+	0x7883, 0x0004, 0x2089, 0x2d2b, 0x2051, 0x1800, 0x2a70, 0x20e1,
 	0x0001, 0x20e9, 0x0001, 0x2009, 0x0000, 0x080c, 0x0e51, 0x2029,
 	0x4d00, 0x2031, 0xffff, 0x2039, 0x4cd0, 0x2021, 0x0200, 0x20e9,
 	0x0001, 0x20a1, 0x0000, 0x20a9, 0x0800, 0x900e, 0x4104, 0x20e9,
 	0x0001, 0x20a1, 0x1000, 0x900e, 0x2001, 0x0cc0, 0x9084, 0x0fff,
 	0x20a8, 0x4104, 0x2001, 0x0000, 0x9086, 0x0000, 0x0120, 0x21a8,
 	0x4104, 0x8001, 0x1de0, 0x756e, 0x7672, 0x776a, 0x7476, 0x747a,
-	0x00e6, 0x2071, 0x1ac8, 0x2472, 0x00ee, 0x20a1, 0x1cd0, 0x7170,
+	0x00e6, 0x2071, 0x1ac7, 0x2472, 0x00ee, 0x20a1, 0x1cd0, 0x7170,
 	0x810d, 0x810d, 0x810d, 0x810d, 0x918c, 0x000f, 0x2001, 0x0001,
 	0x9112, 0x900e, 0x21a8, 0x4104, 0x8211, 0x1de0, 0x7170, 0x3400,
 	0x8001, 0x9102, 0x0120, 0x0218, 0x20a8, 0x900e, 0x4104, 0x2009,
 	0x1800, 0x810d, 0x810d, 0x810d, 0x810d, 0x810d, 0x918c, 0x001f,
 	0x2001, 0x0001, 0x9112, 0x20e9, 0x0001, 0x20a1, 0x0800, 0x900e,
 	0x20a9, 0x0800, 0x4104, 0x8211, 0x1dd8, 0x080c, 0x0f17, 0x080c,
-	0x6028, 0x080c, 0xadf7, 0x080c, 0x10ce, 0x080c, 0x12ed, 0x080c,
-	0x1ba4, 0x080c, 0x0d69, 0x080c, 0x1053, 0x080c, 0x3425, 0x080c,
-	0x76b8, 0x080c, 0x6996, 0x080c, 0x86f6, 0x080c, 0x842a, 0x080c,
-	0x2478, 0x080c, 0x8f98, 0x080c, 0x7d82, 0x080c, 0x22b1, 0x080c,
-	0x23e5, 0x080c, 0x246d, 0x2091, 0x3009, 0x7883, 0x0000, 0x1004,
+	0x6031, 0x080c, 0xae07, 0x080c, 0x10ce, 0x080c, 0x12ed, 0x080c,
+	0x1ba6, 0x080c, 0x0d69, 0x080c, 0x1053, 0x080c, 0x3427, 0x080c,
+	0x76a1, 0x080c, 0x699f, 0x080c, 0x86df, 0x080c, 0x8413, 0x080c,
+	0x247a, 0x080c, 0x8f81, 0x080c, 0x7d6b, 0x080c, 0x22b3, 0x080c,
+	0x23e7, 0x080c, 0x246f, 0x2091, 0x3009, 0x7883, 0x0000, 0x1004,
 	0x091f, 0x7880, 0x9086, 0x0002, 0x1190, 0x7883, 0x4000, 0x7837,
 	0x4000, 0x7833, 0x0010, 0x0e04, 0x0913, 0x2091, 0x5000, 0x2091,
 	0x4080, 0x2001, 0x0089, 0x2004, 0xd084, 0x190c, 0x119b, 0x2071,
 	0x1800, 0x7003, 0x0000, 0x2071, 0x1800, 0x7000, 0x908e, 0x0003,
-	0x1178, 0x080c, 0x4bc9, 0x080c, 0x344c, 0x080c, 0x7729, 0x080c,
-	0x6ed7, 0x080c, 0x87d4, 0x080c, 0x8453, 0x080c, 0x2c93, 0x0c58,
+	0x1178, 0x080c, 0x4bd9, 0x080c, 0x344e, 0x080c, 0x7712, 0x080c,
+	0x6ed0, 0x080c, 0x87bd, 0x080c, 0x843c, 0x080c, 0x2c95, 0x0c58,
 	0x000b, 0x0c78, 0x0944, 0x0945, 0x0ae7, 0x0942, 0x0bae, 0x0d68,
 	0x0d68, 0x0d68, 0x080c, 0x0dd5, 0x0005, 0x0126, 0x00f6, 0x2091,
-	0x8000, 0x7000, 0x9086, 0x0001, 0x1904, 0x0aba, 0x080c, 0x56de,
+	0x8000, 0x7000, 0x9086, 0x0001, 0x1904, 0x0aba, 0x080c, 0x56e7,
 	0x1130, 0x0026, 0x2011, 0x0080, 0x080c, 0x0edf, 0x002e, 0x080c,
-	0x73bc, 0x0150, 0x080c, 0x73df, 0x15a0, 0x2079, 0x0100, 0x7828,
-	0x9085, 0x1800, 0x782a, 0x0468, 0x080c, 0x72ee, 0x7000, 0x9086,
+	0x73a5, 0x0150, 0x080c, 0x73c8, 0x15a0, 0x2079, 0x0100, 0x7828,
+	0x9085, 0x1800, 0x782a, 0x0468, 0x080c, 0x72d7, 0x7000, 0x9086,
 	0x0001, 0x1904, 0x0aba, 0x7098, 0x9086, 0x0028, 0x1904, 0x0aba,
-	0x080c, 0x8422, 0x080c, 0x8414, 0x2001, 0x0161, 0x2003, 0x0001,
+	0x080c, 0x840b, 0x080c, 0x83fd, 0x2001, 0x0161, 0x2003, 0x0001,
 	0x2079, 0x0100, 0x7827, 0xffff, 0x7a28, 0x9295, 0x5e2f, 0x7a2a,
-	0x2011, 0x7252, 0x080c, 0x84f3, 0x2011, 0x7245, 0x080c, 0x85cd,
-	0x2011, 0x5e83, 0x080c, 0x84f3, 0x2011, 0x8030, 0x901e, 0x7396,
-	0x04d0, 0x080c, 0x5730, 0x2079, 0x0100, 0x7844, 0x9005, 0x1904,
-	0x0aba, 0x2011, 0x5e83, 0x080c, 0x84f3, 0x2011, 0x7252, 0x080c,
-	0x84f3, 0x2011, 0x7245, 0x080c, 0x85cd, 0x2001, 0x0265, 0x2001,
+	0x2011, 0x723b, 0x080c, 0x84dc, 0x2011, 0x722e, 0x080c, 0x85b6,
+	0x2011, 0x5e8c, 0x080c, 0x84dc, 0x2011, 0x8030, 0x901e, 0x7396,
+	0x04d0, 0x080c, 0x5739, 0x2079, 0x0100, 0x7844, 0x9005, 0x1904,
+	0x0aba, 0x2011, 0x5e8c, 0x080c, 0x84dc, 0x2011, 0x723b, 0x080c,
+	0x84dc, 0x2011, 0x722e, 0x080c, 0x85b6, 0x2001, 0x0265, 0x2001,
 	0x0205, 0x2003, 0x0000, 0x7840, 0x9084, 0xfffb, 0x7842, 0x2001,
-	0x19a6, 0x2004, 0x9005, 0x1140, 0x00c6, 0x2061, 0x0100, 0x080c,
-	0x5fd0, 0x00ce, 0x0804, 0x0aba, 0x780f, 0x006b, 0x7a28, 0x080c,
-	0x73c4, 0x0118, 0x9295, 0x5e2f, 0x0010, 0x9295, 0x402f, 0x7a2a,
-	0x2011, 0x8010, 0x73d8, 0x2001, 0x19a7, 0x2003, 0x0001, 0x080c,
-	0x2b59, 0x080c, 0x4b04, 0x7248, 0xc284, 0x724a, 0x2001, 0x180c,
-	0x200c, 0xc1ac, 0xc1cc, 0x2102, 0x080c, 0xa51d, 0x2011, 0x0004,
-	0x080c, 0xcb45, 0x080c, 0x6822, 0x080c, 0x73bc, 0x1120, 0x080c,
-	0x2b9d, 0x02e0, 0x0400, 0x080c, 0x5fd7, 0x0140, 0x7097, 0x0001,
-	0x70d3, 0x0000, 0x080c, 0x58fd, 0x0804, 0x0aba, 0x080c, 0x56cf,
+	0x19a5, 0x2004, 0x9005, 0x1140, 0x00c6, 0x2061, 0x0100, 0x080c,
+	0x5fd9, 0x00ce, 0x0804, 0x0aba, 0x780f, 0x006b, 0x7a28, 0x080c,
+	0x73ad, 0x0118, 0x9295, 0x5e2f, 0x0010, 0x9295, 0x402f, 0x7a2a,
+	0x2011, 0x8010, 0x73d8, 0x2001, 0x19a6, 0x2003, 0x0001, 0x080c,
+	0x2b5b, 0x080c, 0x4b14, 0x7248, 0xc284, 0x724a, 0x2001, 0x180c,
+	0x200c, 0xc1ac, 0xc1cc, 0x2102, 0x080c, 0xa51e, 0x2011, 0x0004,
+	0x080c, 0xcb5a, 0x080c, 0x682b, 0x080c, 0x73a5, 0x1120, 0x080c,
+	0x2b9f, 0x02e0, 0x0400, 0x080c, 0x5fe0, 0x0140, 0x7097, 0x0001,
+	0x70d3, 0x0000, 0x080c, 0x5906, 0x0804, 0x0aba, 0x080c, 0x56d8,
 	0xd094, 0x0188, 0x2011, 0x180c, 0x2204, 0xc0cd, 0x2012, 0x080c,
-	0x56d3, 0xd0d4, 0x1118, 0x080c, 0x2b9d, 0x1270, 0x2011, 0x180c,
-	0x2204, 0xc0bc, 0x00a8, 0x080c, 0x56d3, 0xd0d4, 0x1db8, 0x2011,
+	0x56dc, 0xd0d4, 0x1118, 0x080c, 0x2b9f, 0x1270, 0x2011, 0x180c,
+	0x2204, 0xc0bc, 0x00a8, 0x080c, 0x56dc, 0xd0d4, 0x1db8, 0x2011,
 	0x180c, 0x2204, 0xc0bd, 0x0060, 0x2011, 0x180c, 0x2204, 0xc0bd,
-	0x2012, 0x080c, 0x696a, 0x1128, 0xd0a4, 0x0118, 0x2204, 0xc0fd,
-	0x2012, 0x080c, 0x6930, 0x0120, 0x7a0c, 0xc2b4, 0x7a0e, 0x00a8,
-	0x707f, 0x0000, 0x080c, 0x73bc, 0x1130, 0x70b0, 0x9005, 0x1168,
-	0x080c, 0xcf81, 0x0050, 0x080c, 0xcf81, 0x70dc, 0xd09c, 0x1128,
-	0x70b0, 0x9005, 0x0110, 0x080c, 0x5fad, 0x70e7, 0x0000, 0x70e3,
-	0x0000, 0x70a7, 0x0000, 0x080c, 0x2ba5, 0x0228, 0x2011, 0x0101,
-	0x2204, 0xc0c4, 0x2012, 0x72dc, 0x080c, 0x73bc, 0x1178, 0x9016,
-	0x0016, 0x080c, 0x2956, 0x2019, 0x196d, 0x211a, 0x001e, 0x705f,
-	0xffff, 0x7063, 0x00ef, 0x7083, 0x0000, 0x0020, 0x2019, 0x196d,
+	0x2012, 0x080c, 0x6973, 0x1128, 0xd0a4, 0x0118, 0x2204, 0xc0fd,
+	0x2012, 0x080c, 0x6939, 0x0120, 0x7a0c, 0xc2b4, 0x7a0e, 0x00a8,
+	0x707f, 0x0000, 0x080c, 0x73a5, 0x1130, 0x70b0, 0x9005, 0x1168,
+	0x080c, 0xcf9b, 0x0050, 0x080c, 0xcf9b, 0x70dc, 0xd09c, 0x1128,
+	0x70b0, 0x9005, 0x0110, 0x080c, 0x5fb6, 0x70e7, 0x0000, 0x70e3,
+	0x0000, 0x70a7, 0x0000, 0x080c, 0x2ba7, 0x0228, 0x2011, 0x0101,
+	0x2204, 0xc0c4, 0x2012, 0x72dc, 0x080c, 0x73a5, 0x1178, 0x9016,
+	0x0016, 0x080c, 0x2958, 0x2019, 0x196c, 0x211a, 0x001e, 0x705f,
+	0xffff, 0x7063, 0x00ef, 0x7083, 0x0000, 0x0020, 0x2019, 0x196c,
 	0x201b, 0x0000, 0x2079, 0x1847, 0x7804, 0xd0ac, 0x0108, 0xc295,
-	0x72de, 0x080c, 0x73bc, 0x0118, 0x9296, 0x0004, 0x0548, 0x2011,
-	0x0001, 0x080c, 0xcb45, 0x70ab, 0x0000, 0x70af, 0xffff, 0x7003,
+	0x72de, 0x080c, 0x73a5, 0x0118, 0x9296, 0x0004, 0x0548, 0x2011,
+	0x0001, 0x080c, 0xcb5a, 0x70ab, 0x0000, 0x70af, 0xffff, 0x7003,
 	0x0002, 0x2079, 0x0100, 0x7827, 0x0003, 0x7828, 0x9085, 0x0003,
-	0x782a, 0x00fe, 0x080c, 0x2f96, 0x2011, 0x0005, 0x080c, 0xa653,
-	0x080c, 0x968d, 0x080c, 0x73bc, 0x0148, 0x00c6, 0x2061, 0x0100,
-	0x0016, 0x080c, 0x2956, 0x61e2, 0x001e, 0x00ce, 0x012e, 0x0420,
+	0x782a, 0x00fe, 0x080c, 0x2f98, 0x2011, 0x0005, 0x080c, 0xa654,
+	0x080c, 0x9687, 0x080c, 0x73a5, 0x0148, 0x00c6, 0x2061, 0x0100,
+	0x0016, 0x080c, 0x2958, 0x61e2, 0x001e, 0x00ce, 0x012e, 0x0420,
 	0x70ab, 0x0000, 0x70af, 0xffff, 0x7003, 0x0002, 0x00f6, 0x2079,
 	0x0100, 0x7827, 0x0003, 0x7828, 0x9085, 0x0003, 0x782a, 0x00fe,
-	0x2011, 0x0005, 0x080c, 0xa653, 0x080c, 0x968d, 0x080c, 0x73bc,
-	0x0148, 0x00c6, 0x2061, 0x0100, 0x0016, 0x080c, 0x2956, 0x61e2,
+	0x2011, 0x0005, 0x080c, 0xa654, 0x080c, 0x9687, 0x080c, 0x73a5,
+	0x0148, 0x00c6, 0x2061, 0x0100, 0x0016, 0x080c, 0x2958, 0x61e2,
 	0x001e, 0x00ce, 0x00fe, 0x012e, 0x0005, 0x00c6, 0x00b6, 0x080c,
-	0x73bc, 0x1118, 0x20a9, 0x0800, 0x0010, 0x20a9, 0x0782, 0x080c,
-	0x73bc, 0x1110, 0x900e, 0x0010, 0x2009, 0x007e, 0x86ff, 0x0138,
+	0x73a5, 0x1118, 0x20a9, 0x0800, 0x0010, 0x20a9, 0x0782, 0x080c,
+	0x73a5, 0x1110, 0x900e, 0x0010, 0x2009, 0x007e, 0x86ff, 0x0138,
 	0x9180, 0x1000, 0x2004, 0x905d, 0x0110, 0xb800, 0xd0bc, 0x090c,
-	0x32bb, 0x8108, 0x1f04, 0x0ace, 0x707f, 0x0000, 0x7080, 0x9084,
+	0x32bd, 0x8108, 0x1f04, 0x0ace, 0x707f, 0x0000, 0x7080, 0x9084,
 	0x00ff, 0x7082, 0x70b3, 0x0000, 0x00be, 0x00ce, 0x0005, 0x00b6,
 	0x0126, 0x2091, 0x8000, 0x7000, 0x9086, 0x0002, 0x1904, 0x0bab,
-	0x70ac, 0x9086, 0xffff, 0x0130, 0x080c, 0x2f96, 0x080c, 0x968d,
+	0x70ac, 0x9086, 0xffff, 0x0130, 0x080c, 0x2f98, 0x080c, 0x9687,
 	0x0804, 0x0bab, 0x70dc, 0xd0ac, 0x1110, 0xd09c, 0x0558, 0xd084,
 	0x0548, 0x0006, 0x2001, 0x0103, 0x2003, 0x002b, 0x000e, 0xd08c,
-	0x0508, 0x080c, 0x331e, 0x11d0, 0x70e0, 0x9086, 0xffff, 0x01b0,
-	0x080c, 0x312b, 0x080c, 0x968d, 0x70dc, 0xd094, 0x1904, 0x0bab,
-	0x2011, 0x0001, 0x080c, 0xd230, 0x0110, 0x2011, 0x0003, 0x901e,
-	0x080c, 0x3165, 0x080c, 0x968d, 0x0804, 0x0bab, 0x70e4, 0x9005,
+	0x0508, 0x080c, 0x3320, 0x11d0, 0x70e0, 0x9086, 0xffff, 0x01b0,
+	0x080c, 0x312d, 0x080c, 0x9687, 0x70dc, 0xd094, 0x1904, 0x0bab,
+	0x2011, 0x0001, 0x080c, 0xd24a, 0x0110, 0x2011, 0x0003, 0x901e,
+	0x080c, 0x3167, 0x080c, 0x9687, 0x0804, 0x0bab, 0x70e4, 0x9005,
 	0x1904, 0x0bab, 0x70a8, 0x9005, 0x1904, 0x0bab, 0x70dc, 0xd0a4,
-	0x0118, 0xd0b4, 0x0904, 0x0bab, 0x080c, 0x6930, 0x1904, 0x0bab,
-	0x080c, 0x6983, 0x1904, 0x0bab, 0x080c, 0x696a, 0x01c0, 0x0156,
-	0x00c6, 0x20a9, 0x007f, 0x900e, 0x0016, 0x080c, 0x65ff, 0x1118,
+	0x0118, 0xd0b4, 0x0904, 0x0bab, 0x080c, 0x6939, 0x1904, 0x0bab,
+	0x080c, 0x698c, 0x1904, 0x0bab, 0x080c, 0x6973, 0x01c0, 0x0156,
+	0x00c6, 0x20a9, 0x007f, 0x900e, 0x0016, 0x080c, 0x6608, 0x1118,
 	0xb800, 0xd0ec, 0x1138, 0x001e, 0x8108, 0x1f04, 0x0b44, 0x00ce,
 	0x015e, 0x0028, 0x001e, 0x00ce, 0x015e, 0x0804, 0x0bab, 0x0006,
-	0x2001, 0x0103, 0x2003, 0x002b, 0x000e, 0x2011, 0x19b3, 0x080c,
-	0x0f87, 0x2011, 0x19cd, 0x080c, 0x0f87, 0x7030, 0xc08c, 0x7032,
-	0x7003, 0x0003, 0x70af, 0xffff, 0x080c, 0x56de, 0x1130, 0x0026,
-	0x2011, 0x0040, 0x080c, 0x0edf, 0x002e, 0x9006, 0x080c, 0x27ea,
-	0x080c, 0x331e, 0x0118, 0x080c, 0x4ca1, 0x0050, 0x0036, 0x0046,
-	0x2019, 0xffff, 0x2021, 0x0006, 0x080c, 0x4cbb, 0x004e, 0x003e,
-	0x00f6, 0x2079, 0x0100, 0x080c, 0x73df, 0x0150, 0x080c, 0x73bc,
+	0x2001, 0x0103, 0x2003, 0x002b, 0x000e, 0x2011, 0x19b2, 0x080c,
+	0x0f87, 0x2011, 0x19cc, 0x080c, 0x0f87, 0x7030, 0xc08c, 0x7032,
+	0x7003, 0x0003, 0x70af, 0xffff, 0x080c, 0x56e7, 0x1130, 0x0026,
+	0x2011, 0x0040, 0x080c, 0x0edf, 0x002e, 0x9006, 0x080c, 0x27ec,
+	0x080c, 0x3320, 0x0118, 0x080c, 0x4cb1, 0x0050, 0x0036, 0x0046,
+	0x2019, 0xffff, 0x2021, 0x0006, 0x080c, 0x4ccb, 0x004e, 0x003e,
+	0x00f6, 0x2079, 0x0100, 0x080c, 0x73c8, 0x0150, 0x080c, 0x73a5,
 	0x7828, 0x0118, 0x9084, 0xe1ff, 0x0010, 0x9084, 0xffdf, 0x782a,
-	0x00fe, 0x2001, 0x19e8, 0x2004, 0x9086, 0x0005, 0x1120, 0x2011,
-	0x0000, 0x080c, 0xa653, 0x2011, 0x0000, 0x080c, 0xa65d, 0x080c,
-	0x968d, 0x080c, 0x97b9, 0x012e, 0x00be, 0x0005, 0x0016, 0x0046,
+	0x00fe, 0x2001, 0x19e7, 0x2004, 0x9086, 0x0005, 0x1120, 0x2011,
+	0x0000, 0x080c, 0xa654, 0x2011, 0x0000, 0x080c, 0xa65e, 0x080c,
+	0x9687, 0x080c, 0x97b5, 0x012e, 0x00be, 0x0005, 0x0016, 0x0046,
 	0x00f6, 0x0126, 0x2091, 0x8000, 0x2079, 0x0100, 0x7904, 0x918c,
-	0xfffd, 0x7906, 0x2009, 0x00f7, 0x080c, 0x5f96, 0x7940, 0x918c,
+	0xfffd, 0x7906, 0x2009, 0x00f7, 0x080c, 0x5f9f, 0x7940, 0x918c,
 	0x0010, 0x7942, 0x7924, 0xd1b4, 0x0110, 0x7827, 0x0040, 0xd19c,
 	0x0110, 0x7827, 0x0008, 0x0006, 0x0036, 0x0156, 0x7954, 0xd1ac,
-	0x1904, 0x0c3b, 0x2001, 0x19a7, 0x2004, 0x9005, 0x1518, 0x080c,
-	0x2c20, 0x1148, 0x2001, 0x0001, 0x080c, 0x2b88, 0x2001, 0x0001,
-	0x080c, 0x2b6b, 0x00b8, 0x080c, 0x2c28, 0x1138, 0x9006, 0x080c,
-	0x2b88, 0x9006, 0x080c, 0x2b6b, 0x0068, 0x080c, 0x2c30, 0x1d50,
-	0x2001, 0x1998, 0x2004, 0xd0fc, 0x0108, 0x0020, 0x080c, 0x2982,
-	0x0804, 0x0d1a, 0x080c, 0x73cd, 0x0148, 0x080c, 0x73df, 0x1118,
-	0x080c, 0x76b3, 0x0050, 0x080c, 0x73c4, 0x0dd0, 0x080c, 0x76ae,
-	0x080c, 0x76a4, 0x080c, 0x72ee, 0x0058, 0x080c, 0x73bc, 0x0140,
-	0x2009, 0x00f8, 0x080c, 0x5f96, 0x7843, 0x0090, 0x7843, 0x0010,
-	0x20a9, 0x09c4, 0x7820, 0xd09c, 0x1138, 0x080c, 0x73bc, 0x0138,
+	0x1904, 0x0c3b, 0x2001, 0x19a6, 0x2004, 0x9005, 0x1518, 0x080c,
+	0x2c22, 0x1148, 0x2001, 0x0001, 0x080c, 0x2b8a, 0x2001, 0x0001,
+	0x080c, 0x2b6d, 0x00b8, 0x080c, 0x2c2a, 0x1138, 0x9006, 0x080c,
+	0x2b8a, 0x9006, 0x080c, 0x2b6d, 0x0068, 0x080c, 0x2c32, 0x1d50,
+	0x2001, 0x1997, 0x2004, 0xd0fc, 0x0108, 0x0020, 0x080c, 0x2984,
+	0x0804, 0x0d1a, 0x080c, 0x73b6, 0x0148, 0x080c, 0x73c8, 0x1118,
+	0x080c, 0x769c, 0x0050, 0x080c, 0x73ad, 0x0dd0, 0x080c, 0x7697,
+	0x080c, 0x768d, 0x080c, 0x72d7, 0x0058, 0x080c, 0x73a5, 0x0140,
+	0x2009, 0x00f8, 0x080c, 0x5f9f, 0x7843, 0x0090, 0x7843, 0x0010,
+	0x20a9, 0x09c4, 0x7820, 0xd09c, 0x1138, 0x080c, 0x73a5, 0x0138,
 	0x7824, 0xd0ac, 0x1904, 0x0d1f, 0x1f04, 0x0c1a, 0x0070, 0x7824,
-	0x080c, 0x73d6, 0x0118, 0xd0ac, 0x1904, 0x0d1f, 0x9084, 0x1800,
+	0x080c, 0x73bf, 0x0118, 0xd0ac, 0x1904, 0x0d1f, 0x9084, 0x1800,
 	0x0d98, 0x7003, 0x0001, 0x0804, 0x0d1f, 0x2001, 0x0001, 0x080c,
-	0x27ea, 0x0804, 0x0d32, 0x2001, 0x19a7, 0x2004, 0x9005, 0x1518,
-	0x080c, 0x2c20, 0x1148, 0x2001, 0x0001, 0x080c, 0x2b88, 0x2001,
-	0x0001, 0x080c, 0x2b6b, 0x00b8, 0x080c, 0x2c28, 0x1138, 0x9006,
-	0x080c, 0x2b88, 0x9006, 0x080c, 0x2b6b, 0x0068, 0x080c, 0x2c30,
-	0x1d50, 0x2001, 0x1998, 0x2004, 0xd0fc, 0x0108, 0x0020, 0x080c,
-	0x2982, 0x0804, 0x0d1a, 0x7850, 0x9085, 0x0040, 0x7852, 0x7938,
-	0x7850, 0x9084, 0xfbcf, 0x7852, 0x080c, 0x2c38, 0x9085, 0x2000,
-	0x7852, 0x793a, 0x20a9, 0x0046, 0x1d04, 0x0c74, 0x080c, 0x85ad,
+	0x27ec, 0x0804, 0x0d32, 0x2001, 0x19a6, 0x2004, 0x9005, 0x1518,
+	0x080c, 0x2c22, 0x1148, 0x2001, 0x0001, 0x080c, 0x2b8a, 0x2001,
+	0x0001, 0x080c, 0x2b6d, 0x00b8, 0x080c, 0x2c2a, 0x1138, 0x9006,
+	0x080c, 0x2b8a, 0x9006, 0x080c, 0x2b6d, 0x0068, 0x080c, 0x2c32,
+	0x1d50, 0x2001, 0x1997, 0x2004, 0xd0fc, 0x0108, 0x0020, 0x080c,
+	0x2984, 0x0804, 0x0d1a, 0x7850, 0x9085, 0x0040, 0x7852, 0x7938,
+	0x7850, 0x9084, 0xfbcf, 0x7852, 0x080c, 0x2c3a, 0x9085, 0x2000,
+	0x7852, 0x793a, 0x20a9, 0x0046, 0x1d04, 0x0c74, 0x080c, 0x8596,
 	0x1f04, 0x0c74, 0x7850, 0x9085, 0x0400, 0x9084, 0xdfbf, 0x7852,
-	0x793a, 0x080c, 0x73cd, 0x0148, 0x080c, 0x73df, 0x1118, 0x080c,
-	0x76b3, 0x0050, 0x080c, 0x73c4, 0x0dd0, 0x080c, 0x76ae, 0x080c,
-	0x76a4, 0x080c, 0x72ee, 0x0020, 0x2009, 0x00f8, 0x080c, 0x5f96,
+	0x793a, 0x080c, 0x73b6, 0x0148, 0x080c, 0x73c8, 0x1118, 0x080c,
+	0x769c, 0x0050, 0x080c, 0x73ad, 0x0dd0, 0x080c, 0x7697, 0x080c,
+	0x768d, 0x080c, 0x72d7, 0x0020, 0x2009, 0x00f8, 0x080c, 0x5f9f,
 	0x20a9, 0x0028, 0xa001, 0x1f04, 0x0c9a, 0x7850, 0x9085, 0x1400,
-	0x7852, 0x080c, 0x73bc, 0x0120, 0x7843, 0x0090, 0x7843, 0x0010,
-	0x2021, 0xe678, 0x2019, 0xea60, 0x0d0c, 0x85ad, 0x7820, 0xd09c,
-	0x1580, 0x080c, 0x73bc, 0x0904, 0x0cff, 0x7824, 0xd0ac, 0x1904,
-	0x0d1f, 0x080c, 0x73df, 0x1528, 0x0046, 0x2021, 0x0320, 0x8421,
-	0x1df0, 0x004e, 0x7827, 0x1800, 0x080c, 0x2c38, 0x7824, 0x9084,
+	0x7852, 0x080c, 0x73a5, 0x0120, 0x7843, 0x0090, 0x7843, 0x0010,
+	0x2021, 0xe678, 0x2019, 0xea60, 0x0d0c, 0x8596, 0x7820, 0xd09c,
+	0x1580, 0x080c, 0x73a5, 0x0904, 0x0cff, 0x7824, 0xd0ac, 0x1904,
+	0x0d1f, 0x080c, 0x73c8, 0x1528, 0x0046, 0x2021, 0x0320, 0x8421,
+	0x1df0, 0x004e, 0x7827, 0x1800, 0x080c, 0x2c3a, 0x7824, 0x9084,
 	0x1800, 0x1160, 0x9484, 0x0fff, 0x1138, 0x2001, 0x1810, 0x2004,
 	0xd0fc, 0x0110, 0x080c, 0x0d45, 0x8421, 0x1158, 0x1d04, 0x0cda,
-	0x080c, 0x85ad, 0x080c, 0x76ae, 0x080c, 0x76a4, 0x7003, 0x0001,
-	0x04f0, 0x8319, 0x1948, 0x1d04, 0x0ce7, 0x080c, 0x85ad, 0x2009,
-	0x199b, 0x2104, 0x9005, 0x0118, 0x8001, 0x200a, 0x1178, 0x200b,
-	0x000a, 0x7827, 0x0048, 0x20a9, 0x0002, 0x080c, 0x2c19, 0x7924,
-	0x080c, 0x2c38, 0xd19c, 0x0110, 0x080c, 0x2b59, 0x00d8, 0x080c,
-	0x73cd, 0x1140, 0x94a2, 0x03e8, 0x1128, 0x080c, 0x7394, 0x7003,
-	0x0001, 0x00a8, 0x7827, 0x1800, 0x080c, 0x2c38, 0x7824, 0x080c,
-	0x73d6, 0x0110, 0xd0ac, 0x1158, 0x9084, 0x1800, 0x0950, 0x7003,
-	0x0001, 0x0028, 0x2001, 0x0001, 0x080c, 0x27ea, 0x0078, 0x2009,
+	0x080c, 0x8596, 0x080c, 0x7697, 0x080c, 0x768d, 0x7003, 0x0001,
+	0x04f0, 0x8319, 0x1948, 0x1d04, 0x0ce7, 0x080c, 0x8596, 0x2009,
+	0x199a, 0x2104, 0x9005, 0x0118, 0x8001, 0x200a, 0x1178, 0x200b,
+	0x000a, 0x7827, 0x0048, 0x20a9, 0x0002, 0x080c, 0x2c1b, 0x7924,
+	0x080c, 0x2c3a, 0xd19c, 0x0110, 0x080c, 0x2b5b, 0x00d8, 0x080c,
+	0x73b6, 0x1140, 0x94a2, 0x03e8, 0x1128, 0x080c, 0x737d, 0x7003,
+	0x0001, 0x00a8, 0x7827, 0x1800, 0x080c, 0x2c3a, 0x7824, 0x080c,
+	0x73bf, 0x0110, 0xd0ac, 0x1158, 0x9084, 0x1800, 0x0950, 0x7003,
+	0x0001, 0x0028, 0x2001, 0x0001, 0x080c, 0x27ec, 0x0078, 0x2009,
 	0x180c, 0x210c, 0xd19c, 0x1120, 0x7904, 0x918d, 0x0002, 0x7906,
 	0x7827, 0x0048, 0x7828, 0x9085, 0x0028, 0x782a, 0x7850, 0x9085,
-	0x0400, 0x7852, 0x2001, 0x19a7, 0x2003, 0x0000, 0x9006, 0x78f2,
-	0x015e, 0x003e, 0x000e, 0x080c, 0x56de, 0x1110, 0x080c, 0x0e62,
+	0x0400, 0x7852, 0x2001, 0x19a6, 0x2003, 0x0000, 0x9006, 0x78f2,
+	0x015e, 0x003e, 0x000e, 0x080c, 0x56e7, 0x1110, 0x080c, 0x0e62,
 	0x012e, 0x00fe, 0x004e, 0x001e, 0x0005, 0x0006, 0x0016, 0x0036,
 	0x0046, 0x00b6, 0x00c6, 0x00d6, 0x00e6, 0x00f6, 0x0156, 0x0069,
-	0x0d0c, 0x85ad, 0x015e, 0x00fe, 0x00ee, 0x00de, 0x00ce, 0x00be,
+	0x0d0c, 0x8596, 0x015e, 0x00fe, 0x00ee, 0x00de, 0x00ce, 0x00be,
 	0x004e, 0x003e, 0x001e, 0x000e, 0x0005, 0x00e6, 0x2071, 0x189e,
-	0x7004, 0x9086, 0x0001, 0x1110, 0x080c, 0x344c, 0x00ee, 0x0005,
-	0x0005, 0x2a70, 0x2061, 0x19ab, 0x2063, 0x0003, 0x6007, 0x0002,
-	0x600b, 0x001c, 0x600f, 0x0137, 0x2001, 0x197c, 0x900e, 0x2102,
+	0x7004, 0x9086, 0x0001, 0x1110, 0x080c, 0x344e, 0x00ee, 0x0005,
+	0x0005, 0x2a70, 0x2061, 0x19aa, 0x2063, 0x0003, 0x6007, 0x0002,
+	0x600b, 0x001e, 0x600f, 0x0137, 0x2001, 0x197b, 0x900e, 0x2102,
 	0x7196, 0x2001, 0x0100, 0x2004, 0x9082, 0x0002, 0x0218, 0x705f,
 	0xffff, 0x0008, 0x715e, 0x7067, 0xffff, 0x717e, 0x7182, 0x080c,
-	0xcf81, 0x2061, 0x196c, 0x6003, 0x0909, 0x6106, 0x600b, 0x8800,
+	0xcf9b, 0x2061, 0x196b, 0x6003, 0x0909, 0x6106, 0x600b, 0x8800,
 	0x600f, 0x0200, 0x6013, 0x00ff, 0x6017, 0x001f, 0x611a, 0x601f,
-	0x07d0, 0x2061, 0x1974, 0x6003, 0x8000, 0x6106, 0x610a, 0x600f,
+	0x07d0, 0x2061, 0x1973, 0x6003, 0x8000, 0x6106, 0x610a, 0x600f,
 	0x0200, 0x6013, 0x00ff, 0x6116, 0x601b, 0x0001, 0x611e, 0x2061,
-	0x1989, 0x6003, 0x514c, 0x6007, 0x4f47, 0x600b, 0x4943, 0x600f,
-	0x2020, 0x2001, 0x182c, 0x2102, 0x0005, 0x9016, 0x080c, 0x65ff,
+	0x1988, 0x6003, 0x514c, 0x6007, 0x4f47, 0x600b, 0x4943, 0x600f,
+	0x2020, 0x2001, 0x182c, 0x2102, 0x0005, 0x9016, 0x080c, 0x6608,
 	0x1178, 0xb804, 0x90c4, 0x00ff, 0x98c6, 0x0006, 0x0128, 0x90c4,
 	0xff00, 0x98c6, 0x0600, 0x1120, 0x9186, 0x0080, 0x0108, 0x8210,
 	0x8108, 0x9186, 0x0800, 0x1d50, 0x2208, 0x0005, 0x2091, 0x8000,
@@ -240,22 +240,22 @@ unsigned short risc_code01[] = {
 	0x0dd7, 0x0006, 0x0016, 0x2001, 0x8002, 0x0006, 0x2079, 0x0000,
 	0x000e, 0x7882, 0x7836, 0x001e, 0x798e, 0x000e, 0x788a, 0x000e,
 	0x7886, 0x3900, 0x789a, 0x7833, 0x0012, 0x2091, 0x5000, 0x0156,
-	0x00d6, 0x0036, 0x0026, 0x2079, 0x0300, 0x2069, 0x1aa2, 0x7a08,
-	0x226a, 0x2069, 0x1aa3, 0x7a18, 0x226a, 0x8d68, 0x7a1c, 0x226a,
-	0x782c, 0x2019, 0x1ab0, 0x201a, 0x2019, 0x1ab3, 0x9016, 0x7808,
-	0xd09c, 0x0168, 0x7820, 0x201a, 0x8210, 0x8318, 0x9386, 0x1ac8,
+	0x00d6, 0x0036, 0x0026, 0x2079, 0x0300, 0x2069, 0x1aa1, 0x7a08,
+	0x226a, 0x2069, 0x1aa2, 0x7a18, 0x226a, 0x8d68, 0x7a1c, 0x226a,
+	0x782c, 0x2019, 0x1aaf, 0x201a, 0x2019, 0x1ab2, 0x9016, 0x7808,
+	0xd09c, 0x0168, 0x7820, 0x201a, 0x8210, 0x8318, 0x9386, 0x1ac7,
 	0x0108, 0x0ca8, 0x7808, 0xd09c, 0x0110, 0x2011, 0xdead, 0x2019,
-	0x1ab1, 0x782c, 0x201a, 0x8318, 0x221a, 0x7803, 0x0000, 0x2069,
-	0x1a82, 0x901e, 0x20a9, 0x0020, 0x7b26, 0x7a28, 0x226a, 0x8d68,
+	0x1ab0, 0x782c, 0x201a, 0x8318, 0x221a, 0x7803, 0x0000, 0x2069,
+	0x1a81, 0x901e, 0x20a9, 0x0020, 0x7b26, 0x7a28, 0x226a, 0x8d68,
 	0x8318, 0x1f04, 0x0e24, 0x002e, 0x003e, 0x00de, 0x015e, 0x2079,
 	0x1800, 0x7803, 0x0005, 0x2091, 0x4080, 0x2001, 0x0089, 0x2004,
-	0xd084, 0x0180, 0x2001, 0x1a19, 0x2004, 0x9005, 0x0128, 0x2001,
+	0xd084, 0x0180, 0x2001, 0x1a18, 0x2004, 0x9005, 0x0128, 0x2001,
 	0x008b, 0x2004, 0xd0fc, 0x0dd8, 0x2001, 0x008a, 0x2003, 0x0002,
-	0x2003, 0x1001, 0x080c, 0x56de, 0x1110, 0x080c, 0x0e99, 0x0cd0,
+	0x2003, 0x1001, 0x080c, 0x56e7, 0x1110, 0x080c, 0x0e99, 0x0cd0,
 	0x0005, 0x918c, 0x03ff, 0x2001, 0x0003, 0x2004, 0x9084, 0x0600,
 	0x1118, 0x918d, 0x2800, 0x0010, 0x918d, 0x2000, 0x2001, 0x017f,
 	0x2102, 0x0005, 0x00f6, 0x0006, 0x2079, 0x1827, 0x2f04, 0x8000,
-	0x207a, 0x080c, 0x2c30, 0x1150, 0x0006, 0x2001, 0x1998, 0x2004,
+	0x207a, 0x080c, 0x2c32, 0x1150, 0x0006, 0x2001, 0x1997, 0x2004,
 	0xd0fc, 0x000e, 0x1118, 0x9082, 0x7530, 0x0010, 0x9082, 0x000f,
 	0x0258, 0x9006, 0x207a, 0x2079, 0x182a, 0x2f04, 0x9084, 0x0001,
 	0x9086, 0x0001, 0x207a, 0x0090, 0x2079, 0x182a, 0x2f7c, 0x8fff,
@@ -266,8 +266,8 @@ unsigned short risc_code01[] = {
 	0x080c, 0x0f00, 0x0c80, 0x7038, 0xd0b4, 0x1128, 0x0026, 0x2011,
 	0x0040, 0x0469, 0x002e, 0x0005, 0x7038, 0xd0b4, 0x1128, 0x0026,
 	0x2011, 0x0080, 0x0421, 0x002e, 0x0005, 0x0026, 0x70ef, 0x0000,
-	0x0459, 0x1148, 0x080c, 0x2c30, 0x1118, 0x2011, 0x8484, 0x0058,
-	0x2011, 0x8282, 0x0040, 0x080c, 0x2c30, 0x1118, 0x2011, 0xcdc5,
+	0x0459, 0x1148, 0x080c, 0x2c32, 0x1118, 0x2011, 0x8484, 0x0058,
+	0x2011, 0x8282, 0x0040, 0x080c, 0x2c32, 0x1118, 0x2011, 0xcdc5,
 	0x0010, 0x2011, 0xcac2, 0x00e9, 0x002e, 0x0005, 0xd0b4, 0x0130,
 	0x0006, 0x3b00, 0x9084, 0xff3f, 0x20d8, 0x000e, 0x0005, 0x0016,
 	0x3b08, 0x3a00, 0x9104, 0x918d, 0x00c0, 0x21d8, 0x9084, 0xff3f,
@@ -315,7 +315,7 @@ unsigned short risc_code01[] = {
 	0x0cd8, 0x00e6, 0x0126, 0x2091, 0x8000, 0x0016, 0x890e, 0x810e,
 	0x810f, 0x9184, 0x003f, 0xa862, 0x9184, 0xffc0, 0xa85e, 0x001e,
 	0x0020, 0x00e6, 0x0126, 0x2091, 0x8000, 0x2071, 0x1800, 0x702c,
-	0xa802, 0x2900, 0x702e, 0x70c0, 0x8000, 0x70c2, 0x080c, 0x8414,
+	0xa802, 0x2900, 0x702e, 0x70c0, 0x8000, 0x70c2, 0x080c, 0x83fd,
 	0x012e, 0x00ee, 0x0005, 0x2071, 0x1800, 0x9026, 0x2009, 0x0000,
 	0x2049, 0x0400, 0x2900, 0x702e, 0x8940, 0x2800, 0xa802, 0xa95e,
 	0xa863, 0x0001, 0x8420, 0x9886, 0x0440, 0x0120, 0x2848, 0x9188,
@@ -332,20 +332,20 @@ unsigned short risc_code01[] = {
 	0x9982, 0x0534, 0x0288, 0x9982, 0x0800, 0x1270, 0x0040, 0x9982,
 	0x0800, 0x0250, 0x2071, 0x188d, 0x7010, 0x9902, 0x1228, 0x9085,
 	0x0001, 0x001e, 0x00ee, 0x0005, 0x9006, 0x0cd8, 0x00e6, 0x2071,
-	0x1a18, 0x7007, 0x0000, 0x9006, 0x701e, 0x7022, 0x7002, 0x2071,
+	0x1a17, 0x7007, 0x0000, 0x9006, 0x701e, 0x7022, 0x7002, 0x2071,
 	0x0000, 0x7010, 0x9085, 0x8044, 0x7012, 0x2071, 0x0080, 0x9006,
 	0x20a9, 0x0040, 0x7022, 0x1f04, 0x10e2, 0x702b, 0x0020, 0x00ee,
 	0x0005, 0x0126, 0x2091, 0x8000, 0x00e6, 0xa06f, 0x0000, 0x2071,
-	0x1a18, 0x701c, 0x9088, 0x1a22, 0x280a, 0x8000, 0x9084, 0x003f,
+	0x1a17, 0x701c, 0x9088, 0x1a21, 0x280a, 0x8000, 0x9084, 0x003f,
 	0x701e, 0x7120, 0x9106, 0x090c, 0x0dd5, 0x7004, 0x9005, 0x1128,
 	0x00f6, 0x2079, 0x0080, 0x00a9, 0x00fe, 0x00ee, 0x012e, 0x0005,
-	0x0126, 0x2091, 0x8000, 0x00e6, 0x2071, 0x1a18, 0x7004, 0x9005,
+	0x0126, 0x2091, 0x8000, 0x00e6, 0x2071, 0x1a17, 0x7004, 0x9005,
 	0x1128, 0x00f6, 0x2079, 0x0080, 0x0021, 0x00fe, 0x00ee, 0x012e,
 	0x0005, 0x7004, 0x9086, 0x0000, 0x1110, 0x7007, 0x0006, 0x7000,
 	0x0002, 0x112b, 0x12ae, 0x1129, 0x1129, 0x12a2, 0x12a2, 0x12a2,
 	0x12a2, 0x080c, 0x0dd5, 0x701c, 0x7120, 0x9106, 0x1148, 0x792c,
 	0x9184, 0x0001, 0x1120, 0xd1fc, 0x1110, 0x7007, 0x0000, 0x0005,
-	0x0096, 0x9180, 0x1a22, 0x2004, 0x700a, 0x2048, 0x8108, 0x918c,
+	0x0096, 0x9180, 0x1a21, 0x2004, 0x700a, 0x2048, 0x8108, 0x918c,
 	0x003f, 0x7122, 0x782b, 0x0026, 0xa88c, 0x7802, 0xa890, 0x7806,
 	0xa894, 0x780a, 0xa898, 0x780e, 0xa878, 0x700e, 0xa870, 0x7016,
 	0xa874, 0x701a, 0xa868, 0x009e, 0xd084, 0x0120, 0x7007, 0x0001,
@@ -357,8 +357,8 @@ unsigned short risc_code01[] = {
 	0x782b, 0x0026, 0x710c, 0x2011, 0x0040, 0x9182, 0x0040, 0x1210,
 	0x2110, 0x9006, 0x700e, 0x22a8, 0x4006, 0x8203, 0x7812, 0x782b,
 	0x0020, 0x3300, 0x701a, 0x782b, 0x0001, 0x015e, 0x014e, 0x013e,
-	0x002e, 0x001e, 0x0005, 0x2009, 0x1a18, 0x2104, 0xc095, 0x200a,
-	0x080c, 0x1108, 0x0005, 0x0016, 0x00e6, 0x2071, 0x1a18, 0x00f6,
+	0x002e, 0x001e, 0x0005, 0x2009, 0x1a17, 0x2104, 0xc095, 0x200a,
+	0x080c, 0x1108, 0x0005, 0x0016, 0x00e6, 0x2071, 0x1a17, 0x00f6,
 	0x2079, 0x0080, 0x792c, 0xd1bc, 0x190c, 0x0dce, 0x782b, 0x0002,
 	0xd1fc, 0x0120, 0x918c, 0x0700, 0x7004, 0x0023, 0x00fe, 0x00ee,
 	0x001e, 0x0005, 0x1119, 0x11c1, 0x11f5, 0x12cd, 0x0dd5, 0x12e8,
@@ -380,15 +380,15 @@ unsigned short risc_code01[] = {
 	0x080c, 0x1108, 0x0005, 0x00de, 0x009e, 0x080c, 0x1108, 0x0005,
 	0xa8a8, 0xd08c, 0x0005, 0x0096, 0xa0a0, 0x904d, 0x090c, 0x0dd5,
 	0xa06c, 0x908e, 0x0100, 0x0130, 0xa87b, 0x0030, 0xa883, 0x0000,
-	0xa897, 0x4002, 0x080c, 0x6c75, 0xa09f, 0x0000, 0xa0a3, 0x0000,
+	0xa897, 0x4002, 0x080c, 0x6c7a, 0xa09f, 0x0000, 0xa0a3, 0x0000,
 	0x2848, 0x080c, 0x1031, 0x009e, 0x0005, 0x00a6, 0xa0a0, 0x904d,
 	0x090c, 0x0dd5, 0xa06c, 0x908e, 0x0100, 0x0128, 0xa87b, 0x0001,
 	0xa883, 0x0000, 0x00c0, 0xa80c, 0x2050, 0xb004, 0x9005, 0x0198,
 	0xa80e, 0x2050, 0x8006, 0x8006, 0x8007, 0x908c, 0x003f, 0x9084,
 	0xffc0, 0x9080, 0x0002, 0xa076, 0xa172, 0xb000, 0xa07a, 0x2810,
 	0x080c, 0x10e9, 0x00e8, 0xa97c, 0xa894, 0x0016, 0x0006, 0x080c,
-	0x6c75, 0x000e, 0x001e, 0xd1fc, 0x1138, 0xd1f4, 0x0128, 0x00c6,
-	0x2060, 0x080c, 0xae61, 0x00ce, 0x7008, 0x2048, 0xa89f, 0x0000,
+	0x6c7a, 0x000e, 0x001e, 0xd1fc, 0x1138, 0xd1f4, 0x0128, 0x00c6,
+	0x2060, 0x080c, 0xae71, 0x00ce, 0x7008, 0x2048, 0xa89f, 0x0000,
 	0xa8a3, 0x0000, 0x080c, 0x1031, 0x7007, 0x0000, 0x080c, 0x1108,
 	0x00ae, 0x0005, 0x0126, 0x2091, 0x8000, 0x782b, 0x1001, 0x7007,
 	0x0005, 0x7000, 0xc094, 0x7002, 0x012e, 0x0005, 0x0096, 0x2001,
@@ -397,1811 +397,1813 @@ unsigned short risc_code01[] = {
 	0x8000, 0x782b, 0x0041, 0x7007, 0x0003, 0x7000, 0xc084, 0x7002,
 	0x2900, 0x700a, 0x012e, 0x009e, 0x0005, 0x20e1, 0x0000, 0x2099,
 	0x0088, 0x782b, 0x0040, 0x0096, 0x2001, 0x192e, 0x204c, 0xaa7c,
-	0x009e, 0x080c, 0x8a0c, 0x2009, 0x188c, 0x2104, 0x9084, 0xfffc,
-	0x200a, 0x080c, 0x887f, 0x7007, 0x0000, 0x080c, 0x1119, 0x0005,
+	0x009e, 0x080c, 0x89f5, 0x2009, 0x188c, 0x2104, 0x9084, 0xfffc,
+	0x200a, 0x080c, 0x8868, 0x7007, 0x0000, 0x080c, 0x1119, 0x0005,
 	0x7007, 0x0000, 0x080c, 0x1119, 0x0005, 0x0126, 0x2091, 0x2200,
-	0x2079, 0x0300, 0x2071, 0x1a62, 0x7003, 0x0000, 0x78bf, 0x00f6,
+	0x2079, 0x0300, 0x2071, 0x1a61, 0x7003, 0x0000, 0x78bf, 0x00f6,
 	0x781b, 0x4800, 0x00c1, 0x7803, 0x0003, 0x780f, 0x0000, 0x20a9,
-	0x03d0, 0x2061, 0xea18, 0x2c0d, 0x7912, 0xe104, 0x9ce0, 0x0002,
+	0x03d0, 0x2061, 0xea39, 0x2c0d, 0x7912, 0xe104, 0x9ce0, 0x0002,
 	0x7916, 0x1f04, 0x1303, 0x7807, 0x0007, 0x7803, 0x0000, 0x7803,
 	0x0001, 0x012e, 0x0005, 0x00c6, 0x7803, 0x0000, 0x7808, 0xd09c,
-	0x0120, 0x7820, 0x080c, 0x1362, 0x0cc8, 0x2001, 0x1a63, 0x2003,
+	0x0120, 0x7820, 0x080c, 0x1362, 0x0cc8, 0x2001, 0x1a62, 0x2003,
 	0x0000, 0x78ab, 0x0004, 0x78ac, 0xd0ac, 0x1de8, 0x78ab, 0x0002,
 	0x7807, 0x0007, 0x7827, 0x0030, 0x782b, 0x0400, 0x7827, 0x0031,
-	0x782b, 0x1a82, 0x781f, 0xff00, 0x781b, 0xb700, 0x2001, 0x0200,
-	0x2004, 0xd0dc, 0x0110, 0x781f, 0x0303, 0x2061, 0x1a82, 0x602f,
+	0x782b, 0x1a81, 0x781f, 0xff00, 0x781b, 0xb700, 0x2001, 0x0200,
+	0x2004, 0xd0dc, 0x0110, 0x781f, 0x0303, 0x2061, 0x1a81, 0x602f,
 	0x1cd0, 0x2001, 0x181a, 0x2004, 0x9082, 0x1cd0, 0x6032, 0x603b,
-	0x2090, 0x2001, 0x3325, 0xd0fc, 0x190c, 0x0dd5, 0x2001, 0x0003,
-	0x2004, 0xd0d4, 0x1118, 0x783f, 0x3325, 0x0020, 0x9084, 0xc000,
-	0x783f, 0xb325, 0x604f, 0x193c, 0x2001, 0x1927, 0x2004, 0x6042,
+	0x2092, 0x2001, 0x3327, 0xd0fc, 0x190c, 0x0dd5, 0x2001, 0x0003,
+	0x2004, 0xd0d4, 0x1118, 0x783f, 0x3327, 0x0020, 0x9084, 0xc000,
+	0x783f, 0xb327, 0x604f, 0x193c, 0x2001, 0x1927, 0x2004, 0x6042,
 	0x00ce, 0x0005, 0x9086, 0x000d, 0x11d0, 0x7808, 0xd09c, 0x01b8,
-	0x7820, 0x0026, 0x2010, 0x080c, 0xcb23, 0x0180, 0x2260, 0x6000,
+	0x7820, 0x0026, 0x2010, 0x080c, 0xcb38, 0x0180, 0x2260, 0x6000,
 	0x9086, 0x0004, 0x1158, 0x0016, 0x6120, 0x9186, 0x0009, 0x0108,
-	0x0020, 0x2009, 0x004c, 0x080c, 0xaedc, 0x001e, 0x002e, 0x0005,
+	0x0020, 0x2009, 0x004c, 0x080c, 0xaeec, 0x001e, 0x002e, 0x0005,
 	0x0126, 0x2091, 0x2200, 0x7908, 0x9184, 0x0070, 0x190c, 0x0dce,
 	0xd19c, 0x0158, 0x7820, 0x908c, 0xf000, 0x15e8, 0x908a, 0x0024,
 	0x1a0c, 0x0dd5, 0x0023, 0x012e, 0x0005, 0x012e, 0x0005, 0x13bb,
 	0x13bb, 0x13d2, 0x13d7, 0x13db, 0x13e0, 0x1408, 0x140c, 0x141a,
-	0x141e, 0x13bb, 0x14e9, 0x14ed, 0x1552, 0x1559, 0x13bb, 0x155a,
-	0x155b, 0x1566, 0x156d, 0x13bb, 0x13bb, 0x13bb, 0x13bb, 0x13bb,
+	0x141e, 0x13bb, 0x14eb, 0x14ef, 0x1554, 0x155b, 0x13bb, 0x155c,
+	0x155d, 0x1568, 0x156f, 0x13bb, 0x13bb, 0x13bb, 0x13bb, 0x13bb,
 	0x13bb, 0x13bb, 0x13e2, 0x13bb, 0x13bb, 0x13bb, 0x13bb, 0x13bb,
 	0x13bb, 0x13bf, 0x13bd, 0x080c, 0x0dd5, 0x080c, 0x0dce, 0x080c,
-	0x1578, 0x2009, 0x1a7b, 0x2104, 0x8000, 0x200a, 0x080c, 0x7e56,
-	0x080c, 0x1aa9, 0x0005, 0x2009, 0x0048, 0x2060, 0x080c, 0xaedc,
+	0x157a, 0x2009, 0x1a7a, 0x2104, 0x8000, 0x200a, 0x080c, 0x7e3f,
+	0x080c, 0x1aab, 0x0005, 0x2009, 0x0048, 0x2060, 0x080c, 0xaeec,
 	0x012e, 0x0005, 0x7004, 0xc085, 0xc0b5, 0x7006, 0x0005, 0x7004,
-	0xc085, 0x7006, 0x0005, 0x080c, 0x1578, 0x080c, 0x16bb, 0x0005,
-	0x080c, 0x0dd5, 0x080c, 0x1578, 0x2060, 0x6014, 0x0096, 0x2048,
-	0xa83b, 0xffff, 0x009e, 0x2009, 0x0048, 0x080c, 0xaedc, 0x2001,
+	0xc085, 0x7006, 0x0005, 0x080c, 0x157a, 0x080c, 0x16bd, 0x0005,
+	0x080c, 0x0dd5, 0x080c, 0x157a, 0x2060, 0x6014, 0x0096, 0x2048,
+	0xa83b, 0xffff, 0x009e, 0x2009, 0x0048, 0x080c, 0xaeec, 0x2001,
 	0x015d, 0x2003, 0x0000, 0x2009, 0x03e8, 0x8109, 0x0160, 0x2001,
 	0x0201, 0x2004, 0x9005, 0x0dc8, 0x2001, 0x0218, 0x2004, 0xd0ec,
-	0x1110, 0x080c, 0x157d, 0x2001, 0x0307, 0x2003, 0x8000, 0x0005,
-	0x7004, 0xc095, 0x7006, 0x0005, 0x080c, 0x1578, 0x2060, 0x6014,
+	0x1110, 0x080c, 0x157f, 0x2001, 0x0307, 0x2003, 0x8000, 0x0005,
+	0x7004, 0xc095, 0x7006, 0x0005, 0x080c, 0x157a, 0x2060, 0x6014,
 	0x0096, 0x2048, 0xa83b, 0xffff, 0x009e, 0x2009, 0x0048, 0x080c,
-	0xaedc, 0x0005, 0x080c, 0x1578, 0x080c, 0x0dd5, 0x080c, 0x1578,
-	0x080c, 0x14d4, 0x7827, 0x0018, 0x79ac, 0xd1dc, 0x0904, 0x1487,
+	0xaeec, 0x0005, 0x080c, 0x157a, 0x080c, 0x0dd5, 0x080c, 0x157a,
+	0x080c, 0x14d6, 0x7827, 0x0018, 0x79ac, 0xd1dc, 0x0904, 0x1487,
 	0x7827, 0x0015, 0x7828, 0x782b, 0x0000, 0x9065, 0x0140, 0x2001,
 	0x020d, 0x2003, 0x0050, 0x2003, 0x0020, 0x0804, 0x148d, 0x7004,
 	0x9005, 0x01c8, 0x1188, 0x78ab, 0x0004, 0x7827, 0x0018, 0x782b,
 	0x0000, 0xd1bc, 0x090c, 0x0dd5, 0x2001, 0x020d, 0x2003, 0x0050,
-	0x2003, 0x0020, 0x0804, 0x14b9, 0x78ab, 0x0004, 0x7803, 0x0001,
-	0x080c, 0x14ed, 0x0005, 0x7827, 0x0018, 0xa001, 0x7828, 0x7827,
+	0x2003, 0x0020, 0x0804, 0x14bb, 0x78ab, 0x0004, 0x7803, 0x0001,
+	0x080c, 0x14ef, 0x0005, 0x7827, 0x0018, 0xa001, 0x7828, 0x7827,
 	0x0011, 0xa001, 0x7928, 0x9106, 0x0110, 0x79ac, 0x08e0, 0x00e6,
-	0x2071, 0x0200, 0x702c, 0xd0c4, 0x0140, 0x00ee, 0x080c, 0x1aa9,
+	0x2071, 0x0200, 0x702c, 0xd0c4, 0x0140, 0x00ee, 0x080c, 0x1aab,
 	0x080c, 0x1313, 0x7803, 0x0001, 0x0005, 0x7037, 0x0001, 0xa001,
 	0x7150, 0x00ee, 0x918c, 0xff00, 0x9186, 0x0500, 0x0110, 0x79ac,
 	0x0810, 0x7004, 0xc09d, 0x7006, 0x78ab, 0x0004, 0x7803, 0x0001,
-	0x080c, 0x14ed, 0x2001, 0x020d, 0x2003, 0x0020, 0x0005, 0x7828,
+	0x080c, 0x14ef, 0x2001, 0x020d, 0x2003, 0x0020, 0x0005, 0x7828,
 	0x782b, 0x0000, 0x9065, 0x090c, 0x0dd5, 0x6014, 0x2048, 0x78ab,
-	0x0004, 0x918c, 0x0700, 0x0198, 0x080c, 0x7e56, 0x080c, 0x1aa9,
-	0x080c, 0xcb35, 0x0158, 0xa9ac, 0xa936, 0xa9b0, 0xa93a, 0xa83f,
-	0xffff, 0xa843, 0xffff, 0xa880, 0xc0bd, 0xa882, 0x0005, 0x6020,
-	0x9086, 0x0009, 0x1128, 0x2009, 0x004c, 0x080c, 0xaedc, 0x0048,
-	0x6010, 0x00b6, 0x2058, 0xb800, 0x00be, 0xd0bc, 0x6024, 0x190c,
-	0xcf1a, 0x2029, 0x00c8, 0x8529, 0x0128, 0x2001, 0x0201, 0x2004,
-	0x9005, 0x0dc8, 0x7dbc, 0x080c, 0xe9c1, 0xd5a4, 0x1118, 0x080c,
-	0x157d, 0x0005, 0x080c, 0x7e56, 0x080c, 0x1aa9, 0x0005, 0x781f,
-	0x0300, 0x7803, 0x0001, 0x0005, 0x0016, 0x0066, 0x0076, 0x00f6,
-	0x2079, 0x0300, 0x7908, 0x918c, 0x0007, 0x9186, 0x0003, 0x0120,
-	0x2001, 0x0016, 0x080c, 0x15ee, 0x00fe, 0x007e, 0x006e, 0x001e,
-	0x0005, 0x7004, 0xc09d, 0x7006, 0x0005, 0x7104, 0x9184, 0x0004,
-	0x190c, 0x0dd5, 0xd184, 0x1189, 0xd19c, 0x0158, 0xc19c, 0x7106,
-	0x2001, 0x020d, 0x2003, 0x0050, 0x2003, 0x0020, 0x080c, 0x157d,
-	0x0005, 0x81ff, 0x190c, 0x0dd5, 0x0005, 0xc184, 0xd1b4, 0xc1b4,
-	0x7106, 0x0016, 0x00e6, 0x15f0, 0x2071, 0x0200, 0x080c, 0x16a8,
-	0x05c8, 0x6014, 0x9005, 0x05b0, 0x0096, 0x2048, 0xa864, 0x009e,
-	0x9084, 0x00ff, 0x908e, 0x0029, 0x0160, 0x908e, 0x0048, 0x1550,
-	0x601c, 0xd084, 0x11e0, 0x00f6, 0x2c78, 0x080c, 0x1725, 0x00fe,
-	0x00b0, 0x00f6, 0x2c78, 0x080c, 0x18ac, 0x00fe, 0x2009, 0x01f4,
-	0x8109, 0x0168, 0x2001, 0x0201, 0x2004, 0x9005, 0x0dc8, 0x2001,
-	0x0218, 0x2004, 0xd0ec, 0x1118, 0x080c, 0x157d, 0x0040, 0x2001,
-	0x020d, 0x2003, 0x0020, 0x080c, 0x1313, 0x7803, 0x0001, 0x00ee,
-	0x001e, 0x0005, 0x2001, 0x020d, 0x2003, 0x0050, 0x2003, 0x0020,
-	0x0461, 0x0ca8, 0x0429, 0x2060, 0x2009, 0x0053, 0x080c, 0xaedc,
-	0x0005, 0x0005, 0x0005, 0x00e1, 0x2008, 0x00d1, 0x0006, 0x7004,
-	0xc09d, 0x7006, 0x000e, 0x080c, 0x8d69, 0x0005, 0x0089, 0x9005,
-	0x0118, 0x080c, 0x896c, 0x0cd0, 0x0005, 0x2001, 0x0036, 0x2009,
-	0x1820, 0x210c, 0x2011, 0x181f, 0x2214, 0x080c, 0x15ee, 0x0005,
-	0x7808, 0xd09c, 0x0de8, 0x7820, 0x0005, 0x080c, 0x14d4, 0x00d6,
-	0x2069, 0x0200, 0x2009, 0x01f4, 0x8109, 0x0510, 0x6804, 0x9005,
-	0x0dd8, 0x2001, 0x015d, 0x2003, 0x0000, 0x79bc, 0xd1a4, 0x1528,
-	0x79b8, 0x918c, 0x0fff, 0x0180, 0x9182, 0x0841, 0x1268, 0x9188,
-	0x0007, 0x918c, 0x0ff8, 0x810c, 0x810c, 0x810c, 0x080c, 0x15e0,
-	0x6827, 0x0001, 0x8109, 0x1dd0, 0x04d9, 0x6827, 0x0002, 0x04c1,
-	0x6804, 0x9005, 0x1130, 0x682c, 0xd0e4, 0x1500, 0x6804, 0x9005,
-	0x0de8, 0x79b8, 0xd1ec, 0x1130, 0x08c0, 0x080c, 0x7e56, 0x080c,
-	0x1aa9, 0x0090, 0x7827, 0x0015, 0x782b, 0x0000, 0x7827, 0x0018,
-	0x782b, 0x0000, 0x2001, 0x020d, 0x2003, 0x0020, 0x2001, 0x0307,
-	0x2003, 0x0300, 0x7803, 0x0001, 0x00de, 0x0005, 0x682c, 0x9084,
-	0x5400, 0x9086, 0x5400, 0x0d30, 0x7827, 0x0015, 0x782b, 0x0000,
-	0x7803, 0x0001, 0x6800, 0x9085, 0x1800, 0x6802, 0x00de, 0x0005,
-	0x6824, 0x9084, 0x0003, 0x1de0, 0x0005, 0x2001, 0x0030, 0x2c08,
-	0x621c, 0x0021, 0x7830, 0x9086, 0x0041, 0x0005, 0x00f6, 0x2079,
-	0x0300, 0x0006, 0x7808, 0xd09c, 0x0140, 0x0016, 0x0026, 0x00c6,
-	0x080c, 0x1380, 0x00ce, 0x002e, 0x001e, 0x000e, 0x0006, 0x7832,
-	0x7936, 0x7a3a, 0x781b, 0x8080, 0x0059, 0x1118, 0x000e, 0x00fe,
-	0x0005, 0x000e, 0x792c, 0x3900, 0x8000, 0x2004, 0x080c, 0x0dd5,
-	0x2009, 0x180c, 0x2104, 0xc0f4, 0x200a, 0x2009, 0xff00, 0x8109,
-	0x0904, 0x166c, 0x7a18, 0x9284, 0x0030, 0x0904, 0x1667, 0x9284,
-	0x0048, 0x9086, 0x0008, 0x1904, 0x1667, 0x2001, 0x0109, 0x2004,
-	0xd08c, 0x01f0, 0x0006, 0x01c6, 0x01d6, 0x0136, 0x0146, 0x0156,
-	0x0126, 0x2091, 0x2800, 0x00f6, 0x0026, 0x0016, 0x2009, 0x1a7d,
-	0x2104, 0x8000, 0x0208, 0x200a, 0x080c, 0x90a2, 0x001e, 0x002e,
-	0x00fe, 0x012e, 0x015e, 0x014e, 0x013e, 0x01de, 0x01ce, 0x000e,
-	0x2001, 0x009b, 0x2004, 0xd0fc, 0x01d0, 0x0006, 0x0126, 0x01c6,
-	0x01d6, 0x0136, 0x0146, 0x0156, 0x00f6, 0x0016, 0x2009, 0x1a7e,
-	0x2104, 0x8000, 0x0208, 0x200a, 0x080c, 0x1eb4, 0x001e, 0x00fe,
-	0x015e, 0x014e, 0x013e, 0x01de, 0x01ce, 0x012e, 0x000e, 0x7818,
-	0xd0bc, 0x1904, 0x1617, 0x0005, 0x2001, 0x180c, 0x2004, 0xd0f4,
-	0x1528, 0x7a18, 0x9284, 0x0030, 0x0508, 0x9284, 0x0048, 0x9086,
-	0x0008, 0x11e0, 0x2001, 0x19f6, 0x2004, 0x9005, 0x01b8, 0x2001,
-	0x1a66, 0x2004, 0x9086, 0x0000, 0x0188, 0x2009, 0x1a7c, 0x2104,
-	0x8000, 0x0208, 0x200a, 0x080c, 0xa2f7, 0x2009, 0x180c, 0x2104,
-	0xc0f5, 0x200a, 0x2009, 0xff00, 0x0804, 0x1617, 0x9085, 0x0001,
-	0x0005, 0x7832, 0x7936, 0x7a3a, 0x781b, 0x8080, 0x080c, 0x1610,
-	0x1108, 0x0005, 0x792c, 0x3900, 0x8000, 0x2004, 0x080c, 0x0dd5,
-	0x7037, 0x0001, 0x7150, 0x7037, 0x0002, 0x7050, 0x2060, 0xd1bc,
-	0x1110, 0x7054, 0x2060, 0x918c, 0xff00, 0x9186, 0x0500, 0x0110,
-	0x9085, 0x0001, 0x0005, 0x00e6, 0x0016, 0x2071, 0x0200, 0x0c41,
-	0x6124, 0xd1dc, 0x01f8, 0x701c, 0xd08c, 0x0904, 0x171a, 0x7017,
-	0x0000, 0x2001, 0x0264, 0x2004, 0xd0bc, 0x0904, 0x171a, 0x2001,
-	0x0268, 0x00c6, 0x2064, 0x6104, 0x6038, 0x00ce, 0x918e, 0x0039,
-	0x1904, 0x171a, 0x9c06, 0x15f0, 0x0126, 0x2091, 0x2600, 0x080c,
-	0x7d9d, 0x012e, 0x7358, 0x745c, 0x6014, 0x905d, 0x0598, 0x2b48,
-	0x6010, 0x00b6, 0x2058, 0xb800, 0x00be, 0xd0bc, 0x190c, 0xcef5,
-	0xab42, 0xac3e, 0x2001, 0x1869, 0x2004, 0xd0b4, 0x1170, 0x601c,
-	0xd0e4, 0x1158, 0x6010, 0x00b6, 0x2058, 0xb800, 0x00be, 0xd0bc,
-	0x1120, 0xa83b, 0x7fff, 0xa837, 0xffff, 0x080c, 0x20b0, 0x1190,
-	0x080c, 0x1907, 0x2a00, 0xa816, 0x0130, 0x2800, 0xa80e, 0x2c05,
-	0xa80a, 0x2c00, 0xa812, 0x7037, 0x0020, 0x781f, 0x0300, 0x001e,
-	0x00ee, 0x0005, 0x7037, 0x0050, 0x7037, 0x0020, 0x001e, 0x00ee,
-	0x080c, 0x157d, 0x0005, 0x080c, 0x0dd5, 0x2ff0, 0x0126, 0x2091,
-	0x2200, 0x00c6, 0x3e60, 0x6014, 0x2048, 0x2940, 0x903e, 0x2730,
-	0xa864, 0x2068, 0xa81a, 0x9d84, 0x000f, 0x9088, 0x2090, 0x2165,
-	0x0002, 0x1750, 0x17be, 0x1750, 0x1750, 0x1754, 0x179f, 0x1750,
-	0x1774, 0x1749, 0x17b5, 0x1750, 0x1750, 0x1759, 0x18aa, 0x1788,
-	0x177e, 0xa964, 0x918c, 0x00ff, 0x918e, 0x0048, 0x0904, 0x17b5,
-	0x9085, 0x0001, 0x0804, 0x18a1, 0xa87c, 0xd0ac, 0x0dc8, 0x0804,
-	0x17c5, 0xa87c, 0xd0ac, 0x0da0, 0x0804, 0x1830, 0xa898, 0x901d,
-	0x1108, 0xab9c, 0x9016, 0xaab2, 0xaa3e, 0xaa42, 0x3e00, 0x9080,
-	0x0008, 0x2004, 0x9080, 0x8f30, 0x2005, 0x9005, 0x090c, 0x0dd5,
-	0x2004, 0xa8ae, 0x0804, 0x1889, 0xa87c, 0xd0bc, 0x09c8, 0xa890,
-	0xa842, 0xa88c, 0xa83e, 0xa888, 0x0804, 0x17c5, 0xa87c, 0xd0bc,
-	0x0978, 0xa890, 0xa842, 0xa88c, 0xa83e, 0xa888, 0x0804, 0x1830,
-	0xa87c, 0xd0bc, 0x0928, 0xa890, 0xa842, 0xa88c, 0xa83e, 0xa804,
-	0x9045, 0x090c, 0x0dd5, 0xa164, 0xa91a, 0x91ec, 0x000f, 0x9d80,
-	0x2090, 0x2065, 0xa888, 0xd19c, 0x1904, 0x1830, 0x0430, 0xa87c,
-	0xd0ac, 0x0904, 0x1750, 0xa804, 0x9045, 0x090c, 0x0dd5, 0xa164,
-	0xa91a, 0x91ec, 0x000f, 0x9d80, 0x2090, 0x2065, 0x9006, 0xa842,
-	0xa83e, 0xd19c, 0x1904, 0x1830, 0x0080, 0xa87c, 0xd0ac, 0x0904,
-	0x1750, 0x9006, 0xa842, 0xa83e, 0x0804, 0x1830, 0xa87c, 0xd0ac,
-	0x0904, 0x1750, 0x9006, 0xa842, 0xa83e, 0x2c05, 0x908a, 0x0036,
-	0x1a0c, 0x0dd5, 0x9082, 0x001b, 0x0002, 0x17e8, 0x17e8, 0x17ea,
-	0x17e8, 0x17e8, 0x17e8, 0x17f4, 0x17e8, 0x17e8, 0x17e8, 0x17fe,
-	0x17e8, 0x17e8, 0x17e8, 0x1808, 0x17e8, 0x17e8, 0x17e8, 0x1812,
-	0x17e8, 0x17e8, 0x17e8, 0x181c, 0x17e8, 0x17e8, 0x17e8, 0x1826,
-	0x080c, 0x0dd5, 0xa574, 0xa478, 0x9d86, 0x0024, 0x0904, 0x175e,
-	0xa37c, 0xa280, 0x0804, 0x1889, 0xa584, 0xa488, 0x9d86, 0x0024,
-	0x0904, 0x175e, 0xa38c, 0xa290, 0x0804, 0x1889, 0xa594, 0xa498,
-	0x9d86, 0x0024, 0x0904, 0x175e, 0xa39c, 0xa2a0, 0x0804, 0x1889,
-	0xa5a4, 0xa4a8, 0x9d86, 0x0024, 0x0904, 0x175e, 0xa3ac, 0xa2b0,
-	0x0804, 0x1889, 0xa5b4, 0xa4b8, 0x9d86, 0x0024, 0x0904, 0x175e,
-	0xa3bc, 0xa2c0, 0x0804, 0x1889, 0xa5c4, 0xa4c8, 0x9d86, 0x0024,
-	0x0904, 0x175e, 0xa3cc, 0xa2d0, 0x0804, 0x1889, 0xa5d4, 0xa4d8,
-	0x9d86, 0x0024, 0x0904, 0x175e, 0xa3dc, 0xa2e0, 0x0804, 0x1889,
-	0x2c05, 0x908a, 0x0034, 0x1a0c, 0x0dd5, 0x9082, 0x001b, 0x0002,
-	0x1853, 0x1851, 0x1851, 0x1851, 0x1851, 0x1851, 0x185e, 0x1851,
-	0x1851, 0x1851, 0x1851, 0x1851, 0x1869, 0x1851, 0x1851, 0x1851,
-	0x1851, 0x1851, 0x1874, 0x1851, 0x1851, 0x1851, 0x1851, 0x1851,
-	0x187f, 0x080c, 0x0dd5, 0xa56c, 0xa470, 0xa774, 0xa678, 0x9d86,
-	0x002c, 0x0904, 0x175e, 0xa37c, 0xa280, 0x0458, 0xa584, 0xa488,
-	0xa78c, 0xa690, 0x9d86, 0x002c, 0x0904, 0x175e, 0xa394, 0xa298,
-	0x0400, 0xa59c, 0xa4a0, 0xa7a4, 0xa6a8, 0x9d86, 0x002c, 0x0904,
-	0x175e, 0xa3ac, 0xa2b0, 0x00a8, 0xa5b4, 0xa4b8, 0xa7bc, 0xa6c0,
-	0x9d86, 0x002c, 0x0904, 0x175e, 0xa3c4, 0xa2c8, 0x0050, 0xa5cc,
-	0xa4d0, 0xa7d4, 0xa6d8, 0x9d86, 0x002c, 0x0904, 0x175e, 0xa3dc,
-	0xa2e0, 0xab2e, 0xaa32, 0xad1e, 0xac22, 0xaf26, 0xae2a, 0xa988,
-	0x8c60, 0x2c1d, 0xa8ac, 0xaab0, 0xa836, 0xaa3a, 0x8109, 0xa916,
-	0x1158, 0x3e60, 0x601c, 0xc085, 0x601e, 0xa87c, 0xc0dd, 0xa87e,
-	0x9006, 0x00ce, 0x012e, 0x0005, 0x2800, 0xa80e, 0xab0a, 0x2c00,
-	0xa812, 0x0c78, 0x0804, 0x1750, 0x2ff0, 0x0126, 0x2091, 0x2200,
-	0x00c6, 0x3e60, 0x6014, 0x2048, 0x2940, 0xa80e, 0x2061, 0x208b,
-	0xa813, 0x208b, 0x2c05, 0xa80a, 0xa964, 0xa91a, 0xa87c, 0xd0ac,
-	0x090c, 0x0dd5, 0x9006, 0xa842, 0xa83e, 0x2c05, 0x908a, 0x0034,
-	0x1a0c, 0x0dd5, 0xadcc, 0xacd0, 0xafd4, 0xaed8, 0xabdc, 0xaae0,
-	0xab2e, 0xaa32, 0xad1e, 0xac22, 0xaf26, 0xae2a, 0xa8ac, 0xaab0,
-	0xa836, 0xaa3a, 0xa988, 0xa864, 0x9084, 0x00ff, 0x9086, 0x0008,
-	0x1120, 0x8109, 0xa916, 0x0128, 0x0078, 0x918a, 0x0002, 0xa916,
-	0x1158, 0x3e60, 0x601c, 0xc085, 0x601e, 0xa87c, 0xc0dd, 0xa87e,
-	0x9006, 0x00ce, 0x012e, 0x0005, 0xa804, 0x9045, 0x090c, 0x0dd5,
-	0xa80e, 0xa064, 0xa81a, 0x9084, 0x000f, 0x9080, 0x2090, 0x2015,
-	0x82ff, 0x090c, 0x0dd5, 0xaa12, 0x2205, 0xa80a, 0x0c10, 0x903e,
-	0x2730, 0xa880, 0xd0fc, 0x1190, 0x2d00, 0x0002, 0x1a31, 0x195e,
-	0x195e, 0x1a31, 0x195e, 0x1a2b, 0x1a31, 0x195e, 0x19ce, 0x19ce,
-	0x19ce, 0x1a31, 0x19ce, 0x1a31, 0x1a28, 0x19ce, 0xc0fc, 0xa882,
-	0xab2c, 0xaa30, 0xad1c, 0xac20, 0xdd9c, 0x0904, 0x1a33, 0x2c05,
-	0x908a, 0x0034, 0x1a0c, 0x0dd5, 0x9082, 0x001b, 0x0002, 0x194a,
-	0x1948, 0x1948, 0x1948, 0x1948, 0x1948, 0x194e, 0x1948, 0x1948,
-	0x1948, 0x1948, 0x1948, 0x1952, 0x1948, 0x1948, 0x1948, 0x1948,
-	0x1948, 0x1956, 0x1948, 0x1948, 0x1948, 0x1948, 0x1948, 0x195a,
-	0x080c, 0x0dd5, 0xa774, 0xa678, 0x0804, 0x1a33, 0xa78c, 0xa690,
-	0x0804, 0x1a33, 0xa7a4, 0xa6a8, 0x0804, 0x1a33, 0xa7bc, 0xa6c0,
-	0x0804, 0x1a33, 0xa7d4, 0xa6d8, 0x0804, 0x1a33, 0xa898, 0x901d,
-	0x1108, 0xab9c, 0x9016, 0x2c05, 0x908a, 0x0036, 0x1a0c, 0x0dd5,
-	0x9082, 0x001b, 0x0002, 0x1986, 0x1986, 0x1988, 0x1986, 0x1986,
-	0x1986, 0x1992, 0x1986, 0x1986, 0x1986, 0x199c, 0x1986, 0x1986,
-	0x1986, 0x19a6, 0x1986, 0x1986, 0x1986, 0x19b0, 0x1986, 0x1986,
-	0x1986, 0x19ba, 0x1986, 0x1986, 0x1986, 0x19c4, 0x080c, 0x0dd5,
-	0xa574, 0xa478, 0x9d86, 0x0004, 0x0904, 0x1a33, 0xa37c, 0xa280,
-	0x0804, 0x1a33, 0xa584, 0xa488, 0x9d86, 0x0004, 0x0904, 0x1a33,
-	0xa38c, 0xa290, 0x0804, 0x1a33, 0xa594, 0xa498, 0x9d86, 0x0004,
-	0x0904, 0x1a33, 0xa39c, 0xa2a0, 0x0804, 0x1a33, 0xa5a4, 0xa4a8,
-	0x9d86, 0x0004, 0x0904, 0x1a33, 0xa3ac, 0xa2b0, 0x0804, 0x1a33,
-	0xa5b4, 0xa4b8, 0x9d86, 0x0004, 0x0904, 0x1a33, 0xa3bc, 0xa2c0,
-	0x0804, 0x1a33, 0xa5c4, 0xa4c8, 0x9d86, 0x0004, 0x0904, 0x1a33,
-	0xa3cc, 0xa2d0, 0x0804, 0x1a33, 0xa5d4, 0xa4d8, 0x9d86, 0x0004,
-	0x0904, 0x1a33, 0xa3dc, 0xa2e0, 0x0804, 0x1a33, 0xa898, 0x901d,
-	0x1108, 0xab9c, 0x9016, 0x2c05, 0x908a, 0x0034, 0x1a0c, 0x0dd5,
-	0x9082, 0x001b, 0x0002, 0x19f6, 0x19f4, 0x19f4, 0x19f4, 0x19f4,
-	0x19f4, 0x1a00, 0x19f4, 0x19f4, 0x19f4, 0x19f4, 0x19f4, 0x1a0a,
-	0x19f4, 0x19f4, 0x19f4, 0x19f4, 0x19f4, 0x1a14, 0x19f4, 0x19f4,
-	0x19f4, 0x19f4, 0x19f4, 0x1a1e, 0x080c, 0x0dd5, 0xa56c, 0xa470,
-	0xa774, 0xa678, 0x9d86, 0x000c, 0x05b0, 0xa37c, 0xa280, 0x0498,
-	0xa584, 0xa488, 0xa78c, 0xa690, 0x9d86, 0x000c, 0x0560, 0xa394,
-	0xa298, 0x0448, 0xa59c, 0xa4a0, 0xa7a4, 0xa6a8, 0x9d86, 0x000c,
-	0x0510, 0xa3ac, 0xa2b0, 0x00f8, 0xa5b4, 0xa4b8, 0xa7bc, 0xa6c0,
-	0x9d86, 0x000c, 0x01c0, 0xa3c4, 0xa2c8, 0x00a8, 0xa5cc, 0xa4d0,
-	0xa7d4, 0xa6d8, 0x9d86, 0x000c, 0x0170, 0xa3dc, 0xa2e0, 0x0058,
-	0x9d86, 0x000e, 0x1130, 0x080c, 0x2048, 0x1904, 0x1907, 0x900e,
-	0x0050, 0x080c, 0x0dd5, 0xab2e, 0xaa32, 0xad1e, 0xac22, 0xaf26,
-	0xae2a, 0x080c, 0x2048, 0x0005, 0x6014, 0x2048, 0x6118, 0x810c,
-	0x810c, 0x810c, 0x81ff, 0x1118, 0xa887, 0x0001, 0x0008, 0xa986,
-	0x601b, 0x0002, 0xa974, 0xd1dc, 0x1108, 0x0005, 0xa934, 0xa88c,
-	0x9106, 0x1158, 0xa938, 0xa890, 0x9106, 0x1138, 0x601c, 0xc084,
-	0x601e, 0x2009, 0x0048, 0x0804, 0xaedc, 0x0005, 0x0126, 0x00c6,
-	0x2091, 0x2200, 0x00ce, 0x7908, 0x918c, 0x0007, 0x9186, 0x0000,
-	0x05b0, 0x9186, 0x0003, 0x0598, 0x6020, 0x6023, 0x0000, 0x0006,
-	0x2031, 0x0008, 0x00c6, 0x781f, 0x0808, 0x7808, 0xd09c, 0x0120,
-	0x080c, 0x1380, 0x8631, 0x1db8, 0x00ce, 0x781f, 0x0800, 0x2031,
-	0x0168, 0x00c6, 0x7808, 0xd09c, 0x190c, 0x1380, 0x00ce, 0x2001,
-	0x0038, 0x080c, 0x1b36, 0x7930, 0x9186, 0x0040, 0x0160, 0x9186,
-	0x0042, 0x190c, 0x0dd5, 0x2001, 0x001e, 0x8001, 0x1df0, 0x8631,
-	0x1d40, 0x080c, 0x1b45, 0x000e, 0x6022, 0x012e, 0x0005, 0x080c,
-	0x1b32, 0x7827, 0x0015, 0x7828, 0x9c06, 0x1db8, 0x782b, 0x0000,
-	0x0ca0, 0x00f6, 0x2079, 0x0300, 0x7803, 0x0000, 0x78ab, 0x0004,
-	0x00fe, 0x080c, 0x73bc, 0x11b0, 0x2001, 0x0138, 0x2003, 0x0000,
-	0x2001, 0x0160, 0x2003, 0x0000, 0x2011, 0x012c, 0xa001, 0xa001,
-	0x8211, 0x1de0, 0x0081, 0x0066, 0x2031, 0x0000, 0x080c, 0x746c,
-	0x006e, 0x0005, 0x0479, 0x0039, 0x2001, 0x0160, 0x2502, 0x2001,
-	0x0138, 0x2202, 0x0005, 0x00e6, 0x2071, 0x0200, 0x080c, 0x2c44,
-	0x2009, 0x003c, 0x080c, 0x23d2, 0x2001, 0x015d, 0x2003, 0x0000,
-	0x7000, 0x9084, 0x003c, 0x1de0, 0x080c, 0x8414, 0x70a0, 0x70a2,
-	0x7098, 0x709a, 0x709c, 0x709e, 0x2001, 0x020d, 0x2003, 0x0020,
-	0x00f6, 0x2079, 0x0300, 0x080c, 0x1313, 0x7803, 0x0001, 0x00fe,
-	0x00ee, 0x0005, 0x2001, 0x0138, 0x2014, 0x2003, 0x0000, 0x2001,
-	0x0160, 0x202c, 0x2003, 0x0000, 0x080c, 0x73bc, 0x1108, 0x0005,
-	0x2021, 0x0260, 0x2001, 0x0141, 0x201c, 0xd3dc, 0x1168, 0x2001,
-	0x0109, 0x201c, 0x939c, 0x0048, 0x1160, 0x2001, 0x0111, 0x201c,
-	0x83ff, 0x1110, 0x8421, 0x1d70, 0x2001, 0x015d, 0x2003, 0x0000,
-	0x0005, 0x0046, 0x2021, 0x0019, 0x2003, 0x0048, 0xa001, 0xa001,
-	0x201c, 0x939c, 0x0048, 0x0120, 0x8421, 0x1db0, 0x004e, 0x0c60,
-	0x004e, 0x0c40, 0x601c, 0xc084, 0x601e, 0x0005, 0x2c08, 0x621c,
-	0x080c, 0x15ee, 0x7930, 0x0005, 0x2c08, 0x621c, 0x080c, 0x1699,
-	0x7930, 0x0005, 0x8001, 0x1df0, 0x0005, 0x2031, 0x0005, 0x781c,
-	0x9084, 0x0007, 0x0170, 0x2001, 0x0038, 0x0c41, 0x9186, 0x0040,
-	0x0904, 0x1ba3, 0x2001, 0x001e, 0x0c69, 0x8631, 0x1d80, 0x080c,
-	0x0dd5, 0x781f, 0x0202, 0x2001, 0x015d, 0x2003, 0x0000, 0x2001,
-	0x0b10, 0x0c01, 0x781c, 0xd084, 0x0110, 0x0861, 0x04e0, 0x2001,
-	0x0030, 0x0891, 0x9186, 0x0040, 0x0568, 0x781c, 0xd084, 0x1da8,
-	0x781f, 0x0101, 0x2001, 0x0014, 0x0869, 0x2001, 0x0037, 0x0821,
-	0x9186, 0x0040, 0x0140, 0x2001, 0x0030, 0x080c, 0x1b3c, 0x9186,
-	0x0040, 0x190c, 0x0dd5, 0x00d6, 0x2069, 0x0200, 0x692c, 0xd1f4,
-	0x1170, 0xd1c4, 0x0160, 0xd19c, 0x0130, 0x6800, 0x9085, 0x1800,
-	0x6802, 0x00de, 0x0080, 0x6908, 0x9184, 0x0007, 0x1db0, 0x00de,
-	0x781f, 0x0100, 0x791c, 0x9184, 0x0007, 0x090c, 0x0dd5, 0xa001,
-	0xa001, 0x781f, 0x0200, 0x0005, 0x0126, 0x2091, 0x2400, 0x2071,
-	0x1a66, 0x2079, 0x0090, 0x012e, 0x0005, 0x9280, 0x0005, 0x2004,
-	0x2048, 0xa97c, 0xd1dc, 0x1904, 0x1c45, 0xa964, 0x9184, 0x0007,
-	0x0002, 0x1bc1, 0x1c30, 0x1bd8, 0x1bda, 0x1bd8, 0x1c18, 0x1bf8,
-	0x1be7, 0x918c, 0x00ff, 0x9186, 0x0008, 0x1170, 0xa87c, 0xd0b4,
-	0x0904, 0x1e6f, 0x9006, 0xa842, 0xa83e, 0xa988, 0x2900, 0xa85a,
-	0xa813, 0x208b, 0x0804, 0x1c41, 0x9186, 0x0048, 0x0904, 0x1c30,
-	0x080c, 0x0dd5, 0x9184, 0x00ff, 0x9086, 0x0013, 0x0904, 0x1c30,
-	0x9184, 0x00ff, 0x9086, 0x001b, 0x0904, 0x1c30, 0x0c88, 0xa87c,
-	0xd0b4, 0x0904, 0x1e6f, 0xa890, 0xa842, 0xa83a, 0xa88c, 0xa83e,
-	0xa836, 0xa8ac, 0xa846, 0xa8b0, 0xa84a, 0xa988, 0x0804, 0x1c38,
-	0xa864, 0x9084, 0x00ff, 0x9086, 0x001e, 0x19d0, 0xa87c, 0xd0b4,
-	0x0904, 0x1e6f, 0xa890, 0xa842, 0xa83a, 0xa88c, 0xa83e, 0xa836,
-	0xa8ac, 0xa846, 0xa8b0, 0xa84a, 0xa804, 0xa85a, 0x2040, 0xa064,
-	0x9084, 0x000f, 0x9080, 0x2090, 0x2005, 0xa812, 0xa988, 0x0448,
-	0x918c, 0x00ff, 0x9186, 0x0015, 0x1540, 0xa87c, 0xd0b4, 0x0904,
-	0x1e6f, 0xa804, 0xa85a, 0x2040, 0xa064, 0x9084, 0x000f, 0x9080,
-	0x2090, 0x2005, 0xa812, 0xa988, 0x9006, 0xa842, 0xa83e, 0x0088,
-	0xa87c, 0xd0b4, 0x0904, 0x1e6f, 0xa988, 0x9006, 0xa842, 0xa83e,
-	0x2900, 0xa85a, 0xa864, 0x9084, 0x000f, 0x9080, 0x2090, 0x2005,
-	0xa812, 0xa916, 0xa87c, 0xc0dd, 0xa87e, 0x0005, 0x00f6, 0x2079,
-	0x0090, 0x782c, 0xd0fc, 0x190c, 0x1eb4, 0x00e6, 0x2071, 0x1a66,
-	0x7000, 0x9005, 0x1904, 0x1cae, 0x7206, 0x9280, 0x0005, 0x204c,
-	0x9280, 0x0004, 0x2004, 0x782b, 0x0004, 0x00f6, 0x2079, 0x0200,
-	0x7803, 0x0040, 0x00fe, 0x00b6, 0x2058, 0xb86c, 0x7836, 0xb890,
-	0x00be, 0x00f6, 0x2079, 0x0200, 0x7803, 0x0040, 0xa001, 0xa001,
-	0xa001, 0xa001, 0xa001, 0xa001, 0x781a, 0x2079, 0x0100, 0x8004,
-	0x78d6, 0x00fe, 0xa814, 0x2050, 0xa858, 0x2040, 0xa810, 0x2060,
-	0xa064, 0x90ec, 0x000f, 0xa944, 0x791a, 0x7116, 0xa848, 0x781e,
-	0x701a, 0x9006, 0x700e, 0x7012, 0x7004, 0xa940, 0xa838, 0x9106,
-	0x1500, 0xa93c, 0xa834, 0x9106, 0x11e0, 0x0006, 0x0016, 0xa938,
-	0xa834, 0x9105, 0x0118, 0x001e, 0x000e, 0x0098, 0x001e, 0x000e,
-	0x8aff, 0x01c8, 0x0126, 0x2091, 0x8000, 0x2009, 0x0306, 0x200b,
-	0x0808, 0x00d9, 0x0108, 0x00c9, 0x012e, 0x9006, 0x00ee, 0x00fe,
-	0x0005, 0x0036, 0x0046, 0xab38, 0xac34, 0x080c, 0x20b0, 0x004e,
-	0x003e, 0x0d30, 0x0c98, 0x9085, 0x0001, 0x0c80, 0x2009, 0x0306,
-	0x200b, 0x4800, 0x7027, 0x0000, 0x0005, 0x0076, 0x0066, 0x0056,
-	0x0046, 0x0036, 0x0026, 0x8aff, 0x0904, 0x1e68, 0x700c, 0x7214,
-	0x923a, 0x7010, 0x7218, 0x9203, 0x0a04, 0x1e67, 0x9705, 0x0904,
-	0x1e67, 0x903e, 0x2730, 0xa880, 0xd0fc, 0x1190, 0x2d00, 0x0002,
-	0x1df1, 0x1d30, 0x1d30, 0x1df1, 0x1df1, 0x1dce, 0x1df1, 0x1d30,
-	0x1dd5, 0x1d7f, 0x1d7f, 0x1df1, 0x1df1, 0x1df1, 0x1dc8, 0x1d7f,
+	0x0004, 0x918c, 0x0700, 0x01a8, 0x080c, 0x7e3f, 0x080c, 0x1aab,
+	0x080c, 0xcb4a, 0x0158, 0xa9ac, 0xa936, 0xa9b0, 0xa93a, 0xa83f,
+	0xffff, 0xa843, 0xffff, 0xa880, 0xc0bd, 0xa882, 0x080c, 0xc77b,
+	0x0005, 0x6020, 0x9086, 0x0009, 0x1128, 0x2009, 0x004c, 0x080c,
+	0xaeec, 0x0048, 0x6010, 0x00b6, 0x2058, 0xb800, 0x00be, 0xd0bc,
+	0x6024, 0x190c, 0xcf34, 0x2029, 0x00c8, 0x8529, 0x0128, 0x2001,
+	0x0201, 0x2004, 0x9005, 0x0dc8, 0x7dbc, 0x080c, 0xe9e2, 0xd5a4,
+	0x1118, 0x080c, 0x157f, 0x0005, 0x080c, 0x7e3f, 0x080c, 0x1aab,
+	0x0005, 0x781f, 0x0300, 0x7803, 0x0001, 0x0005, 0x0016, 0x0066,
+	0x0076, 0x00f6, 0x2079, 0x0300, 0x7908, 0x918c, 0x0007, 0x9186,
+	0x0003, 0x0120, 0x2001, 0x0016, 0x080c, 0x15f0, 0x00fe, 0x007e,
+	0x006e, 0x001e, 0x0005, 0x7004, 0xc09d, 0x7006, 0x0005, 0x7104,
+	0x9184, 0x0004, 0x190c, 0x0dd5, 0xd184, 0x1189, 0xd19c, 0x0158,
+	0xc19c, 0x7106, 0x2001, 0x020d, 0x2003, 0x0050, 0x2003, 0x0020,
+	0x080c, 0x157f, 0x0005, 0x81ff, 0x190c, 0x0dd5, 0x0005, 0xc184,
+	0xd1b4, 0xc1b4, 0x7106, 0x0016, 0x00e6, 0x15f0, 0x2071, 0x0200,
+	0x080c, 0x16aa, 0x05c8, 0x6014, 0x9005, 0x05b0, 0x0096, 0x2048,
+	0xa864, 0x009e, 0x9084, 0x00ff, 0x908e, 0x0029, 0x0160, 0x908e,
+	0x0048, 0x1550, 0x601c, 0xd084, 0x11e0, 0x00f6, 0x2c78, 0x080c,
+	0x1727, 0x00fe, 0x00b0, 0x00f6, 0x2c78, 0x080c, 0x18ae, 0x00fe,
+	0x2009, 0x01f4, 0x8109, 0x0168, 0x2001, 0x0201, 0x2004, 0x9005,
+	0x0dc8, 0x2001, 0x0218, 0x2004, 0xd0ec, 0x1118, 0x080c, 0x157f,
+	0x0040, 0x2001, 0x020d, 0x2003, 0x0020, 0x080c, 0x1313, 0x7803,
+	0x0001, 0x00ee, 0x001e, 0x0005, 0x2001, 0x020d, 0x2003, 0x0050,
+	0x2003, 0x0020, 0x0461, 0x0ca8, 0x0429, 0x2060, 0x2009, 0x0053,
+	0x080c, 0xaeec, 0x0005, 0x0005, 0x0005, 0x00e1, 0x2008, 0x00d1,
+	0x0006, 0x7004, 0xc09d, 0x7006, 0x000e, 0x080c, 0x8d52, 0x0005,
+	0x0089, 0x9005, 0x0118, 0x080c, 0x8955, 0x0cd0, 0x0005, 0x2001,
+	0x0036, 0x2009, 0x1820, 0x210c, 0x2011, 0x181f, 0x2214, 0x080c,
+	0x15f0, 0x0005, 0x7808, 0xd09c, 0x0de8, 0x7820, 0x0005, 0x080c,
+	0x14d6, 0x00d6, 0x2069, 0x0200, 0x2009, 0x01f4, 0x8109, 0x0510,
+	0x6804, 0x9005, 0x0dd8, 0x2001, 0x015d, 0x2003, 0x0000, 0x79bc,
+	0xd1a4, 0x1528, 0x79b8, 0x918c, 0x0fff, 0x0180, 0x9182, 0x0841,
+	0x1268, 0x9188, 0x0007, 0x918c, 0x0ff8, 0x810c, 0x810c, 0x810c,
+	0x080c, 0x15e2, 0x6827, 0x0001, 0x8109, 0x1dd0, 0x04d9, 0x6827,
+	0x0002, 0x04c1, 0x6804, 0x9005, 0x1130, 0x682c, 0xd0e4, 0x1500,
+	0x6804, 0x9005, 0x0de8, 0x79b8, 0xd1ec, 0x1130, 0x08c0, 0x080c,
+	0x7e3f, 0x080c, 0x1aab, 0x0090, 0x7827, 0x0015, 0x782b, 0x0000,
+	0x7827, 0x0018, 0x782b, 0x0000, 0x2001, 0x020d, 0x2003, 0x0020,
+	0x2001, 0x0307, 0x2003, 0x0300, 0x7803, 0x0001, 0x00de, 0x0005,
+	0x682c, 0x9084, 0x5400, 0x9086, 0x5400, 0x0d30, 0x7827, 0x0015,
+	0x782b, 0x0000, 0x7803, 0x0001, 0x6800, 0x9085, 0x1800, 0x6802,
+	0x00de, 0x0005, 0x6824, 0x9084, 0x0003, 0x1de0, 0x0005, 0x2001,
+	0x0030, 0x2c08, 0x621c, 0x0021, 0x7830, 0x9086, 0x0041, 0x0005,
+	0x00f6, 0x2079, 0x0300, 0x0006, 0x7808, 0xd09c, 0x0140, 0x0016,
+	0x0026, 0x00c6, 0x080c, 0x1380, 0x00ce, 0x002e, 0x001e, 0x000e,
+	0x0006, 0x7832, 0x7936, 0x7a3a, 0x781b, 0x8080, 0x0059, 0x1118,
+	0x000e, 0x00fe, 0x0005, 0x000e, 0x792c, 0x3900, 0x8000, 0x2004,
+	0x080c, 0x0dd5, 0x2009, 0x180c, 0x2104, 0xc0f4, 0x200a, 0x2009,
+	0xff00, 0x8109, 0x0904, 0x166e, 0x7a18, 0x9284, 0x0030, 0x0904,
+	0x1669, 0x9284, 0x0048, 0x9086, 0x0008, 0x1904, 0x1669, 0x2001,
+	0x0109, 0x2004, 0xd08c, 0x01f0, 0x0006, 0x01c6, 0x01d6, 0x0136,
+	0x0146, 0x0156, 0x0126, 0x2091, 0x2800, 0x00f6, 0x0026, 0x0016,
+	0x2009, 0x1a7c, 0x2104, 0x8000, 0x0208, 0x200a, 0x080c, 0x908b,
+	0x001e, 0x002e, 0x00fe, 0x012e, 0x015e, 0x014e, 0x013e, 0x01de,
+	0x01ce, 0x000e, 0x2001, 0x009b, 0x2004, 0xd0fc, 0x01d0, 0x0006,
+	0x0126, 0x01c6, 0x01d6, 0x0136, 0x0146, 0x0156, 0x00f6, 0x0016,
+	0x2009, 0x1a7d, 0x2104, 0x8000, 0x0208, 0x200a, 0x080c, 0x1eb6,
+	0x001e, 0x00fe, 0x015e, 0x014e, 0x013e, 0x01de, 0x01ce, 0x012e,
+	0x000e, 0x7818, 0xd0bc, 0x1904, 0x1619, 0x0005, 0x2001, 0x180c,
+	0x2004, 0xd0f4, 0x1528, 0x7a18, 0x9284, 0x0030, 0x0508, 0x9284,
+	0x0048, 0x9086, 0x0008, 0x11e0, 0x2001, 0x19f5, 0x2004, 0x9005,
+	0x01b8, 0x2001, 0x1a65, 0x2004, 0x9086, 0x0000, 0x0188, 0x2009,
+	0x1a7b, 0x2104, 0x8000, 0x0208, 0x200a, 0x080c, 0xa2f8, 0x2009,
+	0x180c, 0x2104, 0xc0f5, 0x200a, 0x2009, 0xff00, 0x0804, 0x1619,
+	0x9085, 0x0001, 0x0005, 0x7832, 0x7936, 0x7a3a, 0x781b, 0x8080,
+	0x080c, 0x1612, 0x1108, 0x0005, 0x792c, 0x3900, 0x8000, 0x2004,
+	0x080c, 0x0dd5, 0x7037, 0x0001, 0x7150, 0x7037, 0x0002, 0x7050,
+	0x2060, 0xd1bc, 0x1110, 0x7054, 0x2060, 0x918c, 0xff00, 0x9186,
+	0x0500, 0x0110, 0x9085, 0x0001, 0x0005, 0x00e6, 0x0016, 0x2071,
+	0x0200, 0x0c41, 0x6124, 0xd1dc, 0x01f8, 0x701c, 0xd08c, 0x0904,
+	0x171c, 0x7017, 0x0000, 0x2001, 0x0264, 0x2004, 0xd0bc, 0x0904,
+	0x171c, 0x2001, 0x0268, 0x00c6, 0x2064, 0x6104, 0x6038, 0x00ce,
+	0x918e, 0x0039, 0x1904, 0x171c, 0x9c06, 0x15f0, 0x0126, 0x2091,
+	0x2600, 0x080c, 0x7d86, 0x012e, 0x7358, 0x745c, 0x6014, 0x905d,
+	0x0598, 0x2b48, 0x6010, 0x00b6, 0x2058, 0xb800, 0x00be, 0xd0bc,
+	0x190c, 0xcf0f, 0xab42, 0xac3e, 0x2001, 0x1869, 0x2004, 0xd0b4,
+	0x1170, 0x601c, 0xd0e4, 0x1158, 0x6010, 0x00b6, 0x2058, 0xb800,
+	0x00be, 0xd0bc, 0x1120, 0xa83b, 0x7fff, 0xa837, 0xffff, 0x080c,
+	0x20b2, 0x1190, 0x080c, 0x1909, 0x2a00, 0xa816, 0x0130, 0x2800,
+	0xa80e, 0x2c05, 0xa80a, 0x2c00, 0xa812, 0x7037, 0x0020, 0x781f,
+	0x0300, 0x001e, 0x00ee, 0x0005, 0x7037, 0x0050, 0x7037, 0x0020,
+	0x001e, 0x00ee, 0x080c, 0x157f, 0x0005, 0x080c, 0x0dd5, 0x2ff0,
+	0x0126, 0x2091, 0x2200, 0x00c6, 0x3e60, 0x6014, 0x2048, 0x2940,
+	0x903e, 0x2730, 0xa864, 0x2068, 0xa81a, 0x9d84, 0x000f, 0x9088,
+	0x2092, 0x2165, 0x0002, 0x1752, 0x17c0, 0x1752, 0x1752, 0x1756,
+	0x17a1, 0x1752, 0x1776, 0x174b, 0x17b7, 0x1752, 0x1752, 0x175b,
+	0x18ac, 0x178a, 0x1780, 0xa964, 0x918c, 0x00ff, 0x918e, 0x0048,
+	0x0904, 0x17b7, 0x9085, 0x0001, 0x0804, 0x18a3, 0xa87c, 0xd0ac,
+	0x0dc8, 0x0804, 0x17c7, 0xa87c, 0xd0ac, 0x0da0, 0x0804, 0x1832,
+	0xa898, 0x901d, 0x1108, 0xab9c, 0x9016, 0xaab2, 0xaa3e, 0xaa42,
+	0x3e00, 0x9080, 0x0008, 0x2004, 0x9080, 0x8f19, 0x2005, 0x9005,
+	0x090c, 0x0dd5, 0x2004, 0xa8ae, 0x0804, 0x188b, 0xa87c, 0xd0bc,
+	0x09c8, 0xa890, 0xa842, 0xa88c, 0xa83e, 0xa888, 0x0804, 0x17c7,
+	0xa87c, 0xd0bc, 0x0978, 0xa890, 0xa842, 0xa88c, 0xa83e, 0xa888,
+	0x0804, 0x1832, 0xa87c, 0xd0bc, 0x0928, 0xa890, 0xa842, 0xa88c,
+	0xa83e, 0xa804, 0x9045, 0x090c, 0x0dd5, 0xa164, 0xa91a, 0x91ec,
+	0x000f, 0x9d80, 0x2092, 0x2065, 0xa888, 0xd19c, 0x1904, 0x1832,
+	0x0430, 0xa87c, 0xd0ac, 0x0904, 0x1752, 0xa804, 0x9045, 0x090c,
+	0x0dd5, 0xa164, 0xa91a, 0x91ec, 0x000f, 0x9d80, 0x2092, 0x2065,
+	0x9006, 0xa842, 0xa83e, 0xd19c, 0x1904, 0x1832, 0x0080, 0xa87c,
+	0xd0ac, 0x0904, 0x1752, 0x9006, 0xa842, 0xa83e, 0x0804, 0x1832,
+	0xa87c, 0xd0ac, 0x0904, 0x1752, 0x9006, 0xa842, 0xa83e, 0x2c05,
+	0x908a, 0x0036, 0x1a0c, 0x0dd5, 0x9082, 0x001b, 0x0002, 0x17ea,
+	0x17ea, 0x17ec, 0x17ea, 0x17ea, 0x17ea, 0x17f6, 0x17ea, 0x17ea,
+	0x17ea, 0x1800, 0x17ea, 0x17ea, 0x17ea, 0x180a, 0x17ea, 0x17ea,
+	0x17ea, 0x1814, 0x17ea, 0x17ea, 0x17ea, 0x181e, 0x17ea, 0x17ea,
+	0x17ea, 0x1828, 0x080c, 0x0dd5, 0xa574, 0xa478, 0x9d86, 0x0024,
+	0x0904, 0x1760, 0xa37c, 0xa280, 0x0804, 0x188b, 0xa584, 0xa488,
+	0x9d86, 0x0024, 0x0904, 0x1760, 0xa38c, 0xa290, 0x0804, 0x188b,
+	0xa594, 0xa498, 0x9d86, 0x0024, 0x0904, 0x1760, 0xa39c, 0xa2a0,
+	0x0804, 0x188b, 0xa5a4, 0xa4a8, 0x9d86, 0x0024, 0x0904, 0x1760,
+	0xa3ac, 0xa2b0, 0x0804, 0x188b, 0xa5b4, 0xa4b8, 0x9d86, 0x0024,
+	0x0904, 0x1760, 0xa3bc, 0xa2c0, 0x0804, 0x188b, 0xa5c4, 0xa4c8,
+	0x9d86, 0x0024, 0x0904, 0x1760, 0xa3cc, 0xa2d0, 0x0804, 0x188b,
+	0xa5d4, 0xa4d8, 0x9d86, 0x0024, 0x0904, 0x1760, 0xa3dc, 0xa2e0,
+	0x0804, 0x188b, 0x2c05, 0x908a, 0x0034, 0x1a0c, 0x0dd5, 0x9082,
+	0x001b, 0x0002, 0x1855, 0x1853, 0x1853, 0x1853, 0x1853, 0x1853,
+	0x1860, 0x1853, 0x1853, 0x1853, 0x1853, 0x1853, 0x186b, 0x1853,
+	0x1853, 0x1853, 0x1853, 0x1853, 0x1876, 0x1853, 0x1853, 0x1853,
+	0x1853, 0x1853, 0x1881, 0x080c, 0x0dd5, 0xa56c, 0xa470, 0xa774,
+	0xa678, 0x9d86, 0x002c, 0x0904, 0x1760, 0xa37c, 0xa280, 0x0458,
+	0xa584, 0xa488, 0xa78c, 0xa690, 0x9d86, 0x002c, 0x0904, 0x1760,
+	0xa394, 0xa298, 0x0400, 0xa59c, 0xa4a0, 0xa7a4, 0xa6a8, 0x9d86,
+	0x002c, 0x0904, 0x1760, 0xa3ac, 0xa2b0, 0x00a8, 0xa5b4, 0xa4b8,
+	0xa7bc, 0xa6c0, 0x9d86, 0x002c, 0x0904, 0x1760, 0xa3c4, 0xa2c8,
+	0x0050, 0xa5cc, 0xa4d0, 0xa7d4, 0xa6d8, 0x9d86, 0x002c, 0x0904,
+	0x1760, 0xa3dc, 0xa2e0, 0xab2e, 0xaa32, 0xad1e, 0xac22, 0xaf26,
+	0xae2a, 0xa988, 0x8c60, 0x2c1d, 0xa8ac, 0xaab0, 0xa836, 0xaa3a,
+	0x8109, 0xa916, 0x1158, 0x3e60, 0x601c, 0xc085, 0x601e, 0xa87c,
+	0xc0dd, 0xa87e, 0x9006, 0x00ce, 0x012e, 0x0005, 0x2800, 0xa80e,
+	0xab0a, 0x2c00, 0xa812, 0x0c78, 0x0804, 0x1752, 0x2ff0, 0x0126,
+	0x2091, 0x2200, 0x00c6, 0x3e60, 0x6014, 0x2048, 0x2940, 0xa80e,
+	0x2061, 0x208d, 0xa813, 0x208d, 0x2c05, 0xa80a, 0xa964, 0xa91a,
+	0xa87c, 0xd0ac, 0x090c, 0x0dd5, 0x9006, 0xa842, 0xa83e, 0x2c05,
+	0x908a, 0x0034, 0x1a0c, 0x0dd5, 0xadcc, 0xacd0, 0xafd4, 0xaed8,
+	0xabdc, 0xaae0, 0xab2e, 0xaa32, 0xad1e, 0xac22, 0xaf26, 0xae2a,
+	0xa8ac, 0xaab0, 0xa836, 0xaa3a, 0xa988, 0xa864, 0x9084, 0x00ff,
+	0x9086, 0x0008, 0x1120, 0x8109, 0xa916, 0x0128, 0x0078, 0x918a,
+	0x0002, 0xa916, 0x1158, 0x3e60, 0x601c, 0xc085, 0x601e, 0xa87c,
+	0xc0dd, 0xa87e, 0x9006, 0x00ce, 0x012e, 0x0005, 0xa804, 0x9045,
+	0x090c, 0x0dd5, 0xa80e, 0xa064, 0xa81a, 0x9084, 0x000f, 0x9080,
+	0x2092, 0x2015, 0x82ff, 0x090c, 0x0dd5, 0xaa12, 0x2205, 0xa80a,
+	0x0c10, 0x903e, 0x2730, 0xa880, 0xd0fc, 0x1190, 0x2d00, 0x0002,
+	0x1a33, 0x1960, 0x1960, 0x1a33, 0x1960, 0x1a2d, 0x1a33, 0x1960,
+	0x19d0, 0x19d0, 0x19d0, 0x1a33, 0x19d0, 0x1a33, 0x1a2a, 0x19d0,
 	0xc0fc, 0xa882, 0xab2c, 0xaa30, 0xad1c, 0xac20, 0xdd9c, 0x0904,
-	0x1dfe, 0x2c05, 0x908a, 0x0034, 0x1a0c, 0x0dd5, 0x9082, 0x001b,
-	0x0002, 0x1d1c, 0x1d1a, 0x1d1a, 0x1d1a, 0x1d1a, 0x1d1a, 0x1d20,
-	0x1d1a, 0x1d1a, 0x1d1a, 0x1d1a, 0x1d1a, 0x1d24, 0x1d1a, 0x1d1a,
-	0x1d1a, 0x1d1a, 0x1d1a, 0x1d28, 0x1d1a, 0x1d1a, 0x1d1a, 0x1d1a,
-	0x1d1a, 0x1d2c, 0x080c, 0x0dd5, 0xa774, 0xa678, 0x0804, 0x1dfe,
-	0xa78c, 0xa690, 0x0804, 0x1dfe, 0xa7a4, 0xa6a8, 0x0804, 0x1dfe,
-	0xa7bc, 0xa6c0, 0x0804, 0x1dfe, 0xa7d4, 0xa6d8, 0x0804, 0x1dfe,
-	0x2c05, 0x908a, 0x0036, 0x1a0c, 0x0dd5, 0x9082, 0x001b, 0x0002,
-	0x1d53, 0x1d53, 0x1d55, 0x1d53, 0x1d53, 0x1d53, 0x1d5b, 0x1d53,
-	0x1d53, 0x1d53, 0x1d61, 0x1d53, 0x1d53, 0x1d53, 0x1d67, 0x1d53,
-	0x1d53, 0x1d53, 0x1d6d, 0x1d53, 0x1d53, 0x1d53, 0x1d73, 0x1d53,
-	0x1d53, 0x1d53, 0x1d79, 0x080c, 0x0dd5, 0xa574, 0xa478, 0xa37c,
-	0xa280, 0x0804, 0x1dfe, 0xa584, 0xa488, 0xa38c, 0xa290, 0x0804,
-	0x1dfe, 0xa594, 0xa498, 0xa39c, 0xa2a0, 0x0804, 0x1dfe, 0xa5a4,
-	0xa4a8, 0xa3ac, 0xa2b0, 0x0804, 0x1dfe, 0xa5b4, 0xa4b8, 0xa3bc,
-	0xa2c0, 0x0804, 0x1dfe, 0xa5c4, 0xa4c8, 0xa3cc, 0xa2d0, 0x0804,
-	0x1dfe, 0xa5d4, 0xa4d8, 0xa3dc, 0xa2e0, 0x0804, 0x1dfe, 0x2c05,
-	0x908a, 0x0034, 0x1a0c, 0x0dd5, 0x9082, 0x001b, 0x0002, 0x1da2,
-	0x1da0, 0x1da0, 0x1da0, 0x1da0, 0x1da0, 0x1daa, 0x1da0, 0x1da0,
-	0x1da0, 0x1da0, 0x1da0, 0x1db2, 0x1da0, 0x1da0, 0x1da0, 0x1da0,
-	0x1da0, 0x1dba, 0x1da0, 0x1da0, 0x1da0, 0x1da0, 0x1da0, 0x1dc1,
-	0x080c, 0x0dd5, 0xa56c, 0xa470, 0xa774, 0xa678, 0xa37c, 0xa280,
-	0x0804, 0x1dfe, 0xa584, 0xa488, 0xa78c, 0xa690, 0xa394, 0xa298,
-	0x0804, 0x1dfe, 0xa59c, 0xa4a0, 0xa7a4, 0xa6a8, 0xa3ac, 0xa2b0,
-	0x0804, 0x1dfe, 0xa5b4, 0xa4b8, 0xa7bc, 0xa6c0, 0xa3c4, 0xa2c8,
-	0x04e8, 0xa5cc, 0xa4d0, 0xa7d4, 0xa6d8, 0xa3dc, 0xa2e0, 0x04b0,
-	0xa864, 0x9084, 0x00ff, 0x9086, 0x001e, 0x1518, 0x080c, 0x2048,
-	0x1904, 0x1ccb, 0x900e, 0x0804, 0x1e68, 0xab64, 0x939c, 0x00ff,
-	0x9386, 0x0048, 0x1180, 0x00c6, 0x7004, 0x2060, 0x6004, 0x9086,
-	0x0043, 0x00ce, 0x0904, 0x1d7f, 0xab9c, 0x9016, 0xad8c, 0xac90,
-	0xaf94, 0xae98, 0x0098, 0x9386, 0x0008, 0x0904, 0x1d7f, 0x080c,
-	0x0dd5, 0xa964, 0x918c, 0x00ff, 0x9186, 0x0013, 0x0904, 0x1d30,
-	0x9186, 0x001b, 0x0904, 0x1d7f, 0x080c, 0x0dd5, 0x2009, 0x030f,
-	0x2104, 0xd0fc, 0x0530, 0x0066, 0x2009, 0x0306, 0x2104, 0x9084,
-	0x0030, 0x15c8, 0x2031, 0x1000, 0x200b, 0x4000, 0x2600, 0x9302,
-	0x928b, 0x0000, 0xa82e, 0xa932, 0x0278, 0x9105, 0x0168, 0x2011,
-	0x0000, 0x2618, 0x2600, 0x9500, 0xa81e, 0x9481, 0x0000, 0xa822,
-	0xa880, 0xc0fd, 0xa882, 0x0020, 0xa82f, 0x0000, 0xa833, 0x0000,
-	0x006e, 0x7b12, 0x7a16, 0x7d02, 0x7c06, 0x7f0a, 0x7e0e, 0x782b,
-	0x0001, 0x7000, 0x8000, 0x7002, 0xa83c, 0x9300, 0xa83e, 0xa840,
-	0x9201, 0xa842, 0x700c, 0x9300, 0x700e, 0x7010, 0x9201, 0x7012,
-	0x080c, 0x2048, 0x0428, 0x2031, 0x0080, 0x9584, 0x007f, 0x0108,
-	0x9632, 0x7124, 0x7000, 0x9086, 0x0000, 0x1198, 0xc185, 0x7126,
-	0x2009, 0x0306, 0x2104, 0xd0b4, 0x1904, 0x1e0e, 0x200b, 0x4040,
-	0x2009, 0x1a7f, 0x2104, 0x8000, 0x0a04, 0x1e0e, 0x200a, 0x0804,
-	0x1e0e, 0xc18d, 0x7126, 0xd184, 0x1d58, 0x0804, 0x1e0e, 0x9006,
-	0x002e, 0x003e, 0x004e, 0x005e, 0x006e, 0x007e, 0x0005, 0x080c,
-	0x0dd5, 0x0026, 0x2001, 0x0105, 0x2003, 0x0010, 0x782b, 0x0004,
-	0x7003, 0x0000, 0x7004, 0x0016, 0x080c, 0x1cbe, 0x001e, 0x2060,
-	0x6014, 0x2048, 0x080c, 0xcb35, 0x0118, 0xa880, 0xc0bd, 0xa882,
-	0x6020, 0x9086, 0x0006, 0x1180, 0x2061, 0x0100, 0x62c8, 0x2001,
-	0x00fa, 0x8001, 0x1df0, 0x60c8, 0x9206, 0x1dc0, 0x60c4, 0xa89a,
-	0x60c8, 0xa896, 0x7004, 0x2060, 0x00c6, 0x080c, 0xc768, 0x00ce,
-	0x2001, 0x19f6, 0x2004, 0x9c06, 0x1160, 0x2009, 0x0040, 0x080c,
-	0x23d2, 0x080c, 0xa7cc, 0x2011, 0x0000, 0x080c, 0xa65d, 0x080c,
-	0x97b9, 0x002e, 0x0804, 0x1ff8, 0x0126, 0x2091, 0x2400, 0xa858,
-	0x2040, 0x792c, 0x782b, 0x0002, 0x9184, 0x0700, 0x1904, 0x1e71,
-	0x7000, 0x0002, 0x1ff8, 0x1ec6, 0x1f46, 0x1ff6, 0x8001, 0x7002,
-	0x7027, 0x0000, 0xd19c, 0x1158, 0x8aff, 0x0904, 0x1f13, 0x080c,
-	0x1cc5, 0x0904, 0x1ff8, 0x080c, 0x1cc5, 0x0804, 0x1ff8, 0x782b,
-	0x0004, 0xd194, 0x0148, 0xa880, 0xc0fc, 0xa882, 0x8aff, 0x1518,
-	0xa87c, 0xc0f5, 0xa87e, 0x00f8, 0x0026, 0x0036, 0xab3c, 0xaa40,
-	0x0016, 0x7910, 0xa82c, 0x9100, 0xa82e, 0x7914, 0xa830, 0x9101,
-	0xa832, 0x001e, 0x7810, 0x931a, 0x7814, 0x9213, 0x7800, 0xa81e,
-	0x7804, 0xa822, 0xab3e, 0xaa42, 0x003e, 0x002e, 0x080c, 0x2063,
-	0xa880, 0xc0fd, 0xa882, 0x2a00, 0xa816, 0x2800, 0xa85a, 0x2c00,
-	0xa812, 0x7003, 0x0000, 0x2009, 0x0306, 0x200b, 0x4800, 0x7027,
-	0x0000, 0x0804, 0x1ff8, 0x00f6, 0x0026, 0x781c, 0x0006, 0x7818,
-	0x0006, 0x2079, 0x0100, 0x7a14, 0x9284, 0x1984, 0x9085, 0x0012,
-	0x7816, 0x0036, 0x2019, 0x1000, 0x8319, 0x090c, 0x0dd5, 0x7820,
-	0xd0bc, 0x1dd0, 0x003e, 0x79c8, 0x000e, 0x9102, 0x001e, 0x0006,
-	0x0016, 0x79c4, 0x000e, 0x9103, 0x78c6, 0x000e, 0x78ca, 0x9284,
-	0x1984, 0x9085, 0x0012, 0x7816, 0x002e, 0x00fe, 0x782b, 0x0008,
-	0x7003, 0x0000, 0x080c, 0x1cbe, 0x0804, 0x1ff8, 0x8001, 0x7002,
-	0x7024, 0x8004, 0x7026, 0xd194, 0x0170, 0x782c, 0xd0fc, 0x1904,
-	0x1eb9, 0xd19c, 0x1904, 0x1ff4, 0x8aff, 0x0904, 0x1ff8, 0x080c,
-	0x1cc5, 0x0804, 0x1ff8, 0x0026, 0x0036, 0xab3c, 0xaa40, 0x080c,
-	0x2063, 0xdd9c, 0x1904, 0x1fb3, 0x2c05, 0x908a, 0x0036, 0x1a0c,
-	0x0dd5, 0x9082, 0x001b, 0x0002, 0x1f87, 0x1f87, 0x1f89, 0x1f87,
-	0x1f87, 0x1f87, 0x1f8f, 0x1f87, 0x1f87, 0x1f87, 0x1f95, 0x1f87,
-	0x1f87, 0x1f87, 0x1f9b, 0x1f87, 0x1f87, 0x1f87, 0x1fa1, 0x1f87,
-	0x1f87, 0x1f87, 0x1fa7, 0x1f87, 0x1f87, 0x1f87, 0x1fad, 0x080c,
-	0x0dd5, 0xa07c, 0x931a, 0xa080, 0x9213, 0x0804, 0x1ee8, 0xa08c,
-	0x931a, 0xa090, 0x9213, 0x0804, 0x1ee8, 0xa09c, 0x931a, 0xa0a0,
-	0x9213, 0x0804, 0x1ee8, 0xa0ac, 0x931a, 0xa0b0, 0x9213, 0x0804,
-	0x1ee8, 0xa0bc, 0x931a, 0xa0c0, 0x9213, 0x0804, 0x1ee8, 0xa0cc,
-	0x931a, 0xa0d0, 0x9213, 0x0804, 0x1ee8, 0xa0dc, 0x931a, 0xa0e0,
-	0x9213, 0x0804, 0x1ee8, 0x2c05, 0x908a, 0x0034, 0x1a0c, 0x0dd5,
-	0x9082, 0x001b, 0x0002, 0x1fd6, 0x1fd4, 0x1fd4, 0x1fd4, 0x1fd4,
-	0x1fd4, 0x1fdc, 0x1fd4, 0x1fd4, 0x1fd4, 0x1fd4, 0x1fd4, 0x1fe2,
-	0x1fd4, 0x1fd4, 0x1fd4, 0x1fd4, 0x1fd4, 0x1fe8, 0x1fd4, 0x1fd4,
-	0x1fd4, 0x1fd4, 0x1fd4, 0x1fee, 0x080c, 0x0dd5, 0xa07c, 0x931a,
-	0xa080, 0x9213, 0x0804, 0x1ee8, 0xa094, 0x931a, 0xa098, 0x9213,
-	0x0804, 0x1ee8, 0xa0ac, 0x931a, 0xa0b0, 0x9213, 0x0804, 0x1ee8,
-	0xa0c4, 0x931a, 0xa0c8, 0x9213, 0x0804, 0x1ee8, 0xa0dc, 0x931a,
-	0xa0e0, 0x9213, 0x0804, 0x1ee8, 0x0804, 0x1ee4, 0x080c, 0x0dd5,
-	0x012e, 0x0005, 0x00f6, 0x00e6, 0x2071, 0x1a66, 0x7000, 0x9086,
-	0x0000, 0x0904, 0x2043, 0x2079, 0x0090, 0x2009, 0x0207, 0x210c,
-	0xd194, 0x01b8, 0x2009, 0x020c, 0x210c, 0x9184, 0x0003, 0x0188,
-	0x080c, 0xea0a, 0x2001, 0x0133, 0x2004, 0x9005, 0x090c, 0x0dd5,
-	0x0016, 0x2009, 0x0040, 0x080c, 0x23d2, 0x001e, 0x2001, 0x020c,
-	0x2102, 0x2009, 0x0206, 0x2104, 0x2009, 0x0203, 0x210c, 0x9106,
-	0x1120, 0x2009, 0x0040, 0x080c, 0x23d2, 0x782c, 0xd0fc, 0x09a8,
-	0x080c, 0x1eb4, 0x7000, 0x9086, 0x0000, 0x1978, 0x782b, 0x0004,
-	0x782c, 0xd0ac, 0x1de8, 0x2009, 0x0040, 0x080c, 0x23d2, 0x782b,
-	0x0002, 0x7003, 0x0000, 0x080c, 0x1cbe, 0x00ee, 0x00fe, 0x0005,
-	0xa880, 0xd0fc, 0x11a8, 0x8c60, 0x2c05, 0x9005, 0x0110, 0x8a51,
-	0x0005, 0xa004, 0x9005, 0x0168, 0xa85a, 0x2040, 0xa064, 0x9084,
-	0x000f, 0x9080, 0x2090, 0x2065, 0x8cff, 0x090c, 0x0dd5, 0x8a51,
-	0x0005, 0x2050, 0x0005, 0xa880, 0xd0fc, 0x11b8, 0x8a50, 0x8c61,
-	0x2c05, 0x9005, 0x1190, 0x2800, 0x9906, 0x0120, 0xa000, 0x9005,
-	0x1108, 0x2900, 0x2040, 0xa85a, 0xa064, 0x9084, 0x000f, 0x9080,
-	0x20a0, 0x2065, 0x8cff, 0x090c, 0x0dd5, 0x0005, 0x0000, 0x001d,
-	0x0021, 0x0025, 0x0029, 0x002d, 0x0031, 0x0035, 0x0000, 0x001b,
-	0x0021, 0x0027, 0x002d, 0x0033, 0x0000, 0x0000, 0x0023, 0x0000,
-	0x0000, 0x2083, 0x207f, 0x2083, 0x2083, 0x208d, 0x0000, 0x2083,
-	0x208a, 0x208a, 0x2087, 0x208a, 0x208a, 0x0000, 0x208d, 0x208a,
-	0x0000, 0x2085, 0x2085, 0x0000, 0x2085, 0x208d, 0x0000, 0x2085,
-	0x208b, 0x208b, 0x208b, 0x0000, 0x208b, 0x0000, 0x208d, 0x208b,
-	0x00c6, 0x00d6, 0x0086, 0xab42, 0xac3e, 0xa888, 0x9055, 0x0904,
-	0x228f, 0x2940, 0xa064, 0x90ec, 0x000f, 0x9084, 0x00ff, 0x9086,
-	0x0008, 0x1118, 0x2061, 0x208b, 0x00d0, 0x9de0, 0x2090, 0x9d86,
-	0x0007, 0x0130, 0x9d86, 0x000e, 0x0118, 0x9d86, 0x000f, 0x1120,
-	0xa08c, 0x9422, 0xa090, 0x931b, 0x2c05, 0x9065, 0x1140, 0x0310,
-	0x0804, 0x228f, 0xa004, 0x9045, 0x0904, 0x228f, 0x08d8, 0x2c05,
-	0x9005, 0x0904, 0x2177, 0xdd9c, 0x1904, 0x2133, 0x908a, 0x0036,
-	0x1a0c, 0x0dd5, 0x9082, 0x001b, 0x0002, 0x2108, 0x2108, 0x210a,
-	0x2108, 0x2108, 0x2108, 0x2110, 0x2108, 0x2108, 0x2108, 0x2116,
-	0x2108, 0x2108, 0x2108, 0x211c, 0x2108, 0x2108, 0x2108, 0x2122,
-	0x2108, 0x2108, 0x2108, 0x2128, 0x2108, 0x2108, 0x2108, 0x212e,
-	0x080c, 0x0dd5, 0xa07c, 0x9422, 0xa080, 0x931b, 0x0804, 0x216d,
-	0xa08c, 0x9422, 0xa090, 0x931b, 0x0804, 0x216d, 0xa09c, 0x9422,
-	0xa0a0, 0x931b, 0x0804, 0x216d, 0xa0ac, 0x9422, 0xa0b0, 0x931b,
-	0x0804, 0x216d, 0xa0bc, 0x9422, 0xa0c0, 0x931b, 0x0804, 0x216d,
-	0xa0cc, 0x9422, 0xa0d0, 0x931b, 0x0804, 0x216d, 0xa0dc, 0x9422,
-	0xa0e0, 0x931b, 0x04d0, 0x908a, 0x0034, 0x1a0c, 0x0dd5, 0x9082,
-	0x001b, 0x0002, 0x2155, 0x2153, 0x2153, 0x2153, 0x2153, 0x2153,
-	0x215a, 0x2153, 0x2153, 0x2153, 0x2153, 0x2153, 0x215f, 0x2153,
-	0x2153, 0x2153, 0x2153, 0x2153, 0x2164, 0x2153, 0x2153, 0x2153,
-	0x2153, 0x2153, 0x2169, 0x080c, 0x0dd5, 0xa07c, 0x9422, 0xa080,
-	0x931b, 0x0098, 0xa094, 0x9422, 0xa098, 0x931b, 0x0070, 0xa0ac,
-	0x9422, 0xa0b0, 0x931b, 0x0048, 0xa0c4, 0x9422, 0xa0c8, 0x931b,
-	0x0020, 0xa0dc, 0x9422, 0xa0e0, 0x931b, 0x0630, 0x2300, 0x9405,
-	0x0160, 0x8a51, 0x0904, 0x228f, 0x8c60, 0x0804, 0x20df, 0xa004,
-	0x9045, 0x0904, 0x228f, 0x0804, 0x20ba, 0x8a51, 0x0904, 0x228f,
-	0x8c60, 0x2c05, 0x9005, 0x1158, 0xa004, 0x9045, 0x0904, 0x228f,
-	0xa064, 0x90ec, 0x000f, 0x9de0, 0x2090, 0x2c05, 0x2060, 0xa880,
-	0xc0fc, 0xa882, 0x0804, 0x2284, 0x2c05, 0x8422, 0x8420, 0x831a,
-	0x9399, 0x0000, 0xac2e, 0xab32, 0xdd9c, 0x1904, 0x2221, 0x9082,
-	0x001b, 0x0002, 0x21bd, 0x21bd, 0x21bf, 0x21bd, 0x21bd, 0x21bd,
-	0x21cd, 0x21bd, 0x21bd, 0x21bd, 0x21db, 0x21bd, 0x21bd, 0x21bd,
-	0x21e9, 0x21bd, 0x21bd, 0x21bd, 0x21f7, 0x21bd, 0x21bd, 0x21bd,
-	0x2205, 0x21bd, 0x21bd, 0x21bd, 0x2213, 0x080c, 0x0dd5, 0xa17c,
-	0x2400, 0x9122, 0xa180, 0x2300, 0x911b, 0x0a0c, 0x0dd5, 0xa074,
-	0x9420, 0xa078, 0x9319, 0x0804, 0x227f, 0xa18c, 0x2400, 0x9122,
-	0xa190, 0x2300, 0x911b, 0x0a0c, 0x0dd5, 0xa084, 0x9420, 0xa088,
-	0x9319, 0x0804, 0x227f, 0xa19c, 0x2400, 0x9122, 0xa1a0, 0x2300,
-	0x911b, 0x0a0c, 0x0dd5, 0xa094, 0x9420, 0xa098, 0x9319, 0x0804,
-	0x227f, 0xa1ac, 0x2400, 0x9122, 0xa1b0, 0x2300, 0x911b, 0x0a0c,
-	0x0dd5, 0xa0a4, 0x9420, 0xa0a8, 0x9319, 0x0804, 0x227f, 0xa1bc,
-	0x2400, 0x9122, 0xa1c0, 0x2300, 0x911b, 0x0a0c, 0x0dd5, 0xa0b4,
-	0x9420, 0xa0b8, 0x9319, 0x0804, 0x227f, 0xa1cc, 0x2400, 0x9122,
-	0xa1d0, 0x2300, 0x911b, 0x0a0c, 0x0dd5, 0xa0c4, 0x9420, 0xa0c8,
-	0x9319, 0x0804, 0x227f, 0xa1dc, 0x2400, 0x9122, 0xa1e0, 0x2300,
-	0x911b, 0x0a0c, 0x0dd5, 0xa0d4, 0x9420, 0xa0d8, 0x9319, 0x0804,
-	0x227f, 0x9082, 0x001b, 0x0002, 0x223f, 0x223d, 0x223d, 0x223d,
-	0x223d, 0x223d, 0x224c, 0x223d, 0x223d, 0x223d, 0x223d, 0x223d,
-	0x2259, 0x223d, 0x223d, 0x223d, 0x223d, 0x223d, 0x2266, 0x223d,
-	0x223d, 0x223d, 0x223d, 0x223d, 0x2273, 0x080c, 0x0dd5, 0xa17c,
-	0x2400, 0x9122, 0xa180, 0x2300, 0x911b, 0x0a0c, 0x0dd5, 0xa06c,
-	0x9420, 0xa070, 0x9319, 0x0498, 0xa194, 0x2400, 0x9122, 0xa198,
-	0x2300, 0x911b, 0x0a0c, 0x0dd5, 0xa084, 0x9420, 0xa088, 0x9319,
-	0x0430, 0xa1ac, 0x2400, 0x9122, 0xa1b0, 0x2300, 0x911b, 0x0a0c,
-	0x0dd5, 0xa09c, 0x9420, 0xa0a0, 0x9319, 0x00c8, 0xa1c4, 0x2400,
-	0x9122, 0xa1c8, 0x2300, 0x911b, 0x0a0c, 0x0dd5, 0xa0b4, 0x9420,
-	0xa0b8, 0x9319, 0x0060, 0xa1dc, 0x2400, 0x9122, 0xa1e0, 0x2300,
-	0x911b, 0x0a0c, 0x0dd5, 0xa0cc, 0x9420, 0xa0d0, 0x9319, 0xac1e,
-	0xab22, 0xa880, 0xc0fd, 0xa882, 0x2800, 0xa85a, 0x2c00, 0xa812,
-	0x2a00, 0xa816, 0x000e, 0x000e, 0x000e, 0x9006, 0x0028, 0x008e,
-	0x00de, 0x00ce, 0x9085, 0x0001, 0x0005, 0x2001, 0x0005, 0x2004,
-	0xd0bc, 0x190c, 0x0dce, 0x9084, 0x0007, 0x0002, 0x22b0, 0x1eb4,
-	0x22b0, 0x22a6, 0x22a9, 0x22ac, 0x22a9, 0x22ac, 0x080c, 0x1eb4,
-	0x0005, 0x080c, 0x11a3, 0x0005, 0x080c, 0x1eb4, 0x080c, 0x11a3,
-	0x0005, 0x0126, 0x2091, 0x2600, 0x2079, 0x0200, 0x2071, 0x0260,
-	0x2069, 0x1800, 0x7817, 0x0000, 0x789b, 0x0814, 0x78a3, 0x0406,
-	0x789f, 0x0410, 0x2009, 0x013b, 0x200b, 0x0400, 0x781b, 0x0002,
-	0x783b, 0x001f, 0x7837, 0x0020, 0x7803, 0x1600, 0x012e, 0x0005,
-	0x2091, 0x2600, 0x781c, 0xd0a4, 0x190c, 0x23cf, 0x7900, 0xd1dc,
-	0x1118, 0x9084, 0x0006, 0x001a, 0x9084, 0x000e, 0x0002, 0x22f7,
-	0x22ef, 0x7d9d, 0x22ef, 0x22f1, 0x22f1, 0x22f1, 0x22f1, 0x7d83,
-	0x22ef, 0x22f3, 0x22ef, 0x22f1, 0x22ef, 0x22f1, 0x22ef, 0x080c,
-	0x0dd5, 0x0031, 0x0020, 0x080c, 0x7d83, 0x080c, 0x7d9d, 0x0005,
-	0x0006, 0x0016, 0x0026, 0x080c, 0xea0a, 0x7930, 0x9184, 0x0003,
-	0x01c0, 0x2001, 0x19f6, 0x2004, 0x9005, 0x0170, 0x2001, 0x0133,
-	0x2004, 0x9005, 0x090c, 0x0dd5, 0x00c6, 0x2001, 0x19f6, 0x2064,
-	0x080c, 0xc768, 0x00ce, 0x00f8, 0x2009, 0x0040, 0x080c, 0x23d2,
-	0x00d0, 0x9184, 0x0014, 0x01a0, 0x6a00, 0x9286, 0x0003, 0x0160,
-	0x080c, 0x73bc, 0x1138, 0x080c, 0x76a4, 0x080c, 0x601a, 0x080c,
-	0x72ee, 0x0010, 0x080c, 0x5ed9, 0x080c, 0x7e4c, 0x0041, 0x0018,
-	0x9184, 0x9540, 0x1dc8, 0x002e, 0x001e, 0x000e, 0x0005, 0x00e6,
-	0x0036, 0x0046, 0x0056, 0x2071, 0x1a62, 0x080c, 0x1aa9, 0x005e,
-	0x004e, 0x003e, 0x00ee, 0x0005, 0x0126, 0x2091, 0x2e00, 0x2071,
-	0x1800, 0x7128, 0x2001, 0x196f, 0x2102, 0x2001, 0x1977, 0x2102,
-	0x2001, 0x013b, 0x2102, 0x2079, 0x0200, 0x2001, 0x0201, 0x789e,
-	0x78a3, 0x0200, 0x9198, 0x0007, 0x831c, 0x831c, 0x831c, 0x9398,
-	0x0005, 0x2320, 0x9182, 0x0204, 0x1230, 0x2011, 0x0008, 0x8423,
-	0x8423, 0x8423, 0x0488, 0x9182, 0x024c, 0x1240, 0x2011, 0x0007,
-	0x8403, 0x8003, 0x9400, 0x9400, 0x9420, 0x0430, 0x9182, 0x02bc,
-	0x1238, 0x2011, 0x0006, 0x8403, 0x8003, 0x9400, 0x9420, 0x00e0,
-	0x9182, 0x034c, 0x1230, 0x2011, 0x0005, 0x8403, 0x8003, 0x9420,
-	0x0098, 0x9182, 0x042c, 0x1228, 0x2011, 0x0004, 0x8423, 0x8423,
-	0x0058, 0x9182, 0x059c, 0x1228, 0x2011, 0x0003, 0x8403, 0x9420,
-	0x0018, 0x2011, 0x0002, 0x8423, 0x9482, 0x0228, 0x8002, 0x8020,
-	0x8301, 0x9402, 0x0110, 0x0208, 0x8321, 0x8217, 0x8203, 0x9405,
-	0x789a, 0x012e, 0x0005, 0x0006, 0x00d6, 0x2069, 0x0200, 0x6814,
-	0x9084, 0xffc0, 0x910d, 0x6916, 0x00de, 0x000e, 0x0005, 0x00d6,
-	0x2069, 0x0200, 0x9005, 0x6810, 0x0110, 0xc0a5, 0x0008, 0xc0a4,
-	0x6812, 0x00de, 0x0005, 0x0006, 0x00d6, 0x2069, 0x0200, 0x6810,
-	0x9084, 0xfff8, 0x910d, 0x6912, 0x00de, 0x000e, 0x0005, 0x7938,
-	0x080c, 0x0dce, 0x00f6, 0x2079, 0x0200, 0x7902, 0xa001, 0xa001,
-	0xa001, 0xa001, 0xa001, 0xa001, 0x7902, 0xa001, 0xa001, 0xa001,
-	0xa001, 0xa001, 0xa001, 0x00fe, 0x0005, 0x0126, 0x2091, 0x2800,
-	0x2061, 0x0100, 0x2071, 0x1800, 0x2009, 0x0000, 0x080c, 0x2c3e,
-	0x080c, 0x2b59, 0x6054, 0x8004, 0x8004, 0x8004, 0x8004, 0x9084,
-	0x000c, 0x6150, 0x918c, 0xfff3, 0x9105, 0x6052, 0x6050, 0x9084,
-	0xb17f, 0x9085, 0x2000, 0x6052, 0x2009, 0x199d, 0x2011, 0x199e,
-	0x6358, 0x939c, 0x38f0, 0x2320, 0x080c, 0x2b9d, 0x1238, 0x939d,
-	0x4003, 0x94a5, 0x8603, 0x230a, 0x2412, 0x0030, 0x939d, 0x0203,
-	0x94a5, 0x8603, 0x230a, 0x2412, 0x9006, 0x080c, 0x2b88, 0x9006,
-	0x080c, 0x2b6b, 0x20a9, 0x0012, 0x1d04, 0x2424, 0x2091, 0x6000,
-	0x1f04, 0x2424, 0x602f, 0x0100, 0x602f, 0x0000, 0x6050, 0x9085,
-	0x0400, 0x9084, 0xdfff, 0x6052, 0x6024, 0x6026, 0x080c, 0x2877,
-	0x2009, 0x00ef, 0x6132, 0x6136, 0x080c, 0x2887, 0x60e7, 0x0000,
-	0x61ea, 0x60e3, 0x0008, 0x604b, 0xf7f7, 0x6043, 0x0000, 0x602f,
-	0x0080, 0x602f, 0x0000, 0x6007, 0x349f, 0x60bb, 0x0000, 0x20a9,
-	0x0018, 0x60bf, 0x0000, 0x1f04, 0x2451, 0x60bb, 0x0000, 0x60bf,
-	0x0108, 0x60bf, 0x0012, 0x60bf, 0x0405, 0x60bf, 0x0014, 0x60bf,
-	0x0320, 0x60bf, 0x0018, 0x601b, 0x00f0, 0x601f, 0x001e, 0x600f,
-	0x006b, 0x602b, 0x402f, 0x012e, 0x0005, 0x00f6, 0x2079, 0x0140,
-	0x78c3, 0x0080, 0x78c3, 0x0083, 0x78c3, 0x0000, 0x00fe, 0x0005,
-	0x2001, 0x1835, 0x2003, 0x0000, 0x2001, 0x1834, 0x2003, 0x0001,
-	0x0005, 0x0126, 0x2091, 0x2800, 0x0006, 0x0016, 0x0026, 0x6124,
-	0x0066, 0x2031, 0x1837, 0x2634, 0x96b4, 0x0028, 0x006e, 0x1138,
-	0x6020, 0xd1bc, 0x0120, 0xd0bc, 0x1168, 0xd0b4, 0x1198, 0x9184,
-	0x5e2c, 0x1118, 0x9184, 0x0007, 0x00aa, 0x9195, 0x0004, 0x9284,
-	0x0007, 0x0082, 0x0016, 0x2001, 0x188b, 0x200c, 0xd184, 0x001e,
-	0x0d70, 0x0c98, 0x0016, 0x2001, 0x188b, 0x200c, 0xd194, 0x001e,
-	0x0d30, 0x0c58, 0x24d4, 0x24ba, 0x24bd, 0x24c0, 0x24c5, 0x24c7,
-	0x24cb, 0x24cf, 0x080c, 0x8fd5, 0x00b8, 0x080c, 0x90a2, 0x00a0,
-	0x080c, 0x90a2, 0x080c, 0x8fd5, 0x0078, 0x0099, 0x0068, 0x080c,
-	0x8fd5, 0x0079, 0x0048, 0x080c, 0x90a2, 0x0059, 0x0028, 0x080c,
-	0x90a2, 0x080c, 0x8fd5, 0x0029, 0x002e, 0x001e, 0x000e, 0x012e,
-	0x0005, 0x00a6, 0x6124, 0x6028, 0xd09c, 0x0118, 0xd19c, 0x1904,
-	0x273c, 0xd1f4, 0x190c, 0x0dce, 0x080c, 0x73bc, 0x0904, 0x252f,
-	0x080c, 0xd230, 0x1120, 0x7000, 0x9086, 0x0003, 0x0570, 0x6024,
-	0x9084, 0x1800, 0x0550, 0x080c, 0x73df, 0x0118, 0x080c, 0x73cd,
-	0x1520, 0x6027, 0x0020, 0x6043, 0x0000, 0x080c, 0xd230, 0x0168,
-	0x080c, 0x73df, 0x1150, 0x2001, 0x19a7, 0x2003, 0x0001, 0x6027,
-	0x1800, 0x080c, 0x7252, 0x0804, 0x273f, 0x70a4, 0x9005, 0x1150,
-	0x70a7, 0x0001, 0x00d6, 0x2069, 0x0140, 0x080c, 0x7413, 0x00de,
-	0x1904, 0x273f, 0x080c, 0x76ae, 0x0428, 0x080c, 0x73df, 0x1590,
-	0x6024, 0x9084, 0x1800, 0x1108, 0x0468, 0x080c, 0x76ae, 0x080c,
-	0x76a4, 0x080c, 0x601a, 0x080c, 0x72ee, 0x0804, 0x273c, 0xd1ac,
-	0x1508, 0x6024, 0xd0dc, 0x1170, 0xd0e4, 0x1178, 0xd0d4, 0x1190,
-	0xd0cc, 0x0130, 0x7098, 0x9086, 0x0028, 0x1110, 0x080c, 0x7591,
-	0x0804, 0x273c, 0x080c, 0x76a9, 0x0048, 0x2001, 0x197d, 0x2003,
-	0x0002, 0x0020, 0x080c, 0x74f6, 0x0804, 0x273c, 0x080c, 0x762c,
-	0x0804, 0x273c, 0x6220, 0xd1bc, 0x0138, 0xd2bc, 0x1904, 0x27af,
-	0xd2b4, 0x1904, 0x27c2, 0x0000, 0xd1ac, 0x0904, 0x2651, 0x0036,
-	0x6328, 0xc3bc, 0x632a, 0x003e, 0x080c, 0x73bc, 0x11c0, 0x6027,
-	0x0020, 0x0006, 0x0026, 0x0036, 0x080c, 0x73d6, 0x1158, 0x080c,
-	0x76a4, 0x080c, 0x601a, 0x080c, 0x72ee, 0x003e, 0x002e, 0x000e,
-	0x00ae, 0x0005, 0x003e, 0x002e, 0x000e, 0x080c, 0x7394, 0x0016,
-	0x0046, 0x00c6, 0x644c, 0x9486, 0xf0f0, 0x1138, 0x2061, 0x0100,
-	0x644a, 0x6043, 0x0090, 0x6043, 0x0010, 0x74da, 0x948c, 0xff00,
-	0x7038, 0xd084, 0x0178, 0x9186, 0xf800, 0x1160, 0x7048, 0xd084,
-	0x1148, 0xc085, 0x704a, 0x0036, 0x2418, 0x2011, 0x8016, 0x080c,
-	0x4b04, 0x003e, 0x080c, 0xd229, 0x1904, 0x262e, 0x9196, 0xff00,
-	0x05a8, 0x7060, 0x9084, 0x00ff, 0x810f, 0x81ff, 0x0110, 0x9116,
-	0x0568, 0x7130, 0xd184, 0x1550, 0x080c, 0x3319, 0x0128, 0xc18d,
-	0x7132, 0x080c, 0x696a, 0x1510, 0x6240, 0x9294, 0x0010, 0x0130,
-	0x6248, 0x9294, 0xff00, 0x9296, 0xff00, 0x01c0, 0x7030, 0xd08c,
-	0x0904, 0x262e, 0x7038, 0xd08c, 0x1140, 0x2001, 0x180c, 0x200c,
-	0xd1ac, 0x1904, 0x262e, 0xc1ad, 0x2102, 0x0036, 0x73d8, 0x2011,
-	0x8013, 0x080c, 0x4b04, 0x003e, 0x0804, 0x262e, 0x7038, 0xd08c,
-	0x1140, 0x2001, 0x180c, 0x200c, 0xd1ac, 0x1904, 0x262e, 0xc1ad,
-	0x2102, 0x0036, 0x73d8, 0x2011, 0x8013, 0x080c, 0x4b04, 0x003e,
-	0x7130, 0xc185, 0x7132, 0x2011, 0x1848, 0x220c, 0xd1a4, 0x01f0,
-	0x0016, 0x2009, 0x0001, 0x2011, 0x0100, 0x080c, 0x86dd, 0x2019,
-	0x000e, 0x00c6, 0x2061, 0x0000, 0x080c, 0xe522, 0x00ce, 0x9484,
-	0x00ff, 0x9080, 0x3325, 0x200d, 0x918c, 0xff00, 0x810f, 0x2120,
-	0x9006, 0x2009, 0x000e, 0x080c, 0xe5ae, 0x001e, 0x0016, 0x2009,
-	0x0002, 0x2019, 0x0004, 0x080c, 0x318a, 0x001e, 0x0078, 0x0156,
-	0x00b6, 0x20a9, 0x007f, 0x900e, 0x080c, 0x65ff, 0x1110, 0x080c,
-	0x6034, 0x8108, 0x1f04, 0x2624, 0x00be, 0x015e, 0x00ce, 0x004e,
-	0x080c, 0xadd2, 0x60e3, 0x0000, 0x001e, 0x2001, 0x1800, 0x2014,
-	0x9296, 0x0004, 0x1170, 0xd19c, 0x11a0, 0x2011, 0x180c, 0x2214,
-	0xd29c, 0x1120, 0x6204, 0x9295, 0x0002, 0x6206, 0x6228, 0xc29d,
-	0x622a, 0x2003, 0x0001, 0x2001, 0x1826, 0x2003, 0x0000, 0x6027,
-	0x0020, 0xd194, 0x0904, 0x273c, 0x0016, 0x6220, 0xd2b4, 0x0904,
-	0x26d9, 0x080c, 0x8579, 0x080c, 0xa273, 0x6027, 0x0004, 0x00f6,
-	0x2019, 0x19f0, 0x2304, 0x907d, 0x0904, 0x26a8, 0x7804, 0x9086,
-	0x0032, 0x15f0, 0x00d6, 0x00c6, 0x00e6, 0x0096, 0x2069, 0x0140,
-	0x782c, 0x685e, 0x7808, 0x685a, 0x6043, 0x0002, 0x2001, 0x0003,
-	0x8001, 0x1df0, 0x6043, 0x0000, 0x2001, 0x003c, 0x8001, 0x1df0,
-	0x080c, 0x2cff, 0x2001, 0x001e, 0x8001, 0x0240, 0x20a9, 0x0009,
-	0x080c, 0x2c19, 0x6904, 0xd1dc, 0x1140, 0x0cb0, 0x2001, 0x0100,
-	0x080c, 0x2cef, 0x9006, 0x080c, 0x2cef, 0x080c, 0x9588, 0x080c,
-	0x968d, 0x7814, 0x2048, 0xa867, 0x0103, 0x2f60, 0x080c, 0xae61,
-	0x009e, 0x00ee, 0x00ce, 0x00de, 0x00fe, 0x001e, 0x00ae, 0x0005,
-	0x00fe, 0x00d6, 0x2069, 0x0140, 0x6804, 0x9084, 0x4000, 0x0110,
-	0x080c, 0x2cff, 0x00de, 0x00c6, 0x2061, 0x19e7, 0x6028, 0x080c,
-	0xd230, 0x0120, 0x909a, 0x0003, 0x1258, 0x0018, 0x909a, 0x00c8,
-	0x1238, 0x8000, 0x602a, 0x00ce, 0x080c, 0xa24f, 0x0804, 0x273b,
-	0x2061, 0x0100, 0x62c0, 0x080c, 0xac5d, 0x2019, 0x19f0, 0x2304,
-	0x9065, 0x0120, 0x2009, 0x0027, 0x080c, 0xaedc, 0x00ce, 0x0804,
-	0x273b, 0xd2bc, 0x0904, 0x2722, 0x080c, 0x8586, 0x6014, 0x9084,
-	0x1984, 0x9085, 0x0010, 0x6016, 0x6027, 0x0004, 0x00d6, 0x2069,
-	0x0140, 0x6804, 0x9084, 0x4000, 0x0110, 0x080c, 0x2cff, 0x00de,
-	0x00c6, 0x2061, 0x19e7, 0x6044, 0x080c, 0xd230, 0x0120, 0x909a,
-	0x0003, 0x1658, 0x0018, 0x909a, 0x00c8, 0x1638, 0x8000, 0x6046,
-	0x603c, 0x00ce, 0x9005, 0x05b8, 0x2009, 0x07d0, 0x080c, 0x857e,
-	0x9080, 0x0008, 0x2004, 0x9086, 0x0006, 0x1138, 0x6114, 0x918c,
-	0x1984, 0x918d, 0x0012, 0x6116, 0x0430, 0x9080, 0x0008, 0x2004,
-	0x9086, 0x0009, 0x0d98, 0x6114, 0x918c, 0x1984, 0x918d, 0x0016,
-	0x6116, 0x00c8, 0x6027, 0x0004, 0x00b0, 0x0036, 0x2019, 0x0001,
-	0x080c, 0xa5b6, 0x003e, 0x2019, 0x19f6, 0x2304, 0x9065, 0x0150,
-	0x2009, 0x004f, 0x6020, 0x9086, 0x0009, 0x1110, 0x2009, 0x004f,
-	0x080c, 0xaedc, 0x00ce, 0x001e, 0xd19c, 0x0904, 0x27aa, 0x7038,
-	0xd0ac, 0x1904, 0x2783, 0x0016, 0x0156, 0x6027, 0x0008, 0x6050,
-	0x9085, 0x0040, 0x6052, 0x6050, 0x9084, 0xfbcf, 0x6052, 0x080c,
-	0x2c38, 0x9085, 0x2000, 0x6052, 0x20a9, 0x0012, 0x1d04, 0x2756,
-	0x080c, 0x85ad, 0x1f04, 0x2756, 0x6050, 0x9085, 0x0400, 0x9084,
-	0xdfbf, 0x6052, 0x20a9, 0x0028, 0xa001, 0x1f04, 0x2764, 0x6150,
-	0x9185, 0x1400, 0x6052, 0x20a9, 0x0366, 0x1d04, 0x276d, 0x080c,
-	0x85ad, 0x6020, 0xd09c, 0x1130, 0x015e, 0x6152, 0x001e, 0x6027,
-	0x0008, 0x0480, 0x080c, 0x2c00, 0x1f04, 0x276d, 0x015e, 0x6152,
-	0x001e, 0x6027, 0x0008, 0x0016, 0x6028, 0xc09c, 0x602a, 0x080c,
-	0xadd2, 0x60e3, 0x0000, 0x080c, 0xe9e9, 0x080c, 0xea04, 0x080c,
-	0x56d3, 0xd0fc, 0x1138, 0x080c, 0xd229, 0x1120, 0x9085, 0x0001,
-	0x080c, 0x7403, 0x9006, 0x080c, 0x2cef, 0x2009, 0x0002, 0x080c,
-	0x2c3e, 0x2001, 0x1800, 0x2003, 0x0004, 0x6027, 0x0008, 0x080c,
-	0x0bae, 0x001e, 0x918c, 0xffd0, 0x6126, 0x00ae, 0x0005, 0x0016,
-	0x2001, 0x188b, 0x200c, 0xd184, 0x001e, 0x0904, 0x255c, 0x0016,
-	0x2009, 0x27bb, 0x00d0, 0x2001, 0x188b, 0x200c, 0xc184, 0x2102,
-	0x001e, 0x0c40, 0x0016, 0x2001, 0x188b, 0x200c, 0xd194, 0x001e,
-	0x0904, 0x255c, 0x0016, 0x2009, 0x27ce, 0x0038, 0x2001, 0x188b,
-	0x200c, 0xc194, 0x2102, 0x001e, 0x08a8, 0x6028, 0xc0bc, 0x602a,
-	0x2001, 0x0156, 0x2003, 0xbc91, 0x8000, 0x2003, 0xffff, 0x6043,
-	0x0001, 0x080c, 0x2c38, 0x6027, 0x0080, 0x6017, 0x0000, 0x6043,
-	0x0000, 0x0817, 0x0006, 0x0016, 0x0026, 0x0036, 0x00e6, 0x00f6,
-	0x0126, 0x2091, 0x8000, 0x2071, 0x1800, 0x71d0, 0x70d2, 0x9116,
-	0x05e8, 0x81ff, 0x01a0, 0x2009, 0x0000, 0x080c, 0x2c3e, 0x2011,
-	0x8011, 0x2019, 0x010e, 0x231c, 0x939e, 0x0007, 0x1118, 0x2019,
-	0x0001, 0x0010, 0x2019, 0x0000, 0x080c, 0x4b04, 0x0438, 0x2001,
-	0x19a8, 0x200c, 0x81ff, 0x1140, 0x2001, 0x0109, 0x2004, 0xd0b4,
-	0x0118, 0x2019, 0x0003, 0x0008, 0x2118, 0x2011, 0x8012, 0x080c,
-	0x4b04, 0x080c, 0x56d3, 0xd0fc, 0x1188, 0x080c, 0xd229, 0x1170,
-	0x00c6, 0x080c, 0x28d2, 0x080c, 0xa51d, 0x2061, 0x0100, 0x2019,
-	0x0028, 0x2009, 0x0002, 0x080c, 0x318a, 0x00ce, 0x012e, 0x00fe,
-	0x00ee, 0x003e, 0x002e, 0x001e, 0x000e, 0x0005, 0x2028, 0x918c,
-	0x00ff, 0x2130, 0x9094, 0xff00, 0x11f0, 0x2011, 0x1837, 0x2214,
-	0xd2ac, 0x11c8, 0x81ff, 0x01e8, 0x2011, 0x181f, 0x2204, 0x9106,
-	0x1190, 0x2011, 0x1820, 0x2214, 0x9294, 0xff00, 0x9584, 0xff00,
-	0x9206, 0x1148, 0x2011, 0x1820, 0x2214, 0x9294, 0x00ff, 0x9584,
-	0x00ff, 0x9206, 0x1120, 0x2500, 0x080c, 0x80be, 0x0048, 0x9584,
-	0x00ff, 0x9080, 0x3325, 0x200d, 0x918c, 0xff00, 0x810f, 0x9006,
-	0x0005, 0x9080, 0x3325, 0x200d, 0x918c, 0x00ff, 0x0005, 0x00d6,
-	0x2069, 0x0140, 0x2001, 0x1818, 0x2003, 0x00ef, 0x20a9, 0x0010,
-	0x9006, 0x6852, 0x6856, 0x1f04, 0x2882, 0x00de, 0x0005, 0x0006,
-	0x00d6, 0x0026, 0x2069, 0x0140, 0x2001, 0x1818, 0x2102, 0x8114,
-	0x8214, 0x8214, 0x8214, 0x20a9, 0x0010, 0x6853, 0x0000, 0x9006,
-	0x82ff, 0x1128, 0x9184, 0x000f, 0x9080, 0xf1b6, 0x2005, 0x6856,
-	0x8211, 0x1f04, 0x2897, 0x002e, 0x00de, 0x000e, 0x0005, 0x00c6,
-	0x2061, 0x1800, 0x6030, 0x0110, 0xc09d, 0x0008, 0xc09c, 0x6032,
-	0x00ce, 0x0005, 0x0156, 0x00d6, 0x0026, 0x0016, 0x0006, 0x2069,
-	0x0140, 0x6980, 0x9116, 0x0180, 0x9112, 0x1230, 0x8212, 0x8210,
-	0x22a8, 0x2001, 0x0402, 0x0018, 0x22a8, 0x2001, 0x0404, 0x680e,
-	0x1f04, 0x28c7, 0x680f, 0x0000, 0x000e, 0x001e, 0x002e, 0x00de,
-	0x015e, 0x0005, 0x080c, 0x56cf, 0xd0c4, 0x0150, 0xd0a4, 0x0140,
-	0x9006, 0x0046, 0x2020, 0x2009, 0x002e, 0x080c, 0xe5ae, 0x004e,
-	0x0005, 0x00f6, 0x0016, 0x0026, 0x2079, 0x0140, 0x78c4, 0xd0dc,
-	0x0904, 0x293e, 0x080c, 0x2b9d, 0x0660, 0x9084, 0x0700, 0x908e,
-	0x0600, 0x1120, 0x2011, 0x4000, 0x900e, 0x0458, 0x908e, 0x0500,
-	0x1120, 0x2011, 0x8000, 0x900e, 0x0420, 0x908e, 0x0400, 0x1120,
-	0x9016, 0x2009, 0x0001, 0x00e8, 0x908e, 0x0300, 0x1120, 0x9016,
-	0x2009, 0x0002, 0x00b0, 0x908e, 0x0200, 0x1120, 0x9016, 0x2009,
-	0x0004, 0x0078, 0x908e, 0x0100, 0x1548, 0x9016, 0x2009, 0x0008,
-	0x0040, 0x9084, 0x0700, 0x908e, 0x0300, 0x1500, 0x2011, 0x0030,
-	0x0058, 0x2300, 0x9080, 0x0020, 0x2018, 0x080c, 0x8f68, 0x928c,
-	0xff00, 0x0110, 0x2011, 0x00ff, 0x2200, 0x8007, 0x9085, 0x004c,
-	0x78c2, 0x2009, 0x0138, 0x220a, 0x080c, 0x73bc, 0x1118, 0x2009,
-	0x196d, 0x220a, 0x002e, 0x001e, 0x00fe, 0x0005, 0x78c3, 0x0000,
-	0x0cc8, 0x0126, 0x2091, 0x2800, 0x0006, 0x0016, 0x0026, 0x2001,
-	0x0170, 0x200c, 0x8000, 0x2014, 0x9184, 0x0003, 0x0110, 0x080c,
-	0x0dce, 0x002e, 0x001e, 0x000e, 0x012e, 0x0005, 0x2001, 0x0171,
-	0x2004, 0xd0dc, 0x0168, 0x2001, 0x0170, 0x200c, 0x918c, 0x00ff,
-	0x918e, 0x004c, 0x1128, 0x200c, 0x918c, 0xff00, 0x810f, 0x0005,
-	0x900e, 0x2001, 0x0227, 0x2004, 0x8007, 0x9084, 0x00ff, 0x8004,
-	0x9108, 0x2001, 0x0226, 0x2004, 0x8007, 0x9084, 0x00ff, 0x8004,
-	0x9108, 0x0005, 0x0018, 0x000c, 0x0018, 0x0020, 0x1000, 0x0800,
-	0x1000, 0x1800, 0x0156, 0x0006, 0x0016, 0x0026, 0x00e6, 0x2001,
-	0x1990, 0x2004, 0x908a, 0x0007, 0x1a0c, 0x0dd5, 0x0033, 0x00ee,
-	0x002e, 0x001e, 0x000e, 0x015e, 0x0005, 0x299c, 0x29ba, 0x29de,
-	0x29e0, 0x2a09, 0x2a0b, 0x2a0d, 0x2001, 0x0001, 0x080c, 0x27ea,
-	0x080c, 0x2bfb, 0x2001, 0x1992, 0x2003, 0x0000, 0x7828, 0x9084,
-	0xe1d7, 0x782a, 0x9006, 0x20a9, 0x0009, 0x080c, 0x2bb9, 0x2001,
-	0x1990, 0x2003, 0x0006, 0x2009, 0x001e, 0x2011, 0x2a0e, 0x080c,
-	0x858b, 0x0005, 0x2009, 0x1995, 0x200b, 0x0000, 0x2001, 0x199a,
-	0x2003, 0x0036, 0x2001, 0x1999, 0x2003, 0x002a, 0x2001, 0x1992,
-	0x2003, 0x0001, 0x9006, 0x080c, 0x2b6b, 0x2001, 0xffff, 0x20a9,
-	0x0009, 0x080c, 0x2bb9, 0x2001, 0x1990, 0x2003, 0x0006, 0x2009,
-	0x001e, 0x2011, 0x2a0e, 0x080c, 0x858b, 0x0005, 0x080c, 0x0dd5,
-	0x2001, 0x199a, 0x2003, 0x0036, 0x2001, 0x1992, 0x2003, 0x0003,
-	0x7a38, 0x9294, 0x0005, 0x9296, 0x0004, 0x0110, 0x9006, 0x0010,
-	0x2001, 0x0001, 0x080c, 0x2b6b, 0x2001, 0x1996, 0x2003, 0x0000,
-	0x2001, 0xffff, 0x20a9, 0x0009, 0x080c, 0x2bb9, 0x2001, 0x1990,
-	0x2003, 0x0006, 0x2009, 0x001e, 0x2011, 0x2a0e, 0x080c, 0x858b,
-	0x0005, 0x080c, 0x0dd5, 0x080c, 0x0dd5, 0x0005, 0x0006, 0x0016,
-	0x0026, 0x00e6, 0x00f6, 0x0156, 0x0126, 0x2091, 0x8000, 0x2079,
-	0x0100, 0x2001, 0x1992, 0x2004, 0x908a, 0x0007, 0x1a0c, 0x0dd5,
-	0x0043, 0x012e, 0x015e, 0x00fe, 0x00ee, 0x002e, 0x001e, 0x000e,
-	0x0005, 0x2a30, 0x2a50, 0x2a90, 0x2ac0, 0x2ae4, 0x2af4, 0x2af6,
-	0x080c, 0x2bad, 0x11b0, 0x7850, 0x9084, 0xefff, 0x7852, 0x2009,
-	0x1998, 0x2104, 0x7a38, 0x9294, 0x0005, 0x9296, 0x0004, 0x0110,
-	0xc08d, 0x0008, 0xc085, 0x200a, 0x2001, 0x1990, 0x2003, 0x0001,
-	0x0030, 0x080c, 0x2b1a, 0x2001, 0xffff, 0x080c, 0x29ab, 0x0005,
-	0x080c, 0x2af8, 0x05e0, 0x2009, 0x1999, 0x2104, 0x8001, 0x200a,
-	0x080c, 0x2bad, 0x1178, 0x7850, 0x9084, 0xefff, 0x7852, 0x7a38,
-	0x9294, 0x0005, 0x9296, 0x0005, 0x0518, 0x2009, 0x1998, 0x2104,
-	0xc085, 0x200a, 0x2009, 0x1995, 0x2104, 0x8000, 0x200a, 0x9086,
-	0x0005, 0x0118, 0x080c, 0x2b00, 0x00c0, 0x200b, 0x0000, 0x7a38,
-	0x9294, 0x0006, 0x9296, 0x0004, 0x0110, 0x9006, 0x0010, 0x2001,
-	0x0001, 0x080c, 0x2b88, 0x2001, 0x1992, 0x2003, 0x0002, 0x0028,
-	0x2001, 0x1990, 0x2003, 0x0003, 0x0010, 0x080c, 0x29cd, 0x0005,
-	0x080c, 0x2af8, 0x0560, 0x2009, 0x1999, 0x2104, 0x8001, 0x200a,
-	0x080c, 0x2bad, 0x1168, 0x7850, 0x9084, 0xefff, 0x7852, 0x2001,
-	0x1990, 0x2003, 0x0003, 0x2001, 0x1991, 0x2003, 0x0000, 0x00b8,
-	0x2009, 0x1999, 0x2104, 0x9005, 0x1118, 0x080c, 0x2b3d, 0x0010,
-	0x080c, 0x2b0d, 0x080c, 0x2b00, 0x2009, 0x1995, 0x200b, 0x0000,
-	0x2001, 0x1992, 0x2003, 0x0001, 0x080c, 0x29cd, 0x0000, 0x0005,
-	0x04b9, 0x0508, 0x080c, 0x2bad, 0x11b8, 0x7850, 0x9084, 0xefff,
-	0x7852, 0x2009, 0x1996, 0x2104, 0x8000, 0x200a, 0x9086, 0x0007,
-	0x0108, 0x0078, 0x2001, 0x199b, 0x2003, 0x000a, 0x2009, 0x1998,
-	0x2104, 0xc0fd, 0x200a, 0x0038, 0x0419, 0x2001, 0x1992, 0x2003,
-	0x0004, 0x080c, 0x29f8, 0x0005, 0x0099, 0x0168, 0x080c, 0x2bad,
-	0x1138, 0x7850, 0x9084, 0xefff, 0x7852, 0x080c, 0x29e4, 0x0018,
-	0x0079, 0x080c, 0x29f8, 0x0005, 0x080c, 0x0dd5, 0x080c, 0x0dd5,
-	0x2009, 0x199a, 0x2104, 0x8001, 0x200a, 0x090c, 0x2b59, 0x0005,
-	0x7a38, 0x9294, 0x0005, 0x9296, 0x0005, 0x0110, 0x9006, 0x0010,
-	0x2001, 0x0001, 0x080c, 0x2b88, 0x0005, 0x7a38, 0x9294, 0x0006,
-	0x9296, 0x0006, 0x0110, 0x9006, 0x0010, 0x2001, 0x0001, 0x080c,
-	0x2b6b, 0x0005, 0x2009, 0x1995, 0x2104, 0x8000, 0x200a, 0x9086,
-	0x0005, 0x0108, 0x0068, 0x200b, 0x0000, 0x7a38, 0x9294, 0x0006,
-	0x9296, 0x0006, 0x0110, 0x9006, 0x0010, 0x2001, 0x0001, 0x04d9,
-	0x7a38, 0x9294, 0x0005, 0x9296, 0x0005, 0x0110, 0x9006, 0x0010,
-	0x2001, 0x0001, 0x080c, 0x2b88, 0x0005, 0x0086, 0x2001, 0x1998,
-	0x2004, 0x9084, 0x7fff, 0x090c, 0x0dd5, 0x2009, 0x1997, 0x2144,
-	0x8846, 0x280a, 0x9844, 0x0dd8, 0xd08c, 0x1120, 0xd084, 0x1120,
-	0x080c, 0x0dd5, 0x9006, 0x0010, 0x2001, 0x0001, 0x00a1, 0x008e,
-	0x0005, 0x0006, 0x0156, 0x2001, 0x1990, 0x20a9, 0x0009, 0x2003,
-	0x0000, 0x8000, 0x1f04, 0x2b5f, 0x2001, 0x1997, 0x2003, 0x8000,
-	0x015e, 0x000e, 0x0005, 0x00f6, 0x2079, 0x0100, 0x9085, 0x0000,
-	0x0158, 0x7838, 0x9084, 0xfff9, 0x9085, 0x0004, 0x783a, 0x2009,
-	0x199d, 0x210c, 0x795a, 0x0050, 0x7838, 0x9084, 0xfffb, 0x9085,
-	0x0006, 0x783a, 0x2009, 0x199e, 0x210c, 0x795a, 0x00fe, 0x0005,
-	0x00f6, 0x2079, 0x0100, 0x9085, 0x0000, 0x0138, 0x7838, 0x9084,
-	0xfffa, 0x9085, 0x0004, 0x783a, 0x0030, 0x7838, 0x9084, 0xfffb,
-	0x9085, 0x0005, 0x783a, 0x00fe, 0x0005, 0x0006, 0x2001, 0x0100,
-	0x2004, 0x9082, 0x0007, 0x000e, 0x0005, 0x0006, 0x2001, 0x0100,
-	0x2004, 0x9082, 0x0009, 0x000e, 0x0005, 0x0156, 0x20a9, 0x0064,
-	0x7820, 0x080c, 0x2c38, 0xd09c, 0x1110, 0x1f04, 0x2bb0, 0x015e,
-	0x0005, 0x0126, 0x0016, 0x0006, 0x2091, 0x8000, 0x7850, 0x9085,
-	0x0040, 0x7852, 0x7850, 0x9084, 0xfbcf, 0x7852, 0x080c, 0x2c38,
-	0x9085, 0x2000, 0x7852, 0x000e, 0x2008, 0x9186, 0x0000, 0x1118,
-	0x783b, 0x0007, 0x0090, 0x9186, 0x0001, 0x1118, 0x783b, 0x0006,
-	0x0060, 0x9186, 0x0002, 0x1118, 0x783b, 0x0005, 0x0030, 0x9186,
-	0x0003, 0x1118, 0x783b, 0x0004, 0x0000, 0x0006, 0x1d04, 0x2be6,
-	0x080c, 0x85ad, 0x1f04, 0x2be6, 0x7850, 0x9085, 0x0400, 0x9084,
-	0xdfbf, 0x7852, 0x080c, 0x2c38, 0x9085, 0x1000, 0x7852, 0x000e,
-	0x001e, 0x012e, 0x0005, 0x7850, 0x9084, 0xffcf, 0x7852, 0x0005,
-	0x0006, 0x0156, 0x00f6, 0x2079, 0x0100, 0x20a9, 0x000a, 0x7854,
-	0xd0ac, 0x1130, 0x7820, 0xd0e4, 0x1140, 0x1f04, 0x2c0a, 0x0028,
-	0x7854, 0xd08c, 0x1110, 0x1f04, 0x2c10, 0x00fe, 0x015e, 0x000e,
-	0x0005, 0x1d04, 0x2c19, 0x080c, 0x85ad, 0x1f04, 0x2c19, 0x0005,
-	0x0006, 0x2001, 0x199c, 0x2004, 0x9086, 0x0000, 0x000e, 0x0005,
-	0x0006, 0x2001, 0x199c, 0x2004, 0x9086, 0x0001, 0x000e, 0x0005,
-	0x0006, 0x2001, 0x199c, 0x2004, 0x9086, 0x0002, 0x000e, 0x0005,
-	0xa001, 0xa001, 0xa001, 0xa001, 0xa001, 0x0005, 0x0006, 0x2001,
-	0x19a8, 0x2102, 0x000e, 0x0005, 0x2009, 0x0171, 0x2104, 0xd0dc,
-	0x0140, 0x2009, 0x0170, 0x2104, 0x200b, 0x0080, 0xa001, 0xa001,
-	0x200a, 0x0005, 0x0036, 0x0046, 0x2001, 0x0141, 0x200c, 0x918c,
-	0xff00, 0x9186, 0x2000, 0x0118, 0x9186, 0x0100, 0x1588, 0x2009,
-	0x00a2, 0x080c, 0x0e51, 0x2019, 0x0160, 0x2324, 0x2011, 0x0003,
-	0x2009, 0x0169, 0x2104, 0x9084, 0x0007, 0x210c, 0x918c, 0x0007,
-	0x910e, 0x1db0, 0x9086, 0x0003, 0x11b8, 0x2304, 0x9402, 0x02a0,
-	0x1d60, 0x8211, 0x1d68, 0x84ff, 0x0170, 0x2001, 0x0141, 0x200c,
-	0x918c, 0xff00, 0x9186, 0x0100, 0x0130, 0x2009, 0x180c, 0x2104,
-	0xc0dd, 0x200a, 0x0008, 0x0419, 0x2009, 0x0000, 0x080c, 0x0e51,
-	0x004e, 0x003e, 0x0005, 0x2001, 0x180c, 0x2004, 0xd0dc, 0x01b0,
-	0x2001, 0x0160, 0x2004, 0x9005, 0x0140, 0x2001, 0x0141, 0x2004,
-	0x9084, 0xff00, 0x9086, 0x0100, 0x1148, 0x0126, 0x2091, 0x8000,
-	0x0016, 0x0026, 0x0021, 0x002e, 0x001e, 0x012e, 0x0005, 0x00c6,
-	0x2061, 0x0100, 0x6014, 0x0006, 0x2001, 0x0161, 0x2003, 0x0000,
-	0x6017, 0x0018, 0xa001, 0xa001, 0x602f, 0x0008, 0x6104, 0x918e,
-	0x0010, 0x6106, 0x918e, 0x0010, 0x6106, 0x6017, 0x0040, 0x04b9,
-	0x001e, 0x9184, 0x0003, 0x01e0, 0x0036, 0x0016, 0x2019, 0x0141,
-	0x6124, 0x918c, 0x0028, 0x1120, 0x2304, 0x9084, 0x2800, 0x0dc0,
-	0x001e, 0x919c, 0xffe4, 0x9184, 0x0001, 0x0118, 0x9385, 0x0009,
-	0x6016, 0x9184, 0x0002, 0x0118, 0x9385, 0x0012, 0x6016, 0x003e,
-	0x2001, 0x180c, 0x200c, 0xc1dc, 0x2102, 0x00ce, 0x0005, 0x0016,
-	0x0026, 0x080c, 0x73d6, 0x0108, 0xc0bc, 0x2009, 0x0140, 0x2114,
-	0x9294, 0x0001, 0x9215, 0x220a, 0x002e, 0x001e, 0x0005, 0x0016,
-	0x0026, 0x2009, 0x0140, 0x2114, 0x9294, 0x0001, 0x9285, 0x1000,
-	0x200a, 0x220a, 0x002e, 0x001e, 0x0005, 0x0016, 0x0026, 0x2009,
+	0x1a35, 0x2c05, 0x908a, 0x0034, 0x1a0c, 0x0dd5, 0x9082, 0x001b,
+	0x0002, 0x194c, 0x194a, 0x194a, 0x194a, 0x194a, 0x194a, 0x1950,
+	0x194a, 0x194a, 0x194a, 0x194a, 0x194a, 0x1954, 0x194a, 0x194a,
+	0x194a, 0x194a, 0x194a, 0x1958, 0x194a, 0x194a, 0x194a, 0x194a,
+	0x194a, 0x195c, 0x080c, 0x0dd5, 0xa774, 0xa678, 0x0804, 0x1a35,
+	0xa78c, 0xa690, 0x0804, 0x1a35, 0xa7a4, 0xa6a8, 0x0804, 0x1a35,
+	0xa7bc, 0xa6c0, 0x0804, 0x1a35, 0xa7d4, 0xa6d8, 0x0804, 0x1a35,
+	0xa898, 0x901d, 0x1108, 0xab9c, 0x9016, 0x2c05, 0x908a, 0x0036,
+	0x1a0c, 0x0dd5, 0x9082, 0x001b, 0x0002, 0x1988, 0x1988, 0x198a,
+	0x1988, 0x1988, 0x1988, 0x1994, 0x1988, 0x1988, 0x1988, 0x199e,
+	0x1988, 0x1988, 0x1988, 0x19a8, 0x1988, 0x1988, 0x1988, 0x19b2,
+	0x1988, 0x1988, 0x1988, 0x19bc, 0x1988, 0x1988, 0x1988, 0x19c6,
+	0x080c, 0x0dd5, 0xa574, 0xa478, 0x9d86, 0x0004, 0x0904, 0x1a35,
+	0xa37c, 0xa280, 0x0804, 0x1a35, 0xa584, 0xa488, 0x9d86, 0x0004,
+	0x0904, 0x1a35, 0xa38c, 0xa290, 0x0804, 0x1a35, 0xa594, 0xa498,
+	0x9d86, 0x0004, 0x0904, 0x1a35, 0xa39c, 0xa2a0, 0x0804, 0x1a35,
+	0xa5a4, 0xa4a8, 0x9d86, 0x0004, 0x0904, 0x1a35, 0xa3ac, 0xa2b0,
+	0x0804, 0x1a35, 0xa5b4, 0xa4b8, 0x9d86, 0x0004, 0x0904, 0x1a35,
+	0xa3bc, 0xa2c0, 0x0804, 0x1a35, 0xa5c4, 0xa4c8, 0x9d86, 0x0004,
+	0x0904, 0x1a35, 0xa3cc, 0xa2d0, 0x0804, 0x1a35, 0xa5d4, 0xa4d8,
+	0x9d86, 0x0004, 0x0904, 0x1a35, 0xa3dc, 0xa2e0, 0x0804, 0x1a35,
+	0xa898, 0x901d, 0x1108, 0xab9c, 0x9016, 0x2c05, 0x908a, 0x0034,
+	0x1a0c, 0x0dd5, 0x9082, 0x001b, 0x0002, 0x19f8, 0x19f6, 0x19f6,
+	0x19f6, 0x19f6, 0x19f6, 0x1a02, 0x19f6, 0x19f6, 0x19f6, 0x19f6,
+	0x19f6, 0x1a0c, 0x19f6, 0x19f6, 0x19f6, 0x19f6, 0x19f6, 0x1a16,
+	0x19f6, 0x19f6, 0x19f6, 0x19f6, 0x19f6, 0x1a20, 0x080c, 0x0dd5,
+	0xa56c, 0xa470, 0xa774, 0xa678, 0x9d86, 0x000c, 0x05b0, 0xa37c,
+	0xa280, 0x0498, 0xa584, 0xa488, 0xa78c, 0xa690, 0x9d86, 0x000c,
+	0x0560, 0xa394, 0xa298, 0x0448, 0xa59c, 0xa4a0, 0xa7a4, 0xa6a8,
+	0x9d86, 0x000c, 0x0510, 0xa3ac, 0xa2b0, 0x00f8, 0xa5b4, 0xa4b8,
+	0xa7bc, 0xa6c0, 0x9d86, 0x000c, 0x01c0, 0xa3c4, 0xa2c8, 0x00a8,
+	0xa5cc, 0xa4d0, 0xa7d4, 0xa6d8, 0x9d86, 0x000c, 0x0170, 0xa3dc,
+	0xa2e0, 0x0058, 0x9d86, 0x000e, 0x1130, 0x080c, 0x204a, 0x1904,
+	0x1909, 0x900e, 0x0050, 0x080c, 0x0dd5, 0xab2e, 0xaa32, 0xad1e,
+	0xac22, 0xaf26, 0xae2a, 0x080c, 0x204a, 0x0005, 0x6014, 0x2048,
+	0x6118, 0x810c, 0x810c, 0x810c, 0x81ff, 0x1118, 0xa887, 0x0001,
+	0x0008, 0xa986, 0x601b, 0x0002, 0xa974, 0xd1dc, 0x1108, 0x0005,
+	0xa934, 0xa88c, 0x9106, 0x1158, 0xa938, 0xa890, 0x9106, 0x1138,
+	0x601c, 0xc084, 0x601e, 0x2009, 0x0048, 0x0804, 0xaeec, 0x0005,
+	0x0126, 0x00c6, 0x2091, 0x2200, 0x00ce, 0x7908, 0x918c, 0x0007,
+	0x9186, 0x0000, 0x05b0, 0x9186, 0x0003, 0x0598, 0x6020, 0x6023,
+	0x0000, 0x0006, 0x2031, 0x0008, 0x00c6, 0x781f, 0x0808, 0x7808,
+	0xd09c, 0x0120, 0x080c, 0x1380, 0x8631, 0x1db8, 0x00ce, 0x781f,
+	0x0800, 0x2031, 0x0168, 0x00c6, 0x7808, 0xd09c, 0x190c, 0x1380,
+	0x00ce, 0x2001, 0x0038, 0x080c, 0x1b38, 0x7930, 0x9186, 0x0040,
+	0x0160, 0x9186, 0x0042, 0x190c, 0x0dd5, 0x2001, 0x001e, 0x8001,
+	0x1df0, 0x8631, 0x1d40, 0x080c, 0x1b47, 0x000e, 0x6022, 0x012e,
+	0x0005, 0x080c, 0x1b34, 0x7827, 0x0015, 0x7828, 0x9c06, 0x1db8,
+	0x782b, 0x0000, 0x0ca0, 0x00f6, 0x2079, 0x0300, 0x7803, 0x0000,
+	0x78ab, 0x0004, 0x00fe, 0x080c, 0x73a5, 0x11b0, 0x2001, 0x0138,
+	0x2003, 0x0000, 0x2001, 0x0160, 0x2003, 0x0000, 0x2011, 0x012c,
+	0xa001, 0xa001, 0x8211, 0x1de0, 0x0081, 0x0066, 0x2031, 0x0000,
+	0x080c, 0x7455, 0x006e, 0x0005, 0x0479, 0x0039, 0x2001, 0x0160,
+	0x2502, 0x2001, 0x0138, 0x2202, 0x0005, 0x00e6, 0x2071, 0x0200,
+	0x080c, 0x2c46, 0x2009, 0x003c, 0x080c, 0x23d4, 0x2001, 0x015d,
+	0x2003, 0x0000, 0x7000, 0x9084, 0x003c, 0x1de0, 0x080c, 0x83fd,
+	0x70a0, 0x70a2, 0x7098, 0x709a, 0x709c, 0x709e, 0x2001, 0x020d,
+	0x2003, 0x0020, 0x00f6, 0x2079, 0x0300, 0x080c, 0x1313, 0x7803,
+	0x0001, 0x00fe, 0x00ee, 0x0005, 0x2001, 0x0138, 0x2014, 0x2003,
+	0x0000, 0x2001, 0x0160, 0x202c, 0x2003, 0x0000, 0x080c, 0x73a5,
+	0x1108, 0x0005, 0x2021, 0x0260, 0x2001, 0x0141, 0x201c, 0xd3dc,
+	0x1168, 0x2001, 0x0109, 0x201c, 0x939c, 0x0048, 0x1160, 0x2001,
+	0x0111, 0x201c, 0x83ff, 0x1110, 0x8421, 0x1d70, 0x2001, 0x015d,
+	0x2003, 0x0000, 0x0005, 0x0046, 0x2021, 0x0019, 0x2003, 0x0048,
+	0xa001, 0xa001, 0x201c, 0x939c, 0x0048, 0x0120, 0x8421, 0x1db0,
+	0x004e, 0x0c60, 0x004e, 0x0c40, 0x601c, 0xc084, 0x601e, 0x0005,
+	0x2c08, 0x621c, 0x080c, 0x15f0, 0x7930, 0x0005, 0x2c08, 0x621c,
+	0x080c, 0x169b, 0x7930, 0x0005, 0x8001, 0x1df0, 0x0005, 0x2031,
+	0x0005, 0x781c, 0x9084, 0x0007, 0x0170, 0x2001, 0x0038, 0x0c41,
+	0x9186, 0x0040, 0x0904, 0x1ba5, 0x2001, 0x001e, 0x0c69, 0x8631,
+	0x1d80, 0x080c, 0x0dd5, 0x781f, 0x0202, 0x2001, 0x015d, 0x2003,
+	0x0000, 0x2001, 0x0b10, 0x0c01, 0x781c, 0xd084, 0x0110, 0x0861,
+	0x04e0, 0x2001, 0x0030, 0x0891, 0x9186, 0x0040, 0x0568, 0x781c,
+	0xd084, 0x1da8, 0x781f, 0x0101, 0x2001, 0x0014, 0x0869, 0x2001,
+	0x0037, 0x0821, 0x9186, 0x0040, 0x0140, 0x2001, 0x0030, 0x080c,
+	0x1b3e, 0x9186, 0x0040, 0x190c, 0x0dd5, 0x00d6, 0x2069, 0x0200,
+	0x692c, 0xd1f4, 0x1170, 0xd1c4, 0x0160, 0xd19c, 0x0130, 0x6800,
+	0x9085, 0x1800, 0x6802, 0x00de, 0x0080, 0x6908, 0x9184, 0x0007,
+	0x1db0, 0x00de, 0x781f, 0x0100, 0x791c, 0x9184, 0x0007, 0x090c,
+	0x0dd5, 0xa001, 0xa001, 0x781f, 0x0200, 0x0005, 0x0126, 0x2091,
+	0x2400, 0x2071, 0x1a65, 0x2079, 0x0090, 0x012e, 0x0005, 0x9280,
+	0x0005, 0x2004, 0x2048, 0xa97c, 0xd1dc, 0x1904, 0x1c47, 0xa964,
+	0x9184, 0x0007, 0x0002, 0x1bc3, 0x1c32, 0x1bda, 0x1bdc, 0x1bda,
+	0x1c1a, 0x1bfa, 0x1be9, 0x918c, 0x00ff, 0x9186, 0x0008, 0x1170,
+	0xa87c, 0xd0b4, 0x0904, 0x1e71, 0x9006, 0xa842, 0xa83e, 0xa988,
+	0x2900, 0xa85a, 0xa813, 0x208d, 0x0804, 0x1c43, 0x9186, 0x0048,
+	0x0904, 0x1c32, 0x080c, 0x0dd5, 0x9184, 0x00ff, 0x9086, 0x0013,
+	0x0904, 0x1c32, 0x9184, 0x00ff, 0x9086, 0x001b, 0x0904, 0x1c32,
+	0x0c88, 0xa87c, 0xd0b4, 0x0904, 0x1e71, 0xa890, 0xa842, 0xa83a,
+	0xa88c, 0xa83e, 0xa836, 0xa8ac, 0xa846, 0xa8b0, 0xa84a, 0xa988,
+	0x0804, 0x1c3a, 0xa864, 0x9084, 0x00ff, 0x9086, 0x001e, 0x19d0,
+	0xa87c, 0xd0b4, 0x0904, 0x1e71, 0xa890, 0xa842, 0xa83a, 0xa88c,
+	0xa83e, 0xa836, 0xa8ac, 0xa846, 0xa8b0, 0xa84a, 0xa804, 0xa85a,
+	0x2040, 0xa064, 0x9084, 0x000f, 0x9080, 0x2092, 0x2005, 0xa812,
+	0xa988, 0x0448, 0x918c, 0x00ff, 0x9186, 0x0015, 0x1540, 0xa87c,
+	0xd0b4, 0x0904, 0x1e71, 0xa804, 0xa85a, 0x2040, 0xa064, 0x9084,
+	0x000f, 0x9080, 0x2092, 0x2005, 0xa812, 0xa988, 0x9006, 0xa842,
+	0xa83e, 0x0088, 0xa87c, 0xd0b4, 0x0904, 0x1e71, 0xa988, 0x9006,
+	0xa842, 0xa83e, 0x2900, 0xa85a, 0xa864, 0x9084, 0x000f, 0x9080,
+	0x2092, 0x2005, 0xa812, 0xa916, 0xa87c, 0xc0dd, 0xa87e, 0x0005,
+	0x00f6, 0x2079, 0x0090, 0x782c, 0xd0fc, 0x190c, 0x1eb6, 0x00e6,
+	0x2071, 0x1a65, 0x7000, 0x9005, 0x1904, 0x1cb0, 0x7206, 0x9280,
+	0x0005, 0x204c, 0x9280, 0x0004, 0x2004, 0x782b, 0x0004, 0x00f6,
+	0x2079, 0x0200, 0x7803, 0x0040, 0x00fe, 0x00b6, 0x2058, 0xb86c,
+	0x7836, 0xb890, 0x00be, 0x00f6, 0x2079, 0x0200, 0x7803, 0x0040,
+	0xa001, 0xa001, 0xa001, 0xa001, 0xa001, 0xa001, 0x781a, 0x2079,
+	0x0100, 0x8004, 0x78d6, 0x00fe, 0xa814, 0x2050, 0xa858, 0x2040,
+	0xa810, 0x2060, 0xa064, 0x90ec, 0x000f, 0xa944, 0x791a, 0x7116,
+	0xa848, 0x781e, 0x701a, 0x9006, 0x700e, 0x7012, 0x7004, 0xa940,
+	0xa838, 0x9106, 0x1500, 0xa93c, 0xa834, 0x9106, 0x11e0, 0x0006,
+	0x0016, 0xa938, 0xa834, 0x9105, 0x0118, 0x001e, 0x000e, 0x0098,
+	0x001e, 0x000e, 0x8aff, 0x01c8, 0x0126, 0x2091, 0x8000, 0x2009,
+	0x0306, 0x200b, 0x0808, 0x00d9, 0x0108, 0x00c9, 0x012e, 0x9006,
+	0x00ee, 0x00fe, 0x0005, 0x0036, 0x0046, 0xab38, 0xac34, 0x080c,
+	0x20b2, 0x004e, 0x003e, 0x0d30, 0x0c98, 0x9085, 0x0001, 0x0c80,
+	0x2009, 0x0306, 0x200b, 0x4800, 0x7027, 0x0000, 0x0005, 0x0076,
+	0x0066, 0x0056, 0x0046, 0x0036, 0x0026, 0x8aff, 0x0904, 0x1e6a,
+	0x700c, 0x7214, 0x923a, 0x7010, 0x7218, 0x9203, 0x0a04, 0x1e69,
+	0x9705, 0x0904, 0x1e69, 0x903e, 0x2730, 0xa880, 0xd0fc, 0x1190,
+	0x2d00, 0x0002, 0x1df3, 0x1d32, 0x1d32, 0x1df3, 0x1df3, 0x1dd0,
+	0x1df3, 0x1d32, 0x1dd7, 0x1d81, 0x1d81, 0x1df3, 0x1df3, 0x1df3,
+	0x1dca, 0x1d81, 0xc0fc, 0xa882, 0xab2c, 0xaa30, 0xad1c, 0xac20,
+	0xdd9c, 0x0904, 0x1e00, 0x2c05, 0x908a, 0x0034, 0x1a0c, 0x0dd5,
+	0x9082, 0x001b, 0x0002, 0x1d1e, 0x1d1c, 0x1d1c, 0x1d1c, 0x1d1c,
+	0x1d1c, 0x1d22, 0x1d1c, 0x1d1c, 0x1d1c, 0x1d1c, 0x1d1c, 0x1d26,
+	0x1d1c, 0x1d1c, 0x1d1c, 0x1d1c, 0x1d1c, 0x1d2a, 0x1d1c, 0x1d1c,
+	0x1d1c, 0x1d1c, 0x1d1c, 0x1d2e, 0x080c, 0x0dd5, 0xa774, 0xa678,
+	0x0804, 0x1e00, 0xa78c, 0xa690, 0x0804, 0x1e00, 0xa7a4, 0xa6a8,
+	0x0804, 0x1e00, 0xa7bc, 0xa6c0, 0x0804, 0x1e00, 0xa7d4, 0xa6d8,
+	0x0804, 0x1e00, 0x2c05, 0x908a, 0x0036, 0x1a0c, 0x0dd5, 0x9082,
+	0x001b, 0x0002, 0x1d55, 0x1d55, 0x1d57, 0x1d55, 0x1d55, 0x1d55,
+	0x1d5d, 0x1d55, 0x1d55, 0x1d55, 0x1d63, 0x1d55, 0x1d55, 0x1d55,
+	0x1d69, 0x1d55, 0x1d55, 0x1d55, 0x1d6f, 0x1d55, 0x1d55, 0x1d55,
+	0x1d75, 0x1d55, 0x1d55, 0x1d55, 0x1d7b, 0x080c, 0x0dd5, 0xa574,
+	0xa478, 0xa37c, 0xa280, 0x0804, 0x1e00, 0xa584, 0xa488, 0xa38c,
+	0xa290, 0x0804, 0x1e00, 0xa594, 0xa498, 0xa39c, 0xa2a0, 0x0804,
+	0x1e00, 0xa5a4, 0xa4a8, 0xa3ac, 0xa2b0, 0x0804, 0x1e00, 0xa5b4,
+	0xa4b8, 0xa3bc, 0xa2c0, 0x0804, 0x1e00, 0xa5c4, 0xa4c8, 0xa3cc,
+	0xa2d0, 0x0804, 0x1e00, 0xa5d4, 0xa4d8, 0xa3dc, 0xa2e0, 0x0804,
+	0x1e00, 0x2c05, 0x908a, 0x0034, 0x1a0c, 0x0dd5, 0x9082, 0x001b,
+	0x0002, 0x1da4, 0x1da2, 0x1da2, 0x1da2, 0x1da2, 0x1da2, 0x1dac,
+	0x1da2, 0x1da2, 0x1da2, 0x1da2, 0x1da2, 0x1db4, 0x1da2, 0x1da2,
+	0x1da2, 0x1da2, 0x1da2, 0x1dbc, 0x1da2, 0x1da2, 0x1da2, 0x1da2,
+	0x1da2, 0x1dc3, 0x080c, 0x0dd5, 0xa56c, 0xa470, 0xa774, 0xa678,
+	0xa37c, 0xa280, 0x0804, 0x1e00, 0xa584, 0xa488, 0xa78c, 0xa690,
+	0xa394, 0xa298, 0x0804, 0x1e00, 0xa59c, 0xa4a0, 0xa7a4, 0xa6a8,
+	0xa3ac, 0xa2b0, 0x0804, 0x1e00, 0xa5b4, 0xa4b8, 0xa7bc, 0xa6c0,
+	0xa3c4, 0xa2c8, 0x04e8, 0xa5cc, 0xa4d0, 0xa7d4, 0xa6d8, 0xa3dc,
+	0xa2e0, 0x04b0, 0xa864, 0x9084, 0x00ff, 0x9086, 0x001e, 0x1518,
+	0x080c, 0x204a, 0x1904, 0x1ccd, 0x900e, 0x0804, 0x1e6a, 0xab64,
+	0x939c, 0x00ff, 0x9386, 0x0048, 0x1180, 0x00c6, 0x7004, 0x2060,
+	0x6004, 0x9086, 0x0043, 0x00ce, 0x0904, 0x1d81, 0xab9c, 0x9016,
+	0xad8c, 0xac90, 0xaf94, 0xae98, 0x0098, 0x9386, 0x0008, 0x0904,
+	0x1d81, 0x080c, 0x0dd5, 0xa964, 0x918c, 0x00ff, 0x9186, 0x0013,
+	0x0904, 0x1d32, 0x9186, 0x001b, 0x0904, 0x1d81, 0x080c, 0x0dd5,
+	0x2009, 0x030f, 0x2104, 0xd0fc, 0x0530, 0x0066, 0x2009, 0x0306,
+	0x2104, 0x9084, 0x0030, 0x15c8, 0x2031, 0x1000, 0x200b, 0x4000,
+	0x2600, 0x9302, 0x928b, 0x0000, 0xa82e, 0xa932, 0x0278, 0x9105,
+	0x0168, 0x2011, 0x0000, 0x2618, 0x2600, 0x9500, 0xa81e, 0x9481,
+	0x0000, 0xa822, 0xa880, 0xc0fd, 0xa882, 0x0020, 0xa82f, 0x0000,
+	0xa833, 0x0000, 0x006e, 0x7b12, 0x7a16, 0x7d02, 0x7c06, 0x7f0a,
+	0x7e0e, 0x782b, 0x0001, 0x7000, 0x8000, 0x7002, 0xa83c, 0x9300,
+	0xa83e, 0xa840, 0x9201, 0xa842, 0x700c, 0x9300, 0x700e, 0x7010,
+	0x9201, 0x7012, 0x080c, 0x204a, 0x0428, 0x2031, 0x0080, 0x9584,
+	0x007f, 0x0108, 0x9632, 0x7124, 0x7000, 0x9086, 0x0000, 0x1198,
+	0xc185, 0x7126, 0x2009, 0x0306, 0x2104, 0xd0b4, 0x1904, 0x1e10,
+	0x200b, 0x4040, 0x2009, 0x1a7e, 0x2104, 0x8000, 0x0a04, 0x1e10,
+	0x200a, 0x0804, 0x1e10, 0xc18d, 0x7126, 0xd184, 0x1d58, 0x0804,
+	0x1e10, 0x9006, 0x002e, 0x003e, 0x004e, 0x005e, 0x006e, 0x007e,
+	0x0005, 0x080c, 0x0dd5, 0x0026, 0x2001, 0x0105, 0x2003, 0x0010,
+	0x782b, 0x0004, 0x7003, 0x0000, 0x7004, 0x0016, 0x080c, 0x1cc0,
+	0x001e, 0x2060, 0x6014, 0x2048, 0x080c, 0xcb4a, 0x0118, 0xa880,
+	0xc0bd, 0xa882, 0x6020, 0x9086, 0x0006, 0x1180, 0x2061, 0x0100,
+	0x62c8, 0x2001, 0x00fa, 0x8001, 0x1df0, 0x60c8, 0x9206, 0x1dc0,
+	0x60c4, 0xa89a, 0x60c8, 0xa896, 0x7004, 0x2060, 0x00c6, 0x080c,
+	0xc77b, 0x00ce, 0x2001, 0x19f5, 0x2004, 0x9c06, 0x1160, 0x2009,
+	0x0040, 0x080c, 0x23d4, 0x080c, 0xa7cd, 0x2011, 0x0000, 0x080c,
+	0xa65e, 0x080c, 0x97b5, 0x002e, 0x0804, 0x1ffa, 0x0126, 0x2091,
+	0x2400, 0xa858, 0x2040, 0x792c, 0x782b, 0x0002, 0x9184, 0x0700,
+	0x1904, 0x1e73, 0x7000, 0x0002, 0x1ffa, 0x1ec8, 0x1f48, 0x1ff8,
+	0x8001, 0x7002, 0x7027, 0x0000, 0xd19c, 0x1158, 0x8aff, 0x0904,
+	0x1f15, 0x080c, 0x1cc7, 0x0904, 0x1ffa, 0x080c, 0x1cc7, 0x0804,
+	0x1ffa, 0x782b, 0x0004, 0xd194, 0x0148, 0xa880, 0xc0fc, 0xa882,
+	0x8aff, 0x1518, 0xa87c, 0xc0f5, 0xa87e, 0x00f8, 0x0026, 0x0036,
+	0xab3c, 0xaa40, 0x0016, 0x7910, 0xa82c, 0x9100, 0xa82e, 0x7914,
+	0xa830, 0x9101, 0xa832, 0x001e, 0x7810, 0x931a, 0x7814, 0x9213,
+	0x7800, 0xa81e, 0x7804, 0xa822, 0xab3e, 0xaa42, 0x003e, 0x002e,
+	0x080c, 0x2065, 0xa880, 0xc0fd, 0xa882, 0x2a00, 0xa816, 0x2800,
+	0xa85a, 0x2c00, 0xa812, 0x7003, 0x0000, 0x2009, 0x0306, 0x200b,
+	0x4800, 0x7027, 0x0000, 0x0804, 0x1ffa, 0x00f6, 0x0026, 0x781c,
+	0x0006, 0x7818, 0x0006, 0x2079, 0x0100, 0x7a14, 0x9284, 0x1984,
+	0x9085, 0x0012, 0x7816, 0x0036, 0x2019, 0x1000, 0x8319, 0x090c,
+	0x0dd5, 0x7820, 0xd0bc, 0x1dd0, 0x003e, 0x79c8, 0x000e, 0x9102,
+	0x001e, 0x0006, 0x0016, 0x79c4, 0x000e, 0x9103, 0x78c6, 0x000e,
+	0x78ca, 0x9284, 0x1984, 0x9085, 0x0012, 0x7816, 0x002e, 0x00fe,
+	0x782b, 0x0008, 0x7003, 0x0000, 0x080c, 0x1cc0, 0x0804, 0x1ffa,
+	0x8001, 0x7002, 0x7024, 0x8004, 0x7026, 0xd194, 0x0170, 0x782c,
+	0xd0fc, 0x1904, 0x1ebb, 0xd19c, 0x1904, 0x1ff6, 0x8aff, 0x0904,
+	0x1ffa, 0x080c, 0x1cc7, 0x0804, 0x1ffa, 0x0026, 0x0036, 0xab3c,
+	0xaa40, 0x080c, 0x2065, 0xdd9c, 0x1904, 0x1fb5, 0x2c05, 0x908a,
+	0x0036, 0x1a0c, 0x0dd5, 0x9082, 0x001b, 0x0002, 0x1f89, 0x1f89,
+	0x1f8b, 0x1f89, 0x1f89, 0x1f89, 0x1f91, 0x1f89, 0x1f89, 0x1f89,
+	0x1f97, 0x1f89, 0x1f89, 0x1f89, 0x1f9d, 0x1f89, 0x1f89, 0x1f89,
+	0x1fa3, 0x1f89, 0x1f89, 0x1f89, 0x1fa9, 0x1f89, 0x1f89, 0x1f89,
+	0x1faf, 0x080c, 0x0dd5, 0xa07c, 0x931a, 0xa080, 0x9213, 0x0804,
+	0x1eea, 0xa08c, 0x931a, 0xa090, 0x9213, 0x0804, 0x1eea, 0xa09c,
+	0x931a, 0xa0a0, 0x9213, 0x0804, 0x1eea, 0xa0ac, 0x931a, 0xa0b0,
+	0x9213, 0x0804, 0x1eea, 0xa0bc, 0x931a, 0xa0c0, 0x9213, 0x0804,
+	0x1eea, 0xa0cc, 0x931a, 0xa0d0, 0x9213, 0x0804, 0x1eea, 0xa0dc,
+	0x931a, 0xa0e0, 0x9213, 0x0804, 0x1eea, 0x2c05, 0x908a, 0x0034,
+	0x1a0c, 0x0dd5, 0x9082, 0x001b, 0x0002, 0x1fd8, 0x1fd6, 0x1fd6,
+	0x1fd6, 0x1fd6, 0x1fd6, 0x1fde, 0x1fd6, 0x1fd6, 0x1fd6, 0x1fd6,
+	0x1fd6, 0x1fe4, 0x1fd6, 0x1fd6, 0x1fd6, 0x1fd6, 0x1fd6, 0x1fea,
+	0x1fd6, 0x1fd6, 0x1fd6, 0x1fd6, 0x1fd6, 0x1ff0, 0x080c, 0x0dd5,
+	0xa07c, 0x931a, 0xa080, 0x9213, 0x0804, 0x1eea, 0xa094, 0x931a,
+	0xa098, 0x9213, 0x0804, 0x1eea, 0xa0ac, 0x931a, 0xa0b0, 0x9213,
+	0x0804, 0x1eea, 0xa0c4, 0x931a, 0xa0c8, 0x9213, 0x0804, 0x1eea,
+	0xa0dc, 0x931a, 0xa0e0, 0x9213, 0x0804, 0x1eea, 0x0804, 0x1ee6,
+	0x080c, 0x0dd5, 0x012e, 0x0005, 0x00f6, 0x00e6, 0x2071, 0x1a65,
+	0x7000, 0x9086, 0x0000, 0x0904, 0x2045, 0x2079, 0x0090, 0x2009,
+	0x0207, 0x210c, 0xd194, 0x01b8, 0x2009, 0x020c, 0x210c, 0x9184,
+	0x0003, 0x0188, 0x080c, 0xea2b, 0x2001, 0x0133, 0x2004, 0x9005,
+	0x090c, 0x0dd5, 0x0016, 0x2009, 0x0040, 0x080c, 0x23d4, 0x001e,
+	0x2001, 0x020c, 0x2102, 0x2009, 0x0206, 0x2104, 0x2009, 0x0203,
+	0x210c, 0x9106, 0x1120, 0x2009, 0x0040, 0x080c, 0x23d4, 0x782c,
+	0xd0fc, 0x09a8, 0x080c, 0x1eb6, 0x7000, 0x9086, 0x0000, 0x1978,
+	0x782b, 0x0004, 0x782c, 0xd0ac, 0x1de8, 0x2009, 0x0040, 0x080c,
+	0x23d4, 0x782b, 0x0002, 0x7003, 0x0000, 0x080c, 0x1cc0, 0x00ee,
+	0x00fe, 0x0005, 0xa880, 0xd0fc, 0x11a8, 0x8c60, 0x2c05, 0x9005,
+	0x0110, 0x8a51, 0x0005, 0xa004, 0x9005, 0x0168, 0xa85a, 0x2040,
+	0xa064, 0x9084, 0x000f, 0x9080, 0x2092, 0x2065, 0x8cff, 0x090c,
+	0x0dd5, 0x8a51, 0x0005, 0x2050, 0x0005, 0xa880, 0xd0fc, 0x11b8,
+	0x8a50, 0x8c61, 0x2c05, 0x9005, 0x1190, 0x2800, 0x9906, 0x0120,
+	0xa000, 0x9005, 0x1108, 0x2900, 0x2040, 0xa85a, 0xa064, 0x9084,
+	0x000f, 0x9080, 0x20a2, 0x2065, 0x8cff, 0x090c, 0x0dd5, 0x0005,
+	0x0000, 0x001d, 0x0021, 0x0025, 0x0029, 0x002d, 0x0031, 0x0035,
+	0x0000, 0x001b, 0x0021, 0x0027, 0x002d, 0x0033, 0x0000, 0x0000,
+	0x0023, 0x0000, 0x0000, 0x2085, 0x2081, 0x2085, 0x2085, 0x208f,
+	0x0000, 0x2085, 0x208c, 0x208c, 0x2089, 0x208c, 0x208c, 0x0000,
+	0x208f, 0x208c, 0x0000, 0x2087, 0x2087, 0x0000, 0x2087, 0x208f,
+	0x0000, 0x2087, 0x208d, 0x208d, 0x208d, 0x0000, 0x208d, 0x0000,
+	0x208f, 0x208d, 0x00c6, 0x00d6, 0x0086, 0xab42, 0xac3e, 0xa888,
+	0x9055, 0x0904, 0x2291, 0x2940, 0xa064, 0x90ec, 0x000f, 0x9084,
+	0x00ff, 0x9086, 0x0008, 0x1118, 0x2061, 0x208d, 0x00d0, 0x9de0,
+	0x2092, 0x9d86, 0x0007, 0x0130, 0x9d86, 0x000e, 0x0118, 0x9d86,
+	0x000f, 0x1120, 0xa08c, 0x9422, 0xa090, 0x931b, 0x2c05, 0x9065,
+	0x1140, 0x0310, 0x0804, 0x2291, 0xa004, 0x9045, 0x0904, 0x2291,
+	0x08d8, 0x2c05, 0x9005, 0x0904, 0x2179, 0xdd9c, 0x1904, 0x2135,
+	0x908a, 0x0036, 0x1a0c, 0x0dd5, 0x9082, 0x001b, 0x0002, 0x210a,
+	0x210a, 0x210c, 0x210a, 0x210a, 0x210a, 0x2112, 0x210a, 0x210a,
+	0x210a, 0x2118, 0x210a, 0x210a, 0x210a, 0x211e, 0x210a, 0x210a,
+	0x210a, 0x2124, 0x210a, 0x210a, 0x210a, 0x212a, 0x210a, 0x210a,
+	0x210a, 0x2130, 0x080c, 0x0dd5, 0xa07c, 0x9422, 0xa080, 0x931b,
+	0x0804, 0x216f, 0xa08c, 0x9422, 0xa090, 0x931b, 0x0804, 0x216f,
+	0xa09c, 0x9422, 0xa0a0, 0x931b, 0x0804, 0x216f, 0xa0ac, 0x9422,
+	0xa0b0, 0x931b, 0x0804, 0x216f, 0xa0bc, 0x9422, 0xa0c0, 0x931b,
+	0x0804, 0x216f, 0xa0cc, 0x9422, 0xa0d0, 0x931b, 0x0804, 0x216f,
+	0xa0dc, 0x9422, 0xa0e0, 0x931b, 0x04d0, 0x908a, 0x0034, 0x1a0c,
+	0x0dd5, 0x9082, 0x001b, 0x0002, 0x2157, 0x2155, 0x2155, 0x2155,
+	0x2155, 0x2155, 0x215c, 0x2155, 0x2155, 0x2155, 0x2155, 0x2155,
+	0x2161, 0x2155, 0x2155, 0x2155, 0x2155, 0x2155, 0x2166, 0x2155,
+	0x2155, 0x2155, 0x2155, 0x2155, 0x216b, 0x080c, 0x0dd5, 0xa07c,
+	0x9422, 0xa080, 0x931b, 0x0098, 0xa094, 0x9422, 0xa098, 0x931b,
+	0x0070, 0xa0ac, 0x9422, 0xa0b0, 0x931b, 0x0048, 0xa0c4, 0x9422,
+	0xa0c8, 0x931b, 0x0020, 0xa0dc, 0x9422, 0xa0e0, 0x931b, 0x0630,
+	0x2300, 0x9405, 0x0160, 0x8a51, 0x0904, 0x2291, 0x8c60, 0x0804,
+	0x20e1, 0xa004, 0x9045, 0x0904, 0x2291, 0x0804, 0x20bc, 0x8a51,
+	0x0904, 0x2291, 0x8c60, 0x2c05, 0x9005, 0x1158, 0xa004, 0x9045,
+	0x0904, 0x2291, 0xa064, 0x90ec, 0x000f, 0x9de0, 0x2092, 0x2c05,
+	0x2060, 0xa880, 0xc0fc, 0xa882, 0x0804, 0x2286, 0x2c05, 0x8422,
+	0x8420, 0x831a, 0x9399, 0x0000, 0xac2e, 0xab32, 0xdd9c, 0x1904,
+	0x2223, 0x9082, 0x001b, 0x0002, 0x21bf, 0x21bf, 0x21c1, 0x21bf,
+	0x21bf, 0x21bf, 0x21cf, 0x21bf, 0x21bf, 0x21bf, 0x21dd, 0x21bf,
+	0x21bf, 0x21bf, 0x21eb, 0x21bf, 0x21bf, 0x21bf, 0x21f9, 0x21bf,
+	0x21bf, 0x21bf, 0x2207, 0x21bf, 0x21bf, 0x21bf, 0x2215, 0x080c,
+	0x0dd5, 0xa17c, 0x2400, 0x9122, 0xa180, 0x2300, 0x911b, 0x0a0c,
+	0x0dd5, 0xa074, 0x9420, 0xa078, 0x9319, 0x0804, 0x2281, 0xa18c,
+	0x2400, 0x9122, 0xa190, 0x2300, 0x911b, 0x0a0c, 0x0dd5, 0xa084,
+	0x9420, 0xa088, 0x9319, 0x0804, 0x2281, 0xa19c, 0x2400, 0x9122,
+	0xa1a0, 0x2300, 0x911b, 0x0a0c, 0x0dd5, 0xa094, 0x9420, 0xa098,
+	0x9319, 0x0804, 0x2281, 0xa1ac, 0x2400, 0x9122, 0xa1b0, 0x2300,
+	0x911b, 0x0a0c, 0x0dd5, 0xa0a4, 0x9420, 0xa0a8, 0x9319, 0x0804,
+	0x2281, 0xa1bc, 0x2400, 0x9122, 0xa1c0, 0x2300, 0x911b, 0x0a0c,
+	0x0dd5, 0xa0b4, 0x9420, 0xa0b8, 0x9319, 0x0804, 0x2281, 0xa1cc,
+	0x2400, 0x9122, 0xa1d0, 0x2300, 0x911b, 0x0a0c, 0x0dd5, 0xa0c4,
+	0x9420, 0xa0c8, 0x9319, 0x0804, 0x2281, 0xa1dc, 0x2400, 0x9122,
+	0xa1e0, 0x2300, 0x911b, 0x0a0c, 0x0dd5, 0xa0d4, 0x9420, 0xa0d8,
+	0x9319, 0x0804, 0x2281, 0x9082, 0x001b, 0x0002, 0x2241, 0x223f,
+	0x223f, 0x223f, 0x223f, 0x223f, 0x224e, 0x223f, 0x223f, 0x223f,
+	0x223f, 0x223f, 0x225b, 0x223f, 0x223f, 0x223f, 0x223f, 0x223f,
+	0x2268, 0x223f, 0x223f, 0x223f, 0x223f, 0x223f, 0x2275, 0x080c,
+	0x0dd5, 0xa17c, 0x2400, 0x9122, 0xa180, 0x2300, 0x911b, 0x0a0c,
+	0x0dd5, 0xa06c, 0x9420, 0xa070, 0x9319, 0x0498, 0xa194, 0x2400,
+	0x9122, 0xa198, 0x2300, 0x911b, 0x0a0c, 0x0dd5, 0xa084, 0x9420,
+	0xa088, 0x9319, 0x0430, 0xa1ac, 0x2400, 0x9122, 0xa1b0, 0x2300,
+	0x911b, 0x0a0c, 0x0dd5, 0xa09c, 0x9420, 0xa0a0, 0x9319, 0x00c8,
+	0xa1c4, 0x2400, 0x9122, 0xa1c8, 0x2300, 0x911b, 0x0a0c, 0x0dd5,
+	0xa0b4, 0x9420, 0xa0b8, 0x9319, 0x0060, 0xa1dc, 0x2400, 0x9122,
+	0xa1e0, 0x2300, 0x911b, 0x0a0c, 0x0dd5, 0xa0cc, 0x9420, 0xa0d0,
+	0x9319, 0xac1e, 0xab22, 0xa880, 0xc0fd, 0xa882, 0x2800, 0xa85a,
+	0x2c00, 0xa812, 0x2a00, 0xa816, 0x000e, 0x000e, 0x000e, 0x9006,
+	0x0028, 0x008e, 0x00de, 0x00ce, 0x9085, 0x0001, 0x0005, 0x2001,
+	0x0005, 0x2004, 0xd0bc, 0x190c, 0x0dce, 0x9084, 0x0007, 0x0002,
+	0x22b2, 0x1eb6, 0x22b2, 0x22a8, 0x22ab, 0x22ae, 0x22ab, 0x22ae,
+	0x080c, 0x1eb6, 0x0005, 0x080c, 0x11a3, 0x0005, 0x080c, 0x1eb6,
+	0x080c, 0x11a3, 0x0005, 0x0126, 0x2091, 0x2600, 0x2079, 0x0200,
+	0x2071, 0x0260, 0x2069, 0x1800, 0x7817, 0x0000, 0x789b, 0x0814,
+	0x78a3, 0x0406, 0x789f, 0x0410, 0x2009, 0x013b, 0x200b, 0x0400,
+	0x781b, 0x0002, 0x783b, 0x001f, 0x7837, 0x0020, 0x7803, 0x1600,
+	0x012e, 0x0005, 0x2091, 0x2600, 0x781c, 0xd0a4, 0x190c, 0x23d1,
+	0x7900, 0xd1dc, 0x1118, 0x9084, 0x0006, 0x001a, 0x9084, 0x000e,
+	0x0002, 0x22f9, 0x22f1, 0x7d86, 0x22f1, 0x22f3, 0x22f3, 0x22f3,
+	0x22f3, 0x7d6c, 0x22f1, 0x22f5, 0x22f1, 0x22f3, 0x22f1, 0x22f3,
+	0x22f1, 0x080c, 0x0dd5, 0x0031, 0x0020, 0x080c, 0x7d6c, 0x080c,
+	0x7d86, 0x0005, 0x0006, 0x0016, 0x0026, 0x080c, 0xea2b, 0x7930,
+	0x9184, 0x0003, 0x01c0, 0x2001, 0x19f5, 0x2004, 0x9005, 0x0170,
+	0x2001, 0x0133, 0x2004, 0x9005, 0x090c, 0x0dd5, 0x00c6, 0x2001,
+	0x19f5, 0x2064, 0x080c, 0xc77b, 0x00ce, 0x00f8, 0x2009, 0x0040,
+	0x080c, 0x23d4, 0x00d0, 0x9184, 0x0014, 0x01a0, 0x6a00, 0x9286,
+	0x0003, 0x0160, 0x080c, 0x73a5, 0x1138, 0x080c, 0x768d, 0x080c,
+	0x6023, 0x080c, 0x72d7, 0x0010, 0x080c, 0x5ee2, 0x080c, 0x7e35,
+	0x0041, 0x0018, 0x9184, 0x9540, 0x1dc8, 0x002e, 0x001e, 0x000e,
+	0x0005, 0x00e6, 0x0036, 0x0046, 0x0056, 0x2071, 0x1a61, 0x080c,
+	0x1aab, 0x005e, 0x004e, 0x003e, 0x00ee, 0x0005, 0x0126, 0x2091,
+	0x2e00, 0x2071, 0x1800, 0x7128, 0x2001, 0x196e, 0x2102, 0x2001,
+	0x1976, 0x2102, 0x2001, 0x013b, 0x2102, 0x2079, 0x0200, 0x2001,
+	0x0201, 0x789e, 0x78a3, 0x0200, 0x9198, 0x0007, 0x831c, 0x831c,
+	0x831c, 0x9398, 0x0005, 0x2320, 0x9182, 0x0204, 0x1230, 0x2011,
+	0x0008, 0x8423, 0x8423, 0x8423, 0x0488, 0x9182, 0x024c, 0x1240,
+	0x2011, 0x0007, 0x8403, 0x8003, 0x9400, 0x9400, 0x9420, 0x0430,
+	0x9182, 0x02bc, 0x1238, 0x2011, 0x0006, 0x8403, 0x8003, 0x9400,
+	0x9420, 0x00e0, 0x9182, 0x034c, 0x1230, 0x2011, 0x0005, 0x8403,
+	0x8003, 0x9420, 0x0098, 0x9182, 0x042c, 0x1228, 0x2011, 0x0004,
+	0x8423, 0x8423, 0x0058, 0x9182, 0x059c, 0x1228, 0x2011, 0x0003,
+	0x8403, 0x9420, 0x0018, 0x2011, 0x0002, 0x8423, 0x9482, 0x0228,
+	0x8002, 0x8020, 0x8301, 0x9402, 0x0110, 0x0208, 0x8321, 0x8217,
+	0x8203, 0x9405, 0x789a, 0x012e, 0x0005, 0x0006, 0x00d6, 0x2069,
+	0x0200, 0x6814, 0x9084, 0xffc0, 0x910d, 0x6916, 0x00de, 0x000e,
+	0x0005, 0x00d6, 0x2069, 0x0200, 0x9005, 0x6810, 0x0110, 0xc0a5,
+	0x0008, 0xc0a4, 0x6812, 0x00de, 0x0005, 0x0006, 0x00d6, 0x2069,
+	0x0200, 0x6810, 0x9084, 0xfff8, 0x910d, 0x6912, 0x00de, 0x000e,
+	0x0005, 0x7938, 0x080c, 0x0dce, 0x00f6, 0x2079, 0x0200, 0x7902,
+	0xa001, 0xa001, 0xa001, 0xa001, 0xa001, 0xa001, 0x7902, 0xa001,
+	0xa001, 0xa001, 0xa001, 0xa001, 0xa001, 0x00fe, 0x0005, 0x0126,
+	0x2091, 0x2800, 0x2061, 0x0100, 0x2071, 0x1800, 0x2009, 0x0000,
+	0x080c, 0x2c40, 0x080c, 0x2b5b, 0x6054, 0x8004, 0x8004, 0x8004,
+	0x8004, 0x9084, 0x000c, 0x6150, 0x918c, 0xfff3, 0x9105, 0x6052,
+	0x6050, 0x9084, 0xb17f, 0x9085, 0x2000, 0x6052, 0x2009, 0x199c,
+	0x2011, 0x199d, 0x6358, 0x939c, 0x38f0, 0x2320, 0x080c, 0x2b9f,
+	0x1238, 0x939d, 0x4003, 0x94a5, 0x8603, 0x230a, 0x2412, 0x0030,
+	0x939d, 0x0203, 0x94a5, 0x8603, 0x230a, 0x2412, 0x9006, 0x080c,
+	0x2b8a, 0x9006, 0x080c, 0x2b6d, 0x20a9, 0x0012, 0x1d04, 0x2426,
+	0x2091, 0x6000, 0x1f04, 0x2426, 0x602f, 0x0100, 0x602f, 0x0000,
+	0x6050, 0x9085, 0x0400, 0x9084, 0xdfff, 0x6052, 0x6024, 0x6026,
+	0x080c, 0x2879, 0x2009, 0x00ef, 0x6132, 0x6136, 0x080c, 0x2889,
+	0x60e7, 0x0000, 0x61ea, 0x60e3, 0x0008, 0x604b, 0xf7f7, 0x6043,
+	0x0000, 0x602f, 0x0080, 0x602f, 0x0000, 0x6007, 0x349f, 0x60bb,
+	0x0000, 0x20a9, 0x0018, 0x60bf, 0x0000, 0x1f04, 0x2453, 0x60bb,
+	0x0000, 0x60bf, 0x0108, 0x60bf, 0x0012, 0x60bf, 0x0405, 0x60bf,
+	0x0014, 0x60bf, 0x0320, 0x60bf, 0x0018, 0x601b, 0x00f0, 0x601f,
+	0x001e, 0x600f, 0x006b, 0x602b, 0x402f, 0x012e, 0x0005, 0x00f6,
+	0x2079, 0x0140, 0x78c3, 0x0080, 0x78c3, 0x0083, 0x78c3, 0x0000,
+	0x00fe, 0x0005, 0x2001, 0x1835, 0x2003, 0x0000, 0x2001, 0x1834,
+	0x2003, 0x0001, 0x0005, 0x0126, 0x2091, 0x2800, 0x0006, 0x0016,
+	0x0026, 0x6124, 0x0066, 0x2031, 0x1837, 0x2634, 0x96b4, 0x0028,
+	0x006e, 0x1138, 0x6020, 0xd1bc, 0x0120, 0xd0bc, 0x1168, 0xd0b4,
+	0x1198, 0x9184, 0x5e2c, 0x1118, 0x9184, 0x0007, 0x00aa, 0x9195,
+	0x0004, 0x9284, 0x0007, 0x0082, 0x0016, 0x2001, 0x188b, 0x200c,
+	0xd184, 0x001e, 0x0d70, 0x0c98, 0x0016, 0x2001, 0x188b, 0x200c,
+	0xd194, 0x001e, 0x0d30, 0x0c58, 0x24d6, 0x24bc, 0x24bf, 0x24c2,
+	0x24c7, 0x24c9, 0x24cd, 0x24d1, 0x080c, 0x8fbe, 0x00b8, 0x080c,
+	0x908b, 0x00a0, 0x080c, 0x908b, 0x080c, 0x8fbe, 0x0078, 0x0099,
+	0x0068, 0x080c, 0x8fbe, 0x0079, 0x0048, 0x080c, 0x908b, 0x0059,
+	0x0028, 0x080c, 0x908b, 0x080c, 0x8fbe, 0x0029, 0x002e, 0x001e,
+	0x000e, 0x012e, 0x0005, 0x00a6, 0x6124, 0x6028, 0xd09c, 0x0118,
+	0xd19c, 0x1904, 0x273e, 0xd1f4, 0x190c, 0x0dce, 0x080c, 0x73a5,
+	0x0904, 0x2531, 0x080c, 0xd24a, 0x1120, 0x7000, 0x9086, 0x0003,
+	0x0570, 0x6024, 0x9084, 0x1800, 0x0550, 0x080c, 0x73c8, 0x0118,
+	0x080c, 0x73b6, 0x1520, 0x6027, 0x0020, 0x6043, 0x0000, 0x080c,
+	0xd24a, 0x0168, 0x080c, 0x73c8, 0x1150, 0x2001, 0x19a6, 0x2003,
+	0x0001, 0x6027, 0x1800, 0x080c, 0x723b, 0x0804, 0x2741, 0x70a4,
+	0x9005, 0x1150, 0x70a7, 0x0001, 0x00d6, 0x2069, 0x0140, 0x080c,
+	0x73fc, 0x00de, 0x1904, 0x2741, 0x080c, 0x7697, 0x0428, 0x080c,
+	0x73c8, 0x1590, 0x6024, 0x9084, 0x1800, 0x1108, 0x0468, 0x080c,
+	0x7697, 0x080c, 0x768d, 0x080c, 0x6023, 0x080c, 0x72d7, 0x0804,
+	0x273e, 0xd1ac, 0x1508, 0x6024, 0xd0dc, 0x1170, 0xd0e4, 0x1178,
+	0xd0d4, 0x1190, 0xd0cc, 0x0130, 0x7098, 0x9086, 0x0028, 0x1110,
+	0x080c, 0x757a, 0x0804, 0x273e, 0x080c, 0x7692, 0x0048, 0x2001,
+	0x197c, 0x2003, 0x0002, 0x0020, 0x080c, 0x74df, 0x0804, 0x273e,
+	0x080c, 0x7615, 0x0804, 0x273e, 0x6220, 0xd1bc, 0x0138, 0xd2bc,
+	0x1904, 0x27b1, 0xd2b4, 0x1904, 0x27c4, 0x0000, 0xd1ac, 0x0904,
+	0x2653, 0x0036, 0x6328, 0xc3bc, 0x632a, 0x003e, 0x080c, 0x73a5,
+	0x11c0, 0x6027, 0x0020, 0x0006, 0x0026, 0x0036, 0x080c, 0x73bf,
+	0x1158, 0x080c, 0x768d, 0x080c, 0x6023, 0x080c, 0x72d7, 0x003e,
+	0x002e, 0x000e, 0x00ae, 0x0005, 0x003e, 0x002e, 0x000e, 0x080c,
+	0x737d, 0x0016, 0x0046, 0x00c6, 0x644c, 0x9486, 0xf0f0, 0x1138,
+	0x2061, 0x0100, 0x644a, 0x6043, 0x0090, 0x6043, 0x0010, 0x74da,
+	0x948c, 0xff00, 0x7038, 0xd084, 0x0178, 0x9186, 0xf800, 0x1160,
+	0x7048, 0xd084, 0x1148, 0xc085, 0x704a, 0x0036, 0x2418, 0x2011,
+	0x8016, 0x080c, 0x4b14, 0x003e, 0x080c, 0xd243, 0x1904, 0x2630,
+	0x9196, 0xff00, 0x05a8, 0x7060, 0x9084, 0x00ff, 0x810f, 0x81ff,
+	0x0110, 0x9116, 0x0568, 0x7130, 0xd184, 0x1550, 0x080c, 0x331b,
+	0x0128, 0xc18d, 0x7132, 0x080c, 0x6973, 0x1510, 0x6240, 0x9294,
+	0x0010, 0x0130, 0x6248, 0x9294, 0xff00, 0x9296, 0xff00, 0x01c0,
+	0x7030, 0xd08c, 0x0904, 0x2630, 0x7038, 0xd08c, 0x1140, 0x2001,
+	0x180c, 0x200c, 0xd1ac, 0x1904, 0x2630, 0xc1ad, 0x2102, 0x0036,
+	0x73d8, 0x2011, 0x8013, 0x080c, 0x4b14, 0x003e, 0x0804, 0x2630,
+	0x7038, 0xd08c, 0x1140, 0x2001, 0x180c, 0x200c, 0xd1ac, 0x1904,
+	0x2630, 0xc1ad, 0x2102, 0x0036, 0x73d8, 0x2011, 0x8013, 0x080c,
+	0x4b14, 0x003e, 0x7130, 0xc185, 0x7132, 0x2011, 0x1848, 0x220c,
+	0xd1a4, 0x01f0, 0x0016, 0x2009, 0x0001, 0x2011, 0x0100, 0x080c,
+	0x86c6, 0x2019, 0x000e, 0x00c6, 0x2061, 0x0000, 0x080c, 0xe543,
+	0x00ce, 0x9484, 0x00ff, 0x9080, 0x3327, 0x200d, 0x918c, 0xff00,
+	0x810f, 0x2120, 0x9006, 0x2009, 0x000e, 0x080c, 0xe5cf, 0x001e,
+	0x0016, 0x2009, 0x0002, 0x2019, 0x0004, 0x080c, 0x318c, 0x001e,
+	0x0078, 0x0156, 0x00b6, 0x20a9, 0x007f, 0x900e, 0x080c, 0x6608,
+	0x1110, 0x080c, 0x603d, 0x8108, 0x1f04, 0x2626, 0x00be, 0x015e,
+	0x00ce, 0x004e, 0x080c, 0xade2, 0x60e3, 0x0000, 0x001e, 0x2001,
+	0x1800, 0x2014, 0x9296, 0x0004, 0x1170, 0xd19c, 0x11a0, 0x2011,
+	0x180c, 0x2214, 0xd29c, 0x1120, 0x6204, 0x9295, 0x0002, 0x6206,
+	0x6228, 0xc29d, 0x622a, 0x2003, 0x0001, 0x2001, 0x1826, 0x2003,
+	0x0000, 0x6027, 0x0020, 0xd194, 0x0904, 0x273e, 0x0016, 0x6220,
+	0xd2b4, 0x0904, 0x26db, 0x080c, 0x8562, 0x080c, 0xa274, 0x6027,
+	0x0004, 0x00f6, 0x2019, 0x19ef, 0x2304, 0x907d, 0x0904, 0x26aa,
+	0x7804, 0x9086, 0x0032, 0x15f0, 0x00d6, 0x00c6, 0x00e6, 0x0096,
+	0x2069, 0x0140, 0x782c, 0x685e, 0x7808, 0x685a, 0x6043, 0x0002,
+	0x2001, 0x0003, 0x8001, 0x1df0, 0x6043, 0x0000, 0x2001, 0x003c,
+	0x8001, 0x1df0, 0x080c, 0x2d01, 0x2001, 0x001e, 0x8001, 0x0240,
+	0x20a9, 0x0009, 0x080c, 0x2c1b, 0x6904, 0xd1dc, 0x1140, 0x0cb0,
+	0x2001, 0x0100, 0x080c, 0x2cf1, 0x9006, 0x080c, 0x2cf1, 0x080c,
+	0x957b, 0x080c, 0x9687, 0x7814, 0x2048, 0xa867, 0x0103, 0x2f60,
+	0x080c, 0xae71, 0x009e, 0x00ee, 0x00ce, 0x00de, 0x00fe, 0x001e,
+	0x00ae, 0x0005, 0x00fe, 0x00d6, 0x2069, 0x0140, 0x6804, 0x9084,
+	0x4000, 0x0110, 0x080c, 0x2d01, 0x00de, 0x00c6, 0x2061, 0x19e6,
+	0x6028, 0x080c, 0xd24a, 0x0120, 0x909a, 0x0003, 0x1258, 0x0018,
+	0x909a, 0x00c8, 0x1238, 0x8000, 0x602a, 0x00ce, 0x080c, 0xa250,
+	0x0804, 0x273d, 0x2061, 0x0100, 0x62c0, 0x080c, 0xac68, 0x2019,
+	0x19ef, 0x2304, 0x9065, 0x0120, 0x2009, 0x0027, 0x080c, 0xaeec,
+	0x00ce, 0x0804, 0x273d, 0xd2bc, 0x0904, 0x2724, 0x080c, 0x856f,
+	0x6014, 0x9084, 0x1984, 0x9085, 0x0010, 0x6016, 0x6027, 0x0004,
+	0x00d6, 0x2069, 0x0140, 0x6804, 0x9084, 0x4000, 0x0110, 0x080c,
+	0x2d01, 0x00de, 0x00c6, 0x2061, 0x19e6, 0x6044, 0x080c, 0xd24a,
+	0x0120, 0x909a, 0x0003, 0x1658, 0x0018, 0x909a, 0x00c8, 0x1638,
+	0x8000, 0x6046, 0x603c, 0x00ce, 0x9005, 0x05b8, 0x2009, 0x07d0,
+	0x080c, 0x8567, 0x9080, 0x0008, 0x2004, 0x9086, 0x0006, 0x1138,
+	0x6114, 0x918c, 0x1984, 0x918d, 0x0012, 0x6116, 0x0430, 0x9080,
+	0x0008, 0x2004, 0x9086, 0x0009, 0x0d98, 0x6114, 0x918c, 0x1984,
+	0x918d, 0x0016, 0x6116, 0x00c8, 0x6027, 0x0004, 0x00b0, 0x0036,
+	0x2019, 0x0001, 0x080c, 0xa5b7, 0x003e, 0x2019, 0x19f5, 0x2304,
+	0x9065, 0x0150, 0x2009, 0x004f, 0x6020, 0x9086, 0x0009, 0x1110,
+	0x2009, 0x004f, 0x080c, 0xaeec, 0x00ce, 0x001e, 0xd19c, 0x0904,
+	0x27ac, 0x7038, 0xd0ac, 0x1904, 0x2785, 0x0016, 0x0156, 0x6027,
+	0x0008, 0x6050, 0x9085, 0x0040, 0x6052, 0x6050, 0x9084, 0xfbcf,
+	0x6052, 0x080c, 0x2c3a, 0x9085, 0x2000, 0x6052, 0x20a9, 0x0012,
+	0x1d04, 0x2758, 0x080c, 0x8596, 0x1f04, 0x2758, 0x6050, 0x9085,
+	0x0400, 0x9084, 0xdfbf, 0x6052, 0x20a9, 0x0028, 0xa001, 0x1f04,
+	0x2766, 0x6150, 0x9185, 0x1400, 0x6052, 0x20a9, 0x0366, 0x1d04,
+	0x276f, 0x080c, 0x8596, 0x6020, 0xd09c, 0x1130, 0x015e, 0x6152,
+	0x001e, 0x6027, 0x0008, 0x0480, 0x080c, 0x2c02, 0x1f04, 0x276f,
+	0x015e, 0x6152, 0x001e, 0x6027, 0x0008, 0x0016, 0x6028, 0xc09c,
+	0x602a, 0x080c, 0xade2, 0x60e3, 0x0000, 0x080c, 0xea0a, 0x080c,
+	0xea25, 0x080c, 0x56dc, 0xd0fc, 0x1138, 0x080c, 0xd243, 0x1120,
+	0x9085, 0x0001, 0x080c, 0x73ec, 0x9006, 0x080c, 0x2cf1, 0x2009,
+	0x0002, 0x080c, 0x2c40, 0x2001, 0x1800, 0x2003, 0x0004, 0x6027,
+	0x0008, 0x080c, 0x0bae, 0x001e, 0x918c, 0xffd0, 0x6126, 0x00ae,
+	0x0005, 0x0016, 0x2001, 0x188b, 0x200c, 0xd184, 0x001e, 0x0904,
+	0x255e, 0x0016, 0x2009, 0x27bd, 0x00d0, 0x2001, 0x188b, 0x200c,
+	0xc184, 0x2102, 0x001e, 0x0c40, 0x0016, 0x2001, 0x188b, 0x200c,
+	0xd194, 0x001e, 0x0904, 0x255e, 0x0016, 0x2009, 0x27d0, 0x0038,
+	0x2001, 0x188b, 0x200c, 0xc194, 0x2102, 0x001e, 0x08a8, 0x6028,
+	0xc0bc, 0x602a, 0x2001, 0x0156, 0x2003, 0xbc91, 0x8000, 0x2003,
+	0xffff, 0x6043, 0x0001, 0x080c, 0x2c3a, 0x6027, 0x0080, 0x6017,
+	0x0000, 0x6043, 0x0000, 0x0817, 0x0006, 0x0016, 0x0026, 0x0036,
+	0x00e6, 0x00f6, 0x0126, 0x2091, 0x8000, 0x2071, 0x1800, 0x71d0,
+	0x70d2, 0x9116, 0x05e8, 0x81ff, 0x01a0, 0x2009, 0x0000, 0x080c,
+	0x2c40, 0x2011, 0x8011, 0x2019, 0x010e, 0x231c, 0x939e, 0x0007,
+	0x1118, 0x2019, 0x0001, 0x0010, 0x2019, 0x0000, 0x080c, 0x4b14,
+	0x0438, 0x2001, 0x19a7, 0x200c, 0x81ff, 0x1140, 0x2001, 0x0109,
+	0x2004, 0xd0b4, 0x0118, 0x2019, 0x0003, 0x0008, 0x2118, 0x2011,
+	0x8012, 0x080c, 0x4b14, 0x080c, 0x56dc, 0xd0fc, 0x1188, 0x080c,
+	0xd243, 0x1170, 0x00c6, 0x080c, 0x28d4, 0x080c, 0xa51e, 0x2061,
+	0x0100, 0x2019, 0x0028, 0x2009, 0x0002, 0x080c, 0x318c, 0x00ce,
+	0x012e, 0x00fe, 0x00ee, 0x003e, 0x002e, 0x001e, 0x000e, 0x0005,
+	0x2028, 0x918c, 0x00ff, 0x2130, 0x9094, 0xff00, 0x11f0, 0x2011,
+	0x1837, 0x2214, 0xd2ac, 0x11c8, 0x81ff, 0x01e8, 0x2011, 0x181f,
+	0x2204, 0x9106, 0x1190, 0x2011, 0x1820, 0x2214, 0x9294, 0xff00,
+	0x9584, 0xff00, 0x9206, 0x1148, 0x2011, 0x1820, 0x2214, 0x9294,
+	0x00ff, 0x9584, 0x00ff, 0x9206, 0x1120, 0x2500, 0x080c, 0x80a7,
+	0x0048, 0x9584, 0x00ff, 0x9080, 0x3327, 0x200d, 0x918c, 0xff00,
+	0x810f, 0x9006, 0x0005, 0x9080, 0x3327, 0x200d, 0x918c, 0x00ff,
+	0x0005, 0x00d6, 0x2069, 0x0140, 0x2001, 0x1818, 0x2003, 0x00ef,
+	0x20a9, 0x0010, 0x9006, 0x6852, 0x6856, 0x1f04, 0x2884, 0x00de,
+	0x0005, 0x0006, 0x00d6, 0x0026, 0x2069, 0x0140, 0x2001, 0x1818,
+	0x2102, 0x8114, 0x8214, 0x8214, 0x8214, 0x20a9, 0x0010, 0x6853,
+	0x0000, 0x9006, 0x82ff, 0x1128, 0x9184, 0x000f, 0x9080, 0xf1d7,
+	0x2005, 0x6856, 0x8211, 0x1f04, 0x2899, 0x002e, 0x00de, 0x000e,
+	0x0005, 0x00c6, 0x2061, 0x1800, 0x6030, 0x0110, 0xc09d, 0x0008,
+	0xc09c, 0x6032, 0x00ce, 0x0005, 0x0156, 0x00d6, 0x0026, 0x0016,
+	0x0006, 0x2069, 0x0140, 0x6980, 0x9116, 0x0180, 0x9112, 0x1230,
+	0x8212, 0x8210, 0x22a8, 0x2001, 0x0402, 0x0018, 0x22a8, 0x2001,
+	0x0404, 0x680e, 0x1f04, 0x28c9, 0x680f, 0x0000, 0x000e, 0x001e,
+	0x002e, 0x00de, 0x015e, 0x0005, 0x080c, 0x56d8, 0xd0c4, 0x0150,
+	0xd0a4, 0x0140, 0x9006, 0x0046, 0x2020, 0x2009, 0x002e, 0x080c,
+	0xe5cf, 0x004e, 0x0005, 0x00f6, 0x0016, 0x0026, 0x2079, 0x0140,
+	0x78c4, 0xd0dc, 0x0904, 0x2940, 0x080c, 0x2b9f, 0x0660, 0x9084,
+	0x0700, 0x908e, 0x0600, 0x1120, 0x2011, 0x4000, 0x900e, 0x0458,
+	0x908e, 0x0500, 0x1120, 0x2011, 0x8000, 0x900e, 0x0420, 0x908e,
+	0x0400, 0x1120, 0x9016, 0x2009, 0x0001, 0x00e8, 0x908e, 0x0300,
+	0x1120, 0x9016, 0x2009, 0x0002, 0x00b0, 0x908e, 0x0200, 0x1120,
+	0x9016, 0x2009, 0x0004, 0x0078, 0x908e, 0x0100, 0x1548, 0x9016,
+	0x2009, 0x0008, 0x0040, 0x9084, 0x0700, 0x908e, 0x0300, 0x1500,
+	0x2011, 0x0030, 0x0058, 0x2300, 0x9080, 0x0020, 0x2018, 0x080c,
+	0x8f51, 0x928c, 0xff00, 0x0110, 0x2011, 0x00ff, 0x2200, 0x8007,
+	0x9085, 0x004c, 0x78c2, 0x2009, 0x0138, 0x220a, 0x080c, 0x73a5,
+	0x1118, 0x2009, 0x196c, 0x220a, 0x002e, 0x001e, 0x00fe, 0x0005,
+	0x78c3, 0x0000, 0x0cc8, 0x0126, 0x2091, 0x2800, 0x0006, 0x0016,
+	0x0026, 0x2001, 0x0170, 0x200c, 0x8000, 0x2014, 0x9184, 0x0003,
+	0x0110, 0x080c, 0x0dce, 0x002e, 0x001e, 0x000e, 0x012e, 0x0005,
+	0x2001, 0x0171, 0x2004, 0xd0dc, 0x0168, 0x2001, 0x0170, 0x200c,
+	0x918c, 0x00ff, 0x918e, 0x004c, 0x1128, 0x200c, 0x918c, 0xff00,
+	0x810f, 0x0005, 0x900e, 0x2001, 0x0227, 0x2004, 0x8007, 0x9084,
+	0x00ff, 0x8004, 0x9108, 0x2001, 0x0226, 0x2004, 0x8007, 0x9084,
+	0x00ff, 0x8004, 0x9108, 0x0005, 0x0018, 0x000c, 0x0018, 0x0020,
+	0x1000, 0x0800, 0x1000, 0x1800, 0x0156, 0x0006, 0x0016, 0x0026,
+	0x00e6, 0x2001, 0x198f, 0x2004, 0x908a, 0x0007, 0x1a0c, 0x0dd5,
+	0x0033, 0x00ee, 0x002e, 0x001e, 0x000e, 0x015e, 0x0005, 0x299e,
+	0x29bc, 0x29e0, 0x29e2, 0x2a0b, 0x2a0d, 0x2a0f, 0x2001, 0x0001,
+	0x080c, 0x27ec, 0x080c, 0x2bfd, 0x2001, 0x1991, 0x2003, 0x0000,
+	0x7828, 0x9084, 0xe1d7, 0x782a, 0x9006, 0x20a9, 0x0009, 0x080c,
+	0x2bbb, 0x2001, 0x198f, 0x2003, 0x0006, 0x2009, 0x001e, 0x2011,
+	0x2a10, 0x080c, 0x8574, 0x0005, 0x2009, 0x1994, 0x200b, 0x0000,
+	0x2001, 0x1999, 0x2003, 0x0036, 0x2001, 0x1998, 0x2003, 0x002a,
+	0x2001, 0x1991, 0x2003, 0x0001, 0x9006, 0x080c, 0x2b6d, 0x2001,
+	0xffff, 0x20a9, 0x0009, 0x080c, 0x2bbb, 0x2001, 0x198f, 0x2003,
+	0x0006, 0x2009, 0x001e, 0x2011, 0x2a10, 0x080c, 0x8574, 0x0005,
+	0x080c, 0x0dd5, 0x2001, 0x1999, 0x2003, 0x0036, 0x2001, 0x1991,
+	0x2003, 0x0003, 0x7a38, 0x9294, 0x0005, 0x9296, 0x0004, 0x0110,
+	0x9006, 0x0010, 0x2001, 0x0001, 0x080c, 0x2b6d, 0x2001, 0x1995,
+	0x2003, 0x0000, 0x2001, 0xffff, 0x20a9, 0x0009, 0x080c, 0x2bbb,
+	0x2001, 0x198f, 0x2003, 0x0006, 0x2009, 0x001e, 0x2011, 0x2a10,
+	0x080c, 0x8574, 0x0005, 0x080c, 0x0dd5, 0x080c, 0x0dd5, 0x0005,
+	0x0006, 0x0016, 0x0026, 0x00e6, 0x00f6, 0x0156, 0x0126, 0x2091,
+	0x8000, 0x2079, 0x0100, 0x2001, 0x1991, 0x2004, 0x908a, 0x0007,
+	0x1a0c, 0x0dd5, 0x0043, 0x012e, 0x015e, 0x00fe, 0x00ee, 0x002e,
+	0x001e, 0x000e, 0x0005, 0x2a32, 0x2a52, 0x2a92, 0x2ac2, 0x2ae6,
+	0x2af6, 0x2af8, 0x080c, 0x2baf, 0x11b0, 0x7850, 0x9084, 0xefff,
+	0x7852, 0x2009, 0x1997, 0x2104, 0x7a38, 0x9294, 0x0005, 0x9296,
+	0x0004, 0x0110, 0xc08d, 0x0008, 0xc085, 0x200a, 0x2001, 0x198f,
+	0x2003, 0x0001, 0x0030, 0x080c, 0x2b1c, 0x2001, 0xffff, 0x080c,
+	0x29ad, 0x0005, 0x080c, 0x2afa, 0x05e0, 0x2009, 0x1998, 0x2104,
+	0x8001, 0x200a, 0x080c, 0x2baf, 0x1178, 0x7850, 0x9084, 0xefff,
+	0x7852, 0x7a38, 0x9294, 0x0005, 0x9296, 0x0005, 0x0518, 0x2009,
+	0x1997, 0x2104, 0xc085, 0x200a, 0x2009, 0x1994, 0x2104, 0x8000,
+	0x200a, 0x9086, 0x0005, 0x0118, 0x080c, 0x2b02, 0x00c0, 0x200b,
+	0x0000, 0x7a38, 0x9294, 0x0006, 0x9296, 0x0004, 0x0110, 0x9006,
+	0x0010, 0x2001, 0x0001, 0x080c, 0x2b8a, 0x2001, 0x1991, 0x2003,
+	0x0002, 0x0028, 0x2001, 0x198f, 0x2003, 0x0003, 0x0010, 0x080c,
+	0x29cf, 0x0005, 0x080c, 0x2afa, 0x0560, 0x2009, 0x1998, 0x2104,
+	0x8001, 0x200a, 0x080c, 0x2baf, 0x1168, 0x7850, 0x9084, 0xefff,
+	0x7852, 0x2001, 0x198f, 0x2003, 0x0003, 0x2001, 0x1990, 0x2003,
+	0x0000, 0x00b8, 0x2009, 0x1998, 0x2104, 0x9005, 0x1118, 0x080c,
+	0x2b3f, 0x0010, 0x080c, 0x2b0f, 0x080c, 0x2b02, 0x2009, 0x1994,
+	0x200b, 0x0000, 0x2001, 0x1991, 0x2003, 0x0001, 0x080c, 0x29cf,
+	0x0000, 0x0005, 0x04b9, 0x0508, 0x080c, 0x2baf, 0x11b8, 0x7850,
+	0x9084, 0xefff, 0x7852, 0x2009, 0x1995, 0x2104, 0x8000, 0x200a,
+	0x9086, 0x0007, 0x0108, 0x0078, 0x2001, 0x199a, 0x2003, 0x000a,
+	0x2009, 0x1997, 0x2104, 0xc0fd, 0x200a, 0x0038, 0x0419, 0x2001,
+	0x1991, 0x2003, 0x0004, 0x080c, 0x29fa, 0x0005, 0x0099, 0x0168,
+	0x080c, 0x2baf, 0x1138, 0x7850, 0x9084, 0xefff, 0x7852, 0x080c,
+	0x29e6, 0x0018, 0x0079, 0x080c, 0x29fa, 0x0005, 0x080c, 0x0dd5,
+	0x080c, 0x0dd5, 0x2009, 0x1999, 0x2104, 0x8001, 0x200a, 0x090c,
+	0x2b5b, 0x0005, 0x7a38, 0x9294, 0x0005, 0x9296, 0x0005, 0x0110,
+	0x9006, 0x0010, 0x2001, 0x0001, 0x080c, 0x2b8a, 0x0005, 0x7a38,
+	0x9294, 0x0006, 0x9296, 0x0006, 0x0110, 0x9006, 0x0010, 0x2001,
+	0x0001, 0x080c, 0x2b6d, 0x0005, 0x2009, 0x1994, 0x2104, 0x8000,
+	0x200a, 0x9086, 0x0005, 0x0108, 0x0068, 0x200b, 0x0000, 0x7a38,
+	0x9294, 0x0006, 0x9296, 0x0006, 0x0110, 0x9006, 0x0010, 0x2001,
+	0x0001, 0x04d9, 0x7a38, 0x9294, 0x0005, 0x9296, 0x0005, 0x0110,
+	0x9006, 0x0010, 0x2001, 0x0001, 0x080c, 0x2b8a, 0x0005, 0x0086,
+	0x2001, 0x1997, 0x2004, 0x9084, 0x7fff, 0x090c, 0x0dd5, 0x2009,
+	0x1996, 0x2144, 0x8846, 0x280a, 0x9844, 0x0dd8, 0xd08c, 0x1120,
+	0xd084, 0x1120, 0x080c, 0x0dd5, 0x9006, 0x0010, 0x2001, 0x0001,
+	0x00a1, 0x008e, 0x0005, 0x0006, 0x0156, 0x2001, 0x198f, 0x20a9,
+	0x0009, 0x2003, 0x0000, 0x8000, 0x1f04, 0x2b61, 0x2001, 0x1996,
+	0x2003, 0x8000, 0x015e, 0x000e, 0x0005, 0x00f6, 0x2079, 0x0100,
+	0x9085, 0x0000, 0x0158, 0x7838, 0x9084, 0xfff9, 0x9085, 0x0004,
+	0x783a, 0x2009, 0x199c, 0x210c, 0x795a, 0x0050, 0x7838, 0x9084,
+	0xfffb, 0x9085, 0x0006, 0x783a, 0x2009, 0x199d, 0x210c, 0x795a,
+	0x00fe, 0x0005, 0x00f6, 0x2079, 0x0100, 0x9085, 0x0000, 0x0138,
+	0x7838, 0x9084, 0xfffa, 0x9085, 0x0004, 0x783a, 0x0030, 0x7838,
+	0x9084, 0xfffb, 0x9085, 0x0005, 0x783a, 0x00fe, 0x0005, 0x0006,
+	0x2001, 0x0100, 0x2004, 0x9082, 0x0007, 0x000e, 0x0005, 0x0006,
+	0x2001, 0x0100, 0x2004, 0x9082, 0x0009, 0x000e, 0x0005, 0x0156,
+	0x20a9, 0x0064, 0x7820, 0x080c, 0x2c3a, 0xd09c, 0x1110, 0x1f04,
+	0x2bb2, 0x015e, 0x0005, 0x0126, 0x0016, 0x0006, 0x2091, 0x8000,
+	0x7850, 0x9085, 0x0040, 0x7852, 0x7850, 0x9084, 0xfbcf, 0x7852,
+	0x080c, 0x2c3a, 0x9085, 0x2000, 0x7852, 0x000e, 0x2008, 0x9186,
+	0x0000, 0x1118, 0x783b, 0x0007, 0x0090, 0x9186, 0x0001, 0x1118,
+	0x783b, 0x0006, 0x0060, 0x9186, 0x0002, 0x1118, 0x783b, 0x0005,
+	0x0030, 0x9186, 0x0003, 0x1118, 0x783b, 0x0004, 0x0000, 0x0006,
+	0x1d04, 0x2be8, 0x080c, 0x8596, 0x1f04, 0x2be8, 0x7850, 0x9085,
+	0x0400, 0x9084, 0xdfbf, 0x7852, 0x080c, 0x2c3a, 0x9085, 0x1000,
+	0x7852, 0x000e, 0x001e, 0x012e, 0x0005, 0x7850, 0x9084, 0xffcf,
+	0x7852, 0x0005, 0x0006, 0x0156, 0x00f6, 0x2079, 0x0100, 0x20a9,
+	0x000a, 0x7854, 0xd0ac, 0x1130, 0x7820, 0xd0e4, 0x1140, 0x1f04,
+	0x2c0c, 0x0028, 0x7854, 0xd08c, 0x1110, 0x1f04, 0x2c12, 0x00fe,
+	0x015e, 0x000e, 0x0005, 0x1d04, 0x2c1b, 0x080c, 0x8596, 0x1f04,
+	0x2c1b, 0x0005, 0x0006, 0x2001, 0x199b, 0x2004, 0x9086, 0x0000,
+	0x000e, 0x0005, 0x0006, 0x2001, 0x199b, 0x2004, 0x9086, 0x0001,
+	0x000e, 0x0005, 0x0006, 0x2001, 0x199b, 0x2004, 0x9086, 0x0002,
+	0x000e, 0x0005, 0xa001, 0xa001, 0xa001, 0xa001, 0xa001, 0x0005,
+	0x0006, 0x2001, 0x19a7, 0x2102, 0x000e, 0x0005, 0x2009, 0x0171,
+	0x2104, 0xd0dc, 0x0140, 0x2009, 0x0170, 0x2104, 0x200b, 0x0080,
+	0xa001, 0xa001, 0x200a, 0x0005, 0x0036, 0x0046, 0x2001, 0x0141,
+	0x200c, 0x918c, 0xff00, 0x9186, 0x2000, 0x0118, 0x9186, 0x0100,
+	0x1588, 0x2009, 0x00a2, 0x080c, 0x0e51, 0x2019, 0x0160, 0x2324,
+	0x2011, 0x0003, 0x2009, 0x0169, 0x2104, 0x9084, 0x0007, 0x210c,
+	0x918c, 0x0007, 0x910e, 0x1db0, 0x9086, 0x0003, 0x11b8, 0x2304,
+	0x9402, 0x02a0, 0x1d60, 0x8211, 0x1d68, 0x84ff, 0x0170, 0x2001,
+	0x0141, 0x200c, 0x918c, 0xff00, 0x9186, 0x0100, 0x0130, 0x2009,
+	0x180c, 0x2104, 0xc0dd, 0x200a, 0x0008, 0x0419, 0x2009, 0x0000,
+	0x080c, 0x0e51, 0x004e, 0x003e, 0x0005, 0x2001, 0x180c, 0x2004,
+	0xd0dc, 0x01b0, 0x2001, 0x0160, 0x2004, 0x9005, 0x0140, 0x2001,
+	0x0141, 0x2004, 0x9084, 0xff00, 0x9086, 0x0100, 0x1148, 0x0126,
+	0x2091, 0x8000, 0x0016, 0x0026, 0x0021, 0x002e, 0x001e, 0x012e,
+	0x0005, 0x00c6, 0x2061, 0x0100, 0x6014, 0x0006, 0x2001, 0x0161,
+	0x2003, 0x0000, 0x6017, 0x0018, 0xa001, 0xa001, 0x602f, 0x0008,
+	0x6104, 0x918e, 0x0010, 0x6106, 0x918e, 0x0010, 0x6106, 0x6017,
+	0x0040, 0x04b9, 0x001e, 0x9184, 0x0003, 0x01e0, 0x0036, 0x0016,
+	0x2019, 0x0141, 0x6124, 0x918c, 0x0028, 0x1120, 0x2304, 0x9084,
+	0x2800, 0x0dc0, 0x001e, 0x919c, 0xffe4, 0x9184, 0x0001, 0x0118,
+	0x9385, 0x0009, 0x6016, 0x9184, 0x0002, 0x0118, 0x9385, 0x0012,
+	0x6016, 0x003e, 0x2001, 0x180c, 0x200c, 0xc1dc, 0x2102, 0x00ce,
+	0x0005, 0x0016, 0x0026, 0x080c, 0x73bf, 0x0108, 0xc0bc, 0x2009,
 	0x0140, 0x2114, 0x9294, 0x0001, 0x9215, 0x220a, 0x002e, 0x001e,
-	0x0005, 0x0006, 0x0016, 0x2009, 0x0140, 0x2104, 0x1128, 0x080c,
-	0x73d6, 0x0110, 0xc0bc, 0x0008, 0xc0bd, 0x200a, 0x001e, 0x000e,
-	0x0005, 0x2f95, 0x2f95, 0x2db9, 0x2db9, 0x2dc5, 0x2dc5, 0x2dd1,
-	0x2dd1, 0x2ddf, 0x2ddf, 0x2deb, 0x2deb, 0x2df9, 0x2df9, 0x2e07,
-	0x2e07, 0x2e19, 0x2e19, 0x2e25, 0x2e25, 0x2e33, 0x2e33, 0x2e51,
-	0x2e51, 0x2e71, 0x2e71, 0x2e41, 0x2e41, 0x2e61, 0x2e61, 0x2e7f,
-	0x2e7f, 0x2e17, 0x2e17, 0x2e17, 0x2e17, 0x2e17, 0x2e17, 0x2e17,
-	0x2e17, 0x2e17, 0x2e17, 0x2e17, 0x2e17, 0x2e17, 0x2e17, 0x2e17,
-	0x2e17, 0x2e17, 0x2e17, 0x2e17, 0x2e17, 0x2e17, 0x2e17, 0x2e17,
-	0x2e17, 0x2e17, 0x2e17, 0x2e17, 0x2e17, 0x2e17, 0x2e17, 0x2e17,
-	0x2e17, 0x2e91, 0x2e91, 0x2e9d, 0x2e9d, 0x2eab, 0x2eab, 0x2eb9,
-	0x2eb9, 0x2ec9, 0x2ec9, 0x2ed7, 0x2ed7, 0x2ee7, 0x2ee7, 0x2ef7,
-	0x2ef7, 0x2f09, 0x2f09, 0x2f17, 0x2f17, 0x2f27, 0x2f27, 0x2f49,
-	0x2f49, 0x2f6b, 0x2f6b, 0x2f37, 0x2f37, 0x2f5a, 0x2f5a, 0x2f7a,
-	0x2f7a, 0x2e17, 0x2e17, 0x2e17, 0x2e17, 0x2e17, 0x2e17, 0x2e17,
-	0x2e17, 0x2e17, 0x2e17, 0x2e17, 0x2e17, 0x2e17, 0x2e17, 0x2e17,
-	0x2e17, 0x2e17, 0x2e17, 0x2e17, 0x2e17, 0x2e17, 0x2e17, 0x2e17,
-	0x2e17, 0x2e17, 0x2e17, 0x2e17, 0x2e17, 0x2e17, 0x2e17, 0x2e17,
-	0x2e17, 0x2e17, 0x2e17, 0x2e17, 0x2e17, 0x2e17, 0x2e17, 0x2e17,
-	0x2e17, 0x2e17, 0x2e17, 0x2e17, 0x2e17, 0x2e17, 0x2e17, 0x2e17,
-	0x2e17, 0x0106, 0x0006, 0x0126, 0x01c6, 0x01d6, 0x0136, 0x0146,
-	0x0156, 0x080c, 0x2481, 0x0804, 0x2f8d, 0x0106, 0x0006, 0x0126,
-	0x01c6, 0x01d6, 0x0136, 0x0146, 0x0156, 0x080c, 0x2295, 0x0804,
-	0x2f8d, 0x0106, 0x0006, 0x0126, 0x01c6, 0x01d6, 0x0136, 0x0146,
-	0x0156, 0x080c, 0x2295, 0x080c, 0x2481, 0x0804, 0x2f8d, 0x0106,
-	0x0006, 0x0126, 0x01c6, 0x01d6, 0x0136, 0x0146, 0x0156, 0x080c,
-	0x22d0, 0x0804, 0x2f8d, 0x0106, 0x0006, 0x0126, 0x01c6, 0x01d6,
-	0x0136, 0x0146, 0x0156, 0x080c, 0x2481, 0x080c, 0x22d0, 0x0804,
-	0x2f8d, 0x0106, 0x0006, 0x0126, 0x01c6, 0x01d6, 0x0136, 0x0146,
-	0x0156, 0x080c, 0x2295, 0x080c, 0x22d0, 0x0804, 0x2f8d, 0x0106,
-	0x0006, 0x0126, 0x01c6, 0x01d6, 0x0136, 0x0146, 0x0156, 0x080c,
-	0x2295, 0x080c, 0x2481, 0x080c, 0x22d0, 0x0804, 0x2f8d, 0xa001,
-	0x0cf0, 0x0106, 0x0006, 0x0126, 0x01c6, 0x01d6, 0x0136, 0x0146,
-	0x0156, 0x080c, 0x1380, 0x0804, 0x2f8d, 0x0106, 0x0006, 0x0126,
-	0x01c6, 0x01d6, 0x0136, 0x0146, 0x0156, 0x080c, 0x2481, 0x080c,
-	0x1380, 0x0804, 0x2f8d, 0x0106, 0x0006, 0x0126, 0x01c6, 0x01d6,
-	0x0136, 0x0146, 0x0156, 0x080c, 0x2295, 0x080c, 0x1380, 0x0804,
-	0x2f8d, 0x0106, 0x0006, 0x0126, 0x01c6, 0x01d6, 0x0136, 0x0146,
-	0x0156, 0x080c, 0x2481, 0x080c, 0x1380, 0x080c, 0x22d0, 0x0804,
-	0x2f8d, 0x0106, 0x0006, 0x0126, 0x01c6, 0x01d6, 0x0136, 0x0146,
-	0x0156, 0x080c, 0x2295, 0x080c, 0x2481, 0x080c, 0x1380, 0x0804,
-	0x2f8d, 0x0106, 0x0006, 0x0126, 0x01c6, 0x01d6, 0x0136, 0x0146,
-	0x0156, 0x080c, 0x2295, 0x080c, 0x1380, 0x080c, 0x22d0, 0x0804,
-	0x2f8d, 0x0106, 0x0006, 0x0126, 0x01c6, 0x01d6, 0x0136, 0x0146,
-	0x0156, 0x080c, 0x1380, 0x080c, 0x22d0, 0x0804, 0x2f8d, 0x0106,
-	0x0006, 0x0126, 0x01c6, 0x01d6, 0x0136, 0x0146, 0x0156, 0x080c,
-	0x2295, 0x080c, 0x2481, 0x080c, 0x1380, 0x080c, 0x22d0, 0x0804,
-	0x2f8d, 0x0106, 0x0006, 0x0126, 0x01c6, 0x01d6, 0x0136, 0x0146,
-	0x0156, 0x080c, 0x2941, 0x0804, 0x2f8d, 0x0106, 0x0006, 0x0126,
-	0x01c6, 0x01d6, 0x0136, 0x0146, 0x0156, 0x080c, 0x2941, 0x080c,
-	0x2481, 0x0804, 0x2f8d, 0x0106, 0x0006, 0x0126, 0x01c6, 0x01d6,
-	0x0136, 0x0146, 0x0156, 0x080c, 0x2941, 0x080c, 0x2295, 0x0804,
-	0x2f8d, 0x0106, 0x0006, 0x0126, 0x01c6, 0x01d6, 0x0136, 0x0146,
-	0x0156, 0x080c, 0x2941, 0x080c, 0x2295, 0x080c, 0x2481, 0x0804,
-	0x2f8d, 0x0106, 0x0006, 0x0126, 0x01c6, 0x01d6, 0x0136, 0x0146,
-	0x0156, 0x080c, 0x2941, 0x080c, 0x22d0, 0x0804, 0x2f8d, 0x0106,
-	0x0006, 0x0126, 0x01c6, 0x01d6, 0x0136, 0x0146, 0x0156, 0x080c,
-	0x2941, 0x080c, 0x2481, 0x080c, 0x22d0, 0x0804, 0x2f8d, 0x0106,
+	0x0005, 0x0016, 0x0026, 0x2009, 0x0140, 0x2114, 0x9294, 0x0001,
+	0x9285, 0x1000, 0x200a, 0x220a, 0x002e, 0x001e, 0x0005, 0x0016,
+	0x0026, 0x2009, 0x0140, 0x2114, 0x9294, 0x0001, 0x9215, 0x220a,
+	0x002e, 0x001e, 0x0005, 0x0006, 0x0016, 0x2009, 0x0140, 0x2104,
+	0x1128, 0x080c, 0x73bf, 0x0110, 0xc0bc, 0x0008, 0xc0bd, 0x200a,
+	0x001e, 0x000e, 0x0005, 0x2f97, 0x2f97, 0x2dbb, 0x2dbb, 0x2dc7,
+	0x2dc7, 0x2dd3, 0x2dd3, 0x2de1, 0x2de1, 0x2ded, 0x2ded, 0x2dfb,
+	0x2dfb, 0x2e09, 0x2e09, 0x2e1b, 0x2e1b, 0x2e27, 0x2e27, 0x2e35,
+	0x2e35, 0x2e53, 0x2e53, 0x2e73, 0x2e73, 0x2e43, 0x2e43, 0x2e63,
+	0x2e63, 0x2e81, 0x2e81, 0x2e19, 0x2e19, 0x2e19, 0x2e19, 0x2e19,
+	0x2e19, 0x2e19, 0x2e19, 0x2e19, 0x2e19, 0x2e19, 0x2e19, 0x2e19,
+	0x2e19, 0x2e19, 0x2e19, 0x2e19, 0x2e19, 0x2e19, 0x2e19, 0x2e19,
+	0x2e19, 0x2e19, 0x2e19, 0x2e19, 0x2e19, 0x2e19, 0x2e19, 0x2e19,
+	0x2e19, 0x2e19, 0x2e19, 0x2e93, 0x2e93, 0x2e9f, 0x2e9f, 0x2ead,
+	0x2ead, 0x2ebb, 0x2ebb, 0x2ecb, 0x2ecb, 0x2ed9, 0x2ed9, 0x2ee9,
+	0x2ee9, 0x2ef9, 0x2ef9, 0x2f0b, 0x2f0b, 0x2f19, 0x2f19, 0x2f29,
+	0x2f29, 0x2f4b, 0x2f4b, 0x2f6d, 0x2f6d, 0x2f39, 0x2f39, 0x2f5c,
+	0x2f5c, 0x2f7c, 0x2f7c, 0x2e19, 0x2e19, 0x2e19, 0x2e19, 0x2e19,
+	0x2e19, 0x2e19, 0x2e19, 0x2e19, 0x2e19, 0x2e19, 0x2e19, 0x2e19,
+	0x2e19, 0x2e19, 0x2e19, 0x2e19, 0x2e19, 0x2e19, 0x2e19, 0x2e19,
+	0x2e19, 0x2e19, 0x2e19, 0x2e19, 0x2e19, 0x2e19, 0x2e19, 0x2e19,
+	0x2e19, 0x2e19, 0x2e19, 0x2e19, 0x2e19, 0x2e19, 0x2e19, 0x2e19,
+	0x2e19, 0x2e19, 0x2e19, 0x2e19, 0x2e19, 0x2e19, 0x2e19, 0x2e19,
+	0x2e19, 0x2e19, 0x2e19, 0x0106, 0x0006, 0x0126, 0x01c6, 0x01d6,
+	0x0136, 0x0146, 0x0156, 0x080c, 0x2483, 0x0804, 0x2f8f, 0x0106,
 	0x0006, 0x0126, 0x01c6, 0x01d6, 0x0136, 0x0146, 0x0156, 0x080c,
-	0x2941, 0x080c, 0x2295, 0x080c, 0x22d0, 0x0804, 0x2f8d, 0x0106,
+	0x2297, 0x0804, 0x2f8f, 0x0106, 0x0006, 0x0126, 0x01c6, 0x01d6,
+	0x0136, 0x0146, 0x0156, 0x080c, 0x2297, 0x080c, 0x2483, 0x0804,
+	0x2f8f, 0x0106, 0x0006, 0x0126, 0x01c6, 0x01d6, 0x0136, 0x0146,
+	0x0156, 0x080c, 0x22d2, 0x0804, 0x2f8f, 0x0106, 0x0006, 0x0126,
+	0x01c6, 0x01d6, 0x0136, 0x0146, 0x0156, 0x080c, 0x2483, 0x080c,
+	0x22d2, 0x0804, 0x2f8f, 0x0106, 0x0006, 0x0126, 0x01c6, 0x01d6,
+	0x0136, 0x0146, 0x0156, 0x080c, 0x2297, 0x080c, 0x22d2, 0x0804,
+	0x2f8f, 0x0106, 0x0006, 0x0126, 0x01c6, 0x01d6, 0x0136, 0x0146,
+	0x0156, 0x080c, 0x2297, 0x080c, 0x2483, 0x080c, 0x22d2, 0x0804,
+	0x2f8f, 0xa001, 0x0cf0, 0x0106, 0x0006, 0x0126, 0x01c6, 0x01d6,
+	0x0136, 0x0146, 0x0156, 0x080c, 0x1380, 0x0804, 0x2f8f, 0x0106,
 	0x0006, 0x0126, 0x01c6, 0x01d6, 0x0136, 0x0146, 0x0156, 0x080c,
-	0x2941, 0x080c, 0x2295, 0x080c, 0x2481, 0x080c, 0x22d0, 0x0804,
-	0x2f8d, 0x0106, 0x0006, 0x0126, 0x01c6, 0x01d6, 0x0136, 0x0146,
-	0x0156, 0x080c, 0x2941, 0x080c, 0x1380, 0x0804, 0x2f8d, 0x0106,
+	0x2483, 0x080c, 0x1380, 0x0804, 0x2f8f, 0x0106, 0x0006, 0x0126,
+	0x01c6, 0x01d6, 0x0136, 0x0146, 0x0156, 0x080c, 0x2297, 0x080c,
+	0x1380, 0x0804, 0x2f8f, 0x0106, 0x0006, 0x0126, 0x01c6, 0x01d6,
+	0x0136, 0x0146, 0x0156, 0x080c, 0x2483, 0x080c, 0x1380, 0x080c,
+	0x22d2, 0x0804, 0x2f8f, 0x0106, 0x0006, 0x0126, 0x01c6, 0x01d6,
+	0x0136, 0x0146, 0x0156, 0x080c, 0x2297, 0x080c, 0x2483, 0x080c,
+	0x1380, 0x0804, 0x2f8f, 0x0106, 0x0006, 0x0126, 0x01c6, 0x01d6,
+	0x0136, 0x0146, 0x0156, 0x080c, 0x2297, 0x080c, 0x1380, 0x080c,
+	0x22d2, 0x0804, 0x2f8f, 0x0106, 0x0006, 0x0126, 0x01c6, 0x01d6,
+	0x0136, 0x0146, 0x0156, 0x080c, 0x1380, 0x080c, 0x22d2, 0x0804,
+	0x2f8f, 0x0106, 0x0006, 0x0126, 0x01c6, 0x01d6, 0x0136, 0x0146,
+	0x0156, 0x080c, 0x2297, 0x080c, 0x2483, 0x080c, 0x1380, 0x080c,
+	0x22d2, 0x0804, 0x2f8f, 0x0106, 0x0006, 0x0126, 0x01c6, 0x01d6,
+	0x0136, 0x0146, 0x0156, 0x080c, 0x2943, 0x0804, 0x2f8f, 0x0106,
 	0x0006, 0x0126, 0x01c6, 0x01d6, 0x0136, 0x0146, 0x0156, 0x080c,
-	0x2941, 0x080c, 0x2481, 0x080c, 0x1380, 0x0804, 0x2f8d, 0x0106,
-	0x0006, 0x0126, 0x01c6, 0x01d6, 0x0136, 0x0146, 0x0156, 0x080c,
-	0x2941, 0x080c, 0x2295, 0x080c, 0x1380, 0x0804, 0x2f8d, 0x0106,
-	0x0006, 0x0126, 0x01c6, 0x01d6, 0x0136, 0x0146, 0x0156, 0x080c,
-	0x2941, 0x080c, 0x2481, 0x080c, 0x1380, 0x080c, 0x22d0, 0x0804,
-	0x2f8d, 0x0106, 0x0006, 0x0126, 0x01c6, 0x01d6, 0x0136, 0x0146,
-	0x0156, 0x080c, 0x2941, 0x080c, 0x2295, 0x080c, 0x2481, 0x080c,
-	0x1380, 0x0498, 0x0106, 0x0006, 0x0126, 0x01c6, 0x01d6, 0x0136,
-	0x0146, 0x0156, 0x080c, 0x2941, 0x080c, 0x2295, 0x080c, 0x1380,
-	0x080c, 0x22d0, 0x0410, 0x0106, 0x0006, 0x0126, 0x01c6, 0x01d6,
-	0x0136, 0x0146, 0x0156, 0x080c, 0x2941, 0x080c, 0x1380, 0x080c,
-	0x22d0, 0x0098, 0x0106, 0x0006, 0x0126, 0x01c6, 0x01d6, 0x0136,
-	0x0146, 0x0156, 0x080c, 0x2941, 0x080c, 0x2295, 0x080c, 0x2481,
-	0x080c, 0x1380, 0x080c, 0x22d0, 0x0000, 0x015e, 0x014e, 0x013e,
-	0x01de, 0x01ce, 0x012e, 0x000e, 0x010e, 0x000d, 0x00b6, 0x00c6,
-	0x0026, 0x0046, 0x9026, 0x080c, 0x6930, 0x1904, 0x30a6, 0x72dc,
-	0x2001, 0x197c, 0x2004, 0x9005, 0x1110, 0xd29c, 0x0148, 0xd284,
-	0x1138, 0xd2bc, 0x1904, 0x30a6, 0x080c, 0x30ab, 0x0804, 0x30a6,
-	0xd2cc, 0x1904, 0x30a6, 0x080c, 0x73bc, 0x1120, 0x70af, 0xffff,
-	0x0804, 0x30a6, 0xd294, 0x0120, 0x70af, 0xffff, 0x0804, 0x30a6,
-	0x080c, 0x3314, 0x0160, 0x080c, 0xd230, 0x0128, 0x2001, 0x1818,
-	0x203c, 0x0804, 0x3033, 0x70af, 0xffff, 0x0804, 0x30a6, 0x2001,
-	0x1818, 0x203c, 0x7294, 0xd284, 0x0904, 0x3033, 0xd28c, 0x1904,
-	0x3033, 0x0036, 0x73ac, 0x938e, 0xffff, 0x1110, 0x2019, 0x0001,
-	0x8314, 0x92e0, 0x1c80, 0x2c04, 0x938c, 0x0001, 0x0120, 0x9084,
-	0xff00, 0x8007, 0x0010, 0x9084, 0x00ff, 0x970e, 0x05d0, 0x908e,
-	0x0000, 0x05b8, 0x908e, 0x00ff, 0x1150, 0x7230, 0xd284, 0x15b0,
-	0x7294, 0xc28d, 0x7296, 0x70af, 0xffff, 0x003e, 0x04a0, 0x900e,
-	0x080c, 0x283e, 0x080c, 0x659e, 0x1538, 0x9006, 0xb8bb, 0x0520,
-	0xb8ac, 0x9005, 0x0148, 0x00c6, 0x2060, 0x080c, 0x8981, 0x00ce,
-	0x090c, 0x8d25, 0xb8af, 0x0000, 0x080c, 0x6972, 0x1168, 0x7030,
-	0xd08c, 0x0130, 0xb800, 0xd0bc, 0x0138, 0x080c, 0x681f, 0x0120,
-	0x080c, 0x30c4, 0x0148, 0x0028, 0x080c, 0x3204, 0x080c, 0x30f0,
-	0x0118, 0x8318, 0x0804, 0x2fe0, 0x73ae, 0x0010, 0x70af, 0xffff,
-	0x003e, 0x0804, 0x30a6, 0x9780, 0x3325, 0x203d, 0x97bc, 0xff00,
-	0x873f, 0x2041, 0x007e, 0x70ac, 0x9096, 0xffff, 0x1118, 0x900e,
-	0x28a8, 0x0050, 0x9812, 0x0220, 0x2008, 0x9802, 0x20a8, 0x0020,
-	0x70af, 0xffff, 0x0804, 0x30a6, 0x2700, 0x0156, 0x0016, 0x9106,
-	0x0904, 0x309b, 0xc484, 0x080c, 0x65ff, 0x0148, 0x080c, 0xd230,
-	0x1904, 0x309b, 0x080c, 0x659e, 0x1904, 0x30a3, 0x0008, 0xc485,
+	0x2943, 0x080c, 0x2483, 0x0804, 0x2f8f, 0x0106, 0x0006, 0x0126,
+	0x01c6, 0x01d6, 0x0136, 0x0146, 0x0156, 0x080c, 0x2943, 0x080c,
+	0x2297, 0x0804, 0x2f8f, 0x0106, 0x0006, 0x0126, 0x01c6, 0x01d6,
+	0x0136, 0x0146, 0x0156, 0x080c, 0x2943, 0x080c, 0x2297, 0x080c,
+	0x2483, 0x0804, 0x2f8f, 0x0106, 0x0006, 0x0126, 0x01c6, 0x01d6,
+	0x0136, 0x0146, 0x0156, 0x080c, 0x2943, 0x080c, 0x22d2, 0x0804,
+	0x2f8f, 0x0106, 0x0006, 0x0126, 0x01c6, 0x01d6, 0x0136, 0x0146,
+	0x0156, 0x080c, 0x2943, 0x080c, 0x2483, 0x080c, 0x22d2, 0x0804,
+	0x2f8f, 0x0106, 0x0006, 0x0126, 0x01c6, 0x01d6, 0x0136, 0x0146,
+	0x0156, 0x080c, 0x2943, 0x080c, 0x2297, 0x080c, 0x22d2, 0x0804,
+	0x2f8f, 0x0106, 0x0006, 0x0126, 0x01c6, 0x01d6, 0x0136, 0x0146,
+	0x0156, 0x080c, 0x2943, 0x080c, 0x2297, 0x080c, 0x2483, 0x080c,
+	0x22d2, 0x0804, 0x2f8f, 0x0106, 0x0006, 0x0126, 0x01c6, 0x01d6,
+	0x0136, 0x0146, 0x0156, 0x080c, 0x2943, 0x080c, 0x1380, 0x0804,
+	0x2f8f, 0x0106, 0x0006, 0x0126, 0x01c6, 0x01d6, 0x0136, 0x0146,
+	0x0156, 0x080c, 0x2943, 0x080c, 0x2483, 0x080c, 0x1380, 0x0804,
+	0x2f8f, 0x0106, 0x0006, 0x0126, 0x01c6, 0x01d6, 0x0136, 0x0146,
+	0x0156, 0x080c, 0x2943, 0x080c, 0x2297, 0x080c, 0x1380, 0x0804,
+	0x2f8f, 0x0106, 0x0006, 0x0126, 0x01c6, 0x01d6, 0x0136, 0x0146,
+	0x0156, 0x080c, 0x2943, 0x080c, 0x2483, 0x080c, 0x1380, 0x080c,
+	0x22d2, 0x0804, 0x2f8f, 0x0106, 0x0006, 0x0126, 0x01c6, 0x01d6,
+	0x0136, 0x0146, 0x0156, 0x080c, 0x2943, 0x080c, 0x2297, 0x080c,
+	0x2483, 0x080c, 0x1380, 0x0498, 0x0106, 0x0006, 0x0126, 0x01c6,
+	0x01d6, 0x0136, 0x0146, 0x0156, 0x080c, 0x2943, 0x080c, 0x2297,
+	0x080c, 0x1380, 0x080c, 0x22d2, 0x0410, 0x0106, 0x0006, 0x0126,
+	0x01c6, 0x01d6, 0x0136, 0x0146, 0x0156, 0x080c, 0x2943, 0x080c,
+	0x1380, 0x080c, 0x22d2, 0x0098, 0x0106, 0x0006, 0x0126, 0x01c6,
+	0x01d6, 0x0136, 0x0146, 0x0156, 0x080c, 0x2943, 0x080c, 0x2297,
+	0x080c, 0x2483, 0x080c, 0x1380, 0x080c, 0x22d2, 0x0000, 0x015e,
+	0x014e, 0x013e, 0x01de, 0x01ce, 0x012e, 0x000e, 0x010e, 0x000d,
+	0x00b6, 0x00c6, 0x0026, 0x0046, 0x9026, 0x080c, 0x6939, 0x1904,
+	0x30a8, 0x72dc, 0x2001, 0x197b, 0x2004, 0x9005, 0x1110, 0xd29c,
+	0x0148, 0xd284, 0x1138, 0xd2bc, 0x1904, 0x30a8, 0x080c, 0x30ad,
+	0x0804, 0x30a8, 0xd2cc, 0x1904, 0x30a8, 0x080c, 0x73a5, 0x1120,
+	0x70af, 0xffff, 0x0804, 0x30a8, 0xd294, 0x0120, 0x70af, 0xffff,
+	0x0804, 0x30a8, 0x080c, 0x3316, 0x0160, 0x080c, 0xd24a, 0x0128,
+	0x2001, 0x1818, 0x203c, 0x0804, 0x3035, 0x70af, 0xffff, 0x0804,
+	0x30a8, 0x2001, 0x1818, 0x203c, 0x7294, 0xd284, 0x0904, 0x3035,
+	0xd28c, 0x1904, 0x3035, 0x0036, 0x73ac, 0x938e, 0xffff, 0x1110,
+	0x2019, 0x0001, 0x8314, 0x92e0, 0x1c80, 0x2c04, 0x938c, 0x0001,
+	0x0120, 0x9084, 0xff00, 0x8007, 0x0010, 0x9084, 0x00ff, 0x970e,
+	0x05d0, 0x908e, 0x0000, 0x05b8, 0x908e, 0x00ff, 0x1150, 0x7230,
+	0xd284, 0x15b0, 0x7294, 0xc28d, 0x7296, 0x70af, 0xffff, 0x003e,
+	0x04a0, 0x900e, 0x080c, 0x2840, 0x080c, 0x65a7, 0x1538, 0x9006,
 	0xb8bb, 0x0520, 0xb8ac, 0x9005, 0x0148, 0x00c6, 0x2060, 0x080c,
-	0x8981, 0x00ce, 0x090c, 0x8d25, 0xb8af, 0x0000, 0x080c, 0x6972,
-	0x1130, 0x7030, 0xd08c, 0x01f8, 0xb800, 0xd0bc, 0x11e0, 0x7294,
-	0xd28c, 0x0180, 0x080c, 0x6972, 0x9082, 0x0006, 0x02e0, 0xd484,
-	0x1118, 0x080c, 0x65c3, 0x0028, 0x080c, 0x3290, 0x01a0, 0x080c,
-	0x32bb, 0x0088, 0x080c, 0x3204, 0x080c, 0xd230, 0x1160, 0x080c,
-	0x30f0, 0x0188, 0x0040, 0x080c, 0xd230, 0x1118, 0x080c, 0x3290,
-	0x0110, 0x0451, 0x0140, 0x001e, 0x8108, 0x015e, 0x1f04, 0x304c,
-	0x70af, 0xffff, 0x0018, 0x001e, 0x015e, 0x71ae, 0x004e, 0x002e,
-	0x00ce, 0x00be, 0x0005, 0x00c6, 0x0016, 0x70af, 0x0001, 0x2009,
-	0x007e, 0x080c, 0x659e, 0x1168, 0xb813, 0x00ff, 0xb817, 0xfffe,
-	0x080c, 0x3204, 0x04a9, 0x0128, 0x70dc, 0xc0bd, 0x70de, 0x080c,
-	0xcf81, 0x001e, 0x00ce, 0x0005, 0x0016, 0x0076, 0x00d6, 0x00c6,
-	0x2001, 0x184c, 0x2004, 0x9084, 0x00ff, 0xb842, 0x080c, 0xaeaf,
-	0x01d0, 0x2b00, 0x6012, 0x080c, 0xcfaa, 0x6023, 0x0001, 0x9006,
-	0x080c, 0x653b, 0x2001, 0x0000, 0x080c, 0x654f, 0x0126, 0x2091,
-	0x8000, 0x70a8, 0x8000, 0x70aa, 0x012e, 0x2009, 0x0004, 0x080c,
-	0xaedc, 0x9085, 0x0001, 0x00ce, 0x00de, 0x007e, 0x001e, 0x0005,
-	0x0016, 0x0076, 0x00d6, 0x00c6, 0x2001, 0x184c, 0x2004, 0x9084,
-	0x00ff, 0xb842, 0x080c, 0xaeaf, 0x0548, 0x2b00, 0x6012, 0xb800,
-	0xc0c4, 0xb802, 0xb8a0, 0x9086, 0x007e, 0x0140, 0xb804, 0x9084,
-	0x00ff, 0x9086, 0x0006, 0x1110, 0x080c, 0x31bf, 0x080c, 0xcfaa,
-	0x6023, 0x0001, 0x9006, 0x080c, 0x653b, 0x2001, 0x0002, 0x080c,
-	0x654f, 0x0126, 0x2091, 0x8000, 0x70a8, 0x8000, 0x70aa, 0x012e,
-	0x2009, 0x0002, 0x080c, 0xaedc, 0x9085, 0x0001, 0x00ce, 0x00de,
-	0x007e, 0x001e, 0x0005, 0x00b6, 0x00c6, 0x0026, 0x2009, 0x0080,
-	0x080c, 0x659e, 0x1140, 0xb813, 0x00ff, 0xb817, 0xfffc, 0x0039,
-	0x0110, 0x70e3, 0xffff, 0x002e, 0x00ce, 0x00be, 0x0005, 0x0016,
-	0x0076, 0x00d6, 0x00c6, 0x080c, 0xae0b, 0x01d0, 0x2b00, 0x6012,
-	0x080c, 0xcfaa, 0x6023, 0x0001, 0x9006, 0x080c, 0x653b, 0x2001,
-	0x0002, 0x080c, 0x654f, 0x0126, 0x2091, 0x8000, 0x70e4, 0x8000,
-	0x70e6, 0x012e, 0x2009, 0x0002, 0x080c, 0xaedc, 0x9085, 0x0001,
-	0x00ce, 0x00de, 0x007e, 0x001e, 0x0005, 0x00c6, 0x00d6, 0x0126,
-	0x2091, 0x8000, 0x2009, 0x007f, 0x080c, 0x659e, 0x11b8, 0xb813,
-	0x00ff, 0xb817, 0xfffd, 0xb8cf, 0x0004, 0x080c, 0xae0b, 0x0170,
-	0x2b00, 0x6012, 0x6316, 0x6023, 0x0001, 0x620a, 0x080c, 0xcfaa,
-	0x2009, 0x0022, 0x080c, 0xaedc, 0x9085, 0x0001, 0x012e, 0x00de,
-	0x00ce, 0x0005, 0x00e6, 0x00c6, 0x0066, 0x0036, 0x0026, 0x00b6,
-	0x21f0, 0x080c, 0x9296, 0x080c, 0x921b, 0x080c, 0xaca4, 0x080c,
-	0xbd77, 0x3e08, 0x2130, 0x81ff, 0x0120, 0x20a9, 0x007e, 0x900e,
-	0x0018, 0x20a9, 0x007f, 0x900e, 0x0016, 0x080c, 0x65ff, 0x1140,
-	0x9686, 0x0002, 0x1118, 0xb800, 0xd0bc, 0x1110, 0x080c, 0x6034,
-	0x001e, 0x8108, 0x1f04, 0x31a4, 0x9686, 0x0001, 0x190c, 0x32e8,
-	0x00be, 0x002e, 0x003e, 0x006e, 0x00ce, 0x00ee, 0x0005, 0x00e6,
-	0x00c6, 0x0046, 0x0036, 0x0026, 0x0016, 0x00b6, 0x6210, 0x2258,
-	0xbaa0, 0x0026, 0x2019, 0x0029, 0x080c, 0x928b, 0x0076, 0x2039,
-	0x0000, 0x080c, 0x9168, 0x2c08, 0x080c, 0xe2eb, 0x007e, 0x001e,
-	0xba10, 0xbb14, 0xbcc0, 0x080c, 0x6034, 0xba12, 0xbb16, 0xbcc2,
-	0x00be, 0x001e, 0x002e, 0x003e, 0x004e, 0x00ce, 0x00ee, 0x0005,
-	0x00e6, 0x0006, 0x00b6, 0x6010, 0x2058, 0xb8a0, 0x00be, 0x9086,
-	0x0080, 0x0150, 0x2071, 0x1800, 0x70a8, 0x9005, 0x0110, 0x8001,
-	0x70aa, 0x000e, 0x00ee, 0x0005, 0x2071, 0x1800, 0x70e4, 0x9005,
-	0x0dc0, 0x8001, 0x70e6, 0x0ca8, 0xb800, 0xc08c, 0xb802, 0x0005,
-	0x00f6, 0x00e6, 0x00c6, 0x00b6, 0x0046, 0x0036, 0x0026, 0x0016,
-	0x0156, 0x2178, 0x81ff, 0x1118, 0x20a9, 0x0001, 0x0078, 0x080c,
-	0x56cf, 0xd0c4, 0x0140, 0xd0a4, 0x0130, 0x9006, 0x2020, 0x2009,
-	0x002d, 0x080c, 0xe5ae, 0x20a9, 0x0800, 0x9016, 0x0026, 0x928e,
-	0x007e, 0x0904, 0x326f, 0x928e, 0x007f, 0x0904, 0x326f, 0x928e,
-	0x0080, 0x05e8, 0x9288, 0x1000, 0x210c, 0x81ff, 0x05c0, 0x8fff,
-	0x1148, 0x2001, 0x198e, 0x0006, 0x2003, 0x0001, 0x04f1, 0x000e,
-	0x2003, 0x0000, 0x00b6, 0x00c6, 0x2158, 0x2001, 0x0001, 0x080c,
-	0x693c, 0x00ce, 0x00be, 0x2019, 0x0029, 0x080c, 0x928b, 0x0076,
-	0x2039, 0x0000, 0x080c, 0x9168, 0x00b6, 0x00c6, 0x0026, 0x2158,
-	0xba04, 0x9294, 0x00ff, 0x9286, 0x0006, 0x1118, 0xb807, 0x0404,
-	0x0028, 0x2001, 0x0004, 0x8007, 0x9215, 0xba06, 0x002e, 0x00ce,
-	0x00be, 0x0016, 0x2c08, 0x080c, 0xe2eb, 0x001e, 0x007e, 0x002e,
-	0x8210, 0x1f04, 0x3226, 0x015e, 0x001e, 0x002e, 0x003e, 0x004e,
-	0x00be, 0x00ce, 0x00ee, 0x00fe, 0x0005, 0x0046, 0x0026, 0x0016,
-	0x080c, 0x56cf, 0xd0c4, 0x0140, 0xd0a4, 0x0130, 0x9006, 0x2220,
-	0x2009, 0x0029, 0x080c, 0xe5ae, 0x001e, 0x002e, 0x004e, 0x0005,
-	0x0016, 0x0026, 0x0036, 0x00c6, 0x7294, 0x82ff, 0x01e8, 0x080c,
-	0x696a, 0x11d0, 0x2100, 0x080c, 0x2871, 0x81ff, 0x01b8, 0x2019,
-	0x0001, 0x8314, 0x92e0, 0x1c80, 0x2c04, 0xd384, 0x0120, 0x9084,
-	0xff00, 0x8007, 0x0010, 0x9084, 0x00ff, 0x9116, 0x0138, 0x9096,
-	0x00ff, 0x0110, 0x8318, 0x0c68, 0x9085, 0x0001, 0x00ce, 0x003e,
-	0x002e, 0x001e, 0x0005, 0x0016, 0x00c6, 0x0126, 0x2091, 0x8000,
-	0x0036, 0x2019, 0x0029, 0x00a9, 0x003e, 0x9180, 0x1000, 0x2004,
-	0x9065, 0x0158, 0x0016, 0x00c6, 0x2061, 0x1ab0, 0x001e, 0x6112,
-	0x080c, 0x31bf, 0x001e, 0x080c, 0x65c3, 0x012e, 0x00ce, 0x001e,
-	0x0005, 0x0016, 0x0026, 0x2110, 0x080c, 0xa808, 0x080c, 0xe917,
-	0x002e, 0x001e, 0x0005, 0x2001, 0x1837, 0x2004, 0xd0cc, 0x0005,
-	0x00c6, 0x00b6, 0x080c, 0x73bc, 0x1118, 0x20a9, 0x0800, 0x0010,
-	0x20a9, 0x0782, 0x080c, 0x73bc, 0x1110, 0x900e, 0x0010, 0x2009,
-	0x007e, 0x9180, 0x1000, 0x2004, 0x905d, 0x0130, 0x86ff, 0x0110,
-	0xb800, 0xd0bc, 0x090c, 0x65c3, 0x8108, 0x1f04, 0x32f9, 0x2061,
-	0x1800, 0x607f, 0x0000, 0x6080, 0x9084, 0x00ff, 0x6082, 0x60b3,
-	0x0000, 0x00be, 0x00ce, 0x0005, 0x2001, 0x1869, 0x2004, 0xd0bc,
-	0x0005, 0x2011, 0x1848, 0x2214, 0xd2ec, 0x0005, 0x0026, 0x2011,
-	0x1867, 0x2214, 0xd2dc, 0x002e, 0x0005, 0x7eef, 0x7de8, 0x7ce4,
-	0x80e2, 0x7be1, 0x80e0, 0x80dc, 0x80da, 0x7ad9, 0x80d6, 0x80d5,
-	0x80d4, 0x80d3, 0x80d2, 0x80d1, 0x79ce, 0x78cd, 0x80cc, 0x80cb,
-	0x80ca, 0x80c9, 0x80c7, 0x80c6, 0x77c5, 0x76c3, 0x80bc, 0x80ba,
-	0x75b9, 0x80b6, 0x74b5, 0x73b4, 0x72b3, 0x80b2, 0x80b1, 0x80ae,
-	0x71ad, 0x80ac, 0x70ab, 0x6faa, 0x6ea9, 0x80a7, 0x6da6, 0x6ca5,
-	0x6ba3, 0x6a9f, 0x699e, 0x689d, 0x809b, 0x8098, 0x6797, 0x6690,
-	0x658f, 0x6488, 0x6384, 0x6282, 0x8081, 0x8080, 0x617c, 0x607a,
-	0x8079, 0x5f76, 0x8075, 0x8074, 0x8073, 0x8072, 0x8071, 0x806e,
-	0x5e6d, 0x806c, 0x5d6b, 0x5c6a, 0x5b69, 0x8067, 0x5a66, 0x5965,
-	0x5863, 0x575c, 0x565a, 0x5559, 0x8056, 0x8055, 0x5454, 0x5353,
-	0x5252, 0x5151, 0x504e, 0x4f4d, 0x804c, 0x804b, 0x4e4a, 0x4d49,
-	0x8047, 0x4c46, 0x8045, 0x8043, 0x803c, 0x803a, 0x8039, 0x8036,
-	0x4b35, 0x8034, 0x4a33, 0x4932, 0x4831, 0x802e, 0x472d, 0x462c,
-	0x452b, 0x442a, 0x4329, 0x4227, 0x8026, 0x8025, 0x4123, 0x401f,
-	0x3f1e, 0x3e1d, 0x3d1b, 0x3c18, 0x8017, 0x8010, 0x3b0f, 0x3a08,
-	0x8004, 0x3902, 0x8001, 0x8000, 0x8000, 0x3800, 0x3700, 0x3600,
-	0x8000, 0x3500, 0x8000, 0x8000, 0x8000, 0x3400, 0x8000, 0x8000,
-	0x8000, 0x8000, 0x8000, 0x8000, 0x3300, 0x3200, 0x8000, 0x8000,
-	0x8000, 0x8000, 0x8000, 0x8000, 0x3100, 0x3000, 0x8000, 0x8000,
-	0x2f00, 0x8000, 0x2e00, 0x2d00, 0x2c00, 0x8000, 0x8000, 0x8000,
-	0x2b00, 0x8000, 0x2a00, 0x2900, 0x2800, 0x8000, 0x2700, 0x2600,
-	0x2500, 0x2400, 0x2300, 0x2200, 0x8000, 0x8000, 0x2100, 0x2000,
-	0x1f00, 0x1e00, 0x1d00, 0x1c00, 0x8000, 0x8000, 0x1b00, 0x1a00,
-	0x8000, 0x1900, 0x8000, 0x8000, 0x8000, 0x8000, 0x8000, 0x8000,
-	0x1800, 0x8000, 0x1700, 0x1600, 0x1500, 0x8000, 0x1400, 0x1300,
-	0x1200, 0x1100, 0x1000, 0x0f00, 0x8000, 0x8000, 0x0e00, 0x0d00,
-	0x0c00, 0x0b00, 0x0a00, 0x0900, 0x8000, 0x8000, 0x0800, 0x0700,
-	0x8000, 0x0600, 0x8000, 0x8000, 0x8000, 0x0500, 0x0400, 0x0300,
-	0x8000, 0x0200, 0x8000, 0x8000, 0x8000, 0x0100, 0x8000, 0x8000,
-	0x8000, 0x8000, 0x8000, 0x8000, 0x0000, 0x8000, 0x8000, 0x8000,
+	0x896a, 0x00ce, 0x090c, 0x8d0e, 0xb8af, 0x0000, 0x080c, 0x697b,
+	0x1168, 0x7030, 0xd08c, 0x0130, 0xb800, 0xd0bc, 0x0138, 0x080c,
+	0x6828, 0x0120, 0x080c, 0x30c6, 0x0148, 0x0028, 0x080c, 0x3206,
+	0x080c, 0x30f2, 0x0118, 0x8318, 0x0804, 0x2fe2, 0x73ae, 0x0010,
+	0x70af, 0xffff, 0x003e, 0x0804, 0x30a8, 0x9780, 0x3327, 0x203d,
+	0x97bc, 0xff00, 0x873f, 0x2041, 0x007e, 0x70ac, 0x9096, 0xffff,
+	0x1118, 0x900e, 0x28a8, 0x0050, 0x9812, 0x0220, 0x2008, 0x9802,
+	0x20a8, 0x0020, 0x70af, 0xffff, 0x0804, 0x30a8, 0x2700, 0x0156,
+	0x0016, 0x9106, 0x0904, 0x309d, 0xc484, 0x080c, 0x6608, 0x0148,
+	0x080c, 0xd24a, 0x1904, 0x309d, 0x080c, 0x65a7, 0x1904, 0x30a5,
+	0x0008, 0xc485, 0xb8bb, 0x0520, 0xb8ac, 0x9005, 0x0148, 0x00c6,
+	0x2060, 0x080c, 0x896a, 0x00ce, 0x090c, 0x8d0e, 0xb8af, 0x0000,
+	0x080c, 0x697b, 0x1130, 0x7030, 0xd08c, 0x01f8, 0xb800, 0xd0bc,
+	0x11e0, 0x7294, 0xd28c, 0x0180, 0x080c, 0x697b, 0x9082, 0x0006,
+	0x02e0, 0xd484, 0x1118, 0x080c, 0x65cc, 0x0028, 0x080c, 0x3292,
+	0x01a0, 0x080c, 0x32bd, 0x0088, 0x080c, 0x3206, 0x080c, 0xd24a,
+	0x1160, 0x080c, 0x30f2, 0x0188, 0x0040, 0x080c, 0xd24a, 0x1118,
+	0x080c, 0x3292, 0x0110, 0x0451, 0x0140, 0x001e, 0x8108, 0x015e,
+	0x1f04, 0x304e, 0x70af, 0xffff, 0x0018, 0x001e, 0x015e, 0x71ae,
+	0x004e, 0x002e, 0x00ce, 0x00be, 0x0005, 0x00c6, 0x0016, 0x70af,
+	0x0001, 0x2009, 0x007e, 0x080c, 0x65a7, 0x1168, 0xb813, 0x00ff,
+	0xb817, 0xfffe, 0x080c, 0x3206, 0x04a9, 0x0128, 0x70dc, 0xc0bd,
+	0x70de, 0x080c, 0xcf9b, 0x001e, 0x00ce, 0x0005, 0x0016, 0x0076,
+	0x00d6, 0x00c6, 0x2001, 0x184c, 0x2004, 0x9084, 0x00ff, 0xb842,
+	0x080c, 0xaebf, 0x01d0, 0x2b00, 0x6012, 0x080c, 0xcfc4, 0x6023,
+	0x0001, 0x9006, 0x080c, 0x6544, 0x2001, 0x0000, 0x080c, 0x6558,
+	0x0126, 0x2091, 0x8000, 0x70a8, 0x8000, 0x70aa, 0x012e, 0x2009,
+	0x0004, 0x080c, 0xaeec, 0x9085, 0x0001, 0x00ce, 0x00de, 0x007e,
+	0x001e, 0x0005, 0x0016, 0x0076, 0x00d6, 0x00c6, 0x2001, 0x184c,
+	0x2004, 0x9084, 0x00ff, 0xb842, 0x080c, 0xaebf, 0x0548, 0x2b00,
+	0x6012, 0xb800, 0xc0c4, 0xb802, 0xb8a0, 0x9086, 0x007e, 0x0140,
+	0xb804, 0x9084, 0x00ff, 0x9086, 0x0006, 0x1110, 0x080c, 0x31c1,
+	0x080c, 0xcfc4, 0x6023, 0x0001, 0x9006, 0x080c, 0x6544, 0x2001,
+	0x0002, 0x080c, 0x6558, 0x0126, 0x2091, 0x8000, 0x70a8, 0x8000,
+	0x70aa, 0x012e, 0x2009, 0x0002, 0x080c, 0xaeec, 0x9085, 0x0001,
+	0x00ce, 0x00de, 0x007e, 0x001e, 0x0005, 0x00b6, 0x00c6, 0x0026,
+	0x2009, 0x0080, 0x080c, 0x65a7, 0x1140, 0xb813, 0x00ff, 0xb817,
+	0xfffc, 0x0039, 0x0110, 0x70e3, 0xffff, 0x002e, 0x00ce, 0x00be,
+	0x0005, 0x0016, 0x0076, 0x00d6, 0x00c6, 0x080c, 0xae1b, 0x01d0,
+	0x2b00, 0x6012, 0x080c, 0xcfc4, 0x6023, 0x0001, 0x9006, 0x080c,
+	0x6544, 0x2001, 0x0002, 0x080c, 0x6558, 0x0126, 0x2091, 0x8000,
+	0x70e4, 0x8000, 0x70e6, 0x012e, 0x2009, 0x0002, 0x080c, 0xaeec,
+	0x9085, 0x0001, 0x00ce, 0x00de, 0x007e, 0x001e, 0x0005, 0x00c6,
+	0x00d6, 0x0126, 0x2091, 0x8000, 0x2009, 0x007f, 0x080c, 0x65a7,
+	0x11b8, 0xb813, 0x00ff, 0xb817, 0xfffd, 0xb8cf, 0x0004, 0x080c,
+	0xae1b, 0x0170, 0x2b00, 0x6012, 0x6316, 0x6023, 0x0001, 0x620a,
+	0x080c, 0xcfc4, 0x2009, 0x0022, 0x080c, 0xaeec, 0x9085, 0x0001,
+	0x012e, 0x00de, 0x00ce, 0x0005, 0x00e6, 0x00c6, 0x0066, 0x0036,
+	0x0026, 0x00b6, 0x21f0, 0x080c, 0x9289, 0x080c, 0x9209, 0x080c,
+	0xacaf, 0x080c, 0xbd8a, 0x3e08, 0x2130, 0x81ff, 0x0120, 0x20a9,
+	0x007e, 0x900e, 0x0018, 0x20a9, 0x007f, 0x900e, 0x0016, 0x080c,
+	0x6608, 0x1140, 0x9686, 0x0002, 0x1118, 0xb800, 0xd0bc, 0x1110,
+	0x080c, 0x603d, 0x001e, 0x8108, 0x1f04, 0x31a6, 0x9686, 0x0001,
+	0x190c, 0x32ea, 0x00be, 0x002e, 0x003e, 0x006e, 0x00ce, 0x00ee,
+	0x0005, 0x00e6, 0x00c6, 0x0046, 0x0036, 0x0026, 0x0016, 0x00b6,
+	0x6210, 0x2258, 0xbaa0, 0x0026, 0x2019, 0x0029, 0x080c, 0x927e,
+	0x0076, 0x2039, 0x0000, 0x080c, 0x9151, 0x2c08, 0x080c, 0xe30c,
+	0x007e, 0x001e, 0xba10, 0xbb14, 0xbcc0, 0x080c, 0x603d, 0xba12,
+	0xbb16, 0xbcc2, 0x00be, 0x001e, 0x002e, 0x003e, 0x004e, 0x00ce,
+	0x00ee, 0x0005, 0x00e6, 0x0006, 0x00b6, 0x6010, 0x2058, 0xb8a0,
+	0x00be, 0x9086, 0x0080, 0x0150, 0x2071, 0x1800, 0x70a8, 0x9005,
+	0x0110, 0x8001, 0x70aa, 0x000e, 0x00ee, 0x0005, 0x2071, 0x1800,
+	0x70e4, 0x9005, 0x0dc0, 0x8001, 0x70e6, 0x0ca8, 0xb800, 0xc08c,
+	0xb802, 0x0005, 0x00f6, 0x00e6, 0x00c6, 0x00b6, 0x0046, 0x0036,
+	0x0026, 0x0016, 0x0156, 0x2178, 0x81ff, 0x1118, 0x20a9, 0x0001,
+	0x0078, 0x080c, 0x56d8, 0xd0c4, 0x0140, 0xd0a4, 0x0130, 0x9006,
+	0x2020, 0x2009, 0x002d, 0x080c, 0xe5cf, 0x20a9, 0x0800, 0x9016,
+	0x0026, 0x928e, 0x007e, 0x0904, 0x3271, 0x928e, 0x007f, 0x0904,
+	0x3271, 0x928e, 0x0080, 0x05e8, 0x9288, 0x1000, 0x210c, 0x81ff,
+	0x05c0, 0x8fff, 0x1148, 0x2001, 0x198d, 0x0006, 0x2003, 0x0001,
+	0x04f1, 0x000e, 0x2003, 0x0000, 0x00b6, 0x00c6, 0x2158, 0x2001,
+	0x0001, 0x080c, 0x6945, 0x00ce, 0x00be, 0x2019, 0x0029, 0x080c,
+	0x927e, 0x0076, 0x2039, 0x0000, 0x080c, 0x9151, 0x00b6, 0x00c6,
+	0x0026, 0x2158, 0xba04, 0x9294, 0x00ff, 0x9286, 0x0006, 0x1118,
+	0xb807, 0x0404, 0x0028, 0x2001, 0x0004, 0x8007, 0x9215, 0xba06,
+	0x002e, 0x00ce, 0x00be, 0x0016, 0x2c08, 0x080c, 0xe30c, 0x001e,
+	0x007e, 0x002e, 0x8210, 0x1f04, 0x3228, 0x015e, 0x001e, 0x002e,
+	0x003e, 0x004e, 0x00be, 0x00ce, 0x00ee, 0x00fe, 0x0005, 0x0046,
+	0x0026, 0x0016, 0x080c, 0x56d8, 0xd0c4, 0x0140, 0xd0a4, 0x0130,
+	0x9006, 0x2220, 0x2009, 0x0029, 0x080c, 0xe5cf, 0x001e, 0x002e,
+	0x004e, 0x0005, 0x0016, 0x0026, 0x0036, 0x00c6, 0x7294, 0x82ff,
+	0x01e8, 0x080c, 0x6973, 0x11d0, 0x2100, 0x080c, 0x2873, 0x81ff,
+	0x01b8, 0x2019, 0x0001, 0x8314, 0x92e0, 0x1c80, 0x2c04, 0xd384,
+	0x0120, 0x9084, 0xff00, 0x8007, 0x0010, 0x9084, 0x00ff, 0x9116,
+	0x0138, 0x9096, 0x00ff, 0x0110, 0x8318, 0x0c68, 0x9085, 0x0001,
+	0x00ce, 0x003e, 0x002e, 0x001e, 0x0005, 0x0016, 0x00c6, 0x0126,
+	0x2091, 0x8000, 0x0036, 0x2019, 0x0029, 0x00a9, 0x003e, 0x9180,
+	0x1000, 0x2004, 0x9065, 0x0158, 0x0016, 0x00c6, 0x2061, 0x1aaf,
+	0x001e, 0x6112, 0x080c, 0x31c1, 0x001e, 0x080c, 0x65cc, 0x012e,
+	0x00ce, 0x001e, 0x0005, 0x0016, 0x0026, 0x2110, 0x080c, 0xa80e,
+	0x080c, 0xe938, 0x002e, 0x001e, 0x0005, 0x2001, 0x1837, 0x2004,
+	0xd0cc, 0x0005, 0x00c6, 0x00b6, 0x080c, 0x73a5, 0x1118, 0x20a9,
+	0x0800, 0x0010, 0x20a9, 0x0782, 0x080c, 0x73a5, 0x1110, 0x900e,
+	0x0010, 0x2009, 0x007e, 0x9180, 0x1000, 0x2004, 0x905d, 0x0130,
+	0x86ff, 0x0110, 0xb800, 0xd0bc, 0x090c, 0x65cc, 0x8108, 0x1f04,
+	0x32fb, 0x2061, 0x1800, 0x607f, 0x0000, 0x6080, 0x9084, 0x00ff,
+	0x6082, 0x60b3, 0x0000, 0x00be, 0x00ce, 0x0005, 0x2001, 0x1869,
+	0x2004, 0xd0bc, 0x0005, 0x2011, 0x1848, 0x2214, 0xd2ec, 0x0005,
+	0x0026, 0x2011, 0x1867, 0x2214, 0xd2dc, 0x002e, 0x0005, 0x7eef,
+	0x7de8, 0x7ce4, 0x80e2, 0x7be1, 0x80e0, 0x80dc, 0x80da, 0x7ad9,
+	0x80d6, 0x80d5, 0x80d4, 0x80d3, 0x80d2, 0x80d1, 0x79ce, 0x78cd,
+	0x80cc, 0x80cb, 0x80ca, 0x80c9, 0x80c7, 0x80c6, 0x77c5, 0x76c3,
+	0x80bc, 0x80ba, 0x75b9, 0x80b6, 0x74b5, 0x73b4, 0x72b3, 0x80b2,
+	0x80b1, 0x80ae, 0x71ad, 0x80ac, 0x70ab, 0x6faa, 0x6ea9, 0x80a7,
+	0x6da6, 0x6ca5, 0x6ba3, 0x6a9f, 0x699e, 0x689d, 0x809b, 0x8098,
+	0x6797, 0x6690, 0x658f, 0x6488, 0x6384, 0x6282, 0x8081, 0x8080,
+	0x617c, 0x607a, 0x8079, 0x5f76, 0x8075, 0x8074, 0x8073, 0x8072,
+	0x8071, 0x806e, 0x5e6d, 0x806c, 0x5d6b, 0x5c6a, 0x5b69, 0x8067,
+	0x5a66, 0x5965, 0x5863, 0x575c, 0x565a, 0x5559, 0x8056, 0x8055,
+	0x5454, 0x5353, 0x5252, 0x5151, 0x504e, 0x4f4d, 0x804c, 0x804b,
+	0x4e4a, 0x4d49, 0x8047, 0x4c46, 0x8045, 0x8043, 0x803c, 0x803a,
+	0x8039, 0x8036, 0x4b35, 0x8034, 0x4a33, 0x4932, 0x4831, 0x802e,
+	0x472d, 0x462c, 0x452b, 0x442a, 0x4329, 0x4227, 0x8026, 0x8025,
+	0x4123, 0x401f, 0x3f1e, 0x3e1d, 0x3d1b, 0x3c18, 0x8017, 0x8010,
+	0x3b0f, 0x3a08, 0x8004, 0x3902, 0x8001, 0x8000, 0x8000, 0x3800,
+	0x3700, 0x3600, 0x8000, 0x3500, 0x8000, 0x8000, 0x8000, 0x3400,
+	0x8000, 0x8000, 0x8000, 0x8000, 0x8000, 0x8000, 0x3300, 0x3200,
+	0x8000, 0x8000, 0x8000, 0x8000, 0x8000, 0x8000, 0x3100, 0x3000,
+	0x8000, 0x8000, 0x2f00, 0x8000, 0x2e00, 0x2d00, 0x2c00, 0x8000,
+	0x8000, 0x8000, 0x2b00, 0x8000, 0x2a00, 0x2900, 0x2800, 0x8000,
+	0x2700, 0x2600, 0x2500, 0x2400, 0x2300, 0x2200, 0x8000, 0x8000,
+	0x2100, 0x2000, 0x1f00, 0x1e00, 0x1d00, 0x1c00, 0x8000, 0x8000,
+	0x1b00, 0x1a00, 0x8000, 0x1900, 0x8000, 0x8000, 0x8000, 0x8000,
+	0x8000, 0x8000, 0x1800, 0x8000, 0x1700, 0x1600, 0x1500, 0x8000,
+	0x1400, 0x1300, 0x1200, 0x1100, 0x1000, 0x0f00, 0x8000, 0x8000,
+	0x0e00, 0x0d00, 0x0c00, 0x0b00, 0x0a00, 0x0900, 0x8000, 0x8000,
+	0x0800, 0x0700, 0x8000, 0x0600, 0x8000, 0x8000, 0x8000, 0x0500,
+	0x0400, 0x0300, 0x8000, 0x0200, 0x8000, 0x8000, 0x8000, 0x0100,
+	0x8000, 0x8000, 0x8000, 0x8000, 0x8000, 0x8000, 0x0000, 0x8000,
 	0x8000, 0x8000, 0x8000, 0x8000, 0x8000, 0x8000, 0x8000, 0x8000,
-	0x8000, 0x8000, 0x8000, 0x8000, 0x8000, 0x2071, 0x189e, 0x7003,
-	0x0002, 0x9006, 0x7016, 0x701a, 0x704a, 0x704e, 0x700e, 0x7042,
-	0x7046, 0x703b, 0x18ba, 0x703f, 0x18ba, 0x7007, 0x0001, 0x080c,
-	0x1018, 0x090c, 0x0dd5, 0x2900, 0x706a, 0xa867, 0x0002, 0xa8ab,
-	0xdcb0, 0x080c, 0x1018, 0x090c, 0x0dd5, 0x2900, 0x706e, 0xa867,
-	0x0002, 0xa8ab, 0xdcb0, 0x0005, 0x2071, 0x189e, 0x7004, 0x0002,
-	0x3454, 0x3455, 0x3468, 0x347c, 0x0005, 0x1004, 0x3465, 0x0e04,
-	0x3465, 0x2079, 0x0000, 0x0126, 0x2091, 0x8000, 0x700c, 0x9005,
-	0x1128, 0x700f, 0x0001, 0x012e, 0x0468, 0x0005, 0x012e, 0x0ce8,
-	0x2079, 0x0000, 0x2061, 0x18b8, 0x2c4c, 0xa86c, 0x908e, 0x0100,
-	0x0128, 0x9086, 0x0200, 0x0904, 0x3550, 0x0005, 0x7018, 0x2048,
-	0x2061, 0x1800, 0x701c, 0x0807, 0x7014, 0x2048, 0xa864, 0x9094,
-	0x00ff, 0x9296, 0x0029, 0x1120, 0xaa78, 0xd2fc, 0x0128, 0x0005,
-	0x9086, 0x0103, 0x0108, 0x0005, 0x2079, 0x0000, 0x2061, 0x1800,
-	0x701c, 0x0807, 0x2061, 0x1800, 0x7880, 0x908a, 0x0040, 0x1210,
-	0x61d0, 0x0042, 0x2100, 0x908a, 0x003f, 0x1a04, 0x354d, 0x61d0,
-	0x0804, 0x34e2, 0x3524, 0x355c, 0x3566, 0x356a, 0x3574, 0x357a,
-	0x357e, 0x358e, 0x3591, 0x359b, 0x35a0, 0x35a5, 0x35b0, 0x35bb,
-	0x35ca, 0x35d9, 0x35e7, 0x35fe, 0x3619, 0x354d, 0x36c2, 0x3700,
-	0x37a6, 0x37b7, 0x37da, 0x354d, 0x354d, 0x354d, 0x3812, 0x382e,
-	0x3837, 0x3866, 0x386c, 0x354d, 0x38b2, 0x354d, 0x354d, 0x354d,
-	0x354d, 0x354d, 0x38bd, 0x38c6, 0x38ce, 0x38d0, 0x354d, 0x354d,
-	0x354d, 0x354d, 0x354d, 0x354d, 0x38fc, 0x354d, 0x354d, 0x354d,
-	0x354d, 0x354d, 0x3919, 0x397a, 0x354d, 0x354d, 0x354d, 0x354d,
-	0x354d, 0x354d, 0x0002, 0x39a4, 0x39a7, 0x3a06, 0x3a1f, 0x3a4f,
-	0x3ced, 0x354d, 0x52a8, 0x354d, 0x354d, 0x354d, 0x354d, 0x354d,
-	0x354d, 0x354d, 0x354d, 0x359b, 0x35a0, 0x420e, 0x56f3, 0x422c,
-	0x5337, 0x5388, 0x548b, 0x354d, 0x54ed, 0x5529, 0x555a, 0x565e,
-	0x5587, 0x55de, 0x354d, 0x4230, 0x43f1, 0x4407, 0x442c, 0x4491,
-	0x4505, 0x4525, 0x459c, 0x45f8, 0x4654, 0x4657, 0x467c, 0x4719,
-	0x477f, 0x4787, 0x48b9, 0x4a2e, 0x4a62, 0x4cc6, 0x354d, 0x4ce4,
-	0x4d90, 0x4e72, 0x4ecc, 0x354d, 0x4f81, 0x354d, 0x4fe7, 0x5002,
-	0x4787, 0x5248, 0x714c, 0x0000, 0x2021, 0x4000, 0x080c, 0x4ae0,
-	0x0126, 0x2091, 0x8000, 0x0e04, 0x352e, 0x0010, 0x012e, 0x0cc0,
-	0x7c36, 0x9486, 0x4000, 0x0118, 0x7833, 0x0011, 0x0010, 0x7833,
-	0x0010, 0x7c82, 0x7986, 0x7a8a, 0x7b8e, 0x2091, 0x4080, 0x2001,
-	0x0089, 0x2004, 0xd084, 0x190c, 0x119b, 0x7007, 0x0001, 0x2091,
-	0x5000, 0x700f, 0x0000, 0x012e, 0x0005, 0x2021, 0x4001, 0x08b0,
-	0x2021, 0x4002, 0x0898, 0x2021, 0x4003, 0x0880, 0x2021, 0x4005,
-	0x0868, 0x2021, 0x4006, 0x0850, 0x2039, 0x0001, 0x902e, 0x2520,
-	0x7b88, 0x7a8c, 0x7884, 0x7990, 0x0804, 0x4aed, 0x7883, 0x0004,
-	0x7884, 0x0807, 0x2039, 0x0001, 0x902e, 0x2520, 0x7b88, 0x7a8c,
-	0x7884, 0x7990, 0x0804, 0x4af0, 0x7984, 0x7888, 0x2114, 0x200a,
-	0x0804, 0x3524, 0x7984, 0x2114, 0x0804, 0x3524, 0x20e1, 0x0000,
-	0x2099, 0x0021, 0x20e9, 0x0000, 0x20a1, 0x0021, 0x20a9, 0x001f,
-	0x4003, 0x7984, 0x7a88, 0x7b8c, 0x0804, 0x3524, 0x7884, 0x2060,
-	0x04d8, 0x2009, 0x0003, 0x2011, 0x0002, 0x2019, 0x001c, 0x789b,
-	0x0137, 0x0804, 0x3524, 0x2039, 0x0001, 0x7d98, 0x7c9c, 0x0800,
-	0x2039, 0x0001, 0x7d98, 0x7c9c, 0x0848, 0x79a0, 0x9182, 0x0040,
-	0x0210, 0x0804, 0x3559, 0x2138, 0x7d98, 0x7c9c, 0x0804, 0x3560,
-	0x79a0, 0x9182, 0x0040, 0x0210, 0x0804, 0x3559, 0x2138, 0x7d98,
-	0x7c9c, 0x0804, 0x356e, 0x79a0, 0x9182, 0x0040, 0x0210, 0x0804,
-	0x3559, 0x21e8, 0x7984, 0x7888, 0x20a9, 0x0001, 0x21a0, 0x4004,
-	0x0804, 0x3524, 0x2061, 0x0800, 0xe10c, 0x9006, 0x2c15, 0x9200,
-	0x8c60, 0x8109, 0x1dd8, 0x2010, 0x9005, 0x0904, 0x3524, 0x0804,
-	0x3553, 0x79a0, 0x9182, 0x0040, 0x0210, 0x0804, 0x3559, 0x21e0,
-	0x20a9, 0x0001, 0x7984, 0x2198, 0x4012, 0x0804, 0x3524, 0x2069,
-	0x1847, 0x7884, 0x7990, 0x911a, 0x1a04, 0x3559, 0x8019, 0x0904,
-	0x3559, 0x684a, 0x6942, 0x788c, 0x6852, 0x7888, 0x6856, 0x9006,
-	0x685a, 0x685e, 0x080c, 0x76d5, 0x0804, 0x3524, 0x2069, 0x1847,
-	0x7884, 0x7994, 0x911a, 0x1a04, 0x3559, 0x8019, 0x0904, 0x3559,
-	0x684e, 0x6946, 0x788c, 0x6862, 0x7888, 0x6866, 0x9006, 0x686a,
-	0x686e, 0x0126, 0x2091, 0x8000, 0x080c, 0x69dc, 0x012e, 0x0804,
-	0x3524, 0x902e, 0x2520, 0x81ff, 0x0120, 0x2009, 0x0001, 0x0804,
-	0x3556, 0x7984, 0x7b88, 0x7a8c, 0x20a9, 0x0005, 0x20e9, 0x0001,
-	0x20a1, 0x18a6, 0x4101, 0x080c, 0x4aa4, 0x1120, 0x2009, 0x0002,
-	0x0804, 0x3556, 0x2009, 0x0020, 0xa85c, 0x9080, 0x0019, 0xaf60,
-	0x080c, 0x4aed, 0x701f, 0x363d, 0x0005, 0xa864, 0x2008, 0x9084,
-	0x00ff, 0x9096, 0x0011, 0x0168, 0x9096, 0x0019, 0x0150, 0x9096,
-	0x0015, 0x0138, 0x9096, 0x0048, 0x0120, 0x9096, 0x0029, 0x1904,
-	0x3556, 0x810f, 0x918c, 0x00ff, 0x0904, 0x3556, 0x7112, 0x7010,
-	0x8001, 0x0560, 0x7012, 0x080c, 0x4aa4, 0x1120, 0x2009, 0x0002,
-	0x0804, 0x3556, 0x2009, 0x0020, 0x7068, 0x2040, 0xa28c, 0xa390,
-	0xa494, 0xa598, 0x9290, 0x0040, 0x9399, 0x0000, 0x94a1, 0x0000,
-	0x95a9, 0x0000, 0xa85c, 0x9080, 0x0019, 0xaf60, 0x080c, 0x4aed,
-	0x701f, 0x367b, 0x0005, 0xa864, 0x9084, 0x00ff, 0x9096, 0x0002,
-	0x0120, 0x9096, 0x000a, 0x1904, 0x3556, 0x0888, 0x7014, 0x2048,
-	0xa868, 0xc0fd, 0xa86a, 0xa864, 0x9084, 0x00ff, 0x9096, 0x0029,
-	0x1160, 0xc2fd, 0xaa7a, 0x080c, 0x618b, 0x0150, 0x0126, 0x2091,
-	0x8000, 0xa87a, 0xa982, 0x012e, 0x0050, 0x080c, 0x64b4, 0x1128,
-	0x7007, 0x0003, 0x701f, 0x36a7, 0x0005, 0x080c, 0x6ec0, 0x0126,
-	0x2091, 0x8000, 0x20a9, 0x0005, 0x20e1, 0x0001, 0x2099, 0x18a6,
-	0x400a, 0x2100, 0x9210, 0x9399, 0x0000, 0x94a1, 0x0000, 0x95a9,
-	0x0000, 0xa85c, 0x9080, 0x0019, 0x2009, 0x0020, 0x012e, 0xaf60,
-	0x0804, 0x4af0, 0x2091, 0x8000, 0x7837, 0x4000, 0x7833, 0x0010,
-	0x7883, 0x4000, 0x7887, 0x4953, 0x788b, 0x5020, 0x788f, 0x2020,
-	0x2009, 0x017f, 0x2104, 0x7892, 0x3f00, 0x7896, 0x2061, 0x0100,
-	0x6200, 0x2061, 0x0200, 0x603c, 0x8007, 0x9205, 0x789a, 0x2009,
-	0x04fd, 0x2104, 0x789e, 0x2091, 0x5000, 0x2091, 0x4080, 0x2001,
-	0x0089, 0x2004, 0xd084, 0x0180, 0x2001, 0x1a19, 0x2004, 0x9005,
-	0x0128, 0x2001, 0x008b, 0x2004, 0xd0fc, 0x0dd8, 0x2001, 0x008a,
-	0x2003, 0x0002, 0x2003, 0x1001, 0x2071, 0x0080, 0x0804, 0x0427,
-	0x81ff, 0x1904, 0x3556, 0x7984, 0x080c, 0x65ff, 0x1904, 0x3559,
-	0x7e98, 0x9684, 0x3fff, 0x9082, 0x4000, 0x1a04, 0x3559, 0x7c88,
-	0x7d8c, 0x080c, 0x6762, 0x080c, 0x6731, 0x0000, 0x1518, 0x2061,
-	0x1cd0, 0x0126, 0x2091, 0x8000, 0x6000, 0x9086, 0x0000, 0x0148,
-	0x6014, 0x904d, 0x0130, 0xa86c, 0x9406, 0x1118, 0xa870, 0x9506,
-	0x0150, 0x012e, 0x9ce0, 0x0018, 0x2001, 0x181a, 0x2004, 0x9c02,
-	0x1a04, 0x3556, 0x0c30, 0x080c, 0xc768, 0x012e, 0x0904, 0x3556,
-	0x0804, 0x3524, 0x900e, 0x2001, 0x0005, 0x080c, 0x6ec0, 0x0126,
-	0x2091, 0x8000, 0x080c, 0xce2a, 0x080c, 0x6c81, 0x012e, 0x0804,
-	0x3524, 0x00a6, 0x2950, 0xb198, 0x080c, 0x65ff, 0x1904, 0x3793,
-	0xb6a4, 0x9684, 0x3fff, 0x9082, 0x4000, 0x16e8, 0xb49c, 0xb5a0,
-	0x080c, 0x6762, 0x080c, 0x6731, 0x1520, 0x2061, 0x1cd0, 0x0126,
-	0x2091, 0x8000, 0x6000, 0x9086, 0x0000, 0x0148, 0x6014, 0x904d,
-	0x0130, 0xa86c, 0x9406, 0x1118, 0xa870, 0x9506, 0x0158, 0x012e,
-	0x9ce0, 0x0018, 0x2001, 0x181a, 0x2004, 0x9c02, 0x2009, 0x000d,
-	0x12b0, 0x0c28, 0x080c, 0xc768, 0x012e, 0x2009, 0x0003, 0x0178,
-	0x00e0, 0x900e, 0x2001, 0x0005, 0x080c, 0x6ec0, 0x0126, 0x2091,
-	0x8000, 0x080c, 0xce2a, 0x080c, 0x6c75, 0x012e, 0x0070, 0xb097,
-	0x4005, 0xb19a, 0x0010, 0xb097, 0x4006, 0x900e, 0x9085, 0x0001,
-	0x2001, 0x0030, 0x2a48, 0x00ae, 0x0005, 0xb097, 0x4000, 0x9006,
-	0x918d, 0x0001, 0x2008, 0x2a48, 0x00ae, 0x0005, 0x81ff, 0x1904,
-	0x3556, 0x080c, 0x4abb, 0x0904, 0x3559, 0x080c, 0x66c6, 0x0904,
-	0x3556, 0x080c, 0x6768, 0x0904, 0x3556, 0x0804, 0x451c, 0x81ff,
-	0x1904, 0x3556, 0x080c, 0x4ad7, 0x0904, 0x3559, 0x080c, 0x67f6,
-	0x0904, 0x3556, 0x2019, 0x0005, 0x79a8, 0x080c, 0x6783, 0x0904,
-	0x3556, 0x7888, 0x908a, 0x1000, 0x1a04, 0x3559, 0x8003, 0x800b,
-	0x810b, 0x9108, 0x080c, 0x8501, 0x7984, 0xd184, 0x1904, 0x3524,
-	0x0804, 0x451c, 0x0126, 0x2091, 0x8000, 0x81ff, 0x0118, 0x2009,
-	0x0001, 0x0450, 0x2029, 0x07ff, 0x645c, 0x2400, 0x9506, 0x01f8,
-	0x2508, 0x080c, 0x65ff, 0x11d8, 0x080c, 0x67f6, 0x1128, 0x2009,
-	0x0002, 0x62c0, 0x2518, 0x00c0, 0x2019, 0x0004, 0x900e, 0x080c,
-	0x6783, 0x1118, 0x2009, 0x0006, 0x0078, 0x7884, 0x908a, 0x1000,
-	0x1270, 0x8003, 0x800b, 0x810b, 0x9108, 0x080c, 0x8501, 0x8529,
-	0x1ae0, 0x012e, 0x0804, 0x3524, 0x012e, 0x0804, 0x3556, 0x012e,
-	0x0804, 0x3559, 0x080c, 0x4abb, 0x0904, 0x3559, 0x080c, 0x66c6,
-	0x0904, 0x3556, 0xbaa0, 0x2019, 0x0005, 0x00c6, 0x9066, 0x080c,
-	0x928b, 0x0076, 0x903e, 0x080c, 0x9168, 0x900e, 0x080c, 0xe2eb,
-	0x007e, 0x00ce, 0x080c, 0x6762, 0x0804, 0x3524, 0x080c, 0x4abb,
-	0x0904, 0x3559, 0x080c, 0x6762, 0x2208, 0x0804, 0x3524, 0x0156,
-	0x00d6, 0x00e6, 0x2069, 0x1910, 0x6810, 0x6914, 0x910a, 0x1208,
-	0x900e, 0x6816, 0x9016, 0x901e, 0x20a9, 0x007e, 0x2069, 0x1000,
-	0x2d04, 0x905d, 0x0118, 0xb84c, 0x0059, 0x9210, 0x8d68, 0x1f04,
-	0x3848, 0x2300, 0x9218, 0x00ee, 0x00de, 0x015e, 0x0804, 0x3524,
-	0x00f6, 0x0016, 0x907d, 0x0138, 0x9006, 0x8000, 0x2f0c, 0x81ff,
-	0x0110, 0x2178, 0x0cd0, 0x001e, 0x00fe, 0x0005, 0x2069, 0x1910,
-	0x6910, 0x62bc, 0x0804, 0x3524, 0x81ff, 0x0120, 0x2009, 0x0001,
-	0x0804, 0x3556, 0x0126, 0x2091, 0x8000, 0x080c, 0x56e3, 0x0128,
-	0x2009, 0x0007, 0x012e, 0x0804, 0x3556, 0x012e, 0x615c, 0x9190,
-	0x3325, 0x2215, 0x9294, 0x00ff, 0x637c, 0x83ff, 0x0108, 0x6280,
-	0x67dc, 0x97c4, 0x000a, 0x98c6, 0x000a, 0x1118, 0x2031, 0x0001,
-	0x00e8, 0x97c4, 0x0022, 0x98c6, 0x0022, 0x1118, 0x2031, 0x0003,
-	0x00a8, 0x97c4, 0x0012, 0x98c6, 0x0012, 0x1118, 0x2031, 0x0002,
-	0x0068, 0x080c, 0x73bc, 0x1118, 0x2031, 0x0004, 0x0038, 0xd79c,
-	0x0120, 0x2009, 0x0005, 0x0804, 0x3556, 0x9036, 0x7e9a, 0x7f9e,
-	0x0804, 0x3524, 0x614c, 0x6250, 0x2019, 0x1986, 0x231c, 0x2001,
-	0x1987, 0x2004, 0x789a, 0x0804, 0x3524, 0x0126, 0x2091, 0x8000,
-	0x6138, 0x623c, 0x6340, 0x012e, 0x0804, 0x3524, 0x080c, 0x4ad7,
-	0x0904, 0x3559, 0xba44, 0xbb38, 0x0804, 0x3524, 0x080c, 0x0dd5,
-	0x080c, 0x4ad7, 0x2110, 0x0904, 0x3559, 0xb804, 0x908c, 0x00ff,
-	0x918e, 0x0006, 0x0140, 0x9084, 0xff00, 0x9086, 0x0600, 0x2009,
-	0x0009, 0x1904, 0x3556, 0x0126, 0x2091, 0x8000, 0x2019, 0x0005,
-	0x00c6, 0x9066, 0x080c, 0xa808, 0x080c, 0x928b, 0x0076, 0x903e,
-	0x080c, 0x9168, 0x900e, 0x080c, 0xe2eb, 0x007e, 0x00ce, 0xb807,
-	0x0407, 0x012e, 0x0804, 0x3524, 0x614c, 0x6250, 0x7884, 0x604e,
-	0x7b88, 0x6352, 0x2069, 0x1847, 0x831f, 0x9305, 0x6816, 0x788c,
-	0x2069, 0x1986, 0x2d1c, 0x206a, 0x7e98, 0x9682, 0x0014, 0x1210,
-	0x2031, 0x07d0, 0x2069, 0x1987, 0x2d04, 0x266a, 0x789a, 0x0804,
-	0x3524, 0x0126, 0x2091, 0x8000, 0x7884, 0x603a, 0xd0c4, 0x01a8,
-	0x00d6, 0x78a8, 0x2009, 0x199d, 0x200a, 0x78ac, 0x2011, 0x199e,
-	0x2012, 0x2069, 0x0100, 0x6838, 0x9086, 0x0007, 0x1118, 0x2214,
-	0x6a5a, 0x0010, 0x210c, 0x695a, 0x00de, 0x7884, 0xd0b4, 0x0120,
-	0x3b00, 0x9084, 0xff3f, 0x20d8, 0x7888, 0x603e, 0x2011, 0x0114,
-	0x220c, 0x7888, 0xd08c, 0x0118, 0x918d, 0x0080, 0x0010, 0x918c,
-	0xff7f, 0x2112, 0x788c, 0x6042, 0x9084, 0x0020, 0x0130, 0x78b4,
-	0x6046, 0x9084, 0x0001, 0x090c, 0x420e, 0x6040, 0xd0cc, 0x0120,
-	0x78b0, 0x2011, 0x0114, 0x2012, 0x012e, 0x0804, 0x3524, 0x00f6,
-	0x2079, 0x1800, 0x7a38, 0xa898, 0x9084, 0xfebf, 0x9215, 0xa89c,
-	0x9084, 0xfebf, 0x8002, 0x9214, 0x7838, 0x9084, 0x0140, 0x9215,
-	0x7a3a, 0xa897, 0x4000, 0x900e, 0x9085, 0x0001, 0x2001, 0x0000,
-	0x00fe, 0x0005, 0x7898, 0x9005, 0x01a8, 0x7888, 0x9025, 0x0904,
-	0x3559, 0x788c, 0x902d, 0x0904, 0x3559, 0x900e, 0x080c, 0x65ff,
-	0x1120, 0xba44, 0xbb38, 0xbc46, 0xbd3a, 0x9186, 0x07ff, 0x0190,
-	0x8108, 0x0ca0, 0x080c, 0x4ad7, 0x0904, 0x3559, 0x7888, 0x900d,
-	0x0904, 0x3559, 0x788c, 0x9005, 0x0904, 0x3559, 0xba44, 0xb946,
-	0xbb38, 0xb83a, 0x0804, 0x3524, 0x2011, 0xbc09, 0x0010, 0x2011,
-	0xbc05, 0x080c, 0x56e3, 0x1904, 0x3556, 0x00c6, 0x2061, 0x0100,
-	0x7984, 0x9186, 0x00ff, 0x1130, 0x2001, 0x1818, 0x2004, 0x9085,
-	0xff00, 0x0088, 0x9182, 0x007f, 0x16e0, 0x9188, 0x3325, 0x210d,
-	0x918c, 0x00ff, 0x2001, 0x1818, 0x2004, 0x0026, 0x9116, 0x002e,
-	0x0580, 0x810f, 0x9105, 0x0126, 0x2091, 0x8000, 0x0006, 0x080c,
-	0xae0b, 0x000e, 0x0510, 0x602e, 0x620a, 0x7984, 0x00b6, 0x080c,
-	0x65a4, 0x2b08, 0x00be, 0x1500, 0x6112, 0x6023, 0x0001, 0x080c,
-	0x4aa4, 0x01d0, 0x9006, 0xa866, 0x7007, 0x0003, 0xa832, 0xa868,
-	0xc0fd, 0xa86a, 0x701f, 0x39ff, 0x2900, 0x6016, 0x2009, 0x0032,
-	0x080c, 0xaedc, 0x012e, 0x00ce, 0x0005, 0x012e, 0x00ce, 0x0804,
-	0x3556, 0x00ce, 0x0804, 0x3559, 0x080c, 0xae61, 0x0cb0, 0xa830,
-	0x9086, 0x0100, 0x0904, 0x3556, 0x0804, 0x3524, 0x2061, 0x1a71,
-	0x0126, 0x2091, 0x8000, 0x6000, 0xd084, 0x0170, 0x6104, 0x6208,
-	0x2061, 0x1800, 0x6354, 0x6074, 0x789a, 0x60c0, 0x789e, 0x60bc,
-	0x78aa, 0x012e, 0x0804, 0x3524, 0x900e, 0x2110, 0x0c88, 0x81ff,
-	0x1904, 0x3556, 0x080c, 0x73bc, 0x0904, 0x3556, 0x0126, 0x2091,
-	0x8000, 0x6254, 0x6074, 0x9202, 0x0248, 0x9085, 0x0001, 0x080c,
-	0x28a7, 0x080c, 0x58fd, 0x012e, 0x0804, 0x3524, 0x012e, 0x0804,
-	0x3559, 0x0006, 0x0016, 0x00c6, 0x00e6, 0x2001, 0x19a9, 0x2070,
-	0x2061, 0x1847, 0x6008, 0x2072, 0x900e, 0x2011, 0x1400, 0x080c,
-	0x8f68, 0x7206, 0x00ee, 0x00ce, 0x001e, 0x000e, 0x0005, 0x0126,
-	0x2091, 0x8000, 0x81ff, 0x0128, 0x012e, 0x2021, 0x400b, 0x0804,
-	0x3526, 0x7884, 0xd0fc, 0x0148, 0x2001, 0x002a, 0x2004, 0x9082,
-	0x00e1, 0x0288, 0x012e, 0x0804, 0x3559, 0x2001, 0x002a, 0x2004,
-	0x2069, 0x1847, 0x6908, 0x9102, 0x1230, 0x012e, 0x0804, 0x3559,
-	0x012e, 0x0804, 0x3556, 0x080c, 0xadcb, 0x0dd0, 0x7884, 0xd0fc,
-	0x0904, 0x3aca, 0x00c6, 0x080c, 0x4aa4, 0x00ce, 0x0d88, 0xa867,
-	0x0000, 0x7884, 0xa80a, 0x7898, 0xa80e, 0x789c, 0xa812, 0x2001,
-	0x002e, 0x2004, 0xa81a, 0x2001, 0x002f, 0x2004, 0xa81e, 0x2001,
-	0x0030, 0x2004, 0xa822, 0x2001, 0x0031, 0x2004, 0xa826, 0x2001,
-	0x0034, 0x2004, 0xa82a, 0x2001, 0x0035, 0x2004, 0xa82e, 0x2001,
-	0x002a, 0x2004, 0x9080, 0x0003, 0x9084, 0x00fc, 0x8004, 0xa816,
-	0x080c, 0x3c50, 0x0928, 0x7014, 0x2048, 0xad2c, 0xac28, 0xab1c,
-	0xaa18, 0xa930, 0xa808, 0xd0b4, 0x1120, 0x2029, 0x0000, 0x2021,
+	0x8000, 0x8000, 0x8000, 0x8000, 0x8000, 0x8000, 0x8000, 0x2071,
+	0x189e, 0x7003, 0x0002, 0x9006, 0x7016, 0x701a, 0x704a, 0x704e,
+	0x700e, 0x7042, 0x7046, 0x703b, 0x18ba, 0x703f, 0x18ba, 0x7007,
+	0x0001, 0x080c, 0x1018, 0x090c, 0x0dd5, 0x2900, 0x706a, 0xa867,
+	0x0002, 0xa8ab, 0xdcb0, 0x080c, 0x1018, 0x090c, 0x0dd5, 0x2900,
+	0x706e, 0xa867, 0x0002, 0xa8ab, 0xdcb0, 0x0005, 0x2071, 0x189e,
+	0x7004, 0x0002, 0x3456, 0x3457, 0x346a, 0x347e, 0x0005, 0x1004,
+	0x3467, 0x0e04, 0x3467, 0x2079, 0x0000, 0x0126, 0x2091, 0x8000,
+	0x700c, 0x9005, 0x1128, 0x700f, 0x0001, 0x012e, 0x0468, 0x0005,
+	0x012e, 0x0ce8, 0x2079, 0x0000, 0x2061, 0x18b8, 0x2c4c, 0xa86c,
+	0x908e, 0x0100, 0x0128, 0x9086, 0x0200, 0x0904, 0x3552, 0x0005,
+	0x7018, 0x2048, 0x2061, 0x1800, 0x701c, 0x0807, 0x7014, 0x2048,
+	0xa864, 0x9094, 0x00ff, 0x9296, 0x0029, 0x1120, 0xaa78, 0xd2fc,
+	0x0128, 0x0005, 0x9086, 0x0103, 0x0108, 0x0005, 0x2079, 0x0000,
+	0x2061, 0x1800, 0x701c, 0x0807, 0x2061, 0x1800, 0x7880, 0x908a,
+	0x0040, 0x1210, 0x61d0, 0x0042, 0x2100, 0x908a, 0x003f, 0x1a04,
+	0x354f, 0x61d0, 0x0804, 0x34e4, 0x3526, 0x355e, 0x354f, 0x3568,
+	0x3572, 0x3578, 0x357c, 0x358c, 0x3590, 0x35a6, 0x35ac, 0x35b2,
+	0x35bd, 0x35c8, 0x35d7, 0x35e6, 0x35f4, 0x360b, 0x3626, 0x354f,
+	0x36cf, 0x370d, 0x37b3, 0x37c4, 0x37e7, 0x354f, 0x354f, 0x354f,
+	0x381f, 0x383b, 0x3844, 0x3873, 0x3879, 0x354f, 0x38bf, 0x354f,
+	0x354f, 0x354f, 0x354f, 0x354f, 0x38ca, 0x38d3, 0x38db, 0x38dd,
+	0x354f, 0x354f, 0x354f, 0x354f, 0x354f, 0x354f, 0x3909, 0x354f,
+	0x354f, 0x354f, 0x354f, 0x354f, 0x3926, 0x3987, 0x354f, 0x354f,
+	0x354f, 0x354f, 0x354f, 0x354f, 0x0002, 0x39b1, 0x39b4, 0x3a13,
+	0x3a2c, 0x3a5c, 0x3cfa, 0x354f, 0x52b1, 0x354f, 0x354f, 0x354f,
+	0x354f, 0x354f, 0x354f, 0x354f, 0x354f, 0x35a6, 0x35ac, 0x421b,
+	0x56fc, 0x4239, 0x5340, 0x5391, 0x5494, 0x354f, 0x54f6, 0x5532,
+	0x5563, 0x5667, 0x5590, 0x55e7, 0x354f, 0x423d, 0x43fe, 0x4414,
+	0x4439, 0x449e, 0x4512, 0x4532, 0x45a9, 0x4605, 0x4661, 0x4664,
+	0x4689, 0x4726, 0x478c, 0x4794, 0x48c6, 0x4a3e, 0x4a72, 0x4cd6,
+	0x354f, 0x4cf4, 0x4d99, 0x4e7b, 0x4ed5, 0x354f, 0x4f8a, 0x354f,
+	0x4ff0, 0x500b, 0x4794, 0x5251, 0x714c, 0x0000, 0x2021, 0x4000,
+	0x080c, 0x4af0, 0x0126, 0x2091, 0x8000, 0x0e04, 0x3530, 0x0010,
+	0x012e, 0x0cc0, 0x7c36, 0x9486, 0x4000, 0x0118, 0x7833, 0x0011,
+	0x0010, 0x7833, 0x0010, 0x7c82, 0x7986, 0x7a8a, 0x7b8e, 0x2091,
+	0x4080, 0x2001, 0x0089, 0x2004, 0xd084, 0x190c, 0x119b, 0x7007,
+	0x0001, 0x2091, 0x5000, 0x700f, 0x0000, 0x012e, 0x0005, 0x2021,
+	0x4001, 0x08b0, 0x2021, 0x4002, 0x0898, 0x2021, 0x4003, 0x0880,
+	0x2021, 0x4005, 0x0868, 0x2021, 0x4006, 0x0850, 0x2039, 0x0001,
+	0x902e, 0x2520, 0x7b88, 0x7a8c, 0x7884, 0x7990, 0x0804, 0x4afd,
+	0x2039, 0x0001, 0x902e, 0x2520, 0x7b88, 0x7a8c, 0x7884, 0x7990,
+	0x0804, 0x4b00, 0x7984, 0x7888, 0x2114, 0x200a, 0x0804, 0x3526,
+	0x7984, 0x2114, 0x0804, 0x3526, 0x20e1, 0x0000, 0x2099, 0x0021,
+	0x20e9, 0x0000, 0x20a1, 0x0021, 0x20a9, 0x001f, 0x4003, 0x7984,
+	0x7a88, 0x7b8c, 0x0804, 0x3526, 0x7884, 0x2060, 0x0804, 0x35d9,
+	0x2009, 0x0003, 0x2011, 0x0002, 0x2019, 0x001e, 0x789b, 0x0137,
+	0x7893, 0xffff, 0x2001, 0x188f, 0x2004, 0x9005, 0x0118, 0x7896,
+	0x0804, 0x3526, 0x7897, 0x0001, 0x0804, 0x3526, 0x2039, 0x0001,
+	0x7d98, 0x7c9c, 0x0804, 0x3562, 0x2039, 0x0001, 0x7d98, 0x7c9c,
+	0x0804, 0x356c, 0x79a0, 0x9182, 0x0040, 0x0210, 0x0804, 0x355b,
+	0x2138, 0x7d98, 0x7c9c, 0x0804, 0x3562, 0x79a0, 0x9182, 0x0040,
+	0x0210, 0x0804, 0x355b, 0x2138, 0x7d98, 0x7c9c, 0x0804, 0x356c,
+	0x79a0, 0x9182, 0x0040, 0x0210, 0x0804, 0x355b, 0x21e8, 0x7984,
+	0x7888, 0x20a9, 0x0001, 0x21a0, 0x4004, 0x0804, 0x3526, 0x2061,
+	0x0800, 0xe10c, 0x9006, 0x2c15, 0x9200, 0x8c60, 0x8109, 0x1dd8,
+	0x2010, 0x9005, 0x0904, 0x3526, 0x0804, 0x3555, 0x79a0, 0x9182,
+	0x0040, 0x0210, 0x0804, 0x355b, 0x21e0, 0x20a9, 0x0001, 0x7984,
+	0x2198, 0x4012, 0x0804, 0x3526, 0x2069, 0x1847, 0x7884, 0x7990,
+	0x911a, 0x1a04, 0x355b, 0x8019, 0x0904, 0x355b, 0x684a, 0x6942,
+	0x788c, 0x6852, 0x7888, 0x6856, 0x9006, 0x685a, 0x685e, 0x080c,
+	0x76be, 0x0804, 0x3526, 0x2069, 0x1847, 0x7884, 0x7994, 0x911a,
+	0x1a04, 0x355b, 0x8019, 0x0904, 0x355b, 0x684e, 0x6946, 0x788c,
+	0x6862, 0x7888, 0x6866, 0x9006, 0x686a, 0x686e, 0x0126, 0x2091,
+	0x8000, 0x080c, 0x69e1, 0x012e, 0x0804, 0x3526, 0x902e, 0x2520,
+	0x81ff, 0x0120, 0x2009, 0x0001, 0x0804, 0x3558, 0x7984, 0x7b88,
+	0x7a8c, 0x20a9, 0x0005, 0x20e9, 0x0001, 0x20a1, 0x18a6, 0x4101,
+	0x080c, 0x4ab4, 0x1120, 0x2009, 0x0002, 0x0804, 0x3558, 0x2009,
+	0x0020, 0xa85c, 0x9080, 0x0019, 0xaf60, 0x080c, 0x4afd, 0x701f,
+	0x364a, 0x0005, 0xa864, 0x2008, 0x9084, 0x00ff, 0x9096, 0x0011,
+	0x0168, 0x9096, 0x0019, 0x0150, 0x9096, 0x0015, 0x0138, 0x9096,
+	0x0048, 0x0120, 0x9096, 0x0029, 0x1904, 0x3558, 0x810f, 0x918c,
+	0x00ff, 0x0904, 0x3558, 0x7112, 0x7010, 0x8001, 0x0560, 0x7012,
+	0x080c, 0x4ab4, 0x1120, 0x2009, 0x0002, 0x0804, 0x3558, 0x2009,
+	0x0020, 0x7068, 0x2040, 0xa28c, 0xa390, 0xa494, 0xa598, 0x9290,
+	0x0040, 0x9399, 0x0000, 0x94a1, 0x0000, 0x95a9, 0x0000, 0xa85c,
+	0x9080, 0x0019, 0xaf60, 0x080c, 0x4afd, 0x701f, 0x3688, 0x0005,
+	0xa864, 0x9084, 0x00ff, 0x9096, 0x0002, 0x0120, 0x9096, 0x000a,
+	0x1904, 0x3558, 0x0888, 0x7014, 0x2048, 0xa868, 0xc0fd, 0xa86a,
+	0xa864, 0x9084, 0x00ff, 0x9096, 0x0029, 0x1160, 0xc2fd, 0xaa7a,
+	0x080c, 0x6194, 0x0150, 0x0126, 0x2091, 0x8000, 0xa87a, 0xa982,
+	0x012e, 0x0050, 0x080c, 0x64bd, 0x1128, 0x7007, 0x0003, 0x701f,
+	0x36b4, 0x0005, 0x080c, 0x6eb9, 0x0126, 0x2091, 0x8000, 0x20a9,
+	0x0005, 0x20e1, 0x0001, 0x2099, 0x18a6, 0x400a, 0x2100, 0x9210,
+	0x9399, 0x0000, 0x94a1, 0x0000, 0x95a9, 0x0000, 0xa85c, 0x9080,
+	0x0019, 0x2009, 0x0020, 0x012e, 0xaf60, 0x0804, 0x4b00, 0x2091,
+	0x8000, 0x7837, 0x4000, 0x7833, 0x0010, 0x7883, 0x4000, 0x7887,
+	0x4953, 0x788b, 0x5020, 0x788f, 0x2020, 0x2009, 0x017f, 0x2104,
+	0x7892, 0x3f00, 0x7896, 0x2061, 0x0100, 0x6200, 0x2061, 0x0200,
+	0x603c, 0x8007, 0x9205, 0x789a, 0x2009, 0x04fd, 0x2104, 0x789e,
+	0x2091, 0x5000, 0x2091, 0x4080, 0x2001, 0x0089, 0x2004, 0xd084,
+	0x0180, 0x2001, 0x1a18, 0x2004, 0x9005, 0x0128, 0x2001, 0x008b,
+	0x2004, 0xd0fc, 0x0dd8, 0x2001, 0x008a, 0x2003, 0x0002, 0x2003,
+	0x1001, 0x2071, 0x0080, 0x0804, 0x0427, 0x81ff, 0x1904, 0x3558,
+	0x7984, 0x080c, 0x6608, 0x1904, 0x355b, 0x7e98, 0x9684, 0x3fff,
+	0x9082, 0x4000, 0x1a04, 0x355b, 0x7c88, 0x7d8c, 0x080c, 0x676b,
+	0x080c, 0x673a, 0x0000, 0x1518, 0x2061, 0x1cd0, 0x0126, 0x2091,
+	0x8000, 0x6000, 0x9086, 0x0000, 0x0148, 0x6014, 0x904d, 0x0130,
+	0xa86c, 0x9406, 0x1118, 0xa870, 0x9506, 0x0150, 0x012e, 0x9ce0,
+	0x0018, 0x2001, 0x181a, 0x2004, 0x9c02, 0x1a04, 0x3558, 0x0c30,
+	0x080c, 0xc77b, 0x012e, 0x0904, 0x3558, 0x0804, 0x3526, 0x900e,
+	0x2001, 0x0005, 0x080c, 0x6eb9, 0x0126, 0x2091, 0x8000, 0x080c,
+	0xce44, 0x080c, 0x6c86, 0x012e, 0x0804, 0x3526, 0x00a6, 0x2950,
+	0xb198, 0x080c, 0x6608, 0x1904, 0x37a0, 0xb6a4, 0x9684, 0x3fff,
+	0x9082, 0x4000, 0x16e8, 0xb49c, 0xb5a0, 0x080c, 0x676b, 0x080c,
+	0x673a, 0x1520, 0x2061, 0x1cd0, 0x0126, 0x2091, 0x8000, 0x6000,
+	0x9086, 0x0000, 0x0148, 0x6014, 0x904d, 0x0130, 0xa86c, 0x9406,
+	0x1118, 0xa870, 0x9506, 0x0158, 0x012e, 0x9ce0, 0x0018, 0x2001,
+	0x181a, 0x2004, 0x9c02, 0x2009, 0x000d, 0x12b0, 0x0c28, 0x080c,
+	0xc77b, 0x012e, 0x2009, 0x0003, 0x0178, 0x00e0, 0x900e, 0x2001,
+	0x0005, 0x080c, 0x6eb9, 0x0126, 0x2091, 0x8000, 0x080c, 0xce44,
+	0x080c, 0x6c7a, 0x012e, 0x0070, 0xb097, 0x4005, 0xb19a, 0x0010,
+	0xb097, 0x4006, 0x900e, 0x9085, 0x0001, 0x2001, 0x0030, 0x2a48,
+	0x00ae, 0x0005, 0xb097, 0x4000, 0x9006, 0x918d, 0x0001, 0x2008,
+	0x2a48, 0x00ae, 0x0005, 0x81ff, 0x1904, 0x3558, 0x080c, 0x4acb,
+	0x0904, 0x355b, 0x080c, 0x66cf, 0x0904, 0x3558, 0x080c, 0x6771,
+	0x0904, 0x3558, 0x0804, 0x4529, 0x81ff, 0x1904, 0x3558, 0x080c,
+	0x4ae7, 0x0904, 0x355b, 0x080c, 0x67ff, 0x0904, 0x3558, 0x2019,
+	0x0005, 0x79a8, 0x080c, 0x678c, 0x0904, 0x3558, 0x7888, 0x908a,
+	0x1000, 0x1a04, 0x355b, 0x8003, 0x800b, 0x810b, 0x9108, 0x080c,
+	0x84ea, 0x7984, 0xd184, 0x1904, 0x3526, 0x0804, 0x4529, 0x0126,
+	0x2091, 0x8000, 0x81ff, 0x0118, 0x2009, 0x0001, 0x0450, 0x2029,
+	0x07ff, 0x645c, 0x2400, 0x9506, 0x01f8, 0x2508, 0x080c, 0x6608,
+	0x11d8, 0x080c, 0x67ff, 0x1128, 0x2009, 0x0002, 0x62c0, 0x2518,
+	0x00c0, 0x2019, 0x0004, 0x900e, 0x080c, 0x678c, 0x1118, 0x2009,
+	0x0006, 0x0078, 0x7884, 0x908a, 0x1000, 0x1270, 0x8003, 0x800b,
+	0x810b, 0x9108, 0x080c, 0x84ea, 0x8529, 0x1ae0, 0x012e, 0x0804,
+	0x3526, 0x012e, 0x0804, 0x3558, 0x012e, 0x0804, 0x355b, 0x080c,
+	0x4acb, 0x0904, 0x355b, 0x080c, 0x66cf, 0x0904, 0x3558, 0xbaa0,
+	0x2019, 0x0005, 0x00c6, 0x9066, 0x080c, 0x927e, 0x0076, 0x903e,
+	0x080c, 0x9151, 0x900e, 0x080c, 0xe30c, 0x007e, 0x00ce, 0x080c,
+	0x676b, 0x0804, 0x3526, 0x080c, 0x4acb, 0x0904, 0x355b, 0x080c,
+	0x676b, 0x2208, 0x0804, 0x3526, 0x0156, 0x00d6, 0x00e6, 0x2069,
+	0x1910, 0x6810, 0x6914, 0x910a, 0x1208, 0x900e, 0x6816, 0x9016,
+	0x901e, 0x20a9, 0x007e, 0x2069, 0x1000, 0x2d04, 0x905d, 0x0118,
+	0xb84c, 0x0059, 0x9210, 0x8d68, 0x1f04, 0x3855, 0x2300, 0x9218,
+	0x00ee, 0x00de, 0x015e, 0x0804, 0x3526, 0x00f6, 0x0016, 0x907d,
+	0x0138, 0x9006, 0x8000, 0x2f0c, 0x81ff, 0x0110, 0x2178, 0x0cd0,
+	0x001e, 0x00fe, 0x0005, 0x2069, 0x1910, 0x6910, 0x62bc, 0x0804,
+	0x3526, 0x81ff, 0x0120, 0x2009, 0x0001, 0x0804, 0x3558, 0x0126,
+	0x2091, 0x8000, 0x080c, 0x56ec, 0x0128, 0x2009, 0x0007, 0x012e,
+	0x0804, 0x3558, 0x012e, 0x615c, 0x9190, 0x3327, 0x2215, 0x9294,
+	0x00ff, 0x637c, 0x83ff, 0x0108, 0x6280, 0x67dc, 0x97c4, 0x000a,
+	0x98c6, 0x000a, 0x1118, 0x2031, 0x0001, 0x00e8, 0x97c4, 0x0022,
+	0x98c6, 0x0022, 0x1118, 0x2031, 0x0003, 0x00a8, 0x97c4, 0x0012,
+	0x98c6, 0x0012, 0x1118, 0x2031, 0x0002, 0x0068, 0x080c, 0x73a5,
+	0x1118, 0x2031, 0x0004, 0x0038, 0xd79c, 0x0120, 0x2009, 0x0005,
+	0x0804, 0x3558, 0x9036, 0x7e9a, 0x7f9e, 0x0804, 0x3526, 0x614c,
+	0x6250, 0x2019, 0x1985, 0x231c, 0x2001, 0x1986, 0x2004, 0x789a,
+	0x0804, 0x3526, 0x0126, 0x2091, 0x8000, 0x6138, 0x623c, 0x6340,
+	0x012e, 0x0804, 0x3526, 0x080c, 0x4ae7, 0x0904, 0x355b, 0xba44,
+	0xbb38, 0x0804, 0x3526, 0x080c, 0x0dd5, 0x080c, 0x4ae7, 0x2110,
+	0x0904, 0x355b, 0xb804, 0x908c, 0x00ff, 0x918e, 0x0006, 0x0140,
+	0x9084, 0xff00, 0x9086, 0x0600, 0x2009, 0x0009, 0x1904, 0x3558,
+	0x0126, 0x2091, 0x8000, 0x2019, 0x0005, 0x00c6, 0x9066, 0x080c,
+	0xa80e, 0x080c, 0x927e, 0x0076, 0x903e, 0x080c, 0x9151, 0x900e,
+	0x080c, 0xe30c, 0x007e, 0x00ce, 0xb807, 0x0407, 0x012e, 0x0804,
+	0x3526, 0x614c, 0x6250, 0x7884, 0x604e, 0x7b88, 0x6352, 0x2069,
+	0x1847, 0x831f, 0x9305, 0x6816, 0x788c, 0x2069, 0x1985, 0x2d1c,
+	0x206a, 0x7e98, 0x9682, 0x0014, 0x1210, 0x2031, 0x07d0, 0x2069,
+	0x1986, 0x2d04, 0x266a, 0x789a, 0x0804, 0x3526, 0x0126, 0x2091,
+	0x8000, 0x7884, 0x603a, 0xd0c4, 0x01a8, 0x00d6, 0x78a8, 0x2009,
+	0x199c, 0x200a, 0x78ac, 0x2011, 0x199d, 0x2012, 0x2069, 0x0100,
+	0x6838, 0x9086, 0x0007, 0x1118, 0x2214, 0x6a5a, 0x0010, 0x210c,
+	0x695a, 0x00de, 0x7884, 0xd0b4, 0x0120, 0x3b00, 0x9084, 0xff3f,
+	0x20d8, 0x7888, 0x603e, 0x2011, 0x0114, 0x220c, 0x7888, 0xd08c,
+	0x0118, 0x918d, 0x0080, 0x0010, 0x918c, 0xff7f, 0x2112, 0x788c,
+	0x6042, 0x9084, 0x0020, 0x0130, 0x78b4, 0x6046, 0x9084, 0x0001,
+	0x090c, 0x421b, 0x6040, 0xd0cc, 0x0120, 0x78b0, 0x2011, 0x0114,
+	0x2012, 0x012e, 0x0804, 0x3526, 0x00f6, 0x2079, 0x1800, 0x7a38,
+	0xa898, 0x9084, 0xfebf, 0x9215, 0xa89c, 0x9084, 0xfebf, 0x8002,
+	0x9214, 0x7838, 0x9084, 0x0140, 0x9215, 0x7a3a, 0xa897, 0x4000,
+	0x900e, 0x9085, 0x0001, 0x2001, 0x0000, 0x00fe, 0x0005, 0x7898,
+	0x9005, 0x01a8, 0x7888, 0x9025, 0x0904, 0x355b, 0x788c, 0x902d,
+	0x0904, 0x355b, 0x900e, 0x080c, 0x6608, 0x1120, 0xba44, 0xbb38,
+	0xbc46, 0xbd3a, 0x9186, 0x07ff, 0x0190, 0x8108, 0x0ca0, 0x080c,
+	0x4ae7, 0x0904, 0x355b, 0x7888, 0x900d, 0x0904, 0x355b, 0x788c,
+	0x9005, 0x0904, 0x355b, 0xba44, 0xb946, 0xbb38, 0xb83a, 0x0804,
+	0x3526, 0x2011, 0xbc09, 0x0010, 0x2011, 0xbc05, 0x080c, 0x56ec,
+	0x1904, 0x3558, 0x00c6, 0x2061, 0x0100, 0x7984, 0x9186, 0x00ff,
+	0x1130, 0x2001, 0x1818, 0x2004, 0x9085, 0xff00, 0x0088, 0x9182,
+	0x007f, 0x16e0, 0x9188, 0x3327, 0x210d, 0x918c, 0x00ff, 0x2001,
+	0x1818, 0x2004, 0x0026, 0x9116, 0x002e, 0x0580, 0x810f, 0x9105,
+	0x0126, 0x2091, 0x8000, 0x0006, 0x080c, 0xae1b, 0x000e, 0x0510,
+	0x602e, 0x620a, 0x7984, 0x00b6, 0x080c, 0x65ad, 0x2b08, 0x00be,
+	0x1500, 0x6112, 0x6023, 0x0001, 0x080c, 0x4ab4, 0x01d0, 0x9006,
+	0xa866, 0x7007, 0x0003, 0xa832, 0xa868, 0xc0fd, 0xa86a, 0x701f,
+	0x3a0c, 0x2900, 0x6016, 0x2009, 0x0032, 0x080c, 0xaeec, 0x012e,
+	0x00ce, 0x0005, 0x012e, 0x00ce, 0x0804, 0x3558, 0x00ce, 0x0804,
+	0x355b, 0x080c, 0xae71, 0x0cb0, 0xa830, 0x9086, 0x0100, 0x0904,
+	0x3558, 0x0804, 0x3526, 0x2061, 0x1a70, 0x0126, 0x2091, 0x8000,
+	0x6000, 0xd084, 0x0170, 0x6104, 0x6208, 0x2061, 0x1800, 0x6354,
+	0x6074, 0x789a, 0x60c0, 0x789e, 0x60bc, 0x78aa, 0x012e, 0x0804,
+	0x3526, 0x900e, 0x2110, 0x0c88, 0x81ff, 0x1904, 0x3558, 0x080c,
+	0x73a5, 0x0904, 0x3558, 0x0126, 0x2091, 0x8000, 0x6254, 0x6074,
+	0x9202, 0x0248, 0x9085, 0x0001, 0x080c, 0x28a9, 0x080c, 0x5906,
+	0x012e, 0x0804, 0x3526, 0x012e, 0x0804, 0x355b, 0x0006, 0x0016,
+	0x00c6, 0x00e6, 0x2001, 0x19a8, 0x2070, 0x2061, 0x1847, 0x6008,
+	0x2072, 0x900e, 0x2011, 0x1400, 0x080c, 0x8f51, 0x7206, 0x00ee,
+	0x00ce, 0x001e, 0x000e, 0x0005, 0x0126, 0x2091, 0x8000, 0x81ff,
+	0x0128, 0x012e, 0x2021, 0x400b, 0x0804, 0x3528, 0x7884, 0xd0fc,
+	0x0148, 0x2001, 0x002a, 0x2004, 0x9082, 0x00e1, 0x0288, 0x012e,
+	0x0804, 0x355b, 0x2001, 0x002a, 0x2004, 0x2069, 0x1847, 0x6908,
+	0x9102, 0x1230, 0x012e, 0x0804, 0x355b, 0x012e, 0x0804, 0x3558,
+	0x080c, 0xaddb, 0x0dd0, 0x7884, 0xd0fc, 0x0904, 0x3ad7, 0x00c6,
+	0x080c, 0x4ab4, 0x00ce, 0x0d88, 0xa867, 0x0000, 0x7884, 0xa80a,
+	0x7898, 0xa80e, 0x789c, 0xa812, 0x2001, 0x002e, 0x2004, 0xa81a,
+	0x2001, 0x002f, 0x2004, 0xa81e, 0x2001, 0x0030, 0x2004, 0xa822,
+	0x2001, 0x0031, 0x2004, 0xa826, 0x2001, 0x0034, 0x2004, 0xa82a,
+	0x2001, 0x0035, 0x2004, 0xa82e, 0x2001, 0x002a, 0x2004, 0x9080,
+	0x0003, 0x9084, 0x00fc, 0x8004, 0xa816, 0x080c, 0x3c5d, 0x0928,
+	0x7014, 0x2048, 0xad2c, 0xac28, 0xab1c, 0xaa18, 0xa930, 0xa808,
+	0xd0b4, 0x1120, 0x2029, 0x0000, 0x2021, 0x0000, 0x8906, 0x8006,
+	0x8007, 0x90bc, 0x003f, 0x9084, 0xffc0, 0x9080, 0x001b, 0x080c,
+	0x4afd, 0x701f, 0x3b9a, 0x7023, 0x0001, 0x012e, 0x0005, 0x0046,
+	0x0086, 0x0096, 0x00a6, 0x00b6, 0x00c6, 0x00d6, 0x00e6, 0x00f6,
+	0x080c, 0x3a46, 0x2001, 0x199e, 0x2003, 0x0000, 0x2021, 0x000a,
+	0x2061, 0x0100, 0x6104, 0x0016, 0x60bb, 0x0000, 0x60bf, 0x32e1,
+	0x60bf, 0x0012, 0x080c, 0x3ccc, 0x080c, 0x3c8b, 0x00f6, 0x00e6,
+	0x0086, 0x2940, 0x2071, 0x1a65, 0x2079, 0x0090, 0x00d6, 0x2069,
+	0x0000, 0x6884, 0xd0b4, 0x0140, 0x2001, 0x0035, 0x2004, 0x780e,
+	0x2001, 0x0034, 0x2004, 0x780a, 0x00de, 0x2011, 0x0001, 0x080c,
+	0x405f, 0x008e, 0x00ee, 0x00fe, 0x080c, 0x3f8c, 0x080c, 0x3e91,
+	0x05b8, 0x2001, 0x020b, 0x2004, 0x9084, 0x0140, 0x1db8, 0x080c,
+	0x40d3, 0x00f6, 0x2079, 0x0300, 0x78bc, 0x00fe, 0x908c, 0x0070,
+	0x1560, 0x2071, 0x0200, 0x7037, 0x0000, 0x7050, 0x9084, 0xff00,
+	0x9086, 0x3200, 0x1510, 0x7037, 0x0001, 0x7050, 0x9084, 0xff00,
+	0x9086, 0xe100, 0x11d0, 0x7037, 0x0000, 0x7054, 0x7037, 0x0000,
+	0x715c, 0x9106, 0x1190, 0x2001, 0x1820, 0x2004, 0x9106, 0x1168,
+	0x00c6, 0x2061, 0x0100, 0x6024, 0x9084, 0x1e00, 0x00ce, 0x0138,
+	0x080c, 0x3e9b, 0x080c, 0x3c86, 0x0058, 0x080c, 0x3c86, 0x080c,
+	0x3ff7, 0x080c, 0x3f82, 0x2001, 0x020b, 0x2004, 0xd0e4, 0x0dd8,
+	0x2001, 0x032a, 0x2003, 0x0004, 0x2061, 0x0100, 0x6027, 0x0002,
+	0x001e, 0x6106, 0x2011, 0x020d, 0x2013, 0x0020, 0x60bb, 0x0000,
+	0x60bf, 0x0108, 0x60bf, 0x0012, 0x2001, 0x0004, 0x200c, 0x918c,
+	0xfffd, 0x2102, 0x080c, 0x12ed, 0x2009, 0x0028, 0x080c, 0x23d4,
+	0x2001, 0x0227, 0x200c, 0x2102, 0x00fe, 0x00ee, 0x00de, 0x00ce,
+	0x00be, 0x00ae, 0x009e, 0x008e, 0x004e, 0x2001, 0x199e, 0x2004,
+	0x9005, 0x1118, 0x012e, 0x0804, 0x3526, 0x012e, 0x2021, 0x400c,
+	0x0804, 0x3528, 0x0016, 0x0026, 0x0036, 0x0046, 0x0056, 0x0076,
+	0x0086, 0x0096, 0x00d6, 0x0156, 0x7014, 0x2048, 0x7020, 0x20a8,
+	0x8000, 0x7022, 0xa804, 0x9005, 0x0904, 0x3bf6, 0x2048, 0x1f04,
+	0x3baa, 0x7068, 0x2040, 0xa28c, 0xa390, 0xa494, 0xa598, 0xa930,
+	0xa808, 0xd0b4, 0x1120, 0x2029, 0x0000, 0x2021, 0x0000, 0x0096,
+	0x7014, 0x2048, 0xa864, 0x009e, 0x9086, 0x0103, 0x0170, 0x8906,
+	0x8006, 0x8007, 0x90bc, 0x003f, 0x9084, 0xffc0, 0x9080, 0x001b,
+	0x080c, 0x4afd, 0x701f, 0x3b9a, 0x00b0, 0x8906, 0x8006, 0x8007,
+	0x90bc, 0x003f, 0x9084, 0xffc0, 0x9080, 0x001b, 0x21a8, 0x27e0,
+	0x2098, 0x27e8, 0x20a0, 0x0006, 0x080c, 0x0f7c, 0x000e, 0x080c,
+	0x4b00, 0x701f, 0x3b9a, 0x015e, 0x00de, 0x009e, 0x008e, 0x007e,
+	0x005e, 0x004e, 0x003e, 0x002e, 0x001e, 0x0005, 0x7014, 0x2048,
+	0xa864, 0x9086, 0x0103, 0x1118, 0x701f, 0x3c5b, 0x0450, 0x7014,
+	0x2048, 0xa868, 0xc0fd, 0xa86a, 0x2009, 0x007f, 0x080c, 0x65a7,
+	0x0110, 0x9006, 0x0030, 0xb813, 0x00ff, 0xb817, 0xfffd, 0x080c,
+	0xd013, 0x015e, 0x00de, 0x009e, 0x008e, 0x007e, 0x005e, 0x004e,
+	0x003e, 0x002e, 0x001e, 0x0904, 0x3558, 0x0016, 0x0026, 0x0036,
+	0x0046, 0x0056, 0x0076, 0x0086, 0x0096, 0x00d6, 0x0156, 0x701f,
+	0x3c2d, 0x7007, 0x0003, 0x0804, 0x3beb, 0xa830, 0x9086, 0x0100,
+	0x2021, 0x400c, 0x0904, 0x3528, 0x0076, 0xad10, 0xac0c, 0xab24,
+	0xaa20, 0xa930, 0xa808, 0xd0b4, 0x1120, 0x2029, 0x0000, 0x2021,
 	0x0000, 0x8906, 0x8006, 0x8007, 0x90bc, 0x003f, 0x9084, 0xffc0,
-	0x9080, 0x001b, 0x080c, 0x4aed, 0x701f, 0x3b8d, 0x7023, 0x0001,
-	0x012e, 0x0005, 0x0046, 0x0086, 0x0096, 0x00a6, 0x00b6, 0x00c6,
-	0x00d6, 0x00e6, 0x00f6, 0x080c, 0x3a39, 0x2001, 0x199f, 0x2003,
-	0x0000, 0x2021, 0x000a, 0x2061, 0x0100, 0x6104, 0x0016, 0x60bb,
-	0x0000, 0x60bf, 0x32e1, 0x60bf, 0x0012, 0x080c, 0x3cbf, 0x080c,
-	0x3c7e, 0x00f6, 0x00e6, 0x0086, 0x2940, 0x2071, 0x1a66, 0x2079,
-	0x0090, 0x00d6, 0x2069, 0x0000, 0x6884, 0xd0b4, 0x0140, 0x2001,
-	0x0035, 0x2004, 0x780e, 0x2001, 0x0034, 0x2004, 0x780a, 0x00de,
-	0x2011, 0x0001, 0x080c, 0x4052, 0x008e, 0x00ee, 0x00fe, 0x080c,
-	0x3f7f, 0x080c, 0x3e84, 0x05b8, 0x2001, 0x020b, 0x2004, 0x9084,
-	0x0140, 0x1db8, 0x080c, 0x40c6, 0x00f6, 0x2079, 0x0300, 0x78bc,
-	0x00fe, 0x908c, 0x0070, 0x1560, 0x2071, 0x0200, 0x7037, 0x0000,
-	0x7050, 0x9084, 0xff00, 0x9086, 0x3200, 0x1510, 0x7037, 0x0001,
-	0x7050, 0x9084, 0xff00, 0x9086, 0xe100, 0x11d0, 0x7037, 0x0000,
-	0x7054, 0x7037, 0x0000, 0x715c, 0x9106, 0x1190, 0x2001, 0x1820,
-	0x2004, 0x9106, 0x1168, 0x00c6, 0x2061, 0x0100, 0x6024, 0x9084,
-	0x1e00, 0x00ce, 0x0138, 0x080c, 0x3e8e, 0x080c, 0x3c79, 0x0058,
-	0x080c, 0x3c79, 0x080c, 0x3fea, 0x080c, 0x3f75, 0x2001, 0x020b,
-	0x2004, 0xd0e4, 0x0dd8, 0x2001, 0x032a, 0x2003, 0x0004, 0x2061,
-	0x0100, 0x6027, 0x0002, 0x001e, 0x6106, 0x2011, 0x020d, 0x2013,
-	0x0020, 0x60bb, 0x0000, 0x60bf, 0x0108, 0x60bf, 0x0012, 0x2001,
-	0x0004, 0x200c, 0x918c, 0xfffd, 0x2102, 0x080c, 0x12ed, 0x2009,
-	0x0028, 0x080c, 0x23d2, 0x2001, 0x0227, 0x200c, 0x2102, 0x00fe,
-	0x00ee, 0x00de, 0x00ce, 0x00be, 0x00ae, 0x009e, 0x008e, 0x004e,
-	0x2001, 0x199f, 0x2004, 0x9005, 0x1118, 0x012e, 0x0804, 0x3524,
-	0x012e, 0x2021, 0x400c, 0x0804, 0x3526, 0x0016, 0x0026, 0x0036,
-	0x0046, 0x0056, 0x0076, 0x0086, 0x0096, 0x00d6, 0x0156, 0x7014,
-	0x2048, 0x7020, 0x20a8, 0x8000, 0x7022, 0xa804, 0x9005, 0x0904,
-	0x3be9, 0x2048, 0x1f04, 0x3b9d, 0x7068, 0x2040, 0xa28c, 0xa390,
-	0xa494, 0xa598, 0xa930, 0xa808, 0xd0b4, 0x1120, 0x2029, 0x0000,
-	0x2021, 0x0000, 0x0096, 0x7014, 0x2048, 0xa864, 0x009e, 0x9086,
-	0x0103, 0x0170, 0x8906, 0x8006, 0x8007, 0x90bc, 0x003f, 0x9084,
-	0xffc0, 0x9080, 0x001b, 0x080c, 0x4aed, 0x701f, 0x3b8d, 0x00b0,
-	0x8906, 0x8006, 0x8007, 0x90bc, 0x003f, 0x9084, 0xffc0, 0x9080,
-	0x001b, 0x21a8, 0x27e0, 0x2098, 0x27e8, 0x20a0, 0x0006, 0x080c,
-	0x0f7c, 0x000e, 0x080c, 0x4af0, 0x701f, 0x3b8d, 0x015e, 0x00de,
-	0x009e, 0x008e, 0x007e, 0x005e, 0x004e, 0x003e, 0x002e, 0x001e,
-	0x0005, 0x7014, 0x2048, 0xa864, 0x9086, 0x0103, 0x1118, 0x701f,
-	0x3c4e, 0x0450, 0x7014, 0x2048, 0xa868, 0xc0fd, 0xa86a, 0x2009,
-	0x007f, 0x080c, 0x659e, 0x0110, 0x9006, 0x0030, 0xb813, 0x00ff,
-	0xb817, 0xfffd, 0x080c, 0xcff9, 0x015e, 0x00de, 0x009e, 0x008e,
-	0x007e, 0x005e, 0x004e, 0x003e, 0x002e, 0x001e, 0x0904, 0x3556,
-	0x0016, 0x0026, 0x0036, 0x0046, 0x0056, 0x0076, 0x0086, 0x0096,
-	0x00d6, 0x0156, 0x701f, 0x3c20, 0x7007, 0x0003, 0x0804, 0x3bde,
-	0xa830, 0x9086, 0x0100, 0x2021, 0x400c, 0x0904, 0x3526, 0x0076,
-	0xad10, 0xac0c, 0xab24, 0xaa20, 0xa930, 0xa808, 0xd0b4, 0x1120,
-	0x2029, 0x0000, 0x2021, 0x0000, 0x8906, 0x8006, 0x8007, 0x90bc,
-	0x003f, 0x9084, 0xffc0, 0x9080, 0x001b, 0x21a8, 0x27e0, 0x2098,
-	0x27e8, 0x20a0, 0x0006, 0x080c, 0x0f7c, 0x000e, 0x080c, 0x4af0,
-	0x007e, 0x701f, 0x3b8d, 0x7023, 0x0001, 0x0005, 0x0804, 0x3524,
-	0x0156, 0x00c6, 0xa814, 0x908a, 0x001e, 0x0218, 0xa833, 0x001e,
-	0x0010, 0xa832, 0x0078, 0x81ff, 0x0168, 0x0016, 0x080c, 0x4aa4,
-	0x001e, 0x0130, 0xa800, 0x2040, 0xa008, 0xa80a, 0x2100, 0x0c58,
-	0x9006, 0x0010, 0x9085, 0x0001, 0x00ce, 0x015e, 0x0005, 0x0006,
-	0x00f6, 0x2079, 0x0000, 0x7880, 0x9086, 0x0044, 0x00fe, 0x000e,
-	0x0005, 0x2001, 0x199f, 0x2003, 0x0001, 0x0005, 0x00f6, 0x00e6,
-	0x00c6, 0x2061, 0x0200, 0x2001, 0x19aa, 0x2004, 0x601a, 0x2061,
-	0x0100, 0x2001, 0x19a9, 0x2004, 0x60ce, 0x6104, 0xc1ac, 0x6106,
-	0x080c, 0x4aa4, 0xa813, 0x0019, 0xa817, 0x0001, 0x2900, 0xa85a,
-	0x2001, 0x002e, 0x2004, 0xa866, 0x2001, 0x002f, 0x2004, 0xa86a,
-	0x2061, 0x0090, 0x2079, 0x0100, 0x2001, 0x19a9, 0x2004, 0x6036,
-	0x2009, 0x0040, 0x080c, 0x23d2, 0x2001, 0x002a, 0x2004, 0x9084,
-	0xfff8, 0xa86e, 0x601a, 0xa873, 0x0000, 0x601f, 0x0000, 0x78ca,
-	0x9006, 0x600a, 0x600e, 0x00ce, 0x00ee, 0x00fe, 0x0005, 0x00e6,
-	0x080c, 0x4aa4, 0x2940, 0xa013, 0x0019, 0xa017, 0x0001, 0x2800,
-	0xa05a, 0x2001, 0x0030, 0x2004, 0xa866, 0x2001, 0x0031, 0x2004,
-	0xa86a, 0x2001, 0x002a, 0x2004, 0x9084, 0xfff8, 0xa86e, 0xa873,
-	0x0000, 0x2001, 0x032a, 0x2003, 0x0004, 0x2001, 0x0300, 0x2003,
-	0x0000, 0x2001, 0x020d, 0x2003, 0x0000, 0x2001, 0x0004, 0x200c,
-	0x918d, 0x0002, 0x2102, 0x00ee, 0x0005, 0x0126, 0x2091, 0x8000,
-	0x81ff, 0x0148, 0x080c, 0x2c30, 0x1130, 0x9006, 0x080c, 0x2b88,
-	0x9006, 0x080c, 0x2b6b, 0x7884, 0x9084, 0x0007, 0x0002, 0x3d0a,
-	0x3d13, 0x3d1c, 0x3d07, 0x3d07, 0x3d07, 0x3d07, 0x3d07, 0x012e,
-	0x0804, 0x3559, 0x2009, 0x0114, 0x2104, 0x9085, 0x0800, 0x200a,
-	0x080c, 0x3ed8, 0x00c0, 0x2009, 0x0114, 0x2104, 0x9085, 0x4000,
-	0x200a, 0x080c, 0x3ed8, 0x0078, 0x080c, 0x73bc, 0x1128, 0x012e,
-	0x2009, 0x0016, 0x0804, 0x3556, 0x81ff, 0x0128, 0x012e, 0x2021,
-	0x400b, 0x0804, 0x3526, 0x0086, 0x0096, 0x00a6, 0x00b6, 0x00c6,
-	0x00d6, 0x00e6, 0x00f6, 0x080c, 0x3a39, 0x2009, 0x0101, 0x210c,
-	0x0016, 0x7ec8, 0x7dcc, 0x9006, 0x2068, 0x2060, 0x2058, 0x080c,
-	0x41a1, 0x080c, 0x40f1, 0x903e, 0x2720, 0x00f6, 0x00e6, 0x0086,
-	0x2940, 0x2071, 0x1a66, 0x2079, 0x0090, 0x00d6, 0x2069, 0x0000,
-	0x6884, 0xd0b4, 0x0120, 0x68d4, 0x780e, 0x68d0, 0x780a, 0x00de,
-	0x2011, 0x0001, 0x080c, 0x4052, 0x080c, 0x2c38, 0x080c, 0x2c38,
-	0x080c, 0x2c38, 0x080c, 0x2c38, 0x080c, 0x4052, 0x008e, 0x00ee,
-	0x00fe, 0x080c, 0x3f7f, 0x2009, 0x9c40, 0x8109, 0x11b0, 0x080c,
-	0x3e8e, 0x2001, 0x0004, 0x200c, 0x918c, 0xfffd, 0x2102, 0x001e,
-	0x00fe, 0x00ee, 0x00de, 0x00ce, 0x00be, 0x00ae, 0x009e, 0x008e,
-	0x2009, 0x0017, 0x080c, 0x3556, 0x0cf8, 0x2001, 0x020b, 0x2004,
-	0x9084, 0x0140, 0x1d10, 0x00f6, 0x2079, 0x0000, 0x7884, 0x00fe,
-	0xd0bc, 0x0178, 0x2001, 0x0201, 0x200c, 0x81ff, 0x0150, 0x080c,
-	0x3f5d, 0x2d00, 0x9c05, 0x9b05, 0x0120, 0x080c, 0x3e8e, 0x0804,
-	0x3e3b, 0x080c, 0x40c6, 0x080c, 0x3fea, 0x080c, 0x3f40, 0x080c,
-	0x3f75, 0x00f6, 0x2079, 0x0100, 0x7824, 0xd0ac, 0x0130, 0x8b58,
-	0x080c, 0x3e8e, 0x00fe, 0x0804, 0x3e3b, 0x00fe, 0x080c, 0x3e84,
-	0x1150, 0x8d68, 0x2001, 0x0032, 0x2602, 0x2001, 0x0033, 0x2502,
-	0x080c, 0x3e8e, 0x0080, 0x87ff, 0x0138, 0x2001, 0x0201, 0x2004,
-	0x9005, 0x1908, 0x8739, 0x0038, 0x2001, 0x1a62, 0x2004, 0x9086,
-	0x0000, 0x1904, 0x3d8b, 0x2001, 0x032f, 0x2003, 0x00f6, 0x8631,
-	0x1208, 0x8529, 0x2500, 0x9605, 0x0904, 0x3e3b, 0x7884, 0xd0bc,
-	0x0128, 0x2d00, 0x9c05, 0x9b05, 0x1904, 0x3e3b, 0xa013, 0x0019,
-	0x2001, 0x032a, 0x2003, 0x0004, 0x7884, 0xd0ac, 0x1148, 0x2001,
-	0x1a62, 0x2003, 0x0003, 0x2001, 0x032a, 0x2003, 0x0009, 0x0030,
-	0xa017, 0x0001, 0x78b4, 0x9005, 0x0108, 0xa016, 0x2800, 0xa05a,
-	0x2009, 0x0040, 0x080c, 0x23d2, 0x2900, 0xa85a, 0xa813, 0x0019,
-	0x7884, 0xd0a4, 0x1180, 0xa817, 0x0000, 0x00c6, 0x20a9, 0x0004,
-	0x2061, 0x0090, 0x602b, 0x0008, 0x2001, 0x0203, 0x2004, 0x1f04,
-	0x3e12, 0x00ce, 0x0030, 0xa817, 0x0001, 0x78b0, 0x9005, 0x0108,
-	0xa816, 0x00f6, 0x00c6, 0x2079, 0x0100, 0x2061, 0x0090, 0x7827,
-	0x0002, 0x2001, 0x002a, 0x2004, 0x9084, 0xfff8, 0x601a, 0x0006,
-	0x2001, 0x002b, 0x2004, 0x601e, 0x78c6, 0x000e, 0x78ca, 0x00ce,
-	0x00fe, 0x0804, 0x3d45, 0x001e, 0x00c6, 0x2001, 0x032a, 0x2003,
-	0x0004, 0x2061, 0x0100, 0x6027, 0x0002, 0x6106, 0x2011, 0x020d,
-	0x2013, 0x0020, 0x2001, 0x0004, 0x200c, 0x918c, 0xfffd, 0x2102,
-	0x080c, 0x12ed, 0x7884, 0x9084, 0x0003, 0x9086, 0x0002, 0x01a0,
-	0x2009, 0x0028, 0x080c, 0x23d2, 0x2001, 0x0227, 0x200c, 0x2102,
-	0x6050, 0x9084, 0xb7ef, 0x6052, 0x602f, 0x0000, 0x604b, 0xf7f7,
-	0x6043, 0x0090, 0x6043, 0x0010, 0x00ce, 0x2d08, 0x2c10, 0x2b18,
-	0x2b00, 0x9c05, 0x9d05, 0x00fe, 0x00ee, 0x00de, 0x00ce, 0x00be,
-	0x00ae, 0x009e, 0x008e, 0x1118, 0x012e, 0x0804, 0x3524, 0x012e,
-	0x2021, 0x400c, 0x0804, 0x3526, 0x9085, 0x0001, 0x1d04, 0x3e8d,
-	0x2091, 0x6000, 0x8420, 0x9486, 0x0064, 0x0005, 0x2001, 0x0105,
-	0x2003, 0x0010, 0x2001, 0x032a, 0x2003, 0x0004, 0x2001, 0x1a62,
-	0x2003, 0x0000, 0x0071, 0x2009, 0x0048, 0x080c, 0x23d2, 0x2001,
-	0x0227, 0x2024, 0x2402, 0x2001, 0x0109, 0x2003, 0x4000, 0x9026,
-	0x0005, 0x00f6, 0x00e6, 0x2071, 0x1a66, 0x7000, 0x9086, 0x0000,
-	0x0520, 0x2079, 0x0090, 0x2009, 0x0206, 0x2104, 0x2009, 0x0203,
-	0x210c, 0x9106, 0x1120, 0x2009, 0x0040, 0x080c, 0x23d2, 0x782c,
-	0xd0fc, 0x0d88, 0x080c, 0x40c6, 0x7000, 0x9086, 0x0000, 0x1d58,
-	0x782b, 0x0004, 0x782c, 0xd0ac, 0x1de8, 0x2009, 0x0040, 0x080c,
-	0x23d2, 0x782b, 0x0002, 0x7003, 0x0000, 0x00ee, 0x00fe, 0x0005,
-	0x00f6, 0x2079, 0x0100, 0x2001, 0x1818, 0x200c, 0x7932, 0x7936,
-	0x080c, 0x2887, 0x7850, 0x9084, 0xfbff, 0x9085, 0x0030, 0x7852,
-	0x2019, 0x01f4, 0x8319, 0x1df0, 0x9084, 0xffcf, 0x9085, 0x2000,
-	0x7852, 0x20a9, 0x0046, 0x1d04, 0x3ef3, 0x2091, 0x6000, 0x1f04,
-	0x3ef3, 0x7850, 0x9085, 0x0400, 0x9084, 0xdfff, 0x7852, 0x2001,
-	0x0021, 0x2004, 0x9084, 0x0003, 0x9086, 0x0001, 0x1120, 0x7850,
-	0x9084, 0xdfff, 0x7852, 0x784b, 0xf7f7, 0x7843, 0x0090, 0x7843,
-	0x0010, 0x20a9, 0x0028, 0xa001, 0x1f04, 0x3f13, 0x7850, 0x9085,
-	0x1400, 0x7852, 0x2019, 0x61a8, 0x7854, 0xa001, 0xa001, 0xd08c,
-	0x1110, 0x8319, 0x1dc8, 0x7827, 0x0048, 0x7850, 0x9085, 0x0400,
-	0x7852, 0x7843, 0x0040, 0x2019, 0x01f4, 0xa001, 0xa001, 0x8319,
-	0x1de0, 0x2001, 0x0100, 0x080c, 0x2cef, 0x7827, 0x0020, 0x7843,
-	0x0000, 0x9006, 0x080c, 0x2cef, 0x7827, 0x0048, 0x00fe, 0x0005,
-	0x7884, 0xd0ac, 0x11c8, 0x00f6, 0x00e6, 0x2071, 0x1a62, 0x2079,
-	0x0320, 0x2001, 0x0201, 0x2004, 0x9005, 0x0160, 0x7000, 0x9086,
-	0x0000, 0x1140, 0x0051, 0xd0bc, 0x0108, 0x8738, 0x7003, 0x0003,
-	0x782b, 0x0019, 0x00ee, 0x00fe, 0x0005, 0x00f6, 0x2079, 0x0300,
-	0x78bc, 0x00fe, 0x908c, 0x0070, 0x0178, 0x2009, 0x0032, 0x260a,
-	0x2009, 0x0033, 0x250a, 0xd0b4, 0x0108, 0x8c60, 0xd0ac, 0x0108,
-	0x8d68, 0xd0a4, 0x0108, 0x8b58, 0x0005, 0x00f6, 0x2079, 0x0200,
-	0x781c, 0xd084, 0x0110, 0x7837, 0x0050, 0x00fe, 0x0005, 0x00e6,
-	0x2071, 0x0100, 0x2001, 0x19aa, 0x2004, 0x70e2, 0x080c, 0x3c6f,
-	0x1188, 0x2001, 0x1820, 0x2004, 0x2009, 0x181f, 0x210c, 0x918c,
-	0x00ff, 0x706e, 0x716a, 0x7066, 0x918d, 0x3200, 0x7162, 0x7073,
-	0xe109, 0x0080, 0x702c, 0x9085, 0x0002, 0x702e, 0x2009, 0x1818,
-	0x210c, 0x716e, 0x7063, 0x0100, 0x7166, 0x719e, 0x706b, 0x0000,
-	0x7073, 0x0809, 0x7077, 0x0008, 0x7078, 0x9080, 0x0100, 0x707a,
-	0x7080, 0x8000, 0x7082, 0x7087, 0xaaaa, 0x9006, 0x708a, 0x708e,
-	0x707e, 0x70d6, 0x70ab, 0x0036, 0x70af, 0x95d5, 0x7014, 0x9084,
-	0x1984, 0x9085, 0x0092, 0x7016, 0x080c, 0x40c6, 0x00f6, 0x2071,
-	0x1a62, 0x2079, 0x0320, 0x00d6, 0x2069, 0x0000, 0x6884, 0xd0b4,
-	0x0120, 0x689c, 0x780e, 0x6898, 0x780a, 0x00de, 0x2009, 0x03e8,
-	0x8109, 0x1df0, 0x792c, 0xd1fc, 0x0110, 0x782b, 0x0004, 0x2011,
-	0x0011, 0x080c, 0x4052, 0x2011, 0x0001, 0x080c, 0x4052, 0x00fe,
-	0x00ee, 0x0005, 0x00f6, 0x00e6, 0x2071, 0x1a62, 0x2079, 0x0320,
-	0x792c, 0xd1fc, 0x0904, 0x404f, 0x782b, 0x0002, 0x9026, 0xd19c,
-	0x1904, 0x404b, 0x7000, 0x0002, 0x404f, 0x4000, 0x4030, 0x404b,
-	0xd1bc, 0x1170, 0xd1dc, 0x1190, 0x8001, 0x7002, 0x2011, 0x0001,
-	0x080c, 0x4052, 0x0904, 0x404f, 0x080c, 0x4052, 0x0804, 0x404f,
-	0x00f6, 0x2079, 0x0300, 0x78bf, 0x0000, 0x00fe, 0x7810, 0x7914,
-	0x782b, 0x0004, 0x7812, 0x7916, 0x2001, 0x0201, 0x200c, 0x81ff,
-	0x0de8, 0x080c, 0x3f5d, 0x2009, 0x0001, 0x00f6, 0x2079, 0x0300,
-	0x78b8, 0x00fe, 0xd0ec, 0x0110, 0x2009, 0x0011, 0x792a, 0x00f8,
-	0x8001, 0x7002, 0x9184, 0x0880, 0x1140, 0x782c, 0xd0fc, 0x1904,
-	0x3ff4, 0x2011, 0x0001, 0x00b1, 0x0090, 0xa010, 0x9092, 0x0004,
-	0x9086, 0x0015, 0x1120, 0xa000, 0xa05a, 0x2011, 0x0031, 0xa212,
-	0xd1dc, 0x1960, 0x0828, 0x782b, 0x0004, 0x7003, 0x0000, 0x00ee,
-	0x00fe, 0x0005, 0xa014, 0x9005, 0x0550, 0x8001, 0x0036, 0x0096,
-	0xa016, 0xa058, 0x2048, 0xa010, 0x2009, 0x0031, 0x911a, 0x831c,
-	0x831c, 0x938a, 0x0007, 0x1a0c, 0x0dd5, 0x9398, 0x4080, 0x231d,
-	0x083f, 0x9080, 0x0004, 0x7a2a, 0x7100, 0x8108, 0x7102, 0x009e,
-	0x003e, 0x908a, 0x0035, 0x1140, 0x0096, 0xa058, 0x2048, 0xa804,
-	0xa05a, 0x2001, 0x0019, 0x009e, 0xa012, 0x9085, 0x0001, 0x0005,
-	0x40bd, 0x40b4, 0x40ab, 0x40a2, 0x4099, 0x4090, 0x4087, 0xa964,
-	0x7902, 0xa968, 0x7906, 0xa96c, 0x7912, 0xa970, 0x7916, 0x0005,
-	0xa974, 0x7902, 0xa978, 0x7906, 0xa97c, 0x7912, 0xa980, 0x7916,
-	0x0005, 0xa984, 0x7902, 0xa988, 0x7906, 0xa98c, 0x7912, 0xa990,
-	0x7916, 0x0005, 0xa994, 0x7902, 0xa998, 0x7906, 0xa99c, 0x7912,
-	0xa9a0, 0x7916, 0x0005, 0xa9a4, 0x7902, 0xa9a8, 0x7906, 0xa9ac,
-	0x7912, 0xa9b0, 0x7916, 0x0005, 0xa9b4, 0x7902, 0xa9b8, 0x7906,
-	0xa9bc, 0x7912, 0xa9c0, 0x7916, 0x0005, 0xa9c4, 0x7902, 0xa9c8,
-	0x7906, 0xa9cc, 0x7912, 0xa9d0, 0x7916, 0x0005, 0x00f6, 0x00e6,
-	0x0086, 0x2071, 0x1a66, 0x2079, 0x0090, 0x792c, 0xd1fc, 0x01e8,
-	0x782b, 0x0002, 0x2940, 0x9026, 0x7000, 0x0002, 0x40ed, 0x40d9,
-	0x40e4, 0x8001, 0x7002, 0xd19c, 0x1180, 0x2011, 0x0001, 0x080c,
-	0x4052, 0x190c, 0x4052, 0x0048, 0x8001, 0x7002, 0x782c, 0xd0fc,
-	0x1d38, 0x2011, 0x0001, 0x080c, 0x4052, 0x008e, 0x00ee, 0x00fe,
-	0x0005, 0x00f6, 0x00e6, 0x00c6, 0x0086, 0x2061, 0x0200, 0x2001,
-	0x19aa, 0x2004, 0x601a, 0x2061, 0x0100, 0x2001, 0x19a9, 0x2004,
-	0x60ce, 0x6104, 0xc1ac, 0x6106, 0x2001, 0x002c, 0x2004, 0x9005,
-	0x0520, 0x2038, 0x2001, 0x002e, 0x2024, 0x2001, 0x002f, 0x201c,
-	0x080c, 0x4aa4, 0xa813, 0x0019, 0xaf16, 0x2900, 0xa85a, 0x978a,
-	0x0007, 0x0220, 0x2138, 0x2009, 0x0007, 0x0010, 0x2708, 0x903e,
-	0x0096, 0xa858, 0x2048, 0xa85c, 0x9080, 0x0019, 0x009e, 0x080c,
-	0x4169, 0x1d68, 0x2900, 0xa85a, 0x00d0, 0x080c, 0x4aa4, 0xa813,
+	0x9080, 0x001b, 0x21a8, 0x27e0, 0x2098, 0x27e8, 0x20a0, 0x0006,
+	0x080c, 0x0f7c, 0x000e, 0x080c, 0x4b00, 0x007e, 0x701f, 0x3b9a,
+	0x7023, 0x0001, 0x0005, 0x0804, 0x3526, 0x0156, 0x00c6, 0xa814,
+	0x908a, 0x001e, 0x0218, 0xa833, 0x001e, 0x0010, 0xa832, 0x0078,
+	0x81ff, 0x0168, 0x0016, 0x080c, 0x4ab4, 0x001e, 0x0130, 0xa800,
+	0x2040, 0xa008, 0xa80a, 0x2100, 0x0c58, 0x9006, 0x0010, 0x9085,
+	0x0001, 0x00ce, 0x015e, 0x0005, 0x0006, 0x00f6, 0x2079, 0x0000,
+	0x7880, 0x9086, 0x0044, 0x00fe, 0x000e, 0x0005, 0x2001, 0x199e,
+	0x2003, 0x0001, 0x0005, 0x00f6, 0x00e6, 0x00c6, 0x2061, 0x0200,
+	0x2001, 0x19a9, 0x2004, 0x601a, 0x2061, 0x0100, 0x2001, 0x19a8,
+	0x2004, 0x60ce, 0x6104, 0xc1ac, 0x6106, 0x080c, 0x4ab4, 0xa813,
 	0x0019, 0xa817, 0x0001, 0x2900, 0xa85a, 0x2001, 0x002e, 0x2004,
-	0xa866, 0x2001, 0x002f, 0x2004, 0xa86a, 0x2001, 0x002a, 0x2004,
-	0x9084, 0xfff8, 0xa86e, 0x2001, 0x002b, 0x2004, 0xa872, 0x2061,
-	0x0090, 0x2079, 0x0100, 0x2001, 0x19a9, 0x2004, 0x6036, 0x2009,
-	0x0040, 0x080c, 0x23d2, 0x2001, 0x002a, 0x2004, 0x9084, 0xfff8,
-	0x601a, 0x0006, 0x2001, 0x002b, 0x2004, 0x601e, 0x78c6, 0x000e,
-	0x78ca, 0x9006, 0x600a, 0x600e, 0x008e, 0x00ce, 0x00ee, 0x00fe,
-	0x0005, 0x00e6, 0x2071, 0x0080, 0xaa60, 0x22e8, 0x20a0, 0x20e1,
-	0x0000, 0x2099, 0x0088, 0x702b, 0x0026, 0x7402, 0x7306, 0x9006,
-	0x700a, 0x700e, 0x810b, 0x810b, 0x21a8, 0x810b, 0x7112, 0x702b,
-	0x0041, 0x702c, 0xd0fc, 0x0de8, 0x702b, 0x0002, 0x702b, 0x0040,
-	0x4005, 0x7400, 0x7304, 0x87ff, 0x0190, 0x0086, 0x0096, 0x2940,
-	0x0086, 0x080c, 0x4aa4, 0x008e, 0xa058, 0x00a6, 0x2050, 0x2900,
-	0xb006, 0xa05a, 0x00ae, 0x009e, 0x008e, 0x9085, 0x0001, 0x00ee,
-	0x0005, 0x00e6, 0x2001, 0x002d, 0x2004, 0x9005, 0x0528, 0x2038,
-	0x2001, 0x0030, 0x2024, 0x2001, 0x0031, 0x201c, 0x080c, 0x4aa4,
-	0x2940, 0xa813, 0x0019, 0xaf16, 0x2900, 0xa85a, 0x978a, 0x0007,
-	0x0220, 0x2138, 0x2009, 0x0007, 0x0010, 0x2708, 0x903e, 0x0096,
-	0xa858, 0x2048, 0xa85c, 0x9080, 0x0019, 0x009e, 0x080c, 0x4169,
-	0x1d68, 0x2900, 0xa85a, 0x00d8, 0x080c, 0x4aa4, 0x2940, 0xa013,
-	0x0019, 0xa017, 0x0001, 0x2800, 0xa05a, 0x2001, 0x0030, 0x2004,
-	0xa066, 0x2001, 0x0031, 0x2004, 0xa06a, 0x2001, 0x002a, 0x2004,
-	0x9084, 0xfff8, 0xa06e, 0x2001, 0x002b, 0x2004, 0xa072, 0x2001,
-	0x032a, 0x2003, 0x0004, 0x7884, 0xd0ac, 0x1180, 0x2001, 0x0101,
-	0x200c, 0x918d, 0x0200, 0x2102, 0xa017, 0x0000, 0x2001, 0x1a62,
-	0x2003, 0x0003, 0x2001, 0x032a, 0x2003, 0x0009, 0x2001, 0x0300,
-	0x2003, 0x0000, 0x2001, 0x020d, 0x2003, 0x0000, 0x2001, 0x0004,
-	0x200c, 0x918d, 0x0002, 0x2102, 0x00ee, 0x0005, 0x0126, 0x2091,
-	0x8000, 0x20a9, 0x0007, 0x20a1, 0x1840, 0x20e9, 0x0001, 0x9006,
-	0x4004, 0x20a9, 0x000c, 0x20a1, 0xfff4, 0x20e9, 0x0000, 0x9006,
-	0x4004, 0x2009, 0x013c, 0x200a, 0x012e, 0x7880, 0x9086, 0x0052,
-	0x0108, 0x0005, 0x0804, 0x3524, 0x7d98, 0x7c9c, 0x0804, 0x361b,
-	0x080c, 0x73bc, 0x190c, 0x5fdf, 0x6040, 0x9084, 0x0020, 0x09b1,
-	0x2069, 0x1847, 0x2d00, 0x2009, 0x0030, 0x7a8c, 0x7b88, 0x7c9c,
-	0x7d98, 0x2039, 0x0001, 0x080c, 0x4aed, 0x701f, 0x4248, 0x0005,
-	0x080c, 0x56de, 0x1130, 0x3b00, 0x3a08, 0xc194, 0xc095, 0x20d8,
-	0x21d0, 0x2069, 0x1847, 0x6800, 0x9005, 0x0904, 0x3559, 0x6804,
-	0xd0ac, 0x0118, 0xd0a4, 0x0904, 0x3559, 0xd094, 0x00c6, 0x2061,
-	0x0100, 0x6104, 0x0138, 0x6200, 0x9292, 0x0005, 0x0218, 0x918c,
-	0xffdf, 0x0010, 0x918d, 0x0020, 0x6106, 0x00ce, 0xd08c, 0x00c6,
-	0x2061, 0x0100, 0x6104, 0x0118, 0x918d, 0x0010, 0x0010, 0x918c,
-	0xffef, 0x6106, 0x00ce, 0xd084, 0x0158, 0x6a28, 0x928a, 0x007f,
-	0x1a04, 0x3559, 0x9288, 0x3325, 0x210d, 0x918c, 0x00ff, 0x6166,
-	0xd0dc, 0x0130, 0x6828, 0x908a, 0x007f, 0x1a04, 0x3559, 0x605e,
-	0x6888, 0x9084, 0x0030, 0x8004, 0x8004, 0x8004, 0x8004, 0x0006,
-	0x2009, 0x19b1, 0x9080, 0x297a, 0x2005, 0x200a, 0x000e, 0x2009,
-	0x19b2, 0x9080, 0x297e, 0x2005, 0x200a, 0x6808, 0x908a, 0x0100,
-	0x0a04, 0x3559, 0x908a, 0x0841, 0x1a04, 0x3559, 0x9084, 0x0007,
-	0x1904, 0x3559, 0x680c, 0x9005, 0x0904, 0x3559, 0x6810, 0x9005,
-	0x0904, 0x3559, 0x6848, 0x6940, 0x910a, 0x1a04, 0x3559, 0x8001,
-	0x0904, 0x3559, 0x684c, 0x6944, 0x910a, 0x1a04, 0x3559, 0x8001,
-	0x0904, 0x3559, 0x2009, 0x1981, 0x200b, 0x0000, 0x2001, 0x1869,
-	0x2004, 0xd0c4, 0x0140, 0x7884, 0x200a, 0x2009, 0x017f, 0x200a,
-	0x3b00, 0xc085, 0x20d8, 0x6814, 0x908c, 0x00ff, 0x614e, 0x8007,
-	0x9084, 0x00ff, 0x6052, 0x080c, 0x76d5, 0x080c, 0x69a8, 0x080c,
-	0x69dc, 0x6808, 0x602a, 0x080c, 0x2344, 0x2009, 0x0170, 0x200b,
-	0x0080, 0xa001, 0xa001, 0x200b, 0x0000, 0x0036, 0x6b08, 0x080c,
-	0x28e1, 0x003e, 0x6000, 0x9086, 0x0000, 0x1904, 0x43df, 0x6818,
-	0x691c, 0x6a20, 0x6b24, 0x8007, 0x810f, 0x8217, 0x831f, 0x6016,
-	0x611a, 0x621e, 0x6322, 0x6c04, 0xd4f4, 0x0148, 0x6830, 0x6934,
-	0x6a38, 0x6b3c, 0x8007, 0x810f, 0x8217, 0x831f, 0x0010, 0x9084,
-	0xf0ff, 0x6006, 0x610a, 0x620e, 0x6312, 0x8007, 0x810f, 0x8217,
-	0x831f, 0x20a9, 0x0004, 0x20a1, 0x19b3, 0x20e9, 0x0001, 0x4001,
-	0x20a9, 0x0004, 0x20a1, 0x19cd, 0x20e9, 0x0001, 0x4001, 0x080c,
-	0x85ef, 0x00c6, 0x900e, 0x20a9, 0x0001, 0x6b70, 0xd384, 0x0510,
-	0x0068, 0x2009, 0x0100, 0x210c, 0x918e, 0x0008, 0x1110, 0x839d,
-	0x0010, 0x83f5, 0x3e18, 0x12b0, 0x3508, 0x8109, 0x080c, 0x7c8b,
-	0x6878, 0x6016, 0x6874, 0x2008, 0x9084, 0xff00, 0x8007, 0x600a,
-	0x9184, 0x00ff, 0x6006, 0x8108, 0x1118, 0x6003, 0x0003, 0x0010,
-	0x6003, 0x0001, 0x1f04, 0x4339, 0x00ce, 0x00c6, 0x2061, 0x199c,
-	0x6a88, 0x9284, 0xc000, 0x2010, 0x9286, 0x0000, 0x1158, 0x2063,
-	0x0000, 0x2001, 0x0001, 0x080c, 0x2b88, 0x2001, 0x0001, 0x080c,
-	0x2b6b, 0x0088, 0x9286, 0x4000, 0x1148, 0x2063, 0x0001, 0x9006,
-	0x080c, 0x2b88, 0x9006, 0x080c, 0x2b6b, 0x0028, 0x9286, 0x8000,
-	0x1d30, 0x2063, 0x0002, 0x00ce, 0x6888, 0xd0ec, 0x0130, 0x2011,
-	0x0114, 0x2204, 0x9085, 0x0100, 0x2012, 0x6a80, 0x9284, 0x0030,
-	0x9086, 0x0030, 0x1128, 0x9294, 0xffcf, 0x9295, 0x0020, 0x6a82,
-	0x2001, 0x197c, 0x6a80, 0x9294, 0x0030, 0x928e, 0x0000, 0x0170,
-	0x928e, 0x0010, 0x0118, 0x928e, 0x0020, 0x0140, 0x2003, 0xaaaa,
-	0x080c, 0x2956, 0x2001, 0x196d, 0x2102, 0x0008, 0x2102, 0x00c6,
-	0x2061, 0x0100, 0x602f, 0x0040, 0x602f, 0x0000, 0x00ce, 0x080c,
-	0x73bc, 0x0128, 0x080c, 0x4fdb, 0x0110, 0x080c, 0x28a7, 0x60d4,
-	0x9005, 0x01c0, 0x6003, 0x0001, 0x2009, 0x43c7, 0x00e0, 0x080c,
-	0x73bc, 0x1168, 0x2011, 0x7252, 0x080c, 0x84f3, 0x2011, 0x7245,
-	0x080c, 0x85cd, 0x080c, 0x76a9, 0x080c, 0x72ee, 0x0040, 0x080c,
-	0x5ed9, 0x0028, 0x6003, 0x0004, 0x2009, 0x43df, 0x0020, 0x080c,
-	0x68d4, 0x0804, 0x3524, 0x2001, 0x0170, 0x2004, 0x9084, 0x00ff,
-	0x9086, 0x004c, 0x1118, 0x2091, 0x30bd, 0x0817, 0x2091, 0x303d,
-	0x0817, 0x6000, 0x9086, 0x0000, 0x0904, 0x3556, 0x2069, 0x1847,
-	0x7890, 0x6842, 0x7894, 0x6846, 0x2d00, 0x2009, 0x0030, 0x7a8c,
-	0x7b88, 0x7c9c, 0x7d98, 0x2039, 0x0001, 0x0804, 0x4af0, 0x9006,
-	0x080c, 0x28a7, 0x81ff, 0x1904, 0x3556, 0x080c, 0x73bc, 0x11b0,
-	0x080c, 0x76a4, 0x080c, 0x601a, 0x080c, 0x3319, 0x0118, 0x6130,
-	0xc18d, 0x6132, 0x080c, 0xd230, 0x0130, 0x080c, 0x73df, 0x1118,
-	0x080c, 0x7394, 0x0038, 0x080c, 0x72ee, 0x0020, 0x080c, 0x5fdf,
-	0x080c, 0x5ed9, 0x0804, 0x3524, 0x81ff, 0x1904, 0x3556, 0x080c,
-	0x73bc, 0x1110, 0x0804, 0x3556, 0x6194, 0x81ff, 0x01a8, 0x704f,
-	0x0000, 0x2001, 0x1c80, 0x2009, 0x0040, 0x7a8c, 0x7b88, 0x7c9c,
-	0x7d98, 0x0126, 0x2091, 0x8000, 0x2039, 0x0001, 0x080c, 0x4af0,
-	0x701f, 0x3522, 0x012e, 0x0005, 0x704f, 0x0001, 0x00d6, 0x2069,
-	0x1c80, 0x20a9, 0x0040, 0x20e9, 0x0001, 0x20a1, 0x1c80, 0x2019,
-	0xffff, 0x4304, 0x655c, 0x9588, 0x3325, 0x210d, 0x918c, 0x00ff,
-	0x216a, 0x900e, 0x2011, 0x0002, 0x2100, 0x9506, 0x01a8, 0x080c,
-	0x65ff, 0x1190, 0xb814, 0x821c, 0x0238, 0x9398, 0x1c80, 0x9085,
-	0xff00, 0x8007, 0x201a, 0x0038, 0x9398, 0x1c80, 0x2324, 0x94a4,
-	0xff00, 0x9405, 0x201a, 0x8210, 0x8108, 0x9182, 0x0080, 0x1208,
-	0x0c18, 0x8201, 0x8007, 0x2d0c, 0x9105, 0x206a, 0x00de, 0x20a9,
-	0x0040, 0x20a1, 0x1c80, 0x2099, 0x1c80, 0x080c, 0x5f6a, 0x0804,
-	0x4439, 0x080c, 0x4ad7, 0x0904, 0x3559, 0x080c, 0x4aa4, 0x1120,
-	0x2009, 0x0002, 0x0804, 0x3556, 0x080c, 0x56cf, 0xd0b4, 0x0558,
-	0x7884, 0x908e, 0x007e, 0x0538, 0x908e, 0x007f, 0x0520, 0x908e,
-	0x0080, 0x0508, 0x080c, 0x3314, 0x1148, 0xb800, 0xd08c, 0x11d8,
-	0xb804, 0x9084, 0x00ff, 0x9086, 0x0006, 0x11a8, 0xa867, 0x0000,
-	0xa868, 0xc0fd, 0xa86a, 0x080c, 0xccfe, 0x1120, 0x2009, 0x0003,
-	0x0804, 0x3556, 0x7007, 0x0003, 0x701f, 0x44c7, 0x0005, 0x080c,
-	0x4ad7, 0x0904, 0x3559, 0x20a9, 0x002b, 0xb8c4, 0x20e0, 0xb8c8,
-	0x2098, 0xa860, 0x20e8, 0xa85c, 0x9080, 0x0002, 0x20a0, 0x4003,
-	0x20a9, 0x0008, 0x9080, 0x0006, 0x20a0, 0xb8c4, 0x20e0, 0xb8c8,
-	0x9080, 0x0006, 0x2098, 0x080c, 0x0f7c, 0x0070, 0x20a9, 0x0004,
-	0xa85c, 0x9080, 0x000a, 0x20a0, 0xb8c4, 0x20e0, 0xb8c8, 0x9080,
-	0x000a, 0x2098, 0x080c, 0x0f7c, 0x8906, 0x8006, 0x8007, 0x90bc,
-	0x003f, 0x9084, 0xffc0, 0x9080, 0x0002, 0x2009, 0x002b, 0x7a8c,
-	0x7b88, 0x7c9c, 0x7d98, 0x0804, 0x4af0, 0x81ff, 0x1904, 0x3556,
-	0x080c, 0x4abb, 0x0904, 0x3559, 0x080c, 0x6771, 0x0904, 0x3556,
-	0x0058, 0xa878, 0x9005, 0x0120, 0x2009, 0x0004, 0x0804, 0x3556,
-	0xa974, 0xaa94, 0x0804, 0x3524, 0x080c, 0x56d7, 0x0904, 0x3524,
-	0x701f, 0x4511, 0x7007, 0x0003, 0x0005, 0x81ff, 0x1904, 0x3556,
-	0x7888, 0x908a, 0x1000, 0x1a04, 0x3559, 0x080c, 0x4ad7, 0x0904,
-	0x3559, 0x080c, 0x6972, 0x0120, 0x080c, 0x697a, 0x1904, 0x3559,
-	0x080c, 0x67f6, 0x0904, 0x3556, 0x2019, 0x0004, 0x900e, 0x080c,
-	0x6783, 0x0904, 0x3556, 0x7984, 0x7a88, 0x04c9, 0x08a8, 0xa89c,
-	0x908a, 0x1000, 0x12f8, 0x080c, 0x4ad5, 0x01e0, 0x080c, 0x6972,
-	0x0118, 0x080c, 0x697a, 0x11b0, 0x080c, 0x67f6, 0x2009, 0x0002,
-	0x0168, 0x2009, 0x0002, 0x2019, 0x0004, 0x080c, 0x6783, 0x2009,
-	0x0003, 0x0120, 0xa998, 0xaa9c, 0x00d1, 0x0060, 0xa897, 0x4005,
-	0xa99a, 0x0010, 0xa897, 0x4006, 0x900e, 0x9085, 0x0001, 0x2001,
-	0x0030, 0x0005, 0xa897, 0x4000, 0x080c, 0x56d7, 0x0110, 0x9006,
-	0x0018, 0x900e, 0x9085, 0x0001, 0x2001, 0x0000, 0x0005, 0x9186,
-	0x00ff, 0x0110, 0x0071, 0x0060, 0x2029, 0x007e, 0x2061, 0x1800,
-	0x645c, 0x2400, 0x9506, 0x0110, 0x2508, 0x0019, 0x8529, 0x1ec8,
-	0x0005, 0x080c, 0x65ff, 0x1138, 0x2200, 0x8003, 0x800b, 0x810b,
-	0x9108, 0x080c, 0x8501, 0x0005, 0x81ff, 0x1904, 0x3556, 0x798c,
-	0x2001, 0x1980, 0x918c, 0x8000, 0x2102, 0x080c, 0x4abb, 0x0904,
-	0x3559, 0x080c, 0x6972, 0x0120, 0x080c, 0x697a, 0x1904, 0x3559,
-	0x080c, 0x66c6, 0x0904, 0x3556, 0x080c, 0x677a, 0x0904, 0x3556,
-	0x2001, 0x1980, 0x2004, 0xd0fc, 0x1904, 0x3524, 0x0804, 0x451c,
-	0xa9a0, 0x2001, 0x1980, 0x918c, 0x8000, 0xc18d, 0x2102, 0x080c,
-	0x4ac8, 0x01a0, 0x080c, 0x6972, 0x0118, 0x080c, 0x697a, 0x1170,
-	0x080c, 0x66c6, 0x2009, 0x0002, 0x0128, 0x080c, 0x677a, 0x1170,
-	0x2009, 0x0003, 0xa897, 0x4005, 0xa99a, 0x0010, 0xa897, 0x4006,
-	0x900e, 0x9085, 0x0001, 0x2001, 0x0030, 0x0005, 0xa897, 0x4000,
-	0x2001, 0x1980, 0x2004, 0xd0fc, 0x1128, 0x080c, 0x56d7, 0x0110,
-	0x9006, 0x0018, 0x900e, 0x9085, 0x0001, 0x2001, 0x0000, 0x0005,
-	0x81ff, 0x1904, 0x3556, 0x798c, 0x2001, 0x197f, 0x918c, 0x8000,
-	0x2102, 0x080c, 0x4abb, 0x0904, 0x3559, 0x080c, 0x6972, 0x0120,
-	0x080c, 0x697a, 0x1904, 0x3559, 0x080c, 0x66c6, 0x0904, 0x3556,
-	0x080c, 0x6768, 0x0904, 0x3556, 0x2001, 0x197f, 0x2004, 0xd0fc,
-	0x1904, 0x3524, 0x0804, 0x451c, 0xa9a0, 0x2001, 0x197f, 0x918c,
-	0x8000, 0xc18d, 0x2102, 0x080c, 0x4ac8, 0x01a0, 0x080c, 0x6972,
-	0x0118, 0x080c, 0x697a, 0x1170, 0x080c, 0x66c6, 0x2009, 0x0002,
-	0x0128, 0x080c, 0x6768, 0x1170, 0x2009, 0x0003, 0xa897, 0x4005,
-	0xa99a, 0x0010, 0xa897, 0x4006, 0x900e, 0x9085, 0x0001, 0x2001,
-	0x0030, 0x0005, 0xa897, 0x4000, 0x2001, 0x197f, 0x2004, 0xd0fc,
-	0x1128, 0x080c, 0x56d7, 0x0110, 0x9006, 0x0018, 0x900e, 0x9085,
-	0x0001, 0x2001, 0x0000, 0x0005, 0x6100, 0x0804, 0x3524, 0x080c,
-	0x4ad7, 0x0904, 0x3559, 0x080c, 0x56e3, 0x1904, 0x3556, 0x79a8,
-	0xd184, 0x1158, 0xb834, 0x8007, 0x789e, 0xb830, 0x8007, 0x789a,
-	0xbb2c, 0x831f, 0xba28, 0x8217, 0x0050, 0xb824, 0x8007, 0x789e,
-	0xb820, 0x8007, 0x789a, 0xbb1c, 0x831f, 0xba18, 0x8217, 0xb900,
-	0x918c, 0x0200, 0x0804, 0x3524, 0x78a8, 0x909c, 0x0003, 0xd0b4,
-	0x1148, 0x939a, 0x0003, 0x1a04, 0x3556, 0x625c, 0x7884, 0x9206,
-	0x1904, 0x46c9, 0x080c, 0x85d9, 0x2001, 0xfff4, 0x2009, 0x000c,
-	0x7a8c, 0x7b88, 0x7c9c, 0x7d98, 0x2039, 0x0000, 0x0006, 0x78a8,
-	0x9084, 0x0080, 0x11c8, 0x0006, 0x0036, 0x2001, 0x1a7f, 0x201c,
-	0x7b9a, 0x2003, 0x0000, 0x2001, 0x1a80, 0x201c, 0x7b9e, 0x2003,
-	0x0000, 0x2001, 0x1a81, 0x201c, 0x7ba2, 0x2003, 0x0000, 0x003e,
-	0x000e, 0x000e, 0x0804, 0x4af0, 0x000e, 0x2031, 0x0000, 0x2061,
-	0x18b8, 0x2c44, 0xa66a, 0xa17a, 0xa772, 0xa076, 0xa28e, 0xa392,
-	0xa496, 0xa59a, 0x080c, 0x10e9, 0x7007, 0x0002, 0x701f, 0x46e9,
-	0x0005, 0x81ff, 0x1904, 0x3556, 0x080c, 0x4ad7, 0x0904, 0x3559,
-	0x080c, 0x6972, 0x1904, 0x3556, 0x00c6, 0x080c, 0x4aa4, 0x00ce,
-	0x0904, 0x3556, 0xa867, 0x0000, 0xa868, 0xc0fd, 0xa86a, 0x7ea8,
-	0x080c, 0xcca4, 0x0904, 0x3556, 0x7007, 0x0003, 0x701f, 0x4703,
-	0x0005, 0x080c, 0x420e, 0x0006, 0x0036, 0x2001, 0x1a7f, 0x201c,
-	0x7b9a, 0x2003, 0x0000, 0x2001, 0x1a80, 0x201c, 0x7b9e, 0x2003,
-	0x0000, 0x2001, 0x1a81, 0x201c, 0x7ba2, 0x2003, 0x0000, 0x003e,
-	0x000e, 0x0804, 0x3524, 0xa830, 0x9086, 0x0100, 0x0904, 0x3556,
-	0x8906, 0x8006, 0x8007, 0x90bc, 0x003f, 0x9084, 0xffc0, 0x9080,
-	0x001b, 0x2009, 0x000c, 0x7a8c, 0x7b88, 0x7c9c, 0x7d98, 0x0804,
-	0x4af0, 0x9006, 0x080c, 0x28a7, 0x78a8, 0x9084, 0x00ff, 0x9086,
-	0x00ff, 0x0118, 0x81ff, 0x1904, 0x3556, 0x080c, 0x73bc, 0x0110,
-	0x080c, 0x5fdf, 0x7888, 0x908a, 0x1000, 0x1a04, 0x3559, 0x7984,
-	0x9186, 0x00ff, 0x0138, 0x9182, 0x007f, 0x1a04, 0x3559, 0x2100,
-	0x080c, 0x2871, 0x0026, 0x00c6, 0x0126, 0x2091, 0x8000, 0x2061,
-	0x19fa, 0x601b, 0x0000, 0x601f, 0x0000, 0x6073, 0x0000, 0x6077,
-	0x0000, 0x080c, 0x73bc, 0x1158, 0x080c, 0x76a4, 0x080c, 0x601a,
-	0x9085, 0x0001, 0x080c, 0x7403, 0x080c, 0x72ee, 0x00d0, 0x080c,
-	0xadd2, 0x2061, 0x0100, 0x2001, 0x1818, 0x2004, 0x9084, 0x00ff,
-	0x810f, 0x9105, 0x604a, 0x6043, 0x0090, 0x6043, 0x0010, 0x2009,
-	0x1999, 0x200b, 0x0000, 0x2009, 0x002d, 0x2011, 0x5f05, 0x080c,
-	0x858b, 0x7984, 0x080c, 0x73bc, 0x1110, 0x2009, 0x00ff, 0x7a88,
-	0x080c, 0x457f, 0x012e, 0x00ce, 0x002e, 0x0804, 0x3524, 0x7984,
-	0x080c, 0x659e, 0x2b08, 0x1904, 0x3559, 0x0804, 0x3524, 0x81ff,
-	0x0120, 0x2009, 0x0001, 0x0804, 0x3556, 0x60dc, 0xd0ac, 0x1130,
-	0xd09c, 0x1120, 0x2009, 0x0005, 0x0804, 0x3556, 0x080c, 0x4aa4,
-	0x1120, 0x2009, 0x0002, 0x0804, 0x3556, 0x7984, 0x9192, 0x0021,
-	0x1a04, 0x3559, 0x7a8c, 0x7b88, 0x7c9c, 0x7d98, 0xa85c, 0x9080,
-	0x0019, 0x702a, 0xaf60, 0x7736, 0x080c, 0x4aed, 0x701f, 0x47b7,
-	0x7880, 0x9086, 0x006e, 0x0110, 0x701f, 0x518d, 0x0005, 0x2009,
-	0x0080, 0x080c, 0x65ff, 0x1118, 0x080c, 0x6972, 0x0120, 0x2021,
-	0x400a, 0x0804, 0x3526, 0x00d6, 0x0096, 0xa964, 0xaa6c, 0xab70,
-	0xac74, 0xad78, 0xae7c, 0xa884, 0x90be, 0x0100, 0x0904, 0x4850,
-	0x90be, 0x0112, 0x0904, 0x4850, 0x90be, 0x0113, 0x0904, 0x4850,
-	0x90be, 0x0114, 0x0904, 0x4850, 0x90be, 0x0117, 0x0904, 0x4850,
-	0x90be, 0x011a, 0x0904, 0x4850, 0x90be, 0x011c, 0x0904, 0x4850,
-	0x90be, 0x0121, 0x0904, 0x4837, 0x90be, 0x0131, 0x0904, 0x4837,
-	0x90be, 0x0171, 0x0904, 0x4850, 0x90be, 0x0173, 0x0904, 0x4850,
-	0x90be, 0x01a1, 0x1128, 0xa894, 0x8007, 0xa896, 0x0804, 0x485b,
-	0x90be, 0x0212, 0x0904, 0x4844, 0x90be, 0x0213, 0x05e8, 0x90be,
-	0x0214, 0x0500, 0x90be, 0x0217, 0x0188, 0x90be, 0x021a, 0x1120,
-	0xa89c, 0x8007, 0xa89e, 0x04e0, 0x90be, 0x021f, 0x05c8, 0x90be,
-	0x0300, 0x05b0, 0x009e, 0x00de, 0x0804, 0x3559, 0x7028, 0x9080,
-	0x0010, 0x2098, 0x20a0, 0x7034, 0x20e0, 0x20e8, 0x20a9, 0x0007,
-	0x080c, 0x4899, 0x7028, 0x9080, 0x000e, 0x2098, 0x20a0, 0x7034,
-	0x20e0, 0x20e8, 0x20a9, 0x0001, 0x080c, 0x4899, 0x00c8, 0x7028,
-	0x9080, 0x000c, 0x2098, 0x20a0, 0x7034, 0x20e0, 0x20e8, 0x20a9,
-	0x0001, 0x080c, 0x48a6, 0x00b8, 0x7028, 0x9080, 0x000e, 0x2098,
-	0x20a0, 0x7034, 0x20e0, 0x20e8, 0x20a9, 0x0001, 0x080c, 0x48a6,
-	0x7028, 0x9080, 0x000c, 0x2098, 0x20a0, 0x7034, 0x20e0, 0x20e8,
-	0x20a9, 0x0001, 0x04f1, 0x00c6, 0x080c, 0x4aa4, 0x0550, 0xa868,
-	0xc0fd, 0xa86a, 0xa867, 0x0119, 0x9006, 0xa882, 0xa87f, 0x0020,
-	0xa88b, 0x0001, 0x810b, 0xa9ae, 0xa8b2, 0xaab6, 0xabba, 0xacbe,
-	0xadc2, 0xa9c6, 0xa8ca, 0x00ce, 0x009e, 0x00de, 0xa866, 0xa822,
-	0xa868, 0xc0fd, 0xa86a, 0xa804, 0x2048, 0x080c, 0xccbf, 0x1120,
-	0x2009, 0x0003, 0x0804, 0x3556, 0x7007, 0x0003, 0x701f, 0x4890,
-	0x0005, 0x00ce, 0x009e, 0x00de, 0x2009, 0x0002, 0x0804, 0x3556,
-	0xa820, 0x9086, 0x8001, 0x1904, 0x3524, 0x2009, 0x0004, 0x0804,
-	0x3556, 0x0016, 0x0026, 0x3510, 0x20a9, 0x0002, 0x4002, 0x4104,
-	0x4004, 0x8211, 0x1dc8, 0x002e, 0x001e, 0x0005, 0x0016, 0x0026,
-	0x0036, 0x0046, 0x3520, 0x20a9, 0x0004, 0x4002, 0x4304, 0x4204,
-	0x4104, 0x4004, 0x8421, 0x1db8, 0x004e, 0x003e, 0x002e, 0x001e,
-	0x0005, 0x81ff, 0x0120, 0x2009, 0x0001, 0x0804, 0x3556, 0x60dc,
-	0xd0ac, 0x1130, 0xd09c, 0x1120, 0x2009, 0x0005, 0x0804, 0x3556,
-	0x7984, 0x78a8, 0x2040, 0x080c, 0xadcb, 0x1120, 0x9182, 0x007f,
-	0x0a04, 0x3559, 0x9186, 0x00ff, 0x0904, 0x3559, 0x9182, 0x0800,
-	0x1a04, 0x3559, 0x7a8c, 0x7b88, 0x607c, 0x9306, 0x1140, 0x6080,
-	0x924e, 0x0904, 0x3559, 0x99cc, 0xff00, 0x0904, 0x3559, 0x0126,
-	0x2091, 0x8000, 0x080c, 0x49b7, 0x0904, 0x4937, 0x0086, 0x90c6,
+	0xa866, 0x2001, 0x002f, 0x2004, 0xa86a, 0x2061, 0x0090, 0x2079,
+	0x0100, 0x2001, 0x19a8, 0x2004, 0x6036, 0x2009, 0x0040, 0x080c,
+	0x23d4, 0x2001, 0x002a, 0x2004, 0x9084, 0xfff8, 0xa86e, 0x601a,
+	0xa873, 0x0000, 0x601f, 0x0000, 0x78ca, 0x9006, 0x600a, 0x600e,
+	0x00ce, 0x00ee, 0x00fe, 0x0005, 0x00e6, 0x080c, 0x4ab4, 0x2940,
+	0xa013, 0x0019, 0xa017, 0x0001, 0x2800, 0xa05a, 0x2001, 0x0030,
+	0x2004, 0xa866, 0x2001, 0x0031, 0x2004, 0xa86a, 0x2001, 0x002a,
+	0x2004, 0x9084, 0xfff8, 0xa86e, 0xa873, 0x0000, 0x2001, 0x032a,
+	0x2003, 0x0004, 0x2001, 0x0300, 0x2003, 0x0000, 0x2001, 0x020d,
+	0x2003, 0x0000, 0x2001, 0x0004, 0x200c, 0x918d, 0x0002, 0x2102,
+	0x00ee, 0x0005, 0x0126, 0x2091, 0x8000, 0x81ff, 0x0148, 0x080c,
+	0x2c32, 0x1130, 0x9006, 0x080c, 0x2b8a, 0x9006, 0x080c, 0x2b6d,
+	0x7884, 0x9084, 0x0007, 0x0002, 0x3d17, 0x3d20, 0x3d29, 0x3d14,
+	0x3d14, 0x3d14, 0x3d14, 0x3d14, 0x012e, 0x0804, 0x355b, 0x2009,
+	0x0114, 0x2104, 0x9085, 0x0800, 0x200a, 0x080c, 0x3ee5, 0x00c0,
+	0x2009, 0x0114, 0x2104, 0x9085, 0x4000, 0x200a, 0x080c, 0x3ee5,
+	0x0078, 0x080c, 0x73a5, 0x1128, 0x012e, 0x2009, 0x0016, 0x0804,
+	0x3558, 0x81ff, 0x0128, 0x012e, 0x2021, 0x400b, 0x0804, 0x3528,
+	0x0086, 0x0096, 0x00a6, 0x00b6, 0x00c6, 0x00d6, 0x00e6, 0x00f6,
+	0x080c, 0x3a46, 0x2009, 0x0101, 0x210c, 0x0016, 0x7ec8, 0x7dcc,
+	0x9006, 0x2068, 0x2060, 0x2058, 0x080c, 0x41ae, 0x080c, 0x40fe,
+	0x903e, 0x2720, 0x00f6, 0x00e6, 0x0086, 0x2940, 0x2071, 0x1a65,
+	0x2079, 0x0090, 0x00d6, 0x2069, 0x0000, 0x6884, 0xd0b4, 0x0120,
+	0x68d4, 0x780e, 0x68d0, 0x780a, 0x00de, 0x2011, 0x0001, 0x080c,
+	0x405f, 0x080c, 0x2c3a, 0x080c, 0x2c3a, 0x080c, 0x2c3a, 0x080c,
+	0x2c3a, 0x080c, 0x405f, 0x008e, 0x00ee, 0x00fe, 0x080c, 0x3f8c,
+	0x2009, 0x9c40, 0x8109, 0x11b0, 0x080c, 0x3e9b, 0x2001, 0x0004,
+	0x200c, 0x918c, 0xfffd, 0x2102, 0x001e, 0x00fe, 0x00ee, 0x00de,
+	0x00ce, 0x00be, 0x00ae, 0x009e, 0x008e, 0x2009, 0x0017, 0x080c,
+	0x3558, 0x0cf8, 0x2001, 0x020b, 0x2004, 0x9084, 0x0140, 0x1d10,
+	0x00f6, 0x2079, 0x0000, 0x7884, 0x00fe, 0xd0bc, 0x0178, 0x2001,
+	0x0201, 0x200c, 0x81ff, 0x0150, 0x080c, 0x3f6a, 0x2d00, 0x9c05,
+	0x9b05, 0x0120, 0x080c, 0x3e9b, 0x0804, 0x3e48, 0x080c, 0x40d3,
+	0x080c, 0x3ff7, 0x080c, 0x3f4d, 0x080c, 0x3f82, 0x00f6, 0x2079,
+	0x0100, 0x7824, 0xd0ac, 0x0130, 0x8b58, 0x080c, 0x3e9b, 0x00fe,
+	0x0804, 0x3e48, 0x00fe, 0x080c, 0x3e91, 0x1150, 0x8d68, 0x2001,
+	0x0032, 0x2602, 0x2001, 0x0033, 0x2502, 0x080c, 0x3e9b, 0x0080,
+	0x87ff, 0x0138, 0x2001, 0x0201, 0x2004, 0x9005, 0x1908, 0x8739,
+	0x0038, 0x2001, 0x1a61, 0x2004, 0x9086, 0x0000, 0x1904, 0x3d98,
+	0x2001, 0x032f, 0x2003, 0x00f6, 0x8631, 0x1208, 0x8529, 0x2500,
+	0x9605, 0x0904, 0x3e48, 0x7884, 0xd0bc, 0x0128, 0x2d00, 0x9c05,
+	0x9b05, 0x1904, 0x3e48, 0xa013, 0x0019, 0x2001, 0x032a, 0x2003,
+	0x0004, 0x7884, 0xd0ac, 0x1148, 0x2001, 0x1a61, 0x2003, 0x0003,
+	0x2001, 0x032a, 0x2003, 0x0009, 0x0030, 0xa017, 0x0001, 0x78b4,
+	0x9005, 0x0108, 0xa016, 0x2800, 0xa05a, 0x2009, 0x0040, 0x080c,
+	0x23d4, 0x2900, 0xa85a, 0xa813, 0x0019, 0x7884, 0xd0a4, 0x1180,
+	0xa817, 0x0000, 0x00c6, 0x20a9, 0x0004, 0x2061, 0x0090, 0x602b,
+	0x0008, 0x2001, 0x0203, 0x2004, 0x1f04, 0x3e1f, 0x00ce, 0x0030,
+	0xa817, 0x0001, 0x78b0, 0x9005, 0x0108, 0xa816, 0x00f6, 0x00c6,
+	0x2079, 0x0100, 0x2061, 0x0090, 0x7827, 0x0002, 0x2001, 0x002a,
+	0x2004, 0x9084, 0xfff8, 0x601a, 0x0006, 0x2001, 0x002b, 0x2004,
+	0x601e, 0x78c6, 0x000e, 0x78ca, 0x00ce, 0x00fe, 0x0804, 0x3d52,
+	0x001e, 0x00c6, 0x2001, 0x032a, 0x2003, 0x0004, 0x2061, 0x0100,
+	0x6027, 0x0002, 0x6106, 0x2011, 0x020d, 0x2013, 0x0020, 0x2001,
+	0x0004, 0x200c, 0x918c, 0xfffd, 0x2102, 0x080c, 0x12ed, 0x7884,
+	0x9084, 0x0003, 0x9086, 0x0002, 0x01a0, 0x2009, 0x0028, 0x080c,
+	0x23d4, 0x2001, 0x0227, 0x200c, 0x2102, 0x6050, 0x9084, 0xb7ef,
+	0x6052, 0x602f, 0x0000, 0x604b, 0xf7f7, 0x6043, 0x0090, 0x6043,
+	0x0010, 0x00ce, 0x2d08, 0x2c10, 0x2b18, 0x2b00, 0x9c05, 0x9d05,
+	0x00fe, 0x00ee, 0x00de, 0x00ce, 0x00be, 0x00ae, 0x009e, 0x008e,
+	0x1118, 0x012e, 0x0804, 0x3526, 0x012e, 0x2021, 0x400c, 0x0804,
+	0x3528, 0x9085, 0x0001, 0x1d04, 0x3e9a, 0x2091, 0x6000, 0x8420,
+	0x9486, 0x0064, 0x0005, 0x2001, 0x0105, 0x2003, 0x0010, 0x2001,
+	0x032a, 0x2003, 0x0004, 0x2001, 0x1a61, 0x2003, 0x0000, 0x0071,
+	0x2009, 0x0048, 0x080c, 0x23d4, 0x2001, 0x0227, 0x2024, 0x2402,
+	0x2001, 0x0109, 0x2003, 0x4000, 0x9026, 0x0005, 0x00f6, 0x00e6,
+	0x2071, 0x1a65, 0x7000, 0x9086, 0x0000, 0x0520, 0x2079, 0x0090,
+	0x2009, 0x0206, 0x2104, 0x2009, 0x0203, 0x210c, 0x9106, 0x1120,
+	0x2009, 0x0040, 0x080c, 0x23d4, 0x782c, 0xd0fc, 0x0d88, 0x080c,
+	0x40d3, 0x7000, 0x9086, 0x0000, 0x1d58, 0x782b, 0x0004, 0x782c,
+	0xd0ac, 0x1de8, 0x2009, 0x0040, 0x080c, 0x23d4, 0x782b, 0x0002,
+	0x7003, 0x0000, 0x00ee, 0x00fe, 0x0005, 0x00f6, 0x2079, 0x0100,
+	0x2001, 0x1818, 0x200c, 0x7932, 0x7936, 0x080c, 0x2889, 0x7850,
+	0x9084, 0xfbff, 0x9085, 0x0030, 0x7852, 0x2019, 0x01f4, 0x8319,
+	0x1df0, 0x9084, 0xffcf, 0x9085, 0x2000, 0x7852, 0x20a9, 0x0046,
+	0x1d04, 0x3f00, 0x2091, 0x6000, 0x1f04, 0x3f00, 0x7850, 0x9085,
+	0x0400, 0x9084, 0xdfff, 0x7852, 0x2001, 0x0021, 0x2004, 0x9084,
+	0x0003, 0x9086, 0x0001, 0x1120, 0x7850, 0x9084, 0xdfff, 0x7852,
+	0x784b, 0xf7f7, 0x7843, 0x0090, 0x7843, 0x0010, 0x20a9, 0x0028,
+	0xa001, 0x1f04, 0x3f20, 0x7850, 0x9085, 0x1400, 0x7852, 0x2019,
+	0x61a8, 0x7854, 0xa001, 0xa001, 0xd08c, 0x1110, 0x8319, 0x1dc8,
+	0x7827, 0x0048, 0x7850, 0x9085, 0x0400, 0x7852, 0x7843, 0x0040,
+	0x2019, 0x01f4, 0xa001, 0xa001, 0x8319, 0x1de0, 0x2001, 0x0100,
+	0x080c, 0x2cf1, 0x7827, 0x0020, 0x7843, 0x0000, 0x9006, 0x080c,
+	0x2cf1, 0x7827, 0x0048, 0x00fe, 0x0005, 0x7884, 0xd0ac, 0x11c8,
+	0x00f6, 0x00e6, 0x2071, 0x1a61, 0x2079, 0x0320, 0x2001, 0x0201,
+	0x2004, 0x9005, 0x0160, 0x7000, 0x9086, 0x0000, 0x1140, 0x0051,
+	0xd0bc, 0x0108, 0x8738, 0x7003, 0x0003, 0x782b, 0x0019, 0x00ee,
+	0x00fe, 0x0005, 0x00f6, 0x2079, 0x0300, 0x78bc, 0x00fe, 0x908c,
+	0x0070, 0x0178, 0x2009, 0x0032, 0x260a, 0x2009, 0x0033, 0x250a,
+	0xd0b4, 0x0108, 0x8c60, 0xd0ac, 0x0108, 0x8d68, 0xd0a4, 0x0108,
+	0x8b58, 0x0005, 0x00f6, 0x2079, 0x0200, 0x781c, 0xd084, 0x0110,
+	0x7837, 0x0050, 0x00fe, 0x0005, 0x00e6, 0x2071, 0x0100, 0x2001,
+	0x19a9, 0x2004, 0x70e2, 0x080c, 0x3c7c, 0x1188, 0x2001, 0x1820,
+	0x2004, 0x2009, 0x181f, 0x210c, 0x918c, 0x00ff, 0x706e, 0x716a,
+	0x7066, 0x918d, 0x3200, 0x7162, 0x7073, 0xe109, 0x0080, 0x702c,
+	0x9085, 0x0002, 0x702e, 0x2009, 0x1818, 0x210c, 0x716e, 0x7063,
+	0x0100, 0x7166, 0x719e, 0x706b, 0x0000, 0x7073, 0x0809, 0x7077,
+	0x0008, 0x7078, 0x9080, 0x0100, 0x707a, 0x7080, 0x8000, 0x7082,
+	0x7087, 0xaaaa, 0x9006, 0x708a, 0x708e, 0x707e, 0x70d6, 0x70ab,
+	0x0036, 0x70af, 0x95d5, 0x7014, 0x9084, 0x1984, 0x9085, 0x0092,
+	0x7016, 0x080c, 0x40d3, 0x00f6, 0x2071, 0x1a61, 0x2079, 0x0320,
+	0x00d6, 0x2069, 0x0000, 0x6884, 0xd0b4, 0x0120, 0x689c, 0x780e,
+	0x6898, 0x780a, 0x00de, 0x2009, 0x03e8, 0x8109, 0x1df0, 0x792c,
+	0xd1fc, 0x0110, 0x782b, 0x0004, 0x2011, 0x0011, 0x080c, 0x405f,
+	0x2011, 0x0001, 0x080c, 0x405f, 0x00fe, 0x00ee, 0x0005, 0x00f6,
+	0x00e6, 0x2071, 0x1a61, 0x2079, 0x0320, 0x792c, 0xd1fc, 0x0904,
+	0x405c, 0x782b, 0x0002, 0x9026, 0xd19c, 0x1904, 0x4058, 0x7000,
+	0x0002, 0x405c, 0x400d, 0x403d, 0x4058, 0xd1bc, 0x1170, 0xd1dc,
+	0x1190, 0x8001, 0x7002, 0x2011, 0x0001, 0x080c, 0x405f, 0x0904,
+	0x405c, 0x080c, 0x405f, 0x0804, 0x405c, 0x00f6, 0x2079, 0x0300,
+	0x78bf, 0x0000, 0x00fe, 0x7810, 0x7914, 0x782b, 0x0004, 0x7812,
+	0x7916, 0x2001, 0x0201, 0x200c, 0x81ff, 0x0de8, 0x080c, 0x3f6a,
+	0x2009, 0x0001, 0x00f6, 0x2079, 0x0300, 0x78b8, 0x00fe, 0xd0ec,
+	0x0110, 0x2009, 0x0011, 0x792a, 0x00f8, 0x8001, 0x7002, 0x9184,
+	0x0880, 0x1140, 0x782c, 0xd0fc, 0x1904, 0x4001, 0x2011, 0x0001,
+	0x00b1, 0x0090, 0xa010, 0x9092, 0x0004, 0x9086, 0x0015, 0x1120,
+	0xa000, 0xa05a, 0x2011, 0x0031, 0xa212, 0xd1dc, 0x1960, 0x0828,
+	0x782b, 0x0004, 0x7003, 0x0000, 0x00ee, 0x00fe, 0x0005, 0xa014,
+	0x9005, 0x0550, 0x8001, 0x0036, 0x0096, 0xa016, 0xa058, 0x2048,
+	0xa010, 0x2009, 0x0031, 0x911a, 0x831c, 0x831c, 0x938a, 0x0007,
+	0x1a0c, 0x0dd5, 0x9398, 0x408d, 0x231d, 0x083f, 0x9080, 0x0004,
+	0x7a2a, 0x7100, 0x8108, 0x7102, 0x009e, 0x003e, 0x908a, 0x0035,
+	0x1140, 0x0096, 0xa058, 0x2048, 0xa804, 0xa05a, 0x2001, 0x0019,
+	0x009e, 0xa012, 0x9085, 0x0001, 0x0005, 0x40ca, 0x40c1, 0x40b8,
+	0x40af, 0x40a6, 0x409d, 0x4094, 0xa964, 0x7902, 0xa968, 0x7906,
+	0xa96c, 0x7912, 0xa970, 0x7916, 0x0005, 0xa974, 0x7902, 0xa978,
+	0x7906, 0xa97c, 0x7912, 0xa980, 0x7916, 0x0005, 0xa984, 0x7902,
+	0xa988, 0x7906, 0xa98c, 0x7912, 0xa990, 0x7916, 0x0005, 0xa994,
+	0x7902, 0xa998, 0x7906, 0xa99c, 0x7912, 0xa9a0, 0x7916, 0x0005,
+	0xa9a4, 0x7902, 0xa9a8, 0x7906, 0xa9ac, 0x7912, 0xa9b0, 0x7916,
+	0x0005, 0xa9b4, 0x7902, 0xa9b8, 0x7906, 0xa9bc, 0x7912, 0xa9c0,
+	0x7916, 0x0005, 0xa9c4, 0x7902, 0xa9c8, 0x7906, 0xa9cc, 0x7912,
+	0xa9d0, 0x7916, 0x0005, 0x00f6, 0x00e6, 0x0086, 0x2071, 0x1a65,
+	0x2079, 0x0090, 0x792c, 0xd1fc, 0x01e8, 0x782b, 0x0002, 0x2940,
+	0x9026, 0x7000, 0x0002, 0x40fa, 0x40e6, 0x40f1, 0x8001, 0x7002,
+	0xd19c, 0x1180, 0x2011, 0x0001, 0x080c, 0x405f, 0x190c, 0x405f,
+	0x0048, 0x8001, 0x7002, 0x782c, 0xd0fc, 0x1d38, 0x2011, 0x0001,
+	0x080c, 0x405f, 0x008e, 0x00ee, 0x00fe, 0x0005, 0x00f6, 0x00e6,
+	0x00c6, 0x0086, 0x2061, 0x0200, 0x2001, 0x19a9, 0x2004, 0x601a,
+	0x2061, 0x0100, 0x2001, 0x19a8, 0x2004, 0x60ce, 0x6104, 0xc1ac,
+	0x6106, 0x2001, 0x002c, 0x2004, 0x9005, 0x0520, 0x2038, 0x2001,
+	0x002e, 0x2024, 0x2001, 0x002f, 0x201c, 0x080c, 0x4ab4, 0xa813,
+	0x0019, 0xaf16, 0x2900, 0xa85a, 0x978a, 0x0007, 0x0220, 0x2138,
+	0x2009, 0x0007, 0x0010, 0x2708, 0x903e, 0x0096, 0xa858, 0x2048,
+	0xa85c, 0x9080, 0x0019, 0x009e, 0x080c, 0x4176, 0x1d68, 0x2900,
+	0xa85a, 0x00d0, 0x080c, 0x4ab4, 0xa813, 0x0019, 0xa817, 0x0001,
+	0x2900, 0xa85a, 0x2001, 0x002e, 0x2004, 0xa866, 0x2001, 0x002f,
+	0x2004, 0xa86a, 0x2001, 0x002a, 0x2004, 0x9084, 0xfff8, 0xa86e,
+	0x2001, 0x002b, 0x2004, 0xa872, 0x2061, 0x0090, 0x2079, 0x0100,
+	0x2001, 0x19a8, 0x2004, 0x6036, 0x2009, 0x0040, 0x080c, 0x23d4,
+	0x2001, 0x002a, 0x2004, 0x9084, 0xfff8, 0x601a, 0x0006, 0x2001,
+	0x002b, 0x2004, 0x601e, 0x78c6, 0x000e, 0x78ca, 0x9006, 0x600a,
+	0x600e, 0x008e, 0x00ce, 0x00ee, 0x00fe, 0x0005, 0x00e6, 0x2071,
+	0x0080, 0xaa60, 0x22e8, 0x20a0, 0x20e1, 0x0000, 0x2099, 0x0088,
+	0x702b, 0x0026, 0x7402, 0x7306, 0x9006, 0x700a, 0x700e, 0x810b,
+	0x810b, 0x21a8, 0x810b, 0x7112, 0x702b, 0x0041, 0x702c, 0xd0fc,
+	0x0de8, 0x702b, 0x0002, 0x702b, 0x0040, 0x4005, 0x7400, 0x7304,
+	0x87ff, 0x0190, 0x0086, 0x0096, 0x2940, 0x0086, 0x080c, 0x4ab4,
+	0x008e, 0xa058, 0x00a6, 0x2050, 0x2900, 0xb006, 0xa05a, 0x00ae,
+	0x009e, 0x008e, 0x9085, 0x0001, 0x00ee, 0x0005, 0x00e6, 0x2001,
+	0x002d, 0x2004, 0x9005, 0x0528, 0x2038, 0x2001, 0x0030, 0x2024,
+	0x2001, 0x0031, 0x201c, 0x080c, 0x4ab4, 0x2940, 0xa813, 0x0019,
+	0xaf16, 0x2900, 0xa85a, 0x978a, 0x0007, 0x0220, 0x2138, 0x2009,
+	0x0007, 0x0010, 0x2708, 0x903e, 0x0096, 0xa858, 0x2048, 0xa85c,
+	0x9080, 0x0019, 0x009e, 0x080c, 0x4176, 0x1d68, 0x2900, 0xa85a,
+	0x00d8, 0x080c, 0x4ab4, 0x2940, 0xa013, 0x0019, 0xa017, 0x0001,
+	0x2800, 0xa05a, 0x2001, 0x0030, 0x2004, 0xa066, 0x2001, 0x0031,
+	0x2004, 0xa06a, 0x2001, 0x002a, 0x2004, 0x9084, 0xfff8, 0xa06e,
+	0x2001, 0x002b, 0x2004, 0xa072, 0x2001, 0x032a, 0x2003, 0x0004,
+	0x7884, 0xd0ac, 0x1180, 0x2001, 0x0101, 0x200c, 0x918d, 0x0200,
+	0x2102, 0xa017, 0x0000, 0x2001, 0x1a61, 0x2003, 0x0003, 0x2001,
+	0x032a, 0x2003, 0x0009, 0x2001, 0x0300, 0x2003, 0x0000, 0x2001,
+	0x020d, 0x2003, 0x0000, 0x2001, 0x0004, 0x200c, 0x918d, 0x0002,
+	0x2102, 0x00ee, 0x0005, 0x0126, 0x2091, 0x8000, 0x20a9, 0x0007,
+	0x20a1, 0x1840, 0x20e9, 0x0001, 0x9006, 0x4004, 0x20a9, 0x000c,
+	0x20a1, 0xfff4, 0x20e9, 0x0000, 0x9006, 0x4004, 0x2009, 0x013c,
+	0x200a, 0x012e, 0x7880, 0x9086, 0x0052, 0x0108, 0x0005, 0x0804,
+	0x3526, 0x7d98, 0x7c9c, 0x0804, 0x3628, 0x080c, 0x73a5, 0x190c,
+	0x5fe8, 0x6040, 0x9084, 0x0020, 0x09b1, 0x2069, 0x1847, 0x2d00,
+	0x2009, 0x0030, 0x7a8c, 0x7b88, 0x7c9c, 0x7d98, 0x2039, 0x0001,
+	0x080c, 0x4afd, 0x701f, 0x4255, 0x0005, 0x080c, 0x56e7, 0x1130,
+	0x3b00, 0x3a08, 0xc194, 0xc095, 0x20d8, 0x21d0, 0x2069, 0x1847,
+	0x6800, 0x9005, 0x0904, 0x355b, 0x6804, 0xd0ac, 0x0118, 0xd0a4,
+	0x0904, 0x355b, 0xd094, 0x00c6, 0x2061, 0x0100, 0x6104, 0x0138,
+	0x6200, 0x9292, 0x0005, 0x0218, 0x918c, 0xffdf, 0x0010, 0x918d,
+	0x0020, 0x6106, 0x00ce, 0xd08c, 0x00c6, 0x2061, 0x0100, 0x6104,
+	0x0118, 0x918d, 0x0010, 0x0010, 0x918c, 0xffef, 0x6106, 0x00ce,
+	0xd084, 0x0158, 0x6a28, 0x928a, 0x007f, 0x1a04, 0x355b, 0x9288,
+	0x3327, 0x210d, 0x918c, 0x00ff, 0x6166, 0xd0dc, 0x0130, 0x6828,
+	0x908a, 0x007f, 0x1a04, 0x355b, 0x605e, 0x6888, 0x9084, 0x0030,
+	0x8004, 0x8004, 0x8004, 0x8004, 0x0006, 0x2009, 0x19b0, 0x9080,
+	0x297c, 0x2005, 0x200a, 0x000e, 0x2009, 0x19b1, 0x9080, 0x2980,
+	0x2005, 0x200a, 0x6808, 0x908a, 0x0100, 0x0a04, 0x355b, 0x908a,
+	0x0841, 0x1a04, 0x355b, 0x9084, 0x0007, 0x1904, 0x355b, 0x680c,
+	0x9005, 0x0904, 0x355b, 0x6810, 0x9005, 0x0904, 0x355b, 0x6848,
+	0x6940, 0x910a, 0x1a04, 0x355b, 0x8001, 0x0904, 0x355b, 0x684c,
+	0x6944, 0x910a, 0x1a04, 0x355b, 0x8001, 0x0904, 0x355b, 0x2009,
+	0x1980, 0x200b, 0x0000, 0x2001, 0x1869, 0x2004, 0xd0c4, 0x0140,
+	0x7884, 0x200a, 0x2009, 0x017f, 0x200a, 0x3b00, 0xc085, 0x20d8,
+	0x6814, 0x908c, 0x00ff, 0x614e, 0x8007, 0x9084, 0x00ff, 0x6052,
+	0x080c, 0x76be, 0x080c, 0x69ad, 0x080c, 0x69e1, 0x6808, 0x602a,
+	0x080c, 0x2346, 0x2009, 0x0170, 0x200b, 0x0080, 0xa001, 0xa001,
+	0x200b, 0x0000, 0x0036, 0x6b08, 0x080c, 0x28e3, 0x003e, 0x6000,
+	0x9086, 0x0000, 0x1904, 0x43ec, 0x6818, 0x691c, 0x6a20, 0x6b24,
+	0x8007, 0x810f, 0x8217, 0x831f, 0x6016, 0x611a, 0x621e, 0x6322,
+	0x6c04, 0xd4f4, 0x0148, 0x6830, 0x6934, 0x6a38, 0x6b3c, 0x8007,
+	0x810f, 0x8217, 0x831f, 0x0010, 0x9084, 0xf0ff, 0x6006, 0x610a,
+	0x620e, 0x6312, 0x8007, 0x810f, 0x8217, 0x831f, 0x20a9, 0x0004,
+	0x20a1, 0x19b2, 0x20e9, 0x0001, 0x4001, 0x20a9, 0x0004, 0x20a1,
+	0x19cc, 0x20e9, 0x0001, 0x4001, 0x080c, 0x85d8, 0x00c6, 0x900e,
+	0x20a9, 0x0001, 0x6b70, 0xd384, 0x0510, 0x0068, 0x2009, 0x0100,
+	0x210c, 0x918e, 0x0008, 0x1110, 0x839d, 0x0010, 0x83f5, 0x3e18,
+	0x12b0, 0x3508, 0x8109, 0x080c, 0x7c74, 0x6878, 0x6016, 0x6874,
+	0x2008, 0x9084, 0xff00, 0x8007, 0x600a, 0x9184, 0x00ff, 0x6006,
+	0x8108, 0x1118, 0x6003, 0x0003, 0x0010, 0x6003, 0x0001, 0x1f04,
+	0x4346, 0x00ce, 0x00c6, 0x2061, 0x199b, 0x6a88, 0x9284, 0xc000,
+	0x2010, 0x9286, 0x0000, 0x1158, 0x2063, 0x0000, 0x2001, 0x0001,
+	0x080c, 0x2b8a, 0x2001, 0x0001, 0x080c, 0x2b6d, 0x0088, 0x9286,
+	0x4000, 0x1148, 0x2063, 0x0001, 0x9006, 0x080c, 0x2b8a, 0x9006,
+	0x080c, 0x2b6d, 0x0028, 0x9286, 0x8000, 0x1d30, 0x2063, 0x0002,
+	0x00ce, 0x6888, 0xd0ec, 0x0130, 0x2011, 0x0114, 0x2204, 0x9085,
+	0x0100, 0x2012, 0x6a80, 0x9284, 0x0030, 0x9086, 0x0030, 0x1128,
+	0x9294, 0xffcf, 0x9295, 0x0020, 0x6a82, 0x2001, 0x197b, 0x6a80,
+	0x9294, 0x0030, 0x928e, 0x0000, 0x0170, 0x928e, 0x0010, 0x0118,
+	0x928e, 0x0020, 0x0140, 0x2003, 0xaaaa, 0x080c, 0x2958, 0x2001,
+	0x196c, 0x2102, 0x0008, 0x2102, 0x00c6, 0x2061, 0x0100, 0x602f,
+	0x0040, 0x602f, 0x0000, 0x00ce, 0x080c, 0x73a5, 0x0128, 0x080c,
+	0x4fe4, 0x0110, 0x080c, 0x28a9, 0x60d4, 0x9005, 0x01c0, 0x6003,
+	0x0001, 0x2009, 0x43d4, 0x00e0, 0x080c, 0x73a5, 0x1168, 0x2011,
+	0x723b, 0x080c, 0x84dc, 0x2011, 0x722e, 0x080c, 0x85b6, 0x080c,
+	0x7692, 0x080c, 0x72d7, 0x0040, 0x080c, 0x5ee2, 0x0028, 0x6003,
+	0x0004, 0x2009, 0x43ec, 0x0020, 0x080c, 0x68dd, 0x0804, 0x3526,
+	0x2001, 0x0170, 0x2004, 0x9084, 0x00ff, 0x9086, 0x004c, 0x1118,
+	0x2091, 0x30bd, 0x0817, 0x2091, 0x303d, 0x0817, 0x6000, 0x9086,
+	0x0000, 0x0904, 0x3558, 0x2069, 0x1847, 0x7890, 0x6842, 0x7894,
+	0x6846, 0x2d00, 0x2009, 0x0030, 0x7a8c, 0x7b88, 0x7c9c, 0x7d98,
+	0x2039, 0x0001, 0x0804, 0x4b00, 0x9006, 0x080c, 0x28a9, 0x81ff,
+	0x1904, 0x3558, 0x080c, 0x73a5, 0x11b0, 0x080c, 0x768d, 0x080c,
+	0x6023, 0x080c, 0x331b, 0x0118, 0x6130, 0xc18d, 0x6132, 0x080c,
+	0xd24a, 0x0130, 0x080c, 0x73c8, 0x1118, 0x080c, 0x737d, 0x0038,
+	0x080c, 0x72d7, 0x0020, 0x080c, 0x5fe8, 0x080c, 0x5ee2, 0x0804,
+	0x3526, 0x81ff, 0x1904, 0x3558, 0x080c, 0x73a5, 0x1110, 0x0804,
+	0x3558, 0x6194, 0x81ff, 0x01a8, 0x704f, 0x0000, 0x2001, 0x1c80,
+	0x2009, 0x0040, 0x7a8c, 0x7b88, 0x7c9c, 0x7d98, 0x0126, 0x2091,
+	0x8000, 0x2039, 0x0001, 0x080c, 0x4b00, 0x701f, 0x3524, 0x012e,
+	0x0005, 0x704f, 0x0001, 0x00d6, 0x2069, 0x1c80, 0x20a9, 0x0040,
+	0x20e9, 0x0001, 0x20a1, 0x1c80, 0x2019, 0xffff, 0x4304, 0x655c,
+	0x9588, 0x3327, 0x210d, 0x918c, 0x00ff, 0x216a, 0x900e, 0x2011,
+	0x0002, 0x2100, 0x9506, 0x01a8, 0x080c, 0x6608, 0x1190, 0xb814,
+	0x821c, 0x0238, 0x9398, 0x1c80, 0x9085, 0xff00, 0x8007, 0x201a,
+	0x0038, 0x9398, 0x1c80, 0x2324, 0x94a4, 0xff00, 0x9405, 0x201a,
+	0x8210, 0x8108, 0x9182, 0x0080, 0x1208, 0x0c18, 0x8201, 0x8007,
+	0x2d0c, 0x9105, 0x206a, 0x00de, 0x20a9, 0x0040, 0x20a1, 0x1c80,
+	0x2099, 0x1c80, 0x080c, 0x5f73, 0x0804, 0x4446, 0x080c, 0x4ae7,
+	0x0904, 0x355b, 0x080c, 0x4ab4, 0x1120, 0x2009, 0x0002, 0x0804,
+	0x3558, 0x080c, 0x56d8, 0xd0b4, 0x0558, 0x7884, 0x908e, 0x007e,
+	0x0538, 0x908e, 0x007f, 0x0520, 0x908e, 0x0080, 0x0508, 0x080c,
+	0x3316, 0x1148, 0xb800, 0xd08c, 0x11d8, 0xb804, 0x9084, 0x00ff,
+	0x9086, 0x0006, 0x11a8, 0xa867, 0x0000, 0xa868, 0xc0fd, 0xa86a,
+	0x080c, 0xcd13, 0x1120, 0x2009, 0x0003, 0x0804, 0x3558, 0x7007,
+	0x0003, 0x701f, 0x44d4, 0x0005, 0x080c, 0x4ae7, 0x0904, 0x355b,
+	0x20a9, 0x002b, 0xb8c4, 0x20e0, 0xb8c8, 0x2098, 0xa860, 0x20e8,
+	0xa85c, 0x9080, 0x0002, 0x20a0, 0x4003, 0x20a9, 0x0008, 0x9080,
+	0x0006, 0x20a0, 0xb8c4, 0x20e0, 0xb8c8, 0x9080, 0x0006, 0x2098,
+	0x080c, 0x0f7c, 0x0070, 0x20a9, 0x0004, 0xa85c, 0x9080, 0x000a,
+	0x20a0, 0xb8c4, 0x20e0, 0xb8c8, 0x9080, 0x000a, 0x2098, 0x080c,
+	0x0f7c, 0x8906, 0x8006, 0x8007, 0x90bc, 0x003f, 0x9084, 0xffc0,
+	0x9080, 0x0002, 0x2009, 0x002b, 0x7a8c, 0x7b88, 0x7c9c, 0x7d98,
+	0x0804, 0x4b00, 0x81ff, 0x1904, 0x3558, 0x080c, 0x4acb, 0x0904,
+	0x355b, 0x080c, 0x677a, 0x0904, 0x3558, 0x0058, 0xa878, 0x9005,
+	0x0120, 0x2009, 0x0004, 0x0804, 0x3558, 0xa974, 0xaa94, 0x0804,
+	0x3526, 0x080c, 0x56e0, 0x0904, 0x3526, 0x701f, 0x451e, 0x7007,
+	0x0003, 0x0005, 0x81ff, 0x1904, 0x3558, 0x7888, 0x908a, 0x1000,
+	0x1a04, 0x355b, 0x080c, 0x4ae7, 0x0904, 0x355b, 0x080c, 0x697b,
+	0x0120, 0x080c, 0x6983, 0x1904, 0x355b, 0x080c, 0x67ff, 0x0904,
+	0x3558, 0x2019, 0x0004, 0x900e, 0x080c, 0x678c, 0x0904, 0x3558,
+	0x7984, 0x7a88, 0x04c9, 0x08a8, 0xa89c, 0x908a, 0x1000, 0x12f8,
+	0x080c, 0x4ae5, 0x01e0, 0x080c, 0x697b, 0x0118, 0x080c, 0x6983,
+	0x11b0, 0x080c, 0x67ff, 0x2009, 0x0002, 0x0168, 0x2009, 0x0002,
+	0x2019, 0x0004, 0x080c, 0x678c, 0x2009, 0x0003, 0x0120, 0xa998,
+	0xaa9c, 0x00d1, 0x0060, 0xa897, 0x4005, 0xa99a, 0x0010, 0xa897,
+	0x4006, 0x900e, 0x9085, 0x0001, 0x2001, 0x0030, 0x0005, 0xa897,
+	0x4000, 0x080c, 0x56e0, 0x0110, 0x9006, 0x0018, 0x900e, 0x9085,
+	0x0001, 0x2001, 0x0000, 0x0005, 0x9186, 0x00ff, 0x0110, 0x0071,
+	0x0060, 0x2029, 0x007e, 0x2061, 0x1800, 0x645c, 0x2400, 0x9506,
+	0x0110, 0x2508, 0x0019, 0x8529, 0x1ec8, 0x0005, 0x080c, 0x6608,
+	0x1138, 0x2200, 0x8003, 0x800b, 0x810b, 0x9108, 0x080c, 0x84ea,
+	0x0005, 0x81ff, 0x1904, 0x3558, 0x798c, 0x2001, 0x197f, 0x918c,
+	0x8000, 0x2102, 0x080c, 0x4acb, 0x0904, 0x355b, 0x080c, 0x697b,
+	0x0120, 0x080c, 0x6983, 0x1904, 0x355b, 0x080c, 0x66cf, 0x0904,
+	0x3558, 0x080c, 0x6783, 0x0904, 0x3558, 0x2001, 0x197f, 0x2004,
+	0xd0fc, 0x1904, 0x3526, 0x0804, 0x4529, 0xa9a0, 0x2001, 0x197f,
+	0x918c, 0x8000, 0xc18d, 0x2102, 0x080c, 0x4ad8, 0x01a0, 0x080c,
+	0x697b, 0x0118, 0x080c, 0x6983, 0x1170, 0x080c, 0x66cf, 0x2009,
+	0x0002, 0x0128, 0x080c, 0x6783, 0x1170, 0x2009, 0x0003, 0xa897,
+	0x4005, 0xa99a, 0x0010, 0xa897, 0x4006, 0x900e, 0x9085, 0x0001,
+	0x2001, 0x0030, 0x0005, 0xa897, 0x4000, 0x2001, 0x197f, 0x2004,
+	0xd0fc, 0x1128, 0x080c, 0x56e0, 0x0110, 0x9006, 0x0018, 0x900e,
+	0x9085, 0x0001, 0x2001, 0x0000, 0x0005, 0x81ff, 0x1904, 0x3558,
+	0x798c, 0x2001, 0x197e, 0x918c, 0x8000, 0x2102, 0x080c, 0x4acb,
+	0x0904, 0x355b, 0x080c, 0x697b, 0x0120, 0x080c, 0x6983, 0x1904,
+	0x355b, 0x080c, 0x66cf, 0x0904, 0x3558, 0x080c, 0x6771, 0x0904,
+	0x3558, 0x2001, 0x197e, 0x2004, 0xd0fc, 0x1904, 0x3526, 0x0804,
+	0x4529, 0xa9a0, 0x2001, 0x197e, 0x918c, 0x8000, 0xc18d, 0x2102,
+	0x080c, 0x4ad8, 0x01a0, 0x080c, 0x697b, 0x0118, 0x080c, 0x6983,
+	0x1170, 0x080c, 0x66cf, 0x2009, 0x0002, 0x0128, 0x080c, 0x6771,
+	0x1170, 0x2009, 0x0003, 0xa897, 0x4005, 0xa99a, 0x0010, 0xa897,
+	0x4006, 0x900e, 0x9085, 0x0001, 0x2001, 0x0030, 0x0005, 0xa897,
+	0x4000, 0x2001, 0x197e, 0x2004, 0xd0fc, 0x1128, 0x080c, 0x56e0,
+	0x0110, 0x9006, 0x0018, 0x900e, 0x9085, 0x0001, 0x2001, 0x0000,
+	0x0005, 0x6100, 0x0804, 0x3526, 0x080c, 0x4ae7, 0x0904, 0x355b,
+	0x080c, 0x56ec, 0x1904, 0x3558, 0x79a8, 0xd184, 0x1158, 0xb834,
+	0x8007, 0x789e, 0xb830, 0x8007, 0x789a, 0xbb2c, 0x831f, 0xba28,
+	0x8217, 0x0050, 0xb824, 0x8007, 0x789e, 0xb820, 0x8007, 0x789a,
+	0xbb1c, 0x831f, 0xba18, 0x8217, 0xb900, 0x918c, 0x0200, 0x0804,
+	0x3526, 0x78a8, 0x909c, 0x0003, 0xd0b4, 0x1148, 0x939a, 0x0003,
+	0x1a04, 0x3558, 0x625c, 0x7884, 0x9206, 0x1904, 0x46d6, 0x080c,
+	0x85c2, 0x2001, 0xfff4, 0x2009, 0x000c, 0x7a8c, 0x7b88, 0x7c9c,
+	0x7d98, 0x2039, 0x0000, 0x0006, 0x78a8, 0x9084, 0x0080, 0x11c8,
+	0x0006, 0x0036, 0x2001, 0x1a7e, 0x201c, 0x7b9a, 0x2003, 0x0000,
+	0x2001, 0x1a7f, 0x201c, 0x7b9e, 0x2003, 0x0000, 0x2001, 0x1a80,
+	0x201c, 0x7ba2, 0x2003, 0x0000, 0x003e, 0x000e, 0x000e, 0x0804,
+	0x4b00, 0x000e, 0x2031, 0x0000, 0x2061, 0x18b8, 0x2c44, 0xa66a,
+	0xa17a, 0xa772, 0xa076, 0xa28e, 0xa392, 0xa496, 0xa59a, 0x080c,
+	0x10e9, 0x7007, 0x0002, 0x701f, 0x46f6, 0x0005, 0x81ff, 0x1904,
+	0x3558, 0x080c, 0x4ae7, 0x0904, 0x355b, 0x080c, 0x697b, 0x1904,
+	0x3558, 0x00c6, 0x080c, 0x4ab4, 0x00ce, 0x0904, 0x3558, 0xa867,
+	0x0000, 0xa868, 0xc0fd, 0xa86a, 0x7ea8, 0x080c, 0xccb9, 0x0904,
+	0x3558, 0x7007, 0x0003, 0x701f, 0x4710, 0x0005, 0x080c, 0x421b,
+	0x0006, 0x0036, 0x2001, 0x1a7e, 0x201c, 0x7b9a, 0x2003, 0x0000,
+	0x2001, 0x1a7f, 0x201c, 0x7b9e, 0x2003, 0x0000, 0x2001, 0x1a80,
+	0x201c, 0x7ba2, 0x2003, 0x0000, 0x003e, 0x000e, 0x0804, 0x3526,
+	0xa830, 0x9086, 0x0100, 0x0904, 0x3558, 0x8906, 0x8006, 0x8007,
+	0x90bc, 0x003f, 0x9084, 0xffc0, 0x9080, 0x001b, 0x2009, 0x000c,
+	0x7a8c, 0x7b88, 0x7c9c, 0x7d98, 0x0804, 0x4b00, 0x9006, 0x080c,
+	0x28a9, 0x78a8, 0x9084, 0x00ff, 0x9086, 0x00ff, 0x0118, 0x81ff,
+	0x1904, 0x3558, 0x080c, 0x73a5, 0x0110, 0x080c, 0x5fe8, 0x7888,
+	0x908a, 0x1000, 0x1a04, 0x355b, 0x7984, 0x9186, 0x00ff, 0x0138,
+	0x9182, 0x007f, 0x1a04, 0x355b, 0x2100, 0x080c, 0x2873, 0x0026,
+	0x00c6, 0x0126, 0x2091, 0x8000, 0x2061, 0x19f9, 0x601b, 0x0000,
+	0x601f, 0x0000, 0x6073, 0x0000, 0x6077, 0x0000, 0x080c, 0x73a5,
+	0x1158, 0x080c, 0x768d, 0x080c, 0x6023, 0x9085, 0x0001, 0x080c,
+	0x73ec, 0x080c, 0x72d7, 0x00d0, 0x080c, 0xade2, 0x2061, 0x0100,
+	0x2001, 0x1818, 0x2004, 0x9084, 0x00ff, 0x810f, 0x9105, 0x604a,
+	0x6043, 0x0090, 0x6043, 0x0010, 0x2009, 0x1998, 0x200b, 0x0000,
+	0x2009, 0x002d, 0x2011, 0x5f0e, 0x080c, 0x8574, 0x7984, 0x080c,
+	0x73a5, 0x1110, 0x2009, 0x00ff, 0x7a88, 0x080c, 0x458c, 0x012e,
+	0x00ce, 0x002e, 0x0804, 0x3526, 0x7984, 0x080c, 0x65a7, 0x2b08,
+	0x1904, 0x355b, 0x0804, 0x3526, 0x81ff, 0x0120, 0x2009, 0x0001,
+	0x0804, 0x3558, 0x60dc, 0xd0ac, 0x1130, 0xd09c, 0x1120, 0x2009,
+	0x0005, 0x0804, 0x3558, 0x080c, 0x4ab4, 0x1120, 0x2009, 0x0002,
+	0x0804, 0x3558, 0x7984, 0x9192, 0x0021, 0x1a04, 0x355b, 0x7a8c,
+	0x7b88, 0x7c9c, 0x7d98, 0xa85c, 0x9080, 0x0019, 0x702a, 0xaf60,
+	0x7736, 0x080c, 0x4afd, 0x701f, 0x47c4, 0x7880, 0x9086, 0x006e,
+	0x0110, 0x701f, 0x5196, 0x0005, 0x2009, 0x0080, 0x080c, 0x6608,
+	0x1118, 0x080c, 0x697b, 0x0120, 0x2021, 0x400a, 0x0804, 0x3528,
+	0x00d6, 0x0096, 0xa964, 0xaa6c, 0xab70, 0xac74, 0xad78, 0xae7c,
+	0xa884, 0x90be, 0x0100, 0x0904, 0x485d, 0x90be, 0x0112, 0x0904,
+	0x485d, 0x90be, 0x0113, 0x0904, 0x485d, 0x90be, 0x0114, 0x0904,
+	0x485d, 0x90be, 0x0117, 0x0904, 0x485d, 0x90be, 0x011a, 0x0904,
+	0x485d, 0x90be, 0x011c, 0x0904, 0x485d, 0x90be, 0x0121, 0x0904,
+	0x4844, 0x90be, 0x0131, 0x0904, 0x4844, 0x90be, 0x0171, 0x0904,
+	0x485d, 0x90be, 0x0173, 0x0904, 0x485d, 0x90be, 0x01a1, 0x1128,
+	0xa894, 0x8007, 0xa896, 0x0804, 0x4868, 0x90be, 0x0212, 0x0904,
+	0x4851, 0x90be, 0x0213, 0x05e8, 0x90be, 0x0214, 0x0500, 0x90be,
+	0x0217, 0x0188, 0x90be, 0x021a, 0x1120, 0xa89c, 0x8007, 0xa89e,
+	0x04e0, 0x90be, 0x021f, 0x05c8, 0x90be, 0x0300, 0x05b0, 0x009e,
+	0x00de, 0x0804, 0x355b, 0x7028, 0x9080, 0x0010, 0x2098, 0x20a0,
+	0x7034, 0x20e0, 0x20e8, 0x20a9, 0x0007, 0x080c, 0x48a6, 0x7028,
+	0x9080, 0x000e, 0x2098, 0x20a0, 0x7034, 0x20e0, 0x20e8, 0x20a9,
+	0x0001, 0x080c, 0x48a6, 0x00c8, 0x7028, 0x9080, 0x000c, 0x2098,
+	0x20a0, 0x7034, 0x20e0, 0x20e8, 0x20a9, 0x0001, 0x080c, 0x48b3,
+	0x00b8, 0x7028, 0x9080, 0x000e, 0x2098, 0x20a0, 0x7034, 0x20e0,
+	0x20e8, 0x20a9, 0x0001, 0x080c, 0x48b3, 0x7028, 0x9080, 0x000c,
+	0x2098, 0x20a0, 0x7034, 0x20e0, 0x20e8, 0x20a9, 0x0001, 0x04f1,
+	0x00c6, 0x080c, 0x4ab4, 0x0550, 0xa868, 0xc0fd, 0xa86a, 0xa867,
+	0x0119, 0x9006, 0xa882, 0xa87f, 0x0020, 0xa88b, 0x0001, 0x810b,
+	0xa9ae, 0xa8b2, 0xaab6, 0xabba, 0xacbe, 0xadc2, 0xa9c6, 0xa8ca,
+	0x00ce, 0x009e, 0x00de, 0xa866, 0xa822, 0xa868, 0xc0fd, 0xa86a,
+	0xa804, 0x2048, 0x080c, 0xccd4, 0x1120, 0x2009, 0x0003, 0x0804,
+	0x3558, 0x7007, 0x0003, 0x701f, 0x489d, 0x0005, 0x00ce, 0x009e,
+	0x00de, 0x2009, 0x0002, 0x0804, 0x3558, 0xa820, 0x9086, 0x8001,
+	0x1904, 0x3526, 0x2009, 0x0004, 0x0804, 0x3558, 0x0016, 0x0026,
+	0x3510, 0x20a9, 0x0002, 0x4002, 0x4104, 0x4004, 0x8211, 0x1dc8,
+	0x002e, 0x001e, 0x0005, 0x0016, 0x0026, 0x0036, 0x0046, 0x3520,
+	0x20a9, 0x0004, 0x4002, 0x4304, 0x4204, 0x4104, 0x4004, 0x8421,
+	0x1db8, 0x004e, 0x003e, 0x002e, 0x001e, 0x0005, 0x81ff, 0x0120,
+	0x2009, 0x0001, 0x0804, 0x3558, 0x60dc, 0xd0ac, 0x1130, 0xd09c,
+	0x1120, 0x2009, 0x0005, 0x0804, 0x3558, 0x7984, 0x78a8, 0x2040,
+	0x080c, 0xaddb, 0x1120, 0x9182, 0x007f, 0x0a04, 0x355b, 0x9186,
+	0x00ff, 0x0904, 0x355b, 0x9182, 0x0800, 0x1a04, 0x355b, 0x7a8c,
+	0x7b88, 0x607c, 0x9306, 0x1158, 0x6080, 0x924e, 0x0904, 0x355b,
+	0x080c, 0xaddb, 0x1120, 0x99cc, 0xff00, 0x0904, 0x355b, 0x0126,
+	0x2091, 0x8000, 0x080c, 0x49c7, 0x0904, 0x4947, 0x0086, 0x90c6,
 	0x4000, 0x008e, 0x1538, 0x00c6, 0x0006, 0x0036, 0xb818, 0xbb1c,
 	0x9305, 0xbb20, 0x9305, 0xbb24, 0x9305, 0xbb28, 0x9305, 0xbb2c,
 	0x9305, 0xbb30, 0x9305, 0xbb34, 0x9305, 0x003e, 0x0570, 0xd88c,
-	0x1128, 0x080c, 0x6972, 0x0110, 0xc89d, 0x0438, 0x900e, 0x080c,
-	0x681f, 0x1108, 0xc185, 0xb800, 0xd0bc, 0x0108, 0xc18d, 0x000e,
+	0x1128, 0x080c, 0x697b, 0x0110, 0xc89d, 0x0438, 0x900e, 0x080c,
+	0x6828, 0x1108, 0xc185, 0xb800, 0xd0bc, 0x0108, 0xc18d, 0x000e,
 	0x00ce, 0x00b8, 0x90c6, 0x4007, 0x1110, 0x2408, 0x0090, 0x90c6,
 	0x4008, 0x1118, 0x2708, 0x2610, 0x0060, 0x90c6, 0x4009, 0x1108,
 	0x0040, 0x90c6, 0x4006, 0x1108, 0x0020, 0x2001, 0x4005, 0x2009,
-	0x000a, 0x2020, 0x012e, 0x0804, 0x3526, 0x000e, 0x00ce, 0x2b00,
-	0x7026, 0x0016, 0x00b6, 0x00c6, 0x00e6, 0x2c70, 0x080c, 0xaeaf,
-	0x0904, 0x498c, 0x2b00, 0x6012, 0x080c, 0xcfaa, 0x2e58, 0x00ee,
-	0x00e6, 0x00c6, 0x080c, 0x4aa4, 0x00ce, 0x2b70, 0x1158, 0x080c,
-	0xae61, 0x00ee, 0x00ce, 0x00be, 0x001e, 0x012e, 0x2009, 0x0002,
-	0x0804, 0x3556, 0x900e, 0xa966, 0xa96a, 0x2900, 0x6016, 0xa932,
+	0x000a, 0x2020, 0x012e, 0x0804, 0x3528, 0x000e, 0x00ce, 0x2b00,
+	0x7026, 0x0016, 0x00b6, 0x00c6, 0x00e6, 0x2c70, 0x080c, 0xaebf,
+	0x0904, 0x499c, 0x2b00, 0x6012, 0x080c, 0xcfc4, 0x2e58, 0x00ee,
+	0x00e6, 0x00c6, 0x080c, 0x4ab4, 0x00ce, 0x2b70, 0x1158, 0x080c,
+	0xae71, 0x00ee, 0x00ce, 0x00be, 0x001e, 0x012e, 0x2009, 0x0002,
+	0x0804, 0x3558, 0x900e, 0xa966, 0xa96a, 0x2900, 0x6016, 0xa932,
 	0xa868, 0xc0fd, 0xd88c, 0x0108, 0xc0f5, 0xa86a, 0xd89c, 0x1110,
-	0x080c, 0x31bf, 0x6023, 0x0001, 0x9006, 0x080c, 0x653b, 0xd89c,
-	0x0138, 0x2001, 0x0004, 0x080c, 0x654f, 0x2009, 0x0003, 0x0030,
-	0x2001, 0x0002, 0x080c, 0x654f, 0x2009, 0x0002, 0x080c, 0xaedc,
+	0x080c, 0x31c1, 0x6023, 0x0001, 0x9006, 0x080c, 0x6544, 0xd89c,
+	0x0138, 0x2001, 0x0004, 0x080c, 0x6558, 0x2009, 0x0003, 0x0030,
+	0x2001, 0x0002, 0x080c, 0x6558, 0x2009, 0x0002, 0x080c, 0xaeec,
 	0x78a8, 0xd094, 0x0138, 0x00ee, 0x7024, 0x00e6, 0x2058, 0xb8cc,
 	0xc08d, 0xb8ce, 0x9085, 0x0001, 0x00ee, 0x00ce, 0x00be, 0x001e,
-	0x012e, 0x1120, 0x2009, 0x0003, 0x0804, 0x3556, 0x7007, 0x0003,
-	0x701f, 0x499b, 0x0005, 0xa830, 0x9086, 0x0100, 0x7024, 0x2058,
-	0x1138, 0x2009, 0x0004, 0xba04, 0x9294, 0x00ff, 0x0804, 0x562c,
-	0x900e, 0xa868, 0xd0f4, 0x1904, 0x3524, 0x080c, 0x681f, 0x1108,
-	0xc185, 0xb800, 0xd0bc, 0x0108, 0xc18d, 0x0804, 0x3524, 0x00e6,
-	0x00d6, 0x0096, 0x83ff, 0x0904, 0x4a06, 0x902e, 0x080c, 0xadcb,
+	0x012e, 0x1120, 0x2009, 0x0003, 0x0804, 0x3558, 0x7007, 0x0003,
+	0x701f, 0x49ab, 0x0005, 0xa830, 0x9086, 0x0100, 0x7024, 0x2058,
+	0x1138, 0x2009, 0x0004, 0xba04, 0x9294, 0x00ff, 0x0804, 0x5635,
+	0x900e, 0xa868, 0xd0f4, 0x1904, 0x3526, 0x080c, 0x6828, 0x1108,
+	0xc185, 0xb800, 0xd0bc, 0x0108, 0xc18d, 0x0804, 0x3526, 0x00e6,
+	0x00d6, 0x0096, 0x83ff, 0x0904, 0x4a16, 0x902e, 0x080c, 0xaddb,
 	0x0130, 0x9026, 0x20a9, 0x0800, 0x2071, 0x1000, 0x0030, 0x2021,
 	0x007f, 0x20a9, 0x0781, 0x2071, 0x107f, 0x2e04, 0x9005, 0x11b8,
-	0x2100, 0x9406, 0x1904, 0x4a17, 0x2428, 0x94ce, 0x007f, 0x1120,
+	0x2100, 0x9406, 0x1904, 0x4a27, 0x2428, 0x94ce, 0x007f, 0x1120,
 	0x92ce, 0xfffd, 0x1558, 0x0030, 0x94ce, 0x0080, 0x1130, 0x92ce,
 	0xfffc, 0x1520, 0x93ce, 0x00ff, 0x1508, 0xc5fd, 0x0480, 0x2058,
 	0xbf10, 0x2700, 0x9306, 0x11e8, 0xbe14, 0x2600, 0x9206, 0x11c8,
 	0x2400, 0x9106, 0x1180, 0xd884, 0x0598, 0xd894, 0x1588, 0x080c,
-	0x6912, 0x1570, 0x2001, 0x4000, 0x0460, 0x080c, 0x6972, 0x1540,
+	0x691b, 0x1570, 0x2001, 0x4000, 0x0460, 0x080c, 0x697b, 0x1540,
 	0x2001, 0x4000, 0x0430, 0x2001, 0x4007, 0x0418, 0x2001, 0x4006,
 	0x0400, 0x2400, 0x9106, 0x1158, 0xbe14, 0x87ff, 0x1128, 0x86ff,
-	0x0918, 0x080c, 0xadcb, 0x1900, 0x2001, 0x4008, 0x0090, 0x8420,
-	0x8e70, 0x1f04, 0x49cd, 0x85ff, 0x1130, 0x2001, 0x4009, 0x0048,
-	0x2001, 0x0001, 0x0030, 0x080c, 0x659e, 0x1dd0, 0xbb12, 0xba16,
+	0x0918, 0x080c, 0xaddb, 0x1900, 0x2001, 0x4008, 0x0090, 0x8420,
+	0x8e70, 0x1f04, 0x49dd, 0x85ff, 0x1130, 0x2001, 0x4009, 0x0048,
+	0x2001, 0x0001, 0x0030, 0x080c, 0x65a7, 0x1dd0, 0xbb12, 0xba16,
 	0x9006, 0x9005, 0x009e, 0x00de, 0x00ee, 0x0005, 0x81ff, 0x0120,
-	0x2009, 0x0001, 0x0804, 0x3556, 0x080c, 0x4aa4, 0x1120, 0x2009,
-	0x0002, 0x0804, 0x3556, 0xa867, 0x0000, 0xa868, 0xc0fd, 0xa86a,
-	0x7884, 0x9005, 0x0904, 0x3559, 0x9096, 0x00ff, 0x0120, 0x9092,
-	0x0004, 0x1a04, 0x3559, 0x2010, 0x2918, 0x080c, 0x3165, 0x1120,
-	0x2009, 0x0003, 0x0804, 0x3556, 0x7007, 0x0003, 0x701f, 0x4a59,
-	0x0005, 0xa830, 0x9086, 0x0100, 0x1904, 0x3524, 0x2009, 0x0004,
-	0x0804, 0x3556, 0x7984, 0x080c, 0xadcb, 0x1120, 0x9182, 0x007f,
-	0x0a04, 0x3559, 0x9186, 0x00ff, 0x0904, 0x3559, 0x9182, 0x0800,
-	0x1a04, 0x3559, 0x2001, 0x9000, 0x080c, 0x5687, 0x1904, 0x3556,
-	0x0804, 0x3524, 0xa998, 0x080c, 0xadcb, 0x1118, 0x9182, 0x007f,
+	0x2009, 0x0001, 0x0804, 0x3558, 0x080c, 0x4ab4, 0x1120, 0x2009,
+	0x0002, 0x0804, 0x3558, 0xa867, 0x0000, 0xa868, 0xc0fd, 0xa86a,
+	0x7884, 0x9005, 0x0904, 0x355b, 0x9096, 0x00ff, 0x0120, 0x9092,
+	0x0004, 0x1a04, 0x355b, 0x2010, 0x2918, 0x080c, 0x3167, 0x1120,
+	0x2009, 0x0003, 0x0804, 0x3558, 0x7007, 0x0003, 0x701f, 0x4a69,
+	0x0005, 0xa830, 0x9086, 0x0100, 0x1904, 0x3526, 0x2009, 0x0004,
+	0x0804, 0x3558, 0x7984, 0x080c, 0xaddb, 0x1120, 0x9182, 0x007f,
+	0x0a04, 0x355b, 0x9186, 0x00ff, 0x0904, 0x355b, 0x9182, 0x0800,
+	0x1a04, 0x355b, 0x2001, 0x9000, 0x080c, 0x5690, 0x1904, 0x3558,
+	0x0804, 0x3526, 0xa998, 0x080c, 0xaddb, 0x1118, 0x9182, 0x007f,
 	0x0280, 0x9186, 0x00ff, 0x0168, 0x9182, 0x0800, 0x1250, 0x2001,
-	0x9000, 0x080c, 0x5687, 0x11a8, 0x0060, 0xa897, 0x4005, 0xa99a,
+	0x9000, 0x080c, 0x5690, 0x11a8, 0x0060, 0xa897, 0x4005, 0xa99a,
 	0x0010, 0xa897, 0x4006, 0x900e, 0x9085, 0x0001, 0x2001, 0x0030,
 	0x0005, 0xa897, 0x4000, 0x900e, 0x9085, 0x0001, 0x2001, 0x0000,
 	0x0005, 0x2009, 0x000a, 0x0c48, 0x080c, 0x0fff, 0x0198, 0x9006,
 	0xa802, 0x7014, 0x9005, 0x1120, 0x2900, 0x7016, 0x701a, 0x0040,
 	0x7018, 0xa802, 0x0086, 0x2040, 0x2900, 0xa006, 0x701a, 0x008e,
-	0x9085, 0x0001, 0x0005, 0x7984, 0x080c, 0x65ff, 0x1130, 0x7e88,
+	0x9085, 0x0001, 0x0005, 0x7984, 0x080c, 0x6608, 0x1130, 0x7e88,
 	0x9684, 0x3fff, 0x9082, 0x4000, 0x0208, 0x905e, 0x8bff, 0x0005,
-	0xa998, 0x080c, 0x65ff, 0x1130, 0xae9c, 0x9684, 0x3fff, 0x9082,
+	0xa998, 0x080c, 0x6608, 0x1130, 0xae9c, 0x9684, 0x3fff, 0x9082,
 	0x4000, 0x0208, 0x905e, 0x8bff, 0x0005, 0xae98, 0x0008, 0x7e84,
-	0x2608, 0x080c, 0x65ff, 0x1108, 0x0008, 0x905e, 0x8bff, 0x0005,
+	0x2608, 0x080c, 0x6608, 0x1108, 0x0008, 0x905e, 0x8bff, 0x0005,
 	0x0016, 0x7114, 0x81ff, 0x0128, 0x2148, 0xa904, 0x080c, 0x1031,
 	0x0cc8, 0x7116, 0x711a, 0x001e, 0x0005, 0x2031, 0x0001, 0x0010,
 	0x2031, 0x0000, 0x2061, 0x18b8, 0x2c44, 0xa66a, 0xa17a, 0xa772,
 	0xa076, 0xa28e, 0xa392, 0xa496, 0xa59a, 0x080c, 0x10e9, 0x7007,
-	0x0002, 0x701f, 0x3524, 0x0005, 0x00f6, 0x0126, 0x2091, 0x8000,
+	0x0002, 0x701f, 0x3526, 0x0005, 0x00f6, 0x0126, 0x2091, 0x8000,
 	0x2079, 0x0000, 0x2001, 0x18b0, 0x2004, 0x9005, 0x1190, 0x0e04,
-	0x4b21, 0x7a36, 0x7833, 0x0012, 0x7a82, 0x7b86, 0x7c8a, 0x2091,
+	0x4b31, 0x7a36, 0x7833, 0x0012, 0x7a82, 0x7b86, 0x7c8a, 0x2091,
 	0x4080, 0x2001, 0x0089, 0x2004, 0xd084, 0x190c, 0x119b, 0x0804,
-	0x4b87, 0x0016, 0x0086, 0x0096, 0x00c6, 0x00e6, 0x2071, 0x189e,
+	0x4b97, 0x0016, 0x0086, 0x0096, 0x00c6, 0x00e6, 0x2071, 0x189e,
 	0x7044, 0x9005, 0x1540, 0x7148, 0x9182, 0x0010, 0x0288, 0x7038,
-	0x2060, 0x080c, 0x0fff, 0x0904, 0x4b7f, 0xa84b, 0x0000, 0x2900,
-	0x7046, 0x2001, 0x0002, 0x9080, 0x2090, 0x2005, 0xa846, 0x0098,
+	0x2060, 0x080c, 0x0fff, 0x0904, 0x4b8f, 0xa84b, 0x0000, 0x2900,
+	0x7046, 0x2001, 0x0002, 0x9080, 0x2092, 0x2005, 0xa846, 0x0098,
 	0x7038, 0x90e0, 0x0004, 0x2001, 0x18ba, 0x9c82, 0x18fa, 0x0210,
 	0x2061, 0x18ba, 0x2c00, 0x703a, 0x7148, 0x81ff, 0x1108, 0x703e,
 	0x8108, 0x714a, 0x0460, 0x7148, 0x8108, 0x714a, 0x7044, 0x2040,
@@ -2209,24 +2211,24 @@ unsigned short risc_code01[] = {
 	0x001e, 0x8108, 0x2105, 0x9005, 0xa146, 0x1520, 0x080c, 0x0fff,
 	0x1130, 0x8109, 0xa946, 0x7148, 0x8109, 0x714a, 0x00d8, 0x9006,
 	0xa806, 0xa84a, 0xa046, 0x2800, 0xa802, 0x2900, 0xa006, 0x7046,
-	0x2001, 0x0002, 0x9080, 0x2090, 0x2005, 0xa846, 0x0058, 0x2262,
+	0x2001, 0x0002, 0x9080, 0x2092, 0x2005, 0xa846, 0x0058, 0x2262,
 	0x6306, 0x640a, 0x00ee, 0x00ce, 0x009e, 0x008e, 0x001e, 0x012e,
-	0x00fe, 0x0005, 0x2c00, 0x9082, 0x001b, 0x0002, 0x4ba9, 0x4ba9,
-	0x4bab, 0x4ba9, 0x4ba9, 0x4ba9, 0x4baf, 0x4ba9, 0x4ba9, 0x4ba9,
-	0x4bb3, 0x4ba9, 0x4ba9, 0x4ba9, 0x4bb7, 0x4ba9, 0x4ba9, 0x4ba9,
-	0x4bbb, 0x4ba9, 0x4ba9, 0x4ba9, 0x4bbf, 0x4ba9, 0x4ba9, 0x4ba9,
-	0x4bc4, 0x080c, 0x0dd5, 0xa276, 0xa37a, 0xa47e, 0x0898, 0xa286,
+	0x00fe, 0x0005, 0x2c00, 0x9082, 0x001b, 0x0002, 0x4bb9, 0x4bb9,
+	0x4bbb, 0x4bb9, 0x4bb9, 0x4bb9, 0x4bbf, 0x4bb9, 0x4bb9, 0x4bb9,
+	0x4bc3, 0x4bb9, 0x4bb9, 0x4bb9, 0x4bc7, 0x4bb9, 0x4bb9, 0x4bb9,
+	0x4bcb, 0x4bb9, 0x4bb9, 0x4bb9, 0x4bcf, 0x4bb9, 0x4bb9, 0x4bb9,
+	0x4bd4, 0x080c, 0x0dd5, 0xa276, 0xa37a, 0xa47e, 0x0898, 0xa286,
 	0xa38a, 0xa48e, 0x0878, 0xa296, 0xa39a, 0xa49e, 0x0858, 0xa2a6,
 	0xa3aa, 0xa4ae, 0x0838, 0xa2b6, 0xa3ba, 0xa4be, 0x0818, 0xa2c6,
-	0xa3ca, 0xa4ce, 0x0804, 0x4b82, 0xa2d6, 0xa3da, 0xa4de, 0x0804,
-	0x4b82, 0x00e6, 0x2071, 0x189e, 0x7048, 0x9005, 0x0904, 0x4c5b,
-	0x0126, 0x2091, 0x8000, 0x0e04, 0x4c5a, 0x00f6, 0x2079, 0x0000,
+	0xa3ca, 0xa4ce, 0x0804, 0x4b92, 0xa2d6, 0xa3da, 0xa4de, 0x0804,
+	0x4b92, 0x00e6, 0x2071, 0x189e, 0x7048, 0x9005, 0x0904, 0x4c6b,
+	0x0126, 0x2091, 0x8000, 0x0e04, 0x4c6a, 0x00f6, 0x2079, 0x0000,
 	0x00c6, 0x0096, 0x0086, 0x0076, 0x9006, 0x2038, 0x7040, 0x2048,
 	0x9005, 0x0500, 0xa948, 0x2105, 0x0016, 0x908a, 0x0036, 0x1a0c,
 	0x0dd5, 0x2060, 0x001e, 0x8108, 0x2105, 0x9005, 0xa94a, 0x1904,
-	0x4c5d, 0xa804, 0x9005, 0x090c, 0x0dd5, 0x7042, 0x2938, 0x2040,
-	0xa003, 0x0000, 0x2001, 0x0002, 0x9080, 0x2090, 0x2005, 0xa04a,
-	0x0804, 0x4c5d, 0x703c, 0x2060, 0x2c14, 0x6304, 0x6408, 0x650c,
+	0x4c6d, 0xa804, 0x9005, 0x090c, 0x0dd5, 0x7042, 0x2938, 0x2040,
+	0xa003, 0x0000, 0x2001, 0x0002, 0x9080, 0x2092, 0x2005, 0xa04a,
+	0x0804, 0x4c6d, 0x703c, 0x2060, 0x2c14, 0x6304, 0x6408, 0x650c,
 	0x2200, 0x7836, 0x7833, 0x0012, 0x7882, 0x2300, 0x7886, 0x2400,
 	0x788a, 0x2091, 0x4080, 0x2001, 0x0089, 0x2004, 0xd084, 0x190c,
 	0x119b, 0x87ff, 0x0118, 0x2748, 0x080c, 0x1031, 0x7048, 0x8001,
@@ -2236,3130 +2238,3130 @@ unsigned short risc_code01[] = {
 	0x9c80, 0x0004, 0x90fa, 0x18fa, 0x0210, 0x2001, 0x18ba, 0x703e,
 	0x00a0, 0x9006, 0x703e, 0x703a, 0x7044, 0x9005, 0x090c, 0x0dd5,
 	0x2048, 0xa800, 0x9005, 0x1de0, 0x2900, 0x7042, 0x2001, 0x0002,
-	0x9080, 0x2090, 0x2005, 0xa84a, 0x0000, 0x007e, 0x008e, 0x009e,
+	0x9080, 0x2092, 0x2005, 0xa84a, 0x0000, 0x007e, 0x008e, 0x009e,
 	0x00ce, 0x00fe, 0x012e, 0x00ee, 0x0005, 0x2c00, 0x9082, 0x001b,
-	0x0002, 0x4c7c, 0x4c7c, 0x4c7e, 0x4c7c, 0x4c7c, 0x4c7c, 0x4c83,
-	0x4c7c, 0x4c7c, 0x4c7c, 0x4c88, 0x4c7c, 0x4c7c, 0x4c7c, 0x4c8d,
-	0x4c7c, 0x4c7c, 0x4c7c, 0x4c92, 0x4c7c, 0x4c7c, 0x4c7c, 0x4c97,
-	0x4c7c, 0x4c7c, 0x4c7c, 0x4c9c, 0x080c, 0x0dd5, 0xaa74, 0xab78,
-	0xac7c, 0x0804, 0x4c08, 0xaa84, 0xab88, 0xac8c, 0x0804, 0x4c08,
-	0xaa94, 0xab98, 0xac9c, 0x0804, 0x4c08, 0xaaa4, 0xaba8, 0xacac,
-	0x0804, 0x4c08, 0xaab4, 0xabb8, 0xacbc, 0x0804, 0x4c08, 0xaac4,
-	0xabc8, 0xaccc, 0x0804, 0x4c08, 0xaad4, 0xabd8, 0xacdc, 0x0804,
-	0x4c08, 0x0016, 0x0026, 0x0036, 0x00b6, 0x00c6, 0x2009, 0x007e,
-	0x080c, 0x65ff, 0x2019, 0x0001, 0xb85c, 0xd0ac, 0x0110, 0x2019,
-	0x0000, 0x2011, 0x801b, 0x080c, 0x4b04, 0x00ce, 0x00be, 0x003e,
-	0x002e, 0x001e, 0x0005, 0x0026, 0x080c, 0x56cf, 0xd0c4, 0x0120,
-	0x2011, 0x8014, 0x080c, 0x4b04, 0x002e, 0x0005, 0x81ff, 0x1904,
-	0x3556, 0x0126, 0x2091, 0x8000, 0x6030, 0xc08d, 0xc085, 0xc0ac,
-	0x6032, 0x080c, 0x73bc, 0x1158, 0x080c, 0x76a4, 0x080c, 0x601a,
-	0x9085, 0x0001, 0x080c, 0x7403, 0x080c, 0x72ee, 0x0010, 0x080c,
-	0x5ed9, 0x012e, 0x0804, 0x3524, 0x81ff, 0x0120, 0x2009, 0x0001,
-	0x0804, 0x3556, 0x080c, 0x56e3, 0x0120, 0x2009, 0x0007, 0x0804,
-	0x3556, 0x080c, 0x696a, 0x0120, 0x2009, 0x0008, 0x0804, 0x3556,
-	0x080c, 0x3314, 0x0128, 0x7984, 0x080c, 0x659e, 0x1904, 0x3559,
-	0x080c, 0x4ad7, 0x0904, 0x3559, 0x2b00, 0x7026, 0x080c, 0x6972,
-	0x7888, 0x1170, 0x9084, 0x0005, 0x1158, 0x900e, 0x080c, 0x681f,
-	0x1108, 0xc185, 0xb800, 0xd0bc, 0x0108, 0xc18d, 0x0804, 0x3524,
-	0x080c, 0x4aa4, 0x0904, 0x3556, 0x9006, 0xa866, 0xa832, 0xa868,
-	0xc0fd, 0xa86a, 0x080c, 0xcd58, 0x0904, 0x3556, 0x7888, 0xd094,
-	0x0118, 0xb8cc, 0xc08d, 0xb8ce, 0x7007, 0x0003, 0x701f, 0x4d7d,
-	0x0005, 0x2061, 0x1800, 0x080c, 0x56e3, 0x2009, 0x0007, 0x1578,
-	0x080c, 0x696a, 0x0118, 0x2009, 0x0008, 0x0448, 0x080c, 0x3314,
-	0x0120, 0xa998, 0x080c, 0x659e, 0x1530, 0x080c, 0x4ad5, 0x0518,
-	0x080c, 0x6972, 0xa89c, 0x1168, 0x9084, 0x0005, 0x1150, 0x900e,
-	0x080c, 0x681f, 0x1108, 0xc185, 0xb800, 0xd0bc, 0x0108, 0xc18d,
-	0x00d0, 0xa868, 0xc0fc, 0xa86a, 0x080c, 0xcd58, 0x11e0, 0xa89c,
-	0xd094, 0x0118, 0xb8cc, 0xc08d, 0xb8ce, 0x2009, 0x0003, 0xa897,
-	0x4005, 0xa99a, 0x0010, 0xa897, 0x4006, 0x900e, 0x9085, 0x0001,
-	0x2001, 0x0030, 0x0005, 0xa897, 0x4000, 0xa99a, 0x9006, 0x918d,
-	0x0001, 0x2008, 0x0005, 0x9006, 0x0005, 0xa830, 0x9086, 0x0100,
-	0x7024, 0x2058, 0x1110, 0x0804, 0x562c, 0x900e, 0x080c, 0x681f,
-	0x1108, 0xc185, 0xb800, 0xd0bc, 0x0108, 0xc18d, 0x0804, 0x3524,
-	0x080c, 0x56e3, 0x0120, 0x2009, 0x0007, 0x0804, 0x3556, 0x7f84,
-	0x7a8c, 0x7b88, 0x7c9c, 0x7d98, 0x080c, 0x4aa4, 0x1120, 0x2009,
-	0x0002, 0x0804, 0x3556, 0x900e, 0x2130, 0x7126, 0x7132, 0xa860,
-	0x20e8, 0x7036, 0xa85c, 0x9080, 0x0005, 0x702a, 0x20a0, 0x080c,
-	0x65ff, 0x1904, 0x4e1f, 0x080c, 0x6972, 0x0138, 0x080c, 0x697a,
-	0x0120, 0x080c, 0x6912, 0x1904, 0x4e1f, 0xd794, 0x1110, 0xd784,
-	0x01a8, 0xb8c4, 0x20e0, 0xb8c8, 0x9080, 0x0006, 0x2098, 0x3400,
-	0xd794, 0x0160, 0x20a9, 0x0008, 0x4003, 0x2098, 0x20a0, 0x3d00,
-	0x20e0, 0x20a9, 0x0002, 0x080c, 0x48a6, 0x0048, 0x20a9, 0x0004,
-	0x4003, 0x2098, 0x20a0, 0x3d00, 0x20e0, 0x080c, 0x48a6, 0x9186,
-	0x007e, 0x0170, 0x9186, 0x0080, 0x0158, 0x080c, 0x6972, 0x90c2,
-	0x0006, 0x1210, 0xc1fd, 0x0020, 0x080c, 0x681f, 0x1108, 0xc1fd,
-	0x4104, 0xc1fc, 0xd794, 0x0528, 0xb8c4, 0x20e0, 0xb8c8, 0x2060,
-	0x9c80, 0x0000, 0x2098, 0x20a9, 0x0002, 0x4003, 0x9c80, 0x0003,
-	0x2098, 0x20a9, 0x0001, 0x4005, 0x9c80, 0x0004, 0x2098, 0x3400,
-	0x20a9, 0x0002, 0x4003, 0x2098, 0x20a0, 0x3d00, 0x20e0, 0x080c,
-	0x4899, 0x9c80, 0x0026, 0x2098, 0xb8c4, 0x20e0, 0x20a9, 0x0002,
-	0x4003, 0xd794, 0x0110, 0x96b0, 0x000b, 0x96b0, 0x0005, 0x8108,
-	0x080c, 0xadcb, 0x0118, 0x9186, 0x0800, 0x0040, 0xd78c, 0x0120,
-	0x9186, 0x0800, 0x0170, 0x0018, 0x9186, 0x007e, 0x0150, 0xd794,
-	0x0118, 0x9686, 0x0020, 0x0010, 0x9686, 0x0028, 0x0150, 0x0804,
-	0x4daf, 0x86ff, 0x1120, 0x7124, 0x810b, 0x0804, 0x3524, 0x7033,
-	0x0001, 0x7122, 0x7024, 0x9600, 0x7026, 0x772e, 0x2061, 0x18b8,
-	0x2c44, 0xa06b, 0x0000, 0xa67a, 0x7034, 0xa072, 0x7028, 0xa076,
-	0xa28e, 0xa392, 0xa496, 0xa59a, 0x080c, 0x10e9, 0x7007, 0x0002,
-	0x701f, 0x4e5b, 0x0005, 0x7030, 0x9005, 0x1180, 0x7120, 0x7028,
-	0x20a0, 0x772c, 0x9036, 0x7034, 0x20e8, 0x2061, 0x18b8, 0x2c44,
-	0xa28c, 0xa390, 0xa494, 0xa598, 0x0804, 0x4daf, 0x7124, 0x810b,
-	0x0804, 0x3524, 0x2029, 0x007e, 0x7984, 0x7a88, 0x7b8c, 0x7c98,
-	0x9184, 0xff00, 0x8007, 0x90e2, 0x0020, 0x0a04, 0x3559, 0x9502,
-	0x0a04, 0x3559, 0x9184, 0x00ff, 0x90e2, 0x0020, 0x0a04, 0x3559,
-	0x9502, 0x0a04, 0x3559, 0x9284, 0xff00, 0x8007, 0x90e2, 0x0020,
-	0x0a04, 0x3559, 0x9502, 0x0a04, 0x3559, 0x9284, 0x00ff, 0x90e2,
-	0x0020, 0x0a04, 0x3559, 0x9502, 0x0a04, 0x3559, 0x9384, 0xff00,
-	0x8007, 0x90e2, 0x0020, 0x0a04, 0x3559, 0x9502, 0x0a04, 0x3559,
-	0x9384, 0x00ff, 0x90e2, 0x0020, 0x0a04, 0x3559, 0x9502, 0x0a04,
-	0x3559, 0x9484, 0xff00, 0x8007, 0x90e2, 0x0020, 0x0a04, 0x3559,
-	0x9502, 0x0a04, 0x3559, 0x9484, 0x00ff, 0x90e2, 0x0020, 0x0a04,
-	0x3559, 0x9502, 0x0a04, 0x3559, 0x2061, 0x1989, 0x6102, 0x6206,
-	0x630a, 0x640e, 0x0804, 0x3524, 0x080c, 0x4aa4, 0x0904, 0x3556,
-	0x2009, 0x0016, 0x7a8c, 0x7b88, 0x7c9c, 0x7d98, 0xa85c, 0x9080,
-	0x0019, 0xaf60, 0x080c, 0x4aed, 0x701f, 0x4edf, 0x0005, 0x2001,
-	0x0138, 0x2003, 0x0000, 0x00e6, 0x2071, 0x0300, 0x701c, 0xd0a4,
-	0x1de8, 0x00ee, 0x20a9, 0x0016, 0x896e, 0x8d6e, 0x8d6f, 0x9d84,
-	0xffc0, 0x9080, 0x0019, 0x2098, 0x9d84, 0x003f, 0x20e0, 0x2069,
-	0x1877, 0x20e9, 0x0001, 0x2da0, 0x4003, 0x6800, 0x9005, 0x0904,
-	0x4f60, 0x6804, 0x2008, 0x918c, 0xfff8, 0x1904, 0x4f60, 0x680c,
-	0x9005, 0x0904, 0x4f60, 0x9082, 0xff01, 0x1a04, 0x4f60, 0x6810,
-	0x9082, 0x005c, 0x0a04, 0x4f60, 0x6824, 0x2008, 0x9082, 0x0008,
-	0x0a04, 0x4f60, 0x9182, 0x0400, 0x1a04, 0x4f60, 0x0056, 0x2029,
-	0x0000, 0x080c, 0x8afb, 0x005e, 0x6944, 0x6820, 0x9102, 0x06c0,
-	0x6820, 0x9082, 0x0019, 0x16a0, 0x6828, 0x6944, 0x810c, 0x9102,
-	0x0678, 0x6840, 0x9082, 0x000f, 0x1658, 0x080c, 0x1018, 0x2900,
-	0x0904, 0x4f7a, 0x684e, 0x00e6, 0x2071, 0x1930, 0x00b6, 0x2059,
-	0x0000, 0x080c, 0x89b7, 0x00be, 0x00ee, 0x0558, 0x080c, 0x8711,
-	0x080c, 0x8757, 0x11e0, 0x6857, 0x0000, 0x00c6, 0x2061, 0x0100,
-	0x6104, 0x918d, 0x2000, 0x6106, 0x6b10, 0x2061, 0x1a62, 0x630a,
-	0x00ce, 0x080c, 0x2956, 0x2001, 0x0138, 0x2102, 0x0804, 0x3524,
-	0x080c, 0x2956, 0x2001, 0x0138, 0x2102, 0x0804, 0x3559, 0x00e6,
-	0x2071, 0x1930, 0x080c, 0x8b8c, 0x080c, 0x8b9b, 0x080c, 0x89a6,
-	0x00ee, 0x2001, 0x188a, 0x204c, 0x080c, 0x1031, 0x2001, 0x188a,
-	0x2003, 0x0000, 0x080c, 0x2956, 0x2001, 0x0138, 0x2102, 0x0804,
-	0x3556, 0x2001, 0x1924, 0x200c, 0x918e, 0x0000, 0x0904, 0x4fd9,
-	0x080c, 0x89a1, 0x0904, 0x4fd9, 0x2001, 0x0101, 0x200c, 0x918c,
-	0xdfff, 0x2102, 0x2001, 0x0138, 0x2003, 0x0000, 0x00e6, 0x2071,
-	0x0300, 0x701c, 0xd0a4, 0x1de8, 0x00ee, 0x080c, 0x89a6, 0x2001,
-	0x0035, 0x080c, 0x15ee, 0x00c6, 0x2061, 0x193c, 0x6004, 0x6100,
-	0x9106, 0x1de0, 0x00ce, 0x080c, 0x2956, 0x2001, 0x0138, 0x2102,
-	0x00e6, 0x00f6, 0x2071, 0x1923, 0x080c, 0x88e2, 0x0120, 0x2f00,
-	0x080c, 0x896c, 0x0cc8, 0x00fe, 0x00ee, 0x0126, 0x2091, 0x8000,
-	0x2001, 0x188a, 0x200c, 0x81ff, 0x0138, 0x2148, 0x080c, 0x1031,
-	0x2001, 0x188a, 0x2003, 0x0000, 0x2001, 0x183c, 0x2003, 0x0020,
-	0x00e6, 0x2071, 0x1930, 0x080c, 0x8b8c, 0x080c, 0x8b9b, 0x00ee,
-	0x012e, 0x0804, 0x3524, 0x0006, 0x080c, 0x56cf, 0xd0cc, 0x000e,
-	0x0005, 0x0006, 0x080c, 0x56d3, 0xd0bc, 0x000e, 0x0005, 0x6174,
-	0x7a84, 0x6300, 0x82ff, 0x1118, 0x7986, 0x0804, 0x3524, 0x83ff,
-	0x1904, 0x3559, 0x2001, 0xfff0, 0x9200, 0x1a04, 0x3559, 0x2019,
-	0xffff, 0x6078, 0x9302, 0x9200, 0x0a04, 0x3559, 0x7986, 0x6276,
-	0x0804, 0x3524, 0x080c, 0x56e3, 0x1904, 0x3556, 0x7c88, 0x7d84,
-	0x7e98, 0x7f8c, 0x080c, 0x4aa4, 0x0904, 0x3556, 0x900e, 0x901e,
-	0x7326, 0x7332, 0xa860, 0x20e8, 0x7036, 0xa85c, 0x9080, 0x0003,
-	0x702a, 0x20a0, 0x91d8, 0x1000, 0x2b5c, 0x8bff, 0x0178, 0x080c,
-	0x6972, 0x0118, 0x080c, 0x697a, 0x1148, 0x20a9, 0x0001, 0xb814,
+	0x0002, 0x4c8c, 0x4c8c, 0x4c8e, 0x4c8c, 0x4c8c, 0x4c8c, 0x4c93,
+	0x4c8c, 0x4c8c, 0x4c8c, 0x4c98, 0x4c8c, 0x4c8c, 0x4c8c, 0x4c9d,
+	0x4c8c, 0x4c8c, 0x4c8c, 0x4ca2, 0x4c8c, 0x4c8c, 0x4c8c, 0x4ca7,
+	0x4c8c, 0x4c8c, 0x4c8c, 0x4cac, 0x080c, 0x0dd5, 0xaa74, 0xab78,
+	0xac7c, 0x0804, 0x4c18, 0xaa84, 0xab88, 0xac8c, 0x0804, 0x4c18,
+	0xaa94, 0xab98, 0xac9c, 0x0804, 0x4c18, 0xaaa4, 0xaba8, 0xacac,
+	0x0804, 0x4c18, 0xaab4, 0xabb8, 0xacbc, 0x0804, 0x4c18, 0xaac4,
+	0xabc8, 0xaccc, 0x0804, 0x4c18, 0xaad4, 0xabd8, 0xacdc, 0x0804,
+	0x4c18, 0x0016, 0x0026, 0x0036, 0x00b6, 0x00c6, 0x2009, 0x007e,
+	0x080c, 0x6608, 0x2019, 0x0001, 0xb85c, 0xd0ac, 0x0110, 0x2019,
+	0x0000, 0x2011, 0x801b, 0x080c, 0x4b14, 0x00ce, 0x00be, 0x003e,
+	0x002e, 0x001e, 0x0005, 0x0026, 0x080c, 0x56d8, 0xd0c4, 0x0120,
+	0x2011, 0x8014, 0x080c, 0x4b14, 0x002e, 0x0005, 0x81ff, 0x1904,
+	0x3558, 0x0126, 0x2091, 0x8000, 0x6030, 0xc08d, 0xc085, 0xc0ac,
+	0x6032, 0x080c, 0x73a5, 0x1158, 0x080c, 0x768d, 0x080c, 0x6023,
+	0x9085, 0x0001, 0x080c, 0x73ec, 0x080c, 0x72d7, 0x0010, 0x080c,
+	0x5ee2, 0x012e, 0x0804, 0x3526, 0x81ff, 0x0120, 0x2009, 0x0001,
+	0x0804, 0x3558, 0x080c, 0x56ec, 0x0120, 0x2009, 0x0007, 0x0804,
+	0x3558, 0x080c, 0x6973, 0x0120, 0x2009, 0x0008, 0x0804, 0x3558,
+	0x7984, 0x080c, 0x65a7, 0x1904, 0x355b, 0x2b00, 0x7026, 0x080c,
+	0x697b, 0x7888, 0x1170, 0x9084, 0x0005, 0x1158, 0x900e, 0x080c,
+	0x6828, 0x1108, 0xc185, 0xb800, 0xd0bc, 0x0108, 0xc18d, 0x0804,
+	0x3526, 0x080c, 0x4ab4, 0x0904, 0x3558, 0x9006, 0xa866, 0xa832,
+	0xa868, 0xc0fd, 0xa86a, 0x080c, 0xcd72, 0x0904, 0x3558, 0x7888,
+	0xd094, 0x0118, 0xb8cc, 0xc08d, 0xb8ce, 0x7007, 0x0003, 0x701f,
+	0x4d86, 0x0005, 0x2061, 0x1800, 0x080c, 0x56ec, 0x2009, 0x0007,
+	0x1578, 0x080c, 0x6973, 0x0118, 0x2009, 0x0008, 0x0448, 0x080c,
+	0x3316, 0x0120, 0xa998, 0x080c, 0x65a7, 0x1530, 0x080c, 0x4ae5,
+	0x0518, 0x080c, 0x697b, 0xa89c, 0x1168, 0x9084, 0x0005, 0x1150,
+	0x900e, 0x080c, 0x6828, 0x1108, 0xc185, 0xb800, 0xd0bc, 0x0108,
+	0xc18d, 0x00d0, 0xa868, 0xc0fc, 0xa86a, 0x080c, 0xcd72, 0x11e0,
+	0xa89c, 0xd094, 0x0118, 0xb8cc, 0xc08d, 0xb8ce, 0x2009, 0x0003,
+	0xa897, 0x4005, 0xa99a, 0x0010, 0xa897, 0x4006, 0x900e, 0x9085,
+	0x0001, 0x2001, 0x0030, 0x0005, 0xa897, 0x4000, 0xa99a, 0x9006,
+	0x918d, 0x0001, 0x2008, 0x0005, 0x9006, 0x0005, 0xa830, 0x9086,
+	0x0100, 0x7024, 0x2058, 0x1110, 0x0804, 0x5635, 0x900e, 0x080c,
+	0x6828, 0x1108, 0xc185, 0xb800, 0xd0bc, 0x0108, 0xc18d, 0x0804,
+	0x3526, 0x080c, 0x56ec, 0x0120, 0x2009, 0x0007, 0x0804, 0x3558,
+	0x7f84, 0x7a8c, 0x7b88, 0x7c9c, 0x7d98, 0x080c, 0x4ab4, 0x1120,
+	0x2009, 0x0002, 0x0804, 0x3558, 0x900e, 0x2130, 0x7126, 0x7132,
+	0xa860, 0x20e8, 0x7036, 0xa85c, 0x9080, 0x0005, 0x702a, 0x20a0,
+	0x080c, 0x6608, 0x1904, 0x4e28, 0x080c, 0x697b, 0x0138, 0x080c,
+	0x6983, 0x0120, 0x080c, 0x691b, 0x1904, 0x4e28, 0xd794, 0x1110,
+	0xd784, 0x01a8, 0xb8c4, 0x20e0, 0xb8c8, 0x9080, 0x0006, 0x2098,
+	0x3400, 0xd794, 0x0160, 0x20a9, 0x0008, 0x4003, 0x2098, 0x20a0,
+	0x3d00, 0x20e0, 0x20a9, 0x0002, 0x080c, 0x48b3, 0x0048, 0x20a9,
+	0x0004, 0x4003, 0x2098, 0x20a0, 0x3d00, 0x20e0, 0x080c, 0x48b3,
+	0x9186, 0x007e, 0x0170, 0x9186, 0x0080, 0x0158, 0x080c, 0x697b,
+	0x90c2, 0x0006, 0x1210, 0xc1fd, 0x0020, 0x080c, 0x6828, 0x1108,
+	0xc1fd, 0x4104, 0xc1fc, 0xd794, 0x0528, 0xb8c4, 0x20e0, 0xb8c8,
+	0x2060, 0x9c80, 0x0000, 0x2098, 0x20a9, 0x0002, 0x4003, 0x9c80,
+	0x0003, 0x2098, 0x20a9, 0x0001, 0x4005, 0x9c80, 0x0004, 0x2098,
+	0x3400, 0x20a9, 0x0002, 0x4003, 0x2098, 0x20a0, 0x3d00, 0x20e0,
+	0x080c, 0x48a6, 0x9c80, 0x0026, 0x2098, 0xb8c4, 0x20e0, 0x20a9,
+	0x0002, 0x4003, 0xd794, 0x0110, 0x96b0, 0x000b, 0x96b0, 0x0005,
+	0x8108, 0x080c, 0xaddb, 0x0118, 0x9186, 0x0800, 0x0040, 0xd78c,
+	0x0120, 0x9186, 0x0800, 0x0170, 0x0018, 0x9186, 0x007e, 0x0150,
+	0xd794, 0x0118, 0x9686, 0x0020, 0x0010, 0x9686, 0x0028, 0x0150,
+	0x0804, 0x4db8, 0x86ff, 0x1120, 0x7124, 0x810b, 0x0804, 0x3526,
+	0x7033, 0x0001, 0x7122, 0x7024, 0x9600, 0x7026, 0x772e, 0x2061,
+	0x18b8, 0x2c44, 0xa06b, 0x0000, 0xa67a, 0x7034, 0xa072, 0x7028,
+	0xa076, 0xa28e, 0xa392, 0xa496, 0xa59a, 0x080c, 0x10e9, 0x7007,
+	0x0002, 0x701f, 0x4e64, 0x0005, 0x7030, 0x9005, 0x1180, 0x7120,
+	0x7028, 0x20a0, 0x772c, 0x9036, 0x7034, 0x20e8, 0x2061, 0x18b8,
+	0x2c44, 0xa28c, 0xa390, 0xa494, 0xa598, 0x0804, 0x4db8, 0x7124,
+	0x810b, 0x0804, 0x3526, 0x2029, 0x007e, 0x7984, 0x7a88, 0x7b8c,
+	0x7c98, 0x9184, 0xff00, 0x8007, 0x90e2, 0x0020, 0x0a04, 0x355b,
+	0x9502, 0x0a04, 0x355b, 0x9184, 0x00ff, 0x90e2, 0x0020, 0x0a04,
+	0x355b, 0x9502, 0x0a04, 0x355b, 0x9284, 0xff00, 0x8007, 0x90e2,
+	0x0020, 0x0a04, 0x355b, 0x9502, 0x0a04, 0x355b, 0x9284, 0x00ff,
+	0x90e2, 0x0020, 0x0a04, 0x355b, 0x9502, 0x0a04, 0x355b, 0x9384,
+	0xff00, 0x8007, 0x90e2, 0x0020, 0x0a04, 0x355b, 0x9502, 0x0a04,
+	0x355b, 0x9384, 0x00ff, 0x90e2, 0x0020, 0x0a04, 0x355b, 0x9502,
+	0x0a04, 0x355b, 0x9484, 0xff00, 0x8007, 0x90e2, 0x0020, 0x0a04,
+	0x355b, 0x9502, 0x0a04, 0x355b, 0x9484, 0x00ff, 0x90e2, 0x0020,
+	0x0a04, 0x355b, 0x9502, 0x0a04, 0x355b, 0x2061, 0x1988, 0x6102,
+	0x6206, 0x630a, 0x640e, 0x0804, 0x3526, 0x080c, 0x4ab4, 0x0904,
+	0x3558, 0x2009, 0x0016, 0x7a8c, 0x7b88, 0x7c9c, 0x7d98, 0xa85c,
+	0x9080, 0x0019, 0xaf60, 0x080c, 0x4afd, 0x701f, 0x4ee8, 0x0005,
+	0x2001, 0x0138, 0x2003, 0x0000, 0x00e6, 0x2071, 0x0300, 0x701c,
+	0xd0a4, 0x1de8, 0x00ee, 0x20a9, 0x0016, 0x896e, 0x8d6e, 0x8d6f,
+	0x9d84, 0xffc0, 0x9080, 0x0019, 0x2098, 0x9d84, 0x003f, 0x20e0,
+	0x2069, 0x1877, 0x20e9, 0x0001, 0x2da0, 0x4003, 0x6800, 0x9005,
+	0x0904, 0x4f69, 0x6804, 0x2008, 0x918c, 0xfff8, 0x1904, 0x4f69,
+	0x680c, 0x9005, 0x0904, 0x4f69, 0x9082, 0xff01, 0x1a04, 0x4f69,
+	0x6810, 0x9082, 0x005c, 0x0a04, 0x4f69, 0x6824, 0x2008, 0x9082,
+	0x0008, 0x0a04, 0x4f69, 0x9182, 0x0400, 0x1a04, 0x4f69, 0x0056,
+	0x2029, 0x0000, 0x080c, 0x8ae4, 0x005e, 0x6944, 0x6820, 0x9102,
+	0x06c0, 0x6820, 0x9082, 0x0019, 0x16a0, 0x6828, 0x6944, 0x810c,
+	0x9102, 0x0678, 0x6840, 0x9082, 0x000f, 0x1658, 0x080c, 0x1018,
+	0x2900, 0x0904, 0x4f83, 0x684e, 0x00e6, 0x2071, 0x1930, 0x00b6,
+	0x2059, 0x0000, 0x080c, 0x89a0, 0x00be, 0x00ee, 0x0558, 0x080c,
+	0x86fa, 0x080c, 0x8740, 0x11e0, 0x6857, 0x0000, 0x00c6, 0x2061,
+	0x0100, 0x6104, 0x918d, 0x2000, 0x6106, 0x6b10, 0x2061, 0x1a61,
+	0x630a, 0x00ce, 0x080c, 0x2958, 0x2001, 0x0138, 0x2102, 0x0804,
+	0x3526, 0x080c, 0x2958, 0x2001, 0x0138, 0x2102, 0x0804, 0x355b,
+	0x00e6, 0x2071, 0x1930, 0x080c, 0x8b75, 0x080c, 0x8b84, 0x080c,
+	0x898f, 0x00ee, 0x2001, 0x188a, 0x204c, 0x080c, 0x1031, 0x2001,
+	0x188a, 0x2003, 0x0000, 0x080c, 0x2958, 0x2001, 0x0138, 0x2102,
+	0x0804, 0x3558, 0x2001, 0x1924, 0x200c, 0x918e, 0x0000, 0x0904,
+	0x4fe2, 0x080c, 0x898a, 0x0904, 0x4fe2, 0x2001, 0x0101, 0x200c,
+	0x918c, 0xdfff, 0x2102, 0x2001, 0x0138, 0x2003, 0x0000, 0x00e6,
+	0x2071, 0x0300, 0x701c, 0xd0a4, 0x1de8, 0x00ee, 0x080c, 0x898f,
+	0x2001, 0x0035, 0x080c, 0x15f0, 0x00c6, 0x2061, 0x193c, 0x6004,
+	0x6100, 0x9106, 0x1de0, 0x00ce, 0x080c, 0x2958, 0x2001, 0x0138,
+	0x2102, 0x00e6, 0x00f6, 0x2071, 0x1923, 0x080c, 0x88cb, 0x0120,
+	0x2f00, 0x080c, 0x8955, 0x0cc8, 0x00fe, 0x00ee, 0x0126, 0x2091,
+	0x8000, 0x2001, 0x188a, 0x200c, 0x81ff, 0x0138, 0x2148, 0x080c,
+	0x1031, 0x2001, 0x188a, 0x2003, 0x0000, 0x2001, 0x183c, 0x2003,
+	0x0020, 0x00e6, 0x2071, 0x1930, 0x080c, 0x8b75, 0x080c, 0x8b84,
+	0x00ee, 0x012e, 0x0804, 0x3526, 0x0006, 0x080c, 0x56d8, 0xd0cc,
+	0x000e, 0x0005, 0x0006, 0x080c, 0x56dc, 0xd0bc, 0x000e, 0x0005,
+	0x6174, 0x7a84, 0x6300, 0x82ff, 0x1118, 0x7986, 0x0804, 0x3526,
+	0x83ff, 0x1904, 0x355b, 0x2001, 0xfff0, 0x9200, 0x1a04, 0x355b,
+	0x2019, 0xffff, 0x6078, 0x9302, 0x9200, 0x0a04, 0x355b, 0x7986,
+	0x6276, 0x0804, 0x3526, 0x080c, 0x56ec, 0x1904, 0x3558, 0x7c88,
+	0x7d84, 0x7e98, 0x7f8c, 0x080c, 0x4ab4, 0x0904, 0x3558, 0x900e,
+	0x901e, 0x7326, 0x7332, 0xa860, 0x20e8, 0x7036, 0xa85c, 0x9080,
+	0x0003, 0x702a, 0x20a0, 0x91d8, 0x1000, 0x2b5c, 0x8bff, 0x0178,
+	0x080c, 0x697b, 0x0118, 0x080c, 0x6983, 0x1148, 0x20a9, 0x0001,
+	0xb814, 0x4004, 0xb810, 0x4004, 0x4104, 0x9398, 0x0003, 0x8108,
+	0x9182, 0x0800, 0x0120, 0x9386, 0x003c, 0x0170, 0x0c20, 0x83ff,
+	0x1148, 0x7224, 0x900e, 0x2001, 0x0003, 0x080c, 0x8f51, 0x2208,
+	0x0804, 0x3526, 0x7033, 0x0001, 0x7122, 0x7024, 0x9300, 0x7026,
+	0x2061, 0x18b8, 0x2c44, 0xa06b, 0x0000, 0xa37a, 0x7028, 0xa076,
+	0x7034, 0xa072, 0xa48e, 0xa592, 0xa696, 0xa79a, 0x080c, 0x10e9,
+	0x7007, 0x0002, 0x701f, 0x5065, 0x0005, 0x7030, 0x9005, 0x1178,
+	0x7120, 0x7028, 0x20a0, 0x901e, 0x7034, 0x20e8, 0x2061, 0x18b8,
+	0x2c44, 0xa48c, 0xa590, 0xa694, 0xa798, 0x0804, 0x5023, 0x7224,
+	0x900e, 0x2001, 0x0003, 0x080c, 0x8f51, 0x2208, 0x0804, 0x3526,
+	0x00f6, 0x00e6, 0x080c, 0x56ec, 0x2009, 0x0007, 0x1904, 0x50f8,
+	0x2071, 0x189e, 0x745c, 0x84ff, 0x2009, 0x000e, 0x1904, 0x50f8,
+	0xac9c, 0xad98, 0xaea4, 0xafa0, 0x0096, 0x080c, 0x1018, 0x2009,
+	0x0002, 0x0904, 0x50f8, 0x2900, 0x705e, 0x900e, 0x901e, 0x7356,
+	0x7362, 0xa860, 0x7066, 0xa85c, 0x9080, 0x0003, 0x705a, 0x20a0,
+	0x91d8, 0x1000, 0x2b5c, 0x8bff, 0x0178, 0x080c, 0x697b, 0x0118,
+	0x080c, 0x6983, 0x1148, 0xb814, 0x20a9, 0x0001, 0x4004, 0xb810,
+	0x4004, 0x4104, 0x9398, 0x0003, 0x8108, 0x9182, 0x0800, 0x0120,
+	0x9386, 0x003c, 0x01e8, 0x0c20, 0x83ff, 0x11c0, 0x7254, 0x900e,
+	0x2001, 0x0003, 0x080c, 0x8f51, 0x2208, 0x009e, 0xa897, 0x4000,
+	0xa99a, 0x715c, 0x81ff, 0x090c, 0x0dd5, 0x2148, 0x080c, 0x1031,
+	0x9006, 0x705e, 0x918d, 0x0001, 0x2008, 0x0418, 0x7063, 0x0001,
+	0x7152, 0x7054, 0x9300, 0x7056, 0x2061, 0x18b9, 0x2c44, 0xa37a,
+	0x7058, 0xa076, 0x7064, 0xa072, 0xa48e, 0xa592, 0xa696, 0xa79a,
+	0xa09f, 0x5104, 0x000e, 0xa0a2, 0x080c, 0x10e9, 0x9006, 0x0048,
+	0x009e, 0xa897, 0x4005, 0xa99a, 0x900e, 0x9085, 0x0001, 0x2001,
+	0x0030, 0x00ee, 0x00fe, 0x0005, 0x00f6, 0xa0a0, 0x904d, 0x090c,
+	0x0dd5, 0x00e6, 0x2071, 0x189e, 0xa06c, 0x908e, 0x0100, 0x0138,
+	0xa87b, 0x0030, 0xa883, 0x0000, 0xa897, 0x4002, 0x00d8, 0x7060,
+	0x9005, 0x1158, 0x7150, 0x7058, 0x20a0, 0x901e, 0x7064, 0x20e8,
+	0xa48c, 0xa590, 0xa694, 0xa798, 0x0428, 0xa87b, 0x0000, 0xa883,
+	0x0000, 0xa897, 0x4000, 0x7254, 0x900e, 0x2001, 0x0003, 0x080c,
+	0x8f51, 0xaa9a, 0x715c, 0x81ff, 0x090c, 0x0dd5, 0x2148, 0x080c,
+	0x1031, 0x705f, 0x0000, 0xa0a0, 0x2048, 0x0126, 0x2091, 0x8000,
+	0x080c, 0x6c86, 0x012e, 0xa09f, 0x0000, 0xa0a3, 0x0000, 0x00ee,
+	0x00fe, 0x0005, 0x91d8, 0x1000, 0x2b5c, 0x8bff, 0x0178, 0x080c,
+	0x697b, 0x0118, 0x080c, 0x6983, 0x1148, 0xb814, 0x20a9, 0x0001,
 	0x4004, 0xb810, 0x4004, 0x4104, 0x9398, 0x0003, 0x8108, 0x9182,
-	0x0800, 0x0120, 0x9386, 0x003c, 0x0170, 0x0c20, 0x83ff, 0x1148,
-	0x7224, 0x900e, 0x2001, 0x0003, 0x080c, 0x8f68, 0x2208, 0x0804,
-	0x3524, 0x7033, 0x0001, 0x7122, 0x7024, 0x9300, 0x7026, 0x2061,
-	0x18b8, 0x2c44, 0xa06b, 0x0000, 0xa37a, 0x7028, 0xa076, 0x7034,
-	0xa072, 0xa48e, 0xa592, 0xa696, 0xa79a, 0x080c, 0x10e9, 0x7007,
-	0x0002, 0x701f, 0x505c, 0x0005, 0x7030, 0x9005, 0x1178, 0x7120,
-	0x7028, 0x20a0, 0x901e, 0x7034, 0x20e8, 0x2061, 0x18b8, 0x2c44,
-	0xa48c, 0xa590, 0xa694, 0xa798, 0x0804, 0x501a, 0x7224, 0x900e,
-	0x2001, 0x0003, 0x080c, 0x8f68, 0x2208, 0x0804, 0x3524, 0x00f6,
-	0x00e6, 0x080c, 0x56e3, 0x2009, 0x0007, 0x1904, 0x50ef, 0x2071,
-	0x189e, 0x745c, 0x84ff, 0x2009, 0x000e, 0x1904, 0x50ef, 0xac9c,
-	0xad98, 0xaea4, 0xafa0, 0x0096, 0x080c, 0x1018, 0x2009, 0x0002,
-	0x0904, 0x50ef, 0x2900, 0x705e, 0x900e, 0x901e, 0x7356, 0x7362,
-	0xa860, 0x7066, 0xa85c, 0x9080, 0x0003, 0x705a, 0x20a0, 0x91d8,
-	0x1000, 0x2b5c, 0x8bff, 0x0178, 0x080c, 0x6972, 0x0118, 0x080c,
-	0x697a, 0x1148, 0xb814, 0x20a9, 0x0001, 0x4004, 0xb810, 0x4004,
-	0x4104, 0x9398, 0x0003, 0x8108, 0x9182, 0x0800, 0x0120, 0x9386,
-	0x003c, 0x01e8, 0x0c20, 0x83ff, 0x11c0, 0x7254, 0x900e, 0x2001,
-	0x0003, 0x080c, 0x8f68, 0x2208, 0x009e, 0xa897, 0x4000, 0xa99a,
-	0x715c, 0x81ff, 0x090c, 0x0dd5, 0x2148, 0x080c, 0x1031, 0x9006,
-	0x705e, 0x918d, 0x0001, 0x2008, 0x0418, 0x7063, 0x0001, 0x7152,
-	0x7054, 0x9300, 0x7056, 0x2061, 0x18b9, 0x2c44, 0xa37a, 0x7058,
-	0xa076, 0x7064, 0xa072, 0xa48e, 0xa592, 0xa696, 0xa79a, 0xa09f,
-	0x50fb, 0x000e, 0xa0a2, 0x080c, 0x10e9, 0x9006, 0x0048, 0x009e,
-	0xa897, 0x4005, 0xa99a, 0x900e, 0x9085, 0x0001, 0x2001, 0x0030,
-	0x00ee, 0x00fe, 0x0005, 0x00f6, 0xa0a0, 0x904d, 0x090c, 0x0dd5,
-	0x00e6, 0x2071, 0x189e, 0xa06c, 0x908e, 0x0100, 0x0138, 0xa87b,
-	0x0030, 0xa883, 0x0000, 0xa897, 0x4002, 0x00d8, 0x7060, 0x9005,
-	0x1158, 0x7150, 0x7058, 0x20a0, 0x901e, 0x7064, 0x20e8, 0xa48c,
-	0xa590, 0xa694, 0xa798, 0x0428, 0xa87b, 0x0000, 0xa883, 0x0000,
-	0xa897, 0x4000, 0x7254, 0x900e, 0x2001, 0x0003, 0x080c, 0x8f68,
-	0xaa9a, 0x715c, 0x81ff, 0x090c, 0x0dd5, 0x2148, 0x080c, 0x1031,
-	0x705f, 0x0000, 0xa0a0, 0x2048, 0x0126, 0x2091, 0x8000, 0x080c,
-	0x6c81, 0x012e, 0xa09f, 0x0000, 0xa0a3, 0x0000, 0x00ee, 0x00fe,
-	0x0005, 0x91d8, 0x1000, 0x2b5c, 0x8bff, 0x0178, 0x080c, 0x6972,
-	0x0118, 0x080c, 0x697a, 0x1148, 0xb814, 0x20a9, 0x0001, 0x4004,
-	0xb810, 0x4004, 0x4104, 0x9398, 0x0003, 0x8108, 0x9182, 0x0800,
-	0x0120, 0x9386, 0x003c, 0x0518, 0x0c20, 0x83ff, 0x11f0, 0x7154,
-	0x810c, 0xa99a, 0xa897, 0x4000, 0x715c, 0x81ff, 0x090c, 0x0dd5,
-	0x2148, 0x080c, 0x1031, 0x9006, 0x705e, 0x918d, 0x0001, 0x2008,
-	0xa0a0, 0x2048, 0x0126, 0x2091, 0x8000, 0x080c, 0x6c81, 0x012e,
-	0xa09f, 0x0000, 0xa0a3, 0x0000, 0x0070, 0x7063, 0x0001, 0x7152,
-	0x7054, 0x9300, 0x7056, 0xa37a, 0xa48e, 0xa592, 0xa696, 0xa79a,
-	0x080c, 0x10e9, 0x9006, 0x00ee, 0x0005, 0x0096, 0xa88c, 0x90be,
-	0x7000, 0x0148, 0x90be, 0x7100, 0x0130, 0x90be, 0x7200, 0x0118,
-	0x009e, 0x0804, 0x3559, 0xa884, 0xa988, 0x080c, 0x283e, 0x1518,
-	0x080c, 0x659e, 0x1500, 0x7126, 0xbe12, 0xbd16, 0xae7c, 0x080c,
-	0x4aa4, 0x01c8, 0x080c, 0x4aa4, 0x01b0, 0x009e, 0xa867, 0x0000,
-	0xa868, 0xc0fd, 0xa86a, 0xa823, 0x0000, 0xa804, 0x2048, 0x080c,
-	0xccdf, 0x1120, 0x2009, 0x0003, 0x0804, 0x3556, 0x7007, 0x0003,
-	0x701f, 0x51c8, 0x0005, 0x009e, 0x2009, 0x0002, 0x0804, 0x3556,
-	0x7124, 0x080c, 0x32bb, 0xa820, 0x9086, 0x8001, 0x1120, 0x2009,
-	0x0004, 0x0804, 0x3556, 0x2900, 0x7022, 0xa804, 0x0096, 0x2048,
-	0x8906, 0x8006, 0x8007, 0x90bc, 0x003f, 0x9084, 0xffc0, 0x009e,
-	0x9080, 0x0002, 0x0076, 0x0006, 0x2098, 0x20a0, 0x27e0, 0x27e8,
-	0x20a9, 0x002a, 0x080c, 0x0f7c, 0xaa6c, 0xab70, 0xac74, 0xad78,
-	0x2061, 0x18b8, 0x2c44, 0xa06b, 0x0000, 0xae64, 0xaf8c, 0x97c6,
-	0x7000, 0x0118, 0x97c6, 0x7100, 0x1148, 0x96c2, 0x0004, 0x0600,
-	0x2009, 0x0004, 0x000e, 0x007e, 0x0804, 0x4af0, 0x97c6, 0x7200,
-	0x11b8, 0x96c2, 0x0054, 0x02a0, 0x000e, 0x007e, 0x2061, 0x18b8,
-	0x2c44, 0xa076, 0xa772, 0xa07b, 0x002a, 0xa28e, 0xa392, 0xa496,
-	0xa59a, 0x080c, 0x10e9, 0x7007, 0x0002, 0x701f, 0x5224, 0x0005,
-	0x000e, 0x007e, 0x0804, 0x3559, 0x7020, 0x2048, 0xa804, 0x2048,
-	0xa804, 0x2048, 0x8906, 0x8006, 0x8007, 0x90bc, 0x003f, 0x9084,
-	0xffc0, 0x9080, 0x0002, 0x2098, 0x20a0, 0x27e0, 0x27e8, 0x20a9,
-	0x002a, 0x080c, 0x0f7c, 0x2100, 0x2238, 0x2061, 0x18b8, 0x2c44,
-	0xa28c, 0xa390, 0xa494, 0xa598, 0x2009, 0x002a, 0x0804, 0x4af0,
-	0x81ff, 0x1904, 0x3556, 0x798c, 0x2001, 0x197e, 0x918c, 0x8000,
-	0x2102, 0x080c, 0x4abb, 0x0904, 0x3559, 0x080c, 0x6972, 0x0120,
-	0x080c, 0x697a, 0x1904, 0x3559, 0x080c, 0x66c6, 0x0904, 0x3556,
-	0x0126, 0x2091, 0x8000, 0x080c, 0x678c, 0x012e, 0x0904, 0x3556,
-	0x2001, 0x197e, 0x2004, 0xd0fc, 0x1904, 0x3524, 0x0804, 0x451c,
-	0xa9a0, 0x2001, 0x197e, 0x918c, 0x8000, 0xc18d, 0x2102, 0x080c,
-	0x4ac8, 0x01a0, 0x080c, 0x6972, 0x0118, 0x080c, 0x697a, 0x1170,
-	0x080c, 0x66c6, 0x2009, 0x0002, 0x0128, 0x080c, 0x678c, 0x1170,
-	0x2009, 0x0003, 0xa897, 0x4005, 0xa99a, 0x0010, 0xa897, 0x4006,
-	0x900e, 0x9085, 0x0001, 0x2001, 0x0030, 0x0005, 0xa897, 0x4000,
-	0x2001, 0x197e, 0x2004, 0xd0fc, 0x1128, 0x080c, 0x56d7, 0x0110,
-	0x9006, 0x0018, 0x900e, 0x9085, 0x0001, 0x2001, 0x0000, 0x0005,
-	0x78a8, 0xd08c, 0x1118, 0xd084, 0x0904, 0x4491, 0x080c, 0x4ad7,
-	0x0904, 0x3559, 0x080c, 0x4aa4, 0x1120, 0x2009, 0x0002, 0x0804,
-	0x3556, 0x080c, 0x6972, 0x0130, 0x908e, 0x0004, 0x0118, 0x908e,
-	0x0005, 0x15a0, 0x78a8, 0xd08c, 0x0120, 0xb800, 0xc08c, 0xb802,
-	0x0028, 0x080c, 0x56cf, 0xd0b4, 0x0904, 0x44cb, 0x7884, 0x908e,
-	0x007e, 0x0904, 0x44cb, 0x908e, 0x007f, 0x0904, 0x44cb, 0x908e,
-	0x0080, 0x0904, 0x44cb, 0xb800, 0xd08c, 0x1904, 0x44cb, 0xa867,
-	0x0000, 0xa868, 0xc0fd, 0xa86a, 0x080c, 0xccfe, 0x1120, 0x2009,
-	0x0003, 0x0804, 0x3556, 0x7007, 0x0003, 0x701f, 0x52f0, 0x0005,
-	0x080c, 0x4ad7, 0x0904, 0x3559, 0x0804, 0x44cb, 0x080c, 0x3314,
-	0x0108, 0x0005, 0x2009, 0x1834, 0x210c, 0x81ff, 0x0120, 0x2009,
-	0x0001, 0x0804, 0x3556, 0x080c, 0x56e3, 0x0120, 0x2009, 0x0007,
-	0x0804, 0x3556, 0x080c, 0x696a, 0x0120, 0x2009, 0x0008, 0x0804,
-	0x3556, 0xb89c, 0xd0a4, 0x1118, 0xd0ac, 0x1904, 0x44cb, 0x9006,
-	0xa866, 0xa832, 0xa868, 0xc0fd, 0xa86a, 0x080c, 0xcd58, 0x1120,
-	0x2009, 0x0003, 0x0804, 0x3556, 0x7007, 0x0003, 0x701f, 0x5329,
-	0x0005, 0xa830, 0x9086, 0x0100, 0x1120, 0x2009, 0x0004, 0x0804,
-	0x562c, 0x080c, 0x4ad7, 0x0904, 0x3559, 0x0804, 0x52c2, 0x81ff,
-	0x2009, 0x0001, 0x1904, 0x3556, 0x080c, 0x56e3, 0x2009, 0x0007,
-	0x1904, 0x3556, 0x080c, 0x696a, 0x0120, 0x2009, 0x0008, 0x0804,
-	0x3556, 0x080c, 0x4ad7, 0x0904, 0x3559, 0x080c, 0x6972, 0x2009,
-	0x0009, 0x1904, 0x3556, 0x080c, 0x4aa4, 0x2009, 0x0002, 0x0904,
-	0x3556, 0x9006, 0xa866, 0xa832, 0xa868, 0xc0fd, 0xa86a, 0x7988,
-	0x9194, 0xff00, 0x918c, 0x00ff, 0x9006, 0x82ff, 0x1128, 0xc0ed,
-	0xa952, 0x798c, 0xa956, 0x0038, 0x928e, 0x0100, 0x1904, 0x3559,
-	0xc0e5, 0xa952, 0xa956, 0xa83e, 0x080c, 0xcfab, 0x2009, 0x0003,
-	0x0904, 0x3556, 0x7007, 0x0003, 0x701f, 0x537f, 0x0005, 0xa830,
-	0x9086, 0x0100, 0x2009, 0x0004, 0x0904, 0x3556, 0x0804, 0x3524,
-	0x7aa8, 0x9284, 0xc000, 0x0148, 0xd2ec, 0x01a0, 0x080c, 0x56e3,
-	0x1188, 0x2009, 0x0014, 0x0804, 0x3556, 0xd2dc, 0x1568, 0x81ff,
-	0x2009, 0x0001, 0x1904, 0x3556, 0x080c, 0x56e3, 0x2009, 0x0007,
-	0x1904, 0x3556, 0xd2f4, 0x0130, 0x9284, 0x5000, 0x080c, 0x56aa,
-	0x0804, 0x3524, 0xd2fc, 0x0158, 0x080c, 0x4ad7, 0x0904, 0x3559,
-	0x7984, 0x9284, 0x9000, 0x080c, 0x5687, 0x0804, 0x3524, 0x080c,
-	0x4ad7, 0x0904, 0x3559, 0xb804, 0x9084, 0x00ff, 0x9086, 0x0006,
-	0x2009, 0x0009, 0x1904, 0x5468, 0x080c, 0x4aa4, 0x2009, 0x0002,
-	0x0904, 0x5468, 0xa85c, 0x9080, 0x001b, 0xaf60, 0x2009, 0x0008,
-	0x7a8c, 0x7b88, 0x7c9c, 0x7d98, 0x080c, 0x4aed, 0x701f, 0x53d9,
-	0x0005, 0xa86c, 0x9086, 0x0500, 0x1138, 0xa870, 0x9005, 0x1120,
-	0xa874, 0x9084, 0xff00, 0x0110, 0x1904, 0x3559, 0xa866, 0xa832,
-	0xa868, 0xc0fd, 0xa86a, 0x080c, 0x4ad7, 0x1110, 0x0804, 0x3559,
-	0x2009, 0x0043, 0x080c, 0xd013, 0x2009, 0x0003, 0x0904, 0x5468,
-	0x7007, 0x0003, 0x701f, 0x53fd, 0x0005, 0xa830, 0x9086, 0x0100,
-	0x2009, 0x0004, 0x0904, 0x5468, 0x7984, 0x7aa8, 0x9284, 0x1000,
-	0x080c, 0x5687, 0x0804, 0x3524, 0x00c6, 0xaab0, 0x9284, 0xc000,
-	0x0140, 0xd2ec, 0x0168, 0x080c, 0x56e3, 0x1150, 0x2009, 0x0014,
-	0x04f0, 0x2061, 0x1800, 0x080c, 0x56e3, 0x2009, 0x0007, 0x15b8,
-	0xd2f4, 0x0128, 0x9284, 0x5000, 0x080c, 0x56aa, 0x0050, 0xd2fc,
-	0x0178, 0x080c, 0x4ad5, 0x0588, 0xa998, 0x9284, 0x9000, 0x080c,
-	0x5687, 0xa87b, 0x0000, 0xa883, 0x0000, 0xa897, 0x4000, 0x0438,
-	0x080c, 0x4ad5, 0x0510, 0x080c, 0x6972, 0x2009, 0x0009, 0x11b8,
-	0xa8c4, 0x9086, 0x0500, 0x11c8, 0xa8c8, 0x9005, 0x11b0, 0xa8cc,
-	0x9084, 0xff00, 0x1190, 0x080c, 0x4ad5, 0x1108, 0x0070, 0x2009,
-	0x004b, 0x080c, 0xd013, 0x2009, 0x0003, 0x0108, 0x0078, 0x0429,
-	0x19c0, 0xa897, 0x4005, 0xa99a, 0x0010, 0xa897, 0x4006, 0x900e,
-	0x9085, 0x0001, 0x2001, 0x0030, 0x00ce, 0x0005, 0x9006, 0x0ce0,
-	0x7aa8, 0xd2dc, 0x0904, 0x3556, 0x0016, 0x7984, 0x9284, 0x1000,
-	0xc0fd, 0x080c, 0x5687, 0x001e, 0x1904, 0x3556, 0x0804, 0x3524,
-	0x00f6, 0x2d78, 0x0011, 0x00fe, 0x0005, 0xaab0, 0xd2dc, 0x0150,
-	0x0016, 0xa998, 0x9284, 0x1000, 0xc0fd, 0x080c, 0x5687, 0x001e,
-	0x9085, 0x0001, 0x0005, 0x81ff, 0x0120, 0x2009, 0x0001, 0x0804,
-	0x3556, 0x080c, 0x56e3, 0x0120, 0x2009, 0x0007, 0x0804, 0x3556,
-	0x7984, 0x7ea8, 0x96b4, 0x00ff, 0x080c, 0x65ff, 0x1904, 0x3559,
-	0x9186, 0x007f, 0x0138, 0x080c, 0x6972, 0x0120, 0x2009, 0x0009,
-	0x0804, 0x3556, 0x080c, 0x4aa4, 0x1120, 0x2009, 0x0002, 0x0804,
-	0x3556, 0xa867, 0x0000, 0xa868, 0xc0fd, 0xa86a, 0x2001, 0x0100,
-	0x8007, 0xa80a, 0x080c, 0xcd18, 0x1120, 0x2009, 0x0003, 0x0804,
-	0x3556, 0x7007, 0x0003, 0x701f, 0x54c6, 0x0005, 0xa808, 0x8007,
-	0x9086, 0x0100, 0x1120, 0x2009, 0x0004, 0x0804, 0x3556, 0xa8e0,
-	0xa866, 0xa810, 0x8007, 0x9084, 0x00ff, 0x800c, 0xa814, 0x8007,
-	0x9084, 0x00ff, 0x8004, 0x9080, 0x0002, 0x9108, 0x8906, 0x8006,
-	0x8007, 0x90bc, 0x003f, 0x9084, 0xffc0, 0x9080, 0x0004, 0x7a8c,
-	0x7b88, 0x7c9c, 0x7d98, 0x0804, 0x4af0, 0x080c, 0x4aa4, 0x1120,
-	0x2009, 0x0002, 0x0804, 0x3556, 0x7984, 0x9194, 0xff00, 0x918c,
-	0x00ff, 0x8217, 0x82ff, 0x1118, 0x7023, 0x19b3, 0x0040, 0x92c6,
-	0x0001, 0x1118, 0x7023, 0x19cd, 0x0010, 0x0804, 0x3559, 0x2009,
+	0x0800, 0x0120, 0x9386, 0x003c, 0x0518, 0x0c20, 0x83ff, 0x11f0,
+	0x7154, 0x810c, 0xa99a, 0xa897, 0x4000, 0x715c, 0x81ff, 0x090c,
+	0x0dd5, 0x2148, 0x080c, 0x1031, 0x9006, 0x705e, 0x918d, 0x0001,
+	0x2008, 0xa0a0, 0x2048, 0x0126, 0x2091, 0x8000, 0x080c, 0x6c86,
+	0x012e, 0xa09f, 0x0000, 0xa0a3, 0x0000, 0x0070, 0x7063, 0x0001,
+	0x7152, 0x7054, 0x9300, 0x7056, 0xa37a, 0xa48e, 0xa592, 0xa696,
+	0xa79a, 0x080c, 0x10e9, 0x9006, 0x00ee, 0x0005, 0x0096, 0xa88c,
+	0x90be, 0x7000, 0x0148, 0x90be, 0x7100, 0x0130, 0x90be, 0x7200,
+	0x0118, 0x009e, 0x0804, 0x355b, 0xa884, 0xa988, 0x080c, 0x2840,
+	0x1518, 0x080c, 0x65a7, 0x1500, 0x7126, 0xbe12, 0xbd16, 0xae7c,
+	0x080c, 0x4ab4, 0x01c8, 0x080c, 0x4ab4, 0x01b0, 0x009e, 0xa867,
+	0x0000, 0xa868, 0xc0fd, 0xa86a, 0xa823, 0x0000, 0xa804, 0x2048,
+	0x080c, 0xccf4, 0x1120, 0x2009, 0x0003, 0x0804, 0x3558, 0x7007,
+	0x0003, 0x701f, 0x51d1, 0x0005, 0x009e, 0x2009, 0x0002, 0x0804,
+	0x3558, 0x7124, 0x080c, 0x32bd, 0xa820, 0x9086, 0x8001, 0x1120,
+	0x2009, 0x0004, 0x0804, 0x3558, 0x2900, 0x7022, 0xa804, 0x0096,
+	0x2048, 0x8906, 0x8006, 0x8007, 0x90bc, 0x003f, 0x9084, 0xffc0,
+	0x009e, 0x9080, 0x0002, 0x0076, 0x0006, 0x2098, 0x20a0, 0x27e0,
+	0x27e8, 0x20a9, 0x002a, 0x080c, 0x0f7c, 0xaa6c, 0xab70, 0xac74,
+	0xad78, 0x2061, 0x18b8, 0x2c44, 0xa06b, 0x0000, 0xae64, 0xaf8c,
+	0x97c6, 0x7000, 0x0118, 0x97c6, 0x7100, 0x1148, 0x96c2, 0x0004,
+	0x0600, 0x2009, 0x0004, 0x000e, 0x007e, 0x0804, 0x4b00, 0x97c6,
+	0x7200, 0x11b8, 0x96c2, 0x0054, 0x02a0, 0x000e, 0x007e, 0x2061,
+	0x18b8, 0x2c44, 0xa076, 0xa772, 0xa07b, 0x002a, 0xa28e, 0xa392,
+	0xa496, 0xa59a, 0x080c, 0x10e9, 0x7007, 0x0002, 0x701f, 0x522d,
+	0x0005, 0x000e, 0x007e, 0x0804, 0x355b, 0x7020, 0x2048, 0xa804,
+	0x2048, 0xa804, 0x2048, 0x8906, 0x8006, 0x8007, 0x90bc, 0x003f,
+	0x9084, 0xffc0, 0x9080, 0x0002, 0x2098, 0x20a0, 0x27e0, 0x27e8,
+	0x20a9, 0x002a, 0x080c, 0x0f7c, 0x2100, 0x2238, 0x2061, 0x18b8,
+	0x2c44, 0xa28c, 0xa390, 0xa494, 0xa598, 0x2009, 0x002a, 0x0804,
+	0x4b00, 0x81ff, 0x1904, 0x3558, 0x798c, 0x2001, 0x197d, 0x918c,
+	0x8000, 0x2102, 0x080c, 0x4acb, 0x0904, 0x355b, 0x080c, 0x697b,
+	0x0120, 0x080c, 0x6983, 0x1904, 0x355b, 0x080c, 0x66cf, 0x0904,
+	0x3558, 0x0126, 0x2091, 0x8000, 0x080c, 0x6795, 0x012e, 0x0904,
+	0x3558, 0x2001, 0x197d, 0x2004, 0xd0fc, 0x1904, 0x3526, 0x0804,
+	0x4529, 0xa9a0, 0x2001, 0x197d, 0x918c, 0x8000, 0xc18d, 0x2102,
+	0x080c, 0x4ad8, 0x01a0, 0x080c, 0x697b, 0x0118, 0x080c, 0x6983,
+	0x1170, 0x080c, 0x66cf, 0x2009, 0x0002, 0x0128, 0x080c, 0x6795,
+	0x1170, 0x2009, 0x0003, 0xa897, 0x4005, 0xa99a, 0x0010, 0xa897,
+	0x4006, 0x900e, 0x9085, 0x0001, 0x2001, 0x0030, 0x0005, 0xa897,
+	0x4000, 0x2001, 0x197d, 0x2004, 0xd0fc, 0x1128, 0x080c, 0x56e0,
+	0x0110, 0x9006, 0x0018, 0x900e, 0x9085, 0x0001, 0x2001, 0x0000,
+	0x0005, 0x78a8, 0xd08c, 0x1118, 0xd084, 0x0904, 0x449e, 0x080c,
+	0x4ae7, 0x0904, 0x355b, 0x080c, 0x4ab4, 0x1120, 0x2009, 0x0002,
+	0x0804, 0x3558, 0x080c, 0x697b, 0x0130, 0x908e, 0x0004, 0x0118,
+	0x908e, 0x0005, 0x15a0, 0x78a8, 0xd08c, 0x0120, 0xb800, 0xc08c,
+	0xb802, 0x0028, 0x080c, 0x56d8, 0xd0b4, 0x0904, 0x44d8, 0x7884,
+	0x908e, 0x007e, 0x0904, 0x44d8, 0x908e, 0x007f, 0x0904, 0x44d8,
+	0x908e, 0x0080, 0x0904, 0x44d8, 0xb800, 0xd08c, 0x1904, 0x44d8,
+	0xa867, 0x0000, 0xa868, 0xc0fd, 0xa86a, 0x080c, 0xcd13, 0x1120,
+	0x2009, 0x0003, 0x0804, 0x3558, 0x7007, 0x0003, 0x701f, 0x52f9,
+	0x0005, 0x080c, 0x4ae7, 0x0904, 0x355b, 0x0804, 0x44d8, 0x080c,
+	0x3316, 0x0108, 0x0005, 0x2009, 0x1834, 0x210c, 0x81ff, 0x0120,
+	0x2009, 0x0001, 0x0804, 0x3558, 0x080c, 0x56ec, 0x0120, 0x2009,
+	0x0007, 0x0804, 0x3558, 0x080c, 0x6973, 0x0120, 0x2009, 0x0008,
+	0x0804, 0x3558, 0xb89c, 0xd0a4, 0x1118, 0xd0ac, 0x1904, 0x44d8,
+	0x9006, 0xa866, 0xa832, 0xa868, 0xc0fd, 0xa86a, 0x080c, 0xcd72,
+	0x1120, 0x2009, 0x0003, 0x0804, 0x3558, 0x7007, 0x0003, 0x701f,
+	0x5332, 0x0005, 0xa830, 0x9086, 0x0100, 0x1120, 0x2009, 0x0004,
+	0x0804, 0x5635, 0x080c, 0x4ae7, 0x0904, 0x355b, 0x0804, 0x52cb,
+	0x81ff, 0x2009, 0x0001, 0x1904, 0x3558, 0x080c, 0x56ec, 0x2009,
+	0x0007, 0x1904, 0x3558, 0x080c, 0x6973, 0x0120, 0x2009, 0x0008,
+	0x0804, 0x3558, 0x080c, 0x4ae7, 0x0904, 0x355b, 0x080c, 0x697b,
+	0x2009, 0x0009, 0x1904, 0x3558, 0x080c, 0x4ab4, 0x2009, 0x0002,
+	0x0904, 0x3558, 0x9006, 0xa866, 0xa832, 0xa868, 0xc0fd, 0xa86a,
+	0x7988, 0x9194, 0xff00, 0x918c, 0x00ff, 0x9006, 0x82ff, 0x1128,
+	0xc0ed, 0xa952, 0x798c, 0xa956, 0x0038, 0x928e, 0x0100, 0x1904,
+	0x355b, 0xc0e5, 0xa952, 0xa956, 0xa83e, 0x080c, 0xcfc5, 0x2009,
+	0x0003, 0x0904, 0x3558, 0x7007, 0x0003, 0x701f, 0x5388, 0x0005,
+	0xa830, 0x9086, 0x0100, 0x2009, 0x0004, 0x0904, 0x3558, 0x0804,
+	0x3526, 0x7aa8, 0x9284, 0xc000, 0x0148, 0xd2ec, 0x01a0, 0x080c,
+	0x56ec, 0x1188, 0x2009, 0x0014, 0x0804, 0x3558, 0xd2dc, 0x1568,
+	0x81ff, 0x2009, 0x0001, 0x1904, 0x3558, 0x080c, 0x56ec, 0x2009,
+	0x0007, 0x1904, 0x3558, 0xd2f4, 0x0130, 0x9284, 0x5000, 0x080c,
+	0x56b3, 0x0804, 0x3526, 0xd2fc, 0x0158, 0x080c, 0x4ae7, 0x0904,
+	0x355b, 0x7984, 0x9284, 0x9000, 0x080c, 0x5690, 0x0804, 0x3526,
+	0x080c, 0x4ae7, 0x0904, 0x355b, 0xb804, 0x9084, 0x00ff, 0x9086,
+	0x0006, 0x2009, 0x0009, 0x1904, 0x5471, 0x080c, 0x4ab4, 0x2009,
+	0x0002, 0x0904, 0x5471, 0xa85c, 0x9080, 0x001b, 0xaf60, 0x2009,
+	0x0008, 0x7a8c, 0x7b88, 0x7c9c, 0x7d98, 0x080c, 0x4afd, 0x701f,
+	0x53e2, 0x0005, 0xa86c, 0x9086, 0x0500, 0x1138, 0xa870, 0x9005,
+	0x1120, 0xa874, 0x9084, 0xff00, 0x0110, 0x1904, 0x355b, 0xa866,
+	0xa832, 0xa868, 0xc0fd, 0xa86a, 0x080c, 0x4ae7, 0x1110, 0x0804,
+	0x355b, 0x2009, 0x0043, 0x080c, 0xd02d, 0x2009, 0x0003, 0x0904,
+	0x5471, 0x7007, 0x0003, 0x701f, 0x5406, 0x0005, 0xa830, 0x9086,
+	0x0100, 0x2009, 0x0004, 0x0904, 0x5471, 0x7984, 0x7aa8, 0x9284,
+	0x1000, 0x080c, 0x5690, 0x0804, 0x3526, 0x00c6, 0xaab0, 0x9284,
+	0xc000, 0x0140, 0xd2ec, 0x0168, 0x080c, 0x56ec, 0x1150, 0x2009,
+	0x0014, 0x04f0, 0x2061, 0x1800, 0x080c, 0x56ec, 0x2009, 0x0007,
+	0x15b8, 0xd2f4, 0x0128, 0x9284, 0x5000, 0x080c, 0x56b3, 0x0050,
+	0xd2fc, 0x0178, 0x080c, 0x4ae5, 0x0588, 0xa998, 0x9284, 0x9000,
+	0x080c, 0x5690, 0xa87b, 0x0000, 0xa883, 0x0000, 0xa897, 0x4000,
+	0x0438, 0x080c, 0x4ae5, 0x0510, 0x080c, 0x697b, 0x2009, 0x0009,
+	0x11b8, 0xa8c4, 0x9086, 0x0500, 0x11c8, 0xa8c8, 0x9005, 0x11b0,
+	0xa8cc, 0x9084, 0xff00, 0x1190, 0x080c, 0x4ae5, 0x1108, 0x0070,
+	0x2009, 0x004b, 0x080c, 0xd02d, 0x2009, 0x0003, 0x0108, 0x0078,
+	0x0429, 0x19c0, 0xa897, 0x4005, 0xa99a, 0x0010, 0xa897, 0x4006,
+	0x900e, 0x9085, 0x0001, 0x2001, 0x0030, 0x00ce, 0x0005, 0x9006,
+	0x0ce0, 0x7aa8, 0xd2dc, 0x0904, 0x3558, 0x0016, 0x7984, 0x9284,
+	0x1000, 0xc0fd, 0x080c, 0x5690, 0x001e, 0x1904, 0x3558, 0x0804,
+	0x3526, 0x00f6, 0x2d78, 0x0011, 0x00fe, 0x0005, 0xaab0, 0xd2dc,
+	0x0150, 0x0016, 0xa998, 0x9284, 0x1000, 0xc0fd, 0x080c, 0x5690,
+	0x001e, 0x9085, 0x0001, 0x0005, 0x81ff, 0x0120, 0x2009, 0x0001,
+	0x0804, 0x3558, 0x080c, 0x56ec, 0x0120, 0x2009, 0x0007, 0x0804,
+	0x3558, 0x7984, 0x7ea8, 0x96b4, 0x00ff, 0x080c, 0x6608, 0x1904,
+	0x355b, 0x9186, 0x007f, 0x0138, 0x080c, 0x697b, 0x0120, 0x2009,
+	0x0009, 0x0804, 0x3558, 0x080c, 0x4ab4, 0x1120, 0x2009, 0x0002,
+	0x0804, 0x3558, 0xa867, 0x0000, 0xa868, 0xc0fd, 0xa86a, 0x2001,
+	0x0100, 0x8007, 0xa80a, 0x080c, 0xcd2d, 0x1120, 0x2009, 0x0003,
+	0x0804, 0x3558, 0x7007, 0x0003, 0x701f, 0x54cf, 0x0005, 0xa808,
+	0x8007, 0x9086, 0x0100, 0x1120, 0x2009, 0x0004, 0x0804, 0x3558,
+	0xa8e0, 0xa866, 0xa810, 0x8007, 0x9084, 0x00ff, 0x800c, 0xa814,
+	0x8007, 0x9084, 0x00ff, 0x8004, 0x9080, 0x0002, 0x9108, 0x8906,
+	0x8006, 0x8007, 0x90bc, 0x003f, 0x9084, 0xffc0, 0x9080, 0x0004,
+	0x7a8c, 0x7b88, 0x7c9c, 0x7d98, 0x0804, 0x4b00, 0x080c, 0x4ab4,
+	0x1120, 0x2009, 0x0002, 0x0804, 0x3558, 0x7984, 0x9194, 0xff00,
+	0x918c, 0x00ff, 0x8217, 0x82ff, 0x1118, 0x7023, 0x19b2, 0x0040,
+	0x92c6, 0x0001, 0x1118, 0x7023, 0x19cc, 0x0010, 0x0804, 0x355b,
+	0x2009, 0x001a, 0x7a8c, 0x7b88, 0x7c9c, 0x7d98, 0xa85c, 0x9080,
+	0x0019, 0xaf60, 0x080c, 0x4afd, 0x701f, 0x551f, 0x0005, 0x2001,
+	0x182e, 0x2003, 0x0001, 0xa85c, 0x9080, 0x0019, 0x2098, 0xa860,
+	0x20e0, 0x20a9, 0x001a, 0x7020, 0x20a0, 0x20e9, 0x0001, 0x4003,
+	0x0804, 0x3526, 0x080c, 0x4ab4, 0x1120, 0x2009, 0x0002, 0x0804,
+	0x3558, 0x7984, 0x9194, 0xff00, 0x918c, 0x00ff, 0x8217, 0x82ff,
+	0x1118, 0x2099, 0x19b2, 0x0040, 0x92c6, 0x0001, 0x1118, 0x2099,
+	0x19cc, 0x0010, 0x0804, 0x355b, 0xa85c, 0x9080, 0x0019, 0x20a0,
+	0xa860, 0x20e8, 0x20a9, 0x001a, 0x20e1, 0x0001, 0x4003, 0x2009,
 	0x001a, 0x7a8c, 0x7b88, 0x7c9c, 0x7d98, 0xa85c, 0x9080, 0x0019,
-	0xaf60, 0x080c, 0x4aed, 0x701f, 0x5516, 0x0005, 0x2001, 0x182e,
-	0x2003, 0x0001, 0xa85c, 0x9080, 0x0019, 0x2098, 0xa860, 0x20e0,
-	0x20a9, 0x001a, 0x7020, 0x20a0, 0x20e9, 0x0001, 0x4003, 0x0804,
-	0x3524, 0x080c, 0x4aa4, 0x1120, 0x2009, 0x0002, 0x0804, 0x3556,
-	0x7984, 0x9194, 0xff00, 0x918c, 0x00ff, 0x8217, 0x82ff, 0x1118,
-	0x2099, 0x19b3, 0x0040, 0x92c6, 0x0001, 0x1118, 0x2099, 0x19cd,
-	0x0010, 0x0804, 0x3559, 0xa85c, 0x9080, 0x0019, 0x20a0, 0xa860,
-	0x20e8, 0x20a9, 0x001a, 0x20e1, 0x0001, 0x4003, 0x2009, 0x001a,
-	0x7a8c, 0x7b88, 0x7c9c, 0x7d98, 0xa85c, 0x9080, 0x0019, 0xaf60,
-	0x0804, 0x4af0, 0x7884, 0x908a, 0x1000, 0x1a04, 0x3559, 0x0126,
-	0x2091, 0x8000, 0x8003, 0x800b, 0x810b, 0x9108, 0x00c6, 0x2061,
-	0x19fa, 0x6142, 0x00ce, 0x012e, 0x0804, 0x3524, 0x00c6, 0x080c,
-	0x73bc, 0x1160, 0x080c, 0x76a4, 0x080c, 0x601a, 0x9085, 0x0001,
-	0x080c, 0x7403, 0x080c, 0x72ee, 0x080c, 0x0dd5, 0x2061, 0x1800,
-	0x6030, 0xc09d, 0x6032, 0x080c, 0x5ed9, 0x00ce, 0x0005, 0x00c6,
-	0x2001, 0x1800, 0x2004, 0x908e, 0x0000, 0x0904, 0x3556, 0x7884,
-	0x9005, 0x0188, 0x7888, 0x2061, 0x199c, 0x2c0c, 0x2062, 0x080c,
-	0x2c20, 0x01a0, 0x080c, 0x2c28, 0x0188, 0x080c, 0x2c30, 0x0170,
-	0x2162, 0x0804, 0x3559, 0x2061, 0x0100, 0x6038, 0x9086, 0x0007,
-	0x1118, 0x2009, 0x0001, 0x0010, 0x2009, 0x0000, 0x7884, 0x9086,
-	0x0002, 0x1548, 0x2061, 0x0100, 0x6028, 0xc09c, 0x602a, 0x0026,
-	0x2011, 0x0003, 0x080c, 0xa653, 0x2011, 0x0002, 0x080c, 0xa65d,
-	0x002e, 0x080c, 0xa540, 0x0036, 0x901e, 0x080c, 0xa5b6, 0x003e,
-	0x60e3, 0x0000, 0x080c, 0xe9e9, 0x080c, 0xea04, 0x9085, 0x0001,
-	0x080c, 0x7403, 0x9006, 0x080c, 0x2cef, 0x2001, 0x1800, 0x2003,
-	0x0004, 0x6027, 0x0008, 0x00ce, 0x0804, 0x3524, 0x81ff, 0x0120,
-	0x2009, 0x0001, 0x0804, 0x3556, 0x080c, 0x56e3, 0x0120, 0x2009,
-	0x0007, 0x0804, 0x3556, 0x7984, 0x7ea8, 0x96b4, 0x00ff, 0x080c,
-	0x65ff, 0x1904, 0x3559, 0x9186, 0x007f, 0x0138, 0x080c, 0x6972,
-	0x0120, 0x2009, 0x0009, 0x0804, 0x3556, 0x080c, 0x4aa4, 0x1120,
-	0x2009, 0x0002, 0x0804, 0x3556, 0xa867, 0x0000, 0xa868, 0xc0fd,
-	0xa86a, 0x080c, 0xcd1b, 0x1120, 0x2009, 0x0003, 0x0804, 0x3556,
-	0x7007, 0x0003, 0x701f, 0x5615, 0x0005, 0xa830, 0x9086, 0x0100,
-	0x1120, 0x2009, 0x0004, 0x0804, 0x3556, 0xa8e0, 0xa866, 0xa834,
-	0x8007, 0x800c, 0xa85c, 0x9080, 0x000c, 0x7a8c, 0x7b88, 0x7c9c,
-	0x7d98, 0xaf60, 0x0804, 0x4af0, 0xa898, 0x9086, 0x000d, 0x1904,
-	0x3556, 0x2021, 0x4005, 0x0126, 0x2091, 0x8000, 0x0e04, 0x5639,
-	0x0010, 0x012e, 0x0cc0, 0x7c36, 0x9486, 0x4000, 0x0118, 0x7833,
-	0x0011, 0x0010, 0x7833, 0x0010, 0x7883, 0x4005, 0xa998, 0x7986,
-	0xa9a4, 0x799a, 0xa9a8, 0x799e, 0x080c, 0x4ae0, 0x2091, 0x4080,
-	0x2001, 0x0089, 0x2004, 0xd084, 0x190c, 0x119b, 0x7007, 0x0001,
-	0x2091, 0x5000, 0x700f, 0x0000, 0x012e, 0x0005, 0x0126, 0x2091,
-	0x8000, 0x00c6, 0x2061, 0x19fa, 0x7984, 0x6152, 0x614e, 0x6057,
-	0x0000, 0x604b, 0x0009, 0x7898, 0x606a, 0x789c, 0x6066, 0x7888,
-	0x6062, 0x788c, 0x605e, 0x2001, 0x1a08, 0x2044, 0x2001, 0x1a0f,
-	0xa076, 0xa060, 0xa072, 0xa07b, 0x0001, 0xa07f, 0x0002, 0xa06b,
-	0x0000, 0xa09f, 0x0000, 0x00ce, 0x012e, 0x0804, 0x3524, 0x0126,
-	0x2091, 0x8000, 0x00b6, 0x00c6, 0x90e4, 0xc000, 0x0128, 0x0006,
-	0x080c, 0xcb82, 0x000e, 0x1198, 0xd0e4, 0x0160, 0x9180, 0x1000,
-	0x2004, 0x905d, 0x0160, 0x080c, 0x6034, 0x080c, 0xadcb, 0x0110,
-	0xb817, 0x0000, 0x9006, 0x00ce, 0x00be, 0x012e, 0x0005, 0x9085,
-	0x0001, 0x0cc8, 0x0126, 0x2091, 0x8000, 0x0156, 0x2010, 0x900e,
-	0x20a9, 0x0800, 0x0016, 0x9180, 0x1000, 0x2004, 0x9005, 0x0180,
-	0x9186, 0x007e, 0x0168, 0x9186, 0x007f, 0x0150, 0x9186, 0x0080,
-	0x0138, 0x9186, 0x00ff, 0x0120, 0x0026, 0x2200, 0x0801, 0x002e,
-	0x001e, 0x8108, 0x1f04, 0x56b2, 0x015e, 0x012e, 0x0005, 0x2001,
-	0x1848, 0x2004, 0x0005, 0x2001, 0x1867, 0x2004, 0x0005, 0x0006,
-	0x2001, 0x1810, 0x2004, 0xd0d4, 0x000e, 0x0005, 0x2001, 0x180e,
-	0x2004, 0xd0b4, 0x0005, 0x2001, 0x1800, 0x2004, 0x9086, 0x0003,
-	0x0005, 0x0016, 0x00e6, 0x2071, 0x189e, 0x7108, 0x910d, 0x710a,
-	0x00ee, 0x001e, 0x0005, 0x79a4, 0x9182, 0x0081, 0x1a04, 0x3559,
-	0x810c, 0x0016, 0x080c, 0x4aa4, 0x080c, 0x0f07, 0x2100, 0x2238,
-	0x7d84, 0x7c88, 0x7b8c, 0x7a90, 0x001e, 0x080c, 0x4aed, 0x701f,
-	0x570a, 0x0005, 0x2079, 0x0000, 0x7d94, 0x7c98, 0x7ba8, 0x7aac,
-	0x79a4, 0x810c, 0x2061, 0x18b8, 0x2c44, 0xa770, 0xa074, 0x2071,
-	0x189e, 0x080c, 0x4af0, 0x701f, 0x571e, 0x0005, 0x2061, 0x18b8,
-	0x2c44, 0x0016, 0x0026, 0xa270, 0xa174, 0x080c, 0x0f0f, 0x002e,
-	0x001e, 0x080c, 0x0fbc, 0x9006, 0xa802, 0xa806, 0x0804, 0x3524,
-	0x0126, 0x0156, 0x0136, 0x0146, 0x01c6, 0x01d6, 0x00c6, 0x00d6,
-	0x00e6, 0x00f6, 0x2061, 0x0100, 0x2069, 0x0200, 0x2071, 0x1800,
-	0x6044, 0xd0a4, 0x11e8, 0xd084, 0x0118, 0x080c, 0x58d9, 0x0068,
-	0xd08c, 0x0118, 0x080c, 0x57e2, 0x0040, 0xd094, 0x0118, 0x080c,
-	0x57b2, 0x0018, 0xd09c, 0x0108, 0x0099, 0x00fe, 0x00ee, 0x00de,
-	0x00ce, 0x01de, 0x01ce, 0x014e, 0x013e, 0x015e, 0x012e, 0x0005,
-	0x0016, 0x6128, 0xd19c, 0x1110, 0xc19d, 0x612a, 0x001e, 0x0c68,
-	0x0006, 0x7098, 0x9005, 0x000e, 0x0120, 0x709b, 0x0000, 0x7093,
-	0x0000, 0x624c, 0x9286, 0xf0f0, 0x1150, 0x6048, 0x9086, 0xf0f0,
-	0x0130, 0x624a, 0x6043, 0x0090, 0x6043, 0x0010, 0x0490, 0x9294,
-	0xff00, 0x9296, 0xf700, 0x0178, 0x7138, 0xd1a4, 0x1160, 0x6240,
-	0x9295, 0x0100, 0x6242, 0x9294, 0x0010, 0x0128, 0x2009, 0x00f7,
-	0x080c, 0x5f96, 0x00f0, 0x6040, 0x9084, 0x0010, 0x9085, 0x0140,
-	0x6042, 0x6043, 0x0000, 0x7087, 0x0000, 0x70a3, 0x0001, 0x70c7,
-	0x0000, 0x70df, 0x0000, 0x2009, 0x1c80, 0x200b, 0x0000, 0x7097,
-	0x0000, 0x708b, 0x000f, 0x2009, 0x000f, 0x2011, 0x5e7c, 0x080c,
-	0x858b, 0x0005, 0x2001, 0x1869, 0x2004, 0xd08c, 0x0110, 0x705f,
-	0xffff, 0x7088, 0x9005, 0x1528, 0x2011, 0x5e7c, 0x080c, 0x84f3,
-	0x6040, 0x9094, 0x0010, 0x9285, 0x0020, 0x6042, 0x20a9, 0x00c8,
-	0x6044, 0xd08c, 0x1168, 0x1f04, 0x57c8, 0x6242, 0x709b, 0x0000,
-	0x6040, 0x9094, 0x0010, 0x9285, 0x0080, 0x6042, 0x6242, 0x0048,
-	0x6242, 0x709b, 0x0000, 0x708f, 0x0000, 0x9006, 0x080c, 0x601f,
-	0x0000, 0x0005, 0x708c, 0x908a, 0x0003, 0x1a0c, 0x0dd5, 0x000b,
-	0x0005, 0x57ec, 0x583d, 0x58d8, 0x00f6, 0x0016, 0x6900, 0x918c,
-	0x0800, 0x708f, 0x0001, 0x2001, 0x015d, 0x2003, 0x0000, 0x6803,
-	0x00fc, 0x20a9, 0x0004, 0x6800, 0x9084, 0x00fc, 0x0120, 0x1f04,
-	0x57fb, 0x080c, 0x0dd5, 0x68a0, 0x68a2, 0x689c, 0x689e, 0x6898,
-	0x689a, 0xa001, 0x918d, 0x1600, 0x6902, 0x001e, 0x6837, 0x0020,
-	0x080c, 0x5ffb, 0x2079, 0x1c00, 0x7833, 0x1101, 0x7837, 0x0000,
-	0x20e1, 0x0001, 0x2099, 0x1805, 0x20e9, 0x0001, 0x20a1, 0x1c0e,
-	0x20a9, 0x0004, 0x4003, 0x080c, 0xab21, 0x20e1, 0x0001, 0x2099,
-	0x1c00, 0x20e9, 0x0000, 0x20a1, 0x0240, 0x20a9, 0x0014, 0x4003,
-	0x60c3, 0x000c, 0x600f, 0x0000, 0x080c, 0x5ead, 0x00fe, 0x9006,
-	0x7092, 0x6043, 0x0008, 0x6042, 0x0005, 0x00f6, 0x7090, 0x7093,
-	0x0000, 0x9025, 0x0904, 0x58b5, 0x6020, 0xd0b4, 0x1904, 0x58b3,
-	0x71a0, 0x81ff, 0x0904, 0x58a1, 0x9486, 0x000c, 0x1904, 0x58ae,
-	0x9480, 0x0018, 0x8004, 0x20a8, 0x080c, 0x5ff4, 0x2011, 0x0260,
-	0x2019, 0x1c00, 0x220c, 0x2304, 0x9106, 0x11e8, 0x8210, 0x8318,
-	0x1f04, 0x585a, 0x6043, 0x0004, 0x2061, 0x0140, 0x605b, 0xbc94,
-	0x605f, 0xf0f0, 0x2061, 0x0100, 0x6043, 0x0006, 0x708f, 0x0002,
-	0x709b, 0x0002, 0x2009, 0x07d0, 0x2011, 0x5e83, 0x080c, 0x858b,
-	0x080c, 0x5ffb, 0x04c0, 0x080c, 0x5ff4, 0x2079, 0x0260, 0x7930,
-	0x918e, 0x1101, 0x1558, 0x7834, 0x9005, 0x1540, 0x7900, 0x918c,
-	0x00ff, 0x1118, 0x7804, 0x9005, 0x0190, 0x080c, 0x5ff4, 0x2011,
-	0x026e, 0x2019, 0x1805, 0x20a9, 0x0004, 0x220c, 0x2304, 0x9102,
-	0x0230, 0x11a0, 0x8210, 0x8318, 0x1f04, 0x5895, 0x0078, 0x70a3,
-	0x0000, 0x080c, 0x5ff4, 0x20e1, 0x0000, 0x2099, 0x0260, 0x20e9,
-	0x0001, 0x20a1, 0x1c00, 0x20a9, 0x0014, 0x4003, 0x6043, 0x0008,
-	0x6043, 0x0000, 0x0010, 0x00fe, 0x0005, 0x6040, 0x9085, 0x0100,
-	0x6042, 0x6020, 0xd0b4, 0x1db8, 0x080c, 0xab21, 0x20e1, 0x0001,
+	0xaf60, 0x0804, 0x4b00, 0x7884, 0x908a, 0x1000, 0x1a04, 0x355b,
+	0x0126, 0x2091, 0x8000, 0x8003, 0x800b, 0x810b, 0x9108, 0x00c6,
+	0x2061, 0x19f9, 0x6142, 0x00ce, 0x012e, 0x0804, 0x3526, 0x00c6,
+	0x080c, 0x73a5, 0x1160, 0x080c, 0x768d, 0x080c, 0x6023, 0x9085,
+	0x0001, 0x080c, 0x73ec, 0x080c, 0x72d7, 0x080c, 0x0dd5, 0x2061,
+	0x1800, 0x6030, 0xc09d, 0x6032, 0x080c, 0x5ee2, 0x00ce, 0x0005,
+	0x00c6, 0x2001, 0x1800, 0x2004, 0x908e, 0x0000, 0x0904, 0x3558,
+	0x7884, 0x9005, 0x0188, 0x7888, 0x2061, 0x199b, 0x2c0c, 0x2062,
+	0x080c, 0x2c22, 0x01a0, 0x080c, 0x2c2a, 0x0188, 0x080c, 0x2c32,
+	0x0170, 0x2162, 0x0804, 0x355b, 0x2061, 0x0100, 0x6038, 0x9086,
+	0x0007, 0x1118, 0x2009, 0x0001, 0x0010, 0x2009, 0x0000, 0x7884,
+	0x9086, 0x0002, 0x1548, 0x2061, 0x0100, 0x6028, 0xc09c, 0x602a,
+	0x0026, 0x2011, 0x0003, 0x080c, 0xa654, 0x2011, 0x0002, 0x080c,
+	0xa65e, 0x002e, 0x080c, 0xa541, 0x0036, 0x901e, 0x080c, 0xa5b7,
+	0x003e, 0x60e3, 0x0000, 0x080c, 0xea0a, 0x080c, 0xea25, 0x9085,
+	0x0001, 0x080c, 0x73ec, 0x9006, 0x080c, 0x2cf1, 0x2001, 0x1800,
+	0x2003, 0x0004, 0x6027, 0x0008, 0x00ce, 0x0804, 0x3526, 0x81ff,
+	0x0120, 0x2009, 0x0001, 0x0804, 0x3558, 0x080c, 0x56ec, 0x0120,
+	0x2009, 0x0007, 0x0804, 0x3558, 0x7984, 0x7ea8, 0x96b4, 0x00ff,
+	0x080c, 0x6608, 0x1904, 0x355b, 0x9186, 0x007f, 0x0138, 0x080c,
+	0x697b, 0x0120, 0x2009, 0x0009, 0x0804, 0x3558, 0x080c, 0x4ab4,
+	0x1120, 0x2009, 0x0002, 0x0804, 0x3558, 0xa867, 0x0000, 0xa868,
+	0xc0fd, 0xa86a, 0x080c, 0xcd30, 0x1120, 0x2009, 0x0003, 0x0804,
+	0x3558, 0x7007, 0x0003, 0x701f, 0x561e, 0x0005, 0xa830, 0x9086,
+	0x0100, 0x1120, 0x2009, 0x0004, 0x0804, 0x3558, 0xa8e0, 0xa866,
+	0xa834, 0x8007, 0x800c, 0xa85c, 0x9080, 0x000c, 0x7a8c, 0x7b88,
+	0x7c9c, 0x7d98, 0xaf60, 0x0804, 0x4b00, 0xa898, 0x9086, 0x000d,
+	0x1904, 0x3558, 0x2021, 0x4005, 0x0126, 0x2091, 0x8000, 0x0e04,
+	0x5642, 0x0010, 0x012e, 0x0cc0, 0x7c36, 0x9486, 0x4000, 0x0118,
+	0x7833, 0x0011, 0x0010, 0x7833, 0x0010, 0x7883, 0x4005, 0xa998,
+	0x7986, 0xa9a4, 0x799a, 0xa9a8, 0x799e, 0x080c, 0x4af0, 0x2091,
+	0x4080, 0x2001, 0x0089, 0x2004, 0xd084, 0x190c, 0x119b, 0x7007,
+	0x0001, 0x2091, 0x5000, 0x700f, 0x0000, 0x012e, 0x0005, 0x0126,
+	0x2091, 0x8000, 0x00c6, 0x2061, 0x19f9, 0x7984, 0x6152, 0x614e,
+	0x6057, 0x0000, 0x604b, 0x0009, 0x7898, 0x606a, 0x789c, 0x6066,
+	0x7888, 0x6062, 0x788c, 0x605e, 0x2001, 0x1a07, 0x2044, 0x2001,
+	0x1a0e, 0xa076, 0xa060, 0xa072, 0xa07b, 0x0001, 0xa07f, 0x0002,
+	0xa06b, 0x0000, 0xa09f, 0x0000, 0x00ce, 0x012e, 0x0804, 0x3526,
+	0x0126, 0x2091, 0x8000, 0x00b6, 0x00c6, 0x90e4, 0xc000, 0x0128,
+	0x0006, 0x080c, 0xcb97, 0x000e, 0x1198, 0xd0e4, 0x0160, 0x9180,
+	0x1000, 0x2004, 0x905d, 0x0160, 0x080c, 0x603d, 0x080c, 0xaddb,
+	0x0110, 0xb817, 0x0000, 0x9006, 0x00ce, 0x00be, 0x012e, 0x0005,
+	0x9085, 0x0001, 0x0cc8, 0x0126, 0x2091, 0x8000, 0x0156, 0x2010,
+	0x900e, 0x20a9, 0x0800, 0x0016, 0x9180, 0x1000, 0x2004, 0x9005,
+	0x0180, 0x9186, 0x007e, 0x0168, 0x9186, 0x007f, 0x0150, 0x9186,
+	0x0080, 0x0138, 0x9186, 0x00ff, 0x0120, 0x0026, 0x2200, 0x0801,
+	0x002e, 0x001e, 0x8108, 0x1f04, 0x56bb, 0x015e, 0x012e, 0x0005,
+	0x2001, 0x1848, 0x2004, 0x0005, 0x2001, 0x1867, 0x2004, 0x0005,
+	0x0006, 0x2001, 0x1810, 0x2004, 0xd0d4, 0x000e, 0x0005, 0x2001,
+	0x180e, 0x2004, 0xd0b4, 0x0005, 0x2001, 0x1800, 0x2004, 0x9086,
+	0x0003, 0x0005, 0x0016, 0x00e6, 0x2071, 0x189e, 0x7108, 0x910d,
+	0x710a, 0x00ee, 0x001e, 0x0005, 0x79a4, 0x9182, 0x0081, 0x1a04,
+	0x355b, 0x810c, 0x0016, 0x080c, 0x4ab4, 0x080c, 0x0f07, 0x2100,
+	0x2238, 0x7d84, 0x7c88, 0x7b8c, 0x7a90, 0x001e, 0x080c, 0x4afd,
+	0x701f, 0x5713, 0x0005, 0x2079, 0x0000, 0x7d94, 0x7c98, 0x7ba8,
+	0x7aac, 0x79a4, 0x810c, 0x2061, 0x18b8, 0x2c44, 0xa770, 0xa074,
+	0x2071, 0x189e, 0x080c, 0x4b00, 0x701f, 0x5727, 0x0005, 0x2061,
+	0x18b8, 0x2c44, 0x0016, 0x0026, 0xa270, 0xa174, 0x080c, 0x0f0f,
+	0x002e, 0x001e, 0x080c, 0x0fbc, 0x9006, 0xa802, 0xa806, 0x0804,
+	0x3526, 0x0126, 0x0156, 0x0136, 0x0146, 0x01c6, 0x01d6, 0x00c6,
+	0x00d6, 0x00e6, 0x00f6, 0x2061, 0x0100, 0x2069, 0x0200, 0x2071,
+	0x1800, 0x6044, 0xd0a4, 0x11e8, 0xd084, 0x0118, 0x080c, 0x58e2,
+	0x0068, 0xd08c, 0x0118, 0x080c, 0x57eb, 0x0040, 0xd094, 0x0118,
+	0x080c, 0x57bb, 0x0018, 0xd09c, 0x0108, 0x0099, 0x00fe, 0x00ee,
+	0x00de, 0x00ce, 0x01de, 0x01ce, 0x014e, 0x013e, 0x015e, 0x012e,
+	0x0005, 0x0016, 0x6128, 0xd19c, 0x1110, 0xc19d, 0x612a, 0x001e,
+	0x0c68, 0x0006, 0x7098, 0x9005, 0x000e, 0x0120, 0x709b, 0x0000,
+	0x7093, 0x0000, 0x624c, 0x9286, 0xf0f0, 0x1150, 0x6048, 0x9086,
+	0xf0f0, 0x0130, 0x624a, 0x6043, 0x0090, 0x6043, 0x0010, 0x0490,
+	0x9294, 0xff00, 0x9296, 0xf700, 0x0178, 0x7138, 0xd1a4, 0x1160,
+	0x6240, 0x9295, 0x0100, 0x6242, 0x9294, 0x0010, 0x0128, 0x2009,
+	0x00f7, 0x080c, 0x5f9f, 0x00f0, 0x6040, 0x9084, 0x0010, 0x9085,
+	0x0140, 0x6042, 0x6043, 0x0000, 0x7087, 0x0000, 0x70a3, 0x0001,
+	0x70c7, 0x0000, 0x70df, 0x0000, 0x2009, 0x1c80, 0x200b, 0x0000,
+	0x7097, 0x0000, 0x708b, 0x000f, 0x2009, 0x000f, 0x2011, 0x5e85,
+	0x080c, 0x8574, 0x0005, 0x2001, 0x1869, 0x2004, 0xd08c, 0x0110,
+	0x705f, 0xffff, 0x7088, 0x9005, 0x1528, 0x2011, 0x5e85, 0x080c,
+	0x84dc, 0x6040, 0x9094, 0x0010, 0x9285, 0x0020, 0x6042, 0x20a9,
+	0x00c8, 0x6044, 0xd08c, 0x1168, 0x1f04, 0x57d1, 0x6242, 0x709b,
+	0x0000, 0x6040, 0x9094, 0x0010, 0x9285, 0x0080, 0x6042, 0x6242,
+	0x0048, 0x6242, 0x709b, 0x0000, 0x708f, 0x0000, 0x9006, 0x080c,
+	0x6028, 0x0000, 0x0005, 0x708c, 0x908a, 0x0003, 0x1a0c, 0x0dd5,
+	0x000b, 0x0005, 0x57f5, 0x5846, 0x58e1, 0x00f6, 0x0016, 0x6900,
+	0x918c, 0x0800, 0x708f, 0x0001, 0x2001, 0x015d, 0x2003, 0x0000,
+	0x6803, 0x00fc, 0x20a9, 0x0004, 0x6800, 0x9084, 0x00fc, 0x0120,
+	0x1f04, 0x5804, 0x080c, 0x0dd5, 0x68a0, 0x68a2, 0x689c, 0x689e,
+	0x6898, 0x689a, 0xa001, 0x918d, 0x1600, 0x6902, 0x001e, 0x6837,
+	0x0020, 0x080c, 0x6004, 0x2079, 0x1c00, 0x7833, 0x1101, 0x7837,
+	0x0000, 0x20e1, 0x0001, 0x2099, 0x1805, 0x20e9, 0x0001, 0x20a1,
+	0x1c0e, 0x20a9, 0x0004, 0x4003, 0x080c, 0xab2c, 0x20e1, 0x0001,
 	0x2099, 0x1c00, 0x20e9, 0x0000, 0x20a1, 0x0240, 0x20a9, 0x0014,
-	0x4003, 0x60c3, 0x000c, 0x2011, 0x19f1, 0x2013, 0x0000, 0x7093,
-	0x0000, 0x60a3, 0x0056, 0x60a7, 0x9575, 0x080c, 0xa26a, 0x08d8,
-	0x0005, 0x7098, 0x908a, 0x001d, 0x1a0c, 0x0dd5, 0x000b, 0x0005,
-	0x590a, 0x591d, 0x5946, 0x5966, 0x598c, 0x59bb, 0x59e1, 0x5a19,
-	0x5a3f, 0x5a6d, 0x5aa8, 0x5ae0, 0x5afe, 0x5b29, 0x5b4b, 0x5b66,
-	0x5b70, 0x5ba4, 0x5bca, 0x5bf9, 0x5c1f, 0x5c57, 0x5c9b, 0x5cd8,
-	0x5cf9, 0x5d52, 0x5d74, 0x5da2, 0x5da2, 0x00c6, 0x2061, 0x1800,
-	0x6003, 0x0007, 0x2061, 0x0100, 0x6004, 0x9084, 0xfff9, 0x6006,
-	0x00ce, 0x0005, 0x2061, 0x0140, 0x605b, 0xbc94, 0x605f, 0xf0f0,
-	0x2061, 0x0100, 0x6043, 0x0002, 0x709b, 0x0001, 0x2009, 0x07d0,
-	0x2011, 0x5e83, 0x080c, 0x858b, 0x0005, 0x00f6, 0x7090, 0x9086,
-	0x0014, 0x1510, 0x6042, 0x6020, 0xd0b4, 0x11f0, 0x080c, 0x5ff4,
-	0x2079, 0x0260, 0x7a30, 0x9296, 0x1102, 0x11a0, 0x7834, 0x9005,
-	0x1188, 0x7a38, 0xd2fc, 0x0128, 0x70c4, 0x9005, 0x1110, 0x70c7,
-	0x0001, 0x2011, 0x5e83, 0x080c, 0x84f3, 0x709b, 0x0010, 0x080c,
-	0x5b70, 0x0010, 0x7093, 0x0000, 0x00fe, 0x0005, 0x00f6, 0x709b,
-	0x0003, 0x6043, 0x0004, 0x2011, 0x5e83, 0x080c, 0x84f3, 0x080c,
-	0x5f78, 0x2079, 0x0240, 0x7833, 0x1102, 0x7837, 0x0000, 0x20a9,
-	0x0008, 0x9f88, 0x000e, 0x200b, 0x0000, 0x8108, 0x1f04, 0x595b,
-	0x60c3, 0x0014, 0x080c, 0x5ead, 0x00fe, 0x0005, 0x00f6, 0x7090,
-	0x9005, 0x0500, 0x2011, 0x5e83, 0x080c, 0x84f3, 0x9086, 0x0014,
-	0x11b8, 0x080c, 0x5ff4, 0x2079, 0x0260, 0x7a30, 0x9296, 0x1102,
-	0x1178, 0x7834, 0x9005, 0x1160, 0x7a38, 0xd2fc, 0x0128, 0x70c4,
-	0x9005, 0x1110, 0x70c7, 0x0001, 0x709b, 0x0004, 0x0029, 0x0010,
-	0x080c, 0x5fd0, 0x00fe, 0x0005, 0x00f6, 0x709b, 0x0005, 0x080c,
-	0x5f78, 0x2079, 0x0240, 0x7833, 0x1103, 0x7837, 0x0000, 0x080c,
-	0x5ff4, 0x080c, 0x5fd7, 0x1170, 0x7084, 0x9005, 0x1158, 0x715c,
-	0x9186, 0xffff, 0x0138, 0x2011, 0x0008, 0x080c, 0x5e30, 0x0168,
-	0x080c, 0x5fad, 0x20a9, 0x0008, 0x20e1, 0x0000, 0x2099, 0x026e,
-	0x20e9, 0x0000, 0x20a1, 0x024e, 0x4003, 0x60c3, 0x0014, 0x080c,
-	0x5ead, 0x00fe, 0x0005, 0x00f6, 0x7090, 0x9005, 0x0500, 0x2011,
-	0x5e83, 0x080c, 0x84f3, 0x9086, 0x0014, 0x11b8, 0x080c, 0x5ff4,
-	0x2079, 0x0260, 0x7a30, 0x9296, 0x1103, 0x1178, 0x7834, 0x9005,
-	0x1160, 0x7a38, 0xd2fc, 0x0128, 0x70c4, 0x9005, 0x1110, 0x70c7,
-	0x0001, 0x709b, 0x0006, 0x0029, 0x0010, 0x080c, 0x5fd0, 0x00fe,
-	0x0005, 0x00f6, 0x709b, 0x0007, 0x080c, 0x5f78, 0x2079, 0x0240,
-	0x7833, 0x1104, 0x7837, 0x0000, 0x080c, 0x5ff4, 0x080c, 0x5fd7,
-	0x11b8, 0x7084, 0x9005, 0x11a0, 0x7164, 0x9186, 0xffff, 0x0180,
-	0x9180, 0x3325, 0x200d, 0x918c, 0xff00, 0x810f, 0x2011, 0x0008,
-	0x080c, 0x5e30, 0x0180, 0x080c, 0x4fe1, 0x0110, 0x080c, 0x28a7,
-	0x20a9, 0x0008, 0x20e1, 0x0000, 0x2099, 0x026e, 0x20e9, 0x0000,
-	0x20a1, 0x024e, 0x4003, 0x60c3, 0x0014, 0x080c, 0x5ead, 0x00fe,
-	0x0005, 0x00f6, 0x7090, 0x9005, 0x0500, 0x2011, 0x5e83, 0x080c,
-	0x84f3, 0x9086, 0x0014, 0x11b8, 0x080c, 0x5ff4, 0x2079, 0x0260,
-	0x7a30, 0x9296, 0x1104, 0x1178, 0x7834, 0x9005, 0x1160, 0x7a38,
-	0xd2fc, 0x0128, 0x70c4, 0x9005, 0x1110, 0x70c7, 0x0001, 0x709b,
-	0x0008, 0x0029, 0x0010, 0x080c, 0x5fd0, 0x00fe, 0x0005, 0x00f6,
-	0x709b, 0x0009, 0x080c, 0x5f78, 0x2079, 0x0240, 0x7833, 0x1105,
-	0x7837, 0x0100, 0x080c, 0x5fd7, 0x1150, 0x7084, 0x9005, 0x1138,
-	0x080c, 0x5da3, 0x1188, 0x9085, 0x0001, 0x080c, 0x28a7, 0x20a9,
-	0x0008, 0x080c, 0x5ff4, 0x20e1, 0x0000, 0x2099, 0x026e, 0x20e9,
-	0x0000, 0x20a1, 0x024e, 0x4003, 0x60c3, 0x0014, 0x080c, 0x5ead,
-	0x0010, 0x080c, 0x58fd, 0x00fe, 0x0005, 0x00f6, 0x7090, 0x9005,
-	0x05a8, 0x2011, 0x5e83, 0x080c, 0x84f3, 0x9086, 0x0014, 0x1560,
-	0x080c, 0x5ff4, 0x2079, 0x0260, 0x7a30, 0x9296, 0x1105, 0x1520,
-	0x7834, 0x9084, 0x0100, 0x2011, 0x0100, 0x921e, 0x1160, 0x7a38,
-	0xd2fc, 0x0128, 0x70c4, 0x9005, 0x1110, 0x70c7, 0x0001, 0x709b,
-	0x000a, 0x00b1, 0x0098, 0x9005, 0x1178, 0x7a38, 0xd2fc, 0x0128,
-	0x70c4, 0x9005, 0x1110, 0x70c7, 0x0001, 0x7097, 0x0000, 0x709b,
-	0x000e, 0x080c, 0x5b4b, 0x0010, 0x080c, 0x5fd0, 0x00fe, 0x0005,
-	0x00f6, 0x709b, 0x000b, 0x2011, 0x1c0e, 0x20e9, 0x0001, 0x22a0,
-	0x20a9, 0x0040, 0x2019, 0xffff, 0x4304, 0x080c, 0x5f78, 0x2079,
-	0x0240, 0x7833, 0x1106, 0x7837, 0x0000, 0x080c, 0x5fd7, 0x0118,
-	0x2013, 0x0000, 0x0020, 0x7060, 0x9085, 0x0100, 0x2012, 0x20a9,
-	0x0040, 0x2009, 0x024e, 0x2011, 0x1c0e, 0x220e, 0x8210, 0x8108,
-	0x9186, 0x0260, 0x1128, 0x6810, 0x8000, 0x6812, 0x2009, 0x0240,
-	0x1f04, 0x5acd, 0x60c3, 0x0084, 0x080c, 0x5ead, 0x00fe, 0x0005,
-	0x00f6, 0x7090, 0x9005, 0x01c0, 0x2011, 0x5e83, 0x080c, 0x84f3,
-	0x9086, 0x0084, 0x1178, 0x080c, 0x5ff4, 0x2079, 0x0260, 0x7a30,
-	0x9296, 0x1106, 0x1138, 0x7834, 0x9005, 0x1120, 0x709b, 0x000c,
-	0x0029, 0x0010, 0x080c, 0x5fd0, 0x00fe, 0x0005, 0x00f6, 0x709b,
-	0x000d, 0x080c, 0x5f78, 0x2079, 0x0240, 0x7833, 0x1107, 0x7837,
-	0x0000, 0x080c, 0x5ff4, 0x20a9, 0x0040, 0x2011, 0x026e, 0x2009,
-	0x024e, 0x220e, 0x8210, 0x8108, 0x9186, 0x0260, 0x1150, 0x6810,
-	0x8000, 0x6812, 0x2009, 0x0240, 0x6814, 0x8000, 0x6816, 0x2011,
-	0x0260, 0x1f04, 0x5b11, 0x60c3, 0x0084, 0x080c, 0x5ead, 0x00fe,
-	0x0005, 0x00f6, 0x7090, 0x9005, 0x01e0, 0x2011, 0x5e83, 0x080c,
-	0x84f3, 0x9086, 0x0084, 0x1198, 0x080c, 0x5ff4, 0x2079, 0x0260,
-	0x7a30, 0x9296, 0x1107, 0x1158, 0x7834, 0x9005, 0x1140, 0x7097,
-	0x0001, 0x080c, 0x5f4a, 0x709b, 0x000e, 0x0029, 0x0010, 0x080c,
-	0x5fd0, 0x00fe, 0x0005, 0x918d, 0x0001, 0x080c, 0x601f, 0x709b,
-	0x000f, 0x7093, 0x0000, 0x2061, 0x0140, 0x605b, 0xbc85, 0x605f,
-	0xb5b5, 0x2061, 0x0100, 0x6043, 0x0005, 0x6043, 0x0004, 0x2009,
-	0x07d0, 0x2011, 0x5e83, 0x080c, 0x84e7, 0x0005, 0x7090, 0x9005,
-	0x0130, 0x2011, 0x5e83, 0x080c, 0x84f3, 0x709b, 0x0000, 0x0005,
-	0x709b, 0x0011, 0x080c, 0xab21, 0x080c, 0x5ff4, 0x20e1, 0x0000,
-	0x2099, 0x0260, 0x20e9, 0x0000, 0x20a1, 0x0240, 0x7490, 0x9480,
-	0x0018, 0x9080, 0x0007, 0x9084, 0x03f8, 0x8004, 0x20a8, 0x4003,
-	0x080c, 0x5fd7, 0x11a0, 0x717c, 0x81ff, 0x0188, 0x900e, 0x7080,
-	0x9084, 0x00ff, 0x0160, 0x080c, 0x283e, 0x9186, 0x007e, 0x0138,
-	0x9186, 0x0080, 0x0120, 0x2011, 0x0008, 0x080c, 0x5e30, 0x60c3,
-	0x0014, 0x080c, 0x5ead, 0x0005, 0x00f6, 0x7090, 0x9005, 0x0500,
-	0x2011, 0x5e83, 0x080c, 0x84f3, 0x9086, 0x0014, 0x11b8, 0x080c,
-	0x5ff4, 0x2079, 0x0260, 0x7a30, 0x9296, 0x1103, 0x1178, 0x7834,
+	0x4003, 0x60c3, 0x000c, 0x600f, 0x0000, 0x080c, 0x5eb6, 0x00fe,
+	0x9006, 0x7092, 0x6043, 0x0008, 0x6042, 0x0005, 0x00f6, 0x7090,
+	0x7093, 0x0000, 0x9025, 0x0904, 0x58be, 0x6020, 0xd0b4, 0x1904,
+	0x58bc, 0x71a0, 0x81ff, 0x0904, 0x58aa, 0x9486, 0x000c, 0x1904,
+	0x58b7, 0x9480, 0x0018, 0x8004, 0x20a8, 0x080c, 0x5ffd, 0x2011,
+	0x0260, 0x2019, 0x1c00, 0x220c, 0x2304, 0x9106, 0x11e8, 0x8210,
+	0x8318, 0x1f04, 0x5863, 0x6043, 0x0004, 0x2061, 0x0140, 0x605b,
+	0xbc94, 0x605f, 0xf0f0, 0x2061, 0x0100, 0x6043, 0x0006, 0x708f,
+	0x0002, 0x709b, 0x0002, 0x2009, 0x07d0, 0x2011, 0x5e8c, 0x080c,
+	0x8574, 0x080c, 0x6004, 0x04c0, 0x080c, 0x5ffd, 0x2079, 0x0260,
+	0x7930, 0x918e, 0x1101, 0x1558, 0x7834, 0x9005, 0x1540, 0x7900,
+	0x918c, 0x00ff, 0x1118, 0x7804, 0x9005, 0x0190, 0x080c, 0x5ffd,
+	0x2011, 0x026e, 0x2019, 0x1805, 0x20a9, 0x0004, 0x220c, 0x2304,
+	0x9102, 0x0230, 0x11a0, 0x8210, 0x8318, 0x1f04, 0x589e, 0x0078,
+	0x70a3, 0x0000, 0x080c, 0x5ffd, 0x20e1, 0x0000, 0x2099, 0x0260,
+	0x20e9, 0x0001, 0x20a1, 0x1c00, 0x20a9, 0x0014, 0x4003, 0x6043,
+	0x0008, 0x6043, 0x0000, 0x0010, 0x00fe, 0x0005, 0x6040, 0x9085,
+	0x0100, 0x6042, 0x6020, 0xd0b4, 0x1db8, 0x080c, 0xab2c, 0x20e1,
+	0x0001, 0x2099, 0x1c00, 0x20e9, 0x0000, 0x20a1, 0x0240, 0x20a9,
+	0x0014, 0x4003, 0x60c3, 0x000c, 0x2011, 0x19f0, 0x2013, 0x0000,
+	0x7093, 0x0000, 0x60a3, 0x0056, 0x60a7, 0x9575, 0x080c, 0xa26b,
+	0x08d8, 0x0005, 0x7098, 0x908a, 0x001d, 0x1a0c, 0x0dd5, 0x000b,
+	0x0005, 0x5913, 0x5926, 0x594f, 0x596f, 0x5995, 0x59c4, 0x59ea,
+	0x5a22, 0x5a48, 0x5a76, 0x5ab1, 0x5ae9, 0x5b07, 0x5b32, 0x5b54,
+	0x5b6f, 0x5b79, 0x5bad, 0x5bd3, 0x5c02, 0x5c28, 0x5c60, 0x5ca4,
+	0x5ce1, 0x5d02, 0x5d5b, 0x5d7d, 0x5dab, 0x5dab, 0x00c6, 0x2061,
+	0x1800, 0x6003, 0x0007, 0x2061, 0x0100, 0x6004, 0x9084, 0xfff9,
+	0x6006, 0x00ce, 0x0005, 0x2061, 0x0140, 0x605b, 0xbc94, 0x605f,
+	0xf0f0, 0x2061, 0x0100, 0x6043, 0x0002, 0x709b, 0x0001, 0x2009,
+	0x07d0, 0x2011, 0x5e8c, 0x080c, 0x8574, 0x0005, 0x00f6, 0x7090,
+	0x9086, 0x0014, 0x1510, 0x6042, 0x6020, 0xd0b4, 0x11f0, 0x080c,
+	0x5ffd, 0x2079, 0x0260, 0x7a30, 0x9296, 0x1102, 0x11a0, 0x7834,
+	0x9005, 0x1188, 0x7a38, 0xd2fc, 0x0128, 0x70c4, 0x9005, 0x1110,
+	0x70c7, 0x0001, 0x2011, 0x5e8c, 0x080c, 0x84dc, 0x709b, 0x0010,
+	0x080c, 0x5b79, 0x0010, 0x7093, 0x0000, 0x00fe, 0x0005, 0x00f6,
+	0x709b, 0x0003, 0x6043, 0x0004, 0x2011, 0x5e8c, 0x080c, 0x84dc,
+	0x080c, 0x5f81, 0x2079, 0x0240, 0x7833, 0x1102, 0x7837, 0x0000,
+	0x20a9, 0x0008, 0x9f88, 0x000e, 0x200b, 0x0000, 0x8108, 0x1f04,
+	0x5964, 0x60c3, 0x0014, 0x080c, 0x5eb6, 0x00fe, 0x0005, 0x00f6,
+	0x7090, 0x9005, 0x0500, 0x2011, 0x5e8c, 0x080c, 0x84dc, 0x9086,
+	0x0014, 0x11b8, 0x080c, 0x5ffd, 0x2079, 0x0260, 0x7a30, 0x9296,
+	0x1102, 0x1178, 0x7834, 0x9005, 0x1160, 0x7a38, 0xd2fc, 0x0128,
+	0x70c4, 0x9005, 0x1110, 0x70c7, 0x0001, 0x709b, 0x0004, 0x0029,
+	0x0010, 0x080c, 0x5fd9, 0x00fe, 0x0005, 0x00f6, 0x709b, 0x0005,
+	0x080c, 0x5f81, 0x2079, 0x0240, 0x7833, 0x1103, 0x7837, 0x0000,
+	0x080c, 0x5ffd, 0x080c, 0x5fe0, 0x1170, 0x7084, 0x9005, 0x1158,
+	0x715c, 0x9186, 0xffff, 0x0138, 0x2011, 0x0008, 0x080c, 0x5e39,
+	0x0168, 0x080c, 0x5fb6, 0x20a9, 0x0008, 0x20e1, 0x0000, 0x2099,
+	0x026e, 0x20e9, 0x0000, 0x20a1, 0x024e, 0x4003, 0x60c3, 0x0014,
+	0x080c, 0x5eb6, 0x00fe, 0x0005, 0x00f6, 0x7090, 0x9005, 0x0500,
+	0x2011, 0x5e8c, 0x080c, 0x84dc, 0x9086, 0x0014, 0x11b8, 0x080c,
+	0x5ffd, 0x2079, 0x0260, 0x7a30, 0x9296, 0x1103, 0x1178, 0x7834,
 	0x9005, 0x1160, 0x7a38, 0xd2fc, 0x0128, 0x70c4, 0x9005, 0x1110,
-	0x70c7, 0x0001, 0x709b, 0x0012, 0x0029, 0x0010, 0x7093, 0x0000,
-	0x00fe, 0x0005, 0x00f6, 0x709b, 0x0013, 0x080c, 0x5f86, 0x2079,
-	0x0240, 0x7833, 0x1103, 0x7837, 0x0000, 0x080c, 0x5ff4, 0x080c,
-	0x5fd7, 0x1170, 0x7084, 0x9005, 0x1158, 0x715c, 0x9186, 0xffff,
-	0x0138, 0x2011, 0x0008, 0x080c, 0x5e30, 0x0168, 0x080c, 0x5fad,
-	0x20a9, 0x0008, 0x20e1, 0x0000, 0x2099, 0x026e, 0x20e9, 0x0000,
-	0x20a1, 0x024e, 0x4003, 0x60c3, 0x0014, 0x080c, 0x5ead, 0x00fe,
-	0x0005, 0x00f6, 0x7090, 0x9005, 0x0500, 0x2011, 0x5e83, 0x080c,
-	0x84f3, 0x9086, 0x0014, 0x11b8, 0x080c, 0x5ff4, 0x2079, 0x0260,
-	0x7a30, 0x9296, 0x1104, 0x1178, 0x7834, 0x9005, 0x1160, 0x7a38,
-	0xd2fc, 0x0128, 0x70c4, 0x9005, 0x1110, 0x70c7, 0x0001, 0x709b,
-	0x0014, 0x0029, 0x0010, 0x7093, 0x0000, 0x00fe, 0x0005, 0x00f6,
-	0x709b, 0x0015, 0x080c, 0x5f86, 0x2079, 0x0240, 0x7833, 0x1104,
-	0x7837, 0x0000, 0x080c, 0x5ff4, 0x080c, 0x5fd7, 0x11b8, 0x7084,
-	0x9005, 0x11a0, 0x7164, 0x9186, 0xffff, 0x0180, 0x9180, 0x3325,
-	0x200d, 0x918c, 0xff00, 0x810f, 0x2011, 0x0008, 0x080c, 0x5e30,
-	0x0180, 0x080c, 0x4fe1, 0x0110, 0x080c, 0x28a7, 0x20a9, 0x0008,
-	0x20e1, 0x0000, 0x2099, 0x026e, 0x20e9, 0x0000, 0x20a1, 0x024e,
-	0x4003, 0x60c3, 0x0014, 0x080c, 0x5ead, 0x00fe, 0x0005, 0x00f6,
-	0x7090, 0x9005, 0x05f0, 0x2011, 0x5e83, 0x080c, 0x84f3, 0x9086,
-	0x0014, 0x15a8, 0x080c, 0x5ff4, 0x2079, 0x0260, 0x7a30, 0x9296,
-	0x1105, 0x1568, 0x7834, 0x9084, 0x0100, 0x2011, 0x0100, 0x921e,
-	0x1168, 0x9085, 0x0001, 0x080c, 0x601f, 0x7a38, 0xd2fc, 0x0128,
-	0x70c4, 0x9005, 0x1110, 0x70c7, 0x0001, 0x0080, 0x9005, 0x11b8,
+	0x70c7, 0x0001, 0x709b, 0x0006, 0x0029, 0x0010, 0x080c, 0x5fd9,
+	0x00fe, 0x0005, 0x00f6, 0x709b, 0x0007, 0x080c, 0x5f81, 0x2079,
+	0x0240, 0x7833, 0x1104, 0x7837, 0x0000, 0x080c, 0x5ffd, 0x080c,
+	0x5fe0, 0x11b8, 0x7084, 0x9005, 0x11a0, 0x7164, 0x9186, 0xffff,
+	0x0180, 0x9180, 0x3327, 0x200d, 0x918c, 0xff00, 0x810f, 0x2011,
+	0x0008, 0x080c, 0x5e39, 0x0180, 0x080c, 0x4fea, 0x0110, 0x080c,
+	0x28a9, 0x20a9, 0x0008, 0x20e1, 0x0000, 0x2099, 0x026e, 0x20e9,
+	0x0000, 0x20a1, 0x024e, 0x4003, 0x60c3, 0x0014, 0x080c, 0x5eb6,
+	0x00fe, 0x0005, 0x00f6, 0x7090, 0x9005, 0x0500, 0x2011, 0x5e8c,
+	0x080c, 0x84dc, 0x9086, 0x0014, 0x11b8, 0x080c, 0x5ffd, 0x2079,
+	0x0260, 0x7a30, 0x9296, 0x1104, 0x1178, 0x7834, 0x9005, 0x1160,
+	0x7a38, 0xd2fc, 0x0128, 0x70c4, 0x9005, 0x1110, 0x70c7, 0x0001,
+	0x709b, 0x0008, 0x0029, 0x0010, 0x080c, 0x5fd9, 0x00fe, 0x0005,
+	0x00f6, 0x709b, 0x0009, 0x080c, 0x5f81, 0x2079, 0x0240, 0x7833,
+	0x1105, 0x7837, 0x0100, 0x080c, 0x5fe0, 0x1150, 0x7084, 0x9005,
+	0x1138, 0x080c, 0x5dac, 0x1188, 0x9085, 0x0001, 0x080c, 0x28a9,
+	0x20a9, 0x0008, 0x080c, 0x5ffd, 0x20e1, 0x0000, 0x2099, 0x026e,
+	0x20e9, 0x0000, 0x20a1, 0x024e, 0x4003, 0x60c3, 0x0014, 0x080c,
+	0x5eb6, 0x0010, 0x080c, 0x5906, 0x00fe, 0x0005, 0x00f6, 0x7090,
+	0x9005, 0x05a8, 0x2011, 0x5e8c, 0x080c, 0x84dc, 0x9086, 0x0014,
+	0x1560, 0x080c, 0x5ffd, 0x2079, 0x0260, 0x7a30, 0x9296, 0x1105,
+	0x1520, 0x7834, 0x9084, 0x0100, 0x2011, 0x0100, 0x921e, 0x1160,
 	0x7a38, 0xd2fc, 0x0128, 0x70c4, 0x9005, 0x1110, 0x70c7, 0x0001,
-	0x9085, 0x0001, 0x080c, 0x601f, 0x7097, 0x0000, 0x7a38, 0xd2f4,
-	0x0110, 0x70df, 0x0008, 0x709b, 0x0016, 0x0029, 0x0010, 0x7093,
-	0x0000, 0x00fe, 0x0005, 0x080c, 0xab21, 0x080c, 0x5ff4, 0x20e1,
-	0x0000, 0x2099, 0x0260, 0x20e9, 0x0000, 0x20a1, 0x0240, 0x20a9,
-	0x000e, 0x4003, 0x2011, 0x026d, 0x2204, 0x9084, 0x0100, 0x2011,
-	0x024d, 0x2012, 0x2011, 0x026e, 0x709b, 0x0017, 0x080c, 0x5fd7,
-	0x1150, 0x7084, 0x9005, 0x1138, 0x080c, 0x5da3, 0x1188, 0x9085,
-	0x0001, 0x080c, 0x28a7, 0x20a9, 0x0008, 0x080c, 0x5ff4, 0x20e1,
-	0x0000, 0x2099, 0x026e, 0x20e9, 0x0000, 0x20a1, 0x024e, 0x4003,
-	0x60c3, 0x0014, 0x080c, 0x5ead, 0x0010, 0x080c, 0x58fd, 0x0005,
-	0x00f6, 0x7090, 0x9005, 0x01d8, 0x2011, 0x5e83, 0x080c, 0x84f3,
-	0x9086, 0x0084, 0x1190, 0x080c, 0x5ff4, 0x2079, 0x0260, 0x7a30,
-	0x9296, 0x1106, 0x1150, 0x7834, 0x9005, 0x1138, 0x9006, 0x080c,
-	0x601f, 0x709b, 0x0018, 0x0029, 0x0010, 0x7093, 0x0000, 0x00fe,
-	0x0005, 0x00f6, 0x709b, 0x0019, 0x080c, 0x5f86, 0x2079, 0x0240,
-	0x7833, 0x1106, 0x7837, 0x0000, 0x080c, 0x5ff4, 0x2009, 0x026e,
-	0x2039, 0x1c0e, 0x20a9, 0x0040, 0x213e, 0x8738, 0x8108, 0x9186,
-	0x0280, 0x1128, 0x6814, 0x8000, 0x6816, 0x2009, 0x0260, 0x1f04,
-	0x5d0c, 0x2039, 0x1c0e, 0x080c, 0x5fd7, 0x11e8, 0x2728, 0x2514,
-	0x8207, 0x9084, 0x00ff, 0x8000, 0x2018, 0x9294, 0x00ff, 0x8007,
-	0x9205, 0x202a, 0x7060, 0x2310, 0x8214, 0x92a0, 0x1c0e, 0x2414,
-	0x938c, 0x0001, 0x0118, 0x9294, 0xff00, 0x0018, 0x9294, 0x00ff,
-	0x8007, 0x9215, 0x2222, 0x20a9, 0x0040, 0x2009, 0x024e, 0x270e,
-	0x8738, 0x8108, 0x9186, 0x0260, 0x1128, 0x6810, 0x8000, 0x6812,
-	0x2009, 0x0240, 0x1f04, 0x5d3f, 0x60c3, 0x0084, 0x080c, 0x5ead,
-	0x00fe, 0x0005, 0x00f6, 0x7090, 0x9005, 0x01e0, 0x2011, 0x5e83,
-	0x080c, 0x84f3, 0x9086, 0x0084, 0x1198, 0x080c, 0x5ff4, 0x2079,
+	0x709b, 0x000a, 0x00b1, 0x0098, 0x9005, 0x1178, 0x7a38, 0xd2fc,
+	0x0128, 0x70c4, 0x9005, 0x1110, 0x70c7, 0x0001, 0x7097, 0x0000,
+	0x709b, 0x000e, 0x080c, 0x5b54, 0x0010, 0x080c, 0x5fd9, 0x00fe,
+	0x0005, 0x00f6, 0x709b, 0x000b, 0x2011, 0x1c0e, 0x20e9, 0x0001,
+	0x22a0, 0x20a9, 0x0040, 0x2019, 0xffff, 0x4304, 0x080c, 0x5f81,
+	0x2079, 0x0240, 0x7833, 0x1106, 0x7837, 0x0000, 0x080c, 0x5fe0,
+	0x0118, 0x2013, 0x0000, 0x0020, 0x7060, 0x9085, 0x0100, 0x2012,
+	0x20a9, 0x0040, 0x2009, 0x024e, 0x2011, 0x1c0e, 0x220e, 0x8210,
+	0x8108, 0x9186, 0x0260, 0x1128, 0x6810, 0x8000, 0x6812, 0x2009,
+	0x0240, 0x1f04, 0x5ad6, 0x60c3, 0x0084, 0x080c, 0x5eb6, 0x00fe,
+	0x0005, 0x00f6, 0x7090, 0x9005, 0x01c0, 0x2011, 0x5e8c, 0x080c,
+	0x84dc, 0x9086, 0x0084, 0x1178, 0x080c, 0x5ffd, 0x2079, 0x0260,
+	0x7a30, 0x9296, 0x1106, 0x1138, 0x7834, 0x9005, 0x1120, 0x709b,
+	0x000c, 0x0029, 0x0010, 0x080c, 0x5fd9, 0x00fe, 0x0005, 0x00f6,
+	0x709b, 0x000d, 0x080c, 0x5f81, 0x2079, 0x0240, 0x7833, 0x1107,
+	0x7837, 0x0000, 0x080c, 0x5ffd, 0x20a9, 0x0040, 0x2011, 0x026e,
+	0x2009, 0x024e, 0x220e, 0x8210, 0x8108, 0x9186, 0x0260, 0x1150,
+	0x6810, 0x8000, 0x6812, 0x2009, 0x0240, 0x6814, 0x8000, 0x6816,
+	0x2011, 0x0260, 0x1f04, 0x5b1a, 0x60c3, 0x0084, 0x080c, 0x5eb6,
+	0x00fe, 0x0005, 0x00f6, 0x7090, 0x9005, 0x01e0, 0x2011, 0x5e8c,
+	0x080c, 0x84dc, 0x9086, 0x0084, 0x1198, 0x080c, 0x5ffd, 0x2079,
 	0x0260, 0x7a30, 0x9296, 0x1107, 0x1158, 0x7834, 0x9005, 0x1140,
-	0x7097, 0x0001, 0x080c, 0x5f4a, 0x709b, 0x001a, 0x0029, 0x0010,
-	0x7093, 0x0000, 0x00fe, 0x0005, 0x9085, 0x0001, 0x080c, 0x601f,
-	0x709b, 0x001b, 0x080c, 0xab21, 0x080c, 0x5ff4, 0x2011, 0x0260,
-	0x2009, 0x0240, 0x7490, 0x9480, 0x0018, 0x9080, 0x0007, 0x9084,
-	0x03f8, 0x8004, 0x20a8, 0x220e, 0x8210, 0x8108, 0x9186, 0x0260,
-	0x1150, 0x6810, 0x8000, 0x6812, 0x2009, 0x0240, 0x6814, 0x8000,
-	0x6816, 0x2011, 0x0260, 0x1f04, 0x5d8b, 0x60c3, 0x0084, 0x080c,
-	0x5ead, 0x0005, 0x0005, 0x0086, 0x0096, 0x2029, 0x1848, 0x252c,
-	0x20a9, 0x0008, 0x2041, 0x1c0e, 0x20e9, 0x0001, 0x28a0, 0x080c,
-	0x5ff4, 0x20e1, 0x0000, 0x2099, 0x026e, 0x4003, 0x20a9, 0x0008,
-	0x2011, 0x0007, 0xd5d4, 0x0108, 0x9016, 0x2800, 0x9200, 0x200c,
-	0x91a6, 0xffff, 0x1148, 0xd5d4, 0x0110, 0x8210, 0x0008, 0x8211,
-	0x1f04, 0x5dbd, 0x0804, 0x5e2c, 0x82ff, 0x1160, 0xd5d4, 0x0120,
-	0x91a6, 0x3fff, 0x0d90, 0x0020, 0x91a6, 0x3fff, 0x0904, 0x5e2c,
-	0x918d, 0xc000, 0x20a9, 0x0010, 0x2019, 0x0001, 0xd5d4, 0x0110,
-	0x2019, 0x0010, 0x2120, 0xd5d4, 0x0110, 0x8423, 0x0008, 0x8424,
-	0x1240, 0xd5d4, 0x0110, 0x8319, 0x0008, 0x8318, 0x1f04, 0x5de3,
-	0x04d8, 0x23a8, 0x2021, 0x0001, 0x8426, 0x8425, 0x1f04, 0x5df5,
-	0x2328, 0x8529, 0x92be, 0x0007, 0x0158, 0x0006, 0x2039, 0x0007,
-	0x2200, 0x973a, 0x000e, 0x27a8, 0x95a8, 0x0010, 0x1f04, 0x5e04,
-	0x755e, 0x95c8, 0x3325, 0x292d, 0x95ac, 0x00ff, 0x7582, 0x6532,
-	0x6536, 0x0016, 0x2508, 0x080c, 0x2887, 0x001e, 0x60e7, 0x0000,
-	0x65ea, 0x2018, 0x2304, 0x9405, 0x201a, 0x7087, 0x0001, 0x20e9,
-	0x0000, 0x20a1, 0x024e, 0x20e1, 0x0001, 0x2898, 0x20a9, 0x0008,
-	0x4003, 0x9085, 0x0001, 0x0008, 0x9006, 0x009e, 0x008e, 0x0005,
-	0x0156, 0x01c6, 0x01d6, 0x0136, 0x0146, 0x22a8, 0x20e1, 0x0000,
-	0x2099, 0x026e, 0x20e9, 0x0000, 0x2011, 0x024e, 0x22a0, 0x4003,
-	0x014e, 0x013e, 0x01de, 0x01ce, 0x015e, 0x2118, 0x9026, 0x2001,
-	0x0007, 0x939a, 0x0010, 0x0218, 0x8420, 0x8001, 0x0cd0, 0x2118,
-	0x84ff, 0x0120, 0x939a, 0x0010, 0x8421, 0x1de0, 0x2021, 0x0001,
-	0x83ff, 0x0118, 0x8423, 0x8319, 0x1de8, 0x9238, 0x2029, 0x026e,
-	0x9528, 0x2504, 0x942c, 0x11b8, 0x9405, 0x203a, 0x715e, 0x91a0,
-	0x3325, 0x242d, 0x95ac, 0x00ff, 0x7582, 0x6532, 0x6536, 0x0016,
-	0x2508, 0x080c, 0x2887, 0x001e, 0x60e7, 0x0000, 0x65ea, 0x7087,
-	0x0001, 0x9084, 0x0000, 0x0005, 0x00e6, 0x2071, 0x1800, 0x708b,
-	0x0000, 0x00ee, 0x0005, 0x00e6, 0x00f6, 0x2079, 0x0100, 0x2071,
-	0x0140, 0x080c, 0x5f39, 0x080c, 0xa273, 0x7004, 0x9084, 0x4000,
-	0x0110, 0x080c, 0x2cff, 0x0126, 0x2091, 0x8000, 0x2071, 0x1826,
-	0x2073, 0x0000, 0x7840, 0x0026, 0x0016, 0x2009, 0x00f7, 0x080c,
-	0x5f96, 0x001e, 0x9094, 0x0010, 0x9285, 0x0080, 0x7842, 0x7a42,
-	0x002e, 0x012e, 0x00fe, 0x00ee, 0x0005, 0x0126, 0x2091, 0x8000,
-	0x080c, 0x2ba5, 0x0228, 0x2011, 0x0101, 0x2204, 0xc0c5, 0x2012,
-	0x2011, 0x19f1, 0x2013, 0x0000, 0x7093, 0x0000, 0x012e, 0x60a3,
-	0x0056, 0x60a7, 0x9575, 0x080c, 0xa26a, 0x6144, 0xd184, 0x0120,
-	0x7198, 0x918d, 0x2000, 0x0018, 0x718c, 0x918d, 0x1000, 0x2011,
-	0x1999, 0x2112, 0x2009, 0x07d0, 0x2011, 0x5e83, 0x080c, 0x858b,
-	0x0005, 0x0016, 0x0026, 0x00c6, 0x0126, 0x2091, 0x8000, 0x080c,
-	0xadd2, 0x2009, 0x00f7, 0x080c, 0x5f96, 0x2061, 0x19fa, 0x900e,
-	0x611a, 0x611e, 0x6172, 0x6176, 0x2061, 0x1800, 0x6003, 0x0001,
-	0x2061, 0x0100, 0x6043, 0x0090, 0x6043, 0x0010, 0x2009, 0x1999,
-	0x200b, 0x0000, 0x2009, 0x002d, 0x2011, 0x5f05, 0x080c, 0x84e7,
-	0x012e, 0x00ce, 0x002e, 0x001e, 0x0005, 0x00e6, 0x0006, 0x0126,
-	0x2091, 0x8000, 0x0471, 0x2071, 0x0100, 0x080c, 0xa273, 0x2071,
-	0x0140, 0x7004, 0x9084, 0x4000, 0x0110, 0x080c, 0x2cff, 0x080c,
-	0x73c4, 0x0188, 0x080c, 0x73df, 0x1170, 0x080c, 0x76ae, 0x0016,
-	0x080c, 0x2956, 0x2001, 0x196d, 0x2102, 0x001e, 0x080c, 0x76a9,
-	0x080c, 0x72ee, 0x0050, 0x2009, 0x0001, 0x080c, 0x2c3e, 0x2001,
-	0x0001, 0x080c, 0x27ea, 0x080c, 0x5ed9, 0x012e, 0x000e, 0x00ee,
-	0x0005, 0x2001, 0x180e, 0x2004, 0xd0bc, 0x0158, 0x0026, 0x0036,
-	0x2011, 0x8017, 0x2001, 0x1999, 0x201c, 0x080c, 0x4b04, 0x003e,
-	0x002e, 0x0005, 0x20a9, 0x0012, 0x20e9, 0x0001, 0x20a1, 0x1c80,
-	0x080c, 0x5ff4, 0x20e9, 0x0000, 0x2099, 0x026e, 0x0099, 0x20a9,
-	0x0020, 0x080c, 0x5fee, 0x2099, 0x0260, 0x20a1, 0x1c92, 0x0051,
-	0x20a9, 0x000e, 0x080c, 0x5ff1, 0x2099, 0x0260, 0x20a1, 0x1cb2,
-	0x0009, 0x0005, 0x0016, 0x0026, 0x3410, 0x3308, 0x2104, 0x8007,
-	0x2012, 0x8108, 0x8210, 0x1f04, 0x5f6e, 0x002e, 0x001e, 0x0005,
-	0x080c, 0xab21, 0x20e1, 0x0001, 0x2099, 0x1c00, 0x20e9, 0x0000,
-	0x20a1, 0x0240, 0x20a9, 0x000c, 0x4003, 0x0005, 0x080c, 0xab21,
-	0x080c, 0x5ff4, 0x20e1, 0x0000, 0x2099, 0x0260, 0x20e9, 0x0000,
-	0x20a1, 0x0240, 0x20a9, 0x000c, 0x4003, 0x0005, 0x00c6, 0x0006,
-	0x2061, 0x0100, 0x810f, 0x2001, 0x1834, 0x2004, 0x9005, 0x1138,
-	0x2001, 0x1818, 0x2004, 0x9084, 0x00ff, 0x9105, 0x0010, 0x9185,
-	0x00f7, 0x604a, 0x000e, 0x00ce, 0x0005, 0x0016, 0x0046, 0x080c,
-	0x696e, 0x0158, 0x9006, 0x2020, 0x2009, 0x002a, 0x080c, 0xe5ae,
-	0x2001, 0x180c, 0x200c, 0xc195, 0x2102, 0x2019, 0x002a, 0x900e,
-	0x080c, 0x318a, 0x080c, 0xd230, 0x0140, 0x0036, 0x2019, 0xffff,
-	0x2021, 0x0007, 0x080c, 0x4cbb, 0x003e, 0x004e, 0x001e, 0x0005,
-	0x080c, 0x5ed9, 0x709b, 0x0000, 0x7093, 0x0000, 0x0005, 0x0006,
-	0x2001, 0x180c, 0x2004, 0xd09c, 0x0100, 0x000e, 0x0005, 0x0006,
-	0x0016, 0x0126, 0x2091, 0x8000, 0x2001, 0x0101, 0x200c, 0x918d,
-	0x0006, 0x2102, 0x012e, 0x001e, 0x000e, 0x0005, 0x2009, 0x0001,
-	0x0020, 0x2009, 0x0002, 0x0008, 0x900e, 0x6814, 0x9084, 0xffc0,
-	0x910d, 0x6916, 0x0005, 0x00f6, 0x0156, 0x0146, 0x01d6, 0x9006,
-	0x20a9, 0x0080, 0x20e9, 0x0001, 0x20a1, 0x1c00, 0x4004, 0x2079,
-	0x1c00, 0x7803, 0x2200, 0x7807, 0x00ef, 0x780f, 0x00ef, 0x7813,
-	0x0138, 0x7823, 0xffff, 0x7827, 0xffff, 0x01de, 0x014e, 0x015e,
-	0x00fe, 0x0005, 0x2001, 0x1800, 0x2003, 0x0001, 0x0005, 0x2001,
-	0x19a6, 0x0118, 0x2003, 0x0001, 0x0010, 0x2003, 0x0000, 0x0005,
-	0x0156, 0x20a9, 0x0800, 0x2009, 0x1000, 0x9006, 0x200a, 0x8108,
-	0x1f04, 0x602e, 0x015e, 0x0005, 0x00d6, 0x0036, 0x0156, 0x0136,
-	0x0146, 0x2069, 0x1847, 0x9006, 0xb802, 0xb8ce, 0xb807, 0x0707,
-	0xb80a, 0xb80e, 0xb812, 0x9198, 0x3325, 0x231d, 0x939c, 0x00ff,
-	0xbb16, 0x0016, 0x0026, 0xb8c2, 0x080c, 0xadcb, 0x1120, 0x9192,
-	0x007e, 0x1208, 0xbbc2, 0x20a9, 0x0004, 0xb8c4, 0x20e8, 0xb9c8,
-	0x9198, 0x0006, 0x9006, 0x23a0, 0x4004, 0x20a9, 0x0004, 0x9198,
-	0x000a, 0x23a0, 0x4004, 0x002e, 0x001e, 0xb83e, 0xb842, 0xb84e,
-	0xb852, 0xb856, 0xb85a, 0xb85e, 0xb862, 0xb866, 0xb86a, 0xb86f,
-	0x0100, 0xb872, 0xb876, 0xb87a, 0xb88a, 0xb88e, 0xb893, 0x0008,
-	0xb896, 0xb89a, 0xb89e, 0xb8be, 0xb9a2, 0x0096, 0xb8a4, 0x904d,
-	0x0110, 0x080c, 0x1031, 0xb8a7, 0x0000, 0x009e, 0x9006, 0xb84a,
-	0x6810, 0xb83a, 0x680c, 0xb846, 0xb8bb, 0x0520, 0xb8ac, 0x9005,
-	0x0198, 0x00c6, 0x2060, 0x9c82, 0x1cd0, 0x0a0c, 0x0dd5, 0x2001,
-	0x181a, 0x2004, 0x9c02, 0x1a0c, 0x0dd5, 0x080c, 0x8981, 0x00ce,
-	0x090c, 0x8d25, 0xb8af, 0x0000, 0x6814, 0x9084, 0x00ff, 0xb842,
-	0x014e, 0x013e, 0x015e, 0x003e, 0x00de, 0x0005, 0x0126, 0x2091,
-	0x8000, 0xa974, 0xae78, 0x9684, 0x3fff, 0x9082, 0x4000, 0x1a04,
-	0x611c, 0x9182, 0x0800, 0x1a04, 0x6120, 0x2001, 0x180c, 0x2004,
-	0x9084, 0x0003, 0x1904, 0x6126, 0x9188, 0x1000, 0x2104, 0x905d,
-	0x0518, 0xb804, 0x9084, 0x00ff, 0x908e, 0x0006, 0x1508, 0xb8a4,
-	0x900d, 0x1904, 0x6138, 0xb850, 0x900d, 0x1148, 0xa802, 0x2900,
-	0xb852, 0xb84e, 0x080c, 0x910d, 0x9006, 0x012e, 0x0005, 0x00a6,
-	0x2150, 0x2900, 0xb002, 0xa803, 0x0000, 0x00ae, 0xb852, 0x0c90,
-	0x2001, 0x0005, 0x900e, 0x04b8, 0x2001, 0x0028, 0x900e, 0x0498,
-	0x9082, 0x0006, 0x1290, 0x080c, 0xadcb, 0x1160, 0xb8a0, 0x9084,
-	0xff80, 0x1140, 0xb900, 0xd1fc, 0x0990, 0x2001, 0x0029, 0x2009,
-	0x1000, 0x0408, 0x2001, 0x0028, 0x00a8, 0x2009, 0x180c, 0x210c,
-	0xd18c, 0x0118, 0x2001, 0x0004, 0x0068, 0xd184, 0x0118, 0x2001,
-	0x0004, 0x0040, 0x2001, 0x0029, 0xb900, 0xd1fc, 0x0118, 0x2009,
-	0x1000, 0x0048, 0x900e, 0x0038, 0x2001, 0x0029, 0x900e, 0x0018,
-	0x2001, 0x0029, 0x900e, 0x9005, 0x012e, 0x0005, 0x2001, 0x180c,
-	0x2004, 0xd084, 0x19d0, 0x9188, 0x1000, 0x2104, 0x905d, 0x09a8,
-	0x080c, 0x6972, 0x1990, 0xb800, 0xd0bc, 0x0978, 0x0804, 0x60cf,
-	0x080c, 0x679b, 0x0904, 0x60e8, 0x0804, 0x60d3, 0x00b6, 0x00e6,
-	0x0126, 0x2091, 0x8000, 0xa874, 0x908e, 0x00ff, 0x1120, 0x2001,
-	0x196b, 0x205c, 0x0060, 0xa974, 0x9182, 0x0800, 0x1690, 0x9188,
-	0x1000, 0x2104, 0x905d, 0x01d0, 0x080c, 0x6912, 0x11d0, 0x080c,
-	0xae0b, 0x0570, 0x2b00, 0x6012, 0x2900, 0x6016, 0x6023, 0x0009,
-	0x600b, 0x0000, 0xa874, 0x908e, 0x00ff, 0x1110, 0x600b, 0x8000,
-	0x2009, 0x0043, 0x080c, 0xaedc, 0x9006, 0x00b0, 0x2001, 0x0028,
-	0x0090, 0x2009, 0x180c, 0x210c, 0xd18c, 0x0118, 0x2001, 0x0004,
-	0x0038, 0xd184, 0x0118, 0x2001, 0x0004, 0x0010, 0x2001, 0x0029,
-	0x0010, 0x2001, 0x0029, 0x9005, 0x012e, 0x00ee, 0x00be, 0x0005,
-	0x2001, 0x002c, 0x0cc0, 0x00b6, 0x00e6, 0x0126, 0x2091, 0x8000,
-	0xa974, 0x9182, 0x0800, 0x1a04, 0x6206, 0x9188, 0x1000, 0x2104,
-	0x905d, 0x0904, 0x61de, 0xb8a0, 0x9086, 0x007f, 0x0178, 0x080c,
-	0x697a, 0x0160, 0xa994, 0x81ff, 0x0130, 0x908e, 0x0004, 0x0130,
-	0x908e, 0x0005, 0x0118, 0x080c, 0x6972, 0x1598, 0xa87c, 0xd0fc,
-	0x01e0, 0xa894, 0x9005, 0x01c8, 0x2060, 0x0026, 0x2010, 0x080c,
-	0xcb23, 0x002e, 0x1120, 0x2001, 0x0008, 0x0804, 0x6208, 0x6020,
-	0x9086, 0x000a, 0x0120, 0x2001, 0x0008, 0x0804, 0x6208, 0x601a,
-	0x6003, 0x0008, 0x2900, 0x6016, 0x0058, 0x080c, 0xae0b, 0x05e8,
-	0x2b00, 0x6012, 0x2900, 0x6016, 0x600b, 0xffff, 0x6023, 0x000a,
-	0x2009, 0x0003, 0x080c, 0xaedc, 0x9006, 0x0458, 0x2001, 0x0028,
-	0x0438, 0x9082, 0x0006, 0x1290, 0x080c, 0xadcb, 0x1160, 0xb8a0,
-	0x9084, 0xff80, 0x1140, 0xb900, 0xd1fc, 0x0900, 0x2001, 0x0029,
-	0x2009, 0x1000, 0x00a8, 0x2001, 0x0028, 0x0090, 0x2009, 0x180c,
-	0x210c, 0xd18c, 0x0118, 0x2001, 0x0004, 0x0050, 0xd184, 0x0118,
-	0x2001, 0x0004, 0x0028, 0x2001, 0x0029, 0x0010, 0x2001, 0x0029,
-	0x9005, 0x012e, 0x00ee, 0x00be, 0x0005, 0x2001, 0x002c, 0x0cc0,
-	0x00f6, 0x00b6, 0x0126, 0x2091, 0x8000, 0xa8e0, 0x9005, 0x1550,
-	0xa8dc, 0x9082, 0x0101, 0x1630, 0xa8c8, 0x9005, 0x1518, 0xa8c4,
-	0x9082, 0x0101, 0x12f8, 0xa974, 0x2079, 0x1800, 0x9182, 0x0800,
-	0x12e8, 0x7830, 0x9084, 0x0003, 0x1130, 0xaa98, 0xab94, 0xa878,
-	0x9084, 0x0007, 0x00ea, 0x7930, 0xd18c, 0x0118, 0x2001, 0x0004,
-	0x0038, 0xd184, 0x0118, 0x2001, 0x0004, 0x0010, 0x2001, 0x0029,
-	0x900e, 0x0038, 0x2001, 0x002c, 0x900e, 0x0018, 0x2001, 0x0029,
-	0x900e, 0x9006, 0x0008, 0x9005, 0x012e, 0x00be, 0x00fe, 0x0005,
-	0x629d, 0x6258, 0x626f, 0x629d, 0x629d, 0x629d, 0x629d, 0x629d,
-	0x2100, 0x9082, 0x007e, 0x1278, 0x080c, 0x659e, 0x0148, 0x9046,
-	0xb810, 0x9306, 0x1904, 0x62a5, 0xb814, 0x9206, 0x15f0, 0x0028,
-	0xbb12, 0xba16, 0x0010, 0x080c, 0x49b7, 0x0150, 0x04b0, 0x080c,
-	0x65ff, 0x1598, 0xb810, 0x9306, 0x1580, 0xb814, 0x9206, 0x1568,
-	0x080c, 0xae0b, 0x0530, 0x2b00, 0x6012, 0x080c, 0xcfaa, 0x2900,
-	0x6016, 0x600b, 0xffff, 0x6023, 0x000a, 0xa878, 0x9086, 0x0001,
-	0x1170, 0x080c, 0x31bf, 0x9006, 0x080c, 0x653b, 0x2001, 0x0002,
-	0x080c, 0x654f, 0x2001, 0x0200, 0xb86e, 0xb893, 0x0002, 0x2009,
-	0x0003, 0x080c, 0xaedc, 0x9006, 0x0068, 0x2001, 0x0001, 0x900e,
-	0x0038, 0x2001, 0x002c, 0x900e, 0x0018, 0x2001, 0x0028, 0x900e,
-	0x9005, 0x0000, 0x012e, 0x00be, 0x00fe, 0x0005, 0x00b6, 0x00f6,
-	0x00e6, 0x0126, 0x2091, 0x8000, 0xa894, 0x90c6, 0x0015, 0x0904,
-	0x648c, 0x90c6, 0x0056, 0x0904, 0x6490, 0x90c6, 0x0066, 0x0904,
-	0x6494, 0x90c6, 0x0067, 0x0904, 0x6498, 0x90c6, 0x0068, 0x0904,
-	0x649c, 0x90c6, 0x0071, 0x0904, 0x64a0, 0x90c6, 0x0074, 0x0904,
-	0x64a4, 0x90c6, 0x007c, 0x0904, 0x64a8, 0x90c6, 0x007e, 0x0904,
-	0x64ac, 0x90c6, 0x0037, 0x0904, 0x64b0, 0x9016, 0x2079, 0x1800,
-	0xa974, 0x9186, 0x00ff, 0x0904, 0x6487, 0x9182, 0x0800, 0x1a04,
-	0x6487, 0x080c, 0x65ff, 0x1198, 0xb804, 0x9084, 0x00ff, 0x9082,
-	0x0006, 0x1268, 0xa894, 0x90c6, 0x006f, 0x0148, 0x080c, 0xadcb,
-	0x1904, 0x6470, 0xb8a0, 0x9084, 0xff80, 0x1904, 0x6470, 0xa894,
-	0x90c6, 0x006f, 0x0158, 0x90c6, 0x005e, 0x0904, 0x63d0, 0x90c6,
-	0x0064, 0x0904, 0x63f9, 0x2008, 0x0804, 0x6392, 0xa998, 0xa8b0,
-	0x2040, 0x080c, 0xadcb, 0x1120, 0x9182, 0x007f, 0x0a04, 0x6392,
-	0x9186, 0x00ff, 0x0904, 0x6392, 0x9182, 0x0800, 0x1a04, 0x6392,
-	0xaaa0, 0xab9c, 0x787c, 0x9306, 0x1188, 0x7880, 0x0096, 0x924e,
-	0x1128, 0x2208, 0x2310, 0x009e, 0x0804, 0x6392, 0x99cc, 0xff00,
-	0x009e, 0x1120, 0x2208, 0x2310, 0x0804, 0x6392, 0x080c, 0x49b7,
-	0x0904, 0x639c, 0x900e, 0x9016, 0x90c6, 0x4000, 0x15e0, 0x0006,
-	0x080c, 0x681f, 0x1108, 0xc185, 0xb800, 0xd0bc, 0x0108, 0xc18d,
-	0x20a9, 0x0004, 0xa860, 0x20e8, 0xa85c, 0x9080, 0x0031, 0x20a0,
-	0xb8c4, 0x20e0, 0xb8c8, 0x9080, 0x0006, 0x2098, 0x080c, 0x0f7c,
-	0x20a9, 0x0004, 0xa860, 0x20e8, 0xa85c, 0x9080, 0x0035, 0x20a0,
-	0xb8c4, 0x20e0, 0xb8c8, 0x9080, 0x000a, 0x2098, 0x080c, 0x0f7c,
-	0xa8c4, 0xabc8, 0x9305, 0xabcc, 0x9305, 0xabd0, 0x9305, 0xabd4,
-	0x9305, 0xabd8, 0x9305, 0xabdc, 0x9305, 0xabe0, 0x9305, 0x9005,
-	0x0510, 0x000e, 0x00c8, 0x90c6, 0x4007, 0x1110, 0x2408, 0x00a0,
-	0x90c6, 0x4008, 0x1118, 0x2708, 0x2610, 0x0070, 0x90c6, 0x4009,
-	0x1108, 0x0050, 0x90c6, 0x4006, 0x0138, 0x2001, 0x4005, 0x2009,
-	0x000a, 0x0010, 0x2001, 0x4006, 0xa896, 0xa99a, 0xaa9e, 0x2001,
-	0x0030, 0x900e, 0x0478, 0x000e, 0x080c, 0xae0b, 0x1130, 0x2001,
-	0x4005, 0x2009, 0x0003, 0x9016, 0x0c78, 0x2b00, 0x6012, 0x080c,
-	0xcfaa, 0x2900, 0x6016, 0x6023, 0x0001, 0xa868, 0xd88c, 0x0108,
-	0xc0f5, 0xa86a, 0x0126, 0x2091, 0x8000, 0x080c, 0x31bf, 0x012e,
-	0x9006, 0x080c, 0x653b, 0x2001, 0x0002, 0x080c, 0x654f, 0x2009,
-	0x0002, 0x080c, 0xaedc, 0xa8b0, 0xd094, 0x0118, 0xb8cc, 0xc08d,
-	0xb8ce, 0x9006, 0x9005, 0x012e, 0x00ee, 0x00fe, 0x00be, 0x0005,
-	0x080c, 0x56e3, 0x0118, 0x2009, 0x0007, 0x00f8, 0xa998, 0xaeb0,
-	0x080c, 0x65ff, 0x1904, 0x638d, 0x9186, 0x007f, 0x0130, 0x080c,
-	0x6972, 0x0118, 0x2009, 0x0009, 0x0080, 0x0096, 0x080c, 0x0fff,
-	0x1120, 0x009e, 0x2009, 0x0002, 0x0040, 0x2900, 0x009e, 0xa806,
-	0x080c, 0xcd1b, 0x19b0, 0x2009, 0x0003, 0x2001, 0x4005, 0x0804,
-	0x6394, 0xa998, 0xaeb0, 0x080c, 0x65ff, 0x1904, 0x638d, 0x0096,
-	0x080c, 0x0fff, 0x1128, 0x009e, 0x2009, 0x0002, 0x0804, 0x644d,
-	0x2900, 0x009e, 0xa806, 0x0096, 0x2048, 0x20a9, 0x002b, 0xb8c4,
-	0x20e0, 0xb8c8, 0x2098, 0xa860, 0x20e8, 0xa85c, 0x9080, 0x0002,
-	0x20a0, 0x4003, 0x20a9, 0x0008, 0x9080, 0x0006, 0x20a0, 0xbbc8,
-	0x9398, 0x0006, 0x2398, 0x080c, 0x0f7c, 0x009e, 0xa87b, 0x0000,
-	0xa883, 0x0000, 0xa897, 0x4000, 0xd684, 0x1168, 0x080c, 0x56cf,
-	0xd0b4, 0x1118, 0xa89b, 0x000b, 0x00e0, 0xb800, 0xd08c, 0x0118,
-	0xa89b, 0x000c, 0x00b0, 0x080c, 0x6972, 0x0118, 0xa89b, 0x0009,
-	0x0080, 0x080c, 0x56e3, 0x0118, 0xa89b, 0x0007, 0x0050, 0x080c,
-	0xccfe, 0x1904, 0x63c9, 0x2009, 0x0003, 0x2001, 0x4005, 0x0804,
-	0x6394, 0xa87b, 0x0030, 0xa897, 0x4005, 0xa804, 0x8006, 0x8006,
-	0x8007, 0x90bc, 0x003f, 0x9084, 0xffc0, 0x9080, 0x0002, 0x2009,
-	0x002b, 0xaaa0, 0xab9c, 0xaca8, 0xada4, 0x2031, 0x0000, 0x2041,
-	0x1243, 0x080c, 0xb37a, 0x1904, 0x63c9, 0x2009, 0x0002, 0x08e8,
-	0x2001, 0x0028, 0x900e, 0x0804, 0x63ca, 0x2009, 0x180c, 0x210c,
-	0xd18c, 0x0118, 0x2001, 0x0004, 0x0038, 0xd184, 0x0118, 0x2001,
-	0x0004, 0x0010, 0x2001, 0x0029, 0x900e, 0x0804, 0x63ca, 0x2001,
-	0x0029, 0x900e, 0x0804, 0x63ca, 0x080c, 0x3749, 0x0804, 0x63cb,
-	0x080c, 0x540c, 0x0804, 0x63cb, 0x080c, 0x4547, 0x0804, 0x63cb,
-	0x080c, 0x45c0, 0x0804, 0x63cb, 0x080c, 0x461c, 0x0804, 0x63cb,
-	0x080c, 0x4a7a, 0x0804, 0x63cb, 0x080c, 0x4d31, 0x0804, 0x63cb,
-	0x080c, 0x5077, 0x0804, 0x63cb, 0x080c, 0x5270, 0x0804, 0x63cb,
-	0x080c, 0x395f, 0x0804, 0x63cb, 0x00b6, 0xa974, 0xae78, 0x9684,
-	0x3fff, 0x9082, 0x4000, 0x1618, 0x9182, 0x0800, 0x1268, 0x9188,
-	0x1000, 0x2104, 0x905d, 0x0140, 0x080c, 0x6972, 0x1148, 0x00e9,
-	0x080c, 0x672a, 0x9006, 0x00b0, 0x2001, 0x0028, 0x900e, 0x0090,
-	0x9082, 0x0006, 0x1240, 0xb900, 0xd1fc, 0x0d88, 0x2001, 0x0029,
-	0x2009, 0x1000, 0x0038, 0x2001, 0x0029, 0x900e, 0x0018, 0x2001,
-	0x0029, 0x900e, 0x9005, 0x00be, 0x0005, 0x0126, 0x2091, 0x8000,
-	0xb850, 0x900d, 0x0150, 0x2900, 0x0096, 0x2148, 0xa802, 0x009e,
-	0xa803, 0x0000, 0xb852, 0x012e, 0x0005, 0x2900, 0xb852, 0xb84e,
-	0xa803, 0x0000, 0x0cc0, 0x0126, 0x2091, 0x8000, 0xb84c, 0x9005,
-	0x0170, 0x00e6, 0x2071, 0x19e7, 0x7004, 0x9086, 0x0002, 0x0168,
-	0x00ee, 0xb84c, 0xa802, 0x2900, 0xb84e, 0x012e, 0x0005, 0x2900,
-	0xb852, 0xb84e, 0xa803, 0x0000, 0x0cc0, 0x701c, 0x9b06, 0x1d80,
-	0xb84c, 0x00a6, 0x2050, 0xb000, 0xa802, 0x2900, 0xb002, 0x00ae,
-	0x00ee, 0x012e, 0x0005, 0x0126, 0x2091, 0x8000, 0xb84c, 0x904d,
-	0x0130, 0xa800, 0x9005, 0x1108, 0xb852, 0xb84e, 0x9905, 0x012e,
-	0x0005, 0xb84c, 0x904d, 0x0130, 0xa800, 0x9005, 0x1108, 0xb852,
-	0xb84e, 0x9905, 0x0005, 0x00b6, 0x0126, 0x00c6, 0x0026, 0x2091,
-	0x8000, 0x6210, 0x2258, 0xba00, 0x9005, 0x0110, 0xc285, 0x0008,
-	0xc284, 0xba02, 0x002e, 0x00ce, 0x012e, 0x00be, 0x0005, 0x00b6,
-	0x0126, 0x00c6, 0x2091, 0x8000, 0x6210, 0x2258, 0xba04, 0x0006,
-	0x9086, 0x0006, 0x1170, 0xb89c, 0xd0ac, 0x0158, 0x080c, 0x696e,
-	0x0140, 0x9284, 0xff00, 0x8007, 0x9086, 0x0007, 0x1110, 0x2011,
-	0x0600, 0x000e, 0x9294, 0xff00, 0x9215, 0xba06, 0x0006, 0x9086,
-	0x0006, 0x1120, 0xba90, 0x82ff, 0x090c, 0x0dd5, 0x000e, 0x00ce,
-	0x012e, 0x00be, 0x0005, 0x00b6, 0x0126, 0x00c6, 0x2091, 0x8000,
-	0x6210, 0x2258, 0xba04, 0x0006, 0x9086, 0x0006, 0x1168, 0xb89c,
-	0xd0a4, 0x0150, 0x080c, 0x696a, 0x1138, 0x9284, 0x00ff, 0x9086,
-	0x0007, 0x1110, 0x2011, 0x0006, 0x000e, 0x9294, 0x00ff, 0x8007,
-	0x9215, 0xba06, 0x00ce, 0x012e, 0x00be, 0x0005, 0x9182, 0x0800,
-	0x0218, 0x9085, 0x0001, 0x0005, 0x00d6, 0x0026, 0x9190, 0x1000,
-	0x2204, 0x905d, 0x1188, 0x0096, 0x080c, 0x0fff, 0x2958, 0x009e,
-	0x0168, 0x2b00, 0x2012, 0xb85c, 0xb8ca, 0xb860, 0xb8c6, 0x9006,
-	0xb8a6, 0xb8ae, 0x080c, 0x6034, 0x9006, 0x0010, 0x9085, 0x0001,
-	0x002e, 0x00de, 0x0005, 0x00b6, 0x0096, 0x0126, 0x2091, 0x8000,
-	0x0026, 0x9182, 0x0800, 0x0218, 0x9085, 0x0001, 0x0458, 0x00d6,
-	0x9190, 0x1000, 0x2204, 0x905d, 0x0518, 0x2013, 0x0000, 0xb8a4,
-	0x904d, 0x0110, 0x080c, 0x1031, 0x00d6, 0x00c6, 0xb8bc, 0x2060,
-	0x8cff, 0x0168, 0x600c, 0x0006, 0x6014, 0x2048, 0x080c, 0xcb35,
-	0x0110, 0x080c, 0x0fb1, 0x080c, 0xae61, 0x00ce, 0x0c88, 0x00ce,
-	0x00de, 0x2b48, 0xb8c8, 0xb85e, 0xb8c4, 0xb862, 0x080c, 0x1041,
-	0x00de, 0x9006, 0x002e, 0x012e, 0x009e, 0x00be, 0x0005, 0x0016,
-	0x9182, 0x0800, 0x0218, 0x9085, 0x0001, 0x0030, 0x9188, 0x1000,
-	0x2104, 0x905d, 0x0dc0, 0x9006, 0x001e, 0x0005, 0x00d6, 0x0156,
-	0x0136, 0x0146, 0x9006, 0xb80a, 0xb80e, 0xb800, 0xc08c, 0xb802,
-	0x080c, 0x73bc, 0x1510, 0xb8a0, 0x9086, 0x007e, 0x0120, 0x080c,
-	0xadcb, 0x11d8, 0x0078, 0x7040, 0xd0e4, 0x01b8, 0x00c6, 0x2061,
-	0x1982, 0x7048, 0x2062, 0x704c, 0x6006, 0x7050, 0x600a, 0x7054,
-	0x600e, 0x00ce, 0x703c, 0x2069, 0x0140, 0x9005, 0x1110, 0x2001,
-	0x0001, 0x6886, 0x2069, 0x1800, 0x68b6, 0x7040, 0xb85e, 0x7048,
-	0xb862, 0x704c, 0xb866, 0x20e1, 0x0000, 0x2099, 0x0276, 0xb8c4,
-	0x20e8, 0xb8c8, 0x9088, 0x000a, 0x21a0, 0x20a9, 0x0004, 0x4003,
-	0x2099, 0x027a, 0x9088, 0x0006, 0x21a0, 0x20a9, 0x0004, 0x4003,
-	0x2069, 0x0200, 0x6817, 0x0001, 0x7040, 0xb86a, 0x7144, 0xb96e,
-	0x7048, 0xb872, 0x7050, 0xb876, 0x2069, 0x0200, 0x6817, 0x0000,
-	0xb8a0, 0x9086, 0x007e, 0x1110, 0x7144, 0xb96e, 0x9182, 0x0211,
-	0x1218, 0x2009, 0x0008, 0x0400, 0x9182, 0x0259, 0x1218, 0x2009,
-	0x0007, 0x00d0, 0x9182, 0x02c1, 0x1218, 0x2009, 0x0006, 0x00a0,
-	0x9182, 0x0349, 0x1218, 0x2009, 0x0005, 0x0070, 0x9182, 0x0421,
-	0x1218, 0x2009, 0x0004, 0x0040, 0x9182, 0x0581, 0x1218, 0x2009,
-	0x0003, 0x0010, 0x2009, 0x0002, 0xb992, 0x014e, 0x013e, 0x015e,
-	0x00de, 0x0005, 0x0016, 0x0026, 0x00e6, 0x2071, 0x0260, 0x7034,
-	0xb896, 0x703c, 0xb89a, 0x7054, 0xb89e, 0x0036, 0xbbcc, 0xc384,
-	0xba00, 0x2009, 0x1867, 0x210c, 0xd0bc, 0x0120, 0xd1ec, 0x0110,
-	0xc2ad, 0x0008, 0xc2ac, 0xd0c4, 0x0148, 0xd1e4, 0x0138, 0xc2bd,
-	0xd0cc, 0x0128, 0xd38c, 0x1108, 0xc385, 0x0008, 0xc2bc, 0xba02,
-	0xbbce, 0x003e, 0x00ee, 0x002e, 0x001e, 0x0005, 0x0096, 0x0126,
-	0x2091, 0x8000, 0xb8a4, 0x904d, 0x0578, 0xa900, 0x81ff, 0x15c0,
-	0xaa04, 0x9282, 0x0010, 0x16c8, 0x0136, 0x0146, 0x01c6, 0x01d6,
-	0x8906, 0x8006, 0x8007, 0x908c, 0x003f, 0x21e0, 0x9084, 0xffc0,
-	0x9080, 0x0004, 0x2098, 0x2009, 0x0010, 0x20a9, 0x0001, 0x4002,
-	0x9086, 0xffff, 0x0120, 0x8109, 0x1dd0, 0x080c, 0x0dd5, 0x3c00,
-	0x20e8, 0x3300, 0x8001, 0x20a0, 0x4604, 0x8210, 0xaa06, 0x01de,
-	0x01ce, 0x014e, 0x013e, 0x0060, 0x080c, 0x0fff, 0x0170, 0x2900,
-	0xb8a6, 0xa803, 0x0000, 0x080c, 0x67bb, 0xa807, 0x0001, 0xae12,
-	0x9085, 0x0001, 0x012e, 0x009e, 0x0005, 0x9006, 0x0cd8, 0x0126,
-	0x2091, 0x8000, 0x0096, 0xb8a4, 0x904d, 0x0188, 0xa800, 0x9005,
-	0x1150, 0x080c, 0x67ca, 0x1158, 0xa804, 0x908a, 0x0002, 0x0218,
-	0x8001, 0xa806, 0x0020, 0x080c, 0x1031, 0xb8a7, 0x0000, 0x009e,
-	0x012e, 0x0005, 0x0126, 0x2091, 0x8000, 0x080c, 0x910d, 0x012e,
-	0x0005, 0x901e, 0x0010, 0x2019, 0x0001, 0x900e, 0x0126, 0x2091,
-	0x8000, 0xb84c, 0x2048, 0xb800, 0xd0dc, 0x1170, 0x89ff, 0x0500,
-	0x83ff, 0x0120, 0xa878, 0x9606, 0x0158, 0x0030, 0xa86c, 0x9406,
-	0x1118, 0xa870, 0x9506, 0x0120, 0x2908, 0xa800, 0x2048, 0x0c70,
-	0x080c, 0xa692, 0xaa00, 0xb84c, 0x9906, 0x1110, 0xba4e, 0x0020,
-	0x00a6, 0x2150, 0xb202, 0x00ae, 0x82ff, 0x1110, 0xb952, 0x89ff,
-	0x012e, 0x0005, 0x9016, 0x0489, 0x1110, 0x2011, 0x0001, 0x0005,
-	0x080c, 0x681f, 0x0128, 0x080c, 0xcbf2, 0x0010, 0x9085, 0x0001,
-	0x0005, 0x080c, 0x681f, 0x0128, 0x080c, 0xcb97, 0x0010, 0x9085,
-	0x0001, 0x0005, 0x080c, 0x681f, 0x0128, 0x080c, 0xcbef, 0x0010,
-	0x9085, 0x0001, 0x0005, 0x080c, 0x681f, 0x0128, 0x080c, 0xcbb6,
-	0x0010, 0x9085, 0x0001, 0x0005, 0x080c, 0x681f, 0x0128, 0x080c,
-	0xcc33, 0x0010, 0x9085, 0x0001, 0x0005, 0xb8a4, 0x900d, 0x1118,
-	0x9085, 0x0001, 0x0005, 0x0136, 0x01c6, 0xa800, 0x9005, 0x11b8,
+	0x7097, 0x0001, 0x080c, 0x5f53, 0x709b, 0x000e, 0x0029, 0x0010,
+	0x080c, 0x5fd9, 0x00fe, 0x0005, 0x918d, 0x0001, 0x080c, 0x6028,
+	0x709b, 0x000f, 0x7093, 0x0000, 0x2061, 0x0140, 0x605b, 0xbc85,
+	0x605f, 0xb5b5, 0x2061, 0x0100, 0x6043, 0x0005, 0x6043, 0x0004,
+	0x2009, 0x07d0, 0x2011, 0x5e8c, 0x080c, 0x84d0, 0x0005, 0x7090,
+	0x9005, 0x0130, 0x2011, 0x5e8c, 0x080c, 0x84dc, 0x709b, 0x0000,
+	0x0005, 0x709b, 0x0011, 0x080c, 0xab2c, 0x080c, 0x5ffd, 0x20e1,
+	0x0000, 0x2099, 0x0260, 0x20e9, 0x0000, 0x20a1, 0x0240, 0x7490,
+	0x9480, 0x0018, 0x9080, 0x0007, 0x9084, 0x03f8, 0x8004, 0x20a8,
+	0x4003, 0x080c, 0x5fe0, 0x11a0, 0x717c, 0x81ff, 0x0188, 0x900e,
+	0x7080, 0x9084, 0x00ff, 0x0160, 0x080c, 0x2840, 0x9186, 0x007e,
+	0x0138, 0x9186, 0x0080, 0x0120, 0x2011, 0x0008, 0x080c, 0x5e39,
+	0x60c3, 0x0014, 0x080c, 0x5eb6, 0x0005, 0x00f6, 0x7090, 0x9005,
+	0x0500, 0x2011, 0x5e8c, 0x080c, 0x84dc, 0x9086, 0x0014, 0x11b8,
+	0x080c, 0x5ffd, 0x2079, 0x0260, 0x7a30, 0x9296, 0x1103, 0x1178,
+	0x7834, 0x9005, 0x1160, 0x7a38, 0xd2fc, 0x0128, 0x70c4, 0x9005,
+	0x1110, 0x70c7, 0x0001, 0x709b, 0x0012, 0x0029, 0x0010, 0x7093,
+	0x0000, 0x00fe, 0x0005, 0x00f6, 0x709b, 0x0013, 0x080c, 0x5f8f,
+	0x2079, 0x0240, 0x7833, 0x1103, 0x7837, 0x0000, 0x080c, 0x5ffd,
+	0x080c, 0x5fe0, 0x1170, 0x7084, 0x9005, 0x1158, 0x715c, 0x9186,
+	0xffff, 0x0138, 0x2011, 0x0008, 0x080c, 0x5e39, 0x0168, 0x080c,
+	0x5fb6, 0x20a9, 0x0008, 0x20e1, 0x0000, 0x2099, 0x026e, 0x20e9,
+	0x0000, 0x20a1, 0x024e, 0x4003, 0x60c3, 0x0014, 0x080c, 0x5eb6,
+	0x00fe, 0x0005, 0x00f6, 0x7090, 0x9005, 0x0500, 0x2011, 0x5e8c,
+	0x080c, 0x84dc, 0x9086, 0x0014, 0x11b8, 0x080c, 0x5ffd, 0x2079,
+	0x0260, 0x7a30, 0x9296, 0x1104, 0x1178, 0x7834, 0x9005, 0x1160,
+	0x7a38, 0xd2fc, 0x0128, 0x70c4, 0x9005, 0x1110, 0x70c7, 0x0001,
+	0x709b, 0x0014, 0x0029, 0x0010, 0x7093, 0x0000, 0x00fe, 0x0005,
+	0x00f6, 0x709b, 0x0015, 0x080c, 0x5f8f, 0x2079, 0x0240, 0x7833,
+	0x1104, 0x7837, 0x0000, 0x080c, 0x5ffd, 0x080c, 0x5fe0, 0x11b8,
+	0x7084, 0x9005, 0x11a0, 0x7164, 0x9186, 0xffff, 0x0180, 0x9180,
+	0x3327, 0x200d, 0x918c, 0xff00, 0x810f, 0x2011, 0x0008, 0x080c,
+	0x5e39, 0x0180, 0x080c, 0x4fea, 0x0110, 0x080c, 0x28a9, 0x20a9,
+	0x0008, 0x20e1, 0x0000, 0x2099, 0x026e, 0x20e9, 0x0000, 0x20a1,
+	0x024e, 0x4003, 0x60c3, 0x0014, 0x080c, 0x5eb6, 0x00fe, 0x0005,
+	0x00f6, 0x7090, 0x9005, 0x05f0, 0x2011, 0x5e8c, 0x080c, 0x84dc,
+	0x9086, 0x0014, 0x15a8, 0x080c, 0x5ffd, 0x2079, 0x0260, 0x7a30,
+	0x9296, 0x1105, 0x1568, 0x7834, 0x9084, 0x0100, 0x2011, 0x0100,
+	0x921e, 0x1168, 0x9085, 0x0001, 0x080c, 0x6028, 0x7a38, 0xd2fc,
+	0x0128, 0x70c4, 0x9005, 0x1110, 0x70c7, 0x0001, 0x0080, 0x9005,
+	0x11b8, 0x7a38, 0xd2fc, 0x0128, 0x70c4, 0x9005, 0x1110, 0x70c7,
+	0x0001, 0x9085, 0x0001, 0x080c, 0x6028, 0x7097, 0x0000, 0x7a38,
+	0xd2f4, 0x0110, 0x70df, 0x0008, 0x709b, 0x0016, 0x0029, 0x0010,
+	0x7093, 0x0000, 0x00fe, 0x0005, 0x080c, 0xab2c, 0x080c, 0x5ffd,
+	0x20e1, 0x0000, 0x2099, 0x0260, 0x20e9, 0x0000, 0x20a1, 0x0240,
+	0x20a9, 0x000e, 0x4003, 0x2011, 0x026d, 0x2204, 0x9084, 0x0100,
+	0x2011, 0x024d, 0x2012, 0x2011, 0x026e, 0x709b, 0x0017, 0x080c,
+	0x5fe0, 0x1150, 0x7084, 0x9005, 0x1138, 0x080c, 0x5dac, 0x1188,
+	0x9085, 0x0001, 0x080c, 0x28a9, 0x20a9, 0x0008, 0x080c, 0x5ffd,
+	0x20e1, 0x0000, 0x2099, 0x026e, 0x20e9, 0x0000, 0x20a1, 0x024e,
+	0x4003, 0x60c3, 0x0014, 0x080c, 0x5eb6, 0x0010, 0x080c, 0x5906,
+	0x0005, 0x00f6, 0x7090, 0x9005, 0x01d8, 0x2011, 0x5e8c, 0x080c,
+	0x84dc, 0x9086, 0x0084, 0x1190, 0x080c, 0x5ffd, 0x2079, 0x0260,
+	0x7a30, 0x9296, 0x1106, 0x1150, 0x7834, 0x9005, 0x1138, 0x9006,
+	0x080c, 0x6028, 0x709b, 0x0018, 0x0029, 0x0010, 0x7093, 0x0000,
+	0x00fe, 0x0005, 0x00f6, 0x709b, 0x0019, 0x080c, 0x5f8f, 0x2079,
+	0x0240, 0x7833, 0x1106, 0x7837, 0x0000, 0x080c, 0x5ffd, 0x2009,
+	0x026e, 0x2039, 0x1c0e, 0x20a9, 0x0040, 0x213e, 0x8738, 0x8108,
+	0x9186, 0x0280, 0x1128, 0x6814, 0x8000, 0x6816, 0x2009, 0x0260,
+	0x1f04, 0x5d15, 0x2039, 0x1c0e, 0x080c, 0x5fe0, 0x11e8, 0x2728,
+	0x2514, 0x8207, 0x9084, 0x00ff, 0x8000, 0x2018, 0x9294, 0x00ff,
+	0x8007, 0x9205, 0x202a, 0x7060, 0x2310, 0x8214, 0x92a0, 0x1c0e,
+	0x2414, 0x938c, 0x0001, 0x0118, 0x9294, 0xff00, 0x0018, 0x9294,
+	0x00ff, 0x8007, 0x9215, 0x2222, 0x20a9, 0x0040, 0x2009, 0x024e,
+	0x270e, 0x8738, 0x8108, 0x9186, 0x0260, 0x1128, 0x6810, 0x8000,
+	0x6812, 0x2009, 0x0240, 0x1f04, 0x5d48, 0x60c3, 0x0084, 0x080c,
+	0x5eb6, 0x00fe, 0x0005, 0x00f6, 0x7090, 0x9005, 0x01e0, 0x2011,
+	0x5e8c, 0x080c, 0x84dc, 0x9086, 0x0084, 0x1198, 0x080c, 0x5ffd,
+	0x2079, 0x0260, 0x7a30, 0x9296, 0x1107, 0x1158, 0x7834, 0x9005,
+	0x1140, 0x7097, 0x0001, 0x080c, 0x5f53, 0x709b, 0x001a, 0x0029,
+	0x0010, 0x7093, 0x0000, 0x00fe, 0x0005, 0x9085, 0x0001, 0x080c,
+	0x6028, 0x709b, 0x001b, 0x080c, 0xab2c, 0x080c, 0x5ffd, 0x2011,
+	0x0260, 0x2009, 0x0240, 0x7490, 0x9480, 0x0018, 0x9080, 0x0007,
+	0x9084, 0x03f8, 0x8004, 0x20a8, 0x220e, 0x8210, 0x8108, 0x9186,
+	0x0260, 0x1150, 0x6810, 0x8000, 0x6812, 0x2009, 0x0240, 0x6814,
+	0x8000, 0x6816, 0x2011, 0x0260, 0x1f04, 0x5d94, 0x60c3, 0x0084,
+	0x080c, 0x5eb6, 0x0005, 0x0005, 0x0086, 0x0096, 0x2029, 0x1848,
+	0x252c, 0x20a9, 0x0008, 0x2041, 0x1c0e, 0x20e9, 0x0001, 0x28a0,
+	0x080c, 0x5ffd, 0x20e1, 0x0000, 0x2099, 0x026e, 0x4003, 0x20a9,
+	0x0008, 0x2011, 0x0007, 0xd5d4, 0x0108, 0x9016, 0x2800, 0x9200,
+	0x200c, 0x91a6, 0xffff, 0x1148, 0xd5d4, 0x0110, 0x8210, 0x0008,
+	0x8211, 0x1f04, 0x5dc6, 0x0804, 0x5e35, 0x82ff, 0x1160, 0xd5d4,
+	0x0120, 0x91a6, 0x3fff, 0x0d90, 0x0020, 0x91a6, 0x3fff, 0x0904,
+	0x5e35, 0x918d, 0xc000, 0x20a9, 0x0010, 0x2019, 0x0001, 0xd5d4,
+	0x0110, 0x2019, 0x0010, 0x2120, 0xd5d4, 0x0110, 0x8423, 0x0008,
+	0x8424, 0x1240, 0xd5d4, 0x0110, 0x8319, 0x0008, 0x8318, 0x1f04,
+	0x5dec, 0x04d8, 0x23a8, 0x2021, 0x0001, 0x8426, 0x8425, 0x1f04,
+	0x5dfe, 0x2328, 0x8529, 0x92be, 0x0007, 0x0158, 0x0006, 0x2039,
+	0x0007, 0x2200, 0x973a, 0x000e, 0x27a8, 0x95a8, 0x0010, 0x1f04,
+	0x5e0d, 0x755e, 0x95c8, 0x3327, 0x292d, 0x95ac, 0x00ff, 0x7582,
+	0x6532, 0x6536, 0x0016, 0x2508, 0x080c, 0x2889, 0x001e, 0x60e7,
+	0x0000, 0x65ea, 0x2018, 0x2304, 0x9405, 0x201a, 0x7087, 0x0001,
+	0x20e9, 0x0000, 0x20a1, 0x024e, 0x20e1, 0x0001, 0x2898, 0x20a9,
+	0x0008, 0x4003, 0x9085, 0x0001, 0x0008, 0x9006, 0x009e, 0x008e,
+	0x0005, 0x0156, 0x01c6, 0x01d6, 0x0136, 0x0146, 0x22a8, 0x20e1,
+	0x0000, 0x2099, 0x026e, 0x20e9, 0x0000, 0x2011, 0x024e, 0x22a0,
+	0x4003, 0x014e, 0x013e, 0x01de, 0x01ce, 0x015e, 0x2118, 0x9026,
+	0x2001, 0x0007, 0x939a, 0x0010, 0x0218, 0x8420, 0x8001, 0x0cd0,
+	0x2118, 0x84ff, 0x0120, 0x939a, 0x0010, 0x8421, 0x1de0, 0x2021,
+	0x0001, 0x83ff, 0x0118, 0x8423, 0x8319, 0x1de8, 0x9238, 0x2029,
+	0x026e, 0x9528, 0x2504, 0x942c, 0x11b8, 0x9405, 0x203a, 0x715e,
+	0x91a0, 0x3327, 0x242d, 0x95ac, 0x00ff, 0x7582, 0x6532, 0x6536,
+	0x0016, 0x2508, 0x080c, 0x2889, 0x001e, 0x60e7, 0x0000, 0x65ea,
+	0x7087, 0x0001, 0x9084, 0x0000, 0x0005, 0x00e6, 0x2071, 0x1800,
+	0x708b, 0x0000, 0x00ee, 0x0005, 0x00e6, 0x00f6, 0x2079, 0x0100,
+	0x2071, 0x0140, 0x080c, 0x5f42, 0x080c, 0xa274, 0x7004, 0x9084,
+	0x4000, 0x0110, 0x080c, 0x2d01, 0x0126, 0x2091, 0x8000, 0x2071,
+	0x1826, 0x2073, 0x0000, 0x7840, 0x0026, 0x0016, 0x2009, 0x00f7,
+	0x080c, 0x5f9f, 0x001e, 0x9094, 0x0010, 0x9285, 0x0080, 0x7842,
+	0x7a42, 0x002e, 0x012e, 0x00fe, 0x00ee, 0x0005, 0x0126, 0x2091,
+	0x8000, 0x080c, 0x2ba7, 0x0228, 0x2011, 0x0101, 0x2204, 0xc0c5,
+	0x2012, 0x2011, 0x19f0, 0x2013, 0x0000, 0x7093, 0x0000, 0x012e,
+	0x60a3, 0x0056, 0x60a7, 0x9575, 0x080c, 0xa26b, 0x6144, 0xd184,
+	0x0120, 0x7198, 0x918d, 0x2000, 0x0018, 0x718c, 0x918d, 0x1000,
+	0x2011, 0x1998, 0x2112, 0x2009, 0x07d0, 0x2011, 0x5e8c, 0x080c,
+	0x8574, 0x0005, 0x0016, 0x0026, 0x00c6, 0x0126, 0x2091, 0x8000,
+	0x080c, 0xade2, 0x2009, 0x00f7, 0x080c, 0x5f9f, 0x2061, 0x19f9,
+	0x900e, 0x611a, 0x611e, 0x6172, 0x6176, 0x2061, 0x1800, 0x6003,
+	0x0001, 0x2061, 0x0100, 0x6043, 0x0090, 0x6043, 0x0010, 0x2009,
+	0x1998, 0x200b, 0x0000, 0x2009, 0x002d, 0x2011, 0x5f0e, 0x080c,
+	0x84d0, 0x012e, 0x00ce, 0x002e, 0x001e, 0x0005, 0x00e6, 0x0006,
+	0x0126, 0x2091, 0x8000, 0x0471, 0x2071, 0x0100, 0x080c, 0xa274,
+	0x2071, 0x0140, 0x7004, 0x9084, 0x4000, 0x0110, 0x080c, 0x2d01,
+	0x080c, 0x73ad, 0x0188, 0x080c, 0x73c8, 0x1170, 0x080c, 0x7697,
+	0x0016, 0x080c, 0x2958, 0x2001, 0x196c, 0x2102, 0x001e, 0x080c,
+	0x7692, 0x080c, 0x72d7, 0x0050, 0x2009, 0x0001, 0x080c, 0x2c40,
+	0x2001, 0x0001, 0x080c, 0x27ec, 0x080c, 0x5ee2, 0x012e, 0x000e,
+	0x00ee, 0x0005, 0x2001, 0x180e, 0x2004, 0xd0bc, 0x0158, 0x0026,
+	0x0036, 0x2011, 0x8017, 0x2001, 0x1998, 0x201c, 0x080c, 0x4b14,
+	0x003e, 0x002e, 0x0005, 0x20a9, 0x0012, 0x20e9, 0x0001, 0x20a1,
+	0x1c80, 0x080c, 0x5ffd, 0x20e9, 0x0000, 0x2099, 0x026e, 0x0099,
+	0x20a9, 0x0020, 0x080c, 0x5ff7, 0x2099, 0x0260, 0x20a1, 0x1c92,
+	0x0051, 0x20a9, 0x000e, 0x080c, 0x5ffa, 0x2099, 0x0260, 0x20a1,
+	0x1cb2, 0x0009, 0x0005, 0x0016, 0x0026, 0x3410, 0x3308, 0x2104,
+	0x8007, 0x2012, 0x8108, 0x8210, 0x1f04, 0x5f77, 0x002e, 0x001e,
+	0x0005, 0x080c, 0xab2c, 0x20e1, 0x0001, 0x2099, 0x1c00, 0x20e9,
+	0x0000, 0x20a1, 0x0240, 0x20a9, 0x000c, 0x4003, 0x0005, 0x080c,
+	0xab2c, 0x080c, 0x5ffd, 0x20e1, 0x0000, 0x2099, 0x0260, 0x20e9,
+	0x0000, 0x20a1, 0x0240, 0x20a9, 0x000c, 0x4003, 0x0005, 0x00c6,
+	0x0006, 0x2061, 0x0100, 0x810f, 0x2001, 0x1834, 0x2004, 0x9005,
+	0x1138, 0x2001, 0x1818, 0x2004, 0x9084, 0x00ff, 0x9105, 0x0010,
+	0x9185, 0x00f7, 0x604a, 0x000e, 0x00ce, 0x0005, 0x0016, 0x0046,
+	0x080c, 0x6977, 0x0158, 0x9006, 0x2020, 0x2009, 0x002a, 0x080c,
+	0xe5cf, 0x2001, 0x180c, 0x200c, 0xc195, 0x2102, 0x2019, 0x002a,
+	0x900e, 0x080c, 0x318c, 0x080c, 0xd24a, 0x0140, 0x0036, 0x2019,
+	0xffff, 0x2021, 0x0007, 0x080c, 0x4ccb, 0x003e, 0x004e, 0x001e,
+	0x0005, 0x080c, 0x5ee2, 0x709b, 0x0000, 0x7093, 0x0000, 0x0005,
+	0x0006, 0x2001, 0x180c, 0x2004, 0xd09c, 0x0100, 0x000e, 0x0005,
+	0x0006, 0x0016, 0x0126, 0x2091, 0x8000, 0x2001, 0x0101, 0x200c,
+	0x918d, 0x0006, 0x2102, 0x012e, 0x001e, 0x000e, 0x0005, 0x2009,
+	0x0001, 0x0020, 0x2009, 0x0002, 0x0008, 0x900e, 0x6814, 0x9084,
+	0xffc0, 0x910d, 0x6916, 0x0005, 0x00f6, 0x0156, 0x0146, 0x01d6,
+	0x9006, 0x20a9, 0x0080, 0x20e9, 0x0001, 0x20a1, 0x1c00, 0x4004,
+	0x2079, 0x1c00, 0x7803, 0x2200, 0x7807, 0x00ef, 0x780f, 0x00ef,
+	0x7813, 0x0138, 0x7823, 0xffff, 0x7827, 0xffff, 0x01de, 0x014e,
+	0x015e, 0x00fe, 0x0005, 0x2001, 0x1800, 0x2003, 0x0001, 0x0005,
+	0x2001, 0x19a5, 0x0118, 0x2003, 0x0001, 0x0010, 0x2003, 0x0000,
+	0x0005, 0x0156, 0x20a9, 0x0800, 0x2009, 0x1000, 0x9006, 0x200a,
+	0x8108, 0x1f04, 0x6037, 0x015e, 0x0005, 0x00d6, 0x0036, 0x0156,
+	0x0136, 0x0146, 0x2069, 0x1847, 0x9006, 0xb802, 0xb8ce, 0xb807,
+	0x0707, 0xb80a, 0xb80e, 0xb812, 0x9198, 0x3327, 0x231d, 0x939c,
+	0x00ff, 0xbb16, 0x0016, 0x0026, 0xb8c2, 0x080c, 0xaddb, 0x1120,
+	0x9192, 0x007e, 0x1208, 0xbbc2, 0x20a9, 0x0004, 0xb8c4, 0x20e8,
+	0xb9c8, 0x9198, 0x0006, 0x9006, 0x23a0, 0x4004, 0x20a9, 0x0004,
+	0x9198, 0x000a, 0x23a0, 0x4004, 0x002e, 0x001e, 0xb83e, 0xb842,
+	0xb84e, 0xb852, 0xb856, 0xb85a, 0xb85e, 0xb862, 0xb866, 0xb86a,
+	0xb86f, 0x0100, 0xb872, 0xb876, 0xb87a, 0xb88a, 0xb88e, 0xb893,
+	0x0008, 0xb896, 0xb89a, 0xb89e, 0xb8be, 0xb9a2, 0x0096, 0xb8a4,
+	0x904d, 0x0110, 0x080c, 0x1031, 0xb8a7, 0x0000, 0x009e, 0x9006,
+	0xb84a, 0x6810, 0xb83a, 0x680c, 0xb846, 0xb8bb, 0x0520, 0xb8ac,
+	0x9005, 0x0198, 0x00c6, 0x2060, 0x9c82, 0x1cd0, 0x0a0c, 0x0dd5,
+	0x2001, 0x181a, 0x2004, 0x9c02, 0x1a0c, 0x0dd5, 0x080c, 0x896a,
+	0x00ce, 0x090c, 0x8d0e, 0xb8af, 0x0000, 0x6814, 0x9084, 0x00ff,
+	0xb842, 0x014e, 0x013e, 0x015e, 0x003e, 0x00de, 0x0005, 0x0126,
+	0x2091, 0x8000, 0xa974, 0xae78, 0x9684, 0x3fff, 0x9082, 0x4000,
+	0x1a04, 0x6125, 0x9182, 0x0800, 0x1a04, 0x6129, 0x2001, 0x180c,
+	0x2004, 0x9084, 0x0003, 0x1904, 0x612f, 0x9188, 0x1000, 0x2104,
+	0x905d, 0x0518, 0xb804, 0x9084, 0x00ff, 0x908e, 0x0006, 0x1508,
+	0xb8a4, 0x900d, 0x1904, 0x6141, 0xb850, 0x900d, 0x1148, 0xa802,
+	0x2900, 0xb852, 0xb84e, 0x080c, 0x90f6, 0x9006, 0x012e, 0x0005,
+	0x00a6, 0x2150, 0x2900, 0xb002, 0xa803, 0x0000, 0x00ae, 0xb852,
+	0x0c90, 0x2001, 0x0005, 0x900e, 0x04b8, 0x2001, 0x0028, 0x900e,
+	0x0498, 0x9082, 0x0006, 0x1290, 0x080c, 0xaddb, 0x1160, 0xb8a0,
+	0x9084, 0xff80, 0x1140, 0xb900, 0xd1fc, 0x0990, 0x2001, 0x0029,
+	0x2009, 0x1000, 0x0408, 0x2001, 0x0028, 0x00a8, 0x2009, 0x180c,
+	0x210c, 0xd18c, 0x0118, 0x2001, 0x0004, 0x0068, 0xd184, 0x0118,
+	0x2001, 0x0004, 0x0040, 0x2001, 0x0029, 0xb900, 0xd1fc, 0x0118,
+	0x2009, 0x1000, 0x0048, 0x900e, 0x0038, 0x2001, 0x0029, 0x900e,
+	0x0018, 0x2001, 0x0029, 0x900e, 0x9005, 0x012e, 0x0005, 0x2001,
+	0x180c, 0x2004, 0xd084, 0x19d0, 0x9188, 0x1000, 0x2104, 0x905d,
+	0x09a8, 0x080c, 0x697b, 0x1990, 0xb800, 0xd0bc, 0x0978, 0x0804,
+	0x60d8, 0x080c, 0x67a4, 0x0904, 0x60f1, 0x0804, 0x60dc, 0x00b6,
+	0x00e6, 0x0126, 0x2091, 0x8000, 0xa874, 0x908e, 0x00ff, 0x1120,
+	0x2001, 0x196a, 0x205c, 0x0060, 0xa974, 0x9182, 0x0800, 0x1690,
+	0x9188, 0x1000, 0x2104, 0x905d, 0x01d0, 0x080c, 0x691b, 0x11d0,
+	0x080c, 0xae1b, 0x0570, 0x2b00, 0x6012, 0x2900, 0x6016, 0x6023,
+	0x0009, 0x600b, 0x0000, 0xa874, 0x908e, 0x00ff, 0x1110, 0x600b,
+	0x8000, 0x2009, 0x0043, 0x080c, 0xaeec, 0x9006, 0x00b0, 0x2001,
+	0x0028, 0x0090, 0x2009, 0x180c, 0x210c, 0xd18c, 0x0118, 0x2001,
+	0x0004, 0x0038, 0xd184, 0x0118, 0x2001, 0x0004, 0x0010, 0x2001,
+	0x0029, 0x0010, 0x2001, 0x0029, 0x9005, 0x012e, 0x00ee, 0x00be,
+	0x0005, 0x2001, 0x002c, 0x0cc0, 0x00b6, 0x00e6, 0x0126, 0x2091,
+	0x8000, 0xa974, 0x9182, 0x0800, 0x1a04, 0x620f, 0x9188, 0x1000,
+	0x2104, 0x905d, 0x0904, 0x61e7, 0xb8a0, 0x9086, 0x007f, 0x0178,
+	0x080c, 0x6983, 0x0160, 0xa994, 0x81ff, 0x0130, 0x908e, 0x0004,
+	0x0130, 0x908e, 0x0005, 0x0118, 0x080c, 0x697b, 0x1598, 0xa87c,
+	0xd0fc, 0x01e0, 0xa894, 0x9005, 0x01c8, 0x2060, 0x0026, 0x2010,
+	0x080c, 0xcb38, 0x002e, 0x1120, 0x2001, 0x0008, 0x0804, 0x6211,
+	0x6020, 0x9086, 0x000a, 0x0120, 0x2001, 0x0008, 0x0804, 0x6211,
+	0x601a, 0x6003, 0x0008, 0x2900, 0x6016, 0x0058, 0x080c, 0xae1b,
+	0x05e8, 0x2b00, 0x6012, 0x2900, 0x6016, 0x600b, 0xffff, 0x6023,
+	0x000a, 0x2009, 0x0003, 0x080c, 0xaeec, 0x9006, 0x0458, 0x2001,
+	0x0028, 0x0438, 0x9082, 0x0006, 0x1290, 0x080c, 0xaddb, 0x1160,
+	0xb8a0, 0x9084, 0xff80, 0x1140, 0xb900, 0xd1fc, 0x0900, 0x2001,
+	0x0029, 0x2009, 0x1000, 0x00a8, 0x2001, 0x0028, 0x0090, 0x2009,
+	0x180c, 0x210c, 0xd18c, 0x0118, 0x2001, 0x0004, 0x0050, 0xd184,
+	0x0118, 0x2001, 0x0004, 0x0028, 0x2001, 0x0029, 0x0010, 0x2001,
+	0x0029, 0x9005, 0x012e, 0x00ee, 0x00be, 0x0005, 0x2001, 0x002c,
+	0x0cc0, 0x00f6, 0x00b6, 0x0126, 0x2091, 0x8000, 0xa8e0, 0x9005,
+	0x1550, 0xa8dc, 0x9082, 0x0101, 0x1630, 0xa8c8, 0x9005, 0x1518,
+	0xa8c4, 0x9082, 0x0101, 0x12f8, 0xa974, 0x2079, 0x1800, 0x9182,
+	0x0800, 0x12e8, 0x7830, 0x9084, 0x0003, 0x1130, 0xaa98, 0xab94,
+	0xa878, 0x9084, 0x0007, 0x00ea, 0x7930, 0xd18c, 0x0118, 0x2001,
+	0x0004, 0x0038, 0xd184, 0x0118, 0x2001, 0x0004, 0x0010, 0x2001,
+	0x0029, 0x900e, 0x0038, 0x2001, 0x002c, 0x900e, 0x0018, 0x2001,
+	0x0029, 0x900e, 0x9006, 0x0008, 0x9005, 0x012e, 0x00be, 0x00fe,
+	0x0005, 0x62a6, 0x6261, 0x6278, 0x62a6, 0x62a6, 0x62a6, 0x62a6,
+	0x62a6, 0x2100, 0x9082, 0x007e, 0x1278, 0x080c, 0x65a7, 0x0148,
+	0x9046, 0xb810, 0x9306, 0x1904, 0x62ae, 0xb814, 0x9206, 0x15f0,
+	0x0028, 0xbb12, 0xba16, 0x0010, 0x080c, 0x49c7, 0x0150, 0x04b0,
+	0x080c, 0x6608, 0x1598, 0xb810, 0x9306, 0x1580, 0xb814, 0x9206,
+	0x1568, 0x080c, 0xae1b, 0x0530, 0x2b00, 0x6012, 0x080c, 0xcfc4,
+	0x2900, 0x6016, 0x600b, 0xffff, 0x6023, 0x000a, 0xa878, 0x9086,
+	0x0001, 0x1170, 0x080c, 0x31c1, 0x9006, 0x080c, 0x6544, 0x2001,
+	0x0002, 0x080c, 0x6558, 0x2001, 0x0200, 0xb86e, 0xb893, 0x0002,
+	0x2009, 0x0003, 0x080c, 0xaeec, 0x9006, 0x0068, 0x2001, 0x0001,
+	0x900e, 0x0038, 0x2001, 0x002c, 0x900e, 0x0018, 0x2001, 0x0028,
+	0x900e, 0x9005, 0x0000, 0x012e, 0x00be, 0x00fe, 0x0005, 0x00b6,
+	0x00f6, 0x00e6, 0x0126, 0x2091, 0x8000, 0xa894, 0x90c6, 0x0015,
+	0x0904, 0x6495, 0x90c6, 0x0056, 0x0904, 0x6499, 0x90c6, 0x0066,
+	0x0904, 0x649d, 0x90c6, 0x0067, 0x0904, 0x64a1, 0x90c6, 0x0068,
+	0x0904, 0x64a5, 0x90c6, 0x0071, 0x0904, 0x64a9, 0x90c6, 0x0074,
+	0x0904, 0x64ad, 0x90c6, 0x007c, 0x0904, 0x64b1, 0x90c6, 0x007e,
+	0x0904, 0x64b5, 0x90c6, 0x0037, 0x0904, 0x64b9, 0x9016, 0x2079,
+	0x1800, 0xa974, 0x9186, 0x00ff, 0x0904, 0x6490, 0x9182, 0x0800,
+	0x1a04, 0x6490, 0x080c, 0x6608, 0x1198, 0xb804, 0x9084, 0x00ff,
+	0x9082, 0x0006, 0x1268, 0xa894, 0x90c6, 0x006f, 0x0148, 0x080c,
+	0xaddb, 0x1904, 0x6479, 0xb8a0, 0x9084, 0xff80, 0x1904, 0x6479,
+	0xa894, 0x90c6, 0x006f, 0x0158, 0x90c6, 0x005e, 0x0904, 0x63d9,
+	0x90c6, 0x0064, 0x0904, 0x6402, 0x2008, 0x0804, 0x639b, 0xa998,
+	0xa8b0, 0x2040, 0x080c, 0xaddb, 0x1120, 0x9182, 0x007f, 0x0a04,
+	0x639b, 0x9186, 0x00ff, 0x0904, 0x639b, 0x9182, 0x0800, 0x1a04,
+	0x639b, 0xaaa0, 0xab9c, 0x787c, 0x9306, 0x1188, 0x7880, 0x0096,
+	0x924e, 0x1128, 0x2208, 0x2310, 0x009e, 0x0804, 0x639b, 0x99cc,
+	0xff00, 0x009e, 0x1120, 0x2208, 0x2310, 0x0804, 0x639b, 0x080c,
+	0x49c7, 0x0904, 0x63a5, 0x900e, 0x9016, 0x90c6, 0x4000, 0x15e0,
+	0x0006, 0x080c, 0x6828, 0x1108, 0xc185, 0xb800, 0xd0bc, 0x0108,
+	0xc18d, 0x20a9, 0x0004, 0xa860, 0x20e8, 0xa85c, 0x9080, 0x0031,
+	0x20a0, 0xb8c4, 0x20e0, 0xb8c8, 0x9080, 0x0006, 0x2098, 0x080c,
+	0x0f7c, 0x20a9, 0x0004, 0xa860, 0x20e8, 0xa85c, 0x9080, 0x0035,
+	0x20a0, 0xb8c4, 0x20e0, 0xb8c8, 0x9080, 0x000a, 0x2098, 0x080c,
+	0x0f7c, 0xa8c4, 0xabc8, 0x9305, 0xabcc, 0x9305, 0xabd0, 0x9305,
+	0xabd4, 0x9305, 0xabd8, 0x9305, 0xabdc, 0x9305, 0xabe0, 0x9305,
+	0x9005, 0x0510, 0x000e, 0x00c8, 0x90c6, 0x4007, 0x1110, 0x2408,
+	0x00a0, 0x90c6, 0x4008, 0x1118, 0x2708, 0x2610, 0x0070, 0x90c6,
+	0x4009, 0x1108, 0x0050, 0x90c6, 0x4006, 0x0138, 0x2001, 0x4005,
+	0x2009, 0x000a, 0x0010, 0x2001, 0x4006, 0xa896, 0xa99a, 0xaa9e,
+	0x2001, 0x0030, 0x900e, 0x0478, 0x000e, 0x080c, 0xae1b, 0x1130,
+	0x2001, 0x4005, 0x2009, 0x0003, 0x9016, 0x0c78, 0x2b00, 0x6012,
+	0x080c, 0xcfc4, 0x2900, 0x6016, 0x6023, 0x0001, 0xa868, 0xd88c,
+	0x0108, 0xc0f5, 0xa86a, 0x0126, 0x2091, 0x8000, 0x080c, 0x31c1,
+	0x012e, 0x9006, 0x080c, 0x6544, 0x2001, 0x0002, 0x080c, 0x6558,
+	0x2009, 0x0002, 0x080c, 0xaeec, 0xa8b0, 0xd094, 0x0118, 0xb8cc,
+	0xc08d, 0xb8ce, 0x9006, 0x9005, 0x012e, 0x00ee, 0x00fe, 0x00be,
+	0x0005, 0x080c, 0x56ec, 0x0118, 0x2009, 0x0007, 0x00f8, 0xa998,
+	0xaeb0, 0x080c, 0x6608, 0x1904, 0x6396, 0x9186, 0x007f, 0x0130,
+	0x080c, 0x697b, 0x0118, 0x2009, 0x0009, 0x0080, 0x0096, 0x080c,
+	0x0fff, 0x1120, 0x009e, 0x2009, 0x0002, 0x0040, 0x2900, 0x009e,
+	0xa806, 0x080c, 0xcd30, 0x19b0, 0x2009, 0x0003, 0x2001, 0x4005,
+	0x0804, 0x639d, 0xa998, 0xaeb0, 0x080c, 0x6608, 0x1904, 0x6396,
+	0x0096, 0x080c, 0x0fff, 0x1128, 0x009e, 0x2009, 0x0002, 0x0804,
+	0x6456, 0x2900, 0x009e, 0xa806, 0x0096, 0x2048, 0x20a9, 0x002b,
+	0xb8c4, 0x20e0, 0xb8c8, 0x2098, 0xa860, 0x20e8, 0xa85c, 0x9080,
+	0x0002, 0x20a0, 0x4003, 0x20a9, 0x0008, 0x9080, 0x0006, 0x20a0,
+	0xbbc8, 0x9398, 0x0006, 0x2398, 0x080c, 0x0f7c, 0x009e, 0xa87b,
+	0x0000, 0xa883, 0x0000, 0xa897, 0x4000, 0xd684, 0x1168, 0x080c,
+	0x56d8, 0xd0b4, 0x1118, 0xa89b, 0x000b, 0x00e0, 0xb800, 0xd08c,
+	0x0118, 0xa89b, 0x000c, 0x00b0, 0x080c, 0x697b, 0x0118, 0xa89b,
+	0x0009, 0x0080, 0x080c, 0x56ec, 0x0118, 0xa89b, 0x0007, 0x0050,
+	0x080c, 0xcd13, 0x1904, 0x63d2, 0x2009, 0x0003, 0x2001, 0x4005,
+	0x0804, 0x639d, 0xa87b, 0x0030, 0xa897, 0x4005, 0xa804, 0x8006,
+	0x8006, 0x8007, 0x90bc, 0x003f, 0x9084, 0xffc0, 0x9080, 0x0002,
+	0x2009, 0x002b, 0xaaa0, 0xab9c, 0xaca8, 0xada4, 0x2031, 0x0000,
+	0x2041, 0x1243, 0x080c, 0xb38b, 0x1904, 0x63d2, 0x2009, 0x0002,
+	0x08e8, 0x2001, 0x0028, 0x900e, 0x0804, 0x63d3, 0x2009, 0x180c,
+	0x210c, 0xd18c, 0x0118, 0x2001, 0x0004, 0x0038, 0xd184, 0x0118,
+	0x2001, 0x0004, 0x0010, 0x2001, 0x0029, 0x900e, 0x0804, 0x63d3,
+	0x2001, 0x0029, 0x900e, 0x0804, 0x63d3, 0x080c, 0x3756, 0x0804,
+	0x63d4, 0x080c, 0x5415, 0x0804, 0x63d4, 0x080c, 0x4554, 0x0804,
+	0x63d4, 0x080c, 0x45cd, 0x0804, 0x63d4, 0x080c, 0x4629, 0x0804,
+	0x63d4, 0x080c, 0x4a8a, 0x0804, 0x63d4, 0x080c, 0x4d3a, 0x0804,
+	0x63d4, 0x080c, 0x5080, 0x0804, 0x63d4, 0x080c, 0x5279, 0x0804,
+	0x63d4, 0x080c, 0x396c, 0x0804, 0x63d4, 0x00b6, 0xa974, 0xae78,
+	0x9684, 0x3fff, 0x9082, 0x4000, 0x1618, 0x9182, 0x0800, 0x1268,
+	0x9188, 0x1000, 0x2104, 0x905d, 0x0140, 0x080c, 0x697b, 0x1148,
+	0x00e9, 0x080c, 0x6733, 0x9006, 0x00b0, 0x2001, 0x0028, 0x900e,
+	0x0090, 0x9082, 0x0006, 0x1240, 0xb900, 0xd1fc, 0x0d88, 0x2001,
+	0x0029, 0x2009, 0x1000, 0x0038, 0x2001, 0x0029, 0x900e, 0x0018,
+	0x2001, 0x0029, 0x900e, 0x9005, 0x00be, 0x0005, 0x0126, 0x2091,
+	0x8000, 0xb850, 0x900d, 0x0150, 0x2900, 0x0096, 0x2148, 0xa802,
+	0x009e, 0xa803, 0x0000, 0xb852, 0x012e, 0x0005, 0x2900, 0xb852,
+	0xb84e, 0xa803, 0x0000, 0x0cc0, 0x0126, 0x2091, 0x8000, 0xb84c,
+	0x9005, 0x0170, 0x00e6, 0x2071, 0x19e6, 0x7004, 0x9086, 0x0002,
+	0x0168, 0x00ee, 0xb84c, 0xa802, 0x2900, 0xb84e, 0x012e, 0x0005,
+	0x2900, 0xb852, 0xb84e, 0xa803, 0x0000, 0x0cc0, 0x701c, 0x9b06,
+	0x1d80, 0xb84c, 0x00a6, 0x2050, 0xb000, 0xa802, 0x2900, 0xb002,
+	0x00ae, 0x00ee, 0x012e, 0x0005, 0x0126, 0x2091, 0x8000, 0xb84c,
+	0x904d, 0x0130, 0xa800, 0x9005, 0x1108, 0xb852, 0xb84e, 0x9905,
+	0x012e, 0x0005, 0xb84c, 0x904d, 0x0130, 0xa800, 0x9005, 0x1108,
+	0xb852, 0xb84e, 0x9905, 0x0005, 0x00b6, 0x0126, 0x00c6, 0x0026,
+	0x2091, 0x8000, 0x6210, 0x2258, 0xba00, 0x9005, 0x0110, 0xc285,
+	0x0008, 0xc284, 0xba02, 0x002e, 0x00ce, 0x012e, 0x00be, 0x0005,
+	0x00b6, 0x0126, 0x00c6, 0x2091, 0x8000, 0x6210, 0x2258, 0xba04,
+	0x0006, 0x9086, 0x0006, 0x1170, 0xb89c, 0xd0ac, 0x0158, 0x080c,
+	0x6977, 0x0140, 0x9284, 0xff00, 0x8007, 0x9086, 0x0007, 0x1110,
+	0x2011, 0x0600, 0x000e, 0x9294, 0xff00, 0x9215, 0xba06, 0x0006,
+	0x9086, 0x0006, 0x1120, 0xba90, 0x82ff, 0x090c, 0x0dd5, 0x000e,
+	0x00ce, 0x012e, 0x00be, 0x0005, 0x00b6, 0x0126, 0x00c6, 0x2091,
+	0x8000, 0x6210, 0x2258, 0xba04, 0x0006, 0x9086, 0x0006, 0x1168,
+	0xb89c, 0xd0a4, 0x0150, 0x080c, 0x6973, 0x1138, 0x9284, 0x00ff,
+	0x9086, 0x0007, 0x1110, 0x2011, 0x0006, 0x000e, 0x9294, 0x00ff,
+	0x8007, 0x9215, 0xba06, 0x00ce, 0x012e, 0x00be, 0x0005, 0x9182,
+	0x0800, 0x0218, 0x9085, 0x0001, 0x0005, 0x00d6, 0x0026, 0x9190,
+	0x1000, 0x2204, 0x905d, 0x1188, 0x0096, 0x080c, 0x0fff, 0x2958,
+	0x009e, 0x0168, 0x2b00, 0x2012, 0xb85c, 0xb8ca, 0xb860, 0xb8c6,
+	0x9006, 0xb8a6, 0xb8ae, 0x080c, 0x603d, 0x9006, 0x0010, 0x9085,
+	0x0001, 0x002e, 0x00de, 0x0005, 0x00b6, 0x0096, 0x0126, 0x2091,
+	0x8000, 0x0026, 0x9182, 0x0800, 0x0218, 0x9085, 0x0001, 0x0458,
+	0x00d6, 0x9190, 0x1000, 0x2204, 0x905d, 0x0518, 0x2013, 0x0000,
+	0xb8a4, 0x904d, 0x0110, 0x080c, 0x1031, 0x00d6, 0x00c6, 0xb8bc,
+	0x2060, 0x8cff, 0x0168, 0x600c, 0x0006, 0x6014, 0x2048, 0x080c,
+	0xcb4a, 0x0110, 0x080c, 0x0fb1, 0x080c, 0xae71, 0x00ce, 0x0c88,
+	0x00ce, 0x00de, 0x2b48, 0xb8c8, 0xb85e, 0xb8c4, 0xb862, 0x080c,
+	0x1041, 0x00de, 0x9006, 0x002e, 0x012e, 0x009e, 0x00be, 0x0005,
+	0x0016, 0x9182, 0x0800, 0x0218, 0x9085, 0x0001, 0x0030, 0x9188,
+	0x1000, 0x2104, 0x905d, 0x0dc0, 0x9006, 0x001e, 0x0005, 0x00d6,
+	0x0156, 0x0136, 0x0146, 0x9006, 0xb80a, 0xb80e, 0xb800, 0xc08c,
+	0xb802, 0x080c, 0x73a5, 0x1510, 0xb8a0, 0x9086, 0x007e, 0x0120,
+	0x080c, 0xaddb, 0x11d8, 0x0078, 0x7040, 0xd0e4, 0x01b8, 0x00c6,
+	0x2061, 0x1981, 0x7048, 0x2062, 0x704c, 0x6006, 0x7050, 0x600a,
+	0x7054, 0x600e, 0x00ce, 0x703c, 0x2069, 0x0140, 0x9005, 0x1110,
+	0x2001, 0x0001, 0x6886, 0x2069, 0x1800, 0x68b6, 0x7040, 0xb85e,
+	0x7048, 0xb862, 0x704c, 0xb866, 0x20e1, 0x0000, 0x2099, 0x0276,
+	0xb8c4, 0x20e8, 0xb8c8, 0x9088, 0x000a, 0x21a0, 0x20a9, 0x0004,
+	0x4003, 0x2099, 0x027a, 0x9088, 0x0006, 0x21a0, 0x20a9, 0x0004,
+	0x4003, 0x2069, 0x0200, 0x6817, 0x0001, 0x7040, 0xb86a, 0x7144,
+	0xb96e, 0x7048, 0xb872, 0x7050, 0xb876, 0x2069, 0x0200, 0x6817,
+	0x0000, 0xb8a0, 0x9086, 0x007e, 0x1110, 0x7144, 0xb96e, 0x9182,
+	0x0211, 0x1218, 0x2009, 0x0008, 0x0400, 0x9182, 0x0259, 0x1218,
+	0x2009, 0x0007, 0x00d0, 0x9182, 0x02c1, 0x1218, 0x2009, 0x0006,
+	0x00a0, 0x9182, 0x0349, 0x1218, 0x2009, 0x0005, 0x0070, 0x9182,
+	0x0421, 0x1218, 0x2009, 0x0004, 0x0040, 0x9182, 0x0581, 0x1218,
+	0x2009, 0x0003, 0x0010, 0x2009, 0x0002, 0xb992, 0x014e, 0x013e,
+	0x015e, 0x00de, 0x0005, 0x0016, 0x0026, 0x00e6, 0x2071, 0x0260,
+	0x7034, 0xb896, 0x703c, 0xb89a, 0x7054, 0xb89e, 0x0036, 0xbbcc,
+	0xc384, 0xba00, 0x2009, 0x1867, 0x210c, 0xd0bc, 0x0120, 0xd1ec,
+	0x0110, 0xc2ad, 0x0008, 0xc2ac, 0xd0c4, 0x0148, 0xd1e4, 0x0138,
+	0xc2bd, 0xd0cc, 0x0128, 0xd38c, 0x1108, 0xc385, 0x0008, 0xc2bc,
+	0xba02, 0xbbce, 0x003e, 0x00ee, 0x002e, 0x001e, 0x0005, 0x0096,
+	0x0126, 0x2091, 0x8000, 0xb8a4, 0x904d, 0x0578, 0xa900, 0x81ff,
+	0x15c0, 0xaa04, 0x9282, 0x0010, 0x16c8, 0x0136, 0x0146, 0x01c6,
+	0x01d6, 0x8906, 0x8006, 0x8007, 0x908c, 0x003f, 0x21e0, 0x9084,
+	0xffc0, 0x9080, 0x0004, 0x2098, 0x2009, 0x0010, 0x20a9, 0x0001,
+	0x4002, 0x9086, 0xffff, 0x0120, 0x8109, 0x1dd0, 0x080c, 0x0dd5,
+	0x3c00, 0x20e8, 0x3300, 0x8001, 0x20a0, 0x4604, 0x8210, 0xaa06,
+	0x01de, 0x01ce, 0x014e, 0x013e, 0x0060, 0x080c, 0x0fff, 0x0170,
+	0x2900, 0xb8a6, 0xa803, 0x0000, 0x080c, 0x67c4, 0xa807, 0x0001,
+	0xae12, 0x9085, 0x0001, 0x012e, 0x009e, 0x0005, 0x9006, 0x0cd8,
+	0x0126, 0x2091, 0x8000, 0x0096, 0xb8a4, 0x904d, 0x0188, 0xa800,
+	0x9005, 0x1150, 0x080c, 0x67d3, 0x1158, 0xa804, 0x908a, 0x0002,
+	0x0218, 0x8001, 0xa806, 0x0020, 0x080c, 0x1031, 0xb8a7, 0x0000,
+	0x009e, 0x012e, 0x0005, 0x0126, 0x2091, 0x8000, 0x080c, 0x90f6,
+	0x012e, 0x0005, 0x901e, 0x0010, 0x2019, 0x0001, 0x900e, 0x0126,
+	0x2091, 0x8000, 0xb84c, 0x2048, 0xb800, 0xd0dc, 0x1170, 0x89ff,
+	0x0500, 0x83ff, 0x0120, 0xa878, 0x9606, 0x0158, 0x0030, 0xa86c,
+	0x9406, 0x1118, 0xa870, 0x9506, 0x0120, 0x2908, 0xa800, 0x2048,
+	0x0c70, 0x080c, 0xa693, 0xaa00, 0xb84c, 0x9906, 0x1110, 0xba4e,
+	0x0020, 0x00a6, 0x2150, 0xb202, 0x00ae, 0x82ff, 0x1110, 0xb952,
+	0x89ff, 0x012e, 0x0005, 0x9016, 0x0489, 0x1110, 0x2011, 0x0001,
+	0x0005, 0x080c, 0x6828, 0x0128, 0x080c, 0xcc07, 0x0010, 0x9085,
+	0x0001, 0x0005, 0x080c, 0x6828, 0x0128, 0x080c, 0xcbac, 0x0010,
+	0x9085, 0x0001, 0x0005, 0x080c, 0x6828, 0x0128, 0x080c, 0xcc04,
+	0x0010, 0x9085, 0x0001, 0x0005, 0x080c, 0x6828, 0x0128, 0x080c,
+	0xcbcb, 0x0010, 0x9085, 0x0001, 0x0005, 0x080c, 0x6828, 0x0128,
+	0x080c, 0xcc48, 0x0010, 0x9085, 0x0001, 0x0005, 0xb8a4, 0x900d,
+	0x1118, 0x9085, 0x0001, 0x0005, 0x0136, 0x01c6, 0xa800, 0x9005,
+	0x11b8, 0x890e, 0x810e, 0x810f, 0x9184, 0x003f, 0x20e0, 0x9184,
+	0xffc0, 0x9080, 0x0004, 0x2098, 0x20a9, 0x0001, 0x2009, 0x0010,
+	0x4002, 0x9606, 0x0128, 0x8109, 0x1dd8, 0x9085, 0x0001, 0x0008,
+	0x9006, 0x01ce, 0x013e, 0x0005, 0x0146, 0x01d6, 0xa860, 0x20e8,
+	0xa85c, 0x9080, 0x0004, 0x20a0, 0x20a9, 0x0010, 0x2009, 0xffff,
+	0x4104, 0x01de, 0x014e, 0x0136, 0x01c6, 0xa800, 0x9005, 0x11b8,
 	0x890e, 0x810e, 0x810f, 0x9184, 0x003f, 0x20e0, 0x9184, 0xffc0,
 	0x9080, 0x0004, 0x2098, 0x20a9, 0x0001, 0x2009, 0x0010, 0x4002,
-	0x9606, 0x0128, 0x8109, 0x1dd8, 0x9085, 0x0001, 0x0008, 0x9006,
-	0x01ce, 0x013e, 0x0005, 0x0146, 0x01d6, 0xa860, 0x20e8, 0xa85c,
-	0x9080, 0x0004, 0x20a0, 0x20a9, 0x0010, 0x2009, 0xffff, 0x4104,
-	0x01de, 0x014e, 0x0136, 0x01c6, 0xa800, 0x9005, 0x11b8, 0x890e,
-	0x810e, 0x810f, 0x9184, 0x003f, 0x20e0, 0x9184, 0xffc0, 0x9080,
-	0x0004, 0x2098, 0x20a9, 0x0001, 0x2009, 0x0010, 0x4002, 0x9606,
-	0x0128, 0x8109, 0x1dd8, 0x9085, 0x0001, 0x0068, 0x0146, 0x01d6,
-	0x3300, 0x8001, 0x20a0, 0x3c00, 0x20e8, 0x2001, 0xffff, 0x4004,
-	0x01de, 0x014e, 0x9006, 0x01ce, 0x013e, 0x0005, 0x0096, 0x0126,
-	0x2091, 0x8000, 0xb8a4, 0x904d, 0x1128, 0x080c, 0x0fff, 0x0168,
-	0x2900, 0xb8a6, 0x080c, 0x67bb, 0xa803, 0x0001, 0xa807, 0x0000,
-	0x9085, 0x0001, 0x012e, 0x009e, 0x0005, 0x9006, 0x0cd8, 0x0096,
-	0x0126, 0x2091, 0x8000, 0xb8a4, 0x904d, 0x0130, 0xb8a7, 0x0000,
-	0x080c, 0x1031, 0x9085, 0x0001, 0x012e, 0x009e, 0x0005, 0xb89c,
-	0xd0a4, 0x0005, 0x00b6, 0x00f6, 0x080c, 0x73bc, 0x01b0, 0x71c4,
-	0x81ff, 0x1198, 0x71dc, 0xd19c, 0x0180, 0x2001, 0x007e, 0x9080,
-	0x1000, 0x2004, 0x905d, 0x0148, 0xb804, 0x9084, 0x00ff, 0x9086,
-	0x0006, 0x1118, 0xb800, 0xc0ed, 0xb802, 0x2079, 0x1847, 0x7804,
-	0xd0a4, 0x01d0, 0x0156, 0x20a9, 0x007f, 0x900e, 0x0016, 0x080c,
-	0x65ff, 0x1168, 0xb804, 0x9084, 0xff00, 0x8007, 0x9096, 0x0004,
-	0x0118, 0x9086, 0x0006, 0x1118, 0xb800, 0xc0ed, 0xb802, 0x001e,
-	0x8108, 0x1f04, 0x6846, 0x015e, 0x080c, 0x6930, 0x0120, 0x2001,
-	0x1985, 0x200c, 0x0038, 0x2079, 0x1847, 0x7804, 0xd0a4, 0x0130,
-	0x2009, 0x07d0, 0x2011, 0x6871, 0x080c, 0x858b, 0x00fe, 0x00be,
-	0x0005, 0x00b6, 0x2011, 0x6871, 0x080c, 0x84f3, 0x080c, 0x6930,
-	0x01d8, 0x2001, 0x107e, 0x2004, 0x2058, 0xb900, 0xc1ec, 0xb902,
-	0x080c, 0x696e, 0x0130, 0x2009, 0x07d0, 0x2011, 0x6871, 0x080c,
-	0x858b, 0x00e6, 0x2071, 0x1800, 0x9006, 0x707e, 0x7060, 0x7082,
-	0x080c, 0x2f96, 0x00ee, 0x04b0, 0x0156, 0x00c6, 0x20a9, 0x007f,
-	0x900e, 0x0016, 0x080c, 0x65ff, 0x1538, 0xb800, 0xd0ec, 0x0520,
-	0x0046, 0xbaa0, 0x2220, 0x9006, 0x2009, 0x0029, 0x080c, 0xe5ae,
-	0xb800, 0xc0e5, 0xc0ec, 0xb802, 0x080c, 0x696a, 0x2001, 0x0707,
-	0x1128, 0xb804, 0x9084, 0x00ff, 0x9085, 0x0700, 0xb806, 0x2019,
-	0x0029, 0x080c, 0x928b, 0x0076, 0x903e, 0x080c, 0x9168, 0x900e,
-	0x080c, 0xe2eb, 0x007e, 0x004e, 0x001e, 0x8108, 0x1f04, 0x6899,
-	0x00ce, 0x015e, 0x00be, 0x0005, 0x00b6, 0x6010, 0x2058, 0xb800,
-	0xc0ec, 0xb802, 0x00be, 0x0005, 0x00b6, 0x00c6, 0x0096, 0x080c,
-	0x1018, 0x090c, 0x0dd5, 0x2958, 0x009e, 0x2001, 0x196b, 0x2b02,
-	0x8b07, 0x8006, 0x8006, 0x908c, 0x003f, 0xb9c6, 0x908c, 0xffc0,
-	0xb9ca, 0xb8af, 0x0000, 0x2009, 0x00ff, 0x080c, 0x6034, 0xb807,
-	0x0006, 0xb813, 0x00ff, 0xb817, 0xffff, 0xb86f, 0x0200, 0xb86c,
-	0xb893, 0x0002, 0xb8bb, 0x0520, 0xb8a3, 0x00ff, 0xb8af, 0x0000,
-	0x00ce, 0x00be, 0x0005, 0x7810, 0x00b6, 0x2058, 0xb800, 0x00be,
-	0xd0ac, 0x0005, 0x6010, 0x00b6, 0x905d, 0x0108, 0xb800, 0x00be,
-	0xd0bc, 0x0005, 0x0006, 0x0016, 0x0026, 0xb804, 0x908c, 0x00ff,
-	0x9196, 0x0006, 0x0188, 0x9196, 0x0004, 0x0170, 0x9196, 0x0005,
-	0x0158, 0x908c, 0xff00, 0x810f, 0x9196, 0x0006, 0x0128, 0x9196,
-	0x0004, 0x0110, 0x9196, 0x0005, 0x002e, 0x001e, 0x000e, 0x0005,
-	0x00b6, 0x00f6, 0x2001, 0x107e, 0x2004, 0x905d, 0x0110, 0xb800,
-	0xd0ec, 0x00fe, 0x00be, 0x0005, 0x0126, 0x0026, 0x2091, 0x8000,
-	0x0006, 0xbaa0, 0x9290, 0x1000, 0x2204, 0x9b06, 0x190c, 0x0dd5,
-	0x000e, 0xba00, 0x9005, 0x0110, 0xc2fd, 0x0008, 0xc2fc, 0xba02,
-	0x002e, 0x012e, 0x0005, 0x2011, 0x1837, 0x2204, 0xd0cc, 0x0138,
-	0x2001, 0x1983, 0x200c, 0x2011, 0x6960, 0x080c, 0x858b, 0x0005,
-	0x2011, 0x6960, 0x080c, 0x84f3, 0x2011, 0x1837, 0x2204, 0xc0cc,
-	0x2012, 0x0005, 0x080c, 0x56cf, 0xd0ac, 0x0005, 0x080c, 0x56cf,
-	0xd0a4, 0x0005, 0x0016, 0xb904, 0x9184, 0x00ff, 0x908e, 0x0006,
-	0x001e, 0x0005, 0x0016, 0xb904, 0x9184, 0xff00, 0x8007, 0x908e,
-	0x0006, 0x001e, 0x0005, 0x00b6, 0x00f6, 0x080c, 0xd230, 0x0158,
-	0x70dc, 0x9084, 0x0028, 0x0138, 0x2001, 0x107f, 0x2004, 0x905d,
-	0x0110, 0xb8cc, 0xd094, 0x00fe, 0x00be, 0x0005, 0x2071, 0x1910,
-	0x7003, 0x0001, 0x7007, 0x0000, 0x9006, 0x7012, 0x7016, 0x701a,
-	0x701e, 0x700a, 0x7046, 0x2001, 0x1947, 0x2003, 0x0000, 0x0005,
-	0x0016, 0x00e6, 0x2071, 0x1948, 0x900e, 0x710a, 0x080c, 0x56cf,
-	0xd0fc, 0x1140, 0x080c, 0x56cf, 0x900e, 0xd09c, 0x0108, 0x8108,
-	0x7102, 0x00f8, 0x2001, 0x1867, 0x200c, 0x9184, 0x0007, 0x0002,
-	0x69b2, 0x69b2, 0x69b2, 0x69b2, 0x69b2, 0x69c8, 0x69d6, 0x69b2,
-	0x7003, 0x0003, 0x2009, 0x1868, 0x210c, 0x9184, 0xff00, 0x8007,
-	0x9005, 0x1110, 0x2001, 0x0002, 0x7006, 0x0018, 0x7003, 0x0005,
-	0x0c88, 0x00ee, 0x001e, 0x0005, 0x00e6, 0x2071, 0x0050, 0x684c,
-	0x9005, 0x1150, 0x00e6, 0x2071, 0x1910, 0x7028, 0xc085, 0x702a,
-	0x00ee, 0x9085, 0x0001, 0x0488, 0x6844, 0x9005, 0x0158, 0x080c,
-	0x7716, 0x6a60, 0x9200, 0x7002, 0x6864, 0x9101, 0x7006, 0x9006,
-	0x7012, 0x7016, 0x6860, 0x7002, 0x6864, 0x7006, 0x6868, 0x700a,
-	0x686c, 0x700e, 0x6844, 0x9005, 0x1110, 0x7012, 0x7016, 0x684c,
-	0x701a, 0x701c, 0x9085, 0x0040, 0x701e, 0x7037, 0x0019, 0x702b,
-	0x0001, 0x00e6, 0x2071, 0x1910, 0x7028, 0xc084, 0x702a, 0x7007,
-	0x0001, 0x700b, 0x0000, 0x00ee, 0x9006, 0x00ee, 0x0005, 0x00e6,
-	0x0026, 0x2071, 0x1948, 0x7000, 0x9015, 0x0904, 0x6c86, 0x9286,
-	0x0003, 0x0904, 0x6b1c, 0x9286, 0x0005, 0x0904, 0x6b1c, 0x2071,
-	0x1877, 0xa87c, 0x9005, 0x0904, 0x6a7d, 0x7140, 0xa868, 0x9102,
-	0x0a04, 0x6c86, 0xa878, 0xd084, 0x15d8, 0xa853, 0x0019, 0x2001,
-	0x8023, 0xa84e, 0x2071, 0x1910, 0x701c, 0x9005, 0x1904, 0x6e28,
-	0x0e04, 0x6e96, 0x2071, 0x0000, 0xa850, 0x7032, 0xa84c, 0x7082,
-	0xa870, 0x7086, 0xa86c, 0x708a, 0xa880, 0x708e, 0x7036, 0x0146,
-	0x01d6, 0x0136, 0x01c6, 0x0156, 0x20e9, 0x0000, 0x20a1, 0x002a,
-	0xa868, 0x20a8, 0xa860, 0x20e0, 0xa85c, 0x9080, 0x0021, 0x2098,
-	0x4003, 0x015e, 0x01ce, 0x013e, 0x01de, 0x014e, 0x2091, 0x4080,
-	0x2001, 0x0089, 0x2004, 0xd084, 0x190c, 0x119b, 0x0804, 0x6aff,
-	0xa853, 0x001b, 0x2001, 0x8027, 0x0820, 0x7004, 0xd08c, 0x1904,
-	0x6c86, 0xa853, 0x001a, 0x2001, 0x8024, 0x0804, 0x6a41, 0x00e6,
-	0x0026, 0x2071, 0x1948, 0x7000, 0x9015, 0x0904, 0x6c86, 0x9286,
-	0x0003, 0x0904, 0x6b1c, 0x9286, 0x0005, 0x0904, 0x6b1c, 0xa84f,
-	0x8022, 0xa853, 0x0018, 0x0804, 0x6ae4, 0xa868, 0xd0fc, 0x11d8,
-	0x00e6, 0x0026, 0x2001, 0x1948, 0x2004, 0x9005, 0x0904, 0x6c86,
-	0xa87c, 0xd0bc, 0x1904, 0x6c86, 0xa978, 0xa874, 0x9105, 0x1904,
-	0x6c86, 0x2001, 0x1948, 0x2004, 0x0002, 0x6c86, 0x6ae0, 0x6b1c,
-	0x6b1c, 0x6c86, 0x6b1c, 0x0005, 0xa868, 0xd0fc, 0x1500, 0x00e6,
-	0x0026, 0x2009, 0x1948, 0x210c, 0x81ff, 0x0904, 0x6c86, 0xa87c,
-	0xd0cc, 0x0904, 0x6c86, 0xa880, 0x9084, 0x00ff, 0x9086, 0x0001,
-	0x1904, 0x6c86, 0x9186, 0x0003, 0x0904, 0x6b1c, 0x9186, 0x0005,
-	0x0904, 0x6b1c, 0xa84f, 0x8021, 0xa853, 0x0017, 0x0028, 0x0005,
-	0xa84f, 0x8020, 0xa853, 0x0016, 0x2071, 0x1910, 0x701c, 0x9005,
-	0x1904, 0x6e28, 0x0e04, 0x6e96, 0x2071, 0x0000, 0xa84c, 0x7082,
-	0xa850, 0x7032, 0xa86c, 0x7086, 0x7036, 0xa870, 0x708a, 0x2091,
-	0x4080, 0x2001, 0x0089, 0x2004, 0xd084, 0x190c, 0x119b, 0x2071,
-	0x1800, 0x2011, 0x0001, 0xa804, 0x900d, 0x702c, 0x1158, 0xa802,
-	0x2900, 0x702e, 0x70c0, 0x9200, 0x70c2, 0x080c, 0x8414, 0x002e,
-	0x00ee, 0x0005, 0x0096, 0x2148, 0xa904, 0xa802, 0x8210, 0x2900,
-	0x81ff, 0x1dc8, 0x009e, 0x0c58, 0xa84f, 0x0000, 0x00f6, 0x2079,
-	0x0050, 0x2071, 0x1910, 0xa803, 0x0000, 0x7010, 0x9005, 0x1904,
-	0x6c0b, 0x782c, 0x908c, 0x0780, 0x190c, 0x6fe2, 0x8004, 0x8004,
-	0x8004, 0x9084, 0x0003, 0x0002, 0x6b3a, 0x6c0b, 0x6b5f, 0x6ba6,
-	0x080c, 0x0dd5, 0x2071, 0x1800, 0x2900, 0x7822, 0xa804, 0x900d,
-	0x1170, 0x2071, 0x19fa, 0x703c, 0x9005, 0x1328, 0x2001, 0x1949,
-	0x2004, 0x8005, 0x703e, 0x00fe, 0x002e, 0x00ee, 0x0005, 0x9016,
-	0x702c, 0x2148, 0xa904, 0xa802, 0x8210, 0x2900, 0x81ff, 0x1dc8,
-	0x702e, 0x70c0, 0x9200, 0x70c2, 0x080c, 0x8414, 0x0c10, 0x2071,
-	0x1800, 0x2900, 0x7822, 0xa804, 0x900d, 0x1580, 0x7824, 0x00e6,
-	0x2071, 0x0040, 0x712c, 0xd19c, 0x1148, 0x2009, 0x1830, 0x210c,
-	0x918a, 0x0020, 0x0218, 0x7022, 0x00ee, 0x0058, 0x00ee, 0x2048,
-	0x702c, 0xa802, 0x2900, 0x702e, 0x70c0, 0x8000, 0x70c2, 0x080c,
-	0x8414, 0x782c, 0x9094, 0x0780, 0x190c, 0x6fe2, 0xd0a4, 0x19f0,
-	0x2071, 0x19fa, 0x703c, 0x9005, 0x1328, 0x2001, 0x1949, 0x2004,
-	0x8005, 0x703e, 0x00fe, 0x002e, 0x00ee, 0x0005, 0x9016, 0x702c,
-	0x2148, 0xa904, 0xa802, 0x8210, 0x2900, 0x81ff, 0x1dc8, 0x702e,
-	0x70c0, 0x9200, 0x70c2, 0x080c, 0x8414, 0x0800, 0x0096, 0x00e6,
-	0x7824, 0x2048, 0x2071, 0x1800, 0x702c, 0xa802, 0x2900, 0x702e,
-	0x70c0, 0x8000, 0x70c2, 0x080c, 0x8414, 0x782c, 0x9094, 0x0780,
-	0x190c, 0x6fe2, 0xd0a4, 0x1d60, 0x00ee, 0x782c, 0x9094, 0x0780,
-	0x190c, 0x6fe2, 0xd09c, 0x11a0, 0x009e, 0x2900, 0x7822, 0xa804,
-	0x900d, 0x1560, 0x2071, 0x19fa, 0x703c, 0x9005, 0x1328, 0x2001,
-	0x1949, 0x2004, 0x8005, 0x703e, 0x00fe, 0x002e, 0x00ee, 0x0005,
-	0x009e, 0x2908, 0x7010, 0x8000, 0x7012, 0x7018, 0x904d, 0x711a,
-	0x0110, 0xa902, 0x0008, 0x711e, 0x2148, 0xa804, 0x900d, 0x1170,
-	0x2071, 0x19fa, 0x703c, 0x9005, 0x1328, 0x2001, 0x1949, 0x2004,
-	0x8005, 0x703e, 0x00fe, 0x002e, 0x00ee, 0x0005, 0x2071, 0x1800,
-	0x9016, 0x702c, 0x2148, 0xa904, 0xa802, 0x8210, 0x2900, 0x81ff,
-	0x1dc8, 0x702e, 0x70c0, 0x9200, 0x70c2, 0x080c, 0x8414, 0x00fe,
-	0x002e, 0x00ee, 0x0005, 0x2908, 0x7010, 0x8000, 0x7012, 0x7018,
-	0x904d, 0x711a, 0x0110, 0xa902, 0x0008, 0x711e, 0x2148, 0xa804,
-	0x900d, 0x1904, 0x6c60, 0x782c, 0x9094, 0x0780, 0x190c, 0x6fe2,
-	0xd09c, 0x1198, 0x701c, 0x904d, 0x0180, 0x7010, 0x8001, 0x7012,
-	0x1108, 0x701a, 0xa800, 0x701e, 0x2900, 0x7822, 0x782c, 0x9094,
-	0x0780, 0x190c, 0x6fe2, 0xd09c, 0x0d68, 0x782c, 0x9094, 0x0780,
-	0x190c, 0x6fe2, 0xd0a4, 0x01b0, 0x00e6, 0x7824, 0x2048, 0x2071,
-	0x1800, 0x702c, 0xa802, 0x2900, 0x702e, 0x70c0, 0x8000, 0x70c2,
-	0x080c, 0x8414, 0x782c, 0x9094, 0x0780, 0x190c, 0x6fe2, 0xd0a4,
-	0x1d60, 0x00ee, 0x2071, 0x19fa, 0x703c, 0x9005, 0x1328, 0x2001,
-	0x1949, 0x2004, 0x8005, 0x703e, 0x00fe, 0x002e, 0x00ee, 0x0005,
-	0x00e6, 0x2071, 0x1800, 0x9016, 0x702c, 0x2148, 0xa904, 0xa802,
-	0x8210, 0x2900, 0x81ff, 0x1dc8, 0x702e, 0x70c0, 0x9200, 0x70c2,
-	0x080c, 0x8414, 0x00ee, 0x0804, 0x6c1b, 0xa868, 0xd0fc, 0x1560,
-	0x0096, 0xa804, 0xa807, 0x0000, 0x904d, 0x190c, 0x0fb1, 0x009e,
-	0x0018, 0xa868, 0xd0fc, 0x1500, 0x00e6, 0x0026, 0xa84f, 0x0000,
-	0x00f6, 0x2079, 0x0050, 0x2071, 0x1910, 0xa803, 0x0000, 0x7010,
-	0x9005, 0x1904, 0x6da2, 0x782c, 0x908c, 0x0780, 0x190c, 0x6fe2,
-	0x8004, 0x8004, 0x8004, 0x9084, 0x0003, 0x0002, 0x6ca5, 0x6da2,
-	0x6cc0, 0x6d31, 0x080c, 0x0dd5, 0x0005, 0x2071, 0x1800, 0x2900,
-	0x7822, 0xa804, 0x900d, 0x1120, 0x00fe, 0x002e, 0x00ee, 0x0005,
-	0x9016, 0x702c, 0x2148, 0xa904, 0xa802, 0x8210, 0x2900, 0x81ff,
-	0x1dc8, 0x702e, 0x70c0, 0x9200, 0x70c2, 0x080c, 0x8414, 0x0c60,
-	0x2071, 0x1800, 0x2900, 0x7822, 0xa804, 0x900d, 0x1904, 0x6d20,
-	0x7830, 0x8007, 0x9084, 0x001f, 0x9082, 0x0005, 0x1220, 0x00fe,
-	0x002e, 0x00ee, 0x0005, 0x7824, 0x00e6, 0x2071, 0x0040, 0x712c,
+	0x9606, 0x0128, 0x8109, 0x1dd8, 0x9085, 0x0001, 0x0068, 0x0146,
+	0x01d6, 0x3300, 0x8001, 0x20a0, 0x3c00, 0x20e8, 0x2001, 0xffff,
+	0x4004, 0x01de, 0x014e, 0x9006, 0x01ce, 0x013e, 0x0005, 0x0096,
+	0x0126, 0x2091, 0x8000, 0xb8a4, 0x904d, 0x1128, 0x080c, 0x0fff,
+	0x0168, 0x2900, 0xb8a6, 0x080c, 0x67c4, 0xa803, 0x0001, 0xa807,
+	0x0000, 0x9085, 0x0001, 0x012e, 0x009e, 0x0005, 0x9006, 0x0cd8,
+	0x0096, 0x0126, 0x2091, 0x8000, 0xb8a4, 0x904d, 0x0130, 0xb8a7,
+	0x0000, 0x080c, 0x1031, 0x9085, 0x0001, 0x012e, 0x009e, 0x0005,
+	0xb89c, 0xd0a4, 0x0005, 0x00b6, 0x00f6, 0x080c, 0x73a5, 0x01b0,
+	0x71c4, 0x81ff, 0x1198, 0x71dc, 0xd19c, 0x0180, 0x2001, 0x007e,
+	0x9080, 0x1000, 0x2004, 0x905d, 0x0148, 0xb804, 0x9084, 0x00ff,
+	0x9086, 0x0006, 0x1118, 0xb800, 0xc0ed, 0xb802, 0x2079, 0x1847,
+	0x7804, 0xd0a4, 0x01d0, 0x0156, 0x20a9, 0x007f, 0x900e, 0x0016,
+	0x080c, 0x6608, 0x1168, 0xb804, 0x9084, 0xff00, 0x8007, 0x9096,
+	0x0004, 0x0118, 0x9086, 0x0006, 0x1118, 0xb800, 0xc0ed, 0xb802,
+	0x001e, 0x8108, 0x1f04, 0x684f, 0x015e, 0x080c, 0x6939, 0x0120,
+	0x2001, 0x1984, 0x200c, 0x0038, 0x2079, 0x1847, 0x7804, 0xd0a4,
+	0x0130, 0x2009, 0x07d0, 0x2011, 0x687a, 0x080c, 0x8574, 0x00fe,
+	0x00be, 0x0005, 0x00b6, 0x2011, 0x687a, 0x080c, 0x84dc, 0x080c,
+	0x6939, 0x01d8, 0x2001, 0x107e, 0x2004, 0x2058, 0xb900, 0xc1ec,
+	0xb902, 0x080c, 0x6977, 0x0130, 0x2009, 0x07d0, 0x2011, 0x687a,
+	0x080c, 0x8574, 0x00e6, 0x2071, 0x1800, 0x9006, 0x707e, 0x7060,
+	0x7082, 0x080c, 0x2f98, 0x00ee, 0x04b0, 0x0156, 0x00c6, 0x20a9,
+	0x007f, 0x900e, 0x0016, 0x080c, 0x6608, 0x1538, 0xb800, 0xd0ec,
+	0x0520, 0x0046, 0xbaa0, 0x2220, 0x9006, 0x2009, 0x0029, 0x080c,
+	0xe5cf, 0xb800, 0xc0e5, 0xc0ec, 0xb802, 0x080c, 0x6973, 0x2001,
+	0x0707, 0x1128, 0xb804, 0x9084, 0x00ff, 0x9085, 0x0700, 0xb806,
+	0x2019, 0x0029, 0x080c, 0x927e, 0x0076, 0x903e, 0x080c, 0x9151,
+	0x900e, 0x080c, 0xe30c, 0x007e, 0x004e, 0x001e, 0x8108, 0x1f04,
+	0x68a2, 0x00ce, 0x015e, 0x00be, 0x0005, 0x00b6, 0x6010, 0x2058,
+	0xb800, 0xc0ec, 0xb802, 0x00be, 0x0005, 0x00b6, 0x00c6, 0x0096,
+	0x080c, 0x1018, 0x090c, 0x0dd5, 0x2958, 0x009e, 0x2001, 0x196a,
+	0x2b02, 0x8b07, 0x8006, 0x8006, 0x908c, 0x003f, 0xb9c6, 0x908c,
+	0xffc0, 0xb9ca, 0xb8af, 0x0000, 0x2009, 0x00ff, 0x080c, 0x603d,
+	0xb807, 0x0006, 0xb813, 0x00ff, 0xb817, 0xffff, 0xb86f, 0x0200,
+	0xb86c, 0xb893, 0x0002, 0xb8bb, 0x0520, 0xb8a3, 0x00ff, 0xb8af,
+	0x0000, 0x00ce, 0x00be, 0x0005, 0x7810, 0x00b6, 0x2058, 0xb800,
+	0x00be, 0xd0ac, 0x0005, 0x6010, 0x00b6, 0x905d, 0x0108, 0xb800,
+	0x00be, 0xd0bc, 0x0005, 0x0006, 0x0016, 0x0026, 0xb804, 0x908c,
+	0x00ff, 0x9196, 0x0006, 0x0188, 0x9196, 0x0004, 0x0170, 0x9196,
+	0x0005, 0x0158, 0x908c, 0xff00, 0x810f, 0x9196, 0x0006, 0x0128,
+	0x9196, 0x0004, 0x0110, 0x9196, 0x0005, 0x002e, 0x001e, 0x000e,
+	0x0005, 0x00b6, 0x00f6, 0x2001, 0x107e, 0x2004, 0x905d, 0x0110,
+	0xb800, 0xd0ec, 0x00fe, 0x00be, 0x0005, 0x0126, 0x0026, 0x2091,
+	0x8000, 0x0006, 0xbaa0, 0x9290, 0x1000, 0x2204, 0x9b06, 0x190c,
+	0x0dd5, 0x000e, 0xba00, 0x9005, 0x0110, 0xc2fd, 0x0008, 0xc2fc,
+	0xba02, 0x002e, 0x012e, 0x0005, 0x2011, 0x1837, 0x2204, 0xd0cc,
+	0x0138, 0x2001, 0x1982, 0x200c, 0x2011, 0x6969, 0x080c, 0x8574,
+	0x0005, 0x2011, 0x6969, 0x080c, 0x84dc, 0x2011, 0x1837, 0x2204,
+	0xc0cc, 0x2012, 0x0005, 0x080c, 0x56d8, 0xd0ac, 0x0005, 0x080c,
+	0x56d8, 0xd0a4, 0x0005, 0x0016, 0xb904, 0x9184, 0x00ff, 0x908e,
+	0x0006, 0x001e, 0x0005, 0x0016, 0xb904, 0x9184, 0xff00, 0x8007,
+	0x908e, 0x0006, 0x001e, 0x0005, 0x00b6, 0x00f6, 0x080c, 0xd24a,
+	0x0158, 0x70dc, 0x9084, 0x0028, 0x0138, 0x2001, 0x107f, 0x2004,
+	0x905d, 0x0110, 0xb8cc, 0xd094, 0x00fe, 0x00be, 0x0005, 0x2071,
+	0x1910, 0x7003, 0x0001, 0x7007, 0x0000, 0x9006, 0x7012, 0x7016,
+	0x701a, 0x701e, 0x700a, 0x7046, 0x0005, 0x0016, 0x00e6, 0x2071,
+	0x1947, 0x900e, 0x710a, 0x080c, 0x56d8, 0xd0fc, 0x1140, 0x080c,
+	0x56d8, 0x900e, 0xd09c, 0x0108, 0x8108, 0x7102, 0x00f8, 0x2001,
+	0x1867, 0x200c, 0x9184, 0x0007, 0x0002, 0x69b7, 0x69b7, 0x69b7,
+	0x69b7, 0x69b7, 0x69cd, 0x69db, 0x69b7, 0x7003, 0x0003, 0x2009,
+	0x1868, 0x210c, 0x9184, 0xff00, 0x8007, 0x9005, 0x1110, 0x2001,
+	0x0002, 0x7006, 0x0018, 0x7003, 0x0005, 0x0c88, 0x00ee, 0x001e,
+	0x0005, 0x00e6, 0x2071, 0x0050, 0x684c, 0x9005, 0x1150, 0x00e6,
+	0x2071, 0x1910, 0x7028, 0xc085, 0x702a, 0x00ee, 0x9085, 0x0001,
+	0x0488, 0x6844, 0x9005, 0x0158, 0x080c, 0x76ff, 0x6a60, 0x9200,
+	0x7002, 0x6864, 0x9101, 0x7006, 0x9006, 0x7012, 0x7016, 0x6860,
+	0x7002, 0x6864, 0x7006, 0x6868, 0x700a, 0x686c, 0x700e, 0x6844,
+	0x9005, 0x1110, 0x7012, 0x7016, 0x684c, 0x701a, 0x701c, 0x9085,
+	0x0040, 0x701e, 0x7037, 0x0019, 0x702b, 0x0001, 0x00e6, 0x2071,
+	0x1910, 0x7028, 0xc084, 0x702a, 0x7007, 0x0001, 0x700b, 0x0000,
+	0x00ee, 0x9006, 0x00ee, 0x0005, 0x00e6, 0x0026, 0x2071, 0x1947,
+	0x7000, 0x9015, 0x0904, 0x6c8b, 0x9286, 0x0003, 0x0904, 0x6b21,
+	0x9286, 0x0005, 0x0904, 0x6b21, 0x2071, 0x1877, 0xa87c, 0x9005,
+	0x0904, 0x6a82, 0x7140, 0xa868, 0x9102, 0x0a04, 0x6c8b, 0xa878,
+	0xd084, 0x15d8, 0xa853, 0x0019, 0x2001, 0x8023, 0xa84e, 0x2071,
+	0x1910, 0x701c, 0x9005, 0x1904, 0x6e21, 0x0e04, 0x6e8f, 0x2071,
+	0x0000, 0xa850, 0x7032, 0xa84c, 0x7082, 0xa870, 0x7086, 0xa86c,
+	0x708a, 0xa880, 0x708e, 0x7036, 0x0146, 0x01d6, 0x0136, 0x01c6,
+	0x0156, 0x20e9, 0x0000, 0x20a1, 0x002a, 0xa868, 0x20a8, 0xa860,
+	0x20e0, 0xa85c, 0x9080, 0x0021, 0x2098, 0x4003, 0x015e, 0x01ce,
+	0x013e, 0x01de, 0x014e, 0x2091, 0x4080, 0x2001, 0x0089, 0x2004,
+	0xd084, 0x190c, 0x119b, 0x0804, 0x6b04, 0xa853, 0x001b, 0x2001,
+	0x8027, 0x0820, 0x7004, 0xd08c, 0x1904, 0x6c8b, 0xa853, 0x001a,
+	0x2001, 0x8024, 0x0804, 0x6a46, 0x00e6, 0x0026, 0x2071, 0x1947,
+	0x7000, 0x9015, 0x0904, 0x6c8b, 0x9286, 0x0003, 0x0904, 0x6b21,
+	0x9286, 0x0005, 0x0904, 0x6b21, 0xa84f, 0x8022, 0xa853, 0x0018,
+	0x0804, 0x6ae9, 0xa868, 0xd0fc, 0x11d8, 0x00e6, 0x0026, 0x2001,
+	0x1947, 0x2004, 0x9005, 0x0904, 0x6c8b, 0xa87c, 0xd0bc, 0x1904,
+	0x6c8b, 0xa978, 0xa874, 0x9105, 0x1904, 0x6c8b, 0x2001, 0x1947,
+	0x2004, 0x0002, 0x6c8b, 0x6ae5, 0x6b21, 0x6b21, 0x6c8b, 0x6b21,
+	0x0005, 0xa868, 0xd0fc, 0x1500, 0x00e6, 0x0026, 0x2009, 0x1947,
+	0x210c, 0x81ff, 0x0904, 0x6c8b, 0xa87c, 0xd0cc, 0x0904, 0x6c8b,
+	0xa880, 0x9084, 0x00ff, 0x9086, 0x0001, 0x1904, 0x6c8b, 0x9186,
+	0x0003, 0x0904, 0x6b21, 0x9186, 0x0005, 0x0904, 0x6b21, 0xa84f,
+	0x8021, 0xa853, 0x0017, 0x0028, 0x0005, 0xa84f, 0x8020, 0xa853,
+	0x0016, 0x2071, 0x1910, 0x701c, 0x9005, 0x1904, 0x6e21, 0x0e04,
+	0x6e8f, 0x2071, 0x0000, 0xa84c, 0x7082, 0xa850, 0x7032, 0xa86c,
+	0x7086, 0x7036, 0xa870, 0x708a, 0x2091, 0x4080, 0x2001, 0x0089,
+	0x2004, 0xd084, 0x190c, 0x119b, 0x2071, 0x1800, 0x2011, 0x0001,
+	0xa804, 0x900d, 0x702c, 0x1158, 0xa802, 0x2900, 0x702e, 0x70c0,
+	0x9200, 0x70c2, 0x080c, 0x83fd, 0x002e, 0x00ee, 0x0005, 0x0096,
+	0x2148, 0xa904, 0xa802, 0x8210, 0x2900, 0x81ff, 0x1dc8, 0x009e,
+	0x0c58, 0xa84f, 0x0000, 0x00f6, 0x2079, 0x0050, 0x2071, 0x1910,
+	0xa803, 0x0000, 0x7010, 0x9005, 0x1904, 0x6c10, 0x782c, 0x908c,
+	0x0780, 0x190c, 0x6fdb, 0x8004, 0x8004, 0x8004, 0x9084, 0x0003,
+	0x0002, 0x6b3f, 0x6c10, 0x6b64, 0x6bab, 0x080c, 0x0dd5, 0x2071,
+	0x1800, 0x2900, 0x7822, 0xa804, 0x900d, 0x1170, 0x2071, 0x19f9,
+	0x703c, 0x9005, 0x1328, 0x2001, 0x1948, 0x2004, 0x8005, 0x703e,
+	0x00fe, 0x002e, 0x00ee, 0x0005, 0x9016, 0x702c, 0x2148, 0xa904,
+	0xa802, 0x8210, 0x2900, 0x81ff, 0x1dc8, 0x702e, 0x70c0, 0x9200,
+	0x70c2, 0x080c, 0x83fd, 0x0c10, 0x2071, 0x1800, 0x2900, 0x7822,
+	0xa804, 0x900d, 0x1580, 0x7824, 0x00e6, 0x2071, 0x0040, 0x712c,
 	0xd19c, 0x1148, 0x2009, 0x1830, 0x210c, 0x918a, 0x0020, 0x0218,
 	0x7022, 0x00ee, 0x0058, 0x00ee, 0x2048, 0x702c, 0xa802, 0x2900,
-	0x702e, 0x70c0, 0x8000, 0x70c2, 0x080c, 0x8414, 0x782c, 0x9094,
-	0x0780, 0x190c, 0x6fe2, 0xd0a4, 0x19f0, 0x0e04, 0x6d17, 0x7838,
-	0x7938, 0x910e, 0x1de0, 0x00d6, 0x2069, 0x0000, 0x6836, 0x6833,
-	0x0013, 0x00de, 0x2001, 0x1921, 0x200c, 0xc184, 0x2102, 0x2091,
-	0x4080, 0x2001, 0x0089, 0x2004, 0xd084, 0x190c, 0x119b, 0x2009,
-	0x1947, 0x200b, 0x0000, 0x00fe, 0x002e, 0x00ee, 0x0005, 0x2001,
-	0x1921, 0x200c, 0xc185, 0x2102, 0x00fe, 0x002e, 0x00ee, 0x0005,
+	0x702e, 0x70c0, 0x8000, 0x70c2, 0x080c, 0x83fd, 0x782c, 0x9094,
+	0x0780, 0x190c, 0x6fdb, 0xd0a4, 0x19f0, 0x2071, 0x19f9, 0x703c,
+	0x9005, 0x1328, 0x2001, 0x1948, 0x2004, 0x8005, 0x703e, 0x00fe,
+	0x002e, 0x00ee, 0x0005, 0x9016, 0x702c, 0x2148, 0xa904, 0xa802,
+	0x8210, 0x2900, 0x81ff, 0x1dc8, 0x702e, 0x70c0, 0x9200, 0x70c2,
+	0x080c, 0x83fd, 0x0800, 0x0096, 0x00e6, 0x7824, 0x2048, 0x2071,
+	0x1800, 0x702c, 0xa802, 0x2900, 0x702e, 0x70c0, 0x8000, 0x70c2,
+	0x080c, 0x83fd, 0x782c, 0x9094, 0x0780, 0x190c, 0x6fdb, 0xd0a4,
+	0x1d60, 0x00ee, 0x782c, 0x9094, 0x0780, 0x190c, 0x6fdb, 0xd09c,
+	0x11a0, 0x009e, 0x2900, 0x7822, 0xa804, 0x900d, 0x1560, 0x2071,
+	0x19f9, 0x703c, 0x9005, 0x1328, 0x2001, 0x1948, 0x2004, 0x8005,
+	0x703e, 0x00fe, 0x002e, 0x00ee, 0x0005, 0x009e, 0x2908, 0x7010,
+	0x8000, 0x7012, 0x7018, 0x904d, 0x711a, 0x0110, 0xa902, 0x0008,
+	0x711e, 0x2148, 0xa804, 0x900d, 0x1170, 0x2071, 0x19f9, 0x703c,
+	0x9005, 0x1328, 0x2001, 0x1948, 0x2004, 0x8005, 0x703e, 0x00fe,
+	0x002e, 0x00ee, 0x0005, 0x2071, 0x1800, 0x9016, 0x702c, 0x2148,
+	0xa904, 0xa802, 0x8210, 0x2900, 0x81ff, 0x1dc8, 0x702e, 0x70c0,
+	0x9200, 0x70c2, 0x080c, 0x83fd, 0x00fe, 0x002e, 0x00ee, 0x0005,
+	0x2908, 0x7010, 0x8000, 0x7012, 0x7018, 0x904d, 0x711a, 0x0110,
+	0xa902, 0x0008, 0x711e, 0x2148, 0xa804, 0x900d, 0x1904, 0x6c65,
+	0x782c, 0x9094, 0x0780, 0x190c, 0x6fdb, 0xd09c, 0x1198, 0x701c,
+	0x904d, 0x0180, 0x7010, 0x8001, 0x7012, 0x1108, 0x701a, 0xa800,
+	0x701e, 0x2900, 0x7822, 0x782c, 0x9094, 0x0780, 0x190c, 0x6fdb,
+	0xd09c, 0x0d68, 0x782c, 0x9094, 0x0780, 0x190c, 0x6fdb, 0xd0a4,
+	0x01b0, 0x00e6, 0x7824, 0x2048, 0x2071, 0x1800, 0x702c, 0xa802,
+	0x2900, 0x702e, 0x70c0, 0x8000, 0x70c2, 0x080c, 0x83fd, 0x782c,
+	0x9094, 0x0780, 0x190c, 0x6fdb, 0xd0a4, 0x1d60, 0x00ee, 0x2071,
+	0x19f9, 0x703c, 0x9005, 0x1328, 0x2001, 0x1948, 0x2004, 0x8005,
+	0x703e, 0x00fe, 0x002e, 0x00ee, 0x0005, 0x00e6, 0x2071, 0x1800,
 	0x9016, 0x702c, 0x2148, 0xa904, 0xa802, 0x8210, 0x2900, 0x81ff,
-	0x1dc8, 0x702e, 0x70c0, 0x9200, 0x70c2, 0x080c, 0x8414, 0x0804,
-	0x6cd3, 0x0096, 0x00e6, 0x7824, 0x2048, 0x2071, 0x1800, 0x702c,
-	0xa802, 0x2900, 0x702e, 0x70c0, 0x8000, 0x70c2, 0x080c, 0x8414,
-	0x782c, 0x9094, 0x0780, 0x190c, 0x6fe2, 0xd0a4, 0x1d60, 0x00ee,
-	0x0e04, 0x6d75, 0x7838, 0x7938, 0x910e, 0x1de0, 0x00d6, 0x2069,
-	0x0000, 0x6836, 0x6833, 0x0013, 0x00de, 0x7044, 0xc084, 0x7046,
-	0x2091, 0x4080, 0x2001, 0x0089, 0x2004, 0xd084, 0x190c, 0x119b,
-	0x2009, 0x1947, 0x200b, 0x0000, 0x782c, 0x9094, 0x0780, 0x190c,
-	0x6fe2, 0xd09c, 0x1170, 0x009e, 0x2900, 0x7822, 0xa804, 0x900d,
-	0x11e0, 0x00fe, 0x002e, 0x00ee, 0x0005, 0x7044, 0xc085, 0x7046,
-	0x0c58, 0x009e, 0x2908, 0x7010, 0x8000, 0x7012, 0x7018, 0x904d,
-	0x711a, 0x0110, 0xa902, 0x0008, 0x711e, 0x2148, 0xa804, 0x900d,
-	0x1120, 0x00fe, 0x002e, 0x00ee, 0x0005, 0x2071, 0x1800, 0x9016,
+	0x1dc8, 0x702e, 0x70c0, 0x9200, 0x70c2, 0x080c, 0x83fd, 0x00ee,
+	0x0804, 0x6c20, 0xa868, 0xd0fc, 0x1560, 0x0096, 0xa804, 0xa807,
+	0x0000, 0x904d, 0x190c, 0x0fb1, 0x009e, 0x0018, 0xa868, 0xd0fc,
+	0x1500, 0x00e6, 0x0026, 0xa84f, 0x0000, 0x00f6, 0x2079, 0x0050,
+	0x2071, 0x1910, 0xa803, 0x0000, 0x7010, 0x9005, 0x1904, 0x6d9f,
+	0x782c, 0x908c, 0x0780, 0x190c, 0x6fdb, 0x8004, 0x8004, 0x8004,
+	0x9084, 0x0003, 0x0002, 0x6caa, 0x6d9f, 0x6cc5, 0x6d32, 0x080c,
+	0x0dd5, 0x0005, 0x2071, 0x1800, 0x2900, 0x7822, 0xa804, 0x900d,
+	0x1120, 0x00fe, 0x002e, 0x00ee, 0x0005, 0x9016, 0x702c, 0x2148,
+	0xa904, 0xa802, 0x8210, 0x2900, 0x81ff, 0x1dc8, 0x702e, 0x70c0,
+	0x9200, 0x70c2, 0x080c, 0x83fd, 0x0c60, 0x2071, 0x1800, 0x2900,
+	0x7822, 0xa804, 0x900d, 0x1904, 0x6d21, 0x7830, 0x8007, 0x9084,
+	0x001f, 0x9082, 0x0001, 0x1220, 0x00fe, 0x002e, 0x00ee, 0x0005,
+	0x7824, 0x00e6, 0x2071, 0x0040, 0x712c, 0xd19c, 0x1148, 0x2009,
+	0x1830, 0x210c, 0x918a, 0x0020, 0x0218, 0x7022, 0x00ee, 0x0058,
+	0x00ee, 0x2048, 0x702c, 0xa802, 0x2900, 0x702e, 0x70c0, 0x8000,
+	0x70c2, 0x080c, 0x83fd, 0x782c, 0x9094, 0x0780, 0x190c, 0x6fdb,
+	0xd0a4, 0x19f0, 0x0e04, 0x6d18, 0x7838, 0x7938, 0x910e, 0x1de0,
+	0x00d6, 0x2069, 0x0000, 0x6836, 0x6833, 0x0013, 0x00de, 0x2001,
+	0x1921, 0x200c, 0xc184, 0x2102, 0x2091, 0x4080, 0x2001, 0x0089,
+	0x2004, 0xd084, 0x190c, 0x119b, 0x00fe, 0x002e, 0x00ee, 0x0005,
+	0x2001, 0x1921, 0x200c, 0xc185, 0x2102, 0x00fe, 0x002e, 0x00ee,
+	0x0005, 0x9016, 0x702c, 0x2148, 0xa904, 0xa802, 0x8210, 0x2900,
+	0x81ff, 0x1dc8, 0x702e, 0x70c0, 0x9200, 0x70c2, 0x080c, 0x83fd,
+	0x0804, 0x6cd8, 0x0096, 0x00e6, 0x7824, 0x2048, 0x2071, 0x1800,
+	0x702c, 0xa802, 0x2900, 0x702e, 0x70c0, 0x8000, 0x70c2, 0x080c,
+	0x83fd, 0x782c, 0x9094, 0x0780, 0x190c, 0x6fdb, 0xd0a4, 0x1d60,
+	0x00ee, 0x0e04, 0x6d72, 0x7838, 0x7938, 0x910e, 0x1de0, 0x00d6,
+	0x2069, 0x0000, 0x6836, 0x6833, 0x0013, 0x00de, 0x7044, 0xc084,
+	0x7046, 0x2091, 0x4080, 0x2001, 0x0089, 0x2004, 0xd084, 0x190c,
+	0x119b, 0x782c, 0x9094, 0x0780, 0x190c, 0x6fdb, 0xd09c, 0x1170,
+	0x009e, 0x2900, 0x7822, 0xa804, 0x900d, 0x11e0, 0x00fe, 0x002e,
+	0x00ee, 0x0005, 0x7044, 0xc085, 0x7046, 0x0c58, 0x009e, 0x2908,
+	0x7010, 0x8000, 0x7012, 0x7018, 0x904d, 0x711a, 0x0110, 0xa902,
+	0x0008, 0x711e, 0x2148, 0xa804, 0x900d, 0x1120, 0x00fe, 0x002e,
+	0x00ee, 0x0005, 0x2071, 0x1800, 0x9016, 0x702c, 0x2148, 0xa904,
+	0xa802, 0x8210, 0x2900, 0x81ff, 0x1dc8, 0x702e, 0x70c0, 0x9200,
+	0x70c2, 0x080c, 0x83fd, 0x00fe, 0x002e, 0x00ee, 0x0005, 0x2908,
+	0x7010, 0x8000, 0x7012, 0x7018, 0x904d, 0x711a, 0x0110, 0xa902,
+	0x0008, 0x711e, 0x2148, 0xa804, 0x900d, 0x1904, 0x6e0c, 0x782c,
+	0x9094, 0x0780, 0x190c, 0x6fdb, 0xd09c, 0x11b0, 0x701c, 0x904d,
+	0x0198, 0xa84c, 0x9005, 0x1180, 0x7010, 0x8001, 0x7012, 0x1108,
+	0x701a, 0xa800, 0x701e, 0x2900, 0x7822, 0x782c, 0x9094, 0x0780,
+	0x190c, 0x6fdb, 0xd09c, 0x0d50, 0x782c, 0x9094, 0x0780, 0x190c,
+	0x6fdb, 0xd0a4, 0x05a8, 0x00e6, 0x7824, 0x2048, 0x2071, 0x1800,
+	0x702c, 0xa802, 0x2900, 0x702e, 0x70c0, 0x8000, 0x70c2, 0x080c,
+	0x83fd, 0x782c, 0x9094, 0x0780, 0x190c, 0x6fdb, 0xd0a4, 0x1d60,
+	0x00ee, 0x0e04, 0x6e05, 0x7838, 0x7938, 0x910e, 0x1de0, 0x00d6,
+	0x2069, 0x0000, 0x6836, 0x6833, 0x0013, 0x00de, 0x7044, 0xc084,
+	0x7046, 0x2091, 0x4080, 0x2001, 0x0089, 0x2004, 0xd084, 0x190c,
+	0x119b, 0x00fe, 0x002e, 0x00ee, 0x0005, 0x7044, 0xc085, 0x7046,
+	0x00fe, 0x002e, 0x00ee, 0x0005, 0x00e6, 0x2071, 0x1800, 0x9016,
 	0x702c, 0x2148, 0xa904, 0xa802, 0x8210, 0x2900, 0x81ff, 0x1dc8,
-	0x702e, 0x70c0, 0x9200, 0x70c2, 0x080c, 0x8414, 0x00fe, 0x002e,
-	0x00ee, 0x0005, 0x2908, 0x7010, 0x8000, 0x7012, 0x7018, 0x904d,
-	0x711a, 0x0110, 0xa902, 0x0008, 0x711e, 0x2148, 0xa804, 0x900d,
-	0x1904, 0x6e13, 0x782c, 0x9094, 0x0780, 0x190c, 0x6fe2, 0xd09c,
-	0x11b0, 0x701c, 0x904d, 0x0198, 0xa84c, 0x9005, 0x1180, 0x7010,
-	0x8001, 0x7012, 0x1108, 0x701a, 0xa800, 0x701e, 0x2900, 0x7822,
-	0x782c, 0x9094, 0x0780, 0x190c, 0x6fe2, 0xd09c, 0x0d50, 0x782c,
-	0x9094, 0x0780, 0x190c, 0x6fe2, 0xd0a4, 0x05c8, 0x00e6, 0x7824,
-	0x2048, 0x2071, 0x1800, 0x702c, 0xa802, 0x2900, 0x702e, 0x70c0,
-	0x8000, 0x70c2, 0x080c, 0x8414, 0x782c, 0x9094, 0x0780, 0x190c,
-	0x6fe2, 0xd0a4, 0x1d60, 0x00ee, 0x0e04, 0x6e0c, 0x7838, 0x7938,
-	0x910e, 0x1de0, 0x00d6, 0x2069, 0x0000, 0x6836, 0x6833, 0x0013,
-	0x00de, 0x7044, 0xc084, 0x7046, 0x2091, 0x4080, 0x2001, 0x0089,
-	0x2004, 0xd084, 0x190c, 0x119b, 0x2009, 0x1947, 0x200b, 0x0000,
-	0x00fe, 0x002e, 0x00ee, 0x0005, 0x7044, 0xc085, 0x7046, 0x00fe,
-	0x002e, 0x00ee, 0x0005, 0x00e6, 0x2071, 0x1800, 0x9016, 0x702c,
-	0x2148, 0xa904, 0xa802, 0x8210, 0x2900, 0x81ff, 0x1dc8, 0x702e,
-	0x70c0, 0x9200, 0x70c2, 0x080c, 0x8414, 0x00ee, 0x0804, 0x6db2,
-	0x2071, 0x1910, 0xa803, 0x0000, 0x2908, 0x7010, 0x8000, 0x7012,
-	0x7018, 0x904d, 0x711a, 0x0110, 0xa902, 0x0008, 0x711e, 0x2148,
-	0xa804, 0x900d, 0x1128, 0x1e04, 0x6e53, 0x002e, 0x00ee, 0x0005,
-	0x2071, 0x1800, 0x9016, 0x702c, 0x2148, 0xa904, 0xa802, 0x8210,
-	0x2900, 0x81ff, 0x1dc8, 0x702e, 0x70c0, 0x9200, 0x70c2, 0x080c,
-	0x8414, 0x0e04, 0x6e3d, 0x2071, 0x1910, 0x701c, 0x2048, 0xa84c,
-	0x900d, 0x0d18, 0x2071, 0x0000, 0x7182, 0xa850, 0x7032, 0xa86c,
-	0x7086, 0x7036, 0xa870, 0x708a, 0xa850, 0x9082, 0x0019, 0x1278,
-	0x2091, 0x4080, 0x2001, 0x0089, 0x2004, 0xd084, 0x190c, 0x119b,
-	0x2071, 0x1910, 0x080c, 0x6fce, 0x002e, 0x00ee, 0x0005, 0xa850,
-	0x9082, 0x001c, 0x1e68, 0xa880, 0x708e, 0x7036, 0x0146, 0x01d6,
-	0x0136, 0x01c6, 0x0156, 0x20e9, 0x0000, 0x20a1, 0x002a, 0xa868,
-	0x20a8, 0xa860, 0x20e0, 0xa85c, 0x9080, 0x0021, 0x2098, 0x4003,
-	0x015e, 0x01ce, 0x013e, 0x01de, 0x014e, 0x0890, 0x2071, 0x1910,
-	0xa803, 0x0000, 0x2908, 0x7010, 0x8000, 0x7012, 0x7018, 0x904d,
-	0x711a, 0x0110, 0xa902, 0x0008, 0x711e, 0x2148, 0xa804, 0x900d,
-	0x1118, 0x002e, 0x00ee, 0x0005, 0x2071, 0x1800, 0x9016, 0x702c,
-	0x2148, 0xa904, 0xa802, 0x8210, 0x2900, 0x81ff, 0x1dc8, 0x702e,
-	0x70c0, 0x9200, 0x70c2, 0x080c, 0x8414, 0x002e, 0x00ee, 0x0005,
-	0x0006, 0xa87c, 0x0006, 0xa867, 0x0103, 0x20a9, 0x001c, 0xa860,
-	0x20e8, 0xa85c, 0x9080, 0x001d, 0x20a0, 0x9006, 0x4004, 0x000e,
-	0x9084, 0x00ff, 0xa87e, 0x000e, 0xa87a, 0xa982, 0x0005, 0x2071,
-	0x1910, 0x7004, 0x0002, 0x6ee1, 0x6ee2, 0x6fcd, 0x6ee2, 0x0dd5,
-	0x6fcd, 0x0005, 0x2001, 0x1948, 0x2004, 0x0002, 0x6eec, 0x6eec,
-	0x6f66, 0x6f67, 0x6eec, 0x6f67, 0x0126, 0x2091, 0x8000, 0x1e0c,
-	0x6fed, 0x701c, 0x904d, 0x0508, 0xa84c, 0x9005, 0x0904, 0x6f37,
-	0x0e04, 0x6f15, 0xa94c, 0x2071, 0x0000, 0x7182, 0xa850, 0x7032,
+	0x702e, 0x70c0, 0x9200, 0x70c2, 0x080c, 0x83fd, 0x00ee, 0x0804,
+	0x6daf, 0x2071, 0x1910, 0xa803, 0x0000, 0x2908, 0x7010, 0x8000,
+	0x7012, 0x7018, 0x904d, 0x711a, 0x0110, 0xa902, 0x0008, 0x711e,
+	0x2148, 0xa804, 0x900d, 0x1128, 0x1e04, 0x6e4c, 0x002e, 0x00ee,
+	0x0005, 0x2071, 0x1800, 0x9016, 0x702c, 0x2148, 0xa904, 0xa802,
+	0x8210, 0x2900, 0x81ff, 0x1dc8, 0x702e, 0x70c0, 0x9200, 0x70c2,
+	0x080c, 0x83fd, 0x0e04, 0x6e36, 0x2071, 0x1910, 0x701c, 0x2048,
+	0xa84c, 0x900d, 0x0d18, 0x2071, 0x0000, 0x7182, 0xa850, 0x7032,
 	0xa86c, 0x7086, 0x7036, 0xa870, 0x708a, 0xa850, 0x9082, 0x0019,
 	0x1278, 0x2091, 0x4080, 0x2001, 0x0089, 0x2004, 0xd084, 0x190c,
-	0x119b, 0x2071, 0x1910, 0x080c, 0x6fce, 0x012e, 0x0804, 0x6f65,
+	0x119b, 0x2071, 0x1910, 0x080c, 0x6fc7, 0x002e, 0x00ee, 0x0005,
 	0xa850, 0x9082, 0x001c, 0x1e68, 0xa880, 0x708e, 0x7036, 0x0146,
 	0x01d6, 0x0136, 0x01c6, 0x0156, 0x20e9, 0x0000, 0x20a1, 0x002a,
 	0xa868, 0x20a8, 0xa860, 0x20e0, 0xa85c, 0x9080, 0x0021, 0x2098,
-	0x4003, 0x015e, 0x01ce, 0x013e, 0x01de, 0x014e, 0x0890, 0x2001,
-	0x005b, 0x2004, 0x9094, 0x0780, 0x190c, 0x6fe2, 0xd09c, 0x2071,
-	0x1910, 0x1510, 0x2071, 0x1910, 0x700f, 0x0001, 0xa964, 0x9184,
-	0x00ff, 0x9086, 0x0003, 0x1130, 0x810f, 0x918c, 0x00ff, 0x8101,
-	0x0108, 0x710e, 0x2900, 0x00d6, 0x2069, 0x0050, 0x6822, 0x00de,
-	0x2071, 0x1910, 0x701c, 0x2048, 0x7010, 0x8001, 0x7012, 0xa800,
-	0x701e, 0x9005, 0x1108, 0x701a, 0x012e, 0x0005, 0x0005, 0x00d6,
-	0x2008, 0x2069, 0x19fa, 0x683c, 0x9005, 0x0760, 0x0158, 0x9186,
-	0x0003, 0x0540, 0x2001, 0x1815, 0x2004, 0x2009, 0x1ac8, 0x210c,
-	0x9102, 0x1500, 0x0126, 0x2091, 0x8000, 0x2069, 0x0050, 0x693c,
-	0x6838, 0x9106, 0x0190, 0x0e04, 0x6f99, 0x2069, 0x0000, 0x6837,
-	0x8040, 0x6833, 0x0012, 0x6883, 0x8040, 0x2091, 0x4080, 0x2001,
-	0x0089, 0x2004, 0xd084, 0x190c, 0x119b, 0x2069, 0x19fa, 0x683f,
-	0xffff, 0x012e, 0x00de, 0x0126, 0x2091, 0x8000, 0x1e0c, 0x705e,
-	0x701c, 0x904d, 0x0540, 0x2001, 0x005b, 0x2004, 0x9094, 0x0780,
-	0x15c9, 0xd09c, 0x1500, 0x2071, 0x1910, 0x700f, 0x0001, 0xa964,
+	0x4003, 0x015e, 0x01ce, 0x013e, 0x01de, 0x014e, 0x0890, 0x2071,
+	0x1910, 0xa803, 0x0000, 0x2908, 0x7010, 0x8000, 0x7012, 0x7018,
+	0x904d, 0x711a, 0x0110, 0xa902, 0x0008, 0x711e, 0x2148, 0xa804,
+	0x900d, 0x1118, 0x002e, 0x00ee, 0x0005, 0x2071, 0x1800, 0x9016,
+	0x702c, 0x2148, 0xa904, 0xa802, 0x8210, 0x2900, 0x81ff, 0x1dc8,
+	0x702e, 0x70c0, 0x9200, 0x70c2, 0x080c, 0x83fd, 0x002e, 0x00ee,
+	0x0005, 0x0006, 0xa87c, 0x0006, 0xa867, 0x0103, 0x20a9, 0x001c,
+	0xa860, 0x20e8, 0xa85c, 0x9080, 0x001d, 0x20a0, 0x9006, 0x4004,
+	0x000e, 0x9084, 0x00ff, 0xa87e, 0x000e, 0xa87a, 0xa982, 0x0005,
+	0x2071, 0x1910, 0x7004, 0x0002, 0x6eda, 0x6edb, 0x6fc6, 0x6edb,
+	0x0dd5, 0x6fc6, 0x0005, 0x2001, 0x1947, 0x2004, 0x0002, 0x6ee5,
+	0x6ee5, 0x6f5f, 0x6f60, 0x6ee5, 0x6f60, 0x0126, 0x2091, 0x8000,
+	0x1e0c, 0x6fe6, 0x701c, 0x904d, 0x0508, 0xa84c, 0x9005, 0x0904,
+	0x6f30, 0x0e04, 0x6f0e, 0xa94c, 0x2071, 0x0000, 0x7182, 0xa850,
+	0x7032, 0xa86c, 0x7086, 0x7036, 0xa870, 0x708a, 0xa850, 0x9082,
+	0x0019, 0x1278, 0x2091, 0x4080, 0x2001, 0x0089, 0x2004, 0xd084,
+	0x190c, 0x119b, 0x2071, 0x1910, 0x080c, 0x6fc7, 0x012e, 0x0804,
+	0x6f5e, 0xa850, 0x9082, 0x001c, 0x1e68, 0xa880, 0x708e, 0x7036,
+	0x0146, 0x01d6, 0x0136, 0x01c6, 0x0156, 0x20e9, 0x0000, 0x20a1,
+	0x002a, 0xa868, 0x20a8, 0xa860, 0x20e0, 0xa85c, 0x9080, 0x0021,
+	0x2098, 0x4003, 0x015e, 0x01ce, 0x013e, 0x01de, 0x014e, 0x0890,
+	0x2001, 0x005b, 0x2004, 0x9094, 0x0780, 0x190c, 0x6fdb, 0xd09c,
+	0x2071, 0x1910, 0x1510, 0x2071, 0x1910, 0x700f, 0x0001, 0xa964,
 	0x9184, 0x00ff, 0x9086, 0x0003, 0x1130, 0x810f, 0x918c, 0x00ff,
 	0x8101, 0x0108, 0x710e, 0x2900, 0x00d6, 0x2069, 0x0050, 0x6822,
-	0x00de, 0x701c, 0x2048, 0x7010, 0x8001, 0x7012, 0xa800, 0x701e,
-	0x9005, 0x1108, 0x701a, 0x012e, 0x0005, 0x0005, 0x0126, 0x2091,
-	0x8000, 0x701c, 0x904d, 0x0160, 0x7010, 0x8001, 0x7012, 0xa800,
-	0x701e, 0x9005, 0x1108, 0x701a, 0x012e, 0x080c, 0x1031, 0x0005,
-	0x012e, 0x0005, 0x2091, 0x8000, 0x0e04, 0x6fe4, 0x0006, 0x0016,
-	0x2001, 0x8004, 0x0006, 0x0804, 0x0dde, 0x0096, 0x00f6, 0x2079,
-	0x0050, 0x7044, 0xd084, 0x01e0, 0xc084, 0x7046, 0x7838, 0x7938,
-	0x910e, 0x1de0, 0x00d6, 0x2069, 0x0000, 0x6836, 0x6833, 0x0013,
-	0x00de, 0x2091, 0x4080, 0x2001, 0x0089, 0x2004, 0xd084, 0x190c,
-	0x119b, 0x2009, 0x1947, 0x200b, 0x0000, 0x00fe, 0x009e, 0x0005,
-	0x782c, 0x9094, 0x0780, 0x1971, 0xd0a4, 0x0db8, 0x2009, 0x1947,
-	0x2104, 0x8000, 0x200a, 0x9082, 0x000f, 0x0e78, 0x00e6, 0x2071,
-	0x1800, 0x7824, 0x00e6, 0x2071, 0x0040, 0x712c, 0xd19c, 0x1148,
-	0x2009, 0x1830, 0x210c, 0x918a, 0x0020, 0x0218, 0x7022, 0x00ee,
-	0x0058, 0x00ee, 0x2048, 0x702c, 0xa802, 0x2900, 0x702e, 0x70c0,
-	0x8000, 0x70c2, 0x080c, 0x8414, 0x782c, 0x9094, 0x0780, 0x190c,
-	0x6fe2, 0xd0a4, 0x19f0, 0x7838, 0x7938, 0x910e, 0x1de0, 0x00d6,
-	0x2069, 0x0000, 0x6836, 0x6833, 0x0013, 0x00de, 0x2091, 0x4080,
-	0x2001, 0x0089, 0x2004, 0xd084, 0x190c, 0x119b, 0x2009, 0x1947,
-	0x200b, 0x0000, 0x00ee, 0x00fe, 0x009e, 0x0005, 0x00f6, 0x2079,
-	0x0050, 0x7044, 0xd084, 0x01b8, 0xc084, 0x7046, 0x7838, 0x7938,
-	0x910e, 0x1de0, 0x00d6, 0x2069, 0x0000, 0x6836, 0x6833, 0x0013,
-	0x00de, 0x2091, 0x4080, 0x2001, 0x0089, 0x2004, 0xd084, 0x190c,
-	0x119b, 0x00fe, 0x0005, 0x782c, 0x9094, 0x0780, 0x190c, 0x6fe2,
-	0xd0a4, 0x0db8, 0x00e6, 0x2071, 0x1800, 0x7824, 0x2048, 0x702c,
-	0xa802, 0x2900, 0x702e, 0x70c0, 0x8000, 0x70c2, 0x080c, 0x8414,
-	0x782c, 0x9094, 0x0780, 0x190c, 0x6fe2, 0xd0a4, 0x1d70, 0x00d6,
-	0x2069, 0x0050, 0x693c, 0x2069, 0x1948, 0x6808, 0x690a, 0x2069,
-	0x19fa, 0x9102, 0x1118, 0x683c, 0x9005, 0x1328, 0x2001, 0x1949,
-	0x200c, 0x810d, 0x693e, 0x00de, 0x00ee, 0x00fe, 0x0005, 0x7098,
-	0x908a, 0x0029, 0x1a0c, 0x0dd5, 0x9082, 0x001d, 0x001b, 0x6027,
-	0x1e00, 0x0005, 0x7186, 0x710c, 0x7128, 0x7152, 0x7175, 0x71b5,
-	0x71c7, 0x7128, 0x719d, 0x70c7, 0x70f5, 0x70c6, 0x0005, 0x00d6,
-	0x2069, 0x0200, 0x6804, 0x9005, 0x1180, 0x6808, 0x9005, 0x1518,
-	0x709b, 0x0028, 0x2069, 0x198f, 0x2d04, 0x7002, 0x080c, 0x74f6,
-	0x6028, 0x9085, 0x0600, 0x602a, 0x00b0, 0x709b, 0x0028, 0x2069,
-	0x198f, 0x2d04, 0x7002, 0x6028, 0x9085, 0x0600, 0x602a, 0x00e6,
-	0x0036, 0x0046, 0x0056, 0x2071, 0x1a62, 0x080c, 0x1aa9, 0x005e,
-	0x004e, 0x003e, 0x00ee, 0x00de, 0x0005, 0x00d6, 0x2069, 0x0200,
-	0x6804, 0x9005, 0x1178, 0x6808, 0x9005, 0x1160, 0x709b, 0x0028,
-	0x2069, 0x198f, 0x2d04, 0x7002, 0x080c, 0x7591, 0x6028, 0x9085,
-	0x0600, 0x602a, 0x00de, 0x0005, 0x0006, 0x2001, 0x0090, 0x080c,
-	0x2cef, 0x000e, 0x6124, 0xd1e4, 0x1190, 0x080c, 0x7234, 0xd1d4,
-	0x1160, 0xd1dc, 0x1138, 0xd1cc, 0x0150, 0x709b, 0x0020, 0x080c,
-	0x7234, 0x0028, 0x709b, 0x001d, 0x0010, 0x709b, 0x001f, 0x0005,
-	0x2001, 0x0088, 0x080c, 0x2cef, 0x6124, 0xd1cc, 0x11e8, 0xd1dc,
-	0x11c0, 0xd1e4, 0x1198, 0x9184, 0x1e00, 0x11d8, 0x080c, 0x1ad3,
-	0x60e3, 0x0001, 0x600c, 0xc0b4, 0x600e, 0x080c, 0x73e8, 0x2001,
-	0x0080, 0x080c, 0x2cef, 0x709b, 0x0028, 0x0058, 0x709b, 0x001e,
-	0x0040, 0x709b, 0x001d, 0x0028, 0x709b, 0x0020, 0x0010, 0x709b,
-	0x001f, 0x0005, 0x080c, 0x1ad3, 0x60e3, 0x0001, 0x600c, 0xc0b4,
-	0x600e, 0x080c, 0x73e8, 0x2001, 0x0080, 0x080c, 0x2cef, 0x6124,
-	0xd1d4, 0x1180, 0xd1dc, 0x1158, 0xd1e4, 0x1130, 0x9184, 0x1e00,
-	0x1158, 0x709b, 0x0028, 0x0040, 0x709b, 0x001e, 0x0028, 0x709b,
-	0x001d, 0x0010, 0x709b, 0x001f, 0x0005, 0x2001, 0x00a0, 0x080c,
-	0x2cef, 0x6124, 0xd1dc, 0x1138, 0xd1e4, 0x0138, 0x080c, 0x1ad3,
-	0x709b, 0x001e, 0x0010, 0x709b, 0x001d, 0x0005, 0x080c, 0x72b7,
-	0x6124, 0xd1dc, 0x1188, 0x080c, 0x7234, 0x0016, 0x080c, 0x1ad3,
-	0x001e, 0xd1d4, 0x1128, 0xd1e4, 0x0138, 0x709b, 0x001e, 0x0020,
-	0x709b, 0x001f, 0x080c, 0x7234, 0x0005, 0x0006, 0x2001, 0x00a0,
-	0x080c, 0x2cef, 0x000e, 0x6124, 0xd1d4, 0x1160, 0xd1cc, 0x1150,
-	0xd1dc, 0x1128, 0xd1e4, 0x0140, 0x709b, 0x001e, 0x0028, 0x709b,
-	0x001d, 0x0010, 0x709b, 0x0021, 0x0005, 0x080c, 0x72b7, 0x6124,
-	0xd1d4, 0x1150, 0xd1dc, 0x1128, 0xd1e4, 0x0140, 0x709b, 0x001e,
-	0x0028, 0x709b, 0x001d, 0x0010, 0x709b, 0x001f, 0x0005, 0x0006,
-	0x2001, 0x0090, 0x080c, 0x2cef, 0x000e, 0x6124, 0xd1d4, 0x1178,
-	0xd1cc, 0x1150, 0xd1dc, 0x1128, 0xd1e4, 0x0158, 0x709b, 0x001e,
-	0x0040, 0x709b, 0x001d, 0x0028, 0x709b, 0x0020, 0x0010, 0x709b,
-	0x001f, 0x0005, 0x0016, 0x00c6, 0x00d6, 0x00e6, 0x0126, 0x2061,
-	0x0100, 0x2069, 0x0140, 0x2071, 0x1800, 0x2091, 0x8000, 0x080c,
-	0x73bc, 0x11d8, 0x2001, 0x180c, 0x200c, 0xd1b4, 0x01b0, 0xc1b4,
-	0x2102, 0x6027, 0x0200, 0x080c, 0x2c38, 0x6024, 0xd0cc, 0x0148,
-	0x2001, 0x00a0, 0x080c, 0x2cef, 0x080c, 0x76a4, 0x080c, 0x601a,
-	0x0428, 0x6028, 0xc0cd, 0x602a, 0x0408, 0x080c, 0x73d6, 0x0150,
-	0x080c, 0x73cd, 0x1138, 0x2001, 0x0001, 0x080c, 0x27ea, 0x080c,
-	0x7394, 0x00a0, 0x080c, 0x72b4, 0x0178, 0x2001, 0x0001, 0x080c,
-	0x27ea, 0x7098, 0x9086, 0x001e, 0x0120, 0x7098, 0x9086, 0x0022,
-	0x1118, 0x709b, 0x0025, 0x0010, 0x709b, 0x0021, 0x012e, 0x00ee,
-	0x00de, 0x00ce, 0x001e, 0x0005, 0x0026, 0x2011, 0x7245, 0x080c,
-	0x85cd, 0x002e, 0x0016, 0x0026, 0x2009, 0x0064, 0x2011, 0x7245,
-	0x080c, 0x85c4, 0x002e, 0x001e, 0x0005, 0x00e6, 0x00f6, 0x0016,
-	0x080c, 0xa273, 0x2071, 0x1800, 0x080c, 0x71e2, 0x001e, 0x00fe,
-	0x00ee, 0x0005, 0x0016, 0x0026, 0x0036, 0x00c6, 0x00d6, 0x00e6,
-	0x00f6, 0x0126, 0x080c, 0xa273, 0x2061, 0x0100, 0x2069, 0x0140,
-	0x2071, 0x1800, 0x2091, 0x8000, 0x6028, 0xc09c, 0x602a, 0x2011,
-	0x0003, 0x080c, 0xa653, 0x2011, 0x0002, 0x080c, 0xa65d, 0x080c,
-	0xa540, 0x080c, 0x8579, 0x0036, 0x901e, 0x080c, 0xa5b6, 0x003e,
-	0x60e3, 0x0000, 0x080c, 0xe9e9, 0x080c, 0xea04, 0x2009, 0x0004,
-	0x080c, 0x2c3e, 0x080c, 0x2b59, 0x2001, 0x1800, 0x2003, 0x0004,
-	0x6027, 0x0008, 0x2011, 0x7245, 0x080c, 0x85cd, 0x080c, 0x73d6,
-	0x0118, 0x9006, 0x080c, 0x2cef, 0x080c, 0x0bae, 0x2001, 0x0001,
-	0x080c, 0x27ea, 0x012e, 0x00fe, 0x00ee, 0x00de, 0x00ce, 0x003e,
-	0x002e, 0x001e, 0x0005, 0x0026, 0x00e6, 0x2011, 0x7252, 0x2071,
-	0x19fa, 0x701c, 0x9206, 0x1118, 0x7018, 0x9005, 0x0110, 0x9085,
-	0x0001, 0x00ee, 0x002e, 0x0005, 0x6020, 0xd09c, 0x0005, 0x6800,
-	0x9084, 0xfffe, 0x9086, 0x00c0, 0x0170, 0x2001, 0x00c0, 0x080c,
-	0x2cef, 0x0156, 0x20a9, 0x002d, 0x1d04, 0x72c4, 0x2091, 0x6000,
-	0x1f04, 0x72c4, 0x015e, 0x0005, 0x00c6, 0x00d6, 0x00e6, 0x2061,
-	0x0100, 0x2069, 0x0140, 0x2071, 0x1800, 0x080c, 0x76b3, 0x2001,
-	0x196d, 0x2003, 0x0000, 0x9006, 0x709a, 0x60e2, 0x6886, 0x080c,
-	0x28b2, 0x9006, 0x080c, 0x2cef, 0x080c, 0x5ed9, 0x6027, 0xffff,
-	0x602b, 0x182f, 0x00ee, 0x00de, 0x00ce, 0x0005, 0x00c6, 0x00d6,
-	0x00e6, 0x2061, 0x0100, 0x2069, 0x0140, 0x2071, 0x1800, 0x2001,
-	0x197d, 0x200c, 0x9186, 0x0000, 0x0158, 0x9186, 0x0001, 0x0158,
-	0x9186, 0x0002, 0x0158, 0x9186, 0x0003, 0x0158, 0x0804, 0x7384,
-	0x709b, 0x0022, 0x0040, 0x709b, 0x0021, 0x0028, 0x709b, 0x0023,
-	0x0010, 0x709b, 0x0024, 0x60e3, 0x0000, 0x6887, 0x0001, 0x2001,
-	0x0001, 0x080c, 0x28b2, 0x0026, 0x080c, 0xadd2, 0x002e, 0x7000,
-	0x908e, 0x0004, 0x0118, 0x602b, 0x0028, 0x0010, 0x602b, 0x0020,
-	0x0156, 0x0126, 0x2091, 0x8000, 0x20a9, 0x0005, 0x6024, 0xd0ac,
-	0x0150, 0x012e, 0x015e, 0x080c, 0xd230, 0x0118, 0x9006, 0x080c,
-	0x2d19, 0x0804, 0x7390, 0x6800, 0x9084, 0x00a1, 0xc0bd, 0x6802,
-	0x080c, 0x2c38, 0x6904, 0xd1d4, 0x1140, 0x2001, 0x0100, 0x080c,
-	0x2cef, 0x1f04, 0x732e, 0x080c, 0x7413, 0x012e, 0x015e, 0x080c,
-	0x73cd, 0x01a8, 0x6044, 0x9005, 0x0168, 0x6050, 0x0006, 0x9085,
-	0x0020, 0x6052, 0x080c, 0x7413, 0x9006, 0x8001, 0x1df0, 0x000e,
-	0x6052, 0x0028, 0x6804, 0xd0d4, 0x1110, 0x080c, 0x7413, 0x080c,
-	0xd230, 0x0118, 0x9006, 0x080c, 0x2d19, 0x0016, 0x0026, 0x7000,
-	0x908e, 0x0004, 0x0130, 0x2009, 0x00c8, 0x2011, 0x7252, 0x080c,
-	0x858b, 0x002e, 0x001e, 0x080c, 0x840b, 0x7034, 0xc085, 0x7036,
-	0x2001, 0x197d, 0x2003, 0x0004, 0x080c, 0x70af, 0x080c, 0x73cd,
-	0x0138, 0x6804, 0xd0d4, 0x1120, 0xd0dc, 0x1100, 0x080c, 0x76a9,
-	0x00ee, 0x00de, 0x00ce, 0x0005, 0x00c6, 0x00d6, 0x00e6, 0x2061,
-	0x0100, 0x2069, 0x0140, 0x2071, 0x1800, 0x080c, 0x8422, 0x080c,
-	0x8414, 0x080c, 0x76b3, 0x2001, 0x196d, 0x2003, 0x0000, 0x9006,
-	0x709a, 0x60e2, 0x6886, 0x080c, 0x28b2, 0x9006, 0x080c, 0x2cef,
-	0x6043, 0x0090, 0x6043, 0x0010, 0x6027, 0xffff, 0x602b, 0x182f,
-	0x00ee, 0x00de, 0x00ce, 0x0005, 0x0006, 0x2001, 0x197c, 0x2004,
-	0x9086, 0xaaaa, 0x000e, 0x0005, 0x0006, 0x080c, 0x56d3, 0x9084,
-	0x0030, 0x9086, 0x0000, 0x000e, 0x0005, 0x0006, 0x080c, 0x56d3,
-	0x9084, 0x0030, 0x9086, 0x0030, 0x000e, 0x0005, 0x0006, 0x080c,
-	0x56d3, 0x9084, 0x0030, 0x9086, 0x0010, 0x000e, 0x0005, 0x0006,
-	0x080c, 0x56d3, 0x9084, 0x0030, 0x9086, 0x0020, 0x000e, 0x0005,
-	0x0036, 0x0016, 0x2001, 0x180c, 0x2004, 0x908c, 0x0013, 0x0180,
-	0x0020, 0x080c, 0x28d2, 0x900e, 0x0028, 0x080c, 0x696a, 0x1dc8,
-	0x2009, 0x0002, 0x2019, 0x0028, 0x080c, 0x318a, 0x9006, 0x0019,
-	0x001e, 0x003e, 0x0005, 0x00e6, 0x2071, 0x180c, 0x2e04, 0x0130,
-	0x080c, 0xd229, 0x1128, 0x9085, 0x0010, 0x0010, 0x9084, 0xffef,
-	0x2072, 0x00ee, 0x0005, 0x6050, 0x0006, 0x60ec, 0x0006, 0x600c,
-	0x0006, 0x6004, 0x0006, 0x6028, 0x0006, 0x0016, 0x6138, 0x6050,
-	0x9084, 0xfbff, 0x9085, 0x2000, 0x6052, 0x613a, 0x20a9, 0x0012,
-	0x1d04, 0x7428, 0x2091, 0x6000, 0x1f04, 0x7428, 0x602f, 0x0100,
-	0x602f, 0x0000, 0x6050, 0x9085, 0x0400, 0x9084, 0xdfff, 0x6052,
-	0x613a, 0x001e, 0x602f, 0x0040, 0x602f, 0x0000, 0x000e, 0x602a,
-	0x000e, 0x6006, 0x000e, 0x600e, 0x000e, 0x60ee, 0x60e3, 0x0000,
-	0x6887, 0x0001, 0x2001, 0x0001, 0x080c, 0x28b2, 0x2001, 0x00a0,
-	0x0006, 0x080c, 0xd230, 0x000e, 0x0130, 0x080c, 0x2d0d, 0x9006,
-	0x080c, 0x2d19, 0x0010, 0x080c, 0x2cef, 0x000e, 0x6052, 0x6050,
-	0x0006, 0xc0e5, 0x6052, 0x00f6, 0x2079, 0x0100, 0x080c, 0x2bad,
-	0x00fe, 0x000e, 0x6052, 0x0005, 0x0156, 0x0016, 0x0026, 0x0036,
-	0x00c6, 0x00d6, 0x00e6, 0x2061, 0x0100, 0x2069, 0x0140, 0x2071,
-	0x1800, 0x6020, 0x9084, 0x0080, 0x0138, 0x2001, 0x180c, 0x200c,
-	0xc1c5, 0x2102, 0x0804, 0x74e8, 0x2001, 0x180c, 0x200c, 0xc1c4,
-	0x2102, 0x6028, 0x9084, 0xe1ff, 0x602a, 0x6027, 0x0200, 0x2001,
-	0x0090, 0x080c, 0x2cef, 0x20a9, 0x0366, 0x6024, 0xd0cc, 0x1518,
-	0x1d04, 0x7495, 0x2091, 0x6000, 0x1f04, 0x7495, 0x2011, 0x0003,
-	0x080c, 0xa653, 0x2011, 0x0002, 0x080c, 0xa65d, 0x080c, 0xa540,
-	0x901e, 0x080c, 0xa5b6, 0x2001, 0x00a0, 0x080c, 0x2cef, 0x080c,
-	0x76a4, 0x080c, 0x601a, 0x080c, 0xd230, 0x0110, 0x080c, 0x0d45,
-	0x9085, 0x0001, 0x0498, 0x86ff, 0x1110, 0x080c, 0x1ad3, 0x60e3,
-	0x0000, 0x2001, 0x196d, 0x2004, 0x080c, 0x28b2, 0x60e2, 0x2001,
-	0x0080, 0x080c, 0x2cef, 0x20a9, 0x0366, 0x6027, 0x1e00, 0x2009,
-	0x1e00, 0x080c, 0x2c38, 0x6024, 0x910c, 0x0138, 0x1d04, 0x74cd,
-	0x2091, 0x6000, 0x1f04, 0x74cd, 0x0808, 0x6028, 0x9085, 0x1e00,
-	0x602a, 0x70b4, 0x9005, 0x1118, 0x6887, 0x0001, 0x0008, 0x6886,
-	0x080c, 0xd230, 0x0110, 0x080c, 0x0d45, 0x9006, 0x00ee, 0x00de,
-	0x00ce, 0x003e, 0x002e, 0x001e, 0x015e, 0x0005, 0x0156, 0x0016,
-	0x0026, 0x0036, 0x00c6, 0x00d6, 0x00e6, 0x2061, 0x0100, 0x2071,
-	0x1800, 0x7000, 0x9086, 0x0003, 0x1168, 0x2001, 0x020b, 0x2004,
-	0x9084, 0x5540, 0x9086, 0x5540, 0x1128, 0x2069, 0x1a79, 0x2d04,
-	0x8000, 0x206a, 0x2069, 0x0140, 0x6020, 0x9084, 0x00c0, 0x0120,
-	0x6884, 0x9005, 0x1904, 0x755b, 0x2001, 0x0088, 0x080c, 0x2cef,
-	0x9006, 0x60e2, 0x6886, 0x080c, 0x28b2, 0x2069, 0x0200, 0x6804,
-	0x9005, 0x1118, 0x6808, 0x9005, 0x01c0, 0x6028, 0x9084, 0xfbff,
-	0x602a, 0x6027, 0x0400, 0x2069, 0x198f, 0x7000, 0x206a, 0x709b,
-	0x0026, 0x7003, 0x0001, 0x20a9, 0x0002, 0x1d04, 0x753d, 0x2091,
-	0x6000, 0x1f04, 0x753d, 0x0804, 0x7589, 0x2069, 0x0140, 0x20a9,
-	0x0384, 0x6027, 0x1e00, 0x2009, 0x1e00, 0x080c, 0x2c38, 0x6024,
-	0x910c, 0x0508, 0x9084, 0x1a00, 0x11f0, 0x1d04, 0x7549, 0x2091,
-	0x6000, 0x1f04, 0x7549, 0x2011, 0x0003, 0x080c, 0xa653, 0x2011,
-	0x0002, 0x080c, 0xa65d, 0x080c, 0xa540, 0x901e, 0x080c, 0xa5b6,
-	0x2001, 0x00a0, 0x080c, 0x2cef, 0x080c, 0x76a4, 0x080c, 0x601a,
-	0x9085, 0x0001, 0x00b0, 0x2001, 0x0080, 0x080c, 0x2cef, 0x2069,
+	0x00de, 0x2071, 0x1910, 0x701c, 0x2048, 0x7010, 0x8001, 0x7012,
+	0xa800, 0x701e, 0x9005, 0x1108, 0x701a, 0x012e, 0x0005, 0x0005,
+	0x00d6, 0x2008, 0x2069, 0x19f9, 0x683c, 0x9005, 0x0760, 0x0158,
+	0x9186, 0x0003, 0x0540, 0x2001, 0x1815, 0x2004, 0x2009, 0x1ac7,
+	0x210c, 0x9102, 0x1500, 0x0126, 0x2091, 0x8000, 0x2069, 0x0050,
+	0x693c, 0x6838, 0x9106, 0x0190, 0x0e04, 0x6f92, 0x2069, 0x0000,
+	0x6837, 0x8040, 0x6833, 0x0012, 0x6883, 0x8040, 0x2091, 0x4080,
+	0x2001, 0x0089, 0x2004, 0xd084, 0x190c, 0x119b, 0x2069, 0x19f9,
+	0x683f, 0xffff, 0x012e, 0x00de, 0x0126, 0x2091, 0x8000, 0x1e0c,
+	0x7047, 0x701c, 0x904d, 0x0540, 0x2001, 0x005b, 0x2004, 0x9094,
+	0x0780, 0x15c9, 0xd09c, 0x1500, 0x2071, 0x1910, 0x700f, 0x0001,
+	0xa964, 0x9184, 0x00ff, 0x9086, 0x0003, 0x1130, 0x810f, 0x918c,
+	0x00ff, 0x8101, 0x0108, 0x710e, 0x2900, 0x00d6, 0x2069, 0x0050,
+	0x6822, 0x00de, 0x701c, 0x2048, 0x7010, 0x8001, 0x7012, 0xa800,
+	0x701e, 0x9005, 0x1108, 0x701a, 0x012e, 0x0005, 0x0005, 0x0126,
+	0x2091, 0x8000, 0x701c, 0x904d, 0x0160, 0x7010, 0x8001, 0x7012,
+	0xa800, 0x701e, 0x9005, 0x1108, 0x701a, 0x012e, 0x080c, 0x1031,
+	0x0005, 0x012e, 0x0005, 0x2091, 0x8000, 0x0e04, 0x6fdd, 0x0006,
+	0x0016, 0x2001, 0x8004, 0x0006, 0x0804, 0x0dde, 0x0096, 0x00f6,
+	0x2079, 0x0050, 0x7044, 0xd084, 0x01c0, 0xc084, 0x7046, 0x7838,
+	0x7938, 0x910e, 0x1de0, 0x00d6, 0x2069, 0x0000, 0x6836, 0x6833,
+	0x0013, 0x00de, 0x2091, 0x4080, 0x2001, 0x0089, 0x2004, 0xd084,
+	0x190c, 0x119b, 0x00fe, 0x009e, 0x0005, 0x782c, 0x9094, 0x0780,
+	0x1991, 0xd0a4, 0x0db8, 0x00e6, 0x2071, 0x1800, 0x7824, 0x00e6,
+	0x2071, 0x0040, 0x712c, 0xd19c, 0x1148, 0x2009, 0x1830, 0x210c,
+	0x918a, 0x0020, 0x0218, 0x7022, 0x00ee, 0x0058, 0x00ee, 0x2048,
+	0x702c, 0xa802, 0x2900, 0x702e, 0x70c0, 0x8000, 0x70c2, 0x080c,
+	0x83fd, 0x782c, 0x9094, 0x0780, 0x190c, 0x6fdb, 0xd0a4, 0x19f0,
+	0x7838, 0x7938, 0x910e, 0x1de0, 0x00d6, 0x2069, 0x0000, 0x6836,
+	0x6833, 0x0013, 0x00de, 0x2091, 0x4080, 0x2001, 0x0089, 0x2004,
+	0xd084, 0x190c, 0x119b, 0x00ee, 0x00fe, 0x009e, 0x0005, 0x00f6,
+	0x2079, 0x0050, 0x7044, 0xd084, 0x01b8, 0xc084, 0x7046, 0x7838,
+	0x7938, 0x910e, 0x1de0, 0x00d6, 0x2069, 0x0000, 0x6836, 0x6833,
+	0x0013, 0x00de, 0x2091, 0x4080, 0x2001, 0x0089, 0x2004, 0xd084,
+	0x190c, 0x119b, 0x00fe, 0x0005, 0x782c, 0x9094, 0x0780, 0x190c,
+	0x6fdb, 0xd0a4, 0x0db8, 0x00e6, 0x2071, 0x1800, 0x7824, 0x2048,
+	0x702c, 0xa802, 0x2900, 0x702e, 0x70c0, 0x8000, 0x70c2, 0x080c,
+	0x83fd, 0x782c, 0x9094, 0x0780, 0x190c, 0x6fdb, 0xd0a4, 0x1d70,
+	0x00d6, 0x2069, 0x0050, 0x693c, 0x2069, 0x1947, 0x6808, 0x690a,
+	0x2069, 0x19f9, 0x9102, 0x1118, 0x683c, 0x9005, 0x1328, 0x2001,
+	0x1948, 0x200c, 0x810d, 0x693e, 0x00de, 0x00ee, 0x00fe, 0x0005,
+	0x7098, 0x908a, 0x0029, 0x1a0c, 0x0dd5, 0x9082, 0x001d, 0x001b,
+	0x6027, 0x1e00, 0x0005, 0x716f, 0x70f5, 0x7111, 0x713b, 0x715e,
+	0x719e, 0x71b0, 0x7111, 0x7186, 0x70b0, 0x70de, 0x70af, 0x0005,
+	0x00d6, 0x2069, 0x0200, 0x6804, 0x9005, 0x1180, 0x6808, 0x9005,
+	0x1518, 0x709b, 0x0028, 0x2069, 0x198e, 0x2d04, 0x7002, 0x080c,
+	0x74df, 0x6028, 0x9085, 0x0600, 0x602a, 0x00b0, 0x709b, 0x0028,
+	0x2069, 0x198e, 0x2d04, 0x7002, 0x6028, 0x9085, 0x0600, 0x602a,
+	0x00e6, 0x0036, 0x0046, 0x0056, 0x2071, 0x1a61, 0x080c, 0x1aab,
+	0x005e, 0x004e, 0x003e, 0x00ee, 0x00de, 0x0005, 0x00d6, 0x2069,
+	0x0200, 0x6804, 0x9005, 0x1178, 0x6808, 0x9005, 0x1160, 0x709b,
+	0x0028, 0x2069, 0x198e, 0x2d04, 0x7002, 0x080c, 0x757a, 0x6028,
+	0x9085, 0x0600, 0x602a, 0x00de, 0x0005, 0x0006, 0x2001, 0x0090,
+	0x080c, 0x2cf1, 0x000e, 0x6124, 0xd1e4, 0x1190, 0x080c, 0x721d,
+	0xd1d4, 0x1160, 0xd1dc, 0x1138, 0xd1cc, 0x0150, 0x709b, 0x0020,
+	0x080c, 0x721d, 0x0028, 0x709b, 0x001d, 0x0010, 0x709b, 0x001f,
+	0x0005, 0x2001, 0x0088, 0x080c, 0x2cf1, 0x6124, 0xd1cc, 0x11e8,
+	0xd1dc, 0x11c0, 0xd1e4, 0x1198, 0x9184, 0x1e00, 0x11d8, 0x080c,
+	0x1ad5, 0x60e3, 0x0001, 0x600c, 0xc0b4, 0x600e, 0x080c, 0x73d1,
+	0x2001, 0x0080, 0x080c, 0x2cf1, 0x709b, 0x0028, 0x0058, 0x709b,
+	0x001e, 0x0040, 0x709b, 0x001d, 0x0028, 0x709b, 0x0020, 0x0010,
+	0x709b, 0x001f, 0x0005, 0x080c, 0x1ad5, 0x60e3, 0x0001, 0x600c,
+	0xc0b4, 0x600e, 0x080c, 0x73d1, 0x2001, 0x0080, 0x080c, 0x2cf1,
+	0x6124, 0xd1d4, 0x1180, 0xd1dc, 0x1158, 0xd1e4, 0x1130, 0x9184,
+	0x1e00, 0x1158, 0x709b, 0x0028, 0x0040, 0x709b, 0x001e, 0x0028,
+	0x709b, 0x001d, 0x0010, 0x709b, 0x001f, 0x0005, 0x2001, 0x00a0,
+	0x080c, 0x2cf1, 0x6124, 0xd1dc, 0x1138, 0xd1e4, 0x0138, 0x080c,
+	0x1ad5, 0x709b, 0x001e, 0x0010, 0x709b, 0x001d, 0x0005, 0x080c,
+	0x72a0, 0x6124, 0xd1dc, 0x1188, 0x080c, 0x721d, 0x0016, 0x080c,
+	0x1ad5, 0x001e, 0xd1d4, 0x1128, 0xd1e4, 0x0138, 0x709b, 0x001e,
+	0x0020, 0x709b, 0x001f, 0x080c, 0x721d, 0x0005, 0x0006, 0x2001,
+	0x00a0, 0x080c, 0x2cf1, 0x000e, 0x6124, 0xd1d4, 0x1160, 0xd1cc,
+	0x1150, 0xd1dc, 0x1128, 0xd1e4, 0x0140, 0x709b, 0x001e, 0x0028,
+	0x709b, 0x001d, 0x0010, 0x709b, 0x0021, 0x0005, 0x080c, 0x72a0,
+	0x6124, 0xd1d4, 0x1150, 0xd1dc, 0x1128, 0xd1e4, 0x0140, 0x709b,
+	0x001e, 0x0028, 0x709b, 0x001d, 0x0010, 0x709b, 0x001f, 0x0005,
+	0x0006, 0x2001, 0x0090, 0x080c, 0x2cf1, 0x000e, 0x6124, 0xd1d4,
+	0x1178, 0xd1cc, 0x1150, 0xd1dc, 0x1128, 0xd1e4, 0x0158, 0x709b,
+	0x001e, 0x0040, 0x709b, 0x001d, 0x0028, 0x709b, 0x0020, 0x0010,
+	0x709b, 0x001f, 0x0005, 0x0016, 0x00c6, 0x00d6, 0x00e6, 0x0126,
+	0x2061, 0x0100, 0x2069, 0x0140, 0x2071, 0x1800, 0x2091, 0x8000,
+	0x080c, 0x73a5, 0x11d8, 0x2001, 0x180c, 0x200c, 0xd1b4, 0x01b0,
+	0xc1b4, 0x2102, 0x6027, 0x0200, 0x080c, 0x2c3a, 0x6024, 0xd0cc,
+	0x0148, 0x2001, 0x00a0, 0x080c, 0x2cf1, 0x080c, 0x768d, 0x080c,
+	0x6023, 0x0428, 0x6028, 0xc0cd, 0x602a, 0x0408, 0x080c, 0x73bf,
+	0x0150, 0x080c, 0x73b6, 0x1138, 0x2001, 0x0001, 0x080c, 0x27ec,
+	0x080c, 0x737d, 0x00a0, 0x080c, 0x729d, 0x0178, 0x2001, 0x0001,
+	0x080c, 0x27ec, 0x7098, 0x9086, 0x001e, 0x0120, 0x7098, 0x9086,
+	0x0022, 0x1118, 0x709b, 0x0025, 0x0010, 0x709b, 0x0021, 0x012e,
+	0x00ee, 0x00de, 0x00ce, 0x001e, 0x0005, 0x0026, 0x2011, 0x722e,
+	0x080c, 0x85b6, 0x002e, 0x0016, 0x0026, 0x2009, 0x0064, 0x2011,
+	0x722e, 0x080c, 0x85ad, 0x002e, 0x001e, 0x0005, 0x00e6, 0x00f6,
+	0x0016, 0x080c, 0xa274, 0x2071, 0x1800, 0x080c, 0x71cb, 0x001e,
+	0x00fe, 0x00ee, 0x0005, 0x0016, 0x0026, 0x0036, 0x00c6, 0x00d6,
+	0x00e6, 0x00f6, 0x0126, 0x080c, 0xa274, 0x2061, 0x0100, 0x2069,
+	0x0140, 0x2071, 0x1800, 0x2091, 0x8000, 0x6028, 0xc09c, 0x602a,
+	0x2011, 0x0003, 0x080c, 0xa654, 0x2011, 0x0002, 0x080c, 0xa65e,
+	0x080c, 0xa541, 0x080c, 0x8562, 0x0036, 0x901e, 0x080c, 0xa5b7,
+	0x003e, 0x60e3, 0x0000, 0x080c, 0xea0a, 0x080c, 0xea25, 0x2009,
+	0x0004, 0x080c, 0x2c40, 0x080c, 0x2b5b, 0x2001, 0x1800, 0x2003,
+	0x0004, 0x6027, 0x0008, 0x2011, 0x722e, 0x080c, 0x85b6, 0x080c,
+	0x73bf, 0x0118, 0x9006, 0x080c, 0x2cf1, 0x080c, 0x0bae, 0x2001,
+	0x0001, 0x080c, 0x27ec, 0x012e, 0x00fe, 0x00ee, 0x00de, 0x00ce,
+	0x003e, 0x002e, 0x001e, 0x0005, 0x0026, 0x00e6, 0x2011, 0x723b,
+	0x2071, 0x19f9, 0x701c, 0x9206, 0x1118, 0x7018, 0x9005, 0x0110,
+	0x9085, 0x0001, 0x00ee, 0x002e, 0x0005, 0x6020, 0xd09c, 0x0005,
+	0x6800, 0x9084, 0xfffe, 0x9086, 0x00c0, 0x0170, 0x2001, 0x00c0,
+	0x080c, 0x2cf1, 0x0156, 0x20a9, 0x002d, 0x1d04, 0x72ad, 0x2091,
+	0x6000, 0x1f04, 0x72ad, 0x015e, 0x0005, 0x00c6, 0x00d6, 0x00e6,
+	0x2061, 0x0100, 0x2069, 0x0140, 0x2071, 0x1800, 0x080c, 0x769c,
+	0x2001, 0x196c, 0x2003, 0x0000, 0x9006, 0x709a, 0x60e2, 0x6886,
+	0x080c, 0x28b4, 0x9006, 0x080c, 0x2cf1, 0x080c, 0x5ee2, 0x6027,
+	0xffff, 0x602b, 0x182f, 0x00ee, 0x00de, 0x00ce, 0x0005, 0x00c6,
+	0x00d6, 0x00e6, 0x2061, 0x0100, 0x2069, 0x0140, 0x2071, 0x1800,
+	0x2001, 0x197c, 0x200c, 0x9186, 0x0000, 0x0158, 0x9186, 0x0001,
+	0x0158, 0x9186, 0x0002, 0x0158, 0x9186, 0x0003, 0x0158, 0x0804,
+	0x736d, 0x709b, 0x0022, 0x0040, 0x709b, 0x0021, 0x0028, 0x709b,
+	0x0023, 0x0010, 0x709b, 0x0024, 0x60e3, 0x0000, 0x6887, 0x0001,
+	0x2001, 0x0001, 0x080c, 0x28b4, 0x0026, 0x080c, 0xade2, 0x002e,
+	0x7000, 0x908e, 0x0004, 0x0118, 0x602b, 0x0028, 0x0010, 0x602b,
+	0x0020, 0x0156, 0x0126, 0x2091, 0x8000, 0x20a9, 0x0005, 0x6024,
+	0xd0ac, 0x0150, 0x012e, 0x015e, 0x080c, 0xd24a, 0x0118, 0x9006,
+	0x080c, 0x2d1b, 0x0804, 0x7379, 0x6800, 0x9084, 0x00a1, 0xc0bd,
+	0x6802, 0x080c, 0x2c3a, 0x6904, 0xd1d4, 0x1140, 0x2001, 0x0100,
+	0x080c, 0x2cf1, 0x1f04, 0x7317, 0x080c, 0x73fc, 0x012e, 0x015e,
+	0x080c, 0x73b6, 0x01a8, 0x6044, 0x9005, 0x0168, 0x6050, 0x0006,
+	0x9085, 0x0020, 0x6052, 0x080c, 0x73fc, 0x9006, 0x8001, 0x1df0,
+	0x000e, 0x6052, 0x0028, 0x6804, 0xd0d4, 0x1110, 0x080c, 0x73fc,
+	0x080c, 0xd24a, 0x0118, 0x9006, 0x080c, 0x2d1b, 0x0016, 0x0026,
+	0x7000, 0x908e, 0x0004, 0x0130, 0x2009, 0x00c8, 0x2011, 0x723b,
+	0x080c, 0x8574, 0x002e, 0x001e, 0x080c, 0x83f4, 0x7034, 0xc085,
+	0x7036, 0x2001, 0x197c, 0x2003, 0x0004, 0x080c, 0x7098, 0x080c,
+	0x73b6, 0x0138, 0x6804, 0xd0d4, 0x1120, 0xd0dc, 0x1100, 0x080c,
+	0x7692, 0x00ee, 0x00de, 0x00ce, 0x0005, 0x00c6, 0x00d6, 0x00e6,
+	0x2061, 0x0100, 0x2069, 0x0140, 0x2071, 0x1800, 0x080c, 0x840b,
+	0x080c, 0x83fd, 0x080c, 0x769c, 0x2001, 0x196c, 0x2003, 0x0000,
+	0x9006, 0x709a, 0x60e2, 0x6886, 0x080c, 0x28b4, 0x9006, 0x080c,
+	0x2cf1, 0x6043, 0x0090, 0x6043, 0x0010, 0x6027, 0xffff, 0x602b,
+	0x182f, 0x00ee, 0x00de, 0x00ce, 0x0005, 0x0006, 0x2001, 0x197b,
+	0x2004, 0x9086, 0xaaaa, 0x000e, 0x0005, 0x0006, 0x080c, 0x56dc,
+	0x9084, 0x0030, 0x9086, 0x0000, 0x000e, 0x0005, 0x0006, 0x080c,
+	0x56dc, 0x9084, 0x0030, 0x9086, 0x0030, 0x000e, 0x0005, 0x0006,
+	0x080c, 0x56dc, 0x9084, 0x0030, 0x9086, 0x0010, 0x000e, 0x0005,
+	0x0006, 0x080c, 0x56dc, 0x9084, 0x0030, 0x9086, 0x0020, 0x000e,
+	0x0005, 0x0036, 0x0016, 0x2001, 0x180c, 0x2004, 0x908c, 0x0013,
+	0x0180, 0x0020, 0x080c, 0x28d4, 0x900e, 0x0028, 0x080c, 0x6973,
+	0x1dc8, 0x2009, 0x0002, 0x2019, 0x0028, 0x080c, 0x318c, 0x9006,
+	0x0019, 0x001e, 0x003e, 0x0005, 0x00e6, 0x2071, 0x180c, 0x2e04,
+	0x0130, 0x080c, 0xd243, 0x1128, 0x9085, 0x0010, 0x0010, 0x9084,
+	0xffef, 0x2072, 0x00ee, 0x0005, 0x6050, 0x0006, 0x60ec, 0x0006,
+	0x600c, 0x0006, 0x6004, 0x0006, 0x6028, 0x0006, 0x0016, 0x6138,
+	0x6050, 0x9084, 0xfbff, 0x9085, 0x2000, 0x6052, 0x613a, 0x20a9,
+	0x0012, 0x1d04, 0x7411, 0x2091, 0x6000, 0x1f04, 0x7411, 0x602f,
+	0x0100, 0x602f, 0x0000, 0x6050, 0x9085, 0x0400, 0x9084, 0xdfff,
+	0x6052, 0x613a, 0x001e, 0x602f, 0x0040, 0x602f, 0x0000, 0x000e,
+	0x602a, 0x000e, 0x6006, 0x000e, 0x600e, 0x000e, 0x60ee, 0x60e3,
+	0x0000, 0x6887, 0x0001, 0x2001, 0x0001, 0x080c, 0x28b4, 0x2001,
+	0x00a0, 0x0006, 0x080c, 0xd24a, 0x000e, 0x0130, 0x080c, 0x2d0f,
+	0x9006, 0x080c, 0x2d1b, 0x0010, 0x080c, 0x2cf1, 0x000e, 0x6052,
+	0x6050, 0x0006, 0xc0e5, 0x6052, 0x00f6, 0x2079, 0x0100, 0x080c,
+	0x2baf, 0x00fe, 0x000e, 0x6052, 0x0005, 0x0156, 0x0016, 0x0026,
+	0x0036, 0x00c6, 0x00d6, 0x00e6, 0x2061, 0x0100, 0x2069, 0x0140,
+	0x2071, 0x1800, 0x6020, 0x9084, 0x0080, 0x0138, 0x2001, 0x180c,
+	0x200c, 0xc1c5, 0x2102, 0x0804, 0x74d1, 0x2001, 0x180c, 0x200c,
+	0xc1c4, 0x2102, 0x6028, 0x9084, 0xe1ff, 0x602a, 0x6027, 0x0200,
+	0x2001, 0x0090, 0x080c, 0x2cf1, 0x20a9, 0x0366, 0x6024, 0xd0cc,
+	0x1518, 0x1d04, 0x747e, 0x2091, 0x6000, 0x1f04, 0x747e, 0x2011,
+	0x0003, 0x080c, 0xa654, 0x2011, 0x0002, 0x080c, 0xa65e, 0x080c,
+	0xa541, 0x901e, 0x080c, 0xa5b7, 0x2001, 0x00a0, 0x080c, 0x2cf1,
+	0x080c, 0x768d, 0x080c, 0x6023, 0x080c, 0xd24a, 0x0110, 0x080c,
+	0x0d45, 0x9085, 0x0001, 0x0498, 0x86ff, 0x1110, 0x080c, 0x1ad5,
+	0x60e3, 0x0000, 0x2001, 0x196c, 0x2004, 0x080c, 0x28b4, 0x60e2,
+	0x2001, 0x0080, 0x080c, 0x2cf1, 0x20a9, 0x0366, 0x6027, 0x1e00,
+	0x2009, 0x1e00, 0x080c, 0x2c3a, 0x6024, 0x910c, 0x0138, 0x1d04,
+	0x74b6, 0x2091, 0x6000, 0x1f04, 0x74b6, 0x0808, 0x6028, 0x9085,
+	0x1e00, 0x602a, 0x70b4, 0x9005, 0x1118, 0x6887, 0x0001, 0x0008,
+	0x6886, 0x080c, 0xd24a, 0x0110, 0x080c, 0x0d45, 0x9006, 0x00ee,
+	0x00de, 0x00ce, 0x003e, 0x002e, 0x001e, 0x015e, 0x0005, 0x0156,
+	0x0016, 0x0026, 0x0036, 0x00c6, 0x00d6, 0x00e6, 0x2061, 0x0100,
+	0x2071, 0x1800, 0x7000, 0x9086, 0x0003, 0x1168, 0x2001, 0x020b,
+	0x2004, 0x9084, 0x5540, 0x9086, 0x5540, 0x1128, 0x2069, 0x1a78,
+	0x2d04, 0x8000, 0x206a, 0x2069, 0x0140, 0x6020, 0x9084, 0x00c0,
+	0x0120, 0x6884, 0x9005, 0x1904, 0x7544, 0x2001, 0x0088, 0x080c,
+	0x2cf1, 0x9006, 0x60e2, 0x6886, 0x080c, 0x28b4, 0x2069, 0x0200,
+	0x6804, 0x9005, 0x1118, 0x6808, 0x9005, 0x01c0, 0x6028, 0x9084,
+	0xfbff, 0x602a, 0x6027, 0x0400, 0x2069, 0x198e, 0x7000, 0x206a,
+	0x709b, 0x0026, 0x7003, 0x0001, 0x20a9, 0x0002, 0x1d04, 0x7526,
+	0x2091, 0x6000, 0x1f04, 0x7526, 0x0804, 0x7572, 0x2069, 0x0140,
+	0x20a9, 0x0384, 0x6027, 0x1e00, 0x2009, 0x1e00, 0x080c, 0x2c3a,
+	0x6024, 0x910c, 0x0508, 0x9084, 0x1a00, 0x11f0, 0x1d04, 0x7532,
+	0x2091, 0x6000, 0x1f04, 0x7532, 0x2011, 0x0003, 0x080c, 0xa654,
+	0x2011, 0x0002, 0x080c, 0xa65e, 0x080c, 0xa541, 0x901e, 0x080c,
+	0xa5b7, 0x2001, 0x00a0, 0x080c, 0x2cf1, 0x080c, 0x768d, 0x080c,
+	0x6023, 0x9085, 0x0001, 0x00b0, 0x2001, 0x0080, 0x080c, 0x2cf1,
+	0x2069, 0x0140, 0x60e3, 0x0000, 0x70b4, 0x9005, 0x1118, 0x6887,
+	0x0001, 0x0008, 0x6886, 0x2001, 0x196c, 0x2004, 0x080c, 0x28b4,
+	0x60e2, 0x9006, 0x00ee, 0x00de, 0x00ce, 0x003e, 0x002e, 0x001e,
+	0x015e, 0x0005, 0x0156, 0x0016, 0x0026, 0x0036, 0x00c6, 0x00d6,
+	0x00e6, 0x2061, 0x0100, 0x2071, 0x1800, 0x6020, 0x9084, 0x00c0,
+	0x01c8, 0x2011, 0x0003, 0x080c, 0xa654, 0x2011, 0x0002, 0x080c,
+	0xa65e, 0x080c, 0xa541, 0x901e, 0x080c, 0xa5b7, 0x2069, 0x0140,
+	0x2001, 0x00a0, 0x080c, 0x2cf1, 0x080c, 0x768d, 0x080c, 0x6023,
+	0x0804, 0x760d, 0x2001, 0x180c, 0x200c, 0xd1b4, 0x1160, 0xc1b5,
+	0x2102, 0x080c, 0x7223, 0x2069, 0x0140, 0x2001, 0x0080, 0x080c,
+	0x2cf1, 0x60e3, 0x0000, 0x2069, 0x0200, 0x6804, 0x9005, 0x1118,
+	0x6808, 0x9005, 0x0180, 0x6028, 0x9084, 0xfdff, 0x602a, 0x6027,
+	0x0200, 0x2069, 0x198e, 0x7000, 0x206a, 0x709b, 0x0027, 0x7003,
+	0x0001, 0x0804, 0x760d, 0x6027, 0x1e00, 0x2009, 0x1e00, 0x080c,
+	0x2c3a, 0x6024, 0x910c, 0x01c8, 0x9084, 0x1c00, 0x11b0, 0x1d04,
+	0x75cb, 0x0006, 0x0016, 0x00c6, 0x00d6, 0x00e6, 0x080c, 0x843c,
+	0x00ee, 0x00de, 0x00ce, 0x001e, 0x000e, 0x00e6, 0x2071, 0x19f9,
+	0x7018, 0x00ee, 0x9005, 0x19f8, 0x0500, 0x0026, 0x2011, 0x723b,
+	0x080c, 0x84dc, 0x2011, 0x722e, 0x080c, 0x85b6, 0x002e, 0x2069,
 	0x0140, 0x60e3, 0x0000, 0x70b4, 0x9005, 0x1118, 0x6887, 0x0001,
-	0x0008, 0x6886, 0x2001, 0x196d, 0x2004, 0x080c, 0x28b2, 0x60e2,
-	0x9006, 0x00ee, 0x00de, 0x00ce, 0x003e, 0x002e, 0x001e, 0x015e,
-	0x0005, 0x0156, 0x0016, 0x0026, 0x0036, 0x00c6, 0x00d6, 0x00e6,
-	0x2061, 0x0100, 0x2071, 0x1800, 0x6020, 0x9084, 0x00c0, 0x01c8,
-	0x2011, 0x0003, 0x080c, 0xa653, 0x2011, 0x0002, 0x080c, 0xa65d,
-	0x080c, 0xa540, 0x901e, 0x080c, 0xa5b6, 0x2069, 0x0140, 0x2001,
-	0x00a0, 0x080c, 0x2cef, 0x080c, 0x76a4, 0x080c, 0x601a, 0x0804,
-	0x7624, 0x2001, 0x180c, 0x200c, 0xd1b4, 0x1160, 0xc1b5, 0x2102,
-	0x080c, 0x723a, 0x2069, 0x0140, 0x2001, 0x0080, 0x080c, 0x2cef,
-	0x60e3, 0x0000, 0x2069, 0x0200, 0x6804, 0x9005, 0x1118, 0x6808,
-	0x9005, 0x0180, 0x6028, 0x9084, 0xfdff, 0x602a, 0x6027, 0x0200,
-	0x2069, 0x198f, 0x7000, 0x206a, 0x709b, 0x0027, 0x7003, 0x0001,
-	0x0804, 0x7624, 0x6027, 0x1e00, 0x2009, 0x1e00, 0x080c, 0x2c38,
-	0x6024, 0x910c, 0x01c8, 0x9084, 0x1c00, 0x11b0, 0x1d04, 0x75e2,
-	0x0006, 0x0016, 0x00c6, 0x00d6, 0x00e6, 0x080c, 0x8453, 0x00ee,
-	0x00de, 0x00ce, 0x001e, 0x000e, 0x00e6, 0x2071, 0x19fa, 0x7018,
-	0x00ee, 0x9005, 0x19f8, 0x0500, 0x0026, 0x2011, 0x7252, 0x080c,
-	0x84f3, 0x2011, 0x7245, 0x080c, 0x85cd, 0x002e, 0x2069, 0x0140,
-	0x60e3, 0x0000, 0x70b4, 0x9005, 0x1118, 0x6887, 0x0001, 0x0008,
-	0x6886, 0x2001, 0x196d, 0x2004, 0x080c, 0x28b2, 0x60e2, 0x2001,
-	0x180c, 0x200c, 0xc1b4, 0x2102, 0x00ee, 0x00de, 0x00ce, 0x003e,
-	0x002e, 0x001e, 0x015e, 0x0005, 0x0156, 0x0016, 0x0026, 0x0036,
-	0x0046, 0x00c6, 0x00e6, 0x2061, 0x0100, 0x2071, 0x1800, 0x080c,
-	0xd229, 0x1904, 0x7692, 0x7130, 0xd184, 0x1170, 0x080c, 0x3319,
-	0x0138, 0xc18d, 0x7132, 0x2011, 0x1848, 0x2214, 0xd2ac, 0x1120,
-	0x7030, 0xd08c, 0x0904, 0x7692, 0x2011, 0x1848, 0x220c, 0xd1a4,
-	0x0538, 0x0016, 0x2019, 0x000e, 0x080c, 0xe522, 0x0156, 0x00b6,
-	0x20a9, 0x007f, 0x900e, 0x9186, 0x007e, 0x01a0, 0x9186, 0x0080,
-	0x0188, 0x080c, 0x65ff, 0x1170, 0x2120, 0x9006, 0x0016, 0x2009,
-	0x000e, 0x080c, 0xe5ae, 0x2009, 0x0001, 0x2011, 0x0100, 0x080c,
-	0x86dd, 0x001e, 0x8108, 0x1f04, 0x765b, 0x00be, 0x015e, 0x001e,
-	0xd1ac, 0x1148, 0x0016, 0x2009, 0x0002, 0x2019, 0x0004, 0x080c,
-	0x318a, 0x001e, 0x0078, 0x0156, 0x00b6, 0x20a9, 0x007f, 0x900e,
-	0x080c, 0x65ff, 0x1110, 0x080c, 0x6034, 0x8108, 0x1f04, 0x7688,
-	0x00be, 0x015e, 0x080c, 0x1ad3, 0x080c, 0xadd2, 0x60e3, 0x0000,
-	0x080c, 0x601a, 0x080c, 0x72ee, 0x00ee, 0x00ce, 0x004e, 0x003e,
-	0x002e, 0x001e, 0x015e, 0x0005, 0x2001, 0x197d, 0x2003, 0x0001,
-	0x0005, 0x2001, 0x197d, 0x2003, 0x0000, 0x0005, 0x2001, 0x197c,
-	0x2003, 0xaaaa, 0x0005, 0x2001, 0x197c, 0x2003, 0x0000, 0x0005,
-	0x2071, 0x18fa, 0x7003, 0x0000, 0x7007, 0x0000, 0x080c, 0x1018,
-	0x090c, 0x0dd5, 0xa8ab, 0xdcb0, 0x2900, 0x704e, 0x080c, 0x1018,
-	0x090c, 0x0dd5, 0xa8ab, 0xdcb0, 0x2900, 0x7052, 0xa867, 0x0000,
-	0xa86b, 0x0001, 0xa89f, 0x0000, 0x0005, 0x00e6, 0x2071, 0x0040,
-	0x6848, 0x9005, 0x1118, 0x9085, 0x0001, 0x04b0, 0x6840, 0x9005,
-	0x0150, 0x04a1, 0x6a50, 0x9200, 0x7002, 0x6854, 0x9101, 0x7006,
-	0x9006, 0x7012, 0x7016, 0x6850, 0x7002, 0x6854, 0x7006, 0x6858,
-	0x700a, 0x685c, 0x700e, 0x6840, 0x9005, 0x1110, 0x7012, 0x7016,
-	0x6848, 0x701a, 0x701c, 0x9085, 0x0040, 0x701e, 0x2001, 0x0019,
-	0x7036, 0x702b, 0x0001, 0x2001, 0x0004, 0x200c, 0x918c, 0xfff7,
-	0x918d, 0x8000, 0x2102, 0x00d6, 0x2069, 0x18fa, 0x6807, 0x0001,
-	0x00de, 0x080c, 0x7c90, 0x9006, 0x00ee, 0x0005, 0x900e, 0x0156,
-	0x20a9, 0x0006, 0x8003, 0x2011, 0x0100, 0x2214, 0x9296, 0x0008,
-	0x1110, 0x818d, 0x0010, 0x81f5, 0x3e08, 0x1f04, 0x771a, 0x015e,
-	0x0005, 0x2079, 0x0040, 0x2071, 0x18fa, 0x7004, 0x0002, 0x7739,
-	0x773a, 0x7771, 0x77cc, 0x78dc, 0x7737, 0x7737, 0x7906, 0x080c,
-	0x0dd5, 0x0005, 0x2079, 0x0040, 0x782c, 0x908c, 0x0780, 0x190c,
-	0x7d72, 0xd0a4, 0x01f0, 0x7824, 0x2048, 0x9006, 0xa802, 0xa806,
-	0xa864, 0x9084, 0x00ff, 0x908a, 0x0040, 0x0608, 0x00b8, 0x2001,
-	0x1800, 0x200c, 0x9186, 0x0003, 0x1160, 0x7104, 0x9186, 0x0004,
-	0x0140, 0x9186, 0x0007, 0x0128, 0x9186, 0x0003, 0x19e8, 0x080c,
-	0x77cc, 0x782c, 0xd09c, 0x090c, 0x7c90, 0x0005, 0x9082, 0x005a,
-	0x1218, 0x2100, 0x003b, 0x0c18, 0x080c, 0x7802, 0x0c90, 0x00e3,
-	0x08f0, 0x0005, 0x7802, 0x7802, 0x7802, 0x7802, 0x7802, 0x7802,
-	0x7802, 0x7802, 0x7824, 0x7802, 0x7802, 0x7802, 0x7802, 0x7802,
-	0x7802, 0x7802, 0x7802, 0x7802, 0x7802, 0x7802, 0x7802, 0x7802,
-	0x7802, 0x7802, 0x7802, 0x7802, 0x7802, 0x7802, 0x780e, 0x7802,
-	0x79f7, 0x7802, 0x7802, 0x7802, 0x7824, 0x7802, 0x780e, 0x7a38,
-	0x7a79, 0x7ac0, 0x7ad4, 0x7802, 0x7802, 0x7824, 0x780e, 0x7838,
-	0x7802, 0x78b0, 0x7b7f, 0x7b9a, 0x7802, 0x7824, 0x7802, 0x7838,
-	0x7802, 0x7802, 0x78a6, 0x7b9a, 0x7802, 0x7802, 0x7802, 0x7802,
-	0x7802, 0x7802, 0x7802, 0x7802, 0x7802, 0x784c, 0x7802, 0x7802,
-	0x7802, 0x7802, 0x7802, 0x7802, 0x7802, 0x7802, 0x7802, 0x7d16,
-	0x7802, 0x7cc0, 0x7802, 0x7cc0, 0x7802, 0x7861, 0x7802, 0x7802,
-	0x7802, 0x7802, 0x7802, 0x7802, 0x2079, 0x0040, 0x7004, 0x9086,
-	0x0003, 0x1198, 0x782c, 0x080c, 0x7cb9, 0xd0a4, 0x0170, 0x7824,
-	0x2048, 0x9006, 0xa802, 0xa806, 0xa864, 0x9084, 0x00ff, 0x908a,
-	0x001a, 0x1210, 0x002b, 0x0c50, 0x00e9, 0x080c, 0x7c90, 0x0005,
-	0x7802, 0x780e, 0x79e3, 0x7802, 0x780e, 0x7802, 0x780e, 0x780e,
-	0x7802, 0x780e, 0x79e3, 0x780e, 0x780e, 0x780e, 0x780e, 0x780e,
-	0x7802, 0x780e, 0x79e3, 0x7802, 0x7802, 0x780e, 0x7802, 0x7802,
-	0x7802, 0x780e, 0x00e6, 0x2071, 0x18fa, 0x2009, 0x0400, 0x0071,
-	0x00ee, 0x0005, 0x2009, 0x1000, 0x0049, 0x0005, 0x2009, 0x2000,
-	0x0029, 0x0005, 0x2009, 0x0800, 0x0009, 0x0005, 0x7007, 0x0001,
-	0xa868, 0x9084, 0x00ff, 0x9105, 0xa86a, 0x0126, 0x2091, 0x8000,
-	0x080c, 0x6c81, 0x012e, 0x0005, 0xa864, 0x8007, 0x9084, 0x00ff,
-	0x0d08, 0x8001, 0x1120, 0x7007, 0x0001, 0x0804, 0x7985, 0x7007,
-	0x0003, 0x7012, 0x2900, 0x7016, 0x701a, 0x704b, 0x7985, 0x0005,
-	0xa864, 0x8007, 0x9084, 0x00ff, 0x0968, 0x8001, 0x1120, 0x7007,
-	0x0001, 0x0804, 0x79a0, 0x7007, 0x0003, 0x7012, 0x2900, 0x7016,
-	0x701a, 0x704b, 0x79a0, 0x0005, 0xa864, 0x8007, 0x9084, 0x00ff,
-	0x0904, 0x780a, 0x8001, 0x1120, 0x7007, 0x0001, 0x0804, 0x79bc,
-	0x7007, 0x0003, 0x7012, 0x2900, 0x7016, 0x701a, 0x704b, 0x79bc,
-	0x0005, 0xa864, 0x8007, 0x9084, 0x00ff, 0x9086, 0x0001, 0x1904,
-	0x780a, 0x7007, 0x0001, 0x2009, 0x1834, 0x210c, 0x81ff, 0x11a8,
-	0xa868, 0x9084, 0x00ff, 0xa86a, 0xa883, 0x0000, 0x080c, 0x62ae,
-	0x1108, 0x0005, 0x0126, 0x2091, 0x8000, 0xa867, 0x0139, 0xa87a,
-	0xa982, 0x080c, 0x6c81, 0x012e, 0x0ca0, 0xa994, 0x9186, 0x0071,
-	0x0d38, 0x9186, 0x0064, 0x0d20, 0x9186, 0x007c, 0x0d08, 0x9186,
-	0x0028, 0x09f0, 0x9186, 0x0038, 0x09d8, 0x9186, 0x0078, 0x09c0,
-	0x9186, 0x005f, 0x09a8, 0x9186, 0x0056, 0x0990, 0xa897, 0x4005,
-	0xa89b, 0x0001, 0x2001, 0x0030, 0x900e, 0x08a0, 0xa87c, 0x9084,
-	0x00c0, 0x9086, 0x00c0, 0x1120, 0x7007, 0x0001, 0x0804, 0x7bb1,
-	0x2900, 0x7016, 0x701a, 0x20a9, 0x0004, 0xa860, 0x20e0, 0xa85c,
-	0x9080, 0x0030, 0x2098, 0x7050, 0x2040, 0xa060, 0x20e8, 0xa05c,
-	0x9080, 0x0023, 0x20a0, 0x4003, 0xa888, 0x7012, 0x9082, 0x0401,
-	0x1a04, 0x7812, 0xaab4, 0x928a, 0x0002, 0x1a04, 0x7812, 0x82ff,
-	0x1138, 0xa8b8, 0xa9bc, 0x9105, 0x0118, 0x2001, 0x7943, 0x0018,
-	0x9280, 0x7939, 0x2005, 0x7056, 0x7010, 0x9015, 0x0904, 0x7924,
-	0x080c, 0x1018, 0x1118, 0x7007, 0x0004, 0x0005, 0x2900, 0x7022,
-	0x7054, 0x2060, 0xe000, 0xa866, 0x7050, 0x2040, 0xa95c, 0xe004,
-	0x9100, 0xa076, 0xa860, 0xa072, 0xe008, 0x920a, 0x1210, 0x900e,
-	0x2200, 0x7112, 0xe20c, 0x8003, 0x800b, 0x9296, 0x0004, 0x0108,
-	0x9108, 0xa17a, 0x810b, 0xa17e, 0x080c, 0x10e9, 0xa06c, 0x908e,
-	0x0100, 0x0170, 0x9086, 0x0200, 0x0118, 0x7007, 0x0007, 0x0005,
-	0x7020, 0x2048, 0x080c, 0x1031, 0x7014, 0x2048, 0x0804, 0x7812,
-	0x7020, 0x2048, 0x7018, 0xa802, 0xa807, 0x0000, 0x2908, 0x2048,
-	0xa906, 0x711a, 0x0804, 0x78dc, 0x7014, 0x2048, 0x7007, 0x0001,
-	0xa8b4, 0x9005, 0x1128, 0xa8b8, 0xa9bc, 0x9105, 0x0108, 0x00b9,
-	0xa864, 0x9084, 0x00ff, 0x9086, 0x001e, 0x0904, 0x7bb1, 0x0804,
-	0x7985, 0x793b, 0x793f, 0x0002, 0x001d, 0x0007, 0x0004, 0x000a,
-	0x001b, 0x0005, 0x0006, 0x000a, 0x001d, 0x0005, 0x0004, 0x0076,
-	0x0066, 0xafb8, 0xaebc, 0xa804, 0x2050, 0xb0c0, 0xb0e2, 0xb0bc,
-	0xb0de, 0xb0b8, 0xb0d2, 0xb0b4, 0xb0ce, 0xb6da, 0xb7d6, 0xb0b0,
-	0xb0ca, 0xb0ac, 0xb0c6, 0xb0a8, 0xb0ba, 0xb0a4, 0xb0b6, 0xb6c2,
-	0xb7be, 0xb0a0, 0xb0b2, 0xb09c, 0xb0ae, 0xb098, 0xb0a2, 0xb094,
-	0xb09e, 0xb6aa, 0xb7a6, 0xb090, 0xb09a, 0xb08c, 0xb096, 0xb088,
-	0xb08a, 0xb084, 0xb086, 0xb692, 0xb78e, 0xb080, 0xb082, 0xb07c,
-	0xb07e, 0xb078, 0xb072, 0xb074, 0xb06e, 0xb67a, 0xb776, 0xb004,
-	0x9055, 0x1958, 0x006e, 0x007e, 0x0005, 0x2009, 0x1834, 0x210c,
-	0x81ff, 0x1178, 0x080c, 0x60ae, 0x1108, 0x0005, 0x080c, 0x6ec0,
-	0x0126, 0x2091, 0x8000, 0x080c, 0xce24, 0x080c, 0x6c81, 0x012e,
-	0x0ca0, 0x080c, 0xd229, 0x1d70, 0x2001, 0x0028, 0x900e, 0x0c70,
-	0x2009, 0x1834, 0x210c, 0x81ff, 0x1188, 0xa888, 0x9005, 0x0188,
-	0xa883, 0x0000, 0x080c, 0x613e, 0x1108, 0x0005, 0xa87a, 0x0126,
-	0x2091, 0x8000, 0x080c, 0x6c81, 0x012e, 0x0cb8, 0x2001, 0x0028,
-	0x0ca8, 0x2001, 0x0000, 0x0c90, 0x2009, 0x1834, 0x210c, 0x81ff,
-	0x11d8, 0xa888, 0x9005, 0x01e0, 0xa883, 0x0000, 0xa87c, 0xd0f4,
-	0x0120, 0x080c, 0x6210, 0x1138, 0x0005, 0x9006, 0xa87a, 0x080c,
-	0x618b, 0x1108, 0x0005, 0x0126, 0x2091, 0x8000, 0xa87a, 0xa982,
-	0x080c, 0x6c81, 0x012e, 0x0cb0, 0x2001, 0x0028, 0x900e, 0x0c98,
-	0x2001, 0x0000, 0x0c80, 0x7018, 0xa802, 0x2908, 0x2048, 0xa906,
-	0x711a, 0x7010, 0x8001, 0x7012, 0x0118, 0x7007, 0x0003, 0x0030,
-	0x7014, 0x2048, 0x7007, 0x0001, 0x7048, 0x080f, 0x0005, 0x00b6,
-	0x7007, 0x0001, 0xa974, 0xa878, 0x9084, 0x00ff, 0x9096, 0x0004,
-	0x0540, 0x20a9, 0x0001, 0x9096, 0x0001, 0x0190, 0x900e, 0x20a9,
-	0x0800, 0x9096, 0x0002, 0x0160, 0x9005, 0x11d8, 0xa974, 0x080c,
-	0x65ff, 0x11b8, 0x0066, 0xae80, 0x080c, 0x670f, 0x006e, 0x0088,
-	0x0046, 0x2011, 0x180c, 0x2224, 0xc484, 0x2412, 0x004e, 0x00c6,
-	0x080c, 0x65ff, 0x1110, 0x080c, 0x680f, 0x8108, 0x1f04, 0x7a20,
-	0x00ce, 0xa87c, 0xd084, 0x1120, 0x080c, 0x1031, 0x00be, 0x0005,
-	0x0126, 0x2091, 0x8000, 0x080c, 0x6c81, 0x012e, 0x00be, 0x0005,
-	0x0126, 0x2091, 0x8000, 0x7007, 0x0001, 0x080c, 0x696e, 0x0580,
-	0x2061, 0x1a71, 0x6100, 0xd184, 0x0178, 0xa888, 0x9084, 0x00ff,
-	0x1550, 0x6000, 0xd084, 0x0520, 0x6004, 0x9005, 0x1538, 0x6003,
-	0x0000, 0x600b, 0x0000, 0x00c8, 0x2011, 0x0001, 0xa890, 0x9005,
-	0x1110, 0x2001, 0x001e, 0x8000, 0x6016, 0xa888, 0x9084, 0x00ff,
-	0x0178, 0x6006, 0xa888, 0x8007, 0x9084, 0x00ff, 0x0148, 0x600a,
-	0xa888, 0x8000, 0x1108, 0xc28d, 0x6202, 0x012e, 0x0804, 0x7c7a,
-	0x012e, 0x0804, 0x7c74, 0x012e, 0x0804, 0x7c6e, 0x012e, 0x0804,
-	0x7c71, 0x0126, 0x2091, 0x8000, 0x7007, 0x0001, 0x080c, 0x696e,
-	0x05e0, 0x2061, 0x1a71, 0x6000, 0xd084, 0x05b8, 0x6204, 0x6308,
-	0xd08c, 0x1530, 0xac78, 0x9484, 0x0003, 0x0170, 0xa988, 0x918c,
-	0x00ff, 0x8001, 0x1120, 0x2100, 0x9210, 0x0620, 0x0028, 0x8001,
-	0x1508, 0x2100, 0x9212, 0x02f0, 0x9484, 0x000c, 0x0188, 0xa988,
-	0x810f, 0x918c, 0x00ff, 0x9082, 0x0004, 0x1120, 0x2100, 0x9318,
-	0x0288, 0x0030, 0x9082, 0x0004, 0x1168, 0x2100, 0x931a, 0x0250,
-	0xa890, 0x9005, 0x0110, 0x8000, 0x6016, 0x6206, 0x630a, 0x012e,
-	0x0804, 0x7c7a, 0x012e, 0x0804, 0x7c77, 0x012e, 0x0804, 0x7c74,
-	0x0126, 0x2091, 0x8000, 0x7007, 0x0001, 0x2061, 0x1a71, 0x6300,
-	0xd38c, 0x1120, 0x6308, 0x8318, 0x0220, 0x630a, 0x012e, 0x0804,
-	0x7c88, 0x012e, 0x0804, 0x7c77, 0x00b6, 0x0126, 0x00c6, 0x2091,
-	0x8000, 0x7007, 0x0001, 0xa87c, 0xd0ac, 0x0148, 0x00c6, 0x2061,
-	0x1a71, 0x6000, 0x9084, 0xfcff, 0x6002, 0x00ce, 0x0440, 0xa888,
-	0x9005, 0x05d8, 0xa88c, 0x9065, 0x0598, 0x2001, 0x1834, 0x2004,
-	0x9005, 0x0118, 0x080c, 0xae92, 0x0068, 0x6017, 0xf400, 0x605b,
-	0x0000, 0xa97c, 0xd1a4, 0x0110, 0xa980, 0x615a, 0x2009, 0x0041,
-	0x080c, 0xaedc, 0xa988, 0x918c, 0xff00, 0x9186, 0x2000, 0x1138,
-	0x0026, 0x900e, 0x2011, 0xfdff, 0x080c, 0x86dd, 0x002e, 0xa87c,
-	0xd0c4, 0x0148, 0x2061, 0x1a71, 0x6000, 0xd08c, 0x1120, 0x6008,
-	0x8000, 0x0208, 0x600a, 0x00ce, 0x012e, 0x00be, 0x0804, 0x7c7a,
-	0x00ce, 0x012e, 0x00be, 0x0804, 0x7c74, 0xa984, 0x9186, 0x002e,
-	0x0d30, 0x9186, 0x002d, 0x0d18, 0x9186, 0x0045, 0x0510, 0x9186,
-	0x002a, 0x1130, 0x2001, 0x180c, 0x200c, 0xc194, 0x2102, 0x08b8,
-	0x9186, 0x0020, 0x0158, 0x9186, 0x0029, 0x1d10, 0xa974, 0x080c,
-	0x65ff, 0x1968, 0xb800, 0xc0e4, 0xb802, 0x0848, 0xa88c, 0x9065,
-	0x09b8, 0x6007, 0x0024, 0x2001, 0x1986, 0x2004, 0x601a, 0x0804,
-	0x7b0f, 0xa88c, 0x9065, 0x0960, 0x00e6, 0xa890, 0x9075, 0x2001,
-	0x1834, 0x2004, 0x9005, 0x0150, 0x080c, 0xae92, 0x8eff, 0x0118,
-	0x2e60, 0x080c, 0xae92, 0x00ee, 0x0804, 0x7b0f, 0x6024, 0xc0dc,
-	0xc0d5, 0x6026, 0x2e60, 0x6007, 0x003a, 0xa8a0, 0x9005, 0x0130,
-	0x6007, 0x003b, 0xa8a4, 0x602e, 0xa8a8, 0x6016, 0x6003, 0x0001,
-	0x080c, 0x90f0, 0x080c, 0x968d, 0x00ee, 0x0804, 0x7b0f, 0x2061,
-	0x1a71, 0x6000, 0xd084, 0x0190, 0xd08c, 0x1904, 0x7c88, 0x0126,
-	0x2091, 0x8000, 0x6204, 0x8210, 0x0220, 0x6206, 0x012e, 0x0804,
-	0x7c88, 0x012e, 0xa883, 0x0016, 0x0804, 0x7c81, 0xa883, 0x0007,
-	0x0804, 0x7c81, 0xa864, 0x8007, 0x9084, 0x00ff, 0x0130, 0x8001,
-	0x1138, 0x7007, 0x0001, 0x0069, 0x0005, 0x080c, 0x780a, 0x0040,
-	0x7007, 0x0003, 0x7012, 0x2900, 0x7016, 0x701a, 0x704b, 0x7bb1,
-	0x0005, 0x00b6, 0x00e6, 0x0126, 0x2091, 0x8000, 0x903e, 0x2061,
-	0x1800, 0x61d0, 0x81ff, 0x1904, 0x7c33, 0x6130, 0xd194, 0x1904,
-	0x7c5d, 0xa878, 0x2070, 0x9e82, 0x1cd0, 0x0a04, 0x7c27, 0x6068,
-	0x9e02, 0x1a04, 0x7c27, 0x7120, 0x9186, 0x0006, 0x1904, 0x7c19,
-	0x7010, 0x905d, 0x0904, 0x7c33, 0xb800, 0xd0e4, 0x1904, 0x7c57,
-	0x2061, 0x1a71, 0x6100, 0x9184, 0x0301, 0x9086, 0x0001, 0x15a0,
-	0x7024, 0xd0dc, 0x1904, 0x7c60, 0xa883, 0x0000, 0xa803, 0x0000,
-	0x2908, 0x7014, 0x9005, 0x1198, 0x7116, 0xa87c, 0xd0f4, 0x1904,
-	0x7c63, 0x080c, 0x56cf, 0xd09c, 0x1118, 0xa87c, 0xc0cc, 0xa87e,
-	0x2e60, 0x080c, 0x85fd, 0x012e, 0x00ee, 0x00be, 0x0005, 0x2048,
-	0xa800, 0x9005, 0x1de0, 0xa902, 0x2148, 0xa87c, 0xd0f4, 0x1904,
-	0x7c63, 0x012e, 0x00ee, 0x00be, 0x0005, 0x012e, 0x00ee, 0xa883,
-	0x0006, 0x00be, 0x0804, 0x7c81, 0xd184, 0x0db8, 0xd1c4, 0x1190,
-	0x00a0, 0xa974, 0x080c, 0x65ff, 0x15d0, 0xb800, 0xd0e4, 0x15b8,
-	0x7120, 0x9186, 0x0007, 0x1118, 0xa883, 0x0002, 0x0490, 0xa883,
-	0x0008, 0x0478, 0xa883, 0x000e, 0x0460, 0xa883, 0x0017, 0x0448,
-	0xa883, 0x0035, 0x0430, 0x080c, 0x56d3, 0xd0fc, 0x01e8, 0xa878,
-	0x2070, 0x9e82, 0x1cd0, 0x02c0, 0x6068, 0x9e02, 0x12a8, 0x7120,
-	0x9186, 0x0006, 0x1188, 0x7010, 0x905d, 0x0170, 0xb800, 0xd0bc,
-	0x0158, 0x2039, 0x0001, 0x7000, 0x9086, 0x0007, 0x1904, 0x7bbd,
-	0x7003, 0x0002, 0x0804, 0x7bbd, 0xa883, 0x0028, 0x0010, 0xa883,
-	0x0029, 0x012e, 0x00ee, 0x00be, 0x0420, 0xa883, 0x002a, 0x0cc8,
-	0xa883, 0x0045, 0x0cb0, 0x2e60, 0x2019, 0x0002, 0x601b, 0x0014,
-	0x080c, 0xe134, 0x012e, 0x00ee, 0x00be, 0x0005, 0x2009, 0x003e,
-	0x0058, 0x2009, 0x0004, 0x0040, 0x2009, 0x0006, 0x0028, 0x2009,
-	0x0016, 0x0010, 0x2009, 0x0001, 0xa884, 0x9084, 0xff00, 0x9105,
-	0xa886, 0x0126, 0x2091, 0x8000, 0x080c, 0x6c81, 0x012e, 0x0005,
-	0x080c, 0x1031, 0x0005, 0x00d6, 0x080c, 0x85f4, 0x00de, 0x0005,
-	0x00d6, 0x00e6, 0x0126, 0x2091, 0x8000, 0x2071, 0x0040, 0x702c,
-	0xd084, 0x01d8, 0x908c, 0x0780, 0x190c, 0x7d72, 0xd09c, 0x11a8,
-	0x2071, 0x1800, 0x70c0, 0x90ea, 0x0020, 0x0278, 0x8001, 0x70c2,
-	0x702c, 0x2048, 0xa800, 0x702e, 0x9006, 0xa802, 0xa806, 0x2071,
-	0x0040, 0x2900, 0x7022, 0x702c, 0x0c28, 0x012e, 0x00ee, 0x00de,
-	0x0005, 0x0006, 0x9084, 0x0780, 0x190c, 0x7d72, 0x000e, 0x0005,
-	0xa898, 0x9084, 0x0003, 0x05a8, 0x080c, 0xae0b, 0x05d8, 0x2900,
-	0x6016, 0xa864, 0x9084, 0x00ff, 0x9086, 0x0035, 0x1138, 0x6008,
-	0xc0fd, 0x600a, 0x2001, 0x196b, 0x2004, 0x0098, 0xa8a0, 0x9084,
-	0x00ff, 0xa99c, 0x918c, 0xff00, 0x9105, 0xa99c, 0x918c, 0x00ff,
-	0x080c, 0x283e, 0x1540, 0x00b6, 0x080c, 0x65ff, 0x2b00, 0x00be,
-	0x1510, 0x6012, 0x6023, 0x0001, 0x2009, 0x0040, 0xa864, 0x9084,
-	0x00ff, 0x9086, 0x0035, 0x0110, 0x2009, 0x0041, 0x080c, 0xaedc,
-	0x0005, 0xa87b, 0x0101, 0x0126, 0x2091, 0x8000, 0x080c, 0x6c81,
-	0x012e, 0x0005, 0xa87b, 0x002c, 0x0126, 0x2091, 0x8000, 0x080c,
-	0x6c81, 0x012e, 0x0005, 0xa87b, 0x0028, 0x0126, 0x2091, 0x8000,
-	0x080c, 0x6c81, 0x012e, 0x080c, 0xae61, 0x0005, 0x00d6, 0x00c6,
-	0x0036, 0x0026, 0x0016, 0x00b6, 0x7007, 0x0001, 0xaa74, 0x9282,
-	0x0004, 0x1a04, 0x7d63, 0xa97c, 0x9188, 0x1000, 0x2104, 0x905d,
-	0xb804, 0xd284, 0x0140, 0x05e8, 0x8007, 0x9084, 0x00ff, 0x9084,
-	0x0006, 0x1108, 0x04b0, 0x2b10, 0x080c, 0xae0b, 0x1118, 0x080c,
-	0xaeaf, 0x05a8, 0x6212, 0xa874, 0x0002, 0x7d41, 0x7d46, 0x7d49,
-	0x7d4f, 0x2019, 0x0002, 0x080c, 0xe522, 0x0060, 0x080c, 0xe4be,
-	0x0048, 0x2019, 0x0002, 0xa980, 0x080c, 0xe4d9, 0x0018, 0xa980,
-	0x080c, 0xe4be, 0x080c, 0xae61, 0xa887, 0x0000, 0x0126, 0x2091,
-	0x8000, 0x080c, 0x6c81, 0x012e, 0x00be, 0x001e, 0x002e, 0x003e,
-	0x00ce, 0x00de, 0x0005, 0xa887, 0x0006, 0x0c80, 0xa887, 0x0002,
-	0x0c68, 0xa887, 0x0005, 0x0c50, 0xa887, 0x0004, 0x0c38, 0xa887,
-	0x0007, 0x0c20, 0x2091, 0x8000, 0x0e04, 0x7d74, 0x0006, 0x0016,
-	0x2001, 0x8003, 0x0006, 0x0804, 0x0dde, 0x2001, 0x1834, 0x2004,
-	0x9005, 0x0005, 0x0005, 0x00f6, 0x2079, 0x0300, 0x2001, 0x0200,
-	0x200c, 0xc1e5, 0xc1dc, 0x2102, 0x2009, 0x0218, 0x210c, 0xd1ec,
-	0x1120, 0x080c, 0x157d, 0x00fe, 0x0005, 0x2001, 0x020d, 0x2003,
-	0x0020, 0x781f, 0x0300, 0x00fe, 0x0005, 0x781c, 0xd08c, 0x0904,
-	0x7df4, 0x68c0, 0x90aa, 0x0005, 0x0a04, 0x840b, 0x7d44, 0x7c40,
-	0x9584, 0x00f6, 0x1510, 0x9484, 0x7000, 0x0140, 0x908a, 0x2000,
-	0x1260, 0x9584, 0x0700, 0x8007, 0x0804, 0x7dfb, 0x7000, 0x9084,
-	0xff00, 0x9086, 0x8100, 0x0da8, 0x00b0, 0x9484, 0x0fff, 0x1130,
-	0x7000, 0x9084, 0xff00, 0x9086, 0x8100, 0x11c0, 0x080c, 0xe9c1,
-	0x080c, 0x8300, 0x7817, 0x0140, 0x00a8, 0x9584, 0x0076, 0x1118,
-	0x080c, 0x835e, 0x19c0, 0xd5a4, 0x0148, 0x0046, 0x0056, 0x080c,
-	0x7e56, 0x080c, 0x2337, 0x005e, 0x004e, 0x0020, 0x080c, 0xe9c1,
-	0x7817, 0x0140, 0x080c, 0x73bc, 0x0168, 0x2001, 0x0111, 0x2004,
-	0xd08c, 0x0140, 0x6893, 0x0000, 0x2001, 0x0110, 0x2003, 0x0008,
-	0x2003, 0x0000, 0x080c, 0x7e37, 0x2001, 0x19f0, 0x2004, 0x9005,
-	0x090c, 0x968d, 0x0005, 0x0002, 0x7e0d, 0x8122, 0x7e04, 0x7e04,
-	0x7e04, 0x7e04, 0x7e04, 0x7e04, 0x7817, 0x0140, 0x2001, 0x19f0,
-	0x2004, 0x9005, 0x090c, 0x968d, 0x0005, 0x7000, 0x908c, 0xff00,
-	0x9194, 0xf000, 0x810f, 0x9484, 0x0fff, 0x6892, 0x9286, 0x2000,
-	0x1150, 0x6800, 0x9086, 0x0001, 0x1118, 0x080c, 0x5730, 0x0070,
-	0x080c, 0x7e76, 0x0058, 0x9286, 0x3000, 0x1118, 0x080c, 0x805d,
-	0x0028, 0x9286, 0x8000, 0x1110, 0x080c, 0x8230, 0x7817, 0x0140,
-	0x2001, 0x19f0, 0x2004, 0x9005, 0x090c, 0x968d, 0x0005, 0x2001,
-	0x1810, 0x2004, 0xd08c, 0x0178, 0x2001, 0x1800, 0x2004, 0x9086,
-	0x0003, 0x1148, 0x0026, 0x0036, 0x2011, 0x8048, 0x2518, 0x080c,
-	0x4b04, 0x003e, 0x002e, 0x0005, 0x0036, 0x0046, 0x0056, 0x00f6,
-	0x2079, 0x0200, 0x2019, 0xfffe, 0x7c30, 0x0050, 0x0036, 0x0046,
-	0x0056, 0x00f6, 0x2079, 0x0200, 0x7d44, 0x7c40, 0x2019, 0xffff,
-	0x2001, 0x1810, 0x2004, 0xd08c, 0x0160, 0x2001, 0x1800, 0x2004,
-	0x9086, 0x0003, 0x1130, 0x0026, 0x2011, 0x8048, 0x080c, 0x4b04,
-	0x002e, 0x00fe, 0x005e, 0x004e, 0x003e, 0x0005, 0x00b6, 0x00c6,
-	0x7010, 0x9084, 0xff00, 0x8007, 0x9096, 0x0001, 0x0120, 0x9096,
-	0x0023, 0x1904, 0x802e, 0x9186, 0x0023, 0x15c0, 0x080c, 0x82c5,
-	0x0904, 0x802e, 0x6120, 0x9186, 0x0001, 0x0150, 0x9186, 0x0004,
-	0x0138, 0x9186, 0x0008, 0x0120, 0x9186, 0x000a, 0x1904, 0x802e,
-	0x7124, 0x610a, 0x7030, 0x908e, 0x0200, 0x1130, 0x2009, 0x0015,
-	0x080c, 0xaedc, 0x0804, 0x802e, 0x908e, 0x0214, 0x0118, 0x908e,
-	0x0210, 0x1130, 0x2009, 0x0015, 0x080c, 0xaedc, 0x0804, 0x802e,
-	0x908e, 0x0100, 0x1904, 0x802e, 0x7034, 0x9005, 0x1904, 0x802e,
-	0x2009, 0x0016, 0x080c, 0xaedc, 0x0804, 0x802e, 0x9186, 0x0022,
-	0x1904, 0x802e, 0x7030, 0x908e, 0x0300, 0x1580, 0x68dc, 0xd0a4,
-	0x0528, 0xc0b5, 0x68de, 0x7100, 0x918c, 0x00ff, 0x697e, 0x7004,
-	0x6882, 0x00f6, 0x2079, 0x0100, 0x79e6, 0x78ea, 0x0006, 0x9084,
-	0x00ff, 0x0016, 0x2008, 0x080c, 0x2887, 0x7932, 0x7936, 0x001e,
-	0x000e, 0x00fe, 0x080c, 0x283e, 0x695e, 0x703c, 0x00e6, 0x2071,
-	0x0140, 0x7086, 0x2071, 0x1800, 0x70b6, 0x00ee, 0x7034, 0x9005,
-	0x1904, 0x802e, 0x2009, 0x0017, 0x0804, 0x7fde, 0x908e, 0x0400,
-	0x1190, 0x7034, 0x9005, 0x1904, 0x802e, 0x080c, 0x73bc, 0x0120,
-	0x2009, 0x001d, 0x0804, 0x7fde, 0x68dc, 0xc0a5, 0x68de, 0x2009,
-	0x0030, 0x0804, 0x7fde, 0x908e, 0x0500, 0x1140, 0x7034, 0x9005,
-	0x1904, 0x802e, 0x2009, 0x0018, 0x0804, 0x7fde, 0x908e, 0x2010,
-	0x1120, 0x2009, 0x0019, 0x0804, 0x7fde, 0x908e, 0x2110, 0x1120,
-	0x2009, 0x001a, 0x0804, 0x7fde, 0x908e, 0x5200, 0x1140, 0x7034,
-	0x9005, 0x1904, 0x802e, 0x2009, 0x001b, 0x0804, 0x7fde, 0x908e,
-	0x5000, 0x1140, 0x7034, 0x9005, 0x1904, 0x802e, 0x2009, 0x001c,
-	0x0804, 0x7fde, 0x908e, 0x1300, 0x1120, 0x2009, 0x0034, 0x0804,
-	0x7fde, 0x908e, 0x1200, 0x1140, 0x7034, 0x9005, 0x1904, 0x802e,
-	0x2009, 0x0024, 0x0804, 0x7fde, 0x908c, 0xff00, 0x918e, 0x2400,
-	0x1170, 0x2009, 0x002d, 0x2001, 0x1810, 0x2004, 0xd09c, 0x0904,
-	0x7fde, 0x080c, 0xd905, 0x1904, 0x802e, 0x0804, 0x7fdc, 0x908c,
-	0xff00, 0x918e, 0x5300, 0x1120, 0x2009, 0x002a, 0x0804, 0x7fde,
-	0x908e, 0x0f00, 0x1120, 0x2009, 0x0020, 0x0804, 0x7fde, 0x908e,
-	0x6104, 0x1530, 0x2029, 0x0205, 0x2011, 0x026d, 0x8208, 0x2204,
-	0x9082, 0x0004, 0x8004, 0x8004, 0x20a8, 0x2011, 0x8015, 0x211c,
-	0x8108, 0x0046, 0x2124, 0x080c, 0x4b04, 0x004e, 0x8108, 0x0f04,
-	0x7f92, 0x9186, 0x0280, 0x1d88, 0x2504, 0x8000, 0x202a, 0x2009,
-	0x0260, 0x0c58, 0x202b, 0x0000, 0x2009, 0x0023, 0x0804, 0x7fde,
-	0x908e, 0x6000, 0x1120, 0x2009, 0x003f, 0x0804, 0x7fde, 0x908e,
-	0x5400, 0x1138, 0x080c, 0x83bb, 0x1904, 0x802e, 0x2009, 0x0046,
-	0x04a8, 0x908e, 0x5500, 0x1148, 0x080c, 0x83e3, 0x1118, 0x2009,
-	0x0041, 0x0460, 0x2009, 0x0042, 0x0448, 0x908e, 0x7800, 0x1118,
-	0x2009, 0x0045, 0x0418, 0x908e, 0x1000, 0x1118, 0x2009, 0x004e,
-	0x00e8, 0x908e, 0x6300, 0x1118, 0x2009, 0x004a, 0x00b8, 0x908c,
-	0xff00, 0x918e, 0x5600, 0x1118, 0x2009, 0x004f, 0x0078, 0x908c,
-	0xff00, 0x918e, 0x5700, 0x1118, 0x2009, 0x0050, 0x0038, 0x2009,
-	0x001d, 0x6838, 0xd0d4, 0x0110, 0x2009, 0x004c, 0x0016, 0x2011,
-	0x0263, 0x2204, 0x8211, 0x220c, 0x080c, 0x283e, 0x1904, 0x8031,
-	0x080c, 0x659e, 0x1904, 0x8031, 0xbe12, 0xbd16, 0x001e, 0x0016,
-	0x080c, 0x73bc, 0x01c0, 0x68dc, 0xd08c, 0x1148, 0x7000, 0x9084,
-	0x00ff, 0x1188, 0x7004, 0x9084, 0xff00, 0x1168, 0x0040, 0x687c,
-	0x9606, 0x1148, 0x6880, 0x9506, 0x9084, 0xff00, 0x1120, 0x9584,
-	0x00ff, 0xb8c2, 0x0080, 0xb8c0, 0x9005, 0x1168, 0x9186, 0x0046,
-	0x1150, 0x687c, 0x9606, 0x1138, 0x6880, 0x9506, 0x9084, 0xff00,
-	0x1110, 0x001e, 0x0098, 0x080c, 0xae0b, 0x01a8, 0x2b08, 0x6112,
-	0x6023, 0x0004, 0x7120, 0x610a, 0x001e, 0x9186, 0x004c, 0x1110,
-	0x6023, 0x000a, 0x0016, 0x001e, 0x080c, 0xaedc, 0x00ce, 0x00be,
-	0x0005, 0x001e, 0x0cd8, 0x2001, 0x180e, 0x2004, 0xd0ec, 0x0120,
-	0x2011, 0x8049, 0x080c, 0x4b04, 0x080c, 0xaeaf, 0x0d90, 0x2b08,
-	0x6112, 0x6023, 0x0004, 0x7120, 0x610a, 0x001e, 0x0016, 0x9186,
-	0x0017, 0x0118, 0x9186, 0x0030, 0x1128, 0x6007, 0x0009, 0x6017,
-	0x2900, 0x0020, 0x6007, 0x0051, 0x6017, 0x0000, 0x602f, 0x0009,
-	0x6003, 0x0001, 0x080c, 0x9138, 0x08a0, 0x080c, 0x32e3, 0x1140,
-	0x7010, 0x9084, 0xff00, 0x8007, 0x908e, 0x0008, 0x1108, 0x0009,
-	0x0005, 0x00b6, 0x00c6, 0x0046, 0x7000, 0x908c, 0xff00, 0x810f,
-	0x9186, 0x0033, 0x11e8, 0x080c, 0x82c5, 0x0904, 0x80ba, 0x7124,
-	0x610a, 0x7030, 0x908e, 0x0200, 0x1140, 0x7034, 0x9005, 0x15d0,
-	0x2009, 0x0015, 0x080c, 0xaedc, 0x04a8, 0x908e, 0x0100, 0x1590,
-	0x7034, 0x9005, 0x1578, 0x2009, 0x0016, 0x080c, 0xaedc, 0x0450,
-	0x9186, 0x0032, 0x1538, 0x7030, 0x908e, 0x1400, 0x1518, 0x2009,
-	0x0038, 0x0016, 0x2011, 0x0263, 0x2204, 0x8211, 0x220c, 0x080c,
-	0x283e, 0x11b8, 0x080c, 0x659e, 0x11a0, 0xbe12, 0xbd16, 0x080c,
-	0xae0b, 0x0178, 0x2b08, 0x6112, 0x080c, 0xcfaa, 0x6023, 0x0004,
-	0x7120, 0x610a, 0x001e, 0x080c, 0xaedc, 0x080c, 0x968d, 0x0010,
-	0x00ce, 0x001e, 0x004e, 0x00ce, 0x00be, 0x0005, 0x00b6, 0x0046,
-	0x00e6, 0x00d6, 0x2028, 0x2130, 0x9696, 0x00ff, 0x11b8, 0x9592,
-	0xfffc, 0x02a0, 0x9596, 0xfffd, 0x1120, 0x2009, 0x007f, 0x0804,
-	0x811c, 0x9596, 0xfffe, 0x1120, 0x2009, 0x007e, 0x0804, 0x811c,
-	0x9596, 0xfffc, 0x1118, 0x2009, 0x0080, 0x04f0, 0x2011, 0x0000,
-	0x2019, 0x1837, 0x231c, 0xd3ac, 0x0130, 0x9026, 0x20a9, 0x0800,
-	0x2071, 0x1000, 0x0030, 0x2021, 0x0081, 0x20a9, 0x077f, 0x2071,
-	0x1081, 0x2e1c, 0x93dd, 0x0000, 0x1140, 0x82ff, 0x11d0, 0x9496,
-	0x00ff, 0x01b8, 0x2410, 0xc2fd, 0x00a0, 0xbf10, 0x2600, 0x9706,
-	0xb814, 0x1120, 0x9546, 0x1110, 0x2408, 0x00b0, 0x9745, 0x1148,
-	0x94c6, 0x007e, 0x0130, 0x94c6, 0x007f, 0x0118, 0x94c6, 0x0080,
-	0x1d20, 0x8420, 0x8e70, 0x1f04, 0x80f1, 0x82ff, 0x1118, 0x9085,
-	0x0001, 0x0018, 0xc2fc, 0x2208, 0x9006, 0x00de, 0x00ee, 0x004e,
-	0x00be, 0x0005, 0x7000, 0x908c, 0xff00, 0x810f, 0x9184, 0x000f,
-	0x0002, 0x8139, 0x8139, 0x8139, 0x82d7, 0x8139, 0x8142, 0x816d,
-	0x81fb, 0x8139, 0x8139, 0x8139, 0x8139, 0x8139, 0x8139, 0x8139,
-	0x8139, 0x7817, 0x0140, 0x2001, 0x19f0, 0x2004, 0x9005, 0x090c,
-	0x968d, 0x0005, 0x00b6, 0x7110, 0xd1bc, 0x01e8, 0x7120, 0x2160,
-	0x9c8c, 0x0007, 0x11c0, 0x9c8a, 0x1cd0, 0x02a8, 0x6868, 0x9c02,
-	0x1290, 0x7008, 0x9084, 0x00ff, 0x6110, 0x2158, 0xb910, 0x9106,
-	0x1150, 0x700c, 0xb914, 0x9106, 0x1130, 0x7124, 0x610a, 0x2009,
-	0x0046, 0x080c, 0xaedc, 0x7817, 0x0140, 0x2001, 0x19f0, 0x2004,
-	0x9005, 0x090c, 0x968d, 0x00be, 0x0005, 0x00b6, 0x00c6, 0x9484,
-	0x0fff, 0x0904, 0x81d1, 0x7110, 0xd1bc, 0x1904, 0x81d1, 0x7108,
-	0x700c, 0x2028, 0x918c, 0x00ff, 0x2130, 0x9094, 0xff00, 0x15b0,
-	0x81ff, 0x15a0, 0x9080, 0x3325, 0x200d, 0x918c, 0xff00, 0x810f,
-	0x2001, 0x0080, 0x9106, 0x0904, 0x81d1, 0x080c, 0x659e, 0x1904,
-	0x81d1, 0xbe12, 0xbd16, 0xb800, 0xd0ec, 0x15d8, 0xba04, 0x9294,
-	0xff00, 0x9286, 0x0600, 0x11a0, 0x080c, 0xae0b, 0x05e8, 0x2b08,
-	0x7028, 0x604a, 0x702c, 0x6046, 0x6112, 0x6023, 0x0006, 0x7120,
-	0x610a, 0x7130, 0x6156, 0x2009, 0x0044, 0x080c, 0xdb63, 0x0408,
-	0x080c, 0x6972, 0x1138, 0xb807, 0x0606, 0x0c30, 0x190c, 0x80be,
-	0x11c0, 0x0898, 0x080c, 0xae0b, 0x2b08, 0x0198, 0x6112, 0x6023,
-	0x0004, 0x7120, 0x610a, 0x9286, 0x0400, 0x1118, 0x6007, 0x0005,
-	0x0010, 0x6007, 0x0001, 0x6003, 0x0001, 0x080c, 0x9138, 0x080c,
-	0x968d, 0x7817, 0x0140, 0x2001, 0x19f0, 0x2004, 0x9005, 0x090c,
-	0x968d, 0x00ce, 0x00be, 0x0005, 0x2001, 0x180e, 0x2004, 0xd0ec,
-	0x0120, 0x2011, 0x8049, 0x080c, 0x4b04, 0x080c, 0xaeaf, 0x0d48,
-	0x2b08, 0x6112, 0x6023, 0x0006, 0x7120, 0x610a, 0x7130, 0x6156,
-	0x6017, 0xf300, 0x6003, 0x0001, 0x6007, 0x0041, 0x080c, 0x90f0,
-	0x080c, 0x968d, 0x08b0, 0x00b6, 0x7110, 0xd1bc, 0x01e8, 0x7020,
-	0x2060, 0x9c84, 0x0007, 0x11c0, 0x9c82, 0x1cd0, 0x02a8, 0x6868,
+	0x0008, 0x6886, 0x2001, 0x196c, 0x2004, 0x080c, 0x28b4, 0x60e2,
+	0x2001, 0x180c, 0x200c, 0xc1b4, 0x2102, 0x00ee, 0x00de, 0x00ce,
+	0x003e, 0x002e, 0x001e, 0x015e, 0x0005, 0x0156, 0x0016, 0x0026,
+	0x0036, 0x0046, 0x00c6, 0x00e6, 0x2061, 0x0100, 0x2071, 0x1800,
+	0x080c, 0xd243, 0x1904, 0x767b, 0x7130, 0xd184, 0x1170, 0x080c,
+	0x331b, 0x0138, 0xc18d, 0x7132, 0x2011, 0x1848, 0x2214, 0xd2ac,
+	0x1120, 0x7030, 0xd08c, 0x0904, 0x767b, 0x2011, 0x1848, 0x220c,
+	0xd1a4, 0x0538, 0x0016, 0x2019, 0x000e, 0x080c, 0xe543, 0x0156,
+	0x00b6, 0x20a9, 0x007f, 0x900e, 0x9186, 0x007e, 0x01a0, 0x9186,
+	0x0080, 0x0188, 0x080c, 0x6608, 0x1170, 0x2120, 0x9006, 0x0016,
+	0x2009, 0x000e, 0x080c, 0xe5cf, 0x2009, 0x0001, 0x2011, 0x0100,
+	0x080c, 0x86c6, 0x001e, 0x8108, 0x1f04, 0x7644, 0x00be, 0x015e,
+	0x001e, 0xd1ac, 0x1148, 0x0016, 0x2009, 0x0002, 0x2019, 0x0004,
+	0x080c, 0x318c, 0x001e, 0x0078, 0x0156, 0x00b6, 0x20a9, 0x007f,
+	0x900e, 0x080c, 0x6608, 0x1110, 0x080c, 0x603d, 0x8108, 0x1f04,
+	0x7671, 0x00be, 0x015e, 0x080c, 0x1ad5, 0x080c, 0xade2, 0x60e3,
+	0x0000, 0x080c, 0x6023, 0x080c, 0x72d7, 0x00ee, 0x00ce, 0x004e,
+	0x003e, 0x002e, 0x001e, 0x015e, 0x0005, 0x2001, 0x197c, 0x2003,
+	0x0001, 0x0005, 0x2001, 0x197c, 0x2003, 0x0000, 0x0005, 0x2001,
+	0x197b, 0x2003, 0xaaaa, 0x0005, 0x2001, 0x197b, 0x2003, 0x0000,
+	0x0005, 0x2071, 0x18fa, 0x7003, 0x0000, 0x7007, 0x0000, 0x080c,
+	0x1018, 0x090c, 0x0dd5, 0xa8ab, 0xdcb0, 0x2900, 0x704e, 0x080c,
+	0x1018, 0x090c, 0x0dd5, 0xa8ab, 0xdcb0, 0x2900, 0x7052, 0xa867,
+	0x0000, 0xa86b, 0x0001, 0xa89f, 0x0000, 0x0005, 0x00e6, 0x2071,
+	0x0040, 0x6848, 0x9005, 0x1118, 0x9085, 0x0001, 0x04b0, 0x6840,
+	0x9005, 0x0150, 0x04a1, 0x6a50, 0x9200, 0x7002, 0x6854, 0x9101,
+	0x7006, 0x9006, 0x7012, 0x7016, 0x6850, 0x7002, 0x6854, 0x7006,
+	0x6858, 0x700a, 0x685c, 0x700e, 0x6840, 0x9005, 0x1110, 0x7012,
+	0x7016, 0x6848, 0x701a, 0x701c, 0x9085, 0x0040, 0x701e, 0x2001,
+	0x0019, 0x7036, 0x702b, 0x0001, 0x2001, 0x0004, 0x200c, 0x918c,
+	0xfff7, 0x918d, 0x8000, 0x2102, 0x00d6, 0x2069, 0x18fa, 0x6807,
+	0x0001, 0x00de, 0x080c, 0x7c79, 0x9006, 0x00ee, 0x0005, 0x900e,
+	0x0156, 0x20a9, 0x0006, 0x8003, 0x2011, 0x0100, 0x2214, 0x9296,
+	0x0008, 0x1110, 0x818d, 0x0010, 0x81f5, 0x3e08, 0x1f04, 0x7703,
+	0x015e, 0x0005, 0x2079, 0x0040, 0x2071, 0x18fa, 0x7004, 0x0002,
+	0x7722, 0x7723, 0x775a, 0x77b5, 0x78c5, 0x7720, 0x7720, 0x78ef,
+	0x080c, 0x0dd5, 0x0005, 0x2079, 0x0040, 0x782c, 0x908c, 0x0780,
+	0x190c, 0x7d5b, 0xd0a4, 0x01f0, 0x7824, 0x2048, 0x9006, 0xa802,
+	0xa806, 0xa864, 0x9084, 0x00ff, 0x908a, 0x0040, 0x0608, 0x00b8,
+	0x2001, 0x1800, 0x200c, 0x9186, 0x0003, 0x1160, 0x7104, 0x9186,
+	0x0004, 0x0140, 0x9186, 0x0007, 0x0128, 0x9186, 0x0003, 0x19e8,
+	0x080c, 0x77b5, 0x782c, 0xd09c, 0x090c, 0x7c79, 0x0005, 0x9082,
+	0x005a, 0x1218, 0x2100, 0x003b, 0x0c18, 0x080c, 0x77eb, 0x0c90,
+	0x00e3, 0x08f0, 0x0005, 0x77eb, 0x77eb, 0x77eb, 0x77eb, 0x77eb,
+	0x77eb, 0x77eb, 0x77eb, 0x780d, 0x77eb, 0x77eb, 0x77eb, 0x77eb,
+	0x77eb, 0x77eb, 0x77eb, 0x77eb, 0x77eb, 0x77eb, 0x77eb, 0x77eb,
+	0x77eb, 0x77eb, 0x77eb, 0x77eb, 0x77eb, 0x77eb, 0x77eb, 0x77f7,
+	0x77eb, 0x79e0, 0x77eb, 0x77eb, 0x77eb, 0x780d, 0x77eb, 0x77f7,
+	0x7a21, 0x7a62, 0x7aa9, 0x7abd, 0x77eb, 0x77eb, 0x780d, 0x77f7,
+	0x7821, 0x77eb, 0x7899, 0x7b68, 0x7b83, 0x77eb, 0x780d, 0x77eb,
+	0x7821, 0x77eb, 0x77eb, 0x788f, 0x7b83, 0x77eb, 0x77eb, 0x77eb,
+	0x77eb, 0x77eb, 0x77eb, 0x77eb, 0x77eb, 0x77eb, 0x7835, 0x77eb,
+	0x77eb, 0x77eb, 0x77eb, 0x77eb, 0x77eb, 0x77eb, 0x77eb, 0x77eb,
+	0x7cff, 0x77eb, 0x7ca9, 0x77eb, 0x7ca9, 0x77eb, 0x784a, 0x77eb,
+	0x77eb, 0x77eb, 0x77eb, 0x77eb, 0x77eb, 0x2079, 0x0040, 0x7004,
+	0x9086, 0x0003, 0x1198, 0x782c, 0x080c, 0x7ca2, 0xd0a4, 0x0170,
+	0x7824, 0x2048, 0x9006, 0xa802, 0xa806, 0xa864, 0x9084, 0x00ff,
+	0x908a, 0x001a, 0x1210, 0x002b, 0x0c50, 0x00e9, 0x080c, 0x7c79,
+	0x0005, 0x77eb, 0x77f7, 0x79cc, 0x77eb, 0x77f7, 0x77eb, 0x77f7,
+	0x77f7, 0x77eb, 0x77f7, 0x79cc, 0x77f7, 0x77f7, 0x77f7, 0x77f7,
+	0x77f7, 0x77eb, 0x77f7, 0x79cc, 0x77eb, 0x77eb, 0x77f7, 0x77eb,
+	0x77eb, 0x77eb, 0x77f7, 0x00e6, 0x2071, 0x18fa, 0x2009, 0x0400,
+	0x0071, 0x00ee, 0x0005, 0x2009, 0x1000, 0x0049, 0x0005, 0x2009,
+	0x2000, 0x0029, 0x0005, 0x2009, 0x0800, 0x0009, 0x0005, 0x7007,
+	0x0001, 0xa868, 0x9084, 0x00ff, 0x9105, 0xa86a, 0x0126, 0x2091,
+	0x8000, 0x080c, 0x6c86, 0x012e, 0x0005, 0xa864, 0x8007, 0x9084,
+	0x00ff, 0x0d08, 0x8001, 0x1120, 0x7007, 0x0001, 0x0804, 0x796e,
+	0x7007, 0x0003, 0x7012, 0x2900, 0x7016, 0x701a, 0x704b, 0x796e,
+	0x0005, 0xa864, 0x8007, 0x9084, 0x00ff, 0x0968, 0x8001, 0x1120,
+	0x7007, 0x0001, 0x0804, 0x7989, 0x7007, 0x0003, 0x7012, 0x2900,
+	0x7016, 0x701a, 0x704b, 0x7989, 0x0005, 0xa864, 0x8007, 0x9084,
+	0x00ff, 0x0904, 0x77f3, 0x8001, 0x1120, 0x7007, 0x0001, 0x0804,
+	0x79a5, 0x7007, 0x0003, 0x7012, 0x2900, 0x7016, 0x701a, 0x704b,
+	0x79a5, 0x0005, 0xa864, 0x8007, 0x9084, 0x00ff, 0x9086, 0x0001,
+	0x1904, 0x77f3, 0x7007, 0x0001, 0x2009, 0x1834, 0x210c, 0x81ff,
+	0x11a8, 0xa868, 0x9084, 0x00ff, 0xa86a, 0xa883, 0x0000, 0x080c,
+	0x62b7, 0x1108, 0x0005, 0x0126, 0x2091, 0x8000, 0xa867, 0x0139,
+	0xa87a, 0xa982, 0x080c, 0x6c86, 0x012e, 0x0ca0, 0xa994, 0x9186,
+	0x0071, 0x0d38, 0x9186, 0x0064, 0x0d20, 0x9186, 0x007c, 0x0d08,
+	0x9186, 0x0028, 0x09f0, 0x9186, 0x0038, 0x09d8, 0x9186, 0x0078,
+	0x09c0, 0x9186, 0x005f, 0x09a8, 0x9186, 0x0056, 0x0990, 0xa897,
+	0x4005, 0xa89b, 0x0001, 0x2001, 0x0030, 0x900e, 0x08a0, 0xa87c,
+	0x9084, 0x00c0, 0x9086, 0x00c0, 0x1120, 0x7007, 0x0001, 0x0804,
+	0x7b9a, 0x2900, 0x7016, 0x701a, 0x20a9, 0x0004, 0xa860, 0x20e0,
+	0xa85c, 0x9080, 0x0030, 0x2098, 0x7050, 0x2040, 0xa060, 0x20e8,
+	0xa05c, 0x9080, 0x0023, 0x20a0, 0x4003, 0xa888, 0x7012, 0x9082,
+	0x0401, 0x1a04, 0x77fb, 0xaab4, 0x928a, 0x0002, 0x1a04, 0x77fb,
+	0x82ff, 0x1138, 0xa8b8, 0xa9bc, 0x9105, 0x0118, 0x2001, 0x792c,
+	0x0018, 0x9280, 0x7922, 0x2005, 0x7056, 0x7010, 0x9015, 0x0904,
+	0x790d, 0x080c, 0x1018, 0x1118, 0x7007, 0x0004, 0x0005, 0x2900,
+	0x7022, 0x7054, 0x2060, 0xe000, 0xa866, 0x7050, 0x2040, 0xa95c,
+	0xe004, 0x9100, 0xa076, 0xa860, 0xa072, 0xe008, 0x920a, 0x1210,
+	0x900e, 0x2200, 0x7112, 0xe20c, 0x8003, 0x800b, 0x9296, 0x0004,
+	0x0108, 0x9108, 0xa17a, 0x810b, 0xa17e, 0x080c, 0x10e9, 0xa06c,
+	0x908e, 0x0100, 0x0170, 0x9086, 0x0200, 0x0118, 0x7007, 0x0007,
+	0x0005, 0x7020, 0x2048, 0x080c, 0x1031, 0x7014, 0x2048, 0x0804,
+	0x77fb, 0x7020, 0x2048, 0x7018, 0xa802, 0xa807, 0x0000, 0x2908,
+	0x2048, 0xa906, 0x711a, 0x0804, 0x78c5, 0x7014, 0x2048, 0x7007,
+	0x0001, 0xa8b4, 0x9005, 0x1128, 0xa8b8, 0xa9bc, 0x9105, 0x0108,
+	0x00b9, 0xa864, 0x9084, 0x00ff, 0x9086, 0x001e, 0x0904, 0x7b9a,
+	0x0804, 0x796e, 0x7924, 0x7928, 0x0002, 0x001d, 0x0007, 0x0004,
+	0x000a, 0x001b, 0x0005, 0x0006, 0x000a, 0x001d, 0x0005, 0x0004,
+	0x0076, 0x0066, 0xafb8, 0xaebc, 0xa804, 0x2050, 0xb0c0, 0xb0e2,
+	0xb0bc, 0xb0de, 0xb0b8, 0xb0d2, 0xb0b4, 0xb0ce, 0xb6da, 0xb7d6,
+	0xb0b0, 0xb0ca, 0xb0ac, 0xb0c6, 0xb0a8, 0xb0ba, 0xb0a4, 0xb0b6,
+	0xb6c2, 0xb7be, 0xb0a0, 0xb0b2, 0xb09c, 0xb0ae, 0xb098, 0xb0a2,
+	0xb094, 0xb09e, 0xb6aa, 0xb7a6, 0xb090, 0xb09a, 0xb08c, 0xb096,
+	0xb088, 0xb08a, 0xb084, 0xb086, 0xb692, 0xb78e, 0xb080, 0xb082,
+	0xb07c, 0xb07e, 0xb078, 0xb072, 0xb074, 0xb06e, 0xb67a, 0xb776,
+	0xb004, 0x9055, 0x1958, 0x006e, 0x007e, 0x0005, 0x2009, 0x1834,
+	0x210c, 0x81ff, 0x1178, 0x080c, 0x60b7, 0x1108, 0x0005, 0x080c,
+	0x6eb9, 0x0126, 0x2091, 0x8000, 0x080c, 0xce3e, 0x080c, 0x6c86,
+	0x012e, 0x0ca0, 0x080c, 0xd243, 0x1d70, 0x2001, 0x0028, 0x900e,
+	0x0c70, 0x2009, 0x1834, 0x210c, 0x81ff, 0x1188, 0xa888, 0x9005,
+	0x0188, 0xa883, 0x0000, 0x080c, 0x6147, 0x1108, 0x0005, 0xa87a,
+	0x0126, 0x2091, 0x8000, 0x080c, 0x6c86, 0x012e, 0x0cb8, 0x2001,
+	0x0028, 0x0ca8, 0x2001, 0x0000, 0x0c90, 0x2009, 0x1834, 0x210c,
+	0x81ff, 0x11d8, 0xa888, 0x9005, 0x01e0, 0xa883, 0x0000, 0xa87c,
+	0xd0f4, 0x0120, 0x080c, 0x6219, 0x1138, 0x0005, 0x9006, 0xa87a,
+	0x080c, 0x6194, 0x1108, 0x0005, 0x0126, 0x2091, 0x8000, 0xa87a,
+	0xa982, 0x080c, 0x6c86, 0x012e, 0x0cb0, 0x2001, 0x0028, 0x900e,
+	0x0c98, 0x2001, 0x0000, 0x0c80, 0x7018, 0xa802, 0x2908, 0x2048,
+	0xa906, 0x711a, 0x7010, 0x8001, 0x7012, 0x0118, 0x7007, 0x0003,
+	0x0030, 0x7014, 0x2048, 0x7007, 0x0001, 0x7048, 0x080f, 0x0005,
+	0x00b6, 0x7007, 0x0001, 0xa974, 0xa878, 0x9084, 0x00ff, 0x9096,
+	0x0004, 0x0540, 0x20a9, 0x0001, 0x9096, 0x0001, 0x0190, 0x900e,
+	0x20a9, 0x0800, 0x9096, 0x0002, 0x0160, 0x9005, 0x11d8, 0xa974,
+	0x080c, 0x6608, 0x11b8, 0x0066, 0xae80, 0x080c, 0x6718, 0x006e,
+	0x0088, 0x0046, 0x2011, 0x180c, 0x2224, 0xc484, 0x2412, 0x004e,
+	0x00c6, 0x080c, 0x6608, 0x1110, 0x080c, 0x6818, 0x8108, 0x1f04,
+	0x7a09, 0x00ce, 0xa87c, 0xd084, 0x1120, 0x080c, 0x1031, 0x00be,
+	0x0005, 0x0126, 0x2091, 0x8000, 0x080c, 0x6c86, 0x012e, 0x00be,
+	0x0005, 0x0126, 0x2091, 0x8000, 0x7007, 0x0001, 0x080c, 0x6977,
+	0x0580, 0x2061, 0x1a70, 0x6100, 0xd184, 0x0178, 0xa888, 0x9084,
+	0x00ff, 0x1550, 0x6000, 0xd084, 0x0520, 0x6004, 0x9005, 0x1538,
+	0x6003, 0x0000, 0x600b, 0x0000, 0x00c8, 0x2011, 0x0001, 0xa890,
+	0x9005, 0x1110, 0x2001, 0x001e, 0x8000, 0x6016, 0xa888, 0x9084,
+	0x00ff, 0x0178, 0x6006, 0xa888, 0x8007, 0x9084, 0x00ff, 0x0148,
+	0x600a, 0xa888, 0x8000, 0x1108, 0xc28d, 0x6202, 0x012e, 0x0804,
+	0x7c63, 0x012e, 0x0804, 0x7c5d, 0x012e, 0x0804, 0x7c57, 0x012e,
+	0x0804, 0x7c5a, 0x0126, 0x2091, 0x8000, 0x7007, 0x0001, 0x080c,
+	0x6977, 0x05e0, 0x2061, 0x1a70, 0x6000, 0xd084, 0x05b8, 0x6204,
+	0x6308, 0xd08c, 0x1530, 0xac78, 0x9484, 0x0003, 0x0170, 0xa988,
+	0x918c, 0x00ff, 0x8001, 0x1120, 0x2100, 0x9210, 0x0620, 0x0028,
+	0x8001, 0x1508, 0x2100, 0x9212, 0x02f0, 0x9484, 0x000c, 0x0188,
+	0xa988, 0x810f, 0x918c, 0x00ff, 0x9082, 0x0004, 0x1120, 0x2100,
+	0x9318, 0x0288, 0x0030, 0x9082, 0x0004, 0x1168, 0x2100, 0x931a,
+	0x0250, 0xa890, 0x9005, 0x0110, 0x8000, 0x6016, 0x6206, 0x630a,
+	0x012e, 0x0804, 0x7c63, 0x012e, 0x0804, 0x7c60, 0x012e, 0x0804,
+	0x7c5d, 0x0126, 0x2091, 0x8000, 0x7007, 0x0001, 0x2061, 0x1a70,
+	0x6300, 0xd38c, 0x1120, 0x6308, 0x8318, 0x0220, 0x630a, 0x012e,
+	0x0804, 0x7c71, 0x012e, 0x0804, 0x7c60, 0x00b6, 0x0126, 0x00c6,
+	0x2091, 0x8000, 0x7007, 0x0001, 0xa87c, 0xd0ac, 0x0148, 0x00c6,
+	0x2061, 0x1a70, 0x6000, 0x9084, 0xfcff, 0x6002, 0x00ce, 0x0440,
+	0xa888, 0x9005, 0x05d8, 0xa88c, 0x9065, 0x0598, 0x2001, 0x1834,
+	0x2004, 0x9005, 0x0118, 0x080c, 0xaea2, 0x0068, 0x6017, 0xf400,
+	0x605b, 0x0000, 0xa97c, 0xd1a4, 0x0110, 0xa980, 0x615a, 0x2009,
+	0x0041, 0x080c, 0xaeec, 0xa988, 0x918c, 0xff00, 0x9186, 0x2000,
+	0x1138, 0x0026, 0x900e, 0x2011, 0xfdff, 0x080c, 0x86c6, 0x002e,
+	0xa87c, 0xd0c4, 0x0148, 0x2061, 0x1a70, 0x6000, 0xd08c, 0x1120,
+	0x6008, 0x8000, 0x0208, 0x600a, 0x00ce, 0x012e, 0x00be, 0x0804,
+	0x7c63, 0x00ce, 0x012e, 0x00be, 0x0804, 0x7c5d, 0xa984, 0x9186,
+	0x002e, 0x0d30, 0x9186, 0x002d, 0x0d18, 0x9186, 0x0045, 0x0510,
+	0x9186, 0x002a, 0x1130, 0x2001, 0x180c, 0x200c, 0xc194, 0x2102,
+	0x08b8, 0x9186, 0x0020, 0x0158, 0x9186, 0x0029, 0x1d10, 0xa974,
+	0x080c, 0x6608, 0x1968, 0xb800, 0xc0e4, 0xb802, 0x0848, 0xa88c,
+	0x9065, 0x09b8, 0x6007, 0x0024, 0x2001, 0x1985, 0x2004, 0x601a,
+	0x0804, 0x7af8, 0xa88c, 0x9065, 0x0960, 0x00e6, 0xa890, 0x9075,
+	0x2001, 0x1834, 0x2004, 0x9005, 0x0150, 0x080c, 0xaea2, 0x8eff,
+	0x0118, 0x2e60, 0x080c, 0xaea2, 0x00ee, 0x0804, 0x7af8, 0x6024,
+	0xc0dc, 0xc0d5, 0x6026, 0x2e60, 0x6007, 0x003a, 0xa8a0, 0x9005,
+	0x0130, 0x6007, 0x003b, 0xa8a4, 0x602e, 0xa8a8, 0x6016, 0x6003,
+	0x0001, 0x080c, 0x90d9, 0x080c, 0x9687, 0x00ee, 0x0804, 0x7af8,
+	0x2061, 0x1a70, 0x6000, 0xd084, 0x0190, 0xd08c, 0x1904, 0x7c71,
+	0x0126, 0x2091, 0x8000, 0x6204, 0x8210, 0x0220, 0x6206, 0x012e,
+	0x0804, 0x7c71, 0x012e, 0xa883, 0x0016, 0x0804, 0x7c6a, 0xa883,
+	0x0007, 0x0804, 0x7c6a, 0xa864, 0x8007, 0x9084, 0x00ff, 0x0130,
+	0x8001, 0x1138, 0x7007, 0x0001, 0x0069, 0x0005, 0x080c, 0x77f3,
+	0x0040, 0x7007, 0x0003, 0x7012, 0x2900, 0x7016, 0x701a, 0x704b,
+	0x7b9a, 0x0005, 0x00b6, 0x00e6, 0x0126, 0x2091, 0x8000, 0x903e,
+	0x2061, 0x1800, 0x61d0, 0x81ff, 0x1904, 0x7c1c, 0x6130, 0xd194,
+	0x1904, 0x7c46, 0xa878, 0x2070, 0x9e82, 0x1cd0, 0x0a04, 0x7c10,
+	0x6068, 0x9e02, 0x1a04, 0x7c10, 0x7120, 0x9186, 0x0006, 0x1904,
+	0x7c02, 0x7010, 0x905d, 0x0904, 0x7c1c, 0xb800, 0xd0e4, 0x1904,
+	0x7c40, 0x2061, 0x1a70, 0x6100, 0x9184, 0x0301, 0x9086, 0x0001,
+	0x15a0, 0x7024, 0xd0dc, 0x1904, 0x7c49, 0xa883, 0x0000, 0xa803,
+	0x0000, 0x2908, 0x7014, 0x9005, 0x1198, 0x7116, 0xa87c, 0xd0f4,
+	0x1904, 0x7c4c, 0x080c, 0x56d8, 0xd09c, 0x1118, 0xa87c, 0xc0cc,
+	0xa87e, 0x2e60, 0x080c, 0x85e6, 0x012e, 0x00ee, 0x00be, 0x0005,
+	0x2048, 0xa800, 0x9005, 0x1de0, 0xa902, 0x2148, 0xa87c, 0xd0f4,
+	0x1904, 0x7c4c, 0x012e, 0x00ee, 0x00be, 0x0005, 0x012e, 0x00ee,
+	0xa883, 0x0006, 0x00be, 0x0804, 0x7c6a, 0xd184, 0x0db8, 0xd1c4,
+	0x1190, 0x00a0, 0xa974, 0x080c, 0x6608, 0x15d0, 0xb800, 0xd0e4,
+	0x15b8, 0x7120, 0x9186, 0x0007, 0x1118, 0xa883, 0x0002, 0x0490,
+	0xa883, 0x0008, 0x0478, 0xa883, 0x000e, 0x0460, 0xa883, 0x0017,
+	0x0448, 0xa883, 0x0035, 0x0430, 0x080c, 0x56dc, 0xd0fc, 0x01e8,
+	0xa878, 0x2070, 0x9e82, 0x1cd0, 0x02c0, 0x6068, 0x9e02, 0x12a8,
+	0x7120, 0x9186, 0x0006, 0x1188, 0x7010, 0x905d, 0x0170, 0xb800,
+	0xd0bc, 0x0158, 0x2039, 0x0001, 0x7000, 0x9086, 0x0007, 0x1904,
+	0x7ba6, 0x7003, 0x0002, 0x0804, 0x7ba6, 0xa883, 0x0028, 0x0010,
+	0xa883, 0x0029, 0x012e, 0x00ee, 0x00be, 0x0420, 0xa883, 0x002a,
+	0x0cc8, 0xa883, 0x0045, 0x0cb0, 0x2e60, 0x2019, 0x0002, 0x601b,
+	0x0014, 0x080c, 0xe155, 0x012e, 0x00ee, 0x00be, 0x0005, 0x2009,
+	0x003e, 0x0058, 0x2009, 0x0004, 0x0040, 0x2009, 0x0006, 0x0028,
+	0x2009, 0x0016, 0x0010, 0x2009, 0x0001, 0xa884, 0x9084, 0xff00,
+	0x9105, 0xa886, 0x0126, 0x2091, 0x8000, 0x080c, 0x6c86, 0x012e,
+	0x0005, 0x080c, 0x1031, 0x0005, 0x00d6, 0x080c, 0x85dd, 0x00de,
+	0x0005, 0x00d6, 0x00e6, 0x0126, 0x2091, 0x8000, 0x2071, 0x0040,
+	0x702c, 0xd084, 0x01d8, 0x908c, 0x0780, 0x190c, 0x7d5b, 0xd09c,
+	0x11a8, 0x2071, 0x1800, 0x70c0, 0x90ea, 0x0020, 0x0278, 0x8001,
+	0x70c2, 0x702c, 0x2048, 0xa800, 0x702e, 0x9006, 0xa802, 0xa806,
+	0x2071, 0x0040, 0x2900, 0x7022, 0x702c, 0x0c28, 0x012e, 0x00ee,
+	0x00de, 0x0005, 0x0006, 0x9084, 0x0780, 0x190c, 0x7d5b, 0x000e,
+	0x0005, 0xa898, 0x9084, 0x0003, 0x05a8, 0x080c, 0xae1b, 0x05d8,
+	0x2900, 0x6016, 0xa864, 0x9084, 0x00ff, 0x9086, 0x0035, 0x1138,
+	0x6008, 0xc0fd, 0x600a, 0x2001, 0x196a, 0x2004, 0x0098, 0xa8a0,
+	0x9084, 0x00ff, 0xa99c, 0x918c, 0xff00, 0x9105, 0xa99c, 0x918c,
+	0x00ff, 0x080c, 0x2840, 0x1540, 0x00b6, 0x080c, 0x6608, 0x2b00,
+	0x00be, 0x1510, 0x6012, 0x6023, 0x0001, 0x2009, 0x0040, 0xa864,
+	0x9084, 0x00ff, 0x9086, 0x0035, 0x0110, 0x2009, 0x0041, 0x080c,
+	0xaeec, 0x0005, 0xa87b, 0x0101, 0x0126, 0x2091, 0x8000, 0x080c,
+	0x6c86, 0x012e, 0x0005, 0xa87b, 0x002c, 0x0126, 0x2091, 0x8000,
+	0x080c, 0x6c86, 0x012e, 0x0005, 0xa87b, 0x0028, 0x0126, 0x2091,
+	0x8000, 0x080c, 0x6c86, 0x012e, 0x080c, 0xae71, 0x0005, 0x00d6,
+	0x00c6, 0x0036, 0x0026, 0x0016, 0x00b6, 0x7007, 0x0001, 0xaa74,
+	0x9282, 0x0004, 0x1a04, 0x7d4c, 0xa97c, 0x9188, 0x1000, 0x2104,
+	0x905d, 0xb804, 0xd284, 0x0140, 0x05e8, 0x8007, 0x9084, 0x00ff,
+	0x9084, 0x0006, 0x1108, 0x04b0, 0x2b10, 0x080c, 0xae1b, 0x1118,
+	0x080c, 0xaebf, 0x05a8, 0x6212, 0xa874, 0x0002, 0x7d2a, 0x7d2f,
+	0x7d32, 0x7d38, 0x2019, 0x0002, 0x080c, 0xe543, 0x0060, 0x080c,
+	0xe4df, 0x0048, 0x2019, 0x0002, 0xa980, 0x080c, 0xe4fa, 0x0018,
+	0xa980, 0x080c, 0xe4df, 0x080c, 0xae71, 0xa887, 0x0000, 0x0126,
+	0x2091, 0x8000, 0x080c, 0x6c86, 0x012e, 0x00be, 0x001e, 0x002e,
+	0x003e, 0x00ce, 0x00de, 0x0005, 0xa887, 0x0006, 0x0c80, 0xa887,
+	0x0002, 0x0c68, 0xa887, 0x0005, 0x0c50, 0xa887, 0x0004, 0x0c38,
+	0xa887, 0x0007, 0x0c20, 0x2091, 0x8000, 0x0e04, 0x7d5d, 0x0006,
+	0x0016, 0x2001, 0x8003, 0x0006, 0x0804, 0x0dde, 0x2001, 0x1834,
+	0x2004, 0x9005, 0x0005, 0x0005, 0x00f6, 0x2079, 0x0300, 0x2001,
+	0x0200, 0x200c, 0xc1e5, 0xc1dc, 0x2102, 0x2009, 0x0218, 0x210c,
+	0xd1ec, 0x1120, 0x080c, 0x157f, 0x00fe, 0x0005, 0x2001, 0x020d,
+	0x2003, 0x0020, 0x781f, 0x0300, 0x00fe, 0x0005, 0x781c, 0xd08c,
+	0x0904, 0x7ddd, 0x68c0, 0x90aa, 0x0005, 0x0a04, 0x83f4, 0x7d44,
+	0x7c40, 0x9584, 0x00f6, 0x1510, 0x9484, 0x7000, 0x0140, 0x908a,
+	0x2000, 0x1260, 0x9584, 0x0700, 0x8007, 0x0804, 0x7de4, 0x7000,
+	0x9084, 0xff00, 0x9086, 0x8100, 0x0da8, 0x00b0, 0x9484, 0x0fff,
+	0x1130, 0x7000, 0x9084, 0xff00, 0x9086, 0x8100, 0x11c0, 0x080c,
+	0xe9e2, 0x080c, 0x82e9, 0x7817, 0x0140, 0x00a8, 0x9584, 0x0076,
+	0x1118, 0x080c, 0x8347, 0x19c0, 0xd5a4, 0x0148, 0x0046, 0x0056,
+	0x080c, 0x7e3f, 0x080c, 0x2339, 0x005e, 0x004e, 0x0020, 0x080c,
+	0xe9e2, 0x7817, 0x0140, 0x080c, 0x73a5, 0x0168, 0x2001, 0x0111,
+	0x2004, 0xd08c, 0x0140, 0x6893, 0x0000, 0x2001, 0x0110, 0x2003,
+	0x0008, 0x2003, 0x0000, 0x080c, 0x7e20, 0x2001, 0x19ef, 0x2004,
+	0x9005, 0x090c, 0x9687, 0x0005, 0x0002, 0x7df6, 0x810b, 0x7ded,
+	0x7ded, 0x7ded, 0x7ded, 0x7ded, 0x7ded, 0x7817, 0x0140, 0x2001,
+	0x19ef, 0x2004, 0x9005, 0x090c, 0x9687, 0x0005, 0x7000, 0x908c,
+	0xff00, 0x9194, 0xf000, 0x810f, 0x9484, 0x0fff, 0x6892, 0x9286,
+	0x2000, 0x1150, 0x6800, 0x9086, 0x0001, 0x1118, 0x080c, 0x5739,
+	0x0070, 0x080c, 0x7e5f, 0x0058, 0x9286, 0x3000, 0x1118, 0x080c,
+	0x8046, 0x0028, 0x9286, 0x8000, 0x1110, 0x080c, 0x8219, 0x7817,
+	0x0140, 0x2001, 0x19ef, 0x2004, 0x9005, 0x090c, 0x9687, 0x0005,
+	0x2001, 0x1810, 0x2004, 0xd08c, 0x0178, 0x2001, 0x1800, 0x2004,
+	0x9086, 0x0003, 0x1148, 0x0026, 0x0036, 0x2011, 0x8048, 0x2518,
+	0x080c, 0x4b14, 0x003e, 0x002e, 0x0005, 0x0036, 0x0046, 0x0056,
+	0x00f6, 0x2079, 0x0200, 0x2019, 0xfffe, 0x7c30, 0x0050, 0x0036,
+	0x0046, 0x0056, 0x00f6, 0x2079, 0x0200, 0x7d44, 0x7c40, 0x2019,
+	0xffff, 0x2001, 0x1810, 0x2004, 0xd08c, 0x0160, 0x2001, 0x1800,
+	0x2004, 0x9086, 0x0003, 0x1130, 0x0026, 0x2011, 0x8048, 0x080c,
+	0x4b14, 0x002e, 0x00fe, 0x005e, 0x004e, 0x003e, 0x0005, 0x00b6,
+	0x00c6, 0x7010, 0x9084, 0xff00, 0x8007, 0x9096, 0x0001, 0x0120,
+	0x9096, 0x0023, 0x1904, 0x8017, 0x9186, 0x0023, 0x15c0, 0x080c,
+	0x82ae, 0x0904, 0x8017, 0x6120, 0x9186, 0x0001, 0x0150, 0x9186,
+	0x0004, 0x0138, 0x9186, 0x0008, 0x0120, 0x9186, 0x000a, 0x1904,
+	0x8017, 0x7124, 0x610a, 0x7030, 0x908e, 0x0200, 0x1130, 0x2009,
+	0x0015, 0x080c, 0xaeec, 0x0804, 0x8017, 0x908e, 0x0214, 0x0118,
+	0x908e, 0x0210, 0x1130, 0x2009, 0x0015, 0x080c, 0xaeec, 0x0804,
+	0x8017, 0x908e, 0x0100, 0x1904, 0x8017, 0x7034, 0x9005, 0x1904,
+	0x8017, 0x2009, 0x0016, 0x080c, 0xaeec, 0x0804, 0x8017, 0x9186,
+	0x0022, 0x1904, 0x8017, 0x7030, 0x908e, 0x0300, 0x1580, 0x68dc,
+	0xd0a4, 0x0528, 0xc0b5, 0x68de, 0x7100, 0x918c, 0x00ff, 0x697e,
+	0x7004, 0x6882, 0x00f6, 0x2079, 0x0100, 0x79e6, 0x78ea, 0x0006,
+	0x9084, 0x00ff, 0x0016, 0x2008, 0x080c, 0x2889, 0x7932, 0x7936,
+	0x001e, 0x000e, 0x00fe, 0x080c, 0x2840, 0x695e, 0x703c, 0x00e6,
+	0x2071, 0x0140, 0x7086, 0x2071, 0x1800, 0x70b6, 0x00ee, 0x7034,
+	0x9005, 0x1904, 0x8017, 0x2009, 0x0017, 0x0804, 0x7fc7, 0x908e,
+	0x0400, 0x1190, 0x7034, 0x9005, 0x1904, 0x8017, 0x080c, 0x73a5,
+	0x0120, 0x2009, 0x001d, 0x0804, 0x7fc7, 0x68dc, 0xc0a5, 0x68de,
+	0x2009, 0x0030, 0x0804, 0x7fc7, 0x908e, 0x0500, 0x1140, 0x7034,
+	0x9005, 0x1904, 0x8017, 0x2009, 0x0018, 0x0804, 0x7fc7, 0x908e,
+	0x2010, 0x1120, 0x2009, 0x0019, 0x0804, 0x7fc7, 0x908e, 0x2110,
+	0x1120, 0x2009, 0x001a, 0x0804, 0x7fc7, 0x908e, 0x5200, 0x1140,
+	0x7034, 0x9005, 0x1904, 0x8017, 0x2009, 0x001b, 0x0804, 0x7fc7,
+	0x908e, 0x5000, 0x1140, 0x7034, 0x9005, 0x1904, 0x8017, 0x2009,
+	0x001c, 0x0804, 0x7fc7, 0x908e, 0x1300, 0x1120, 0x2009, 0x0034,
+	0x0804, 0x7fc7, 0x908e, 0x1200, 0x1140, 0x7034, 0x9005, 0x1904,
+	0x8017, 0x2009, 0x0024, 0x0804, 0x7fc7, 0x908c, 0xff00, 0x918e,
+	0x2400, 0x1170, 0x2009, 0x002d, 0x2001, 0x1810, 0x2004, 0xd09c,
+	0x0904, 0x7fc7, 0x080c, 0xd924, 0x1904, 0x8017, 0x0804, 0x7fc5,
+	0x908c, 0xff00, 0x918e, 0x5300, 0x1120, 0x2009, 0x002a, 0x0804,
+	0x7fc7, 0x908e, 0x0f00, 0x1120, 0x2009, 0x0020, 0x0804, 0x7fc7,
+	0x908e, 0x6104, 0x1530, 0x2029, 0x0205, 0x2011, 0x026d, 0x8208,
+	0x2204, 0x9082, 0x0004, 0x8004, 0x8004, 0x20a8, 0x2011, 0x8015,
+	0x211c, 0x8108, 0x0046, 0x2124, 0x080c, 0x4b14, 0x004e, 0x8108,
+	0x0f04, 0x7f7b, 0x9186, 0x0280, 0x1d88, 0x2504, 0x8000, 0x202a,
+	0x2009, 0x0260, 0x0c58, 0x202b, 0x0000, 0x2009, 0x0023, 0x0804,
+	0x7fc7, 0x908e, 0x6000, 0x1120, 0x2009, 0x003f, 0x0804, 0x7fc7,
+	0x908e, 0x5400, 0x1138, 0x080c, 0x83a4, 0x1904, 0x8017, 0x2009,
+	0x0046, 0x04a8, 0x908e, 0x5500, 0x1148, 0x080c, 0x83cc, 0x1118,
+	0x2009, 0x0041, 0x0460, 0x2009, 0x0042, 0x0448, 0x908e, 0x7800,
+	0x1118, 0x2009, 0x0045, 0x0418, 0x908e, 0x1000, 0x1118, 0x2009,
+	0x004e, 0x00e8, 0x908e, 0x6300, 0x1118, 0x2009, 0x004a, 0x00b8,
+	0x908c, 0xff00, 0x918e, 0x5600, 0x1118, 0x2009, 0x004f, 0x0078,
+	0x908c, 0xff00, 0x918e, 0x5700, 0x1118, 0x2009, 0x0050, 0x0038,
+	0x2009, 0x001d, 0x6838, 0xd0d4, 0x0110, 0x2009, 0x004c, 0x0016,
+	0x2011, 0x0263, 0x2204, 0x8211, 0x220c, 0x080c, 0x2840, 0x1904,
+	0x801a, 0x080c, 0x65a7, 0x1904, 0x801a, 0xbe12, 0xbd16, 0x001e,
+	0x0016, 0x080c, 0x73a5, 0x01c0, 0x68dc, 0xd08c, 0x1148, 0x7000,
+	0x9084, 0x00ff, 0x1188, 0x7004, 0x9084, 0xff00, 0x1168, 0x0040,
+	0x687c, 0x9606, 0x1148, 0x6880, 0x9506, 0x9084, 0xff00, 0x1120,
+	0x9584, 0x00ff, 0xb8c2, 0x0080, 0xb8c0, 0x9005, 0x1168, 0x9186,
+	0x0046, 0x1150, 0x687c, 0x9606, 0x1138, 0x6880, 0x9506, 0x9084,
+	0xff00, 0x1110, 0x001e, 0x0098, 0x080c, 0xae1b, 0x01a8, 0x2b08,
+	0x6112, 0x6023, 0x0004, 0x7120, 0x610a, 0x001e, 0x9186, 0x004c,
+	0x1110, 0x6023, 0x000a, 0x0016, 0x001e, 0x080c, 0xaeec, 0x00ce,
+	0x00be, 0x0005, 0x001e, 0x0cd8, 0x2001, 0x180e, 0x2004, 0xd0ec,
+	0x0120, 0x2011, 0x8049, 0x080c, 0x4b14, 0x080c, 0xaebf, 0x0d90,
+	0x2b08, 0x6112, 0x6023, 0x0004, 0x7120, 0x610a, 0x001e, 0x0016,
+	0x9186, 0x0017, 0x0118, 0x9186, 0x0030, 0x1128, 0x6007, 0x0009,
+	0x6017, 0x2900, 0x0020, 0x6007, 0x0051, 0x6017, 0x0000, 0x602f,
+	0x0009, 0x6003, 0x0001, 0x080c, 0x9121, 0x08a0, 0x080c, 0x32e5,
+	0x1140, 0x7010, 0x9084, 0xff00, 0x8007, 0x908e, 0x0008, 0x1108,
+	0x0009, 0x0005, 0x00b6, 0x00c6, 0x0046, 0x7000, 0x908c, 0xff00,
+	0x810f, 0x9186, 0x0033, 0x11e8, 0x080c, 0x82ae, 0x0904, 0x80a3,
+	0x7124, 0x610a, 0x7030, 0x908e, 0x0200, 0x1140, 0x7034, 0x9005,
+	0x15d0, 0x2009, 0x0015, 0x080c, 0xaeec, 0x04a8, 0x908e, 0x0100,
+	0x1590, 0x7034, 0x9005, 0x1578, 0x2009, 0x0016, 0x080c, 0xaeec,
+	0x0450, 0x9186, 0x0032, 0x1538, 0x7030, 0x908e, 0x1400, 0x1518,
+	0x2009, 0x0038, 0x0016, 0x2011, 0x0263, 0x2204, 0x8211, 0x220c,
+	0x080c, 0x2840, 0x11b8, 0x080c, 0x65a7, 0x11a0, 0xbe12, 0xbd16,
+	0x080c, 0xae1b, 0x0178, 0x2b08, 0x6112, 0x080c, 0xcfc4, 0x6023,
+	0x0004, 0x7120, 0x610a, 0x001e, 0x080c, 0xaeec, 0x080c, 0x9687,
+	0x0010, 0x00ce, 0x001e, 0x004e, 0x00ce, 0x00be, 0x0005, 0x00b6,
+	0x0046, 0x00e6, 0x00d6, 0x2028, 0x2130, 0x9696, 0x00ff, 0x11b8,
+	0x9592, 0xfffc, 0x02a0, 0x9596, 0xfffd, 0x1120, 0x2009, 0x007f,
+	0x0804, 0x8105, 0x9596, 0xfffe, 0x1120, 0x2009, 0x007e, 0x0804,
+	0x8105, 0x9596, 0xfffc, 0x1118, 0x2009, 0x0080, 0x04f0, 0x2011,
+	0x0000, 0x2019, 0x1837, 0x231c, 0xd3ac, 0x0130, 0x9026, 0x20a9,
+	0x0800, 0x2071, 0x1000, 0x0030, 0x2021, 0x0081, 0x20a9, 0x077f,
+	0x2071, 0x1081, 0x2e1c, 0x93dd, 0x0000, 0x1140, 0x82ff, 0x11d0,
+	0x9496, 0x00ff, 0x01b8, 0x2410, 0xc2fd, 0x00a0, 0xbf10, 0x2600,
+	0x9706, 0xb814, 0x1120, 0x9546, 0x1110, 0x2408, 0x00b0, 0x9745,
+	0x1148, 0x94c6, 0x007e, 0x0130, 0x94c6, 0x007f, 0x0118, 0x94c6,
+	0x0080, 0x1d20, 0x8420, 0x8e70, 0x1f04, 0x80da, 0x82ff, 0x1118,
+	0x9085, 0x0001, 0x0018, 0xc2fc, 0x2208, 0x9006, 0x00de, 0x00ee,
+	0x004e, 0x00be, 0x0005, 0x7000, 0x908c, 0xff00, 0x810f, 0x9184,
+	0x000f, 0x0002, 0x8122, 0x8122, 0x8122, 0x82c0, 0x8122, 0x812b,
+	0x8156, 0x81e4, 0x8122, 0x8122, 0x8122, 0x8122, 0x8122, 0x8122,
+	0x8122, 0x8122, 0x7817, 0x0140, 0x2001, 0x19ef, 0x2004, 0x9005,
+	0x090c, 0x9687, 0x0005, 0x00b6, 0x7110, 0xd1bc, 0x01e8, 0x7120,
+	0x2160, 0x9c8c, 0x0007, 0x11c0, 0x9c8a, 0x1cd0, 0x02a8, 0x6868,
 	0x9c02, 0x1290, 0x7008, 0x9084, 0x00ff, 0x6110, 0x2158, 0xb910,
 	0x9106, 0x1150, 0x700c, 0xb914, 0x9106, 0x1130, 0x7124, 0x610a,
-	0x2009, 0x0045, 0x080c, 0xaedc, 0x7817, 0x0140, 0x2001, 0x19f0,
-	0x2004, 0x9005, 0x090c, 0x968d, 0x00be, 0x0005, 0x6120, 0x9186,
-	0x0002, 0x0128, 0x9186, 0x0005, 0x0110, 0x9085, 0x0001, 0x0005,
-	0x080c, 0x32e3, 0x1168, 0x7010, 0x9084, 0xff00, 0x8007, 0x9086,
-	0x0000, 0x1130, 0x9184, 0x000f, 0x908a, 0x0006, 0x1208, 0x000b,
-	0x0005, 0x8247, 0x8248, 0x8247, 0x8247, 0x82a7, 0x82b6, 0x0005,
-	0x00b6, 0x7110, 0xd1bc, 0x0120, 0x702c, 0xd084, 0x0904, 0x82a5,
-	0x700c, 0x7108, 0x080c, 0x283e, 0x1904, 0x82a5, 0x080c, 0x659e,
-	0x1904, 0x82a5, 0xbe12, 0xbd16, 0x7110, 0xd1bc, 0x01d8, 0x080c,
-	0x6972, 0x0118, 0x9086, 0x0004, 0x1588, 0x00c6, 0x080c, 0x82c5,
-	0x00ce, 0x05d8, 0x080c, 0xae0b, 0x2b08, 0x05b8, 0x6112, 0x080c,
-	0xcfaa, 0x6023, 0x0002, 0x7120, 0x610a, 0x2009, 0x0088, 0x080c,
-	0xaedc, 0x0458, 0x080c, 0x6972, 0x0148, 0x9086, 0x0004, 0x0130,
-	0x080c, 0x697a, 0x0118, 0x9086, 0x0004, 0x1180, 0x080c, 0xae0b,
-	0x2b08, 0x01d8, 0x6112, 0x080c, 0xcfaa, 0x6023, 0x0005, 0x7120,
-	0x610a, 0x2009, 0x0088, 0x080c, 0xaedc, 0x0078, 0x080c, 0xae0b,
-	0x2b08, 0x0158, 0x6112, 0x080c, 0xcfaa, 0x6023, 0x0004, 0x7120,
-	0x610a, 0x2009, 0x0001, 0x080c, 0xaedc, 0x00be, 0x0005, 0x7110,
-	0xd1bc, 0x0158, 0x00d1, 0x0148, 0x080c, 0x8226, 0x1130, 0x7124,
-	0x610a, 0x2009, 0x0089, 0x080c, 0xaedc, 0x0005, 0x7110, 0xd1bc,
-	0x0158, 0x0059, 0x0148, 0x080c, 0x8226, 0x1130, 0x7124, 0x610a,
-	0x2009, 0x008a, 0x080c, 0xaedc, 0x0005, 0x7020, 0x2060, 0x9c84,
-	0x0007, 0x1158, 0x9c82, 0x1cd0, 0x0240, 0x2001, 0x181a, 0x2004,
-	0x9c02, 0x1218, 0x9085, 0x0001, 0x0005, 0x9006, 0x0ce8, 0x00b6,
-	0x7110, 0xd1bc, 0x11d8, 0x7024, 0x2060, 0x9c84, 0x0007, 0x11b0,
-	0x9c82, 0x1cd0, 0x0298, 0x6868, 0x9c02, 0x1280, 0x7008, 0x9084,
-	0x00ff, 0x6110, 0x2158, 0xb910, 0x9106, 0x1140, 0x700c, 0xb914,
-	0x9106, 0x1120, 0x2009, 0x0051, 0x080c, 0xaedc, 0x7817, 0x0140,
-	0x2001, 0x19f0, 0x2004, 0x9005, 0x090c, 0x968d, 0x00be, 0x0005,
-	0x2031, 0x0105, 0x0069, 0x0005, 0x2031, 0x0206, 0x0049, 0x0005,
-	0x2031, 0x0207, 0x0029, 0x0005, 0x2031, 0x0213, 0x0009, 0x0005,
-	0x00c6, 0x0096, 0x00f6, 0x7000, 0x9084, 0xf000, 0x9086, 0xc000,
-	0x05d0, 0x080c, 0xae0b, 0x05b8, 0x0066, 0x00c6, 0x0046, 0x2011,
-	0x0263, 0x2204, 0x8211, 0x220c, 0x080c, 0x283e, 0x15a0, 0x080c,
-	0x659e, 0x1588, 0xbe12, 0xbd16, 0x2b00, 0x004e, 0x00ce, 0x6012,
-	0x080c, 0xcfaa, 0x080c, 0x0fff, 0x0510, 0x2900, 0x605a, 0x9006,
-	0xa802, 0xa866, 0xac6a, 0xa85c, 0x90f8, 0x001b, 0x20a9, 0x000e,
-	0xa860, 0x20e8, 0x20e1, 0x0000, 0x2fa0, 0x2e98, 0x4003, 0x006e,
-	0x6616, 0x6007, 0x003e, 0x6023, 0x0001, 0x6003, 0x0001, 0x080c,
-	0x9138, 0x080c, 0x968d, 0x00fe, 0x009e, 0x00ce, 0x0005, 0x080c,
-	0xae61, 0x006e, 0x0cc0, 0x004e, 0x00ce, 0x0cc8, 0x00c6, 0x7000,
-	0x908c, 0xff00, 0x9184, 0xf000, 0x810f, 0x9086, 0x2000, 0x1904,
-	0x83b5, 0x9186, 0x0022, 0x15f0, 0x2001, 0x0111, 0x2004, 0x9005,
-	0x1904, 0x83b7, 0x7030, 0x908e, 0x0400, 0x0904, 0x83b7, 0x908e,
-	0x6000, 0x05e8, 0x908e, 0x5400, 0x05d0, 0x908e, 0x0300, 0x11d8,
-	0x2009, 0x1837, 0x210c, 0xd18c, 0x1590, 0xd1a4, 0x1580, 0x080c,
-	0x6930, 0x0558, 0x68b0, 0x9084, 0x00ff, 0x7100, 0x918c, 0x00ff,
-	0x9106, 0x1518, 0x6880, 0x69b0, 0x918c, 0xff00, 0x9105, 0x7104,
-	0x9106, 0x11d8, 0x00e0, 0x2009, 0x0103, 0x210c, 0xd1b4, 0x11a8,
-	0x908e, 0x5200, 0x09e8, 0x908e, 0x0500, 0x09d0, 0x908e, 0x5000,
-	0x09b8, 0x0058, 0x9186, 0x0023, 0x1140, 0x080c, 0x82c5, 0x0128,
-	0x6004, 0x9086, 0x0002, 0x0118, 0x0000, 0x9006, 0x0010, 0x9085,
-	0x0001, 0x00ce, 0x0005, 0x0156, 0x0046, 0x0016, 0x0036, 0x7038,
-	0x2020, 0x8427, 0x94a4, 0x0007, 0xd484, 0x0148, 0x20a9, 0x0004,
-	0x2019, 0x1805, 0x2011, 0x027a, 0x080c, 0xbe09, 0x1178, 0xd48c,
-	0x0148, 0x20a9, 0x0004, 0x2019, 0x1801, 0x2011, 0x027e, 0x080c,
-	0xbe09, 0x1120, 0xd494, 0x0110, 0x9085, 0x0001, 0x003e, 0x001e,
-	0x004e, 0x015e, 0x0005, 0x0156, 0x0046, 0x0016, 0x0036, 0x7038,
-	0x2020, 0x8427, 0x94a4, 0x0007, 0xd484, 0x0148, 0x20a9, 0x0004,
-	0x2019, 0x1805, 0x2011, 0x0272, 0x080c, 0xbe09, 0x1178, 0xd48c,
-	0x0148, 0x20a9, 0x0004, 0x2019, 0x1801, 0x2011, 0x0276, 0x080c,
-	0xbe09, 0x1120, 0xd494, 0x0110, 0x9085, 0x0001, 0x003e, 0x001e,
-	0x004e, 0x015e, 0x0005, 0x00f6, 0x2079, 0x0200, 0x7800, 0xc0e5,
-	0xc0cc, 0x7802, 0x00fe, 0x0005, 0x00f6, 0x2079, 0x1800, 0x7834,
-	0xd084, 0x1130, 0x2079, 0x0200, 0x7800, 0x9085, 0x1200, 0x7802,
-	0x00fe, 0x0005, 0x00e6, 0x2071, 0x1800, 0x7034, 0xc084, 0x7036,
-	0x00ee, 0x0005, 0x2071, 0x19fa, 0x7003, 0x0003, 0x700f, 0x0361,
-	0x9006, 0x701a, 0x7072, 0x7012, 0x7017, 0x1cd0, 0x7007, 0x0000,
-	0x7026, 0x702b, 0xa289, 0x7032, 0x7037, 0xa2f7, 0x703f, 0xffff,
-	0x7042, 0x7047, 0x556e, 0x704a, 0x705b, 0x8594, 0x080c, 0x1018,
-	0x090c, 0x0dd5, 0x2900, 0x703a, 0xa867, 0x0003, 0xa86f, 0x0100,
-	0xa8ab, 0xdcb0, 0x0005, 0x2071, 0x19fa, 0x1d04, 0x84e2, 0x2091,
-	0x6000, 0x700c, 0x8001, 0x700e, 0x1530, 0x2001, 0x013c, 0x2004,
-	0x9005, 0x190c, 0x85d9, 0x2001, 0x1869, 0x2004, 0xd0c4, 0x0158,
-	0x3a00, 0xd08c, 0x1140, 0x20d1, 0x0000, 0x20d1, 0x0001, 0x20d1,
-	0x0000, 0x080c, 0x0dd5, 0x700f, 0x0361, 0x7007, 0x0001, 0x0126,
-	0x2091, 0x8000, 0x7040, 0x900d, 0x0148, 0x8109, 0x7142, 0x1130,
-	0x7044, 0x080f, 0x0018, 0x0126, 0x2091, 0x8000, 0x7024, 0x900d,
-	0x0188, 0x7020, 0x8001, 0x7022, 0x1168, 0x7023, 0x0009, 0x8109,
-	0x7126, 0x9186, 0x03e8, 0x1110, 0x7028, 0x080f, 0x81ff, 0x1110,
-	0x7028, 0x080f, 0x7030, 0x900d, 0x0180, 0x702c, 0x8001, 0x702e,
-	0x1160, 0x702f, 0x0009, 0x8109, 0x7132, 0x0128, 0x9184, 0x007f,
-	0x090c, 0xa418, 0x0010, 0x7034, 0x080f, 0x703c, 0x9005, 0x0118,
-	0x0310, 0x8001, 0x703e, 0x704c, 0x900d, 0x0168, 0x7048, 0x8001,
-	0x704a, 0x1148, 0x704b, 0x0009, 0x8109, 0x714e, 0x1120, 0x7150,
-	0x714e, 0x7058, 0x080f, 0x7018, 0x900d, 0x01d8, 0x0016, 0x7070,
-	0x900d, 0x0158, 0x706c, 0x8001, 0x706e, 0x1138, 0x706f, 0x0009,
-	0x8109, 0x7172, 0x1110, 0x7074, 0x080f, 0x001e, 0x7008, 0x8001,
-	0x700a, 0x1138, 0x700b, 0x0009, 0x8109, 0x711a, 0x1110, 0x701c,
-	0x080f, 0x012e, 0x7004, 0x0002, 0x850a, 0x850b, 0x8527, 0x00e6,
-	0x2071, 0x19fa, 0x7018, 0x9005, 0x1120, 0x711a, 0x721e, 0x700b,
-	0x0009, 0x00ee, 0x0005, 0x00e6, 0x0006, 0x2071, 0x19fa, 0x701c,
-	0x9206, 0x1120, 0x701a, 0x701e, 0x7072, 0x7076, 0x000e, 0x00ee,
-	0x0005, 0x00e6, 0x2071, 0x19fa, 0xb888, 0x9102, 0x0208, 0xb98a,
-	0x00ee, 0x0005, 0x0005, 0x00b6, 0x7110, 0x080c, 0x65ff, 0x1168,
-	0xb888, 0x8001, 0x0250, 0xb88a, 0x1140, 0x0126, 0x2091, 0x8000,
-	0x0016, 0x080c, 0x968d, 0x001e, 0x012e, 0x8108, 0x9182, 0x0800,
-	0x0218, 0x900e, 0x7007, 0x0002, 0x7112, 0x00be, 0x0005, 0x7014,
-	0x2060, 0x0126, 0x2091, 0x8000, 0x6040, 0x9005, 0x0128, 0x8001,
-	0x6042, 0x1110, 0x080c, 0xce3b, 0x6018, 0x9005, 0x0558, 0x8001,
-	0x601a, 0x1540, 0x6120, 0x9186, 0x0003, 0x0148, 0x9186, 0x0006,
-	0x0130, 0x9186, 0x0009, 0x11e0, 0x611c, 0xd1c4, 0x1100, 0x080c,
-	0xcb35, 0x01b0, 0x6014, 0x2048, 0xa884, 0x908a, 0x199a, 0x0280,
-	0x9082, 0x1999, 0xa886, 0x908a, 0x199a, 0x0210, 0x2001, 0x1999,
-	0x8003, 0x800b, 0x810b, 0x9108, 0x611a, 0xa87c, 0xd0e4, 0x0110,
-	0x080c, 0xc833, 0x012e, 0x9c88, 0x0018, 0x7116, 0x2001, 0x181a,
-	0x2004, 0x9102, 0x0220, 0x7017, 0x1cd0, 0x7007, 0x0000, 0x0005,
-	0x00e6, 0x2071, 0x19fa, 0x7027, 0x07d0, 0x7023, 0x0009, 0x00ee,
-	0x0005, 0x2001, 0x1a03, 0x2003, 0x0000, 0x0005, 0x00e6, 0x2071,
-	0x19fa, 0x7132, 0x702f, 0x0009, 0x00ee, 0x0005, 0x2011, 0x1a06,
-	0x2013, 0x0000, 0x0005, 0x00e6, 0x2071, 0x19fa, 0x711a, 0x721e,
-	0x700b, 0x0009, 0x00ee, 0x0005, 0x0086, 0x0026, 0x7054, 0x8000,
-	0x7056, 0x2001, 0x1a08, 0x2044, 0xa06c, 0x9086, 0x0000, 0x0150,
-	0x7068, 0xa09a, 0x7064, 0xa096, 0x7060, 0xa092, 0x705c, 0xa08e,
-	0x080c, 0x10e9, 0x002e, 0x008e, 0x0005, 0x0006, 0x0016, 0x0096,
-	0x00a6, 0x00b6, 0x00c6, 0x00d6, 0x00e6, 0x00f6, 0x0156, 0x080c,
-	0x8453, 0x015e, 0x00fe, 0x00ee, 0x00de, 0x00ce, 0x00be, 0x00ae,
-	0x009e, 0x001e, 0x000e, 0x0005, 0x00e6, 0x2071, 0x19fa, 0x7172,
-	0x7276, 0x706f, 0x0009, 0x00ee, 0x0005, 0x00e6, 0x0006, 0x2071,
-	0x19fa, 0x7074, 0x9206, 0x1110, 0x7072, 0x7076, 0x000e, 0x00ee,
-	0x0005, 0x0016, 0x00c6, 0x2009, 0xfffc, 0x210d, 0x2061, 0x0100,
-	0x60f0, 0x9100, 0x60f3, 0x0000, 0x2009, 0xfffc, 0x200f, 0x1220,
-	0x8108, 0x2105, 0x8000, 0x200f, 0x00ce, 0x001e, 0x0005, 0x00c6,
-	0x2061, 0x1a71, 0x00ce, 0x0005, 0x9184, 0x000f, 0x8003, 0x8003,
-	0x8003, 0x9080, 0x1a71, 0x2060, 0x0005, 0xa884, 0x908a, 0x199a,
-	0x1638, 0x9005, 0x1150, 0x00c6, 0x2061, 0x1a71, 0x6014, 0x00ce,
-	0x9005, 0x1130, 0x2001, 0x001e, 0x0018, 0x908e, 0xffff, 0x01b0,
-	0x8003, 0x800b, 0x810b, 0x9108, 0x611a, 0xa87c, 0x908c, 0x00c0,
-	0x918e, 0x00c0, 0x0904, 0x8687, 0xd0b4, 0x1168, 0xd0bc, 0x1904,
-	0x8660, 0x2009, 0x0006, 0x080c, 0x86b4, 0x0005, 0x900e, 0x0c60,
-	0x2001, 0x1999, 0x08b0, 0xd0fc, 0x0160, 0x908c, 0x0003, 0x0120,
-	0x918e, 0x0003, 0x1904, 0x86ae, 0x908c, 0x2020, 0x918e, 0x2020,
-	0x01a8, 0x6024, 0xd0d4, 0x11e8, 0x2009, 0x1869, 0x2104, 0xd084,
-	0x1138, 0x87ff, 0x1120, 0x2009, 0x0043, 0x0804, 0xaedc, 0x0005,
-	0x87ff, 0x1de8, 0x2009, 0x0042, 0x0804, 0xaedc, 0x6110, 0x00b6,
-	0x2158, 0xb900, 0x00be, 0xd1ac, 0x0d20, 0x6024, 0xc0cd, 0x6026,
-	0x0c00, 0xc0d4, 0x6026, 0xa890, 0x602e, 0xa88c, 0x6032, 0x08e0,
-	0xd0fc, 0x0160, 0x908c, 0x0003, 0x0120, 0x918e, 0x0003, 0x1904,
-	0x86ae, 0x908c, 0x2020, 0x918e, 0x2020, 0x0170, 0x0076, 0x00f6,
-	0x2c78, 0x080c, 0x1725, 0x00fe, 0x007e, 0x87ff, 0x1120, 0x2009,
-	0x0042, 0x080c, 0xaedc, 0x0005, 0x6110, 0x00b6, 0x2158, 0xb900,
-	0x00be, 0xd1ac, 0x0d58, 0x6124, 0xc1cd, 0x6126, 0x0c38, 0xd0fc,
-	0x0188, 0x908c, 0x2020, 0x918e, 0x2020, 0x01a8, 0x9084, 0x0003,
-	0x908e, 0x0002, 0x0148, 0x87ff, 0x1120, 0x2009, 0x0041, 0x080c,
-	0xaedc, 0x0005, 0x00b9, 0x0ce8, 0x87ff, 0x1dd8, 0x2009, 0x0043,
-	0x080c, 0xaedc, 0x0cb0, 0x6110, 0x00b6, 0x2158, 0xb900, 0x00be,
-	0xd1ac, 0x0d20, 0x6124, 0xc1cd, 0x6126, 0x0c00, 0x2009, 0x0004,
-	0x0019, 0x0005, 0x2009, 0x0001, 0x0096, 0x080c, 0xcb35, 0x0518,
-	0x6014, 0x2048, 0xa982, 0xa800, 0x6016, 0x9186, 0x0001, 0x1188,
-	0xa97c, 0x918c, 0x8100, 0x918e, 0x8100, 0x1158, 0x00c6, 0x2061,
-	0x1a71, 0x6200, 0xd28c, 0x1120, 0x6204, 0x8210, 0x0208, 0x6206,
-	0x00ce, 0x080c, 0x6abc, 0x6014, 0x904d, 0x0076, 0x2039, 0x0000,
-	0x190c, 0x85fd, 0x007e, 0x009e, 0x0005, 0x0156, 0x00c6, 0x2061,
-	0x1a71, 0x6000, 0x81ff, 0x0110, 0x9205, 0x0008, 0x9204, 0x6002,
-	0x00ce, 0x015e, 0x0005, 0x6800, 0xd08c, 0x1138, 0x6808, 0x9005,
-	0x0120, 0x8001, 0x680a, 0x9085, 0x0001, 0x0005, 0x2071, 0x1923,
-	0x7003, 0x0006, 0x7007, 0x0000, 0x700f, 0x0000, 0x7013, 0x0001,
-	0x080c, 0x1018, 0x090c, 0x0dd5, 0xa867, 0x0006, 0xa86b, 0x0001,
-	0xa8ab, 0xdcb0, 0xa89f, 0x0000, 0x2900, 0x702e, 0x7033, 0x0000,
-	0x0005, 0x0096, 0x00e6, 0x2071, 0x1923, 0x702c, 0x2048, 0x6a2c,
-	0x721e, 0x6b30, 0x7322, 0x6834, 0x7026, 0xa896, 0x6838, 0x702a,
-	0xa89a, 0x6824, 0x7016, 0x683c, 0x701a, 0x2009, 0x0028, 0x200a,
-	0x9005, 0x0148, 0x900e, 0x9188, 0x000c, 0x8001, 0x1de0, 0x2100,
-	0x9210, 0x1208, 0x8318, 0xaa8e, 0xab92, 0x7010, 0xd084, 0x0178,
-	0xc084, 0x7007, 0x0001, 0x700f, 0x0000, 0x0006, 0x2009, 0x181d,
-	0x2104, 0x9082, 0x0007, 0x2009, 0x1ac8, 0x200a, 0x000e, 0xc095,
-	0x7012, 0x2008, 0x2001, 0x003b, 0x080c, 0x15ee, 0x9006, 0x2071,
-	0x193c, 0x7002, 0x7006, 0x702a, 0x00ee, 0x009e, 0x0005, 0x00e6,
-	0x0126, 0x0156, 0x2091, 0x8000, 0x2071, 0x1800, 0x7154, 0x2001,
-	0x0008, 0x910a, 0x0638, 0x2001, 0x187d, 0x20ac, 0x9006, 0x9080,
-	0x0008, 0x1f04, 0x8767, 0x71c0, 0x9102, 0x02e0, 0x2071, 0x1877,
-	0x20a9, 0x0007, 0x00c6, 0x080c, 0xae0b, 0x6023, 0x0009, 0x6003,
-	0x0004, 0x601f, 0x0101, 0x0089, 0x0126, 0x2091, 0x8000, 0x080c,
-	0x88ed, 0x012e, 0x1f04, 0x8773, 0x9006, 0x00ce, 0x015e, 0x012e,
-	0x00ee, 0x0005, 0x9085, 0x0001, 0x0cc8, 0x00e6, 0x00b6, 0x0096,
-	0x0086, 0x0056, 0x0046, 0x0026, 0x7118, 0x720c, 0x7620, 0x7004,
-	0xd084, 0x1128, 0x2021, 0x0024, 0x2029, 0x0002, 0x0020, 0x2021,
-	0x002c, 0x2029, 0x000a, 0x080c, 0x0fff, 0x090c, 0x0dd5, 0x2900,
-	0x6016, 0x2058, 0xac66, 0x9006, 0xa802, 0xa806, 0xa86a, 0xa87a,
-	0xa8aa, 0xa887, 0x0005, 0xa87f, 0x0020, 0x7008, 0xa89a, 0x7010,
-	0xa89e, 0xae8a, 0xa8af, 0xffff, 0xa8b3, 0x0000, 0x8109, 0x0160,
-	0x080c, 0x0fff, 0x090c, 0x0dd5, 0xad66, 0x2b00, 0xa802, 0x2900,
-	0xb806, 0x2058, 0x8109, 0x1da0, 0x002e, 0x004e, 0x005e, 0x008e,
-	0x009e, 0x00be, 0x00ee, 0x0005, 0x2079, 0x0000, 0x2071, 0x1923,
-	0x7004, 0x004b, 0x700c, 0x0002, 0x87df, 0x87d8, 0x87d8, 0x0005,
-	0x87e9, 0x884a, 0x884a, 0x884a, 0x884b, 0x885c, 0x885c, 0x700c,
-	0x0cba, 0x0126, 0x2091, 0x8000, 0x78a0, 0x79a0, 0x9106, 0x0128,
-	0x78a0, 0x79a0, 0x9106, 0x1904, 0x883d, 0x2001, 0x0005, 0x2004,
-	0xd0bc, 0x0130, 0x2011, 0x0004, 0x2204, 0xc0c5, 0x2012, 0x0ca8,
-	0x012e, 0x7018, 0x910a, 0x1130, 0x7030, 0x9005, 0x05a8, 0x080c,
-	0x888b, 0x0490, 0x1210, 0x7114, 0x910a, 0x9192, 0x000a, 0x0210,
-	0x2009, 0x000a, 0x2001, 0x1888, 0x2014, 0x2001, 0x1935, 0x2004,
-	0x9100, 0x9202, 0x0e48, 0x080c, 0x89d7, 0x2200, 0x9102, 0x0208,
-	0x2208, 0x0096, 0x702c, 0x2048, 0xa873, 0x0001, 0xa976, 0x080c,
-	0x8ae0, 0x2100, 0xa87e, 0xa86f, 0x0000, 0x009e, 0x0126, 0x2091,
-	0x8000, 0x2009, 0x1a18, 0x2104, 0xc085, 0x200a, 0x700f, 0x0002,
-	0x012e, 0x080c, 0x1108, 0x1de8, 0x0005, 0x2001, 0x0005, 0x2004,
-	0xd0bc, 0x0130, 0x2011, 0x0004, 0x2204, 0xc0c5, 0x2012, 0x0ca8,
-	0x012e, 0x0005, 0x0005, 0x700c, 0x0002, 0x8850, 0x8853, 0x8852,
-	0x080c, 0x87e7, 0x0005, 0x8001, 0x700e, 0x0096, 0x702c, 0x2048,
-	0xa974, 0x009e, 0x0011, 0x0ca0, 0x0005, 0x0096, 0x702c, 0x2048,
-	0x7018, 0x9100, 0x7214, 0x921a, 0x1130, 0x701c, 0xa88e, 0x7020,
-	0xa892, 0x9006, 0x0068, 0x0006, 0x080c, 0x8ae0, 0x2100, 0xaa8c,
-	0x9210, 0xaa8e, 0x1220, 0xa890, 0x9081, 0x0000, 0xa892, 0x000e,
-	0x009e, 0x2f08, 0x9188, 0x0028, 0x200a, 0x701a, 0x0005, 0x00e6,
-	0x2071, 0x1923, 0x700c, 0x0002, 0x8889, 0x8889, 0x8887, 0x700f,
-	0x0001, 0x00ee, 0x0005, 0x0126, 0x2091, 0x8000, 0x7030, 0x9005,
-	0x0508, 0x2078, 0x7814, 0x2048, 0xae88, 0x00b6, 0x2059, 0x0000,
-	0x080c, 0x88f6, 0x00be, 0x01b0, 0x00e6, 0x2071, 0x193c, 0x080c,
-	0x893d, 0x00ee, 0x0178, 0x0096, 0x080c, 0x1018, 0x2900, 0x009e,
-	0x0148, 0xa8aa, 0x04b9, 0x0041, 0x2001, 0x1946, 0x2003, 0x0000,
-	0x012e, 0x08c8, 0x012e, 0x0005, 0x00d6, 0x00c6, 0x0086, 0x00a6,
-	0x2940, 0x2650, 0x2600, 0x9005, 0x0180, 0xa864, 0x9084, 0x000f,
-	0x2068, 0x9d88, 0x2090, 0x2165, 0x0056, 0x2029, 0x0000, 0x080c,
-	0x8a65, 0x080c, 0x2048, 0x1dd8, 0x005e, 0x00ae, 0x2001, 0x187f,
-	0x2004, 0xa88a, 0x080c, 0x1725, 0x781f, 0x0101, 0x7813, 0x0000,
-	0x0126, 0x2091, 0x8000, 0x080c, 0x894c, 0x012e, 0x008e, 0x00ce,
-	0x00de, 0x0005, 0x7030, 0x9005, 0x0138, 0x2078, 0x780c, 0x7032,
-	0x2001, 0x1946, 0x2003, 0x0001, 0x0005, 0x00e6, 0x2071, 0x1923,
-	0x7030, 0x600e, 0x2c00, 0x7032, 0x00ee, 0x0005, 0x00d6, 0x00c6,
-	0x0026, 0x9b80, 0x8bbf, 0x2005, 0x906d, 0x090c, 0x0dd5, 0x9b80,
-	0x8bb7, 0x2005, 0x9065, 0x090c, 0x0dd5, 0x6114, 0x2600, 0x9102,
-	0x0248, 0x6828, 0x9102, 0x02f0, 0x9085, 0x0001, 0x002e, 0x00ce,
-	0x00de, 0x0005, 0x6804, 0xd094, 0x0148, 0x6854, 0xd084, 0x1178,
-	0xc085, 0x6856, 0x2011, 0x8026, 0x080c, 0x4b04, 0x684c, 0x0096,
-	0x904d, 0x090c, 0x0dd5, 0xa804, 0x8000, 0xa806, 0x009e, 0x9006,
-	0x2030, 0x0c20, 0x6854, 0xd08c, 0x1d08, 0xc08d, 0x6856, 0x2011,
-	0x8025, 0x080c, 0x4b04, 0x684c, 0x0096, 0x904d, 0x090c, 0x0dd5,
-	0xa800, 0x8000, 0xa802, 0x009e, 0x0888, 0x7000, 0x2019, 0x0008,
-	0x8319, 0x7104, 0x9102, 0x1118, 0x2300, 0x9005, 0x0020, 0x0210,
-	0x9302, 0x0008, 0x8002, 0x0005, 0x00d6, 0x7814, 0x9005, 0x090c,
-	0x0dd5, 0x781c, 0x9084, 0x0101, 0x9086, 0x0101, 0x190c, 0x0dd5,
-	0x2069, 0x193c, 0x6804, 0x9080, 0x193e, 0x2f08, 0x2102, 0x6904,
-	0x8108, 0x9182, 0x0008, 0x0208, 0x900e, 0x6906, 0x9180, 0x193e,
-	0x2003, 0x0000, 0x00de, 0x0005, 0x0096, 0x00c6, 0x2060, 0x6014,
-	0x2048, 0xa8a8, 0x0096, 0x2048, 0x9005, 0x190c, 0x1031, 0x009e,
-	0xa8ab, 0x0000, 0x080c, 0x0fb1, 0x080c, 0xae61, 0x00ce, 0x009e,
-	0x0005, 0x6020, 0x9086, 0x0009, 0x1128, 0x601c, 0xd0c4, 0x0110,
-	0x9006, 0x0005, 0x9085, 0x0001, 0x0005, 0x6000, 0x9086, 0x0000,
-	0x0178, 0x6010, 0x9005, 0x0150, 0x00b6, 0x2058, 0x080c, 0x8cf2,
-	0x00be, 0x6013, 0x0000, 0x601b, 0x0000, 0x0010, 0x2c00, 0x0861,
-	0x0005, 0x2009, 0x1927, 0x210c, 0xd194, 0x0005, 0x00e6, 0x2071,
-	0x1923, 0x7110, 0xc194, 0xd19c, 0x1118, 0xc185, 0x7007, 0x0000,
-	0x7112, 0x2001, 0x003b, 0x080c, 0x15ee, 0x00ee, 0x0005, 0x0096,
-	0x00d6, 0x9006, 0x7006, 0x700e, 0x701a, 0x701e, 0x7022, 0x7016,
-	0x702a, 0x7026, 0x702f, 0x0000, 0x080c, 0x8b3f, 0x0170, 0x080c,
-	0x8b74, 0x0158, 0x2900, 0x7002, 0x700a, 0x701a, 0x7013, 0x0001,
-	0x701f, 0x000a, 0x00de, 0x009e, 0x0005, 0x900e, 0x0cd8, 0x00e6,
-	0x0096, 0x0086, 0x00d6, 0x00c6, 0x2071, 0x1930, 0x721c, 0x2100,
-	0x9202, 0x1618, 0x080c, 0x8b74, 0x090c, 0x0dd5, 0x7018, 0x9005,
-	0x1160, 0x2900, 0x7002, 0x700a, 0x701a, 0x9006, 0x7006, 0x700e,
-	0xa806, 0xa802, 0x7012, 0x701e, 0x0038, 0x2040, 0xa806, 0x2900,
-	0xa002, 0x701a, 0xa803, 0x0000, 0x7010, 0x8000, 0x7012, 0x701c,
-	0x9080, 0x000a, 0x701e, 0x721c, 0x08d0, 0x721c, 0x00ce, 0x00de,
-	0x008e, 0x009e, 0x00ee, 0x0005, 0x0096, 0x0156, 0x0136, 0x0146,
-	0x00e6, 0x0126, 0x2091, 0x8000, 0x2071, 0x1930, 0x7300, 0x831f,
-	0x831e, 0x831e, 0x9384, 0x003f, 0x20e8, 0x939c, 0xffc0, 0x9398,
-	0x0003, 0x7104, 0x080c, 0x8ae0, 0x810c, 0x2100, 0x9318, 0x8003,
-	0x2228, 0x2021, 0x0078, 0x9402, 0x9532, 0x0208, 0x2028, 0x2500,
-	0x8004, 0x20a8, 0x23a0, 0xa001, 0xa001, 0x4005, 0x2508, 0x080c,
-	0x8ae9, 0x2130, 0x7014, 0x9600, 0x7016, 0x2600, 0x711c, 0x9102,
-	0x701e, 0x7004, 0x9600, 0x2008, 0x9082, 0x000a, 0x1190, 0x7000,
-	0x2048, 0xa800, 0x9005, 0x1148, 0x2009, 0x0001, 0x0026, 0x080c,
-	0x89d7, 0x002e, 0x7000, 0x2048, 0xa800, 0x7002, 0x7007, 0x0000,
-	0x0008, 0x7106, 0x2500, 0x9212, 0x1904, 0x8a16, 0x012e, 0x00ee,
-	0x014e, 0x013e, 0x015e, 0x009e, 0x0005, 0x0016, 0x0026, 0x00e6,
-	0x0126, 0x2091, 0x8000, 0x9580, 0x8bb7, 0x2005, 0x9075, 0x090c,
-	0x0dd5, 0x080c, 0x8abb, 0x012e, 0x9580, 0x8bb3, 0x2005, 0x9075,
-	0x090c, 0x0dd5, 0x0156, 0x0136, 0x01c6, 0x0146, 0x01d6, 0x831f,
-	0x831e, 0x831e, 0x9384, 0x003f, 0x20e0, 0x9384, 0xffc0, 0x9100,
-	0x2098, 0xa860, 0x20e8, 0xa95c, 0x2c05, 0x9100, 0x20a0, 0x20a9,
-	0x0002, 0x4003, 0x2e0c, 0x2d00, 0x0002, 0x8aa5, 0x8aa5, 0x8aa7,
-	0x8aa5, 0x8aa7, 0x8aa5, 0x8aa5, 0x8aa5, 0x8aa5, 0x8aa5, 0x8aad,
-	0x8aa5, 0x8aad, 0x8aa5, 0x8aa5, 0x8aa5, 0x080c, 0x0dd5, 0x4104,
-	0x20a9, 0x0002, 0x4002, 0x4003, 0x0028, 0x20a9, 0x0002, 0x4003,
-	0x4104, 0x4003, 0x01de, 0x014e, 0x01ce, 0x013e, 0x015e, 0x00ee,
-	0x002e, 0x001e, 0x0005, 0x0096, 0x7014, 0x8001, 0x7016, 0x710c,
-	0x2110, 0x00f1, 0x810c, 0x9188, 0x0003, 0x7308, 0x8210, 0x9282,
-	0x000a, 0x1198, 0x7008, 0x2048, 0xa800, 0x9005, 0x0158, 0x0006,
-	0x080c, 0x8b83, 0x009e, 0xa807, 0x0000, 0x2900, 0x700a, 0x7010,
-	0x8001, 0x7012, 0x700f, 0x0000, 0x0008, 0x720e, 0x009e, 0x0005,
-	0x0006, 0x810b, 0x810b, 0x2100, 0x810b, 0x9100, 0x2008, 0x000e,
-	0x0005, 0x0006, 0x0026, 0x2100, 0x9005, 0x0158, 0x9092, 0x000c,
-	0x0240, 0x900e, 0x8108, 0x9082, 0x000c, 0x1de0, 0x002e, 0x000e,
-	0x0005, 0x900e, 0x0cd8, 0x2d00, 0x90b8, 0x0008, 0x690c, 0x6810,
-	0x2019, 0x0001, 0x2031, 0x8b29, 0x9112, 0x0220, 0x0118, 0x8318,
-	0x2208, 0x0cd0, 0x6808, 0x9005, 0x0108, 0x8318, 0x233a, 0x6804,
-	0xd084, 0x2300, 0x2021, 0x0001, 0x1150, 0x9082, 0x0003, 0x0967,
-	0x0a67, 0x8420, 0x9082, 0x0007, 0x0967, 0x0a67, 0x0cd0, 0x9082,
-	0x0002, 0x0967, 0x0a67, 0x8420, 0x9082, 0x0005, 0x0967, 0x0a67,
-	0x0cd0, 0x6c1a, 0x2d00, 0x90b8, 0x0007, 0x00e6, 0x2071, 0x1800,
-	0x7128, 0x6810, 0x2019, 0x0001, 0x910a, 0x0118, 0x0210, 0x8318,
-	0x0cd8, 0x2031, 0x8b3c, 0x0870, 0x6c16, 0x00ee, 0x0005, 0x0096,
-	0x0046, 0x0126, 0x2091, 0x8000, 0x2b00, 0x9080, 0x8bbb, 0x2005,
-	0x9005, 0x090c, 0x0dd5, 0x2004, 0x90a0, 0x000a, 0x080c, 0x1018,
-	0x01d0, 0x2900, 0x7026, 0xa803, 0x0000, 0xa807, 0x0000, 0x080c,
-	0x1018, 0x0188, 0x7024, 0xa802, 0xa807, 0x0000, 0x2900, 0x7026,
-	0x94a2, 0x000a, 0x0110, 0x0208, 0x0c90, 0x9085, 0x0001, 0x012e,
-	0x004e, 0x009e, 0x0005, 0x7024, 0x9005, 0x0dc8, 0x2048, 0xac00,
-	0x080c, 0x1031, 0x2400, 0x0cc0, 0x0126, 0x2091, 0x8000, 0x7024,
-	0x2048, 0x9005, 0x0130, 0xa800, 0x7026, 0xa803, 0x0000, 0xa807,
-	0x0000, 0x012e, 0x0005, 0x0126, 0x2091, 0x8000, 0x7024, 0xa802,
-	0x2900, 0x7026, 0x012e, 0x0005, 0x0096, 0x9e80, 0x0009, 0x2004,
-	0x9005, 0x0138, 0x2048, 0xa800, 0x0006, 0x080c, 0x1031, 0x000e,
-	0x0cb8, 0x009e, 0x0005, 0x0096, 0x7008, 0x9005, 0x0138, 0x2048,
-	0xa800, 0x0006, 0x080c, 0x1031, 0x000e, 0x0cb8, 0x9006, 0x7002,
-	0x700a, 0x7006, 0x700e, 0x701a, 0x701e, 0x7022, 0x702a, 0x7026,
-	0x702e, 0x009e, 0x0005, 0x1a64, 0x0000, 0x0000, 0x0000, 0x1930,
-	0x0000, 0x0000, 0x0000, 0x1888, 0x0000, 0x0000, 0x0000, 0x1877,
-	0x0000, 0x0000, 0x0000, 0x00e6, 0x00c6, 0x00b6, 0x00a6, 0xa8a8,
-	0x2040, 0x2071, 0x1877, 0x080c, 0x8cdd, 0xa067, 0x0023, 0x6010,
-	0x905d, 0x0904, 0x8cb2, 0xb814, 0xa06e, 0xb910, 0xa172, 0xb9a0,
-	0xa176, 0x2001, 0x0003, 0xa07e, 0xa834, 0xa082, 0xa07b, 0x0000,
-	0xa898, 0x9005, 0x0118, 0xa078, 0xc085, 0xa07a, 0x2858, 0x2031,
-	0x0018, 0xa068, 0x908a, 0x0019, 0x1a0c, 0x0dd5, 0x2020, 0x2050,
-	0x2940, 0xa864, 0x90bc, 0x00ff, 0x908c, 0x000f, 0x91e0, 0x2090,
-	0x2c65, 0x9786, 0x0024, 0x2c05, 0x1590, 0x908a, 0x0036, 0x1a0c,
-	0x0dd5, 0x9082, 0x001b, 0x0002, 0x8c1f, 0x8c1f, 0x8c21, 0x8c1f,
-	0x8c1f, 0x8c1f, 0x8c23, 0x8c1f, 0x8c1f, 0x8c1f, 0x8c25, 0x8c1f,
-	0x8c1f, 0x8c1f, 0x8c27, 0x8c1f, 0x8c1f, 0x8c1f, 0x8c29, 0x8c1f,
-	0x8c1f, 0x8c1f, 0x8c2b, 0x8c1f, 0x8c1f, 0x8c1f, 0x8c2d, 0x080c,
-	0x0dd5, 0xa180, 0x04b8, 0xa190, 0x04a8, 0xa1a0, 0x0498, 0xa1b0,
-	0x0488, 0xa1c0, 0x0478, 0xa1d0, 0x0468, 0xa1e0, 0x0458, 0x908a,
-	0x0034, 0x1a0c, 0x0dd5, 0x9082, 0x001b, 0x0002, 0x8c51, 0x8c4f,
-	0x8c4f, 0x8c4f, 0x8c4f, 0x8c4f, 0x8c53, 0x8c4f, 0x8c4f, 0x8c4f,
-	0x8c4f, 0x8c4f, 0x8c55, 0x8c4f, 0x8c4f, 0x8c4f, 0x8c4f, 0x8c4f,
-	0x8c57, 0x8c4f, 0x8c4f, 0x8c4f, 0x8c4f, 0x8c4f, 0x8c59, 0x080c,
-	0x0dd5, 0xa180, 0x0038, 0xa198, 0x0028, 0xa1b0, 0x0018, 0xa1c8,
-	0x0008, 0xa1e0, 0x2600, 0x0002, 0x8c75, 0x8c77, 0x8c79, 0x8c7b,
-	0x8c7d, 0x8c7f, 0x8c81, 0x8c83, 0x8c85, 0x8c87, 0x8c89, 0x8c8b,
-	0x8c8d, 0x8c8f, 0x8c91, 0x8c93, 0x8c95, 0x8c97, 0x8c99, 0x8c9b,
-	0x8c9d, 0x8c9f, 0x8ca1, 0x8ca3, 0x8ca5, 0x080c, 0x0dd5, 0xb9e2,
-	0x0468, 0xb9de, 0x0458, 0xb9da, 0x0448, 0xb9d6, 0x0438, 0xb9d2,
-	0x0428, 0xb9ce, 0x0418, 0xb9ca, 0x0408, 0xb9c6, 0x00f8, 0xb9c2,
-	0x00e8, 0xb9be, 0x00d8, 0xb9ba, 0x00c8, 0xb9b6, 0x00b8, 0xb9b2,
-	0x00a8, 0xb9ae, 0x0098, 0xb9aa, 0x0088, 0xb9a6, 0x0078, 0xb9a2,
-	0x0068, 0xb99e, 0x0058, 0xb99a, 0x0048, 0xb996, 0x0038, 0xb992,
-	0x0028, 0xb98e, 0x0018, 0xb98a, 0x0008, 0xb986, 0x8631, 0x8421,
-	0x0120, 0x080c, 0x2048, 0x0804, 0x8bf9, 0x00ae, 0x00be, 0x00ce,
-	0x00ee, 0x0005, 0xa86c, 0xa06e, 0xa870, 0xa072, 0xa077, 0x00ff,
-	0x9006, 0x0804, 0x8bdb, 0x0006, 0x0016, 0x00b6, 0x6010, 0x2058,
-	0xb810, 0x9005, 0x01b0, 0x2001, 0x1924, 0x2004, 0x9005, 0x0188,
-	0x2001, 0x1800, 0x2004, 0x9086, 0x0003, 0x1158, 0x0036, 0x0046,
-	0xbba0, 0x2021, 0x0004, 0x2011, 0x8014, 0x080c, 0x4b04, 0x004e,
-	0x003e, 0x00be, 0x001e, 0x000e, 0x0005, 0x9016, 0x710c, 0xa834,
-	0x910a, 0xa936, 0x7008, 0x9005, 0x0120, 0x8210, 0x910a, 0x0238,
-	0x0130, 0x7010, 0x8210, 0x910a, 0x0210, 0x0108, 0x0cd8, 0xaa8a,
-	0xa26a, 0x0005, 0x00f6, 0x00d6, 0x0036, 0x2079, 0x0300, 0x781b,
-	0x0200, 0x7818, 0xd094, 0x1dd8, 0x781b, 0x0202, 0xa001, 0xa001,
-	0x7818, 0xd094, 0x1da0, 0xb8ac, 0x9005, 0x01b8, 0x2068, 0x2079,
-	0x0000, 0x2c08, 0x911e, 0x1118, 0x680c, 0xb8ae, 0x0060, 0x9106,
-	0x0140, 0x2d00, 0x2078, 0x680c, 0x9005, 0x090c, 0x0dd5, 0x2068,
-	0x0cb0, 0x6b0c, 0x7b0e, 0x600f, 0x0000, 0x2079, 0x0300, 0x781b,
-	0x0200, 0x003e, 0x00de, 0x00fe, 0x0005, 0x00e6, 0x00d6, 0x0096,
-	0x00c6, 0x0036, 0x0126, 0x2091, 0x8000, 0x0156, 0x20a9, 0x01ff,
-	0x2071, 0x0300, 0x701b, 0x0200, 0x7018, 0xd094, 0x0110, 0x1f04,
-	0x8d32, 0x701b, 0x0202, 0xa001, 0xa001, 0x7018, 0xd094, 0x1d90,
-	0xb8ac, 0x9005, 0x01d0, 0x2060, 0x600c, 0xb8ae, 0x6003, 0x0004,
-	0x601b, 0x0000, 0x6013, 0x0000, 0x601f, 0x0101, 0x6014, 0x2048,
-	0xa88b, 0x0000, 0xa8a8, 0xa8ab, 0x0000, 0x904d, 0x090c, 0x0dd5,
-	0x080c, 0x1031, 0x080c, 0x88ed, 0x0c18, 0x2071, 0x0300, 0x701b,
-	0x0200, 0x015e, 0x012e, 0x003e, 0x00ce, 0x009e, 0x00de, 0x00ee,
-	0x0005, 0x00c6, 0x00b6, 0x0016, 0x0006, 0x0156, 0x080c, 0x283e,
-	0x015e, 0x11b0, 0x080c, 0x659e, 0x190c, 0x0dd5, 0x000e, 0x001e,
-	0xb912, 0xb816, 0x080c, 0xae0b, 0x0140, 0x2b00, 0x6012, 0x6023,
-	0x0001, 0x2009, 0x0001, 0x080c, 0xaedc, 0x00be, 0x00ce, 0x0005,
-	0x000e, 0x001e, 0x0cd0, 0x0066, 0x6000, 0x90b2, 0x0016, 0x1a0c,
-	0x0dd5, 0x0013, 0x006e, 0x0005, 0x8da4, 0x8da4, 0x8da4, 0x8da6,
-	0x8df7, 0x8da4, 0x8da4, 0x8da4, 0x8e5a, 0x8da4, 0x8e97, 0x8da4,
-	0x8da4, 0x8da4, 0x8da4, 0x8da4, 0x080c, 0x0dd5, 0x9182, 0x0040,
-	0x0002, 0x8db9, 0x8db9, 0x8db9, 0x8db9, 0x8db9, 0x8db9, 0x8db9,
-	0x8db9, 0x8db9, 0x8dbb, 0x8dd0, 0x8db9, 0x8db9, 0x8db9, 0x8db9,
-	0x8de3, 0x080c, 0x0dd5, 0x0096, 0x080c, 0x963d, 0x080c, 0x97b9,
-	0x6114, 0x2148, 0xa87b, 0x0000, 0x6010, 0x00b6, 0x2058, 0xb8bb,
-	0x0500, 0x00be, 0x080c, 0x6a87, 0x080c, 0xae61, 0x009e, 0x0005,
-	0x080c, 0x963d, 0x00d6, 0x6114, 0x080c, 0xcb35, 0x0130, 0x0096,
-	0x6114, 0x2148, 0x080c, 0x6c81, 0x009e, 0x00de, 0x080c, 0xae61,
-	0x080c, 0x97b9, 0x0005, 0x080c, 0x963d, 0x080c, 0x31bf, 0x6114,
-	0x0096, 0x2148, 0x080c, 0xcb35, 0x0120, 0xa87b, 0x0029, 0x080c,
-	0x6c81, 0x009e, 0x080c, 0xae61, 0x080c, 0x97b9, 0x0005, 0x601b,
-	0x0000, 0x9182, 0x0040, 0x0096, 0x0002, 0x8e12, 0x8e12, 0x8e12,
-	0x8e12, 0x8e12, 0x8e12, 0x8e12, 0x8e12, 0x8e14, 0x8e12, 0x8e12,
-	0x8e12, 0x8e56, 0x8e12, 0x8e12, 0x8e12, 0x8e12, 0x8e12, 0x8e12,
-	0x8e1a, 0x8e12, 0x080c, 0x0dd5, 0x6114, 0x2148, 0xa938, 0x918e,
-	0xffff, 0x05e0, 0x00e6, 0x6114, 0x2148, 0x080c, 0x8bc3, 0x0096,
-	0xa8a8, 0x2048, 0x080c, 0x6a1f, 0x009e, 0xa8ab, 0x0000, 0x6010,
-	0x9005, 0x0128, 0x00b6, 0x2058, 0x080c, 0x8cf2, 0x00be, 0xae88,
-	0x00b6, 0x2059, 0x0000, 0x080c, 0x88f6, 0x00be, 0x01e0, 0x2071,
-	0x193c, 0x080c, 0x893d, 0x01b8, 0x9086, 0x0001, 0x1128, 0x2001,
-	0x1946, 0x2004, 0x9005, 0x1178, 0x0096, 0x080c, 0x0fff, 0x2900,
-	0x009e, 0x0148, 0xa8aa, 0x00f6, 0x2c78, 0x080c, 0x88b4, 0x00fe,
-	0x00ee, 0x009e, 0x0005, 0x080c, 0x88ed, 0x0cd0, 0x080c, 0x8f04,
-	0x009e, 0x0005, 0x9182, 0x0040, 0x0096, 0x0002, 0x8e6e, 0x8e6e,
-	0x8e6e, 0x8e70, 0x8e6e, 0x8e6e, 0x8e6e, 0x8e95, 0x8e6e, 0x8e6e,
-	0x8e6e, 0x8e6e, 0x8e6e, 0x8e6e, 0x8e6e, 0x8e6e, 0x080c, 0x0dd5,
-	0x6003, 0x0003, 0x6106, 0x6014, 0x2048, 0xa8ac, 0xa846, 0xa8b0,
-	0xa84a, 0xa837, 0x0000, 0xa83b, 0x0000, 0xa884, 0x9092, 0x199a,
-	0x0210, 0x2001, 0x1999, 0x8003, 0x8013, 0x8213, 0x9210, 0x621a,
-	0x2c10, 0x080c, 0x1bad, 0x080c, 0x9155, 0x0126, 0x2091, 0x8000,
-	0x080c, 0x97b9, 0x012e, 0x009e, 0x0005, 0x080c, 0x0dd5, 0x080c,
-	0x963d, 0x080c, 0x97b9, 0x6114, 0x2148, 0xa87b, 0x0000, 0x6010,
-	0x00b6, 0x2058, 0xb8bb, 0x0500, 0x00be, 0x080c, 0x6c81, 0x080c,
-	0xae61, 0x009e, 0x0005, 0x6000, 0x908a, 0x0016, 0x1a0c, 0x0dd5,
-	0x0096, 0x0013, 0x009e, 0x0005, 0x8ec4, 0x8ec4, 0x8ec4, 0x8ec6,
-	0x8ed7, 0x8ec4, 0x8ec4, 0x8ec4, 0x8ec4, 0x8ec4, 0x8ec4, 0x8ec4,
-	0x8ec4, 0x8ec4, 0x8ec4, 0x8ec4, 0x080c, 0x0dd5, 0x080c, 0xa7cc,
-	0x6114, 0x2148, 0xa87b, 0x0006, 0x6010, 0x00b6, 0x2058, 0xb8bb,
-	0x0500, 0x00be, 0x080c, 0x6c81, 0x080c, 0xae61, 0x0005, 0x0461,
-	0x0005, 0x6000, 0x908a, 0x0016, 0x1a0c, 0x0dd5, 0x0096, 0x0013,
-	0x009e, 0x0005, 0x8ef2, 0x8ef2, 0x8ef2, 0x8ef4, 0x8f04, 0x8ef2,
-	0x8ef2, 0x8ef2, 0x8ef2, 0x8ef2, 0x8ef2, 0x8ef2, 0x8ef2, 0x8ef2,
-	0x8ef2, 0x8ef2, 0x080c, 0x0dd5, 0x0036, 0x00e6, 0x2071, 0x19e7,
-	0x703c, 0x9c06, 0x1120, 0x2019, 0x0000, 0x080c, 0xa5b6, 0x080c,
-	0xa7cc, 0x00ee, 0x003e, 0x0005, 0x00f6, 0x00e6, 0x601b, 0x0000,
-	0x6014, 0x2048, 0x6010, 0x9005, 0x0128, 0x00b6, 0x2058, 0x080c,
-	0x8cf2, 0x00be, 0x2071, 0x193c, 0x080c, 0x893d, 0x0160, 0x2001,
-	0x187f, 0x2004, 0xa88a, 0x2031, 0x0000, 0x2c78, 0x080c, 0x88b4,
-	0x00ee, 0x00fe, 0x0005, 0x0096, 0xa88b, 0x0000, 0xa8a8, 0x2048,
-	0x080c, 0x1031, 0x009e, 0xa8ab, 0x0000, 0x080c, 0x88ed, 0x0c80,
-	0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
-	0x0000, 0x187a, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
-	0x0126, 0x2091, 0x8000, 0x0036, 0x0046, 0x20a9, 0x0010, 0x9006,
-	0x8004, 0x2019, 0x0100, 0x231c, 0x93a6, 0x0008, 0x1118, 0x8086,
-	0x818e, 0x0020, 0x80f6, 0x3e00, 0x81f6, 0x3e08, 0x1208, 0x9200,
-	0x1f04, 0x8f49, 0x93a6, 0x0008, 0x1118, 0x8086, 0x818e, 0x0020,
-	0x80f6, 0x3e00, 0x81f6, 0x3e08, 0x004e, 0x003e, 0x012e, 0x0005,
-	0x0126, 0x2091, 0x8000, 0x0076, 0x0156, 0x20a9, 0x0010, 0x9005,
-	0x0510, 0x911a, 0x1600, 0x8213, 0x2039, 0x0100, 0x273c, 0x97be,
-	0x0008, 0x1110, 0x818d, 0x0010, 0x81f5, 0x3e08, 0x0228, 0x911a,
-	0x1220, 0x1f04, 0x8f73, 0x0028, 0x911a, 0x2308, 0x8210, 0x1f04,
-	0x8f73, 0x0006, 0x3200, 0x9084, 0xefff, 0x2080, 0x000e, 0x015e,
-	0x007e, 0x012e, 0x0005, 0x0006, 0x3200, 0x9085, 0x1000, 0x0ca8,
-	0x0126, 0x2091, 0x2800, 0x2079, 0x19e7, 0x012e, 0x00d6, 0x2069,
-	0x19e7, 0x6803, 0x0005, 0x0156, 0x0146, 0x01d6, 0x20e9, 0x0000,
-	0x2069, 0x0200, 0x080c, 0xab21, 0x0401, 0x080c, 0xab0c, 0x00e9,
-	0x080c, 0xab0f, 0x00d1, 0x080c, 0xab12, 0x00b9, 0x080c, 0xab15,
-	0x00a1, 0x080c, 0xab18, 0x0089, 0x080c, 0xab1b, 0x0071, 0x080c,
-	0xab1e, 0x0059, 0x01de, 0x014e, 0x015e, 0x2069, 0x0004, 0x2d04,
-	0x9085, 0x8001, 0x206a, 0x00de, 0x0005, 0x20a9, 0x0020, 0x20a1,
-	0x0240, 0x2001, 0x0000, 0x4004, 0x0005, 0x00c6, 0x6027, 0x0001,
-	0x7804, 0x9084, 0x0007, 0x0002, 0x8fe6, 0x900a, 0x9049, 0x8fec,
-	0x900a, 0x8fe6, 0x8fe4, 0x8fe4, 0x080c, 0x0dd5, 0x080c, 0x8579,
-	0x080c, 0x968d, 0x00ce, 0x0005, 0x62c0, 0x82ff, 0x1110, 0x00ce,
-	0x0005, 0x2011, 0x5e83, 0x080c, 0x84f3, 0x7828, 0x9092, 0x00c8,
-	0x1228, 0x8000, 0x782a, 0x080c, 0x5ec3, 0x0c88, 0x62c0, 0x080c,
-	0xac5d, 0x080c, 0x5e83, 0x7807, 0x0003, 0x7827, 0x0000, 0x782b,
-	0x0000, 0x0c28, 0x080c, 0x8579, 0x6220, 0xd2a4, 0x0160, 0x782b,
-	0x0000, 0x7824, 0x9065, 0x090c, 0x0dd5, 0x2009, 0x0013, 0x080c,
-	0xaedc, 0x00ce, 0x0005, 0x00c6, 0x7824, 0x9065, 0x090c, 0x0dd5,
-	0x7828, 0x9092, 0xc350, 0x12c0, 0x8000, 0x782a, 0x00ce, 0x080c,
-	0x2ba5, 0x0278, 0x00c6, 0x7924, 0x2160, 0x6010, 0x906d, 0x090c,
-	0x0dd5, 0x7807, 0x0000, 0x7827, 0x0000, 0x00ce, 0x080c, 0x968d,
-	0x0c00, 0x080c, 0xa24f, 0x08e8, 0x2011, 0x0130, 0x2214, 0x080c,
-	0xac5d, 0x080c, 0xe9fe, 0x2009, 0x0014, 0x080c, 0xaedc, 0x00ce,
-	0x0880, 0x2001, 0x1a03, 0x2003, 0x0000, 0x62c0, 0x82ff, 0x1160,
+	0x2009, 0x0046, 0x080c, 0xaeec, 0x7817, 0x0140, 0x2001, 0x19ef,
+	0x2004, 0x9005, 0x090c, 0x9687, 0x00be, 0x0005, 0x00b6, 0x00c6,
+	0x9484, 0x0fff, 0x0904, 0x81ba, 0x7110, 0xd1bc, 0x1904, 0x81ba,
+	0x7108, 0x700c, 0x2028, 0x918c, 0x00ff, 0x2130, 0x9094, 0xff00,
+	0x15b0, 0x81ff, 0x15a0, 0x9080, 0x3327, 0x200d, 0x918c, 0xff00,
+	0x810f, 0x2001, 0x0080, 0x9106, 0x0904, 0x81ba, 0x080c, 0x65a7,
+	0x1904, 0x81ba, 0xbe12, 0xbd16, 0xb800, 0xd0ec, 0x15d8, 0xba04,
+	0x9294, 0xff00, 0x9286, 0x0600, 0x11a0, 0x080c, 0xae1b, 0x05e8,
+	0x2b08, 0x7028, 0x604a, 0x702c, 0x6046, 0x6112, 0x6023, 0x0006,
+	0x7120, 0x610a, 0x7130, 0x6156, 0x2009, 0x0044, 0x080c, 0xdb84,
+	0x0408, 0x080c, 0x697b, 0x1138, 0xb807, 0x0606, 0x0c30, 0x190c,
+	0x80a7, 0x11c0, 0x0898, 0x080c, 0xae1b, 0x2b08, 0x0198, 0x6112,
+	0x6023, 0x0004, 0x7120, 0x610a, 0x9286, 0x0400, 0x1118, 0x6007,
+	0x0005, 0x0010, 0x6007, 0x0001, 0x6003, 0x0001, 0x080c, 0x9121,
+	0x080c, 0x9687, 0x7817, 0x0140, 0x2001, 0x19ef, 0x2004, 0x9005,
+	0x090c, 0x9687, 0x00ce, 0x00be, 0x0005, 0x2001, 0x180e, 0x2004,
+	0xd0ec, 0x0120, 0x2011, 0x8049, 0x080c, 0x4b14, 0x080c, 0xaebf,
+	0x0d48, 0x2b08, 0x6112, 0x6023, 0x0006, 0x7120, 0x610a, 0x7130,
+	0x6156, 0x6017, 0xf300, 0x6003, 0x0001, 0x6007, 0x0041, 0x080c,
+	0x90d9, 0x080c, 0x9687, 0x08b0, 0x00b6, 0x7110, 0xd1bc, 0x01e8,
+	0x7020, 0x2060, 0x9c84, 0x0007, 0x11c0, 0x9c82, 0x1cd0, 0x02a8,
+	0x6868, 0x9c02, 0x1290, 0x7008, 0x9084, 0x00ff, 0x6110, 0x2158,
+	0xb910, 0x9106, 0x1150, 0x700c, 0xb914, 0x9106, 0x1130, 0x7124,
+	0x610a, 0x2009, 0x0045, 0x080c, 0xaeec, 0x7817, 0x0140, 0x2001,
+	0x19ef, 0x2004, 0x9005, 0x090c, 0x9687, 0x00be, 0x0005, 0x6120,
+	0x9186, 0x0002, 0x0128, 0x9186, 0x0005, 0x0110, 0x9085, 0x0001,
+	0x0005, 0x080c, 0x32e5, 0x1168, 0x7010, 0x9084, 0xff00, 0x8007,
+	0x9086, 0x0000, 0x1130, 0x9184, 0x000f, 0x908a, 0x0006, 0x1208,
+	0x000b, 0x0005, 0x8230, 0x8231, 0x8230, 0x8230, 0x8290, 0x829f,
+	0x0005, 0x00b6, 0x7110, 0xd1bc, 0x0120, 0x702c, 0xd084, 0x0904,
+	0x828e, 0x700c, 0x7108, 0x080c, 0x2840, 0x1904, 0x828e, 0x080c,
+	0x65a7, 0x1904, 0x828e, 0xbe12, 0xbd16, 0x7110, 0xd1bc, 0x01d8,
+	0x080c, 0x697b, 0x0118, 0x9086, 0x0004, 0x1588, 0x00c6, 0x080c,
+	0x82ae, 0x00ce, 0x05d8, 0x080c, 0xae1b, 0x2b08, 0x05b8, 0x6112,
+	0x080c, 0xcfc4, 0x6023, 0x0002, 0x7120, 0x610a, 0x2009, 0x0088,
+	0x080c, 0xaeec, 0x0458, 0x080c, 0x697b, 0x0148, 0x9086, 0x0004,
+	0x0130, 0x080c, 0x6983, 0x0118, 0x9086, 0x0004, 0x1180, 0x080c,
+	0xae1b, 0x2b08, 0x01d8, 0x6112, 0x080c, 0xcfc4, 0x6023, 0x0005,
+	0x7120, 0x610a, 0x2009, 0x0088, 0x080c, 0xaeec, 0x0078, 0x080c,
+	0xae1b, 0x2b08, 0x0158, 0x6112, 0x080c, 0xcfc4, 0x6023, 0x0004,
+	0x7120, 0x610a, 0x2009, 0x0001, 0x080c, 0xaeec, 0x00be, 0x0005,
+	0x7110, 0xd1bc, 0x0158, 0x00d1, 0x0148, 0x080c, 0x820f, 0x1130,
+	0x7124, 0x610a, 0x2009, 0x0089, 0x080c, 0xaeec, 0x0005, 0x7110,
+	0xd1bc, 0x0158, 0x0059, 0x0148, 0x080c, 0x820f, 0x1130, 0x7124,
+	0x610a, 0x2009, 0x008a, 0x080c, 0xaeec, 0x0005, 0x7020, 0x2060,
+	0x9c84, 0x0007, 0x1158, 0x9c82, 0x1cd0, 0x0240, 0x2001, 0x181a,
+	0x2004, 0x9c02, 0x1218, 0x9085, 0x0001, 0x0005, 0x9006, 0x0ce8,
+	0x00b6, 0x7110, 0xd1bc, 0x11d8, 0x7024, 0x2060, 0x9c84, 0x0007,
+	0x11b0, 0x9c82, 0x1cd0, 0x0298, 0x6868, 0x9c02, 0x1280, 0x7008,
+	0x9084, 0x00ff, 0x6110, 0x2158, 0xb910, 0x9106, 0x1140, 0x700c,
+	0xb914, 0x9106, 0x1120, 0x2009, 0x0051, 0x080c, 0xaeec, 0x7817,
+	0x0140, 0x2001, 0x19ef, 0x2004, 0x9005, 0x090c, 0x9687, 0x00be,
+	0x0005, 0x2031, 0x0105, 0x0069, 0x0005, 0x2031, 0x0206, 0x0049,
+	0x0005, 0x2031, 0x0207, 0x0029, 0x0005, 0x2031, 0x0213, 0x0009,
+	0x0005, 0x00c6, 0x0096, 0x00f6, 0x7000, 0x9084, 0xf000, 0x9086,
+	0xc000, 0x05d0, 0x080c, 0xae1b, 0x05b8, 0x0066, 0x00c6, 0x0046,
+	0x2011, 0x0263, 0x2204, 0x8211, 0x220c, 0x080c, 0x2840, 0x15a0,
+	0x080c, 0x65a7, 0x1588, 0xbe12, 0xbd16, 0x2b00, 0x004e, 0x00ce,
+	0x6012, 0x080c, 0xcfc4, 0x080c, 0x0fff, 0x0510, 0x2900, 0x605a,
+	0x9006, 0xa802, 0xa866, 0xac6a, 0xa85c, 0x90f8, 0x001b, 0x20a9,
+	0x000e, 0xa860, 0x20e8, 0x20e1, 0x0000, 0x2fa0, 0x2e98, 0x4003,
+	0x006e, 0x6616, 0x6007, 0x003e, 0x6023, 0x0001, 0x6003, 0x0001,
+	0x080c, 0x9121, 0x080c, 0x9687, 0x00fe, 0x009e, 0x00ce, 0x0005,
+	0x080c, 0xae71, 0x006e, 0x0cc0, 0x004e, 0x00ce, 0x0cc8, 0x00c6,
+	0x7000, 0x908c, 0xff00, 0x9184, 0xf000, 0x810f, 0x9086, 0x2000,
+	0x1904, 0x839e, 0x9186, 0x0022, 0x15f0, 0x2001, 0x0111, 0x2004,
+	0x9005, 0x1904, 0x83a0, 0x7030, 0x908e, 0x0400, 0x0904, 0x83a0,
+	0x908e, 0x6000, 0x05e8, 0x908e, 0x5400, 0x05d0, 0x908e, 0x0300,
+	0x11d8, 0x2009, 0x1837, 0x210c, 0xd18c, 0x1590, 0xd1a4, 0x1580,
+	0x080c, 0x6939, 0x0558, 0x68b0, 0x9084, 0x00ff, 0x7100, 0x918c,
+	0x00ff, 0x9106, 0x1518, 0x6880, 0x69b0, 0x918c, 0xff00, 0x9105,
+	0x7104, 0x9106, 0x11d8, 0x00e0, 0x2009, 0x0103, 0x210c, 0xd1b4,
+	0x11a8, 0x908e, 0x5200, 0x09e8, 0x908e, 0x0500, 0x09d0, 0x908e,
+	0x5000, 0x09b8, 0x0058, 0x9186, 0x0023, 0x1140, 0x080c, 0x82ae,
+	0x0128, 0x6004, 0x9086, 0x0002, 0x0118, 0x0000, 0x9006, 0x0010,
+	0x9085, 0x0001, 0x00ce, 0x0005, 0x0156, 0x0046, 0x0016, 0x0036,
+	0x7038, 0x2020, 0x8427, 0x94a4, 0x0007, 0xd484, 0x0148, 0x20a9,
+	0x0004, 0x2019, 0x1805, 0x2011, 0x027a, 0x080c, 0xbe1c, 0x1178,
+	0xd48c, 0x0148, 0x20a9, 0x0004, 0x2019, 0x1801, 0x2011, 0x027e,
+	0x080c, 0xbe1c, 0x1120, 0xd494, 0x0110, 0x9085, 0x0001, 0x003e,
+	0x001e, 0x004e, 0x015e, 0x0005, 0x0156, 0x0046, 0x0016, 0x0036,
+	0x7038, 0x2020, 0x8427, 0x94a4, 0x0007, 0xd484, 0x0148, 0x20a9,
+	0x0004, 0x2019, 0x1805, 0x2011, 0x0272, 0x080c, 0xbe1c, 0x1178,
+	0xd48c, 0x0148, 0x20a9, 0x0004, 0x2019, 0x1801, 0x2011, 0x0276,
+	0x080c, 0xbe1c, 0x1120, 0xd494, 0x0110, 0x9085, 0x0001, 0x003e,
+	0x001e, 0x004e, 0x015e, 0x0005, 0x00f6, 0x2079, 0x0200, 0x7800,
+	0xc0e5, 0xc0cc, 0x7802, 0x00fe, 0x0005, 0x00f6, 0x2079, 0x1800,
+	0x7834, 0xd084, 0x1130, 0x2079, 0x0200, 0x7800, 0x9085, 0x1200,
+	0x7802, 0x00fe, 0x0005, 0x00e6, 0x2071, 0x1800, 0x7034, 0xc084,
+	0x7036, 0x00ee, 0x0005, 0x2071, 0x19f9, 0x7003, 0x0003, 0x700f,
+	0x0361, 0x9006, 0x701a, 0x7072, 0x7012, 0x7017, 0x1cd0, 0x7007,
+	0x0000, 0x7026, 0x702b, 0xa28a, 0x7032, 0x7037, 0xa2f8, 0x703f,
+	0xffff, 0x7042, 0x7047, 0x5577, 0x704a, 0x705b, 0x857d, 0x080c,
+	0x1018, 0x090c, 0x0dd5, 0x2900, 0x703a, 0xa867, 0x0003, 0xa86f,
+	0x0100, 0xa8ab, 0xdcb0, 0x0005, 0x2071, 0x19f9, 0x1d04, 0x84cb,
+	0x2091, 0x6000, 0x700c, 0x8001, 0x700e, 0x1530, 0x2001, 0x013c,
+	0x2004, 0x9005, 0x190c, 0x85c2, 0x2001, 0x1869, 0x2004, 0xd0c4,
+	0x0158, 0x3a00, 0xd08c, 0x1140, 0x20d1, 0x0000, 0x20d1, 0x0001,
+	0x20d1, 0x0000, 0x080c, 0x0dd5, 0x700f, 0x0361, 0x7007, 0x0001,
+	0x0126, 0x2091, 0x8000, 0x7040, 0x900d, 0x0148, 0x8109, 0x7142,
+	0x1130, 0x7044, 0x080f, 0x0018, 0x0126, 0x2091, 0x8000, 0x7024,
+	0x900d, 0x0188, 0x7020, 0x8001, 0x7022, 0x1168, 0x7023, 0x0009,
+	0x8109, 0x7126, 0x9186, 0x03e8, 0x1110, 0x7028, 0x080f, 0x81ff,
+	0x1110, 0x7028, 0x080f, 0x7030, 0x900d, 0x0180, 0x702c, 0x8001,
+	0x702e, 0x1160, 0x702f, 0x0009, 0x8109, 0x7132, 0x0128, 0x9184,
+	0x007f, 0x090c, 0xa419, 0x0010, 0x7034, 0x080f, 0x703c, 0x9005,
+	0x0118, 0x0310, 0x8001, 0x703e, 0x704c, 0x900d, 0x0168, 0x7048,
+	0x8001, 0x704a, 0x1148, 0x704b, 0x0009, 0x8109, 0x714e, 0x1120,
+	0x7150, 0x714e, 0x7058, 0x080f, 0x7018, 0x900d, 0x01d8, 0x0016,
+	0x7070, 0x900d, 0x0158, 0x706c, 0x8001, 0x706e, 0x1138, 0x706f,
+	0x0009, 0x8109, 0x7172, 0x1110, 0x7074, 0x080f, 0x001e, 0x7008,
+	0x8001, 0x700a, 0x1138, 0x700b, 0x0009, 0x8109, 0x711a, 0x1110,
+	0x701c, 0x080f, 0x012e, 0x7004, 0x0002, 0x84f3, 0x84f4, 0x8510,
+	0x00e6, 0x2071, 0x19f9, 0x7018, 0x9005, 0x1120, 0x711a, 0x721e,
+	0x700b, 0x0009, 0x00ee, 0x0005, 0x00e6, 0x0006, 0x2071, 0x19f9,
+	0x701c, 0x9206, 0x1120, 0x701a, 0x701e, 0x7072, 0x7076, 0x000e,
+	0x00ee, 0x0005, 0x00e6, 0x2071, 0x19f9, 0xb888, 0x9102, 0x0208,
+	0xb98a, 0x00ee, 0x0005, 0x0005, 0x00b6, 0x7110, 0x080c, 0x6608,
+	0x1168, 0xb888, 0x8001, 0x0250, 0xb88a, 0x1140, 0x0126, 0x2091,
+	0x8000, 0x0016, 0x080c, 0x9687, 0x001e, 0x012e, 0x8108, 0x9182,
+	0x0800, 0x0218, 0x900e, 0x7007, 0x0002, 0x7112, 0x00be, 0x0005,
+	0x7014, 0x2060, 0x0126, 0x2091, 0x8000, 0x6040, 0x9005, 0x0128,
+	0x8001, 0x6042, 0x1110, 0x080c, 0xce55, 0x6018, 0x9005, 0x0558,
+	0x8001, 0x601a, 0x1540, 0x6120, 0x9186, 0x0003, 0x0148, 0x9186,
+	0x0006, 0x0130, 0x9186, 0x0009, 0x11e0, 0x611c, 0xd1c4, 0x1100,
+	0x080c, 0xcb4a, 0x01b0, 0x6014, 0x2048, 0xa884, 0x908a, 0x199a,
+	0x0280, 0x9082, 0x1999, 0xa886, 0x908a, 0x199a, 0x0210, 0x2001,
+	0x1999, 0x8003, 0x800b, 0x810b, 0x9108, 0x611a, 0xa87c, 0xd0e4,
+	0x0110, 0x080c, 0xc846, 0x012e, 0x9c88, 0x0018, 0x7116, 0x2001,
+	0x181a, 0x2004, 0x9102, 0x0220, 0x7017, 0x1cd0, 0x7007, 0x0000,
+	0x0005, 0x00e6, 0x2071, 0x19f9, 0x7027, 0x07d0, 0x7023, 0x0009,
+	0x00ee, 0x0005, 0x2001, 0x1a02, 0x2003, 0x0000, 0x0005, 0x00e6,
+	0x2071, 0x19f9, 0x7132, 0x702f, 0x0009, 0x00ee, 0x0005, 0x2011,
+	0x1a05, 0x2013, 0x0000, 0x0005, 0x00e6, 0x2071, 0x19f9, 0x711a,
+	0x721e, 0x700b, 0x0009, 0x00ee, 0x0005, 0x0086, 0x0026, 0x7054,
+	0x8000, 0x7056, 0x2001, 0x1a07, 0x2044, 0xa06c, 0x9086, 0x0000,
+	0x0150, 0x7068, 0xa09a, 0x7064, 0xa096, 0x7060, 0xa092, 0x705c,
+	0xa08e, 0x080c, 0x10e9, 0x002e, 0x008e, 0x0005, 0x0006, 0x0016,
+	0x0096, 0x00a6, 0x00b6, 0x00c6, 0x00d6, 0x00e6, 0x00f6, 0x0156,
+	0x080c, 0x843c, 0x015e, 0x00fe, 0x00ee, 0x00de, 0x00ce, 0x00be,
+	0x00ae, 0x009e, 0x001e, 0x000e, 0x0005, 0x00e6, 0x2071, 0x19f9,
+	0x7172, 0x7276, 0x706f, 0x0009, 0x00ee, 0x0005, 0x00e6, 0x0006,
+	0x2071, 0x19f9, 0x7074, 0x9206, 0x1110, 0x7072, 0x7076, 0x000e,
+	0x00ee, 0x0005, 0x0016, 0x00c6, 0x2009, 0xfffc, 0x210d, 0x2061,
+	0x0100, 0x60f0, 0x9100, 0x60f3, 0x0000, 0x2009, 0xfffc, 0x200f,
+	0x1220, 0x8108, 0x2105, 0x8000, 0x200f, 0x00ce, 0x001e, 0x0005,
+	0x00c6, 0x2061, 0x1a70, 0x00ce, 0x0005, 0x9184, 0x000f, 0x8003,
+	0x8003, 0x8003, 0x9080, 0x1a70, 0x2060, 0x0005, 0xa884, 0x908a,
+	0x199a, 0x1638, 0x9005, 0x1150, 0x00c6, 0x2061, 0x1a70, 0x6014,
+	0x00ce, 0x9005, 0x1130, 0x2001, 0x001e, 0x0018, 0x908e, 0xffff,
+	0x01b0, 0x8003, 0x800b, 0x810b, 0x9108, 0x611a, 0xa87c, 0x908c,
+	0x00c0, 0x918e, 0x00c0, 0x0904, 0x8670, 0xd0b4, 0x1168, 0xd0bc,
+	0x1904, 0x8649, 0x2009, 0x0006, 0x080c, 0x869d, 0x0005, 0x900e,
+	0x0c60, 0x2001, 0x1999, 0x08b0, 0xd0fc, 0x0160, 0x908c, 0x0003,
+	0x0120, 0x918e, 0x0003, 0x1904, 0x8697, 0x908c, 0x2020, 0x918e,
+	0x2020, 0x01a8, 0x6024, 0xd0d4, 0x11e8, 0x2009, 0x1869, 0x2104,
+	0xd084, 0x1138, 0x87ff, 0x1120, 0x2009, 0x0043, 0x0804, 0xaeec,
+	0x0005, 0x87ff, 0x1de8, 0x2009, 0x0042, 0x0804, 0xaeec, 0x6110,
+	0x00b6, 0x2158, 0xb900, 0x00be, 0xd1ac, 0x0d20, 0x6024, 0xc0cd,
+	0x6026, 0x0c00, 0xc0d4, 0x6026, 0xa890, 0x602e, 0xa88c, 0x6032,
+	0x08e0, 0xd0fc, 0x0160, 0x908c, 0x0003, 0x0120, 0x918e, 0x0003,
+	0x1904, 0x8697, 0x908c, 0x2020, 0x918e, 0x2020, 0x0170, 0x0076,
+	0x00f6, 0x2c78, 0x080c, 0x1727, 0x00fe, 0x007e, 0x87ff, 0x1120,
+	0x2009, 0x0042, 0x080c, 0xaeec, 0x0005, 0x6110, 0x00b6, 0x2158,
+	0xb900, 0x00be, 0xd1ac, 0x0d58, 0x6124, 0xc1cd, 0x6126, 0x0c38,
+	0xd0fc, 0x0188, 0x908c, 0x2020, 0x918e, 0x2020, 0x01a8, 0x9084,
+	0x0003, 0x908e, 0x0002, 0x0148, 0x87ff, 0x1120, 0x2009, 0x0041,
+	0x080c, 0xaeec, 0x0005, 0x00b9, 0x0ce8, 0x87ff, 0x1dd8, 0x2009,
+	0x0043, 0x080c, 0xaeec, 0x0cb0, 0x6110, 0x00b6, 0x2158, 0xb900,
+	0x00be, 0xd1ac, 0x0d20, 0x6124, 0xc1cd, 0x6126, 0x0c00, 0x2009,
+	0x0004, 0x0019, 0x0005, 0x2009, 0x0001, 0x0096, 0x080c, 0xcb4a,
+	0x0518, 0x6014, 0x2048, 0xa982, 0xa800, 0x6016, 0x9186, 0x0001,
+	0x1188, 0xa97c, 0x918c, 0x8100, 0x918e, 0x8100, 0x1158, 0x00c6,
+	0x2061, 0x1a70, 0x6200, 0xd28c, 0x1120, 0x6204, 0x8210, 0x0208,
+	0x6206, 0x00ce, 0x080c, 0x6ac1, 0x6014, 0x904d, 0x0076, 0x2039,
+	0x0000, 0x190c, 0x85e6, 0x007e, 0x009e, 0x0005, 0x0156, 0x00c6,
+	0x2061, 0x1a70, 0x6000, 0x81ff, 0x0110, 0x9205, 0x0008, 0x9204,
+	0x6002, 0x00ce, 0x015e, 0x0005, 0x6800, 0xd08c, 0x1138, 0x6808,
+	0x9005, 0x0120, 0x8001, 0x680a, 0x9085, 0x0001, 0x0005, 0x2071,
+	0x1923, 0x7003, 0x0006, 0x7007, 0x0000, 0x700f, 0x0000, 0x7013,
+	0x0001, 0x080c, 0x1018, 0x090c, 0x0dd5, 0xa867, 0x0006, 0xa86b,
+	0x0001, 0xa8ab, 0xdcb0, 0xa89f, 0x0000, 0x2900, 0x702e, 0x7033,
+	0x0000, 0x0005, 0x0096, 0x00e6, 0x2071, 0x1923, 0x702c, 0x2048,
+	0x6a2c, 0x721e, 0x6b30, 0x7322, 0x6834, 0x7026, 0xa896, 0x6838,
+	0x702a, 0xa89a, 0x6824, 0x7016, 0x683c, 0x701a, 0x2009, 0x0028,
+	0x200a, 0x9005, 0x0148, 0x900e, 0x9188, 0x000c, 0x8001, 0x1de0,
+	0x2100, 0x9210, 0x1208, 0x8318, 0xaa8e, 0xab92, 0x7010, 0xd084,
+	0x0178, 0xc084, 0x7007, 0x0001, 0x700f, 0x0000, 0x0006, 0x2009,
+	0x181d, 0x2104, 0x9082, 0x0007, 0x2009, 0x1ac7, 0x200a, 0x000e,
+	0xc095, 0x7012, 0x2008, 0x2001, 0x003b, 0x080c, 0x15f0, 0x9006,
+	0x2071, 0x193c, 0x7002, 0x7006, 0x702a, 0x00ee, 0x009e, 0x0005,
+	0x00e6, 0x0126, 0x0156, 0x2091, 0x8000, 0x2071, 0x1800, 0x7154,
+	0x2001, 0x0008, 0x910a, 0x0638, 0x2001, 0x187d, 0x20ac, 0x9006,
+	0x9080, 0x0008, 0x1f04, 0x8750, 0x71c0, 0x9102, 0x02e0, 0x2071,
+	0x1877, 0x20a9, 0x0007, 0x00c6, 0x080c, 0xae1b, 0x6023, 0x0009,
+	0x6003, 0x0004, 0x601f, 0x0101, 0x0089, 0x0126, 0x2091, 0x8000,
+	0x080c, 0x88d6, 0x012e, 0x1f04, 0x875c, 0x9006, 0x00ce, 0x015e,
+	0x012e, 0x00ee, 0x0005, 0x9085, 0x0001, 0x0cc8, 0x00e6, 0x00b6,
+	0x0096, 0x0086, 0x0056, 0x0046, 0x0026, 0x7118, 0x720c, 0x7620,
+	0x7004, 0xd084, 0x1128, 0x2021, 0x0024, 0x2029, 0x0002, 0x0020,
+	0x2021, 0x002c, 0x2029, 0x000a, 0x080c, 0x0fff, 0x090c, 0x0dd5,
+	0x2900, 0x6016, 0x2058, 0xac66, 0x9006, 0xa802, 0xa806, 0xa86a,
+	0xa87a, 0xa8aa, 0xa887, 0x0005, 0xa87f, 0x0020, 0x7008, 0xa89a,
+	0x7010, 0xa89e, 0xae8a, 0xa8af, 0xffff, 0xa8b3, 0x0000, 0x8109,
+	0x0160, 0x080c, 0x0fff, 0x090c, 0x0dd5, 0xad66, 0x2b00, 0xa802,
+	0x2900, 0xb806, 0x2058, 0x8109, 0x1da0, 0x002e, 0x004e, 0x005e,
+	0x008e, 0x009e, 0x00be, 0x00ee, 0x0005, 0x2079, 0x0000, 0x2071,
+	0x1923, 0x7004, 0x004b, 0x700c, 0x0002, 0x87c8, 0x87c1, 0x87c1,
+	0x0005, 0x87d2, 0x8833, 0x8833, 0x8833, 0x8834, 0x8845, 0x8845,
+	0x700c, 0x0cba, 0x0126, 0x2091, 0x8000, 0x78a0, 0x79a0, 0x9106,
+	0x0128, 0x78a0, 0x79a0, 0x9106, 0x1904, 0x8826, 0x2001, 0x0005,
+	0x2004, 0xd0bc, 0x0130, 0x2011, 0x0004, 0x2204, 0xc0c5, 0x2012,
+	0x0ca8, 0x012e, 0x7018, 0x910a, 0x1130, 0x7030, 0x9005, 0x05a8,
+	0x080c, 0x8874, 0x0490, 0x1210, 0x7114, 0x910a, 0x9192, 0x000a,
+	0x0210, 0x2009, 0x000a, 0x2001, 0x1888, 0x2014, 0x2001, 0x1935,
+	0x2004, 0x9100, 0x9202, 0x0e48, 0x080c, 0x89c0, 0x2200, 0x9102,
+	0x0208, 0x2208, 0x0096, 0x702c, 0x2048, 0xa873, 0x0001, 0xa976,
+	0x080c, 0x8ac9, 0x2100, 0xa87e, 0xa86f, 0x0000, 0x009e, 0x0126,
+	0x2091, 0x8000, 0x2009, 0x1a17, 0x2104, 0xc085, 0x200a, 0x700f,
+	0x0002, 0x012e, 0x080c, 0x1108, 0x1de8, 0x0005, 0x2001, 0x0005,
+	0x2004, 0xd0bc, 0x0130, 0x2011, 0x0004, 0x2204, 0xc0c5, 0x2012,
+	0x0ca8, 0x012e, 0x0005, 0x0005, 0x700c, 0x0002, 0x8839, 0x883c,
+	0x883b, 0x080c, 0x87d0, 0x0005, 0x8001, 0x700e, 0x0096, 0x702c,
+	0x2048, 0xa974, 0x009e, 0x0011, 0x0ca0, 0x0005, 0x0096, 0x702c,
+	0x2048, 0x7018, 0x9100, 0x7214, 0x921a, 0x1130, 0x701c, 0xa88e,
+	0x7020, 0xa892, 0x9006, 0x0068, 0x0006, 0x080c, 0x8ac9, 0x2100,
+	0xaa8c, 0x9210, 0xaa8e, 0x1220, 0xa890, 0x9081, 0x0000, 0xa892,
+	0x000e, 0x009e, 0x2f08, 0x9188, 0x0028, 0x200a, 0x701a, 0x0005,
+	0x00e6, 0x2071, 0x1923, 0x700c, 0x0002, 0x8872, 0x8872, 0x8870,
+	0x700f, 0x0001, 0x00ee, 0x0005, 0x0126, 0x2091, 0x8000, 0x7030,
+	0x9005, 0x0508, 0x2078, 0x7814, 0x2048, 0xae88, 0x00b6, 0x2059,
+	0x0000, 0x080c, 0x88df, 0x00be, 0x01b0, 0x00e6, 0x2071, 0x193c,
+	0x080c, 0x8926, 0x00ee, 0x0178, 0x0096, 0x080c, 0x1018, 0x2900,
+	0x009e, 0x0148, 0xa8aa, 0x04b9, 0x0041, 0x2001, 0x1946, 0x2003,
+	0x0000, 0x012e, 0x08c8, 0x012e, 0x0005, 0x00d6, 0x00c6, 0x0086,
+	0x00a6, 0x2940, 0x2650, 0x2600, 0x9005, 0x0180, 0xa864, 0x9084,
+	0x000f, 0x2068, 0x9d88, 0x2092, 0x2165, 0x0056, 0x2029, 0x0000,
+	0x080c, 0x8a4e, 0x080c, 0x204a, 0x1dd8, 0x005e, 0x00ae, 0x2001,
+	0x187f, 0x2004, 0xa88a, 0x080c, 0x1727, 0x781f, 0x0101, 0x7813,
+	0x0000, 0x0126, 0x2091, 0x8000, 0x080c, 0x8935, 0x012e, 0x008e,
+	0x00ce, 0x00de, 0x0005, 0x7030, 0x9005, 0x0138, 0x2078, 0x780c,
+	0x7032, 0x2001, 0x1946, 0x2003, 0x0001, 0x0005, 0x00e6, 0x2071,
+	0x1923, 0x7030, 0x600e, 0x2c00, 0x7032, 0x00ee, 0x0005, 0x00d6,
+	0x00c6, 0x0026, 0x9b80, 0x8ba8, 0x2005, 0x906d, 0x090c, 0x0dd5,
+	0x9b80, 0x8ba0, 0x2005, 0x9065, 0x090c, 0x0dd5, 0x6114, 0x2600,
+	0x9102, 0x0248, 0x6828, 0x9102, 0x02f0, 0x9085, 0x0001, 0x002e,
+	0x00ce, 0x00de, 0x0005, 0x6804, 0xd094, 0x0148, 0x6854, 0xd084,
+	0x1178, 0xc085, 0x6856, 0x2011, 0x8026, 0x080c, 0x4b14, 0x684c,
+	0x0096, 0x904d, 0x090c, 0x0dd5, 0xa804, 0x8000, 0xa806, 0x009e,
+	0x9006, 0x2030, 0x0c20, 0x6854, 0xd08c, 0x1d08, 0xc08d, 0x6856,
+	0x2011, 0x8025, 0x080c, 0x4b14, 0x684c, 0x0096, 0x904d, 0x090c,
+	0x0dd5, 0xa800, 0x8000, 0xa802, 0x009e, 0x0888, 0x7000, 0x2019,
+	0x0008, 0x8319, 0x7104, 0x9102, 0x1118, 0x2300, 0x9005, 0x0020,
+	0x0210, 0x9302, 0x0008, 0x8002, 0x0005, 0x00d6, 0x7814, 0x9005,
+	0x090c, 0x0dd5, 0x781c, 0x9084, 0x0101, 0x9086, 0x0101, 0x190c,
+	0x0dd5, 0x2069, 0x193c, 0x6804, 0x9080, 0x193e, 0x2f08, 0x2102,
+	0x6904, 0x8108, 0x9182, 0x0008, 0x0208, 0x900e, 0x6906, 0x9180,
+	0x193e, 0x2003, 0x0000, 0x00de, 0x0005, 0x0096, 0x00c6, 0x2060,
+	0x6014, 0x2048, 0xa8a8, 0x0096, 0x2048, 0x9005, 0x190c, 0x1031,
+	0x009e, 0xa8ab, 0x0000, 0x080c, 0x0fb1, 0x080c, 0xae71, 0x00ce,
+	0x009e, 0x0005, 0x6020, 0x9086, 0x0009, 0x1128, 0x601c, 0xd0c4,
+	0x0110, 0x9006, 0x0005, 0x9085, 0x0001, 0x0005, 0x6000, 0x9086,
+	0x0000, 0x0178, 0x6010, 0x9005, 0x0150, 0x00b6, 0x2058, 0x080c,
+	0x8cdb, 0x00be, 0x6013, 0x0000, 0x601b, 0x0000, 0x0010, 0x2c00,
+	0x0861, 0x0005, 0x2009, 0x1927, 0x210c, 0xd194, 0x0005, 0x00e6,
+	0x2071, 0x1923, 0x7110, 0xc194, 0xd19c, 0x1118, 0xc185, 0x7007,
+	0x0000, 0x7112, 0x2001, 0x003b, 0x080c, 0x15f0, 0x00ee, 0x0005,
+	0x0096, 0x00d6, 0x9006, 0x7006, 0x700e, 0x701a, 0x701e, 0x7022,
+	0x7016, 0x702a, 0x7026, 0x702f, 0x0000, 0x080c, 0x8b28, 0x0170,
+	0x080c, 0x8b5d, 0x0158, 0x2900, 0x7002, 0x700a, 0x701a, 0x7013,
+	0x0001, 0x701f, 0x000a, 0x00de, 0x009e, 0x0005, 0x900e, 0x0cd8,
+	0x00e6, 0x0096, 0x0086, 0x00d6, 0x00c6, 0x2071, 0x1930, 0x721c,
+	0x2100, 0x9202, 0x1618, 0x080c, 0x8b5d, 0x090c, 0x0dd5, 0x7018,
+	0x9005, 0x1160, 0x2900, 0x7002, 0x700a, 0x701a, 0x9006, 0x7006,
+	0x700e, 0xa806, 0xa802, 0x7012, 0x701e, 0x0038, 0x2040, 0xa806,
+	0x2900, 0xa002, 0x701a, 0xa803, 0x0000, 0x7010, 0x8000, 0x7012,
+	0x701c, 0x9080, 0x000a, 0x701e, 0x721c, 0x08d0, 0x721c, 0x00ce,
+	0x00de, 0x008e, 0x009e, 0x00ee, 0x0005, 0x0096, 0x0156, 0x0136,
+	0x0146, 0x00e6, 0x0126, 0x2091, 0x8000, 0x2071, 0x1930, 0x7300,
+	0x831f, 0x831e, 0x831e, 0x9384, 0x003f, 0x20e8, 0x939c, 0xffc0,
+	0x9398, 0x0003, 0x7104, 0x080c, 0x8ac9, 0x810c, 0x2100, 0x9318,
+	0x8003, 0x2228, 0x2021, 0x0078, 0x9402, 0x9532, 0x0208, 0x2028,
+	0x2500, 0x8004, 0x20a8, 0x23a0, 0xa001, 0xa001, 0x4005, 0x2508,
+	0x080c, 0x8ad2, 0x2130, 0x7014, 0x9600, 0x7016, 0x2600, 0x711c,
+	0x9102, 0x701e, 0x7004, 0x9600, 0x2008, 0x9082, 0x000a, 0x1190,
+	0x7000, 0x2048, 0xa800, 0x9005, 0x1148, 0x2009, 0x0001, 0x0026,
+	0x080c, 0x89c0, 0x002e, 0x7000, 0x2048, 0xa800, 0x7002, 0x7007,
+	0x0000, 0x0008, 0x7106, 0x2500, 0x9212, 0x1904, 0x89ff, 0x012e,
+	0x00ee, 0x014e, 0x013e, 0x015e, 0x009e, 0x0005, 0x0016, 0x0026,
+	0x00e6, 0x0126, 0x2091, 0x8000, 0x9580, 0x8ba0, 0x2005, 0x9075,
+	0x090c, 0x0dd5, 0x080c, 0x8aa4, 0x012e, 0x9580, 0x8b9c, 0x2005,
+	0x9075, 0x090c, 0x0dd5, 0x0156, 0x0136, 0x01c6, 0x0146, 0x01d6,
+	0x831f, 0x831e, 0x831e, 0x9384, 0x003f, 0x20e0, 0x9384, 0xffc0,
+	0x9100, 0x2098, 0xa860, 0x20e8, 0xa95c, 0x2c05, 0x9100, 0x20a0,
+	0x20a9, 0x0002, 0x4003, 0x2e0c, 0x2d00, 0x0002, 0x8a8e, 0x8a8e,
+	0x8a90, 0x8a8e, 0x8a90, 0x8a8e, 0x8a8e, 0x8a8e, 0x8a8e, 0x8a8e,
+	0x8a96, 0x8a8e, 0x8a96, 0x8a8e, 0x8a8e, 0x8a8e, 0x080c, 0x0dd5,
+	0x4104, 0x20a9, 0x0002, 0x4002, 0x4003, 0x0028, 0x20a9, 0x0002,
+	0x4003, 0x4104, 0x4003, 0x01de, 0x014e, 0x01ce, 0x013e, 0x015e,
+	0x00ee, 0x002e, 0x001e, 0x0005, 0x0096, 0x7014, 0x8001, 0x7016,
+	0x710c, 0x2110, 0x00f1, 0x810c, 0x9188, 0x0003, 0x7308, 0x8210,
+	0x9282, 0x000a, 0x1198, 0x7008, 0x2048, 0xa800, 0x9005, 0x0158,
+	0x0006, 0x080c, 0x8b6c, 0x009e, 0xa807, 0x0000, 0x2900, 0x700a,
+	0x7010, 0x8001, 0x7012, 0x700f, 0x0000, 0x0008, 0x720e, 0x009e,
+	0x0005, 0x0006, 0x810b, 0x810b, 0x2100, 0x810b, 0x9100, 0x2008,
+	0x000e, 0x0005, 0x0006, 0x0026, 0x2100, 0x9005, 0x0158, 0x9092,
+	0x000c, 0x0240, 0x900e, 0x8108, 0x9082, 0x000c, 0x1de0, 0x002e,
+	0x000e, 0x0005, 0x900e, 0x0cd8, 0x2d00, 0x90b8, 0x0008, 0x690c,
+	0x6810, 0x2019, 0x0001, 0x2031, 0x8b12, 0x9112, 0x0220, 0x0118,
+	0x8318, 0x2208, 0x0cd0, 0x6808, 0x9005, 0x0108, 0x8318, 0x233a,
+	0x6804, 0xd084, 0x2300, 0x2021, 0x0001, 0x1150, 0x9082, 0x0003,
+	0x0967, 0x0a67, 0x8420, 0x9082, 0x0007, 0x0967, 0x0a67, 0x0cd0,
+	0x9082, 0x0002, 0x0967, 0x0a67, 0x8420, 0x9082, 0x0005, 0x0967,
+	0x0a67, 0x0cd0, 0x6c1a, 0x2d00, 0x90b8, 0x0007, 0x00e6, 0x2071,
+	0x1800, 0x7128, 0x6810, 0x2019, 0x0001, 0x910a, 0x0118, 0x0210,
+	0x8318, 0x0cd8, 0x2031, 0x8b25, 0x0870, 0x6c16, 0x00ee, 0x0005,
+	0x0096, 0x0046, 0x0126, 0x2091, 0x8000, 0x2b00, 0x9080, 0x8ba4,
+	0x2005, 0x9005, 0x090c, 0x0dd5, 0x2004, 0x90a0, 0x000a, 0x080c,
+	0x1018, 0x01d0, 0x2900, 0x7026, 0xa803, 0x0000, 0xa807, 0x0000,
+	0x080c, 0x1018, 0x0188, 0x7024, 0xa802, 0xa807, 0x0000, 0x2900,
+	0x7026, 0x94a2, 0x000a, 0x0110, 0x0208, 0x0c90, 0x9085, 0x0001,
+	0x012e, 0x004e, 0x009e, 0x0005, 0x7024, 0x9005, 0x0dc8, 0x2048,
+	0xac00, 0x080c, 0x1031, 0x2400, 0x0cc0, 0x0126, 0x2091, 0x8000,
+	0x7024, 0x2048, 0x9005, 0x0130, 0xa800, 0x7026, 0xa803, 0x0000,
+	0xa807, 0x0000, 0x012e, 0x0005, 0x0126, 0x2091, 0x8000, 0x7024,
+	0xa802, 0x2900, 0x7026, 0x012e, 0x0005, 0x0096, 0x9e80, 0x0009,
+	0x2004, 0x9005, 0x0138, 0x2048, 0xa800, 0x0006, 0x080c, 0x1031,
+	0x000e, 0x0cb8, 0x009e, 0x0005, 0x0096, 0x7008, 0x9005, 0x0138,
+	0x2048, 0xa800, 0x0006, 0x080c, 0x1031, 0x000e, 0x0cb8, 0x9006,
+	0x7002, 0x700a, 0x7006, 0x700e, 0x701a, 0x701e, 0x7022, 0x702a,
+	0x7026, 0x702e, 0x009e, 0x0005, 0x1a63, 0x0000, 0x0000, 0x0000,
+	0x1930, 0x0000, 0x0000, 0x0000, 0x1888, 0x0000, 0x0000, 0x0000,
+	0x1877, 0x0000, 0x0000, 0x0000, 0x00e6, 0x00c6, 0x00b6, 0x00a6,
+	0xa8a8, 0x2040, 0x2071, 0x1877, 0x080c, 0x8cc6, 0xa067, 0x0023,
+	0x6010, 0x905d, 0x0904, 0x8c9b, 0xb814, 0xa06e, 0xb910, 0xa172,
+	0xb9a0, 0xa176, 0x2001, 0x0003, 0xa07e, 0xa834, 0xa082, 0xa07b,
+	0x0000, 0xa898, 0x9005, 0x0118, 0xa078, 0xc085, 0xa07a, 0x2858,
+	0x2031, 0x0018, 0xa068, 0x908a, 0x0019, 0x1a0c, 0x0dd5, 0x2020,
+	0x2050, 0x2940, 0xa864, 0x90bc, 0x00ff, 0x908c, 0x000f, 0x91e0,
+	0x2092, 0x2c65, 0x9786, 0x0024, 0x2c05, 0x1590, 0x908a, 0x0036,
+	0x1a0c, 0x0dd5, 0x9082, 0x001b, 0x0002, 0x8c08, 0x8c08, 0x8c0a,
+	0x8c08, 0x8c08, 0x8c08, 0x8c0c, 0x8c08, 0x8c08, 0x8c08, 0x8c0e,
+	0x8c08, 0x8c08, 0x8c08, 0x8c10, 0x8c08, 0x8c08, 0x8c08, 0x8c12,
+	0x8c08, 0x8c08, 0x8c08, 0x8c14, 0x8c08, 0x8c08, 0x8c08, 0x8c16,
+	0x080c, 0x0dd5, 0xa180, 0x04b8, 0xa190, 0x04a8, 0xa1a0, 0x0498,
+	0xa1b0, 0x0488, 0xa1c0, 0x0478, 0xa1d0, 0x0468, 0xa1e0, 0x0458,
+	0x908a, 0x0034, 0x1a0c, 0x0dd5, 0x9082, 0x001b, 0x0002, 0x8c3a,
+	0x8c38, 0x8c38, 0x8c38, 0x8c38, 0x8c38, 0x8c3c, 0x8c38, 0x8c38,
+	0x8c38, 0x8c38, 0x8c38, 0x8c3e, 0x8c38, 0x8c38, 0x8c38, 0x8c38,
+	0x8c38, 0x8c40, 0x8c38, 0x8c38, 0x8c38, 0x8c38, 0x8c38, 0x8c42,
+	0x080c, 0x0dd5, 0xa180, 0x0038, 0xa198, 0x0028, 0xa1b0, 0x0018,
+	0xa1c8, 0x0008, 0xa1e0, 0x2600, 0x0002, 0x8c5e, 0x8c60, 0x8c62,
+	0x8c64, 0x8c66, 0x8c68, 0x8c6a, 0x8c6c, 0x8c6e, 0x8c70, 0x8c72,
+	0x8c74, 0x8c76, 0x8c78, 0x8c7a, 0x8c7c, 0x8c7e, 0x8c80, 0x8c82,
+	0x8c84, 0x8c86, 0x8c88, 0x8c8a, 0x8c8c, 0x8c8e, 0x080c, 0x0dd5,
+	0xb9e2, 0x0468, 0xb9de, 0x0458, 0xb9da, 0x0448, 0xb9d6, 0x0438,
+	0xb9d2, 0x0428, 0xb9ce, 0x0418, 0xb9ca, 0x0408, 0xb9c6, 0x00f8,
+	0xb9c2, 0x00e8, 0xb9be, 0x00d8, 0xb9ba, 0x00c8, 0xb9b6, 0x00b8,
+	0xb9b2, 0x00a8, 0xb9ae, 0x0098, 0xb9aa, 0x0088, 0xb9a6, 0x0078,
+	0xb9a2, 0x0068, 0xb99e, 0x0058, 0xb99a, 0x0048, 0xb996, 0x0038,
+	0xb992, 0x0028, 0xb98e, 0x0018, 0xb98a, 0x0008, 0xb986, 0x8631,
+	0x8421, 0x0120, 0x080c, 0x204a, 0x0804, 0x8be2, 0x00ae, 0x00be,
+	0x00ce, 0x00ee, 0x0005, 0xa86c, 0xa06e, 0xa870, 0xa072, 0xa077,
+	0x00ff, 0x9006, 0x0804, 0x8bc4, 0x0006, 0x0016, 0x00b6, 0x6010,
+	0x2058, 0xb810, 0x9005, 0x01b0, 0x2001, 0x1924, 0x2004, 0x9005,
+	0x0188, 0x2001, 0x1800, 0x2004, 0x9086, 0x0003, 0x1158, 0x0036,
+	0x0046, 0xbba0, 0x2021, 0x0004, 0x2011, 0x8014, 0x080c, 0x4b14,
+	0x004e, 0x003e, 0x00be, 0x001e, 0x000e, 0x0005, 0x9016, 0x710c,
+	0xa834, 0x910a, 0xa936, 0x7008, 0x9005, 0x0120, 0x8210, 0x910a,
+	0x0238, 0x0130, 0x7010, 0x8210, 0x910a, 0x0210, 0x0108, 0x0cd8,
+	0xaa8a, 0xa26a, 0x0005, 0x00f6, 0x00d6, 0x0036, 0x2079, 0x0300,
+	0x781b, 0x0200, 0x7818, 0xd094, 0x1dd8, 0x781b, 0x0202, 0xa001,
+	0xa001, 0x7818, 0xd094, 0x1da0, 0xb8ac, 0x9005, 0x01b8, 0x2068,
+	0x2079, 0x0000, 0x2c08, 0x911e, 0x1118, 0x680c, 0xb8ae, 0x0060,
+	0x9106, 0x0140, 0x2d00, 0x2078, 0x680c, 0x9005, 0x090c, 0x0dd5,
+	0x2068, 0x0cb0, 0x6b0c, 0x7b0e, 0x600f, 0x0000, 0x2079, 0x0300,
+	0x781b, 0x0200, 0x003e, 0x00de, 0x00fe, 0x0005, 0x00e6, 0x00d6,
+	0x0096, 0x00c6, 0x0036, 0x0126, 0x2091, 0x8000, 0x0156, 0x20a9,
+	0x01ff, 0x2071, 0x0300, 0x701b, 0x0200, 0x7018, 0xd094, 0x0110,
+	0x1f04, 0x8d1b, 0x701b, 0x0202, 0xa001, 0xa001, 0x7018, 0xd094,
+	0x1d90, 0xb8ac, 0x9005, 0x01d0, 0x2060, 0x600c, 0xb8ae, 0x6003,
+	0x0004, 0x601b, 0x0000, 0x6013, 0x0000, 0x601f, 0x0101, 0x6014,
+	0x2048, 0xa88b, 0x0000, 0xa8a8, 0xa8ab, 0x0000, 0x904d, 0x090c,
+	0x0dd5, 0x080c, 0x1031, 0x080c, 0x88d6, 0x0c18, 0x2071, 0x0300,
+	0x701b, 0x0200, 0x015e, 0x012e, 0x003e, 0x00ce, 0x009e, 0x00de,
+	0x00ee, 0x0005, 0x00c6, 0x00b6, 0x0016, 0x0006, 0x0156, 0x080c,
+	0x2840, 0x015e, 0x11b0, 0x080c, 0x65a7, 0x190c, 0x0dd5, 0x000e,
+	0x001e, 0xb912, 0xb816, 0x080c, 0xae1b, 0x0140, 0x2b00, 0x6012,
+	0x6023, 0x0001, 0x2009, 0x0001, 0x080c, 0xaeec, 0x00be, 0x00ce,
+	0x0005, 0x000e, 0x001e, 0x0cd0, 0x0066, 0x6000, 0x90b2, 0x0016,
+	0x1a0c, 0x0dd5, 0x0013, 0x006e, 0x0005, 0x8d8d, 0x8d8d, 0x8d8d,
+	0x8d8f, 0x8de0, 0x8d8d, 0x8d8d, 0x8d8d, 0x8e43, 0x8d8d, 0x8e80,
+	0x8d8d, 0x8d8d, 0x8d8d, 0x8d8d, 0x8d8d, 0x080c, 0x0dd5, 0x9182,
+	0x0040, 0x0002, 0x8da2, 0x8da2, 0x8da2, 0x8da2, 0x8da2, 0x8da2,
+	0x8da2, 0x8da2, 0x8da2, 0x8da4, 0x8db9, 0x8da2, 0x8da2, 0x8da2,
+	0x8da2, 0x8dcc, 0x080c, 0x0dd5, 0x0096, 0x080c, 0x9637, 0x080c,
+	0x97b5, 0x6114, 0x2148, 0xa87b, 0x0000, 0x6010, 0x00b6, 0x2058,
+	0xb8bb, 0x0500, 0x00be, 0x080c, 0x6a8c, 0x080c, 0xae71, 0x009e,
+	0x0005, 0x080c, 0x9637, 0x00d6, 0x6114, 0x080c, 0xcb4a, 0x0130,
+	0x0096, 0x6114, 0x2148, 0x080c, 0x6c86, 0x009e, 0x00de, 0x080c,
+	0xae71, 0x080c, 0x97b5, 0x0005, 0x080c, 0x9637, 0x080c, 0x31c1,
+	0x6114, 0x0096, 0x2148, 0x080c, 0xcb4a, 0x0120, 0xa87b, 0x0029,
+	0x080c, 0x6c86, 0x009e, 0x080c, 0xae71, 0x080c, 0x97b5, 0x0005,
+	0x601b, 0x0000, 0x9182, 0x0040, 0x0096, 0x0002, 0x8dfb, 0x8dfb,
+	0x8dfb, 0x8dfb, 0x8dfb, 0x8dfb, 0x8dfb, 0x8dfb, 0x8dfd, 0x8dfb,
+	0x8dfb, 0x8dfb, 0x8e3f, 0x8dfb, 0x8dfb, 0x8dfb, 0x8dfb, 0x8dfb,
+	0x8dfb, 0x8e03, 0x8dfb, 0x080c, 0x0dd5, 0x6114, 0x2148, 0xa938,
+	0x918e, 0xffff, 0x05e0, 0x00e6, 0x6114, 0x2148, 0x080c, 0x8bac,
+	0x0096, 0xa8a8, 0x2048, 0x080c, 0x6a24, 0x009e, 0xa8ab, 0x0000,
+	0x6010, 0x9005, 0x0128, 0x00b6, 0x2058, 0x080c, 0x8cdb, 0x00be,
+	0xae88, 0x00b6, 0x2059, 0x0000, 0x080c, 0x88df, 0x00be, 0x01e0,
+	0x2071, 0x193c, 0x080c, 0x8926, 0x01b8, 0x9086, 0x0001, 0x1128,
+	0x2001, 0x1946, 0x2004, 0x9005, 0x1178, 0x0096, 0x080c, 0x0fff,
+	0x2900, 0x009e, 0x0148, 0xa8aa, 0x00f6, 0x2c78, 0x080c, 0x889d,
+	0x00fe, 0x00ee, 0x009e, 0x0005, 0x080c, 0x88d6, 0x0cd0, 0x080c,
+	0x8eed, 0x009e, 0x0005, 0x9182, 0x0040, 0x0096, 0x0002, 0x8e57,
+	0x8e57, 0x8e57, 0x8e59, 0x8e57, 0x8e57, 0x8e57, 0x8e7e, 0x8e57,
+	0x8e57, 0x8e57, 0x8e57, 0x8e57, 0x8e57, 0x8e57, 0x8e57, 0x080c,
+	0x0dd5, 0x6003, 0x0003, 0x6106, 0x6014, 0x2048, 0xa8ac, 0xa846,
+	0xa8b0, 0xa84a, 0xa837, 0x0000, 0xa83b, 0x0000, 0xa884, 0x9092,
+	0x199a, 0x0210, 0x2001, 0x1999, 0x8003, 0x8013, 0x8213, 0x9210,
+	0x621a, 0x2c10, 0x080c, 0x1baf, 0x080c, 0x913e, 0x0126, 0x2091,
+	0x8000, 0x080c, 0x97b5, 0x012e, 0x009e, 0x0005, 0x080c, 0x0dd5,
+	0x080c, 0x9637, 0x080c, 0x97b5, 0x6114, 0x2148, 0xa87b, 0x0000,
+	0x6010, 0x00b6, 0x2058, 0xb8bb, 0x0500, 0x00be, 0x080c, 0x6c86,
+	0x080c, 0xae71, 0x009e, 0x0005, 0x6000, 0x908a, 0x0016, 0x1a0c,
+	0x0dd5, 0x0096, 0x0013, 0x009e, 0x0005, 0x8ead, 0x8ead, 0x8ead,
+	0x8eaf, 0x8ec0, 0x8ead, 0x8ead, 0x8ead, 0x8ead, 0x8ead, 0x8ead,
+	0x8ead, 0x8ead, 0x8ead, 0x8ead, 0x8ead, 0x080c, 0x0dd5, 0x080c,
+	0xa7cd, 0x6114, 0x2148, 0xa87b, 0x0006, 0x6010, 0x00b6, 0x2058,
+	0xb8bb, 0x0500, 0x00be, 0x080c, 0x6c86, 0x080c, 0xae71, 0x0005,
+	0x0461, 0x0005, 0x6000, 0x908a, 0x0016, 0x1a0c, 0x0dd5, 0x0096,
+	0x0013, 0x009e, 0x0005, 0x8edb, 0x8edb, 0x8edb, 0x8edd, 0x8eed,
+	0x8edb, 0x8edb, 0x8edb, 0x8edb, 0x8edb, 0x8edb, 0x8edb, 0x8edb,
+	0x8edb, 0x8edb, 0x8edb, 0x080c, 0x0dd5, 0x0036, 0x00e6, 0x2071,
+	0x19e6, 0x703c, 0x9c06, 0x1120, 0x2019, 0x0000, 0x080c, 0xa5b7,
+	0x080c, 0xa7cd, 0x00ee, 0x003e, 0x0005, 0x00f6, 0x00e6, 0x601b,
+	0x0000, 0x6014, 0x2048, 0x6010, 0x9005, 0x0128, 0x00b6, 0x2058,
+	0x080c, 0x8cdb, 0x00be, 0x2071, 0x193c, 0x080c, 0x8926, 0x0160,
+	0x2001, 0x187f, 0x2004, 0xa88a, 0x2031, 0x0000, 0x2c78, 0x080c,
+	0x889d, 0x00ee, 0x00fe, 0x0005, 0x0096, 0xa88b, 0x0000, 0xa8a8,
+	0x2048, 0x080c, 0x1031, 0x009e, 0xa8ab, 0x0000, 0x080c, 0x88d6,
+	0x0c80, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
+	0x0000, 0x0000, 0x187a, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
+	0x0000, 0x0126, 0x2091, 0x8000, 0x0036, 0x0046, 0x20a9, 0x0010,
+	0x9006, 0x8004, 0x2019, 0x0100, 0x231c, 0x93a6, 0x0008, 0x1118,
+	0x8086, 0x818e, 0x0020, 0x80f6, 0x3e00, 0x81f6, 0x3e08, 0x1208,
+	0x9200, 0x1f04, 0x8f32, 0x93a6, 0x0008, 0x1118, 0x8086, 0x818e,
+	0x0020, 0x80f6, 0x3e00, 0x81f6, 0x3e08, 0x004e, 0x003e, 0x012e,
+	0x0005, 0x0126, 0x2091, 0x8000, 0x0076, 0x0156, 0x20a9, 0x0010,
+	0x9005, 0x0510, 0x911a, 0x1600, 0x8213, 0x2039, 0x0100, 0x273c,
+	0x97be, 0x0008, 0x1110, 0x818d, 0x0010, 0x81f5, 0x3e08, 0x0228,
+	0x911a, 0x1220, 0x1f04, 0x8f5c, 0x0028, 0x911a, 0x2308, 0x8210,
+	0x1f04, 0x8f5c, 0x0006, 0x3200, 0x9084, 0xefff, 0x2080, 0x000e,
+	0x015e, 0x007e, 0x012e, 0x0005, 0x0006, 0x3200, 0x9085, 0x1000,
+	0x0ca8, 0x0126, 0x2091, 0x2800, 0x2079, 0x19e6, 0x012e, 0x00d6,
+	0x2069, 0x19e6, 0x6803, 0x0005, 0x0156, 0x0146, 0x01d6, 0x20e9,
+	0x0000, 0x2069, 0x0200, 0x080c, 0xab2c, 0x0401, 0x080c, 0xab17,
+	0x00e9, 0x080c, 0xab1a, 0x00d1, 0x080c, 0xab1d, 0x00b9, 0x080c,
+	0xab20, 0x00a1, 0x080c, 0xab23, 0x0089, 0x080c, 0xab26, 0x0071,
+	0x080c, 0xab29, 0x0059, 0x01de, 0x014e, 0x015e, 0x2069, 0x0004,
+	0x2d04, 0x9085, 0x8001, 0x206a, 0x00de, 0x0005, 0x20a9, 0x0020,
+	0x20a1, 0x0240, 0x2001, 0x0000, 0x4004, 0x0005, 0x00c6, 0x6027,
+	0x0001, 0x7804, 0x9084, 0x0007, 0x0002, 0x8fcf, 0x8ff3, 0x9032,
+	0x8fd5, 0x8ff3, 0x8fcf, 0x8fcd, 0x8fcd, 0x080c, 0x0dd5, 0x080c,
+	0x8562, 0x080c, 0x9687, 0x00ce, 0x0005, 0x62c0, 0x82ff, 0x1110,
+	0x00ce, 0x0005, 0x2011, 0x5e8c, 0x080c, 0x84dc, 0x7828, 0x9092,
+	0x00c8, 0x1228, 0x8000, 0x782a, 0x080c, 0x5ecc, 0x0c88, 0x62c0,
+	0x080c, 0xac68, 0x080c, 0x5e8c, 0x7807, 0x0003, 0x7827, 0x0000,
+	0x782b, 0x0000, 0x0c28, 0x080c, 0x8562, 0x6220, 0xd2a4, 0x0160,
 	0x782b, 0x0000, 0x7824, 0x9065, 0x090c, 0x0dd5, 0x2009, 0x0013,
-	0x080c, 0xaf2e, 0x00ce, 0x0005, 0x00b6, 0x00c6, 0x00d6, 0x7824,
-	0x9005, 0x090c, 0x0dd5, 0x7828, 0x9092, 0xc350, 0x1648, 0x8000,
-	0x782a, 0x00de, 0x00ce, 0x00be, 0x080c, 0x2ba5, 0x02f0, 0x00b6,
-	0x00c6, 0x00d6, 0x781c, 0x905d, 0x090c, 0x0dd5, 0xb800, 0xc0dc,
-	0xb802, 0x7924, 0x2160, 0x080c, 0xae61, 0xb93c, 0x81ff, 0x090c,
-	0x0dd5, 0x8109, 0xb93e, 0x7807, 0x0000, 0x7827, 0x0000, 0x00de,
-	0x00ce, 0x00be, 0x080c, 0x968d, 0x0868, 0x080c, 0xa24f, 0x0850,
-	0x2011, 0x0130, 0x2214, 0x080c, 0xac5d, 0x080c, 0xe9fe, 0x7824,
-	0x9065, 0x2009, 0x0014, 0x080c, 0xaedc, 0x00de, 0x00ce, 0x00be,
-	0x0804, 0x905a, 0x00c6, 0x2001, 0x009b, 0x2004, 0xd0fc, 0x190c,
-	0x1eb4, 0x6024, 0x6027, 0x0002, 0xd0f4, 0x15b8, 0x62c8, 0x60c4,
-	0x9205, 0x1170, 0x783c, 0x9065, 0x0130, 0x2009, 0x0049, 0x080c,
-	0xaedc, 0x00ce, 0x0005, 0x2011, 0x1a06, 0x2013, 0x0000, 0x0cc8,
-	0x793c, 0x81ff, 0x0dc0, 0x7944, 0x9192, 0x7530, 0x1628, 0x8108,
-	0x7946, 0x793c, 0x9188, 0x0008, 0x210c, 0x918e, 0x0006, 0x1138,
-	0x6014, 0x9084, 0x1984, 0x9085, 0x0012, 0x6016, 0x0c10, 0x793c,
-	0x9188, 0x0008, 0x210c, 0x918e, 0x0009, 0x0d90, 0x6014, 0x9084,
-	0x1984, 0x9085, 0x0016, 0x6016, 0x08a0, 0x793c, 0x2160, 0x2009,
-	0x004a, 0x080c, 0xaedc, 0x0868, 0x7848, 0xc085, 0x784a, 0x0848,
-	0x0006, 0x0016, 0x00c6, 0x0126, 0x2091, 0x8000, 0x600f, 0x0000,
-	0x2c08, 0x2061, 0x19e7, 0x6020, 0x8000, 0x6022, 0x6010, 0x9005,
-	0x0148, 0x9080, 0x0003, 0x2102, 0x6112, 0x012e, 0x00ce, 0x001e,
-	0x000e, 0x0005, 0x6116, 0x6112, 0x0cc0, 0x00d6, 0x2069, 0x19e7,
-	0xb800, 0xd0d4, 0x0168, 0x6820, 0x8000, 0x6822, 0x9086, 0x0001,
-	0x1110, 0x2b00, 0x681e, 0x00de, 0x0804, 0x968d, 0x00de, 0x0005,
-	0xc0d5, 0xb802, 0x6818, 0x9005, 0x0168, 0xb856, 0xb85b, 0x0000,
-	0x0086, 0x0006, 0x2b00, 0x681a, 0x008e, 0xa05a, 0x008e, 0x2069,
-	0x19e7, 0x0c08, 0xb856, 0xb85a, 0x2b00, 0x681a, 0x681e, 0x08d8,
-	0x0006, 0x0016, 0x00c6, 0x0126, 0x2091, 0x8000, 0x600f, 0x0000,
-	0x2c08, 0x2061, 0x19e7, 0x6020, 0x8000, 0x6022, 0x6008, 0x9005,
-	0x0148, 0x9080, 0x0003, 0x2102, 0x610a, 0x012e, 0x00ce, 0x001e,
-	0x000e, 0x0005, 0x610e, 0x610a, 0x0cc0, 0x00c6, 0x600f, 0x0000,
-	0x2c08, 0x2061, 0x19e7, 0x6034, 0x9005, 0x0130, 0x9080, 0x0003,
-	0x2102, 0x6136, 0x00ce, 0x0005, 0x613a, 0x6136, 0x00ce, 0x0005,
-	0x00f6, 0x00e6, 0x00d6, 0x00c6, 0x00b6, 0x0096, 0x0076, 0x0066,
-	0x0056, 0x0036, 0x0026, 0x0016, 0x0006, 0x0126, 0x902e, 0x2071,
-	0x19e7, 0x7638, 0x2660, 0x2678, 0x2091, 0x8000, 0x8cff, 0x0904,
-	0x91df, 0x6010, 0x2058, 0xb8a0, 0x9206, 0x1904, 0x91da, 0x87ff,
-	0x0120, 0x6054, 0x9106, 0x1904, 0x91da, 0x703c, 0x9c06, 0x1178,
-	0x0036, 0x2019, 0x0001, 0x080c, 0xa5b6, 0x7033, 0x0000, 0x9006,
-	0x703e, 0x7042, 0x7046, 0x704a, 0x003e, 0x2029, 0x0001, 0x7038,
-	0x9c36, 0x1110, 0x660c, 0x763a, 0x7034, 0x9c36, 0x1140, 0x2c00,
-	0x9f36, 0x0118, 0x2f00, 0x7036, 0x0010, 0x7037, 0x0000, 0x660c,
-	0x0066, 0x2c00, 0x9f06, 0x0110, 0x7e0e, 0x0008, 0x2678, 0x600f,
-	0x0000, 0x080c, 0xcb35, 0x01c8, 0x6014, 0x2048, 0x6020, 0x9086,
-	0x0003, 0x1590, 0xa867, 0x0103, 0xab7a, 0xa877, 0x0000, 0x0016,
-	0x0036, 0x0076, 0x080c, 0xce24, 0x080c, 0xe908, 0x080c, 0x6c81,
-	0x007e, 0x003e, 0x001e, 0x080c, 0xcd1e, 0x080c, 0xae92, 0x00ce,
-	0x0804, 0x917e, 0x2c78, 0x600c, 0x2060, 0x0804, 0x917e, 0x85ff,
-	0x0120, 0x0036, 0x080c, 0x97b9, 0x003e, 0x012e, 0x000e, 0x001e,
-	0x002e, 0x003e, 0x005e, 0x006e, 0x007e, 0x009e, 0x00be, 0x00ce,
-	0x00de, 0x00ee, 0x00fe, 0x0005, 0x6020, 0x9086, 0x0006, 0x1158,
-	0x0016, 0x0036, 0x0076, 0x080c, 0xe908, 0x080c, 0xe551, 0x007e,
-	0x003e, 0x001e, 0x0890, 0x6020, 0x9086, 0x0009, 0x1168, 0xa87b,
-	0x0006, 0x0016, 0x0036, 0x0076, 0x080c, 0x6c81, 0x080c, 0xae61,
-	0x007e, 0x003e, 0x001e, 0x0818, 0x6020, 0x9086, 0x000a, 0x0904,
-	0x91c4, 0x0804, 0x91c2, 0x0006, 0x0066, 0x0096, 0x00c6, 0x00d6,
-	0x00f6, 0x9036, 0x0126, 0x2091, 0x8000, 0x2079, 0x19e7, 0x7838,
-	0x9065, 0x0904, 0x926b, 0x600c, 0x0006, 0x600f, 0x0000, 0x783c,
-	0x9c06, 0x1168, 0x0036, 0x2019, 0x0001, 0x080c, 0xa5b6, 0x7833,
-	0x0000, 0x901e, 0x7b3e, 0x7b42, 0x7b46, 0x7b4a, 0x003e, 0x080c,
-	0xcb35, 0x0520, 0x6014, 0x2048, 0x6020, 0x9086, 0x0003, 0x1568,
-	0x3e08, 0x918e, 0x0002, 0x1188, 0x6010, 0x9005, 0x0170, 0x00b6,
-	0x2058, 0xb800, 0x00be, 0xd0bc, 0x0140, 0x6040, 0x9005, 0x1180,
-	0x2001, 0x1988, 0x2004, 0x6042, 0x0058, 0xa867, 0x0103, 0xab7a,
-	0xa877, 0x0000, 0x080c, 0x6c75, 0x080c, 0xcd1e, 0x080c, 0xae92,
-	0x000e, 0x0804, 0x9228, 0x7e3a, 0x7e36, 0x012e, 0x00fe, 0x00de,
-	0x00ce, 0x009e, 0x006e, 0x000e, 0x0005, 0x6020, 0x9086, 0x0006,
-	0x1118, 0x080c, 0xe551, 0x0c50, 0x6020, 0x9086, 0x0009, 0x1130,
-	0xab7a, 0x080c, 0x6c81, 0x080c, 0xae61, 0x0c10, 0x6020, 0x9086,
-	0x000a, 0x09a8, 0x0890, 0x0016, 0x0026, 0x0086, 0x9046, 0x0099,
-	0x080c, 0x9374, 0x008e, 0x002e, 0x001e, 0x0005, 0x00f6, 0x0126,
-	0x2079, 0x19e7, 0x2091, 0x8000, 0x080c, 0x940b, 0x080c, 0x9499,
-	0x012e, 0x00fe, 0x0005, 0x00b6, 0x0096, 0x00f6, 0x00e6, 0x00d6,
-	0x00c6, 0x0066, 0x0016, 0x0006, 0x0126, 0x2091, 0x8000, 0x2071,
-	0x19e7, 0x7614, 0x2660, 0x2678, 0x8cff, 0x0904, 0x9339, 0x6010,
-	0x2058, 0xb8a0, 0x9206, 0x1904, 0x9334, 0x88ff, 0x0120, 0x6054,
-	0x9106, 0x1904, 0x9334, 0x7024, 0x9c06, 0x1558, 0x2069, 0x0100,
-	0x6820, 0xd0a4, 0x1508, 0x080c, 0x8579, 0x080c, 0xa273, 0x68c3,
-	0x0000, 0x080c, 0xa7bc, 0x7027, 0x0000, 0x0036, 0x2069, 0x0140,
-	0x6b04, 0x9384, 0x1000, 0x0138, 0x2001, 0x0100, 0x080c, 0x2cef,
-	0x9006, 0x080c, 0x2cef, 0x2069, 0x0100, 0x6824, 0xd084, 0x0110,
-	0x6827, 0x0001, 0x003e, 0x0028, 0x6003, 0x0009, 0x630a, 0x0804,
-	0x9334, 0x7014, 0x9c36, 0x1110, 0x660c, 0x7616, 0x7010, 0x9c36,
-	0x1140, 0x2c00, 0x9f36, 0x0118, 0x2f00, 0x7012, 0x0010, 0x7013,
-	0x0000, 0x660c, 0x0066, 0x2c00, 0x9f06, 0x0110, 0x7e0e, 0x0008,
-	0x2678, 0x600f, 0x0000, 0x6014, 0x2048, 0x080c, 0xcb35, 0x01e8,
-	0x6020, 0x9086, 0x0003, 0x1580, 0x080c, 0xcd3b, 0x1118, 0x080c,
-	0xb813, 0x0098, 0xa867, 0x0103, 0xab7a, 0xa877, 0x0000, 0x0016,
-	0x0036, 0x0086, 0x080c, 0xce24, 0x080c, 0xe908, 0x080c, 0x6c81,
-	0x008e, 0x003e, 0x001e, 0x080c, 0xcd1e, 0x080c, 0xae92, 0x080c,
-	0xa692, 0x00ce, 0x0804, 0x92b4, 0x2c78, 0x600c, 0x2060, 0x0804,
-	0x92b4, 0x012e, 0x000e, 0x001e, 0x006e, 0x00ce, 0x00de, 0x00ee,
-	0x00fe, 0x009e, 0x00be, 0x0005, 0x6020, 0x9086, 0x0006, 0x1158,
-	0x0016, 0x0036, 0x0086, 0x080c, 0xe908, 0x080c, 0xe551, 0x008e,
-	0x003e, 0x001e, 0x08d0, 0x080c, 0xb813, 0x6020, 0x9086, 0x0002,
-	0x1160, 0x6004, 0x0006, 0x9086, 0x0085, 0x000e, 0x0904, 0x931a,
-	0x9086, 0x008b, 0x0904, 0x931a, 0x0840, 0x6020, 0x9086, 0x0005,
-	0x1920, 0x6004, 0x0006, 0x9086, 0x0085, 0x000e, 0x09c8, 0x9086,
-	0x008b, 0x09b0, 0x0804, 0x932d, 0x00b6, 0x00a6, 0x0096, 0x00c6,
-	0x0006, 0x0126, 0x2091, 0x8000, 0x9280, 0x1000, 0x2004, 0x905d,
-	0x0904, 0x9404, 0x00f6, 0x00e6, 0x00d6, 0x0066, 0x2071, 0x19e7,
-	0xbe54, 0x7018, 0x9b06, 0x1108, 0x761a, 0x701c, 0x9b06, 0x1130,
-	0x86ff, 0x1118, 0x7018, 0x701e, 0x0008, 0x761e, 0xb858, 0x904d,
-	0x0108, 0xae56, 0x96d5, 0x0000, 0x0110, 0x2900, 0xb05a, 0xb857,
-	0x0000, 0xb85b, 0x0000, 0xb800, 0xc0d4, 0xc0dc, 0xb802, 0x080c,
-	0x6531, 0x0904, 0x9400, 0x7624, 0x86ff, 0x0904, 0x93ef, 0x9680,
-	0x0005, 0x2004, 0x9906, 0x15d8, 0x00d6, 0x2069, 0x0100, 0x68c0,
-	0x9005, 0x0560, 0x080c, 0x8579, 0x080c, 0xa273, 0x68c3, 0x0000,
-	0x080c, 0xa7bc, 0x7027, 0x0000, 0x0036, 0x2069, 0x0140, 0x6b04,
-	0x9384, 0x1000, 0x0138, 0x2001, 0x0100, 0x080c, 0x2cef, 0x9006,
-	0x080c, 0x2cef, 0x2069, 0x0100, 0x6824, 0xd084, 0x0110, 0x6827,
-	0x0001, 0x003e, 0x00de, 0x00c6, 0xb83c, 0x9005, 0x0110, 0x8001,
-	0xb83e, 0x2660, 0x080c, 0xae92, 0x00ce, 0x0048, 0x00de, 0x00c6,
-	0x2660, 0x6003, 0x0009, 0x630a, 0x00ce, 0x0804, 0x93a7, 0x89ff,
-	0x0158, 0xa867, 0x0103, 0xab7a, 0xa877, 0x0000, 0x080c, 0xce24,
-	0x080c, 0xe908, 0x080c, 0x6c81, 0x080c, 0xa692, 0x0804, 0x93a7,
-	0x006e, 0x00de, 0x00ee, 0x00fe, 0x012e, 0x000e, 0x00ce, 0x009e,
-	0x00ae, 0x00be, 0x0005, 0x0096, 0x0006, 0x0066, 0x00c6, 0x00d6,
-	0x9036, 0x7814, 0x9065, 0x0904, 0x946c, 0x600c, 0x0006, 0x600f,
-	0x0000, 0x7824, 0x9c06, 0x1570, 0x2069, 0x0100, 0x6820, 0xd0a4,
-	0x1508, 0x080c, 0x8579, 0x080c, 0xa273, 0x68c3, 0x0000, 0x080c,
-	0xa7bc, 0x7827, 0x0000, 0x0036, 0x2069, 0x0140, 0x6b04, 0x9384,
-	0x1000, 0x0138, 0x2001, 0x0100, 0x080c, 0x2cef, 0x9006, 0x080c,
-	0x2cef, 0x2069, 0x0100, 0x6824, 0xd084, 0x0110, 0x6827, 0x0001,
-	0x003e, 0x0040, 0x080c, 0x690a, 0x1520, 0x6003, 0x0009, 0x630a,
-	0x2c30, 0x00f8, 0x6014, 0x2048, 0x080c, 0xcb33, 0x01b0, 0x6020,
-	0x9086, 0x0003, 0x1508, 0x080c, 0xcd3b, 0x1118, 0x080c, 0xb813,
-	0x0060, 0x080c, 0x690a, 0x1168, 0xa867, 0x0103, 0xab7a, 0xa877,
-	0x0000, 0x080c, 0x6c81, 0x080c, 0xcd1e, 0x080c, 0xae92, 0x080c,
-	0xa692, 0x000e, 0x0804, 0x9412, 0x7e16, 0x7e12, 0x00de, 0x00ce,
-	0x006e, 0x000e, 0x009e, 0x0005, 0x6020, 0x9086, 0x0006, 0x1118,
-	0x080c, 0xe551, 0x0c50, 0x080c, 0xb813, 0x6020, 0x9086, 0x0002,
-	0x1150, 0x6004, 0x0006, 0x9086, 0x0085, 0x000e, 0x0990, 0x9086,
-	0x008b, 0x0978, 0x08d0, 0x6020, 0x9086, 0x0005, 0x19b0, 0x6004,
-	0x0006, 0x9086, 0x0085, 0x000e, 0x0d18, 0x9086, 0x008b, 0x0d00,
-	0x0860, 0x0006, 0x0066, 0x0096, 0x00b6, 0x00c6, 0x00d6, 0x7818,
-	0x905d, 0x0904, 0x9519, 0xb854, 0x0006, 0x9006, 0xb856, 0xb85a,
-	0xb800, 0xc0d4, 0xc0dc, 0xb802, 0x080c, 0x6531, 0x0904, 0x9516,
-	0x7e24, 0x86ff, 0x0904, 0x9509, 0x9680, 0x0005, 0x2004, 0x9906,
-	0x1904, 0x9509, 0x00d6, 0x2069, 0x0100, 0x68c0, 0x9005, 0x0904,
-	0x9500, 0x080c, 0x8579, 0x080c, 0xa273, 0x68c3, 0x0000, 0x080c,
-	0xa7bc, 0x7827, 0x0000, 0x0036, 0x2069, 0x0140, 0x6b04, 0x9384,
-	0x1000, 0x0138, 0x2001, 0x0100, 0x080c, 0x2cef, 0x9006, 0x080c,
-	0x2cef, 0x2069, 0x0100, 0x6824, 0xd084, 0x0110, 0x6827, 0x0001,
-	0x003e, 0x00de, 0x00c6, 0x3e08, 0x918e, 0x0002, 0x1168, 0xb800,
-	0xd0bc, 0x0150, 0x9680, 0x0010, 0x200c, 0x81ff, 0x1518, 0x2009,
-	0x1988, 0x210c, 0x2102, 0x00f0, 0xb83c, 0x9005, 0x0110, 0x8001,
-	0xb83e, 0x2660, 0x600f, 0x0000, 0x080c, 0xae92, 0x00ce, 0x0048,
-	0x00de, 0x00c6, 0x2660, 0x6003, 0x0009, 0x630a, 0x00ce, 0x0804,
-	0x94ac, 0x89ff, 0x0138, 0xa867, 0x0103, 0xab7a, 0xa877, 0x0000,
-	0x080c, 0x6c81, 0x080c, 0xa692, 0x0804, 0x94ac, 0x000e, 0x0804,
-	0x94a0, 0x781e, 0x781a, 0x00de, 0x00ce, 0x00be, 0x009e, 0x006e,
-	0x000e, 0x0005, 0x00e6, 0x00d6, 0x0096, 0x0066, 0xb800, 0xd0dc,
-	0x01a0, 0xb84c, 0x904d, 0x0188, 0xa878, 0x9606, 0x1170, 0x2071,
-	0x19e7, 0x7024, 0x9035, 0x0148, 0x9080, 0x0005, 0x2004, 0x9906,
-	0x1120, 0xb800, 0xc0dc, 0xb802, 0x0029, 0x006e, 0x009e, 0x00de,
-	0x00ee, 0x0005, 0x00f6, 0x2079, 0x0100, 0x78c0, 0x9005, 0x1138,
-	0x00c6, 0x2660, 0x6003, 0x0009, 0x630a, 0x00ce, 0x04b8, 0x080c,
-	0xa273, 0x78c3, 0x0000, 0x080c, 0xa7bc, 0x7027, 0x0000, 0x0036,
-	0x2079, 0x0140, 0x7b04, 0x9384, 0x1000, 0x0138, 0x2001, 0x0100,
-	0x080c, 0x2cef, 0x9006, 0x080c, 0x2cef, 0x2079, 0x0100, 0x7824,
-	0xd084, 0x0110, 0x7827, 0x0001, 0x080c, 0xa7bc, 0x003e, 0x080c,
-	0x6531, 0x00c6, 0xb83c, 0x9005, 0x0110, 0x8001, 0xb83e, 0x2660,
-	0x080c, 0xae61, 0x00ce, 0xa867, 0x0103, 0xab7a, 0xa877, 0x0000,
-	0x080c, 0xce24, 0x080c, 0x6c81, 0x080c, 0xa692, 0x00fe, 0x0005,
-	0x00b6, 0x00e6, 0x00c6, 0x2011, 0x0101, 0x2204, 0xc0c4, 0x2012,
-	0x2001, 0x180c, 0x2014, 0xc2e4, 0x2202, 0x2071, 0x19e7, 0x7004,
-	0x9084, 0x0007, 0x0002, 0x95a5, 0x95a9, 0x95c0, 0x95e9, 0x9627,
-	0x95a5, 0x95c0, 0x95a3, 0x080c, 0x0dd5, 0x00ce, 0x00ee, 0x00be,
-	0x0005, 0x7024, 0x9065, 0x0148, 0x7020, 0x8001, 0x7022, 0x600c,
-	0x9015, 0x0158, 0x7216, 0x600f, 0x0000, 0x7007, 0x0000, 0x7027,
-	0x0000, 0x00ce, 0x00ee, 0x00be, 0x0005, 0x7216, 0x7212, 0x0ca8,
-	0x6010, 0x2058, 0x080c, 0x6531, 0xb800, 0xc0dc, 0xb802, 0x7007,
-	0x0000, 0x7027, 0x0000, 0x7020, 0x8001, 0x7022, 0x1148, 0x2001,
-	0x180c, 0x2014, 0xd2ec, 0x1180, 0x00ce, 0x00ee, 0x00be, 0x0005,
-	0xb854, 0x9015, 0x0120, 0x721e, 0x080c, 0x968d, 0x0ca8, 0x7218,
-	0x721e, 0x080c, 0x968d, 0x0c80, 0xc2ec, 0x2202, 0x080c, 0x97b9,
-	0x0c58, 0x7024, 0x9065, 0x05b8, 0x700c, 0x9c06, 0x1160, 0x080c,
-	0xa692, 0x600c, 0x9015, 0x0120, 0x720e, 0x600f, 0x0000, 0x0448,
-	0x720e, 0x720a, 0x0430, 0x7014, 0x9c06, 0x1160, 0x080c, 0xa692,
-	0x600c, 0x9015, 0x0120, 0x7216, 0x600f, 0x0000, 0x00d0, 0x7216,
-	0x7212, 0x00b8, 0x6020, 0x9086, 0x0003, 0x1198, 0x6010, 0x2058,
-	0x080c, 0x6531, 0xb800, 0xc0dc, 0xb802, 0x080c, 0xa692, 0x701c,
-	0x9065, 0x0138, 0xb854, 0x9015, 0x0110, 0x721e, 0x0010, 0x7218,
-	0x721e, 0x7027, 0x0000, 0x00ce, 0x00ee, 0x00be, 0x0005, 0x7024,
-	0x9065, 0x0140, 0x080c, 0xa692, 0x600c, 0x9015, 0x0158, 0x720e,
-	0x600f, 0x0000, 0x080c, 0xa7bc, 0x7027, 0x0000, 0x00ce, 0x00ee,
-	0x00be, 0x0005, 0x720e, 0x720a, 0x0ca8, 0x00d6, 0x2069, 0x19e7,
-	0x6830, 0x9084, 0x0003, 0x0002, 0x964a, 0x964c, 0x9670, 0x9648,
-	0x080c, 0x0dd5, 0x00de, 0x0005, 0x00c6, 0x6840, 0x9086, 0x0001,
-	0x01b8, 0x683c, 0x9065, 0x0130, 0x600c, 0x9015, 0x0170, 0x6a3a,
-	0x600f, 0x0000, 0x6833, 0x0000, 0x683f, 0x0000, 0x2011, 0x1a06,
-	0x2013, 0x0000, 0x00ce, 0x00de, 0x0005, 0x683a, 0x6836, 0x0c90,
-	0x6843, 0x0000, 0x6838, 0x9065, 0x0d68, 0x6003, 0x0003, 0x0c50,
-	0x00c6, 0x9006, 0x6842, 0x6846, 0x684a, 0x683c, 0x9065, 0x0160,
-	0x600c, 0x9015, 0x0130, 0x6a3a, 0x600f, 0x0000, 0x683f, 0x0000,
-	0x0018, 0x683e, 0x683a, 0x6836, 0x00ce, 0x00de, 0x0005, 0x2001,
-	0x180c, 0x200c, 0xc1e5, 0x2102, 0x0005, 0x2001, 0x180c, 0x200c,
-	0xd1ec, 0x0120, 0xc1ec, 0x2102, 0x080c, 0x97b9, 0x2001, 0x19f3,
-	0x2004, 0x9086, 0x0001, 0x0d58, 0x00d6, 0x2069, 0x19e7, 0x6804,
-	0x9084, 0x0007, 0x0006, 0x9005, 0x11c8, 0x2001, 0x1837, 0x2004,
-	0x9084, 0x0028, 0x1198, 0x2001, 0x197c, 0x2004, 0x9086, 0xaaaa,
-	0x0168, 0x2001, 0x188b, 0x2004, 0xd08c, 0x1118, 0xd084, 0x1118,
-	0x0028, 0x080c, 0x97b9, 0x000e, 0x00de, 0x0005, 0x000e, 0x0002,
-	0x96ca, 0x9787, 0x9787, 0x9787, 0x9787, 0x9789, 0x9787, 0x96c8,
-	0x080c, 0x0dd5, 0x6820, 0x9005, 0x1110, 0x00de, 0x0005, 0x00c6,
-	0x680c, 0x9065, 0x0520, 0x6114, 0x0096, 0x2148, 0xa964, 0x009e,
-	0x918c, 0x00ff, 0x918e, 0x0035, 0x1180, 0x2009, 0x1837, 0x210c,
-	0x918c, 0x0028, 0x1150, 0x080c, 0x73bc, 0x0138, 0x0006, 0x2009,
-	0x188b, 0x2104, 0xc095, 0x200a, 0x000e, 0x6807, 0x0004, 0x6826,
-	0x682b, 0x0000, 0x080c, 0x9861, 0x00ce, 0x00de, 0x0005, 0x6814,
-	0x9065, 0x0150, 0x6807, 0x0001, 0x6826, 0x682b, 0x0000, 0x080c,
-	0x9861, 0x00ce, 0x00de, 0x0005, 0x00b6, 0x00e6, 0x6a1c, 0x92dd,
-	0x0000, 0x0904, 0x9773, 0xb84c, 0x900d, 0x0118, 0xb888, 0x9005,
-	0x01a0, 0xb854, 0x905d, 0x0120, 0x920e, 0x0904, 0x9773, 0x0028,
-	0x6818, 0x920e, 0x0904, 0x9773, 0x2058, 0xb84c, 0x900d, 0x0d88,
-	0xb888, 0x9005, 0x1d70, 0x2b00, 0x681e, 0xbb3c, 0xb838, 0x9302,
-	0x1e40, 0x080c, 0xae38, 0x0904, 0x9773, 0x8318, 0xbb3e, 0x6116,
-	0x2b10, 0x6212, 0x0096, 0x2148, 0xa880, 0x9084, 0x00ff, 0x605e,
-	0xa883, 0x0000, 0xa884, 0x009e, 0x908a, 0x199a, 0x0210, 0x2001,
-	0x1999, 0x8003, 0x801b, 0x831b, 0x9318, 0x631a, 0x6114, 0x0096,
-	0x2148, 0xa964, 0x009e, 0x918c, 0x00ff, 0x918e, 0x0048, 0x0538,
-	0x00f6, 0x2c78, 0x2061, 0x0100, 0xbac0, 0x629a, 0x2069, 0x0200,
-	0x2071, 0x0240, 0x080c, 0x9dae, 0x2069, 0x19e7, 0xbb00, 0xc3dd,
-	0xbb02, 0x6807, 0x0002, 0x2f18, 0x6b26, 0x682b, 0x0000, 0x7823,
-	0x0003, 0x7803, 0x0001, 0x7807, 0x0040, 0x00fe, 0x00ee, 0x00be,
-	0x00ce, 0x00de, 0x0005, 0x00ee, 0x00be, 0x00ce, 0x0cd0, 0xbb00,
-	0xc3dd, 0xbb02, 0x6807, 0x0006, 0x2f18, 0x6b26, 0x682b, 0x0000,
-	0x080c, 0xac7d, 0x00ee, 0x00be, 0x00ce, 0x00de, 0x0005, 0x00de,
-	0x0005, 0x00c6, 0x680c, 0x9065, 0x0508, 0x6114, 0x0096, 0x2148,
+	0x080c, 0xaeec, 0x00ce, 0x0005, 0x00c6, 0x7824, 0x9065, 0x090c,
+	0x0dd5, 0x7828, 0x9092, 0xc350, 0x12c0, 0x8000, 0x782a, 0x00ce,
+	0x080c, 0x2ba7, 0x0278, 0x00c6, 0x7924, 0x2160, 0x6010, 0x906d,
+	0x090c, 0x0dd5, 0x7807, 0x0000, 0x7827, 0x0000, 0x00ce, 0x080c,
+	0x9687, 0x0c00, 0x080c, 0xa250, 0x08e8, 0x2011, 0x0130, 0x2214,
+	0x080c, 0xac68, 0x080c, 0xea1f, 0x2009, 0x0014, 0x080c, 0xaeec,
+	0x00ce, 0x0880, 0x2001, 0x1a02, 0x2003, 0x0000, 0x62c0, 0x82ff,
+	0x1160, 0x782b, 0x0000, 0x7824, 0x9065, 0x090c, 0x0dd5, 0x2009,
+	0x0013, 0x080c, 0xaf3e, 0x00ce, 0x0005, 0x00b6, 0x00c6, 0x00d6,
+	0x7824, 0x9005, 0x090c, 0x0dd5, 0x7828, 0x9092, 0xc350, 0x1648,
+	0x8000, 0x782a, 0x00de, 0x00ce, 0x00be, 0x080c, 0x2ba7, 0x02f0,
+	0x00b6, 0x00c6, 0x00d6, 0x781c, 0x905d, 0x090c, 0x0dd5, 0xb800,
+	0xc0dc, 0xb802, 0x7924, 0x2160, 0x080c, 0xae71, 0xb93c, 0x81ff,
+	0x090c, 0x0dd5, 0x8109, 0xb93e, 0x7807, 0x0000, 0x7827, 0x0000,
+	0x00de, 0x00ce, 0x00be, 0x080c, 0x9687, 0x0868, 0x080c, 0xa250,
+	0x0850, 0x2011, 0x0130, 0x2214, 0x080c, 0xac68, 0x080c, 0xea1f,
+	0x7824, 0x9065, 0x2009, 0x0014, 0x080c, 0xaeec, 0x00de, 0x00ce,
+	0x00be, 0x0804, 0x9043, 0x00c6, 0x2001, 0x009b, 0x2004, 0xd0fc,
+	0x190c, 0x1eb6, 0x6024, 0x6027, 0x0002, 0xd0f4, 0x15b8, 0x62c8,
+	0x60c4, 0x9205, 0x1170, 0x783c, 0x9065, 0x0130, 0x2009, 0x0049,
+	0x080c, 0xaeec, 0x00ce, 0x0005, 0x2011, 0x1a05, 0x2013, 0x0000,
+	0x0cc8, 0x793c, 0x81ff, 0x0dc0, 0x7944, 0x9192, 0x7530, 0x1628,
+	0x8108, 0x7946, 0x793c, 0x9188, 0x0008, 0x210c, 0x918e, 0x0006,
+	0x1138, 0x6014, 0x9084, 0x1984, 0x9085, 0x0012, 0x6016, 0x0c10,
+	0x793c, 0x9188, 0x0008, 0x210c, 0x918e, 0x0009, 0x0d90, 0x6014,
+	0x9084, 0x1984, 0x9085, 0x0016, 0x6016, 0x08a0, 0x793c, 0x2160,
+	0x2009, 0x004a, 0x080c, 0xaeec, 0x0868, 0x7848, 0xc085, 0x784a,
+	0x0848, 0x0006, 0x0016, 0x00c6, 0x0126, 0x2091, 0x8000, 0x600f,
+	0x0000, 0x2c08, 0x2061, 0x19e6, 0x6020, 0x8000, 0x6022, 0x6010,
+	0x9005, 0x0148, 0x9080, 0x0003, 0x2102, 0x6112, 0x012e, 0x00ce,
+	0x001e, 0x000e, 0x0005, 0x6116, 0x6112, 0x0cc0, 0x00d6, 0x2069,
+	0x19e6, 0xb800, 0xd0d4, 0x0168, 0x6820, 0x8000, 0x6822, 0x9086,
+	0x0001, 0x1110, 0x2b00, 0x681e, 0x00de, 0x0804, 0x9687, 0x00de,
+	0x0005, 0xc0d5, 0xb802, 0x6818, 0x9005, 0x0168, 0xb856, 0xb85b,
+	0x0000, 0x0086, 0x0006, 0x2b00, 0x681a, 0x008e, 0xa05a, 0x008e,
+	0x2069, 0x19e6, 0x0c08, 0xb856, 0xb85a, 0x2b00, 0x681a, 0x681e,
+	0x08d8, 0x0006, 0x0016, 0x00c6, 0x0126, 0x2091, 0x8000, 0x600f,
+	0x0000, 0x2c08, 0x2061, 0x19e6, 0x6020, 0x8000, 0x6022, 0x6008,
+	0x9005, 0x0148, 0x9080, 0x0003, 0x2102, 0x610a, 0x012e, 0x00ce,
+	0x001e, 0x000e, 0x0005, 0x610e, 0x610a, 0x0cc0, 0x00c6, 0x600f,
+	0x0000, 0x2c08, 0x2061, 0x19e6, 0x6034, 0x9005, 0x0130, 0x9080,
+	0x0003, 0x2102, 0x6136, 0x00ce, 0x0005, 0x613a, 0x6136, 0x00ce,
+	0x0005, 0x00f6, 0x00e6, 0x00d6, 0x00c6, 0x00b6, 0x0096, 0x0076,
+	0x0066, 0x0056, 0x0036, 0x0026, 0x0016, 0x0006, 0x0126, 0x902e,
+	0x2071, 0x19e6, 0x7638, 0x2660, 0x2678, 0x2091, 0x8000, 0x8cff,
+	0x0904, 0x91cd, 0x6010, 0x2058, 0xb8a0, 0x9206, 0x1904, 0x91c8,
+	0x87ff, 0x0120, 0x6054, 0x9106, 0x1904, 0x91c8, 0x703c, 0x9c06,
+	0x1178, 0x0036, 0x2019, 0x0001, 0x080c, 0xa5b7, 0x7033, 0x0000,
+	0x9006, 0x703e, 0x7042, 0x7046, 0x704a, 0x003e, 0x2029, 0x0001,
+	0x7038, 0x9c36, 0x1110, 0x660c, 0x763a, 0x7034, 0x9c36, 0x1140,
+	0x2c00, 0x9f36, 0x0118, 0x2f00, 0x7036, 0x0010, 0x7037, 0x0000,
+	0x660c, 0x0066, 0x2c00, 0x9f06, 0x0110, 0x7e0e, 0x0008, 0x2678,
+	0x600f, 0x0000, 0x080c, 0xcb4a, 0x01f0, 0x6014, 0x2048, 0x6020,
+	0x9086, 0x0003, 0x15b8, 0x6004, 0x9086, 0x0040, 0x090c, 0xa7bd,
+	0xa867, 0x0103, 0xab7a, 0xa877, 0x0000, 0x0016, 0x0036, 0x0076,
+	0x080c, 0xce3e, 0x080c, 0xe929, 0x080c, 0x6c86, 0x007e, 0x003e,
+	0x001e, 0x080c, 0xcd33, 0x080c, 0xaea2, 0x00ce, 0x0804, 0x9167,
+	0x2c78, 0x600c, 0x2060, 0x0804, 0x9167, 0x85ff, 0x0120, 0x0036,
+	0x080c, 0x97b5, 0x003e, 0x012e, 0x000e, 0x001e, 0x002e, 0x003e,
+	0x005e, 0x006e, 0x007e, 0x009e, 0x00be, 0x00ce, 0x00de, 0x00ee,
+	0x00fe, 0x0005, 0x6020, 0x9086, 0x0006, 0x1158, 0x0016, 0x0036,
+	0x0076, 0x080c, 0xe929, 0x080c, 0xe572, 0x007e, 0x003e, 0x001e,
+	0x0890, 0x6020, 0x9086, 0x0009, 0x1168, 0xa87b, 0x0006, 0x0016,
+	0x0036, 0x0076, 0x080c, 0x6c86, 0x080c, 0xae71, 0x007e, 0x003e,
+	0x001e, 0x0818, 0x6020, 0x9086, 0x000a, 0x0904, 0x91b2, 0x0804,
+	0x91ab, 0x0006, 0x0066, 0x0096, 0x00c6, 0x00d6, 0x00f6, 0x9036,
+	0x0126, 0x2091, 0x8000, 0x2079, 0x19e6, 0x7838, 0x9065, 0x0904,
+	0x925e, 0x600c, 0x0006, 0x600f, 0x0000, 0x783c, 0x9c06, 0x1168,
+	0x0036, 0x2019, 0x0001, 0x080c, 0xa5b7, 0x7833, 0x0000, 0x901e,
+	0x7b3e, 0x7b42, 0x7b46, 0x7b4a, 0x003e, 0x080c, 0xcb4a, 0x0548,
+	0x6014, 0x2048, 0x6020, 0x9086, 0x0003, 0x1590, 0x3e08, 0x918e,
+	0x0002, 0x1188, 0x6010, 0x9005, 0x0170, 0x00b6, 0x2058, 0xb800,
+	0x00be, 0xd0bc, 0x0140, 0x6040, 0x9005, 0x11a8, 0x2001, 0x1987,
+	0x2004, 0x6042, 0x0080, 0x6004, 0x9086, 0x0040, 0x090c, 0xa7bd,
+	0xa867, 0x0103, 0xab7a, 0xa877, 0x0000, 0x080c, 0x6c7a, 0x080c,
+	0xcd33, 0x080c, 0xaea2, 0x000e, 0x0804, 0x9216, 0x7e3a, 0x7e36,
+	0x012e, 0x00fe, 0x00de, 0x00ce, 0x009e, 0x006e, 0x000e, 0x0005,
+	0x6020, 0x9086, 0x0006, 0x1118, 0x080c, 0xe572, 0x0c50, 0x6020,
+	0x9086, 0x0009, 0x1130, 0xab7a, 0x080c, 0x6c86, 0x080c, 0xae71,
+	0x0c10, 0x6020, 0x9086, 0x000a, 0x09a8, 0x0868, 0x0016, 0x0026,
+	0x0086, 0x9046, 0x0099, 0x080c, 0x9367, 0x008e, 0x002e, 0x001e,
+	0x0005, 0x00f6, 0x0126, 0x2079, 0x19e6, 0x2091, 0x8000, 0x080c,
+	0x93fe, 0x080c, 0x948c, 0x012e, 0x00fe, 0x0005, 0x00b6, 0x0096,
+	0x00f6, 0x00e6, 0x00d6, 0x00c6, 0x0066, 0x0016, 0x0006, 0x0126,
+	0x2091, 0x8000, 0x2071, 0x19e6, 0x7614, 0x2660, 0x2678, 0x8cff,
+	0x0904, 0x932c, 0x6010, 0x2058, 0xb8a0, 0x9206, 0x1904, 0x9327,
+	0x88ff, 0x0120, 0x6054, 0x9106, 0x1904, 0x9327, 0x7024, 0x9c06,
+	0x1558, 0x2069, 0x0100, 0x6820, 0xd0a4, 0x1508, 0x080c, 0x8562,
+	0x080c, 0xa274, 0x68c3, 0x0000, 0x080c, 0xa7bd, 0x7027, 0x0000,
+	0x0036, 0x2069, 0x0140, 0x6b04, 0x9384, 0x1000, 0x0138, 0x2001,
+	0x0100, 0x080c, 0x2cf1, 0x9006, 0x080c, 0x2cf1, 0x2069, 0x0100,
+	0x6824, 0xd084, 0x0110, 0x6827, 0x0001, 0x003e, 0x0028, 0x6003,
+	0x0009, 0x630a, 0x0804, 0x9327, 0x7014, 0x9c36, 0x1110, 0x660c,
+	0x7616, 0x7010, 0x9c36, 0x1140, 0x2c00, 0x9f36, 0x0118, 0x2f00,
+	0x7012, 0x0010, 0x7013, 0x0000, 0x660c, 0x0066, 0x2c00, 0x9f06,
+	0x0110, 0x7e0e, 0x0008, 0x2678, 0x600f, 0x0000, 0x6014, 0x2048,
+	0x080c, 0xcb4a, 0x01e8, 0x6020, 0x9086, 0x0003, 0x1580, 0x080c,
+	0xcd50, 0x1118, 0x080c, 0xb824, 0x0098, 0xa867, 0x0103, 0xab7a,
+	0xa877, 0x0000, 0x0016, 0x0036, 0x0086, 0x080c, 0xce3e, 0x080c,
+	0xe929, 0x080c, 0x6c86, 0x008e, 0x003e, 0x001e, 0x080c, 0xcd33,
+	0x080c, 0xaea2, 0x080c, 0xa693, 0x00ce, 0x0804, 0x92a7, 0x2c78,
+	0x600c, 0x2060, 0x0804, 0x92a7, 0x012e, 0x000e, 0x001e, 0x006e,
+	0x00ce, 0x00de, 0x00ee, 0x00fe, 0x009e, 0x00be, 0x0005, 0x6020,
+	0x9086, 0x0006, 0x1158, 0x0016, 0x0036, 0x0086, 0x080c, 0xe929,
+	0x080c, 0xe572, 0x008e, 0x003e, 0x001e, 0x08d0, 0x080c, 0xb824,
+	0x6020, 0x9086, 0x0002, 0x1160, 0x6004, 0x0006, 0x9086, 0x0085,
+	0x000e, 0x0904, 0x930d, 0x9086, 0x008b, 0x0904, 0x930d, 0x0840,
+	0x6020, 0x9086, 0x0005, 0x1920, 0x6004, 0x0006, 0x9086, 0x0085,
+	0x000e, 0x09c8, 0x9086, 0x008b, 0x09b0, 0x0804, 0x9320, 0x00b6,
+	0x00a6, 0x0096, 0x00c6, 0x0006, 0x0126, 0x2091, 0x8000, 0x9280,
+	0x1000, 0x2004, 0x905d, 0x0904, 0x93f7, 0x00f6, 0x00e6, 0x00d6,
+	0x0066, 0x2071, 0x19e6, 0xbe54, 0x7018, 0x9b06, 0x1108, 0x761a,
+	0x701c, 0x9b06, 0x1130, 0x86ff, 0x1118, 0x7018, 0x701e, 0x0008,
+	0x761e, 0xb858, 0x904d, 0x0108, 0xae56, 0x96d5, 0x0000, 0x0110,
+	0x2900, 0xb05a, 0xb857, 0x0000, 0xb85b, 0x0000, 0xb800, 0xc0d4,
+	0xc0dc, 0xb802, 0x080c, 0x653a, 0x0904, 0x93f3, 0x7624, 0x86ff,
+	0x0904, 0x93e2, 0x9680, 0x0005, 0x2004, 0x9906, 0x15d8, 0x00d6,
+	0x2069, 0x0100, 0x68c0, 0x9005, 0x0560, 0x080c, 0x8562, 0x080c,
+	0xa274, 0x68c3, 0x0000, 0x080c, 0xa7bd, 0x7027, 0x0000, 0x0036,
+	0x2069, 0x0140, 0x6b04, 0x9384, 0x1000, 0x0138, 0x2001, 0x0100,
+	0x080c, 0x2cf1, 0x9006, 0x080c, 0x2cf1, 0x2069, 0x0100, 0x6824,
+	0xd084, 0x0110, 0x6827, 0x0001, 0x003e, 0x00de, 0x00c6, 0xb83c,
+	0x9005, 0x0110, 0x8001, 0xb83e, 0x2660, 0x080c, 0xaea2, 0x00ce,
+	0x0048, 0x00de, 0x00c6, 0x2660, 0x6003, 0x0009, 0x630a, 0x00ce,
+	0x0804, 0x939a, 0x89ff, 0x0158, 0xa867, 0x0103, 0xab7a, 0xa877,
+	0x0000, 0x080c, 0xce3e, 0x080c, 0xe929, 0x080c, 0x6c86, 0x080c,
+	0xa693, 0x0804, 0x939a, 0x006e, 0x00de, 0x00ee, 0x00fe, 0x012e,
+	0x000e, 0x00ce, 0x009e, 0x00ae, 0x00be, 0x0005, 0x0096, 0x0006,
+	0x0066, 0x00c6, 0x00d6, 0x9036, 0x7814, 0x9065, 0x0904, 0x945f,
+	0x600c, 0x0006, 0x600f, 0x0000, 0x7824, 0x9c06, 0x1570, 0x2069,
+	0x0100, 0x6820, 0xd0a4, 0x1508, 0x080c, 0x8562, 0x080c, 0xa274,
+	0x68c3, 0x0000, 0x080c, 0xa7bd, 0x7827, 0x0000, 0x0036, 0x2069,
+	0x0140, 0x6b04, 0x9384, 0x1000, 0x0138, 0x2001, 0x0100, 0x080c,
+	0x2cf1, 0x9006, 0x080c, 0x2cf1, 0x2069, 0x0100, 0x6824, 0xd084,
+	0x0110, 0x6827, 0x0001, 0x003e, 0x0040, 0x080c, 0x6913, 0x1520,
+	0x6003, 0x0009, 0x630a, 0x2c30, 0x00f8, 0x6014, 0x2048, 0x080c,
+	0xcb48, 0x01b0, 0x6020, 0x9086, 0x0003, 0x1508, 0x080c, 0xcd50,
+	0x1118, 0x080c, 0xb824, 0x0060, 0x080c, 0x6913, 0x1168, 0xa867,
+	0x0103, 0xab7a, 0xa877, 0x0000, 0x080c, 0x6c86, 0x080c, 0xcd33,
+	0x080c, 0xaea2, 0x080c, 0xa693, 0x000e, 0x0804, 0x9405, 0x7e16,
+	0x7e12, 0x00de, 0x00ce, 0x006e, 0x000e, 0x009e, 0x0005, 0x6020,
+	0x9086, 0x0006, 0x1118, 0x080c, 0xe572, 0x0c50, 0x080c, 0xb824,
+	0x6020, 0x9086, 0x0002, 0x1150, 0x6004, 0x0006, 0x9086, 0x0085,
+	0x000e, 0x0990, 0x9086, 0x008b, 0x0978, 0x08d0, 0x6020, 0x9086,
+	0x0005, 0x19b0, 0x6004, 0x0006, 0x9086, 0x0085, 0x000e, 0x0d18,
+	0x9086, 0x008b, 0x0d00, 0x0860, 0x0006, 0x0066, 0x0096, 0x00b6,
+	0x00c6, 0x00d6, 0x7818, 0x905d, 0x0904, 0x950c, 0xb854, 0x0006,
+	0x9006, 0xb856, 0xb85a, 0xb800, 0xc0d4, 0xc0dc, 0xb802, 0x080c,
+	0x653a, 0x0904, 0x9509, 0x7e24, 0x86ff, 0x0904, 0x94fc, 0x9680,
+	0x0005, 0x2004, 0x9906, 0x1904, 0x94fc, 0x00d6, 0x2069, 0x0100,
+	0x68c0, 0x9005, 0x0904, 0x94f3, 0x080c, 0x8562, 0x080c, 0xa274,
+	0x68c3, 0x0000, 0x080c, 0xa7bd, 0x7827, 0x0000, 0x0036, 0x2069,
+	0x0140, 0x6b04, 0x9384, 0x1000, 0x0138, 0x2001, 0x0100, 0x080c,
+	0x2cf1, 0x9006, 0x080c, 0x2cf1, 0x2069, 0x0100, 0x6824, 0xd084,
+	0x0110, 0x6827, 0x0001, 0x003e, 0x00de, 0x00c6, 0x3e08, 0x918e,
+	0x0002, 0x1168, 0xb800, 0xd0bc, 0x0150, 0x9680, 0x0010, 0x200c,
+	0x81ff, 0x1518, 0x2009, 0x1987, 0x210c, 0x2102, 0x00f0, 0xb83c,
+	0x9005, 0x0110, 0x8001, 0xb83e, 0x2660, 0x600f, 0x0000, 0x080c,
+	0xaea2, 0x00ce, 0x0048, 0x00de, 0x00c6, 0x2660, 0x6003, 0x0009,
+	0x630a, 0x00ce, 0x0804, 0x949f, 0x89ff, 0x0138, 0xa867, 0x0103,
+	0xab7a, 0xa877, 0x0000, 0x080c, 0x6c86, 0x080c, 0xa693, 0x0804,
+	0x949f, 0x000e, 0x0804, 0x9493, 0x781e, 0x781a, 0x00de, 0x00ce,
+	0x00be, 0x009e, 0x006e, 0x000e, 0x0005, 0x00e6, 0x00d6, 0x0096,
+	0x0066, 0xb800, 0xd0dc, 0x01a0, 0xb84c, 0x904d, 0x0188, 0xa878,
+	0x9606, 0x1170, 0x2071, 0x19e6, 0x7024, 0x9035, 0x0148, 0x9080,
+	0x0005, 0x2004, 0x9906, 0x1120, 0xb800, 0xc0dc, 0xb802, 0x0029,
+	0x006e, 0x009e, 0x00de, 0x00ee, 0x0005, 0x00f6, 0x2079, 0x0100,
+	0x78c0, 0x9005, 0x1138, 0x00c6, 0x2660, 0x6003, 0x0009, 0x630a,
+	0x00ce, 0x04b8, 0x080c, 0xa274, 0x78c3, 0x0000, 0x080c, 0xa7bd,
+	0x7027, 0x0000, 0x0036, 0x2079, 0x0140, 0x7b04, 0x9384, 0x1000,
+	0x0138, 0x2001, 0x0100, 0x080c, 0x2cf1, 0x9006, 0x080c, 0x2cf1,
+	0x2079, 0x0100, 0x7824, 0xd084, 0x0110, 0x7827, 0x0001, 0x080c,
+	0xa7bd, 0x003e, 0x080c, 0x653a, 0x00c6, 0xb83c, 0x9005, 0x0110,
+	0x8001, 0xb83e, 0x2660, 0x080c, 0xae71, 0x00ce, 0xa867, 0x0103,
+	0xab7a, 0xa877, 0x0000, 0x080c, 0xce3e, 0x080c, 0x6c86, 0x080c,
+	0xa693, 0x00fe, 0x0005, 0x00b6, 0x00e6, 0x00c6, 0x2011, 0x0101,
+	0x2204, 0xc0c4, 0x2012, 0x2001, 0x180c, 0x2014, 0xc2e4, 0x2202,
+	0x2071, 0x19e6, 0x7004, 0x9084, 0x0007, 0x0002, 0x9598, 0x959c,
+	0x95ba, 0x95e3, 0x9621, 0x9598, 0x95b3, 0x9596, 0x080c, 0x0dd5,
+	0x00ce, 0x00ee, 0x00be, 0x0005, 0x7024, 0x9065, 0x0148, 0x7020,
+	0x8001, 0x7022, 0x600c, 0x9015, 0x0158, 0x7216, 0x600f, 0x0000,
+	0x7007, 0x0000, 0x7027, 0x0000, 0x00ce, 0x00ee, 0x00be, 0x0005,
+	0x7216, 0x7212, 0x0ca8, 0x7007, 0x0000, 0x7027, 0x0000, 0x7020,
+	0x9005, 0x0070, 0x6010, 0x2058, 0x080c, 0x653a, 0xb800, 0xc0dc,
+	0xb802, 0x7007, 0x0000, 0x7027, 0x0000, 0x7020, 0x8001, 0x7022,
+	0x1148, 0x2001, 0x180c, 0x2014, 0xd2ec, 0x1180, 0x00ce, 0x00ee,
+	0x00be, 0x0005, 0xb854, 0x9015, 0x0120, 0x721e, 0x080c, 0x9687,
+	0x0ca8, 0x7218, 0x721e, 0x080c, 0x9687, 0x0c80, 0xc2ec, 0x2202,
+	0x080c, 0x97b5, 0x0c58, 0x7024, 0x9065, 0x05b8, 0x700c, 0x9c06,
+	0x1160, 0x080c, 0xa693, 0x600c, 0x9015, 0x0120, 0x720e, 0x600f,
+	0x0000, 0x0448, 0x720e, 0x720a, 0x0430, 0x7014, 0x9c06, 0x1160,
+	0x080c, 0xa693, 0x600c, 0x9015, 0x0120, 0x7216, 0x600f, 0x0000,
+	0x00d0, 0x7216, 0x7212, 0x00b8, 0x6020, 0x9086, 0x0003, 0x1198,
+	0x6010, 0x2058, 0x080c, 0x653a, 0xb800, 0xc0dc, 0xb802, 0x080c,
+	0xa693, 0x701c, 0x9065, 0x0138, 0xb854, 0x9015, 0x0110, 0x721e,
+	0x0010, 0x7218, 0x721e, 0x7027, 0x0000, 0x00ce, 0x00ee, 0x00be,
+	0x0005, 0x7024, 0x9065, 0x0140, 0x080c, 0xa693, 0x600c, 0x9015,
+	0x0158, 0x720e, 0x600f, 0x0000, 0x080c, 0xa7bd, 0x7027, 0x0000,
+	0x00ce, 0x00ee, 0x00be, 0x0005, 0x720e, 0x720a, 0x0ca8, 0x00d6,
+	0x2069, 0x19e6, 0x6830, 0x9084, 0x0003, 0x0002, 0x9644, 0x9646,
+	0x966a, 0x9642, 0x080c, 0x0dd5, 0x00de, 0x0005, 0x00c6, 0x6840,
+	0x9086, 0x0001, 0x01b8, 0x683c, 0x9065, 0x0130, 0x600c, 0x9015,
+	0x0170, 0x6a3a, 0x600f, 0x0000, 0x6833, 0x0000, 0x683f, 0x0000,
+	0x2011, 0x1a05, 0x2013, 0x0000, 0x00ce, 0x00de, 0x0005, 0x683a,
+	0x6836, 0x0c90, 0x6843, 0x0000, 0x6838, 0x9065, 0x0d68, 0x6003,
+	0x0003, 0x0c50, 0x00c6, 0x9006, 0x6842, 0x6846, 0x684a, 0x683c,
+	0x9065, 0x0160, 0x600c, 0x9015, 0x0130, 0x6a3a, 0x600f, 0x0000,
+	0x683f, 0x0000, 0x0018, 0x683e, 0x683a, 0x6836, 0x00ce, 0x00de,
+	0x0005, 0x2001, 0x180c, 0x200c, 0xc1e5, 0x2102, 0x0005, 0x2001,
+	0x180c, 0x200c, 0xd1ec, 0x0120, 0xc1ec, 0x2102, 0x080c, 0x97b5,
+	0x2001, 0x19f2, 0x2004, 0x9086, 0x0001, 0x0d58, 0x00d6, 0x2069,
+	0x19e6, 0x6804, 0x9084, 0x0007, 0x0006, 0x9005, 0x11c8, 0x2001,
+	0x1837, 0x2004, 0x9084, 0x0028, 0x1198, 0x2001, 0x197b, 0x2004,
+	0x9086, 0xaaaa, 0x0168, 0x2001, 0x188b, 0x2004, 0xd08c, 0x1118,
+	0xd084, 0x1118, 0x0028, 0x080c, 0x97b5, 0x000e, 0x00de, 0x0005,
+	0x000e, 0x0002, 0x96c4, 0x9783, 0x9783, 0x9783, 0x9783, 0x9785,
+	0x9783, 0x96c2, 0x080c, 0x0dd5, 0x6820, 0x9005, 0x1110, 0x00de,
+	0x0005, 0x00c6, 0x680c, 0x9065, 0x0520, 0x6114, 0x0096, 0x2148,
 	0xa964, 0x009e, 0x918c, 0x00ff, 0x918e, 0x0035, 0x1180, 0x2009,
-	0x1837, 0x210c, 0x918c, 0x0028, 0x1150, 0x080c, 0x73bc, 0x0138,
+	0x1837, 0x210c, 0x918c, 0x0028, 0x1150, 0x080c, 0x73a5, 0x0138,
 	0x0006, 0x2009, 0x188b, 0x2104, 0xc095, 0x200a, 0x000e, 0x6807,
-	0x0004, 0x6826, 0x682b, 0x0000, 0x080c, 0x9861, 0x00ce, 0x00de,
-	0x0005, 0x2001, 0x180c, 0x2014, 0xc2ed, 0x2202, 0x00de, 0x00fe,
-	0x0005, 0x00f6, 0x00d6, 0x2069, 0x19e7, 0x6830, 0x9086, 0x0000,
-	0x1570, 0x2001, 0x180c, 0x2014, 0xd2e4, 0x0130, 0xc2e4, 0x2202,
-	0x080c, 0x969c, 0x2069, 0x19e7, 0x2001, 0x180c, 0x200c, 0xd1c4,
-	0x1508, 0x6838, 0x907d, 0x01d8, 0x6a04, 0x9296, 0x0000, 0x1904,
-	0x985a, 0x7920, 0x918e, 0x0009, 0x0588, 0x6833, 0x0001, 0x683e,
+	0x0004, 0x6826, 0x682b, 0x0000, 0x080c, 0x9862, 0x00ce, 0x00de,
+	0x0005, 0x6814, 0x9065, 0x0150, 0x6807, 0x0001, 0x6826, 0x682b,
+	0x0000, 0x080c, 0x9862, 0x00ce, 0x00de, 0x0005, 0x00b6, 0x00e6,
+	0x6a1c, 0x92dd, 0x0000, 0x0904, 0x976d, 0xb84c, 0x900d, 0x0118,
+	0xb888, 0x9005, 0x01a0, 0xb854, 0x905d, 0x0120, 0x920e, 0x0904,
+	0x976d, 0x0028, 0x6818, 0x920e, 0x0904, 0x976d, 0x2058, 0xb84c,
+	0x900d, 0x0d88, 0xb888, 0x9005, 0x1d70, 0x2b00, 0x681e, 0xbb3c,
+	0xb838, 0x9302, 0x1e40, 0x080c, 0xae48, 0x0904, 0x976d, 0x8318,
+	0xbb3e, 0x6116, 0x2b10, 0x6212, 0x0096, 0x2148, 0xa880, 0x9084,
+	0x00ff, 0x605e, 0xa883, 0x0000, 0xa884, 0x009e, 0x908a, 0x199a,
+	0x0210, 0x2001, 0x1999, 0x8003, 0x801b, 0x831b, 0x9318, 0x631a,
+	0x6114, 0x0096, 0x2148, 0xa964, 0x009e, 0x918c, 0x00ff, 0x918e,
+	0x0048, 0x0538, 0x00f6, 0x2c78, 0x2061, 0x0100, 0xbac0, 0x629a,
+	0x2069, 0x0200, 0x2071, 0x0240, 0x080c, 0x9daf, 0x2069, 0x19e6,
+	0xbb00, 0xc3dd, 0xbb02, 0x6807, 0x0002, 0x2f18, 0x6b26, 0x682b,
+	0x0000, 0x7823, 0x0003, 0x7803, 0x0001, 0x7807, 0x0040, 0x00fe,
+	0x00ee, 0x00be, 0x00ce, 0x00de, 0x0005, 0x00ee, 0x00be, 0x00ce,
+	0x0cd0, 0x6807, 0x0006, 0x2c18, 0x6b26, 0x6820, 0x8001, 0x6822,
+	0x682b, 0x0000, 0x080c, 0x653a, 0x080c, 0xac88, 0x00ee, 0x00be,
+	0x00ce, 0x00de, 0x0005, 0x00de, 0x0005, 0x00c6, 0x680c, 0x9065,
+	0x0508, 0x6114, 0x0096, 0x2148, 0xa964, 0x009e, 0x918c, 0x00ff,
+	0x918e, 0x0035, 0x1180, 0x2009, 0x1837, 0x210c, 0x918c, 0x0028,
+	0x1150, 0x080c, 0x73a5, 0x0138, 0x0006, 0x2009, 0x188b, 0x2104,
+	0xc095, 0x200a, 0x000e, 0x6807, 0x0004, 0x6826, 0x682b, 0x0000,
+	0x080c, 0x9862, 0x00ce, 0x00de, 0x0005, 0x2001, 0x180c, 0x2014,
+	0xc2ed, 0x2202, 0x00de, 0x00fe, 0x0005, 0x00f6, 0x00d6, 0x2069,
+	0x19e6, 0x6830, 0x9086, 0x0000, 0x1570, 0x2001, 0x180c, 0x2014,
+	0xd2e4, 0x0130, 0xc2e4, 0x2202, 0x080c, 0x9696, 0x2069, 0x19e6,
+	0x2001, 0x180c, 0x200c, 0xd1c4, 0x1508, 0x6838, 0x907d, 0x01d8,
+	0x6a04, 0x9296, 0x0000, 0x1904, 0x9856, 0x7920, 0x918e, 0x0009,
+	0x0588, 0x6833, 0x0001, 0x683e, 0x6847, 0x0000, 0x684b, 0x0000,
+	0x0126, 0x00f6, 0x2091, 0x2400, 0x002e, 0x080c, 0x1c48, 0x1178,
+	0x012e, 0x080c, 0xa0d1, 0x00de, 0x00fe, 0x0005, 0xc1c4, 0x2102,
+	0x0066, 0x2031, 0x0001, 0x080c, 0x7455, 0x006e, 0x08b0, 0x012e,
+	0x6843, 0x0000, 0x7803, 0x0002, 0x780c, 0x9015, 0x0140, 0x6a3a,
+	0x780f, 0x0000, 0x6833, 0x0000, 0x683f, 0x0000, 0x0c20, 0x683a,
+	0x6836, 0x0cc0, 0x7908, 0xd1fc, 0x1198, 0x6833, 0x0001, 0x683e,
 	0x6847, 0x0000, 0x684b, 0x0000, 0x0126, 0x00f6, 0x2091, 0x2400,
-	0x002e, 0x080c, 0x1c46, 0x1178, 0x012e, 0x080c, 0xa0d0, 0x00de,
-	0x00fe, 0x0005, 0xc1c4, 0x2102, 0x0066, 0x2031, 0x0001, 0x080c,
-	0x746c, 0x006e, 0x08b0, 0x012e, 0x6843, 0x0000, 0x7803, 0x0002,
-	0x780c, 0x9015, 0x0140, 0x6a3a, 0x780f, 0x0000, 0x6833, 0x0000,
-	0x683f, 0x0000, 0x0c20, 0x683a, 0x6836, 0x0cc0, 0x7908, 0xd1fc,
-	0x1198, 0x6833, 0x0001, 0x683e, 0x6847, 0x0000, 0x684b, 0x0000,
-	0x0126, 0x00f6, 0x2091, 0x2400, 0x002e, 0x080c, 0x1c46, 0x19d8,
-	0x012e, 0x080c, 0xa051, 0x0858, 0x2001, 0x1837, 0x2004, 0x9084,
-	0x0028, 0x1188, 0x2001, 0x197c, 0x2004, 0x9086, 0xaaaa, 0x0158,
-	0x2001, 0x19e8, 0x2004, 0x9005, 0x11f0, 0x2001, 0x188b, 0x200c,
-	0xc185, 0xc18c, 0x2102, 0x2f00, 0x6833, 0x0001, 0x683e, 0x6847,
-	0x0000, 0x684b, 0x0000, 0x0126, 0x00f6, 0x2091, 0x2400, 0x002e,
-	0x080c, 0x1c46, 0x1904, 0x97fb, 0x012e, 0x6a3c, 0x2278, 0x080c,
-	0x9fdb, 0x0804, 0x97ef, 0x2011, 0x188b, 0x2204, 0xc08d, 0x2012,
-	0x0804, 0x97ef, 0x6a04, 0x9296, 0x0006, 0x0904, 0x97d9, 0x0804,
-	0x97b1, 0x6020, 0x9084, 0x000f, 0x000b, 0x0005, 0x9875, 0x987a,
-	0x9ce8, 0x9d77, 0x987a, 0x9ce8, 0x9d77, 0x9875, 0x987a, 0x9875,
-	0x9875, 0x9875, 0x9875, 0x9875, 0x9875, 0x080c, 0x9588, 0x080c,
-	0x968d, 0x0005, 0x00b6, 0x0156, 0x0136, 0x0146, 0x01c6, 0x01d6,
-	0x00c6, 0x00d6, 0x00e6, 0x00f6, 0x2069, 0x0200, 0x2071, 0x0240,
-	0x6004, 0x908a, 0x0053, 0x1a0c, 0x0dd5, 0x6110, 0x2158, 0xb9c0,
-	0x2c78, 0x2061, 0x0100, 0x619a, 0x908a, 0x0040, 0x1a04, 0x98e6,
+	0x002e, 0x080c, 0x1c48, 0x19d8, 0x012e, 0x080c, 0xa052, 0x0858,
+	0x2001, 0x1837, 0x2004, 0x9084, 0x0028, 0x1188, 0x2001, 0x197b,
+	0x2004, 0x9086, 0xaaaa, 0x0158, 0x2001, 0x19e7, 0x2004, 0x9005,
+	0x11f0, 0x2001, 0x188b, 0x200c, 0xc185, 0xc18c, 0x2102, 0x2f00,
+	0x6833, 0x0001, 0x683e, 0x6847, 0x0000, 0x684b, 0x0000, 0x0126,
+	0x00f6, 0x2091, 0x2400, 0x002e, 0x080c, 0x1c48, 0x1904, 0x97f7,
+	0x012e, 0x6a3c, 0x2278, 0x080c, 0x9fdc, 0x0804, 0x97eb, 0x2011,
+	0x188b, 0x2204, 0xc08d, 0x2012, 0x0804, 0x97eb, 0x6a04, 0x9296,
+	0x0006, 0x1904, 0x97ad, 0x6a30, 0x9296, 0x0000, 0x0904, 0x97d5,
+	0x0804, 0x97ad, 0x6020, 0x9084, 0x000f, 0x000b, 0x0005, 0x9876,
+	0x987b, 0x9ce9, 0x9d78, 0x987b, 0x9ce9, 0x9d78, 0x9876, 0x987b,
+	0x9876, 0x9876, 0x9876, 0x9876, 0x9876, 0x9876, 0x080c, 0x957b,
+	0x080c, 0x9687, 0x0005, 0x00b6, 0x0156, 0x0136, 0x0146, 0x01c6,
+	0x01d6, 0x00c6, 0x00d6, 0x00e6, 0x00f6, 0x2069, 0x0200, 0x2071,
+	0x0240, 0x6004, 0x908a, 0x0053, 0x1a0c, 0x0dd5, 0x6110, 0x2158,
+	0xb9c0, 0x2c78, 0x2061, 0x0100, 0x619a, 0x908a, 0x0040, 0x1a04,
+	0x98e7, 0x005b, 0x00fe, 0x00ee, 0x00de, 0x00ce, 0x01de, 0x01ce,
+	0x014e, 0x013e, 0x015e, 0x00be, 0x0005, 0x9a6c, 0x9aa7, 0x9ad0,
+	0x9b78, 0x9b9a, 0x9ba0, 0x9bad, 0x9bb5, 0x9bc1, 0x9bc7, 0x9bd8,
+	0x9bc7, 0x9c30, 0x9bb5, 0x9c3c, 0x9c42, 0x9bc1, 0x9c42, 0x9c4e,
+	0x98e5, 0x98e5, 0x98e5, 0x98e5, 0x98e5, 0x98e5, 0x98e5, 0x98e5,
+	0x98e5, 0x98e5, 0x98e5, 0xa46e, 0xa491, 0xa4a2, 0xa4c2, 0xa4f4,
+	0x9bad, 0x98e5, 0x9bad, 0x9bc7, 0x98e5, 0x9ad0, 0x9b78, 0x98e5,
+	0xa8b4, 0x9bc7, 0x98e5, 0xa8d0, 0x9bc7, 0x98e5, 0x9bc1, 0x9a66,
+	0x9908, 0x98e5, 0xa8ec, 0xa959, 0xaa30, 0x98e5, 0xaa3d, 0x9baa,
+	0xaa68, 0x98e5, 0xa4fe, 0xaa95, 0x98e5, 0x080c, 0x0dd5, 0x2100,
 	0x005b, 0x00fe, 0x00ee, 0x00de, 0x00ce, 0x01de, 0x01ce, 0x014e,
-	0x013e, 0x015e, 0x00be, 0x0005, 0x9a6b, 0x9aa6, 0x9acf, 0x9b77,
-	0x9b99, 0x9b9f, 0x9bac, 0x9bb4, 0x9bc0, 0x9bc6, 0x9bd7, 0x9bc6,
-	0x9c2f, 0x9bb4, 0x9c3b, 0x9c41, 0x9bc0, 0x9c41, 0x9c4d, 0x98e4,
-	0x98e4, 0x98e4, 0x98e4, 0x98e4, 0x98e4, 0x98e4, 0x98e4, 0x98e4,
-	0x98e4, 0x98e4, 0xa46d, 0xa490, 0xa4a1, 0xa4c1, 0xa4f3, 0x9bac,
-	0x98e4, 0x9bac, 0x9bc6, 0x98e4, 0x9acf, 0x9b77, 0x98e4, 0xa8a9,
-	0x9bc6, 0x98e4, 0xa8c5, 0x9bc6, 0x98e4, 0x9bc0, 0x9a65, 0x9907,
-	0x98e4, 0xa8e1, 0xa94e, 0xaa25, 0x98e4, 0xaa32, 0x9ba9, 0xaa5d,
-	0x98e4, 0xa4fd, 0xaa8a, 0x98e4, 0x080c, 0x0dd5, 0x2100, 0x005b,
-	0x00fe, 0x00ee, 0x00de, 0x00ce, 0x01de, 0x01ce, 0x014e, 0x013e,
-	0x015e, 0x00be, 0x0005, 0xab25, 0xabd7, 0x9905, 0x992e, 0x99da,
-	0x99e5, 0x9905, 0x9bac, 0x9905, 0x9a2c, 0x9a38, 0x9949, 0x9905,
-	0x9964, 0x9998, 0xad3f, 0xad84, 0x9bc6, 0x080c, 0x0dd5, 0x00d6,
-	0x0096, 0x080c, 0x9c60, 0x7003, 0x2414, 0x7007, 0x0018, 0x700b,
-	0x0800, 0x7814, 0x2048, 0xa83c, 0x700e, 0xa850, 0x7022, 0xa854,
-	0x7026, 0x60c3, 0x0018, 0x080c, 0xa247, 0x009e, 0x00de, 0x0005,
-	0x7810, 0x00b6, 0x2058, 0xb8a0, 0x00be, 0x080c, 0xadcb, 0x1118,
-	0x9084, 0xff80, 0x0110, 0x9085, 0x0001, 0x0005, 0x00d6, 0x0096,
-	0x080c, 0x9c60, 0x7003, 0x0500, 0x7814, 0x2048, 0xa874, 0x700a,
-	0xa878, 0x700e, 0xa87c, 0x7012, 0xa880, 0x7016, 0xa884, 0x701a,
-	0xa888, 0x701e, 0x60c3, 0x0010, 0x080c, 0xa247, 0x009e, 0x00de,
-	0x0005, 0x00d6, 0x0096, 0x080c, 0x9c60, 0x7003, 0x0500, 0x7814,
-	0x2048, 0xa8cc, 0x700a, 0xa8d0, 0x700e, 0xa8d4, 0x7012, 0xa8d8,
-	0x7016, 0xa8dc, 0x701a, 0xa8e0, 0x701e, 0x60c3, 0x0010, 0x080c,
-	0xa247, 0x009e, 0x00de, 0x0005, 0x00d6, 0x0096, 0x0126, 0x2091,
-	0x8000, 0x080c, 0x9c60, 0x20e9, 0x0000, 0x2001, 0x19a3, 0x2003,
-	0x0000, 0x7814, 0x2048, 0xa814, 0x8003, 0x60c2, 0xa830, 0x20a8,
-	0xa860, 0x20e0, 0xa85c, 0x9080, 0x001b, 0x2098, 0x2001, 0x19a3,
-	0x0016, 0x200c, 0x2001, 0x0001, 0x080c, 0x23b7, 0x080c, 0xd867,
-	0x9006, 0x080c, 0x23b7, 0x001e, 0xa804, 0x9005, 0x0110, 0x2048,
-	0x0c28, 0x04d9, 0x080c, 0xa247, 0x012e, 0x009e, 0x00de, 0x0005,
-	0x00d6, 0x0096, 0x0126, 0x2091, 0x8000, 0x080c, 0x9cab, 0x20e9,
-	0x0000, 0x2001, 0x19a3, 0x2003, 0x0000, 0x7814, 0x2048, 0xa86f,
-	0x0200, 0xa873, 0x0000, 0xa814, 0x8003, 0x60c2, 0xa830, 0x20a8,
-	0xa860, 0x20e0, 0xa85c, 0x9080, 0x001b, 0x2098, 0x2001, 0x19a3,
-	0x0016, 0x200c, 0x080c, 0xd867, 0x001e, 0xa804, 0x9005, 0x0110,
-	0x2048, 0x0c60, 0x0051, 0x7814, 0x2048, 0x080c, 0x0fb1, 0x080c,
-	0xa247, 0x012e, 0x009e, 0x00de, 0x0005, 0x60c0, 0x8004, 0x9084,
-	0x0003, 0x9005, 0x0130, 0x9082, 0x0004, 0x20a3, 0x0000, 0x8000,
-	0x1de0, 0x0005, 0x080c, 0x9c60, 0x7003, 0x7800, 0x7808, 0x8007,
-	0x700a, 0x60c3, 0x0008, 0x0804, 0xa247, 0x00d6, 0x00e6, 0x080c,
-	0x9cab, 0x7814, 0x9084, 0xff00, 0x2073, 0x0200, 0x8e70, 0x8e70,
-	0x9095, 0x0010, 0x2272, 0x8e70, 0x2073, 0x0034, 0x8e70, 0x2069,
-	0x1805, 0x20a9, 0x0004, 0x2d76, 0x8d68, 0x8e70, 0x1f04, 0x99fb,
-	0x2069, 0x1801, 0x20a9, 0x0004, 0x2d76, 0x8d68, 0x8e70, 0x1f04,
-	0x9a04, 0x2069, 0x19b3, 0x9086, 0xdf00, 0x0110, 0x2069, 0x19cd,
-	0x20a9, 0x001a, 0x9e86, 0x0260, 0x1148, 0x00c6, 0x2061, 0x0200,
-	0x6010, 0x8000, 0x6012, 0x00ce, 0x2071, 0x0240, 0x2d04, 0x8007,
-	0x2072, 0x8d68, 0x8e70, 0x1f04, 0x9a12, 0x60c3, 0x004c, 0x080c,
-	0xa247, 0x00ee, 0x00de, 0x0005, 0x080c, 0x9c60, 0x7003, 0x6300,
-	0x7007, 0x0028, 0x7808, 0x700e, 0x60c3, 0x0008, 0x0804, 0xa247,
-	0x00d6, 0x0026, 0x0016, 0x080c, 0x9cab, 0x7003, 0x0200, 0x7814,
-	0x700e, 0x00e6, 0x9ef0, 0x0004, 0x2009, 0x0001, 0x2011, 0x000c,
-	0x2069, 0x1923, 0x6810, 0xd084, 0x1148, 0x2073, 0x0500, 0x8e70,
-	0x2073, 0x0000, 0x8e70, 0x8108, 0x9290, 0x0004, 0x2073, 0x0800,
-	0x8e70, 0x2073, 0x0000, 0x00ee, 0x7206, 0x710a, 0x62c2, 0x080c,
-	0xa247, 0x001e, 0x002e, 0x00de, 0x0005, 0x2001, 0x1818, 0x2004,
-	0x609a, 0x0804, 0xa247, 0x080c, 0x9c60, 0x7003, 0x5200, 0x2069,
-	0x1847, 0x6804, 0xd084, 0x0130, 0x6828, 0x0016, 0x080c, 0x2871,
-	0x710e, 0x001e, 0x20a9, 0x0004, 0x20e1, 0x0001, 0x2099, 0x1805,
-	0x20e9, 0x0000, 0x20a1, 0x0250, 0x4003, 0x20a9, 0x0004, 0x2099,
-	0x1801, 0x20a1, 0x0254, 0x4003, 0x080c, 0xadcb, 0x1120, 0xb8a0,
-	0x9082, 0x007f, 0x0248, 0x2001, 0x181f, 0x2004, 0x7032, 0x2001,
-	0x1820, 0x2004, 0x7036, 0x0030, 0x2001, 0x1818, 0x2004, 0x9084,
-	0x00ff, 0x7036, 0x60c3, 0x001c, 0x0804, 0xa247, 0x080c, 0x9c60,
-	0x7003, 0x0500, 0x080c, 0xadcb, 0x1120, 0xb8a0, 0x9082, 0x007f,
-	0x0248, 0x2001, 0x181f, 0x2004, 0x700a, 0x2001, 0x1820, 0x2004,
-	0x700e, 0x0030, 0x2001, 0x1818, 0x2004, 0x9084, 0x00ff, 0x700e,
-	0x20a9, 0x0004, 0x20e1, 0x0001, 0x2099, 0x1805, 0x20e9, 0x0000,
-	0x20a1, 0x0250, 0x4003, 0x60c3, 0x0010, 0x0804, 0xa247, 0x080c,
-	0x9c60, 0x9006, 0x080c, 0x693c, 0xb8a0, 0x9086, 0x007e, 0x1130,
-	0x7003, 0x0400, 0x620c, 0xc2b4, 0x620e, 0x0058, 0x7814, 0x0096,
-	0x904d, 0x0120, 0x9006, 0xa89a, 0xa8a6, 0xa8aa, 0x009e, 0x7003,
-	0x0300, 0xb8a0, 0x9086, 0x007e, 0x1904, 0x9b3e, 0x00d6, 0x2069,
-	0x196c, 0x2001, 0x1837, 0x2004, 0xd0a4, 0x0188, 0x6800, 0x700a,
-	0x6808, 0x9084, 0x2000, 0x7012, 0x080c, 0xade2, 0x680c, 0x7016,
-	0x701f, 0x2710, 0x6818, 0x7022, 0x681c, 0x7026, 0x0090, 0x6800,
-	0x700a, 0x6804, 0x700e, 0x6808, 0x080c, 0x73bc, 0x1118, 0x9084,
-	0x37ff, 0x0010, 0x9084, 0x3fff, 0x7012, 0x080c, 0xade2, 0x680c,
-	0x7016, 0x00de, 0x20a9, 0x0004, 0x20e1, 0x0001, 0x2099, 0x1805,
-	0x20e9, 0x0000, 0x20a1, 0x0256, 0x4003, 0x20a9, 0x0004, 0x2099,
-	0x1801, 0x20a1, 0x025a, 0x4003, 0x00d6, 0x080c, 0xab0c, 0x2069,
-	0x1974, 0x2071, 0x024e, 0x6800, 0xc0dd, 0x7002, 0x080c, 0x56d3,
-	0xd0e4, 0x0110, 0x680c, 0x700e, 0x00de, 0x04a8, 0x2001, 0x1837,
-	0x2004, 0xd0a4, 0x0170, 0x0016, 0x2001, 0x196d, 0x200c, 0x60e0,
-	0x9106, 0x0130, 0x2100, 0x60e3, 0x0000, 0x080c, 0x28b2, 0x61e2,
-	0x001e, 0x20e1, 0x0001, 0x2099, 0x196c, 0x20e9, 0x0000, 0x20a1,
-	0x024e, 0x20a9, 0x0008, 0x4003, 0x20a9, 0x0004, 0x2099, 0x1805,
-	0x20a1, 0x0256, 0x4003, 0x20a9, 0x0004, 0x2099, 0x1801, 0x20a1,
-	0x025a, 0x4003, 0x080c, 0xab0c, 0x20a1, 0x024e, 0x20a9, 0x0008,
-	0x2099, 0x1974, 0x4003, 0x60c3, 0x0074, 0x0804, 0xa247, 0x080c,
-	0x9c60, 0x7003, 0x2010, 0x7007, 0x0014, 0x700b, 0x0800, 0x700f,
-	0x2000, 0x9006, 0x00f6, 0x2079, 0x1847, 0x7904, 0x00fe, 0xd1ac,
-	0x1110, 0x9085, 0x0020, 0xd1a4, 0x0110, 0x9085, 0x0010, 0x9085,
-	0x0002, 0x00d6, 0x0804, 0x9c10, 0x7026, 0x60c3, 0x0014, 0x0804,
-	0xa247, 0x080c, 0x9c60, 0x7003, 0x5000, 0x0804, 0x9ae9, 0x080c,
-	0x9c60, 0x7003, 0x2110, 0x7007, 0x0014, 0x60c3, 0x0014, 0x0804,
-	0xa247, 0x080c, 0x9ca2, 0x0010, 0x080c, 0x9cab, 0x7003, 0x0200,
-	0x60c3, 0x0004, 0x0804, 0xa247, 0x080c, 0x9cab, 0x7003, 0x0100,
-	0x700b, 0x0003, 0x700f, 0x2a00, 0x60c3, 0x0008, 0x0804, 0xa247,
-	0x080c, 0x9cab, 0x7003, 0x0200, 0x0804, 0x9ae9, 0x080c, 0x9cab,
-	0x7003, 0x0100, 0x782c, 0x9005, 0x0110, 0x700a, 0x0010, 0x700b,
-	0x0003, 0x7814, 0x700e, 0x60c3, 0x0008, 0x0804, 0xa247, 0x00d6,
-	0x080c, 0x9cab, 0x7003, 0x0210, 0x7007, 0x0014, 0x700b, 0x0800,
-	0xb894, 0x9086, 0x0014, 0x1198, 0xb99c, 0x9184, 0x0030, 0x0190,
-	0xb998, 0x9184, 0xc000, 0x1140, 0xd1ec, 0x0118, 0x700f, 0x2100,
-	0x0058, 0x700f, 0x0100, 0x0040, 0x700f, 0x0400, 0x0028, 0x700f,
-	0x0700, 0x0010, 0x700f, 0x0800, 0x00f6, 0x2079, 0x1847, 0x7904,
-	0x00fe, 0xd1ac, 0x1110, 0x9085, 0x0020, 0xd1a4, 0x0110, 0x9085,
-	0x0010, 0x2009, 0x1869, 0x210c, 0xd184, 0x1110, 0x9085, 0x0002,
-	0x0026, 0x2009, 0x1867, 0x210c, 0xd1e4, 0x0150, 0xc0c5, 0xbacc,
-	0xd28c, 0x1108, 0xc0cd, 0x9094, 0x0030, 0x9296, 0x0010, 0x0140,
-	0xd1ec, 0x0130, 0x9094, 0x0030, 0x9296, 0x0010, 0x0108, 0xc0bd,
-	0x002e, 0x7026, 0x60c3, 0x0014, 0x00de, 0x0804, 0xa247, 0x080c,
-	0x9cab, 0x7003, 0x0210, 0x7007, 0x0014, 0x700f, 0x0100, 0x60c3,
-	0x0014, 0x0804, 0xa247, 0x080c, 0x9cab, 0x7003, 0x0200, 0x0804,
-	0x9a6f, 0x080c, 0x9cab, 0x7003, 0x0100, 0x700b, 0x0003, 0x700f,
-	0x2a00, 0x60c3, 0x0008, 0x0804, 0xa247, 0x080c, 0x9cab, 0x7003,
-	0x0100, 0x700b, 0x000b, 0x60c3, 0x0008, 0x0804, 0xa247, 0x0026,
-	0x00d6, 0x0036, 0x0046, 0x2019, 0x3200, 0x2021, 0x0800, 0x0040,
-	0x0026, 0x00d6, 0x0036, 0x0046, 0x2019, 0x2200, 0x2021, 0x0100,
-	0x080c, 0xab21, 0xb810, 0x9305, 0x7002, 0xb814, 0x7006, 0x2069,
-	0x1800, 0x687c, 0x700a, 0x6880, 0x700e, 0x9485, 0x0029, 0x7012,
-	0x004e, 0x003e, 0x00de, 0x080c, 0xa235, 0x721a, 0x9f95, 0x0000,
-	0x7222, 0x7027, 0xffff, 0x2071, 0x024c, 0x002e, 0x0005, 0x0026,
-	0x080c, 0xab21, 0x7003, 0x02ff, 0x7007, 0xfffc, 0x00d6, 0x2069,
-	0x1800, 0x687c, 0x700a, 0x6880, 0x700e, 0x00de, 0x7013, 0x2029,
-	0x0c10, 0x7003, 0x0100, 0x7007, 0x0000, 0x700b, 0xfc02, 0x700f,
-	0x0000, 0x0005, 0x0026, 0x00d6, 0x0036, 0x0046, 0x2019, 0x3300,
-	0x2021, 0x0800, 0x0040, 0x0026, 0x00d6, 0x0036, 0x0046, 0x2019,
-	0x2300, 0x2021, 0x0100, 0x080c, 0xab21, 0xb810, 0x9305, 0x7002,
-	0xb814, 0x7006, 0x2069, 0x1800, 0xb810, 0x9005, 0x1140, 0xb814,
-	0x9005, 0x1128, 0x700b, 0x00ff, 0x700f, 0xfffe, 0x0020, 0x687c,
-	0x700a, 0x6880, 0x700e, 0x0000, 0x9485, 0x0098, 0x7012, 0x004e,
-	0x003e, 0x00de, 0x080c, 0xa235, 0x721a, 0x7a08, 0x7222, 0x2f10,
-	0x7226, 0x2071, 0x024c, 0x002e, 0x0005, 0x080c, 0xa235, 0x721a,
-	0x7a08, 0x7222, 0x7814, 0x7026, 0x2071, 0x024c, 0x002e, 0x0005,
-	0x00b6, 0x00c6, 0x00d6, 0x00e6, 0x00f6, 0x2069, 0x0200, 0x2071,
-	0x0240, 0x6004, 0x908a, 0x0085, 0x0a0c, 0x0dd5, 0x908a, 0x0092,
-	0x1a0c, 0x0dd5, 0x6110, 0x2158, 0xb9c0, 0x2c78, 0x2061, 0x0100,
-	0x619a, 0x9082, 0x0085, 0x0033, 0x00fe, 0x00ee, 0x00de, 0x00ce,
-	0x00be, 0x0005, 0x9d19, 0x9d28, 0x9d33, 0x9d17, 0x9d17, 0x9d17,
-	0x9d19, 0x9d17, 0x9d17, 0x9d17, 0x9d17, 0x9d17, 0x9d17, 0x080c,
-	0x0dd5, 0x0411, 0x60c3, 0x0000, 0x0026, 0x080c, 0x2ba5, 0x0228,
-	0x2011, 0x0101, 0x2204, 0xc0c5, 0x2012, 0x002e, 0x0804, 0xa247,
-	0x0431, 0x7808, 0x700a, 0x7814, 0x700e, 0x7017, 0xffff, 0x60c3,
-	0x000c, 0x0804, 0xa247, 0x0479, 0x7003, 0x0003, 0x7007, 0x0300,
-	0x60c3, 0x0004, 0x0804, 0xa247, 0x0026, 0x080c, 0xab21, 0xb810,
-	0x9085, 0x8100, 0x7002, 0xb814, 0x7006, 0x2069, 0x1800, 0x687c,
-	0x700a, 0x6880, 0x700e, 0x7013, 0x0009, 0x0804, 0x9c7b, 0x0026,
-	0x080c, 0xab21, 0xb810, 0x9085, 0x8400, 0x7002, 0xb814, 0x7006,
-	0x2069, 0x1800, 0x687c, 0x700a, 0x6880, 0x700e, 0x2001, 0x0099,
-	0x7012, 0x0804, 0x9cdd, 0x0026, 0x080c, 0xab21, 0xb810, 0x9085,
-	0x8500, 0x7002, 0xb814, 0x7006, 0x2069, 0x1800, 0x687c, 0x700a,
-	0x6880, 0x700e, 0x2001, 0x0099, 0x7012, 0x0804, 0x9cdd, 0x00b6,
-	0x00c6, 0x00d6, 0x00e6, 0x00f6, 0x2c78, 0x2069, 0x0200, 0x2071,
-	0x0240, 0x7804, 0x908a, 0x0040, 0x0a0c, 0x0dd5, 0x908a, 0x0054,
-	0x1a0c, 0x0dd5, 0x7910, 0x2158, 0xb9c0, 0x2061, 0x0100, 0x619a,
-	0x9082, 0x0040, 0x0033, 0x00fe, 0x00ee, 0x00de, 0x00ce, 0x00be,
-	0x0005, 0x9dae, 0x9e6a, 0x9e3d, 0x9f8c, 0x9dac, 0x9dac, 0x9dac,
-	0x9dac, 0x9dac, 0x9dac, 0x9dac, 0xa66f, 0xa677, 0xa67f, 0xa687,
-	0x9dac, 0xaa69, 0x9dac, 0xa667, 0x080c, 0x0dd5, 0x0096, 0x780b,
-	0xffff, 0x080c, 0x9e19, 0x7914, 0x2148, 0xa978, 0x7956, 0xae64,
-	0x96b4, 0x00ff, 0x9686, 0x0008, 0x1148, 0xa8b4, 0x7032, 0xa8b8,
-	0x7036, 0xa8bc, 0x703a, 0xa8c0, 0x703e, 0x0008, 0x7132, 0xa97c,
-	0x9184, 0x000f, 0x1118, 0x2001, 0x0005, 0x0040, 0xd184, 0x0118,
-	0x2001, 0x0004, 0x0018, 0x9084, 0x0006, 0x8004, 0x2010, 0x785c,
-	0x9084, 0x00ff, 0x8007, 0x9205, 0x7042, 0xd1ac, 0x0158, 0x7047,
-	0x0002, 0x9686, 0x0008, 0x1118, 0x080c, 0x18ac, 0x0010, 0x080c,
-	0x1725, 0x0050, 0xd1b4, 0x0118, 0x7047, 0x0001, 0x0028, 0x7047,
-	0x0000, 0x9016, 0x2230, 0x0010, 0xaab0, 0xaeac, 0x726a, 0x766e,
-	0x20a9, 0x0008, 0x20e9, 0x0000, 0xa860, 0x20e0, 0xa85c, 0x9080,
-	0x0023, 0x2098, 0x20a1, 0x0252, 0x2069, 0x0200, 0x6813, 0x0018,
-	0x4003, 0x6813, 0x0008, 0x60c3, 0x0020, 0x6017, 0x0009, 0x2001,
-	0x1a03, 0x2003, 0x07d0, 0x2001, 0x1a02, 0x2003, 0x0009, 0x009e,
-	0x0005, 0x6813, 0x0008, 0xba8c, 0x8210, 0xb8cc, 0xd084, 0x0128,
-	0x7a46, 0x7b14, 0x7b4a, 0x722e, 0x732a, 0x9294, 0x00ff, 0xba8e,
-	0x8217, 0x721a, 0xba10, 0x9295, 0x0600, 0x7202, 0xba14, 0x7206,
-	0x2069, 0x1800, 0x6a7c, 0x720a, 0x6a80, 0x720e, 0x7013, 0x0829,
-	0x2f10, 0x7222, 0x7027, 0xffff, 0x0005, 0x00d6, 0x0096, 0x0081,
-	0x7814, 0x2048, 0xa890, 0x7002, 0xa88c, 0x7006, 0xa8b0, 0x700a,
-	0xa8ac, 0x700e, 0x60c3, 0x000c, 0x009e, 0x00de, 0x0804, 0xa247,
-	0x6813, 0x0008, 0xb810, 0x9085, 0x0500, 0x7002, 0xb814, 0x7006,
-	0x2069, 0x1800, 0x687c, 0x700a, 0x6880, 0x700e, 0x7013, 0x0889,
-	0x080c, 0xa235, 0x721a, 0x7a08, 0x7222, 0x2f10, 0x7226, 0x2071,
-	0x024c, 0x0005, 0x00d6, 0x0096, 0x080c, 0x9f6a, 0x7814, 0x2048,
-	0x080c, 0xcb33, 0x1130, 0x7814, 0x9084, 0x0700, 0x8007, 0x0033,
-	0x0010, 0x9006, 0x001b, 0x009e, 0x00de, 0x0005, 0x9e88, 0x9ef1,
-	0x9f01, 0x9f27, 0x9f33, 0x9f44, 0x9f4c, 0x9e86, 0x080c, 0x0dd5,
-	0x0016, 0x0036, 0xa97c, 0x918c, 0x0003, 0x0118, 0x9186, 0x0003,
-	0x1198, 0xaba8, 0x7824, 0xd0cc, 0x1168, 0x7316, 0xa898, 0x701a,
-	0xa894, 0x701e, 0x003e, 0x001e, 0x2001, 0x19b1, 0x2004, 0x60c2,
-	0x0804, 0xa247, 0xc3e5, 0x0c88, 0x9186, 0x0001, 0x190c, 0x0dd5,
-	0xaba8, 0x7824, 0xd0cc, 0x1904, 0x9eee, 0x7316, 0xa898, 0x701a,
-	0xa894, 0x701e, 0xa8a4, 0x7026, 0xa8ac, 0x702e, 0x2009, 0x0018,
-	0x9384, 0x0300, 0x0570, 0xd3c4, 0x0110, 0xa8ac, 0x9108, 0xd3cc,
-	0x0110, 0xa8a4, 0x9108, 0x6810, 0x9085, 0x0010, 0x6812, 0x2011,
-	0x0258, 0x20e9, 0x0000, 0x22a0, 0x0156, 0x20a9, 0x0008, 0xa860,
-	0x20e0, 0xa85c, 0x9080, 0x002c, 0x2098, 0x4003, 0x6810, 0x8000,
-	0x6812, 0x2011, 0x0240, 0x22a0, 0x20a9, 0x0005, 0x4003, 0x6810,
-	0xc084, 0x6812, 0x015e, 0x9184, 0x0003, 0x0118, 0x2019, 0x0245,
-	0x201a, 0x61c2, 0x003e, 0x001e, 0x0804, 0xa247, 0xc3e5, 0x0804,
-	0x9ead, 0x2011, 0x0008, 0x2001, 0x180f, 0x2004, 0xd0a4, 0x0110,
-	0x2011, 0x0028, 0x7824, 0xd0cc, 0x1110, 0x7216, 0x0470, 0x0ce8,
-	0xc2e5, 0x2011, 0x0302, 0x0016, 0x782c, 0x701a, 0x7930, 0x711e,
-	0x9105, 0x0108, 0xc2dd, 0x001e, 0x7824, 0xd0cc, 0x0108, 0xc2e5,
-	0x7216, 0x7027, 0x0012, 0x702f, 0x0008, 0x7043, 0x7000, 0x7047,
-	0x0500, 0x704f, 0x000a, 0x2069, 0x0200, 0x6813, 0x0009, 0x2071,
-	0x0240, 0x700b, 0x2500, 0x60c3, 0x0032, 0x0804, 0xa247, 0x2011,
-	0x0028, 0x7824, 0xd0cc, 0x1128, 0x7216, 0x60c3, 0x0018, 0x0804,
-	0xa247, 0x0cd0, 0xc2e5, 0x2011, 0x0100, 0x7824, 0xd0cc, 0x0108,
-	0xc2e5, 0x7216, 0x702f, 0x0008, 0x7858, 0x9084, 0x00ff, 0x7036,
-	0x60c3, 0x0020, 0x0804, 0xa247, 0x2011, 0x0008, 0x7824, 0xd0cc,
-	0x0108, 0xc2e5, 0x7216, 0x0c08, 0x0036, 0x7b14, 0x9384, 0xff00,
-	0x7816, 0x9384, 0x00ff, 0x8001, 0x1138, 0x7824, 0xd0cc, 0x0108,
-	0xc2e5, 0x7216, 0x003e, 0x0888, 0x0046, 0x2021, 0x0800, 0x0006,
-	0x7824, 0xd0cc, 0x000e, 0x0108, 0xc4e5, 0x7416, 0x004e, 0x701e,
-	0x003e, 0x0818, 0x00d6, 0x6813, 0x0008, 0xb810, 0x9085, 0x0700,
-	0x7002, 0xb814, 0x7006, 0x2069, 0x1800, 0x687c, 0x700a, 0x6880,
-	0x700e, 0x7824, 0xd0cc, 0x1168, 0x7013, 0x0898, 0x080c, 0xa235,
-	0x721a, 0x7a08, 0x7222, 0x2f10, 0x7226, 0x2071, 0x024c, 0x00de,
-	0x0005, 0x7013, 0x0889, 0x0c90, 0x0016, 0x7814, 0x9084, 0x0700,
-	0x8007, 0x0013, 0x001e, 0x0005, 0x9f9c, 0x9f9c, 0x9f9e, 0x9f9c,
-	0x9f9c, 0x9f9c, 0x9fb8, 0x9f9c, 0x080c, 0x0dd5, 0x7914, 0x918c,
-	0x08ff, 0x918d, 0xf600, 0x7916, 0x2009, 0x0003, 0x00b9, 0x2069,
-	0x1847, 0x6804, 0xd0bc, 0x0130, 0x682c, 0x9084, 0x00ff, 0x8007,
-	0x7032, 0x0010, 0x7033, 0x3f00, 0x60c3, 0x0001, 0x0804, 0xa247,
-	0x2009, 0x0003, 0x0019, 0x7033, 0x7f00, 0x0cb0, 0x0016, 0x080c,
-	0xab21, 0x001e, 0xb810, 0x9085, 0x0100, 0x7002, 0xb814, 0x7006,
-	0x2069, 0x1800, 0x6a7c, 0x720a, 0x6a80, 0x720e, 0x7013, 0x0888,
-	0x918d, 0x0008, 0x7116, 0x080c, 0xa235, 0x721a, 0x7a08, 0x7222,
-	0x2f10, 0x7226, 0x0005, 0x00b6, 0x00e6, 0x00d6, 0x00c6, 0x0066,
-	0x0056, 0x0046, 0x0036, 0x2061, 0x0100, 0x2071, 0x1800, 0x7160,
-	0x7810, 0x2058, 0x76dc, 0x96b4, 0x0028, 0x0110, 0x737c, 0x7480,
-	0x2500, 0x76dc, 0x96b4, 0x0028, 0x0140, 0x2001, 0x04ff, 0x6062,
-	0x6067, 0xffff, 0x636a, 0x646e, 0x0050, 0x2001, 0x00ff, 0x9085,
-	0x0400, 0x6062, 0x6067, 0xffff, 0x606b, 0x0000, 0x616e, 0xb8b8,
-	0x6073, 0x0530, 0x6077, 0x0008, 0xb88c, 0x8000, 0x9084, 0x00ff,
-	0xb88e, 0x8007, 0x9085, 0x0020, 0x607a, 0x607f, 0x0000, 0x2b00,
-	0x6082, 0x6087, 0xffff, 0x7814, 0x0096, 0x2048, 0xa838, 0x608a,
-	0xa834, 0x608e, 0xa848, 0x60c6, 0xa844, 0x60ca, 0x009e, 0xb86c,
-	0x60ce, 0x60ab, 0x0036, 0x60af, 0x95d5, 0x60d7, 0x0000, 0x2001,
-	0x1837, 0x2004, 0x9084, 0x0028, 0x0128, 0x609f, 0x0000, 0x2001,
-	0x0092, 0x0048, 0x6028, 0xc0bd, 0x602a, 0x609f, 0x00ff, 0x6027,
-	0xffff, 0x2001, 0x00b2, 0x6016, 0x2009, 0x07d0, 0x080c, 0x857e,
-	0x003e, 0x004e, 0x005e, 0x006e, 0x00ce, 0x00de, 0x00ee, 0x00be,
-	0x0005, 0x00b6, 0x00e6, 0x00d6, 0x00c6, 0x0066, 0x0056, 0x0046,
-	0x0036, 0x2061, 0x0100, 0x2071, 0x1800, 0x7160, 0x7810, 0x2058,
-	0xb8a0, 0x2028, 0x76dc, 0xd6ac, 0x1168, 0x9582, 0x007e, 0x1250,
-	0x2500, 0x9094, 0xff80, 0x1130, 0x9080, 0x3325, 0x2015, 0x9294,
-	0x00ff, 0x0020, 0xb910, 0xba14, 0x737c, 0x7480, 0x70dc, 0xd0ac,
-	0x1130, 0x9582, 0x007e, 0x1218, 0x9584, 0xff80, 0x0138, 0x9185,
-	0x0400, 0x6062, 0x6266, 0x636a, 0x646e, 0x0030, 0x6063, 0x0400,
-	0x6266, 0x606b, 0x0000, 0x616e, 0xb8b8, 0x6072, 0x6077, 0x0000,
-	0xb864, 0xd0a4, 0x0110, 0x6077, 0x0008, 0xb88c, 0x8000, 0x9084,
+	0x013e, 0x015e, 0x00be, 0x0005, 0xab30, 0xabe2, 0x9906, 0x992f,
+	0x99db, 0x99e6, 0x9906, 0x9bad, 0x9906, 0x9a2d, 0x9a39, 0x994a,
+	0x9906, 0x9965, 0x9999, 0xad4f, 0xad94, 0x9bc7, 0x080c, 0x0dd5,
+	0x00d6, 0x0096, 0x080c, 0x9c61, 0x7003, 0x2414, 0x7007, 0x0018,
+	0x700b, 0x0800, 0x7814, 0x2048, 0xa83c, 0x700e, 0xa850, 0x7022,
+	0xa854, 0x7026, 0x60c3, 0x0018, 0x080c, 0xa248, 0x009e, 0x00de,
+	0x0005, 0x7810, 0x00b6, 0x2058, 0xb8a0, 0x00be, 0x080c, 0xaddb,
+	0x1118, 0x9084, 0xff80, 0x0110, 0x9085, 0x0001, 0x0005, 0x00d6,
+	0x0096, 0x080c, 0x9c61, 0x7003, 0x0500, 0x7814, 0x2048, 0xa874,
+	0x700a, 0xa878, 0x700e, 0xa87c, 0x7012, 0xa880, 0x7016, 0xa884,
+	0x701a, 0xa888, 0x701e, 0x60c3, 0x0010, 0x080c, 0xa248, 0x009e,
+	0x00de, 0x0005, 0x00d6, 0x0096, 0x080c, 0x9c61, 0x7003, 0x0500,
+	0x7814, 0x2048, 0xa8cc, 0x700a, 0xa8d0, 0x700e, 0xa8d4, 0x7012,
+	0xa8d8, 0x7016, 0xa8dc, 0x701a, 0xa8e0, 0x701e, 0x60c3, 0x0010,
+	0x080c, 0xa248, 0x009e, 0x00de, 0x0005, 0x00d6, 0x0096, 0x0126,
+	0x2091, 0x8000, 0x080c, 0x9c61, 0x20e9, 0x0000, 0x2001, 0x19a2,
+	0x2003, 0x0000, 0x7814, 0x2048, 0xa814, 0x8003, 0x60c2, 0xa830,
+	0x20a8, 0xa860, 0x20e0, 0xa85c, 0x9080, 0x001b, 0x2098, 0x2001,
+	0x19a2, 0x0016, 0x200c, 0x2001, 0x0001, 0x080c, 0x23b9, 0x080c,
+	0xd886, 0x9006, 0x080c, 0x23b9, 0x001e, 0xa804, 0x9005, 0x0110,
+	0x2048, 0x0c28, 0x04d9, 0x080c, 0xa248, 0x012e, 0x009e, 0x00de,
+	0x0005, 0x00d6, 0x0096, 0x0126, 0x2091, 0x8000, 0x080c, 0x9cac,
+	0x20e9, 0x0000, 0x2001, 0x19a2, 0x2003, 0x0000, 0x7814, 0x2048,
+	0xa86f, 0x0200, 0xa873, 0x0000, 0xa814, 0x8003, 0x60c2, 0xa830,
+	0x20a8, 0xa860, 0x20e0, 0xa85c, 0x9080, 0x001b, 0x2098, 0x2001,
+	0x19a2, 0x0016, 0x200c, 0x080c, 0xd886, 0x001e, 0xa804, 0x9005,
+	0x0110, 0x2048, 0x0c60, 0x0051, 0x7814, 0x2048, 0x080c, 0x0fb1,
+	0x080c, 0xa248, 0x012e, 0x009e, 0x00de, 0x0005, 0x60c0, 0x8004,
+	0x9084, 0x0003, 0x9005, 0x0130, 0x9082, 0x0004, 0x20a3, 0x0000,
+	0x8000, 0x1de0, 0x0005, 0x080c, 0x9c61, 0x7003, 0x7800, 0x7808,
+	0x8007, 0x700a, 0x60c3, 0x0008, 0x0804, 0xa248, 0x00d6, 0x00e6,
+	0x080c, 0x9cac, 0x7814, 0x9084, 0xff00, 0x2073, 0x0200, 0x8e70,
+	0x8e70, 0x9095, 0x0010, 0x2272, 0x8e70, 0x2073, 0x0034, 0x8e70,
+	0x2069, 0x1805, 0x20a9, 0x0004, 0x2d76, 0x8d68, 0x8e70, 0x1f04,
+	0x99fc, 0x2069, 0x1801, 0x20a9, 0x0004, 0x2d76, 0x8d68, 0x8e70,
+	0x1f04, 0x9a05, 0x2069, 0x19b2, 0x9086, 0xdf00, 0x0110, 0x2069,
+	0x19cc, 0x20a9, 0x001a, 0x9e86, 0x0260, 0x1148, 0x00c6, 0x2061,
+	0x0200, 0x6010, 0x8000, 0x6012, 0x00ce, 0x2071, 0x0240, 0x2d04,
+	0x8007, 0x2072, 0x8d68, 0x8e70, 0x1f04, 0x9a13, 0x60c3, 0x004c,
+	0x080c, 0xa248, 0x00ee, 0x00de, 0x0005, 0x080c, 0x9c61, 0x7003,
+	0x6300, 0x7007, 0x0028, 0x7808, 0x700e, 0x60c3, 0x0008, 0x0804,
+	0xa248, 0x00d6, 0x0026, 0x0016, 0x080c, 0x9cac, 0x7003, 0x0200,
+	0x7814, 0x700e, 0x00e6, 0x9ef0, 0x0004, 0x2009, 0x0001, 0x2011,
+	0x000c, 0x2069, 0x1923, 0x6810, 0xd084, 0x1148, 0x2073, 0x0500,
+	0x8e70, 0x2073, 0x0000, 0x8e70, 0x8108, 0x9290, 0x0004, 0x2073,
+	0x0800, 0x8e70, 0x2073, 0x0000, 0x00ee, 0x7206, 0x710a, 0x62c2,
+	0x080c, 0xa248, 0x001e, 0x002e, 0x00de, 0x0005, 0x2001, 0x1818,
+	0x2004, 0x609a, 0x0804, 0xa248, 0x080c, 0x9c61, 0x7003, 0x5200,
+	0x2069, 0x1847, 0x6804, 0xd084, 0x0130, 0x6828, 0x0016, 0x080c,
+	0x2873, 0x710e, 0x001e, 0x20a9, 0x0004, 0x20e1, 0x0001, 0x2099,
+	0x1805, 0x20e9, 0x0000, 0x20a1, 0x0250, 0x4003, 0x20a9, 0x0004,
+	0x2099, 0x1801, 0x20a1, 0x0254, 0x4003, 0x080c, 0xaddb, 0x1120,
+	0xb8a0, 0x9082, 0x007f, 0x0248, 0x2001, 0x181f, 0x2004, 0x7032,
+	0x2001, 0x1820, 0x2004, 0x7036, 0x0030, 0x2001, 0x1818, 0x2004,
+	0x9084, 0x00ff, 0x7036, 0x60c3, 0x001c, 0x0804, 0xa248, 0x080c,
+	0x9c61, 0x7003, 0x0500, 0x080c, 0xaddb, 0x1120, 0xb8a0, 0x9082,
+	0x007f, 0x0248, 0x2001, 0x181f, 0x2004, 0x700a, 0x2001, 0x1820,
+	0x2004, 0x700e, 0x0030, 0x2001, 0x1818, 0x2004, 0x9084, 0x00ff,
+	0x700e, 0x20a9, 0x0004, 0x20e1, 0x0001, 0x2099, 0x1805, 0x20e9,
+	0x0000, 0x20a1, 0x0250, 0x4003, 0x60c3, 0x0010, 0x0804, 0xa248,
+	0x080c, 0x9c61, 0x9006, 0x080c, 0x6945, 0xb8a0, 0x9086, 0x007e,
+	0x1130, 0x7003, 0x0400, 0x620c, 0xc2b4, 0x620e, 0x0058, 0x7814,
+	0x0096, 0x904d, 0x0120, 0x9006, 0xa89a, 0xa8a6, 0xa8aa, 0x009e,
+	0x7003, 0x0300, 0xb8a0, 0x9086, 0x007e, 0x1904, 0x9b3f, 0x00d6,
+	0x2069, 0x196b, 0x2001, 0x1837, 0x2004, 0xd0a4, 0x0188, 0x6800,
+	0x700a, 0x6808, 0x9084, 0x2000, 0x7012, 0x080c, 0xadf2, 0x680c,
+	0x7016, 0x701f, 0x2710, 0x6818, 0x7022, 0x681c, 0x7026, 0x0090,
+	0x6800, 0x700a, 0x6804, 0x700e, 0x6808, 0x080c, 0x73a5, 0x1118,
+	0x9084, 0x37ff, 0x0010, 0x9084, 0x3fff, 0x7012, 0x080c, 0xadf2,
+	0x680c, 0x7016, 0x00de, 0x20a9, 0x0004, 0x20e1, 0x0001, 0x2099,
+	0x1805, 0x20e9, 0x0000, 0x20a1, 0x0256, 0x4003, 0x20a9, 0x0004,
+	0x2099, 0x1801, 0x20a1, 0x025a, 0x4003, 0x00d6, 0x080c, 0xab17,
+	0x2069, 0x1973, 0x2071, 0x024e, 0x6800, 0xc0dd, 0x7002, 0x080c,
+	0x56dc, 0xd0e4, 0x0110, 0x680c, 0x700e, 0x00de, 0x04a8, 0x2001,
+	0x1837, 0x2004, 0xd0a4, 0x0170, 0x0016, 0x2001, 0x196c, 0x200c,
+	0x60e0, 0x9106, 0x0130, 0x2100, 0x60e3, 0x0000, 0x080c, 0x28b4,
+	0x61e2, 0x001e, 0x20e1, 0x0001, 0x2099, 0x196b, 0x20e9, 0x0000,
+	0x20a1, 0x024e, 0x20a9, 0x0008, 0x4003, 0x20a9, 0x0004, 0x2099,
+	0x1805, 0x20a1, 0x0256, 0x4003, 0x20a9, 0x0004, 0x2099, 0x1801,
+	0x20a1, 0x025a, 0x4003, 0x080c, 0xab17, 0x20a1, 0x024e, 0x20a9,
+	0x0008, 0x2099, 0x1973, 0x4003, 0x60c3, 0x0074, 0x0804, 0xa248,
+	0x080c, 0x9c61, 0x7003, 0x2010, 0x7007, 0x0014, 0x700b, 0x0800,
+	0x700f, 0x2000, 0x9006, 0x00f6, 0x2079, 0x1847, 0x7904, 0x00fe,
+	0xd1ac, 0x1110, 0x9085, 0x0020, 0xd1a4, 0x0110, 0x9085, 0x0010,
+	0x9085, 0x0002, 0x00d6, 0x0804, 0x9c11, 0x7026, 0x60c3, 0x0014,
+	0x0804, 0xa248, 0x080c, 0x9c61, 0x7003, 0x5000, 0x0804, 0x9aea,
+	0x080c, 0x9c61, 0x7003, 0x2110, 0x7007, 0x0014, 0x60c3, 0x0014,
+	0x0804, 0xa248, 0x080c, 0x9ca3, 0x0010, 0x080c, 0x9cac, 0x7003,
+	0x0200, 0x60c3, 0x0004, 0x0804, 0xa248, 0x080c, 0x9cac, 0x7003,
+	0x0100, 0x700b, 0x0003, 0x700f, 0x2a00, 0x60c3, 0x0008, 0x0804,
+	0xa248, 0x080c, 0x9cac, 0x7003, 0x0200, 0x0804, 0x9aea, 0x080c,
+	0x9cac, 0x7003, 0x0100, 0x782c, 0x9005, 0x0110, 0x700a, 0x0010,
+	0x700b, 0x0003, 0x7814, 0x700e, 0x60c3, 0x0008, 0x0804, 0xa248,
+	0x00d6, 0x080c, 0x9cac, 0x7003, 0x0210, 0x7007, 0x0014, 0x700b,
+	0x0800, 0xb894, 0x9086, 0x0014, 0x1198, 0xb99c, 0x9184, 0x0030,
+	0x0190, 0xb998, 0x9184, 0xc000, 0x1140, 0xd1ec, 0x0118, 0x700f,
+	0x2100, 0x0058, 0x700f, 0x0100, 0x0040, 0x700f, 0x0400, 0x0028,
+	0x700f, 0x0700, 0x0010, 0x700f, 0x0800, 0x00f6, 0x2079, 0x1847,
+	0x7904, 0x00fe, 0xd1ac, 0x1110, 0x9085, 0x0020, 0xd1a4, 0x0110,
+	0x9085, 0x0010, 0x2009, 0x1869, 0x210c, 0xd184, 0x1110, 0x9085,
+	0x0002, 0x0026, 0x2009, 0x1867, 0x210c, 0xd1e4, 0x0150, 0xc0c5,
+	0xbacc, 0xd28c, 0x1108, 0xc0cd, 0x9094, 0x0030, 0x9296, 0x0010,
+	0x0140, 0xd1ec, 0x0130, 0x9094, 0x0030, 0x9296, 0x0010, 0x0108,
+	0xc0bd, 0x002e, 0x7026, 0x60c3, 0x0014, 0x00de, 0x0804, 0xa248,
+	0x080c, 0x9cac, 0x7003, 0x0210, 0x7007, 0x0014, 0x700f, 0x0100,
+	0x60c3, 0x0014, 0x0804, 0xa248, 0x080c, 0x9cac, 0x7003, 0x0200,
+	0x0804, 0x9a70, 0x080c, 0x9cac, 0x7003, 0x0100, 0x700b, 0x0003,
+	0x700f, 0x2a00, 0x60c3, 0x0008, 0x0804, 0xa248, 0x080c, 0x9cac,
+	0x7003, 0x0100, 0x700b, 0x000b, 0x60c3, 0x0008, 0x0804, 0xa248,
+	0x0026, 0x00d6, 0x0036, 0x0046, 0x2019, 0x3200, 0x2021, 0x0800,
+	0x0040, 0x0026, 0x00d6, 0x0036, 0x0046, 0x2019, 0x2200, 0x2021,
+	0x0100, 0x080c, 0xab2c, 0xb810, 0x9305, 0x7002, 0xb814, 0x7006,
+	0x2069, 0x1800, 0x687c, 0x700a, 0x6880, 0x700e, 0x9485, 0x0029,
+	0x7012, 0x004e, 0x003e, 0x00de, 0x080c, 0xa236, 0x721a, 0x9f95,
+	0x0000, 0x7222, 0x7027, 0xffff, 0x2071, 0x024c, 0x002e, 0x0005,
+	0x0026, 0x080c, 0xab2c, 0x7003, 0x02ff, 0x7007, 0xfffc, 0x00d6,
+	0x2069, 0x1800, 0x687c, 0x700a, 0x6880, 0x700e, 0x00de, 0x7013,
+	0x2029, 0x0c10, 0x7003, 0x0100, 0x7007, 0x0000, 0x700b, 0xfc02,
+	0x700f, 0x0000, 0x0005, 0x0026, 0x00d6, 0x0036, 0x0046, 0x2019,
+	0x3300, 0x2021, 0x0800, 0x0040, 0x0026, 0x00d6, 0x0036, 0x0046,
+	0x2019, 0x2300, 0x2021, 0x0100, 0x080c, 0xab2c, 0xb810, 0x9305,
+	0x7002, 0xb814, 0x7006, 0x2069, 0x1800, 0xb810, 0x9005, 0x1140,
+	0xb814, 0x9005, 0x1128, 0x700b, 0x00ff, 0x700f, 0xfffe, 0x0020,
+	0x687c, 0x700a, 0x6880, 0x700e, 0x0000, 0x9485, 0x0098, 0x7012,
+	0x004e, 0x003e, 0x00de, 0x080c, 0xa236, 0x721a, 0x7a08, 0x7222,
+	0x2f10, 0x7226, 0x2071, 0x024c, 0x002e, 0x0005, 0x080c, 0xa236,
+	0x721a, 0x7a08, 0x7222, 0x7814, 0x7026, 0x2071, 0x024c, 0x002e,
+	0x0005, 0x00b6, 0x00c6, 0x00d6, 0x00e6, 0x00f6, 0x2069, 0x0200,
+	0x2071, 0x0240, 0x6004, 0x908a, 0x0085, 0x0a0c, 0x0dd5, 0x908a,
+	0x0092, 0x1a0c, 0x0dd5, 0x6110, 0x2158, 0xb9c0, 0x2c78, 0x2061,
+	0x0100, 0x619a, 0x9082, 0x0085, 0x0033, 0x00fe, 0x00ee, 0x00de,
+	0x00ce, 0x00be, 0x0005, 0x9d1a, 0x9d29, 0x9d34, 0x9d18, 0x9d18,
+	0x9d18, 0x9d1a, 0x9d18, 0x9d18, 0x9d18, 0x9d18, 0x9d18, 0x9d18,
+	0x080c, 0x0dd5, 0x0411, 0x60c3, 0x0000, 0x0026, 0x080c, 0x2ba7,
+	0x0228, 0x2011, 0x0101, 0x2204, 0xc0c5, 0x2012, 0x002e, 0x0804,
+	0xa248, 0x0431, 0x7808, 0x700a, 0x7814, 0x700e, 0x7017, 0xffff,
+	0x60c3, 0x000c, 0x0804, 0xa248, 0x0479, 0x7003, 0x0003, 0x7007,
+	0x0300, 0x60c3, 0x0004, 0x0804, 0xa248, 0x0026, 0x080c, 0xab2c,
+	0xb810, 0x9085, 0x8100, 0x7002, 0xb814, 0x7006, 0x2069, 0x1800,
+	0x687c, 0x700a, 0x6880, 0x700e, 0x7013, 0x0009, 0x0804, 0x9c7c,
+	0x0026, 0x080c, 0xab2c, 0xb810, 0x9085, 0x8400, 0x7002, 0xb814,
+	0x7006, 0x2069, 0x1800, 0x687c, 0x700a, 0x6880, 0x700e, 0x2001,
+	0x0099, 0x7012, 0x0804, 0x9cde, 0x0026, 0x080c, 0xab2c, 0xb810,
+	0x9085, 0x8500, 0x7002, 0xb814, 0x7006, 0x2069, 0x1800, 0x687c,
+	0x700a, 0x6880, 0x700e, 0x2001, 0x0099, 0x7012, 0x0804, 0x9cde,
+	0x00b6, 0x00c6, 0x00d6, 0x00e6, 0x00f6, 0x2c78, 0x2069, 0x0200,
+	0x2071, 0x0240, 0x7804, 0x908a, 0x0040, 0x0a0c, 0x0dd5, 0x908a,
+	0x0054, 0x1a0c, 0x0dd5, 0x7910, 0x2158, 0xb9c0, 0x2061, 0x0100,
+	0x619a, 0x9082, 0x0040, 0x0033, 0x00fe, 0x00ee, 0x00de, 0x00ce,
+	0x00be, 0x0005, 0x9daf, 0x9e6b, 0x9e3e, 0x9f8d, 0x9dad, 0x9dad,
+	0x9dad, 0x9dad, 0x9dad, 0x9dad, 0x9dad, 0xa670, 0xa678, 0xa680,
+	0xa688, 0x9dad, 0xaa74, 0x9dad, 0xa668, 0x080c, 0x0dd5, 0x0096,
+	0x780b, 0xffff, 0x080c, 0x9e1a, 0x7914, 0x2148, 0xa978, 0x7956,
+	0xae64, 0x96b4, 0x00ff, 0x9686, 0x0008, 0x1148, 0xa8b4, 0x7032,
+	0xa8b8, 0x7036, 0xa8bc, 0x703a, 0xa8c0, 0x703e, 0x0008, 0x7132,
+	0xa97c, 0x9184, 0x000f, 0x1118, 0x2001, 0x0005, 0x0040, 0xd184,
+	0x0118, 0x2001, 0x0004, 0x0018, 0x9084, 0x0006, 0x8004, 0x2010,
+	0x785c, 0x9084, 0x00ff, 0x8007, 0x9205, 0x7042, 0xd1ac, 0x0158,
+	0x7047, 0x0002, 0x9686, 0x0008, 0x1118, 0x080c, 0x18ae, 0x0010,
+	0x080c, 0x1727, 0x0050, 0xd1b4, 0x0118, 0x7047, 0x0001, 0x0028,
+	0x7047, 0x0000, 0x9016, 0x2230, 0x0010, 0xaab0, 0xaeac, 0x726a,
+	0x766e, 0x20a9, 0x0008, 0x20e9, 0x0000, 0xa860, 0x20e0, 0xa85c,
+	0x9080, 0x0023, 0x2098, 0x20a1, 0x0252, 0x2069, 0x0200, 0x6813,
+	0x0018, 0x4003, 0x6813, 0x0008, 0x60c3, 0x0020, 0x6017, 0x0009,
+	0x2001, 0x1a02, 0x2003, 0x07d0, 0x2001, 0x1a01, 0x2003, 0x0009,
+	0x009e, 0x0005, 0x6813, 0x0008, 0xba8c, 0x8210, 0xb8cc, 0xd084,
+	0x0128, 0x7a46, 0x7b14, 0x7b4a, 0x722e, 0x732a, 0x9294, 0x00ff,
+	0xba8e, 0x8217, 0x721a, 0xba10, 0x9295, 0x0600, 0x7202, 0xba14,
+	0x7206, 0x2069, 0x1800, 0x6a7c, 0x720a, 0x6a80, 0x720e, 0x7013,
+	0x0829, 0x2f10, 0x7222, 0x7027, 0xffff, 0x0005, 0x00d6, 0x0096,
+	0x0081, 0x7814, 0x2048, 0xa890, 0x7002, 0xa88c, 0x7006, 0xa8b0,
+	0x700a, 0xa8ac, 0x700e, 0x60c3, 0x000c, 0x009e, 0x00de, 0x0804,
+	0xa248, 0x6813, 0x0008, 0xb810, 0x9085, 0x0500, 0x7002, 0xb814,
+	0x7006, 0x2069, 0x1800, 0x687c, 0x700a, 0x6880, 0x700e, 0x7013,
+	0x0889, 0x080c, 0xa236, 0x721a, 0x7a08, 0x7222, 0x2f10, 0x7226,
+	0x2071, 0x024c, 0x0005, 0x00d6, 0x0096, 0x080c, 0x9f6b, 0x7814,
+	0x2048, 0x080c, 0xcb48, 0x1130, 0x7814, 0x9084, 0x0700, 0x8007,
+	0x0033, 0x0010, 0x9006, 0x001b, 0x009e, 0x00de, 0x0005, 0x9e89,
+	0x9ef2, 0x9f02, 0x9f28, 0x9f34, 0x9f45, 0x9f4d, 0x9e87, 0x080c,
+	0x0dd5, 0x0016, 0x0036, 0xa97c, 0x918c, 0x0003, 0x0118, 0x9186,
+	0x0003, 0x1198, 0xaba8, 0x7824, 0xd0cc, 0x1168, 0x7316, 0xa898,
+	0x701a, 0xa894, 0x701e, 0x003e, 0x001e, 0x2001, 0x19b0, 0x2004,
+	0x60c2, 0x0804, 0xa248, 0xc3e5, 0x0c88, 0x9186, 0x0001, 0x190c,
+	0x0dd5, 0xaba8, 0x7824, 0xd0cc, 0x1904, 0x9eef, 0x7316, 0xa898,
+	0x701a, 0xa894, 0x701e, 0xa8a4, 0x7026, 0xa8ac, 0x702e, 0x2009,
+	0x0018, 0x9384, 0x0300, 0x0570, 0xd3c4, 0x0110, 0xa8ac, 0x9108,
+	0xd3cc, 0x0110, 0xa8a4, 0x9108, 0x6810, 0x9085, 0x0010, 0x6812,
+	0x2011, 0x0258, 0x20e9, 0x0000, 0x22a0, 0x0156, 0x20a9, 0x0008,
+	0xa860, 0x20e0, 0xa85c, 0x9080, 0x002c, 0x2098, 0x4003, 0x6810,
+	0x8000, 0x6812, 0x2011, 0x0240, 0x22a0, 0x20a9, 0x0005, 0x4003,
+	0x6810, 0xc084, 0x6812, 0x015e, 0x9184, 0x0003, 0x0118, 0x2019,
+	0x0245, 0x201a, 0x61c2, 0x003e, 0x001e, 0x0804, 0xa248, 0xc3e5,
+	0x0804, 0x9eae, 0x2011, 0x0008, 0x2001, 0x180f, 0x2004, 0xd0a4,
+	0x0110, 0x2011, 0x0028, 0x7824, 0xd0cc, 0x1110, 0x7216, 0x0470,
+	0x0ce8, 0xc2e5, 0x2011, 0x0302, 0x0016, 0x782c, 0x701a, 0x7930,
+	0x711e, 0x9105, 0x0108, 0xc2dd, 0x001e, 0x7824, 0xd0cc, 0x0108,
+	0xc2e5, 0x7216, 0x7027, 0x0012, 0x702f, 0x0008, 0x7043, 0x7000,
+	0x7047, 0x0500, 0x704f, 0x000a, 0x2069, 0x0200, 0x6813, 0x0009,
+	0x2071, 0x0240, 0x700b, 0x2500, 0x60c3, 0x0032, 0x0804, 0xa248,
+	0x2011, 0x0028, 0x7824, 0xd0cc, 0x1128, 0x7216, 0x60c3, 0x0018,
+	0x0804, 0xa248, 0x0cd0, 0xc2e5, 0x2011, 0x0100, 0x7824, 0xd0cc,
+	0x0108, 0xc2e5, 0x7216, 0x702f, 0x0008, 0x7858, 0x9084, 0x00ff,
+	0x7036, 0x60c3, 0x0020, 0x0804, 0xa248, 0x2011, 0x0008, 0x7824,
+	0xd0cc, 0x0108, 0xc2e5, 0x7216, 0x0c08, 0x0036, 0x7b14, 0x9384,
+	0xff00, 0x7816, 0x9384, 0x00ff, 0x8001, 0x1138, 0x7824, 0xd0cc,
+	0x0108, 0xc2e5, 0x7216, 0x003e, 0x0888, 0x0046, 0x2021, 0x0800,
+	0x0006, 0x7824, 0xd0cc, 0x000e, 0x0108, 0xc4e5, 0x7416, 0x004e,
+	0x701e, 0x003e, 0x0818, 0x00d6, 0x6813, 0x0008, 0xb810, 0x9085,
+	0x0700, 0x7002, 0xb814, 0x7006, 0x2069, 0x1800, 0x687c, 0x700a,
+	0x6880, 0x700e, 0x7824, 0xd0cc, 0x1168, 0x7013, 0x0898, 0x080c,
+	0xa236, 0x721a, 0x7a08, 0x7222, 0x2f10, 0x7226, 0x2071, 0x024c,
+	0x00de, 0x0005, 0x7013, 0x0889, 0x0c90, 0x0016, 0x7814, 0x9084,
+	0x0700, 0x8007, 0x0013, 0x001e, 0x0005, 0x9f9d, 0x9f9d, 0x9f9f,
+	0x9f9d, 0x9f9d, 0x9f9d, 0x9fb9, 0x9f9d, 0x080c, 0x0dd5, 0x7914,
+	0x918c, 0x08ff, 0x918d, 0xf600, 0x7916, 0x2009, 0x0003, 0x00b9,
+	0x2069, 0x1847, 0x6804, 0xd0bc, 0x0130, 0x682c, 0x9084, 0x00ff,
+	0x8007, 0x7032, 0x0010, 0x7033, 0x3f00, 0x60c3, 0x0001, 0x0804,
+	0xa248, 0x2009, 0x0003, 0x0019, 0x7033, 0x7f00, 0x0cb0, 0x0016,
+	0x080c, 0xab2c, 0x001e, 0xb810, 0x9085, 0x0100, 0x7002, 0xb814,
+	0x7006, 0x2069, 0x1800, 0x6a7c, 0x720a, 0x6a80, 0x720e, 0x7013,
+	0x0888, 0x918d, 0x0008, 0x7116, 0x080c, 0xa236, 0x721a, 0x7a08,
+	0x7222, 0x2f10, 0x7226, 0x0005, 0x00b6, 0x00e6, 0x00d6, 0x00c6,
+	0x0066, 0x0056, 0x0046, 0x0036, 0x2061, 0x0100, 0x2071, 0x1800,
+	0x7160, 0x7810, 0x2058, 0x76dc, 0x96b4, 0x0028, 0x0110, 0x737c,
+	0x7480, 0x2500, 0x76dc, 0x96b4, 0x0028, 0x0140, 0x2001, 0x04ff,
+	0x6062, 0x6067, 0xffff, 0x636a, 0x646e, 0x0050, 0x2001, 0x00ff,
+	0x9085, 0x0400, 0x6062, 0x6067, 0xffff, 0x606b, 0x0000, 0x616e,
+	0xb8b8, 0x6073, 0x0530, 0x6077, 0x0008, 0xb88c, 0x8000, 0x9084,
 	0x00ff, 0xb88e, 0x8007, 0x9085, 0x0020, 0x607a, 0x607f, 0x0000,
 	0x2b00, 0x6082, 0x6087, 0xffff, 0x7814, 0x0096, 0x2048, 0xa838,
 	0x608a, 0xa834, 0x608e, 0xa848, 0x60c6, 0xa844, 0x60ca, 0x009e,
 	0xb86c, 0x60ce, 0x60ab, 0x0036, 0x60af, 0x95d5, 0x60d7, 0x0000,
-	0xbac0, 0x629e, 0x00f6, 0x2079, 0x0140, 0x7803, 0x0000, 0x00fe,
-	0x2009, 0x0092, 0x6116, 0x2009, 0x07d0, 0x080c, 0x857e, 0x003e,
-	0x004e, 0x005e, 0x006e, 0x00ce, 0x00de, 0x00ee, 0x00be, 0x0005,
-	0x00b6, 0x0096, 0x00e6, 0x00d6, 0x00c6, 0x0056, 0x0046, 0x0036,
-	0x2061, 0x0100, 0x2071, 0x1800, 0x7810, 0x2058, 0xb8a0, 0x2028,
-	0xb910, 0xba14, 0x737c, 0x7480, 0x7820, 0x90be, 0x0006, 0x0904,
-	0xa1a4, 0x90be, 0x000a, 0x1904, 0xa160, 0xb8c0, 0x609e, 0x7814,
-	0x2048, 0xa87c, 0xd0fc, 0x0558, 0xaf90, 0x9784, 0xff00, 0x9105,
-	0x6062, 0x873f, 0x9784, 0xff00, 0x0006, 0x7814, 0x2048, 0xa878,
-	0xc0fc, 0x9005, 0x000e, 0x1160, 0xaf94, 0x87ff, 0x0198, 0x2039,
-	0x0098, 0x9705, 0x6072, 0x7808, 0x6082, 0x2f00, 0x6086, 0x0038,
-	0x9185, 0x2200, 0x6062, 0x6073, 0x0129, 0x6077, 0x0000, 0xb8c0,
-	0x609e, 0x0050, 0x2039, 0x0029, 0x9705, 0x6072, 0x0cc0, 0x9185,
-	0x0200, 0x6062, 0x6073, 0x2029, 0xa87c, 0xd0fc, 0x0118, 0xaf94,
-	0x87ff, 0x1120, 0x2f00, 0x6082, 0x7808, 0x6086, 0x6266, 0x636a,
-	0x646e, 0x6077, 0x0000, 0xb88c, 0x8000, 0x9084, 0x00ff, 0xb88e,
-	0x8007, 0x607a, 0x607f, 0x0000, 0xa838, 0x608a, 0xa834, 0x608e,
-	0xa848, 0x60c6, 0xa844, 0x60ca, 0xb86c, 0x60ce, 0x60af, 0x95d5,
-	0x60d7, 0x0000, 0x080c, 0xab06, 0x2009, 0x07d0, 0x60c4, 0x9084,
-	0xfff0, 0x9005, 0x0110, 0x2009, 0x1b58, 0x080c, 0x857e, 0x003e,
-	0x004e, 0x005e, 0x00ce, 0x00de, 0x00ee, 0x009e, 0x00be, 0x0005,
-	0x7804, 0x9086, 0x0040, 0x0904, 0xa1e0, 0x9185, 0x0100, 0x6062,
-	0x6266, 0x636a, 0x646e, 0x6073, 0x0809, 0x6077, 0x0008, 0x60af,
-	0x95d5, 0x60d7, 0x0000, 0xb88c, 0x8000, 0x9084, 0x00ff, 0xb88e,
-	0x8007, 0x607a, 0x607f, 0x0000, 0x2f00, 0x6082, 0x7808, 0x6086,
-	0x7814, 0x2048, 0xa838, 0x608a, 0xa834, 0x608e, 0xa848, 0x60c6,
-	0xa844, 0x60ca, 0xb86c, 0x60ce, 0xbac0, 0x629e, 0x080c, 0xab06,
-	0x2009, 0x07d0, 0x60c4, 0x9084, 0xfff0, 0x9005, 0x0110, 0x2009,
-	0x1b58, 0x080c, 0x857e, 0x003e, 0x004e, 0x005e, 0x00ce, 0x00de,
-	0x00ee, 0x009e, 0x00be, 0x0005, 0x7814, 0x2048, 0xa87c, 0x9084,
-	0x0003, 0x9086, 0x0002, 0x0904, 0xa1fc, 0x9185, 0x0100, 0x6062,
-	0x6266, 0x636a, 0x646e, 0x6073, 0x0880, 0x6077, 0x0008, 0xb88c,
-	0x8000, 0x9084, 0x00ff, 0xb88e, 0x8007, 0x607a, 0x7838, 0x607e,
-	0x2f00, 0x6086, 0x7808, 0x6082, 0xa890, 0x608a, 0xa88c, 0x608e,
-	0xa8b0, 0x60c6, 0xa8ac, 0x60ca, 0xa8ac, 0x7930, 0x9108, 0x7932,
-	0xa8b0, 0x792c, 0x9109, 0x792e, 0xb86c, 0x60ce, 0x60af, 0x95d5,
-	0x60d7, 0x0000, 0xbac0, 0x629e, 0x080c, 0xaae3, 0x0804, 0xa190,
-	0xb8cc, 0xd084, 0x0148, 0xb88c, 0x7814, 0x2048, 0xb88c, 0x7846,
-	0xa836, 0x2900, 0xa83a, 0xb04a, 0x9185, 0x0600, 0x6062, 0x6266,
-	0x636a, 0x646e, 0x6073, 0x0829, 0x6077, 0x0000, 0x60af, 0x9575,
-	0x60d7, 0x0000, 0x0804, 0xa173, 0x9185, 0x0700, 0x6062, 0x6266,
-	0x636a, 0x646e, 0x7824, 0xd0cc, 0x7826, 0x0118, 0x6073, 0x0889,
-	0x0010, 0x6073, 0x0898, 0x6077, 0x0000, 0xb88c, 0x8000, 0x9084,
-	0x00ff, 0xb88e, 0x8007, 0x607a, 0x607f, 0x0000, 0x2f00, 0x6086,
-	0x7808, 0x6082, 0xa838, 0x608a, 0xa834, 0x608e, 0xa848, 0x60c6,
-	0xa844, 0x60ca, 0xb86c, 0x60ce, 0x60af, 0x95d5, 0x60d7, 0x0000,
-	0xbac0, 0x629e, 0x7824, 0xd0cc, 0x0120, 0x080c, 0xab06, 0x0804,
-	0xa190, 0x080c, 0xaae3, 0x0804, 0xa190, 0x7a10, 0x00b6, 0x2258,
-	0xba8c, 0x8210, 0x9294, 0x00ff, 0xba8e, 0x00be, 0x8217, 0x0005,
-	0x00d6, 0x2069, 0x19e7, 0x6843, 0x0001, 0x00de, 0x0005, 0x60a3,
-	0x0056, 0x60a7, 0x9575, 0x00f1, 0x080c, 0x8570, 0x0005, 0x0016,
-	0x2001, 0x180c, 0x200c, 0x9184, 0x0600, 0x9086, 0x0600, 0x0128,
-	0x0089, 0x080c, 0x8570, 0x001e, 0x0005, 0xc1e5, 0x2001, 0x180c,
-	0x2102, 0x2001, 0x19e8, 0x2003, 0x0000, 0x2001, 0x19f0, 0x2003,
-	0x0000, 0x0c88, 0x0006, 0x6014, 0x9084, 0x1804, 0x9085, 0x0009,
-	0x6016, 0x000e, 0x0005, 0x0016, 0x00c6, 0x0006, 0x2061, 0x0100,
-	0x61a4, 0x60a7, 0x95f5, 0x6014, 0x9084, 0x1804, 0x9085, 0x0008,
-	0x6016, 0x000e, 0xa001, 0xa001, 0xa001, 0x61a6, 0x00ce, 0x001e,
-	0x0005, 0x00c6, 0x00d6, 0x0016, 0x0026, 0x2061, 0x0100, 0x2069,
-	0x0140, 0x080c, 0x73bc, 0x11e8, 0x2001, 0x1a03, 0x2004, 0x9005,
-	0x1904, 0xa2d9, 0x0066, 0x2031, 0x0001, 0x080c, 0x746c, 0x006e,
-	0x1160, 0x2061, 0x0100, 0x6020, 0xd0b4, 0x1120, 0x6024, 0xd084,
-	0x090c, 0x0dd5, 0x080c, 0x8570, 0x0460, 0x00c6, 0x2061, 0x19e7,
-	0x00d0, 0x6904, 0x9194, 0x4000, 0x0548, 0x080c, 0xa273, 0x080c,
-	0x2cff, 0x00c6, 0x2061, 0x19e7, 0x6128, 0x9192, 0x0008, 0x1258,
-	0x8108, 0x612a, 0x6124, 0x00ce, 0x81ff, 0x0198, 0x080c, 0x8570,
-	0x080c, 0xa26a, 0x0070, 0x6124, 0x91e5, 0x0000, 0x0140, 0x080c,
-	0xe9fe, 0x080c, 0x8579, 0x2009, 0x0014, 0x080c, 0xaedc, 0x00ce,
-	0x0000, 0x002e, 0x001e, 0x00de, 0x00ce, 0x0005, 0x2001, 0x1a03,
-	0x2004, 0x9005, 0x1db0, 0x00c6, 0x2061, 0x19e7, 0x6128, 0x9192,
-	0x0003, 0x1e08, 0x8108, 0x612a, 0x00ce, 0x080c, 0x8570, 0x080c,
-	0x5ed9, 0x2009, 0x1846, 0x2114, 0x8210, 0x220a, 0x0c10, 0x0096,
-	0x00c6, 0x00d6, 0x00e6, 0x0016, 0x0026, 0x080c, 0x8586, 0x2071,
-	0x19e7, 0x713c, 0x81ff, 0x0904, 0xa37d, 0x2061, 0x0100, 0x2069,
-	0x0140, 0x080c, 0x73bc, 0x1500, 0x0036, 0x2019, 0x0002, 0x080c,
-	0xa5b6, 0x003e, 0x713c, 0x2160, 0x080c, 0xe9fe, 0x2009, 0x004a,
-	0x6220, 0x9296, 0x0009, 0x1130, 0x6114, 0x2148, 0xa87b, 0x0006,
-	0x2009, 0x004a, 0x080c, 0xaedc, 0x0066, 0x2031, 0x0001, 0x080c,
-	0x746c, 0x006e, 0x0804, 0xa37d, 0x080c, 0xa389, 0x0904, 0xa37d,
-	0x6904, 0xd1f4, 0x0904, 0xa384, 0x080c, 0x2cff, 0x00c6, 0x703c,
-	0x9065, 0x090c, 0x0dd5, 0x6020, 0x00ce, 0x9086, 0x0006, 0x1528,
-	0x61c8, 0x60c4, 0x9105, 0x1508, 0x2009, 0x180c, 0x2104, 0xd0d4,
-	0x01e0, 0x6214, 0x9294, 0x1800, 0x1128, 0x6224, 0x9294, 0x0002,
-	0x1560, 0x0030, 0xc0d4, 0x200a, 0xd0cc, 0x0110, 0x080c, 0x2c52,
-	0x6014, 0x9084, 0xe7fd, 0x9085, 0x0010, 0x6016, 0x703c, 0x2060,
-	0x2009, 0x0049, 0x080c, 0xaedc, 0x00c0, 0x0036, 0x2019, 0x0001,
-	0x080c, 0xa5b6, 0x003e, 0x713c, 0x2160, 0x080c, 0xe9fe, 0x2009,
+	0x2001, 0x1837, 0x2004, 0x9084, 0x0028, 0x0128, 0x609f, 0x0000,
+	0x2001, 0x0092, 0x0048, 0x6028, 0xc0bd, 0x602a, 0x609f, 0x00ff,
+	0x6027, 0xffff, 0x2001, 0x00b2, 0x6016, 0x2009, 0x07d0, 0x080c,
+	0x8567, 0x003e, 0x004e, 0x005e, 0x006e, 0x00ce, 0x00de, 0x00ee,
+	0x00be, 0x0005, 0x00b6, 0x00e6, 0x00d6, 0x00c6, 0x0066, 0x0056,
+	0x0046, 0x0036, 0x2061, 0x0100, 0x2071, 0x1800, 0x7160, 0x7810,
+	0x2058, 0xb8a0, 0x2028, 0x76dc, 0xd6ac, 0x1168, 0x9582, 0x007e,
+	0x1250, 0x2500, 0x9094, 0xff80, 0x1130, 0x9080, 0x3327, 0x2015,
+	0x9294, 0x00ff, 0x0020, 0xb910, 0xba14, 0x737c, 0x7480, 0x70dc,
+	0xd0ac, 0x1130, 0x9582, 0x007e, 0x1218, 0x9584, 0xff80, 0x0138,
+	0x9185, 0x0400, 0x6062, 0x6266, 0x636a, 0x646e, 0x0030, 0x6063,
+	0x0400, 0x6266, 0x606b, 0x0000, 0x616e, 0xb8b8, 0x6072, 0x6077,
+	0x0000, 0xb864, 0xd0a4, 0x0110, 0x6077, 0x0008, 0xb88c, 0x8000,
+	0x9084, 0x00ff, 0xb88e, 0x8007, 0x9085, 0x0020, 0x607a, 0x607f,
+	0x0000, 0x2b00, 0x6082, 0x6087, 0xffff, 0x7814, 0x0096, 0x2048,
+	0xa838, 0x608a, 0xa834, 0x608e, 0xa848, 0x60c6, 0xa844, 0x60ca,
+	0x009e, 0xb86c, 0x60ce, 0x60ab, 0x0036, 0x60af, 0x95d5, 0x60d7,
+	0x0000, 0xbac0, 0x629e, 0x00f6, 0x2079, 0x0140, 0x7803, 0x0000,
+	0x00fe, 0x2009, 0x0092, 0x6116, 0x2009, 0x07d0, 0x080c, 0x8567,
+	0x003e, 0x004e, 0x005e, 0x006e, 0x00ce, 0x00de, 0x00ee, 0x00be,
+	0x0005, 0x00b6, 0x0096, 0x00e6, 0x00d6, 0x00c6, 0x0056, 0x0046,
+	0x0036, 0x2061, 0x0100, 0x2071, 0x1800, 0x7810, 0x2058, 0xb8a0,
+	0x2028, 0xb910, 0xba14, 0x737c, 0x7480, 0x7820, 0x90be, 0x0006,
+	0x0904, 0xa1a5, 0x90be, 0x000a, 0x1904, 0xa161, 0xb8c0, 0x609e,
+	0x7814, 0x2048, 0xa87c, 0xd0fc, 0x0558, 0xaf90, 0x9784, 0xff00,
+	0x9105, 0x6062, 0x873f, 0x9784, 0xff00, 0x0006, 0x7814, 0x2048,
+	0xa878, 0xc0fc, 0x9005, 0x000e, 0x1160, 0xaf94, 0x87ff, 0x0198,
+	0x2039, 0x0098, 0x9705, 0x6072, 0x7808, 0x6082, 0x2f00, 0x6086,
+	0x0038, 0x9185, 0x2200, 0x6062, 0x6073, 0x0129, 0x6077, 0x0000,
+	0xb8c0, 0x609e, 0x0050, 0x2039, 0x0029, 0x9705, 0x6072, 0x0cc0,
+	0x9185, 0x0200, 0x6062, 0x6073, 0x2029, 0xa87c, 0xd0fc, 0x0118,
+	0xaf94, 0x87ff, 0x1120, 0x2f00, 0x6082, 0x7808, 0x6086, 0x6266,
+	0x636a, 0x646e, 0x6077, 0x0000, 0xb88c, 0x8000, 0x9084, 0x00ff,
+	0xb88e, 0x8007, 0x607a, 0x607f, 0x0000, 0xa838, 0x608a, 0xa834,
+	0x608e, 0xa848, 0x60c6, 0xa844, 0x60ca, 0xb86c, 0x60ce, 0x60af,
+	0x95d5, 0x60d7, 0x0000, 0x080c, 0xab11, 0x2009, 0x07d0, 0x60c4,
+	0x9084, 0xfff0, 0x9005, 0x0110, 0x2009, 0x1b58, 0x080c, 0x8567,
+	0x003e, 0x004e, 0x005e, 0x00ce, 0x00de, 0x00ee, 0x009e, 0x00be,
+	0x0005, 0x7804, 0x9086, 0x0040, 0x0904, 0xa1e1, 0x9185, 0x0100,
+	0x6062, 0x6266, 0x636a, 0x646e, 0x6073, 0x0809, 0x6077, 0x0008,
+	0x60af, 0x95d5, 0x60d7, 0x0000, 0xb88c, 0x8000, 0x9084, 0x00ff,
+	0xb88e, 0x8007, 0x607a, 0x607f, 0x0000, 0x2f00, 0x6082, 0x7808,
+	0x6086, 0x7814, 0x2048, 0xa838, 0x608a, 0xa834, 0x608e, 0xa848,
+	0x60c6, 0xa844, 0x60ca, 0xb86c, 0x60ce, 0xbac0, 0x629e, 0x080c,
+	0xab11, 0x2009, 0x07d0, 0x60c4, 0x9084, 0xfff0, 0x9005, 0x0110,
+	0x2009, 0x1b58, 0x080c, 0x8567, 0x003e, 0x004e, 0x005e, 0x00ce,
+	0x00de, 0x00ee, 0x009e, 0x00be, 0x0005, 0x7814, 0x2048, 0xa87c,
+	0x9084, 0x0003, 0x9086, 0x0002, 0x0904, 0xa1fd, 0x9185, 0x0100,
+	0x6062, 0x6266, 0x636a, 0x646e, 0x6073, 0x0880, 0x6077, 0x0008,
+	0xb88c, 0x8000, 0x9084, 0x00ff, 0xb88e, 0x8007, 0x607a, 0x7838,
+	0x607e, 0x2f00, 0x6086, 0x7808, 0x6082, 0xa890, 0x608a, 0xa88c,
+	0x608e, 0xa8b0, 0x60c6, 0xa8ac, 0x60ca, 0xa8ac, 0x7930, 0x9108,
+	0x7932, 0xa8b0, 0x792c, 0x9109, 0x792e, 0xb86c, 0x60ce, 0x60af,
+	0x95d5, 0x60d7, 0x0000, 0xbac0, 0x629e, 0x080c, 0xaaee, 0x0804,
+	0xa191, 0xb8cc, 0xd084, 0x0148, 0xb88c, 0x7814, 0x2048, 0xb88c,
+	0x7846, 0xa836, 0x2900, 0xa83a, 0xb04a, 0x9185, 0x0600, 0x6062,
+	0x6266, 0x636a, 0x646e, 0x6073, 0x0829, 0x6077, 0x0000, 0x60af,
+	0x9575, 0x60d7, 0x0000, 0x0804, 0xa174, 0x9185, 0x0700, 0x6062,
+	0x6266, 0x636a, 0x646e, 0x7824, 0xd0cc, 0x7826, 0x0118, 0x6073,
+	0x0889, 0x0010, 0x6073, 0x0898, 0x6077, 0x0000, 0xb88c, 0x8000,
+	0x9084, 0x00ff, 0xb88e, 0x8007, 0x607a, 0x607f, 0x0000, 0x2f00,
+	0x6086, 0x7808, 0x6082, 0xa838, 0x608a, 0xa834, 0x608e, 0xa848,
+	0x60c6, 0xa844, 0x60ca, 0xb86c, 0x60ce, 0x60af, 0x95d5, 0x60d7,
+	0x0000, 0xbac0, 0x629e, 0x7824, 0xd0cc, 0x0120, 0x080c, 0xab11,
+	0x0804, 0xa191, 0x080c, 0xaaee, 0x0804, 0xa191, 0x7a10, 0x00b6,
+	0x2258, 0xba8c, 0x8210, 0x9294, 0x00ff, 0xba8e, 0x00be, 0x8217,
+	0x0005, 0x00d6, 0x2069, 0x19e6, 0x6843, 0x0001, 0x00de, 0x0005,
+	0x60a3, 0x0056, 0x60a7, 0x9575, 0x00f1, 0x080c, 0x8559, 0x0005,
+	0x0016, 0x2001, 0x180c, 0x200c, 0x9184, 0x0600, 0x9086, 0x0600,
+	0x0128, 0x0089, 0x080c, 0x8559, 0x001e, 0x0005, 0xc1e5, 0x2001,
+	0x180c, 0x2102, 0x2001, 0x19e7, 0x2003, 0x0000, 0x2001, 0x19ef,
+	0x2003, 0x0000, 0x0c88, 0x0006, 0x6014, 0x9084, 0x1804, 0x9085,
+	0x0009, 0x6016, 0x000e, 0x0005, 0x0016, 0x00c6, 0x0006, 0x2061,
+	0x0100, 0x61a4, 0x60a7, 0x95f5, 0x6014, 0x9084, 0x1804, 0x9085,
+	0x0008, 0x6016, 0x000e, 0xa001, 0xa001, 0xa001, 0x61a6, 0x00ce,
+	0x001e, 0x0005, 0x00c6, 0x00d6, 0x0016, 0x0026, 0x2061, 0x0100,
+	0x2069, 0x0140, 0x080c, 0x73a5, 0x11e8, 0x2001, 0x1a02, 0x2004,
+	0x9005, 0x1904, 0xa2da, 0x0066, 0x2031, 0x0001, 0x080c, 0x7455,
+	0x006e, 0x1160, 0x2061, 0x0100, 0x6020, 0xd0b4, 0x1120, 0x6024,
+	0xd084, 0x090c, 0x0dd5, 0x080c, 0x8559, 0x0460, 0x00c6, 0x2061,
+	0x19e6, 0x00d0, 0x6904, 0x9194, 0x4000, 0x0548, 0x080c, 0xa274,
+	0x080c, 0x2d01, 0x00c6, 0x2061, 0x19e6, 0x6128, 0x9192, 0x0008,
+	0x1258, 0x8108, 0x612a, 0x6124, 0x00ce, 0x81ff, 0x0198, 0x080c,
+	0x8559, 0x080c, 0xa26b, 0x0070, 0x6124, 0x91e5, 0x0000, 0x0140,
+	0x080c, 0xea1f, 0x080c, 0x8562, 0x2009, 0x0014, 0x080c, 0xaeec,
+	0x00ce, 0x0000, 0x002e, 0x001e, 0x00de, 0x00ce, 0x0005, 0x2001,
+	0x1a02, 0x2004, 0x9005, 0x1db0, 0x00c6, 0x2061, 0x19e6, 0x6128,
+	0x9192, 0x0003, 0x1e08, 0x8108, 0x612a, 0x00ce, 0x080c, 0x8559,
+	0x080c, 0x5ee2, 0x2009, 0x1846, 0x2114, 0x8210, 0x220a, 0x0c10,
+	0x0096, 0x00c6, 0x00d6, 0x00e6, 0x0016, 0x0026, 0x080c, 0x856f,
+	0x2071, 0x19e6, 0x713c, 0x81ff, 0x0904, 0xa37e, 0x2061, 0x0100,
+	0x2069, 0x0140, 0x080c, 0x73a5, 0x1500, 0x0036, 0x2019, 0x0002,
+	0x080c, 0xa5b7, 0x003e, 0x713c, 0x2160, 0x080c, 0xea1f, 0x2009,
 	0x004a, 0x6220, 0x9296, 0x0009, 0x1130, 0x6114, 0x2148, 0xa87b,
-	0x0006, 0x2009, 0x004a, 0x080c, 0xaedc, 0x002e, 0x001e, 0x00ee,
-	0x00de, 0x00ce, 0x009e, 0x0005, 0xd1ec, 0x1904, 0xa334, 0x0804,
-	0xa336, 0x00d6, 0x00c6, 0x0096, 0x703c, 0x9065, 0x090c, 0x0dd5,
-	0x2001, 0x1837, 0x2004, 0xd09c, 0x1904, 0xa415, 0x2001, 0x0306,
-	0x200c, 0x9184, 0x0030, 0x0904, 0xa415, 0x9184, 0x0048, 0x9086,
-	0x0008, 0x1904, 0xa415, 0x2001, 0x020b, 0x2004, 0xd0fc, 0x0904,
-	0xa415, 0xd08c, 0x0904, 0xa415, 0x2009, 0x1a80, 0x2104, 0x8000,
-	0x0208, 0x200a, 0x2069, 0x0100, 0x6914, 0x918c, 0x0184, 0x918d,
-	0x0010, 0x6916, 0x69c8, 0x2011, 0x0020, 0x68c8, 0x9106, 0x1570,
-	0x8211, 0x1dd8, 0x2001, 0x0306, 0x2003, 0x4800, 0x2001, 0x009a,
-	0x2003, 0x0004, 0x2001, 0x1a66, 0x2003, 0x0000, 0x2001, 0x1a6f,
-	0x2003, 0x0000, 0x6a88, 0x698c, 0x2200, 0x9105, 0x1120, 0x2c10,
-	0x080c, 0x1bad, 0x0040, 0x6014, 0x2048, 0xaa3a, 0xa936, 0x6ac4,
-	0x69c8, 0xa946, 0xaa4a, 0x0126, 0x00c6, 0x2091, 0x2400, 0x002e,
-	0x080c, 0x1c46, 0x190c, 0x0dd5, 0x012e, 0x0090, 0x2009, 0x1a81,
-	0x2104, 0x8000, 0x0208, 0x200a, 0x69c8, 0x2011, 0x0020, 0x8211,
-	0x1df0, 0x68c8, 0x9106, 0x1dc0, 0x69c4, 0x68c8, 0x9105, 0x0160,
-	0x6824, 0xd08c, 0x0110, 0x6827, 0x0002, 0x7048, 0xc085, 0x704a,
-	0x0079, 0x7048, 0xc084, 0x704a, 0x2009, 0x07d0, 0x080c, 0x857e,
-	0x9006, 0x009e, 0x00ce, 0x00de, 0x0005, 0x9085, 0x0001, 0x0cc8,
-	0x0026, 0x00e6, 0x2071, 0x19e7, 0x7048, 0xd084, 0x01d8, 0x713c,
-	0x81ff, 0x01c0, 0x2071, 0x0100, 0x9188, 0x0008, 0x2114, 0x928e,
-	0x0006, 0x1138, 0x7014, 0x9084, 0x1984, 0x9085, 0x0012, 0x7016,
-	0x0048, 0x928e, 0x0009, 0x0db0, 0x7014, 0x9084, 0x1984, 0x9085,
-	0x0016, 0x7016, 0x00ee, 0x002e, 0x0005, 0x00b6, 0x00e6, 0x00d6,
-	0x00c6, 0x0066, 0x0056, 0x0046, 0x0006, 0x0126, 0x2091, 0x8000,
-	0x6010, 0x2058, 0xbca0, 0x2071, 0x19e7, 0x7018, 0x2058, 0x8bff,
-	0x0190, 0xb8a0, 0x9406, 0x0118, 0xb854, 0x2058, 0x0cc0, 0x6014,
-	0x0096, 0x2048, 0xac6c, 0xad70, 0xae78, 0x009e, 0x080c, 0x6731,
-	0x0110, 0x9085, 0x0001, 0x012e, 0x000e, 0x004e, 0x005e, 0x006e,
-	0x00ce, 0x00de, 0x00ee, 0x00be, 0x0005, 0x080c, 0x9c60, 0x7003,
-	0x1200, 0x7838, 0x7012, 0x783c, 0x7016, 0x00c6, 0x7820, 0x9086,
-	0x0004, 0x1148, 0x7810, 0x9005, 0x0130, 0x00b6, 0x2058, 0xb810,
-	0xb914, 0x00be, 0x0020, 0x2061, 0x1800, 0x607c, 0x6180, 0x9084,
-	0x00ff, 0x700a, 0x710e, 0x00ce, 0x60c3, 0x002c, 0x0804, 0xa247,
-	0x080c, 0x9c60, 0x7003, 0x0f00, 0x7808, 0xd09c, 0x0128, 0xb810,
-	0x9084, 0x00ff, 0x700a, 0xb814, 0x700e, 0x60c3, 0x0008, 0x0804,
-	0xa247, 0x0156, 0x080c, 0x9cab, 0x7003, 0x0200, 0x080c, 0x85d9,
-	0x20a9, 0x0006, 0x2011, 0xfff4, 0x2019, 0xfff5, 0x9ef0, 0x0002,
-	0x2305, 0x2072, 0x8e70, 0x2205, 0x2072, 0x8e70, 0x9398, 0x0002,
-	0x9290, 0x0002, 0x1f04, 0xa4b0, 0x60c3, 0x001c, 0x015e, 0x0804,
-	0xa247, 0x0016, 0x0026, 0x080c, 0x9c87, 0x080c, 0x9c99, 0x9e80,
-	0x0004, 0x20e9, 0x0000, 0x20a0, 0x7814, 0x0096, 0x2048, 0xa800,
-	0x2048, 0xa860, 0x20e0, 0xa85c, 0x9080, 0x0021, 0x2098, 0x009e,
-	0x7808, 0x9088, 0x0002, 0x21a8, 0x9192, 0x0010, 0x1250, 0x4003,
-	0x9080, 0x0004, 0x8003, 0x60c2, 0x080c, 0xa247, 0x002e, 0x001e,
-	0x0005, 0x20a9, 0x0010, 0x4003, 0x080c, 0xab0c, 0x20a1, 0x0240,
-	0x22a8, 0x4003, 0x0c68, 0x080c, 0x9c60, 0x7003, 0x6200, 0x7808,
-	0x700e, 0x60c3, 0x0008, 0x0804, 0xa247, 0x0016, 0x0026, 0x080c,
-	0x9c60, 0x20e9, 0x0000, 0x20a1, 0x024c, 0x7814, 0x0096, 0x2048,
-	0xa800, 0x2048, 0xa860, 0x20e0, 0xa85c, 0x9080, 0x0023, 0x2098,
-	0x009e, 0x7808, 0x9088, 0x0002, 0x21a8, 0x4003, 0x8003, 0x60c2,
-	0x080c, 0xa247, 0x002e, 0x001e, 0x0005, 0x00e6, 0x00c6, 0x0006,
-	0x0126, 0x2091, 0x8000, 0x2071, 0x19e7, 0x700c, 0x2060, 0x8cff,
-	0x0178, 0x080c, 0xcd3b, 0x1110, 0x080c, 0xb813, 0x600c, 0x0006,
-	0x080c, 0xcfa2, 0x080c, 0xae61, 0x080c, 0xa692, 0x00ce, 0x0c78,
-	0x2c00, 0x700e, 0x700a, 0x012e, 0x000e, 0x00ce, 0x00ee, 0x0005,
-	0x0126, 0x0156, 0x00f6, 0x00e6, 0x00d6, 0x00c6, 0x0066, 0x0026,
-	0x0016, 0x0006, 0x2091, 0x8000, 0x2001, 0x180c, 0x200c, 0x918c,
-	0xe7ff, 0x2102, 0x2069, 0x0100, 0x2079, 0x0140, 0x2071, 0x19e7,
-	0x7024, 0x2060, 0x8cff, 0x01f8, 0x080c, 0xa273, 0x6ac0, 0x68c3,
-	0x0000, 0x080c, 0x8579, 0x00c6, 0x2061, 0x0100, 0x080c, 0xac5d,
-	0x00ce, 0x20a9, 0x01f4, 0x0461, 0x2009, 0x0013, 0x080c, 0xaedc,
-	0x000e, 0x001e, 0x002e, 0x006e, 0x00ce, 0x00de, 0x00ee, 0x00fe,
-	0x015e, 0x012e, 0x0005, 0x2001, 0x1800, 0x2004, 0x9096, 0x0001,
-	0x0d78, 0x9096, 0x0004, 0x0d60, 0x080c, 0x8579, 0x6814, 0x9084,
-	0x0001, 0x0110, 0x68a7, 0x95f5, 0x6817, 0x0008, 0x68c3, 0x0000,
-	0x2011, 0x5e83, 0x080c, 0x84f3, 0x20a9, 0x01f4, 0x0009, 0x08c0,
-	0x6824, 0xd094, 0x0140, 0x6827, 0x0004, 0x7804, 0x9084, 0x4000,
-	0x190c, 0x2cff, 0x0090, 0xd084, 0x0118, 0x6827, 0x0001, 0x0010,
-	0x1f04, 0xa598, 0x7804, 0x9084, 0x1000, 0x0138, 0x2001, 0x0100,
-	0x080c, 0x2cef, 0x9006, 0x080c, 0x2cef, 0x0005, 0x0126, 0x0156,
-	0x00f6, 0x00e6, 0x00d6, 0x00c6, 0x0066, 0x0026, 0x0016, 0x0006,
-	0x2091, 0x8000, 0x2001, 0x180c, 0x200c, 0x918c, 0xdbff, 0x2102,
-	0x2069, 0x0100, 0x2079, 0x0140, 0x2071, 0x19e7, 0x703c, 0x2060,
-	0x8cff, 0x0904, 0xa648, 0x9386, 0x0002, 0x1128, 0x6814, 0x9084,
-	0x0002, 0x0904, 0xa648, 0x68af, 0x95f5, 0x6817, 0x0010, 0x2009,
-	0x00fa, 0x8109, 0x1df0, 0x69c6, 0x68cb, 0x0008, 0x080c, 0x8586,
-	0x080c, 0x1ffa, 0x0046, 0x2009, 0x00a5, 0x080c, 0x0e51, 0x2021,
-	0x0169, 0x2404, 0x9084, 0x000f, 0x9086, 0x0004, 0x11f8, 0x68af,
-	0x95f5, 0x68c6, 0x68cb, 0x0008, 0x00e6, 0x00f6, 0x2079, 0x0090,
-	0x2071, 0x1a66, 0x6814, 0x9084, 0x1984, 0x9085, 0x0012, 0x6816,
-	0x782b, 0x0008, 0x7003, 0x0000, 0x00fe, 0x00ee, 0x9386, 0x0002,
-	0x1128, 0x7884, 0x9005, 0x1110, 0x7887, 0x0001, 0x2001, 0x1981,
-	0x200c, 0x080c, 0x0e51, 0x004e, 0x20a9, 0x03e8, 0x6824, 0xd094,
-	0x0140, 0x6827, 0x0004, 0x7804, 0x9084, 0x4000, 0x190c, 0x2cff,
-	0x0090, 0xd08c, 0x0118, 0x6827, 0x0002, 0x0010, 0x1f04, 0xa61e,
-	0x7804, 0x9084, 0x1000, 0x0138, 0x2001, 0x0100, 0x080c, 0x2cef,
-	0x9006, 0x080c, 0x2cef, 0x6827, 0x4000, 0x6824, 0x83ff, 0x1140,
-	0x2009, 0x0049, 0x6020, 0x9086, 0x0009, 0x0110, 0x080c, 0xaedc,
-	0x000e, 0x001e, 0x002e, 0x006e, 0x00ce, 0x00de, 0x00ee, 0x00fe,
-	0x015e, 0x012e, 0x0005, 0x00d6, 0x0126, 0x2091, 0x8000, 0x2069,
-	0x19e7, 0x6a06, 0x012e, 0x00de, 0x0005, 0x00d6, 0x0126, 0x2091,
-	0x8000, 0x2069, 0x19e7, 0x6a32, 0x012e, 0x00de, 0x0005, 0x080c,
-	0x9e19, 0x7854, 0x7032, 0x7042, 0x7047, 0x1000, 0x00f8, 0x080c,
-	0x9e19, 0x7854, 0x7032, 0x7042, 0x7047, 0x4000, 0x00b8, 0x080c,
-	0x9e19, 0x7854, 0x7032, 0x7042, 0x7047, 0x2000, 0x0078, 0x080c,
-	0x9e19, 0x7854, 0x7032, 0x7042, 0x7047, 0x0400, 0x0038, 0x080c,
-	0x9e19, 0x7854, 0x7032, 0x7042, 0x7047, 0x0200, 0x60c3, 0x0020,
-	0x0804, 0xa247, 0x00e6, 0x2071, 0x19e7, 0x7020, 0x9005, 0x0110,
-	0x8001, 0x7022, 0x00ee, 0x0005, 0x00f6, 0x00e6, 0x00d6, 0x00c6,
-	0x0076, 0x0066, 0x0006, 0x0126, 0x2091, 0x8000, 0x2071, 0x19e7,
-	0x7614, 0x2660, 0x2678, 0x2039, 0x0001, 0x87ff, 0x0904, 0xa737,
-	0x8cff, 0x0904, 0xa737, 0x6020, 0x9086, 0x0006, 0x1904, 0xa732,
-	0x88ff, 0x0138, 0x2800, 0x9c06, 0x1904, 0xa732, 0x2039, 0x0000,
-	0x0050, 0x6010, 0x9b06, 0x1904, 0xa732, 0x85ff, 0x0120, 0x6054,
-	0x9106, 0x1904, 0xa732, 0x7024, 0x9c06, 0x15b0, 0x2069, 0x0100,
-	0x68c0, 0x9005, 0x1160, 0x6824, 0xd084, 0x0148, 0x6827, 0x0001,
-	0x080c, 0x8579, 0x080c, 0xa7bc, 0x7027, 0x0000, 0x0428, 0x080c,
-	0x8579, 0x6820, 0xd0b4, 0x0110, 0x68a7, 0x95f5, 0x6817, 0x0008,
-	0x68c3, 0x0000, 0x080c, 0xa7bc, 0x7027, 0x0000, 0x0036, 0x2069,
-	0x0140, 0x6b04, 0x9384, 0x1000, 0x0138, 0x2001, 0x0100, 0x080c,
-	0x2cef, 0x9006, 0x080c, 0x2cef, 0x2069, 0x0100, 0x6824, 0xd084,
-	0x0110, 0x6827, 0x0001, 0x003e, 0x7014, 0x9c36, 0x1110, 0x660c,
-	0x7616, 0x7010, 0x9c36, 0x1140, 0x2c00, 0x9f36, 0x0118, 0x2f00,
-	0x7012, 0x0010, 0x7013, 0x0000, 0x660c, 0x0066, 0x2c00, 0x9f06,
-	0x0110, 0x7e0e, 0x0008, 0x2678, 0x89ff, 0x1168, 0x600f, 0x0000,
-	0x6014, 0x0096, 0x2048, 0x080c, 0xcb33, 0x0110, 0x080c, 0xe551,
-	0x009e, 0x080c, 0xae92, 0x080c, 0xa692, 0x88ff, 0x1190, 0x00ce,
-	0x0804, 0xa6ad, 0x2c78, 0x600c, 0x2060, 0x0804, 0xa6ad, 0x9006,
-	0x012e, 0x000e, 0x006e, 0x007e, 0x00ce, 0x00de, 0x00ee, 0x00fe,
-	0x0005, 0x601b, 0x0000, 0x00ce, 0x98c5, 0x0001, 0x0c88, 0x00f6,
-	0x00e6, 0x00d6, 0x0096, 0x00c6, 0x0066, 0x0026, 0x0006, 0x0126,
-	0x2091, 0x8000, 0x2071, 0x19e7, 0x7638, 0x2660, 0x2678, 0x8cff,
-	0x0904, 0xa7ab, 0x6020, 0x9086, 0x0006, 0x1904, 0xa7a6, 0x87ff,
-	0x0128, 0x2700, 0x9c06, 0x1904, 0xa7a6, 0x0040, 0x6010, 0x9b06,
-	0x15e8, 0x85ff, 0x0118, 0x6054, 0x9106, 0x15c0, 0x703c, 0x9c06,
-	0x1168, 0x0036, 0x2019, 0x0001, 0x080c, 0xa5b6, 0x7033, 0x0000,
-	0x9006, 0x703e, 0x7042, 0x7046, 0x704a, 0x003e, 0x7038, 0x9c36,
-	0x1110, 0x660c, 0x763a, 0x7034, 0x9c36, 0x1140, 0x2c00, 0x9f36,
-	0x0118, 0x2f00, 0x7036, 0x0010, 0x7037, 0x0000, 0x660c, 0x0066,
-	0x2c00, 0x9f06, 0x0110, 0x7e0e, 0x0008, 0x2678, 0x600f, 0x0000,
-	0x6014, 0x2048, 0x080c, 0xcb33, 0x0110, 0x080c, 0xe551, 0x080c,
-	0xae92, 0x87ff, 0x1198, 0x00ce, 0x0804, 0xa757, 0x2c78, 0x600c,
-	0x2060, 0x0804, 0xa757, 0x9006, 0x012e, 0x000e, 0x002e, 0x006e,
-	0x00ce, 0x009e, 0x00de, 0x00ee, 0x00fe, 0x0005, 0x601b, 0x0000,
-	0x00ce, 0x97bd, 0x0001, 0x0c80, 0x00e6, 0x2071, 0x19e7, 0x2001,
-	0x1800, 0x2004, 0x9086, 0x0002, 0x1118, 0x7007, 0x0005, 0x0010,
-	0x7007, 0x0000, 0x00ee, 0x0005, 0x00f6, 0x00e6, 0x00c6, 0x0066,
-	0x0026, 0x0006, 0x0126, 0x2091, 0x8000, 0x2071, 0x19e7, 0x2c10,
-	0x7638, 0x2660, 0x2678, 0x8cff, 0x0518, 0x2200, 0x9c06, 0x11e0,
-	0x7038, 0x9c36, 0x1110, 0x660c, 0x763a, 0x7034, 0x9c36, 0x1140,
-	0x2c00, 0x9f36, 0x0118, 0x2f00, 0x7036, 0x0010, 0x7037, 0x0000,
-	0x660c, 0x2c00, 0x9f06, 0x0110, 0x7e0e, 0x0008, 0x2678, 0x600f,
-	0x0000, 0x9085, 0x0001, 0x0020, 0x2c78, 0x600c, 0x2060, 0x08d8,
-	0x012e, 0x000e, 0x002e, 0x006e, 0x00ce, 0x00ee, 0x00fe, 0x0005,
-	0x0096, 0x00f6, 0x00e6, 0x00d6, 0x00c6, 0x0066, 0x0026, 0x0006,
-	0x0126, 0x2091, 0x8000, 0x2071, 0x19e7, 0x760c, 0x2660, 0x2678,
-	0x8cff, 0x0904, 0xa898, 0x6010, 0x00b6, 0x2058, 0xb8a0, 0x00be,
-	0x9206, 0x1904, 0xa893, 0x7024, 0x9c06, 0x1520, 0x2069, 0x0100,
-	0x68c0, 0x9005, 0x0904, 0xa86f, 0x080c, 0xa273, 0x68c3, 0x0000,
-	0x080c, 0xa7bc, 0x7027, 0x0000, 0x0036, 0x2069, 0x0140, 0x6b04,
-	0x9384, 0x1000, 0x0138, 0x2001, 0x0100, 0x080c, 0x2cef, 0x9006,
-	0x080c, 0x2cef, 0x2069, 0x0100, 0x6824, 0xd084, 0x0110, 0x6827,
-	0x0001, 0x003e, 0x700c, 0x9c36, 0x1110, 0x660c, 0x760e, 0x7008,
-	0x9c36, 0x1140, 0x2c00, 0x9f36, 0x0118, 0x2f00, 0x700a, 0x0010,
-	0x700b, 0x0000, 0x660c, 0x0066, 0x2c00, 0x9f06, 0x0110, 0x7e0e,
-	0x0008, 0x2678, 0x600f, 0x0000, 0x080c, 0xcd2a, 0x1158, 0x080c,
-	0x31e8, 0x080c, 0xcd3b, 0x11f0, 0x080c, 0xb813, 0x00d8, 0x080c,
-	0xa7bc, 0x08c0, 0x080c, 0xcd3b, 0x1118, 0x080c, 0xb813, 0x0090,
-	0x6014, 0x2048, 0x080c, 0xcb33, 0x0168, 0x6020, 0x9086, 0x0003,
-	0x1508, 0xa867, 0x0103, 0xab7a, 0xa877, 0x0000, 0x080c, 0x6c75,
-	0x080c, 0xcd1e, 0x080c, 0xcfa2, 0x080c, 0xae92, 0x080c, 0xa692,
-	0x00ce, 0x0804, 0xa818, 0x2c78, 0x600c, 0x2060, 0x0804, 0xa818,
-	0x012e, 0x000e, 0x002e, 0x006e, 0x00ce, 0x00de, 0x00ee, 0x00fe,
-	0x009e, 0x0005, 0x6020, 0x9086, 0x0006, 0x1d20, 0x080c, 0xe551,
-	0x0c08, 0x00d6, 0x080c, 0x9cab, 0x7003, 0x0200, 0x7007, 0x0014,
-	0x60c3, 0x0014, 0x20e1, 0x0001, 0x2099, 0x1989, 0x20e9, 0x0000,
-	0x20a1, 0x0250, 0x20a9, 0x0004, 0x4003, 0x7023, 0x0004, 0x7027,
-	0x7878, 0x080c, 0xa247, 0x00de, 0x0005, 0x080c, 0x9cab, 0x700b,
-	0x0800, 0x7814, 0x9084, 0xff00, 0x700e, 0x7814, 0x9084, 0x00ff,
-	0x7022, 0x782c, 0x7026, 0x7858, 0x9084, 0x00ff, 0x9085, 0x0200,
-	0x7002, 0x7858, 0x9084, 0xff00, 0x8007, 0x7006, 0x60c2, 0x0804,
-	0xa247, 0x00b6, 0x00d6, 0x0016, 0x00d6, 0x2f68, 0x2009, 0x0035,
-	0x080c, 0xd1a8, 0x00de, 0x1904, 0xa946, 0x080c, 0x9c60, 0x7003,
-	0x1300, 0x782c, 0x080c, 0xaa48, 0x2068, 0x6820, 0x9086, 0x0003,
-	0x0560, 0x7810, 0x2058, 0xbaa0, 0x080c, 0xadcb, 0x11d8, 0x9286,
-	0x007e, 0x1128, 0x700b, 0x00ff, 0x700f, 0xfffe, 0x0498, 0x9286,
-	0x007f, 0x1128, 0x700b, 0x00ff, 0x700f, 0xfffd, 0x0458, 0x9284,
-	0xff80, 0x0180, 0x9286, 0x0080, 0x1128, 0x700b, 0x00ff, 0x700f,
-	0xfffc, 0x0400, 0x92d8, 0x1000, 0x2b5c, 0xb810, 0x700a, 0xb814,
-	0x700e, 0x00c0, 0x6098, 0x700e, 0x00a8, 0x080c, 0xadcb, 0x1130,
-	0x7810, 0x2058, 0xb8a0, 0x9082, 0x007e, 0x0250, 0x00d6, 0x2069,
-	0x181f, 0x2d04, 0x700a, 0x8d68, 0x2d04, 0x700e, 0x00de, 0x0010,
-	0x6034, 0x700e, 0x7838, 0x7012, 0x783c, 0x7016, 0x60c3, 0x000c,
-	0x001e, 0x00de, 0x080c, 0xa247, 0x00be, 0x0005, 0x781b, 0x0001,
-	0x7803, 0x0006, 0x001e, 0x00de, 0x00be, 0x0005, 0x792c, 0x9180,
-	0x0008, 0x200c, 0x9186, 0x0006, 0x01c0, 0x9186, 0x0003, 0x0904,
-	0xa9c0, 0x9186, 0x0005, 0x0904, 0xa9a9, 0x9186, 0x0004, 0x05d8,
-	0x9186, 0x0008, 0x0904, 0xa9b1, 0x7807, 0x0037, 0x782f, 0x0003,
-	0x7817, 0x1700, 0x080c, 0xaa25, 0x0005, 0x080c, 0xa9e6, 0x00d6,
-	0x0026, 0x792c, 0x2168, 0x2009, 0x4000, 0x6800, 0x0002, 0xa98a,
-	0xa995, 0xa98c, 0xa995, 0xa991, 0xa98a, 0xa98a, 0xa995, 0xa995,
-	0xa995, 0xa995, 0xa98a, 0xa98a, 0xa98a, 0xa98a, 0xa98a, 0xa995,
-	0xa98a, 0xa995, 0x080c, 0x0dd5, 0x6824, 0xd0e4, 0x0110, 0xd0cc,
-	0x0110, 0x900e, 0x0010, 0x2009, 0x2000, 0x682c, 0x7022, 0x6830,
-	0x7026, 0x0804, 0xa9df, 0x080c, 0xa9e6, 0x00d6, 0x0026, 0x792c,
-	0x2168, 0x2009, 0x4000, 0x6a00, 0x9286, 0x0002, 0x1108, 0x900e,
-	0x04b0, 0x04e1, 0x00d6, 0x0026, 0x792c, 0x2168, 0x2009, 0x4000,
-	0x0470, 0x04a1, 0x00d6, 0x0026, 0x792c, 0x2168, 0x2009, 0x4000,
-	0x9286, 0x0005, 0x0118, 0x9286, 0x0002, 0x1108, 0x900e, 0x00f8,
-	0x0429, 0x00d6, 0x0026, 0x792c, 0x2168, 0x6814, 0x0096, 0x2048,
-	0xa9ac, 0xa834, 0x9112, 0xa9b0, 0xa838, 0x009e, 0x9103, 0x7022,
-	0x7226, 0x792c, 0x9180, 0x0000, 0x2004, 0x908e, 0x0002, 0x0130,
-	0x908e, 0x0004, 0x0118, 0x2009, 0x4000, 0x0008, 0x900e, 0x712a,
-	0x60c3, 0x0018, 0x002e, 0x00de, 0x0804, 0xa247, 0x00b6, 0x0036,
-	0x0046, 0x0056, 0x0066, 0x080c, 0x9cab, 0x9006, 0x7003, 0x0200,
-	0x7938, 0x710a, 0x793c, 0x710e, 0x7810, 0x2058, 0xb8a0, 0x080c,
-	0xadcb, 0x1118, 0x9092, 0x007e, 0x0268, 0x00d6, 0x2069, 0x181f,
-	0x2d2c, 0x8d68, 0x2d34, 0x90d8, 0x1000, 0x2b5c, 0xbb10, 0xbc14,
-	0x00de, 0x0028, 0x901e, 0x6498, 0x2029, 0x0000, 0x6634, 0x782c,
-	0x9080, 0x0008, 0x2004, 0x9086, 0x0003, 0x1128, 0x7512, 0x7616,
-	0x731a, 0x741e, 0x0020, 0x7312, 0x7416, 0x751a, 0x761e, 0x006e,
-	0x005e, 0x004e, 0x003e, 0x00be, 0x0005, 0x080c, 0x9cab, 0x7003,
-	0x0100, 0x782c, 0x700a, 0x7814, 0x700e, 0x700e, 0x60c3, 0x0008,
-	0x0804, 0xa247, 0x080c, 0x9c57, 0x7003, 0x1400, 0x7838, 0x700a,
-	0x0079, 0x783c, 0x700e, 0x782c, 0x7012, 0x7830, 0x7016, 0x7834,
-	0x9084, 0x00ff, 0x8007, 0x701a, 0x60c3, 0x0010, 0x0804, 0xa247,
-	0x00e6, 0x2071, 0x0240, 0x0006, 0x00f6, 0x2078, 0x7810, 0x00b6,
-	0x2058, 0xb8cc, 0xd084, 0x0120, 0x7848, 0x702a, 0x7844, 0x702e,
-	0x00be, 0x00fe, 0x000e, 0x00ee, 0x0005, 0x080c, 0x9ca2, 0x7003,
-	0x0100, 0x782c, 0x700a, 0x7814, 0x700e, 0x60c3, 0x0008, 0x0804,
-	0xa247, 0x0021, 0x60c3, 0x0000, 0x0804, 0xa247, 0x00d6, 0x080c,
-	0xab21, 0xb810, 0x9085, 0x0300, 0x7002, 0xb814, 0x7006, 0x2069,
-	0x1800, 0x687c, 0x700a, 0x6880, 0x700e, 0x7013, 0x0819, 0x080c,
-	0xa235, 0x721a, 0x2f10, 0x7222, 0x7a08, 0x7226, 0x2071, 0x024c,
-	0x00de, 0x0005, 0x00a9, 0x7914, 0x712a, 0x60c3, 0x0000, 0x60a7,
-	0x9575, 0x0026, 0x080c, 0x2ba5, 0x0228, 0x2011, 0x0101, 0x2204,
-	0xc0c5, 0x2012, 0x002e, 0x080c, 0xa26a, 0x080c, 0x8570, 0x0005,
-	0x0036, 0x0096, 0x00d6, 0x00e6, 0x7858, 0x2048, 0xaa7c, 0x9296,
-	0x00c0, 0x9294, 0xfffd, 0xaa7e, 0xaa80, 0x9294, 0x0300, 0xaa82,
-	0xa96c, 0x9194, 0x00ff, 0xab74, 0x9384, 0x00ff, 0x908d, 0xc200,
-	0xa96e, 0x9384, 0xff00, 0x9215, 0xaa76, 0xa870, 0xaa78, 0xa87a,
-	0xaa72, 0x00d6, 0x2069, 0x0200, 0x080c, 0xab21, 0x00de, 0x20e9,
-	0x0000, 0x20a1, 0x0240, 0x20a9, 0x000a, 0xa860, 0x20e0, 0xa85c,
-	0x9080, 0x001b, 0x2098, 0x4003, 0x60a3, 0x0035, 0xaa68, 0x9294,
-	0x7000, 0x9286, 0x3000, 0x0110, 0x60a3, 0x0037, 0x00ee, 0x00de,
-	0x009e, 0x003e, 0x0005, 0x900e, 0x7814, 0x0096, 0x2048, 0xa87c,
-	0xd0fc, 0x01c0, 0x9084, 0x0003, 0x11a8, 0x2001, 0x180c, 0x2004,
-	0xd0bc, 0x0180, 0x7824, 0xd0cc, 0x1168, 0xd0c4, 0x1158, 0xa8a8,
-	0x9005, 0x1140, 0x2001, 0x180c, 0x200c, 0xc1d5, 0x2102, 0x2009,
-	0x19b2, 0x210c, 0x009e, 0x918d, 0x0092, 0x0010, 0x2009, 0x0096,
-	0x60ab, 0x0036, 0x6116, 0x0005, 0x2009, 0x0009, 0x00a0, 0x2009,
-	0x000a, 0x0088, 0x2009, 0x000b, 0x0070, 0x2009, 0x000c, 0x0058,
-	0x2009, 0x000d, 0x0040, 0x2009, 0x000e, 0x0028, 0x2009, 0x000f,
-	0x0010, 0x2009, 0x0008, 0x6912, 0x0005, 0x080c, 0x9c60, 0x0016,
-	0x0026, 0x0096, 0x00d6, 0x7814, 0x2048, 0x7013, 0x0138, 0x2001,
-	0x1837, 0x2004, 0x9084, 0x0028, 0x1138, 0x2001, 0x197c, 0x2004,
-	0x9086, 0xaaaa, 0x1904, 0xabc6, 0x7003, 0x5400, 0x00c6, 0x2061,
-	0x1800, 0x607c, 0x9084, 0x00ff, 0xa998, 0x810f, 0x918c, 0xff00,
-	0x9105, 0x700a, 0x6080, 0x700e, 0xa998, 0x918c, 0xff00, 0x7112,
-	0x20a9, 0x0004, 0x2009, 0x1805, 0x2e10, 0x9290, 0x0006, 0x2104,
-	0x2012, 0x8108, 0x8210, 0x1f04, 0xab57, 0x20a9, 0x0004, 0x2009,
-	0x1801, 0x2104, 0x2012, 0x8108, 0x8210, 0x1f04, 0xab61, 0xa860,
-	0x20e0, 0xa85c, 0x9080, 0x0029, 0x2098, 0x2009, 0x0006, 0x20a9,
-	0x0001, 0x4002, 0x8007, 0x2012, 0x8210, 0x8109, 0x1dc0, 0x00d6,
-	0x2069, 0x0200, 0x080c, 0xab0c, 0x00de, 0x2071, 0x0240, 0x2011,
-	0x0240, 0x2009, 0x0002, 0x20a9, 0x0001, 0x4002, 0x8007, 0x2012,
-	0x8210, 0x8109, 0x1dc0, 0x2009, 0x0008, 0x20a9, 0x0001, 0x4002,
-	0x8007, 0x2012, 0x8210, 0x8109, 0x1dc0, 0xa85c, 0x9080, 0x0031,
-	0x2098, 0x2009, 0x0008, 0x20a9, 0x0001, 0x4002, 0x8007, 0x2012,
-	0x8210, 0x8109, 0x1dc0, 0x00ce, 0x60c3, 0x004c, 0x60a3, 0x0056,
-	0x60a7, 0x9575, 0x2001, 0x1837, 0x2004, 0x9084, 0x0028, 0x1168,
-	0x080c, 0x73bc, 0x0150, 0x6028, 0xc0bd, 0x602a, 0x6014, 0x9084,
-	0x1804, 0x9085, 0x0029, 0x6016, 0x0010, 0x080c, 0xa247, 0x080c,
-	0x8570, 0x00de, 0x009e, 0x002e, 0x001e, 0x0005, 0x00e6, 0x2071,
-	0x0240, 0x2001, 0x2200, 0x9085, 0x00ff, 0x7002, 0x7007, 0xffff,
-	0x2071, 0x0100, 0x709b, 0x00ff, 0x00ee, 0x0804, 0xab3c, 0x080c,
-	0x9c60, 0x0016, 0x0026, 0x0096, 0x00d6, 0x7814, 0x2048, 0x7013,
-	0x0138, 0x7003, 0x5500, 0x00c6, 0xa89c, 0x9084, 0x00ff, 0xa998,
-	0x810f, 0x918c, 0xff00, 0x9105, 0x700a, 0xa99c, 0x918c, 0xff00,
-	0xa8a0, 0x9084, 0x00ff, 0x9105, 0x700e, 0xa998, 0x918c, 0xff00,
-	0x2061, 0x1800, 0x607c, 0x9084, 0x00ff, 0x910d, 0x7112, 0x6180,
-	0x7116, 0x2009, 0x0008, 0xa860, 0x20e0, 0xa85c, 0x9080, 0x0029,
-	0x2098, 0x2e10, 0x9290, 0x0006, 0x20a9, 0x0001, 0x4002, 0x8007,
-	0x2012, 0x8210, 0x8109, 0x1dc0, 0x20a9, 0x0004, 0x2009, 0x1805,
-	0x2104, 0x2012, 0x8108, 0x8210, 0x1f04, 0xac18, 0x20a9, 0x0002,
-	0x2009, 0x1801, 0x2104, 0x2012, 0x8108, 0x8210, 0x1f04, 0xac22,
-	0x00d6, 0x0016, 0x2069, 0x0200, 0x080c, 0xab0c, 0x001e, 0x00de,
-	0x2071, 0x0240, 0x20a9, 0x0002, 0x2009, 0x1803, 0x2011, 0x0240,
-	0x2104, 0x2012, 0x8108, 0x8210, 0x1f04, 0xac38, 0x2009, 0x0008,
-	0x4002, 0x8007, 0x2012, 0x8210, 0x8109, 0x1dd0, 0x9006, 0x20a9,
-	0x0008, 0x2012, 0x8210, 0x1f04, 0xac49, 0x00ce, 0x60c3, 0x004c,
-	0x60a3, 0x0056, 0x60a7, 0x9575, 0x080c, 0xa247, 0x080c, 0x8570,
-	0x00de, 0x009e, 0x002e, 0x001e, 0x0005, 0x00d6, 0x9290, 0x0018,
-	0x8214, 0x20e9, 0x0000, 0x2069, 0x0200, 0x6813, 0x0000, 0x22a8,
-	0x9284, 0x00e0, 0x0128, 0x20a9, 0x0020, 0x9292, 0x0020, 0x0008,
-	0x9016, 0x20a1, 0x0240, 0x9006, 0x4004, 0x82ff, 0x0120, 0x6810,
-	0x8000, 0x6812, 0x0c60, 0x00de, 0x0005, 0x00d6, 0x0096, 0x6014,
-	0x2048, 0xa878, 0x6056, 0x9006, 0xa836, 0xa83a, 0xa99c, 0xa946,
-	0xa84a, 0x6023, 0x0003, 0x6007, 0x0040, 0x6003, 0x0003, 0x600b,
-	0xffff, 0xa817, 0x0001, 0xa842, 0xa83e, 0x2900, 0xa85a, 0xa813,
-	0x208e, 0x080c, 0x9155, 0x0126, 0x2091, 0x8000, 0x080c, 0x97b9,
-	0x012e, 0x009e, 0x00de, 0x0005, 0x00f6, 0x00e6, 0x00d6, 0x00c6,
-	0x00a6, 0x0096, 0x0066, 0x0126, 0x2091, 0x8000, 0x2071, 0x19e7,
-	0x760c, 0x2660, 0x2678, 0x8cff, 0x0904, 0xad2b, 0x7024, 0x9c06,
-	0x1520, 0x2069, 0x0100, 0x68c0, 0x9005, 0x0904, 0xad02, 0x080c,
-	0xa273, 0x68c3, 0x0000, 0x080c, 0xa7bc, 0x7027, 0x0000, 0x0036,
+	0x0006, 0x2009, 0x004a, 0x080c, 0xaeec, 0x0066, 0x2031, 0x0001,
+	0x080c, 0x7455, 0x006e, 0x0804, 0xa37e, 0x080c, 0xa38a, 0x0904,
+	0xa37e, 0x6904, 0xd1f4, 0x0904, 0xa385, 0x080c, 0x2d01, 0x00c6,
+	0x703c, 0x9065, 0x090c, 0x0dd5, 0x6020, 0x00ce, 0x9086, 0x0006,
+	0x1528, 0x61c8, 0x60c4, 0x9105, 0x1508, 0x2009, 0x180c, 0x2104,
+	0xd0d4, 0x01e0, 0x6214, 0x9294, 0x1800, 0x1128, 0x6224, 0x9294,
+	0x0002, 0x1560, 0x0030, 0xc0d4, 0x200a, 0xd0cc, 0x0110, 0x080c,
+	0x2c54, 0x6014, 0x9084, 0xe7fd, 0x9085, 0x0010, 0x6016, 0x703c,
+	0x2060, 0x2009, 0x0049, 0x080c, 0xaeec, 0x00c0, 0x0036, 0x2019,
+	0x0001, 0x080c, 0xa5b7, 0x003e, 0x713c, 0x2160, 0x080c, 0xea1f,
+	0x2009, 0x004a, 0x6220, 0x9296, 0x0009, 0x1130, 0x6114, 0x2148,
+	0xa87b, 0x0006, 0x2009, 0x004a, 0x080c, 0xaeec, 0x002e, 0x001e,
+	0x00ee, 0x00de, 0x00ce, 0x009e, 0x0005, 0xd1ec, 0x1904, 0xa335,
+	0x0804, 0xa337, 0x00d6, 0x00c6, 0x0096, 0x703c, 0x9065, 0x090c,
+	0x0dd5, 0x2001, 0x1837, 0x2004, 0xd09c, 0x1904, 0xa416, 0x2001,
+	0x0306, 0x200c, 0x9184, 0x0030, 0x0904, 0xa416, 0x9184, 0x0048,
+	0x9086, 0x0008, 0x1904, 0xa416, 0x2001, 0x020b, 0x2004, 0xd0fc,
+	0x0904, 0xa416, 0xd08c, 0x0904, 0xa416, 0x2009, 0x1a7f, 0x2104,
+	0x8000, 0x0208, 0x200a, 0x2069, 0x0100, 0x6914, 0x918c, 0x0184,
+	0x918d, 0x0010, 0x6916, 0x69c8, 0x2011, 0x0020, 0x68c8, 0x9106,
+	0x1570, 0x8211, 0x1dd8, 0x2001, 0x0306, 0x2003, 0x4800, 0x2001,
+	0x009a, 0x2003, 0x0004, 0x2001, 0x1a65, 0x2003, 0x0000, 0x2001,
+	0x1a6e, 0x2003, 0x0000, 0x6a88, 0x698c, 0x2200, 0x9105, 0x1120,
+	0x2c10, 0x080c, 0x1baf, 0x0040, 0x6014, 0x2048, 0xaa3a, 0xa936,
+	0x6ac4, 0x69c8, 0xa946, 0xaa4a, 0x0126, 0x00c6, 0x2091, 0x2400,
+	0x002e, 0x080c, 0x1c48, 0x190c, 0x0dd5, 0x012e, 0x0090, 0x2009,
+	0x1a80, 0x2104, 0x8000, 0x0208, 0x200a, 0x69c8, 0x2011, 0x0020,
+	0x8211, 0x1df0, 0x68c8, 0x9106, 0x1dc0, 0x69c4, 0x68c8, 0x9105,
+	0x0160, 0x6824, 0xd08c, 0x0110, 0x6827, 0x0002, 0x7048, 0xc085,
+	0x704a, 0x0079, 0x7048, 0xc084, 0x704a, 0x2009, 0x07d0, 0x080c,
+	0x8567, 0x9006, 0x009e, 0x00ce, 0x00de, 0x0005, 0x9085, 0x0001,
+	0x0cc8, 0x0026, 0x00e6, 0x2071, 0x19e6, 0x7048, 0xd084, 0x01d8,
+	0x713c, 0x81ff, 0x01c0, 0x2071, 0x0100, 0x9188, 0x0008, 0x2114,
+	0x928e, 0x0006, 0x1138, 0x7014, 0x9084, 0x1984, 0x9085, 0x0012,
+	0x7016, 0x0048, 0x928e, 0x0009, 0x0db0, 0x7014, 0x9084, 0x1984,
+	0x9085, 0x0016, 0x7016, 0x00ee, 0x002e, 0x0005, 0x00b6, 0x00e6,
+	0x00d6, 0x00c6, 0x0066, 0x0056, 0x0046, 0x0006, 0x0126, 0x2091,
+	0x8000, 0x6010, 0x2058, 0xbca0, 0x2071, 0x19e6, 0x7018, 0x2058,
+	0x8bff, 0x0190, 0xb8a0, 0x9406, 0x0118, 0xb854, 0x2058, 0x0cc0,
+	0x6014, 0x0096, 0x2048, 0xac6c, 0xad70, 0xae78, 0x009e, 0x080c,
+	0x673a, 0x0110, 0x9085, 0x0001, 0x012e, 0x000e, 0x004e, 0x005e,
+	0x006e, 0x00ce, 0x00de, 0x00ee, 0x00be, 0x0005, 0x080c, 0x9c61,
+	0x7003, 0x1200, 0x7838, 0x7012, 0x783c, 0x7016, 0x00c6, 0x7820,
+	0x9086, 0x0004, 0x1148, 0x7810, 0x9005, 0x0130, 0x00b6, 0x2058,
+	0xb810, 0xb914, 0x00be, 0x0020, 0x2061, 0x1800, 0x607c, 0x6180,
+	0x9084, 0x00ff, 0x700a, 0x710e, 0x00ce, 0x60c3, 0x002c, 0x0804,
+	0xa248, 0x080c, 0x9c61, 0x7003, 0x0f00, 0x7808, 0xd09c, 0x0128,
+	0xb810, 0x9084, 0x00ff, 0x700a, 0xb814, 0x700e, 0x60c3, 0x0008,
+	0x0804, 0xa248, 0x0156, 0x080c, 0x9cac, 0x7003, 0x0200, 0x080c,
+	0x85c2, 0x20a9, 0x0006, 0x2011, 0xfff4, 0x2019, 0xfff5, 0x9ef0,
+	0x0002, 0x2305, 0x2072, 0x8e70, 0x2205, 0x2072, 0x8e70, 0x9398,
+	0x0002, 0x9290, 0x0002, 0x1f04, 0xa4b1, 0x60c3, 0x001c, 0x015e,
+	0x0804, 0xa248, 0x0016, 0x0026, 0x080c, 0x9c88, 0x080c, 0x9c9a,
+	0x9e80, 0x0004, 0x20e9, 0x0000, 0x20a0, 0x7814, 0x0096, 0x2048,
+	0xa800, 0x2048, 0xa860, 0x20e0, 0xa85c, 0x9080, 0x0021, 0x2098,
+	0x009e, 0x7808, 0x9088, 0x0002, 0x21a8, 0x9192, 0x0010, 0x1250,
+	0x4003, 0x9080, 0x0004, 0x8003, 0x60c2, 0x080c, 0xa248, 0x002e,
+	0x001e, 0x0005, 0x20a9, 0x0010, 0x4003, 0x080c, 0xab17, 0x20a1,
+	0x0240, 0x22a8, 0x4003, 0x0c68, 0x080c, 0x9c61, 0x7003, 0x6200,
+	0x7808, 0x700e, 0x60c3, 0x0008, 0x0804, 0xa248, 0x0016, 0x0026,
+	0x080c, 0x9c61, 0x20e9, 0x0000, 0x20a1, 0x024c, 0x7814, 0x0096,
+	0x2048, 0xa800, 0x2048, 0xa860, 0x20e0, 0xa85c, 0x9080, 0x0023,
+	0x2098, 0x009e, 0x7808, 0x9088, 0x0002, 0x21a8, 0x4003, 0x8003,
+	0x60c2, 0x080c, 0xa248, 0x002e, 0x001e, 0x0005, 0x00e6, 0x00c6,
+	0x0006, 0x0126, 0x2091, 0x8000, 0x2071, 0x19e6, 0x700c, 0x2060,
+	0x8cff, 0x0178, 0x080c, 0xcd50, 0x1110, 0x080c, 0xb824, 0x600c,
+	0x0006, 0x080c, 0xcfbc, 0x080c, 0xae71, 0x080c, 0xa693, 0x00ce,
+	0x0c78, 0x2c00, 0x700e, 0x700a, 0x012e, 0x000e, 0x00ce, 0x00ee,
+	0x0005, 0x0126, 0x0156, 0x00f6, 0x00e6, 0x00d6, 0x00c6, 0x0066,
+	0x0026, 0x0016, 0x0006, 0x2091, 0x8000, 0x2001, 0x180c, 0x200c,
+	0x918c, 0xe7ff, 0x2102, 0x2069, 0x0100, 0x2079, 0x0140, 0x2071,
+	0x19e6, 0x7024, 0x2060, 0x8cff, 0x01f8, 0x080c, 0xa274, 0x6ac0,
+	0x68c3, 0x0000, 0x080c, 0x8562, 0x00c6, 0x2061, 0x0100, 0x080c,
+	0xac68, 0x00ce, 0x20a9, 0x01f4, 0x0461, 0x2009, 0x0013, 0x080c,
+	0xaeec, 0x000e, 0x001e, 0x002e, 0x006e, 0x00ce, 0x00de, 0x00ee,
+	0x00fe, 0x015e, 0x012e, 0x0005, 0x2001, 0x1800, 0x2004, 0x9096,
+	0x0001, 0x0d78, 0x9096, 0x0004, 0x0d60, 0x080c, 0x8562, 0x6814,
+	0x9084, 0x0001, 0x0110, 0x68a7, 0x95f5, 0x6817, 0x0008, 0x68c3,
+	0x0000, 0x2011, 0x5e8c, 0x080c, 0x84dc, 0x20a9, 0x01f4, 0x0009,
+	0x08c0, 0x6824, 0xd094, 0x0140, 0x6827, 0x0004, 0x7804, 0x9084,
+	0x4000, 0x190c, 0x2d01, 0x0090, 0xd084, 0x0118, 0x6827, 0x0001,
+	0x0010, 0x1f04, 0xa599, 0x7804, 0x9084, 0x1000, 0x0138, 0x2001,
+	0x0100, 0x080c, 0x2cf1, 0x9006, 0x080c, 0x2cf1, 0x0005, 0x0126,
+	0x0156, 0x00f6, 0x00e6, 0x00d6, 0x00c6, 0x0066, 0x0026, 0x0016,
+	0x0006, 0x2091, 0x8000, 0x2001, 0x180c, 0x200c, 0x918c, 0xdbff,
+	0x2102, 0x2069, 0x0100, 0x2079, 0x0140, 0x2071, 0x19e6, 0x703c,
+	0x2060, 0x8cff, 0x0904, 0xa649, 0x9386, 0x0002, 0x1128, 0x6814,
+	0x9084, 0x0002, 0x0904, 0xa649, 0x68af, 0x95f5, 0x6817, 0x0010,
+	0x2009, 0x00fa, 0x8109, 0x1df0, 0x69c6, 0x68cb, 0x0008, 0x080c,
+	0x856f, 0x080c, 0x1ffc, 0x0046, 0x2009, 0x00a5, 0x080c, 0x0e51,
+	0x2021, 0x0169, 0x2404, 0x9084, 0x000f, 0x9086, 0x0004, 0x11f8,
+	0x68af, 0x95f5, 0x68c6, 0x68cb, 0x0008, 0x00e6, 0x00f6, 0x2079,
+	0x0090, 0x2071, 0x1a65, 0x6814, 0x9084, 0x1984, 0x9085, 0x0012,
+	0x6816, 0x782b, 0x0008, 0x7003, 0x0000, 0x00fe, 0x00ee, 0x9386,
+	0x0002, 0x1128, 0x7884, 0x9005, 0x1110, 0x7887, 0x0001, 0x2001,
+	0x1980, 0x200c, 0x080c, 0x0e51, 0x004e, 0x20a9, 0x03e8, 0x6824,
+	0xd094, 0x0140, 0x6827, 0x0004, 0x7804, 0x9084, 0x4000, 0x190c,
+	0x2d01, 0x0090, 0xd08c, 0x0118, 0x6827, 0x0002, 0x0010, 0x1f04,
+	0xa61f, 0x7804, 0x9084, 0x1000, 0x0138, 0x2001, 0x0100, 0x080c,
+	0x2cf1, 0x9006, 0x080c, 0x2cf1, 0x6827, 0x4000, 0x6824, 0x83ff,
+	0x1140, 0x2009, 0x0049, 0x6020, 0x9086, 0x0009, 0x0110, 0x080c,
+	0xaeec, 0x000e, 0x001e, 0x002e, 0x006e, 0x00ce, 0x00de, 0x00ee,
+	0x00fe, 0x015e, 0x012e, 0x0005, 0x00d6, 0x0126, 0x2091, 0x8000,
+	0x2069, 0x19e6, 0x6a06, 0x012e, 0x00de, 0x0005, 0x00d6, 0x0126,
+	0x2091, 0x8000, 0x2069, 0x19e6, 0x6a32, 0x012e, 0x00de, 0x0005,
+	0x080c, 0x9e1a, 0x7854, 0x7032, 0x7042, 0x7047, 0x1000, 0x00f8,
+	0x080c, 0x9e1a, 0x7854, 0x7032, 0x7042, 0x7047, 0x4000, 0x00b8,
+	0x080c, 0x9e1a, 0x7854, 0x7032, 0x7042, 0x7047, 0x2000, 0x0078,
+	0x080c, 0x9e1a, 0x7854, 0x7032, 0x7042, 0x7047, 0x0400, 0x0038,
+	0x080c, 0x9e1a, 0x7854, 0x7032, 0x7042, 0x7047, 0x0200, 0x60c3,
+	0x0020, 0x0804, 0xa248, 0x00e6, 0x2071, 0x19e6, 0x7020, 0x9005,
+	0x0110, 0x8001, 0x7022, 0x00ee, 0x0005, 0x00f6, 0x00e6, 0x00d6,
+	0x00c6, 0x0076, 0x0066, 0x0006, 0x0126, 0x2091, 0x8000, 0x2071,
+	0x19e6, 0x7614, 0x2660, 0x2678, 0x2039, 0x0001, 0x87ff, 0x0904,
+	0xa738, 0x8cff, 0x0904, 0xa738, 0x6020, 0x9086, 0x0006, 0x1904,
+	0xa733, 0x88ff, 0x0138, 0x2800, 0x9c06, 0x1904, 0xa733, 0x2039,
+	0x0000, 0x0050, 0x6010, 0x9b06, 0x1904, 0xa733, 0x85ff, 0x0120,
+	0x6054, 0x9106, 0x1904, 0xa733, 0x7024, 0x9c06, 0x15b0, 0x2069,
+	0x0100, 0x68c0, 0x9005, 0x1160, 0x6824, 0xd084, 0x0148, 0x6827,
+	0x0001, 0x080c, 0x8562, 0x080c, 0xa7bd, 0x7027, 0x0000, 0x0428,
+	0x080c, 0x8562, 0x6820, 0xd0b4, 0x0110, 0x68a7, 0x95f5, 0x6817,
+	0x0008, 0x68c3, 0x0000, 0x080c, 0xa7bd, 0x7027, 0x0000, 0x0036,
 	0x2069, 0x0140, 0x6b04, 0x9384, 0x1000, 0x0138, 0x2001, 0x0100,
-	0x080c, 0x2cef, 0x9006, 0x080c, 0x2cef, 0x2069, 0x0100, 0x6824,
-	0xd084, 0x0110, 0x6827, 0x0001, 0x003e, 0x700c, 0x9c36, 0x1110,
-	0x660c, 0x760e, 0x7008, 0x9c36, 0x1140, 0x2c00, 0x9f36, 0x0118,
-	0x2f00, 0x700a, 0x0010, 0x700b, 0x0000, 0x660c, 0x0066, 0x2c00,
-	0x9f06, 0x0110, 0x7e0e, 0x0008, 0x2678, 0x600f, 0x0000, 0x080c,
-	0xcd2a, 0x1158, 0x080c, 0x31e8, 0x080c, 0xcd3b, 0x11f0, 0x080c,
-	0xb813, 0x00d8, 0x080c, 0xa7bc, 0x08c0, 0x080c, 0xcd3b, 0x1118,
-	0x080c, 0xb813, 0x0090, 0x6014, 0x2048, 0x080c, 0xcb33, 0x0168,
+	0x080c, 0x2cf1, 0x9006, 0x080c, 0x2cf1, 0x2069, 0x0100, 0x6824,
+	0xd084, 0x0110, 0x6827, 0x0001, 0x003e, 0x7014, 0x9c36, 0x1110,
+	0x660c, 0x7616, 0x7010, 0x9c36, 0x1140, 0x2c00, 0x9f36, 0x0118,
+	0x2f00, 0x7012, 0x0010, 0x7013, 0x0000, 0x660c, 0x0066, 0x2c00,
+	0x9f06, 0x0110, 0x7e0e, 0x0008, 0x2678, 0x89ff, 0x1168, 0x600f,
+	0x0000, 0x6014, 0x0096, 0x2048, 0x080c, 0xcb48, 0x0110, 0x080c,
+	0xe572, 0x009e, 0x080c, 0xaea2, 0x080c, 0xa693, 0x88ff, 0x1190,
+	0x00ce, 0x0804, 0xa6ae, 0x2c78, 0x600c, 0x2060, 0x0804, 0xa6ae,
+	0x9006, 0x012e, 0x000e, 0x006e, 0x007e, 0x00ce, 0x00de, 0x00ee,
+	0x00fe, 0x0005, 0x601b, 0x0000, 0x00ce, 0x98c5, 0x0001, 0x0c88,
+	0x00f6, 0x00e6, 0x00d6, 0x0096, 0x00c6, 0x0066, 0x0026, 0x0006,
+	0x0126, 0x2091, 0x8000, 0x2071, 0x19e6, 0x7638, 0x2660, 0x2678,
+	0x8cff, 0x0904, 0xa7ac, 0x6020, 0x9086, 0x0006, 0x1904, 0xa7a7,
+	0x87ff, 0x0128, 0x2700, 0x9c06, 0x1904, 0xa7a7, 0x0040, 0x6010,
+	0x9b06, 0x15e8, 0x85ff, 0x0118, 0x6054, 0x9106, 0x15c0, 0x703c,
+	0x9c06, 0x1168, 0x0036, 0x2019, 0x0001, 0x080c, 0xa5b7, 0x7033,
+	0x0000, 0x9006, 0x703e, 0x7042, 0x7046, 0x704a, 0x003e, 0x7038,
+	0x9c36, 0x1110, 0x660c, 0x763a, 0x7034, 0x9c36, 0x1140, 0x2c00,
+	0x9f36, 0x0118, 0x2f00, 0x7036, 0x0010, 0x7037, 0x0000, 0x660c,
+	0x0066, 0x2c00, 0x9f06, 0x0110, 0x7e0e, 0x0008, 0x2678, 0x600f,
+	0x0000, 0x6014, 0x2048, 0x080c, 0xcb48, 0x0110, 0x080c, 0xe572,
+	0x080c, 0xaea2, 0x87ff, 0x1198, 0x00ce, 0x0804, 0xa758, 0x2c78,
+	0x600c, 0x2060, 0x0804, 0xa758, 0x9006, 0x012e, 0x000e, 0x002e,
+	0x006e, 0x00ce, 0x009e, 0x00de, 0x00ee, 0x00fe, 0x0005, 0x601b,
+	0x0000, 0x00ce, 0x97bd, 0x0001, 0x0c80, 0x00e6, 0x2071, 0x19e6,
+	0x2001, 0x1800, 0x2004, 0x9086, 0x0002, 0x1118, 0x7007, 0x0005,
+	0x0010, 0x7007, 0x0000, 0x00ee, 0x0005, 0x00f6, 0x00e6, 0x00c6,
+	0x0066, 0x0026, 0x0006, 0x0126, 0x2091, 0x8000, 0x2071, 0x19e6,
+	0x2c10, 0x7638, 0x2660, 0x2678, 0x8cff, 0x0540, 0x2200, 0x9c06,
+	0x1508, 0x7038, 0x9c36, 0x1110, 0x660c, 0x763a, 0x7034, 0x9c36,
+	0x1140, 0x2c00, 0x9f36, 0x0118, 0x2f00, 0x7036, 0x0010, 0x7037,
+	0x0000, 0x660c, 0x2c00, 0x9f06, 0x0110, 0x7e0e, 0x0008, 0x2678,
+	0x600f, 0x0000, 0x6004, 0x9086, 0x0040, 0x090c, 0x957b, 0x9085,
+	0x0001, 0x0020, 0x2c78, 0x600c, 0x2060, 0x08b0, 0x012e, 0x000e,
+	0x002e, 0x006e, 0x00ce, 0x00ee, 0x00fe, 0x0005, 0x0096, 0x00f6,
+	0x00e6, 0x00d6, 0x00c6, 0x0066, 0x0026, 0x0006, 0x0126, 0x2091,
+	0x8000, 0x2071, 0x19e6, 0x760c, 0x2660, 0x2678, 0x8cff, 0x0904,
+	0xa8a3, 0x6010, 0x00b6, 0x2058, 0xb8a0, 0x00be, 0x9206, 0x1904,
+	0xa89e, 0x7024, 0x9c06, 0x1520, 0x2069, 0x0100, 0x68c0, 0x9005,
+	0x0904, 0xa875, 0x080c, 0xa274, 0x68c3, 0x0000, 0x080c, 0xa7bd,
+	0x7027, 0x0000, 0x0036, 0x2069, 0x0140, 0x6b04, 0x9384, 0x1000,
+	0x0138, 0x2001, 0x0100, 0x080c, 0x2cf1, 0x9006, 0x080c, 0x2cf1,
+	0x2069, 0x0100, 0x6824, 0xd084, 0x0110, 0x6827, 0x0001, 0x003e,
+	0x700c, 0x9c36, 0x1110, 0x660c, 0x760e, 0x7008, 0x9c36, 0x1140,
+	0x2c00, 0x9f36, 0x0118, 0x2f00, 0x700a, 0x0010, 0x700b, 0x0000,
+	0x660c, 0x0066, 0x2c00, 0x9f06, 0x0110, 0x7e0e, 0x0008, 0x2678,
+	0x600f, 0x0000, 0x080c, 0xcd3f, 0x1180, 0x080c, 0x31ea, 0x080c,
+	0xcd50, 0x1518, 0x080c, 0xb824, 0x0400, 0x080c, 0xa7bd, 0x6824,
+	0xd084, 0x09b0, 0x6827, 0x0001, 0x0898, 0x080c, 0xcd50, 0x1118,
+	0x080c, 0xb824, 0x0090, 0x6014, 0x2048, 0x080c, 0xcb48, 0x0168,
+	0x6020, 0x9086, 0x0003, 0x1508, 0xa867, 0x0103, 0xab7a, 0xa877,
+	0x0000, 0x080c, 0x6c7a, 0x080c, 0xcd33, 0x080c, 0xcfbc, 0x080c,
+	0xaea2, 0x080c, 0xa693, 0x00ce, 0x0804, 0xa81e, 0x2c78, 0x600c,
+	0x2060, 0x0804, 0xa81e, 0x012e, 0x000e, 0x002e, 0x006e, 0x00ce,
+	0x00de, 0x00ee, 0x00fe, 0x009e, 0x0005, 0x6020, 0x9086, 0x0006,
+	0x1d20, 0x080c, 0xe572, 0x0c08, 0x00d6, 0x080c, 0x9cac, 0x7003,
+	0x0200, 0x7007, 0x0014, 0x60c3, 0x0014, 0x20e1, 0x0001, 0x2099,
+	0x1988, 0x20e9, 0x0000, 0x20a1, 0x0250, 0x20a9, 0x0004, 0x4003,
+	0x7023, 0x0004, 0x7027, 0x7878, 0x080c, 0xa248, 0x00de, 0x0005,
+	0x080c, 0x9cac, 0x700b, 0x0800, 0x7814, 0x9084, 0xff00, 0x700e,
+	0x7814, 0x9084, 0x00ff, 0x7022, 0x782c, 0x7026, 0x7858, 0x9084,
+	0x00ff, 0x9085, 0x0200, 0x7002, 0x7858, 0x9084, 0xff00, 0x8007,
+	0x7006, 0x60c2, 0x0804, 0xa248, 0x00b6, 0x00d6, 0x0016, 0x00d6,
+	0x2f68, 0x2009, 0x0035, 0x080c, 0xd1c2, 0x00de, 0x1904, 0xa951,
+	0x080c, 0x9c61, 0x7003, 0x1300, 0x782c, 0x080c, 0xaa53, 0x2068,
+	0x6820, 0x9086, 0x0003, 0x0560, 0x7810, 0x2058, 0xbaa0, 0x080c,
+	0xaddb, 0x11d8, 0x9286, 0x007e, 0x1128, 0x700b, 0x00ff, 0x700f,
+	0xfffe, 0x0498, 0x9286, 0x007f, 0x1128, 0x700b, 0x00ff, 0x700f,
+	0xfffd, 0x0458, 0x9284, 0xff80, 0x0180, 0x9286, 0x0080, 0x1128,
+	0x700b, 0x00ff, 0x700f, 0xfffc, 0x0400, 0x92d8, 0x1000, 0x2b5c,
+	0xb810, 0x700a, 0xb814, 0x700e, 0x00c0, 0x6098, 0x700e, 0x00a8,
+	0x080c, 0xaddb, 0x1130, 0x7810, 0x2058, 0xb8a0, 0x9082, 0x007e,
+	0x0250, 0x00d6, 0x2069, 0x181f, 0x2d04, 0x700a, 0x8d68, 0x2d04,
+	0x700e, 0x00de, 0x0010, 0x6034, 0x700e, 0x7838, 0x7012, 0x783c,
+	0x7016, 0x60c3, 0x000c, 0x001e, 0x00de, 0x080c, 0xa248, 0x00be,
+	0x0005, 0x781b, 0x0001, 0x7803, 0x0006, 0x001e, 0x00de, 0x00be,
+	0x0005, 0x792c, 0x9180, 0x0008, 0x200c, 0x9186, 0x0006, 0x01c0,
+	0x9186, 0x0003, 0x0904, 0xa9cb, 0x9186, 0x0005, 0x0904, 0xa9b4,
+	0x9186, 0x0004, 0x05d8, 0x9186, 0x0008, 0x0904, 0xa9bc, 0x7807,
+	0x0037, 0x782f, 0x0003, 0x7817, 0x1700, 0x080c, 0xaa30, 0x0005,
+	0x080c, 0xa9f1, 0x00d6, 0x0026, 0x792c, 0x2168, 0x2009, 0x4000,
+	0x6800, 0x0002, 0xa995, 0xa9a0, 0xa997, 0xa9a0, 0xa99c, 0xa995,
+	0xa995, 0xa9a0, 0xa9a0, 0xa9a0, 0xa9a0, 0xa995, 0xa995, 0xa995,
+	0xa995, 0xa995, 0xa9a0, 0xa995, 0xa9a0, 0x080c, 0x0dd5, 0x6824,
+	0xd0e4, 0x0110, 0xd0cc, 0x0110, 0x900e, 0x0010, 0x2009, 0x2000,
+	0x682c, 0x7022, 0x6830, 0x7026, 0x0804, 0xa9ea, 0x080c, 0xa9f1,
+	0x00d6, 0x0026, 0x792c, 0x2168, 0x2009, 0x4000, 0x6a00, 0x9286,
+	0x0002, 0x1108, 0x900e, 0x04b0, 0x04e1, 0x00d6, 0x0026, 0x792c,
+	0x2168, 0x2009, 0x4000, 0x0470, 0x04a1, 0x00d6, 0x0026, 0x792c,
+	0x2168, 0x2009, 0x4000, 0x9286, 0x0005, 0x0118, 0x9286, 0x0002,
+	0x1108, 0x900e, 0x00f8, 0x0429, 0x00d6, 0x0026, 0x792c, 0x2168,
+	0x6814, 0x0096, 0x2048, 0xa9ac, 0xa834, 0x9112, 0xa9b0, 0xa838,
+	0x009e, 0x9103, 0x7022, 0x7226, 0x792c, 0x9180, 0x0000, 0x2004,
+	0x908e, 0x0002, 0x0130, 0x908e, 0x0004, 0x0118, 0x2009, 0x4000,
+	0x0008, 0x900e, 0x712a, 0x60c3, 0x0018, 0x002e, 0x00de, 0x0804,
+	0xa248, 0x00b6, 0x0036, 0x0046, 0x0056, 0x0066, 0x080c, 0x9cac,
+	0x9006, 0x7003, 0x0200, 0x7938, 0x710a, 0x793c, 0x710e, 0x7810,
+	0x2058, 0xb8a0, 0x080c, 0xaddb, 0x1118, 0x9092, 0x007e, 0x0268,
+	0x00d6, 0x2069, 0x181f, 0x2d2c, 0x8d68, 0x2d34, 0x90d8, 0x1000,
+	0x2b5c, 0xbb10, 0xbc14, 0x00de, 0x0028, 0x901e, 0x6498, 0x2029,
+	0x0000, 0x6634, 0x782c, 0x9080, 0x0008, 0x2004, 0x9086, 0x0003,
+	0x1128, 0x7512, 0x7616, 0x731a, 0x741e, 0x0020, 0x7312, 0x7416,
+	0x751a, 0x761e, 0x006e, 0x005e, 0x004e, 0x003e, 0x00be, 0x0005,
+	0x080c, 0x9cac, 0x7003, 0x0100, 0x782c, 0x700a, 0x7814, 0x700e,
+	0x700e, 0x60c3, 0x0008, 0x0804, 0xa248, 0x080c, 0x9c58, 0x7003,
+	0x1400, 0x7838, 0x700a, 0x0079, 0x783c, 0x700e, 0x782c, 0x7012,
+	0x7830, 0x7016, 0x7834, 0x9084, 0x00ff, 0x8007, 0x701a, 0x60c3,
+	0x0010, 0x0804, 0xa248, 0x00e6, 0x2071, 0x0240, 0x0006, 0x00f6,
+	0x2078, 0x7810, 0x00b6, 0x2058, 0xb8cc, 0xd084, 0x0120, 0x7848,
+	0x702a, 0x7844, 0x702e, 0x00be, 0x00fe, 0x000e, 0x00ee, 0x0005,
+	0x080c, 0x9ca3, 0x7003, 0x0100, 0x782c, 0x700a, 0x7814, 0x700e,
+	0x60c3, 0x0008, 0x0804, 0xa248, 0x0021, 0x60c3, 0x0000, 0x0804,
+	0xa248, 0x00d6, 0x080c, 0xab2c, 0xb810, 0x9085, 0x0300, 0x7002,
+	0xb814, 0x7006, 0x2069, 0x1800, 0x687c, 0x700a, 0x6880, 0x700e,
+	0x7013, 0x0819, 0x080c, 0xa236, 0x721a, 0x2f10, 0x7222, 0x7a08,
+	0x7226, 0x2071, 0x024c, 0x00de, 0x0005, 0x00a9, 0x7914, 0x712a,
+	0x60c3, 0x0000, 0x60a7, 0x9575, 0x0026, 0x080c, 0x2ba7, 0x0228,
+	0x2011, 0x0101, 0x2204, 0xc0c5, 0x2012, 0x002e, 0x080c, 0xa26b,
+	0x080c, 0x8559, 0x0005, 0x0036, 0x0096, 0x00d6, 0x00e6, 0x7858,
+	0x2048, 0xaa7c, 0x9296, 0x00c0, 0x9294, 0xfffd, 0xaa7e, 0xaa80,
+	0x9294, 0x0300, 0xaa82, 0xa96c, 0x9194, 0x00ff, 0xab74, 0x9384,
+	0x00ff, 0x908d, 0xc200, 0xa96e, 0x9384, 0xff00, 0x9215, 0xaa76,
+	0xa870, 0xaa78, 0xa87a, 0xaa72, 0x00d6, 0x2069, 0x0200, 0x080c,
+	0xab2c, 0x00de, 0x20e9, 0x0000, 0x20a1, 0x0240, 0x20a9, 0x000a,
+	0xa860, 0x20e0, 0xa85c, 0x9080, 0x001b, 0x2098, 0x4003, 0x60a3,
+	0x0035, 0xaa68, 0x9294, 0x7000, 0x9286, 0x3000, 0x0110, 0x60a3,
+	0x0037, 0x00ee, 0x00de, 0x009e, 0x003e, 0x0005, 0x900e, 0x7814,
+	0x0096, 0x2048, 0xa87c, 0xd0fc, 0x01c0, 0x9084, 0x0003, 0x11a8,
+	0x2001, 0x180c, 0x2004, 0xd0bc, 0x0180, 0x7824, 0xd0cc, 0x1168,
+	0xd0c4, 0x1158, 0xa8a8, 0x9005, 0x1140, 0x2001, 0x180c, 0x200c,
+	0xc1d5, 0x2102, 0x2009, 0x19b1, 0x210c, 0x009e, 0x918d, 0x0092,
+	0x0010, 0x2009, 0x0096, 0x60ab, 0x0036, 0x6116, 0x0005, 0x2009,
+	0x0009, 0x00a0, 0x2009, 0x000a, 0x0088, 0x2009, 0x000b, 0x0070,
+	0x2009, 0x000c, 0x0058, 0x2009, 0x000d, 0x0040, 0x2009, 0x000e,
+	0x0028, 0x2009, 0x000f, 0x0010, 0x2009, 0x0008, 0x6912, 0x0005,
+	0x080c, 0x9c61, 0x0016, 0x0026, 0x0096, 0x00d6, 0x7814, 0x2048,
+	0x7013, 0x0138, 0x2001, 0x1837, 0x2004, 0x9084, 0x0028, 0x1138,
+	0x2001, 0x197b, 0x2004, 0x9086, 0xaaaa, 0x1904, 0xabd1, 0x7003,
+	0x5400, 0x00c6, 0x2061, 0x1800, 0x607c, 0x9084, 0x00ff, 0xa998,
+	0x810f, 0x918c, 0xff00, 0x9105, 0x700a, 0x6080, 0x700e, 0xa998,
+	0x918c, 0xff00, 0x7112, 0x20a9, 0x0004, 0x2009, 0x1805, 0x2e10,
+	0x9290, 0x0006, 0x2104, 0x2012, 0x8108, 0x8210, 0x1f04, 0xab62,
+	0x20a9, 0x0004, 0x2009, 0x1801, 0x2104, 0x2012, 0x8108, 0x8210,
+	0x1f04, 0xab6c, 0xa860, 0x20e0, 0xa85c, 0x9080, 0x0029, 0x2098,
+	0x2009, 0x0006, 0x20a9, 0x0001, 0x4002, 0x8007, 0x2012, 0x8210,
+	0x8109, 0x1dc0, 0x00d6, 0x2069, 0x0200, 0x080c, 0xab17, 0x00de,
+	0x2071, 0x0240, 0x2011, 0x0240, 0x2009, 0x0002, 0x20a9, 0x0001,
+	0x4002, 0x8007, 0x2012, 0x8210, 0x8109, 0x1dc0, 0x2009, 0x0008,
+	0x20a9, 0x0001, 0x4002, 0x8007, 0x2012, 0x8210, 0x8109, 0x1dc0,
+	0xa85c, 0x9080, 0x0031, 0x2098, 0x2009, 0x0008, 0x20a9, 0x0001,
+	0x4002, 0x8007, 0x2012, 0x8210, 0x8109, 0x1dc0, 0x00ce, 0x60c3,
+	0x004c, 0x60a3, 0x0056, 0x60a7, 0x9575, 0x2001, 0x1837, 0x2004,
+	0x9084, 0x0028, 0x1168, 0x080c, 0x73a5, 0x0150, 0x6028, 0xc0bd,
+	0x602a, 0x6014, 0x9084, 0x1804, 0x9085, 0x0029, 0x6016, 0x0010,
+	0x080c, 0xa248, 0x080c, 0x8559, 0x00de, 0x009e, 0x002e, 0x001e,
+	0x0005, 0x00e6, 0x2071, 0x0240, 0x2001, 0x2200, 0x9085, 0x00ff,
+	0x7002, 0x7007, 0xffff, 0x2071, 0x0100, 0x709b, 0x00ff, 0x00ee,
+	0x0804, 0xab47, 0x080c, 0x9c61, 0x0016, 0x0026, 0x0096, 0x00d6,
+	0x7814, 0x2048, 0x7013, 0x0138, 0x7003, 0x5500, 0x00c6, 0xa89c,
+	0x9084, 0x00ff, 0xa998, 0x810f, 0x918c, 0xff00, 0x9105, 0x700a,
+	0xa99c, 0x918c, 0xff00, 0xa8a0, 0x9084, 0x00ff, 0x9105, 0x700e,
+	0xa998, 0x918c, 0xff00, 0x2061, 0x1800, 0x607c, 0x9084, 0x00ff,
+	0x910d, 0x7112, 0x6180, 0x7116, 0x2009, 0x0008, 0xa860, 0x20e0,
+	0xa85c, 0x9080, 0x0029, 0x2098, 0x2e10, 0x9290, 0x0006, 0x20a9,
+	0x0001, 0x4002, 0x8007, 0x2012, 0x8210, 0x8109, 0x1dc0, 0x20a9,
+	0x0004, 0x2009, 0x1805, 0x2104, 0x2012, 0x8108, 0x8210, 0x1f04,
+	0xac23, 0x20a9, 0x0002, 0x2009, 0x1801, 0x2104, 0x2012, 0x8108,
+	0x8210, 0x1f04, 0xac2d, 0x00d6, 0x0016, 0x2069, 0x0200, 0x080c,
+	0xab17, 0x001e, 0x00de, 0x2071, 0x0240, 0x20a9, 0x0002, 0x2009,
+	0x1803, 0x2011, 0x0240, 0x2104, 0x2012, 0x8108, 0x8210, 0x1f04,
+	0xac43, 0x2009, 0x0008, 0x4002, 0x8007, 0x2012, 0x8210, 0x8109,
+	0x1dd0, 0x9006, 0x20a9, 0x0008, 0x2012, 0x8210, 0x1f04, 0xac54,
+	0x00ce, 0x60c3, 0x004c, 0x60a3, 0x0056, 0x60a7, 0x9575, 0x080c,
+	0xa248, 0x080c, 0x8559, 0x00de, 0x009e, 0x002e, 0x001e, 0x0005,
+	0x00d6, 0x9290, 0x0018, 0x8214, 0x20e9, 0x0000, 0x2069, 0x0200,
+	0x6813, 0x0000, 0x22a8, 0x9284, 0x00e0, 0x0128, 0x20a9, 0x0020,
+	0x9292, 0x0020, 0x0008, 0x9016, 0x20a1, 0x0240, 0x9006, 0x4004,
+	0x82ff, 0x0120, 0x6810, 0x8000, 0x6812, 0x0c60, 0x00de, 0x0005,
+	0x00d6, 0x0096, 0x6014, 0x2048, 0xa878, 0x6056, 0x9006, 0xa836,
+	0xa83a, 0xa99c, 0xa946, 0xa84a, 0x6023, 0x0003, 0x6007, 0x0040,
+	0x6003, 0x0003, 0x600b, 0xffff, 0xa817, 0x0001, 0xa842, 0xa83e,
+	0x2900, 0xa85a, 0xa813, 0x2090, 0x080c, 0x913e, 0x0126, 0x2091,
+	0x8000, 0x080c, 0x97b5, 0x012e, 0x009e, 0x00de, 0x0005, 0x00f6,
+	0x00e6, 0x00d6, 0x00c6, 0x00a6, 0x0096, 0x0066, 0x0126, 0x2091,
+	0x8000, 0x2071, 0x19e6, 0x760c, 0x2660, 0x2678, 0x8cff, 0x0904,
+	0xad3b, 0x7024, 0x9c06, 0x1520, 0x2069, 0x0100, 0x68c0, 0x9005,
+	0x0904, 0xad0d, 0x080c, 0xa274, 0x68c3, 0x0000, 0x080c, 0xa7bd,
+	0x7027, 0x0000, 0x0036, 0x2069, 0x0140, 0x6b04, 0x9384, 0x1000,
+	0x0138, 0x2001, 0x0100, 0x080c, 0x2cf1, 0x9006, 0x080c, 0x2cf1,
+	0x2069, 0x0100, 0x6824, 0xd084, 0x0110, 0x6827, 0x0001, 0x003e,
+	0x700c, 0x9c36, 0x1110, 0x660c, 0x760e, 0x7008, 0x9c36, 0x1140,
+	0x2c00, 0x9f36, 0x0118, 0x2f00, 0x700a, 0x0010, 0x700b, 0x0000,
+	0x660c, 0x0066, 0x2c00, 0x9f06, 0x0110, 0x7e0e, 0x0008, 0x2678,
+	0x600f, 0x0000, 0x080c, 0xcd3f, 0x1180, 0x080c, 0x31ea, 0x080c,
+	0xcd50, 0x1518, 0x080c, 0xb824, 0x0400, 0x080c, 0xa7bd, 0x6824,
+	0xd084, 0x09b0, 0x6827, 0x0001, 0x0898, 0x080c, 0xcd50, 0x1118,
+	0x080c, 0xb824, 0x0090, 0x6014, 0x2048, 0x080c, 0xcb48, 0x0168,
 	0x6020, 0x9086, 0x0003, 0x1520, 0xa867, 0x0103, 0xab7a, 0xa877,
-	0x0000, 0x080c, 0x6c81, 0x080c, 0xcd1e, 0x080c, 0xcfa2, 0x080c,
-	0xae92, 0x080c, 0xa692, 0x00ce, 0x0804, 0xacb3, 0x2c78, 0x600c,
-	0x2060, 0x0804, 0xacb3, 0x700f, 0x0000, 0x700b, 0x0000, 0x012e,
+	0x0000, 0x080c, 0x6c86, 0x080c, 0xcd33, 0x080c, 0xcfbc, 0x080c,
+	0xaea2, 0x080c, 0xa693, 0x00ce, 0x0804, 0xacbe, 0x2c78, 0x600c,
+	0x2060, 0x0804, 0xacbe, 0x700f, 0x0000, 0x700b, 0x0000, 0x012e,
 	0x006e, 0x009e, 0x00ae, 0x00ce, 0x00de, 0x00ee, 0x00fe, 0x0005,
-	0x6020, 0x9086, 0x0006, 0x1d08, 0x080c, 0xe551, 0x08f0, 0x00d6,
-	0x0156, 0x080c, 0x9cab, 0x7a14, 0x82ff, 0x0138, 0x7003, 0x0100,
+	0x6020, 0x9086, 0x0006, 0x1d08, 0x080c, 0xe572, 0x08f0, 0x00d6,
+	0x0156, 0x080c, 0x9cac, 0x7a14, 0x82ff, 0x0138, 0x7003, 0x0100,
 	0x700b, 0x0003, 0x60c3, 0x0008, 0x0490, 0x7003, 0x0200, 0x7007,
 	0x0000, 0x2069, 0x1800, 0x901e, 0x6800, 0x9086, 0x0004, 0x1110,
-	0xc38d, 0x0060, 0x080c, 0x73bc, 0x1110, 0xc3ad, 0x0008, 0xc3a5,
+	0xc38d, 0x0060, 0x080c, 0x73a5, 0x1110, 0xc3ad, 0x0008, 0xc3a5,
 	0x6adc, 0xd29c, 0x1110, 0xd2ac, 0x0108, 0xc39d, 0x730e, 0x080c,
-	0x85d9, 0x20a9, 0x0006, 0x2011, 0xfff4, 0x2019, 0xfff5, 0x2071,
+	0x85c2, 0x20a9, 0x0006, 0x2011, 0xfff4, 0x2019, 0xfff5, 0x2071,
 	0x0250, 0x2305, 0x2072, 0x8e70, 0x2205, 0x2072, 0x8e70, 0x9398,
-	0x0002, 0x9290, 0x0002, 0x1f04, 0xad71, 0x60c3, 0x0020, 0x080c,
-	0xa247, 0x015e, 0x00de, 0x0005, 0x0156, 0x080c, 0x9cab, 0x7a14,
+	0x0002, 0x9290, 0x0002, 0x1f04, 0xad81, 0x60c3, 0x0020, 0x080c,
+	0xa248, 0x015e, 0x00de, 0x0005, 0x0156, 0x080c, 0x9cac, 0x7a14,
 	0x82ff, 0x0168, 0x9286, 0xffff, 0x0118, 0x9282, 0x000e, 0x1238,
 	0x7003, 0x0100, 0x700b, 0x0003, 0x60c3, 0x0008, 0x0488, 0x7003,
-	0x0200, 0x7007, 0x001c, 0x700f, 0x0001, 0x2011, 0x19bd, 0x2204,
+	0x0200, 0x7007, 0x001c, 0x700f, 0x0001, 0x2011, 0x19bc, 0x2204,
 	0x8007, 0x701a, 0x8210, 0x2204, 0x8007, 0x701e, 0x0421, 0x1120,
 	0xb8a0, 0x9082, 0x007f, 0x0248, 0x2001, 0x181f, 0x2004, 0x7022,
 	0x2001, 0x1820, 0x2004, 0x7026, 0x0030, 0x2001, 0x1818, 0x2004,
 	0x9084, 0x00ff, 0x7026, 0x20a9, 0x0004, 0x20e1, 0x0001, 0x2099,
 	0x1805, 0x20e9, 0x0000, 0x20a1, 0x0256, 0x4003, 0x60c3, 0x001c,
-	0x015e, 0x0804, 0xa247, 0x0006, 0x2001, 0x1837, 0x2004, 0xd0ac,
-	0x000e, 0x0005, 0x2011, 0x0003, 0x080c, 0xa653, 0x2011, 0x0002,
-	0x080c, 0xa65d, 0x080c, 0xa540, 0x0036, 0x901e, 0x080c, 0xa5b6,
-	0x003e, 0x0005, 0x080c, 0x331e, 0x0188, 0x0016, 0x00b6, 0x00c6,
-	0x7010, 0x9085, 0x0020, 0x7012, 0x2009, 0x007e, 0x080c, 0x65ff,
+	0x015e, 0x0804, 0xa248, 0x0006, 0x2001, 0x1837, 0x2004, 0xd0ac,
+	0x000e, 0x0005, 0x2011, 0x0003, 0x080c, 0xa654, 0x2011, 0x0002,
+	0x080c, 0xa65e, 0x080c, 0xa541, 0x0036, 0x901e, 0x080c, 0xa5b7,
+	0x003e, 0x0005, 0x080c, 0x3320, 0x0188, 0x0016, 0x00b6, 0x00c6,
+	0x7010, 0x9085, 0x0020, 0x7012, 0x2009, 0x007e, 0x080c, 0x6608,
 	0xb85c, 0xc0ac, 0xb85e, 0x00ce, 0x00be, 0x001e, 0x0005, 0x2071,
 	0x188d, 0x7000, 0x9005, 0x0140, 0x2001, 0x0976, 0x2071, 0x1800,
 	0x7076, 0x707a, 0x706b, 0xffe0, 0x2071, 0x1800, 0x7074, 0x7056,
@@ -5379,42 +5381,42 @@ unsigned short risc_code01[] = {
 	0x601a, 0x6012, 0x6023, 0x0000, 0x6003, 0x0000, 0x601e, 0x6056,
 	0x605a, 0x6026, 0x602a, 0x602e, 0x6032, 0x6036, 0x603a, 0x603e,
 	0x6042, 0x602a, 0x2061, 0x1800, 0x6054, 0x8000, 0x6056, 0x9086,
-	0x0001, 0x0108, 0x0005, 0x0126, 0x2091, 0x8000, 0x080c, 0x968d,
+	0x0001, 0x0108, 0x0005, 0x0126, 0x2091, 0x8000, 0x080c, 0x9687,
 	0x012e, 0x0cc0, 0x0006, 0x6000, 0x9086, 0x0000, 0x01b0, 0x601c,
-	0xd084, 0x190c, 0x1a5e, 0x6017, 0x0000, 0x6023, 0x0007, 0x2001,
-	0x1986, 0x2004, 0x0006, 0x9082, 0x0051, 0x000e, 0x0208, 0x8004,
-	0x601a, 0x080c, 0xe80b, 0x6043, 0x0000, 0x000e, 0x0005, 0x00e6,
+	0xd084, 0x190c, 0x1a60, 0x6017, 0x0000, 0x6023, 0x0007, 0x2001,
+	0x1985, 0x2004, 0x0006, 0x9082, 0x0051, 0x000e, 0x0208, 0x8004,
+	0x601a, 0x080c, 0xe82c, 0x6043, 0x0000, 0x000e, 0x0005, 0x00e6,
 	0x0126, 0x2071, 0x1800, 0x2091, 0x8000, 0x7554, 0x9582, 0x0001,
 	0x0608, 0x7058, 0x2060, 0x6000, 0x9086, 0x0000, 0x0148, 0x9ce0,
 	0x0018, 0x7068, 0x9c02, 0x1208, 0x0cb0, 0x2061, 0x1cd0, 0x0c98,
 	0x6003, 0x0008, 0x8529, 0x7556, 0x9ca8, 0x0018, 0x7068, 0x9502,
 	0x1230, 0x755a, 0x9085, 0x0001, 0x012e, 0x00ee, 0x0005, 0x705b,
 	0x1cd0, 0x0cc0, 0x9006, 0x0cc0, 0x6020, 0x9084, 0x000f, 0x0002,
-	0xaeef, 0xaef8, 0xaf13, 0xaf2e, 0xd256, 0xd273, 0xd28e, 0xaeef,
-	0xaef8, 0x8d8b, 0xaf4a, 0xaeef, 0xaeef, 0xaeef, 0xaeef, 0x9186,
-	0x0013, 0x1128, 0x080c, 0x9588, 0x080c, 0x968d, 0x0005, 0x0005,
+	0xaeff, 0xaf08, 0xaf23, 0xaf3e, 0xd270, 0xd28d, 0xd2a8, 0xaeff,
+	0xaf08, 0x8d74, 0xaf5a, 0xaeff, 0xaeff, 0xaeff, 0xaeff, 0x9186,
+	0x0013, 0x1128, 0x080c, 0x957b, 0x080c, 0x9687, 0x0005, 0x0005,
 	0x0066, 0x6000, 0x90b2, 0x0016, 0x1a0c, 0x0dd5, 0x0013, 0x006e,
-	0x0005, 0xaf11, 0xb67f, 0xb85a, 0xaf11, 0xb8f0, 0xb22d, 0xaf11,
-	0xaf11, 0xb601, 0xbe55, 0xaf11, 0xaf11, 0xaf11, 0xaf11, 0xaf11,
-	0xaf11, 0x080c, 0x0dd5, 0x0066, 0x6000, 0x90b2, 0x0016, 0x1a0c,
-	0x0dd5, 0x0013, 0x006e, 0x0005, 0xaf2c, 0xc529, 0xaf2c, 0xaf2c,
-	0xaf2c, 0xaf2c, 0xaf2c, 0xaf2c, 0xc4ce, 0xc6ab, 0xaf2c, 0xc56a,
-	0xc5e9, 0xc56a, 0xc5e9, 0xaf2c, 0x080c, 0x0dd5, 0x6000, 0x9082,
-	0x0016, 0x1a0c, 0x0dd5, 0x6000, 0x0002, 0xaf48, 0xbe9c, 0xbf81,
-	0xc0b1, 0xc25c, 0xaf48, 0xaf48, 0xaf48, 0xbe70, 0xc45a, 0xc45d,
-	0xaf48, 0xaf48, 0xaf48, 0xaf48, 0xc48c, 0xaf48, 0xaf48, 0xaf48,
+	0x0005, 0xaf21, 0xb690, 0xb86b, 0xaf21, 0xb901, 0xb23d, 0xaf21,
+	0xaf21, 0xb612, 0xbe68, 0xaf21, 0xaf21, 0xaf21, 0xaf21, 0xaf21,
+	0xaf21, 0x080c, 0x0dd5, 0x0066, 0x6000, 0x90b2, 0x0016, 0x1a0c,
+	0x0dd5, 0x0013, 0x006e, 0x0005, 0xaf3c, 0xc53c, 0xaf3c, 0xaf3c,
+	0xaf3c, 0xaf3c, 0xaf3c, 0xaf3c, 0xc4e1, 0xc6be, 0xaf3c, 0xc57d,
+	0xc5fc, 0xc57d, 0xc5fc, 0xaf3c, 0x080c, 0x0dd5, 0x6000, 0x9082,
+	0x0016, 0x1a0c, 0x0dd5, 0x6000, 0x0002, 0xaf58, 0xbeaf, 0xbf94,
+	0xc0c4, 0xc26f, 0xaf58, 0xaf58, 0xaf58, 0xbe83, 0xc46d, 0xc470,
+	0xaf58, 0xaf58, 0xaf58, 0xaf58, 0xc49f, 0xaf58, 0xaf58, 0xaf58,
 	0x080c, 0x0dd5, 0x0066, 0x6000, 0x90b2, 0x0016, 0x1a0c, 0x0dd5,
-	0x0013, 0x006e, 0x0005, 0xaf63, 0xaf63, 0xafa6, 0xb045, 0xb0da,
-	0xaf63, 0xaf63, 0xaf63, 0xaf65, 0xaf63, 0xaf63, 0xaf63, 0xaf63,
-	0xaf63, 0xaf63, 0xaf63, 0x080c, 0x0dd5, 0x9186, 0x004c, 0x0588,
+	0x0013, 0x006e, 0x0005, 0xaf73, 0xaf73, 0xafb6, 0xb055, 0xb0ea,
+	0xaf73, 0xaf73, 0xaf73, 0xaf75, 0xaf73, 0xaf73, 0xaf73, 0xaf73,
+	0xaf73, 0xaf73, 0xaf73, 0x080c, 0x0dd5, 0x9186, 0x004c, 0x0588,
 	0x9186, 0x0003, 0x190c, 0x0dd5, 0x0096, 0x601c, 0xc0ed, 0x601e,
 	0x6003, 0x0003, 0x6106, 0x6014, 0x2048, 0xa87c, 0x9084, 0xa000,
 	0xc0b5, 0xa87e, 0xa8ac, 0xa846, 0xa8b0, 0xa84a, 0x9006, 0xa836,
 	0xa83a, 0xa884, 0x9092, 0x199a, 0x0210, 0x2001, 0x1999, 0x8003,
-	0x8013, 0x8213, 0x9210, 0x621a, 0x009e, 0x2c10, 0x080c, 0x1bad,
-	0x080c, 0x9155, 0x0126, 0x2091, 0x8000, 0x080c, 0x97b9, 0x012e,
+	0x8013, 0x8213, 0x9210, 0x621a, 0x009e, 0x2c10, 0x080c, 0x1baf,
+	0x080c, 0x913e, 0x0126, 0x2091, 0x8000, 0x080c, 0x97b5, 0x012e,
 	0x0005, 0x6010, 0x00b6, 0x2058, 0xbca0, 0x00be, 0x2c00, 0x080c,
-	0xb0fc, 0x080c, 0xd248, 0x6003, 0x0007, 0x0005, 0x00d6, 0x0096,
+	0xb10c, 0x080c, 0xd262, 0x6003, 0x0007, 0x0005, 0x00d6, 0x0096,
 	0x00f6, 0x2079, 0x1800, 0x7a90, 0x6014, 0x2048, 0xa87c, 0xd0ec,
 	0x1110, 0x9290, 0x0018, 0xac78, 0xc4fc, 0x0046, 0xa8e0, 0x9005,
 	0x1140, 0xa8dc, 0x921a, 0x0140, 0x0220, 0xa87b, 0x0007, 0x2010,
@@ -5423,56 +5425,56 @@ unsigned short risc_code01[] = {
 	0x00f6, 0x2400, 0x9005, 0x1108, 0x009a, 0x2100, 0x9086, 0x0015,
 	0x1118, 0x2001, 0x0001, 0x0038, 0x2100, 0x9086, 0x0016, 0x0118,
 	0x2001, 0x0001, 0x002a, 0x94a4, 0x0007, 0x8423, 0x9405, 0x0002,
-	0xb00d, 0xb00d, 0xb008, 0xb00b, 0xb00d, 0xb005, 0xaff8, 0xaff8,
-	0xaff8, 0xaff8, 0xaff8, 0xaff8, 0xaff8, 0xaff8, 0xaff8, 0xaff8,
+	0xb01d, 0xb01d, 0xb018, 0xb01b, 0xb01d, 0xb015, 0xb008, 0xb008,
+	0xb008, 0xb008, 0xb008, 0xb008, 0xb008, 0xb008, 0xb008, 0xb008,
 	0x00fe, 0x00ee, 0x00de, 0x00ce, 0x002e, 0x001e, 0x000e, 0x004e,
-	0x00fe, 0x009e, 0x00de, 0x080c, 0x0dd5, 0x080c, 0xbaad, 0x0028,
-	0x080c, 0xbb92, 0x0010, 0x080c, 0xbc88, 0x00fe, 0x00ee, 0x00de,
-	0x00ce, 0x002e, 0x001e, 0x2c00, 0xa896, 0x000e, 0x080c, 0xb1ba,
+	0x00fe, 0x009e, 0x00de, 0x080c, 0x0dd5, 0x080c, 0xbac0, 0x0028,
+	0x080c, 0xbba5, 0x0010, 0x080c, 0xbc9b, 0x00fe, 0x00ee, 0x00de,
+	0x00ce, 0x002e, 0x001e, 0x2c00, 0xa896, 0x000e, 0x080c, 0xb1ca,
 	0x0530, 0xa804, 0xa80e, 0x00a6, 0x2050, 0xb100, 0x00ae, 0x8006,
 	0x8006, 0x8007, 0x90bc, 0x003f, 0x9084, 0xffc0, 0x9080, 0x0002,
 	0xaacc, 0xabd0, 0xacd4, 0xadd8, 0x2031, 0x0000, 0x2041, 0x125d,
-	0x080c, 0xb37a, 0x0160, 0x000e, 0x9005, 0x0120, 0x00fe, 0x009e,
-	0x00de, 0x0005, 0x00fe, 0x009e, 0x00de, 0x0804, 0xae61, 0x2001,
-	0x002c, 0x900e, 0x080c, 0xb220, 0x0c70, 0x91b6, 0x0015, 0x0170,
+	0x080c, 0xb38b, 0x0160, 0x000e, 0x9005, 0x0120, 0x00fe, 0x009e,
+	0x00de, 0x0005, 0x00fe, 0x009e, 0x00de, 0x0804, 0xae71, 0x2001,
+	0x002c, 0x900e, 0x080c, 0xb230, 0x0c70, 0x91b6, 0x0015, 0x0170,
 	0x91b6, 0x0016, 0x0158, 0x91b2, 0x0047, 0x0a0c, 0x0dd5, 0x91b2,
 	0x0050, 0x1a0c, 0x0dd5, 0x9182, 0x0047, 0x00ca, 0x2001, 0x0109,
 	0x2004, 0xd08c, 0x0198, 0x0126, 0x2091, 0x2800, 0x0006, 0x0016,
-	0x0026, 0x080c, 0x90a2, 0x002e, 0x001e, 0x000e, 0x012e, 0xa001,
-	0x6000, 0x9086, 0x0002, 0x1110, 0x0804, 0xafa6, 0x0005, 0xb078,
-	0xb078, 0xb07a, 0xb0b0, 0xb078, 0xb078, 0xb078, 0xb078, 0xb0c3,
-	0x080c, 0x0dd5, 0x00d6, 0x0016, 0x0096, 0x080c, 0x963d, 0x080c,
-	0x97b9, 0x6003, 0x0004, 0x6114, 0x2148, 0xa87c, 0xd0fc, 0x01c0,
+	0x0026, 0x080c, 0x908b, 0x002e, 0x001e, 0x000e, 0x012e, 0xa001,
+	0x6000, 0x9086, 0x0002, 0x1110, 0x0804, 0xafb6, 0x0005, 0xb088,
+	0xb088, 0xb08a, 0xb0c0, 0xb088, 0xb088, 0xb088, 0xb088, 0xb0d3,
+	0x080c, 0x0dd5, 0x00d6, 0x0016, 0x0096, 0x080c, 0x9637, 0x080c,
+	0x97b5, 0x6003, 0x0004, 0x6114, 0x2148, 0xa87c, 0xd0fc, 0x01c0,
 	0xa878, 0xc0fc, 0x9005, 0x1158, 0xa894, 0x9005, 0x0140, 0x2001,
-	0x0000, 0x900e, 0x080c, 0xb220, 0x080c, 0xae61, 0x00a8, 0x6003,
+	0x0000, 0x900e, 0x080c, 0xb230, 0x080c, 0xae71, 0x00a8, 0x6003,
 	0x0002, 0xa8a4, 0xa9a8, 0x9105, 0x1178, 0xa8ae, 0xa8b2, 0x0c78,
 	0xa87f, 0x0020, 0xa88c, 0xa88a, 0xa8a4, 0xa8ae, 0xa8a8, 0xa8b2,
 	0xa8c7, 0x0000, 0xa8cb, 0x0000, 0x009e, 0x001e, 0x00de, 0x0005,
-	0x080c, 0x963d, 0x00d6, 0x0096, 0x6114, 0x2148, 0x080c, 0xcb35,
-	0x0120, 0xa87b, 0x0006, 0x080c, 0x6c81, 0x009e, 0x00de, 0x080c,
-	0xae61, 0x0804, 0x97b9, 0x080c, 0x963d, 0x080c, 0x31bf, 0x080c,
-	0xd245, 0x00d6, 0x0096, 0x6114, 0x2148, 0x080c, 0xcb35, 0x0120,
-	0xa87b, 0x0029, 0x080c, 0x6c81, 0x009e, 0x00de, 0x080c, 0xae61,
-	0x0804, 0x97b9, 0x9182, 0x0047, 0x0002, 0xb0ea, 0xb0ec, 0xb0ea,
-	0xb0ea, 0xb0ea, 0xb0ea, 0xb0ea, 0xb0ea, 0xb0ea, 0xb0ea, 0xb0ea,
-	0xb0ea, 0xb0ec, 0x080c, 0x0dd5, 0x00d6, 0x0096, 0x601f, 0x0000,
-	0x6114, 0x2148, 0xa87b, 0x0000, 0xa883, 0x0000, 0x080c, 0x6c81,
-	0x009e, 0x00de, 0x0804, 0xae61, 0x0026, 0x0036, 0x0056, 0x0066,
+	0x080c, 0x9637, 0x00d6, 0x0096, 0x6114, 0x2148, 0x080c, 0xcb4a,
+	0x0120, 0xa87b, 0x0006, 0x080c, 0x6c86, 0x009e, 0x00de, 0x080c,
+	0xae71, 0x0804, 0x97b5, 0x080c, 0x9637, 0x080c, 0x31c1, 0x080c,
+	0xd25f, 0x00d6, 0x0096, 0x6114, 0x2148, 0x080c, 0xcb4a, 0x0120,
+	0xa87b, 0x0029, 0x080c, 0x6c86, 0x009e, 0x00de, 0x080c, 0xae71,
+	0x0804, 0x97b5, 0x9182, 0x0047, 0x0002, 0xb0fa, 0xb0fc, 0xb0fa,
+	0xb0fa, 0xb0fa, 0xb0fa, 0xb0fa, 0xb0fa, 0xb0fa, 0xb0fa, 0xb0fa,
+	0xb0fa, 0xb0fc, 0x080c, 0x0dd5, 0x00d6, 0x0096, 0x601f, 0x0000,
+	0x6114, 0x2148, 0xa87b, 0x0000, 0xa883, 0x0000, 0x080c, 0x6c86,
+	0x009e, 0x00de, 0x0804, 0xae71, 0x0026, 0x0036, 0x0056, 0x0066,
 	0x0096, 0x00a6, 0x00f6, 0x0006, 0x080c, 0x0fff, 0x000e, 0x090c,
 	0x0dd5, 0xa960, 0x21e8, 0xa95c, 0x9188, 0x0019, 0x21a0, 0x900e,
 	0x20a9, 0x0020, 0x4104, 0xa87a, 0x2079, 0x1800, 0x7990, 0x9188,
 	0x0018, 0x918c, 0x0fff, 0xa972, 0xac76, 0x2950, 0x00a6, 0x2001,
 	0x0205, 0x2003, 0x0000, 0x901e, 0x2029, 0x0001, 0x9182, 0x0034,
-	0x1228, 0x2011, 0x001f, 0x080c, 0xc730, 0x04c0, 0x2130, 0x2009,
-	0x0034, 0x2011, 0x001f, 0x080c, 0xc730, 0x96b2, 0x0034, 0xb004,
+	0x1228, 0x2011, 0x001f, 0x080c, 0xc743, 0x04c0, 0x2130, 0x2009,
+	0x0034, 0x2011, 0x001f, 0x080c, 0xc743, 0x96b2, 0x0034, 0xb004,
 	0x904d, 0x0110, 0x080c, 0x0fb1, 0x080c, 0x0fff, 0x01d0, 0x8528,
 	0xa867, 0x0110, 0xa86b, 0x0000, 0x2920, 0xb406, 0x968a, 0x003d,
-	0x1230, 0x2608, 0x2011, 0x001b, 0x080c, 0xc730, 0x00b8, 0x96b2,
-	0x003c, 0x2009, 0x003c, 0x2950, 0x2011, 0x001b, 0x080c, 0xc730,
+	0x1230, 0x2608, 0x2011, 0x001b, 0x080c, 0xc743, 0x00b8, 0x96b2,
+	0x003c, 0x2009, 0x003c, 0x2950, 0x2011, 0x001b, 0x080c, 0xc743,
 	0x0c18, 0x2001, 0x0205, 0x2003, 0x0000, 0x00ae, 0x852f, 0x95ad,
 	0x0050, 0xb566, 0xb070, 0xc0fd, 0xb072, 0x0048, 0x2001, 0x0205,
 	0x2003, 0x0000, 0x00ae, 0x852f, 0x95ad, 0x0050, 0xb566, 0x2a48,
-	0xa804, 0xa807, 0x0000, 0x0006, 0x080c, 0x6c81, 0x000e, 0x2048,
+	0xa804, 0xa807, 0x0000, 0x0006, 0x080c, 0x6c86, 0x000e, 0x2048,
 	0x9005, 0x1db0, 0x00fe, 0x00ae, 0x009e, 0x006e, 0x005e, 0x003e,
 	0x002e, 0x0005, 0x00d6, 0x00f6, 0x0096, 0x0006, 0x080c, 0x0fff,
 	0x000e, 0x090c, 0x0dd5, 0xa960, 0x21e8, 0xa95c, 0x9188, 0x0019,
@@ -5480,7 +5482,7 @@ unsigned short risc_code01[] = {
 	0x1800, 0x7990, 0x810c, 0x9188, 0x000c, 0x9182, 0x001a, 0x0210,
 	0x2009, 0x001a, 0x21a8, 0x810b, 0xa972, 0xac76, 0x2e98, 0xa85c,
 	0x9080, 0x001f, 0x20a0, 0x2001, 0x0205, 0x200c, 0x918d, 0x0080,
-	0x2102, 0x4003, 0x2003, 0x0000, 0x080c, 0x6c81, 0x009e, 0x00fe,
+	0x2102, 0x4003, 0x2003, 0x0000, 0x080c, 0x6c86, 0x009e, 0x00fe,
 	0x00de, 0x0005, 0x0016, 0x00d6, 0x00f6, 0x0096, 0x0016, 0x2001,
 	0x0205, 0x200c, 0x918d, 0x0080, 0x2102, 0x001e, 0x2079, 0x0200,
 	0x2e98, 0xa87c, 0xd0ec, 0x0118, 0x9e80, 0x000c, 0x2098, 0x2021,
@@ -5492,2049 +5494,2051 @@ unsigned short risc_code01[] = {
 	0x2400, 0x9202, 0x2410, 0x9318, 0x9006, 0x2020, 0x22a8, 0xa800,
 	0x9200, 0xa802, 0x20e1, 0x0000, 0x4003, 0x83ff, 0x0180, 0x3300,
 	0x9086, 0x0280, 0x1130, 0x7814, 0x8000, 0x9085, 0x0080, 0x7816,
-	0x2e98, 0x2310, 0x84ff, 0x0904, 0xb1cf, 0x0804, 0xb1d1, 0x9085,
+	0x2e98, 0x2310, 0x84ff, 0x0904, 0xb1df, 0x0804, 0xb1e1, 0x9085,
 	0x0001, 0x7817, 0x0000, 0x009e, 0x00fe, 0x00de, 0x001e, 0x0005,
 	0x00d6, 0x0036, 0x0096, 0x6314, 0x2348, 0xa87a, 0xa982, 0x080c,
-	0x6c75, 0x009e, 0x003e, 0x00de, 0x0005, 0x91b6, 0x0015, 0x1118,
-	0x080c, 0xae61, 0x0030, 0x91b6, 0x0016, 0x190c, 0x0dd5, 0x080c,
-	0xae61, 0x0005, 0x20a9, 0x000e, 0x20e1, 0x0000, 0x2e98, 0x6014,
+	0x6c7a, 0x009e, 0x003e, 0x00de, 0x0005, 0x91b6, 0x0015, 0x1118,
+	0x080c, 0xae71, 0x0030, 0x91b6, 0x0016, 0x190c, 0x0dd5, 0x080c,
+	0xae71, 0x0005, 0x20a9, 0x000e, 0x20e1, 0x0000, 0x2e98, 0x6014,
 	0x0096, 0x2048, 0xa860, 0x20e8, 0xa85c, 0x20a0, 0x009e, 0x4003,
-	0x0136, 0x9080, 0x001b, 0x2011, 0x0006, 0x20a9, 0x0001, 0x3418,
-	0x8318, 0x23a0, 0x4003, 0x3318, 0x8318, 0x2398, 0x8211, 0x1db8,
-	0x2011, 0x0006, 0x013e, 0x20a0, 0x3318, 0x8318, 0x2398, 0x4003,
-	0x3418, 0x8318, 0x23a0, 0x8211, 0x1db8, 0x0096, 0x080c, 0xcb35,
-	0x0130, 0x6014, 0x2048, 0xa807, 0x0000, 0xa867, 0x0103, 0x009e,
-	0x0804, 0xae61, 0x0096, 0x00d6, 0x0036, 0x7330, 0x9386, 0x0200,
-	0x11a8, 0x6010, 0x00b6, 0x2058, 0xb8cf, 0x0000, 0x00be, 0x6014,
-	0x9005, 0x0130, 0x2048, 0xa807, 0x0000, 0xa867, 0x0103, 0xab32,
-	0x080c, 0xae61, 0x003e, 0x00de, 0x009e, 0x0005, 0x0011, 0x1d48,
-	0x0cc8, 0x0006, 0x0016, 0x080c, 0xd230, 0x0188, 0x6014, 0x9005,
-	0x1170, 0x600b, 0x0003, 0x601b, 0x0000, 0x6043, 0x0000, 0x2009,
-	0x0022, 0x080c, 0xb657, 0x9006, 0x001e, 0x000e, 0x0005, 0x9085,
-	0x0001, 0x0cd0, 0x0096, 0x0016, 0x20a9, 0x0014, 0x9e80, 0x000c,
-	0x20e1, 0x0000, 0x2098, 0x6014, 0x2048, 0xa860, 0x20e8, 0xa85c,
-	0x9080, 0x0002, 0x20a0, 0x4003, 0x2001, 0x0205, 0x2003, 0x0001,
-	0x2099, 0x0260, 0x20a9, 0x0016, 0x4003, 0x20a9, 0x000a, 0xa804,
-	0x2048, 0xa860, 0x20e8, 0xa85c, 0x9080, 0x0002, 0x20a0, 0x4003,
-	0x2001, 0x0205, 0x2003, 0x0002, 0x2099, 0x0260, 0x20a9, 0x0020,
-	0x4003, 0x2003, 0x0000, 0x6014, 0x2048, 0xa800, 0x2048, 0xa867,
-	0x0103, 0x080c, 0xae61, 0x001e, 0x009e, 0x0005, 0x0096, 0x0016,
-	0x900e, 0x7030, 0x9086, 0x0100, 0x0140, 0x7038, 0x9084, 0x00ff,
-	0x800c, 0x703c, 0x9084, 0x00ff, 0x8004, 0x9080, 0x0004, 0x9108,
-	0x810b, 0x2011, 0x0002, 0x2019, 0x000c, 0x6014, 0x2048, 0x080c,
-	0xc730, 0x080c, 0xcb35, 0x0140, 0x6014, 0x2048, 0xa807, 0x0000,
-	0xa864, 0xa8e2, 0xa867, 0x0103, 0x080c, 0xae61, 0x001e, 0x009e,
-	0x0005, 0x0016, 0x2009, 0x0000, 0x7030, 0x9086, 0x0200, 0x0110,
-	0x2009, 0x0001, 0x0096, 0x6014, 0x904d, 0x090c, 0x0dd5, 0xa97a,
-	0x080c, 0x6c81, 0x009e, 0x080c, 0xae61, 0x001e, 0x0005, 0x0016,
-	0x0096, 0x7030, 0x9086, 0x0100, 0x1118, 0x2009, 0x0004, 0x0010,
-	0x7034, 0x800c, 0x810b, 0x2011, 0x000c, 0x2019, 0x000c, 0x6014,
-	0x2048, 0xa804, 0x0096, 0x9005, 0x0108, 0x2048, 0x080c, 0xc730,
-	0x009e, 0x080c, 0xcb35, 0x0148, 0xa804, 0x9005, 0x1158, 0xa807,
-	0x0000, 0xa864, 0xa8e2, 0xa867, 0x0103, 0x080c, 0xae61, 0x009e,
-	0x001e, 0x0005, 0x0086, 0x2040, 0xa030, 0x8007, 0x9086, 0x0100,
-	0x1118, 0x080c, 0xb813, 0x00e0, 0xa034, 0x8007, 0x800c, 0x8806,
-	0x8006, 0x8007, 0x90bc, 0x003f, 0x9084, 0xffc0, 0x9080, 0x000c,
-	0xa87b, 0x0000, 0xa883, 0x0000, 0xa897, 0x4000, 0xaaa0, 0xab9c,
-	0xaca8, 0xada4, 0x2031, 0x0000, 0x2041, 0x1243, 0x0019, 0x0d08,
-	0x008e, 0x0898, 0x0096, 0x0006, 0x080c, 0x0fff, 0x000e, 0x01b0,
-	0xa8ab, 0x0dcb, 0xa876, 0x000e, 0xa8a2, 0x0006, 0xae6a, 0x2800,
-	0xa89e, 0xa97a, 0xaf72, 0xaa8e, 0xab92, 0xac96, 0xad9a, 0x0086,
-	0x2940, 0x080c, 0x10e9, 0x008e, 0x9085, 0x0001, 0x009e, 0x0005,
-	0x00e6, 0x00d6, 0x0026, 0x7008, 0x9084, 0x00ff, 0x6210, 0x00b6,
-	0x2258, 0xba10, 0x00be, 0x9206, 0x1520, 0x700c, 0x6210, 0x00b6,
-	0x2258, 0xba14, 0x00be, 0x9206, 0x11e0, 0x6043, 0x0000, 0x2c68,
-	0x0016, 0x2009, 0x0035, 0x080c, 0xd1a8, 0x001e, 0x1158, 0x622c,
-	0x2268, 0x2071, 0x026c, 0x6b20, 0x9386, 0x0003, 0x0130, 0x9386,
-	0x0006, 0x0128, 0x080c, 0xae61, 0x0020, 0x0039, 0x0010, 0x080c,
-	0xb48c, 0x002e, 0x00de, 0x00ee, 0x0005, 0x0096, 0x6814, 0x2048,
-	0x9186, 0x0015, 0x0904, 0xb474, 0x918e, 0x0016, 0x1904, 0xb48a,
-	0x700c, 0x908c, 0xff00, 0x9186, 0x1700, 0x0120, 0x9186, 0x0300,
-	0x1904, 0xb44e, 0x89ff, 0x1138, 0x6800, 0x9086, 0x000f, 0x0904,
-	0xb431, 0x0804, 0xb488, 0x6808, 0x9086, 0xffff, 0x1904, 0xb476,
-	0xa87c, 0x9084, 0x0060, 0x9086, 0x0020, 0x1128, 0xa83c, 0xa940,
-	0x9105, 0x1904, 0xb476, 0x6824, 0xd0b4, 0x1904, 0xb476, 0x080c,
-	0xcd1e, 0x685c, 0xa882, 0xa87c, 0xc0dc, 0xc0f4, 0xc0d4, 0xa87e,
-	0x0026, 0x900e, 0x6a18, 0x2001, 0x000a, 0x080c, 0x8f68, 0xa884,
-	0x920a, 0x0208, 0x8011, 0xaa86, 0x82ff, 0x002e, 0x1138, 0x00c6,
-	0x2d60, 0x080c, 0xc85a, 0x00ce, 0x0804, 0xb488, 0x00c6, 0xa868,
-	0xd0fc, 0x1118, 0x080c, 0x60ae, 0x0010, 0x080c, 0x64b4, 0x00ce,
-	0x1904, 0xb476, 0x00c6, 0x2d60, 0x080c, 0xae61, 0x00ce, 0x0804,
-	0xb488, 0x00c6, 0x080c, 0xaeaf, 0x0198, 0x6017, 0x0000, 0x6810,
-	0x6012, 0x080c, 0xcfaa, 0x6023, 0x0003, 0x6904, 0x00c6, 0x2d60,
-	0x080c, 0xae61, 0x00ce, 0x080c, 0xaedc, 0x00ce, 0x0804, 0xb488,
-	0x2001, 0x1988, 0x2004, 0x6842, 0x00ce, 0x04d0, 0x7008, 0x9086,
-	0x000b, 0x11c8, 0x6010, 0x00b6, 0x2058, 0xb900, 0xc1bc, 0xb902,
-	0x00be, 0x00c6, 0x2d60, 0xa87b, 0x0003, 0x080c, 0xd1ea, 0x6007,
-	0x0085, 0x6003, 0x000b, 0x6023, 0x0002, 0x080c, 0x90f0, 0x080c,
-	0x968d, 0x00ce, 0x00e8, 0x700c, 0x9086, 0x2a00, 0x1138, 0x2001,
-	0x1988, 0x2004, 0x6842, 0x00a0, 0x0479, 0x00a0, 0x89ff, 0x090c,
-	0x0dd5, 0x00c6, 0x00d6, 0x2d60, 0xa867, 0x0103, 0xa87b, 0x0003,
-	0x080c, 0x6a9d, 0x080c, 0xcd1e, 0x080c, 0xae92, 0x00de, 0x00ce,
-	0x080c, 0xae61, 0x009e, 0x0005, 0x9186, 0x0015, 0x1128, 0x2001,
-	0x1988, 0x2004, 0x6842, 0x0068, 0x918e, 0x0016, 0x1160, 0x00c6,
-	0x2d00, 0x2060, 0x080c, 0xe80b, 0x080c, 0x86b2, 0x080c, 0xae61,
-	0x00ce, 0x080c, 0xae61, 0x0005, 0x0026, 0x0036, 0x0046, 0x7228,
-	0xacb0, 0xabac, 0xd2f4, 0x0130, 0x2001, 0x1988, 0x2004, 0x6842,
-	0x0804, 0xb506, 0x00c6, 0x2d60, 0x080c, 0xc75b, 0x00ce, 0x6804,
-	0x9086, 0x0050, 0x1168, 0x00c6, 0x2d00, 0x2060, 0x6003, 0x0001,
-	0x6007, 0x0050, 0x080c, 0x90f0, 0x080c, 0x968d, 0x00ce, 0x04f0,
-	0x6800, 0x9086, 0x000f, 0x01a8, 0x89ff, 0x090c, 0x0dd5, 0x6800,
-	0x9086, 0x0004, 0x1190, 0xa87c, 0xd0ac, 0x0178, 0xa843, 0x0fff,
-	0xa83f, 0x0fff, 0xa880, 0xc0fc, 0xa882, 0x2001, 0x0001, 0x6832,
-	0x0400, 0x2001, 0x0007, 0x6832, 0x00e0, 0xa87c, 0xd0b4, 0x1150,
-	0xd0ac, 0x0db8, 0x6824, 0xd0f4, 0x1d48, 0xa838, 0xa934, 0x9105,
-	0x0d80, 0x0c20, 0xd2ec, 0x1d68, 0x7024, 0x9306, 0x1118, 0x7020,
-	0x9406, 0x0d38, 0x7020, 0x683e, 0x7024, 0x683a, 0x2001, 0x0005,
-	0x6832, 0x080c, 0xcea1, 0x080c, 0x968d, 0x0010, 0x080c, 0xae61,
-	0x004e, 0x003e, 0x002e, 0x0005, 0x00e6, 0x00d6, 0x0026, 0x7008,
-	0x9084, 0x00ff, 0x6210, 0x00b6, 0x2258, 0xba10, 0x00be, 0x9206,
-	0x1904, 0xb571, 0x700c, 0x6210, 0x00b6, 0x2258, 0xba14, 0x00be,
-	0x9206, 0x1904, 0xb571, 0x6038, 0x2068, 0x6824, 0xc0dc, 0x6826,
-	0x6a20, 0x9286, 0x0007, 0x0904, 0xb571, 0x9286, 0x0002, 0x0904,
-	0xb571, 0x9286, 0x0000, 0x05e8, 0x6808, 0x633c, 0x9306, 0x15c8,
-	0x2071, 0x026c, 0x9186, 0x0015, 0x0570, 0x918e, 0x0016, 0x1100,
-	0x00c6, 0x6038, 0x2060, 0x6104, 0x9186, 0x004b, 0x01c0, 0x9186,
-	0x004c, 0x01a8, 0x9186, 0x004d, 0x0190, 0x9186, 0x004e, 0x0178,
-	0x9186, 0x0052, 0x0160, 0x6014, 0x0096, 0x2048, 0x080c, 0xcb35,
-	0x090c, 0x0dd5, 0xa87b, 0x0003, 0x009e, 0x080c, 0xd1ea, 0x6007,
-	0x0085, 0x6003, 0x000b, 0x6023, 0x0002, 0x080c, 0x90f0, 0x080c,
-	0x968d, 0x00ce, 0x0030, 0x6038, 0x2070, 0x2001, 0x1988, 0x2004,
-	0x7042, 0x080c, 0xae61, 0x002e, 0x00de, 0x00ee, 0x0005, 0x00b6,
-	0x0096, 0x00f6, 0x6014, 0x2048, 0x6010, 0x2058, 0x91b6, 0x0015,
-	0x0130, 0xba08, 0xbb0c, 0xbc00, 0xc48c, 0xbc02, 0x0460, 0x0096,
-	0x0156, 0x0036, 0x0026, 0x2b48, 0x9e90, 0x0010, 0x2019, 0x000a,
-	0x20a9, 0x0004, 0x080c, 0xbe1d, 0x002e, 0x003e, 0x015e, 0x009e,
-	0x1904, 0xb5e0, 0x0096, 0x0156, 0x0036, 0x0026, 0x2b48, 0x9e90,
-	0x0014, 0x2019, 0x0006, 0x20a9, 0x0004, 0x080c, 0xbe1d, 0x002e,
-	0x003e, 0x015e, 0x009e, 0x15a0, 0x7238, 0xba0a, 0x733c, 0xbb0e,
-	0xbc00, 0xc48d, 0xbc02, 0xa804, 0x9005, 0x1128, 0x00fe, 0x009e,
-	0x00be, 0x0804, 0xb265, 0x0096, 0x2048, 0xaa12, 0xab16, 0xac0a,
-	0x009e, 0x8006, 0x8006, 0x8007, 0x90bc, 0x003f, 0x9084, 0xffc0,
-	0x9080, 0x0002, 0x2009, 0x002b, 0xaaa0, 0xab9c, 0xaca8, 0xada4,
-	0x2031, 0x0000, 0x2041, 0x1243, 0x080c, 0xb37a, 0x0130, 0x00fe,
-	0x009e, 0x080c, 0xae61, 0x00be, 0x0005, 0x080c, 0xb813, 0x0cb8,
-	0x2b78, 0x00f6, 0x080c, 0x31bf, 0x080c, 0xd245, 0x00fe, 0x00c6,
-	0x080c, 0xae0b, 0x2f00, 0x6012, 0x6017, 0x0000, 0x6023, 0x0001,
-	0x6007, 0x0001, 0x6003, 0x0001, 0x2001, 0x0007, 0x080c, 0x654f,
-	0x080c, 0x657b, 0x080c, 0x9138, 0x080c, 0x968d, 0x00ce, 0x0804,
-	0xb5b3, 0x2100, 0x91b2, 0x0053, 0x1a0c, 0x0dd5, 0x91b2, 0x0040,
-	0x1a04, 0xb669, 0x0002, 0xb657, 0xb657, 0xb64d, 0xb657, 0xb657,
-	0xb657, 0xb64b, 0xb64b, 0xb64b, 0xb64b, 0xb64b, 0xb64b, 0xb64b,
-	0xb64b, 0xb64b, 0xb64b, 0xb64b, 0xb64b, 0xb64b, 0xb64b, 0xb64b,
-	0xb64b, 0xb64b, 0xb64b, 0xb64b, 0xb64b, 0xb64b, 0xb64b, 0xb64b,
-	0xb64b, 0xb64b, 0xb657, 0xb64b, 0xb657, 0xb657, 0xb64b, 0xb64b,
-	0xb64b, 0xb64b, 0xb64b, 0xb64d, 0xb64b, 0xb64b, 0xb64b, 0xb64b,
-	0xb64b, 0xb64b, 0xb64b, 0xb64b, 0xb64b, 0xb657, 0xb657, 0xb64b,
-	0xb64b, 0xb64b, 0xb64b, 0xb64b, 0xb64b, 0xb64b, 0xb64b, 0xb64b,
-	0xb657, 0xb64b, 0xb64b, 0x080c, 0x0dd5, 0x0066, 0x00b6, 0x6610,
-	0x2658, 0xb8cc, 0xc08c, 0xb8ce, 0x00be, 0x006e, 0x0000, 0x6003,
-	0x0001, 0x6106, 0x9186, 0x0032, 0x0118, 0x080c, 0x9138, 0x0010,
-	0x080c, 0x90f0, 0x0126, 0x2091, 0x8000, 0x080c, 0x968d, 0x012e,
-	0x0005, 0x2600, 0x0002, 0xb657, 0xb657, 0xb67d, 0xb657, 0xb657,
-	0xb67d, 0xb67d, 0xb67d, 0xb67d, 0xb657, 0xb67d, 0xb657, 0xb67d,
-	0xb657, 0xb67d, 0xb67d, 0xb67d, 0xb67d, 0x080c, 0x0dd5, 0x6004,
-	0x90b2, 0x0053, 0x1a0c, 0x0dd5, 0x91b6, 0x0013, 0x0904, 0xb741,
-	0x91b6, 0x0027, 0x1904, 0xb6fc, 0x080c, 0x9588, 0x6004, 0x080c,
-	0xcd2a, 0x01b0, 0x080c, 0xcd3b, 0x01a8, 0x908e, 0x0021, 0x0904,
-	0xb6f9, 0x908e, 0x0022, 0x1130, 0x080c, 0xb291, 0x0904, 0xb6f5,
-	0x0804, 0xb6f6, 0x908e, 0x003d, 0x0904, 0xb6f9, 0x0804, 0xb6ef,
-	0x080c, 0x31e8, 0x2001, 0x0007, 0x080c, 0x654f, 0x6010, 0x00b6,
-	0x2058, 0xb9a0, 0x00be, 0x080c, 0xb813, 0x9186, 0x007e, 0x1148,
-	0x2001, 0x1837, 0x2014, 0xc285, 0x080c, 0x73bc, 0x1108, 0xc2ad,
-	0x2202, 0x0036, 0x0026, 0x2019, 0x0028, 0x2110, 0x080c, 0xe917,
-	0x002e, 0x003e, 0x0016, 0x0026, 0x0036, 0x2110, 0x2019, 0x0028,
-	0x080c, 0x928b, 0x0076, 0x903e, 0x080c, 0x9168, 0x6010, 0x00b6,
-	0x905d, 0x0100, 0x00be, 0x2c08, 0x080c, 0xe2eb, 0x007e, 0x003e,
-	0x002e, 0x001e, 0x080c, 0xd245, 0x0016, 0x080c, 0xcfa2, 0x080c,
-	0xae61, 0x001e, 0x080c, 0x32bb, 0x080c, 0x968d, 0x0030, 0x080c,
-	0xcfa2, 0x080c, 0xae61, 0x080c, 0x968d, 0x0005, 0x080c, 0xb813,
-	0x0cb0, 0x080c, 0xb84f, 0x0c98, 0x9186, 0x0014, 0x1db0, 0x080c,
-	0x9588, 0x6004, 0x908e, 0x0022, 0x1118, 0x080c, 0xb291, 0x0d68,
-	0x080c, 0x31bf, 0x080c, 0xd245, 0x080c, 0xcd2a, 0x1190, 0x080c,
-	0x31e8, 0x6010, 0x00b6, 0x2058, 0xb9a0, 0x00be, 0x080c, 0xb813,
-	0x9186, 0x007e, 0x1128, 0x2001, 0x1837, 0x200c, 0xc185, 0x2102,
-	0x0870, 0x080c, 0xcd3b, 0x1118, 0x080c, 0xb813, 0x0840, 0x6004,
-	0x908e, 0x0032, 0x1160, 0x00e6, 0x00f6, 0x2071, 0x189e, 0x2079,
-	0x0000, 0x080c, 0x3556, 0x00fe, 0x00ee, 0x0804, 0xb6ef, 0x6004,
-	0x908e, 0x0021, 0x0d48, 0x908e, 0x0022, 0x090c, 0xb813, 0x0804,
-	0xb6ef, 0x90b2, 0x0040, 0x1a04, 0xb7ef, 0x2008, 0x0002, 0xb789,
-	0xb78a, 0xb78d, 0xb790, 0xb793, 0xb796, 0xb787, 0xb787, 0xb787,
-	0xb787, 0xb787, 0xb787, 0xb787, 0xb787, 0xb787, 0xb787, 0xb787,
-	0xb787, 0xb787, 0xb787, 0xb787, 0xb787, 0xb787, 0xb787, 0xb787,
-	0xb787, 0xb787, 0xb787, 0xb787, 0xb787, 0xb799, 0xb7a4, 0xb787,
-	0xb7a6, 0xb7a4, 0xb787, 0xb787, 0xb787, 0xb787, 0xb787, 0xb7a4,
-	0xb7a4, 0xb787, 0xb787, 0xb787, 0xb787, 0xb787, 0xb787, 0xb787,
-	0xb787, 0xb7d6, 0xb7a4, 0xb787, 0xb7a0, 0xb787, 0xb787, 0xb787,
-	0xb7a1, 0xb787, 0xb787, 0xb787, 0xb7a4, 0xb7cd, 0xb787, 0x080c,
-	0x0dd5, 0x00d0, 0x2001, 0x000b, 0x0410, 0x2001, 0x0003, 0x00f8,
-	0x2001, 0x0005, 0x00e0, 0x2001, 0x0001, 0x00c8, 0x2001, 0x0009,
-	0x00b0, 0x080c, 0x9588, 0x6003, 0x0005, 0x080c, 0x968d, 0x0070,
-	0x0018, 0x0010, 0x080c, 0x654f, 0x0804, 0xb7e7, 0x080c, 0x9588,
-	0x080c, 0xd248, 0x6003, 0x0004, 0x080c, 0x968d, 0x0005, 0x080c,
-	0x654f, 0x080c, 0x9588, 0x6003, 0x0002, 0x0036, 0x2019, 0x1852,
-	0x2304, 0x9084, 0xff00, 0x1120, 0x2001, 0x1986, 0x201c, 0x0040,
-	0x8007, 0x909a, 0x0004, 0x0ec0, 0x8003, 0x801b, 0x831b, 0x9318,
-	0x631a, 0x003e, 0x080c, 0x968d, 0x0c08, 0x080c, 0x9588, 0x080c,
-	0xcfa2, 0x080c, 0xae61, 0x080c, 0x968d, 0x08c0, 0x00e6, 0x00f6,
-	0x2071, 0x189e, 0x2079, 0x0000, 0x080c, 0x3556, 0x00fe, 0x00ee,
-	0x080c, 0x9588, 0x080c, 0xae61, 0x080c, 0x968d, 0x0838, 0x080c,
-	0x9588, 0x6003, 0x0002, 0x080c, 0xd248, 0x0804, 0x968d, 0x2600,
-	0x2008, 0x0002, 0xb806, 0xb7e7, 0xb804, 0xb7e7, 0xb7e7, 0xb804,
-	0xb804, 0xb804, 0xb804, 0xb7e7, 0xb804, 0xb7e7, 0xb804, 0xb7e7,
-	0xb804, 0xb804, 0xb804, 0xb804, 0x080c, 0x0dd5, 0x080c, 0x9588,
-	0x0096, 0x6014, 0x2048, 0x080c, 0x6c81, 0x009e, 0x080c, 0xae61,
-	0x080c, 0x968d, 0x0005, 0x00e6, 0x0096, 0x0026, 0x0016, 0x080c,
-	0xcb35, 0x0568, 0x6014, 0x2048, 0xa864, 0x9086, 0x0139, 0x11a8,
-	0xa894, 0x9086, 0x0056, 0x1148, 0x080c, 0x5478, 0x0130, 0x2001,
-	0x0000, 0x900e, 0x2011, 0x4000, 0x0028, 0x2001, 0x0030, 0x900e,
-	0x2011, 0x4005, 0x080c, 0xd10f, 0x0090, 0xa868, 0xd0fc, 0x0178,
-	0xa807, 0x0000, 0x0016, 0x6004, 0x908e, 0x0021, 0x0168, 0x908e,
-	0x003d, 0x0150, 0x001e, 0xa867, 0x0103, 0xa833, 0x0100, 0x001e,
-	0x002e, 0x009e, 0x00ee, 0x0005, 0x001e, 0x0009, 0x0cc0, 0x0096,
-	0x6014, 0x2048, 0xa800, 0x2048, 0xa867, 0x0103, 0xa823, 0x8001,
-	0x009e, 0x0005, 0x00b6, 0x6610, 0x2658, 0xb804, 0x9084, 0x00ff,
-	0x90b2, 0x000c, 0x1a0c, 0x0dd5, 0x6604, 0x96b6, 0x004d, 0x1120,
-	0x080c, 0xd02e, 0x0804, 0xb8df, 0x6604, 0x96b6, 0x0043, 0x1120,
-	0x080c, 0xd077, 0x0804, 0xb8df, 0x6604, 0x96b6, 0x004b, 0x1120,
-	0x080c, 0xd0a3, 0x0804, 0xb8df, 0x6604, 0x96b6, 0x0033, 0x1120,
-	0x080c, 0xcfc4, 0x0804, 0xb8df, 0x6604, 0x96b6, 0x0028, 0x1120,
-	0x080c, 0xcd74, 0x0804, 0xb8df, 0x6604, 0x96b6, 0x0029, 0x1120,
-	0x080c, 0xcdb5, 0x0804, 0xb8df, 0x6604, 0x96b6, 0x001f, 0x1120,
-	0x080c, 0xb23a, 0x0804, 0xb8df, 0x6604, 0x96b6, 0x0000, 0x1118,
-	0x080c, 0xb577, 0x04e0, 0x6604, 0x96b6, 0x0022, 0x1118, 0x080c,
-	0xb272, 0x04a8, 0x6604, 0x96b6, 0x0035, 0x1118, 0x080c, 0xb398,
-	0x0470, 0x6604, 0x96b6, 0x0039, 0x1118, 0x080c, 0xb50c, 0x0438,
-	0x6604, 0x96b6, 0x003d, 0x1118, 0x080c, 0xb2aa, 0x0400, 0x6604,
-	0x96b6, 0x0044, 0x1118, 0x080c, 0xb2e6, 0x00c8, 0x6604, 0x96b6,
-	0x0049, 0x1118, 0x080c, 0xb327, 0x0090, 0x6604, 0x96b6, 0x0041,
-	0x1118, 0x080c, 0xb311, 0x0058, 0x91b6, 0x0015, 0x1110, 0x0063,
-	0x0030, 0x91b6, 0x0016, 0x1128, 0x00be, 0x0804, 0xbb39, 0x00be,
-	0x0005, 0x080c, 0xaef7, 0x0cd8, 0xb8fc, 0xb8ff, 0xb8fc, 0xb946,
-	0xb8fc, 0xbaad, 0xbb46, 0xb8fc, 0xb8fc, 0xbb0f, 0xb8fc, 0xbb25,
-	0x0096, 0x601f, 0x0000, 0x6014, 0x2048, 0xa800, 0x2048, 0xa867,
-	0x0103, 0x009e, 0x0804, 0xae61, 0xa001, 0xa001, 0x0005, 0x00e6,
-	0x2071, 0x1800, 0x7090, 0x9086, 0x0074, 0x1540, 0x080c, 0xe2bc,
-	0x11b0, 0x6010, 0x00b6, 0x2058, 0x7030, 0xd08c, 0x0128, 0xb800,
-	0xd0bc, 0x0110, 0xc0c5, 0xb802, 0x00f9, 0x00be, 0x2001, 0x0006,
-	0x080c, 0x654f, 0x080c, 0x31e8, 0x080c, 0xae61, 0x0098, 0x2001,
-	0x000a, 0x080c, 0x654f, 0x080c, 0x31e8, 0x6003, 0x0001, 0x6007,
-	0x0001, 0x080c, 0x9138, 0x080c, 0x968d, 0x0020, 0x2001, 0x0001,
-	0x080c, 0xba7d, 0x00ee, 0x0005, 0x00d6, 0xb800, 0xd084, 0x0160,
-	0x9006, 0x080c, 0x653b, 0x2069, 0x1847, 0x6804, 0xd0a4, 0x0120,
-	0x2001, 0x0006, 0x080c, 0x657b, 0x00de, 0x0005, 0x00b6, 0x0096,
-	0x00d6, 0x2011, 0x1824, 0x2204, 0x9086, 0x0074, 0x1904, 0xba54,
-	0x6010, 0x2058, 0xbaa0, 0x9286, 0x007e, 0x1120, 0x080c, 0xbc93,
-	0x0804, 0xb9b8, 0x080c, 0xbc88, 0x6010, 0x2058, 0xbaa0, 0x9286,
-	0x0080, 0x1510, 0x6014, 0x9005, 0x01a8, 0x2048, 0xa864, 0x9084,
-	0x00ff, 0x9086, 0x0039, 0x1140, 0x2001, 0x0000, 0x900e, 0x2011,
-	0x4000, 0x080c, 0xd10f, 0x0030, 0xa807, 0x0000, 0xa867, 0x0103,
-	0xa833, 0x0200, 0x2001, 0x0006, 0x080c, 0x654f, 0x080c, 0x31e8,
-	0x080c, 0xae61, 0x0804, 0xba57, 0x080c, 0xba65, 0x6014, 0x9005,
-	0x0190, 0x2048, 0xa868, 0xd0f4, 0x01e8, 0xa864, 0x9084, 0x00ff,
-	0x9086, 0x0039, 0x1d08, 0x2001, 0x0000, 0x900e, 0x2011, 0x4000,
-	0x080c, 0xd10f, 0x08f8, 0x080c, 0xba5b, 0x0160, 0x9006, 0x080c,
-	0x653b, 0x2001, 0x0004, 0x080c, 0x657b, 0x2001, 0x0007, 0x080c,
-	0x654f, 0x08a0, 0x2001, 0x0004, 0x080c, 0x654f, 0x6003, 0x0001,
-	0x6007, 0x0003, 0x080c, 0x9138, 0x080c, 0x968d, 0x0804, 0xba57,
-	0xb85c, 0xd0e4, 0x01d8, 0x080c, 0xcf44, 0x080c, 0x73bc, 0x0118,
-	0xd0dc, 0x1904, 0xb97a, 0x2011, 0x1837, 0x2204, 0xc0ad, 0x2012,
-	0x2001, 0x196d, 0x2004, 0x00f6, 0x2079, 0x0100, 0x78e3, 0x0000,
-	0x080c, 0x28b2, 0x78e2, 0x00fe, 0x0804, 0xb97a, 0x080c, 0xcf81,
-	0x2011, 0x1837, 0x2204, 0xc0a5, 0x2012, 0x0006, 0x080c, 0xe441,
-	0x000e, 0x1904, 0xb97a, 0xc0b5, 0x2012, 0x2001, 0x0006, 0x080c,
-	0x654f, 0x9006, 0x080c, 0x653b, 0x00c6, 0x2001, 0x180f, 0x2004,
-	0xd09c, 0x0520, 0x00f6, 0x2079, 0x0100, 0x00e6, 0x2071, 0x1800,
-	0x700c, 0x9084, 0x00ff, 0x78e6, 0x707e, 0x7010, 0x78ea, 0x7082,
-	0x908c, 0x00ff, 0x00ee, 0x780c, 0xc0b5, 0x780e, 0x00fe, 0x080c,
-	0x2887, 0x00f6, 0x2100, 0x900e, 0x080c, 0x283e, 0x795e, 0x00fe,
-	0x9186, 0x0081, 0x01d8, 0x2009, 0x0081, 0x00c8, 0x2009, 0x00ef,
-	0x00f6, 0x2079, 0x0100, 0x79ea, 0x7932, 0x7936, 0x780c, 0xc0b5,
-	0x780e, 0x00fe, 0x080c, 0x2887, 0x00f6, 0x2079, 0x1800, 0x7982,
-	0x2100, 0x900e, 0x080c, 0x283e, 0x795e, 0x00fe, 0x8108, 0x080c,
-	0x659e, 0x2b00, 0x00ce, 0x1904, 0xb97a, 0x6012, 0x2009, 0x180f,
-	0x210c, 0xd19c, 0x0150, 0x2009, 0x027c, 0x210c, 0x918c, 0x00ff,
-	0xb912, 0x2009, 0x027d, 0x210c, 0xb916, 0x2001, 0x0002, 0x080c,
-	0x654f, 0x6023, 0x0001, 0x6003, 0x0001, 0x6007, 0x0002, 0x080c,
-	0x9138, 0x080c, 0x968d, 0x0018, 0x2001, 0x0001, 0x0431, 0x00de,
-	0x009e, 0x00be, 0x0005, 0x2001, 0x1810, 0x2004, 0xd0a4, 0x0120,
-	0x2001, 0x1848, 0x2004, 0xd0ac, 0x0005, 0x00e6, 0x080c, 0xe970,
-	0x0190, 0x2071, 0x0260, 0x7108, 0x720c, 0x918c, 0x00ff, 0x1118,
-	0x9284, 0xff00, 0x0140, 0x6010, 0x2058, 0xb8a0, 0x9084, 0xff80,
-	0x1110, 0xb912, 0xba16, 0x00ee, 0x0005, 0x2030, 0x9005, 0x0158,
-	0x2001, 0x0007, 0x080c, 0x654f, 0x080c, 0x56e3, 0x1120, 0x2001,
-	0x0007, 0x080c, 0x657b, 0x2600, 0x9005, 0x11b0, 0x6014, 0x0096,
-	0x2048, 0xa868, 0x009e, 0xd0fc, 0x1178, 0x0036, 0x0046, 0x6010,
-	0x00b6, 0x2058, 0xbba0, 0x00be, 0x2021, 0x0004, 0x2011, 0x8014,
-	0x080c, 0x4b04, 0x004e, 0x003e, 0x080c, 0x31e8, 0x6020, 0x9086,
-	0x000a, 0x1108, 0x0005, 0x0804, 0xae61, 0x00b6, 0x00e6, 0x0026,
-	0x0016, 0x2071, 0x1800, 0x7090, 0x9086, 0x0014, 0x1904, 0xbb05,
-	0x080c, 0x56e3, 0x1170, 0x6014, 0x9005, 0x1158, 0x0036, 0x0046,
-	0x6010, 0x2058, 0xbba0, 0x2021, 0x0006, 0x080c, 0x4cbb, 0x004e,
-	0x003e, 0x00d6, 0x6010, 0x2058, 0x080c, 0x669a, 0x080c, 0xb934,
-	0x00de, 0x080c, 0xbd59, 0x1588, 0x6010, 0x2058, 0xb890, 0x9005,
-	0x0560, 0x2001, 0x0006, 0x080c, 0x654f, 0x0096, 0x6014, 0x904d,
-	0x01d0, 0xa864, 0x9084, 0x00ff, 0x9086, 0x0039, 0x1140, 0x2001,
-	0x0000, 0x900e, 0x2011, 0x4000, 0x080c, 0xd10f, 0x0060, 0xa864,
-	0x9084, 0x00ff, 0x9086, 0x0029, 0x0130, 0xa807, 0x0000, 0xa867,
-	0x0103, 0xa833, 0x0200, 0x009e, 0x080c, 0x31e8, 0x6020, 0x9086,
-	0x000a, 0x0140, 0x080c, 0xae61, 0x0028, 0x080c, 0xb813, 0x9006,
-	0x080c, 0xba7d, 0x001e, 0x002e, 0x00ee, 0x00be, 0x0005, 0x2011,
-	0x1824, 0x2204, 0x9086, 0x0014, 0x1160, 0x2001, 0x0002, 0x080c,
-	0x654f, 0x6003, 0x0001, 0x6007, 0x0001, 0x080c, 0x9138, 0x0804,
-	0x968d, 0x2001, 0x0001, 0x0804, 0xba7d, 0x2030, 0x2011, 0x1824,
-	0x2204, 0x9086, 0x0004, 0x1148, 0x96b6, 0x000b, 0x1120, 0x2001,
-	0x0007, 0x080c, 0x654f, 0x0804, 0xae61, 0x2001, 0x0001, 0x0804,
-	0xba7d, 0x0002, 0xb8fc, 0xbb51, 0xb8fc, 0xbb92, 0xb8fc, 0xbc3f,
-	0xbb46, 0xb8fc, 0xb8fc, 0xbc53, 0xb8fc, 0xbc65, 0x6604, 0x9686,
-	0x0003, 0x0904, 0xbaad, 0x96b6, 0x001e, 0x1110, 0x080c, 0xae61,
-	0x0005, 0x00b6, 0x00d6, 0x00c6, 0x080c, 0xbc77, 0x11a0, 0x9006,
-	0x080c, 0x653b, 0x080c, 0x31bf, 0x080c, 0xd245, 0x2001, 0x0002,
-	0x080c, 0x654f, 0x6003, 0x0001, 0x6007, 0x0002, 0x080c, 0x9138,
-	0x080c, 0x968d, 0x0418, 0x2009, 0x026e, 0x2104, 0x9086, 0x0009,
-	0x1160, 0x6010, 0x2058, 0xb840, 0x9084, 0x00ff, 0x9005, 0x0170,
-	0x8001, 0xb842, 0x601b, 0x000a, 0x0088, 0x2009, 0x026f, 0x2104,
-	0x9084, 0xff00, 0x9086, 0x1900, 0x1108, 0x08a0, 0x080c, 0x31bf,
-	0x080c, 0xd245, 0x2001, 0x0001, 0x080c, 0xba7d, 0x00ce, 0x00de,
-	0x00be, 0x0005, 0x0096, 0x00b6, 0x0026, 0x9016, 0x080c, 0xbc85,
-	0x00d6, 0x2069, 0x197c, 0x2d04, 0x9005, 0x0168, 0x6010, 0x2058,
-	0xb8a0, 0x9086, 0x007e, 0x1138, 0x2069, 0x1820, 0x2d04, 0x8000,
-	0x206a, 0x00de, 0x0010, 0x00de, 0x0088, 0x9006, 0x080c, 0x653b,
-	0x2001, 0x0002, 0x080c, 0x654f, 0x6003, 0x0001, 0x6007, 0x0002,
-	0x080c, 0x9138, 0x080c, 0x968d, 0x0804, 0xbc0f, 0x080c, 0xcb35,
-	0x01b0, 0x6014, 0x2048, 0xa864, 0x2010, 0x9086, 0x0139, 0x1138,
-	0x6007, 0x0016, 0x2001, 0x0002, 0x080c, 0xd169, 0x00b0, 0x6014,
-	0x2048, 0xa864, 0xd0fc, 0x0118, 0x2001, 0x0001, 0x0ca8, 0x2001,
-	0x180e, 0x2004, 0xd0dc, 0x0148, 0x6010, 0x2058, 0xb840, 0x9084,
-	0x00ff, 0x9005, 0x1110, 0x9006, 0x0c38, 0x080c, 0xb813, 0x2009,
-	0x026e, 0x2134, 0x96b4, 0x00ff, 0x9686, 0x0005, 0x0520, 0x9686,
-	0x000b, 0x01c8, 0x2009, 0x026f, 0x2104, 0x9084, 0xff00, 0x1118,
-	0x9686, 0x0009, 0x01c0, 0x9086, 0x1900, 0x1168, 0x9686, 0x0009,
-	0x0190, 0x2001, 0x0004, 0x080c, 0x654f, 0x2001, 0x0028, 0x601a,
-	0x6007, 0x0052, 0x0020, 0x2001, 0x0001, 0x080c, 0xba7d, 0x002e,
-	0x00be, 0x009e, 0x0005, 0x9286, 0x0139, 0x0160, 0x6014, 0x2048,
-	0x080c, 0xcb35, 0x0140, 0xa864, 0x9086, 0x0139, 0x0118, 0xa868,
-	0xd0fc, 0x0108, 0x0c40, 0x6010, 0x2058, 0xb840, 0x9084, 0x00ff,
-	0x9005, 0x0138, 0x8001, 0xb842, 0x601b, 0x000a, 0x6007, 0x0016,
-	0x08f0, 0xb8a0, 0x9086, 0x007e, 0x1138, 0x00e6, 0x2071, 0x1800,
-	0x080c, 0x5fad, 0x00ee, 0x0010, 0x080c, 0x31bf, 0x0860, 0x080c,
-	0xbc85, 0x1160, 0x2001, 0x0004, 0x080c, 0x654f, 0x6003, 0x0001,
-	0x6007, 0x0003, 0x080c, 0x9138, 0x0804, 0x968d, 0x080c, 0xb813,
-	0x9006, 0x0804, 0xba7d, 0x0489, 0x1160, 0x2001, 0x0008, 0x080c,
-	0x654f, 0x6003, 0x0001, 0x6007, 0x0005, 0x080c, 0x9138, 0x0804,
-	0x968d, 0x2001, 0x0001, 0x0804, 0xba7d, 0x00f9, 0x1160, 0x2001,
-	0x000a, 0x080c, 0x654f, 0x6003, 0x0001, 0x6007, 0x0001, 0x080c,
-	0x9138, 0x0804, 0x968d, 0x2001, 0x0001, 0x0804, 0xba7d, 0x2009,
-	0x026e, 0x2104, 0x9086, 0x0003, 0x1138, 0x2009, 0x026f, 0x2104,
-	0x9084, 0xff00, 0x9086, 0x2a00, 0x0005, 0x9085, 0x0001, 0x0005,
-	0x00b6, 0x00c6, 0x0016, 0x6110, 0x2158, 0x080c, 0x660e, 0x001e,
-	0x00ce, 0x00be, 0x0005, 0x00b6, 0x00f6, 0x00e6, 0x00d6, 0x0036,
-	0x0016, 0x6010, 0x2058, 0x2009, 0x1837, 0x2104, 0x9085, 0x0003,
-	0x200a, 0x080c, 0xbd2b, 0x0560, 0x2009, 0x1837, 0x2104, 0xc0cd,
-	0x200a, 0x080c, 0x696e, 0x0158, 0x9006, 0x2020, 0x2009, 0x002a,
-	0x080c, 0xe5ae, 0x2001, 0x180c, 0x200c, 0xc195, 0x2102, 0x2019,
-	0x002a, 0x2009, 0x0001, 0x080c, 0x318a, 0x00e6, 0x2071, 0x1800,
-	0x080c, 0x2f96, 0x00ee, 0x00c6, 0x0156, 0x20a9, 0x0781, 0x2009,
-	0x007f, 0x080c, 0x32bb, 0x8108, 0x1f04, 0xbcc9, 0x015e, 0x00ce,
-	0x080c, 0xbc88, 0x2071, 0x0260, 0x2079, 0x0200, 0x7817, 0x0001,
-	0x2001, 0x1837, 0x200c, 0xc1c5, 0x7018, 0xd0fc, 0x0110, 0xd0dc,
-	0x0118, 0x7038, 0xd0dc, 0x1108, 0xc1c4, 0x7817, 0x0000, 0x2001,
-	0x1837, 0x2102, 0x2079, 0x0100, 0x2e04, 0x9084, 0x00ff, 0x2069,
-	0x181f, 0x206a, 0x78e6, 0x0006, 0x8e70, 0x2e04, 0x2069, 0x1820,
-	0x206a, 0x78ea, 0x7832, 0x7836, 0x2010, 0x9084, 0xff00, 0x001e,
-	0x9105, 0x2009, 0x182c, 0x200a, 0x2200, 0x9084, 0x00ff, 0x2008,
-	0x080c, 0x2887, 0x080c, 0x73bc, 0x0170, 0x2071, 0x0260, 0x2069,
-	0x1982, 0x7048, 0x206a, 0x704c, 0x6806, 0x7050, 0x680a, 0x7054,
-	0x680e, 0x080c, 0xcf44, 0x0040, 0x2001, 0x0006, 0x080c, 0x654f,
-	0x080c, 0x31e8, 0x080c, 0xae61, 0x001e, 0x003e, 0x00de, 0x00ee,
-	0x00fe, 0x00be, 0x0005, 0x0096, 0x0026, 0x0036, 0x00e6, 0x0156,
-	0x2019, 0x182c, 0x231c, 0x83ff, 0x01f0, 0x2071, 0x0260, 0x7200,
-	0x9294, 0x00ff, 0x7004, 0x9084, 0xff00, 0x9205, 0x9306, 0x1198,
-	0x2011, 0x0276, 0x20a9, 0x0004, 0x2b48, 0x2019, 0x000a, 0x080c,
-	0xbe1d, 0x1148, 0x2011, 0x027a, 0x20a9, 0x0004, 0x2019, 0x0006,
-	0x080c, 0xbe1d, 0x1100, 0x015e, 0x00ee, 0x003e, 0x002e, 0x009e,
-	0x0005, 0x00e6, 0x2071, 0x0260, 0x7034, 0x9086, 0x0014, 0x11a8,
-	0x7038, 0x9086, 0x0800, 0x1188, 0x703c, 0xd0ec, 0x0160, 0x9084,
-	0x0f00, 0x9086, 0x0100, 0x1138, 0x7054, 0xd0a4, 0x1110, 0xd0ac,
-	0x0110, 0x9006, 0x0010, 0x9085, 0x0001, 0x00ee, 0x0005, 0x00e6,
-	0x0096, 0x00c6, 0x0076, 0x0056, 0x0046, 0x0026, 0x0006, 0x0126,
-	0x2091, 0x8000, 0x2029, 0x19f0, 0x252c, 0x2021, 0x19f6, 0x2424,
-	0x2061, 0x1cd0, 0x2071, 0x1800, 0x7254, 0x7074, 0x9202, 0x1a04,
-	0xbde9, 0x080c, 0x8981, 0x0904, 0xbde2, 0x080c, 0xe5df, 0x0904,
-	0xbde2, 0x6720, 0x9786, 0x0007, 0x0904, 0xbde2, 0x2500, 0x9c06,
-	0x0904, 0xbde2, 0x2400, 0x9c06, 0x05e8, 0x3e08, 0x9186, 0x0002,
-	0x1148, 0x6010, 0x9005, 0x0130, 0x00b6, 0x2058, 0xb800, 0x00be,
-	0xd0bc, 0x1580, 0x00c6, 0x6000, 0x9086, 0x0004, 0x1110, 0x080c,
-	0x1a5e, 0x9786, 0x000a, 0x0148, 0x080c, 0xcd3b, 0x1130, 0x00ce,
-	0x080c, 0xb813, 0x080c, 0xae92, 0x00e8, 0x6014, 0x2048, 0x080c,
-	0xcb35, 0x01a8, 0x9786, 0x0003, 0x1530, 0xa867, 0x0103, 0xa87c,
-	0xd0cc, 0x0130, 0x0096, 0xa878, 0x2048, 0x080c, 0x0fb1, 0x009e,
-	0xab7a, 0xa877, 0x0000, 0x080c, 0x6c75, 0x080c, 0xcd1e, 0x080c,
-	0xae92, 0x00ce, 0x9ce0, 0x0018, 0x7068, 0x9c02, 0x1210, 0x0804,
-	0xbd8c, 0x012e, 0x000e, 0x002e, 0x004e, 0x005e, 0x007e, 0x00ce,
-	0x009e, 0x00ee, 0x0005, 0x9786, 0x0006, 0x1118, 0x080c, 0xe551,
-	0x0c30, 0x9786, 0x0009, 0x1148, 0x6000, 0x9086, 0x0004, 0x0d08,
-	0x2009, 0x004c, 0x080c, 0xaedc, 0x08e0, 0x9786, 0x000a, 0x0938,
-	0x0820, 0x220c, 0x2304, 0x9106, 0x1130, 0x8210, 0x8318, 0x1f04,
-	0xbe09, 0x9006, 0x0005, 0x2304, 0x9102, 0x0218, 0x2001, 0x0001,
-	0x0008, 0x9006, 0x918d, 0x0001, 0x0005, 0x0136, 0x01c6, 0x0016,
-	0x8906, 0x8006, 0x8007, 0x908c, 0x003f, 0x21e0, 0x9084, 0xffc0,
-	0x9300, 0x2098, 0x3518, 0x20a9, 0x0001, 0x220c, 0x4002, 0x910e,
-	0x1140, 0x8210, 0x8319, 0x1dc8, 0x9006, 0x001e, 0x01ce, 0x013e,
-	0x0005, 0x220c, 0x9102, 0x0218, 0x2001, 0x0001, 0x0010, 0x2001,
-	0x0000, 0x918d, 0x0001, 0x001e, 0x01ce, 0x013e, 0x0005, 0x220c,
-	0x810f, 0x2304, 0x9106, 0x1130, 0x8210, 0x8318, 0x1f04, 0xbe47,
-	0x9006, 0x0005, 0x918d, 0x0001, 0x0005, 0x6004, 0x908a, 0x0053,
-	0x1a0c, 0x0dd5, 0x080c, 0xcd2a, 0x0120, 0x080c, 0xcd3b, 0x0168,
-	0x0028, 0x080c, 0x31e8, 0x080c, 0xcd3b, 0x0138, 0x080c, 0x9588,
-	0x080c, 0xae61, 0x080c, 0x968d, 0x0005, 0x080c, 0xb813, 0x0cb0,
-	0x9182, 0x0054, 0x1220, 0x9182, 0x0040, 0x0208, 0x000a, 0x0005,
-	0xbe8c, 0xbe8c, 0xbe8c, 0xbe8c, 0xbe8c, 0xbe8c, 0xbe8c, 0xbe8c,
-	0xbe8c, 0xbe8c, 0xbe8c, 0xbe8e, 0xbe8e, 0xbe8e, 0xbe8e, 0xbe8c,
-	0xbe8c, 0xbe8c, 0xbe8e, 0xbe8c, 0x080c, 0x0dd5, 0x600b, 0xffff,
-	0x6003, 0x0001, 0x6106, 0x080c, 0x90f0, 0x0126, 0x2091, 0x8000,
-	0x080c, 0x968d, 0x012e, 0x0005, 0x9186, 0x0013, 0x1128, 0x6004,
-	0x9082, 0x0040, 0x0804, 0xbf43, 0x9186, 0x0027, 0x1520, 0x080c,
-	0x9588, 0x080c, 0x31bf, 0x080c, 0xd245, 0x0096, 0x6114, 0x2148,
-	0x080c, 0xcb35, 0x0198, 0x080c, 0xcd3b, 0x1118, 0x080c, 0xb813,
-	0x0068, 0xa867, 0x0103, 0xa87b, 0x0029, 0xa877, 0x0000, 0xa97c,
-	0xc1c5, 0xa97e, 0x080c, 0x6c81, 0x080c, 0xcd1e, 0x009e, 0x080c,
-	0xae61, 0x0804, 0x968d, 0x9186, 0x0014, 0x1120, 0x6004, 0x9082,
-	0x0040, 0x04a0, 0x9186, 0x0046, 0x0150, 0x9186, 0x0045, 0x0138,
-	0x9186, 0x0053, 0x0120, 0x9186, 0x0048, 0x190c, 0x0dd5, 0x2001,
-	0x0109, 0x2004, 0xd084, 0x0508, 0x0126, 0x2091, 0x2800, 0x0006,
-	0x0016, 0x0026, 0x0036, 0x00f6, 0x00e6, 0x00c6, 0x2079, 0x19e7,
-	0x2071, 0x1800, 0x2061, 0x0100, 0x080c, 0x8fd5, 0x00ce, 0x00ee,
-	0x00fe, 0x003e, 0x002e, 0x001e, 0x000e, 0x012e, 0xa001, 0x6000,
-	0x9086, 0x0002, 0x1110, 0x0804, 0xbf81, 0x0005, 0x0002, 0xbf1d,
-	0xbf1b, 0xbf1b, 0xbf1b, 0xbf1b, 0xbf1b, 0xbf1b, 0xbf1b, 0xbf1b,
-	0xbf1b, 0xbf1b, 0xbf38, 0xbf38, 0xbf38, 0xbf38, 0xbf1b, 0xbf38,
-	0xbf1b, 0xbf38, 0xbf1b, 0x080c, 0x0dd5, 0x080c, 0x9588, 0x0096,
-	0x6114, 0x2148, 0x080c, 0xcb35, 0x0168, 0xa867, 0x0103, 0xa87b,
-	0x0006, 0xa877, 0x0000, 0xa880, 0xc0ec, 0xa882, 0x080c, 0x6c81,
-	0x080c, 0xcd1e, 0x009e, 0x080c, 0xae61, 0x080c, 0x968d, 0x0005,
-	0x080c, 0x9588, 0x080c, 0xcd3b, 0x090c, 0xb813, 0x080c, 0xae61,
-	0x080c, 0x968d, 0x0005, 0x0002, 0xbf5a, 0xbf58, 0xbf58, 0xbf58,
-	0xbf58, 0xbf58, 0xbf58, 0xbf58, 0xbf58, 0xbf58, 0xbf58, 0xbf71,
-	0xbf71, 0xbf71, 0xbf71, 0xbf58, 0xbf7b, 0xbf58, 0xbf71, 0xbf58,
-	0x080c, 0x0dd5, 0x0096, 0x080c, 0x9588, 0x6014, 0x2048, 0x2001,
-	0x1988, 0x2004, 0x6042, 0xa97c, 0xd1ac, 0x0140, 0x6003, 0x0004,
-	0xa87c, 0x9085, 0x0400, 0xa87e, 0x009e, 0x0005, 0x6003, 0x0002,
-	0x0cb8, 0x080c, 0x9588, 0x080c, 0xd248, 0x080c, 0xd24d, 0x6003,
-	0x000f, 0x0804, 0x968d, 0x080c, 0x9588, 0x080c, 0xae61, 0x0804,
-	0x968d, 0x9182, 0x0054, 0x1220, 0x9182, 0x0040, 0x0208, 0x000a,
-	0x0005, 0xbf9d, 0xbf9d, 0xbf9d, 0xbf9d, 0xbf9d, 0xbf9f, 0xc07c,
-	0xbf9d, 0xc0b0, 0xbf9d, 0xbf9d, 0xbf9d, 0xbf9d, 0xbf9d, 0xbf9d,
-	0xbf9d, 0xbf9d, 0xbf9d, 0xbf9d, 0xc0b0, 0x080c, 0x0dd5, 0x00b6,
-	0x0096, 0x6114, 0x2148, 0x7644, 0x96b4, 0x0fff, 0x86ff, 0x1528,
-	0x6010, 0x2058, 0xb800, 0xd0bc, 0x1904, 0xc06b, 0xa87b, 0x0000,
-	0xa867, 0x0103, 0xae76, 0xa87c, 0xd0ac, 0x0128, 0xa834, 0xa938,
-	0x9115, 0x190c, 0xc245, 0x080c, 0x6a9d, 0x6210, 0x2258, 0xba3c,
-	0x82ff, 0x0110, 0x8211, 0xba3e, 0x7044, 0xd0e4, 0x1904, 0xc04f,
-	0x080c, 0xae61, 0x009e, 0x00be, 0x0005, 0x968c, 0x0c00, 0x0150,
-	0x6010, 0x2058, 0xb800, 0xd0bc, 0x1904, 0xc053, 0x7348, 0xab92,
-	0x734c, 0xab8e, 0x968c, 0x00ff, 0x9186, 0x0002, 0x0508, 0x9186,
-	0x0028, 0x1118, 0xa87b, 0x001c, 0x00e8, 0xd6dc, 0x01a0, 0xa87b,
-	0x0015, 0xa87c, 0xd0ac, 0x0170, 0xa938, 0xaa34, 0x2100, 0x9205,
-	0x0148, 0x7048, 0x9106, 0x1118, 0x704c, 0x9206, 0x0118, 0xa992,
-	0xaa8e, 0xc6dc, 0x0038, 0xd6d4, 0x0118, 0xa87b, 0x0007, 0x0010,
-	0xa87b, 0x0000, 0xa867, 0x0103, 0xae76, 0x901e, 0xd6c4, 0x01d8,
-	0x9686, 0x0100, 0x1130, 0x7064, 0x9005, 0x1118, 0xc6c4, 0x0804,
-	0xbfa6, 0x735c, 0xab86, 0x83ff, 0x0170, 0x938a, 0x0009, 0x0210,
-	0x2019, 0x0008, 0x0036, 0x2308, 0x2019, 0x0018, 0x2011, 0x0025,
-	0x080c, 0xc730, 0x003e, 0xd6cc, 0x0904, 0xbfbb, 0x7154, 0xa98a,
-	0x81ff, 0x0904, 0xbfbb, 0x9192, 0x0021, 0x1278, 0x8304, 0x9098,
-	0x0018, 0x2011, 0x0029, 0x080c, 0xc730, 0x2011, 0x0205, 0x2013,
-	0x0000, 0x080c, 0xd1d5, 0x0804, 0xbfbb, 0xa868, 0xd0fc, 0x0120,
-	0x2009, 0x0020, 0xa98a, 0x0c50, 0x00a6, 0x2950, 0x080c, 0xc6cf,
-	0x00ae, 0x080c, 0xd1d5, 0x080c, 0xc720, 0x0804, 0xbfbd, 0x080c,
-	0xce2e, 0x0804, 0xbfca, 0xa87c, 0xd0ac, 0x0904, 0xbfd6, 0xa880,
-	0xd0bc, 0x1904, 0xbfd6, 0x7348, 0xa838, 0x9306, 0x11c8, 0x734c,
-	0xa834, 0x931e, 0x0904, 0xbfd6, 0xd6d4, 0x0190, 0xab38, 0x9305,
-	0x0904, 0xbfd6, 0x0068, 0xa87c, 0xd0ac, 0x0904, 0xbfae, 0xa838,
-	0xa934, 0x9105, 0x0904, 0xbfae, 0xa880, 0xd0bc, 0x1904, 0xbfae,
-	0x080c, 0xce68, 0x0804, 0xbfca, 0x0096, 0x00f6, 0x6003, 0x0003,
-	0x6007, 0x0043, 0x2079, 0x026c, 0x7c04, 0x7b00, 0x7e0c, 0x7d08,
-	0x6014, 0x2048, 0xa87c, 0xd0ac, 0x0140, 0x6003, 0x0002, 0x00fe,
-	0x009e, 0x0005, 0x2130, 0x2228, 0x0058, 0x2400, 0xa9ac, 0x910a,
-	0x2300, 0xaab0, 0x9213, 0x2600, 0x9102, 0x2500, 0x9203, 0x0e90,
-	0xac36, 0xab3a, 0xae46, 0xad4a, 0x00fe, 0x6043, 0x0000, 0x2c10,
-	0x080c, 0x1bad, 0x080c, 0x9155, 0x080c, 0x97b9, 0x009e, 0x0005,
-	0x0005, 0x9182, 0x0054, 0x1220, 0x9182, 0x0040, 0x0208, 0x000a,
-	0x0005, 0xc0cd, 0xc0cd, 0xc0cd, 0xc0cd, 0xc0cd, 0xc0cf, 0xc165,
-	0xc0cd, 0xc0cd, 0xc17c, 0xc208, 0xc0cd, 0xc0cd, 0xc0cd, 0xc0cd,
-	0xc21d, 0xc0cd, 0xc0cd, 0xc0cd, 0xc0cd, 0x080c, 0x0dd5, 0x0076,
-	0x00a6, 0x00e6, 0x0096, 0x2071, 0x0260, 0x6114, 0x2150, 0x7644,
-	0xb676, 0x96b4, 0x0fff, 0xb77c, 0xc7e5, 0xb77e, 0x6210, 0x00b6,
-	0x2258, 0xba3c, 0x82ff, 0x0110, 0x8211, 0xba3e, 0x00be, 0x86ff,
-	0x0904, 0xc160, 0x9694, 0xff00, 0x9284, 0x0c00, 0x0120, 0x7048,
-	0xb092, 0x704c, 0xb08e, 0x9284, 0x0300, 0x0904, 0xc160, 0x080c,
-	0x0fff, 0x090c, 0x0dd5, 0x2900, 0xb07a, 0xb77c, 0xc7cd, 0xb77e,
-	0xa867, 0x0103, 0xb068, 0xa86a, 0xb06c, 0xa86e, 0xb070, 0xa872,
-	0xae76, 0x968c, 0x0c00, 0x0120, 0x7348, 0xab92, 0x734c, 0xab8e,
-	0x968c, 0x00ff, 0x9186, 0x0002, 0x0180, 0x9186, 0x0028, 0x1118,
-	0xa87b, 0x001c, 0x0060, 0xd6dc, 0x0118, 0xa87b, 0x0015, 0x0038,
-	0xd6d4, 0x0118, 0xa87b, 0x0007, 0x0010, 0xa87b, 0x0000, 0xaf7e,
-	0xb080, 0xa882, 0xb084, 0xa886, 0x901e, 0xd6c4, 0x0190, 0x735c,
-	0xab86, 0x83ff, 0x0170, 0x938a, 0x0009, 0x0210, 0x2019, 0x0008,
-	0x0036, 0x2308, 0x2019, 0x0018, 0x2011, 0x0025, 0x080c, 0xc730,
-	0x003e, 0xd6cc, 0x01e8, 0x7154, 0xa98a, 0x81ff, 0x01c8, 0x9192,
-	0x0021, 0x1260, 0x8304, 0x9098, 0x0018, 0x2011, 0x0029, 0x080c,
-	0xc730, 0x2011, 0x0205, 0x2013, 0x0000, 0x0050, 0xb068, 0xd0fc,
-	0x0120, 0x2009, 0x0020, 0xa98a, 0x0c68, 0x2950, 0x080c, 0xc6cf,
-	0x009e, 0x00ee, 0x00ae, 0x007e, 0x0005, 0x00f6, 0x00a6, 0x6003,
-	0x0003, 0x2079, 0x026c, 0x7c04, 0x7b00, 0x7e0c, 0x7d08, 0x6014,
-	0x2050, 0xb436, 0xb33a, 0xb646, 0xb54a, 0x00ae, 0x00fe, 0x2c10,
-	0x080c, 0x1bad, 0x0804, 0xa240, 0x6003, 0x0002, 0x6004, 0x9086,
-	0x0040, 0x11c8, 0x0096, 0x6014, 0x2048, 0xa87c, 0xd0ac, 0x0160,
-	0x601c, 0xd084, 0x1130, 0x00f6, 0x2c00, 0x2078, 0x080c, 0x1725,
-	0x00fe, 0x6003, 0x0004, 0x0010, 0x6003, 0x0002, 0x009e, 0x080c,
-	0x9588, 0x080c, 0x968d, 0x0096, 0x2001, 0x1988, 0x2004, 0x6042,
-	0x080c, 0x963d, 0x080c, 0x97b9, 0x6114, 0x2148, 0xa97c, 0xd1e4,
-	0x0904, 0xc203, 0xd1cc, 0x05a8, 0xa978, 0xa868, 0xd0fc, 0x0538,
-	0x0016, 0xa87c, 0x0006, 0xa880, 0x0006, 0xa860, 0x20e8, 0xa85c,
-	0x9080, 0x0019, 0x20a0, 0x810e, 0x810e, 0x810f, 0x9184, 0x003f,
-	0x20e0, 0x9184, 0xffc0, 0x9080, 0x0019, 0x2098, 0x0156, 0x20a9,
-	0x0020, 0x4003, 0x015e, 0x000e, 0xa882, 0x000e, 0xa87e, 0x001e,
-	0xa874, 0x0006, 0x2148, 0x080c, 0x0fb1, 0x001e, 0x0440, 0x0016,
-	0x080c, 0x0fb1, 0x009e, 0xa974, 0x0016, 0x080c, 0xc720, 0x001e,
-	0x00f0, 0xa867, 0x0103, 0xa974, 0x9184, 0x00ff, 0x90b6, 0x0002,
-	0x0180, 0x9086, 0x0028, 0x1118, 0xa87b, 0x001c, 0x0060, 0xd1dc,
-	0x0118, 0xa87b, 0x0015, 0x0038, 0xd1d4, 0x0118, 0xa87b, 0x0007,
-	0x0010, 0xa87b, 0x0000, 0x0016, 0x080c, 0x6a9d, 0x001e, 0xd1e4,
-	0x1120, 0x080c, 0xae61, 0x009e, 0x0005, 0x080c, 0xce2e, 0x0cd8,
-	0x6004, 0x9086, 0x0040, 0x1120, 0x080c, 0x9588, 0x080c, 0x968d,
-	0x2019, 0x0001, 0x080c, 0xa5b6, 0x6003, 0x0002, 0x080c, 0xd24d,
-	0x080c, 0x963d, 0x080c, 0x97b9, 0x0005, 0x6004, 0x9086, 0x0040,
-	0x1120, 0x080c, 0x9588, 0x080c, 0x968d, 0x2019, 0x0001, 0x080c,
-	0xa5b6, 0x080c, 0x963d, 0x080c, 0x31bf, 0x080c, 0xd245, 0x0096,
-	0x6114, 0x2148, 0x080c, 0xcb35, 0x0150, 0xa867, 0x0103, 0xa87b,
-	0x0029, 0xa877, 0x0000, 0x080c, 0x6c81, 0x080c, 0xcd1e, 0x009e,
-	0x080c, 0xae61, 0x080c, 0x97b9, 0x0005, 0xa87b, 0x0015, 0xd1fc,
-	0x0180, 0xa87b, 0x0007, 0x8002, 0x8000, 0x810a, 0x9189, 0x0000,
-	0x0006, 0x0016, 0x2009, 0x1a7a, 0x2104, 0x8000, 0x200a, 0x001e,
-	0x000e, 0xa992, 0xa88e, 0x0005, 0x9182, 0x0054, 0x1220, 0x9182,
-	0x0040, 0x0208, 0x000a, 0x0005, 0xc278, 0xc278, 0xc278, 0xc278,
-	0xc278, 0xc27a, 0xc278, 0xc278, 0xc320, 0xc278, 0xc278, 0xc278,
-	0xc278, 0xc278, 0xc278, 0xc278, 0xc278, 0xc278, 0xc278, 0xc451,
+	0x0136, 0x9080, 0x001b, 0x20a0, 0x2011, 0x0006, 0x20a9, 0x0001,
+	0x3418, 0x8318, 0x23a0, 0x4003, 0x3318, 0x8318, 0x2398, 0x8211,
+	0x1db8, 0x2011, 0x0006, 0x013e, 0x20a0, 0x3318, 0x8318, 0x2398,
+	0x4003, 0x3418, 0x8318, 0x23a0, 0x8211, 0x1db8, 0x0096, 0x080c,
+	0xcb4a, 0x0130, 0x6014, 0x2048, 0xa807, 0x0000, 0xa867, 0x0103,
+	0x009e, 0x0804, 0xae71, 0x0096, 0x00d6, 0x0036, 0x7330, 0x9386,
+	0x0200, 0x11a8, 0x6010, 0x00b6, 0x2058, 0xb8cf, 0x0000, 0x00be,
+	0x6014, 0x9005, 0x0130, 0x2048, 0xa807, 0x0000, 0xa867, 0x0103,
+	0xab32, 0x080c, 0xae71, 0x003e, 0x00de, 0x009e, 0x0005, 0x0011,
+	0x1d48, 0x0cc8, 0x0006, 0x0016, 0x080c, 0xd24a, 0x0188, 0x6014,
+	0x9005, 0x1170, 0x600b, 0x0003, 0x601b, 0x0000, 0x6043, 0x0000,
+	0x2009, 0x0022, 0x080c, 0xb668, 0x9006, 0x001e, 0x000e, 0x0005,
+	0x9085, 0x0001, 0x0cd0, 0x0096, 0x0016, 0x20a9, 0x0014, 0x9e80,
+	0x000c, 0x20e1, 0x0000, 0x2098, 0x6014, 0x2048, 0xa860, 0x20e8,
+	0xa85c, 0x9080, 0x0002, 0x20a0, 0x4003, 0x2001, 0x0205, 0x2003,
+	0x0001, 0x2099, 0x0260, 0x20a9, 0x0016, 0x4003, 0x20a9, 0x000a,
+	0xa804, 0x2048, 0xa860, 0x20e8, 0xa85c, 0x9080, 0x0002, 0x20a0,
+	0x4003, 0x2001, 0x0205, 0x2003, 0x0002, 0x2099, 0x0260, 0x20a9,
+	0x0020, 0x4003, 0x2003, 0x0000, 0x6014, 0x2048, 0xa800, 0x2048,
+	0xa867, 0x0103, 0x080c, 0xae71, 0x001e, 0x009e, 0x0005, 0x0096,
+	0x0016, 0x900e, 0x7030, 0x9086, 0x0100, 0x0140, 0x7038, 0x9084,
+	0x00ff, 0x800c, 0x703c, 0x9084, 0x00ff, 0x8004, 0x9080, 0x0004,
+	0x9108, 0x810b, 0x2011, 0x0002, 0x2019, 0x000c, 0x6014, 0x2048,
+	0x080c, 0xc743, 0x080c, 0xcb4a, 0x0140, 0x6014, 0x2048, 0xa807,
+	0x0000, 0xa864, 0xa8e2, 0xa867, 0x0103, 0x080c, 0xae71, 0x001e,
+	0x009e, 0x0005, 0x0016, 0x2009, 0x0000, 0x7030, 0x9086, 0x0200,
+	0x0110, 0x2009, 0x0001, 0x0096, 0x6014, 0x904d, 0x090c, 0x0dd5,
+	0xa97a, 0x080c, 0x6c86, 0x009e, 0x080c, 0xae71, 0x001e, 0x0005,
+	0x0016, 0x0096, 0x7030, 0x9086, 0x0100, 0x1118, 0x2009, 0x0004,
+	0x0010, 0x7034, 0x800c, 0x810b, 0x2011, 0x000c, 0x2019, 0x000c,
+	0x6014, 0x2048, 0xa804, 0x0096, 0x9005, 0x0108, 0x2048, 0x080c,
+	0xc743, 0x009e, 0x080c, 0xcb4a, 0x0148, 0xa804, 0x9005, 0x1158,
+	0xa807, 0x0000, 0xa864, 0xa8e2, 0xa867, 0x0103, 0x080c, 0xae71,
+	0x009e, 0x001e, 0x0005, 0x0086, 0x2040, 0xa030, 0x8007, 0x9086,
+	0x0100, 0x1118, 0x080c, 0xb824, 0x00e0, 0xa034, 0x8007, 0x800c,
+	0x8806, 0x8006, 0x8007, 0x90bc, 0x003f, 0x9084, 0xffc0, 0x9080,
+	0x000c, 0xa87b, 0x0000, 0xa883, 0x0000, 0xa897, 0x4000, 0xaaa0,
+	0xab9c, 0xaca8, 0xada4, 0x2031, 0x0000, 0x2041, 0x1243, 0x0019,
+	0x0d08, 0x008e, 0x0898, 0x0096, 0x0006, 0x080c, 0x0fff, 0x000e,
+	0x01b0, 0xa8ab, 0x0dcb, 0xa876, 0x000e, 0xa8a2, 0x0006, 0xae6a,
+	0x2800, 0xa89e, 0xa97a, 0xaf72, 0xaa8e, 0xab92, 0xac96, 0xad9a,
+	0x0086, 0x2940, 0x080c, 0x10e9, 0x008e, 0x9085, 0x0001, 0x009e,
+	0x0005, 0x00e6, 0x00d6, 0x0026, 0x7008, 0x9084, 0x00ff, 0x6210,
+	0x00b6, 0x2258, 0xba10, 0x00be, 0x9206, 0x1520, 0x700c, 0x6210,
+	0x00b6, 0x2258, 0xba14, 0x00be, 0x9206, 0x11e0, 0x6043, 0x0000,
+	0x2c68, 0x0016, 0x2009, 0x0035, 0x080c, 0xd1c2, 0x001e, 0x1158,
+	0x622c, 0x2268, 0x2071, 0x026c, 0x6b20, 0x9386, 0x0003, 0x0130,
+	0x9386, 0x0006, 0x0128, 0x080c, 0xae71, 0x0020, 0x0039, 0x0010,
+	0x080c, 0xb49d, 0x002e, 0x00de, 0x00ee, 0x0005, 0x0096, 0x6814,
+	0x2048, 0x9186, 0x0015, 0x0904, 0xb485, 0x918e, 0x0016, 0x1904,
+	0xb49b, 0x700c, 0x908c, 0xff00, 0x9186, 0x1700, 0x0120, 0x9186,
+	0x0300, 0x1904, 0xb45f, 0x89ff, 0x1138, 0x6800, 0x9086, 0x000f,
+	0x0904, 0xb442, 0x0804, 0xb499, 0x6808, 0x9086, 0xffff, 0x1904,
+	0xb487, 0xa87c, 0x9084, 0x0060, 0x9086, 0x0020, 0x1128, 0xa83c,
+	0xa940, 0x9105, 0x1904, 0xb487, 0x6824, 0xd0b4, 0x1904, 0xb487,
+	0x080c, 0xcd33, 0x685c, 0xa882, 0xa87c, 0xc0dc, 0xc0f4, 0xc0d4,
+	0xa87e, 0x0026, 0x900e, 0x6a18, 0x2001, 0x000a, 0x080c, 0x8f51,
+	0xa884, 0x920a, 0x0208, 0x8011, 0xaa86, 0x82ff, 0x002e, 0x1138,
+	0x00c6, 0x2d60, 0x080c, 0xc86d, 0x00ce, 0x0804, 0xb499, 0x00c6,
+	0xa868, 0xd0fc, 0x1118, 0x080c, 0x60b7, 0x0010, 0x080c, 0x64bd,
+	0x00ce, 0x1904, 0xb487, 0x00c6, 0x2d60, 0x080c, 0xae71, 0x00ce,
+	0x0804, 0xb499, 0x00c6, 0x080c, 0xaebf, 0x0198, 0x6017, 0x0000,
+	0x6810, 0x6012, 0x080c, 0xcfc4, 0x6023, 0x0003, 0x6904, 0x00c6,
+	0x2d60, 0x080c, 0xae71, 0x00ce, 0x080c, 0xaeec, 0x00ce, 0x0804,
+	0xb499, 0x2001, 0x1987, 0x2004, 0x6842, 0x00ce, 0x04d0, 0x7008,
+	0x9086, 0x000b, 0x11c8, 0x6010, 0x00b6, 0x2058, 0xb900, 0xc1bc,
+	0xb902, 0x00be, 0x00c6, 0x2d60, 0xa87b, 0x0003, 0x080c, 0xd204,
+	0x6007, 0x0085, 0x6003, 0x000b, 0x6023, 0x0002, 0x080c, 0x90d9,
+	0x080c, 0x9687, 0x00ce, 0x00e8, 0x700c, 0x9086, 0x2a00, 0x1138,
+	0x2001, 0x1987, 0x2004, 0x6842, 0x00a0, 0x0479, 0x00a0, 0x89ff,
+	0x090c, 0x0dd5, 0x00c6, 0x00d6, 0x2d60, 0xa867, 0x0103, 0xa87b,
+	0x0003, 0x080c, 0x6aa2, 0x080c, 0xcd33, 0x080c, 0xaea2, 0x00de,
+	0x00ce, 0x080c, 0xae71, 0x009e, 0x0005, 0x9186, 0x0015, 0x1128,
+	0x2001, 0x1987, 0x2004, 0x6842, 0x0068, 0x918e, 0x0016, 0x1160,
+	0x00c6, 0x2d00, 0x2060, 0x080c, 0xe82c, 0x080c, 0x869b, 0x080c,
+	0xae71, 0x00ce, 0x080c, 0xae71, 0x0005, 0x0026, 0x0036, 0x0046,
+	0x7228, 0xacb0, 0xabac, 0xd2f4, 0x0130, 0x2001, 0x1987, 0x2004,
+	0x6842, 0x0804, 0xb517, 0x00c6, 0x2d60, 0x080c, 0xc76e, 0x00ce,
+	0x6804, 0x9086, 0x0050, 0x1168, 0x00c6, 0x2d00, 0x2060, 0x6003,
+	0x0001, 0x6007, 0x0050, 0x080c, 0x90d9, 0x080c, 0x9687, 0x00ce,
+	0x04f0, 0x6800, 0x9086, 0x000f, 0x01a8, 0x89ff, 0x090c, 0x0dd5,
+	0x6800, 0x9086, 0x0004, 0x1190, 0xa87c, 0xd0ac, 0x0178, 0xa843,
+	0x0fff, 0xa83f, 0x0fff, 0xa880, 0xc0fc, 0xa882, 0x2001, 0x0001,
+	0x6832, 0x0400, 0x2001, 0x0007, 0x6832, 0x00e0, 0xa87c, 0xd0b4,
+	0x1150, 0xd0ac, 0x0db8, 0x6824, 0xd0f4, 0x1d48, 0xa838, 0xa934,
+	0x9105, 0x0d80, 0x0c20, 0xd2ec, 0x1d68, 0x7024, 0x9306, 0x1118,
+	0x7020, 0x9406, 0x0d38, 0x7020, 0x683e, 0x7024, 0x683a, 0x2001,
+	0x0005, 0x6832, 0x080c, 0xcebb, 0x080c, 0x9687, 0x0010, 0x080c,
+	0xae71, 0x004e, 0x003e, 0x002e, 0x0005, 0x00e6, 0x00d6, 0x0026,
+	0x7008, 0x9084, 0x00ff, 0x6210, 0x00b6, 0x2258, 0xba10, 0x00be,
+	0x9206, 0x1904, 0xb582, 0x700c, 0x6210, 0x00b6, 0x2258, 0xba14,
+	0x00be, 0x9206, 0x1904, 0xb582, 0x6038, 0x2068, 0x6824, 0xc0dc,
+	0x6826, 0x6a20, 0x9286, 0x0007, 0x0904, 0xb582, 0x9286, 0x0002,
+	0x0904, 0xb582, 0x9286, 0x0000, 0x05e8, 0x6808, 0x633c, 0x9306,
+	0x15c8, 0x2071, 0x026c, 0x9186, 0x0015, 0x0570, 0x918e, 0x0016,
+	0x1100, 0x00c6, 0x6038, 0x2060, 0x6104, 0x9186, 0x004b, 0x01c0,
+	0x9186, 0x004c, 0x01a8, 0x9186, 0x004d, 0x0190, 0x9186, 0x004e,
+	0x0178, 0x9186, 0x0052, 0x0160, 0x6014, 0x0096, 0x2048, 0x080c,
+	0xcb4a, 0x090c, 0x0dd5, 0xa87b, 0x0003, 0x009e, 0x080c, 0xd204,
+	0x6007, 0x0085, 0x6003, 0x000b, 0x6023, 0x0002, 0x080c, 0x90d9,
+	0x080c, 0x9687, 0x00ce, 0x0030, 0x6038, 0x2070, 0x2001, 0x1987,
+	0x2004, 0x7042, 0x080c, 0xae71, 0x002e, 0x00de, 0x00ee, 0x0005,
+	0x00b6, 0x0096, 0x00f6, 0x6014, 0x2048, 0x6010, 0x2058, 0x91b6,
+	0x0015, 0x0130, 0xba08, 0xbb0c, 0xbc00, 0xc48c, 0xbc02, 0x0460,
+	0x0096, 0x0156, 0x0036, 0x0026, 0x2b48, 0x9e90, 0x0010, 0x2019,
+	0x000a, 0x20a9, 0x0004, 0x080c, 0xbe30, 0x002e, 0x003e, 0x015e,
+	0x009e, 0x1904, 0xb5f1, 0x0096, 0x0156, 0x0036, 0x0026, 0x2b48,
+	0x9e90, 0x0014, 0x2019, 0x0006, 0x20a9, 0x0004, 0x080c, 0xbe30,
+	0x002e, 0x003e, 0x015e, 0x009e, 0x15a0, 0x7238, 0xba0a, 0x733c,
+	0xbb0e, 0xbc00, 0xc48d, 0xbc02, 0xa804, 0x9005, 0x1128, 0x00fe,
+	0x009e, 0x00be, 0x0804, 0xb276, 0x0096, 0x2048, 0xaa12, 0xab16,
+	0xac0a, 0x009e, 0x8006, 0x8006, 0x8007, 0x90bc, 0x003f, 0x9084,
+	0xffc0, 0x9080, 0x0002, 0x2009, 0x002b, 0xaaa0, 0xab9c, 0xaca8,
+	0xada4, 0x2031, 0x0000, 0x2041, 0x1243, 0x080c, 0xb38b, 0x0130,
+	0x00fe, 0x009e, 0x080c, 0xae71, 0x00be, 0x0005, 0x080c, 0xb824,
+	0x0cb8, 0x2b78, 0x00f6, 0x080c, 0x31c1, 0x080c, 0xd25f, 0x00fe,
+	0x00c6, 0x080c, 0xae1b, 0x2f00, 0x6012, 0x6017, 0x0000, 0x6023,
+	0x0001, 0x6007, 0x0001, 0x6003, 0x0001, 0x2001, 0x0007, 0x080c,
+	0x6558, 0x080c, 0x6584, 0x080c, 0x9121, 0x080c, 0x9687, 0x00ce,
+	0x0804, 0xb5c4, 0x2100, 0x91b2, 0x0053, 0x1a0c, 0x0dd5, 0x91b2,
+	0x0040, 0x1a04, 0xb67a, 0x0002, 0xb668, 0xb668, 0xb65e, 0xb668,
+	0xb668, 0xb668, 0xb65c, 0xb65c, 0xb65c, 0xb65c, 0xb65c, 0xb65c,
+	0xb65c, 0xb65c, 0xb65c, 0xb65c, 0xb65c, 0xb65c, 0xb65c, 0xb65c,
+	0xb65c, 0xb65c, 0xb65c, 0xb65c, 0xb65c, 0xb65c, 0xb65c, 0xb65c,
+	0xb65c, 0xb65c, 0xb65c, 0xb668, 0xb65c, 0xb668, 0xb668, 0xb65c,
+	0xb65c, 0xb65c, 0xb65c, 0xb65c, 0xb65e, 0xb65c, 0xb65c, 0xb65c,
+	0xb65c, 0xb65c, 0xb65c, 0xb65c, 0xb65c, 0xb65c, 0xb668, 0xb668,
+	0xb65c, 0xb65c, 0xb65c, 0xb65c, 0xb65c, 0xb65c, 0xb65c, 0xb65c,
+	0xb65c, 0xb668, 0xb65c, 0xb65c, 0x080c, 0x0dd5, 0x0066, 0x00b6,
+	0x6610, 0x2658, 0xb8cc, 0xc08c, 0xb8ce, 0x00be, 0x006e, 0x0000,
+	0x6003, 0x0001, 0x6106, 0x9186, 0x0032, 0x0118, 0x080c, 0x9121,
+	0x0010, 0x080c, 0x90d9, 0x0126, 0x2091, 0x8000, 0x080c, 0x9687,
+	0x012e, 0x0005, 0x2600, 0x0002, 0xb668, 0xb668, 0xb68e, 0xb668,
+	0xb668, 0xb68e, 0xb68e, 0xb68e, 0xb68e, 0xb668, 0xb68e, 0xb668,
+	0xb68e, 0xb668, 0xb68e, 0xb68e, 0xb68e, 0xb68e, 0x080c, 0x0dd5,
+	0x6004, 0x90b2, 0x0053, 0x1a0c, 0x0dd5, 0x91b6, 0x0013, 0x0904,
+	0xb752, 0x91b6, 0x0027, 0x1904, 0xb70d, 0x080c, 0x957b, 0x6004,
+	0x080c, 0xcd3f, 0x01b0, 0x080c, 0xcd50, 0x01a8, 0x908e, 0x0021,
+	0x0904, 0xb70a, 0x908e, 0x0022, 0x1130, 0x080c, 0xb2a2, 0x0904,
+	0xb706, 0x0804, 0xb707, 0x908e, 0x003d, 0x0904, 0xb70a, 0x0804,
+	0xb700, 0x080c, 0x31ea, 0x2001, 0x0007, 0x080c, 0x6558, 0x6010,
+	0x00b6, 0x2058, 0xb9a0, 0x00be, 0x080c, 0xb824, 0x9186, 0x007e,
+	0x1148, 0x2001, 0x1837, 0x2014, 0xc285, 0x080c, 0x73a5, 0x1108,
+	0xc2ad, 0x2202, 0x0036, 0x0026, 0x2019, 0x0028, 0x2110, 0x080c,
+	0xe938, 0x002e, 0x003e, 0x0016, 0x0026, 0x0036, 0x2110, 0x2019,
+	0x0028, 0x080c, 0x927e, 0x0076, 0x903e, 0x080c, 0x9151, 0x6010,
+	0x00b6, 0x905d, 0x0100, 0x00be, 0x2c08, 0x080c, 0xe30c, 0x007e,
+	0x003e, 0x002e, 0x001e, 0x080c, 0xd25f, 0x0016, 0x080c, 0xcfbc,
+	0x080c, 0xae71, 0x001e, 0x080c, 0x32bd, 0x080c, 0x9687, 0x0030,
+	0x080c, 0xcfbc, 0x080c, 0xae71, 0x080c, 0x9687, 0x0005, 0x080c,
+	0xb824, 0x0cb0, 0x080c, 0xb860, 0x0c98, 0x9186, 0x0014, 0x1db0,
+	0x080c, 0x957b, 0x6004, 0x908e, 0x0022, 0x1118, 0x080c, 0xb2a2,
+	0x0d68, 0x080c, 0x31c1, 0x080c, 0xd25f, 0x080c, 0xcd3f, 0x1190,
+	0x080c, 0x31ea, 0x6010, 0x00b6, 0x2058, 0xb9a0, 0x00be, 0x080c,
+	0xb824, 0x9186, 0x007e, 0x1128, 0x2001, 0x1837, 0x200c, 0xc185,
+	0x2102, 0x0870, 0x080c, 0xcd50, 0x1118, 0x080c, 0xb824, 0x0840,
+	0x6004, 0x908e, 0x0032, 0x1160, 0x00e6, 0x00f6, 0x2071, 0x189e,
+	0x2079, 0x0000, 0x080c, 0x3558, 0x00fe, 0x00ee, 0x0804, 0xb700,
+	0x6004, 0x908e, 0x0021, 0x0d48, 0x908e, 0x0022, 0x090c, 0xb824,
+	0x0804, 0xb700, 0x90b2, 0x0040, 0x1a04, 0xb800, 0x2008, 0x0002,
+	0xb79a, 0xb79b, 0xb79e, 0xb7a1, 0xb7a4, 0xb7a7, 0xb798, 0xb798,
+	0xb798, 0xb798, 0xb798, 0xb798, 0xb798, 0xb798, 0xb798, 0xb798,
+	0xb798, 0xb798, 0xb798, 0xb798, 0xb798, 0xb798, 0xb798, 0xb798,
+	0xb798, 0xb798, 0xb798, 0xb798, 0xb798, 0xb798, 0xb7aa, 0xb7b5,
+	0xb798, 0xb7b7, 0xb7b5, 0xb798, 0xb798, 0xb798, 0xb798, 0xb798,
+	0xb7b5, 0xb7b5, 0xb798, 0xb798, 0xb798, 0xb798, 0xb798, 0xb798,
+	0xb798, 0xb798, 0xb7e7, 0xb7b5, 0xb798, 0xb7b1, 0xb798, 0xb798,
+	0xb798, 0xb7b2, 0xb798, 0xb798, 0xb798, 0xb7b5, 0xb7de, 0xb798,
+	0x080c, 0x0dd5, 0x00d0, 0x2001, 0x000b, 0x0410, 0x2001, 0x0003,
+	0x00f8, 0x2001, 0x0005, 0x00e0, 0x2001, 0x0001, 0x00c8, 0x2001,
+	0x0009, 0x00b0, 0x080c, 0x957b, 0x6003, 0x0005, 0x080c, 0x9687,
+	0x0070, 0x0018, 0x0010, 0x080c, 0x6558, 0x0804, 0xb7f8, 0x080c,
+	0x957b, 0x080c, 0xd262, 0x6003, 0x0004, 0x080c, 0x9687, 0x0005,
+	0x080c, 0x6558, 0x080c, 0x957b, 0x6003, 0x0002, 0x0036, 0x2019,
+	0x1852, 0x2304, 0x9084, 0xff00, 0x1120, 0x2001, 0x1985, 0x201c,
+	0x0040, 0x8007, 0x909a, 0x0004, 0x0ec0, 0x8003, 0x801b, 0x831b,
+	0x9318, 0x631a, 0x003e, 0x080c, 0x9687, 0x0c08, 0x080c, 0x957b,
+	0x080c, 0xcfbc, 0x080c, 0xae71, 0x080c, 0x9687, 0x08c0, 0x00e6,
+	0x00f6, 0x2071, 0x189e, 0x2079, 0x0000, 0x080c, 0x3558, 0x00fe,
+	0x00ee, 0x080c, 0x957b, 0x080c, 0xae71, 0x080c, 0x9687, 0x0838,
+	0x080c, 0x957b, 0x6003, 0x0002, 0x080c, 0xd262, 0x0804, 0x9687,
+	0x2600, 0x2008, 0x0002, 0xb817, 0xb7f8, 0xb815, 0xb7f8, 0xb7f8,
+	0xb815, 0xb815, 0xb815, 0xb815, 0xb7f8, 0xb815, 0xb7f8, 0xb815,
+	0xb7f8, 0xb815, 0xb815, 0xb815, 0xb815, 0x080c, 0x0dd5, 0x080c,
+	0x957b, 0x0096, 0x6014, 0x2048, 0x080c, 0x6c86, 0x009e, 0x080c,
+	0xae71, 0x080c, 0x9687, 0x0005, 0x00e6, 0x0096, 0x0026, 0x0016,
+	0x080c, 0xcb4a, 0x0568, 0x6014, 0x2048, 0xa864, 0x9086, 0x0139,
+	0x11a8, 0xa894, 0x9086, 0x0056, 0x1148, 0x080c, 0x5481, 0x0130,
+	0x2001, 0x0000, 0x900e, 0x2011, 0x4000, 0x0028, 0x2001, 0x0030,
+	0x900e, 0x2011, 0x4005, 0x080c, 0xd129, 0x0090, 0xa868, 0xd0fc,
+	0x0178, 0xa807, 0x0000, 0x0016, 0x6004, 0x908e, 0x0021, 0x0168,
+	0x908e, 0x003d, 0x0150, 0x001e, 0xa867, 0x0103, 0xa833, 0x0100,
+	0x001e, 0x002e, 0x009e, 0x00ee, 0x0005, 0x001e, 0x0009, 0x0cc0,
+	0x0096, 0x6014, 0x2048, 0xa800, 0x2048, 0xa867, 0x0103, 0xa823,
+	0x8001, 0x009e, 0x0005, 0x00b6, 0x6610, 0x2658, 0xb804, 0x9084,
+	0x00ff, 0x90b2, 0x000c, 0x1a0c, 0x0dd5, 0x6604, 0x96b6, 0x004d,
+	0x1120, 0x080c, 0xd048, 0x0804, 0xb8f0, 0x6604, 0x96b6, 0x0043,
+	0x1120, 0x080c, 0xd091, 0x0804, 0xb8f0, 0x6604, 0x96b6, 0x004b,
+	0x1120, 0x080c, 0xd0bd, 0x0804, 0xb8f0, 0x6604, 0x96b6, 0x0033,
+	0x1120, 0x080c, 0xcfde, 0x0804, 0xb8f0, 0x6604, 0x96b6, 0x0028,
+	0x1120, 0x080c, 0xcd8e, 0x0804, 0xb8f0, 0x6604, 0x96b6, 0x0029,
+	0x1120, 0x080c, 0xcdcf, 0x0804, 0xb8f0, 0x6604, 0x96b6, 0x001f,
+	0x1120, 0x080c, 0xb24a, 0x0804, 0xb8f0, 0x6604, 0x96b6, 0x0000,
+	0x1118, 0x080c, 0xb588, 0x04e0, 0x6604, 0x96b6, 0x0022, 0x1118,
+	0x080c, 0xb283, 0x04a8, 0x6604, 0x96b6, 0x0035, 0x1118, 0x080c,
+	0xb3a9, 0x0470, 0x6604, 0x96b6, 0x0039, 0x1118, 0x080c, 0xb51d,
+	0x0438, 0x6604, 0x96b6, 0x003d, 0x1118, 0x080c, 0xb2bb, 0x0400,
+	0x6604, 0x96b6, 0x0044, 0x1118, 0x080c, 0xb2f7, 0x00c8, 0x6604,
+	0x96b6, 0x0049, 0x1118, 0x080c, 0xb338, 0x0090, 0x6604, 0x96b6,
+	0x0041, 0x1118, 0x080c, 0xb322, 0x0058, 0x91b6, 0x0015, 0x1110,
+	0x0063, 0x0030, 0x91b6, 0x0016, 0x1128, 0x00be, 0x0804, 0xbb4c,
+	0x00be, 0x0005, 0x080c, 0xaf07, 0x0cd8, 0xb90d, 0xb910, 0xb90d,
+	0xb957, 0xb90d, 0xbac0, 0xbb59, 0xb90d, 0xb90d, 0xbb22, 0xb90d,
+	0xbb38, 0x0096, 0x601f, 0x0000, 0x6014, 0x2048, 0xa800, 0x2048,
+	0xa867, 0x0103, 0x009e, 0x0804, 0xae71, 0xa001, 0xa001, 0x0005,
+	0x00e6, 0x2071, 0x1800, 0x7090, 0x9086, 0x0074, 0x1540, 0x080c,
+	0xe2dd, 0x11b0, 0x6010, 0x00b6, 0x2058, 0x7030, 0xd08c, 0x0128,
+	0xb800, 0xd0bc, 0x0110, 0xc0c5, 0xb802, 0x00f9, 0x00be, 0x2001,
+	0x0006, 0x080c, 0x6558, 0x080c, 0x31ea, 0x080c, 0xae71, 0x0098,
+	0x2001, 0x000a, 0x080c, 0x6558, 0x080c, 0x31ea, 0x6003, 0x0001,
+	0x6007, 0x0001, 0x080c, 0x9121, 0x080c, 0x9687, 0x0020, 0x2001,
+	0x0001, 0x080c, 0xba90, 0x00ee, 0x0005, 0x00d6, 0xb800, 0xd084,
+	0x0160, 0x9006, 0x080c, 0x6544, 0x2069, 0x1847, 0x6804, 0xd0a4,
+	0x0120, 0x2001, 0x0006, 0x080c, 0x6584, 0x00de, 0x0005, 0x00b6,
+	0x0096, 0x00d6, 0x2011, 0x1824, 0x2204, 0x9086, 0x0074, 0x1904,
+	0xba65, 0x6010, 0x2058, 0xbaa0, 0x9286, 0x007e, 0x1120, 0x080c,
+	0xbca6, 0x0804, 0xb9c9, 0x080c, 0xbc9b, 0x6010, 0x2058, 0xbaa0,
+	0x9286, 0x0080, 0x1510, 0x6014, 0x9005, 0x01a8, 0x2048, 0xa864,
+	0x9084, 0x00ff, 0x9086, 0x0039, 0x1140, 0x2001, 0x0000, 0x900e,
+	0x2011, 0x4000, 0x080c, 0xd129, 0x0030, 0xa807, 0x0000, 0xa867,
+	0x0103, 0xa833, 0x0200, 0x2001, 0x0006, 0x080c, 0x6558, 0x080c,
+	0x31ea, 0x080c, 0xae71, 0x0804, 0xba6a, 0x080c, 0xba78, 0x6014,
+	0x9005, 0x0190, 0x2048, 0xa868, 0xd0f4, 0x01e8, 0xa864, 0x9084,
+	0x00ff, 0x9086, 0x0039, 0x1d08, 0x2001, 0x0000, 0x900e, 0x2011,
+	0x4000, 0x080c, 0xd129, 0x08f8, 0x080c, 0xba6e, 0x0160, 0x9006,
+	0x080c, 0x6544, 0x2001, 0x0004, 0x080c, 0x6584, 0x2001, 0x0007,
+	0x080c, 0x6558, 0x08a0, 0x2001, 0x0004, 0x080c, 0x6558, 0x6003,
+	0x0001, 0x6007, 0x0003, 0x080c, 0x9121, 0x080c, 0x9687, 0x0804,
+	0xba6a, 0xb85c, 0xd0e4, 0x01d8, 0x080c, 0xcf5e, 0x080c, 0x73a5,
+	0x0118, 0xd0dc, 0x1904, 0xb98b, 0x2011, 0x1837, 0x2204, 0xc0ad,
+	0x2012, 0x2001, 0x196c, 0x2004, 0x00f6, 0x2079, 0x0100, 0x78e3,
+	0x0000, 0x080c, 0x28b4, 0x78e2, 0x00fe, 0x0804, 0xb98b, 0x080c,
+	0xcf9b, 0x2011, 0x1837, 0x2204, 0xc0a5, 0x2012, 0x0006, 0x080c,
+	0xe462, 0x000e, 0x1904, 0xb98b, 0xc0b5, 0x2012, 0x2001, 0x0006,
+	0x080c, 0x6558, 0x9006, 0x080c, 0x6544, 0x00c6, 0x2001, 0x180f,
+	0x2004, 0xd09c, 0x0520, 0x00f6, 0x2079, 0x0100, 0x00e6, 0x2071,
+	0x1800, 0x700c, 0x9084, 0x00ff, 0x78e6, 0x707e, 0x7010, 0x78ea,
+	0x7082, 0x908c, 0x00ff, 0x00ee, 0x780c, 0xc0b5, 0x780e, 0x00fe,
+	0x080c, 0x2889, 0x00f6, 0x2100, 0x900e, 0x080c, 0x2840, 0x795e,
+	0x00fe, 0x9186, 0x0081, 0x01d8, 0x2009, 0x0081, 0x00c8, 0x2009,
+	0x00ef, 0x00f6, 0x2079, 0x0100, 0x79ea, 0x7932, 0x7936, 0x780c,
+	0xc0b5, 0x780e, 0x00fe, 0x080c, 0x2889, 0x00f6, 0x2079, 0x1800,
+	0x7982, 0x2100, 0x900e, 0x080c, 0x2840, 0x795e, 0x00fe, 0x8108,
+	0x080c, 0x65a7, 0x2b00, 0x00ce, 0x1904, 0xb98b, 0x6012, 0x2009,
+	0x180f, 0x210c, 0xd19c, 0x0150, 0x2009, 0x027c, 0x210c, 0x918c,
+	0x00ff, 0xb912, 0x2009, 0x027d, 0x210c, 0xb916, 0x2001, 0x0002,
+	0x080c, 0x6558, 0x6023, 0x0001, 0x6003, 0x0001, 0x6007, 0x0002,
+	0x080c, 0x9121, 0x080c, 0x9687, 0x0028, 0x080c, 0xb824, 0x2001,
+	0x0001, 0x0431, 0x00de, 0x009e, 0x00be, 0x0005, 0x2001, 0x1810,
+	0x2004, 0xd0a4, 0x0120, 0x2001, 0x1848, 0x2004, 0xd0ac, 0x0005,
+	0x00e6, 0x080c, 0xe991, 0x0190, 0x2071, 0x0260, 0x7108, 0x720c,
+	0x918c, 0x00ff, 0x1118, 0x9284, 0xff00, 0x0140, 0x6010, 0x2058,
+	0xb8a0, 0x9084, 0xff80, 0x1110, 0xb912, 0xba16, 0x00ee, 0x0005,
+	0x2030, 0x9005, 0x0158, 0x2001, 0x0007, 0x080c, 0x6558, 0x080c,
+	0x56ec, 0x1120, 0x2001, 0x0007, 0x080c, 0x6584, 0x2600, 0x9005,
+	0x11b0, 0x6014, 0x0096, 0x2048, 0xa868, 0x009e, 0xd0fc, 0x1178,
+	0x0036, 0x0046, 0x6010, 0x00b6, 0x2058, 0xbba0, 0x00be, 0x2021,
+	0x0004, 0x2011, 0x8014, 0x080c, 0x4b14, 0x004e, 0x003e, 0x080c,
+	0x31ea, 0x6020, 0x9086, 0x000a, 0x1108, 0x0005, 0x0804, 0xae71,
+	0x00b6, 0x00e6, 0x0026, 0x0016, 0x2071, 0x1800, 0x7090, 0x9086,
+	0x0014, 0x1904, 0xbb18, 0x080c, 0x56ec, 0x1170, 0x6014, 0x9005,
+	0x1158, 0x0036, 0x0046, 0x6010, 0x2058, 0xbba0, 0x2021, 0x0006,
+	0x080c, 0x4ccb, 0x004e, 0x003e, 0x00d6, 0x6010, 0x2058, 0x080c,
+	0x66a3, 0x080c, 0xb945, 0x00de, 0x080c, 0xbd6c, 0x1588, 0x6010,
+	0x2058, 0xb890, 0x9005, 0x0560, 0x2001, 0x0006, 0x080c, 0x6558,
+	0x0096, 0x6014, 0x904d, 0x01d0, 0xa864, 0x9084, 0x00ff, 0x9086,
+	0x0039, 0x1140, 0x2001, 0x0000, 0x900e, 0x2011, 0x4000, 0x080c,
+	0xd129, 0x0060, 0xa864, 0x9084, 0x00ff, 0x9086, 0x0029, 0x0130,
+	0xa807, 0x0000, 0xa867, 0x0103, 0xa833, 0x0200, 0x009e, 0x080c,
+	0x31ea, 0x6020, 0x9086, 0x000a, 0x0140, 0x080c, 0xae71, 0x0028,
+	0x080c, 0xb824, 0x9006, 0x080c, 0xba90, 0x001e, 0x002e, 0x00ee,
+	0x00be, 0x0005, 0x2011, 0x1824, 0x2204, 0x9086, 0x0014, 0x1160,
+	0x2001, 0x0002, 0x080c, 0x6558, 0x6003, 0x0001, 0x6007, 0x0001,
+	0x080c, 0x9121, 0x0804, 0x9687, 0x2001, 0x0001, 0x0804, 0xba90,
+	0x2030, 0x2011, 0x1824, 0x2204, 0x9086, 0x0004, 0x1148, 0x96b6,
+	0x000b, 0x1120, 0x2001, 0x0007, 0x080c, 0x6558, 0x0804, 0xae71,
+	0x2001, 0x0001, 0x0804, 0xba90, 0x0002, 0xb90d, 0xbb64, 0xb90d,
+	0xbba5, 0xb90d, 0xbc52, 0xbb59, 0xb90d, 0xb90d, 0xbc66, 0xb90d,
+	0xbc78, 0x6604, 0x9686, 0x0003, 0x0904, 0xbac0, 0x96b6, 0x001e,
+	0x1110, 0x080c, 0xae71, 0x0005, 0x00b6, 0x00d6, 0x00c6, 0x080c,
+	0xbc8a, 0x11a0, 0x9006, 0x080c, 0x6544, 0x080c, 0x31c1, 0x080c,
+	0xd25f, 0x2001, 0x0002, 0x080c, 0x6558, 0x6003, 0x0001, 0x6007,
+	0x0002, 0x080c, 0x9121, 0x080c, 0x9687, 0x0418, 0x2009, 0x026e,
+	0x2104, 0x9086, 0x0009, 0x1160, 0x6010, 0x2058, 0xb840, 0x9084,
+	0x00ff, 0x9005, 0x0170, 0x8001, 0xb842, 0x601b, 0x000a, 0x0088,
+	0x2009, 0x026f, 0x2104, 0x9084, 0xff00, 0x9086, 0x1900, 0x1108,
+	0x08a0, 0x080c, 0x31c1, 0x080c, 0xd25f, 0x2001, 0x0001, 0x080c,
+	0xba90, 0x00ce, 0x00de, 0x00be, 0x0005, 0x0096, 0x00b6, 0x0026,
+	0x9016, 0x080c, 0xbc98, 0x00d6, 0x2069, 0x197b, 0x2d04, 0x9005,
+	0x0168, 0x6010, 0x2058, 0xb8a0, 0x9086, 0x007e, 0x1138, 0x2069,
+	0x1820, 0x2d04, 0x8000, 0x206a, 0x00de, 0x0010, 0x00de, 0x0088,
+	0x9006, 0x080c, 0x6544, 0x2001, 0x0002, 0x080c, 0x6558, 0x6003,
+	0x0001, 0x6007, 0x0002, 0x080c, 0x9121, 0x080c, 0x9687, 0x0804,
+	0xbc22, 0x080c, 0xcb4a, 0x01b0, 0x6014, 0x2048, 0xa864, 0x2010,
+	0x9086, 0x0139, 0x1138, 0x6007, 0x0016, 0x2001, 0x0002, 0x080c,
+	0xd183, 0x00b0, 0x6014, 0x2048, 0xa864, 0xd0fc, 0x0118, 0x2001,
+	0x0001, 0x0ca8, 0x2001, 0x180e, 0x2004, 0xd0dc, 0x0148, 0x6010,
+	0x2058, 0xb840, 0x9084, 0x00ff, 0x9005, 0x1110, 0x9006, 0x0c38,
+	0x080c, 0xb824, 0x2009, 0x026e, 0x2134, 0x96b4, 0x00ff, 0x9686,
+	0x0005, 0x0520, 0x9686, 0x000b, 0x01c8, 0x2009, 0x026f, 0x2104,
+	0x9084, 0xff00, 0x1118, 0x9686, 0x0009, 0x01c0, 0x9086, 0x1900,
+	0x1168, 0x9686, 0x0009, 0x0190, 0x2001, 0x0004, 0x080c, 0x6558,
+	0x2001, 0x0028, 0x601a, 0x6007, 0x0052, 0x0020, 0x2001, 0x0001,
+	0x080c, 0xba90, 0x002e, 0x00be, 0x009e, 0x0005, 0x9286, 0x0139,
+	0x0160, 0x6014, 0x2048, 0x080c, 0xcb4a, 0x0140, 0xa864, 0x9086,
+	0x0139, 0x0118, 0xa868, 0xd0fc, 0x0108, 0x0c40, 0x6010, 0x2058,
+	0xb840, 0x9084, 0x00ff, 0x9005, 0x0138, 0x8001, 0xb842, 0x601b,
+	0x000a, 0x6007, 0x0016, 0x08f0, 0xb8a0, 0x9086, 0x007e, 0x1138,
+	0x00e6, 0x2071, 0x1800, 0x080c, 0x5fb6, 0x00ee, 0x0010, 0x080c,
+	0x31c1, 0x0860, 0x080c, 0xbc98, 0x1160, 0x2001, 0x0004, 0x080c,
+	0x6558, 0x6003, 0x0001, 0x6007, 0x0003, 0x080c, 0x9121, 0x0804,
+	0x9687, 0x080c, 0xb824, 0x9006, 0x0804, 0xba90, 0x0489, 0x1160,
+	0x2001, 0x0008, 0x080c, 0x6558, 0x6003, 0x0001, 0x6007, 0x0005,
+	0x080c, 0x9121, 0x0804, 0x9687, 0x2001, 0x0001, 0x0804, 0xba90,
+	0x00f9, 0x1160, 0x2001, 0x000a, 0x080c, 0x6558, 0x6003, 0x0001,
+	0x6007, 0x0001, 0x080c, 0x9121, 0x0804, 0x9687, 0x2001, 0x0001,
+	0x0804, 0xba90, 0x2009, 0x026e, 0x2104, 0x9086, 0x0003, 0x1138,
+	0x2009, 0x026f, 0x2104, 0x9084, 0xff00, 0x9086, 0x2a00, 0x0005,
+	0x9085, 0x0001, 0x0005, 0x00b6, 0x00c6, 0x0016, 0x6110, 0x2158,
+	0x080c, 0x6617, 0x001e, 0x00ce, 0x00be, 0x0005, 0x00b6, 0x00f6,
+	0x00e6, 0x00d6, 0x0036, 0x0016, 0x6010, 0x2058, 0x2009, 0x1837,
+	0x2104, 0x9085, 0x0003, 0x200a, 0x080c, 0xbd3e, 0x0560, 0x2009,
+	0x1837, 0x2104, 0xc0cd, 0x200a, 0x080c, 0x6977, 0x0158, 0x9006,
+	0x2020, 0x2009, 0x002a, 0x080c, 0xe5cf, 0x2001, 0x180c, 0x200c,
+	0xc195, 0x2102, 0x2019, 0x002a, 0x2009, 0x0001, 0x080c, 0x318c,
+	0x00e6, 0x2071, 0x1800, 0x080c, 0x2f98, 0x00ee, 0x00c6, 0x0156,
+	0x20a9, 0x0781, 0x2009, 0x007f, 0x080c, 0x32bd, 0x8108, 0x1f04,
+	0xbcdc, 0x015e, 0x00ce, 0x080c, 0xbc9b, 0x2071, 0x0260, 0x2079,
+	0x0200, 0x7817, 0x0001, 0x2001, 0x1837, 0x200c, 0xc1c5, 0x7018,
+	0xd0fc, 0x0110, 0xd0dc, 0x0118, 0x7038, 0xd0dc, 0x1108, 0xc1c4,
+	0x7817, 0x0000, 0x2001, 0x1837, 0x2102, 0x2079, 0x0100, 0x2e04,
+	0x9084, 0x00ff, 0x2069, 0x181f, 0x206a, 0x78e6, 0x0006, 0x8e70,
+	0x2e04, 0x2069, 0x1820, 0x206a, 0x78ea, 0x7832, 0x7836, 0x2010,
+	0x9084, 0xff00, 0x001e, 0x9105, 0x2009, 0x182c, 0x200a, 0x2200,
+	0x9084, 0x00ff, 0x2008, 0x080c, 0x2889, 0x080c, 0x73a5, 0x0170,
+	0x2071, 0x0260, 0x2069, 0x1981, 0x7048, 0x206a, 0x704c, 0x6806,
+	0x7050, 0x680a, 0x7054, 0x680e, 0x080c, 0xcf5e, 0x0040, 0x2001,
+	0x0006, 0x080c, 0x6558, 0x080c, 0x31ea, 0x080c, 0xae71, 0x001e,
+	0x003e, 0x00de, 0x00ee, 0x00fe, 0x00be, 0x0005, 0x0096, 0x0026,
+	0x0036, 0x00e6, 0x0156, 0x2019, 0x182c, 0x231c, 0x83ff, 0x01f0,
+	0x2071, 0x0260, 0x7200, 0x9294, 0x00ff, 0x7004, 0x9084, 0xff00,
+	0x9205, 0x9306, 0x1198, 0x2011, 0x0276, 0x20a9, 0x0004, 0x2b48,
+	0x2019, 0x000a, 0x080c, 0xbe30, 0x1148, 0x2011, 0x027a, 0x20a9,
+	0x0004, 0x2019, 0x0006, 0x080c, 0xbe30, 0x1100, 0x015e, 0x00ee,
+	0x003e, 0x002e, 0x009e, 0x0005, 0x00e6, 0x2071, 0x0260, 0x7034,
+	0x9086, 0x0014, 0x11a8, 0x7038, 0x9086, 0x0800, 0x1188, 0x703c,
+	0xd0ec, 0x0160, 0x9084, 0x0f00, 0x9086, 0x0100, 0x1138, 0x7054,
+	0xd0a4, 0x1110, 0xd0ac, 0x0110, 0x9006, 0x0010, 0x9085, 0x0001,
+	0x00ee, 0x0005, 0x00e6, 0x0096, 0x00c6, 0x0076, 0x0056, 0x0046,
+	0x0026, 0x0006, 0x0126, 0x2091, 0x8000, 0x2029, 0x19ef, 0x252c,
+	0x2021, 0x19f5, 0x2424, 0x2061, 0x1cd0, 0x2071, 0x1800, 0x7254,
+	0x7074, 0x9202, 0x1a04, 0xbdfc, 0x080c, 0x896a, 0x0904, 0xbdf5,
+	0x080c, 0xe600, 0x0904, 0xbdf5, 0x6720, 0x9786, 0x0007, 0x0904,
+	0xbdf5, 0x2500, 0x9c06, 0x0904, 0xbdf5, 0x2400, 0x9c06, 0x05e8,
+	0x3e08, 0x9186, 0x0002, 0x1148, 0x6010, 0x9005, 0x0130, 0x00b6,
+	0x2058, 0xb800, 0x00be, 0xd0bc, 0x1580, 0x00c6, 0x6000, 0x9086,
+	0x0004, 0x1110, 0x080c, 0x1a60, 0x9786, 0x000a, 0x0148, 0x080c,
+	0xcd50, 0x1130, 0x00ce, 0x080c, 0xb824, 0x080c, 0xaea2, 0x00e8,
+	0x6014, 0x2048, 0x080c, 0xcb4a, 0x01a8, 0x9786, 0x0003, 0x1530,
+	0xa867, 0x0103, 0xa87c, 0xd0cc, 0x0130, 0x0096, 0xa878, 0x2048,
+	0x080c, 0x0fb1, 0x009e, 0xab7a, 0xa877, 0x0000, 0x080c, 0x6c7a,
+	0x080c, 0xcd33, 0x080c, 0xaea2, 0x00ce, 0x9ce0, 0x0018, 0x7068,
+	0x9c02, 0x1210, 0x0804, 0xbd9f, 0x012e, 0x000e, 0x002e, 0x004e,
+	0x005e, 0x007e, 0x00ce, 0x009e, 0x00ee, 0x0005, 0x9786, 0x0006,
+	0x1118, 0x080c, 0xe572, 0x0c30, 0x9786, 0x0009, 0x1148, 0x6000,
+	0x9086, 0x0004, 0x0d08, 0x2009, 0x004c, 0x080c, 0xaeec, 0x08e0,
+	0x9786, 0x000a, 0x0938, 0x0820, 0x220c, 0x2304, 0x9106, 0x1130,
+	0x8210, 0x8318, 0x1f04, 0xbe1c, 0x9006, 0x0005, 0x2304, 0x9102,
+	0x0218, 0x2001, 0x0001, 0x0008, 0x9006, 0x918d, 0x0001, 0x0005,
+	0x0136, 0x01c6, 0x0016, 0x8906, 0x8006, 0x8007, 0x908c, 0x003f,
+	0x21e0, 0x9084, 0xffc0, 0x9300, 0x2098, 0x3518, 0x20a9, 0x0001,
+	0x220c, 0x4002, 0x910e, 0x1140, 0x8210, 0x8319, 0x1dc8, 0x9006,
+	0x001e, 0x01ce, 0x013e, 0x0005, 0x220c, 0x9102, 0x0218, 0x2001,
+	0x0001, 0x0010, 0x2001, 0x0000, 0x918d, 0x0001, 0x001e, 0x01ce,
+	0x013e, 0x0005, 0x220c, 0x810f, 0x2304, 0x9106, 0x1130, 0x8210,
+	0x8318, 0x1f04, 0xbe5a, 0x9006, 0x0005, 0x918d, 0x0001, 0x0005,
+	0x6004, 0x908a, 0x0053, 0x1a0c, 0x0dd5, 0x080c, 0xcd3f, 0x0120,
+	0x080c, 0xcd50, 0x0168, 0x0028, 0x080c, 0x31ea, 0x080c, 0xcd50,
+	0x0138, 0x080c, 0x957b, 0x080c, 0xae71, 0x080c, 0x9687, 0x0005,
+	0x080c, 0xb824, 0x0cb0, 0x9182, 0x0054, 0x1220, 0x9182, 0x0040,
+	0x0208, 0x000a, 0x0005, 0xbe9f, 0xbe9f, 0xbe9f, 0xbe9f, 0xbe9f,
+	0xbe9f, 0xbe9f, 0xbe9f, 0xbe9f, 0xbe9f, 0xbe9f, 0xbea1, 0xbea1,
+	0xbea1, 0xbea1, 0xbe9f, 0xbe9f, 0xbe9f, 0xbea1, 0xbe9f, 0x080c,
+	0x0dd5, 0x600b, 0xffff, 0x6003, 0x0001, 0x6106, 0x080c, 0x90d9,
+	0x0126, 0x2091, 0x8000, 0x080c, 0x9687, 0x012e, 0x0005, 0x9186,
+	0x0013, 0x1128, 0x6004, 0x9082, 0x0040, 0x0804, 0xbf56, 0x9186,
+	0x0027, 0x1520, 0x080c, 0x957b, 0x080c, 0x31c1, 0x080c, 0xd25f,
+	0x0096, 0x6114, 0x2148, 0x080c, 0xcb4a, 0x0198, 0x080c, 0xcd50,
+	0x1118, 0x080c, 0xb824, 0x0068, 0xa867, 0x0103, 0xa87b, 0x0029,
+	0xa877, 0x0000, 0xa97c, 0xc1c5, 0xa97e, 0x080c, 0x6c86, 0x080c,
+	0xcd33, 0x009e, 0x080c, 0xae71, 0x0804, 0x9687, 0x9186, 0x0014,
+	0x1120, 0x6004, 0x9082, 0x0040, 0x04a0, 0x9186, 0x0046, 0x0150,
+	0x9186, 0x0045, 0x0138, 0x9186, 0x0053, 0x0120, 0x9186, 0x0048,
+	0x190c, 0x0dd5, 0x2001, 0x0109, 0x2004, 0xd084, 0x0508, 0x0126,
+	0x2091, 0x2800, 0x0006, 0x0016, 0x0026, 0x0036, 0x00f6, 0x00e6,
+	0x00c6, 0x2079, 0x19e6, 0x2071, 0x1800, 0x2061, 0x0100, 0x080c,
+	0x8fbe, 0x00ce, 0x00ee, 0x00fe, 0x003e, 0x002e, 0x001e, 0x000e,
+	0x012e, 0xa001, 0x6000, 0x9086, 0x0002, 0x1110, 0x0804, 0xbf94,
+	0x0005, 0x0002, 0xbf30, 0xbf2e, 0xbf2e, 0xbf2e, 0xbf2e, 0xbf2e,
+	0xbf2e, 0xbf2e, 0xbf2e, 0xbf2e, 0xbf2e, 0xbf4b, 0xbf4b, 0xbf4b,
+	0xbf4b, 0xbf2e, 0xbf4b, 0xbf2e, 0xbf4b, 0xbf2e, 0x080c, 0x0dd5,
+	0x080c, 0x957b, 0x0096, 0x6114, 0x2148, 0x080c, 0xcb4a, 0x0168,
+	0xa867, 0x0103, 0xa87b, 0x0006, 0xa877, 0x0000, 0xa880, 0xc0ec,
+	0xa882, 0x080c, 0x6c86, 0x080c, 0xcd33, 0x009e, 0x080c, 0xae71,
+	0x080c, 0x9687, 0x0005, 0x080c, 0x957b, 0x080c, 0xcd50, 0x090c,
+	0xb824, 0x080c, 0xae71, 0x080c, 0x9687, 0x0005, 0x0002, 0xbf6d,
+	0xbf6b, 0xbf6b, 0xbf6b, 0xbf6b, 0xbf6b, 0xbf6b, 0xbf6b, 0xbf6b,
+	0xbf6b, 0xbf6b, 0xbf84, 0xbf84, 0xbf84, 0xbf84, 0xbf6b, 0xbf8e,
+	0xbf6b, 0xbf84, 0xbf6b, 0x080c, 0x0dd5, 0x0096, 0x080c, 0x957b,
+	0x6014, 0x2048, 0x2001, 0x1987, 0x2004, 0x6042, 0xa97c, 0xd1ac,
+	0x0140, 0x6003, 0x0004, 0xa87c, 0x9085, 0x0400, 0xa87e, 0x009e,
+	0x0005, 0x6003, 0x0002, 0x0cb8, 0x080c, 0x957b, 0x080c, 0xd262,
+	0x080c, 0xd267, 0x6003, 0x000f, 0x0804, 0x9687, 0x080c, 0x957b,
+	0x080c, 0xae71, 0x0804, 0x9687, 0x9182, 0x0054, 0x1220, 0x9182,
+	0x0040, 0x0208, 0x000a, 0x0005, 0xbfb0, 0xbfb0, 0xbfb0, 0xbfb0,
+	0xbfb0, 0xbfb2, 0xc08f, 0xbfb0, 0xc0c3, 0xbfb0, 0xbfb0, 0xbfb0,
+	0xbfb0, 0xbfb0, 0xbfb0, 0xbfb0, 0xbfb0, 0xbfb0, 0xbfb0, 0xc0c3,
+	0x080c, 0x0dd5, 0x00b6, 0x0096, 0x6114, 0x2148, 0x7644, 0x96b4,
+	0x0fff, 0x86ff, 0x1528, 0x6010, 0x2058, 0xb800, 0xd0bc, 0x1904,
+	0xc07e, 0xa87b, 0x0000, 0xa867, 0x0103, 0xae76, 0xa87c, 0xd0ac,
+	0x0128, 0xa834, 0xa938, 0x9115, 0x190c, 0xc258, 0x080c, 0x6aa2,
+	0x6210, 0x2258, 0xba3c, 0x82ff, 0x0110, 0x8211, 0xba3e, 0x7044,
+	0xd0e4, 0x1904, 0xc062, 0x080c, 0xae71, 0x009e, 0x00be, 0x0005,
+	0x968c, 0x0c00, 0x0150, 0x6010, 0x2058, 0xb800, 0xd0bc, 0x1904,
+	0xc066, 0x7348, 0xab92, 0x734c, 0xab8e, 0x968c, 0x00ff, 0x9186,
+	0x0002, 0x0508, 0x9186, 0x0028, 0x1118, 0xa87b, 0x001c, 0x00e8,
+	0xd6dc, 0x01a0, 0xa87b, 0x0015, 0xa87c, 0xd0ac, 0x0170, 0xa938,
+	0xaa34, 0x2100, 0x9205, 0x0148, 0x7048, 0x9106, 0x1118, 0x704c,
+	0x9206, 0x0118, 0xa992, 0xaa8e, 0xc6dc, 0x0038, 0xd6d4, 0x0118,
+	0xa87b, 0x0007, 0x0010, 0xa87b, 0x0000, 0xa867, 0x0103, 0xae76,
+	0x901e, 0xd6c4, 0x01d8, 0x9686, 0x0100, 0x1130, 0x7064, 0x9005,
+	0x1118, 0xc6c4, 0x0804, 0xbfb9, 0x735c, 0xab86, 0x83ff, 0x0170,
+	0x938a, 0x0009, 0x0210, 0x2019, 0x0008, 0x0036, 0x2308, 0x2019,
+	0x0018, 0x2011, 0x0025, 0x080c, 0xc743, 0x003e, 0xd6cc, 0x0904,
+	0xbfce, 0x7154, 0xa98a, 0x81ff, 0x0904, 0xbfce, 0x9192, 0x0021,
+	0x1278, 0x8304, 0x9098, 0x0018, 0x2011, 0x0029, 0x080c, 0xc743,
+	0x2011, 0x0205, 0x2013, 0x0000, 0x080c, 0xd1ef, 0x0804, 0xbfce,
+	0xa868, 0xd0fc, 0x0120, 0x2009, 0x0020, 0xa98a, 0x0c50, 0x00a6,
+	0x2950, 0x080c, 0xc6e2, 0x00ae, 0x080c, 0xd1ef, 0x080c, 0xc733,
+	0x0804, 0xbfd0, 0x080c, 0xce48, 0x0804, 0xbfdd, 0xa87c, 0xd0ac,
+	0x0904, 0xbfe9, 0xa880, 0xd0bc, 0x1904, 0xbfe9, 0x7348, 0xa838,
+	0x9306, 0x11c8, 0x734c, 0xa834, 0x931e, 0x0904, 0xbfe9, 0xd6d4,
+	0x0190, 0xab38, 0x9305, 0x0904, 0xbfe9, 0x0068, 0xa87c, 0xd0ac,
+	0x0904, 0xbfc1, 0xa838, 0xa934, 0x9105, 0x0904, 0xbfc1, 0xa880,
+	0xd0bc, 0x1904, 0xbfc1, 0x080c, 0xce82, 0x0804, 0xbfdd, 0x0096,
+	0x00f6, 0x6003, 0x0003, 0x6007, 0x0043, 0x2079, 0x026c, 0x7c04,
+	0x7b00, 0x7e0c, 0x7d08, 0x6014, 0x2048, 0xa87c, 0xd0ac, 0x0140,
+	0x6003, 0x0002, 0x00fe, 0x009e, 0x0005, 0x2130, 0x2228, 0x0058,
+	0x2400, 0xa9ac, 0x910a, 0x2300, 0xaab0, 0x9213, 0x2600, 0x9102,
+	0x2500, 0x9203, 0x0e90, 0xac36, 0xab3a, 0xae46, 0xad4a, 0x00fe,
+	0x6043, 0x0000, 0x2c10, 0x080c, 0x1baf, 0x080c, 0x913e, 0x080c,
+	0x97b5, 0x009e, 0x0005, 0x0005, 0x9182, 0x0054, 0x1220, 0x9182,
+	0x0040, 0x0208, 0x000a, 0x0005, 0xc0e0, 0xc0e0, 0xc0e0, 0xc0e0,
+	0xc0e0, 0xc0e2, 0xc178, 0xc0e0, 0xc0e0, 0xc18f, 0xc21b, 0xc0e0,
+	0xc0e0, 0xc0e0, 0xc0e0, 0xc230, 0xc0e0, 0xc0e0, 0xc0e0, 0xc0e0,
 	0x080c, 0x0dd5, 0x0076, 0x00a6, 0x00e6, 0x0096, 0x2071, 0x0260,
 	0x6114, 0x2150, 0x7644, 0xb676, 0x96b4, 0x0fff, 0xb77c, 0xc7e5,
 	0xb77e, 0x6210, 0x00b6, 0x2258, 0xba3c, 0x82ff, 0x0110, 0x8211,
-	0xba3e, 0x00be, 0x86ff, 0x0904, 0xc319, 0x9694, 0xff00, 0x9284,
+	0xba3e, 0x00be, 0x86ff, 0x0904, 0xc173, 0x9694, 0xff00, 0x9284,
 	0x0c00, 0x0120, 0x7048, 0xb092, 0x704c, 0xb08e, 0x9284, 0x0300,
-	0x0904, 0xc319, 0x9686, 0x0100, 0x1130, 0x7064, 0x9005, 0x1118,
-	0xc6c4, 0xb676, 0x0c38, 0x080c, 0x0fff, 0x090c, 0x0dd5, 0x2900,
-	0xb07a, 0xb77c, 0x97bd, 0x0200, 0xb77e, 0xa867, 0x0103, 0xb068,
-	0xa86a, 0xb06c, 0xa86e, 0xb070, 0xa872, 0x7044, 0x9084, 0xf000,
-	0x9635, 0xae76, 0x968c, 0x0c00, 0x0120, 0x7348, 0xab92, 0x734c,
-	0xab8e, 0x968c, 0x00ff, 0x9186, 0x0002, 0x0180, 0x9186, 0x0028,
-	0x1118, 0xa87b, 0x001c, 0x0060, 0xd6dc, 0x0118, 0xa87b, 0x0015,
-	0x0038, 0xd6d4, 0x0118, 0xa87b, 0x0007, 0x0010, 0xa87b, 0x0000,
-	0xaf7e, 0xb080, 0xa882, 0xb084, 0xa886, 0x901e, 0xd6c4, 0x0190,
-	0x735c, 0xab86, 0x83ff, 0x0170, 0x938a, 0x0009, 0x0210, 0x2019,
-	0x0008, 0x0036, 0x2308, 0x2019, 0x0018, 0x2011, 0x0025, 0x080c,
-	0xc730, 0x003e, 0xd6cc, 0x01e8, 0x7154, 0xa98a, 0x81ff, 0x01c8,
-	0x9192, 0x0021, 0x1260, 0x8304, 0x9098, 0x0018, 0x2011, 0x0029,
-	0x080c, 0xc730, 0x2011, 0x0205, 0x2013, 0x0000, 0x0050, 0xb068,
-	0xd0fc, 0x0120, 0x2009, 0x0020, 0xa98a, 0x0c68, 0x2950, 0x080c,
-	0xc6cf, 0x080c, 0x1a3c, 0x009e, 0x00ee, 0x00ae, 0x007e, 0x0005,
-	0x2001, 0x1988, 0x2004, 0x6042, 0x0096, 0x6114, 0x2148, 0xa83c,
-	0xa940, 0x9105, 0x1118, 0xa87c, 0xc0dc, 0xa87e, 0x6003, 0x0002,
-	0xa97c, 0xd1e4, 0x0904, 0xc44c, 0x6043, 0x0000, 0x6010, 0x00b6,
-	0x2058, 0xb800, 0x00be, 0xd0bc, 0x1500, 0xd1cc, 0x0904, 0xc41b,
-	0xa978, 0xa868, 0xd0fc, 0x0904, 0xc3dc, 0x0016, 0xa87c, 0x0006,
-	0xa880, 0x0006, 0x00a6, 0x2150, 0xb174, 0x9184, 0x00ff, 0x90b6,
-	0x0002, 0x0904, 0xc3aa, 0x9086, 0x0028, 0x1904, 0xc396, 0xa87b,
-	0x001c, 0xb07b, 0x001c, 0x0804, 0xc3b2, 0x6024, 0xd0f4, 0x11d0,
-	0xa838, 0xaa34, 0x9205, 0x09c8, 0xa838, 0xaa90, 0x9206, 0x1120,
-	0xa88c, 0xaa34, 0x9206, 0x0988, 0x6024, 0xd0d4, 0x1148, 0xa9ac,
-	0xa834, 0x9102, 0x603a, 0xa9b0, 0xa838, 0x9103, 0x603e, 0x6024,
-	0xc0f5, 0x6026, 0x6010, 0x00b6, 0x2058, 0xb83c, 0x8000, 0xb83e,
-	0x00be, 0x9006, 0xa876, 0xa892, 0xa88e, 0xa87c, 0xc0e4, 0xa87e,
-	0xd0cc, 0x0140, 0xc0cc, 0xa87e, 0x0096, 0xa878, 0x2048, 0x080c,
-	0x0fb1, 0x009e, 0x080c, 0xce68, 0x0804, 0xc44c, 0xd1dc, 0x0158,
-	0xa87b, 0x0015, 0xb07b, 0x0015, 0x080c, 0xd0f8, 0x0118, 0xb174,
-	0xc1dc, 0xb176, 0x0078, 0xd1d4, 0x0128, 0xa87b, 0x0007, 0xb07b,
-	0x0007, 0x0040, 0xa87c, 0xd0ac, 0x0128, 0xa834, 0xa938, 0x9115,
-	0x190c, 0xc245, 0xa87c, 0xb07e, 0xa890, 0xb092, 0xa88c, 0xb08e,
-	0xa860, 0x20e8, 0xa85c, 0x9080, 0x0019, 0x20a0, 0x20a9, 0x0020,
-	0x8a06, 0x8006, 0x8007, 0x9094, 0x003f, 0x22e0, 0x9084, 0xffc0,
-	0x9080, 0x0019, 0x2098, 0x4003, 0x00ae, 0x000e, 0xa882, 0x000e,
-	0xa87e, 0x080c, 0xd1d5, 0x001e, 0xa874, 0x0006, 0x2148, 0x080c,
-	0x0fb1, 0x001e, 0x0804, 0xc448, 0x0016, 0x00a6, 0x2150, 0xb174,
-	0x9184, 0x00ff, 0x90b6, 0x0002, 0x01e0, 0x9086, 0x0028, 0x1128,
-	0xa87b, 0x001c, 0xb07b, 0x001c, 0x00e0, 0xd1dc, 0x0158, 0xa87b,
-	0x0015, 0xb07b, 0x0015, 0x080c, 0xd0f8, 0x0118, 0xb174, 0xc1dc,
-	0xb176, 0x0078, 0xd1d4, 0x0128, 0xa87b, 0x0007, 0xb07b, 0x0007,
-	0x0040, 0xa87c, 0xd0ac, 0x0128, 0xa834, 0xa938, 0x9115, 0x190c,
-	0xc245, 0xa890, 0xb092, 0xa88c, 0xb08e, 0xa87c, 0xb07e, 0x00ae,
-	0x080c, 0x0fb1, 0x009e, 0x080c, 0xd1d5, 0xa974, 0x0016, 0x080c,
-	0xc720, 0x001e, 0x0468, 0xa867, 0x0103, 0xa974, 0x9184, 0x00ff,
-	0x90b6, 0x0002, 0x01b0, 0x9086, 0x0028, 0x1118, 0xa87b, 0x001c,
-	0x00d0, 0xd1dc, 0x0148, 0xa87b, 0x0015, 0x080c, 0xd0f8, 0x0118,
-	0xa974, 0xc1dc, 0xa976, 0x0078, 0xd1d4, 0x0118, 0xa87b, 0x0007,
-	0x0050, 0xa87b, 0x0000, 0xa87c, 0xd0ac, 0x0128, 0xa834, 0xa938,
-	0x9115, 0x190c, 0xc245, 0xa974, 0x0016, 0x080c, 0x6a9d, 0x001e,
-	0xd1e4, 0x1120, 0x080c, 0xae61, 0x009e, 0x0005, 0x080c, 0xce2e,
-	0x0cd8, 0x6114, 0x0096, 0x2148, 0xa97c, 0xd1e4, 0x190c, 0x1a4a,
-	0x009e, 0x0005, 0x080c, 0x9588, 0x0010, 0x080c, 0x963d, 0x080c,
-	0xcb35, 0x01f0, 0x0096, 0x6114, 0x2148, 0x080c, 0xcd3b, 0x1118,
-	0x080c, 0xb813, 0x00a0, 0xa867, 0x0103, 0x2009, 0x180c, 0x210c,
-	0xd18c, 0x11b8, 0xd184, 0x1190, 0x6108, 0xa97a, 0x918e, 0x0029,
-	0x1110, 0x080c, 0xe908, 0xa877, 0x0000, 0x080c, 0x6c81, 0x009e,
-	0x080c, 0xae61, 0x080c, 0x968d, 0x0804, 0x97b9, 0xa87b, 0x0004,
-	0x0c90, 0xa87b, 0x0004, 0x0c78, 0x9182, 0x0054, 0x1220, 0x9182,
-	0x0040, 0x0208, 0x000a, 0x0005, 0xc4a8, 0xc4a8, 0xc4a8, 0xc4a8,
-	0xc4a8, 0xc4aa, 0xc4a8, 0xc4a8, 0xc4a8, 0xc4a8, 0xc4a8, 0xc4a8,
-	0xc4a8, 0xc4a8, 0xc4a8, 0xc4a8, 0xc4a8, 0xc4a8, 0xc4a8, 0xc4a8,
-	0x080c, 0x0dd5, 0x080c, 0x56d7, 0x01f8, 0x6014, 0x7144, 0x918c,
-	0x0fff, 0x9016, 0xd1c4, 0x0118, 0x7264, 0x9294, 0x00ff, 0x0096,
-	0x904d, 0x0188, 0xa87b, 0x0000, 0xa864, 0x9086, 0x0139, 0x0128,
-	0xa867, 0x0103, 0xa976, 0xaa96, 0x0030, 0xa897, 0x4000, 0xa99a,
-	0xaa9e, 0x080c, 0x6c81, 0x009e, 0x0804, 0xae61, 0x9182, 0x0085,
-	0x0002, 0xc4e0, 0xc4de, 0xc4de, 0xc4ec, 0xc4de, 0xc4de, 0xc4de,
-	0xc4de, 0xc4de, 0xc4de, 0xc4de, 0xc4de, 0xc4de, 0x080c, 0x0dd5,
-	0x6003, 0x0001, 0x6106, 0x080c, 0x90f0, 0x0126, 0x2091, 0x8000,
-	0x080c, 0x968d, 0x012e, 0x0005, 0x0026, 0x0056, 0x00d6, 0x00e6,
-	0x2071, 0x0260, 0x7224, 0x6216, 0x7220, 0x080c, 0xcb23, 0x01a0,
-	0x2268, 0x6800, 0x9086, 0x0000, 0x0178, 0x6010, 0x6d10, 0x952e,
-	0x1158, 0x00c6, 0x2d60, 0x080c, 0xc75b, 0x00ce, 0x0128, 0x6803,
-	0x0002, 0x6007, 0x0086, 0x0010, 0x6007, 0x0087, 0x6003, 0x0001,
-	0x080c, 0x90f0, 0x080c, 0x968d, 0x9280, 0x0004, 0x00b6, 0x2058,
-	0xb800, 0x00be, 0xd0bc, 0x0140, 0x6824, 0xd0ec, 0x0128, 0x00c6,
-	0x2260, 0x080c, 0xce68, 0x00ce, 0x00ee, 0x00de, 0x005e, 0x002e,
-	0x0005, 0x9186, 0x0013, 0x1160, 0x6004, 0x908a, 0x0085, 0x0a0c,
-	0x0dd5, 0x908a, 0x0092, 0x1a0c, 0x0dd5, 0x9082, 0x0085, 0x00e2,
-	0x9186, 0x0027, 0x0120, 0x9186, 0x0014, 0x190c, 0x0dd5, 0x080c,
-	0x9588, 0x0096, 0x6014, 0x2048, 0x080c, 0xcb35, 0x0140, 0xa867,
-	0x0103, 0xa877, 0x0000, 0xa87b, 0x0029, 0x080c, 0x6c81, 0x009e,
-	0x080c, 0xae92, 0x0804, 0x968d, 0xc561, 0xc563, 0xc563, 0xc561,
-	0xc561, 0xc561, 0xc561, 0xc561, 0xc561, 0xc561, 0xc561, 0xc561,
-	0xc561, 0x080c, 0x0dd5, 0x080c, 0x9588, 0x080c, 0xae92, 0x080c,
-	0x968d, 0x0005, 0x9186, 0x0013, 0x1128, 0x6004, 0x9082, 0x0085,
-	0x2008, 0x04b8, 0x9186, 0x0027, 0x11f8, 0x080c, 0x9588, 0x080c,
-	0x31bf, 0x080c, 0xd245, 0x0096, 0x6014, 0x2048, 0x080c, 0xcb35,
-	0x0150, 0xa867, 0x0103, 0xa877, 0x0000, 0xa87b, 0x0029, 0x080c,
-	0x6c81, 0x080c, 0xcd1e, 0x009e, 0x080c, 0xae61, 0x080c, 0x968d,
-	0x0005, 0x080c, 0xaef7, 0x0ce0, 0x9186, 0x0014, 0x1dd0, 0x080c,
-	0x9588, 0x0096, 0x6014, 0x2048, 0x080c, 0xcb35, 0x0d60, 0xa867,
-	0x0103, 0xa877, 0x0000, 0xa87b, 0x0006, 0xa880, 0xc0ec, 0xa882,
-	0x08f0, 0x0002, 0xc5b9, 0xc5b7, 0xc5b7, 0xc5b7, 0xc5b7, 0xc5b7,
-	0xc5d1, 0xc5b7, 0xc5b7, 0xc5b7, 0xc5b7, 0xc5b7, 0xc5b7, 0x080c,
-	0x0dd5, 0x080c, 0x9588, 0x6034, 0x908c, 0xff00, 0x810f, 0x9186,
-	0x0039, 0x0118, 0x9186, 0x0035, 0x1118, 0x2001, 0x1986, 0x0010,
-	0x2001, 0x1987, 0x2004, 0x601a, 0x6003, 0x000c, 0x080c, 0x968d,
-	0x0005, 0x080c, 0x9588, 0x6034, 0x908c, 0xff00, 0x810f, 0x9186,
-	0x0039, 0x0118, 0x9186, 0x0035, 0x1118, 0x2001, 0x1986, 0x0010,
-	0x2001, 0x1987, 0x2004, 0x601a, 0x6003, 0x000e, 0x080c, 0x968d,
-	0x0005, 0x9182, 0x0092, 0x1220, 0x9182, 0x0085, 0x0208, 0x0012,
-	0x0804, 0xaef7, 0xc5ff, 0xc5ff, 0xc5ff, 0xc5ff, 0xc601, 0xc64e,
-	0xc5ff, 0xc5ff, 0xc5ff, 0xc5ff, 0xc5ff, 0xc5ff, 0xc5ff, 0x080c,
-	0x0dd5, 0x0096, 0x6010, 0x00b6, 0x2058, 0xb800, 0x00be, 0xd0bc,
-	0x0168, 0x6034, 0x908c, 0xff00, 0x810f, 0x9186, 0x0039, 0x0118,
-	0x9186, 0x0035, 0x1118, 0x009e, 0x0804, 0xc662, 0x080c, 0xcb35,
-	0x1118, 0x080c, 0xcd1e, 0x0068, 0x6014, 0x2048, 0xa87c, 0xd0e4,
-	0x1110, 0x080c, 0xcd1e, 0xa867, 0x0103, 0x080c, 0xd210, 0x080c,
-	0x6c81, 0x00d6, 0x2c68, 0x080c, 0xae0b, 0x01d0, 0x6003, 0x0001,
-	0x6007, 0x001e, 0x600b, 0xffff, 0x2009, 0x026e, 0x210c, 0x613a,
-	0x2009, 0x026f, 0x210c, 0x613e, 0x6910, 0x6112, 0x080c, 0xcfaa,
-	0x6954, 0x6156, 0x6023, 0x0001, 0x080c, 0x90f0, 0x080c, 0x968d,
-	0x2d60, 0x00de, 0x080c, 0xae61, 0x009e, 0x0005, 0x6010, 0x00b6,
-	0x2058, 0xb800, 0x00be, 0xd0bc, 0x05a0, 0x6034, 0x908c, 0xff00,
-	0x810f, 0x9186, 0x0035, 0x0130, 0x9186, 0x001e, 0x0118, 0x9186,
-	0x0039, 0x1538, 0x00d6, 0x2c68, 0x080c, 0xd1a8, 0x11f0, 0x080c,
-	0xae0b, 0x01d8, 0x6106, 0x6003, 0x0001, 0x6023, 0x0001, 0x6910,
-	0x6112, 0x692c, 0x612e, 0x6930, 0x6132, 0x6934, 0x918c, 0x00ff,
-	0x6136, 0x6938, 0x613a, 0x693c, 0x613e, 0x6954, 0x6156, 0x080c,
-	0xcfaa, 0x080c, 0x90f0, 0x080c, 0x968d, 0x2d60, 0x00de, 0x0804,
-	0xae61, 0x0096, 0x6014, 0x2048, 0x080c, 0xcb35, 0x01c8, 0xa867,
-	0x0103, 0xa880, 0xd0b4, 0x0128, 0xc0ec, 0xa882, 0xa87b, 0x0006,
-	0x0048, 0xd0bc, 0x0118, 0xa87b, 0x0002, 0x0020, 0xa87b, 0x0005,
-	0x080c, 0xce2a, 0xa877, 0x0000, 0x080c, 0x6c81, 0x080c, 0xcd1e,
-	0x009e, 0x0804, 0xae61, 0x0016, 0x0096, 0x6014, 0x2048, 0x080c,
-	0xcb35, 0x0140, 0xa867, 0x0103, 0xa87b, 0x0028, 0xa877, 0x0000,
-	0x080c, 0x6c81, 0x009e, 0x001e, 0x9186, 0x0013, 0x0148, 0x9186,
-	0x0014, 0x0130, 0x9186, 0x0027, 0x0118, 0x080c, 0xaef7, 0x0030,
-	0x080c, 0x9588, 0x080c, 0xae92, 0x080c, 0x968d, 0x0005, 0x0056,
-	0x0066, 0x0096, 0x00a6, 0x2029, 0x0001, 0x9182, 0x0101, 0x1208,
-	0x0010, 0x2009, 0x0100, 0x2130, 0x8304, 0x9098, 0x0018, 0x2009,
-	0x0020, 0x2011, 0x0029, 0x080c, 0xc730, 0x96b2, 0x0020, 0xb004,
-	0x904d, 0x0110, 0x080c, 0x0fb1, 0x080c, 0x0fff, 0x0520, 0x8528,
-	0xa867, 0x0110, 0xa86b, 0x0000, 0x2920, 0xb406, 0x968a, 0x003d,
-	0x1228, 0x2608, 0x2011, 0x001b, 0x0499, 0x00a8, 0x96b2, 0x003c,
-	0x2009, 0x003c, 0x2950, 0x2011, 0x001b, 0x0451, 0x0c28, 0x2001,
-	0x0205, 0x2003, 0x0000, 0x00ae, 0x852f, 0x95ad, 0x0003, 0xb566,
-	0x95ac, 0x0000, 0x0048, 0x2001, 0x0205, 0x2003, 0x0000, 0x00ae,
-	0x852f, 0x95ad, 0x0003, 0xb566, 0x009e, 0x006e, 0x005e, 0x0005,
-	0x00a6, 0x89ff, 0x0158, 0xa804, 0x9055, 0x0130, 0xa807, 0x0000,
-	0x080c, 0x6c81, 0x2a48, 0x0cb8, 0x080c, 0x6c81, 0x00ae, 0x0005,
-	0x00f6, 0x2079, 0x0200, 0x7814, 0x9085, 0x0080, 0x7816, 0xd184,
-	0x0108, 0x8108, 0x810c, 0x20a9, 0x0001, 0xa860, 0x20e8, 0xa85c,
-	0x9200, 0x20a0, 0x20e1, 0x0000, 0x2300, 0x9e00, 0x2098, 0x4003,
-	0x8318, 0x9386, 0x0020, 0x1148, 0x2018, 0x2300, 0x9e00, 0x2098,
-	0x7814, 0x8000, 0x9085, 0x0080, 0x7816, 0x8109, 0x1d80, 0x7817,
-	0x0000, 0x00fe, 0x0005, 0x0066, 0x0126, 0x2091, 0x8000, 0x2031,
-	0x0001, 0x6020, 0x9084, 0x000f, 0x0083, 0x012e, 0x006e, 0x0005,
-	0x0126, 0x2091, 0x8000, 0x0066, 0x2031, 0x0000, 0x6020, 0x9084,
-	0x000f, 0x001b, 0x006e, 0x012e, 0x0005, 0xc796, 0xc796, 0xc791,
-	0xc7b8, 0xc784, 0xc791, 0xc7b8, 0xc791, 0xc784, 0x8ed9, 0xc791,
-	0xc791, 0xc791, 0xc784, 0xc784, 0x080c, 0x0dd5, 0x0036, 0x2019,
-	0x0010, 0x080c, 0xe134, 0x6023, 0x0006, 0x6003, 0x0007, 0x003e,
-	0x0005, 0x9006, 0x0005, 0x9085, 0x0001, 0x0005, 0x0096, 0x86ff,
-	0x11d8, 0x6014, 0x2048, 0x080c, 0xcb35, 0x01c0, 0xa864, 0x9086,
-	0x0139, 0x1128, 0xa87b, 0x0005, 0xa883, 0x0000, 0x0028, 0x900e,
-	0x2001, 0x0005, 0x080c, 0x6ec0, 0x080c, 0xce2a, 0x080c, 0x6c75,
-	0x080c, 0xae92, 0x9085, 0x0001, 0x009e, 0x0005, 0x9006, 0x0ce0,
-	0x6000, 0x908a, 0x0016, 0x1a0c, 0x0dd5, 0x0002, 0xc7ce, 0xc7fc,
-	0xc7d0, 0xc81d, 0xc7f7, 0xc7ce, 0xc791, 0xc796, 0xc796, 0xc791,
-	0xc791, 0xc791, 0xc791, 0xc791, 0xc791, 0xc791, 0x080c, 0x0dd5,
-	0x86ff, 0x1510, 0x6020, 0x9086, 0x0006, 0x01f0, 0x0096, 0x6014,
-	0x2048, 0x080c, 0xcb35, 0x0158, 0xa87c, 0xd0cc, 0x0130, 0x0096,
-	0xa878, 0x2048, 0x080c, 0x0fb1, 0x009e, 0x080c, 0xce2a, 0x009e,
-	0x080c, 0xd1ea, 0x6007, 0x0085, 0x6003, 0x000b, 0x6023, 0x0002,
-	0x080c, 0x90f0, 0x080c, 0x968d, 0x9085, 0x0001, 0x0005, 0x0066,
-	0x080c, 0x1a5e, 0x006e, 0x08a0, 0x00e6, 0x2071, 0x19e7, 0x7024,
-	0x9c06, 0x1120, 0x080c, 0xa540, 0x00ee, 0x0850, 0x6020, 0x9084,
-	0x000f, 0x9086, 0x0006, 0x1150, 0x0086, 0x0096, 0x2049, 0x0001,
-	0x2c40, 0x080c, 0xa69c, 0x009e, 0x008e, 0x0010, 0x080c, 0xa43d,
-	0x00ee, 0x1904, 0xc7d0, 0x0804, 0xc791, 0x0036, 0x00e6, 0x2071,
-	0x19e7, 0x703c, 0x9c06, 0x1138, 0x901e, 0x080c, 0xa5b6, 0x00ee,
-	0x003e, 0x0804, 0xc7d0, 0x080c, 0xa7cc, 0x00ee, 0x003e, 0x1904,
-	0xc7d0, 0x0804, 0xc791, 0x00c6, 0x6020, 0x9084, 0x000f, 0x0013,
-	0x00ce, 0x0005, 0xc850, 0xc919, 0xca80, 0xc85a, 0xae92, 0xc850,
-	0xe126, 0xd252, 0xc919, 0x8eab, 0xcaff, 0xc849, 0xc849, 0xc849,
-	0xc849, 0x080c, 0x0dd5, 0x080c, 0xcd3b, 0x1110, 0x080c, 0xb813,
-	0x0005, 0x080c, 0x9588, 0x080c, 0x968d, 0x0804, 0xae61, 0x601b,
-	0x0001, 0x0005, 0x080c, 0xcb35, 0x0130, 0x6014, 0x0096, 0x2048,
-	0x2c00, 0xa896, 0x009e, 0x6000, 0x908a, 0x0016, 0x1a0c, 0x0dd5,
-	0x0002, 0xc879, 0xc87b, 0xc89f, 0xc8b3, 0xc8d7, 0xc879, 0xc850,
-	0xc850, 0xc850, 0xc8b3, 0xc8b3, 0xc879, 0xc879, 0xc879, 0xc879,
-	0xc8bd, 0x080c, 0x0dd5, 0x00e6, 0x6014, 0x0096, 0x2048, 0xa880,
-	0xc0b5, 0xa882, 0x009e, 0x2071, 0x19e7, 0x7024, 0x9c06, 0x01a0,
-	0x080c, 0xa43d, 0x080c, 0xd1ea, 0x6007, 0x0085, 0x6003, 0x000b,
-	0x6023, 0x0002, 0x2001, 0x1987, 0x2004, 0x601a, 0x080c, 0x90f0,
-	0x080c, 0x968d, 0x00ee, 0x0005, 0x601b, 0x0001, 0x0cd8, 0x0096,
-	0x6014, 0x2048, 0xa880, 0xc0b5, 0xa882, 0x009e, 0x080c, 0xd1ea,
-	0x6007, 0x0085, 0x6003, 0x000b, 0x6023, 0x0002, 0x080c, 0x90f0,
-	0x080c, 0x968d, 0x0005, 0x0096, 0x601b, 0x0001, 0x6014, 0x2048,
-	0xa880, 0xc0b5, 0xa882, 0x009e, 0x0005, 0x080c, 0x56d7, 0x01a8,
-	0x6014, 0x0096, 0x904d, 0x0180, 0xa864, 0xa867, 0x0103, 0xa87b,
-	0x0006, 0x9086, 0x0139, 0x1140, 0xa867, 0x0139, 0xa897, 0x4005,
-	0xa89b, 0x0004, 0x080c, 0x6c81, 0x009e, 0x0804, 0xae61, 0x6014,
-	0x0096, 0x904d, 0x05c8, 0xa97c, 0xd1e4, 0x05b0, 0x2001, 0x180f,
-	0x2004, 0xd0c4, 0x0110, 0x009e, 0x0005, 0xa884, 0x009e, 0x8003,
-	0x800b, 0x810b, 0x9108, 0x611a, 0x2001, 0x0030, 0x2c08, 0x080c,
-	0x15ee, 0x2001, 0x030c, 0x2004, 0x9086, 0x0041, 0x11a0, 0x6014,
-	0x0096, 0x904d, 0x090c, 0x0dd5, 0xa880, 0xd0f4, 0x1130, 0xc0f5,
-	0xa882, 0x009e, 0x601b, 0x0002, 0x0070, 0x009e, 0x2001, 0x0037,
-	0x2c08, 0x080c, 0x15ee, 0x6000, 0x9086, 0x0004, 0x1120, 0x2009,
-	0x0048, 0x080c, 0xaedc, 0x0005, 0x009e, 0x080c, 0x1a5e, 0x0804,
-	0xc89f, 0x6000, 0x908a, 0x0016, 0x1a0c, 0x0dd5, 0x000b, 0x0005,
-	0xc930, 0xc857, 0xc932, 0xc930, 0xc932, 0xc932, 0xc851, 0xc930,
-	0xc84b, 0xc84b, 0xc930, 0xc930, 0xc930, 0xc930, 0xc930, 0xc930,
-	0x080c, 0x0dd5, 0x6010, 0x00b6, 0x2058, 0xb804, 0x9084, 0x00ff,
-	0x00be, 0x908a, 0x000c, 0x1a0c, 0x0dd5, 0x00b6, 0x0013, 0x00be,
-	0x0005, 0xc94d, 0xca1a, 0xc94f, 0xc98f, 0xc94f, 0xc98f, 0xc94f,
-	0xc95d, 0xc94d, 0xc98f, 0xc94d, 0xc97e, 0x080c, 0x0dd5, 0x6004,
-	0x908e, 0x0016, 0x05c0, 0x908e, 0x0004, 0x05a8, 0x908e, 0x0002,
-	0x0590, 0x908e, 0x0052, 0x0904, 0xca16, 0x6004, 0x080c, 0xcd3b,
-	0x0904, 0xca33, 0x908e, 0x0004, 0x1110, 0x080c, 0x31e8, 0x908e,
-	0x0021, 0x0904, 0xca37, 0x908e, 0x0022, 0x0904, 0xca7b, 0x908e,
-	0x003d, 0x0904, 0xca37, 0x908e, 0x0039, 0x0904, 0xca3b, 0x908e,
-	0x0035, 0x0904, 0xca3b, 0x908e, 0x001e, 0x0178, 0x908e, 0x0001,
-	0x1140, 0x6010, 0x2058, 0xb804, 0x9084, 0x00ff, 0x9086, 0x0006,
-	0x0110, 0x080c, 0x31bf, 0x080c, 0xb813, 0x0804, 0xae92, 0x00c6,
-	0x00d6, 0x6104, 0x9186, 0x0016, 0x0904, 0xca07, 0x9186, 0x0002,
-	0x1904, 0xc9dc, 0x2001, 0x1837, 0x2004, 0xd08c, 0x11c8, 0x080c,
-	0x73bc, 0x11b0, 0x080c, 0xd230, 0x0138, 0x080c, 0x73df, 0x1120,
-	0x080c, 0x72cc, 0x0804, 0xca64, 0x2001, 0x197d, 0x2003, 0x0001,
-	0x2001, 0x1800, 0x2003, 0x0001, 0x080c, 0x72ee, 0x0804, 0xca64,
-	0x6010, 0x2058, 0x2001, 0x1837, 0x2004, 0xd0ac, 0x1904, 0xca64,
-	0xb8a0, 0x9084, 0xff80, 0x1904, 0xca64, 0xb840, 0x9084, 0x00ff,
-	0x9005, 0x0190, 0x8001, 0xb842, 0x6017, 0x0000, 0x6023, 0x0007,
-	0x601b, 0x0398, 0x6043, 0x0000, 0x080c, 0xae0b, 0x0128, 0x2b00,
-	0x6012, 0x6023, 0x0001, 0x0458, 0x00de, 0x00ce, 0x6004, 0x908e,
-	0x0002, 0x11a0, 0x6010, 0x2058, 0xb8a0, 0x9086, 0x007e, 0x1170,
-	0x2009, 0x1837, 0x2104, 0xc085, 0x200a, 0x00e6, 0x2071, 0x1800,
-	0x080c, 0x5fad, 0x00ee, 0x080c, 0xb813, 0x0030, 0x080c, 0xb813,
-	0x080c, 0x31bf, 0x080c, 0xd245, 0x00e6, 0x0126, 0x2091, 0x8000,
-	0x080c, 0x31e8, 0x012e, 0x00ee, 0x080c, 0xae92, 0x0005, 0x2001,
-	0x0002, 0x080c, 0x654f, 0x6003, 0x0001, 0x6007, 0x0002, 0x080c,
-	0x9138, 0x080c, 0x968d, 0x00de, 0x00ce, 0x0c80, 0x080c, 0x31e8,
-	0x0804, 0xc98b, 0x00c6, 0x00d6, 0x6104, 0x9186, 0x0016, 0x0d38,
-	0x6010, 0x2058, 0xb840, 0x9084, 0x00ff, 0x9005, 0x0904, 0xc9dc,
-	0x8001, 0xb842, 0x6003, 0x0001, 0x080c, 0x9138, 0x080c, 0x968d,
-	0x00de, 0x00ce, 0x0898, 0x080c, 0xb813, 0x0804, 0xc98d, 0x080c,
-	0xb84f, 0x0804, 0xc98d, 0x00d6, 0x2c68, 0x6104, 0x080c, 0xd1a8,
-	0x00de, 0x0118, 0x080c, 0xae61, 0x00f0, 0x6004, 0x8007, 0x6134,
-	0x918c, 0x00ff, 0x9105, 0x6036, 0x6007, 0x0085, 0x6003, 0x000b,
-	0x6023, 0x0002, 0x603c, 0x600a, 0x2001, 0x1987, 0x2004, 0x601a,
-	0x602c, 0x2c08, 0x2060, 0x6024, 0xc0b5, 0x6026, 0x2160, 0x080c,
-	0x90f0, 0x080c, 0x968d, 0x0005, 0x00de, 0x00ce, 0x080c, 0xb813,
-	0x080c, 0x31bf, 0x00e6, 0x0126, 0x2091, 0x8000, 0x080c, 0x31e8,
-	0x6017, 0x0000, 0x6023, 0x0007, 0x601b, 0x0398, 0x6043, 0x0000,
-	0x012e, 0x00ee, 0x0005, 0x080c, 0xb291, 0x1904, 0xca33, 0x0005,
-	0x6000, 0x908a, 0x0016, 0x1a0c, 0x0dd5, 0x0096, 0x00d6, 0x001b,
-	0x00de, 0x009e, 0x0005, 0xca9b, 0xca9b, 0xca9b, 0xca9b, 0xca9b,
-	0xca9b, 0xca9b, 0xca9b, 0xca9b, 0xc850, 0xca9b, 0xc857, 0xca9d,
-	0xc857, 0xcaaa, 0xca9b, 0x080c, 0x0dd5, 0x6004, 0x9086, 0x008b,
-	0x0148, 0x6007, 0x008b, 0x6003, 0x000d, 0x080c, 0x90f0, 0x080c,
-	0x968d, 0x0005, 0x080c, 0xd224, 0x0118, 0x080c, 0xd237, 0x0010,
-	0x080c, 0xd245, 0x080c, 0xcd1e, 0x080c, 0xcb35, 0x0570, 0x080c,
-	0x31bf, 0x080c, 0xcb35, 0x0168, 0x6014, 0x2048, 0xa867, 0x0103,
-	0xa87b, 0x0006, 0xa877, 0x0000, 0xa880, 0xc0ed, 0xa882, 0x080c,
-	0x6c81, 0x2c68, 0x080c, 0xae0b, 0x0150, 0x6810, 0x6012, 0x080c,
-	0xcfaa, 0x00c6, 0x2d60, 0x080c, 0xae92, 0x00ce, 0x0008, 0x2d60,
-	0x6017, 0x0000, 0x6023, 0x0001, 0x6007, 0x0001, 0x6003, 0x0001,
-	0x080c, 0x9138, 0x080c, 0x968d, 0x00c8, 0x080c, 0xd224, 0x0138,
-	0x6034, 0x9086, 0x4000, 0x1118, 0x080c, 0x31bf, 0x08d0, 0x6034,
-	0x908c, 0xff00, 0x810f, 0x9186, 0x0039, 0x0118, 0x9186, 0x0035,
-	0x1118, 0x080c, 0x31bf, 0x0868, 0x080c, 0xae92, 0x0005, 0x6000,
-	0x908a, 0x0016, 0x1a0c, 0x0dd5, 0x0002, 0xcb15, 0xcb15, 0xcb17,
-	0xcb17, 0xcb17, 0xcb15, 0xcb15, 0xae92, 0xcb15, 0xcb15, 0xcb15,
-	0xcb15, 0xcb15, 0xcb15, 0xcb15, 0xcb15, 0x080c, 0x0dd5, 0x080c,
-	0xa7cc, 0x6114, 0x0096, 0x2148, 0xa87b, 0x0006, 0x080c, 0x6c81,
-	0x009e, 0x0804, 0xae61, 0x9284, 0x0007, 0x1158, 0x9282, 0x1cd0,
-	0x0240, 0x2001, 0x181a, 0x2004, 0x9202, 0x1218, 0x9085, 0x0001,
-	0x0005, 0x9006, 0x0ce8, 0x0096, 0x0028, 0x0096, 0x0006, 0x6014,
-	0x2048, 0x000e, 0x0006, 0x9984, 0xf000, 0x9086, 0xf000, 0x0110,
-	0x080c, 0x10aa, 0x000e, 0x009e, 0x0005, 0x00e6, 0x00c6, 0x0036,
-	0x0006, 0x0126, 0x2091, 0x8000, 0x2061, 0x1cd0, 0x2071, 0x1800,
-	0x7354, 0x7074, 0x9302, 0x1640, 0x6020, 0x9206, 0x11f8, 0x080c,
-	0xd230, 0x0180, 0x9286, 0x0001, 0x1168, 0x6004, 0x9086, 0x0004,
-	0x1148, 0x080c, 0x31bf, 0x080c, 0xd245, 0x00c6, 0x080c, 0xae92,
-	0x00ce, 0x0060, 0x080c, 0xcf24, 0x0148, 0x080c, 0xcd3b, 0x1110,
-	0x080c, 0xb813, 0x00c6, 0x080c, 0xae61, 0x00ce, 0x9ce0, 0x0018,
-	0x7068, 0x9c02, 0x1208, 0x08a0, 0x012e, 0x000e, 0x003e, 0x00ce,
-	0x00ee, 0x0005, 0x00e6, 0x00c6, 0x0016, 0x9188, 0x1000, 0x210c,
-	0x81ff, 0x0128, 0x2061, 0x1ab0, 0x6112, 0x080c, 0x31bf, 0x9006,
-	0x0010, 0x9085, 0x0001, 0x001e, 0x00ce, 0x00ee, 0x0005, 0x00c6,
-	0x0126, 0x2091, 0x8000, 0x080c, 0xae0b, 0x01b0, 0x6656, 0x2b00,
-	0x6012, 0x080c, 0x56d7, 0x0118, 0x080c, 0xcc62, 0x0168, 0x080c,
-	0xcfaa, 0x6023, 0x0003, 0x2009, 0x004b, 0x080c, 0xaedc, 0x9085,
-	0x0001, 0x012e, 0x00ce, 0x0005, 0x9006, 0x0cd8, 0x00c6, 0x0126,
-	0x2091, 0x8000, 0xbaa0, 0x080c, 0xaeaf, 0x0560, 0x6057, 0x0000,
-	0x2b00, 0x6012, 0x080c, 0xcfaa, 0x6023, 0x0003, 0x0016, 0x080c,
-	0x928b, 0x0076, 0x903e, 0x080c, 0x9168, 0x2c08, 0x080c, 0xe2eb,
-	0x007e, 0x001e, 0xd184, 0x0128, 0x080c, 0xae61, 0x9085, 0x0001,
-	0x0070, 0x080c, 0x56d7, 0x0128, 0xd18c, 0x1170, 0x080c, 0xcc62,
-	0x0148, 0x2009, 0x004c, 0x080c, 0xaedc, 0x9085, 0x0001, 0x012e,
-	0x00ce, 0x0005, 0x9006, 0x0cd8, 0x2900, 0x6016, 0x0c90, 0x2009,
-	0x004d, 0x0010, 0x2009, 0x004e, 0x00f6, 0x00c6, 0x0046, 0x0016,
-	0x080c, 0xae0b, 0x2c78, 0x0590, 0x7e56, 0x2b00, 0x7812, 0x7823,
-	0x0003, 0x2021, 0x0005, 0x080c, 0xcc74, 0x9186, 0x004d, 0x0118,
-	0x9186, 0x004e, 0x0148, 0x2001, 0x1980, 0x200c, 0xd1fc, 0x0168,
-	0x2f60, 0x080c, 0xae61, 0x00d0, 0x2001, 0x197f, 0x200c, 0xd1fc,
-	0x0120, 0x2f60, 0x080c, 0xae61, 0x0088, 0x2f60, 0x080c, 0x56d7,
-	0x0138, 0xd18c, 0x1118, 0x04f1, 0x0148, 0x0010, 0x2900, 0x7816,
-	0x001e, 0x0016, 0x080c, 0xaedc, 0x9085, 0x0001, 0x001e, 0x004e,
-	0x00ce, 0x00fe, 0x0005, 0x00f6, 0x00c6, 0x0046, 0x080c, 0xae0b,
-	0x2c78, 0x0508, 0x7e56, 0x2b00, 0x7812, 0x7823, 0x0003, 0x0096,
-	0x2021, 0x0004, 0x0489, 0x009e, 0x2001, 0x197e, 0x200c, 0xd1fc,
-	0x0120, 0x2f60, 0x080c, 0xae61, 0x0060, 0x2f60, 0x080c, 0x56d7,
-	0x0120, 0xd18c, 0x1160, 0x0071, 0x0130, 0x2009, 0x0052, 0x080c,
-	0xaedc, 0x9085, 0x0001, 0x004e, 0x00ce, 0x00fe, 0x0005, 0x2900,
-	0x7816, 0x0c98, 0x00c6, 0x080c, 0x4aa4, 0x00ce, 0x1120, 0x080c,
-	0xae61, 0x9006, 0x0005, 0xa867, 0x0000, 0xa86b, 0x8000, 0x2900,
-	0x6016, 0x9085, 0x0001, 0x0005, 0x0096, 0x0076, 0x0126, 0x2091,
-	0x8000, 0x080c, 0x6733, 0x0158, 0x2001, 0xcc79, 0x0006, 0x900e,
-	0x2400, 0x080c, 0x6ec0, 0x080c, 0x6c81, 0x000e, 0x0807, 0x2418,
-	0x080c, 0x9522, 0xbaa0, 0x0086, 0x2041, 0x0001, 0x2039, 0x0001,
-	0x2608, 0x080c, 0x92a3, 0x008e, 0x080c, 0x9168, 0x2f08, 0x2648,
-	0x080c, 0xe2eb, 0xb93c, 0x81ff, 0x090c, 0x9374, 0x080c, 0x968d,
-	0x012e, 0x007e, 0x009e, 0x0005, 0x00c6, 0x0126, 0x2091, 0x8000,
-	0x080c, 0xae0b, 0x0190, 0x660a, 0x2b08, 0x6112, 0x080c, 0xcfaa,
-	0x6023, 0x0001, 0x2900, 0x6016, 0x2009, 0x001f, 0x080c, 0xaedc,
-	0x9085, 0x0001, 0x012e, 0x00ce, 0x0005, 0x9006, 0x0cd8, 0x00c6,
-	0x0126, 0x2091, 0x8000, 0x080c, 0xaeaf, 0x01b8, 0x660a, 0x2b08,
-	0x6112, 0x080c, 0xcfaa, 0x6023, 0x0008, 0x2900, 0x6016, 0x00f6,
-	0x2c78, 0x080c, 0x1725, 0x00fe, 0x2009, 0x0021, 0x080c, 0xaedc,
-	0x9085, 0x0001, 0x012e, 0x00ce, 0x0005, 0x9006, 0x0cd8, 0x2009,
-	0x003d, 0x00c6, 0x0126, 0x0016, 0x2091, 0x8000, 0x080c, 0xae0b,
-	0x0198, 0x660a, 0x2b08, 0x6112, 0x080c, 0xcfaa, 0x6023, 0x0001,
-	0x2900, 0x6016, 0x001e, 0x0016, 0x080c, 0xaedc, 0x9085, 0x0001,
-	0x001e, 0x012e, 0x00ce, 0x0005, 0x9006, 0x0cd0, 0x00c6, 0x0126,
-	0x2091, 0x8000, 0x080c, 0xaeaf, 0x0188, 0x2b08, 0x6112, 0x080c,
-	0xcfaa, 0x6023, 0x0001, 0x2900, 0x6016, 0x2009, 0x0000, 0x080c,
-	0xaedc, 0x9085, 0x0001, 0x012e, 0x00ce, 0x0005, 0x9006, 0x0cd8,
-	0x2009, 0x0044, 0x0830, 0x2009, 0x0049, 0x0818, 0x0026, 0x00b6,
-	0x6210, 0x2258, 0xba3c, 0x82ff, 0x0110, 0x8211, 0xba3e, 0x00be,
-	0x002e, 0x0005, 0x0006, 0x0016, 0x6004, 0x908e, 0x0002, 0x0140,
-	0x908e, 0x0003, 0x0128, 0x908e, 0x0004, 0x0110, 0x9085, 0x0001,
-	0x001e, 0x000e, 0x0005, 0x0006, 0x0096, 0x6020, 0x9086, 0x0004,
-	0x0190, 0x6014, 0x904d, 0x080c, 0xcb35, 0x0168, 0xa864, 0x9086,
-	0x0139, 0x0158, 0x6020, 0x9086, 0x0003, 0x0128, 0xa868, 0xd0fc,
-	0x0110, 0x9006, 0x0010, 0x9085, 0x0001, 0x009e, 0x000e, 0x0005,
-	0x00c6, 0x0126, 0x2091, 0x8000, 0x080c, 0xaeaf, 0x0198, 0x2b08,
-	0x6112, 0x080c, 0xcfaa, 0x6023, 0x0001, 0x2900, 0x6016, 0x080c,
-	0x31bf, 0x2009, 0x0028, 0x080c, 0xaedc, 0x9085, 0x0001, 0x012e,
-	0x00ce, 0x0005, 0x9006, 0x0cd8, 0x9186, 0x0015, 0x11a8, 0x2011,
-	0x1824, 0x2204, 0x9086, 0x0074, 0x1178, 0x00b6, 0x080c, 0xba65,
-	0x00be, 0x080c, 0xbc88, 0x6003, 0x0001, 0x6007, 0x0029, 0x080c,
-	0x9138, 0x080c, 0x968d, 0x0078, 0x6014, 0x0096, 0x2048, 0xa868,
-	0x009e, 0xd0fc, 0x0148, 0x2001, 0x0001, 0x080c, 0xd169, 0x080c,
-	0xb813, 0x080c, 0xae61, 0x0005, 0x0096, 0x6014, 0x904d, 0x090c,
-	0x0dd5, 0xa87b, 0x0030, 0xa883, 0x0000, 0xa897, 0x4005, 0xa89b,
-	0x0004, 0xa867, 0x0139, 0x0126, 0x2091, 0x8000, 0x080c, 0x6c81,
-	0x012e, 0x009e, 0x080c, 0xae61, 0x0c30, 0x0096, 0x9186, 0x0016,
-	0x1128, 0x2001, 0x0004, 0x080c, 0x654f, 0x00e8, 0x9186, 0x0015,
-	0x1510, 0x2011, 0x1824, 0x2204, 0x9086, 0x0014, 0x11e0, 0x6010,
-	0x00b6, 0x2058, 0x080c, 0x669a, 0x00be, 0x080c, 0xbd59, 0x1198,
-	0x6010, 0x00b6, 0x2058, 0xb890, 0x00be, 0x9005, 0x0160, 0x2001,
-	0x0006, 0x080c, 0x654f, 0x6014, 0x2048, 0xa868, 0xd0fc, 0x0170,
-	0x080c, 0xb265, 0x0048, 0x6014, 0x2048, 0xa868, 0xd0fc, 0x0528,
-	0x080c, 0xb813, 0x080c, 0xae61, 0x009e, 0x0005, 0x6014, 0x6310,
-	0x2358, 0x904d, 0x090c, 0x0dd5, 0xa87b, 0x0000, 0xa883, 0x0000,
-	0xa897, 0x4000, 0x900e, 0x080c, 0x681f, 0x1108, 0xc185, 0xb800,
-	0xd0bc, 0x0108, 0xc18d, 0xa99a, 0x0126, 0x2091, 0x8000, 0x080c,
-	0x6c81, 0x012e, 0x080c, 0xae61, 0x08f8, 0x6014, 0x904d, 0x090c,
-	0x0dd5, 0xa87b, 0x0030, 0xa883, 0x0000, 0xa897, 0x4005, 0xa89b,
-	0x0004, 0xa867, 0x0139, 0x0126, 0x2091, 0x8000, 0x080c, 0x6c81,
-	0x012e, 0x080c, 0xae61, 0x0840, 0xa878, 0x9086, 0x0005, 0x1108,
-	0x0009, 0x0005, 0xa880, 0xc0ad, 0xa882, 0x0005, 0x6043, 0x0000,
-	0x6017, 0x0000, 0x6003, 0x0001, 0x6007, 0x0050, 0x080c, 0x90f0,
-	0x080c, 0x968d, 0x0005, 0x00c6, 0x6010, 0x00b6, 0x2058, 0xb800,
-	0x00be, 0xd0bc, 0x0120, 0x6020, 0x9084, 0x000f, 0x0013, 0x00ce,
-	0x0005, 0xc850, 0xce5a, 0xce5a, 0xce5d, 0xe5fd, 0xe618, 0xe61b,
-	0xc850, 0xc850, 0xc850, 0xc850, 0xc850, 0xc850, 0xc850, 0xc850,
-	0x080c, 0x0dd5, 0xa001, 0xa001, 0x0005, 0x0096, 0x6014, 0x904d,
-	0x0118, 0xa87c, 0xd0e4, 0x1110, 0x009e, 0x0010, 0x009e, 0x0005,
-	0x6010, 0x00b6, 0x2058, 0xb800, 0x00be, 0xd0bc, 0x0550, 0x2001,
-	0x1834, 0x2004, 0x9005, 0x1540, 0x00f6, 0x2c78, 0x080c, 0xae0b,
-	0x0508, 0x7810, 0x6012, 0x080c, 0xcfaa, 0x7820, 0x9086, 0x0003,
-	0x0128, 0x7808, 0x603a, 0x2f00, 0x603e, 0x0020, 0x7808, 0x603e,
-	0x2f00, 0x603a, 0x602e, 0x6023, 0x0001, 0x6007, 0x0035, 0x6003,
-	0x0001, 0x7954, 0x6156, 0x080c, 0x90f0, 0x080c, 0x968d, 0x2f60,
-	0x00fe, 0x0005, 0x2f60, 0x00fe, 0x2001, 0x1988, 0x2004, 0x6042,
-	0x0005, 0x0016, 0x0096, 0x6814, 0x2048, 0xa87c, 0xd0e4, 0x0180,
-	0xc0e4, 0xa87e, 0xa877, 0x0000, 0xa893, 0x0000, 0xa88f, 0x0000,
-	0xd0cc, 0x0130, 0xc0cc, 0xa87e, 0xa878, 0x2048, 0x080c, 0x0fb1,
-	0x6830, 0x6036, 0x908e, 0x0001, 0x0148, 0x6803, 0x0002, 0x9086,
-	0x0005, 0x0170, 0x9006, 0x602e, 0x6032, 0x00d0, 0x681c, 0xc085,
-	0x681e, 0x6803, 0x0004, 0x6824, 0xc0f4, 0x9085, 0x0c00, 0x6826,
-	0x6814, 0x2048, 0xa8ac, 0x6938, 0x9102, 0xa8b0, 0x693c, 0x9103,
-	0x1e48, 0x683c, 0x602e, 0x6838, 0x9084, 0xfffc, 0x683a, 0x6032,
-	0x2d00, 0x603a, 0x6808, 0x603e, 0x6910, 0x6112, 0x6954, 0x6156,
-	0x6023, 0x0001, 0x6007, 0x0039, 0x6003, 0x0001, 0x080c, 0x90f0,
-	0x080c, 0x968d, 0x009e, 0x001e, 0x0005, 0x6024, 0xd0d4, 0x0510,
-	0xd0f4, 0x11f8, 0x6038, 0x940a, 0x603c, 0x9303, 0x0230, 0x9105,
-	0x0120, 0x6024, 0xc0d4, 0xc0f5, 0x0098, 0x643a, 0x633e, 0xac3e,
-	0xab42, 0x0046, 0x0036, 0x2400, 0xacac, 0x9402, 0xa836, 0x2300,
-	0xabb0, 0x9303, 0xa83a, 0x003e, 0x004e, 0x6024, 0xc0d4, 0x0000,
-	0x6026, 0x0005, 0xd0f4, 0x1138, 0xa83c, 0x603a, 0xa840, 0x603e,
-	0x6024, 0xc0f5, 0x6026, 0x0005, 0x0006, 0x0016, 0x6004, 0x908e,
-	0x0034, 0x01b8, 0x908e, 0x0035, 0x01a0, 0x908e, 0x0036, 0x0188,
-	0x908e, 0x0037, 0x0170, 0x908e, 0x0038, 0x0158, 0x908e, 0x0039,
-	0x0140, 0x908e, 0x003a, 0x0128, 0x908e, 0x003b, 0x0110, 0x9085,
-	0x0001, 0x001e, 0x000e, 0x0005, 0x0006, 0x0016, 0x0026, 0x0036,
-	0x00e6, 0x2001, 0x1982, 0x200c, 0x8000, 0x2014, 0x2001, 0x0032,
-	0x080c, 0x8f68, 0x2001, 0x1986, 0x82ff, 0x1110, 0x2011, 0x0014,
-	0x2202, 0x2001, 0x1984, 0x200c, 0x8000, 0x2014, 0x2071, 0x196c,
-	0x711a, 0x721e, 0x2001, 0x0064, 0x080c, 0x8f68, 0x2001, 0x1987,
-	0x82ff, 0x1110, 0x2011, 0x0014, 0x2202, 0x2001, 0x1988, 0x9288,
-	0x000a, 0x2102, 0x2001, 0x1a91, 0x2102, 0x2001, 0x0032, 0x080c,
-	0x15ee, 0x080c, 0x6953, 0x00ee, 0x003e, 0x002e, 0x001e, 0x000e,
-	0x0005, 0x0006, 0x0016, 0x00e6, 0x2001, 0x1986, 0x2003, 0x0028,
-	0x2001, 0x1987, 0x2003, 0x0014, 0x2071, 0x196c, 0x701b, 0x0000,
-	0x701f, 0x07d0, 0x2001, 0x1988, 0x2009, 0x001e, 0x2102, 0x2001,
-	0x1a91, 0x2102, 0x2001, 0x0032, 0x080c, 0x15ee, 0x00ee, 0x001e,
-	0x000e, 0x0005, 0x0096, 0x6058, 0x904d, 0x0110, 0x080c, 0x1031,
-	0x009e, 0x0005, 0x0005, 0x00c6, 0x0126, 0x2091, 0x8000, 0x080c,
-	0xae0b, 0x0180, 0x2b08, 0x6112, 0x0ca9, 0x6023, 0x0001, 0x2900,
-	0x6016, 0x2009, 0x0033, 0x080c, 0xaedc, 0x9085, 0x0001, 0x012e,
-	0x00ce, 0x0005, 0x9006, 0x0cd8, 0x0096, 0x00e6, 0x00f6, 0x2071,
-	0x1800, 0x9186, 0x0015, 0x1500, 0x7090, 0x9086, 0x0018, 0x11e0,
-	0x6014, 0x2048, 0xaa3c, 0xd2e4, 0x1160, 0x2c78, 0x080c, 0x9920,
-	0x01d8, 0x707c, 0xaa50, 0x9206, 0x1160, 0x7080, 0xaa54, 0x9206,
-	0x1140, 0x6210, 0x00b6, 0x2258, 0xbaa0, 0x00be, 0x900e, 0x080c,
-	0x3208, 0x080c, 0xb265, 0x0020, 0x080c, 0xb813, 0x080c, 0xae61,
-	0x00fe, 0x00ee, 0x009e, 0x0005, 0x7060, 0xaa54, 0x9206, 0x0d48,
-	0x0c80, 0x00c6, 0x0126, 0x2091, 0x8000, 0x080c, 0xae0b, 0x0188,
-	0x2b08, 0x6112, 0x080c, 0xcfaa, 0x6023, 0x0001, 0x2900, 0x6016,
-	0x2009, 0x004d, 0x080c, 0xaedc, 0x9085, 0x0001, 0x012e, 0x00ce,
-	0x0005, 0x9006, 0x0cd8, 0x00c6, 0x0126, 0x2091, 0x8000, 0x0016,
-	0x080c, 0xae0b, 0x0180, 0x2b08, 0x6112, 0x080c, 0xcfaa, 0x6023,
-	0x0001, 0x2900, 0x6016, 0x001e, 0x080c, 0xaedc, 0x9085, 0x0001,
-	0x012e, 0x00ce, 0x0005, 0x001e, 0x9006, 0x0cd0, 0x0016, 0x0026,
-	0x0036, 0x0046, 0x0056, 0x0066, 0x0096, 0x00e6, 0x00f6, 0x2071,
-	0x1800, 0x9186, 0x0015, 0x1568, 0x7190, 0x6014, 0x2048, 0xa814,
-	0x8003, 0x9106, 0x1530, 0x20e1, 0x0000, 0x2001, 0x19a0, 0x2003,
-	0x0000, 0x6014, 0x2048, 0xa830, 0x20a8, 0x8906, 0x8006, 0x8007,
-	0x9094, 0x003f, 0x22e8, 0x9084, 0xffc0, 0x9080, 0x001b, 0x20a0,
-	0x2001, 0x19a0, 0x0016, 0x200c, 0x080c, 0xd81b, 0x001e, 0xa804,
-	0x9005, 0x0110, 0x2048, 0x0c38, 0x6014, 0x2048, 0xa867, 0x0103,
-	0x0010, 0x080c, 0xb813, 0x080c, 0xae61, 0x00fe, 0x00ee, 0x009e,
-	0x006e, 0x005e, 0x004e, 0x003e, 0x002e, 0x001e, 0x0005, 0x0096,
-	0x00e6, 0x00f6, 0x2071, 0x1800, 0x9186, 0x0015, 0x11b8, 0x7090,
-	0x9086, 0x0004, 0x1198, 0x6014, 0x2048, 0x2c78, 0x080c, 0x9920,
-	0x01a8, 0x707c, 0xaa74, 0x9206, 0x1130, 0x7080, 0xaa78, 0x9206,
-	0x1110, 0x080c, 0x31bf, 0x080c, 0xb265, 0x0020, 0x080c, 0xb813,
-	0x080c, 0xae61, 0x00fe, 0x00ee, 0x009e, 0x0005, 0x7060, 0xaa78,
-	0x9206, 0x0d78, 0x0c80, 0x0096, 0x00e6, 0x00f6, 0x2071, 0x1800,
-	0x9186, 0x0015, 0x1550, 0x7090, 0x9086, 0x0004, 0x1530, 0x6014,
-	0x2048, 0x2c78, 0x080c, 0x9920, 0x05f0, 0x707c, 0xaacc, 0x9206,
-	0x1180, 0x7080, 0xaad0, 0x9206, 0x1160, 0x080c, 0x31bf, 0x0016,
-	0xa998, 0xaab0, 0x9284, 0x1000, 0xc0fd, 0x080c, 0x5687, 0x001e,
-	0x0010, 0x080c, 0x5478, 0x080c, 0xcb35, 0x0508, 0xa87b, 0x0000,
-	0xa883, 0x0000, 0xa897, 0x4000, 0x0080, 0x080c, 0xcb35, 0x01b8,
-	0x6014, 0x2048, 0x080c, 0x5478, 0x1d70, 0xa87b, 0x0030, 0xa883,
-	0x0000, 0xa897, 0x4005, 0xa89b, 0x0004, 0x0126, 0x2091, 0x8000,
-	0xa867, 0x0139, 0x080c, 0x6c81, 0x012e, 0x080c, 0xae61, 0x00fe,
-	0x00ee, 0x009e, 0x0005, 0x7060, 0xaad0, 0x9206, 0x0930, 0x0888,
-	0x0016, 0x0026, 0xa87c, 0xd0ac, 0x0178, 0xa938, 0xaa34, 0x2100,
-	0x9205, 0x0150, 0xa890, 0x9106, 0x1118, 0xa88c, 0x9206, 0x0120,
-	0xa992, 0xaa8e, 0x9085, 0x0001, 0x002e, 0x001e, 0x0005, 0x00b6,
-	0x00d6, 0x0036, 0x080c, 0xcb35, 0x0904, 0xd165, 0x0096, 0x6314,
-	0x2348, 0xa87a, 0xa982, 0x929e, 0x4000, 0x1580, 0x6310, 0x00c6,
-	0x2358, 0x2009, 0x0000, 0xa868, 0xd0f4, 0x1140, 0x080c, 0x681f,
-	0x1108, 0xc185, 0xb800, 0xd0bc, 0x0108, 0xc18d, 0xaa96, 0xa99a,
-	0x20a9, 0x0004, 0xa860, 0x20e8, 0xa85c, 0x9080, 0x0031, 0x20a0,
-	0xb8c4, 0x20e0, 0xb8c8, 0x9080, 0x0006, 0x2098, 0x080c, 0x0f7c,
-	0x20a9, 0x0004, 0xa85c, 0x9080, 0x0035, 0x20a0, 0xb8c8, 0x9080,
-	0x000a, 0x2098, 0x080c, 0x0f7c, 0x00ce, 0x0090, 0xaa96, 0x3918,
-	0x9398, 0x0007, 0x231c, 0x6004, 0x9086, 0x0016, 0x0110, 0xa89b,
-	0x0004, 0xaba2, 0x6310, 0x2358, 0xb804, 0x9084, 0x00ff, 0xa89e,
-	0x080c, 0x6c75, 0x6017, 0x0000, 0x009e, 0x003e, 0x00de, 0x00be,
-	0x0005, 0x0026, 0x0036, 0x0046, 0x00b6, 0x0096, 0x00f6, 0x6214,
-	0x2248, 0x6210, 0x2258, 0x2079, 0x0260, 0x9096, 0x0000, 0x11a0,
-	0xb814, 0x9084, 0x00ff, 0x900e, 0x080c, 0x283e, 0x2118, 0x831f,
-	0x939c, 0xff00, 0x7838, 0x9084, 0x00ff, 0x931d, 0x7c3c, 0x2011,
-	0x8018, 0x080c, 0x4b04, 0x00a8, 0x9096, 0x0001, 0x1148, 0x89ff,
-	0x0180, 0xa89b, 0x000d, 0x7838, 0xa8a6, 0x783c, 0xa8aa, 0x0048,
-	0x9096, 0x0002, 0x1130, 0xa89b, 0x000d, 0x7838, 0xa8a6, 0x783c,
-	0xa8aa, 0x00fe, 0x009e, 0x00be, 0x004e, 0x003e, 0x002e, 0x0005,
-	0x00c6, 0x0026, 0x0016, 0x9186, 0x0035, 0x0110, 0x6a38, 0x0008,
-	0x6a2c, 0x080c, 0xcb23, 0x01f0, 0x2260, 0x6120, 0x9186, 0x0003,
-	0x0118, 0x9186, 0x0006, 0x1190, 0x6838, 0x9206, 0x0140, 0x683c,
-	0x9206, 0x1160, 0x6108, 0x6838, 0x9106, 0x1140, 0x0020, 0x6008,
-	0x693c, 0x9106, 0x1118, 0x6010, 0x6910, 0x9106, 0x001e, 0x002e,
-	0x00ce, 0x0005, 0x9085, 0x0001, 0x0cc8, 0xa974, 0xd1cc, 0x0188,
-	0x918c, 0x00ff, 0x918e, 0x0002, 0x1160, 0xa9a8, 0x918c, 0x0f00,
-	0x810f, 0x918e, 0x0001, 0x1128, 0xa834, 0xa938, 0x9115, 0x190c,
-	0xc245, 0x0005, 0x0036, 0x2019, 0x0001, 0x0010, 0x0036, 0x901e,
-	0x0499, 0x01e0, 0x080c, 0xcb35, 0x01c8, 0x080c, 0xcd1e, 0x6037,
-	0x4000, 0x6014, 0x6017, 0x0000, 0x0096, 0x2048, 0xa87c, 0x080c,
-	0xcd3b, 0x1118, 0x080c, 0xb813, 0x0040, 0xa867, 0x0103, 0xa877,
-	0x0000, 0x83ff, 0x1129, 0x080c, 0x6c81, 0x009e, 0x003e, 0x0005,
-	0xa880, 0xd0b4, 0x0128, 0xa87b, 0x0006, 0xc0ec, 0xa882, 0x0048,
-	0xd0bc, 0x0118, 0xa87b, 0x0002, 0x0020, 0xa87b, 0x0005, 0x080c,
-	0xce2a, 0xa877, 0x0000, 0x0005, 0x2001, 0x1810, 0x2004, 0xd0ec,
-	0x0005, 0x0006, 0x2001, 0x1810, 0x2004, 0xd0f4, 0x000e, 0x0005,
-	0x0006, 0x2001, 0x1810, 0x2004, 0xd0e4, 0x000e, 0x0005, 0x0036,
-	0x0046, 0x6010, 0x00b6, 0x2058, 0xbba0, 0x00be, 0x2021, 0x0007,
-	0x080c, 0x4cbb, 0x004e, 0x003e, 0x0005, 0x0c51, 0x1d81, 0x0005,
-	0x2001, 0x1986, 0x2004, 0x601a, 0x0005, 0x2001, 0x1988, 0x2004,
-	0x6042, 0x0005, 0x080c, 0xae61, 0x0804, 0x968d, 0x00b6, 0x0066,
-	0x6000, 0x90b2, 0x0016, 0x1a0c, 0x0dd5, 0x001b, 0x006e, 0x00be,
-	0x0005, 0xd271, 0xd978, 0xdad5, 0xd271, 0xd271, 0xd271, 0xd271,
-	0xd271, 0xd2a8, 0xdb57, 0xd271, 0xd271, 0xd271, 0xd271, 0xd271,
-	0xd271, 0x080c, 0x0dd5, 0x0066, 0x6000, 0x90b2, 0x0016, 0x1a0c,
-	0x0dd5, 0x0013, 0x006e, 0x0005, 0xd28c, 0xe0bf, 0xd28c, 0xd28c,
-	0xd28c, 0xd28c, 0xd28c, 0xd28c, 0xe06c, 0xe113, 0xd28c, 0xe738,
-	0xe76e, 0xe738, 0xe76e, 0xd28c, 0x080c, 0x0dd5, 0x6000, 0x9082,
-	0x0016, 0x1a0c, 0x0dd5, 0x6000, 0x000a, 0x0005, 0xd2a6, 0xdd34,
-	0xde24, 0xde46, 0xdf05, 0xd2a6, 0xdfe3, 0xdf8d, 0xdb63, 0xe042,
-	0xe057, 0xd2a6, 0xd2a6, 0xd2a6, 0xd2a6, 0xd2a6, 0x080c, 0x0dd5,
-	0x91b2, 0x0053, 0x1a0c, 0x0dd5, 0x2100, 0x91b2, 0x0040, 0x1a04,
-	0xd6ec, 0x0002, 0xd2f2, 0xd4dd, 0xd2f2, 0xd2f2, 0xd2f2, 0xd4e6,
-	0xd2f2, 0xd2f2, 0xd2f2, 0xd2f2, 0xd2f2, 0xd2f2, 0xd2f2, 0xd2f2,
-	0xd2f2, 0xd2f2, 0xd2f2, 0xd2f2, 0xd2f2, 0xd2f2, 0xd2f2, 0xd2f2,
-	0xd2f2, 0xd2f4, 0xd357, 0xd366, 0xd3ca, 0xd3f5, 0xd46e, 0xd4c8,
-	0xd2f2, 0xd2f2, 0xd4e9, 0xd2f2, 0xd2f2, 0xd4fe, 0xd50b, 0xd2f2,
-	0xd2f2, 0xd2f2, 0xd2f2, 0xd2f2, 0xd58e, 0xd2f2, 0xd2f2, 0xd5a2,
-	0xd2f2, 0xd2f2, 0xd55d, 0xd2f2, 0xd2f2, 0xd2f2, 0xd5ba, 0xd2f2,
-	0xd2f2, 0xd2f2, 0xd637, 0xd2f2, 0xd2f2, 0xd2f2, 0xd2f2, 0xd2f2,
-	0xd2f2, 0xd6b4, 0x080c, 0x0dd5, 0x080c, 0x6930, 0x1150, 0x2001,
-	0x1837, 0x2004, 0xd0cc, 0x1128, 0x9084, 0x0009, 0x9086, 0x0008,
-	0x1140, 0x6007, 0x0009, 0x602f, 0x0009, 0x6017, 0x0000, 0x0804,
-	0xd4d6, 0x080c, 0x68cc, 0x00e6, 0x00c6, 0x0036, 0x0026, 0x0016,
-	0x6210, 0x2258, 0xbaa0, 0x0026, 0x2019, 0x0029, 0x080c, 0x928b,
-	0x0076, 0x903e, 0x080c, 0x9168, 0x2c08, 0x080c, 0xe2eb, 0x007e,
-	0x001e, 0x001e, 0x002e, 0x003e, 0x00ce, 0x00ee, 0x6610, 0x2658,
-	0x080c, 0x660e, 0xbe04, 0x9684, 0x00ff, 0x9082, 0x0006, 0x1268,
-	0x0016, 0x0026, 0x6210, 0x00b6, 0x2258, 0xbaa0, 0x00be, 0x2c08,
-	0x080c, 0xe997, 0x002e, 0x001e, 0x1178, 0x080c, 0xe21d, 0x1904,
-	0xd3c2, 0x080c, 0xe1b9, 0x1120, 0x6007, 0x0008, 0x0804, 0xd4d6,
-	0x6007, 0x0009, 0x0804, 0xd4d6, 0x080c, 0xe441, 0x0128, 0x080c,
-	0xe21d, 0x0d78, 0x0804, 0xd3c2, 0x6017, 0x1900, 0x0c88, 0x080c,
-	0x32e3, 0x1904, 0xd6e9, 0x6106, 0x080c, 0xe16e, 0x6007, 0x0006,
-	0x0804, 0xd4d6, 0x6007, 0x0007, 0x0804, 0xd4d6, 0x080c, 0xe7aa,
-	0x1904, 0xd6e9, 0x080c, 0x32e3, 0x1904, 0xd6e9, 0x00d6, 0x6610,
-	0x2658, 0xbe04, 0x9684, 0x00ff, 0x9082, 0x0006, 0x1220, 0x2001,
-	0x0001, 0x080c, 0x653b, 0x96b4, 0xff00, 0x8637, 0x9686, 0x0006,
-	0x0188, 0x9686, 0x0004, 0x0170, 0xbe04, 0x96b4, 0x00ff, 0x9686,
-	0x0006, 0x0140, 0x9686, 0x0004, 0x0128, 0x9686, 0x0005, 0x0110,
-	0x00de, 0x0480, 0x00e6, 0x2071, 0x0260, 0x7034, 0x9084, 0x0003,
-	0x1140, 0x7034, 0x9082, 0x0014, 0x0220, 0x7030, 0x9084, 0x0003,
-	0x0130, 0x00ee, 0x6017, 0x0000, 0x602f, 0x0007, 0x00b0, 0x00ee,
-	0x080c, 0xe281, 0x1190, 0x9686, 0x0006, 0x1140, 0x0026, 0x6210,
-	0x2258, 0xbaa0, 0x900e, 0x080c, 0x3208, 0x002e, 0x080c, 0x669a,
-	0x6007, 0x000a, 0x00de, 0x0804, 0xd4d6, 0x6007, 0x000b, 0x00de,
-	0x0804, 0xd4d6, 0x080c, 0x31bf, 0x080c, 0xd245, 0x6007, 0x0001,
-	0x0804, 0xd4d6, 0x080c, 0xe7aa, 0x1904, 0xd6e9, 0x080c, 0x32e3,
-	0x1904, 0xd6e9, 0x2071, 0x0260, 0x7034, 0x90b4, 0x0003, 0x1948,
-	0x90b2, 0x0014, 0x0a30, 0x7030, 0x9084, 0x0003, 0x1910, 0x6610,
-	0x2658, 0xbe04, 0x9686, 0x0707, 0x09e8, 0x0026, 0x6210, 0x2258,
-	0xbaa0, 0x900e, 0x080c, 0x3208, 0x002e, 0x6007, 0x000c, 0x2001,
-	0x0001, 0x080c, 0xe977, 0x0804, 0xd4d6, 0x080c, 0x6930, 0x1140,
-	0x2001, 0x1837, 0x2004, 0x9084, 0x0009, 0x9086, 0x0008, 0x1110,
-	0x0804, 0xd301, 0x080c, 0x68cc, 0x6610, 0x2658, 0xbe04, 0x9684,
-	0x00ff, 0x9082, 0x0006, 0x06c8, 0x1138, 0x0026, 0x2001, 0x0006,
-	0x080c, 0x657b, 0x002e, 0x0050, 0x96b4, 0xff00, 0x8637, 0x9686,
-	0x0004, 0x0120, 0x9686, 0x0006, 0x1904, 0xd3c2, 0x080c, 0xe28e,
-	0x1120, 0x6007, 0x000e, 0x0804, 0xd4d6, 0x0046, 0x6410, 0x2458,
-	0xbca0, 0x0046, 0x080c, 0x31bf, 0x080c, 0xd245, 0x004e, 0x0016,
-	0x9006, 0x2009, 0x1848, 0x210c, 0xd1a4, 0x0148, 0x2009, 0x0029,
-	0x080c, 0xe5ae, 0x6010, 0x2058, 0xb800, 0xc0e5, 0xb802, 0x001e,
-	0x004e, 0x6007, 0x0001, 0x0804, 0xd4d6, 0x2001, 0x0001, 0x080c,
-	0x653b, 0x0156, 0x0016, 0x0026, 0x0036, 0x20a9, 0x0004, 0x2019,
-	0x1805, 0x2011, 0x0270, 0x080c, 0xbe09, 0x003e, 0x002e, 0x001e,
-	0x015e, 0x9005, 0x0168, 0x96b4, 0xff00, 0x8637, 0x9682, 0x0004,
-	0x0a04, 0xd3c2, 0x9682, 0x0007, 0x0a04, 0xd41e, 0x0804, 0xd3c2,
-	0x6017, 0x1900, 0x6007, 0x0009, 0x0804, 0xd4d6, 0x080c, 0x6930,
-	0x1140, 0x2001, 0x1837, 0x2004, 0x9084, 0x0009, 0x9086, 0x0008,
-	0x1110, 0x0804, 0xd301, 0x080c, 0x68cc, 0x6610, 0x2658, 0xbe04,
-	0x9684, 0x00ff, 0x9082, 0x0006, 0x0698, 0x0150, 0x96b4, 0xff00,
-	0x8637, 0x9686, 0x0004, 0x0120, 0x9686, 0x0006, 0x1904, 0xd3c2,
-	0x080c, 0xe2bc, 0x1130, 0x080c, 0xe1b9, 0x1118, 0x6007, 0x0010,
-	0x04e8, 0x0046, 0x6410, 0x2458, 0xbca0, 0x0046, 0x080c, 0x31bf,
-	0x080c, 0xd245, 0x004e, 0x0016, 0x9006, 0x2009, 0x1848, 0x210c,
-	0xd1a4, 0x0148, 0x2009, 0x0029, 0x080c, 0xe5ae, 0x6010, 0x2058,
-	0xb800, 0xc0e5, 0xb802, 0x001e, 0x004e, 0x6007, 0x0001, 0x00f0,
-	0x080c, 0xe441, 0x0140, 0x96b4, 0xff00, 0x8637, 0x9686, 0x0006,
-	0x0978, 0x0804, 0xd3c2, 0x6017, 0x1900, 0x6007, 0x0009, 0x0070,
-	0x080c, 0x32e3, 0x1904, 0xd6e9, 0x080c, 0xe7aa, 0x1904, 0xd6e9,
-	0x080c, 0xd8b6, 0x1904, 0xd3c2, 0x6007, 0x0012, 0x6003, 0x0001,
-	0x080c, 0x9138, 0x080c, 0x968d, 0x0005, 0x6007, 0x0001, 0x6003,
-	0x0001, 0x080c, 0x9138, 0x080c, 0x968d, 0x0cb0, 0x6007, 0x0005,
-	0x0c68, 0x080c, 0xe7aa, 0x1904, 0xd6e9, 0x080c, 0x32e3, 0x1904,
-	0xd6e9, 0x080c, 0xd8b6, 0x1904, 0xd3c2, 0x6007, 0x0020, 0x6003,
-	0x0001, 0x080c, 0x9138, 0x080c, 0x968d, 0x0005, 0x080c, 0x32e3,
-	0x1904, 0xd6e9, 0x6007, 0x0023, 0x6003, 0x0001, 0x080c, 0x9138,
-	0x080c, 0x968d, 0x0005, 0x080c, 0xe7aa, 0x1904, 0xd6e9, 0x080c,
-	0x32e3, 0x1904, 0xd6e9, 0x080c, 0xd8b6, 0x1904, 0xd3c2, 0x0016,
-	0x0026, 0x00e6, 0x2071, 0x0260, 0x7244, 0x9286, 0xffff, 0x0180,
-	0x2c08, 0x080c, 0xcb23, 0x01b0, 0x2260, 0x7240, 0x6008, 0x9206,
-	0x1188, 0x6010, 0x9190, 0x0004, 0x2214, 0x9206, 0x01b8, 0x0050,
-	0x7240, 0x2c08, 0x9006, 0x080c, 0xe578, 0x1180, 0x7244, 0x9286,
-	0xffff, 0x01b0, 0x2160, 0x6007, 0x0026, 0x6017, 0x1700, 0x7214,
-	0x9296, 0xffff, 0x1180, 0x6007, 0x0025, 0x0068, 0x6020, 0x9086,
-	0x0007, 0x1d80, 0x6004, 0x9086, 0x0024, 0x1110, 0x080c, 0xae61,
-	0x2160, 0x6007, 0x0025, 0x6003, 0x0001, 0x080c, 0x9138, 0x080c,
-	0x968d, 0x00ee, 0x002e, 0x001e, 0x0005, 0x2001, 0x0001, 0x080c,
-	0x653b, 0x0156, 0x0016, 0x0026, 0x0036, 0x20a9, 0x0004, 0x2019,
-	0x1805, 0x2011, 0x0276, 0x080c, 0xbe09, 0x003e, 0x002e, 0x001e,
-	0x015e, 0x0120, 0x6007, 0x0031, 0x0804, 0xd4d6, 0x080c, 0xba7d,
-	0x080c, 0x73bc, 0x1190, 0x0006, 0x0026, 0x0036, 0x080c, 0x73d6,
-	0x1138, 0x080c, 0x76a4, 0x080c, 0x601a, 0x080c, 0x72ee, 0x0010,
-	0x080c, 0x7394, 0x003e, 0x002e, 0x000e, 0x0005, 0x080c, 0x32e3,
-	0x1904, 0xd6e9, 0x080c, 0xd8b6, 0x1904, 0xd3c2, 0x6106, 0x080c,
-	0xd8d2, 0x1120, 0x6007, 0x002b, 0x0804, 0xd4d6, 0x6007, 0x002c,
-	0x0804, 0xd4d6, 0x080c, 0xe7aa, 0x1904, 0xd6e9, 0x080c, 0x32e3,
-	0x1904, 0xd6e9, 0x080c, 0xd8b6, 0x1904, 0xd3c2, 0x6106, 0x080c,
-	0xd8d7, 0x1120, 0x6007, 0x002e, 0x0804, 0xd4d6, 0x6007, 0x002f,
-	0x0804, 0xd4d6, 0x080c, 0x32e3, 0x1904, 0xd6e9, 0x00e6, 0x00d6,
-	0x00c6, 0x6010, 0x2058, 0xb904, 0x9184, 0x00ff, 0x9086, 0x0006,
-	0x0158, 0x9184, 0xff00, 0x8007, 0x9086, 0x0006, 0x0128, 0x00ce,
-	0x00de, 0x00ee, 0x0804, 0xd4dd, 0x080c, 0x56d3, 0xd0e4, 0x0904,
-	0xd634, 0x2071, 0x026c, 0x7010, 0x603a, 0x7014, 0x603e, 0x7108,
-	0x720c, 0x080c, 0x696e, 0x0140, 0x6010, 0x2058, 0xb810, 0x9106,
-	0x1118, 0xb814, 0x9206, 0x0510, 0x080c, 0x696a, 0x15b8, 0x2069,
-	0x1800, 0x6880, 0x9206, 0x1590, 0x687c, 0x9106, 0x1578, 0x7210,
-	0x080c, 0xcb23, 0x0590, 0x080c, 0xd7a1, 0x0578, 0x080c, 0xe62a,
-	0x0560, 0x622e, 0x6007, 0x0036, 0x6003, 0x0001, 0x080c, 0x90f0,
-	0x080c, 0x968d, 0x00ce, 0x00de, 0x00ee, 0x0005, 0x7214, 0x9286,
-	0xffff, 0x0150, 0x080c, 0xcb23, 0x01c0, 0x9280, 0x0002, 0x2004,
-	0x7110, 0x9106, 0x1190, 0x08e0, 0x7210, 0x2c08, 0x9085, 0x0001,
-	0x080c, 0xe578, 0x2c10, 0x2160, 0x0140, 0x0890, 0x6007, 0x0037,
-	0x602f, 0x0009, 0x6017, 0x1500, 0x08b8, 0x6007, 0x0037, 0x602f,
-	0x0003, 0x6017, 0x1700, 0x0880, 0x6007, 0x0012, 0x0868, 0x080c,
-	0x32e3, 0x1904, 0xd6e9, 0x6010, 0x2058, 0xb804, 0x9084, 0xff00,
-	0x8007, 0x9086, 0x0006, 0x1904, 0xd4dd, 0x00e6, 0x00d6, 0x00c6,
-	0x080c, 0x56d3, 0xd0e4, 0x0904, 0xd6ac, 0x2069, 0x1800, 0x2071,
-	0x026c, 0x7008, 0x603a, 0x720c, 0x623e, 0x9286, 0xffff, 0x1150,
-	0x7208, 0x00c6, 0x2c08, 0x9085, 0x0001, 0x080c, 0xe578, 0x2c10,
-	0x00ce, 0x05e8, 0x080c, 0xcb23, 0x05d0, 0x7108, 0x9280, 0x0002,
-	0x2004, 0x9106, 0x15a0, 0x00c6, 0x0026, 0x2260, 0x080c, 0xc75b,
-	0x002e, 0x00ce, 0x7118, 0x918c, 0xff00, 0x810f, 0x9186, 0x0001,
-	0x0178, 0x9186, 0x0005, 0x0118, 0x9186, 0x0007, 0x1198, 0x9280,
-	0x0005, 0x2004, 0x9005, 0x0170, 0x080c, 0xd7a1, 0x0904, 0xd62d,
-	0x0056, 0x7510, 0x7614, 0x080c, 0xe643, 0x005e, 0x00ce, 0x00de,
-	0x00ee, 0x0005, 0x6007, 0x003b, 0x602f, 0x0009, 0x6017, 0x2a00,
-	0x6003, 0x0001, 0x080c, 0x90f0, 0x080c, 0x968d, 0x0c78, 0x6007,
-	0x003b, 0x602f, 0x0003, 0x6017, 0x0300, 0x6003, 0x0001, 0x080c,
-	0x90f0, 0x080c, 0x968d, 0x0c10, 0x6007, 0x003b, 0x602f, 0x000b,
-	0x6017, 0x0000, 0x0804, 0xd604, 0x00e6, 0x0026, 0x080c, 0x6930,
-	0x0550, 0x080c, 0x68cc, 0x080c, 0xe81c, 0x1518, 0x2071, 0x1800,
-	0x70dc, 0x9085, 0x0003, 0x70de, 0x00f6, 0x2079, 0x0100, 0x72b0,
-	0x9284, 0x00ff, 0x707e, 0x78e6, 0x9284, 0xff00, 0x7280, 0x9205,
-	0x7082, 0x78ea, 0x00fe, 0x70e7, 0x0000, 0x080c, 0x696e, 0x0120,
-	0x2011, 0x1a00, 0x2013, 0x07d0, 0xd0ac, 0x1128, 0x080c, 0x2f96,
-	0x0010, 0x080c, 0xe84e, 0x002e, 0x00ee, 0x080c, 0xae61, 0x0804,
-	0xd4dc, 0x080c, 0xae61, 0x0005, 0x2600, 0x0002, 0xd700, 0xd731,
-	0xd742, 0xd700, 0xd700, 0xd702, 0xd753, 0xd700, 0xd700, 0xd700,
-	0xd71f, 0xd700, 0xd700, 0xd700, 0xd75e, 0xd76b, 0xd79c, 0xd700,
-	0x080c, 0x0dd5, 0x080c, 0xe7aa, 0x1d20, 0x080c, 0x32e3, 0x1d08,
-	0x080c, 0xd8b6, 0x1148, 0x7038, 0x6016, 0x6007, 0x0045, 0x6003,
-	0x0001, 0x080c, 0x9138, 0x0005, 0x080c, 0x31bf, 0x080c, 0xd245,
-	0x6007, 0x0001, 0x6003, 0x0001, 0x080c, 0x9138, 0x0005, 0x080c,
-	0xe7aa, 0x1938, 0x080c, 0x32e3, 0x1920, 0x080c, 0xd8b6, 0x1d60,
-	0x703c, 0x6016, 0x6007, 0x004a, 0x6003, 0x0001, 0x080c, 0x9138,
-	0x0005, 0x080c, 0x32e3, 0x1904, 0xd6e9, 0x2009, 0x0041, 0x080c,
-	0xe857, 0x6007, 0x0047, 0x6003, 0x0001, 0x080c, 0x9138, 0x080c,
-	0x968d, 0x0005, 0x080c, 0x32e3, 0x1904, 0xd6e9, 0x2009, 0x0042,
-	0x080c, 0xe857, 0x6007, 0x0047, 0x6003, 0x0001, 0x080c, 0x9138,
-	0x080c, 0x968d, 0x0005, 0x080c, 0x32e3, 0x1904, 0xd6e9, 0x2009,
-	0x0046, 0x080c, 0xe857, 0x080c, 0xae61, 0x0005, 0x080c, 0xd7be,
-	0x0904, 0xd6e9, 0x6007, 0x004e, 0x6003, 0x0001, 0x080c, 0x9138,
-	0x080c, 0x968d, 0x0005, 0x6007, 0x004f, 0x6017, 0x0000, 0x7134,
-	0x918c, 0x00ff, 0x81ff, 0x0508, 0x9186, 0x0001, 0x1160, 0x7140,
-	0x2001, 0x19bd, 0x2004, 0x9106, 0x11b0, 0x7144, 0x2001, 0x19be,
-	0x2004, 0x9106, 0x0190, 0x9186, 0x0002, 0x1168, 0x2011, 0x0276,
-	0x20a9, 0x0004, 0x6010, 0x0096, 0x2048, 0x2019, 0x000a, 0x080c,
-	0xbe1d, 0x009e, 0x0110, 0x6017, 0x0001, 0x6003, 0x0001, 0x080c,
-	0x9138, 0x080c, 0x968d, 0x0005, 0x6007, 0x0050, 0x703c, 0x6016,
-	0x0ca0, 0x0016, 0x00e6, 0x2071, 0x0260, 0x00b6, 0x00c6, 0x2260,
-	0x6010, 0x2058, 0xb8cc, 0xd084, 0x0150, 0x7128, 0x6048, 0x9106,
-	0x1120, 0x712c, 0x6044, 0x9106, 0x0110, 0x9006, 0x0010, 0x9085,
-	0x0001, 0x00ce, 0x00be, 0x00ee, 0x001e, 0x0005, 0x0016, 0x0096,
-	0x0086, 0x00e6, 0x01c6, 0x01d6, 0x0126, 0x2091, 0x8000, 0x2071,
-	0x1800, 0x7090, 0x908a, 0x00f9, 0x16e8, 0x20e1, 0x0000, 0x2001,
-	0x19a0, 0x2003, 0x0000, 0x080c, 0x1018, 0x05a0, 0x2900, 0x6016,
-	0x7090, 0x8004, 0xa816, 0x908a, 0x001e, 0x02d0, 0xa833, 0x001e,
-	0x20a9, 0x001e, 0xa860, 0x20e8, 0xa85c, 0x9080, 0x001b, 0x20a0,
-	0x2001, 0x19a0, 0x0016, 0x200c, 0x0471, 0x001e, 0x2940, 0x080c,
-	0x1018, 0x01c0, 0x2900, 0xa006, 0x2100, 0x81ff, 0x0180, 0x0c18,
-	0xa832, 0x20a8, 0xa860, 0x20e8, 0xa85c, 0x9080, 0x001b, 0x20a0,
-	0x2001, 0x19a0, 0x0016, 0x200c, 0x00b1, 0x001e, 0x0000, 0x9085,
-	0x0001, 0x0048, 0x2071, 0x1800, 0x7093, 0x0000, 0x6014, 0x2048,
-	0x080c, 0x0fb1, 0x9006, 0x012e, 0x01de, 0x01ce, 0x00ee, 0x008e,
-	0x009e, 0x001e, 0x0005, 0x0006, 0x0016, 0x0026, 0x0036, 0x00c6,
-	0x918c, 0xffff, 0x11a8, 0x080c, 0x23ab, 0x2099, 0x026c, 0x2001,
-	0x0014, 0x3518, 0x9312, 0x1218, 0x23a8, 0x4003, 0x00f8, 0x20a8,
-	0x4003, 0x22a8, 0x8108, 0x080c, 0x23ab, 0x2099, 0x0260, 0x0ca8,
-	0x080c, 0x23ab, 0x2061, 0x19a0, 0x6004, 0x2098, 0x6008, 0x3518,
-	0x9312, 0x1218, 0x23a8, 0x4003, 0x0048, 0x20a8, 0x4003, 0x22a8,
-	0x8108, 0x080c, 0x23ab, 0x2099, 0x0260, 0x0ca8, 0x2061, 0x19a0,
-	0x2019, 0x0280, 0x3300, 0x931e, 0x0110, 0x6006, 0x0020, 0x2001,
-	0x0260, 0x6006, 0x8108, 0x2162, 0x9292, 0x0021, 0x9296, 0xffff,
-	0x620a, 0x00ce, 0x003e, 0x002e, 0x001e, 0x000e, 0x0005, 0x0006,
-	0x0016, 0x0026, 0x0036, 0x00c6, 0x81ff, 0x11b8, 0x080c, 0x23c3,
-	0x20a1, 0x024c, 0x2001, 0x0014, 0x3518, 0x9312, 0x1218, 0x23a8,
-	0x4003, 0x0418, 0x20a8, 0x4003, 0x82ff, 0x01f8, 0x22a8, 0x8108,
-	0x080c, 0x23c3, 0x20a1, 0x0240, 0x0c98, 0x080c, 0x23c3, 0x2061,
-	0x19a3, 0x6004, 0x20a0, 0x6008, 0x3518, 0x9312, 0x1218, 0x23a8,
-	0x4003, 0x0058, 0x20a8, 0x4003, 0x82ff, 0x0138, 0x22a8, 0x8108,
-	0x080c, 0x23c3, 0x20a1, 0x0240, 0x0c98, 0x2061, 0x19a3, 0x2019,
-	0x0260, 0x3400, 0x931e, 0x0110, 0x6006, 0x0020, 0x2001, 0x0240,
+	0x0904, 0xc173, 0x080c, 0x0fff, 0x090c, 0x0dd5, 0x2900, 0xb07a,
+	0xb77c, 0xc7cd, 0xb77e, 0xa867, 0x0103, 0xb068, 0xa86a, 0xb06c,
+	0xa86e, 0xb070, 0xa872, 0xae76, 0x968c, 0x0c00, 0x0120, 0x7348,
+	0xab92, 0x734c, 0xab8e, 0x968c, 0x00ff, 0x9186, 0x0002, 0x0180,
+	0x9186, 0x0028, 0x1118, 0xa87b, 0x001c, 0x0060, 0xd6dc, 0x0118,
+	0xa87b, 0x0015, 0x0038, 0xd6d4, 0x0118, 0xa87b, 0x0007, 0x0010,
+	0xa87b, 0x0000, 0xaf7e, 0xb080, 0xa882, 0xb084, 0xa886, 0x901e,
+	0xd6c4, 0x0190, 0x735c, 0xab86, 0x83ff, 0x0170, 0x938a, 0x0009,
+	0x0210, 0x2019, 0x0008, 0x0036, 0x2308, 0x2019, 0x0018, 0x2011,
+	0x0025, 0x080c, 0xc743, 0x003e, 0xd6cc, 0x01e8, 0x7154, 0xa98a,
+	0x81ff, 0x01c8, 0x9192, 0x0021, 0x1260, 0x8304, 0x9098, 0x0018,
+	0x2011, 0x0029, 0x080c, 0xc743, 0x2011, 0x0205, 0x2013, 0x0000,
+	0x0050, 0xb068, 0xd0fc, 0x0120, 0x2009, 0x0020, 0xa98a, 0x0c68,
+	0x2950, 0x080c, 0xc6e2, 0x009e, 0x00ee, 0x00ae, 0x007e, 0x0005,
+	0x00f6, 0x00a6, 0x6003, 0x0003, 0x2079, 0x026c, 0x7c04, 0x7b00,
+	0x7e0c, 0x7d08, 0x6014, 0x2050, 0xb436, 0xb33a, 0xb646, 0xb54a,
+	0x00ae, 0x00fe, 0x2c10, 0x080c, 0x1baf, 0x0804, 0xa241, 0x6003,
+	0x0002, 0x6004, 0x9086, 0x0040, 0x11c8, 0x0096, 0x6014, 0x2048,
+	0xa87c, 0xd0ac, 0x0160, 0x601c, 0xd084, 0x1130, 0x00f6, 0x2c00,
+	0x2078, 0x080c, 0x1727, 0x00fe, 0x6003, 0x0004, 0x0010, 0x6003,
+	0x0002, 0x009e, 0x080c, 0x957b, 0x080c, 0x9687, 0x0096, 0x2001,
+	0x1987, 0x2004, 0x6042, 0x080c, 0x9637, 0x080c, 0x97b5, 0x6114,
+	0x2148, 0xa97c, 0xd1e4, 0x0904, 0xc216, 0xd1cc, 0x05a8, 0xa978,
+	0xa868, 0xd0fc, 0x0538, 0x0016, 0xa87c, 0x0006, 0xa880, 0x0006,
+	0xa860, 0x20e8, 0xa85c, 0x9080, 0x0019, 0x20a0, 0x810e, 0x810e,
+	0x810f, 0x9184, 0x003f, 0x20e0, 0x9184, 0xffc0, 0x9080, 0x0019,
+	0x2098, 0x0156, 0x20a9, 0x0020, 0x4003, 0x015e, 0x000e, 0xa882,
+	0x000e, 0xa87e, 0x001e, 0xa874, 0x0006, 0x2148, 0x080c, 0x0fb1,
+	0x001e, 0x0440, 0x0016, 0x080c, 0x0fb1, 0x009e, 0xa974, 0x0016,
+	0x080c, 0xc733, 0x001e, 0x00f0, 0xa867, 0x0103, 0xa974, 0x9184,
+	0x00ff, 0x90b6, 0x0002, 0x0180, 0x9086, 0x0028, 0x1118, 0xa87b,
+	0x001c, 0x0060, 0xd1dc, 0x0118, 0xa87b, 0x0015, 0x0038, 0xd1d4,
+	0x0118, 0xa87b, 0x0007, 0x0010, 0xa87b, 0x0000, 0x0016, 0x080c,
+	0x6aa2, 0x001e, 0xd1e4, 0x1120, 0x080c, 0xae71, 0x009e, 0x0005,
+	0x080c, 0xce48, 0x0cd8, 0x6004, 0x9086, 0x0040, 0x1120, 0x080c,
+	0x957b, 0x080c, 0x9687, 0x2019, 0x0001, 0x080c, 0xa5b7, 0x6003,
+	0x0002, 0x080c, 0xd267, 0x080c, 0x9637, 0x080c, 0x97b5, 0x0005,
+	0x6004, 0x9086, 0x0040, 0x1120, 0x080c, 0x957b, 0x080c, 0x9687,
+	0x2019, 0x0001, 0x080c, 0xa5b7, 0x080c, 0x9637, 0x080c, 0x31c1,
+	0x080c, 0xd25f, 0x0096, 0x6114, 0x2148, 0x080c, 0xcb4a, 0x0150,
+	0xa867, 0x0103, 0xa87b, 0x0029, 0xa877, 0x0000, 0x080c, 0x6c86,
+	0x080c, 0xcd33, 0x009e, 0x080c, 0xae71, 0x080c, 0x97b5, 0x0005,
+	0xa87b, 0x0015, 0xd1fc, 0x0180, 0xa87b, 0x0007, 0x8002, 0x8000,
+	0x810a, 0x9189, 0x0000, 0x0006, 0x0016, 0x2009, 0x1a79, 0x2104,
+	0x8000, 0x200a, 0x001e, 0x000e, 0xa992, 0xa88e, 0x0005, 0x9182,
+	0x0054, 0x1220, 0x9182, 0x0040, 0x0208, 0x000a, 0x0005, 0xc28b,
+	0xc28b, 0xc28b, 0xc28b, 0xc28b, 0xc28d, 0xc28b, 0xc28b, 0xc333,
+	0xc28b, 0xc28b, 0xc28b, 0xc28b, 0xc28b, 0xc28b, 0xc28b, 0xc28b,
+	0xc28b, 0xc28b, 0xc464, 0x080c, 0x0dd5, 0x0076, 0x00a6, 0x00e6,
+	0x0096, 0x2071, 0x0260, 0x6114, 0x2150, 0x7644, 0xb676, 0x96b4,
+	0x0fff, 0xb77c, 0xc7e5, 0xb77e, 0x6210, 0x00b6, 0x2258, 0xba3c,
+	0x82ff, 0x0110, 0x8211, 0xba3e, 0x00be, 0x86ff, 0x0904, 0xc32c,
+	0x9694, 0xff00, 0x9284, 0x0c00, 0x0120, 0x7048, 0xb092, 0x704c,
+	0xb08e, 0x9284, 0x0300, 0x0904, 0xc32c, 0x9686, 0x0100, 0x1130,
+	0x7064, 0x9005, 0x1118, 0xc6c4, 0xb676, 0x0c38, 0x080c, 0x0fff,
+	0x090c, 0x0dd5, 0x2900, 0xb07a, 0xb77c, 0x97bd, 0x0200, 0xb77e,
+	0xa867, 0x0103, 0xb068, 0xa86a, 0xb06c, 0xa86e, 0xb070, 0xa872,
+	0x7044, 0x9084, 0xf000, 0x9635, 0xae76, 0x968c, 0x0c00, 0x0120,
+	0x7348, 0xab92, 0x734c, 0xab8e, 0x968c, 0x00ff, 0x9186, 0x0002,
+	0x0180, 0x9186, 0x0028, 0x1118, 0xa87b, 0x001c, 0x0060, 0xd6dc,
+	0x0118, 0xa87b, 0x0015, 0x0038, 0xd6d4, 0x0118, 0xa87b, 0x0007,
+	0x0010, 0xa87b, 0x0000, 0xaf7e, 0xb080, 0xa882, 0xb084, 0xa886,
+	0x901e, 0xd6c4, 0x0190, 0x735c, 0xab86, 0x83ff, 0x0170, 0x938a,
+	0x0009, 0x0210, 0x2019, 0x0008, 0x0036, 0x2308, 0x2019, 0x0018,
+	0x2011, 0x0025, 0x080c, 0xc743, 0x003e, 0xd6cc, 0x01e8, 0x7154,
+	0xa98a, 0x81ff, 0x01c8, 0x9192, 0x0021, 0x1260, 0x8304, 0x9098,
+	0x0018, 0x2011, 0x0029, 0x080c, 0xc743, 0x2011, 0x0205, 0x2013,
+	0x0000, 0x0050, 0xb068, 0xd0fc, 0x0120, 0x2009, 0x0020, 0xa98a,
+	0x0c68, 0x2950, 0x080c, 0xc6e2, 0x080c, 0x1a3e, 0x009e, 0x00ee,
+	0x00ae, 0x007e, 0x0005, 0x2001, 0x1987, 0x2004, 0x6042, 0x0096,
+	0x6114, 0x2148, 0xa83c, 0xa940, 0x9105, 0x1118, 0xa87c, 0xc0dc,
+	0xa87e, 0x6003, 0x0002, 0xa97c, 0xd1e4, 0x0904, 0xc45f, 0x6043,
+	0x0000, 0x6010, 0x00b6, 0x2058, 0xb800, 0x00be, 0xd0bc, 0x1500,
+	0xd1cc, 0x0904, 0xc42e, 0xa978, 0xa868, 0xd0fc, 0x0904, 0xc3ef,
+	0x0016, 0xa87c, 0x0006, 0xa880, 0x0006, 0x00a6, 0x2150, 0xb174,
+	0x9184, 0x00ff, 0x90b6, 0x0002, 0x0904, 0xc3bd, 0x9086, 0x0028,
+	0x1904, 0xc3a9, 0xa87b, 0x001c, 0xb07b, 0x001c, 0x0804, 0xc3c5,
+	0x6024, 0xd0f4, 0x11d0, 0xa838, 0xaa34, 0x9205, 0x09c8, 0xa838,
+	0xaa90, 0x9206, 0x1120, 0xa88c, 0xaa34, 0x9206, 0x0988, 0x6024,
+	0xd0d4, 0x1148, 0xa9ac, 0xa834, 0x9102, 0x603a, 0xa9b0, 0xa838,
+	0x9103, 0x603e, 0x6024, 0xc0f5, 0x6026, 0x6010, 0x00b6, 0x2058,
+	0xb83c, 0x8000, 0xb83e, 0x00be, 0x9006, 0xa876, 0xa892, 0xa88e,
+	0xa87c, 0xc0e4, 0xa87e, 0xd0cc, 0x0140, 0xc0cc, 0xa87e, 0x0096,
+	0xa878, 0x2048, 0x080c, 0x0fb1, 0x009e, 0x080c, 0xce82, 0x0804,
+	0xc45f, 0xd1dc, 0x0158, 0xa87b, 0x0015, 0xb07b, 0x0015, 0x080c,
+	0xd112, 0x0118, 0xb174, 0xc1dc, 0xb176, 0x0078, 0xd1d4, 0x0128,
+	0xa87b, 0x0007, 0xb07b, 0x0007, 0x0040, 0xa87c, 0xd0ac, 0x0128,
+	0xa834, 0xa938, 0x9115, 0x190c, 0xc258, 0xa87c, 0xb07e, 0xa890,
+	0xb092, 0xa88c, 0xb08e, 0xa860, 0x20e8, 0xa85c, 0x9080, 0x0019,
+	0x20a0, 0x20a9, 0x0020, 0x8a06, 0x8006, 0x8007, 0x9094, 0x003f,
+	0x22e0, 0x9084, 0xffc0, 0x9080, 0x0019, 0x2098, 0x4003, 0x00ae,
+	0x000e, 0xa882, 0x000e, 0xa87e, 0x080c, 0xd1ef, 0x001e, 0xa874,
+	0x0006, 0x2148, 0x080c, 0x0fb1, 0x001e, 0x0804, 0xc45b, 0x0016,
+	0x00a6, 0x2150, 0xb174, 0x9184, 0x00ff, 0x90b6, 0x0002, 0x01e0,
+	0x9086, 0x0028, 0x1128, 0xa87b, 0x001c, 0xb07b, 0x001c, 0x00e0,
+	0xd1dc, 0x0158, 0xa87b, 0x0015, 0xb07b, 0x0015, 0x080c, 0xd112,
+	0x0118, 0xb174, 0xc1dc, 0xb176, 0x0078, 0xd1d4, 0x0128, 0xa87b,
+	0x0007, 0xb07b, 0x0007, 0x0040, 0xa87c, 0xd0ac, 0x0128, 0xa834,
+	0xa938, 0x9115, 0x190c, 0xc258, 0xa890, 0xb092, 0xa88c, 0xb08e,
+	0xa87c, 0xb07e, 0x00ae, 0x080c, 0x0fb1, 0x009e, 0x080c, 0xd1ef,
+	0xa974, 0x0016, 0x080c, 0xc733, 0x001e, 0x0468, 0xa867, 0x0103,
+	0xa974, 0x9184, 0x00ff, 0x90b6, 0x0002, 0x01b0, 0x9086, 0x0028,
+	0x1118, 0xa87b, 0x001c, 0x00d0, 0xd1dc, 0x0148, 0xa87b, 0x0015,
+	0x080c, 0xd112, 0x0118, 0xa974, 0xc1dc, 0xa976, 0x0078, 0xd1d4,
+	0x0118, 0xa87b, 0x0007, 0x0050, 0xa87b, 0x0000, 0xa87c, 0xd0ac,
+	0x0128, 0xa834, 0xa938, 0x9115, 0x190c, 0xc258, 0xa974, 0x0016,
+	0x080c, 0x6aa2, 0x001e, 0xd1e4, 0x1120, 0x080c, 0xae71, 0x009e,
+	0x0005, 0x080c, 0xce48, 0x0cd8, 0x6114, 0x0096, 0x2148, 0xa97c,
+	0xd1e4, 0x190c, 0x1a4c, 0x009e, 0x0005, 0x080c, 0x957b, 0x0010,
+	0x080c, 0x9637, 0x080c, 0xcb4a, 0x01f0, 0x0096, 0x6114, 0x2148,
+	0x080c, 0xcd50, 0x1118, 0x080c, 0xb824, 0x00a0, 0xa867, 0x0103,
+	0x2009, 0x180c, 0x210c, 0xd18c, 0x11b8, 0xd184, 0x1190, 0x6108,
+	0xa97a, 0x918e, 0x0029, 0x1110, 0x080c, 0xe929, 0xa877, 0x0000,
+	0x080c, 0x6c86, 0x009e, 0x080c, 0xae71, 0x080c, 0x9687, 0x0804,
+	0x97b5, 0xa87b, 0x0004, 0x0c90, 0xa87b, 0x0004, 0x0c78, 0x9182,
+	0x0054, 0x1220, 0x9182, 0x0040, 0x0208, 0x000a, 0x0005, 0xc4bb,
+	0xc4bb, 0xc4bb, 0xc4bb, 0xc4bb, 0xc4bd, 0xc4bb, 0xc4bb, 0xc4bb,
+	0xc4bb, 0xc4bb, 0xc4bb, 0xc4bb, 0xc4bb, 0xc4bb, 0xc4bb, 0xc4bb,
+	0xc4bb, 0xc4bb, 0xc4bb, 0x080c, 0x0dd5, 0x080c, 0x56e0, 0x01f8,
+	0x6014, 0x7144, 0x918c, 0x0fff, 0x9016, 0xd1c4, 0x0118, 0x7264,
+	0x9294, 0x00ff, 0x0096, 0x904d, 0x0188, 0xa87b, 0x0000, 0xa864,
+	0x9086, 0x0139, 0x0128, 0xa867, 0x0103, 0xa976, 0xaa96, 0x0030,
+	0xa897, 0x4000, 0xa99a, 0xaa9e, 0x080c, 0x6c86, 0x009e, 0x0804,
+	0xae71, 0x9182, 0x0085, 0x0002, 0xc4f3, 0xc4f1, 0xc4f1, 0xc4ff,
+	0xc4f1, 0xc4f1, 0xc4f1, 0xc4f1, 0xc4f1, 0xc4f1, 0xc4f1, 0xc4f1,
+	0xc4f1, 0x080c, 0x0dd5, 0x6003, 0x0001, 0x6106, 0x080c, 0x90d9,
+	0x0126, 0x2091, 0x8000, 0x080c, 0x9687, 0x012e, 0x0005, 0x0026,
+	0x0056, 0x00d6, 0x00e6, 0x2071, 0x0260, 0x7224, 0x6216, 0x7220,
+	0x080c, 0xcb38, 0x01a0, 0x2268, 0x6800, 0x9086, 0x0000, 0x0178,
+	0x6010, 0x6d10, 0x952e, 0x1158, 0x00c6, 0x2d60, 0x080c, 0xc76e,
+	0x00ce, 0x0128, 0x6803, 0x0002, 0x6007, 0x0086, 0x0010, 0x6007,
+	0x0087, 0x6003, 0x0001, 0x080c, 0x90d9, 0x080c, 0x9687, 0x9280,
+	0x0004, 0x00b6, 0x2058, 0xb800, 0x00be, 0xd0bc, 0x0140, 0x6824,
+	0xd0ec, 0x0128, 0x00c6, 0x2260, 0x080c, 0xce82, 0x00ce, 0x00ee,
+	0x00de, 0x005e, 0x002e, 0x0005, 0x9186, 0x0013, 0x1160, 0x6004,
+	0x908a, 0x0085, 0x0a0c, 0x0dd5, 0x908a, 0x0092, 0x1a0c, 0x0dd5,
+	0x9082, 0x0085, 0x00e2, 0x9186, 0x0027, 0x0120, 0x9186, 0x0014,
+	0x190c, 0x0dd5, 0x080c, 0x957b, 0x0096, 0x6014, 0x2048, 0x080c,
+	0xcb4a, 0x0140, 0xa867, 0x0103, 0xa877, 0x0000, 0xa87b, 0x0029,
+	0x080c, 0x6c86, 0x009e, 0x080c, 0xaea2, 0x0804, 0x9687, 0xc574,
+	0xc576, 0xc576, 0xc574, 0xc574, 0xc574, 0xc574, 0xc574, 0xc574,
+	0xc574, 0xc574, 0xc574, 0xc574, 0x080c, 0x0dd5, 0x080c, 0x957b,
+	0x080c, 0xaea2, 0x080c, 0x9687, 0x0005, 0x9186, 0x0013, 0x1128,
+	0x6004, 0x9082, 0x0085, 0x2008, 0x04b8, 0x9186, 0x0027, 0x11f8,
+	0x080c, 0x957b, 0x080c, 0x31c1, 0x080c, 0xd25f, 0x0096, 0x6014,
+	0x2048, 0x080c, 0xcb4a, 0x0150, 0xa867, 0x0103, 0xa877, 0x0000,
+	0xa87b, 0x0029, 0x080c, 0x6c86, 0x080c, 0xcd33, 0x009e, 0x080c,
+	0xae71, 0x080c, 0x9687, 0x0005, 0x080c, 0xaf07, 0x0ce0, 0x9186,
+	0x0014, 0x1dd0, 0x080c, 0x957b, 0x0096, 0x6014, 0x2048, 0x080c,
+	0xcb4a, 0x0d60, 0xa867, 0x0103, 0xa877, 0x0000, 0xa87b, 0x0006,
+	0xa880, 0xc0ec, 0xa882, 0x08f0, 0x0002, 0xc5cc, 0xc5ca, 0xc5ca,
+	0xc5ca, 0xc5ca, 0xc5ca, 0xc5e4, 0xc5ca, 0xc5ca, 0xc5ca, 0xc5ca,
+	0xc5ca, 0xc5ca, 0x080c, 0x0dd5, 0x080c, 0x957b, 0x6034, 0x908c,
+	0xff00, 0x810f, 0x9186, 0x0039, 0x0118, 0x9186, 0x0035, 0x1118,
+	0x2001, 0x1985, 0x0010, 0x2001, 0x1986, 0x2004, 0x601a, 0x6003,
+	0x000c, 0x080c, 0x9687, 0x0005, 0x080c, 0x957b, 0x6034, 0x908c,
+	0xff00, 0x810f, 0x9186, 0x0039, 0x0118, 0x9186, 0x0035, 0x1118,
+	0x2001, 0x1985, 0x0010, 0x2001, 0x1986, 0x2004, 0x601a, 0x6003,
+	0x000e, 0x080c, 0x9687, 0x0005, 0x9182, 0x0092, 0x1220, 0x9182,
+	0x0085, 0x0208, 0x0012, 0x0804, 0xaf07, 0xc612, 0xc612, 0xc612,
+	0xc612, 0xc614, 0xc661, 0xc612, 0xc612, 0xc612, 0xc612, 0xc612,
+	0xc612, 0xc612, 0x080c, 0x0dd5, 0x0096, 0x6010, 0x00b6, 0x2058,
+	0xb800, 0x00be, 0xd0bc, 0x0168, 0x6034, 0x908c, 0xff00, 0x810f,
+	0x9186, 0x0039, 0x0118, 0x9186, 0x0035, 0x1118, 0x009e, 0x0804,
+	0xc675, 0x080c, 0xcb4a, 0x1118, 0x080c, 0xcd33, 0x0068, 0x6014,
+	0x2048, 0xa87c, 0xd0e4, 0x1110, 0x080c, 0xcd33, 0xa867, 0x0103,
+	0x080c, 0xd22a, 0x080c, 0x6c86, 0x00d6, 0x2c68, 0x080c, 0xae1b,
+	0x01d0, 0x6003, 0x0001, 0x6007, 0x001e, 0x600b, 0xffff, 0x2009,
+	0x026e, 0x210c, 0x613a, 0x2009, 0x026f, 0x210c, 0x613e, 0x6910,
+	0x6112, 0x080c, 0xcfc4, 0x6954, 0x6156, 0x6023, 0x0001, 0x080c,
+	0x90d9, 0x080c, 0x9687, 0x2d60, 0x00de, 0x080c, 0xae71, 0x009e,
+	0x0005, 0x6010, 0x00b6, 0x2058, 0xb800, 0x00be, 0xd0bc, 0x05a0,
+	0x6034, 0x908c, 0xff00, 0x810f, 0x9186, 0x0035, 0x0130, 0x9186,
+	0x001e, 0x0118, 0x9186, 0x0039, 0x1538, 0x00d6, 0x2c68, 0x080c,
+	0xd1c2, 0x11f0, 0x080c, 0xae1b, 0x01d8, 0x6106, 0x6003, 0x0001,
+	0x6023, 0x0001, 0x6910, 0x6112, 0x692c, 0x612e, 0x6930, 0x6132,
+	0x6934, 0x918c, 0x00ff, 0x6136, 0x6938, 0x613a, 0x693c, 0x613e,
+	0x6954, 0x6156, 0x080c, 0xcfc4, 0x080c, 0x90d9, 0x080c, 0x9687,
+	0x2d60, 0x00de, 0x0804, 0xae71, 0x0096, 0x6014, 0x2048, 0x080c,
+	0xcb4a, 0x01c8, 0xa867, 0x0103, 0xa880, 0xd0b4, 0x0128, 0xc0ec,
+	0xa882, 0xa87b, 0x0006, 0x0048, 0xd0bc, 0x0118, 0xa87b, 0x0002,
+	0x0020, 0xa87b, 0x0005, 0x080c, 0xce44, 0xa877, 0x0000, 0x080c,
+	0x6c86, 0x080c, 0xcd33, 0x009e, 0x0804, 0xae71, 0x0016, 0x0096,
+	0x6014, 0x2048, 0x080c, 0xcb4a, 0x0140, 0xa867, 0x0103, 0xa87b,
+	0x0028, 0xa877, 0x0000, 0x080c, 0x6c86, 0x009e, 0x001e, 0x9186,
+	0x0013, 0x0148, 0x9186, 0x0014, 0x0130, 0x9186, 0x0027, 0x0118,
+	0x080c, 0xaf07, 0x0030, 0x080c, 0x957b, 0x080c, 0xaea2, 0x080c,
+	0x9687, 0x0005, 0x0056, 0x0066, 0x0096, 0x00a6, 0x2029, 0x0001,
+	0x9182, 0x0101, 0x1208, 0x0010, 0x2009, 0x0100, 0x2130, 0x8304,
+	0x9098, 0x0018, 0x2009, 0x0020, 0x2011, 0x0029, 0x080c, 0xc743,
+	0x96b2, 0x0020, 0xb004, 0x904d, 0x0110, 0x080c, 0x0fb1, 0x080c,
+	0x0fff, 0x0520, 0x8528, 0xa867, 0x0110, 0xa86b, 0x0000, 0x2920,
+	0xb406, 0x968a, 0x003d, 0x1228, 0x2608, 0x2011, 0x001b, 0x0499,
+	0x00a8, 0x96b2, 0x003c, 0x2009, 0x003c, 0x2950, 0x2011, 0x001b,
+	0x0451, 0x0c28, 0x2001, 0x0205, 0x2003, 0x0000, 0x00ae, 0x852f,
+	0x95ad, 0x0003, 0xb566, 0x95ac, 0x0000, 0x0048, 0x2001, 0x0205,
+	0x2003, 0x0000, 0x00ae, 0x852f, 0x95ad, 0x0003, 0xb566, 0x009e,
+	0x006e, 0x005e, 0x0005, 0x00a6, 0x89ff, 0x0158, 0xa804, 0x9055,
+	0x0130, 0xa807, 0x0000, 0x080c, 0x6c86, 0x2a48, 0x0cb8, 0x080c,
+	0x6c86, 0x00ae, 0x0005, 0x00f6, 0x2079, 0x0200, 0x7814, 0x9085,
+	0x0080, 0x7816, 0xd184, 0x0108, 0x8108, 0x810c, 0x20a9, 0x0001,
+	0xa860, 0x20e8, 0xa85c, 0x9200, 0x20a0, 0x20e1, 0x0000, 0x2300,
+	0x9e00, 0x2098, 0x4003, 0x8318, 0x9386, 0x0020, 0x1148, 0x2018,
+	0x2300, 0x9e00, 0x2098, 0x7814, 0x8000, 0x9085, 0x0080, 0x7816,
+	0x8109, 0x1d80, 0x7817, 0x0000, 0x00fe, 0x0005, 0x0066, 0x0126,
+	0x2091, 0x8000, 0x2031, 0x0001, 0x6020, 0x9084, 0x000f, 0x0083,
+	0x012e, 0x006e, 0x0005, 0x0126, 0x2091, 0x8000, 0x0066, 0x2031,
+	0x0000, 0x6020, 0x9084, 0x000f, 0x001b, 0x006e, 0x012e, 0x0005,
+	0xc7a9, 0xc7a9, 0xc7a4, 0xc7cb, 0xc797, 0xc7a4, 0xc7cb, 0xc7a4,
+	0xc797, 0x8ec2, 0xc7a4, 0xc7a4, 0xc7a4, 0xc797, 0xc797, 0x080c,
+	0x0dd5, 0x0036, 0x2019, 0x0010, 0x080c, 0xe155, 0x6023, 0x0006,
+	0x6003, 0x0007, 0x003e, 0x0005, 0x9006, 0x0005, 0x9085, 0x0001,
+	0x0005, 0x0096, 0x86ff, 0x11d8, 0x6014, 0x2048, 0x080c, 0xcb4a,
+	0x01c0, 0xa864, 0x9086, 0x0139, 0x1128, 0xa87b, 0x0005, 0xa883,
+	0x0000, 0x0028, 0x900e, 0x2001, 0x0005, 0x080c, 0x6eb9, 0x080c,
+	0xce44, 0x080c, 0x6c7a, 0x080c, 0xaea2, 0x9085, 0x0001, 0x009e,
+	0x0005, 0x9006, 0x0ce0, 0x6000, 0x908a, 0x0016, 0x1a0c, 0x0dd5,
+	0x0002, 0xc7e1, 0xc80f, 0xc7e3, 0xc830, 0xc80a, 0xc7e1, 0xc7a4,
+	0xc7a9, 0xc7a9, 0xc7a4, 0xc7a4, 0xc7a4, 0xc7a4, 0xc7a4, 0xc7a4,
+	0xc7a4, 0x080c, 0x0dd5, 0x86ff, 0x1510, 0x6020, 0x9086, 0x0006,
+	0x01f0, 0x0096, 0x6014, 0x2048, 0x080c, 0xcb4a, 0x0158, 0xa87c,
+	0xd0cc, 0x0130, 0x0096, 0xa878, 0x2048, 0x080c, 0x0fb1, 0x009e,
+	0x080c, 0xce44, 0x009e, 0x080c, 0xd204, 0x6007, 0x0085, 0x6003,
+	0x000b, 0x6023, 0x0002, 0x080c, 0x90d9, 0x080c, 0x9687, 0x9085,
+	0x0001, 0x0005, 0x0066, 0x080c, 0x1a60, 0x006e, 0x08a0, 0x00e6,
+	0x2071, 0x19e6, 0x7024, 0x9c06, 0x1120, 0x080c, 0xa541, 0x00ee,
+	0x0850, 0x6020, 0x9084, 0x000f, 0x9086, 0x0006, 0x1150, 0x0086,
+	0x0096, 0x2049, 0x0001, 0x2c40, 0x080c, 0xa69d, 0x009e, 0x008e,
+	0x0010, 0x080c, 0xa43e, 0x00ee, 0x1904, 0xc7e3, 0x0804, 0xc7a4,
+	0x0036, 0x00e6, 0x2071, 0x19e6, 0x703c, 0x9c06, 0x1138, 0x901e,
+	0x080c, 0xa5b7, 0x00ee, 0x003e, 0x0804, 0xc7e3, 0x080c, 0xa7cd,
+	0x00ee, 0x003e, 0x1904, 0xc7e3, 0x0804, 0xc7a4, 0x00c6, 0x6020,
+	0x9084, 0x000f, 0x0013, 0x00ce, 0x0005, 0xc863, 0xc92e, 0xca95,
+	0xc86d, 0xaea2, 0xc863, 0xe147, 0xd26c, 0xc92e, 0x8e94, 0xcb14,
+	0xc85c, 0xc85c, 0xc85c, 0xc85c, 0x080c, 0x0dd5, 0x080c, 0xcd50,
+	0x1110, 0x080c, 0xb824, 0x0005, 0x080c, 0x957b, 0x080c, 0x9687,
+	0x0804, 0xae71, 0x601b, 0x0001, 0x0005, 0x080c, 0xcb4a, 0x0130,
+	0x6014, 0x0096, 0x2048, 0x2c00, 0xa896, 0x009e, 0x6000, 0x908a,
+	0x0016, 0x1a0c, 0x0dd5, 0x0002, 0xc88c, 0xc88e, 0xc8b2, 0xc8c6,
+	0xc8ec, 0xc88c, 0xc863, 0xc863, 0xc863, 0xc8c6, 0xc8c6, 0xc88c,
+	0xc88c, 0xc88c, 0xc88c, 0xc8d0, 0x080c, 0x0dd5, 0x00e6, 0x6014,
+	0x0096, 0x2048, 0xa880, 0xc0b5, 0xa882, 0x009e, 0x2071, 0x19e6,
+	0x7024, 0x9c06, 0x01a0, 0x080c, 0xa43e, 0x080c, 0xd204, 0x6007,
+	0x0085, 0x6003, 0x000b, 0x6023, 0x0002, 0x2001, 0x1986, 0x2004,
+	0x601a, 0x080c, 0x90d9, 0x080c, 0x9687, 0x00ee, 0x0005, 0x601b,
+	0x0001, 0x0cd8, 0x0096, 0x6014, 0x2048, 0xa880, 0xc0b5, 0xa882,
+	0x009e, 0x080c, 0xd204, 0x6007, 0x0085, 0x6003, 0x000b, 0x6023,
+	0x0002, 0x080c, 0x90d9, 0x080c, 0x9687, 0x0005, 0x0096, 0x601b,
+	0x0001, 0x6014, 0x2048, 0xa880, 0xc0b5, 0xa882, 0x009e, 0x0005,
+	0x080c, 0x56e0, 0x01b8, 0x6014, 0x0096, 0x904d, 0x0190, 0xa864,
+	0xa867, 0x0103, 0xa87b, 0x0006, 0x9086, 0x0139, 0x1150, 0xa867,
+	0x0139, 0xa87b, 0x0030, 0xa897, 0x4005, 0xa89b, 0x0004, 0x080c,
+	0x6c86, 0x009e, 0x0804, 0xae71, 0x6014, 0x0096, 0x904d, 0x05c8,
+	0xa97c, 0xd1e4, 0x05b0, 0x2001, 0x180f, 0x2004, 0xd0c4, 0x0110,
+	0x009e, 0x0005, 0xa884, 0x009e, 0x8003, 0x800b, 0x810b, 0x9108,
+	0x611a, 0x2001, 0x0030, 0x2c08, 0x080c, 0x15f0, 0x2001, 0x030c,
+	0x2004, 0x9086, 0x0041, 0x11a0, 0x6014, 0x0096, 0x904d, 0x090c,
+	0x0dd5, 0xa880, 0xd0f4, 0x1130, 0xc0f5, 0xa882, 0x009e, 0x601b,
+	0x0002, 0x0070, 0x009e, 0x2001, 0x0037, 0x2c08, 0x080c, 0x15f0,
+	0x6000, 0x9086, 0x0004, 0x1120, 0x2009, 0x0048, 0x080c, 0xaeec,
+	0x0005, 0x009e, 0x080c, 0x1a60, 0x0804, 0xc8b2, 0x6000, 0x908a,
+	0x0016, 0x1a0c, 0x0dd5, 0x000b, 0x0005, 0xc945, 0xc86a, 0xc947,
+	0xc945, 0xc947, 0xc947, 0xc864, 0xc945, 0xc85e, 0xc85e, 0xc945,
+	0xc945, 0xc945, 0xc945, 0xc945, 0xc945, 0x080c, 0x0dd5, 0x6010,
+	0x00b6, 0x2058, 0xb804, 0x9084, 0x00ff, 0x00be, 0x908a, 0x000c,
+	0x1a0c, 0x0dd5, 0x00b6, 0x0013, 0x00be, 0x0005, 0xc962, 0xca2f,
+	0xc964, 0xc9a4, 0xc964, 0xc9a4, 0xc964, 0xc972, 0xc962, 0xc9a4,
+	0xc962, 0xc993, 0x080c, 0x0dd5, 0x6004, 0x908e, 0x0016, 0x05c0,
+	0x908e, 0x0004, 0x05a8, 0x908e, 0x0002, 0x0590, 0x908e, 0x0052,
+	0x0904, 0xca2b, 0x6004, 0x080c, 0xcd50, 0x0904, 0xca48, 0x908e,
+	0x0004, 0x1110, 0x080c, 0x31ea, 0x908e, 0x0021, 0x0904, 0xca4c,
+	0x908e, 0x0022, 0x0904, 0xca90, 0x908e, 0x003d, 0x0904, 0xca4c,
+	0x908e, 0x0039, 0x0904, 0xca50, 0x908e, 0x0035, 0x0904, 0xca50,
+	0x908e, 0x001e, 0x0178, 0x908e, 0x0001, 0x1140, 0x6010, 0x2058,
+	0xb804, 0x9084, 0x00ff, 0x9086, 0x0006, 0x0110, 0x080c, 0x31c1,
+	0x080c, 0xb824, 0x0804, 0xaea2, 0x00c6, 0x00d6, 0x6104, 0x9186,
+	0x0016, 0x0904, 0xca1c, 0x9186, 0x0002, 0x1904, 0xc9f1, 0x2001,
+	0x1837, 0x2004, 0xd08c, 0x11c8, 0x080c, 0x73a5, 0x11b0, 0x080c,
+	0xd24a, 0x0138, 0x080c, 0x73c8, 0x1120, 0x080c, 0x72b5, 0x0804,
+	0xca79, 0x2001, 0x197c, 0x2003, 0x0001, 0x2001, 0x1800, 0x2003,
+	0x0001, 0x080c, 0x72d7, 0x0804, 0xca79, 0x6010, 0x2058, 0x2001,
+	0x1837, 0x2004, 0xd0ac, 0x1904, 0xca79, 0xb8a0, 0x9084, 0xff80,
+	0x1904, 0xca79, 0xb840, 0x9084, 0x00ff, 0x9005, 0x0190, 0x8001,
+	0xb842, 0x6017, 0x0000, 0x6023, 0x0007, 0x601b, 0x0398, 0x6043,
+	0x0000, 0x080c, 0xae1b, 0x0128, 0x2b00, 0x6012, 0x6023, 0x0001,
+	0x0458, 0x00de, 0x00ce, 0x6004, 0x908e, 0x0002, 0x11a0, 0x6010,
+	0x2058, 0xb8a0, 0x9086, 0x007e, 0x1170, 0x2009, 0x1837, 0x2104,
+	0xc085, 0x200a, 0x00e6, 0x2071, 0x1800, 0x080c, 0x5fb6, 0x00ee,
+	0x080c, 0xb824, 0x0030, 0x080c, 0xb824, 0x080c, 0x31c1, 0x080c,
+	0xd25f, 0x00e6, 0x0126, 0x2091, 0x8000, 0x080c, 0x31ea, 0x012e,
+	0x00ee, 0x080c, 0xaea2, 0x0005, 0x2001, 0x0002, 0x080c, 0x6558,
+	0x6003, 0x0001, 0x6007, 0x0002, 0x080c, 0x9121, 0x080c, 0x9687,
+	0x00de, 0x00ce, 0x0c80, 0x080c, 0x31ea, 0x0804, 0xc9a0, 0x00c6,
+	0x00d6, 0x6104, 0x9186, 0x0016, 0x0d38, 0x6010, 0x2058, 0xb840,
+	0x9084, 0x00ff, 0x9005, 0x0904, 0xc9f1, 0x8001, 0xb842, 0x6003,
+	0x0001, 0x080c, 0x9121, 0x080c, 0x9687, 0x00de, 0x00ce, 0x0898,
+	0x080c, 0xb824, 0x0804, 0xc9a2, 0x080c, 0xb860, 0x0804, 0xc9a2,
+	0x00d6, 0x2c68, 0x6104, 0x080c, 0xd1c2, 0x00de, 0x0118, 0x080c,
+	0xae71, 0x00f0, 0x6004, 0x8007, 0x6134, 0x918c, 0x00ff, 0x9105,
+	0x6036, 0x6007, 0x0085, 0x6003, 0x000b, 0x6023, 0x0002, 0x603c,
+	0x600a, 0x2001, 0x1986, 0x2004, 0x601a, 0x602c, 0x2c08, 0x2060,
+	0x6024, 0xc0b5, 0x6026, 0x2160, 0x080c, 0x90d9, 0x080c, 0x9687,
+	0x0005, 0x00de, 0x00ce, 0x080c, 0xb824, 0x080c, 0x31c1, 0x00e6,
+	0x0126, 0x2091, 0x8000, 0x080c, 0x31ea, 0x6017, 0x0000, 0x6023,
+	0x0007, 0x601b, 0x0398, 0x6043, 0x0000, 0x012e, 0x00ee, 0x0005,
+	0x080c, 0xb2a2, 0x1904, 0xca48, 0x0005, 0x6000, 0x908a, 0x0016,
+	0x1a0c, 0x0dd5, 0x0096, 0x00d6, 0x001b, 0x00de, 0x009e, 0x0005,
+	0xcab0, 0xcab0, 0xcab0, 0xcab0, 0xcab0, 0xcab0, 0xcab0, 0xcab0,
+	0xcab0, 0xc863, 0xcab0, 0xc86a, 0xcab2, 0xc86a, 0xcabf, 0xcab0,
+	0x080c, 0x0dd5, 0x6004, 0x9086, 0x008b, 0x0148, 0x6007, 0x008b,
+	0x6003, 0x000d, 0x080c, 0x90d9, 0x080c, 0x9687, 0x0005, 0x080c,
+	0xd23e, 0x0118, 0x080c, 0xd251, 0x0010, 0x080c, 0xd25f, 0x080c,
+	0xcd33, 0x080c, 0xcb4a, 0x0570, 0x080c, 0x31c1, 0x080c, 0xcb4a,
+	0x0168, 0x6014, 0x2048, 0xa867, 0x0103, 0xa87b, 0x0006, 0xa877,
+	0x0000, 0xa880, 0xc0ed, 0xa882, 0x080c, 0x6c86, 0x2c68, 0x080c,
+	0xae1b, 0x0150, 0x6810, 0x6012, 0x080c, 0xcfc4, 0x00c6, 0x2d60,
+	0x080c, 0xaea2, 0x00ce, 0x0008, 0x2d60, 0x6017, 0x0000, 0x6023,
+	0x0001, 0x6007, 0x0001, 0x6003, 0x0001, 0x080c, 0x9121, 0x080c,
+	0x9687, 0x00c8, 0x080c, 0xd23e, 0x0138, 0x6034, 0x9086, 0x4000,
+	0x1118, 0x080c, 0x31c1, 0x08d0, 0x6034, 0x908c, 0xff00, 0x810f,
+	0x9186, 0x0039, 0x0118, 0x9186, 0x0035, 0x1118, 0x080c, 0x31c1,
+	0x0868, 0x080c, 0xaea2, 0x0005, 0x6000, 0x908a, 0x0016, 0x1a0c,
+	0x0dd5, 0x0002, 0xcb2a, 0xcb2a, 0xcb2c, 0xcb2c, 0xcb2c, 0xcb2a,
+	0xcb2a, 0xaea2, 0xcb2a, 0xcb2a, 0xcb2a, 0xcb2a, 0xcb2a, 0xcb2a,
+	0xcb2a, 0xcb2a, 0x080c, 0x0dd5, 0x080c, 0xa7cd, 0x6114, 0x0096,
+	0x2148, 0xa87b, 0x0006, 0x080c, 0x6c86, 0x009e, 0x0804, 0xae71,
+	0x9284, 0x0007, 0x1158, 0x9282, 0x1cd0, 0x0240, 0x2001, 0x181a,
+	0x2004, 0x9202, 0x1218, 0x9085, 0x0001, 0x0005, 0x9006, 0x0ce8,
+	0x0096, 0x0028, 0x0096, 0x0006, 0x6014, 0x2048, 0x000e, 0x0006,
+	0x9984, 0xf000, 0x9086, 0xf000, 0x0110, 0x080c, 0x10aa, 0x000e,
+	0x009e, 0x0005, 0x00e6, 0x00c6, 0x0036, 0x0006, 0x0126, 0x2091,
+	0x8000, 0x2061, 0x1cd0, 0x2071, 0x1800, 0x7354, 0x7074, 0x9302,
+	0x1640, 0x6020, 0x9206, 0x11f8, 0x080c, 0xd24a, 0x0180, 0x9286,
+	0x0001, 0x1168, 0x6004, 0x9086, 0x0004, 0x1148, 0x080c, 0x31c1,
+	0x080c, 0xd25f, 0x00c6, 0x080c, 0xaea2, 0x00ce, 0x0060, 0x080c,
+	0xcf3e, 0x0148, 0x080c, 0xcd50, 0x1110, 0x080c, 0xb824, 0x00c6,
+	0x080c, 0xae71, 0x00ce, 0x9ce0, 0x0018, 0x7068, 0x9c02, 0x1208,
+	0x08a0, 0x012e, 0x000e, 0x003e, 0x00ce, 0x00ee, 0x0005, 0x00e6,
+	0x00c6, 0x0016, 0x9188, 0x1000, 0x210c, 0x81ff, 0x0128, 0x2061,
+	0x1aaf, 0x6112, 0x080c, 0x31c1, 0x9006, 0x0010, 0x9085, 0x0001,
+	0x001e, 0x00ce, 0x00ee, 0x0005, 0x00c6, 0x0126, 0x2091, 0x8000,
+	0x080c, 0xae1b, 0x01b0, 0x6656, 0x2b00, 0x6012, 0x080c, 0x56e0,
+	0x0118, 0x080c, 0xcc77, 0x0168, 0x080c, 0xcfc4, 0x6023, 0x0003,
+	0x2009, 0x004b, 0x080c, 0xaeec, 0x9085, 0x0001, 0x012e, 0x00ce,
+	0x0005, 0x9006, 0x0cd8, 0x00c6, 0x0126, 0x2091, 0x8000, 0xbaa0,
+	0x080c, 0xaebf, 0x0560, 0x6057, 0x0000, 0x2b00, 0x6012, 0x080c,
+	0xcfc4, 0x6023, 0x0003, 0x0016, 0x080c, 0x927e, 0x0076, 0x903e,
+	0x080c, 0x9151, 0x2c08, 0x080c, 0xe30c, 0x007e, 0x001e, 0xd184,
+	0x0128, 0x080c, 0xae71, 0x9085, 0x0001, 0x0070, 0x080c, 0x56e0,
+	0x0128, 0xd18c, 0x1170, 0x080c, 0xcc77, 0x0148, 0x2009, 0x004c,
+	0x080c, 0xaeec, 0x9085, 0x0001, 0x012e, 0x00ce, 0x0005, 0x9006,
+	0x0cd8, 0x2900, 0x6016, 0x0c90, 0x2009, 0x004d, 0x0010, 0x2009,
+	0x004e, 0x00f6, 0x00c6, 0x0046, 0x0016, 0x080c, 0xae1b, 0x2c78,
+	0x0590, 0x7e56, 0x2b00, 0x7812, 0x7823, 0x0003, 0x2021, 0x0005,
+	0x080c, 0xcc89, 0x9186, 0x004d, 0x0118, 0x9186, 0x004e, 0x0148,
+	0x2001, 0x197f, 0x200c, 0xd1fc, 0x0168, 0x2f60, 0x080c, 0xae71,
+	0x00d0, 0x2001, 0x197e, 0x200c, 0xd1fc, 0x0120, 0x2f60, 0x080c,
+	0xae71, 0x0088, 0x2f60, 0x080c, 0x56e0, 0x0138, 0xd18c, 0x1118,
+	0x04f1, 0x0148, 0x0010, 0x2900, 0x7816, 0x001e, 0x0016, 0x080c,
+	0xaeec, 0x9085, 0x0001, 0x001e, 0x004e, 0x00ce, 0x00fe, 0x0005,
+	0x00f6, 0x00c6, 0x0046, 0x080c, 0xae1b, 0x2c78, 0x0508, 0x7e56,
+	0x2b00, 0x7812, 0x7823, 0x0003, 0x0096, 0x2021, 0x0004, 0x0489,
+	0x009e, 0x2001, 0x197d, 0x200c, 0xd1fc, 0x0120, 0x2f60, 0x080c,
+	0xae71, 0x0060, 0x2f60, 0x080c, 0x56e0, 0x0120, 0xd18c, 0x1160,
+	0x0071, 0x0130, 0x2009, 0x0052, 0x080c, 0xaeec, 0x9085, 0x0001,
+	0x004e, 0x00ce, 0x00fe, 0x0005, 0x2900, 0x7816, 0x0c98, 0x00c6,
+	0x080c, 0x4ab4, 0x00ce, 0x1120, 0x080c, 0xae71, 0x9006, 0x0005,
+	0xa867, 0x0000, 0xa86b, 0x8000, 0x2900, 0x6016, 0x9085, 0x0001,
+	0x0005, 0x0096, 0x0076, 0x0126, 0x2091, 0x8000, 0x080c, 0x673c,
+	0x0158, 0x2001, 0xcc8e, 0x0006, 0x900e, 0x2400, 0x080c, 0x6eb9,
+	0x080c, 0x6c86, 0x000e, 0x0807, 0x2418, 0x080c, 0x9515, 0xbaa0,
+	0x0086, 0x2041, 0x0001, 0x2039, 0x0001, 0x2608, 0x080c, 0x9296,
+	0x008e, 0x080c, 0x9151, 0x2f08, 0x2648, 0x080c, 0xe30c, 0xb93c,
+	0x81ff, 0x090c, 0x9367, 0x080c, 0x9687, 0x012e, 0x007e, 0x009e,
+	0x0005, 0x00c6, 0x0126, 0x2091, 0x8000, 0x080c, 0xae1b, 0x0190,
+	0x660a, 0x2b08, 0x6112, 0x080c, 0xcfc4, 0x6023, 0x0001, 0x2900,
+	0x6016, 0x2009, 0x001f, 0x080c, 0xaeec, 0x9085, 0x0001, 0x012e,
+	0x00ce, 0x0005, 0x9006, 0x0cd8, 0x00c6, 0x0126, 0x2091, 0x8000,
+	0x080c, 0xaebf, 0x01b8, 0x660a, 0x2b08, 0x6112, 0x080c, 0xcfc4,
+	0x6023, 0x0008, 0x2900, 0x6016, 0x00f6, 0x2c78, 0x080c, 0x1727,
+	0x00fe, 0x2009, 0x0021, 0x080c, 0xaeec, 0x9085, 0x0001, 0x012e,
+	0x00ce, 0x0005, 0x9006, 0x0cd8, 0x2009, 0x003d, 0x00c6, 0x0126,
+	0x0016, 0x2091, 0x8000, 0x080c, 0xae1b, 0x0198, 0x660a, 0x2b08,
+	0x6112, 0x080c, 0xcfc4, 0x6023, 0x0001, 0x2900, 0x6016, 0x001e,
+	0x0016, 0x080c, 0xaeec, 0x9085, 0x0001, 0x001e, 0x012e, 0x00ce,
+	0x0005, 0x9006, 0x0cd0, 0x00c6, 0x0126, 0x2091, 0x8000, 0x080c,
+	0xaebf, 0x0188, 0x2b08, 0x6112, 0x080c, 0xcfc4, 0x6023, 0x0001,
+	0x2900, 0x6016, 0x2009, 0x0000, 0x080c, 0xaeec, 0x9085, 0x0001,
+	0x012e, 0x00ce, 0x0005, 0x9006, 0x0cd8, 0x2009, 0x0044, 0x0830,
+	0x2009, 0x0049, 0x0818, 0x0026, 0x00b6, 0x6210, 0x2258, 0xba3c,
+	0x82ff, 0x0110, 0x8211, 0xba3e, 0x00be, 0x002e, 0x0005, 0x0006,
+	0x0016, 0x6004, 0x908e, 0x0002, 0x0140, 0x908e, 0x0003, 0x0128,
+	0x908e, 0x0004, 0x0110, 0x9085, 0x0001, 0x001e, 0x000e, 0x0005,
+	0x0006, 0x0086, 0x0096, 0x6020, 0x9086, 0x0004, 0x01a8, 0x6014,
+	0x904d, 0x080c, 0xcb4a, 0x0180, 0xa864, 0x9086, 0x0139, 0x0170,
+	0x6020, 0x90c6, 0x0003, 0x0140, 0x90c6, 0x0002, 0x0128, 0xa868,
+	0xd0fc, 0x0110, 0x9006, 0x0010, 0x9085, 0x0001, 0x009e, 0x008e,
+	0x000e, 0x0005, 0x00c6, 0x0126, 0x2091, 0x8000, 0x080c, 0xaebf,
+	0x0198, 0x2b08, 0x6112, 0x080c, 0xcfc4, 0x6023, 0x0001, 0x2900,
+	0x6016, 0x080c, 0x31c1, 0x2009, 0x0028, 0x080c, 0xaeec, 0x9085,
+	0x0001, 0x012e, 0x00ce, 0x0005, 0x9006, 0x0cd8, 0x9186, 0x0015,
+	0x11a8, 0x2011, 0x1824, 0x2204, 0x9086, 0x0074, 0x1178, 0x00b6,
+	0x080c, 0xba78, 0x00be, 0x080c, 0xbc9b, 0x6003, 0x0001, 0x6007,
+	0x0029, 0x080c, 0x9121, 0x080c, 0x9687, 0x0078, 0x6014, 0x0096,
+	0x2048, 0xa868, 0x009e, 0xd0fc, 0x0148, 0x2001, 0x0001, 0x080c,
+	0xd183, 0x080c, 0xb824, 0x080c, 0xae71, 0x0005, 0x0096, 0x6014,
+	0x904d, 0x090c, 0x0dd5, 0xa87b, 0x0030, 0xa883, 0x0000, 0xa897,
+	0x4005, 0xa89b, 0x0004, 0xa867, 0x0139, 0x0126, 0x2091, 0x8000,
+	0x080c, 0x6c86, 0x012e, 0x009e, 0x080c, 0xae71, 0x0c30, 0x0096,
+	0x9186, 0x0016, 0x1128, 0x2001, 0x0004, 0x080c, 0x6558, 0x00e8,
+	0x9186, 0x0015, 0x1510, 0x2011, 0x1824, 0x2204, 0x9086, 0x0014,
+	0x11e0, 0x6010, 0x00b6, 0x2058, 0x080c, 0x66a3, 0x00be, 0x080c,
+	0xbd6c, 0x1198, 0x6010, 0x00b6, 0x2058, 0xb890, 0x00be, 0x9005,
+	0x0160, 0x2001, 0x0006, 0x080c, 0x6558, 0x6014, 0x2048, 0xa868,
+	0xd0fc, 0x0170, 0x080c, 0xb276, 0x0048, 0x6014, 0x2048, 0xa868,
+	0xd0fc, 0x0528, 0x080c, 0xb824, 0x080c, 0xae71, 0x009e, 0x0005,
+	0x6014, 0x6310, 0x2358, 0x904d, 0x090c, 0x0dd5, 0xa87b, 0x0000,
+	0xa883, 0x0000, 0xa897, 0x4000, 0x900e, 0x080c, 0x6828, 0x1108,
+	0xc185, 0xb800, 0xd0bc, 0x0108, 0xc18d, 0xa99a, 0x0126, 0x2091,
+	0x8000, 0x080c, 0x6c86, 0x012e, 0x080c, 0xae71, 0x08f8, 0x6014,
+	0x904d, 0x090c, 0x0dd5, 0xa87b, 0x0030, 0xa883, 0x0000, 0xa897,
+	0x4005, 0xa89b, 0x0004, 0xa867, 0x0139, 0x0126, 0x2091, 0x8000,
+	0x080c, 0x6c86, 0x012e, 0x080c, 0xae71, 0x0840, 0xa878, 0x9086,
+	0x0005, 0x1108, 0x0009, 0x0005, 0xa880, 0xc0ad, 0xa882, 0x0005,
+	0x6043, 0x0000, 0x6017, 0x0000, 0x6003, 0x0001, 0x6007, 0x0050,
+	0x080c, 0x90d9, 0x080c, 0x9687, 0x0005, 0x00c6, 0x6010, 0x00b6,
+	0x2058, 0xb800, 0x00be, 0xd0bc, 0x0120, 0x6020, 0x9084, 0x000f,
+	0x0013, 0x00ce, 0x0005, 0xc863, 0xce74, 0xce74, 0xce77, 0xe61e,
+	0xe639, 0xe63c, 0xc863, 0xc863, 0xc863, 0xc863, 0xc863, 0xc863,
+	0xc863, 0xc863, 0x080c, 0x0dd5, 0xa001, 0xa001, 0x0005, 0x0096,
+	0x6014, 0x904d, 0x0118, 0xa87c, 0xd0e4, 0x1110, 0x009e, 0x0010,
+	0x009e, 0x0005, 0x6010, 0x00b6, 0x2058, 0xb800, 0x00be, 0xd0bc,
+	0x0550, 0x2001, 0x1834, 0x2004, 0x9005, 0x1540, 0x00f6, 0x2c78,
+	0x080c, 0xae1b, 0x0508, 0x7810, 0x6012, 0x080c, 0xcfc4, 0x7820,
+	0x9086, 0x0003, 0x0128, 0x7808, 0x603a, 0x2f00, 0x603e, 0x0020,
+	0x7808, 0x603e, 0x2f00, 0x603a, 0x602e, 0x6023, 0x0001, 0x6007,
+	0x0035, 0x6003, 0x0001, 0x7954, 0x6156, 0x080c, 0x90d9, 0x080c,
+	0x9687, 0x2f60, 0x00fe, 0x0005, 0x2f60, 0x00fe, 0x2001, 0x1987,
+	0x2004, 0x6042, 0x0005, 0x0016, 0x0096, 0x6814, 0x2048, 0xa87c,
+	0xd0e4, 0x0180, 0xc0e4, 0xa87e, 0xa877, 0x0000, 0xa893, 0x0000,
+	0xa88f, 0x0000, 0xd0cc, 0x0130, 0xc0cc, 0xa87e, 0xa878, 0x2048,
+	0x080c, 0x0fb1, 0x6830, 0x6036, 0x908e, 0x0001, 0x0148, 0x6803,
+	0x0002, 0x9086, 0x0005, 0x0170, 0x9006, 0x602e, 0x6032, 0x00d0,
+	0x681c, 0xc085, 0x681e, 0x6803, 0x0004, 0x6824, 0xc0f4, 0x9085,
+	0x0c00, 0x6826, 0x6814, 0x2048, 0xa8ac, 0x6938, 0x9102, 0xa8b0,
+	0x693c, 0x9103, 0x1e48, 0x683c, 0x602e, 0x6838, 0x9084, 0xfffc,
+	0x683a, 0x6032, 0x2d00, 0x603a, 0x6808, 0x603e, 0x6910, 0x6112,
+	0x6954, 0x6156, 0x6023, 0x0001, 0x6007, 0x0039, 0x6003, 0x0001,
+	0x080c, 0x90d9, 0x080c, 0x9687, 0x009e, 0x001e, 0x0005, 0x6024,
+	0xd0d4, 0x0510, 0xd0f4, 0x11f8, 0x6038, 0x940a, 0x603c, 0x9303,
+	0x0230, 0x9105, 0x0120, 0x6024, 0xc0d4, 0xc0f5, 0x0098, 0x643a,
+	0x633e, 0xac3e, 0xab42, 0x0046, 0x0036, 0x2400, 0xacac, 0x9402,
+	0xa836, 0x2300, 0xabb0, 0x9303, 0xa83a, 0x003e, 0x004e, 0x6024,
+	0xc0d4, 0x0000, 0x6026, 0x0005, 0xd0f4, 0x1138, 0xa83c, 0x603a,
+	0xa840, 0x603e, 0x6024, 0xc0f5, 0x6026, 0x0005, 0x0006, 0x0016,
+	0x6004, 0x908e, 0x0034, 0x01b8, 0x908e, 0x0035, 0x01a0, 0x908e,
+	0x0036, 0x0188, 0x908e, 0x0037, 0x0170, 0x908e, 0x0038, 0x0158,
+	0x908e, 0x0039, 0x0140, 0x908e, 0x003a, 0x0128, 0x908e, 0x003b,
+	0x0110, 0x9085, 0x0001, 0x001e, 0x000e, 0x0005, 0x0006, 0x0016,
+	0x0026, 0x0036, 0x00e6, 0x2001, 0x1981, 0x200c, 0x8000, 0x2014,
+	0x2001, 0x0032, 0x080c, 0x8f51, 0x2001, 0x1985, 0x82ff, 0x1110,
+	0x2011, 0x0014, 0x2202, 0x2001, 0x1983, 0x200c, 0x8000, 0x2014,
+	0x2071, 0x196b, 0x711a, 0x721e, 0x2001, 0x0064, 0x080c, 0x8f51,
+	0x2001, 0x1986, 0x82ff, 0x1110, 0x2011, 0x0014, 0x2202, 0x2001,
+	0x1987, 0x9288, 0x000a, 0x2102, 0x2001, 0x1a90, 0x2102, 0x2001,
+	0x0032, 0x080c, 0x15f0, 0x080c, 0x695c, 0x00ee, 0x003e, 0x002e,
+	0x001e, 0x000e, 0x0005, 0x0006, 0x0016, 0x00e6, 0x2001, 0x1985,
+	0x2003, 0x0028, 0x2001, 0x1986, 0x2003, 0x0014, 0x2071, 0x196b,
+	0x701b, 0x0000, 0x701f, 0x07d0, 0x2001, 0x1987, 0x2009, 0x001e,
+	0x2102, 0x2001, 0x1a90, 0x2102, 0x2001, 0x0032, 0x080c, 0x15f0,
+	0x00ee, 0x001e, 0x000e, 0x0005, 0x0096, 0x6058, 0x904d, 0x0110,
+	0x080c, 0x1031, 0x009e, 0x0005, 0x0005, 0x00c6, 0x0126, 0x2091,
+	0x8000, 0x080c, 0xae1b, 0x0180, 0x2b08, 0x6112, 0x0ca9, 0x6023,
+	0x0001, 0x2900, 0x6016, 0x2009, 0x0033, 0x080c, 0xaeec, 0x9085,
+	0x0001, 0x012e, 0x00ce, 0x0005, 0x9006, 0x0cd8, 0x0096, 0x00e6,
+	0x00f6, 0x2071, 0x1800, 0x9186, 0x0015, 0x1500, 0x7090, 0x9086,
+	0x0018, 0x11e0, 0x6014, 0x2048, 0xaa3c, 0xd2e4, 0x1160, 0x2c78,
+	0x080c, 0x9921, 0x01d8, 0x707c, 0xaa50, 0x9206, 0x1160, 0x7080,
+	0xaa54, 0x9206, 0x1140, 0x6210, 0x00b6, 0x2258, 0xbaa0, 0x00be,
+	0x900e, 0x080c, 0x320a, 0x080c, 0xb276, 0x0020, 0x080c, 0xb824,
+	0x080c, 0xae71, 0x00fe, 0x00ee, 0x009e, 0x0005, 0x7060, 0xaa54,
+	0x9206, 0x0d48, 0x0c80, 0x00c6, 0x0126, 0x2091, 0x8000, 0x080c,
+	0xae1b, 0x0188, 0x2b08, 0x6112, 0x080c, 0xcfc4, 0x6023, 0x0001,
+	0x2900, 0x6016, 0x2009, 0x004d, 0x080c, 0xaeec, 0x9085, 0x0001,
+	0x012e, 0x00ce, 0x0005, 0x9006, 0x0cd8, 0x00c6, 0x0126, 0x2091,
+	0x8000, 0x0016, 0x080c, 0xae1b, 0x0180, 0x2b08, 0x6112, 0x080c,
+	0xcfc4, 0x6023, 0x0001, 0x2900, 0x6016, 0x001e, 0x080c, 0xaeec,
+	0x9085, 0x0001, 0x012e, 0x00ce, 0x0005, 0x001e, 0x9006, 0x0cd0,
+	0x0016, 0x0026, 0x0036, 0x0046, 0x0056, 0x0066, 0x0096, 0x00e6,
+	0x00f6, 0x2071, 0x1800, 0x9186, 0x0015, 0x1568, 0x7190, 0x6014,
+	0x2048, 0xa814, 0x8003, 0x9106, 0x1530, 0x20e1, 0x0000, 0x2001,
+	0x199f, 0x2003, 0x0000, 0x6014, 0x2048, 0xa830, 0x20a8, 0x8906,
+	0x8006, 0x8007, 0x9094, 0x003f, 0x22e8, 0x9084, 0xffc0, 0x9080,
+	0x001b, 0x20a0, 0x2001, 0x199f, 0x0016, 0x200c, 0x080c, 0xd83a,
+	0x001e, 0xa804, 0x9005, 0x0110, 0x2048, 0x0c38, 0x6014, 0x2048,
+	0xa867, 0x0103, 0x0010, 0x080c, 0xb824, 0x080c, 0xae71, 0x00fe,
+	0x00ee, 0x009e, 0x006e, 0x005e, 0x004e, 0x003e, 0x002e, 0x001e,
+	0x0005, 0x0096, 0x00e6, 0x00f6, 0x2071, 0x1800, 0x9186, 0x0015,
+	0x11b8, 0x7090, 0x9086, 0x0004, 0x1198, 0x6014, 0x2048, 0x2c78,
+	0x080c, 0x9921, 0x01a8, 0x707c, 0xaa74, 0x9206, 0x1130, 0x7080,
+	0xaa78, 0x9206, 0x1110, 0x080c, 0x31c1, 0x080c, 0xb276, 0x0020,
+	0x080c, 0xb824, 0x080c, 0xae71, 0x00fe, 0x00ee, 0x009e, 0x0005,
+	0x7060, 0xaa78, 0x9206, 0x0d78, 0x0c80, 0x0096, 0x00e6, 0x00f6,
+	0x2071, 0x1800, 0x9186, 0x0015, 0x1550, 0x7090, 0x9086, 0x0004,
+	0x1530, 0x6014, 0x2048, 0x2c78, 0x080c, 0x9921, 0x05f0, 0x707c,
+	0xaacc, 0x9206, 0x1180, 0x7080, 0xaad0, 0x9206, 0x1160, 0x080c,
+	0x31c1, 0x0016, 0xa998, 0xaab0, 0x9284, 0x1000, 0xc0fd, 0x080c,
+	0x5690, 0x001e, 0x0010, 0x080c, 0x5481, 0x080c, 0xcb4a, 0x0508,
+	0xa87b, 0x0000, 0xa883, 0x0000, 0xa897, 0x4000, 0x0080, 0x080c,
+	0xcb4a, 0x01b8, 0x6014, 0x2048, 0x080c, 0x5481, 0x1d70, 0xa87b,
+	0x0030, 0xa883, 0x0000, 0xa897, 0x4005, 0xa89b, 0x0004, 0x0126,
+	0x2091, 0x8000, 0xa867, 0x0139, 0x080c, 0x6c86, 0x012e, 0x080c,
+	0xae71, 0x00fe, 0x00ee, 0x009e, 0x0005, 0x7060, 0xaad0, 0x9206,
+	0x0930, 0x0888, 0x0016, 0x0026, 0xa87c, 0xd0ac, 0x0178, 0xa938,
+	0xaa34, 0x2100, 0x9205, 0x0150, 0xa890, 0x9106, 0x1118, 0xa88c,
+	0x9206, 0x0120, 0xa992, 0xaa8e, 0x9085, 0x0001, 0x002e, 0x001e,
+	0x0005, 0x00b6, 0x00d6, 0x0036, 0x080c, 0xcb4a, 0x0904, 0xd17f,
+	0x0096, 0x6314, 0x2348, 0xa87a, 0xa982, 0x929e, 0x4000, 0x1580,
+	0x6310, 0x00c6, 0x2358, 0x2009, 0x0000, 0xa868, 0xd0f4, 0x1140,
+	0x080c, 0x6828, 0x1108, 0xc185, 0xb800, 0xd0bc, 0x0108, 0xc18d,
+	0xaa96, 0xa99a, 0x20a9, 0x0004, 0xa860, 0x20e8, 0xa85c, 0x9080,
+	0x0031, 0x20a0, 0xb8c4, 0x20e0, 0xb8c8, 0x9080, 0x0006, 0x2098,
+	0x080c, 0x0f7c, 0x20a9, 0x0004, 0xa85c, 0x9080, 0x0035, 0x20a0,
+	0xb8c8, 0x9080, 0x000a, 0x2098, 0x080c, 0x0f7c, 0x00ce, 0x0090,
+	0xaa96, 0x3918, 0x9398, 0x0007, 0x231c, 0x6004, 0x9086, 0x0016,
+	0x0110, 0xa89b, 0x0004, 0xaba2, 0x6310, 0x2358, 0xb804, 0x9084,
+	0x00ff, 0xa89e, 0x080c, 0x6c7a, 0x6017, 0x0000, 0x009e, 0x003e,
+	0x00de, 0x00be, 0x0005, 0x0026, 0x0036, 0x0046, 0x00b6, 0x0096,
+	0x00f6, 0x6214, 0x2248, 0x6210, 0x2258, 0x2079, 0x0260, 0x9096,
+	0x0000, 0x11a0, 0xb814, 0x9084, 0x00ff, 0x900e, 0x080c, 0x2840,
+	0x2118, 0x831f, 0x939c, 0xff00, 0x7838, 0x9084, 0x00ff, 0x931d,
+	0x7c3c, 0x2011, 0x8018, 0x080c, 0x4b14, 0x00a8, 0x9096, 0x0001,
+	0x1148, 0x89ff, 0x0180, 0xa89b, 0x000d, 0x7838, 0xa8a6, 0x783c,
+	0xa8aa, 0x0048, 0x9096, 0x0002, 0x1130, 0xa89b, 0x000d, 0x7838,
+	0xa8a6, 0x783c, 0xa8aa, 0x00fe, 0x009e, 0x00be, 0x004e, 0x003e,
+	0x002e, 0x0005, 0x00c6, 0x0026, 0x0016, 0x9186, 0x0035, 0x0110,
+	0x6a38, 0x0008, 0x6a2c, 0x080c, 0xcb38, 0x01f0, 0x2260, 0x6120,
+	0x9186, 0x0003, 0x0118, 0x9186, 0x0006, 0x1190, 0x6838, 0x9206,
+	0x0140, 0x683c, 0x9206, 0x1160, 0x6108, 0x6838, 0x9106, 0x1140,
+	0x0020, 0x6008, 0x693c, 0x9106, 0x1118, 0x6010, 0x6910, 0x9106,
+	0x001e, 0x002e, 0x00ce, 0x0005, 0x9085, 0x0001, 0x0cc8, 0xa974,
+	0xd1cc, 0x0188, 0x918c, 0x00ff, 0x918e, 0x0002, 0x1160, 0xa9a8,
+	0x918c, 0x0f00, 0x810f, 0x918e, 0x0001, 0x1128, 0xa834, 0xa938,
+	0x9115, 0x190c, 0xc258, 0x0005, 0x0036, 0x2019, 0x0001, 0x0010,
+	0x0036, 0x901e, 0x0499, 0x01e0, 0x080c, 0xcb4a, 0x01c8, 0x080c,
+	0xcd33, 0x6037, 0x4000, 0x6014, 0x6017, 0x0000, 0x0096, 0x2048,
+	0xa87c, 0x080c, 0xcd50, 0x1118, 0x080c, 0xb824, 0x0040, 0xa867,
+	0x0103, 0xa877, 0x0000, 0x83ff, 0x1129, 0x080c, 0x6c86, 0x009e,
+	0x003e, 0x0005, 0xa880, 0xd0b4, 0x0128, 0xa87b, 0x0006, 0xc0ec,
+	0xa882, 0x0048, 0xd0bc, 0x0118, 0xa87b, 0x0002, 0x0020, 0xa87b,
+	0x0005, 0x080c, 0xce44, 0xa877, 0x0000, 0x0005, 0x2001, 0x1810,
+	0x2004, 0xd0ec, 0x0005, 0x0006, 0x2001, 0x1810, 0x2004, 0xd0f4,
+	0x000e, 0x0005, 0x0006, 0x2001, 0x1810, 0x2004, 0xd0e4, 0x000e,
+	0x0005, 0x0036, 0x0046, 0x6010, 0x00b6, 0x2058, 0xbba0, 0x00be,
+	0x2021, 0x0007, 0x080c, 0x4ccb, 0x004e, 0x003e, 0x0005, 0x0c51,
+	0x1d81, 0x0005, 0x2001, 0x1985, 0x2004, 0x601a, 0x0005, 0x2001,
+	0x1987, 0x2004, 0x6042, 0x0005, 0x080c, 0xae71, 0x0804, 0x9687,
+	0x00b6, 0x0066, 0x6000, 0x90b2, 0x0016, 0x1a0c, 0x0dd5, 0x001b,
+	0x006e, 0x00be, 0x0005, 0xd28b, 0xd997, 0xdaf4, 0xd28b, 0xd28b,
+	0xd28b, 0xd28b, 0xd28b, 0xd2c2, 0xdb78, 0xd28b, 0xd28b, 0xd28b,
+	0xd28b, 0xd28b, 0xd28b, 0x080c, 0x0dd5, 0x0066, 0x6000, 0x90b2,
+	0x0016, 0x1a0c, 0x0dd5, 0x0013, 0x006e, 0x0005, 0xd2a6, 0xe0e0,
+	0xd2a6, 0xd2a6, 0xd2a6, 0xd2a6, 0xd2a6, 0xd2a6, 0xe08d, 0xe134,
+	0xd2a6, 0xe759, 0xe78f, 0xe759, 0xe78f, 0xd2a6, 0x080c, 0x0dd5,
+	0x6000, 0x9082, 0x0016, 0x1a0c, 0x0dd5, 0x6000, 0x000a, 0x0005,
+	0xd2c0, 0xdd55, 0xde45, 0xde67, 0xdf26, 0xd2c0, 0xe004, 0xdfae,
+	0xdb84, 0xe063, 0xe078, 0xd2c0, 0xd2c0, 0xd2c0, 0xd2c0, 0xd2c0,
+	0x080c, 0x0dd5, 0x91b2, 0x0053, 0x1a0c, 0x0dd5, 0x2100, 0x91b2,
+	0x0040, 0x1a04, 0xd70b, 0x0002, 0xd30c, 0xd4fc, 0xd30c, 0xd30c,
+	0xd30c, 0xd505, 0xd30c, 0xd30c, 0xd30c, 0xd30c, 0xd30c, 0xd30c,
+	0xd30c, 0xd30c, 0xd30c, 0xd30c, 0xd30c, 0xd30c, 0xd30c, 0xd30c,
+	0xd30c, 0xd30c, 0xd30c, 0xd30e, 0xd371, 0xd380, 0xd3e4, 0xd40f,
+	0xd488, 0xd4e7, 0xd30c, 0xd30c, 0xd508, 0xd30c, 0xd30c, 0xd51d,
+	0xd52a, 0xd30c, 0xd30c, 0xd30c, 0xd30c, 0xd30c, 0xd5ad, 0xd30c,
+	0xd30c, 0xd5c1, 0xd30c, 0xd30c, 0xd57c, 0xd30c, 0xd30c, 0xd30c,
+	0xd5d9, 0xd30c, 0xd30c, 0xd30c, 0xd656, 0xd30c, 0xd30c, 0xd30c,
+	0xd30c, 0xd30c, 0xd30c, 0xd6d3, 0x080c, 0x0dd5, 0x080c, 0x6939,
+	0x1150, 0x2001, 0x1837, 0x2004, 0xd0cc, 0x1128, 0x9084, 0x0009,
+	0x9086, 0x0008, 0x1140, 0x6007, 0x0009, 0x602f, 0x0009, 0x6017,
+	0x0000, 0x0804, 0xd4f5, 0x080c, 0x68d5, 0x00e6, 0x00c6, 0x0036,
+	0x0026, 0x0016, 0x6210, 0x2258, 0xbaa0, 0x0026, 0x2019, 0x0029,
+	0x080c, 0x927e, 0x0076, 0x903e, 0x080c, 0x9151, 0x2c08, 0x080c,
+	0xe30c, 0x007e, 0x001e, 0x001e, 0x002e, 0x003e, 0x00ce, 0x00ee,
+	0x6610, 0x2658, 0x080c, 0x6617, 0xbe04, 0x9684, 0x00ff, 0x9082,
+	0x0006, 0x1268, 0x0016, 0x0026, 0x6210, 0x00b6, 0x2258, 0xbaa0,
+	0x00be, 0x2c08, 0x080c, 0xe9b8, 0x002e, 0x001e, 0x1178, 0x080c,
+	0xe23e, 0x1904, 0xd3dc, 0x080c, 0xe1da, 0x1120, 0x6007, 0x0008,
+	0x0804, 0xd4f5, 0x6007, 0x0009, 0x0804, 0xd4f5, 0x080c, 0xe462,
+	0x0128, 0x080c, 0xe23e, 0x0d78, 0x0804, 0xd3dc, 0x6017, 0x1900,
+	0x0c88, 0x080c, 0x32e5, 0x1904, 0xd708, 0x6106, 0x080c, 0xe18f,
+	0x6007, 0x0006, 0x0804, 0xd4f5, 0x6007, 0x0007, 0x0804, 0xd4f5,
+	0x080c, 0xe7cb, 0x1904, 0xd708, 0x080c, 0x32e5, 0x1904, 0xd708,
+	0x00d6, 0x6610, 0x2658, 0xbe04, 0x9684, 0x00ff, 0x9082, 0x0006,
+	0x1220, 0x2001, 0x0001, 0x080c, 0x6544, 0x96b4, 0xff00, 0x8637,
+	0x9686, 0x0006, 0x0188, 0x9686, 0x0004, 0x0170, 0xbe04, 0x96b4,
+	0x00ff, 0x9686, 0x0006, 0x0140, 0x9686, 0x0004, 0x0128, 0x9686,
+	0x0005, 0x0110, 0x00de, 0x0480, 0x00e6, 0x2071, 0x0260, 0x7034,
+	0x9084, 0x0003, 0x1140, 0x7034, 0x9082, 0x0014, 0x0220, 0x7030,
+	0x9084, 0x0003, 0x0130, 0x00ee, 0x6017, 0x0000, 0x602f, 0x0007,
+	0x00b0, 0x00ee, 0x080c, 0xe2a2, 0x1190, 0x9686, 0x0006, 0x1140,
+	0x0026, 0x6210, 0x2258, 0xbaa0, 0x900e, 0x080c, 0x320a, 0x002e,
+	0x080c, 0x66a3, 0x6007, 0x000a, 0x00de, 0x0804, 0xd4f5, 0x6007,
+	0x000b, 0x00de, 0x0804, 0xd4f5, 0x080c, 0x31c1, 0x080c, 0xd25f,
+	0x6007, 0x0001, 0x0804, 0xd4f5, 0x080c, 0xe7cb, 0x1904, 0xd708,
+	0x080c, 0x32e5, 0x1904, 0xd708, 0x2071, 0x0260, 0x7034, 0x90b4,
+	0x0003, 0x1948, 0x90b2, 0x0014, 0x0a30, 0x7030, 0x9084, 0x0003,
+	0x1910, 0x6610, 0x2658, 0xbe04, 0x9686, 0x0707, 0x09e8, 0x0026,
+	0x6210, 0x2258, 0xbaa0, 0x900e, 0x080c, 0x320a, 0x002e, 0x6007,
+	0x000c, 0x2001, 0x0001, 0x080c, 0xe998, 0x0804, 0xd4f5, 0x080c,
+	0x6939, 0x1140, 0x2001, 0x1837, 0x2004, 0x9084, 0x0009, 0x9086,
+	0x0008, 0x1110, 0x0804, 0xd31b, 0x080c, 0x68d5, 0x6610, 0x2658,
+	0xbe04, 0x9684, 0x00ff, 0x9082, 0x0006, 0x06c8, 0x1138, 0x0026,
+	0x2001, 0x0006, 0x080c, 0x6584, 0x002e, 0x0050, 0x96b4, 0xff00,
+	0x8637, 0x9686, 0x0004, 0x0120, 0x9686, 0x0006, 0x1904, 0xd3dc,
+	0x080c, 0xe2af, 0x1120, 0x6007, 0x000e, 0x0804, 0xd4f5, 0x0046,
+	0x6410, 0x2458, 0xbca0, 0x0046, 0x080c, 0x31c1, 0x080c, 0xd25f,
+	0x004e, 0x0016, 0x9006, 0x2009, 0x1848, 0x210c, 0xd1a4, 0x0148,
+	0x2009, 0x0029, 0x080c, 0xe5cf, 0x6010, 0x2058, 0xb800, 0xc0e5,
+	0xb802, 0x001e, 0x004e, 0x6007, 0x0001, 0x0804, 0xd4f5, 0x2001,
+	0x0001, 0x080c, 0x6544, 0x0156, 0x0016, 0x0026, 0x0036, 0x20a9,
+	0x0004, 0x2019, 0x1805, 0x2011, 0x0270, 0x080c, 0xbe1c, 0x003e,
+	0x002e, 0x001e, 0x015e, 0x9005, 0x0168, 0x96b4, 0xff00, 0x8637,
+	0x9682, 0x0004, 0x0a04, 0xd3dc, 0x9682, 0x0007, 0x0a04, 0xd438,
+	0x0804, 0xd3dc, 0x6017, 0x1900, 0x6007, 0x0009, 0x0804, 0xd4f5,
+	0x080c, 0x6939, 0x1140, 0x2001, 0x1837, 0x2004, 0x9084, 0x0009,
+	0x9086, 0x0008, 0x1110, 0x0804, 0xd31b, 0x080c, 0x68d5, 0x6610,
+	0x2658, 0xbe04, 0x9684, 0x00ff, 0x0006, 0x9086, 0x0001, 0x000e,
+	0x0170, 0x9082, 0x0006, 0x0698, 0x0150, 0x96b4, 0xff00, 0x8637,
+	0x9686, 0x0004, 0x0120, 0x9686, 0x0006, 0x1904, 0xd3dc, 0x080c,
+	0xe2dd, 0x1130, 0x080c, 0xe1da, 0x1118, 0x6007, 0x0010, 0x04e8,
+	0x0046, 0x6410, 0x2458, 0xbca0, 0x0046, 0x080c, 0x31c1, 0x080c,
+	0xd25f, 0x004e, 0x0016, 0x9006, 0x2009, 0x1848, 0x210c, 0xd1a4,
+	0x0148, 0x2009, 0x0029, 0x080c, 0xe5cf, 0x6010, 0x2058, 0xb800,
+	0xc0e5, 0xb802, 0x001e, 0x004e, 0x6007, 0x0001, 0x00f0, 0x080c,
+	0xe462, 0x0140, 0x96b4, 0xff00, 0x8637, 0x9686, 0x0006, 0x0978,
+	0x0804, 0xd3dc, 0x6017, 0x1900, 0x6007, 0x0009, 0x0070, 0x080c,
+	0x32e5, 0x1904, 0xd708, 0x080c, 0xe7cb, 0x1904, 0xd708, 0x080c,
+	0xd8d5, 0x1904, 0xd3dc, 0x6007, 0x0012, 0x6003, 0x0001, 0x080c,
+	0x9121, 0x080c, 0x9687, 0x0005, 0x6007, 0x0001, 0x6003, 0x0001,
+	0x080c, 0x9121, 0x080c, 0x9687, 0x0cb0, 0x6007, 0x0005, 0x0c68,
+	0x080c, 0xe7cb, 0x1904, 0xd708, 0x080c, 0x32e5, 0x1904, 0xd708,
+	0x080c, 0xd8d5, 0x1904, 0xd3dc, 0x6007, 0x0020, 0x6003, 0x0001,
+	0x080c, 0x9121, 0x080c, 0x9687, 0x0005, 0x080c, 0x32e5, 0x1904,
+	0xd708, 0x6007, 0x0023, 0x6003, 0x0001, 0x080c, 0x9121, 0x080c,
+	0x9687, 0x0005, 0x080c, 0xe7cb, 0x1904, 0xd708, 0x080c, 0x32e5,
+	0x1904, 0xd708, 0x080c, 0xd8d5, 0x1904, 0xd3dc, 0x0016, 0x0026,
+	0x00e6, 0x2071, 0x0260, 0x7244, 0x9286, 0xffff, 0x0180, 0x2c08,
+	0x080c, 0xcb38, 0x01b0, 0x2260, 0x7240, 0x6008, 0x9206, 0x1188,
+	0x6010, 0x9190, 0x0004, 0x2214, 0x9206, 0x01b8, 0x0050, 0x7240,
+	0x2c08, 0x9006, 0x080c, 0xe599, 0x1180, 0x7244, 0x9286, 0xffff,
+	0x01b0, 0x2160, 0x6007, 0x0026, 0x6017, 0x1700, 0x7214, 0x9296,
+	0xffff, 0x1180, 0x6007, 0x0025, 0x0068, 0x6020, 0x9086, 0x0007,
+	0x1d80, 0x6004, 0x9086, 0x0024, 0x1110, 0x080c, 0xae71, 0x2160,
+	0x6007, 0x0025, 0x6003, 0x0001, 0x080c, 0x9121, 0x080c, 0x9687,
+	0x00ee, 0x002e, 0x001e, 0x0005, 0x2001, 0x0001, 0x080c, 0x6544,
+	0x0156, 0x0016, 0x0026, 0x0036, 0x20a9, 0x0004, 0x2019, 0x1805,
+	0x2011, 0x0276, 0x080c, 0xbe1c, 0x003e, 0x002e, 0x001e, 0x015e,
+	0x0120, 0x6007, 0x0031, 0x0804, 0xd4f5, 0x080c, 0xba90, 0x080c,
+	0x73a5, 0x1190, 0x0006, 0x0026, 0x0036, 0x080c, 0x73bf, 0x1138,
+	0x080c, 0x768d, 0x080c, 0x6023, 0x080c, 0x72d7, 0x0010, 0x080c,
+	0x737d, 0x003e, 0x002e, 0x000e, 0x0005, 0x080c, 0x32e5, 0x1904,
+	0xd708, 0x080c, 0xd8d5, 0x1904, 0xd3dc, 0x6106, 0x080c, 0xd8f1,
+	0x1120, 0x6007, 0x002b, 0x0804, 0xd4f5, 0x6007, 0x002c, 0x0804,
+	0xd4f5, 0x080c, 0xe7cb, 0x1904, 0xd708, 0x080c, 0x32e5, 0x1904,
+	0xd708, 0x080c, 0xd8d5, 0x1904, 0xd3dc, 0x6106, 0x080c, 0xd8f6,
+	0x1120, 0x6007, 0x002e, 0x0804, 0xd4f5, 0x6007, 0x002f, 0x0804,
+	0xd4f5, 0x080c, 0x32e5, 0x1904, 0xd708, 0x00e6, 0x00d6, 0x00c6,
+	0x6010, 0x2058, 0xb904, 0x9184, 0x00ff, 0x9086, 0x0006, 0x0158,
+	0x9184, 0xff00, 0x8007, 0x9086, 0x0006, 0x0128, 0x00ce, 0x00de,
+	0x00ee, 0x0804, 0xd4fc, 0x080c, 0x56dc, 0xd0e4, 0x0904, 0xd653,
+	0x2071, 0x026c, 0x7010, 0x603a, 0x7014, 0x603e, 0x7108, 0x720c,
+	0x080c, 0x6977, 0x0140, 0x6010, 0x2058, 0xb810, 0x9106, 0x1118,
+	0xb814, 0x9206, 0x0510, 0x080c, 0x6973, 0x15b8, 0x2069, 0x1800,
+	0x6880, 0x9206, 0x1590, 0x687c, 0x9106, 0x1578, 0x7210, 0x080c,
+	0xcb38, 0x0590, 0x080c, 0xd7c0, 0x0578, 0x080c, 0xe64b, 0x0560,
+	0x622e, 0x6007, 0x0036, 0x6003, 0x0001, 0x080c, 0x90d9, 0x080c,
+	0x9687, 0x00ce, 0x00de, 0x00ee, 0x0005, 0x7214, 0x9286, 0xffff,
+	0x0150, 0x080c, 0xcb38, 0x01c0, 0x9280, 0x0002, 0x2004, 0x7110,
+	0x9106, 0x1190, 0x08e0, 0x7210, 0x2c08, 0x9085, 0x0001, 0x080c,
+	0xe599, 0x2c10, 0x2160, 0x0140, 0x0890, 0x6007, 0x0037, 0x602f,
+	0x0009, 0x6017, 0x1500, 0x08b8, 0x6007, 0x0037, 0x602f, 0x0003,
+	0x6017, 0x1700, 0x0880, 0x6007, 0x0012, 0x0868, 0x080c, 0x32e5,
+	0x1904, 0xd708, 0x6010, 0x2058, 0xb804, 0x9084, 0xff00, 0x8007,
+	0x9086, 0x0006, 0x1904, 0xd4fc, 0x00e6, 0x00d6, 0x00c6, 0x080c,
+	0x56dc, 0xd0e4, 0x0904, 0xd6cb, 0x2069, 0x1800, 0x2071, 0x026c,
+	0x7008, 0x603a, 0x720c, 0x623e, 0x9286, 0xffff, 0x1150, 0x7208,
+	0x00c6, 0x2c08, 0x9085, 0x0001, 0x080c, 0xe599, 0x2c10, 0x00ce,
+	0x05e8, 0x080c, 0xcb38, 0x05d0, 0x7108, 0x9280, 0x0002, 0x2004,
+	0x9106, 0x15a0, 0x00c6, 0x0026, 0x2260, 0x080c, 0xc76e, 0x002e,
+	0x00ce, 0x7118, 0x918c, 0xff00, 0x810f, 0x9186, 0x0001, 0x0178,
+	0x9186, 0x0005, 0x0118, 0x9186, 0x0007, 0x1198, 0x9280, 0x0005,
+	0x2004, 0x9005, 0x0170, 0x080c, 0xd7c0, 0x0904, 0xd64c, 0x0056,
+	0x7510, 0x7614, 0x080c, 0xe664, 0x005e, 0x00ce, 0x00de, 0x00ee,
+	0x0005, 0x6007, 0x003b, 0x602f, 0x0009, 0x6017, 0x2a00, 0x6003,
+	0x0001, 0x080c, 0x90d9, 0x080c, 0x9687, 0x0c78, 0x6007, 0x003b,
+	0x602f, 0x0003, 0x6017, 0x0300, 0x6003, 0x0001, 0x080c, 0x90d9,
+	0x080c, 0x9687, 0x0c10, 0x6007, 0x003b, 0x602f, 0x000b, 0x6017,
+	0x0000, 0x0804, 0xd623, 0x00e6, 0x0026, 0x080c, 0x6939, 0x0550,
+	0x080c, 0x68d5, 0x080c, 0xe83d, 0x1518, 0x2071, 0x1800, 0x70dc,
+	0x9085, 0x0003, 0x70de, 0x00f6, 0x2079, 0x0100, 0x72b0, 0x9284,
+	0x00ff, 0x707e, 0x78e6, 0x9284, 0xff00, 0x7280, 0x9205, 0x7082,
+	0x78ea, 0x00fe, 0x70e7, 0x0000, 0x080c, 0x6977, 0x0120, 0x2011,
+	0x19ff, 0x2013, 0x07d0, 0xd0ac, 0x1128, 0x080c, 0x2f98, 0x0010,
+	0x080c, 0xe86f, 0x002e, 0x00ee, 0x080c, 0xae71, 0x0804, 0xd4fb,
+	0x080c, 0xae71, 0x0005, 0x2600, 0x0002, 0xd71f, 0xd750, 0xd761,
+	0xd71f, 0xd71f, 0xd721, 0xd772, 0xd71f, 0xd71f, 0xd71f, 0xd73e,
+	0xd71f, 0xd71f, 0xd71f, 0xd77d, 0xd78a, 0xd7bb, 0xd71f, 0x080c,
+	0x0dd5, 0x080c, 0xe7cb, 0x1d20, 0x080c, 0x32e5, 0x1d08, 0x080c,
+	0xd8d5, 0x1148, 0x7038, 0x6016, 0x6007, 0x0045, 0x6003, 0x0001,
+	0x080c, 0x9121, 0x0005, 0x080c, 0x31c1, 0x080c, 0xd25f, 0x6007,
+	0x0001, 0x6003, 0x0001, 0x080c, 0x9121, 0x0005, 0x080c, 0xe7cb,
+	0x1938, 0x080c, 0x32e5, 0x1920, 0x080c, 0xd8d5, 0x1d60, 0x703c,
+	0x6016, 0x6007, 0x004a, 0x6003, 0x0001, 0x080c, 0x9121, 0x0005,
+	0x080c, 0x32e5, 0x1904, 0xd708, 0x2009, 0x0041, 0x080c, 0xe878,
+	0x6007, 0x0047, 0x6003, 0x0001, 0x080c, 0x9121, 0x080c, 0x9687,
+	0x0005, 0x080c, 0x32e5, 0x1904, 0xd708, 0x2009, 0x0042, 0x080c,
+	0xe878, 0x6007, 0x0047, 0x6003, 0x0001, 0x080c, 0x9121, 0x080c,
+	0x9687, 0x0005, 0x080c, 0x32e5, 0x1904, 0xd708, 0x2009, 0x0046,
+	0x080c, 0xe878, 0x080c, 0xae71, 0x0005, 0x080c, 0xd7dd, 0x0904,
+	0xd708, 0x6007, 0x004e, 0x6003, 0x0001, 0x080c, 0x9121, 0x080c,
+	0x9687, 0x0005, 0x6007, 0x004f, 0x6017, 0x0000, 0x7134, 0x918c,
+	0x00ff, 0x81ff, 0x0508, 0x9186, 0x0001, 0x1160, 0x7140, 0x2001,
+	0x19bc, 0x2004, 0x9106, 0x11b0, 0x7144, 0x2001, 0x19bd, 0x2004,
+	0x9106, 0x0190, 0x9186, 0x0002, 0x1168, 0x2011, 0x0276, 0x20a9,
+	0x0004, 0x6010, 0x0096, 0x2048, 0x2019, 0x000a, 0x080c, 0xbe30,
+	0x009e, 0x0110, 0x6017, 0x0001, 0x6003, 0x0001, 0x080c, 0x9121,
+	0x080c, 0x9687, 0x0005, 0x6007, 0x0050, 0x703c, 0x6016, 0x0ca0,
+	0x0016, 0x00e6, 0x2071, 0x0260, 0x00b6, 0x00c6, 0x2260, 0x6010,
+	0x2058, 0xb8cc, 0xd084, 0x0150, 0x7128, 0x6048, 0x9106, 0x1120,
+	0x712c, 0x6044, 0x9106, 0x0110, 0x9006, 0x0010, 0x9085, 0x0001,
+	0x00ce, 0x00be, 0x00ee, 0x001e, 0x0005, 0x0016, 0x0096, 0x0086,
+	0x00e6, 0x01c6, 0x01d6, 0x0126, 0x2091, 0x8000, 0x2071, 0x1800,
+	0x7090, 0x908a, 0x00f9, 0x16e8, 0x20e1, 0x0000, 0x2001, 0x199f,
+	0x2003, 0x0000, 0x080c, 0x1018, 0x05a0, 0x2900, 0x6016, 0x7090,
+	0x8004, 0xa816, 0x908a, 0x001e, 0x02d0, 0xa833, 0x001e, 0x20a9,
+	0x001e, 0xa860, 0x20e8, 0xa85c, 0x9080, 0x001b, 0x20a0, 0x2001,
+	0x199f, 0x0016, 0x200c, 0x0471, 0x001e, 0x2940, 0x080c, 0x1018,
+	0x01c0, 0x2900, 0xa006, 0x2100, 0x81ff, 0x0180, 0x0c18, 0xa832,
+	0x20a8, 0xa860, 0x20e8, 0xa85c, 0x9080, 0x001b, 0x20a0, 0x2001,
+	0x199f, 0x0016, 0x200c, 0x00b1, 0x001e, 0x0000, 0x9085, 0x0001,
+	0x0048, 0x2071, 0x1800, 0x7093, 0x0000, 0x6014, 0x2048, 0x080c,
+	0x0fb1, 0x9006, 0x012e, 0x01de, 0x01ce, 0x00ee, 0x008e, 0x009e,
+	0x001e, 0x0005, 0x0006, 0x0016, 0x0026, 0x0036, 0x00c6, 0x918c,
+	0xffff, 0x11a8, 0x080c, 0x23ad, 0x2099, 0x026c, 0x2001, 0x0014,
+	0x3518, 0x9312, 0x1218, 0x23a8, 0x4003, 0x00f8, 0x20a8, 0x4003,
+	0x22a8, 0x8108, 0x080c, 0x23ad, 0x2099, 0x0260, 0x0ca8, 0x080c,
+	0x23ad, 0x2061, 0x199f, 0x6004, 0x2098, 0x6008, 0x3518, 0x9312,
+	0x1218, 0x23a8, 0x4003, 0x0048, 0x20a8, 0x4003, 0x22a8, 0x8108,
+	0x080c, 0x23ad, 0x2099, 0x0260, 0x0ca8, 0x2061, 0x199f, 0x2019,
+	0x0280, 0x3300, 0x931e, 0x0110, 0x6006, 0x0020, 0x2001, 0x0260,
 	0x6006, 0x8108, 0x2162, 0x9292, 0x0021, 0x9296, 0xffff, 0x620a,
-	0x00ce, 0x003e, 0x002e, 0x001e, 0x000e, 0x0005, 0x00b6, 0x0066,
-	0x6610, 0x2658, 0xbe04, 0x96b4, 0xff00, 0x8637, 0x9686, 0x0006,
-	0x0170, 0x9686, 0x0004, 0x0158, 0xbe04, 0x96b4, 0x00ff, 0x9686,
-	0x0006, 0x0128, 0x9686, 0x0004, 0x0110, 0x9085, 0x0001, 0x006e,
-	0x00be, 0x0005, 0x00d6, 0x080c, 0xd94e, 0x00de, 0x0005, 0x00d6,
-	0x080c, 0xd95b, 0x1520, 0x680c, 0x908c, 0xff00, 0x6820, 0x9084,
-	0x00ff, 0x9115, 0x6216, 0x6824, 0x602e, 0xd1e4, 0x0130, 0x9006,
-	0x080c, 0xe977, 0x2009, 0x0001, 0x0078, 0xd1ec, 0x0180, 0x6920,
-	0x918c, 0x00ff, 0x6824, 0x080c, 0x283e, 0x1148, 0x2001, 0x0001,
-	0x080c, 0xe977, 0x2110, 0x900e, 0x080c, 0x3208, 0x0018, 0x9085,
-	0x0001, 0x0008, 0x9006, 0x00de, 0x0005, 0x00b6, 0x00c6, 0x080c,
-	0xaeaf, 0x05a8, 0x0016, 0x0026, 0x00c6, 0x2011, 0x0263, 0x2204,
-	0x8211, 0x220c, 0x080c, 0x283e, 0x1578, 0x080c, 0x659e, 0x1560,
-	0xbe12, 0xbd16, 0x00ce, 0x002e, 0x001e, 0x2b00, 0x6012, 0x080c,
-	0xe7aa, 0x11d8, 0x080c, 0x32e3, 0x11c0, 0x080c, 0xd8b6, 0x0510,
-	0x2001, 0x0007, 0x080c, 0x654f, 0x2001, 0x0007, 0x080c, 0x657b,
-	0x6017, 0x0000, 0x6023, 0x0001, 0x6007, 0x0001, 0x6003, 0x0001,
-	0x080c, 0x9138, 0x080c, 0x968d, 0x0010, 0x080c, 0xae61, 0x9085,
-	0x0001, 0x00ce, 0x00be, 0x0005, 0x080c, 0xae61, 0x00ce, 0x002e,
-	0x001e, 0x0ca8, 0x080c, 0xae61, 0x9006, 0x0c98, 0x2069, 0x026d,
-	0x6800, 0x9082, 0x0010, 0x1228, 0x6017, 0x0000, 0x9085, 0x0001,
-	0x0008, 0x9006, 0x0005, 0x6017, 0x0000, 0x2069, 0x026c, 0x6808,
-	0x9084, 0xff00, 0x9086, 0x0800, 0x1190, 0x6904, 0x9186, 0x0018,
-	0x0118, 0x9186, 0x0014, 0x1158, 0x810f, 0x6800, 0x9084, 0x00ff,
-	0x910d, 0x615a, 0x908e, 0x0014, 0x0110, 0x908e, 0x0010, 0x0005,
-	0x6004, 0x90b2, 0x0053, 0x1a0c, 0x0dd5, 0x91b6, 0x0013, 0x1130,
-	0x2008, 0x91b2, 0x0040, 0x1a04, 0xdaa5, 0x0092, 0x91b6, 0x0027,
-	0x0120, 0x91b6, 0x0014, 0x190c, 0x0dd5, 0x2001, 0x0007, 0x080c,
-	0x657b, 0x080c, 0x9588, 0x080c, 0xae92, 0x080c, 0x968d, 0x0005,
-	0xd9d8, 0xd9da, 0xd9d8, 0xd9d8, 0xd9d8, 0xd9da, 0xd9e9, 0xda9e,
-	0xda3b, 0xda9e, 0xda4f, 0xda9e, 0xd9e9, 0xda9e, 0xda96, 0xda9e,
-	0xda96, 0xda9e, 0xda9e, 0xd9d8, 0xd9d8, 0xd9d8, 0xd9d8, 0xd9d8,
-	0xd9d8, 0xd9d8, 0xd9d8, 0xd9d8, 0xd9d8, 0xd9d8, 0xd9da, 0xd9d8,
-	0xda9e, 0xd9d8, 0xd9d8, 0xda9e, 0xd9d8, 0xda9b, 0xda9e, 0xd9d8,
-	0xd9d8, 0xd9d8, 0xd9d8, 0xda9e, 0xda9e, 0xd9d8, 0xda9e, 0xda9e,
-	0xd9d8, 0xd9e4, 0xd9d8, 0xd9d8, 0xd9d8, 0xd9d8, 0xda9a, 0xda9e,
-	0xd9d8, 0xd9d8, 0xda9e, 0xda9e, 0xd9d8, 0xd9d8, 0xd9d8, 0xd9d8,
-	0x080c, 0x0dd5, 0x080c, 0x9588, 0x080c, 0xd248, 0x6003, 0x0002,
-	0x080c, 0x968d, 0x0804, 0xdaa4, 0x9006, 0x080c, 0x653b, 0x0804,
-	0xda9e, 0x080c, 0x696a, 0x1904, 0xda9e, 0x9006, 0x080c, 0x653b,
-	0x6010, 0x2058, 0xb810, 0x9086, 0x00ff, 0x1140, 0x00f6, 0x2079,
-	0x1800, 0x78a8, 0x8000, 0x78aa, 0x00fe, 0x0428, 0x6010, 0x2058,
-	0xb8c0, 0x9005, 0x1178, 0x080c, 0xd230, 0x1904, 0xda9e, 0x0036,
-	0x0046, 0xbba0, 0x2021, 0x0007, 0x080c, 0x4cbb, 0x004e, 0x003e,
-	0x0804, 0xda9e, 0x080c, 0x3314, 0x1904, 0xda9e, 0x2001, 0x1800,
-	0x2004, 0x9086, 0x0002, 0x1138, 0x00f6, 0x2079, 0x1800, 0x78a8,
-	0x8000, 0x78aa, 0x00fe, 0x2001, 0x0002, 0x080c, 0x654f, 0x080c,
-	0x9588, 0x6023, 0x0001, 0x6003, 0x0001, 0x6007, 0x0002, 0x080c,
-	0x9138, 0x080c, 0x968d, 0x6110, 0x2158, 0x2009, 0x0001, 0x080c,
-	0x8501, 0x0804, 0xdaa4, 0x6610, 0x2658, 0xbe04, 0x96b4, 0xff00,
-	0x8637, 0x9686, 0x0006, 0x0904, 0xda9e, 0x9686, 0x0004, 0x0904,
-	0xda9e, 0x080c, 0x8cbb, 0x2001, 0x0004, 0x0804, 0xda9c, 0x2001,
-	0x1800, 0x2004, 0x9086, 0x0003, 0x1158, 0x0036, 0x0046, 0x6010,
-	0x2058, 0xbba0, 0x2021, 0x0006, 0x080c, 0x4cbb, 0x004e, 0x003e,
-	0x2001, 0x0006, 0x080c, 0xdac2, 0x6610, 0x2658, 0xbe04, 0x0066,
-	0x96b4, 0xff00, 0x8637, 0x9686, 0x0006, 0x006e, 0x0168, 0x2001,
-	0x0006, 0x080c, 0x657b, 0x9284, 0x00ff, 0x908e, 0x0007, 0x1120,
-	0x2001, 0x0006, 0x080c, 0x654f, 0x080c, 0x696a, 0x11f8, 0x2001,
-	0x1837, 0x2004, 0xd0a4, 0x01d0, 0xbe04, 0x96b4, 0x00ff, 0x9686,
-	0x0006, 0x01a0, 0x00f6, 0x2079, 0x1800, 0x78a8, 0x8000, 0x78aa,
-	0x00fe, 0x0804, 0xda23, 0x2001, 0x0004, 0x0030, 0x2001, 0x0006,
-	0x0449, 0x0020, 0x0018, 0x0010, 0x080c, 0x657b, 0x080c, 0x9588,
-	0x080c, 0xae61, 0x080c, 0x968d, 0x0005, 0x2600, 0x0002, 0xdab9,
-	0xdab9, 0xdab9, 0xdab9, 0xdab9, 0xdabb, 0xdab9, 0xdabb, 0xdab9,
-	0xdab9, 0xdabb, 0xdab9, 0xdab9, 0xdab9, 0xdabb, 0xdabb, 0xdabb,
-	0xdabb, 0x080c, 0x0dd5, 0x080c, 0x9588, 0x080c, 0xae61, 0x080c,
-	0x968d, 0x0005, 0x0016, 0x00b6, 0x00d6, 0x6110, 0x2158, 0xb900,
-	0xd184, 0x0138, 0x080c, 0x654f, 0x9006, 0x080c, 0x653b, 0x080c,
-	0x31e8, 0x00de, 0x00be, 0x001e, 0x0005, 0x6610, 0x2658, 0xb804,
-	0x9084, 0xff00, 0x8007, 0x90b2, 0x000c, 0x1a0c, 0x0dd5, 0x91b6,
-	0x0015, 0x1110, 0x003b, 0x0028, 0x91b6, 0x0016, 0x190c, 0x0dd5,
-	0x006b, 0x0005, 0xb8fc, 0xb8fc, 0xb8fc, 0xb8fc, 0xb8fc, 0xb8fc,
-	0xdb41, 0xdb02, 0xb8fc, 0xb8fc, 0xb8fc, 0xb8fc, 0xb8fc, 0xb8fc,
-	0xb8fc, 0xb8fc, 0xb8fc, 0xb8fc, 0xdb41, 0xdb48, 0xb8fc, 0xb8fc,
-	0xb8fc, 0xb8fc, 0x00f6, 0x080c, 0x696a, 0x11d8, 0x080c, 0xd230,
-	0x11c0, 0x6010, 0x905d, 0x01a8, 0xb8c0, 0x9005, 0x0190, 0x9006,
-	0x080c, 0x653b, 0x2001, 0x0002, 0x080c, 0x654f, 0x6023, 0x0001,
-	0x6003, 0x0001, 0x6007, 0x0002, 0x080c, 0x9138, 0x080c, 0x968d,
-	0x00f0, 0x2011, 0x0263, 0x2204, 0x8211, 0x220c, 0x080c, 0x283e,
-	0x11b0, 0x080c, 0x65ff, 0x0118, 0x080c, 0xae61, 0x0080, 0xb810,
-	0x0006, 0xb814, 0x0006, 0xb8c0, 0x0006, 0x080c, 0x6034, 0x000e,
-	0xb8c2, 0x000e, 0xb816, 0x000e, 0xb812, 0x080c, 0xae61, 0x00fe,
-	0x0005, 0x6604, 0x96b6, 0x001e, 0x1110, 0x080c, 0xae61, 0x0005,
-	0x080c, 0xbc85, 0x1148, 0x6003, 0x0001, 0x6007, 0x0001, 0x080c,
-	0x9138, 0x080c, 0x968d, 0x0010, 0x080c, 0xae61, 0x0005, 0x6004,
-	0x908a, 0x0053, 0x1a0c, 0x0dd5, 0x080c, 0x9588, 0x080c, 0xae92,
-	0x080c, 0x968d, 0x0005, 0x9182, 0x0040, 0x0002, 0xdb79, 0xdb79,
-	0xdb79, 0xdb79, 0xdb7b, 0xdb79, 0xdb79, 0xdb79, 0xdb79, 0xdb79,
-	0xdb79, 0xdb79, 0xdb79, 0xdb79, 0xdb79, 0xdb79, 0xdb79, 0xdb79,
-	0xdb79, 0x080c, 0x0dd5, 0x0096, 0x00b6, 0x00d6, 0x00e6, 0x00f6,
-	0x0046, 0x0026, 0x6210, 0x2258, 0xb8bc, 0x9005, 0x11a8, 0x6106,
-	0x2071, 0x0260, 0x7444, 0x94a4, 0xff00, 0x0904, 0xdbe1, 0x080c,
-	0xe96b, 0x1170, 0x9486, 0x2000, 0x1158, 0x2009, 0x0001, 0x2011,
-	0x0200, 0x080c, 0x86dd, 0x0020, 0x9026, 0x080c, 0xe7ef, 0x0c38,
-	0x080c, 0x0fff, 0x090c, 0x0dd5, 0x6003, 0x0007, 0xa867, 0x010d,
-	0x9006, 0xa802, 0xa86a, 0xac8a, 0x2c00, 0xa88e, 0x6008, 0xa8e2,
-	0x6010, 0x2058, 0xb8a0, 0x7130, 0xa97a, 0x0016, 0xa876, 0xa87f,
-	0x0000, 0xa883, 0x0000, 0xa887, 0x0036, 0x080c, 0x6c81, 0x001e,
-	0x080c, 0xe96b, 0x1904, 0xdc41, 0x9486, 0x2000, 0x1130, 0x2019,
-	0x0017, 0x080c, 0xe522, 0x0804, 0xdc41, 0x9486, 0x0200, 0x1120,
-	0x080c, 0xe4be, 0x0804, 0xdc41, 0x9486, 0x0400, 0x0120, 0x9486,
-	0x1000, 0x1904, 0xdc41, 0x2019, 0x0002, 0x080c, 0xe4d9, 0x0804,
-	0xdc41, 0x2069, 0x1a71, 0x6a00, 0xd284, 0x0904, 0xdcab, 0x9284,
-	0x0300, 0x1904, 0xdca4, 0x6804, 0x9005, 0x0904, 0xdc8c, 0x2d78,
-	0x6003, 0x0007, 0x080c, 0x1018, 0x0904, 0xdc4d, 0x7800, 0xd08c,
-	0x1118, 0x7804, 0x8001, 0x7806, 0x6017, 0x0000, 0x2001, 0x180f,
-	0x2004, 0xd084, 0x1904, 0xdcaf, 0x9006, 0xa802, 0xa867, 0x0116,
-	0xa86a, 0x6008, 0xa8e2, 0x2c00, 0xa87a, 0x6010, 0x2058, 0xb8a0,
-	0x7130, 0xa9b6, 0xa876, 0xb928, 0xa9ba, 0xb92c, 0xa9be, 0xb930,
-	0xa9c2, 0xb934, 0xa9c6, 0xa883, 0x003d, 0x7044, 0x9084, 0x0003,
-	0x9080, 0xdc49, 0x2005, 0xa87e, 0x20a9, 0x000a, 0x2001, 0x0270,
-	0xaa5c, 0x9290, 0x0021, 0x2009, 0x0205, 0x200b, 0x0080, 0x20e1,
-	0x0000, 0xab60, 0x23e8, 0x2098, 0x22a0, 0x4003, 0x200b, 0x0000,
-	0x2001, 0x027a, 0x200c, 0xa9b2, 0x8000, 0x200c, 0xa9ae, 0x080c,
-	0x6c81, 0x002e, 0x004e, 0x00fe, 0x00ee, 0x00de, 0x00be, 0x009e,
-	0x0005, 0x0000, 0x0080, 0x0040, 0x0000, 0x2001, 0x1810, 0x2004,
-	0xd084, 0x0120, 0x080c, 0x0fff, 0x1904, 0xdbf6, 0x6017, 0xf100,
-	0x6003, 0x0001, 0x6007, 0x0041, 0x080c, 0x90f0, 0x080c, 0x968d,
-	0x0c00, 0x2069, 0x0260, 0x6848, 0x9084, 0xff00, 0x9086, 0x1200,
-	0x1198, 0x686c, 0x9084, 0x00ff, 0x0016, 0x6114, 0x918c, 0xf700,
-	0x910d, 0x6116, 0x001e, 0x6003, 0x0001, 0x6007, 0x0043, 0x080c,
-	0x90f0, 0x080c, 0x968d, 0x0828, 0x6868, 0x602e, 0x686c, 0x6032,
-	0x6017, 0xf200, 0x6003, 0x0001, 0x6007, 0x0041, 0x080c, 0x90f0,
-	0x080c, 0x968d, 0x0804, 0xdc41, 0x2001, 0x180e, 0x2004, 0xd0ec,
-	0x0120, 0x2011, 0x8049, 0x080c, 0x4b04, 0x6017, 0xf300, 0x0010,
-	0x6017, 0xf100, 0x6003, 0x0001, 0x6007, 0x0041, 0x080c, 0x90f0,
-	0x080c, 0x968d, 0x0804, 0xdc41, 0x6017, 0xf500, 0x0c98, 0x6017,
-	0xf600, 0x0804, 0xdc61, 0x6017, 0xf200, 0x0804, 0xdc61, 0xa867,
-	0x0146, 0xa86b, 0x0000, 0x6008, 0xa886, 0x2c00, 0xa87a, 0x7044,
-	0x9084, 0x0003, 0x9080, 0xdc49, 0x2005, 0xa87e, 0x2928, 0x6010,
-	0x2058, 0xb8a0, 0xa876, 0xb828, 0xa88a, 0xb82c, 0xa88e, 0xb830,
-	0xa892, 0xb834, 0xa896, 0xa883, 0x003d, 0x2009, 0x0205, 0x2104,
-	0x9085, 0x0080, 0x200a, 0x20e1, 0x0000, 0x2011, 0x0210, 0x2214,
-	0x9294, 0x0fff, 0xaaa2, 0x9282, 0x0111, 0x1a0c, 0x0dd5, 0x8210,
-	0x821c, 0x2001, 0x026c, 0x2098, 0xa860, 0x20e8, 0xa85c, 0x9080,
-	0x0029, 0x20a0, 0x2011, 0xdd2b, 0x2041, 0x0001, 0x223d, 0x9784,
-	0x00ff, 0x9322, 0x1208, 0x2300, 0x20a8, 0x4003, 0x931a, 0x0530,
-	0x8210, 0xd7fc, 0x1130, 0x8d68, 0x2d0a, 0x2001, 0x0260, 0x2098,
-	0x0c68, 0x2950, 0x080c, 0x1018, 0x0170, 0x2900, 0xb002, 0xa867,
-	0x0147, 0xa86b, 0x0000, 0xa860, 0x20e8, 0xa85c, 0x9080, 0x001b,
-	0x20a0, 0x8840, 0x08d8, 0x2548, 0xa800, 0x902d, 0x0118, 0x080c,
-	0x1031, 0x0cc8, 0x080c, 0x1031, 0x0804, 0xdc4d, 0x2548, 0x8847,
-	0x9885, 0x0046, 0xa866, 0x2009, 0x0205, 0x200b, 0x0000, 0x080c,
-	0xe551, 0x0804, 0xdc41, 0x8010, 0x0004, 0x801a, 0x0006, 0x8018,
-	0x0008, 0x8016, 0x000a, 0x8014, 0x9186, 0x0013, 0x1160, 0x6004,
-	0x908a, 0x0054, 0x1a0c, 0x0dd5, 0x9082, 0x0040, 0x0a0c, 0x0dd5,
-	0x2008, 0x0804, 0xdddc, 0x9186, 0x0051, 0x0108, 0x00c0, 0x2001,
-	0x0109, 0x2004, 0xd084, 0x0904, 0xdd8d, 0x0126, 0x2091, 0x2800,
-	0x0006, 0x0016, 0x0026, 0x080c, 0x8fd5, 0x002e, 0x001e, 0x000e,
-	0x012e, 0x6000, 0x9086, 0x0002, 0x1580, 0x0804, 0xde24, 0x9186,
-	0x0027, 0x0530, 0x9186, 0x0048, 0x0128, 0x9186, 0x0014, 0x0500,
-	0x190c, 0x0dd5, 0x2001, 0x0109, 0x2004, 0xd084, 0x01f0, 0x00c6,
-	0x0126, 0x2091, 0x2800, 0x00c6, 0x2061, 0x0100, 0x0006, 0x0016,
-	0x0026, 0x080c, 0x8fd5, 0x002e, 0x001e, 0x000e, 0x00ce, 0x012e,
-	0x00ce, 0x6000, 0x9086, 0x0004, 0x190c, 0x0dd5, 0x0804, 0xdf05,
-	0x6004, 0x9082, 0x0040, 0x2008, 0x001a, 0x080c, 0xaef7, 0x0005,
-	0xdda3, 0xdda5, 0xdda5, 0xddcc, 0xdda3, 0xdda3, 0xdda3, 0xdda3,
-	0xdda3, 0xdda3, 0xdda3, 0xdda3, 0xdda3, 0xdda3, 0xdda3, 0xdda3,
-	0xdda3, 0xdda3, 0xdda3, 0x080c, 0x0dd5, 0x080c, 0x9588, 0x080c,
-	0x968d, 0x0036, 0x0096, 0x6014, 0x904d, 0x01d8, 0x080c, 0xcb35,
-	0x01c0, 0x6003, 0x0002, 0x6010, 0x00b6, 0x2058, 0xb800, 0x00be,
-	0xd0bc, 0x1178, 0x2019, 0x0004, 0x080c, 0xe551, 0x6017, 0x0000,
-	0x6018, 0x9005, 0x1120, 0x2001, 0x1987, 0x2004, 0x601a, 0x6003,
-	0x0007, 0x009e, 0x003e, 0x0005, 0x0096, 0x080c, 0x9588, 0x080c,
-	0x968d, 0x080c, 0xcb35, 0x0120, 0x6014, 0x2048, 0x080c, 0x1031,
-	0x080c, 0xae92, 0x009e, 0x0005, 0x0002, 0xddf0, 0xde07, 0xddf2,
-	0xde1e, 0xddf0, 0xddf0, 0xddf0, 0xddf0, 0xddf0, 0xddf0, 0xddf0,
-	0xddf0, 0xddf0, 0xddf0, 0xddf0, 0xddf0, 0xddf0, 0xddf0, 0xddf0,
-	0x080c, 0x0dd5, 0x0096, 0x080c, 0x9588, 0x6014, 0x2048, 0xa87c,
-	0xd0b4, 0x0138, 0x6003, 0x0007, 0x2009, 0x0043, 0x080c, 0xaedc,
-	0x0010, 0x6003, 0x0004, 0x080c, 0x968d, 0x009e, 0x0005, 0x080c,
-	0x9588, 0x080c, 0xcb35, 0x0138, 0x6114, 0x0096, 0x2148, 0xa97c,
-	0x009e, 0xd1ec, 0x1138, 0x080c, 0x86b2, 0x080c, 0xae61, 0x080c,
-	0x968d, 0x0005, 0x080c, 0xe7b3, 0x0db0, 0x0cc8, 0x080c, 0x9588,
-	0x2009, 0x0041, 0x0804, 0xdf8d, 0x9182, 0x0040, 0x0002, 0xde3a,
-	0xde3c, 0xde3a, 0xde3a, 0xde3a, 0xde3a, 0xde3a, 0xde3a, 0xde3a,
-	0xde3a, 0xde3a, 0xde3a, 0xde3a, 0xde3a, 0xde3a, 0xde3a, 0xde3a,
-	0xde3d, 0xde3a, 0x080c, 0x0dd5, 0x0005, 0x00d6, 0x080c, 0x86b2,
-	0x00de, 0x080c, 0xe80b, 0x080c, 0xae61, 0x0005, 0x9182, 0x0040,
-	0x0002, 0xde5c, 0xde5c, 0xde5c, 0xde5c, 0xde5c, 0xde5c, 0xde5c,
-	0xde5c, 0xde5c, 0xde5e, 0xdecd, 0xde5c, 0xde5c, 0xde5c, 0xde5c,
-	0xdecd, 0xde5c, 0xde5c, 0xde5c, 0x080c, 0x0dd5, 0x2001, 0x0105,
-	0x2004, 0x9084, 0x1800, 0x01c8, 0x2001, 0x0132, 0x200c, 0x2001,
-	0x0131, 0x2004, 0x9105, 0x1904, 0xdecd, 0x2009, 0x180c, 0x2104,
-	0xd0d4, 0x0904, 0xdecd, 0xc0d4, 0x200a, 0x2009, 0x0105, 0x2104,
-	0x9084, 0xe7fd, 0x9085, 0x0010, 0x200a, 0x2001, 0x1867, 0x2004,
-	0xd0e4, 0x1528, 0x603b, 0x0000, 0x080c, 0x963d, 0x6014, 0x0096,
-	0x2048, 0xa87c, 0xd0fc, 0x0188, 0x908c, 0x0003, 0x918e, 0x0002,
-	0x0508, 0x2001, 0x180c, 0x2004, 0xd0d4, 0x11e0, 0x080c, 0x97b9,
-	0x2009, 0x0041, 0x009e, 0x0804, 0xdf8d, 0x080c, 0x97b9, 0x6003,
-	0x0007, 0x601b, 0x0000, 0x080c, 0x86b2, 0x009e, 0x0005, 0x2001,
-	0x0100, 0x2004, 0x9082, 0x0005, 0x0aa8, 0x2001, 0x011f, 0x2004,
-	0x603a, 0x0890, 0x2001, 0x180c, 0x200c, 0xc1d4, 0x2102, 0xd1cc,
-	0x0110, 0x080c, 0x2c52, 0x080c, 0x97b9, 0x6014, 0x2048, 0xa97c,
-	0xd1ec, 0x1130, 0x080c, 0x86b2, 0x080c, 0xae61, 0x009e, 0x0005,
-	0x080c, 0xe7b3, 0x0db8, 0x009e, 0x0005, 0x2001, 0x180c, 0x200c,
-	0xc1d4, 0x2102, 0x0036, 0x080c, 0x963d, 0x080c, 0x97b9, 0x6014,
-	0x0096, 0x2048, 0x6010, 0x00b6, 0x2058, 0xb800, 0x00be, 0xd0bc,
-	0x0188, 0xa87c, 0x9084, 0x0003, 0x9086, 0x0002, 0x0140, 0xa8ac,
-	0x6330, 0x931a, 0x6332, 0xa8b0, 0x632c, 0x931b, 0x632e, 0x6003,
-	0x0002, 0x0080, 0x2019, 0x0004, 0x080c, 0xe551, 0x6018, 0x9005,
-	0x1128, 0x2001, 0x1987, 0x2004, 0x8003, 0x601a, 0x6017, 0x0000,
-	0x6003, 0x0007, 0x009e, 0x003e, 0x0005, 0x9182, 0x0040, 0x0002,
-	0xdf1c, 0xdf1c, 0xdf1c, 0xdf1c, 0xdf1c, 0xdf1c, 0xdf1c, 0xdf1c,
-	0xdf1e, 0xdf1c, 0xdf1c, 0xdf1c, 0xdf1c, 0xdf1c, 0xdf1c, 0xdf1c,
-	0xdf1c, 0xdf1c, 0xdf1c, 0xdf69, 0x080c, 0x0dd5, 0x6014, 0x0096,
-	0x2048, 0xa834, 0xaa38, 0x6110, 0x00b6, 0x2158, 0xb900, 0x00be,
-	0xd1bc, 0x1190, 0x920d, 0x1518, 0xa87c, 0xd0fc, 0x0128, 0x2009,
-	0x0041, 0x009e, 0x0804, 0xdf8d, 0x6003, 0x0007, 0x601b, 0x0000,
-	0x080c, 0x86b2, 0x009e, 0x0005, 0x6124, 0xd1f4, 0x1d58, 0x0006,
-	0x0046, 0xacac, 0x9422, 0xa9b0, 0x2200, 0x910b, 0x6030, 0x9420,
-	0x6432, 0x602c, 0x9109, 0x612e, 0x004e, 0x000e, 0x08d8, 0x6110,
-	0x00b6, 0x2158, 0xb900, 0x00be, 0xd1bc, 0x1178, 0x2009, 0x180e,
-	0x210c, 0xd19c, 0x0118, 0x6003, 0x0007, 0x0010, 0x6003, 0x0006,
-	0x00e9, 0x080c, 0x86b4, 0x009e, 0x0005, 0x6003, 0x0002, 0x009e,
-	0x0005, 0x6024, 0xd0f4, 0x0128, 0x080c, 0x15e5, 0x1904, 0xdf1e,
-	0x0005, 0x6014, 0x0096, 0x2048, 0xa834, 0xa938, 0x009e, 0x9105,
-	0x1120, 0x080c, 0x15e5, 0x1904, 0xdf1e, 0x0005, 0xd2fc, 0x0140,
-	0x8002, 0x8000, 0x8212, 0x9291, 0x0000, 0x2009, 0x0009, 0x0010,
-	0x2009, 0x0015, 0xaa9a, 0xa896, 0x0005, 0x9182, 0x0040, 0x0208,
-	0x0062, 0x9186, 0x0013, 0x0120, 0x9186, 0x0014, 0x190c, 0x0dd5,
-	0x6024, 0xd0dc, 0x090c, 0x0dd5, 0x0005, 0xdfb0, 0xdfbc, 0xdfc8,
-	0xdfd4, 0xdfb0, 0xdfb0, 0xdfb0, 0xdfb0, 0xdfb7, 0xdfb2, 0xdfb2,
-	0xdfb0, 0xdfb0, 0xdfb0, 0xdfb0, 0xdfb2, 0xdfb0, 0xdfb2, 0xdfb0,
-	0x080c, 0x0dd5, 0x6024, 0xd0dc, 0x090c, 0x0dd5, 0x0005, 0x6014,
-	0x9005, 0x190c, 0x0dd5, 0x0005, 0x6003, 0x0001, 0x6106, 0x080c,
-	0x90f0, 0x0126, 0x2091, 0x8000, 0x080c, 0x968d, 0x012e, 0x0005,
-	0x6003, 0x0001, 0x6106, 0x080c, 0x90f0, 0x0126, 0x2091, 0x8000,
-	0x080c, 0x968d, 0x012e, 0x0005, 0x6003, 0x0003, 0x6106, 0x2c10,
-	0x080c, 0x1bad, 0x0126, 0x2091, 0x8000, 0x080c, 0x9155, 0x080c,
-	0x97b9, 0x012e, 0x0005, 0x0126, 0x2091, 0x8000, 0x0036, 0x0096,
-	0x9182, 0x0040, 0x0023, 0x009e, 0x003e, 0x012e, 0x0005, 0xdfff,
-	0xe001, 0xe013, 0xe02d, 0xdfff, 0xdfff, 0xdfff, 0xdfff, 0xdfff,
-	0xdfff, 0xdfff, 0xdfff, 0xdfff, 0xdfff, 0xdfff, 0xdfff, 0x080c,
-	0x0dd5, 0x6014, 0x2048, 0xa87c, 0xd0fc, 0x01f8, 0x909c, 0x0003,
-	0x939e, 0x0003, 0x01d0, 0x6003, 0x0001, 0x6106, 0x080c, 0x90f0,
-	0x080c, 0x968d, 0x0470, 0x6014, 0x2048, 0xa87c, 0xd0fc, 0x0168,
-	0x909c, 0x0003, 0x939e, 0x0003, 0x0140, 0x6003, 0x0001, 0x6106,
-	0x080c, 0x90f0, 0x080c, 0x968d, 0x00e0, 0x901e, 0x6316, 0x631a,
-	0x2019, 0x0004, 0x080c, 0xe551, 0x00a0, 0x6014, 0x2048, 0xa87c,
-	0xd0fc, 0x0d98, 0x909c, 0x0003, 0x939e, 0x0003, 0x0d70, 0x6003,
-	0x0003, 0x6106, 0x2c10, 0x080c, 0x1bad, 0x080c, 0x9155, 0x080c,
-	0x97b9, 0x0005, 0x080c, 0x9588, 0x6114, 0x81ff, 0x0158, 0x0096,
-	0x2148, 0x080c, 0xe908, 0x0036, 0x2019, 0x0029, 0x080c, 0xe551,
-	0x003e, 0x009e, 0x080c, 0xae92, 0x080c, 0x968d, 0x0005, 0x080c,
-	0x963d, 0x6114, 0x81ff, 0x0158, 0x0096, 0x2148, 0x080c, 0xe908,
-	0x0036, 0x2019, 0x0029, 0x080c, 0xe551, 0x003e, 0x009e, 0x080c,
-	0xae92, 0x080c, 0x97b9, 0x0005, 0x9182, 0x0085, 0x0002, 0xe07e,
-	0xe07c, 0xe07c, 0xe08a, 0xe07c, 0xe07c, 0xe07c, 0xe07c, 0xe07c,
-	0xe07c, 0xe07c, 0xe07c, 0xe07c, 0x080c, 0x0dd5, 0x6003, 0x000b,
-	0x6106, 0x080c, 0x90f0, 0x0126, 0x2091, 0x8000, 0x080c, 0x968d,
-	0x012e, 0x0005, 0x0026, 0x00e6, 0x080c, 0xe7aa, 0x0118, 0x080c,
-	0xae61, 0x0450, 0x2071, 0x0260, 0x7224, 0x6216, 0x2001, 0x180e,
-	0x2004, 0xd0e4, 0x0150, 0x6010, 0x00b6, 0x2058, 0xbca0, 0x00be,
-	0x2c00, 0x2011, 0x014e, 0x080c, 0xb182, 0x7220, 0x080c, 0xe3f7,
-	0x0118, 0x6007, 0x0086, 0x0040, 0x6007, 0x0087, 0x7224, 0x9296,
-	0xffff, 0x1110, 0x6007, 0x0086, 0x6003, 0x0001, 0x080c, 0x90f0,
-	0x080c, 0x968d, 0x080c, 0x97b9, 0x00ee, 0x002e, 0x0005, 0x9186,
-	0x0013, 0x1160, 0x6004, 0x908a, 0x0085, 0x0a0c, 0x0dd5, 0x908a,
-	0x0092, 0x1a0c, 0x0dd5, 0x9082, 0x0085, 0x00a2, 0x9186, 0x0027,
-	0x0130, 0x9186, 0x0014, 0x0118, 0x080c, 0xaef7, 0x0050, 0x2001,
-	0x0007, 0x080c, 0x657b, 0x080c, 0x9588, 0x080c, 0xae92, 0x080c,
-	0x968d, 0x0005, 0xe0ef, 0xe0f1, 0xe0f1, 0xe0ef, 0xe0ef, 0xe0ef,
-	0xe0ef, 0xe0ef, 0xe0ef, 0xe0ef, 0xe0ef, 0xe0ef, 0xe0ef, 0x080c,
-	0x0dd5, 0x080c, 0x9588, 0x080c, 0xae92, 0x080c, 0x968d, 0x0005,
-	0x9182, 0x0085, 0x0a0c, 0x0dd5, 0x9182, 0x0092, 0x1a0c, 0x0dd5,
-	0x9182, 0x0085, 0x0002, 0xe110, 0xe110, 0xe110, 0xe112, 0xe110,
+	0x00ce, 0x003e, 0x002e, 0x001e, 0x000e, 0x0005, 0x0006, 0x0016,
+	0x0026, 0x0036, 0x00c6, 0x81ff, 0x11b8, 0x080c, 0x23c5, 0x20a1,
+	0x024c, 0x2001, 0x0014, 0x3518, 0x9312, 0x1218, 0x23a8, 0x4003,
+	0x0418, 0x20a8, 0x4003, 0x82ff, 0x01f8, 0x22a8, 0x8108, 0x080c,
+	0x23c5, 0x20a1, 0x0240, 0x0c98, 0x080c, 0x23c5, 0x2061, 0x19a2,
+	0x6004, 0x20a0, 0x6008, 0x3518, 0x9312, 0x1218, 0x23a8, 0x4003,
+	0x0058, 0x20a8, 0x4003, 0x82ff, 0x0138, 0x22a8, 0x8108, 0x080c,
+	0x23c5, 0x20a1, 0x0240, 0x0c98, 0x2061, 0x19a2, 0x2019, 0x0260,
+	0x3400, 0x931e, 0x0110, 0x6006, 0x0020, 0x2001, 0x0240, 0x6006,
+	0x8108, 0x2162, 0x9292, 0x0021, 0x9296, 0xffff, 0x620a, 0x00ce,
+	0x003e, 0x002e, 0x001e, 0x000e, 0x0005, 0x00b6, 0x0066, 0x6610,
+	0x2658, 0xbe04, 0x96b4, 0xff00, 0x8637, 0x9686, 0x0006, 0x0170,
+	0x9686, 0x0004, 0x0158, 0xbe04, 0x96b4, 0x00ff, 0x9686, 0x0006,
+	0x0128, 0x9686, 0x0004, 0x0110, 0x9085, 0x0001, 0x006e, 0x00be,
+	0x0005, 0x00d6, 0x080c, 0xd96d, 0x00de, 0x0005, 0x00d6, 0x080c,
+	0xd97a, 0x1520, 0x680c, 0x908c, 0xff00, 0x6820, 0x9084, 0x00ff,
+	0x9115, 0x6216, 0x6824, 0x602e, 0xd1e4, 0x0130, 0x9006, 0x080c,
+	0xe998, 0x2009, 0x0001, 0x0078, 0xd1ec, 0x0180, 0x6920, 0x918c,
+	0x00ff, 0x6824, 0x080c, 0x2840, 0x1148, 0x2001, 0x0001, 0x080c,
+	0xe998, 0x2110, 0x900e, 0x080c, 0x320a, 0x0018, 0x9085, 0x0001,
+	0x0008, 0x9006, 0x00de, 0x0005, 0x00b6, 0x00c6, 0x080c, 0xaebf,
+	0x05a8, 0x0016, 0x0026, 0x00c6, 0x2011, 0x0263, 0x2204, 0x8211,
+	0x220c, 0x080c, 0x2840, 0x1578, 0x080c, 0x65a7, 0x1560, 0xbe12,
+	0xbd16, 0x00ce, 0x002e, 0x001e, 0x2b00, 0x6012, 0x080c, 0xe7cb,
+	0x11d8, 0x080c, 0x32e5, 0x11c0, 0x080c, 0xd8d5, 0x0510, 0x2001,
+	0x0007, 0x080c, 0x6558, 0x2001, 0x0007, 0x080c, 0x6584, 0x6017,
+	0x0000, 0x6023, 0x0001, 0x6007, 0x0001, 0x6003, 0x0001, 0x080c,
+	0x9121, 0x080c, 0x9687, 0x0010, 0x080c, 0xae71, 0x9085, 0x0001,
+	0x00ce, 0x00be, 0x0005, 0x080c, 0xae71, 0x00ce, 0x002e, 0x001e,
+	0x0ca8, 0x080c, 0xae71, 0x9006, 0x0c98, 0x2069, 0x026d, 0x6800,
+	0x9082, 0x0010, 0x1228, 0x6017, 0x0000, 0x9085, 0x0001, 0x0008,
+	0x9006, 0x0005, 0x6017, 0x0000, 0x2069, 0x026c, 0x6808, 0x9084,
+	0xff00, 0x9086, 0x0800, 0x1190, 0x6904, 0x9186, 0x0018, 0x0118,
+	0x9186, 0x0014, 0x1158, 0x810f, 0x6800, 0x9084, 0x00ff, 0x910d,
+	0x615a, 0x908e, 0x0014, 0x0110, 0x908e, 0x0010, 0x0005, 0x6004,
+	0x90b2, 0x0053, 0x1a0c, 0x0dd5, 0x91b6, 0x0013, 0x1130, 0x2008,
+	0x91b2, 0x0040, 0x1a04, 0xdac4, 0x0092, 0x91b6, 0x0027, 0x0120,
+	0x91b6, 0x0014, 0x190c, 0x0dd5, 0x2001, 0x0007, 0x080c, 0x6584,
+	0x080c, 0x957b, 0x080c, 0xaea2, 0x080c, 0x9687, 0x0005, 0xd9f7,
+	0xd9f9, 0xd9f7, 0xd9f7, 0xd9f7, 0xd9f9, 0xda08, 0xdabd, 0xda5a,
+	0xdabd, 0xda6e, 0xdabd, 0xda08, 0xdabd, 0xdab5, 0xdabd, 0xdab5,
+	0xdabd, 0xdabd, 0xd9f7, 0xd9f7, 0xd9f7, 0xd9f7, 0xd9f7, 0xd9f7,
+	0xd9f7, 0xd9f7, 0xd9f7, 0xd9f7, 0xd9f7, 0xd9f9, 0xd9f7, 0xdabd,
+	0xd9f7, 0xd9f7, 0xdabd, 0xd9f7, 0xdaba, 0xdabd, 0xd9f7, 0xd9f7,
+	0xd9f7, 0xd9f7, 0xdabd, 0xdabd, 0xd9f7, 0xdabd, 0xdabd, 0xd9f7,
+	0xda03, 0xd9f7, 0xd9f7, 0xd9f7, 0xd9f7, 0xdab9, 0xdabd, 0xd9f7,
+	0xd9f7, 0xdabd, 0xdabd, 0xd9f7, 0xd9f7, 0xd9f7, 0xd9f7, 0x080c,
+	0x0dd5, 0x080c, 0x957b, 0x080c, 0xd262, 0x6003, 0x0002, 0x080c,
+	0x9687, 0x0804, 0xdac3, 0x9006, 0x080c, 0x6544, 0x0804, 0xdabd,
+	0x080c, 0x6973, 0x1904, 0xdabd, 0x9006, 0x080c, 0x6544, 0x6010,
+	0x2058, 0xb810, 0x9086, 0x00ff, 0x1140, 0x00f6, 0x2079, 0x1800,
+	0x78a8, 0x8000, 0x78aa, 0x00fe, 0x0428, 0x6010, 0x2058, 0xb8c0,
+	0x9005, 0x1178, 0x080c, 0xd24a, 0x1904, 0xdabd, 0x0036, 0x0046,
+	0xbba0, 0x2021, 0x0007, 0x080c, 0x4ccb, 0x004e, 0x003e, 0x0804,
+	0xdabd, 0x080c, 0x3316, 0x1904, 0xdabd, 0x2001, 0x1800, 0x2004,
+	0x9086, 0x0002, 0x1138, 0x00f6, 0x2079, 0x1800, 0x78a8, 0x8000,
+	0x78aa, 0x00fe, 0x2001, 0x0002, 0x080c, 0x6558, 0x080c, 0x957b,
+	0x6023, 0x0001, 0x6003, 0x0001, 0x6007, 0x0002, 0x080c, 0x9121,
+	0x080c, 0x9687, 0x6110, 0x2158, 0x2009, 0x0001, 0x080c, 0x84ea,
+	0x0804, 0xdac3, 0x6610, 0x2658, 0xbe04, 0x96b4, 0xff00, 0x8637,
+	0x9686, 0x0006, 0x0904, 0xdabd, 0x9686, 0x0004, 0x0904, 0xdabd,
+	0x080c, 0x8ca4, 0x2001, 0x0004, 0x0804, 0xdabb, 0x2001, 0x1800,
+	0x2004, 0x9086, 0x0003, 0x1158, 0x0036, 0x0046, 0x6010, 0x2058,
+	0xbba0, 0x2021, 0x0006, 0x080c, 0x4ccb, 0x004e, 0x003e, 0x2001,
+	0x0006, 0x080c, 0xdae1, 0x6610, 0x2658, 0xbe04, 0x0066, 0x96b4,
+	0xff00, 0x8637, 0x9686, 0x0006, 0x006e, 0x0168, 0x2001, 0x0006,
+	0x080c, 0x6584, 0x9284, 0x00ff, 0x908e, 0x0007, 0x1120, 0x2001,
+	0x0006, 0x080c, 0x6558, 0x080c, 0x6973, 0x11f8, 0x2001, 0x1837,
+	0x2004, 0xd0a4, 0x01d0, 0xbe04, 0x96b4, 0x00ff, 0x9686, 0x0006,
+	0x01a0, 0x00f6, 0x2079, 0x1800, 0x78a8, 0x8000, 0x78aa, 0x00fe,
+	0x0804, 0xda42, 0x2001, 0x0004, 0x0030, 0x2001, 0x0006, 0x0449,
+	0x0020, 0x0018, 0x0010, 0x080c, 0x6584, 0x080c, 0x957b, 0x080c,
+	0xae71, 0x080c, 0x9687, 0x0005, 0x2600, 0x0002, 0xdad8, 0xdad8,
+	0xdad8, 0xdad8, 0xdad8, 0xdada, 0xdad8, 0xdada, 0xdad8, 0xdad8,
+	0xdada, 0xdad8, 0xdad8, 0xdad8, 0xdada, 0xdada, 0xdada, 0xdada,
+	0x080c, 0x0dd5, 0x080c, 0x957b, 0x080c, 0xae71, 0x080c, 0x9687,
+	0x0005, 0x0016, 0x00b6, 0x00d6, 0x6110, 0x2158, 0xb900, 0xd184,
+	0x0138, 0x080c, 0x6558, 0x9006, 0x080c, 0x6544, 0x080c, 0x31ea,
+	0x00de, 0x00be, 0x001e, 0x0005, 0x6610, 0x2658, 0xb804, 0x9084,
+	0xff00, 0x8007, 0x90b2, 0x000c, 0x1a0c, 0x0dd5, 0x91b6, 0x0015,
+	0x1110, 0x003b, 0x0028, 0x91b6, 0x0016, 0x190c, 0x0dd5, 0x006b,
+	0x0005, 0xb90d, 0xb90d, 0xb90d, 0xb90d, 0xdb76, 0xb90d, 0xdb60,
+	0xdb21, 0xb90d, 0xb90d, 0xb90d, 0xb90d, 0xb90d, 0xb90d, 0xb90d,
+	0xb90d, 0xdb76, 0xb90d, 0xdb60, 0xdb67, 0xb90d, 0xb90d, 0xb90d,
+	0xb90d, 0x00f6, 0x080c, 0x6973, 0x11d8, 0x080c, 0xd24a, 0x11c0,
+	0x6010, 0x905d, 0x01a8, 0xb8c0, 0x9005, 0x0190, 0x9006, 0x080c,
+	0x6544, 0x2001, 0x0002, 0x080c, 0x6558, 0x6023, 0x0001, 0x6003,
+	0x0001, 0x6007, 0x0002, 0x080c, 0x9121, 0x080c, 0x9687, 0x00f0,
+	0x2011, 0x0263, 0x2204, 0x8211, 0x220c, 0x080c, 0x2840, 0x11b0,
+	0x080c, 0x6608, 0x0118, 0x080c, 0xae71, 0x0080, 0xb810, 0x0006,
+	0xb814, 0x0006, 0xb8c0, 0x0006, 0x080c, 0x603d, 0x000e, 0xb8c2,
+	0x000e, 0xb816, 0x000e, 0xb812, 0x080c, 0xae71, 0x00fe, 0x0005,
+	0x6604, 0x96b6, 0x001e, 0x1110, 0x080c, 0xae71, 0x0005, 0x080c,
+	0xbc98, 0x1148, 0x6003, 0x0001, 0x6007, 0x0001, 0x080c, 0x9121,
+	0x080c, 0x9687, 0x0010, 0x080c, 0xae71, 0x0005, 0x0804, 0xae71,
+	0x6004, 0x908a, 0x0053, 0x1a0c, 0x0dd5, 0x080c, 0x957b, 0x080c,
+	0xaea2, 0x080c, 0x9687, 0x0005, 0x9182, 0x0040, 0x0002, 0xdb9a,
+	0xdb9a, 0xdb9a, 0xdb9a, 0xdb9c, 0xdb9a, 0xdb9a, 0xdb9a, 0xdb9a,
+	0xdb9a, 0xdb9a, 0xdb9a, 0xdb9a, 0xdb9a, 0xdb9a, 0xdb9a, 0xdb9a,
+	0xdb9a, 0xdb9a, 0x080c, 0x0dd5, 0x0096, 0x00b6, 0x00d6, 0x00e6,
+	0x00f6, 0x0046, 0x0026, 0x6210, 0x2258, 0xb8bc, 0x9005, 0x11a8,
+	0x6106, 0x2071, 0x0260, 0x7444, 0x94a4, 0xff00, 0x0904, 0xdc02,
+	0x080c, 0xe98c, 0x1170, 0x9486, 0x2000, 0x1158, 0x2009, 0x0001,
+	0x2011, 0x0200, 0x080c, 0x86c6, 0x0020, 0x9026, 0x080c, 0xe810,
+	0x0c38, 0x080c, 0x0fff, 0x090c, 0x0dd5, 0x6003, 0x0007, 0xa867,
+	0x010d, 0x9006, 0xa802, 0xa86a, 0xac8a, 0x2c00, 0xa88e, 0x6008,
+	0xa8e2, 0x6010, 0x2058, 0xb8a0, 0x7130, 0xa97a, 0x0016, 0xa876,
+	0xa87f, 0x0000, 0xa883, 0x0000, 0xa887, 0x0036, 0x080c, 0x6c86,
+	0x001e, 0x080c, 0xe98c, 0x1904, 0xdc62, 0x9486, 0x2000, 0x1130,
+	0x2019, 0x0017, 0x080c, 0xe543, 0x0804, 0xdc62, 0x9486, 0x0200,
+	0x1120, 0x080c, 0xe4df, 0x0804, 0xdc62, 0x9486, 0x0400, 0x0120,
+	0x9486, 0x1000, 0x1904, 0xdc62, 0x2019, 0x0002, 0x080c, 0xe4fa,
+	0x0804, 0xdc62, 0x2069, 0x1a70, 0x6a00, 0xd284, 0x0904, 0xdccc,
+	0x9284, 0x0300, 0x1904, 0xdcc5, 0x6804, 0x9005, 0x0904, 0xdcad,
+	0x2d78, 0x6003, 0x0007, 0x080c, 0x1018, 0x0904, 0xdc6e, 0x7800,
+	0xd08c, 0x1118, 0x7804, 0x8001, 0x7806, 0x6017, 0x0000, 0x2001,
+	0x180f, 0x2004, 0xd084, 0x1904, 0xdcd0, 0x9006, 0xa802, 0xa867,
+	0x0116, 0xa86a, 0x6008, 0xa8e2, 0x2c00, 0xa87a, 0x6010, 0x2058,
+	0xb8a0, 0x7130, 0xa9b6, 0xa876, 0xb928, 0xa9ba, 0xb92c, 0xa9be,
+	0xb930, 0xa9c2, 0xb934, 0xa9c6, 0xa883, 0x003d, 0x7044, 0x9084,
+	0x0003, 0x9080, 0xdc6a, 0x2005, 0xa87e, 0x20a9, 0x000a, 0x2001,
+	0x0270, 0xaa5c, 0x9290, 0x0021, 0x2009, 0x0205, 0x200b, 0x0080,
+	0x20e1, 0x0000, 0xab60, 0x23e8, 0x2098, 0x22a0, 0x4003, 0x200b,
+	0x0000, 0x2001, 0x027a, 0x200c, 0xa9b2, 0x8000, 0x200c, 0xa9ae,
+	0x080c, 0x6c86, 0x002e, 0x004e, 0x00fe, 0x00ee, 0x00de, 0x00be,
+	0x009e, 0x0005, 0x0000, 0x0080, 0x0040, 0x0000, 0x2001, 0x1810,
+	0x2004, 0xd084, 0x0120, 0x080c, 0x0fff, 0x1904, 0xdc17, 0x6017,
+	0xf100, 0x6003, 0x0001, 0x6007, 0x0041, 0x080c, 0x90d9, 0x080c,
+	0x9687, 0x0c00, 0x2069, 0x0260, 0x6848, 0x9084, 0xff00, 0x9086,
+	0x1200, 0x1198, 0x686c, 0x9084, 0x00ff, 0x0016, 0x6114, 0x918c,
+	0xf700, 0x910d, 0x6116, 0x001e, 0x6003, 0x0001, 0x6007, 0x0043,
+	0x080c, 0x90d9, 0x080c, 0x9687, 0x0828, 0x6868, 0x602e, 0x686c,
+	0x6032, 0x6017, 0xf200, 0x6003, 0x0001, 0x6007, 0x0041, 0x080c,
+	0x90d9, 0x080c, 0x9687, 0x0804, 0xdc62, 0x2001, 0x180e, 0x2004,
+	0xd0ec, 0x0120, 0x2011, 0x8049, 0x080c, 0x4b14, 0x6017, 0xf300,
+	0x0010, 0x6017, 0xf100, 0x6003, 0x0001, 0x6007, 0x0041, 0x080c,
+	0x90d9, 0x080c, 0x9687, 0x0804, 0xdc62, 0x6017, 0xf500, 0x0c98,
+	0x6017, 0xf600, 0x0804, 0xdc82, 0x6017, 0xf200, 0x0804, 0xdc82,
+	0xa867, 0x0146, 0xa86b, 0x0000, 0x6008, 0xa886, 0x2c00, 0xa87a,
+	0x7044, 0x9084, 0x0003, 0x9080, 0xdc6a, 0x2005, 0xa87e, 0x2928,
+	0x6010, 0x2058, 0xb8a0, 0xa876, 0xb828, 0xa88a, 0xb82c, 0xa88e,
+	0xb830, 0xa892, 0xb834, 0xa896, 0xa883, 0x003d, 0x2009, 0x0205,
+	0x2104, 0x9085, 0x0080, 0x200a, 0x20e1, 0x0000, 0x2011, 0x0210,
+	0x2214, 0x9294, 0x0fff, 0xaaa2, 0x9282, 0x0111, 0x1a0c, 0x0dd5,
+	0x8210, 0x821c, 0x2001, 0x026c, 0x2098, 0xa860, 0x20e8, 0xa85c,
+	0x9080, 0x0029, 0x20a0, 0x2011, 0xdd4c, 0x2041, 0x0001, 0x223d,
+	0x9784, 0x00ff, 0x9322, 0x1208, 0x2300, 0x20a8, 0x4003, 0x931a,
+	0x0530, 0x8210, 0xd7fc, 0x1130, 0x8d68, 0x2d0a, 0x2001, 0x0260,
+	0x2098, 0x0c68, 0x2950, 0x080c, 0x1018, 0x0170, 0x2900, 0xb002,
+	0xa867, 0x0147, 0xa86b, 0x0000, 0xa860, 0x20e8, 0xa85c, 0x9080,
+	0x001b, 0x20a0, 0x8840, 0x08d8, 0x2548, 0xa800, 0x902d, 0x0118,
+	0x080c, 0x1031, 0x0cc8, 0x080c, 0x1031, 0x0804, 0xdc6e, 0x2548,
+	0x8847, 0x9885, 0x0046, 0xa866, 0x2009, 0x0205, 0x200b, 0x0000,
+	0x080c, 0xe572, 0x0804, 0xdc62, 0x8010, 0x0004, 0x801a, 0x0006,
+	0x8018, 0x0008, 0x8016, 0x000a, 0x8014, 0x9186, 0x0013, 0x1160,
+	0x6004, 0x908a, 0x0054, 0x1a0c, 0x0dd5, 0x9082, 0x0040, 0x0a0c,
+	0x0dd5, 0x2008, 0x0804, 0xddfd, 0x9186, 0x0051, 0x0108, 0x00c0,
+	0x2001, 0x0109, 0x2004, 0xd084, 0x0904, 0xddae, 0x0126, 0x2091,
+	0x2800, 0x0006, 0x0016, 0x0026, 0x080c, 0x8fbe, 0x002e, 0x001e,
+	0x000e, 0x012e, 0x6000, 0x9086, 0x0002, 0x1580, 0x0804, 0xde45,
+	0x9186, 0x0027, 0x0530, 0x9186, 0x0048, 0x0128, 0x9186, 0x0014,
+	0x0500, 0x190c, 0x0dd5, 0x2001, 0x0109, 0x2004, 0xd084, 0x01f0,
+	0x00c6, 0x0126, 0x2091, 0x2800, 0x00c6, 0x2061, 0x0100, 0x0006,
+	0x0016, 0x0026, 0x080c, 0x8fbe, 0x002e, 0x001e, 0x000e, 0x00ce,
+	0x012e, 0x00ce, 0x6000, 0x9086, 0x0004, 0x190c, 0x0dd5, 0x0804,
+	0xdf26, 0x6004, 0x9082, 0x0040, 0x2008, 0x001a, 0x080c, 0xaf07,
+	0x0005, 0xddc4, 0xddc6, 0xddc6, 0xdded, 0xddc4, 0xddc4, 0xddc4,
+	0xddc4, 0xddc4, 0xddc4, 0xddc4, 0xddc4, 0xddc4, 0xddc4, 0xddc4,
+	0xddc4, 0xddc4, 0xddc4, 0xddc4, 0x080c, 0x0dd5, 0x080c, 0x957b,
+	0x080c, 0x9687, 0x0036, 0x0096, 0x6014, 0x904d, 0x01d8, 0x080c,
+	0xcb4a, 0x01c0, 0x6003, 0x0002, 0x6010, 0x00b6, 0x2058, 0xb800,
+	0x00be, 0xd0bc, 0x1178, 0x2019, 0x0004, 0x080c, 0xe572, 0x6017,
+	0x0000, 0x6018, 0x9005, 0x1120, 0x2001, 0x1986, 0x2004, 0x601a,
+	0x6003, 0x0007, 0x009e, 0x003e, 0x0005, 0x0096, 0x080c, 0x957b,
+	0x080c, 0x9687, 0x080c, 0xcb4a, 0x0120, 0x6014, 0x2048, 0x080c,
+	0x1031, 0x080c, 0xaea2, 0x009e, 0x0005, 0x0002, 0xde11, 0xde28,
+	0xde13, 0xde3f, 0xde11, 0xde11, 0xde11, 0xde11, 0xde11, 0xde11,
+	0xde11, 0xde11, 0xde11, 0xde11, 0xde11, 0xde11, 0xde11, 0xde11,
+	0xde11, 0x080c, 0x0dd5, 0x0096, 0x080c, 0x957b, 0x6014, 0x2048,
+	0xa87c, 0xd0b4, 0x0138, 0x6003, 0x0007, 0x2009, 0x0043, 0x080c,
+	0xaeec, 0x0010, 0x6003, 0x0004, 0x080c, 0x9687, 0x009e, 0x0005,
+	0x080c, 0x957b, 0x080c, 0xcb4a, 0x0138, 0x6114, 0x0096, 0x2148,
+	0xa97c, 0x009e, 0xd1ec, 0x1138, 0x080c, 0x869b, 0x080c, 0xae71,
+	0x080c, 0x9687, 0x0005, 0x080c, 0xe7d4, 0x0db0, 0x0cc8, 0x080c,
+	0x957b, 0x2009, 0x0041, 0x0804, 0xdfae, 0x9182, 0x0040, 0x0002,
+	0xde5b, 0xde5d, 0xde5b, 0xde5b, 0xde5b, 0xde5b, 0xde5b, 0xde5b,
+	0xde5b, 0xde5b, 0xde5b, 0xde5b, 0xde5b, 0xde5b, 0xde5b, 0xde5b,
+	0xde5b, 0xde5e, 0xde5b, 0x080c, 0x0dd5, 0x0005, 0x00d6, 0x080c,
+	0x869b, 0x00de, 0x080c, 0xe82c, 0x080c, 0xae71, 0x0005, 0x9182,
+	0x0040, 0x0002, 0xde7d, 0xde7d, 0xde7d, 0xde7d, 0xde7d, 0xde7d,
+	0xde7d, 0xde7d, 0xde7d, 0xde7f, 0xdeee, 0xde7d, 0xde7d, 0xde7d,
+	0xde7d, 0xdeee, 0xde7d, 0xde7d, 0xde7d, 0x080c, 0x0dd5, 0x2001,
+	0x0105, 0x2004, 0x9084, 0x1800, 0x01c8, 0x2001, 0x0132, 0x200c,
+	0x2001, 0x0131, 0x2004, 0x9105, 0x1904, 0xdeee, 0x2009, 0x180c,
+	0x2104, 0xd0d4, 0x0904, 0xdeee, 0xc0d4, 0x200a, 0x2009, 0x0105,
+	0x2104, 0x9084, 0xe7fd, 0x9085, 0x0010, 0x200a, 0x2001, 0x1867,
+	0x2004, 0xd0e4, 0x1528, 0x603b, 0x0000, 0x080c, 0x9637, 0x6014,
+	0x0096, 0x2048, 0xa87c, 0xd0fc, 0x0188, 0x908c, 0x0003, 0x918e,
+	0x0002, 0x0508, 0x2001, 0x180c, 0x2004, 0xd0d4, 0x11e0, 0x080c,
+	0x97b5, 0x2009, 0x0041, 0x009e, 0x0804, 0xdfae, 0x080c, 0x97b5,
+	0x6003, 0x0007, 0x601b, 0x0000, 0x080c, 0x869b, 0x009e, 0x0005,
+	0x2001, 0x0100, 0x2004, 0x9082, 0x0005, 0x0aa8, 0x2001, 0x011f,
+	0x2004, 0x603a, 0x0890, 0x2001, 0x180c, 0x200c, 0xc1d4, 0x2102,
+	0xd1cc, 0x0110, 0x080c, 0x2c54, 0x080c, 0x97b5, 0x6014, 0x2048,
+	0xa97c, 0xd1ec, 0x1130, 0x080c, 0x869b, 0x080c, 0xae71, 0x009e,
+	0x0005, 0x080c, 0xe7d4, 0x0db8, 0x009e, 0x0005, 0x2001, 0x180c,
+	0x200c, 0xc1d4, 0x2102, 0x0036, 0x080c, 0x9637, 0x080c, 0x97b5,
+	0x6014, 0x0096, 0x2048, 0x6010, 0x00b6, 0x2058, 0xb800, 0x00be,
+	0xd0bc, 0x0188, 0xa87c, 0x9084, 0x0003, 0x9086, 0x0002, 0x0140,
+	0xa8ac, 0x6330, 0x931a, 0x6332, 0xa8b0, 0x632c, 0x931b, 0x632e,
+	0x6003, 0x0002, 0x0080, 0x2019, 0x0004, 0x080c, 0xe572, 0x6018,
+	0x9005, 0x1128, 0x2001, 0x1986, 0x2004, 0x8003, 0x601a, 0x6017,
+	0x0000, 0x6003, 0x0007, 0x009e, 0x003e, 0x0005, 0x9182, 0x0040,
+	0x0002, 0xdf3d, 0xdf3d, 0xdf3d, 0xdf3d, 0xdf3d, 0xdf3d, 0xdf3d,
+	0xdf3d, 0xdf3f, 0xdf3d, 0xdf3d, 0xdf3d, 0xdf3d, 0xdf3d, 0xdf3d,
+	0xdf3d, 0xdf3d, 0xdf3d, 0xdf3d, 0xdf8a, 0x080c, 0x0dd5, 0x6014,
+	0x0096, 0x2048, 0xa834, 0xaa38, 0x6110, 0x00b6, 0x2158, 0xb900,
+	0x00be, 0xd1bc, 0x1190, 0x920d, 0x1518, 0xa87c, 0xd0fc, 0x0128,
+	0x2009, 0x0041, 0x009e, 0x0804, 0xdfae, 0x6003, 0x0007, 0x601b,
+	0x0000, 0x080c, 0x869b, 0x009e, 0x0005, 0x6124, 0xd1f4, 0x1d58,
+	0x0006, 0x0046, 0xacac, 0x9422, 0xa9b0, 0x2200, 0x910b, 0x6030,
+	0x9420, 0x6432, 0x602c, 0x9109, 0x612e, 0x004e, 0x000e, 0x08d8,
+	0x6110, 0x00b6, 0x2158, 0xb900, 0x00be, 0xd1bc, 0x1178, 0x2009,
+	0x180e, 0x210c, 0xd19c, 0x0118, 0x6003, 0x0007, 0x0010, 0x6003,
+	0x0006, 0x00e9, 0x080c, 0x869d, 0x009e, 0x0005, 0x6003, 0x0002,
+	0x009e, 0x0005, 0x6024, 0xd0f4, 0x0128, 0x080c, 0x15e7, 0x1904,
+	0xdf3f, 0x0005, 0x6014, 0x0096, 0x2048, 0xa834, 0xa938, 0x009e,
+	0x9105, 0x1120, 0x080c, 0x15e7, 0x1904, 0xdf3f, 0x0005, 0xd2fc,
+	0x0140, 0x8002, 0x8000, 0x8212, 0x9291, 0x0000, 0x2009, 0x0009,
+	0x0010, 0x2009, 0x0015, 0xaa9a, 0xa896, 0x0005, 0x9182, 0x0040,
+	0x0208, 0x0062, 0x9186, 0x0013, 0x0120, 0x9186, 0x0014, 0x190c,
+	0x0dd5, 0x6024, 0xd0dc, 0x090c, 0x0dd5, 0x0005, 0xdfd1, 0xdfdd,
+	0xdfe9, 0xdff5, 0xdfd1, 0xdfd1, 0xdfd1, 0xdfd1, 0xdfd8, 0xdfd3,
+	0xdfd3, 0xdfd1, 0xdfd1, 0xdfd1, 0xdfd1, 0xdfd3, 0xdfd1, 0xdfd3,
+	0xdfd1, 0x080c, 0x0dd5, 0x6024, 0xd0dc, 0x090c, 0x0dd5, 0x0005,
+	0x6014, 0x9005, 0x190c, 0x0dd5, 0x0005, 0x6003, 0x0001, 0x6106,
+	0x080c, 0x90d9, 0x0126, 0x2091, 0x8000, 0x080c, 0x9687, 0x012e,
+	0x0005, 0x6003, 0x0001, 0x6106, 0x080c, 0x90d9, 0x0126, 0x2091,
+	0x8000, 0x080c, 0x9687, 0x012e, 0x0005, 0x6003, 0x0003, 0x6106,
+	0x2c10, 0x080c, 0x1baf, 0x0126, 0x2091, 0x8000, 0x080c, 0x913e,
+	0x080c, 0x97b5, 0x012e, 0x0005, 0x0126, 0x2091, 0x8000, 0x0036,
+	0x0096, 0x9182, 0x0040, 0x0023, 0x009e, 0x003e, 0x012e, 0x0005,
+	0xe020, 0xe022, 0xe034, 0xe04e, 0xe020, 0xe020, 0xe020, 0xe020,
+	0xe020, 0xe020, 0xe020, 0xe020, 0xe020, 0xe020, 0xe020, 0xe020,
+	0x080c, 0x0dd5, 0x6014, 0x2048, 0xa87c, 0xd0fc, 0x01f8, 0x909c,
+	0x0003, 0x939e, 0x0003, 0x01d0, 0x6003, 0x0001, 0x6106, 0x080c,
+	0x90d9, 0x080c, 0x9687, 0x0470, 0x6014, 0x2048, 0xa87c, 0xd0fc,
+	0x0168, 0x909c, 0x0003, 0x939e, 0x0003, 0x0140, 0x6003, 0x0001,
+	0x6106, 0x080c, 0x90d9, 0x080c, 0x9687, 0x00e0, 0x901e, 0x6316,
+	0x631a, 0x2019, 0x0004, 0x080c, 0xe572, 0x00a0, 0x6014, 0x2048,
+	0xa87c, 0xd0fc, 0x0d98, 0x909c, 0x0003, 0x939e, 0x0003, 0x0d70,
+	0x6003, 0x0003, 0x6106, 0x2c10, 0x080c, 0x1baf, 0x080c, 0x913e,
+	0x080c, 0x97b5, 0x0005, 0x080c, 0x957b, 0x6114, 0x81ff, 0x0158,
+	0x0096, 0x2148, 0x080c, 0xe929, 0x0036, 0x2019, 0x0029, 0x080c,
+	0xe572, 0x003e, 0x009e, 0x080c, 0xaea2, 0x080c, 0x9687, 0x0005,
+	0x080c, 0x9637, 0x6114, 0x81ff, 0x0158, 0x0096, 0x2148, 0x080c,
+	0xe929, 0x0036, 0x2019, 0x0029, 0x080c, 0xe572, 0x003e, 0x009e,
+	0x080c, 0xaea2, 0x080c, 0x97b5, 0x0005, 0x9182, 0x0085, 0x0002,
+	0xe09f, 0xe09d, 0xe09d, 0xe0ab, 0xe09d, 0xe09d, 0xe09d, 0xe09d,
+	0xe09d, 0xe09d, 0xe09d, 0xe09d, 0xe09d, 0x080c, 0x0dd5, 0x6003,
+	0x000b, 0x6106, 0x080c, 0x90d9, 0x0126, 0x2091, 0x8000, 0x080c,
+	0x9687, 0x012e, 0x0005, 0x0026, 0x00e6, 0x080c, 0xe7cb, 0x0118,
+	0x080c, 0xae71, 0x0450, 0x2071, 0x0260, 0x7224, 0x6216, 0x2001,
+	0x180e, 0x2004, 0xd0e4, 0x0150, 0x6010, 0x00b6, 0x2058, 0xbca0,
+	0x00be, 0x2c00, 0x2011, 0x014e, 0x080c, 0xb192, 0x7220, 0x080c,
+	0xe418, 0x0118, 0x6007, 0x0086, 0x0040, 0x6007, 0x0087, 0x7224,
+	0x9296, 0xffff, 0x1110, 0x6007, 0x0086, 0x6003, 0x0001, 0x080c,
+	0x90d9, 0x080c, 0x9687, 0x080c, 0x97b5, 0x00ee, 0x002e, 0x0005,
+	0x9186, 0x0013, 0x1160, 0x6004, 0x908a, 0x0085, 0x0a0c, 0x0dd5,
+	0x908a, 0x0092, 0x1a0c, 0x0dd5, 0x9082, 0x0085, 0x00a2, 0x9186,
+	0x0027, 0x0130, 0x9186, 0x0014, 0x0118, 0x080c, 0xaf07, 0x0050,
+	0x2001, 0x0007, 0x080c, 0x6584, 0x080c, 0x957b, 0x080c, 0xaea2,
+	0x080c, 0x9687, 0x0005, 0xe110, 0xe112, 0xe112, 0xe110, 0xe110,
 	0xe110, 0xe110, 0xe110, 0xe110, 0xe110, 0xe110, 0xe110, 0xe110,
-	0x080c, 0x0dd5, 0x0005, 0x9186, 0x0013, 0x0148, 0x9186, 0x0014,
-	0x0130, 0x9186, 0x0027, 0x0118, 0x080c, 0xaef7, 0x0030, 0x080c,
-	0x9588, 0x080c, 0xae92, 0x080c, 0x968d, 0x0005, 0x0036, 0x080c,
-	0xe80b, 0x6043, 0x0000, 0x2019, 0x000b, 0x0031, 0x6023, 0x0006,
-	0x6003, 0x0007, 0x003e, 0x0005, 0x0126, 0x0036, 0x2091, 0x8000,
-	0x0086, 0x2c40, 0x0096, 0x904e, 0x080c, 0xa69c, 0x009e, 0x008e,
-	0x1550, 0x0076, 0x2c38, 0x080c, 0xa747, 0x007e, 0x1520, 0x6000,
-	0x9086, 0x0000, 0x0500, 0x6020, 0x9086, 0x0007, 0x01e0, 0x0096,
-	0x601c, 0xd084, 0x0140, 0x080c, 0xe80b, 0x080c, 0xd248, 0x080c,
-	0x1a5e, 0x6023, 0x0007, 0x6014, 0x2048, 0x080c, 0xcb35, 0x0110,
-	0x080c, 0xe551, 0x009e, 0x6017, 0x0000, 0x080c, 0xe80b, 0x6023,
-	0x0007, 0x080c, 0xd248, 0x003e, 0x012e, 0x0005, 0x00f6, 0x00c6,
-	0x00b6, 0x0036, 0x0156, 0x2079, 0x0260, 0x7938, 0x783c, 0x080c,
-	0x283e, 0x15c8, 0x0016, 0x00c6, 0x080c, 0x65ff, 0x1590, 0x001e,
-	0x00c6, 0x2160, 0x080c, 0xd245, 0x00ce, 0x002e, 0x0026, 0x0016,
-	0x2019, 0x0029, 0x080c, 0xa808, 0x080c, 0x928b, 0x0076, 0x903e,
-	0x080c, 0x9168, 0x007e, 0x001e, 0x0076, 0x903e, 0x080c, 0xe2eb,
-	0x007e, 0x0026, 0xba04, 0x9294, 0xff00, 0x8217, 0x9286, 0x0006,
-	0x0118, 0x9286, 0x0004, 0x1118, 0xbaa0, 0x080c, 0x327d, 0x002e,
-	0xbcc0, 0x001e, 0x080c, 0x6034, 0xbe12, 0xbd16, 0xbcc2, 0x9006,
-	0x0010, 0x00ce, 0x001e, 0x015e, 0x003e, 0x00be, 0x00ce, 0x00fe,
-	0x0005, 0x00c6, 0x00d6, 0x00b6, 0x0016, 0x2009, 0x1824, 0x2104,
-	0x9086, 0x0074, 0x1904, 0xe212, 0x2069, 0x0260, 0x6944, 0x9182,
-	0x0100, 0x06e0, 0x6940, 0x9184, 0x8000, 0x0904, 0xe20f, 0x2001,
-	0x197c, 0x2004, 0x9005, 0x1140, 0x6010, 0x2058, 0xb8c0, 0x9005,
-	0x0118, 0x9184, 0x0800, 0x0598, 0x6948, 0x918a, 0x0001, 0x0648,
-	0x080c, 0xe970, 0x0118, 0x6978, 0xd1fc, 0x11b8, 0x2009, 0x0205,
-	0x200b, 0x0001, 0x693c, 0x81ff, 0x1198, 0x6944, 0x9182, 0x0100,
-	0x02a8, 0x6940, 0x81ff, 0x1178, 0x6948, 0x918a, 0x0001, 0x0288,
-	0x6950, 0x918a, 0x0001, 0x0298, 0x00d0, 0x6017, 0x0100, 0x00a0,
-	0x6017, 0x0300, 0x0088, 0x6017, 0x0500, 0x0070, 0x6017, 0x0700,
-	0x0058, 0x6017, 0x0900, 0x0040, 0x6017, 0x0b00, 0x0028, 0x6017,
-	0x0f00, 0x0010, 0x6017, 0x2d00, 0x9085, 0x0001, 0x0008, 0x9006,
-	0x001e, 0x00be, 0x00de, 0x00ce, 0x0005, 0x00c6, 0x00b6, 0x0026,
-	0x0036, 0x0156, 0x6210, 0x2258, 0xbb04, 0x9394, 0x00ff, 0x9286,
-	0x0006, 0x0180, 0x9286, 0x0004, 0x0168, 0x9394, 0xff00, 0x8217,
-	0x9286, 0x0006, 0x0138, 0x9286, 0x0004, 0x0120, 0x080c, 0x660e,
-	0x0804, 0xe27a, 0x2011, 0x0276, 0x20a9, 0x0004, 0x0096, 0x2b48,
-	0x2019, 0x000a, 0x080c, 0xbe1d, 0x009e, 0x15a8, 0x2011, 0x027a,
-	0x20a9, 0x0004, 0x0096, 0x2b48, 0x2019, 0x0006, 0x080c, 0xbe1d,
-	0x009e, 0x1548, 0x0046, 0x0016, 0xbaa0, 0x2220, 0x9006, 0x2009,
-	0x1848, 0x210c, 0xd1a4, 0x0138, 0x2009, 0x0029, 0x080c, 0xe5ae,
-	0xb800, 0xc0e5, 0xb802, 0x2019, 0x0029, 0x080c, 0x928b, 0x0076,
-	0x2039, 0x0000, 0x080c, 0x9168, 0x2c08, 0x080c, 0xe2eb, 0x007e,
-	0x2001, 0x0007, 0x080c, 0x657b, 0x2001, 0x0007, 0x080c, 0x654f,
-	0x001e, 0x004e, 0x9006, 0x015e, 0x003e, 0x002e, 0x00be, 0x00ce,
-	0x0005, 0x00d6, 0x2069, 0x026e, 0x6800, 0x9086, 0x0800, 0x0118,
-	0x6017, 0x0000, 0x0008, 0x9006, 0x00de, 0x0005, 0x00b6, 0x00f6,
-	0x0016, 0x0026, 0x0036, 0x0156, 0x2079, 0x026c, 0x7930, 0x7834,
-	0x080c, 0x283e, 0x11d0, 0x080c, 0x65ff, 0x11b8, 0x2011, 0x0270,
-	0x20a9, 0x0004, 0x0096, 0x2b48, 0x2019, 0x000a, 0x080c, 0xbe1d,
-	0x009e, 0x1158, 0x2011, 0x0274, 0x20a9, 0x0004, 0x0096, 0x2b48,
-	0x2019, 0x0006, 0x080c, 0xbe1d, 0x009e, 0x015e, 0x003e, 0x002e,
-	0x001e, 0x00fe, 0x00be, 0x0005, 0x00b6, 0x0006, 0x0016, 0x0026,
-	0x0036, 0x0156, 0x2011, 0x0263, 0x2204, 0x8211, 0x220c, 0x080c,
-	0x283e, 0x11d0, 0x080c, 0x65ff, 0x11b8, 0x2011, 0x0276, 0x20a9,
-	0x0004, 0x0096, 0x2b48, 0x2019, 0x000a, 0x080c, 0xbe1d, 0x009e,
-	0x1158, 0x2011, 0x027a, 0x20a9, 0x0004, 0x0096, 0x2b48, 0x2019,
-	0x0006, 0x080c, 0xbe1d, 0x009e, 0x015e, 0x003e, 0x002e, 0x001e,
-	0x000e, 0x00be, 0x0005, 0x00e6, 0x00c6, 0x0086, 0x0076, 0x0066,
-	0x0056, 0x0046, 0x0026, 0x0126, 0x2091, 0x8000, 0x2740, 0x2029,
-	0x19f0, 0x252c, 0x2021, 0x19f6, 0x2424, 0x2061, 0x1cd0, 0x2071,
-	0x1800, 0x7654, 0x7074, 0x81ff, 0x0150, 0x0006, 0x9186, 0x1ab0,
-	0x000e, 0x0128, 0x8001, 0x9602, 0x1a04, 0xe388, 0x0018, 0x9606,
-	0x0904, 0xe388, 0x080c, 0x8981, 0x0904, 0xe37f, 0x2100, 0x9c06,
-	0x0904, 0xe37f, 0x080c, 0xe5ef, 0x1904, 0xe37f, 0x080c, 0xe98d,
-	0x0904, 0xe37f, 0x080c, 0xe5df, 0x0904, 0xe37f, 0x6720, 0x9786,
-	0x0001, 0x1148, 0x080c, 0x3314, 0x0904, 0xe3c7, 0x6004, 0x9086,
-	0x0000, 0x1904, 0xe3c7, 0x9786, 0x0004, 0x0904, 0xe3c7, 0x9786,
-	0x0007, 0x0904, 0xe37f, 0x2500, 0x9c06, 0x0904, 0xe37f, 0x2400,
-	0x9c06, 0x05e8, 0x88ff, 0x0118, 0x6054, 0x9906, 0x15c0, 0x0096,
-	0x6000, 0x9086, 0x0004, 0x1120, 0x0016, 0x080c, 0x1a5e, 0x001e,
-	0x9786, 0x000a, 0x0148, 0x080c, 0xcd3b, 0x1130, 0x080c, 0xb813,
-	0x009e, 0x080c, 0xae92, 0x0418, 0x6014, 0x2048, 0x080c, 0xcb35,
-	0x01d8, 0x9786, 0x0003, 0x1570, 0xa867, 0x0103, 0xa87c, 0xd0cc,
-	0x0130, 0x0096, 0xa878, 0x2048, 0x080c, 0x0fb1, 0x009e, 0xab7a,
-	0xa877, 0x0000, 0x080c, 0xe908, 0x0016, 0x080c, 0xce24, 0x080c,
-	0x6c75, 0x001e, 0x080c, 0xcd1e, 0x009e, 0x080c, 0xae92, 0x9ce0,
-	0x0018, 0x2001, 0x181a, 0x2004, 0x9c02, 0x1210, 0x0804, 0xe2ff,
-	0x012e, 0x002e, 0x004e, 0x005e, 0x006e, 0x007e, 0x008e, 0x00ce,
-	0x00ee, 0x0005, 0x9786, 0x0006, 0x1150, 0x9386, 0x0005, 0x0128,
-	0x080c, 0xe908, 0x080c, 0xe551, 0x08f8, 0x009e, 0x0c00, 0x9786,
-	0x0009, 0x11f8, 0x6000, 0x9086, 0x0004, 0x01c0, 0x6000, 0x9086,
-	0x0003, 0x11a0, 0x080c, 0x963d, 0x0096, 0x6114, 0x2148, 0x080c,
-	0xcb35, 0x0118, 0x6010, 0x080c, 0x6c81, 0x009e, 0x00c6, 0x080c,
-	0xae61, 0x00ce, 0x0036, 0x080c, 0x97b9, 0x003e, 0x009e, 0x0804,
-	0xe37f, 0x9786, 0x000a, 0x0904, 0xe366, 0x0804, 0xe364, 0x81ff,
-	0x0904, 0xe37f, 0x9180, 0x0001, 0x2004, 0x9086, 0x0018, 0x0138,
-	0x9180, 0x0001, 0x2004, 0x9086, 0x002d, 0x1904, 0xe37f, 0x6000,
-	0x9086, 0x0002, 0x1904, 0xe37f, 0x080c, 0xcd2a, 0x0138, 0x080c,
-	0xcd3b, 0x1904, 0xe37f, 0x080c, 0xb813, 0x0038, 0x080c, 0x31e8,
-	0x080c, 0xcd3b, 0x1110, 0x080c, 0xb813, 0x080c, 0xae92, 0x0804,
-	0xe37f, 0xa864, 0x9084, 0x00ff, 0x9086, 0x0039, 0x0005, 0x00c6,
-	0x00e6, 0x0016, 0x2c08, 0x2170, 0x9006, 0x080c, 0xe578, 0x001e,
-	0x0120, 0x6020, 0x9084, 0x000f, 0x001b, 0x00ee, 0x00ce, 0x0005,
-	0xe416, 0xe416, 0xe416, 0xe416, 0xe416, 0xe416, 0xe418, 0xe416,
-	0xe416, 0xe416, 0xe416, 0xae92, 0xae92, 0xe416, 0x9006, 0x0005,
-	0x0036, 0x0046, 0x0016, 0x7010, 0x00b6, 0x2058, 0xbca0, 0x00be,
-	0x2c00, 0x2009, 0x0020, 0x080c, 0xe5ae, 0x001e, 0x004e, 0x2019,
-	0x0002, 0x080c, 0xe134, 0x003e, 0x9085, 0x0001, 0x0005, 0x0096,
-	0x080c, 0xcb35, 0x0140, 0x6014, 0x904d, 0x080c, 0xc768, 0x687b,
-	0x0005, 0x080c, 0x6c81, 0x009e, 0x080c, 0xae92, 0x9085, 0x0001,
-	0x0005, 0x2001, 0x0001, 0x080c, 0x653b, 0x0156, 0x0016, 0x0026,
-	0x0036, 0x20a9, 0x0004, 0x2019, 0x1805, 0x2011, 0x0276, 0x080c,
-	0xbe09, 0x003e, 0x002e, 0x001e, 0x015e, 0x9005, 0x0005, 0x00f6,
-	0x00e6, 0x00c6, 0x0086, 0x0076, 0x0066, 0x00b6, 0x0126, 0x2091,
-	0x8000, 0x2740, 0x2061, 0x1cd0, 0x2079, 0x0001, 0x8fff, 0x0904,
-	0xe4b1, 0x2071, 0x1800, 0x7654, 0x7074, 0x8001, 0x9602, 0x1a04,
-	0xe4b1, 0x88ff, 0x0120, 0x2800, 0x9c06, 0x1590, 0x2078, 0x080c,
-	0xe5df, 0x0570, 0x2400, 0x9c06, 0x0558, 0x6720, 0x9786, 0x0006,
-	0x1538, 0x9786, 0x0007, 0x0520, 0x88ff, 0x1140, 0x6010, 0x9b06,
-	0x11f8, 0x85ff, 0x0118, 0x6054, 0x9106, 0x11d0, 0x0096, 0x601c,
-	0xd084, 0x0140, 0x080c, 0xe80b, 0x080c, 0xd248, 0x080c, 0x1a5e,
-	0x6023, 0x0007, 0x6014, 0x2048, 0x080c, 0xcb35, 0x0120, 0x0046,
-	0x080c, 0xe551, 0x004e, 0x009e, 0x080c, 0xae92, 0x88ff, 0x1198,
+	0x080c, 0x0dd5, 0x080c, 0x957b, 0x080c, 0xaea2, 0x080c, 0x9687,
+	0x0005, 0x9182, 0x0085, 0x0a0c, 0x0dd5, 0x9182, 0x0092, 0x1a0c,
+	0x0dd5, 0x9182, 0x0085, 0x0002, 0xe131, 0xe131, 0xe131, 0xe133,
+	0xe131, 0xe131, 0xe131, 0xe131, 0xe131, 0xe131, 0xe131, 0xe131,
+	0xe131, 0x080c, 0x0dd5, 0x0005, 0x9186, 0x0013, 0x0148, 0x9186,
+	0x0014, 0x0130, 0x9186, 0x0027, 0x0118, 0x080c, 0xaf07, 0x0030,
+	0x080c, 0x957b, 0x080c, 0xaea2, 0x080c, 0x9687, 0x0005, 0x0036,
+	0x080c, 0xe82c, 0x6043, 0x0000, 0x2019, 0x000b, 0x0031, 0x6023,
+	0x0006, 0x6003, 0x0007, 0x003e, 0x0005, 0x0126, 0x0036, 0x2091,
+	0x8000, 0x0086, 0x2c40, 0x0096, 0x904e, 0x080c, 0xa69d, 0x009e,
+	0x008e, 0x1550, 0x0076, 0x2c38, 0x080c, 0xa748, 0x007e, 0x1520,
+	0x6000, 0x9086, 0x0000, 0x0500, 0x6020, 0x9086, 0x0007, 0x01e0,
+	0x0096, 0x601c, 0xd084, 0x0140, 0x080c, 0xe82c, 0x080c, 0xd262,
+	0x080c, 0x1a60, 0x6023, 0x0007, 0x6014, 0x2048, 0x080c, 0xcb4a,
+	0x0110, 0x080c, 0xe572, 0x009e, 0x6017, 0x0000, 0x080c, 0xe82c,
+	0x6023, 0x0007, 0x080c, 0xd262, 0x003e, 0x012e, 0x0005, 0x00f6,
+	0x00c6, 0x00b6, 0x0036, 0x0156, 0x2079, 0x0260, 0x7938, 0x783c,
+	0x080c, 0x2840, 0x15c8, 0x0016, 0x00c6, 0x080c, 0x6608, 0x1590,
+	0x001e, 0x00c6, 0x2160, 0x080c, 0xd25f, 0x00ce, 0x002e, 0x0026,
+	0x0016, 0x2019, 0x0029, 0x080c, 0xa80e, 0x080c, 0x927e, 0x0076,
+	0x903e, 0x080c, 0x9151, 0x007e, 0x001e, 0x0076, 0x903e, 0x080c,
+	0xe30c, 0x007e, 0x0026, 0xba04, 0x9294, 0xff00, 0x8217, 0x9286,
+	0x0006, 0x0118, 0x9286, 0x0004, 0x1118, 0xbaa0, 0x080c, 0x327f,
+	0x002e, 0xbcc0, 0x001e, 0x080c, 0x603d, 0xbe12, 0xbd16, 0xbcc2,
+	0x9006, 0x0010, 0x00ce, 0x001e, 0x015e, 0x003e, 0x00be, 0x00ce,
+	0x00fe, 0x0005, 0x00c6, 0x00d6, 0x00b6, 0x0016, 0x2009, 0x1824,
+	0x2104, 0x9086, 0x0074, 0x1904, 0xe233, 0x2069, 0x0260, 0x6944,
+	0x9182, 0x0100, 0x06e0, 0x6940, 0x9184, 0x8000, 0x0904, 0xe230,
+	0x2001, 0x197b, 0x2004, 0x9005, 0x1140, 0x6010, 0x2058, 0xb8c0,
+	0x9005, 0x0118, 0x9184, 0x0800, 0x0598, 0x6948, 0x918a, 0x0001,
+	0x0648, 0x080c, 0xe991, 0x0118, 0x6978, 0xd1fc, 0x11b8, 0x2009,
+	0x0205, 0x200b, 0x0001, 0x693c, 0x81ff, 0x1198, 0x6944, 0x9182,
+	0x0100, 0x02a8, 0x6940, 0x81ff, 0x1178, 0x6948, 0x918a, 0x0001,
+	0x0288, 0x6950, 0x918a, 0x0001, 0x0298, 0x00d0, 0x6017, 0x0100,
+	0x00a0, 0x6017, 0x0300, 0x0088, 0x6017, 0x0500, 0x0070, 0x6017,
+	0x0700, 0x0058, 0x6017, 0x0900, 0x0040, 0x6017, 0x0b00, 0x0028,
+	0x6017, 0x0f00, 0x0010, 0x6017, 0x2d00, 0x9085, 0x0001, 0x0008,
+	0x9006, 0x001e, 0x00be, 0x00de, 0x00ce, 0x0005, 0x00c6, 0x00b6,
+	0x0026, 0x0036, 0x0156, 0x6210, 0x2258, 0xbb04, 0x9394, 0x00ff,
+	0x9286, 0x0006, 0x0180, 0x9286, 0x0004, 0x0168, 0x9394, 0xff00,
+	0x8217, 0x9286, 0x0006, 0x0138, 0x9286, 0x0004, 0x0120, 0x080c,
+	0x6617, 0x0804, 0xe29b, 0x2011, 0x0276, 0x20a9, 0x0004, 0x0096,
+	0x2b48, 0x2019, 0x000a, 0x080c, 0xbe30, 0x009e, 0x15a8, 0x2011,
+	0x027a, 0x20a9, 0x0004, 0x0096, 0x2b48, 0x2019, 0x0006, 0x080c,
+	0xbe30, 0x009e, 0x1548, 0x0046, 0x0016, 0xbaa0, 0x2220, 0x9006,
+	0x2009, 0x1848, 0x210c, 0xd1a4, 0x0138, 0x2009, 0x0029, 0x080c,
+	0xe5cf, 0xb800, 0xc0e5, 0xb802, 0x2019, 0x0029, 0x080c, 0x927e,
+	0x0076, 0x2039, 0x0000, 0x080c, 0x9151, 0x2c08, 0x080c, 0xe30c,
+	0x007e, 0x2001, 0x0007, 0x080c, 0x6584, 0x2001, 0x0007, 0x080c,
+	0x6558, 0x001e, 0x004e, 0x9006, 0x015e, 0x003e, 0x002e, 0x00be,
+	0x00ce, 0x0005, 0x00d6, 0x2069, 0x026e, 0x6800, 0x9086, 0x0800,
+	0x0118, 0x6017, 0x0000, 0x0008, 0x9006, 0x00de, 0x0005, 0x00b6,
+	0x00f6, 0x0016, 0x0026, 0x0036, 0x0156, 0x2079, 0x026c, 0x7930,
+	0x7834, 0x080c, 0x2840, 0x11d0, 0x080c, 0x6608, 0x11b8, 0x2011,
+	0x0270, 0x20a9, 0x0004, 0x0096, 0x2b48, 0x2019, 0x000a, 0x080c,
+	0xbe30, 0x009e, 0x1158, 0x2011, 0x0274, 0x20a9, 0x0004, 0x0096,
+	0x2b48, 0x2019, 0x0006, 0x080c, 0xbe30, 0x009e, 0x015e, 0x003e,
+	0x002e, 0x001e, 0x00fe, 0x00be, 0x0005, 0x00b6, 0x0006, 0x0016,
+	0x0026, 0x0036, 0x0156, 0x2011, 0x0263, 0x2204, 0x8211, 0x220c,
+	0x080c, 0x2840, 0x11d0, 0x080c, 0x6608, 0x11b8, 0x2011, 0x0276,
+	0x20a9, 0x0004, 0x0096, 0x2b48, 0x2019, 0x000a, 0x080c, 0xbe30,
+	0x009e, 0x1158, 0x2011, 0x027a, 0x20a9, 0x0004, 0x0096, 0x2b48,
+	0x2019, 0x0006, 0x080c, 0xbe30, 0x009e, 0x015e, 0x003e, 0x002e,
+	0x001e, 0x000e, 0x00be, 0x0005, 0x00e6, 0x00c6, 0x0086, 0x0076,
+	0x0066, 0x0056, 0x0046, 0x0026, 0x0126, 0x2091, 0x8000, 0x2740,
+	0x2029, 0x19ef, 0x252c, 0x2021, 0x19f5, 0x2424, 0x2061, 0x1cd0,
+	0x2071, 0x1800, 0x7654, 0x7074, 0x81ff, 0x0150, 0x0006, 0x9186,
+	0x1aaf, 0x000e, 0x0128, 0x8001, 0x9602, 0x1a04, 0xe3a9, 0x0018,
+	0x9606, 0x0904, 0xe3a9, 0x080c, 0x896a, 0x0904, 0xe3a0, 0x2100,
+	0x9c06, 0x0904, 0xe3a0, 0x080c, 0xe610, 0x1904, 0xe3a0, 0x080c,
+	0xe9ae, 0x0904, 0xe3a0, 0x080c, 0xe600, 0x0904, 0xe3a0, 0x6720,
+	0x9786, 0x0001, 0x1148, 0x080c, 0x3316, 0x0904, 0xe3e8, 0x6004,
+	0x9086, 0x0000, 0x1904, 0xe3e8, 0x9786, 0x0004, 0x0904, 0xe3e8,
+	0x9786, 0x0007, 0x0904, 0xe3a0, 0x2500, 0x9c06, 0x0904, 0xe3a0,
+	0x2400, 0x9c06, 0x05e8, 0x88ff, 0x0118, 0x6054, 0x9906, 0x15c0,
+	0x0096, 0x6000, 0x9086, 0x0004, 0x1120, 0x0016, 0x080c, 0x1a60,
+	0x001e, 0x9786, 0x000a, 0x0148, 0x080c, 0xcd50, 0x1130, 0x080c,
+	0xb824, 0x009e, 0x080c, 0xaea2, 0x0418, 0x6014, 0x2048, 0x080c,
+	0xcb4a, 0x01d8, 0x9786, 0x0003, 0x1570, 0xa867, 0x0103, 0xa87c,
+	0xd0cc, 0x0130, 0x0096, 0xa878, 0x2048, 0x080c, 0x0fb1, 0x009e,
+	0xab7a, 0xa877, 0x0000, 0x080c, 0xe929, 0x0016, 0x080c, 0xce3e,
+	0x080c, 0x6c7a, 0x001e, 0x080c, 0xcd33, 0x009e, 0x080c, 0xaea2,
 	0x9ce0, 0x0018, 0x2001, 0x181a, 0x2004, 0x9c02, 0x1210, 0x0804,
-	0xe466, 0x9006, 0x012e, 0x00be, 0x006e, 0x007e, 0x008e, 0x00ce,
-	0x00ee, 0x00fe, 0x0005, 0x98c5, 0x0001, 0x0ca0, 0x00b6, 0x0076,
-	0x0056, 0x0086, 0x9046, 0x2029, 0x0001, 0x2c20, 0x2019, 0x0002,
-	0x6210, 0x2258, 0x0096, 0x904e, 0x080c, 0xa69c, 0x009e, 0x008e,
-	0x903e, 0x080c, 0xa747, 0x080c, 0xe457, 0x005e, 0x007e, 0x00be,
-	0x0005, 0x00b6, 0x0046, 0x0056, 0x0076, 0x00c6, 0x0156, 0x2c20,
-	0x2128, 0x20a9, 0x007f, 0x900e, 0x0016, 0x0036, 0x080c, 0x65ff,
-	0x1190, 0x0056, 0x0086, 0x9046, 0x2508, 0x2029, 0x0001, 0x0096,
-	0x904e, 0x080c, 0xa69c, 0x009e, 0x008e, 0x903e, 0x080c, 0xa747,
-	0x080c, 0xe457, 0x005e, 0x003e, 0x001e, 0x8108, 0x1f04, 0xe4e4,
-	0x015e, 0x00ce, 0x007e, 0x005e, 0x004e, 0x00be, 0x0005, 0x00b6,
-	0x0076, 0x0056, 0x6210, 0x2258, 0x0086, 0x9046, 0x2029, 0x0001,
-	0x2019, 0x0048, 0x0096, 0x904e, 0x080c, 0xa69c, 0x009e, 0x008e,
-	0x903e, 0x080c, 0xa747, 0x2c20, 0x080c, 0xe457, 0x005e, 0x007e,
+	0xe320, 0x012e, 0x002e, 0x004e, 0x005e, 0x006e, 0x007e, 0x008e,
+	0x00ce, 0x00ee, 0x0005, 0x9786, 0x0006, 0x1150, 0x9386, 0x0005,
+	0x0128, 0x080c, 0xe929, 0x080c, 0xe572, 0x08f8, 0x009e, 0x0c00,
+	0x9786, 0x0009, 0x11f8, 0x6000, 0x9086, 0x0004, 0x01c0, 0x6000,
+	0x9086, 0x0003, 0x11a0, 0x080c, 0x9637, 0x0096, 0x6114, 0x2148,
+	0x080c, 0xcb4a, 0x0118, 0x6010, 0x080c, 0x6c86, 0x009e, 0x00c6,
+	0x080c, 0xae71, 0x00ce, 0x0036, 0x080c, 0x97b5, 0x003e, 0x009e,
+	0x0804, 0xe3a0, 0x9786, 0x000a, 0x0904, 0xe387, 0x0804, 0xe385,
+	0x81ff, 0x0904, 0xe3a0, 0x9180, 0x0001, 0x2004, 0x9086, 0x0018,
+	0x0138, 0x9180, 0x0001, 0x2004, 0x9086, 0x002d, 0x1904, 0xe3a0,
+	0x6000, 0x9086, 0x0002, 0x1904, 0xe3a0, 0x080c, 0xcd3f, 0x0138,
+	0x080c, 0xcd50, 0x1904, 0xe3a0, 0x080c, 0xb824, 0x0038, 0x080c,
+	0x31ea, 0x080c, 0xcd50, 0x1110, 0x080c, 0xb824, 0x080c, 0xaea2,
+	0x0804, 0xe3a0, 0xa864, 0x9084, 0x00ff, 0x9086, 0x0039, 0x0005,
+	0x00c6, 0x00e6, 0x0016, 0x2c08, 0x2170, 0x9006, 0x080c, 0xe599,
+	0x001e, 0x0120, 0x6020, 0x9084, 0x000f, 0x001b, 0x00ee, 0x00ce,
+	0x0005, 0xe437, 0xe437, 0xe437, 0xe437, 0xe437, 0xe437, 0xe439,
+	0xe437, 0xe437, 0xe437, 0xe437, 0xaea2, 0xaea2, 0xe437, 0x9006,
+	0x0005, 0x0036, 0x0046, 0x0016, 0x7010, 0x00b6, 0x2058, 0xbca0,
+	0x00be, 0x2c00, 0x2009, 0x0020, 0x080c, 0xe5cf, 0x001e, 0x004e,
+	0x2019, 0x0002, 0x080c, 0xe155, 0x003e, 0x9085, 0x0001, 0x0005,
+	0x0096, 0x080c, 0xcb4a, 0x0140, 0x6014, 0x904d, 0x080c, 0xc77b,
+	0x687b, 0x0005, 0x080c, 0x6c86, 0x009e, 0x080c, 0xaea2, 0x9085,
+	0x0001, 0x0005, 0x2001, 0x0001, 0x080c, 0x6544, 0x0156, 0x0016,
+	0x0026, 0x0036, 0x20a9, 0x0004, 0x2019, 0x1805, 0x2011, 0x0276,
+	0x080c, 0xbe1c, 0x003e, 0x002e, 0x001e, 0x015e, 0x9005, 0x0005,
+	0x00f6, 0x00e6, 0x00c6, 0x0086, 0x0076, 0x0066, 0x00b6, 0x0126,
+	0x2091, 0x8000, 0x2740, 0x2061, 0x1cd0, 0x2079, 0x0001, 0x8fff,
+	0x0904, 0xe4d2, 0x2071, 0x1800, 0x7654, 0x7074, 0x8001, 0x9602,
+	0x1a04, 0xe4d2, 0x88ff, 0x0120, 0x2800, 0x9c06, 0x1590, 0x2078,
+	0x080c, 0xe600, 0x0570, 0x2400, 0x9c06, 0x0558, 0x6720, 0x9786,
+	0x0006, 0x1538, 0x9786, 0x0007, 0x0520, 0x88ff, 0x1140, 0x6010,
+	0x9b06, 0x11f8, 0x85ff, 0x0118, 0x6054, 0x9106, 0x11d0, 0x0096,
+	0x601c, 0xd084, 0x0140, 0x080c, 0xe82c, 0x080c, 0xd262, 0x080c,
+	0x1a60, 0x6023, 0x0007, 0x6014, 0x2048, 0x080c, 0xcb4a, 0x0120,
+	0x0046, 0x080c, 0xe572, 0x004e, 0x009e, 0x080c, 0xaea2, 0x88ff,
+	0x1198, 0x9ce0, 0x0018, 0x2001, 0x181a, 0x2004, 0x9c02, 0x1210,
+	0x0804, 0xe487, 0x9006, 0x012e, 0x00be, 0x006e, 0x007e, 0x008e,
+	0x00ce, 0x00ee, 0x00fe, 0x0005, 0x98c5, 0x0001, 0x0ca0, 0x00b6,
+	0x0076, 0x0056, 0x0086, 0x9046, 0x2029, 0x0001, 0x2c20, 0x2019,
+	0x0002, 0x6210, 0x2258, 0x0096, 0x904e, 0x080c, 0xa69d, 0x009e,
+	0x008e, 0x903e, 0x080c, 0xa748, 0x080c, 0xe478, 0x005e, 0x007e,
 	0x00be, 0x0005, 0x00b6, 0x0046, 0x0056, 0x0076, 0x00c6, 0x0156,
-	0x2c20, 0x20a9, 0x0800, 0x900e, 0x0016, 0x0036, 0x080c, 0x65ff,
-	0x11a0, 0x0086, 0x9046, 0x2828, 0x0046, 0x2021, 0x0001, 0x080c,
-	0xe7ef, 0x004e, 0x0096, 0x904e, 0x080c, 0xa69c, 0x009e, 0x008e,
-	0x903e, 0x080c, 0xa747, 0x080c, 0xe457, 0x003e, 0x001e, 0x8108,
-	0x1f04, 0xe52c, 0x015e, 0x00ce, 0x007e, 0x005e, 0x004e, 0x00be,
-	0x0005, 0x0016, 0x00f6, 0x080c, 0xcb33, 0x0198, 0xa864, 0x9084,
-	0x00ff, 0x9086, 0x0046, 0x0180, 0xa800, 0x907d, 0x0138, 0xa803,
-	0x0000, 0xab82, 0x080c, 0x6c81, 0x2f48, 0x0cb0, 0xab82, 0x080c,
-	0x6c81, 0x00fe, 0x001e, 0x0005, 0xa800, 0x907d, 0x0130, 0xa803,
-	0x0000, 0x080c, 0x6c81, 0x2f48, 0x0cb8, 0x080c, 0x6c81, 0x0c88,
-	0x00e6, 0x0046, 0x0036, 0x2061, 0x1cd0, 0x9005, 0x1138, 0x2071,
-	0x1800, 0x7454, 0x7074, 0x8001, 0x9402, 0x12f8, 0x2100, 0x9c06,
-	0x0188, 0x6000, 0x9086, 0x0000, 0x0168, 0x6008, 0x9206, 0x1150,
-	0x6320, 0x9386, 0x0009, 0x01b0, 0x6010, 0x91a0, 0x0004, 0x2424,
-	0x9406, 0x0140, 0x9ce0, 0x0018, 0x2001, 0x181a, 0x2004, 0x9c02,
-	0x1220, 0x0c20, 0x9085, 0x0001, 0x0008, 0x9006, 0x003e, 0x004e,
-	0x00ee, 0x0005, 0x631c, 0xd3c4, 0x1d68, 0x0c30, 0x0096, 0x0006,
-	0x080c, 0x0fff, 0x000e, 0x090c, 0x0dd5, 0xaae2, 0xa867, 0x010d,
-	0xa88e, 0x0026, 0x2010, 0x080c, 0xcb23, 0x2001, 0x0000, 0x0120,
-	0x2200, 0x9080, 0x0015, 0x2004, 0x002e, 0xa87a, 0x9186, 0x0020,
-	0x0110, 0xa8e3, 0xffff, 0xa986, 0xac76, 0xa87f, 0x0000, 0x2001,
-	0x198e, 0x2004, 0xa882, 0x9006, 0xa802, 0xa86a, 0xa88a, 0x0126,
-	0x2091, 0x8000, 0x080c, 0x6c81, 0x012e, 0x009e, 0x0005, 0x6700,
-	0x9786, 0x0000, 0x0158, 0x9786, 0x0001, 0x0140, 0x9786, 0x000a,
-	0x0128, 0x9786, 0x0009, 0x0110, 0x9085, 0x0001, 0x0005, 0x00e6,
-	0x6010, 0x9075, 0x0138, 0x00b6, 0x2058, 0xb8a0, 0x00be, 0x9206,
-	0x00ee, 0x0005, 0x9085, 0x0001, 0x0cd8, 0x0016, 0x6004, 0x908e,
-	0x001e, 0x11a0, 0x8007, 0x6134, 0x918c, 0x00ff, 0x9105, 0x6036,
-	0x6007, 0x0085, 0x6003, 0x000b, 0x6023, 0x0005, 0x2001, 0x1987,
-	0x2004, 0x601a, 0x080c, 0x90f0, 0x080c, 0x968d, 0x001e, 0x0005,
-	0xa001, 0xa001, 0x0005, 0x6024, 0xd0e4, 0x0158, 0xd0cc, 0x0118,
-	0x080c, 0xce68, 0x0030, 0x080c, 0xe80b, 0x080c, 0x86b2, 0x080c,
-	0xae61, 0x0005, 0x9280, 0x0008, 0x2004, 0x9084, 0x000f, 0x0002,
-	0xe63e, 0xe63e, 0xe63e, 0xe640, 0xe63e, 0xe640, 0xe640, 0xe63e,
-	0xe640, 0xe63e, 0xe63e, 0xe63e, 0xe63e, 0xe63e, 0x9006, 0x0005,
-	0x9085, 0x0001, 0x0005, 0x9280, 0x0008, 0x2004, 0x9084, 0x000f,
-	0x0002, 0xe657, 0xe657, 0xe657, 0xe657, 0xe657, 0xe657, 0xe664,
-	0xe657, 0xe657, 0xe657, 0xe657, 0xe657, 0xe657, 0xe657, 0x6007,
-	0x003b, 0x602f, 0x0009, 0x6017, 0x2a00, 0x6003, 0x0001, 0x080c,
-	0x90f0, 0x080c, 0x968d, 0x0005, 0x0096, 0x00c6, 0x2260, 0x080c,
-	0xe80b, 0x6043, 0x0000, 0x6024, 0xc0f4, 0xc0e4, 0x6026, 0x603b,
-	0x0000, 0x00ce, 0x00d6, 0x2268, 0x9186, 0x0007, 0x1904, 0xe6bd,
-	0x6814, 0x9005, 0x0138, 0x2048, 0xa87c, 0xd0fc, 0x1118, 0x00de,
-	0x009e, 0x08a8, 0x6007, 0x003a, 0x6003, 0x0001, 0x080c, 0x90f0,
-	0x080c, 0x968d, 0x00c6, 0x2d60, 0x6100, 0x9186, 0x0002, 0x1904,
-	0xe734, 0x6014, 0x9005, 0x1138, 0x6000, 0x9086, 0x0007, 0x190c,
-	0x0dd5, 0x0804, 0xe734, 0x2048, 0x080c, 0xcb35, 0x1130, 0x0028,
-	0x2048, 0xa800, 0x9005, 0x1de0, 0x2900, 0x2048, 0xa87c, 0x9084,
-	0x0003, 0x9086, 0x0002, 0x1168, 0xa87c, 0xc0dc, 0xc0f4, 0xa87e,
-	0xa880, 0xc0fc, 0xa882, 0x2009, 0x0043, 0x080c, 0xdf8d, 0x0804,
-	0xe734, 0x2009, 0x0041, 0x0804, 0xe72e, 0x9186, 0x0005, 0x15a0,
-	0x6814, 0x2048, 0xa87c, 0xd0bc, 0x1120, 0x00de, 0x009e, 0x0804,
-	0xe657, 0xd0b4, 0x0128, 0xd0fc, 0x090c, 0x0dd5, 0x0804, 0xe678,
-	0x6007, 0x003a, 0x6003, 0x0001, 0x080c, 0x90f0, 0x080c, 0x968d,
-	0x00c6, 0x2d60, 0x6100, 0x9186, 0x0002, 0x0120, 0x9186, 0x0004,
-	0x1904, 0xe734, 0x6814, 0x2048, 0xa97c, 0xc1f4, 0xc1dc, 0xa97e,
-	0xa980, 0xc1fc, 0xc1bc, 0xa982, 0x00f6, 0x2c78, 0x080c, 0x1725,
-	0x00fe, 0x2009, 0x0042, 0x04d0, 0x0036, 0x080c, 0x0fff, 0x090c,
-	0x0dd5, 0xa867, 0x010d, 0x9006, 0xa802, 0xa86a, 0xa88a, 0x2d18,
-	0xab8e, 0xa887, 0x0045, 0x2c00, 0xa892, 0x6038, 0xa8a2, 0x2360,
-	0x6024, 0xc0dd, 0x6026, 0x6010, 0x00b6, 0x2058, 0xb8a0, 0x00be,
-	0x2004, 0x6354, 0xab7a, 0xa876, 0x9006, 0xa87e, 0xa882, 0xad9a,
-	0xae96, 0xa89f, 0x0001, 0x080c, 0x6c81, 0x2019, 0x0045, 0x6008,
-	0x2068, 0x080c, 0xe134, 0x2d00, 0x600a, 0x6023, 0x0006, 0x6003,
-	0x0007, 0x901e, 0x631a, 0x6342, 0x003e, 0x0038, 0x6043, 0x0000,
-	0x6003, 0x0007, 0x080c, 0xdf8d, 0x00ce, 0x00de, 0x009e, 0x0005,
-	0x9186, 0x0013, 0x1128, 0x6004, 0x9082, 0x0085, 0x2008, 0x00c2,
-	0x9186, 0x0027, 0x1178, 0x080c, 0x9588, 0x0036, 0x0096, 0x6014,
-	0x2048, 0x2019, 0x0004, 0x080c, 0xe551, 0x009e, 0x003e, 0x080c,
-	0x968d, 0x0005, 0x9186, 0x0014, 0x0d70, 0x080c, 0xaef7, 0x0005,
-	0xe767, 0xe765, 0xe765, 0xe765, 0xe765, 0xe765, 0xe767, 0xe765,
-	0xe765, 0xe765, 0xe765, 0xe765, 0xe765, 0x080c, 0x0dd5, 0x080c,
-	0x9588, 0x6003, 0x000c, 0x080c, 0x968d, 0x0005, 0x9182, 0x0092,
-	0x1220, 0x9182, 0x0085, 0x0208, 0x001a, 0x080c, 0xaef7, 0x0005,
-	0xe785, 0xe785, 0xe785, 0xe785, 0xe787, 0xe7a7, 0xe785, 0xe785,
-	0xe785, 0xe785, 0xe785, 0xe785, 0xe785, 0x080c, 0x0dd5, 0x00d6,
-	0x2c68, 0x080c, 0xae0b, 0x01b0, 0x6003, 0x0001, 0x6007, 0x001e,
-	0x2009, 0x026e, 0x210c, 0x613a, 0x2009, 0x026f, 0x210c, 0x613e,
-	0x600b, 0xffff, 0x6910, 0x6112, 0x6023, 0x0004, 0x080c, 0x90f0,
-	0x080c, 0x968d, 0x2d60, 0x080c, 0xae61, 0x00de, 0x0005, 0x080c,
-	0xae61, 0x0005, 0x00e6, 0x6010, 0x00b6, 0x2058, 0xb800, 0x00be,
-	0xd0ec, 0x00ee, 0x0005, 0x2009, 0x1867, 0x210c, 0xd1ec, 0x05b0,
-	0x6003, 0x0002, 0x6024, 0xc0e5, 0x6026, 0xd0cc, 0x0150, 0x2001,
-	0x1988, 0x2004, 0x6042, 0x2009, 0x1867, 0x210c, 0xd1f4, 0x1520,
-	0x00a0, 0x2009, 0x1867, 0x210c, 0xd1f4, 0x0128, 0x6024, 0xc0e4,
-	0x6026, 0x9006, 0x00d8, 0x2001, 0x1988, 0x200c, 0x2001, 0x1986,
-	0x2004, 0x9100, 0x9080, 0x000a, 0x6042, 0x6010, 0x00b6, 0x2058,
-	0xb8bc, 0x00be, 0x0008, 0x2104, 0x9005, 0x0118, 0x9088, 0x0003,
-	0x0cd0, 0x2c0a, 0x600f, 0x0000, 0x9085, 0x0001, 0x0005, 0x0016,
-	0x00c6, 0x00e6, 0x6154, 0xb8bc, 0x2060, 0x8cff, 0x0180, 0x84ff,
-	0x1118, 0x6054, 0x9106, 0x1138, 0x600c, 0x2072, 0x080c, 0x86b2,
-	0x080c, 0xae61, 0x0010, 0x9cf0, 0x0003, 0x2e64, 0x0c70, 0x00ee,
-	0x00ce, 0x001e, 0x0005, 0x00d6, 0x00b6, 0x6010, 0x2058, 0xb8bc,
-	0x2068, 0x9005, 0x0130, 0x9c06, 0x0110, 0x680c, 0x0cd0, 0x600c,
-	0x680e, 0x00be, 0x00de, 0x0005, 0x0026, 0x0036, 0x0156, 0x2011,
-	0x182c, 0x2204, 0x9084, 0x00ff, 0x2019, 0x026e, 0x2334, 0x9636,
-	0x1508, 0x8318, 0x2334, 0x2204, 0x9084, 0xff00, 0x9636, 0x11d0,
-	0x2011, 0x0270, 0x20a9, 0x0004, 0x6010, 0x0096, 0x2048, 0x2019,
-	0x000a, 0x080c, 0xbe1d, 0x009e, 0x1168, 0x2011, 0x0274, 0x20a9,
-	0x0004, 0x6010, 0x0096, 0x2048, 0x2019, 0x0006, 0x080c, 0xbe1d,
-	0x009e, 0x1100, 0x015e, 0x003e, 0x002e, 0x0005, 0x00e6, 0x2071,
-	0x1800, 0x080c, 0x5fad, 0x080c, 0x2f96, 0x00ee, 0x0005, 0x0096,
-	0x0026, 0x080c, 0x0fff, 0x090c, 0x0dd5, 0xa85c, 0x9080, 0x001a,
-	0x20a0, 0x20a9, 0x000c, 0xa860, 0x20e8, 0x9006, 0x4004, 0x9186,
-	0x0046, 0x1118, 0xa867, 0x0136, 0x0038, 0xa867, 0x0138, 0x9186,
-	0x0041, 0x0110, 0xa87b, 0x0001, 0x7038, 0x9084, 0xff00, 0x7240,
-	0x9294, 0xff00, 0x8007, 0x9215, 0xaa9a, 0x9186, 0x0046, 0x1168,
-	0x7038, 0x9084, 0x00ff, 0x723c, 0x9294, 0xff00, 0x9215, 0xaa9e,
-	0x723c, 0x9294, 0x00ff, 0xaaa2, 0x0060, 0x7040, 0x9084, 0x00ff,
-	0x7244, 0x9294, 0xff00, 0x9215, 0xaa9e, 0x7244, 0x9294, 0x00ff,
-	0xaaa2, 0x9186, 0x0046, 0x1118, 0x9e90, 0x0012, 0x0010, 0x9e90,
-	0x001a, 0x2204, 0x8007, 0xa8a6, 0x8210, 0x2204, 0x8007, 0xa8aa,
-	0x8210, 0x2204, 0x8007, 0xa8ae, 0x8210, 0x2204, 0x8007, 0xa8b2,
-	0x8210, 0x9186, 0x0046, 0x11b8, 0x9e90, 0x0016, 0x2204, 0x8007,
-	0xa8b6, 0x8210, 0x2204, 0x8007, 0xa8ba, 0x8210, 0x2204, 0x8007,
-	0xa8be, 0x8210, 0x2204, 0x8007, 0xa8c2, 0x8210, 0x2011, 0x0205,
-	0x2013, 0x0001, 0x00b0, 0x9e90, 0x001e, 0x2204, 0x8007, 0xa8b6,
-	0x8210, 0x2204, 0x8007, 0xa8ba, 0x2011, 0x0205, 0x2013, 0x0001,
-	0x2011, 0x0260, 0x2204, 0x8007, 0xa8be, 0x8210, 0x2204, 0x8007,
-	0xa8c2, 0x9186, 0x0046, 0x1118, 0x2011, 0x0262, 0x0010, 0x2011,
-	0x026a, 0x0146, 0x01d6, 0x0036, 0x20a9, 0x0001, 0x2019, 0x0008,
-	0xa860, 0x20e8, 0xa85c, 0x9080, 0x0031, 0x20a0, 0x2204, 0x8007,
-	0x4004, 0x8210, 0x8319, 0x1dd0, 0x003e, 0x01ce, 0x013e, 0x2011,
-	0x0205, 0x2013, 0x0000, 0x002e, 0x080c, 0x6c81, 0x009e, 0x0005,
-	0x00e6, 0x6010, 0x00b6, 0x2058, 0xb800, 0x00be, 0xd0fc, 0x0108,
-	0x0011, 0x00ee, 0x0005, 0xa880, 0xc0e5, 0xa882, 0x0005, 0x00e6,
-	0x00d6, 0x00c6, 0x0076, 0x0066, 0x0056, 0x0046, 0x0026, 0x0016,
-	0x0126, 0x2091, 0x8000, 0x2029, 0x19f0, 0x252c, 0x2021, 0x19f6,
-	0x2424, 0x2061, 0x1cd0, 0x2071, 0x1800, 0x7654, 0x7074, 0x9606,
-	0x0578, 0x6720, 0x9786, 0x0001, 0x0118, 0x9786, 0x0008, 0x1500,
-	0x2500, 0x9c06, 0x01e8, 0x2400, 0x9c06, 0x01d0, 0x080c, 0xe5df,
-	0x01b8, 0x080c, 0xe5ef, 0x11a0, 0x6000, 0x9086, 0x0004, 0x1120,
-	0x0016, 0x080c, 0x1a5e, 0x001e, 0x080c, 0xcd2a, 0x1110, 0x080c,
-	0x31e8, 0x080c, 0xcd3b, 0x1110, 0x080c, 0xb813, 0x080c, 0xae92,
-	0x9ce0, 0x0018, 0x2001, 0x181a, 0x2004, 0x9c02, 0x1208, 0x0858,
-	0x012e, 0x001e, 0x002e, 0x004e, 0x005e, 0x006e, 0x007e, 0x00ce,
-	0x00de, 0x00ee, 0x0005, 0x2001, 0x1810, 0x2004, 0xd0dc, 0x0005,
-	0x0006, 0x2001, 0x1837, 0x2004, 0xd09c, 0x000e, 0x0005, 0x0006,
-	0x0036, 0x0046, 0x080c, 0xd230, 0x0168, 0x2019, 0xffff, 0x9005,
-	0x0128, 0x6010, 0x00b6, 0x2058, 0xbba0, 0x00be, 0x2021, 0x0004,
-	0x080c, 0x4cbb, 0x004e, 0x003e, 0x000e, 0x6004, 0x9086, 0x0001,
-	0x1128, 0x080c, 0xa808, 0x080c, 0xae92, 0x9006, 0x0005, 0x00e6,
-	0x00c6, 0x00b6, 0x0046, 0x2061, 0x1cd0, 0x2071, 0x1800, 0x7454,
-	0x7074, 0x8001, 0x9402, 0x12b8, 0x2100, 0x9c06, 0x0148, 0x6000,
-	0x9086, 0x0000, 0x0128, 0x6010, 0x2058, 0xb8a0, 0x9206, 0x0140,
-	0x9ce0, 0x0018, 0x2001, 0x181a, 0x2004, 0x9c02, 0x1220, 0x0c60,
-	0x9085, 0x0001, 0x0008, 0x9006, 0x004e, 0x00be, 0x00ce, 0x00ee,
-	0x0005, 0x0126, 0x0006, 0x00e6, 0x0016, 0x2091, 0x8000, 0x2071,
-	0x1840, 0xd5a4, 0x0118, 0x7004, 0x8000, 0x7006, 0xd5b4, 0x0118,
-	0x7000, 0x8000, 0x7002, 0xd5ac, 0x0178, 0x2500, 0x9084, 0x0007,
-	0x908e, 0x0003, 0x0148, 0x908e, 0x0004, 0x0130, 0x908e, 0x0005,
-	0x0118, 0x2071, 0xfffe, 0x0089, 0x001e, 0x00ee, 0x000e, 0x012e,
-	0x0005, 0x0126, 0x0006, 0x00e6, 0x2091, 0x8000, 0x2071, 0xfff6,
-	0x0021, 0x00ee, 0x000e, 0x012e, 0x0005, 0x2e05, 0x8000, 0x2077,
-	0x1220, 0x8e70, 0x2e05, 0x8000, 0x2077, 0x0005, 0x00e6, 0x2071,
-	0xfff4, 0x0c99, 0x00ee, 0x0005, 0x00e6, 0x2071, 0xfff8, 0x0c69,
-	0x00ee, 0x0005, 0x0126, 0x0006, 0x00e6, 0x2091, 0x8000, 0x2071,
-	0x1840, 0x7014, 0x8000, 0x7016, 0x00ee, 0x000e, 0x012e, 0x0005,
-	0x0003, 0x000b, 0x079e, 0x0000, 0xc000, 0x0001, 0x8064, 0x0008,
-	0x0010, 0x0000, 0x8066, 0x0000, 0x0101, 0x0008, 0x4407, 0x0003,
-	0x8060, 0x0000, 0x0400, 0x0000, 0x580d, 0x000b, 0x79a8, 0x000b,
-	0x50ee, 0x000b, 0x4c0a, 0x0003, 0xbac0, 0x0009, 0x008a, 0x0000,
-	0x0c0a, 0x000b, 0x15fe, 0x0008, 0x340a, 0x0003, 0xc4c0, 0x0009,
-	0x7000, 0x0000, 0xffa0, 0x0001, 0x2000, 0x0000, 0x1668, 0x000b,
-	0x808c, 0x0008, 0x0001, 0x0000, 0x0000, 0x0007, 0x4028, 0x0000,
-	0x4047, 0x000a, 0x808c, 0x0008, 0x0002, 0x0000, 0x0822, 0x0003,
-	0x4022, 0x0000, 0x0028, 0x000b, 0x4122, 0x0008, 0x94c0, 0x0009,
-	0xff00, 0x0008, 0xffe0, 0x0009, 0x0500, 0x0008, 0x0a93, 0x000b,
-	0x4447, 0x0002, 0x0e90, 0x0003, 0x0bfe, 0x0008, 0x11a0, 0x0001,
-	0x126e, 0x0003, 0x0ca0, 0x0001, 0x126e, 0x0003, 0x9180, 0x0001,
-	0x0004, 0x0000, 0x8060, 0x0000, 0x0400, 0x0000, 0x7f62, 0x0008,
-	0x8066, 0x0000, 0x0009, 0x0008, 0x4436, 0x000b, 0x808c, 0x0008,
-	0x0000, 0x0008, 0x0060, 0x0008, 0x8062, 0x0008, 0x0004, 0x0000,
-	0x8066, 0x0000, 0x0411, 0x0000, 0x443e, 0x0003, 0x03fe, 0x0000,
-	0x43e0, 0x0001, 0x0e6b, 0x000b, 0xc2c0, 0x0009, 0x00ff, 0x0008,
-	0x02e0, 0x0001, 0x0e6b, 0x000b, 0x9180, 0x0001, 0x0005, 0x0008,
-	0x8060, 0x0000, 0x0400, 0x0000, 0x7f62, 0x0008, 0x8066, 0x0000,
-	0x0019, 0x0000, 0x444d, 0x000b, 0x0240, 0x0002, 0x0a68, 0x0003,
-	0x00fe, 0x0000, 0x326b, 0x000b, 0x0248, 0x000a, 0x085c, 0x0003,
-	0x9180, 0x0001, 0x0006, 0x0008, 0x7f62, 0x0008, 0x8002, 0x0008,
-	0x0003, 0x0008, 0x8066, 0x0000, 0x020a, 0x0000, 0x445b, 0x0003,
-	0x112a, 0x0000, 0x002e, 0x0008, 0x022c, 0x0008, 0x3a44, 0x0002,
-	0x0c0a, 0x000b, 0x808c, 0x0008, 0x0002, 0x0000, 0x1760, 0x0008,
-	0x8062, 0x0008, 0x000f, 0x0008, 0x8066, 0x0000, 0x0011, 0x0008,
-	0x4468, 0x0003, 0x01fe, 0x0008, 0x42e0, 0x0009, 0x0e5c, 0x0003,
-	0x00fe, 0x0000, 0x43e0, 0x0001, 0x0e5c, 0x0003, 0x1734, 0x0000,
-	0x1530, 0x0000, 0x1632, 0x0008, 0x0d2a, 0x0008, 0x9880, 0x0001,
-	0x0010, 0x0000, 0x8060, 0x0000, 0x0400, 0x0000, 0x7f62, 0x0008,
-	0x8066, 0x0000, 0x1e0a, 0x0008, 0x447a, 0x0003, 0x808a, 0x0008,
-	0x0003, 0x0008, 0x1a60, 0x0000, 0x8062, 0x0008, 0x0002, 0x0000,
-	0x5880, 0x000b, 0x8066, 0x0000, 0x3679, 0x0000, 0x4483, 0x0003,
-	0x5884, 0x0003, 0x3efe, 0x0008, 0x7f4f, 0x0002, 0x088a, 0x000b,
-	0x0d00, 0x0000, 0x0092, 0x000c, 0x8054, 0x0008, 0x0011, 0x0008,
-	0x8074, 0x0000, 0x1010, 0x0008, 0x1efe, 0x0000, 0x300a, 0x000b,
-	0x00c8, 0x000c, 0x000a, 0x000b, 0x00fe, 0x0000, 0x349a, 0x0003,
-	0x1a60, 0x0000, 0x8062, 0x0008, 0x0007, 0x0000, 0x8066, 0x0000,
-	0x0231, 0x0008, 0x4499, 0x000b, 0x03fe, 0x0000, 0x04d0, 0x0001,
-	0x0cc0, 0x000b, 0x82c0, 0x0001, 0x1f00, 0x0000, 0xffa0, 0x0001,
-	0x0400, 0x0000, 0x08af, 0x0003, 0x14c0, 0x000b, 0x01fe, 0x0008,
-	0x0580, 0x0009, 0x7f06, 0x0000, 0x02fe, 0x0008, 0xffc0, 0x0001,
-	0x00ff, 0x0008, 0x0690, 0x0001, 0x10af, 0x0003, 0x7f08, 0x0008,
-	0x84c0, 0x0001, 0xff00, 0x0008, 0x08c0, 0x0003, 0x00fe, 0x0000,
-	0x34b6, 0x000b, 0x8072, 0x0000, 0x1010, 0x0008, 0x3944, 0x0002,
-	0x08b1, 0x0003, 0x00ba, 0x0003, 0x8072, 0x0000, 0x2020, 0x0008,
-	0x3945, 0x000a, 0x08b6, 0x000b, 0x3946, 0x000a, 0x0cc7, 0x0003,
-	0x0000, 0x0007, 0x3943, 0x000a, 0x08c7, 0x000b, 0x00ba, 0x0003,
-	0x00fe, 0x0000, 0x34c5, 0x0003, 0x8072, 0x0000, 0x1000, 0x0000,
-	0x00c7, 0x0003, 0x8072, 0x0000, 0x2000, 0x0000, 0x4000, 0x000f,
-	0x1c60, 0x0000, 0x1b62, 0x0000, 0x8066, 0x0000, 0x0231, 0x0008,
-	0x44cc, 0x000b, 0x58cd, 0x000b, 0x0140, 0x0008, 0x0242, 0x0000,
-	0x1f43, 0x0002, 0x0cdb, 0x000b, 0x0d44, 0x0000, 0x0d46, 0x0008,
-	0x0348, 0x0008, 0x044a, 0x0008, 0x030a, 0x0008, 0x040c, 0x0000,
-	0x0d06, 0x0000, 0x0d08, 0x0008, 0x00df, 0x0003, 0x0344, 0x0008,
-	0x0446, 0x0008, 0x0548, 0x0008, 0x064a, 0x0000, 0x1948, 0x000a,
-	0x08e2, 0x0003, 0x0d4a, 0x0008, 0x58e2, 0x0003, 0x3efe, 0x0008,
-	0x7f4f, 0x0002, 0x08e9, 0x000b, 0x8000, 0x0000, 0x0001, 0x0000,
-	0x0092, 0x000c, 0x8054, 0x0008, 0x0001, 0x0000, 0x8074, 0x0000,
-	0x2020, 0x0008, 0x4000, 0x000f, 0x3a40, 0x000a, 0x0c0d, 0x0003,
-	0x2b24, 0x0008, 0x2b24, 0x0008, 0x58f2, 0x000b, 0x8054, 0x0008,
-	0x0002, 0x0000, 0x1242, 0x0002, 0x0940, 0x0003, 0x3a45, 0x000a,
-	0x092f, 0x0003, 0x8072, 0x0000, 0x1000, 0x0000, 0x3945, 0x000a,
-	0x08ff, 0x0003, 0x8072, 0x0000, 0x3010, 0x0000, 0x1e10, 0x000a,
-	0x7f3c, 0x0000, 0x092a, 0x0003, 0x1d00, 0x0002, 0x7f3a, 0x0000,
-	0x0d60, 0x0000, 0x7f62, 0x0008, 0x8066, 0x0000, 0x0009, 0x0008,
-	0x4508, 0x000b, 0x00fe, 0x0000, 0x3527, 0x000b, 0x1c60, 0x0000,
-	0x8062, 0x0008, 0x0001, 0x0000, 0x8066, 0x0000, 0x0009, 0x0008,
-	0x4510, 0x000b, 0x00fe, 0x0000, 0x3243, 0x000b, 0x0038, 0x0000,
-	0x0060, 0x0008, 0x8062, 0x0008, 0x0019, 0x0000, 0x8066, 0x0000,
-	0x0009, 0x0008, 0x4519, 0x000b, 0x80c0, 0x0009, 0x00ff, 0x0008,
-	0x7f3e, 0x0008, 0x0d60, 0x0000, 0x0efe, 0x0008, 0x1f80, 0x0001,
-	0x7f62, 0x0008, 0x8066, 0x0000, 0x0009, 0x0008, 0x4523, 0x000b,
-	0x003a, 0x0008, 0x1dfe, 0x0000, 0x0104, 0x000b, 0x0036, 0x0008,
-	0x00c8, 0x000c, 0x0140, 0x000b, 0x8074, 0x0000, 0x2000, 0x0000,
-	0x8072, 0x0000, 0x2000, 0x0000, 0x0140, 0x000b, 0x3a44, 0x0002,
-	0x0a71, 0x000b, 0x8074, 0x0000, 0x1000, 0x0000, 0x8072, 0x0000,
-	0x1000, 0x0000, 0x2d0e, 0x0000, 0x2d0e, 0x0000, 0x3640, 0x0003,
-	0x26fe, 0x0008, 0x26fe, 0x0008, 0x2700, 0x0008, 0x2700, 0x0008,
-	0x00d0, 0x0009, 0x0d52, 0x000b, 0x8074, 0x0000, 0x4040, 0x0008,
-	0x5940, 0x0003, 0x50ee, 0x000b, 0x3a46, 0x000a, 0x0d52, 0x000b,
-	0x3a47, 0x0002, 0x094d, 0x000b, 0x8054, 0x0008, 0x0004, 0x0000,
-	0x8074, 0x0000, 0x8000, 0x0000, 0x8072, 0x0000, 0x3000, 0x0008,
-	0x019c, 0x0003, 0x92c0, 0x0009, 0x0fc8, 0x0000, 0x080a, 0x0003,
-	0x1246, 0x000a, 0x0e3a, 0x0003, 0x1a60, 0x0000, 0x8062, 0x0008,
-	0x0002, 0x0000, 0x8066, 0x0000, 0x362a, 0x0000, 0x4557, 0x000b,
-	0x2000, 0x0000, 0x2000, 0x0000, 0x2102, 0x0000, 0x2102, 0x0000,
-	0x2204, 0x0000, 0x2204, 0x0000, 0x2306, 0x0000, 0x2306, 0x0000,
-	0x2408, 0x0000, 0x2408, 0x0000, 0x250a, 0x0000, 0x250a, 0x0000,
-	0x260c, 0x0000, 0x260c, 0x0000, 0x270e, 0x0000, 0x270e, 0x0000,
-	0x2810, 0x0000, 0x2810, 0x0000, 0x2912, 0x0000, 0x2912, 0x0000,
-	0x1a60, 0x0000, 0x8062, 0x0008, 0x0007, 0x0000, 0x8066, 0x0000,
-	0x0052, 0x0000, 0x4571, 0x0003, 0x92c0, 0x0009, 0x0780, 0x0008,
-	0x0e56, 0x0003, 0x124b, 0x0002, 0x097a, 0x0003, 0x2e4d, 0x0002,
-	0x2e4d, 0x0002, 0x0a40, 0x0003, 0x3a46, 0x000a, 0x0d8a, 0x000b,
-	0x597c, 0x0003, 0x8054, 0x0008, 0x0004, 0x0000, 0x1243, 0x000a,
-	0x0998, 0x0003, 0x8010, 0x0008, 0x000d, 0x0000, 0x021b, 0x000c,
-	0x1948, 0x000a, 0x0987, 0x000b, 0x0210, 0x0004, 0x1810, 0x0000,
-	0x021b, 0x000c, 0x0198, 0x000b, 0x1948, 0x000a, 0x098e, 0x000b,
-	0x1243, 0x000a, 0x0a43, 0x0003, 0x194d, 0x000a, 0x0992, 0x0003,
-	0x1243, 0x000a, 0x0a4a, 0x0003, 0x5992, 0x0003, 0x8054, 0x0008,
-	0x0004, 0x0000, 0x0210, 0x0004, 0x1810, 0x0000, 0x021b, 0x000c,
-	0x8074, 0x0000, 0xf000, 0x0008, 0x8072, 0x0000, 0x3000, 0x0008,
-	0x0d30, 0x0000, 0x3a42, 0x0002, 0x0da2, 0x000b, 0x15fe, 0x0008,
-	0x3461, 0x000b, 0x000a, 0x000b, 0x8074, 0x0000, 0x0501, 0x0000,
-	0x8010, 0x0008, 0x000c, 0x0008, 0x021b, 0x000c, 0x000a, 0x000b,
-	0xbbe0, 0x0009, 0x0030, 0x0008, 0x0db8, 0x0003, 0x18fe, 0x0000,
-	0x3ce0, 0x0009, 0x09b5, 0x0003, 0x15fe, 0x0008, 0x3ce0, 0x0009,
-	0x09b5, 0x0003, 0x020b, 0x0004, 0x8076, 0x0008, 0x0040, 0x0000,
-	0x0208, 0x000b, 0x8076, 0x0008, 0x0041, 0x0008, 0x0208, 0x000b,
-	0xbbe0, 0x0009, 0x0032, 0x0000, 0x0dbd, 0x0003, 0x3c1e, 0x0008,
-	0x0208, 0x000b, 0xbbe0, 0x0009, 0x003b, 0x0000, 0x0dc2, 0x000b,
-	0x3c20, 0x0000, 0x0208, 0x000b, 0xbbe0, 0x0009, 0x0035, 0x0008,
-	0x0dc8, 0x000b, 0x8072, 0x0000, 0x8000, 0x0000, 0x0384, 0x000b,
-	0xbbe0, 0x0009, 0x0036, 0x0008, 0x0aa5, 0x000b, 0xbbe0, 0x0009,
-	0x0037, 0x0000, 0x0de9, 0x000b, 0x18fe, 0x0000, 0x3ce0, 0x0009,
-	0x0db5, 0x000b, 0x8076, 0x0008, 0x0040, 0x0000, 0x1a60, 0x0000,
-	0x8062, 0x0008, 0x000d, 0x0000, 0x2604, 0x0008, 0x2604, 0x0008,
-	0x2706, 0x0008, 0x2706, 0x0008, 0x2808, 0x0000, 0x2808, 0x0000,
-	0x290a, 0x0000, 0x290a, 0x0000, 0x8066, 0x0000, 0x0422, 0x0000,
-	0x45e0, 0x000b, 0x0210, 0x0004, 0x8054, 0x0008, 0x0004, 0x0000,
-	0x8074, 0x0000, 0xf000, 0x0008, 0x8072, 0x0000, 0xb000, 0x0000,
-	0x019c, 0x0003, 0xbbe0, 0x0009, 0x0038, 0x0000, 0x0dfb, 0x000b,
-	0x18fe, 0x0000, 0x3ce0, 0x0009, 0x09f8, 0x0003, 0x15fe, 0x0008,
-	0x3ce0, 0x0009, 0x0db1, 0x0003, 0x020b, 0x0004, 0x8076, 0x0008,
-	0x0040, 0x0000, 0x8072, 0x0000, 0x8000, 0x0000, 0x0268, 0x000b,
-	0x8076, 0x0008, 0x0042, 0x0008, 0x0208, 0x000b, 0xbbe0, 0x0009,
-	0x0016, 0x0000, 0x0e08, 0x000b, 0x8074, 0x0000, 0x0808, 0x0008,
-	0x3a44, 0x0002, 0x0c0c, 0x000b, 0x8074, 0x0000, 0x0800, 0x0000,
-	0x8072, 0x0000, 0x8000, 0x0000, 0x8000, 0x000f, 0x000a, 0x000b,
-	0x8072, 0x0000, 0x8000, 0x0000, 0x000a, 0x000b, 0x3d30, 0x000a,
-	0x7f00, 0x0000, 0xbc80, 0x0001, 0x0007, 0x0000, 0x0214, 0x0003,
-	0x1930, 0x000a, 0x7f00, 0x0000, 0x9880, 0x0001, 0x0007, 0x0000,
-	0x8060, 0x0000, 0x0400, 0x0000, 0x7f62, 0x0008, 0x8066, 0x0000,
-	0x000a, 0x0008, 0x4619, 0x000b, 0x4000, 0x000f, 0x221e, 0x000b,
-	0x0870, 0x0008, 0x4000, 0x000f, 0x7e1b, 0x000b, 0xbbe0, 0x0009,
-	0x0030, 0x0008, 0x0e1b, 0x0003, 0x18fe, 0x0000, 0x3ce0, 0x0009,
-	0x0a2c, 0x0003, 0x15fe, 0x0008, 0x3ce0, 0x0009, 0x0a2c, 0x0003,
-	0x020b, 0x0004, 0x8076, 0x0008, 0x0040, 0x0000, 0x022e, 0x0003,
-	0x8076, 0x0008, 0x0041, 0x0008, 0x8072, 0x0000, 0x8000, 0x0000,
-	0x021b, 0x0003, 0xbac0, 0x0009, 0x0090, 0x0008, 0x0a37, 0x0003,
-	0x8074, 0x0000, 0x0706, 0x0000, 0x0239, 0x0003, 0x8074, 0x0000,
-	0x0703, 0x0000, 0x4000, 0x000f, 0x8010, 0x0008, 0x0023, 0x0000,
-	0x0276, 0x000b, 0x8010, 0x0008, 0x0008, 0x0000, 0x0276, 0x000b,
-	0x8010, 0x0008, 0x0022, 0x0008, 0x0276, 0x000b, 0x0210, 0x0004,
-	0x8010, 0x0008, 0x0007, 0x0000, 0x021b, 0x000c, 0x1810, 0x0000,
-	0x021b, 0x000c, 0x0282, 0x0003, 0x0210, 0x0004, 0x8010, 0x0008,
-	0x001b, 0x0008, 0x021b, 0x000c, 0x1810, 0x0000, 0x021b, 0x000c,
-	0x8074, 0x0000, 0xf080, 0x0000, 0x8072, 0x0000, 0x3000, 0x0008,
-	0x0d30, 0x0000, 0x000a, 0x000b, 0x8010, 0x0008, 0x0009, 0x0008,
-	0x0276, 0x000b, 0x8010, 0x0008, 0x0005, 0x0008, 0x0276, 0x000b,
-	0x1648, 0x000a, 0x0c6f, 0x000b, 0x808c, 0x0008, 0x0001, 0x0000,
-	0x8010, 0x0008, 0x0004, 0x0000, 0x4143, 0x000a, 0x086f, 0x0003,
-	0x3a44, 0x0002, 0x0c0a, 0x000b, 0x0d2a, 0x0008, 0x0276, 0x000b,
-	0x8010, 0x0008, 0x0003, 0x0008, 0x027a, 0x000b, 0x8010, 0x0008,
-	0x000b, 0x0000, 0x027a, 0x000b, 0x8010, 0x0008, 0x0002, 0x0000,
-	0x027a, 0x000b, 0x3a47, 0x0002, 0x0d40, 0x000b, 0x8010, 0x0008,
-	0x0006, 0x0008, 0x027a, 0x000b, 0x8074, 0x0000, 0xf000, 0x0008,
-	0x8072, 0x0000, 0x3000, 0x0008, 0x021b, 0x000c, 0x0231, 0x0004,
-	0x3a40, 0x000a, 0x080a, 0x0003, 0x8010, 0x0008, 0x000c, 0x0008,
-	0x021b, 0x000c, 0x000a, 0x000b, 0x8074, 0x0000, 0xf080, 0x0000,
-	0x8072, 0x0000, 0x3000, 0x0008, 0x0d30, 0x0000, 0x2e4d, 0x0002,
-	0x2e4d, 0x0002, 0x0a8d, 0x000b, 0x8054, 0x0008, 0x0019, 0x0000,
-	0x000a, 0x000b, 0x8054, 0x0008, 0x0009, 0x0008, 0x000a, 0x000b,
-	0x3a44, 0x0002, 0x0c0a, 0x000b, 0x026b, 0x000b, 0x808c, 0x0008,
-	0x0000, 0x0008, 0x4447, 0x0002, 0x0ab9, 0x0003, 0xc0c0, 0x0001,
-	0x00ff, 0x0008, 0xffe0, 0x0009, 0x00ff, 0x0008, 0x0e90, 0x0003,
-	0xc1e0, 0x0001, 0xffff, 0x0008, 0x0e90, 0x0003, 0x8010, 0x0008,
-	0x0013, 0x0000, 0x021b, 0x000c, 0x8074, 0x0000, 0x0202, 0x0008,
-	0x000a, 0x000b, 0x3a40, 0x000a, 0x0eb6, 0x000b, 0x8074, 0x0000,
-	0x0200, 0x0000, 0x3d00, 0x0000, 0x3cfe, 0x0000, 0x8072, 0x0000,
-	0x8000, 0x0000, 0x43e0, 0x0001, 0x0eb4, 0x0003, 0x42fe, 0x0000,
-	0xffc0, 0x0001, 0x00ff, 0x0008, 0x00e0, 0x0009, 0x0a90, 0x000b,
-	0x0d08, 0x0008, 0x0309, 0x000b, 0x8072, 0x0000, 0x8000, 0x0000,
-	0x000a, 0x000b, 0x038d, 0x0004, 0x808c, 0x0008, 0x0001, 0x0000,
-	0x04fe, 0x0008, 0x3370, 0x0003, 0x0460, 0x0000, 0x8062, 0x0008,
-	0x0001, 0x0000, 0x8066, 0x0000, 0x0009, 0x0008, 0x46c3, 0x0003,
-	0x0004, 0x0000, 0x80c0, 0x0009, 0x00ff, 0x0008, 0x7f00, 0x0000,
-	0x80e0, 0x0001, 0x0004, 0x0000, 0x0add, 0x000b, 0x80e0, 0x0001,
-	0x0005, 0x0008, 0x0add, 0x000b, 0x80e0, 0x0001, 0x0006, 0x0008,
-	0x0add, 0x000b, 0x82c0, 0x0001, 0xff00, 0x0008, 0x7f04, 0x0008,
-	0x82e0, 0x0009, 0x0600, 0x0008, 0x0add, 0x000b, 0x82e0, 0x0009,
-	0x0500, 0x0008, 0x0add, 0x000b, 0x82e0, 0x0009, 0x0400, 0x0000,
-	0x0f70, 0x0003, 0xc4c0, 0x0009, 0x7000, 0x0000, 0xffe0, 0x0009,
-	0x1000, 0x0000, 0x0b09, 0x0003, 0x037e, 0x0004, 0x3941, 0x0002,
-	0x0ae8, 0x000b, 0x8072, 0x0000, 0x0400, 0x0000, 0x000a, 0x000b,
-	0x0460, 0x0000, 0x80fe, 0x0008, 0x002b, 0x0008, 0x7f62, 0x0008,
-	0x8066, 0x0000, 0x2209, 0x0008, 0x46ee, 0x0003, 0x11fe, 0x0000,
-	0x3304, 0x0003, 0x9180, 0x0001, 0x0002, 0x0000, 0x8060, 0x0000,
-	0x0400, 0x0000, 0x7f62, 0x0008, 0x8066, 0x0000, 0x0609, 0x0008,
-	0x46f8, 0x000b, 0x42fe, 0x0000, 0xffc0, 0x0001, 0xff00, 0x0008,
-	0x03e0, 0x0009, 0x0f01, 0x0003, 0x8072, 0x0000, 0x0400, 0x0000,
-	0x0046, 0x0003, 0x9180, 0x0001, 0x0003, 0x0008, 0x02eb, 0x0003,
-	0x8072, 0x0000, 0x0400, 0x0000, 0x8010, 0x0008, 0x0010, 0x0000,
-	0x0361, 0x0003, 0x037e, 0x0004, 0x3941, 0x0002, 0x0b0f, 0x0003,
-	0x8072, 0x0000, 0x0400, 0x0000, 0x000a, 0x000b, 0x0346, 0x000c,
-	0x11fe, 0x0000, 0x3717, 0x0003, 0x8072, 0x0000, 0x0400, 0x0000,
-	0x8010, 0x0008, 0x000e, 0x0000, 0x0361, 0x0003, 0x8060, 0x0000,
-	0x0400, 0x0000, 0x04fe, 0x0008, 0x372c, 0x000b, 0x808c, 0x0008,
-	0x0000, 0x0008, 0x9180, 0x0001, 0x0005, 0x0008, 0x7f62, 0x0008,
-	0x8066, 0x0000, 0x0009, 0x0008, 0x4722, 0x000b, 0x0060, 0x0008,
-	0x8062, 0x0008, 0x001b, 0x0008, 0x4304, 0x0008, 0x4206, 0x0008,
-	0x8066, 0x0000, 0x0412, 0x0000, 0x472a, 0x0003, 0x0343, 0x0003,
-	0x808c, 0x0008, 0x0001, 0x0000, 0x0460, 0x0000, 0x8062, 0x0008,
-	0x002b, 0x0008, 0x8066, 0x0000, 0x0609, 0x0008, 0x4733, 0x000b,
-	0x8066, 0x0000, 0x220a, 0x0008, 0x4736, 0x000b, 0x42fe, 0x0000,
-	0xffc0, 0x0001, 0xff00, 0x0008, 0x7f04, 0x0008, 0x8060, 0x0000,
-	0x0400, 0x0000, 0x9180, 0x0001, 0x0002, 0x0000, 0x7f62, 0x0008,
-	0x8066, 0x0000, 0x041a, 0x0008, 0x4742, 0x000b, 0x8072, 0x0000,
-	0x0400, 0x0000, 0x0046, 0x0003, 0x8060, 0x0000, 0x0400, 0x0000,
-	0x1362, 0x0008, 0x8066, 0x0000, 0x0411, 0x0000, 0x474b, 0x000b,
-	0x02fe, 0x0008, 0x03e0, 0x0009, 0x0f51, 0x0003, 0x0d22, 0x0000,
-	0x4000, 0x000f, 0x8280, 0x0009, 0x0002, 0x0000, 0x1380, 0x0001,
-	0x7f62, 0x0008, 0x8066, 0x0000, 0x2209, 0x0008, 0x4757, 0x0003,
-	0x0200, 0x000a, 0xffc0, 0x0001, 0x0007, 0x0000, 0x7f06, 0x0000,
-	0x1362, 0x0008, 0x8066, 0x0000, 0x060a, 0x0008, 0x475f, 0x000b,
-	0x4000, 0x000f, 0x3a44, 0x0002, 0x0c0a, 0x000b, 0x2f44, 0x000a,
-	0x2f44, 0x000a, 0x0e6b, 0x000b, 0x808a, 0x0008, 0x0003, 0x0008,
-	0x8074, 0x0000, 0xf080, 0x0000, 0x8072, 0x0000, 0x3000, 0x0008,
-	0x5b6c, 0x0003, 0x8054, 0x0008, 0x0019, 0x0000, 0x000a, 0x000b,
-	0x3a44, 0x0002, 0x0c0a, 0x000b, 0x808c, 0x0008, 0x0000, 0x0008,
-	0x8010, 0x0008, 0x0011, 0x0008, 0x021b, 0x000c, 0x42fe, 0x0000,
-	0xffc0, 0x0001, 0x00ff, 0x0008, 0x7f10, 0x0008, 0x021b, 0x000c,
-	0x4310, 0x0008, 0x027a, 0x000b, 0x3941, 0x0002, 0x0b81, 0x0003,
-	0x4000, 0x000f, 0x8072, 0x0000, 0x0404, 0x0008, 0x4000, 0x000f,
-	0x8010, 0x0008, 0x0012, 0x0008, 0x021b, 0x000c, 0x0346, 0x000c,
-	0x1110, 0x0000, 0x021b, 0x000c, 0x11fe, 0x0000, 0x3787, 0x0003,
-	0x000a, 0x000b, 0xc2c0, 0x0009, 0x00ff, 0x0008, 0x7f00, 0x0000,
-	0xc3c0, 0x0001, 0xff00, 0x0008, 0x00d0, 0x0009, 0x0bb2, 0x0003,
-	0x0d0a, 0x0000, 0x8580, 0x0001, 0x1000, 0x0000, 0x7f62, 0x0008,
-	0x8060, 0x0000, 0x0400, 0x0000, 0x8066, 0x0000, 0x0809, 0x0000,
-	0x479c, 0x000b, 0x04fe, 0x0008, 0x33ab, 0x0003, 0x0460, 0x0000,
-	0x8062, 0x0008, 0x0004, 0x0000, 0x8066, 0x0000, 0x0211, 0x0000,
-	0x47a4, 0x0003, 0x01fe, 0x0008, 0x00e0, 0x0009, 0x0fab, 0x0003,
-	0x02fe, 0x0008, 0x43e0, 0x0001, 0x0bb1, 0x0003, 0x0500, 0x0002,
-	0x7f0a, 0x0000, 0xffe0, 0x0009, 0x0800, 0x0000, 0x0f95, 0x000b,
-	0x0d08, 0x0008, 0x4000, 0x000f, 0x43fe, 0x0008, 0x3e80, 0x0001,
-	0xffc0, 0x0001, 0x7fff, 0x0000, 0x0d60, 0x0000, 0x7f62, 0x0008,
-	0x8066, 0x0000, 0x0809, 0x0000, 0x47ba, 0x0003, 0x8060, 0x0000,
-	0x0400, 0x0000, 0x84c0, 0x0001, 0xff00, 0x0008, 0x7f60, 0x000a,
-	0x7f60, 0x000a, 0x7f60, 0x000a, 0x7f60, 0x000a, 0x7f60, 0x000a,
-	0x7f60, 0x000a, 0x7f60, 0x000a, 0x7f60, 0x000a, 0xff80, 0x0009,
-	0x1000, 0x0000, 0x7f62, 0x0008, 0x8066, 0x0000, 0x0809, 0x0000,
-	0x47cc, 0x000b, 0x4000, 0x000f, 0x5ff4, 0xebed, 0x0001, 0x0002,
-	0x0004, 0x0008, 0x0010, 0x0020, 0x0040, 0x0080, 0x0100, 0x0200,
-	0x0400, 0x0800, 0x1000, 0x2000, 0x4000, 0x8000, 0x2c40
+	0x2c20, 0x2128, 0x20a9, 0x007f, 0x900e, 0x0016, 0x0036, 0x080c,
+	0x6608, 0x1190, 0x0056, 0x0086, 0x9046, 0x2508, 0x2029, 0x0001,
+	0x0096, 0x904e, 0x080c, 0xa69d, 0x009e, 0x008e, 0x903e, 0x080c,
+	0xa748, 0x080c, 0xe478, 0x005e, 0x003e, 0x001e, 0x8108, 0x1f04,
+	0xe505, 0x015e, 0x00ce, 0x007e, 0x005e, 0x004e, 0x00be, 0x0005,
+	0x00b6, 0x0076, 0x0056, 0x6210, 0x2258, 0x0086, 0x9046, 0x2029,
+	0x0001, 0x2019, 0x0048, 0x0096, 0x904e, 0x080c, 0xa69d, 0x009e,
+	0x008e, 0x903e, 0x080c, 0xa748, 0x2c20, 0x080c, 0xe478, 0x005e,
+	0x007e, 0x00be, 0x0005, 0x00b6, 0x0046, 0x0056, 0x0076, 0x00c6,
+	0x0156, 0x2c20, 0x20a9, 0x0800, 0x900e, 0x0016, 0x0036, 0x080c,
+	0x6608, 0x11a0, 0x0086, 0x9046, 0x2828, 0x0046, 0x2021, 0x0001,
+	0x080c, 0xe810, 0x004e, 0x0096, 0x904e, 0x080c, 0xa69d, 0x009e,
+	0x008e, 0x903e, 0x080c, 0xa748, 0x080c, 0xe478, 0x003e, 0x001e,
+	0x8108, 0x1f04, 0xe54d, 0x015e, 0x00ce, 0x007e, 0x005e, 0x004e,
+	0x00be, 0x0005, 0x0016, 0x00f6, 0x080c, 0xcb48, 0x0198, 0xa864,
+	0x9084, 0x00ff, 0x9086, 0x0046, 0x0180, 0xa800, 0x907d, 0x0138,
+	0xa803, 0x0000, 0xab82, 0x080c, 0x6c86, 0x2f48, 0x0cb0, 0xab82,
+	0x080c, 0x6c86, 0x00fe, 0x001e, 0x0005, 0xa800, 0x907d, 0x0130,
+	0xa803, 0x0000, 0x080c, 0x6c86, 0x2f48, 0x0cb8, 0x080c, 0x6c86,
+	0x0c88, 0x00e6, 0x0046, 0x0036, 0x2061, 0x1cd0, 0x9005, 0x1138,
+	0x2071, 0x1800, 0x7454, 0x7074, 0x8001, 0x9402, 0x12f8, 0x2100,
+	0x9c06, 0x0188, 0x6000, 0x9086, 0x0000, 0x0168, 0x6008, 0x9206,
+	0x1150, 0x6320, 0x9386, 0x0009, 0x01b0, 0x6010, 0x91a0, 0x0004,
+	0x2424, 0x9406, 0x0140, 0x9ce0, 0x0018, 0x2001, 0x181a, 0x2004,
+	0x9c02, 0x1220, 0x0c20, 0x9085, 0x0001, 0x0008, 0x9006, 0x003e,
+	0x004e, 0x00ee, 0x0005, 0x631c, 0xd3c4, 0x1d68, 0x0c30, 0x0096,
+	0x0006, 0x080c, 0x0fff, 0x000e, 0x090c, 0x0dd5, 0xaae2, 0xa867,
+	0x010d, 0xa88e, 0x0026, 0x2010, 0x080c, 0xcb38, 0x2001, 0x0000,
+	0x0120, 0x2200, 0x9080, 0x0015, 0x2004, 0x002e, 0xa87a, 0x9186,
+	0x0020, 0x0110, 0xa8e3, 0xffff, 0xa986, 0xac76, 0xa87f, 0x0000,
+	0x2001, 0x198d, 0x2004, 0xa882, 0x9006, 0xa802, 0xa86a, 0xa88a,
+	0x0126, 0x2091, 0x8000, 0x080c, 0x6c86, 0x012e, 0x009e, 0x0005,
+	0x6700, 0x9786, 0x0000, 0x0158, 0x9786, 0x0001, 0x0140, 0x9786,
+	0x000a, 0x0128, 0x9786, 0x0009, 0x0110, 0x9085, 0x0001, 0x0005,
+	0x00e6, 0x6010, 0x9075, 0x0138, 0x00b6, 0x2058, 0xb8a0, 0x00be,
+	0x9206, 0x00ee, 0x0005, 0x9085, 0x0001, 0x0cd8, 0x0016, 0x6004,
+	0x908e, 0x001e, 0x11a0, 0x8007, 0x6134, 0x918c, 0x00ff, 0x9105,
+	0x6036, 0x6007, 0x0085, 0x6003, 0x000b, 0x6023, 0x0005, 0x2001,
+	0x1986, 0x2004, 0x601a, 0x080c, 0x90d9, 0x080c, 0x9687, 0x001e,
+	0x0005, 0xa001, 0xa001, 0x0005, 0x6024, 0xd0e4, 0x0158, 0xd0cc,
+	0x0118, 0x080c, 0xce82, 0x0030, 0x080c, 0xe82c, 0x080c, 0x869b,
+	0x080c, 0xae71, 0x0005, 0x9280, 0x0008, 0x2004, 0x9084, 0x000f,
+	0x0002, 0xe65f, 0xe65f, 0xe65f, 0xe661, 0xe65f, 0xe661, 0xe661,
+	0xe65f, 0xe661, 0xe65f, 0xe65f, 0xe65f, 0xe65f, 0xe65f, 0x9006,
+	0x0005, 0x9085, 0x0001, 0x0005, 0x9280, 0x0008, 0x2004, 0x9084,
+	0x000f, 0x0002, 0xe678, 0xe678, 0xe678, 0xe678, 0xe678, 0xe678,
+	0xe685, 0xe678, 0xe678, 0xe678, 0xe678, 0xe678, 0xe678, 0xe678,
+	0x6007, 0x003b, 0x602f, 0x0009, 0x6017, 0x2a00, 0x6003, 0x0001,
+	0x080c, 0x90d9, 0x080c, 0x9687, 0x0005, 0x0096, 0x00c6, 0x2260,
+	0x080c, 0xe82c, 0x6043, 0x0000, 0x6024, 0xc0f4, 0xc0e4, 0x6026,
+	0x603b, 0x0000, 0x00ce, 0x00d6, 0x2268, 0x9186, 0x0007, 0x1904,
+	0xe6de, 0x6814, 0x9005, 0x0138, 0x2048, 0xa87c, 0xd0fc, 0x1118,
+	0x00de, 0x009e, 0x08a8, 0x6007, 0x003a, 0x6003, 0x0001, 0x080c,
+	0x90d9, 0x080c, 0x9687, 0x00c6, 0x2d60, 0x6100, 0x9186, 0x0002,
+	0x1904, 0xe755, 0x6014, 0x9005, 0x1138, 0x6000, 0x9086, 0x0007,
+	0x190c, 0x0dd5, 0x0804, 0xe755, 0x2048, 0x080c, 0xcb4a, 0x1130,
+	0x0028, 0x2048, 0xa800, 0x9005, 0x1de0, 0x2900, 0x2048, 0xa87c,
+	0x9084, 0x0003, 0x9086, 0x0002, 0x1168, 0xa87c, 0xc0dc, 0xc0f4,
+	0xa87e, 0xa880, 0xc0fc, 0xa882, 0x2009, 0x0043, 0x080c, 0xdfae,
+	0x0804, 0xe755, 0x2009, 0x0041, 0x0804, 0xe74f, 0x9186, 0x0005,
+	0x15a0, 0x6814, 0x2048, 0xa87c, 0xd0bc, 0x1120, 0x00de, 0x009e,
+	0x0804, 0xe678, 0xd0b4, 0x0128, 0xd0fc, 0x090c, 0x0dd5, 0x0804,
+	0xe699, 0x6007, 0x003a, 0x6003, 0x0001, 0x080c, 0x90d9, 0x080c,
+	0x9687, 0x00c6, 0x2d60, 0x6100, 0x9186, 0x0002, 0x0120, 0x9186,
+	0x0004, 0x1904, 0xe755, 0x6814, 0x2048, 0xa97c, 0xc1f4, 0xc1dc,
+	0xa97e, 0xa980, 0xc1fc, 0xc1bc, 0xa982, 0x00f6, 0x2c78, 0x080c,
+	0x1727, 0x00fe, 0x2009, 0x0042, 0x04d0, 0x0036, 0x080c, 0x0fff,
+	0x090c, 0x0dd5, 0xa867, 0x010d, 0x9006, 0xa802, 0xa86a, 0xa88a,
+	0x2d18, 0xab8e, 0xa887, 0x0045, 0x2c00, 0xa892, 0x6038, 0xa8a2,
+	0x2360, 0x6024, 0xc0dd, 0x6026, 0x6010, 0x00b6, 0x2058, 0xb8a0,
+	0x00be, 0x2004, 0x6354, 0xab7a, 0xa876, 0x9006, 0xa87e, 0xa882,
+	0xad9a, 0xae96, 0xa89f, 0x0001, 0x080c, 0x6c86, 0x2019, 0x0045,
+	0x6008, 0x2068, 0x080c, 0xe155, 0x2d00, 0x600a, 0x6023, 0x0006,
+	0x6003, 0x0007, 0x901e, 0x631a, 0x6342, 0x003e, 0x0038, 0x6043,
+	0x0000, 0x6003, 0x0007, 0x080c, 0xdfae, 0x00ce, 0x00de, 0x009e,
+	0x0005, 0x9186, 0x0013, 0x1128, 0x6004, 0x9082, 0x0085, 0x2008,
+	0x00c2, 0x9186, 0x0027, 0x1178, 0x080c, 0x957b, 0x0036, 0x0096,
+	0x6014, 0x2048, 0x2019, 0x0004, 0x080c, 0xe572, 0x009e, 0x003e,
+	0x080c, 0x9687, 0x0005, 0x9186, 0x0014, 0x0d70, 0x080c, 0xaf07,
+	0x0005, 0xe788, 0xe786, 0xe786, 0xe786, 0xe786, 0xe786, 0xe788,
+	0xe786, 0xe786, 0xe786, 0xe786, 0xe786, 0xe786, 0x080c, 0x0dd5,
+	0x080c, 0x957b, 0x6003, 0x000c, 0x080c, 0x9687, 0x0005, 0x9182,
+	0x0092, 0x1220, 0x9182, 0x0085, 0x0208, 0x001a, 0x080c, 0xaf07,
+	0x0005, 0xe7a6, 0xe7a6, 0xe7a6, 0xe7a6, 0xe7a8, 0xe7c8, 0xe7a6,
+	0xe7a6, 0xe7a6, 0xe7a6, 0xe7a6, 0xe7a6, 0xe7a6, 0x080c, 0x0dd5,
+	0x00d6, 0x2c68, 0x080c, 0xae1b, 0x01b0, 0x6003, 0x0001, 0x6007,
+	0x001e, 0x2009, 0x026e, 0x210c, 0x613a, 0x2009, 0x026f, 0x210c,
+	0x613e, 0x600b, 0xffff, 0x6910, 0x6112, 0x6023, 0x0004, 0x080c,
+	0x90d9, 0x080c, 0x9687, 0x2d60, 0x080c, 0xae71, 0x00de, 0x0005,
+	0x080c, 0xae71, 0x0005, 0x00e6, 0x6010, 0x00b6, 0x2058, 0xb800,
+	0x00be, 0xd0ec, 0x00ee, 0x0005, 0x2009, 0x1867, 0x210c, 0xd1ec,
+	0x05b0, 0x6003, 0x0002, 0x6024, 0xc0e5, 0x6026, 0xd0cc, 0x0150,
+	0x2001, 0x1987, 0x2004, 0x6042, 0x2009, 0x1867, 0x210c, 0xd1f4,
+	0x1520, 0x00a0, 0x2009, 0x1867, 0x210c, 0xd1f4, 0x0128, 0x6024,
+	0xc0e4, 0x6026, 0x9006, 0x00d8, 0x2001, 0x1987, 0x200c, 0x2001,
+	0x1985, 0x2004, 0x9100, 0x9080, 0x000a, 0x6042, 0x6010, 0x00b6,
+	0x2058, 0xb8bc, 0x00be, 0x0008, 0x2104, 0x9005, 0x0118, 0x9088,
+	0x0003, 0x0cd0, 0x2c0a, 0x600f, 0x0000, 0x9085, 0x0001, 0x0005,
+	0x0016, 0x00c6, 0x00e6, 0x6154, 0xb8bc, 0x2060, 0x8cff, 0x0180,
+	0x84ff, 0x1118, 0x6054, 0x9106, 0x1138, 0x600c, 0x2072, 0x080c,
+	0x869b, 0x080c, 0xae71, 0x0010, 0x9cf0, 0x0003, 0x2e64, 0x0c70,
+	0x00ee, 0x00ce, 0x001e, 0x0005, 0x00d6, 0x00b6, 0x6010, 0x2058,
+	0xb8bc, 0x2068, 0x9005, 0x0130, 0x9c06, 0x0110, 0x680c, 0x0cd0,
+	0x600c, 0x680e, 0x00be, 0x00de, 0x0005, 0x0026, 0x0036, 0x0156,
+	0x2011, 0x182c, 0x2204, 0x9084, 0x00ff, 0x2019, 0x026e, 0x2334,
+	0x9636, 0x1508, 0x8318, 0x2334, 0x2204, 0x9084, 0xff00, 0x9636,
+	0x11d0, 0x2011, 0x0270, 0x20a9, 0x0004, 0x6010, 0x0096, 0x2048,
+	0x2019, 0x000a, 0x080c, 0xbe30, 0x009e, 0x1168, 0x2011, 0x0274,
+	0x20a9, 0x0004, 0x6010, 0x0096, 0x2048, 0x2019, 0x0006, 0x080c,
+	0xbe30, 0x009e, 0x1100, 0x015e, 0x003e, 0x002e, 0x0005, 0x00e6,
+	0x2071, 0x1800, 0x080c, 0x5fb6, 0x080c, 0x2f98, 0x00ee, 0x0005,
+	0x0096, 0x0026, 0x080c, 0x0fff, 0x090c, 0x0dd5, 0xa85c, 0x9080,
+	0x001a, 0x20a0, 0x20a9, 0x000c, 0xa860, 0x20e8, 0x9006, 0x4004,
+	0x9186, 0x0046, 0x1118, 0xa867, 0x0136, 0x0038, 0xa867, 0x0138,
+	0x9186, 0x0041, 0x0110, 0xa87b, 0x0001, 0x7038, 0x9084, 0xff00,
+	0x7240, 0x9294, 0xff00, 0x8007, 0x9215, 0xaa9a, 0x9186, 0x0046,
+	0x1168, 0x7038, 0x9084, 0x00ff, 0x723c, 0x9294, 0xff00, 0x9215,
+	0xaa9e, 0x723c, 0x9294, 0x00ff, 0xaaa2, 0x0060, 0x7040, 0x9084,
+	0x00ff, 0x7244, 0x9294, 0xff00, 0x9215, 0xaa9e, 0x7244, 0x9294,
+	0x00ff, 0xaaa2, 0x9186, 0x0046, 0x1118, 0x9e90, 0x0012, 0x0010,
+	0x9e90, 0x001a, 0x2204, 0x8007, 0xa8a6, 0x8210, 0x2204, 0x8007,
+	0xa8aa, 0x8210, 0x2204, 0x8007, 0xa8ae, 0x8210, 0x2204, 0x8007,
+	0xa8b2, 0x8210, 0x9186, 0x0046, 0x11b8, 0x9e90, 0x0016, 0x2204,
+	0x8007, 0xa8b6, 0x8210, 0x2204, 0x8007, 0xa8ba, 0x8210, 0x2204,
+	0x8007, 0xa8be, 0x8210, 0x2204, 0x8007, 0xa8c2, 0x8210, 0x2011,
+	0x0205, 0x2013, 0x0001, 0x00b0, 0x9e90, 0x001e, 0x2204, 0x8007,
+	0xa8b6, 0x8210, 0x2204, 0x8007, 0xa8ba, 0x2011, 0x0205, 0x2013,
+	0x0001, 0x2011, 0x0260, 0x2204, 0x8007, 0xa8be, 0x8210, 0x2204,
+	0x8007, 0xa8c2, 0x9186, 0x0046, 0x1118, 0x2011, 0x0262, 0x0010,
+	0x2011, 0x026a, 0x0146, 0x01d6, 0x0036, 0x20a9, 0x0001, 0x2019,
+	0x0008, 0xa860, 0x20e8, 0xa85c, 0x9080, 0x0031, 0x20a0, 0x2204,
+	0x8007, 0x4004, 0x8210, 0x8319, 0x1dd0, 0x003e, 0x01ce, 0x013e,
+	0x2011, 0x0205, 0x2013, 0x0000, 0x002e, 0x080c, 0x6c86, 0x009e,
+	0x0005, 0x00e6, 0x6010, 0x00b6, 0x2058, 0xb800, 0x00be, 0xd0fc,
+	0x0108, 0x0011, 0x00ee, 0x0005, 0xa880, 0xc0e5, 0xa882, 0x0005,
+	0x00e6, 0x00d6, 0x00c6, 0x0076, 0x0066, 0x0056, 0x0046, 0x0026,
+	0x0016, 0x0126, 0x2091, 0x8000, 0x2029, 0x19ef, 0x252c, 0x2021,
+	0x19f5, 0x2424, 0x2061, 0x1cd0, 0x2071, 0x1800, 0x7654, 0x7074,
+	0x9606, 0x0578, 0x6720, 0x9786, 0x0001, 0x0118, 0x9786, 0x0008,
+	0x1500, 0x2500, 0x9c06, 0x01e8, 0x2400, 0x9c06, 0x01d0, 0x080c,
+	0xe600, 0x01b8, 0x080c, 0xe610, 0x11a0, 0x6000, 0x9086, 0x0004,
+	0x1120, 0x0016, 0x080c, 0x1a60, 0x001e, 0x080c, 0xcd3f, 0x1110,
+	0x080c, 0x31ea, 0x080c, 0xcd50, 0x1110, 0x080c, 0xb824, 0x080c,
+	0xaea2, 0x9ce0, 0x0018, 0x2001, 0x181a, 0x2004, 0x9c02, 0x1208,
+	0x0858, 0x012e, 0x001e, 0x002e, 0x004e, 0x005e, 0x006e, 0x007e,
+	0x00ce, 0x00de, 0x00ee, 0x0005, 0x2001, 0x1810, 0x2004, 0xd0dc,
+	0x0005, 0x0006, 0x2001, 0x1837, 0x2004, 0xd09c, 0x000e, 0x0005,
+	0x0006, 0x0036, 0x0046, 0x080c, 0xd24a, 0x0168, 0x2019, 0xffff,
+	0x9005, 0x0128, 0x6010, 0x00b6, 0x2058, 0xbba0, 0x00be, 0x2021,
+	0x0004, 0x080c, 0x4ccb, 0x004e, 0x003e, 0x000e, 0x6004, 0x9086,
+	0x0001, 0x1128, 0x080c, 0xa80e, 0x080c, 0xaea2, 0x9006, 0x0005,
+	0x00e6, 0x00c6, 0x00b6, 0x0046, 0x2061, 0x1cd0, 0x2071, 0x1800,
+	0x7454, 0x7074, 0x8001, 0x9402, 0x12b8, 0x2100, 0x9c06, 0x0148,
+	0x6000, 0x9086, 0x0000, 0x0128, 0x6010, 0x2058, 0xb8a0, 0x9206,
+	0x0140, 0x9ce0, 0x0018, 0x2001, 0x181a, 0x2004, 0x9c02, 0x1220,
+	0x0c60, 0x9085, 0x0001, 0x0008, 0x9006, 0x004e, 0x00be, 0x00ce,
+	0x00ee, 0x0005, 0x0126, 0x0006, 0x00e6, 0x0016, 0x2091, 0x8000,
+	0x2071, 0x1840, 0xd5a4, 0x0118, 0x7004, 0x8000, 0x7006, 0xd5b4,
+	0x0118, 0x7000, 0x8000, 0x7002, 0xd5ac, 0x0178, 0x2500, 0x9084,
+	0x0007, 0x908e, 0x0003, 0x0148, 0x908e, 0x0004, 0x0130, 0x908e,
+	0x0005, 0x0118, 0x2071, 0xfffe, 0x0089, 0x001e, 0x00ee, 0x000e,
+	0x012e, 0x0005, 0x0126, 0x0006, 0x00e6, 0x2091, 0x8000, 0x2071,
+	0xfff6, 0x0021, 0x00ee, 0x000e, 0x012e, 0x0005, 0x2e05, 0x8000,
+	0x2077, 0x1220, 0x8e70, 0x2e05, 0x8000, 0x2077, 0x0005, 0x00e6,
+	0x2071, 0xfff4, 0x0c99, 0x00ee, 0x0005, 0x00e6, 0x2071, 0xfff8,
+	0x0c69, 0x00ee, 0x0005, 0x0126, 0x0006, 0x00e6, 0x2091, 0x8000,
+	0x2071, 0x1840, 0x7014, 0x8000, 0x7016, 0x00ee, 0x000e, 0x012e,
+	0x0005, 0x0003, 0x000b, 0x079e, 0x0000, 0xc000, 0x0001, 0x8064,
+	0x0008, 0x0010, 0x0000, 0x8066, 0x0000, 0x0101, 0x0008, 0x4407,
+	0x0003, 0x8060, 0x0000, 0x0400, 0x0000, 0x580d, 0x000b, 0x79a8,
+	0x000b, 0x50ee, 0x000b, 0x4c0a, 0x0003, 0xbac0, 0x0009, 0x008a,
+	0x0000, 0x0c0a, 0x000b, 0x15fe, 0x0008, 0x340a, 0x0003, 0xc4c0,
+	0x0009, 0x7000, 0x0000, 0xffa0, 0x0001, 0x2000, 0x0000, 0x1668,
+	0x000b, 0x808c, 0x0008, 0x0001, 0x0000, 0x0000, 0x0007, 0x4028,
+	0x0000, 0x4047, 0x000a, 0x808c, 0x0008, 0x0002, 0x0000, 0x0822,
+	0x0003, 0x4022, 0x0000, 0x0028, 0x000b, 0x4122, 0x0008, 0x94c0,
+	0x0009, 0xff00, 0x0008, 0xffe0, 0x0009, 0x0500, 0x0008, 0x0a93,
+	0x000b, 0x4447, 0x0002, 0x0e90, 0x0003, 0x0bfe, 0x0008, 0x11a0,
+	0x0001, 0x126e, 0x0003, 0x0ca0, 0x0001, 0x126e, 0x0003, 0x9180,
+	0x0001, 0x0004, 0x0000, 0x8060, 0x0000, 0x0400, 0x0000, 0x7f62,
+	0x0008, 0x8066, 0x0000, 0x0009, 0x0008, 0x4436, 0x000b, 0x808c,
+	0x0008, 0x0000, 0x0008, 0x0060, 0x0008, 0x8062, 0x0008, 0x0004,
+	0x0000, 0x8066, 0x0000, 0x0411, 0x0000, 0x443e, 0x0003, 0x03fe,
+	0x0000, 0x43e0, 0x0001, 0x0e6b, 0x000b, 0xc2c0, 0x0009, 0x00ff,
+	0x0008, 0x02e0, 0x0001, 0x0e6b, 0x000b, 0x9180, 0x0001, 0x0005,
+	0x0008, 0x8060, 0x0000, 0x0400, 0x0000, 0x7f62, 0x0008, 0x8066,
+	0x0000, 0x0019, 0x0000, 0x444d, 0x000b, 0x0240, 0x0002, 0x0a68,
+	0x0003, 0x00fe, 0x0000, 0x326b, 0x000b, 0x0248, 0x000a, 0x085c,
+	0x0003, 0x9180, 0x0001, 0x0006, 0x0008, 0x7f62, 0x0008, 0x8002,
+	0x0008, 0x0003, 0x0008, 0x8066, 0x0000, 0x020a, 0x0000, 0x445b,
+	0x0003, 0x112a, 0x0000, 0x002e, 0x0008, 0x022c, 0x0008, 0x3a44,
+	0x0002, 0x0c0a, 0x000b, 0x808c, 0x0008, 0x0002, 0x0000, 0x1760,
+	0x0008, 0x8062, 0x0008, 0x000f, 0x0008, 0x8066, 0x0000, 0x0011,
+	0x0008, 0x4468, 0x0003, 0x01fe, 0x0008, 0x42e0, 0x0009, 0x0e5c,
+	0x0003, 0x00fe, 0x0000, 0x43e0, 0x0001, 0x0e5c, 0x0003, 0x1734,
+	0x0000, 0x1530, 0x0000, 0x1632, 0x0008, 0x0d2a, 0x0008, 0x9880,
+	0x0001, 0x0010, 0x0000, 0x8060, 0x0000, 0x0400, 0x0000, 0x7f62,
+	0x0008, 0x8066, 0x0000, 0x1e0a, 0x0008, 0x447a, 0x0003, 0x808a,
+	0x0008, 0x0003, 0x0008, 0x1a60, 0x0000, 0x8062, 0x0008, 0x0002,
+	0x0000, 0x5880, 0x000b, 0x8066, 0x0000, 0x3679, 0x0000, 0x4483,
+	0x0003, 0x5884, 0x0003, 0x3efe, 0x0008, 0x7f4f, 0x0002, 0x088a,
+	0x000b, 0x0d00, 0x0000, 0x0092, 0x000c, 0x8054, 0x0008, 0x0011,
+	0x0008, 0x8074, 0x0000, 0x1010, 0x0008, 0x1efe, 0x0000, 0x300a,
+	0x000b, 0x00c8, 0x000c, 0x000a, 0x000b, 0x00fe, 0x0000, 0x349a,
+	0x0003, 0x1a60, 0x0000, 0x8062, 0x0008, 0x0007, 0x0000, 0x8066,
+	0x0000, 0x0231, 0x0008, 0x4499, 0x000b, 0x03fe, 0x0000, 0x04d0,
+	0x0001, 0x0cc0, 0x000b, 0x82c0, 0x0001, 0x1f00, 0x0000, 0xffa0,
+	0x0001, 0x0400, 0x0000, 0x08af, 0x0003, 0x14c0, 0x000b, 0x01fe,
+	0x0008, 0x0580, 0x0009, 0x7f06, 0x0000, 0x02fe, 0x0008, 0xffc0,
+	0x0001, 0x00ff, 0x0008, 0x0690, 0x0001, 0x10af, 0x0003, 0x7f08,
+	0x0008, 0x84c0, 0x0001, 0xff00, 0x0008, 0x08c0, 0x0003, 0x00fe,
+	0x0000, 0x34b6, 0x000b, 0x8072, 0x0000, 0x1010, 0x0008, 0x3944,
+	0x0002, 0x08b1, 0x0003, 0x00ba, 0x0003, 0x8072, 0x0000, 0x2020,
+	0x0008, 0x3945, 0x000a, 0x08b6, 0x000b, 0x3946, 0x000a, 0x0cc7,
+	0x0003, 0x0000, 0x0007, 0x3943, 0x000a, 0x08c7, 0x000b, 0x00ba,
+	0x0003, 0x00fe, 0x0000, 0x34c5, 0x0003, 0x8072, 0x0000, 0x1000,
+	0x0000, 0x00c7, 0x0003, 0x8072, 0x0000, 0x2000, 0x0000, 0x4000,
+	0x000f, 0x1c60, 0x0000, 0x1b62, 0x0000, 0x8066, 0x0000, 0x0231,
+	0x0008, 0x44cc, 0x000b, 0x58cd, 0x000b, 0x0140, 0x0008, 0x0242,
+	0x0000, 0x1f43, 0x0002, 0x0cdb, 0x000b, 0x0d44, 0x0000, 0x0d46,
+	0x0008, 0x0348, 0x0008, 0x044a, 0x0008, 0x030a, 0x0008, 0x040c,
+	0x0000, 0x0d06, 0x0000, 0x0d08, 0x0008, 0x00df, 0x0003, 0x0344,
+	0x0008, 0x0446, 0x0008, 0x0548, 0x0008, 0x064a, 0x0000, 0x1948,
+	0x000a, 0x08e2, 0x0003, 0x0d4a, 0x0008, 0x58e2, 0x0003, 0x3efe,
+	0x0008, 0x7f4f, 0x0002, 0x08e9, 0x000b, 0x8000, 0x0000, 0x0001,
+	0x0000, 0x0092, 0x000c, 0x8054, 0x0008, 0x0001, 0x0000, 0x8074,
+	0x0000, 0x2020, 0x0008, 0x4000, 0x000f, 0x3a40, 0x000a, 0x0c0d,
+	0x0003, 0x2b24, 0x0008, 0x2b24, 0x0008, 0x58f2, 0x000b, 0x8054,
+	0x0008, 0x0002, 0x0000, 0x1242, 0x0002, 0x0940, 0x0003, 0x3a45,
+	0x000a, 0x092f, 0x0003, 0x8072, 0x0000, 0x1000, 0x0000, 0x3945,
+	0x000a, 0x08ff, 0x0003, 0x8072, 0x0000, 0x3010, 0x0000, 0x1e10,
+	0x000a, 0x7f3c, 0x0000, 0x092a, 0x0003, 0x1d00, 0x0002, 0x7f3a,
+	0x0000, 0x0d60, 0x0000, 0x7f62, 0x0008, 0x8066, 0x0000, 0x0009,
+	0x0008, 0x4508, 0x000b, 0x00fe, 0x0000, 0x3527, 0x000b, 0x1c60,
+	0x0000, 0x8062, 0x0008, 0x0001, 0x0000, 0x8066, 0x0000, 0x0009,
+	0x0008, 0x4510, 0x000b, 0x00fe, 0x0000, 0x3243, 0x000b, 0x0038,
+	0x0000, 0x0060, 0x0008, 0x8062, 0x0008, 0x0019, 0x0000, 0x8066,
+	0x0000, 0x0009, 0x0008, 0x4519, 0x000b, 0x80c0, 0x0009, 0x00ff,
+	0x0008, 0x7f3e, 0x0008, 0x0d60, 0x0000, 0x0efe, 0x0008, 0x1f80,
+	0x0001, 0x7f62, 0x0008, 0x8066, 0x0000, 0x0009, 0x0008, 0x4523,
+	0x000b, 0x003a, 0x0008, 0x1dfe, 0x0000, 0x0104, 0x000b, 0x0036,
+	0x0008, 0x00c8, 0x000c, 0x0140, 0x000b, 0x8074, 0x0000, 0x2000,
+	0x0000, 0x8072, 0x0000, 0x2000, 0x0000, 0x0140, 0x000b, 0x3a44,
+	0x0002, 0x0a71, 0x000b, 0x8074, 0x0000, 0x1000, 0x0000, 0x8072,
+	0x0000, 0x1000, 0x0000, 0x2d0e, 0x0000, 0x2d0e, 0x0000, 0x3640,
+	0x0003, 0x26fe, 0x0008, 0x26fe, 0x0008, 0x2700, 0x0008, 0x2700,
+	0x0008, 0x00d0, 0x0009, 0x0d52, 0x000b, 0x8074, 0x0000, 0x4040,
+	0x0008, 0x5940, 0x0003, 0x50ee, 0x000b, 0x3a46, 0x000a, 0x0d52,
+	0x000b, 0x3a47, 0x0002, 0x094d, 0x000b, 0x8054, 0x0008, 0x0004,
+	0x0000, 0x8074, 0x0000, 0x8000, 0x0000, 0x8072, 0x0000, 0x3000,
+	0x0008, 0x019c, 0x0003, 0x92c0, 0x0009, 0x0fc8, 0x0000, 0x080a,
+	0x0003, 0x1246, 0x000a, 0x0e3a, 0x0003, 0x1a60, 0x0000, 0x8062,
+	0x0008, 0x0002, 0x0000, 0x8066, 0x0000, 0x362a, 0x0000, 0x4557,
+	0x000b, 0x2000, 0x0000, 0x2000, 0x0000, 0x2102, 0x0000, 0x2102,
+	0x0000, 0x2204, 0x0000, 0x2204, 0x0000, 0x2306, 0x0000, 0x2306,
+	0x0000, 0x2408, 0x0000, 0x2408, 0x0000, 0x250a, 0x0000, 0x250a,
+	0x0000, 0x260c, 0x0000, 0x260c, 0x0000, 0x270e, 0x0000, 0x270e,
+	0x0000, 0x2810, 0x0000, 0x2810, 0x0000, 0x2912, 0x0000, 0x2912,
+	0x0000, 0x1a60, 0x0000, 0x8062, 0x0008, 0x0007, 0x0000, 0x8066,
+	0x0000, 0x0052, 0x0000, 0x4571, 0x0003, 0x92c0, 0x0009, 0x0780,
+	0x0008, 0x0e56, 0x0003, 0x124b, 0x0002, 0x097a, 0x0003, 0x2e4d,
+	0x0002, 0x2e4d, 0x0002, 0x0a40, 0x0003, 0x3a46, 0x000a, 0x0d8a,
+	0x000b, 0x597c, 0x0003, 0x8054, 0x0008, 0x0004, 0x0000, 0x1243,
+	0x000a, 0x0998, 0x0003, 0x8010, 0x0008, 0x000d, 0x0000, 0x021b,
+	0x000c, 0x1948, 0x000a, 0x0987, 0x000b, 0x0210, 0x0004, 0x1810,
+	0x0000, 0x021b, 0x000c, 0x0198, 0x000b, 0x1948, 0x000a, 0x098e,
+	0x000b, 0x1243, 0x000a, 0x0a43, 0x0003, 0x194d, 0x000a, 0x0992,
+	0x0003, 0x1243, 0x000a, 0x0a4a, 0x0003, 0x5992, 0x0003, 0x8054,
+	0x0008, 0x0004, 0x0000, 0x0210, 0x0004, 0x1810, 0x0000, 0x021b,
+	0x000c, 0x8074, 0x0000, 0xf000, 0x0008, 0x8072, 0x0000, 0x3000,
+	0x0008, 0x0d30, 0x0000, 0x3a42, 0x0002, 0x0da2, 0x000b, 0x15fe,
+	0x0008, 0x3461, 0x000b, 0x000a, 0x000b, 0x8074, 0x0000, 0x0501,
+	0x0000, 0x8010, 0x0008, 0x000c, 0x0008, 0x021b, 0x000c, 0x000a,
+	0x000b, 0xbbe0, 0x0009, 0x0030, 0x0008, 0x0db8, 0x0003, 0x18fe,
+	0x0000, 0x3ce0, 0x0009, 0x09b5, 0x0003, 0x15fe, 0x0008, 0x3ce0,
+	0x0009, 0x09b5, 0x0003, 0x020b, 0x0004, 0x8076, 0x0008, 0x0040,
+	0x0000, 0x0208, 0x000b, 0x8076, 0x0008, 0x0041, 0x0008, 0x0208,
+	0x000b, 0xbbe0, 0x0009, 0x0032, 0x0000, 0x0dbd, 0x0003, 0x3c1e,
+	0x0008, 0x0208, 0x000b, 0xbbe0, 0x0009, 0x003b, 0x0000, 0x0dc2,
+	0x000b, 0x3c20, 0x0000, 0x0208, 0x000b, 0xbbe0, 0x0009, 0x0035,
+	0x0008, 0x0dc8, 0x000b, 0x8072, 0x0000, 0x8000, 0x0000, 0x0384,
+	0x000b, 0xbbe0, 0x0009, 0x0036, 0x0008, 0x0aa5, 0x000b, 0xbbe0,
+	0x0009, 0x0037, 0x0000, 0x0de9, 0x000b, 0x18fe, 0x0000, 0x3ce0,
+	0x0009, 0x0db5, 0x000b, 0x8076, 0x0008, 0x0040, 0x0000, 0x1a60,
+	0x0000, 0x8062, 0x0008, 0x000d, 0x0000, 0x2604, 0x0008, 0x2604,
+	0x0008, 0x2706, 0x0008, 0x2706, 0x0008, 0x2808, 0x0000, 0x2808,
+	0x0000, 0x290a, 0x0000, 0x290a, 0x0000, 0x8066, 0x0000, 0x0422,
+	0x0000, 0x45e0, 0x000b, 0x0210, 0x0004, 0x8054, 0x0008, 0x0004,
+	0x0000, 0x8074, 0x0000, 0xf000, 0x0008, 0x8072, 0x0000, 0xb000,
+	0x0000, 0x019c, 0x0003, 0xbbe0, 0x0009, 0x0038, 0x0000, 0x0dfb,
+	0x000b, 0x18fe, 0x0000, 0x3ce0, 0x0009, 0x09f8, 0x0003, 0x15fe,
+	0x0008, 0x3ce0, 0x0009, 0x0db1, 0x0003, 0x020b, 0x0004, 0x8076,
+	0x0008, 0x0040, 0x0000, 0x8072, 0x0000, 0x8000, 0x0000, 0x0268,
+	0x000b, 0x8076, 0x0008, 0x0042, 0x0008, 0x0208, 0x000b, 0xbbe0,
+	0x0009, 0x0016, 0x0000, 0x0e08, 0x000b, 0x8074, 0x0000, 0x0808,
+	0x0008, 0x3a44, 0x0002, 0x0c0c, 0x000b, 0x8074, 0x0000, 0x0800,
+	0x0000, 0x8072, 0x0000, 0x8000, 0x0000, 0x8000, 0x000f, 0x000a,
+	0x000b, 0x8072, 0x0000, 0x8000, 0x0000, 0x000a, 0x000b, 0x3d30,
+	0x000a, 0x7f00, 0x0000, 0xbc80, 0x0001, 0x0007, 0x0000, 0x0214,
+	0x0003, 0x1930, 0x000a, 0x7f00, 0x0000, 0x9880, 0x0001, 0x0007,
+	0x0000, 0x8060, 0x0000, 0x0400, 0x0000, 0x7f62, 0x0008, 0x8066,
+	0x0000, 0x000a, 0x0008, 0x4619, 0x000b, 0x4000, 0x000f, 0x221e,
+	0x000b, 0x0870, 0x0008, 0x4000, 0x000f, 0x7e1b, 0x000b, 0xbbe0,
+	0x0009, 0x0030, 0x0008, 0x0e1b, 0x0003, 0x18fe, 0x0000, 0x3ce0,
+	0x0009, 0x0a2c, 0x0003, 0x15fe, 0x0008, 0x3ce0, 0x0009, 0x0a2c,
+	0x0003, 0x020b, 0x0004, 0x8076, 0x0008, 0x0040, 0x0000, 0x022e,
+	0x0003, 0x8076, 0x0008, 0x0041, 0x0008, 0x8072, 0x0000, 0x8000,
+	0x0000, 0x021b, 0x0003, 0xbac0, 0x0009, 0x0090, 0x0008, 0x0a37,
+	0x0003, 0x8074, 0x0000, 0x0706, 0x0000, 0x0239, 0x0003, 0x8074,
+	0x0000, 0x0703, 0x0000, 0x4000, 0x000f, 0x8010, 0x0008, 0x0023,
+	0x0000, 0x0276, 0x000b, 0x8010, 0x0008, 0x0008, 0x0000, 0x0276,
+	0x000b, 0x8010, 0x0008, 0x0022, 0x0008, 0x0276, 0x000b, 0x0210,
+	0x0004, 0x8010, 0x0008, 0x0007, 0x0000, 0x021b, 0x000c, 0x1810,
+	0x0000, 0x021b, 0x000c, 0x0282, 0x0003, 0x0210, 0x0004, 0x8010,
+	0x0008, 0x001b, 0x0008, 0x021b, 0x000c, 0x1810, 0x0000, 0x021b,
+	0x000c, 0x8074, 0x0000, 0xf080, 0x0000, 0x8072, 0x0000, 0x3000,
+	0x0008, 0x0d30, 0x0000, 0x000a, 0x000b, 0x8010, 0x0008, 0x0009,
+	0x0008, 0x0276, 0x000b, 0x8010, 0x0008, 0x0005, 0x0008, 0x0276,
+	0x000b, 0x1648, 0x000a, 0x0c6f, 0x000b, 0x808c, 0x0008, 0x0001,
+	0x0000, 0x8010, 0x0008, 0x0004, 0x0000, 0x4143, 0x000a, 0x086f,
+	0x0003, 0x3a44, 0x0002, 0x0c0a, 0x000b, 0x0d2a, 0x0008, 0x0276,
+	0x000b, 0x8010, 0x0008, 0x0003, 0x0008, 0x027a, 0x000b, 0x8010,
+	0x0008, 0x000b, 0x0000, 0x027a, 0x000b, 0x8010, 0x0008, 0x0002,
+	0x0000, 0x027a, 0x000b, 0x3a47, 0x0002, 0x0d40, 0x000b, 0x8010,
+	0x0008, 0x0006, 0x0008, 0x027a, 0x000b, 0x8074, 0x0000, 0xf000,
+	0x0008, 0x8072, 0x0000, 0x3000, 0x0008, 0x021b, 0x000c, 0x0231,
+	0x0004, 0x3a40, 0x000a, 0x080a, 0x0003, 0x8010, 0x0008, 0x000c,
+	0x0008, 0x021b, 0x000c, 0x000a, 0x000b, 0x8074, 0x0000, 0xf080,
+	0x0000, 0x8072, 0x0000, 0x3000, 0x0008, 0x0d30, 0x0000, 0x2e4d,
+	0x0002, 0x2e4d, 0x0002, 0x0a8d, 0x000b, 0x8054, 0x0008, 0x0019,
+	0x0000, 0x000a, 0x000b, 0x8054, 0x0008, 0x0009, 0x0008, 0x000a,
+	0x000b, 0x3a44, 0x0002, 0x0c0a, 0x000b, 0x026b, 0x000b, 0x808c,
+	0x0008, 0x0000, 0x0008, 0x4447, 0x0002, 0x0ab9, 0x0003, 0xc0c0,
+	0x0001, 0x00ff, 0x0008, 0xffe0, 0x0009, 0x00ff, 0x0008, 0x0e90,
+	0x0003, 0xc1e0, 0x0001, 0xffff, 0x0008, 0x0e90, 0x0003, 0x8010,
+	0x0008, 0x0013, 0x0000, 0x021b, 0x000c, 0x8074, 0x0000, 0x0202,
+	0x0008, 0x000a, 0x000b, 0x3a40, 0x000a, 0x0eb6, 0x000b, 0x8074,
+	0x0000, 0x0200, 0x0000, 0x3d00, 0x0000, 0x3cfe, 0x0000, 0x8072,
+	0x0000, 0x8000, 0x0000, 0x43e0, 0x0001, 0x0eb4, 0x0003, 0x42fe,
+	0x0000, 0xffc0, 0x0001, 0x00ff, 0x0008, 0x00e0, 0x0009, 0x0a90,
+	0x000b, 0x0d08, 0x0008, 0x0309, 0x000b, 0x8072, 0x0000, 0x8000,
+	0x0000, 0x000a, 0x000b, 0x038d, 0x0004, 0x808c, 0x0008, 0x0001,
+	0x0000, 0x04fe, 0x0008, 0x3370, 0x0003, 0x0460, 0x0000, 0x8062,
+	0x0008, 0x0001, 0x0000, 0x8066, 0x0000, 0x0009, 0x0008, 0x46c3,
+	0x0003, 0x0004, 0x0000, 0x80c0, 0x0009, 0x00ff, 0x0008, 0x7f00,
+	0x0000, 0x80e0, 0x0001, 0x0004, 0x0000, 0x0add, 0x000b, 0x80e0,
+	0x0001, 0x0005, 0x0008, 0x0add, 0x000b, 0x80e0, 0x0001, 0x0006,
+	0x0008, 0x0add, 0x000b, 0x82c0, 0x0001, 0xff00, 0x0008, 0x7f04,
+	0x0008, 0x82e0, 0x0009, 0x0600, 0x0008, 0x0add, 0x000b, 0x82e0,
+	0x0009, 0x0500, 0x0008, 0x0add, 0x000b, 0x82e0, 0x0009, 0x0400,
+	0x0000, 0x0f70, 0x0003, 0xc4c0, 0x0009, 0x7000, 0x0000, 0xffe0,
+	0x0009, 0x1000, 0x0000, 0x0b09, 0x0003, 0x037e, 0x0004, 0x3941,
+	0x0002, 0x0ae8, 0x000b, 0x8072, 0x0000, 0x0400, 0x0000, 0x000a,
+	0x000b, 0x0460, 0x0000, 0x80fe, 0x0008, 0x002b, 0x0008, 0x7f62,
+	0x0008, 0x8066, 0x0000, 0x2209, 0x0008, 0x46ee, 0x0003, 0x11fe,
+	0x0000, 0x3304, 0x0003, 0x9180, 0x0001, 0x0002, 0x0000, 0x8060,
+	0x0000, 0x0400, 0x0000, 0x7f62, 0x0008, 0x8066, 0x0000, 0x0609,
+	0x0008, 0x46f8, 0x000b, 0x42fe, 0x0000, 0xffc0, 0x0001, 0xff00,
+	0x0008, 0x03e0, 0x0009, 0x0f01, 0x0003, 0x8072, 0x0000, 0x0400,
+	0x0000, 0x0046, 0x0003, 0x9180, 0x0001, 0x0003, 0x0008, 0x02eb,
+	0x0003, 0x8072, 0x0000, 0x0400, 0x0000, 0x8010, 0x0008, 0x0010,
+	0x0000, 0x0361, 0x0003, 0x037e, 0x0004, 0x3941, 0x0002, 0x0b0f,
+	0x0003, 0x8072, 0x0000, 0x0400, 0x0000, 0x000a, 0x000b, 0x0346,
+	0x000c, 0x11fe, 0x0000, 0x3717, 0x0003, 0x8072, 0x0000, 0x0400,
+	0x0000, 0x8010, 0x0008, 0x000e, 0x0000, 0x0361, 0x0003, 0x8060,
+	0x0000, 0x0400, 0x0000, 0x04fe, 0x0008, 0x372c, 0x000b, 0x808c,
+	0x0008, 0x0000, 0x0008, 0x9180, 0x0001, 0x0005, 0x0008, 0x7f62,
+	0x0008, 0x8066, 0x0000, 0x0009, 0x0008, 0x4722, 0x000b, 0x0060,
+	0x0008, 0x8062, 0x0008, 0x001b, 0x0008, 0x4304, 0x0008, 0x4206,
+	0x0008, 0x8066, 0x0000, 0x0412, 0x0000, 0x472a, 0x0003, 0x0343,
+	0x0003, 0x808c, 0x0008, 0x0001, 0x0000, 0x0460, 0x0000, 0x8062,
+	0x0008, 0x002b, 0x0008, 0x8066, 0x0000, 0x0609, 0x0008, 0x4733,
+	0x000b, 0x8066, 0x0000, 0x220a, 0x0008, 0x4736, 0x000b, 0x42fe,
+	0x0000, 0xffc0, 0x0001, 0xff00, 0x0008, 0x7f04, 0x0008, 0x8060,
+	0x0000, 0x0400, 0x0000, 0x9180, 0x0001, 0x0002, 0x0000, 0x7f62,
+	0x0008, 0x8066, 0x0000, 0x041a, 0x0008, 0x4742, 0x000b, 0x8072,
+	0x0000, 0x0400, 0x0000, 0x0046, 0x0003, 0x8060, 0x0000, 0x0400,
+	0x0000, 0x1362, 0x0008, 0x8066, 0x0000, 0x0411, 0x0000, 0x474b,
+	0x000b, 0x02fe, 0x0008, 0x03e0, 0x0009, 0x0f51, 0x0003, 0x0d22,
+	0x0000, 0x4000, 0x000f, 0x8280, 0x0009, 0x0002, 0x0000, 0x1380,
+	0x0001, 0x7f62, 0x0008, 0x8066, 0x0000, 0x2209, 0x0008, 0x4757,
+	0x0003, 0x0200, 0x000a, 0xffc0, 0x0001, 0x0007, 0x0000, 0x7f06,
+	0x0000, 0x1362, 0x0008, 0x8066, 0x0000, 0x060a, 0x0008, 0x475f,
+	0x000b, 0x4000, 0x000f, 0x3a44, 0x0002, 0x0c0a, 0x000b, 0x2f44,
+	0x000a, 0x2f44, 0x000a, 0x0e6b, 0x000b, 0x808a, 0x0008, 0x0003,
+	0x0008, 0x8074, 0x0000, 0xf080, 0x0000, 0x8072, 0x0000, 0x3000,
+	0x0008, 0x5b6c, 0x0003, 0x8054, 0x0008, 0x0019, 0x0000, 0x000a,
+	0x000b, 0x3a44, 0x0002, 0x0c0a, 0x000b, 0x808c, 0x0008, 0x0000,
+	0x0008, 0x8010, 0x0008, 0x0011, 0x0008, 0x021b, 0x000c, 0x42fe,
+	0x0000, 0xffc0, 0x0001, 0x00ff, 0x0008, 0x7f10, 0x0008, 0x021b,
+	0x000c, 0x4310, 0x0008, 0x027a, 0x000b, 0x3941, 0x0002, 0x0b81,
+	0x0003, 0x4000, 0x000f, 0x8072, 0x0000, 0x0404, 0x0008, 0x4000,
+	0x000f, 0x8010, 0x0008, 0x0012, 0x0008, 0x021b, 0x000c, 0x0346,
+	0x000c, 0x1110, 0x0000, 0x021b, 0x000c, 0x11fe, 0x0000, 0x3787,
+	0x0003, 0x000a, 0x000b, 0xc2c0, 0x0009, 0x00ff, 0x0008, 0x7f00,
+	0x0000, 0xc3c0, 0x0001, 0xff00, 0x0008, 0x00d0, 0x0009, 0x0bb2,
+	0x0003, 0x0d0a, 0x0000, 0x8580, 0x0001, 0x1000, 0x0000, 0x7f62,
+	0x0008, 0x8060, 0x0000, 0x0400, 0x0000, 0x8066, 0x0000, 0x0809,
+	0x0000, 0x479c, 0x000b, 0x04fe, 0x0008, 0x33ab, 0x0003, 0x0460,
+	0x0000, 0x8062, 0x0008, 0x0004, 0x0000, 0x8066, 0x0000, 0x0211,
+	0x0000, 0x47a4, 0x0003, 0x01fe, 0x0008, 0x00e0, 0x0009, 0x0fab,
+	0x0003, 0x02fe, 0x0008, 0x43e0, 0x0001, 0x0bb1, 0x0003, 0x0500,
+	0x0002, 0x7f0a, 0x0000, 0xffe0, 0x0009, 0x0800, 0x0000, 0x0f95,
+	0x000b, 0x0d08, 0x0008, 0x4000, 0x000f, 0x43fe, 0x0008, 0x3e80,
+	0x0001, 0xffc0, 0x0001, 0x7fff, 0x0000, 0x0d60, 0x0000, 0x7f62,
+	0x0008, 0x8066, 0x0000, 0x0809, 0x0000, 0x47ba, 0x0003, 0x8060,
+	0x0000, 0x0400, 0x0000, 0x84c0, 0x0001, 0xff00, 0x0008, 0x7f60,
+	0x000a, 0x7f60, 0x000a, 0x7f60, 0x000a, 0x7f60, 0x000a, 0x7f60,
+	0x000a, 0x7f60, 0x000a, 0x7f60, 0x000a, 0x7f60, 0x000a, 0xff80,
+	0x0009, 0x1000, 0x0000, 0x7f62, 0x0008, 0x8066, 0x0000, 0x0809,
+	0x0000, 0x47cc, 0x000b, 0x4000, 0x000f, 0x5ff4, 0xebed, 0x0001,
+	0x0002, 0x0004, 0x0008, 0x0010, 0x0020, 0x0040, 0x0080, 0x0100,
+	0x0200, 0x0400, 0x0800, 0x1000, 0x2000, 0x4000, 0x8000, 0x4464
 };
 #ifdef UNIQUE_FW_NAME
-unsigned short fw2300ipx_length01 = 0xe9c7;
+unsigned short fw2300ipx_length01 = 0xe9e8;
 #else
-unsigned short risc_code_length01 = 0xe9c7;
+unsigned short risc_code_length01 = 0xe9e8;
 #endif
 
diff --git a/drivers/scsi/qla2xxx/ql2322.c b/drivers/scsi/qla2xxx/ql2322.c
index 1e2cfad1d..ebbb51ea6 100644
--- a/drivers/scsi/qla2xxx/ql2322.c
+++ b/drivers/scsi/qla2xxx/ql2322.c
@@ -9,7 +9,6 @@
 #include <linux/module.h>
 #include <linux/pci.h>
 
-#include "qla_os.h"
 #include "qla_def.h"
 
 static char qla_driver_name[] = "qla2322";
diff --git a/drivers/scsi/qla2xxx/ql2322_fw.c b/drivers/scsi/qla2xxx/ql2322_fw.c
index f75b3c971..796206533 100644
--- a/drivers/scsi/qla2xxx/ql2322_fw.c
+++ b/drivers/scsi/qla2xxx/ql2322_fw.c
@@ -18,7 +18,7 @@
  *************************************************************************/
 
 /*
- *	Firmware Version 3.02.28 (14:05 Apr 03, 2004)
+ *	Firmware Version 3.02.30 (07:55 Jun 16, 2004)
  */
 
 #ifdef UNIQUE_FW_NAME
@@ -28,15 +28,15 @@ unsigned short risc_code_version = 3*1024+2;
 #endif
 
 #ifdef UNIQUE_FW_NAME
-unsigned char fw2322ipx_version_str[] = {3, 2,28};
+unsigned char fw2322ipx_version_str[] = {3, 2,30};
 #else
-unsigned char firmware_version[] = {3, 2,28};
+unsigned char firmware_version[] = {3, 2,30};
 #endif
 
 #ifdef UNIQUE_FW_NAME
-#define fw2322ipx_VERSION_STRING "3.02.28"
+#define fw2322ipx_VERSION_STRING "3.02.30"
 #else
-#define FW_VERSION_STRING "3.02.28"
+#define FW_VERSION_STRING "3.02.30"
 #endif
 
 #ifdef UNIQUE_FW_NAME
@@ -50,12 +50,12 @@ unsigned short fw2322ipx_code01[] = {
 #else
 unsigned short risc_code01[] = { 
 #endif
-	0x0470, 0x0000, 0x0000, 0xdf42, 0x0000, 0x0003, 0x0002, 0x001c,
+	0x0470, 0x0000, 0x0000, 0xdf52, 0x0000, 0x0003, 0x0002, 0x001e,
 	0x0137, 0x2043, 0x4f50, 0x5952, 0x4947, 0x4854, 0x2032, 0x3030,
 	0x3120, 0x514c, 0x4f47, 0x4943, 0x2043, 0x4f52, 0x504f, 0x5241,
 	0x5449, 0x4f4e, 0x2049, 0x5350, 0x3233, 0x3030, 0x2046, 0x6972,
 	0x6d77, 0x6172, 0x6520, 0x2056, 0x6572, 0x7369, 0x6f6e, 0x2030,
-	0x332e, 0x3032, 0x2e32, 0x3820, 0x2020, 0x2020, 0x2400, 0x20a9,
+	0x332e, 0x3032, 0x2e33, 0x3020, 0x2020, 0x2020, 0x2400, 0x20a9,
 	0x000f, 0x2001, 0x0000, 0x400f, 0x2091, 0x2200, 0x20a9, 0x000f,
 	0x2001, 0x0000, 0x400f, 0x2091, 0x2400, 0x20a9, 0x000f, 0x2001,
 	0x0000, 0x400f, 0x2091, 0x2600, 0x20a9, 0x000f, 0x2001, 0x0000,
@@ -64,164 +64,164 @@ unsigned short risc_code01[] = {
 	0x2c00, 0x20a9, 0x000f, 0x2001, 0x0000, 0x400f, 0x2091, 0x2e00,
 	0x20a9, 0x000f, 0x2001, 0x0000, 0x400f, 0x2091, 0x2000, 0x2001,
 	0x0000, 0x20c1, 0x0004, 0x20c9, 0x1cff, 0x2059, 0x0000, 0x2b78,
-	0x7883, 0x0004, 0x2089, 0x2ab5, 0x2051, 0x1800, 0x2a70, 0x20e1,
+	0x7883, 0x0004, 0x2089, 0x2ac3, 0x2051, 0x1800, 0x2a70, 0x20e1,
 	0x0001, 0x20e9, 0x0001, 0x2009, 0x0000, 0x080c, 0x0e55, 0x00f6,
-	0x7888, 0x9005, 0x11f8, 0x2061, 0xc000, 0x080c, 0x205a, 0x1170,
-	0x2079, 0x0300, 0x080c, 0x2070, 0x2061, 0xe000, 0x080c, 0x205a,
-	0x1128, 0x2079, 0x0380, 0x080c, 0x2070, 0x0060, 0x00fe, 0x7883,
+	0x7888, 0x9005, 0x11f8, 0x2061, 0xc000, 0x080c, 0x2067, 0x1170,
+	0x2079, 0x0300, 0x080c, 0x207d, 0x2061, 0xe000, 0x080c, 0x2067,
+	0x1128, 0x2079, 0x0380, 0x080c, 0x207d, 0x0060, 0x00fe, 0x7883,
 	0x4010, 0x7837, 0x4010, 0x7833, 0x0010, 0x2091, 0x5000, 0x2091,
 	0x4080, 0x0cf8, 0x00fe, 0x2029, 0x5600, 0x2031, 0xffff, 0x2039,
 	0x55dc, 0x2021, 0x0200, 0x20e9, 0x0001, 0x20a1, 0x0000, 0x20a9,
 	0x0800, 0x900e, 0x4104, 0x20e9, 0x0001, 0x20a1, 0x1000, 0x900e,
 	0x2001, 0x0dc1, 0x9084, 0x0fff, 0x20a8, 0x4104, 0x2001, 0x0000,
 	0x9086, 0x0000, 0x0120, 0x21a8, 0x4104, 0x8001, 0x1de0, 0x756e,
-	0x7672, 0x776a, 0x7476, 0x747a, 0x00e6, 0x2071, 0x1b4e, 0x2472,
+	0x7672, 0x776a, 0x7476, 0x747a, 0x00e6, 0x2071, 0x1b4d, 0x2472,
 	0x00ee, 0x20a1, 0x1ddc, 0x7170, 0x810d, 0x810d, 0x810d, 0x810d,
 	0x918c, 0x000f, 0x2001, 0x0001, 0x9112, 0x900e, 0x21a8, 0x4104,
 	0x8211, 0x1de0, 0x7170, 0x3400, 0x8001, 0x9102, 0x0120, 0x0218,
 	0x20a8, 0x900e, 0x4104, 0x2009, 0x1800, 0x810d, 0x810d, 0x810d,
 	0x810d, 0x810d, 0x918c, 0x001f, 0x2001, 0x0001, 0x9112, 0x20e9,
 	0x0001, 0x20a1, 0x0800, 0x900e, 0x20a9, 0x0800, 0x4104, 0x8211,
-	0x1dd8, 0x080c, 0x0f52, 0x080c, 0x6037, 0x080c, 0xab83, 0x080c,
-	0x1109, 0x080c, 0x1328, 0x080c, 0x1bb0, 0x080c, 0x918d, 0x080c,
-	0x0d0f, 0x080c, 0x108e, 0x080c, 0x3474, 0x080c, 0x7801, 0x080c,
-	0x6a8f, 0x080c, 0x8905, 0x080c, 0x8569, 0x080c, 0x223f, 0x080c,
-	0x7ed6, 0x080c, 0x2089, 0x080c, 0x21c3, 0x080c, 0x2234, 0x2091,
+	0x1dd8, 0x080c, 0x0f52, 0x080c, 0x6032, 0x080c, 0xab75, 0x080c,
+	0x1109, 0x080c, 0x1333, 0x080c, 0x1bbd, 0x080c, 0x916f, 0x080c,
+	0x0d0f, 0x080c, 0x108e, 0x080c, 0x3468, 0x080c, 0x77e0, 0x080c,
+	0x6a8e, 0x080c, 0x88e7, 0x080c, 0x8548, 0x080c, 0x2258, 0x080c,
+	0x7eb5, 0x080c, 0x2096, 0x080c, 0x21d4, 0x080c, 0x224d, 0x2091,
 	0x3009, 0x7883, 0x0000, 0x1004, 0x0943, 0x7880, 0x9086, 0x0002,
 	0x1190, 0x7883, 0x4000, 0x7837, 0x4000, 0x7833, 0x0010, 0x0e04,
 	0x0937, 0x2091, 0x5000, 0x2091, 0x4080, 0x2001, 0x0089, 0x2004,
-	0xd084, 0x190c, 0x11d6, 0x2071, 0x1800, 0x7003, 0x0000, 0x780c,
+	0xd084, 0x190c, 0x11e1, 0x2071, 0x1800, 0x7003, 0x0000, 0x780c,
 	0x9084, 0x0030, 0x9086, 0x0000, 0x190c, 0x0d7d, 0x2071, 0x1800,
-	0x7000, 0x908e, 0x0003, 0x1168, 0x080c, 0x4bcc, 0x080c, 0x349b,
-	0x080c, 0x7869, 0x080c, 0x6fd7, 0x080c, 0x89e3, 0x080c, 0x8592,
+	0x7000, 0x908e, 0x0003, 0x1168, 0x080c, 0x4bce, 0x080c, 0x348f,
+	0x080c, 0x7848, 0x080c, 0x6fc6, 0x080c, 0x89c5, 0x080c, 0x8571,
 	0x0c68, 0x000b, 0x0c88, 0x096d, 0x096e, 0x0b09, 0x096b, 0x0bc3,
 	0x0d0e, 0x0d0e, 0x0d0e, 0x080c, 0x0d7d, 0x0005, 0x0126, 0x00f6,
 	0x2091, 0x8000, 0x7000, 0x9086, 0x0001, 0x1904, 0x0adc, 0x080c,
-	0x0ea5, 0x080c, 0x74e9, 0x0150, 0x080c, 0x750c, 0x15b0, 0x2079,
-	0x0100, 0x7828, 0x9085, 0x1800, 0x782a, 0x0478, 0x080c, 0x741a,
+	0x0ea5, 0x080c, 0x74c8, 0x0150, 0x080c, 0x74eb, 0x15b0, 0x2079,
+	0x0100, 0x7828, 0x9085, 0x1800, 0x782a, 0x0478, 0x080c, 0x73f9,
 	0x7000, 0x9086, 0x0001, 0x1904, 0x0adc, 0x7098, 0x9086, 0x0028,
-	0x1904, 0x0adc, 0x080c, 0x8561, 0x080c, 0x8553, 0x2001, 0x0161,
-	0x2003, 0x0001, 0x2079, 0x0100, 0x2011, 0xffff, 0x080c, 0x2a44,
-	0x7a28, 0x9295, 0x5e2c, 0x7a2a, 0x2011, 0x735f, 0x080c, 0x863e,
-	0x2011, 0x7352, 0x080c, 0x874a, 0x2011, 0x5e8e, 0x080c, 0x863e,
-	0x2011, 0x8030, 0x901e, 0x7396, 0x04d0, 0x080c, 0x573b, 0x2079,
-	0x0100, 0x7844, 0x9005, 0x1904, 0x0adc, 0x2011, 0x5e8e, 0x080c,
-	0x863e, 0x2011, 0x735f, 0x080c, 0x863e, 0x2011, 0x7352, 0x080c,
-	0x874a, 0x2001, 0x0265, 0x2001, 0x0205, 0x2003, 0x0000, 0x7840,
-	0x9084, 0xfffb, 0x7842, 0x2001, 0x19a6, 0x2004, 0x9005, 0x1140,
-	0x00c6, 0x2061, 0x0100, 0x080c, 0x5fdf, 0x00ce, 0x0804, 0x0adc,
-	0x780f, 0x006b, 0x7a28, 0x080c, 0x74f1, 0x0118, 0x9295, 0x5e2c,
+	0x1904, 0x0adc, 0x080c, 0x8540, 0x080c, 0x8532, 0x2001, 0x0161,
+	0x2003, 0x0001, 0x2079, 0x0100, 0x2011, 0xffff, 0x080c, 0x2a63,
+	0x7a28, 0x9295, 0x5e2c, 0x7a2a, 0x2011, 0x733e, 0x080c, 0x861d,
+	0x2011, 0x7331, 0x080c, 0x8729, 0x2011, 0x5e89, 0x080c, 0x861d,
+	0x2011, 0x8030, 0x901e, 0x7396, 0x04d0, 0x080c, 0x5736, 0x2079,
+	0x0100, 0x7844, 0x9005, 0x1904, 0x0adc, 0x2011, 0x5e89, 0x080c,
+	0x861d, 0x2011, 0x733e, 0x080c, 0x861d, 0x2011, 0x7331, 0x080c,
+	0x8729, 0x2001, 0x0265, 0x2001, 0x0205, 0x2003, 0x0000, 0x7840,
+	0x9084, 0xfffb, 0x7842, 0x2001, 0x19a5, 0x2004, 0x9005, 0x1140,
+	0x00c6, 0x2061, 0x0100, 0x080c, 0x5fda, 0x00ce, 0x0804, 0x0adc,
+	0x780f, 0x006b, 0x7a28, 0x080c, 0x74d0, 0x0118, 0x9295, 0x5e2c,
 	0x0010, 0x9295, 0x402c, 0x7a2a, 0x2011, 0x8010, 0x73d8, 0x2001,
-	0x19a7, 0x2003, 0x0001, 0x080c, 0x2916, 0x080c, 0x4b07, 0x7248,
+	0x19a6, 0x2003, 0x0001, 0x080c, 0x292f, 0x080c, 0x4b09, 0x7248,
 	0xc284, 0x724a, 0x2001, 0x180c, 0x200c, 0xc1ac, 0xc1cc, 0x2102,
-	0x2001, 0x0390, 0x2003, 0x0400, 0x080c, 0xa896, 0x080c, 0xa073,
-	0x2011, 0x0004, 0x080c, 0xc848, 0x080c, 0xa8b2, 0x080c, 0x6917,
-	0x080c, 0x74e9, 0x1120, 0x080c, 0x2971, 0x0600, 0x0420, 0x080c,
-	0x5fe6, 0x0140, 0x7097, 0x0001, 0x70d3, 0x0000, 0x080c, 0x5908,
-	0x0804, 0x0adc, 0x080c, 0x56da, 0xd094, 0x01a8, 0x2001, 0x0390,
+	0x2001, 0x0390, 0x2003, 0x0400, 0x080c, 0xa888, 0x080c, 0xa055,
+	0x2011, 0x0004, 0x080c, 0xc842, 0x080c, 0xa8a4, 0x080c, 0x6916,
+	0x080c, 0x74c8, 0x1120, 0x080c, 0x2990, 0x0600, 0x0420, 0x080c,
+	0x5fe1, 0x0140, 0x7097, 0x0001, 0x70d3, 0x0000, 0x080c, 0x5903,
+	0x0804, 0x0adc, 0x080c, 0x56d5, 0xd094, 0x01a8, 0x2001, 0x0390,
 	0x2003, 0x0404, 0x2011, 0x180c, 0x2204, 0xc0cd, 0x2012, 0x080c,
-	0x56de, 0xd0d4, 0x1118, 0x080c, 0x2971, 0x1270, 0x2011, 0x180c,
-	0x2204, 0xc0bc, 0x00a8, 0x080c, 0x56de, 0xd0d4, 0x1db8, 0x2011,
+	0x56d9, 0xd0d4, 0x1118, 0x080c, 0x2990, 0x1270, 0x2011, 0x180c,
+	0x2204, 0xc0bc, 0x00a8, 0x080c, 0x56d9, 0xd0d4, 0x1db8, 0x2011,
 	0x180c, 0x2204, 0xc0bd, 0x0060, 0x2011, 0x180c, 0x2204, 0xc0bd,
-	0x2012, 0x080c, 0x6a63, 0x1128, 0xd0a4, 0x0118, 0x2204, 0xc0fd,
-	0x2012, 0x080c, 0x6a29, 0x0120, 0x7a0c, 0xc2b4, 0x7a0e, 0x00a8,
-	0x707f, 0x0000, 0x080c, 0x74e9, 0x1130, 0x70b0, 0x9005, 0x1168,
-	0x080c, 0xcc9f, 0x0050, 0x080c, 0xcc9f, 0x70dc, 0xd09c, 0x1128,
-	0x70b0, 0x9005, 0x0110, 0x080c, 0x5fbc, 0x70e7, 0x0000, 0x70e3,
-	0x0000, 0x70a7, 0x0000, 0x080c, 0x2979, 0x0228, 0x2011, 0x0101,
-	0x2204, 0xc0c4, 0x2012, 0x72dc, 0x080c, 0x74e9, 0x1178, 0x9016,
-	0x0016, 0x080c, 0x2713, 0x2019, 0x196d, 0x211a, 0x001e, 0x705f,
-	0xffff, 0x7063, 0x00ef, 0x7083, 0x0000, 0x0020, 0x2019, 0x196d,
+	0x2012, 0x080c, 0x6a62, 0x1128, 0xd0a4, 0x0118, 0x2204, 0xc0fd,
+	0x2012, 0x080c, 0x6a28, 0x0120, 0x7a0c, 0xc2b4, 0x7a0e, 0x00a8,
+	0x707f, 0x0000, 0x080c, 0x74c8, 0x1130, 0x70b0, 0x9005, 0x1168,
+	0x080c, 0xcc9e, 0x0050, 0x080c, 0xcc9e, 0x70dc, 0xd09c, 0x1128,
+	0x70b0, 0x9005, 0x0110, 0x080c, 0x5fb7, 0x70e7, 0x0000, 0x70e3,
+	0x0000, 0x70a7, 0x0000, 0x080c, 0x2998, 0x0228, 0x2011, 0x0101,
+	0x2204, 0xc0c4, 0x2012, 0x72dc, 0x080c, 0x74c8, 0x1178, 0x9016,
+	0x0016, 0x080c, 0x272c, 0x2019, 0x196c, 0x211a, 0x001e, 0x705f,
+	0xffff, 0x7063, 0x00ef, 0x7083, 0x0000, 0x0020, 0x2019, 0x196c,
 	0x201b, 0x0000, 0x2079, 0x1847, 0x7804, 0xd0ac, 0x0108, 0xc295,
-	0x72de, 0x080c, 0x74e9, 0x0118, 0x9296, 0x0004, 0x0518, 0x2011,
-	0x0001, 0x080c, 0xc848, 0x70ab, 0x0000, 0x70af, 0xffff, 0x7003,
-	0x0002, 0x00fe, 0x080c, 0x2fb2, 0x080c, 0xa896, 0x2011, 0x0005,
-	0x080c, 0xa1cf, 0x080c, 0xa8b2, 0x080c, 0x74e9, 0x0148, 0x00c6,
-	0x2061, 0x0100, 0x0016, 0x080c, 0x2713, 0x61e2, 0x001e, 0x00ce,
+	0x72de, 0x080c, 0x74c8, 0x0118, 0x9296, 0x0004, 0x0518, 0x2011,
+	0x0001, 0x080c, 0xc842, 0x70ab, 0x0000, 0x70af, 0xffff, 0x7003,
+	0x0002, 0x00fe, 0x080c, 0x2fc0, 0x080c, 0xa888, 0x2011, 0x0005,
+	0x080c, 0xa1b1, 0x080c, 0xa8a4, 0x080c, 0x74c8, 0x0148, 0x00c6,
+	0x2061, 0x0100, 0x0016, 0x080c, 0x272c, 0x61e2, 0x001e, 0x00ce,
 	0x012e, 0x00e0, 0x70ab, 0x0000, 0x70af, 0xffff, 0x7003, 0x0002,
-	0x080c, 0xa896, 0x2011, 0x0005, 0x080c, 0xa1cf, 0x080c, 0xa8b2,
-	0x080c, 0x74e9, 0x0148, 0x00c6, 0x2061, 0x0100, 0x0016, 0x080c,
-	0x2713, 0x61e2, 0x001e, 0x00ce, 0x00fe, 0x012e, 0x0005, 0x00c6,
-	0x00b6, 0x080c, 0x74e9, 0x1118, 0x20a9, 0x0800, 0x0010, 0x20a9,
-	0x0782, 0x080c, 0x74e9, 0x1110, 0x900e, 0x0010, 0x2009, 0x007e,
+	0x080c, 0xa888, 0x2011, 0x0005, 0x080c, 0xa1b1, 0x080c, 0xa8a4,
+	0x080c, 0x74c8, 0x0148, 0x00c6, 0x2061, 0x0100, 0x0016, 0x080c,
+	0x272c, 0x61e2, 0x001e, 0x00ce, 0x00fe, 0x012e, 0x0005, 0x00c6,
+	0x00b6, 0x080c, 0x74c8, 0x1118, 0x20a9, 0x0800, 0x0010, 0x20a9,
+	0x0782, 0x080c, 0x74c8, 0x1110, 0x900e, 0x0010, 0x2009, 0x007e,
 	0x86ff, 0x0138, 0x9180, 0x1000, 0x2004, 0x905d, 0x0110, 0xb800,
-	0xd0bc, 0x090c, 0x32fc, 0x8108, 0x1f04, 0x0af0, 0x707f, 0x0000,
+	0xd0bc, 0x090c, 0x32f8, 0x8108, 0x1f04, 0x0af0, 0x707f, 0x0000,
 	0x7080, 0x9084, 0x00ff, 0x7082, 0x70b3, 0x0000, 0x00be, 0x00ce,
 	0x0005, 0x00b6, 0x0126, 0x2091, 0x8000, 0x7000, 0x9086, 0x0002,
-	0x1904, 0x0bc0, 0x70ac, 0x9086, 0xffff, 0x0120, 0x080c, 0x2fb2,
+	0x1904, 0x0bc0, 0x70ac, 0x9086, 0xffff, 0x0120, 0x080c, 0x2fc0,
 	0x0804, 0x0bc0, 0x70dc, 0xd0ac, 0x1110, 0xd09c, 0x0538, 0xd084,
 	0x0528, 0x0006, 0x2001, 0x0103, 0x2003, 0x002b, 0x000e, 0xd08c,
-	0x01e8, 0x080c, 0x336d, 0x11b0, 0x70e0, 0x9086, 0xffff, 0x0190,
-	0x080c, 0x3147, 0x70dc, 0xd094, 0x1904, 0x0bc0, 0x2011, 0x0001,
-	0x080c, 0xcf52, 0x0110, 0x2011, 0x0003, 0x901e, 0x080c, 0x3181,
+	0x01e8, 0x080c, 0x3361, 0x11b0, 0x70e0, 0x9086, 0xffff, 0x0190,
+	0x080c, 0x3155, 0x70dc, 0xd094, 0x1904, 0x0bc0, 0x2011, 0x0001,
+	0x080c, 0xcf51, 0x0110, 0x2011, 0x0003, 0x901e, 0x080c, 0x318f,
 	0x0804, 0x0bc0, 0x70e4, 0x9005, 0x1904, 0x0bc0, 0x70a8, 0x9005,
 	0x1904, 0x0bc0, 0x70dc, 0xd0a4, 0x0118, 0xd0b4, 0x0904, 0x0bc0,
-	0x080c, 0x6a29, 0x1904, 0x0bc0, 0x080c, 0x6a7c, 0x1904, 0x0bc0,
-	0x080c, 0x6a63, 0x01c0, 0x0156, 0x00c6, 0x20a9, 0x007f, 0x900e,
-	0x0016, 0x080c, 0x6625, 0x1118, 0xb800, 0xd0ec, 0x1138, 0x001e,
+	0x080c, 0x6a28, 0x1904, 0x0bc0, 0x080c, 0x6a7b, 0x1904, 0x0bc0,
+	0x080c, 0x6a62, 0x01c0, 0x0156, 0x00c6, 0x20a9, 0x007f, 0x900e,
+	0x0016, 0x080c, 0x6620, 0x1118, 0xb800, 0xd0ec, 0x1138, 0x001e,
 	0x8108, 0x1f04, 0x0b60, 0x00ce, 0x015e, 0x0028, 0x001e, 0x00ce,
 	0x015e, 0x0804, 0x0bc0, 0x0006, 0x2001, 0x0103, 0x2003, 0x002b,
-	0x000e, 0x2011, 0x19b3, 0x080c, 0x0fc2, 0x2011, 0x19cd, 0x080c,
+	0x000e, 0x2011, 0x19b2, 0x080c, 0x0fc2, 0x2011, 0x19cc, 0x080c,
 	0x0fc2, 0x7030, 0xc08c, 0x7032, 0x7003, 0x0003, 0x70af, 0xffff,
-	0x080c, 0x0e79, 0x9006, 0x080c, 0x25a0, 0x080c, 0x336d, 0x0118,
-	0x080c, 0x4ca4, 0x0050, 0x0036, 0x0046, 0x2019, 0xffff, 0x2021,
-	0x0006, 0x080c, 0x4cbe, 0x004e, 0x003e, 0x00f6, 0x2079, 0x0100,
-	0x080c, 0x750c, 0x0150, 0x080c, 0x74e9, 0x7828, 0x0118, 0x9084,
-	0xe1ff, 0x0010, 0x9084, 0xffdf, 0x782a, 0x00fe, 0x080c, 0xa896,
-	0x2001, 0x19e8, 0x2004, 0x9086, 0x0005, 0x1120, 0x2011, 0x0000,
-	0x080c, 0xa1cf, 0x2011, 0x0000, 0x080c, 0xa1d9, 0x080c, 0xa8b2,
+	0x080c, 0x0e79, 0x9006, 0x080c, 0x25b9, 0x080c, 0x3361, 0x0118,
+	0x080c, 0x4ca6, 0x0050, 0x0036, 0x0046, 0x2019, 0xffff, 0x2021,
+	0x0006, 0x080c, 0x4cc0, 0x004e, 0x003e, 0x00f6, 0x2079, 0x0100,
+	0x080c, 0x74eb, 0x0150, 0x080c, 0x74c8, 0x7828, 0x0118, 0x9084,
+	0xe1ff, 0x0010, 0x9084, 0xffdf, 0x782a, 0x00fe, 0x080c, 0xa888,
+	0x2001, 0x19e7, 0x2004, 0x9086, 0x0005, 0x1120, 0x2011, 0x0000,
+	0x080c, 0xa1b1, 0x2011, 0x0000, 0x080c, 0xa1bb, 0x080c, 0xa8a4,
 	0x012e, 0x00be, 0x0005, 0x0016, 0x0026, 0x0046, 0x00f6, 0x0126,
 	0x2091, 0x8000, 0x2079, 0x0100, 0x7904, 0x918c, 0xfffd, 0x7906,
-	0x2009, 0x00f7, 0x080c, 0x5fa5, 0x7940, 0x918c, 0x0010, 0x7942,
-	0x7924, 0xd1b4, 0x0120, 0x2011, 0x0040, 0x080c, 0x2a44, 0xd19c,
-	0x0120, 0x2011, 0x0008, 0x080c, 0x2a44, 0x0006, 0x0036, 0x0156,
-	0x0000, 0x2001, 0x19a7, 0x2004, 0x9005, 0x1518, 0x080c, 0x29d8,
-	0x1148, 0x2001, 0x0001, 0x080c, 0x2945, 0x2001, 0x0001, 0x080c,
-	0x2928, 0x00b8, 0x080c, 0x29e0, 0x1138, 0x9006, 0x080c, 0x2945,
-	0x9006, 0x080c, 0x2928, 0x0068, 0x080c, 0x29e8, 0x1d50, 0x2001,
-	0x1998, 0x2004, 0xd0fc, 0x0108, 0x0020, 0x080c, 0x273f, 0x0804,
-	0x0cc1, 0x080c, 0x2a67, 0x080c, 0x2aab, 0x20a9, 0x003a, 0x1d04,
-	0x0c17, 0x080c, 0x872a, 0x1f04, 0x0c17, 0x080c, 0x74fa, 0x0148,
-	0x080c, 0x750c, 0x1118, 0x080c, 0x77fc, 0x0050, 0x080c, 0x74f1,
-	0x0dd0, 0x080c, 0x77f7, 0x080c, 0x77ed, 0x080c, 0x741a, 0x0020,
-	0x2009, 0x00f8, 0x080c, 0x5fa5, 0x7850, 0xc0e5, 0x7852, 0x080c,
-	0x74e9, 0x0120, 0x7843, 0x0090, 0x7843, 0x0010, 0x2021, 0xe678,
-	0x2019, 0xea60, 0x0d0c, 0x872a, 0x7820, 0xd09c, 0x15a0, 0x080c,
-	0x74e9, 0x0904, 0x0ca3, 0x7824, 0xd0ac, 0x1904, 0x0cc6, 0x080c,
-	0x750c, 0x1548, 0x0046, 0x2021, 0x0320, 0x8421, 0x1df0, 0x004e,
-	0x2011, 0x1800, 0x080c, 0x2a44, 0x080c, 0x29f0, 0x7824, 0x9084,
+	0x2009, 0x00f7, 0x080c, 0x5fa0, 0x7940, 0x918c, 0x0010, 0x7942,
+	0x7924, 0xd1b4, 0x0120, 0x2011, 0x0040, 0x080c, 0x2a63, 0xd19c,
+	0x0120, 0x2011, 0x0008, 0x080c, 0x2a63, 0x0006, 0x0036, 0x0156,
+	0x0000, 0x2001, 0x19a6, 0x2004, 0x9005, 0x1518, 0x080c, 0x29f7,
+	0x1148, 0x2001, 0x0001, 0x080c, 0x295e, 0x2001, 0x0001, 0x080c,
+	0x2941, 0x00b8, 0x080c, 0x29ff, 0x1138, 0x9006, 0x080c, 0x295e,
+	0x9006, 0x080c, 0x2941, 0x0068, 0x080c, 0x2a07, 0x1d50, 0x2001,
+	0x1997, 0x2004, 0xd0fc, 0x0108, 0x0020, 0x080c, 0x2758, 0x0804,
+	0x0cc1, 0x080c, 0x2a86, 0x080c, 0x2ab9, 0x20a9, 0x003a, 0x1d04,
+	0x0c17, 0x080c, 0x8709, 0x1f04, 0x0c17, 0x080c, 0x74d9, 0x0148,
+	0x080c, 0x74eb, 0x1118, 0x080c, 0x77db, 0x0050, 0x080c, 0x74d0,
+	0x0dd0, 0x080c, 0x77d6, 0x080c, 0x77cc, 0x080c, 0x73f9, 0x0020,
+	0x2009, 0x00f8, 0x080c, 0x5fa0, 0x7850, 0xc0e5, 0x7852, 0x080c,
+	0x74c8, 0x0120, 0x7843, 0x0090, 0x7843, 0x0010, 0x2021, 0xe678,
+	0x2019, 0xea60, 0x0d0c, 0x8709, 0x7820, 0xd09c, 0x15a0, 0x080c,
+	0x74c8, 0x0904, 0x0ca3, 0x7824, 0xd0ac, 0x1904, 0x0cc6, 0x080c,
+	0x74eb, 0x1548, 0x0046, 0x2021, 0x0320, 0x8421, 0x1df0, 0x004e,
+	0x2011, 0x1800, 0x080c, 0x2a63, 0x080c, 0x2a0f, 0x7824, 0x9084,
 	0x1800, 0x1168, 0x9484, 0x0fff, 0x1140, 0x2001, 0x1810, 0x2004,
 	0x9084, 0x9000, 0x0110, 0x080c, 0x0ce9, 0x8421, 0x1160, 0x1d04,
-	0x0c73, 0x080c, 0x872a, 0x080c, 0x77f7, 0x080c, 0x77ed, 0x7003,
+	0x0c73, 0x080c, 0x8709, 0x080c, 0x77d6, 0x080c, 0x77cc, 0x7003,
 	0x0001, 0x0804, 0x0cc6, 0x8319, 0x1928, 0x2001, 0x1810, 0x2004,
 	0x9084, 0x9000, 0x0110, 0x080c, 0x0ce9, 0x1d04, 0x0c89, 0x080c,
-	0x872a, 0x2009, 0x199b, 0x2104, 0x9005, 0x0118, 0x8001, 0x200a,
-	0x1188, 0x200b, 0x000a, 0x2011, 0x0048, 0x080c, 0x2a44, 0x20a9,
-	0x0002, 0x080c, 0x29d1, 0x7924, 0x080c, 0x29f0, 0xd19c, 0x0110,
-	0x080c, 0x2916, 0x00f0, 0x080c, 0x74fa, 0x1140, 0x94a2, 0x03e8,
-	0x1128, 0x080c, 0x74bd, 0x7003, 0x0001, 0x00c0, 0x2011, 0x1800,
-	0x080c, 0x2a44, 0x080c, 0x29f0, 0x7824, 0x080c, 0x7503, 0x0110,
+	0x8709, 0x2009, 0x199a, 0x2104, 0x9005, 0x0118, 0x8001, 0x200a,
+	0x1188, 0x200b, 0x000a, 0x2011, 0x0048, 0x080c, 0x2a63, 0x20a9,
+	0x0002, 0x080c, 0x29f0, 0x7924, 0x080c, 0x2a0f, 0xd19c, 0x0110,
+	0x080c, 0x292f, 0x00f0, 0x080c, 0x74d9, 0x1140, 0x94a2, 0x03e8,
+	0x1128, 0x080c, 0x749c, 0x7003, 0x0001, 0x00c0, 0x2011, 0x1800,
+	0x080c, 0x2a63, 0x080c, 0x2a0f, 0x7824, 0x080c, 0x74e2, 0x0110,
 	0xd0ac, 0x1160, 0x9084, 0x1800, 0x0904, 0x0c7b, 0x7003, 0x0001,
-	0x0028, 0x2001, 0x0001, 0x080c, 0x25a0, 0x00a0, 0x7850, 0xc0e4,
+	0x0028, 0x2001, 0x0001, 0x080c, 0x25b9, 0x00a0, 0x7850, 0xc0e4,
 	0x7852, 0x2009, 0x180c, 0x210c, 0xd19c, 0x1120, 0x7904, 0x918d,
-	0x0002, 0x7906, 0x2011, 0x0048, 0x080c, 0x2a44, 0x7828, 0x9085,
-	0x0028, 0x782a, 0x2001, 0x19a7, 0x2003, 0x0000, 0x9006, 0x78f2,
+	0x0002, 0x7906, 0x2011, 0x0048, 0x080c, 0x2a63, 0x7828, 0x9085,
+	0x0028, 0x782a, 0x2001, 0x19a6, 0x2003, 0x0000, 0x9006, 0x78f2,
 	0x015e, 0x003e, 0x000e, 0x012e, 0x00fe, 0x004e, 0x002e, 0x001e,
 	0x0005, 0x0006, 0x0016, 0x0026, 0x0036, 0x0046, 0x00b6, 0x00c6,
-	0x00d6, 0x00e6, 0x00f6, 0x0156, 0x0071, 0x0d0c, 0x872a, 0x015e,
+	0x00d6, 0x00e6, 0x00f6, 0x0156, 0x0071, 0x0d0c, 0x8709, 0x015e,
 	0x00fe, 0x00ee, 0x00de, 0x00ce, 0x00be, 0x004e, 0x003e, 0x002e,
 	0x001e, 0x000e, 0x0005, 0x00e6, 0x2071, 0x189e, 0x7004, 0x9086,
-	0x0001, 0x1110, 0x080c, 0x349b, 0x00ee, 0x0005, 0x0005, 0x2a70,
-	0x2061, 0x19ab, 0x2063, 0x0003, 0x6007, 0x0002, 0x600b, 0x001c,
-	0x600f, 0x0137, 0x2001, 0x197c, 0x900e, 0x2102, 0x7196, 0x2001,
+	0x0001, 0x1110, 0x080c, 0x348f, 0x00ee, 0x0005, 0x0005, 0x2a70,
+	0x2061, 0x19aa, 0x2063, 0x0003, 0x6007, 0x0002, 0x600b, 0x001e,
+	0x600f, 0x0137, 0x2001, 0x197b, 0x900e, 0x2102, 0x7196, 0x2001,
 	0x0100, 0x2004, 0x9082, 0x0002, 0x0218, 0x705f, 0xffff, 0x0008,
-	0x715e, 0x7067, 0xffff, 0x717e, 0x7182, 0x080c, 0xcc9f, 0x70ef,
-	0x00c0, 0x2061, 0x196c, 0x6003, 0x0909, 0x6106, 0x600b, 0x8800,
+	0x715e, 0x7067, 0xffff, 0x717e, 0x7182, 0x080c, 0xcc9e, 0x70ef,
+	0x00c0, 0x2061, 0x196b, 0x6003, 0x0909, 0x6106, 0x600b, 0x8800,
 	0x600f, 0x0200, 0x6013, 0x00ff, 0x6017, 0x001f, 0x611a, 0x601f,
-	0x07d0, 0x2061, 0x1974, 0x6003, 0x8000, 0x6106, 0x610a, 0x600f,
+	0x07d0, 0x2061, 0x1973, 0x6003, 0x8000, 0x6106, 0x610a, 0x600f,
 	0x0200, 0x6013, 0x00ff, 0x6116, 0x601b, 0x0001, 0x611e, 0x2061,
-	0x1989, 0x6003, 0x514c, 0x6007, 0x4f47, 0x600b, 0x4943, 0x600f,
-	0x2020, 0x2001, 0x182c, 0x2102, 0x0005, 0x9016, 0x080c, 0x6625,
+	0x1988, 0x6003, 0x514c, 0x6007, 0x4f47, 0x600b, 0x4943, 0x600f,
+	0x2020, 0x2001, 0x182c, 0x2102, 0x0005, 0x9016, 0x080c, 0x6620,
 	0x1178, 0xb804, 0x90c4, 0x00ff, 0x98c6, 0x0006, 0x0128, 0x90c4,
 	0xff00, 0x98c6, 0x0600, 0x1120, 0x9186, 0x0080, 0x0108, 0x8210,
 	0x8108, 0x9186, 0x0800, 0x1d50, 0x2208, 0x0005, 0x2091, 0x8000,
@@ -229,29 +229,29 @@ unsigned short risc_code01[] = {
 	0x0d7f, 0x0006, 0x0016, 0x2001, 0x8002, 0x0006, 0x2079, 0x0000,
 	0x000e, 0x7882, 0x7836, 0x001e, 0x798e, 0x000e, 0x788a, 0x000e,
 	0x7886, 0x3900, 0x789a, 0x7833, 0x0012, 0x2091, 0x5000, 0x0156,
-	0x00d6, 0x0036, 0x0026, 0x2079, 0x0300, 0x2069, 0x1b24, 0x7a08,
-	0x226a, 0x2069, 0x1b25, 0x7a18, 0x226a, 0x8d68, 0x7a1c, 0x226a,
-	0x782c, 0x2019, 0x1b32, 0x201a, 0x2019, 0x1b35, 0x9016, 0x7808,
-	0xd09c, 0x0168, 0x7820, 0x201a, 0x8210, 0x8318, 0x9386, 0x1b4e,
+	0x00d6, 0x0036, 0x0026, 0x2079, 0x0300, 0x2069, 0x1b23, 0x7a08,
+	0x226a, 0x2069, 0x1b24, 0x7a18, 0x226a, 0x8d68, 0x7a1c, 0x226a,
+	0x782c, 0x2019, 0x1b31, 0x201a, 0x2019, 0x1b34, 0x9016, 0x7808,
+	0xd09c, 0x0168, 0x7820, 0x201a, 0x8210, 0x8318, 0x9386, 0x1b4d,
 	0x0108, 0x0ca8, 0x7808, 0xd09c, 0x0110, 0x2011, 0xdead, 0x2019,
-	0x1b33, 0x782c, 0x201a, 0x8318, 0x221a, 0x7803, 0x0000, 0x2069,
-	0x1a7a, 0x901e, 0x20a9, 0x0020, 0x7b26, 0x7a28, 0x226a, 0x8d68,
+	0x1b32, 0x782c, 0x201a, 0x8318, 0x221a, 0x7803, 0x0000, 0x2069,
+	0x1a79, 0x901e, 0x20a9, 0x0020, 0x7b26, 0x7a28, 0x226a, 0x8d68,
 	0x8318, 0x1f04, 0x0dcc, 0x0491, 0x002e, 0x003e, 0x00de, 0x015e,
 	0x2079, 0x1800, 0x7803, 0x0005, 0x2091, 0x4080, 0x2001, 0x0089,
-	0x2004, 0xd084, 0x0180, 0x2001, 0x1a22, 0x2004, 0x9005, 0x0128,
+	0x2004, 0xd084, 0x0180, 0x2001, 0x1a21, 0x2004, 0x9005, 0x0128,
 	0x2001, 0x008b, 0x2004, 0xd0fc, 0x0dd8, 0x2001, 0x008a, 0x2003,
-	0x0002, 0x2003, 0x1001, 0x080c, 0x56e9, 0x1170, 0x080c, 0x0f13,
-	0x0110, 0x080c, 0x0e66, 0x080c, 0x56e9, 0x1130, 0x2071, 0x1800,
+	0x0002, 0x2003, 0x1001, 0x080c, 0x56e4, 0x1170, 0x080c, 0x0f13,
+	0x0110, 0x080c, 0x0e66, 0x080c, 0x56e4, 0x1130, 0x2071, 0x1800,
 	0x2011, 0x8000, 0x080c, 0x0f27, 0x0c70, 0x0005, 0x2001, 0x0382,
 	0x2004, 0x9084, 0x0007, 0x9086, 0x0001, 0x1120, 0x2001, 0x0015,
-	0x080c, 0xa887, 0x2079, 0x0380, 0x2069, 0x1b04, 0x7818, 0x6802,
+	0x080c, 0xa879, 0x2079, 0x0380, 0x2069, 0x1b03, 0x7818, 0x6802,
 	0x781c, 0x6806, 0x7840, 0x680a, 0x7844, 0x680e, 0x782c, 0x6812,
-	0x2019, 0x1b0f, 0x9016, 0x7808, 0xd09c, 0x0150, 0x7820, 0x201a,
+	0x2019, 0x1b0e, 0x9016, 0x7808, 0xd09c, 0x0150, 0x7820, 0x201a,
 	0x8210, 0x8318, 0x8210, 0x9282, 0x0011, 0x0ea8, 0x2011, 0xdead,
 	0x6a2a, 0x7830, 0x681a, 0x7834, 0x681e, 0x7838, 0x6822, 0x783c,
-	0x6826, 0x7803, 0x0000, 0x2069, 0x1ac4, 0x901e, 0x20a9, 0x0020,
+	0x6826, 0x7803, 0x0000, 0x2069, 0x1ac3, 0x901e, 0x20a9, 0x0020,
 	0x7b26, 0x7828, 0x206a, 0x8d68, 0x8318, 0x1f04, 0x0e40, 0x2069,
-	0x1ae4, 0x2019, 0x00b0, 0x20a9, 0x0020, 0x7b26, 0x7828, 0x206a,
+	0x1ae3, 0x2019, 0x00b0, 0x20a9, 0x0020, 0x7b26, 0x7828, 0x206a,
 	0x8d68, 0x8318, 0x1f04, 0x0e4d, 0x0005, 0x918c, 0x03ff, 0x2001,
 	0x0003, 0x2004, 0x9084, 0x0600, 0x1118, 0x918d, 0x6c00, 0x0010,
 	0x918d, 0x6400, 0x2001, 0x017f, 0x2102, 0x0005, 0x0026, 0x0126,
@@ -266,7 +266,7 @@ unsigned short risc_code01[] = {
 	0x0148, 0xd0a4, 0x1138, 0x2011, 0xcdd5, 0x0010, 0x2011, 0x0080,
 	0x080c, 0x0f18, 0x002e, 0x0005, 0x0026, 0x70f3, 0x0000, 0x080c,
 	0x0f13, 0x1130, 0x2011, 0x8040, 0x080c, 0x0f27, 0x002e, 0x0005,
-	0x080c, 0x29e8, 0x1118, 0x2011, 0xcdc5, 0x0010, 0x2011, 0xcac2,
+	0x080c, 0x2a07, 0x1118, 0x2011, 0xcdc5, 0x0010, 0x2011, 0xcac2,
 	0x080c, 0x0f18, 0x002e, 0x0005, 0x00e6, 0x0016, 0x0006, 0x2071,
 	0x1800, 0xd0b4, 0x70ec, 0x71e8, 0x1118, 0xc0e4, 0xc1f4, 0x0050,
 	0x0006, 0x3b00, 0x9084, 0xff3e, 0x20d8, 0x000e, 0x70f3, 0x0000,
@@ -323,7 +323,7 @@ unsigned short risc_code01[] = {
 	0x0016, 0x890e, 0x810e, 0x810f, 0x9184, 0x003f, 0xa862, 0x9184,
 	0xffc0, 0xa85e, 0x001e, 0x0020, 0x00e6, 0x0126, 0x2091, 0x8000,
 	0x2071, 0x1800, 0x702c, 0xa802, 0x2900, 0x702e, 0x70c0, 0x8000,
-	0x70c2, 0x080c, 0x8553, 0x012e, 0x00ee, 0x0005, 0x2071, 0x1800,
+	0x70c2, 0x080c, 0x8532, 0x012e, 0x00ee, 0x0005, 0x2071, 0x1800,
 	0x9026, 0x2009, 0x0000, 0x2049, 0x0400, 0x2900, 0x702e, 0x8940,
 	0x2800, 0xa802, 0xa95e, 0xa863, 0x0001, 0x8420, 0x9886, 0x0440,
 	0x0120, 0x2848, 0x9188, 0x0040, 0x0c90, 0x2071, 0x188d, 0x7000,
@@ -339,5007 +339,5005 @@ unsigned short risc_code01[] = {
 	0x9982, 0x0440, 0x0278, 0x9982, 0x0558, 0x0288, 0x9982, 0x0800,
 	0x1270, 0x0040, 0x9982, 0x0800, 0x0250, 0x2071, 0x188d, 0x7010,
 	0x9902, 0x1228, 0x9085, 0x0001, 0x001e, 0x00ee, 0x0005, 0x9006,
-	0x0cd8, 0x00e6, 0x2071, 0x1a21, 0x7007, 0x0000, 0x9006, 0x701e,
+	0x0cd8, 0x00e6, 0x2071, 0x1a20, 0x7007, 0x0000, 0x9006, 0x701e,
 	0x7022, 0x7002, 0x2071, 0x0000, 0x7010, 0x9085, 0x8044, 0x7012,
-	0x2071, 0x0080, 0x9006, 0x20a9, 0x0040, 0x7022, 0x1f04, 0x111d,
-	0x702b, 0x0020, 0x00ee, 0x0005, 0x0126, 0x2091, 0x8000, 0x00e6,
-	0xa06f, 0x0000, 0x2071, 0x1a21, 0x701c, 0x9088, 0x1a2b, 0x280a,
-	0x8000, 0x9084, 0x003f, 0x701e, 0x7120, 0x9106, 0x090c, 0x0d7d,
-	0x7004, 0x9005, 0x1128, 0x00f6, 0x2079, 0x0080, 0x00a9, 0x00fe,
-	0x00ee, 0x012e, 0x0005, 0x0126, 0x2091, 0x8000, 0x00e6, 0x2071,
-	0x1a21, 0x7004, 0x9005, 0x1128, 0x00f6, 0x2079, 0x0080, 0x0021,
-	0x00fe, 0x00ee, 0x012e, 0x0005, 0x7004, 0x9086, 0x0000, 0x1110,
-	0x7007, 0x0006, 0x7000, 0x0002, 0x1166, 0x12e9, 0x1164, 0x1164,
-	0x12dd, 0x12dd, 0x12dd, 0x12dd, 0x080c, 0x0d7d, 0x701c, 0x7120,
-	0x9106, 0x1148, 0x792c, 0x9184, 0x0001, 0x1120, 0xd1fc, 0x1110,
-	0x7007, 0x0000, 0x0005, 0x0096, 0x9180, 0x1a2b, 0x2004, 0x700a,
-	0x2048, 0x8108, 0x918c, 0x003f, 0x7122, 0x782b, 0x0026, 0xa88c,
-	0x7802, 0xa890, 0x7806, 0xa894, 0x780a, 0xa898, 0x780e, 0xa878,
-	0x700e, 0xa870, 0x7016, 0xa874, 0x701a, 0xa868, 0x009e, 0xd084,
-	0x0120, 0x7007, 0x0001, 0x0029, 0x0005, 0x7007, 0x0002, 0x00b1,
-	0x0005, 0x0016, 0x0026, 0x710c, 0x2011, 0x0040, 0x9182, 0x0040,
-	0x1210, 0x2110, 0x9006, 0x700e, 0x7212, 0x8203, 0x7812, 0x782b,
-	0x0020, 0x782b, 0x0041, 0x002e, 0x001e, 0x0005, 0x0016, 0x0026,
-	0x0136, 0x0146, 0x0156, 0x7014, 0x20e0, 0x7018, 0x2098, 0x20e9,
-	0x0000, 0x20a1, 0x0088, 0x782b, 0x0026, 0x710c, 0x2011, 0x0040,
-	0x9182, 0x0040, 0x1210, 0x2110, 0x9006, 0x700e, 0x22a8, 0x4006,
-	0x8203, 0x7812, 0x782b, 0x0020, 0x3300, 0x701a, 0x782b, 0x0001,
-	0x015e, 0x014e, 0x013e, 0x002e, 0x001e, 0x0005, 0x2009, 0x1a21,
-	0x2104, 0xc095, 0x200a, 0x080c, 0x1143, 0x0005, 0x0016, 0x00e6,
-	0x2071, 0x1a21, 0x00f6, 0x2079, 0x0080, 0x792c, 0xd1bc, 0x190c,
-	0x0d76, 0x782b, 0x0002, 0xd1fc, 0x0120, 0x918c, 0x0700, 0x7004,
-	0x0023, 0x00fe, 0x00ee, 0x001e, 0x0005, 0x1154, 0x11fc, 0x1230,
-	0x1308, 0x0d7d, 0x1323, 0x0d7d, 0x918c, 0x0700, 0x1550, 0x0136,
-	0x0146, 0x0156, 0x7014, 0x20e8, 0x7018, 0x20a0, 0x20e1, 0x0000,
-	0x2099, 0x0088, 0x782b, 0x0040, 0x7010, 0x20a8, 0x4005, 0x3400,
-	0x701a, 0x015e, 0x014e, 0x013e, 0x700c, 0x9005, 0x0578, 0x7800,
-	0x7802, 0x7804, 0x7806, 0x080c, 0x1199, 0x0005, 0x7008, 0x0096,
-	0x2048, 0xa86f, 0x0100, 0x009e, 0x7007, 0x0000, 0x080c, 0x1154,
-	0x0005, 0x7008, 0x0096, 0x2048, 0xa86f, 0x0200, 0x009e, 0x0ca0,
-	0x918c, 0x0700, 0x1150, 0x700c, 0x9005, 0x0180, 0x7800, 0x7802,
-	0x7804, 0x7806, 0x080c, 0x11ae, 0x0005, 0x7008, 0x0096, 0x2048,
-	0xa86f, 0x0200, 0x009e, 0x7007, 0x0000, 0x0080, 0x0096, 0x7008,
-	0x2048, 0x7800, 0xa88e, 0x7804, 0xa892, 0x7808, 0xa896, 0x780c,
-	0xa89a, 0xa86f, 0x0100, 0x009e, 0x7007, 0x0000, 0x0096, 0x00d6,
-	0x7008, 0x2048, 0x2001, 0x18b9, 0x2004, 0x9906, 0x1128, 0xa89c,
-	0x080f, 0x00de, 0x009e, 0x00a0, 0x00de, 0x009e, 0x0096, 0x00d6,
-	0x7008, 0x2048, 0x0081, 0x0150, 0xa89c, 0x0086, 0x2940, 0x080f,
-	0x008e, 0x00de, 0x009e, 0x080c, 0x1143, 0x0005, 0x00de, 0x009e,
-	0x080c, 0x1143, 0x0005, 0xa8a8, 0xd08c, 0x0005, 0x0096, 0xa0a0,
-	0x904d, 0x090c, 0x0d7d, 0xa06c, 0x908e, 0x0100, 0x0130, 0xa87b,
-	0x0030, 0xa883, 0x0000, 0xa897, 0x4002, 0x080c, 0x6d74, 0xa09f,
-	0x0000, 0xa0a3, 0x0000, 0x2848, 0x080c, 0x106c, 0x009e, 0x0005,
-	0x00a6, 0xa0a0, 0x904d, 0x090c, 0x0d7d, 0xa06c, 0x908e, 0x0100,
-	0x0128, 0xa87b, 0x0001, 0xa883, 0x0000, 0x00c0, 0xa80c, 0x2050,
-	0xb004, 0x9005, 0x0198, 0xa80e, 0x2050, 0x8006, 0x8006, 0x8007,
-	0x908c, 0x003f, 0x9084, 0xffc0, 0x9080, 0x0002, 0xa076, 0xa172,
-	0xb000, 0xa07a, 0x2810, 0x080c, 0x1124, 0x00e8, 0xa97c, 0xa894,
-	0x0016, 0x0006, 0x080c, 0x6d74, 0x000e, 0x001e, 0xd1fc, 0x1138,
-	0xd1f4, 0x0128, 0x00c6, 0x2060, 0x080c, 0xabed, 0x00ce, 0x7008,
-	0x2048, 0xa89f, 0x0000, 0xa8a3, 0x0000, 0x080c, 0x106c, 0x7007,
-	0x0000, 0x080c, 0x1143, 0x00ae, 0x0005, 0x0126, 0x2091, 0x8000,
-	0x782b, 0x1001, 0x7007, 0x0005, 0x7000, 0xc094, 0x7002, 0x012e,
-	0x0005, 0x0096, 0x2001, 0x192e, 0x204c, 0xa87c, 0x7812, 0xa88c,
-	0x7802, 0xa890, 0x7806, 0xa894, 0x780a, 0xa898, 0x780e, 0x782b,
-	0x0020, 0x0126, 0x2091, 0x8000, 0x782b, 0x0041, 0x7007, 0x0003,
-	0x7000, 0xc084, 0x7002, 0x2900, 0x700a, 0x012e, 0x009e, 0x0005,
-	0x20e1, 0x0000, 0x2099, 0x0088, 0x782b, 0x0040, 0x0096, 0x2001,
-	0x192e, 0x204c, 0xaa7c, 0x009e, 0x080c, 0x8c1b, 0x2009, 0x188c,
-	0x2104, 0x9084, 0xfffc, 0x200a, 0x080c, 0x8a8e, 0x7007, 0x0000,
-	0x080c, 0x1154, 0x0005, 0x7007, 0x0000, 0x080c, 0x1154, 0x0005,
-	0x0126, 0x2091, 0x2200, 0x2079, 0x0300, 0x2071, 0x1a6b, 0x7003,
-	0x0000, 0x78bf, 0x00f6, 0x0041, 0x7807, 0x0007, 0x7803, 0x0000,
-	0x7803, 0x0001, 0x012e, 0x0005, 0x00c6, 0x7803, 0x0000, 0x2001,
-	0x0165, 0x2003, 0x4198, 0x7808, 0xd09c, 0x0118, 0x7820, 0x04e9,
-	0x0cd0, 0x2001, 0x1a6c, 0x2003, 0x0000, 0x78ab, 0x0004, 0x78ac,
-	0xd0ac, 0x1de8, 0x78ab, 0x0002, 0x7807, 0x0007, 0x7827, 0x0030,
-	0x782b, 0x0400, 0x7827, 0x0031, 0x782b, 0x1a7a, 0x781f, 0xff00,
-	0x781b, 0xff00, 0x2001, 0x0200, 0x2004, 0xd0dc, 0x0110, 0x781f,
-	0x0303, 0x2061, 0x1a7a, 0x602f, 0x1ddc, 0x2001, 0x181a, 0x2004,
-	0x9082, 0x1ddc, 0x6032, 0x603b, 0x1e55, 0x602b, 0x1aba, 0x6007,
-	0x1a9a, 0x2061, 0x1a9a, 0x60af, 0x193c, 0x2001, 0x1927, 0x2004,
-	0x60ba, 0x783f, 0x3374, 0x00ce, 0x0005, 0x9086, 0x000d, 0x11d0,
-	0x7808, 0xd09c, 0x01b8, 0x7820, 0x0026, 0x2010, 0x080c, 0xc826,
-	0x0180, 0x2260, 0x6000, 0x9086, 0x0004, 0x1158, 0x0016, 0x6120,
-	0x9186, 0x0009, 0x0108, 0x0020, 0x2009, 0x004c, 0x080c, 0xac8c,
-	0x001e, 0x002e, 0x0005, 0x0126, 0x2091, 0x2200, 0x7908, 0x9184,
-	0x0070, 0x190c, 0x0d76, 0xd19c, 0x05a0, 0x7820, 0x908c, 0xf000,
-	0x0540, 0x2060, 0x6020, 0x9086, 0x0003, 0x1550, 0x6000, 0x9086,
-	0x0004, 0x1530, 0x6114, 0x2148, 0xa876, 0xa87a, 0xa867, 0x0103,
-	0x080c, 0x6b96, 0x00b6, 0x6010, 0x2058, 0xba3c, 0x8211, 0x0208,
-	0xba3e, 0xb8d0, 0x9005, 0x190c, 0x6750, 0x00be, 0x6044, 0xd0fc,
-	0x190c, 0xa8bf, 0x080c, 0xac16, 0x7808, 0xd09c, 0x19b0, 0x012e,
-	0x0005, 0x908a, 0x0024, 0x1a0c, 0x0d7d, 0x002b, 0x012e, 0x0005,
-	0x04b0, 0x012e, 0x0005, 0x1407, 0x142d, 0x145d, 0x1462, 0x1466,
-	0x146b, 0x1493, 0x1497, 0x14a5, 0x14a9, 0x1407, 0x1574, 0x1578,
-	0x15dd, 0x15e4, 0x1407, 0x15e5, 0x15e6, 0x15f1, 0x15f8, 0x1407,
-	0x1407, 0x1407, 0x1407, 0x1407, 0x1407, 0x1407, 0x146d, 0x1407,
-	0x1435, 0x145a, 0x1421, 0x1407, 0x1441, 0x140b, 0x1409, 0x080c,
-	0x0d7d, 0x080c, 0x0d76, 0x080c, 0x1603, 0x2009, 0x1a79, 0x2104,
-	0x8000, 0x200a, 0x080c, 0x7f99, 0x080c, 0x1ab5, 0x0005, 0x6044,
-	0xd0fc, 0x190c, 0xa8bf, 0x2009, 0x0055, 0x080c, 0xac8c, 0x012e,
-	0x0005, 0x080c, 0x1603, 0x2060, 0x6044, 0xd0fc, 0x190c, 0xa8bf,
-	0x2009, 0x0055, 0x080c, 0xac8c, 0x0005, 0x2009, 0x0048, 0x080c,
-	0x1603, 0x2060, 0x080c, 0xac8c, 0x0005, 0x2009, 0x0054, 0x080c,
-	0x1603, 0x2060, 0x6044, 0xd0fc, 0x190c, 0xa8bf, 0x080c, 0xac8c,
-	0x0005, 0x080c, 0x1603, 0x2060, 0x0056, 0x0066, 0x080c, 0x1603,
-	0x2028, 0x080c, 0x1603, 0x2030, 0x0036, 0x0046, 0x2021, 0x0000,
-	0x2418, 0x2009, 0x0056, 0x080c, 0xac8c, 0x004e, 0x003e, 0x006e,
-	0x005e, 0x0005, 0x080c, 0x1603, 0x0005, 0x7004, 0xc085, 0xc0b5,
-	0x7006, 0x0005, 0x7004, 0xc085, 0x7006, 0x0005, 0x080c, 0x1603,
-	0x080c, 0x16c7, 0x0005, 0x080c, 0x0d7d, 0x080c, 0x1603, 0x2060,
-	0x6014, 0x0096, 0x2048, 0xa83b, 0xffff, 0x009e, 0x2009, 0x0048,
-	0x080c, 0xac8c, 0x2001, 0x015d, 0x2003, 0x0000, 0x2009, 0x03e8,
-	0x8109, 0x0160, 0x2001, 0x0201, 0x2004, 0x9005, 0x0dc8, 0x2001,
-	0x0218, 0x2004, 0xd0ec, 0x1110, 0x080c, 0x1608, 0x2001, 0x0307,
-	0x2003, 0x8000, 0x0005, 0x7004, 0xc095, 0x7006, 0x0005, 0x080c,
-	0x1603, 0x2060, 0x6014, 0x0096, 0x2048, 0xa83b, 0xffff, 0x009e,
-	0x2009, 0x0048, 0x080c, 0xac8c, 0x0005, 0x080c, 0x1603, 0x080c,
-	0x0d7d, 0x080c, 0x1603, 0x080c, 0x155f, 0x7827, 0x0018, 0x79ac,
-	0xd1dc, 0x0904, 0x1512, 0x7827, 0x0015, 0x7828, 0x782b, 0x0000,
-	0x9065, 0x0140, 0x2001, 0x020d, 0x2003, 0x0050, 0x2003, 0x0020,
-	0x0804, 0x1518, 0x7004, 0x9005, 0x01c8, 0x1188, 0x78ab, 0x0004,
-	0x7827, 0x0018, 0x782b, 0x0000, 0xd1bc, 0x090c, 0x0d7d, 0x2001,
-	0x020d, 0x2003, 0x0050, 0x2003, 0x0020, 0x0804, 0x1544, 0x78ab,
-	0x0004, 0x7803, 0x0001, 0x080c, 0x1578, 0x0005, 0x7827, 0x0018,
-	0xa001, 0x7828, 0x7827, 0x0011, 0xa001, 0x7928, 0x9106, 0x0110,
-	0x79ac, 0x08e0, 0x00e6, 0x2071, 0x0200, 0x702c, 0xd0c4, 0x0140,
-	0x00ee, 0x080c, 0x1ab5, 0x080c, 0x133c, 0x7803, 0x0001, 0x0005,
-	0x7037, 0x0001, 0xa001, 0x7150, 0x00ee, 0x918c, 0xff00, 0x9186,
-	0x0500, 0x0110, 0x79ac, 0x0810, 0x7004, 0xc09d, 0x7006, 0x78ab,
-	0x0004, 0x7803, 0x0001, 0x080c, 0x1578, 0x2001, 0x020d, 0x2003,
-	0x0020, 0x0005, 0x7828, 0x782b, 0x0000, 0x9065, 0x090c, 0x0d7d,
-	0x6014, 0x2048, 0x78ab, 0x0004, 0x918c, 0x0700, 0x0198, 0x080c,
-	0x7f99, 0x080c, 0x1ab5, 0x080c, 0xc838, 0x0158, 0xa9ac, 0xa936,
-	0xa9b0, 0xa93a, 0xa83f, 0xffff, 0xa843, 0xffff, 0xa880, 0xc0bd,
-	0xa882, 0x0005, 0x6020, 0x9086, 0x0009, 0x1128, 0x2009, 0x004c,
-	0x080c, 0xac8c, 0x0048, 0x6010, 0x00b6, 0x2058, 0xb800, 0x00be,
-	0xd0bc, 0x6024, 0x190c, 0xcc34, 0x2029, 0x00c8, 0x8529, 0x0128,
-	0x2001, 0x0201, 0x2004, 0x9005, 0x0dc8, 0x7dbc, 0x080c, 0xe6da,
-	0xd5a4, 0x1118, 0x080c, 0x1608, 0x0005, 0x080c, 0x7f99, 0x080c,
-	0x1ab5, 0x0005, 0x781f, 0x0300, 0x7803, 0x0001, 0x0005, 0x0016,
-	0x0066, 0x0076, 0x00f6, 0x2079, 0x0300, 0x7908, 0x918c, 0x0007,
-	0x9186, 0x0003, 0x0120, 0x2001, 0x0016, 0x080c, 0x1679, 0x00fe,
-	0x007e, 0x006e, 0x001e, 0x0005, 0x7004, 0xc09d, 0x7006, 0x0005,
-	0x7104, 0x9184, 0x0004, 0x190c, 0x0d7d, 0xd184, 0x1189, 0xd19c,
-	0x0158, 0xc19c, 0x7106, 0x2001, 0x020d, 0x2003, 0x0050, 0x2003,
-	0x0020, 0x080c, 0x1608, 0x0005, 0x81ff, 0x190c, 0x0d7d, 0x0005,
-	0xc184, 0xd1b4, 0xc1b4, 0x7106, 0x0016, 0x00e6, 0x15f0, 0x2071,
-	0x0200, 0x080c, 0x16b4, 0x05c8, 0x6014, 0x9005, 0x05b0, 0x0096,
-	0x2048, 0xa864, 0x009e, 0x9084, 0x00ff, 0x908e, 0x0029, 0x0160,
-	0x908e, 0x0048, 0x1550, 0x601c, 0xd084, 0x11e0, 0x00f6, 0x2c78,
-	0x080c, 0x1731, 0x00fe, 0x00b0, 0x00f6, 0x2c78, 0x080c, 0x18b8,
-	0x00fe, 0x2009, 0x01f4, 0x8109, 0x0168, 0x2001, 0x0201, 0x2004,
-	0x9005, 0x0dc8, 0x2001, 0x0218, 0x2004, 0xd0ec, 0x1118, 0x080c,
-	0x1608, 0x0040, 0x2001, 0x020d, 0x2003, 0x0020, 0x080c, 0x133c,
-	0x7803, 0x0001, 0x00ee, 0x001e, 0x0005, 0x2001, 0x020d, 0x2003,
-	0x0050, 0x2003, 0x0020, 0x0461, 0x0ca8, 0x0429, 0x2060, 0x2009,
-	0x0053, 0x080c, 0xac8c, 0x0005, 0x0005, 0x0005, 0x00e1, 0x2008,
-	0x00d1, 0x0006, 0x7004, 0xc09d, 0x7006, 0x000e, 0x080c, 0x8f78,
-	0x0005, 0x0089, 0x9005, 0x0118, 0x080c, 0x8b7b, 0x0cd0, 0x0005,
-	0x2001, 0x0036, 0x2009, 0x1820, 0x210c, 0x2011, 0x181f, 0x2214,
-	0x080c, 0x1679, 0x0005, 0x7808, 0xd09c, 0x0de8, 0x7820, 0x0005,
-	0x080c, 0x155f, 0x00d6, 0x2069, 0x0200, 0x2009, 0x01f4, 0x8109,
-	0x0510, 0x6804, 0x9005, 0x0dd8, 0x2001, 0x015d, 0x2003, 0x0000,
-	0x79bc, 0xd1a4, 0x1528, 0x79b8, 0x918c, 0x0fff, 0x0180, 0x9182,
-	0x0841, 0x1268, 0x9188, 0x0007, 0x918c, 0x0ff8, 0x810c, 0x810c,
-	0x810c, 0x080c, 0x166b, 0x6827, 0x0001, 0x8109, 0x1dd0, 0x04d9,
-	0x6827, 0x0002, 0x04c1, 0x6804, 0x9005, 0x1130, 0x682c, 0xd0e4,
-	0x1500, 0x6804, 0x9005, 0x0de8, 0x79b8, 0xd1ec, 0x1130, 0x08c0,
-	0x080c, 0x7f99, 0x080c, 0x1ab5, 0x0090, 0x7827, 0x0015, 0x782b,
-	0x0000, 0x7827, 0x0018, 0x782b, 0x0000, 0x2001, 0x020d, 0x2003,
-	0x0020, 0x2001, 0x0307, 0x2003, 0x0300, 0x7803, 0x0001, 0x00de,
-	0x0005, 0x682c, 0x9084, 0x5400, 0x9086, 0x5400, 0x0d30, 0x7827,
-	0x0015, 0x782b, 0x0000, 0x7803, 0x0001, 0x6800, 0x9085, 0x1800,
-	0x6802, 0x00de, 0x0005, 0x6824, 0x9084, 0x0003, 0x1de0, 0x0005,
-	0x2001, 0x0030, 0x2c08, 0x621c, 0x0021, 0x7830, 0x9086, 0x0041,
-	0x0005, 0x00f6, 0x2079, 0x0300, 0x0006, 0x7808, 0xd09c, 0x0140,
-	0x0016, 0x0026, 0x00c6, 0x080c, 0x13a3, 0x00ce, 0x002e, 0x001e,
-	0x000e, 0x0006, 0x7832, 0x7936, 0x7a3a, 0x781b, 0x8080, 0x0059,
-	0x1118, 0x000e, 0x00fe, 0x0005, 0x000e, 0x792c, 0x3900, 0x8000,
-	0x2004, 0x080c, 0x0d7d, 0x2009, 0xff00, 0x8109, 0x0120, 0x7818,
-	0xd0bc, 0x1dd8, 0x0005, 0x9085, 0x0001, 0x0005, 0x7832, 0x7936,
-	0x7a3a, 0x781b, 0x8080, 0x0c79, 0x1108, 0x0005, 0x792c, 0x3900,
-	0x8000, 0x2004, 0x080c, 0x0d7d, 0x7037, 0x0001, 0x7150, 0x7037,
-	0x0002, 0x7050, 0x2060, 0xd1bc, 0x1110, 0x7054, 0x2060, 0x918c,
-	0xff00, 0x9186, 0x0500, 0x0110, 0x9085, 0x0001, 0x0005, 0x00e6,
-	0x0016, 0x2071, 0x0200, 0x0c41, 0x6124, 0xd1dc, 0x01f8, 0x701c,
-	0xd08c, 0x0904, 0x1726, 0x7017, 0x0000, 0x2001, 0x0264, 0x2004,
-	0xd0bc, 0x0904, 0x1726, 0x2001, 0x0268, 0x00c6, 0x2064, 0x6104,
-	0x6038, 0x00ce, 0x918e, 0x0039, 0x1904, 0x1726, 0x9c06, 0x15f0,
-	0x0126, 0x2091, 0x2600, 0x080c, 0x7ef1, 0x012e, 0x7358, 0x745c,
-	0x6014, 0x905d, 0x0598, 0x2b48, 0x6010, 0x00b6, 0x2058, 0xb800,
-	0x00be, 0xd0bc, 0x190c, 0xcc0f, 0xab42, 0xac3e, 0x2001, 0x1869,
-	0x2004, 0xd0b4, 0x1170, 0x601c, 0xd0e4, 0x1158, 0x6010, 0x00b6,
-	0x2058, 0xb800, 0x00be, 0xd0bc, 0x1120, 0xa83b, 0x7fff, 0xa837,
-	0xffff, 0x080c, 0x1e75, 0x1190, 0x080c, 0x1913, 0x2a00, 0xa816,
-	0x0130, 0x2800, 0xa80e, 0x2c05, 0xa80a, 0x2c00, 0xa812, 0x7037,
-	0x0020, 0x781f, 0x0300, 0x001e, 0x00ee, 0x0005, 0x7037, 0x0050,
-	0x7037, 0x0020, 0x001e, 0x00ee, 0x080c, 0x1608, 0x0005, 0x080c,
-	0x0d7d, 0x2cf0, 0x0126, 0x2091, 0x2200, 0x00c6, 0x3e60, 0x6014,
-	0x2048, 0x2940, 0x903e, 0x2730, 0xa864, 0x2068, 0xa81a, 0x9d84,
-	0x000f, 0x9088, 0x1e55, 0x2165, 0x0002, 0x175c, 0x17ca, 0x175c,
-	0x175c, 0x1760, 0x17ab, 0x175c, 0x1780, 0x1755, 0x17c1, 0x175c,
-	0x175c, 0x1765, 0x18b6, 0x1794, 0x178a, 0xa964, 0x918c, 0x00ff,
-	0x918e, 0x0048, 0x0904, 0x17c1, 0x9085, 0x0001, 0x0804, 0x18ad,
-	0xa87c, 0xd0ac, 0x0dc8, 0x0804, 0x17d1, 0xa87c, 0xd0ac, 0x0da0,
-	0x0804, 0x183c, 0xa898, 0x901d, 0x1108, 0xab9c, 0x9016, 0xaab2,
-	0xaa3e, 0xaa42, 0x3e00, 0x9080, 0x0008, 0x2004, 0x9080, 0x9141,
-	0x2005, 0x9005, 0x090c, 0x0d7d, 0x2004, 0xa8ae, 0x0804, 0x1895,
-	0xa87c, 0xd0bc, 0x09c8, 0xa890, 0xa842, 0xa88c, 0xa83e, 0xa888,
-	0x0804, 0x17d1, 0xa87c, 0xd0bc, 0x0978, 0xa890, 0xa842, 0xa88c,
-	0xa83e, 0xa888, 0x0804, 0x183c, 0xa87c, 0xd0bc, 0x0928, 0xa890,
-	0xa842, 0xa88c, 0xa83e, 0xa804, 0x9045, 0x090c, 0x0d7d, 0xa164,
-	0xa91a, 0x91ec, 0x000f, 0x9d80, 0x1e55, 0x2065, 0xa888, 0xd19c,
-	0x1904, 0x183c, 0x0430, 0xa87c, 0xd0ac, 0x0904, 0x175c, 0xa804,
-	0x9045, 0x090c, 0x0d7d, 0xa164, 0xa91a, 0x91ec, 0x000f, 0x9d80,
-	0x1e55, 0x2065, 0x9006, 0xa842, 0xa83e, 0xd19c, 0x1904, 0x183c,
-	0x0080, 0xa87c, 0xd0ac, 0x0904, 0x175c, 0x9006, 0xa842, 0xa83e,
-	0x0804, 0x183c, 0xa87c, 0xd0ac, 0x0904, 0x175c, 0x9006, 0xa842,
-	0xa83e, 0x2c05, 0x908a, 0x0036, 0x1a0c, 0x0d7d, 0x9082, 0x001b,
-	0x0002, 0x17f4, 0x17f4, 0x17f6, 0x17f4, 0x17f4, 0x17f4, 0x1800,
-	0x17f4, 0x17f4, 0x17f4, 0x180a, 0x17f4, 0x17f4, 0x17f4, 0x1814,
-	0x17f4, 0x17f4, 0x17f4, 0x181e, 0x17f4, 0x17f4, 0x17f4, 0x1828,
-	0x17f4, 0x17f4, 0x17f4, 0x1832, 0x080c, 0x0d7d, 0xa574, 0xa478,
-	0x9d86, 0x0024, 0x0904, 0x176a, 0xa37c, 0xa280, 0x0804, 0x1895,
-	0xa584, 0xa488, 0x9d86, 0x0024, 0x0904, 0x176a, 0xa38c, 0xa290,
-	0x0804, 0x1895, 0xa594, 0xa498, 0x9d86, 0x0024, 0x0904, 0x176a,
-	0xa39c, 0xa2a0, 0x0804, 0x1895, 0xa5a4, 0xa4a8, 0x9d86, 0x0024,
-	0x0904, 0x176a, 0xa3ac, 0xa2b0, 0x0804, 0x1895, 0xa5b4, 0xa4b8,
-	0x9d86, 0x0024, 0x0904, 0x176a, 0xa3bc, 0xa2c0, 0x0804, 0x1895,
-	0xa5c4, 0xa4c8, 0x9d86, 0x0024, 0x0904, 0x176a, 0xa3cc, 0xa2d0,
-	0x0804, 0x1895, 0xa5d4, 0xa4d8, 0x9d86, 0x0024, 0x0904, 0x176a,
-	0xa3dc, 0xa2e0, 0x0804, 0x1895, 0x2c05, 0x908a, 0x0034, 0x1a0c,
-	0x0d7d, 0x9082, 0x001b, 0x0002, 0x185f, 0x185d, 0x185d, 0x185d,
-	0x185d, 0x185d, 0x186a, 0x185d, 0x185d, 0x185d, 0x185d, 0x185d,
-	0x1875, 0x185d, 0x185d, 0x185d, 0x185d, 0x185d, 0x1880, 0x185d,
-	0x185d, 0x185d, 0x185d, 0x185d, 0x188b, 0x080c, 0x0d7d, 0xa56c,
-	0xa470, 0xa774, 0xa678, 0x9d86, 0x002c, 0x0904, 0x176a, 0xa37c,
-	0xa280, 0x0458, 0xa584, 0xa488, 0xa78c, 0xa690, 0x9d86, 0x002c,
-	0x0904, 0x176a, 0xa394, 0xa298, 0x0400, 0xa59c, 0xa4a0, 0xa7a4,
-	0xa6a8, 0x9d86, 0x002c, 0x0904, 0x176a, 0xa3ac, 0xa2b0, 0x00a8,
-	0xa5b4, 0xa4b8, 0xa7bc, 0xa6c0, 0x9d86, 0x002c, 0x0904, 0x176a,
-	0xa3c4, 0xa2c8, 0x0050, 0xa5cc, 0xa4d0, 0xa7d4, 0xa6d8, 0x9d86,
-	0x002c, 0x0904, 0x176a, 0xa3dc, 0xa2e0, 0xab2e, 0xaa32, 0xad1e,
-	0xac22, 0xaf26, 0xae2a, 0xa988, 0x8c60, 0x2c1d, 0xa8ac, 0xaab0,
-	0xa836, 0xaa3a, 0x8109, 0xa916, 0x1158, 0x3e60, 0x601c, 0xc085,
-	0x601e, 0xa87c, 0xc0dd, 0xa87e, 0x9006, 0x00ce, 0x012e, 0x0005,
-	0x2800, 0xa80e, 0xab0a, 0x2c00, 0xa812, 0x0c78, 0x0804, 0x175c,
-	0x2ff0, 0x0126, 0x2091, 0x2200, 0x00c6, 0x3e60, 0x6014, 0x2048,
-	0x2940, 0xa80e, 0x2061, 0x1e50, 0xa813, 0x1e50, 0x2c05, 0xa80a,
-	0xa964, 0xa91a, 0xa87c, 0xd0ac, 0x090c, 0x0d7d, 0x9006, 0xa842,
-	0xa83e, 0x2c05, 0x908a, 0x0034, 0x1a0c, 0x0d7d, 0xadcc, 0xacd0,
-	0xafd4, 0xaed8, 0xabdc, 0xaae0, 0xab2e, 0xaa32, 0xad1e, 0xac22,
-	0xaf26, 0xae2a, 0xa8ac, 0xaab0, 0xa836, 0xaa3a, 0xa988, 0xa864,
-	0x9084, 0x00ff, 0x9086, 0x0008, 0x1120, 0x8109, 0xa916, 0x0128,
-	0x0078, 0x918a, 0x0002, 0xa916, 0x1158, 0x3e60, 0x601c, 0xc085,
-	0x601e, 0xa87c, 0xc0dd, 0xa87e, 0x9006, 0x00ce, 0x012e, 0x0005,
-	0xa804, 0x9045, 0x090c, 0x0d7d, 0xa80e, 0xa064, 0xa81a, 0x9084,
-	0x000f, 0x9080, 0x1e55, 0x2015, 0x82ff, 0x090c, 0x0d7d, 0xaa12,
-	0x2205, 0xa80a, 0x0c10, 0x903e, 0x2730, 0xa880, 0xd0fc, 0x1190,
-	0x2d00, 0x0002, 0x1a3d, 0x196a, 0x196a, 0x1a3d, 0x196a, 0x1a37,
-	0x1a3d, 0x196a, 0x19da, 0x19da, 0x19da, 0x1a3d, 0x19da, 0x1a3d,
-	0x1a34, 0x19da, 0xc0fc, 0xa882, 0xab2c, 0xaa30, 0xad1c, 0xac20,
-	0xdd9c, 0x0904, 0x1a3f, 0x2c05, 0x908a, 0x0034, 0x1a0c, 0x0d7d,
-	0x9082, 0x001b, 0x0002, 0x1956, 0x1954, 0x1954, 0x1954, 0x1954,
-	0x1954, 0x195a, 0x1954, 0x1954, 0x1954, 0x1954, 0x1954, 0x195e,
-	0x1954, 0x1954, 0x1954, 0x1954, 0x1954, 0x1962, 0x1954, 0x1954,
-	0x1954, 0x1954, 0x1954, 0x1966, 0x080c, 0x0d7d, 0xa774, 0xa678,
-	0x0804, 0x1a3f, 0xa78c, 0xa690, 0x0804, 0x1a3f, 0xa7a4, 0xa6a8,
-	0x0804, 0x1a3f, 0xa7bc, 0xa6c0, 0x0804, 0x1a3f, 0xa7d4, 0xa6d8,
-	0x0804, 0x1a3f, 0xa898, 0x901d, 0x1108, 0xab9c, 0x9016, 0x2c05,
-	0x908a, 0x0036, 0x1a0c, 0x0d7d, 0x9082, 0x001b, 0x0002, 0x1992,
-	0x1992, 0x1994, 0x1992, 0x1992, 0x1992, 0x199e, 0x1992, 0x1992,
-	0x1992, 0x19a8, 0x1992, 0x1992, 0x1992, 0x19b2, 0x1992, 0x1992,
-	0x1992, 0x19bc, 0x1992, 0x1992, 0x1992, 0x19c6, 0x1992, 0x1992,
-	0x1992, 0x19d0, 0x080c, 0x0d7d, 0xa574, 0xa478, 0x9d86, 0x0004,
-	0x0904, 0x1a3f, 0xa37c, 0xa280, 0x0804, 0x1a3f, 0xa584, 0xa488,
-	0x9d86, 0x0004, 0x0904, 0x1a3f, 0xa38c, 0xa290, 0x0804, 0x1a3f,
-	0xa594, 0xa498, 0x9d86, 0x0004, 0x0904, 0x1a3f, 0xa39c, 0xa2a0,
-	0x0804, 0x1a3f, 0xa5a4, 0xa4a8, 0x9d86, 0x0004, 0x0904, 0x1a3f,
-	0xa3ac, 0xa2b0, 0x0804, 0x1a3f, 0xa5b4, 0xa4b8, 0x9d86, 0x0004,
-	0x0904, 0x1a3f, 0xa3bc, 0xa2c0, 0x0804, 0x1a3f, 0xa5c4, 0xa4c8,
-	0x9d86, 0x0004, 0x0904, 0x1a3f, 0xa3cc, 0xa2d0, 0x0804, 0x1a3f,
-	0xa5d4, 0xa4d8, 0x9d86, 0x0004, 0x0904, 0x1a3f, 0xa3dc, 0xa2e0,
-	0x0804, 0x1a3f, 0xa898, 0x901d, 0x1108, 0xab9c, 0x9016, 0x2c05,
-	0x908a, 0x0034, 0x1a0c, 0x0d7d, 0x9082, 0x001b, 0x0002, 0x1a02,
-	0x1a00, 0x1a00, 0x1a00, 0x1a00, 0x1a00, 0x1a0c, 0x1a00, 0x1a00,
-	0x1a00, 0x1a00, 0x1a00, 0x1a16, 0x1a00, 0x1a00, 0x1a00, 0x1a00,
-	0x1a00, 0x1a20, 0x1a00, 0x1a00, 0x1a00, 0x1a00, 0x1a00, 0x1a2a,
-	0x080c, 0x0d7d, 0xa56c, 0xa470, 0xa774, 0xa678, 0x9d86, 0x000c,
-	0x05b0, 0xa37c, 0xa280, 0x0498, 0xa584, 0xa488, 0xa78c, 0xa690,
-	0x9d86, 0x000c, 0x0560, 0xa394, 0xa298, 0x0448, 0xa59c, 0xa4a0,
-	0xa7a4, 0xa6a8, 0x9d86, 0x000c, 0x0510, 0xa3ac, 0xa2b0, 0x00f8,
-	0xa5b4, 0xa4b8, 0xa7bc, 0xa6c0, 0x9d86, 0x000c, 0x01c0, 0xa3c4,
-	0xa2c8, 0x00a8, 0xa5cc, 0xa4d0, 0xa7d4, 0xa6d8, 0x9d86, 0x000c,
-	0x0170, 0xa3dc, 0xa2e0, 0x0058, 0x9d86, 0x000e, 0x1130, 0x080c,
-	0x1e2b, 0x1904, 0x1913, 0x900e, 0x0050, 0x080c, 0x0d7d, 0xab2e,
-	0xaa32, 0xad1e, 0xac22, 0xaf26, 0xae2a, 0x080c, 0x1e2b, 0x0005,
-	0x6014, 0x2048, 0x6118, 0x810c, 0x810c, 0x810c, 0x81ff, 0x1118,
-	0xa887, 0x0001, 0x0008, 0xa986, 0x601b, 0x0002, 0xa974, 0xd1dc,
-	0x1108, 0x0005, 0xa934, 0xa88c, 0x9106, 0x1158, 0xa938, 0xa890,
-	0x9106, 0x1138, 0x601c, 0xc084, 0x601e, 0x2009, 0x0048, 0x0804,
-	0xac8c, 0x0005, 0x0126, 0x00c6, 0x2091, 0x2200, 0x00ce, 0x7908,
-	0x918c, 0x0007, 0x9186, 0x0000, 0x05b0, 0x9186, 0x0003, 0x0598,
-	0x6020, 0x6023, 0x0000, 0x0006, 0x2031, 0x0008, 0x00c6, 0x781f,
-	0x0808, 0x7808, 0xd09c, 0x0120, 0x080c, 0x13a3, 0x8631, 0x1db8,
-	0x00ce, 0x781f, 0x0800, 0x2031, 0x0168, 0x00c6, 0x7808, 0xd09c,
-	0x190c, 0x13a3, 0x00ce, 0x2001, 0x0038, 0x080c, 0x1b42, 0x7930,
-	0x9186, 0x0040, 0x0160, 0x9186, 0x0042, 0x190c, 0x0d7d, 0x2001,
-	0x001e, 0x8001, 0x1df0, 0x8631, 0x1d40, 0x080c, 0x1b51, 0x000e,
-	0x6022, 0x012e, 0x0005, 0x080c, 0x1b3e, 0x7827, 0x0015, 0x7828,
-	0x9c06, 0x1db8, 0x782b, 0x0000, 0x0ca0, 0x00f6, 0x2079, 0x0300,
-	0x7803, 0x0000, 0x78ab, 0x0004, 0x00fe, 0x080c, 0x74e9, 0x11b0,
-	0x2001, 0x0138, 0x2003, 0x0000, 0x2001, 0x0160, 0x2003, 0x0000,
-	0x2011, 0x012c, 0xa001, 0xa001, 0x8211, 0x1de0, 0x0081, 0x2001,
-	0x0386, 0x2003, 0x2020, 0x080c, 0x758a, 0x0005, 0x0479, 0x0039,
-	0x2001, 0x0160, 0x2502, 0x2001, 0x0138, 0x2202, 0x0005, 0x00e6,
-	0x2071, 0x0200, 0x080c, 0x29fc, 0x2009, 0x003c, 0x080c, 0x21b0,
-	0x2001, 0x015d, 0x2003, 0x0000, 0x7000, 0x9084, 0x003c, 0x1de0,
-	0x080c, 0x8553, 0x70a0, 0x70a2, 0x7098, 0x709a, 0x709c, 0x709e,
-	0x2001, 0x020d, 0x2003, 0x0020, 0x00f6, 0x2079, 0x0300, 0x080c,
-	0x133c, 0x7803, 0x0001, 0x00fe, 0x00ee, 0x0005, 0x2001, 0x0138,
-	0x2014, 0x2003, 0x0000, 0x2001, 0x0160, 0x202c, 0x2003, 0x0000,
-	0x080c, 0x74e9, 0x1108, 0x0005, 0x2021, 0x0260, 0x2001, 0x0141,
-	0x201c, 0xd3dc, 0x1168, 0x2001, 0x0109, 0x201c, 0x939c, 0x0048,
-	0x1160, 0x2001, 0x0111, 0x201c, 0x83ff, 0x1110, 0x8421, 0x1d70,
-	0x2001, 0x015d, 0x2003, 0x0000, 0x0005, 0x0046, 0x2021, 0x0019,
-	0x2003, 0x0048, 0xa001, 0xa001, 0x201c, 0x939c, 0x0048, 0x0120,
-	0x8421, 0x1db0, 0x004e, 0x0c60, 0x004e, 0x0c40, 0x601c, 0xc084,
-	0x601e, 0x0005, 0x2c08, 0x621c, 0x080c, 0x1679, 0x7930, 0x0005,
-	0x2c08, 0x621c, 0x080c, 0x16a6, 0x7930, 0x0005, 0x8001, 0x1df0,
-	0x0005, 0x2031, 0x0005, 0x781c, 0x9084, 0x0007, 0x0170, 0x2001,
-	0x0038, 0x0c41, 0x9186, 0x0040, 0x0904, 0x1baf, 0x2001, 0x001e,
-	0x0c69, 0x8631, 0x1d80, 0x080c, 0x0d7d, 0x781f, 0x0202, 0x2001,
-	0x015d, 0x2003, 0x0000, 0x2001, 0x0b10, 0x0c01, 0x781c, 0xd084,
-	0x0110, 0x0861, 0x04e0, 0x2001, 0x0030, 0x0891, 0x9186, 0x0040,
-	0x0568, 0x781c, 0xd084, 0x1da8, 0x781f, 0x0101, 0x2001, 0x0014,
-	0x0869, 0x2001, 0x0037, 0x0821, 0x9186, 0x0040, 0x0140, 0x2001,
-	0x0030, 0x080c, 0x1b48, 0x9186, 0x0040, 0x190c, 0x0d7d, 0x00d6,
-	0x2069, 0x0200, 0x692c, 0xd1f4, 0x1170, 0xd1c4, 0x0160, 0xd19c,
-	0x0130, 0x6800, 0x9085, 0x1800, 0x6802, 0x00de, 0x0080, 0x6908,
-	0x9184, 0x0007, 0x1db0, 0x00de, 0x781f, 0x0100, 0x791c, 0x9184,
-	0x0007, 0x090c, 0x0d7d, 0xa001, 0xa001, 0x781f, 0x0200, 0x0005,
-	0x0126, 0x2091, 0x2400, 0x2079, 0x0380, 0x2001, 0x19e7, 0x2070,
-	0x012e, 0x0005, 0x2cf0, 0x0126, 0x2091, 0x2400, 0x3e60, 0x6014,
-	0x2048, 0xa964, 0xa91a, 0x918c, 0x00ff, 0x9184, 0x000f, 0x0002,
-	0x1be4, 0x1be4, 0x1be4, 0x1be6, 0x1be4, 0x1be4, 0x1be4, 0x1be4,
-	0x1bd8, 0x1bee, 0x1be4, 0x1bea, 0x1be4, 0x1be4, 0x1be4, 0x1be4,
-	0x9086, 0x0008, 0x1148, 0xa87c, 0xd0b4, 0x0904, 0x1d5e, 0x2011,
-	0x1e50, 0x2205, 0xab88, 0x00a8, 0x080c, 0x0d7d, 0x9186, 0x0013,
-	0x0128, 0x0cd0, 0x9186, 0x001b, 0x0108, 0x0cb0, 0xa87c, 0xd0b4,
-	0x0904, 0x1d5e, 0x9184, 0x000f, 0x9080, 0x1e55, 0x2015, 0x2205,
-	0xab88, 0x2908, 0xa80a, 0xa90e, 0xaa12, 0xab16, 0x9006, 0xa842,
-	0xa83e, 0x012e, 0x0005, 0x2cf0, 0x0126, 0x2091, 0x2400, 0x3e60,
-	0x6014, 0x2048, 0xa88c, 0xa990, 0xaaac, 0xabb0, 0xaa36, 0xab3a,
-	0xa83e, 0xa942, 0xa846, 0xa94a, 0xa964, 0x918c, 0x00ff, 0x9186,
-	0x001e, 0x0198, 0x2940, 0xa064, 0xa81a, 0x90ec, 0x000f, 0x9d80,
-	0x1e55, 0x2065, 0x2c05, 0x2808, 0x2c10, 0xab88, 0xa80a, 0xa90e,
-	0xaa12, 0xab16, 0x012e, 0x3e60, 0x0005, 0xa804, 0x2040, 0x0c58,
-	0x2cf0, 0x0126, 0x2091, 0x2400, 0x3e60, 0x6014, 0x2048, 0xa97c,
-	0x2950, 0xd1dc, 0x1904, 0x1d28, 0xc1dd, 0xa97e, 0x9006, 0xa842,
-	0xa83e, 0xa988, 0x8109, 0xa916, 0xa964, 0xa91a, 0x9184, 0x000f,
-	0x9088, 0x1e55, 0x2145, 0x0002, 0x1c5c, 0x1c6a, 0x1c5c, 0x1c5c,
-	0x1c5c, 0x1c5e, 0x1c5c, 0x1c5c, 0x1cbf, 0x1cbf, 0x1c5c, 0x1c5c,
-	0x1c5c, 0x1cbd, 0x1c5c, 0x1c5c, 0x080c, 0x0d7d, 0xa804, 0x2050,
-	0xb164, 0xa91a, 0x9184, 0x000f, 0x9080, 0x1e55, 0x2045, 0xd19c,
-	0x1904, 0x1cbf, 0x9036, 0x2638, 0x2805, 0x908a, 0x0036, 0x1a0c,
-	0x0d7d, 0x9082, 0x001b, 0x0002, 0x1c8f, 0x1c8f, 0x1c91, 0x1c8f,
-	0x1c8f, 0x1c8f, 0x1c97, 0x1c8f, 0x1c8f, 0x1c8f, 0x1c9d, 0x1c8f,
-	0x1c8f, 0x1c8f, 0x1ca3, 0x1c8f, 0x1c8f, 0x1c8f, 0x1ca9, 0x1c8f,
-	0x1c8f, 0x1c8f, 0x1caf, 0x1c8f, 0x1c8f, 0x1c8f, 0x1cb5, 0x080c,
-	0x0d7d, 0xb574, 0xb478, 0xb37c, 0xb280, 0x0804, 0x1d04, 0xb584,
-	0xb488, 0xb38c, 0xb290, 0x0804, 0x1d04, 0xb594, 0xb498, 0xb39c,
-	0xb2a0, 0x0804, 0x1d04, 0xb5a4, 0xb4a8, 0xb3ac, 0xb2b0, 0x0804,
-	0x1d04, 0xb5b4, 0xb4b8, 0xb3bc, 0xb2c0, 0x0804, 0x1d04, 0xb5c4,
-	0xb4c8, 0xb3cc, 0xb2d0, 0x0804, 0x1d04, 0xb5d4, 0xb4d8, 0xb3dc,
-	0xb2e0, 0x0804, 0x1d04, 0x0804, 0x1d04, 0x080c, 0x0d7d, 0x2805,
-	0x908a, 0x0034, 0x1a0c, 0x0d7d, 0x9082, 0x001b, 0x0002, 0x1ce2,
-	0x1ce0, 0x1ce0, 0x1ce0, 0x1ce0, 0x1ce0, 0x1ce9, 0x1ce0, 0x1ce0,
-	0x1ce0, 0x1ce0, 0x1ce0, 0x1cf0, 0x1ce0, 0x1ce0, 0x1ce0, 0x1ce0,
-	0x1ce0, 0x1cf7, 0x1ce0, 0x1ce0, 0x1ce0, 0x1ce0, 0x1ce0, 0x1cfe,
-	0x080c, 0x0d7d, 0xb56c, 0xb470, 0xb774, 0xb678, 0xb37c, 0xb280,
-	0x00d8, 0xb584, 0xb488, 0xb78c, 0xb690, 0xb394, 0xb298, 0x00a0,
-	0xb59c, 0xb4a0, 0xb7a4, 0xb6a8, 0xb3ac, 0xb2b0, 0x0068, 0xb5b4,
-	0xb4b8, 0xb7bc, 0xb6c0, 0xb3c4, 0xb2c8, 0x0030, 0xb5cc, 0xb4d0,
-	0xb7d4, 0xb6d8, 0xb3dc, 0xb2e0, 0xab2e, 0xaa32, 0xad1e, 0xac22,
-	0xaf26, 0xae2a, 0xa988, 0x8109, 0xa916, 0x1118, 0x9006, 0x012e,
-	0x0005, 0x8840, 0x2805, 0x9005, 0x1168, 0xb004, 0x9005, 0x090c,
-	0x0d7d, 0x2050, 0xb164, 0xa91a, 0x9184, 0x000f, 0x9080, 0x1e55,
-	0x2045, 0x2805, 0x2810, 0x2a08, 0xa80a, 0xa90e, 0xaa12, 0x0c30,
-	0x3e60, 0x6344, 0xd3fc, 0x190c, 0x0d7d, 0xa93c, 0xaa40, 0xa844,
-	0x9106, 0x1118, 0xa848, 0x9206, 0x0508, 0x2958, 0xab48, 0xac44,
-	0x2940, 0x080c, 0x1e75, 0x1998, 0x2850, 0x2c40, 0xab14, 0xa880,
-	0xd0fc, 0x1140, 0xa810, 0x2005, 0xa80a, 0x2a00, 0xa80e, 0x2009,
-	0x8015, 0x0070, 0x00c6, 0x3e60, 0x6044, 0xc0a4, 0x9085, 0x8005,
-	0x6046, 0x00ce, 0x8319, 0xab16, 0x1904, 0x1d11, 0x2009, 0x8005,
-	0x3e60, 0x6044, 0x9105, 0x6046, 0x0804, 0x1d0e, 0x080c, 0x0d7d,
-	0x00f6, 0x00e6, 0x0096, 0x00c6, 0x0026, 0x704c, 0x9c06, 0x190c,
-	0x0d7d, 0x2079, 0x0090, 0x2001, 0x0105, 0x2003, 0x0010, 0x782b,
-	0x0004, 0x7057, 0x0000, 0x6014, 0x2048, 0x080c, 0xc838, 0x0118,
-	0xa880, 0xc0bd, 0xa882, 0x6020, 0x9086, 0x0006, 0x1170, 0x2061,
-	0x0100, 0x62c8, 0x2001, 0x00fa, 0x8001, 0x1df0, 0x60c8, 0x9206,
-	0x1dc0, 0x60c4, 0xa89a, 0x60c8, 0xa896, 0x704c, 0x2060, 0x00c6,
-	0x080c, 0xc443, 0x080c, 0xa896, 0x00ce, 0x704c, 0x9c06, 0x1150,
-	0x2009, 0x0040, 0x080c, 0x21b0, 0x080c, 0xa34e, 0x2011, 0x0000,
-	0x080c, 0xa1d9, 0x002e, 0x00ce, 0x009e, 0x00ee, 0x00fe, 0x0005,
-	0x00f6, 0x2079, 0x0090, 0x781c, 0x0006, 0x7818, 0x0006, 0x2079,
-	0x0100, 0x7a14, 0x9284, 0x1984, 0x9085, 0x0012, 0x7816, 0x2019,
-	0x1000, 0x8319, 0x090c, 0x0d7d, 0x7820, 0xd0bc, 0x1dd0, 0x79c8,
-	0x000e, 0x9102, 0x001e, 0x0006, 0x0016, 0x79c4, 0x000e, 0x9103,
-	0x78c6, 0x000e, 0x78ca, 0x9284, 0x1984, 0x9085, 0x0012, 0x7816,
-	0x2079, 0x0090, 0x782b, 0x0008, 0x7057, 0x0000, 0x00fe, 0x0005,
-	0x00f6, 0x00e6, 0x2071, 0x19e7, 0x7054, 0x9086, 0x0000, 0x0904,
-	0x1e26, 0x2079, 0x0090, 0x2009, 0x0207, 0x210c, 0xd194, 0x01b8,
-	0x2009, 0x020c, 0x210c, 0x9184, 0x0003, 0x0188, 0x080c, 0xe723,
-	0x2001, 0x0133, 0x2004, 0x9005, 0x090c, 0x0d7d, 0x0016, 0x2009,
-	0x0040, 0x080c, 0x21b0, 0x001e, 0x2001, 0x020c, 0x2102, 0x2009,
-	0x0206, 0x2104, 0x2009, 0x0203, 0x210c, 0x9106, 0x1120, 0x2009,
-	0x0040, 0x080c, 0x21b0, 0x782c, 0xd0fc, 0x09a8, 0x080c, 0xa8b2,
-	0x782c, 0xd0fc, 0x1de8, 0x080c, 0xa896, 0x7054, 0x9086, 0x0000,
-	0x1950, 0x782b, 0x0004, 0x782c, 0xd0ac, 0x1de8, 0x2009, 0x0040,
-	0x080c, 0x21b0, 0x782b, 0x0002, 0x7057, 0x0000, 0x00ee, 0x00fe,
-	0x0005, 0x080c, 0x0d7d, 0x8c60, 0x2c05, 0x9005, 0x0110, 0x8a51,
-	0x0005, 0xa004, 0x9005, 0x0168, 0xa85a, 0x2040, 0xa064, 0x9084,
-	0x000f, 0x9080, 0x1e55, 0x2065, 0x8cff, 0x090c, 0x0d7d, 0x8a51,
-	0x0005, 0x2050, 0x0005, 0x0000, 0x001d, 0x0021, 0x0025, 0x0029,
-	0x002d, 0x0031, 0x0035, 0x0000, 0x001b, 0x0021, 0x0027, 0x002d,
-	0x0033, 0x0000, 0x0000, 0x0023, 0x0000, 0x0000, 0x1e48, 0x1e44,
-	0x1e48, 0x1e48, 0x1e52, 0x0000, 0x1e48, 0x1e4f, 0x1e4f, 0x1e4c,
-	0x1e4f, 0x1e4f, 0x0000, 0x1e52, 0x1e4f, 0x0000, 0x1e4a, 0x1e4a,
-	0x0000, 0x1e4a, 0x1e52, 0x0000, 0x1e4a, 0x1e50, 0x1e50, 0x1e50,
-	0x0000, 0x1e50, 0x0000, 0x1e52, 0x1e50, 0x00c6, 0x00d6, 0x0086,
-	0xab42, 0xac3e, 0xa888, 0x9055, 0x0904, 0x2054, 0x2940, 0xa064,
-	0x90ec, 0x000f, 0x9084, 0x00ff, 0x9086, 0x0008, 0x1118, 0x2061,
-	0x1e50, 0x00d0, 0x9de0, 0x1e55, 0x9d86, 0x0007, 0x0130, 0x9d86,
-	0x000e, 0x0118, 0x9d86, 0x000f, 0x1120, 0xa08c, 0x9422, 0xa090,
-	0x931b, 0x2c05, 0x9065, 0x1140, 0x0310, 0x0804, 0x2054, 0xa004,
-	0x9045, 0x0904, 0x2054, 0x08d8, 0x2c05, 0x9005, 0x0904, 0x1f3c,
-	0xdd9c, 0x1904, 0x1ef8, 0x908a, 0x0036, 0x1a0c, 0x0d7d, 0x9082,
-	0x001b, 0x0002, 0x1ecd, 0x1ecd, 0x1ecf, 0x1ecd, 0x1ecd, 0x1ecd,
-	0x1ed5, 0x1ecd, 0x1ecd, 0x1ecd, 0x1edb, 0x1ecd, 0x1ecd, 0x1ecd,
-	0x1ee1, 0x1ecd, 0x1ecd, 0x1ecd, 0x1ee7, 0x1ecd, 0x1ecd, 0x1ecd,
-	0x1eed, 0x1ecd, 0x1ecd, 0x1ecd, 0x1ef3, 0x080c, 0x0d7d, 0xa07c,
-	0x9422, 0xa080, 0x931b, 0x0804, 0x1f32, 0xa08c, 0x9422, 0xa090,
-	0x931b, 0x0804, 0x1f32, 0xa09c, 0x9422, 0xa0a0, 0x931b, 0x0804,
-	0x1f32, 0xa0ac, 0x9422, 0xa0b0, 0x931b, 0x0804, 0x1f32, 0xa0bc,
-	0x9422, 0xa0c0, 0x931b, 0x0804, 0x1f32, 0xa0cc, 0x9422, 0xa0d0,
-	0x931b, 0x0804, 0x1f32, 0xa0dc, 0x9422, 0xa0e0, 0x931b, 0x04d0,
-	0x908a, 0x0034, 0x1a0c, 0x0d7d, 0x9082, 0x001b, 0x0002, 0x1f1a,
-	0x1f18, 0x1f18, 0x1f18, 0x1f18, 0x1f18, 0x1f1f, 0x1f18, 0x1f18,
-	0x1f18, 0x1f18, 0x1f18, 0x1f24, 0x1f18, 0x1f18, 0x1f18, 0x1f18,
-	0x1f18, 0x1f29, 0x1f18, 0x1f18, 0x1f18, 0x1f18, 0x1f18, 0x1f2e,
-	0x080c, 0x0d7d, 0xa07c, 0x9422, 0xa080, 0x931b, 0x0098, 0xa094,
-	0x9422, 0xa098, 0x931b, 0x0070, 0xa0ac, 0x9422, 0xa0b0, 0x931b,
-	0x0048, 0xa0c4, 0x9422, 0xa0c8, 0x931b, 0x0020, 0xa0dc, 0x9422,
-	0xa0e0, 0x931b, 0x0630, 0x2300, 0x9405, 0x0160, 0x8a51, 0x0904,
-	0x2054, 0x8c60, 0x0804, 0x1ea4, 0xa004, 0x9045, 0x0904, 0x2054,
-	0x0804, 0x1e7f, 0x8a51, 0x0904, 0x2054, 0x8c60, 0x2c05, 0x9005,
-	0x1158, 0xa004, 0x9045, 0x0904, 0x2054, 0xa064, 0x90ec, 0x000f,
-	0x9de0, 0x1e55, 0x2c05, 0x2060, 0xa880, 0xc0fc, 0xa882, 0x0804,
-	0x2049, 0x2c05, 0x8422, 0x8420, 0x831a, 0x9399, 0x0000, 0xac2e,
-	0xab32, 0xdd9c, 0x1904, 0x1fe6, 0x9082, 0x001b, 0x0002, 0x1f82,
-	0x1f82, 0x1f84, 0x1f82, 0x1f82, 0x1f82, 0x1f92, 0x1f82, 0x1f82,
-	0x1f82, 0x1fa0, 0x1f82, 0x1f82, 0x1f82, 0x1fae, 0x1f82, 0x1f82,
-	0x1f82, 0x1fbc, 0x1f82, 0x1f82, 0x1f82, 0x1fca, 0x1f82, 0x1f82,
-	0x1f82, 0x1fd8, 0x080c, 0x0d7d, 0xa17c, 0x2400, 0x9122, 0xa180,
-	0x2300, 0x911b, 0x0a0c, 0x0d7d, 0xa074, 0x9420, 0xa078, 0x9319,
-	0x0804, 0x2044, 0xa18c, 0x2400, 0x9122, 0xa190, 0x2300, 0x911b,
-	0x0a0c, 0x0d7d, 0xa084, 0x9420, 0xa088, 0x9319, 0x0804, 0x2044,
-	0xa19c, 0x2400, 0x9122, 0xa1a0, 0x2300, 0x911b, 0x0a0c, 0x0d7d,
-	0xa094, 0x9420, 0xa098, 0x9319, 0x0804, 0x2044, 0xa1ac, 0x2400,
-	0x9122, 0xa1b0, 0x2300, 0x911b, 0x0a0c, 0x0d7d, 0xa0a4, 0x9420,
-	0xa0a8, 0x9319, 0x0804, 0x2044, 0xa1bc, 0x2400, 0x9122, 0xa1c0,
-	0x2300, 0x911b, 0x0a0c, 0x0d7d, 0xa0b4, 0x9420, 0xa0b8, 0x9319,
-	0x0804, 0x2044, 0xa1cc, 0x2400, 0x9122, 0xa1d0, 0x2300, 0x911b,
-	0x0a0c, 0x0d7d, 0xa0c4, 0x9420, 0xa0c8, 0x9319, 0x0804, 0x2044,
-	0xa1dc, 0x2400, 0x9122, 0xa1e0, 0x2300, 0x911b, 0x0a0c, 0x0d7d,
-	0xa0d4, 0x9420, 0xa0d8, 0x9319, 0x0804, 0x2044, 0x9082, 0x001b,
-	0x0002, 0x2004, 0x2002, 0x2002, 0x2002, 0x2002, 0x2002, 0x2011,
-	0x2002, 0x2002, 0x2002, 0x2002, 0x2002, 0x201e, 0x2002, 0x2002,
-	0x2002, 0x2002, 0x2002, 0x202b, 0x2002, 0x2002, 0x2002, 0x2002,
-	0x2002, 0x2038, 0x080c, 0x0d7d, 0xa17c, 0x2400, 0x9122, 0xa180,
-	0x2300, 0x911b, 0x0a0c, 0x0d7d, 0xa06c, 0x9420, 0xa070, 0x9319,
-	0x0498, 0xa194, 0x2400, 0x9122, 0xa198, 0x2300, 0x911b, 0x0a0c,
-	0x0d7d, 0xa084, 0x9420, 0xa088, 0x9319, 0x0430, 0xa1ac, 0x2400,
-	0x9122, 0xa1b0, 0x2300, 0x911b, 0x0a0c, 0x0d7d, 0xa09c, 0x9420,
-	0xa0a0, 0x9319, 0x00c8, 0xa1c4, 0x2400, 0x9122, 0xa1c8, 0x2300,
-	0x911b, 0x0a0c, 0x0d7d, 0xa0b4, 0x9420, 0xa0b8, 0x9319, 0x0060,
-	0xa1dc, 0x2400, 0x9122, 0xa1e0, 0x2300, 0x911b, 0x0a0c, 0x0d7d,
-	0xa0cc, 0x9420, 0xa0d0, 0x9319, 0xac1e, 0xab22, 0xa880, 0xc0fd,
-	0xa882, 0x2800, 0xa85a, 0x2c00, 0xa812, 0x2a00, 0xa816, 0x000e,
-	0x000e, 0x000e, 0x9006, 0x0028, 0x008e, 0x00de, 0x00ce, 0x9085,
-	0x0001, 0x0005, 0x00c6, 0x610c, 0x0016, 0x9026, 0x2410, 0x6004,
-	0x9420, 0x9291, 0x0000, 0x2c04, 0x9210, 0x9ce0, 0x0002, 0x918a,
-	0x0002, 0x1da8, 0x9284, 0x000f, 0x9405, 0x001e, 0x00ce, 0x0005,
-	0x7803, 0x0003, 0x780f, 0x0000, 0x6004, 0x7812, 0x2c04, 0x7816,
-	0x9ce0, 0x0002, 0x918a, 0x0002, 0x1db8, 0x0005, 0x2001, 0x0005,
-	0x2004, 0xd0bc, 0x190c, 0x0d76, 0xd094, 0x0110, 0x080c, 0x11de,
-	0x0005, 0x0126, 0x2091, 0x2600, 0x2079, 0x0200, 0x2071, 0x0260,
-	0x2069, 0x1800, 0x7817, 0x0000, 0x789b, 0x0814, 0x78a3, 0x0406,
-	0x789f, 0x0410, 0x2009, 0x013b, 0x200b, 0x0400, 0x781b, 0x0002,
-	0x783b, 0x001f, 0x7837, 0x0020, 0x7803, 0x1600, 0x012e, 0x0005,
-	0x2091, 0x2600, 0x781c, 0xd0a4, 0x190c, 0x21ad, 0x7900, 0xd1dc,
-	0x1118, 0x9084, 0x0006, 0x001a, 0x9084, 0x000e, 0x0002, 0x20cf,
-	0x20c7, 0x7ef1, 0x20c7, 0x20c9, 0x20c9, 0x20c9, 0x20c9, 0x7ed7,
-	0x20c7, 0x20cb, 0x20c7, 0x20c9, 0x20c7, 0x20c9, 0x20c7, 0x080c,
-	0x0d7d, 0x0031, 0x0020, 0x080c, 0x7ed7, 0x080c, 0x7ef1, 0x0005,
-	0x0006, 0x0016, 0x0026, 0x080c, 0xe723, 0x7930, 0x9184, 0x0003,
-	0x01f0, 0x080c, 0xa896, 0x2001, 0x19fa, 0x2004, 0x9005, 0x0180,
-	0x2001, 0x0133, 0x2004, 0x9005, 0x090c, 0x0d7d, 0x00c6, 0x2001,
-	0x19fa, 0x2064, 0x080c, 0xa8b2, 0x080c, 0xc443, 0x00ce, 0x0408,
-	0x2009, 0x0040, 0x080c, 0x21b0, 0x080c, 0xa8b2, 0x00d0, 0x9184,
-	0x0014, 0x01a0, 0x6a00, 0x9286, 0x0003, 0x0160, 0x080c, 0x74e9,
-	0x1138, 0x080c, 0x77ed, 0x080c, 0x6029, 0x080c, 0x741a, 0x0010,
-	0x080c, 0x5ee4, 0x080c, 0x7f8f, 0x0041, 0x0018, 0x9184, 0x9540,
-	0x1dc8, 0x002e, 0x001e, 0x000e, 0x0005, 0x00e6, 0x0036, 0x0046,
-	0x0056, 0x2071, 0x1a6b, 0x080c, 0x1ab5, 0x005e, 0x004e, 0x003e,
-	0x00ee, 0x0005, 0x0126, 0x2091, 0x2e00, 0x2071, 0x1800, 0x7128,
-	0x2001, 0x196f, 0x2102, 0x2001, 0x1977, 0x2102, 0x2001, 0x013b,
-	0x2102, 0x2079, 0x0200, 0x2001, 0x0201, 0x789e, 0x78a3, 0x0200,
-	0x9198, 0x0007, 0x831c, 0x831c, 0x831c, 0x9398, 0x0005, 0x2320,
-	0x9182, 0x0204, 0x1230, 0x2011, 0x0008, 0x8423, 0x8423, 0x8423,
-	0x0488, 0x9182, 0x024c, 0x1240, 0x2011, 0x0007, 0x8403, 0x8003,
-	0x9400, 0x9400, 0x9420, 0x0430, 0x9182, 0x02bc, 0x1238, 0x2011,
-	0x0006, 0x8403, 0x8003, 0x9400, 0x9420, 0x00e0, 0x9182, 0x034c,
-	0x1230, 0x2011, 0x0005, 0x8403, 0x8003, 0x9420, 0x0098, 0x9182,
-	0x042c, 0x1228, 0x2011, 0x0004, 0x8423, 0x8423, 0x0058, 0x9182,
-	0x059c, 0x1228, 0x2011, 0x0003, 0x8403, 0x9420, 0x0018, 0x2011,
-	0x0002, 0x8423, 0x9482, 0x0228, 0x8002, 0x8020, 0x8301, 0x9402,
-	0x0110, 0x0208, 0x8321, 0x8217, 0x8203, 0x9405, 0x789a, 0x012e,
-	0x0005, 0x0006, 0x00d6, 0x2069, 0x0200, 0x6814, 0x9084, 0xffc0,
-	0x910d, 0x6916, 0x00de, 0x000e, 0x0005, 0x00d6, 0x2069, 0x0200,
-	0x9005, 0x6810, 0x0110, 0xc0a5, 0x0008, 0xc0a4, 0x6812, 0x00de,
-	0x0005, 0x0006, 0x00d6, 0x2069, 0x0200, 0x6810, 0x9084, 0xfff8,
-	0x910d, 0x6912, 0x00de, 0x000e, 0x0005, 0x7938, 0x080c, 0x0d76,
-	0x00f6, 0x2079, 0x0200, 0x7902, 0xa001, 0xa001, 0xa001, 0xa001,
-	0xa001, 0xa001, 0x7902, 0xa001, 0xa001, 0xa001, 0xa001, 0xa001,
-	0xa001, 0x00fe, 0x0005, 0x0126, 0x2091, 0x2800, 0x2061, 0x0100,
-	0x2071, 0x1800, 0x2009, 0x0000, 0x080c, 0x29f6, 0x080c, 0x2916,
-	0x080c, 0x2a67, 0x9006, 0x080c, 0x2945, 0x9006, 0x080c, 0x2928,
-	0x20a9, 0x0012, 0x1d04, 0x21da, 0x2091, 0x6000, 0x1f04, 0x21da,
-	0x602f, 0x0100, 0x602f, 0x0000, 0x6050, 0x9085, 0x0400, 0x9084,
-	0xdfff, 0x6052, 0x6224, 0x080c, 0x2a44, 0x080c, 0x2634, 0x2009,
-	0x00ef, 0x6132, 0x6136, 0x080c, 0x2644, 0x60e7, 0x0000, 0x61ea,
-	0x60e3, 0x0008, 0x604b, 0xf7f7, 0x6043, 0x0000, 0x602f, 0x0080,
-	0x602f, 0x0000, 0x6007, 0x349f, 0x00c6, 0x2061, 0x0140, 0x608b,
-	0x000b, 0x608f, 0x10b8, 0x6093, 0x0000, 0x6097, 0x0198, 0x00ce,
-	0x6004, 0x9085, 0x8000, 0x6006, 0x60bb, 0x0000, 0x20a9, 0x0018,
-	0x60bf, 0x0000, 0x1f04, 0x2218, 0x60bb, 0x0000, 0x60bf, 0x0108,
-	0x60bf, 0x0012, 0x60bf, 0x0405, 0x60bf, 0x0014, 0x60bf, 0x0320,
-	0x60bf, 0x0018, 0x601b, 0x00f0, 0x601f, 0x001e, 0x600f, 0x006b,
-	0x602b, 0x402c, 0x012e, 0x0005, 0x00f6, 0x2079, 0x0140, 0x78c3,
-	0x0080, 0x78c3, 0x0083, 0x78c3, 0x0000, 0x00fe, 0x0005, 0x2001,
-	0x1835, 0x2003, 0x0000, 0x2001, 0x1834, 0x2003, 0x0001, 0x0005,
-	0x0126, 0x2091, 0x2800, 0x0006, 0x0016, 0x0026, 0x6124, 0x6028,
-	0x910c, 0x0066, 0x2031, 0x1837, 0x2634, 0x96b4, 0x0028, 0x006e,
-	0x1138, 0x6020, 0xd1bc, 0x0120, 0xd0bc, 0x1168, 0xd0b4, 0x1198,
-	0x9184, 0x5e2c, 0x1118, 0x9184, 0x0007, 0x00aa, 0x9195, 0x0004,
-	0x9284, 0x0007, 0x0082, 0x0016, 0x2001, 0x0387, 0x200c, 0xd1a4,
-	0x001e, 0x0d70, 0x0c98, 0x0016, 0x2001, 0x0387, 0x200c, 0xd1b4,
-	0x001e, 0x0d30, 0x0c58, 0x2286, 0x2283, 0x2283, 0x2283, 0x2285,
-	0x2283, 0x2283, 0x2283, 0x080c, 0x0d7d, 0x0029, 0x002e, 0x001e,
-	0x000e, 0x012e, 0x0005, 0x00a6, 0x6124, 0x6028, 0xd09c, 0x0118,
-	0xd19c, 0x1904, 0x2500, 0xd1f4, 0x190c, 0x0d76, 0x080c, 0x74e9,
-	0x0904, 0x22e3, 0x080c, 0xcf52, 0x1120, 0x7000, 0x9086, 0x0003,
-	0x0580, 0x6024, 0x9084, 0x1800, 0x0560, 0x080c, 0x750c, 0x0118,
-	0x080c, 0x74fa, 0x1530, 0x2011, 0x0020, 0x080c, 0x2a44, 0x6043,
-	0x0000, 0x080c, 0xcf52, 0x0168, 0x080c, 0x750c, 0x1150, 0x2001,
-	0x19a7, 0x2003, 0x0001, 0x6027, 0x1800, 0x080c, 0x735f, 0x0804,
-	0x2503, 0x70a4, 0x9005, 0x1150, 0x70a7, 0x0001, 0x00d6, 0x2069,
-	0x0140, 0x080c, 0x7540, 0x00de, 0x1904, 0x2503, 0x080c, 0x77f7,
-	0x0428, 0x080c, 0x750c, 0x1590, 0x6024, 0x9084, 0x1800, 0x1108,
-	0x0468, 0x080c, 0x77f7, 0x080c, 0x77ed, 0x080c, 0x6029, 0x080c,
-	0x741a, 0x0804, 0x2500, 0xd1ac, 0x1508, 0x6024, 0xd0dc, 0x1170,
-	0xd0e4, 0x1178, 0xd0d4, 0x1190, 0xd0cc, 0x0130, 0x7098, 0x9086,
-	0x0028, 0x1110, 0x080c, 0x76ce, 0x0804, 0x2500, 0x080c, 0x77f2,
-	0x0048, 0x2001, 0x197d, 0x2003, 0x0002, 0x0020, 0x080c, 0x762b,
-	0x0804, 0x2500, 0x080c, 0x7771, 0x0804, 0x2500, 0x6220, 0xd1bc,
-	0x0138, 0xd2bc, 0x1904, 0x2565, 0xd2b4, 0x1904, 0x2577, 0x0000,
-	0xd1ac, 0x0904, 0x240d, 0x0036, 0x6328, 0xc3bc, 0x632a, 0x003e,
-	0x080c, 0x74e9, 0x11d0, 0x2011, 0x0020, 0x080c, 0x2a44, 0x0006,
-	0x0026, 0x0036, 0x080c, 0x7503, 0x1158, 0x080c, 0x77ed, 0x080c,
-	0x6029, 0x080c, 0x741a, 0x003e, 0x002e, 0x000e, 0x00ae, 0x0005,
-	0x003e, 0x002e, 0x000e, 0x080c, 0x74bd, 0x0016, 0x0046, 0x00c6,
-	0x644c, 0x9486, 0xf0f0, 0x1138, 0x2061, 0x0100, 0x644a, 0x6043,
-	0x0090, 0x6043, 0x0010, 0x74da, 0x948c, 0xff00, 0x7038, 0xd084,
-	0x0178, 0x9186, 0xf800, 0x1160, 0x7048, 0xd084, 0x1148, 0xc085,
-	0x704a, 0x0036, 0x2418, 0x2011, 0x8016, 0x080c, 0x4b07, 0x003e,
-	0x080c, 0xcf4b, 0x1904, 0x23e4, 0x9196, 0xff00, 0x05a8, 0x7060,
-	0x9084, 0x00ff, 0x810f, 0x81ff, 0x0110, 0x9116, 0x0568, 0x7130,
-	0xd184, 0x1550, 0x080c, 0x3368, 0x0128, 0xc18d, 0x7132, 0x080c,
-	0x6a63, 0x1510, 0x6240, 0x9294, 0x0010, 0x0130, 0x6248, 0x9294,
-	0xff00, 0x9296, 0xff00, 0x01c0, 0x7030, 0xd08c, 0x0904, 0x23e4,
-	0x7038, 0xd08c, 0x1140, 0x2001, 0x180c, 0x200c, 0xd1ac, 0x1904,
-	0x23e4, 0xc1ad, 0x2102, 0x0036, 0x73d8, 0x2011, 0x8013, 0x080c,
-	0x4b07, 0x003e, 0x0804, 0x23e4, 0x7038, 0xd08c, 0x1140, 0x2001,
-	0x180c, 0x200c, 0xd1ac, 0x1904, 0x23e4, 0xc1ad, 0x2102, 0x0036,
-	0x73d8, 0x2011, 0x8013, 0x080c, 0x4b07, 0x003e, 0x7130, 0xc185,
-	0x7132, 0x2011, 0x1848, 0x220c, 0xd1a4, 0x01f0, 0x0016, 0x2009,
-	0x0001, 0x2011, 0x0100, 0x080c, 0x88ec, 0x2019, 0x000e, 0x00c6,
-	0x2061, 0x0000, 0x080c, 0xe239, 0x00ce, 0x9484, 0x00ff, 0x9080,
-	0x3374, 0x200d, 0x918c, 0xff00, 0x810f, 0x2120, 0x9006, 0x2009,
-	0x000e, 0x080c, 0xe2c9, 0x001e, 0x0016, 0x2009, 0x0002, 0x2019,
-	0x0004, 0x080c, 0x31a6, 0x001e, 0x0078, 0x0156, 0x00b6, 0x20a9,
-	0x007f, 0x900e, 0x080c, 0x6625, 0x1110, 0x080c, 0x6043, 0x8108,
-	0x1f04, 0x23da, 0x00be, 0x015e, 0x00ce, 0x004e, 0x080c, 0xa896,
-	0x080c, 0xab5e, 0x080c, 0xa8b2, 0x60e3, 0x0000, 0x001e, 0x2001,
-	0x1800, 0x2014, 0x9296, 0x0004, 0x1170, 0xd19c, 0x11b0, 0x2011,
-	0x180c, 0x2214, 0xd29c, 0x1120, 0x6204, 0x9295, 0x0002, 0x6206,
-	0x6228, 0xc29d, 0x622a, 0x2003, 0x0001, 0x2001, 0x1826, 0x2003,
-	0x0000, 0x2011, 0x0020, 0x080c, 0x2a44, 0xd194, 0x0904, 0x2500,
-	0x0016, 0x080c, 0xa896, 0x6220, 0xd2b4, 0x0904, 0x249b, 0x080c,
-	0x86f6, 0x080c, 0x9e32, 0x2011, 0x0004, 0x080c, 0x2a44, 0x00f6,
-	0x2019, 0x19f3, 0x2304, 0x907d, 0x0904, 0x2468, 0x7804, 0x9086,
-	0x0032, 0x15f0, 0x00d6, 0x00c6, 0x00e6, 0x0096, 0x2069, 0x0140,
-	0x782c, 0x685e, 0x7808, 0x685a, 0x6043, 0x0002, 0x2001, 0x0003,
-	0x8001, 0x1df0, 0x6043, 0x0000, 0x2001, 0x003c, 0x8001, 0x1df0,
-	0x080c, 0x2a1a, 0x2001, 0x001e, 0x8001, 0x0240, 0x20a9, 0x0009,
-	0x080c, 0x29d1, 0x6904, 0xd1dc, 0x1140, 0x0cb0, 0x2001, 0x0100,
-	0x080c, 0x2a0a, 0x9006, 0x080c, 0x2a0a, 0x080c, 0x95de, 0x080c,
-	0xa8b2, 0x7814, 0x2048, 0xa867, 0x0103, 0x2f60, 0x080c, 0xabed,
-	0x009e, 0x00ee, 0x00ce, 0x00de, 0x00fe, 0x001e, 0x00ae, 0x0005,
-	0x00fe, 0x00d6, 0x2069, 0x0140, 0x6804, 0x9084, 0x4000, 0x0110,
-	0x080c, 0x2a1a, 0x00de, 0x00c6, 0x2061, 0x19e7, 0x6034, 0x080c,
-	0xcf52, 0x0120, 0x909a, 0x0003, 0x1258, 0x0018, 0x909a, 0x00c8,
-	0x1238, 0x8000, 0x6036, 0x00ce, 0x080c, 0x9e0a, 0x0804, 0x24fd,
-	0x2061, 0x0100, 0x62c0, 0x080c, 0xa7cc, 0x2019, 0x19f3, 0x2304,
-	0x9065, 0x0130, 0x6003, 0x0001, 0x2009, 0x0027, 0x080c, 0xac8c,
-	0x00ce, 0x0804, 0x24fd, 0xd2bc, 0x0904, 0x24e0, 0x080c, 0x8703,
-	0x2011, 0x0004, 0x080c, 0x2a44, 0x00d6, 0x2069, 0x0140, 0x6804,
-	0x9084, 0x4000, 0x0110, 0x080c, 0x2a1a, 0x00de, 0x00c6, 0x2061,
-	0x19e7, 0x6050, 0x080c, 0xcf52, 0x0120, 0x909a, 0x0003, 0x1668,
-	0x0018, 0x909a, 0x00c8, 0x1648, 0x8000, 0x6052, 0x604c, 0x00ce,
-	0x9005, 0x05d8, 0x2009, 0x07d0, 0x080c, 0x86fb, 0x9080, 0x0008,
-	0x2004, 0x9086, 0x0006, 0x1138, 0x2009, 0x1984, 0x2011, 0x0012,
-	0x080c, 0x2a53, 0x0450, 0x9080, 0x0008, 0x2004, 0x9086, 0x0009,
-	0x0d98, 0x2009, 0x1984, 0x2011, 0x0016, 0x080c, 0x2a53, 0x00e8,
-	0x2011, 0x0004, 0x080c, 0x2a44, 0x00c0, 0x0036, 0x2019, 0x0001,
-	0x080c, 0xa118, 0x003e, 0x2019, 0x19fa, 0x2304, 0x9065, 0x0160,
-	0x2009, 0x004f, 0x6020, 0x9086, 0x0009, 0x1110, 0x2009, 0x004f,
-	0x6003, 0x0003, 0x080c, 0xac8c, 0x00ce, 0x080c, 0xa8b2, 0x001e,
-	0xd19c, 0x0904, 0x255e, 0x7038, 0xd0ac, 0x1538, 0x0016, 0x0156,
-	0x2011, 0x0008, 0x080c, 0x2a44, 0x6050, 0xc0e5, 0x6052, 0x20a9,
-	0x0367, 0x1f04, 0x252b, 0x1d04, 0x2513, 0x080c, 0x872a, 0x6020,
-	0xd09c, 0x1db8, 0x00f6, 0x2079, 0x0100, 0x080c, 0x2981, 0x00fe,
-	0x1d80, 0x6050, 0xc0e4, 0x6052, 0x2011, 0x0008, 0x080c, 0x2a44,
-	0x015e, 0x001e, 0x0498, 0x015e, 0x001e, 0x0016, 0x6028, 0xc09c,
-	0x602a, 0x080c, 0xa896, 0x080c, 0xab5e, 0x080c, 0xa8b2, 0x60e3,
-	0x0000, 0x080c, 0xe702, 0x080c, 0xe71d, 0x080c, 0x56de, 0xd0fc,
-	0x1138, 0x080c, 0xcf4b, 0x1120, 0x9085, 0x0001, 0x080c, 0x7530,
-	0x9006, 0x080c, 0x2a0a, 0x2009, 0x0002, 0x080c, 0x29f6, 0x00e6,
-	0x2071, 0x1800, 0x7003, 0x0004, 0x080c, 0x0eb4, 0x00ee, 0x2011,
-	0x0008, 0x080c, 0x2a44, 0x080c, 0x0bc3, 0x001e, 0x918c, 0xffd0,
-	0x2110, 0x080c, 0x2a44, 0x00ae, 0x0005, 0x0016, 0x2001, 0x0387,
-	0x200c, 0xd1a4, 0x001e, 0x0904, 0x2310, 0x0016, 0x2009, 0x2571,
-	0x00c0, 0x2001, 0x0387, 0x2003, 0x1000, 0x001e, 0x0c38, 0x0016,
-	0x2001, 0x0387, 0x200c, 0xd1b4, 0x001e, 0x0904, 0x2310, 0x0016,
-	0x2009, 0x2583, 0x0030, 0x2001, 0x0387, 0x2003, 0x4000, 0x001e,
-	0x08a8, 0x6028, 0xc0bc, 0x602a, 0x2001, 0x0156, 0x2003, 0xbc91,
-	0x8000, 0x2003, 0xffff, 0x6043, 0x0001, 0x080c, 0x29f0, 0x2011,
-	0x0080, 0x080c, 0x2a44, 0x6017, 0x0000, 0x6043, 0x0000, 0x0817,
-	0x0006, 0x0016, 0x0026, 0x0036, 0x00e6, 0x00f6, 0x0126, 0x2091,
-	0x8000, 0x2071, 0x1800, 0x71d0, 0x70d2, 0x9116, 0x0904, 0x25f3,
-	0x81ff, 0x01a0, 0x2009, 0x0000, 0x080c, 0x29f6, 0x2011, 0x8011,
-	0x2019, 0x010e, 0x231c, 0x939e, 0x0007, 0x1118, 0x2019, 0x0001,
-	0x0010, 0x2019, 0x0000, 0x080c, 0x4b07, 0x0468, 0x2001, 0x19a8,
-	0x200c, 0x81ff, 0x1140, 0x2001, 0x0109, 0x2004, 0xd0b4, 0x0118,
-	0x2019, 0x0003, 0x0008, 0x2118, 0x2011, 0x8012, 0x080c, 0x4b07,
-	0x080c, 0x0eb4, 0x080c, 0x56de, 0xd0fc, 0x11a8, 0x080c, 0xcf4b,
-	0x1190, 0x00c6, 0x080c, 0x268f, 0x080c, 0xa896, 0x080c, 0xa073,
-	0x080c, 0xa8b2, 0x2061, 0x0100, 0x2019, 0x0028, 0x2009, 0x0002,
-	0x080c, 0x31a6, 0x00ce, 0x012e, 0x00fe, 0x00ee, 0x003e, 0x002e,
-	0x001e, 0x000e, 0x0005, 0x2028, 0x918c, 0x00ff, 0x2130, 0x9094,
-	0xff00, 0x11f0, 0x2011, 0x1837, 0x2214, 0xd2ac, 0x11c8, 0x81ff,
-	0x01e8, 0x2011, 0x181f, 0x2204, 0x9106, 0x1190, 0x2011, 0x1820,
-	0x2214, 0x9294, 0xff00, 0x9584, 0xff00, 0x9206, 0x1148, 0x2011,
-	0x1820, 0x2214, 0x9294, 0x00ff, 0x9584, 0x00ff, 0x9206, 0x1120,
-	0x2500, 0x080c, 0x81ff, 0x0048, 0x9584, 0x00ff, 0x9080, 0x3374,
-	0x200d, 0x918c, 0xff00, 0x810f, 0x9006, 0x0005, 0x9080, 0x3374,
-	0x200d, 0x918c, 0x00ff, 0x0005, 0x00d6, 0x2069, 0x0140, 0x2001,
-	0x1818, 0x2003, 0x00ef, 0x20a9, 0x0010, 0x9006, 0x6852, 0x6856,
-	0x1f04, 0x263f, 0x00de, 0x0005, 0x0006, 0x00d6, 0x0026, 0x2069,
-	0x0140, 0x2001, 0x1818, 0x2102, 0x8114, 0x8214, 0x8214, 0x8214,
-	0x20a9, 0x0010, 0x6853, 0x0000, 0x9006, 0x82ff, 0x1128, 0x9184,
-	0x000f, 0x9080, 0xe731, 0x2005, 0x6856, 0x8211, 0x1f04, 0x2654,
-	0x002e, 0x00de, 0x000e, 0x0005, 0x00c6, 0x2061, 0x1800, 0x6030,
-	0x0110, 0xc09d, 0x0008, 0xc09c, 0x6032, 0x00ce, 0x0005, 0x0156,
-	0x00d6, 0x0026, 0x0016, 0x0006, 0x2069, 0x0140, 0x6980, 0x9116,
-	0x0180, 0x9112, 0x1230, 0x8212, 0x8210, 0x22a8, 0x2001, 0x0402,
-	0x0018, 0x22a8, 0x2001, 0x0404, 0x680e, 0x1f04, 0x2684, 0x680f,
-	0x0000, 0x000e, 0x001e, 0x002e, 0x00de, 0x015e, 0x0005, 0x080c,
-	0x56da, 0xd0c4, 0x0150, 0xd0a4, 0x0140, 0x9006, 0x0046, 0x2020,
-	0x2009, 0x002e, 0x080c, 0xe2c9, 0x004e, 0x0005, 0x00f6, 0x0016,
-	0x0026, 0x2079, 0x0140, 0x78c4, 0xd0dc, 0x0904, 0x26fb, 0x080c,
-	0x2971, 0x0660, 0x9084, 0x0700, 0x908e, 0x0600, 0x1120, 0x2011,
-	0x4000, 0x900e, 0x0458, 0x908e, 0x0500, 0x1120, 0x2011, 0x8000,
-	0x900e, 0x0420, 0x908e, 0x0400, 0x1120, 0x9016, 0x2009, 0x0001,
-	0x00e8, 0x908e, 0x0300, 0x1120, 0x9016, 0x2009, 0x0002, 0x00b0,
-	0x908e, 0x0200, 0x1120, 0x9016, 0x2009, 0x0004, 0x0078, 0x908e,
-	0x0100, 0x1548, 0x9016, 0x2009, 0x0008, 0x0040, 0x9084, 0x0700,
-	0x908e, 0x0300, 0x1500, 0x2011, 0x0030, 0x0058, 0x2300, 0x9080,
-	0x0020, 0x2018, 0x080c, 0x9166, 0x928c, 0xff00, 0x0110, 0x2011,
-	0x00ff, 0x2200, 0x8007, 0x9085, 0x004c, 0x78c2, 0x2009, 0x0138,
-	0x220a, 0x080c, 0x74e9, 0x1118, 0x2009, 0x196d, 0x220a, 0x002e,
-	0x001e, 0x00fe, 0x0005, 0x78c3, 0x0000, 0x0cc8, 0x0126, 0x2091,
-	0x2800, 0x0006, 0x0016, 0x0026, 0x2001, 0x0170, 0x200c, 0x8000,
-	0x2014, 0x9184, 0x0003, 0x0110, 0x080c, 0x0d76, 0x002e, 0x001e,
-	0x000e, 0x012e, 0x0005, 0x2001, 0x0171, 0x2004, 0xd0dc, 0x0168,
-	0x2001, 0x0170, 0x200c, 0x918c, 0x00ff, 0x918e, 0x004c, 0x1128,
-	0x200c, 0x918c, 0xff00, 0x810f, 0x0005, 0x900e, 0x2001, 0x0227,
-	0x2004, 0x8007, 0x9084, 0x00ff, 0x8004, 0x9108, 0x2001, 0x0226,
-	0x2004, 0x8007, 0x9084, 0x00ff, 0x8004, 0x9108, 0x0005, 0x0018,
-	0x000c, 0x0018, 0x0020, 0x1000, 0x0800, 0x1000, 0x1800, 0x0156,
-	0x0006, 0x0016, 0x0026, 0x00e6, 0x2001, 0x1990, 0x2004, 0x908a,
-	0x0007, 0x1a0c, 0x0d7d, 0x0033, 0x00ee, 0x002e, 0x001e, 0x000e,
-	0x015e, 0x0005, 0x2759, 0x2777, 0x279b, 0x279d, 0x27c6, 0x27c8,
-	0x27ca, 0x2001, 0x0001, 0x080c, 0x25a0, 0x080c, 0x29bb, 0x2001,
-	0x1992, 0x2003, 0x0000, 0x7828, 0x9084, 0xe1d7, 0x782a, 0x9006,
-	0x20a9, 0x0009, 0x080c, 0x298d, 0x2001, 0x1990, 0x2003, 0x0006,
-	0x2009, 0x001e, 0x2011, 0x27cb, 0x080c, 0x8708, 0x0005, 0x2009,
-	0x1995, 0x200b, 0x0000, 0x2001, 0x199a, 0x2003, 0x0036, 0x2001,
-	0x1999, 0x2003, 0x002a, 0x2001, 0x1992, 0x2003, 0x0001, 0x9006,
-	0x080c, 0x2928, 0x2001, 0xffff, 0x20a9, 0x0009, 0x080c, 0x298d,
-	0x2001, 0x1990, 0x2003, 0x0006, 0x2009, 0x001e, 0x2011, 0x27cb,
-	0x080c, 0x8708, 0x0005, 0x080c, 0x0d7d, 0x2001, 0x199a, 0x2003,
-	0x0036, 0x2001, 0x1992, 0x2003, 0x0003, 0x7a38, 0x9294, 0x0005,
+	0x2071, 0x0080, 0x9006, 0x702b, 0x0060, 0x20a9, 0x0040, 0x7022,
+	0x1f04, 0x111f, 0x702b, 0x0060, 0x702b, 0x0020, 0x20a9, 0x0040,
+	0x7022, 0x1f04, 0x1128, 0x702b, 0x0020, 0x00ee, 0x0005, 0x0126,
+	0x2091, 0x8000, 0x00e6, 0xa06f, 0x0000, 0x2071, 0x1a20, 0x701c,
+	0x9088, 0x1a2a, 0x280a, 0x8000, 0x9084, 0x003f, 0x701e, 0x7120,
+	0x9106, 0x090c, 0x0d7d, 0x7004, 0x9005, 0x1128, 0x00f6, 0x2079,
+	0x0080, 0x00a9, 0x00fe, 0x00ee, 0x012e, 0x0005, 0x0126, 0x2091,
+	0x8000, 0x00e6, 0x2071, 0x1a20, 0x7004, 0x9005, 0x1128, 0x00f6,
+	0x2079, 0x0080, 0x0021, 0x00fe, 0x00ee, 0x012e, 0x0005, 0x7004,
+	0x9086, 0x0000, 0x1110, 0x7007, 0x0006, 0x7000, 0x0002, 0x1171,
+	0x12f4, 0x116f, 0x116f, 0x12e8, 0x12e8, 0x12e8, 0x12e8, 0x080c,
+	0x0d7d, 0x701c, 0x7120, 0x9106, 0x1148, 0x792c, 0x9184, 0x0001,
+	0x1120, 0xd1fc, 0x1110, 0x7007, 0x0000, 0x0005, 0x0096, 0x9180,
+	0x1a2a, 0x2004, 0x700a, 0x2048, 0x8108, 0x918c, 0x003f, 0x7122,
+	0x782b, 0x0026, 0xa88c, 0x7802, 0xa890, 0x7806, 0xa894, 0x780a,
+	0xa898, 0x780e, 0xa878, 0x700e, 0xa870, 0x7016, 0xa874, 0x701a,
+	0xa868, 0x009e, 0xd084, 0x0120, 0x7007, 0x0001, 0x0029, 0x0005,
+	0x7007, 0x0002, 0x00b1, 0x0005, 0x0016, 0x0026, 0x710c, 0x2011,
+	0x0040, 0x9182, 0x0040, 0x1210, 0x2110, 0x9006, 0x700e, 0x7212,
+	0x8203, 0x7812, 0x782b, 0x0020, 0x782b, 0x0041, 0x002e, 0x001e,
+	0x0005, 0x0016, 0x0026, 0x0136, 0x0146, 0x0156, 0x7014, 0x20e0,
+	0x7018, 0x2098, 0x20e9, 0x0000, 0x20a1, 0x0088, 0x782b, 0x0026,
+	0x710c, 0x2011, 0x0040, 0x9182, 0x0040, 0x1210, 0x2110, 0x9006,
+	0x700e, 0x22a8, 0x4006, 0x8203, 0x7812, 0x782b, 0x0020, 0x3300,
+	0x701a, 0x782b, 0x0001, 0x015e, 0x014e, 0x013e, 0x002e, 0x001e,
+	0x0005, 0x2009, 0x1a20, 0x2104, 0xc095, 0x200a, 0x080c, 0x114e,
+	0x0005, 0x0016, 0x00e6, 0x2071, 0x1a20, 0x00f6, 0x2079, 0x0080,
+	0x792c, 0xd1bc, 0x190c, 0x0d76, 0x782b, 0x0002, 0xd1fc, 0x0120,
+	0x918c, 0x0700, 0x7004, 0x0023, 0x00fe, 0x00ee, 0x001e, 0x0005,
+	0x115f, 0x1207, 0x123b, 0x1313, 0x0d7d, 0x132e, 0x0d7d, 0x918c,
+	0x0700, 0x1550, 0x0136, 0x0146, 0x0156, 0x7014, 0x20e8, 0x7018,
+	0x20a0, 0x20e1, 0x0000, 0x2099, 0x0088, 0x782b, 0x0040, 0x7010,
+	0x20a8, 0x4005, 0x3400, 0x701a, 0x015e, 0x014e, 0x013e, 0x700c,
+	0x9005, 0x0578, 0x7800, 0x7802, 0x7804, 0x7806, 0x080c, 0x11a4,
+	0x0005, 0x7008, 0x0096, 0x2048, 0xa86f, 0x0100, 0x009e, 0x7007,
+	0x0000, 0x080c, 0x115f, 0x0005, 0x7008, 0x0096, 0x2048, 0xa86f,
+	0x0200, 0x009e, 0x0ca0, 0x918c, 0x0700, 0x1150, 0x700c, 0x9005,
+	0x0180, 0x7800, 0x7802, 0x7804, 0x7806, 0x080c, 0x11b9, 0x0005,
+	0x7008, 0x0096, 0x2048, 0xa86f, 0x0200, 0x009e, 0x7007, 0x0000,
+	0x0080, 0x0096, 0x7008, 0x2048, 0x7800, 0xa88e, 0x7804, 0xa892,
+	0x7808, 0xa896, 0x780c, 0xa89a, 0xa86f, 0x0100, 0x009e, 0x7007,
+	0x0000, 0x0096, 0x00d6, 0x7008, 0x2048, 0x2001, 0x18b9, 0x2004,
+	0x9906, 0x1128, 0xa89c, 0x080f, 0x00de, 0x009e, 0x00a0, 0x00de,
+	0x009e, 0x0096, 0x00d6, 0x7008, 0x2048, 0x0081, 0x0150, 0xa89c,
+	0x0086, 0x2940, 0x080f, 0x008e, 0x00de, 0x009e, 0x080c, 0x114e,
+	0x0005, 0x00de, 0x009e, 0x080c, 0x114e, 0x0005, 0xa8a8, 0xd08c,
+	0x0005, 0x0096, 0xa0a0, 0x904d, 0x090c, 0x0d7d, 0xa06c, 0x908e,
+	0x0100, 0x0130, 0xa87b, 0x0030, 0xa883, 0x0000, 0xa897, 0x4002,
+	0x080c, 0x6d6f, 0xa09f, 0x0000, 0xa0a3, 0x0000, 0x2848, 0x080c,
+	0x106c, 0x009e, 0x0005, 0x00a6, 0xa0a0, 0x904d, 0x090c, 0x0d7d,
+	0xa06c, 0x908e, 0x0100, 0x0128, 0xa87b, 0x0001, 0xa883, 0x0000,
+	0x00c0, 0xa80c, 0x2050, 0xb004, 0x9005, 0x0198, 0xa80e, 0x2050,
+	0x8006, 0x8006, 0x8007, 0x908c, 0x003f, 0x9084, 0xffc0, 0x9080,
+	0x0002, 0xa076, 0xa172, 0xb000, 0xa07a, 0x2810, 0x080c, 0x112f,
+	0x00e8, 0xa97c, 0xa894, 0x0016, 0x0006, 0x080c, 0x6d6f, 0x000e,
+	0x001e, 0xd1fc, 0x1138, 0xd1f4, 0x0128, 0x00c6, 0x2060, 0x080c,
+	0xabdf, 0x00ce, 0x7008, 0x2048, 0xa89f, 0x0000, 0xa8a3, 0x0000,
+	0x080c, 0x106c, 0x7007, 0x0000, 0x080c, 0x114e, 0x00ae, 0x0005,
+	0x0126, 0x2091, 0x8000, 0x782b, 0x1001, 0x7007, 0x0005, 0x7000,
+	0xc094, 0x7002, 0x012e, 0x0005, 0x0096, 0x2001, 0x192e, 0x204c,
+	0xa87c, 0x7812, 0xa88c, 0x7802, 0xa890, 0x7806, 0xa894, 0x780a,
+	0xa898, 0x780e, 0x782b, 0x0020, 0x0126, 0x2091, 0x8000, 0x782b,
+	0x0041, 0x7007, 0x0003, 0x7000, 0xc084, 0x7002, 0x2900, 0x700a,
+	0x012e, 0x009e, 0x0005, 0x20e1, 0x0000, 0x2099, 0x0088, 0x782b,
+	0x0040, 0x0096, 0x2001, 0x192e, 0x204c, 0xaa7c, 0x009e, 0x080c,
+	0x8bfd, 0x2009, 0x188c, 0x2104, 0x9084, 0xfffc, 0x200a, 0x080c,
+	0x8a70, 0x7007, 0x0000, 0x080c, 0x115f, 0x0005, 0x7007, 0x0000,
+	0x080c, 0x115f, 0x0005, 0x0126, 0x2091, 0x2200, 0x2079, 0x0300,
+	0x2071, 0x1a6a, 0x7003, 0x0000, 0x78bf, 0x00f6, 0x0041, 0x7807,
+	0x0007, 0x7803, 0x0000, 0x7803, 0x0001, 0x012e, 0x0005, 0x00c6,
+	0x7803, 0x0000, 0x2001, 0x0165, 0x2003, 0x4198, 0x7808, 0xd09c,
+	0x0118, 0x7820, 0x04e9, 0x0cd0, 0x2001, 0x1a6b, 0x2003, 0x0000,
+	0x78ab, 0x0004, 0x78ac, 0xd0ac, 0x1de8, 0x78ab, 0x0002, 0x7807,
+	0x0007, 0x7827, 0x0030, 0x782b, 0x0400, 0x7827, 0x0031, 0x782b,
+	0x1a79, 0x781f, 0xff00, 0x781b, 0xff00, 0x2001, 0x0200, 0x2004,
+	0xd0dc, 0x0110, 0x781f, 0x0303, 0x2061, 0x1a79, 0x602f, 0x1ddc,
+	0x2001, 0x181a, 0x2004, 0x9082, 0x1ddc, 0x6032, 0x603b, 0x1e62,
+	0x602b, 0x1ab9, 0x6007, 0x1a99, 0x2061, 0x1a99, 0x60af, 0x193c,
+	0x2001, 0x1927, 0x2004, 0x60ba, 0x783f, 0x3368, 0x00ce, 0x0005,
+	0x9086, 0x000d, 0x11d0, 0x7808, 0xd09c, 0x01b8, 0x7820, 0x0026,
+	0x2010, 0x080c, 0xc820, 0x0180, 0x2260, 0x6000, 0x9086, 0x0004,
+	0x1158, 0x0016, 0x6120, 0x9186, 0x0009, 0x0108, 0x0020, 0x2009,
+	0x004c, 0x080c, 0xac7c, 0x001e, 0x002e, 0x0005, 0x0126, 0x2091,
+	0x2200, 0x7908, 0x9184, 0x0070, 0x190c, 0x0d76, 0xd19c, 0x05a0,
+	0x7820, 0x908c, 0xf000, 0x0540, 0x2060, 0x6020, 0x9086, 0x0003,
+	0x1550, 0x6000, 0x9086, 0x0004, 0x1530, 0x6114, 0x2148, 0xa876,
+	0xa87a, 0xa867, 0x0103, 0x080c, 0x6b91, 0x00b6, 0x6010, 0x2058,
+	0xba3c, 0x8211, 0x0208, 0xba3e, 0xb8d0, 0x9005, 0x190c, 0x674b,
+	0x00be, 0x6044, 0xd0fc, 0x190c, 0xa8b1, 0x080c, 0xac08, 0x7808,
+	0xd09c, 0x19b0, 0x012e, 0x0005, 0x908a, 0x0024, 0x1a0c, 0x0d7d,
+	0x002b, 0x012e, 0x0005, 0x04b0, 0x012e, 0x0005, 0x1412, 0x1438,
+	0x1468, 0x146d, 0x1471, 0x1476, 0x149e, 0x14a2, 0x14b0, 0x14b4,
+	0x1412, 0x1581, 0x1585, 0x15ea, 0x15f1, 0x1412, 0x15f2, 0x15f3,
+	0x15fe, 0x1605, 0x1412, 0x1412, 0x1412, 0x1412, 0x1412, 0x1412,
+	0x1412, 0x1478, 0x1412, 0x1440, 0x1465, 0x142c, 0x1412, 0x144c,
+	0x1416, 0x1414, 0x080c, 0x0d7d, 0x080c, 0x0d76, 0x080c, 0x1610,
+	0x2009, 0x1a78, 0x2104, 0x8000, 0x200a, 0x080c, 0x7f78, 0x080c,
+	0x1ac2, 0x0005, 0x6044, 0xd0fc, 0x190c, 0xa8b1, 0x2009, 0x0055,
+	0x080c, 0xac7c, 0x012e, 0x0005, 0x080c, 0x1610, 0x2060, 0x6044,
+	0xd0fc, 0x190c, 0xa8b1, 0x2009, 0x0055, 0x080c, 0xac7c, 0x0005,
+	0x2009, 0x0048, 0x080c, 0x1610, 0x2060, 0x080c, 0xac7c, 0x0005,
+	0x2009, 0x0054, 0x080c, 0x1610, 0x2060, 0x6044, 0xd0fc, 0x190c,
+	0xa8b1, 0x080c, 0xac7c, 0x0005, 0x080c, 0x1610, 0x2060, 0x0056,
+	0x0066, 0x080c, 0x1610, 0x2028, 0x080c, 0x1610, 0x2030, 0x0036,
+	0x0046, 0x2021, 0x0000, 0x2418, 0x2009, 0x0056, 0x080c, 0xac7c,
+	0x004e, 0x003e, 0x006e, 0x005e, 0x0005, 0x080c, 0x1610, 0x0005,
+	0x7004, 0xc085, 0xc0b5, 0x7006, 0x0005, 0x7004, 0xc085, 0x7006,
+	0x0005, 0x080c, 0x1610, 0x080c, 0x16d4, 0x0005, 0x080c, 0x0d7d,
+	0x080c, 0x1610, 0x2060, 0x6014, 0x0096, 0x2048, 0xa83b, 0xffff,
+	0x009e, 0x2009, 0x0048, 0x080c, 0xac7c, 0x2001, 0x015d, 0x2003,
+	0x0000, 0x2009, 0x03e8, 0x8109, 0x0160, 0x2001, 0x0201, 0x2004,
+	0x9005, 0x0dc8, 0x2001, 0x0218, 0x2004, 0xd0ec, 0x1110, 0x080c,
+	0x1615, 0x2001, 0x0307, 0x2003, 0x8000, 0x0005, 0x7004, 0xc095,
+	0x7006, 0x0005, 0x080c, 0x1610, 0x2060, 0x6014, 0x0096, 0x2048,
+	0xa83b, 0xffff, 0x009e, 0x2009, 0x0048, 0x080c, 0xac7c, 0x0005,
+	0x080c, 0x1610, 0x080c, 0x0d7d, 0x080c, 0x1610, 0x080c, 0x156c,
+	0x7827, 0x0018, 0x79ac, 0xd1dc, 0x0904, 0x151d, 0x7827, 0x0015,
+	0x7828, 0x782b, 0x0000, 0x9065, 0x0140, 0x2001, 0x020d, 0x2003,
+	0x0050, 0x2003, 0x0020, 0x0804, 0x1523, 0x7004, 0x9005, 0x01c8,
+	0x1188, 0x78ab, 0x0004, 0x7827, 0x0018, 0x782b, 0x0000, 0xd1bc,
+	0x090c, 0x0d7d, 0x2001, 0x020d, 0x2003, 0x0050, 0x2003, 0x0020,
+	0x0804, 0x1551, 0x78ab, 0x0004, 0x7803, 0x0001, 0x080c, 0x1585,
+	0x0005, 0x7827, 0x0018, 0xa001, 0x7828, 0x7827, 0x0011, 0xa001,
+	0x7928, 0x9106, 0x0110, 0x79ac, 0x08e0, 0x00e6, 0x2071, 0x0200,
+	0x702c, 0xd0c4, 0x0140, 0x00ee, 0x080c, 0x1ac2, 0x080c, 0x1347,
+	0x7803, 0x0001, 0x0005, 0x7037, 0x0001, 0xa001, 0x7150, 0x00ee,
+	0x918c, 0xff00, 0x9186, 0x0500, 0x0110, 0x79ac, 0x0810, 0x7004,
+	0xc09d, 0x7006, 0x78ab, 0x0004, 0x7803, 0x0001, 0x080c, 0x1585,
+	0x2001, 0x020d, 0x2003, 0x0020, 0x0005, 0x7828, 0x782b, 0x0000,
+	0x9065, 0x090c, 0x0d7d, 0x6014, 0x2048, 0x78ab, 0x0004, 0x918c,
+	0x0700, 0x01a8, 0x080c, 0x7f78, 0x080c, 0x1ac2, 0x080c, 0xc832,
+	0x0158, 0xa9ac, 0xa936, 0xa9b0, 0xa93a, 0xa83f, 0xffff, 0xa843,
+	0xffff, 0xa880, 0xc0bd, 0xa882, 0x080c, 0xc430, 0x0005, 0x6020,
+	0x9086, 0x0009, 0x1128, 0x2009, 0x004c, 0x080c, 0xac7c, 0x0048,
+	0x6010, 0x00b6, 0x2058, 0xb800, 0x00be, 0xd0bc, 0x6024, 0x190c,
+	0xcc33, 0x2029, 0x00c8, 0x8529, 0x0128, 0x2001, 0x0201, 0x2004,
+	0x9005, 0x0dc8, 0x7dbc, 0x080c, 0xe6ea, 0xd5a4, 0x1118, 0x080c,
+	0x1615, 0x0005, 0x080c, 0x7f78, 0x080c, 0x1ac2, 0x0005, 0x781f,
+	0x0300, 0x7803, 0x0001, 0x0005, 0x0016, 0x0066, 0x0076, 0x00f6,
+	0x2079, 0x0300, 0x7908, 0x918c, 0x0007, 0x9186, 0x0003, 0x0120,
+	0x2001, 0x0016, 0x080c, 0x1686, 0x00fe, 0x007e, 0x006e, 0x001e,
+	0x0005, 0x7004, 0xc09d, 0x7006, 0x0005, 0x7104, 0x9184, 0x0004,
+	0x190c, 0x0d7d, 0xd184, 0x1189, 0xd19c, 0x0158, 0xc19c, 0x7106,
+	0x2001, 0x020d, 0x2003, 0x0050, 0x2003, 0x0020, 0x080c, 0x1615,
+	0x0005, 0x81ff, 0x190c, 0x0d7d, 0x0005, 0xc184, 0xd1b4, 0xc1b4,
+	0x7106, 0x0016, 0x00e6, 0x15f0, 0x2071, 0x0200, 0x080c, 0x16c1,
+	0x05c8, 0x6014, 0x9005, 0x05b0, 0x0096, 0x2048, 0xa864, 0x009e,
+	0x9084, 0x00ff, 0x908e, 0x0029, 0x0160, 0x908e, 0x0048, 0x1550,
+	0x601c, 0xd084, 0x11e0, 0x00f6, 0x2c78, 0x080c, 0x173e, 0x00fe,
+	0x00b0, 0x00f6, 0x2c78, 0x080c, 0x18c5, 0x00fe, 0x2009, 0x01f4,
+	0x8109, 0x0168, 0x2001, 0x0201, 0x2004, 0x9005, 0x0dc8, 0x2001,
+	0x0218, 0x2004, 0xd0ec, 0x1118, 0x080c, 0x1615, 0x0040, 0x2001,
+	0x020d, 0x2003, 0x0020, 0x080c, 0x1347, 0x7803, 0x0001, 0x00ee,
+	0x001e, 0x0005, 0x2001, 0x020d, 0x2003, 0x0050, 0x2003, 0x0020,
+	0x0461, 0x0ca8, 0x0429, 0x2060, 0x2009, 0x0053, 0x080c, 0xac7c,
+	0x0005, 0x0005, 0x0005, 0x00e1, 0x2008, 0x00d1, 0x0006, 0x7004,
+	0xc09d, 0x7006, 0x000e, 0x080c, 0x8f5a, 0x0005, 0x0089, 0x9005,
+	0x0118, 0x080c, 0x8b5d, 0x0cd0, 0x0005, 0x2001, 0x0036, 0x2009,
+	0x1820, 0x210c, 0x2011, 0x181f, 0x2214, 0x080c, 0x1686, 0x0005,
+	0x7808, 0xd09c, 0x0de8, 0x7820, 0x0005, 0x080c, 0x156c, 0x00d6,
+	0x2069, 0x0200, 0x2009, 0x01f4, 0x8109, 0x0510, 0x6804, 0x9005,
+	0x0dd8, 0x2001, 0x015d, 0x2003, 0x0000, 0x79bc, 0xd1a4, 0x1528,
+	0x79b8, 0x918c, 0x0fff, 0x0180, 0x9182, 0x0841, 0x1268, 0x9188,
+	0x0007, 0x918c, 0x0ff8, 0x810c, 0x810c, 0x810c, 0x080c, 0x1678,
+	0x6827, 0x0001, 0x8109, 0x1dd0, 0x04d9, 0x6827, 0x0002, 0x04c1,
+	0x6804, 0x9005, 0x1130, 0x682c, 0xd0e4, 0x1500, 0x6804, 0x9005,
+	0x0de8, 0x79b8, 0xd1ec, 0x1130, 0x08c0, 0x080c, 0x7f78, 0x080c,
+	0x1ac2, 0x0090, 0x7827, 0x0015, 0x782b, 0x0000, 0x7827, 0x0018,
+	0x782b, 0x0000, 0x2001, 0x020d, 0x2003, 0x0020, 0x2001, 0x0307,
+	0x2003, 0x0300, 0x7803, 0x0001, 0x00de, 0x0005, 0x682c, 0x9084,
+	0x5400, 0x9086, 0x5400, 0x0d30, 0x7827, 0x0015, 0x782b, 0x0000,
+	0x7803, 0x0001, 0x6800, 0x9085, 0x1800, 0x6802, 0x00de, 0x0005,
+	0x6824, 0x9084, 0x0003, 0x1de0, 0x0005, 0x2001, 0x0030, 0x2c08,
+	0x621c, 0x0021, 0x7830, 0x9086, 0x0041, 0x0005, 0x00f6, 0x2079,
+	0x0300, 0x0006, 0x7808, 0xd09c, 0x0140, 0x0016, 0x0026, 0x00c6,
+	0x080c, 0x13ae, 0x00ce, 0x002e, 0x001e, 0x000e, 0x0006, 0x7832,
+	0x7936, 0x7a3a, 0x781b, 0x8080, 0x0059, 0x1118, 0x000e, 0x00fe,
+	0x0005, 0x000e, 0x792c, 0x3900, 0x8000, 0x2004, 0x080c, 0x0d7d,
+	0x2009, 0xff00, 0x8109, 0x0120, 0x7818, 0xd0bc, 0x1dd8, 0x0005,
+	0x9085, 0x0001, 0x0005, 0x7832, 0x7936, 0x7a3a, 0x781b, 0x8080,
+	0x0c79, 0x1108, 0x0005, 0x792c, 0x3900, 0x8000, 0x2004, 0x080c,
+	0x0d7d, 0x7037, 0x0001, 0x7150, 0x7037, 0x0002, 0x7050, 0x2060,
+	0xd1bc, 0x1110, 0x7054, 0x2060, 0x918c, 0xff00, 0x9186, 0x0500,
+	0x0110, 0x9085, 0x0001, 0x0005, 0x00e6, 0x0016, 0x2071, 0x0200,
+	0x0c41, 0x6124, 0xd1dc, 0x01f8, 0x701c, 0xd08c, 0x0904, 0x1733,
+	0x7017, 0x0000, 0x2001, 0x0264, 0x2004, 0xd0bc, 0x0904, 0x1733,
+	0x2001, 0x0268, 0x00c6, 0x2064, 0x6104, 0x6038, 0x00ce, 0x918e,
+	0x0039, 0x1904, 0x1733, 0x9c06, 0x15f0, 0x0126, 0x2091, 0x2600,
+	0x080c, 0x7ed0, 0x012e, 0x7358, 0x745c, 0x6014, 0x905d, 0x0598,
+	0x2b48, 0x6010, 0x00b6, 0x2058, 0xb800, 0x00be, 0xd0bc, 0x190c,
+	0xcc0e, 0xab42, 0xac3e, 0x2001, 0x1869, 0x2004, 0xd0b4, 0x1170,
+	0x601c, 0xd0e4, 0x1158, 0x6010, 0x00b6, 0x2058, 0xb800, 0x00be,
+	0xd0bc, 0x1120, 0xa83b, 0x7fff, 0xa837, 0xffff, 0x080c, 0x1e82,
+	0x1190, 0x080c, 0x1920, 0x2a00, 0xa816, 0x0130, 0x2800, 0xa80e,
+	0x2c05, 0xa80a, 0x2c00, 0xa812, 0x7037, 0x0020, 0x781f, 0x0300,
+	0x001e, 0x00ee, 0x0005, 0x7037, 0x0050, 0x7037, 0x0020, 0x001e,
+	0x00ee, 0x080c, 0x1615, 0x0005, 0x080c, 0x0d7d, 0x2cf0, 0x0126,
+	0x2091, 0x2200, 0x00c6, 0x3e60, 0x6014, 0x2048, 0x2940, 0x903e,
+	0x2730, 0xa864, 0x2068, 0xa81a, 0x9d84, 0x000f, 0x9088, 0x1e62,
+	0x2165, 0x0002, 0x1769, 0x17d7, 0x1769, 0x1769, 0x176d, 0x17b8,
+	0x1769, 0x178d, 0x1762, 0x17ce, 0x1769, 0x1769, 0x1772, 0x18c3,
+	0x17a1, 0x1797, 0xa964, 0x918c, 0x00ff, 0x918e, 0x0048, 0x0904,
+	0x17ce, 0x9085, 0x0001, 0x0804, 0x18ba, 0xa87c, 0xd0ac, 0x0dc8,
+	0x0804, 0x17de, 0xa87c, 0xd0ac, 0x0da0, 0x0804, 0x1849, 0xa898,
+	0x901d, 0x1108, 0xab9c, 0x9016, 0xaab2, 0xaa3e, 0xaa42, 0x3e00,
+	0x9080, 0x0008, 0x2004, 0x9080, 0x9123, 0x2005, 0x9005, 0x090c,
+	0x0d7d, 0x2004, 0xa8ae, 0x0804, 0x18a2, 0xa87c, 0xd0bc, 0x09c8,
+	0xa890, 0xa842, 0xa88c, 0xa83e, 0xa888, 0x0804, 0x17de, 0xa87c,
+	0xd0bc, 0x0978, 0xa890, 0xa842, 0xa88c, 0xa83e, 0xa888, 0x0804,
+	0x1849, 0xa87c, 0xd0bc, 0x0928, 0xa890, 0xa842, 0xa88c, 0xa83e,
+	0xa804, 0x9045, 0x090c, 0x0d7d, 0xa164, 0xa91a, 0x91ec, 0x000f,
+	0x9d80, 0x1e62, 0x2065, 0xa888, 0xd19c, 0x1904, 0x1849, 0x0430,
+	0xa87c, 0xd0ac, 0x0904, 0x1769, 0xa804, 0x9045, 0x090c, 0x0d7d,
+	0xa164, 0xa91a, 0x91ec, 0x000f, 0x9d80, 0x1e62, 0x2065, 0x9006,
+	0xa842, 0xa83e, 0xd19c, 0x1904, 0x1849, 0x0080, 0xa87c, 0xd0ac,
+	0x0904, 0x1769, 0x9006, 0xa842, 0xa83e, 0x0804, 0x1849, 0xa87c,
+	0xd0ac, 0x0904, 0x1769, 0x9006, 0xa842, 0xa83e, 0x2c05, 0x908a,
+	0x0036, 0x1a0c, 0x0d7d, 0x9082, 0x001b, 0x0002, 0x1801, 0x1801,
+	0x1803, 0x1801, 0x1801, 0x1801, 0x180d, 0x1801, 0x1801, 0x1801,
+	0x1817, 0x1801, 0x1801, 0x1801, 0x1821, 0x1801, 0x1801, 0x1801,
+	0x182b, 0x1801, 0x1801, 0x1801, 0x1835, 0x1801, 0x1801, 0x1801,
+	0x183f, 0x080c, 0x0d7d, 0xa574, 0xa478, 0x9d86, 0x0024, 0x0904,
+	0x1777, 0xa37c, 0xa280, 0x0804, 0x18a2, 0xa584, 0xa488, 0x9d86,
+	0x0024, 0x0904, 0x1777, 0xa38c, 0xa290, 0x0804, 0x18a2, 0xa594,
+	0xa498, 0x9d86, 0x0024, 0x0904, 0x1777, 0xa39c, 0xa2a0, 0x0804,
+	0x18a2, 0xa5a4, 0xa4a8, 0x9d86, 0x0024, 0x0904, 0x1777, 0xa3ac,
+	0xa2b0, 0x0804, 0x18a2, 0xa5b4, 0xa4b8, 0x9d86, 0x0024, 0x0904,
+	0x1777, 0xa3bc, 0xa2c0, 0x0804, 0x18a2, 0xa5c4, 0xa4c8, 0x9d86,
+	0x0024, 0x0904, 0x1777, 0xa3cc, 0xa2d0, 0x0804, 0x18a2, 0xa5d4,
+	0xa4d8, 0x9d86, 0x0024, 0x0904, 0x1777, 0xa3dc, 0xa2e0, 0x0804,
+	0x18a2, 0x2c05, 0x908a, 0x0034, 0x1a0c, 0x0d7d, 0x9082, 0x001b,
+	0x0002, 0x186c, 0x186a, 0x186a, 0x186a, 0x186a, 0x186a, 0x1877,
+	0x186a, 0x186a, 0x186a, 0x186a, 0x186a, 0x1882, 0x186a, 0x186a,
+	0x186a, 0x186a, 0x186a, 0x188d, 0x186a, 0x186a, 0x186a, 0x186a,
+	0x186a, 0x1898, 0x080c, 0x0d7d, 0xa56c, 0xa470, 0xa774, 0xa678,
+	0x9d86, 0x002c, 0x0904, 0x1777, 0xa37c, 0xa280, 0x0458, 0xa584,
+	0xa488, 0xa78c, 0xa690, 0x9d86, 0x002c, 0x0904, 0x1777, 0xa394,
+	0xa298, 0x0400, 0xa59c, 0xa4a0, 0xa7a4, 0xa6a8, 0x9d86, 0x002c,
+	0x0904, 0x1777, 0xa3ac, 0xa2b0, 0x00a8, 0xa5b4, 0xa4b8, 0xa7bc,
+	0xa6c0, 0x9d86, 0x002c, 0x0904, 0x1777, 0xa3c4, 0xa2c8, 0x0050,
+	0xa5cc, 0xa4d0, 0xa7d4, 0xa6d8, 0x9d86, 0x002c, 0x0904, 0x1777,
+	0xa3dc, 0xa2e0, 0xab2e, 0xaa32, 0xad1e, 0xac22, 0xaf26, 0xae2a,
+	0xa988, 0x8c60, 0x2c1d, 0xa8ac, 0xaab0, 0xa836, 0xaa3a, 0x8109,
+	0xa916, 0x1158, 0x3e60, 0x601c, 0xc085, 0x601e, 0xa87c, 0xc0dd,
+	0xa87e, 0x9006, 0x00ce, 0x012e, 0x0005, 0x2800, 0xa80e, 0xab0a,
+	0x2c00, 0xa812, 0x0c78, 0x0804, 0x1769, 0x2ff0, 0x0126, 0x2091,
+	0x2200, 0x00c6, 0x3e60, 0x6014, 0x2048, 0x2940, 0xa80e, 0x2061,
+	0x1e5d, 0xa813, 0x1e5d, 0x2c05, 0xa80a, 0xa964, 0xa91a, 0xa87c,
+	0xd0ac, 0x090c, 0x0d7d, 0x9006, 0xa842, 0xa83e, 0x2c05, 0x908a,
+	0x0034, 0x1a0c, 0x0d7d, 0xadcc, 0xacd0, 0xafd4, 0xaed8, 0xabdc,
+	0xaae0, 0xab2e, 0xaa32, 0xad1e, 0xac22, 0xaf26, 0xae2a, 0xa8ac,
+	0xaab0, 0xa836, 0xaa3a, 0xa988, 0xa864, 0x9084, 0x00ff, 0x9086,
+	0x0008, 0x1120, 0x8109, 0xa916, 0x0128, 0x0078, 0x918a, 0x0002,
+	0xa916, 0x1158, 0x3e60, 0x601c, 0xc085, 0x601e, 0xa87c, 0xc0dd,
+	0xa87e, 0x9006, 0x00ce, 0x012e, 0x0005, 0xa804, 0x9045, 0x090c,
+	0x0d7d, 0xa80e, 0xa064, 0xa81a, 0x9084, 0x000f, 0x9080, 0x1e62,
+	0x2015, 0x82ff, 0x090c, 0x0d7d, 0xaa12, 0x2205, 0xa80a, 0x0c10,
+	0x903e, 0x2730, 0xa880, 0xd0fc, 0x1190, 0x2d00, 0x0002, 0x1a4a,
+	0x1977, 0x1977, 0x1a4a, 0x1977, 0x1a44, 0x1a4a, 0x1977, 0x19e7,
+	0x19e7, 0x19e7, 0x1a4a, 0x19e7, 0x1a4a, 0x1a41, 0x19e7, 0xc0fc,
+	0xa882, 0xab2c, 0xaa30, 0xad1c, 0xac20, 0xdd9c, 0x0904, 0x1a4c,
+	0x2c05, 0x908a, 0x0034, 0x1a0c, 0x0d7d, 0x9082, 0x001b, 0x0002,
+	0x1963, 0x1961, 0x1961, 0x1961, 0x1961, 0x1961, 0x1967, 0x1961,
+	0x1961, 0x1961, 0x1961, 0x1961, 0x196b, 0x1961, 0x1961, 0x1961,
+	0x1961, 0x1961, 0x196f, 0x1961, 0x1961, 0x1961, 0x1961, 0x1961,
+	0x1973, 0x080c, 0x0d7d, 0xa774, 0xa678, 0x0804, 0x1a4c, 0xa78c,
+	0xa690, 0x0804, 0x1a4c, 0xa7a4, 0xa6a8, 0x0804, 0x1a4c, 0xa7bc,
+	0xa6c0, 0x0804, 0x1a4c, 0xa7d4, 0xa6d8, 0x0804, 0x1a4c, 0xa898,
+	0x901d, 0x1108, 0xab9c, 0x9016, 0x2c05, 0x908a, 0x0036, 0x1a0c,
+	0x0d7d, 0x9082, 0x001b, 0x0002, 0x199f, 0x199f, 0x19a1, 0x199f,
+	0x199f, 0x199f, 0x19ab, 0x199f, 0x199f, 0x199f, 0x19b5, 0x199f,
+	0x199f, 0x199f, 0x19bf, 0x199f, 0x199f, 0x199f, 0x19c9, 0x199f,
+	0x199f, 0x199f, 0x19d3, 0x199f, 0x199f, 0x199f, 0x19dd, 0x080c,
+	0x0d7d, 0xa574, 0xa478, 0x9d86, 0x0004, 0x0904, 0x1a4c, 0xa37c,
+	0xa280, 0x0804, 0x1a4c, 0xa584, 0xa488, 0x9d86, 0x0004, 0x0904,
+	0x1a4c, 0xa38c, 0xa290, 0x0804, 0x1a4c, 0xa594, 0xa498, 0x9d86,
+	0x0004, 0x0904, 0x1a4c, 0xa39c, 0xa2a0, 0x0804, 0x1a4c, 0xa5a4,
+	0xa4a8, 0x9d86, 0x0004, 0x0904, 0x1a4c, 0xa3ac, 0xa2b0, 0x0804,
+	0x1a4c, 0xa5b4, 0xa4b8, 0x9d86, 0x0004, 0x0904, 0x1a4c, 0xa3bc,
+	0xa2c0, 0x0804, 0x1a4c, 0xa5c4, 0xa4c8, 0x9d86, 0x0004, 0x0904,
+	0x1a4c, 0xa3cc, 0xa2d0, 0x0804, 0x1a4c, 0xa5d4, 0xa4d8, 0x9d86,
+	0x0004, 0x0904, 0x1a4c, 0xa3dc, 0xa2e0, 0x0804, 0x1a4c, 0xa898,
+	0x901d, 0x1108, 0xab9c, 0x9016, 0x2c05, 0x908a, 0x0034, 0x1a0c,
+	0x0d7d, 0x9082, 0x001b, 0x0002, 0x1a0f, 0x1a0d, 0x1a0d, 0x1a0d,
+	0x1a0d, 0x1a0d, 0x1a19, 0x1a0d, 0x1a0d, 0x1a0d, 0x1a0d, 0x1a0d,
+	0x1a23, 0x1a0d, 0x1a0d, 0x1a0d, 0x1a0d, 0x1a0d, 0x1a2d, 0x1a0d,
+	0x1a0d, 0x1a0d, 0x1a0d, 0x1a0d, 0x1a37, 0x080c, 0x0d7d, 0xa56c,
+	0xa470, 0xa774, 0xa678, 0x9d86, 0x000c, 0x05b0, 0xa37c, 0xa280,
+	0x0498, 0xa584, 0xa488, 0xa78c, 0xa690, 0x9d86, 0x000c, 0x0560,
+	0xa394, 0xa298, 0x0448, 0xa59c, 0xa4a0, 0xa7a4, 0xa6a8, 0x9d86,
+	0x000c, 0x0510, 0xa3ac, 0xa2b0, 0x00f8, 0xa5b4, 0xa4b8, 0xa7bc,
+	0xa6c0, 0x9d86, 0x000c, 0x01c0, 0xa3c4, 0xa2c8, 0x00a8, 0xa5cc,
+	0xa4d0, 0xa7d4, 0xa6d8, 0x9d86, 0x000c, 0x0170, 0xa3dc, 0xa2e0,
+	0x0058, 0x9d86, 0x000e, 0x1130, 0x080c, 0x1e38, 0x1904, 0x1920,
+	0x900e, 0x0050, 0x080c, 0x0d7d, 0xab2e, 0xaa32, 0xad1e, 0xac22,
+	0xaf26, 0xae2a, 0x080c, 0x1e38, 0x0005, 0x6014, 0x2048, 0x6118,
+	0x810c, 0x810c, 0x810c, 0x81ff, 0x1118, 0xa887, 0x0001, 0x0008,
+	0xa986, 0x601b, 0x0002, 0xa974, 0xd1dc, 0x1108, 0x0005, 0xa934,
+	0xa88c, 0x9106, 0x1158, 0xa938, 0xa890, 0x9106, 0x1138, 0x601c,
+	0xc084, 0x601e, 0x2009, 0x0048, 0x0804, 0xac7c, 0x0005, 0x0126,
+	0x00c6, 0x2091, 0x2200, 0x00ce, 0x7908, 0x918c, 0x0007, 0x9186,
+	0x0000, 0x05b0, 0x9186, 0x0003, 0x0598, 0x6020, 0x6023, 0x0000,
+	0x0006, 0x2031, 0x0008, 0x00c6, 0x781f, 0x0808, 0x7808, 0xd09c,
+	0x0120, 0x080c, 0x13ae, 0x8631, 0x1db8, 0x00ce, 0x781f, 0x0800,
+	0x2031, 0x0168, 0x00c6, 0x7808, 0xd09c, 0x190c, 0x13ae, 0x00ce,
+	0x2001, 0x0038, 0x080c, 0x1b4f, 0x7930, 0x9186, 0x0040, 0x0160,
+	0x9186, 0x0042, 0x190c, 0x0d7d, 0x2001, 0x001e, 0x8001, 0x1df0,
+	0x8631, 0x1d40, 0x080c, 0x1b5e, 0x000e, 0x6022, 0x012e, 0x0005,
+	0x080c, 0x1b4b, 0x7827, 0x0015, 0x7828, 0x9c06, 0x1db8, 0x782b,
+	0x0000, 0x0ca0, 0x00f6, 0x2079, 0x0300, 0x7803, 0x0000, 0x78ab,
+	0x0004, 0x00fe, 0x080c, 0x74c8, 0x11b0, 0x2001, 0x0138, 0x2003,
+	0x0000, 0x2001, 0x0160, 0x2003, 0x0000, 0x2011, 0x012c, 0xa001,
+	0xa001, 0x8211, 0x1de0, 0x0081, 0x2001, 0x0386, 0x2003, 0x2020,
+	0x080c, 0x7569, 0x0005, 0x0479, 0x0039, 0x2001, 0x0160, 0x2502,
+	0x2001, 0x0138, 0x2202, 0x0005, 0x00e6, 0x2071, 0x0200, 0x080c,
+	0x2a1b, 0x2009, 0x003c, 0x080c, 0x21c1, 0x2001, 0x015d, 0x2003,
+	0x0000, 0x7000, 0x9084, 0x003c, 0x1de0, 0x080c, 0x8532, 0x70a0,
+	0x70a2, 0x7098, 0x709a, 0x709c, 0x709e, 0x2001, 0x020d, 0x2003,
+	0x0020, 0x00f6, 0x2079, 0x0300, 0x080c, 0x1347, 0x7803, 0x0001,
+	0x00fe, 0x00ee, 0x0005, 0x2001, 0x0138, 0x2014, 0x2003, 0x0000,
+	0x2001, 0x0160, 0x202c, 0x2003, 0x0000, 0x080c, 0x74c8, 0x1108,
+	0x0005, 0x2021, 0x0260, 0x2001, 0x0141, 0x201c, 0xd3dc, 0x1168,
+	0x2001, 0x0109, 0x201c, 0x939c, 0x0048, 0x1160, 0x2001, 0x0111,
+	0x201c, 0x83ff, 0x1110, 0x8421, 0x1d70, 0x2001, 0x015d, 0x2003,
+	0x0000, 0x0005, 0x0046, 0x2021, 0x0019, 0x2003, 0x0048, 0xa001,
+	0xa001, 0x201c, 0x939c, 0x0048, 0x0120, 0x8421, 0x1db0, 0x004e,
+	0x0c60, 0x004e, 0x0c40, 0x601c, 0xc084, 0x601e, 0x0005, 0x2c08,
+	0x621c, 0x080c, 0x1686, 0x7930, 0x0005, 0x2c08, 0x621c, 0x080c,
+	0x16b3, 0x7930, 0x0005, 0x8001, 0x1df0, 0x0005, 0x2031, 0x0005,
+	0x781c, 0x9084, 0x0007, 0x0170, 0x2001, 0x0038, 0x0c41, 0x9186,
+	0x0040, 0x0904, 0x1bbc, 0x2001, 0x001e, 0x0c69, 0x8631, 0x1d80,
+	0x080c, 0x0d7d, 0x781f, 0x0202, 0x2001, 0x015d, 0x2003, 0x0000,
+	0x2001, 0x0b10, 0x0c01, 0x781c, 0xd084, 0x0110, 0x0861, 0x04e0,
+	0x2001, 0x0030, 0x0891, 0x9186, 0x0040, 0x0568, 0x781c, 0xd084,
+	0x1da8, 0x781f, 0x0101, 0x2001, 0x0014, 0x0869, 0x2001, 0x0037,
+	0x0821, 0x9186, 0x0040, 0x0140, 0x2001, 0x0030, 0x080c, 0x1b55,
+	0x9186, 0x0040, 0x190c, 0x0d7d, 0x00d6, 0x2069, 0x0200, 0x692c,
+	0xd1f4, 0x1170, 0xd1c4, 0x0160, 0xd19c, 0x0130, 0x6800, 0x9085,
+	0x1800, 0x6802, 0x00de, 0x0080, 0x6908, 0x9184, 0x0007, 0x1db0,
+	0x00de, 0x781f, 0x0100, 0x791c, 0x9184, 0x0007, 0x090c, 0x0d7d,
+	0xa001, 0xa001, 0x781f, 0x0200, 0x0005, 0x0126, 0x2091, 0x2400,
+	0x2079, 0x0380, 0x2001, 0x19e6, 0x2070, 0x012e, 0x0005, 0x2cf0,
+	0x0126, 0x2091, 0x2400, 0x3e60, 0x6014, 0x2048, 0xa964, 0xa91a,
+	0x918c, 0x00ff, 0x9184, 0x000f, 0x0002, 0x1bf1, 0x1bf1, 0x1bf1,
+	0x1bf3, 0x1bf1, 0x1bf1, 0x1bf1, 0x1bf1, 0x1be5, 0x1bfb, 0x1bf1,
+	0x1bf7, 0x1bf1, 0x1bf1, 0x1bf1, 0x1bf1, 0x9086, 0x0008, 0x1148,
+	0xa87c, 0xd0b4, 0x0904, 0x1d6b, 0x2011, 0x1e5d, 0x2205, 0xab88,
+	0x00a8, 0x080c, 0x0d7d, 0x9186, 0x0013, 0x0128, 0x0cd0, 0x9186,
+	0x001b, 0x0108, 0x0cb0, 0xa87c, 0xd0b4, 0x0904, 0x1d6b, 0x9184,
+	0x000f, 0x9080, 0x1e62, 0x2015, 0x2205, 0xab88, 0x2908, 0xa80a,
+	0xa90e, 0xaa12, 0xab16, 0x9006, 0xa842, 0xa83e, 0x012e, 0x0005,
+	0x2cf0, 0x0126, 0x2091, 0x2400, 0x3e60, 0x6014, 0x2048, 0xa88c,
+	0xa990, 0xaaac, 0xabb0, 0xaa36, 0xab3a, 0xa83e, 0xa942, 0xa846,
+	0xa94a, 0xa964, 0x918c, 0x00ff, 0x9186, 0x001e, 0x0198, 0x2940,
+	0xa064, 0xa81a, 0x90ec, 0x000f, 0x9d80, 0x1e62, 0x2065, 0x2c05,
+	0x2808, 0x2c10, 0xab88, 0xa80a, 0xa90e, 0xaa12, 0xab16, 0x012e,
+	0x3e60, 0x0005, 0xa804, 0x2040, 0x0c58, 0x2cf0, 0x0126, 0x2091,
+	0x2400, 0x3e60, 0x6014, 0x2048, 0xa97c, 0x2950, 0xd1dc, 0x1904,
+	0x1d35, 0xc1dd, 0xa97e, 0x9006, 0xa842, 0xa83e, 0xa988, 0x8109,
+	0xa916, 0xa964, 0xa91a, 0x9184, 0x000f, 0x9088, 0x1e62, 0x2145,
+	0x0002, 0x1c69, 0x1c77, 0x1c69, 0x1c69, 0x1c69, 0x1c6b, 0x1c69,
+	0x1c69, 0x1ccc, 0x1ccc, 0x1c69, 0x1c69, 0x1c69, 0x1cca, 0x1c69,
+	0x1c69, 0x080c, 0x0d7d, 0xa804, 0x2050, 0xb164, 0xa91a, 0x9184,
+	0x000f, 0x9080, 0x1e62, 0x2045, 0xd19c, 0x1904, 0x1ccc, 0x9036,
+	0x2638, 0x2805, 0x908a, 0x0036, 0x1a0c, 0x0d7d, 0x9082, 0x001b,
+	0x0002, 0x1c9c, 0x1c9c, 0x1c9e, 0x1c9c, 0x1c9c, 0x1c9c, 0x1ca4,
+	0x1c9c, 0x1c9c, 0x1c9c, 0x1caa, 0x1c9c, 0x1c9c, 0x1c9c, 0x1cb0,
+	0x1c9c, 0x1c9c, 0x1c9c, 0x1cb6, 0x1c9c, 0x1c9c, 0x1c9c, 0x1cbc,
+	0x1c9c, 0x1c9c, 0x1c9c, 0x1cc2, 0x080c, 0x0d7d, 0xb574, 0xb478,
+	0xb37c, 0xb280, 0x0804, 0x1d11, 0xb584, 0xb488, 0xb38c, 0xb290,
+	0x0804, 0x1d11, 0xb594, 0xb498, 0xb39c, 0xb2a0, 0x0804, 0x1d11,
+	0xb5a4, 0xb4a8, 0xb3ac, 0xb2b0, 0x0804, 0x1d11, 0xb5b4, 0xb4b8,
+	0xb3bc, 0xb2c0, 0x0804, 0x1d11, 0xb5c4, 0xb4c8, 0xb3cc, 0xb2d0,
+	0x0804, 0x1d11, 0xb5d4, 0xb4d8, 0xb3dc, 0xb2e0, 0x0804, 0x1d11,
+	0x0804, 0x1d11, 0x080c, 0x0d7d, 0x2805, 0x908a, 0x0034, 0x1a0c,
+	0x0d7d, 0x9082, 0x001b, 0x0002, 0x1cef, 0x1ced, 0x1ced, 0x1ced,
+	0x1ced, 0x1ced, 0x1cf6, 0x1ced, 0x1ced, 0x1ced, 0x1ced, 0x1ced,
+	0x1cfd, 0x1ced, 0x1ced, 0x1ced, 0x1ced, 0x1ced, 0x1d04, 0x1ced,
+	0x1ced, 0x1ced, 0x1ced, 0x1ced, 0x1d0b, 0x080c, 0x0d7d, 0xb56c,
+	0xb470, 0xb774, 0xb678, 0xb37c, 0xb280, 0x00d8, 0xb584, 0xb488,
+	0xb78c, 0xb690, 0xb394, 0xb298, 0x00a0, 0xb59c, 0xb4a0, 0xb7a4,
+	0xb6a8, 0xb3ac, 0xb2b0, 0x0068, 0xb5b4, 0xb4b8, 0xb7bc, 0xb6c0,
+	0xb3c4, 0xb2c8, 0x0030, 0xb5cc, 0xb4d0, 0xb7d4, 0xb6d8, 0xb3dc,
+	0xb2e0, 0xab2e, 0xaa32, 0xad1e, 0xac22, 0xaf26, 0xae2a, 0xa988,
+	0x8109, 0xa916, 0x1118, 0x9006, 0x012e, 0x0005, 0x8840, 0x2805,
+	0x9005, 0x1168, 0xb004, 0x9005, 0x090c, 0x0d7d, 0x2050, 0xb164,
+	0xa91a, 0x9184, 0x000f, 0x9080, 0x1e62, 0x2045, 0x2805, 0x2810,
+	0x2a08, 0xa80a, 0xa90e, 0xaa12, 0x0c30, 0x3e60, 0x6344, 0xd3fc,
+	0x190c, 0x0d7d, 0xa93c, 0xaa40, 0xa844, 0x9106, 0x1118, 0xa848,
+	0x9206, 0x0508, 0x2958, 0xab48, 0xac44, 0x2940, 0x080c, 0x1e82,
+	0x1998, 0x2850, 0x2c40, 0xab14, 0xa880, 0xd0fc, 0x1140, 0xa810,
+	0x2005, 0xa80a, 0x2a00, 0xa80e, 0x2009, 0x8015, 0x0070, 0x00c6,
+	0x3e60, 0x6044, 0xc0a4, 0x9085, 0x8005, 0x6046, 0x00ce, 0x8319,
+	0xab16, 0x1904, 0x1d1e, 0x2009, 0x8005, 0x3e60, 0x6044, 0x9105,
+	0x6046, 0x0804, 0x1d1b, 0x080c, 0x0d7d, 0x00f6, 0x00e6, 0x0096,
+	0x00c6, 0x0026, 0x704c, 0x9c06, 0x190c, 0x0d7d, 0x2079, 0x0090,
+	0x2001, 0x0105, 0x2003, 0x0010, 0x782b, 0x0004, 0x7057, 0x0000,
+	0x6014, 0x2048, 0x080c, 0xc832, 0x0118, 0xa880, 0xc0bd, 0xa882,
+	0x6020, 0x9086, 0x0006, 0x1170, 0x2061, 0x0100, 0x62c8, 0x2001,
+	0x00fa, 0x8001, 0x1df0, 0x60c8, 0x9206, 0x1dc0, 0x60c4, 0xa89a,
+	0x60c8, 0xa896, 0x704c, 0x2060, 0x00c6, 0x080c, 0xc430, 0x080c,
+	0xa888, 0x00ce, 0x704c, 0x9c06, 0x1150, 0x2009, 0x0040, 0x080c,
+	0x21c1, 0x080c, 0xa331, 0x2011, 0x0000, 0x080c, 0xa1bb, 0x002e,
+	0x00ce, 0x009e, 0x00ee, 0x00fe, 0x0005, 0x00f6, 0x2079, 0x0090,
+	0x781c, 0x0006, 0x7818, 0x0006, 0x2079, 0x0100, 0x7a14, 0x9284,
+	0x1984, 0x9085, 0x0012, 0x7816, 0x2019, 0x1000, 0x8319, 0x090c,
+	0x0d7d, 0x7820, 0xd0bc, 0x1dd0, 0x79c8, 0x000e, 0x9102, 0x001e,
+	0x0006, 0x0016, 0x79c4, 0x000e, 0x9103, 0x78c6, 0x000e, 0x78ca,
+	0x9284, 0x1984, 0x9085, 0x0012, 0x7816, 0x2079, 0x0090, 0x782b,
+	0x0008, 0x7057, 0x0000, 0x00fe, 0x0005, 0x00f6, 0x00e6, 0x2071,
+	0x19e6, 0x7054, 0x9086, 0x0000, 0x0904, 0x1e33, 0x2079, 0x0090,
+	0x2009, 0x0207, 0x210c, 0xd194, 0x01b8, 0x2009, 0x020c, 0x210c,
+	0x9184, 0x0003, 0x0188, 0x080c, 0xe733, 0x2001, 0x0133, 0x2004,
+	0x9005, 0x090c, 0x0d7d, 0x0016, 0x2009, 0x0040, 0x080c, 0x21c1,
+	0x001e, 0x2001, 0x020c, 0x2102, 0x2009, 0x0206, 0x2104, 0x2009,
+	0x0203, 0x210c, 0x9106, 0x1120, 0x2009, 0x0040, 0x080c, 0x21c1,
+	0x782c, 0xd0fc, 0x09a8, 0x080c, 0xa8a4, 0x782c, 0xd0fc, 0x1de8,
+	0x080c, 0xa888, 0x7054, 0x9086, 0x0000, 0x1950, 0x782b, 0x0004,
+	0x782c, 0xd0ac, 0x1de8, 0x2009, 0x0040, 0x080c, 0x21c1, 0x782b,
+	0x0002, 0x7057, 0x0000, 0x00ee, 0x00fe, 0x0005, 0x080c, 0x0d7d,
+	0x8c60, 0x2c05, 0x9005, 0x0110, 0x8a51, 0x0005, 0xa004, 0x9005,
+	0x0168, 0xa85a, 0x2040, 0xa064, 0x9084, 0x000f, 0x9080, 0x1e62,
+	0x2065, 0x8cff, 0x090c, 0x0d7d, 0x8a51, 0x0005, 0x2050, 0x0005,
+	0x0000, 0x001d, 0x0021, 0x0025, 0x0029, 0x002d, 0x0031, 0x0035,
+	0x0000, 0x001b, 0x0021, 0x0027, 0x002d, 0x0033, 0x0000, 0x0000,
+	0x0023, 0x0000, 0x0000, 0x1e55, 0x1e51, 0x1e55, 0x1e55, 0x1e5f,
+	0x0000, 0x1e55, 0x1e5c, 0x1e5c, 0x1e59, 0x1e5c, 0x1e5c, 0x0000,
+	0x1e5f, 0x1e5c, 0x0000, 0x1e57, 0x1e57, 0x0000, 0x1e57, 0x1e5f,
+	0x0000, 0x1e57, 0x1e5d, 0x1e5d, 0x1e5d, 0x0000, 0x1e5d, 0x0000,
+	0x1e5f, 0x1e5d, 0x00c6, 0x00d6, 0x0086, 0xab42, 0xac3e, 0xa888,
+	0x9055, 0x0904, 0x2061, 0x2940, 0xa064, 0x90ec, 0x000f, 0x9084,
+	0x00ff, 0x9086, 0x0008, 0x1118, 0x2061, 0x1e5d, 0x00d0, 0x9de0,
+	0x1e62, 0x9d86, 0x0007, 0x0130, 0x9d86, 0x000e, 0x0118, 0x9d86,
+	0x000f, 0x1120, 0xa08c, 0x9422, 0xa090, 0x931b, 0x2c05, 0x9065,
+	0x1140, 0x0310, 0x0804, 0x2061, 0xa004, 0x9045, 0x0904, 0x2061,
+	0x08d8, 0x2c05, 0x9005, 0x0904, 0x1f49, 0xdd9c, 0x1904, 0x1f05,
+	0x908a, 0x0036, 0x1a0c, 0x0d7d, 0x9082, 0x001b, 0x0002, 0x1eda,
+	0x1eda, 0x1edc, 0x1eda, 0x1eda, 0x1eda, 0x1ee2, 0x1eda, 0x1eda,
+	0x1eda, 0x1ee8, 0x1eda, 0x1eda, 0x1eda, 0x1eee, 0x1eda, 0x1eda,
+	0x1eda, 0x1ef4, 0x1eda, 0x1eda, 0x1eda, 0x1efa, 0x1eda, 0x1eda,
+	0x1eda, 0x1f00, 0x080c, 0x0d7d, 0xa07c, 0x9422, 0xa080, 0x931b,
+	0x0804, 0x1f3f, 0xa08c, 0x9422, 0xa090, 0x931b, 0x0804, 0x1f3f,
+	0xa09c, 0x9422, 0xa0a0, 0x931b, 0x0804, 0x1f3f, 0xa0ac, 0x9422,
+	0xa0b0, 0x931b, 0x0804, 0x1f3f, 0xa0bc, 0x9422, 0xa0c0, 0x931b,
+	0x0804, 0x1f3f, 0xa0cc, 0x9422, 0xa0d0, 0x931b, 0x0804, 0x1f3f,
+	0xa0dc, 0x9422, 0xa0e0, 0x931b, 0x04d0, 0x908a, 0x0034, 0x1a0c,
+	0x0d7d, 0x9082, 0x001b, 0x0002, 0x1f27, 0x1f25, 0x1f25, 0x1f25,
+	0x1f25, 0x1f25, 0x1f2c, 0x1f25, 0x1f25, 0x1f25, 0x1f25, 0x1f25,
+	0x1f31, 0x1f25, 0x1f25, 0x1f25, 0x1f25, 0x1f25, 0x1f36, 0x1f25,
+	0x1f25, 0x1f25, 0x1f25, 0x1f25, 0x1f3b, 0x080c, 0x0d7d, 0xa07c,
+	0x9422, 0xa080, 0x931b, 0x0098, 0xa094, 0x9422, 0xa098, 0x931b,
+	0x0070, 0xa0ac, 0x9422, 0xa0b0, 0x931b, 0x0048, 0xa0c4, 0x9422,
+	0xa0c8, 0x931b, 0x0020, 0xa0dc, 0x9422, 0xa0e0, 0x931b, 0x0630,
+	0x2300, 0x9405, 0x0160, 0x8a51, 0x0904, 0x2061, 0x8c60, 0x0804,
+	0x1eb1, 0xa004, 0x9045, 0x0904, 0x2061, 0x0804, 0x1e8c, 0x8a51,
+	0x0904, 0x2061, 0x8c60, 0x2c05, 0x9005, 0x1158, 0xa004, 0x9045,
+	0x0904, 0x2061, 0xa064, 0x90ec, 0x000f, 0x9de0, 0x1e62, 0x2c05,
+	0x2060, 0xa880, 0xc0fc, 0xa882, 0x0804, 0x2056, 0x2c05, 0x8422,
+	0x8420, 0x831a, 0x9399, 0x0000, 0xac2e, 0xab32, 0xdd9c, 0x1904,
+	0x1ff3, 0x9082, 0x001b, 0x0002, 0x1f8f, 0x1f8f, 0x1f91, 0x1f8f,
+	0x1f8f, 0x1f8f, 0x1f9f, 0x1f8f, 0x1f8f, 0x1f8f, 0x1fad, 0x1f8f,
+	0x1f8f, 0x1f8f, 0x1fbb, 0x1f8f, 0x1f8f, 0x1f8f, 0x1fc9, 0x1f8f,
+	0x1f8f, 0x1f8f, 0x1fd7, 0x1f8f, 0x1f8f, 0x1f8f, 0x1fe5, 0x080c,
+	0x0d7d, 0xa17c, 0x2400, 0x9122, 0xa180, 0x2300, 0x911b, 0x0a0c,
+	0x0d7d, 0xa074, 0x9420, 0xa078, 0x9319, 0x0804, 0x2051, 0xa18c,
+	0x2400, 0x9122, 0xa190, 0x2300, 0x911b, 0x0a0c, 0x0d7d, 0xa084,
+	0x9420, 0xa088, 0x9319, 0x0804, 0x2051, 0xa19c, 0x2400, 0x9122,
+	0xa1a0, 0x2300, 0x911b, 0x0a0c, 0x0d7d, 0xa094, 0x9420, 0xa098,
+	0x9319, 0x0804, 0x2051, 0xa1ac, 0x2400, 0x9122, 0xa1b0, 0x2300,
+	0x911b, 0x0a0c, 0x0d7d, 0xa0a4, 0x9420, 0xa0a8, 0x9319, 0x0804,
+	0x2051, 0xa1bc, 0x2400, 0x9122, 0xa1c0, 0x2300, 0x911b, 0x0a0c,
+	0x0d7d, 0xa0b4, 0x9420, 0xa0b8, 0x9319, 0x0804, 0x2051, 0xa1cc,
+	0x2400, 0x9122, 0xa1d0, 0x2300, 0x911b, 0x0a0c, 0x0d7d, 0xa0c4,
+	0x9420, 0xa0c8, 0x9319, 0x0804, 0x2051, 0xa1dc, 0x2400, 0x9122,
+	0xa1e0, 0x2300, 0x911b, 0x0a0c, 0x0d7d, 0xa0d4, 0x9420, 0xa0d8,
+	0x9319, 0x0804, 0x2051, 0x9082, 0x001b, 0x0002, 0x2011, 0x200f,
+	0x200f, 0x200f, 0x200f, 0x200f, 0x201e, 0x200f, 0x200f, 0x200f,
+	0x200f, 0x200f, 0x202b, 0x200f, 0x200f, 0x200f, 0x200f, 0x200f,
+	0x2038, 0x200f, 0x200f, 0x200f, 0x200f, 0x200f, 0x2045, 0x080c,
+	0x0d7d, 0xa17c, 0x2400, 0x9122, 0xa180, 0x2300, 0x911b, 0x0a0c,
+	0x0d7d, 0xa06c, 0x9420, 0xa070, 0x9319, 0x0498, 0xa194, 0x2400,
+	0x9122, 0xa198, 0x2300, 0x911b, 0x0a0c, 0x0d7d, 0xa084, 0x9420,
+	0xa088, 0x9319, 0x0430, 0xa1ac, 0x2400, 0x9122, 0xa1b0, 0x2300,
+	0x911b, 0x0a0c, 0x0d7d, 0xa09c, 0x9420, 0xa0a0, 0x9319, 0x00c8,
+	0xa1c4, 0x2400, 0x9122, 0xa1c8, 0x2300, 0x911b, 0x0a0c, 0x0d7d,
+	0xa0b4, 0x9420, 0xa0b8, 0x9319, 0x0060, 0xa1dc, 0x2400, 0x9122,
+	0xa1e0, 0x2300, 0x911b, 0x0a0c, 0x0d7d, 0xa0cc, 0x9420, 0xa0d0,
+	0x9319, 0xac1e, 0xab22, 0xa880, 0xc0fd, 0xa882, 0x2800, 0xa85a,
+	0x2c00, 0xa812, 0x2a00, 0xa816, 0x000e, 0x000e, 0x000e, 0x9006,
+	0x0028, 0x008e, 0x00de, 0x00ce, 0x9085, 0x0001, 0x0005, 0x00c6,
+	0x610c, 0x0016, 0x9026, 0x2410, 0x6004, 0x9420, 0x9291, 0x0000,
+	0x2c04, 0x9210, 0x9ce0, 0x0002, 0x918a, 0x0002, 0x1da8, 0x9284,
+	0x000f, 0x9405, 0x001e, 0x00ce, 0x0005, 0x7803, 0x0003, 0x780f,
+	0x0000, 0x6004, 0x7812, 0x2c04, 0x7816, 0x9ce0, 0x0002, 0x918a,
+	0x0002, 0x1db8, 0x0005, 0x2001, 0x0005, 0x2004, 0xd0bc, 0x190c,
+	0x0d76, 0xd094, 0x0110, 0x080c, 0x11e9, 0x0005, 0x0126, 0x2091,
+	0x2600, 0x2079, 0x0200, 0x2071, 0x0260, 0x2069, 0x1800, 0x7817,
+	0x0000, 0x789b, 0x0814, 0x78a3, 0x0406, 0x789f, 0x0410, 0x2009,
+	0x013b, 0x200b, 0x0400, 0x781b, 0x0002, 0x783b, 0x001f, 0x7837,
+	0x0020, 0x7803, 0x1600, 0x012e, 0x0005, 0x2091, 0x2600, 0x781c,
+	0xd0a4, 0x190c, 0x21be, 0x7900, 0xd1dc, 0x1118, 0x9084, 0x0006,
+	0x001a, 0x9084, 0x000e, 0x0002, 0x20dc, 0x20d4, 0x7ed0, 0x20d4,
+	0x20d6, 0x20d6, 0x20d6, 0x20d6, 0x7eb6, 0x20d4, 0x20d8, 0x20d4,
+	0x20d6, 0x20d4, 0x20d6, 0x20d4, 0x080c, 0x0d7d, 0x0031, 0x0020,
+	0x080c, 0x7eb6, 0x080c, 0x7ed0, 0x0005, 0x0006, 0x0016, 0x0026,
+	0x080c, 0xe733, 0x7930, 0x9184, 0x0003, 0x0510, 0x080c, 0xa888,
+	0x2001, 0x19f9, 0x2004, 0x9005, 0x01a0, 0x2001, 0x0133, 0x2004,
+	0x9005, 0x090c, 0x0d7d, 0x00c6, 0x2001, 0x19f9, 0x2064, 0x080c,
+	0xa8a4, 0x080c, 0xc430, 0x2009, 0x0040, 0x080c, 0x21c1, 0x00ce,
+	0x0408, 0x2009, 0x0040, 0x080c, 0x21c1, 0x080c, 0xa8a4, 0x00d0,
+	0x9184, 0x0014, 0x01a0, 0x6a00, 0x9286, 0x0003, 0x0160, 0x080c,
+	0x74c8, 0x1138, 0x080c, 0x77cc, 0x080c, 0x6024, 0x080c, 0x73f9,
+	0x0010, 0x080c, 0x5edf, 0x080c, 0x7f6e, 0x0041, 0x0018, 0x9184,
+	0x9540, 0x1dc8, 0x002e, 0x001e, 0x000e, 0x0005, 0x00e6, 0x0036,
+	0x0046, 0x0056, 0x2071, 0x1a6a, 0x080c, 0x1ac2, 0x005e, 0x004e,
+	0x003e, 0x00ee, 0x0005, 0x0126, 0x2091, 0x2e00, 0x2071, 0x1800,
+	0x7128, 0x2001, 0x196e, 0x2102, 0x2001, 0x1976, 0x2102, 0x2001,
+	0x013b, 0x2102, 0x2079, 0x0200, 0x2001, 0x0201, 0x789e, 0x78a3,
+	0x0200, 0x9198, 0x0007, 0x831c, 0x831c, 0x831c, 0x9398, 0x0005,
+	0x2320, 0x9182, 0x0204, 0x1230, 0x2011, 0x0008, 0x8423, 0x8423,
+	0x8423, 0x0488, 0x9182, 0x024c, 0x1240, 0x2011, 0x0007, 0x8403,
+	0x8003, 0x9400, 0x9400, 0x9420, 0x0430, 0x9182, 0x02bc, 0x1238,
+	0x2011, 0x0006, 0x8403, 0x8003, 0x9400, 0x9420, 0x00e0, 0x9182,
+	0x034c, 0x1230, 0x2011, 0x0005, 0x8403, 0x8003, 0x9420, 0x0098,
+	0x9182, 0x042c, 0x1228, 0x2011, 0x0004, 0x8423, 0x8423, 0x0058,
+	0x9182, 0x059c, 0x1228, 0x2011, 0x0003, 0x8403, 0x9420, 0x0018,
+	0x2011, 0x0002, 0x8423, 0x9482, 0x0228, 0x8002, 0x8020, 0x8301,
+	0x9402, 0x0110, 0x0208, 0x8321, 0x8217, 0x8203, 0x9405, 0x789a,
+	0x012e, 0x0005, 0x0006, 0x00d6, 0x2069, 0x0200, 0x6814, 0x9084,
+	0xffc0, 0x910d, 0x6916, 0x00de, 0x000e, 0x0005, 0x00d6, 0x2069,
+	0x0200, 0x9005, 0x6810, 0x0110, 0xc0a5, 0x0008, 0xc0a4, 0x6812,
+	0x00de, 0x0005, 0x0006, 0x00d6, 0x2069, 0x0200, 0x6810, 0x9084,
+	0xfff8, 0x910d, 0x6912, 0x00de, 0x000e, 0x0005, 0x7938, 0x080c,
+	0x0d76, 0x00f6, 0x2079, 0x0200, 0x7902, 0xa001, 0xa001, 0xa001,
+	0xa001, 0xa001, 0xa001, 0x7902, 0xa001, 0xa001, 0xa001, 0xa001,
+	0xa001, 0xa001, 0x00fe, 0x0005, 0x0126, 0x2091, 0x2800, 0x2061,
+	0x0100, 0x2071, 0x1800, 0x2009, 0x0000, 0x080c, 0x2a15, 0x080c,
+	0x292f, 0x2001, 0x199c, 0x2003, 0x0000, 0x2001, 0x199d, 0x2003,
+	0x0000, 0x080c, 0x2a86, 0x9006, 0x080c, 0x295e, 0x9006, 0x080c,
+	0x2941, 0x20a9, 0x0012, 0x1d04, 0x21f3, 0x2091, 0x6000, 0x1f04,
+	0x21f3, 0x602f, 0x0100, 0x602f, 0x0000, 0x6050, 0x9085, 0x0400,
+	0x9084, 0xdfff, 0x6052, 0x6224, 0x080c, 0x2a63, 0x080c, 0x264d,
+	0x2009, 0x00ef, 0x6132, 0x6136, 0x080c, 0x265d, 0x60e7, 0x0000,
+	0x61ea, 0x60e3, 0x0008, 0x604b, 0xf7f7, 0x6043, 0x0000, 0x602f,
+	0x0080, 0x602f, 0x0000, 0x6007, 0x349f, 0x00c6, 0x2061, 0x0140,
+	0x608b, 0x000b, 0x608f, 0x10b8, 0x6093, 0x0000, 0x6097, 0x0198,
+	0x00ce, 0x6004, 0x9085, 0x8000, 0x6006, 0x60bb, 0x0000, 0x20a9,
+	0x0018, 0x60bf, 0x0000, 0x1f04, 0x2231, 0x60bb, 0x0000, 0x60bf,
+	0x0108, 0x60bf, 0x0012, 0x60bf, 0x0405, 0x60bf, 0x0014, 0x60bf,
+	0x0320, 0x60bf, 0x0018, 0x601b, 0x00f0, 0x601f, 0x001e, 0x600f,
+	0x006b, 0x602b, 0x402c, 0x012e, 0x0005, 0x00f6, 0x2079, 0x0140,
+	0x78c3, 0x0080, 0x78c3, 0x0083, 0x78c3, 0x0000, 0x00fe, 0x0005,
+	0x2001, 0x1835, 0x2003, 0x0000, 0x2001, 0x1834, 0x2003, 0x0001,
+	0x0005, 0x0126, 0x2091, 0x2800, 0x0006, 0x0016, 0x0026, 0x6124,
+	0x6028, 0x910c, 0x0066, 0x2031, 0x1837, 0x2634, 0x96b4, 0x0028,
+	0x006e, 0x1138, 0x6020, 0xd1bc, 0x0120, 0xd0bc, 0x1168, 0xd0b4,
+	0x1198, 0x9184, 0x5e2c, 0x1118, 0x9184, 0x0007, 0x00aa, 0x9195,
+	0x0004, 0x9284, 0x0007, 0x0082, 0x0016, 0x2001, 0x0387, 0x200c,
+	0xd1a4, 0x001e, 0x0d70, 0x0c98, 0x0016, 0x2001, 0x0387, 0x200c,
+	0xd1b4, 0x001e, 0x0d30, 0x0c58, 0x229f, 0x229c, 0x229c, 0x229c,
+	0x229e, 0x229c, 0x229c, 0x229c, 0x080c, 0x0d7d, 0x0029, 0x002e,
+	0x001e, 0x000e, 0x012e, 0x0005, 0x00a6, 0x6124, 0x6028, 0xd09c,
+	0x0118, 0xd19c, 0x1904, 0x2519, 0xd1f4, 0x190c, 0x0d76, 0x080c,
+	0x74c8, 0x0904, 0x22fc, 0x080c, 0xcf51, 0x1120, 0x7000, 0x9086,
+	0x0003, 0x0580, 0x6024, 0x9084, 0x1800, 0x0560, 0x080c, 0x74eb,
+	0x0118, 0x080c, 0x74d9, 0x1530, 0x2011, 0x0020, 0x080c, 0x2a63,
+	0x6043, 0x0000, 0x080c, 0xcf51, 0x0168, 0x080c, 0x74eb, 0x1150,
+	0x2001, 0x19a6, 0x2003, 0x0001, 0x6027, 0x1800, 0x080c, 0x733e,
+	0x0804, 0x251c, 0x70a4, 0x9005, 0x1150, 0x70a7, 0x0001, 0x00d6,
+	0x2069, 0x0140, 0x080c, 0x751f, 0x00de, 0x1904, 0x251c, 0x080c,
+	0x77d6, 0x0428, 0x080c, 0x74eb, 0x1590, 0x6024, 0x9084, 0x1800,
+	0x1108, 0x0468, 0x080c, 0x77d6, 0x080c, 0x77cc, 0x080c, 0x6024,
+	0x080c, 0x73f9, 0x0804, 0x2519, 0xd1ac, 0x1508, 0x6024, 0xd0dc,
+	0x1170, 0xd0e4, 0x1178, 0xd0d4, 0x1190, 0xd0cc, 0x0130, 0x7098,
+	0x9086, 0x0028, 0x1110, 0x080c, 0x76ad, 0x0804, 0x2519, 0x080c,
+	0x77d1, 0x0048, 0x2001, 0x197c, 0x2003, 0x0002, 0x0020, 0x080c,
+	0x760a, 0x0804, 0x2519, 0x080c, 0x7750, 0x0804, 0x2519, 0x6220,
+	0xd1bc, 0x0138, 0xd2bc, 0x1904, 0x257e, 0xd2b4, 0x1904, 0x2590,
+	0x0000, 0xd1ac, 0x0904, 0x2426, 0x0036, 0x6328, 0xc3bc, 0x632a,
+	0x003e, 0x080c, 0x74c8, 0x11d0, 0x2011, 0x0020, 0x080c, 0x2a63,
+	0x0006, 0x0026, 0x0036, 0x080c, 0x74e2, 0x1158, 0x080c, 0x77cc,
+	0x080c, 0x6024, 0x080c, 0x73f9, 0x003e, 0x002e, 0x000e, 0x00ae,
+	0x0005, 0x003e, 0x002e, 0x000e, 0x080c, 0x749c, 0x0016, 0x0046,
+	0x00c6, 0x644c, 0x9486, 0xf0f0, 0x1138, 0x2061, 0x0100, 0x644a,
+	0x6043, 0x0090, 0x6043, 0x0010, 0x74da, 0x948c, 0xff00, 0x7038,
+	0xd084, 0x0178, 0x9186, 0xf800, 0x1160, 0x7048, 0xd084, 0x1148,
+	0xc085, 0x704a, 0x0036, 0x2418, 0x2011, 0x8016, 0x080c, 0x4b09,
+	0x003e, 0x080c, 0xcf4a, 0x1904, 0x23fd, 0x9196, 0xff00, 0x05a8,
+	0x7060, 0x9084, 0x00ff, 0x810f, 0x81ff, 0x0110, 0x9116, 0x0568,
+	0x7130, 0xd184, 0x1550, 0x080c, 0x335c, 0x0128, 0xc18d, 0x7132,
+	0x080c, 0x6a62, 0x1510, 0x6240, 0x9294, 0x0010, 0x0130, 0x6248,
+	0x9294, 0xff00, 0x9296, 0xff00, 0x01c0, 0x7030, 0xd08c, 0x0904,
+	0x23fd, 0x7038, 0xd08c, 0x1140, 0x2001, 0x180c, 0x200c, 0xd1ac,
+	0x1904, 0x23fd, 0xc1ad, 0x2102, 0x0036, 0x73d8, 0x2011, 0x8013,
+	0x080c, 0x4b09, 0x003e, 0x0804, 0x23fd, 0x7038, 0xd08c, 0x1140,
+	0x2001, 0x180c, 0x200c, 0xd1ac, 0x1904, 0x23fd, 0xc1ad, 0x2102,
+	0x0036, 0x73d8, 0x2011, 0x8013, 0x080c, 0x4b09, 0x003e, 0x7130,
+	0xc185, 0x7132, 0x2011, 0x1848, 0x220c, 0xd1a4, 0x01f0, 0x0016,
+	0x2009, 0x0001, 0x2011, 0x0100, 0x080c, 0x88ce, 0x2019, 0x000e,
+	0x00c6, 0x2061, 0x0000, 0x080c, 0xe249, 0x00ce, 0x9484, 0x00ff,
+	0x9080, 0x3368, 0x200d, 0x918c, 0xff00, 0x810f, 0x2120, 0x9006,
+	0x2009, 0x000e, 0x080c, 0xe2d9, 0x001e, 0x0016, 0x2009, 0x0002,
+	0x2019, 0x0004, 0x080c, 0x31b4, 0x001e, 0x0078, 0x0156, 0x00b6,
+	0x20a9, 0x007f, 0x900e, 0x080c, 0x6620, 0x1110, 0x080c, 0x603e,
+	0x8108, 0x1f04, 0x23f3, 0x00be, 0x015e, 0x00ce, 0x004e, 0x080c,
+	0xa888, 0x080c, 0xab50, 0x080c, 0xa8a4, 0x60e3, 0x0000, 0x001e,
+	0x2001, 0x1800, 0x2014, 0x9296, 0x0004, 0x1170, 0xd19c, 0x11b0,
+	0x2011, 0x180c, 0x2214, 0xd29c, 0x1120, 0x6204, 0x9295, 0x0002,
+	0x6206, 0x6228, 0xc29d, 0x622a, 0x2003, 0x0001, 0x2001, 0x1826,
+	0x2003, 0x0000, 0x2011, 0x0020, 0x080c, 0x2a63, 0xd194, 0x0904,
+	0x2519, 0x0016, 0x080c, 0xa888, 0x6220, 0xd2b4, 0x0904, 0x24b4,
+	0x080c, 0x86d5, 0x080c, 0x9e16, 0x2011, 0x0004, 0x080c, 0x2a63,
+	0x00f6, 0x2019, 0x19f2, 0x2304, 0x907d, 0x0904, 0x2481, 0x7804,
+	0x9086, 0x0032, 0x15f0, 0x00d6, 0x00c6, 0x00e6, 0x0096, 0x2069,
+	0x0140, 0x782c, 0x685e, 0x7808, 0x685a, 0x6043, 0x0002, 0x2001,
+	0x0003, 0x8001, 0x1df0, 0x6043, 0x0000, 0x2001, 0x003c, 0x8001,
+	0x1df0, 0x080c, 0x2a39, 0x2001, 0x001e, 0x8001, 0x0240, 0x20a9,
+	0x0009, 0x080c, 0x29f0, 0x6904, 0xd1dc, 0x1140, 0x0cb0, 0x2001,
+	0x0100, 0x080c, 0x2a29, 0x9006, 0x080c, 0x2a29, 0x080c, 0x95c6,
+	0x080c, 0xa8a4, 0x7814, 0x2048, 0xa867, 0x0103, 0x2f60, 0x080c,
+	0xabdf, 0x009e, 0x00ee, 0x00ce, 0x00de, 0x00fe, 0x001e, 0x00ae,
+	0x0005, 0x00fe, 0x00d6, 0x2069, 0x0140, 0x6804, 0x9084, 0x4000,
+	0x0110, 0x080c, 0x2a39, 0x00de, 0x00c6, 0x2061, 0x19e6, 0x6034,
+	0x080c, 0xcf51, 0x0120, 0x909a, 0x0003, 0x1258, 0x0018, 0x909a,
+	0x00c8, 0x1238, 0x8000, 0x6036, 0x00ce, 0x080c, 0x9dee, 0x0804,
+	0x2516, 0x2061, 0x0100, 0x62c0, 0x080c, 0xa7b9, 0x2019, 0x19f2,
+	0x2304, 0x9065, 0x0130, 0x6003, 0x0001, 0x2009, 0x0027, 0x080c,
+	0xac7c, 0x00ce, 0x0804, 0x2516, 0xd2bc, 0x0904, 0x24f9, 0x080c,
+	0x86e2, 0x2011, 0x0004, 0x080c, 0x2a63, 0x00d6, 0x2069, 0x0140,
+	0x6804, 0x9084, 0x4000, 0x0110, 0x080c, 0x2a39, 0x00de, 0x00c6,
+	0x2061, 0x19e6, 0x6050, 0x080c, 0xcf51, 0x0120, 0x909a, 0x0003,
+	0x1668, 0x0018, 0x909a, 0x00c8, 0x1648, 0x8000, 0x6052, 0x604c,
+	0x00ce, 0x9005, 0x05d8, 0x2009, 0x07d0, 0x080c, 0x86da, 0x9080,
+	0x0008, 0x2004, 0x9086, 0x0006, 0x1138, 0x2009, 0x1984, 0x2011,
+	0x0012, 0x080c, 0x2a72, 0x0450, 0x9080, 0x0008, 0x2004, 0x9086,
+	0x0009, 0x0d98, 0x2009, 0x1984, 0x2011, 0x0016, 0x080c, 0x2a72,
+	0x00e8, 0x2011, 0x0004, 0x080c, 0x2a63, 0x00c0, 0x0036, 0x2019,
+	0x0001, 0x080c, 0xa0fa, 0x003e, 0x2019, 0x19f9, 0x2304, 0x9065,
+	0x0160, 0x2009, 0x004f, 0x6020, 0x9086, 0x0009, 0x1110, 0x2009,
+	0x004f, 0x6003, 0x0003, 0x080c, 0xac7c, 0x00ce, 0x080c, 0xa8a4,
+	0x001e, 0xd19c, 0x0904, 0x2577, 0x7038, 0xd0ac, 0x1538, 0x0016,
+	0x0156, 0x2011, 0x0008, 0x080c, 0x2a63, 0x6050, 0xc0e5, 0x6052,
+	0x20a9, 0x0367, 0x1f04, 0x2544, 0x1d04, 0x252c, 0x080c, 0x8709,
+	0x6020, 0xd09c, 0x1db8, 0x00f6, 0x2079, 0x0100, 0x080c, 0x29a0,
+	0x00fe, 0x1d80, 0x6050, 0xc0e4, 0x6052, 0x2011, 0x0008, 0x080c,
+	0x2a63, 0x015e, 0x001e, 0x0498, 0x015e, 0x001e, 0x0016, 0x6028,
+	0xc09c, 0x602a, 0x080c, 0xa888, 0x080c, 0xab50, 0x080c, 0xa8a4,
+	0x60e3, 0x0000, 0x080c, 0xe712, 0x080c, 0xe72d, 0x080c, 0x56d9,
+	0xd0fc, 0x1138, 0x080c, 0xcf4a, 0x1120, 0x9085, 0x0001, 0x080c,
+	0x750f, 0x9006, 0x080c, 0x2a29, 0x2009, 0x0002, 0x080c, 0x2a15,
+	0x00e6, 0x2071, 0x1800, 0x7003, 0x0004, 0x080c, 0x0eb4, 0x00ee,
+	0x2011, 0x0008, 0x080c, 0x2a63, 0x080c, 0x0bc3, 0x001e, 0x918c,
+	0xffd0, 0x2110, 0x080c, 0x2a63, 0x00ae, 0x0005, 0x0016, 0x2001,
+	0x0387, 0x200c, 0xd1a4, 0x001e, 0x0904, 0x2329, 0x0016, 0x2009,
+	0x258a, 0x00c0, 0x2001, 0x0387, 0x2003, 0x1000, 0x001e, 0x0c38,
+	0x0016, 0x2001, 0x0387, 0x200c, 0xd1b4, 0x001e, 0x0904, 0x2329,
+	0x0016, 0x2009, 0x259c, 0x0030, 0x2001, 0x0387, 0x2003, 0x4000,
+	0x001e, 0x08a8, 0x6028, 0xc0bc, 0x602a, 0x2001, 0x0156, 0x2003,
+	0xbc91, 0x8000, 0x2003, 0xffff, 0x6043, 0x0001, 0x080c, 0x2a0f,
+	0x2011, 0x0080, 0x080c, 0x2a63, 0x6017, 0x0000, 0x6043, 0x0000,
+	0x0817, 0x0006, 0x0016, 0x0026, 0x0036, 0x00e6, 0x00f6, 0x0126,
+	0x2091, 0x8000, 0x2071, 0x1800, 0x71d0, 0x70d2, 0x9116, 0x0904,
+	0x260c, 0x81ff, 0x01a0, 0x2009, 0x0000, 0x080c, 0x2a15, 0x2011,
+	0x8011, 0x2019, 0x010e, 0x231c, 0x939e, 0x0007, 0x1118, 0x2019,
+	0x0001, 0x0010, 0x2019, 0x0000, 0x080c, 0x4b09, 0x0468, 0x2001,
+	0x19a7, 0x200c, 0x81ff, 0x1140, 0x2001, 0x0109, 0x2004, 0xd0b4,
+	0x0118, 0x2019, 0x0003, 0x0008, 0x2118, 0x2011, 0x8012, 0x080c,
+	0x4b09, 0x080c, 0x0eb4, 0x080c, 0x56d9, 0xd0fc, 0x11a8, 0x080c,
+	0xcf4a, 0x1190, 0x00c6, 0x080c, 0x26a8, 0x080c, 0xa888, 0x080c,
+	0xa055, 0x080c, 0xa8a4, 0x2061, 0x0100, 0x2019, 0x0028, 0x2009,
+	0x0002, 0x080c, 0x31b4, 0x00ce, 0x012e, 0x00fe, 0x00ee, 0x003e,
+	0x002e, 0x001e, 0x000e, 0x0005, 0x2028, 0x918c, 0x00ff, 0x2130,
+	0x9094, 0xff00, 0x11f0, 0x2011, 0x1837, 0x2214, 0xd2ac, 0x11c8,
+	0x81ff, 0x01e8, 0x2011, 0x181f, 0x2204, 0x9106, 0x1190, 0x2011,
+	0x1820, 0x2214, 0x9294, 0xff00, 0x9584, 0xff00, 0x9206, 0x1148,
+	0x2011, 0x1820, 0x2214, 0x9294, 0x00ff, 0x9584, 0x00ff, 0x9206,
+	0x1120, 0x2500, 0x080c, 0x81de, 0x0048, 0x9584, 0x00ff, 0x9080,
+	0x3368, 0x200d, 0x918c, 0xff00, 0x810f, 0x9006, 0x0005, 0x9080,
+	0x3368, 0x200d, 0x918c, 0x00ff, 0x0005, 0x00d6, 0x2069, 0x0140,
+	0x2001, 0x1818, 0x2003, 0x00ef, 0x20a9, 0x0010, 0x9006, 0x6852,
+	0x6856, 0x1f04, 0x2658, 0x00de, 0x0005, 0x0006, 0x00d6, 0x0026,
+	0x2069, 0x0140, 0x2001, 0x1818, 0x2102, 0x8114, 0x8214, 0x8214,
+	0x8214, 0x20a9, 0x0010, 0x6853, 0x0000, 0x9006, 0x82ff, 0x1128,
+	0x9184, 0x000f, 0x9080, 0xe741, 0x2005, 0x6856, 0x8211, 0x1f04,
+	0x266d, 0x002e, 0x00de, 0x000e, 0x0005, 0x00c6, 0x2061, 0x1800,
+	0x6030, 0x0110, 0xc09d, 0x0008, 0xc09c, 0x6032, 0x00ce, 0x0005,
+	0x0156, 0x00d6, 0x0026, 0x0016, 0x0006, 0x2069, 0x0140, 0x6980,
+	0x9116, 0x0180, 0x9112, 0x1230, 0x8212, 0x8210, 0x22a8, 0x2001,
+	0x0402, 0x0018, 0x22a8, 0x2001, 0x0404, 0x680e, 0x1f04, 0x269d,
+	0x680f, 0x0000, 0x000e, 0x001e, 0x002e, 0x00de, 0x015e, 0x0005,
+	0x080c, 0x56d5, 0xd0c4, 0x0150, 0xd0a4, 0x0140, 0x9006, 0x0046,
+	0x2020, 0x2009, 0x002e, 0x080c, 0xe2d9, 0x004e, 0x0005, 0x00f6,
+	0x0016, 0x0026, 0x2079, 0x0140, 0x78c4, 0xd0dc, 0x0904, 0x2714,
+	0x080c, 0x2990, 0x0660, 0x9084, 0x0700, 0x908e, 0x0600, 0x1120,
+	0x2011, 0x4000, 0x900e, 0x0458, 0x908e, 0x0500, 0x1120, 0x2011,
+	0x8000, 0x900e, 0x0420, 0x908e, 0x0400, 0x1120, 0x9016, 0x2009,
+	0x0001, 0x00e8, 0x908e, 0x0300, 0x1120, 0x9016, 0x2009, 0x0002,
+	0x00b0, 0x908e, 0x0200, 0x1120, 0x9016, 0x2009, 0x0004, 0x0078,
+	0x908e, 0x0100, 0x1548, 0x9016, 0x2009, 0x0008, 0x0040, 0x9084,
+	0x0700, 0x908e, 0x0300, 0x1500, 0x2011, 0x0030, 0x0058, 0x2300,
+	0x9080, 0x0020, 0x2018, 0x080c, 0x9148, 0x928c, 0xff00, 0x0110,
+	0x2011, 0x00ff, 0x2200, 0x8007, 0x9085, 0x004c, 0x78c2, 0x2009,
+	0x0138, 0x220a, 0x080c, 0x74c8, 0x1118, 0x2009, 0x196c, 0x220a,
+	0x002e, 0x001e, 0x00fe, 0x0005, 0x78c3, 0x0000, 0x0cc8, 0x0126,
+	0x2091, 0x2800, 0x0006, 0x0016, 0x0026, 0x2001, 0x0170, 0x200c,
+	0x8000, 0x2014, 0x9184, 0x0003, 0x0110, 0x080c, 0x0d76, 0x002e,
+	0x001e, 0x000e, 0x012e, 0x0005, 0x2001, 0x0171, 0x2004, 0xd0dc,
+	0x0168, 0x2001, 0x0170, 0x200c, 0x918c, 0x00ff, 0x918e, 0x004c,
+	0x1128, 0x200c, 0x918c, 0xff00, 0x810f, 0x0005, 0x900e, 0x2001,
+	0x0227, 0x2004, 0x8007, 0x9084, 0x00ff, 0x8004, 0x9108, 0x2001,
+	0x0226, 0x2004, 0x8007, 0x9084, 0x00ff, 0x8004, 0x9108, 0x0005,
+	0x0018, 0x000c, 0x0018, 0x0020, 0x1000, 0x0800, 0x1000, 0x1800,
+	0x0156, 0x0006, 0x0016, 0x0026, 0x00e6, 0x2001, 0x198f, 0x2004,
+	0x908a, 0x0007, 0x1a0c, 0x0d7d, 0x0033, 0x00ee, 0x002e, 0x001e,
+	0x000e, 0x015e, 0x0005, 0x2772, 0x2790, 0x27b4, 0x27b6, 0x27df,
+	0x27e1, 0x27e3, 0x2001, 0x0001, 0x080c, 0x25b9, 0x080c, 0x29da,
+	0x2001, 0x1991, 0x2003, 0x0000, 0x7828, 0x9084, 0xe1d7, 0x782a,
+	0x9006, 0x20a9, 0x0009, 0x080c, 0x29ac, 0x2001, 0x198f, 0x2003,
+	0x0006, 0x2009, 0x001e, 0x2011, 0x27e4, 0x080c, 0x86e7, 0x0005,
+	0x2009, 0x1994, 0x200b, 0x0000, 0x2001, 0x1999, 0x2003, 0x0036,
+	0x2001, 0x1998, 0x2003, 0x002a, 0x2001, 0x1991, 0x2003, 0x0001,
+	0x9006, 0x080c, 0x2941, 0x2001, 0xffff, 0x20a9, 0x0009, 0x080c,
+	0x29ac, 0x2001, 0x198f, 0x2003, 0x0006, 0x2009, 0x001e, 0x2011,
+	0x27e4, 0x080c, 0x86e7, 0x0005, 0x080c, 0x0d7d, 0x2001, 0x1999,
+	0x2003, 0x0036, 0x2001, 0x1991, 0x2003, 0x0003, 0x7a38, 0x9294,
+	0x0005, 0x9296, 0x0004, 0x0110, 0x9006, 0x0010, 0x2001, 0x0001,
+	0x080c, 0x2941, 0x2001, 0x1995, 0x2003, 0x0000, 0x2001, 0xffff,
+	0x20a9, 0x0009, 0x080c, 0x29ac, 0x2001, 0x198f, 0x2003, 0x0006,
+	0x2009, 0x001e, 0x2011, 0x27e4, 0x080c, 0x86e7, 0x0005, 0x080c,
+	0x0d7d, 0x080c, 0x0d7d, 0x0005, 0x0006, 0x0016, 0x0026, 0x00e6,
+	0x00f6, 0x0156, 0x0126, 0x2091, 0x8000, 0x2079, 0x0100, 0x2001,
+	0x1991, 0x2004, 0x908a, 0x0007, 0x1a0c, 0x0d7d, 0x0043, 0x012e,
+	0x015e, 0x00fe, 0x00ee, 0x002e, 0x001e, 0x000e, 0x0005, 0x2806,
+	0x2826, 0x2866, 0x2896, 0x28ba, 0x28ca, 0x28cc, 0x080c, 0x29a0,
+	0x11b0, 0x7850, 0x9084, 0xefff, 0x7852, 0x2009, 0x1997, 0x2104,
+	0x7a38, 0x9294, 0x0005, 0x9296, 0x0004, 0x0110, 0xc08d, 0x0008,
+	0xc085, 0x200a, 0x2001, 0x198f, 0x2003, 0x0001, 0x0030, 0x080c,
+	0x28f0, 0x2001, 0xffff, 0x080c, 0x2781, 0x0005, 0x080c, 0x28ce,
+	0x05e0, 0x2009, 0x1998, 0x2104, 0x8001, 0x200a, 0x080c, 0x29a0,
+	0x1178, 0x7850, 0x9084, 0xefff, 0x7852, 0x7a38, 0x9294, 0x0005,
+	0x9296, 0x0005, 0x0518, 0x2009, 0x1997, 0x2104, 0xc085, 0x200a,
+	0x2009, 0x1994, 0x2104, 0x8000, 0x200a, 0x9086, 0x0005, 0x0118,
+	0x080c, 0x28d6, 0x00c0, 0x200b, 0x0000, 0x7a38, 0x9294, 0x0006,
 	0x9296, 0x0004, 0x0110, 0x9006, 0x0010, 0x2001, 0x0001, 0x080c,
-	0x2928, 0x2001, 0x1996, 0x2003, 0x0000, 0x2001, 0xffff, 0x20a9,
-	0x0009, 0x080c, 0x298d, 0x2001, 0x1990, 0x2003, 0x0006, 0x2009,
-	0x001e, 0x2011, 0x27cb, 0x080c, 0x8708, 0x0005, 0x080c, 0x0d7d,
-	0x080c, 0x0d7d, 0x0005, 0x0006, 0x0016, 0x0026, 0x00e6, 0x00f6,
-	0x0156, 0x0126, 0x2091, 0x8000, 0x2079, 0x0100, 0x2001, 0x1992,
-	0x2004, 0x908a, 0x0007, 0x1a0c, 0x0d7d, 0x0043, 0x012e, 0x015e,
-	0x00fe, 0x00ee, 0x002e, 0x001e, 0x000e, 0x0005, 0x27ed, 0x280d,
-	0x284d, 0x287d, 0x28a1, 0x28b1, 0x28b3, 0x080c, 0x2981, 0x11b0,
-	0x7850, 0x9084, 0xefff, 0x7852, 0x2009, 0x1998, 0x2104, 0x7a38,
-	0x9294, 0x0005, 0x9296, 0x0004, 0x0110, 0xc08d, 0x0008, 0xc085,
-	0x200a, 0x2001, 0x1990, 0x2003, 0x0001, 0x0030, 0x080c, 0x28d7,
-	0x2001, 0xffff, 0x080c, 0x2768, 0x0005, 0x080c, 0x28b5, 0x05e0,
-	0x2009, 0x1999, 0x2104, 0x8001, 0x200a, 0x080c, 0x2981, 0x1178,
-	0x7850, 0x9084, 0xefff, 0x7852, 0x7a38, 0x9294, 0x0005, 0x9296,
-	0x0005, 0x0518, 0x2009, 0x1998, 0x2104, 0xc085, 0x200a, 0x2009,
-	0x1995, 0x2104, 0x8000, 0x200a, 0x9086, 0x0005, 0x0118, 0x080c,
-	0x28bd, 0x00c0, 0x200b, 0x0000, 0x7a38, 0x9294, 0x0006, 0x9296,
-	0x0004, 0x0110, 0x9006, 0x0010, 0x2001, 0x0001, 0x080c, 0x2945,
-	0x2001, 0x1992, 0x2003, 0x0002, 0x0028, 0x2001, 0x1990, 0x2003,
-	0x0003, 0x0010, 0x080c, 0x278a, 0x0005, 0x080c, 0x28b5, 0x0560,
-	0x2009, 0x1999, 0x2104, 0x8001, 0x200a, 0x080c, 0x2981, 0x1168,
-	0x7850, 0x9084, 0xefff, 0x7852, 0x2001, 0x1990, 0x2003, 0x0003,
-	0x2001, 0x1991, 0x2003, 0x0000, 0x00b8, 0x2009, 0x1999, 0x2104,
-	0x9005, 0x1118, 0x080c, 0x28fa, 0x0010, 0x080c, 0x28ca, 0x080c,
-	0x28bd, 0x2009, 0x1995, 0x200b, 0x0000, 0x2001, 0x1992, 0x2003,
-	0x0001, 0x080c, 0x278a, 0x0000, 0x0005, 0x04b9, 0x0508, 0x080c,
-	0x2981, 0x11b8, 0x7850, 0x9084, 0xefff, 0x7852, 0x2009, 0x1996,
-	0x2104, 0x8000, 0x200a, 0x9086, 0x0007, 0x0108, 0x0078, 0x2001,
-	0x199b, 0x2003, 0x000a, 0x2009, 0x1998, 0x2104, 0xc0fd, 0x200a,
-	0x0038, 0x0419, 0x2001, 0x1992, 0x2003, 0x0004, 0x080c, 0x27b5,
-	0x0005, 0x0099, 0x0168, 0x080c, 0x2981, 0x1138, 0x7850, 0x9084,
-	0xefff, 0x7852, 0x080c, 0x27a1, 0x0018, 0x0079, 0x080c, 0x27b5,
-	0x0005, 0x080c, 0x0d7d, 0x080c, 0x0d7d, 0x2009, 0x199a, 0x2104,
-	0x8001, 0x200a, 0x090c, 0x2916, 0x0005, 0x7a38, 0x9294, 0x0005,
-	0x9296, 0x0005, 0x0110, 0x9006, 0x0010, 0x2001, 0x0001, 0x080c,
-	0x2945, 0x0005, 0x7a38, 0x9294, 0x0006, 0x9296, 0x0006, 0x0110,
-	0x9006, 0x0010, 0x2001, 0x0001, 0x080c, 0x2928, 0x0005, 0x2009,
-	0x1995, 0x2104, 0x8000, 0x200a, 0x9086, 0x0005, 0x0108, 0x0068,
-	0x200b, 0x0000, 0x7a38, 0x9294, 0x0006, 0x9296, 0x0006, 0x0110,
-	0x9006, 0x0010, 0x2001, 0x0001, 0x04d9, 0x7a38, 0x9294, 0x0005,
-	0x9296, 0x0005, 0x0110, 0x9006, 0x0010, 0x2001, 0x0001, 0x080c,
-	0x2945, 0x0005, 0x0086, 0x2001, 0x1998, 0x2004, 0x9084, 0x7fff,
-	0x090c, 0x0d7d, 0x2009, 0x1997, 0x2144, 0x8846, 0x280a, 0x9844,
-	0x0dd8, 0xd08c, 0x1120, 0xd084, 0x1120, 0x080c, 0x0d7d, 0x9006,
-	0x0010, 0x2001, 0x0001, 0x00a1, 0x008e, 0x0005, 0x0006, 0x0156,
-	0x2001, 0x1990, 0x20a9, 0x0009, 0x2003, 0x0000, 0x8000, 0x1f04,
-	0x291c, 0x2001, 0x1997, 0x2003, 0x8000, 0x015e, 0x000e, 0x0005,
-	0x00f6, 0x2079, 0x0100, 0x9085, 0x0000, 0x0158, 0x7838, 0x9084,
-	0xfff9, 0x9085, 0x0004, 0x783a, 0x2009, 0x199d, 0x210c, 0x795a,
-	0x0050, 0x7838, 0x9084, 0xfffb, 0x9085, 0x0006, 0x783a, 0x2009,
-	0x199e, 0x210c, 0x795a, 0x00fe, 0x0005, 0x00f6, 0x2079, 0x0100,
-	0x9085, 0x0000, 0x0158, 0x7838, 0x9084, 0xfffa, 0x9085, 0x0004,
-	0x783a, 0x7850, 0x9084, 0xfff0, 0x7852, 0x00c8, 0x7838, 0x9084,
-	0xfffb, 0x9085, 0x0005, 0x783a, 0x7850, 0x9084, 0xfff0, 0x0016,
-	0x2009, 0x0003, 0x210c, 0x918c, 0x0600, 0x918e, 0x0400, 0x0118,
-	0x9085, 0x000a, 0x0010, 0x9085, 0x0000, 0x001e, 0x7852, 0x00fe,
-	0x0005, 0x0006, 0x2001, 0x0100, 0x2004, 0x9082, 0x0007, 0x000e,
-	0x0005, 0x0006, 0x2001, 0x0100, 0x2004, 0x9082, 0x0009, 0x000e,
-	0x0005, 0x0156, 0x20a9, 0x0064, 0x7820, 0x080c, 0x29f0, 0xd09c,
-	0x1110, 0x1f04, 0x2984, 0x015e, 0x0005, 0x0126, 0x0016, 0x0006,
-	0x2091, 0x8000, 0x000e, 0x2008, 0x9186, 0x0000, 0x1118, 0x783b,
-	0x0007, 0x0090, 0x9186, 0x0001, 0x1118, 0x783b, 0x0006, 0x0060,
-	0x9186, 0x0002, 0x1118, 0x783b, 0x0005, 0x0030, 0x9186, 0x0003,
-	0x1118, 0x783b, 0x0004, 0x0000, 0x0006, 0x1d04, 0x29ad, 0x080c,
-	0x872a, 0x1f04, 0x29ad, 0x7850, 0x9085, 0x1000, 0x7852, 0x000e,
-	0x001e, 0x012e, 0x0005, 0x080c, 0x2aab, 0x0005, 0x0006, 0x0156,
-	0x00f6, 0x2079, 0x0100, 0x20a9, 0x000a, 0x7854, 0xd0ac, 0x1100,
-	0x7854, 0xd08c, 0x1110, 0x1f04, 0x29c8, 0x00fe, 0x015e, 0x000e,
-	0x0005, 0x1d04, 0x29d1, 0x080c, 0x872a, 0x1f04, 0x29d1, 0x0005,
-	0x0006, 0x2001, 0x199c, 0x2004, 0x9086, 0x0000, 0x000e, 0x0005,
-	0x0006, 0x2001, 0x199c, 0x2004, 0x9086, 0x0001, 0x000e, 0x0005,
-	0x0006, 0x2001, 0x199c, 0x2004, 0x9086, 0x0002, 0x000e, 0x0005,
-	0xa001, 0xa001, 0xa001, 0xa001, 0xa001, 0x0005, 0x0006, 0x2001,
-	0x19a8, 0x2102, 0x000e, 0x0005, 0x2009, 0x0171, 0x2104, 0xd0dc,
-	0x0140, 0x2009, 0x0170, 0x2104, 0x200b, 0x0080, 0xa001, 0xa001,
-	0x200a, 0x0005, 0x0016, 0x0026, 0x080c, 0x7503, 0x0108, 0xc0bc,
-	0x2009, 0x0140, 0x2114, 0x9294, 0x0001, 0x9215, 0x220a, 0x002e,
-	0x001e, 0x0005, 0x0016, 0x0026, 0x2009, 0x0140, 0x2114, 0x9294,
-	0x0001, 0x9285, 0x1000, 0x200a, 0x220a, 0x002e, 0x001e, 0x0005,
-	0x0016, 0x0026, 0x2009, 0x0140, 0x2114, 0x9294, 0x0001, 0x9215,
-	0x220a, 0x002e, 0x001e, 0x0005, 0x0006, 0x0016, 0x2009, 0x0140,
-	0x2104, 0x1128, 0x080c, 0x7503, 0x0110, 0xc0bc, 0x0008, 0xc0bd,
-	0x200a, 0x001e, 0x000e, 0x0005, 0x00f6, 0x2079, 0x0380, 0x7843,
-	0x0101, 0x7844, 0xd084, 0x1de8, 0x2001, 0x0109, 0x2202, 0x7843,
-	0x0100, 0x00fe, 0x0005, 0x00f6, 0x2079, 0x0380, 0x7843, 0x0202,
-	0x7844, 0xd08c, 0x1de8, 0x2079, 0x0100, 0x7814, 0x9104, 0x9205,
-	0x7a16, 0x2079, 0x0380, 0x7843, 0x0200, 0x00fe, 0x0005, 0x0016,
-	0x0026, 0x0036, 0x00c6, 0x2061, 0x0100, 0x6050, 0x9084, 0xfbff,
-	0x9085, 0x0040, 0x6052, 0x20a9, 0x0002, 0x080c, 0x29d1, 0x6050,
-	0x9085, 0x0400, 0x9084, 0xff9f, 0x6052, 0x20a9, 0x0005, 0x080c,
-	0x29d1, 0x6054, 0xd0bc, 0x090c, 0x0d7d, 0x20a9, 0x0005, 0x080c,
-	0x29d1, 0x6054, 0xd0ac, 0x090c, 0x0d7d, 0x2009, 0x19af, 0x9084,
-	0x7e00, 0x8007, 0x8004, 0x8004, 0x200a, 0x9085, 0x0000, 0x605a,
-	0x2009, 0x199d, 0x2011, 0x199e, 0x6358, 0x939c, 0x38df, 0x2320,
-	0x939d, 0x0000, 0x94a5, 0x0000, 0x230a, 0x2412, 0x00ce, 0x003e,
-	0x002e, 0x001e, 0x0005, 0x0006, 0x00c6, 0x2061, 0x0100, 0x6050,
-	0xc0cd, 0x6052, 0x00ce, 0x000e, 0x0005, 0x2fb1, 0x2fb1, 0x2bb5,
-	0x2bb5, 0x2bc1, 0x2bc1, 0x2bcd, 0x2bcd, 0x2bdb, 0x2bdb, 0x2be7,
-	0x2be7, 0x2bf5, 0x2bf5, 0x2c03, 0x2c03, 0x2c15, 0x2c15, 0x2c21,
-	0x2c21, 0x2c2f, 0x2c2f, 0x2c4d, 0x2c4d, 0x2c6d, 0x2c6d, 0x2c3d,
-	0x2c3d, 0x2c5d, 0x2c5d, 0x2c7b, 0x2c7b, 0x2c13, 0x2c13, 0x2c13,
-	0x2c13, 0x2c13, 0x2c13, 0x2c13, 0x2c13, 0x2c13, 0x2c13, 0x2c13,
-	0x2c13, 0x2c13, 0x2c13, 0x2c13, 0x2c13, 0x2c13, 0x2c13, 0x2c13,
-	0x2c13, 0x2c13, 0x2c13, 0x2c13, 0x2c13, 0x2c13, 0x2c13, 0x2c13,
-	0x2c13, 0x2c13, 0x2c13, 0x2c13, 0x2c13, 0x2c8d, 0x2c8d, 0x2c99,
-	0x2c99, 0x2ca7, 0x2ca7, 0x2cb5, 0x2cb5, 0x2cc5, 0x2cc5, 0x2cd3,
-	0x2cd3, 0x2ce3, 0x2ce3, 0x2cf3, 0x2cf3, 0x2d05, 0x2d05, 0x2d13,
-	0x2d13, 0x2d23, 0x2d23, 0x2d45, 0x2d45, 0x2d69, 0x2d69, 0x2d33,
-	0x2d33, 0x2d57, 0x2d57, 0x2d79, 0x2d79, 0x2c13, 0x2c13, 0x2c13,
-	0x2c13, 0x2c13, 0x2c13, 0x2c13, 0x2c13, 0x2c13, 0x2c13, 0x2c13,
-	0x2c13, 0x2c13, 0x2c13, 0x2c13, 0x2c13, 0x2c13, 0x2c13, 0x2c13,
-	0x2c13, 0x2c13, 0x2c13, 0x2c13, 0x2c13, 0x2c13, 0x2c13, 0x2c13,
-	0x2c13, 0x2c13, 0x2c13, 0x2c13, 0x2c13, 0x2d8d, 0x2d8d, 0x2d99,
-	0x2d99, 0x2da7, 0x2da7, 0x2db5, 0x2db5, 0x2dc5, 0x2dc5, 0x2dd3,
-	0x2dd3, 0x2de3, 0x2de3, 0x2df3, 0x2df3, 0x2e05, 0x2e05, 0x2e13,
-	0x2e13, 0x2e23, 0x2e23, 0x2e33, 0x2e33, 0x2e45, 0x2e45, 0x2e55,
-	0x2e55, 0x2e67, 0x2e67, 0x2e79, 0x2e79, 0x2c13, 0x2c13, 0x2c13,
-	0x2c13, 0x2c13, 0x2c13, 0x2c13, 0x2c13, 0x2c13, 0x2c13, 0x2c13,
-	0x2c13, 0x2c13, 0x2c13, 0x2c13, 0x2c13, 0x2c13, 0x2c13, 0x2c13,
-	0x2c13, 0x2c13, 0x2c13, 0x2c13, 0x2c13, 0x2c13, 0x2c13, 0x2c13,
-	0x2c13, 0x2c13, 0x2c13, 0x2c13, 0x2c13, 0x2e8d, 0x2e8d, 0x2e9b,
-	0x2e9b, 0x2eab, 0x2eab, 0x2ebb, 0x2ebb, 0x2ecd, 0x2ecd, 0x2edd,
-	0x2edd, 0x2eef, 0x2eef, 0x2f01, 0x2f01, 0x2f15, 0x2f15, 0x2f25,
-	0x2f25, 0x2f37, 0x2f37, 0x2f49, 0x2f49, 0x2f5d, 0x2f5d, 0x2f6e,
-	0x2f6e, 0x2f81, 0x2f81, 0x2f94, 0x2f94, 0x2c13, 0x2c13, 0x2c13,
-	0x2c13, 0x2c13, 0x2c13, 0x2c13, 0x2c13, 0x2c13, 0x2c13, 0x2c13,
-	0x2c13, 0x2c13, 0x2c13, 0x2c13, 0x2c13, 0x2c13, 0x2c13, 0x2c13,
-	0x2c13, 0x2c13, 0x2c13, 0x2c13, 0x2c13, 0x2c13, 0x2c13, 0x2c13,
-	0x2c13, 0x2c13, 0x2c13, 0x2c13, 0x2c13, 0x0106, 0x0006, 0x0126,
-	0x01c6, 0x01d6, 0x0136, 0x0146, 0x0156, 0x080c, 0x2248, 0x0804,
-	0x2fa9, 0x0106, 0x0006, 0x0126, 0x01c6, 0x01d6, 0x0136, 0x0146,
-	0x0156, 0x080c, 0x207e, 0x0804, 0x2fa9, 0x0106, 0x0006, 0x0126,
-	0x01c6, 0x01d6, 0x0136, 0x0146, 0x0156, 0x080c, 0x207e, 0x080c,
-	0x2248, 0x0804, 0x2fa9, 0x0106, 0x0006, 0x0126, 0x01c6, 0x01d6,
-	0x0136, 0x0146, 0x0156, 0x080c, 0x20a8, 0x0804, 0x2fa9, 0x0106,
+	0x295e, 0x2001, 0x1991, 0x2003, 0x0002, 0x0028, 0x2001, 0x198f,
+	0x2003, 0x0003, 0x0010, 0x080c, 0x27a3, 0x0005, 0x080c, 0x28ce,
+	0x0560, 0x2009, 0x1998, 0x2104, 0x8001, 0x200a, 0x080c, 0x29a0,
+	0x1168, 0x7850, 0x9084, 0xefff, 0x7852, 0x2001, 0x198f, 0x2003,
+	0x0003, 0x2001, 0x1990, 0x2003, 0x0000, 0x00b8, 0x2009, 0x1998,
+	0x2104, 0x9005, 0x1118, 0x080c, 0x2913, 0x0010, 0x080c, 0x28e3,
+	0x080c, 0x28d6, 0x2009, 0x1994, 0x200b, 0x0000, 0x2001, 0x1991,
+	0x2003, 0x0001, 0x080c, 0x27a3, 0x0000, 0x0005, 0x04b9, 0x0508,
+	0x080c, 0x29a0, 0x11b8, 0x7850, 0x9084, 0xefff, 0x7852, 0x2009,
+	0x1995, 0x2104, 0x8000, 0x200a, 0x9086, 0x0007, 0x0108, 0x0078,
+	0x2001, 0x199a, 0x2003, 0x000a, 0x2009, 0x1997, 0x2104, 0xc0fd,
+	0x200a, 0x0038, 0x0419, 0x2001, 0x1991, 0x2003, 0x0004, 0x080c,
+	0x27ce, 0x0005, 0x0099, 0x0168, 0x080c, 0x29a0, 0x1138, 0x7850,
+	0x9084, 0xefff, 0x7852, 0x080c, 0x27ba, 0x0018, 0x0079, 0x080c,
+	0x27ce, 0x0005, 0x080c, 0x0d7d, 0x080c, 0x0d7d, 0x2009, 0x1999,
+	0x2104, 0x8001, 0x200a, 0x090c, 0x292f, 0x0005, 0x7a38, 0x9294,
+	0x0005, 0x9296, 0x0005, 0x0110, 0x9006, 0x0010, 0x2001, 0x0001,
+	0x080c, 0x295e, 0x0005, 0x7a38, 0x9294, 0x0006, 0x9296, 0x0006,
+	0x0110, 0x9006, 0x0010, 0x2001, 0x0001, 0x080c, 0x2941, 0x0005,
+	0x2009, 0x1994, 0x2104, 0x8000, 0x200a, 0x9086, 0x0005, 0x0108,
+	0x0068, 0x200b, 0x0000, 0x7a38, 0x9294, 0x0006, 0x9296, 0x0006,
+	0x0110, 0x9006, 0x0010, 0x2001, 0x0001, 0x04d9, 0x7a38, 0x9294,
+	0x0005, 0x9296, 0x0005, 0x0110, 0x9006, 0x0010, 0x2001, 0x0001,
+	0x080c, 0x295e, 0x0005, 0x0086, 0x2001, 0x1997, 0x2004, 0x9084,
+	0x7fff, 0x090c, 0x0d7d, 0x2009, 0x1996, 0x2144, 0x8846, 0x280a,
+	0x9844, 0x0dd8, 0xd08c, 0x1120, 0xd084, 0x1120, 0x080c, 0x0d7d,
+	0x9006, 0x0010, 0x2001, 0x0001, 0x00a1, 0x008e, 0x0005, 0x0006,
+	0x0156, 0x2001, 0x198f, 0x20a9, 0x0009, 0x2003, 0x0000, 0x8000,
+	0x1f04, 0x2935, 0x2001, 0x1996, 0x2003, 0x8000, 0x015e, 0x000e,
+	0x0005, 0x00f6, 0x2079, 0x0100, 0x9085, 0x0000, 0x0158, 0x7838,
+	0x9084, 0xfff9, 0x9085, 0x0004, 0x783a, 0x2009, 0x199c, 0x210c,
+	0x795a, 0x0050, 0x7838, 0x9084, 0xfffb, 0x9085, 0x0006, 0x783a,
+	0x2009, 0x199d, 0x210c, 0x795a, 0x00fe, 0x0005, 0x00f6, 0x2079,
+	0x0100, 0x9085, 0x0000, 0x0158, 0x7838, 0x9084, 0xfffa, 0x9085,
+	0x0004, 0x783a, 0x7850, 0x9084, 0xfff0, 0x7852, 0x00f8, 0x7838,
+	0x9084, 0xfffb, 0x9085, 0x0005, 0x783a, 0x7850, 0x9084, 0xfff0,
+	0x0016, 0x2009, 0x017f, 0x210c, 0x918e, 0x0005, 0x0140, 0x2009,
+	0x0003, 0x210c, 0x918c, 0x0600, 0x918e, 0x0400, 0x0118, 0x9085,
+	0x000a, 0x0010, 0x9085, 0x0000, 0x001e, 0x7852, 0x00fe, 0x0005,
+	0x0006, 0x2001, 0x0100, 0x2004, 0x9082, 0x0007, 0x000e, 0x0005,
+	0x0006, 0x2001, 0x0100, 0x2004, 0x9082, 0x0009, 0x000e, 0x0005,
+	0x0156, 0x20a9, 0x0064, 0x7820, 0x080c, 0x2a0f, 0xd09c, 0x1110,
+	0x1f04, 0x29a3, 0x015e, 0x0005, 0x0126, 0x0016, 0x0006, 0x2091,
+	0x8000, 0x000e, 0x2008, 0x9186, 0x0000, 0x1118, 0x783b, 0x0007,
+	0x0090, 0x9186, 0x0001, 0x1118, 0x783b, 0x0006, 0x0060, 0x9186,
+	0x0002, 0x1118, 0x783b, 0x0005, 0x0030, 0x9186, 0x0003, 0x1118,
+	0x783b, 0x0004, 0x0000, 0x0006, 0x1d04, 0x29cc, 0x080c, 0x8709,
+	0x1f04, 0x29cc, 0x7850, 0x9085, 0x1000, 0x7852, 0x000e, 0x001e,
+	0x012e, 0x0005, 0x080c, 0x2ab9, 0x0005, 0x0006, 0x0156, 0x00f6,
+	0x2079, 0x0100, 0x20a9, 0x000a, 0x7854, 0xd0ac, 0x1100, 0x7854,
+	0xd08c, 0x1110, 0x1f04, 0x29e7, 0x00fe, 0x015e, 0x000e, 0x0005,
+	0x1d04, 0x29f0, 0x080c, 0x8709, 0x1f04, 0x29f0, 0x0005, 0x0006,
+	0x2001, 0x199b, 0x2004, 0x9086, 0x0000, 0x000e, 0x0005, 0x0006,
+	0x2001, 0x199b, 0x2004, 0x9086, 0x0001, 0x000e, 0x0005, 0x0006,
+	0x2001, 0x199b, 0x2004, 0x9086, 0x0002, 0x000e, 0x0005, 0xa001,
+	0xa001, 0xa001, 0xa001, 0xa001, 0x0005, 0x0006, 0x2001, 0x19a7,
+	0x2102, 0x000e, 0x0005, 0x2009, 0x0171, 0x2104, 0xd0dc, 0x0140,
+	0x2009, 0x0170, 0x2104, 0x200b, 0x0080, 0xa001, 0xa001, 0x200a,
+	0x0005, 0x0016, 0x0026, 0x080c, 0x74e2, 0x0108, 0xc0bc, 0x2009,
+	0x0140, 0x2114, 0x9294, 0x0001, 0x9215, 0x220a, 0x002e, 0x001e,
+	0x0005, 0x0016, 0x0026, 0x2009, 0x0140, 0x2114, 0x9294, 0x0001,
+	0x9285, 0x1000, 0x200a, 0x220a, 0x002e, 0x001e, 0x0005, 0x0016,
+	0x0026, 0x2009, 0x0140, 0x2114, 0x9294, 0x0001, 0x9215, 0x220a,
+	0x002e, 0x001e, 0x0005, 0x0006, 0x0016, 0x2009, 0x0140, 0x2104,
+	0x1128, 0x080c, 0x74e2, 0x0110, 0xc0bc, 0x0008, 0xc0bd, 0x200a,
+	0x001e, 0x000e, 0x0005, 0x00f6, 0x2079, 0x0380, 0x7843, 0x0101,
+	0x7844, 0xd084, 0x1de8, 0x2001, 0x0109, 0x2202, 0x7843, 0x0100,
+	0x00fe, 0x0005, 0x00f6, 0x2079, 0x0380, 0x7843, 0x0202, 0x7844,
+	0xd08c, 0x1de8, 0x2079, 0x0100, 0x7814, 0x9104, 0x9205, 0x7a16,
+	0x2079, 0x0380, 0x7843, 0x0200, 0x00fe, 0x0005, 0x0016, 0x0026,
+	0x0036, 0x00c6, 0x2061, 0x0100, 0x6050, 0x9084, 0xfbff, 0x9085,
+	0x0040, 0x6052, 0x20a9, 0x0002, 0x080c, 0x29f0, 0x6050, 0x9085,
+	0x0400, 0x9084, 0xff9f, 0x6052, 0x20a9, 0x0005, 0x080c, 0x29f0,
+	0x6054, 0xd0bc, 0x090c, 0x0d7d, 0x20a9, 0x0005, 0x080c, 0x29f0,
+	0x6054, 0xd0ac, 0x090c, 0x0d7d, 0x2009, 0x19ae, 0x9084, 0x7e00,
+	0x8007, 0x8004, 0x8004, 0x200a, 0x00ce, 0x003e, 0x002e, 0x001e,
+	0x0005, 0x0006, 0x00c6, 0x2061, 0x0100, 0x6050, 0xc0cd, 0x6052,
+	0x00ce, 0x000e, 0x0005, 0x2fbf, 0x2fbf, 0x2bc3, 0x2bc3, 0x2bcf,
+	0x2bcf, 0x2bdb, 0x2bdb, 0x2be9, 0x2be9, 0x2bf5, 0x2bf5, 0x2c03,
+	0x2c03, 0x2c11, 0x2c11, 0x2c23, 0x2c23, 0x2c2f, 0x2c2f, 0x2c3d,
+	0x2c3d, 0x2c5b, 0x2c5b, 0x2c7b, 0x2c7b, 0x2c4b, 0x2c4b, 0x2c6b,
+	0x2c6b, 0x2c89, 0x2c89, 0x2c21, 0x2c21, 0x2c21, 0x2c21, 0x2c21,
+	0x2c21, 0x2c21, 0x2c21, 0x2c21, 0x2c21, 0x2c21, 0x2c21, 0x2c21,
+	0x2c21, 0x2c21, 0x2c21, 0x2c21, 0x2c21, 0x2c21, 0x2c21, 0x2c21,
+	0x2c21, 0x2c21, 0x2c21, 0x2c21, 0x2c21, 0x2c21, 0x2c21, 0x2c21,
+	0x2c21, 0x2c21, 0x2c21, 0x2c9b, 0x2c9b, 0x2ca7, 0x2ca7, 0x2cb5,
+	0x2cb5, 0x2cc3, 0x2cc3, 0x2cd3, 0x2cd3, 0x2ce1, 0x2ce1, 0x2cf1,
+	0x2cf1, 0x2d01, 0x2d01, 0x2d13, 0x2d13, 0x2d21, 0x2d21, 0x2d31,
+	0x2d31, 0x2d53, 0x2d53, 0x2d77, 0x2d77, 0x2d41, 0x2d41, 0x2d65,
+	0x2d65, 0x2d87, 0x2d87, 0x2c21, 0x2c21, 0x2c21, 0x2c21, 0x2c21,
+	0x2c21, 0x2c21, 0x2c21, 0x2c21, 0x2c21, 0x2c21, 0x2c21, 0x2c21,
+	0x2c21, 0x2c21, 0x2c21, 0x2c21, 0x2c21, 0x2c21, 0x2c21, 0x2c21,
+	0x2c21, 0x2c21, 0x2c21, 0x2c21, 0x2c21, 0x2c21, 0x2c21, 0x2c21,
+	0x2c21, 0x2c21, 0x2c21, 0x2d9b, 0x2d9b, 0x2da7, 0x2da7, 0x2db5,
+	0x2db5, 0x2dc3, 0x2dc3, 0x2dd3, 0x2dd3, 0x2de1, 0x2de1, 0x2df1,
+	0x2df1, 0x2e01, 0x2e01, 0x2e13, 0x2e13, 0x2e21, 0x2e21, 0x2e31,
+	0x2e31, 0x2e41, 0x2e41, 0x2e53, 0x2e53, 0x2e63, 0x2e63, 0x2e75,
+	0x2e75, 0x2e87, 0x2e87, 0x2c21, 0x2c21, 0x2c21, 0x2c21, 0x2c21,
+	0x2c21, 0x2c21, 0x2c21, 0x2c21, 0x2c21, 0x2c21, 0x2c21, 0x2c21,
+	0x2c21, 0x2c21, 0x2c21, 0x2c21, 0x2c21, 0x2c21, 0x2c21, 0x2c21,
+	0x2c21, 0x2c21, 0x2c21, 0x2c21, 0x2c21, 0x2c21, 0x2c21, 0x2c21,
+	0x2c21, 0x2c21, 0x2c21, 0x2e9b, 0x2e9b, 0x2ea9, 0x2ea9, 0x2eb9,
+	0x2eb9, 0x2ec9, 0x2ec9, 0x2edb, 0x2edb, 0x2eeb, 0x2eeb, 0x2efd,
+	0x2efd, 0x2f0f, 0x2f0f, 0x2f23, 0x2f23, 0x2f33, 0x2f33, 0x2f45,
+	0x2f45, 0x2f57, 0x2f57, 0x2f6b, 0x2f6b, 0x2f7c, 0x2f7c, 0x2f8f,
+	0x2f8f, 0x2fa2, 0x2fa2, 0x2c21, 0x2c21, 0x2c21, 0x2c21, 0x2c21,
+	0x2c21, 0x2c21, 0x2c21, 0x2c21, 0x2c21, 0x2c21, 0x2c21, 0x2c21,
+	0x2c21, 0x2c21, 0x2c21, 0x2c21, 0x2c21, 0x2c21, 0x2c21, 0x2c21,
+	0x2c21, 0x2c21, 0x2c21, 0x2c21, 0x2c21, 0x2c21, 0x2c21, 0x2c21,
+	0x2c21, 0x2c21, 0x2c21, 0x0106, 0x0006, 0x0126, 0x01c6, 0x01d6,
+	0x0136, 0x0146, 0x0156, 0x080c, 0x2261, 0x0804, 0x2fb7, 0x0106,
 	0x0006, 0x0126, 0x01c6, 0x01d6, 0x0136, 0x0146, 0x0156, 0x080c,
-	0x2248, 0x080c, 0x20a8, 0x0804, 0x2fa9, 0x0106, 0x0006, 0x0126,
-	0x01c6, 0x01d6, 0x0136, 0x0146, 0x0156, 0x080c, 0x207e, 0x080c,
-	0x20a8, 0x0804, 0x2fa9, 0x0106, 0x0006, 0x0126, 0x01c6, 0x01d6,
-	0x0136, 0x0146, 0x0156, 0x080c, 0x207e, 0x080c, 0x2248, 0x080c,
-	0x20a8, 0x0804, 0x2fa9, 0xa001, 0x0cf0, 0x0106, 0x0006, 0x0126,
-	0x01c6, 0x01d6, 0x0136, 0x0146, 0x0156, 0x080c, 0x13a3, 0x0804,
-	0x2fa9, 0x0106, 0x0006, 0x0126, 0x01c6, 0x01d6, 0x0136, 0x0146,
-	0x0156, 0x080c, 0x2248, 0x080c, 0x13a3, 0x0804, 0x2fa9, 0x0106,
+	0x208b, 0x0804, 0x2fb7, 0x0106, 0x0006, 0x0126, 0x01c6, 0x01d6,
+	0x0136, 0x0146, 0x0156, 0x080c, 0x208b, 0x080c, 0x2261, 0x0804,
+	0x2fb7, 0x0106, 0x0006, 0x0126, 0x01c6, 0x01d6, 0x0136, 0x0146,
+	0x0156, 0x080c, 0x20b5, 0x0804, 0x2fb7, 0x0106, 0x0006, 0x0126,
+	0x01c6, 0x01d6, 0x0136, 0x0146, 0x0156, 0x080c, 0x2261, 0x080c,
+	0x20b5, 0x0804, 0x2fb7, 0x0106, 0x0006, 0x0126, 0x01c6, 0x01d6,
+	0x0136, 0x0146, 0x0156, 0x080c, 0x208b, 0x080c, 0x20b5, 0x0804,
+	0x2fb7, 0x0106, 0x0006, 0x0126, 0x01c6, 0x01d6, 0x0136, 0x0146,
+	0x0156, 0x080c, 0x208b, 0x080c, 0x2261, 0x080c, 0x20b5, 0x0804,
+	0x2fb7, 0xa001, 0x0cf0, 0x0106, 0x0006, 0x0126, 0x01c6, 0x01d6,
+	0x0136, 0x0146, 0x0156, 0x080c, 0x13ae, 0x0804, 0x2fb7, 0x0106,
 	0x0006, 0x0126, 0x01c6, 0x01d6, 0x0136, 0x0146, 0x0156, 0x080c,
-	0x207e, 0x080c, 0x13a3, 0x0804, 0x2fa9, 0x0106, 0x0006, 0x0126,
-	0x01c6, 0x01d6, 0x0136, 0x0146, 0x0156, 0x080c, 0x2248, 0x080c,
-	0x13a3, 0x080c, 0x20a8, 0x0804, 0x2fa9, 0x0106, 0x0006, 0x0126,
-	0x01c6, 0x01d6, 0x0136, 0x0146, 0x0156, 0x080c, 0x207e, 0x080c,
-	0x2248, 0x080c, 0x13a3, 0x0804, 0x2fa9, 0x0106, 0x0006, 0x0126,
-	0x01c6, 0x01d6, 0x0136, 0x0146, 0x0156, 0x080c, 0x207e, 0x080c,
-	0x13a3, 0x080c, 0x20a8, 0x0804, 0x2fa9, 0x0106, 0x0006, 0x0126,
-	0x01c6, 0x01d6, 0x0136, 0x0146, 0x0156, 0x080c, 0x13a3, 0x080c,
-	0x20a8, 0x0804, 0x2fa9, 0x0106, 0x0006, 0x0126, 0x01c6, 0x01d6,
-	0x0136, 0x0146, 0x0156, 0x080c, 0x207e, 0x080c, 0x2248, 0x080c,
-	0x13a3, 0x080c, 0x20a8, 0x0804, 0x2fa9, 0x0106, 0x0006, 0x0126,
-	0x01c6, 0x01d6, 0x0136, 0x0146, 0x0156, 0x080c, 0x26fe, 0x0804,
-	0x2fa9, 0x0106, 0x0006, 0x0126, 0x01c6, 0x01d6, 0x0136, 0x0146,
-	0x0156, 0x080c, 0x26fe, 0x080c, 0x2248, 0x0804, 0x2fa9, 0x0106,
+	0x2261, 0x080c, 0x13ae, 0x0804, 0x2fb7, 0x0106, 0x0006, 0x0126,
+	0x01c6, 0x01d6, 0x0136, 0x0146, 0x0156, 0x080c, 0x208b, 0x080c,
+	0x13ae, 0x0804, 0x2fb7, 0x0106, 0x0006, 0x0126, 0x01c6, 0x01d6,
+	0x0136, 0x0146, 0x0156, 0x080c, 0x2261, 0x080c, 0x13ae, 0x080c,
+	0x20b5, 0x0804, 0x2fb7, 0x0106, 0x0006, 0x0126, 0x01c6, 0x01d6,
+	0x0136, 0x0146, 0x0156, 0x080c, 0x208b, 0x080c, 0x2261, 0x080c,
+	0x13ae, 0x0804, 0x2fb7, 0x0106, 0x0006, 0x0126, 0x01c6, 0x01d6,
+	0x0136, 0x0146, 0x0156, 0x080c, 0x208b, 0x080c, 0x13ae, 0x080c,
+	0x20b5, 0x0804, 0x2fb7, 0x0106, 0x0006, 0x0126, 0x01c6, 0x01d6,
+	0x0136, 0x0146, 0x0156, 0x080c, 0x13ae, 0x080c, 0x20b5, 0x0804,
+	0x2fb7, 0x0106, 0x0006, 0x0126, 0x01c6, 0x01d6, 0x0136, 0x0146,
+	0x0156, 0x080c, 0x208b, 0x080c, 0x2261, 0x080c, 0x13ae, 0x080c,
+	0x20b5, 0x0804, 0x2fb7, 0x0106, 0x0006, 0x0126, 0x01c6, 0x01d6,
+	0x0136, 0x0146, 0x0156, 0x080c, 0x2717, 0x0804, 0x2fb7, 0x0106,
 	0x0006, 0x0126, 0x01c6, 0x01d6, 0x0136, 0x0146, 0x0156, 0x080c,
-	0x26fe, 0x080c, 0x207e, 0x0804, 0x2fa9, 0x0106, 0x0006, 0x0126,
-	0x01c6, 0x01d6, 0x0136, 0x0146, 0x0156, 0x080c, 0x26fe, 0x080c,
-	0x207e, 0x080c, 0x2248, 0x0804, 0x2fa9, 0x0106, 0x0006, 0x0126,
-	0x01c6, 0x01d6, 0x0136, 0x0146, 0x0156, 0x080c, 0x26fe, 0x080c,
-	0x20a8, 0x0804, 0x2fa9, 0x0106, 0x0006, 0x0126, 0x01c6, 0x01d6,
-	0x0136, 0x0146, 0x0156, 0x080c, 0x26fe, 0x080c, 0x2248, 0x080c,
-	0x20a8, 0x0804, 0x2fa9, 0x0106, 0x0006, 0x0126, 0x01c6, 0x01d6,
-	0x0136, 0x0146, 0x0156, 0x080c, 0x26fe, 0x080c, 0x207e, 0x080c,
-	0x20a8, 0x0804, 0x2fa9, 0x0106, 0x0006, 0x0126, 0x01c6, 0x01d6,
-	0x0136, 0x0146, 0x0156, 0x080c, 0x26fe, 0x080c, 0x207e, 0x080c,
-	0x2248, 0x080c, 0x20a8, 0x0804, 0x2fa9, 0x0106, 0x0006, 0x0126,
-	0x01c6, 0x01d6, 0x0136, 0x0146, 0x0156, 0x080c, 0x26fe, 0x080c,
-	0x13a3, 0x0804, 0x2fa9, 0x0106, 0x0006, 0x0126, 0x01c6, 0x01d6,
-	0x0136, 0x0146, 0x0156, 0x080c, 0x26fe, 0x080c, 0x2248, 0x080c,
-	0x13a3, 0x0804, 0x2fa9, 0x0106, 0x0006, 0x0126, 0x01c6, 0x01d6,
-	0x0136, 0x0146, 0x0156, 0x080c, 0x26fe, 0x080c, 0x207e, 0x080c,
-	0x13a3, 0x0804, 0x2fa9, 0x0106, 0x0006, 0x0126, 0x01c6, 0x01d6,
-	0x0136, 0x0146, 0x0156, 0x080c, 0x26fe, 0x080c, 0x2248, 0x080c,
-	0x13a3, 0x080c, 0x20a8, 0x0804, 0x2fa9, 0x0106, 0x0006, 0x0126,
-	0x01c6, 0x01d6, 0x0136, 0x0146, 0x0156, 0x080c, 0x26fe, 0x080c,
-	0x207e, 0x080c, 0x2248, 0x080c, 0x13a3, 0x0804, 0x2fa9, 0x0106,
+	0x2717, 0x080c, 0x2261, 0x0804, 0x2fb7, 0x0106, 0x0006, 0x0126,
+	0x01c6, 0x01d6, 0x0136, 0x0146, 0x0156, 0x080c, 0x2717, 0x080c,
+	0x208b, 0x0804, 0x2fb7, 0x0106, 0x0006, 0x0126, 0x01c6, 0x01d6,
+	0x0136, 0x0146, 0x0156, 0x080c, 0x2717, 0x080c, 0x208b, 0x080c,
+	0x2261, 0x0804, 0x2fb7, 0x0106, 0x0006, 0x0126, 0x01c6, 0x01d6,
+	0x0136, 0x0146, 0x0156, 0x080c, 0x2717, 0x080c, 0x20b5, 0x0804,
+	0x2fb7, 0x0106, 0x0006, 0x0126, 0x01c6, 0x01d6, 0x0136, 0x0146,
+	0x0156, 0x080c, 0x2717, 0x080c, 0x2261, 0x080c, 0x20b5, 0x0804,
+	0x2fb7, 0x0106, 0x0006, 0x0126, 0x01c6, 0x01d6, 0x0136, 0x0146,
+	0x0156, 0x080c, 0x2717, 0x080c, 0x208b, 0x080c, 0x20b5, 0x0804,
+	0x2fb7, 0x0106, 0x0006, 0x0126, 0x01c6, 0x01d6, 0x0136, 0x0146,
+	0x0156, 0x080c, 0x2717, 0x080c, 0x208b, 0x080c, 0x2261, 0x080c,
+	0x20b5, 0x0804, 0x2fb7, 0x0106, 0x0006, 0x0126, 0x01c6, 0x01d6,
+	0x0136, 0x0146, 0x0156, 0x080c, 0x2717, 0x080c, 0x13ae, 0x0804,
+	0x2fb7, 0x0106, 0x0006, 0x0126, 0x01c6, 0x01d6, 0x0136, 0x0146,
+	0x0156, 0x080c, 0x2717, 0x080c, 0x2261, 0x080c, 0x13ae, 0x0804,
+	0x2fb7, 0x0106, 0x0006, 0x0126, 0x01c6, 0x01d6, 0x0136, 0x0146,
+	0x0156, 0x080c, 0x2717, 0x080c, 0x208b, 0x080c, 0x13ae, 0x0804,
+	0x2fb7, 0x0106, 0x0006, 0x0126, 0x01c6, 0x01d6, 0x0136, 0x0146,
+	0x0156, 0x080c, 0x2717, 0x080c, 0x2261, 0x080c, 0x13ae, 0x080c,
+	0x20b5, 0x0804, 0x2fb7, 0x0106, 0x0006, 0x0126, 0x01c6, 0x01d6,
+	0x0136, 0x0146, 0x0156, 0x080c, 0x2717, 0x080c, 0x208b, 0x080c,
+	0x2261, 0x080c, 0x13ae, 0x0804, 0x2fb7, 0x0106, 0x0006, 0x0126,
+	0x01c6, 0x01d6, 0x0136, 0x0146, 0x0156, 0x080c, 0x2717, 0x080c,
+	0x208b, 0x080c, 0x13ae, 0x080c, 0x20b5, 0x0804, 0x2fb7, 0x0106,
 	0x0006, 0x0126, 0x01c6, 0x01d6, 0x0136, 0x0146, 0x0156, 0x080c,
-	0x26fe, 0x080c, 0x207e, 0x080c, 0x13a3, 0x080c, 0x20a8, 0x0804,
-	0x2fa9, 0x0106, 0x0006, 0x0126, 0x01c6, 0x01d6, 0x0136, 0x0146,
-	0x0156, 0x080c, 0x26fe, 0x080c, 0x13a3, 0x080c, 0x20a8, 0x0804,
-	0x2fa9, 0x0106, 0x0006, 0x0126, 0x01c6, 0x01d6, 0x0136, 0x0146,
-	0x0156, 0x080c, 0x26fe, 0x080c, 0x207e, 0x080c, 0x2248, 0x080c,
-	0x13a3, 0x080c, 0x20a8, 0x0804, 0x2fa9, 0x0106, 0x0006, 0x0126,
-	0x01c6, 0x01d6, 0x0136, 0x0146, 0x0156, 0x080c, 0xa8fc, 0x0804,
-	0x2fa9, 0x0106, 0x0006, 0x0126, 0x01c6, 0x01d6, 0x0136, 0x0146,
-	0x0156, 0x080c, 0xa8fc, 0x080c, 0x2248, 0x0804, 0x2fa9, 0x0106,
+	0x2717, 0x080c, 0x13ae, 0x080c, 0x20b5, 0x0804, 0x2fb7, 0x0106,
 	0x0006, 0x0126, 0x01c6, 0x01d6, 0x0136, 0x0146, 0x0156, 0x080c,
-	0x207e, 0x080c, 0xa8fc, 0x0804, 0x2fa9, 0x0106, 0x0006, 0x0126,
-	0x01c6, 0x01d6, 0x0136, 0x0146, 0x0156, 0x080c, 0x207e, 0x080c,
-	0xa8fc, 0x080c, 0x2248, 0x0804, 0x2fa9, 0x0106, 0x0006, 0x0126,
-	0x01c6, 0x01d6, 0x0136, 0x0146, 0x0156, 0x080c, 0xa8fc, 0x080c,
-	0x20a8, 0x0804, 0x2fa9, 0x0106, 0x0006, 0x0126, 0x01c6, 0x01d6,
-	0x0136, 0x0146, 0x0156, 0x080c, 0xa8fc, 0x080c, 0x2248, 0x080c,
-	0x20a8, 0x0804, 0x2fa9, 0x0106, 0x0006, 0x0126, 0x01c6, 0x01d6,
-	0x0136, 0x0146, 0x0156, 0x080c, 0x207e, 0x080c, 0xa8fc, 0x080c,
-	0x20a8, 0x0804, 0x2fa9, 0x0106, 0x0006, 0x0126, 0x01c6, 0x01d6,
-	0x0136, 0x0146, 0x0156, 0x080c, 0x207e, 0x080c, 0xa8fc, 0x080c,
-	0x2248, 0x080c, 0x20a8, 0x0804, 0x2fa9, 0x0106, 0x0006, 0x0126,
-	0x01c6, 0x01d6, 0x0136, 0x0146, 0x0156, 0x080c, 0xa8fc, 0x080c,
-	0x13a3, 0x0804, 0x2fa9, 0x0106, 0x0006, 0x0126, 0x01c6, 0x01d6,
-	0x0136, 0x0146, 0x0156, 0x080c, 0xa8fc, 0x080c, 0x2248, 0x080c,
-	0x13a3, 0x0804, 0x2fa9, 0x0106, 0x0006, 0x0126, 0x01c6, 0x01d6,
-	0x0136, 0x0146, 0x0156, 0x080c, 0x207e, 0x080c, 0xa8fc, 0x080c,
-	0x13a3, 0x0804, 0x2fa9, 0x0106, 0x0006, 0x0126, 0x01c6, 0x01d6,
-	0x0136, 0x0146, 0x0156, 0x080c, 0x207e, 0x080c, 0xa8fc, 0x080c,
-	0x2248, 0x080c, 0x13a3, 0x0804, 0x2fa9, 0x0106, 0x0006, 0x0126,
-	0x01c6, 0x01d6, 0x0136, 0x0146, 0x0156, 0x080c, 0xa8fc, 0x080c,
-	0x13a3, 0x080c, 0x20a8, 0x0804, 0x2fa9, 0x0106, 0x0006, 0x0126,
-	0x01c6, 0x01d6, 0x0136, 0x0146, 0x0156, 0x080c, 0xa8fc, 0x080c,
-	0x2248, 0x080c, 0x13a3, 0x080c, 0x20a8, 0x0804, 0x2fa9, 0x0106,
+	0x2717, 0x080c, 0x208b, 0x080c, 0x2261, 0x080c, 0x13ae, 0x080c,
+	0x20b5, 0x0804, 0x2fb7, 0x0106, 0x0006, 0x0126, 0x01c6, 0x01d6,
+	0x0136, 0x0146, 0x0156, 0x080c, 0xa8ee, 0x0804, 0x2fb7, 0x0106,
 	0x0006, 0x0126, 0x01c6, 0x01d6, 0x0136, 0x0146, 0x0156, 0x080c,
-	0x207e, 0x080c, 0xa8fc, 0x080c, 0x13a3, 0x080c, 0x20a8, 0x0804,
-	0x2fa9, 0x0106, 0x0006, 0x0126, 0x01c6, 0x01d6, 0x0136, 0x0146,
-	0x0156, 0x080c, 0x207e, 0x080c, 0xa8fc, 0x080c, 0x2248, 0x080c,
-	0x13a3, 0x080c, 0x20a8, 0x0804, 0x2fa9, 0x0106, 0x0006, 0x0126,
-	0x01c6, 0x01d6, 0x0136, 0x0146, 0x0156, 0x080c, 0x26fe, 0x080c,
-	0xa8fc, 0x0804, 0x2fa9, 0x0106, 0x0006, 0x0126, 0x01c6, 0x01d6,
-	0x0136, 0x0146, 0x0156, 0x080c, 0x26fe, 0x080c, 0xa8fc, 0x080c,
-	0x2248, 0x0804, 0x2fa9, 0x0106, 0x0006, 0x0126, 0x01c6, 0x01d6,
-	0x0136, 0x0146, 0x0156, 0x080c, 0x26fe, 0x080c, 0x207e, 0x080c,
-	0xa8fc, 0x0804, 0x2fa9, 0x0106, 0x0006, 0x0126, 0x01c6, 0x01d6,
-	0x0136, 0x0146, 0x0156, 0x080c, 0x26fe, 0x080c, 0x207e, 0x080c,
-	0xa8fc, 0x080c, 0x2248, 0x0804, 0x2fa9, 0x0106, 0x0006, 0x0126,
-	0x01c6, 0x01d6, 0x0136, 0x0146, 0x0156, 0x080c, 0x26fe, 0x080c,
-	0xa8fc, 0x080c, 0x20a8, 0x0804, 0x2fa9, 0x0106, 0x0006, 0x0126,
-	0x01c6, 0x01d6, 0x0136, 0x0146, 0x0156, 0x080c, 0x26fe, 0x080c,
-	0xa8fc, 0x080c, 0x2248, 0x080c, 0x20a8, 0x0804, 0x2fa9, 0x0106,
+	0xa8ee, 0x080c, 0x2261, 0x0804, 0x2fb7, 0x0106, 0x0006, 0x0126,
+	0x01c6, 0x01d6, 0x0136, 0x0146, 0x0156, 0x080c, 0x208b, 0x080c,
+	0xa8ee, 0x0804, 0x2fb7, 0x0106, 0x0006, 0x0126, 0x01c6, 0x01d6,
+	0x0136, 0x0146, 0x0156, 0x080c, 0x208b, 0x080c, 0xa8ee, 0x080c,
+	0x2261, 0x0804, 0x2fb7, 0x0106, 0x0006, 0x0126, 0x01c6, 0x01d6,
+	0x0136, 0x0146, 0x0156, 0x080c, 0xa8ee, 0x080c, 0x20b5, 0x0804,
+	0x2fb7, 0x0106, 0x0006, 0x0126, 0x01c6, 0x01d6, 0x0136, 0x0146,
+	0x0156, 0x080c, 0xa8ee, 0x080c, 0x2261, 0x080c, 0x20b5, 0x0804,
+	0x2fb7, 0x0106, 0x0006, 0x0126, 0x01c6, 0x01d6, 0x0136, 0x0146,
+	0x0156, 0x080c, 0x208b, 0x080c, 0xa8ee, 0x080c, 0x20b5, 0x0804,
+	0x2fb7, 0x0106, 0x0006, 0x0126, 0x01c6, 0x01d6, 0x0136, 0x0146,
+	0x0156, 0x080c, 0x208b, 0x080c, 0xa8ee, 0x080c, 0x2261, 0x080c,
+	0x20b5, 0x0804, 0x2fb7, 0x0106, 0x0006, 0x0126, 0x01c6, 0x01d6,
+	0x0136, 0x0146, 0x0156, 0x080c, 0xa8ee, 0x080c, 0x13ae, 0x0804,
+	0x2fb7, 0x0106, 0x0006, 0x0126, 0x01c6, 0x01d6, 0x0136, 0x0146,
+	0x0156, 0x080c, 0xa8ee, 0x080c, 0x2261, 0x080c, 0x13ae, 0x0804,
+	0x2fb7, 0x0106, 0x0006, 0x0126, 0x01c6, 0x01d6, 0x0136, 0x0146,
+	0x0156, 0x080c, 0x208b, 0x080c, 0xa8ee, 0x080c, 0x13ae, 0x0804,
+	0x2fb7, 0x0106, 0x0006, 0x0126, 0x01c6, 0x01d6, 0x0136, 0x0146,
+	0x0156, 0x080c, 0x208b, 0x080c, 0xa8ee, 0x080c, 0x2261, 0x080c,
+	0x13ae, 0x0804, 0x2fb7, 0x0106, 0x0006, 0x0126, 0x01c6, 0x01d6,
+	0x0136, 0x0146, 0x0156, 0x080c, 0xa8ee, 0x080c, 0x13ae, 0x080c,
+	0x20b5, 0x0804, 0x2fb7, 0x0106, 0x0006, 0x0126, 0x01c6, 0x01d6,
+	0x0136, 0x0146, 0x0156, 0x080c, 0xa8ee, 0x080c, 0x2261, 0x080c,
+	0x13ae, 0x080c, 0x20b5, 0x0804, 0x2fb7, 0x0106, 0x0006, 0x0126,
+	0x01c6, 0x01d6, 0x0136, 0x0146, 0x0156, 0x080c, 0x208b, 0x080c,
+	0xa8ee, 0x080c, 0x13ae, 0x080c, 0x20b5, 0x0804, 0x2fb7, 0x0106,
 	0x0006, 0x0126, 0x01c6, 0x01d6, 0x0136, 0x0146, 0x0156, 0x080c,
-	0x26fe, 0x080c, 0x207e, 0x080c, 0xa8fc, 0x080c, 0x20a8, 0x0804,
-	0x2fa9, 0x0106, 0x0006, 0x0126, 0x01c6, 0x01d6, 0x0136, 0x0146,
-	0x0156, 0x080c, 0x26fe, 0x080c, 0x207e, 0x080c, 0xa8fc, 0x080c,
-	0x2248, 0x080c, 0x20a8, 0x0804, 0x2fa9, 0x0106, 0x0006, 0x0126,
-	0x01c6, 0x01d6, 0x0136, 0x0146, 0x0156, 0x080c, 0x26fe, 0x080c,
-	0xa8fc, 0x080c, 0x13a3, 0x0804, 0x2fa9, 0x0106, 0x0006, 0x0126,
-	0x01c6, 0x01d6, 0x0136, 0x0146, 0x0156, 0x080c, 0x26fe, 0x080c,
-	0xa8fc, 0x080c, 0x2248, 0x080c, 0x13a3, 0x0804, 0x2fa9, 0x0106,
+	0x208b, 0x080c, 0xa8ee, 0x080c, 0x2261, 0x080c, 0x13ae, 0x080c,
+	0x20b5, 0x0804, 0x2fb7, 0x0106, 0x0006, 0x0126, 0x01c6, 0x01d6,
+	0x0136, 0x0146, 0x0156, 0x080c, 0x2717, 0x080c, 0xa8ee, 0x0804,
+	0x2fb7, 0x0106, 0x0006, 0x0126, 0x01c6, 0x01d6, 0x0136, 0x0146,
+	0x0156, 0x080c, 0x2717, 0x080c, 0xa8ee, 0x080c, 0x2261, 0x0804,
+	0x2fb7, 0x0106, 0x0006, 0x0126, 0x01c6, 0x01d6, 0x0136, 0x0146,
+	0x0156, 0x080c, 0x2717, 0x080c, 0x208b, 0x080c, 0xa8ee, 0x0804,
+	0x2fb7, 0x0106, 0x0006, 0x0126, 0x01c6, 0x01d6, 0x0136, 0x0146,
+	0x0156, 0x080c, 0x2717, 0x080c, 0x208b, 0x080c, 0xa8ee, 0x080c,
+	0x2261, 0x0804, 0x2fb7, 0x0106, 0x0006, 0x0126, 0x01c6, 0x01d6,
+	0x0136, 0x0146, 0x0156, 0x080c, 0x2717, 0x080c, 0xa8ee, 0x080c,
+	0x20b5, 0x0804, 0x2fb7, 0x0106, 0x0006, 0x0126, 0x01c6, 0x01d6,
+	0x0136, 0x0146, 0x0156, 0x080c, 0x2717, 0x080c, 0xa8ee, 0x080c,
+	0x2261, 0x080c, 0x20b5, 0x0804, 0x2fb7, 0x0106, 0x0006, 0x0126,
+	0x01c6, 0x01d6, 0x0136, 0x0146, 0x0156, 0x080c, 0x2717, 0x080c,
+	0x208b, 0x080c, 0xa8ee, 0x080c, 0x20b5, 0x0804, 0x2fb7, 0x0106,
 	0x0006, 0x0126, 0x01c6, 0x01d6, 0x0136, 0x0146, 0x0156, 0x080c,
-	0x26fe, 0x080c, 0x207e, 0x080c, 0xa8fc, 0x080c, 0x13a3, 0x0804,
-	0x2fa9, 0x0106, 0x0006, 0x0126, 0x01c6, 0x01d6, 0x0136, 0x0146,
-	0x0156, 0x080c, 0x26fe, 0x080c, 0x207e, 0x080c, 0xa8fc, 0x080c,
-	0x2248, 0x080c, 0x13a3, 0x0804, 0x2fa9, 0x0106, 0x0006, 0x0126,
-	0x01c6, 0x01d6, 0x0136, 0x0146, 0x0156, 0x080c, 0x26fe, 0x080c,
-	0xa8fc, 0x080c, 0x13a3, 0x080c, 0x20a8, 0x04d8, 0x0106, 0x0006,
-	0x0126, 0x01c6, 0x01d6, 0x0136, 0x0146, 0x0156, 0x080c, 0x26fe,
-	0x080c, 0xa8fc, 0x080c, 0x2248, 0x080c, 0x13a3, 0x080c, 0x20a8,
-	0x0440, 0x0106, 0x0006, 0x0126, 0x01c6, 0x01d6, 0x0136, 0x0146,
-	0x0156, 0x080c, 0x26fe, 0x080c, 0x207e, 0x080c, 0x13a3, 0x080c,
-	0xa8fc, 0x080c, 0x20a8, 0x00a8, 0x0106, 0x0006, 0x0126, 0x01c6,
-	0x01d6, 0x0136, 0x0146, 0x0156, 0x080c, 0x26fe, 0x080c, 0x207e,
-	0x080c, 0xa8fc, 0x080c, 0x2248, 0x080c, 0x13a3, 0x080c, 0x20a8,
-	0x0000, 0x015e, 0x014e, 0x013e, 0x01de, 0x01ce, 0x012e, 0x000e,
-	0x010e, 0x000d, 0x00b6, 0x00c6, 0x0026, 0x0046, 0x9026, 0x080c,
-	0x6a29, 0x1904, 0x30c2, 0x72dc, 0x2001, 0x197c, 0x2004, 0x9005,
-	0x1110, 0xd29c, 0x0148, 0xd284, 0x1138, 0xd2bc, 0x1904, 0x30c2,
-	0x080c, 0x30c7, 0x0804, 0x30c2, 0xd2cc, 0x1904, 0x30c2, 0x080c,
-	0x74e9, 0x1120, 0x70af, 0xffff, 0x0804, 0x30c2, 0xd294, 0x0120,
-	0x70af, 0xffff, 0x0804, 0x30c2, 0x080c, 0x3363, 0x0160, 0x080c,
-	0xcf52, 0x0128, 0x2001, 0x1818, 0x203c, 0x0804, 0x304f, 0x70af,
-	0xffff, 0x0804, 0x30c2, 0x2001, 0x1818, 0x203c, 0x7294, 0xd284,
-	0x0904, 0x304f, 0xd28c, 0x1904, 0x304f, 0x0036, 0x73ac, 0x938e,
-	0xffff, 0x1110, 0x2019, 0x0001, 0x8314, 0x92e0, 0x1d80, 0x2c04,
-	0x938c, 0x0001, 0x0120, 0x9084, 0xff00, 0x8007, 0x0010, 0x9084,
-	0x00ff, 0x970e, 0x05d0, 0x908e, 0x0000, 0x05b8, 0x908e, 0x00ff,
-	0x1150, 0x7230, 0xd284, 0x15b0, 0x7294, 0xc28d, 0x7296, 0x70af,
-	0xffff, 0x003e, 0x04a0, 0x900e, 0x080c, 0x25fb, 0x080c, 0x65c4,
-	0x1538, 0x9006, 0xb8bb, 0x0520, 0xb8ac, 0x9005, 0x0148, 0x00c6,
-	0x2060, 0x080c, 0x8b90, 0x00ce, 0x090c, 0x8f34, 0xb8af, 0x0000,
-	0x080c, 0x6a6b, 0x1168, 0x7030, 0xd08c, 0x0130, 0xb800, 0xd0bc,
-	0x0138, 0x080c, 0x6914, 0x0120, 0x080c, 0x30e0, 0x0148, 0x0028,
-	0x080c, 0x3238, 0x080c, 0x310c, 0x0118, 0x8318, 0x0804, 0x2ffc,
-	0x73ae, 0x0010, 0x70af, 0xffff, 0x003e, 0x0804, 0x30c2, 0x9780,
-	0x3374, 0x203d, 0x97bc, 0xff00, 0x873f, 0x2041, 0x007e, 0x70ac,
-	0x9096, 0xffff, 0x1118, 0x900e, 0x28a8, 0x0050, 0x9812, 0x0220,
-	0x2008, 0x9802, 0x20a8, 0x0020, 0x70af, 0xffff, 0x0804, 0x30c2,
-	0x2700, 0x0156, 0x0016, 0x9106, 0x0904, 0x30b7, 0xc484, 0x080c,
-	0x6625, 0x0148, 0x080c, 0xcf52, 0x1904, 0x30b7, 0x080c, 0x65c4,
-	0x1904, 0x30bf, 0x0008, 0xc485, 0xb8bb, 0x0520, 0xb8ac, 0x9005,
-	0x0148, 0x00c6, 0x2060, 0x080c, 0x8b90, 0x00ce, 0x090c, 0x8f34,
-	0xb8af, 0x0000, 0x080c, 0x6a6b, 0x1130, 0x7030, 0xd08c, 0x01f8,
-	0xb800, 0xd0bc, 0x11e0, 0x7294, 0xd28c, 0x0180, 0x080c, 0x6a6b,
-	0x9082, 0x0006, 0x02e0, 0xd484, 0x1118, 0x080c, 0x65e9, 0x0028,
-	0x080c, 0x32d1, 0x01a0, 0x080c, 0x32fc, 0x0088, 0x080c, 0x3238,
-	0x080c, 0xcf52, 0x1160, 0x080c, 0x310c, 0x0188, 0x0040, 0x080c,
-	0xcf52, 0x1118, 0x080c, 0x32d1, 0x0110, 0x0451, 0x0140, 0x001e,
-	0x8108, 0x015e, 0x1f04, 0x3068, 0x70af, 0xffff, 0x0018, 0x001e,
-	0x015e, 0x71ae, 0x004e, 0x002e, 0x00ce, 0x00be, 0x0005, 0x00c6,
-	0x0016, 0x70af, 0x0001, 0x2009, 0x007e, 0x080c, 0x65c4, 0x1168,
-	0xb813, 0x00ff, 0xb817, 0xfffe, 0x080c, 0x3238, 0x04a9, 0x0128,
-	0x70dc, 0xc0bd, 0x70de, 0x080c, 0xcc9f, 0x001e, 0x00ce, 0x0005,
-	0x0016, 0x0076, 0x00d6, 0x00c6, 0x2001, 0x184c, 0x2004, 0x9084,
-	0x00ff, 0xb842, 0x080c, 0xac5f, 0x01d0, 0x2b00, 0x6012, 0x080c,
-	0xcccc, 0x6023, 0x0001, 0x9006, 0x080c, 0x6561, 0x2001, 0x0000,
-	0x080c, 0x6575, 0x0126, 0x2091, 0x8000, 0x70a8, 0x8000, 0x70aa,
-	0x012e, 0x2009, 0x0004, 0x080c, 0xac8c, 0x9085, 0x0001, 0x00ce,
-	0x00de, 0x007e, 0x001e, 0x0005, 0x0016, 0x0076, 0x00d6, 0x00c6,
-	0x2001, 0x184c, 0x2004, 0x9084, 0x00ff, 0xb842, 0x080c, 0xac5f,
-	0x0548, 0x2b00, 0x6012, 0xb800, 0xc0c4, 0xb802, 0xb8a0, 0x9086,
-	0x007e, 0x0140, 0xb804, 0x9084, 0x00ff, 0x9086, 0x0006, 0x1110,
-	0x080c, 0x31e7, 0x080c, 0xcccc, 0x6023, 0x0001, 0x9006, 0x080c,
-	0x6561, 0x2001, 0x0002, 0x080c, 0x6575, 0x0126, 0x2091, 0x8000,
-	0x70a8, 0x8000, 0x70aa, 0x012e, 0x2009, 0x0002, 0x080c, 0xac8c,
-	0x9085, 0x0001, 0x00ce, 0x00de, 0x007e, 0x001e, 0x0005, 0x00b6,
-	0x00c6, 0x0026, 0x2009, 0x0080, 0x080c, 0x65c4, 0x1140, 0xb813,
-	0x00ff, 0xb817, 0xfffc, 0x0039, 0x0110, 0x70e3, 0xffff, 0x002e,
-	0x00ce, 0x00be, 0x0005, 0x0016, 0x0076, 0x00d6, 0x00c6, 0x080c,
-	0xab97, 0x01d0, 0x2b00, 0x6012, 0x080c, 0xcccc, 0x6023, 0x0001,
-	0x9006, 0x080c, 0x6561, 0x2001, 0x0002, 0x080c, 0x6575, 0x0126,
-	0x2091, 0x8000, 0x70e4, 0x8000, 0x70e6, 0x012e, 0x2009, 0x0002,
-	0x080c, 0xac8c, 0x9085, 0x0001, 0x00ce, 0x00de, 0x007e, 0x001e,
-	0x0005, 0x00c6, 0x00d6, 0x0126, 0x2091, 0x8000, 0x2009, 0x007f,
-	0x080c, 0x65c4, 0x11b8, 0xb813, 0x00ff, 0xb817, 0xfffd, 0xb8d7,
-	0x0004, 0x080c, 0xab97, 0x0170, 0x2b00, 0x6012, 0x6316, 0x6023,
-	0x0001, 0x620a, 0x080c, 0xcccc, 0x2009, 0x0022, 0x080c, 0xac8c,
-	0x9085, 0x0001, 0x012e, 0x00de, 0x00ce, 0x0005, 0x00e6, 0x00c6,
-	0x0066, 0x0036, 0x0026, 0x00b6, 0x21f0, 0x9036, 0x080c, 0xa896,
-	0x1110, 0x2031, 0x0001, 0x0066, 0x080c, 0x93b0, 0x080c, 0x9326,
-	0x080c, 0xa7ec, 0x080c, 0xbb19, 0x006e, 0x86ff, 0x0110, 0x080c,
-	0xa8b2, 0x3e08, 0x2130, 0x81ff, 0x0120, 0x20a9, 0x007e, 0x900e,
-	0x0018, 0x20a9, 0x007f, 0x900e, 0x0016, 0x080c, 0x6625, 0x1140,
-	0x9686, 0x0002, 0x1118, 0xb800, 0xd0bc, 0x1110, 0x080c, 0x6043,
-	0x001e, 0x8108, 0x1f04, 0x31cc, 0x9686, 0x0001, 0x190c, 0x3337,
+	0x2717, 0x080c, 0x208b, 0x080c, 0xa8ee, 0x080c, 0x2261, 0x080c,
+	0x20b5, 0x0804, 0x2fb7, 0x0106, 0x0006, 0x0126, 0x01c6, 0x01d6,
+	0x0136, 0x0146, 0x0156, 0x080c, 0x2717, 0x080c, 0xa8ee, 0x080c,
+	0x13ae, 0x0804, 0x2fb7, 0x0106, 0x0006, 0x0126, 0x01c6, 0x01d6,
+	0x0136, 0x0146, 0x0156, 0x080c, 0x2717, 0x080c, 0xa8ee, 0x080c,
+	0x2261, 0x080c, 0x13ae, 0x0804, 0x2fb7, 0x0106, 0x0006, 0x0126,
+	0x01c6, 0x01d6, 0x0136, 0x0146, 0x0156, 0x080c, 0x2717, 0x080c,
+	0x208b, 0x080c, 0xa8ee, 0x080c, 0x13ae, 0x0804, 0x2fb7, 0x0106,
+	0x0006, 0x0126, 0x01c6, 0x01d6, 0x0136, 0x0146, 0x0156, 0x080c,
+	0x2717, 0x080c, 0x208b, 0x080c, 0xa8ee, 0x080c, 0x2261, 0x080c,
+	0x13ae, 0x0804, 0x2fb7, 0x0106, 0x0006, 0x0126, 0x01c6, 0x01d6,
+	0x0136, 0x0146, 0x0156, 0x080c, 0x2717, 0x080c, 0xa8ee, 0x080c,
+	0x13ae, 0x080c, 0x20b5, 0x04d8, 0x0106, 0x0006, 0x0126, 0x01c6,
+	0x01d6, 0x0136, 0x0146, 0x0156, 0x080c, 0x2717, 0x080c, 0xa8ee,
+	0x080c, 0x2261, 0x080c, 0x13ae, 0x080c, 0x20b5, 0x0440, 0x0106,
+	0x0006, 0x0126, 0x01c6, 0x01d6, 0x0136, 0x0146, 0x0156, 0x080c,
+	0x2717, 0x080c, 0x208b, 0x080c, 0x13ae, 0x080c, 0xa8ee, 0x080c,
+	0x20b5, 0x00a8, 0x0106, 0x0006, 0x0126, 0x01c6, 0x01d6, 0x0136,
+	0x0146, 0x0156, 0x080c, 0x2717, 0x080c, 0x208b, 0x080c, 0xa8ee,
+	0x080c, 0x2261, 0x080c, 0x13ae, 0x080c, 0x20b5, 0x0000, 0x015e,
+	0x014e, 0x013e, 0x01de, 0x01ce, 0x012e, 0x000e, 0x010e, 0x000d,
+	0x00b6, 0x00c6, 0x0026, 0x0046, 0x9026, 0x080c, 0x6a28, 0x1904,
+	0x30d0, 0x72dc, 0x2001, 0x197b, 0x2004, 0x9005, 0x1110, 0xd29c,
+	0x0148, 0xd284, 0x1138, 0xd2bc, 0x1904, 0x30d0, 0x080c, 0x30d5,
+	0x0804, 0x30d0, 0xd2cc, 0x1904, 0x30d0, 0x080c, 0x74c8, 0x1120,
+	0x70af, 0xffff, 0x0804, 0x30d0, 0xd294, 0x0120, 0x70af, 0xffff,
+	0x0804, 0x30d0, 0x080c, 0x3357, 0x0160, 0x080c, 0xcf51, 0x0128,
+	0x2001, 0x1818, 0x203c, 0x0804, 0x305d, 0x70af, 0xffff, 0x0804,
+	0x30d0, 0x2001, 0x1818, 0x203c, 0x7294, 0xd284, 0x0904, 0x305d,
+	0xd28c, 0x1904, 0x305d, 0x0036, 0x73ac, 0x938e, 0xffff, 0x1110,
+	0x2019, 0x0001, 0x8314, 0x92e0, 0x1d80, 0x2c04, 0x938c, 0x0001,
+	0x0120, 0x9084, 0xff00, 0x8007, 0x0010, 0x9084, 0x00ff, 0x970e,
+	0x05d0, 0x908e, 0x0000, 0x05b8, 0x908e, 0x00ff, 0x1150, 0x7230,
+	0xd284, 0x15b0, 0x7294, 0xc28d, 0x7296, 0x70af, 0xffff, 0x003e,
+	0x04a0, 0x900e, 0x080c, 0x2614, 0x080c, 0x65bf, 0x1538, 0x9006,
+	0xb8bb, 0x0520, 0xb8ac, 0x9005, 0x0148, 0x00c6, 0x2060, 0x080c,
+	0x8b72, 0x00ce, 0x090c, 0x8f16, 0xb8af, 0x0000, 0x080c, 0x6a6a,
+	0x1168, 0x7030, 0xd08c, 0x0130, 0xb800, 0xd0bc, 0x0138, 0x080c,
+	0x6913, 0x0120, 0x080c, 0x30ee, 0x0148, 0x0028, 0x080c, 0x323a,
+	0x080c, 0x311a, 0x0118, 0x8318, 0x0804, 0x300a, 0x73ae, 0x0010,
+	0x70af, 0xffff, 0x003e, 0x0804, 0x30d0, 0x9780, 0x3368, 0x203d,
+	0x97bc, 0xff00, 0x873f, 0x2041, 0x007e, 0x70ac, 0x9096, 0xffff,
+	0x1118, 0x900e, 0x28a8, 0x0050, 0x9812, 0x0220, 0x2008, 0x9802,
+	0x20a8, 0x0020, 0x70af, 0xffff, 0x0804, 0x30d0, 0x2700, 0x0156,
+	0x0016, 0x9106, 0x0904, 0x30c5, 0xc484, 0x080c, 0x6620, 0x0148,
+	0x080c, 0xcf51, 0x1904, 0x30c5, 0x080c, 0x65bf, 0x1904, 0x30cd,
+	0x0008, 0xc485, 0xb8bb, 0x0520, 0xb8ac, 0x9005, 0x0148, 0x00c6,
+	0x2060, 0x080c, 0x8b72, 0x00ce, 0x090c, 0x8f16, 0xb8af, 0x0000,
+	0x080c, 0x6a6a, 0x1130, 0x7030, 0xd08c, 0x01f8, 0xb800, 0xd0bc,
+	0x11e0, 0x7294, 0xd28c, 0x0180, 0x080c, 0x6a6a, 0x9082, 0x0006,
+	0x02e0, 0xd484, 0x1118, 0x080c, 0x65e4, 0x0028, 0x080c, 0x32cd,
+	0x01a0, 0x080c, 0x32f8, 0x0088, 0x080c, 0x323a, 0x080c, 0xcf51,
+	0x1160, 0x080c, 0x311a, 0x0188, 0x0040, 0x080c, 0xcf51, 0x1118,
+	0x080c, 0x32cd, 0x0110, 0x0451, 0x0140, 0x001e, 0x8108, 0x015e,
+	0x1f04, 0x3076, 0x70af, 0xffff, 0x0018, 0x001e, 0x015e, 0x71ae,
+	0x004e, 0x002e, 0x00ce, 0x00be, 0x0005, 0x00c6, 0x0016, 0x70af,
+	0x0001, 0x2009, 0x007e, 0x080c, 0x65bf, 0x1168, 0xb813, 0x00ff,
+	0xb817, 0xfffe, 0x080c, 0x323a, 0x04a9, 0x0128, 0x70dc, 0xc0bd,
+	0x70de, 0x080c, 0xcc9e, 0x001e, 0x00ce, 0x0005, 0x0016, 0x0076,
+	0x00d6, 0x00c6, 0x2001, 0x184c, 0x2004, 0x9084, 0x00ff, 0xb842,
+	0x080c, 0xac4f, 0x01d0, 0x2b00, 0x6012, 0x080c, 0xcccb, 0x6023,
+	0x0001, 0x9006, 0x080c, 0x655c, 0x2001, 0x0000, 0x080c, 0x6570,
+	0x0126, 0x2091, 0x8000, 0x70a8, 0x8000, 0x70aa, 0x012e, 0x2009,
+	0x0004, 0x080c, 0xac7c, 0x9085, 0x0001, 0x00ce, 0x00de, 0x007e,
+	0x001e, 0x0005, 0x0016, 0x0076, 0x00d6, 0x00c6, 0x2001, 0x184c,
+	0x2004, 0x9084, 0x00ff, 0xb842, 0x080c, 0xac4f, 0x0548, 0x2b00,
+	0x6012, 0xb800, 0xc0c4, 0xb802, 0xb8a0, 0x9086, 0x007e, 0x0140,
+	0xb804, 0x9084, 0x00ff, 0x9086, 0x0006, 0x1110, 0x080c, 0x31ef,
+	0x080c, 0xcccb, 0x6023, 0x0001, 0x9006, 0x080c, 0x655c, 0x2001,
+	0x0002, 0x080c, 0x6570, 0x0126, 0x2091, 0x8000, 0x70a8, 0x8000,
+	0x70aa, 0x012e, 0x2009, 0x0002, 0x080c, 0xac7c, 0x9085, 0x0001,
+	0x00ce, 0x00de, 0x007e, 0x001e, 0x0005, 0x00b6, 0x00c6, 0x0026,
+	0x2009, 0x0080, 0x080c, 0x65bf, 0x1140, 0xb813, 0x00ff, 0xb817,
+	0xfffc, 0x0039, 0x0110, 0x70e3, 0xffff, 0x002e, 0x00ce, 0x00be,
+	0x0005, 0x0016, 0x0076, 0x00d6, 0x00c6, 0x080c, 0xab89, 0x01d0,
+	0x2b00, 0x6012, 0x080c, 0xcccb, 0x6023, 0x0001, 0x9006, 0x080c,
+	0x655c, 0x2001, 0x0002, 0x080c, 0x6570, 0x0126, 0x2091, 0x8000,
+	0x70e4, 0x8000, 0x70e6, 0x012e, 0x2009, 0x0002, 0x080c, 0xac7c,
+	0x9085, 0x0001, 0x00ce, 0x00de, 0x007e, 0x001e, 0x0005, 0x00c6,
+	0x00d6, 0x0126, 0x2091, 0x8000, 0x2009, 0x007f, 0x080c, 0x65bf,
+	0x11b8, 0xb813, 0x00ff, 0xb817, 0xfffd, 0xb8d7, 0x0004, 0x080c,
+	0xab89, 0x0170, 0x2b00, 0x6012, 0x6316, 0x6023, 0x0001, 0x620a,
+	0x080c, 0xcccb, 0x2009, 0x0022, 0x080c, 0xac7c, 0x9085, 0x0001,
+	0x012e, 0x00de, 0x00ce, 0x0005, 0x00e6, 0x00c6, 0x0066, 0x0036,
+	0x0026, 0x00b6, 0x21f0, 0x080c, 0xa888, 0x0106, 0x080c, 0x9398,
+	0x080c, 0x9309, 0x080c, 0xa7d9, 0x080c, 0xbb0c, 0x010e, 0x090c,
+	0xa8a4, 0x3e08, 0x2130, 0x81ff, 0x0120, 0x20a9, 0x007e, 0x900e,
+	0x0018, 0x20a9, 0x007f, 0x900e, 0x0016, 0x080c, 0x6620, 0x1140,
+	0x9686, 0x0002, 0x1118, 0xb800, 0xd0bc, 0x1110, 0x080c, 0x603e,
+	0x001e, 0x8108, 0x1f04, 0x31d4, 0x9686, 0x0001, 0x190c, 0x332b,
 	0x00be, 0x002e, 0x003e, 0x006e, 0x00ce, 0x00ee, 0x0005, 0x00e6,
-	0x00c6, 0x0046, 0x0036, 0x0026, 0x0016, 0x00b6, 0x9016, 0x080c,
-	0xa896, 0x1110, 0x2011, 0x0001, 0x0026, 0x6210, 0x2258, 0xbaa0,
-	0x0026, 0x2019, 0x0029, 0x080c, 0x93a5, 0x0076, 0x2039, 0x0000,
-	0x080c, 0x9277, 0x2c08, 0x080c, 0xdfeb, 0x007e, 0x001e, 0x002e,
-	0x82ff, 0x0110, 0x080c, 0xa8b2, 0xba10, 0xbb14, 0xbc84, 0x080c,
-	0x6043, 0xba12, 0xbb16, 0xbc86, 0x00be, 0x001e, 0x002e, 0x003e,
-	0x004e, 0x00ce, 0x00ee, 0x0005, 0x00e6, 0x0006, 0x00b6, 0x6010,
-	0x2058, 0xb8a0, 0x00be, 0x9086, 0x0080, 0x0150, 0x2071, 0x1800,
-	0x70a8, 0x9005, 0x0110, 0x8001, 0x70aa, 0x000e, 0x00ee, 0x0005,
-	0x2071, 0x1800, 0x70e4, 0x9005, 0x0dc0, 0x8001, 0x70e6, 0x0ca8,
-	0xb800, 0xc08c, 0xb802, 0x0005, 0x00f6, 0x00e6, 0x00c6, 0x00b6,
-	0x0046, 0x0036, 0x0026, 0x0016, 0x0156, 0x2178, 0x9016, 0x080c,
-	0xa896, 0x1110, 0x2011, 0x0001, 0x0026, 0x81ff, 0x1118, 0x20a9,
-	0x0001, 0x0078, 0x080c, 0x56da, 0xd0c4, 0x0140, 0xd0a4, 0x0130,
-	0x9006, 0x2020, 0x2009, 0x002d, 0x080c, 0xe2c9, 0x20a9, 0x0800,
-	0x9016, 0x0026, 0x928e, 0x007e, 0x0904, 0x32ab, 0x928e, 0x007f,
-	0x0904, 0x32ab, 0x928e, 0x0080, 0x05f0, 0x9288, 0x1000, 0x210c,
-	0x81ff, 0x05c8, 0x8fff, 0x1150, 0x2001, 0x198e, 0x0006, 0x2003,
-	0x0001, 0x080c, 0x32be, 0x000e, 0x2003, 0x0000, 0x00b6, 0x00c6,
-	0x2158, 0x2001, 0x0001, 0x080c, 0x6a35, 0x00ce, 0x00be, 0x2019,
-	0x0029, 0x080c, 0x93a5, 0x0076, 0x2039, 0x0000, 0x080c, 0x9277,
-	0x00b6, 0x00c6, 0x0026, 0x2158, 0xba04, 0x9294, 0x00ff, 0x9286,
-	0x0006, 0x1118, 0xb807, 0x0404, 0x0028, 0x2001, 0x0004, 0x8007,
-	0x9215, 0xba06, 0x002e, 0x00ce, 0x00be, 0x0016, 0x2c08, 0x080c,
-	0xdfeb, 0x001e, 0x007e, 0x002e, 0x8210, 0x1f04, 0x3261, 0x002e,
-	0x82ff, 0x0110, 0x080c, 0xa8b2, 0x015e, 0x001e, 0x002e, 0x003e,
-	0x004e, 0x00be, 0x00ce, 0x00ee, 0x00fe, 0x0005, 0x0046, 0x0026,
-	0x0016, 0x080c, 0x56da, 0xd0c4, 0x0140, 0xd0a4, 0x0130, 0x9006,
-	0x2220, 0x2009, 0x0029, 0x080c, 0xe2c9, 0x001e, 0x002e, 0x004e,
-	0x0005, 0x0016, 0x0026, 0x0036, 0x00c6, 0x7294, 0x82ff, 0x01e8,
-	0x080c, 0x6a63, 0x11d0, 0x2100, 0x080c, 0x262e, 0x81ff, 0x01b8,
-	0x2019, 0x0001, 0x8314, 0x92e0, 0x1d80, 0x2c04, 0xd384, 0x0120,
-	0x9084, 0xff00, 0x8007, 0x0010, 0x9084, 0x00ff, 0x9116, 0x0138,
-	0x9096, 0x00ff, 0x0110, 0x8318, 0x0c68, 0x9085, 0x0001, 0x00ce,
-	0x003e, 0x002e, 0x001e, 0x0005, 0x0016, 0x00c6, 0x0126, 0x2091,
-	0x8000, 0x0066, 0x9036, 0x080c, 0xa896, 0x1110, 0x2031, 0x0001,
-	0x0066, 0x0036, 0x2019, 0x0029, 0x00d9, 0x003e, 0x006e, 0x86ff,
-	0x0110, 0x080c, 0xa8b2, 0x006e, 0x9180, 0x1000, 0x2004, 0x9065,
-	0x0158, 0x0016, 0x00c6, 0x2061, 0x1b32, 0x001e, 0x6112, 0x080c,
-	0x31e7, 0x001e, 0x080c, 0x65e9, 0x012e, 0x00ce, 0x001e, 0x0005,
-	0x0016, 0x0026, 0x2110, 0x080c, 0xa38a, 0x080c, 0xe630, 0x002e,
-	0x001e, 0x0005, 0x2001, 0x1837, 0x2004, 0xd0cc, 0x0005, 0x00c6,
-	0x00b6, 0x080c, 0x74e9, 0x1118, 0x20a9, 0x0800, 0x0010, 0x20a9,
-	0x0782, 0x080c, 0x74e9, 0x1110, 0x900e, 0x0010, 0x2009, 0x007e,
-	0x9180, 0x1000, 0x2004, 0x905d, 0x0130, 0x86ff, 0x0110, 0xb800,
-	0xd0bc, 0x090c, 0x65e9, 0x8108, 0x1f04, 0x3348, 0x2061, 0x1800,
-	0x607f, 0x0000, 0x6080, 0x9084, 0x00ff, 0x6082, 0x60b3, 0x0000,
-	0x00be, 0x00ce, 0x0005, 0x2001, 0x1869, 0x2004, 0xd0bc, 0x0005,
-	0x2011, 0x1848, 0x2214, 0xd2ec, 0x0005, 0x0026, 0x2011, 0x1867,
-	0x2214, 0xd2dc, 0x002e, 0x0005, 0x7eef, 0x7de8, 0x7ce4, 0x80e2,
-	0x7be1, 0x80e0, 0x80dc, 0x80da, 0x7ad9, 0x80d6, 0x80d5, 0x80d4,
-	0x80d3, 0x80d2, 0x80d1, 0x79ce, 0x78cd, 0x80cc, 0x80cb, 0x80ca,
-	0x80c9, 0x80c7, 0x80c6, 0x77c5, 0x76c3, 0x80bc, 0x80ba, 0x75b9,
-	0x80b6, 0x74b5, 0x73b4, 0x72b3, 0x80b2, 0x80b1, 0x80ae, 0x71ad,
-	0x80ac, 0x70ab, 0x6faa, 0x6ea9, 0x80a7, 0x6da6, 0x6ca5, 0x6ba3,
-	0x6a9f, 0x699e, 0x689d, 0x809b, 0x8098, 0x6797, 0x6690, 0x658f,
-	0x6488, 0x6384, 0x6282, 0x8081, 0x8080, 0x617c, 0x607a, 0x8079,
-	0x5f76, 0x8075, 0x8074, 0x8073, 0x8072, 0x8071, 0x806e, 0x5e6d,
-	0x806c, 0x5d6b, 0x5c6a, 0x5b69, 0x8067, 0x5a66, 0x5965, 0x5863,
-	0x575c, 0x565a, 0x5559, 0x8056, 0x8055, 0x5454, 0x5353, 0x5252,
-	0x5151, 0x504e, 0x4f4d, 0x804c, 0x804b, 0x4e4a, 0x4d49, 0x8047,
-	0x4c46, 0x8045, 0x8043, 0x803c, 0x803a, 0x8039, 0x8036, 0x4b35,
-	0x8034, 0x4a33, 0x4932, 0x4831, 0x802e, 0x472d, 0x462c, 0x452b,
-	0x442a, 0x4329, 0x4227, 0x8026, 0x8025, 0x4123, 0x401f, 0x3f1e,
-	0x3e1d, 0x3d1b, 0x3c18, 0x8017, 0x8010, 0x3b0f, 0x3a08, 0x8004,
-	0x3902, 0x8001, 0x8000, 0x8000, 0x3800, 0x3700, 0x3600, 0x8000,
-	0x3500, 0x8000, 0x8000, 0x8000, 0x3400, 0x8000, 0x8000, 0x8000,
-	0x8000, 0x8000, 0x8000, 0x3300, 0x3200, 0x8000, 0x8000, 0x8000,
-	0x8000, 0x8000, 0x8000, 0x3100, 0x3000, 0x8000, 0x8000, 0x2f00,
-	0x8000, 0x2e00, 0x2d00, 0x2c00, 0x8000, 0x8000, 0x8000, 0x2b00,
-	0x8000, 0x2a00, 0x2900, 0x2800, 0x8000, 0x2700, 0x2600, 0x2500,
-	0x2400, 0x2300, 0x2200, 0x8000, 0x8000, 0x2100, 0x2000, 0x1f00,
-	0x1e00, 0x1d00, 0x1c00, 0x8000, 0x8000, 0x1b00, 0x1a00, 0x8000,
-	0x1900, 0x8000, 0x8000, 0x8000, 0x8000, 0x8000, 0x8000, 0x1800,
-	0x8000, 0x1700, 0x1600, 0x1500, 0x8000, 0x1400, 0x1300, 0x1200,
-	0x1100, 0x1000, 0x0f00, 0x8000, 0x8000, 0x0e00, 0x0d00, 0x0c00,
-	0x0b00, 0x0a00, 0x0900, 0x8000, 0x8000, 0x0800, 0x0700, 0x8000,
-	0x0600, 0x8000, 0x8000, 0x8000, 0x0500, 0x0400, 0x0300, 0x8000,
-	0x0200, 0x8000, 0x8000, 0x8000, 0x0100, 0x8000, 0x8000, 0x8000,
-	0x8000, 0x8000, 0x8000, 0x0000, 0x8000, 0x8000, 0x8000, 0x8000,
+	0x00c6, 0x0046, 0x0036, 0x0026, 0x0016, 0x00b6, 0x080c, 0xa888,
+	0x0106, 0x6210, 0x2258, 0xbaa0, 0x0026, 0x2019, 0x0029, 0x080c,
+	0x938d, 0x0076, 0x2039, 0x0000, 0x080c, 0x9256, 0x2c08, 0x080c,
+	0xdffb, 0x007e, 0x001e, 0x010e, 0x090c, 0xa8a4, 0xba10, 0xbb14,
+	0xbc84, 0x080c, 0x603e, 0xba12, 0xbb16, 0xbc86, 0x00be, 0x001e,
+	0x002e, 0x003e, 0x004e, 0x00ce, 0x00ee, 0x0005, 0x00e6, 0x0006,
+	0x00b6, 0x6010, 0x2058, 0xb8a0, 0x00be, 0x9086, 0x0080, 0x0150,
+	0x2071, 0x1800, 0x70a8, 0x9005, 0x0110, 0x8001, 0x70aa, 0x000e,
+	0x00ee, 0x0005, 0x2071, 0x1800, 0x70e4, 0x9005, 0x0dc0, 0x8001,
+	0x70e6, 0x0ca8, 0xb800, 0xc08c, 0xb802, 0x0005, 0x00f6, 0x00e6,
+	0x00c6, 0x00b6, 0x0046, 0x0036, 0x0026, 0x0016, 0x0156, 0x2178,
+	0x080c, 0xa888, 0x0106, 0x81ff, 0x1118, 0x20a9, 0x0001, 0x0078,
+	0x080c, 0x56d5, 0xd0c4, 0x0140, 0xd0a4, 0x0130, 0x9006, 0x2020,
+	0x2009, 0x002d, 0x080c, 0xe2d9, 0x20a9, 0x0800, 0x9016, 0x0026,
+	0x928e, 0x007e, 0x0904, 0x32a9, 0x928e, 0x007f, 0x0904, 0x32a9,
+	0x928e, 0x0080, 0x05f0, 0x9288, 0x1000, 0x210c, 0x81ff, 0x05c8,
+	0x8fff, 0x1150, 0x2001, 0x198d, 0x0006, 0x2003, 0x0001, 0x080c,
+	0x32ba, 0x000e, 0x2003, 0x0000, 0x00b6, 0x00c6, 0x2158, 0x2001,
+	0x0001, 0x080c, 0x6a34, 0x00ce, 0x00be, 0x2019, 0x0029, 0x080c,
+	0x938d, 0x0076, 0x2039, 0x0000, 0x080c, 0x9256, 0x00b6, 0x00c6,
+	0x0026, 0x2158, 0xba04, 0x9294, 0x00ff, 0x9286, 0x0006, 0x1118,
+	0xb807, 0x0404, 0x0028, 0x2001, 0x0004, 0x8007, 0x9215, 0xba06,
+	0x002e, 0x00ce, 0x00be, 0x0016, 0x2c08, 0x080c, 0xdffb, 0x001e,
+	0x007e, 0x002e, 0x8210, 0x1f04, 0x325f, 0x010e, 0x090c, 0xa8a4,
+	0x015e, 0x001e, 0x002e, 0x003e, 0x004e, 0x00be, 0x00ce, 0x00ee,
+	0x00fe, 0x0005, 0x0046, 0x0026, 0x0016, 0x080c, 0x56d5, 0xd0c4,
+	0x0140, 0xd0a4, 0x0130, 0x9006, 0x2220, 0x2009, 0x0029, 0x080c,
+	0xe2d9, 0x001e, 0x002e, 0x004e, 0x0005, 0x0016, 0x0026, 0x0036,
+	0x00c6, 0x7294, 0x82ff, 0x01e8, 0x080c, 0x6a62, 0x11d0, 0x2100,
+	0x080c, 0x2647, 0x81ff, 0x01b8, 0x2019, 0x0001, 0x8314, 0x92e0,
+	0x1d80, 0x2c04, 0xd384, 0x0120, 0x9084, 0xff00, 0x8007, 0x0010,
+	0x9084, 0x00ff, 0x9116, 0x0138, 0x9096, 0x00ff, 0x0110, 0x8318,
+	0x0c68, 0x9085, 0x0001, 0x00ce, 0x003e, 0x002e, 0x001e, 0x0005,
+	0x0016, 0x00c6, 0x0126, 0x2091, 0x8000, 0x080c, 0xa888, 0x0106,
+	0x0036, 0x2019, 0x0029, 0x00c1, 0x003e, 0x010e, 0x090c, 0xa8a4,
+	0x9180, 0x1000, 0x2004, 0x9065, 0x0158, 0x0016, 0x00c6, 0x2061,
+	0x1b31, 0x001e, 0x6112, 0x080c, 0x31ef, 0x001e, 0x080c, 0x65e4,
+	0x012e, 0x00ce, 0x001e, 0x0005, 0x0016, 0x0026, 0x2110, 0x080c,
+	0xa372, 0x080c, 0xe640, 0x002e, 0x001e, 0x0005, 0x2001, 0x1837,
+	0x2004, 0xd0cc, 0x0005, 0x00c6, 0x00b6, 0x080c, 0x74c8, 0x1118,
+	0x20a9, 0x0800, 0x0010, 0x20a9, 0x0782, 0x080c, 0x74c8, 0x1110,
+	0x900e, 0x0010, 0x2009, 0x007e, 0x9180, 0x1000, 0x2004, 0x905d,
+	0x0130, 0x86ff, 0x0110, 0xb800, 0xd0bc, 0x090c, 0x65e4, 0x8108,
+	0x1f04, 0x333c, 0x2061, 0x1800, 0x607f, 0x0000, 0x6080, 0x9084,
+	0x00ff, 0x6082, 0x60b3, 0x0000, 0x00be, 0x00ce, 0x0005, 0x2001,
+	0x1869, 0x2004, 0xd0bc, 0x0005, 0x2011, 0x1848, 0x2214, 0xd2ec,
+	0x0005, 0x0026, 0x2011, 0x1867, 0x2214, 0xd2dc, 0x002e, 0x0005,
+	0x7eef, 0x7de8, 0x7ce4, 0x80e2, 0x7be1, 0x80e0, 0x80dc, 0x80da,
+	0x7ad9, 0x80d6, 0x80d5, 0x80d4, 0x80d3, 0x80d2, 0x80d1, 0x79ce,
+	0x78cd, 0x80cc, 0x80cb, 0x80ca, 0x80c9, 0x80c7, 0x80c6, 0x77c5,
+	0x76c3, 0x80bc, 0x80ba, 0x75b9, 0x80b6, 0x74b5, 0x73b4, 0x72b3,
+	0x80b2, 0x80b1, 0x80ae, 0x71ad, 0x80ac, 0x70ab, 0x6faa, 0x6ea9,
+	0x80a7, 0x6da6, 0x6ca5, 0x6ba3, 0x6a9f, 0x699e, 0x689d, 0x809b,
+	0x8098, 0x6797, 0x6690, 0x658f, 0x6488, 0x6384, 0x6282, 0x8081,
+	0x8080, 0x617c, 0x607a, 0x8079, 0x5f76, 0x8075, 0x8074, 0x8073,
+	0x8072, 0x8071, 0x806e, 0x5e6d, 0x806c, 0x5d6b, 0x5c6a, 0x5b69,
+	0x8067, 0x5a66, 0x5965, 0x5863, 0x575c, 0x565a, 0x5559, 0x8056,
+	0x8055, 0x5454, 0x5353, 0x5252, 0x5151, 0x504e, 0x4f4d, 0x804c,
+	0x804b, 0x4e4a, 0x4d49, 0x8047, 0x4c46, 0x8045, 0x8043, 0x803c,
+	0x803a, 0x8039, 0x8036, 0x4b35, 0x8034, 0x4a33, 0x4932, 0x4831,
+	0x802e, 0x472d, 0x462c, 0x452b, 0x442a, 0x4329, 0x4227, 0x8026,
+	0x8025, 0x4123, 0x401f, 0x3f1e, 0x3e1d, 0x3d1b, 0x3c18, 0x8017,
+	0x8010, 0x3b0f, 0x3a08, 0x8004, 0x3902, 0x8001, 0x8000, 0x8000,
+	0x3800, 0x3700, 0x3600, 0x8000, 0x3500, 0x8000, 0x8000, 0x8000,
+	0x3400, 0x8000, 0x8000, 0x8000, 0x8000, 0x8000, 0x8000, 0x3300,
+	0x3200, 0x8000, 0x8000, 0x8000, 0x8000, 0x8000, 0x8000, 0x3100,
+	0x3000, 0x8000, 0x8000, 0x2f00, 0x8000, 0x2e00, 0x2d00, 0x2c00,
+	0x8000, 0x8000, 0x8000, 0x2b00, 0x8000, 0x2a00, 0x2900, 0x2800,
+	0x8000, 0x2700, 0x2600, 0x2500, 0x2400, 0x2300, 0x2200, 0x8000,
+	0x8000, 0x2100, 0x2000, 0x1f00, 0x1e00, 0x1d00, 0x1c00, 0x8000,
+	0x8000, 0x1b00, 0x1a00, 0x8000, 0x1900, 0x8000, 0x8000, 0x8000,
+	0x8000, 0x8000, 0x8000, 0x1800, 0x8000, 0x1700, 0x1600, 0x1500,
+	0x8000, 0x1400, 0x1300, 0x1200, 0x1100, 0x1000, 0x0f00, 0x8000,
+	0x8000, 0x0e00, 0x0d00, 0x0c00, 0x0b00, 0x0a00, 0x0900, 0x8000,
+	0x8000, 0x0800, 0x0700, 0x8000, 0x0600, 0x8000, 0x8000, 0x8000,
+	0x0500, 0x0400, 0x0300, 0x8000, 0x0200, 0x8000, 0x8000, 0x8000,
+	0x0100, 0x8000, 0x8000, 0x8000, 0x8000, 0x8000, 0x8000, 0x0000,
+	0x8000, 0x8000, 0x8000, 0x8000, 0x8000, 0x8000, 0x8000, 0x8000,
 	0x8000, 0x8000, 0x8000, 0x8000, 0x8000, 0x8000, 0x8000, 0x8000,
-	0x8000, 0x8000, 0x8000, 0x8000, 0x2071, 0x189e, 0x7003, 0x0002,
-	0x9006, 0x7016, 0x701a, 0x704a, 0x704e, 0x700e, 0x7042, 0x7046,
-	0x703b, 0x18ba, 0x703f, 0x18ba, 0x7007, 0x0001, 0x080c, 0x1053,
-	0x090c, 0x0d7d, 0x2900, 0x706a, 0xa867, 0x0002, 0xa8ab, 0xdcb0,
-	0x080c, 0x1053, 0x090c, 0x0d7d, 0x2900, 0x706e, 0xa867, 0x0002,
-	0xa8ab, 0xdcb0, 0x0005, 0x2071, 0x189e, 0x7004, 0x0002, 0x34a3,
-	0x34a4, 0x34b7, 0x34cb, 0x0005, 0x1004, 0x34b4, 0x0e04, 0x34b4,
-	0x2079, 0x0000, 0x0126, 0x2091, 0x8000, 0x700c, 0x9005, 0x1128,
-	0x700f, 0x0001, 0x012e, 0x0468, 0x0005, 0x012e, 0x0ce8, 0x2079,
-	0x0000, 0x2061, 0x18b8, 0x2c4c, 0xa86c, 0x908e, 0x0100, 0x0128,
-	0x9086, 0x0200, 0x0904, 0x359f, 0x0005, 0x7018, 0x2048, 0x2061,
-	0x1800, 0x701c, 0x0807, 0x7014, 0x2048, 0xa864, 0x9094, 0x00ff,
-	0x9296, 0x0029, 0x1120, 0xaa78, 0xd2fc, 0x0128, 0x0005, 0x9086,
-	0x0103, 0x0108, 0x0005, 0x2079, 0x0000, 0x2061, 0x1800, 0x701c,
-	0x0807, 0x2061, 0x1800, 0x7880, 0x908a, 0x0040, 0x1210, 0x61d0,
-	0x0042, 0x2100, 0x908a, 0x003f, 0x1a04, 0x359c, 0x61d0, 0x0804,
-	0x3531, 0x3573, 0x35ab, 0x35b5, 0x35b9, 0x35c3, 0x35c9, 0x35cd,
-	0x35dd, 0x35e0, 0x35ea, 0x35ef, 0x35f4, 0x35ff, 0x360a, 0x3619,
-	0x3628, 0x3636, 0x364d, 0x3668, 0x359c, 0x3711, 0x374f, 0x37f4,
-	0x3805, 0x3828, 0x359c, 0x359c, 0x359c, 0x3860, 0x3880, 0x3889,
-	0x38b5, 0x38bb, 0x359c, 0x3901, 0x359c, 0x359c, 0x359c, 0x359c,
-	0x359c, 0x390c, 0x3915, 0x391d, 0x391f, 0x359c, 0x359c, 0x359c,
-	0x359c, 0x359c, 0x359c, 0x394f, 0x359c, 0x359c, 0x359c, 0x359c,
-	0x359c, 0x396c, 0x39d0, 0x359c, 0x359c, 0x359c, 0x359c, 0x359c,
-	0x359c, 0x0002, 0x39fa, 0x39fd, 0x3a5c, 0x3a75, 0x3aa5, 0x3d47,
-	0x359c, 0x52ab, 0x359c, 0x359c, 0x359c, 0x359c, 0x359c, 0x359c,
-	0x359c, 0x359c, 0x35ea, 0x35ef, 0x4246, 0x56fe, 0x4264, 0x533a,
-	0x538b, 0x548e, 0x359c, 0x54f0, 0x552c, 0x555d, 0x5669, 0x558a,
-	0x55e9, 0x359c, 0x4268, 0x441d, 0x4433, 0x4458, 0x44bd, 0x4531,
-	0x4551, 0x45c8, 0x4624, 0x4680, 0x4683, 0x46a8, 0x4718, 0x4782,
-	0x478a, 0x48bc, 0x4a31, 0x4a65, 0x4cc9, 0x359c, 0x4ce7, 0x4d93,
-	0x4e75, 0x4ecf, 0x359c, 0x4f84, 0x359c, 0x4fea, 0x5005, 0x478a,
-	0x524b, 0x714c, 0x0000, 0x2021, 0x4000, 0x080c, 0x4ae3, 0x0126,
-	0x2091, 0x8000, 0x0e04, 0x357d, 0x0010, 0x012e, 0x0cc0, 0x7c36,
-	0x9486, 0x4000, 0x0118, 0x7833, 0x0011, 0x0010, 0x7833, 0x0010,
-	0x7c82, 0x7986, 0x7a8a, 0x7b8e, 0x2091, 0x4080, 0x2001, 0x0089,
-	0x2004, 0xd084, 0x190c, 0x11d6, 0x7007, 0x0001, 0x2091, 0x5000,
-	0x700f, 0x0000, 0x012e, 0x0005, 0x2021, 0x4001, 0x08b0, 0x2021,
-	0x4002, 0x0898, 0x2021, 0x4003, 0x0880, 0x2021, 0x4005, 0x0868,
-	0x2021, 0x4006, 0x0850, 0x2039, 0x0001, 0x902e, 0x2520, 0x7b88,
-	0x7a8c, 0x7884, 0x7990, 0x0804, 0x4af0, 0x7883, 0x0004, 0x7884,
-	0x0807, 0x2039, 0x0001, 0x902e, 0x2520, 0x7b88, 0x7a8c, 0x7884,
-	0x7990, 0x0804, 0x4af3, 0x7984, 0x7888, 0x2114, 0x200a, 0x0804,
-	0x3573, 0x7984, 0x2114, 0x0804, 0x3573, 0x20e1, 0x0000, 0x2099,
+	0x2071, 0x189e, 0x7003, 0x0002, 0x9006, 0x7016, 0x701a, 0x704a,
+	0x704e, 0x700e, 0x7042, 0x7046, 0x703b, 0x18ba, 0x703f, 0x18ba,
+	0x7007, 0x0001, 0x080c, 0x1053, 0x090c, 0x0d7d, 0x2900, 0x706a,
+	0xa867, 0x0002, 0xa8ab, 0xdcb0, 0x080c, 0x1053, 0x090c, 0x0d7d,
+	0x2900, 0x706e, 0xa867, 0x0002, 0xa8ab, 0xdcb0, 0x0005, 0x2071,
+	0x189e, 0x7004, 0x0002, 0x3497, 0x3498, 0x34ab, 0x34bf, 0x0005,
+	0x1004, 0x34a8, 0x0e04, 0x34a8, 0x2079, 0x0000, 0x0126, 0x2091,
+	0x8000, 0x700c, 0x9005, 0x1128, 0x700f, 0x0001, 0x012e, 0x0468,
+	0x0005, 0x012e, 0x0ce8, 0x2079, 0x0000, 0x2061, 0x18b8, 0x2c4c,
+	0xa86c, 0x908e, 0x0100, 0x0128, 0x9086, 0x0200, 0x0904, 0x3593,
+	0x0005, 0x7018, 0x2048, 0x2061, 0x1800, 0x701c, 0x0807, 0x7014,
+	0x2048, 0xa864, 0x9094, 0x00ff, 0x9296, 0x0029, 0x1120, 0xaa78,
+	0xd2fc, 0x0128, 0x0005, 0x9086, 0x0103, 0x0108, 0x0005, 0x2079,
+	0x0000, 0x2061, 0x1800, 0x701c, 0x0807, 0x2061, 0x1800, 0x7880,
+	0x908a, 0x0040, 0x1210, 0x61d0, 0x0042, 0x2100, 0x908a, 0x003f,
+	0x1a04, 0x3590, 0x61d0, 0x0804, 0x3525, 0x3567, 0x359f, 0x3590,
+	0x35a9, 0x35b3, 0x35b9, 0x35bd, 0x35cd, 0x35d1, 0x35e7, 0x35ed,
+	0x35f3, 0x35fe, 0x3609, 0x3618, 0x3627, 0x3635, 0x364c, 0x3667,
+	0x3590, 0x3710, 0x374e, 0x37f3, 0x3804, 0x3827, 0x3590, 0x3590,
+	0x3590, 0x385f, 0x387f, 0x3888, 0x38b4, 0x38ba, 0x3590, 0x3900,
+	0x3590, 0x3590, 0x3590, 0x3590, 0x3590, 0x390b, 0x3914, 0x391c,
+	0x391e, 0x3590, 0x3590, 0x3590, 0x3590, 0x3590, 0x3590, 0x394e,
+	0x3590, 0x3590, 0x3590, 0x3590, 0x3590, 0x396b, 0x39cf, 0x3590,
+	0x3590, 0x3590, 0x3590, 0x3590, 0x3590, 0x0002, 0x39f9, 0x39fc,
+	0x3a5b, 0x3a74, 0x3aa4, 0x3d46, 0x3590, 0x52a6, 0x3590, 0x3590,
+	0x3590, 0x3590, 0x3590, 0x3590, 0x3590, 0x3590, 0x35e7, 0x35ed,
+	0x4245, 0x56f9, 0x4263, 0x5335, 0x5386, 0x5489, 0x3590, 0x54eb,
+	0x5527, 0x5558, 0x5664, 0x5585, 0x55e4, 0x3590, 0x4267, 0x441c,
+	0x4432, 0x4457, 0x44bc, 0x4530, 0x4550, 0x45c7, 0x4623, 0x467f,
+	0x4682, 0x46a7, 0x4717, 0x4781, 0x4789, 0x48bb, 0x4a33, 0x4a67,
+	0x4ccb, 0x3590, 0x4ce9, 0x4d8e, 0x4e70, 0x4eca, 0x3590, 0x4f7f,
+	0x3590, 0x4fe5, 0x5000, 0x4789, 0x5246, 0x714c, 0x0000, 0x2021,
+	0x4000, 0x080c, 0x4ae5, 0x0126, 0x2091, 0x8000, 0x0e04, 0x3571,
+	0x0010, 0x012e, 0x0cc0, 0x7c36, 0x9486, 0x4000, 0x0118, 0x7833,
+	0x0011, 0x0010, 0x7833, 0x0010, 0x7c82, 0x7986, 0x7a8a, 0x7b8e,
+	0x2091, 0x4080, 0x2001, 0x0089, 0x2004, 0xd084, 0x190c, 0x11e1,
+	0x7007, 0x0001, 0x2091, 0x5000, 0x700f, 0x0000, 0x012e, 0x0005,
+	0x2021, 0x4001, 0x08b0, 0x2021, 0x4002, 0x0898, 0x2021, 0x4003,
+	0x0880, 0x2021, 0x4005, 0x0868, 0x2021, 0x4006, 0x0850, 0x2039,
+	0x0001, 0x902e, 0x2520, 0x7b88, 0x7a8c, 0x7884, 0x7990, 0x0804,
+	0x4af2, 0x2039, 0x0001, 0x902e, 0x2520, 0x7b88, 0x7a8c, 0x7884,
+	0x7990, 0x0804, 0x4af5, 0x7984, 0x7888, 0x2114, 0x200a, 0x0804,
+	0x3567, 0x7984, 0x2114, 0x0804, 0x3567, 0x20e1, 0x0000, 0x2099,
 	0x0021, 0x20e9, 0x0000, 0x20a1, 0x0021, 0x20a9, 0x001f, 0x4003,
-	0x7984, 0x7a88, 0x7b8c, 0x0804, 0x3573, 0x7884, 0x2060, 0x04d8,
-	0x2009, 0x0003, 0x2011, 0x0002, 0x2019, 0x001c, 0x789b, 0x0137,
-	0x0804, 0x3573, 0x2039, 0x0001, 0x7d98, 0x7c9c, 0x0800, 0x2039,
-	0x0001, 0x7d98, 0x7c9c, 0x0848, 0x79a0, 0x9182, 0x0040, 0x0210,
-	0x0804, 0x35a8, 0x2138, 0x7d98, 0x7c9c, 0x0804, 0x35af, 0x79a0,
-	0x9182, 0x0040, 0x0210, 0x0804, 0x35a8, 0x2138, 0x7d98, 0x7c9c,
-	0x0804, 0x35bd, 0x79a0, 0x9182, 0x0040, 0x0210, 0x0804, 0x35a8,
-	0x21e8, 0x7984, 0x7888, 0x20a9, 0x0001, 0x21a0, 0x4004, 0x0804,
-	0x3573, 0x2061, 0x0800, 0xe10c, 0x9006, 0x2c15, 0x9200, 0x8c60,
-	0x8109, 0x1dd8, 0x2010, 0x9005, 0x0904, 0x3573, 0x0804, 0x35a2,
-	0x79a0, 0x9182, 0x0040, 0x0210, 0x0804, 0x35a8, 0x21e0, 0x20a9,
-	0x0001, 0x7984, 0x2198, 0x4012, 0x0804, 0x3573, 0x2069, 0x1847,
-	0x7884, 0x7990, 0x911a, 0x1a04, 0x35a8, 0x8019, 0x0904, 0x35a8,
-	0x684a, 0x6942, 0x788c, 0x6852, 0x7888, 0x6856, 0x9006, 0x685a,
-	0x685e, 0x080c, 0x781e, 0x0804, 0x3573, 0x2069, 0x1847, 0x7884,
-	0x7994, 0x911a, 0x1a04, 0x35a8, 0x8019, 0x0904, 0x35a8, 0x684e,
-	0x6946, 0x788c, 0x6862, 0x7888, 0x6866, 0x9006, 0x686a, 0x686e,
-	0x0126, 0x2091, 0x8000, 0x080c, 0x6ad5, 0x012e, 0x0804, 0x3573,
-	0x902e, 0x2520, 0x81ff, 0x0120, 0x2009, 0x0001, 0x0804, 0x35a5,
-	0x7984, 0x7b88, 0x7a8c, 0x20a9, 0x0005, 0x20e9, 0x0001, 0x20a1,
-	0x18a6, 0x4101, 0x080c, 0x4aa7, 0x1120, 0x2009, 0x0002, 0x0804,
-	0x35a5, 0x2009, 0x0020, 0xa85c, 0x9080, 0x0019, 0xaf60, 0x080c,
-	0x4af0, 0x701f, 0x368c, 0x0005, 0xa864, 0x2008, 0x9084, 0x00ff,
-	0x9096, 0x0011, 0x0168, 0x9096, 0x0019, 0x0150, 0x9096, 0x0015,
-	0x0138, 0x9096, 0x0048, 0x0120, 0x9096, 0x0029, 0x1904, 0x35a5,
-	0x810f, 0x918c, 0x00ff, 0x0904, 0x35a5, 0x7112, 0x7010, 0x8001,
-	0x0560, 0x7012, 0x080c, 0x4aa7, 0x1120, 0x2009, 0x0002, 0x0804,
-	0x35a5, 0x2009, 0x0020, 0x7068, 0x2040, 0xa28c, 0xa390, 0xa494,
-	0xa598, 0x9290, 0x0040, 0x9399, 0x0000, 0x94a1, 0x0000, 0x95a9,
-	0x0000, 0xa85c, 0x9080, 0x0019, 0xaf60, 0x080c, 0x4af0, 0x701f,
-	0x36ca, 0x0005, 0xa864, 0x9084, 0x00ff, 0x9096, 0x0002, 0x0120,
-	0x9096, 0x000a, 0x1904, 0x35a5, 0x0888, 0x7014, 0x2048, 0xa868,
-	0xc0fd, 0xa86a, 0xa864, 0x9084, 0x00ff, 0x9096, 0x0029, 0x1160,
-	0xc2fd, 0xaa7a, 0x080c, 0x6196, 0x0150, 0x0126, 0x2091, 0x8000,
-	0xa87a, 0xa982, 0x012e, 0x0050, 0x080c, 0x64bf, 0x1128, 0x7007,
-	0x0003, 0x701f, 0x36f6, 0x0005, 0x080c, 0x6fc0, 0x0126, 0x2091,
-	0x8000, 0x20a9, 0x0005, 0x20e1, 0x0001, 0x2099, 0x18a6, 0x400a,
-	0x2100, 0x9210, 0x9399, 0x0000, 0x94a1, 0x0000, 0x95a9, 0x0000,
-	0xa85c, 0x9080, 0x0019, 0x2009, 0x0020, 0x012e, 0xaf60, 0x0804,
-	0x4af3, 0x2091, 0x8000, 0x7837, 0x4000, 0x7833, 0x0010, 0x7883,
-	0x4000, 0x7887, 0x4953, 0x788b, 0x5020, 0x788f, 0x2020, 0x2009,
-	0x017f, 0x2104, 0x7892, 0x3f00, 0x7896, 0x2061, 0x0100, 0x6200,
-	0x2061, 0x0200, 0x603c, 0x8007, 0x9205, 0x789a, 0x2009, 0x04fd,
-	0x2104, 0x789e, 0x2091, 0x5000, 0x2091, 0x4080, 0x2001, 0x0089,
-	0x2004, 0xd084, 0x0180, 0x2001, 0x1a22, 0x2004, 0x9005, 0x0128,
-	0x2001, 0x008b, 0x2004, 0xd0fc, 0x0dd8, 0x2001, 0x008a, 0x2003,
-	0x0002, 0x2003, 0x1001, 0x2071, 0x0080, 0x0804, 0x0427, 0x81ff,
-	0x1904, 0x35a5, 0x7984, 0x080c, 0x6625, 0x1904, 0x35a8, 0x7e98,
-	0x9684, 0x3fff, 0x9082, 0x4000, 0x1a04, 0x35a8, 0x7c88, 0x7d8c,
-	0x080c, 0x6857, 0x080c, 0x67e8, 0x1518, 0x2061, 0x1ddc, 0x0126,
-	0x2091, 0x8000, 0x6000, 0x9086, 0x0000, 0x0148, 0x6014, 0x904d,
-	0x0130, 0xa86c, 0x9406, 0x1118, 0xa870, 0x9506, 0x0150, 0x012e,
-	0x9ce0, 0x001c, 0x2001, 0x181a, 0x2004, 0x9c02, 0x1a04, 0x35a5,
-	0x0c30, 0x080c, 0xc443, 0x012e, 0x0904, 0x35a5, 0x0804, 0x3573,
-	0x900e, 0x2001, 0x0005, 0x080c, 0x6fc0, 0x0126, 0x2091, 0x8000,
-	0x080c, 0xcb3c, 0x080c, 0x6d80, 0x012e, 0x0804, 0x3573, 0x00a6,
-	0x2950, 0xb198, 0x080c, 0x6625, 0x1904, 0x37e1, 0xb6a4, 0x9684,
-	0x3fff, 0x9082, 0x4000, 0x16e8, 0xb49c, 0xb5a0, 0x080c, 0x6857,
-	0x080c, 0x6802, 0x1520, 0x2061, 0x1ddc, 0x0126, 0x2091, 0x8000,
-	0x6000, 0x9086, 0x0000, 0x0148, 0x6014, 0x904d, 0x0130, 0xa86c,
-	0x9406, 0x1118, 0xa870, 0x9506, 0x0158, 0x012e, 0x9ce0, 0x001c,
-	0x2001, 0x181a, 0x2004, 0x9c02, 0x2009, 0x000d, 0x12b0, 0x0c28,
-	0x080c, 0xc443, 0x012e, 0x2009, 0x0003, 0x0178, 0x00e0, 0x900e,
-	0x2001, 0x0005, 0x080c, 0x6fc0, 0x0126, 0x2091, 0x8000, 0x080c,
-	0xcb3c, 0x080c, 0x6d74, 0x012e, 0x0070, 0xb097, 0x4005, 0xb19a,
-	0x0010, 0xb097, 0x4006, 0x900e, 0x9085, 0x0001, 0x2001, 0x0030,
-	0x2a48, 0x00ae, 0x0005, 0xb097, 0x4000, 0x9006, 0x918d, 0x0001,
-	0x2008, 0x2a48, 0x00ae, 0x0005, 0x81ff, 0x1904, 0x35a5, 0x080c,
-	0x4abe, 0x0904, 0x35a8, 0x080c, 0x66ec, 0x0904, 0x35a5, 0x080c,
-	0x685d, 0x0904, 0x35a5, 0x0804, 0x4548, 0x81ff, 0x1904, 0x35a5,
-	0x080c, 0x4ada, 0x0904, 0x35a8, 0x080c, 0x68eb, 0x0904, 0x35a5,
-	0x2019, 0x0005, 0x79a8, 0x080c, 0x6878, 0x0904, 0x35a5, 0x7888,
-	0x908a, 0x1000, 0x1a04, 0x35a8, 0x8003, 0x800b, 0x810b, 0x9108,
-	0x080c, 0x864c, 0x7984, 0xd184, 0x1904, 0x3573, 0x0804, 0x4548,
-	0x0126, 0x2091, 0x8000, 0x81ff, 0x0118, 0x2009, 0x0001, 0x0450,
-	0x2029, 0x07ff, 0x645c, 0x2400, 0x9506, 0x01f8, 0x2508, 0x080c,
-	0x6625, 0x11d8, 0x080c, 0x68eb, 0x1128, 0x2009, 0x0002, 0x62c0,
-	0x2518, 0x00c0, 0x2019, 0x0004, 0x900e, 0x080c, 0x6878, 0x1118,
-	0x2009, 0x0006, 0x0078, 0x7884, 0x908a, 0x1000, 0x1270, 0x8003,
-	0x800b, 0x810b, 0x9108, 0x080c, 0x864c, 0x8529, 0x1ae0, 0x012e,
-	0x0804, 0x3573, 0x012e, 0x0804, 0x35a5, 0x012e, 0x0804, 0x35a8,
-	0x080c, 0x4abe, 0x0904, 0x35a8, 0x080c, 0x66ec, 0x0904, 0x35a5,
-	0x080c, 0xa896, 0xbaa0, 0x2019, 0x0005, 0x00c6, 0x9066, 0x080c,
-	0x93a5, 0x0076, 0x903e, 0x080c, 0x9277, 0x900e, 0x080c, 0xdfeb,
-	0x007e, 0x00ce, 0x080c, 0xa8b2, 0x080c, 0x6857, 0x0804, 0x3573,
-	0x080c, 0x4abe, 0x0904, 0x35a8, 0x080c, 0x6857, 0x2208, 0x0804,
-	0x3573, 0x0156, 0x00d6, 0x00e6, 0x00c6, 0x2069, 0x1910, 0x6810,
-	0x6914, 0x910a, 0x1208, 0x900e, 0x6816, 0x9016, 0x901e, 0x2071,
-	0x19e7, 0x7028, 0x9065, 0x0118, 0x8210, 0x600c, 0x0cd8, 0x2300,
-	0x9218, 0x00ce, 0x00ee, 0x00de, 0x015e, 0x0804, 0x3573, 0x00f6,
-	0x0016, 0x907d, 0x0138, 0x9006, 0x8000, 0x2f0c, 0x81ff, 0x0110,
-	0x2178, 0x0cd0, 0x001e, 0x00fe, 0x0005, 0x2069, 0x1910, 0x6910,
-	0x62bc, 0x0804, 0x3573, 0x81ff, 0x0120, 0x2009, 0x0001, 0x0804,
-	0x35a5, 0x0126, 0x2091, 0x8000, 0x080c, 0x56ee, 0x0128, 0x2009,
-	0x0007, 0x012e, 0x0804, 0x35a5, 0x012e, 0x615c, 0x9190, 0x3374,
-	0x2215, 0x9294, 0x00ff, 0x637c, 0x83ff, 0x0108, 0x6280, 0x67dc,
-	0x97c4, 0x000a, 0x98c6, 0x000a, 0x1118, 0x2031, 0x0001, 0x00e8,
-	0x97c4, 0x0022, 0x98c6, 0x0022, 0x1118, 0x2031, 0x0003, 0x00a8,
-	0x97c4, 0x0012, 0x98c6, 0x0012, 0x1118, 0x2031, 0x0002, 0x0068,
-	0x080c, 0x74e9, 0x1118, 0x2031, 0x0004, 0x0038, 0xd79c, 0x0120,
-	0x2009, 0x0005, 0x0804, 0x35a5, 0x9036, 0x7e9a, 0x7f9e, 0x0804,
-	0x3573, 0x614c, 0x6250, 0x2019, 0x1986, 0x231c, 0x2001, 0x1987,
-	0x2004, 0x789a, 0x0804, 0x3573, 0x0126, 0x2091, 0x8000, 0x6138,
-	0x623c, 0x6340, 0x012e, 0x0804, 0x3573, 0x080c, 0x4ada, 0x0904,
-	0x35a8, 0xba44, 0xbb38, 0x0804, 0x3573, 0x080c, 0x0d7d, 0x080c,
-	0x4ada, 0x2110, 0x0904, 0x35a8, 0xb804, 0x908c, 0x00ff, 0x918e,
-	0x0006, 0x0140, 0x9084, 0xff00, 0x9086, 0x0600, 0x2009, 0x0009,
-	0x1904, 0x35a5, 0x0126, 0x2091, 0x8000, 0x2019, 0x0005, 0x00c6,
-	0x9066, 0x080c, 0xa896, 0x080c, 0xa38a, 0x080c, 0x93a5, 0x0076,
-	0x903e, 0x080c, 0x9277, 0x900e, 0x080c, 0xdfeb, 0x007e, 0x00ce,
-	0x080c, 0xa8b2, 0xb807, 0x0407, 0x012e, 0x0804, 0x3573, 0x614c,
-	0x6250, 0x7884, 0x604e, 0x7b88, 0x6352, 0x2069, 0x1847, 0x831f,
-	0x9305, 0x6816, 0x788c, 0x2069, 0x1986, 0x2d1c, 0x206a, 0x7e98,
-	0x9682, 0x0014, 0x1210, 0x2031, 0x07d0, 0x2069, 0x1987, 0x2d04,
-	0x266a, 0x789a, 0x0804, 0x3573, 0x0126, 0x2091, 0x8000, 0x6138,
-	0x7884, 0x603a, 0x910e, 0xd1b4, 0x190c, 0x0ecc, 0xd0c4, 0x01a8,
-	0x00d6, 0x78a8, 0x2009, 0x199d, 0x200a, 0x78ac, 0x2011, 0x199e,
-	0x2012, 0x2069, 0x0100, 0x6838, 0x9086, 0x0007, 0x1118, 0x2214,
-	0x6a5a, 0x0010, 0x210c, 0x695a, 0x00de, 0x7888, 0x603e, 0x2011,
-	0x0116, 0x220c, 0x7888, 0xd08c, 0x0118, 0x918d, 0x0040, 0x0010,
-	0x918c, 0xff7f, 0x2112, 0x6140, 0x788c, 0x6042, 0x910e, 0xd1e4,
-	0x190c, 0x0ee7, 0x9084, 0x0020, 0x0130, 0x78b4, 0x6046, 0x9084,
-	0x0001, 0x090c, 0x4246, 0x6040, 0xd0cc, 0x0120, 0x78b0, 0x2011,
-	0x0114, 0x2012, 0x012e, 0x0804, 0x3573, 0x00f6, 0x2079, 0x1800,
-	0x7a38, 0xa898, 0x9084, 0xfebf, 0x9215, 0xa89c, 0x9084, 0xfebf,
-	0x8002, 0x9214, 0x7838, 0x9084, 0x0140, 0x9215, 0x7a3a, 0xa897,
-	0x4000, 0x900e, 0x9085, 0x0001, 0x2001, 0x0000, 0x00fe, 0x0005,
-	0x7898, 0x9005, 0x01a8, 0x7888, 0x9025, 0x0904, 0x35a8, 0x788c,
-	0x902d, 0x0904, 0x35a8, 0x900e, 0x080c, 0x6625, 0x1120, 0xba44,
-	0xbb38, 0xbc46, 0xbd3a, 0x9186, 0x07ff, 0x0190, 0x8108, 0x0ca0,
-	0x080c, 0x4ada, 0x0904, 0x35a8, 0x7888, 0x900d, 0x0904, 0x35a8,
-	0x788c, 0x9005, 0x0904, 0x35a8, 0xba44, 0xb946, 0xbb38, 0xb83a,
-	0x0804, 0x3573, 0x2011, 0xbc09, 0x0010, 0x2011, 0xbc05, 0x080c,
-	0x56ee, 0x1904, 0x35a5, 0x00c6, 0x2061, 0x0100, 0x7984, 0x9186,
-	0x00ff, 0x1130, 0x2001, 0x1818, 0x2004, 0x9085, 0xff00, 0x0088,
-	0x9182, 0x007f, 0x16e0, 0x9188, 0x3374, 0x210d, 0x918c, 0x00ff,
-	0x2001, 0x1818, 0x2004, 0x0026, 0x9116, 0x002e, 0x0580, 0x810f,
-	0x9105, 0x0126, 0x2091, 0x8000, 0x0006, 0x080c, 0xab97, 0x000e,
-	0x0510, 0x602e, 0x620a, 0x7984, 0x00b6, 0x080c, 0x65ca, 0x2b08,
-	0x00be, 0x1500, 0x6112, 0x6023, 0x0001, 0x080c, 0x4aa7, 0x01d0,
-	0x9006, 0xa866, 0x7007, 0x0003, 0xa832, 0xa868, 0xc0fd, 0xa86a,
-	0x701f, 0x3a55, 0x2900, 0x6016, 0x2009, 0x0032, 0x080c, 0xac8c,
-	0x012e, 0x00ce, 0x0005, 0x012e, 0x00ce, 0x0804, 0x35a5, 0x00ce,
-	0x0804, 0x35a8, 0x080c, 0xabed, 0x0cb0, 0xa830, 0x9086, 0x0100,
-	0x0904, 0x35a5, 0x0804, 0x3573, 0x2061, 0x1a6f, 0x0126, 0x2091,
-	0x8000, 0x6000, 0xd084, 0x0170, 0x6104, 0x6208, 0x2061, 0x1800,
-	0x6354, 0x6074, 0x789a, 0x60c0, 0x789e, 0x60bc, 0x78aa, 0x012e,
-	0x0804, 0x3573, 0x900e, 0x2110, 0x0c88, 0x81ff, 0x1904, 0x35a5,
-	0x080c, 0x74e9, 0x0904, 0x35a5, 0x0126, 0x2091, 0x8000, 0x6254,
-	0x6074, 0x9202, 0x0248, 0x9085, 0x0001, 0x080c, 0x2664, 0x080c,
-	0x5908, 0x012e, 0x0804, 0x3573, 0x012e, 0x0804, 0x35a8, 0x0006,
-	0x0016, 0x00c6, 0x00e6, 0x2001, 0x19a9, 0x2070, 0x2061, 0x1847,
-	0x6008, 0x2072, 0x900e, 0x2011, 0x1400, 0x080c, 0x9166, 0x7206,
-	0x00ee, 0x00ce, 0x001e, 0x000e, 0x0005, 0x0126, 0x2091, 0x8000,
-	0x81ff, 0x0128, 0x012e, 0x2021, 0x400b, 0x0804, 0x3575, 0x7884,
-	0xd0fc, 0x0148, 0x2001, 0x002a, 0x2004, 0x9082, 0x00e1, 0x0288,
-	0x012e, 0x0804, 0x35a8, 0x2001, 0x002a, 0x2004, 0x2069, 0x1847,
-	0x6908, 0x9102, 0x1230, 0x012e, 0x0804, 0x35a8, 0x012e, 0x0804,
-	0x35a5, 0x080c, 0xab57, 0x0dd0, 0x7884, 0xd0fc, 0x0904, 0x3b20,
-	0x00c6, 0x080c, 0x4aa7, 0x00ce, 0x0d88, 0xa867, 0x0000, 0x7884,
-	0xa80a, 0x7898, 0xa80e, 0x789c, 0xa812, 0x2001, 0x002e, 0x2004,
-	0xa81a, 0x2001, 0x002f, 0x2004, 0xa81e, 0x2001, 0x0030, 0x2004,
-	0xa822, 0x2001, 0x0031, 0x2004, 0xa826, 0x2001, 0x0034, 0x2004,
-	0xa82a, 0x2001, 0x0035, 0x2004, 0xa82e, 0x2001, 0x002a, 0x2004,
-	0x9080, 0x0003, 0x9084, 0x00fc, 0x8004, 0xa816, 0x080c, 0x3caa,
-	0x0928, 0x7014, 0x2048, 0xad2c, 0xac28, 0xab1c, 0xaa18, 0xa930,
-	0xa808, 0xd0b4, 0x1120, 0x2029, 0x0000, 0x2021, 0x0000, 0x8906,
-	0x8006, 0x8007, 0x90bc, 0x003f, 0x9084, 0xffc0, 0x9080, 0x001b,
-	0x080c, 0x4af0, 0x701f, 0x3be7, 0x7023, 0x0001, 0x012e, 0x0005,
-	0x080c, 0xa896, 0x0046, 0x0086, 0x0096, 0x00a6, 0x00b6, 0x00c6,
-	0x00d6, 0x00e6, 0x00f6, 0x080c, 0x3a8f, 0x2001, 0x199f, 0x2003,
-	0x0000, 0x2021, 0x000a, 0x2061, 0x0100, 0x6104, 0x0016, 0x60bb,
-	0x0000, 0x60bf, 0x32e1, 0x60bf, 0x0012, 0x080c, 0x3d19, 0x080c,
-	0x3cd8, 0x00f6, 0x00e6, 0x0086, 0x2940, 0x2071, 0x19e7, 0x2079,
-	0x0090, 0x00d6, 0x2069, 0x0000, 0x6884, 0xd0b4, 0x0140, 0x2001,
-	0x0035, 0x2004, 0x780e, 0x2001, 0x0034, 0x2004, 0x780a, 0x00de,
-	0x2011, 0x0001, 0x080c, 0x408a, 0x008e, 0x00ee, 0x00fe, 0x080c,
-	0x3fb7, 0x080c, 0x3ee4, 0x05b8, 0x2001, 0x020b, 0x2004, 0x9084,
-	0x0140, 0x1db8, 0x080c, 0x40fe, 0x00f6, 0x2079, 0x0300, 0x78bc,
-	0x00fe, 0x908c, 0x0070, 0x1560, 0x2071, 0x0200, 0x7037, 0x0000,
-	0x7050, 0x9084, 0xff00, 0x9086, 0x3200, 0x1510, 0x7037, 0x0001,
-	0x7050, 0x9084, 0xff00, 0x9086, 0xe100, 0x11d0, 0x7037, 0x0000,
-	0x7054, 0x7037, 0x0000, 0x715c, 0x9106, 0x1190, 0x2001, 0x1820,
-	0x2004, 0x9106, 0x1168, 0x00c6, 0x2061, 0x0100, 0x6024, 0x9084,
-	0x1e00, 0x00ce, 0x0138, 0x080c, 0x3eee, 0x080c, 0x3cd3, 0x0058,
-	0x080c, 0x3cd3, 0x080c, 0x4022, 0x080c, 0x3fad, 0x2001, 0x020b,
-	0x2004, 0xd0e4, 0x0dd8, 0x2001, 0x032a, 0x2003, 0x0004, 0x2061,
-	0x0100, 0x6027, 0x0002, 0x001e, 0x6106, 0x2011, 0x020d, 0x2013,
-	0x0020, 0x60bb, 0x0000, 0x60bf, 0x0108, 0x60bf, 0x0012, 0x2001,
-	0x0004, 0x200c, 0x918c, 0xfffd, 0x2102, 0x080c, 0x1328, 0x2009,
-	0x0028, 0x080c, 0x21b0, 0x2001, 0x0227, 0x200c, 0x2102, 0x080c,
-	0xa8b2, 0x00fe, 0x00ee, 0x00de, 0x00ce, 0x00be, 0x00ae, 0x009e,
-	0x008e, 0x004e, 0x2001, 0x199f, 0x2004, 0x9005, 0x1118, 0x012e,
-	0x0804, 0x3573, 0x012e, 0x2021, 0x400c, 0x0804, 0x3575, 0x0016,
-	0x0026, 0x0036, 0x0046, 0x0056, 0x0076, 0x0086, 0x0096, 0x00d6,
-	0x0156, 0x7014, 0x2048, 0x7020, 0x20a8, 0x8000, 0x7022, 0xa804,
-	0x9005, 0x0904, 0x3c43, 0x2048, 0x1f04, 0x3bf7, 0x7068, 0x2040,
-	0xa28c, 0xa390, 0xa494, 0xa598, 0xa930, 0xa808, 0xd0b4, 0x1120,
-	0x2029, 0x0000, 0x2021, 0x0000, 0x0096, 0x7014, 0x2048, 0xa864,
-	0x009e, 0x9086, 0x0103, 0x0170, 0x8906, 0x8006, 0x8007, 0x90bc,
-	0x003f, 0x9084, 0xffc0, 0x9080, 0x001b, 0x080c, 0x4af0, 0x701f,
-	0x3be7, 0x00b0, 0x8906, 0x8006, 0x8007, 0x90bc, 0x003f, 0x9084,
-	0xffc0, 0x9080, 0x001b, 0x21a8, 0x27e0, 0x2098, 0x27e8, 0x20a0,
-	0x0006, 0x080c, 0x0fb7, 0x000e, 0x080c, 0x4af3, 0x701f, 0x3be7,
-	0x015e, 0x00de, 0x009e, 0x008e, 0x007e, 0x005e, 0x004e, 0x003e,
-	0x002e, 0x001e, 0x0005, 0x7014, 0x2048, 0xa864, 0x9086, 0x0103,
-	0x1118, 0x701f, 0x3ca8, 0x0450, 0x7014, 0x2048, 0xa868, 0xc0fd,
-	0xa86a, 0x2009, 0x007f, 0x080c, 0x65c4, 0x0110, 0x9006, 0x0030,
-	0xb813, 0x00ff, 0xb817, 0xfffd, 0x080c, 0xcd1b, 0x015e, 0x00de,
-	0x009e, 0x008e, 0x007e, 0x005e, 0x004e, 0x003e, 0x002e, 0x001e,
-	0x0904, 0x35a5, 0x0016, 0x0026, 0x0036, 0x0046, 0x0056, 0x0076,
-	0x0086, 0x0096, 0x00d6, 0x0156, 0x701f, 0x3c7a, 0x7007, 0x0003,
-	0x0804, 0x3c38, 0xa830, 0x9086, 0x0100, 0x2021, 0x400c, 0x0904,
-	0x3575, 0x0076, 0xad10, 0xac0c, 0xab24, 0xaa20, 0xa930, 0xa808,
+	0x7984, 0x7a88, 0x7b8c, 0x0804, 0x3567, 0x7884, 0x2060, 0x0804,
+	0x361a, 0x2009, 0x0003, 0x2011, 0x0002, 0x2019, 0x001e, 0x789b,
+	0x0137, 0x7893, 0xffff, 0x2001, 0x188f, 0x2004, 0x9005, 0x0118,
+	0x7896, 0x0804, 0x3567, 0x7897, 0x0001, 0x0804, 0x3567, 0x2039,
+	0x0001, 0x7d98, 0x7c9c, 0x0804, 0x35a3, 0x2039, 0x0001, 0x7d98,
+	0x7c9c, 0x0804, 0x35ad, 0x79a0, 0x9182, 0x0040, 0x0210, 0x0804,
+	0x359c, 0x2138, 0x7d98, 0x7c9c, 0x0804, 0x35a3, 0x79a0, 0x9182,
+	0x0040, 0x0210, 0x0804, 0x359c, 0x2138, 0x7d98, 0x7c9c, 0x0804,
+	0x35ad, 0x79a0, 0x9182, 0x0040, 0x0210, 0x0804, 0x359c, 0x21e8,
+	0x7984, 0x7888, 0x20a9, 0x0001, 0x21a0, 0x4004, 0x0804, 0x3567,
+	0x2061, 0x0800, 0xe10c, 0x9006, 0x2c15, 0x9200, 0x8c60, 0x8109,
+	0x1dd8, 0x2010, 0x9005, 0x0904, 0x3567, 0x0804, 0x3596, 0x79a0,
+	0x9182, 0x0040, 0x0210, 0x0804, 0x359c, 0x21e0, 0x20a9, 0x0001,
+	0x7984, 0x2198, 0x4012, 0x0804, 0x3567, 0x2069, 0x1847, 0x7884,
+	0x7990, 0x911a, 0x1a04, 0x359c, 0x8019, 0x0904, 0x359c, 0x684a,
+	0x6942, 0x788c, 0x6852, 0x7888, 0x6856, 0x9006, 0x685a, 0x685e,
+	0x080c, 0x77fd, 0x0804, 0x3567, 0x2069, 0x1847, 0x7884, 0x7994,
+	0x911a, 0x1a04, 0x359c, 0x8019, 0x0904, 0x359c, 0x684e, 0x6946,
+	0x788c, 0x6862, 0x7888, 0x6866, 0x9006, 0x686a, 0x686e, 0x0126,
+	0x2091, 0x8000, 0x080c, 0x6ad0, 0x012e, 0x0804, 0x3567, 0x902e,
+	0x2520, 0x81ff, 0x0120, 0x2009, 0x0001, 0x0804, 0x3599, 0x7984,
+	0x7b88, 0x7a8c, 0x20a9, 0x0005, 0x20e9, 0x0001, 0x20a1, 0x18a6,
+	0x4101, 0x080c, 0x4aa9, 0x1120, 0x2009, 0x0002, 0x0804, 0x3599,
+	0x2009, 0x0020, 0xa85c, 0x9080, 0x0019, 0xaf60, 0x080c, 0x4af2,
+	0x701f, 0x368b, 0x0005, 0xa864, 0x2008, 0x9084, 0x00ff, 0x9096,
+	0x0011, 0x0168, 0x9096, 0x0019, 0x0150, 0x9096, 0x0015, 0x0138,
+	0x9096, 0x0048, 0x0120, 0x9096, 0x0029, 0x1904, 0x3599, 0x810f,
+	0x918c, 0x00ff, 0x0904, 0x3599, 0x7112, 0x7010, 0x8001, 0x0560,
+	0x7012, 0x080c, 0x4aa9, 0x1120, 0x2009, 0x0002, 0x0804, 0x3599,
+	0x2009, 0x0020, 0x7068, 0x2040, 0xa28c, 0xa390, 0xa494, 0xa598,
+	0x9290, 0x0040, 0x9399, 0x0000, 0x94a1, 0x0000, 0x95a9, 0x0000,
+	0xa85c, 0x9080, 0x0019, 0xaf60, 0x080c, 0x4af2, 0x701f, 0x36c9,
+	0x0005, 0xa864, 0x9084, 0x00ff, 0x9096, 0x0002, 0x0120, 0x9096,
+	0x000a, 0x1904, 0x3599, 0x0888, 0x7014, 0x2048, 0xa868, 0xc0fd,
+	0xa86a, 0xa864, 0x9084, 0x00ff, 0x9096, 0x0029, 0x1160, 0xc2fd,
+	0xaa7a, 0x080c, 0x6191, 0x0150, 0x0126, 0x2091, 0x8000, 0xa87a,
+	0xa982, 0x012e, 0x0050, 0x080c, 0x64ba, 0x1128, 0x7007, 0x0003,
+	0x701f, 0x36f5, 0x0005, 0x080c, 0x6faf, 0x0126, 0x2091, 0x8000,
+	0x20a9, 0x0005, 0x20e1, 0x0001, 0x2099, 0x18a6, 0x400a, 0x2100,
+	0x9210, 0x9399, 0x0000, 0x94a1, 0x0000, 0x95a9, 0x0000, 0xa85c,
+	0x9080, 0x0019, 0x2009, 0x0020, 0x012e, 0xaf60, 0x0804, 0x4af5,
+	0x2091, 0x8000, 0x7837, 0x4000, 0x7833, 0x0010, 0x7883, 0x4000,
+	0x7887, 0x4953, 0x788b, 0x5020, 0x788f, 0x2020, 0x2009, 0x017f,
+	0x2104, 0x7892, 0x3f00, 0x7896, 0x2061, 0x0100, 0x6200, 0x2061,
+	0x0200, 0x603c, 0x8007, 0x9205, 0x789a, 0x2009, 0x04fd, 0x2104,
+	0x789e, 0x2091, 0x5000, 0x2091, 0x4080, 0x2001, 0x0089, 0x2004,
+	0xd084, 0x0180, 0x2001, 0x1a21, 0x2004, 0x9005, 0x0128, 0x2001,
+	0x008b, 0x2004, 0xd0fc, 0x0dd8, 0x2001, 0x008a, 0x2003, 0x0002,
+	0x2003, 0x1001, 0x2071, 0x0080, 0x0804, 0x0427, 0x81ff, 0x1904,
+	0x3599, 0x7984, 0x080c, 0x6620, 0x1904, 0x359c, 0x7e98, 0x9684,
+	0x3fff, 0x9082, 0x4000, 0x1a04, 0x359c, 0x7c88, 0x7d8c, 0x080c,
+	0x6856, 0x080c, 0x67e3, 0x1518, 0x2061, 0x1ddc, 0x0126, 0x2091,
+	0x8000, 0x6000, 0x9086, 0x0000, 0x0148, 0x6014, 0x904d, 0x0130,
+	0xa86c, 0x9406, 0x1118, 0xa870, 0x9506, 0x0150, 0x012e, 0x9ce0,
+	0x001c, 0x2001, 0x181a, 0x2004, 0x9c02, 0x1a04, 0x3599, 0x0c30,
+	0x080c, 0xc430, 0x012e, 0x0904, 0x3599, 0x0804, 0x3567, 0x900e,
+	0x2001, 0x0005, 0x080c, 0x6faf, 0x0126, 0x2091, 0x8000, 0x080c,
+	0xcb3b, 0x080c, 0x6d7b, 0x012e, 0x0804, 0x3567, 0x00a6, 0x2950,
+	0xb198, 0x080c, 0x6620, 0x1904, 0x37e0, 0xb6a4, 0x9684, 0x3fff,
+	0x9082, 0x4000, 0x16e8, 0xb49c, 0xb5a0, 0x080c, 0x6856, 0x080c,
+	0x6800, 0x1520, 0x2061, 0x1ddc, 0x0126, 0x2091, 0x8000, 0x6000,
+	0x9086, 0x0000, 0x0148, 0x6014, 0x904d, 0x0130, 0xa86c, 0x9406,
+	0x1118, 0xa870, 0x9506, 0x0158, 0x012e, 0x9ce0, 0x001c, 0x2001,
+	0x181a, 0x2004, 0x9c02, 0x2009, 0x000d, 0x12b0, 0x0c28, 0x080c,
+	0xc430, 0x012e, 0x2009, 0x0003, 0x0178, 0x00e0, 0x900e, 0x2001,
+	0x0005, 0x080c, 0x6faf, 0x0126, 0x2091, 0x8000, 0x080c, 0xcb3b,
+	0x080c, 0x6d6f, 0x012e, 0x0070, 0xb097, 0x4005, 0xb19a, 0x0010,
+	0xb097, 0x4006, 0x900e, 0x9085, 0x0001, 0x2001, 0x0030, 0x2a48,
+	0x00ae, 0x0005, 0xb097, 0x4000, 0x9006, 0x918d, 0x0001, 0x2008,
+	0x2a48, 0x00ae, 0x0005, 0x81ff, 0x1904, 0x3599, 0x080c, 0x4ac0,
+	0x0904, 0x359c, 0x080c, 0x66e7, 0x0904, 0x3599, 0x080c, 0x685c,
+	0x0904, 0x3599, 0x0804, 0x4547, 0x81ff, 0x1904, 0x3599, 0x080c,
+	0x4adc, 0x0904, 0x359c, 0x080c, 0x68ea, 0x0904, 0x3599, 0x2019,
+	0x0005, 0x79a8, 0x080c, 0x6877, 0x0904, 0x3599, 0x7888, 0x908a,
+	0x1000, 0x1a04, 0x359c, 0x8003, 0x800b, 0x810b, 0x9108, 0x080c,
+	0x862b, 0x7984, 0xd184, 0x1904, 0x3567, 0x0804, 0x4547, 0x0126,
+	0x2091, 0x8000, 0x81ff, 0x0118, 0x2009, 0x0001, 0x0450, 0x2029,
+	0x07ff, 0x645c, 0x2400, 0x9506, 0x01f8, 0x2508, 0x080c, 0x6620,
+	0x11d8, 0x080c, 0x68ea, 0x1128, 0x2009, 0x0002, 0x62c0, 0x2518,
+	0x00c0, 0x2019, 0x0004, 0x900e, 0x080c, 0x6877, 0x1118, 0x2009,
+	0x0006, 0x0078, 0x7884, 0x908a, 0x1000, 0x1270, 0x8003, 0x800b,
+	0x810b, 0x9108, 0x080c, 0x862b, 0x8529, 0x1ae0, 0x012e, 0x0804,
+	0x3567, 0x012e, 0x0804, 0x3599, 0x012e, 0x0804, 0x359c, 0x080c,
+	0x4ac0, 0x0904, 0x359c, 0x080c, 0x66e7, 0x0904, 0x3599, 0x080c,
+	0xa888, 0xbaa0, 0x2019, 0x0005, 0x00c6, 0x9066, 0x080c, 0x938d,
+	0x0076, 0x903e, 0x080c, 0x9256, 0x900e, 0x080c, 0xdffb, 0x007e,
+	0x00ce, 0x080c, 0xa8a4, 0x080c, 0x6856, 0x0804, 0x3567, 0x080c,
+	0x4ac0, 0x0904, 0x359c, 0x080c, 0x6856, 0x2208, 0x0804, 0x3567,
+	0x0156, 0x00d6, 0x00e6, 0x00c6, 0x2069, 0x1910, 0x6810, 0x6914,
+	0x910a, 0x1208, 0x900e, 0x6816, 0x9016, 0x901e, 0x2071, 0x19e6,
+	0x7028, 0x9065, 0x0118, 0x8210, 0x600c, 0x0cd8, 0x2300, 0x9218,
+	0x00ce, 0x00ee, 0x00de, 0x015e, 0x0804, 0x3567, 0x00f6, 0x0016,
+	0x907d, 0x0138, 0x9006, 0x8000, 0x2f0c, 0x81ff, 0x0110, 0x2178,
+	0x0cd0, 0x001e, 0x00fe, 0x0005, 0x2069, 0x1910, 0x6910, 0x62bc,
+	0x0804, 0x3567, 0x81ff, 0x0120, 0x2009, 0x0001, 0x0804, 0x3599,
+	0x0126, 0x2091, 0x8000, 0x080c, 0x56e9, 0x0128, 0x2009, 0x0007,
+	0x012e, 0x0804, 0x3599, 0x012e, 0x615c, 0x9190, 0x3368, 0x2215,
+	0x9294, 0x00ff, 0x637c, 0x83ff, 0x0108, 0x6280, 0x67dc, 0x97c4,
+	0x000a, 0x98c6, 0x000a, 0x1118, 0x2031, 0x0001, 0x00e8, 0x97c4,
+	0x0022, 0x98c6, 0x0022, 0x1118, 0x2031, 0x0003, 0x00a8, 0x97c4,
+	0x0012, 0x98c6, 0x0012, 0x1118, 0x2031, 0x0002, 0x0068, 0x080c,
+	0x74c8, 0x1118, 0x2031, 0x0004, 0x0038, 0xd79c, 0x0120, 0x2009,
+	0x0005, 0x0804, 0x3599, 0x9036, 0x7e9a, 0x7f9e, 0x0804, 0x3567,
+	0x614c, 0x6250, 0x2019, 0x1985, 0x231c, 0x2001, 0x1986, 0x2004,
+	0x789a, 0x0804, 0x3567, 0x0126, 0x2091, 0x8000, 0x6138, 0x623c,
+	0x6340, 0x012e, 0x0804, 0x3567, 0x080c, 0x4adc, 0x0904, 0x359c,
+	0xba44, 0xbb38, 0x0804, 0x3567, 0x080c, 0x0d7d, 0x080c, 0x4adc,
+	0x2110, 0x0904, 0x359c, 0xb804, 0x908c, 0x00ff, 0x918e, 0x0006,
+	0x0140, 0x9084, 0xff00, 0x9086, 0x0600, 0x2009, 0x0009, 0x1904,
+	0x3599, 0x0126, 0x2091, 0x8000, 0x2019, 0x0005, 0x00c6, 0x9066,
+	0x080c, 0xa888, 0x080c, 0xa372, 0x080c, 0x938d, 0x0076, 0x903e,
+	0x080c, 0x9256, 0x900e, 0x080c, 0xdffb, 0x007e, 0x00ce, 0x080c,
+	0xa8a4, 0xb807, 0x0407, 0x012e, 0x0804, 0x3567, 0x614c, 0x6250,
+	0x7884, 0x604e, 0x7b88, 0x6352, 0x2069, 0x1847, 0x831f, 0x9305,
+	0x6816, 0x788c, 0x2069, 0x1985, 0x2d1c, 0x206a, 0x7e98, 0x9682,
+	0x0014, 0x1210, 0x2031, 0x07d0, 0x2069, 0x1986, 0x2d04, 0x266a,
+	0x789a, 0x0804, 0x3567, 0x0126, 0x2091, 0x8000, 0x6138, 0x7884,
+	0x603a, 0x910e, 0xd1b4, 0x190c, 0x0ecc, 0xd0c4, 0x01a8, 0x00d6,
+	0x78a8, 0x2009, 0x199c, 0x200a, 0x78ac, 0x2011, 0x199d, 0x2012,
+	0x2069, 0x0100, 0x6838, 0x9086, 0x0007, 0x1118, 0x2214, 0x6a5a,
+	0x0010, 0x210c, 0x695a, 0x00de, 0x7888, 0x603e, 0x2011, 0x0116,
+	0x220c, 0x7888, 0xd08c, 0x0118, 0x918d, 0x0040, 0x0010, 0x918c,
+	0xff7f, 0x2112, 0x6140, 0x788c, 0x6042, 0x910e, 0xd1e4, 0x190c,
+	0x0ee7, 0x9084, 0x0020, 0x0130, 0x78b4, 0x6046, 0x9084, 0x0001,
+	0x090c, 0x4245, 0x6040, 0xd0cc, 0x0120, 0x78b0, 0x2011, 0x0114,
+	0x2012, 0x012e, 0x0804, 0x3567, 0x00f6, 0x2079, 0x1800, 0x7a38,
+	0xa898, 0x9084, 0xfebf, 0x9215, 0xa89c, 0x9084, 0xfebf, 0x8002,
+	0x9214, 0x7838, 0x9084, 0x0140, 0x9215, 0x7a3a, 0xa897, 0x4000,
+	0x900e, 0x9085, 0x0001, 0x2001, 0x0000, 0x00fe, 0x0005, 0x7898,
+	0x9005, 0x01a8, 0x7888, 0x9025, 0x0904, 0x359c, 0x788c, 0x902d,
+	0x0904, 0x359c, 0x900e, 0x080c, 0x6620, 0x1120, 0xba44, 0xbb38,
+	0xbc46, 0xbd3a, 0x9186, 0x07ff, 0x0190, 0x8108, 0x0ca0, 0x080c,
+	0x4adc, 0x0904, 0x359c, 0x7888, 0x900d, 0x0904, 0x359c, 0x788c,
+	0x9005, 0x0904, 0x359c, 0xba44, 0xb946, 0xbb38, 0xb83a, 0x0804,
+	0x3567, 0x2011, 0xbc09, 0x0010, 0x2011, 0xbc05, 0x080c, 0x56e9,
+	0x1904, 0x3599, 0x00c6, 0x2061, 0x0100, 0x7984, 0x9186, 0x00ff,
+	0x1130, 0x2001, 0x1818, 0x2004, 0x9085, 0xff00, 0x0088, 0x9182,
+	0x007f, 0x16e0, 0x9188, 0x3368, 0x210d, 0x918c, 0x00ff, 0x2001,
+	0x1818, 0x2004, 0x0026, 0x9116, 0x002e, 0x0580, 0x810f, 0x9105,
+	0x0126, 0x2091, 0x8000, 0x0006, 0x080c, 0xab89, 0x000e, 0x0510,
+	0x602e, 0x620a, 0x7984, 0x00b6, 0x080c, 0x65c5, 0x2b08, 0x00be,
+	0x1500, 0x6112, 0x6023, 0x0001, 0x080c, 0x4aa9, 0x01d0, 0x9006,
+	0xa866, 0x7007, 0x0003, 0xa832, 0xa868, 0xc0fd, 0xa86a, 0x701f,
+	0x3a54, 0x2900, 0x6016, 0x2009, 0x0032, 0x080c, 0xac7c, 0x012e,
+	0x00ce, 0x0005, 0x012e, 0x00ce, 0x0804, 0x3599, 0x00ce, 0x0804,
+	0x359c, 0x080c, 0xabdf, 0x0cb0, 0xa830, 0x9086, 0x0100, 0x0904,
+	0x3599, 0x0804, 0x3567, 0x2061, 0x1a6e, 0x0126, 0x2091, 0x8000,
+	0x6000, 0xd084, 0x0170, 0x6104, 0x6208, 0x2061, 0x1800, 0x6354,
+	0x6074, 0x789a, 0x60c0, 0x789e, 0x60bc, 0x78aa, 0x012e, 0x0804,
+	0x3567, 0x900e, 0x2110, 0x0c88, 0x81ff, 0x1904, 0x3599, 0x080c,
+	0x74c8, 0x0904, 0x3599, 0x0126, 0x2091, 0x8000, 0x6254, 0x6074,
+	0x9202, 0x0248, 0x9085, 0x0001, 0x080c, 0x267d, 0x080c, 0x5903,
+	0x012e, 0x0804, 0x3567, 0x012e, 0x0804, 0x359c, 0x0006, 0x0016,
+	0x00c6, 0x00e6, 0x2001, 0x19a8, 0x2070, 0x2061, 0x1847, 0x6008,
+	0x2072, 0x900e, 0x2011, 0x1400, 0x080c, 0x9148, 0x7206, 0x00ee,
+	0x00ce, 0x001e, 0x000e, 0x0005, 0x0126, 0x2091, 0x8000, 0x81ff,
+	0x0128, 0x012e, 0x2021, 0x400b, 0x0804, 0x3569, 0x7884, 0xd0fc,
+	0x0148, 0x2001, 0x002a, 0x2004, 0x9082, 0x00e1, 0x0288, 0x012e,
+	0x0804, 0x359c, 0x2001, 0x002a, 0x2004, 0x2069, 0x1847, 0x6908,
+	0x9102, 0x1230, 0x012e, 0x0804, 0x359c, 0x012e, 0x0804, 0x3599,
+	0x080c, 0xab49, 0x0dd0, 0x7884, 0xd0fc, 0x0904, 0x3b1f, 0x00c6,
+	0x080c, 0x4aa9, 0x00ce, 0x0d88, 0xa867, 0x0000, 0x7884, 0xa80a,
+	0x7898, 0xa80e, 0x789c, 0xa812, 0x2001, 0x002e, 0x2004, 0xa81a,
+	0x2001, 0x002f, 0x2004, 0xa81e, 0x2001, 0x0030, 0x2004, 0xa822,
+	0x2001, 0x0031, 0x2004, 0xa826, 0x2001, 0x0034, 0x2004, 0xa82a,
+	0x2001, 0x0035, 0x2004, 0xa82e, 0x2001, 0x002a, 0x2004, 0x9080,
+	0x0003, 0x9084, 0x00fc, 0x8004, 0xa816, 0x080c, 0x3ca9, 0x0928,
+	0x7014, 0x2048, 0xad2c, 0xac28, 0xab1c, 0xaa18, 0xa930, 0xa808,
 	0xd0b4, 0x1120, 0x2029, 0x0000, 0x2021, 0x0000, 0x8906, 0x8006,
-	0x8007, 0x90bc, 0x003f, 0x9084, 0xffc0, 0x9080, 0x001b, 0x21a8,
-	0x27e0, 0x2098, 0x27e8, 0x20a0, 0x0006, 0x080c, 0x0fb7, 0x000e,
-	0x080c, 0x4af3, 0x007e, 0x701f, 0x3be7, 0x7023, 0x0001, 0x0005,
-	0x0804, 0x3573, 0x0156, 0x00c6, 0xa814, 0x908a, 0x001e, 0x0218,
-	0xa833, 0x001e, 0x0010, 0xa832, 0x0078, 0x81ff, 0x0168, 0x0016,
-	0x080c, 0x4aa7, 0x001e, 0x0130, 0xa800, 0x2040, 0xa008, 0xa80a,
-	0x2100, 0x0c58, 0x9006, 0x0010, 0x9085, 0x0001, 0x00ce, 0x015e,
-	0x0005, 0x0006, 0x00f6, 0x2079, 0x0000, 0x7880, 0x9086, 0x0044,
-	0x00fe, 0x000e, 0x0005, 0x2001, 0x199f, 0x2003, 0x0001, 0x0005,
-	0x00f6, 0x00e6, 0x00c6, 0x2061, 0x0200, 0x2001, 0x19aa, 0x2004,
-	0x601a, 0x2061, 0x0100, 0x2001, 0x19a9, 0x2004, 0x60ce, 0x6104,
-	0xc1ac, 0x6106, 0x080c, 0x4aa7, 0xa813, 0x0019, 0xa817, 0x0001,
-	0x2900, 0xa85a, 0x2001, 0x002e, 0x2004, 0xa866, 0x2001, 0x002f,
-	0x2004, 0xa86a, 0x2061, 0x0090, 0x2079, 0x0100, 0x2001, 0x19a9,
-	0x2004, 0x6036, 0x2009, 0x0040, 0x080c, 0x21b0, 0x2001, 0x002a,
-	0x2004, 0x9084, 0xfff8, 0xa86e, 0x601a, 0xa873, 0x0000, 0x601f,
-	0x0000, 0x78ca, 0x9006, 0x600a, 0x600e, 0x00ce, 0x00ee, 0x00fe,
-	0x0005, 0x00e6, 0x080c, 0x4aa7, 0x2940, 0xa013, 0x0019, 0xa017,
-	0x0001, 0x2800, 0xa05a, 0x2001, 0x0030, 0x2004, 0xa866, 0x2001,
-	0x0031, 0x2004, 0xa86a, 0x2001, 0x002a, 0x2004, 0x9084, 0xfff8,
-	0xa86e, 0xa873, 0x0000, 0x2001, 0x032a, 0x2003, 0x0004, 0x2001,
-	0x0300, 0x2003, 0x0000, 0x2001, 0x020d, 0x2003, 0x0000, 0x2001,
-	0x0004, 0x200c, 0x918d, 0x0002, 0x2102, 0x00ee, 0x0005, 0x0126,
-	0x2091, 0x8000, 0x81ff, 0x0148, 0x080c, 0x29e8, 0x1130, 0x9006,
-	0x080c, 0x2945, 0x9006, 0x080c, 0x2928, 0x7884, 0x9084, 0x0007,
-	0x0002, 0x3d64, 0x3d6d, 0x3d76, 0x3d61, 0x3d61, 0x3d61, 0x3d61,
-	0x3d61, 0x012e, 0x0804, 0x35a8, 0x2009, 0x0114, 0x2104, 0x9085,
-	0x0800, 0x200a, 0x080c, 0x3f38, 0x00c0, 0x2009, 0x0114, 0x2104,
-	0x9085, 0x4000, 0x200a, 0x080c, 0x3f38, 0x0078, 0x080c, 0x74e9,
-	0x1128, 0x012e, 0x2009, 0x0016, 0x0804, 0x35a5, 0x81ff, 0x0128,
-	0x012e, 0x2021, 0x400b, 0x0804, 0x3575, 0x080c, 0xa896, 0x0086,
-	0x0096, 0x00a6, 0x00b6, 0x00c6, 0x00d6, 0x00e6, 0x00f6, 0x080c,
-	0x3a8f, 0x2009, 0x0101, 0x210c, 0x0016, 0x7ec8, 0x7dcc, 0x9006,
-	0x2068, 0x2060, 0x2058, 0x080c, 0x41d9, 0x080c, 0x4129, 0x903e,
-	0x2720, 0x00f6, 0x00e6, 0x0086, 0x2940, 0x2071, 0x19e7, 0x2079,
-	0x0090, 0x00d6, 0x2069, 0x0000, 0x6884, 0xd0b4, 0x0120, 0x68d4,
-	0x780e, 0x68d0, 0x780a, 0x00de, 0x2011, 0x0001, 0x080c, 0x408a,
-	0x080c, 0x29f0, 0x080c, 0x29f0, 0x080c, 0x29f0, 0x080c, 0x29f0,
-	0x080c, 0x408a, 0x008e, 0x00ee, 0x00fe, 0x080c, 0x3fb7, 0x2009,
-	0x9c40, 0x8109, 0x11b0, 0x080c, 0x3eee, 0x2001, 0x0004, 0x200c,
-	0x918c, 0xfffd, 0x2102, 0x001e, 0x00fe, 0x00ee, 0x00de, 0x00ce,
-	0x00be, 0x00ae, 0x009e, 0x008e, 0x2009, 0x0017, 0x080c, 0x35a5,
-	0x0cf8, 0x2001, 0x020b, 0x2004, 0x9084, 0x0140, 0x1d10, 0x00f6,
-	0x2079, 0x0000, 0x7884, 0x00fe, 0xd0bc, 0x0178, 0x2001, 0x0201,
-	0x200c, 0x81ff, 0x0150, 0x080c, 0x3f95, 0x2d00, 0x9c05, 0x9b05,
-	0x0120, 0x080c, 0x3eee, 0x0804, 0x3e97, 0x080c, 0x40fe, 0x080c,
-	0x4022, 0x080c, 0x3f78, 0x080c, 0x3fad, 0x00f6, 0x2079, 0x0100,
-	0x7824, 0xd0ac, 0x0130, 0x8b58, 0x080c, 0x3eee, 0x00fe, 0x0804,
-	0x3e97, 0x00fe, 0x080c, 0x3ee4, 0x1150, 0x8d68, 0x2001, 0x0032,
-	0x2602, 0x2001, 0x0033, 0x2502, 0x080c, 0x3eee, 0x0080, 0x87ff,
-	0x0138, 0x2001, 0x0201, 0x2004, 0x9005, 0x1908, 0x8739, 0x0038,
-	0x2001, 0x1a6b, 0x2004, 0x9086, 0x0000, 0x1904, 0x3de7, 0x2001,
-	0x032f, 0x2003, 0x00f6, 0x8631, 0x1208, 0x8529, 0x2500, 0x9605,
-	0x0904, 0x3e97, 0x7884, 0xd0bc, 0x0128, 0x2d00, 0x9c05, 0x9b05,
-	0x1904, 0x3e97, 0xa013, 0x0019, 0x2001, 0x032a, 0x2003, 0x0004,
-	0x7884, 0xd0ac, 0x1148, 0x2001, 0x1a6b, 0x2003, 0x0003, 0x2001,
-	0x032a, 0x2003, 0x0009, 0x0030, 0xa017, 0x0001, 0x78b4, 0x9005,
-	0x0108, 0xa016, 0x2800, 0xa05a, 0x2009, 0x0040, 0x080c, 0x21b0,
-	0x2900, 0xa85a, 0xa813, 0x0019, 0x7884, 0xd0a4, 0x1180, 0xa817,
-	0x0000, 0x00c6, 0x20a9, 0x0004, 0x2061, 0x0090, 0x602b, 0x0008,
-	0x2001, 0x0203, 0x2004, 0x1f04, 0x3e6e, 0x00ce, 0x0030, 0xa817,
-	0x0001, 0x78b0, 0x9005, 0x0108, 0xa816, 0x00f6, 0x00c6, 0x2079,
-	0x0100, 0x2061, 0x0090, 0x7827, 0x0002, 0x2001, 0x002a, 0x2004,
-	0x9084, 0xfff8, 0x601a, 0x0006, 0x2001, 0x002b, 0x2004, 0x601e,
-	0x78c6, 0x000e, 0x78ca, 0x00ce, 0x00fe, 0x0804, 0x3da1, 0x001e,
-	0x00c6, 0x2001, 0x032a, 0x2003, 0x0004, 0x2061, 0x0100, 0x6027,
-	0x0002, 0x6106, 0x2011, 0x020d, 0x2013, 0x0020, 0x2001, 0x0004,
-	0x200c, 0x918c, 0xfffd, 0x2102, 0x080c, 0x1328, 0x7884, 0x9084,
-	0x0003, 0x9086, 0x0002, 0x01b0, 0x2009, 0x0028, 0x080c, 0x21b0,
-	0x2001, 0x0227, 0x200c, 0x2102, 0x6050, 0x9084, 0xb7ff, 0x080c,
-	0x2aab, 0x6052, 0x602f, 0x0000, 0x604b, 0xf7f7, 0x6043, 0x0090,
-	0x6043, 0x0010, 0x080c, 0xa8b2, 0x00ce, 0x2d08, 0x2c10, 0x2b18,
-	0x2b00, 0x9c05, 0x9d05, 0x00fe, 0x00ee, 0x00de, 0x00ce, 0x00be,
-	0x00ae, 0x009e, 0x008e, 0x1118, 0x012e, 0x0804, 0x3573, 0x012e,
-	0x2021, 0x400c, 0x0804, 0x3575, 0x9085, 0x0001, 0x1d04, 0x3eed,
-	0x2091, 0x6000, 0x8420, 0x9486, 0x0064, 0x0005, 0x2001, 0x0105,
-	0x2003, 0x0010, 0x2001, 0x032a, 0x2003, 0x0004, 0x2001, 0x1a6b,
-	0x2003, 0x0000, 0x0071, 0x2009, 0x0048, 0x080c, 0x21b0, 0x2001,
-	0x0227, 0x2024, 0x2402, 0x2001, 0x0109, 0x2003, 0x4000, 0x9026,
-	0x0005, 0x00f6, 0x00e6, 0x2071, 0x19e7, 0x7054, 0x9086, 0x0000,
-	0x0520, 0x2079, 0x0090, 0x2009, 0x0206, 0x2104, 0x2009, 0x0203,
-	0x210c, 0x9106, 0x1120, 0x2009, 0x0040, 0x080c, 0x21b0, 0x782c,
-	0xd0fc, 0x0d88, 0x080c, 0x40fe, 0x7054, 0x9086, 0x0000, 0x1d58,
-	0x782b, 0x0004, 0x782c, 0xd0ac, 0x1de8, 0x2009, 0x0040, 0x080c,
-	0x21b0, 0x782b, 0x0002, 0x7057, 0x0000, 0x00ee, 0x00fe, 0x0005,
-	0x00f6, 0x2079, 0x0100, 0x2001, 0x1818, 0x200c, 0x7932, 0x7936,
-	0x080c, 0x2644, 0x080c, 0x2a67, 0x080c, 0x2aab, 0x784b, 0xf7f7,
-	0x7843, 0x0090, 0x7843, 0x0010, 0x7850, 0xc0e5, 0x7852, 0x2019,
-	0x61a8, 0x7820, 0xd09c, 0x0110, 0x8319, 0x1dd8, 0x7850, 0xc0e4,
-	0x7852, 0x2011, 0x0048, 0x080c, 0x2a44, 0x7843, 0x0040, 0x2019,
-	0x01f4, 0xa001, 0xa001, 0x8319, 0x1de0, 0x2001, 0x0100, 0x080c,
-	0x2a0a, 0x2011, 0x0020, 0x080c, 0x2a44, 0x7843, 0x0000, 0x9006,
-	0x080c, 0x2a0a, 0x2011, 0x0048, 0x080c, 0x2a44, 0x00fe, 0x0005,
-	0x7884, 0xd0ac, 0x11c8, 0x00f6, 0x00e6, 0x2071, 0x1a6b, 0x2079,
-	0x0320, 0x2001, 0x0201, 0x2004, 0x9005, 0x0160, 0x7000, 0x9086,
-	0x0000, 0x1140, 0x0051, 0xd0bc, 0x0108, 0x8738, 0x7003, 0x0003,
-	0x782b, 0x0019, 0x00ee, 0x00fe, 0x0005, 0x00f6, 0x2079, 0x0300,
-	0x78bc, 0x00fe, 0x908c, 0x0070, 0x0178, 0x2009, 0x0032, 0x260a,
-	0x2009, 0x0033, 0x250a, 0xd0b4, 0x0108, 0x8c60, 0xd0ac, 0x0108,
-	0x8d68, 0xd0a4, 0x0108, 0x8b58, 0x0005, 0x00f6, 0x2079, 0x0200,
-	0x781c, 0xd084, 0x0110, 0x7837, 0x0050, 0x00fe, 0x0005, 0x00e6,
-	0x2071, 0x0100, 0x2001, 0x19aa, 0x2004, 0x70e2, 0x080c, 0x3cc9,
-	0x1188, 0x2001, 0x1820, 0x2004, 0x2009, 0x181f, 0x210c, 0x918c,
-	0x00ff, 0x706e, 0x716a, 0x7066, 0x918d, 0x3200, 0x7162, 0x7073,
-	0xe109, 0x0080, 0x702c, 0x9085, 0x0002, 0x702e, 0x2009, 0x1818,
-	0x210c, 0x716e, 0x7063, 0x0100, 0x7166, 0x719e, 0x706b, 0x0000,
-	0x7073, 0x0809, 0x7077, 0x0008, 0x7078, 0x9080, 0x0100, 0x707a,
-	0x7080, 0x8000, 0x7082, 0x7087, 0xaaaa, 0x9006, 0x708a, 0x708e,
-	0x707e, 0x70d6, 0x70ab, 0x0036, 0x70af, 0x95d5, 0x7014, 0x9084,
-	0x1984, 0x9085, 0x0092, 0x7016, 0x080c, 0x40fe, 0x00f6, 0x2071,
-	0x1a6b, 0x2079, 0x0320, 0x00d6, 0x2069, 0x0000, 0x6884, 0xd0b4,
-	0x0120, 0x689c, 0x780e, 0x6898, 0x780a, 0x00de, 0x2009, 0x03e8,
-	0x8109, 0x1df0, 0x792c, 0xd1fc, 0x0110, 0x782b, 0x0004, 0x2011,
-	0x0011, 0x080c, 0x408a, 0x2011, 0x0001, 0x080c, 0x408a, 0x00fe,
-	0x00ee, 0x0005, 0x00f6, 0x00e6, 0x2071, 0x1a6b, 0x2079, 0x0320,
-	0x792c, 0xd1fc, 0x0904, 0x4087, 0x782b, 0x0002, 0x9026, 0xd19c,
-	0x1904, 0x4083, 0x7000, 0x0002, 0x4087, 0x4038, 0x4068, 0x4083,
-	0xd1bc, 0x1170, 0xd1dc, 0x1190, 0x8001, 0x7002, 0x2011, 0x0001,
-	0x080c, 0x408a, 0x0904, 0x4087, 0x080c, 0x408a, 0x0804, 0x4087,
-	0x00f6, 0x2079, 0x0300, 0x78bf, 0x0000, 0x00fe, 0x7810, 0x7914,
-	0x782b, 0x0004, 0x7812, 0x7916, 0x2001, 0x0201, 0x200c, 0x81ff,
-	0x0de8, 0x080c, 0x3f95, 0x2009, 0x0001, 0x00f6, 0x2079, 0x0300,
-	0x78b8, 0x00fe, 0xd0ec, 0x0110, 0x2009, 0x0011, 0x792a, 0x00f8,
-	0x8001, 0x7002, 0x9184, 0x0880, 0x1140, 0x782c, 0xd0fc, 0x1904,
-	0x402c, 0x2011, 0x0001, 0x00b1, 0x0090, 0xa010, 0x9092, 0x0004,
-	0x9086, 0x0015, 0x1120, 0xa000, 0xa05a, 0x2011, 0x0031, 0xa212,
-	0xd1dc, 0x1960, 0x0828, 0x782b, 0x0004, 0x7003, 0x0000, 0x00ee,
-	0x00fe, 0x0005, 0xa014, 0x9005, 0x0550, 0x8001, 0x0036, 0x0096,
-	0xa016, 0xa058, 0x2048, 0xa010, 0x2009, 0x0031, 0x911a, 0x831c,
-	0x831c, 0x938a, 0x0007, 0x1a0c, 0x0d7d, 0x9398, 0x40b8, 0x231d,
-	0x083f, 0x9080, 0x0004, 0x7a2a, 0x7100, 0x8108, 0x7102, 0x009e,
-	0x003e, 0x908a, 0x0035, 0x1140, 0x0096, 0xa058, 0x2048, 0xa804,
-	0xa05a, 0x2001, 0x0019, 0x009e, 0xa012, 0x9085, 0x0001, 0x0005,
-	0x40f5, 0x40ec, 0x40e3, 0x40da, 0x40d1, 0x40c8, 0x40bf, 0xa964,
-	0x7902, 0xa968, 0x7906, 0xa96c, 0x7912, 0xa970, 0x7916, 0x0005,
-	0xa974, 0x7902, 0xa978, 0x7906, 0xa97c, 0x7912, 0xa980, 0x7916,
-	0x0005, 0xa984, 0x7902, 0xa988, 0x7906, 0xa98c, 0x7912, 0xa990,
-	0x7916, 0x0005, 0xa994, 0x7902, 0xa998, 0x7906, 0xa99c, 0x7912,
-	0xa9a0, 0x7916, 0x0005, 0xa9a4, 0x7902, 0xa9a8, 0x7906, 0xa9ac,
-	0x7912, 0xa9b0, 0x7916, 0x0005, 0xa9b4, 0x7902, 0xa9b8, 0x7906,
-	0xa9bc, 0x7912, 0xa9c0, 0x7916, 0x0005, 0xa9c4, 0x7902, 0xa9c8,
-	0x7906, 0xa9cc, 0x7912, 0xa9d0, 0x7916, 0x0005, 0x00f6, 0x00e6,
-	0x0086, 0x2071, 0x19e7, 0x2079, 0x0090, 0x792c, 0xd1fc, 0x01e8,
-	0x782b, 0x0002, 0x2940, 0x9026, 0x7054, 0x0002, 0x4125, 0x4111,
-	0x411c, 0x8001, 0x7056, 0xd19c, 0x1180, 0x2011, 0x0001, 0x080c,
-	0x408a, 0x190c, 0x408a, 0x0048, 0x8001, 0x7056, 0x782c, 0xd0fc,
-	0x1d38, 0x2011, 0x0001, 0x080c, 0x408a, 0x008e, 0x00ee, 0x00fe,
-	0x0005, 0x00f6, 0x00e6, 0x00c6, 0x0086, 0x2061, 0x0200, 0x2001,
-	0x19aa, 0x2004, 0x601a, 0x2061, 0x0100, 0x2001, 0x19a9, 0x2004,
-	0x60ce, 0x6104, 0xc1ac, 0x6106, 0x2001, 0x002c, 0x2004, 0x9005,
-	0x0520, 0x2038, 0x2001, 0x002e, 0x2024, 0x2001, 0x002f, 0x201c,
-	0x080c, 0x4aa7, 0xa813, 0x0019, 0xaf16, 0x2900, 0xa85a, 0x978a,
-	0x0007, 0x0220, 0x2138, 0x2009, 0x0007, 0x0010, 0x2708, 0x903e,
-	0x0096, 0xa858, 0x2048, 0xa85c, 0x9080, 0x0019, 0x009e, 0x080c,
-	0x41a1, 0x1d68, 0x2900, 0xa85a, 0x00d0, 0x080c, 0x4aa7, 0xa813,
-	0x0019, 0xa817, 0x0001, 0x2900, 0xa85a, 0x2001, 0x002e, 0x2004,
-	0xa866, 0x2001, 0x002f, 0x2004, 0xa86a, 0x2001, 0x002a, 0x2004,
-	0x9084, 0xfff8, 0xa86e, 0x2001, 0x002b, 0x2004, 0xa872, 0x2061,
-	0x0090, 0x2079, 0x0100, 0x2001, 0x19a9, 0x2004, 0x6036, 0x2009,
-	0x0040, 0x080c, 0x21b0, 0x2001, 0x002a, 0x2004, 0x9084, 0xfff8,
-	0x601a, 0x0006, 0x2001, 0x002b, 0x2004, 0x601e, 0x78c6, 0x000e,
-	0x78ca, 0x9006, 0x600a, 0x600e, 0x008e, 0x00ce, 0x00ee, 0x00fe,
-	0x0005, 0x00e6, 0x2071, 0x0080, 0xaa60, 0x22e8, 0x20a0, 0x20e1,
-	0x0000, 0x2099, 0x0088, 0x702b, 0x0026, 0x7402, 0x7306, 0x9006,
-	0x700a, 0x700e, 0x810b, 0x810b, 0x21a8, 0x810b, 0x7112, 0x702b,
-	0x0041, 0x702c, 0xd0fc, 0x0de8, 0x702b, 0x0002, 0x702b, 0x0040,
-	0x4005, 0x7400, 0x7304, 0x87ff, 0x0190, 0x0086, 0x0096, 0x2940,
-	0x0086, 0x080c, 0x4aa7, 0x008e, 0xa058, 0x00a6, 0x2050, 0x2900,
-	0xb006, 0xa05a, 0x00ae, 0x009e, 0x008e, 0x9085, 0x0001, 0x00ee,
-	0x0005, 0x00e6, 0x2001, 0x002d, 0x2004, 0x9005, 0x0528, 0x2038,
-	0x2001, 0x0030, 0x2024, 0x2001, 0x0031, 0x201c, 0x080c, 0x4aa7,
-	0x2940, 0xa813, 0x0019, 0xaf16, 0x2900, 0xa85a, 0x978a, 0x0007,
-	0x0220, 0x2138, 0x2009, 0x0007, 0x0010, 0x2708, 0x903e, 0x0096,
-	0xa858, 0x2048, 0xa85c, 0x9080, 0x0019, 0x009e, 0x080c, 0x41a1,
-	0x1d68, 0x2900, 0xa85a, 0x00d8, 0x080c, 0x4aa7, 0x2940, 0xa013,
-	0x0019, 0xa017, 0x0001, 0x2800, 0xa05a, 0x2001, 0x0030, 0x2004,
-	0xa066, 0x2001, 0x0031, 0x2004, 0xa06a, 0x2001, 0x002a, 0x2004,
-	0x9084, 0xfff8, 0xa06e, 0x2001, 0x002b, 0x2004, 0xa072, 0x2001,
-	0x032a, 0x2003, 0x0004, 0x7884, 0xd0ac, 0x1180, 0x2001, 0x0101,
-	0x200c, 0x918d, 0x0200, 0x2102, 0xa017, 0x0000, 0x2001, 0x1a6b,
-	0x2003, 0x0003, 0x2001, 0x032a, 0x2003, 0x0009, 0x2001, 0x0300,
+	0x8007, 0x90bc, 0x003f, 0x9084, 0xffc0, 0x9080, 0x001b, 0x080c,
+	0x4af2, 0x701f, 0x3be6, 0x7023, 0x0001, 0x012e, 0x0005, 0x080c,
+	0xa888, 0x0046, 0x0086, 0x0096, 0x00a6, 0x00b6, 0x00c6, 0x00d6,
+	0x00e6, 0x00f6, 0x080c, 0x3a8e, 0x2001, 0x199e, 0x2003, 0x0000,
+	0x2021, 0x000a, 0x2061, 0x0100, 0x6104, 0x0016, 0x60bb, 0x0000,
+	0x60bf, 0x32e1, 0x60bf, 0x0012, 0x080c, 0x3d18, 0x080c, 0x3cd7,
+	0x00f6, 0x00e6, 0x0086, 0x2940, 0x2071, 0x19e6, 0x2079, 0x0090,
+	0x00d6, 0x2069, 0x0000, 0x6884, 0xd0b4, 0x0140, 0x2001, 0x0035,
+	0x2004, 0x780e, 0x2001, 0x0034, 0x2004, 0x780a, 0x00de, 0x2011,
+	0x0001, 0x080c, 0x4089, 0x008e, 0x00ee, 0x00fe, 0x080c, 0x3fb6,
+	0x080c, 0x3ee3, 0x05b8, 0x2001, 0x020b, 0x2004, 0x9084, 0x0140,
+	0x1db8, 0x080c, 0x40fd, 0x00f6, 0x2079, 0x0300, 0x78bc, 0x00fe,
+	0x908c, 0x0070, 0x1560, 0x2071, 0x0200, 0x7037, 0x0000, 0x7050,
+	0x9084, 0xff00, 0x9086, 0x3200, 0x1510, 0x7037, 0x0001, 0x7050,
+	0x9084, 0xff00, 0x9086, 0xe100, 0x11d0, 0x7037, 0x0000, 0x7054,
+	0x7037, 0x0000, 0x715c, 0x9106, 0x1190, 0x2001, 0x1820, 0x2004,
+	0x9106, 0x1168, 0x00c6, 0x2061, 0x0100, 0x6024, 0x9084, 0x1e00,
+	0x00ce, 0x0138, 0x080c, 0x3eed, 0x080c, 0x3cd2, 0x0058, 0x080c,
+	0x3cd2, 0x080c, 0x4021, 0x080c, 0x3fac, 0x2001, 0x020b, 0x2004,
+	0xd0e4, 0x0dd8, 0x2001, 0x032a, 0x2003, 0x0004, 0x2061, 0x0100,
+	0x6027, 0x0002, 0x001e, 0x6106, 0x2011, 0x020d, 0x2013, 0x0020,
+	0x60bb, 0x0000, 0x60bf, 0x0108, 0x60bf, 0x0012, 0x2001, 0x0004,
+	0x200c, 0x918c, 0xfffd, 0x2102, 0x080c, 0x1333, 0x2009, 0x0028,
+	0x080c, 0x21c1, 0x2001, 0x0227, 0x200c, 0x2102, 0x080c, 0xa8a4,
+	0x00fe, 0x00ee, 0x00de, 0x00ce, 0x00be, 0x00ae, 0x009e, 0x008e,
+	0x004e, 0x2001, 0x199e, 0x2004, 0x9005, 0x1118, 0x012e, 0x0804,
+	0x3567, 0x012e, 0x2021, 0x400c, 0x0804, 0x3569, 0x0016, 0x0026,
+	0x0036, 0x0046, 0x0056, 0x0076, 0x0086, 0x0096, 0x00d6, 0x0156,
+	0x7014, 0x2048, 0x7020, 0x20a8, 0x8000, 0x7022, 0xa804, 0x9005,
+	0x0904, 0x3c42, 0x2048, 0x1f04, 0x3bf6, 0x7068, 0x2040, 0xa28c,
+	0xa390, 0xa494, 0xa598, 0xa930, 0xa808, 0xd0b4, 0x1120, 0x2029,
+	0x0000, 0x2021, 0x0000, 0x0096, 0x7014, 0x2048, 0xa864, 0x009e,
+	0x9086, 0x0103, 0x0170, 0x8906, 0x8006, 0x8007, 0x90bc, 0x003f,
+	0x9084, 0xffc0, 0x9080, 0x001b, 0x080c, 0x4af2, 0x701f, 0x3be6,
+	0x00b0, 0x8906, 0x8006, 0x8007, 0x90bc, 0x003f, 0x9084, 0xffc0,
+	0x9080, 0x001b, 0x21a8, 0x27e0, 0x2098, 0x27e8, 0x20a0, 0x0006,
+	0x080c, 0x0fb7, 0x000e, 0x080c, 0x4af5, 0x701f, 0x3be6, 0x015e,
+	0x00de, 0x009e, 0x008e, 0x007e, 0x005e, 0x004e, 0x003e, 0x002e,
+	0x001e, 0x0005, 0x7014, 0x2048, 0xa864, 0x9086, 0x0103, 0x1118,
+	0x701f, 0x3ca7, 0x0450, 0x7014, 0x2048, 0xa868, 0xc0fd, 0xa86a,
+	0x2009, 0x007f, 0x080c, 0x65bf, 0x0110, 0x9006, 0x0030, 0xb813,
+	0x00ff, 0xb817, 0xfffd, 0x080c, 0xcd1a, 0x015e, 0x00de, 0x009e,
+	0x008e, 0x007e, 0x005e, 0x004e, 0x003e, 0x002e, 0x001e, 0x0904,
+	0x3599, 0x0016, 0x0026, 0x0036, 0x0046, 0x0056, 0x0076, 0x0086,
+	0x0096, 0x00d6, 0x0156, 0x701f, 0x3c79, 0x7007, 0x0003, 0x0804,
+	0x3c37, 0xa830, 0x9086, 0x0100, 0x2021, 0x400c, 0x0904, 0x3569,
+	0x0076, 0xad10, 0xac0c, 0xab24, 0xaa20, 0xa930, 0xa808, 0xd0b4,
+	0x1120, 0x2029, 0x0000, 0x2021, 0x0000, 0x8906, 0x8006, 0x8007,
+	0x90bc, 0x003f, 0x9084, 0xffc0, 0x9080, 0x001b, 0x21a8, 0x27e0,
+	0x2098, 0x27e8, 0x20a0, 0x0006, 0x080c, 0x0fb7, 0x000e, 0x080c,
+	0x4af5, 0x007e, 0x701f, 0x3be6, 0x7023, 0x0001, 0x0005, 0x0804,
+	0x3567, 0x0156, 0x00c6, 0xa814, 0x908a, 0x001e, 0x0218, 0xa833,
+	0x001e, 0x0010, 0xa832, 0x0078, 0x81ff, 0x0168, 0x0016, 0x080c,
+	0x4aa9, 0x001e, 0x0130, 0xa800, 0x2040, 0xa008, 0xa80a, 0x2100,
+	0x0c58, 0x9006, 0x0010, 0x9085, 0x0001, 0x00ce, 0x015e, 0x0005,
+	0x0006, 0x00f6, 0x2079, 0x0000, 0x7880, 0x9086, 0x0044, 0x00fe,
+	0x000e, 0x0005, 0x2001, 0x199e, 0x2003, 0x0001, 0x0005, 0x00f6,
+	0x00e6, 0x00c6, 0x2061, 0x0200, 0x2001, 0x19a9, 0x2004, 0x601a,
+	0x2061, 0x0100, 0x2001, 0x19a8, 0x2004, 0x60ce, 0x6104, 0xc1ac,
+	0x6106, 0x080c, 0x4aa9, 0xa813, 0x0019, 0xa817, 0x0001, 0x2900,
+	0xa85a, 0x2001, 0x002e, 0x2004, 0xa866, 0x2001, 0x002f, 0x2004,
+	0xa86a, 0x2061, 0x0090, 0x2079, 0x0100, 0x2001, 0x19a8, 0x2004,
+	0x6036, 0x2009, 0x0040, 0x080c, 0x21c1, 0x2001, 0x002a, 0x2004,
+	0x9084, 0xfff8, 0xa86e, 0x601a, 0xa873, 0x0000, 0x601f, 0x0000,
+	0x78ca, 0x9006, 0x600a, 0x600e, 0x00ce, 0x00ee, 0x00fe, 0x0005,
+	0x00e6, 0x080c, 0x4aa9, 0x2940, 0xa013, 0x0019, 0xa017, 0x0001,
+	0x2800, 0xa05a, 0x2001, 0x0030, 0x2004, 0xa866, 0x2001, 0x0031,
+	0x2004, 0xa86a, 0x2001, 0x002a, 0x2004, 0x9084, 0xfff8, 0xa86e,
+	0xa873, 0x0000, 0x2001, 0x032a, 0x2003, 0x0004, 0x2001, 0x0300,
 	0x2003, 0x0000, 0x2001, 0x020d, 0x2003, 0x0000, 0x2001, 0x0004,
 	0x200c, 0x918d, 0x0002, 0x2102, 0x00ee, 0x0005, 0x0126, 0x2091,
-	0x8000, 0x20a9, 0x0007, 0x20a1, 0x1840, 0x20e9, 0x0001, 0x9006,
-	0x4004, 0x20a9, 0x000c, 0x20a1, 0xfff4, 0x20e9, 0x0000, 0x9006,
-	0x4004, 0x2009, 0x013c, 0x200a, 0x012e, 0x7880, 0x9086, 0x0052,
-	0x0108, 0x0005, 0x0804, 0x3573, 0x7d98, 0x7c9c, 0x0804, 0x366a,
-	0x080c, 0x74e9, 0x190c, 0x5fee, 0x6040, 0x9084, 0x0020, 0x09b1,
-	0x2069, 0x1847, 0x2d00, 0x2009, 0x0030, 0x7a8c, 0x7b88, 0x7c9c,
-	0x7d98, 0x2039, 0x0001, 0x080c, 0x4af0, 0x701f, 0x4280, 0x0005,
-	0x080c, 0x56e9, 0x1130, 0x3b00, 0x3a08, 0xc194, 0xc095, 0x20d8,
-	0x21d0, 0x2069, 0x1847, 0x6800, 0x9005, 0x0904, 0x35a8, 0x6804,
-	0xd0ac, 0x0118, 0xd0a4, 0x0904, 0x35a8, 0xd094, 0x00c6, 0x2061,
-	0x0100, 0x6104, 0x0138, 0x6200, 0x9292, 0x0005, 0x0218, 0x918c,
-	0xffdf, 0x0010, 0x918d, 0x0020, 0x6106, 0x00ce, 0xd08c, 0x00c6,
-	0x2061, 0x0100, 0x6104, 0x0118, 0x918d, 0x0010, 0x0010, 0x918c,
-	0xffef, 0x6106, 0x00ce, 0xd084, 0x0158, 0x6a28, 0x928a, 0x007f,
-	0x1a04, 0x35a8, 0x9288, 0x3374, 0x210d, 0x918c, 0x00ff, 0x6166,
-	0xd0dc, 0x0130, 0x6828, 0x908a, 0x007f, 0x1a04, 0x35a8, 0x605e,
-	0x6888, 0x9084, 0x0030, 0x8004, 0x8004, 0x8004, 0x8004, 0x0006,
-	0x2009, 0x19b1, 0x9080, 0x2737, 0x2005, 0x200a, 0x2008, 0x2001,
-	0x0018, 0x080c, 0xa887, 0x2009, 0x0390, 0x200b, 0x0400, 0x000e,
-	0x2009, 0x19b2, 0x9080, 0x273b, 0x2005, 0x200a, 0x6808, 0x908a,
-	0x0100, 0x0a04, 0x35a8, 0x908a, 0x0841, 0x1a04, 0x35a8, 0x9084,
-	0x0007, 0x1904, 0x35a8, 0x680c, 0x9005, 0x0904, 0x35a8, 0x6810,
-	0x9005, 0x0904, 0x35a8, 0x6848, 0x6940, 0x910a, 0x1a04, 0x35a8,
-	0x8001, 0x0904, 0x35a8, 0x684c, 0x6944, 0x910a, 0x1a04, 0x35a8,
-	0x8001, 0x0904, 0x35a8, 0x6814, 0x908c, 0x00ff, 0x614e, 0x8007,
-	0x9084, 0x00ff, 0x6052, 0x080c, 0x781e, 0x080c, 0x6aa1, 0x080c,
-	0x6ad5, 0x6808, 0x602a, 0x080c, 0x2122, 0x2009, 0x0170, 0x200b,
-	0x0080, 0xa001, 0xa001, 0x200b, 0x0000, 0x0036, 0x6b08, 0x080c,
-	0x269e, 0x003e, 0x6000, 0x9086, 0x0000, 0x1904, 0x440b, 0x6818,
-	0x691c, 0x6a20, 0x6b24, 0x8007, 0x810f, 0x8217, 0x831f, 0x6016,
-	0x611a, 0x621e, 0x6322, 0x6c04, 0xd4f4, 0x0148, 0x6830, 0x6934,
-	0x6a38, 0x6b3c, 0x8007, 0x810f, 0x8217, 0x831f, 0x0010, 0x9084,
-	0xf0ff, 0x6006, 0x610a, 0x620e, 0x6312, 0x8007, 0x810f, 0x8217,
-	0x831f, 0x20a9, 0x0004, 0x20a1, 0x19b3, 0x20e9, 0x0001, 0x4001,
-	0x20a9, 0x0004, 0x20a1, 0x19cd, 0x20e9, 0x0001, 0x4001, 0x080c,
-	0x87d1, 0x00c6, 0x900e, 0x20a9, 0x0001, 0x6b70, 0xd384, 0x01c8,
-	0x0020, 0x839d, 0x12b0, 0x3508, 0x8109, 0x080c, 0x7ddf, 0x6878,
-	0x6016, 0x6874, 0x2008, 0x9084, 0xff00, 0x8007, 0x600a, 0x9184,
-	0x00ff, 0x6006, 0x8108, 0x1118, 0x6003, 0x0003, 0x0010, 0x6003,
-	0x0001, 0x1f04, 0x4369, 0x00ce, 0x00c6, 0x2061, 0x199c, 0x6a88,
-	0x9284, 0xc000, 0x2010, 0x9286, 0x0000, 0x1158, 0x2063, 0x0000,
-	0x2001, 0x0001, 0x080c, 0x2945, 0x2001, 0x0001, 0x080c, 0x2928,
-	0x0088, 0x9286, 0x4000, 0x1148, 0x2063, 0x0001, 0x9006, 0x080c,
-	0x2945, 0x9006, 0x080c, 0x2928, 0x0028, 0x9286, 0x8000, 0x1d30,
-	0x2063, 0x0002, 0x00ce, 0x00e6, 0x2c70, 0x080c, 0x0eb4, 0x00ee,
-	0x6888, 0xd0ec, 0x0130, 0x2011, 0x0114, 0x2204, 0x9085, 0x0180,
-	0x2012, 0x6a80, 0x9284, 0x0030, 0x9086, 0x0030, 0x1128, 0x9294,
-	0xffcf, 0x9295, 0x0020, 0x6a82, 0x2001, 0x197c, 0x6a80, 0x9294,
-	0x0030, 0x928e, 0x0000, 0x0170, 0x928e, 0x0010, 0x0118, 0x928e,
-	0x0020, 0x0140, 0x2003, 0xaaaa, 0x080c, 0x2713, 0x2001, 0x196d,
-	0x2102, 0x0008, 0x2102, 0x00c6, 0x2061, 0x0100, 0x602f, 0x0040,
-	0x602f, 0x0000, 0x00ce, 0x080c, 0x74e9, 0x0128, 0x080c, 0x4fde,
-	0x0110, 0x080c, 0x2664, 0x60d4, 0x9005, 0x01c0, 0x6003, 0x0001,
-	0x2009, 0x43f3, 0x00e0, 0x080c, 0x74e9, 0x1168, 0x2011, 0x735f,
-	0x080c, 0x863e, 0x2011, 0x7352, 0x080c, 0x874a, 0x080c, 0x77f2,
-	0x080c, 0x741a, 0x0040, 0x080c, 0x5ee4, 0x0028, 0x6003, 0x0004,
-	0x2009, 0x440b, 0x0020, 0x080c, 0x69cd, 0x0804, 0x3573, 0x2001,
-	0x0170, 0x2004, 0x9084, 0x00ff, 0x9086, 0x004c, 0x1118, 0x2091,
-	0x31bd, 0x0817, 0x2091, 0x313d, 0x0817, 0x6000, 0x9086, 0x0000,
-	0x0904, 0x35a5, 0x2069, 0x1847, 0x7890, 0x6842, 0x7894, 0x6846,
-	0x2d00, 0x2009, 0x0030, 0x7a8c, 0x7b88, 0x7c9c, 0x7d98, 0x2039,
-	0x0001, 0x0804, 0x4af3, 0x9006, 0x080c, 0x2664, 0x81ff, 0x1904,
-	0x35a5, 0x080c, 0x74e9, 0x11b0, 0x080c, 0x77ed, 0x080c, 0x6029,
-	0x080c, 0x3368, 0x0118, 0x6130, 0xc18d, 0x6132, 0x080c, 0xcf52,
-	0x0130, 0x080c, 0x750c, 0x1118, 0x080c, 0x74bd, 0x0038, 0x080c,
-	0x741a, 0x0020, 0x080c, 0x5fee, 0x080c, 0x5ee4, 0x0804, 0x3573,
-	0x81ff, 0x1904, 0x35a5, 0x080c, 0x74e9, 0x1110, 0x0804, 0x35a5,
-	0x6194, 0x81ff, 0x01a8, 0x704f, 0x0000, 0x2001, 0x1d80, 0x2009,
-	0x0040, 0x7a8c, 0x7b88, 0x7c9c, 0x7d98, 0x0126, 0x2091, 0x8000,
-	0x2039, 0x0001, 0x080c, 0x4af3, 0x701f, 0x3571, 0x012e, 0x0005,
-	0x704f, 0x0001, 0x00d6, 0x2069, 0x1d80, 0x20a9, 0x0040, 0x20e9,
-	0x0001, 0x20a1, 0x1d80, 0x2019, 0xffff, 0x4304, 0x655c, 0x9588,
-	0x3374, 0x210d, 0x918c, 0x00ff, 0x216a, 0x900e, 0x2011, 0x0002,
-	0x2100, 0x9506, 0x01a8, 0x080c, 0x6625, 0x1190, 0xb814, 0x821c,
-	0x0238, 0x9398, 0x1d80, 0x9085, 0xff00, 0x8007, 0x201a, 0x0038,
-	0x9398, 0x1d80, 0x2324, 0x94a4, 0xff00, 0x9405, 0x201a, 0x8210,
-	0x8108, 0x9182, 0x0080, 0x1208, 0x0c18, 0x8201, 0x8007, 0x2d0c,
-	0x9105, 0x206a, 0x00de, 0x20a9, 0x0040, 0x20a1, 0x1d80, 0x2099,
-	0x1d80, 0x080c, 0x5f79, 0x0804, 0x4465, 0x080c, 0x4ada, 0x0904,
-	0x35a8, 0x080c, 0x4aa7, 0x1120, 0x2009, 0x0002, 0x0804, 0x35a5,
-	0x080c, 0x56da, 0xd0b4, 0x0558, 0x7884, 0x908e, 0x007e, 0x0538,
-	0x908e, 0x007f, 0x0520, 0x908e, 0x0080, 0x0508, 0x080c, 0x3363,
-	0x1148, 0xb800, 0xd08c, 0x11d8, 0xb804, 0x9084, 0x00ff, 0x9086,
-	0x0006, 0x11a8, 0xa867, 0x0000, 0xa868, 0xc0fd, 0xa86a, 0x080c,
-	0xca07, 0x1120, 0x2009, 0x0003, 0x0804, 0x35a5, 0x7007, 0x0003,
-	0x701f, 0x44f3, 0x0005, 0x080c, 0x4ada, 0x0904, 0x35a8, 0x20a9,
-	0x002b, 0xb8c4, 0x20e0, 0xb8c8, 0x2098, 0xa860, 0x20e8, 0xa85c,
-	0x9080, 0x0002, 0x20a0, 0x4003, 0x20a9, 0x0008, 0x9080, 0x0006,
-	0x20a0, 0xb8c4, 0x20e0, 0xb8c8, 0x9080, 0x0006, 0x2098, 0x080c,
-	0x0fb7, 0x0070, 0x20a9, 0x0004, 0xa85c, 0x9080, 0x000a, 0x20a0,
-	0xb8c4, 0x20e0, 0xb8c8, 0x9080, 0x000a, 0x2098, 0x080c, 0x0fb7,
-	0x8906, 0x8006, 0x8007, 0x90bc, 0x003f, 0x9084, 0xffc0, 0x9080,
-	0x0002, 0x2009, 0x002b, 0x7a8c, 0x7b88, 0x7c9c, 0x7d98, 0x0804,
-	0x4af3, 0x81ff, 0x1904, 0x35a5, 0x080c, 0x4abe, 0x0904, 0x35a8,
-	0x080c, 0x6866, 0x0904, 0x35a5, 0x0058, 0xa878, 0x9005, 0x0120,
-	0x2009, 0x0004, 0x0804, 0x35a5, 0xa974, 0xaa94, 0x0804, 0x3573,
-	0x080c, 0x56e2, 0x0904, 0x3573, 0x701f, 0x453d, 0x7007, 0x0003,
-	0x0005, 0x81ff, 0x1904, 0x35a5, 0x7888, 0x908a, 0x1000, 0x1a04,
-	0x35a8, 0x080c, 0x4ada, 0x0904, 0x35a8, 0x080c, 0x6a6b, 0x0120,
-	0x080c, 0x6a73, 0x1904, 0x35a8, 0x080c, 0x68eb, 0x0904, 0x35a5,
-	0x2019, 0x0004, 0x900e, 0x080c, 0x6878, 0x0904, 0x35a5, 0x7984,
-	0x7a88, 0x04c9, 0x08a8, 0xa89c, 0x908a, 0x1000, 0x12f8, 0x080c,
-	0x4ad8, 0x01e0, 0x080c, 0x6a6b, 0x0118, 0x080c, 0x6a73, 0x11b0,
-	0x080c, 0x68eb, 0x2009, 0x0002, 0x0168, 0x2009, 0x0002, 0x2019,
-	0x0004, 0x080c, 0x6878, 0x2009, 0x0003, 0x0120, 0xa998, 0xaa9c,
-	0x00d1, 0x0060, 0xa897, 0x4005, 0xa99a, 0x0010, 0xa897, 0x4006,
-	0x900e, 0x9085, 0x0001, 0x2001, 0x0030, 0x0005, 0xa897, 0x4000,
-	0x080c, 0x56e2, 0x0110, 0x9006, 0x0018, 0x900e, 0x9085, 0x0001,
-	0x2001, 0x0000, 0x0005, 0x9186, 0x00ff, 0x0110, 0x0071, 0x0060,
-	0x2029, 0x007e, 0x2061, 0x1800, 0x645c, 0x2400, 0x9506, 0x0110,
-	0x2508, 0x0019, 0x8529, 0x1ec8, 0x0005, 0x080c, 0x6625, 0x1138,
-	0x2200, 0x8003, 0x800b, 0x810b, 0x9108, 0x080c, 0x864c, 0x0005,
-	0x81ff, 0x1904, 0x35a5, 0x798c, 0x2001, 0x1980, 0x918c, 0x8000,
-	0x2102, 0x080c, 0x4abe, 0x0904, 0x35a8, 0x080c, 0x6a6b, 0x0120,
-	0x080c, 0x6a73, 0x1904, 0x35a8, 0x080c, 0x66ec, 0x0904, 0x35a5,
-	0x080c, 0x686f, 0x0904, 0x35a5, 0x2001, 0x1980, 0x2004, 0xd0fc,
-	0x1904, 0x3573, 0x0804, 0x4548, 0xa9a0, 0x2001, 0x1980, 0x918c,
-	0x8000, 0xc18d, 0x2102, 0x080c, 0x4acb, 0x01a0, 0x080c, 0x6a6b,
-	0x0118, 0x080c, 0x6a73, 0x1170, 0x080c, 0x66ec, 0x2009, 0x0002,
-	0x0128, 0x080c, 0x686f, 0x1170, 0x2009, 0x0003, 0xa897, 0x4005,
-	0xa99a, 0x0010, 0xa897, 0x4006, 0x900e, 0x9085, 0x0001, 0x2001,
-	0x0030, 0x0005, 0xa897, 0x4000, 0x2001, 0x1980, 0x2004, 0xd0fc,
-	0x1128, 0x080c, 0x56e2, 0x0110, 0x9006, 0x0018, 0x900e, 0x9085,
-	0x0001, 0x2001, 0x0000, 0x0005, 0x81ff, 0x1904, 0x35a5, 0x798c,
-	0x2001, 0x197f, 0x918c, 0x8000, 0x2102, 0x080c, 0x4abe, 0x0904,
-	0x35a8, 0x080c, 0x6a6b, 0x0120, 0x080c, 0x6a73, 0x1904, 0x35a8,
-	0x080c, 0x66ec, 0x0904, 0x35a5, 0x080c, 0x685d, 0x0904, 0x35a5,
-	0x2001, 0x197f, 0x2004, 0xd0fc, 0x1904, 0x3573, 0x0804, 0x4548,
-	0xa9a0, 0x2001, 0x197f, 0x918c, 0x8000, 0xc18d, 0x2102, 0x080c,
-	0x4acb, 0x01a0, 0x080c, 0x6a6b, 0x0118, 0x080c, 0x6a73, 0x1170,
-	0x080c, 0x66ec, 0x2009, 0x0002, 0x0128, 0x080c, 0x685d, 0x1170,
-	0x2009, 0x0003, 0xa897, 0x4005, 0xa99a, 0x0010, 0xa897, 0x4006,
+	0x8000, 0x81ff, 0x0148, 0x080c, 0x2a07, 0x1130, 0x9006, 0x080c,
+	0x295e, 0x9006, 0x080c, 0x2941, 0x7884, 0x9084, 0x0007, 0x0002,
+	0x3d63, 0x3d6c, 0x3d75, 0x3d60, 0x3d60, 0x3d60, 0x3d60, 0x3d60,
+	0x012e, 0x0804, 0x359c, 0x2009, 0x0114, 0x2104, 0x9085, 0x0800,
+	0x200a, 0x080c, 0x3f37, 0x00c0, 0x2009, 0x0114, 0x2104, 0x9085,
+	0x4000, 0x200a, 0x080c, 0x3f37, 0x0078, 0x080c, 0x74c8, 0x1128,
+	0x012e, 0x2009, 0x0016, 0x0804, 0x3599, 0x81ff, 0x0128, 0x012e,
+	0x2021, 0x400b, 0x0804, 0x3569, 0x080c, 0xa888, 0x0086, 0x0096,
+	0x00a6, 0x00b6, 0x00c6, 0x00d6, 0x00e6, 0x00f6, 0x080c, 0x3a8e,
+	0x2009, 0x0101, 0x210c, 0x0016, 0x7ec8, 0x7dcc, 0x9006, 0x2068,
+	0x2060, 0x2058, 0x080c, 0x41d8, 0x080c, 0x4128, 0x903e, 0x2720,
+	0x00f6, 0x00e6, 0x0086, 0x2940, 0x2071, 0x19e6, 0x2079, 0x0090,
+	0x00d6, 0x2069, 0x0000, 0x6884, 0xd0b4, 0x0120, 0x68d4, 0x780e,
+	0x68d0, 0x780a, 0x00de, 0x2011, 0x0001, 0x080c, 0x4089, 0x080c,
+	0x2a0f, 0x080c, 0x2a0f, 0x080c, 0x2a0f, 0x080c, 0x2a0f, 0x080c,
+	0x4089, 0x008e, 0x00ee, 0x00fe, 0x080c, 0x3fb6, 0x2009, 0x9c40,
+	0x8109, 0x11b0, 0x080c, 0x3eed, 0x2001, 0x0004, 0x200c, 0x918c,
+	0xfffd, 0x2102, 0x001e, 0x00fe, 0x00ee, 0x00de, 0x00ce, 0x00be,
+	0x00ae, 0x009e, 0x008e, 0x2009, 0x0017, 0x080c, 0x3599, 0x0cf8,
+	0x2001, 0x020b, 0x2004, 0x9084, 0x0140, 0x1d10, 0x00f6, 0x2079,
+	0x0000, 0x7884, 0x00fe, 0xd0bc, 0x0178, 0x2001, 0x0201, 0x200c,
+	0x81ff, 0x0150, 0x080c, 0x3f94, 0x2d00, 0x9c05, 0x9b05, 0x0120,
+	0x080c, 0x3eed, 0x0804, 0x3e96, 0x080c, 0x40fd, 0x080c, 0x4021,
+	0x080c, 0x3f77, 0x080c, 0x3fac, 0x00f6, 0x2079, 0x0100, 0x7824,
+	0xd0ac, 0x0130, 0x8b58, 0x080c, 0x3eed, 0x00fe, 0x0804, 0x3e96,
+	0x00fe, 0x080c, 0x3ee3, 0x1150, 0x8d68, 0x2001, 0x0032, 0x2602,
+	0x2001, 0x0033, 0x2502, 0x080c, 0x3eed, 0x0080, 0x87ff, 0x0138,
+	0x2001, 0x0201, 0x2004, 0x9005, 0x1908, 0x8739, 0x0038, 0x2001,
+	0x1a6a, 0x2004, 0x9086, 0x0000, 0x1904, 0x3de6, 0x2001, 0x032f,
+	0x2003, 0x00f6, 0x8631, 0x1208, 0x8529, 0x2500, 0x9605, 0x0904,
+	0x3e96, 0x7884, 0xd0bc, 0x0128, 0x2d00, 0x9c05, 0x9b05, 0x1904,
+	0x3e96, 0xa013, 0x0019, 0x2001, 0x032a, 0x2003, 0x0004, 0x7884,
+	0xd0ac, 0x1148, 0x2001, 0x1a6a, 0x2003, 0x0003, 0x2001, 0x032a,
+	0x2003, 0x0009, 0x0030, 0xa017, 0x0001, 0x78b4, 0x9005, 0x0108,
+	0xa016, 0x2800, 0xa05a, 0x2009, 0x0040, 0x080c, 0x21c1, 0x2900,
+	0xa85a, 0xa813, 0x0019, 0x7884, 0xd0a4, 0x1180, 0xa817, 0x0000,
+	0x00c6, 0x20a9, 0x0004, 0x2061, 0x0090, 0x602b, 0x0008, 0x2001,
+	0x0203, 0x2004, 0x1f04, 0x3e6d, 0x00ce, 0x0030, 0xa817, 0x0001,
+	0x78b0, 0x9005, 0x0108, 0xa816, 0x00f6, 0x00c6, 0x2079, 0x0100,
+	0x2061, 0x0090, 0x7827, 0x0002, 0x2001, 0x002a, 0x2004, 0x9084,
+	0xfff8, 0x601a, 0x0006, 0x2001, 0x002b, 0x2004, 0x601e, 0x78c6,
+	0x000e, 0x78ca, 0x00ce, 0x00fe, 0x0804, 0x3da0, 0x001e, 0x00c6,
+	0x2001, 0x032a, 0x2003, 0x0004, 0x2061, 0x0100, 0x6027, 0x0002,
+	0x6106, 0x2011, 0x020d, 0x2013, 0x0020, 0x2001, 0x0004, 0x200c,
+	0x918c, 0xfffd, 0x2102, 0x080c, 0x1333, 0x7884, 0x9084, 0x0003,
+	0x9086, 0x0002, 0x01b0, 0x2009, 0x0028, 0x080c, 0x21c1, 0x2001,
+	0x0227, 0x200c, 0x2102, 0x6050, 0x9084, 0xb7ff, 0x080c, 0x2ab9,
+	0x6052, 0x602f, 0x0000, 0x604b, 0xf7f7, 0x6043, 0x0090, 0x6043,
+	0x0010, 0x080c, 0xa8a4, 0x00ce, 0x2d08, 0x2c10, 0x2b18, 0x2b00,
+	0x9c05, 0x9d05, 0x00fe, 0x00ee, 0x00de, 0x00ce, 0x00be, 0x00ae,
+	0x009e, 0x008e, 0x1118, 0x012e, 0x0804, 0x3567, 0x012e, 0x2021,
+	0x400c, 0x0804, 0x3569, 0x9085, 0x0001, 0x1d04, 0x3eec, 0x2091,
+	0x6000, 0x8420, 0x9486, 0x0064, 0x0005, 0x2001, 0x0105, 0x2003,
+	0x0010, 0x2001, 0x032a, 0x2003, 0x0004, 0x2001, 0x1a6a, 0x2003,
+	0x0000, 0x0071, 0x2009, 0x0048, 0x080c, 0x21c1, 0x2001, 0x0227,
+	0x2024, 0x2402, 0x2001, 0x0109, 0x2003, 0x4000, 0x9026, 0x0005,
+	0x00f6, 0x00e6, 0x2071, 0x19e6, 0x7054, 0x9086, 0x0000, 0x0520,
+	0x2079, 0x0090, 0x2009, 0x0206, 0x2104, 0x2009, 0x0203, 0x210c,
+	0x9106, 0x1120, 0x2009, 0x0040, 0x080c, 0x21c1, 0x782c, 0xd0fc,
+	0x0d88, 0x080c, 0x40fd, 0x7054, 0x9086, 0x0000, 0x1d58, 0x782b,
+	0x0004, 0x782c, 0xd0ac, 0x1de8, 0x2009, 0x0040, 0x080c, 0x21c1,
+	0x782b, 0x0002, 0x7057, 0x0000, 0x00ee, 0x00fe, 0x0005, 0x00f6,
+	0x2079, 0x0100, 0x2001, 0x1818, 0x200c, 0x7932, 0x7936, 0x080c,
+	0x265d, 0x080c, 0x2a86, 0x080c, 0x2ab9, 0x784b, 0xf7f7, 0x7843,
+	0x0090, 0x7843, 0x0010, 0x7850, 0xc0e5, 0x7852, 0x2019, 0x61a8,
+	0x7820, 0xd09c, 0x0110, 0x8319, 0x1dd8, 0x7850, 0xc0e4, 0x7852,
+	0x2011, 0x0048, 0x080c, 0x2a63, 0x7843, 0x0040, 0x2019, 0x01f4,
+	0xa001, 0xa001, 0x8319, 0x1de0, 0x2001, 0x0100, 0x080c, 0x2a29,
+	0x2011, 0x0020, 0x080c, 0x2a63, 0x7843, 0x0000, 0x9006, 0x080c,
+	0x2a29, 0x2011, 0x0048, 0x080c, 0x2a63, 0x00fe, 0x0005, 0x7884,
+	0xd0ac, 0x11c8, 0x00f6, 0x00e6, 0x2071, 0x1a6a, 0x2079, 0x0320,
+	0x2001, 0x0201, 0x2004, 0x9005, 0x0160, 0x7000, 0x9086, 0x0000,
+	0x1140, 0x0051, 0xd0bc, 0x0108, 0x8738, 0x7003, 0x0003, 0x782b,
+	0x0019, 0x00ee, 0x00fe, 0x0005, 0x00f6, 0x2079, 0x0300, 0x78bc,
+	0x00fe, 0x908c, 0x0070, 0x0178, 0x2009, 0x0032, 0x260a, 0x2009,
+	0x0033, 0x250a, 0xd0b4, 0x0108, 0x8c60, 0xd0ac, 0x0108, 0x8d68,
+	0xd0a4, 0x0108, 0x8b58, 0x0005, 0x00f6, 0x2079, 0x0200, 0x781c,
+	0xd084, 0x0110, 0x7837, 0x0050, 0x00fe, 0x0005, 0x00e6, 0x2071,
+	0x0100, 0x2001, 0x19a9, 0x2004, 0x70e2, 0x080c, 0x3cc8, 0x1188,
+	0x2001, 0x1820, 0x2004, 0x2009, 0x181f, 0x210c, 0x918c, 0x00ff,
+	0x706e, 0x716a, 0x7066, 0x918d, 0x3200, 0x7162, 0x7073, 0xe109,
+	0x0080, 0x702c, 0x9085, 0x0002, 0x702e, 0x2009, 0x1818, 0x210c,
+	0x716e, 0x7063, 0x0100, 0x7166, 0x719e, 0x706b, 0x0000, 0x7073,
+	0x0809, 0x7077, 0x0008, 0x7078, 0x9080, 0x0100, 0x707a, 0x7080,
+	0x8000, 0x7082, 0x7087, 0xaaaa, 0x9006, 0x708a, 0x708e, 0x707e,
+	0x70d6, 0x70ab, 0x0036, 0x70af, 0x95d5, 0x7014, 0x9084, 0x1984,
+	0x9085, 0x0092, 0x7016, 0x080c, 0x40fd, 0x00f6, 0x2071, 0x1a6a,
+	0x2079, 0x0320, 0x00d6, 0x2069, 0x0000, 0x6884, 0xd0b4, 0x0120,
+	0x689c, 0x780e, 0x6898, 0x780a, 0x00de, 0x2009, 0x03e8, 0x8109,
+	0x1df0, 0x792c, 0xd1fc, 0x0110, 0x782b, 0x0004, 0x2011, 0x0011,
+	0x080c, 0x4089, 0x2011, 0x0001, 0x080c, 0x4089, 0x00fe, 0x00ee,
+	0x0005, 0x00f6, 0x00e6, 0x2071, 0x1a6a, 0x2079, 0x0320, 0x792c,
+	0xd1fc, 0x0904, 0x4086, 0x782b, 0x0002, 0x9026, 0xd19c, 0x1904,
+	0x4082, 0x7000, 0x0002, 0x4086, 0x4037, 0x4067, 0x4082, 0xd1bc,
+	0x1170, 0xd1dc, 0x1190, 0x8001, 0x7002, 0x2011, 0x0001, 0x080c,
+	0x4089, 0x0904, 0x4086, 0x080c, 0x4089, 0x0804, 0x4086, 0x00f6,
+	0x2079, 0x0300, 0x78bf, 0x0000, 0x00fe, 0x7810, 0x7914, 0x782b,
+	0x0004, 0x7812, 0x7916, 0x2001, 0x0201, 0x200c, 0x81ff, 0x0de8,
+	0x080c, 0x3f94, 0x2009, 0x0001, 0x00f6, 0x2079, 0x0300, 0x78b8,
+	0x00fe, 0xd0ec, 0x0110, 0x2009, 0x0011, 0x792a, 0x00f8, 0x8001,
+	0x7002, 0x9184, 0x0880, 0x1140, 0x782c, 0xd0fc, 0x1904, 0x402b,
+	0x2011, 0x0001, 0x00b1, 0x0090, 0xa010, 0x9092, 0x0004, 0x9086,
+	0x0015, 0x1120, 0xa000, 0xa05a, 0x2011, 0x0031, 0xa212, 0xd1dc,
+	0x1960, 0x0828, 0x782b, 0x0004, 0x7003, 0x0000, 0x00ee, 0x00fe,
+	0x0005, 0xa014, 0x9005, 0x0550, 0x8001, 0x0036, 0x0096, 0xa016,
+	0xa058, 0x2048, 0xa010, 0x2009, 0x0031, 0x911a, 0x831c, 0x831c,
+	0x938a, 0x0007, 0x1a0c, 0x0d7d, 0x9398, 0x40b7, 0x231d, 0x083f,
+	0x9080, 0x0004, 0x7a2a, 0x7100, 0x8108, 0x7102, 0x009e, 0x003e,
+	0x908a, 0x0035, 0x1140, 0x0096, 0xa058, 0x2048, 0xa804, 0xa05a,
+	0x2001, 0x0019, 0x009e, 0xa012, 0x9085, 0x0001, 0x0005, 0x40f4,
+	0x40eb, 0x40e2, 0x40d9, 0x40d0, 0x40c7, 0x40be, 0xa964, 0x7902,
+	0xa968, 0x7906, 0xa96c, 0x7912, 0xa970, 0x7916, 0x0005, 0xa974,
+	0x7902, 0xa978, 0x7906, 0xa97c, 0x7912, 0xa980, 0x7916, 0x0005,
+	0xa984, 0x7902, 0xa988, 0x7906, 0xa98c, 0x7912, 0xa990, 0x7916,
+	0x0005, 0xa994, 0x7902, 0xa998, 0x7906, 0xa99c, 0x7912, 0xa9a0,
+	0x7916, 0x0005, 0xa9a4, 0x7902, 0xa9a8, 0x7906, 0xa9ac, 0x7912,
+	0xa9b0, 0x7916, 0x0005, 0xa9b4, 0x7902, 0xa9b8, 0x7906, 0xa9bc,
+	0x7912, 0xa9c0, 0x7916, 0x0005, 0xa9c4, 0x7902, 0xa9c8, 0x7906,
+	0xa9cc, 0x7912, 0xa9d0, 0x7916, 0x0005, 0x00f6, 0x00e6, 0x0086,
+	0x2071, 0x19e6, 0x2079, 0x0090, 0x792c, 0xd1fc, 0x01e8, 0x782b,
+	0x0002, 0x2940, 0x9026, 0x7054, 0x0002, 0x4124, 0x4110, 0x411b,
+	0x8001, 0x7056, 0xd19c, 0x1180, 0x2011, 0x0001, 0x080c, 0x4089,
+	0x190c, 0x4089, 0x0048, 0x8001, 0x7056, 0x782c, 0xd0fc, 0x1d38,
+	0x2011, 0x0001, 0x080c, 0x4089, 0x008e, 0x00ee, 0x00fe, 0x0005,
+	0x00f6, 0x00e6, 0x00c6, 0x0086, 0x2061, 0x0200, 0x2001, 0x19a9,
+	0x2004, 0x601a, 0x2061, 0x0100, 0x2001, 0x19a8, 0x2004, 0x60ce,
+	0x6104, 0xc1ac, 0x6106, 0x2001, 0x002c, 0x2004, 0x9005, 0x0520,
+	0x2038, 0x2001, 0x002e, 0x2024, 0x2001, 0x002f, 0x201c, 0x080c,
+	0x4aa9, 0xa813, 0x0019, 0xaf16, 0x2900, 0xa85a, 0x978a, 0x0007,
+	0x0220, 0x2138, 0x2009, 0x0007, 0x0010, 0x2708, 0x903e, 0x0096,
+	0xa858, 0x2048, 0xa85c, 0x9080, 0x0019, 0x009e, 0x080c, 0x41a0,
+	0x1d68, 0x2900, 0xa85a, 0x00d0, 0x080c, 0x4aa9, 0xa813, 0x0019,
+	0xa817, 0x0001, 0x2900, 0xa85a, 0x2001, 0x002e, 0x2004, 0xa866,
+	0x2001, 0x002f, 0x2004, 0xa86a, 0x2001, 0x002a, 0x2004, 0x9084,
+	0xfff8, 0xa86e, 0x2001, 0x002b, 0x2004, 0xa872, 0x2061, 0x0090,
+	0x2079, 0x0100, 0x2001, 0x19a8, 0x2004, 0x6036, 0x2009, 0x0040,
+	0x080c, 0x21c1, 0x2001, 0x002a, 0x2004, 0x9084, 0xfff8, 0x601a,
+	0x0006, 0x2001, 0x002b, 0x2004, 0x601e, 0x78c6, 0x000e, 0x78ca,
+	0x9006, 0x600a, 0x600e, 0x008e, 0x00ce, 0x00ee, 0x00fe, 0x0005,
+	0x00e6, 0x2071, 0x0080, 0xaa60, 0x22e8, 0x20a0, 0x20e1, 0x0000,
+	0x2099, 0x0088, 0x702b, 0x0026, 0x7402, 0x7306, 0x9006, 0x700a,
+	0x700e, 0x810b, 0x810b, 0x21a8, 0x810b, 0x7112, 0x702b, 0x0041,
+	0x702c, 0xd0fc, 0x0de8, 0x702b, 0x0002, 0x702b, 0x0040, 0x4005,
+	0x7400, 0x7304, 0x87ff, 0x0190, 0x0086, 0x0096, 0x2940, 0x0086,
+	0x080c, 0x4aa9, 0x008e, 0xa058, 0x00a6, 0x2050, 0x2900, 0xb006,
+	0xa05a, 0x00ae, 0x009e, 0x008e, 0x9085, 0x0001, 0x00ee, 0x0005,
+	0x00e6, 0x2001, 0x002d, 0x2004, 0x9005, 0x0528, 0x2038, 0x2001,
+	0x0030, 0x2024, 0x2001, 0x0031, 0x201c, 0x080c, 0x4aa9, 0x2940,
+	0xa813, 0x0019, 0xaf16, 0x2900, 0xa85a, 0x978a, 0x0007, 0x0220,
+	0x2138, 0x2009, 0x0007, 0x0010, 0x2708, 0x903e, 0x0096, 0xa858,
+	0x2048, 0xa85c, 0x9080, 0x0019, 0x009e, 0x080c, 0x41a0, 0x1d68,
+	0x2900, 0xa85a, 0x00d8, 0x080c, 0x4aa9, 0x2940, 0xa013, 0x0019,
+	0xa017, 0x0001, 0x2800, 0xa05a, 0x2001, 0x0030, 0x2004, 0xa066,
+	0x2001, 0x0031, 0x2004, 0xa06a, 0x2001, 0x002a, 0x2004, 0x9084,
+	0xfff8, 0xa06e, 0x2001, 0x002b, 0x2004, 0xa072, 0x2001, 0x032a,
+	0x2003, 0x0004, 0x7884, 0xd0ac, 0x1180, 0x2001, 0x0101, 0x200c,
+	0x918d, 0x0200, 0x2102, 0xa017, 0x0000, 0x2001, 0x1a6a, 0x2003,
+	0x0003, 0x2001, 0x032a, 0x2003, 0x0009, 0x2001, 0x0300, 0x2003,
+	0x0000, 0x2001, 0x020d, 0x2003, 0x0000, 0x2001, 0x0004, 0x200c,
+	0x918d, 0x0002, 0x2102, 0x00ee, 0x0005, 0x0126, 0x2091, 0x8000,
+	0x20a9, 0x0007, 0x20a1, 0x1840, 0x20e9, 0x0001, 0x9006, 0x4004,
+	0x20a9, 0x000c, 0x20a1, 0xfff4, 0x20e9, 0x0000, 0x9006, 0x4004,
+	0x2009, 0x013c, 0x200a, 0x012e, 0x7880, 0x9086, 0x0052, 0x0108,
+	0x0005, 0x0804, 0x3567, 0x7d98, 0x7c9c, 0x0804, 0x3669, 0x080c,
+	0x74c8, 0x190c, 0x5fe9, 0x6040, 0x9084, 0x0020, 0x09b1, 0x2069,
+	0x1847, 0x2d00, 0x2009, 0x0030, 0x7a8c, 0x7b88, 0x7c9c, 0x7d98,
+	0x2039, 0x0001, 0x080c, 0x4af2, 0x701f, 0x427f, 0x0005, 0x080c,
+	0x56e4, 0x1130, 0x3b00, 0x3a08, 0xc194, 0xc095, 0x20d8, 0x21d0,
+	0x2069, 0x1847, 0x6800, 0x9005, 0x0904, 0x359c, 0x6804, 0xd0ac,
+	0x0118, 0xd0a4, 0x0904, 0x359c, 0xd094, 0x00c6, 0x2061, 0x0100,
+	0x6104, 0x0138, 0x6200, 0x9292, 0x0005, 0x0218, 0x918c, 0xffdf,
+	0x0010, 0x918d, 0x0020, 0x6106, 0x00ce, 0xd08c, 0x00c6, 0x2061,
+	0x0100, 0x6104, 0x0118, 0x918d, 0x0010, 0x0010, 0x918c, 0xffef,
+	0x6106, 0x00ce, 0xd084, 0x0158, 0x6a28, 0x928a, 0x007f, 0x1a04,
+	0x359c, 0x9288, 0x3368, 0x210d, 0x918c, 0x00ff, 0x6166, 0xd0dc,
+	0x0130, 0x6828, 0x908a, 0x007f, 0x1a04, 0x359c, 0x605e, 0x6888,
+	0x9084, 0x0030, 0x8004, 0x8004, 0x8004, 0x8004, 0x0006, 0x2009,
+	0x19b0, 0x9080, 0x2750, 0x2005, 0x200a, 0x2008, 0x2001, 0x0018,
+	0x080c, 0xa879, 0x2009, 0x0390, 0x200b, 0x0400, 0x000e, 0x2009,
+	0x19b1, 0x9080, 0x2754, 0x2005, 0x200a, 0x6808, 0x908a, 0x0100,
+	0x0a04, 0x359c, 0x908a, 0x0841, 0x1a04, 0x359c, 0x9084, 0x0007,
+	0x1904, 0x359c, 0x680c, 0x9005, 0x0904, 0x359c, 0x6810, 0x9005,
+	0x0904, 0x359c, 0x6848, 0x6940, 0x910a, 0x1a04, 0x359c, 0x8001,
+	0x0904, 0x359c, 0x684c, 0x6944, 0x910a, 0x1a04, 0x359c, 0x8001,
+	0x0904, 0x359c, 0x6814, 0x908c, 0x00ff, 0x614e, 0x8007, 0x9084,
+	0x00ff, 0x6052, 0x080c, 0x77fd, 0x080c, 0x6a9c, 0x080c, 0x6ad0,
+	0x6808, 0x602a, 0x080c, 0x2133, 0x2009, 0x0170, 0x200b, 0x0080,
+	0xa001, 0xa001, 0x200b, 0x0000, 0x0036, 0x6b08, 0x080c, 0x26b7,
+	0x003e, 0x6000, 0x9086, 0x0000, 0x1904, 0x440a, 0x6818, 0x691c,
+	0x6a20, 0x6b24, 0x8007, 0x810f, 0x8217, 0x831f, 0x6016, 0x611a,
+	0x621e, 0x6322, 0x6c04, 0xd4f4, 0x0148, 0x6830, 0x6934, 0x6a38,
+	0x6b3c, 0x8007, 0x810f, 0x8217, 0x831f, 0x0010, 0x9084, 0xf0ff,
+	0x6006, 0x610a, 0x620e, 0x6312, 0x8007, 0x810f, 0x8217, 0x831f,
+	0x20a9, 0x0004, 0x20a1, 0x19b2, 0x20e9, 0x0001, 0x4001, 0x20a9,
+	0x0004, 0x20a1, 0x19cc, 0x20e9, 0x0001, 0x4001, 0x080c, 0x87b0,
+	0x00c6, 0x900e, 0x20a9, 0x0001, 0x6b70, 0xd384, 0x01c8, 0x0020,
+	0x839d, 0x12b0, 0x3508, 0x8109, 0x080c, 0x7dbe, 0x6878, 0x6016,
+	0x6874, 0x2008, 0x9084, 0xff00, 0x8007, 0x600a, 0x9184, 0x00ff,
+	0x6006, 0x8108, 0x1118, 0x6003, 0x0003, 0x0010, 0x6003, 0x0001,
+	0x1f04, 0x4368, 0x00ce, 0x00c6, 0x2061, 0x199b, 0x6a88, 0x9284,
+	0xc000, 0x2010, 0x9286, 0x0000, 0x1158, 0x2063, 0x0000, 0x2001,
+	0x0001, 0x080c, 0x295e, 0x2001, 0x0001, 0x080c, 0x2941, 0x0088,
+	0x9286, 0x4000, 0x1148, 0x2063, 0x0001, 0x9006, 0x080c, 0x295e,
+	0x9006, 0x080c, 0x2941, 0x0028, 0x9286, 0x8000, 0x1d30, 0x2063,
+	0x0002, 0x00ce, 0x00e6, 0x2c70, 0x080c, 0x0eb4, 0x00ee, 0x6888,
+	0xd0ec, 0x0130, 0x2011, 0x0114, 0x2204, 0x9085, 0x0180, 0x2012,
+	0x6a80, 0x9284, 0x0030, 0x9086, 0x0030, 0x1128, 0x9294, 0xffcf,
+	0x9295, 0x0020, 0x6a82, 0x2001, 0x197b, 0x6a80, 0x9294, 0x0030,
+	0x928e, 0x0000, 0x0170, 0x928e, 0x0010, 0x0118, 0x928e, 0x0020,
+	0x0140, 0x2003, 0xaaaa, 0x080c, 0x272c, 0x2001, 0x196c, 0x2102,
+	0x0008, 0x2102, 0x00c6, 0x2061, 0x0100, 0x602f, 0x0040, 0x602f,
+	0x0000, 0x00ce, 0x080c, 0x74c8, 0x0128, 0x080c, 0x4fd9, 0x0110,
+	0x080c, 0x267d, 0x60d4, 0x9005, 0x01c0, 0x6003, 0x0001, 0x2009,
+	0x43f2, 0x00e0, 0x080c, 0x74c8, 0x1168, 0x2011, 0x733e, 0x080c,
+	0x861d, 0x2011, 0x7331, 0x080c, 0x8729, 0x080c, 0x77d1, 0x080c,
+	0x73f9, 0x0040, 0x080c, 0x5edf, 0x0028, 0x6003, 0x0004, 0x2009,
+	0x440a, 0x0020, 0x080c, 0x69cc, 0x0804, 0x3567, 0x2001, 0x0170,
+	0x2004, 0x9084, 0x00ff, 0x9086, 0x004c, 0x1118, 0x2091, 0x31bd,
+	0x0817, 0x2091, 0x313d, 0x0817, 0x6000, 0x9086, 0x0000, 0x0904,
+	0x3599, 0x2069, 0x1847, 0x7890, 0x6842, 0x7894, 0x6846, 0x2d00,
+	0x2009, 0x0030, 0x7a8c, 0x7b88, 0x7c9c, 0x7d98, 0x2039, 0x0001,
+	0x0804, 0x4af5, 0x9006, 0x080c, 0x267d, 0x81ff, 0x1904, 0x3599,
+	0x080c, 0x74c8, 0x11b0, 0x080c, 0x77cc, 0x080c, 0x6024, 0x080c,
+	0x335c, 0x0118, 0x6130, 0xc18d, 0x6132, 0x080c, 0xcf51, 0x0130,
+	0x080c, 0x74eb, 0x1118, 0x080c, 0x749c, 0x0038, 0x080c, 0x73f9,
+	0x0020, 0x080c, 0x5fe9, 0x080c, 0x5edf, 0x0804, 0x3567, 0x81ff,
+	0x1904, 0x3599, 0x080c, 0x74c8, 0x1110, 0x0804, 0x3599, 0x6194,
+	0x81ff, 0x01a8, 0x704f, 0x0000, 0x2001, 0x1d80, 0x2009, 0x0040,
+	0x7a8c, 0x7b88, 0x7c9c, 0x7d98, 0x0126, 0x2091, 0x8000, 0x2039,
+	0x0001, 0x080c, 0x4af5, 0x701f, 0x3565, 0x012e, 0x0005, 0x704f,
+	0x0001, 0x00d6, 0x2069, 0x1d80, 0x20a9, 0x0040, 0x20e9, 0x0001,
+	0x20a1, 0x1d80, 0x2019, 0xffff, 0x4304, 0x655c, 0x9588, 0x3368,
+	0x210d, 0x918c, 0x00ff, 0x216a, 0x900e, 0x2011, 0x0002, 0x2100,
+	0x9506, 0x01a8, 0x080c, 0x6620, 0x1190, 0xb814, 0x821c, 0x0238,
+	0x9398, 0x1d80, 0x9085, 0xff00, 0x8007, 0x201a, 0x0038, 0x9398,
+	0x1d80, 0x2324, 0x94a4, 0xff00, 0x9405, 0x201a, 0x8210, 0x8108,
+	0x9182, 0x0080, 0x1208, 0x0c18, 0x8201, 0x8007, 0x2d0c, 0x9105,
+	0x206a, 0x00de, 0x20a9, 0x0040, 0x20a1, 0x1d80, 0x2099, 0x1d80,
+	0x080c, 0x5f74, 0x0804, 0x4464, 0x080c, 0x4adc, 0x0904, 0x359c,
+	0x080c, 0x4aa9, 0x1120, 0x2009, 0x0002, 0x0804, 0x3599, 0x080c,
+	0x56d5, 0xd0b4, 0x0558, 0x7884, 0x908e, 0x007e, 0x0538, 0x908e,
+	0x007f, 0x0520, 0x908e, 0x0080, 0x0508, 0x080c, 0x3357, 0x1148,
+	0xb800, 0xd08c, 0x11d8, 0xb804, 0x9084, 0x00ff, 0x9086, 0x0006,
+	0x11a8, 0xa867, 0x0000, 0xa868, 0xc0fd, 0xa86a, 0x080c, 0xca01,
+	0x1120, 0x2009, 0x0003, 0x0804, 0x3599, 0x7007, 0x0003, 0x701f,
+	0x44f2, 0x0005, 0x080c, 0x4adc, 0x0904, 0x359c, 0x20a9, 0x002b,
+	0xb8c4, 0x20e0, 0xb8c8, 0x2098, 0xa860, 0x20e8, 0xa85c, 0x9080,
+	0x0002, 0x20a0, 0x4003, 0x20a9, 0x0008, 0x9080, 0x0006, 0x20a0,
+	0xb8c4, 0x20e0, 0xb8c8, 0x9080, 0x0006, 0x2098, 0x080c, 0x0fb7,
+	0x0070, 0x20a9, 0x0004, 0xa85c, 0x9080, 0x000a, 0x20a0, 0xb8c4,
+	0x20e0, 0xb8c8, 0x9080, 0x000a, 0x2098, 0x080c, 0x0fb7, 0x8906,
+	0x8006, 0x8007, 0x90bc, 0x003f, 0x9084, 0xffc0, 0x9080, 0x0002,
+	0x2009, 0x002b, 0x7a8c, 0x7b88, 0x7c9c, 0x7d98, 0x0804, 0x4af5,
+	0x81ff, 0x1904, 0x3599, 0x080c, 0x4ac0, 0x0904, 0x359c, 0x080c,
+	0x6865, 0x0904, 0x3599, 0x0058, 0xa878, 0x9005, 0x0120, 0x2009,
+	0x0004, 0x0804, 0x3599, 0xa974, 0xaa94, 0x0804, 0x3567, 0x080c,
+	0x56dd, 0x0904, 0x3567, 0x701f, 0x453c, 0x7007, 0x0003, 0x0005,
+	0x81ff, 0x1904, 0x3599, 0x7888, 0x908a, 0x1000, 0x1a04, 0x359c,
+	0x080c, 0x4adc, 0x0904, 0x359c, 0x080c, 0x6a6a, 0x0120, 0x080c,
+	0x6a72, 0x1904, 0x359c, 0x080c, 0x68ea, 0x0904, 0x3599, 0x2019,
+	0x0004, 0x900e, 0x080c, 0x6877, 0x0904, 0x3599, 0x7984, 0x7a88,
+	0x04c9, 0x08a8, 0xa89c, 0x908a, 0x1000, 0x12f8, 0x080c, 0x4ada,
+	0x01e0, 0x080c, 0x6a6a, 0x0118, 0x080c, 0x6a72, 0x11b0, 0x080c,
+	0x68ea, 0x2009, 0x0002, 0x0168, 0x2009, 0x0002, 0x2019, 0x0004,
+	0x080c, 0x6877, 0x2009, 0x0003, 0x0120, 0xa998, 0xaa9c, 0x00d1,
+	0x0060, 0xa897, 0x4005, 0xa99a, 0x0010, 0xa897, 0x4006, 0x900e,
+	0x9085, 0x0001, 0x2001, 0x0030, 0x0005, 0xa897, 0x4000, 0x080c,
+	0x56dd, 0x0110, 0x9006, 0x0018, 0x900e, 0x9085, 0x0001, 0x2001,
+	0x0000, 0x0005, 0x9186, 0x00ff, 0x0110, 0x0071, 0x0060, 0x2029,
+	0x007e, 0x2061, 0x1800, 0x645c, 0x2400, 0x9506, 0x0110, 0x2508,
+	0x0019, 0x8529, 0x1ec8, 0x0005, 0x080c, 0x6620, 0x1138, 0x2200,
+	0x8003, 0x800b, 0x810b, 0x9108, 0x080c, 0x862b, 0x0005, 0x81ff,
+	0x1904, 0x3599, 0x798c, 0x2001, 0x197f, 0x918c, 0x8000, 0x2102,
+	0x080c, 0x4ac0, 0x0904, 0x359c, 0x080c, 0x6a6a, 0x0120, 0x080c,
+	0x6a72, 0x1904, 0x359c, 0x080c, 0x66e7, 0x0904, 0x3599, 0x080c,
+	0x686e, 0x0904, 0x3599, 0x2001, 0x197f, 0x2004, 0xd0fc, 0x1904,
+	0x3567, 0x0804, 0x4547, 0xa9a0, 0x2001, 0x197f, 0x918c, 0x8000,
+	0xc18d, 0x2102, 0x080c, 0x4acd, 0x01a0, 0x080c, 0x6a6a, 0x0118,
+	0x080c, 0x6a72, 0x1170, 0x080c, 0x66e7, 0x2009, 0x0002, 0x0128,
+	0x080c, 0x686e, 0x1170, 0x2009, 0x0003, 0xa897, 0x4005, 0xa99a,
+	0x0010, 0xa897, 0x4006, 0x900e, 0x9085, 0x0001, 0x2001, 0x0030,
+	0x0005, 0xa897, 0x4000, 0x2001, 0x197f, 0x2004, 0xd0fc, 0x1128,
+	0x080c, 0x56dd, 0x0110, 0x9006, 0x0018, 0x900e, 0x9085, 0x0001,
+	0x2001, 0x0000, 0x0005, 0x81ff, 0x1904, 0x3599, 0x798c, 0x2001,
+	0x197e, 0x918c, 0x8000, 0x2102, 0x080c, 0x4ac0, 0x0904, 0x359c,
+	0x080c, 0x6a6a, 0x0120, 0x080c, 0x6a72, 0x1904, 0x359c, 0x080c,
+	0x66e7, 0x0904, 0x3599, 0x080c, 0x685c, 0x0904, 0x3599, 0x2001,
+	0x197e, 0x2004, 0xd0fc, 0x1904, 0x3567, 0x0804, 0x4547, 0xa9a0,
+	0x2001, 0x197e, 0x918c, 0x8000, 0xc18d, 0x2102, 0x080c, 0x4acd,
+	0x01a0, 0x080c, 0x6a6a, 0x0118, 0x080c, 0x6a72, 0x1170, 0x080c,
+	0x66e7, 0x2009, 0x0002, 0x0128, 0x080c, 0x685c, 0x1170, 0x2009,
+	0x0003, 0xa897, 0x4005, 0xa99a, 0x0010, 0xa897, 0x4006, 0x900e,
+	0x9085, 0x0001, 0x2001, 0x0030, 0x0005, 0xa897, 0x4000, 0x2001,
+	0x197e, 0x2004, 0xd0fc, 0x1128, 0x080c, 0x56dd, 0x0110, 0x9006,
+	0x0018, 0x900e, 0x9085, 0x0001, 0x2001, 0x0000, 0x0005, 0x6100,
+	0x0804, 0x3567, 0x080c, 0x4adc, 0x0904, 0x359c, 0x080c, 0x56e9,
+	0x1904, 0x3599, 0x79a8, 0xd184, 0x1158, 0xb834, 0x8007, 0x789e,
+	0xb830, 0x8007, 0x789a, 0xbb2c, 0x831f, 0xba28, 0x8217, 0x0050,
+	0xb824, 0x8007, 0x789e, 0xb820, 0x8007, 0x789a, 0xbb1c, 0x831f,
+	0xba18, 0x8217, 0xb900, 0x918c, 0x0200, 0x0804, 0x3567, 0x78a8,
+	0x909c, 0x0003, 0xd0b4, 0x1140, 0x939a, 0x0003, 0x1a04, 0x3599,
+	0x625c, 0x7884, 0x9206, 0x1548, 0x080c, 0x879a, 0x2001, 0xfff4,
+	0x2009, 0x000c, 0x7a8c, 0x7b88, 0x7c9c, 0x7d98, 0x2039, 0x0000,
+	0x0006, 0x78a8, 0x9084, 0x0080, 0x1118, 0x000e, 0x0804, 0x4af5,
+	0x000e, 0x2031, 0x0000, 0x2061, 0x18b8, 0x2c44, 0xa66a, 0xa17a,
+	0xa772, 0xa076, 0xa28e, 0xa392, 0xa496, 0xa59a, 0x080c, 0x112f,
+	0x7007, 0x0002, 0x701f, 0x46fd, 0x0005, 0x81ff, 0x1904, 0x3599,
+	0x080c, 0x4adc, 0x0904, 0x359c, 0x080c, 0x6a6a, 0x1904, 0x3599,
+	0x00c6, 0x080c, 0x4aa9, 0x00ce, 0x0904, 0x3599, 0xa867, 0x0000,
+	0xa868, 0xc0fd, 0xa86a, 0x7ea8, 0x080c, 0xc9a7, 0x0904, 0x3599,
+	0x7007, 0x0003, 0x701f, 0x4701, 0x0005, 0x080c, 0x4245, 0x0804,
+	0x3567, 0xa830, 0x9086, 0x0100, 0x0904, 0x3599, 0x8906, 0x8006,
+	0x8007, 0x90bc, 0x003f, 0x9084, 0xffc0, 0x9080, 0x001b, 0x2009,
+	0x000c, 0x7a8c, 0x7b88, 0x7c9c, 0x7d98, 0x0804, 0x4af5, 0x9006,
+	0x080c, 0x267d, 0x78a8, 0x9084, 0x00ff, 0x9086, 0x00ff, 0x0118,
+	0x81ff, 0x1904, 0x3599, 0x080c, 0x74c8, 0x0110, 0x080c, 0x5fe9,
+	0x7888, 0x908a, 0x1000, 0x1a04, 0x359c, 0x7984, 0x9186, 0x00ff,
+	0x0138, 0x9182, 0x007f, 0x1a04, 0x359c, 0x2100, 0x080c, 0x2647,
+	0x0026, 0x00c6, 0x0126, 0x2091, 0x8000, 0x2061, 0x1a02, 0x601b,
+	0x0000, 0x601f, 0x0000, 0x6073, 0x0000, 0x6077, 0x0000, 0x080c,
+	0x74c8, 0x1158, 0x080c, 0x77cc, 0x080c, 0x6024, 0x9085, 0x0001,
+	0x080c, 0x750f, 0x080c, 0x73f9, 0x00f0, 0x080c, 0xa888, 0x080c,
+	0xab50, 0x080c, 0xa8a4, 0x2061, 0x0100, 0x2001, 0x1818, 0x2004,
+	0x9084, 0x00ff, 0x810f, 0x9105, 0x604a, 0x6043, 0x0090, 0x6043,
+	0x0010, 0x2009, 0x1998, 0x200b, 0x0000, 0x2009, 0x002d, 0x2011,
+	0x5f0f, 0x080c, 0x86e7, 0x7984, 0x080c, 0x74c8, 0x1110, 0x2009,
+	0x00ff, 0x7a88, 0x080c, 0x45aa, 0x012e, 0x00ce, 0x002e, 0x0804,
+	0x3567, 0x7984, 0x080c, 0x65bf, 0x2b08, 0x1904, 0x359c, 0x0804,
+	0x3567, 0x81ff, 0x0120, 0x2009, 0x0001, 0x0804, 0x3599, 0x60dc,
+	0xd0ac, 0x1130, 0xd09c, 0x1120, 0x2009, 0x0005, 0x0804, 0x3599,
+	0x080c, 0x4aa9, 0x1120, 0x2009, 0x0002, 0x0804, 0x3599, 0x7984,
+	0x9192, 0x0021, 0x1a04, 0x359c, 0x7a8c, 0x7b88, 0x7c9c, 0x7d98,
+	0xa85c, 0x9080, 0x0019, 0x702a, 0xaf60, 0x7736, 0x080c, 0x4af2,
+	0x701f, 0x47b9, 0x7880, 0x9086, 0x006e, 0x0110, 0x701f, 0x518b,
+	0x0005, 0x2009, 0x0080, 0x080c, 0x6620, 0x1118, 0x080c, 0x6a6a,
+	0x0120, 0x2021, 0x400a, 0x0804, 0x3569, 0x00d6, 0x0096, 0xa964,
+	0xaa6c, 0xab70, 0xac74, 0xad78, 0xae7c, 0xa884, 0x90be, 0x0100,
+	0x0904, 0x4852, 0x90be, 0x0112, 0x0904, 0x4852, 0x90be, 0x0113,
+	0x0904, 0x4852, 0x90be, 0x0114, 0x0904, 0x4852, 0x90be, 0x0117,
+	0x0904, 0x4852, 0x90be, 0x011a, 0x0904, 0x4852, 0x90be, 0x011c,
+	0x0904, 0x4852, 0x90be, 0x0121, 0x0904, 0x4839, 0x90be, 0x0131,
+	0x0904, 0x4839, 0x90be, 0x0171, 0x0904, 0x4852, 0x90be, 0x0173,
+	0x0904, 0x4852, 0x90be, 0x01a1, 0x1128, 0xa894, 0x8007, 0xa896,
+	0x0804, 0x485d, 0x90be, 0x0212, 0x0904, 0x4846, 0x90be, 0x0213,
+	0x05e8, 0x90be, 0x0214, 0x0500, 0x90be, 0x0217, 0x0188, 0x90be,
+	0x021a, 0x1120, 0xa89c, 0x8007, 0xa89e, 0x04e0, 0x90be, 0x021f,
+	0x05c8, 0x90be, 0x0300, 0x05b0, 0x009e, 0x00de, 0x0804, 0x359c,
+	0x7028, 0x9080, 0x0010, 0x2098, 0x20a0, 0x7034, 0x20e0, 0x20e8,
+	0x20a9, 0x0007, 0x080c, 0x489b, 0x7028, 0x9080, 0x000e, 0x2098,
+	0x20a0, 0x7034, 0x20e0, 0x20e8, 0x20a9, 0x0001, 0x080c, 0x489b,
+	0x00c8, 0x7028, 0x9080, 0x000c, 0x2098, 0x20a0, 0x7034, 0x20e0,
+	0x20e8, 0x20a9, 0x0001, 0x080c, 0x48a8, 0x00b8, 0x7028, 0x9080,
+	0x000e, 0x2098, 0x20a0, 0x7034, 0x20e0, 0x20e8, 0x20a9, 0x0001,
+	0x080c, 0x48a8, 0x7028, 0x9080, 0x000c, 0x2098, 0x20a0, 0x7034,
+	0x20e0, 0x20e8, 0x20a9, 0x0001, 0x04f1, 0x00c6, 0x080c, 0x4aa9,
+	0x0550, 0xa868, 0xc0fd, 0xa86a, 0xa867, 0x0119, 0x9006, 0xa882,
+	0xa87f, 0x0020, 0xa88b, 0x0001, 0x810b, 0xa9ae, 0xa8b2, 0xaab6,
+	0xabba, 0xacbe, 0xadc2, 0xa9c6, 0xa8ca, 0x00ce, 0x009e, 0x00de,
+	0xa866, 0xa822, 0xa868, 0xc0fd, 0xa86a, 0xa804, 0x2048, 0x080c,
+	0xc9c2, 0x1120, 0x2009, 0x0003, 0x0804, 0x3599, 0x7007, 0x0003,
+	0x701f, 0x4892, 0x0005, 0x00ce, 0x009e, 0x00de, 0x2009, 0x0002,
+	0x0804, 0x3599, 0xa820, 0x9086, 0x8001, 0x1904, 0x3567, 0x2009,
+	0x0004, 0x0804, 0x3599, 0x0016, 0x0026, 0x3510, 0x20a9, 0x0002,
+	0x4002, 0x4104, 0x4004, 0x8211, 0x1dc8, 0x002e, 0x001e, 0x0005,
+	0x0016, 0x0026, 0x0036, 0x0046, 0x3520, 0x20a9, 0x0004, 0x4002,
+	0x4304, 0x4204, 0x4104, 0x4004, 0x8421, 0x1db8, 0x004e, 0x003e,
+	0x002e, 0x001e, 0x0005, 0x81ff, 0x0120, 0x2009, 0x0001, 0x0804,
+	0x3599, 0x60dc, 0xd0ac, 0x1130, 0xd09c, 0x1120, 0x2009, 0x0005,
+	0x0804, 0x3599, 0x7984, 0x78a8, 0x2040, 0x080c, 0xab49, 0x1120,
+	0x9182, 0x007f, 0x0a04, 0x359c, 0x9186, 0x00ff, 0x0904, 0x359c,
+	0x9182, 0x0800, 0x1a04, 0x359c, 0x7a8c, 0x7b88, 0x607c, 0x9306,
+	0x1158, 0x6080, 0x924e, 0x0904, 0x359c, 0x080c, 0xab49, 0x1120,
+	0x99cc, 0xff00, 0x0904, 0x359c, 0x0126, 0x2091, 0x8000, 0x080c,
+	0x49bc, 0x0904, 0x493c, 0x0086, 0x90c6, 0x4000, 0x008e, 0x1538,
+	0x00c6, 0x0006, 0x0036, 0xb818, 0xbb1c, 0x9305, 0xbb20, 0x9305,
+	0xbb24, 0x9305, 0xbb28, 0x9305, 0xbb2c, 0x9305, 0xbb30, 0x9305,
+	0xbb34, 0x9305, 0x003e, 0x0570, 0xd88c, 0x1128, 0x080c, 0x6a6a,
+	0x0110, 0xc89d, 0x0438, 0x900e, 0x080c, 0x6913, 0x1108, 0xc185,
+	0xb800, 0xd0bc, 0x0108, 0xc18d, 0x000e, 0x00ce, 0x00b8, 0x90c6,
+	0x4007, 0x1110, 0x2408, 0x0090, 0x90c6, 0x4008, 0x1118, 0x2708,
+	0x2610, 0x0060, 0x90c6, 0x4009, 0x1108, 0x0040, 0x90c6, 0x4006,
+	0x1108, 0x0020, 0x2001, 0x4005, 0x2009, 0x000a, 0x2020, 0x012e,
+	0x0804, 0x3569, 0x000e, 0x00ce, 0x2b00, 0x7026, 0x0016, 0x00b6,
+	0x00c6, 0x00e6, 0x2c70, 0x080c, 0xac4f, 0x0904, 0x4991, 0x2b00,
+	0x6012, 0x080c, 0xcccb, 0x2e58, 0x00ee, 0x00e6, 0x00c6, 0x080c,
+	0x4aa9, 0x00ce, 0x2b70, 0x1158, 0x080c, 0xabdf, 0x00ee, 0x00ce,
+	0x00be, 0x001e, 0x012e, 0x2009, 0x0002, 0x0804, 0x3599, 0x900e,
+	0xa966, 0xa96a, 0x2900, 0x6016, 0xa932, 0xa868, 0xc0fd, 0xd88c,
+	0x0108, 0xc0f5, 0xa86a, 0xd89c, 0x1110, 0x080c, 0x31ef, 0x6023,
+	0x0001, 0x9006, 0x080c, 0x655c, 0xd89c, 0x0138, 0x2001, 0x0004,
+	0x080c, 0x6570, 0x2009, 0x0003, 0x0030, 0x2001, 0x0002, 0x080c,
+	0x6570, 0x2009, 0x0002, 0x080c, 0xac7c, 0x78a8, 0xd094, 0x0138,
+	0x00ee, 0x7024, 0x00e6, 0x2058, 0xb8d4, 0xc08d, 0xb8d6, 0x9085,
+	0x0001, 0x00ee, 0x00ce, 0x00be, 0x001e, 0x012e, 0x1120, 0x2009,
+	0x0003, 0x0804, 0x3599, 0x7007, 0x0003, 0x701f, 0x49a0, 0x0005,
+	0xa830, 0x9086, 0x0100, 0x7024, 0x2058, 0x1138, 0x2009, 0x0004,
+	0xba04, 0x9294, 0x00ff, 0x0804, 0x5632, 0x900e, 0xa868, 0xd0f4,
+	0x1904, 0x3567, 0x080c, 0x6913, 0x1108, 0xc185, 0xb800, 0xd0bc,
+	0x0108, 0xc18d, 0x0804, 0x3567, 0x00e6, 0x00d6, 0x0096, 0x83ff,
+	0x0904, 0x4a0b, 0x902e, 0x080c, 0xab49, 0x0130, 0x9026, 0x20a9,
+	0x0800, 0x2071, 0x1000, 0x0030, 0x2021, 0x007f, 0x20a9, 0x0781,
+	0x2071, 0x107f, 0x2e04, 0x9005, 0x11b8, 0x2100, 0x9406, 0x1904,
+	0x4a1c, 0x2428, 0x94ce, 0x007f, 0x1120, 0x92ce, 0xfffd, 0x1558,
+	0x0030, 0x94ce, 0x0080, 0x1130, 0x92ce, 0xfffc, 0x1520, 0x93ce,
+	0x00ff, 0x1508, 0xc5fd, 0x0480, 0x2058, 0xbf10, 0x2700, 0x9306,
+	0x11e8, 0xbe14, 0x2600, 0x9206, 0x11c8, 0x2400, 0x9106, 0x1180,
+	0xd884, 0x0598, 0xd894, 0x1588, 0x080c, 0x6a0a, 0x1570, 0x2001,
+	0x4000, 0x0460, 0x080c, 0x6a6a, 0x1540, 0x2001, 0x4000, 0x0430,
+	0x2001, 0x4007, 0x0418, 0x2001, 0x4006, 0x0400, 0x2400, 0x9106,
+	0x1158, 0xbe14, 0x87ff, 0x1128, 0x86ff, 0x0918, 0x080c, 0xab49,
+	0x1900, 0x2001, 0x4008, 0x0090, 0x8420, 0x8e70, 0x1f04, 0x49d2,
+	0x85ff, 0x1130, 0x2001, 0x4009, 0x0048, 0x2001, 0x0001, 0x0030,
+	0x080c, 0x65bf, 0x1dd0, 0xbb12, 0xba16, 0x9006, 0x9005, 0x009e,
+	0x00de, 0x00ee, 0x0005, 0x81ff, 0x0120, 0x2009, 0x0001, 0x0804,
+	0x3599, 0x080c, 0x4aa9, 0x1120, 0x2009, 0x0002, 0x0804, 0x3599,
+	0xa867, 0x0000, 0xa868, 0xc0fd, 0xa86a, 0x7884, 0x9005, 0x0904,
+	0x359c, 0x9096, 0x00ff, 0x0120, 0x9092, 0x0004, 0x1a04, 0x359c,
+	0x2010, 0x2918, 0x080c, 0x318f, 0x1120, 0x2009, 0x0003, 0x0804,
+	0x3599, 0x7007, 0x0003, 0x701f, 0x4a5e, 0x0005, 0xa830, 0x9086,
+	0x0100, 0x1904, 0x3567, 0x2009, 0x0004, 0x0804, 0x3599, 0x7984,
+	0x080c, 0xab49, 0x1120, 0x9182, 0x007f, 0x0a04, 0x359c, 0x9186,
+	0x00ff, 0x0904, 0x359c, 0x9182, 0x0800, 0x1a04, 0x359c, 0x2001,
+	0x9000, 0x080c, 0x568d, 0x1904, 0x3599, 0x0804, 0x3567, 0xa998,
+	0x080c, 0xab49, 0x1118, 0x9182, 0x007f, 0x0280, 0x9186, 0x00ff,
+	0x0168, 0x9182, 0x0800, 0x1250, 0x2001, 0x9000, 0x080c, 0x568d,
+	0x11a8, 0x0060, 0xa897, 0x4005, 0xa99a, 0x0010, 0xa897, 0x4006,
 	0x900e, 0x9085, 0x0001, 0x2001, 0x0030, 0x0005, 0xa897, 0x4000,
-	0x2001, 0x197f, 0x2004, 0xd0fc, 0x1128, 0x080c, 0x56e2, 0x0110,
-	0x9006, 0x0018, 0x900e, 0x9085, 0x0001, 0x2001, 0x0000, 0x0005,
-	0x6100, 0x0804, 0x3573, 0x080c, 0x4ada, 0x0904, 0x35a8, 0x080c,
-	0x56ee, 0x1904, 0x35a5, 0x79a8, 0xd184, 0x1158, 0xb834, 0x8007,
-	0x789e, 0xb830, 0x8007, 0x789a, 0xbb2c, 0x831f, 0xba28, 0x8217,
-	0x0050, 0xb824, 0x8007, 0x789e, 0xb820, 0x8007, 0x789a, 0xbb1c,
-	0x831f, 0xba18, 0x8217, 0xb900, 0x918c, 0x0200, 0x0804, 0x3573,
-	0x78a8, 0x909c, 0x0003, 0xd0b4, 0x1140, 0x939a, 0x0003, 0x1a04,
-	0x35a5, 0x625c, 0x7884, 0x9206, 0x1548, 0x080c, 0x87bb, 0x2001,
-	0xfff4, 0x2009, 0x000c, 0x7a8c, 0x7b88, 0x7c9c, 0x7d98, 0x2039,
-	0x0000, 0x0006, 0x78a8, 0x9084, 0x0080, 0x1118, 0x000e, 0x0804,
-	0x4af3, 0x000e, 0x2031, 0x0000, 0x2061, 0x18b8, 0x2c44, 0xa66a,
-	0xa17a, 0xa772, 0xa076, 0xa28e, 0xa392, 0xa496, 0xa59a, 0x080c,
-	0x1124, 0x7007, 0x0002, 0x701f, 0x46fe, 0x0005, 0x81ff, 0x1904,
-	0x35a5, 0x080c, 0x4ada, 0x0904, 0x35a8, 0x080c, 0x6a6b, 0x1904,
-	0x35a5, 0x00c6, 0x080c, 0x4aa7, 0x00ce, 0x0904, 0x35a5, 0xa867,
-	0x0000, 0xa868, 0xc0fd, 0xa86a, 0x7ea8, 0x080c, 0xc9ad, 0x0904,
-	0x35a5, 0x7007, 0x0003, 0x701f, 0x4702, 0x0005, 0x080c, 0x4246,
-	0x0804, 0x3573, 0xa830, 0x9086, 0x0100, 0x0904, 0x35a5, 0x8906,
-	0x8006, 0x8007, 0x90bc, 0x003f, 0x9084, 0xffc0, 0x9080, 0x001b,
-	0x2009, 0x000c, 0x7a8c, 0x7b88, 0x7c9c, 0x7d98, 0x0804, 0x4af3,
-	0x9006, 0x080c, 0x2664, 0x78a8, 0x9084, 0x00ff, 0x9086, 0x00ff,
-	0x0118, 0x81ff, 0x1904, 0x35a5, 0x080c, 0x74e9, 0x0110, 0x080c,
-	0x5fee, 0x7888, 0x908a, 0x1000, 0x1a04, 0x35a8, 0x7984, 0x9186,
-	0x00ff, 0x0138, 0x9182, 0x007f, 0x1a04, 0x35a8, 0x2100, 0x080c,
-	0x262e, 0x0026, 0x00c6, 0x0126, 0x2091, 0x8000, 0x2061, 0x1a03,
-	0x601b, 0x0000, 0x601f, 0x0000, 0x6073, 0x0000, 0x6077, 0x0000,
-	0x080c, 0x74e9, 0x1158, 0x080c, 0x77ed, 0x080c, 0x6029, 0x9085,
-	0x0001, 0x080c, 0x7530, 0x080c, 0x741a, 0x00f0, 0x080c, 0xa896,
-	0x080c, 0xab5e, 0x080c, 0xa8b2, 0x2061, 0x0100, 0x2001, 0x1818,
-	0x2004, 0x9084, 0x00ff, 0x810f, 0x9105, 0x604a, 0x6043, 0x0090,
-	0x6043, 0x0010, 0x2009, 0x1999, 0x200b, 0x0000, 0x2009, 0x002d,
-	0x2011, 0x5f14, 0x080c, 0x8708, 0x7984, 0x080c, 0x74e9, 0x1110,
-	0x2009, 0x00ff, 0x7a88, 0x080c, 0x45ab, 0x012e, 0x00ce, 0x002e,
-	0x0804, 0x3573, 0x7984, 0x080c, 0x65c4, 0x2b08, 0x1904, 0x35a8,
-	0x0804, 0x3573, 0x81ff, 0x0120, 0x2009, 0x0001, 0x0804, 0x35a5,
-	0x60dc, 0xd0ac, 0x1130, 0xd09c, 0x1120, 0x2009, 0x0005, 0x0804,
-	0x35a5, 0x080c, 0x4aa7, 0x1120, 0x2009, 0x0002, 0x0804, 0x35a5,
-	0x7984, 0x9192, 0x0021, 0x1a04, 0x35a8, 0x7a8c, 0x7b88, 0x7c9c,
-	0x7d98, 0xa85c, 0x9080, 0x0019, 0x702a, 0xaf60, 0x7736, 0x080c,
-	0x4af0, 0x701f, 0x47ba, 0x7880, 0x9086, 0x006e, 0x0110, 0x701f,
-	0x5190, 0x0005, 0x2009, 0x0080, 0x080c, 0x6625, 0x1118, 0x080c,
-	0x6a6b, 0x0120, 0x2021, 0x400a, 0x0804, 0x3575, 0x00d6, 0x0096,
-	0xa964, 0xaa6c, 0xab70, 0xac74, 0xad78, 0xae7c, 0xa884, 0x90be,
-	0x0100, 0x0904, 0x4853, 0x90be, 0x0112, 0x0904, 0x4853, 0x90be,
-	0x0113, 0x0904, 0x4853, 0x90be, 0x0114, 0x0904, 0x4853, 0x90be,
-	0x0117, 0x0904, 0x4853, 0x90be, 0x011a, 0x0904, 0x4853, 0x90be,
-	0x011c, 0x0904, 0x4853, 0x90be, 0x0121, 0x0904, 0x483a, 0x90be,
-	0x0131, 0x0904, 0x483a, 0x90be, 0x0171, 0x0904, 0x4853, 0x90be,
-	0x0173, 0x0904, 0x4853, 0x90be, 0x01a1, 0x1128, 0xa894, 0x8007,
-	0xa896, 0x0804, 0x485e, 0x90be, 0x0212, 0x0904, 0x4847, 0x90be,
-	0x0213, 0x05e8, 0x90be, 0x0214, 0x0500, 0x90be, 0x0217, 0x0188,
-	0x90be, 0x021a, 0x1120, 0xa89c, 0x8007, 0xa89e, 0x04e0, 0x90be,
-	0x021f, 0x05c8, 0x90be, 0x0300, 0x05b0, 0x009e, 0x00de, 0x0804,
-	0x35a8, 0x7028, 0x9080, 0x0010, 0x2098, 0x20a0, 0x7034, 0x20e0,
-	0x20e8, 0x20a9, 0x0007, 0x080c, 0x489c, 0x7028, 0x9080, 0x000e,
-	0x2098, 0x20a0, 0x7034, 0x20e0, 0x20e8, 0x20a9, 0x0001, 0x080c,
-	0x489c, 0x00c8, 0x7028, 0x9080, 0x000c, 0x2098, 0x20a0, 0x7034,
-	0x20e0, 0x20e8, 0x20a9, 0x0001, 0x080c, 0x48a9, 0x00b8, 0x7028,
-	0x9080, 0x000e, 0x2098, 0x20a0, 0x7034, 0x20e0, 0x20e8, 0x20a9,
-	0x0001, 0x080c, 0x48a9, 0x7028, 0x9080, 0x000c, 0x2098, 0x20a0,
-	0x7034, 0x20e0, 0x20e8, 0x20a9, 0x0001, 0x04f1, 0x00c6, 0x080c,
-	0x4aa7, 0x0550, 0xa868, 0xc0fd, 0xa86a, 0xa867, 0x0119, 0x9006,
-	0xa882, 0xa87f, 0x0020, 0xa88b, 0x0001, 0x810b, 0xa9ae, 0xa8b2,
-	0xaab6, 0xabba, 0xacbe, 0xadc2, 0xa9c6, 0xa8ca, 0x00ce, 0x009e,
-	0x00de, 0xa866, 0xa822, 0xa868, 0xc0fd, 0xa86a, 0xa804, 0x2048,
-	0x080c, 0xc9c8, 0x1120, 0x2009, 0x0003, 0x0804, 0x35a5, 0x7007,
-	0x0003, 0x701f, 0x4893, 0x0005, 0x00ce, 0x009e, 0x00de, 0x2009,
-	0x0002, 0x0804, 0x35a5, 0xa820, 0x9086, 0x8001, 0x1904, 0x3573,
-	0x2009, 0x0004, 0x0804, 0x35a5, 0x0016, 0x0026, 0x3510, 0x20a9,
-	0x0002, 0x4002, 0x4104, 0x4004, 0x8211, 0x1dc8, 0x002e, 0x001e,
-	0x0005, 0x0016, 0x0026, 0x0036, 0x0046, 0x3520, 0x20a9, 0x0004,
-	0x4002, 0x4304, 0x4204, 0x4104, 0x4004, 0x8421, 0x1db8, 0x004e,
-	0x003e, 0x002e, 0x001e, 0x0005, 0x81ff, 0x0120, 0x2009, 0x0001,
-	0x0804, 0x35a5, 0x60dc, 0xd0ac, 0x1130, 0xd09c, 0x1120, 0x2009,
-	0x0005, 0x0804, 0x35a5, 0x7984, 0x78a8, 0x2040, 0x080c, 0xab57,
-	0x1120, 0x9182, 0x007f, 0x0a04, 0x35a8, 0x9186, 0x00ff, 0x0904,
-	0x35a8, 0x9182, 0x0800, 0x1a04, 0x35a8, 0x7a8c, 0x7b88, 0x607c,
-	0x9306, 0x1140, 0x6080, 0x924e, 0x0904, 0x35a8, 0x99cc, 0xff00,
-	0x0904, 0x35a8, 0x0126, 0x2091, 0x8000, 0x080c, 0x49ba, 0x0904,
-	0x493a, 0x0086, 0x90c6, 0x4000, 0x008e, 0x1538, 0x00c6, 0x0006,
-	0x0036, 0xb818, 0xbb1c, 0x9305, 0xbb20, 0x9305, 0xbb24, 0x9305,
-	0xbb28, 0x9305, 0xbb2c, 0x9305, 0xbb30, 0x9305, 0xbb34, 0x9305,
-	0x003e, 0x0570, 0xd88c, 0x1128, 0x080c, 0x6a6b, 0x0110, 0xc89d,
-	0x0438, 0x900e, 0x080c, 0x6914, 0x1108, 0xc185, 0xb800, 0xd0bc,
-	0x0108, 0xc18d, 0x000e, 0x00ce, 0x00b8, 0x90c6, 0x4007, 0x1110,
-	0x2408, 0x0090, 0x90c6, 0x4008, 0x1118, 0x2708, 0x2610, 0x0060,
-	0x90c6, 0x4009, 0x1108, 0x0040, 0x90c6, 0x4006, 0x1108, 0x0020,
-	0x2001, 0x4005, 0x2009, 0x000a, 0x2020, 0x012e, 0x0804, 0x3575,
-	0x000e, 0x00ce, 0x2b00, 0x7026, 0x0016, 0x00b6, 0x00c6, 0x00e6,
-	0x2c70, 0x080c, 0xac5f, 0x0904, 0x498f, 0x2b00, 0x6012, 0x080c,
-	0xcccc, 0x2e58, 0x00ee, 0x00e6, 0x00c6, 0x080c, 0x4aa7, 0x00ce,
-	0x2b70, 0x1158, 0x080c, 0xabed, 0x00ee, 0x00ce, 0x00be, 0x001e,
-	0x012e, 0x2009, 0x0002, 0x0804, 0x35a5, 0x900e, 0xa966, 0xa96a,
-	0x2900, 0x6016, 0xa932, 0xa868, 0xc0fd, 0xd88c, 0x0108, 0xc0f5,
-	0xa86a, 0xd89c, 0x1110, 0x080c, 0x31e7, 0x6023, 0x0001, 0x9006,
-	0x080c, 0x6561, 0xd89c, 0x0138, 0x2001, 0x0004, 0x080c, 0x6575,
-	0x2009, 0x0003, 0x0030, 0x2001, 0x0002, 0x080c, 0x6575, 0x2009,
-	0x0002, 0x080c, 0xac8c, 0x78a8, 0xd094, 0x0138, 0x00ee, 0x7024,
-	0x00e6, 0x2058, 0xb8d4, 0xc08d, 0xb8d6, 0x9085, 0x0001, 0x00ee,
-	0x00ce, 0x00be, 0x001e, 0x012e, 0x1120, 0x2009, 0x0003, 0x0804,
-	0x35a5, 0x7007, 0x0003, 0x701f, 0x499e, 0x0005, 0xa830, 0x9086,
-	0x0100, 0x7024, 0x2058, 0x1138, 0x2009, 0x0004, 0xba04, 0x9294,
-	0x00ff, 0x0804, 0x5637, 0x900e, 0xa868, 0xd0f4, 0x1904, 0x3573,
-	0x080c, 0x6914, 0x1108, 0xc185, 0xb800, 0xd0bc, 0x0108, 0xc18d,
-	0x0804, 0x3573, 0x00e6, 0x00d6, 0x0096, 0x83ff, 0x0904, 0x4a09,
-	0x902e, 0x080c, 0xab57, 0x0130, 0x9026, 0x20a9, 0x0800, 0x2071,
-	0x1000, 0x0030, 0x2021, 0x007f, 0x20a9, 0x0781, 0x2071, 0x107f,
-	0x2e04, 0x9005, 0x11b8, 0x2100, 0x9406, 0x1904, 0x4a1a, 0x2428,
-	0x94ce, 0x007f, 0x1120, 0x92ce, 0xfffd, 0x1558, 0x0030, 0x94ce,
-	0x0080, 0x1130, 0x92ce, 0xfffc, 0x1520, 0x93ce, 0x00ff, 0x1508,
-	0xc5fd, 0x0480, 0x2058, 0xbf10, 0x2700, 0x9306, 0x11e8, 0xbe14,
-	0x2600, 0x9206, 0x11c8, 0x2400, 0x9106, 0x1180, 0xd884, 0x0598,
-	0xd894, 0x1588, 0x080c, 0x6a0b, 0x1570, 0x2001, 0x4000, 0x0460,
-	0x080c, 0x6a6b, 0x1540, 0x2001, 0x4000, 0x0430, 0x2001, 0x4007,
-	0x0418, 0x2001, 0x4006, 0x0400, 0x2400, 0x9106, 0x1158, 0xbe14,
-	0x87ff, 0x1128, 0x86ff, 0x0918, 0x080c, 0xab57, 0x1900, 0x2001,
-	0x4008, 0x0090, 0x8420, 0x8e70, 0x1f04, 0x49d0, 0x85ff, 0x1130,
-	0x2001, 0x4009, 0x0048, 0x2001, 0x0001, 0x0030, 0x080c, 0x65c4,
-	0x1dd0, 0xbb12, 0xba16, 0x9006, 0x9005, 0x009e, 0x00de, 0x00ee,
-	0x0005, 0x81ff, 0x0120, 0x2009, 0x0001, 0x0804, 0x35a5, 0x080c,
-	0x4aa7, 0x1120, 0x2009, 0x0002, 0x0804, 0x35a5, 0xa867, 0x0000,
-	0xa868, 0xc0fd, 0xa86a, 0x7884, 0x9005, 0x0904, 0x35a8, 0x9096,
-	0x00ff, 0x0120, 0x9092, 0x0004, 0x1a04, 0x35a8, 0x2010, 0x2918,
-	0x080c, 0x3181, 0x1120, 0x2009, 0x0003, 0x0804, 0x35a5, 0x7007,
-	0x0003, 0x701f, 0x4a5c, 0x0005, 0xa830, 0x9086, 0x0100, 0x1904,
-	0x3573, 0x2009, 0x0004, 0x0804, 0x35a5, 0x7984, 0x080c, 0xab57,
-	0x1120, 0x9182, 0x007f, 0x0a04, 0x35a8, 0x9186, 0x00ff, 0x0904,
-	0x35a8, 0x9182, 0x0800, 0x1a04, 0x35a8, 0x2001, 0x9000, 0x080c,
-	0x5692, 0x1904, 0x35a5, 0x0804, 0x3573, 0xa998, 0x080c, 0xab57,
-	0x1118, 0x9182, 0x007f, 0x0280, 0x9186, 0x00ff, 0x0168, 0x9182,
-	0x0800, 0x1250, 0x2001, 0x9000, 0x080c, 0x5692, 0x11a8, 0x0060,
-	0xa897, 0x4005, 0xa99a, 0x0010, 0xa897, 0x4006, 0x900e, 0x9085,
-	0x0001, 0x2001, 0x0030, 0x0005, 0xa897, 0x4000, 0x900e, 0x9085,
-	0x0001, 0x2001, 0x0000, 0x0005, 0x2009, 0x000a, 0x0c48, 0x080c,
-	0x103a, 0x0198, 0x9006, 0xa802, 0x7014, 0x9005, 0x1120, 0x2900,
-	0x7016, 0x701a, 0x0040, 0x7018, 0xa802, 0x0086, 0x2040, 0x2900,
-	0xa006, 0x701a, 0x008e, 0x9085, 0x0001, 0x0005, 0x7984, 0x080c,
-	0x6625, 0x1130, 0x7e88, 0x9684, 0x3fff, 0x9082, 0x4000, 0x0208,
-	0x905e, 0x8bff, 0x0005, 0xa998, 0x080c, 0x6625, 0x1130, 0xae9c,
-	0x9684, 0x3fff, 0x9082, 0x4000, 0x0208, 0x905e, 0x8bff, 0x0005,
-	0xae98, 0x0008, 0x7e84, 0x2608, 0x080c, 0x6625, 0x1108, 0x0008,
-	0x905e, 0x8bff, 0x0005, 0x0016, 0x7114, 0x81ff, 0x0128, 0x2148,
-	0xa904, 0x080c, 0x106c, 0x0cc8, 0x7116, 0x711a, 0x001e, 0x0005,
-	0x2031, 0x0001, 0x0010, 0x2031, 0x0000, 0x2061, 0x18b8, 0x2c44,
-	0xa66a, 0xa17a, 0xa772, 0xa076, 0xa28e, 0xa392, 0xa496, 0xa59a,
-	0x080c, 0x1124, 0x7007, 0x0002, 0x701f, 0x3573, 0x0005, 0x00f6,
-	0x0126, 0x2091, 0x8000, 0x2079, 0x0000, 0x2001, 0x18b0, 0x2004,
-	0x9005, 0x1190, 0x0e04, 0x4b24, 0x7a36, 0x7833, 0x0012, 0x7a82,
-	0x7b86, 0x7c8a, 0x2091, 0x4080, 0x2001, 0x0089, 0x2004, 0xd084,
-	0x190c, 0x11d6, 0x0804, 0x4b8a, 0x0016, 0x0086, 0x0096, 0x00c6,
-	0x00e6, 0x2071, 0x189e, 0x7044, 0x9005, 0x1540, 0x7148, 0x9182,
-	0x0010, 0x0288, 0x7038, 0x2060, 0x080c, 0x103a, 0x0904, 0x4b82,
-	0xa84b, 0x0000, 0x2900, 0x7046, 0x2001, 0x0002, 0x9080, 0x1e55,
-	0x2005, 0xa846, 0x0098, 0x7038, 0x90e0, 0x0004, 0x2001, 0x18ba,
-	0x9c82, 0x18fa, 0x0210, 0x2061, 0x18ba, 0x2c00, 0x703a, 0x7148,
-	0x81ff, 0x1108, 0x703e, 0x8108, 0x714a, 0x0460, 0x7148, 0x8108,
-	0x714a, 0x7044, 0x2040, 0xa144, 0x2105, 0x0016, 0x908a, 0x0036,
-	0x1a0c, 0x0d7d, 0x2060, 0x001e, 0x8108, 0x2105, 0x9005, 0xa146,
-	0x1520, 0x080c, 0x103a, 0x1130, 0x8109, 0xa946, 0x7148, 0x8109,
-	0x714a, 0x00d8, 0x9006, 0xa806, 0xa84a, 0xa046, 0x2800, 0xa802,
-	0x2900, 0xa006, 0x7046, 0x2001, 0x0002, 0x9080, 0x1e55, 0x2005,
-	0xa846, 0x0058, 0x2262, 0x6306, 0x640a, 0x00ee, 0x00ce, 0x009e,
-	0x008e, 0x001e, 0x012e, 0x00fe, 0x0005, 0x2c00, 0x9082, 0x001b,
-	0x0002, 0x4bac, 0x4bac, 0x4bae, 0x4bac, 0x4bac, 0x4bac, 0x4bb2,
-	0x4bac, 0x4bac, 0x4bac, 0x4bb6, 0x4bac, 0x4bac, 0x4bac, 0x4bba,
-	0x4bac, 0x4bac, 0x4bac, 0x4bbe, 0x4bac, 0x4bac, 0x4bac, 0x4bc2,
-	0x4bac, 0x4bac, 0x4bac, 0x4bc7, 0x080c, 0x0d7d, 0xa276, 0xa37a,
-	0xa47e, 0x0898, 0xa286, 0xa38a, 0xa48e, 0x0878, 0xa296, 0xa39a,
-	0xa49e, 0x0858, 0xa2a6, 0xa3aa, 0xa4ae, 0x0838, 0xa2b6, 0xa3ba,
-	0xa4be, 0x0818, 0xa2c6, 0xa3ca, 0xa4ce, 0x0804, 0x4b85, 0xa2d6,
-	0xa3da, 0xa4de, 0x0804, 0x4b85, 0x00e6, 0x2071, 0x189e, 0x7048,
-	0x9005, 0x0904, 0x4c5e, 0x0126, 0x2091, 0x8000, 0x0e04, 0x4c5d,
-	0x00f6, 0x2079, 0x0000, 0x00c6, 0x0096, 0x0086, 0x0076, 0x9006,
-	0x2038, 0x7040, 0x2048, 0x9005, 0x0500, 0xa948, 0x2105, 0x0016,
+	0x900e, 0x9085, 0x0001, 0x2001, 0x0000, 0x0005, 0x2009, 0x000a,
+	0x0c48, 0x080c, 0x103a, 0x0198, 0x9006, 0xa802, 0x7014, 0x9005,
+	0x1120, 0x2900, 0x7016, 0x701a, 0x0040, 0x7018, 0xa802, 0x0086,
+	0x2040, 0x2900, 0xa006, 0x701a, 0x008e, 0x9085, 0x0001, 0x0005,
+	0x7984, 0x080c, 0x6620, 0x1130, 0x7e88, 0x9684, 0x3fff, 0x9082,
+	0x4000, 0x0208, 0x905e, 0x8bff, 0x0005, 0xa998, 0x080c, 0x6620,
+	0x1130, 0xae9c, 0x9684, 0x3fff, 0x9082, 0x4000, 0x0208, 0x905e,
+	0x8bff, 0x0005, 0xae98, 0x0008, 0x7e84, 0x2608, 0x080c, 0x6620,
+	0x1108, 0x0008, 0x905e, 0x8bff, 0x0005, 0x0016, 0x7114, 0x81ff,
+	0x0128, 0x2148, 0xa904, 0x080c, 0x106c, 0x0cc8, 0x7116, 0x711a,
+	0x001e, 0x0005, 0x2031, 0x0001, 0x0010, 0x2031, 0x0000, 0x2061,
+	0x18b8, 0x2c44, 0xa66a, 0xa17a, 0xa772, 0xa076, 0xa28e, 0xa392,
+	0xa496, 0xa59a, 0x080c, 0x112f, 0x7007, 0x0002, 0x701f, 0x3567,
+	0x0005, 0x00f6, 0x0126, 0x2091, 0x8000, 0x2079, 0x0000, 0x2001,
+	0x18b0, 0x2004, 0x9005, 0x1190, 0x0e04, 0x4b26, 0x7a36, 0x7833,
+	0x0012, 0x7a82, 0x7b86, 0x7c8a, 0x2091, 0x4080, 0x2001, 0x0089,
+	0x2004, 0xd084, 0x190c, 0x11e1, 0x0804, 0x4b8c, 0x0016, 0x0086,
+	0x0096, 0x00c6, 0x00e6, 0x2071, 0x189e, 0x7044, 0x9005, 0x1540,
+	0x7148, 0x9182, 0x0010, 0x0288, 0x7038, 0x2060, 0x080c, 0x103a,
+	0x0904, 0x4b84, 0xa84b, 0x0000, 0x2900, 0x7046, 0x2001, 0x0002,
+	0x9080, 0x1e62, 0x2005, 0xa846, 0x0098, 0x7038, 0x90e0, 0x0004,
+	0x2001, 0x18ba, 0x9c82, 0x18fa, 0x0210, 0x2061, 0x18ba, 0x2c00,
+	0x703a, 0x7148, 0x81ff, 0x1108, 0x703e, 0x8108, 0x714a, 0x0460,
+	0x7148, 0x8108, 0x714a, 0x7044, 0x2040, 0xa144, 0x2105, 0x0016,
 	0x908a, 0x0036, 0x1a0c, 0x0d7d, 0x2060, 0x001e, 0x8108, 0x2105,
-	0x9005, 0xa94a, 0x1904, 0x4c60, 0xa804, 0x9005, 0x090c, 0x0d7d,
-	0x7042, 0x2938, 0x2040, 0xa003, 0x0000, 0x2001, 0x0002, 0x9080,
-	0x1e55, 0x2005, 0xa04a, 0x0804, 0x4c60, 0x703c, 0x2060, 0x2c14,
-	0x6304, 0x6408, 0x650c, 0x2200, 0x7836, 0x7833, 0x0012, 0x7882,
-	0x2300, 0x7886, 0x2400, 0x788a, 0x2091, 0x4080, 0x2001, 0x0089,
-	0x2004, 0xd084, 0x190c, 0x11d6, 0x87ff, 0x0118, 0x2748, 0x080c,
-	0x106c, 0x7048, 0x8001, 0x704a, 0x9005, 0x1170, 0x7040, 0x2048,
-	0x9005, 0x0128, 0x080c, 0x106c, 0x9006, 0x7042, 0x7046, 0x703b,
-	0x18ba, 0x703f, 0x18ba, 0x0420, 0x7040, 0x9005, 0x1508, 0x7238,
-	0x2c00, 0x9206, 0x0148, 0x9c80, 0x0004, 0x90fa, 0x18fa, 0x0210,
-	0x2001, 0x18ba, 0x703e, 0x00a0, 0x9006, 0x703e, 0x703a, 0x7044,
-	0x9005, 0x090c, 0x0d7d, 0x2048, 0xa800, 0x9005, 0x1de0, 0x2900,
-	0x7042, 0x2001, 0x0002, 0x9080, 0x1e55, 0x2005, 0xa84a, 0x0000,
-	0x007e, 0x008e, 0x009e, 0x00ce, 0x00fe, 0x012e, 0x00ee, 0x0005,
-	0x2c00, 0x9082, 0x001b, 0x0002, 0x4c7f, 0x4c7f, 0x4c81, 0x4c7f,
-	0x4c7f, 0x4c7f, 0x4c86, 0x4c7f, 0x4c7f, 0x4c7f, 0x4c8b, 0x4c7f,
-	0x4c7f, 0x4c7f, 0x4c90, 0x4c7f, 0x4c7f, 0x4c7f, 0x4c95, 0x4c7f,
-	0x4c7f, 0x4c7f, 0x4c9a, 0x4c7f, 0x4c7f, 0x4c7f, 0x4c9f, 0x080c,
-	0x0d7d, 0xaa74, 0xab78, 0xac7c, 0x0804, 0x4c0b, 0xaa84, 0xab88,
-	0xac8c, 0x0804, 0x4c0b, 0xaa94, 0xab98, 0xac9c, 0x0804, 0x4c0b,
-	0xaaa4, 0xaba8, 0xacac, 0x0804, 0x4c0b, 0xaab4, 0xabb8, 0xacbc,
-	0x0804, 0x4c0b, 0xaac4, 0xabc8, 0xaccc, 0x0804, 0x4c0b, 0xaad4,
-	0xabd8, 0xacdc, 0x0804, 0x4c0b, 0x0016, 0x0026, 0x0036, 0x00b6,
-	0x00c6, 0x2009, 0x007e, 0x080c, 0x6625, 0x2019, 0x0001, 0xb85c,
-	0xd0ac, 0x0110, 0x2019, 0x0000, 0x2011, 0x801b, 0x080c, 0x4b07,
-	0x00ce, 0x00be, 0x003e, 0x002e, 0x001e, 0x0005, 0x0026, 0x080c,
-	0x56da, 0xd0c4, 0x0120, 0x2011, 0x8014, 0x080c, 0x4b07, 0x002e,
-	0x0005, 0x81ff, 0x1904, 0x35a5, 0x0126, 0x2091, 0x8000, 0x6030,
-	0xc08d, 0xc085, 0xc0ac, 0x6032, 0x080c, 0x74e9, 0x1158, 0x080c,
-	0x77ed, 0x080c, 0x6029, 0x9085, 0x0001, 0x080c, 0x7530, 0x080c,
-	0x741a, 0x0010, 0x080c, 0x5ee4, 0x012e, 0x0804, 0x3573, 0x81ff,
-	0x0120, 0x2009, 0x0001, 0x0804, 0x35a5, 0x080c, 0x56ee, 0x0120,
-	0x2009, 0x0007, 0x0804, 0x35a5, 0x080c, 0x6a63, 0x0120, 0x2009,
-	0x0008, 0x0804, 0x35a5, 0x080c, 0x3363, 0x0128, 0x7984, 0x080c,
-	0x65c4, 0x1904, 0x35a8, 0x080c, 0x4ada, 0x0904, 0x35a8, 0x2b00,
-	0x7026, 0x080c, 0x6a6b, 0x7888, 0x1170, 0x9084, 0x0005, 0x1158,
-	0x900e, 0x080c, 0x6914, 0x1108, 0xc185, 0xb800, 0xd0bc, 0x0108,
-	0xc18d, 0x0804, 0x3573, 0x080c, 0x4aa7, 0x0904, 0x35a5, 0x9006,
-	0xa866, 0xa832, 0xa868, 0xc0fd, 0xa86a, 0x080c, 0xca6a, 0x0904,
-	0x35a5, 0x7888, 0xd094, 0x0118, 0xb8d4, 0xc08d, 0xb8d6, 0x7007,
-	0x0003, 0x701f, 0x4d80, 0x0005, 0x2061, 0x1800, 0x080c, 0x56ee,
-	0x2009, 0x0007, 0x1578, 0x080c, 0x6a63, 0x0118, 0x2009, 0x0008,
-	0x0448, 0x080c, 0x3363, 0x0120, 0xa998, 0x080c, 0x65c4, 0x1530,
-	0x080c, 0x4ad8, 0x0518, 0x080c, 0x6a6b, 0xa89c, 0x1168, 0x9084,
-	0x0005, 0x1150, 0x900e, 0x080c, 0x6914, 0x1108, 0xc185, 0xb800,
-	0xd0bc, 0x0108, 0xc18d, 0x00d0, 0xa868, 0xc0fc, 0xa86a, 0x080c,
-	0xca6a, 0x11e0, 0xa89c, 0xd094, 0x0118, 0xb8d4, 0xc08d, 0xb8d6,
-	0x2009, 0x0003, 0xa897, 0x4005, 0xa99a, 0x0010, 0xa897, 0x4006,
-	0x900e, 0x9085, 0x0001, 0x2001, 0x0030, 0x0005, 0xa897, 0x4000,
-	0xa99a, 0x9006, 0x918d, 0x0001, 0x2008, 0x0005, 0x9006, 0x0005,
-	0xa830, 0x9086, 0x0100, 0x7024, 0x2058, 0x1110, 0x0804, 0x5637,
-	0x900e, 0x080c, 0x6914, 0x1108, 0xc185, 0xb800, 0xd0bc, 0x0108,
-	0xc18d, 0x0804, 0x3573, 0x080c, 0x56ee, 0x0120, 0x2009, 0x0007,
-	0x0804, 0x35a5, 0x7f84, 0x7a8c, 0x7b88, 0x7c9c, 0x7d98, 0x080c,
-	0x4aa7, 0x1120, 0x2009, 0x0002, 0x0804, 0x35a5, 0x900e, 0x2130,
-	0x7126, 0x7132, 0xa860, 0x20e8, 0x7036, 0xa85c, 0x9080, 0x0005,
-	0x702a, 0x20a0, 0x080c, 0x6625, 0x1904, 0x4e22, 0x080c, 0x6a6b,
-	0x0138, 0x080c, 0x6a73, 0x0120, 0x080c, 0x6a0b, 0x1904, 0x4e22,
-	0xd794, 0x1110, 0xd784, 0x01a8, 0xb8c4, 0x20e0, 0xb8c8, 0x9080,
-	0x0006, 0x2098, 0x3400, 0xd794, 0x0160, 0x20a9, 0x0008, 0x4003,
-	0x2098, 0x20a0, 0x3d00, 0x20e0, 0x20a9, 0x0002, 0x080c, 0x48a9,
-	0x0048, 0x20a9, 0x0004, 0x4003, 0x2098, 0x20a0, 0x3d00, 0x20e0,
-	0x080c, 0x48a9, 0x9186, 0x007e, 0x0170, 0x9186, 0x0080, 0x0158,
-	0x080c, 0x6a6b, 0x90c2, 0x0006, 0x1210, 0xc1fd, 0x0020, 0x080c,
-	0x6914, 0x1108, 0xc1fd, 0x4104, 0xc1fc, 0xd794, 0x0528, 0xb8c4,
-	0x20e0, 0xb8c8, 0x2060, 0x9c80, 0x0000, 0x2098, 0x20a9, 0x0002,
-	0x4003, 0x9c80, 0x0003, 0x2098, 0x20a9, 0x0001, 0x4005, 0x9c80,
-	0x0004, 0x2098, 0x3400, 0x20a9, 0x0002, 0x4003, 0x2098, 0x20a0,
-	0x3d00, 0x20e0, 0x080c, 0x489c, 0x9c80, 0x0026, 0x2098, 0xb8c4,
-	0x20e0, 0x20a9, 0x0002, 0x4003, 0xd794, 0x0110, 0x96b0, 0x000b,
-	0x96b0, 0x0005, 0x8108, 0x080c, 0xab57, 0x0118, 0x9186, 0x0800,
-	0x0040, 0xd78c, 0x0120, 0x9186, 0x0800, 0x0170, 0x0018, 0x9186,
-	0x007e, 0x0150, 0xd794, 0x0118, 0x9686, 0x0020, 0x0010, 0x9686,
-	0x0028, 0x0150, 0x0804, 0x4db2, 0x86ff, 0x1120, 0x7124, 0x810b,
-	0x0804, 0x3573, 0x7033, 0x0001, 0x7122, 0x7024, 0x9600, 0x7026,
-	0x772e, 0x2061, 0x18b8, 0x2c44, 0xa06b, 0x0000, 0xa67a, 0x7034,
-	0xa072, 0x7028, 0xa076, 0xa28e, 0xa392, 0xa496, 0xa59a, 0x080c,
-	0x1124, 0x7007, 0x0002, 0x701f, 0x4e5e, 0x0005, 0x7030, 0x9005,
-	0x1180, 0x7120, 0x7028, 0x20a0, 0x772c, 0x9036, 0x7034, 0x20e8,
-	0x2061, 0x18b8, 0x2c44, 0xa28c, 0xa390, 0xa494, 0xa598, 0x0804,
-	0x4db2, 0x7124, 0x810b, 0x0804, 0x3573, 0x2029, 0x007e, 0x7984,
-	0x7a88, 0x7b8c, 0x7c98, 0x9184, 0xff00, 0x8007, 0x90e2, 0x0020,
-	0x0a04, 0x35a8, 0x9502, 0x0a04, 0x35a8, 0x9184, 0x00ff, 0x90e2,
-	0x0020, 0x0a04, 0x35a8, 0x9502, 0x0a04, 0x35a8, 0x9284, 0xff00,
-	0x8007, 0x90e2, 0x0020, 0x0a04, 0x35a8, 0x9502, 0x0a04, 0x35a8,
-	0x9284, 0x00ff, 0x90e2, 0x0020, 0x0a04, 0x35a8, 0x9502, 0x0a04,
-	0x35a8, 0x9384, 0xff00, 0x8007, 0x90e2, 0x0020, 0x0a04, 0x35a8,
-	0x9502, 0x0a04, 0x35a8, 0x9384, 0x00ff, 0x90e2, 0x0020, 0x0a04,
-	0x35a8, 0x9502, 0x0a04, 0x35a8, 0x9484, 0xff00, 0x8007, 0x90e2,
-	0x0020, 0x0a04, 0x35a8, 0x9502, 0x0a04, 0x35a8, 0x9484, 0x00ff,
-	0x90e2, 0x0020, 0x0a04, 0x35a8, 0x9502, 0x0a04, 0x35a8, 0x2061,
-	0x1989, 0x6102, 0x6206, 0x630a, 0x640e, 0x0804, 0x3573, 0x080c,
-	0x4aa7, 0x0904, 0x35a5, 0x2009, 0x0016, 0x7a8c, 0x7b88, 0x7c9c,
-	0x7d98, 0xa85c, 0x9080, 0x0019, 0xaf60, 0x080c, 0x4af0, 0x701f,
-	0x4ee2, 0x0005, 0x2001, 0x0138, 0x2003, 0x0000, 0x00e6, 0x2071,
-	0x0300, 0x701c, 0xd0a4, 0x1de8, 0x00ee, 0x20a9, 0x0016, 0x896e,
-	0x8d6e, 0x8d6f, 0x9d84, 0xffc0, 0x9080, 0x0019, 0x2098, 0x9d84,
-	0x003f, 0x20e0, 0x2069, 0x1877, 0x20e9, 0x0001, 0x2da0, 0x4003,
-	0x6800, 0x9005, 0x0904, 0x4f63, 0x6804, 0x2008, 0x918c, 0xfff8,
-	0x1904, 0x4f63, 0x680c, 0x9005, 0x0904, 0x4f63, 0x9082, 0xff01,
-	0x1a04, 0x4f63, 0x6810, 0x9082, 0x005c, 0x0a04, 0x4f63, 0x6824,
-	0x2008, 0x9082, 0x0008, 0x0a04, 0x4f63, 0x9182, 0x0400, 0x1a04,
-	0x4f63, 0x0056, 0x2029, 0x0000, 0x080c, 0x8d0a, 0x005e, 0x6944,
-	0x6820, 0x9102, 0x06c0, 0x6820, 0x9082, 0x0019, 0x16a0, 0x6828,
-	0x6944, 0x810c, 0x9102, 0x0678, 0x6840, 0x9082, 0x000f, 0x1658,
-	0x080c, 0x1053, 0x2900, 0x0904, 0x4f7d, 0x684e, 0x00e6, 0x2071,
-	0x1930, 0x00b6, 0x2059, 0x0000, 0x080c, 0x8bc6, 0x00be, 0x00ee,
-	0x0558, 0x080c, 0x8920, 0x080c, 0x8966, 0x11e0, 0x6857, 0x0000,
-	0x00c6, 0x2061, 0x0100, 0x6104, 0x918d, 0x2000, 0x6106, 0x6b10,
-	0x2061, 0x1a6b, 0x630a, 0x00ce, 0x080c, 0x2713, 0x2001, 0x0138,
-	0x2102, 0x0804, 0x3573, 0x080c, 0x2713, 0x2001, 0x0138, 0x2102,
-	0x0804, 0x35a8, 0x00e6, 0x2071, 0x1930, 0x080c, 0x8d9b, 0x080c,
-	0x8daa, 0x080c, 0x8bb5, 0x00ee, 0x2001, 0x188a, 0x204c, 0x080c,
-	0x106c, 0x2001, 0x188a, 0x2003, 0x0000, 0x080c, 0x2713, 0x2001,
-	0x0138, 0x2102, 0x0804, 0x35a5, 0x2001, 0x1924, 0x200c, 0x918e,
-	0x0000, 0x0904, 0x4fdc, 0x080c, 0x8bb0, 0x0904, 0x4fdc, 0x2001,
-	0x0101, 0x200c, 0x918c, 0xdfff, 0x2102, 0x2001, 0x0138, 0x2003,
-	0x0000, 0x00e6, 0x2071, 0x0300, 0x701c, 0xd0a4, 0x1de8, 0x00ee,
-	0x080c, 0x8bb5, 0x2001, 0x0035, 0x080c, 0x1679, 0x00c6, 0x2061,
-	0x193c, 0x6004, 0x6100, 0x9106, 0x1de0, 0x00ce, 0x080c, 0x2713,
-	0x2001, 0x0138, 0x2102, 0x00e6, 0x00f6, 0x2071, 0x1923, 0x080c,
-	0x8af1, 0x0120, 0x2f00, 0x080c, 0x8b7b, 0x0cc8, 0x00fe, 0x00ee,
-	0x0126, 0x2091, 0x8000, 0x2001, 0x188a, 0x200c, 0x81ff, 0x0138,
-	0x2148, 0x080c, 0x106c, 0x2001, 0x188a, 0x2003, 0x0000, 0x2001,
-	0x183d, 0x2003, 0x0020, 0x00e6, 0x2071, 0x1930, 0x080c, 0x8d9b,
-	0x080c, 0x8daa, 0x00ee, 0x012e, 0x0804, 0x3573, 0x0006, 0x080c,
-	0x56da, 0xd0cc, 0x000e, 0x0005, 0x0006, 0x080c, 0x56de, 0xd0bc,
-	0x000e, 0x0005, 0x6174, 0x7a84, 0x6300, 0x82ff, 0x1118, 0x7986,
-	0x0804, 0x3573, 0x83ff, 0x1904, 0x35a8, 0x2001, 0xfff0, 0x9200,
-	0x1a04, 0x35a8, 0x2019, 0xffff, 0x6078, 0x9302, 0x9200, 0x0a04,
-	0x35a8, 0x7986, 0x6276, 0x0804, 0x3573, 0x080c, 0x56ee, 0x1904,
-	0x35a5, 0x7c88, 0x7d84, 0x7e98, 0x7f8c, 0x080c, 0x4aa7, 0x0904,
-	0x35a5, 0x900e, 0x901e, 0x7326, 0x7332, 0xa860, 0x20e8, 0x7036,
-	0xa85c, 0x9080, 0x0003, 0x702a, 0x20a0, 0x91d8, 0x1000, 0x2b5c,
-	0x8bff, 0x0178, 0x080c, 0x6a6b, 0x0118, 0x080c, 0x6a73, 0x1148,
-	0x20a9, 0x0001, 0xb814, 0x4004, 0xb810, 0x4004, 0x4104, 0x9398,
-	0x0003, 0x8108, 0x9182, 0x0800, 0x0120, 0x9386, 0x003c, 0x0170,
-	0x0c20, 0x83ff, 0x1148, 0x7224, 0x900e, 0x2001, 0x0003, 0x080c,
-	0x9166, 0x2208, 0x0804, 0x3573, 0x7033, 0x0001, 0x7122, 0x7024,
-	0x9300, 0x7026, 0x2061, 0x18b8, 0x2c44, 0xa06b, 0x0000, 0xa37a,
-	0x7028, 0xa076, 0x7034, 0xa072, 0xa48e, 0xa592, 0xa696, 0xa79a,
-	0x080c, 0x1124, 0x7007, 0x0002, 0x701f, 0x505f, 0x0005, 0x7030,
-	0x9005, 0x1178, 0x7120, 0x7028, 0x20a0, 0x901e, 0x7034, 0x20e8,
-	0x2061, 0x18b8, 0x2c44, 0xa48c, 0xa590, 0xa694, 0xa798, 0x0804,
-	0x501d, 0x7224, 0x900e, 0x2001, 0x0003, 0x080c, 0x9166, 0x2208,
-	0x0804, 0x3573, 0x00f6, 0x00e6, 0x080c, 0x56ee, 0x2009, 0x0007,
-	0x1904, 0x50f2, 0x2071, 0x189e, 0x745c, 0x84ff, 0x2009, 0x000e,
-	0x1904, 0x50f2, 0xac9c, 0xad98, 0xaea4, 0xafa0, 0x0096, 0x080c,
-	0x1053, 0x2009, 0x0002, 0x0904, 0x50f2, 0x2900, 0x705e, 0x900e,
-	0x901e, 0x7356, 0x7362, 0xa860, 0x7066, 0xa85c, 0x9080, 0x0003,
-	0x705a, 0x20a0, 0x91d8, 0x1000, 0x2b5c, 0x8bff, 0x0178, 0x080c,
-	0x6a6b, 0x0118, 0x080c, 0x6a73, 0x1148, 0xb814, 0x20a9, 0x0001,
-	0x4004, 0xb810, 0x4004, 0x4104, 0x9398, 0x0003, 0x8108, 0x9182,
-	0x0800, 0x0120, 0x9386, 0x003c, 0x01e8, 0x0c20, 0x83ff, 0x11c0,
-	0x7254, 0x900e, 0x2001, 0x0003, 0x080c, 0x9166, 0x2208, 0x009e,
-	0xa897, 0x4000, 0xa99a, 0x715c, 0x81ff, 0x090c, 0x0d7d, 0x2148,
-	0x080c, 0x106c, 0x9006, 0x705e, 0x918d, 0x0001, 0x2008, 0x0418,
-	0x7063, 0x0001, 0x7152, 0x7054, 0x9300, 0x7056, 0x2061, 0x18b9,
-	0x2c44, 0xa37a, 0x7058, 0xa076, 0x7064, 0xa072, 0xa48e, 0xa592,
-	0xa696, 0xa79a, 0xa09f, 0x50fe, 0x000e, 0xa0a2, 0x080c, 0x1124,
-	0x9006, 0x0048, 0x009e, 0xa897, 0x4005, 0xa99a, 0x900e, 0x9085,
-	0x0001, 0x2001, 0x0030, 0x00ee, 0x00fe, 0x0005, 0x00f6, 0xa0a0,
-	0x904d, 0x090c, 0x0d7d, 0x00e6, 0x2071, 0x189e, 0xa06c, 0x908e,
-	0x0100, 0x0138, 0xa87b, 0x0030, 0xa883, 0x0000, 0xa897, 0x4002,
-	0x00d8, 0x7060, 0x9005, 0x1158, 0x7150, 0x7058, 0x20a0, 0x901e,
-	0x7064, 0x20e8, 0xa48c, 0xa590, 0xa694, 0xa798, 0x0428, 0xa87b,
-	0x0000, 0xa883, 0x0000, 0xa897, 0x4000, 0x7254, 0x900e, 0x2001,
-	0x0003, 0x080c, 0x9166, 0xaa9a, 0x715c, 0x81ff, 0x090c, 0x0d7d,
-	0x2148, 0x080c, 0x106c, 0x705f, 0x0000, 0xa0a0, 0x2048, 0x0126,
-	0x2091, 0x8000, 0x080c, 0x6d80, 0x012e, 0xa09f, 0x0000, 0xa0a3,
-	0x0000, 0x00ee, 0x00fe, 0x0005, 0x91d8, 0x1000, 0x2b5c, 0x8bff,
-	0x0178, 0x080c, 0x6a6b, 0x0118, 0x080c, 0x6a73, 0x1148, 0xb814,
-	0x20a9, 0x0001, 0x4004, 0xb810, 0x4004, 0x4104, 0x9398, 0x0003,
-	0x8108, 0x9182, 0x0800, 0x0120, 0x9386, 0x003c, 0x0518, 0x0c20,
-	0x83ff, 0x11f0, 0x7154, 0x810c, 0xa99a, 0xa897, 0x4000, 0x715c,
-	0x81ff, 0x090c, 0x0d7d, 0x2148, 0x080c, 0x106c, 0x9006, 0x705e,
-	0x918d, 0x0001, 0x2008, 0xa0a0, 0x2048, 0x0126, 0x2091, 0x8000,
-	0x080c, 0x6d80, 0x012e, 0xa09f, 0x0000, 0xa0a3, 0x0000, 0x0070,
-	0x7063, 0x0001, 0x7152, 0x7054, 0x9300, 0x7056, 0xa37a, 0xa48e,
-	0xa592, 0xa696, 0xa79a, 0x080c, 0x1124, 0x9006, 0x00ee, 0x0005,
-	0x0096, 0xa88c, 0x90be, 0x7000, 0x0148, 0x90be, 0x7100, 0x0130,
-	0x90be, 0x7200, 0x0118, 0x009e, 0x0804, 0x35a8, 0xa884, 0xa988,
-	0x080c, 0x25fb, 0x1518, 0x080c, 0x65c4, 0x1500, 0x7126, 0xbe12,
-	0xbd16, 0xae7c, 0x080c, 0x4aa7, 0x01c8, 0x080c, 0x4aa7, 0x01b0,
-	0x009e, 0xa867, 0x0000, 0xa868, 0xc0fd, 0xa86a, 0xa823, 0x0000,
-	0xa804, 0x2048, 0x080c, 0xc9e8, 0x1120, 0x2009, 0x0003, 0x0804,
-	0x35a5, 0x7007, 0x0003, 0x701f, 0x51cb, 0x0005, 0x009e, 0x2009,
-	0x0002, 0x0804, 0x35a5, 0x7124, 0x080c, 0x32fc, 0xa820, 0x9086,
-	0x8001, 0x1120, 0x2009, 0x0004, 0x0804, 0x35a5, 0x2900, 0x7022,
-	0xa804, 0x0096, 0x2048, 0x8906, 0x8006, 0x8007, 0x90bc, 0x003f,
-	0x9084, 0xffc0, 0x009e, 0x9080, 0x0002, 0x0076, 0x0006, 0x2098,
-	0x20a0, 0x27e0, 0x27e8, 0x20a9, 0x002a, 0x080c, 0x0fb7, 0xaa6c,
-	0xab70, 0xac74, 0xad78, 0x2061, 0x18b8, 0x2c44, 0xa06b, 0x0000,
-	0xae64, 0xaf8c, 0x97c6, 0x7000, 0x0118, 0x97c6, 0x7100, 0x1148,
-	0x96c2, 0x0004, 0x0600, 0x2009, 0x0004, 0x000e, 0x007e, 0x0804,
-	0x4af3, 0x97c6, 0x7200, 0x11b8, 0x96c2, 0x0054, 0x02a0, 0x000e,
-	0x007e, 0x2061, 0x18b8, 0x2c44, 0xa076, 0xa772, 0xa07b, 0x002a,
-	0xa28e, 0xa392, 0xa496, 0xa59a, 0x080c, 0x1124, 0x7007, 0x0002,
-	0x701f, 0x5227, 0x0005, 0x000e, 0x007e, 0x0804, 0x35a8, 0x7020,
-	0x2048, 0xa804, 0x2048, 0xa804, 0x2048, 0x8906, 0x8006, 0x8007,
-	0x90bc, 0x003f, 0x9084, 0xffc0, 0x9080, 0x0002, 0x2098, 0x20a0,
-	0x27e0, 0x27e8, 0x20a9, 0x002a, 0x080c, 0x0fb7, 0x2100, 0x2238,
-	0x2061, 0x18b8, 0x2c44, 0xa28c, 0xa390, 0xa494, 0xa598, 0x2009,
-	0x002a, 0x0804, 0x4af3, 0x81ff, 0x1904, 0x35a5, 0x798c, 0x2001,
-	0x197e, 0x918c, 0x8000, 0x2102, 0x080c, 0x4abe, 0x0904, 0x35a8,
-	0x080c, 0x6a6b, 0x0120, 0x080c, 0x6a73, 0x1904, 0x35a8, 0x080c,
-	0x66ec, 0x0904, 0x35a5, 0x0126, 0x2091, 0x8000, 0x080c, 0x6881,
-	0x012e, 0x0904, 0x35a5, 0x2001, 0x197e, 0x2004, 0xd0fc, 0x1904,
-	0x3573, 0x0804, 0x4548, 0xa9a0, 0x2001, 0x197e, 0x918c, 0x8000,
-	0xc18d, 0x2102, 0x080c, 0x4acb, 0x01a0, 0x080c, 0x6a6b, 0x0118,
-	0x080c, 0x6a73, 0x1170, 0x080c, 0x66ec, 0x2009, 0x0002, 0x0128,
-	0x080c, 0x6881, 0x1170, 0x2009, 0x0003, 0xa897, 0x4005, 0xa99a,
+	0x9005, 0xa146, 0x1520, 0x080c, 0x103a, 0x1130, 0x8109, 0xa946,
+	0x7148, 0x8109, 0x714a, 0x00d8, 0x9006, 0xa806, 0xa84a, 0xa046,
+	0x2800, 0xa802, 0x2900, 0xa006, 0x7046, 0x2001, 0x0002, 0x9080,
+	0x1e62, 0x2005, 0xa846, 0x0058, 0x2262, 0x6306, 0x640a, 0x00ee,
+	0x00ce, 0x009e, 0x008e, 0x001e, 0x012e, 0x00fe, 0x0005, 0x2c00,
+	0x9082, 0x001b, 0x0002, 0x4bae, 0x4bae, 0x4bb0, 0x4bae, 0x4bae,
+	0x4bae, 0x4bb4, 0x4bae, 0x4bae, 0x4bae, 0x4bb8, 0x4bae, 0x4bae,
+	0x4bae, 0x4bbc, 0x4bae, 0x4bae, 0x4bae, 0x4bc0, 0x4bae, 0x4bae,
+	0x4bae, 0x4bc4, 0x4bae, 0x4bae, 0x4bae, 0x4bc9, 0x080c, 0x0d7d,
+	0xa276, 0xa37a, 0xa47e, 0x0898, 0xa286, 0xa38a, 0xa48e, 0x0878,
+	0xa296, 0xa39a, 0xa49e, 0x0858, 0xa2a6, 0xa3aa, 0xa4ae, 0x0838,
+	0xa2b6, 0xa3ba, 0xa4be, 0x0818, 0xa2c6, 0xa3ca, 0xa4ce, 0x0804,
+	0x4b87, 0xa2d6, 0xa3da, 0xa4de, 0x0804, 0x4b87, 0x00e6, 0x2071,
+	0x189e, 0x7048, 0x9005, 0x0904, 0x4c60, 0x0126, 0x2091, 0x8000,
+	0x0e04, 0x4c5f, 0x00f6, 0x2079, 0x0000, 0x00c6, 0x0096, 0x0086,
+	0x0076, 0x9006, 0x2038, 0x7040, 0x2048, 0x9005, 0x0500, 0xa948,
+	0x2105, 0x0016, 0x908a, 0x0036, 0x1a0c, 0x0d7d, 0x2060, 0x001e,
+	0x8108, 0x2105, 0x9005, 0xa94a, 0x1904, 0x4c62, 0xa804, 0x9005,
+	0x090c, 0x0d7d, 0x7042, 0x2938, 0x2040, 0xa003, 0x0000, 0x2001,
+	0x0002, 0x9080, 0x1e62, 0x2005, 0xa04a, 0x0804, 0x4c62, 0x703c,
+	0x2060, 0x2c14, 0x6304, 0x6408, 0x650c, 0x2200, 0x7836, 0x7833,
+	0x0012, 0x7882, 0x2300, 0x7886, 0x2400, 0x788a, 0x2091, 0x4080,
+	0x2001, 0x0089, 0x2004, 0xd084, 0x190c, 0x11e1, 0x87ff, 0x0118,
+	0x2748, 0x080c, 0x106c, 0x7048, 0x8001, 0x704a, 0x9005, 0x1170,
+	0x7040, 0x2048, 0x9005, 0x0128, 0x080c, 0x106c, 0x9006, 0x7042,
+	0x7046, 0x703b, 0x18ba, 0x703f, 0x18ba, 0x0420, 0x7040, 0x9005,
+	0x1508, 0x7238, 0x2c00, 0x9206, 0x0148, 0x9c80, 0x0004, 0x90fa,
+	0x18fa, 0x0210, 0x2001, 0x18ba, 0x703e, 0x00a0, 0x9006, 0x703e,
+	0x703a, 0x7044, 0x9005, 0x090c, 0x0d7d, 0x2048, 0xa800, 0x9005,
+	0x1de0, 0x2900, 0x7042, 0x2001, 0x0002, 0x9080, 0x1e62, 0x2005,
+	0xa84a, 0x0000, 0x007e, 0x008e, 0x009e, 0x00ce, 0x00fe, 0x012e,
+	0x00ee, 0x0005, 0x2c00, 0x9082, 0x001b, 0x0002, 0x4c81, 0x4c81,
+	0x4c83, 0x4c81, 0x4c81, 0x4c81, 0x4c88, 0x4c81, 0x4c81, 0x4c81,
+	0x4c8d, 0x4c81, 0x4c81, 0x4c81, 0x4c92, 0x4c81, 0x4c81, 0x4c81,
+	0x4c97, 0x4c81, 0x4c81, 0x4c81, 0x4c9c, 0x4c81, 0x4c81, 0x4c81,
+	0x4ca1, 0x080c, 0x0d7d, 0xaa74, 0xab78, 0xac7c, 0x0804, 0x4c0d,
+	0xaa84, 0xab88, 0xac8c, 0x0804, 0x4c0d, 0xaa94, 0xab98, 0xac9c,
+	0x0804, 0x4c0d, 0xaaa4, 0xaba8, 0xacac, 0x0804, 0x4c0d, 0xaab4,
+	0xabb8, 0xacbc, 0x0804, 0x4c0d, 0xaac4, 0xabc8, 0xaccc, 0x0804,
+	0x4c0d, 0xaad4, 0xabd8, 0xacdc, 0x0804, 0x4c0d, 0x0016, 0x0026,
+	0x0036, 0x00b6, 0x00c6, 0x2009, 0x007e, 0x080c, 0x6620, 0x2019,
+	0x0001, 0xb85c, 0xd0ac, 0x0110, 0x2019, 0x0000, 0x2011, 0x801b,
+	0x080c, 0x4b09, 0x00ce, 0x00be, 0x003e, 0x002e, 0x001e, 0x0005,
+	0x0026, 0x080c, 0x56d5, 0xd0c4, 0x0120, 0x2011, 0x8014, 0x080c,
+	0x4b09, 0x002e, 0x0005, 0x81ff, 0x1904, 0x3599, 0x0126, 0x2091,
+	0x8000, 0x6030, 0xc08d, 0xc085, 0xc0ac, 0x6032, 0x080c, 0x74c8,
+	0x1158, 0x080c, 0x77cc, 0x080c, 0x6024, 0x9085, 0x0001, 0x080c,
+	0x750f, 0x080c, 0x73f9, 0x0010, 0x080c, 0x5edf, 0x012e, 0x0804,
+	0x3567, 0x81ff, 0x0120, 0x2009, 0x0001, 0x0804, 0x3599, 0x080c,
+	0x56e9, 0x0120, 0x2009, 0x0007, 0x0804, 0x3599, 0x080c, 0x6a62,
+	0x0120, 0x2009, 0x0008, 0x0804, 0x3599, 0x7984, 0x080c, 0x65bf,
+	0x1904, 0x359c, 0x2b00, 0x7026, 0x080c, 0x6a6a, 0x7888, 0x1170,
+	0x9084, 0x0005, 0x1158, 0x900e, 0x080c, 0x6913, 0x1108, 0xc185,
+	0xb800, 0xd0bc, 0x0108, 0xc18d, 0x0804, 0x3567, 0x080c, 0x4aa9,
+	0x0904, 0x3599, 0x9006, 0xa866, 0xa832, 0xa868, 0xc0fd, 0xa86a,
+	0x080c, 0xca69, 0x0904, 0x3599, 0x7888, 0xd094, 0x0118, 0xb8d4,
+	0xc08d, 0xb8d6, 0x7007, 0x0003, 0x701f, 0x4d7b, 0x0005, 0x2061,
+	0x1800, 0x080c, 0x56e9, 0x2009, 0x0007, 0x1578, 0x080c, 0x6a62,
+	0x0118, 0x2009, 0x0008, 0x0448, 0x080c, 0x3357, 0x0120, 0xa998,
+	0x080c, 0x65bf, 0x1530, 0x080c, 0x4ada, 0x0518, 0x080c, 0x6a6a,
+	0xa89c, 0x1168, 0x9084, 0x0005, 0x1150, 0x900e, 0x080c, 0x6913,
+	0x1108, 0xc185, 0xb800, 0xd0bc, 0x0108, 0xc18d, 0x00d0, 0xa868,
+	0xc0fc, 0xa86a, 0x080c, 0xca69, 0x11e0, 0xa89c, 0xd094, 0x0118,
+	0xb8d4, 0xc08d, 0xb8d6, 0x2009, 0x0003, 0xa897, 0x4005, 0xa99a,
 	0x0010, 0xa897, 0x4006, 0x900e, 0x9085, 0x0001, 0x2001, 0x0030,
-	0x0005, 0xa897, 0x4000, 0x2001, 0x197e, 0x2004, 0xd0fc, 0x1128,
-	0x080c, 0x56e2, 0x0110, 0x9006, 0x0018, 0x900e, 0x9085, 0x0001,
-	0x2001, 0x0000, 0x0005, 0x78a8, 0xd08c, 0x1118, 0xd084, 0x0904,
-	0x44bd, 0x080c, 0x4ada, 0x0904, 0x35a8, 0x080c, 0x4aa7, 0x1120,
-	0x2009, 0x0002, 0x0804, 0x35a5, 0x080c, 0x6a6b, 0x0130, 0x908e,
-	0x0004, 0x0118, 0x908e, 0x0005, 0x15a0, 0x78a8, 0xd08c, 0x0120,
-	0xb800, 0xc08c, 0xb802, 0x0028, 0x080c, 0x56da, 0xd0b4, 0x0904,
-	0x44f7, 0x7884, 0x908e, 0x007e, 0x0904, 0x44f7, 0x908e, 0x007f,
-	0x0904, 0x44f7, 0x908e, 0x0080, 0x0904, 0x44f7, 0xb800, 0xd08c,
-	0x1904, 0x44f7, 0xa867, 0x0000, 0xa868, 0xc0fd, 0xa86a, 0x080c,
-	0xca07, 0x1120, 0x2009, 0x0003, 0x0804, 0x35a5, 0x7007, 0x0003,
-	0x701f, 0x52f3, 0x0005, 0x080c, 0x4ada, 0x0904, 0x35a8, 0x0804,
-	0x44f7, 0x080c, 0x3363, 0x0108, 0x0005, 0x2009, 0x1834, 0x210c,
-	0x81ff, 0x0120, 0x2009, 0x0001, 0x0804, 0x35a5, 0x080c, 0x56ee,
-	0x0120, 0x2009, 0x0007, 0x0804, 0x35a5, 0x080c, 0x6a63, 0x0120,
-	0x2009, 0x0008, 0x0804, 0x35a5, 0xb89c, 0xd0a4, 0x1118, 0xd0ac,
-	0x1904, 0x44f7, 0x9006, 0xa866, 0xa832, 0xa868, 0xc0fd, 0xa86a,
-	0x080c, 0xca6a, 0x1120, 0x2009, 0x0003, 0x0804, 0x35a5, 0x7007,
-	0x0003, 0x701f, 0x532c, 0x0005, 0xa830, 0x9086, 0x0100, 0x1120,
-	0x2009, 0x0004, 0x0804, 0x5637, 0x080c, 0x4ada, 0x0904, 0x35a8,
-	0x0804, 0x52c5, 0x81ff, 0x2009, 0x0001, 0x1904, 0x35a5, 0x080c,
-	0x56ee, 0x2009, 0x0007, 0x1904, 0x35a5, 0x080c, 0x6a63, 0x0120,
-	0x2009, 0x0008, 0x0804, 0x35a5, 0x080c, 0x4ada, 0x0904, 0x35a8,
-	0x080c, 0x6a6b, 0x2009, 0x0009, 0x1904, 0x35a5, 0x080c, 0x4aa7,
-	0x2009, 0x0002, 0x0904, 0x35a5, 0x9006, 0xa866, 0xa832, 0xa868,
-	0xc0fd, 0xa86a, 0x7988, 0x9194, 0xff00, 0x918c, 0x00ff, 0x9006,
-	0x82ff, 0x1128, 0xc0ed, 0xa952, 0x798c, 0xa956, 0x0038, 0x928e,
-	0x0100, 0x1904, 0x35a8, 0xc0e5, 0xa952, 0xa956, 0xa83e, 0x080c,
-	0xcccd, 0x2009, 0x0003, 0x0904, 0x35a5, 0x7007, 0x0003, 0x701f,
-	0x5382, 0x0005, 0xa830, 0x9086, 0x0100, 0x2009, 0x0004, 0x0904,
-	0x35a5, 0x0804, 0x3573, 0x7aa8, 0x9284, 0xc000, 0x0148, 0xd2ec,
-	0x01a0, 0x080c, 0x56ee, 0x1188, 0x2009, 0x0014, 0x0804, 0x35a5,
-	0xd2dc, 0x1568, 0x81ff, 0x2009, 0x0001, 0x1904, 0x35a5, 0x080c,
-	0x56ee, 0x2009, 0x0007, 0x1904, 0x35a5, 0xd2f4, 0x0130, 0x9284,
-	0x5000, 0x080c, 0x56b5, 0x0804, 0x3573, 0xd2fc, 0x0158, 0x080c,
-	0x4ada, 0x0904, 0x35a8, 0x7984, 0x9284, 0x9000, 0x080c, 0x5692,
-	0x0804, 0x3573, 0x080c, 0x4ada, 0x0904, 0x35a8, 0xb804, 0x9084,
-	0x00ff, 0x9086, 0x0006, 0x2009, 0x0009, 0x1904, 0x546b, 0x080c,
-	0x4aa7, 0x2009, 0x0002, 0x0904, 0x546b, 0xa85c, 0x9080, 0x001b,
-	0xaf60, 0x2009, 0x0008, 0x7a8c, 0x7b88, 0x7c9c, 0x7d98, 0x080c,
-	0x4af0, 0x701f, 0x53dc, 0x0005, 0xa86c, 0x9086, 0x0500, 0x1138,
-	0xa870, 0x9005, 0x1120, 0xa874, 0x9084, 0xff00, 0x0110, 0x1904,
-	0x35a8, 0xa866, 0xa832, 0xa868, 0xc0fd, 0xa86a, 0x080c, 0x4ada,
-	0x1110, 0x0804, 0x35a8, 0x2009, 0x0043, 0x080c, 0xcd35, 0x2009,
-	0x0003, 0x0904, 0x546b, 0x7007, 0x0003, 0x701f, 0x5400, 0x0005,
-	0xa830, 0x9086, 0x0100, 0x2009, 0x0004, 0x0904, 0x546b, 0x7984,
-	0x7aa8, 0x9284, 0x1000, 0x080c, 0x5692, 0x0804, 0x3573, 0x00c6,
-	0xaab0, 0x9284, 0xc000, 0x0140, 0xd2ec, 0x0168, 0x080c, 0x56ee,
-	0x1150, 0x2009, 0x0014, 0x04f0, 0x2061, 0x1800, 0x080c, 0x56ee,
-	0x2009, 0x0007, 0x15b8, 0xd2f4, 0x0128, 0x9284, 0x5000, 0x080c,
-	0x56b5, 0x0050, 0xd2fc, 0x0178, 0x080c, 0x4ad8, 0x0588, 0xa998,
-	0x9284, 0x9000, 0x080c, 0x5692, 0xa87b, 0x0000, 0xa883, 0x0000,
-	0xa897, 0x4000, 0x0438, 0x080c, 0x4ad8, 0x0510, 0x080c, 0x6a6b,
-	0x2009, 0x0009, 0x11b8, 0xa8c4, 0x9086, 0x0500, 0x11c8, 0xa8c8,
-	0x9005, 0x11b0, 0xa8cc, 0x9084, 0xff00, 0x1190, 0x080c, 0x4ad8,
-	0x1108, 0x0070, 0x2009, 0x004b, 0x080c, 0xcd35, 0x2009, 0x0003,
-	0x0108, 0x0078, 0x0429, 0x19c0, 0xa897, 0x4005, 0xa99a, 0x0010,
-	0xa897, 0x4006, 0x900e, 0x9085, 0x0001, 0x2001, 0x0030, 0x00ce,
-	0x0005, 0x9006, 0x0ce0, 0x7aa8, 0xd2dc, 0x0904, 0x35a5, 0x0016,
-	0x7984, 0x9284, 0x1000, 0xc0fd, 0x080c, 0x5692, 0x001e, 0x1904,
-	0x35a5, 0x0804, 0x3573, 0x00f6, 0x2d78, 0x0011, 0x00fe, 0x0005,
-	0xaab0, 0xd2dc, 0x0150, 0x0016, 0xa998, 0x9284, 0x1000, 0xc0fd,
-	0x080c, 0x5692, 0x001e, 0x9085, 0x0001, 0x0005, 0x81ff, 0x0120,
-	0x2009, 0x0001, 0x0804, 0x35a5, 0x080c, 0x56ee, 0x0120, 0x2009,
-	0x0007, 0x0804, 0x35a5, 0x7984, 0x7ea8, 0x96b4, 0x00ff, 0x080c,
-	0x6625, 0x1904, 0x35a8, 0x9186, 0x007f, 0x0138, 0x080c, 0x6a6b,
-	0x0120, 0x2009, 0x0009, 0x0804, 0x35a5, 0x080c, 0x4aa7, 0x1120,
-	0x2009, 0x0002, 0x0804, 0x35a5, 0xa867, 0x0000, 0xa868, 0xc0fd,
-	0xa86a, 0x2001, 0x0100, 0x8007, 0xa80a, 0x080c, 0xca21, 0x1120,
-	0x2009, 0x0003, 0x0804, 0x35a5, 0x7007, 0x0003, 0x701f, 0x54c9,
-	0x0005, 0xa808, 0x8007, 0x9086, 0x0100, 0x1120, 0x2009, 0x0004,
-	0x0804, 0x35a5, 0xa8e0, 0xa866, 0xa810, 0x8007, 0x9084, 0x00ff,
-	0x800c, 0xa814, 0x8007, 0x9084, 0x00ff, 0x8004, 0x9080, 0x0002,
-	0x9108, 0x8906, 0x8006, 0x8007, 0x90bc, 0x003f, 0x9084, 0xffc0,
-	0x9080, 0x0004, 0x7a8c, 0x7b88, 0x7c9c, 0x7d98, 0x0804, 0x4af3,
-	0x080c, 0x4aa7, 0x1120, 0x2009, 0x0002, 0x0804, 0x35a5, 0x7984,
-	0x9194, 0xff00, 0x918c, 0x00ff, 0x8217, 0x82ff, 0x1118, 0x7023,
-	0x19b3, 0x0040, 0x92c6, 0x0001, 0x1118, 0x7023, 0x19cd, 0x0010,
-	0x0804, 0x35a8, 0x2009, 0x001a, 0x7a8c, 0x7b88, 0x7c9c, 0x7d98,
-	0xa85c, 0x9080, 0x0019, 0xaf60, 0x080c, 0x4af0, 0x701f, 0x5519,
-	0x0005, 0x2001, 0x182e, 0x2003, 0x0001, 0xa85c, 0x9080, 0x0019,
-	0x2098, 0xa860, 0x20e0, 0x20a9, 0x001a, 0x7020, 0x20a0, 0x20e9,
-	0x0001, 0x4003, 0x0804, 0x3573, 0x080c, 0x4aa7, 0x1120, 0x2009,
-	0x0002, 0x0804, 0x35a5, 0x7984, 0x9194, 0xff00, 0x918c, 0x00ff,
-	0x8217, 0x82ff, 0x1118, 0x2099, 0x19b3, 0x0040, 0x92c6, 0x0001,
-	0x1118, 0x2099, 0x19cd, 0x0010, 0x0804, 0x35a8, 0xa85c, 0x9080,
-	0x0019, 0x20a0, 0xa860, 0x20e8, 0x20a9, 0x001a, 0x20e1, 0x0001,
-	0x4003, 0x2009, 0x001a, 0x7a8c, 0x7b88, 0x7c9c, 0x7d98, 0xa85c,
-	0x9080, 0x0019, 0xaf60, 0x0804, 0x4af3, 0x7884, 0x908a, 0x1000,
-	0x1a04, 0x35a8, 0x0126, 0x2091, 0x8000, 0x8003, 0x800b, 0x810b,
-	0x9108, 0x00c6, 0x2061, 0x1a03, 0x6142, 0x00ce, 0x012e, 0x0804,
-	0x3573, 0x00c6, 0x080c, 0x74e9, 0x1160, 0x080c, 0x77ed, 0x080c,
-	0x6029, 0x9085, 0x0001, 0x080c, 0x7530, 0x080c, 0x741a, 0x080c,
-	0x0d7d, 0x2061, 0x1800, 0x6030, 0xc09d, 0x6032, 0x080c, 0x5ee4,
-	0x00ce, 0x0005, 0x00c6, 0x2001, 0x1800, 0x2004, 0x908e, 0x0000,
-	0x0904, 0x35a5, 0x7884, 0x9005, 0x0188, 0x7888, 0x2061, 0x199c,
-	0x2c0c, 0x2062, 0x080c, 0x29d8, 0x01a0, 0x080c, 0x29e0, 0x0188,
-	0x080c, 0x29e8, 0x0170, 0x2162, 0x0804, 0x35a8, 0x2061, 0x0100,
-	0x6038, 0x9086, 0x0007, 0x1118, 0x2009, 0x0001, 0x0010, 0x2009,
-	0x0000, 0x7884, 0x9086, 0x0002, 0x1588, 0x2061, 0x0100, 0x6028,
-	0xc09c, 0x602a, 0x080c, 0xa896, 0x0026, 0x2011, 0x0003, 0x080c,
-	0xa1cf, 0x2011, 0x0002, 0x080c, 0xa1d9, 0x002e, 0x080c, 0xa098,
-	0x0036, 0x901e, 0x080c, 0xa118, 0x003e, 0x080c, 0xa8b2, 0x60e3,
-	0x0000, 0x080c, 0xe702, 0x080c, 0xe71d, 0x9085, 0x0001, 0x080c,
-	0x7530, 0x9006, 0x080c, 0x2a0a, 0x2001, 0x1800, 0x2003, 0x0004,
-	0x0026, 0x2011, 0x0008, 0x080c, 0x2a44, 0x002e, 0x00ce, 0x0804,
-	0x3573, 0x81ff, 0x0120, 0x2009, 0x0001, 0x0804, 0x35a5, 0x080c,
-	0x56ee, 0x0120, 0x2009, 0x0007, 0x0804, 0x35a5, 0x7984, 0x7ea8,
-	0x96b4, 0x00ff, 0x080c, 0x6625, 0x1904, 0x35a8, 0x9186, 0x007f,
-	0x0138, 0x080c, 0x6a6b, 0x0120, 0x2009, 0x0009, 0x0804, 0x35a5,
-	0x080c, 0x4aa7, 0x1120, 0x2009, 0x0002, 0x0804, 0x35a5, 0xa867,
-	0x0000, 0xa868, 0xc0fd, 0xa86a, 0x080c, 0xca24, 0x1120, 0x2009,
-	0x0003, 0x0804, 0x35a5, 0x7007, 0x0003, 0x701f, 0x5620, 0x0005,
-	0xa830, 0x9086, 0x0100, 0x1120, 0x2009, 0x0004, 0x0804, 0x35a5,
-	0xa8e0, 0xa866, 0xa834, 0x8007, 0x800c, 0xa85c, 0x9080, 0x000c,
-	0x7a8c, 0x7b88, 0x7c9c, 0x7d98, 0xaf60, 0x0804, 0x4af3, 0xa898,
-	0x9086, 0x000d, 0x1904, 0x35a5, 0x2021, 0x4005, 0x0126, 0x2091,
-	0x8000, 0x0e04, 0x5644, 0x0010, 0x012e, 0x0cc0, 0x7c36, 0x9486,
-	0x4000, 0x0118, 0x7833, 0x0011, 0x0010, 0x7833, 0x0010, 0x7883,
-	0x4005, 0xa998, 0x7986, 0xa9a4, 0x799a, 0xa9a8, 0x799e, 0x080c,
-	0x4ae3, 0x2091, 0x4080, 0x2001, 0x0089, 0x2004, 0xd084, 0x190c,
-	0x11d6, 0x7007, 0x0001, 0x2091, 0x5000, 0x700f, 0x0000, 0x012e,
-	0x0005, 0x0126, 0x2091, 0x8000, 0x00c6, 0x2061, 0x1a03, 0x7984,
-	0x6152, 0x614e, 0x6057, 0x0000, 0x604b, 0x0009, 0x7898, 0x606a,
-	0x789c, 0x6066, 0x7888, 0x6062, 0x788c, 0x605e, 0x2001, 0x1a11,
-	0x2044, 0x2001, 0x1a18, 0xa076, 0xa060, 0xa072, 0xa07b, 0x0001,
-	0xa07f, 0x0002, 0xa06b, 0x0000, 0xa09f, 0x0000, 0x00ce, 0x012e,
-	0x0804, 0x3573, 0x0126, 0x2091, 0x8000, 0x00b6, 0x00c6, 0x90e4,
-	0xc000, 0x0128, 0x0006, 0x080c, 0xc885, 0x000e, 0x1198, 0xd0e4,
-	0x0160, 0x9180, 0x1000, 0x2004, 0x905d, 0x0160, 0x080c, 0x6043,
-	0x080c, 0xab57, 0x0110, 0xb817, 0x0000, 0x9006, 0x00ce, 0x00be,
-	0x012e, 0x0005, 0x9085, 0x0001, 0x0cc8, 0x0126, 0x2091, 0x8000,
-	0x0156, 0x2010, 0x900e, 0x20a9, 0x0800, 0x0016, 0x9180, 0x1000,
-	0x2004, 0x9005, 0x0180, 0x9186, 0x007e, 0x0168, 0x9186, 0x007f,
-	0x0150, 0x9186, 0x0080, 0x0138, 0x9186, 0x00ff, 0x0120, 0x0026,
-	0x2200, 0x0801, 0x002e, 0x001e, 0x8108, 0x1f04, 0x56bd, 0x015e,
-	0x012e, 0x0005, 0x2001, 0x1848, 0x2004, 0x0005, 0x2001, 0x1867,
-	0x2004, 0x0005, 0x0006, 0x2001, 0x1810, 0x2004, 0xd0d4, 0x000e,
-	0x0005, 0x2001, 0x180e, 0x2004, 0xd0b4, 0x0005, 0x2001, 0x1800,
-	0x2004, 0x9086, 0x0003, 0x0005, 0x0016, 0x00e6, 0x2071, 0x189e,
-	0x7108, 0x910d, 0x710a, 0x00ee, 0x001e, 0x0005, 0x79a4, 0x9182,
-	0x0081, 0x1a04, 0x35a8, 0x810c, 0x0016, 0x080c, 0x4aa7, 0x080c,
-	0x0f42, 0x2100, 0x2238, 0x7d84, 0x7c88, 0x7b8c, 0x7a90, 0x001e,
-	0x080c, 0x4af0, 0x701f, 0x5715, 0x0005, 0x2079, 0x0000, 0x7d94,
-	0x7c98, 0x7ba8, 0x7aac, 0x79a4, 0x810c, 0x2061, 0x18b8, 0x2c44,
-	0xa770, 0xa074, 0x2071, 0x189e, 0x080c, 0x4af3, 0x701f, 0x5729,
-	0x0005, 0x2061, 0x18b8, 0x2c44, 0x0016, 0x0026, 0xa270, 0xa174,
-	0x080c, 0x0f4a, 0x002e, 0x001e, 0x080c, 0x0ff7, 0x9006, 0xa802,
-	0xa806, 0x0804, 0x3573, 0x0126, 0x0156, 0x0136, 0x0146, 0x01c6,
-	0x01d6, 0x00c6, 0x00d6, 0x00e6, 0x00f6, 0x2061, 0x0100, 0x2069,
-	0x0200, 0x2071, 0x1800, 0x6044, 0xd0a4, 0x11e8, 0xd084, 0x0118,
-	0x080c, 0x58e4, 0x0068, 0xd08c, 0x0118, 0x080c, 0x57ed, 0x0040,
-	0xd094, 0x0118, 0x080c, 0x57bd, 0x0018, 0xd09c, 0x0108, 0x0099,
-	0x00fe, 0x00ee, 0x00de, 0x00ce, 0x01de, 0x01ce, 0x014e, 0x013e,
-	0x015e, 0x012e, 0x0005, 0x0016, 0x6128, 0xd19c, 0x1110, 0xc19d,
-	0x612a, 0x001e, 0x0c68, 0x0006, 0x7098, 0x9005, 0x000e, 0x0120,
-	0x709b, 0x0000, 0x7093, 0x0000, 0x624c, 0x9286, 0xf0f0, 0x1150,
-	0x6048, 0x9086, 0xf0f0, 0x0130, 0x624a, 0x6043, 0x0090, 0x6043,
-	0x0010, 0x0490, 0x9294, 0xff00, 0x9296, 0xf700, 0x0178, 0x7138,
-	0xd1a4, 0x1160, 0x6240, 0x9295, 0x0100, 0x6242, 0x9294, 0x0010,
-	0x0128, 0x2009, 0x00f7, 0x080c, 0x5fa5, 0x00f0, 0x6040, 0x9084,
-	0x0010, 0x9085, 0x0140, 0x6042, 0x6043, 0x0000, 0x7087, 0x0000,
-	0x70a3, 0x0001, 0x70c7, 0x0000, 0x70df, 0x0000, 0x2009, 0x1d80,
-	0x200b, 0x0000, 0x7097, 0x0000, 0x708b, 0x000f, 0x2009, 0x000f,
-	0x2011, 0x5e87, 0x080c, 0x8708, 0x0005, 0x2001, 0x1869, 0x2004,
-	0xd08c, 0x0110, 0x705f, 0xffff, 0x7088, 0x9005, 0x1528, 0x2011,
-	0x5e87, 0x080c, 0x863e, 0x6040, 0x9094, 0x0010, 0x9285, 0x0020,
-	0x6042, 0x20a9, 0x00c8, 0x6044, 0xd08c, 0x1168, 0x1f04, 0x57d3,
-	0x6242, 0x709b, 0x0000, 0x6040, 0x9094, 0x0010, 0x9285, 0x0080,
-	0x6042, 0x6242, 0x0048, 0x6242, 0x709b, 0x0000, 0x708f, 0x0000,
-	0x9006, 0x080c, 0x602e, 0x0000, 0x0005, 0x708c, 0x908a, 0x0003,
-	0x1a0c, 0x0d7d, 0x000b, 0x0005, 0x57f7, 0x5848, 0x58e3, 0x00f6,
-	0x0016, 0x6900, 0x918c, 0x0800, 0x708f, 0x0001, 0x2001, 0x015d,
-	0x2003, 0x0000, 0x6803, 0x00fc, 0x20a9, 0x0004, 0x6800, 0x9084,
-	0x00fc, 0x0120, 0x1f04, 0x5806, 0x080c, 0x0d7d, 0x68a0, 0x68a2,
-	0x689c, 0x689e, 0x6898, 0x689a, 0xa001, 0x918d, 0x1600, 0x6902,
-	0x001e, 0x6837, 0x0020, 0x080c, 0x600a, 0x2079, 0x1d00, 0x7833,
-	0x1101, 0x7837, 0x0000, 0x20e1, 0x0001, 0x2099, 0x1805, 0x20e9,
-	0x0001, 0x20a1, 0x1d0e, 0x20a9, 0x0004, 0x4003, 0x080c, 0xa690,
-	0x20e1, 0x0001, 0x2099, 0x1d00, 0x20e9, 0x0000, 0x20a1, 0x0240,
-	0x20a9, 0x0014, 0x4003, 0x60c3, 0x000c, 0x600f, 0x0000, 0x080c,
-	0x5eb8, 0x00fe, 0x9006, 0x7092, 0x6043, 0x0008, 0x6042, 0x0005,
-	0x00f6, 0x7090, 0x7093, 0x0000, 0x9025, 0x0904, 0x58c0, 0x6020,
-	0xd0b4, 0x1904, 0x58be, 0x71a0, 0x81ff, 0x0904, 0x58ac, 0x9486,
-	0x000c, 0x1904, 0x58b9, 0x9480, 0x0018, 0x8004, 0x20a8, 0x080c,
-	0x6003, 0x2011, 0x0260, 0x2019, 0x1d00, 0x220c, 0x2304, 0x9106,
-	0x11e8, 0x8210, 0x8318, 0x1f04, 0x5865, 0x6043, 0x0004, 0x2061,
-	0x0140, 0x605b, 0xbc94, 0x605f, 0xf0f0, 0x2061, 0x0100, 0x6043,
-	0x0006, 0x708f, 0x0002, 0x709b, 0x0002, 0x2009, 0x07d0, 0x2011,
-	0x5e8e, 0x080c, 0x8708, 0x080c, 0x600a, 0x04c0, 0x080c, 0x6003,
-	0x2079, 0x0260, 0x7930, 0x918e, 0x1101, 0x1558, 0x7834, 0x9005,
-	0x1540, 0x7900, 0x918c, 0x00ff, 0x1118, 0x7804, 0x9005, 0x0190,
-	0x080c, 0x6003, 0x2011, 0x026e, 0x2019, 0x1805, 0x20a9, 0x0004,
-	0x220c, 0x2304, 0x9102, 0x0230, 0x11a0, 0x8210, 0x8318, 0x1f04,
-	0x58a0, 0x0078, 0x70a3, 0x0000, 0x080c, 0x6003, 0x20e1, 0x0000,
-	0x2099, 0x0260, 0x20e9, 0x0001, 0x20a1, 0x1d00, 0x20a9, 0x0014,
-	0x4003, 0x6043, 0x0008, 0x6043, 0x0000, 0x0010, 0x00fe, 0x0005,
-	0x6040, 0x9085, 0x0100, 0x6042, 0x6020, 0xd0b4, 0x1db8, 0x080c,
-	0xa690, 0x20e1, 0x0001, 0x2099, 0x1d00, 0x20e9, 0x0000, 0x20a1,
-	0x0240, 0x20a9, 0x0014, 0x4003, 0x60c3, 0x000c, 0x2011, 0x19f4,
-	0x2013, 0x0000, 0x7093, 0x0000, 0x60a3, 0x0056, 0x60a7, 0x9575,
-	0x080c, 0x9e25, 0x08d8, 0x0005, 0x7098, 0x908a, 0x001d, 0x1a0c,
-	0x0d7d, 0x000b, 0x0005, 0x5915, 0x5928, 0x5951, 0x5971, 0x5997,
-	0x59c6, 0x59ec, 0x5a24, 0x5a4a, 0x5a78, 0x5ab3, 0x5aeb, 0x5b09,
-	0x5b34, 0x5b56, 0x5b71, 0x5b7b, 0x5baf, 0x5bd5, 0x5c04, 0x5c2a,
-	0x5c62, 0x5ca6, 0x5ce3, 0x5d04, 0x5d5d, 0x5d7f, 0x5dad, 0x5dad,
-	0x00c6, 0x2061, 0x1800, 0x6003, 0x0007, 0x2061, 0x0100, 0x6004,
-	0x9084, 0xfff9, 0x6006, 0x00ce, 0x0005, 0x2061, 0x0140, 0x605b,
-	0xbc94, 0x605f, 0xf0f0, 0x2061, 0x0100, 0x6043, 0x0002, 0x709b,
-	0x0001, 0x2009, 0x07d0, 0x2011, 0x5e8e, 0x080c, 0x8708, 0x0005,
-	0x00f6, 0x7090, 0x9086, 0x0014, 0x1510, 0x6042, 0x6020, 0xd0b4,
-	0x11f0, 0x080c, 0x6003, 0x2079, 0x0260, 0x7a30, 0x9296, 0x1102,
-	0x11a0, 0x7834, 0x9005, 0x1188, 0x7a38, 0xd2fc, 0x0128, 0x70c4,
-	0x9005, 0x1110, 0x70c7, 0x0001, 0x2011, 0x5e8e, 0x080c, 0x863e,
-	0x709b, 0x0010, 0x080c, 0x5b7b, 0x0010, 0x7093, 0x0000, 0x00fe,
-	0x0005, 0x00f6, 0x709b, 0x0003, 0x6043, 0x0004, 0x2011, 0x5e8e,
-	0x080c, 0x863e, 0x080c, 0x5f87, 0x2079, 0x0240, 0x7833, 0x1102,
-	0x7837, 0x0000, 0x20a9, 0x0008, 0x9f88, 0x000e, 0x200b, 0x0000,
-	0x8108, 0x1f04, 0x5966, 0x60c3, 0x0014, 0x080c, 0x5eb8, 0x00fe,
-	0x0005, 0x00f6, 0x7090, 0x9005, 0x0500, 0x2011, 0x5e8e, 0x080c,
-	0x863e, 0x9086, 0x0014, 0x11b8, 0x080c, 0x6003, 0x2079, 0x0260,
-	0x7a30, 0x9296, 0x1102, 0x1178, 0x7834, 0x9005, 0x1160, 0x7a38,
-	0xd2fc, 0x0128, 0x70c4, 0x9005, 0x1110, 0x70c7, 0x0001, 0x709b,
-	0x0004, 0x0029, 0x0010, 0x080c, 0x5fdf, 0x00fe, 0x0005, 0x00f6,
-	0x709b, 0x0005, 0x080c, 0x5f87, 0x2079, 0x0240, 0x7833, 0x1103,
-	0x7837, 0x0000, 0x080c, 0x6003, 0x080c, 0x5fe6, 0x1170, 0x7084,
-	0x9005, 0x1158, 0x715c, 0x9186, 0xffff, 0x0138, 0x2011, 0x0008,
-	0x080c, 0x5e3b, 0x0168, 0x080c, 0x5fbc, 0x20a9, 0x0008, 0x20e1,
-	0x0000, 0x2099, 0x026e, 0x20e9, 0x0000, 0x20a1, 0x024e, 0x4003,
-	0x60c3, 0x0014, 0x080c, 0x5eb8, 0x00fe, 0x0005, 0x00f6, 0x7090,
-	0x9005, 0x0500, 0x2011, 0x5e8e, 0x080c, 0x863e, 0x9086, 0x0014,
-	0x11b8, 0x080c, 0x6003, 0x2079, 0x0260, 0x7a30, 0x9296, 0x1103,
-	0x1178, 0x7834, 0x9005, 0x1160, 0x7a38, 0xd2fc, 0x0128, 0x70c4,
-	0x9005, 0x1110, 0x70c7, 0x0001, 0x709b, 0x0006, 0x0029, 0x0010,
-	0x080c, 0x5fdf, 0x00fe, 0x0005, 0x00f6, 0x709b, 0x0007, 0x080c,
-	0x5f87, 0x2079, 0x0240, 0x7833, 0x1104, 0x7837, 0x0000, 0x080c,
-	0x6003, 0x080c, 0x5fe6, 0x11b8, 0x7084, 0x9005, 0x11a0, 0x7164,
-	0x9186, 0xffff, 0x0180, 0x9180, 0x3374, 0x200d, 0x918c, 0xff00,
-	0x810f, 0x2011, 0x0008, 0x080c, 0x5e3b, 0x0180, 0x080c, 0x4fe4,
-	0x0110, 0x080c, 0x2664, 0x20a9, 0x0008, 0x20e1, 0x0000, 0x2099,
-	0x026e, 0x20e9, 0x0000, 0x20a1, 0x024e, 0x4003, 0x60c3, 0x0014,
-	0x080c, 0x5eb8, 0x00fe, 0x0005, 0x00f6, 0x7090, 0x9005, 0x0500,
-	0x2011, 0x5e8e, 0x080c, 0x863e, 0x9086, 0x0014, 0x11b8, 0x080c,
-	0x6003, 0x2079, 0x0260, 0x7a30, 0x9296, 0x1104, 0x1178, 0x7834,
+	0x0005, 0xa897, 0x4000, 0xa99a, 0x9006, 0x918d, 0x0001, 0x2008,
+	0x0005, 0x9006, 0x0005, 0xa830, 0x9086, 0x0100, 0x7024, 0x2058,
+	0x1110, 0x0804, 0x5632, 0x900e, 0x080c, 0x6913, 0x1108, 0xc185,
+	0xb800, 0xd0bc, 0x0108, 0xc18d, 0x0804, 0x3567, 0x080c, 0x56e9,
+	0x0120, 0x2009, 0x0007, 0x0804, 0x3599, 0x7f84, 0x7a8c, 0x7b88,
+	0x7c9c, 0x7d98, 0x080c, 0x4aa9, 0x1120, 0x2009, 0x0002, 0x0804,
+	0x3599, 0x900e, 0x2130, 0x7126, 0x7132, 0xa860, 0x20e8, 0x7036,
+	0xa85c, 0x9080, 0x0005, 0x702a, 0x20a0, 0x080c, 0x6620, 0x1904,
+	0x4e1d, 0x080c, 0x6a6a, 0x0138, 0x080c, 0x6a72, 0x0120, 0x080c,
+	0x6a0a, 0x1904, 0x4e1d, 0xd794, 0x1110, 0xd784, 0x01a8, 0xb8c4,
+	0x20e0, 0xb8c8, 0x9080, 0x0006, 0x2098, 0x3400, 0xd794, 0x0160,
+	0x20a9, 0x0008, 0x4003, 0x2098, 0x20a0, 0x3d00, 0x20e0, 0x20a9,
+	0x0002, 0x080c, 0x48a8, 0x0048, 0x20a9, 0x0004, 0x4003, 0x2098,
+	0x20a0, 0x3d00, 0x20e0, 0x080c, 0x48a8, 0x9186, 0x007e, 0x0170,
+	0x9186, 0x0080, 0x0158, 0x080c, 0x6a6a, 0x90c2, 0x0006, 0x1210,
+	0xc1fd, 0x0020, 0x080c, 0x6913, 0x1108, 0xc1fd, 0x4104, 0xc1fc,
+	0xd794, 0x0528, 0xb8c4, 0x20e0, 0xb8c8, 0x2060, 0x9c80, 0x0000,
+	0x2098, 0x20a9, 0x0002, 0x4003, 0x9c80, 0x0003, 0x2098, 0x20a9,
+	0x0001, 0x4005, 0x9c80, 0x0004, 0x2098, 0x3400, 0x20a9, 0x0002,
+	0x4003, 0x2098, 0x20a0, 0x3d00, 0x20e0, 0x080c, 0x489b, 0x9c80,
+	0x0026, 0x2098, 0xb8c4, 0x20e0, 0x20a9, 0x0002, 0x4003, 0xd794,
+	0x0110, 0x96b0, 0x000b, 0x96b0, 0x0005, 0x8108, 0x080c, 0xab49,
+	0x0118, 0x9186, 0x0800, 0x0040, 0xd78c, 0x0120, 0x9186, 0x0800,
+	0x0170, 0x0018, 0x9186, 0x007e, 0x0150, 0xd794, 0x0118, 0x9686,
+	0x0020, 0x0010, 0x9686, 0x0028, 0x0150, 0x0804, 0x4dad, 0x86ff,
+	0x1120, 0x7124, 0x810b, 0x0804, 0x3567, 0x7033, 0x0001, 0x7122,
+	0x7024, 0x9600, 0x7026, 0x772e, 0x2061, 0x18b8, 0x2c44, 0xa06b,
+	0x0000, 0xa67a, 0x7034, 0xa072, 0x7028, 0xa076, 0xa28e, 0xa392,
+	0xa496, 0xa59a, 0x080c, 0x112f, 0x7007, 0x0002, 0x701f, 0x4e59,
+	0x0005, 0x7030, 0x9005, 0x1180, 0x7120, 0x7028, 0x20a0, 0x772c,
+	0x9036, 0x7034, 0x20e8, 0x2061, 0x18b8, 0x2c44, 0xa28c, 0xa390,
+	0xa494, 0xa598, 0x0804, 0x4dad, 0x7124, 0x810b, 0x0804, 0x3567,
+	0x2029, 0x007e, 0x7984, 0x7a88, 0x7b8c, 0x7c98, 0x9184, 0xff00,
+	0x8007, 0x90e2, 0x0020, 0x0a04, 0x359c, 0x9502, 0x0a04, 0x359c,
+	0x9184, 0x00ff, 0x90e2, 0x0020, 0x0a04, 0x359c, 0x9502, 0x0a04,
+	0x359c, 0x9284, 0xff00, 0x8007, 0x90e2, 0x0020, 0x0a04, 0x359c,
+	0x9502, 0x0a04, 0x359c, 0x9284, 0x00ff, 0x90e2, 0x0020, 0x0a04,
+	0x359c, 0x9502, 0x0a04, 0x359c, 0x9384, 0xff00, 0x8007, 0x90e2,
+	0x0020, 0x0a04, 0x359c, 0x9502, 0x0a04, 0x359c, 0x9384, 0x00ff,
+	0x90e2, 0x0020, 0x0a04, 0x359c, 0x9502, 0x0a04, 0x359c, 0x9484,
+	0xff00, 0x8007, 0x90e2, 0x0020, 0x0a04, 0x359c, 0x9502, 0x0a04,
+	0x359c, 0x9484, 0x00ff, 0x90e2, 0x0020, 0x0a04, 0x359c, 0x9502,
+	0x0a04, 0x359c, 0x2061, 0x1988, 0x6102, 0x6206, 0x630a, 0x640e,
+	0x0804, 0x3567, 0x080c, 0x4aa9, 0x0904, 0x3599, 0x2009, 0x0016,
+	0x7a8c, 0x7b88, 0x7c9c, 0x7d98, 0xa85c, 0x9080, 0x0019, 0xaf60,
+	0x080c, 0x4af2, 0x701f, 0x4edd, 0x0005, 0x2001, 0x0138, 0x2003,
+	0x0000, 0x00e6, 0x2071, 0x0300, 0x701c, 0xd0a4, 0x1de8, 0x00ee,
+	0x20a9, 0x0016, 0x896e, 0x8d6e, 0x8d6f, 0x9d84, 0xffc0, 0x9080,
+	0x0019, 0x2098, 0x9d84, 0x003f, 0x20e0, 0x2069, 0x1877, 0x20e9,
+	0x0001, 0x2da0, 0x4003, 0x6800, 0x9005, 0x0904, 0x4f5e, 0x6804,
+	0x2008, 0x918c, 0xfff8, 0x1904, 0x4f5e, 0x680c, 0x9005, 0x0904,
+	0x4f5e, 0x9082, 0xff01, 0x1a04, 0x4f5e, 0x6810, 0x9082, 0x005c,
+	0x0a04, 0x4f5e, 0x6824, 0x2008, 0x9082, 0x0008, 0x0a04, 0x4f5e,
+	0x9182, 0x0400, 0x1a04, 0x4f5e, 0x0056, 0x2029, 0x0000, 0x080c,
+	0x8cec, 0x005e, 0x6944, 0x6820, 0x9102, 0x06c0, 0x6820, 0x9082,
+	0x0019, 0x16a0, 0x6828, 0x6944, 0x810c, 0x9102, 0x0678, 0x6840,
+	0x9082, 0x000f, 0x1658, 0x080c, 0x1053, 0x2900, 0x0904, 0x4f78,
+	0x684e, 0x00e6, 0x2071, 0x1930, 0x00b6, 0x2059, 0x0000, 0x080c,
+	0x8ba8, 0x00be, 0x00ee, 0x0558, 0x080c, 0x8902, 0x080c, 0x8948,
+	0x11e0, 0x6857, 0x0000, 0x00c6, 0x2061, 0x0100, 0x6104, 0x918d,
+	0x2000, 0x6106, 0x6b10, 0x2061, 0x1a6a, 0x630a, 0x00ce, 0x080c,
+	0x272c, 0x2001, 0x0138, 0x2102, 0x0804, 0x3567, 0x080c, 0x272c,
+	0x2001, 0x0138, 0x2102, 0x0804, 0x359c, 0x00e6, 0x2071, 0x1930,
+	0x080c, 0x8d7d, 0x080c, 0x8d8c, 0x080c, 0x8b97, 0x00ee, 0x2001,
+	0x188a, 0x204c, 0x080c, 0x106c, 0x2001, 0x188a, 0x2003, 0x0000,
+	0x080c, 0x272c, 0x2001, 0x0138, 0x2102, 0x0804, 0x3599, 0x2001,
+	0x1924, 0x200c, 0x918e, 0x0000, 0x0904, 0x4fd7, 0x080c, 0x8b92,
+	0x0904, 0x4fd7, 0x2001, 0x0101, 0x200c, 0x918c, 0xdfff, 0x2102,
+	0x2001, 0x0138, 0x2003, 0x0000, 0x00e6, 0x2071, 0x0300, 0x701c,
+	0xd0a4, 0x1de8, 0x00ee, 0x080c, 0x8b97, 0x2001, 0x0035, 0x080c,
+	0x1686, 0x00c6, 0x2061, 0x193c, 0x6004, 0x6100, 0x9106, 0x1de0,
+	0x00ce, 0x080c, 0x272c, 0x2001, 0x0138, 0x2102, 0x00e6, 0x00f6,
+	0x2071, 0x1923, 0x080c, 0x8ad3, 0x0120, 0x2f00, 0x080c, 0x8b5d,
+	0x0cc8, 0x00fe, 0x00ee, 0x0126, 0x2091, 0x8000, 0x2001, 0x188a,
+	0x200c, 0x81ff, 0x0138, 0x2148, 0x080c, 0x106c, 0x2001, 0x188a,
+	0x2003, 0x0000, 0x2001, 0x183d, 0x2003, 0x0020, 0x00e6, 0x2071,
+	0x1930, 0x080c, 0x8d7d, 0x080c, 0x8d8c, 0x00ee, 0x012e, 0x0804,
+	0x3567, 0x0006, 0x080c, 0x56d5, 0xd0cc, 0x000e, 0x0005, 0x0006,
+	0x080c, 0x56d9, 0xd0bc, 0x000e, 0x0005, 0x6174, 0x7a84, 0x6300,
+	0x82ff, 0x1118, 0x7986, 0x0804, 0x3567, 0x83ff, 0x1904, 0x359c,
+	0x2001, 0xfff0, 0x9200, 0x1a04, 0x359c, 0x2019, 0xffff, 0x6078,
+	0x9302, 0x9200, 0x0a04, 0x359c, 0x7986, 0x6276, 0x0804, 0x3567,
+	0x080c, 0x56e9, 0x1904, 0x3599, 0x7c88, 0x7d84, 0x7e98, 0x7f8c,
+	0x080c, 0x4aa9, 0x0904, 0x3599, 0x900e, 0x901e, 0x7326, 0x7332,
+	0xa860, 0x20e8, 0x7036, 0xa85c, 0x9080, 0x0003, 0x702a, 0x20a0,
+	0x91d8, 0x1000, 0x2b5c, 0x8bff, 0x0178, 0x080c, 0x6a6a, 0x0118,
+	0x080c, 0x6a72, 0x1148, 0x20a9, 0x0001, 0xb814, 0x4004, 0xb810,
+	0x4004, 0x4104, 0x9398, 0x0003, 0x8108, 0x9182, 0x0800, 0x0120,
+	0x9386, 0x003c, 0x0170, 0x0c20, 0x83ff, 0x1148, 0x7224, 0x900e,
+	0x2001, 0x0003, 0x080c, 0x9148, 0x2208, 0x0804, 0x3567, 0x7033,
+	0x0001, 0x7122, 0x7024, 0x9300, 0x7026, 0x2061, 0x18b8, 0x2c44,
+	0xa06b, 0x0000, 0xa37a, 0x7028, 0xa076, 0x7034, 0xa072, 0xa48e,
+	0xa592, 0xa696, 0xa79a, 0x080c, 0x112f, 0x7007, 0x0002, 0x701f,
+	0x505a, 0x0005, 0x7030, 0x9005, 0x1178, 0x7120, 0x7028, 0x20a0,
+	0x901e, 0x7034, 0x20e8, 0x2061, 0x18b8, 0x2c44, 0xa48c, 0xa590,
+	0xa694, 0xa798, 0x0804, 0x5018, 0x7224, 0x900e, 0x2001, 0x0003,
+	0x080c, 0x9148, 0x2208, 0x0804, 0x3567, 0x00f6, 0x00e6, 0x080c,
+	0x56e9, 0x2009, 0x0007, 0x1904, 0x50ed, 0x2071, 0x189e, 0x745c,
+	0x84ff, 0x2009, 0x000e, 0x1904, 0x50ed, 0xac9c, 0xad98, 0xaea4,
+	0xafa0, 0x0096, 0x080c, 0x1053, 0x2009, 0x0002, 0x0904, 0x50ed,
+	0x2900, 0x705e, 0x900e, 0x901e, 0x7356, 0x7362, 0xa860, 0x7066,
+	0xa85c, 0x9080, 0x0003, 0x705a, 0x20a0, 0x91d8, 0x1000, 0x2b5c,
+	0x8bff, 0x0178, 0x080c, 0x6a6a, 0x0118, 0x080c, 0x6a72, 0x1148,
+	0xb814, 0x20a9, 0x0001, 0x4004, 0xb810, 0x4004, 0x4104, 0x9398,
+	0x0003, 0x8108, 0x9182, 0x0800, 0x0120, 0x9386, 0x003c, 0x01e8,
+	0x0c20, 0x83ff, 0x11c0, 0x7254, 0x900e, 0x2001, 0x0003, 0x080c,
+	0x9148, 0x2208, 0x009e, 0xa897, 0x4000, 0xa99a, 0x715c, 0x81ff,
+	0x090c, 0x0d7d, 0x2148, 0x080c, 0x106c, 0x9006, 0x705e, 0x918d,
+	0x0001, 0x2008, 0x0418, 0x7063, 0x0001, 0x7152, 0x7054, 0x9300,
+	0x7056, 0x2061, 0x18b9, 0x2c44, 0xa37a, 0x7058, 0xa076, 0x7064,
+	0xa072, 0xa48e, 0xa592, 0xa696, 0xa79a, 0xa09f, 0x50f9, 0x000e,
+	0xa0a2, 0x080c, 0x112f, 0x9006, 0x0048, 0x009e, 0xa897, 0x4005,
+	0xa99a, 0x900e, 0x9085, 0x0001, 0x2001, 0x0030, 0x00ee, 0x00fe,
+	0x0005, 0x00f6, 0xa0a0, 0x904d, 0x090c, 0x0d7d, 0x00e6, 0x2071,
+	0x189e, 0xa06c, 0x908e, 0x0100, 0x0138, 0xa87b, 0x0030, 0xa883,
+	0x0000, 0xa897, 0x4002, 0x00d8, 0x7060, 0x9005, 0x1158, 0x7150,
+	0x7058, 0x20a0, 0x901e, 0x7064, 0x20e8, 0xa48c, 0xa590, 0xa694,
+	0xa798, 0x0428, 0xa87b, 0x0000, 0xa883, 0x0000, 0xa897, 0x4000,
+	0x7254, 0x900e, 0x2001, 0x0003, 0x080c, 0x9148, 0xaa9a, 0x715c,
+	0x81ff, 0x090c, 0x0d7d, 0x2148, 0x080c, 0x106c, 0x705f, 0x0000,
+	0xa0a0, 0x2048, 0x0126, 0x2091, 0x8000, 0x080c, 0x6d7b, 0x012e,
+	0xa09f, 0x0000, 0xa0a3, 0x0000, 0x00ee, 0x00fe, 0x0005, 0x91d8,
+	0x1000, 0x2b5c, 0x8bff, 0x0178, 0x080c, 0x6a6a, 0x0118, 0x080c,
+	0x6a72, 0x1148, 0xb814, 0x20a9, 0x0001, 0x4004, 0xb810, 0x4004,
+	0x4104, 0x9398, 0x0003, 0x8108, 0x9182, 0x0800, 0x0120, 0x9386,
+	0x003c, 0x0518, 0x0c20, 0x83ff, 0x11f0, 0x7154, 0x810c, 0xa99a,
+	0xa897, 0x4000, 0x715c, 0x81ff, 0x090c, 0x0d7d, 0x2148, 0x080c,
+	0x106c, 0x9006, 0x705e, 0x918d, 0x0001, 0x2008, 0xa0a0, 0x2048,
+	0x0126, 0x2091, 0x8000, 0x080c, 0x6d7b, 0x012e, 0xa09f, 0x0000,
+	0xa0a3, 0x0000, 0x0070, 0x7063, 0x0001, 0x7152, 0x7054, 0x9300,
+	0x7056, 0xa37a, 0xa48e, 0xa592, 0xa696, 0xa79a, 0x080c, 0x112f,
+	0x9006, 0x00ee, 0x0005, 0x0096, 0xa88c, 0x90be, 0x7000, 0x0148,
+	0x90be, 0x7100, 0x0130, 0x90be, 0x7200, 0x0118, 0x009e, 0x0804,
+	0x359c, 0xa884, 0xa988, 0x080c, 0x2614, 0x1518, 0x080c, 0x65bf,
+	0x1500, 0x7126, 0xbe12, 0xbd16, 0xae7c, 0x080c, 0x4aa9, 0x01c8,
+	0x080c, 0x4aa9, 0x01b0, 0x009e, 0xa867, 0x0000, 0xa868, 0xc0fd,
+	0xa86a, 0xa823, 0x0000, 0xa804, 0x2048, 0x080c, 0xc9e2, 0x1120,
+	0x2009, 0x0003, 0x0804, 0x3599, 0x7007, 0x0003, 0x701f, 0x51c6,
+	0x0005, 0x009e, 0x2009, 0x0002, 0x0804, 0x3599, 0x7124, 0x080c,
+	0x32f8, 0xa820, 0x9086, 0x8001, 0x1120, 0x2009, 0x0004, 0x0804,
+	0x3599, 0x2900, 0x7022, 0xa804, 0x0096, 0x2048, 0x8906, 0x8006,
+	0x8007, 0x90bc, 0x003f, 0x9084, 0xffc0, 0x009e, 0x9080, 0x0002,
+	0x0076, 0x0006, 0x2098, 0x20a0, 0x27e0, 0x27e8, 0x20a9, 0x002a,
+	0x080c, 0x0fb7, 0xaa6c, 0xab70, 0xac74, 0xad78, 0x2061, 0x18b8,
+	0x2c44, 0xa06b, 0x0000, 0xae64, 0xaf8c, 0x97c6, 0x7000, 0x0118,
+	0x97c6, 0x7100, 0x1148, 0x96c2, 0x0004, 0x0600, 0x2009, 0x0004,
+	0x000e, 0x007e, 0x0804, 0x4af5, 0x97c6, 0x7200, 0x11b8, 0x96c2,
+	0x0054, 0x02a0, 0x000e, 0x007e, 0x2061, 0x18b8, 0x2c44, 0xa076,
+	0xa772, 0xa07b, 0x002a, 0xa28e, 0xa392, 0xa496, 0xa59a, 0x080c,
+	0x112f, 0x7007, 0x0002, 0x701f, 0x5222, 0x0005, 0x000e, 0x007e,
+	0x0804, 0x359c, 0x7020, 0x2048, 0xa804, 0x2048, 0xa804, 0x2048,
+	0x8906, 0x8006, 0x8007, 0x90bc, 0x003f, 0x9084, 0xffc0, 0x9080,
+	0x0002, 0x2098, 0x20a0, 0x27e0, 0x27e8, 0x20a9, 0x002a, 0x080c,
+	0x0fb7, 0x2100, 0x2238, 0x2061, 0x18b8, 0x2c44, 0xa28c, 0xa390,
+	0xa494, 0xa598, 0x2009, 0x002a, 0x0804, 0x4af5, 0x81ff, 0x1904,
+	0x3599, 0x798c, 0x2001, 0x197d, 0x918c, 0x8000, 0x2102, 0x080c,
+	0x4ac0, 0x0904, 0x359c, 0x080c, 0x6a6a, 0x0120, 0x080c, 0x6a72,
+	0x1904, 0x359c, 0x080c, 0x66e7, 0x0904, 0x3599, 0x0126, 0x2091,
+	0x8000, 0x080c, 0x6880, 0x012e, 0x0904, 0x3599, 0x2001, 0x197d,
+	0x2004, 0xd0fc, 0x1904, 0x3567, 0x0804, 0x4547, 0xa9a0, 0x2001,
+	0x197d, 0x918c, 0x8000, 0xc18d, 0x2102, 0x080c, 0x4acd, 0x01a0,
+	0x080c, 0x6a6a, 0x0118, 0x080c, 0x6a72, 0x1170, 0x080c, 0x66e7,
+	0x2009, 0x0002, 0x0128, 0x080c, 0x6880, 0x1170, 0x2009, 0x0003,
+	0xa897, 0x4005, 0xa99a, 0x0010, 0xa897, 0x4006, 0x900e, 0x9085,
+	0x0001, 0x2001, 0x0030, 0x0005, 0xa897, 0x4000, 0x2001, 0x197d,
+	0x2004, 0xd0fc, 0x1128, 0x080c, 0x56dd, 0x0110, 0x9006, 0x0018,
+	0x900e, 0x9085, 0x0001, 0x2001, 0x0000, 0x0005, 0x78a8, 0xd08c,
+	0x1118, 0xd084, 0x0904, 0x44bc, 0x080c, 0x4adc, 0x0904, 0x359c,
+	0x080c, 0x4aa9, 0x1120, 0x2009, 0x0002, 0x0804, 0x3599, 0x080c,
+	0x6a6a, 0x0130, 0x908e, 0x0004, 0x0118, 0x908e, 0x0005, 0x15a0,
+	0x78a8, 0xd08c, 0x0120, 0xb800, 0xc08c, 0xb802, 0x0028, 0x080c,
+	0x56d5, 0xd0b4, 0x0904, 0x44f6, 0x7884, 0x908e, 0x007e, 0x0904,
+	0x44f6, 0x908e, 0x007f, 0x0904, 0x44f6, 0x908e, 0x0080, 0x0904,
+	0x44f6, 0xb800, 0xd08c, 0x1904, 0x44f6, 0xa867, 0x0000, 0xa868,
+	0xc0fd, 0xa86a, 0x080c, 0xca01, 0x1120, 0x2009, 0x0003, 0x0804,
+	0x3599, 0x7007, 0x0003, 0x701f, 0x52ee, 0x0005, 0x080c, 0x4adc,
+	0x0904, 0x359c, 0x0804, 0x44f6, 0x080c, 0x3357, 0x0108, 0x0005,
+	0x2009, 0x1834, 0x210c, 0x81ff, 0x0120, 0x2009, 0x0001, 0x0804,
+	0x3599, 0x080c, 0x56e9, 0x0120, 0x2009, 0x0007, 0x0804, 0x3599,
+	0x080c, 0x6a62, 0x0120, 0x2009, 0x0008, 0x0804, 0x3599, 0xb89c,
+	0xd0a4, 0x1118, 0xd0ac, 0x1904, 0x44f6, 0x9006, 0xa866, 0xa832,
+	0xa868, 0xc0fd, 0xa86a, 0x080c, 0xca69, 0x1120, 0x2009, 0x0003,
+	0x0804, 0x3599, 0x7007, 0x0003, 0x701f, 0x5327, 0x0005, 0xa830,
+	0x9086, 0x0100, 0x1120, 0x2009, 0x0004, 0x0804, 0x5632, 0x080c,
+	0x4adc, 0x0904, 0x359c, 0x0804, 0x52c0, 0x81ff, 0x2009, 0x0001,
+	0x1904, 0x3599, 0x080c, 0x56e9, 0x2009, 0x0007, 0x1904, 0x3599,
+	0x080c, 0x6a62, 0x0120, 0x2009, 0x0008, 0x0804, 0x3599, 0x080c,
+	0x4adc, 0x0904, 0x359c, 0x080c, 0x6a6a, 0x2009, 0x0009, 0x1904,
+	0x3599, 0x080c, 0x4aa9, 0x2009, 0x0002, 0x0904, 0x3599, 0x9006,
+	0xa866, 0xa832, 0xa868, 0xc0fd, 0xa86a, 0x7988, 0x9194, 0xff00,
+	0x918c, 0x00ff, 0x9006, 0x82ff, 0x1128, 0xc0ed, 0xa952, 0x798c,
+	0xa956, 0x0038, 0x928e, 0x0100, 0x1904, 0x359c, 0xc0e5, 0xa952,
+	0xa956, 0xa83e, 0x080c, 0xcccc, 0x2009, 0x0003, 0x0904, 0x3599,
+	0x7007, 0x0003, 0x701f, 0x537d, 0x0005, 0xa830, 0x9086, 0x0100,
+	0x2009, 0x0004, 0x0904, 0x3599, 0x0804, 0x3567, 0x7aa8, 0x9284,
+	0xc000, 0x0148, 0xd2ec, 0x01a0, 0x080c, 0x56e9, 0x1188, 0x2009,
+	0x0014, 0x0804, 0x3599, 0xd2dc, 0x1568, 0x81ff, 0x2009, 0x0001,
+	0x1904, 0x3599, 0x080c, 0x56e9, 0x2009, 0x0007, 0x1904, 0x3599,
+	0xd2f4, 0x0130, 0x9284, 0x5000, 0x080c, 0x56b0, 0x0804, 0x3567,
+	0xd2fc, 0x0158, 0x080c, 0x4adc, 0x0904, 0x359c, 0x7984, 0x9284,
+	0x9000, 0x080c, 0x568d, 0x0804, 0x3567, 0x080c, 0x4adc, 0x0904,
+	0x359c, 0xb804, 0x9084, 0x00ff, 0x9086, 0x0006, 0x2009, 0x0009,
+	0x1904, 0x5466, 0x080c, 0x4aa9, 0x2009, 0x0002, 0x0904, 0x5466,
+	0xa85c, 0x9080, 0x001b, 0xaf60, 0x2009, 0x0008, 0x7a8c, 0x7b88,
+	0x7c9c, 0x7d98, 0x080c, 0x4af2, 0x701f, 0x53d7, 0x0005, 0xa86c,
+	0x9086, 0x0500, 0x1138, 0xa870, 0x9005, 0x1120, 0xa874, 0x9084,
+	0xff00, 0x0110, 0x1904, 0x359c, 0xa866, 0xa832, 0xa868, 0xc0fd,
+	0xa86a, 0x080c, 0x4adc, 0x1110, 0x0804, 0x359c, 0x2009, 0x0043,
+	0x080c, 0xcd34, 0x2009, 0x0003, 0x0904, 0x5466, 0x7007, 0x0003,
+	0x701f, 0x53fb, 0x0005, 0xa830, 0x9086, 0x0100, 0x2009, 0x0004,
+	0x0904, 0x5466, 0x7984, 0x7aa8, 0x9284, 0x1000, 0x080c, 0x568d,
+	0x0804, 0x3567, 0x00c6, 0xaab0, 0x9284, 0xc000, 0x0140, 0xd2ec,
+	0x0168, 0x080c, 0x56e9, 0x1150, 0x2009, 0x0014, 0x04f0, 0x2061,
+	0x1800, 0x080c, 0x56e9, 0x2009, 0x0007, 0x15b8, 0xd2f4, 0x0128,
+	0x9284, 0x5000, 0x080c, 0x56b0, 0x0050, 0xd2fc, 0x0178, 0x080c,
+	0x4ada, 0x0588, 0xa998, 0x9284, 0x9000, 0x080c, 0x568d, 0xa87b,
+	0x0000, 0xa883, 0x0000, 0xa897, 0x4000, 0x0438, 0x080c, 0x4ada,
+	0x0510, 0x080c, 0x6a6a, 0x2009, 0x0009, 0x11b8, 0xa8c4, 0x9086,
+	0x0500, 0x11c8, 0xa8c8, 0x9005, 0x11b0, 0xa8cc, 0x9084, 0xff00,
+	0x1190, 0x080c, 0x4ada, 0x1108, 0x0070, 0x2009, 0x004b, 0x080c,
+	0xcd34, 0x2009, 0x0003, 0x0108, 0x0078, 0x0429, 0x19c0, 0xa897,
+	0x4005, 0xa99a, 0x0010, 0xa897, 0x4006, 0x900e, 0x9085, 0x0001,
+	0x2001, 0x0030, 0x00ce, 0x0005, 0x9006, 0x0ce0, 0x7aa8, 0xd2dc,
+	0x0904, 0x3599, 0x0016, 0x7984, 0x9284, 0x1000, 0xc0fd, 0x080c,
+	0x568d, 0x001e, 0x1904, 0x3599, 0x0804, 0x3567, 0x00f6, 0x2d78,
+	0x0011, 0x00fe, 0x0005, 0xaab0, 0xd2dc, 0x0150, 0x0016, 0xa998,
+	0x9284, 0x1000, 0xc0fd, 0x080c, 0x568d, 0x001e, 0x9085, 0x0001,
+	0x0005, 0x81ff, 0x0120, 0x2009, 0x0001, 0x0804, 0x3599, 0x080c,
+	0x56e9, 0x0120, 0x2009, 0x0007, 0x0804, 0x3599, 0x7984, 0x7ea8,
+	0x96b4, 0x00ff, 0x080c, 0x6620, 0x1904, 0x359c, 0x9186, 0x007f,
+	0x0138, 0x080c, 0x6a6a, 0x0120, 0x2009, 0x0009, 0x0804, 0x3599,
+	0x080c, 0x4aa9, 0x1120, 0x2009, 0x0002, 0x0804, 0x3599, 0xa867,
+	0x0000, 0xa868, 0xc0fd, 0xa86a, 0x2001, 0x0100, 0x8007, 0xa80a,
+	0x080c, 0xca1b, 0x1120, 0x2009, 0x0003, 0x0804, 0x3599, 0x7007,
+	0x0003, 0x701f, 0x54c4, 0x0005, 0xa808, 0x8007, 0x9086, 0x0100,
+	0x1120, 0x2009, 0x0004, 0x0804, 0x3599, 0xa8e0, 0xa866, 0xa810,
+	0x8007, 0x9084, 0x00ff, 0x800c, 0xa814, 0x8007, 0x9084, 0x00ff,
+	0x8004, 0x9080, 0x0002, 0x9108, 0x8906, 0x8006, 0x8007, 0x90bc,
+	0x003f, 0x9084, 0xffc0, 0x9080, 0x0004, 0x7a8c, 0x7b88, 0x7c9c,
+	0x7d98, 0x0804, 0x4af5, 0x080c, 0x4aa9, 0x1120, 0x2009, 0x0002,
+	0x0804, 0x3599, 0x7984, 0x9194, 0xff00, 0x918c, 0x00ff, 0x8217,
+	0x82ff, 0x1118, 0x7023, 0x19b2, 0x0040, 0x92c6, 0x0001, 0x1118,
+	0x7023, 0x19cc, 0x0010, 0x0804, 0x359c, 0x2009, 0x001a, 0x7a8c,
+	0x7b88, 0x7c9c, 0x7d98, 0xa85c, 0x9080, 0x0019, 0xaf60, 0x080c,
+	0x4af2, 0x701f, 0x5514, 0x0005, 0x2001, 0x182e, 0x2003, 0x0001,
+	0xa85c, 0x9080, 0x0019, 0x2098, 0xa860, 0x20e0, 0x20a9, 0x001a,
+	0x7020, 0x20a0, 0x20e9, 0x0001, 0x4003, 0x0804, 0x3567, 0x080c,
+	0x4aa9, 0x1120, 0x2009, 0x0002, 0x0804, 0x3599, 0x7984, 0x9194,
+	0xff00, 0x918c, 0x00ff, 0x8217, 0x82ff, 0x1118, 0x2099, 0x19b2,
+	0x0040, 0x92c6, 0x0001, 0x1118, 0x2099, 0x19cc, 0x0010, 0x0804,
+	0x359c, 0xa85c, 0x9080, 0x0019, 0x20a0, 0xa860, 0x20e8, 0x20a9,
+	0x001a, 0x20e1, 0x0001, 0x4003, 0x2009, 0x001a, 0x7a8c, 0x7b88,
+	0x7c9c, 0x7d98, 0xa85c, 0x9080, 0x0019, 0xaf60, 0x0804, 0x4af5,
+	0x7884, 0x908a, 0x1000, 0x1a04, 0x359c, 0x0126, 0x2091, 0x8000,
+	0x8003, 0x800b, 0x810b, 0x9108, 0x00c6, 0x2061, 0x1a02, 0x6142,
+	0x00ce, 0x012e, 0x0804, 0x3567, 0x00c6, 0x080c, 0x74c8, 0x1160,
+	0x080c, 0x77cc, 0x080c, 0x6024, 0x9085, 0x0001, 0x080c, 0x750f,
+	0x080c, 0x73f9, 0x080c, 0x0d7d, 0x2061, 0x1800, 0x6030, 0xc09d,
+	0x6032, 0x080c, 0x5edf, 0x00ce, 0x0005, 0x00c6, 0x2001, 0x1800,
+	0x2004, 0x908e, 0x0000, 0x0904, 0x3599, 0x7884, 0x9005, 0x0188,
+	0x7888, 0x2061, 0x199b, 0x2c0c, 0x2062, 0x080c, 0x29f7, 0x01a0,
+	0x080c, 0x29ff, 0x0188, 0x080c, 0x2a07, 0x0170, 0x2162, 0x0804,
+	0x359c, 0x2061, 0x0100, 0x6038, 0x9086, 0x0007, 0x1118, 0x2009,
+	0x0001, 0x0010, 0x2009, 0x0000, 0x7884, 0x9086, 0x0002, 0x1588,
+	0x2061, 0x0100, 0x6028, 0xc09c, 0x602a, 0x080c, 0xa888, 0x0026,
+	0x2011, 0x0003, 0x080c, 0xa1b1, 0x2011, 0x0002, 0x080c, 0xa1bb,
+	0x002e, 0x080c, 0xa07a, 0x0036, 0x901e, 0x080c, 0xa0fa, 0x003e,
+	0x080c, 0xa8a4, 0x60e3, 0x0000, 0x080c, 0xe712, 0x080c, 0xe72d,
+	0x9085, 0x0001, 0x080c, 0x750f, 0x9006, 0x080c, 0x2a29, 0x2001,
+	0x1800, 0x2003, 0x0004, 0x0026, 0x2011, 0x0008, 0x080c, 0x2a63,
+	0x002e, 0x00ce, 0x0804, 0x3567, 0x81ff, 0x0120, 0x2009, 0x0001,
+	0x0804, 0x3599, 0x080c, 0x56e9, 0x0120, 0x2009, 0x0007, 0x0804,
+	0x3599, 0x7984, 0x7ea8, 0x96b4, 0x00ff, 0x080c, 0x6620, 0x1904,
+	0x359c, 0x9186, 0x007f, 0x0138, 0x080c, 0x6a6a, 0x0120, 0x2009,
+	0x0009, 0x0804, 0x3599, 0x080c, 0x4aa9, 0x1120, 0x2009, 0x0002,
+	0x0804, 0x3599, 0xa867, 0x0000, 0xa868, 0xc0fd, 0xa86a, 0x080c,
+	0xca1e, 0x1120, 0x2009, 0x0003, 0x0804, 0x3599, 0x7007, 0x0003,
+	0x701f, 0x561b, 0x0005, 0xa830, 0x9086, 0x0100, 0x1120, 0x2009,
+	0x0004, 0x0804, 0x3599, 0xa8e0, 0xa866, 0xa834, 0x8007, 0x800c,
+	0xa85c, 0x9080, 0x000c, 0x7a8c, 0x7b88, 0x7c9c, 0x7d98, 0xaf60,
+	0x0804, 0x4af5, 0xa898, 0x9086, 0x000d, 0x1904, 0x3599, 0x2021,
+	0x4005, 0x0126, 0x2091, 0x8000, 0x0e04, 0x563f, 0x0010, 0x012e,
+	0x0cc0, 0x7c36, 0x9486, 0x4000, 0x0118, 0x7833, 0x0011, 0x0010,
+	0x7833, 0x0010, 0x7883, 0x4005, 0xa998, 0x7986, 0xa9a4, 0x799a,
+	0xa9a8, 0x799e, 0x080c, 0x4ae5, 0x2091, 0x4080, 0x2001, 0x0089,
+	0x2004, 0xd084, 0x190c, 0x11e1, 0x7007, 0x0001, 0x2091, 0x5000,
+	0x700f, 0x0000, 0x012e, 0x0005, 0x0126, 0x2091, 0x8000, 0x00c6,
+	0x2061, 0x1a02, 0x7984, 0x6152, 0x614e, 0x6057, 0x0000, 0x604b,
+	0x0009, 0x7898, 0x606a, 0x789c, 0x6066, 0x7888, 0x6062, 0x788c,
+	0x605e, 0x2001, 0x1a10, 0x2044, 0x2001, 0x1a17, 0xa076, 0xa060,
+	0xa072, 0xa07b, 0x0001, 0xa07f, 0x0002, 0xa06b, 0x0000, 0xa09f,
+	0x0000, 0x00ce, 0x012e, 0x0804, 0x3567, 0x0126, 0x2091, 0x8000,
+	0x00b6, 0x00c6, 0x90e4, 0xc000, 0x0128, 0x0006, 0x080c, 0xc87f,
+	0x000e, 0x1198, 0xd0e4, 0x0160, 0x9180, 0x1000, 0x2004, 0x905d,
+	0x0160, 0x080c, 0x603e, 0x080c, 0xab49, 0x0110, 0xb817, 0x0000,
+	0x9006, 0x00ce, 0x00be, 0x012e, 0x0005, 0x9085, 0x0001, 0x0cc8,
+	0x0126, 0x2091, 0x8000, 0x0156, 0x2010, 0x900e, 0x20a9, 0x0800,
+	0x0016, 0x9180, 0x1000, 0x2004, 0x9005, 0x0180, 0x9186, 0x007e,
+	0x0168, 0x9186, 0x007f, 0x0150, 0x9186, 0x0080, 0x0138, 0x9186,
+	0x00ff, 0x0120, 0x0026, 0x2200, 0x0801, 0x002e, 0x001e, 0x8108,
+	0x1f04, 0x56b8, 0x015e, 0x012e, 0x0005, 0x2001, 0x1848, 0x2004,
+	0x0005, 0x2001, 0x1867, 0x2004, 0x0005, 0x0006, 0x2001, 0x1810,
+	0x2004, 0xd0d4, 0x000e, 0x0005, 0x2001, 0x180e, 0x2004, 0xd0b4,
+	0x0005, 0x2001, 0x1800, 0x2004, 0x9086, 0x0003, 0x0005, 0x0016,
+	0x00e6, 0x2071, 0x189e, 0x7108, 0x910d, 0x710a, 0x00ee, 0x001e,
+	0x0005, 0x79a4, 0x9182, 0x0081, 0x1a04, 0x359c, 0x810c, 0x0016,
+	0x080c, 0x4aa9, 0x080c, 0x0f42, 0x2100, 0x2238, 0x7d84, 0x7c88,
+	0x7b8c, 0x7a90, 0x001e, 0x080c, 0x4af2, 0x701f, 0x5710, 0x0005,
+	0x2079, 0x0000, 0x7d94, 0x7c98, 0x7ba8, 0x7aac, 0x79a4, 0x810c,
+	0x2061, 0x18b8, 0x2c44, 0xa770, 0xa074, 0x2071, 0x189e, 0x080c,
+	0x4af5, 0x701f, 0x5724, 0x0005, 0x2061, 0x18b8, 0x2c44, 0x0016,
+	0x0026, 0xa270, 0xa174, 0x080c, 0x0f4a, 0x002e, 0x001e, 0x080c,
+	0x0ff7, 0x9006, 0xa802, 0xa806, 0x0804, 0x3567, 0x0126, 0x0156,
+	0x0136, 0x0146, 0x01c6, 0x01d6, 0x00c6, 0x00d6, 0x00e6, 0x00f6,
+	0x2061, 0x0100, 0x2069, 0x0200, 0x2071, 0x1800, 0x6044, 0xd0a4,
+	0x11e8, 0xd084, 0x0118, 0x080c, 0x58df, 0x0068, 0xd08c, 0x0118,
+	0x080c, 0x57e8, 0x0040, 0xd094, 0x0118, 0x080c, 0x57b8, 0x0018,
+	0xd09c, 0x0108, 0x0099, 0x00fe, 0x00ee, 0x00de, 0x00ce, 0x01de,
+	0x01ce, 0x014e, 0x013e, 0x015e, 0x012e, 0x0005, 0x0016, 0x6128,
+	0xd19c, 0x1110, 0xc19d, 0x612a, 0x001e, 0x0c68, 0x0006, 0x7098,
+	0x9005, 0x000e, 0x0120, 0x709b, 0x0000, 0x7093, 0x0000, 0x624c,
+	0x9286, 0xf0f0, 0x1150, 0x6048, 0x9086, 0xf0f0, 0x0130, 0x624a,
+	0x6043, 0x0090, 0x6043, 0x0010, 0x0490, 0x9294, 0xff00, 0x9296,
+	0xf700, 0x0178, 0x7138, 0xd1a4, 0x1160, 0x6240, 0x9295, 0x0100,
+	0x6242, 0x9294, 0x0010, 0x0128, 0x2009, 0x00f7, 0x080c, 0x5fa0,
+	0x00f0, 0x6040, 0x9084, 0x0010, 0x9085, 0x0140, 0x6042, 0x6043,
+	0x0000, 0x7087, 0x0000, 0x70a3, 0x0001, 0x70c7, 0x0000, 0x70df,
+	0x0000, 0x2009, 0x1d80, 0x200b, 0x0000, 0x7097, 0x0000, 0x708b,
+	0x000f, 0x2009, 0x000f, 0x2011, 0x5e82, 0x080c, 0x86e7, 0x0005,
+	0x2001, 0x1869, 0x2004, 0xd08c, 0x0110, 0x705f, 0xffff, 0x7088,
+	0x9005, 0x1528, 0x2011, 0x5e82, 0x080c, 0x861d, 0x6040, 0x9094,
+	0x0010, 0x9285, 0x0020, 0x6042, 0x20a9, 0x00c8, 0x6044, 0xd08c,
+	0x1168, 0x1f04, 0x57ce, 0x6242, 0x709b, 0x0000, 0x6040, 0x9094,
+	0x0010, 0x9285, 0x0080, 0x6042, 0x6242, 0x0048, 0x6242, 0x709b,
+	0x0000, 0x708f, 0x0000, 0x9006, 0x080c, 0x6029, 0x0000, 0x0005,
+	0x708c, 0x908a, 0x0003, 0x1a0c, 0x0d7d, 0x000b, 0x0005, 0x57f2,
+	0x5843, 0x58de, 0x00f6, 0x0016, 0x6900, 0x918c, 0x0800, 0x708f,
+	0x0001, 0x2001, 0x015d, 0x2003, 0x0000, 0x6803, 0x00fc, 0x20a9,
+	0x0004, 0x6800, 0x9084, 0x00fc, 0x0120, 0x1f04, 0x5801, 0x080c,
+	0x0d7d, 0x68a0, 0x68a2, 0x689c, 0x689e, 0x6898, 0x689a, 0xa001,
+	0x918d, 0x1600, 0x6902, 0x001e, 0x6837, 0x0020, 0x080c, 0x6005,
+	0x2079, 0x1d00, 0x7833, 0x1101, 0x7837, 0x0000, 0x20e1, 0x0001,
+	0x2099, 0x1805, 0x20e9, 0x0001, 0x20a1, 0x1d0e, 0x20a9, 0x0004,
+	0x4003, 0x080c, 0xa67d, 0x20e1, 0x0001, 0x2099, 0x1d00, 0x20e9,
+	0x0000, 0x20a1, 0x0240, 0x20a9, 0x0014, 0x4003, 0x60c3, 0x000c,
+	0x600f, 0x0000, 0x080c, 0x5eb3, 0x00fe, 0x9006, 0x7092, 0x6043,
+	0x0008, 0x6042, 0x0005, 0x00f6, 0x7090, 0x7093, 0x0000, 0x9025,
+	0x0904, 0x58bb, 0x6020, 0xd0b4, 0x1904, 0x58b9, 0x71a0, 0x81ff,
+	0x0904, 0x58a7, 0x9486, 0x000c, 0x1904, 0x58b4, 0x9480, 0x0018,
+	0x8004, 0x20a8, 0x080c, 0x5ffe, 0x2011, 0x0260, 0x2019, 0x1d00,
+	0x220c, 0x2304, 0x9106, 0x11e8, 0x8210, 0x8318, 0x1f04, 0x5860,
+	0x6043, 0x0004, 0x2061, 0x0140, 0x605b, 0xbc94, 0x605f, 0xf0f0,
+	0x2061, 0x0100, 0x6043, 0x0006, 0x708f, 0x0002, 0x709b, 0x0002,
+	0x2009, 0x07d0, 0x2011, 0x5e89, 0x080c, 0x86e7, 0x080c, 0x6005,
+	0x04c0, 0x080c, 0x5ffe, 0x2079, 0x0260, 0x7930, 0x918e, 0x1101,
+	0x1558, 0x7834, 0x9005, 0x1540, 0x7900, 0x918c, 0x00ff, 0x1118,
+	0x7804, 0x9005, 0x0190, 0x080c, 0x5ffe, 0x2011, 0x026e, 0x2019,
+	0x1805, 0x20a9, 0x0004, 0x220c, 0x2304, 0x9102, 0x0230, 0x11a0,
+	0x8210, 0x8318, 0x1f04, 0x589b, 0x0078, 0x70a3, 0x0000, 0x080c,
+	0x5ffe, 0x20e1, 0x0000, 0x2099, 0x0260, 0x20e9, 0x0001, 0x20a1,
+	0x1d00, 0x20a9, 0x0014, 0x4003, 0x6043, 0x0008, 0x6043, 0x0000,
+	0x0010, 0x00fe, 0x0005, 0x6040, 0x9085, 0x0100, 0x6042, 0x6020,
+	0xd0b4, 0x1db8, 0x080c, 0xa67d, 0x20e1, 0x0001, 0x2099, 0x1d00,
+	0x20e9, 0x0000, 0x20a1, 0x0240, 0x20a9, 0x0014, 0x4003, 0x60c3,
+	0x000c, 0x2011, 0x19f3, 0x2013, 0x0000, 0x7093, 0x0000, 0x60a3,
+	0x0056, 0x60a7, 0x9575, 0x080c, 0x9e09, 0x08d8, 0x0005, 0x7098,
+	0x908a, 0x001d, 0x1a0c, 0x0d7d, 0x000b, 0x0005, 0x5910, 0x5923,
+	0x594c, 0x596c, 0x5992, 0x59c1, 0x59e7, 0x5a1f, 0x5a45, 0x5a73,
+	0x5aae, 0x5ae6, 0x5b04, 0x5b2f, 0x5b51, 0x5b6c, 0x5b76, 0x5baa,
+	0x5bd0, 0x5bff, 0x5c25, 0x5c5d, 0x5ca1, 0x5cde, 0x5cff, 0x5d58,
+	0x5d7a, 0x5da8, 0x5da8, 0x00c6, 0x2061, 0x1800, 0x6003, 0x0007,
+	0x2061, 0x0100, 0x6004, 0x9084, 0xfff9, 0x6006, 0x00ce, 0x0005,
+	0x2061, 0x0140, 0x605b, 0xbc94, 0x605f, 0xf0f0, 0x2061, 0x0100,
+	0x6043, 0x0002, 0x709b, 0x0001, 0x2009, 0x07d0, 0x2011, 0x5e89,
+	0x080c, 0x86e7, 0x0005, 0x00f6, 0x7090, 0x9086, 0x0014, 0x1510,
+	0x6042, 0x6020, 0xd0b4, 0x11f0, 0x080c, 0x5ffe, 0x2079, 0x0260,
+	0x7a30, 0x9296, 0x1102, 0x11a0, 0x7834, 0x9005, 0x1188, 0x7a38,
+	0xd2fc, 0x0128, 0x70c4, 0x9005, 0x1110, 0x70c7, 0x0001, 0x2011,
+	0x5e89, 0x080c, 0x861d, 0x709b, 0x0010, 0x080c, 0x5b76, 0x0010,
+	0x7093, 0x0000, 0x00fe, 0x0005, 0x00f6, 0x709b, 0x0003, 0x6043,
+	0x0004, 0x2011, 0x5e89, 0x080c, 0x861d, 0x080c, 0x5f82, 0x2079,
+	0x0240, 0x7833, 0x1102, 0x7837, 0x0000, 0x20a9, 0x0008, 0x9f88,
+	0x000e, 0x200b, 0x0000, 0x8108, 0x1f04, 0x5961, 0x60c3, 0x0014,
+	0x080c, 0x5eb3, 0x00fe, 0x0005, 0x00f6, 0x7090, 0x9005, 0x0500,
+	0x2011, 0x5e89, 0x080c, 0x861d, 0x9086, 0x0014, 0x11b8, 0x080c,
+	0x5ffe, 0x2079, 0x0260, 0x7a30, 0x9296, 0x1102, 0x1178, 0x7834,
 	0x9005, 0x1160, 0x7a38, 0xd2fc, 0x0128, 0x70c4, 0x9005, 0x1110,
-	0x70c7, 0x0001, 0x709b, 0x0008, 0x0029, 0x0010, 0x080c, 0x5fdf,
-	0x00fe, 0x0005, 0x00f6, 0x709b, 0x0009, 0x080c, 0x5f87, 0x2079,
-	0x0240, 0x7833, 0x1105, 0x7837, 0x0100, 0x080c, 0x5fe6, 0x1150,
-	0x7084, 0x9005, 0x1138, 0x080c, 0x5dae, 0x1188, 0x9085, 0x0001,
-	0x080c, 0x2664, 0x20a9, 0x0008, 0x080c, 0x6003, 0x20e1, 0x0000,
-	0x2099, 0x026e, 0x20e9, 0x0000, 0x20a1, 0x024e, 0x4003, 0x60c3,
-	0x0014, 0x080c, 0x5eb8, 0x0010, 0x080c, 0x5908, 0x00fe, 0x0005,
-	0x00f6, 0x7090, 0x9005, 0x05a8, 0x2011, 0x5e8e, 0x080c, 0x863e,
-	0x9086, 0x0014, 0x1560, 0x080c, 0x6003, 0x2079, 0x0260, 0x7a30,
-	0x9296, 0x1105, 0x1520, 0x7834, 0x9084, 0x0100, 0x2011, 0x0100,
-	0x921e, 0x1160, 0x7a38, 0xd2fc, 0x0128, 0x70c4, 0x9005, 0x1110,
-	0x70c7, 0x0001, 0x709b, 0x000a, 0x00b1, 0x0098, 0x9005, 0x1178,
+	0x70c7, 0x0001, 0x709b, 0x0004, 0x0029, 0x0010, 0x080c, 0x5fda,
+	0x00fe, 0x0005, 0x00f6, 0x709b, 0x0005, 0x080c, 0x5f82, 0x2079,
+	0x0240, 0x7833, 0x1103, 0x7837, 0x0000, 0x080c, 0x5ffe, 0x080c,
+	0x5fe1, 0x1170, 0x7084, 0x9005, 0x1158, 0x715c, 0x9186, 0xffff,
+	0x0138, 0x2011, 0x0008, 0x080c, 0x5e36, 0x0168, 0x080c, 0x5fb7,
+	0x20a9, 0x0008, 0x20e1, 0x0000, 0x2099, 0x026e, 0x20e9, 0x0000,
+	0x20a1, 0x024e, 0x4003, 0x60c3, 0x0014, 0x080c, 0x5eb3, 0x00fe,
+	0x0005, 0x00f6, 0x7090, 0x9005, 0x0500, 0x2011, 0x5e89, 0x080c,
+	0x861d, 0x9086, 0x0014, 0x11b8, 0x080c, 0x5ffe, 0x2079, 0x0260,
+	0x7a30, 0x9296, 0x1103, 0x1178, 0x7834, 0x9005, 0x1160, 0x7a38,
+	0xd2fc, 0x0128, 0x70c4, 0x9005, 0x1110, 0x70c7, 0x0001, 0x709b,
+	0x0006, 0x0029, 0x0010, 0x080c, 0x5fda, 0x00fe, 0x0005, 0x00f6,
+	0x709b, 0x0007, 0x080c, 0x5f82, 0x2079, 0x0240, 0x7833, 0x1104,
+	0x7837, 0x0000, 0x080c, 0x5ffe, 0x080c, 0x5fe1, 0x11b8, 0x7084,
+	0x9005, 0x11a0, 0x7164, 0x9186, 0xffff, 0x0180, 0x9180, 0x3368,
+	0x200d, 0x918c, 0xff00, 0x810f, 0x2011, 0x0008, 0x080c, 0x5e36,
+	0x0180, 0x080c, 0x4fdf, 0x0110, 0x080c, 0x267d, 0x20a9, 0x0008,
+	0x20e1, 0x0000, 0x2099, 0x026e, 0x20e9, 0x0000, 0x20a1, 0x024e,
+	0x4003, 0x60c3, 0x0014, 0x080c, 0x5eb3, 0x00fe, 0x0005, 0x00f6,
+	0x7090, 0x9005, 0x0500, 0x2011, 0x5e89, 0x080c, 0x861d, 0x9086,
+	0x0014, 0x11b8, 0x080c, 0x5ffe, 0x2079, 0x0260, 0x7a30, 0x9296,
+	0x1104, 0x1178, 0x7834, 0x9005, 0x1160, 0x7a38, 0xd2fc, 0x0128,
+	0x70c4, 0x9005, 0x1110, 0x70c7, 0x0001, 0x709b, 0x0008, 0x0029,
+	0x0010, 0x080c, 0x5fda, 0x00fe, 0x0005, 0x00f6, 0x709b, 0x0009,
+	0x080c, 0x5f82, 0x2079, 0x0240, 0x7833, 0x1105, 0x7837, 0x0100,
+	0x080c, 0x5fe1, 0x1150, 0x7084, 0x9005, 0x1138, 0x080c, 0x5da9,
+	0x1188, 0x9085, 0x0001, 0x080c, 0x267d, 0x20a9, 0x0008, 0x080c,
+	0x5ffe, 0x20e1, 0x0000, 0x2099, 0x026e, 0x20e9, 0x0000, 0x20a1,
+	0x024e, 0x4003, 0x60c3, 0x0014, 0x080c, 0x5eb3, 0x0010, 0x080c,
+	0x5903, 0x00fe, 0x0005, 0x00f6, 0x7090, 0x9005, 0x05a8, 0x2011,
+	0x5e89, 0x080c, 0x861d, 0x9086, 0x0014, 0x1560, 0x080c, 0x5ffe,
+	0x2079, 0x0260, 0x7a30, 0x9296, 0x1105, 0x1520, 0x7834, 0x9084,
+	0x0100, 0x2011, 0x0100, 0x921e, 0x1160, 0x7a38, 0xd2fc, 0x0128,
+	0x70c4, 0x9005, 0x1110, 0x70c7, 0x0001, 0x709b, 0x000a, 0x00b1,
+	0x0098, 0x9005, 0x1178, 0x7a38, 0xd2fc, 0x0128, 0x70c4, 0x9005,
+	0x1110, 0x70c7, 0x0001, 0x7097, 0x0000, 0x709b, 0x000e, 0x080c,
+	0x5b51, 0x0010, 0x080c, 0x5fda, 0x00fe, 0x0005, 0x00f6, 0x709b,
+	0x000b, 0x2011, 0x1d0e, 0x20e9, 0x0001, 0x22a0, 0x20a9, 0x0040,
+	0x2019, 0xffff, 0x4304, 0x080c, 0x5f82, 0x2079, 0x0240, 0x7833,
+	0x1106, 0x7837, 0x0000, 0x080c, 0x5fe1, 0x0118, 0x2013, 0x0000,
+	0x0020, 0x7060, 0x9085, 0x0100, 0x2012, 0x20a9, 0x0040, 0x2009,
+	0x024e, 0x2011, 0x1d0e, 0x220e, 0x8210, 0x8108, 0x9186, 0x0260,
+	0x1128, 0x6810, 0x8000, 0x6812, 0x2009, 0x0240, 0x1f04, 0x5ad3,
+	0x60c3, 0x0084, 0x080c, 0x5eb3, 0x00fe, 0x0005, 0x00f6, 0x7090,
+	0x9005, 0x01c0, 0x2011, 0x5e89, 0x080c, 0x861d, 0x9086, 0x0084,
+	0x1178, 0x080c, 0x5ffe, 0x2079, 0x0260, 0x7a30, 0x9296, 0x1106,
+	0x1138, 0x7834, 0x9005, 0x1120, 0x709b, 0x000c, 0x0029, 0x0010,
+	0x080c, 0x5fda, 0x00fe, 0x0005, 0x00f6, 0x709b, 0x000d, 0x080c,
+	0x5f82, 0x2079, 0x0240, 0x7833, 0x1107, 0x7837, 0x0000, 0x080c,
+	0x5ffe, 0x20a9, 0x0040, 0x2011, 0x026e, 0x2009, 0x024e, 0x220e,
+	0x8210, 0x8108, 0x9186, 0x0260, 0x1150, 0x6810, 0x8000, 0x6812,
+	0x2009, 0x0240, 0x6814, 0x8000, 0x6816, 0x2011, 0x0260, 0x1f04,
+	0x5b17, 0x60c3, 0x0084, 0x080c, 0x5eb3, 0x00fe, 0x0005, 0x00f6,
+	0x7090, 0x9005, 0x01e0, 0x2011, 0x5e89, 0x080c, 0x861d, 0x9086,
+	0x0084, 0x1198, 0x080c, 0x5ffe, 0x2079, 0x0260, 0x7a30, 0x9296,
+	0x1107, 0x1158, 0x7834, 0x9005, 0x1140, 0x7097, 0x0001, 0x080c,
+	0x5f54, 0x709b, 0x000e, 0x0029, 0x0010, 0x080c, 0x5fda, 0x00fe,
+	0x0005, 0x918d, 0x0001, 0x080c, 0x6029, 0x709b, 0x000f, 0x7093,
+	0x0000, 0x2061, 0x0140, 0x605b, 0xbc85, 0x605f, 0xb5b5, 0x2061,
+	0x0100, 0x6043, 0x0005, 0x6043, 0x0004, 0x2009, 0x07d0, 0x2011,
+	0x5e89, 0x080c, 0x8611, 0x0005, 0x7090, 0x9005, 0x0130, 0x2011,
+	0x5e89, 0x080c, 0x861d, 0x709b, 0x0000, 0x0005, 0x709b, 0x0011,
+	0x080c, 0xa67d, 0x080c, 0x5ffe, 0x20e1, 0x0000, 0x2099, 0x0260,
+	0x20e9, 0x0000, 0x20a1, 0x0240, 0x7490, 0x9480, 0x0018, 0x9080,
+	0x0007, 0x9084, 0x03f8, 0x8004, 0x20a8, 0x4003, 0x080c, 0x5fe1,
+	0x11a0, 0x717c, 0x81ff, 0x0188, 0x900e, 0x7080, 0x9084, 0x00ff,
+	0x0160, 0x080c, 0x2614, 0x9186, 0x007e, 0x0138, 0x9186, 0x0080,
+	0x0120, 0x2011, 0x0008, 0x080c, 0x5e36, 0x60c3, 0x0014, 0x080c,
+	0x5eb3, 0x0005, 0x00f6, 0x7090, 0x9005, 0x0500, 0x2011, 0x5e89,
+	0x080c, 0x861d, 0x9086, 0x0014, 0x11b8, 0x080c, 0x5ffe, 0x2079,
+	0x0260, 0x7a30, 0x9296, 0x1103, 0x1178, 0x7834, 0x9005, 0x1160,
 	0x7a38, 0xd2fc, 0x0128, 0x70c4, 0x9005, 0x1110, 0x70c7, 0x0001,
-	0x7097, 0x0000, 0x709b, 0x000e, 0x080c, 0x5b56, 0x0010, 0x080c,
-	0x5fdf, 0x00fe, 0x0005, 0x00f6, 0x709b, 0x000b, 0x2011, 0x1d0e,
-	0x20e9, 0x0001, 0x22a0, 0x20a9, 0x0040, 0x2019, 0xffff, 0x4304,
-	0x080c, 0x5f87, 0x2079, 0x0240, 0x7833, 0x1106, 0x7837, 0x0000,
-	0x080c, 0x5fe6, 0x0118, 0x2013, 0x0000, 0x0020, 0x7060, 0x9085,
-	0x0100, 0x2012, 0x20a9, 0x0040, 0x2009, 0x024e, 0x2011, 0x1d0e,
-	0x220e, 0x8210, 0x8108, 0x9186, 0x0260, 0x1128, 0x6810, 0x8000,
-	0x6812, 0x2009, 0x0240, 0x1f04, 0x5ad8, 0x60c3, 0x0084, 0x080c,
-	0x5eb8, 0x00fe, 0x0005, 0x00f6, 0x7090, 0x9005, 0x01c0, 0x2011,
-	0x5e8e, 0x080c, 0x863e, 0x9086, 0x0084, 0x1178, 0x080c, 0x6003,
-	0x2079, 0x0260, 0x7a30, 0x9296, 0x1106, 0x1138, 0x7834, 0x9005,
-	0x1120, 0x709b, 0x000c, 0x0029, 0x0010, 0x080c, 0x5fdf, 0x00fe,
-	0x0005, 0x00f6, 0x709b, 0x000d, 0x080c, 0x5f87, 0x2079, 0x0240,
-	0x7833, 0x1107, 0x7837, 0x0000, 0x080c, 0x6003, 0x20a9, 0x0040,
-	0x2011, 0x026e, 0x2009, 0x024e, 0x220e, 0x8210, 0x8108, 0x9186,
-	0x0260, 0x1150, 0x6810, 0x8000, 0x6812, 0x2009, 0x0240, 0x6814,
-	0x8000, 0x6816, 0x2011, 0x0260, 0x1f04, 0x5b1c, 0x60c3, 0x0084,
-	0x080c, 0x5eb8, 0x00fe, 0x0005, 0x00f6, 0x7090, 0x9005, 0x01e0,
-	0x2011, 0x5e8e, 0x080c, 0x863e, 0x9086, 0x0084, 0x1198, 0x080c,
-	0x6003, 0x2079, 0x0260, 0x7a30, 0x9296, 0x1107, 0x1158, 0x7834,
-	0x9005, 0x1140, 0x7097, 0x0001, 0x080c, 0x5f59, 0x709b, 0x000e,
-	0x0029, 0x0010, 0x080c, 0x5fdf, 0x00fe, 0x0005, 0x918d, 0x0001,
-	0x080c, 0x602e, 0x709b, 0x000f, 0x7093, 0x0000, 0x2061, 0x0140,
-	0x605b, 0xbc85, 0x605f, 0xb5b5, 0x2061, 0x0100, 0x6043, 0x0005,
-	0x6043, 0x0004, 0x2009, 0x07d0, 0x2011, 0x5e8e, 0x080c, 0x8632,
-	0x0005, 0x7090, 0x9005, 0x0130, 0x2011, 0x5e8e, 0x080c, 0x863e,
-	0x709b, 0x0000, 0x0005, 0x709b, 0x0011, 0x080c, 0xa690, 0x080c,
-	0x6003, 0x20e1, 0x0000, 0x2099, 0x0260, 0x20e9, 0x0000, 0x20a1,
-	0x0240, 0x7490, 0x9480, 0x0018, 0x9080, 0x0007, 0x9084, 0x03f8,
-	0x8004, 0x20a8, 0x4003, 0x080c, 0x5fe6, 0x11a0, 0x717c, 0x81ff,
-	0x0188, 0x900e, 0x7080, 0x9084, 0x00ff, 0x0160, 0x080c, 0x25fb,
-	0x9186, 0x007e, 0x0138, 0x9186, 0x0080, 0x0120, 0x2011, 0x0008,
-	0x080c, 0x5e3b, 0x60c3, 0x0014, 0x080c, 0x5eb8, 0x0005, 0x00f6,
-	0x7090, 0x9005, 0x0500, 0x2011, 0x5e8e, 0x080c, 0x863e, 0x9086,
-	0x0014, 0x11b8, 0x080c, 0x6003, 0x2079, 0x0260, 0x7a30, 0x9296,
-	0x1103, 0x1178, 0x7834, 0x9005, 0x1160, 0x7a38, 0xd2fc, 0x0128,
-	0x70c4, 0x9005, 0x1110, 0x70c7, 0x0001, 0x709b, 0x0012, 0x0029,
-	0x0010, 0x7093, 0x0000, 0x00fe, 0x0005, 0x00f6, 0x709b, 0x0013,
-	0x080c, 0x5f95, 0x2079, 0x0240, 0x7833, 0x1103, 0x7837, 0x0000,
-	0x080c, 0x6003, 0x080c, 0x5fe6, 0x1170, 0x7084, 0x9005, 0x1158,
-	0x715c, 0x9186, 0xffff, 0x0138, 0x2011, 0x0008, 0x080c, 0x5e3b,
-	0x0168, 0x080c, 0x5fbc, 0x20a9, 0x0008, 0x20e1, 0x0000, 0x2099,
+	0x709b, 0x0012, 0x0029, 0x0010, 0x7093, 0x0000, 0x00fe, 0x0005,
+	0x00f6, 0x709b, 0x0013, 0x080c, 0x5f90, 0x2079, 0x0240, 0x7833,
+	0x1103, 0x7837, 0x0000, 0x080c, 0x5ffe, 0x080c, 0x5fe1, 0x1170,
+	0x7084, 0x9005, 0x1158, 0x715c, 0x9186, 0xffff, 0x0138, 0x2011,
+	0x0008, 0x080c, 0x5e36, 0x0168, 0x080c, 0x5fb7, 0x20a9, 0x0008,
+	0x20e1, 0x0000, 0x2099, 0x026e, 0x20e9, 0x0000, 0x20a1, 0x024e,
+	0x4003, 0x60c3, 0x0014, 0x080c, 0x5eb3, 0x00fe, 0x0005, 0x00f6,
+	0x7090, 0x9005, 0x0500, 0x2011, 0x5e89, 0x080c, 0x861d, 0x9086,
+	0x0014, 0x11b8, 0x080c, 0x5ffe, 0x2079, 0x0260, 0x7a30, 0x9296,
+	0x1104, 0x1178, 0x7834, 0x9005, 0x1160, 0x7a38, 0xd2fc, 0x0128,
+	0x70c4, 0x9005, 0x1110, 0x70c7, 0x0001, 0x709b, 0x0014, 0x0029,
+	0x0010, 0x7093, 0x0000, 0x00fe, 0x0005, 0x00f6, 0x709b, 0x0015,
+	0x080c, 0x5f90, 0x2079, 0x0240, 0x7833, 0x1104, 0x7837, 0x0000,
+	0x080c, 0x5ffe, 0x080c, 0x5fe1, 0x11b8, 0x7084, 0x9005, 0x11a0,
+	0x7164, 0x9186, 0xffff, 0x0180, 0x9180, 0x3368, 0x200d, 0x918c,
+	0xff00, 0x810f, 0x2011, 0x0008, 0x080c, 0x5e36, 0x0180, 0x080c,
+	0x4fdf, 0x0110, 0x080c, 0x267d, 0x20a9, 0x0008, 0x20e1, 0x0000,
+	0x2099, 0x026e, 0x20e9, 0x0000, 0x20a1, 0x024e, 0x4003, 0x60c3,
+	0x0014, 0x080c, 0x5eb3, 0x00fe, 0x0005, 0x00f6, 0x7090, 0x9005,
+	0x05f0, 0x2011, 0x5e89, 0x080c, 0x861d, 0x9086, 0x0014, 0x15a8,
+	0x080c, 0x5ffe, 0x2079, 0x0260, 0x7a30, 0x9296, 0x1105, 0x1568,
+	0x7834, 0x9084, 0x0100, 0x2011, 0x0100, 0x921e, 0x1168, 0x9085,
+	0x0001, 0x080c, 0x6029, 0x7a38, 0xd2fc, 0x0128, 0x70c4, 0x9005,
+	0x1110, 0x70c7, 0x0001, 0x0080, 0x9005, 0x11b8, 0x7a38, 0xd2fc,
+	0x0128, 0x70c4, 0x9005, 0x1110, 0x70c7, 0x0001, 0x9085, 0x0001,
+	0x080c, 0x6029, 0x7097, 0x0000, 0x7a38, 0xd2f4, 0x0110, 0x70df,
+	0x0008, 0x709b, 0x0016, 0x0029, 0x0010, 0x7093, 0x0000, 0x00fe,
+	0x0005, 0x080c, 0xa67d, 0x080c, 0x5ffe, 0x20e1, 0x0000, 0x2099,
+	0x0260, 0x20e9, 0x0000, 0x20a1, 0x0240, 0x20a9, 0x000e, 0x4003,
+	0x2011, 0x026d, 0x2204, 0x9084, 0x0100, 0x2011, 0x024d, 0x2012,
+	0x2011, 0x026e, 0x709b, 0x0017, 0x080c, 0x5fe1, 0x1150, 0x7084,
+	0x9005, 0x1138, 0x080c, 0x5da9, 0x1188, 0x9085, 0x0001, 0x080c,
+	0x267d, 0x20a9, 0x0008, 0x080c, 0x5ffe, 0x20e1, 0x0000, 0x2099,
 	0x026e, 0x20e9, 0x0000, 0x20a1, 0x024e, 0x4003, 0x60c3, 0x0014,
-	0x080c, 0x5eb8, 0x00fe, 0x0005, 0x00f6, 0x7090, 0x9005, 0x0500,
-	0x2011, 0x5e8e, 0x080c, 0x863e, 0x9086, 0x0014, 0x11b8, 0x080c,
-	0x6003, 0x2079, 0x0260, 0x7a30, 0x9296, 0x1104, 0x1178, 0x7834,
-	0x9005, 0x1160, 0x7a38, 0xd2fc, 0x0128, 0x70c4, 0x9005, 0x1110,
-	0x70c7, 0x0001, 0x709b, 0x0014, 0x0029, 0x0010, 0x7093, 0x0000,
-	0x00fe, 0x0005, 0x00f6, 0x709b, 0x0015, 0x080c, 0x5f95, 0x2079,
-	0x0240, 0x7833, 0x1104, 0x7837, 0x0000, 0x080c, 0x6003, 0x080c,
-	0x5fe6, 0x11b8, 0x7084, 0x9005, 0x11a0, 0x7164, 0x9186, 0xffff,
-	0x0180, 0x9180, 0x3374, 0x200d, 0x918c, 0xff00, 0x810f, 0x2011,
-	0x0008, 0x080c, 0x5e3b, 0x0180, 0x080c, 0x4fe4, 0x0110, 0x080c,
-	0x2664, 0x20a9, 0x0008, 0x20e1, 0x0000, 0x2099, 0x026e, 0x20e9,
-	0x0000, 0x20a1, 0x024e, 0x4003, 0x60c3, 0x0014, 0x080c, 0x5eb8,
-	0x00fe, 0x0005, 0x00f6, 0x7090, 0x9005, 0x05f0, 0x2011, 0x5e8e,
-	0x080c, 0x863e, 0x9086, 0x0014, 0x15a8, 0x080c, 0x6003, 0x2079,
-	0x0260, 0x7a30, 0x9296, 0x1105, 0x1568, 0x7834, 0x9084, 0x0100,
-	0x2011, 0x0100, 0x921e, 0x1168, 0x9085, 0x0001, 0x080c, 0x602e,
-	0x7a38, 0xd2fc, 0x0128, 0x70c4, 0x9005, 0x1110, 0x70c7, 0x0001,
-	0x0080, 0x9005, 0x11b8, 0x7a38, 0xd2fc, 0x0128, 0x70c4, 0x9005,
-	0x1110, 0x70c7, 0x0001, 0x9085, 0x0001, 0x080c, 0x602e, 0x7097,
-	0x0000, 0x7a38, 0xd2f4, 0x0110, 0x70df, 0x0008, 0x709b, 0x0016,
-	0x0029, 0x0010, 0x7093, 0x0000, 0x00fe, 0x0005, 0x080c, 0xa690,
-	0x080c, 0x6003, 0x20e1, 0x0000, 0x2099, 0x0260, 0x20e9, 0x0000,
-	0x20a1, 0x0240, 0x20a9, 0x000e, 0x4003, 0x2011, 0x026d, 0x2204,
-	0x9084, 0x0100, 0x2011, 0x024d, 0x2012, 0x2011, 0x026e, 0x709b,
-	0x0017, 0x080c, 0x5fe6, 0x1150, 0x7084, 0x9005, 0x1138, 0x080c,
-	0x5dae, 0x1188, 0x9085, 0x0001, 0x080c, 0x2664, 0x20a9, 0x0008,
-	0x080c, 0x6003, 0x20e1, 0x0000, 0x2099, 0x026e, 0x20e9, 0x0000,
-	0x20a1, 0x024e, 0x4003, 0x60c3, 0x0014, 0x080c, 0x5eb8, 0x0010,
-	0x080c, 0x5908, 0x0005, 0x00f6, 0x7090, 0x9005, 0x01d8, 0x2011,
-	0x5e8e, 0x080c, 0x863e, 0x9086, 0x0084, 0x1190, 0x080c, 0x6003,
-	0x2079, 0x0260, 0x7a30, 0x9296, 0x1106, 0x1150, 0x7834, 0x9005,
-	0x1138, 0x9006, 0x080c, 0x602e, 0x709b, 0x0018, 0x0029, 0x0010,
-	0x7093, 0x0000, 0x00fe, 0x0005, 0x00f6, 0x709b, 0x0019, 0x080c,
-	0x5f95, 0x2079, 0x0240, 0x7833, 0x1106, 0x7837, 0x0000, 0x080c,
-	0x6003, 0x2009, 0x026e, 0x2039, 0x1d0e, 0x20a9, 0x0040, 0x213e,
-	0x8738, 0x8108, 0x9186, 0x0280, 0x1128, 0x6814, 0x8000, 0x6816,
-	0x2009, 0x0260, 0x1f04, 0x5d17, 0x2039, 0x1d0e, 0x080c, 0x5fe6,
-	0x11e8, 0x2728, 0x2514, 0x8207, 0x9084, 0x00ff, 0x8000, 0x2018,
-	0x9294, 0x00ff, 0x8007, 0x9205, 0x202a, 0x7060, 0x2310, 0x8214,
-	0x92a0, 0x1d0e, 0x2414, 0x938c, 0x0001, 0x0118, 0x9294, 0xff00,
-	0x0018, 0x9294, 0x00ff, 0x8007, 0x9215, 0x2222, 0x20a9, 0x0040,
-	0x2009, 0x024e, 0x270e, 0x8738, 0x8108, 0x9186, 0x0260, 0x1128,
-	0x6810, 0x8000, 0x6812, 0x2009, 0x0240, 0x1f04, 0x5d4a, 0x60c3,
-	0x0084, 0x080c, 0x5eb8, 0x00fe, 0x0005, 0x00f6, 0x7090, 0x9005,
-	0x01e0, 0x2011, 0x5e8e, 0x080c, 0x863e, 0x9086, 0x0084, 0x1198,
-	0x080c, 0x6003, 0x2079, 0x0260, 0x7a30, 0x9296, 0x1107, 0x1158,
-	0x7834, 0x9005, 0x1140, 0x7097, 0x0001, 0x080c, 0x5f59, 0x709b,
-	0x001a, 0x0029, 0x0010, 0x7093, 0x0000, 0x00fe, 0x0005, 0x9085,
-	0x0001, 0x080c, 0x602e, 0x709b, 0x001b, 0x080c, 0xa690, 0x080c,
-	0x6003, 0x2011, 0x0260, 0x2009, 0x0240, 0x7490, 0x9480, 0x0018,
-	0x9080, 0x0007, 0x9084, 0x03f8, 0x8004, 0x20a8, 0x220e, 0x8210,
-	0x8108, 0x9186, 0x0260, 0x1150, 0x6810, 0x8000, 0x6812, 0x2009,
-	0x0240, 0x6814, 0x8000, 0x6816, 0x2011, 0x0260, 0x1f04, 0x5d96,
-	0x60c3, 0x0084, 0x080c, 0x5eb8, 0x0005, 0x0005, 0x0086, 0x0096,
-	0x2029, 0x1848, 0x252c, 0x20a9, 0x0008, 0x2041, 0x1d0e, 0x20e9,
-	0x0001, 0x28a0, 0x080c, 0x6003, 0x20e1, 0x0000, 0x2099, 0x026e,
-	0x4003, 0x20a9, 0x0008, 0x2011, 0x0007, 0xd5d4, 0x0108, 0x9016,
-	0x2800, 0x9200, 0x200c, 0x91a6, 0xffff, 0x1148, 0xd5d4, 0x0110,
-	0x8210, 0x0008, 0x8211, 0x1f04, 0x5dc8, 0x0804, 0x5e37, 0x82ff,
-	0x1160, 0xd5d4, 0x0120, 0x91a6, 0x3fff, 0x0d90, 0x0020, 0x91a6,
-	0x3fff, 0x0904, 0x5e37, 0x918d, 0xc000, 0x20a9, 0x0010, 0x2019,
-	0x0001, 0xd5d4, 0x0110, 0x2019, 0x0010, 0x2120, 0xd5d4, 0x0110,
-	0x8423, 0x0008, 0x8424, 0x1240, 0xd5d4, 0x0110, 0x8319, 0x0008,
-	0x8318, 0x1f04, 0x5dee, 0x04d8, 0x23a8, 0x2021, 0x0001, 0x8426,
-	0x8425, 0x1f04, 0x5e00, 0x2328, 0x8529, 0x92be, 0x0007, 0x0158,
-	0x0006, 0x2039, 0x0007, 0x2200, 0x973a, 0x000e, 0x27a8, 0x95a8,
-	0x0010, 0x1f04, 0x5e0f, 0x755e, 0x95c8, 0x3374, 0x292d, 0x95ac,
-	0x00ff, 0x7582, 0x6532, 0x6536, 0x0016, 0x2508, 0x080c, 0x2644,
-	0x001e, 0x60e7, 0x0000, 0x65ea, 0x2018, 0x2304, 0x9405, 0x201a,
-	0x7087, 0x0001, 0x20e9, 0x0000, 0x20a1, 0x024e, 0x20e1, 0x0001,
-	0x2898, 0x20a9, 0x0008, 0x4003, 0x9085, 0x0001, 0x0008, 0x9006,
-	0x009e, 0x008e, 0x0005, 0x0156, 0x01c6, 0x01d6, 0x0136, 0x0146,
-	0x22a8, 0x20e1, 0x0000, 0x2099, 0x026e, 0x20e9, 0x0000, 0x2011,
-	0x024e, 0x22a0, 0x4003, 0x014e, 0x013e, 0x01de, 0x01ce, 0x015e,
-	0x2118, 0x9026, 0x2001, 0x0007, 0x939a, 0x0010, 0x0218, 0x8420,
-	0x8001, 0x0cd0, 0x2118, 0x84ff, 0x0120, 0x939a, 0x0010, 0x8421,
-	0x1de0, 0x2021, 0x0001, 0x83ff, 0x0118, 0x8423, 0x8319, 0x1de8,
-	0x9238, 0x2029, 0x026e, 0x9528, 0x2504, 0x942c, 0x11b8, 0x9405,
-	0x203a, 0x715e, 0x91a0, 0x3374, 0x242d, 0x95ac, 0x00ff, 0x7582,
-	0x6532, 0x6536, 0x0016, 0x2508, 0x080c, 0x2644, 0x001e, 0x60e7,
-	0x0000, 0x65ea, 0x7087, 0x0001, 0x9084, 0x0000, 0x0005, 0x00e6,
-	0x2071, 0x1800, 0x708b, 0x0000, 0x00ee, 0x0005, 0x00e6, 0x00f6,
-	0x2079, 0x0100, 0x2071, 0x0140, 0x080c, 0x5f48, 0x080c, 0x9e32,
-	0x7004, 0x9084, 0x4000, 0x0110, 0x080c, 0x2a1a, 0x0126, 0x2091,
-	0x8000, 0x2071, 0x1826, 0x2073, 0x0000, 0x7840, 0x0026, 0x0016,
-	0x2009, 0x00f7, 0x080c, 0x5fa5, 0x001e, 0x9094, 0x0010, 0x9285,
-	0x0080, 0x7842, 0x7a42, 0x002e, 0x012e, 0x00fe, 0x00ee, 0x0005,
-	0x0126, 0x2091, 0x8000, 0x080c, 0x2979, 0x0228, 0x2011, 0x0101,
-	0x2204, 0xc0c5, 0x2012, 0x2011, 0x19f4, 0x2013, 0x0000, 0x7093,
-	0x0000, 0x012e, 0x60a3, 0x0056, 0x60a7, 0x9575, 0x080c, 0x9e25,
-	0x6144, 0xd184, 0x0120, 0x7198, 0x918d, 0x2000, 0x0018, 0x718c,
-	0x918d, 0x1000, 0x2011, 0x1999, 0x2112, 0x2009, 0x07d0, 0x2011,
-	0x5e8e, 0x080c, 0x8708, 0x0005, 0x0016, 0x0026, 0x00c6, 0x0126,
-	0x2091, 0x8000, 0x080c, 0xa896, 0x080c, 0xab5e, 0x080c, 0xa8b2,
-	0x2009, 0x00f7, 0x080c, 0x5fa5, 0x2061, 0x1a03, 0x900e, 0x611a,
-	0x611e, 0x6172, 0x6176, 0x2061, 0x1800, 0x6003, 0x0001, 0x2061,
-	0x0100, 0x6043, 0x0090, 0x6043, 0x0010, 0x2009, 0x1999, 0x200b,
-	0x0000, 0x2009, 0x002d, 0x2011, 0x5f14, 0x080c, 0x8632, 0x012e,
-	0x00ce, 0x002e, 0x001e, 0x0005, 0x00e6, 0x0006, 0x0126, 0x2091,
-	0x8000, 0x0471, 0x2071, 0x0100, 0x080c, 0x9e32, 0x2071, 0x0140,
-	0x7004, 0x9084, 0x4000, 0x0110, 0x080c, 0x2a1a, 0x080c, 0x74f1,
-	0x0188, 0x080c, 0x750c, 0x1170, 0x080c, 0x77f7, 0x0016, 0x080c,
-	0x2713, 0x2001, 0x196d, 0x2102, 0x001e, 0x080c, 0x77f2, 0x080c,
-	0x741a, 0x0050, 0x2009, 0x0001, 0x080c, 0x29f6, 0x2001, 0x0001,
-	0x080c, 0x25a0, 0x080c, 0x5ee4, 0x012e, 0x000e, 0x00ee, 0x0005,
-	0x2001, 0x180e, 0x2004, 0xd0bc, 0x0158, 0x0026, 0x0036, 0x2011,
-	0x8017, 0x2001, 0x1999, 0x201c, 0x080c, 0x4b07, 0x003e, 0x002e,
-	0x0005, 0x20a9, 0x0012, 0x20e9, 0x0001, 0x20a1, 0x1d80, 0x080c,
-	0x6003, 0x20e9, 0x0000, 0x2099, 0x026e, 0x0099, 0x20a9, 0x0020,
-	0x080c, 0x5ffd, 0x2099, 0x0260, 0x20a1, 0x1d92, 0x0051, 0x20a9,
-	0x000e, 0x080c, 0x6000, 0x2099, 0x0260, 0x20a1, 0x1db2, 0x0009,
-	0x0005, 0x0016, 0x0026, 0x3410, 0x3308, 0x2104, 0x8007, 0x2012,
-	0x8108, 0x8210, 0x1f04, 0x5f7d, 0x002e, 0x001e, 0x0005, 0x080c,
-	0xa690, 0x20e1, 0x0001, 0x2099, 0x1d00, 0x20e9, 0x0000, 0x20a1,
-	0x0240, 0x20a9, 0x000c, 0x4003, 0x0005, 0x080c, 0xa690, 0x080c,
-	0x6003, 0x20e1, 0x0000, 0x2099, 0x0260, 0x20e9, 0x0000, 0x20a1,
-	0x0240, 0x20a9, 0x000c, 0x4003, 0x0005, 0x00c6, 0x0006, 0x2061,
-	0x0100, 0x810f, 0x2001, 0x1834, 0x2004, 0x9005, 0x1138, 0x2001,
-	0x1818, 0x2004, 0x9084, 0x00ff, 0x9105, 0x0010, 0x9185, 0x00f7,
-	0x604a, 0x000e, 0x00ce, 0x0005, 0x0016, 0x0046, 0x080c, 0x6a67,
-	0x0158, 0x9006, 0x2020, 0x2009, 0x002a, 0x080c, 0xe2c9, 0x2001,
-	0x180c, 0x200c, 0xc195, 0x2102, 0x2019, 0x002a, 0x900e, 0x080c,
-	0x31a6, 0x080c, 0xcf52, 0x0140, 0x0036, 0x2019, 0xffff, 0x2021,
-	0x0007, 0x080c, 0x4cbe, 0x003e, 0x004e, 0x001e, 0x0005, 0x080c,
-	0x5ee4, 0x709b, 0x0000, 0x7093, 0x0000, 0x0005, 0x0006, 0x2001,
-	0x180c, 0x2004, 0xd09c, 0x0100, 0x000e, 0x0005, 0x0006, 0x0016,
-	0x0126, 0x2091, 0x8000, 0x2001, 0x0101, 0x200c, 0x918d, 0x0006,
-	0x2102, 0x012e, 0x001e, 0x000e, 0x0005, 0x2009, 0x0001, 0x0020,
-	0x2009, 0x0002, 0x0008, 0x900e, 0x6814, 0x9084, 0xffc0, 0x910d,
-	0x6916, 0x0005, 0x00f6, 0x0156, 0x0146, 0x01d6, 0x9006, 0x20a9,
-	0x0080, 0x20e9, 0x0001, 0x20a1, 0x1d00, 0x4004, 0x2079, 0x1d00,
-	0x7803, 0x2200, 0x7807, 0x00ef, 0x780f, 0x00ef, 0x7813, 0x0138,
-	0x7823, 0xffff, 0x7827, 0xffff, 0x01de, 0x014e, 0x015e, 0x00fe,
-	0x0005, 0x2001, 0x1800, 0x2003, 0x0001, 0x0005, 0x2001, 0x19a6,
-	0x0118, 0x2003, 0x0001, 0x0010, 0x2003, 0x0000, 0x0005, 0x0156,
-	0x20a9, 0x0800, 0x2009, 0x1000, 0x9006, 0x200a, 0x8108, 0x1f04,
-	0x603d, 0x015e, 0x0005, 0x00d6, 0x0036, 0x0156, 0x0136, 0x0146,
-	0x2069, 0x1847, 0x9006, 0xb802, 0xb8d6, 0xb807, 0x0707, 0xb80a,
-	0xb80e, 0xb812, 0x9198, 0x3374, 0x231d, 0x939c, 0x00ff, 0xbb16,
-	0x0016, 0x0026, 0xb886, 0x080c, 0xab57, 0x1120, 0x9192, 0x007e,
-	0x1208, 0xbb86, 0x20a9, 0x0004, 0xb8c4, 0x20e8, 0xb9c8, 0x9198,
-	0x0006, 0x9006, 0x23a0, 0x4004, 0x20a9, 0x0004, 0x9198, 0x000a,
-	0x23a0, 0x4004, 0x002e, 0x001e, 0xb83e, 0xb842, 0xb8ce, 0xb8d2,
-	0xb85e, 0xb862, 0xb866, 0xb86a, 0xb86f, 0x0100, 0xb872, 0xb876,
-	0xb87a, 0xb88a, 0xb88e, 0xb893, 0x0008, 0xb896, 0xb89a, 0xb89e,
-	0xb8be, 0xb9a2, 0x0096, 0xb8a4, 0x904d, 0x0110, 0x080c, 0x106c,
-	0xb8a7, 0x0000, 0x009e, 0x9006, 0xb84a, 0x6810, 0xb83a, 0x680c,
-	0xb846, 0xb8bb, 0x0520, 0xb8ac, 0x9005, 0x0198, 0x00c6, 0x2060,
-	0x9c82, 0x1ddc, 0x0a0c, 0x0d7d, 0x2001, 0x181a, 0x2004, 0x9c02,
-	0x1a0c, 0x0d7d, 0x080c, 0x8b90, 0x00ce, 0x090c, 0x8f34, 0xb8af,
-	0x0000, 0x6814, 0x9084, 0x00ff, 0xb842, 0x014e, 0x013e, 0x015e,
-	0x003e, 0x00de, 0x0005, 0x0126, 0x2091, 0x8000, 0xa974, 0xae78,
-	0x9684, 0x3fff, 0x9082, 0x4000, 0x1a04, 0x6119, 0x9182, 0x0800,
-	0x1a04, 0x611d, 0x2001, 0x180c, 0x2004, 0x9084, 0x0003, 0x1904,
-	0x6123, 0x9188, 0x1000, 0x2104, 0x905d, 0x0198, 0xb804, 0x9084,
-	0x00ff, 0x908e, 0x0006, 0x1188, 0xb8a4, 0x900d, 0x1904, 0x6135,
-	0x080c, 0x64ee, 0x9006, 0x012e, 0x0005, 0x2001, 0x0005, 0x900e,
-	0x04b8, 0x2001, 0x0028, 0x900e, 0x0498, 0x9082, 0x0006, 0x1290,
-	0x080c, 0xab57, 0x1160, 0xb8a0, 0x9084, 0xff80, 0x1140, 0xb900,
-	0xd1fc, 0x0d10, 0x2001, 0x0029, 0x2009, 0x1000, 0x0408, 0x2001,
-	0x0028, 0x00a8, 0x2009, 0x180c, 0x210c, 0xd18c, 0x0118, 0x2001,
-	0x0004, 0x0068, 0xd184, 0x0118, 0x2001, 0x0004, 0x0040, 0x2001,
-	0x0029, 0xb900, 0xd1fc, 0x0118, 0x2009, 0x1000, 0x0048, 0x900e,
-	0x0038, 0x2001, 0x0029, 0x900e, 0x0018, 0x2001, 0x0029, 0x900e,
-	0x9005, 0x012e, 0x0005, 0x2001, 0x180c, 0x2004, 0xd084, 0x19d0,
-	0x9188, 0x1000, 0x2104, 0x9065, 0x09a8, 0x080c, 0x6a6b, 0x1990,
-	0xb800, 0xd0bc, 0x0978, 0x0804, 0x60dc, 0x080c, 0x6890, 0x0904,
-	0x60e5, 0x0804, 0x60e0, 0x00e6, 0x2071, 0x19e7, 0x7004, 0x9086,
-	0x0002, 0x1128, 0x7030, 0x9080, 0x0004, 0x2004, 0x9b06, 0x00ee,
-	0x0005, 0x00b6, 0x00e6, 0x0126, 0x2091, 0x8000, 0xa874, 0x908e,
-	0x00ff, 0x1120, 0x2001, 0x196b, 0x205c, 0x0060, 0xa974, 0x9182,
-	0x0800, 0x1690, 0x9188, 0x1000, 0x2104, 0x905d, 0x01d0, 0x080c,
-	0x6a0b, 0x11d0, 0x080c, 0xab97, 0x0570, 0x2b00, 0x6012, 0x2900,
-	0x6016, 0x6023, 0x0009, 0x602b, 0x0000, 0xa874, 0x908e, 0x00ff,
-	0x1110, 0x602b, 0x8000, 0x2009, 0x0043, 0x080c, 0xac8c, 0x9006,
-	0x00b0, 0x2001, 0x0028, 0x0090, 0x2009, 0x180c, 0x210c, 0xd18c,
-	0x0118, 0x2001, 0x0004, 0x0038, 0xd184, 0x0118, 0x2001, 0x0004,
-	0x0010, 0x2001, 0x0029, 0x0010, 0x2001, 0x0029, 0x9005, 0x012e,
-	0x00ee, 0x00be, 0x0005, 0x2001, 0x002c, 0x0cc0, 0x00b6, 0x00e6,
-	0x0126, 0x2091, 0x8000, 0xa974, 0x9182, 0x0800, 0x1a04, 0x6211,
-	0x9188, 0x1000, 0x2104, 0x905d, 0x0904, 0x61e9, 0xb8a0, 0x9086,
-	0x007f, 0x0178, 0x080c, 0x6a73, 0x0160, 0xa994, 0x81ff, 0x0130,
-	0x908e, 0x0004, 0x0130, 0x908e, 0x0005, 0x0118, 0x080c, 0x6a6b,
-	0x1598, 0xa87c, 0xd0fc, 0x01e0, 0xa894, 0x9005, 0x01c8, 0x2060,
-	0x0026, 0x2010, 0x080c, 0xc826, 0x002e, 0x1120, 0x2001, 0x0008,
-	0x0804, 0x6213, 0x6020, 0x9086, 0x000a, 0x0120, 0x2001, 0x0008,
-	0x0804, 0x6213, 0x601a, 0x6003, 0x0008, 0x2900, 0x6016, 0x0058,
-	0x080c, 0xab97, 0x05e8, 0x2b00, 0x6012, 0x2900, 0x6016, 0x600b,
-	0xffff, 0x6023, 0x000a, 0x2009, 0x0003, 0x080c, 0xac8c, 0x9006,
-	0x0458, 0x2001, 0x0028, 0x0438, 0x9082, 0x0006, 0x1290, 0x080c,
-	0xab57, 0x1160, 0xb8a0, 0x9084, 0xff80, 0x1140, 0xb900, 0xd1fc,
-	0x0900, 0x2001, 0x0029, 0x2009, 0x1000, 0x00a8, 0x2001, 0x0028,
-	0x0090, 0x2009, 0x180c, 0x210c, 0xd18c, 0x0118, 0x2001, 0x0004,
-	0x0050, 0xd184, 0x0118, 0x2001, 0x0004, 0x0028, 0x2001, 0x0029,
-	0x0010, 0x2001, 0x0029, 0x9005, 0x012e, 0x00ee, 0x00be, 0x0005,
-	0x2001, 0x002c, 0x0cc0, 0x00f6, 0x00b6, 0x0126, 0x2091, 0x8000,
-	0xa8e0, 0x9005, 0x1550, 0xa8dc, 0x9082, 0x0101, 0x1630, 0xa8c8,
-	0x9005, 0x1518, 0xa8c4, 0x9082, 0x0101, 0x12f8, 0xa974, 0x2079,
-	0x1800, 0x9182, 0x0800, 0x12e8, 0x7830, 0x9084, 0x0003, 0x1130,
-	0xaa98, 0xab94, 0xa878, 0x9084, 0x0007, 0x00ea, 0x7930, 0xd18c,
-	0x0118, 0x2001, 0x0004, 0x0038, 0xd184, 0x0118, 0x2001, 0x0004,
-	0x0010, 0x2001, 0x0029, 0x900e, 0x0038, 0x2001, 0x002c, 0x900e,
-	0x0018, 0x2001, 0x0029, 0x900e, 0x9006, 0x0008, 0x9005, 0x012e,
-	0x00be, 0x00fe, 0x0005, 0x62a8, 0x6263, 0x627a, 0x62a8, 0x62a8,
-	0x62a8, 0x62a8, 0x62a8, 0x2100, 0x9082, 0x007e, 0x1278, 0x080c,
-	0x65c4, 0x0148, 0x9046, 0xb810, 0x9306, 0x1904, 0x62b0, 0xb814,
-	0x9206, 0x15f0, 0x0028, 0xbb12, 0xba16, 0x0010, 0x080c, 0x49ba,
-	0x0150, 0x04b0, 0x080c, 0x6625, 0x1598, 0xb810, 0x9306, 0x1580,
-	0xb814, 0x9206, 0x1568, 0x080c, 0xab97, 0x0530, 0x2b00, 0x6012,
-	0x080c, 0xcccc, 0x2900, 0x6016, 0x600b, 0xffff, 0x6023, 0x000a,
-	0xa878, 0x9086, 0x0001, 0x1170, 0x080c, 0x31e7, 0x9006, 0x080c,
-	0x6561, 0x2001, 0x0002, 0x080c, 0x6575, 0x2001, 0x0200, 0xb86e,
-	0xb893, 0x0002, 0x2009, 0x0003, 0x080c, 0xac8c, 0x9006, 0x0068,
-	0x2001, 0x0001, 0x900e, 0x0038, 0x2001, 0x002c, 0x900e, 0x0018,
-	0x2001, 0x0028, 0x900e, 0x9005, 0x0000, 0x012e, 0x00be, 0x00fe,
-	0x0005, 0x00b6, 0x00f6, 0x00e6, 0x0126, 0x2091, 0x8000, 0xa894,
-	0x90c6, 0x0015, 0x0904, 0x6497, 0x90c6, 0x0056, 0x0904, 0x649b,
-	0x90c6, 0x0066, 0x0904, 0x649f, 0x90c6, 0x0067, 0x0904, 0x64a3,
-	0x90c6, 0x0068, 0x0904, 0x64a7, 0x90c6, 0x0071, 0x0904, 0x64ab,
-	0x90c6, 0x0074, 0x0904, 0x64af, 0x90c6, 0x007c, 0x0904, 0x64b3,
-	0x90c6, 0x007e, 0x0904, 0x64b7, 0x90c6, 0x0037, 0x0904, 0x64bb,
-	0x9016, 0x2079, 0x1800, 0xa974, 0x9186, 0x00ff, 0x0904, 0x6492,
-	0x9182, 0x0800, 0x1a04, 0x6492, 0x080c, 0x6625, 0x1198, 0xb804,
-	0x9084, 0x00ff, 0x9082, 0x0006, 0x1268, 0xa894, 0x90c6, 0x006f,
-	0x0148, 0x080c, 0xab57, 0x1904, 0x647b, 0xb8a0, 0x9084, 0xff80,
-	0x1904, 0x647b, 0xa894, 0x90c6, 0x006f, 0x0158, 0x90c6, 0x005e,
-	0x0904, 0x63db, 0x90c6, 0x0064, 0x0904, 0x6404, 0x2008, 0x0804,
-	0x639d, 0xa998, 0xa8b0, 0x2040, 0x080c, 0xab57, 0x1120, 0x9182,
-	0x007f, 0x0a04, 0x639d, 0x9186, 0x00ff, 0x0904, 0x639d, 0x9182,
-	0x0800, 0x1a04, 0x639d, 0xaaa0, 0xab9c, 0x787c, 0x9306, 0x1188,
-	0x7880, 0x0096, 0x924e, 0x1128, 0x2208, 0x2310, 0x009e, 0x0804,
-	0x639d, 0x99cc, 0xff00, 0x009e, 0x1120, 0x2208, 0x2310, 0x0804,
-	0x639d, 0x080c, 0x49ba, 0x0904, 0x63a7, 0x900e, 0x9016, 0x90c6,
-	0x4000, 0x15e0, 0x0006, 0x080c, 0x6914, 0x1108, 0xc185, 0xb800,
-	0xd0bc, 0x0108, 0xc18d, 0x20a9, 0x0004, 0xa860, 0x20e8, 0xa85c,
-	0x9080, 0x0031, 0x20a0, 0xb8c4, 0x20e0, 0xb8c8, 0x9080, 0x0006,
-	0x2098, 0x080c, 0x0fb7, 0x20a9, 0x0004, 0xa860, 0x20e8, 0xa85c,
-	0x9080, 0x0035, 0x20a0, 0xb8c4, 0x20e0, 0xb8c8, 0x9080, 0x000a,
-	0x2098, 0x080c, 0x0fb7, 0xa8c4, 0xabc8, 0x9305, 0xabcc, 0x9305,
-	0xabd0, 0x9305, 0xabd4, 0x9305, 0xabd8, 0x9305, 0xabdc, 0x9305,
-	0xabe0, 0x9305, 0x9005, 0x0510, 0x000e, 0x00c8, 0x90c6, 0x4007,
-	0x1110, 0x2408, 0x00a0, 0x90c6, 0x4008, 0x1118, 0x2708, 0x2610,
-	0x0070, 0x90c6, 0x4009, 0x1108, 0x0050, 0x90c6, 0x4006, 0x0138,
-	0x2001, 0x4005, 0x2009, 0x000a, 0x0010, 0x2001, 0x4006, 0xa896,
-	0xa99a, 0xaa9e, 0x2001, 0x0030, 0x900e, 0x0478, 0x000e, 0x080c,
-	0xab97, 0x1130, 0x2001, 0x4005, 0x2009, 0x0003, 0x9016, 0x0c78,
-	0x2b00, 0x6012, 0x080c, 0xcccc, 0x2900, 0x6016, 0x6023, 0x0001,
-	0xa868, 0xd88c, 0x0108, 0xc0f5, 0xa86a, 0x0126, 0x2091, 0x8000,
-	0x080c, 0x31e7, 0x012e, 0x9006, 0x080c, 0x6561, 0x2001, 0x0002,
-	0x080c, 0x6575, 0x2009, 0x0002, 0x080c, 0xac8c, 0xa8b0, 0xd094,
-	0x0118, 0xb8d4, 0xc08d, 0xb8d6, 0x9006, 0x9005, 0x012e, 0x00ee,
-	0x00fe, 0x00be, 0x0005, 0x080c, 0x56ee, 0x0118, 0x2009, 0x0007,
-	0x00f8, 0xa998, 0xaeb0, 0x080c, 0x6625, 0x1904, 0x6398, 0x9186,
-	0x007f, 0x0130, 0x080c, 0x6a6b, 0x0118, 0x2009, 0x0009, 0x0080,
-	0x0096, 0x080c, 0x103a, 0x1120, 0x009e, 0x2009, 0x0002, 0x0040,
-	0x2900, 0x009e, 0xa806, 0x080c, 0xca24, 0x19b0, 0x2009, 0x0003,
-	0x2001, 0x4005, 0x0804, 0x639f, 0xa998, 0xaeb0, 0x080c, 0x6625,
-	0x1904, 0x6398, 0x0096, 0x080c, 0x103a, 0x1128, 0x009e, 0x2009,
-	0x0002, 0x0804, 0x6458, 0x2900, 0x009e, 0xa806, 0x0096, 0x2048,
-	0x20a9, 0x002b, 0xb8c4, 0x20e0, 0xb8c8, 0x2098, 0xa860, 0x20e8,
-	0xa85c, 0x9080, 0x0002, 0x20a0, 0x4003, 0x20a9, 0x0008, 0x9080,
-	0x0006, 0x20a0, 0xbbc8, 0x9398, 0x0006, 0x2398, 0x080c, 0x0fb7,
-	0x009e, 0xa87b, 0x0000, 0xa883, 0x0000, 0xa897, 0x4000, 0xd684,
-	0x1168, 0x080c, 0x56da, 0xd0b4, 0x1118, 0xa89b, 0x000b, 0x00e0,
-	0xb800, 0xd08c, 0x0118, 0xa89b, 0x000c, 0x00b0, 0x080c, 0x6a6b,
-	0x0118, 0xa89b, 0x0009, 0x0080, 0x080c, 0x56ee, 0x0118, 0xa89b,
-	0x0007, 0x0050, 0x080c, 0xca07, 0x1904, 0x63d4, 0x2009, 0x0003,
-	0x2001, 0x4005, 0x0804, 0x639f, 0xa87b, 0x0030, 0xa897, 0x4005,
-	0xa804, 0x8006, 0x8006, 0x8007, 0x90bc, 0x003f, 0x9084, 0xffc0,
-	0x9080, 0x0002, 0x2009, 0x002b, 0xaaa0, 0xab9c, 0xaca8, 0xada4,
-	0x2031, 0x0000, 0x2041, 0x127e, 0x080c, 0xb112, 0x1904, 0x63d4,
-	0x2009, 0x0002, 0x08e8, 0x2001, 0x0028, 0x900e, 0x0804, 0x63d5,
-	0x2009, 0x180c, 0x210c, 0xd18c, 0x0118, 0x2001, 0x0004, 0x0038,
-	0xd184, 0x0118, 0x2001, 0x0004, 0x0010, 0x2001, 0x0029, 0x900e,
-	0x0804, 0x63d5, 0x2001, 0x0029, 0x900e, 0x0804, 0x63d5, 0x080c,
-	0x3797, 0x0804, 0x63d6, 0x080c, 0x540f, 0x0804, 0x63d6, 0x080c,
-	0x4573, 0x0804, 0x63d6, 0x080c, 0x45ec, 0x0804, 0x63d6, 0x080c,
-	0x4648, 0x0804, 0x63d6, 0x080c, 0x4a7d, 0x0804, 0x63d6, 0x080c,
-	0x4d34, 0x0804, 0x63d6, 0x080c, 0x507a, 0x0804, 0x63d6, 0x080c,
-	0x5273, 0x0804, 0x63d6, 0x080c, 0x39b5, 0x0804, 0x63d6, 0x00b6,
-	0xa974, 0xae78, 0x9684, 0x3fff, 0x9082, 0x4000, 0x1608, 0x9182,
-	0x0800, 0x1258, 0x9188, 0x1000, 0x2104, 0x905d, 0x0130, 0x080c,
-	0x6a6b, 0x1138, 0x00d9, 0x9006, 0x00b0, 0x2001, 0x0028, 0x900e,
-	0x0090, 0x9082, 0x0006, 0x1240, 0xb900, 0xd1fc, 0x0d98, 0x2001,
-	0x0029, 0x2009, 0x1000, 0x0038, 0x2001, 0x0029, 0x900e, 0x0018,
-	0x2001, 0x0029, 0x900e, 0x9005, 0x00be, 0x0005, 0xa877, 0x0000,
-	0xb8d0, 0x9005, 0x1904, 0x6555, 0xb888, 0x9005, 0x1904, 0x6555,
-	0xb838, 0xb93c, 0x9102, 0x1a04, 0x6555, 0x2b10, 0x080c, 0xabc4,
-	0x0904, 0x6551, 0x8108, 0xb93e, 0x6212, 0x2900, 0x6016, 0x6023,
-	0x0003, 0x600b, 0xffff, 0x6007, 0x0040, 0xa878, 0x605e, 0xa880,
-	0x9084, 0x00ff, 0x6066, 0xa883, 0x0000, 0xa87c, 0xd0ac, 0x0588,
-	0xc0dd, 0xa87e, 0xa888, 0x8001, 0x1530, 0xa816, 0xa864, 0x9094,
-	0x00f7, 0x9296, 0x0011, 0x11f8, 0x9084, 0x00ff, 0xc0bd, 0x601e,
-	0xa8ac, 0xaab0, 0xa836, 0xaa3a, 0x2001, 0x000f, 0x8001, 0x1df0,
-	0x2001, 0x8004, 0x6003, 0x0004, 0x6046, 0x00f6, 0x2079, 0x0380,
-	0x7818, 0xd0bc, 0x1de8, 0x7833, 0x0010, 0x2c00, 0x7836, 0x781b,
-	0x8080, 0x00fe, 0x0005, 0x080c, 0x1731, 0x601c, 0xc0bd, 0x601e,
-	0x0c38, 0xd0b4, 0x190c, 0x1c30, 0x2001, 0x8004, 0x6003, 0x0002,
-	0x0c18, 0x81ff, 0x1110, 0xb88b, 0x0001, 0x2908, 0xb8cc, 0xb9ce,
-	0x9005, 0x1110, 0xb9d2, 0x0020, 0x0096, 0x2048, 0xa902, 0x009e,
-	0x0005, 0x00b6, 0x0126, 0x00c6, 0x0026, 0x2091, 0x8000, 0x6210,
-	0x2258, 0xba00, 0x9005, 0x0110, 0xc285, 0x0008, 0xc284, 0xba02,
-	0x002e, 0x00ce, 0x012e, 0x00be, 0x0005, 0x00b6, 0x0126, 0x00c6,
-	0x2091, 0x8000, 0x6210, 0x2258, 0xba04, 0x0006, 0x9086, 0x0006,
-	0x1170, 0xb89c, 0xd0ac, 0x0158, 0x080c, 0x6a67, 0x0140, 0x9284,
-	0xff00, 0x8007, 0x9086, 0x0007, 0x1110, 0x2011, 0x0600, 0x000e,
-	0x9294, 0xff00, 0x9215, 0xba06, 0x0006, 0x9086, 0x0006, 0x1120,
-	0xba90, 0x82ff, 0x090c, 0x0d7d, 0x000e, 0x00ce, 0x012e, 0x00be,
-	0x0005, 0x00b6, 0x0126, 0x00c6, 0x2091, 0x8000, 0x6210, 0x2258,
-	0xba04, 0x0006, 0x9086, 0x0006, 0x1168, 0xb89c, 0xd0a4, 0x0150,
-	0x080c, 0x6a63, 0x1138, 0x9284, 0x00ff, 0x9086, 0x0007, 0x1110,
-	0x2011, 0x0006, 0x000e, 0x9294, 0x00ff, 0x8007, 0x9215, 0xba06,
-	0x00ce, 0x012e, 0x00be, 0x0005, 0x9182, 0x0800, 0x0218, 0x9085,
-	0x0001, 0x0005, 0x00d6, 0x0026, 0x9190, 0x1000, 0x2204, 0x905d,
-	0x1188, 0x0096, 0x080c, 0x103a, 0x2958, 0x009e, 0x0168, 0x2b00,
-	0x2012, 0xb85c, 0xb8ca, 0xb860, 0xb8c6, 0x9006, 0xb8a6, 0xb8ae,
-	0x080c, 0x6043, 0x9006, 0x0010, 0x9085, 0x0001, 0x002e, 0x00de,
-	0x0005, 0x00b6, 0x0096, 0x0126, 0x2091, 0x8000, 0x0026, 0x9182,
-	0x0800, 0x0218, 0x9085, 0x0001, 0x0458, 0x00d6, 0x9190, 0x1000,
-	0x2204, 0x905d, 0x0518, 0x2013, 0x0000, 0xb8a4, 0x904d, 0x0110,
-	0x080c, 0x106c, 0x00d6, 0x00c6, 0xb8bc, 0x2060, 0x8cff, 0x0168,
-	0x600c, 0x0006, 0x6014, 0x2048, 0x080c, 0xc838, 0x0110, 0x080c,
-	0x0fec, 0x080c, 0xabed, 0x00ce, 0x0c88, 0x00ce, 0x00de, 0x2b48,
-	0xb8c8, 0xb85e, 0xb8c4, 0xb862, 0x080c, 0x107c, 0x00de, 0x9006,
-	0x002e, 0x012e, 0x009e, 0x00be, 0x0005, 0x0016, 0x9182, 0x0800,
-	0x0218, 0x9085, 0x0001, 0x0030, 0x9188, 0x1000, 0x2104, 0x905d,
-	0x0dc0, 0x9006, 0x001e, 0x0005, 0x00d6, 0x0156, 0x0136, 0x0146,
-	0x9006, 0xb80a, 0xb80e, 0xb800, 0xc08c, 0xb802, 0x080c, 0x74e9,
-	0x1510, 0xb8a0, 0x9086, 0x007e, 0x0120, 0x080c, 0xab57, 0x11d8,
-	0x0078, 0x7040, 0xd0e4, 0x01b8, 0x00c6, 0x2061, 0x1982, 0x7048,
-	0x2062, 0x704c, 0x6006, 0x7050, 0x600a, 0x7054, 0x600e, 0x00ce,
-	0x703c, 0x2069, 0x0140, 0x9005, 0x1110, 0x2001, 0x0001, 0x6886,
-	0x2069, 0x1800, 0x68b6, 0x7040, 0xb85e, 0x7048, 0xb862, 0x704c,
-	0xb866, 0x20e1, 0x0000, 0x2099, 0x0276, 0xb8c4, 0x20e8, 0xb8c8,
-	0x9088, 0x000a, 0x21a0, 0x20a9, 0x0004, 0x4003, 0x2099, 0x027a,
-	0x9088, 0x0006, 0x21a0, 0x20a9, 0x0004, 0x4003, 0x2069, 0x0200,
-	0x6817, 0x0001, 0x7040, 0xb86a, 0x7144, 0xb96e, 0x7048, 0xb872,
-	0x7050, 0xb876, 0x2069, 0x0200, 0x6817, 0x0000, 0xb8a0, 0x9086,
-	0x007e, 0x1110, 0x7144, 0xb96e, 0x9182, 0x0211, 0x1218, 0x2009,
-	0x0008, 0x0400, 0x9182, 0x0259, 0x1218, 0x2009, 0x0007, 0x00d0,
-	0x9182, 0x02c1, 0x1218, 0x2009, 0x0006, 0x00a0, 0x9182, 0x0349,
-	0x1218, 0x2009, 0x0005, 0x0070, 0x9182, 0x0421, 0x1218, 0x2009,
-	0x0004, 0x0040, 0x9182, 0x0581, 0x1218, 0x2009, 0x0003, 0x0010,
-	0x2009, 0x0002, 0xb992, 0x014e, 0x013e, 0x015e, 0x00de, 0x0005,
-	0x0016, 0x0026, 0x00e6, 0x2071, 0x0260, 0x7034, 0xb896, 0x703c,
-	0xb89a, 0x7054, 0xb89e, 0x0036, 0xbbd4, 0xc384, 0xba00, 0x2009,
-	0x1867, 0x210c, 0xd0bc, 0x0120, 0xd1ec, 0x0110, 0xc2ad, 0x0008,
-	0xc2ac, 0xd0c4, 0x0148, 0xd1e4, 0x0138, 0xc2bd, 0xd0cc, 0x0128,
-	0xd38c, 0x1108, 0xc385, 0x0008, 0xc2bc, 0xba02, 0xbbd6, 0x003e,
-	0x00ee, 0x002e, 0x001e, 0x0005, 0x0096, 0x0126, 0x2091, 0x8000,
-	0xb8a4, 0x904d, 0x0578, 0xa900, 0x81ff, 0x15c0, 0xaa04, 0x9282,
-	0x0010, 0x16c8, 0x0136, 0x0146, 0x01c6, 0x01d6, 0x8906, 0x8006,
-	0x8007, 0x908c, 0x003f, 0x21e0, 0x9084, 0xffc0, 0x9080, 0x0004,
-	0x2098, 0x2009, 0x0010, 0x20a9, 0x0001, 0x4002, 0x9086, 0xffff,
-	0x0120, 0x8109, 0x1dd0, 0x080c, 0x0d7d, 0x3c00, 0x20e8, 0x3300,
-	0x8001, 0x20a0, 0x4604, 0x8210, 0xaa06, 0x01de, 0x01ce, 0x014e,
-	0x013e, 0x0060, 0x080c, 0x103a, 0x0170, 0x2900, 0xb8a6, 0xa803,
-	0x0000, 0x080c, 0x68b0, 0xa807, 0x0001, 0xae12, 0x9085, 0x0001,
-	0x012e, 0x009e, 0x0005, 0x9006, 0x0cd8, 0x0126, 0x2091, 0x8000,
-	0x0096, 0xb8a4, 0x904d, 0x0188, 0xa800, 0x9005, 0x1150, 0x080c,
-	0x68bf, 0x1158, 0xa804, 0x908a, 0x0002, 0x0218, 0x8001, 0xa806,
-	0x0020, 0x080c, 0x106c, 0xb8a7, 0x0000, 0x009e, 0x012e, 0x0005,
-	0x0096, 0x00c6, 0xb888, 0x9005, 0x1904, 0x67a9, 0xb8d0, 0x904d,
-	0x0904, 0x67a9, 0x080c, 0xabc4, 0x0904, 0x67a5, 0x8210, 0xba3e,
-	0xa800, 0xb8d2, 0x9005, 0x1108, 0xb8ce, 0x2b00, 0x6012, 0x2900,
-	0x6016, 0x6023, 0x0003, 0x600b, 0xffff, 0x6007, 0x0040, 0xa878,
-	0x605e, 0xa880, 0x9084, 0x00ff, 0x6066, 0xa883, 0x0000, 0xa87c,
-	0xd0ac, 0x01c8, 0xc0dd, 0xa87e, 0xa888, 0x8001, 0x1568, 0xa816,
-	0xa864, 0x9094, 0x00f7, 0x9296, 0x0011, 0x1530, 0x9084, 0x00ff,
-	0xc0bd, 0x601e, 0xa8ac, 0xaab0, 0xa836, 0xaa3a, 0x2001, 0x8004,
-	0x6003, 0x0004, 0x0030, 0x080c, 0x1c30, 0x2001, 0x8004, 0x6003,
-	0x0002, 0x6046, 0x2001, 0x0010, 0x2c08, 0x080c, 0xa887, 0xb838,
-	0xba3c, 0x9202, 0x0a04, 0x6756, 0x0020, 0x82ff, 0x1110, 0xb88b,
-	0x0001, 0x00ce, 0x009e, 0x0005, 0x080c, 0x1731, 0x601c, 0xc0bd,
-	0x601e, 0x08e0, 0x00b6, 0x0096, 0x0016, 0x20a9, 0x0800, 0x900e,
-	0x0016, 0x080c, 0x6625, 0x1158, 0xb8d0, 0x904d, 0x0140, 0x3e00,
-	0x9086, 0x0002, 0x1118, 0xb800, 0xd0bc, 0x1108, 0x0041, 0x001e,
-	0x8108, 0x1f04, 0x67b8, 0x001e, 0x00be, 0x009e, 0x0005, 0x0096,
-	0x0016, 0xb8d0, 0x904d, 0x0188, 0xa800, 0xb8d2, 0x9005, 0x1108,
-	0xb8ce, 0x9006, 0xa802, 0xa867, 0x0103, 0xab7a, 0xa877, 0x0000,
-	0x080c, 0xcb36, 0x080c, 0x6d80, 0x0c60, 0x001e, 0x009e, 0x0005,
-	0x0086, 0x9046, 0xb8d0, 0x904d, 0x0198, 0xa86c, 0x9406, 0x1118,
-	0xa870, 0x9506, 0x0128, 0x2940, 0xa800, 0x904d, 0x0148, 0x0ca8,
-	0xa800, 0x88ff, 0x1110, 0xb8d2, 0x0008, 0xa002, 0xa803, 0x0000,
-	0x008e, 0x0005, 0x901e, 0x0010, 0x2019, 0x0001, 0x00e6, 0x0096,
-	0x00c6, 0x0086, 0x0026, 0x0126, 0x2091, 0x8000, 0x2071, 0x19e7,
-	0x9046, 0x7028, 0x9065, 0x01e8, 0x6014, 0x2068, 0x83ff, 0x0120,
-	0x605c, 0x9606, 0x0158, 0x0030, 0xa86c, 0x9406, 0x1118, 0xa870,
-	0x9506, 0x0120, 0x2c40, 0x600c, 0x2060, 0x0c60, 0x600c, 0x0006,
-	0x0066, 0x2830, 0x080c, 0x9fa2, 0x006e, 0x000e, 0x83ff, 0x0508,
-	0x0c08, 0x9046, 0xb8d0, 0x904d, 0x01e0, 0x83ff, 0x0120, 0xa878,
-	0x9606, 0x0158, 0x0030, 0xa86c, 0x9406, 0x1118, 0xa870, 0x9506,
-	0x0120, 0x2940, 0xa800, 0x2048, 0x0c70, 0xb8d0, 0xaa00, 0x0026,
-	0x9906, 0x1110, 0xbad2, 0x0008, 0xa202, 0x000e, 0x83ff, 0x0108,
-	0x0c10, 0x002e, 0x008e, 0x00ce, 0x009e, 0x00ee, 0x0005, 0x9016,
-	0x0489, 0x1110, 0x2011, 0x0001, 0x0005, 0x080c, 0x6914, 0x0128,
-	0x080c, 0xc8f9, 0x0010, 0x9085, 0x0001, 0x0005, 0x080c, 0x6914,
-	0x0128, 0x080c, 0xc89a, 0x0010, 0x9085, 0x0001, 0x0005, 0x080c,
-	0x6914, 0x0128, 0x080c, 0xc8f6, 0x0010, 0x9085, 0x0001, 0x0005,
-	0x080c, 0x6914, 0x0128, 0x080c, 0xc8b9, 0x0010, 0x9085, 0x0001,
-	0x0005, 0x080c, 0x6914, 0x0128, 0x080c, 0xc93a, 0x0010, 0x9085,
-	0x0001, 0x0005, 0xb8a4, 0x900d, 0x1118, 0x9085, 0x0001, 0x0005,
-	0x0136, 0x01c6, 0xa800, 0x9005, 0x11b8, 0x890e, 0x810e, 0x810f,
-	0x9184, 0x003f, 0x20e0, 0x9184, 0xffc0, 0x9080, 0x0004, 0x2098,
-	0x20a9, 0x0001, 0x2009, 0x0010, 0x4002, 0x9606, 0x0128, 0x8109,
-	0x1dd8, 0x9085, 0x0001, 0x0008, 0x9006, 0x01ce, 0x013e, 0x0005,
-	0x0146, 0x01d6, 0xa860, 0x20e8, 0xa85c, 0x9080, 0x0004, 0x20a0,
-	0x20a9, 0x0010, 0x2009, 0xffff, 0x4104, 0x01de, 0x014e, 0x0136,
+	0x080c, 0x5eb3, 0x0010, 0x080c, 0x5903, 0x0005, 0x00f6, 0x7090,
+	0x9005, 0x01d8, 0x2011, 0x5e89, 0x080c, 0x861d, 0x9086, 0x0084,
+	0x1190, 0x080c, 0x5ffe, 0x2079, 0x0260, 0x7a30, 0x9296, 0x1106,
+	0x1150, 0x7834, 0x9005, 0x1138, 0x9006, 0x080c, 0x6029, 0x709b,
+	0x0018, 0x0029, 0x0010, 0x7093, 0x0000, 0x00fe, 0x0005, 0x00f6,
+	0x709b, 0x0019, 0x080c, 0x5f90, 0x2079, 0x0240, 0x7833, 0x1106,
+	0x7837, 0x0000, 0x080c, 0x5ffe, 0x2009, 0x026e, 0x2039, 0x1d0e,
+	0x20a9, 0x0040, 0x213e, 0x8738, 0x8108, 0x9186, 0x0280, 0x1128,
+	0x6814, 0x8000, 0x6816, 0x2009, 0x0260, 0x1f04, 0x5d12, 0x2039,
+	0x1d0e, 0x080c, 0x5fe1, 0x11e8, 0x2728, 0x2514, 0x8207, 0x9084,
+	0x00ff, 0x8000, 0x2018, 0x9294, 0x00ff, 0x8007, 0x9205, 0x202a,
+	0x7060, 0x2310, 0x8214, 0x92a0, 0x1d0e, 0x2414, 0x938c, 0x0001,
+	0x0118, 0x9294, 0xff00, 0x0018, 0x9294, 0x00ff, 0x8007, 0x9215,
+	0x2222, 0x20a9, 0x0040, 0x2009, 0x024e, 0x270e, 0x8738, 0x8108,
+	0x9186, 0x0260, 0x1128, 0x6810, 0x8000, 0x6812, 0x2009, 0x0240,
+	0x1f04, 0x5d45, 0x60c3, 0x0084, 0x080c, 0x5eb3, 0x00fe, 0x0005,
+	0x00f6, 0x7090, 0x9005, 0x01e0, 0x2011, 0x5e89, 0x080c, 0x861d,
+	0x9086, 0x0084, 0x1198, 0x080c, 0x5ffe, 0x2079, 0x0260, 0x7a30,
+	0x9296, 0x1107, 0x1158, 0x7834, 0x9005, 0x1140, 0x7097, 0x0001,
+	0x080c, 0x5f54, 0x709b, 0x001a, 0x0029, 0x0010, 0x7093, 0x0000,
+	0x00fe, 0x0005, 0x9085, 0x0001, 0x080c, 0x6029, 0x709b, 0x001b,
+	0x080c, 0xa67d, 0x080c, 0x5ffe, 0x2011, 0x0260, 0x2009, 0x0240,
+	0x7490, 0x9480, 0x0018, 0x9080, 0x0007, 0x9084, 0x03f8, 0x8004,
+	0x20a8, 0x220e, 0x8210, 0x8108, 0x9186, 0x0260, 0x1150, 0x6810,
+	0x8000, 0x6812, 0x2009, 0x0240, 0x6814, 0x8000, 0x6816, 0x2011,
+	0x0260, 0x1f04, 0x5d91, 0x60c3, 0x0084, 0x080c, 0x5eb3, 0x0005,
+	0x0005, 0x0086, 0x0096, 0x2029, 0x1848, 0x252c, 0x20a9, 0x0008,
+	0x2041, 0x1d0e, 0x20e9, 0x0001, 0x28a0, 0x080c, 0x5ffe, 0x20e1,
+	0x0000, 0x2099, 0x026e, 0x4003, 0x20a9, 0x0008, 0x2011, 0x0007,
+	0xd5d4, 0x0108, 0x9016, 0x2800, 0x9200, 0x200c, 0x91a6, 0xffff,
+	0x1148, 0xd5d4, 0x0110, 0x8210, 0x0008, 0x8211, 0x1f04, 0x5dc3,
+	0x0804, 0x5e32, 0x82ff, 0x1160, 0xd5d4, 0x0120, 0x91a6, 0x3fff,
+	0x0d90, 0x0020, 0x91a6, 0x3fff, 0x0904, 0x5e32, 0x918d, 0xc000,
+	0x20a9, 0x0010, 0x2019, 0x0001, 0xd5d4, 0x0110, 0x2019, 0x0010,
+	0x2120, 0xd5d4, 0x0110, 0x8423, 0x0008, 0x8424, 0x1240, 0xd5d4,
+	0x0110, 0x8319, 0x0008, 0x8318, 0x1f04, 0x5de9, 0x04d8, 0x23a8,
+	0x2021, 0x0001, 0x8426, 0x8425, 0x1f04, 0x5dfb, 0x2328, 0x8529,
+	0x92be, 0x0007, 0x0158, 0x0006, 0x2039, 0x0007, 0x2200, 0x973a,
+	0x000e, 0x27a8, 0x95a8, 0x0010, 0x1f04, 0x5e0a, 0x755e, 0x95c8,
+	0x3368, 0x292d, 0x95ac, 0x00ff, 0x7582, 0x6532, 0x6536, 0x0016,
+	0x2508, 0x080c, 0x265d, 0x001e, 0x60e7, 0x0000, 0x65ea, 0x2018,
+	0x2304, 0x9405, 0x201a, 0x7087, 0x0001, 0x20e9, 0x0000, 0x20a1,
+	0x024e, 0x20e1, 0x0001, 0x2898, 0x20a9, 0x0008, 0x4003, 0x9085,
+	0x0001, 0x0008, 0x9006, 0x009e, 0x008e, 0x0005, 0x0156, 0x01c6,
+	0x01d6, 0x0136, 0x0146, 0x22a8, 0x20e1, 0x0000, 0x2099, 0x026e,
+	0x20e9, 0x0000, 0x2011, 0x024e, 0x22a0, 0x4003, 0x014e, 0x013e,
+	0x01de, 0x01ce, 0x015e, 0x2118, 0x9026, 0x2001, 0x0007, 0x939a,
+	0x0010, 0x0218, 0x8420, 0x8001, 0x0cd0, 0x2118, 0x84ff, 0x0120,
+	0x939a, 0x0010, 0x8421, 0x1de0, 0x2021, 0x0001, 0x83ff, 0x0118,
+	0x8423, 0x8319, 0x1de8, 0x9238, 0x2029, 0x026e, 0x9528, 0x2504,
+	0x942c, 0x11b8, 0x9405, 0x203a, 0x715e, 0x91a0, 0x3368, 0x242d,
+	0x95ac, 0x00ff, 0x7582, 0x6532, 0x6536, 0x0016, 0x2508, 0x080c,
+	0x265d, 0x001e, 0x60e7, 0x0000, 0x65ea, 0x7087, 0x0001, 0x9084,
+	0x0000, 0x0005, 0x00e6, 0x2071, 0x1800, 0x708b, 0x0000, 0x00ee,
+	0x0005, 0x00e6, 0x00f6, 0x2079, 0x0100, 0x2071, 0x0140, 0x080c,
+	0x5f43, 0x080c, 0x9e16, 0x7004, 0x9084, 0x4000, 0x0110, 0x080c,
+	0x2a39, 0x0126, 0x2091, 0x8000, 0x2071, 0x1826, 0x2073, 0x0000,
+	0x7840, 0x0026, 0x0016, 0x2009, 0x00f7, 0x080c, 0x5fa0, 0x001e,
+	0x9094, 0x0010, 0x9285, 0x0080, 0x7842, 0x7a42, 0x002e, 0x012e,
+	0x00fe, 0x00ee, 0x0005, 0x0126, 0x2091, 0x8000, 0x080c, 0x2998,
+	0x0228, 0x2011, 0x0101, 0x2204, 0xc0c5, 0x2012, 0x2011, 0x19f3,
+	0x2013, 0x0000, 0x7093, 0x0000, 0x012e, 0x60a3, 0x0056, 0x60a7,
+	0x9575, 0x080c, 0x9e09, 0x6144, 0xd184, 0x0120, 0x7198, 0x918d,
+	0x2000, 0x0018, 0x718c, 0x918d, 0x1000, 0x2011, 0x1998, 0x2112,
+	0x2009, 0x07d0, 0x2011, 0x5e89, 0x080c, 0x86e7, 0x0005, 0x0016,
+	0x0026, 0x00c6, 0x0126, 0x2091, 0x8000, 0x080c, 0xa888, 0x080c,
+	0xab50, 0x080c, 0xa8a4, 0x2009, 0x00f7, 0x080c, 0x5fa0, 0x2061,
+	0x1a02, 0x900e, 0x611a, 0x611e, 0x6172, 0x6176, 0x2061, 0x1800,
+	0x6003, 0x0001, 0x2061, 0x0100, 0x6043, 0x0090, 0x6043, 0x0010,
+	0x2009, 0x1998, 0x200b, 0x0000, 0x2009, 0x002d, 0x2011, 0x5f0f,
+	0x080c, 0x8611, 0x012e, 0x00ce, 0x002e, 0x001e, 0x0005, 0x00e6,
+	0x0006, 0x0126, 0x2091, 0x8000, 0x0471, 0x2071, 0x0100, 0x080c,
+	0x9e16, 0x2071, 0x0140, 0x7004, 0x9084, 0x4000, 0x0110, 0x080c,
+	0x2a39, 0x080c, 0x74d0, 0x0188, 0x080c, 0x74eb, 0x1170, 0x080c,
+	0x77d6, 0x0016, 0x080c, 0x272c, 0x2001, 0x196c, 0x2102, 0x001e,
+	0x080c, 0x77d1, 0x080c, 0x73f9, 0x0050, 0x2009, 0x0001, 0x080c,
+	0x2a15, 0x2001, 0x0001, 0x080c, 0x25b9, 0x080c, 0x5edf, 0x012e,
+	0x000e, 0x00ee, 0x0005, 0x2001, 0x180e, 0x2004, 0xd0bc, 0x0158,
+	0x0026, 0x0036, 0x2011, 0x8017, 0x2001, 0x1998, 0x201c, 0x080c,
+	0x4b09, 0x003e, 0x002e, 0x0005, 0x20a9, 0x0012, 0x20e9, 0x0001,
+	0x20a1, 0x1d80, 0x080c, 0x5ffe, 0x20e9, 0x0000, 0x2099, 0x026e,
+	0x0099, 0x20a9, 0x0020, 0x080c, 0x5ff8, 0x2099, 0x0260, 0x20a1,
+	0x1d92, 0x0051, 0x20a9, 0x000e, 0x080c, 0x5ffb, 0x2099, 0x0260,
+	0x20a1, 0x1db2, 0x0009, 0x0005, 0x0016, 0x0026, 0x3410, 0x3308,
+	0x2104, 0x8007, 0x2012, 0x8108, 0x8210, 0x1f04, 0x5f78, 0x002e,
+	0x001e, 0x0005, 0x080c, 0xa67d, 0x20e1, 0x0001, 0x2099, 0x1d00,
+	0x20e9, 0x0000, 0x20a1, 0x0240, 0x20a9, 0x000c, 0x4003, 0x0005,
+	0x080c, 0xa67d, 0x080c, 0x5ffe, 0x20e1, 0x0000, 0x2099, 0x0260,
+	0x20e9, 0x0000, 0x20a1, 0x0240, 0x20a9, 0x000c, 0x4003, 0x0005,
+	0x00c6, 0x0006, 0x2061, 0x0100, 0x810f, 0x2001, 0x1834, 0x2004,
+	0x9005, 0x1138, 0x2001, 0x1818, 0x2004, 0x9084, 0x00ff, 0x9105,
+	0x0010, 0x9185, 0x00f7, 0x604a, 0x000e, 0x00ce, 0x0005, 0x0016,
+	0x0046, 0x080c, 0x6a66, 0x0158, 0x9006, 0x2020, 0x2009, 0x002a,
+	0x080c, 0xe2d9, 0x2001, 0x180c, 0x200c, 0xc195, 0x2102, 0x2019,
+	0x002a, 0x900e, 0x080c, 0x31b4, 0x080c, 0xcf51, 0x0140, 0x0036,
+	0x2019, 0xffff, 0x2021, 0x0007, 0x080c, 0x4cc0, 0x003e, 0x004e,
+	0x001e, 0x0005, 0x080c, 0x5edf, 0x709b, 0x0000, 0x7093, 0x0000,
+	0x0005, 0x0006, 0x2001, 0x180c, 0x2004, 0xd09c, 0x0100, 0x000e,
+	0x0005, 0x0006, 0x0016, 0x0126, 0x2091, 0x8000, 0x2001, 0x0101,
+	0x200c, 0x918d, 0x0006, 0x2102, 0x012e, 0x001e, 0x000e, 0x0005,
+	0x2009, 0x0001, 0x0020, 0x2009, 0x0002, 0x0008, 0x900e, 0x6814,
+	0x9084, 0xffc0, 0x910d, 0x6916, 0x0005, 0x00f6, 0x0156, 0x0146,
+	0x01d6, 0x9006, 0x20a9, 0x0080, 0x20e9, 0x0001, 0x20a1, 0x1d00,
+	0x4004, 0x2079, 0x1d00, 0x7803, 0x2200, 0x7807, 0x00ef, 0x780f,
+	0x00ef, 0x7813, 0x0138, 0x7823, 0xffff, 0x7827, 0xffff, 0x01de,
+	0x014e, 0x015e, 0x00fe, 0x0005, 0x2001, 0x1800, 0x2003, 0x0001,
+	0x0005, 0x2001, 0x19a5, 0x0118, 0x2003, 0x0001, 0x0010, 0x2003,
+	0x0000, 0x0005, 0x0156, 0x20a9, 0x0800, 0x2009, 0x1000, 0x9006,
+	0x200a, 0x8108, 0x1f04, 0x6038, 0x015e, 0x0005, 0x00d6, 0x0036,
+	0x0156, 0x0136, 0x0146, 0x2069, 0x1847, 0x9006, 0xb802, 0xb8d6,
+	0xb807, 0x0707, 0xb80a, 0xb80e, 0xb812, 0x9198, 0x3368, 0x231d,
+	0x939c, 0x00ff, 0xbb16, 0x0016, 0x0026, 0xb886, 0x080c, 0xab49,
+	0x1120, 0x9192, 0x007e, 0x1208, 0xbb86, 0x20a9, 0x0004, 0xb8c4,
+	0x20e8, 0xb9c8, 0x9198, 0x0006, 0x9006, 0x23a0, 0x4004, 0x20a9,
+	0x0004, 0x9198, 0x000a, 0x23a0, 0x4004, 0x002e, 0x001e, 0xb83e,
+	0xb842, 0xb8ce, 0xb8d2, 0xb85e, 0xb862, 0xb866, 0xb86a, 0xb86f,
+	0x0100, 0xb872, 0xb876, 0xb87a, 0xb88a, 0xb88e, 0xb893, 0x0008,
+	0xb896, 0xb89a, 0xb89e, 0xb8be, 0xb9a2, 0x0096, 0xb8a4, 0x904d,
+	0x0110, 0x080c, 0x106c, 0xb8a7, 0x0000, 0x009e, 0x9006, 0xb84a,
+	0x6810, 0xb83a, 0x680c, 0xb846, 0xb8bb, 0x0520, 0xb8ac, 0x9005,
+	0x0198, 0x00c6, 0x2060, 0x9c82, 0x1ddc, 0x0a0c, 0x0d7d, 0x2001,
+	0x181a, 0x2004, 0x9c02, 0x1a0c, 0x0d7d, 0x080c, 0x8b72, 0x00ce,
+	0x090c, 0x8f16, 0xb8af, 0x0000, 0x6814, 0x9084, 0x00ff, 0xb842,
+	0x014e, 0x013e, 0x015e, 0x003e, 0x00de, 0x0005, 0x0126, 0x2091,
+	0x8000, 0xa974, 0xae78, 0x9684, 0x3fff, 0x9082, 0x4000, 0x1a04,
+	0x6114, 0x9182, 0x0800, 0x1a04, 0x6118, 0x2001, 0x180c, 0x2004,
+	0x9084, 0x0003, 0x1904, 0x611e, 0x9188, 0x1000, 0x2104, 0x905d,
+	0x0198, 0xb804, 0x9084, 0x00ff, 0x908e, 0x0006, 0x1188, 0xb8a4,
+	0x900d, 0x1904, 0x6130, 0x080c, 0x64e9, 0x9006, 0x012e, 0x0005,
+	0x2001, 0x0005, 0x900e, 0x04b8, 0x2001, 0x0028, 0x900e, 0x0498,
+	0x9082, 0x0006, 0x1290, 0x080c, 0xab49, 0x1160, 0xb8a0, 0x9084,
+	0xff80, 0x1140, 0xb900, 0xd1fc, 0x0d10, 0x2001, 0x0029, 0x2009,
+	0x1000, 0x0408, 0x2001, 0x0028, 0x00a8, 0x2009, 0x180c, 0x210c,
+	0xd18c, 0x0118, 0x2001, 0x0004, 0x0068, 0xd184, 0x0118, 0x2001,
+	0x0004, 0x0040, 0x2001, 0x0029, 0xb900, 0xd1fc, 0x0118, 0x2009,
+	0x1000, 0x0048, 0x900e, 0x0038, 0x2001, 0x0029, 0x900e, 0x0018,
+	0x2001, 0x0029, 0x900e, 0x9005, 0x012e, 0x0005, 0x2001, 0x180c,
+	0x2004, 0xd084, 0x19d0, 0x9188, 0x1000, 0x2104, 0x9065, 0x09a8,
+	0x080c, 0x6a6a, 0x1990, 0xb800, 0xd0bc, 0x0978, 0x0804, 0x60d7,
+	0x080c, 0x688f, 0x0904, 0x60e0, 0x0804, 0x60db, 0x00e6, 0x2071,
+	0x19e6, 0x7004, 0x9086, 0x0002, 0x1128, 0x7030, 0x9080, 0x0004,
+	0x2004, 0x9b06, 0x00ee, 0x0005, 0x00b6, 0x00e6, 0x0126, 0x2091,
+	0x8000, 0xa874, 0x908e, 0x00ff, 0x1120, 0x2001, 0x196a, 0x205c,
+	0x0060, 0xa974, 0x9182, 0x0800, 0x1690, 0x9188, 0x1000, 0x2104,
+	0x905d, 0x01d0, 0x080c, 0x6a0a, 0x11d0, 0x080c, 0xab89, 0x0570,
+	0x2b00, 0x6012, 0x2900, 0x6016, 0x6023, 0x0009, 0x602b, 0x0000,
+	0xa874, 0x908e, 0x00ff, 0x1110, 0x602b, 0x8000, 0x2009, 0x0043,
+	0x080c, 0xac7c, 0x9006, 0x00b0, 0x2001, 0x0028, 0x0090, 0x2009,
+	0x180c, 0x210c, 0xd18c, 0x0118, 0x2001, 0x0004, 0x0038, 0xd184,
+	0x0118, 0x2001, 0x0004, 0x0010, 0x2001, 0x0029, 0x0010, 0x2001,
+	0x0029, 0x9005, 0x012e, 0x00ee, 0x00be, 0x0005, 0x2001, 0x002c,
+	0x0cc0, 0x00b6, 0x00e6, 0x0126, 0x2091, 0x8000, 0xa974, 0x9182,
+	0x0800, 0x1a04, 0x620c, 0x9188, 0x1000, 0x2104, 0x905d, 0x0904,
+	0x61e4, 0xb8a0, 0x9086, 0x007f, 0x0178, 0x080c, 0x6a72, 0x0160,
+	0xa994, 0x81ff, 0x0130, 0x908e, 0x0004, 0x0130, 0x908e, 0x0005,
+	0x0118, 0x080c, 0x6a6a, 0x1598, 0xa87c, 0xd0fc, 0x01e0, 0xa894,
+	0x9005, 0x01c8, 0x2060, 0x0026, 0x2010, 0x080c, 0xc820, 0x002e,
+	0x1120, 0x2001, 0x0008, 0x0804, 0x620e, 0x6020, 0x9086, 0x000a,
+	0x0120, 0x2001, 0x0008, 0x0804, 0x620e, 0x601a, 0x6003, 0x0008,
+	0x2900, 0x6016, 0x0058, 0x080c, 0xab89, 0x05e8, 0x2b00, 0x6012,
+	0x2900, 0x6016, 0x600b, 0xffff, 0x6023, 0x000a, 0x2009, 0x0003,
+	0x080c, 0xac7c, 0x9006, 0x0458, 0x2001, 0x0028, 0x0438, 0x9082,
+	0x0006, 0x1290, 0x080c, 0xab49, 0x1160, 0xb8a0, 0x9084, 0xff80,
+	0x1140, 0xb900, 0xd1fc, 0x0900, 0x2001, 0x0029, 0x2009, 0x1000,
+	0x00a8, 0x2001, 0x0028, 0x0090, 0x2009, 0x180c, 0x210c, 0xd18c,
+	0x0118, 0x2001, 0x0004, 0x0050, 0xd184, 0x0118, 0x2001, 0x0004,
+	0x0028, 0x2001, 0x0029, 0x0010, 0x2001, 0x0029, 0x9005, 0x012e,
+	0x00ee, 0x00be, 0x0005, 0x2001, 0x002c, 0x0cc0, 0x00f6, 0x00b6,
+	0x0126, 0x2091, 0x8000, 0xa8e0, 0x9005, 0x1550, 0xa8dc, 0x9082,
+	0x0101, 0x1630, 0xa8c8, 0x9005, 0x1518, 0xa8c4, 0x9082, 0x0101,
+	0x12f8, 0xa974, 0x2079, 0x1800, 0x9182, 0x0800, 0x12e8, 0x7830,
+	0x9084, 0x0003, 0x1130, 0xaa98, 0xab94, 0xa878, 0x9084, 0x0007,
+	0x00ea, 0x7930, 0xd18c, 0x0118, 0x2001, 0x0004, 0x0038, 0xd184,
+	0x0118, 0x2001, 0x0004, 0x0010, 0x2001, 0x0029, 0x900e, 0x0038,
+	0x2001, 0x002c, 0x900e, 0x0018, 0x2001, 0x0029, 0x900e, 0x9006,
+	0x0008, 0x9005, 0x012e, 0x00be, 0x00fe, 0x0005, 0x62a3, 0x625e,
+	0x6275, 0x62a3, 0x62a3, 0x62a3, 0x62a3, 0x62a3, 0x2100, 0x9082,
+	0x007e, 0x1278, 0x080c, 0x65bf, 0x0148, 0x9046, 0xb810, 0x9306,
+	0x1904, 0x62ab, 0xb814, 0x9206, 0x15f0, 0x0028, 0xbb12, 0xba16,
+	0x0010, 0x080c, 0x49bc, 0x0150, 0x04b0, 0x080c, 0x6620, 0x1598,
+	0xb810, 0x9306, 0x1580, 0xb814, 0x9206, 0x1568, 0x080c, 0xab89,
+	0x0530, 0x2b00, 0x6012, 0x080c, 0xcccb, 0x2900, 0x6016, 0x600b,
+	0xffff, 0x6023, 0x000a, 0xa878, 0x9086, 0x0001, 0x1170, 0x080c,
+	0x31ef, 0x9006, 0x080c, 0x655c, 0x2001, 0x0002, 0x080c, 0x6570,
+	0x2001, 0x0200, 0xb86e, 0xb893, 0x0002, 0x2009, 0x0003, 0x080c,
+	0xac7c, 0x9006, 0x0068, 0x2001, 0x0001, 0x900e, 0x0038, 0x2001,
+	0x002c, 0x900e, 0x0018, 0x2001, 0x0028, 0x900e, 0x9005, 0x0000,
+	0x012e, 0x00be, 0x00fe, 0x0005, 0x00b6, 0x00f6, 0x00e6, 0x0126,
+	0x2091, 0x8000, 0xa894, 0x90c6, 0x0015, 0x0904, 0x6492, 0x90c6,
+	0x0056, 0x0904, 0x6496, 0x90c6, 0x0066, 0x0904, 0x649a, 0x90c6,
+	0x0067, 0x0904, 0x649e, 0x90c6, 0x0068, 0x0904, 0x64a2, 0x90c6,
+	0x0071, 0x0904, 0x64a6, 0x90c6, 0x0074, 0x0904, 0x64aa, 0x90c6,
+	0x007c, 0x0904, 0x64ae, 0x90c6, 0x007e, 0x0904, 0x64b2, 0x90c6,
+	0x0037, 0x0904, 0x64b6, 0x9016, 0x2079, 0x1800, 0xa974, 0x9186,
+	0x00ff, 0x0904, 0x648d, 0x9182, 0x0800, 0x1a04, 0x648d, 0x080c,
+	0x6620, 0x1198, 0xb804, 0x9084, 0x00ff, 0x9082, 0x0006, 0x1268,
+	0xa894, 0x90c6, 0x006f, 0x0148, 0x080c, 0xab49, 0x1904, 0x6476,
+	0xb8a0, 0x9084, 0xff80, 0x1904, 0x6476, 0xa894, 0x90c6, 0x006f,
+	0x0158, 0x90c6, 0x005e, 0x0904, 0x63d6, 0x90c6, 0x0064, 0x0904,
+	0x63ff, 0x2008, 0x0804, 0x6398, 0xa998, 0xa8b0, 0x2040, 0x080c,
+	0xab49, 0x1120, 0x9182, 0x007f, 0x0a04, 0x6398, 0x9186, 0x00ff,
+	0x0904, 0x6398, 0x9182, 0x0800, 0x1a04, 0x6398, 0xaaa0, 0xab9c,
+	0x787c, 0x9306, 0x1188, 0x7880, 0x0096, 0x924e, 0x1128, 0x2208,
+	0x2310, 0x009e, 0x0804, 0x6398, 0x99cc, 0xff00, 0x009e, 0x1120,
+	0x2208, 0x2310, 0x0804, 0x6398, 0x080c, 0x49bc, 0x0904, 0x63a2,
+	0x900e, 0x9016, 0x90c6, 0x4000, 0x15e0, 0x0006, 0x080c, 0x6913,
+	0x1108, 0xc185, 0xb800, 0xd0bc, 0x0108, 0xc18d, 0x20a9, 0x0004,
+	0xa860, 0x20e8, 0xa85c, 0x9080, 0x0031, 0x20a0, 0xb8c4, 0x20e0,
+	0xb8c8, 0x9080, 0x0006, 0x2098, 0x080c, 0x0fb7, 0x20a9, 0x0004,
+	0xa860, 0x20e8, 0xa85c, 0x9080, 0x0035, 0x20a0, 0xb8c4, 0x20e0,
+	0xb8c8, 0x9080, 0x000a, 0x2098, 0x080c, 0x0fb7, 0xa8c4, 0xabc8,
+	0x9305, 0xabcc, 0x9305, 0xabd0, 0x9305, 0xabd4, 0x9305, 0xabd8,
+	0x9305, 0xabdc, 0x9305, 0xabe0, 0x9305, 0x9005, 0x0510, 0x000e,
+	0x00c8, 0x90c6, 0x4007, 0x1110, 0x2408, 0x00a0, 0x90c6, 0x4008,
+	0x1118, 0x2708, 0x2610, 0x0070, 0x90c6, 0x4009, 0x1108, 0x0050,
+	0x90c6, 0x4006, 0x0138, 0x2001, 0x4005, 0x2009, 0x000a, 0x0010,
+	0x2001, 0x4006, 0xa896, 0xa99a, 0xaa9e, 0x2001, 0x0030, 0x900e,
+	0x0478, 0x000e, 0x080c, 0xab89, 0x1130, 0x2001, 0x4005, 0x2009,
+	0x0003, 0x9016, 0x0c78, 0x2b00, 0x6012, 0x080c, 0xcccb, 0x2900,
+	0x6016, 0x6023, 0x0001, 0xa868, 0xd88c, 0x0108, 0xc0f5, 0xa86a,
+	0x0126, 0x2091, 0x8000, 0x080c, 0x31ef, 0x012e, 0x9006, 0x080c,
+	0x655c, 0x2001, 0x0002, 0x080c, 0x6570, 0x2009, 0x0002, 0x080c,
+	0xac7c, 0xa8b0, 0xd094, 0x0118, 0xb8d4, 0xc08d, 0xb8d6, 0x9006,
+	0x9005, 0x012e, 0x00ee, 0x00fe, 0x00be, 0x0005, 0x080c, 0x56e9,
+	0x0118, 0x2009, 0x0007, 0x00f8, 0xa998, 0xaeb0, 0x080c, 0x6620,
+	0x1904, 0x6393, 0x9186, 0x007f, 0x0130, 0x080c, 0x6a6a, 0x0118,
+	0x2009, 0x0009, 0x0080, 0x0096, 0x080c, 0x103a, 0x1120, 0x009e,
+	0x2009, 0x0002, 0x0040, 0x2900, 0x009e, 0xa806, 0x080c, 0xca1e,
+	0x19b0, 0x2009, 0x0003, 0x2001, 0x4005, 0x0804, 0x639a, 0xa998,
+	0xaeb0, 0x080c, 0x6620, 0x1904, 0x6393, 0x0096, 0x080c, 0x103a,
+	0x1128, 0x009e, 0x2009, 0x0002, 0x0804, 0x6453, 0x2900, 0x009e,
+	0xa806, 0x0096, 0x2048, 0x20a9, 0x002b, 0xb8c4, 0x20e0, 0xb8c8,
+	0x2098, 0xa860, 0x20e8, 0xa85c, 0x9080, 0x0002, 0x20a0, 0x4003,
+	0x20a9, 0x0008, 0x9080, 0x0006, 0x20a0, 0xbbc8, 0x9398, 0x0006,
+	0x2398, 0x080c, 0x0fb7, 0x009e, 0xa87b, 0x0000, 0xa883, 0x0000,
+	0xa897, 0x4000, 0xd684, 0x1168, 0x080c, 0x56d5, 0xd0b4, 0x1118,
+	0xa89b, 0x000b, 0x00e0, 0xb800, 0xd08c, 0x0118, 0xa89b, 0x000c,
+	0x00b0, 0x080c, 0x6a6a, 0x0118, 0xa89b, 0x0009, 0x0080, 0x080c,
+	0x56e9, 0x0118, 0xa89b, 0x0007, 0x0050, 0x080c, 0xca01, 0x1904,
+	0x63cf, 0x2009, 0x0003, 0x2001, 0x4005, 0x0804, 0x639a, 0xa87b,
+	0x0030, 0xa897, 0x4005, 0xa804, 0x8006, 0x8006, 0x8007, 0x90bc,
+	0x003f, 0x9084, 0xffc0, 0x9080, 0x0002, 0x2009, 0x002b, 0xaaa0,
+	0xab9c, 0xaca8, 0xada4, 0x2031, 0x0000, 0x2041, 0x1289, 0x080c,
+	0xb103, 0x1904, 0x63cf, 0x2009, 0x0002, 0x08e8, 0x2001, 0x0028,
+	0x900e, 0x0804, 0x63d0, 0x2009, 0x180c, 0x210c, 0xd18c, 0x0118,
+	0x2001, 0x0004, 0x0038, 0xd184, 0x0118, 0x2001, 0x0004, 0x0010,
+	0x2001, 0x0029, 0x900e, 0x0804, 0x63d0, 0x2001, 0x0029, 0x900e,
+	0x0804, 0x63d0, 0x080c, 0x3796, 0x0804, 0x63d1, 0x080c, 0x540a,
+	0x0804, 0x63d1, 0x080c, 0x4572, 0x0804, 0x63d1, 0x080c, 0x45eb,
+	0x0804, 0x63d1, 0x080c, 0x4647, 0x0804, 0x63d1, 0x080c, 0x4a7f,
+	0x0804, 0x63d1, 0x080c, 0x4d2f, 0x0804, 0x63d1, 0x080c, 0x5075,
+	0x0804, 0x63d1, 0x080c, 0x526e, 0x0804, 0x63d1, 0x080c, 0x39b4,
+	0x0804, 0x63d1, 0x00b6, 0xa974, 0xae78, 0x9684, 0x3fff, 0x9082,
+	0x4000, 0x1608, 0x9182, 0x0800, 0x1258, 0x9188, 0x1000, 0x2104,
+	0x905d, 0x0130, 0x080c, 0x6a6a, 0x1138, 0x00d9, 0x9006, 0x00b0,
+	0x2001, 0x0028, 0x900e, 0x0090, 0x9082, 0x0006, 0x1240, 0xb900,
+	0xd1fc, 0x0d98, 0x2001, 0x0029, 0x2009, 0x1000, 0x0038, 0x2001,
+	0x0029, 0x900e, 0x0018, 0x2001, 0x0029, 0x900e, 0x9005, 0x00be,
+	0x0005, 0xa877, 0x0000, 0xb8d0, 0x9005, 0x1904, 0x6550, 0xb888,
+	0x9005, 0x1904, 0x6550, 0xb838, 0xb93c, 0x9102, 0x1a04, 0x6550,
+	0x2b10, 0x080c, 0xabb6, 0x0904, 0x654c, 0x8108, 0xb93e, 0x6212,
+	0x2900, 0x6016, 0x6023, 0x0003, 0x600b, 0xffff, 0x6007, 0x0040,
+	0xa878, 0x605e, 0xa880, 0x9084, 0x00ff, 0x6066, 0xa883, 0x0000,
+	0xa87c, 0xd0ac, 0x0588, 0xc0dd, 0xa87e, 0xa888, 0x8001, 0x1530,
+	0xa816, 0xa864, 0x9094, 0x00f7, 0x9296, 0x0011, 0x11f8, 0x9084,
+	0x00ff, 0xc0bd, 0x601e, 0xa8ac, 0xaab0, 0xa836, 0xaa3a, 0x2001,
+	0x000f, 0x8001, 0x1df0, 0x2001, 0x8004, 0x6003, 0x0004, 0x6046,
+	0x00f6, 0x2079, 0x0380, 0x7818, 0xd0bc, 0x1de8, 0x7833, 0x0010,
+	0x2c00, 0x7836, 0x781b, 0x8080, 0x00fe, 0x0005, 0x080c, 0x173e,
+	0x601c, 0xc0bd, 0x601e, 0x0c38, 0xd0b4, 0x190c, 0x1c3d, 0x2001,
+	0x8004, 0x6003, 0x0002, 0x0c18, 0x81ff, 0x1110, 0xb88b, 0x0001,
+	0x2908, 0xb8cc, 0xb9ce, 0x9005, 0x1110, 0xb9d2, 0x0020, 0x0096,
+	0x2048, 0xa902, 0x009e, 0x0005, 0x00b6, 0x0126, 0x00c6, 0x0026,
+	0x2091, 0x8000, 0x6210, 0x2258, 0xba00, 0x9005, 0x0110, 0xc285,
+	0x0008, 0xc284, 0xba02, 0x002e, 0x00ce, 0x012e, 0x00be, 0x0005,
+	0x00b6, 0x0126, 0x00c6, 0x2091, 0x8000, 0x6210, 0x2258, 0xba04,
+	0x0006, 0x9086, 0x0006, 0x1170, 0xb89c, 0xd0ac, 0x0158, 0x080c,
+	0x6a66, 0x0140, 0x9284, 0xff00, 0x8007, 0x9086, 0x0007, 0x1110,
+	0x2011, 0x0600, 0x000e, 0x9294, 0xff00, 0x9215, 0xba06, 0x0006,
+	0x9086, 0x0006, 0x1120, 0xba90, 0x82ff, 0x090c, 0x0d7d, 0x000e,
+	0x00ce, 0x012e, 0x00be, 0x0005, 0x00b6, 0x0126, 0x00c6, 0x2091,
+	0x8000, 0x6210, 0x2258, 0xba04, 0x0006, 0x9086, 0x0006, 0x1168,
+	0xb89c, 0xd0a4, 0x0150, 0x080c, 0x6a62, 0x1138, 0x9284, 0x00ff,
+	0x9086, 0x0007, 0x1110, 0x2011, 0x0006, 0x000e, 0x9294, 0x00ff,
+	0x8007, 0x9215, 0xba06, 0x00ce, 0x012e, 0x00be, 0x0005, 0x9182,
+	0x0800, 0x0218, 0x9085, 0x0001, 0x0005, 0x00d6, 0x0026, 0x9190,
+	0x1000, 0x2204, 0x905d, 0x1188, 0x0096, 0x080c, 0x103a, 0x2958,
+	0x009e, 0x0168, 0x2b00, 0x2012, 0xb85c, 0xb8ca, 0xb860, 0xb8c6,
+	0x9006, 0xb8a6, 0xb8ae, 0x080c, 0x603e, 0x9006, 0x0010, 0x9085,
+	0x0001, 0x002e, 0x00de, 0x0005, 0x00b6, 0x0096, 0x0126, 0x2091,
+	0x8000, 0x0026, 0x9182, 0x0800, 0x0218, 0x9085, 0x0001, 0x0458,
+	0x00d6, 0x9190, 0x1000, 0x2204, 0x905d, 0x0518, 0x2013, 0x0000,
+	0xb8a4, 0x904d, 0x0110, 0x080c, 0x106c, 0x00d6, 0x00c6, 0xb8bc,
+	0x2060, 0x8cff, 0x0168, 0x600c, 0x0006, 0x6014, 0x2048, 0x080c,
+	0xc832, 0x0110, 0x080c, 0x0fec, 0x080c, 0xabdf, 0x00ce, 0x0c88,
+	0x00ce, 0x00de, 0x2b48, 0xb8c8, 0xb85e, 0xb8c4, 0xb862, 0x080c,
+	0x107c, 0x00de, 0x9006, 0x002e, 0x012e, 0x009e, 0x00be, 0x0005,
+	0x0016, 0x9182, 0x0800, 0x0218, 0x9085, 0x0001, 0x0030, 0x9188,
+	0x1000, 0x2104, 0x905d, 0x0dc0, 0x9006, 0x001e, 0x0005, 0x00d6,
+	0x0156, 0x0136, 0x0146, 0x9006, 0xb80a, 0xb80e, 0xb800, 0xc08c,
+	0xb802, 0x080c, 0x74c8, 0x1510, 0xb8a0, 0x9086, 0x007e, 0x0120,
+	0x080c, 0xab49, 0x11d8, 0x0078, 0x7040, 0xd0e4, 0x01b8, 0x00c6,
+	0x2061, 0x1981, 0x7048, 0x2062, 0x704c, 0x6006, 0x7050, 0x600a,
+	0x7054, 0x600e, 0x00ce, 0x703c, 0x2069, 0x0140, 0x9005, 0x1110,
+	0x2001, 0x0001, 0x6886, 0x2069, 0x1800, 0x68b6, 0x7040, 0xb85e,
+	0x7048, 0xb862, 0x704c, 0xb866, 0x20e1, 0x0000, 0x2099, 0x0276,
+	0xb8c4, 0x20e8, 0xb8c8, 0x9088, 0x000a, 0x21a0, 0x20a9, 0x0004,
+	0x4003, 0x2099, 0x027a, 0x9088, 0x0006, 0x21a0, 0x20a9, 0x0004,
+	0x4003, 0x2069, 0x0200, 0x6817, 0x0001, 0x7040, 0xb86a, 0x7144,
+	0xb96e, 0x7048, 0xb872, 0x7050, 0xb876, 0x2069, 0x0200, 0x6817,
+	0x0000, 0xb8a0, 0x9086, 0x007e, 0x1110, 0x7144, 0xb96e, 0x9182,
+	0x0211, 0x1218, 0x2009, 0x0008, 0x0400, 0x9182, 0x0259, 0x1218,
+	0x2009, 0x0007, 0x00d0, 0x9182, 0x02c1, 0x1218, 0x2009, 0x0006,
+	0x00a0, 0x9182, 0x0349, 0x1218, 0x2009, 0x0005, 0x0070, 0x9182,
+	0x0421, 0x1218, 0x2009, 0x0004, 0x0040, 0x9182, 0x0581, 0x1218,
+	0x2009, 0x0003, 0x0010, 0x2009, 0x0002, 0xb992, 0x014e, 0x013e,
+	0x015e, 0x00de, 0x0005, 0x0016, 0x0026, 0x00e6, 0x2071, 0x0260,
+	0x7034, 0xb896, 0x703c, 0xb89a, 0x7054, 0xb89e, 0x0036, 0xbbd4,
+	0xc384, 0xba00, 0x2009, 0x1867, 0x210c, 0xd0bc, 0x0120, 0xd1ec,
+	0x0110, 0xc2ad, 0x0008, 0xc2ac, 0xd0c4, 0x0148, 0xd1e4, 0x0138,
+	0xc2bd, 0xd0cc, 0x0128, 0xd38c, 0x1108, 0xc385, 0x0008, 0xc2bc,
+	0xba02, 0xbbd6, 0x003e, 0x00ee, 0x002e, 0x001e, 0x0005, 0x0096,
+	0x0126, 0x2091, 0x8000, 0xb8a4, 0x904d, 0x0578, 0xa900, 0x81ff,
+	0x15c0, 0xaa04, 0x9282, 0x0010, 0x16c8, 0x0136, 0x0146, 0x01c6,
+	0x01d6, 0x8906, 0x8006, 0x8007, 0x908c, 0x003f, 0x21e0, 0x9084,
+	0xffc0, 0x9080, 0x0004, 0x2098, 0x2009, 0x0010, 0x20a9, 0x0001,
+	0x4002, 0x9086, 0xffff, 0x0120, 0x8109, 0x1dd0, 0x080c, 0x0d7d,
+	0x3c00, 0x20e8, 0x3300, 0x8001, 0x20a0, 0x4604, 0x8210, 0xaa06,
+	0x01de, 0x01ce, 0x014e, 0x013e, 0x0060, 0x080c, 0x103a, 0x0170,
+	0x2900, 0xb8a6, 0xa803, 0x0000, 0x080c, 0x68af, 0xa807, 0x0001,
+	0xae12, 0x9085, 0x0001, 0x012e, 0x009e, 0x0005, 0x9006, 0x0cd8,
+	0x0126, 0x2091, 0x8000, 0x0096, 0xb8a4, 0x904d, 0x0188, 0xa800,
+	0x9005, 0x1150, 0x080c, 0x68be, 0x1158, 0xa804, 0x908a, 0x0002,
+	0x0218, 0x8001, 0xa806, 0x0020, 0x080c, 0x106c, 0xb8a7, 0x0000,
+	0x009e, 0x012e, 0x0005, 0x0096, 0x00c6, 0xb888, 0x9005, 0x1904,
+	0x67a4, 0xb8d0, 0x904d, 0x0904, 0x67a4, 0x080c, 0xabb6, 0x0904,
+	0x67a0, 0x8210, 0xba3e, 0xa800, 0xb8d2, 0x9005, 0x1108, 0xb8ce,
+	0x2b00, 0x6012, 0x2900, 0x6016, 0x6023, 0x0003, 0x600b, 0xffff,
+	0x6007, 0x0040, 0xa878, 0x605e, 0xa880, 0x9084, 0x00ff, 0x6066,
+	0xa883, 0x0000, 0xa87c, 0xd0ac, 0x01c8, 0xc0dd, 0xa87e, 0xa888,
+	0x8001, 0x1568, 0xa816, 0xa864, 0x9094, 0x00f7, 0x9296, 0x0011,
+	0x1530, 0x9084, 0x00ff, 0xc0bd, 0x601e, 0xa8ac, 0xaab0, 0xa836,
+	0xaa3a, 0x2001, 0x8004, 0x6003, 0x0004, 0x0030, 0x080c, 0x1c3d,
+	0x2001, 0x8004, 0x6003, 0x0002, 0x6046, 0x2001, 0x0010, 0x2c08,
+	0x080c, 0xa879, 0xb838, 0xba3c, 0x9202, 0x0a04, 0x6751, 0x0020,
+	0x82ff, 0x1110, 0xb88b, 0x0001, 0x00ce, 0x009e, 0x0005, 0x080c,
+	0x173e, 0x601c, 0xc0bd, 0x601e, 0x08e0, 0x00b6, 0x0096, 0x0016,
+	0x20a9, 0x0800, 0x900e, 0x0016, 0x080c, 0x6620, 0x1158, 0xb8d0,
+	0x904d, 0x0140, 0x3e00, 0x9086, 0x0002, 0x1118, 0xb800, 0xd0bc,
+	0x1108, 0x0041, 0x001e, 0x8108, 0x1f04, 0x67b3, 0x001e, 0x00be,
+	0x009e, 0x0005, 0x0096, 0x0016, 0xb8d0, 0x904d, 0x0188, 0xa800,
+	0xb8d2, 0x9005, 0x1108, 0xb8ce, 0x9006, 0xa802, 0xa867, 0x0103,
+	0xab7a, 0xa877, 0x0000, 0x080c, 0xcb35, 0x080c, 0x6d7b, 0x0c60,
+	0x001e, 0x009e, 0x0005, 0x0086, 0x9046, 0xb8d0, 0x904d, 0x01b0,
+	0xa86c, 0x9406, 0x1118, 0xa870, 0x9506, 0x0128, 0x2940, 0xa800,
+	0x904d, 0x0160, 0x0ca8, 0xa800, 0x88ff, 0x1128, 0xb8d2, 0x9005,
+	0x1118, 0xb8ce, 0x0008, 0xa002, 0xa803, 0x0000, 0x008e, 0x0005,
+	0x901e, 0x0010, 0x2019, 0x0001, 0x0126, 0x2091, 0x8000, 0x00e6,
+	0x0096, 0x00c6, 0x0086, 0x0026, 0x2071, 0x19e6, 0x9046, 0x7028,
+	0x9065, 0x01e8, 0x6014, 0x2068, 0x83ff, 0x0120, 0x605c, 0x9606,
+	0x0158, 0x0030, 0xa86c, 0x9406, 0x1118, 0xa870, 0x9506, 0x0120,
+	0x2c40, 0x600c, 0x2060, 0x0c60, 0x600c, 0x0006, 0x0066, 0x2830,
+	0x080c, 0x9f84, 0x006e, 0x000e, 0x83ff, 0x0508, 0x0c08, 0x9046,
+	0xb8d0, 0x904d, 0x01e0, 0x83ff, 0x0120, 0xa878, 0x9606, 0x0158,
+	0x0030, 0xa86c, 0x9406, 0x1118, 0xa870, 0x9506, 0x0120, 0x2940,
+	0xa800, 0x2048, 0x0c70, 0xb8d0, 0xaa00, 0x0026, 0x9906, 0x1110,
+	0xbad2, 0x0008, 0xa202, 0x000e, 0x83ff, 0x0108, 0x0c10, 0x002e,
+	0x008e, 0x00ce, 0x009e, 0x00ee, 0x012e, 0x0005, 0x9016, 0x0489,
+	0x1110, 0x2011, 0x0001, 0x0005, 0x080c, 0x6913, 0x0128, 0x080c,
+	0xc8f3, 0x0010, 0x9085, 0x0001, 0x0005, 0x080c, 0x6913, 0x0128,
+	0x080c, 0xc894, 0x0010, 0x9085, 0x0001, 0x0005, 0x080c, 0x6913,
+	0x0128, 0x080c, 0xc8f0, 0x0010, 0x9085, 0x0001, 0x0005, 0x080c,
+	0x6913, 0x0128, 0x080c, 0xc8b3, 0x0010, 0x9085, 0x0001, 0x0005,
+	0x080c, 0x6913, 0x0128, 0x080c, 0xc934, 0x0010, 0x9085, 0x0001,
+	0x0005, 0xb8a4, 0x900d, 0x1118, 0x9085, 0x0001, 0x0005, 0x0136,
 	0x01c6, 0xa800, 0x9005, 0x11b8, 0x890e, 0x810e, 0x810f, 0x9184,
 	0x003f, 0x20e0, 0x9184, 0xffc0, 0x9080, 0x0004, 0x2098, 0x20a9,
 	0x0001, 0x2009, 0x0010, 0x4002, 0x9606, 0x0128, 0x8109, 0x1dd8,
-	0x9085, 0x0001, 0x0068, 0x0146, 0x01d6, 0x3300, 0x8001, 0x20a0,
-	0x3c00, 0x20e8, 0x2001, 0xffff, 0x4004, 0x01de, 0x014e, 0x9006,
-	0x01ce, 0x013e, 0x0005, 0x0096, 0x0126, 0x2091, 0x8000, 0xb8a4,
-	0x904d, 0x1128, 0x080c, 0x103a, 0x0168, 0x2900, 0xb8a6, 0x080c,
-	0x68b0, 0xa803, 0x0001, 0xa807, 0x0000, 0x9085, 0x0001, 0x012e,
-	0x009e, 0x0005, 0x9006, 0x0cd8, 0x0096, 0x0126, 0x2091, 0x8000,
-	0xb8a4, 0x904d, 0x0130, 0xb8a7, 0x0000, 0x080c, 0x106c, 0x9085,
-	0x0001, 0x012e, 0x009e, 0x0005, 0xb89c, 0xd0a4, 0x0005, 0x00b6,
-	0x00f6, 0x080c, 0x74e9, 0x01b0, 0x71c4, 0x81ff, 0x1198, 0x71dc,
-	0xd19c, 0x0180, 0x2001, 0x007e, 0x9080, 0x1000, 0x2004, 0x905d,
-	0x0148, 0xb804, 0x9084, 0x00ff, 0x9086, 0x0006, 0x1118, 0xb800,
-	0xc0ed, 0xb802, 0x2079, 0x1847, 0x7804, 0xd0a4, 0x01d0, 0x0156,
-	0x20a9, 0x007f, 0x900e, 0x0016, 0x080c, 0x6625, 0x1168, 0xb804,
-	0x9084, 0xff00, 0x8007, 0x9096, 0x0004, 0x0118, 0x9086, 0x0006,
-	0x1118, 0xb800, 0xc0ed, 0xb802, 0x001e, 0x8108, 0x1f04, 0x693b,
-	0x015e, 0x080c, 0x6a29, 0x0120, 0x2001, 0x1985, 0x200c, 0x0038,
-	0x2079, 0x1847, 0x7804, 0xd0a4, 0x0130, 0x2009, 0x07d0, 0x2011,
-	0x6966, 0x080c, 0x8708, 0x00fe, 0x00be, 0x0005, 0x00b6, 0x2011,
-	0x6966, 0x080c, 0x863e, 0x080c, 0x6a29, 0x01d8, 0x2001, 0x107e,
-	0x2004, 0x2058, 0xb900, 0xc1ec, 0xb902, 0x080c, 0x6a67, 0x0130,
-	0x2009, 0x07d0, 0x2011, 0x6966, 0x080c, 0x8708, 0x00e6, 0x2071,
-	0x1800, 0x9006, 0x707e, 0x7060, 0x7082, 0x080c, 0x2fb2, 0x00ee,
-	0x04d0, 0x0156, 0x00c6, 0x20a9, 0x007f, 0x900e, 0x0016, 0x080c,
-	0x6625, 0x1558, 0xb800, 0xd0ec, 0x0540, 0x0046, 0xbaa0, 0x2220,
-	0x9006, 0x2009, 0x0029, 0x080c, 0xe2c9, 0xb800, 0xc0e5, 0xc0ec,
-	0xb802, 0x080c, 0x6a63, 0x2001, 0x0707, 0x1128, 0xb804, 0x9084,
-	0x00ff, 0x9085, 0x0700, 0xb806, 0x080c, 0xa896, 0x2019, 0x0029,
-	0x080c, 0x93a5, 0x0076, 0x903e, 0x080c, 0x9277, 0x900e, 0x080c,
-	0xdfeb, 0x007e, 0x004e, 0x080c, 0xa8b2, 0x001e, 0x8108, 0x1f04,
-	0x698e, 0x00ce, 0x015e, 0x00be, 0x0005, 0x00b6, 0x6010, 0x2058,
-	0xb800, 0xc0ec, 0xb802, 0x00be, 0x0005, 0x00b6, 0x00c6, 0x0096,
-	0x080c, 0x1053, 0x090c, 0x0d7d, 0x2958, 0x009e, 0x2001, 0x196b,
-	0x2b02, 0x8b07, 0x8006, 0x8006, 0x908c, 0x003f, 0xb9c6, 0x908c,
-	0xffc0, 0xb9ca, 0xb8af, 0x0000, 0x2009, 0x00ff, 0x080c, 0x6043,
-	0xb807, 0x0006, 0xb813, 0x00ff, 0xb817, 0xffff, 0xb86f, 0x0200,
-	0xb86c, 0xb893, 0x0002, 0xb8bb, 0x0520, 0xb8a3, 0x00ff, 0xb8af,
-	0x0000, 0x00ce, 0x00be, 0x0005, 0x7810, 0x00b6, 0x2058, 0xb800,
-	0x00be, 0xd0ac, 0x0005, 0x6010, 0x00b6, 0x905d, 0x0108, 0xb800,
-	0x00be, 0xd0bc, 0x0005, 0x0006, 0x0016, 0x0026, 0xb804, 0x908c,
-	0x00ff, 0x9196, 0x0006, 0x0188, 0x9196, 0x0004, 0x0170, 0x9196,
-	0x0005, 0x0158, 0x908c, 0xff00, 0x810f, 0x9196, 0x0006, 0x0128,
-	0x9196, 0x0004, 0x0110, 0x9196, 0x0005, 0x002e, 0x001e, 0x000e,
-	0x0005, 0x00b6, 0x00f6, 0x2001, 0x107e, 0x2004, 0x905d, 0x0110,
-	0xb800, 0xd0ec, 0x00fe, 0x00be, 0x0005, 0x0126, 0x0026, 0x2091,
-	0x8000, 0x0006, 0xbaa0, 0x9290, 0x1000, 0x2204, 0x9b06, 0x190c,
-	0x0d7d, 0x000e, 0xba00, 0x9005, 0x0110, 0xc2fd, 0x0008, 0xc2fc,
-	0xba02, 0x002e, 0x012e, 0x0005, 0x2011, 0x1837, 0x2204, 0xd0cc,
-	0x0138, 0x2001, 0x1983, 0x200c, 0x2011, 0x6a59, 0x080c, 0x8708,
-	0x0005, 0x2011, 0x6a59, 0x080c, 0x863e, 0x2011, 0x1837, 0x2204,
-	0xc0cc, 0x2012, 0x0005, 0x080c, 0x56da, 0xd0ac, 0x0005, 0x080c,
-	0x56da, 0xd0a4, 0x0005, 0x0016, 0xb904, 0x9184, 0x00ff, 0x908e,
-	0x0006, 0x001e, 0x0005, 0x0016, 0xb904, 0x9184, 0xff00, 0x8007,
-	0x908e, 0x0006, 0x001e, 0x0005, 0x00b6, 0x00f6, 0x080c, 0xcf52,
-	0x0158, 0x70dc, 0x9084, 0x0028, 0x0138, 0x2001, 0x107f, 0x2004,
-	0x905d, 0x0110, 0xb8d4, 0xd094, 0x00fe, 0x00be, 0x0005, 0x2071,
-	0x1910, 0x7003, 0x0001, 0x7007, 0x0000, 0x9006, 0x7012, 0x7016,
-	0x701a, 0x701e, 0x700a, 0x7046, 0x2001, 0x1947, 0x2003, 0x0000,
-	0x0005, 0x0016, 0x00e6, 0x2071, 0x1948, 0x900e, 0x710a, 0x080c,
-	0x56da, 0xd0fc, 0x1140, 0x080c, 0x56da, 0x900e, 0xd09c, 0x0108,
-	0x8108, 0x7102, 0x00f8, 0x2001, 0x1867, 0x200c, 0x9184, 0x0007,
-	0x0002, 0x6aab, 0x6aab, 0x6aab, 0x6aab, 0x6aab, 0x6ac1, 0x6acf,
-	0x6aab, 0x7003, 0x0003, 0x2009, 0x1868, 0x210c, 0x9184, 0xff00,
-	0x8007, 0x9005, 0x1110, 0x2001, 0x0002, 0x7006, 0x0018, 0x7003,
-	0x0005, 0x0c88, 0x00ee, 0x001e, 0x0005, 0x00e6, 0x2071, 0x0050,
-	0x684c, 0x9005, 0x1150, 0x00e6, 0x2071, 0x1910, 0x7028, 0xc085,
-	0x702a, 0x00ee, 0x9085, 0x0001, 0x0488, 0x6844, 0x9005, 0x0158,
-	0x080c, 0x785f, 0x6a60, 0x9200, 0x7002, 0x6864, 0x9101, 0x7006,
-	0x9006, 0x7012, 0x7016, 0x6860, 0x7002, 0x6864, 0x7006, 0x6868,
-	0x700a, 0x686c, 0x700e, 0x6844, 0x9005, 0x1110, 0x7012, 0x7016,
-	0x684c, 0x701a, 0x701c, 0x9085, 0x0040, 0x701e, 0x7037, 0x0019,
-	0x702b, 0x0001, 0x00e6, 0x2071, 0x1910, 0x7028, 0xc084, 0x702a,
-	0x7007, 0x0001, 0x700b, 0x0000, 0x00ee, 0x9006, 0x00ee, 0x0005,
-	0x00e6, 0x0026, 0x2071, 0x1948, 0x7000, 0x9015, 0x0904, 0x6d85,
-	0x9286, 0x0003, 0x0904, 0x6c15, 0x9286, 0x0005, 0x0904, 0x6c15,
-	0x2071, 0x1877, 0xa87c, 0x9005, 0x0904, 0x6b76, 0x7140, 0xa868,
-	0x9102, 0x0a04, 0x6d85, 0xa878, 0xd084, 0x15d8, 0xa853, 0x0019,
-	0x2001, 0x8023, 0xa84e, 0x2071, 0x1910, 0x701c, 0x9005, 0x1904,
-	0x6f28, 0x0e04, 0x6f96, 0x2071, 0x0000, 0xa850, 0x7032, 0xa84c,
-	0x7082, 0xa870, 0x7086, 0xa86c, 0x708a, 0xa880, 0x708e, 0x7036,
-	0x0146, 0x01d6, 0x0136, 0x01c6, 0x0156, 0x20e9, 0x0000, 0x20a1,
-	0x002a, 0xa868, 0x20a8, 0xa860, 0x20e0, 0xa85c, 0x9080, 0x0021,
-	0x2098, 0x4003, 0x015e, 0x01ce, 0x013e, 0x01de, 0x014e, 0x2091,
-	0x4080, 0x2001, 0x0089, 0x2004, 0xd084, 0x190c, 0x11d6, 0x0804,
-	0x6bf8, 0xa853, 0x001b, 0x2001, 0x8027, 0x0820, 0x7004, 0xd08c,
-	0x1904, 0x6d85, 0xa853, 0x001a, 0x2001, 0x8024, 0x0804, 0x6b3a,
-	0x00e6, 0x0026, 0x2071, 0x1948, 0x7000, 0x9015, 0x0904, 0x6d85,
-	0x9286, 0x0003, 0x0904, 0x6c15, 0x9286, 0x0005, 0x0904, 0x6c15,
-	0xa84f, 0x8022, 0xa853, 0x0018, 0x0804, 0x6bdd, 0xa868, 0xd0fc,
-	0x11d8, 0x00e6, 0x0026, 0x2001, 0x1948, 0x2004, 0x9005, 0x0904,
-	0x6d85, 0xa87c, 0xd0bc, 0x1904, 0x6d85, 0xa978, 0xa874, 0x9105,
-	0x1904, 0x6d85, 0x2001, 0x1948, 0x2004, 0x0002, 0x6d85, 0x6bd9,
-	0x6c15, 0x6c15, 0x6d85, 0x6c15, 0x0005, 0xa868, 0xd0fc, 0x1500,
-	0x00e6, 0x0026, 0x2009, 0x1948, 0x210c, 0x81ff, 0x0904, 0x6d85,
-	0xa87c, 0xd0cc, 0x0904, 0x6d85, 0xa880, 0x9084, 0x00ff, 0x9086,
-	0x0001, 0x1904, 0x6d85, 0x9186, 0x0003, 0x0904, 0x6c15, 0x9186,
-	0x0005, 0x0904, 0x6c15, 0xa84f, 0x8021, 0xa853, 0x0017, 0x0028,
-	0x0005, 0xa84f, 0x8020, 0xa853, 0x0016, 0x2071, 0x1910, 0x701c,
-	0x9005, 0x1904, 0x6f28, 0x0e04, 0x6f96, 0x2071, 0x0000, 0xa84c,
-	0x7082, 0xa850, 0x7032, 0xa86c, 0x7086, 0x7036, 0xa870, 0x708a,
-	0x2091, 0x4080, 0x2001, 0x0089, 0x2004, 0xd084, 0x190c, 0x11d6,
-	0x2071, 0x1800, 0x2011, 0x0001, 0xa804, 0x900d, 0x702c, 0x1158,
-	0xa802, 0x2900, 0x702e, 0x70c0, 0x9200, 0x70c2, 0x080c, 0x8553,
-	0x002e, 0x00ee, 0x0005, 0x0096, 0x2148, 0xa904, 0xa802, 0x8210,
-	0x2900, 0x81ff, 0x1dc8, 0x009e, 0x0c58, 0xa84f, 0x0000, 0x00f6,
-	0x2079, 0x0050, 0x2071, 0x1910, 0xa803, 0x0000, 0x7010, 0x9005,
-	0x1904, 0x6d0a, 0x782c, 0x908c, 0x0780, 0x190c, 0x70e2, 0x8004,
-	0x8004, 0x8004, 0x9084, 0x0003, 0x0002, 0x6c33, 0x6d0a, 0x6c58,
-	0x6ca5, 0x080c, 0x0d7d, 0x2071, 0x1800, 0x2900, 0x7822, 0xa804,
-	0x900d, 0x1170, 0x2071, 0x1a03, 0x703c, 0x9005, 0x1328, 0x2001,
-	0x1949, 0x2004, 0x8005, 0x703e, 0x00fe, 0x002e, 0x00ee, 0x0005,
-	0x9016, 0x702c, 0x2148, 0xa904, 0xa802, 0x8210, 0x2900, 0x81ff,
-	0x1dc8, 0x702e, 0x70c0, 0x9200, 0x70c2, 0x080c, 0x8553, 0x0c10,
-	0x2071, 0x1800, 0x2900, 0x7822, 0xa804, 0x900d, 0x15a8, 0x7824,
-	0x00e6, 0x2071, 0x0040, 0x712c, 0xd19c, 0x1170, 0x2009, 0x1830,
-	0x210c, 0x918a, 0x0020, 0x0240, 0x7022, 0x2001, 0x1dc0, 0x200c,
-	0x8108, 0x2102, 0x00ee, 0x0058, 0x00ee, 0x2048, 0x702c, 0xa802,
-	0x2900, 0x702e, 0x70c0, 0x8000, 0x70c2, 0x080c, 0x8553, 0x782c,
-	0x9094, 0x0780, 0x190c, 0x70e2, 0xd0a4, 0x19c8, 0x2071, 0x1a03,
-	0x703c, 0x9005, 0x1328, 0x2001, 0x1949, 0x2004, 0x8005, 0x703e,
-	0x00fe, 0x002e, 0x00ee, 0x0005, 0x9016, 0x702c, 0x2148, 0xa904,
-	0xa802, 0x8210, 0x2900, 0x81ff, 0x1dc8, 0x702e, 0x70c0, 0x9200,
-	0x70c2, 0x080c, 0x8553, 0x0804, 0x6c5f, 0x0096, 0x00e6, 0x7824,
-	0x2048, 0x2071, 0x1800, 0x702c, 0xa802, 0x2900, 0x702e, 0x70c0,
-	0x8000, 0x70c2, 0x080c, 0x8553, 0x782c, 0x9094, 0x0780, 0x190c,
-	0x70e2, 0xd0a4, 0x1d60, 0x00ee, 0x782c, 0x9094, 0x0780, 0x190c,
-	0x70e2, 0xd09c, 0x11a0, 0x009e, 0x2900, 0x7822, 0xa804, 0x900d,
-	0x1560, 0x2071, 0x1a03, 0x703c, 0x9005, 0x1328, 0x2001, 0x1949,
-	0x2004, 0x8005, 0x703e, 0x00fe, 0x002e, 0x00ee, 0x0005, 0x009e,
-	0x2908, 0x7010, 0x8000, 0x7012, 0x7018, 0x904d, 0x711a, 0x0110,
-	0xa902, 0x0008, 0x711e, 0x2148, 0xa804, 0x900d, 0x1170, 0x2071,
-	0x1a03, 0x703c, 0x9005, 0x1328, 0x2001, 0x1949, 0x2004, 0x8005,
-	0x703e, 0x00fe, 0x002e, 0x00ee, 0x0005, 0x2071, 0x1800, 0x9016,
+	0x9085, 0x0001, 0x0008, 0x9006, 0x01ce, 0x013e, 0x0005, 0x0146,
+	0x01d6, 0xa860, 0x20e8, 0xa85c, 0x9080, 0x0004, 0x20a0, 0x20a9,
+	0x0010, 0x2009, 0xffff, 0x4104, 0x01de, 0x014e, 0x0136, 0x01c6,
+	0xa800, 0x9005, 0x11b8, 0x890e, 0x810e, 0x810f, 0x9184, 0x003f,
+	0x20e0, 0x9184, 0xffc0, 0x9080, 0x0004, 0x2098, 0x20a9, 0x0001,
+	0x2009, 0x0010, 0x4002, 0x9606, 0x0128, 0x8109, 0x1dd8, 0x9085,
+	0x0001, 0x0068, 0x0146, 0x01d6, 0x3300, 0x8001, 0x20a0, 0x3c00,
+	0x20e8, 0x2001, 0xffff, 0x4004, 0x01de, 0x014e, 0x9006, 0x01ce,
+	0x013e, 0x0005, 0x0096, 0x0126, 0x2091, 0x8000, 0xb8a4, 0x904d,
+	0x1128, 0x080c, 0x103a, 0x0168, 0x2900, 0xb8a6, 0x080c, 0x68af,
+	0xa803, 0x0001, 0xa807, 0x0000, 0x9085, 0x0001, 0x012e, 0x009e,
+	0x0005, 0x9006, 0x0cd8, 0x0096, 0x0126, 0x2091, 0x8000, 0xb8a4,
+	0x904d, 0x0130, 0xb8a7, 0x0000, 0x080c, 0x106c, 0x9085, 0x0001,
+	0x012e, 0x009e, 0x0005, 0xb89c, 0xd0a4, 0x0005, 0x00b6, 0x00f6,
+	0x080c, 0x74c8, 0x01b0, 0x71c4, 0x81ff, 0x1198, 0x71dc, 0xd19c,
+	0x0180, 0x2001, 0x007e, 0x9080, 0x1000, 0x2004, 0x905d, 0x0148,
+	0xb804, 0x9084, 0x00ff, 0x9086, 0x0006, 0x1118, 0xb800, 0xc0ed,
+	0xb802, 0x2079, 0x1847, 0x7804, 0xd0a4, 0x01d0, 0x0156, 0x20a9,
+	0x007f, 0x900e, 0x0016, 0x080c, 0x6620, 0x1168, 0xb804, 0x9084,
+	0xff00, 0x8007, 0x9096, 0x0004, 0x0118, 0x9086, 0x0006, 0x1118,
+	0xb800, 0xc0ed, 0xb802, 0x001e, 0x8108, 0x1f04, 0x693a, 0x015e,
+	0x080c, 0x6a28, 0x0120, 0x2001, 0x1984, 0x200c, 0x0038, 0x2079,
+	0x1847, 0x7804, 0xd0a4, 0x0130, 0x2009, 0x07d0, 0x2011, 0x6965,
+	0x080c, 0x86e7, 0x00fe, 0x00be, 0x0005, 0x00b6, 0x2011, 0x6965,
+	0x080c, 0x861d, 0x080c, 0x6a28, 0x01d8, 0x2001, 0x107e, 0x2004,
+	0x2058, 0xb900, 0xc1ec, 0xb902, 0x080c, 0x6a66, 0x0130, 0x2009,
+	0x07d0, 0x2011, 0x6965, 0x080c, 0x86e7, 0x00e6, 0x2071, 0x1800,
+	0x9006, 0x707e, 0x7060, 0x7082, 0x080c, 0x2fc0, 0x00ee, 0x04d0,
+	0x0156, 0x00c6, 0x20a9, 0x007f, 0x900e, 0x0016, 0x080c, 0x6620,
+	0x1558, 0xb800, 0xd0ec, 0x0540, 0x0046, 0xbaa0, 0x2220, 0x9006,
+	0x2009, 0x0029, 0x080c, 0xe2d9, 0xb800, 0xc0e5, 0xc0ec, 0xb802,
+	0x080c, 0x6a62, 0x2001, 0x0707, 0x1128, 0xb804, 0x9084, 0x00ff,
+	0x9085, 0x0700, 0xb806, 0x080c, 0xa888, 0x2019, 0x0029, 0x080c,
+	0x938d, 0x0076, 0x903e, 0x080c, 0x9256, 0x900e, 0x080c, 0xdffb,
+	0x007e, 0x004e, 0x080c, 0xa8a4, 0x001e, 0x8108, 0x1f04, 0x698d,
+	0x00ce, 0x015e, 0x00be, 0x0005, 0x00b6, 0x6010, 0x2058, 0xb800,
+	0xc0ec, 0xb802, 0x00be, 0x0005, 0x00b6, 0x00c6, 0x0096, 0x080c,
+	0x1053, 0x090c, 0x0d7d, 0x2958, 0x009e, 0x2001, 0x196a, 0x2b02,
+	0x8b07, 0x8006, 0x8006, 0x908c, 0x003f, 0xb9c6, 0x908c, 0xffc0,
+	0xb9ca, 0xb8af, 0x0000, 0x2009, 0x00ff, 0x080c, 0x603e, 0xb807,
+	0x0006, 0xb813, 0x00ff, 0xb817, 0xffff, 0xb86f, 0x0200, 0xb86c,
+	0xb893, 0x0002, 0xb8bb, 0x0520, 0xb8a3, 0x00ff, 0xb8af, 0x0000,
+	0x00ce, 0x00be, 0x0005, 0x7810, 0x00b6, 0x2058, 0xb800, 0x00be,
+	0xd0ac, 0x0005, 0x6010, 0x00b6, 0x905d, 0x0108, 0xb800, 0x00be,
+	0xd0bc, 0x0005, 0x0006, 0x0016, 0x0026, 0xb804, 0x908c, 0x00ff,
+	0x9196, 0x0006, 0x0188, 0x9196, 0x0004, 0x0170, 0x9196, 0x0005,
+	0x0158, 0x908c, 0xff00, 0x810f, 0x9196, 0x0006, 0x0128, 0x9196,
+	0x0004, 0x0110, 0x9196, 0x0005, 0x002e, 0x001e, 0x000e, 0x0005,
+	0x00b6, 0x00f6, 0x2001, 0x107e, 0x2004, 0x905d, 0x0110, 0xb800,
+	0xd0ec, 0x00fe, 0x00be, 0x0005, 0x0126, 0x0026, 0x2091, 0x8000,
+	0x0006, 0xbaa0, 0x9290, 0x1000, 0x2204, 0x9b06, 0x190c, 0x0d7d,
+	0x000e, 0xba00, 0x9005, 0x0110, 0xc2fd, 0x0008, 0xc2fc, 0xba02,
+	0x002e, 0x012e, 0x0005, 0x2011, 0x1837, 0x2204, 0xd0cc, 0x0138,
+	0x2001, 0x1982, 0x200c, 0x2011, 0x6a58, 0x080c, 0x86e7, 0x0005,
+	0x2011, 0x6a58, 0x080c, 0x861d, 0x2011, 0x1837, 0x2204, 0xc0cc,
+	0x2012, 0x0005, 0x080c, 0x56d5, 0xd0ac, 0x0005, 0x080c, 0x56d5,
+	0xd0a4, 0x0005, 0x0016, 0xb904, 0x9184, 0x00ff, 0x908e, 0x0006,
+	0x001e, 0x0005, 0x0016, 0xb904, 0x9184, 0xff00, 0x8007, 0x908e,
+	0x0006, 0x001e, 0x0005, 0x00b6, 0x00f6, 0x080c, 0xcf51, 0x0158,
+	0x70dc, 0x9084, 0x0028, 0x0138, 0x2001, 0x107f, 0x2004, 0x905d,
+	0x0110, 0xb8d4, 0xd094, 0x00fe, 0x00be, 0x0005, 0x2071, 0x1910,
+	0x7003, 0x0001, 0x7007, 0x0000, 0x9006, 0x7012, 0x7016, 0x701a,
+	0x701e, 0x700a, 0x7046, 0x0005, 0x0016, 0x00e6, 0x2071, 0x1947,
+	0x900e, 0x710a, 0x080c, 0x56d5, 0xd0fc, 0x1140, 0x080c, 0x56d5,
+	0x900e, 0xd09c, 0x0108, 0x8108, 0x7102, 0x00f8, 0x2001, 0x1867,
+	0x200c, 0x9184, 0x0007, 0x0002, 0x6aa6, 0x6aa6, 0x6aa6, 0x6aa6,
+	0x6aa6, 0x6abc, 0x6aca, 0x6aa6, 0x7003, 0x0003, 0x2009, 0x1868,
+	0x210c, 0x9184, 0xff00, 0x8007, 0x9005, 0x1110, 0x2001, 0x0002,
+	0x7006, 0x0018, 0x7003, 0x0005, 0x0c88, 0x00ee, 0x001e, 0x0005,
+	0x00e6, 0x2071, 0x0050, 0x684c, 0x9005, 0x1150, 0x00e6, 0x2071,
+	0x1910, 0x7028, 0xc085, 0x702a, 0x00ee, 0x9085, 0x0001, 0x0488,
+	0x6844, 0x9005, 0x0158, 0x080c, 0x783e, 0x6a60, 0x9200, 0x7002,
+	0x6864, 0x9101, 0x7006, 0x9006, 0x7012, 0x7016, 0x6860, 0x7002,
+	0x6864, 0x7006, 0x6868, 0x700a, 0x686c, 0x700e, 0x6844, 0x9005,
+	0x1110, 0x7012, 0x7016, 0x684c, 0x701a, 0x701c, 0x9085, 0x0040,
+	0x701e, 0x7037, 0x0019, 0x702b, 0x0001, 0x00e6, 0x2071, 0x1910,
+	0x7028, 0xc084, 0x702a, 0x7007, 0x0001, 0x700b, 0x0000, 0x00ee,
+	0x9006, 0x00ee, 0x0005, 0x00e6, 0x0026, 0x2071, 0x1947, 0x7000,
+	0x9015, 0x0904, 0x6d80, 0x9286, 0x0003, 0x0904, 0x6c10, 0x9286,
+	0x0005, 0x0904, 0x6c10, 0x2071, 0x1877, 0xa87c, 0x9005, 0x0904,
+	0x6b71, 0x7140, 0xa868, 0x9102, 0x0a04, 0x6d80, 0xa878, 0xd084,
+	0x15d8, 0xa853, 0x0019, 0x2001, 0x8023, 0xa84e, 0x2071, 0x1910,
+	0x701c, 0x9005, 0x1904, 0x6f17, 0x0e04, 0x6f85, 0x2071, 0x0000,
+	0xa850, 0x7032, 0xa84c, 0x7082, 0xa870, 0x7086, 0xa86c, 0x708a,
+	0xa880, 0x708e, 0x7036, 0x0146, 0x01d6, 0x0136, 0x01c6, 0x0156,
+	0x20e9, 0x0000, 0x20a1, 0x002a, 0xa868, 0x20a8, 0xa860, 0x20e0,
+	0xa85c, 0x9080, 0x0021, 0x2098, 0x4003, 0x015e, 0x01ce, 0x013e,
+	0x01de, 0x014e, 0x2091, 0x4080, 0x2001, 0x0089, 0x2004, 0xd084,
+	0x190c, 0x11e1, 0x0804, 0x6bf3, 0xa853, 0x001b, 0x2001, 0x8027,
+	0x0820, 0x7004, 0xd08c, 0x1904, 0x6d80, 0xa853, 0x001a, 0x2001,
+	0x8024, 0x0804, 0x6b35, 0x00e6, 0x0026, 0x2071, 0x1947, 0x7000,
+	0x9015, 0x0904, 0x6d80, 0x9286, 0x0003, 0x0904, 0x6c10, 0x9286,
+	0x0005, 0x0904, 0x6c10, 0xa84f, 0x8022, 0xa853, 0x0018, 0x0804,
+	0x6bd8, 0xa868, 0xd0fc, 0x11d8, 0x00e6, 0x0026, 0x2001, 0x1947,
+	0x2004, 0x9005, 0x0904, 0x6d80, 0xa87c, 0xd0bc, 0x1904, 0x6d80,
+	0xa978, 0xa874, 0x9105, 0x1904, 0x6d80, 0x2001, 0x1947, 0x2004,
+	0x0002, 0x6d80, 0x6bd4, 0x6c10, 0x6c10, 0x6d80, 0x6c10, 0x0005,
+	0xa868, 0xd0fc, 0x1500, 0x00e6, 0x0026, 0x2009, 0x1947, 0x210c,
+	0x81ff, 0x0904, 0x6d80, 0xa87c, 0xd0cc, 0x0904, 0x6d80, 0xa880,
+	0x9084, 0x00ff, 0x9086, 0x0001, 0x1904, 0x6d80, 0x9186, 0x0003,
+	0x0904, 0x6c10, 0x9186, 0x0005, 0x0904, 0x6c10, 0xa84f, 0x8021,
+	0xa853, 0x0017, 0x0028, 0x0005, 0xa84f, 0x8020, 0xa853, 0x0016,
+	0x2071, 0x1910, 0x701c, 0x9005, 0x1904, 0x6f17, 0x0e04, 0x6f85,
+	0x2071, 0x0000, 0xa84c, 0x7082, 0xa850, 0x7032, 0xa86c, 0x7086,
+	0x7036, 0xa870, 0x708a, 0x2091, 0x4080, 0x2001, 0x0089, 0x2004,
+	0xd084, 0x190c, 0x11e1, 0x2071, 0x1800, 0x2011, 0x0001, 0xa804,
+	0x900d, 0x702c, 0x1158, 0xa802, 0x2900, 0x702e, 0x70c0, 0x9200,
+	0x70c2, 0x080c, 0x8532, 0x002e, 0x00ee, 0x0005, 0x0096, 0x2148,
+	0xa904, 0xa802, 0x8210, 0x2900, 0x81ff, 0x1dc8, 0x009e, 0x0c58,
+	0xa84f, 0x0000, 0x00f6, 0x2079, 0x0050, 0x2071, 0x1910, 0xa803,
+	0x0000, 0x7010, 0x9005, 0x1904, 0x6d05, 0x782c, 0x908c, 0x0780,
+	0x190c, 0x70d1, 0x8004, 0x8004, 0x8004, 0x9084, 0x0003, 0x0002,
+	0x6c2e, 0x6d05, 0x6c53, 0x6ca0, 0x080c, 0x0d7d, 0x2071, 0x1800,
+	0x2900, 0x7822, 0xa804, 0x900d, 0x1170, 0x2071, 0x1a02, 0x703c,
+	0x9005, 0x1328, 0x2001, 0x1948, 0x2004, 0x8005, 0x703e, 0x00fe,
+	0x002e, 0x00ee, 0x0005, 0x9016, 0x702c, 0x2148, 0xa904, 0xa802,
+	0x8210, 0x2900, 0x81ff, 0x1dc8, 0x702e, 0x70c0, 0x9200, 0x70c2,
+	0x080c, 0x8532, 0x0c10, 0x2071, 0x1800, 0x2900, 0x7822, 0xa804,
+	0x900d, 0x15a8, 0x7824, 0x00e6, 0x2071, 0x0040, 0x712c, 0xd19c,
+	0x1170, 0x2009, 0x1830, 0x210c, 0x918a, 0x0020, 0x0240, 0x7022,
+	0x2001, 0x1dc0, 0x200c, 0x8108, 0x2102, 0x00ee, 0x0058, 0x00ee,
+	0x2048, 0x702c, 0xa802, 0x2900, 0x702e, 0x70c0, 0x8000, 0x70c2,
+	0x080c, 0x8532, 0x782c, 0x9094, 0x0780, 0x190c, 0x70d1, 0xd0a4,
+	0x19c8, 0x2071, 0x1a02, 0x703c, 0x9005, 0x1328, 0x2001, 0x1948,
+	0x2004, 0x8005, 0x703e, 0x00fe, 0x002e, 0x00ee, 0x0005, 0x9016,
 	0x702c, 0x2148, 0xa904, 0xa802, 0x8210, 0x2900, 0x81ff, 0x1dc8,
-	0x702e, 0x70c0, 0x9200, 0x70c2, 0x080c, 0x8553, 0x00fe, 0x002e,
-	0x00ee, 0x0005, 0x2908, 0x7010, 0x8000, 0x7012, 0x7018, 0x904d,
-	0x711a, 0x0110, 0xa902, 0x0008, 0x711e, 0x2148, 0xa804, 0x900d,
-	0x1904, 0x6d5f, 0x782c, 0x9094, 0x0780, 0x190c, 0x70e2, 0xd09c,
-	0x1198, 0x701c, 0x904d, 0x0180, 0x7010, 0x8001, 0x7012, 0x1108,
-	0x701a, 0xa800, 0x701e, 0x2900, 0x7822, 0x782c, 0x9094, 0x0780,
-	0x190c, 0x70e2, 0xd09c, 0x0d68, 0x782c, 0x9094, 0x0780, 0x190c,
-	0x70e2, 0xd0a4, 0x01b0, 0x00e6, 0x7824, 0x2048, 0x2071, 0x1800,
-	0x702c, 0xa802, 0x2900, 0x702e, 0x70c0, 0x8000, 0x70c2, 0x080c,
-	0x8553, 0x782c, 0x9094, 0x0780, 0x190c, 0x70e2, 0xd0a4, 0x1d60,
-	0x00ee, 0x2071, 0x1a03, 0x703c, 0x9005, 0x1328, 0x2001, 0x1949,
-	0x2004, 0x8005, 0x703e, 0x00fe, 0x002e, 0x00ee, 0x0005, 0x00e6,
+	0x702e, 0x70c0, 0x9200, 0x70c2, 0x080c, 0x8532, 0x0804, 0x6c5a,
+	0x0096, 0x00e6, 0x7824, 0x2048, 0x2071, 0x1800, 0x702c, 0xa802,
+	0x2900, 0x702e, 0x70c0, 0x8000, 0x70c2, 0x080c, 0x8532, 0x782c,
+	0x9094, 0x0780, 0x190c, 0x70d1, 0xd0a4, 0x1d60, 0x00ee, 0x782c,
+	0x9094, 0x0780, 0x190c, 0x70d1, 0xd09c, 0x11a0, 0x009e, 0x2900,
+	0x7822, 0xa804, 0x900d, 0x1560, 0x2071, 0x1a02, 0x703c, 0x9005,
+	0x1328, 0x2001, 0x1948, 0x2004, 0x8005, 0x703e, 0x00fe, 0x002e,
+	0x00ee, 0x0005, 0x009e, 0x2908, 0x7010, 0x8000, 0x7012, 0x7018,
+	0x904d, 0x711a, 0x0110, 0xa902, 0x0008, 0x711e, 0x2148, 0xa804,
+	0x900d, 0x1170, 0x2071, 0x1a02, 0x703c, 0x9005, 0x1328, 0x2001,
+	0x1948, 0x2004, 0x8005, 0x703e, 0x00fe, 0x002e, 0x00ee, 0x0005,
 	0x2071, 0x1800, 0x9016, 0x702c, 0x2148, 0xa904, 0xa802, 0x8210,
 	0x2900, 0x81ff, 0x1dc8, 0x702e, 0x70c0, 0x9200, 0x70c2, 0x080c,
-	0x8553, 0x00ee, 0x0804, 0x6d1a, 0xa868, 0xd0fc, 0x1560, 0x0096,
-	0xa804, 0xa807, 0x0000, 0x904d, 0x190c, 0x0fec, 0x009e, 0x0018,
-	0xa868, 0xd0fc, 0x1500, 0x00e6, 0x0026, 0xa84f, 0x0000, 0x00f6,
-	0x2079, 0x0050, 0x2071, 0x1910, 0xa803, 0x0000, 0x7010, 0x9005,
-	0x1904, 0x6ea2, 0x782c, 0x908c, 0x0780, 0x190c, 0x70e2, 0x8004,
-	0x8004, 0x8004, 0x9084, 0x0003, 0x0002, 0x6da4, 0x6ea2, 0x6dbf,
-	0x6e31, 0x080c, 0x0d7d, 0x0005, 0x2071, 0x1800, 0x2900, 0x7822,
-	0xa804, 0x900d, 0x1120, 0x00fe, 0x002e, 0x00ee, 0x0005, 0x9016,
-	0x702c, 0x2148, 0xa904, 0xa802, 0x8210, 0x2900, 0x81ff, 0x1dc8,
-	0x702e, 0x70c0, 0x9200, 0x70c2, 0x080c, 0x8553, 0x0c60, 0x2071,
-	0x1800, 0x2900, 0x7822, 0xa804, 0x900d, 0x1904, 0x6e20, 0x7830,
-	0xd0dc, 0x1120, 0x00fe, 0x002e, 0x00ee, 0x0005, 0x7824, 0x00e6,
-	0x2071, 0x0040, 0x712c, 0xd19c, 0x1170, 0x2009, 0x1830, 0x210c,
-	0x918a, 0x0020, 0x0240, 0x7022, 0x2001, 0x1dc0, 0x200c, 0x8108,
-	0x2102, 0x00ee, 0x0058, 0x00ee, 0x2048, 0x702c, 0xa802, 0x2900,
-	0x702e, 0x70c0, 0x8000, 0x70c2, 0x080c, 0x8553, 0x782c, 0x9094,
-	0x0780, 0x190c, 0x70e2, 0xd0a4, 0x19c8, 0x0e04, 0x6e17, 0x7838,
-	0x7938, 0x910e, 0x1de0, 0x00d6, 0x2069, 0x0000, 0x6836, 0x6833,
-	0x0013, 0x00de, 0x2001, 0x1921, 0x200c, 0xc184, 0x2102, 0x2091,
-	0x4080, 0x2001, 0x0089, 0x2004, 0xd084, 0x190c, 0x11d6, 0x2009,
-	0x1947, 0x200b, 0x0000, 0x00fe, 0x002e, 0x00ee, 0x0005, 0x2001,
-	0x1921, 0x200c, 0xc185, 0x2102, 0x00fe, 0x002e, 0x00ee, 0x0005,
-	0x9016, 0x702c, 0x2148, 0xa904, 0xa802, 0x8210, 0x2900, 0x81ff,
-	0x1dc8, 0x702e, 0x70c0, 0x9200, 0x70c2, 0x080c, 0x8553, 0x0804,
-	0x6dce, 0x0096, 0x00e6, 0x7824, 0x2048, 0x2071, 0x1800, 0x702c,
-	0xa802, 0x2900, 0x702e, 0x70c0, 0x8000, 0x70c2, 0x080c, 0x8553,
-	0x782c, 0x9094, 0x0780, 0x190c, 0x70e2, 0xd0a4, 0x1d60, 0x00ee,
-	0x0e04, 0x6e75, 0x7838, 0x7938, 0x910e, 0x1de0, 0x00d6, 0x2069,
-	0x0000, 0x6836, 0x6833, 0x0013, 0x00de, 0x7044, 0xc084, 0x7046,
-	0x2091, 0x4080, 0x2001, 0x0089, 0x2004, 0xd084, 0x190c, 0x11d6,
-	0x2009, 0x1947, 0x200b, 0x0000, 0x782c, 0x9094, 0x0780, 0x190c,
-	0x70e2, 0xd09c, 0x1170, 0x009e, 0x2900, 0x7822, 0xa804, 0x900d,
-	0x11e0, 0x00fe, 0x002e, 0x00ee, 0x0005, 0x7044, 0xc085, 0x7046,
-	0x0c58, 0x009e, 0x2908, 0x7010, 0x8000, 0x7012, 0x7018, 0x904d,
-	0x711a, 0x0110, 0xa902, 0x0008, 0x711e, 0x2148, 0xa804, 0x900d,
-	0x1120, 0x00fe, 0x002e, 0x00ee, 0x0005, 0x2071, 0x1800, 0x9016,
-	0x702c, 0x2148, 0xa904, 0xa802, 0x8210, 0x2900, 0x81ff, 0x1dc8,
-	0x702e, 0x70c0, 0x9200, 0x70c2, 0x080c, 0x8553, 0x00fe, 0x002e,
-	0x00ee, 0x0005, 0x2908, 0x7010, 0x8000, 0x7012, 0x7018, 0x904d,
-	0x711a, 0x0110, 0xa902, 0x0008, 0x711e, 0x2148, 0xa804, 0x900d,
-	0x1904, 0x6f13, 0x782c, 0x9094, 0x0780, 0x190c, 0x70e2, 0xd09c,
-	0x11b0, 0x701c, 0x904d, 0x0198, 0xa84c, 0x9005, 0x1180, 0x7010,
+	0x8532, 0x00fe, 0x002e, 0x00ee, 0x0005, 0x2908, 0x7010, 0x8000,
+	0x7012, 0x7018, 0x904d, 0x711a, 0x0110, 0xa902, 0x0008, 0x711e,
+	0x2148, 0xa804, 0x900d, 0x1904, 0x6d5a, 0x782c, 0x9094, 0x0780,
+	0x190c, 0x70d1, 0xd09c, 0x1198, 0x701c, 0x904d, 0x0180, 0x7010,
 	0x8001, 0x7012, 0x1108, 0x701a, 0xa800, 0x701e, 0x2900, 0x7822,
-	0x782c, 0x9094, 0x0780, 0x190c, 0x70e2, 0xd09c, 0x0d50, 0x782c,
-	0x9094, 0x0780, 0x190c, 0x70e2, 0xd0a4, 0x05c8, 0x00e6, 0x7824,
+	0x782c, 0x9094, 0x0780, 0x190c, 0x70d1, 0xd09c, 0x0d68, 0x782c,
+	0x9094, 0x0780, 0x190c, 0x70d1, 0xd0a4, 0x01b0, 0x00e6, 0x7824,
 	0x2048, 0x2071, 0x1800, 0x702c, 0xa802, 0x2900, 0x702e, 0x70c0,
-	0x8000, 0x70c2, 0x080c, 0x8553, 0x782c, 0x9094, 0x0780, 0x190c,
-	0x70e2, 0xd0a4, 0x1d60, 0x00ee, 0x0e04, 0x6f0c, 0x7838, 0x7938,
-	0x910e, 0x1de0, 0x00d6, 0x2069, 0x0000, 0x6836, 0x6833, 0x0013,
-	0x00de, 0x7044, 0xc084, 0x7046, 0x2091, 0x4080, 0x2001, 0x0089,
-	0x2004, 0xd084, 0x190c, 0x11d6, 0x2009, 0x1947, 0x200b, 0x0000,
-	0x00fe, 0x002e, 0x00ee, 0x0005, 0x7044, 0xc085, 0x7046, 0x00fe,
-	0x002e, 0x00ee, 0x0005, 0x00e6, 0x2071, 0x1800, 0x9016, 0x702c,
-	0x2148, 0xa904, 0xa802, 0x8210, 0x2900, 0x81ff, 0x1dc8, 0x702e,
-	0x70c0, 0x9200, 0x70c2, 0x080c, 0x8553, 0x00ee, 0x0804, 0x6eb2,
-	0x2071, 0x1910, 0xa803, 0x0000, 0x2908, 0x7010, 0x8000, 0x7012,
-	0x7018, 0x904d, 0x711a, 0x0110, 0xa902, 0x0008, 0x711e, 0x2148,
-	0xa804, 0x900d, 0x1128, 0x1e04, 0x6f53, 0x002e, 0x00ee, 0x0005,
+	0x8000, 0x70c2, 0x080c, 0x8532, 0x782c, 0x9094, 0x0780, 0x190c,
+	0x70d1, 0xd0a4, 0x1d60, 0x00ee, 0x2071, 0x1a02, 0x703c, 0x9005,
+	0x1328, 0x2001, 0x1948, 0x2004, 0x8005, 0x703e, 0x00fe, 0x002e,
+	0x00ee, 0x0005, 0x00e6, 0x2071, 0x1800, 0x9016, 0x702c, 0x2148,
+	0xa904, 0xa802, 0x8210, 0x2900, 0x81ff, 0x1dc8, 0x702e, 0x70c0,
+	0x9200, 0x70c2, 0x080c, 0x8532, 0x00ee, 0x0804, 0x6d15, 0xa868,
+	0xd0fc, 0x1560, 0x0096, 0xa804, 0xa807, 0x0000, 0x904d, 0x190c,
+	0x0fec, 0x009e, 0x0018, 0xa868, 0xd0fc, 0x1500, 0x00e6, 0x0026,
+	0xa84f, 0x0000, 0x00f6, 0x2079, 0x0050, 0x2071, 0x1910, 0xa803,
+	0x0000, 0x7010, 0x9005, 0x1904, 0x6e95, 0x782c, 0x908c, 0x0780,
+	0x190c, 0x70d1, 0x8004, 0x8004, 0x8004, 0x9084, 0x0003, 0x0002,
+	0x6d9f, 0x6e95, 0x6dba, 0x6e28, 0x080c, 0x0d7d, 0x0005, 0x2071,
+	0x1800, 0x2900, 0x7822, 0xa804, 0x900d, 0x1120, 0x00fe, 0x002e,
+	0x00ee, 0x0005, 0x9016, 0x702c, 0x2148, 0xa904, 0xa802, 0x8210,
+	0x2900, 0x81ff, 0x1dc8, 0x702e, 0x70c0, 0x9200, 0x70c2, 0x080c,
+	0x8532, 0x0c60, 0x2071, 0x1800, 0x2900, 0x7822, 0xa804, 0x900d,
+	0x1904, 0x6e17, 0x7830, 0xd0dc, 0x1120, 0x00fe, 0x002e, 0x00ee,
+	0x0005, 0x7824, 0x00e6, 0x2071, 0x0040, 0x712c, 0xd19c, 0x1170,
+	0x2009, 0x1830, 0x210c, 0x918a, 0x0020, 0x0240, 0x7022, 0x2001,
+	0x1dc0, 0x200c, 0x8108, 0x2102, 0x00ee, 0x0058, 0x00ee, 0x2048,
+	0x702c, 0xa802, 0x2900, 0x702e, 0x70c0, 0x8000, 0x70c2, 0x080c,
+	0x8532, 0x782c, 0x9094, 0x0780, 0x190c, 0x70d1, 0xd0a4, 0x19c8,
+	0x0e04, 0x6e0e, 0x7838, 0x7938, 0x910e, 0x1de0, 0x00d6, 0x2069,
+	0x0000, 0x6836, 0x6833, 0x0013, 0x00de, 0x2001, 0x1921, 0x200c,
+	0xc184, 0x2102, 0x2091, 0x4080, 0x2001, 0x0089, 0x2004, 0xd084,
+	0x190c, 0x11e1, 0x00fe, 0x002e, 0x00ee, 0x0005, 0x2001, 0x1921,
+	0x200c, 0xc185, 0x2102, 0x00fe, 0x002e, 0x00ee, 0x0005, 0x9016,
+	0x702c, 0x2148, 0xa904, 0xa802, 0x8210, 0x2900, 0x81ff, 0x1dc8,
+	0x702e, 0x70c0, 0x9200, 0x70c2, 0x080c, 0x8532, 0x0804, 0x6dc9,
+	0x0096, 0x00e6, 0x7824, 0x2048, 0x2071, 0x1800, 0x702c, 0xa802,
+	0x2900, 0x702e, 0x70c0, 0x8000, 0x70c2, 0x080c, 0x8532, 0x782c,
+	0x9094, 0x0780, 0x190c, 0x70d1, 0xd0a4, 0x1d60, 0x00ee, 0x0e04,
+	0x6e68, 0x7838, 0x7938, 0x910e, 0x1de0, 0x00d6, 0x2069, 0x0000,
+	0x6836, 0x6833, 0x0013, 0x00de, 0x7044, 0xc084, 0x7046, 0x2091,
+	0x4080, 0x2001, 0x0089, 0x2004, 0xd084, 0x190c, 0x11e1, 0x782c,
+	0x9094, 0x0780, 0x190c, 0x70d1, 0xd09c, 0x1170, 0x009e, 0x2900,
+	0x7822, 0xa804, 0x900d, 0x11e0, 0x00fe, 0x002e, 0x00ee, 0x0005,
+	0x7044, 0xc085, 0x7046, 0x0c58, 0x009e, 0x2908, 0x7010, 0x8000,
+	0x7012, 0x7018, 0x904d, 0x711a, 0x0110, 0xa902, 0x0008, 0x711e,
+	0x2148, 0xa804, 0x900d, 0x1120, 0x00fe, 0x002e, 0x00ee, 0x0005,
 	0x2071, 0x1800, 0x9016, 0x702c, 0x2148, 0xa904, 0xa802, 0x8210,
 	0x2900, 0x81ff, 0x1dc8, 0x702e, 0x70c0, 0x9200, 0x70c2, 0x080c,
-	0x8553, 0x0e04, 0x6f3d, 0x2071, 0x1910, 0x701c, 0x2048, 0xa84c,
-	0x900d, 0x0d18, 0x2071, 0x0000, 0x7182, 0xa850, 0x7032, 0xa86c,
+	0x8532, 0x00fe, 0x002e, 0x00ee, 0x0005, 0x2908, 0x7010, 0x8000,
+	0x7012, 0x7018, 0x904d, 0x711a, 0x0110, 0xa902, 0x0008, 0x711e,
+	0x2148, 0xa804, 0x900d, 0x1904, 0x6f02, 0x782c, 0x9094, 0x0780,
+	0x190c, 0x70d1, 0xd09c, 0x11b0, 0x701c, 0x904d, 0x0198, 0xa84c,
+	0x9005, 0x1180, 0x7010, 0x8001, 0x7012, 0x1108, 0x701a, 0xa800,
+	0x701e, 0x2900, 0x7822, 0x782c, 0x9094, 0x0780, 0x190c, 0x70d1,
+	0xd09c, 0x0d50, 0x782c, 0x9094, 0x0780, 0x190c, 0x70d1, 0xd0a4,
+	0x05a8, 0x00e6, 0x7824, 0x2048, 0x2071, 0x1800, 0x702c, 0xa802,
+	0x2900, 0x702e, 0x70c0, 0x8000, 0x70c2, 0x080c, 0x8532, 0x782c,
+	0x9094, 0x0780, 0x190c, 0x70d1, 0xd0a4, 0x1d60, 0x00ee, 0x0e04,
+	0x6efb, 0x7838, 0x7938, 0x910e, 0x1de0, 0x00d6, 0x2069, 0x0000,
+	0x6836, 0x6833, 0x0013, 0x00de, 0x7044, 0xc084, 0x7046, 0x2091,
+	0x4080, 0x2001, 0x0089, 0x2004, 0xd084, 0x190c, 0x11e1, 0x00fe,
+	0x002e, 0x00ee, 0x0005, 0x7044, 0xc085, 0x7046, 0x00fe, 0x002e,
+	0x00ee, 0x0005, 0x00e6, 0x2071, 0x1800, 0x9016, 0x702c, 0x2148,
+	0xa904, 0xa802, 0x8210, 0x2900, 0x81ff, 0x1dc8, 0x702e, 0x70c0,
+	0x9200, 0x70c2, 0x080c, 0x8532, 0x00ee, 0x0804, 0x6ea5, 0x2071,
+	0x1910, 0xa803, 0x0000, 0x2908, 0x7010, 0x8000, 0x7012, 0x7018,
+	0x904d, 0x711a, 0x0110, 0xa902, 0x0008, 0x711e, 0x2148, 0xa804,
+	0x900d, 0x1128, 0x1e04, 0x6f42, 0x002e, 0x00ee, 0x0005, 0x2071,
+	0x1800, 0x9016, 0x702c, 0x2148, 0xa904, 0xa802, 0x8210, 0x2900,
+	0x81ff, 0x1dc8, 0x702e, 0x70c0, 0x9200, 0x70c2, 0x080c, 0x8532,
+	0x0e04, 0x6f2c, 0x2071, 0x1910, 0x701c, 0x2048, 0xa84c, 0x900d,
+	0x0d18, 0x2071, 0x0000, 0x7182, 0xa850, 0x7032, 0xa86c, 0x7086,
+	0x7036, 0xa870, 0x708a, 0xa850, 0x9082, 0x0019, 0x1278, 0x2091,
+	0x4080, 0x2001, 0x0089, 0x2004, 0xd084, 0x190c, 0x11e1, 0x2071,
+	0x1910, 0x080c, 0x70bd, 0x002e, 0x00ee, 0x0005, 0xa850, 0x9082,
+	0x001c, 0x1e68, 0xa880, 0x708e, 0x7036, 0x0146, 0x01d6, 0x0136,
+	0x01c6, 0x0156, 0x20e9, 0x0000, 0x20a1, 0x002a, 0xa868, 0x20a8,
+	0xa860, 0x20e0, 0xa85c, 0x9080, 0x0021, 0x2098, 0x4003, 0x015e,
+	0x01ce, 0x013e, 0x01de, 0x014e, 0x0890, 0x2071, 0x1910, 0xa803,
+	0x0000, 0x2908, 0x7010, 0x8000, 0x7012, 0x7018, 0x904d, 0x711a,
+	0x0110, 0xa902, 0x0008, 0x711e, 0x2148, 0xa804, 0x900d, 0x1118,
+	0x002e, 0x00ee, 0x0005, 0x2071, 0x1800, 0x9016, 0x702c, 0x2148,
+	0xa904, 0xa802, 0x8210, 0x2900, 0x81ff, 0x1dc8, 0x702e, 0x70c0,
+	0x9200, 0x70c2, 0x080c, 0x8532, 0x002e, 0x00ee, 0x0005, 0x0006,
+	0xa87c, 0x0006, 0xa867, 0x0103, 0x20a9, 0x001c, 0xa860, 0x20e8,
+	0xa85c, 0x9080, 0x001d, 0x20a0, 0x9006, 0x4004, 0x000e, 0x9084,
+	0x00ff, 0xa87e, 0x000e, 0xa87a, 0xa982, 0x0005, 0x2071, 0x1910,
+	0x7004, 0x0002, 0x6fd0, 0x6fd1, 0x70bc, 0x6fd1, 0x0d7d, 0x70bc,
+	0x0005, 0x2001, 0x1947, 0x2004, 0x0002, 0x6fdb, 0x6fdb, 0x7055,
+	0x7056, 0x6fdb, 0x7056, 0x0126, 0x2091, 0x8000, 0x1e0c, 0x70dc,
+	0x701c, 0x904d, 0x0508, 0xa84c, 0x9005, 0x0904, 0x7026, 0x0e04,
+	0x7004, 0xa94c, 0x2071, 0x0000, 0x7182, 0xa850, 0x7032, 0xa86c,
 	0x7086, 0x7036, 0xa870, 0x708a, 0xa850, 0x9082, 0x0019, 0x1278,
-	0x2091, 0x4080, 0x2001, 0x0089, 0x2004, 0xd084, 0x190c, 0x11d6,
-	0x2071, 0x1910, 0x080c, 0x70ce, 0x002e, 0x00ee, 0x0005, 0xa850,
+	0x2091, 0x4080, 0x2001, 0x0089, 0x2004, 0xd084, 0x190c, 0x11e1,
+	0x2071, 0x1910, 0x080c, 0x70bd, 0x012e, 0x0804, 0x7054, 0xa850,
 	0x9082, 0x001c, 0x1e68, 0xa880, 0x708e, 0x7036, 0x0146, 0x01d6,
 	0x0136, 0x01c6, 0x0156, 0x20e9, 0x0000, 0x20a1, 0x002a, 0xa868,
 	0x20a8, 0xa860, 0x20e0, 0xa85c, 0x9080, 0x0021, 0x2098, 0x4003,
-	0x015e, 0x01ce, 0x013e, 0x01de, 0x014e, 0x0890, 0x2071, 0x1910,
-	0xa803, 0x0000, 0x2908, 0x7010, 0x8000, 0x7012, 0x7018, 0x904d,
-	0x711a, 0x0110, 0xa902, 0x0008, 0x711e, 0x2148, 0xa804, 0x900d,
-	0x1118, 0x002e, 0x00ee, 0x0005, 0x2071, 0x1800, 0x9016, 0x702c,
-	0x2148, 0xa904, 0xa802, 0x8210, 0x2900, 0x81ff, 0x1dc8, 0x702e,
-	0x70c0, 0x9200, 0x70c2, 0x080c, 0x8553, 0x002e, 0x00ee, 0x0005,
-	0x0006, 0xa87c, 0x0006, 0xa867, 0x0103, 0x20a9, 0x001c, 0xa860,
-	0x20e8, 0xa85c, 0x9080, 0x001d, 0x20a0, 0x9006, 0x4004, 0x000e,
-	0x9084, 0x00ff, 0xa87e, 0x000e, 0xa87a, 0xa982, 0x0005, 0x2071,
-	0x1910, 0x7004, 0x0002, 0x6fe1, 0x6fe2, 0x70cd, 0x6fe2, 0x0d7d,
-	0x70cd, 0x0005, 0x2001, 0x1948, 0x2004, 0x0002, 0x6fec, 0x6fec,
-	0x7066, 0x7067, 0x6fec, 0x7067, 0x0126, 0x2091, 0x8000, 0x1e0c,
-	0x70ed, 0x701c, 0x904d, 0x0508, 0xa84c, 0x9005, 0x0904, 0x7037,
-	0x0e04, 0x7015, 0xa94c, 0x2071, 0x0000, 0x7182, 0xa850, 0x7032,
-	0xa86c, 0x7086, 0x7036, 0xa870, 0x708a, 0xa850, 0x9082, 0x0019,
-	0x1278, 0x2091, 0x4080, 0x2001, 0x0089, 0x2004, 0xd084, 0x190c,
-	0x11d6, 0x2071, 0x1910, 0x080c, 0x70ce, 0x012e, 0x0804, 0x7065,
-	0xa850, 0x9082, 0x001c, 0x1e68, 0xa880, 0x708e, 0x7036, 0x0146,
-	0x01d6, 0x0136, 0x01c6, 0x0156, 0x20e9, 0x0000, 0x20a1, 0x002a,
-	0xa868, 0x20a8, 0xa860, 0x20e0, 0xa85c, 0x9080, 0x0021, 0x2098,
-	0x4003, 0x015e, 0x01ce, 0x013e, 0x01de, 0x014e, 0x0890, 0x2001,
-	0x005b, 0x2004, 0x9094, 0x0780, 0x190c, 0x70e2, 0xd09c, 0x2071,
-	0x1910, 0x1510, 0x2071, 0x1910, 0x700f, 0x0001, 0xa964, 0x9184,
+	0x015e, 0x01ce, 0x013e, 0x01de, 0x014e, 0x0890, 0x2001, 0x005b,
+	0x2004, 0x9094, 0x0780, 0x190c, 0x70d1, 0xd09c, 0x2071, 0x1910,
+	0x1510, 0x2071, 0x1910, 0x700f, 0x0001, 0xa964, 0x9184, 0x00ff,
+	0x9086, 0x0003, 0x1130, 0x810f, 0x918c, 0x00ff, 0x8101, 0x0108,
+	0x710e, 0x2900, 0x00d6, 0x2069, 0x0050, 0x6822, 0x00de, 0x2071,
+	0x1910, 0x701c, 0x2048, 0x7010, 0x8001, 0x7012, 0xa800, 0x701e,
+	0x9005, 0x1108, 0x701a, 0x012e, 0x0005, 0x0005, 0x00d6, 0x2008,
+	0x2069, 0x1a02, 0x683c, 0x9005, 0x0760, 0x0158, 0x9186, 0x0003,
+	0x0540, 0x2001, 0x1815, 0x2004, 0x2009, 0x1b4d, 0x210c, 0x9102,
+	0x1500, 0x0126, 0x2091, 0x8000, 0x2069, 0x0050, 0x693c, 0x6838,
+	0x9106, 0x0190, 0x0e04, 0x7088, 0x2069, 0x0000, 0x6837, 0x8040,
+	0x6833, 0x0012, 0x6883, 0x8040, 0x2091, 0x4080, 0x2001, 0x0089,
+	0x2004, 0xd084, 0x190c, 0x11e1, 0x2069, 0x1a02, 0x683f, 0xffff,
+	0x012e, 0x00de, 0x0126, 0x2091, 0x8000, 0x1e0c, 0x7142, 0x701c,
+	0x904d, 0x0540, 0x2001, 0x005b, 0x2004, 0x9094, 0x0780, 0x15c9,
+	0xd09c, 0x1500, 0x2071, 0x1910, 0x700f, 0x0001, 0xa964, 0x9184,
 	0x00ff, 0x9086, 0x0003, 0x1130, 0x810f, 0x918c, 0x00ff, 0x8101,
 	0x0108, 0x710e, 0x2900, 0x00d6, 0x2069, 0x0050, 0x6822, 0x00de,
-	0x2071, 0x1910, 0x701c, 0x2048, 0x7010, 0x8001, 0x7012, 0xa800,
-	0x701e, 0x9005, 0x1108, 0x701a, 0x012e, 0x0005, 0x0005, 0x00d6,
-	0x2008, 0x2069, 0x1a03, 0x683c, 0x9005, 0x0760, 0x0158, 0x9186,
-	0x0003, 0x0540, 0x2001, 0x1815, 0x2004, 0x2009, 0x1b4e, 0x210c,
-	0x9102, 0x1500, 0x0126, 0x2091, 0x8000, 0x2069, 0x0050, 0x693c,
-	0x6838, 0x9106, 0x0190, 0x0e04, 0x7099, 0x2069, 0x0000, 0x6837,
-	0x8040, 0x6833, 0x0012, 0x6883, 0x8040, 0x2091, 0x4080, 0x2001,
-	0x0089, 0x2004, 0xd084, 0x190c, 0x11d6, 0x2069, 0x1a03, 0x683f,
-	0xffff, 0x012e, 0x00de, 0x0126, 0x2091, 0x8000, 0x1e0c, 0x7163,
-	0x701c, 0x904d, 0x0540, 0x2001, 0x005b, 0x2004, 0x9094, 0x0780,
-	0x15c9, 0xd09c, 0x1500, 0x2071, 0x1910, 0x700f, 0x0001, 0xa964,
-	0x9184, 0x00ff, 0x9086, 0x0003, 0x1130, 0x810f, 0x918c, 0x00ff,
-	0x8101, 0x0108, 0x710e, 0x2900, 0x00d6, 0x2069, 0x0050, 0x6822,
-	0x00de, 0x701c, 0x2048, 0x7010, 0x8001, 0x7012, 0xa800, 0x701e,
-	0x9005, 0x1108, 0x701a, 0x012e, 0x0005, 0x0005, 0x0126, 0x2091,
-	0x8000, 0x701c, 0x904d, 0x0160, 0x7010, 0x8001, 0x7012, 0xa800,
-	0x701e, 0x9005, 0x1108, 0x701a, 0x012e, 0x080c, 0x106c, 0x0005,
-	0x012e, 0x0005, 0x2091, 0x8000, 0x0e04, 0x70e4, 0x0006, 0x0016,
-	0x2001, 0x8004, 0x0006, 0x0804, 0x0d86, 0x0096, 0x00f6, 0x2079,
-	0x0050, 0x7044, 0xd084, 0x01e0, 0xc084, 0x7046, 0x7838, 0x7938,
-	0x910e, 0x1de0, 0x00d6, 0x2069, 0x0000, 0x6836, 0x6833, 0x0013,
-	0x00de, 0x2091, 0x4080, 0x2001, 0x0089, 0x2004, 0xd084, 0x190c,
-	0x11d6, 0x2009, 0x1947, 0x200b, 0x0000, 0x00fe, 0x009e, 0x0005,
-	0x782c, 0x9094, 0x0780, 0x1971, 0xd0a4, 0x0db8, 0x2009, 0x1947,
-	0x2104, 0x8000, 0x200a, 0x9082, 0x000f, 0x0e78, 0x00e6, 0x2071,
-	0x1800, 0x7824, 0x00e6, 0x2071, 0x0040, 0x712c, 0xd19c, 0x1170,
-	0x2009, 0x1830, 0x210c, 0x918a, 0x0020, 0x0240, 0x7022, 0x2001,
-	0x1dc0, 0x200c, 0x8108, 0x2102, 0x00ee, 0x0058, 0x00ee, 0x2048,
-	0x702c, 0xa802, 0x2900, 0x702e, 0x70c0, 0x8000, 0x70c2, 0x080c,
-	0x8553, 0x782c, 0x9094, 0x0780, 0x190c, 0x70e2, 0xd0a4, 0x19c8,
-	0x7838, 0x7938, 0x910e, 0x1de0, 0x00d6, 0x2069, 0x0000, 0x6836,
-	0x6833, 0x0013, 0x00de, 0x2091, 0x4080, 0x2001, 0x0089, 0x2004,
-	0xd084, 0x190c, 0x11d6, 0x2009, 0x1947, 0x200b, 0x0000, 0x00ee,
-	0x00fe, 0x009e, 0x0005, 0x00f6, 0x2079, 0x0050, 0x7044, 0xd084,
-	0x01b8, 0xc084, 0x7046, 0x7838, 0x7938, 0x910e, 0x1de0, 0x00d6,
+	0x701c, 0x2048, 0x7010, 0x8001, 0x7012, 0xa800, 0x701e, 0x9005,
+	0x1108, 0x701a, 0x012e, 0x0005, 0x0005, 0x0126, 0x2091, 0x8000,
+	0x701c, 0x904d, 0x0160, 0x7010, 0x8001, 0x7012, 0xa800, 0x701e,
+	0x9005, 0x1108, 0x701a, 0x012e, 0x080c, 0x106c, 0x0005, 0x012e,
+	0x0005, 0x2091, 0x8000, 0x0e04, 0x70d3, 0x0006, 0x0016, 0x2001,
+	0x8004, 0x0006, 0x0804, 0x0d86, 0x0096, 0x00f6, 0x2079, 0x0050,
+	0x7044, 0xd084, 0x01c0, 0xc084, 0x7046, 0x7838, 0x7938, 0x910e,
+	0x1de0, 0x00d6, 0x2069, 0x0000, 0x6836, 0x6833, 0x0013, 0x00de,
+	0x2091, 0x4080, 0x2001, 0x0089, 0x2004, 0xd084, 0x190c, 0x11e1,
+	0x00fe, 0x009e, 0x0005, 0x782c, 0x9094, 0x0780, 0x1991, 0xd0a4,
+	0x0db8, 0x00e6, 0x2071, 0x1800, 0x7824, 0x00e6, 0x2071, 0x0040,
+	0x712c, 0xd19c, 0x1170, 0x2009, 0x1830, 0x210c, 0x918a, 0x0020,
+	0x0240, 0x7022, 0x2001, 0x1dc0, 0x200c, 0x8108, 0x2102, 0x00ee,
+	0x0058, 0x00ee, 0x2048, 0x702c, 0xa802, 0x2900, 0x702e, 0x70c0,
+	0x8000, 0x70c2, 0x080c, 0x8532, 0x782c, 0x9094, 0x0780, 0x190c,
+	0x70d1, 0xd0a4, 0x19c8, 0x7838, 0x7938, 0x910e, 0x1de0, 0x00d6,
 	0x2069, 0x0000, 0x6836, 0x6833, 0x0013, 0x00de, 0x2091, 0x4080,
-	0x2001, 0x0089, 0x2004, 0xd084, 0x190c, 0x11d6, 0x00fe, 0x0005,
-	0x782c, 0x9094, 0x0780, 0x190c, 0x70e2, 0xd0a4, 0x0db8, 0x00e6,
-	0x2071, 0x1800, 0x7824, 0x2048, 0x702c, 0xa802, 0x2900, 0x702e,
-	0x70c0, 0x8000, 0x70c2, 0x080c, 0x8553, 0x782c, 0x9094, 0x0780,
-	0x190c, 0x70e2, 0xd0a4, 0x1d70, 0x00d6, 0x2069, 0x0050, 0x693c,
-	0x2069, 0x1948, 0x6808, 0x690a, 0x2069, 0x1a03, 0x9102, 0x1118,
-	0x683c, 0x9005, 0x1328, 0x2001, 0x1949, 0x200c, 0x810d, 0x693e,
-	0x00de, 0x00ee, 0x00fe, 0x0005, 0x7098, 0x908a, 0x0029, 0x1a0c,
-	0x0d7d, 0x9082, 0x001d, 0x003b, 0x0026, 0x2011, 0x1e00, 0x080c,
-	0x2a44, 0x002e, 0x0005, 0x728f, 0x7215, 0x7231, 0x725b, 0x727e,
-	0x72be, 0x72d0, 0x7231, 0x72a6, 0x71d0, 0x71fe, 0x71cf, 0x0005,
-	0x00d6, 0x2069, 0x0200, 0x6804, 0x9005, 0x1180, 0x6808, 0x9005,
-	0x1518, 0x709b, 0x0028, 0x2069, 0x198f, 0x2d04, 0x7002, 0x080c,
-	0x762b, 0x6028, 0x9085, 0x0600, 0x602a, 0x00b0, 0x709b, 0x0028,
-	0x2069, 0x198f, 0x2d04, 0x7002, 0x6028, 0x9085, 0x0600, 0x602a,
-	0x00e6, 0x0036, 0x0046, 0x0056, 0x2071, 0x1a6b, 0x080c, 0x1ab5,
-	0x005e, 0x004e, 0x003e, 0x00ee, 0x00de, 0x0005, 0x00d6, 0x2069,
-	0x0200, 0x6804, 0x9005, 0x1178, 0x6808, 0x9005, 0x1160, 0x709b,
-	0x0028, 0x2069, 0x198f, 0x2d04, 0x7002, 0x080c, 0x76ce, 0x6028,
-	0x9085, 0x0600, 0x602a, 0x00de, 0x0005, 0x0006, 0x2001, 0x0090,
-	0x080c, 0x2a0a, 0x000e, 0x6124, 0xd1e4, 0x1190, 0x080c, 0x7341,
-	0xd1d4, 0x1160, 0xd1dc, 0x1138, 0xd1cc, 0x0150, 0x709b, 0x0020,
-	0x080c, 0x7341, 0x0028, 0x709b, 0x001d, 0x0010, 0x709b, 0x001f,
-	0x0005, 0x2001, 0x0088, 0x080c, 0x2a0a, 0x6124, 0xd1cc, 0x11e8,
-	0xd1dc, 0x11c0, 0xd1e4, 0x1198, 0x9184, 0x1e00, 0x11d8, 0x080c,
-	0x1adf, 0x60e3, 0x0001, 0x600c, 0xc0b4, 0x600e, 0x080c, 0x7515,
-	0x2001, 0x0080, 0x080c, 0x2a0a, 0x709b, 0x0028, 0x0058, 0x709b,
-	0x001e, 0x0040, 0x709b, 0x001d, 0x0028, 0x709b, 0x0020, 0x0010,
-	0x709b, 0x001f, 0x0005, 0x080c, 0x1adf, 0x60e3, 0x0001, 0x600c,
-	0xc0b4, 0x600e, 0x080c, 0x7515, 0x2001, 0x0080, 0x080c, 0x2a0a,
-	0x6124, 0xd1d4, 0x1180, 0xd1dc, 0x1158, 0xd1e4, 0x1130, 0x9184,
-	0x1e00, 0x1158, 0x709b, 0x0028, 0x0040, 0x709b, 0x001e, 0x0028,
-	0x709b, 0x001d, 0x0010, 0x709b, 0x001f, 0x0005, 0x2001, 0x00a0,
-	0x080c, 0x2a0a, 0x6124, 0xd1dc, 0x1138, 0xd1e4, 0x0138, 0x080c,
-	0x1adf, 0x709b, 0x001e, 0x0010, 0x709b, 0x001d, 0x0005, 0x080c,
-	0x73ca, 0x6124, 0xd1dc, 0x1188, 0x080c, 0x7341, 0x0016, 0x080c,
-	0x1adf, 0x001e, 0xd1d4, 0x1128, 0xd1e4, 0x0138, 0x709b, 0x001e,
-	0x0020, 0x709b, 0x001f, 0x080c, 0x7341, 0x0005, 0x0006, 0x2001,
-	0x00a0, 0x080c, 0x2a0a, 0x000e, 0x6124, 0xd1d4, 0x1160, 0xd1cc,
-	0x1150, 0xd1dc, 0x1128, 0xd1e4, 0x0140, 0x709b, 0x001e, 0x0028,
-	0x709b, 0x001d, 0x0010, 0x709b, 0x0021, 0x0005, 0x080c, 0x73ca,
-	0x6124, 0xd1d4, 0x1150, 0xd1dc, 0x1128, 0xd1e4, 0x0140, 0x709b,
-	0x001e, 0x0028, 0x709b, 0x001d, 0x0010, 0x709b, 0x001f, 0x0005,
-	0x0006, 0x2001, 0x0090, 0x080c, 0x2a0a, 0x000e, 0x6124, 0xd1d4,
-	0x1178, 0xd1cc, 0x1150, 0xd1dc, 0x1128, 0xd1e4, 0x0158, 0x709b,
-	0x001e, 0x0040, 0x709b, 0x001d, 0x0028, 0x709b, 0x0020, 0x0010,
-	0x709b, 0x001f, 0x0005, 0x0016, 0x00c6, 0x00d6, 0x00e6, 0x0126,
+	0x2001, 0x0089, 0x2004, 0xd084, 0x190c, 0x11e1, 0x00ee, 0x00fe,
+	0x009e, 0x0005, 0x00f6, 0x2079, 0x0050, 0x7044, 0xd084, 0x01b8,
+	0xc084, 0x7046, 0x7838, 0x7938, 0x910e, 0x1de0, 0x00d6, 0x2069,
+	0x0000, 0x6836, 0x6833, 0x0013, 0x00de, 0x2091, 0x4080, 0x2001,
+	0x0089, 0x2004, 0xd084, 0x190c, 0x11e1, 0x00fe, 0x0005, 0x782c,
+	0x9094, 0x0780, 0x190c, 0x70d1, 0xd0a4, 0x0db8, 0x00e6, 0x2071,
+	0x1800, 0x7824, 0x2048, 0x702c, 0xa802, 0x2900, 0x702e, 0x70c0,
+	0x8000, 0x70c2, 0x080c, 0x8532, 0x782c, 0x9094, 0x0780, 0x190c,
+	0x70d1, 0xd0a4, 0x1d70, 0x00d6, 0x2069, 0x0050, 0x693c, 0x2069,
+	0x1947, 0x6808, 0x690a, 0x2069, 0x1a02, 0x9102, 0x1118, 0x683c,
+	0x9005, 0x1328, 0x2001, 0x1948, 0x200c, 0x810d, 0x693e, 0x00de,
+	0x00ee, 0x00fe, 0x0005, 0x7098, 0x908a, 0x0029, 0x1a0c, 0x0d7d,
+	0x9082, 0x001d, 0x003b, 0x0026, 0x2011, 0x1e00, 0x080c, 0x2a63,
+	0x002e, 0x0005, 0x726e, 0x71f4, 0x7210, 0x723a, 0x725d, 0x729d,
+	0x72af, 0x7210, 0x7285, 0x71af, 0x71dd, 0x71ae, 0x0005, 0x00d6,
+	0x2069, 0x0200, 0x6804, 0x9005, 0x1180, 0x6808, 0x9005, 0x1518,
+	0x709b, 0x0028, 0x2069, 0x198e, 0x2d04, 0x7002, 0x080c, 0x760a,
+	0x6028, 0x9085, 0x0600, 0x602a, 0x00b0, 0x709b, 0x0028, 0x2069,
+	0x198e, 0x2d04, 0x7002, 0x6028, 0x9085, 0x0600, 0x602a, 0x00e6,
+	0x0036, 0x0046, 0x0056, 0x2071, 0x1a6a, 0x080c, 0x1ac2, 0x005e,
+	0x004e, 0x003e, 0x00ee, 0x00de, 0x0005, 0x00d6, 0x2069, 0x0200,
+	0x6804, 0x9005, 0x1178, 0x6808, 0x9005, 0x1160, 0x709b, 0x0028,
+	0x2069, 0x198e, 0x2d04, 0x7002, 0x080c, 0x76ad, 0x6028, 0x9085,
+	0x0600, 0x602a, 0x00de, 0x0005, 0x0006, 0x2001, 0x0090, 0x080c,
+	0x2a29, 0x000e, 0x6124, 0xd1e4, 0x1190, 0x080c, 0x7320, 0xd1d4,
+	0x1160, 0xd1dc, 0x1138, 0xd1cc, 0x0150, 0x709b, 0x0020, 0x080c,
+	0x7320, 0x0028, 0x709b, 0x001d, 0x0010, 0x709b, 0x001f, 0x0005,
+	0x2001, 0x0088, 0x080c, 0x2a29, 0x6124, 0xd1cc, 0x11e8, 0xd1dc,
+	0x11c0, 0xd1e4, 0x1198, 0x9184, 0x1e00, 0x11d8, 0x080c, 0x1aec,
+	0x60e3, 0x0001, 0x600c, 0xc0b4, 0x600e, 0x080c, 0x74f4, 0x2001,
+	0x0080, 0x080c, 0x2a29, 0x709b, 0x0028, 0x0058, 0x709b, 0x001e,
+	0x0040, 0x709b, 0x001d, 0x0028, 0x709b, 0x0020, 0x0010, 0x709b,
+	0x001f, 0x0005, 0x080c, 0x1aec, 0x60e3, 0x0001, 0x600c, 0xc0b4,
+	0x600e, 0x080c, 0x74f4, 0x2001, 0x0080, 0x080c, 0x2a29, 0x6124,
+	0xd1d4, 0x1180, 0xd1dc, 0x1158, 0xd1e4, 0x1130, 0x9184, 0x1e00,
+	0x1158, 0x709b, 0x0028, 0x0040, 0x709b, 0x001e, 0x0028, 0x709b,
+	0x001d, 0x0010, 0x709b, 0x001f, 0x0005, 0x2001, 0x00a0, 0x080c,
+	0x2a29, 0x6124, 0xd1dc, 0x1138, 0xd1e4, 0x0138, 0x080c, 0x1aec,
+	0x709b, 0x001e, 0x0010, 0x709b, 0x001d, 0x0005, 0x080c, 0x73a9,
+	0x6124, 0xd1dc, 0x1188, 0x080c, 0x7320, 0x0016, 0x080c, 0x1aec,
+	0x001e, 0xd1d4, 0x1128, 0xd1e4, 0x0138, 0x709b, 0x001e, 0x0020,
+	0x709b, 0x001f, 0x080c, 0x7320, 0x0005, 0x0006, 0x2001, 0x00a0,
+	0x080c, 0x2a29, 0x000e, 0x6124, 0xd1d4, 0x1160, 0xd1cc, 0x1150,
+	0xd1dc, 0x1128, 0xd1e4, 0x0140, 0x709b, 0x001e, 0x0028, 0x709b,
+	0x001d, 0x0010, 0x709b, 0x0021, 0x0005, 0x080c, 0x73a9, 0x6124,
+	0xd1d4, 0x1150, 0xd1dc, 0x1128, 0xd1e4, 0x0140, 0x709b, 0x001e,
+	0x0028, 0x709b, 0x001d, 0x0010, 0x709b, 0x001f, 0x0005, 0x0006,
+	0x2001, 0x0090, 0x080c, 0x2a29, 0x000e, 0x6124, 0xd1d4, 0x1178,
+	0xd1cc, 0x1150, 0xd1dc, 0x1128, 0xd1e4, 0x0158, 0x709b, 0x001e,
+	0x0040, 0x709b, 0x001d, 0x0028, 0x709b, 0x0020, 0x0010, 0x709b,
+	0x001f, 0x0005, 0x0016, 0x00c6, 0x00d6, 0x00e6, 0x0126, 0x2061,
+	0x0100, 0x2069, 0x0140, 0x2071, 0x1800, 0x2091, 0x8000, 0x080c,
+	0x74c8, 0x11f8, 0x2001, 0x180c, 0x200c, 0xd1b4, 0x01d0, 0xc1b4,
+	0x2102, 0x0026, 0x2011, 0x0200, 0x080c, 0x2a63, 0x002e, 0x080c,
+	0x2a0f, 0x6024, 0xd0cc, 0x0148, 0x2001, 0x00a0, 0x080c, 0x2a29,
+	0x080c, 0x77cc, 0x080c, 0x6024, 0x0428, 0x6028, 0xc0cd, 0x602a,
+	0x0408, 0x080c, 0x74e2, 0x0150, 0x080c, 0x74d9, 0x1138, 0x2001,
+	0x0001, 0x080c, 0x25b9, 0x080c, 0x749c, 0x00a0, 0x080c, 0x73a6,
+	0x0178, 0x2001, 0x0001, 0x080c, 0x25b9, 0x7098, 0x9086, 0x001e,
+	0x0120, 0x7098, 0x9086, 0x0022, 0x1118, 0x709b, 0x0025, 0x0010,
+	0x709b, 0x0021, 0x012e, 0x00ee, 0x00de, 0x00ce, 0x001e, 0x0005,
+	0x0026, 0x2011, 0x7331, 0x080c, 0x8729, 0x002e, 0x0016, 0x0026,
+	0x2009, 0x0064, 0x2011, 0x7331, 0x080c, 0x8720, 0x002e, 0x001e,
+	0x0005, 0x00e6, 0x00f6, 0x0016, 0x080c, 0x9e16, 0x2071, 0x1800,
+	0x080c, 0x72ca, 0x001e, 0x00fe, 0x00ee, 0x0005, 0x0016, 0x0026,
+	0x0036, 0x00c6, 0x00d6, 0x00e6, 0x00f6, 0x0126, 0x080c, 0x9e16,
 	0x2061, 0x0100, 0x2069, 0x0140, 0x2071, 0x1800, 0x2091, 0x8000,
-	0x080c, 0x74e9, 0x11f8, 0x2001, 0x180c, 0x200c, 0xd1b4, 0x01d0,
-	0xc1b4, 0x2102, 0x0026, 0x2011, 0x0200, 0x080c, 0x2a44, 0x002e,
-	0x080c, 0x29f0, 0x6024, 0xd0cc, 0x0148, 0x2001, 0x00a0, 0x080c,
-	0x2a0a, 0x080c, 0x77ed, 0x080c, 0x6029, 0x0428, 0x6028, 0xc0cd,
-	0x602a, 0x0408, 0x080c, 0x7503, 0x0150, 0x080c, 0x74fa, 0x1138,
-	0x2001, 0x0001, 0x080c, 0x25a0, 0x080c, 0x74bd, 0x00a0, 0x080c,
-	0x73c7, 0x0178, 0x2001, 0x0001, 0x080c, 0x25a0, 0x7098, 0x9086,
-	0x001e, 0x0120, 0x7098, 0x9086, 0x0022, 0x1118, 0x709b, 0x0025,
-	0x0010, 0x709b, 0x0021, 0x012e, 0x00ee, 0x00de, 0x00ce, 0x001e,
-	0x0005, 0x0026, 0x2011, 0x7352, 0x080c, 0x874a, 0x002e, 0x0016,
-	0x0026, 0x2009, 0x0064, 0x2011, 0x7352, 0x080c, 0x8741, 0x002e,
-	0x001e, 0x0005, 0x00e6, 0x00f6, 0x0016, 0x080c, 0x9e32, 0x2071,
-	0x1800, 0x080c, 0x72eb, 0x001e, 0x00fe, 0x00ee, 0x0005, 0x0016,
-	0x0026, 0x0036, 0x00c6, 0x00d6, 0x00e6, 0x00f6, 0x0126, 0x080c,
-	0x9e32, 0x2061, 0x0100, 0x2069, 0x0140, 0x2071, 0x1800, 0x2091,
-	0x8000, 0x6028, 0xc09c, 0x602a, 0x080c, 0xa896, 0x2011, 0x0003,
-	0x080c, 0xa1cf, 0x2011, 0x0002, 0x080c, 0xa1d9, 0x080c, 0xa098,
-	0x080c, 0x86f6, 0x0036, 0x901e, 0x080c, 0xa118, 0x003e, 0x080c,
-	0xa8b2, 0x60e3, 0x0000, 0x080c, 0xe702, 0x080c, 0xe71d, 0x2009,
-	0x0004, 0x080c, 0x29f6, 0x080c, 0x2916, 0x2001, 0x1800, 0x2003,
-	0x0004, 0x2011, 0x0008, 0x080c, 0x2a44, 0x2011, 0x7352, 0x080c,
-	0x874a, 0x080c, 0x7503, 0x0118, 0x9006, 0x080c, 0x2a0a, 0x080c,
-	0x0bc3, 0x2001, 0x0001, 0x080c, 0x25a0, 0x012e, 0x00fe, 0x00ee,
-	0x00de, 0x00ce, 0x003e, 0x002e, 0x001e, 0x0005, 0x0026, 0x00e6,
-	0x2011, 0x735f, 0x2071, 0x1a03, 0x701c, 0x9206, 0x1118, 0x7018,
-	0x9005, 0x0110, 0x9085, 0x0001, 0x00ee, 0x002e, 0x0005, 0x6020,
-	0xd09c, 0x0005, 0x6800, 0x9084, 0xfffe, 0x9086, 0x00c0, 0x01b8,
-	0x2001, 0x00c0, 0x080c, 0x2a0a, 0x0156, 0x20a9, 0x002d, 0x1d04,
-	0x73d7, 0x2091, 0x6000, 0x1f04, 0x73d7, 0x015e, 0x00d6, 0x2069,
-	0x1800, 0x689c, 0x8001, 0x0220, 0x0118, 0x689e, 0x00de, 0x0005,
-	0x689f, 0x0014, 0x68ec, 0xd0dc, 0x0dc8, 0x6800, 0x9086, 0x0001,
-	0x1da8, 0x080c, 0x8756, 0x0c90, 0x00c6, 0x00d6, 0x00e6, 0x2061,
-	0x0100, 0x2069, 0x0140, 0x2071, 0x1800, 0x080c, 0x77fc, 0x2001,
-	0x196d, 0x2003, 0x0000, 0x9006, 0x709a, 0x60e2, 0x6886, 0x080c,
-	0x266f, 0x9006, 0x080c, 0x2a0a, 0x080c, 0x5ee4, 0x0026, 0x2011,
-	0xffff, 0x080c, 0x2a44, 0x002e, 0x602b, 0x182c, 0x00ee, 0x00de,
-	0x00ce, 0x0005, 0x00c6, 0x00d6, 0x00e6, 0x2061, 0x0100, 0x2069,
-	0x0140, 0x2071, 0x1800, 0x2001, 0x197d, 0x200c, 0x9186, 0x0000,
-	0x0158, 0x9186, 0x0001, 0x0158, 0x9186, 0x0002, 0x0158, 0x9186,
-	0x0003, 0x0158, 0x0804, 0x74ad, 0x709b, 0x0022, 0x0040, 0x709b,
-	0x0021, 0x0028, 0x709b, 0x0023, 0x0010, 0x709b, 0x0024, 0x60e3,
-	0x0000, 0x6887, 0x0001, 0x2001, 0x0001, 0x080c, 0x266f, 0x080c,
-	0xa896, 0x0026, 0x080c, 0xab5e, 0x002e, 0x080c, 0xa8b2, 0x7000,
-	0x908e, 0x0004, 0x0118, 0x602b, 0x0028, 0x0010, 0x602b, 0x0020,
-	0x0156, 0x0126, 0x2091, 0x8000, 0x20a9, 0x0005, 0x6024, 0xd0ac,
-	0x0150, 0x012e, 0x015e, 0x080c, 0xcf52, 0x0118, 0x9006, 0x080c,
-	0x2a34, 0x0804, 0x74b9, 0x6800, 0x9084, 0x00a1, 0xc0bd, 0x6802,
-	0x080c, 0x29f0, 0x6904, 0xd1d4, 0x1140, 0x2001, 0x0100, 0x080c,
-	0x2a0a, 0x1f04, 0x745e, 0x080c, 0x7540, 0x012e, 0x015e, 0x080c,
-	0x74fa, 0x0170, 0x6044, 0x9005, 0x0130, 0x080c, 0x7540, 0x9006,
-	0x8001, 0x1df0, 0x0028, 0x6804, 0xd0d4, 0x1110, 0x080c, 0x7540,
-	0x080c, 0xcf52, 0x0118, 0x9006, 0x080c, 0x2a34, 0x0016, 0x0026,
-	0x7000, 0x908e, 0x0004, 0x0130, 0x2009, 0x00c8, 0x2011, 0x735f,
-	0x080c, 0x8708, 0x002e, 0x001e, 0x080c, 0x854a, 0x7034, 0xc085,
-	0x7036, 0x2001, 0x197d, 0x2003, 0x0004, 0x080c, 0x71b4, 0x080c,
-	0x74fa, 0x0138, 0x6804, 0xd0d4, 0x1120, 0xd0dc, 0x1100, 0x080c,
-	0x77f2, 0x00ee, 0x00de, 0x00ce, 0x0005, 0x00c6, 0x00d6, 0x00e6,
-	0x2061, 0x0100, 0x2069, 0x0140, 0x2071, 0x1800, 0x080c, 0x8561,
-	0x080c, 0x8553, 0x080c, 0x77fc, 0x2001, 0x196d, 0x2003, 0x0000,
-	0x9006, 0x709a, 0x60e2, 0x6886, 0x080c, 0x266f, 0x9006, 0x080c,
-	0x2a0a, 0x6043, 0x0090, 0x6043, 0x0010, 0x0026, 0x2011, 0xffff,
-	0x080c, 0x2a44, 0x002e, 0x602b, 0x182c, 0x00ee, 0x00de, 0x00ce,
-	0x0005, 0x0006, 0x2001, 0x197c, 0x2004, 0x9086, 0xaaaa, 0x000e,
-	0x0005, 0x0006, 0x080c, 0x56de, 0x9084, 0x0030, 0x9086, 0x0000,
-	0x000e, 0x0005, 0x0006, 0x080c, 0x56de, 0x9084, 0x0030, 0x9086,
-	0x0030, 0x000e, 0x0005, 0x0006, 0x080c, 0x56de, 0x9084, 0x0030,
-	0x9086, 0x0010, 0x000e, 0x0005, 0x0006, 0x080c, 0x56de, 0x9084,
-	0x0030, 0x9086, 0x0020, 0x000e, 0x0005, 0x0036, 0x0016, 0x2001,
-	0x180c, 0x2004, 0x908c, 0x0013, 0x0180, 0x0020, 0x080c, 0x268f,
-	0x900e, 0x0028, 0x080c, 0x6a63, 0x1dc8, 0x2009, 0x0002, 0x2019,
-	0x0028, 0x080c, 0x31a6, 0x9006, 0x0019, 0x001e, 0x003e, 0x0005,
-	0x00e6, 0x2071, 0x180c, 0x2e04, 0x0130, 0x080c, 0xcf4b, 0x1128,
-	0x9085, 0x0010, 0x0010, 0x9084, 0xffef, 0x2072, 0x00ee, 0x0005,
-	0x6050, 0x0006, 0x60ec, 0x0006, 0x600c, 0x0006, 0x6004, 0x0006,
-	0x6028, 0x0006, 0x602f, 0x0100, 0x602f, 0x0000, 0x602f, 0x0040,
-	0x602f, 0x0000, 0x20a9, 0x0002, 0x080c, 0x29d1, 0x0026, 0x2011,
-	0x0040, 0x080c, 0x2a44, 0x002e, 0x000e, 0x602a, 0x000e, 0x6006,
-	0x000e, 0x600e, 0x000e, 0x60ee, 0x60e3, 0x0000, 0x6887, 0x0001,
-	0x2001, 0x0001, 0x080c, 0x266f, 0x2001, 0x00a0, 0x0006, 0x080c,
-	0xcf52, 0x000e, 0x0130, 0x080c, 0x2a28, 0x9006, 0x080c, 0x2a34,
-	0x0010, 0x080c, 0x2a0a, 0x000e, 0x6052, 0x6050, 0x0006, 0xc0e5,
-	0x6052, 0x00f6, 0x2079, 0x0100, 0x080c, 0x2981, 0x00fe, 0x000e,
-	0x6052, 0x0005, 0x0156, 0x0016, 0x0026, 0x0036, 0x00c6, 0x00d6,
-	0x00e6, 0x2061, 0x0100, 0x2069, 0x0140, 0x2071, 0x1800, 0x080c,
-	0xa8f4, 0x0158, 0x2001, 0x0386, 0x2004, 0xd0b4, 0x1130, 0x2001,
-	0x0016, 0x080c, 0xa887, 0x0804, 0x761d, 0x2001, 0x180c, 0x200c,
-	0xc1c4, 0x2102, 0x6028, 0x9084, 0xe1ff, 0x602a, 0x2011, 0x0200,
-	0x080c, 0x2a44, 0x2001, 0x0090, 0x080c, 0x2a0a, 0x20a9, 0x0366,
-	0x6024, 0xd0cc, 0x1558, 0x1d04, 0x75b8, 0x2091, 0x6000, 0x1f04,
-	0x75b8, 0x080c, 0xa896, 0x2011, 0x0003, 0x080c, 0xa1cf, 0x2011,
-	0x0002, 0x080c, 0xa1d9, 0x080c, 0xa098, 0x901e, 0x080c, 0xa118,
-	0x2001, 0x0386, 0x2003, 0x7000, 0x080c, 0xa8b2, 0x2001, 0x00a0,
-	0x080c, 0x2a0a, 0x080c, 0x77ed, 0x080c, 0x6029, 0x080c, 0xcf52,
-	0x0110, 0x080c, 0x0ce9, 0x9085, 0x0001, 0x04e8, 0x2001, 0x0386,
-	0x2004, 0xd0ac, 0x0110, 0x080c, 0x1adf, 0x60e3, 0x0000, 0x2001,
-	0x196d, 0x2004, 0x080c, 0x266f, 0x60e2, 0x2001, 0x0080, 0x080c,
-	0x2a0a, 0x20a9, 0x0366, 0x2011, 0x1e00, 0x080c, 0x2a44, 0x2009,
-	0x1e00, 0x080c, 0x29f0, 0x6024, 0x910c, 0x0140, 0x1d04, 0x75fb,
-	0x2091, 0x6000, 0x1f04, 0x75fb, 0x0804, 0x75c1, 0x2001, 0x0386,
-	0x2003, 0x7000, 0x6028, 0x9085, 0x1e00, 0x602a, 0x70b4, 0x9005,
-	0x1118, 0x6887, 0x0001, 0x0008, 0x6886, 0x080c, 0xcf52, 0x0110,
-	0x080c, 0x0ce9, 0x9006, 0x00ee, 0x00de, 0x00ce, 0x003e, 0x002e,
-	0x001e, 0x015e, 0x0005, 0x0156, 0x0016, 0x0026, 0x0036, 0x00c6,
-	0x00d6, 0x00e6, 0x2061, 0x0100, 0x2071, 0x1800, 0x7000, 0x9086,
-	0x0003, 0x1168, 0x2001, 0x020b, 0x2004, 0x9084, 0x5540, 0x9086,
-	0x5540, 0x1128, 0x2069, 0x1a77, 0x2d04, 0x8000, 0x206a, 0x2069,
-	0x0140, 0x6020, 0x9084, 0x00c0, 0x0120, 0x6884, 0x9005, 0x1904,
-	0x7694, 0x2001, 0x0088, 0x080c, 0x2a0a, 0x9006, 0x60e2, 0x6886,
-	0x080c, 0x266f, 0x2069, 0x0200, 0x6804, 0x9005, 0x1118, 0x6808,
-	0x9005, 0x01d0, 0x6028, 0x9084, 0xfbff, 0x602a, 0x2011, 0x0400,
-	0x080c, 0x2a44, 0x2069, 0x198f, 0x7000, 0x206a, 0x709b, 0x0026,
-	0x7003, 0x0001, 0x20a9, 0x0002, 0x1d04, 0x7674, 0x2091, 0x6000,
-	0x1f04, 0x7674, 0x0804, 0x76c6, 0x2069, 0x0140, 0x20a9, 0x0384,
-	0x2011, 0x1e00, 0x080c, 0x2a44, 0x2009, 0x1e00, 0x080c, 0x29f0,
-	0x6024, 0x910c, 0x0528, 0x9084, 0x1a00, 0x1510, 0x1d04, 0x7680,
-	0x2091, 0x6000, 0x1f04, 0x7680, 0x080c, 0xa896, 0x2011, 0x0003,
-	0x080c, 0xa1cf, 0x2011, 0x0002, 0x080c, 0xa1d9, 0x080c, 0xa098,
-	0x901e, 0x080c, 0xa118, 0x080c, 0xa8b2, 0x2001, 0x00a0, 0x080c,
-	0x2a0a, 0x080c, 0x77ed, 0x080c, 0x6029, 0x9085, 0x0001, 0x00b0,
-	0x2001, 0x0080, 0x080c, 0x2a0a, 0x2069, 0x0140, 0x60e3, 0x0000,
-	0x70b4, 0x9005, 0x1118, 0x6887, 0x0001, 0x0008, 0x6886, 0x2001,
-	0x196d, 0x2004, 0x080c, 0x266f, 0x60e2, 0x9006, 0x00ee, 0x00de,
-	0x00ce, 0x003e, 0x002e, 0x001e, 0x015e, 0x0005, 0x0156, 0x0016,
-	0x0026, 0x0036, 0x00c6, 0x00d6, 0x00e6, 0x2061, 0x0100, 0x2071,
-	0x1800, 0x6020, 0x9084, 0x00c0, 0x01e8, 0x080c, 0xa896, 0x2011,
-	0x0003, 0x080c, 0xa1cf, 0x2011, 0x0002, 0x080c, 0xa1d9, 0x080c,
-	0xa098, 0x901e, 0x080c, 0xa118, 0x080c, 0xa8b2, 0x2069, 0x0140,
-	0x2001, 0x00a0, 0x080c, 0x2a0a, 0x080c, 0x77ed, 0x080c, 0x6029,
-	0x0804, 0x7769, 0x2001, 0x180c, 0x200c, 0xd1b4, 0x1160, 0xc1b5,
-	0x2102, 0x080c, 0x7347, 0x2069, 0x0140, 0x2001, 0x0080, 0x080c,
-	0x2a0a, 0x60e3, 0x0000, 0x2069, 0x0200, 0x6804, 0x9005, 0x1118,
-	0x6808, 0x9005, 0x0190, 0x6028, 0x9084, 0xfdff, 0x602a, 0x2011,
-	0x0200, 0x080c, 0x2a44, 0x2069, 0x198f, 0x7000, 0x206a, 0x709b,
-	0x0027, 0x7003, 0x0001, 0x0804, 0x7769, 0x2011, 0x1e00, 0x080c,
-	0x2a44, 0x2009, 0x1e00, 0x080c, 0x29f0, 0x6024, 0x910c, 0x01c8,
-	0x9084, 0x1c00, 0x11b0, 0x1d04, 0x7725, 0x0006, 0x0016, 0x00c6,
-	0x00d6, 0x00e6, 0x080c, 0x8592, 0x00ee, 0x00de, 0x00ce, 0x001e,
-	0x000e, 0x00e6, 0x2071, 0x1a03, 0x7018, 0x00ee, 0x9005, 0x19e8,
-	0x0500, 0x0026, 0x2011, 0x735f, 0x080c, 0x863e, 0x2011, 0x7352,
-	0x080c, 0x874a, 0x002e, 0x2069, 0x0140, 0x60e3, 0x0000, 0x70b4,
-	0x9005, 0x1118, 0x6887, 0x0001, 0x0008, 0x6886, 0x2001, 0x196d,
-	0x2004, 0x080c, 0x266f, 0x60e2, 0x2001, 0x180c, 0x200c, 0xc1b4,
-	0x2102, 0x00ee, 0x00de, 0x00ce, 0x003e, 0x002e, 0x001e, 0x015e,
-	0x0005, 0x0156, 0x0016, 0x0026, 0x0036, 0x0046, 0x00c6, 0x00e6,
-	0x2061, 0x0100, 0x2071, 0x1800, 0x080c, 0xcf4b, 0x1904, 0x77d7,
-	0x7130, 0xd184, 0x1170, 0x080c, 0x3368, 0x0138, 0xc18d, 0x7132,
-	0x2011, 0x1848, 0x2214, 0xd2ac, 0x1120, 0x7030, 0xd08c, 0x0904,
-	0x77d7, 0x2011, 0x1848, 0x220c, 0xd1a4, 0x0538, 0x0016, 0x2019,
-	0x000e, 0x080c, 0xe239, 0x0156, 0x00b6, 0x20a9, 0x007f, 0x900e,
-	0x9186, 0x007e, 0x01a0, 0x9186, 0x0080, 0x0188, 0x080c, 0x6625,
-	0x1170, 0x2120, 0x9006, 0x0016, 0x2009, 0x000e, 0x080c, 0xe2c9,
-	0x2009, 0x0001, 0x2011, 0x0100, 0x080c, 0x88ec, 0x001e, 0x8108,
-	0x1f04, 0x77a0, 0x00be, 0x015e, 0x001e, 0xd1ac, 0x1148, 0x0016,
-	0x2009, 0x0002, 0x2019, 0x0004, 0x080c, 0x31a6, 0x001e, 0x0078,
-	0x0156, 0x00b6, 0x20a9, 0x007f, 0x900e, 0x080c, 0x6625, 0x1110,
-	0x080c, 0x6043, 0x8108, 0x1f04, 0x77cd, 0x00be, 0x015e, 0x080c,
-	0x1adf, 0x080c, 0xa896, 0x080c, 0xab5e, 0x080c, 0xa8b2, 0x60e3,
-	0x0000, 0x080c, 0x6029, 0x080c, 0x741a, 0x00ee, 0x00ce, 0x004e,
-	0x003e, 0x002e, 0x001e, 0x015e, 0x0005, 0x2001, 0x197d, 0x2003,
-	0x0001, 0x0005, 0x2001, 0x197d, 0x2003, 0x0000, 0x0005, 0x2001,
-	0x197c, 0x2003, 0xaaaa, 0x0005, 0x2001, 0x197c, 0x2003, 0x0000,
-	0x0005, 0x2071, 0x18fa, 0x7003, 0x0000, 0x7007, 0x0000, 0x080c,
-	0x1053, 0x090c, 0x0d7d, 0xa8ab, 0xdcb0, 0x2900, 0x704e, 0x080c,
-	0x1053, 0x090c, 0x0d7d, 0xa8ab, 0xdcb0, 0x2900, 0x7052, 0xa867,
-	0x0000, 0xa86b, 0x0001, 0xa89f, 0x0000, 0x0005, 0x00e6, 0x2071,
-	0x0040, 0x6848, 0x9005, 0x1118, 0x9085, 0x0001, 0x04b0, 0x6840,
-	0x9005, 0x0150, 0x04a1, 0x6a50, 0x9200, 0x7002, 0x6854, 0x9101,
-	0x7006, 0x9006, 0x7012, 0x7016, 0x6850, 0x7002, 0x6854, 0x7006,
-	0x6858, 0x700a, 0x685c, 0x700e, 0x6840, 0x9005, 0x1110, 0x7012,
-	0x7016, 0x6848, 0x701a, 0x701c, 0x9085, 0x0040, 0x701e, 0x2001,
-	0x0019, 0x7036, 0x702b, 0x0001, 0x2001, 0x0004, 0x200c, 0x918c,
-	0xfff7, 0x918d, 0x8000, 0x2102, 0x00d6, 0x2069, 0x18fa, 0x6807,
-	0x0001, 0x00de, 0x080c, 0x7de4, 0x9006, 0x00ee, 0x0005, 0x900e,
-	0x0156, 0x20a9, 0x0006, 0x8003, 0x818d, 0x1f04, 0x7863, 0x015e,
-	0x0005, 0x2079, 0x0040, 0x2071, 0x18fa, 0x7004, 0x0002, 0x7879,
-	0x787a, 0x78c5, 0x7920, 0x7a30, 0x7877, 0x7877, 0x7a5a, 0x080c,
-	0x0d7d, 0x0005, 0x2079, 0x0040, 0x2001, 0x1dc0, 0x2003, 0x0000,
-	0x782c, 0x908c, 0x0780, 0x190c, 0x7ec6, 0xd0a4, 0x0570, 0x2001,
-	0x1dc0, 0x2004, 0x9082, 0x0080, 0x1640, 0x1d04, 0x7897, 0x2001,
-	0x1a06, 0x200c, 0x8109, 0x0508, 0x2091, 0x6000, 0x2102, 0x7824,
-	0x2048, 0x9006, 0xa802, 0xa806, 0xa864, 0x9084, 0x00ff, 0x908a,
-	0x0040, 0x0608, 0x00b8, 0x2001, 0x1800, 0x200c, 0x9186, 0x0003,
-	0x1160, 0x7104, 0x9186, 0x0004, 0x0140, 0x9186, 0x0007, 0x0128,
-	0x9186, 0x0003, 0x1968, 0x080c, 0x7920, 0x782c, 0xd09c, 0x090c,
-	0x7de4, 0x0005, 0x9082, 0x005a, 0x1218, 0x2100, 0x003b, 0x0c18,
-	0x080c, 0x7956, 0x0c90, 0x00e3, 0x08f0, 0x0005, 0x7956, 0x7956,
-	0x7956, 0x7956, 0x7956, 0x7956, 0x7956, 0x7956, 0x7978, 0x7956,
-	0x7956, 0x7956, 0x7956, 0x7956, 0x7956, 0x7956, 0x7956, 0x7956,
-	0x7956, 0x7956, 0x7956, 0x7956, 0x7956, 0x7956, 0x7956, 0x7956,
-	0x7956, 0x7956, 0x7962, 0x7956, 0x7b4b, 0x7956, 0x7956, 0x7956,
-	0x7978, 0x7956, 0x7962, 0x7b8c, 0x7bcd, 0x7c14, 0x7c28, 0x7956,
-	0x7956, 0x7978, 0x7962, 0x798c, 0x7956, 0x7a04, 0x7cd3, 0x7cee,
-	0x7956, 0x7978, 0x7956, 0x798c, 0x7956, 0x7956, 0x79fa, 0x7cee,
-	0x7956, 0x7956, 0x7956, 0x7956, 0x7956, 0x7956, 0x7956, 0x7956,
-	0x7956, 0x79a0, 0x7956, 0x7956, 0x7956, 0x7956, 0x7956, 0x7956,
-	0x7956, 0x7956, 0x7956, 0x7e6a, 0x7956, 0x7e14, 0x7956, 0x7e14,
-	0x7956, 0x79b5, 0x7956, 0x7956, 0x7956, 0x7956, 0x7956, 0x7956,
-	0x2079, 0x0040, 0x7004, 0x9086, 0x0003, 0x1198, 0x782c, 0x080c,
-	0x7e0d, 0xd0a4, 0x0170, 0x7824, 0x2048, 0x9006, 0xa802, 0xa806,
-	0xa864, 0x9084, 0x00ff, 0x908a, 0x001a, 0x1210, 0x002b, 0x0c50,
-	0x00e9, 0x080c, 0x7de4, 0x0005, 0x7956, 0x7962, 0x7b37, 0x7956,
-	0x7962, 0x7956, 0x7962, 0x7962, 0x7956, 0x7962, 0x7b37, 0x7962,
-	0x7962, 0x7962, 0x7962, 0x7962, 0x7956, 0x7962, 0x7b37, 0x7956,
-	0x7956, 0x7962, 0x7956, 0x7956, 0x7956, 0x7962, 0x00e6, 0x2071,
-	0x18fa, 0x2009, 0x0400, 0x0071, 0x00ee, 0x0005, 0x2009, 0x1000,
-	0x0049, 0x0005, 0x2009, 0x2000, 0x0029, 0x0005, 0x2009, 0x0800,
-	0x0009, 0x0005, 0x7007, 0x0001, 0xa868, 0x9084, 0x00ff, 0x9105,
-	0xa86a, 0x0126, 0x2091, 0x8000, 0x080c, 0x6d80, 0x012e, 0x0005,
-	0xa864, 0x8007, 0x9084, 0x00ff, 0x0d08, 0x8001, 0x1120, 0x7007,
-	0x0001, 0x0804, 0x7ad9, 0x7007, 0x0003, 0x7012, 0x2900, 0x7016,
-	0x701a, 0x704b, 0x7ad9, 0x0005, 0xa864, 0x8007, 0x9084, 0x00ff,
-	0x0968, 0x8001, 0x1120, 0x7007, 0x0001, 0x0804, 0x7af4, 0x7007,
-	0x0003, 0x7012, 0x2900, 0x7016, 0x701a, 0x704b, 0x7af4, 0x0005,
-	0xa864, 0x8007, 0x9084, 0x00ff, 0x0904, 0x795e, 0x8001, 0x1120,
-	0x7007, 0x0001, 0x0804, 0x7b10, 0x7007, 0x0003, 0x7012, 0x2900,
-	0x7016, 0x701a, 0x704b, 0x7b10, 0x0005, 0xa864, 0x8007, 0x9084,
-	0x00ff, 0x9086, 0x0001, 0x1904, 0x795e, 0x7007, 0x0001, 0x2009,
-	0x1834, 0x210c, 0x81ff, 0x11a8, 0xa868, 0x9084, 0x00ff, 0xa86a,
-	0xa883, 0x0000, 0x080c, 0x62b9, 0x1108, 0x0005, 0x0126, 0x2091,
-	0x8000, 0xa867, 0x0139, 0xa87a, 0xa982, 0x080c, 0x6d80, 0x012e,
-	0x0ca0, 0xa994, 0x9186, 0x0071, 0x0d38, 0x9186, 0x0064, 0x0d20,
-	0x9186, 0x007c, 0x0d08, 0x9186, 0x0028, 0x09f0, 0x9186, 0x0038,
-	0x09d8, 0x9186, 0x0078, 0x09c0, 0x9186, 0x005f, 0x09a8, 0x9186,
-	0x0056, 0x0990, 0xa897, 0x4005, 0xa89b, 0x0001, 0x2001, 0x0030,
-	0x900e, 0x08a0, 0xa87c, 0x9084, 0x00c0, 0x9086, 0x00c0, 0x1120,
-	0x7007, 0x0001, 0x0804, 0x7d05, 0x2900, 0x7016, 0x701a, 0x20a9,
-	0x0004, 0xa860, 0x20e0, 0xa85c, 0x9080, 0x0030, 0x2098, 0x7050,
-	0x2040, 0xa060, 0x20e8, 0xa05c, 0x9080, 0x0023, 0x20a0, 0x4003,
-	0xa888, 0x7012, 0x9082, 0x0401, 0x1a04, 0x7966, 0xaab4, 0x928a,
-	0x0002, 0x1a04, 0x7966, 0x82ff, 0x1138, 0xa8b8, 0xa9bc, 0x9105,
-	0x0118, 0x2001, 0x7a97, 0x0018, 0x9280, 0x7a8d, 0x2005, 0x7056,
-	0x7010, 0x9015, 0x0904, 0x7a78, 0x080c, 0x1053, 0x1118, 0x7007,
-	0x0004, 0x0005, 0x2900, 0x7022, 0x7054, 0x2060, 0xe000, 0xa866,
-	0x7050, 0x2040, 0xa95c, 0xe004, 0x9100, 0xa076, 0xa860, 0xa072,
-	0xe008, 0x920a, 0x1210, 0x900e, 0x2200, 0x7112, 0xe20c, 0x8003,
-	0x800b, 0x9296, 0x0004, 0x0108, 0x9108, 0xa17a, 0x810b, 0xa17e,
-	0x080c, 0x1124, 0xa06c, 0x908e, 0x0100, 0x0170, 0x9086, 0x0200,
-	0x0118, 0x7007, 0x0007, 0x0005, 0x7020, 0x2048, 0x080c, 0x106c,
-	0x7014, 0x2048, 0x0804, 0x7966, 0x7020, 0x2048, 0x7018, 0xa802,
-	0xa807, 0x0000, 0x2908, 0x2048, 0xa906, 0x711a, 0x0804, 0x7a30,
-	0x7014, 0x2048, 0x7007, 0x0001, 0xa8b4, 0x9005, 0x1128, 0xa8b8,
-	0xa9bc, 0x9105, 0x0108, 0x00b9, 0xa864, 0x9084, 0x00ff, 0x9086,
-	0x001e, 0x0904, 0x7d05, 0x0804, 0x7ad9, 0x7a8f, 0x7a93, 0x0002,
-	0x001d, 0x0007, 0x0004, 0x000a, 0x001b, 0x0005, 0x0006, 0x000a,
-	0x001d, 0x0005, 0x0004, 0x0076, 0x0066, 0xafb8, 0xaebc, 0xa804,
-	0x2050, 0xb0c0, 0xb0e2, 0xb0bc, 0xb0de, 0xb0b8, 0xb0d2, 0xb0b4,
-	0xb0ce, 0xb6da, 0xb7d6, 0xb0b0, 0xb0ca, 0xb0ac, 0xb0c6, 0xb0a8,
-	0xb0ba, 0xb0a4, 0xb0b6, 0xb6c2, 0xb7be, 0xb0a0, 0xb0b2, 0xb09c,
-	0xb0ae, 0xb098, 0xb0a2, 0xb094, 0xb09e, 0xb6aa, 0xb7a6, 0xb090,
-	0xb09a, 0xb08c, 0xb096, 0xb088, 0xb08a, 0xb084, 0xb086, 0xb692,
-	0xb78e, 0xb080, 0xb082, 0xb07c, 0xb07e, 0xb078, 0xb072, 0xb074,
-	0xb06e, 0xb67a, 0xb776, 0xb004, 0x9055, 0x1958, 0x006e, 0x007e,
-	0x0005, 0x2009, 0x1834, 0x210c, 0x81ff, 0x1178, 0x080c, 0x60bb,
-	0x1108, 0x0005, 0x080c, 0x6fc0, 0x0126, 0x2091, 0x8000, 0x080c,
-	0xcb36, 0x080c, 0x6d80, 0x012e, 0x0ca0, 0x080c, 0xcf4b, 0x1d70,
-	0x2001, 0x0028, 0x900e, 0x0c70, 0x2009, 0x1834, 0x210c, 0x81ff,
-	0x1188, 0xa888, 0x9005, 0x0188, 0xa883, 0x0000, 0x080c, 0x6149,
-	0x1108, 0x0005, 0xa87a, 0x0126, 0x2091, 0x8000, 0x080c, 0x6d80,
-	0x012e, 0x0cb8, 0x2001, 0x0028, 0x0ca8, 0x2001, 0x0000, 0x0c90,
-	0x2009, 0x1834, 0x210c, 0x81ff, 0x11d8, 0xa888, 0x9005, 0x01e0,
-	0xa883, 0x0000, 0xa87c, 0xd0f4, 0x0120, 0x080c, 0x621b, 0x1138,
-	0x0005, 0x9006, 0xa87a, 0x080c, 0x6196, 0x1108, 0x0005, 0x0126,
-	0x2091, 0x8000, 0xa87a, 0xa982, 0x080c, 0x6d80, 0x012e, 0x0cb0,
-	0x2001, 0x0028, 0x900e, 0x0c98, 0x2001, 0x0000, 0x0c80, 0x7018,
-	0xa802, 0x2908, 0x2048, 0xa906, 0x711a, 0x7010, 0x8001, 0x7012,
-	0x0118, 0x7007, 0x0003, 0x0030, 0x7014, 0x2048, 0x7007, 0x0001,
-	0x7048, 0x080f, 0x0005, 0x00b6, 0x7007, 0x0001, 0xa974, 0xa878,
-	0x9084, 0x00ff, 0x9096, 0x0004, 0x0540, 0x20a9, 0x0001, 0x9096,
-	0x0001, 0x0190, 0x900e, 0x20a9, 0x0800, 0x9096, 0x0002, 0x0160,
-	0x9005, 0x11d8, 0xa974, 0x080c, 0x6625, 0x11b8, 0x0066, 0xae80,
-	0x080c, 0x6735, 0x006e, 0x0088, 0x0046, 0x2011, 0x180c, 0x2224,
-	0xc484, 0x2412, 0x004e, 0x00c6, 0x080c, 0x6625, 0x1110, 0x080c,
-	0x6904, 0x8108, 0x1f04, 0x7b74, 0x00ce, 0xa87c, 0xd084, 0x1120,
-	0x080c, 0x106c, 0x00be, 0x0005, 0x0126, 0x2091, 0x8000, 0x080c,
-	0x6d80, 0x012e, 0x00be, 0x0005, 0x0126, 0x2091, 0x8000, 0x7007,
-	0x0001, 0x080c, 0x6a67, 0x0580, 0x2061, 0x1a6f, 0x6100, 0xd184,
-	0x0178, 0xa888, 0x9084, 0x00ff, 0x1550, 0x6000, 0xd084, 0x0520,
-	0x6004, 0x9005, 0x1538, 0x6003, 0x0000, 0x600b, 0x0000, 0x00c8,
-	0x2011, 0x0001, 0xa890, 0x9005, 0x1110, 0x2001, 0x001e, 0x8000,
-	0x6016, 0xa888, 0x9084, 0x00ff, 0x0178, 0x6006, 0xa888, 0x8007,
-	0x9084, 0x00ff, 0x0148, 0x600a, 0xa888, 0x8000, 0x1108, 0xc28d,
-	0x6202, 0x012e, 0x0804, 0x7dce, 0x012e, 0x0804, 0x7dc8, 0x012e,
-	0x0804, 0x7dc2, 0x012e, 0x0804, 0x7dc5, 0x0126, 0x2091, 0x8000,
-	0x7007, 0x0001, 0x080c, 0x6a67, 0x05e0, 0x2061, 0x1a6f, 0x6000,
-	0xd084, 0x05b8, 0x6204, 0x6308, 0xd08c, 0x1530, 0xac78, 0x9484,
-	0x0003, 0x0170, 0xa988, 0x918c, 0x00ff, 0x8001, 0x1120, 0x2100,
-	0x9210, 0x0620, 0x0028, 0x8001, 0x1508, 0x2100, 0x9212, 0x02f0,
-	0x9484, 0x000c, 0x0188, 0xa988, 0x810f, 0x918c, 0x00ff, 0x9082,
-	0x0004, 0x1120, 0x2100, 0x9318, 0x0288, 0x0030, 0x9082, 0x0004,
-	0x1168, 0x2100, 0x931a, 0x0250, 0xa890, 0x9005, 0x0110, 0x8000,
-	0x6016, 0x6206, 0x630a, 0x012e, 0x0804, 0x7dce, 0x012e, 0x0804,
-	0x7dcb, 0x012e, 0x0804, 0x7dc8, 0x0126, 0x2091, 0x8000, 0x7007,
-	0x0001, 0x2061, 0x1a6f, 0x6300, 0xd38c, 0x1120, 0x6308, 0x8318,
-	0x0220, 0x630a, 0x012e, 0x0804, 0x7ddc, 0x012e, 0x0804, 0x7dcb,
-	0x00b6, 0x0126, 0x00c6, 0x2091, 0x8000, 0x7007, 0x0001, 0xa87c,
-	0xd0ac, 0x0148, 0x00c6, 0x2061, 0x1a6f, 0x6000, 0x9084, 0xfcff,
-	0x6002, 0x00ce, 0x0440, 0xa888, 0x9005, 0x05d8, 0xa88c, 0x9065,
-	0x0598, 0x2001, 0x1834, 0x2004, 0x9005, 0x0118, 0x080c, 0xac28,
-	0x0068, 0x6017, 0xf400, 0x6063, 0x0000, 0xa97c, 0xd1a4, 0x0110,
-	0xa980, 0x6162, 0x2009, 0x0041, 0x080c, 0xac8c, 0xa988, 0x918c,
-	0xff00, 0x9186, 0x2000, 0x1138, 0x0026, 0x900e, 0x2011, 0xfdff,
-	0x080c, 0x88ec, 0x002e, 0xa87c, 0xd0c4, 0x0148, 0x2061, 0x1a6f,
-	0x6000, 0xd08c, 0x1120, 0x6008, 0x8000, 0x0208, 0x600a, 0x00ce,
-	0x012e, 0x00be, 0x0804, 0x7dce, 0x00ce, 0x012e, 0x00be, 0x0804,
-	0x7dc8, 0xa984, 0x9186, 0x002e, 0x0d30, 0x9186, 0x002d, 0x0d18,
-	0x9186, 0x0045, 0x0510, 0x9186, 0x002a, 0x1130, 0x2001, 0x180c,
-	0x200c, 0xc194, 0x2102, 0x08b8, 0x9186, 0x0020, 0x0158, 0x9186,
-	0x0029, 0x1d10, 0xa974, 0x080c, 0x6625, 0x1968, 0xb800, 0xc0e4,
-	0xb802, 0x0848, 0xa88c, 0x9065, 0x09b8, 0x6007, 0x0024, 0x2001,
-	0x1986, 0x2004, 0x601a, 0x0804, 0x7c63, 0xa88c, 0x9065, 0x0960,
-	0x00e6, 0xa890, 0x9075, 0x2001, 0x1834, 0x2004, 0x9005, 0x0150,
-	0x080c, 0xac28, 0x8eff, 0x0118, 0x2e60, 0x080c, 0xac28, 0x00ee,
-	0x0804, 0x7c63, 0x6024, 0xc0dc, 0xc0d5, 0x6026, 0x2e60, 0x6007,
-	0x003a, 0xa8a0, 0x9005, 0x0130, 0x6007, 0x003b, 0xa8a4, 0x602e,
-	0xa8a8, 0x6016, 0x6003, 0x0001, 0x2009, 0x8020, 0x080c, 0x921e,
-	0x00ee, 0x0804, 0x7c63, 0x2061, 0x1a6f, 0x6000, 0xd084, 0x0190,
-	0xd08c, 0x1904, 0x7ddc, 0x0126, 0x2091, 0x8000, 0x6204, 0x8210,
-	0x0220, 0x6206, 0x012e, 0x0804, 0x7ddc, 0x012e, 0xa883, 0x0016,
-	0x0804, 0x7dd5, 0xa883, 0x0007, 0x0804, 0x7dd5, 0xa864, 0x8007,
-	0x9084, 0x00ff, 0x0130, 0x8001, 0x1138, 0x7007, 0x0001, 0x0069,
-	0x0005, 0x080c, 0x795e, 0x0040, 0x7007, 0x0003, 0x7012, 0x2900,
-	0x7016, 0x701a, 0x704b, 0x7d05, 0x0005, 0x00b6, 0x00e6, 0x0126,
-	0x2091, 0x8000, 0x903e, 0x2061, 0x1800, 0x61d0, 0x81ff, 0x1904,
-	0x7d87, 0x6130, 0xd194, 0x1904, 0x7db1, 0xa878, 0x2070, 0x9e82,
-	0x1ddc, 0x0a04, 0x7d7b, 0x6068, 0x9e02, 0x1a04, 0x7d7b, 0x7120,
-	0x9186, 0x0006, 0x1904, 0x7d6d, 0x7010, 0x905d, 0x0904, 0x7d87,
-	0xb800, 0xd0e4, 0x1904, 0x7dab, 0x2061, 0x1a6f, 0x6100, 0x9184,
-	0x0301, 0x9086, 0x0001, 0x15a0, 0x7024, 0xd0dc, 0x1904, 0x7db4,
-	0xa883, 0x0000, 0xa803, 0x0000, 0x2908, 0x7014, 0x9005, 0x1198,
-	0x7116, 0xa87c, 0xd0f4, 0x1904, 0x7db7, 0x080c, 0x56da, 0xd09c,
-	0x1118, 0xa87c, 0xc0cc, 0xa87e, 0x2e60, 0x080c, 0x87df, 0x012e,
-	0x00ee, 0x00be, 0x0005, 0x2048, 0xa800, 0x9005, 0x1de0, 0xa902,
-	0x2148, 0xa87c, 0xd0f4, 0x1904, 0x7db7, 0x012e, 0x00ee, 0x00be,
-	0x0005, 0x012e, 0x00ee, 0xa883, 0x0006, 0x00be, 0x0804, 0x7dd5,
-	0xd184, 0x0db8, 0xd1c4, 0x1190, 0x00a0, 0xa974, 0x080c, 0x6625,
-	0x15d0, 0xb800, 0xd0e4, 0x15b8, 0x7120, 0x9186, 0x0007, 0x1118,
-	0xa883, 0x0002, 0x0490, 0xa883, 0x0008, 0x0478, 0xa883, 0x000e,
-	0x0460, 0xa883, 0x0017, 0x0448, 0xa883, 0x0035, 0x0430, 0x080c,
-	0x56de, 0xd0fc, 0x01e8, 0xa878, 0x2070, 0x9e82, 0x1ddc, 0x02c0,
-	0x6068, 0x9e02, 0x12a8, 0x7120, 0x9186, 0x0006, 0x1188, 0x7010,
-	0x905d, 0x0170, 0xb800, 0xd0bc, 0x0158, 0x2039, 0x0001, 0x7000,
-	0x9086, 0x0007, 0x1904, 0x7d11, 0x7003, 0x0002, 0x0804, 0x7d11,
-	0xa883, 0x0028, 0x0010, 0xa883, 0x0029, 0x012e, 0x00ee, 0x00be,
-	0x0420, 0xa883, 0x002a, 0x0cc8, 0xa883, 0x0045, 0x0cb0, 0x2e60,
-	0x2019, 0x0002, 0x601b, 0x0014, 0x080c, 0xde1b, 0x012e, 0x00ee,
-	0x00be, 0x0005, 0x2009, 0x003e, 0x0058, 0x2009, 0x0004, 0x0040,
-	0x2009, 0x0006, 0x0028, 0x2009, 0x0016, 0x0010, 0x2009, 0x0001,
-	0xa884, 0x9084, 0xff00, 0x9105, 0xa886, 0x0126, 0x2091, 0x8000,
-	0x080c, 0x6d80, 0x012e, 0x0005, 0x080c, 0x106c, 0x0005, 0x00d6,
-	0x080c, 0x87d6, 0x00de, 0x0005, 0x00d6, 0x00e6, 0x0126, 0x2091,
-	0x8000, 0x2071, 0x0040, 0x702c, 0xd084, 0x01d8, 0x908c, 0x0780,
-	0x190c, 0x7ec6, 0xd09c, 0x11a8, 0x2071, 0x1800, 0x70c0, 0x90ea,
-	0x0020, 0x0278, 0x8001, 0x70c2, 0x702c, 0x2048, 0xa800, 0x702e,
-	0x9006, 0xa802, 0xa806, 0x2071, 0x0040, 0x2900, 0x7022, 0x702c,
-	0x0c28, 0x012e, 0x00ee, 0x00de, 0x0005, 0x0006, 0x9084, 0x0780,
-	0x190c, 0x7ec6, 0x000e, 0x0005, 0xa898, 0x9084, 0x0003, 0x05a8,
-	0x080c, 0xab97, 0x05d8, 0x2900, 0x6016, 0xa864, 0x9084, 0x00ff,
-	0x9086, 0x0035, 0x1138, 0x6028, 0xc0fd, 0x602a, 0x2001, 0x196b,
-	0x2004, 0x0098, 0xa8a0, 0x9084, 0x00ff, 0xa99c, 0x918c, 0xff00,
-	0x9105, 0xa99c, 0x918c, 0x00ff, 0x080c, 0x25fb, 0x1540, 0x00b6,
-	0x080c, 0x6625, 0x2b00, 0x00be, 0x1510, 0x6012, 0x6023, 0x0001,
-	0x2009, 0x0040, 0xa864, 0x9084, 0x00ff, 0x9086, 0x0035, 0x0110,
-	0x2009, 0x0041, 0x080c, 0xac8c, 0x0005, 0xa87b, 0x0101, 0x0126,
-	0x2091, 0x8000, 0x080c, 0x6d80, 0x012e, 0x0005, 0xa87b, 0x002c,
-	0x0126, 0x2091, 0x8000, 0x080c, 0x6d80, 0x012e, 0x0005, 0xa87b,
-	0x0028, 0x0126, 0x2091, 0x8000, 0x080c, 0x6d80, 0x012e, 0x080c,
-	0xabed, 0x0005, 0x00d6, 0x00c6, 0x0036, 0x0026, 0x0016, 0x00b6,
-	0x7007, 0x0001, 0xaa74, 0x9282, 0x0004, 0x1a04, 0x7eb7, 0xa97c,
-	0x9188, 0x1000, 0x2104, 0x905d, 0xb804, 0xd284, 0x0140, 0x05e8,
-	0x8007, 0x9084, 0x00ff, 0x9084, 0x0006, 0x1108, 0x04b0, 0x2b10,
-	0x080c, 0xab97, 0x1118, 0x080c, 0xac5f, 0x05a8, 0x6212, 0xa874,
-	0x0002, 0x7e95, 0x7e9a, 0x7e9d, 0x7ea3, 0x2019, 0x0002, 0x080c,
-	0xe239, 0x0060, 0x080c, 0xe1c9, 0x0048, 0x2019, 0x0002, 0xa980,
-	0x080c, 0xe1e8, 0x0018, 0xa980, 0x080c, 0xe1c9, 0x080c, 0xabed,
-	0xa887, 0x0000, 0x0126, 0x2091, 0x8000, 0x080c, 0x6d80, 0x012e,
-	0x00be, 0x001e, 0x002e, 0x003e, 0x00ce, 0x00de, 0x0005, 0xa887,
-	0x0006, 0x0c80, 0xa887, 0x0002, 0x0c68, 0xa887, 0x0005, 0x0c50,
-	0xa887, 0x0004, 0x0c38, 0xa887, 0x0007, 0x0c20, 0x2091, 0x8000,
-	0x0e04, 0x7ec8, 0x0006, 0x0016, 0x2001, 0x8003, 0x0006, 0x0804,
-	0x0d86, 0x2001, 0x1834, 0x2004, 0x9005, 0x0005, 0x0005, 0x00f6,
-	0x2079, 0x0300, 0x2001, 0x0200, 0x200c, 0xc1e5, 0xc1dc, 0x2102,
-	0x2009, 0x0218, 0x210c, 0xd1ec, 0x1120, 0x080c, 0x1608, 0x00fe,
-	0x0005, 0x2001, 0x020d, 0x2003, 0x0020, 0x781f, 0x0300, 0x00fe,
-	0x0005, 0x781c, 0xd08c, 0x0904, 0x7f49, 0x68c0, 0x90aa, 0x0005,
-	0x0a04, 0x854a, 0x7d44, 0x7c40, 0xd59c, 0x190c, 0x0d7d, 0x9584,
-	0x00f6, 0x1508, 0x9484, 0x7000, 0x0138, 0x908a, 0x2000, 0x1258,
-	0x9584, 0x0700, 0x8007, 0x04f0, 0x7000, 0x9084, 0xff00, 0x9086,
-	0x8100, 0x0db0, 0x00b0, 0x9484, 0x0fff, 0x1130, 0x7000, 0x9084,
-	0xff00, 0x9086, 0x8100, 0x11c0, 0x080c, 0xe6da, 0x080c, 0x8441,
-	0x7817, 0x0140, 0x00a8, 0x9584, 0x0076, 0x1118, 0x080c, 0x849d,
-	0x19c8, 0xd5a4, 0x0148, 0x0046, 0x0056, 0x080c, 0x7f99, 0x080c,
-	0x2115, 0x005e, 0x004e, 0x0020, 0x080c, 0xe6da, 0x7817, 0x0140,
-	0x080c, 0x74e9, 0x0168, 0x2001, 0x0111, 0x2004, 0xd08c, 0x0140,
-	0x6893, 0x0000, 0x2001, 0x0110, 0x2003, 0x0008, 0x2003, 0x0000,
-	0x0489, 0x0005, 0x0002, 0x7f56, 0x8263, 0x7f53, 0x7f53, 0x7f53,
-	0x7f53, 0x7f53, 0x7f53, 0x7817, 0x0140, 0x0005, 0x7000, 0x908c,
-	0xff00, 0x9194, 0xf000, 0x810f, 0x9484, 0x0fff, 0x6892, 0x9286,
-	0x2000, 0x1150, 0x6800, 0x9086, 0x0001, 0x1118, 0x080c, 0x573b,
-	0x0070, 0x080c, 0x7fb9, 0x0058, 0x9286, 0x3000, 0x1118, 0x080c,
-	0x81a0, 0x0028, 0x9286, 0x8000, 0x1110, 0x080c, 0x8377, 0x7817,
-	0x0140, 0x0005, 0x2001, 0x1810, 0x2004, 0xd08c, 0x0178, 0x2001,
-	0x1800, 0x2004, 0x9086, 0x0003, 0x1148, 0x0026, 0x0036, 0x2011,
-	0x8048, 0x2518, 0x080c, 0x4b07, 0x003e, 0x002e, 0x0005, 0x0036,
-	0x0046, 0x0056, 0x00f6, 0x2079, 0x0200, 0x2019, 0xfffe, 0x7c30,
-	0x0050, 0x0036, 0x0046, 0x0056, 0x00f6, 0x2079, 0x0200, 0x7d44,
-	0x7c40, 0x2019, 0xffff, 0x2001, 0x1810, 0x2004, 0xd08c, 0x0160,
-	0x2001, 0x1800, 0x2004, 0x9086, 0x0003, 0x1130, 0x0026, 0x2011,
-	0x8048, 0x080c, 0x4b07, 0x002e, 0x00fe, 0x005e, 0x004e, 0x003e,
-	0x0005, 0x00b6, 0x00c6, 0x7010, 0x9084, 0xff00, 0x8007, 0x9096,
-	0x0001, 0x0120, 0x9096, 0x0023, 0x1904, 0x8171, 0x9186, 0x0023,
-	0x15c0, 0x080c, 0x840c, 0x0904, 0x8171, 0x6120, 0x9186, 0x0001,
-	0x0150, 0x9186, 0x0004, 0x0138, 0x9186, 0x0008, 0x0120, 0x9186,
-	0x000a, 0x1904, 0x8171, 0x7124, 0x610a, 0x7030, 0x908e, 0x0200,
-	0x1130, 0x2009, 0x0015, 0x080c, 0xac8c, 0x0804, 0x8171, 0x908e,
-	0x0214, 0x0118, 0x908e, 0x0210, 0x1130, 0x2009, 0x0015, 0x080c,
-	0xac8c, 0x0804, 0x8171, 0x908e, 0x0100, 0x1904, 0x8171, 0x7034,
-	0x9005, 0x1904, 0x8171, 0x2009, 0x0016, 0x080c, 0xac8c, 0x0804,
-	0x8171, 0x9186, 0x0022, 0x1904, 0x8171, 0x7030, 0x908e, 0x0300,
-	0x1580, 0x68dc, 0xd0a4, 0x0528, 0xc0b5, 0x68de, 0x7100, 0x918c,
-	0x00ff, 0x697e, 0x7004, 0x6882, 0x00f6, 0x2079, 0x0100, 0x79e6,
-	0x78ea, 0x0006, 0x9084, 0x00ff, 0x0016, 0x2008, 0x080c, 0x2644,
-	0x7932, 0x7936, 0x001e, 0x000e, 0x00fe, 0x080c, 0x25fb, 0x695e,
-	0x703c, 0x00e6, 0x2071, 0x0140, 0x7086, 0x2071, 0x1800, 0x70b6,
-	0x00ee, 0x7034, 0x9005, 0x1904, 0x8171, 0x2009, 0x0017, 0x0804,
-	0x8121, 0x908e, 0x0400, 0x1190, 0x7034, 0x9005, 0x1904, 0x8171,
-	0x080c, 0x74e9, 0x0120, 0x2009, 0x001d, 0x0804, 0x8121, 0x68dc,
-	0xc0a5, 0x68de, 0x2009, 0x0030, 0x0804, 0x8121, 0x908e, 0x0500,
-	0x1140, 0x7034, 0x9005, 0x1904, 0x8171, 0x2009, 0x0018, 0x0804,
-	0x8121, 0x908e, 0x2010, 0x1120, 0x2009, 0x0019, 0x0804, 0x8121,
-	0x908e, 0x2110, 0x1120, 0x2009, 0x001a, 0x0804, 0x8121, 0x908e,
-	0x5200, 0x1140, 0x7034, 0x9005, 0x1904, 0x8171, 0x2009, 0x001b,
-	0x0804, 0x8121, 0x908e, 0x5000, 0x1140, 0x7034, 0x9005, 0x1904,
-	0x8171, 0x2009, 0x001c, 0x0804, 0x8121, 0x908e, 0x1300, 0x1120,
-	0x2009, 0x0034, 0x0804, 0x8121, 0x908e, 0x1200, 0x1140, 0x7034,
-	0x9005, 0x1904, 0x8171, 0x2009, 0x0024, 0x0804, 0x8121, 0x908c,
-	0xff00, 0x918e, 0x2400, 0x1170, 0x2009, 0x002d, 0x2001, 0x1810,
-	0x2004, 0xd09c, 0x0904, 0x8121, 0x080c, 0xd64f, 0x1904, 0x8171,
-	0x0804, 0x811f, 0x908c, 0xff00, 0x918e, 0x5300, 0x1120, 0x2009,
-	0x002a, 0x0804, 0x8121, 0x908e, 0x0f00, 0x1120, 0x2009, 0x0020,
-	0x0804, 0x8121, 0x908e, 0x6104, 0x1530, 0x2029, 0x0205, 0x2011,
-	0x026d, 0x8208, 0x2204, 0x9082, 0x0004, 0x8004, 0x8004, 0x20a8,
-	0x2011, 0x8015, 0x211c, 0x8108, 0x0046, 0x2124, 0x080c, 0x4b07,
-	0x004e, 0x8108, 0x0f04, 0x80d5, 0x9186, 0x0280, 0x1d88, 0x2504,
-	0x8000, 0x202a, 0x2009, 0x0260, 0x0c58, 0x202b, 0x0000, 0x2009,
-	0x0023, 0x0804, 0x8121, 0x908e, 0x6000, 0x1120, 0x2009, 0x003f,
-	0x0804, 0x8121, 0x908e, 0x5400, 0x1138, 0x080c, 0x84fa, 0x1904,
-	0x8171, 0x2009, 0x0046, 0x04a8, 0x908e, 0x5500, 0x1148, 0x080c,
-	0x8522, 0x1118, 0x2009, 0x0041, 0x0460, 0x2009, 0x0042, 0x0448,
-	0x908e, 0x7800, 0x1118, 0x2009, 0x0045, 0x0418, 0x908e, 0x1000,
-	0x1118, 0x2009, 0x004e, 0x00e8, 0x908e, 0x6300, 0x1118, 0x2009,
-	0x004a, 0x00b8, 0x908c, 0xff00, 0x918e, 0x5600, 0x1118, 0x2009,
-	0x004f, 0x0078, 0x908c, 0xff00, 0x918e, 0x5700, 0x1118, 0x2009,
-	0x0050, 0x0038, 0x2009, 0x001d, 0x6838, 0xd0d4, 0x0110, 0x2009,
-	0x004c, 0x0016, 0x2011, 0x0263, 0x2204, 0x8211, 0x220c, 0x080c,
-	0x25fb, 0x1904, 0x8174, 0x080c, 0x65c4, 0x1904, 0x8174, 0xbe12,
-	0xbd16, 0x001e, 0x0016, 0x080c, 0x74e9, 0x01c0, 0x68dc, 0xd08c,
-	0x1148, 0x7000, 0x9084, 0x00ff, 0x1188, 0x7004, 0x9084, 0xff00,
-	0x1168, 0x0040, 0x687c, 0x9606, 0x1148, 0x6880, 0x9506, 0x9084,
-	0xff00, 0x1120, 0x9584, 0x00ff, 0xb886, 0x0080, 0xb884, 0x9005,
-	0x1168, 0x9186, 0x0046, 0x1150, 0x687c, 0x9606, 0x1138, 0x6880,
-	0x9506, 0x9084, 0xff00, 0x1110, 0x001e, 0x0098, 0x080c, 0xab97,
-	0x01a8, 0x2b08, 0x6112, 0x6023, 0x0004, 0x7120, 0x610a, 0x001e,
-	0x9186, 0x004c, 0x1110, 0x6023, 0x000a, 0x0016, 0x001e, 0x080c,
-	0xac8c, 0x00ce, 0x00be, 0x0005, 0x001e, 0x0cd8, 0x2001, 0x180e,
-	0x2004, 0xd0ec, 0x0120, 0x2011, 0x8049, 0x080c, 0x4b07, 0x080c,
-	0xac5f, 0x0d90, 0x2b08, 0x6112, 0x6023, 0x0004, 0x7120, 0x610a,
-	0x001e, 0x0016, 0x9186, 0x0017, 0x0118, 0x9186, 0x0030, 0x1128,
-	0x6007, 0x0009, 0x6017, 0x2900, 0x0020, 0x6007, 0x0051, 0x6017,
-	0x0000, 0x602f, 0x0009, 0x6003, 0x0001, 0x080c, 0x9225, 0x08a0,
-	0x080c, 0x3332, 0x1140, 0x7010, 0x9084, 0xff00, 0x8007, 0x908e,
-	0x0008, 0x1108, 0x0009, 0x0005, 0x00b6, 0x00c6, 0x0046, 0x7000,
-	0x908c, 0xff00, 0x810f, 0x9186, 0x0033, 0x11e8, 0x080c, 0x840c,
-	0x0904, 0x81fb, 0x7124, 0x610a, 0x7030, 0x908e, 0x0200, 0x1140,
-	0x7034, 0x9005, 0x15c0, 0x2009, 0x0015, 0x080c, 0xac8c, 0x0498,
-	0x908e, 0x0100, 0x1580, 0x7034, 0x9005, 0x1568, 0x2009, 0x0016,
-	0x080c, 0xac8c, 0x0440, 0x9186, 0x0032, 0x1528, 0x7030, 0x908e,
-	0x1400, 0x1508, 0x2009, 0x0038, 0x0016, 0x2011, 0x0263, 0x2204,
-	0x8211, 0x220c, 0x080c, 0x25fb, 0x11a8, 0x080c, 0x65c4, 0x1190,
-	0xbe12, 0xbd16, 0x080c, 0xab97, 0x0168, 0x2b08, 0x6112, 0x080c,
-	0xcccc, 0x6023, 0x0004, 0x7120, 0x610a, 0x001e, 0x080c, 0xac8c,
-	0x0010, 0x00ce, 0x001e, 0x004e, 0x00ce, 0x00be, 0x0005, 0x00b6,
-	0x0046, 0x00e6, 0x00d6, 0x2028, 0x2130, 0x9696, 0x00ff, 0x11b8,
-	0x9592, 0xfffc, 0x02a0, 0x9596, 0xfffd, 0x1120, 0x2009, 0x007f,
-	0x0804, 0x825d, 0x9596, 0xfffe, 0x1120, 0x2009, 0x007e, 0x0804,
-	0x825d, 0x9596, 0xfffc, 0x1118, 0x2009, 0x0080, 0x04f0, 0x2011,
-	0x0000, 0x2019, 0x1837, 0x231c, 0xd3ac, 0x0130, 0x9026, 0x20a9,
-	0x0800, 0x2071, 0x1000, 0x0030, 0x2021, 0x0081, 0x20a9, 0x077f,
-	0x2071, 0x1081, 0x2e1c, 0x93dd, 0x0000, 0x1140, 0x82ff, 0x11d0,
-	0x9496, 0x00ff, 0x01b8, 0x2410, 0xc2fd, 0x00a0, 0xbf10, 0x2600,
-	0x9706, 0xb814, 0x1120, 0x9546, 0x1110, 0x2408, 0x00b0, 0x9745,
-	0x1148, 0x94c6, 0x007e, 0x0130, 0x94c6, 0x007f, 0x0118, 0x94c6,
-	0x0080, 0x1d20, 0x8420, 0x8e70, 0x1f04, 0x8232, 0x82ff, 0x1118,
-	0x9085, 0x0001, 0x0018, 0xc2fc, 0x2208, 0x9006, 0x00de, 0x00ee,
-	0x004e, 0x00be, 0x0005, 0x7000, 0x908c, 0xff00, 0x810f, 0x9184,
-	0x000f, 0x0002, 0x827a, 0x827a, 0x827a, 0x841e, 0x827a, 0x827d,
-	0x82a2, 0x832b, 0x827a, 0x827a, 0x827a, 0x827a, 0x827a, 0x827a,
-	0x827a, 0x827a, 0x7817, 0x0140, 0x0005, 0x00b6, 0x7110, 0xd1bc,
-	0x01e8, 0x7120, 0x2160, 0x9c8c, 0x0003, 0x11c0, 0x9c8a, 0x1ddc,
-	0x02a8, 0x6868, 0x9c02, 0x1290, 0x7008, 0x9084, 0x00ff, 0x6110,
-	0x2158, 0xb910, 0x9106, 0x1150, 0x700c, 0xb914, 0x9106, 0x1130,
-	0x7124, 0x610a, 0x2009, 0x0046, 0x080c, 0xac8c, 0x7817, 0x0140,
-	0x00be, 0x0005, 0x00b6, 0x00c6, 0x9484, 0x0fff, 0x0904, 0x8307,
-	0x7110, 0xd1bc, 0x1904, 0x8307, 0x7108, 0x700c, 0x2028, 0x918c,
-	0x00ff, 0x2130, 0x9094, 0xff00, 0x15c8, 0x81ff, 0x15b8, 0x9080,
-	0x3374, 0x200d, 0x918c, 0xff00, 0x810f, 0x2001, 0x0080, 0x9106,
-	0x0904, 0x8307, 0x9182, 0x0801, 0x1a04, 0x8307, 0x9190, 0x1000,
-	0x2204, 0x905d, 0x05e0, 0xbe12, 0xbd16, 0xb800, 0xd0ec, 0x15b8,
-	0xba04, 0x9294, 0xff00, 0x9286, 0x0600, 0x1190, 0x080c, 0xab97,
-	0x0598, 0x2b08, 0x7028, 0x6052, 0x702c, 0x604e, 0x6112, 0x6023,
-	0x0006, 0x7120, 0x610a, 0x7130, 0x615e, 0x080c, 0xd8b5, 0x00f8,
-	0x080c, 0x6a6b, 0x1138, 0xb807, 0x0606, 0x0c40, 0x190c, 0x81ff,
-	0x11b0, 0x0880, 0x080c, 0xab97, 0x2b08, 0x0188, 0x6112, 0x6023,
-	0x0004, 0x7120, 0x610a, 0x9286, 0x0400, 0x1118, 0x6007, 0x0005,
-	0x0010, 0x6007, 0x0001, 0x6003, 0x0001, 0x080c, 0x9225, 0x7817,
-	0x0140, 0x00ce, 0x00be, 0x0005, 0x2001, 0x180e, 0x2004, 0xd0ec,
-	0x0120, 0x2011, 0x8049, 0x080c, 0x4b07, 0x080c, 0xac5f, 0x0d78,
-	0x2b08, 0x6112, 0x6023, 0x0006, 0x7120, 0x610a, 0x7130, 0x615e,
-	0x6017, 0xf300, 0x6003, 0x0001, 0x6007, 0x0041, 0x2009, 0xa022,
-	0x080c, 0x921e, 0x08e0, 0x00b6, 0x7110, 0xd1bc, 0x05d0, 0x7020,
-	0x2060, 0x9c84, 0x0003, 0x15a8, 0x9c82, 0x1ddc, 0x0690, 0x6868,
-	0x9c02, 0x1678, 0x9484, 0x0fff, 0x9082, 0x000c, 0x0650, 0x7008,
-	0x9084, 0x00ff, 0x6110, 0x2158, 0xb910, 0x9106, 0x1510, 0x700c,
-	0xb914, 0x9106, 0x11f0, 0x7124, 0x610a, 0x601c, 0xd0fc, 0x11c8,
-	0x2001, 0x0271, 0x2004, 0x9005, 0x1180, 0x9484, 0x0fff, 0x9082,
-	0x000c, 0x0158, 0x0066, 0x2031, 0x0100, 0xa001, 0xa001, 0x8631,
-	0x1de0, 0x006e, 0x601c, 0xd0fc, 0x1120, 0x2009, 0x0045, 0x080c,
-	0xac8c, 0x7817, 0x0140, 0x00be, 0x0005, 0x6120, 0x9186, 0x0002,
-	0x0128, 0x9186, 0x0005, 0x0110, 0x9085, 0x0001, 0x0005, 0x080c,
-	0x3332, 0x1168, 0x7010, 0x9084, 0xff00, 0x8007, 0x9086, 0x0000,
-	0x1130, 0x9184, 0x000f, 0x908a, 0x0006, 0x1208, 0x000b, 0x0005,
-	0x838e, 0x838f, 0x838e, 0x838e, 0x83ee, 0x83fd, 0x0005, 0x00b6,
-	0x7110, 0xd1bc, 0x0120, 0x702c, 0xd084, 0x0904, 0x83ec, 0x700c,
-	0x7108, 0x080c, 0x25fb, 0x1904, 0x83ec, 0x080c, 0x65c4, 0x1904,
-	0x83ec, 0xbe12, 0xbd16, 0x7110, 0xd1bc, 0x01d8, 0x080c, 0x6a6b,
-	0x0118, 0x9086, 0x0004, 0x1588, 0x00c6, 0x080c, 0x840c, 0x00ce,
-	0x05d8, 0x080c, 0xab97, 0x2b08, 0x05b8, 0x6112, 0x080c, 0xcccc,
-	0x6023, 0x0002, 0x7120, 0x610a, 0x2009, 0x0088, 0x080c, 0xac8c,
-	0x0458, 0x080c, 0x6a6b, 0x0148, 0x9086, 0x0004, 0x0130, 0x080c,
-	0x6a73, 0x0118, 0x9086, 0x0004, 0x1180, 0x080c, 0xab97, 0x2b08,
-	0x01d8, 0x6112, 0x080c, 0xcccc, 0x6023, 0x0005, 0x7120, 0x610a,
-	0x2009, 0x0088, 0x080c, 0xac8c, 0x0078, 0x080c, 0xab97, 0x2b08,
-	0x0158, 0x6112, 0x080c, 0xcccc, 0x6023, 0x0004, 0x7120, 0x610a,
-	0x2009, 0x0001, 0x080c, 0xac8c, 0x00be, 0x0005, 0x7110, 0xd1bc,
-	0x0158, 0x00d1, 0x0148, 0x080c, 0x836d, 0x1130, 0x7124, 0x610a,
-	0x2009, 0x0089, 0x080c, 0xac8c, 0x0005, 0x7110, 0xd1bc, 0x0158,
-	0x0059, 0x0148, 0x080c, 0x836d, 0x1130, 0x7124, 0x610a, 0x2009,
-	0x008a, 0x080c, 0xac8c, 0x0005, 0x7020, 0x2060, 0x9c84, 0x0003,
-	0x1158, 0x9c82, 0x1ddc, 0x0240, 0x2001, 0x181a, 0x2004, 0x9c02,
-	0x1218, 0x9085, 0x0001, 0x0005, 0x9006, 0x0ce8, 0x00b6, 0x7110,
-	0xd1bc, 0x11d8, 0x7024, 0x2060, 0x9c84, 0x0003, 0x11b0, 0x9c82,
-	0x1ddc, 0x0298, 0x6868, 0x9c02, 0x1280, 0x7008, 0x9084, 0x00ff,
-	0x6110, 0x2158, 0xb910, 0x9106, 0x1140, 0x700c, 0xb914, 0x9106,
-	0x1120, 0x2009, 0x0051, 0x080c, 0xac8c, 0x7817, 0x0140, 0x00be,
-	0x0005, 0x2031, 0x0105, 0x0069, 0x0005, 0x2031, 0x0206, 0x0049,
-	0x0005, 0x2031, 0x0207, 0x0029, 0x0005, 0x2031, 0x0213, 0x0009,
-	0x0005, 0x00c6, 0x0096, 0x00f6, 0x7000, 0x9084, 0xf000, 0x9086,
-	0xc000, 0x05c0, 0x080c, 0xab97, 0x05a8, 0x0066, 0x00c6, 0x0046,
-	0x2011, 0x0263, 0x2204, 0x8211, 0x220c, 0x080c, 0x25fb, 0x1590,
-	0x080c, 0x65c4, 0x1578, 0xbe12, 0xbd16, 0x2b00, 0x004e, 0x00ce,
-	0x6012, 0x080c, 0xcccc, 0x080c, 0x103a, 0x0500, 0x2900, 0x6062,
-	0x9006, 0xa802, 0xa866, 0xac6a, 0xa85c, 0x90f8, 0x001b, 0x20a9,
-	0x000e, 0xa860, 0x20e8, 0x20e1, 0x0000, 0x2fa0, 0x2e98, 0x4003,
-	0x006e, 0x6616, 0x6007, 0x003e, 0x6023, 0x0001, 0x6003, 0x0001,
-	0x080c, 0x9225, 0x00fe, 0x009e, 0x00ce, 0x0005, 0x080c, 0xabed,
-	0x006e, 0x0cc0, 0x004e, 0x00ce, 0x0cc8, 0x00c6, 0x7000, 0x908c,
-	0xff00, 0x9184, 0xf000, 0x810f, 0x9086, 0x2000, 0x1904, 0x84f4,
-	0x9186, 0x0022, 0x15f0, 0x2001, 0x0111, 0x2004, 0x9005, 0x1904,
-	0x84f6, 0x7030, 0x908e, 0x0400, 0x0904, 0x84f6, 0x908e, 0x6000,
-	0x05e8, 0x908e, 0x5400, 0x05d0, 0x908e, 0x0300, 0x11d8, 0x2009,
-	0x1837, 0x210c, 0xd18c, 0x1590, 0xd1a4, 0x1580, 0x080c, 0x6a29,
-	0x0558, 0x68b0, 0x9084, 0x00ff, 0x7100, 0x918c, 0x00ff, 0x9106,
-	0x1518, 0x6880, 0x69b0, 0x918c, 0xff00, 0x9105, 0x7104, 0x9106,
-	0x11d8, 0x00e0, 0x2009, 0x0103, 0x210c, 0xd1b4, 0x11a8, 0x908e,
-	0x5200, 0x09e8, 0x908e, 0x0500, 0x09d0, 0x908e, 0x5000, 0x09b8,
-	0x0058, 0x9186, 0x0023, 0x1140, 0x080c, 0x840c, 0x0128, 0x6004,
-	0x9086, 0x0002, 0x0118, 0x0000, 0x9006, 0x0010, 0x9085, 0x0001,
-	0x00ce, 0x0005, 0x0156, 0x0046, 0x0016, 0x0036, 0x7038, 0x2020,
-	0x8427, 0x94a4, 0x0007, 0xd484, 0x0148, 0x20a9, 0x0004, 0x2019,
-	0x1805, 0x2011, 0x027a, 0x080c, 0xbbae, 0x1178, 0xd48c, 0x0148,
-	0x20a9, 0x0004, 0x2019, 0x1801, 0x2011, 0x027e, 0x080c, 0xbbae,
-	0x1120, 0xd494, 0x0110, 0x9085, 0x0001, 0x003e, 0x001e, 0x004e,
-	0x015e, 0x0005, 0x0156, 0x0046, 0x0016, 0x0036, 0x7038, 0x2020,
-	0x8427, 0x94a4, 0x0007, 0xd484, 0x0148, 0x20a9, 0x0004, 0x2019,
-	0x1805, 0x2011, 0x0272, 0x080c, 0xbbae, 0x1178, 0xd48c, 0x0148,
-	0x20a9, 0x0004, 0x2019, 0x1801, 0x2011, 0x0276, 0x080c, 0xbbae,
-	0x1120, 0xd494, 0x0110, 0x9085, 0x0001, 0x003e, 0x001e, 0x004e,
-	0x015e, 0x0005, 0x00f6, 0x2079, 0x0200, 0x7800, 0xc0e5, 0xc0cc,
-	0x7802, 0x00fe, 0x0005, 0x00f6, 0x2079, 0x1800, 0x7834, 0xd084,
-	0x1130, 0x2079, 0x0200, 0x7800, 0x9085, 0x1200, 0x7802, 0x00fe,
-	0x0005, 0x00e6, 0x2071, 0x1800, 0x7034, 0xc084, 0x7036, 0x00ee,
-	0x0005, 0x2071, 0x1a03, 0x7003, 0x0003, 0x700f, 0x0361, 0x9006,
-	0x701a, 0x7072, 0x7012, 0x7017, 0x1ddc, 0x7007, 0x0000, 0x7026,
-	0x702b, 0x9e54, 0x7032, 0x7037, 0x9ed1, 0x703f, 0xffff, 0x7042,
-	0x7047, 0x5571, 0x704a, 0x705b, 0x8711, 0x080c, 0x1053, 0x090c,
-	0x0d7d, 0x2900, 0x703a, 0xa867, 0x0003, 0xa86f, 0x0100, 0xa8ab,
-	0xdcb0, 0x0005, 0x2071, 0x1a03, 0x1d04, 0x862d, 0x2091, 0x6000,
-	0x700c, 0x8001, 0x700e, 0x1590, 0x2001, 0x013c, 0x2004, 0x9005,
-	0x190c, 0x87bb, 0x2001, 0x1869, 0x2004, 0xd0c4, 0x0158, 0x3a00,
-	0xd08c, 0x1140, 0x20d1, 0x0000, 0x20d1, 0x0001, 0x20d1, 0x0000,
-	0x080c, 0x0d7d, 0x700f, 0x0361, 0x7007, 0x0001, 0x0126, 0x2091,
-	0x8000, 0x2069, 0x1800, 0x69ec, 0xd1e4, 0x1138, 0xd1dc, 0x1118,
-	0x080c, 0x877f, 0x0010, 0x080c, 0x8756, 0x7040, 0x900d, 0x0148,
-	0x8109, 0x7142, 0x1130, 0x7044, 0x080f, 0x0018, 0x0126, 0x2091,
-	0x8000, 0x7024, 0x900d, 0x0188, 0x7020, 0x8001, 0x7022, 0x1168,
-	0x7023, 0x0009, 0x8109, 0x7126, 0x9186, 0x03e8, 0x1110, 0x7028,
-	0x080f, 0x81ff, 0x1110, 0x7028, 0x080f, 0x7030, 0x900d, 0x0180,
-	0x702c, 0x8001, 0x702e, 0x1160, 0x702f, 0x0009, 0x8109, 0x7132,
-	0x0128, 0x9184, 0x007f, 0x090c, 0x9f6d, 0x0010, 0x7034, 0x080f,
-	0x703c, 0x9005, 0x0118, 0x0310, 0x8001, 0x703e, 0x704c, 0x900d,
-	0x0168, 0x7048, 0x8001, 0x704a, 0x1148, 0x704b, 0x0009, 0x8109,
-	0x714e, 0x1120, 0x7150, 0x714e, 0x7058, 0x080f, 0x7018, 0x900d,
-	0x01d8, 0x0016, 0x7070, 0x900d, 0x0158, 0x706c, 0x8001, 0x706e,
-	0x1138, 0x706f, 0x0009, 0x8109, 0x7172, 0x1110, 0x7074, 0x080f,
-	0x001e, 0x7008, 0x8001, 0x700a, 0x1138, 0x700b, 0x0009, 0x8109,
-	0x711a, 0x1110, 0x701c, 0x080f, 0x012e, 0x7004, 0x0002, 0x8655,
-	0x8656, 0x8680, 0x00e6, 0x2071, 0x1a03, 0x7018, 0x9005, 0x1120,
-	0x711a, 0x721e, 0x700b, 0x0009, 0x00ee, 0x0005, 0x00e6, 0x0006,
-	0x2071, 0x1a03, 0x701c, 0x9206, 0x1120, 0x701a, 0x701e, 0x7072,
-	0x7076, 0x000e, 0x00ee, 0x0005, 0x00e6, 0x2071, 0x1a03, 0xb888,
-	0x9102, 0x0208, 0xb98a, 0x00ee, 0x0005, 0x0005, 0x00b6, 0x2031,
-	0x0010, 0x7110, 0x080c, 0x6625, 0x11a8, 0xb888, 0x8001, 0x0290,
-	0xb88a, 0x1180, 0x0126, 0x2091, 0x8000, 0x0066, 0xb8d0, 0x9005,
-	0x0138, 0x0026, 0xba3c, 0x0016, 0x080c, 0x6750, 0x001e, 0x002e,
-	0x006e, 0x012e, 0x8108, 0x9182, 0x0800, 0x1220, 0x8631, 0x0128,
-	0x7112, 0x0c00, 0x900e, 0x7007, 0x0002, 0x7112, 0x00be, 0x0005,
-	0x2031, 0x0010, 0x7014, 0x2060, 0x0126, 0x2091, 0x8000, 0x6048,
-	0x9005, 0x0128, 0x8001, 0x604a, 0x1110, 0x080c, 0xcb4d, 0x6018,
-	0x9005, 0x0904, 0x86d8, 0x00f6, 0x2079, 0x0300, 0x7918, 0xd1b4,
-	0x1904, 0x86eb, 0x781b, 0x2020, 0xa001, 0x7918, 0xd1b4, 0x0120,
-	0x781b, 0x2000, 0x0804, 0x86eb, 0x8001, 0x601a, 0x0106, 0x781b,
-	0x2000, 0xa001, 0x7918, 0xd1ac, 0x1dd0, 0x010e, 0x00fe, 0x1540,
-	0x6120, 0x9186, 0x0003, 0x0148, 0x9186, 0x0006, 0x0130, 0x9186,
-	0x0009, 0x11e0, 0x611c, 0xd1c4, 0x1100, 0x080c, 0xc838, 0x01b0,
-	0x6014, 0x2048, 0xa884, 0x908a, 0x199a, 0x0280, 0x9082, 0x1999,
-	0xa886, 0x908a, 0x199a, 0x0210, 0x2001, 0x1999, 0x8003, 0x800b,
-	0x810b, 0x9108, 0x611a, 0x080c, 0xcf7e, 0x0110, 0x080c, 0xc536,
-	0x012e, 0x9c88, 0x001c, 0x7116, 0x2001, 0x181a, 0x2004, 0x9102,
-	0x1228, 0x8631, 0x0138, 0x2160, 0x0804, 0x8684, 0x7017, 0x1ddc,
-	0x7007, 0x0000, 0x0005, 0x00fe, 0x0c58, 0x00e6, 0x2071, 0x1a03,
-	0x7027, 0x07d0, 0x7023, 0x0009, 0x00ee, 0x0005, 0x2001, 0x1a0c,
-	0x2003, 0x0000, 0x0005, 0x00e6, 0x2071, 0x1a03, 0x7132, 0x702f,
-	0x0009, 0x00ee, 0x0005, 0x2011, 0x1a0f, 0x2013, 0x0000, 0x0005,
-	0x00e6, 0x2071, 0x1a03, 0x711a, 0x721e, 0x700b, 0x0009, 0x00ee,
-	0x0005, 0x0086, 0x0026, 0x7054, 0x8000, 0x7056, 0x2001, 0x1a11,
-	0x2044, 0xa06c, 0x9086, 0x0000, 0x0150, 0x7068, 0xa09a, 0x7064,
-	0xa096, 0x7060, 0xa092, 0x705c, 0xa08e, 0x080c, 0x1124, 0x002e,
-	0x008e, 0x0005, 0x0006, 0x0016, 0x0096, 0x00a6, 0x00b6, 0x00c6,
-	0x00d6, 0x00e6, 0x00f6, 0x0156, 0x080c, 0x8592, 0x015e, 0x00fe,
-	0x00ee, 0x00de, 0x00ce, 0x00be, 0x00ae, 0x009e, 0x001e, 0x000e,
-	0x0005, 0x00e6, 0x2071, 0x1a03, 0x7172, 0x7276, 0x706f, 0x0009,
-	0x00ee, 0x0005, 0x00e6, 0x0006, 0x2071, 0x1a03, 0x7074, 0x9206,
-	0x1110, 0x7072, 0x7076, 0x000e, 0x00ee, 0x0005, 0x2069, 0x1800,
-	0x69ec, 0xd1e4, 0x1518, 0x0026, 0xd1ec, 0x0140, 0x6a54, 0x6874,
-	0x9202, 0x0288, 0x8117, 0x9294, 0x00c1, 0x0088, 0x9184, 0x0007,
-	0x01a0, 0x8109, 0x9184, 0x0007, 0x0110, 0x69ee, 0x0070, 0x8107,
-	0x9084, 0x0007, 0x910d, 0x8107, 0x9106, 0x9094, 0x00c1, 0x9184,
-	0xff3e, 0x9205, 0x68ee, 0x080c, 0x0f05, 0x002e, 0x0005, 0x69e8,
-	0x9184, 0x003f, 0x05b8, 0x8109, 0x9184, 0x003f, 0x01a8, 0x6a54,
-	0x6874, 0x9202, 0x0220, 0xd1bc, 0x0168, 0xc1bc, 0x0018, 0xd1bc,
-	0x1148, 0xc1bd, 0x2110, 0x00e6, 0x2071, 0x1800, 0x080c, 0x0f27,
-	0x00ee, 0x0400, 0x69ea, 0x00f0, 0x0026, 0x8107, 0x9094, 0x0007,
-	0x0128, 0x8001, 0x8007, 0x9085, 0x0007, 0x0050, 0x2010, 0x8004,
-	0x8004, 0x8004, 0x9084, 0x0007, 0x9205, 0x8007, 0x9085, 0x0028,
-	0x9086, 0x0040, 0x2010, 0x00e6, 0x2071, 0x1800, 0x080c, 0x0f27,
-	0x00ee, 0x002e, 0x0005, 0x0016, 0x00c6, 0x2009, 0xfffc, 0x210d,
-	0x2061, 0x0100, 0x60f0, 0x9100, 0x60f3, 0x0000, 0x2009, 0xfffc,
-	0x200f, 0x1220, 0x8108, 0x2105, 0x8000, 0x200f, 0x00ce, 0x001e,
-	0x0005, 0x00c6, 0x2061, 0x1a6f, 0x00ce, 0x0005, 0x9184, 0x000f,
-	0x8003, 0x8003, 0x8003, 0x9080, 0x1a6f, 0x2060, 0x0005, 0xa884,
-	0x908a, 0x199a, 0x1638, 0x9005, 0x1150, 0x00c6, 0x2061, 0x1a6f,
-	0x6014, 0x00ce, 0x9005, 0x1130, 0x2001, 0x001e, 0x0018, 0x908e,
-	0xffff, 0x01b0, 0x8003, 0x800b, 0x810b, 0x9108, 0x611a, 0xa87c,
-	0x908c, 0x00c0, 0x918e, 0x00c0, 0x0904, 0x8896, 0xd0b4, 0x1168,
-	0xd0bc, 0x1904, 0x886f, 0x2009, 0x0006, 0x080c, 0x88c3, 0x0005,
-	0x900e, 0x0c60, 0x2001, 0x1999, 0x08b0, 0xd0fc, 0x05c8, 0x908c,
-	0x2023, 0x1550, 0x87ff, 0x1540, 0x6124, 0x918c, 0x0500, 0x1520,
-	0x6100, 0x918e, 0x0007, 0x1500, 0x2009, 0x1869, 0x210c, 0xd184,
-	0x11d8, 0x6003, 0x0003, 0x6007, 0x0043, 0x6047, 0xb035, 0x080c,
-	0x1c03, 0xa87c, 0xc0dd, 0xa87e, 0x600f, 0x0000, 0x00f6, 0x2079,
-	0x0380, 0x7818, 0xd0bc, 0x1de8, 0x7833, 0x0013, 0x2c00, 0x7836,
-	0x781b, 0x8080, 0x00fe, 0x0005, 0x908c, 0x0003, 0x0120, 0x918e,
-	0x0003, 0x1904, 0x88bd, 0x908c, 0x2020, 0x918e, 0x2020, 0x01a8,
-	0x6024, 0xd0d4, 0x11e8, 0x2009, 0x1869, 0x2104, 0xd084, 0x1138,
-	0x87ff, 0x1120, 0x2009, 0x0043, 0x0804, 0xac8c, 0x0005, 0x87ff,
-	0x1de8, 0x2009, 0x0042, 0x0804, 0xac8c, 0x6110, 0x00b6, 0x2158,
-	0xb900, 0x00be, 0xd1ac, 0x0d20, 0x6024, 0xc0cd, 0x6026, 0x0c00,
-	0xc0d4, 0x6026, 0xa890, 0x602e, 0xa88c, 0x6032, 0x08e0, 0xd0fc,
-	0x0160, 0x908c, 0x0003, 0x0120, 0x918e, 0x0003, 0x1904, 0x88bd,
-	0x908c, 0x2020, 0x918e, 0x2020, 0x0170, 0x0076, 0x00f6, 0x2c78,
-	0x080c, 0x1731, 0x00fe, 0x007e, 0x87ff, 0x1120, 0x2009, 0x0042,
-	0x080c, 0xac8c, 0x0005, 0x6110, 0x00b6, 0x2158, 0xb900, 0x00be,
-	0xd1ac, 0x0d58, 0x6124, 0xc1cd, 0x6126, 0x0c38, 0xd0fc, 0x0188,
-	0x908c, 0x2020, 0x918e, 0x2020, 0x01a8, 0x9084, 0x0003, 0x908e,
-	0x0002, 0x0148, 0x87ff, 0x1120, 0x2009, 0x0041, 0x080c, 0xac8c,
-	0x0005, 0x00b9, 0x0ce8, 0x87ff, 0x1dd8, 0x2009, 0x0043, 0x080c,
-	0xac8c, 0x0cb0, 0x6110, 0x00b6, 0x2158, 0xb900, 0x00be, 0xd1ac,
-	0x0d20, 0x6124, 0xc1cd, 0x6126, 0x0c00, 0x2009, 0x0004, 0x0019,
-	0x0005, 0x2009, 0x0001, 0x0096, 0x080c, 0xc838, 0x0518, 0x6014,
-	0x2048, 0xa982, 0xa800, 0x6016, 0x9186, 0x0001, 0x1188, 0xa97c,
-	0x918c, 0x8100, 0x918e, 0x8100, 0x1158, 0x00c6, 0x2061, 0x1a6f,
-	0x6200, 0xd28c, 0x1120, 0x6204, 0x8210, 0x0208, 0x6206, 0x00ce,
-	0x080c, 0x6bb5, 0x6014, 0x904d, 0x0076, 0x2039, 0x0000, 0x190c,
-	0x87df, 0x007e, 0x009e, 0x0005, 0x0156, 0x00c6, 0x2061, 0x1a6f,
-	0x6000, 0x81ff, 0x0110, 0x9205, 0x0008, 0x9204, 0x6002, 0x00ce,
-	0x015e, 0x0005, 0x6800, 0xd08c, 0x1138, 0x6808, 0x9005, 0x0120,
-	0x8001, 0x680a, 0x9085, 0x0001, 0x0005, 0x2071, 0x1923, 0x7003,
-	0x0006, 0x7007, 0x0000, 0x700f, 0x0000, 0x7013, 0x0001, 0x080c,
-	0x1053, 0x090c, 0x0d7d, 0xa867, 0x0006, 0xa86b, 0x0001, 0xa8ab,
-	0xdcb0, 0xa89f, 0x0000, 0x2900, 0x702e, 0x7033, 0x0000, 0x0005,
-	0x0096, 0x00e6, 0x2071, 0x1923, 0x702c, 0x2048, 0x6a2c, 0x721e,
-	0x6b30, 0x7322, 0x6834, 0x7026, 0xa896, 0x6838, 0x702a, 0xa89a,
-	0x6824, 0x7016, 0x683c, 0x701a, 0x2009, 0x0028, 0x200a, 0x9005,
-	0x0148, 0x900e, 0x9188, 0x000c, 0x8001, 0x1de0, 0x2100, 0x9210,
-	0x1208, 0x8318, 0xaa8e, 0xab92, 0x7010, 0xd084, 0x0178, 0xc084,
-	0x7007, 0x0001, 0x700f, 0x0000, 0x0006, 0x2009, 0x181d, 0x2104,
-	0x9082, 0x0007, 0x2009, 0x1b4e, 0x200a, 0x000e, 0xc095, 0x7012,
-	0x2008, 0x2001, 0x003b, 0x080c, 0x1679, 0x9006, 0x2071, 0x193c,
-	0x7002, 0x7006, 0x702a, 0x00ee, 0x009e, 0x0005, 0x00e6, 0x0126,
-	0x0156, 0x2091, 0x8000, 0x2071, 0x1800, 0x7154, 0x2001, 0x0008,
-	0x910a, 0x0638, 0x2001, 0x187d, 0x20ac, 0x9006, 0x9080, 0x0008,
-	0x1f04, 0x8976, 0x71c0, 0x9102, 0x02e0, 0x2071, 0x1877, 0x20a9,
-	0x0007, 0x00c6, 0x080c, 0xab97, 0x6023, 0x0009, 0x6003, 0x0004,
-	0x601f, 0x0101, 0x0089, 0x0126, 0x2091, 0x8000, 0x080c, 0x8afc,
-	0x012e, 0x1f04, 0x8982, 0x9006, 0x00ce, 0x015e, 0x012e, 0x00ee,
-	0x0005, 0x9085, 0x0001, 0x0cc8, 0x00e6, 0x00b6, 0x0096, 0x0086,
-	0x0056, 0x0046, 0x0026, 0x7118, 0x720c, 0x7620, 0x7004, 0xd084,
-	0x1128, 0x2021, 0x0024, 0x2029, 0x0002, 0x0020, 0x2021, 0x002c,
-	0x2029, 0x000a, 0x080c, 0x103a, 0x090c, 0x0d7d, 0x2900, 0x6016,
-	0x2058, 0xac66, 0x9006, 0xa802, 0xa806, 0xa86a, 0xa87a, 0xa8aa,
-	0xa887, 0x0005, 0xa87f, 0x0020, 0x7008, 0xa89a, 0x7010, 0xa89e,
-	0xae8a, 0xa8af, 0xffff, 0xa8b3, 0x0000, 0x8109, 0x0160, 0x080c,
-	0x103a, 0x090c, 0x0d7d, 0xad66, 0x2b00, 0xa802, 0x2900, 0xb806,
-	0x2058, 0x8109, 0x1da0, 0x002e, 0x004e, 0x005e, 0x008e, 0x009e,
-	0x00be, 0x00ee, 0x0005, 0x2079, 0x0000, 0x2071, 0x1923, 0x7004,
-	0x004b, 0x700c, 0x0002, 0x89ee, 0x89e7, 0x89e7, 0x0005, 0x89f8,
-	0x8a59, 0x8a59, 0x8a59, 0x8a5a, 0x8a6b, 0x8a6b, 0x700c, 0x0cba,
-	0x0126, 0x2091, 0x8000, 0x78a0, 0x79a0, 0x9106, 0x0128, 0x78a0,
-	0x79a0, 0x9106, 0x1904, 0x8a4c, 0x2001, 0x0005, 0x2004, 0xd0bc,
-	0x0130, 0x2011, 0x0004, 0x2204, 0xc0c5, 0x2012, 0x0ca8, 0x012e,
-	0x7018, 0x910a, 0x1130, 0x7030, 0x9005, 0x05a8, 0x080c, 0x8a9a,
-	0x0490, 0x1210, 0x7114, 0x910a, 0x9192, 0x000a, 0x0210, 0x2009,
-	0x000a, 0x2001, 0x1888, 0x2014, 0x2001, 0x1935, 0x2004, 0x9100,
-	0x9202, 0x0e48, 0x080c, 0x8be6, 0x2200, 0x9102, 0x0208, 0x2208,
-	0x0096, 0x702c, 0x2048, 0xa873, 0x0001, 0xa976, 0x080c, 0x8cef,
-	0x2100, 0xa87e, 0xa86f, 0x0000, 0x009e, 0x0126, 0x2091, 0x8000,
-	0x2009, 0x1a21, 0x2104, 0xc085, 0x200a, 0x700f, 0x0002, 0x012e,
-	0x080c, 0x1143, 0x1de8, 0x0005, 0x2001, 0x0005, 0x2004, 0xd0bc,
-	0x0130, 0x2011, 0x0004, 0x2204, 0xc0c5, 0x2012, 0x0ca8, 0x012e,
-	0x0005, 0x0005, 0x700c, 0x0002, 0x8a5f, 0x8a62, 0x8a61, 0x080c,
-	0x89f6, 0x0005, 0x8001, 0x700e, 0x0096, 0x702c, 0x2048, 0xa974,
-	0x009e, 0x0011, 0x0ca0, 0x0005, 0x0096, 0x702c, 0x2048, 0x7018,
-	0x9100, 0x7214, 0x921a, 0x1130, 0x701c, 0xa88e, 0x7020, 0xa892,
-	0x9006, 0x0068, 0x0006, 0x080c, 0x8cef, 0x2100, 0xaa8c, 0x9210,
-	0xaa8e, 0x1220, 0xa890, 0x9081, 0x0000, 0xa892, 0x000e, 0x009e,
-	0x2f08, 0x9188, 0x0028, 0x200a, 0x701a, 0x0005, 0x00e6, 0x2071,
-	0x1923, 0x700c, 0x0002, 0x8a98, 0x8a98, 0x8a96, 0x700f, 0x0001,
-	0x00ee, 0x0005, 0x0126, 0x2091, 0x8000, 0x7030, 0x9005, 0x0508,
-	0x2078, 0x7814, 0x2048, 0xae88, 0x00b6, 0x2059, 0x0000, 0x080c,
-	0x8b05, 0x00be, 0x01b0, 0x00e6, 0x2071, 0x193c, 0x080c, 0x8b4c,
-	0x00ee, 0x0178, 0x0096, 0x080c, 0x1053, 0x2900, 0x009e, 0x0148,
-	0xa8aa, 0x04b9, 0x0041, 0x2001, 0x1946, 0x2003, 0x0000, 0x012e,
-	0x08c8, 0x012e, 0x0005, 0x00d6, 0x00c6, 0x0086, 0x00a6, 0x2940,
-	0x2650, 0x2600, 0x9005, 0x0180, 0xa864, 0x9084, 0x000f, 0x2068,
-	0x9d88, 0x1e55, 0x2165, 0x0056, 0x2029, 0x0000, 0x080c, 0x8c74,
-	0x080c, 0x1e2b, 0x1dd8, 0x005e, 0x00ae, 0x2001, 0x187f, 0x2004,
-	0xa88a, 0x080c, 0x1731, 0x781f, 0x0101, 0x7813, 0x0000, 0x0126,
-	0x2091, 0x8000, 0x080c, 0x8b5b, 0x012e, 0x008e, 0x00ce, 0x00de,
-	0x0005, 0x7030, 0x9005, 0x0138, 0x2078, 0x780c, 0x7032, 0x2001,
-	0x1946, 0x2003, 0x0001, 0x0005, 0x00e6, 0x2071, 0x1923, 0x7030,
-	0x600e, 0x2c00, 0x7032, 0x00ee, 0x0005, 0x00d6, 0x00c6, 0x0026,
-	0x9b80, 0x8dce, 0x2005, 0x906d, 0x090c, 0x0d7d, 0x9b80, 0x8dc6,
-	0x2005, 0x9065, 0x090c, 0x0d7d, 0x6114, 0x2600, 0x9102, 0x0248,
-	0x6828, 0x9102, 0x02f0, 0x9085, 0x0001, 0x002e, 0x00ce, 0x00de,
-	0x0005, 0x6804, 0xd094, 0x0148, 0x6854, 0xd084, 0x1178, 0xc085,
-	0x6856, 0x2011, 0x8026, 0x080c, 0x4b07, 0x684c, 0x0096, 0x904d,
-	0x090c, 0x0d7d, 0xa804, 0x8000, 0xa806, 0x009e, 0x9006, 0x2030,
-	0x0c20, 0x6854, 0xd08c, 0x1d08, 0xc08d, 0x6856, 0x2011, 0x8025,
-	0x080c, 0x4b07, 0x684c, 0x0096, 0x904d, 0x090c, 0x0d7d, 0xa800,
-	0x8000, 0xa802, 0x009e, 0x0888, 0x7000, 0x2019, 0x0008, 0x8319,
-	0x7104, 0x9102, 0x1118, 0x2300, 0x9005, 0x0020, 0x0210, 0x9302,
-	0x0008, 0x8002, 0x0005, 0x00d6, 0x7814, 0x9005, 0x090c, 0x0d7d,
-	0x781c, 0x9084, 0x0101, 0x9086, 0x0101, 0x190c, 0x0d7d, 0x2069,
-	0x193c, 0x6804, 0x9080, 0x193e, 0x2f08, 0x2102, 0x6904, 0x8108,
-	0x9182, 0x0008, 0x0208, 0x900e, 0x6906, 0x9180, 0x193e, 0x2003,
-	0x0000, 0x00de, 0x0005, 0x0096, 0x00c6, 0x2060, 0x6014, 0x2048,
-	0xa8a8, 0x0096, 0x2048, 0x9005, 0x190c, 0x106c, 0x009e, 0xa8ab,
-	0x0000, 0x080c, 0x0fec, 0x080c, 0xabed, 0x00ce, 0x009e, 0x0005,
-	0x6020, 0x9086, 0x0009, 0x1128, 0x601c, 0xd0c4, 0x0110, 0x9006,
-	0x0005, 0x9085, 0x0001, 0x0005, 0x6000, 0x9086, 0x0000, 0x0178,
-	0x6010, 0x9005, 0x0150, 0x00b6, 0x2058, 0x080c, 0x8f01, 0x00be,
-	0x6013, 0x0000, 0x601b, 0x0000, 0x0010, 0x2c00, 0x0861, 0x0005,
-	0x2009, 0x1927, 0x210c, 0xd194, 0x0005, 0x00e6, 0x2071, 0x1923,
-	0x7110, 0xc194, 0xd19c, 0x1118, 0xc185, 0x7007, 0x0000, 0x7112,
-	0x2001, 0x003b, 0x080c, 0x1679, 0x00ee, 0x0005, 0x0096, 0x00d6,
-	0x9006, 0x7006, 0x700e, 0x701a, 0x701e, 0x7022, 0x7016, 0x702a,
-	0x7026, 0x702f, 0x0000, 0x080c, 0x8d4e, 0x0170, 0x080c, 0x8d83,
-	0x0158, 0x2900, 0x7002, 0x700a, 0x701a, 0x7013, 0x0001, 0x701f,
-	0x000a, 0x00de, 0x009e, 0x0005, 0x900e, 0x0cd8, 0x00e6, 0x0096,
-	0x0086, 0x00d6, 0x00c6, 0x2071, 0x1930, 0x721c, 0x2100, 0x9202,
-	0x1618, 0x080c, 0x8d83, 0x090c, 0x0d7d, 0x7018, 0x9005, 0x1160,
-	0x2900, 0x7002, 0x700a, 0x701a, 0x9006, 0x7006, 0x700e, 0xa806,
-	0xa802, 0x7012, 0x701e, 0x0038, 0x2040, 0xa806, 0x2900, 0xa002,
-	0x701a, 0xa803, 0x0000, 0x7010, 0x8000, 0x7012, 0x701c, 0x9080,
-	0x000a, 0x701e, 0x721c, 0x08d0, 0x721c, 0x00ce, 0x00de, 0x008e,
-	0x009e, 0x00ee, 0x0005, 0x0096, 0x0156, 0x0136, 0x0146, 0x00e6,
-	0x0126, 0x2091, 0x8000, 0x2071, 0x1930, 0x7300, 0x831f, 0x831e,
-	0x831e, 0x9384, 0x003f, 0x20e8, 0x939c, 0xffc0, 0x9398, 0x0003,
-	0x7104, 0x080c, 0x8cef, 0x810c, 0x2100, 0x9318, 0x8003, 0x2228,
-	0x2021, 0x0078, 0x9402, 0x9532, 0x0208, 0x2028, 0x2500, 0x8004,
-	0x20a8, 0x23a0, 0xa001, 0xa001, 0x4005, 0x2508, 0x080c, 0x8cf8,
-	0x2130, 0x7014, 0x9600, 0x7016, 0x2600, 0x711c, 0x9102, 0x701e,
-	0x7004, 0x9600, 0x2008, 0x9082, 0x000a, 0x1190, 0x7000, 0x2048,
-	0xa800, 0x9005, 0x1148, 0x2009, 0x0001, 0x0026, 0x080c, 0x8be6,
-	0x002e, 0x7000, 0x2048, 0xa800, 0x7002, 0x7007, 0x0000, 0x0008,
-	0x7106, 0x2500, 0x9212, 0x1904, 0x8c25, 0x012e, 0x00ee, 0x014e,
-	0x013e, 0x015e, 0x009e, 0x0005, 0x0016, 0x0026, 0x00e6, 0x0126,
-	0x2091, 0x8000, 0x9580, 0x8dc6, 0x2005, 0x9075, 0x090c, 0x0d7d,
-	0x080c, 0x8cca, 0x012e, 0x9580, 0x8dc2, 0x2005, 0x9075, 0x090c,
-	0x0d7d, 0x0156, 0x0136, 0x01c6, 0x0146, 0x01d6, 0x831f, 0x831e,
-	0x831e, 0x9384, 0x003f, 0x20e0, 0x9384, 0xffc0, 0x9100, 0x2098,
-	0xa860, 0x20e8, 0xa95c, 0x2c05, 0x9100, 0x20a0, 0x20a9, 0x0002,
-	0x4003, 0x2e0c, 0x2d00, 0x0002, 0x8cb4, 0x8cb4, 0x8cb6, 0x8cb4,
-	0x8cb6, 0x8cb4, 0x8cb4, 0x8cb4, 0x8cb4, 0x8cb4, 0x8cbc, 0x8cb4,
-	0x8cbc, 0x8cb4, 0x8cb4, 0x8cb4, 0x080c, 0x0d7d, 0x4104, 0x20a9,
-	0x0002, 0x4002, 0x4003, 0x0028, 0x20a9, 0x0002, 0x4003, 0x4104,
-	0x4003, 0x01de, 0x014e, 0x01ce, 0x013e, 0x015e, 0x00ee, 0x002e,
-	0x001e, 0x0005, 0x0096, 0x7014, 0x8001, 0x7016, 0x710c, 0x2110,
-	0x00f1, 0x810c, 0x9188, 0x0003, 0x7308, 0x8210, 0x9282, 0x000a,
-	0x1198, 0x7008, 0x2048, 0xa800, 0x9005, 0x0158, 0x0006, 0x080c,
-	0x8d92, 0x009e, 0xa807, 0x0000, 0x2900, 0x700a, 0x7010, 0x8001,
-	0x7012, 0x700f, 0x0000, 0x0008, 0x720e, 0x009e, 0x0005, 0x0006,
-	0x810b, 0x810b, 0x2100, 0x810b, 0x9100, 0x2008, 0x000e, 0x0005,
-	0x0006, 0x0026, 0x2100, 0x9005, 0x0158, 0x9092, 0x000c, 0x0240,
-	0x900e, 0x8108, 0x9082, 0x000c, 0x1de0, 0x002e, 0x000e, 0x0005,
-	0x900e, 0x0cd8, 0x2d00, 0x90b8, 0x0008, 0x690c, 0x6810, 0x2019,
-	0x0001, 0x2031, 0x8d38, 0x9112, 0x0220, 0x0118, 0x8318, 0x2208,
-	0x0cd0, 0x6808, 0x9005, 0x0108, 0x8318, 0x233a, 0x6804, 0xd084,
-	0x2300, 0x2021, 0x0001, 0x1150, 0x9082, 0x0003, 0x0967, 0x0a67,
-	0x8420, 0x9082, 0x0007, 0x0967, 0x0a67, 0x0cd0, 0x9082, 0x0002,
-	0x0967, 0x0a67, 0x8420, 0x9082, 0x0005, 0x0967, 0x0a67, 0x0cd0,
-	0x6c1a, 0x2d00, 0x90b8, 0x0007, 0x00e6, 0x2071, 0x1800, 0x7128,
-	0x6810, 0x2019, 0x0001, 0x910a, 0x0118, 0x0210, 0x8318, 0x0cd8,
-	0x2031, 0x8d4b, 0x0870, 0x6c16, 0x00ee, 0x0005, 0x0096, 0x0046,
-	0x0126, 0x2091, 0x8000, 0x2b00, 0x9080, 0x8dca, 0x2005, 0x9005,
-	0x090c, 0x0d7d, 0x2004, 0x90a0, 0x000a, 0x080c, 0x1053, 0x01d0,
-	0x2900, 0x7026, 0xa803, 0x0000, 0xa807, 0x0000, 0x080c, 0x1053,
-	0x0188, 0x7024, 0xa802, 0xa807, 0x0000, 0x2900, 0x7026, 0x94a2,
-	0x000a, 0x0110, 0x0208, 0x0c90, 0x9085, 0x0001, 0x012e, 0x004e,
-	0x009e, 0x0005, 0x7024, 0x9005, 0x0dc8, 0x2048, 0xac00, 0x080c,
-	0x106c, 0x2400, 0x0cc0, 0x0126, 0x2091, 0x8000, 0x7024, 0x2048,
-	0x9005, 0x0130, 0xa800, 0x7026, 0xa803, 0x0000, 0xa807, 0x0000,
-	0x012e, 0x0005, 0x0126, 0x2091, 0x8000, 0x7024, 0xa802, 0x2900,
-	0x7026, 0x012e, 0x0005, 0x0096, 0x9e80, 0x0009, 0x2004, 0x9005,
-	0x0138, 0x2048, 0xa800, 0x0006, 0x080c, 0x106c, 0x000e, 0x0cb8,
-	0x009e, 0x0005, 0x0096, 0x7008, 0x9005, 0x0138, 0x2048, 0xa800,
-	0x0006, 0x080c, 0x106c, 0x000e, 0x0cb8, 0x9006, 0x7002, 0x700a,
-	0x7006, 0x700e, 0x701a, 0x701e, 0x7022, 0x702a, 0x7026, 0x702e,
-	0x009e, 0x0005, 0x1a6d, 0x0000, 0x0000, 0x0000, 0x1930, 0x0000,
-	0x0000, 0x0000, 0x1888, 0x0000, 0x0000, 0x0000, 0x1877, 0x0000,
-	0x0000, 0x0000, 0x00e6, 0x00c6, 0x00b6, 0x00a6, 0xa8a8, 0x2040,
-	0x2071, 0x1877, 0x080c, 0x8eec, 0xa067, 0x0023, 0x6010, 0x905d,
-	0x0904, 0x8ec1, 0xb814, 0xa06e, 0xb910, 0xa172, 0xb9a0, 0xa176,
-	0x2001, 0x0003, 0xa07e, 0xa834, 0xa082, 0xa07b, 0x0000, 0xa898,
-	0x9005, 0x0118, 0xa078, 0xc085, 0xa07a, 0x2858, 0x2031, 0x0018,
-	0xa068, 0x908a, 0x0019, 0x1a0c, 0x0d7d, 0x2020, 0x2050, 0x2940,
-	0xa864, 0x90bc, 0x00ff, 0x908c, 0x000f, 0x91e0, 0x1e55, 0x2c65,
-	0x9786, 0x0024, 0x2c05, 0x1590, 0x908a, 0x0036, 0x1a0c, 0x0d7d,
-	0x9082, 0x001b, 0x0002, 0x8e2e, 0x8e2e, 0x8e30, 0x8e2e, 0x8e2e,
-	0x8e2e, 0x8e32, 0x8e2e, 0x8e2e, 0x8e2e, 0x8e34, 0x8e2e, 0x8e2e,
-	0x8e2e, 0x8e36, 0x8e2e, 0x8e2e, 0x8e2e, 0x8e38, 0x8e2e, 0x8e2e,
-	0x8e2e, 0x8e3a, 0x8e2e, 0x8e2e, 0x8e2e, 0x8e3c, 0x080c, 0x0d7d,
-	0xa180, 0x04b8, 0xa190, 0x04a8, 0xa1a0, 0x0498, 0xa1b0, 0x0488,
-	0xa1c0, 0x0478, 0xa1d0, 0x0468, 0xa1e0, 0x0458, 0x908a, 0x0034,
-	0x1a0c, 0x0d7d, 0x9082, 0x001b, 0x0002, 0x8e60, 0x8e5e, 0x8e5e,
-	0x8e5e, 0x8e5e, 0x8e5e, 0x8e62, 0x8e5e, 0x8e5e, 0x8e5e, 0x8e5e,
-	0x8e5e, 0x8e64, 0x8e5e, 0x8e5e, 0x8e5e, 0x8e5e, 0x8e5e, 0x8e66,
-	0x8e5e, 0x8e5e, 0x8e5e, 0x8e5e, 0x8e5e, 0x8e68, 0x080c, 0x0d7d,
-	0xa180, 0x0038, 0xa198, 0x0028, 0xa1b0, 0x0018, 0xa1c8, 0x0008,
-	0xa1e0, 0x2600, 0x0002, 0x8e84, 0x8e86, 0x8e88, 0x8e8a, 0x8e8c,
-	0x8e8e, 0x8e90, 0x8e92, 0x8e94, 0x8e96, 0x8e98, 0x8e9a, 0x8e9c,
-	0x8e9e, 0x8ea0, 0x8ea2, 0x8ea4, 0x8ea6, 0x8ea8, 0x8eaa, 0x8eac,
-	0x8eae, 0x8eb0, 0x8eb2, 0x8eb4, 0x080c, 0x0d7d, 0xb9e2, 0x0468,
-	0xb9de, 0x0458, 0xb9da, 0x0448, 0xb9d6, 0x0438, 0xb9d2, 0x0428,
-	0xb9ce, 0x0418, 0xb9ca, 0x0408, 0xb9c6, 0x00f8, 0xb9c2, 0x00e8,
-	0xb9be, 0x00d8, 0xb9ba, 0x00c8, 0xb9b6, 0x00b8, 0xb9b2, 0x00a8,
-	0xb9ae, 0x0098, 0xb9aa, 0x0088, 0xb9a6, 0x0078, 0xb9a2, 0x0068,
-	0xb99e, 0x0058, 0xb99a, 0x0048, 0xb996, 0x0038, 0xb992, 0x0028,
-	0xb98e, 0x0018, 0xb98a, 0x0008, 0xb986, 0x8631, 0x8421, 0x0120,
-	0x080c, 0x1e2b, 0x0804, 0x8e08, 0x00ae, 0x00be, 0x00ce, 0x00ee,
-	0x0005, 0xa86c, 0xa06e, 0xa870, 0xa072, 0xa077, 0x00ff, 0x9006,
-	0x0804, 0x8dea, 0x0006, 0x0016, 0x00b6, 0x6010, 0x2058, 0xb810,
-	0x9005, 0x01b0, 0x2001, 0x1924, 0x2004, 0x9005, 0x0188, 0x2001,
-	0x1800, 0x2004, 0x9086, 0x0003, 0x1158, 0x0036, 0x0046, 0xbba0,
-	0x2021, 0x0004, 0x2011, 0x8014, 0x080c, 0x4b07, 0x004e, 0x003e,
-	0x00be, 0x001e, 0x000e, 0x0005, 0x9016, 0x710c, 0xa834, 0x910a,
-	0xa936, 0x7008, 0x9005, 0x0120, 0x8210, 0x910a, 0x0238, 0x0130,
-	0x7010, 0x8210, 0x910a, 0x0210, 0x0108, 0x0cd8, 0xaa8a, 0xa26a,
-	0x0005, 0x00f6, 0x00d6, 0x0036, 0x2079, 0x0300, 0x781b, 0x0200,
-	0x7818, 0xd094, 0x1dd8, 0x781b, 0x0202, 0xa001, 0xa001, 0x7818,
-	0xd094, 0x1da0, 0xb8ac, 0x9005, 0x01b8, 0x2068, 0x2079, 0x0000,
-	0x2c08, 0x911e, 0x1118, 0x680c, 0xb8ae, 0x0060, 0x9106, 0x0140,
-	0x2d00, 0x2078, 0x680c, 0x9005, 0x090c, 0x0d7d, 0x2068, 0x0cb0,
-	0x6b0c, 0x7b0e, 0x600f, 0x0000, 0x2079, 0x0300, 0x781b, 0x0200,
-	0x003e, 0x00de, 0x00fe, 0x0005, 0x00e6, 0x00d6, 0x0096, 0x00c6,
-	0x0036, 0x0126, 0x2091, 0x8000, 0x0156, 0x20a9, 0x01ff, 0x2071,
-	0x0300, 0x701b, 0x0200, 0x7018, 0xd094, 0x0110, 0x1f04, 0x8f41,
-	0x701b, 0x0202, 0xa001, 0xa001, 0x7018, 0xd094, 0x1d90, 0xb8ac,
-	0x9005, 0x01d0, 0x2060, 0x600c, 0xb8ae, 0x6003, 0x0004, 0x601b,
-	0x0000, 0x6013, 0x0000, 0x601f, 0x0101, 0x6014, 0x2048, 0xa88b,
-	0x0000, 0xa8a8, 0xa8ab, 0x0000, 0x904d, 0x090c, 0x0d7d, 0x080c,
-	0x106c, 0x080c, 0x8afc, 0x0c18, 0x2071, 0x0300, 0x701b, 0x0200,
-	0x015e, 0x012e, 0x003e, 0x00ce, 0x009e, 0x00de, 0x00ee, 0x0005,
-	0x00c6, 0x00b6, 0x0016, 0x0006, 0x0156, 0x080c, 0x25fb, 0x015e,
-	0x11b0, 0x080c, 0x65c4, 0x190c, 0x0d7d, 0x000e, 0x001e, 0xb912,
-	0xb816, 0x080c, 0xab97, 0x0140, 0x2b00, 0x6012, 0x6023, 0x0001,
-	0x2009, 0x0001, 0x080c, 0xac8c, 0x00be, 0x00ce, 0x0005, 0x000e,
-	0x001e, 0x0cd0, 0x0066, 0x6000, 0x90b2, 0x0016, 0x1a0c, 0x0d7d,
-	0x0013, 0x006e, 0x0005, 0x8fb3, 0x8fb3, 0x8fb3, 0x8fb5, 0x8ffe,
-	0x8fb3, 0x8fb3, 0x8fb3, 0x9061, 0x8fb3, 0x9099, 0x8fb3, 0x8fb3,
-	0x8fb3, 0x8fb3, 0x8fb3, 0x080c, 0x0d7d, 0x9182, 0x0040, 0x0002,
-	0x8fc8, 0x8fc8, 0x8fc8, 0x8fc8, 0x8fc8, 0x8fc8, 0x8fc8, 0x8fc8,
-	0x8fc8, 0x8fca, 0x8fdb, 0x8fc8, 0x8fc8, 0x8fc8, 0x8fc8, 0x8fec,
-	0x080c, 0x0d7d, 0x0096, 0x6114, 0x2148, 0xa87b, 0x0000, 0x6010,
-	0x00b6, 0x2058, 0xb8bb, 0x0500, 0x00be, 0x080c, 0x6b80, 0x080c,
-	0xabed, 0x009e, 0x0005, 0x080c, 0x963b, 0x00d6, 0x6114, 0x080c,
-	0xc838, 0x0130, 0x0096, 0x6114, 0x2148, 0x080c, 0x6d80, 0x009e,
-	0x00de, 0x080c, 0xabed, 0x0005, 0x080c, 0x963b, 0x080c, 0x31e7,
-	0x6114, 0x0096, 0x2148, 0x080c, 0xc838, 0x0120, 0xa87b, 0x0029,
-	0x080c, 0x6d80, 0x009e, 0x080c, 0xabed, 0x0005, 0x601b, 0x0000,
-	0x9182, 0x0040, 0x0096, 0x0002, 0x9019, 0x9019, 0x9019, 0x9019,
-	0x9019, 0x9019, 0x9019, 0x9019, 0x901b, 0x9019, 0x9019, 0x9019,
-	0x905d, 0x9019, 0x9019, 0x9019, 0x9019, 0x9019, 0x9019, 0x9021,
-	0x9019, 0x080c, 0x0d7d, 0x6114, 0x2148, 0xa938, 0x918e, 0xffff,
-	0x05e0, 0x00e6, 0x6114, 0x2148, 0x080c, 0x8dd2, 0x0096, 0xa8a8,
-	0x2048, 0x080c, 0x6b18, 0x009e, 0xa8ab, 0x0000, 0x6010, 0x9005,
-	0x0128, 0x00b6, 0x2058, 0x080c, 0x8f01, 0x00be, 0xae88, 0x00b6,
-	0x2059, 0x0000, 0x080c, 0x8b05, 0x00be, 0x01e0, 0x2071, 0x193c,
-	0x080c, 0x8b4c, 0x01b8, 0x9086, 0x0001, 0x1128, 0x2001, 0x1946,
-	0x2004, 0x9005, 0x1178, 0x0096, 0x080c, 0x103a, 0x2900, 0x009e,
-	0x0148, 0xa8aa, 0x00f6, 0x2c78, 0x080c, 0x8ac3, 0x00fe, 0x00ee,
-	0x009e, 0x0005, 0x080c, 0x8afc, 0x0cd0, 0x080c, 0x9115, 0x009e,
-	0x0005, 0x9182, 0x0040, 0x0096, 0x0002, 0x9075, 0x9075, 0x9075,
-	0x9077, 0x9075, 0x9075, 0x9075, 0x9097, 0x9075, 0x9075, 0x9075,
-	0x9075, 0x9075, 0x9075, 0x9075, 0x9075, 0x080c, 0x0d7d, 0x6003,
-	0x0003, 0x6106, 0x6014, 0x2048, 0xa8ac, 0xa836, 0xa8b0, 0xa83a,
-	0xa847, 0x0000, 0xa84b, 0x0000, 0xa884, 0x9092, 0x199a, 0x0210,
-	0x2001, 0x1999, 0x8003, 0x8013, 0x8213, 0x9210, 0x621a, 0x080c,
-	0x1bba, 0x2009, 0x8030, 0x080c, 0x9265, 0x009e, 0x0005, 0x080c,
-	0x0d7d, 0x080c, 0x963b, 0x6114, 0x2148, 0xa87b, 0x0000, 0x6010,
-	0x00b6, 0x2058, 0xb8bb, 0x0500, 0x00be, 0x080c, 0x6d80, 0x080c,
-	0xabed, 0x009e, 0x0005, 0x080c, 0xa896, 0x6144, 0xd1fc, 0x0120,
-	0xd1ac, 0x1110, 0x6003, 0x0003, 0x6000, 0x908a, 0x0016, 0x1a0c,
-	0x0d7d, 0x0096, 0x0023, 0x009e, 0x080c, 0xa8b2, 0x0005, 0x90cf,
-	0x90cf, 0x90cf, 0x90d1, 0x90e2, 0x90cf, 0x90cf, 0x90cf, 0x90cf,
-	0x90cf, 0x90cf, 0x90cf, 0x90cf, 0x90cf, 0x90cf, 0x90cf, 0x080c,
-	0x0d7d, 0x080c, 0xaa2a, 0x6114, 0x2148, 0xa87b, 0x0006, 0x6010,
-	0x00b6, 0x2058, 0xb8bb, 0x0500, 0x00be, 0x080c, 0x6d80, 0x080c,
-	0xabed, 0x0005, 0x0491, 0x0005, 0x080c, 0xa896, 0x6000, 0x6144,
-	0xd1fc, 0x0130, 0xd1ac, 0x1120, 0x6003, 0x0003, 0x2009, 0x0003,
-	0x908a, 0x0016, 0x1a0c, 0x0d7d, 0x0096, 0x0033, 0x009e, 0x0106,
-	0x080c, 0xa8b2, 0x010e, 0x0005, 0x910c, 0x910c, 0x910c, 0x910e,
-	0x9115, 0x910c, 0x910c, 0x910c, 0x910c, 0x910c, 0x910c, 0x910c,
-	0x910c, 0x910c, 0x910c, 0x910c, 0x080c, 0x0d7d, 0x0036, 0x00e6,
-	0x080c, 0xaa2a, 0x00ee, 0x003e, 0x0005, 0x00f6, 0x00e6, 0x601b,
-	0x0000, 0x6014, 0x2048, 0x6010, 0x9005, 0x0128, 0x00b6, 0x2058,
-	0x080c, 0x8f01, 0x00be, 0x2071, 0x193c, 0x080c, 0x8b4c, 0x0160,
-	0x2001, 0x187f, 0x2004, 0xa88a, 0x2031, 0x0000, 0x2c78, 0x080c,
-	0x8ac3, 0x00ee, 0x00fe, 0x0005, 0x0096, 0xa88b, 0x0000, 0xa8a8,
-	0x2048, 0x080c, 0x106c, 0x009e, 0xa8ab, 0x0000, 0x080c, 0x8afc,
-	0x0c80, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
-	0x0000, 0x0000, 0x187a, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
-	0x0000, 0x0126, 0x2091, 0x8000, 0x0036, 0x0046, 0x20a9, 0x0010,
-	0x9006, 0x8004, 0x8086, 0x818e, 0x1208, 0x9200, 0x1f04, 0x915a,
-	0x8086, 0x818e, 0x004e, 0x003e, 0x012e, 0x0005, 0x0126, 0x2091,
-	0x8000, 0x0076, 0x0156, 0x20a9, 0x0010, 0x9005, 0x01c8, 0x911a,
-	0x12b8, 0x8213, 0x818d, 0x0228, 0x911a, 0x1220, 0x1f04, 0x9171,
-	0x0028, 0x911a, 0x2308, 0x8210, 0x1f04, 0x9171, 0x0006, 0x3200,
-	0x9084, 0xefff, 0x2080, 0x000e, 0x015e, 0x007e, 0x012e, 0x0005,
-	0x0006, 0x3200, 0x9085, 0x1000, 0x0ca8, 0x0126, 0x2091, 0x2800,
-	0x2079, 0x19e7, 0x012e, 0x00d6, 0x2069, 0x19e7, 0x6803, 0x0005,
-	0x0156, 0x0146, 0x01d6, 0x20e9, 0x0000, 0x2069, 0x0200, 0x080c,
-	0xa690, 0x04a9, 0x080c, 0xa67b, 0x0491, 0x080c, 0xa67e, 0x0479,
-	0x080c, 0xa681, 0x0461, 0x080c, 0xa684, 0x0449, 0x080c, 0xa687,
-	0x0431, 0x080c, 0xa68a, 0x0419, 0x080c, 0xa68d, 0x0401, 0x01de,
-	0x014e, 0x015e, 0x6857, 0x0000, 0x00f6, 0x2079, 0x0380, 0x00f9,
-	0x7807, 0x0003, 0x7803, 0x0000, 0x7803, 0x0001, 0x2069, 0x0004,
-	0x2d04, 0x9084, 0xfffe, 0x9085, 0x8000, 0x206a, 0x2069, 0x0100,
-	0x6828, 0x9084, 0xfffc, 0x682a, 0x00fe, 0x00de, 0x0005, 0x20a9,
-	0x0020, 0x20a1, 0x0240, 0x2001, 0x0000, 0x4004, 0x0005, 0x00c6,
-	0x7803, 0x0000, 0x9006, 0x7827, 0x0030, 0x782b, 0x0400, 0x7827,
-	0x0031, 0x782b, 0x1aef, 0x781f, 0xff00, 0x781b, 0xff00, 0x2061,
-	0x1ae4, 0x602f, 0x19e7, 0x6033, 0x1800, 0x6037, 0x1a03, 0x603b,
-	0x1e55, 0x603f, 0x1e65, 0x6042, 0x6047, 0x1aba, 0x00ce, 0x0005,
-	0x2001, 0x0382, 0x2004, 0x9084, 0x0007, 0x9086, 0x0001, 0x01b0,
-	0x00c6, 0x6146, 0x600f, 0x0000, 0x2c08, 0x2061, 0x19e7, 0x602c,
-	0x8000, 0x602e, 0x601c, 0x9005, 0x0130, 0x9080, 0x0003, 0x2102,
-	0x611e, 0x00ce, 0x0005, 0x6122, 0x611e, 0x0cd8, 0x6146, 0x2c08,
-	0x2001, 0x0012, 0x080c, 0xa887, 0x0005, 0x0016, 0x2009, 0x8020,
-	0x6146, 0x2c08, 0x2001, 0x0382, 0x2004, 0x9084, 0x0007, 0x9086,
-	0x0001, 0x1128, 0x2001, 0x0019, 0x080c, 0xa887, 0x0088, 0x00c6,
-	0x2061, 0x19e7, 0x602c, 0x8000, 0x602e, 0x600c, 0x9005, 0x0128,
-	0x9080, 0x0003, 0x2102, 0x610e, 0x0010, 0x6112, 0x610e, 0x00ce,
-	0x001e, 0x0005, 0x2001, 0x0382, 0x2004, 0x9084, 0x0007, 0x9086,
-	0x0001, 0x0198, 0x00c6, 0x6146, 0x600f, 0x0000, 0x2c08, 0x2061,
-	0x19e7, 0x6044, 0x9005, 0x0130, 0x9080, 0x0003, 0x2102, 0x6146,
-	0x00ce, 0x0005, 0x614a, 0x6146, 0x0cd8, 0x6146, 0x600f, 0x0000,
-	0x2c08, 0x2001, 0x0013, 0x080c, 0xa887, 0x0005, 0x6044, 0xd0dc,
-	0x0128, 0x9006, 0x7007, 0x0000, 0x700a, 0x7032, 0x0005, 0x00f6,
-	0x00e6, 0x00d6, 0x00c6, 0x00b6, 0x0096, 0x0076, 0x0066, 0x0056,
-	0x0036, 0x0026, 0x0016, 0x0006, 0x0126, 0x902e, 0x2071, 0x19e7,
-	0x7648, 0x2660, 0x2678, 0x2091, 0x8000, 0x8cff, 0x0904, 0x92f0,
-	0x6010, 0x2058, 0xb8a0, 0x9206, 0x1904, 0x92eb, 0x87ff, 0x0120,
-	0x605c, 0x9106, 0x1904, 0x92eb, 0x704c, 0x9c06, 0x1178, 0x0036,
-	0x2019, 0x0001, 0x080c, 0xa118, 0x703f, 0x0000, 0x9006, 0x704e,
-	0x706a, 0x7052, 0x706e, 0x003e, 0x2029, 0x0001, 0x080c, 0x926e,
-	0x7048, 0x9c36, 0x1110, 0x660c, 0x764a, 0x7044, 0x9c36, 0x1140,
-	0x2c00, 0x9f36, 0x0118, 0x2f00, 0x7046, 0x0010, 0x7047, 0x0000,
-	0x660c, 0x0066, 0x2c00, 0x9f06, 0x0110, 0x7e0e, 0x0008, 0x2678,
-	0x600f, 0x0000, 0x080c, 0xc838, 0x01c8, 0x6014, 0x2048, 0x6020,
-	0x9086, 0x0003, 0x1560, 0xa867, 0x0103, 0xab7a, 0xa877, 0x0000,
-	0x0016, 0x0036, 0x0076, 0x080c, 0xcb36, 0x080c, 0xe621, 0x080c,
-	0x6d80, 0x007e, 0x003e, 0x001e, 0x080c, 0xca27, 0x080c, 0xac28,
-	0x00ce, 0x0804, 0x928d, 0x2c78, 0x600c, 0x2060, 0x0804, 0x928d,
-	0x012e, 0x000e, 0x001e, 0x002e, 0x003e, 0x005e, 0x006e, 0x007e,
-	0x009e, 0x00be, 0x00ce, 0x00de, 0x00ee, 0x00fe, 0x0005, 0x6020,
-	0x9086, 0x0006, 0x1158, 0x0016, 0x0036, 0x0076, 0x080c, 0xe621,
-	0x080c, 0xe26c, 0x007e, 0x003e, 0x001e, 0x08c0, 0x6020, 0x9086,
-	0x0009, 0x1168, 0xa87b, 0x0006, 0x0016, 0x0036, 0x0076, 0x080c,
-	0x6d80, 0x080c, 0xabed, 0x007e, 0x003e, 0x001e, 0x0848, 0x6020,
-	0x9086, 0x000a, 0x0904, 0x92d5, 0x0804, 0x92d3, 0x0006, 0x0066,
-	0x0096, 0x00c6, 0x00d6, 0x00f6, 0x9036, 0x0126, 0x2091, 0x8000,
-	0x2079, 0x19e7, 0x7848, 0x9065, 0x0904, 0x9385, 0x600c, 0x0006,
-	0x600f, 0x0000, 0x784c, 0x9c06, 0x11a0, 0x0036, 0x2019, 0x0001,
-	0x080c, 0xa118, 0x783f, 0x0000, 0x901e, 0x7b4e, 0x7b6a, 0x7b52,
-	0x7b6e, 0x003e, 0x000e, 0x9005, 0x1118, 0x600c, 0x600f, 0x0000,
-	0x0006, 0x00e6, 0x2f70, 0x080c, 0x926e, 0x00ee, 0x080c, 0xc838,
-	0x0520, 0x6014, 0x2048, 0x6020, 0x9086, 0x0003, 0x1580, 0x3e08,
-	0x918e, 0x0002, 0x1188, 0x6010, 0x9005, 0x0170, 0x00b6, 0x2058,
-	0xb800, 0x00be, 0xd0bc, 0x0140, 0x6048, 0x9005, 0x1198, 0x2001,
-	0x1988, 0x2004, 0x604a, 0x0070, 0xa867, 0x0103, 0xab7a, 0xa877,
-	0x0000, 0x080c, 0x6d74, 0x080c, 0xca27, 0x6044, 0xc0fc, 0x6046,
-	0x080c, 0xac28, 0x000e, 0x0804, 0x9333, 0x7e4a, 0x7e46, 0x012e,
+	0x6028, 0xc09c, 0x602a, 0x080c, 0xa888, 0x2011, 0x0003, 0x080c,
+	0xa1b1, 0x2011, 0x0002, 0x080c, 0xa1bb, 0x080c, 0xa07a, 0x080c,
+	0x86d5, 0x0036, 0x901e, 0x080c, 0xa0fa, 0x003e, 0x080c, 0xa8a4,
+	0x60e3, 0x0000, 0x080c, 0xe712, 0x080c, 0xe72d, 0x2009, 0x0004,
+	0x080c, 0x2a15, 0x080c, 0x292f, 0x2001, 0x1800, 0x2003, 0x0004,
+	0x2011, 0x0008, 0x080c, 0x2a63, 0x2011, 0x7331, 0x080c, 0x8729,
+	0x080c, 0x74e2, 0x0118, 0x9006, 0x080c, 0x2a29, 0x080c, 0x0bc3,
+	0x2001, 0x0001, 0x080c, 0x25b9, 0x012e, 0x00fe, 0x00ee, 0x00de,
+	0x00ce, 0x003e, 0x002e, 0x001e, 0x0005, 0x0026, 0x00e6, 0x2011,
+	0x733e, 0x2071, 0x1a02, 0x701c, 0x9206, 0x1118, 0x7018, 0x9005,
+	0x0110, 0x9085, 0x0001, 0x00ee, 0x002e, 0x0005, 0x6020, 0xd09c,
+	0x0005, 0x6800, 0x9084, 0xfffe, 0x9086, 0x00c0, 0x01b8, 0x2001,
+	0x00c0, 0x080c, 0x2a29, 0x0156, 0x20a9, 0x002d, 0x1d04, 0x73b6,
+	0x2091, 0x6000, 0x1f04, 0x73b6, 0x015e, 0x00d6, 0x2069, 0x1800,
+	0x689c, 0x8001, 0x0220, 0x0118, 0x689e, 0x00de, 0x0005, 0x689f,
+	0x0014, 0x68ec, 0xd0dc, 0x0dc8, 0x6800, 0x9086, 0x0001, 0x1da8,
+	0x080c, 0x8735, 0x0c90, 0x00c6, 0x00d6, 0x00e6, 0x2061, 0x0100,
+	0x2069, 0x0140, 0x2071, 0x1800, 0x080c, 0x77db, 0x2001, 0x196c,
+	0x2003, 0x0000, 0x9006, 0x709a, 0x60e2, 0x6886, 0x080c, 0x2688,
+	0x9006, 0x080c, 0x2a29, 0x080c, 0x5edf, 0x0026, 0x2011, 0xffff,
+	0x080c, 0x2a63, 0x002e, 0x602b, 0x182c, 0x00ee, 0x00de, 0x00ce,
+	0x0005, 0x00c6, 0x00d6, 0x00e6, 0x2061, 0x0100, 0x2069, 0x0140,
+	0x2071, 0x1800, 0x2001, 0x197c, 0x200c, 0x9186, 0x0000, 0x0158,
+	0x9186, 0x0001, 0x0158, 0x9186, 0x0002, 0x0158, 0x9186, 0x0003,
+	0x0158, 0x0804, 0x748c, 0x709b, 0x0022, 0x0040, 0x709b, 0x0021,
+	0x0028, 0x709b, 0x0023, 0x0010, 0x709b, 0x0024, 0x60e3, 0x0000,
+	0x6887, 0x0001, 0x2001, 0x0001, 0x080c, 0x2688, 0x080c, 0xa888,
+	0x0026, 0x080c, 0xab50, 0x002e, 0x080c, 0xa8a4, 0x7000, 0x908e,
+	0x0004, 0x0118, 0x602b, 0x0028, 0x0010, 0x602b, 0x0020, 0x0156,
+	0x0126, 0x2091, 0x8000, 0x20a9, 0x0005, 0x6024, 0xd0ac, 0x0150,
+	0x012e, 0x015e, 0x080c, 0xcf51, 0x0118, 0x9006, 0x080c, 0x2a53,
+	0x0804, 0x7498, 0x6800, 0x9084, 0x00a1, 0xc0bd, 0x6802, 0x080c,
+	0x2a0f, 0x6904, 0xd1d4, 0x1140, 0x2001, 0x0100, 0x080c, 0x2a29,
+	0x1f04, 0x743d, 0x080c, 0x751f, 0x012e, 0x015e, 0x080c, 0x74d9,
+	0x0170, 0x6044, 0x9005, 0x0130, 0x080c, 0x751f, 0x9006, 0x8001,
+	0x1df0, 0x0028, 0x6804, 0xd0d4, 0x1110, 0x080c, 0x751f, 0x080c,
+	0xcf51, 0x0118, 0x9006, 0x080c, 0x2a53, 0x0016, 0x0026, 0x7000,
+	0x908e, 0x0004, 0x0130, 0x2009, 0x00c8, 0x2011, 0x733e, 0x080c,
+	0x86e7, 0x002e, 0x001e, 0x080c, 0x8529, 0x7034, 0xc085, 0x7036,
+	0x2001, 0x197c, 0x2003, 0x0004, 0x080c, 0x7193, 0x080c, 0x74d9,
+	0x0138, 0x6804, 0xd0d4, 0x1120, 0xd0dc, 0x1100, 0x080c, 0x77d1,
+	0x00ee, 0x00de, 0x00ce, 0x0005, 0x00c6, 0x00d6, 0x00e6, 0x2061,
+	0x0100, 0x2069, 0x0140, 0x2071, 0x1800, 0x080c, 0x8540, 0x080c,
+	0x8532, 0x080c, 0x77db, 0x2001, 0x196c, 0x2003, 0x0000, 0x9006,
+	0x709a, 0x60e2, 0x6886, 0x080c, 0x2688, 0x9006, 0x080c, 0x2a29,
+	0x6043, 0x0090, 0x6043, 0x0010, 0x0026, 0x2011, 0xffff, 0x080c,
+	0x2a63, 0x002e, 0x602b, 0x182c, 0x00ee, 0x00de, 0x00ce, 0x0005,
+	0x0006, 0x2001, 0x197b, 0x2004, 0x9086, 0xaaaa, 0x000e, 0x0005,
+	0x0006, 0x080c, 0x56d9, 0x9084, 0x0030, 0x9086, 0x0000, 0x000e,
+	0x0005, 0x0006, 0x080c, 0x56d9, 0x9084, 0x0030, 0x9086, 0x0030,
+	0x000e, 0x0005, 0x0006, 0x080c, 0x56d9, 0x9084, 0x0030, 0x9086,
+	0x0010, 0x000e, 0x0005, 0x0006, 0x080c, 0x56d9, 0x9084, 0x0030,
+	0x9086, 0x0020, 0x000e, 0x0005, 0x0036, 0x0016, 0x2001, 0x180c,
+	0x2004, 0x908c, 0x0013, 0x0180, 0x0020, 0x080c, 0x26a8, 0x900e,
+	0x0028, 0x080c, 0x6a62, 0x1dc8, 0x2009, 0x0002, 0x2019, 0x0028,
+	0x080c, 0x31b4, 0x9006, 0x0019, 0x001e, 0x003e, 0x0005, 0x00e6,
+	0x2071, 0x180c, 0x2e04, 0x0130, 0x080c, 0xcf4a, 0x1128, 0x9085,
+	0x0010, 0x0010, 0x9084, 0xffef, 0x2072, 0x00ee, 0x0005, 0x6050,
+	0x0006, 0x60ec, 0x0006, 0x600c, 0x0006, 0x6004, 0x0006, 0x6028,
+	0x0006, 0x602f, 0x0100, 0x602f, 0x0000, 0x602f, 0x0040, 0x602f,
+	0x0000, 0x20a9, 0x0002, 0x080c, 0x29f0, 0x0026, 0x2011, 0x0040,
+	0x080c, 0x2a63, 0x002e, 0x000e, 0x602a, 0x000e, 0x6006, 0x000e,
+	0x600e, 0x000e, 0x60ee, 0x60e3, 0x0000, 0x6887, 0x0001, 0x2001,
+	0x0001, 0x080c, 0x2688, 0x2001, 0x00a0, 0x0006, 0x080c, 0xcf51,
+	0x000e, 0x0130, 0x080c, 0x2a47, 0x9006, 0x080c, 0x2a53, 0x0010,
+	0x080c, 0x2a29, 0x000e, 0x6052, 0x6050, 0x0006, 0xc0e5, 0x6052,
+	0x00f6, 0x2079, 0x0100, 0x080c, 0x29a0, 0x00fe, 0x000e, 0x6052,
+	0x0005, 0x0156, 0x0016, 0x0026, 0x0036, 0x00c6, 0x00d6, 0x00e6,
+	0x2061, 0x0100, 0x2069, 0x0140, 0x2071, 0x1800, 0x080c, 0xa8e6,
+	0x0158, 0x2001, 0x0386, 0x2004, 0xd0b4, 0x1130, 0x2001, 0x0016,
+	0x080c, 0xa879, 0x0804, 0x75fc, 0x2001, 0x180c, 0x200c, 0xc1c4,
+	0x2102, 0x6028, 0x9084, 0xe1ff, 0x602a, 0x2011, 0x0200, 0x080c,
+	0x2a63, 0x2001, 0x0090, 0x080c, 0x2a29, 0x20a9, 0x0366, 0x6024,
+	0xd0cc, 0x1558, 0x1d04, 0x7597, 0x2091, 0x6000, 0x1f04, 0x7597,
+	0x080c, 0xa888, 0x2011, 0x0003, 0x080c, 0xa1b1, 0x2011, 0x0002,
+	0x080c, 0xa1bb, 0x080c, 0xa07a, 0x901e, 0x080c, 0xa0fa, 0x2001,
+	0x0386, 0x2003, 0x7000, 0x080c, 0xa8a4, 0x2001, 0x00a0, 0x080c,
+	0x2a29, 0x080c, 0x77cc, 0x080c, 0x6024, 0x080c, 0xcf51, 0x0110,
+	0x080c, 0x0ce9, 0x9085, 0x0001, 0x04e8, 0x2001, 0x0386, 0x2004,
+	0xd0ac, 0x0110, 0x080c, 0x1aec, 0x60e3, 0x0000, 0x2001, 0x196c,
+	0x2004, 0x080c, 0x2688, 0x60e2, 0x2001, 0x0080, 0x080c, 0x2a29,
+	0x20a9, 0x0366, 0x2011, 0x1e00, 0x080c, 0x2a63, 0x2009, 0x1e00,
+	0x080c, 0x2a0f, 0x6024, 0x910c, 0x0140, 0x1d04, 0x75da, 0x2091,
+	0x6000, 0x1f04, 0x75da, 0x0804, 0x75a0, 0x2001, 0x0386, 0x2003,
+	0x7000, 0x6028, 0x9085, 0x1e00, 0x602a, 0x70b4, 0x9005, 0x1118,
+	0x6887, 0x0001, 0x0008, 0x6886, 0x080c, 0xcf51, 0x0110, 0x080c,
+	0x0ce9, 0x9006, 0x00ee, 0x00de, 0x00ce, 0x003e, 0x002e, 0x001e,
+	0x015e, 0x0005, 0x0156, 0x0016, 0x0026, 0x0036, 0x00c6, 0x00d6,
+	0x00e6, 0x2061, 0x0100, 0x2071, 0x1800, 0x7000, 0x9086, 0x0003,
+	0x1168, 0x2001, 0x020b, 0x2004, 0x9084, 0x5540, 0x9086, 0x5540,
+	0x1128, 0x2069, 0x1a76, 0x2d04, 0x8000, 0x206a, 0x2069, 0x0140,
+	0x6020, 0x9084, 0x00c0, 0x0120, 0x6884, 0x9005, 0x1904, 0x7673,
+	0x2001, 0x0088, 0x080c, 0x2a29, 0x9006, 0x60e2, 0x6886, 0x080c,
+	0x2688, 0x2069, 0x0200, 0x6804, 0x9005, 0x1118, 0x6808, 0x9005,
+	0x01d0, 0x6028, 0x9084, 0xfbff, 0x602a, 0x2011, 0x0400, 0x080c,
+	0x2a63, 0x2069, 0x198e, 0x7000, 0x206a, 0x709b, 0x0026, 0x7003,
+	0x0001, 0x20a9, 0x0002, 0x1d04, 0x7653, 0x2091, 0x6000, 0x1f04,
+	0x7653, 0x0804, 0x76a5, 0x2069, 0x0140, 0x20a9, 0x0384, 0x2011,
+	0x1e00, 0x080c, 0x2a63, 0x2009, 0x1e00, 0x080c, 0x2a0f, 0x6024,
+	0x910c, 0x0528, 0x9084, 0x1a00, 0x1510, 0x1d04, 0x765f, 0x2091,
+	0x6000, 0x1f04, 0x765f, 0x080c, 0xa888, 0x2011, 0x0003, 0x080c,
+	0xa1b1, 0x2011, 0x0002, 0x080c, 0xa1bb, 0x080c, 0xa07a, 0x901e,
+	0x080c, 0xa0fa, 0x080c, 0xa8a4, 0x2001, 0x00a0, 0x080c, 0x2a29,
+	0x080c, 0x77cc, 0x080c, 0x6024, 0x9085, 0x0001, 0x00b0, 0x2001,
+	0x0080, 0x080c, 0x2a29, 0x2069, 0x0140, 0x60e3, 0x0000, 0x70b4,
+	0x9005, 0x1118, 0x6887, 0x0001, 0x0008, 0x6886, 0x2001, 0x196c,
+	0x2004, 0x080c, 0x2688, 0x60e2, 0x9006, 0x00ee, 0x00de, 0x00ce,
+	0x003e, 0x002e, 0x001e, 0x015e, 0x0005, 0x0156, 0x0016, 0x0026,
+	0x0036, 0x00c6, 0x00d6, 0x00e6, 0x2061, 0x0100, 0x2071, 0x1800,
+	0x6020, 0x9084, 0x00c0, 0x01e8, 0x080c, 0xa888, 0x2011, 0x0003,
+	0x080c, 0xa1b1, 0x2011, 0x0002, 0x080c, 0xa1bb, 0x080c, 0xa07a,
+	0x901e, 0x080c, 0xa0fa, 0x080c, 0xa8a4, 0x2069, 0x0140, 0x2001,
+	0x00a0, 0x080c, 0x2a29, 0x080c, 0x77cc, 0x080c, 0x6024, 0x0804,
+	0x7748, 0x2001, 0x180c, 0x200c, 0xd1b4, 0x1160, 0xc1b5, 0x2102,
+	0x080c, 0x7326, 0x2069, 0x0140, 0x2001, 0x0080, 0x080c, 0x2a29,
+	0x60e3, 0x0000, 0x2069, 0x0200, 0x6804, 0x9005, 0x1118, 0x6808,
+	0x9005, 0x0190, 0x6028, 0x9084, 0xfdff, 0x602a, 0x2011, 0x0200,
+	0x080c, 0x2a63, 0x2069, 0x198e, 0x7000, 0x206a, 0x709b, 0x0027,
+	0x7003, 0x0001, 0x0804, 0x7748, 0x2011, 0x1e00, 0x080c, 0x2a63,
+	0x2009, 0x1e00, 0x080c, 0x2a0f, 0x6024, 0x910c, 0x01c8, 0x9084,
+	0x1c00, 0x11b0, 0x1d04, 0x7704, 0x0006, 0x0016, 0x00c6, 0x00d6,
+	0x00e6, 0x080c, 0x8571, 0x00ee, 0x00de, 0x00ce, 0x001e, 0x000e,
+	0x00e6, 0x2071, 0x1a02, 0x7018, 0x00ee, 0x9005, 0x19e8, 0x0500,
+	0x0026, 0x2011, 0x733e, 0x080c, 0x861d, 0x2011, 0x7331, 0x080c,
+	0x8729, 0x002e, 0x2069, 0x0140, 0x60e3, 0x0000, 0x70b4, 0x9005,
+	0x1118, 0x6887, 0x0001, 0x0008, 0x6886, 0x2001, 0x196c, 0x2004,
+	0x080c, 0x2688, 0x60e2, 0x2001, 0x180c, 0x200c, 0xc1b4, 0x2102,
+	0x00ee, 0x00de, 0x00ce, 0x003e, 0x002e, 0x001e, 0x015e, 0x0005,
+	0x0156, 0x0016, 0x0026, 0x0036, 0x0046, 0x00c6, 0x00e6, 0x2061,
+	0x0100, 0x2071, 0x1800, 0x080c, 0xcf4a, 0x1904, 0x77b6, 0x7130,
+	0xd184, 0x1170, 0x080c, 0x335c, 0x0138, 0xc18d, 0x7132, 0x2011,
+	0x1848, 0x2214, 0xd2ac, 0x1120, 0x7030, 0xd08c, 0x0904, 0x77b6,
+	0x2011, 0x1848, 0x220c, 0xd1a4, 0x0538, 0x0016, 0x2019, 0x000e,
+	0x080c, 0xe249, 0x0156, 0x00b6, 0x20a9, 0x007f, 0x900e, 0x9186,
+	0x007e, 0x01a0, 0x9186, 0x0080, 0x0188, 0x080c, 0x6620, 0x1170,
+	0x2120, 0x9006, 0x0016, 0x2009, 0x000e, 0x080c, 0xe2d9, 0x2009,
+	0x0001, 0x2011, 0x0100, 0x080c, 0x88ce, 0x001e, 0x8108, 0x1f04,
+	0x777f, 0x00be, 0x015e, 0x001e, 0xd1ac, 0x1148, 0x0016, 0x2009,
+	0x0002, 0x2019, 0x0004, 0x080c, 0x31b4, 0x001e, 0x0078, 0x0156,
+	0x00b6, 0x20a9, 0x007f, 0x900e, 0x080c, 0x6620, 0x1110, 0x080c,
+	0x603e, 0x8108, 0x1f04, 0x77ac, 0x00be, 0x015e, 0x080c, 0x1aec,
+	0x080c, 0xa888, 0x080c, 0xab50, 0x080c, 0xa8a4, 0x60e3, 0x0000,
+	0x080c, 0x6024, 0x080c, 0x73f9, 0x00ee, 0x00ce, 0x004e, 0x003e,
+	0x002e, 0x001e, 0x015e, 0x0005, 0x2001, 0x197c, 0x2003, 0x0001,
+	0x0005, 0x2001, 0x197c, 0x2003, 0x0000, 0x0005, 0x2001, 0x197b,
+	0x2003, 0xaaaa, 0x0005, 0x2001, 0x197b, 0x2003, 0x0000, 0x0005,
+	0x2071, 0x18fa, 0x7003, 0x0000, 0x7007, 0x0000, 0x080c, 0x1053,
+	0x090c, 0x0d7d, 0xa8ab, 0xdcb0, 0x2900, 0x704e, 0x080c, 0x1053,
+	0x090c, 0x0d7d, 0xa8ab, 0xdcb0, 0x2900, 0x7052, 0xa867, 0x0000,
+	0xa86b, 0x0001, 0xa89f, 0x0000, 0x0005, 0x00e6, 0x2071, 0x0040,
+	0x6848, 0x9005, 0x1118, 0x9085, 0x0001, 0x04b0, 0x6840, 0x9005,
+	0x0150, 0x04a1, 0x6a50, 0x9200, 0x7002, 0x6854, 0x9101, 0x7006,
+	0x9006, 0x7012, 0x7016, 0x6850, 0x7002, 0x6854, 0x7006, 0x6858,
+	0x700a, 0x685c, 0x700e, 0x6840, 0x9005, 0x1110, 0x7012, 0x7016,
+	0x6848, 0x701a, 0x701c, 0x9085, 0x0040, 0x701e, 0x2001, 0x0019,
+	0x7036, 0x702b, 0x0001, 0x2001, 0x0004, 0x200c, 0x918c, 0xfff7,
+	0x918d, 0x8000, 0x2102, 0x00d6, 0x2069, 0x18fa, 0x6807, 0x0001,
+	0x00de, 0x080c, 0x7dc3, 0x9006, 0x00ee, 0x0005, 0x900e, 0x0156,
+	0x20a9, 0x0006, 0x8003, 0x818d, 0x1f04, 0x7842, 0x015e, 0x0005,
+	0x2079, 0x0040, 0x2071, 0x18fa, 0x7004, 0x0002, 0x7858, 0x7859,
+	0x78a4, 0x78ff, 0x7a0f, 0x7856, 0x7856, 0x7a39, 0x080c, 0x0d7d,
+	0x0005, 0x2079, 0x0040, 0x2001, 0x1dc0, 0x2003, 0x0000, 0x782c,
+	0x908c, 0x0780, 0x190c, 0x7ea5, 0xd0a4, 0x0570, 0x2001, 0x1dc0,
+	0x2004, 0x9082, 0x0080, 0x1640, 0x1d04, 0x7876, 0x2001, 0x1a05,
+	0x200c, 0x8109, 0x0508, 0x2091, 0x6000, 0x2102, 0x7824, 0x2048,
+	0x9006, 0xa802, 0xa806, 0xa864, 0x9084, 0x00ff, 0x908a, 0x0040,
+	0x0608, 0x00b8, 0x2001, 0x1800, 0x200c, 0x9186, 0x0003, 0x1160,
+	0x7104, 0x9186, 0x0004, 0x0140, 0x9186, 0x0007, 0x0128, 0x9186,
+	0x0003, 0x1968, 0x080c, 0x78ff, 0x782c, 0xd09c, 0x090c, 0x7dc3,
+	0x0005, 0x9082, 0x005a, 0x1218, 0x2100, 0x003b, 0x0c18, 0x080c,
+	0x7935, 0x0c90, 0x00e3, 0x08f0, 0x0005, 0x7935, 0x7935, 0x7935,
+	0x7935, 0x7935, 0x7935, 0x7935, 0x7935, 0x7957, 0x7935, 0x7935,
+	0x7935, 0x7935, 0x7935, 0x7935, 0x7935, 0x7935, 0x7935, 0x7935,
+	0x7935, 0x7935, 0x7935, 0x7935, 0x7935, 0x7935, 0x7935, 0x7935,
+	0x7935, 0x7941, 0x7935, 0x7b2a, 0x7935, 0x7935, 0x7935, 0x7957,
+	0x7935, 0x7941, 0x7b6b, 0x7bac, 0x7bf3, 0x7c07, 0x7935, 0x7935,
+	0x7957, 0x7941, 0x796b, 0x7935, 0x79e3, 0x7cb2, 0x7ccd, 0x7935,
+	0x7957, 0x7935, 0x796b, 0x7935, 0x7935, 0x79d9, 0x7ccd, 0x7935,
+	0x7935, 0x7935, 0x7935, 0x7935, 0x7935, 0x7935, 0x7935, 0x7935,
+	0x797f, 0x7935, 0x7935, 0x7935, 0x7935, 0x7935, 0x7935, 0x7935,
+	0x7935, 0x7935, 0x7e49, 0x7935, 0x7df3, 0x7935, 0x7df3, 0x7935,
+	0x7994, 0x7935, 0x7935, 0x7935, 0x7935, 0x7935, 0x7935, 0x2079,
+	0x0040, 0x7004, 0x9086, 0x0003, 0x1198, 0x782c, 0x080c, 0x7dec,
+	0xd0a4, 0x0170, 0x7824, 0x2048, 0x9006, 0xa802, 0xa806, 0xa864,
+	0x9084, 0x00ff, 0x908a, 0x001a, 0x1210, 0x002b, 0x0c50, 0x00e9,
+	0x080c, 0x7dc3, 0x0005, 0x7935, 0x7941, 0x7b16, 0x7935, 0x7941,
+	0x7935, 0x7941, 0x7941, 0x7935, 0x7941, 0x7b16, 0x7941, 0x7941,
+	0x7941, 0x7941, 0x7941, 0x7935, 0x7941, 0x7b16, 0x7935, 0x7935,
+	0x7941, 0x7935, 0x7935, 0x7935, 0x7941, 0x00e6, 0x2071, 0x18fa,
+	0x2009, 0x0400, 0x0071, 0x00ee, 0x0005, 0x2009, 0x1000, 0x0049,
+	0x0005, 0x2009, 0x2000, 0x0029, 0x0005, 0x2009, 0x0800, 0x0009,
+	0x0005, 0x7007, 0x0001, 0xa868, 0x9084, 0x00ff, 0x9105, 0xa86a,
+	0x0126, 0x2091, 0x8000, 0x080c, 0x6d7b, 0x012e, 0x0005, 0xa864,
+	0x8007, 0x9084, 0x00ff, 0x0d08, 0x8001, 0x1120, 0x7007, 0x0001,
+	0x0804, 0x7ab8, 0x7007, 0x0003, 0x7012, 0x2900, 0x7016, 0x701a,
+	0x704b, 0x7ab8, 0x0005, 0xa864, 0x8007, 0x9084, 0x00ff, 0x0968,
+	0x8001, 0x1120, 0x7007, 0x0001, 0x0804, 0x7ad3, 0x7007, 0x0003,
+	0x7012, 0x2900, 0x7016, 0x701a, 0x704b, 0x7ad3, 0x0005, 0xa864,
+	0x8007, 0x9084, 0x00ff, 0x0904, 0x793d, 0x8001, 0x1120, 0x7007,
+	0x0001, 0x0804, 0x7aef, 0x7007, 0x0003, 0x7012, 0x2900, 0x7016,
+	0x701a, 0x704b, 0x7aef, 0x0005, 0xa864, 0x8007, 0x9084, 0x00ff,
+	0x9086, 0x0001, 0x1904, 0x793d, 0x7007, 0x0001, 0x2009, 0x1834,
+	0x210c, 0x81ff, 0x11a8, 0xa868, 0x9084, 0x00ff, 0xa86a, 0xa883,
+	0x0000, 0x080c, 0x62b4, 0x1108, 0x0005, 0x0126, 0x2091, 0x8000,
+	0xa867, 0x0139, 0xa87a, 0xa982, 0x080c, 0x6d7b, 0x012e, 0x0ca0,
+	0xa994, 0x9186, 0x0071, 0x0d38, 0x9186, 0x0064, 0x0d20, 0x9186,
+	0x007c, 0x0d08, 0x9186, 0x0028, 0x09f0, 0x9186, 0x0038, 0x09d8,
+	0x9186, 0x0078, 0x09c0, 0x9186, 0x005f, 0x09a8, 0x9186, 0x0056,
+	0x0990, 0xa897, 0x4005, 0xa89b, 0x0001, 0x2001, 0x0030, 0x900e,
+	0x08a0, 0xa87c, 0x9084, 0x00c0, 0x9086, 0x00c0, 0x1120, 0x7007,
+	0x0001, 0x0804, 0x7ce4, 0x2900, 0x7016, 0x701a, 0x20a9, 0x0004,
+	0xa860, 0x20e0, 0xa85c, 0x9080, 0x0030, 0x2098, 0x7050, 0x2040,
+	0xa060, 0x20e8, 0xa05c, 0x9080, 0x0023, 0x20a0, 0x4003, 0xa888,
+	0x7012, 0x9082, 0x0401, 0x1a04, 0x7945, 0xaab4, 0x928a, 0x0002,
+	0x1a04, 0x7945, 0x82ff, 0x1138, 0xa8b8, 0xa9bc, 0x9105, 0x0118,
+	0x2001, 0x7a76, 0x0018, 0x9280, 0x7a6c, 0x2005, 0x7056, 0x7010,
+	0x9015, 0x0904, 0x7a57, 0x080c, 0x1053, 0x1118, 0x7007, 0x0004,
+	0x0005, 0x2900, 0x7022, 0x7054, 0x2060, 0xe000, 0xa866, 0x7050,
+	0x2040, 0xa95c, 0xe004, 0x9100, 0xa076, 0xa860, 0xa072, 0xe008,
+	0x920a, 0x1210, 0x900e, 0x2200, 0x7112, 0xe20c, 0x8003, 0x800b,
+	0x9296, 0x0004, 0x0108, 0x9108, 0xa17a, 0x810b, 0xa17e, 0x080c,
+	0x112f, 0xa06c, 0x908e, 0x0100, 0x0170, 0x9086, 0x0200, 0x0118,
+	0x7007, 0x0007, 0x0005, 0x7020, 0x2048, 0x080c, 0x106c, 0x7014,
+	0x2048, 0x0804, 0x7945, 0x7020, 0x2048, 0x7018, 0xa802, 0xa807,
+	0x0000, 0x2908, 0x2048, 0xa906, 0x711a, 0x0804, 0x7a0f, 0x7014,
+	0x2048, 0x7007, 0x0001, 0xa8b4, 0x9005, 0x1128, 0xa8b8, 0xa9bc,
+	0x9105, 0x0108, 0x00b9, 0xa864, 0x9084, 0x00ff, 0x9086, 0x001e,
+	0x0904, 0x7ce4, 0x0804, 0x7ab8, 0x7a6e, 0x7a72, 0x0002, 0x001d,
+	0x0007, 0x0004, 0x000a, 0x001b, 0x0005, 0x0006, 0x000a, 0x001d,
+	0x0005, 0x0004, 0x0076, 0x0066, 0xafb8, 0xaebc, 0xa804, 0x2050,
+	0xb0c0, 0xb0e2, 0xb0bc, 0xb0de, 0xb0b8, 0xb0d2, 0xb0b4, 0xb0ce,
+	0xb6da, 0xb7d6, 0xb0b0, 0xb0ca, 0xb0ac, 0xb0c6, 0xb0a8, 0xb0ba,
+	0xb0a4, 0xb0b6, 0xb6c2, 0xb7be, 0xb0a0, 0xb0b2, 0xb09c, 0xb0ae,
+	0xb098, 0xb0a2, 0xb094, 0xb09e, 0xb6aa, 0xb7a6, 0xb090, 0xb09a,
+	0xb08c, 0xb096, 0xb088, 0xb08a, 0xb084, 0xb086, 0xb692, 0xb78e,
+	0xb080, 0xb082, 0xb07c, 0xb07e, 0xb078, 0xb072, 0xb074, 0xb06e,
+	0xb67a, 0xb776, 0xb004, 0x9055, 0x1958, 0x006e, 0x007e, 0x0005,
+	0x2009, 0x1834, 0x210c, 0x81ff, 0x1178, 0x080c, 0x60b6, 0x1108,
+	0x0005, 0x080c, 0x6faf, 0x0126, 0x2091, 0x8000, 0x080c, 0xcb35,
+	0x080c, 0x6d7b, 0x012e, 0x0ca0, 0x080c, 0xcf4a, 0x1d70, 0x2001,
+	0x0028, 0x900e, 0x0c70, 0x2009, 0x1834, 0x210c, 0x81ff, 0x1188,
+	0xa888, 0x9005, 0x0188, 0xa883, 0x0000, 0x080c, 0x6144, 0x1108,
+	0x0005, 0xa87a, 0x0126, 0x2091, 0x8000, 0x080c, 0x6d7b, 0x012e,
+	0x0cb8, 0x2001, 0x0028, 0x0ca8, 0x2001, 0x0000, 0x0c90, 0x2009,
+	0x1834, 0x210c, 0x81ff, 0x11d8, 0xa888, 0x9005, 0x01e0, 0xa883,
+	0x0000, 0xa87c, 0xd0f4, 0x0120, 0x080c, 0x6216, 0x1138, 0x0005,
+	0x9006, 0xa87a, 0x080c, 0x6191, 0x1108, 0x0005, 0x0126, 0x2091,
+	0x8000, 0xa87a, 0xa982, 0x080c, 0x6d7b, 0x012e, 0x0cb0, 0x2001,
+	0x0028, 0x900e, 0x0c98, 0x2001, 0x0000, 0x0c80, 0x7018, 0xa802,
+	0x2908, 0x2048, 0xa906, 0x711a, 0x7010, 0x8001, 0x7012, 0x0118,
+	0x7007, 0x0003, 0x0030, 0x7014, 0x2048, 0x7007, 0x0001, 0x7048,
+	0x080f, 0x0005, 0x00b6, 0x7007, 0x0001, 0xa974, 0xa878, 0x9084,
+	0x00ff, 0x9096, 0x0004, 0x0540, 0x20a9, 0x0001, 0x9096, 0x0001,
+	0x0190, 0x900e, 0x20a9, 0x0800, 0x9096, 0x0002, 0x0160, 0x9005,
+	0x11d8, 0xa974, 0x080c, 0x6620, 0x11b8, 0x0066, 0xae80, 0x080c,
+	0x6730, 0x006e, 0x0088, 0x0046, 0x2011, 0x180c, 0x2224, 0xc484,
+	0x2412, 0x004e, 0x00c6, 0x080c, 0x6620, 0x1110, 0x080c, 0x6903,
+	0x8108, 0x1f04, 0x7b53, 0x00ce, 0xa87c, 0xd084, 0x1120, 0x080c,
+	0x106c, 0x00be, 0x0005, 0x0126, 0x2091, 0x8000, 0x080c, 0x6d7b,
+	0x012e, 0x00be, 0x0005, 0x0126, 0x2091, 0x8000, 0x7007, 0x0001,
+	0x080c, 0x6a66, 0x0580, 0x2061, 0x1a6e, 0x6100, 0xd184, 0x0178,
+	0xa888, 0x9084, 0x00ff, 0x1550, 0x6000, 0xd084, 0x0520, 0x6004,
+	0x9005, 0x1538, 0x6003, 0x0000, 0x600b, 0x0000, 0x00c8, 0x2011,
+	0x0001, 0xa890, 0x9005, 0x1110, 0x2001, 0x001e, 0x8000, 0x6016,
+	0xa888, 0x9084, 0x00ff, 0x0178, 0x6006, 0xa888, 0x8007, 0x9084,
+	0x00ff, 0x0148, 0x600a, 0xa888, 0x8000, 0x1108, 0xc28d, 0x6202,
+	0x012e, 0x0804, 0x7dad, 0x012e, 0x0804, 0x7da7, 0x012e, 0x0804,
+	0x7da1, 0x012e, 0x0804, 0x7da4, 0x0126, 0x2091, 0x8000, 0x7007,
+	0x0001, 0x080c, 0x6a66, 0x05e0, 0x2061, 0x1a6e, 0x6000, 0xd084,
+	0x05b8, 0x6204, 0x6308, 0xd08c, 0x1530, 0xac78, 0x9484, 0x0003,
+	0x0170, 0xa988, 0x918c, 0x00ff, 0x8001, 0x1120, 0x2100, 0x9210,
+	0x0620, 0x0028, 0x8001, 0x1508, 0x2100, 0x9212, 0x02f0, 0x9484,
+	0x000c, 0x0188, 0xa988, 0x810f, 0x918c, 0x00ff, 0x9082, 0x0004,
+	0x1120, 0x2100, 0x9318, 0x0288, 0x0030, 0x9082, 0x0004, 0x1168,
+	0x2100, 0x931a, 0x0250, 0xa890, 0x9005, 0x0110, 0x8000, 0x6016,
+	0x6206, 0x630a, 0x012e, 0x0804, 0x7dad, 0x012e, 0x0804, 0x7daa,
+	0x012e, 0x0804, 0x7da7, 0x0126, 0x2091, 0x8000, 0x7007, 0x0001,
+	0x2061, 0x1a6e, 0x6300, 0xd38c, 0x1120, 0x6308, 0x8318, 0x0220,
+	0x630a, 0x012e, 0x0804, 0x7dbb, 0x012e, 0x0804, 0x7daa, 0x00b6,
+	0x0126, 0x00c6, 0x2091, 0x8000, 0x7007, 0x0001, 0xa87c, 0xd0ac,
+	0x0148, 0x00c6, 0x2061, 0x1a6e, 0x6000, 0x9084, 0xfcff, 0x6002,
+	0x00ce, 0x0440, 0xa888, 0x9005, 0x05d8, 0xa88c, 0x9065, 0x0598,
+	0x2001, 0x1834, 0x2004, 0x9005, 0x0118, 0x080c, 0xac1a, 0x0068,
+	0x6017, 0xf400, 0x6063, 0x0000, 0xa97c, 0xd1a4, 0x0110, 0xa980,
+	0x6162, 0x2009, 0x0041, 0x080c, 0xac7c, 0xa988, 0x918c, 0xff00,
+	0x9186, 0x2000, 0x1138, 0x0026, 0x900e, 0x2011, 0xfdff, 0x080c,
+	0x88ce, 0x002e, 0xa87c, 0xd0c4, 0x0148, 0x2061, 0x1a6e, 0x6000,
+	0xd08c, 0x1120, 0x6008, 0x8000, 0x0208, 0x600a, 0x00ce, 0x012e,
+	0x00be, 0x0804, 0x7dad, 0x00ce, 0x012e, 0x00be, 0x0804, 0x7da7,
+	0xa984, 0x9186, 0x002e, 0x0d30, 0x9186, 0x002d, 0x0d18, 0x9186,
+	0x0045, 0x0510, 0x9186, 0x002a, 0x1130, 0x2001, 0x180c, 0x200c,
+	0xc194, 0x2102, 0x08b8, 0x9186, 0x0020, 0x0158, 0x9186, 0x0029,
+	0x1d10, 0xa974, 0x080c, 0x6620, 0x1968, 0xb800, 0xc0e4, 0xb802,
+	0x0848, 0xa88c, 0x9065, 0x09b8, 0x6007, 0x0024, 0x2001, 0x1985,
+	0x2004, 0x601a, 0x0804, 0x7c42, 0xa88c, 0x9065, 0x0960, 0x00e6,
+	0xa890, 0x9075, 0x2001, 0x1834, 0x2004, 0x9005, 0x0150, 0x080c,
+	0xac1a, 0x8eff, 0x0118, 0x2e60, 0x080c, 0xac1a, 0x00ee, 0x0804,
+	0x7c42, 0x6024, 0xc0dc, 0xc0d5, 0x6026, 0x2e60, 0x6007, 0x003a,
+	0xa8a0, 0x9005, 0x0130, 0x6007, 0x003b, 0xa8a4, 0x602e, 0xa8a8,
+	0x6016, 0x6003, 0x0001, 0x2009, 0x8020, 0x080c, 0x9200, 0x00ee,
+	0x0804, 0x7c42, 0x2061, 0x1a6e, 0x6000, 0xd084, 0x0190, 0xd08c,
+	0x1904, 0x7dbb, 0x0126, 0x2091, 0x8000, 0x6204, 0x8210, 0x0220,
+	0x6206, 0x012e, 0x0804, 0x7dbb, 0x012e, 0xa883, 0x0016, 0x0804,
+	0x7db4, 0xa883, 0x0007, 0x0804, 0x7db4, 0xa864, 0x8007, 0x9084,
+	0x00ff, 0x0130, 0x8001, 0x1138, 0x7007, 0x0001, 0x0069, 0x0005,
+	0x080c, 0x793d, 0x0040, 0x7007, 0x0003, 0x7012, 0x2900, 0x7016,
+	0x701a, 0x704b, 0x7ce4, 0x0005, 0x00b6, 0x00e6, 0x0126, 0x2091,
+	0x8000, 0x903e, 0x2061, 0x1800, 0x61d0, 0x81ff, 0x1904, 0x7d66,
+	0x6130, 0xd194, 0x1904, 0x7d90, 0xa878, 0x2070, 0x9e82, 0x1ddc,
+	0x0a04, 0x7d5a, 0x6068, 0x9e02, 0x1a04, 0x7d5a, 0x7120, 0x9186,
+	0x0006, 0x1904, 0x7d4c, 0x7010, 0x905d, 0x0904, 0x7d66, 0xb800,
+	0xd0e4, 0x1904, 0x7d8a, 0x2061, 0x1a6e, 0x6100, 0x9184, 0x0301,
+	0x9086, 0x0001, 0x15a0, 0x7024, 0xd0dc, 0x1904, 0x7d93, 0xa883,
+	0x0000, 0xa803, 0x0000, 0x2908, 0x7014, 0x9005, 0x1198, 0x7116,
+	0xa87c, 0xd0f4, 0x1904, 0x7d96, 0x080c, 0x56d5, 0xd09c, 0x1118,
+	0xa87c, 0xc0cc, 0xa87e, 0x2e60, 0x080c, 0x87be, 0x012e, 0x00ee,
+	0x00be, 0x0005, 0x2048, 0xa800, 0x9005, 0x1de0, 0xa902, 0x2148,
+	0xa87c, 0xd0f4, 0x1904, 0x7d96, 0x012e, 0x00ee, 0x00be, 0x0005,
+	0x012e, 0x00ee, 0xa883, 0x0006, 0x00be, 0x0804, 0x7db4, 0xd184,
+	0x0db8, 0xd1c4, 0x1190, 0x00a0, 0xa974, 0x080c, 0x6620, 0x15d0,
+	0xb800, 0xd0e4, 0x15b8, 0x7120, 0x9186, 0x0007, 0x1118, 0xa883,
+	0x0002, 0x0490, 0xa883, 0x0008, 0x0478, 0xa883, 0x000e, 0x0460,
+	0xa883, 0x0017, 0x0448, 0xa883, 0x0035, 0x0430, 0x080c, 0x56d9,
+	0xd0fc, 0x01e8, 0xa878, 0x2070, 0x9e82, 0x1ddc, 0x02c0, 0x6068,
+	0x9e02, 0x12a8, 0x7120, 0x9186, 0x0006, 0x1188, 0x7010, 0x905d,
+	0x0170, 0xb800, 0xd0bc, 0x0158, 0x2039, 0x0001, 0x7000, 0x9086,
+	0x0007, 0x1904, 0x7cf0, 0x7003, 0x0002, 0x0804, 0x7cf0, 0xa883,
+	0x0028, 0x0010, 0xa883, 0x0029, 0x012e, 0x00ee, 0x00be, 0x0420,
+	0xa883, 0x002a, 0x0cc8, 0xa883, 0x0045, 0x0cb0, 0x2e60, 0x2019,
+	0x0002, 0x601b, 0x0014, 0x080c, 0xde2a, 0x012e, 0x00ee, 0x00be,
+	0x0005, 0x2009, 0x003e, 0x0058, 0x2009, 0x0004, 0x0040, 0x2009,
+	0x0006, 0x0028, 0x2009, 0x0016, 0x0010, 0x2009, 0x0001, 0xa884,
+	0x9084, 0xff00, 0x9105, 0xa886, 0x0126, 0x2091, 0x8000, 0x080c,
+	0x6d7b, 0x012e, 0x0005, 0x080c, 0x106c, 0x0005, 0x00d6, 0x080c,
+	0x87b5, 0x00de, 0x0005, 0x00d6, 0x00e6, 0x0126, 0x2091, 0x8000,
+	0x2071, 0x0040, 0x702c, 0xd084, 0x01d8, 0x908c, 0x0780, 0x190c,
+	0x7ea5, 0xd09c, 0x11a8, 0x2071, 0x1800, 0x70c0, 0x90ea, 0x0020,
+	0x0278, 0x8001, 0x70c2, 0x702c, 0x2048, 0xa800, 0x702e, 0x9006,
+	0xa802, 0xa806, 0x2071, 0x0040, 0x2900, 0x7022, 0x702c, 0x0c28,
+	0x012e, 0x00ee, 0x00de, 0x0005, 0x0006, 0x9084, 0x0780, 0x190c,
+	0x7ea5, 0x000e, 0x0005, 0xa898, 0x9084, 0x0003, 0x05a8, 0x080c,
+	0xab89, 0x05d8, 0x2900, 0x6016, 0xa864, 0x9084, 0x00ff, 0x9086,
+	0x0035, 0x1138, 0x6028, 0xc0fd, 0x602a, 0x2001, 0x196a, 0x2004,
+	0x0098, 0xa8a0, 0x9084, 0x00ff, 0xa99c, 0x918c, 0xff00, 0x9105,
+	0xa99c, 0x918c, 0x00ff, 0x080c, 0x2614, 0x1540, 0x00b6, 0x080c,
+	0x6620, 0x2b00, 0x00be, 0x1510, 0x6012, 0x6023, 0x0001, 0x2009,
+	0x0040, 0xa864, 0x9084, 0x00ff, 0x9086, 0x0035, 0x0110, 0x2009,
+	0x0041, 0x080c, 0xac7c, 0x0005, 0xa87b, 0x0101, 0x0126, 0x2091,
+	0x8000, 0x080c, 0x6d7b, 0x012e, 0x0005, 0xa87b, 0x002c, 0x0126,
+	0x2091, 0x8000, 0x080c, 0x6d7b, 0x012e, 0x0005, 0xa87b, 0x0028,
+	0x0126, 0x2091, 0x8000, 0x080c, 0x6d7b, 0x012e, 0x080c, 0xabdf,
+	0x0005, 0x00d6, 0x00c6, 0x0036, 0x0026, 0x0016, 0x00b6, 0x7007,
+	0x0001, 0xaa74, 0x9282, 0x0004, 0x1a04, 0x7e96, 0xa97c, 0x9188,
+	0x1000, 0x2104, 0x905d, 0xb804, 0xd284, 0x0140, 0x05e8, 0x8007,
+	0x9084, 0x00ff, 0x9084, 0x0006, 0x1108, 0x04b0, 0x2b10, 0x080c,
+	0xab89, 0x1118, 0x080c, 0xac4f, 0x05a8, 0x6212, 0xa874, 0x0002,
+	0x7e74, 0x7e79, 0x7e7c, 0x7e82, 0x2019, 0x0002, 0x080c, 0xe249,
+	0x0060, 0x080c, 0xe1d9, 0x0048, 0x2019, 0x0002, 0xa980, 0x080c,
+	0xe1f8, 0x0018, 0xa980, 0x080c, 0xe1d9, 0x080c, 0xabdf, 0xa887,
+	0x0000, 0x0126, 0x2091, 0x8000, 0x080c, 0x6d7b, 0x012e, 0x00be,
+	0x001e, 0x002e, 0x003e, 0x00ce, 0x00de, 0x0005, 0xa887, 0x0006,
+	0x0c80, 0xa887, 0x0002, 0x0c68, 0xa887, 0x0005, 0x0c50, 0xa887,
+	0x0004, 0x0c38, 0xa887, 0x0007, 0x0c20, 0x2091, 0x8000, 0x0e04,
+	0x7ea7, 0x0006, 0x0016, 0x2001, 0x8003, 0x0006, 0x0804, 0x0d86,
+	0x2001, 0x1834, 0x2004, 0x9005, 0x0005, 0x0005, 0x00f6, 0x2079,
+	0x0300, 0x2001, 0x0200, 0x200c, 0xc1e5, 0xc1dc, 0x2102, 0x2009,
+	0x0218, 0x210c, 0xd1ec, 0x1120, 0x080c, 0x1615, 0x00fe, 0x0005,
+	0x2001, 0x020d, 0x2003, 0x0020, 0x781f, 0x0300, 0x00fe, 0x0005,
+	0x781c, 0xd08c, 0x0904, 0x7f28, 0x68c0, 0x90aa, 0x0005, 0x0a04,
+	0x8529, 0x7d44, 0x7c40, 0xd59c, 0x190c, 0x0d7d, 0x9584, 0x00f6,
+	0x1508, 0x9484, 0x7000, 0x0138, 0x908a, 0x2000, 0x1258, 0x9584,
+	0x0700, 0x8007, 0x04f0, 0x7000, 0x9084, 0xff00, 0x9086, 0x8100,
+	0x0db0, 0x00b0, 0x9484, 0x0fff, 0x1130, 0x7000, 0x9084, 0xff00,
+	0x9086, 0x8100, 0x11c0, 0x080c, 0xe6ea, 0x080c, 0x8420, 0x7817,
+	0x0140, 0x00a8, 0x9584, 0x0076, 0x1118, 0x080c, 0x847c, 0x19c8,
+	0xd5a4, 0x0148, 0x0046, 0x0056, 0x080c, 0x7f78, 0x080c, 0x2126,
+	0x005e, 0x004e, 0x0020, 0x080c, 0xe6ea, 0x7817, 0x0140, 0x080c,
+	0x74c8, 0x0168, 0x2001, 0x0111, 0x2004, 0xd08c, 0x0140, 0x6893,
+	0x0000, 0x2001, 0x0110, 0x2003, 0x0008, 0x2003, 0x0000, 0x0489,
+	0x0005, 0x0002, 0x7f35, 0x8242, 0x7f32, 0x7f32, 0x7f32, 0x7f32,
+	0x7f32, 0x7f32, 0x7817, 0x0140, 0x0005, 0x7000, 0x908c, 0xff00,
+	0x9194, 0xf000, 0x810f, 0x9484, 0x0fff, 0x6892, 0x9286, 0x2000,
+	0x1150, 0x6800, 0x9086, 0x0001, 0x1118, 0x080c, 0x5736, 0x0070,
+	0x080c, 0x7f98, 0x0058, 0x9286, 0x3000, 0x1118, 0x080c, 0x817f,
+	0x0028, 0x9286, 0x8000, 0x1110, 0x080c, 0x8356, 0x7817, 0x0140,
+	0x0005, 0x2001, 0x1810, 0x2004, 0xd08c, 0x0178, 0x2001, 0x1800,
+	0x2004, 0x9086, 0x0003, 0x1148, 0x0026, 0x0036, 0x2011, 0x8048,
+	0x2518, 0x080c, 0x4b09, 0x003e, 0x002e, 0x0005, 0x0036, 0x0046,
+	0x0056, 0x00f6, 0x2079, 0x0200, 0x2019, 0xfffe, 0x7c30, 0x0050,
+	0x0036, 0x0046, 0x0056, 0x00f6, 0x2079, 0x0200, 0x7d44, 0x7c40,
+	0x2019, 0xffff, 0x2001, 0x1810, 0x2004, 0xd08c, 0x0160, 0x2001,
+	0x1800, 0x2004, 0x9086, 0x0003, 0x1130, 0x0026, 0x2011, 0x8048,
+	0x080c, 0x4b09, 0x002e, 0x00fe, 0x005e, 0x004e, 0x003e, 0x0005,
+	0x00b6, 0x00c6, 0x7010, 0x9084, 0xff00, 0x8007, 0x9096, 0x0001,
+	0x0120, 0x9096, 0x0023, 0x1904, 0x8150, 0x9186, 0x0023, 0x15c0,
+	0x080c, 0x83eb, 0x0904, 0x8150, 0x6120, 0x9186, 0x0001, 0x0150,
+	0x9186, 0x0004, 0x0138, 0x9186, 0x0008, 0x0120, 0x9186, 0x000a,
+	0x1904, 0x8150, 0x7124, 0x610a, 0x7030, 0x908e, 0x0200, 0x1130,
+	0x2009, 0x0015, 0x080c, 0xac7c, 0x0804, 0x8150, 0x908e, 0x0214,
+	0x0118, 0x908e, 0x0210, 0x1130, 0x2009, 0x0015, 0x080c, 0xac7c,
+	0x0804, 0x8150, 0x908e, 0x0100, 0x1904, 0x8150, 0x7034, 0x9005,
+	0x1904, 0x8150, 0x2009, 0x0016, 0x080c, 0xac7c, 0x0804, 0x8150,
+	0x9186, 0x0022, 0x1904, 0x8150, 0x7030, 0x908e, 0x0300, 0x1580,
+	0x68dc, 0xd0a4, 0x0528, 0xc0b5, 0x68de, 0x7100, 0x918c, 0x00ff,
+	0x697e, 0x7004, 0x6882, 0x00f6, 0x2079, 0x0100, 0x79e6, 0x78ea,
+	0x0006, 0x9084, 0x00ff, 0x0016, 0x2008, 0x080c, 0x265d, 0x7932,
+	0x7936, 0x001e, 0x000e, 0x00fe, 0x080c, 0x2614, 0x695e, 0x703c,
+	0x00e6, 0x2071, 0x0140, 0x7086, 0x2071, 0x1800, 0x70b6, 0x00ee,
+	0x7034, 0x9005, 0x1904, 0x8150, 0x2009, 0x0017, 0x0804, 0x8100,
+	0x908e, 0x0400, 0x1190, 0x7034, 0x9005, 0x1904, 0x8150, 0x080c,
+	0x74c8, 0x0120, 0x2009, 0x001d, 0x0804, 0x8100, 0x68dc, 0xc0a5,
+	0x68de, 0x2009, 0x0030, 0x0804, 0x8100, 0x908e, 0x0500, 0x1140,
+	0x7034, 0x9005, 0x1904, 0x8150, 0x2009, 0x0018, 0x0804, 0x8100,
+	0x908e, 0x2010, 0x1120, 0x2009, 0x0019, 0x0804, 0x8100, 0x908e,
+	0x2110, 0x1120, 0x2009, 0x001a, 0x0804, 0x8100, 0x908e, 0x5200,
+	0x1140, 0x7034, 0x9005, 0x1904, 0x8150, 0x2009, 0x001b, 0x0804,
+	0x8100, 0x908e, 0x5000, 0x1140, 0x7034, 0x9005, 0x1904, 0x8150,
+	0x2009, 0x001c, 0x0804, 0x8100, 0x908e, 0x1300, 0x1120, 0x2009,
+	0x0034, 0x0804, 0x8100, 0x908e, 0x1200, 0x1140, 0x7034, 0x9005,
+	0x1904, 0x8150, 0x2009, 0x0024, 0x0804, 0x8100, 0x908c, 0xff00,
+	0x918e, 0x2400, 0x1170, 0x2009, 0x002d, 0x2001, 0x1810, 0x2004,
+	0xd09c, 0x0904, 0x8100, 0x080c, 0xd65c, 0x1904, 0x8150, 0x0804,
+	0x80fe, 0x908c, 0xff00, 0x918e, 0x5300, 0x1120, 0x2009, 0x002a,
+	0x0804, 0x8100, 0x908e, 0x0f00, 0x1120, 0x2009, 0x0020, 0x0804,
+	0x8100, 0x908e, 0x6104, 0x1530, 0x2029, 0x0205, 0x2011, 0x026d,
+	0x8208, 0x2204, 0x9082, 0x0004, 0x8004, 0x8004, 0x20a8, 0x2011,
+	0x8015, 0x211c, 0x8108, 0x0046, 0x2124, 0x080c, 0x4b09, 0x004e,
+	0x8108, 0x0f04, 0x80b4, 0x9186, 0x0280, 0x1d88, 0x2504, 0x8000,
+	0x202a, 0x2009, 0x0260, 0x0c58, 0x202b, 0x0000, 0x2009, 0x0023,
+	0x0804, 0x8100, 0x908e, 0x6000, 0x1120, 0x2009, 0x003f, 0x0804,
+	0x8100, 0x908e, 0x5400, 0x1138, 0x080c, 0x84d9, 0x1904, 0x8150,
+	0x2009, 0x0046, 0x04a8, 0x908e, 0x5500, 0x1148, 0x080c, 0x8501,
+	0x1118, 0x2009, 0x0041, 0x0460, 0x2009, 0x0042, 0x0448, 0x908e,
+	0x7800, 0x1118, 0x2009, 0x0045, 0x0418, 0x908e, 0x1000, 0x1118,
+	0x2009, 0x004e, 0x00e8, 0x908e, 0x6300, 0x1118, 0x2009, 0x004a,
+	0x00b8, 0x908c, 0xff00, 0x918e, 0x5600, 0x1118, 0x2009, 0x004f,
+	0x0078, 0x908c, 0xff00, 0x918e, 0x5700, 0x1118, 0x2009, 0x0050,
+	0x0038, 0x2009, 0x001d, 0x6838, 0xd0d4, 0x0110, 0x2009, 0x004c,
+	0x0016, 0x2011, 0x0263, 0x2204, 0x8211, 0x220c, 0x080c, 0x2614,
+	0x1904, 0x8153, 0x080c, 0x65bf, 0x1904, 0x8153, 0xbe12, 0xbd16,
+	0x001e, 0x0016, 0x080c, 0x74c8, 0x01c0, 0x68dc, 0xd08c, 0x1148,
+	0x7000, 0x9084, 0x00ff, 0x1188, 0x7004, 0x9084, 0xff00, 0x1168,
+	0x0040, 0x687c, 0x9606, 0x1148, 0x6880, 0x9506, 0x9084, 0xff00,
+	0x1120, 0x9584, 0x00ff, 0xb886, 0x0080, 0xb884, 0x9005, 0x1168,
+	0x9186, 0x0046, 0x1150, 0x687c, 0x9606, 0x1138, 0x6880, 0x9506,
+	0x9084, 0xff00, 0x1110, 0x001e, 0x0098, 0x080c, 0xab89, 0x01a8,
+	0x2b08, 0x6112, 0x6023, 0x0004, 0x7120, 0x610a, 0x001e, 0x9186,
+	0x004c, 0x1110, 0x6023, 0x000a, 0x0016, 0x001e, 0x080c, 0xac7c,
+	0x00ce, 0x00be, 0x0005, 0x001e, 0x0cd8, 0x2001, 0x180e, 0x2004,
+	0xd0ec, 0x0120, 0x2011, 0x8049, 0x080c, 0x4b09, 0x080c, 0xac4f,
+	0x0d90, 0x2b08, 0x6112, 0x6023, 0x0004, 0x7120, 0x610a, 0x001e,
+	0x0016, 0x9186, 0x0017, 0x0118, 0x9186, 0x0030, 0x1128, 0x6007,
+	0x0009, 0x6017, 0x2900, 0x0020, 0x6007, 0x0051, 0x6017, 0x0000,
+	0x602f, 0x0009, 0x6003, 0x0001, 0x080c, 0x9207, 0x08a0, 0x080c,
+	0x3326, 0x1140, 0x7010, 0x9084, 0xff00, 0x8007, 0x908e, 0x0008,
+	0x1108, 0x0009, 0x0005, 0x00b6, 0x00c6, 0x0046, 0x7000, 0x908c,
+	0xff00, 0x810f, 0x9186, 0x0033, 0x11e8, 0x080c, 0x83eb, 0x0904,
+	0x81da, 0x7124, 0x610a, 0x7030, 0x908e, 0x0200, 0x1140, 0x7034,
+	0x9005, 0x15c0, 0x2009, 0x0015, 0x080c, 0xac7c, 0x0498, 0x908e,
+	0x0100, 0x1580, 0x7034, 0x9005, 0x1568, 0x2009, 0x0016, 0x080c,
+	0xac7c, 0x0440, 0x9186, 0x0032, 0x1528, 0x7030, 0x908e, 0x1400,
+	0x1508, 0x2009, 0x0038, 0x0016, 0x2011, 0x0263, 0x2204, 0x8211,
+	0x220c, 0x080c, 0x2614, 0x11a8, 0x080c, 0x65bf, 0x1190, 0xbe12,
+	0xbd16, 0x080c, 0xab89, 0x0168, 0x2b08, 0x6112, 0x080c, 0xcccb,
+	0x6023, 0x0004, 0x7120, 0x610a, 0x001e, 0x080c, 0xac7c, 0x0010,
+	0x00ce, 0x001e, 0x004e, 0x00ce, 0x00be, 0x0005, 0x00b6, 0x0046,
+	0x00e6, 0x00d6, 0x2028, 0x2130, 0x9696, 0x00ff, 0x11b8, 0x9592,
+	0xfffc, 0x02a0, 0x9596, 0xfffd, 0x1120, 0x2009, 0x007f, 0x0804,
+	0x823c, 0x9596, 0xfffe, 0x1120, 0x2009, 0x007e, 0x0804, 0x823c,
+	0x9596, 0xfffc, 0x1118, 0x2009, 0x0080, 0x04f0, 0x2011, 0x0000,
+	0x2019, 0x1837, 0x231c, 0xd3ac, 0x0130, 0x9026, 0x20a9, 0x0800,
+	0x2071, 0x1000, 0x0030, 0x2021, 0x0081, 0x20a9, 0x077f, 0x2071,
+	0x1081, 0x2e1c, 0x93dd, 0x0000, 0x1140, 0x82ff, 0x11d0, 0x9496,
+	0x00ff, 0x01b8, 0x2410, 0xc2fd, 0x00a0, 0xbf10, 0x2600, 0x9706,
+	0xb814, 0x1120, 0x9546, 0x1110, 0x2408, 0x00b0, 0x9745, 0x1148,
+	0x94c6, 0x007e, 0x0130, 0x94c6, 0x007f, 0x0118, 0x94c6, 0x0080,
+	0x1d20, 0x8420, 0x8e70, 0x1f04, 0x8211, 0x82ff, 0x1118, 0x9085,
+	0x0001, 0x0018, 0xc2fc, 0x2208, 0x9006, 0x00de, 0x00ee, 0x004e,
+	0x00be, 0x0005, 0x7000, 0x908c, 0xff00, 0x810f, 0x9184, 0x000f,
+	0x0002, 0x8259, 0x8259, 0x8259, 0x83fd, 0x8259, 0x825c, 0x8281,
+	0x830a, 0x8259, 0x8259, 0x8259, 0x8259, 0x8259, 0x8259, 0x8259,
+	0x8259, 0x7817, 0x0140, 0x0005, 0x00b6, 0x7110, 0xd1bc, 0x01e8,
+	0x7120, 0x2160, 0x9c8c, 0x0003, 0x11c0, 0x9c8a, 0x1ddc, 0x02a8,
+	0x6868, 0x9c02, 0x1290, 0x7008, 0x9084, 0x00ff, 0x6110, 0x2158,
+	0xb910, 0x9106, 0x1150, 0x700c, 0xb914, 0x9106, 0x1130, 0x7124,
+	0x610a, 0x2009, 0x0046, 0x080c, 0xac7c, 0x7817, 0x0140, 0x00be,
+	0x0005, 0x00b6, 0x00c6, 0x9484, 0x0fff, 0x0904, 0x82e6, 0x7110,
+	0xd1bc, 0x1904, 0x82e6, 0x7108, 0x700c, 0x2028, 0x918c, 0x00ff,
+	0x2130, 0x9094, 0xff00, 0x15c8, 0x81ff, 0x15b8, 0x9080, 0x3368,
+	0x200d, 0x918c, 0xff00, 0x810f, 0x2001, 0x0080, 0x9106, 0x0904,
+	0x82e6, 0x9182, 0x0801, 0x1a04, 0x82e6, 0x9190, 0x1000, 0x2204,
+	0x905d, 0x05e0, 0xbe12, 0xbd16, 0xb800, 0xd0ec, 0x15b8, 0xba04,
+	0x9294, 0xff00, 0x9286, 0x0600, 0x1190, 0x080c, 0xab89, 0x0598,
+	0x2b08, 0x7028, 0x6052, 0x702c, 0x604e, 0x6112, 0x6023, 0x0006,
+	0x7120, 0x610a, 0x7130, 0x615e, 0x080c, 0xd8c4, 0x00f8, 0x080c,
+	0x6a6a, 0x1138, 0xb807, 0x0606, 0x0c40, 0x190c, 0x81de, 0x11b0,
+	0x0880, 0x080c, 0xab89, 0x2b08, 0x0188, 0x6112, 0x6023, 0x0004,
+	0x7120, 0x610a, 0x9286, 0x0400, 0x1118, 0x6007, 0x0005, 0x0010,
+	0x6007, 0x0001, 0x6003, 0x0001, 0x080c, 0x9207, 0x7817, 0x0140,
+	0x00ce, 0x00be, 0x0005, 0x2001, 0x180e, 0x2004, 0xd0ec, 0x0120,
+	0x2011, 0x8049, 0x080c, 0x4b09, 0x080c, 0xac4f, 0x0d78, 0x2b08,
+	0x6112, 0x6023, 0x0006, 0x7120, 0x610a, 0x7130, 0x615e, 0x6017,
+	0xf300, 0x6003, 0x0001, 0x6007, 0x0041, 0x2009, 0xa022, 0x080c,
+	0x9200, 0x08e0, 0x00b6, 0x7110, 0xd1bc, 0x05d0, 0x7020, 0x2060,
+	0x9c84, 0x0003, 0x15a8, 0x9c82, 0x1ddc, 0x0690, 0x6868, 0x9c02,
+	0x1678, 0x9484, 0x0fff, 0x9082, 0x000c, 0x0650, 0x7008, 0x9084,
+	0x00ff, 0x6110, 0x2158, 0xb910, 0x9106, 0x1510, 0x700c, 0xb914,
+	0x9106, 0x11f0, 0x7124, 0x610a, 0x601c, 0xd0fc, 0x11c8, 0x2001,
+	0x0271, 0x2004, 0x9005, 0x1180, 0x9484, 0x0fff, 0x9082, 0x000c,
+	0x0158, 0x0066, 0x2031, 0x0100, 0xa001, 0xa001, 0x8631, 0x1de0,
+	0x006e, 0x601c, 0xd0fc, 0x1120, 0x2009, 0x0045, 0x080c, 0xac7c,
+	0x7817, 0x0140, 0x00be, 0x0005, 0x6120, 0x9186, 0x0002, 0x0128,
+	0x9186, 0x0005, 0x0110, 0x9085, 0x0001, 0x0005, 0x080c, 0x3326,
+	0x1168, 0x7010, 0x9084, 0xff00, 0x8007, 0x9086, 0x0000, 0x1130,
+	0x9184, 0x000f, 0x908a, 0x0006, 0x1208, 0x000b, 0x0005, 0x836d,
+	0x836e, 0x836d, 0x836d, 0x83cd, 0x83dc, 0x0005, 0x00b6, 0x7110,
+	0xd1bc, 0x0120, 0x702c, 0xd084, 0x0904, 0x83cb, 0x700c, 0x7108,
+	0x080c, 0x2614, 0x1904, 0x83cb, 0x080c, 0x65bf, 0x1904, 0x83cb,
+	0xbe12, 0xbd16, 0x7110, 0xd1bc, 0x01d8, 0x080c, 0x6a6a, 0x0118,
+	0x9086, 0x0004, 0x1588, 0x00c6, 0x080c, 0x83eb, 0x00ce, 0x05d8,
+	0x080c, 0xab89, 0x2b08, 0x05b8, 0x6112, 0x080c, 0xcccb, 0x6023,
+	0x0002, 0x7120, 0x610a, 0x2009, 0x0088, 0x080c, 0xac7c, 0x0458,
+	0x080c, 0x6a6a, 0x0148, 0x9086, 0x0004, 0x0130, 0x080c, 0x6a72,
+	0x0118, 0x9086, 0x0004, 0x1180, 0x080c, 0xab89, 0x2b08, 0x01d8,
+	0x6112, 0x080c, 0xcccb, 0x6023, 0x0005, 0x7120, 0x610a, 0x2009,
+	0x0088, 0x080c, 0xac7c, 0x0078, 0x080c, 0xab89, 0x2b08, 0x0158,
+	0x6112, 0x080c, 0xcccb, 0x6023, 0x0004, 0x7120, 0x610a, 0x2009,
+	0x0001, 0x080c, 0xac7c, 0x00be, 0x0005, 0x7110, 0xd1bc, 0x0158,
+	0x00d1, 0x0148, 0x080c, 0x834c, 0x1130, 0x7124, 0x610a, 0x2009,
+	0x0089, 0x080c, 0xac7c, 0x0005, 0x7110, 0xd1bc, 0x0158, 0x0059,
+	0x0148, 0x080c, 0x834c, 0x1130, 0x7124, 0x610a, 0x2009, 0x008a,
+	0x080c, 0xac7c, 0x0005, 0x7020, 0x2060, 0x9c84, 0x0003, 0x1158,
+	0x9c82, 0x1ddc, 0x0240, 0x2001, 0x181a, 0x2004, 0x9c02, 0x1218,
+	0x9085, 0x0001, 0x0005, 0x9006, 0x0ce8, 0x00b6, 0x7110, 0xd1bc,
+	0x11d8, 0x7024, 0x2060, 0x9c84, 0x0003, 0x11b0, 0x9c82, 0x1ddc,
+	0x0298, 0x6868, 0x9c02, 0x1280, 0x7008, 0x9084, 0x00ff, 0x6110,
+	0x2158, 0xb910, 0x9106, 0x1140, 0x700c, 0xb914, 0x9106, 0x1120,
+	0x2009, 0x0051, 0x080c, 0xac7c, 0x7817, 0x0140, 0x00be, 0x0005,
+	0x2031, 0x0105, 0x0069, 0x0005, 0x2031, 0x0206, 0x0049, 0x0005,
+	0x2031, 0x0207, 0x0029, 0x0005, 0x2031, 0x0213, 0x0009, 0x0005,
+	0x00c6, 0x0096, 0x00f6, 0x7000, 0x9084, 0xf000, 0x9086, 0xc000,
+	0x05c0, 0x080c, 0xab89, 0x05a8, 0x0066, 0x00c6, 0x0046, 0x2011,
+	0x0263, 0x2204, 0x8211, 0x220c, 0x080c, 0x2614, 0x1590, 0x080c,
+	0x65bf, 0x1578, 0xbe12, 0xbd16, 0x2b00, 0x004e, 0x00ce, 0x6012,
+	0x080c, 0xcccb, 0x080c, 0x103a, 0x0500, 0x2900, 0x6062, 0x9006,
+	0xa802, 0xa866, 0xac6a, 0xa85c, 0x90f8, 0x001b, 0x20a9, 0x000e,
+	0xa860, 0x20e8, 0x20e1, 0x0000, 0x2fa0, 0x2e98, 0x4003, 0x006e,
+	0x6616, 0x6007, 0x003e, 0x6023, 0x0001, 0x6003, 0x0001, 0x080c,
+	0x9207, 0x00fe, 0x009e, 0x00ce, 0x0005, 0x080c, 0xabdf, 0x006e,
+	0x0cc0, 0x004e, 0x00ce, 0x0cc8, 0x00c6, 0x7000, 0x908c, 0xff00,
+	0x9184, 0xf000, 0x810f, 0x9086, 0x2000, 0x1904, 0x84d3, 0x9186,
+	0x0022, 0x15f0, 0x2001, 0x0111, 0x2004, 0x9005, 0x1904, 0x84d5,
+	0x7030, 0x908e, 0x0400, 0x0904, 0x84d5, 0x908e, 0x6000, 0x05e8,
+	0x908e, 0x5400, 0x05d0, 0x908e, 0x0300, 0x11d8, 0x2009, 0x1837,
+	0x210c, 0xd18c, 0x1590, 0xd1a4, 0x1580, 0x080c, 0x6a28, 0x0558,
+	0x68b0, 0x9084, 0x00ff, 0x7100, 0x918c, 0x00ff, 0x9106, 0x1518,
+	0x6880, 0x69b0, 0x918c, 0xff00, 0x9105, 0x7104, 0x9106, 0x11d8,
+	0x00e0, 0x2009, 0x0103, 0x210c, 0xd1b4, 0x11a8, 0x908e, 0x5200,
+	0x09e8, 0x908e, 0x0500, 0x09d0, 0x908e, 0x5000, 0x09b8, 0x0058,
+	0x9186, 0x0023, 0x1140, 0x080c, 0x83eb, 0x0128, 0x6004, 0x9086,
+	0x0002, 0x0118, 0x0000, 0x9006, 0x0010, 0x9085, 0x0001, 0x00ce,
+	0x0005, 0x0156, 0x0046, 0x0016, 0x0036, 0x7038, 0x2020, 0x8427,
+	0x94a4, 0x0007, 0xd484, 0x0148, 0x20a9, 0x0004, 0x2019, 0x1805,
+	0x2011, 0x027a, 0x080c, 0xbba1, 0x1178, 0xd48c, 0x0148, 0x20a9,
+	0x0004, 0x2019, 0x1801, 0x2011, 0x027e, 0x080c, 0xbba1, 0x1120,
+	0xd494, 0x0110, 0x9085, 0x0001, 0x003e, 0x001e, 0x004e, 0x015e,
+	0x0005, 0x0156, 0x0046, 0x0016, 0x0036, 0x7038, 0x2020, 0x8427,
+	0x94a4, 0x0007, 0xd484, 0x0148, 0x20a9, 0x0004, 0x2019, 0x1805,
+	0x2011, 0x0272, 0x080c, 0xbba1, 0x1178, 0xd48c, 0x0148, 0x20a9,
+	0x0004, 0x2019, 0x1801, 0x2011, 0x0276, 0x080c, 0xbba1, 0x1120,
+	0xd494, 0x0110, 0x9085, 0x0001, 0x003e, 0x001e, 0x004e, 0x015e,
+	0x0005, 0x00f6, 0x2079, 0x0200, 0x7800, 0xc0e5, 0xc0cc, 0x7802,
+	0x00fe, 0x0005, 0x00f6, 0x2079, 0x1800, 0x7834, 0xd084, 0x1130,
+	0x2079, 0x0200, 0x7800, 0x9085, 0x1200, 0x7802, 0x00fe, 0x0005,
+	0x00e6, 0x2071, 0x1800, 0x7034, 0xc084, 0x7036, 0x00ee, 0x0005,
+	0x2071, 0x1a02, 0x7003, 0x0003, 0x700f, 0x0361, 0x9006, 0x701a,
+	0x7072, 0x7012, 0x7017, 0x1ddc, 0x7007, 0x0000, 0x7026, 0x702b,
+	0x9e36, 0x7032, 0x7037, 0x9eb3, 0x703f, 0xffff, 0x7042, 0x7047,
+	0x556c, 0x704a, 0x705b, 0x86f0, 0x080c, 0x1053, 0x090c, 0x0d7d,
+	0x2900, 0x703a, 0xa867, 0x0003, 0xa86f, 0x0100, 0xa8ab, 0xdcb0,
+	0x0005, 0x2071, 0x1a02, 0x1d04, 0x860c, 0x2091, 0x6000, 0x700c,
+	0x8001, 0x700e, 0x1590, 0x2001, 0x013c, 0x2004, 0x9005, 0x190c,
+	0x879a, 0x2001, 0x1869, 0x2004, 0xd0c4, 0x0158, 0x3a00, 0xd08c,
+	0x1140, 0x20d1, 0x0000, 0x20d1, 0x0001, 0x20d1, 0x0000, 0x080c,
+	0x0d7d, 0x700f, 0x0361, 0x7007, 0x0001, 0x0126, 0x2091, 0x8000,
+	0x2069, 0x1800, 0x69ec, 0xd1e4, 0x1138, 0xd1dc, 0x1118, 0x080c,
+	0x875e, 0x0010, 0x080c, 0x8735, 0x7040, 0x900d, 0x0148, 0x8109,
+	0x7142, 0x1130, 0x7044, 0x080f, 0x0018, 0x0126, 0x2091, 0x8000,
+	0x7024, 0x900d, 0x0188, 0x7020, 0x8001, 0x7022, 0x1168, 0x7023,
+	0x0009, 0x8109, 0x7126, 0x9186, 0x03e8, 0x1110, 0x7028, 0x080f,
+	0x81ff, 0x1110, 0x7028, 0x080f, 0x7030, 0x900d, 0x0180, 0x702c,
+	0x8001, 0x702e, 0x1160, 0x702f, 0x0009, 0x8109, 0x7132, 0x0128,
+	0x9184, 0x007f, 0x090c, 0x9f4f, 0x0010, 0x7034, 0x080f, 0x703c,
+	0x9005, 0x0118, 0x0310, 0x8001, 0x703e, 0x704c, 0x900d, 0x0168,
+	0x7048, 0x8001, 0x704a, 0x1148, 0x704b, 0x0009, 0x8109, 0x714e,
+	0x1120, 0x7150, 0x714e, 0x7058, 0x080f, 0x7018, 0x900d, 0x01d8,
+	0x0016, 0x7070, 0x900d, 0x0158, 0x706c, 0x8001, 0x706e, 0x1138,
+	0x706f, 0x0009, 0x8109, 0x7172, 0x1110, 0x7074, 0x080f, 0x001e,
+	0x7008, 0x8001, 0x700a, 0x1138, 0x700b, 0x0009, 0x8109, 0x711a,
+	0x1110, 0x701c, 0x080f, 0x012e, 0x7004, 0x0002, 0x8634, 0x8635,
+	0x865f, 0x00e6, 0x2071, 0x1a02, 0x7018, 0x9005, 0x1120, 0x711a,
+	0x721e, 0x700b, 0x0009, 0x00ee, 0x0005, 0x00e6, 0x0006, 0x2071,
+	0x1a02, 0x701c, 0x9206, 0x1120, 0x701a, 0x701e, 0x7072, 0x7076,
+	0x000e, 0x00ee, 0x0005, 0x00e6, 0x2071, 0x1a02, 0xb888, 0x9102,
+	0x0208, 0xb98a, 0x00ee, 0x0005, 0x0005, 0x00b6, 0x2031, 0x0010,
+	0x7110, 0x080c, 0x6620, 0x11a8, 0xb888, 0x8001, 0x0290, 0xb88a,
+	0x1180, 0x0126, 0x2091, 0x8000, 0x0066, 0xb8d0, 0x9005, 0x0138,
+	0x0026, 0xba3c, 0x0016, 0x080c, 0x674b, 0x001e, 0x002e, 0x006e,
+	0x012e, 0x8108, 0x9182, 0x0800, 0x1220, 0x8631, 0x0128, 0x7112,
+	0x0c00, 0x900e, 0x7007, 0x0002, 0x7112, 0x00be, 0x0005, 0x2031,
+	0x0010, 0x7014, 0x2060, 0x0126, 0x2091, 0x8000, 0x6048, 0x9005,
+	0x0128, 0x8001, 0x604a, 0x1110, 0x080c, 0xcb4c, 0x6018, 0x9005,
+	0x0904, 0x86b7, 0x00f6, 0x2079, 0x0300, 0x7918, 0xd1b4, 0x1904,
+	0x86ca, 0x781b, 0x2020, 0xa001, 0x7918, 0xd1b4, 0x0120, 0x781b,
+	0x2000, 0x0804, 0x86ca, 0x8001, 0x601a, 0x0106, 0x781b, 0x2000,
+	0xa001, 0x7918, 0xd1ac, 0x1dd0, 0x010e, 0x00fe, 0x1540, 0x6120,
+	0x9186, 0x0003, 0x0148, 0x9186, 0x0006, 0x0130, 0x9186, 0x0009,
+	0x11e0, 0x611c, 0xd1c4, 0x1100, 0x080c, 0xc832, 0x01b0, 0x6014,
+	0x2048, 0xa884, 0x908a, 0x199a, 0x0280, 0x9082, 0x1999, 0xa886,
+	0x908a, 0x199a, 0x0210, 0x2001, 0x1999, 0x8003, 0x800b, 0x810b,
+	0x9108, 0x611a, 0x080c, 0xcf7d, 0x0110, 0x080c, 0xc523, 0x012e,
+	0x9c88, 0x001c, 0x7116, 0x2001, 0x181a, 0x2004, 0x9102, 0x1228,
+	0x8631, 0x0138, 0x2160, 0x0804, 0x8663, 0x7017, 0x1ddc, 0x7007,
+	0x0000, 0x0005, 0x00fe, 0x0c58, 0x00e6, 0x2071, 0x1a02, 0x7027,
+	0x07d0, 0x7023, 0x0009, 0x00ee, 0x0005, 0x2001, 0x1a0b, 0x2003,
+	0x0000, 0x0005, 0x00e6, 0x2071, 0x1a02, 0x7132, 0x702f, 0x0009,
+	0x00ee, 0x0005, 0x2011, 0x1a0e, 0x2013, 0x0000, 0x0005, 0x00e6,
+	0x2071, 0x1a02, 0x711a, 0x721e, 0x700b, 0x0009, 0x00ee, 0x0005,
+	0x0086, 0x0026, 0x7054, 0x8000, 0x7056, 0x2001, 0x1a10, 0x2044,
+	0xa06c, 0x9086, 0x0000, 0x0150, 0x7068, 0xa09a, 0x7064, 0xa096,
+	0x7060, 0xa092, 0x705c, 0xa08e, 0x080c, 0x112f, 0x002e, 0x008e,
+	0x0005, 0x0006, 0x0016, 0x0096, 0x00a6, 0x00b6, 0x00c6, 0x00d6,
+	0x00e6, 0x00f6, 0x0156, 0x080c, 0x8571, 0x015e, 0x00fe, 0x00ee,
+	0x00de, 0x00ce, 0x00be, 0x00ae, 0x009e, 0x001e, 0x000e, 0x0005,
+	0x00e6, 0x2071, 0x1a02, 0x7172, 0x7276, 0x706f, 0x0009, 0x00ee,
+	0x0005, 0x00e6, 0x0006, 0x2071, 0x1a02, 0x7074, 0x9206, 0x1110,
+	0x7072, 0x7076, 0x000e, 0x00ee, 0x0005, 0x2069, 0x1800, 0x69ec,
+	0xd1e4, 0x1518, 0x0026, 0xd1ec, 0x0140, 0x6a54, 0x6874, 0x9202,
+	0x0288, 0x8117, 0x9294, 0x00c1, 0x0088, 0x9184, 0x0007, 0x01a0,
+	0x8109, 0x9184, 0x0007, 0x0110, 0x69ee, 0x0070, 0x8107, 0x9084,
+	0x0007, 0x910d, 0x8107, 0x9106, 0x9094, 0x00c1, 0x9184, 0xff3e,
+	0x9205, 0x68ee, 0x080c, 0x0f05, 0x002e, 0x0005, 0x69e8, 0x9184,
+	0x003f, 0x05b8, 0x8109, 0x9184, 0x003f, 0x01a8, 0x6a54, 0x6874,
+	0x9202, 0x0220, 0xd1bc, 0x0168, 0xc1bc, 0x0018, 0xd1bc, 0x1148,
+	0xc1bd, 0x2110, 0x00e6, 0x2071, 0x1800, 0x080c, 0x0f27, 0x00ee,
+	0x0400, 0x69ea, 0x00f0, 0x0026, 0x8107, 0x9094, 0x0007, 0x0128,
+	0x8001, 0x8007, 0x9085, 0x0007, 0x0050, 0x2010, 0x8004, 0x8004,
+	0x8004, 0x9084, 0x0007, 0x9205, 0x8007, 0x9085, 0x0028, 0x9086,
+	0x0040, 0x2010, 0x00e6, 0x2071, 0x1800, 0x080c, 0x0f27, 0x00ee,
+	0x002e, 0x0005, 0x0016, 0x00c6, 0x2009, 0xfffc, 0x210d, 0x2061,
+	0x0100, 0x60f0, 0x9100, 0x60f3, 0x0000, 0x2009, 0xfffc, 0x200f,
+	0x1220, 0x8108, 0x2105, 0x8000, 0x200f, 0x00ce, 0x001e, 0x0005,
+	0x00c6, 0x2061, 0x1a6e, 0x00ce, 0x0005, 0x9184, 0x000f, 0x8003,
+	0x8003, 0x8003, 0x9080, 0x1a6e, 0x2060, 0x0005, 0xa884, 0x908a,
+	0x199a, 0x1638, 0x9005, 0x1150, 0x00c6, 0x2061, 0x1a6e, 0x6014,
+	0x00ce, 0x9005, 0x1130, 0x2001, 0x001e, 0x0018, 0x908e, 0xffff,
+	0x01b0, 0x8003, 0x800b, 0x810b, 0x9108, 0x611a, 0xa87c, 0x908c,
+	0x00c0, 0x918e, 0x00c0, 0x0904, 0x8878, 0xd0b4, 0x1168, 0xd0bc,
+	0x1904, 0x8851, 0x2009, 0x0006, 0x080c, 0x88a5, 0x0005, 0x900e,
+	0x0c60, 0x2001, 0x1999, 0x08b0, 0xd0fc, 0x05e0, 0x908c, 0x2023,
+	0x1568, 0x87ff, 0x1558, 0xa9a8, 0x81ff, 0x1540, 0x6124, 0x918c,
+	0x0500, 0x1520, 0x6100, 0x918e, 0x0007, 0x1500, 0x2009, 0x1869,
+	0x210c, 0xd184, 0x11d8, 0x6003, 0x0003, 0x6007, 0x0043, 0x6047,
+	0xb035, 0x080c, 0x1c10, 0xa87c, 0xc0dd, 0xa87e, 0x600f, 0x0000,
+	0x00f6, 0x2079, 0x0380, 0x7818, 0xd0bc, 0x1de8, 0x7833, 0x0013,
+	0x2c00, 0x7836, 0x781b, 0x8080, 0x00fe, 0x0005, 0x908c, 0x0003,
+	0x0120, 0x918e, 0x0003, 0x1904, 0x889f, 0x908c, 0x2020, 0x918e,
+	0x2020, 0x01a8, 0x6024, 0xd0d4, 0x11e8, 0x2009, 0x1869, 0x2104,
+	0xd084, 0x1138, 0x87ff, 0x1120, 0x2009, 0x0043, 0x0804, 0xac7c,
+	0x0005, 0x87ff, 0x1de8, 0x2009, 0x0042, 0x0804, 0xac7c, 0x6110,
+	0x00b6, 0x2158, 0xb900, 0x00be, 0xd1ac, 0x0d20, 0x6024, 0xc0cd,
+	0x6026, 0x0c00, 0xc0d4, 0x6026, 0xa890, 0x602e, 0xa88c, 0x6032,
+	0x08e0, 0xd0fc, 0x0160, 0x908c, 0x0003, 0x0120, 0x918e, 0x0003,
+	0x1904, 0x889f, 0x908c, 0x2020, 0x918e, 0x2020, 0x0170, 0x0076,
+	0x00f6, 0x2c78, 0x080c, 0x173e, 0x00fe, 0x007e, 0x87ff, 0x1120,
+	0x2009, 0x0042, 0x080c, 0xac7c, 0x0005, 0x6110, 0x00b6, 0x2158,
+	0xb900, 0x00be, 0xd1ac, 0x0d58, 0x6124, 0xc1cd, 0x6126, 0x0c38,
+	0xd0fc, 0x0188, 0x908c, 0x2020, 0x918e, 0x2020, 0x01a8, 0x9084,
+	0x0003, 0x908e, 0x0002, 0x0148, 0x87ff, 0x1120, 0x2009, 0x0041,
+	0x080c, 0xac7c, 0x0005, 0x00b9, 0x0ce8, 0x87ff, 0x1dd8, 0x2009,
+	0x0043, 0x080c, 0xac7c, 0x0cb0, 0x6110, 0x00b6, 0x2158, 0xb900,
+	0x00be, 0xd1ac, 0x0d20, 0x6124, 0xc1cd, 0x6126, 0x0c00, 0x2009,
+	0x0004, 0x0019, 0x0005, 0x2009, 0x0001, 0x0096, 0x080c, 0xc832,
+	0x0518, 0x6014, 0x2048, 0xa982, 0xa800, 0x6016, 0x9186, 0x0001,
+	0x1188, 0xa97c, 0x918c, 0x8100, 0x918e, 0x8100, 0x1158, 0x00c6,
+	0x2061, 0x1a6e, 0x6200, 0xd28c, 0x1120, 0x6204, 0x8210, 0x0208,
+	0x6206, 0x00ce, 0x080c, 0x6bb0, 0x6014, 0x904d, 0x0076, 0x2039,
+	0x0000, 0x190c, 0x87be, 0x007e, 0x009e, 0x0005, 0x0156, 0x00c6,
+	0x2061, 0x1a6e, 0x6000, 0x81ff, 0x0110, 0x9205, 0x0008, 0x9204,
+	0x6002, 0x00ce, 0x015e, 0x0005, 0x6800, 0xd08c, 0x1138, 0x6808,
+	0x9005, 0x0120, 0x8001, 0x680a, 0x9085, 0x0001, 0x0005, 0x2071,
+	0x1923, 0x7003, 0x0006, 0x7007, 0x0000, 0x700f, 0x0000, 0x7013,
+	0x0001, 0x080c, 0x1053, 0x090c, 0x0d7d, 0xa867, 0x0006, 0xa86b,
+	0x0001, 0xa8ab, 0xdcb0, 0xa89f, 0x0000, 0x2900, 0x702e, 0x7033,
+	0x0000, 0x0005, 0x0096, 0x00e6, 0x2071, 0x1923, 0x702c, 0x2048,
+	0x6a2c, 0x721e, 0x6b30, 0x7322, 0x6834, 0x7026, 0xa896, 0x6838,
+	0x702a, 0xa89a, 0x6824, 0x7016, 0x683c, 0x701a, 0x2009, 0x0028,
+	0x200a, 0x9005, 0x0148, 0x900e, 0x9188, 0x000c, 0x8001, 0x1de0,
+	0x2100, 0x9210, 0x1208, 0x8318, 0xaa8e, 0xab92, 0x7010, 0xd084,
+	0x0178, 0xc084, 0x7007, 0x0001, 0x700f, 0x0000, 0x0006, 0x2009,
+	0x181d, 0x2104, 0x9082, 0x0007, 0x2009, 0x1b4d, 0x200a, 0x000e,
+	0xc095, 0x7012, 0x2008, 0x2001, 0x003b, 0x080c, 0x1686, 0x9006,
+	0x2071, 0x193c, 0x7002, 0x7006, 0x702a, 0x00ee, 0x009e, 0x0005,
+	0x00e6, 0x0126, 0x0156, 0x2091, 0x8000, 0x2071, 0x1800, 0x7154,
+	0x2001, 0x0008, 0x910a, 0x0638, 0x2001, 0x187d, 0x20ac, 0x9006,
+	0x9080, 0x0008, 0x1f04, 0x8958, 0x71c0, 0x9102, 0x02e0, 0x2071,
+	0x1877, 0x20a9, 0x0007, 0x00c6, 0x080c, 0xab89, 0x6023, 0x0009,
+	0x6003, 0x0004, 0x601f, 0x0101, 0x0089, 0x0126, 0x2091, 0x8000,
+	0x080c, 0x8ade, 0x012e, 0x1f04, 0x8964, 0x9006, 0x00ce, 0x015e,
+	0x012e, 0x00ee, 0x0005, 0x9085, 0x0001, 0x0cc8, 0x00e6, 0x00b6,
+	0x0096, 0x0086, 0x0056, 0x0046, 0x0026, 0x7118, 0x720c, 0x7620,
+	0x7004, 0xd084, 0x1128, 0x2021, 0x0024, 0x2029, 0x0002, 0x0020,
+	0x2021, 0x002c, 0x2029, 0x000a, 0x080c, 0x103a, 0x090c, 0x0d7d,
+	0x2900, 0x6016, 0x2058, 0xac66, 0x9006, 0xa802, 0xa806, 0xa86a,
+	0xa87a, 0xa8aa, 0xa887, 0x0005, 0xa87f, 0x0020, 0x7008, 0xa89a,
+	0x7010, 0xa89e, 0xae8a, 0xa8af, 0xffff, 0xa8b3, 0x0000, 0x8109,
+	0x0160, 0x080c, 0x103a, 0x090c, 0x0d7d, 0xad66, 0x2b00, 0xa802,
+	0x2900, 0xb806, 0x2058, 0x8109, 0x1da0, 0x002e, 0x004e, 0x005e,
+	0x008e, 0x009e, 0x00be, 0x00ee, 0x0005, 0x2079, 0x0000, 0x2071,
+	0x1923, 0x7004, 0x004b, 0x700c, 0x0002, 0x89d0, 0x89c9, 0x89c9,
+	0x0005, 0x89da, 0x8a3b, 0x8a3b, 0x8a3b, 0x8a3c, 0x8a4d, 0x8a4d,
+	0x700c, 0x0cba, 0x0126, 0x2091, 0x8000, 0x78a0, 0x79a0, 0x9106,
+	0x0128, 0x78a0, 0x79a0, 0x9106, 0x1904, 0x8a2e, 0x2001, 0x0005,
+	0x2004, 0xd0bc, 0x0130, 0x2011, 0x0004, 0x2204, 0xc0c5, 0x2012,
+	0x0ca8, 0x012e, 0x7018, 0x910a, 0x1130, 0x7030, 0x9005, 0x05a8,
+	0x080c, 0x8a7c, 0x0490, 0x1210, 0x7114, 0x910a, 0x9192, 0x000a,
+	0x0210, 0x2009, 0x000a, 0x2001, 0x1888, 0x2014, 0x2001, 0x1935,
+	0x2004, 0x9100, 0x9202, 0x0e48, 0x080c, 0x8bc8, 0x2200, 0x9102,
+	0x0208, 0x2208, 0x0096, 0x702c, 0x2048, 0xa873, 0x0001, 0xa976,
+	0x080c, 0x8cd1, 0x2100, 0xa87e, 0xa86f, 0x0000, 0x009e, 0x0126,
+	0x2091, 0x8000, 0x2009, 0x1a20, 0x2104, 0xc085, 0x200a, 0x700f,
+	0x0002, 0x012e, 0x080c, 0x114e, 0x1de8, 0x0005, 0x2001, 0x0005,
+	0x2004, 0xd0bc, 0x0130, 0x2011, 0x0004, 0x2204, 0xc0c5, 0x2012,
+	0x0ca8, 0x012e, 0x0005, 0x0005, 0x700c, 0x0002, 0x8a41, 0x8a44,
+	0x8a43, 0x080c, 0x89d8, 0x0005, 0x8001, 0x700e, 0x0096, 0x702c,
+	0x2048, 0xa974, 0x009e, 0x0011, 0x0ca0, 0x0005, 0x0096, 0x702c,
+	0x2048, 0x7018, 0x9100, 0x7214, 0x921a, 0x1130, 0x701c, 0xa88e,
+	0x7020, 0xa892, 0x9006, 0x0068, 0x0006, 0x080c, 0x8cd1, 0x2100,
+	0xaa8c, 0x9210, 0xaa8e, 0x1220, 0xa890, 0x9081, 0x0000, 0xa892,
+	0x000e, 0x009e, 0x2f08, 0x9188, 0x0028, 0x200a, 0x701a, 0x0005,
+	0x00e6, 0x2071, 0x1923, 0x700c, 0x0002, 0x8a7a, 0x8a7a, 0x8a78,
+	0x700f, 0x0001, 0x00ee, 0x0005, 0x0126, 0x2091, 0x8000, 0x7030,
+	0x9005, 0x0508, 0x2078, 0x7814, 0x2048, 0xae88, 0x00b6, 0x2059,
+	0x0000, 0x080c, 0x8ae7, 0x00be, 0x01b0, 0x00e6, 0x2071, 0x193c,
+	0x080c, 0x8b2e, 0x00ee, 0x0178, 0x0096, 0x080c, 0x1053, 0x2900,
+	0x009e, 0x0148, 0xa8aa, 0x04b9, 0x0041, 0x2001, 0x1946, 0x2003,
+	0x0000, 0x012e, 0x08c8, 0x012e, 0x0005, 0x00d6, 0x00c6, 0x0086,
+	0x00a6, 0x2940, 0x2650, 0x2600, 0x9005, 0x0180, 0xa864, 0x9084,
+	0x000f, 0x2068, 0x9d88, 0x1e62, 0x2165, 0x0056, 0x2029, 0x0000,
+	0x080c, 0x8c56, 0x080c, 0x1e38, 0x1dd8, 0x005e, 0x00ae, 0x2001,
+	0x187f, 0x2004, 0xa88a, 0x080c, 0x173e, 0x781f, 0x0101, 0x7813,
+	0x0000, 0x0126, 0x2091, 0x8000, 0x080c, 0x8b3d, 0x012e, 0x008e,
+	0x00ce, 0x00de, 0x0005, 0x7030, 0x9005, 0x0138, 0x2078, 0x780c,
+	0x7032, 0x2001, 0x1946, 0x2003, 0x0001, 0x0005, 0x00e6, 0x2071,
+	0x1923, 0x7030, 0x600e, 0x2c00, 0x7032, 0x00ee, 0x0005, 0x00d6,
+	0x00c6, 0x0026, 0x9b80, 0x8db0, 0x2005, 0x906d, 0x090c, 0x0d7d,
+	0x9b80, 0x8da8, 0x2005, 0x9065, 0x090c, 0x0d7d, 0x6114, 0x2600,
+	0x9102, 0x0248, 0x6828, 0x9102, 0x02f0, 0x9085, 0x0001, 0x002e,
+	0x00ce, 0x00de, 0x0005, 0x6804, 0xd094, 0x0148, 0x6854, 0xd084,
+	0x1178, 0xc085, 0x6856, 0x2011, 0x8026, 0x080c, 0x4b09, 0x684c,
+	0x0096, 0x904d, 0x090c, 0x0d7d, 0xa804, 0x8000, 0xa806, 0x009e,
+	0x9006, 0x2030, 0x0c20, 0x6854, 0xd08c, 0x1d08, 0xc08d, 0x6856,
+	0x2011, 0x8025, 0x080c, 0x4b09, 0x684c, 0x0096, 0x904d, 0x090c,
+	0x0d7d, 0xa800, 0x8000, 0xa802, 0x009e, 0x0888, 0x7000, 0x2019,
+	0x0008, 0x8319, 0x7104, 0x9102, 0x1118, 0x2300, 0x9005, 0x0020,
+	0x0210, 0x9302, 0x0008, 0x8002, 0x0005, 0x00d6, 0x7814, 0x9005,
+	0x090c, 0x0d7d, 0x781c, 0x9084, 0x0101, 0x9086, 0x0101, 0x190c,
+	0x0d7d, 0x2069, 0x193c, 0x6804, 0x9080, 0x193e, 0x2f08, 0x2102,
+	0x6904, 0x8108, 0x9182, 0x0008, 0x0208, 0x900e, 0x6906, 0x9180,
+	0x193e, 0x2003, 0x0000, 0x00de, 0x0005, 0x0096, 0x00c6, 0x2060,
+	0x6014, 0x2048, 0xa8a8, 0x0096, 0x2048, 0x9005, 0x190c, 0x106c,
+	0x009e, 0xa8ab, 0x0000, 0x080c, 0x0fec, 0x080c, 0xabdf, 0x00ce,
+	0x009e, 0x0005, 0x6020, 0x9086, 0x0009, 0x1128, 0x601c, 0xd0c4,
+	0x0110, 0x9006, 0x0005, 0x9085, 0x0001, 0x0005, 0x6000, 0x9086,
+	0x0000, 0x0178, 0x6010, 0x9005, 0x0150, 0x00b6, 0x2058, 0x080c,
+	0x8ee3, 0x00be, 0x6013, 0x0000, 0x601b, 0x0000, 0x0010, 0x2c00,
+	0x0861, 0x0005, 0x2009, 0x1927, 0x210c, 0xd194, 0x0005, 0x00e6,
+	0x2071, 0x1923, 0x7110, 0xc194, 0xd19c, 0x1118, 0xc185, 0x7007,
+	0x0000, 0x7112, 0x2001, 0x003b, 0x080c, 0x1686, 0x00ee, 0x0005,
+	0x0096, 0x00d6, 0x9006, 0x7006, 0x700e, 0x701a, 0x701e, 0x7022,
+	0x7016, 0x702a, 0x7026, 0x702f, 0x0000, 0x080c, 0x8d30, 0x0170,
+	0x080c, 0x8d65, 0x0158, 0x2900, 0x7002, 0x700a, 0x701a, 0x7013,
+	0x0001, 0x701f, 0x000a, 0x00de, 0x009e, 0x0005, 0x900e, 0x0cd8,
+	0x00e6, 0x0096, 0x0086, 0x00d6, 0x00c6, 0x2071, 0x1930, 0x721c,
+	0x2100, 0x9202, 0x1618, 0x080c, 0x8d65, 0x090c, 0x0d7d, 0x7018,
+	0x9005, 0x1160, 0x2900, 0x7002, 0x700a, 0x701a, 0x9006, 0x7006,
+	0x700e, 0xa806, 0xa802, 0x7012, 0x701e, 0x0038, 0x2040, 0xa806,
+	0x2900, 0xa002, 0x701a, 0xa803, 0x0000, 0x7010, 0x8000, 0x7012,
+	0x701c, 0x9080, 0x000a, 0x701e, 0x721c, 0x08d0, 0x721c, 0x00ce,
+	0x00de, 0x008e, 0x009e, 0x00ee, 0x0005, 0x0096, 0x0156, 0x0136,
+	0x0146, 0x00e6, 0x0126, 0x2091, 0x8000, 0x2071, 0x1930, 0x7300,
+	0x831f, 0x831e, 0x831e, 0x9384, 0x003f, 0x20e8, 0x939c, 0xffc0,
+	0x9398, 0x0003, 0x7104, 0x080c, 0x8cd1, 0x810c, 0x2100, 0x9318,
+	0x8003, 0x2228, 0x2021, 0x0078, 0x9402, 0x9532, 0x0208, 0x2028,
+	0x2500, 0x8004, 0x20a8, 0x23a0, 0xa001, 0xa001, 0x4005, 0x2508,
+	0x080c, 0x8cda, 0x2130, 0x7014, 0x9600, 0x7016, 0x2600, 0x711c,
+	0x9102, 0x701e, 0x7004, 0x9600, 0x2008, 0x9082, 0x000a, 0x1190,
+	0x7000, 0x2048, 0xa800, 0x9005, 0x1148, 0x2009, 0x0001, 0x0026,
+	0x080c, 0x8bc8, 0x002e, 0x7000, 0x2048, 0xa800, 0x7002, 0x7007,
+	0x0000, 0x0008, 0x7106, 0x2500, 0x9212, 0x1904, 0x8c07, 0x012e,
+	0x00ee, 0x014e, 0x013e, 0x015e, 0x009e, 0x0005, 0x0016, 0x0026,
+	0x00e6, 0x0126, 0x2091, 0x8000, 0x9580, 0x8da8, 0x2005, 0x9075,
+	0x090c, 0x0d7d, 0x080c, 0x8cac, 0x012e, 0x9580, 0x8da4, 0x2005,
+	0x9075, 0x090c, 0x0d7d, 0x0156, 0x0136, 0x01c6, 0x0146, 0x01d6,
+	0x831f, 0x831e, 0x831e, 0x9384, 0x003f, 0x20e0, 0x9384, 0xffc0,
+	0x9100, 0x2098, 0xa860, 0x20e8, 0xa95c, 0x2c05, 0x9100, 0x20a0,
+	0x20a9, 0x0002, 0x4003, 0x2e0c, 0x2d00, 0x0002, 0x8c96, 0x8c96,
+	0x8c98, 0x8c96, 0x8c98, 0x8c96, 0x8c96, 0x8c96, 0x8c96, 0x8c96,
+	0x8c9e, 0x8c96, 0x8c9e, 0x8c96, 0x8c96, 0x8c96, 0x080c, 0x0d7d,
+	0x4104, 0x20a9, 0x0002, 0x4002, 0x4003, 0x0028, 0x20a9, 0x0002,
+	0x4003, 0x4104, 0x4003, 0x01de, 0x014e, 0x01ce, 0x013e, 0x015e,
+	0x00ee, 0x002e, 0x001e, 0x0005, 0x0096, 0x7014, 0x8001, 0x7016,
+	0x710c, 0x2110, 0x00f1, 0x810c, 0x9188, 0x0003, 0x7308, 0x8210,
+	0x9282, 0x000a, 0x1198, 0x7008, 0x2048, 0xa800, 0x9005, 0x0158,
+	0x0006, 0x080c, 0x8d74, 0x009e, 0xa807, 0x0000, 0x2900, 0x700a,
+	0x7010, 0x8001, 0x7012, 0x700f, 0x0000, 0x0008, 0x720e, 0x009e,
+	0x0005, 0x0006, 0x810b, 0x810b, 0x2100, 0x810b, 0x9100, 0x2008,
+	0x000e, 0x0005, 0x0006, 0x0026, 0x2100, 0x9005, 0x0158, 0x9092,
+	0x000c, 0x0240, 0x900e, 0x8108, 0x9082, 0x000c, 0x1de0, 0x002e,
+	0x000e, 0x0005, 0x900e, 0x0cd8, 0x2d00, 0x90b8, 0x0008, 0x690c,
+	0x6810, 0x2019, 0x0001, 0x2031, 0x8d1a, 0x9112, 0x0220, 0x0118,
+	0x8318, 0x2208, 0x0cd0, 0x6808, 0x9005, 0x0108, 0x8318, 0x233a,
+	0x6804, 0xd084, 0x2300, 0x2021, 0x0001, 0x1150, 0x9082, 0x0003,
+	0x0967, 0x0a67, 0x8420, 0x9082, 0x0007, 0x0967, 0x0a67, 0x0cd0,
+	0x9082, 0x0002, 0x0967, 0x0a67, 0x8420, 0x9082, 0x0005, 0x0967,
+	0x0a67, 0x0cd0, 0x6c1a, 0x2d00, 0x90b8, 0x0007, 0x00e6, 0x2071,
+	0x1800, 0x7128, 0x6810, 0x2019, 0x0001, 0x910a, 0x0118, 0x0210,
+	0x8318, 0x0cd8, 0x2031, 0x8d2d, 0x0870, 0x6c16, 0x00ee, 0x0005,
+	0x0096, 0x0046, 0x0126, 0x2091, 0x8000, 0x2b00, 0x9080, 0x8dac,
+	0x2005, 0x9005, 0x090c, 0x0d7d, 0x2004, 0x90a0, 0x000a, 0x080c,
+	0x1053, 0x01d0, 0x2900, 0x7026, 0xa803, 0x0000, 0xa807, 0x0000,
+	0x080c, 0x1053, 0x0188, 0x7024, 0xa802, 0xa807, 0x0000, 0x2900,
+	0x7026, 0x94a2, 0x000a, 0x0110, 0x0208, 0x0c90, 0x9085, 0x0001,
+	0x012e, 0x004e, 0x009e, 0x0005, 0x7024, 0x9005, 0x0dc8, 0x2048,
+	0xac00, 0x080c, 0x106c, 0x2400, 0x0cc0, 0x0126, 0x2091, 0x8000,
+	0x7024, 0x2048, 0x9005, 0x0130, 0xa800, 0x7026, 0xa803, 0x0000,
+	0xa807, 0x0000, 0x012e, 0x0005, 0x0126, 0x2091, 0x8000, 0x7024,
+	0xa802, 0x2900, 0x7026, 0x012e, 0x0005, 0x0096, 0x9e80, 0x0009,
+	0x2004, 0x9005, 0x0138, 0x2048, 0xa800, 0x0006, 0x080c, 0x106c,
+	0x000e, 0x0cb8, 0x009e, 0x0005, 0x0096, 0x7008, 0x9005, 0x0138,
+	0x2048, 0xa800, 0x0006, 0x080c, 0x106c, 0x000e, 0x0cb8, 0x9006,
+	0x7002, 0x700a, 0x7006, 0x700e, 0x701a, 0x701e, 0x7022, 0x702a,
+	0x7026, 0x702e, 0x009e, 0x0005, 0x1a6c, 0x0000, 0x0000, 0x0000,
+	0x1930, 0x0000, 0x0000, 0x0000, 0x1888, 0x0000, 0x0000, 0x0000,
+	0x1877, 0x0000, 0x0000, 0x0000, 0x00e6, 0x00c6, 0x00b6, 0x00a6,
+	0xa8a8, 0x2040, 0x2071, 0x1877, 0x080c, 0x8ece, 0xa067, 0x0023,
+	0x6010, 0x905d, 0x0904, 0x8ea3, 0xb814, 0xa06e, 0xb910, 0xa172,
+	0xb9a0, 0xa176, 0x2001, 0x0003, 0xa07e, 0xa834, 0xa082, 0xa07b,
+	0x0000, 0xa898, 0x9005, 0x0118, 0xa078, 0xc085, 0xa07a, 0x2858,
+	0x2031, 0x0018, 0xa068, 0x908a, 0x0019, 0x1a0c, 0x0d7d, 0x2020,
+	0x2050, 0x2940, 0xa864, 0x90bc, 0x00ff, 0x908c, 0x000f, 0x91e0,
+	0x1e62, 0x2c65, 0x9786, 0x0024, 0x2c05, 0x1590, 0x908a, 0x0036,
+	0x1a0c, 0x0d7d, 0x9082, 0x001b, 0x0002, 0x8e10, 0x8e10, 0x8e12,
+	0x8e10, 0x8e10, 0x8e10, 0x8e14, 0x8e10, 0x8e10, 0x8e10, 0x8e16,
+	0x8e10, 0x8e10, 0x8e10, 0x8e18, 0x8e10, 0x8e10, 0x8e10, 0x8e1a,
+	0x8e10, 0x8e10, 0x8e10, 0x8e1c, 0x8e10, 0x8e10, 0x8e10, 0x8e1e,
+	0x080c, 0x0d7d, 0xa180, 0x04b8, 0xa190, 0x04a8, 0xa1a0, 0x0498,
+	0xa1b0, 0x0488, 0xa1c0, 0x0478, 0xa1d0, 0x0468, 0xa1e0, 0x0458,
+	0x908a, 0x0034, 0x1a0c, 0x0d7d, 0x9082, 0x001b, 0x0002, 0x8e42,
+	0x8e40, 0x8e40, 0x8e40, 0x8e40, 0x8e40, 0x8e44, 0x8e40, 0x8e40,
+	0x8e40, 0x8e40, 0x8e40, 0x8e46, 0x8e40, 0x8e40, 0x8e40, 0x8e40,
+	0x8e40, 0x8e48, 0x8e40, 0x8e40, 0x8e40, 0x8e40, 0x8e40, 0x8e4a,
+	0x080c, 0x0d7d, 0xa180, 0x0038, 0xa198, 0x0028, 0xa1b0, 0x0018,
+	0xa1c8, 0x0008, 0xa1e0, 0x2600, 0x0002, 0x8e66, 0x8e68, 0x8e6a,
+	0x8e6c, 0x8e6e, 0x8e70, 0x8e72, 0x8e74, 0x8e76, 0x8e78, 0x8e7a,
+	0x8e7c, 0x8e7e, 0x8e80, 0x8e82, 0x8e84, 0x8e86, 0x8e88, 0x8e8a,
+	0x8e8c, 0x8e8e, 0x8e90, 0x8e92, 0x8e94, 0x8e96, 0x080c, 0x0d7d,
+	0xb9e2, 0x0468, 0xb9de, 0x0458, 0xb9da, 0x0448, 0xb9d6, 0x0438,
+	0xb9d2, 0x0428, 0xb9ce, 0x0418, 0xb9ca, 0x0408, 0xb9c6, 0x00f8,
+	0xb9c2, 0x00e8, 0xb9be, 0x00d8, 0xb9ba, 0x00c8, 0xb9b6, 0x00b8,
+	0xb9b2, 0x00a8, 0xb9ae, 0x0098, 0xb9aa, 0x0088, 0xb9a6, 0x0078,
+	0xb9a2, 0x0068, 0xb99e, 0x0058, 0xb99a, 0x0048, 0xb996, 0x0038,
+	0xb992, 0x0028, 0xb98e, 0x0018, 0xb98a, 0x0008, 0xb986, 0x8631,
+	0x8421, 0x0120, 0x080c, 0x1e38, 0x0804, 0x8dea, 0x00ae, 0x00be,
+	0x00ce, 0x00ee, 0x0005, 0xa86c, 0xa06e, 0xa870, 0xa072, 0xa077,
+	0x00ff, 0x9006, 0x0804, 0x8dcc, 0x0006, 0x0016, 0x00b6, 0x6010,
+	0x2058, 0xb810, 0x9005, 0x01b0, 0x2001, 0x1924, 0x2004, 0x9005,
+	0x0188, 0x2001, 0x1800, 0x2004, 0x9086, 0x0003, 0x1158, 0x0036,
+	0x0046, 0xbba0, 0x2021, 0x0004, 0x2011, 0x8014, 0x080c, 0x4b09,
+	0x004e, 0x003e, 0x00be, 0x001e, 0x000e, 0x0005, 0x9016, 0x710c,
+	0xa834, 0x910a, 0xa936, 0x7008, 0x9005, 0x0120, 0x8210, 0x910a,
+	0x0238, 0x0130, 0x7010, 0x8210, 0x910a, 0x0210, 0x0108, 0x0cd8,
+	0xaa8a, 0xa26a, 0x0005, 0x00f6, 0x00d6, 0x0036, 0x2079, 0x0300,
+	0x781b, 0x0200, 0x7818, 0xd094, 0x1dd8, 0x781b, 0x0202, 0xa001,
+	0xa001, 0x7818, 0xd094, 0x1da0, 0xb8ac, 0x9005, 0x01b8, 0x2068,
+	0x2079, 0x0000, 0x2c08, 0x911e, 0x1118, 0x680c, 0xb8ae, 0x0060,
+	0x9106, 0x0140, 0x2d00, 0x2078, 0x680c, 0x9005, 0x090c, 0x0d7d,
+	0x2068, 0x0cb0, 0x6b0c, 0x7b0e, 0x600f, 0x0000, 0x2079, 0x0300,
+	0x781b, 0x0200, 0x003e, 0x00de, 0x00fe, 0x0005, 0x00e6, 0x00d6,
+	0x0096, 0x00c6, 0x0036, 0x0126, 0x2091, 0x8000, 0x0156, 0x20a9,
+	0x01ff, 0x2071, 0x0300, 0x701b, 0x0200, 0x7018, 0xd094, 0x0110,
+	0x1f04, 0x8f23, 0x701b, 0x0202, 0xa001, 0xa001, 0x7018, 0xd094,
+	0x1d90, 0xb8ac, 0x9005, 0x01d0, 0x2060, 0x600c, 0xb8ae, 0x6003,
+	0x0004, 0x601b, 0x0000, 0x6013, 0x0000, 0x601f, 0x0101, 0x6014,
+	0x2048, 0xa88b, 0x0000, 0xa8a8, 0xa8ab, 0x0000, 0x904d, 0x090c,
+	0x0d7d, 0x080c, 0x106c, 0x080c, 0x8ade, 0x0c18, 0x2071, 0x0300,
+	0x701b, 0x0200, 0x015e, 0x012e, 0x003e, 0x00ce, 0x009e, 0x00de,
+	0x00ee, 0x0005, 0x00c6, 0x00b6, 0x0016, 0x0006, 0x0156, 0x080c,
+	0x2614, 0x015e, 0x11b0, 0x080c, 0x65bf, 0x190c, 0x0d7d, 0x000e,
+	0x001e, 0xb912, 0xb816, 0x080c, 0xab89, 0x0140, 0x2b00, 0x6012,
+	0x6023, 0x0001, 0x2009, 0x0001, 0x080c, 0xac7c, 0x00be, 0x00ce,
+	0x0005, 0x000e, 0x001e, 0x0cd0, 0x0066, 0x6000, 0x90b2, 0x0016,
+	0x1a0c, 0x0d7d, 0x0013, 0x006e, 0x0005, 0x8f95, 0x8f95, 0x8f95,
+	0x8f97, 0x8fe0, 0x8f95, 0x8f95, 0x8f95, 0x9043, 0x8f95, 0x907b,
+	0x8f95, 0x8f95, 0x8f95, 0x8f95, 0x8f95, 0x080c, 0x0d7d, 0x9182,
+	0x0040, 0x0002, 0x8faa, 0x8faa, 0x8faa, 0x8faa, 0x8faa, 0x8faa,
+	0x8faa, 0x8faa, 0x8faa, 0x8fac, 0x8fbd, 0x8faa, 0x8faa, 0x8faa,
+	0x8faa, 0x8fce, 0x080c, 0x0d7d, 0x0096, 0x6114, 0x2148, 0xa87b,
+	0x0000, 0x6010, 0x00b6, 0x2058, 0xb8bb, 0x0500, 0x00be, 0x080c,
+	0x6b7b, 0x080c, 0xabdf, 0x009e, 0x0005, 0x080c, 0x9621, 0x00d6,
+	0x6114, 0x080c, 0xc832, 0x0130, 0x0096, 0x6114, 0x2148, 0x080c,
+	0x6d7b, 0x009e, 0x00de, 0x080c, 0xabdf, 0x0005, 0x080c, 0x9621,
+	0x080c, 0x31ef, 0x6114, 0x0096, 0x2148, 0x080c, 0xc832, 0x0120,
+	0xa87b, 0x0029, 0x080c, 0x6d7b, 0x009e, 0x080c, 0xabdf, 0x0005,
+	0x601b, 0x0000, 0x9182, 0x0040, 0x0096, 0x0002, 0x8ffb, 0x8ffb,
+	0x8ffb, 0x8ffb, 0x8ffb, 0x8ffb, 0x8ffb, 0x8ffb, 0x8ffd, 0x8ffb,
+	0x8ffb, 0x8ffb, 0x903f, 0x8ffb, 0x8ffb, 0x8ffb, 0x8ffb, 0x8ffb,
+	0x8ffb, 0x9003, 0x8ffb, 0x080c, 0x0d7d, 0x6114, 0x2148, 0xa938,
+	0x918e, 0xffff, 0x05e0, 0x00e6, 0x6114, 0x2148, 0x080c, 0x8db4,
+	0x0096, 0xa8a8, 0x2048, 0x080c, 0x6b13, 0x009e, 0xa8ab, 0x0000,
+	0x6010, 0x9005, 0x0128, 0x00b6, 0x2058, 0x080c, 0x8ee3, 0x00be,
+	0xae88, 0x00b6, 0x2059, 0x0000, 0x080c, 0x8ae7, 0x00be, 0x01e0,
+	0x2071, 0x193c, 0x080c, 0x8b2e, 0x01b8, 0x9086, 0x0001, 0x1128,
+	0x2001, 0x1946, 0x2004, 0x9005, 0x1178, 0x0096, 0x080c, 0x103a,
+	0x2900, 0x009e, 0x0148, 0xa8aa, 0x00f6, 0x2c78, 0x080c, 0x8aa5,
+	0x00fe, 0x00ee, 0x009e, 0x0005, 0x080c, 0x8ade, 0x0cd0, 0x080c,
+	0x90f7, 0x009e, 0x0005, 0x9182, 0x0040, 0x0096, 0x0002, 0x9057,
+	0x9057, 0x9057, 0x9059, 0x9057, 0x9057, 0x9057, 0x9079, 0x9057,
+	0x9057, 0x9057, 0x9057, 0x9057, 0x9057, 0x9057, 0x9057, 0x080c,
+	0x0d7d, 0x6003, 0x0003, 0x6106, 0x6014, 0x2048, 0xa8ac, 0xa836,
+	0xa8b0, 0xa83a, 0xa847, 0x0000, 0xa84b, 0x0000, 0xa884, 0x9092,
+	0x199a, 0x0210, 0x2001, 0x1999, 0x8003, 0x8013, 0x8213, 0x9210,
+	0x621a, 0x080c, 0x1bc7, 0x2009, 0x8030, 0x080c, 0x9247, 0x009e,
+	0x0005, 0x080c, 0x0d7d, 0x080c, 0x9621, 0x6114, 0x2148, 0xa87b,
+	0x0000, 0x6010, 0x00b6, 0x2058, 0xb8bb, 0x0500, 0x00be, 0x080c,
+	0x6d7b, 0x080c, 0xabdf, 0x009e, 0x0005, 0x080c, 0xa888, 0x6144,
+	0xd1fc, 0x0120, 0xd1ac, 0x1110, 0x6003, 0x0003, 0x6000, 0x908a,
+	0x0016, 0x1a0c, 0x0d7d, 0x0096, 0x0023, 0x009e, 0x080c, 0xa8a4,
+	0x0005, 0x90b1, 0x90b1, 0x90b1, 0x90b3, 0x90c4, 0x90b1, 0x90b1,
+	0x90b1, 0x90b1, 0x90b1, 0x90b1, 0x90b1, 0x90b1, 0x90b1, 0x90b1,
+	0x90b1, 0x080c, 0x0d7d, 0x080c, 0xaa1c, 0x6114, 0x2148, 0xa87b,
+	0x0006, 0x6010, 0x00b6, 0x2058, 0xb8bb, 0x0500, 0x00be, 0x080c,
+	0x6d7b, 0x080c, 0xabdf, 0x0005, 0x0491, 0x0005, 0x080c, 0xa888,
+	0x6000, 0x6144, 0xd1fc, 0x0130, 0xd1ac, 0x1120, 0x6003, 0x0003,
+	0x2009, 0x0003, 0x908a, 0x0016, 0x1a0c, 0x0d7d, 0x0096, 0x0033,
+	0x009e, 0x0106, 0x080c, 0xa8a4, 0x010e, 0x0005, 0x90ee, 0x90ee,
+	0x90ee, 0x90f0, 0x90f7, 0x90ee, 0x90ee, 0x90ee, 0x90ee, 0x90ee,
+	0x90ee, 0x90ee, 0x90ee, 0x90ee, 0x90ee, 0x90ee, 0x080c, 0x0d7d,
+	0x0036, 0x00e6, 0x080c, 0xaa1c, 0x00ee, 0x003e, 0x0005, 0x00f6,
+	0x00e6, 0x601b, 0x0000, 0x6014, 0x2048, 0x6010, 0x9005, 0x0128,
+	0x00b6, 0x2058, 0x080c, 0x8ee3, 0x00be, 0x2071, 0x193c, 0x080c,
+	0x8b2e, 0x0160, 0x2001, 0x187f, 0x2004, 0xa88a, 0x2031, 0x0000,
+	0x2c78, 0x080c, 0x8aa5, 0x00ee, 0x00fe, 0x0005, 0x0096, 0xa88b,
+	0x0000, 0xa8a8, 0x2048, 0x080c, 0x106c, 0x009e, 0xa8ab, 0x0000,
+	0x080c, 0x8ade, 0x0c80, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
+	0x0000, 0x0000, 0x0000, 0x0000, 0x187a, 0x0000, 0x0000, 0x0000,
+	0x0000, 0x0000, 0x0000, 0x0126, 0x2091, 0x8000, 0x0036, 0x0046,
+	0x20a9, 0x0010, 0x9006, 0x8004, 0x8086, 0x818e, 0x1208, 0x9200,
+	0x1f04, 0x913c, 0x8086, 0x818e, 0x004e, 0x003e, 0x012e, 0x0005,
+	0x0126, 0x2091, 0x8000, 0x0076, 0x0156, 0x20a9, 0x0010, 0x9005,
+	0x01c8, 0x911a, 0x12b8, 0x8213, 0x818d, 0x0228, 0x911a, 0x1220,
+	0x1f04, 0x9153, 0x0028, 0x911a, 0x2308, 0x8210, 0x1f04, 0x9153,
+	0x0006, 0x3200, 0x9084, 0xefff, 0x2080, 0x000e, 0x015e, 0x007e,
+	0x012e, 0x0005, 0x0006, 0x3200, 0x9085, 0x1000, 0x0ca8, 0x0126,
+	0x2091, 0x2800, 0x2079, 0x19e6, 0x012e, 0x00d6, 0x2069, 0x19e6,
+	0x6803, 0x0005, 0x0156, 0x0146, 0x01d6, 0x20e9, 0x0000, 0x2069,
+	0x0200, 0x080c, 0xa67d, 0x04a9, 0x080c, 0xa668, 0x0491, 0x080c,
+	0xa66b, 0x0479, 0x080c, 0xa66e, 0x0461, 0x080c, 0xa671, 0x0449,
+	0x080c, 0xa674, 0x0431, 0x080c, 0xa677, 0x0419, 0x080c, 0xa67a,
+	0x0401, 0x01de, 0x014e, 0x015e, 0x6857, 0x0000, 0x00f6, 0x2079,
+	0x0380, 0x00f9, 0x7807, 0x0003, 0x7803, 0x0000, 0x7803, 0x0001,
+	0x2069, 0x0004, 0x2d04, 0x9084, 0xfffe, 0x9085, 0x8000, 0x206a,
+	0x2069, 0x0100, 0x6828, 0x9084, 0xfffc, 0x682a, 0x00fe, 0x00de,
+	0x0005, 0x20a9, 0x0020, 0x20a1, 0x0240, 0x2001, 0x0000, 0x4004,
+	0x0005, 0x00c6, 0x7803, 0x0000, 0x9006, 0x7827, 0x0030, 0x782b,
+	0x0400, 0x7827, 0x0031, 0x782b, 0x1aee, 0x781f, 0xff00, 0x781b,
+	0xff00, 0x2061, 0x1ae3, 0x602f, 0x19e6, 0x6033, 0x1800, 0x6037,
+	0x1a02, 0x603b, 0x1e62, 0x603f, 0x1e72, 0x6042, 0x6047, 0x1ab9,
+	0x00ce, 0x0005, 0x2001, 0x0382, 0x2004, 0x9084, 0x0007, 0x9086,
+	0x0001, 0x01b0, 0x00c6, 0x6146, 0x600f, 0x0000, 0x2c08, 0x2061,
+	0x19e6, 0x602c, 0x8000, 0x602e, 0x601c, 0x9005, 0x0130, 0x9080,
+	0x0003, 0x2102, 0x611e, 0x00ce, 0x0005, 0x6122, 0x611e, 0x0cd8,
+	0x6146, 0x2c08, 0x2001, 0x0012, 0x080c, 0xa879, 0x0005, 0x0016,
+	0x2009, 0x8020, 0x6146, 0x2c08, 0x2001, 0x0382, 0x2004, 0x9084,
+	0x0007, 0x9086, 0x0001, 0x1128, 0x2001, 0x0019, 0x080c, 0xa879,
+	0x0088, 0x00c6, 0x2061, 0x19e6, 0x602c, 0x8000, 0x602e, 0x600c,
+	0x9005, 0x0128, 0x9080, 0x0003, 0x2102, 0x610e, 0x0010, 0x6112,
+	0x610e, 0x00ce, 0x001e, 0x0005, 0x2001, 0x0382, 0x2004, 0x9084,
+	0x0007, 0x9086, 0x0001, 0x0198, 0x00c6, 0x6146, 0x600f, 0x0000,
+	0x2c08, 0x2061, 0x19e6, 0x6044, 0x9005, 0x0130, 0x9080, 0x0003,
+	0x2102, 0x6146, 0x00ce, 0x0005, 0x614a, 0x6146, 0x0cd8, 0x6146,
+	0x600f, 0x0000, 0x2c08, 0x2001, 0x0013, 0x080c, 0xa879, 0x0005,
+	0x6044, 0xd0dc, 0x0110, 0x080c, 0xa31a, 0x0005, 0x00f6, 0x00e6,
+	0x00d6, 0x00c6, 0x00b6, 0x0096, 0x0076, 0x0066, 0x0056, 0x0036,
+	0x0026, 0x0016, 0x0006, 0x0126, 0x902e, 0x2071, 0x19e6, 0x7648,
+	0x2660, 0x2678, 0x2091, 0x8000, 0x8cff, 0x0904, 0x92d3, 0x6010,
+	0x2058, 0xb8a0, 0x9206, 0x1904, 0x92ce, 0x87ff, 0x0120, 0x605c,
+	0x9106, 0x1904, 0x92ce, 0x704c, 0x9c06, 0x1178, 0x0036, 0x2019,
+	0x0001, 0x080c, 0xa0fa, 0x703f, 0x0000, 0x9006, 0x704e, 0x706a,
+	0x7052, 0x706e, 0x003e, 0x2029, 0x0001, 0x0811, 0x7048, 0x9c36,
+	0x1110, 0x660c, 0x764a, 0x7044, 0x9c36, 0x1140, 0x2c00, 0x9f36,
+	0x0118, 0x2f00, 0x7046, 0x0010, 0x7047, 0x0000, 0x660c, 0x0066,
+	0x2c00, 0x9f06, 0x0110, 0x7e0e, 0x0008, 0x2678, 0x600f, 0x0000,
+	0x080c, 0xc832, 0x01f0, 0x6014, 0x2048, 0x6020, 0x9086, 0x0003,
+	0x1588, 0x6004, 0x9086, 0x0040, 0x090c, 0xa31a, 0xa867, 0x0103,
+	0xab7a, 0xa877, 0x0000, 0x0016, 0x0036, 0x0076, 0x080c, 0xcb35,
+	0x080c, 0xe631, 0x080c, 0x6d7b, 0x007e, 0x003e, 0x001e, 0x080c,
+	0xca21, 0x080c, 0xac1a, 0x00ce, 0x0804, 0x926c, 0x2c78, 0x600c,
+	0x2060, 0x0804, 0x926c, 0x012e, 0x000e, 0x001e, 0x002e, 0x003e,
+	0x005e, 0x006e, 0x007e, 0x009e, 0x00be, 0x00ce, 0x00de, 0x00ee,
+	0x00fe, 0x0005, 0x6020, 0x9086, 0x0006, 0x1158, 0x0016, 0x0036,
+	0x0076, 0x080c, 0xe631, 0x080c, 0xe27c, 0x007e, 0x003e, 0x001e,
+	0x08c0, 0x6020, 0x9086, 0x0009, 0x1168, 0xa87b, 0x0006, 0x0016,
+	0x0036, 0x0076, 0x080c, 0x6d7b, 0x080c, 0xabdf, 0x007e, 0x003e,
+	0x001e, 0x0848, 0x6020, 0x9086, 0x000a, 0x0904, 0x92b8, 0x0804,
+	0x92b1, 0x0006, 0x0066, 0x0096, 0x00c6, 0x00d6, 0x00f6, 0x9036,
+	0x0126, 0x2091, 0x8000, 0x2079, 0x19e6, 0x7848, 0x9065, 0x0904,
+	0x936d, 0x600c, 0x0006, 0x600f, 0x0000, 0x784c, 0x9c06, 0x11a0,
+	0x0036, 0x2019, 0x0001, 0x080c, 0xa0fa, 0x783f, 0x0000, 0x901e,
+	0x7b4e, 0x7b6a, 0x7b52, 0x7b6e, 0x003e, 0x000e, 0x9005, 0x1118,
+	0x600c, 0x600f, 0x0000, 0x0006, 0x00e6, 0x2f70, 0x080c, 0x9250,
+	0x00ee, 0x080c, 0xc832, 0x0548, 0x6014, 0x2048, 0x6020, 0x9086,
+	0x0003, 0x15a8, 0x3e08, 0x918e, 0x0002, 0x1188, 0x6010, 0x9005,
+	0x0170, 0x00b6, 0x2058, 0xb800, 0x00be, 0xd0bc, 0x0140, 0x6048,
+	0x9005, 0x11c0, 0x2001, 0x1987, 0x2004, 0x604a, 0x0098, 0x6004,
+	0x9086, 0x0040, 0x090c, 0xa31a, 0xa867, 0x0103, 0xab7a, 0xa877,
+	0x0000, 0x080c, 0x6d6f, 0x080c, 0xca21, 0x6044, 0xc0fc, 0x6046,
+	0x080c, 0xac1a, 0x000e, 0x0804, 0x9316, 0x7e4a, 0x7e46, 0x012e,
 	0x00fe, 0x00de, 0x00ce, 0x009e, 0x006e, 0x000e, 0x0005, 0x6020,
-	0x9086, 0x0006, 0x1118, 0x080c, 0xe26c, 0x0c38, 0x6020, 0x9086,
-	0x0009, 0x1130, 0xab7a, 0x080c, 0x6d80, 0x080c, 0xabed, 0x0c10,
-	0x6020, 0x9086, 0x000a, 0x0990, 0x0878, 0x0016, 0x0026, 0x0086,
-	0x9046, 0x00a9, 0x080c, 0x9496, 0x008e, 0x002e, 0x001e, 0x0005,
-	0x00f6, 0x0126, 0x2079, 0x19e7, 0x2091, 0x8000, 0x080c, 0x94df,
-	0x080c, 0x9573, 0x080c, 0x67b2, 0x012e, 0x00fe, 0x0005, 0x00b6,
+	0x9086, 0x0006, 0x1118, 0x080c, 0xe27c, 0x0c38, 0x6020, 0x9086,
+	0x0009, 0x1130, 0xab7a, 0x080c, 0x6d7b, 0x080c, 0xabdf, 0x0c10,
+	0x6020, 0x9086, 0x000a, 0x0990, 0x0850, 0x0016, 0x0026, 0x0086,
+	0x9046, 0x00a9, 0x080c, 0x947e, 0x008e, 0x002e, 0x001e, 0x0005,
+	0x00f6, 0x0126, 0x2079, 0x19e6, 0x2091, 0x8000, 0x080c, 0x94c7,
+	0x080c, 0x955b, 0x080c, 0x67ad, 0x012e, 0x00fe, 0x0005, 0x00b6,
 	0x0096, 0x00f6, 0x00e6, 0x00d6, 0x00c6, 0x0066, 0x0016, 0x0006,
-	0x0126, 0x2091, 0x8000, 0x2071, 0x19e7, 0x7620, 0x2660, 0x2678,
-	0x8cff, 0x0904, 0x945b, 0x6010, 0x2058, 0xb8a0, 0x9206, 0x1904,
-	0x9456, 0x88ff, 0x0120, 0x605c, 0x9106, 0x1904, 0x9456, 0x7030,
+	0x0126, 0x2091, 0x8000, 0x2071, 0x19e6, 0x7620, 0x2660, 0x2678,
+	0x8cff, 0x0904, 0x9443, 0x6010, 0x2058, 0xb8a0, 0x9206, 0x1904,
+	0x943e, 0x88ff, 0x0120, 0x605c, 0x9106, 0x1904, 0x943e, 0x7030,
 	0x9c06, 0x1570, 0x2069, 0x0100, 0x6820, 0xd0a4, 0x1508, 0x080c,
-	0x86f6, 0x080c, 0x9e32, 0x68c3, 0x0000, 0x080c, 0xa338, 0x7033,
+	0x86d5, 0x080c, 0x9e16, 0x68c3, 0x0000, 0x080c, 0xa31a, 0x7033,
 	0x0000, 0x0036, 0x2069, 0x0140, 0x6b04, 0x9384, 0x1000, 0x0138,
-	0x2001, 0x0100, 0x080c, 0x2a0a, 0x9006, 0x080c, 0x2a0a, 0x2069,
+	0x2001, 0x0100, 0x080c, 0x2a29, 0x9006, 0x080c, 0x2a29, 0x2069,
 	0x0100, 0x6824, 0xd084, 0x0110, 0x6827, 0x0001, 0x003e, 0x0040,
-	0x7008, 0xc0ad, 0x700a, 0x6003, 0x0009, 0x630a, 0x0804, 0x9456,
+	0x7008, 0xc0ad, 0x700a, 0x6003, 0x0009, 0x630a, 0x0804, 0x943e,
 	0x7020, 0x9c36, 0x1110, 0x660c, 0x7622, 0x701c, 0x9c36, 0x1140,
 	0x2c00, 0x9f36, 0x0118, 0x2f00, 0x701e, 0x0010, 0x701f, 0x0000,
 	0x660c, 0x0066, 0x2c00, 0x9f06, 0x0110, 0x7e0e, 0x0008, 0x2678,
 	0x600f, 0x0000, 0x6044, 0xc0fc, 0x6046, 0x6014, 0x2048, 0x080c,
-	0xc838, 0x01e8, 0x6020, 0x9086, 0x0003, 0x1580, 0x080c, 0xca4d,
-	0x1118, 0x080c, 0xb5b5, 0x0098, 0xa867, 0x0103, 0xab7a, 0xa877,
-	0x0000, 0x0016, 0x0036, 0x0086, 0x080c, 0xcb36, 0x080c, 0xe621,
-	0x080c, 0x6d80, 0x008e, 0x003e, 0x001e, 0x080c, 0xca27, 0x080c,
-	0xac28, 0x080c, 0xa20e, 0x00ce, 0x0804, 0x93d0, 0x2c78, 0x600c,
-	0x2060, 0x0804, 0x93d0, 0x012e, 0x000e, 0x001e, 0x006e, 0x00ce,
+	0xc832, 0x01e8, 0x6020, 0x9086, 0x0003, 0x1580, 0x080c, 0xca47,
+	0x1118, 0x080c, 0xb5a6, 0x0098, 0xa867, 0x0103, 0xab7a, 0xa877,
+	0x0000, 0x0016, 0x0036, 0x0086, 0x080c, 0xcb35, 0x080c, 0xe631,
+	0x080c, 0x6d7b, 0x008e, 0x003e, 0x001e, 0x080c, 0xca21, 0x080c,
+	0xac1a, 0x080c, 0xa1f0, 0x00ce, 0x0804, 0x93b8, 0x2c78, 0x600c,
+	0x2060, 0x0804, 0x93b8, 0x012e, 0x000e, 0x001e, 0x006e, 0x00ce,
 	0x00de, 0x00ee, 0x00fe, 0x009e, 0x00be, 0x0005, 0x6020, 0x9086,
-	0x0006, 0x1158, 0x0016, 0x0036, 0x0086, 0x080c, 0xe621, 0x080c,
-	0xe26c, 0x008e, 0x003e, 0x001e, 0x08d0, 0x080c, 0xb5b5, 0x6020,
+	0x0006, 0x1158, 0x0016, 0x0036, 0x0086, 0x080c, 0xe631, 0x080c,
+	0xe27c, 0x008e, 0x003e, 0x001e, 0x08d0, 0x080c, 0xb5a6, 0x6020,
 	0x9086, 0x0002, 0x1160, 0x6004, 0x0006, 0x9086, 0x0085, 0x000e,
-	0x0904, 0x943c, 0x9086, 0x008b, 0x0904, 0x943c, 0x0840, 0x6020,
+	0x0904, 0x9424, 0x9086, 0x008b, 0x0904, 0x9424, 0x0840, 0x6020,
 	0x9086, 0x0005, 0x1920, 0x6004, 0x0006, 0x9086, 0x0085, 0x000e,
-	0x09c8, 0x9086, 0x008b, 0x09b0, 0x0804, 0x944f, 0x0006, 0x00f6,
+	0x09c8, 0x9086, 0x008b, 0x09b0, 0x0804, 0x9437, 0x0006, 0x00f6,
 	0x00e6, 0x0096, 0x00b6, 0x00c6, 0x0066, 0x0016, 0x0126, 0x2091,
-	0x8000, 0x9280, 0x1000, 0x2004, 0x905d, 0x2079, 0x19e7, 0x9036,
+	0x8000, 0x9280, 0x1000, 0x2004, 0x905d, 0x2079, 0x19e6, 0x9036,
 	0x7828, 0x2060, 0x8cff, 0x0538, 0x6010, 0x9b06, 0x1500, 0x6043,
-	0xffff, 0x080c, 0xaa75, 0x01d8, 0x610c, 0x0016, 0x080c, 0x9fa2,
+	0xffff, 0x080c, 0xaa67, 0x01d8, 0x610c, 0x0016, 0x080c, 0x9f84,
 	0x6014, 0x2048, 0xa867, 0x0103, 0xab7a, 0xa877, 0x0000, 0x0016,
-	0x0036, 0x0086, 0x080c, 0xcb36, 0x080c, 0xe621, 0x080c, 0x6d80,
-	0x008e, 0x003e, 0x001e, 0x080c, 0xac28, 0x00ce, 0x08d8, 0x2c30,
-	0x600c, 0x2060, 0x08b8, 0x080c, 0x67cf, 0x012e, 0x001e, 0x006e,
+	0x0036, 0x0086, 0x080c, 0xcb35, 0x080c, 0xe631, 0x080c, 0x6d7b,
+	0x008e, 0x003e, 0x001e, 0x080c, 0xac1a, 0x00ce, 0x08d8, 0x2c30,
+	0x600c, 0x2060, 0x08b8, 0x080c, 0x67ca, 0x012e, 0x001e, 0x006e,
 	0x00ce, 0x00be, 0x009e, 0x00ee, 0x00fe, 0x000e, 0x0005, 0x0096,
 	0x0006, 0x0066, 0x00c6, 0x00d6, 0x9036, 0x7820, 0x9065, 0x0904,
-	0x9546, 0x600c, 0x0006, 0x6044, 0xc0fc, 0x6046, 0x600f, 0x0000,
+	0x952e, 0x600c, 0x0006, 0x6044, 0xc0fc, 0x6046, 0x600f, 0x0000,
 	0x7830, 0x9c06, 0x1588, 0x2069, 0x0100, 0x6820, 0xd0a4, 0x1508,
-	0x080c, 0x86f6, 0x080c, 0x9e32, 0x68c3, 0x0000, 0x080c, 0xa338,
+	0x080c, 0x86d5, 0x080c, 0x9e16, 0x68c3, 0x0000, 0x080c, 0xa31a,
 	0x7833, 0x0000, 0x0036, 0x2069, 0x0140, 0x6b04, 0x9384, 0x1000,
-	0x0138, 0x2001, 0x0100, 0x080c, 0x2a0a, 0x9006, 0x080c, 0x2a0a,
+	0x0138, 0x2001, 0x0100, 0x080c, 0x2a29, 0x9006, 0x080c, 0x2a29,
 	0x2069, 0x0100, 0x6824, 0xd084, 0x0110, 0x6827, 0x0001, 0x003e,
-	0x0058, 0x080c, 0x6a03, 0x1538, 0x6003, 0x0009, 0x630a, 0x7808,
-	0xc0ad, 0x780a, 0x2c30, 0x00f8, 0x6014, 0x2048, 0x080c, 0xc836,
-	0x01b0, 0x6020, 0x9086, 0x0003, 0x1508, 0x080c, 0xca4d, 0x1118,
-	0x080c, 0xb5b5, 0x0060, 0x080c, 0x6a03, 0x1168, 0xa867, 0x0103,
-	0xab7a, 0xa877, 0x0000, 0x080c, 0x6d80, 0x080c, 0xca27, 0x080c,
-	0xac28, 0x080c, 0xa20e, 0x000e, 0x0804, 0x94e6, 0x7e22, 0x7e1e,
+	0x0058, 0x080c, 0x6a02, 0x1538, 0x6003, 0x0009, 0x630a, 0x7808,
+	0xc0ad, 0x780a, 0x2c30, 0x00f8, 0x6014, 0x2048, 0x080c, 0xc830,
+	0x01b0, 0x6020, 0x9086, 0x0003, 0x1508, 0x080c, 0xca47, 0x1118,
+	0x080c, 0xb5a6, 0x0060, 0x080c, 0x6a02, 0x1168, 0xa867, 0x0103,
+	0xab7a, 0xa877, 0x0000, 0x080c, 0x6d7b, 0x080c, 0xca21, 0x080c,
+	0xac1a, 0x080c, 0xa1f0, 0x000e, 0x0804, 0x94ce, 0x7e22, 0x7e1e,
 	0x00de, 0x00ce, 0x006e, 0x000e, 0x009e, 0x0005, 0x6020, 0x9086,
-	0x0006, 0x1118, 0x080c, 0xe26c, 0x0c50, 0x080c, 0xb5b5, 0x6020,
+	0x0006, 0x1118, 0x080c, 0xe27c, 0x0c50, 0x080c, 0xb5a6, 0x6020,
 	0x9086, 0x0002, 0x1150, 0x6004, 0x0006, 0x9086, 0x0085, 0x000e,
 	0x0990, 0x9086, 0x008b, 0x0978, 0x08d0, 0x6020, 0x9086, 0x0005,
 	0x19b0, 0x6004, 0x0006, 0x9086, 0x0085, 0x000e, 0x0d18, 0x9086,
 	0x008b, 0x0d00, 0x0860, 0x0006, 0x0096, 0x00b6, 0x00c6, 0x0066,
 	0x9036, 0x7828, 0x9065, 0x0510, 0x6010, 0x2058, 0x600c, 0x0006,
 	0x3e08, 0x918e, 0x0002, 0x1118, 0xb800, 0xd0bc, 0x11a8, 0x6043,
-	0xffff, 0x080c, 0xaa75, 0x0180, 0x610c, 0x080c, 0x9fa2, 0x6014,
-	0x2048, 0xa867, 0x0103, 0xab7a, 0xa877, 0x0000, 0x080c, 0x6d80,
-	0x080c, 0xac28, 0x000e, 0x08f0, 0x2c30, 0x0ce0, 0x006e, 0x00ce,
+	0xffff, 0x080c, 0xaa67, 0x0180, 0x610c, 0x080c, 0x9f84, 0x6014,
+	0x2048, 0xa867, 0x0103, 0xab7a, 0xa877, 0x0000, 0x080c, 0x6d7b,
+	0x080c, 0xac1a, 0x000e, 0x08f0, 0x2c30, 0x0ce0, 0x006e, 0x00ce,
 	0x00be, 0x009e, 0x000e, 0x0005, 0x00e6, 0x00d6, 0x0096, 0x0066,
-	0x080c, 0x613b, 0x11b0, 0x2071, 0x19e7, 0x7030, 0x9080, 0x0005,
-	0x2004, 0x904d, 0x0170, 0xa878, 0x9606, 0x1158, 0x2071, 0x19e7,
+	0x080c, 0x6136, 0x11b0, 0x2071, 0x19e6, 0x7030, 0x9080, 0x0005,
+	0x2004, 0x904d, 0x0170, 0xa878, 0x9606, 0x1158, 0x2071, 0x19e6,
 	0x7030, 0x9035, 0x0130, 0x9080, 0x0005, 0x2004, 0x9906, 0x1108,
 	0x0029, 0x006e, 0x009e, 0x00de, 0x00ee, 0x0005, 0x00c6, 0x2660,
-	0x6043, 0xffff, 0x080c, 0xaa75, 0x0178, 0x080c, 0x9fa2, 0x6014,
-	0x2048, 0xa867, 0x0103, 0xab7a, 0xa877, 0x0000, 0x080c, 0xcb36,
-	0x080c, 0x6d80, 0x080c, 0xac28, 0x00ce, 0x0005, 0x00b6, 0x00e6,
-	0x00c6, 0x080c, 0xa8f4, 0x0106, 0x190c, 0xa896, 0x2071, 0x0101,
-	0x2e04, 0xc0c4, 0x2072, 0x6044, 0xd0fc, 0x1138, 0x010e, 0x190c,
-	0xa8b2, 0x00ce, 0x00ee, 0x00be, 0x0005, 0x2071, 0x19e7, 0x7030,
-	0x9005, 0x0da0, 0x9c06, 0x190c, 0x0d7d, 0x7036, 0x080c, 0x86f6,
-	0x7004, 0x9084, 0x0007, 0x0002, 0x960e, 0x9610, 0x9617, 0x9621,
-	0x962f, 0x960e, 0x9617, 0x960c, 0x080c, 0x0d7d, 0x0428, 0x0005,
-	0x080c, 0xaa60, 0x7007, 0x0000, 0x7033, 0x0000, 0x00e8, 0x0066,
-	0x9036, 0x080c, 0x9fa2, 0x006e, 0x7007, 0x0000, 0x7033, 0x0000,
-	0x0098, 0x080c, 0xaa4b, 0x0140, 0x080c, 0xaa60, 0x0128, 0x0066,
-	0x9036, 0x080c, 0x9fa2, 0x006e, 0x7033, 0x0000, 0x0028, 0x080c,
-	0xaa4b, 0x080c, 0xa338, 0x0000, 0x010e, 0x190c, 0xa8b2, 0x00ce,
-	0x00ee, 0x00be, 0x0005, 0x00d6, 0x00c6, 0x080c, 0xa8f4, 0x0106,
-	0x190c, 0xa896, 0x6044, 0xd0fc, 0x1130, 0x010e, 0x190c, 0xa8b2,
-	0x00ce, 0x00de, 0x0005, 0x2069, 0x19e7, 0x684c, 0x9005, 0x0da8,
-	0x9c06, 0x190c, 0x0d7d, 0x6852, 0x00e6, 0x2d70, 0x080c, 0x926e,
-	0x00ee, 0x080c, 0x8703, 0x0016, 0x2009, 0x0040, 0x080c, 0x21b0,
-	0x001e, 0x683c, 0x9084, 0x0003, 0x0002, 0x966b, 0x966c, 0x968a,
-	0x9669, 0x080c, 0x0d7d, 0x0460, 0x6868, 0x9086, 0x0001, 0x0190,
-	0x600c, 0x9015, 0x0160, 0x6a4a, 0x600f, 0x0000, 0x6044, 0xc0fc,
-	0x6046, 0x9006, 0x7042, 0x684e, 0x683f, 0x0000, 0x00c8, 0x684a,
-	0x6846, 0x0ca0, 0x686b, 0x0000, 0x6848, 0x9065, 0x0d78, 0x6003,
-	0x0002, 0x0c60, 0x9006, 0x686a, 0x6852, 0x686e, 0x600c, 0x9015,
-	0x0120, 0x6a4a, 0x600f, 0x0000, 0x0018, 0x684e, 0x684a, 0x6846,
-	0x684f, 0x0000, 0x010e, 0x190c, 0xa8b2, 0x00ce, 0x00de, 0x0005,
-	0x0005, 0x6020, 0x9084, 0x000f, 0x000b, 0x0005, 0x96b6, 0x96b9,
-	0x9b27, 0x9bb6, 0x96b9, 0x9b27, 0x9bb6, 0x96b6, 0x96b9, 0x96b6,
-	0x96b6, 0x96b6, 0x96b6, 0x96b6, 0x96b6, 0x96b6, 0x080c, 0x95de,
-	0x0005, 0x00b6, 0x0156, 0x0136, 0x0146, 0x01c6, 0x01d6, 0x00c6,
-	0x00d6, 0x00e6, 0x00f6, 0x2069, 0x0200, 0x2071, 0x0240, 0x6004,
-	0x908a, 0x0053, 0x1a0c, 0x0d7d, 0x6110, 0x2158, 0xb984, 0x2c78,
-	0x2061, 0x0100, 0x619a, 0x908a, 0x0040, 0x1a04, 0x9725, 0x005b,
-	0x00fe, 0x00ee, 0x00de, 0x00ce, 0x01de, 0x01ce, 0x014e, 0x013e,
-	0x015e, 0x00be, 0x0005, 0x98aa, 0x98e5, 0x990e, 0x99b6, 0x99d8,
-	0x99de, 0x99eb, 0x99f3, 0x99ff, 0x9a05, 0x9a16, 0x9a05, 0x9a6e,
-	0x99f3, 0x9a7a, 0x9a80, 0x99ff, 0x9a80, 0x9a8c, 0x9723, 0x9723,
-	0x9723, 0x9723, 0x9723, 0x9723, 0x9723, 0x9723, 0x9723, 0x9723,
-	0x9723, 0x9fc3, 0x9fe6, 0x9ff7, 0xa017, 0xa049, 0x99eb, 0x9723,
-	0x99eb, 0x9a05, 0x9723, 0x990e, 0x99b6, 0x9723, 0xa42b, 0x9a05,
-	0x9723, 0xa447, 0x9a05, 0x9723, 0x99ff, 0x98a4, 0x9746, 0x9723,
-	0xa463, 0xa4d0, 0xa5b0, 0x9723, 0xa5bd, 0x99e8, 0xa5e8, 0x9723,
-	0xa053, 0xa5f4, 0x9723, 0x080c, 0x0d7d, 0x2100, 0x005b, 0x00fe,
-	0x00ee, 0x00de, 0x00ce, 0x01de, 0x01ce, 0x014e, 0x013e, 0x015e,
-	0x00be, 0x0005, 0xa694, 0xa746, 0x9744, 0x976d, 0x9819, 0x9824,
-	0x9744, 0x99eb, 0x9744, 0x986b, 0x9877, 0x9788, 0x9744, 0x97a3,
-	0x97d7, 0xaacb, 0xab10, 0x9a05, 0x080c, 0x0d7d, 0x00d6, 0x0096,
-	0x080c, 0x9a9f, 0x7003, 0x2414, 0x7007, 0x0018, 0x700b, 0x0800,
-	0x7814, 0x2048, 0xa83c, 0x700e, 0xa850, 0x7022, 0xa854, 0x7026,
-	0x60c3, 0x0018, 0x080c, 0x9e02, 0x009e, 0x00de, 0x0005, 0x7810,
-	0x00b6, 0x2058, 0xb8a0, 0x00be, 0x080c, 0xab57, 0x1118, 0x9084,
-	0xff80, 0x0110, 0x9085, 0x0001, 0x0005, 0x00d6, 0x0096, 0x080c,
-	0x9a9f, 0x7003, 0x0500, 0x7814, 0x2048, 0xa874, 0x700a, 0xa878,
-	0x700e, 0xa87c, 0x7012, 0xa880, 0x7016, 0xa884, 0x701a, 0xa888,
-	0x701e, 0x60c3, 0x0010, 0x080c, 0x9e02, 0x009e, 0x00de, 0x0005,
-	0x00d6, 0x0096, 0x080c, 0x9a9f, 0x7003, 0x0500, 0x7814, 0x2048,
-	0xa8cc, 0x700a, 0xa8d0, 0x700e, 0xa8d4, 0x7012, 0xa8d8, 0x7016,
-	0xa8dc, 0x701a, 0xa8e0, 0x701e, 0x60c3, 0x0010, 0x080c, 0x9e02,
+	0x6043, 0xffff, 0x080c, 0xaa67, 0x0178, 0x080c, 0x9f84, 0x6014,
+	0x2048, 0xa867, 0x0103, 0xab7a, 0xa877, 0x0000, 0x080c, 0xcb35,
+	0x080c, 0x6d7b, 0x080c, 0xac1a, 0x00ce, 0x0005, 0x00b6, 0x00e6,
+	0x00c6, 0x080c, 0xa888, 0x0106, 0x2071, 0x0101, 0x2e04, 0xc0c4,
+	0x2072, 0x6044, 0xd0fc, 0x1138, 0x010e, 0x090c, 0xa8a4, 0x00ce,
+	0x00ee, 0x00be, 0x0005, 0x2071, 0x19e6, 0x7030, 0x9005, 0x0da0,
+	0x9c06, 0x190c, 0x0d7d, 0x7036, 0x080c, 0x86d5, 0x7004, 0x9084,
+	0x0007, 0x0002, 0x95f4, 0x95f6, 0x95fd, 0x9607, 0x9615, 0x95f4,
+	0x9602, 0x95f2, 0x080c, 0x0d7d, 0x0428, 0x0005, 0x080c, 0xaa52,
+	0x7007, 0x0000, 0x7033, 0x0000, 0x00e8, 0x0066, 0x9036, 0x080c,
+	0x9f84, 0x006e, 0x7007, 0x0000, 0x7033, 0x0000, 0x0098, 0x080c,
+	0xaa3d, 0x0140, 0x080c, 0xaa52, 0x0128, 0x0066, 0x9036, 0x080c,
+	0x9f84, 0x006e, 0x7033, 0x0000, 0x0028, 0x080c, 0xaa3d, 0x080c,
+	0xa31a, 0x0000, 0x010e, 0x190c, 0xa8a4, 0x00ce, 0x00ee, 0x00be,
+	0x0005, 0x00d6, 0x00c6, 0x080c, 0xa888, 0x0106, 0x6044, 0xd0fc,
+	0x1130, 0x010e, 0x090c, 0xa8a4, 0x00ce, 0x00de, 0x0005, 0x2069,
+	0x19e6, 0x684c, 0x9005, 0x0da8, 0x9c06, 0x190c, 0x0d7d, 0x6852,
+	0x00e6, 0x2d70, 0x080c, 0x9250, 0x00ee, 0x080c, 0x86e2, 0x0016,
+	0x2009, 0x0040, 0x080c, 0x21c1, 0x001e, 0x683c, 0x9084, 0x0003,
+	0x0002, 0x964f, 0x9650, 0x966e, 0x964d, 0x080c, 0x0d7d, 0x0460,
+	0x6868, 0x9086, 0x0001, 0x0190, 0x600c, 0x9015, 0x0160, 0x6a4a,
+	0x600f, 0x0000, 0x6044, 0xc0fc, 0x6046, 0x9006, 0x7042, 0x684e,
+	0x683f, 0x0000, 0x00c8, 0x684a, 0x6846, 0x0ca0, 0x686b, 0x0000,
+	0x6848, 0x9065, 0x0d78, 0x6003, 0x0002, 0x0c60, 0x9006, 0x686a,
+	0x6852, 0x686e, 0x600c, 0x9015, 0x0120, 0x6a4a, 0x600f, 0x0000,
+	0x0018, 0x684e, 0x684a, 0x6846, 0x684f, 0x0000, 0x010e, 0x190c,
+	0xa8a4, 0x00ce, 0x00de, 0x0005, 0x0005, 0x6020, 0x9084, 0x000f,
+	0x000b, 0x0005, 0x969a, 0x969d, 0x9b0b, 0x9b9a, 0x969d, 0x9b0b,
+	0x9b9a, 0x969a, 0x969d, 0x969a, 0x969a, 0x969a, 0x969a, 0x969a,
+	0x969a, 0x969a, 0x080c, 0x95c6, 0x0005, 0x00b6, 0x0156, 0x0136,
+	0x0146, 0x01c6, 0x01d6, 0x00c6, 0x00d6, 0x00e6, 0x00f6, 0x2069,
+	0x0200, 0x2071, 0x0240, 0x6004, 0x908a, 0x0053, 0x1a0c, 0x0d7d,
+	0x6110, 0x2158, 0xb984, 0x2c78, 0x2061, 0x0100, 0x619a, 0x908a,
+	0x0040, 0x1a04, 0x9709, 0x005b, 0x00fe, 0x00ee, 0x00de, 0x00ce,
+	0x01de, 0x01ce, 0x014e, 0x013e, 0x015e, 0x00be, 0x0005, 0x988e,
+	0x98c9, 0x98f2, 0x999a, 0x99bc, 0x99c2, 0x99cf, 0x99d7, 0x99e3,
+	0x99e9, 0x99fa, 0x99e9, 0x9a52, 0x99d7, 0x9a5e, 0x9a64, 0x99e3,
+	0x9a64, 0x9a70, 0x9707, 0x9707, 0x9707, 0x9707, 0x9707, 0x9707,
+	0x9707, 0x9707, 0x9707, 0x9707, 0x9707, 0x9fa5, 0x9fc8, 0x9fd9,
+	0x9ff9, 0xa02b, 0x99cf, 0x9707, 0x99cf, 0x99e9, 0x9707, 0x98f2,
+	0x999a, 0x9707, 0xa418, 0x99e9, 0x9707, 0xa434, 0x99e9, 0x9707,
+	0x99e3, 0x9888, 0x972a, 0x9707, 0xa450, 0xa4bd, 0xa59d, 0x9707,
+	0xa5aa, 0x99cc, 0xa5d5, 0x9707, 0xa035, 0xa5e1, 0x9707, 0x080c,
+	0x0d7d, 0x2100, 0x005b, 0x00fe, 0x00ee, 0x00de, 0x00ce, 0x01de,
+	0x01ce, 0x014e, 0x013e, 0x015e, 0x00be, 0x0005, 0xa681, 0xa733,
+	0x9728, 0x9751, 0x97fd, 0x9808, 0x9728, 0x99cf, 0x9728, 0x984f,
+	0x985b, 0x976c, 0x9728, 0x9787, 0x97bb, 0xaabd, 0xab02, 0x99e9,
+	0x080c, 0x0d7d, 0x00d6, 0x0096, 0x080c, 0x9a83, 0x7003, 0x2414,
+	0x7007, 0x0018, 0x700b, 0x0800, 0x7814, 0x2048, 0xa83c, 0x700e,
+	0xa850, 0x7022, 0xa854, 0x7026, 0x60c3, 0x0018, 0x080c, 0x9de6,
+	0x009e, 0x00de, 0x0005, 0x7810, 0x00b6, 0x2058, 0xb8a0, 0x00be,
+	0x080c, 0xab49, 0x1118, 0x9084, 0xff80, 0x0110, 0x9085, 0x0001,
+	0x0005, 0x00d6, 0x0096, 0x080c, 0x9a83, 0x7003, 0x0500, 0x7814,
+	0x2048, 0xa874, 0x700a, 0xa878, 0x700e, 0xa87c, 0x7012, 0xa880,
+	0x7016, 0xa884, 0x701a, 0xa888, 0x701e, 0x60c3, 0x0010, 0x080c,
+	0x9de6, 0x009e, 0x00de, 0x0005, 0x00d6, 0x0096, 0x080c, 0x9a83,
+	0x7003, 0x0500, 0x7814, 0x2048, 0xa8cc, 0x700a, 0xa8d0, 0x700e,
+	0xa8d4, 0x7012, 0xa8d8, 0x7016, 0xa8dc, 0x701a, 0xa8e0, 0x701e,
+	0x60c3, 0x0010, 0x080c, 0x9de6, 0x009e, 0x00de, 0x0005, 0x00d6,
+	0x0096, 0x0126, 0x2091, 0x8000, 0x080c, 0x9a83, 0x20e9, 0x0000,
+	0x2001, 0x19a2, 0x2003, 0x0000, 0x7814, 0x2048, 0xa814, 0x8003,
+	0x60c2, 0xa830, 0x20a8, 0xa860, 0x20e0, 0xa85c, 0x9080, 0x001b,
+	0x2098, 0x2001, 0x19a2, 0x0016, 0x200c, 0x2001, 0x0001, 0x080c,
+	0x21a6, 0x080c, 0xd5be, 0x9006, 0x080c, 0x21a6, 0x001e, 0xa804,
+	0x9005, 0x0110, 0x2048, 0x0c28, 0x04d9, 0x080c, 0x9de6, 0x012e,
 	0x009e, 0x00de, 0x0005, 0x00d6, 0x0096, 0x0126, 0x2091, 0x8000,
-	0x080c, 0x9a9f, 0x20e9, 0x0000, 0x2001, 0x19a3, 0x2003, 0x0000,
-	0x7814, 0x2048, 0xa814, 0x8003, 0x60c2, 0xa830, 0x20a8, 0xa860,
-	0x20e0, 0xa85c, 0x9080, 0x001b, 0x2098, 0x2001, 0x19a3, 0x0016,
-	0x200c, 0x2001, 0x0001, 0x080c, 0x2195, 0x080c, 0xd5b1, 0x9006,
-	0x080c, 0x2195, 0x001e, 0xa804, 0x9005, 0x0110, 0x2048, 0x0c28,
-	0x04d9, 0x080c, 0x9e02, 0x012e, 0x009e, 0x00de, 0x0005, 0x00d6,
-	0x0096, 0x0126, 0x2091, 0x8000, 0x080c, 0x9aea, 0x20e9, 0x0000,
-	0x2001, 0x19a3, 0x2003, 0x0000, 0x7814, 0x2048, 0xa86f, 0x0200,
-	0xa873, 0x0000, 0xa814, 0x8003, 0x60c2, 0xa830, 0x20a8, 0xa860,
-	0x20e0, 0xa85c, 0x9080, 0x001b, 0x2098, 0x2001, 0x19a3, 0x0016,
-	0x200c, 0x080c, 0xd5b1, 0x001e, 0xa804, 0x9005, 0x0110, 0x2048,
-	0x0c60, 0x0051, 0x7814, 0x2048, 0x080c, 0x0fec, 0x080c, 0x9e02,
-	0x012e, 0x009e, 0x00de, 0x0005, 0x60c0, 0x8004, 0x9084, 0x0003,
-	0x9005, 0x0130, 0x9082, 0x0004, 0x20a3, 0x0000, 0x8000, 0x1de0,
-	0x0005, 0x080c, 0x9a9f, 0x7003, 0x7800, 0x7808, 0x8007, 0x700a,
-	0x60c3, 0x0008, 0x0804, 0x9e02, 0x00d6, 0x00e6, 0x080c, 0x9aea,
-	0x7814, 0x9084, 0xff00, 0x2073, 0x0200, 0x8e70, 0x8e70, 0x9095,
-	0x0010, 0x2272, 0x8e70, 0x2073, 0x0034, 0x8e70, 0x2069, 0x1805,
-	0x20a9, 0x0004, 0x2d76, 0x8d68, 0x8e70, 0x1f04, 0x983a, 0x2069,
-	0x1801, 0x20a9, 0x0004, 0x2d76, 0x8d68, 0x8e70, 0x1f04, 0x9843,
-	0x2069, 0x19b3, 0x9086, 0xdf00, 0x0110, 0x2069, 0x19cd, 0x20a9,
-	0x001a, 0x9e86, 0x0260, 0x1148, 0x00c6, 0x2061, 0x0200, 0x6010,
-	0x8000, 0x6012, 0x00ce, 0x2071, 0x0240, 0x2d04, 0x8007, 0x2072,
-	0x8d68, 0x8e70, 0x1f04, 0x9851, 0x60c3, 0x004c, 0x080c, 0x9e02,
-	0x00ee, 0x00de, 0x0005, 0x080c, 0x9a9f, 0x7003, 0x6300, 0x7007,
-	0x0028, 0x7808, 0x700e, 0x60c3, 0x0008, 0x0804, 0x9e02, 0x00d6,
-	0x0026, 0x0016, 0x080c, 0x9aea, 0x7003, 0x0200, 0x7814, 0x700e,
-	0x00e6, 0x9ef0, 0x0004, 0x2009, 0x0001, 0x2011, 0x000c, 0x2069,
-	0x1923, 0x6810, 0xd084, 0x1148, 0x2073, 0x0500, 0x8e70, 0x2073,
-	0x0000, 0x8e70, 0x8108, 0x9290, 0x0004, 0x2073, 0x0800, 0x8e70,
-	0x2073, 0x0000, 0x00ee, 0x7206, 0x710a, 0x62c2, 0x080c, 0x9e02,
-	0x001e, 0x002e, 0x00de, 0x0005, 0x2001, 0x1818, 0x2004, 0x609a,
-	0x0804, 0x9e02, 0x080c, 0x9a9f, 0x7003, 0x5200, 0x2069, 0x1847,
-	0x6804, 0xd084, 0x0130, 0x6828, 0x0016, 0x080c, 0x262e, 0x710e,
-	0x001e, 0x20a9, 0x0004, 0x20e1, 0x0001, 0x2099, 0x1805, 0x20e9,
-	0x0000, 0x20a1, 0x0250, 0x4003, 0x20a9, 0x0004, 0x2099, 0x1801,
-	0x20a1, 0x0254, 0x4003, 0x080c, 0xab57, 0x1120, 0xb8a0, 0x9082,
-	0x007f, 0x0248, 0x2001, 0x181f, 0x2004, 0x7032, 0x2001, 0x1820,
-	0x2004, 0x7036, 0x0030, 0x2001, 0x1818, 0x2004, 0x9084, 0x00ff,
-	0x7036, 0x60c3, 0x001c, 0x0804, 0x9e02, 0x080c, 0x9a9f, 0x7003,
-	0x0500, 0x080c, 0xab57, 0x1120, 0xb8a0, 0x9082, 0x007f, 0x0248,
-	0x2001, 0x181f, 0x2004, 0x700a, 0x2001, 0x1820, 0x2004, 0x700e,
-	0x0030, 0x2001, 0x1818, 0x2004, 0x9084, 0x00ff, 0x700e, 0x20a9,
-	0x0004, 0x20e1, 0x0001, 0x2099, 0x1805, 0x20e9, 0x0000, 0x20a1,
-	0x0250, 0x4003, 0x60c3, 0x0010, 0x0804, 0x9e02, 0x080c, 0x9a9f,
-	0x9006, 0x080c, 0x6a35, 0xb8a0, 0x9086, 0x007e, 0x1130, 0x7003,
-	0x0400, 0x620c, 0xc2b4, 0x620e, 0x0058, 0x7814, 0x0096, 0x904d,
-	0x0120, 0x9006, 0xa89a, 0xa8a6, 0xa8aa, 0x009e, 0x7003, 0x0300,
-	0xb8a0, 0x9086, 0x007e, 0x1904, 0x997d, 0x00d6, 0x2069, 0x196c,
-	0x2001, 0x1837, 0x2004, 0xd0a4, 0x0188, 0x6800, 0x700a, 0x6808,
-	0x9084, 0x2000, 0x7012, 0x080c, 0xab6e, 0x680c, 0x7016, 0x701f,
-	0x2710, 0x6818, 0x7022, 0x681c, 0x7026, 0x0090, 0x6800, 0x700a,
-	0x6804, 0x700e, 0x6808, 0x080c, 0x74e9, 0x1118, 0x9084, 0x37ff,
-	0x0010, 0x9084, 0x3fff, 0x7012, 0x080c, 0xab6e, 0x680c, 0x7016,
-	0x00de, 0x20a9, 0x0004, 0x20e1, 0x0001, 0x2099, 0x1805, 0x20e9,
-	0x0000, 0x20a1, 0x0256, 0x4003, 0x20a9, 0x0004, 0x2099, 0x1801,
-	0x20a1, 0x025a, 0x4003, 0x00d6, 0x080c, 0xa67b, 0x2069, 0x1974,
-	0x2071, 0x024e, 0x6800, 0xc0dd, 0x7002, 0x080c, 0x56de, 0xd0e4,
-	0x0110, 0x680c, 0x700e, 0x00de, 0x04a8, 0x2001, 0x1837, 0x2004,
-	0xd0a4, 0x0170, 0x0016, 0x2001, 0x196d, 0x200c, 0x60e0, 0x9106,
-	0x0130, 0x2100, 0x60e3, 0x0000, 0x080c, 0x266f, 0x61e2, 0x001e,
-	0x20e1, 0x0001, 0x2099, 0x196c, 0x20e9, 0x0000, 0x20a1, 0x024e,
-	0x20a9, 0x0008, 0x4003, 0x20a9, 0x0004, 0x2099, 0x1805, 0x20a1,
-	0x0256, 0x4003, 0x20a9, 0x0004, 0x2099, 0x1801, 0x20a1, 0x025a,
-	0x4003, 0x080c, 0xa67b, 0x20a1, 0x024e, 0x20a9, 0x0008, 0x2099,
-	0x1974, 0x4003, 0x60c3, 0x0074, 0x0804, 0x9e02, 0x080c, 0x9a9f,
-	0x7003, 0x2010, 0x7007, 0x0014, 0x700b, 0x0800, 0x700f, 0x2000,
-	0x9006, 0x00f6, 0x2079, 0x1847, 0x7904, 0x00fe, 0xd1ac, 0x1110,
-	0x9085, 0x0020, 0xd1a4, 0x0110, 0x9085, 0x0010, 0x9085, 0x0002,
-	0x00d6, 0x0804, 0x9a4f, 0x7026, 0x60c3, 0x0014, 0x0804, 0x9e02,
-	0x080c, 0x9a9f, 0x7003, 0x5000, 0x0804, 0x9928, 0x080c, 0x9a9f,
-	0x7003, 0x2110, 0x7007, 0x0014, 0x60c3, 0x0014, 0x0804, 0x9e02,
-	0x080c, 0x9ae1, 0x0010, 0x080c, 0x9aea, 0x7003, 0x0200, 0x60c3,
-	0x0004, 0x0804, 0x9e02, 0x080c, 0x9aea, 0x7003, 0x0100, 0x700b,
-	0x0003, 0x700f, 0x2a00, 0x60c3, 0x0008, 0x0804, 0x9e02, 0x080c,
-	0x9aea, 0x7003, 0x0200, 0x0804, 0x9928, 0x080c, 0x9aea, 0x7003,
-	0x0100, 0x782c, 0x9005, 0x0110, 0x700a, 0x0010, 0x700b, 0x0003,
-	0x7814, 0x700e, 0x60c3, 0x0008, 0x0804, 0x9e02, 0x00d6, 0x080c,
-	0x9aea, 0x7003, 0x0210, 0x7007, 0x0014, 0x700b, 0x0800, 0xb894,
-	0x9086, 0x0014, 0x1198, 0xb99c, 0x9184, 0x0030, 0x0190, 0xb998,
-	0x9184, 0xc000, 0x1140, 0xd1ec, 0x0118, 0x700f, 0x2100, 0x0058,
-	0x700f, 0x0100, 0x0040, 0x700f, 0x0400, 0x0028, 0x700f, 0x0700,
-	0x0010, 0x700f, 0x0800, 0x00f6, 0x2079, 0x1847, 0x7904, 0x00fe,
-	0xd1ac, 0x1110, 0x9085, 0x0020, 0xd1a4, 0x0110, 0x9085, 0x0010,
-	0x2009, 0x1869, 0x210c, 0xd184, 0x1110, 0x9085, 0x0002, 0x0026,
-	0x2009, 0x1867, 0x210c, 0xd1e4, 0x0150, 0xc0c5, 0xbad4, 0xd28c,
-	0x1108, 0xc0cd, 0x9094, 0x0030, 0x9296, 0x0010, 0x0140, 0xd1ec,
-	0x0130, 0x9094, 0x0030, 0x9296, 0x0010, 0x0108, 0xc0bd, 0x002e,
-	0x7026, 0x60c3, 0x0014, 0x00de, 0x0804, 0x9e02, 0x080c, 0x9aea,
-	0x7003, 0x0210, 0x7007, 0x0014, 0x700f, 0x0100, 0x60c3, 0x0014,
-	0x0804, 0x9e02, 0x080c, 0x9aea, 0x7003, 0x0200, 0x0804, 0x98ae,
-	0x080c, 0x9aea, 0x7003, 0x0100, 0x700b, 0x0003, 0x700f, 0x2a00,
-	0x60c3, 0x0008, 0x0804, 0x9e02, 0x080c, 0x9aea, 0x7003, 0x0100,
-	0x700b, 0x000b, 0x60c3, 0x0008, 0x0804, 0x9e02, 0x0026, 0x00d6,
-	0x0036, 0x0046, 0x2019, 0x3200, 0x2021, 0x0800, 0x0040, 0x0026,
-	0x00d6, 0x0036, 0x0046, 0x2019, 0x2200, 0x2021, 0x0100, 0x080c,
-	0xa690, 0xb810, 0x9305, 0x7002, 0xb814, 0x7006, 0x2069, 0x1800,
-	0x687c, 0x700a, 0x6880, 0x700e, 0x9485, 0x0029, 0x7012, 0x004e,
-	0x003e, 0x00de, 0x080c, 0x9df6, 0x721a, 0x9f95, 0x0000, 0x7222,
-	0x7027, 0xffff, 0x2071, 0x024c, 0x002e, 0x0005, 0x0026, 0x080c,
-	0xa690, 0x7003, 0x02ff, 0x7007, 0xfffc, 0x00d6, 0x2069, 0x1800,
-	0x687c, 0x700a, 0x6880, 0x700e, 0x00de, 0x7013, 0x2029, 0x0c10,
-	0x7003, 0x0100, 0x7007, 0x0000, 0x700b, 0xfc02, 0x700f, 0x0000,
-	0x0005, 0x0026, 0x00d6, 0x0036, 0x0046, 0x2019, 0x3300, 0x2021,
-	0x0800, 0x0040, 0x0026, 0x00d6, 0x0036, 0x0046, 0x2019, 0x2300,
-	0x2021, 0x0100, 0x080c, 0xa690, 0xb810, 0x9305, 0x7002, 0xb814,
-	0x7006, 0x2069, 0x1800, 0xb810, 0x9005, 0x1140, 0xb814, 0x9005,
-	0x1128, 0x700b, 0x00ff, 0x700f, 0xfffe, 0x0020, 0x687c, 0x700a,
-	0x6880, 0x700e, 0x0000, 0x9485, 0x0098, 0x7012, 0x004e, 0x003e,
-	0x00de, 0x080c, 0x9df6, 0x721a, 0x7a08, 0x7222, 0x2f10, 0x7226,
-	0x2071, 0x024c, 0x002e, 0x0005, 0x080c, 0x9df6, 0x721a, 0x7a08,
-	0x7222, 0x7814, 0x7026, 0x2071, 0x024c, 0x002e, 0x0005, 0x00b6,
-	0x00c6, 0x00d6, 0x00e6, 0x00f6, 0x2069, 0x0200, 0x2071, 0x0240,
-	0x6004, 0x908a, 0x0085, 0x0a0c, 0x0d7d, 0x908a, 0x0092, 0x1a0c,
-	0x0d7d, 0x6110, 0x2158, 0xb984, 0x2c78, 0x2061, 0x0100, 0x619a,
-	0x9082, 0x0085, 0x0033, 0x00fe, 0x00ee, 0x00de, 0x00ce, 0x00be,
-	0x0005, 0x9b58, 0x9b67, 0x9b72, 0x9b56, 0x9b56, 0x9b56, 0x9b58,
-	0x9b56, 0x9b56, 0x9b56, 0x9b56, 0x9b56, 0x9b56, 0x080c, 0x0d7d,
-	0x0411, 0x60c3, 0x0000, 0x0026, 0x080c, 0x2979, 0x0228, 0x2011,
-	0x0101, 0x2204, 0xc0c5, 0x2012, 0x002e, 0x0804, 0x9e02, 0x0431,
-	0x7808, 0x700a, 0x7814, 0x700e, 0x7017, 0xffff, 0x60c3, 0x000c,
-	0x0804, 0x9e02, 0x0479, 0x7003, 0x0003, 0x7007, 0x0300, 0x60c3,
-	0x0004, 0x0804, 0x9e02, 0x0026, 0x080c, 0xa690, 0xb810, 0x9085,
-	0x8100, 0x7002, 0xb814, 0x7006, 0x2069, 0x1800, 0x687c, 0x700a,
-	0x6880, 0x700e, 0x7013, 0x0009, 0x0804, 0x9aba, 0x0026, 0x080c,
-	0xa690, 0xb810, 0x9085, 0x8400, 0x7002, 0xb814, 0x7006, 0x2069,
-	0x1800, 0x687c, 0x700a, 0x6880, 0x700e, 0x2001, 0x0099, 0x7012,
-	0x0804, 0x9b1c, 0x0026, 0x080c, 0xa690, 0xb810, 0x9085, 0x8500,
+	0x080c, 0x9ace, 0x20e9, 0x0000, 0x2001, 0x19a2, 0x2003, 0x0000,
+	0x7814, 0x2048, 0xa86f, 0x0200, 0xa873, 0x0000, 0xa814, 0x8003,
+	0x60c2, 0xa830, 0x20a8, 0xa860, 0x20e0, 0xa85c, 0x9080, 0x001b,
+	0x2098, 0x2001, 0x19a2, 0x0016, 0x200c, 0x080c, 0xd5be, 0x001e,
+	0xa804, 0x9005, 0x0110, 0x2048, 0x0c60, 0x0051, 0x7814, 0x2048,
+	0x080c, 0x0fec, 0x080c, 0x9de6, 0x012e, 0x009e, 0x00de, 0x0005,
+	0x60c0, 0x8004, 0x9084, 0x0003, 0x9005, 0x0130, 0x9082, 0x0004,
+	0x20a3, 0x0000, 0x8000, 0x1de0, 0x0005, 0x080c, 0x9a83, 0x7003,
+	0x7800, 0x7808, 0x8007, 0x700a, 0x60c3, 0x0008, 0x0804, 0x9de6,
+	0x00d6, 0x00e6, 0x080c, 0x9ace, 0x7814, 0x9084, 0xff00, 0x2073,
+	0x0200, 0x8e70, 0x8e70, 0x9095, 0x0010, 0x2272, 0x8e70, 0x2073,
+	0x0034, 0x8e70, 0x2069, 0x1805, 0x20a9, 0x0004, 0x2d76, 0x8d68,
+	0x8e70, 0x1f04, 0x981e, 0x2069, 0x1801, 0x20a9, 0x0004, 0x2d76,
+	0x8d68, 0x8e70, 0x1f04, 0x9827, 0x2069, 0x19b2, 0x9086, 0xdf00,
+	0x0110, 0x2069, 0x19cc, 0x20a9, 0x001a, 0x9e86, 0x0260, 0x1148,
+	0x00c6, 0x2061, 0x0200, 0x6010, 0x8000, 0x6012, 0x00ce, 0x2071,
+	0x0240, 0x2d04, 0x8007, 0x2072, 0x8d68, 0x8e70, 0x1f04, 0x9835,
+	0x60c3, 0x004c, 0x080c, 0x9de6, 0x00ee, 0x00de, 0x0005, 0x080c,
+	0x9a83, 0x7003, 0x6300, 0x7007, 0x0028, 0x7808, 0x700e, 0x60c3,
+	0x0008, 0x0804, 0x9de6, 0x00d6, 0x0026, 0x0016, 0x080c, 0x9ace,
+	0x7003, 0x0200, 0x7814, 0x700e, 0x00e6, 0x9ef0, 0x0004, 0x2009,
+	0x0001, 0x2011, 0x000c, 0x2069, 0x1923, 0x6810, 0xd084, 0x1148,
+	0x2073, 0x0500, 0x8e70, 0x2073, 0x0000, 0x8e70, 0x8108, 0x9290,
+	0x0004, 0x2073, 0x0800, 0x8e70, 0x2073, 0x0000, 0x00ee, 0x7206,
+	0x710a, 0x62c2, 0x080c, 0x9de6, 0x001e, 0x002e, 0x00de, 0x0005,
+	0x2001, 0x1818, 0x2004, 0x609a, 0x0804, 0x9de6, 0x080c, 0x9a83,
+	0x7003, 0x5200, 0x2069, 0x1847, 0x6804, 0xd084, 0x0130, 0x6828,
+	0x0016, 0x080c, 0x2647, 0x710e, 0x001e, 0x20a9, 0x0004, 0x20e1,
+	0x0001, 0x2099, 0x1805, 0x20e9, 0x0000, 0x20a1, 0x0250, 0x4003,
+	0x20a9, 0x0004, 0x2099, 0x1801, 0x20a1, 0x0254, 0x4003, 0x080c,
+	0xab49, 0x1120, 0xb8a0, 0x9082, 0x007f, 0x0248, 0x2001, 0x181f,
+	0x2004, 0x7032, 0x2001, 0x1820, 0x2004, 0x7036, 0x0030, 0x2001,
+	0x1818, 0x2004, 0x9084, 0x00ff, 0x7036, 0x60c3, 0x001c, 0x0804,
+	0x9de6, 0x080c, 0x9a83, 0x7003, 0x0500, 0x080c, 0xab49, 0x1120,
+	0xb8a0, 0x9082, 0x007f, 0x0248, 0x2001, 0x181f, 0x2004, 0x700a,
+	0x2001, 0x1820, 0x2004, 0x700e, 0x0030, 0x2001, 0x1818, 0x2004,
+	0x9084, 0x00ff, 0x700e, 0x20a9, 0x0004, 0x20e1, 0x0001, 0x2099,
+	0x1805, 0x20e9, 0x0000, 0x20a1, 0x0250, 0x4003, 0x60c3, 0x0010,
+	0x0804, 0x9de6, 0x080c, 0x9a83, 0x9006, 0x080c, 0x6a34, 0xb8a0,
+	0x9086, 0x007e, 0x1130, 0x7003, 0x0400, 0x620c, 0xc2b4, 0x620e,
+	0x0058, 0x7814, 0x0096, 0x904d, 0x0120, 0x9006, 0xa89a, 0xa8a6,
+	0xa8aa, 0x009e, 0x7003, 0x0300, 0xb8a0, 0x9086, 0x007e, 0x1904,
+	0x9961, 0x00d6, 0x2069, 0x196b, 0x2001, 0x1837, 0x2004, 0xd0a4,
+	0x0188, 0x6800, 0x700a, 0x6808, 0x9084, 0x2000, 0x7012, 0x080c,
+	0xab60, 0x680c, 0x7016, 0x701f, 0x2710, 0x6818, 0x7022, 0x681c,
+	0x7026, 0x0090, 0x6800, 0x700a, 0x6804, 0x700e, 0x6808, 0x080c,
+	0x74c8, 0x1118, 0x9084, 0x37ff, 0x0010, 0x9084, 0x3fff, 0x7012,
+	0x080c, 0xab60, 0x680c, 0x7016, 0x00de, 0x20a9, 0x0004, 0x20e1,
+	0x0001, 0x2099, 0x1805, 0x20e9, 0x0000, 0x20a1, 0x0256, 0x4003,
+	0x20a9, 0x0004, 0x2099, 0x1801, 0x20a1, 0x025a, 0x4003, 0x00d6,
+	0x080c, 0xa668, 0x2069, 0x1973, 0x2071, 0x024e, 0x6800, 0xc0dd,
+	0x7002, 0x080c, 0x56d9, 0xd0e4, 0x0110, 0x680c, 0x700e, 0x00de,
+	0x04a8, 0x2001, 0x1837, 0x2004, 0xd0a4, 0x0170, 0x0016, 0x2001,
+	0x196c, 0x200c, 0x60e0, 0x9106, 0x0130, 0x2100, 0x60e3, 0x0000,
+	0x080c, 0x2688, 0x61e2, 0x001e, 0x20e1, 0x0001, 0x2099, 0x196b,
+	0x20e9, 0x0000, 0x20a1, 0x024e, 0x20a9, 0x0008, 0x4003, 0x20a9,
+	0x0004, 0x2099, 0x1805, 0x20a1, 0x0256, 0x4003, 0x20a9, 0x0004,
+	0x2099, 0x1801, 0x20a1, 0x025a, 0x4003, 0x080c, 0xa668, 0x20a1,
+	0x024e, 0x20a9, 0x0008, 0x2099, 0x1973, 0x4003, 0x60c3, 0x0074,
+	0x0804, 0x9de6, 0x080c, 0x9a83, 0x7003, 0x2010, 0x7007, 0x0014,
+	0x700b, 0x0800, 0x700f, 0x2000, 0x9006, 0x00f6, 0x2079, 0x1847,
+	0x7904, 0x00fe, 0xd1ac, 0x1110, 0x9085, 0x0020, 0xd1a4, 0x0110,
+	0x9085, 0x0010, 0x9085, 0x0002, 0x00d6, 0x0804, 0x9a33, 0x7026,
+	0x60c3, 0x0014, 0x0804, 0x9de6, 0x080c, 0x9a83, 0x7003, 0x5000,
+	0x0804, 0x990c, 0x080c, 0x9a83, 0x7003, 0x2110, 0x7007, 0x0014,
+	0x60c3, 0x0014, 0x0804, 0x9de6, 0x080c, 0x9ac5, 0x0010, 0x080c,
+	0x9ace, 0x7003, 0x0200, 0x60c3, 0x0004, 0x0804, 0x9de6, 0x080c,
+	0x9ace, 0x7003, 0x0100, 0x700b, 0x0003, 0x700f, 0x2a00, 0x60c3,
+	0x0008, 0x0804, 0x9de6, 0x080c, 0x9ace, 0x7003, 0x0200, 0x0804,
+	0x990c, 0x080c, 0x9ace, 0x7003, 0x0100, 0x782c, 0x9005, 0x0110,
+	0x700a, 0x0010, 0x700b, 0x0003, 0x7814, 0x700e, 0x60c3, 0x0008,
+	0x0804, 0x9de6, 0x00d6, 0x080c, 0x9ace, 0x7003, 0x0210, 0x7007,
+	0x0014, 0x700b, 0x0800, 0xb894, 0x9086, 0x0014, 0x1198, 0xb99c,
+	0x9184, 0x0030, 0x0190, 0xb998, 0x9184, 0xc000, 0x1140, 0xd1ec,
+	0x0118, 0x700f, 0x2100, 0x0058, 0x700f, 0x0100, 0x0040, 0x700f,
+	0x0400, 0x0028, 0x700f, 0x0700, 0x0010, 0x700f, 0x0800, 0x00f6,
+	0x2079, 0x1847, 0x7904, 0x00fe, 0xd1ac, 0x1110, 0x9085, 0x0020,
+	0xd1a4, 0x0110, 0x9085, 0x0010, 0x2009, 0x1869, 0x210c, 0xd184,
+	0x1110, 0x9085, 0x0002, 0x0026, 0x2009, 0x1867, 0x210c, 0xd1e4,
+	0x0150, 0xc0c5, 0xbad4, 0xd28c, 0x1108, 0xc0cd, 0x9094, 0x0030,
+	0x9296, 0x0010, 0x0140, 0xd1ec, 0x0130, 0x9094, 0x0030, 0x9296,
+	0x0010, 0x0108, 0xc0bd, 0x002e, 0x7026, 0x60c3, 0x0014, 0x00de,
+	0x0804, 0x9de6, 0x080c, 0x9ace, 0x7003, 0x0210, 0x7007, 0x0014,
+	0x700f, 0x0100, 0x60c3, 0x0014, 0x0804, 0x9de6, 0x080c, 0x9ace,
+	0x7003, 0x0200, 0x0804, 0x9892, 0x080c, 0x9ace, 0x7003, 0x0100,
+	0x700b, 0x0003, 0x700f, 0x2a00, 0x60c3, 0x0008, 0x0804, 0x9de6,
+	0x080c, 0x9ace, 0x7003, 0x0100, 0x700b, 0x000b, 0x60c3, 0x0008,
+	0x0804, 0x9de6, 0x0026, 0x00d6, 0x0036, 0x0046, 0x2019, 0x3200,
+	0x2021, 0x0800, 0x0040, 0x0026, 0x00d6, 0x0036, 0x0046, 0x2019,
+	0x2200, 0x2021, 0x0100, 0x080c, 0xa67d, 0xb810, 0x9305, 0x7002,
+	0xb814, 0x7006, 0x2069, 0x1800, 0x687c, 0x700a, 0x6880, 0x700e,
+	0x9485, 0x0029, 0x7012, 0x004e, 0x003e, 0x00de, 0x080c, 0x9dda,
+	0x721a, 0x9f95, 0x0000, 0x7222, 0x7027, 0xffff, 0x2071, 0x024c,
+	0x002e, 0x0005, 0x0026, 0x080c, 0xa67d, 0x7003, 0x02ff, 0x7007,
+	0xfffc, 0x00d6, 0x2069, 0x1800, 0x687c, 0x700a, 0x6880, 0x700e,
+	0x00de, 0x7013, 0x2029, 0x0c10, 0x7003, 0x0100, 0x7007, 0x0000,
+	0x700b, 0xfc02, 0x700f, 0x0000, 0x0005, 0x0026, 0x00d6, 0x0036,
+	0x0046, 0x2019, 0x3300, 0x2021, 0x0800, 0x0040, 0x0026, 0x00d6,
+	0x0036, 0x0046, 0x2019, 0x2300, 0x2021, 0x0100, 0x080c, 0xa67d,
+	0xb810, 0x9305, 0x7002, 0xb814, 0x7006, 0x2069, 0x1800, 0xb810,
+	0x9005, 0x1140, 0xb814, 0x9005, 0x1128, 0x700b, 0x00ff, 0x700f,
+	0xfffe, 0x0020, 0x687c, 0x700a, 0x6880, 0x700e, 0x0000, 0x9485,
+	0x0098, 0x7012, 0x004e, 0x003e, 0x00de, 0x080c, 0x9dda, 0x721a,
+	0x7a08, 0x7222, 0x2f10, 0x7226, 0x2071, 0x024c, 0x002e, 0x0005,
+	0x080c, 0x9dda, 0x721a, 0x7a08, 0x7222, 0x7814, 0x7026, 0x2071,
+	0x024c, 0x002e, 0x0005, 0x00b6, 0x00c6, 0x00d6, 0x00e6, 0x00f6,
+	0x2069, 0x0200, 0x2071, 0x0240, 0x6004, 0x908a, 0x0085, 0x0a0c,
+	0x0d7d, 0x908a, 0x0092, 0x1a0c, 0x0d7d, 0x6110, 0x2158, 0xb984,
+	0x2c78, 0x2061, 0x0100, 0x619a, 0x9082, 0x0085, 0x0033, 0x00fe,
+	0x00ee, 0x00de, 0x00ce, 0x00be, 0x0005, 0x9b3c, 0x9b4b, 0x9b56,
+	0x9b3a, 0x9b3a, 0x9b3a, 0x9b3c, 0x9b3a, 0x9b3a, 0x9b3a, 0x9b3a,
+	0x9b3a, 0x9b3a, 0x080c, 0x0d7d, 0x0411, 0x60c3, 0x0000, 0x0026,
+	0x080c, 0x2998, 0x0228, 0x2011, 0x0101, 0x2204, 0xc0c5, 0x2012,
+	0x002e, 0x0804, 0x9de6, 0x0431, 0x7808, 0x700a, 0x7814, 0x700e,
+	0x7017, 0xffff, 0x60c3, 0x000c, 0x0804, 0x9de6, 0x0479, 0x7003,
+	0x0003, 0x7007, 0x0300, 0x60c3, 0x0004, 0x0804, 0x9de6, 0x0026,
+	0x080c, 0xa67d, 0xb810, 0x9085, 0x8100, 0x7002, 0xb814, 0x7006,
+	0x2069, 0x1800, 0x687c, 0x700a, 0x6880, 0x700e, 0x7013, 0x0009,
+	0x0804, 0x9a9e, 0x0026, 0x080c, 0xa67d, 0xb810, 0x9085, 0x8400,
 	0x7002, 0xb814, 0x7006, 0x2069, 0x1800, 0x687c, 0x700a, 0x6880,
-	0x700e, 0x2001, 0x0099, 0x7012, 0x0804, 0x9b1c, 0x00b6, 0x00c6,
-	0x00d6, 0x00e6, 0x00f6, 0x2c78, 0x2069, 0x0200, 0x2071, 0x0240,
-	0x7804, 0x908a, 0x0040, 0x0a0c, 0x0d7d, 0x908a, 0x0057, 0x1a0c,
-	0x0d7d, 0x7910, 0x2158, 0xb984, 0x2061, 0x0100, 0x619a, 0x9082,
-	0x0040, 0x0033, 0x00fe, 0x00ee, 0x00de, 0x00ce, 0x00be, 0x0005,
-	0x9beb, 0x9beb, 0x9beb, 0x9c11, 0x9beb, 0x9beb, 0x9beb, 0x9beb,
-	0x9beb, 0x9beb, 0x9beb, 0xa1eb, 0xa1f3, 0xa1fb, 0xa203, 0x9beb,
-	0x9beb, 0x9beb, 0xa1e3, 0x080c, 0x0d7d, 0x6813, 0x0008, 0xba8c,
-	0x8210, 0xb8d4, 0xd084, 0x0128, 0x7a4e, 0x7b14, 0x7b52, 0x722e,
-	0x732a, 0x9294, 0x00ff, 0xba8e, 0x8217, 0x721a, 0xba10, 0x9295,
-	0x0600, 0x7202, 0xba14, 0x7206, 0x2069, 0x1800, 0x6a7c, 0x720a,
-	0x6a80, 0x720e, 0x7013, 0x0829, 0x2f10, 0x7222, 0x7027, 0xffff,
-	0x0005, 0x0016, 0x7814, 0x9084, 0x0700, 0x8007, 0x0013, 0x001e,
-	0x0005, 0x9c21, 0x9c21, 0x9c23, 0x9c21, 0x9c21, 0x9c21, 0x9c3d,
-	0x9c21, 0x080c, 0x0d7d, 0x7914, 0x918c, 0x08ff, 0x918d, 0xf600,
-	0x7916, 0x2009, 0x0003, 0x00b9, 0x2069, 0x1847, 0x6804, 0xd0bc,
-	0x0130, 0x682c, 0x9084, 0x00ff, 0x8007, 0x7032, 0x0010, 0x7033,
-	0x3f00, 0x60c3, 0x0001, 0x0804, 0x9e02, 0x2009, 0x0003, 0x0019,
-	0x7033, 0x7f00, 0x0cb0, 0x0016, 0x080c, 0xa690, 0x001e, 0xb810,
-	0x9085, 0x0100, 0x7002, 0xb814, 0x7006, 0x2069, 0x1800, 0x6a7c,
-	0x720a, 0x6a80, 0x720e, 0x7013, 0x0888, 0x918d, 0x0008, 0x7116,
-	0x080c, 0x9df6, 0x721a, 0x7a08, 0x7222, 0x2f10, 0x7226, 0x0005,
-	0x00b6, 0x00e6, 0x00d6, 0x00c6, 0x0066, 0x0056, 0x0046, 0x0036,
-	0x2061, 0x0100, 0x2071, 0x1800, 0x7160, 0x7810, 0x2058, 0x76dc,
-	0x96b4, 0x0028, 0x0110, 0x737c, 0x7480, 0x2500, 0x76dc, 0x96b4,
-	0x0028, 0x0140, 0x2001, 0x04ff, 0x6062, 0x6067, 0xffff, 0x636a,
-	0x646e, 0x0050, 0x2001, 0x00ff, 0x9085, 0x0400, 0x6062, 0x6067,
-	0xffff, 0x606b, 0x0000, 0x616e, 0xb8b8, 0x6073, 0x0530, 0x6077,
-	0x0008, 0xb88c, 0x8000, 0x9084, 0x00ff, 0xb88e, 0x8007, 0x9085,
-	0x0020, 0x607a, 0x607f, 0x0000, 0x2b00, 0x6082, 0x6087, 0xffff,
-	0x7814, 0x0096, 0x2048, 0xa848, 0x608a, 0xa844, 0x608e, 0xa838,
-	0x60c6, 0xa834, 0x60ca, 0x009e, 0xb86c, 0x60ce, 0x60ab, 0x0036,
-	0x60af, 0x95d5, 0x60d7, 0x0000, 0x2001, 0x1837, 0x2004, 0x9084,
-	0x0028, 0x0128, 0x609f, 0x0000, 0x2001, 0x0092, 0x0058, 0x6028,
-	0xc0bd, 0x602a, 0x609f, 0x00ff, 0x2011, 0xffff, 0x080c, 0x2a44,
-	0x2001, 0x00b2, 0x2010, 0x900e, 0x080c, 0x2a53, 0x2009, 0x07d0,
-	0x080c, 0x86fb, 0x003e, 0x004e, 0x005e, 0x006e, 0x00ce, 0x00de,
-	0x00ee, 0x00be, 0x0005, 0x00b6, 0x00e6, 0x00d6, 0x00c6, 0x0066,
-	0x0056, 0x0046, 0x0036, 0x2061, 0x0100, 0x2071, 0x1800, 0x7160,
-	0x7810, 0x2058, 0xb8a0, 0x2028, 0x76dc, 0xd6ac, 0x1168, 0x9582,
-	0x007e, 0x1250, 0x2500, 0x9094, 0xff80, 0x1130, 0x9080, 0x3374,
-	0x2015, 0x9294, 0x00ff, 0x0020, 0xb910, 0xba14, 0x737c, 0x7480,
-	0x70dc, 0xd0ac, 0x1130, 0x9582, 0x007e, 0x1218, 0x9584, 0xff80,
-	0x0138, 0x9185, 0x0400, 0x6062, 0x6266, 0x636a, 0x646e, 0x0030,
-	0x6063, 0x0400, 0x6266, 0x606b, 0x0000, 0x616e, 0xb8b8, 0x6072,
-	0x6077, 0x0000, 0xb864, 0xd0a4, 0x0110, 0x6077, 0x0008, 0xb88c,
-	0x8000, 0x9084, 0x00ff, 0xb88e, 0x8007, 0x9085, 0x0020, 0x607a,
-	0x607f, 0x0000, 0x2b00, 0x6082, 0x6087, 0xffff, 0x7814, 0x0096,
-	0x2048, 0xa848, 0x608a, 0xa844, 0x608e, 0xa838, 0x60c6, 0xa834,
-	0x60ca, 0x009e, 0xb86c, 0x60ce, 0x60ab, 0x0036, 0x60af, 0x95d5,
-	0x60d7, 0x0000, 0xba84, 0x629e, 0x00f6, 0x2079, 0x0140, 0x7803,
-	0x0000, 0x00fe, 0x900e, 0x2011, 0x0092, 0x080c, 0x2a53, 0x2009,
-	0x07d0, 0x080c, 0x86fb, 0x003e, 0x004e, 0x005e, 0x006e, 0x00ce,
-	0x00de, 0x00ee, 0x00be, 0x0005, 0x00b6, 0x0096, 0x00e6, 0x00d6,
-	0x00c6, 0x0056, 0x0046, 0x0036, 0x2061, 0x0100, 0x2071, 0x1800,
-	0x7810, 0x2058, 0xb8a0, 0x2028, 0xb910, 0xba14, 0x737c, 0x7480,
-	0x7820, 0x0002, 0x9d81, 0x9d81, 0x9d81, 0x9d81, 0x9d81, 0x9d81,
-	0x9d81, 0x9d81, 0x9d81, 0x9d81, 0x9d83, 0x9d81, 0x9d81, 0x9d81,
-	0x9d81, 0x080c, 0x0d7d, 0xb884, 0x609e, 0x7814, 0x2048, 0xa87c,
-	0xd0fc, 0x0558, 0xaf90, 0x9784, 0xff00, 0x9105, 0x6062, 0x873f,
-	0x9784, 0xff00, 0x0006, 0x7814, 0x2048, 0xa878, 0xc0fc, 0x9005,
-	0x000e, 0x1160, 0xaf94, 0x87ff, 0x0198, 0x2039, 0x0098, 0x9705,
-	0x6072, 0x7808, 0x6082, 0x2f00, 0x6086, 0x0038, 0x9185, 0x2200,
-	0x6062, 0x6073, 0x0129, 0x6077, 0x0000, 0xb884, 0x609e, 0x0050,
-	0x2039, 0x0029, 0x9705, 0x6072, 0x0cc0, 0x9185, 0x0200, 0x6062,
-	0x6073, 0x2029, 0xa87c, 0xd0fc, 0x0118, 0xaf94, 0x87ff, 0x1120,
-	0x2f00, 0x6082, 0x7808, 0x6086, 0x6266, 0x636a, 0x646e, 0x6077,
-	0x0000, 0xb88c, 0x8000, 0x9084, 0x00ff, 0xb88e, 0x8007, 0x607a,
-	0x607f, 0x0000, 0xa848, 0x608a, 0xa844, 0x608e, 0xa838, 0x60c6,
-	0xa834, 0x60ca, 0xb86c, 0x60ce, 0x60af, 0x95d5, 0x60d7, 0x0000,
-	0x080c, 0xa670, 0x2009, 0x07d0, 0x60c4, 0x9084, 0xfff0, 0x9005,
-	0x0110, 0x2009, 0x1b58, 0x080c, 0x86fb, 0x003e, 0x004e, 0x005e,
-	0x00ce, 0x00de, 0x00ee, 0x009e, 0x00be, 0x0005, 0x7a40, 0x9294,
-	0x00ff, 0x8217, 0x0005, 0x00d6, 0x2069, 0x19e7, 0x686b, 0x0001,
-	0x00de, 0x0005, 0x60a3, 0x0056, 0x60a7, 0x9575, 0x00f1, 0x080c,
-	0x86ed, 0x0005, 0x0016, 0x2001, 0x180c, 0x200c, 0x9184, 0x0600,
-	0x9086, 0x0600, 0x0128, 0x0089, 0x080c, 0x86ed, 0x001e, 0x0005,
-	0xc1e5, 0x2001, 0x180c, 0x2102, 0x2001, 0x19e8, 0x2003, 0x0000,
-	0x2001, 0x19f3, 0x2003, 0x0000, 0x0c88, 0x0006, 0x0016, 0x0026,
-	0x2009, 0x1804, 0x2011, 0x0009, 0x080c, 0x2a53, 0x002e, 0x001e,
-	0x000e, 0x0005, 0x0016, 0x00c6, 0x0006, 0x080c, 0xa8f4, 0x0106,
-	0x190c, 0xa896, 0x2061, 0x0100, 0x61a4, 0x60a7, 0x95f5, 0x0016,
-	0x0026, 0x2009, 0x1804, 0x2011, 0x0008, 0x080c, 0x2a53, 0x002e,
-	0x001e, 0x010e, 0x190c, 0xa8b2, 0x000e, 0xa001, 0xa001, 0xa001,
-	0x61a6, 0x00ce, 0x001e, 0x0005, 0x00c6, 0x00d6, 0x0016, 0x0026,
-	0x2061, 0x0100, 0x2069, 0x0140, 0x080c, 0x74e9, 0x1510, 0x2001,
-	0x1a0c, 0x2004, 0x9005, 0x1904, 0x9eb3, 0x080c, 0x758a, 0x11a8,
-	0x2069, 0x0380, 0x6843, 0x0101, 0x6844, 0xd084, 0x1de8, 0x2061,
-	0x0100, 0x6020, 0xd0b4, 0x1120, 0x6024, 0xd084, 0x090c, 0x0d7d,
-	0x6843, 0x0100, 0x080c, 0x86ed, 0x04b0, 0x00c6, 0x2061, 0x19e7,
-	0x00f0, 0x6904, 0x9194, 0x4000, 0x0598, 0x080c, 0x9e32, 0x080c,
-	0x2a1a, 0x00c6, 0x2061, 0x19e7, 0x6134, 0x9192, 0x0008, 0x1278,
-	0x8108, 0x6136, 0x080c, 0xa896, 0x6130, 0x080c, 0xa8b2, 0x00ce,
-	0x81ff, 0x01c8, 0x080c, 0x86ed, 0x080c, 0x9e25, 0x00a0, 0x080c,
-	0xa896, 0x6130, 0x91e5, 0x0000, 0x0150, 0x080c, 0xe717, 0x080c,
-	0x86f6, 0x6003, 0x0001, 0x2009, 0x0014, 0x080c, 0xac8c, 0x080c,
-	0xa8b2, 0x00ce, 0x0000, 0x002e, 0x001e, 0x00de, 0x00ce, 0x0005,
-	0x2001, 0x1a0c, 0x2004, 0x9005, 0x1db0, 0x00c6, 0x2061, 0x19e7,
-	0x6134, 0x9192, 0x0003, 0x1ad8, 0x8108, 0x6136, 0x00ce, 0x080c,
-	0x86ed, 0x080c, 0x5ee4, 0x2009, 0x1846, 0x2114, 0x8210, 0x220a,
-	0x0c10, 0x0096, 0x00c6, 0x00d6, 0x00e6, 0x0016, 0x0026, 0x080c,
-	0x8703, 0x080c, 0xa896, 0x2001, 0x0387, 0x2003, 0x0202, 0x2071,
-	0x19e7, 0x714c, 0x81ff, 0x0904, 0x9f5b, 0x2061, 0x0100, 0x2069,
-	0x0140, 0x080c, 0x74e9, 0x1510, 0x0036, 0x2019, 0x0002, 0x080c,
-	0xa118, 0x003e, 0x714c, 0x2160, 0x080c, 0xe717, 0x2009, 0x004a,
-	0x6220, 0x9296, 0x0009, 0x1130, 0x6114, 0x2148, 0xa87b, 0x0006,
-	0x2009, 0x004a, 0x6003, 0x0003, 0x080c, 0xac8c, 0x2001, 0x0386,
-	0x2003, 0x5040, 0x080c, 0x758a, 0x0804, 0x9f5b, 0x6904, 0xd1f4,
-	0x0904, 0x9f68, 0x080c, 0x2a1a, 0x00c6, 0x704c, 0x9065, 0x090c,
-	0x0d7d, 0x6020, 0x00ce, 0x9086, 0x0006, 0x1518, 0x61c8, 0x60c4,
-	0x9105, 0x11f8, 0x2009, 0x180c, 0x2104, 0xd0d4, 0x01d0, 0x6214,
-	0x9294, 0x1800, 0x1128, 0x6224, 0x9294, 0x0002, 0x1560, 0x0010,
-	0xc0d4, 0x200a, 0x6014, 0x9084, 0xe7fd, 0x9085, 0x0010, 0x6016,
-	0x704c, 0x2060, 0x080c, 0x963b, 0x2009, 0x0049, 0x080c, 0xac8c,
-	0x00d0, 0x0036, 0x2019, 0x0001, 0x080c, 0xa118, 0x003e, 0x714c,
-	0x2160, 0x080c, 0xe717, 0x2009, 0x004a, 0x6220, 0x9296, 0x0009,
-	0x1130, 0x6114, 0x2148, 0xa87b, 0x0006, 0x2009, 0x004a, 0x6003,
-	0x0003, 0x080c, 0xac8c, 0x2001, 0x0387, 0x2003, 0x0200, 0x080c,
-	0xa8b2, 0x002e, 0x001e, 0x00ee, 0x00de, 0x00ce, 0x009e, 0x0005,
-	0xd1ec, 0x1904, 0x9f12, 0x0804, 0x9f14, 0x0026, 0x00e6, 0x2071,
-	0x19e7, 0x706c, 0xd084, 0x01e8, 0xc084, 0x706e, 0x714c, 0x81ff,
-	0x01c0, 0x2071, 0x0100, 0x9188, 0x0008, 0x2114, 0x928e, 0x0006,
-	0x1138, 0x2009, 0x1984, 0x2011, 0x0012, 0x080c, 0x2a53, 0x0048,
-	0x928e, 0x0009, 0x0db0, 0x2009, 0x1984, 0x2011, 0x0016, 0x080c,
-	0x2a53, 0x00ee, 0x002e, 0x0005, 0x9036, 0x2001, 0x19f1, 0x2004,
-	0x9005, 0x0128, 0x9c06, 0x0128, 0x2c30, 0x600c, 0x0cc8, 0x9085,
-	0x0001, 0x0005, 0x00f6, 0x2079, 0x19e7, 0x610c, 0x9006, 0x600e,
-	0x6044, 0xc0fc, 0x6046, 0x86ff, 0x1140, 0x7824, 0x9c06, 0x1118,
-	0x7826, 0x782a, 0x0050, 0x792a, 0x0040, 0x00c6, 0x2660, 0x610e,
-	0x00ce, 0x7824, 0x9c06, 0x1108, 0x7e26, 0x080c, 0xa20e, 0x080c,
-	0xca27, 0x00fe, 0x0005, 0x080c, 0x9a9f, 0x7003, 0x1200, 0x7838,
-	0x7012, 0x783c, 0x7016, 0x00c6, 0x7820, 0x9086, 0x0004, 0x1148,
-	0x7810, 0x9005, 0x0130, 0x00b6, 0x2058, 0xb810, 0xb914, 0x00be,
-	0x0020, 0x2061, 0x1800, 0x607c, 0x6180, 0x9084, 0x00ff, 0x700a,
-	0x710e, 0x00ce, 0x60c3, 0x002c, 0x0804, 0x9e02, 0x080c, 0x9a9f,
-	0x7003, 0x0f00, 0x7808, 0xd09c, 0x0128, 0xb810, 0x9084, 0x00ff,
-	0x700a, 0xb814, 0x700e, 0x60c3, 0x0008, 0x0804, 0x9e02, 0x0156,
-	0x080c, 0x9aea, 0x7003, 0x0200, 0x080c, 0x87bb, 0x20a9, 0x0006,
-	0x2011, 0xfff4, 0x2019, 0xfff5, 0x9ef0, 0x0002, 0x2305, 0x2072,
-	0x8e70, 0x2205, 0x2072, 0x8e70, 0x9398, 0x0002, 0x9290, 0x0002,
-	0x1f04, 0xa006, 0x60c3, 0x001c, 0x015e, 0x0804, 0x9e02, 0x0016,
-	0x0026, 0x080c, 0x9ac6, 0x080c, 0x9ad8, 0x9e80, 0x0004, 0x20e9,
-	0x0000, 0x20a0, 0x7814, 0x0096, 0x2048, 0xa800, 0x2048, 0xa860,
-	0x20e0, 0xa85c, 0x9080, 0x0021, 0x2098, 0x009e, 0x7808, 0x9088,
-	0x0002, 0x21a8, 0x9192, 0x0010, 0x1250, 0x4003, 0x9080, 0x0004,
-	0x8003, 0x60c2, 0x080c, 0x9e02, 0x002e, 0x001e, 0x0005, 0x20a9,
-	0x0010, 0x4003, 0x080c, 0xa67b, 0x20a1, 0x0240, 0x22a8, 0x4003,
-	0x0c68, 0x080c, 0x9a9f, 0x7003, 0x6200, 0x7808, 0x700e, 0x60c3,
-	0x0008, 0x0804, 0x9e02, 0x0016, 0x0026, 0x080c, 0x9a9f, 0x20e9,
-	0x0000, 0x20a1, 0x024c, 0x7814, 0x0096, 0x2048, 0xa800, 0x2048,
-	0xa860, 0x20e0, 0xa85c, 0x9080, 0x0023, 0x2098, 0x009e, 0x7808,
-	0x9088, 0x0002, 0x21a8, 0x4003, 0x8003, 0x60c2, 0x080c, 0x9e02,
-	0x002e, 0x001e, 0x0005, 0x00e6, 0x00c6, 0x0006, 0x0126, 0x2091,
-	0x8000, 0x2071, 0x19e7, 0x7010, 0x2060, 0x8cff, 0x0188, 0x080c,
-	0xca4d, 0x1110, 0x080c, 0xb5b5, 0x600c, 0x0006, 0x080c, 0xccc4,
-	0x600f, 0x0000, 0x080c, 0xabed, 0x080c, 0xa20e, 0x00ce, 0x0c68,
-	0x2c00, 0x7012, 0x700e, 0x012e, 0x000e, 0x00ce, 0x00ee, 0x0005,
-	0x0126, 0x0156, 0x00f6, 0x00e6, 0x00d6, 0x00c6, 0x0066, 0x0026,
-	0x0016, 0x0006, 0x2091, 0x8000, 0x2001, 0x180c, 0x200c, 0x918c,
-	0xe7ff, 0x2102, 0x2069, 0x0100, 0x2079, 0x0140, 0x2071, 0x19e7,
-	0x7030, 0x2060, 0x8cff, 0x0548, 0x080c, 0x9e32, 0x6ac0, 0x68c3,
-	0x0000, 0x080c, 0x86f6, 0x00c6, 0x2061, 0x0100, 0x080c, 0xa7cc,
-	0x00ce, 0x20a9, 0x01f4, 0x04b1, 0x080c, 0x95de, 0x6044, 0xd0ac,
-	0x1128, 0x2001, 0x1988, 0x2004, 0x604a, 0x0020, 0x2009, 0x0013,
-	0x080c, 0xac8c, 0x000e, 0x001e, 0x002e, 0x006e, 0x00ce, 0x00de,
-	0x00ee, 0x00fe, 0x015e, 0x012e, 0x0005, 0x2001, 0x1800, 0x2004,
-	0x9096, 0x0001, 0x0d78, 0x9096, 0x0004, 0x0d60, 0x080c, 0x86f6,
-	0x6814, 0x9084, 0x0001, 0x0110, 0x68a7, 0x95f5, 0x6817, 0x0008,
-	0x68c3, 0x0000, 0x2011, 0x5e8e, 0x080c, 0x863e, 0x20a9, 0x01f4,
-	0x0009, 0x08c0, 0x6824, 0xd094, 0x0140, 0x6827, 0x0004, 0x7804,
-	0x9084, 0x4000, 0x190c, 0x2a1a, 0x0090, 0xd084, 0x0118, 0x6827,
-	0x0001, 0x0010, 0x1f04, 0xa0fa, 0x7804, 0x9084, 0x1000, 0x0138,
-	0x2001, 0x0100, 0x080c, 0x2a0a, 0x9006, 0x080c, 0x2a0a, 0x0005,
-	0x0126, 0x0156, 0x00f6, 0x00e6, 0x00d6, 0x00c6, 0x0066, 0x0026,
-	0x0016, 0x0006, 0x2091, 0x8000, 0x2001, 0x180c, 0x200c, 0x918c,
-	0xdbff, 0x2102, 0x2069, 0x0100, 0x2079, 0x0140, 0x2071, 0x0380,
-	0x701c, 0x0006, 0x701f, 0x0202, 0x2071, 0x19e7, 0x704c, 0x2060,
-	0x8cff, 0x0904, 0xa1bd, 0x9386, 0x0002, 0x1128, 0x6814, 0x9084,
-	0x0002, 0x0904, 0xa1bd, 0x68af, 0x95f5, 0x6817, 0x0010, 0x2009,
-	0x00fa, 0x8109, 0x1df0, 0x69c6, 0x68cb, 0x0008, 0x080c, 0x8703,
-	0x080c, 0x1dd8, 0x0046, 0x2009, 0x00a5, 0x080c, 0x0e55, 0x2021,
-	0x0169, 0x2404, 0x9084, 0x000f, 0x9086, 0x0004, 0x11f8, 0x68af,
-	0x95f5, 0x68c6, 0x68cb, 0x0008, 0x00e6, 0x00f6, 0x2079, 0x0090,
-	0x2071, 0x19e7, 0x6814, 0x9084, 0x1984, 0x9085, 0x0012, 0x6816,
-	0x782b, 0x0008, 0x7057, 0x0000, 0x00fe, 0x00ee, 0x9386, 0x0002,
-	0x1128, 0x7884, 0x9005, 0x1110, 0x7887, 0x0001, 0x0016, 0x2009,
-	0x0040, 0x080c, 0x21b0, 0x001e, 0x2009, 0x0000, 0x080c, 0x0e55,
-	0x004e, 0x20a9, 0x03e8, 0x6824, 0xd094, 0x0140, 0x6827, 0x0004,
-	0x7804, 0x9084, 0x4000, 0x190c, 0x2a1a, 0x0090, 0xd08c, 0x0118,
-	0x6827, 0x0002, 0x0010, 0x1f04, 0xa18b, 0x7804, 0x9084, 0x1000,
-	0x0138, 0x2001, 0x0100, 0x080c, 0x2a0a, 0x9006, 0x080c, 0x2a0a,
-	0x6827, 0x4000, 0x6824, 0x83ff, 0x1180, 0x2009, 0x0049, 0x6020,
-	0x9086, 0x0009, 0x0150, 0x080c, 0x963b, 0x6044, 0xd0ac, 0x1118,
-	0x6003, 0x0002, 0x0010, 0x080c, 0xac8c, 0x000e, 0x2071, 0x0380,
-	0xd08c, 0x1110, 0x701f, 0x0200, 0x000e, 0x001e, 0x002e, 0x006e,
-	0x00ce, 0x00de, 0x00ee, 0x00fe, 0x015e, 0x012e, 0x0005, 0x00d6,
-	0x0126, 0x2091, 0x8000, 0x2069, 0x19e7, 0x6a06, 0x012e, 0x00de,
-	0x0005, 0x00d6, 0x0126, 0x2091, 0x8000, 0x2069, 0x19e7, 0x6a3e,
-	0x012e, 0x00de, 0x0005, 0x080c, 0x9bed, 0x785c, 0x7032, 0x7042,
-	0x7047, 0x1000, 0x00f8, 0x080c, 0x9bed, 0x785c, 0x7032, 0x7042,
-	0x7047, 0x4000, 0x00b8, 0x080c, 0x9bed, 0x785c, 0x7032, 0x7042,
-	0x7047, 0x2000, 0x0078, 0x080c, 0x9bed, 0x785c, 0x7032, 0x7042,
-	0x7047, 0x0400, 0x0038, 0x080c, 0x9bed, 0x785c, 0x7032, 0x7042,
-	0x7047, 0x0200, 0x60c3, 0x0020, 0x0804, 0x9e02, 0x00e6, 0x2071,
-	0x19e7, 0x702c, 0x9005, 0x0110, 0x8001, 0x702e, 0x00ee, 0x0005,
-	0x00f6, 0x00e6, 0x00d6, 0x00c6, 0x0076, 0x0066, 0x0006, 0x0126,
-	0x2091, 0x8000, 0x2071, 0x19e7, 0x7620, 0x2660, 0x2678, 0x2039,
-	0x0001, 0x87ff, 0x0904, 0xa2b3, 0x8cff, 0x0904, 0xa2b3, 0x6020,
-	0x9086, 0x0006, 0x1904, 0xa2ae, 0x88ff, 0x0138, 0x2800, 0x9c06,
-	0x1904, 0xa2ae, 0x2039, 0x0000, 0x0050, 0x6010, 0x9b06, 0x1904,
-	0xa2ae, 0x85ff, 0x0120, 0x605c, 0x9106, 0x1904, 0xa2ae, 0x7030,
-	0x9c06, 0x15b0, 0x2069, 0x0100, 0x68c0, 0x9005, 0x1160, 0x6824,
-	0xd084, 0x0148, 0x6827, 0x0001, 0x080c, 0x86f6, 0x080c, 0xa338,
-	0x7033, 0x0000, 0x0428, 0x080c, 0x86f6, 0x6820, 0xd0b4, 0x0110,
-	0x68a7, 0x95f5, 0x6817, 0x0008, 0x68c3, 0x0000, 0x080c, 0xa338,
-	0x7033, 0x0000, 0x0036, 0x2069, 0x0140, 0x6b04, 0x9384, 0x1000,
-	0x0138, 0x2001, 0x0100, 0x080c, 0x2a0a, 0x9006, 0x080c, 0x2a0a,
-	0x2069, 0x0100, 0x6824, 0xd084, 0x0110, 0x6827, 0x0001, 0x003e,
-	0x7020, 0x9c36, 0x1110, 0x660c, 0x7622, 0x701c, 0x9c36, 0x1140,
-	0x2c00, 0x9f36, 0x0118, 0x2f00, 0x701e, 0x0010, 0x701f, 0x0000,
-	0x660c, 0x0066, 0x2c00, 0x9f06, 0x0110, 0x7e0e, 0x0008, 0x2678,
-	0x89ff, 0x1168, 0x600f, 0x0000, 0x6014, 0x0096, 0x2048, 0x080c,
-	0xc836, 0x0110, 0x080c, 0xe26c, 0x009e, 0x080c, 0xac28, 0x080c,
-	0xa20e, 0x88ff, 0x1190, 0x00ce, 0x0804, 0xa229, 0x2c78, 0x600c,
-	0x2060, 0x0804, 0xa229, 0x9006, 0x012e, 0x000e, 0x006e, 0x007e,
-	0x00ce, 0x00de, 0x00ee, 0x00fe, 0x0005, 0x601b, 0x0000, 0x00ce,
-	0x98c5, 0x0001, 0x0c88, 0x00f6, 0x00e6, 0x00d6, 0x0096, 0x00c6,
-	0x0066, 0x0026, 0x0006, 0x0126, 0x2091, 0x8000, 0x2071, 0x19e7,
-	0x7648, 0x2660, 0x2678, 0x8cff, 0x0904, 0xa327, 0x6020, 0x9086,
-	0x0006, 0x1904, 0xa322, 0x87ff, 0x0128, 0x2700, 0x9c06, 0x1904,
-	0xa322, 0x0040, 0x6010, 0x9b06, 0x15e8, 0x85ff, 0x0118, 0x605c,
-	0x9106, 0x15c0, 0x704c, 0x9c06, 0x1168, 0x0036, 0x2019, 0x0001,
-	0x080c, 0xa118, 0x703f, 0x0000, 0x9006, 0x704e, 0x706a, 0x7052,
-	0x706e, 0x003e, 0x7048, 0x9c36, 0x1110, 0x660c, 0x764a, 0x7044,
-	0x9c36, 0x1140, 0x2c00, 0x9f36, 0x0118, 0x2f00, 0x7046, 0x0010,
-	0x7047, 0x0000, 0x660c, 0x0066, 0x2c00, 0x9f06, 0x0110, 0x7e0e,
-	0x0008, 0x2678, 0x600f, 0x0000, 0x6014, 0x2048, 0x080c, 0xc836,
-	0x0110, 0x080c, 0xe26c, 0x080c, 0xac28, 0x87ff, 0x1198, 0x00ce,
-	0x0804, 0xa2d3, 0x2c78, 0x600c, 0x2060, 0x0804, 0xa2d3, 0x9006,
-	0x012e, 0x000e, 0x002e, 0x006e, 0x00ce, 0x009e, 0x00de, 0x00ee,
-	0x00fe, 0x0005, 0x601b, 0x0000, 0x00ce, 0x97bd, 0x0001, 0x0c80,
-	0x00e6, 0x2071, 0x19e7, 0x7033, 0x0000, 0x7004, 0x9086, 0x0003,
-	0x0158, 0x2001, 0x1800, 0x2004, 0x9086, 0x0002, 0x1118, 0x7007,
-	0x0005, 0x0010, 0x7007, 0x0000, 0x00ee, 0x0005, 0x00f6, 0x00e6,
-	0x00c6, 0x0066, 0x0026, 0x0006, 0x0126, 0x2091, 0x8000, 0x2071,
-	0x19e7, 0x2c10, 0x7648, 0x2660, 0x2678, 0x8cff, 0x0518, 0x2200,
-	0x9c06, 0x11e0, 0x7048, 0x9c36, 0x1110, 0x660c, 0x764a, 0x7044,
-	0x9c36, 0x1140, 0x2c00, 0x9f36, 0x0118, 0x2f00, 0x7046, 0x0010,
-	0x7047, 0x0000, 0x660c, 0x2c00, 0x9f06, 0x0110, 0x7e0e, 0x0008,
-	0x2678, 0x600f, 0x0000, 0x9085, 0x0001, 0x0020, 0x2c78, 0x600c,
-	0x2060, 0x08d8, 0x012e, 0x000e, 0x002e, 0x006e, 0x00ce, 0x00ee,
+	0x700e, 0x2001, 0x0099, 0x7012, 0x0804, 0x9b00, 0x0026, 0x080c,
+	0xa67d, 0xb810, 0x9085, 0x8500, 0x7002, 0xb814, 0x7006, 0x2069,
+	0x1800, 0x687c, 0x700a, 0x6880, 0x700e, 0x2001, 0x0099, 0x7012,
+	0x0804, 0x9b00, 0x00b6, 0x00c6, 0x00d6, 0x00e6, 0x00f6, 0x2c78,
+	0x2069, 0x0200, 0x2071, 0x0240, 0x7804, 0x908a, 0x0040, 0x0a0c,
+	0x0d7d, 0x908a, 0x0057, 0x1a0c, 0x0d7d, 0x7910, 0x2158, 0xb984,
+	0x2061, 0x0100, 0x619a, 0x9082, 0x0040, 0x0033, 0x00fe, 0x00ee,
+	0x00de, 0x00ce, 0x00be, 0x0005, 0x9bcf, 0x9bcf, 0x9bcf, 0x9bf5,
+	0x9bcf, 0x9bcf, 0x9bcf, 0x9bcf, 0x9bcf, 0x9bcf, 0x9bcf, 0xa1cd,
+	0xa1d5, 0xa1dd, 0xa1e5, 0x9bcf, 0x9bcf, 0x9bcf, 0xa1c5, 0x080c,
+	0x0d7d, 0x6813, 0x0008, 0xba8c, 0x8210, 0xb8d4, 0xd084, 0x0128,
+	0x7a4e, 0x7b14, 0x7b52, 0x722e, 0x732a, 0x9294, 0x00ff, 0xba8e,
+	0x8217, 0x721a, 0xba10, 0x9295, 0x0600, 0x7202, 0xba14, 0x7206,
+	0x2069, 0x1800, 0x6a7c, 0x720a, 0x6a80, 0x720e, 0x7013, 0x0829,
+	0x2f10, 0x7222, 0x7027, 0xffff, 0x0005, 0x0016, 0x7814, 0x9084,
+	0x0700, 0x8007, 0x0013, 0x001e, 0x0005, 0x9c05, 0x9c05, 0x9c07,
+	0x9c05, 0x9c05, 0x9c05, 0x9c21, 0x9c05, 0x080c, 0x0d7d, 0x7914,
+	0x918c, 0x08ff, 0x918d, 0xf600, 0x7916, 0x2009, 0x0003, 0x00b9,
+	0x2069, 0x1847, 0x6804, 0xd0bc, 0x0130, 0x682c, 0x9084, 0x00ff,
+	0x8007, 0x7032, 0x0010, 0x7033, 0x3f00, 0x60c3, 0x0001, 0x0804,
+	0x9de6, 0x2009, 0x0003, 0x0019, 0x7033, 0x7f00, 0x0cb0, 0x0016,
+	0x080c, 0xa67d, 0x001e, 0xb810, 0x9085, 0x0100, 0x7002, 0xb814,
+	0x7006, 0x2069, 0x1800, 0x6a7c, 0x720a, 0x6a80, 0x720e, 0x7013,
+	0x0888, 0x918d, 0x0008, 0x7116, 0x080c, 0x9dda, 0x721a, 0x7a08,
+	0x7222, 0x2f10, 0x7226, 0x0005, 0x00b6, 0x00e6, 0x00d6, 0x00c6,
+	0x0066, 0x0056, 0x0046, 0x0036, 0x2061, 0x0100, 0x2071, 0x1800,
+	0x7160, 0x7810, 0x2058, 0x76dc, 0x96b4, 0x0028, 0x0110, 0x737c,
+	0x7480, 0x2500, 0x76dc, 0x96b4, 0x0028, 0x0140, 0x2001, 0x04ff,
+	0x6062, 0x6067, 0xffff, 0x636a, 0x646e, 0x0050, 0x2001, 0x00ff,
+	0x9085, 0x0400, 0x6062, 0x6067, 0xffff, 0x606b, 0x0000, 0x616e,
+	0xb8b8, 0x6073, 0x0530, 0x6077, 0x0008, 0xb88c, 0x8000, 0x9084,
+	0x00ff, 0xb88e, 0x8007, 0x9085, 0x0020, 0x607a, 0x607f, 0x0000,
+	0x2b00, 0x6082, 0x6087, 0xffff, 0x7814, 0x0096, 0x2048, 0xa848,
+	0x608a, 0xa844, 0x608e, 0xa838, 0x60c6, 0xa834, 0x60ca, 0x009e,
+	0xb86c, 0x60ce, 0x60ab, 0x0036, 0x60af, 0x95d5, 0x60d7, 0x0000,
+	0x2001, 0x1837, 0x2004, 0x9084, 0x0028, 0x0128, 0x609f, 0x0000,
+	0x2001, 0x0092, 0x0058, 0x6028, 0xc0bd, 0x602a, 0x609f, 0x00ff,
+	0x2011, 0xffff, 0x080c, 0x2a63, 0x2001, 0x00b2, 0x2010, 0x900e,
+	0x080c, 0x2a72, 0x2009, 0x07d0, 0x080c, 0x86da, 0x003e, 0x004e,
+	0x005e, 0x006e, 0x00ce, 0x00de, 0x00ee, 0x00be, 0x0005, 0x00b6,
+	0x00e6, 0x00d6, 0x00c6, 0x0066, 0x0056, 0x0046, 0x0036, 0x2061,
+	0x0100, 0x2071, 0x1800, 0x7160, 0x7810, 0x2058, 0xb8a0, 0x2028,
+	0x76dc, 0xd6ac, 0x1168, 0x9582, 0x007e, 0x1250, 0x2500, 0x9094,
+	0xff80, 0x1130, 0x9080, 0x3368, 0x2015, 0x9294, 0x00ff, 0x0020,
+	0xb910, 0xba14, 0x737c, 0x7480, 0x70dc, 0xd0ac, 0x1130, 0x9582,
+	0x007e, 0x1218, 0x9584, 0xff80, 0x0138, 0x9185, 0x0400, 0x6062,
+	0x6266, 0x636a, 0x646e, 0x0030, 0x6063, 0x0400, 0x6266, 0x606b,
+	0x0000, 0x616e, 0xb8b8, 0x6072, 0x6077, 0x0000, 0xb864, 0xd0a4,
+	0x0110, 0x6077, 0x0008, 0xb88c, 0x8000, 0x9084, 0x00ff, 0xb88e,
+	0x8007, 0x9085, 0x0020, 0x607a, 0x607f, 0x0000, 0x2b00, 0x6082,
+	0x6087, 0xffff, 0x7814, 0x0096, 0x2048, 0xa848, 0x608a, 0xa844,
+	0x608e, 0xa838, 0x60c6, 0xa834, 0x60ca, 0x009e, 0xb86c, 0x60ce,
+	0x60ab, 0x0036, 0x60af, 0x95d5, 0x60d7, 0x0000, 0xba84, 0x629e,
+	0x00f6, 0x2079, 0x0140, 0x7803, 0x0000, 0x00fe, 0x900e, 0x2011,
+	0x0092, 0x080c, 0x2a72, 0x2009, 0x07d0, 0x080c, 0x86da, 0x003e,
+	0x004e, 0x005e, 0x006e, 0x00ce, 0x00de, 0x00ee, 0x00be, 0x0005,
+	0x00b6, 0x0096, 0x00e6, 0x00d6, 0x00c6, 0x0056, 0x0046, 0x0036,
+	0x2061, 0x0100, 0x2071, 0x1800, 0x7810, 0x2058, 0xb8a0, 0x2028,
+	0xb910, 0xba14, 0x737c, 0x7480, 0x7820, 0x0002, 0x9d65, 0x9d65,
+	0x9d65, 0x9d65, 0x9d65, 0x9d65, 0x9d65, 0x9d65, 0x9d65, 0x9d65,
+	0x9d67, 0x9d65, 0x9d65, 0x9d65, 0x9d65, 0x080c, 0x0d7d, 0xb884,
+	0x609e, 0x7814, 0x2048, 0xa87c, 0xd0fc, 0x0558, 0xaf90, 0x9784,
+	0xff00, 0x9105, 0x6062, 0x873f, 0x9784, 0xff00, 0x0006, 0x7814,
+	0x2048, 0xa878, 0xc0fc, 0x9005, 0x000e, 0x1160, 0xaf94, 0x87ff,
+	0x0198, 0x2039, 0x0098, 0x9705, 0x6072, 0x7808, 0x6082, 0x2f00,
+	0x6086, 0x0038, 0x9185, 0x2200, 0x6062, 0x6073, 0x0129, 0x6077,
+	0x0000, 0xb884, 0x609e, 0x0050, 0x2039, 0x0029, 0x9705, 0x6072,
+	0x0cc0, 0x9185, 0x0200, 0x6062, 0x6073, 0x2029, 0xa87c, 0xd0fc,
+	0x0118, 0xaf94, 0x87ff, 0x1120, 0x2f00, 0x6082, 0x7808, 0x6086,
+	0x6266, 0x636a, 0x646e, 0x6077, 0x0000, 0xb88c, 0x8000, 0x9084,
+	0x00ff, 0xb88e, 0x8007, 0x607a, 0x607f, 0x0000, 0xa848, 0x608a,
+	0xa844, 0x608e, 0xa838, 0x60c6, 0xa834, 0x60ca, 0xb86c, 0x60ce,
+	0x60af, 0x95d5, 0x60d7, 0x0000, 0x080c, 0xa65d, 0x2009, 0x07d0,
+	0x60c4, 0x9084, 0xfff0, 0x9005, 0x0110, 0x2009, 0x1b58, 0x080c,
+	0x86da, 0x003e, 0x004e, 0x005e, 0x00ce, 0x00de, 0x00ee, 0x009e,
+	0x00be, 0x0005, 0x7a40, 0x9294, 0x00ff, 0x8217, 0x0005, 0x00d6,
+	0x2069, 0x19e6, 0x686b, 0x0001, 0x00de, 0x0005, 0x60a3, 0x0056,
+	0x60a7, 0x9575, 0x00f1, 0x080c, 0x86cc, 0x0005, 0x0016, 0x2001,
+	0x180c, 0x200c, 0x9184, 0x0600, 0x9086, 0x0600, 0x0128, 0x0089,
+	0x080c, 0x86cc, 0x001e, 0x0005, 0xc1e5, 0x2001, 0x180c, 0x2102,
+	0x2001, 0x19e7, 0x2003, 0x0000, 0x2001, 0x19f2, 0x2003, 0x0000,
+	0x0c88, 0x0006, 0x0016, 0x0026, 0x2009, 0x1804, 0x2011, 0x0009,
+	0x080c, 0x2a72, 0x002e, 0x001e, 0x000e, 0x0005, 0x0016, 0x00c6,
+	0x0006, 0x080c, 0xa888, 0x0106, 0x2061, 0x0100, 0x61a4, 0x60a7,
+	0x95f5, 0x0016, 0x0026, 0x2009, 0x1804, 0x2011, 0x0008, 0x080c,
+	0x2a72, 0x002e, 0x001e, 0x010e, 0x090c, 0xa8a4, 0x000e, 0xa001,
+	0xa001, 0xa001, 0x61a6, 0x00ce, 0x001e, 0x0005, 0x00c6, 0x00d6,
+	0x0016, 0x0026, 0x2061, 0x0100, 0x2069, 0x0140, 0x080c, 0x74c8,
+	0x1510, 0x2001, 0x1a0b, 0x2004, 0x9005, 0x1904, 0x9e95, 0x080c,
+	0x7569, 0x11a8, 0x2069, 0x0380, 0x6843, 0x0101, 0x6844, 0xd084,
+	0x1de8, 0x2061, 0x0100, 0x6020, 0xd0b4, 0x1120, 0x6024, 0xd084,
+	0x090c, 0x0d7d, 0x6843, 0x0100, 0x080c, 0x86cc, 0x04b0, 0x00c6,
+	0x2061, 0x19e6, 0x00f0, 0x6904, 0x9194, 0x4000, 0x0598, 0x080c,
+	0x9e16, 0x080c, 0x2a39, 0x00c6, 0x2061, 0x19e6, 0x6134, 0x9192,
+	0x0008, 0x1278, 0x8108, 0x6136, 0x080c, 0xa888, 0x6130, 0x080c,
+	0xa8a4, 0x00ce, 0x81ff, 0x01c8, 0x080c, 0x86cc, 0x080c, 0x9e09,
+	0x00a0, 0x080c, 0xa888, 0x6130, 0x91e5, 0x0000, 0x0150, 0x080c,
+	0xe727, 0x080c, 0x86d5, 0x6003, 0x0001, 0x2009, 0x0014, 0x080c,
+	0xac7c, 0x080c, 0xa8a4, 0x00ce, 0x0000, 0x002e, 0x001e, 0x00de,
+	0x00ce, 0x0005, 0x2001, 0x1a0b, 0x2004, 0x9005, 0x1db0, 0x00c6,
+	0x2061, 0x19e6, 0x6134, 0x9192, 0x0003, 0x1ad8, 0x8108, 0x6136,
+	0x00ce, 0x080c, 0x86cc, 0x080c, 0x5edf, 0x2009, 0x1846, 0x2114,
+	0x8210, 0x220a, 0x0c10, 0x0096, 0x00c6, 0x00d6, 0x00e6, 0x0016,
+	0x0026, 0x080c, 0x86e2, 0x080c, 0xa888, 0x2001, 0x0387, 0x2003,
+	0x0202, 0x2071, 0x19e6, 0x714c, 0x81ff, 0x0904, 0x9f3d, 0x2061,
+	0x0100, 0x2069, 0x0140, 0x080c, 0x74c8, 0x1510, 0x0036, 0x2019,
+	0x0002, 0x080c, 0xa0fa, 0x003e, 0x714c, 0x2160, 0x080c, 0xe727,
+	0x2009, 0x004a, 0x6220, 0x9296, 0x0009, 0x1130, 0x6114, 0x2148,
+	0xa87b, 0x0006, 0x2009, 0x004a, 0x6003, 0x0003, 0x080c, 0xac7c,
+	0x2001, 0x0386, 0x2003, 0x5040, 0x080c, 0x7569, 0x0804, 0x9f3d,
+	0x6904, 0xd1f4, 0x0904, 0x9f4a, 0x080c, 0x2a39, 0x00c6, 0x704c,
+	0x9065, 0x090c, 0x0d7d, 0x6020, 0x00ce, 0x9086, 0x0006, 0x1518,
+	0x61c8, 0x60c4, 0x9105, 0x11f8, 0x2009, 0x180c, 0x2104, 0xd0d4,
+	0x01d0, 0x6214, 0x9294, 0x1800, 0x1128, 0x6224, 0x9294, 0x0002,
+	0x1560, 0x0010, 0xc0d4, 0x200a, 0x6014, 0x9084, 0xe7fd, 0x9085,
+	0x0010, 0x6016, 0x704c, 0x2060, 0x080c, 0x9621, 0x2009, 0x0049,
+	0x080c, 0xac7c, 0x00d0, 0x0036, 0x2019, 0x0001, 0x080c, 0xa0fa,
+	0x003e, 0x714c, 0x2160, 0x080c, 0xe727, 0x2009, 0x004a, 0x6220,
+	0x9296, 0x0009, 0x1130, 0x6114, 0x2148, 0xa87b, 0x0006, 0x2009,
+	0x004a, 0x6003, 0x0003, 0x080c, 0xac7c, 0x2001, 0x0387, 0x2003,
+	0x0200, 0x080c, 0xa8a4, 0x002e, 0x001e, 0x00ee, 0x00de, 0x00ce,
+	0x009e, 0x0005, 0xd1ec, 0x1904, 0x9ef4, 0x0804, 0x9ef6, 0x0026,
+	0x00e6, 0x2071, 0x19e6, 0x706c, 0xd084, 0x01e8, 0xc084, 0x706e,
+	0x714c, 0x81ff, 0x01c0, 0x2071, 0x0100, 0x9188, 0x0008, 0x2114,
+	0x928e, 0x0006, 0x1138, 0x2009, 0x1984, 0x2011, 0x0012, 0x080c,
+	0x2a72, 0x0048, 0x928e, 0x0009, 0x0db0, 0x2009, 0x1984, 0x2011,
+	0x0016, 0x080c, 0x2a72, 0x00ee, 0x002e, 0x0005, 0x9036, 0x2001,
+	0x19f0, 0x2004, 0x9005, 0x0128, 0x9c06, 0x0128, 0x2c30, 0x600c,
+	0x0cc8, 0x9085, 0x0001, 0x0005, 0x00f6, 0x2079, 0x19e6, 0x610c,
+	0x9006, 0x600e, 0x6044, 0xc0fc, 0x6046, 0x86ff, 0x1140, 0x7824,
+	0x9c06, 0x1118, 0x7826, 0x782a, 0x0050, 0x792a, 0x0040, 0x00c6,
+	0x2660, 0x610e, 0x00ce, 0x7824, 0x9c06, 0x1108, 0x7e26, 0x080c,
+	0xa1f0, 0x080c, 0xca21, 0x00fe, 0x0005, 0x080c, 0x9a83, 0x7003,
+	0x1200, 0x7838, 0x7012, 0x783c, 0x7016, 0x00c6, 0x7820, 0x9086,
+	0x0004, 0x1148, 0x7810, 0x9005, 0x0130, 0x00b6, 0x2058, 0xb810,
+	0xb914, 0x00be, 0x0020, 0x2061, 0x1800, 0x607c, 0x6180, 0x9084,
+	0x00ff, 0x700a, 0x710e, 0x00ce, 0x60c3, 0x002c, 0x0804, 0x9de6,
+	0x080c, 0x9a83, 0x7003, 0x0f00, 0x7808, 0xd09c, 0x0128, 0xb810,
+	0x9084, 0x00ff, 0x700a, 0xb814, 0x700e, 0x60c3, 0x0008, 0x0804,
+	0x9de6, 0x0156, 0x080c, 0x9ace, 0x7003, 0x0200, 0x080c, 0x879a,
+	0x20a9, 0x0006, 0x2011, 0xfff4, 0x2019, 0xfff5, 0x9ef0, 0x0002,
+	0x2305, 0x2072, 0x8e70, 0x2205, 0x2072, 0x8e70, 0x9398, 0x0002,
+	0x9290, 0x0002, 0x1f04, 0x9fe8, 0x60c3, 0x001c, 0x015e, 0x0804,
+	0x9de6, 0x0016, 0x0026, 0x080c, 0x9aaa, 0x080c, 0x9abc, 0x9e80,
+	0x0004, 0x20e9, 0x0000, 0x20a0, 0x7814, 0x0096, 0x2048, 0xa800,
+	0x2048, 0xa860, 0x20e0, 0xa85c, 0x9080, 0x0021, 0x2098, 0x009e,
+	0x7808, 0x9088, 0x0002, 0x21a8, 0x9192, 0x0010, 0x1250, 0x4003,
+	0x9080, 0x0004, 0x8003, 0x60c2, 0x080c, 0x9de6, 0x002e, 0x001e,
+	0x0005, 0x20a9, 0x0010, 0x4003, 0x080c, 0xa668, 0x20a1, 0x0240,
+	0x22a8, 0x4003, 0x0c68, 0x080c, 0x9a83, 0x7003, 0x6200, 0x7808,
+	0x700e, 0x60c3, 0x0008, 0x0804, 0x9de6, 0x0016, 0x0026, 0x080c,
+	0x9a83, 0x20e9, 0x0000, 0x20a1, 0x024c, 0x7814, 0x0096, 0x2048,
+	0xa800, 0x2048, 0xa860, 0x20e0, 0xa85c, 0x9080, 0x0023, 0x2098,
+	0x009e, 0x7808, 0x9088, 0x0002, 0x21a8, 0x4003, 0x8003, 0x60c2,
+	0x080c, 0x9de6, 0x002e, 0x001e, 0x0005, 0x00e6, 0x00c6, 0x0006,
+	0x0126, 0x2091, 0x8000, 0x2071, 0x19e6, 0x7010, 0x2060, 0x8cff,
+	0x0188, 0x080c, 0xca47, 0x1110, 0x080c, 0xb5a6, 0x600c, 0x0006,
+	0x080c, 0xccc3, 0x600f, 0x0000, 0x080c, 0xabdf, 0x080c, 0xa1f0,
+	0x00ce, 0x0c68, 0x2c00, 0x7012, 0x700e, 0x012e, 0x000e, 0x00ce,
+	0x00ee, 0x0005, 0x0126, 0x0156, 0x00f6, 0x00e6, 0x00d6, 0x00c6,
+	0x0066, 0x0026, 0x0016, 0x0006, 0x2091, 0x8000, 0x2001, 0x180c,
+	0x200c, 0x918c, 0xe7ff, 0x2102, 0x2069, 0x0100, 0x2079, 0x0140,
+	0x2071, 0x19e6, 0x7030, 0x2060, 0x8cff, 0x0548, 0x080c, 0x9e16,
+	0x6ac0, 0x68c3, 0x0000, 0x080c, 0x86d5, 0x00c6, 0x2061, 0x0100,
+	0x080c, 0xa7b9, 0x00ce, 0x20a9, 0x01f4, 0x04b1, 0x080c, 0x95c6,
+	0x6044, 0xd0ac, 0x1128, 0x2001, 0x1987, 0x2004, 0x604a, 0x0020,
+	0x2009, 0x0013, 0x080c, 0xac7c, 0x000e, 0x001e, 0x002e, 0x006e,
+	0x00ce, 0x00de, 0x00ee, 0x00fe, 0x015e, 0x012e, 0x0005, 0x2001,
+	0x1800, 0x2004, 0x9096, 0x0001, 0x0d78, 0x9096, 0x0004, 0x0d60,
+	0x080c, 0x86d5, 0x6814, 0x9084, 0x0001, 0x0110, 0x68a7, 0x95f5,
+	0x6817, 0x0008, 0x68c3, 0x0000, 0x2011, 0x5e89, 0x080c, 0x861d,
+	0x20a9, 0x01f4, 0x0009, 0x08c0, 0x6824, 0xd094, 0x0140, 0x6827,
+	0x0004, 0x7804, 0x9084, 0x4000, 0x190c, 0x2a39, 0x0090, 0xd084,
+	0x0118, 0x6827, 0x0001, 0x0010, 0x1f04, 0xa0dc, 0x7804, 0x9084,
+	0x1000, 0x0138, 0x2001, 0x0100, 0x080c, 0x2a29, 0x9006, 0x080c,
+	0x2a29, 0x0005, 0x0126, 0x0156, 0x00f6, 0x00e6, 0x00d6, 0x00c6,
+	0x0066, 0x0026, 0x0016, 0x0006, 0x2091, 0x8000, 0x2001, 0x180c,
+	0x200c, 0x918c, 0xdbff, 0x2102, 0x2069, 0x0100, 0x2079, 0x0140,
+	0x2071, 0x0380, 0x701c, 0x0006, 0x701f, 0x0202, 0x2071, 0x19e6,
+	0x704c, 0x2060, 0x8cff, 0x0904, 0xa19f, 0x9386, 0x0002, 0x1128,
+	0x6814, 0x9084, 0x0002, 0x0904, 0xa19f, 0x68af, 0x95f5, 0x6817,
+	0x0010, 0x2009, 0x00fa, 0x8109, 0x1df0, 0x69c6, 0x68cb, 0x0008,
+	0x080c, 0x86e2, 0x080c, 0x1de5, 0x0046, 0x2009, 0x00a5, 0x080c,
+	0x0e55, 0x2021, 0x0169, 0x2404, 0x9084, 0x000f, 0x9086, 0x0004,
+	0x11f8, 0x68af, 0x95f5, 0x68c6, 0x68cb, 0x0008, 0x00e6, 0x00f6,
+	0x2079, 0x0090, 0x2071, 0x19e6, 0x6814, 0x9084, 0x1984, 0x9085,
+	0x0012, 0x6816, 0x782b, 0x0008, 0x7057, 0x0000, 0x00fe, 0x00ee,
+	0x9386, 0x0002, 0x1128, 0x7884, 0x9005, 0x1110, 0x7887, 0x0001,
+	0x0016, 0x2009, 0x0040, 0x080c, 0x21c1, 0x001e, 0x2009, 0x0000,
+	0x080c, 0x0e55, 0x004e, 0x20a9, 0x03e8, 0x6824, 0xd094, 0x0140,
+	0x6827, 0x0004, 0x7804, 0x9084, 0x4000, 0x190c, 0x2a39, 0x0090,
+	0xd08c, 0x0118, 0x6827, 0x0002, 0x0010, 0x1f04, 0xa16d, 0x7804,
+	0x9084, 0x1000, 0x0138, 0x2001, 0x0100, 0x080c, 0x2a29, 0x9006,
+	0x080c, 0x2a29, 0x6827, 0x4000, 0x6824, 0x83ff, 0x1180, 0x2009,
+	0x0049, 0x6020, 0x9086, 0x0009, 0x0150, 0x080c, 0x9621, 0x6044,
+	0xd0ac, 0x1118, 0x6003, 0x0002, 0x0010, 0x080c, 0xac7c, 0x000e,
+	0x2071, 0x0380, 0xd08c, 0x1110, 0x701f, 0x0200, 0x000e, 0x001e,
+	0x002e, 0x006e, 0x00ce, 0x00de, 0x00ee, 0x00fe, 0x015e, 0x012e,
+	0x0005, 0x00d6, 0x0126, 0x2091, 0x8000, 0x2069, 0x19e6, 0x6a06,
+	0x012e, 0x00de, 0x0005, 0x00d6, 0x0126, 0x2091, 0x8000, 0x2069,
+	0x19e6, 0x6a3e, 0x012e, 0x00de, 0x0005, 0x080c, 0x9bd1, 0x785c,
+	0x7032, 0x7042, 0x7047, 0x1000, 0x00f8, 0x080c, 0x9bd1, 0x785c,
+	0x7032, 0x7042, 0x7047, 0x4000, 0x00b8, 0x080c, 0x9bd1, 0x785c,
+	0x7032, 0x7042, 0x7047, 0x2000, 0x0078, 0x080c, 0x9bd1, 0x785c,
+	0x7032, 0x7042, 0x7047, 0x0400, 0x0038, 0x080c, 0x9bd1, 0x785c,
+	0x7032, 0x7042, 0x7047, 0x0200, 0x60c3, 0x0020, 0x0804, 0x9de6,
+	0x00e6, 0x2071, 0x19e6, 0x702c, 0x9005, 0x0110, 0x8001, 0x702e,
+	0x00ee, 0x0005, 0x00f6, 0x00e6, 0x00d6, 0x00c6, 0x0076, 0x0066,
+	0x0006, 0x0126, 0x2091, 0x8000, 0x2071, 0x19e6, 0x7620, 0x2660,
+	0x2678, 0x2039, 0x0001, 0x87ff, 0x0904, 0xa295, 0x8cff, 0x0904,
+	0xa295, 0x6020, 0x9086, 0x0006, 0x1904, 0xa290, 0x88ff, 0x0138,
+	0x2800, 0x9c06, 0x1904, 0xa290, 0x2039, 0x0000, 0x0050, 0x6010,
+	0x9b06, 0x1904, 0xa290, 0x85ff, 0x0120, 0x605c, 0x9106, 0x1904,
+	0xa290, 0x7030, 0x9c06, 0x15b0, 0x2069, 0x0100, 0x68c0, 0x9005,
+	0x1160, 0x6824, 0xd084, 0x0148, 0x6827, 0x0001, 0x080c, 0x86d5,
+	0x080c, 0xa31a, 0x7033, 0x0000, 0x0428, 0x080c, 0x86d5, 0x6820,
+	0xd0b4, 0x0110, 0x68a7, 0x95f5, 0x6817, 0x0008, 0x68c3, 0x0000,
+	0x080c, 0xa31a, 0x7033, 0x0000, 0x0036, 0x2069, 0x0140, 0x6b04,
+	0x9384, 0x1000, 0x0138, 0x2001, 0x0100, 0x080c, 0x2a29, 0x9006,
+	0x080c, 0x2a29, 0x2069, 0x0100, 0x6824, 0xd084, 0x0110, 0x6827,
+	0x0001, 0x003e, 0x7020, 0x9c36, 0x1110, 0x660c, 0x7622, 0x701c,
+	0x9c36, 0x1140, 0x2c00, 0x9f36, 0x0118, 0x2f00, 0x701e, 0x0010,
+	0x701f, 0x0000, 0x660c, 0x0066, 0x2c00, 0x9f06, 0x0110, 0x7e0e,
+	0x0008, 0x2678, 0x89ff, 0x1168, 0x600f, 0x0000, 0x6014, 0x0096,
+	0x2048, 0x080c, 0xc830, 0x0110, 0x080c, 0xe27c, 0x009e, 0x080c,
+	0xac1a, 0x080c, 0xa1f0, 0x88ff, 0x1190, 0x00ce, 0x0804, 0xa20b,
+	0x2c78, 0x600c, 0x2060, 0x0804, 0xa20b, 0x9006, 0x012e, 0x000e,
+	0x006e, 0x007e, 0x00ce, 0x00de, 0x00ee, 0x00fe, 0x0005, 0x601b,
+	0x0000, 0x00ce, 0x98c5, 0x0001, 0x0c88, 0x00f6, 0x00e6, 0x00d6,
+	0x0096, 0x00c6, 0x0066, 0x0026, 0x0006, 0x0126, 0x2091, 0x8000,
+	0x2071, 0x19e6, 0x7648, 0x2660, 0x2678, 0x8cff, 0x0904, 0xa309,
+	0x6020, 0x9086, 0x0006, 0x1904, 0xa304, 0x87ff, 0x0128, 0x2700,
+	0x9c06, 0x1904, 0xa304, 0x0040, 0x6010, 0x9b06, 0x15e8, 0x85ff,
+	0x0118, 0x605c, 0x9106, 0x15c0, 0x704c, 0x9c06, 0x1168, 0x0036,
+	0x2019, 0x0001, 0x080c, 0xa0fa, 0x703f, 0x0000, 0x9006, 0x704e,
+	0x706a, 0x7052, 0x706e, 0x003e, 0x7048, 0x9c36, 0x1110, 0x660c,
+	0x764a, 0x7044, 0x9c36, 0x1140, 0x2c00, 0x9f36, 0x0118, 0x2f00,
+	0x7046, 0x0010, 0x7047, 0x0000, 0x660c, 0x0066, 0x2c00, 0x9f06,
+	0x0110, 0x7e0e, 0x0008, 0x2678, 0x600f, 0x0000, 0x6014, 0x2048,
+	0x080c, 0xc830, 0x0110, 0x080c, 0xe27c, 0x080c, 0xac1a, 0x87ff,
+	0x1198, 0x00ce, 0x0804, 0xa2b5, 0x2c78, 0x600c, 0x2060, 0x0804,
+	0xa2b5, 0x9006, 0x012e, 0x000e, 0x002e, 0x006e, 0x00ce, 0x009e,
+	0x00de, 0x00ee, 0x00fe, 0x0005, 0x601b, 0x0000, 0x00ce, 0x97bd,
+	0x0001, 0x0c80, 0x00e6, 0x2071, 0x19e6, 0x9006, 0x7032, 0x700a,
+	0x7004, 0x9086, 0x0003, 0x0158, 0x2001, 0x1800, 0x2004, 0x9086,
+	0x0002, 0x1118, 0x7007, 0x0005, 0x0010, 0x7007, 0x0000, 0x00ee,
+	0x0005, 0x00f6, 0x00e6, 0x00c6, 0x0066, 0x0026, 0x0006, 0x0126,
+	0x2091, 0x8000, 0x2071, 0x19e6, 0x2c10, 0x7648, 0x2660, 0x2678,
+	0x8cff, 0x0540, 0x2200, 0x9c06, 0x1508, 0x7048, 0x9c36, 0x1110,
+	0x660c, 0x764a, 0x7044, 0x9c36, 0x1140, 0x2c00, 0x9f36, 0x0118,
+	0x2f00, 0x7046, 0x0010, 0x7047, 0x0000, 0x660c, 0x2c00, 0x9f06,
+	0x0110, 0x7e0e, 0x0008, 0x2678, 0x600f, 0x0000, 0x6004, 0x9086,
+	0x0040, 0x090c, 0x95c6, 0x9085, 0x0001, 0x0020, 0x2c78, 0x600c,
+	0x2060, 0x08b0, 0x012e, 0x000e, 0x002e, 0x006e, 0x00ce, 0x00ee,
 	0x00fe, 0x0005, 0x0096, 0x00f6, 0x00e6, 0x00d6, 0x00c6, 0x0066,
-	0x0026, 0x0006, 0x0126, 0x2091, 0x8000, 0x2071, 0x19e7, 0x7610,
-	0x2660, 0x2678, 0x8cff, 0x0904, 0xa41a, 0x6010, 0x00b6, 0x2058,
-	0xb8a0, 0x00be, 0x9206, 0x1904, 0xa415, 0x7030, 0x9c06, 0x1520,
-	0x2069, 0x0100, 0x68c0, 0x9005, 0x0904, 0xa3f1, 0x080c, 0x9e32,
-	0x68c3, 0x0000, 0x080c, 0xa338, 0x7033, 0x0000, 0x0036, 0x2069,
+	0x0026, 0x0006, 0x0126, 0x2091, 0x8000, 0x2071, 0x19e6, 0x7610,
+	0x2660, 0x2678, 0x8cff, 0x0904, 0xa407, 0x6010, 0x00b6, 0x2058,
+	0xb8a0, 0x00be, 0x9206, 0x1904, 0xa402, 0x7030, 0x9c06, 0x1520,
+	0x2069, 0x0100, 0x68c0, 0x9005, 0x0904, 0xa3d9, 0x080c, 0x9e16,
+	0x68c3, 0x0000, 0x080c, 0xa31a, 0x7033, 0x0000, 0x0036, 0x2069,
 	0x0140, 0x6b04, 0x9384, 0x1000, 0x0138, 0x2001, 0x0100, 0x080c,
-	0x2a0a, 0x9006, 0x080c, 0x2a0a, 0x2069, 0x0100, 0x6824, 0xd084,
+	0x2a29, 0x9006, 0x080c, 0x2a29, 0x2069, 0x0100, 0x6824, 0xd084,
 	0x0110, 0x6827, 0x0001, 0x003e, 0x7010, 0x9c36, 0x1110, 0x660c,
 	0x7612, 0x700c, 0x9c36, 0x1140, 0x2c00, 0x9f36, 0x0118, 0x2f00,
 	0x700e, 0x0010, 0x700f, 0x0000, 0x660c, 0x0066, 0x2c00, 0x9f06,
-	0x0110, 0x7e0e, 0x0008, 0x2678, 0x600f, 0x0000, 0x080c, 0xca3c,
-	0x1158, 0x080c, 0x321c, 0x080c, 0xca4d, 0x11f0, 0x080c, 0xb5b5,
-	0x00d8, 0x080c, 0xa338, 0x08c0, 0x080c, 0xca4d, 0x1118, 0x080c,
-	0xb5b5, 0x0090, 0x6014, 0x2048, 0x080c, 0xc836, 0x0168, 0x6020,
-	0x9086, 0x0003, 0x1508, 0xa867, 0x0103, 0xab7a, 0xa877, 0x0000,
-	0x080c, 0x6d74, 0x080c, 0xca27, 0x080c, 0xccc4, 0x080c, 0xac28,
-	0x080c, 0xa20e, 0x00ce, 0x0804, 0xa39a, 0x2c78, 0x600c, 0x2060,
-	0x0804, 0xa39a, 0x012e, 0x000e, 0x002e, 0x006e, 0x00ce, 0x00de,
-	0x00ee, 0x00fe, 0x009e, 0x0005, 0x6020, 0x9086, 0x0006, 0x1d20,
-	0x080c, 0xe26c, 0x0c08, 0x00d6, 0x080c, 0x9aea, 0x7003, 0x0200,
-	0x7007, 0x0014, 0x60c3, 0x0014, 0x20e1, 0x0001, 0x2099, 0x1989,
-	0x20e9, 0x0000, 0x20a1, 0x0250, 0x20a9, 0x0004, 0x4003, 0x7023,
-	0x0004, 0x7027, 0x7878, 0x080c, 0x9e02, 0x00de, 0x0005, 0x080c,
-	0x9aea, 0x700b, 0x0800, 0x7814, 0x9084, 0xff00, 0x700e, 0x7814,
-	0x9084, 0x00ff, 0x7022, 0x782c, 0x7026, 0x7860, 0x9084, 0x00ff,
-	0x9085, 0x0200, 0x7002, 0x7860, 0x9084, 0xff00, 0x8007, 0x7006,
-	0x60c2, 0x0804, 0x9e02, 0x00b6, 0x00d6, 0x0016, 0x00d6, 0x2f68,
-	0x2009, 0x0035, 0x080c, 0xceca, 0x00de, 0x1904, 0xa4c8, 0x080c,
-	0x9a9f, 0x7003, 0x1300, 0x782c, 0x080c, 0xa5d3, 0x2068, 0x6820,
-	0x9086, 0x0003, 0x0560, 0x7810, 0x2058, 0xbaa0, 0x080c, 0xab57,
-	0x11d8, 0x9286, 0x007e, 0x1128, 0x700b, 0x00ff, 0x700f, 0xfffe,
-	0x0498, 0x9286, 0x007f, 0x1128, 0x700b, 0x00ff, 0x700f, 0xfffd,
-	0x0458, 0x9284, 0xff80, 0x0180, 0x9286, 0x0080, 0x1128, 0x700b,
-	0x00ff, 0x700f, 0xfffc, 0x0400, 0x92d8, 0x1000, 0x2b5c, 0xb810,
-	0x700a, 0xb814, 0x700e, 0x00c0, 0xb884, 0x700e, 0x00a8, 0x080c,
-	0xab57, 0x1130, 0x7810, 0x2058, 0xb8a0, 0x9082, 0x007e, 0x0250,
-	0x00d6, 0x2069, 0x181f, 0x2d04, 0x700a, 0x8d68, 0x2d04, 0x700e,
-	0x00de, 0x0010, 0x6034, 0x700e, 0x7838, 0x7012, 0x783c, 0x7016,
-	0x60c3, 0x000c, 0x001e, 0x00de, 0x080c, 0x9e02, 0x00be, 0x0005,
-	0x781b, 0x0001, 0x7803, 0x0006, 0x001e, 0x00de, 0x00be, 0x0005,
-	0x792c, 0x9180, 0x0008, 0x200c, 0x9186, 0x0006, 0x01c0, 0x9186,
-	0x0003, 0x0904, 0xa546, 0x9186, 0x0005, 0x0904, 0xa52e, 0x9186,
-	0x0004, 0x05f0, 0x9186, 0x0008, 0x0904, 0xa537, 0x7807, 0x0037,
-	0x782f, 0x0003, 0x7817, 0x1700, 0x080c, 0xa5b0, 0x0005, 0x080c,
-	0xa571, 0x00d6, 0x0026, 0x792c, 0x2168, 0x2009, 0x4000, 0x6800,
-	0x6a44, 0xd2fc, 0x11f8, 0x0002, 0xa50f, 0xa51a, 0xa511, 0xa51a,
-	0xa516, 0xa50f, 0xa50f, 0xa51a, 0xa51a, 0xa51a, 0xa51a, 0xa50f,
-	0xa50f, 0xa50f, 0xa50f, 0xa50f, 0xa51a, 0xa50f, 0xa51a, 0x080c,
-	0x0d7d, 0x6824, 0xd0e4, 0x0110, 0xd0cc, 0x0110, 0x900e, 0x0010,
-	0x2009, 0x2000, 0x682c, 0x7022, 0x6830, 0x7026, 0x0804, 0xa56a,
-	0x080c, 0xa571, 0x00d6, 0x0026, 0x792c, 0x2168, 0x2009, 0x4000,
-	0x6a00, 0x9286, 0x0002, 0x1108, 0x900e, 0x04e0, 0x080c, 0xa571,
-	0x00d6, 0x0026, 0x792c, 0x2168, 0x2009, 0x4000, 0x0498, 0x04c9,
-	0x00d6, 0x0026, 0x792c, 0x2168, 0x2009, 0x4000, 0x9286, 0x0005,
-	0x0118, 0x9286, 0x0002, 0x1108, 0x900e, 0x0420, 0x0451, 0x00d6,
-	0x0026, 0x792c, 0x2168, 0x6814, 0x0096, 0x2048, 0xa9ac, 0xa834,
-	0x9112, 0xa9b0, 0xa838, 0x009e, 0x9103, 0x7022, 0x7226, 0x792c,
-	0x9180, 0x0011, 0x2004, 0xd0fc, 0x1148, 0x9180, 0x0000, 0x2004,
-	0x908e, 0x0002, 0x0130, 0x908e, 0x0004, 0x0118, 0x2009, 0x4000,
-	0x0008, 0x900e, 0x712a, 0x60c3, 0x0018, 0x002e, 0x00de, 0x0804,
-	0x9e02, 0x00b6, 0x0036, 0x0046, 0x0056, 0x0066, 0x080c, 0x9aea,
-	0x9006, 0x7003, 0x0200, 0x7938, 0x710a, 0x793c, 0x710e, 0x7810,
-	0x2058, 0xb8a0, 0x080c, 0xab57, 0x1118, 0x9092, 0x007e, 0x0268,
-	0x00d6, 0x2069, 0x181f, 0x2d2c, 0x8d68, 0x2d34, 0x90d8, 0x1000,
-	0x2b5c, 0xbb10, 0xbc14, 0x00de, 0x0028, 0x901e, 0xbc84, 0x2029,
-	0x0000, 0x6634, 0x782c, 0x9080, 0x0008, 0x2004, 0x9086, 0x0003,
-	0x1128, 0x7512, 0x7616, 0x731a, 0x741e, 0x0020, 0x7312, 0x7416,
-	0x751a, 0x761e, 0x006e, 0x005e, 0x004e, 0x003e, 0x00be, 0x0005,
-	0x080c, 0x9aea, 0x7003, 0x0100, 0x782c, 0x700a, 0x7814, 0x700e,
-	0x700e, 0x60c3, 0x0008, 0x0804, 0x9e02, 0x080c, 0x9a96, 0x7003,
-	0x1400, 0x7838, 0x700a, 0x0079, 0x783c, 0x700e, 0x782c, 0x7012,
-	0x7830, 0x7016, 0x7834, 0x9084, 0x00ff, 0x8007, 0x701a, 0x60c3,
-	0x0010, 0x0804, 0x9e02, 0x00e6, 0x2071, 0x0240, 0x0006, 0x00f6,
-	0x2078, 0x7810, 0x00b6, 0x2058, 0xb8d4, 0xd084, 0x0120, 0x7850,
-	0x702a, 0x784c, 0x702e, 0x00be, 0x00fe, 0x000e, 0x00ee, 0x0005,
-	0x080c, 0x9ae1, 0x7003, 0x0100, 0x782c, 0x700a, 0x7814, 0x700e,
-	0x60c3, 0x0008, 0x0804, 0x9e02, 0x00a9, 0x7914, 0x712a, 0x60c3,
-	0x0000, 0x60a7, 0x9575, 0x0026, 0x080c, 0x2979, 0x0228, 0x2011,
-	0x0101, 0x2204, 0xc0c5, 0x2012, 0x002e, 0x080c, 0x9e25, 0x080c,
-	0x86ed, 0x0005, 0x0036, 0x0096, 0x00d6, 0x00e6, 0x7860, 0x2048,
-	0xaa7c, 0x9296, 0x00c0, 0x9294, 0xfffd, 0xaa7e, 0xaa80, 0x9294,
-	0x0300, 0xaa82, 0xa96c, 0x9194, 0x00ff, 0xab74, 0x9384, 0x00ff,
-	0x908d, 0xc200, 0xa96e, 0x9384, 0xff00, 0x9215, 0xaa76, 0xa870,
-	0xaa78, 0xa87a, 0xaa72, 0x00d6, 0x2069, 0x0200, 0x080c, 0xa690,
-	0x00de, 0x20e9, 0x0000, 0x20a1, 0x0240, 0x20a9, 0x000a, 0xa860,
-	0x20e0, 0xa85c, 0x9080, 0x001b, 0x2098, 0x4003, 0x60a3, 0x0035,
-	0xaa68, 0x9294, 0x7000, 0x9286, 0x3000, 0x0110, 0x60a3, 0x0037,
-	0x00ee, 0x00de, 0x009e, 0x003e, 0x0005, 0x900e, 0x7814, 0x0096,
-	0x2048, 0xa87c, 0xd0fc, 0x01c0, 0x9084, 0x0003, 0x11a8, 0x2001,
-	0x180c, 0x2004, 0xd0bc, 0x0180, 0x7824, 0xd0cc, 0x1168, 0xd0c4,
-	0x1158, 0xa8a8, 0x9005, 0x1140, 0x2001, 0x180c, 0x200c, 0xc1d5,
-	0x2102, 0x2009, 0x19b2, 0x210c, 0x009e, 0x918d, 0x0092, 0x0010,
-	0x2009, 0x0096, 0x60ab, 0x0036, 0x0026, 0x2110, 0x900e, 0x080c,
-	0x2a53, 0x002e, 0x0005, 0x2009, 0x0009, 0x00a0, 0x2009, 0x000a,
-	0x0088, 0x2009, 0x000b, 0x0070, 0x2009, 0x000c, 0x0058, 0x2009,
-	0x000d, 0x0040, 0x2009, 0x000e, 0x0028, 0x2009, 0x000f, 0x0010,
-	0x2009, 0x0008, 0x6912, 0x0005, 0x080c, 0x9a9f, 0x0016, 0x0026,
-	0x0096, 0x00d6, 0x7814, 0x2048, 0x7013, 0x0138, 0x2001, 0x1837,
-	0x2004, 0x9084, 0x0028, 0x1138, 0x2001, 0x197c, 0x2004, 0x9086,
-	0xaaaa, 0x1904, 0xa735, 0x7003, 0x5400, 0x00c6, 0x2061, 0x1800,
-	0x607c, 0x9084, 0x00ff, 0xa998, 0x810f, 0x918c, 0xff00, 0x9105,
-	0x700a, 0x6080, 0x700e, 0xa998, 0x918c, 0xff00, 0x7112, 0x20a9,
-	0x0004, 0x2009, 0x1805, 0x2e10, 0x9290, 0x0006, 0x2104, 0x2012,
-	0x8108, 0x8210, 0x1f04, 0xa6c6, 0x20a9, 0x0004, 0x2009, 0x1801,
-	0x2104, 0x2012, 0x8108, 0x8210, 0x1f04, 0xa6d0, 0xa860, 0x20e0,
-	0xa85c, 0x9080, 0x0029, 0x2098, 0x2009, 0x0006, 0x20a9, 0x0001,
-	0x4002, 0x8007, 0x2012, 0x8210, 0x8109, 0x1dc0, 0x00d6, 0x2069,
-	0x0200, 0x080c, 0xa67b, 0x00de, 0x2071, 0x0240, 0x2011, 0x0240,
-	0x2009, 0x0002, 0x20a9, 0x0001, 0x4002, 0x8007, 0x2012, 0x8210,
-	0x8109, 0x1dc0, 0x2009, 0x0008, 0x20a9, 0x0001, 0x4002, 0x8007,
-	0x2012, 0x8210, 0x8109, 0x1dc0, 0xa85c, 0x9080, 0x0031, 0x2098,
-	0x2009, 0x0008, 0x20a9, 0x0001, 0x4002, 0x8007, 0x2012, 0x8210,
-	0x8109, 0x1dc0, 0x00ce, 0x60c3, 0x004c, 0x60a3, 0x0056, 0x60a7,
-	0x9575, 0x2001, 0x1837, 0x2004, 0x9084, 0x0028, 0x1168, 0x080c,
-	0x74e9, 0x0150, 0x6028, 0xc0bd, 0x602a, 0x2009, 0x1804, 0x2011,
-	0x0029, 0x080c, 0x2a53, 0x0010, 0x080c, 0x9e02, 0x080c, 0x86ed,
-	0x00de, 0x009e, 0x002e, 0x001e, 0x0005, 0x00e6, 0x2071, 0x0240,
-	0x2001, 0x2200, 0x9085, 0x00ff, 0x7002, 0x7007, 0xffff, 0x2071,
-	0x0100, 0x709b, 0x00ff, 0x00ee, 0x0804, 0xa6ab, 0x080c, 0x9a9f,
-	0x0016, 0x0026, 0x0096, 0x00d6, 0x7814, 0x2048, 0x7013, 0x0138,
-	0x7003, 0x5500, 0x00c6, 0xa89c, 0x9084, 0x00ff, 0xa998, 0x810f,
-	0x918c, 0xff00, 0x9105, 0x700a, 0xa99c, 0x918c, 0xff00, 0xa8a0,
-	0x9084, 0x00ff, 0x9105, 0x700e, 0xa998, 0x918c, 0xff00, 0x2061,
-	0x1800, 0x607c, 0x9084, 0x00ff, 0x910d, 0x7112, 0x6180, 0x7116,
-	0x2009, 0x0008, 0xa860, 0x20e0, 0xa85c, 0x9080, 0x0029, 0x2098,
-	0x2e10, 0x9290, 0x0006, 0x20a9, 0x0001, 0x4002, 0x8007, 0x2012,
-	0x8210, 0x8109, 0x1dc0, 0x20a9, 0x0004, 0x2009, 0x1805, 0x2104,
-	0x2012, 0x8108, 0x8210, 0x1f04, 0xa787, 0x20a9, 0x0002, 0x2009,
-	0x1801, 0x2104, 0x2012, 0x8108, 0x8210, 0x1f04, 0xa791, 0x00d6,
-	0x0016, 0x2069, 0x0200, 0x080c, 0xa67b, 0x001e, 0x00de, 0x2071,
-	0x0240, 0x20a9, 0x0002, 0x2009, 0x1803, 0x2011, 0x0240, 0x2104,
-	0x2012, 0x8108, 0x8210, 0x1f04, 0xa7a7, 0x2009, 0x0008, 0x4002,
-	0x8007, 0x2012, 0x8210, 0x8109, 0x1dd0, 0x9006, 0x20a9, 0x0008,
-	0x2012, 0x8210, 0x1f04, 0xa7b8, 0x00ce, 0x60c3, 0x004c, 0x60a3,
-	0x0056, 0x60a7, 0x9575, 0x080c, 0x9e02, 0x080c, 0x86ed, 0x00de,
-	0x009e, 0x002e, 0x001e, 0x0005, 0x00d6, 0x9290, 0x0018, 0x8214,
-	0x20e9, 0x0000, 0x2069, 0x0200, 0x6813, 0x0000, 0x22a8, 0x9284,
-	0x00e0, 0x0128, 0x20a9, 0x0020, 0x9292, 0x0020, 0x0008, 0x9016,
-	0x20a1, 0x0240, 0x9006, 0x4004, 0x82ff, 0x0120, 0x6810, 0x8000,
-	0x6812, 0x0c60, 0x00de, 0x0005, 0x00f6, 0x00e6, 0x00d6, 0x00c6,
-	0x00a6, 0x0096, 0x0066, 0x0126, 0x2091, 0x8000, 0x2071, 0x19e7,
-	0x7610, 0x2660, 0x2678, 0x8cff, 0x0904, 0xa873, 0x7030, 0x9c06,
-	0x1520, 0x2069, 0x0100, 0x68c0, 0x9005, 0x0904, 0xa84a, 0x080c,
-	0x9e32, 0x68c3, 0x0000, 0x080c, 0xa338, 0x7033, 0x0000, 0x0036,
-	0x2069, 0x0140, 0x6b04, 0x9384, 0x1000, 0x0138, 0x2001, 0x0100,
-	0x080c, 0x2a0a, 0x9006, 0x080c, 0x2a0a, 0x2069, 0x0100, 0x6824,
-	0xd084, 0x0110, 0x6827, 0x0001, 0x003e, 0x7010, 0x9c36, 0x1110,
-	0x660c, 0x7612, 0x700c, 0x9c36, 0x1140, 0x2c00, 0x9f36, 0x0118,
-	0x2f00, 0x700e, 0x0010, 0x700f, 0x0000, 0x660c, 0x0066, 0x2c00,
-	0x9f06, 0x0110, 0x7e0e, 0x0008, 0x2678, 0x600f, 0x0000, 0x080c,
-	0xca3c, 0x1158, 0x080c, 0x321c, 0x080c, 0xca4d, 0x11f0, 0x080c,
-	0xb5b5, 0x00d8, 0x080c, 0xa338, 0x08c0, 0x080c, 0xca4d, 0x1118,
-	0x080c, 0xb5b5, 0x0090, 0x6014, 0x2048, 0x080c, 0xc836, 0x0168,
-	0x6020, 0x9086, 0x0003, 0x1520, 0xa867, 0x0103, 0xab7a, 0xa877,
-	0x0000, 0x080c, 0x6d80, 0x080c, 0xca27, 0x080c, 0xccc4, 0x080c,
-	0xac28, 0x080c, 0xa20e, 0x00ce, 0x0804, 0xa7fb, 0x2c78, 0x600c,
-	0x2060, 0x0804, 0xa7fb, 0x7013, 0x0000, 0x700f, 0x0000, 0x012e,
-	0x006e, 0x009e, 0x00ae, 0x00ce, 0x00de, 0x00ee, 0x00fe, 0x0005,
-	0x6020, 0x9086, 0x0006, 0x1d08, 0x080c, 0xe26c, 0x08f0, 0x00f6,
-	0x0036, 0x2079, 0x0380, 0x7b18, 0xd3bc, 0x1de8, 0x7832, 0x7936,
-	0x7a3a, 0x781b, 0x8080, 0x003e, 0x00fe, 0x0005, 0x0016, 0x2001,
-	0x0382, 0x2004, 0x9084, 0x0007, 0x9086, 0x0001, 0x1188, 0x2001,
-	0x0015, 0x0c29, 0x2009, 0x1000, 0x2001, 0x0382, 0x2004, 0x9084,
-	0x0007, 0x9086, 0x0003, 0x0120, 0x8109, 0x1db0, 0x080c, 0x0d7d,
-	0x001e, 0x0005, 0x2001, 0x0382, 0x2004, 0x9084, 0x0007, 0x9086,
-	0x0003, 0x1120, 0x2001, 0x0380, 0x2003, 0x0001, 0x0005, 0x0156,
-	0x0016, 0x0026, 0x00e6, 0x900e, 0x2071, 0x19e7, 0x0469, 0x0106,
-	0x0190, 0x7004, 0x9086, 0x0003, 0x0148, 0x20a9, 0x1000, 0x6044,
-	0xd0fc, 0x01d8, 0x1f04, 0xa8cf, 0x080c, 0x0d7d, 0x080c, 0xa896,
-	0x6044, 0xd0fc, 0x0190, 0x7030, 0x9c06, 0x1148, 0x080c, 0x95de,
-	0x6044, 0xd0dc, 0x0150, 0xc0dc, 0x6046, 0x700a, 0x7042, 0x704c,
-	0x9c06, 0x190c, 0x0d7d, 0x080c, 0x963b, 0x010e, 0x1919, 0x00ee,
-	0x002e, 0x001e, 0x015e, 0x0005, 0x2001, 0x0382, 0x2004, 0x9084,
-	0x0007, 0x9086, 0x0003, 0x0005, 0x0126, 0x2091, 0x2400, 0x7808,
-	0xd0a4, 0x190c, 0x0d76, 0xd09c, 0x0128, 0x7820, 0x908c, 0xf000,
-	0x11b8, 0x0012, 0x012e, 0x0005, 0xa91c, 0xa95a, 0xa981, 0xa9b8,
-	0xa9c8, 0xa9d9, 0xa9e8, 0xa9f6, 0xaa23, 0xaa27, 0xa91c, 0xa91c,
-	0xa91c, 0xa91c, 0xa91c, 0xa91c, 0x080c, 0x0d7d, 0x012e, 0x0005,
-	0x2060, 0x6044, 0xd0bc, 0x0140, 0xc0bc, 0x6046, 0x6000, 0x908a,
-	0x0016, 0x1a0c, 0x0d7d, 0x0012, 0x012e, 0x0005, 0xa941, 0xa943,
-	0xa941, 0xa949, 0xa941, 0xa941, 0xa941, 0xa941, 0xa941, 0xa943,
-	0xa941, 0xa943, 0xa941, 0xa943, 0xa941, 0xa941, 0xa941, 0xa943,
-	0xa941, 0x080c, 0x0d7d, 0x2009, 0x0013, 0x080c, 0xac8c, 0x012e,
-	0x0005, 0x6014, 0x2048, 0xa87c, 0xd0dc, 0x0130, 0x080c, 0x88c1,
-	0x080c, 0xabed, 0x012e, 0x0005, 0x2009, 0x0049, 0x080c, 0xac8c,
-	0x012e, 0x0005, 0x080c, 0xa896, 0x2001, 0x1a0c, 0x2003, 0x0000,
-	0x7030, 0x9065, 0x090c, 0x0d7d, 0x7034, 0x9092, 0x00c8, 0x1258,
-	0x8000, 0x7036, 0x7004, 0x9086, 0x0003, 0x0110, 0x7007, 0x0000,
-	0x781f, 0x0808, 0x0040, 0x080c, 0xe717, 0x6003, 0x0001, 0x2009,
-	0x0014, 0x080c, 0xac8c, 0x781f, 0x0100, 0x080c, 0xa8b2, 0x012e,
-	0x0005, 0x080c, 0xa896, 0x714c, 0x81ff, 0x1128, 0x2011, 0x1a0f,
-	0x2013, 0x0000, 0x0438, 0x2061, 0x0100, 0x7150, 0x9192, 0x7530,
-	0x12f0, 0x8108, 0x7152, 0x714c, 0x9188, 0x0008, 0x210c, 0x918e,
-	0x0006, 0x1138, 0x6014, 0x9084, 0x1984, 0x9085, 0x0012, 0x6016,
-	0x0088, 0x714c, 0x9188, 0x0008, 0x210c, 0x918e, 0x0009, 0x0d90,
-	0x6014, 0x9084, 0x1984, 0x9085, 0x0016, 0x6016, 0x0018, 0x706c,
-	0xc085, 0x706e, 0x781f, 0x0200, 0x080c, 0xa8b2, 0x012e, 0x0005,
-	0x080c, 0xa896, 0x714c, 0x2160, 0x6003, 0x0003, 0x2009, 0x004a,
-	0x080c, 0xac8c, 0x781f, 0x0200, 0x080c, 0xa8b2, 0x012e, 0x0005,
-	0x7808, 0xd09c, 0x0de8, 0x7820, 0x2060, 0x6003, 0x0003, 0x080c,
-	0xa896, 0x080c, 0x1d60, 0x781f, 0x0400, 0x080c, 0xa8b2, 0x012e,
-	0x0005, 0x7808, 0xd09c, 0x0de8, 0x7820, 0x2060, 0x080c, 0xa896,
-	0x080c, 0x1da8, 0x781f, 0x0400, 0x080c, 0xa8b2, 0x012e, 0x0005,
-	0x7030, 0x9065, 0x0148, 0x6044, 0xc0bc, 0x6046, 0x7104, 0x9186,
-	0x0003, 0x0110, 0x080c, 0x96a1, 0x012e, 0x0005, 0x00f6, 0x703c,
-	0x9086, 0x0002, 0x0528, 0x704c, 0x907d, 0x0510, 0x7844, 0xc0bc,
-	0x7846, 0x7820, 0x9086, 0x0009, 0x0118, 0x080c, 0x9d5c, 0x00c0,
-	0x7828, 0xd0fc, 0x1118, 0x080c, 0x9cdb, 0x0090, 0x2001, 0x1837,
-	0x2004, 0x9084, 0x0028, 0x1130, 0x2001, 0x197c, 0x2004, 0x9086,
-	0xaaaa, 0x1120, 0x2001, 0x0387, 0x2003, 0x1000, 0x080c, 0x9c60,
-	0x00fe, 0x012e, 0x0005, 0x080c, 0x758a, 0x012e, 0x0005, 0x080c,
-	0x0d7d, 0x0005, 0x00e6, 0x2071, 0x19e7, 0x6044, 0xc0bc, 0x6046,
-	0xd0fc, 0x01b8, 0x704c, 0x9c06, 0x1190, 0x2019, 0x0001, 0x080c,
-	0xa118, 0x704f, 0x0000, 0x2001, 0x0109, 0x2004, 0xd08c, 0x1138,
-	0x2001, 0x0108, 0x2004, 0xd0bc, 0x1110, 0x703f, 0x0000, 0x080c,
-	0xa34e, 0x00ee, 0x0005, 0x0026, 0x7010, 0x9c06, 0x1178, 0x080c,
-	0xa20e, 0x6044, 0xc0fc, 0x6046, 0x600c, 0x9015, 0x0120, 0x7212,
-	0x600f, 0x0000, 0x0010, 0x7212, 0x720e, 0x9006, 0x002e, 0x0005,
-	0x0026, 0x7020, 0x9c06, 0x1178, 0x080c, 0xa20e, 0x6044, 0xc0fc,
-	0x6046, 0x600c, 0x9015, 0x0120, 0x7222, 0x600f, 0x0000, 0x0010,
-	0x7222, 0x721e, 0x9006, 0x002e, 0x0005, 0x00d6, 0x0036, 0x7830,
-	0x9c06, 0x1558, 0x2069, 0x0100, 0x68c0, 0x9005, 0x01f8, 0x080c,
-	0x86f6, 0x080c, 0x9e32, 0x68c3, 0x0000, 0x080c, 0xa338, 0x2069,
-	0x0140, 0x6b04, 0x9384, 0x1000, 0x0138, 0x2001, 0x0100, 0x080c,
-	0x2a0a, 0x9006, 0x080c, 0x2a0a, 0x2069, 0x0100, 0x6824, 0xd084,
-	0x0110, 0x6827, 0x0001, 0x9085, 0x0001, 0x0038, 0x7808, 0xc0ad,
-	0x780a, 0x6003, 0x0009, 0x630a, 0x9006, 0x003e, 0x00de, 0x0005,
-	0x0016, 0x0026, 0x0036, 0x6100, 0x2019, 0x0100, 0x2001, 0x0382,
-	0x2004, 0xd09c, 0x0190, 0x00c6, 0x0126, 0x2091, 0x2800, 0x0016,
-	0x0036, 0x080c, 0xa8fc, 0x003e, 0x001e, 0x012e, 0x00ce, 0x6200,
-	0x2200, 0x9106, 0x0d58, 0x2200, 0x0010, 0x8319, 0x1d38, 0x003e,
-	0x002e, 0x001e, 0x0005, 0x00d6, 0x0156, 0x080c, 0x9aea, 0x7a14,
-	0x82ff, 0x0138, 0x7003, 0x0100, 0x700b, 0x0003, 0x60c3, 0x0008,
-	0x0490, 0x7003, 0x0200, 0x7007, 0x0000, 0x2069, 0x1800, 0x901e,
-	0x6800, 0x9086, 0x0004, 0x1110, 0xc38d, 0x0060, 0x080c, 0x74e9,
-	0x1110, 0xc3ad, 0x0008, 0xc3a5, 0x6adc, 0xd29c, 0x1110, 0xd2ac,
-	0x0108, 0xc39d, 0x730e, 0x080c, 0x87bb, 0x20a9, 0x0006, 0x2011,
-	0xfff4, 0x2019, 0xfff5, 0x2071, 0x0250, 0x2305, 0x2072, 0x8e70,
-	0x2205, 0x2072, 0x8e70, 0x9398, 0x0002, 0x9290, 0x0002, 0x1f04,
-	0xaafd, 0x60c3, 0x0020, 0x080c, 0x9e02, 0x015e, 0x00de, 0x0005,
-	0x0156, 0x080c, 0x9aea, 0x7a14, 0x82ff, 0x0168, 0x9286, 0xffff,
-	0x0118, 0x9282, 0x000e, 0x1238, 0x7003, 0x0100, 0x700b, 0x0003,
-	0x60c3, 0x0008, 0x0488, 0x7003, 0x0200, 0x7007, 0x001c, 0x700f,
-	0x0001, 0x2011, 0x19bd, 0x2204, 0x8007, 0x701a, 0x8210, 0x2204,
-	0x8007, 0x701e, 0x0421, 0x1120, 0xb8a0, 0x9082, 0x007f, 0x0248,
-	0x2001, 0x181f, 0x2004, 0x7022, 0x2001, 0x1820, 0x2004, 0x7026,
-	0x0030, 0x2001, 0x1818, 0x2004, 0x9084, 0x00ff, 0x7026, 0x20a9,
-	0x0004, 0x20e1, 0x0001, 0x2099, 0x1805, 0x20e9, 0x0000, 0x20a1,
-	0x0256, 0x4003, 0x60c3, 0x001c, 0x015e, 0x0804, 0x9e02, 0x0006,
-	0x2001, 0x1837, 0x2004, 0xd0ac, 0x000e, 0x0005, 0x2011, 0x0003,
-	0x080c, 0xa1cf, 0x2011, 0x0002, 0x080c, 0xa1d9, 0x080c, 0xa098,
-	0x0036, 0x901e, 0x080c, 0xa118, 0x003e, 0x0005, 0x080c, 0x336d,
-	0x0188, 0x0016, 0x00b6, 0x00c6, 0x7010, 0x9085, 0x0020, 0x7012,
-	0x2009, 0x007e, 0x080c, 0x6625, 0xb85c, 0xc0ac, 0xb85e, 0x00ce,
-	0x00be, 0x001e, 0x0005, 0x2071, 0x188d, 0x7000, 0x9005, 0x0140,
-	0x2001, 0x0812, 0x2071, 0x1800, 0x7076, 0x707a, 0x706b, 0xffd4,
-	0x2071, 0x1800, 0x7074, 0x7056, 0x705b, 0x1ddc, 0x0005, 0x00e6,
-	0x0126, 0x2071, 0x1800, 0x2091, 0x8000, 0x7554, 0x9582, 0x0010,
-	0x0608, 0x7058, 0x2060, 0x6000, 0x9086, 0x0000, 0x0148, 0x9ce0,
-	0x001c, 0x7068, 0x9c02, 0x1208, 0x0cb0, 0x2061, 0x1ddc, 0x0c98,
-	0x6003, 0x0008, 0x8529, 0x7556, 0x9ca8, 0x001c, 0x7068, 0x9502,
-	0x1230, 0x755a, 0x9085, 0x0001, 0x012e, 0x00ee, 0x0005, 0x705b,
-	0x1ddc, 0x0cc0, 0x9006, 0x0cc0, 0x00e6, 0x2071, 0x1800, 0x7554,
-	0x9582, 0x0010, 0x0600, 0x7058, 0x2060, 0x6000, 0x9086, 0x0000,
+	0x0110, 0x7e0e, 0x0008, 0x2678, 0x600f, 0x0000, 0x080c, 0xca36,
+	0x1180, 0x080c, 0x321e, 0x080c, 0xca47, 0x1518, 0x080c, 0xb5a6,
+	0x0400, 0x080c, 0xa31a, 0x6824, 0xd084, 0x09b0, 0x6827, 0x0001,
+	0x0898, 0x080c, 0xca47, 0x1118, 0x080c, 0xb5a6, 0x0090, 0x6014,
+	0x2048, 0x080c, 0xc830, 0x0168, 0x6020, 0x9086, 0x0003, 0x1508,
+	0xa867, 0x0103, 0xab7a, 0xa877, 0x0000, 0x080c, 0x6d6f, 0x080c,
+	0xca21, 0x080c, 0xccc3, 0x080c, 0xac1a, 0x080c, 0xa1f0, 0x00ce,
+	0x0804, 0xa382, 0x2c78, 0x600c, 0x2060, 0x0804, 0xa382, 0x012e,
+	0x000e, 0x002e, 0x006e, 0x00ce, 0x00de, 0x00ee, 0x00fe, 0x009e,
+	0x0005, 0x6020, 0x9086, 0x0006, 0x1d20, 0x080c, 0xe27c, 0x0c08,
+	0x00d6, 0x080c, 0x9ace, 0x7003, 0x0200, 0x7007, 0x0014, 0x60c3,
+	0x0014, 0x20e1, 0x0001, 0x2099, 0x1988, 0x20e9, 0x0000, 0x20a1,
+	0x0250, 0x20a9, 0x0004, 0x4003, 0x7023, 0x0004, 0x7027, 0x7878,
+	0x080c, 0x9de6, 0x00de, 0x0005, 0x080c, 0x9ace, 0x700b, 0x0800,
+	0x7814, 0x9084, 0xff00, 0x700e, 0x7814, 0x9084, 0x00ff, 0x7022,
+	0x782c, 0x7026, 0x7860, 0x9084, 0x00ff, 0x9085, 0x0200, 0x7002,
+	0x7860, 0x9084, 0xff00, 0x8007, 0x7006, 0x60c2, 0x0804, 0x9de6,
+	0x00b6, 0x00d6, 0x0016, 0x00d6, 0x2f68, 0x2009, 0x0035, 0x080c,
+	0xcec9, 0x00de, 0x1904, 0xa4b5, 0x080c, 0x9a83, 0x7003, 0x1300,
+	0x782c, 0x080c, 0xa5c0, 0x2068, 0x6820, 0x9086, 0x0003, 0x0560,
+	0x7810, 0x2058, 0xbaa0, 0x080c, 0xab49, 0x11d8, 0x9286, 0x007e,
+	0x1128, 0x700b, 0x00ff, 0x700f, 0xfffe, 0x0498, 0x9286, 0x007f,
+	0x1128, 0x700b, 0x00ff, 0x700f, 0xfffd, 0x0458, 0x9284, 0xff80,
+	0x0180, 0x9286, 0x0080, 0x1128, 0x700b, 0x00ff, 0x700f, 0xfffc,
+	0x0400, 0x92d8, 0x1000, 0x2b5c, 0xb810, 0x700a, 0xb814, 0x700e,
+	0x00c0, 0xb884, 0x700e, 0x00a8, 0x080c, 0xab49, 0x1130, 0x7810,
+	0x2058, 0xb8a0, 0x9082, 0x007e, 0x0250, 0x00d6, 0x2069, 0x181f,
+	0x2d04, 0x700a, 0x8d68, 0x2d04, 0x700e, 0x00de, 0x0010, 0x6034,
+	0x700e, 0x7838, 0x7012, 0x783c, 0x7016, 0x60c3, 0x000c, 0x001e,
+	0x00de, 0x080c, 0x9de6, 0x00be, 0x0005, 0x781b, 0x0001, 0x7803,
+	0x0006, 0x001e, 0x00de, 0x00be, 0x0005, 0x792c, 0x9180, 0x0008,
+	0x200c, 0x9186, 0x0006, 0x01c0, 0x9186, 0x0003, 0x0904, 0xa533,
+	0x9186, 0x0005, 0x0904, 0xa51b, 0x9186, 0x0004, 0x05f0, 0x9186,
+	0x0008, 0x0904, 0xa524, 0x7807, 0x0037, 0x782f, 0x0003, 0x7817,
+	0x1700, 0x080c, 0xa59d, 0x0005, 0x080c, 0xa55e, 0x00d6, 0x0026,
+	0x792c, 0x2168, 0x2009, 0x4000, 0x6800, 0x6a44, 0xd2fc, 0x11f8,
+	0x0002, 0xa4fc, 0xa507, 0xa4fe, 0xa507, 0xa503, 0xa4fc, 0xa4fc,
+	0xa507, 0xa507, 0xa507, 0xa507, 0xa4fc, 0xa4fc, 0xa4fc, 0xa4fc,
+	0xa4fc, 0xa507, 0xa4fc, 0xa507, 0x080c, 0x0d7d, 0x6824, 0xd0e4,
+	0x0110, 0xd0cc, 0x0110, 0x900e, 0x0010, 0x2009, 0x2000, 0x682c,
+	0x7022, 0x6830, 0x7026, 0x0804, 0xa557, 0x080c, 0xa55e, 0x00d6,
+	0x0026, 0x792c, 0x2168, 0x2009, 0x4000, 0x6a00, 0x9286, 0x0002,
+	0x1108, 0x900e, 0x04e0, 0x080c, 0xa55e, 0x00d6, 0x0026, 0x792c,
+	0x2168, 0x2009, 0x4000, 0x0498, 0x04c9, 0x00d6, 0x0026, 0x792c,
+	0x2168, 0x2009, 0x4000, 0x9286, 0x0005, 0x0118, 0x9286, 0x0002,
+	0x1108, 0x900e, 0x0420, 0x0451, 0x00d6, 0x0026, 0x792c, 0x2168,
+	0x6814, 0x0096, 0x2048, 0xa9ac, 0xa834, 0x9112, 0xa9b0, 0xa838,
+	0x009e, 0x9103, 0x7022, 0x7226, 0x792c, 0x9180, 0x0011, 0x2004,
+	0xd0fc, 0x1148, 0x9180, 0x0000, 0x2004, 0x908e, 0x0002, 0x0130,
+	0x908e, 0x0004, 0x0118, 0x2009, 0x4000, 0x0008, 0x900e, 0x712a,
+	0x60c3, 0x0018, 0x002e, 0x00de, 0x0804, 0x9de6, 0x00b6, 0x0036,
+	0x0046, 0x0056, 0x0066, 0x080c, 0x9ace, 0x9006, 0x7003, 0x0200,
+	0x7938, 0x710a, 0x793c, 0x710e, 0x7810, 0x2058, 0xb8a0, 0x080c,
+	0xab49, 0x1118, 0x9092, 0x007e, 0x0268, 0x00d6, 0x2069, 0x181f,
+	0x2d2c, 0x8d68, 0x2d34, 0x90d8, 0x1000, 0x2b5c, 0xbb10, 0xbc14,
+	0x00de, 0x0028, 0x901e, 0xbc84, 0x2029, 0x0000, 0x6634, 0x782c,
+	0x9080, 0x0008, 0x2004, 0x9086, 0x0003, 0x1128, 0x7512, 0x7616,
+	0x731a, 0x741e, 0x0020, 0x7312, 0x7416, 0x751a, 0x761e, 0x006e,
+	0x005e, 0x004e, 0x003e, 0x00be, 0x0005, 0x080c, 0x9ace, 0x7003,
+	0x0100, 0x782c, 0x700a, 0x7814, 0x700e, 0x700e, 0x60c3, 0x0008,
+	0x0804, 0x9de6, 0x080c, 0x9a7a, 0x7003, 0x1400, 0x7838, 0x700a,
+	0x0079, 0x783c, 0x700e, 0x782c, 0x7012, 0x7830, 0x7016, 0x7834,
+	0x9084, 0x00ff, 0x8007, 0x701a, 0x60c3, 0x0010, 0x0804, 0x9de6,
+	0x00e6, 0x2071, 0x0240, 0x0006, 0x00f6, 0x2078, 0x7810, 0x00b6,
+	0x2058, 0xb8d4, 0xd084, 0x0120, 0x7850, 0x702a, 0x784c, 0x702e,
+	0x00be, 0x00fe, 0x000e, 0x00ee, 0x0005, 0x080c, 0x9ac5, 0x7003,
+	0x0100, 0x782c, 0x700a, 0x7814, 0x700e, 0x60c3, 0x0008, 0x0804,
+	0x9de6, 0x00a9, 0x7914, 0x712a, 0x60c3, 0x0000, 0x60a7, 0x9575,
+	0x0026, 0x080c, 0x2998, 0x0228, 0x2011, 0x0101, 0x2204, 0xc0c5,
+	0x2012, 0x002e, 0x080c, 0x9e09, 0x080c, 0x86cc, 0x0005, 0x0036,
+	0x0096, 0x00d6, 0x00e6, 0x7860, 0x2048, 0xaa7c, 0x9296, 0x00c0,
+	0x9294, 0xfffd, 0xaa7e, 0xaa80, 0x9294, 0x0300, 0xaa82, 0xa96c,
+	0x9194, 0x00ff, 0xab74, 0x9384, 0x00ff, 0x908d, 0xc200, 0xa96e,
+	0x9384, 0xff00, 0x9215, 0xaa76, 0xa870, 0xaa78, 0xa87a, 0xaa72,
+	0x00d6, 0x2069, 0x0200, 0x080c, 0xa67d, 0x00de, 0x20e9, 0x0000,
+	0x20a1, 0x0240, 0x20a9, 0x000a, 0xa860, 0x20e0, 0xa85c, 0x9080,
+	0x001b, 0x2098, 0x4003, 0x60a3, 0x0035, 0xaa68, 0x9294, 0x7000,
+	0x9286, 0x3000, 0x0110, 0x60a3, 0x0037, 0x00ee, 0x00de, 0x009e,
+	0x003e, 0x0005, 0x900e, 0x7814, 0x0096, 0x2048, 0xa87c, 0xd0fc,
+	0x01c0, 0x9084, 0x0003, 0x11a8, 0x2001, 0x180c, 0x2004, 0xd0bc,
+	0x0180, 0x7824, 0xd0cc, 0x1168, 0xd0c4, 0x1158, 0xa8a8, 0x9005,
+	0x1140, 0x2001, 0x180c, 0x200c, 0xc1d5, 0x2102, 0x2009, 0x19b1,
+	0x210c, 0x009e, 0x918d, 0x0092, 0x0010, 0x2009, 0x0096, 0x60ab,
+	0x0036, 0x0026, 0x2110, 0x900e, 0x080c, 0x2a72, 0x002e, 0x0005,
+	0x2009, 0x0009, 0x00a0, 0x2009, 0x000a, 0x0088, 0x2009, 0x000b,
+	0x0070, 0x2009, 0x000c, 0x0058, 0x2009, 0x000d, 0x0040, 0x2009,
+	0x000e, 0x0028, 0x2009, 0x000f, 0x0010, 0x2009, 0x0008, 0x6912,
+	0x0005, 0x080c, 0x9a83, 0x0016, 0x0026, 0x0096, 0x00d6, 0x7814,
+	0x2048, 0x7013, 0x0138, 0x2001, 0x1837, 0x2004, 0x9084, 0x0028,
+	0x1138, 0x2001, 0x197b, 0x2004, 0x9086, 0xaaaa, 0x1904, 0xa722,
+	0x7003, 0x5400, 0x00c6, 0x2061, 0x1800, 0x607c, 0x9084, 0x00ff,
+	0xa998, 0x810f, 0x918c, 0xff00, 0x9105, 0x700a, 0x6080, 0x700e,
+	0xa998, 0x918c, 0xff00, 0x7112, 0x20a9, 0x0004, 0x2009, 0x1805,
+	0x2e10, 0x9290, 0x0006, 0x2104, 0x2012, 0x8108, 0x8210, 0x1f04,
+	0xa6b3, 0x20a9, 0x0004, 0x2009, 0x1801, 0x2104, 0x2012, 0x8108,
+	0x8210, 0x1f04, 0xa6bd, 0xa860, 0x20e0, 0xa85c, 0x9080, 0x0029,
+	0x2098, 0x2009, 0x0006, 0x20a9, 0x0001, 0x4002, 0x8007, 0x2012,
+	0x8210, 0x8109, 0x1dc0, 0x00d6, 0x2069, 0x0200, 0x080c, 0xa668,
+	0x00de, 0x2071, 0x0240, 0x2011, 0x0240, 0x2009, 0x0002, 0x20a9,
+	0x0001, 0x4002, 0x8007, 0x2012, 0x8210, 0x8109, 0x1dc0, 0x2009,
+	0x0008, 0x20a9, 0x0001, 0x4002, 0x8007, 0x2012, 0x8210, 0x8109,
+	0x1dc0, 0xa85c, 0x9080, 0x0031, 0x2098, 0x2009, 0x0008, 0x20a9,
+	0x0001, 0x4002, 0x8007, 0x2012, 0x8210, 0x8109, 0x1dc0, 0x00ce,
+	0x60c3, 0x004c, 0x60a3, 0x0056, 0x60a7, 0x9575, 0x2001, 0x1837,
+	0x2004, 0x9084, 0x0028, 0x1168, 0x080c, 0x74c8, 0x0150, 0x6028,
+	0xc0bd, 0x602a, 0x2009, 0x1804, 0x2011, 0x0029, 0x080c, 0x2a72,
+	0x0010, 0x080c, 0x9de6, 0x080c, 0x86cc, 0x00de, 0x009e, 0x002e,
+	0x001e, 0x0005, 0x00e6, 0x2071, 0x0240, 0x2001, 0x2200, 0x9085,
+	0x00ff, 0x7002, 0x7007, 0xffff, 0x2071, 0x0100, 0x709b, 0x00ff,
+	0x00ee, 0x0804, 0xa698, 0x080c, 0x9a83, 0x0016, 0x0026, 0x0096,
+	0x00d6, 0x7814, 0x2048, 0x7013, 0x0138, 0x7003, 0x5500, 0x00c6,
+	0xa89c, 0x9084, 0x00ff, 0xa998, 0x810f, 0x918c, 0xff00, 0x9105,
+	0x700a, 0xa99c, 0x918c, 0xff00, 0xa8a0, 0x9084, 0x00ff, 0x9105,
+	0x700e, 0xa998, 0x918c, 0xff00, 0x2061, 0x1800, 0x607c, 0x9084,
+	0x00ff, 0x910d, 0x7112, 0x6180, 0x7116, 0x2009, 0x0008, 0xa860,
+	0x20e0, 0xa85c, 0x9080, 0x0029, 0x2098, 0x2e10, 0x9290, 0x0006,
+	0x20a9, 0x0001, 0x4002, 0x8007, 0x2012, 0x8210, 0x8109, 0x1dc0,
+	0x20a9, 0x0004, 0x2009, 0x1805, 0x2104, 0x2012, 0x8108, 0x8210,
+	0x1f04, 0xa774, 0x20a9, 0x0002, 0x2009, 0x1801, 0x2104, 0x2012,
+	0x8108, 0x8210, 0x1f04, 0xa77e, 0x00d6, 0x0016, 0x2069, 0x0200,
+	0x080c, 0xa668, 0x001e, 0x00de, 0x2071, 0x0240, 0x20a9, 0x0002,
+	0x2009, 0x1803, 0x2011, 0x0240, 0x2104, 0x2012, 0x8108, 0x8210,
+	0x1f04, 0xa794, 0x2009, 0x0008, 0x4002, 0x8007, 0x2012, 0x8210,
+	0x8109, 0x1dd0, 0x9006, 0x20a9, 0x0008, 0x2012, 0x8210, 0x1f04,
+	0xa7a5, 0x00ce, 0x60c3, 0x004c, 0x60a3, 0x0056, 0x60a7, 0x9575,
+	0x080c, 0x9de6, 0x080c, 0x86cc, 0x00de, 0x009e, 0x002e, 0x001e,
+	0x0005, 0x00d6, 0x9290, 0x0018, 0x8214, 0x20e9, 0x0000, 0x2069,
+	0x0200, 0x6813, 0x0000, 0x22a8, 0x9284, 0x00e0, 0x0128, 0x20a9,
+	0x0020, 0x9292, 0x0020, 0x0008, 0x9016, 0x20a1, 0x0240, 0x9006,
+	0x4004, 0x82ff, 0x0120, 0x6810, 0x8000, 0x6812, 0x0c60, 0x00de,
+	0x0005, 0x00f6, 0x00e6, 0x00d6, 0x00c6, 0x00a6, 0x0096, 0x0066,
+	0x0126, 0x2091, 0x8000, 0x2071, 0x19e6, 0x7610, 0x2660, 0x2678,
+	0x8cff, 0x0904, 0xa865, 0x7030, 0x9c06, 0x1520, 0x2069, 0x0100,
+	0x68c0, 0x9005, 0x0904, 0xa837, 0x080c, 0x9e16, 0x68c3, 0x0000,
+	0x080c, 0xa31a, 0x7033, 0x0000, 0x0036, 0x2069, 0x0140, 0x6b04,
+	0x9384, 0x1000, 0x0138, 0x2001, 0x0100, 0x080c, 0x2a29, 0x9006,
+	0x080c, 0x2a29, 0x2069, 0x0100, 0x6824, 0xd084, 0x0110, 0x6827,
+	0x0001, 0x003e, 0x7010, 0x9c36, 0x1110, 0x660c, 0x7612, 0x700c,
+	0x9c36, 0x1140, 0x2c00, 0x9f36, 0x0118, 0x2f00, 0x700e, 0x0010,
+	0x700f, 0x0000, 0x660c, 0x0066, 0x2c00, 0x9f06, 0x0110, 0x7e0e,
+	0x0008, 0x2678, 0x600f, 0x0000, 0x080c, 0xca36, 0x1180, 0x080c,
+	0x321e, 0x080c, 0xca47, 0x1518, 0x080c, 0xb5a6, 0x0400, 0x080c,
+	0xa31a, 0x6824, 0xd084, 0x09b0, 0x6827, 0x0001, 0x0898, 0x080c,
+	0xca47, 0x1118, 0x080c, 0xb5a6, 0x0090, 0x6014, 0x2048, 0x080c,
+	0xc830, 0x0168, 0x6020, 0x9086, 0x0003, 0x1520, 0xa867, 0x0103,
+	0xab7a, 0xa877, 0x0000, 0x080c, 0x6d7b, 0x080c, 0xca21, 0x080c,
+	0xccc3, 0x080c, 0xac1a, 0x080c, 0xa1f0, 0x00ce, 0x0804, 0xa7e8,
+	0x2c78, 0x600c, 0x2060, 0x0804, 0xa7e8, 0x7013, 0x0000, 0x700f,
+	0x0000, 0x012e, 0x006e, 0x009e, 0x00ae, 0x00ce, 0x00de, 0x00ee,
+	0x00fe, 0x0005, 0x6020, 0x9086, 0x0006, 0x1d08, 0x080c, 0xe27c,
+	0x08f0, 0x00f6, 0x0036, 0x2079, 0x0380, 0x7b18, 0xd3bc, 0x1de8,
+	0x7832, 0x7936, 0x7a3a, 0x781b, 0x8080, 0x003e, 0x00fe, 0x0005,
+	0x0016, 0x2001, 0x0382, 0x2004, 0x9084, 0x0007, 0x9086, 0x0001,
+	0x1188, 0x2001, 0x0015, 0x0c29, 0x2009, 0x1000, 0x2001, 0x0382,
+	0x2004, 0x9084, 0x0007, 0x9086, 0x0003, 0x0120, 0x8109, 0x1db0,
+	0x080c, 0x0d7d, 0x001e, 0x0005, 0x2001, 0x0382, 0x2004, 0x9084,
+	0x0007, 0x9086, 0x0003, 0x1120, 0x2001, 0x0380, 0x2003, 0x0001,
+	0x0005, 0x0156, 0x0016, 0x0026, 0x00e6, 0x900e, 0x2071, 0x19e6,
+	0x0469, 0x0106, 0x0190, 0x7004, 0x9086, 0x0003, 0x0148, 0x20a9,
+	0x1000, 0x6044, 0xd0fc, 0x01d8, 0x1f04, 0xa8c1, 0x080c, 0x0d7d,
+	0x080c, 0xa888, 0x6044, 0xd0fc, 0x0190, 0x7030, 0x9c06, 0x1148,
+	0x080c, 0x95c6, 0x6044, 0xd0dc, 0x0150, 0xc0dc, 0x6046, 0x700a,
+	0x7042, 0x704c, 0x9c06, 0x190c, 0x0d7d, 0x080c, 0x9621, 0x010e,
+	0x1919, 0x00ee, 0x002e, 0x001e, 0x015e, 0x0005, 0x2001, 0x0382,
+	0x2004, 0x9084, 0x0007, 0x9086, 0x0003, 0x0005, 0x0126, 0x2091,
+	0x2400, 0x7808, 0xd0a4, 0x190c, 0x0d76, 0xd09c, 0x0128, 0x7820,
+	0x908c, 0xf000, 0x11b8, 0x0012, 0x012e, 0x0005, 0xa90e, 0xa94c,
+	0xa973, 0xa9aa, 0xa9ba, 0xa9cb, 0xa9da, 0xa9e8, 0xaa15, 0xaa19,
+	0xa90e, 0xa90e, 0xa90e, 0xa90e, 0xa90e, 0xa90e, 0x080c, 0x0d7d,
+	0x012e, 0x0005, 0x2060, 0x6044, 0xd0bc, 0x0140, 0xc0bc, 0x6046,
+	0x6000, 0x908a, 0x0016, 0x1a0c, 0x0d7d, 0x0012, 0x012e, 0x0005,
+	0xa933, 0xa935, 0xa933, 0xa93b, 0xa933, 0xa933, 0xa933, 0xa933,
+	0xa933, 0xa935, 0xa933, 0xa935, 0xa933, 0xa935, 0xa933, 0xa933,
+	0xa933, 0xa935, 0xa933, 0x080c, 0x0d7d, 0x2009, 0x0013, 0x080c,
+	0xac7c, 0x012e, 0x0005, 0x6014, 0x2048, 0xa87c, 0xd0dc, 0x0130,
+	0x080c, 0x88a3, 0x080c, 0xabdf, 0x012e, 0x0005, 0x2009, 0x0049,
+	0x080c, 0xac7c, 0x012e, 0x0005, 0x080c, 0xa888, 0x2001, 0x1a0b,
+	0x2003, 0x0000, 0x7030, 0x9065, 0x090c, 0x0d7d, 0x7034, 0x9092,
+	0x00c8, 0x1258, 0x8000, 0x7036, 0x7004, 0x9086, 0x0003, 0x0110,
+	0x7007, 0x0000, 0x781f, 0x0808, 0x0040, 0x080c, 0xe727, 0x6003,
+	0x0001, 0x2009, 0x0014, 0x080c, 0xac7c, 0x781f, 0x0100, 0x080c,
+	0xa8a4, 0x012e, 0x0005, 0x080c, 0xa888, 0x714c, 0x81ff, 0x1128,
+	0x2011, 0x1a0e, 0x2013, 0x0000, 0x0438, 0x2061, 0x0100, 0x7150,
+	0x9192, 0x7530, 0x12f0, 0x8108, 0x7152, 0x714c, 0x9188, 0x0008,
+	0x210c, 0x918e, 0x0006, 0x1138, 0x6014, 0x9084, 0x1984, 0x9085,
+	0x0012, 0x6016, 0x0088, 0x714c, 0x9188, 0x0008, 0x210c, 0x918e,
+	0x0009, 0x0d90, 0x6014, 0x9084, 0x1984, 0x9085, 0x0016, 0x6016,
+	0x0018, 0x706c, 0xc085, 0x706e, 0x781f, 0x0200, 0x080c, 0xa8a4,
+	0x012e, 0x0005, 0x080c, 0xa888, 0x714c, 0x2160, 0x6003, 0x0003,
+	0x2009, 0x004a, 0x080c, 0xac7c, 0x781f, 0x0200, 0x080c, 0xa8a4,
+	0x012e, 0x0005, 0x7808, 0xd09c, 0x0de8, 0x7820, 0x2060, 0x6003,
+	0x0003, 0x080c, 0xa888, 0x080c, 0x1d6d, 0x781f, 0x0400, 0x080c,
+	0xa8a4, 0x012e, 0x0005, 0x7808, 0xd09c, 0x0de8, 0x7820, 0x2060,
+	0x080c, 0xa888, 0x080c, 0x1db5, 0x781f, 0x0400, 0x080c, 0xa8a4,
+	0x012e, 0x0005, 0x7030, 0x9065, 0x0148, 0x6044, 0xc0bc, 0x6046,
+	0x7104, 0x9186, 0x0003, 0x0110, 0x080c, 0x9685, 0x012e, 0x0005,
+	0x00f6, 0x703c, 0x9086, 0x0002, 0x0528, 0x704c, 0x907d, 0x0510,
+	0x7844, 0xc0bc, 0x7846, 0x7820, 0x9086, 0x0009, 0x0118, 0x080c,
+	0x9d40, 0x00c0, 0x7828, 0xd0fc, 0x1118, 0x080c, 0x9cbf, 0x0090,
+	0x2001, 0x1837, 0x2004, 0x9084, 0x0028, 0x1130, 0x2001, 0x197b,
+	0x2004, 0x9086, 0xaaaa, 0x1120, 0x2001, 0x0387, 0x2003, 0x1000,
+	0x080c, 0x9c44, 0x00fe, 0x012e, 0x0005, 0x080c, 0x7569, 0x012e,
+	0x0005, 0x080c, 0x0d7d, 0x0005, 0x00e6, 0x2071, 0x19e6, 0x6044,
+	0xc0bc, 0x6046, 0xd0fc, 0x01b8, 0x704c, 0x9c06, 0x1190, 0x2019,
+	0x0001, 0x080c, 0xa0fa, 0x704f, 0x0000, 0x2001, 0x0109, 0x2004,
+	0xd08c, 0x1138, 0x2001, 0x0108, 0x2004, 0xd0bc, 0x1110, 0x703f,
+	0x0000, 0x080c, 0xa331, 0x00ee, 0x0005, 0x0026, 0x7010, 0x9c06,
+	0x1178, 0x080c, 0xa1f0, 0x6044, 0xc0fc, 0x6046, 0x600c, 0x9015,
+	0x0120, 0x7212, 0x600f, 0x0000, 0x0010, 0x7212, 0x720e, 0x9006,
+	0x002e, 0x0005, 0x0026, 0x7020, 0x9c06, 0x1178, 0x080c, 0xa1f0,
+	0x6044, 0xc0fc, 0x6046, 0x600c, 0x9015, 0x0120, 0x7222, 0x600f,
+	0x0000, 0x0010, 0x7222, 0x721e, 0x9006, 0x002e, 0x0005, 0x00d6,
+	0x0036, 0x7830, 0x9c06, 0x1558, 0x2069, 0x0100, 0x68c0, 0x9005,
+	0x01f8, 0x080c, 0x86d5, 0x080c, 0x9e16, 0x68c3, 0x0000, 0x080c,
+	0xa31a, 0x2069, 0x0140, 0x6b04, 0x9384, 0x1000, 0x0138, 0x2001,
+	0x0100, 0x080c, 0x2a29, 0x9006, 0x080c, 0x2a29, 0x2069, 0x0100,
+	0x6824, 0xd084, 0x0110, 0x6827, 0x0001, 0x9085, 0x0001, 0x0038,
+	0x7808, 0xc0ad, 0x780a, 0x6003, 0x0009, 0x630a, 0x9006, 0x003e,
+	0x00de, 0x0005, 0x0016, 0x0026, 0x0036, 0x6100, 0x2019, 0x0100,
+	0x2001, 0x0382, 0x2004, 0xd09c, 0x0190, 0x00c6, 0x0126, 0x2091,
+	0x2800, 0x0016, 0x0036, 0x080c, 0xa8ee, 0x003e, 0x001e, 0x012e,
+	0x00ce, 0x6200, 0x2200, 0x9106, 0x0d58, 0x2200, 0x0010, 0x8319,
+	0x1d38, 0x003e, 0x002e, 0x001e, 0x0005, 0x00d6, 0x0156, 0x080c,
+	0x9ace, 0x7a14, 0x82ff, 0x0138, 0x7003, 0x0100, 0x700b, 0x0003,
+	0x60c3, 0x0008, 0x0490, 0x7003, 0x0200, 0x7007, 0x0000, 0x2069,
+	0x1800, 0x901e, 0x6800, 0x9086, 0x0004, 0x1110, 0xc38d, 0x0060,
+	0x080c, 0x74c8, 0x1110, 0xc3ad, 0x0008, 0xc3a5, 0x6adc, 0xd29c,
+	0x1110, 0xd2ac, 0x0108, 0xc39d, 0x730e, 0x080c, 0x879a, 0x20a9,
+	0x0006, 0x2011, 0xfff4, 0x2019, 0xfff5, 0x2071, 0x0250, 0x2305,
+	0x2072, 0x8e70, 0x2205, 0x2072, 0x8e70, 0x9398, 0x0002, 0x9290,
+	0x0002, 0x1f04, 0xaaef, 0x60c3, 0x0020, 0x080c, 0x9de6, 0x015e,
+	0x00de, 0x0005, 0x0156, 0x080c, 0x9ace, 0x7a14, 0x82ff, 0x0168,
+	0x9286, 0xffff, 0x0118, 0x9282, 0x000e, 0x1238, 0x7003, 0x0100,
+	0x700b, 0x0003, 0x60c3, 0x0008, 0x0488, 0x7003, 0x0200, 0x7007,
+	0x001c, 0x700f, 0x0001, 0x2011, 0x19bc, 0x2204, 0x8007, 0x701a,
+	0x8210, 0x2204, 0x8007, 0x701e, 0x0421, 0x1120, 0xb8a0, 0x9082,
+	0x007f, 0x0248, 0x2001, 0x181f, 0x2004, 0x7022, 0x2001, 0x1820,
+	0x2004, 0x7026, 0x0030, 0x2001, 0x1818, 0x2004, 0x9084, 0x00ff,
+	0x7026, 0x20a9, 0x0004, 0x20e1, 0x0001, 0x2099, 0x1805, 0x20e9,
+	0x0000, 0x20a1, 0x0256, 0x4003, 0x60c3, 0x001c, 0x015e, 0x0804,
+	0x9de6, 0x0006, 0x2001, 0x1837, 0x2004, 0xd0ac, 0x000e, 0x0005,
+	0x2011, 0x0003, 0x080c, 0xa1b1, 0x2011, 0x0002, 0x080c, 0xa1bb,
+	0x080c, 0xa07a, 0x0036, 0x901e, 0x080c, 0xa0fa, 0x003e, 0x0005,
+	0x080c, 0x3361, 0x0188, 0x0016, 0x00b6, 0x00c6, 0x7010, 0x9085,
+	0x0020, 0x7012, 0x2009, 0x007e, 0x080c, 0x6620, 0xb85c, 0xc0ac,
+	0xb85e, 0x00ce, 0x00be, 0x001e, 0x0005, 0x2071, 0x188d, 0x7000,
+	0x9005, 0x0140, 0x2001, 0x0812, 0x2071, 0x1800, 0x7076, 0x707a,
+	0x706b, 0xffd4, 0x2071, 0x1800, 0x7074, 0x7056, 0x705b, 0x1ddc,
+	0x0005, 0x00e6, 0x0126, 0x2071, 0x1800, 0x2091, 0x8000, 0x7554,
+	0x9582, 0x0010, 0x0608, 0x7058, 0x2060, 0x6000, 0x9086, 0x0000,
 	0x0148, 0x9ce0, 0x001c, 0x7068, 0x9c02, 0x1208, 0x0cb0, 0x2061,
 	0x1ddc, 0x0c98, 0x6003, 0x0008, 0x8529, 0x7556, 0x9ca8, 0x001c,
-	0x7068, 0x9502, 0x1228, 0x755a, 0x9085, 0x0001, 0x00ee, 0x0005,
-	0x705b, 0x1ddc, 0x0cc8, 0x9006, 0x0cc8, 0x9c82, 0x1ddc, 0x0a0c,
-	0x0d7d, 0x2001, 0x181a, 0x2004, 0x9c02, 0x1a0c, 0x0d7d, 0x9006,
-	0x6006, 0x600a, 0x600e, 0x6016, 0x601a, 0x6012, 0x6023, 0x0000,
-	0x6003, 0x0000, 0x601e, 0x605e, 0x6062, 0x6026, 0x602a, 0x602e,
-	0x6032, 0x6036, 0x603a, 0x603e, 0x604a, 0x602a, 0x6046, 0x6042,
-	0x2061, 0x1800, 0x6054, 0x8000, 0x6056, 0x0005, 0x9006, 0x600e,
-	0x6016, 0x601a, 0x6012, 0x6022, 0x6002, 0x601e, 0x605e, 0x6062,
-	0x604a, 0x6046, 0x2061, 0x1800, 0x6054, 0x8000, 0x6056, 0x0005,
-	0x0006, 0x6000, 0x9086, 0x0000, 0x01d0, 0x601c, 0xd084, 0x190c,
-	0x1a6a, 0x6023, 0x0007, 0x2001, 0x1986, 0x2004, 0x0006, 0x9082,
-	0x0051, 0x000e, 0x0208, 0x8004, 0x601a, 0x080c, 0xe524, 0x604b,
-	0x0000, 0x6044, 0xd0fc, 0x1129, 0x9006, 0x6046, 0x6016, 0x000e,
-	0x0005, 0x080c, 0xa8f4, 0x0106, 0x190c, 0xa896, 0x2001, 0x19fa,
-	0x2004, 0x9c06, 0x1130, 0x0036, 0x2019, 0x0001, 0x080c, 0xa118,
-	0x003e, 0x080c, 0xa34e, 0x010e, 0x190c, 0xa8b2, 0x0005, 0x00e6,
+	0x7068, 0x9502, 0x1230, 0x755a, 0x9085, 0x0001, 0x012e, 0x00ee,
+	0x0005, 0x705b, 0x1ddc, 0x0cc0, 0x9006, 0x0cc0, 0x00e6, 0x2071,
+	0x1800, 0x7554, 0x9582, 0x0010, 0x0600, 0x7058, 0x2060, 0x6000,
+	0x9086, 0x0000, 0x0148, 0x9ce0, 0x001c, 0x7068, 0x9c02, 0x1208,
+	0x0cb0, 0x2061, 0x1ddc, 0x0c98, 0x6003, 0x0008, 0x8529, 0x7556,
+	0x9ca8, 0x001c, 0x7068, 0x9502, 0x1228, 0x755a, 0x9085, 0x0001,
+	0x00ee, 0x0005, 0x705b, 0x1ddc, 0x0cc8, 0x9006, 0x0cc8, 0x9c82,
+	0x1ddc, 0x0a0c, 0x0d7d, 0x2001, 0x181a, 0x2004, 0x9c02, 0x1a0c,
+	0x0d7d, 0x9006, 0x6006, 0x600a, 0x600e, 0x6016, 0x601a, 0x6012,
+	0x6023, 0x0000, 0x6003, 0x0000, 0x601e, 0x605e, 0x6062, 0x6026,
+	0x602a, 0x602e, 0x6032, 0x6036, 0x603a, 0x603e, 0x604a, 0x602a,
+	0x6046, 0x6042, 0x2061, 0x1800, 0x6054, 0x8000, 0x6056, 0x0005,
+	0x9006, 0x600e, 0x6016, 0x601a, 0x6012, 0x6022, 0x6002, 0x601e,
+	0x605e, 0x6062, 0x604a, 0x6046, 0x2061, 0x1800, 0x6054, 0x8000,
+	0x6056, 0x0005, 0x0006, 0x6000, 0x9086, 0x0000, 0x01d0, 0x601c,
+	0xd084, 0x190c, 0x1a77, 0x6023, 0x0007, 0x2001, 0x1985, 0x2004,
+	0x0006, 0x9082, 0x0051, 0x000e, 0x0208, 0x8004, 0x601a, 0x080c,
+	0xe534, 0x604b, 0x0000, 0x6044, 0xd0fc, 0x1129, 0x9006, 0x6046,
+	0x6016, 0x000e, 0x0005, 0x080c, 0xa888, 0x0106, 0x2001, 0x19f9,
+	0x2004, 0x9c06, 0x1130, 0x0036, 0x2019, 0x0001, 0x080c, 0xa0fa,
+	0x003e, 0x080c, 0xa331, 0x010e, 0x090c, 0xa8a4, 0x0005, 0x00e6,
 	0x0126, 0x2071, 0x1800, 0x2091, 0x8000, 0x7554, 0x9582, 0x0001,
 	0x0608, 0x7058, 0x2060, 0x6000, 0x9086, 0x0000, 0x0148, 0x9ce0,
 	0x001c, 0x7068, 0x9c02, 0x1208, 0x0cb0, 0x2061, 0x1ddc, 0x0c98,
 	0x6003, 0x0008, 0x8529, 0x7556, 0x9ca8, 0x001c, 0x7068, 0x9502,
 	0x1230, 0x755a, 0x9085, 0x0001, 0x012e, 0x00ee, 0x0005, 0x705b,
 	0x1ddc, 0x0cc0, 0x9006, 0x0cc0, 0x6020, 0x9084, 0x000f, 0x0002,
-	0xaca0, 0xacaa, 0xacc5, 0xace0, 0xcf9c, 0xcfb9, 0xcfd4, 0xaca0,
-	0xacaa, 0x8f9a, 0xacfc, 0xaca0, 0xaca0, 0xaca0, 0xaca0, 0xaca0,
-	0x9186, 0x0013, 0x1130, 0x6044, 0xd0fc, 0x0110, 0x080c, 0x95de,
+	0xac90, 0xac9a, 0xacb5, 0xacd0, 0xcfa4, 0xcfc1, 0xcfdc, 0xac90,
+	0xac9a, 0x8f7c, 0xacec, 0xac90, 0xac90, 0xac90, 0xac90, 0xac90,
+	0x9186, 0x0013, 0x1130, 0x6044, 0xd0fc, 0x0110, 0x080c, 0x95c6,
 	0x0005, 0x0005, 0x0066, 0x6000, 0x90b2, 0x0016, 0x1a0c, 0x0d7d,
-	0x0013, 0x006e, 0x0005, 0xacc3, 0xb421, 0xb5fc, 0xacc3, 0xb692,
-	0xafc5, 0xacc3, 0xacc3, 0xb3a3, 0xbbfa, 0xacc3, 0xacc3, 0xacc3,
-	0xacc3, 0xacc3, 0xacc3, 0x080c, 0x0d7d, 0x0066, 0x6000, 0x90b2,
-	0x0016, 0x1a0c, 0x0d7d, 0x0013, 0x006e, 0x0005, 0xacde, 0xc205,
-	0xacde, 0xacde, 0xacde, 0xacde, 0xacde, 0xacde, 0xc1aa, 0xc388,
-	0xacde, 0xc242, 0xc2c6, 0xc242, 0xc2c6, 0xacde, 0x080c, 0x0d7d,
-	0x6000, 0x9082, 0x0016, 0x1a0c, 0x0d7d, 0x6000, 0x0002, 0xacfa,
-	0xbc44, 0xbcdb, 0xbe5b, 0xbeca, 0xacfa, 0xacfa, 0xacfa, 0xbc13,
-	0xc12b, 0xc12e, 0xacfa, 0xacfa, 0xacfa, 0xacfa, 0xc15e, 0xacfa,
-	0xacfa, 0xacfa, 0x080c, 0x0d7d, 0x0066, 0x6000, 0x90b2, 0x0016,
-	0x1a0c, 0x0d7d, 0x0013, 0x006e, 0x0005, 0xad15, 0xad15, 0xad53,
-	0xadf2, 0xae72, 0xad15, 0xad15, 0xad15, 0xad17, 0xad15, 0xad15,
-	0xad15, 0xad15, 0xad15, 0xad15, 0xad15, 0x080c, 0x0d7d, 0x9186,
+	0x0013, 0x006e, 0x0005, 0xacb3, 0xb412, 0xb5ed, 0xacb3, 0xb683,
+	0xafb5, 0xacb3, 0xacb3, 0xb394, 0xbbed, 0xacb3, 0xacb3, 0xacb3,
+	0xacb3, 0xacb3, 0xacb3, 0x080c, 0x0d7d, 0x0066, 0x6000, 0x90b2,
+	0x0016, 0x1a0c, 0x0d7d, 0x0013, 0x006e, 0x0005, 0xacce, 0xc1f2,
+	0xacce, 0xacce, 0xacce, 0xacce, 0xacce, 0xacce, 0xc197, 0xc375,
+	0xacce, 0xc22f, 0xc2b3, 0xc22f, 0xc2b3, 0xacce, 0x080c, 0x0d7d,
+	0x6000, 0x9082, 0x0016, 0x1a0c, 0x0d7d, 0x6000, 0x0002, 0xacea,
+	0xbc37, 0xbcce, 0xbe4e, 0xbebd, 0xacea, 0xacea, 0xacea, 0xbc06,
+	0xc118, 0xc11b, 0xacea, 0xacea, 0xacea, 0xacea, 0xc14b, 0xacea,
+	0xacea, 0xacea, 0x080c, 0x0d7d, 0x0066, 0x6000, 0x90b2, 0x0016,
+	0x1a0c, 0x0d7d, 0x0013, 0x006e, 0x0005, 0xad05, 0xad05, 0xad43,
+	0xade2, 0xae62, 0xad05, 0xad05, 0xad05, 0xad07, 0xad05, 0xad05,
+	0xad05, 0xad05, 0xad05, 0xad05, 0xad05, 0x080c, 0x0d7d, 0x9186,
 	0x004c, 0x0560, 0x9186, 0x0003, 0x190c, 0x0d7d, 0x0096, 0x601c,
 	0xc0ed, 0x601e, 0x6003, 0x0003, 0x6106, 0x6014, 0x2048, 0xa87c,
 	0x9084, 0xa000, 0xc0b5, 0xa87e, 0xa8ac, 0xa836, 0xa8b0, 0xa83a,
 	0x9006, 0xa846, 0xa84a, 0xa884, 0x9092, 0x199a, 0x0210, 0x2001,
 	0x1999, 0x8003, 0x8013, 0x8213, 0x9210, 0x621a, 0x009e, 0x080c,
-	0x1bba, 0x2009, 0x8030, 0x080c, 0x9265, 0x0005, 0x6010, 0x00b6,
-	0x2058, 0xbca0, 0x00be, 0x2c00, 0x080c, 0xae94, 0x080c, 0xcf6a,
+	0x1bc7, 0x2009, 0x8030, 0x080c, 0x9247, 0x0005, 0x6010, 0x00b6,
+	0x2058, 0xbca0, 0x00be, 0x2c00, 0x080c, 0xae84, 0x080c, 0xcf69,
 	0x6003, 0x0007, 0x0005, 0x00d6, 0x0096, 0x00f6, 0x2079, 0x1800,
 	0x7a90, 0x6014, 0x2048, 0xa87c, 0xd0ec, 0x1110, 0x9290, 0x0018,
 	0xac78, 0xc4fc, 0x0046, 0xa8e0, 0x9005, 0x1140, 0xa8dc, 0x921a,
@@ -5348,54 +5346,54 @@ unsigned short risc_code01[] = {
 	0x0016, 0x0026, 0x00c6, 0x00d6, 0x00e6, 0x00f6, 0x2400, 0x9005,
 	0x1108, 0x009a, 0x2100, 0x9086, 0x0015, 0x1118, 0x2001, 0x0001,
 	0x0038, 0x2100, 0x9086, 0x0016, 0x0118, 0x2001, 0x0001, 0x002a,
-	0x94a4, 0x0007, 0x8423, 0x9405, 0x0002, 0xadba, 0xadba, 0xadb5,
-	0xadb8, 0xadba, 0xadb2, 0xada5, 0xada5, 0xada5, 0xada5, 0xada5,
-	0xada5, 0xada5, 0xada5, 0xada5, 0xada5, 0x00fe, 0x00ee, 0x00de,
+	0x94a4, 0x0007, 0x8423, 0x9405, 0x0002, 0xadaa, 0xadaa, 0xada5,
+	0xada8, 0xadaa, 0xada2, 0xad95, 0xad95, 0xad95, 0xad95, 0xad95,
+	0xad95, 0xad95, 0xad95, 0xad95, 0xad95, 0x00fe, 0x00ee, 0x00de,
 	0x00ce, 0x002e, 0x001e, 0x000e, 0x004e, 0x00fe, 0x009e, 0x00de,
-	0x080c, 0x0d7d, 0x080c, 0xb84f, 0x0028, 0x080c, 0xb934, 0x0010,
-	0x080c, 0xba2a, 0x00fe, 0x00ee, 0x00de, 0x00ce, 0x002e, 0x001e,
-	0x2c00, 0xa896, 0x000e, 0x080c, 0xaf52, 0x0530, 0xa804, 0xa80e,
+	0x080c, 0x0d7d, 0x080c, 0xb842, 0x0028, 0x080c, 0xb927, 0x0010,
+	0x080c, 0xba1d, 0x00fe, 0x00ee, 0x00de, 0x00ce, 0x002e, 0x001e,
+	0x2c00, 0xa896, 0x000e, 0x080c, 0xaf42, 0x0530, 0xa804, 0xa80e,
 	0x00a6, 0x2050, 0xb100, 0x00ae, 0x8006, 0x8006, 0x8007, 0x90bc,
 	0x003f, 0x9084, 0xffc0, 0x9080, 0x0002, 0xaacc, 0xabd0, 0xacd4,
-	0xadd8, 0x2031, 0x0000, 0x2041, 0x1298, 0x080c, 0xb112, 0x0160,
+	0xadd8, 0x2031, 0x0000, 0x2041, 0x12a3, 0x080c, 0xb103, 0x0160,
 	0x000e, 0x9005, 0x0120, 0x00fe, 0x009e, 0x00de, 0x0005, 0x00fe,
-	0x009e, 0x00de, 0x0804, 0xabed, 0x2001, 0x002c, 0x900e, 0x080c,
-	0xafb8, 0x0c70, 0x91b6, 0x0015, 0x0170, 0x91b6, 0x0016, 0x0158,
+	0x009e, 0x00de, 0x0804, 0xabdf, 0x2001, 0x002c, 0x900e, 0x080c,
+	0xafa8, 0x0c70, 0x91b6, 0x0015, 0x0170, 0x91b6, 0x0016, 0x0158,
 	0x91b2, 0x0047, 0x0a0c, 0x0d7d, 0x91b2, 0x0050, 0x1a0c, 0x0d7d,
-	0x9182, 0x0047, 0x0042, 0x080c, 0xaaa8, 0x0120, 0x9086, 0x0002,
-	0x0904, 0xad53, 0x0005, 0xae14, 0xae14, 0xae16, 0xae48, 0xae14,
-	0xae14, 0xae14, 0xae14, 0xae5b, 0x080c, 0x0d7d, 0x00d6, 0x0016,
+	0x9182, 0x0047, 0x0042, 0x080c, 0xaa9a, 0x0120, 0x9086, 0x0002,
+	0x0904, 0xad43, 0x0005, 0xae04, 0xae04, 0xae06, 0xae38, 0xae04,
+	0xae04, 0xae04, 0xae04, 0xae4b, 0x080c, 0x0d7d, 0x00d6, 0x0016,
 	0x0096, 0x6003, 0x0004, 0x6114, 0x2148, 0xa87c, 0xd0fc, 0x01c0,
 	0xa878, 0xc0fc, 0x9005, 0x1158, 0xa894, 0x9005, 0x0140, 0x2001,
-	0x0000, 0x900e, 0x080c, 0xafb8, 0x080c, 0xabed, 0x00a8, 0x6003,
+	0x0000, 0x900e, 0x080c, 0xafa8, 0x080c, 0xabdf, 0x00a8, 0x6003,
 	0x0002, 0xa8a4, 0xa9a8, 0x9105, 0x1178, 0xa8ae, 0xa8b2, 0x0c78,
 	0xa87f, 0x0020, 0xa88c, 0xa88a, 0xa8a4, 0xa8ae, 0xa8a8, 0xa8b2,
 	0xa8c7, 0x0000, 0xa8cb, 0x0000, 0x009e, 0x001e, 0x00de, 0x0005,
-	0x080c, 0x963b, 0x00d6, 0x0096, 0x6114, 0x2148, 0x080c, 0xc838,
-	0x0120, 0xa87b, 0x0006, 0x080c, 0x6d80, 0x009e, 0x00de, 0x080c,
-	0xabed, 0x0804, 0x96a0, 0x080c, 0x963b, 0x080c, 0x31e7, 0x080c,
-	0xcf67, 0x00d6, 0x0096, 0x6114, 0x2148, 0x080c, 0xc838, 0x0120,
-	0xa87b, 0x0029, 0x080c, 0x6d80, 0x009e, 0x00de, 0x080c, 0xabed,
-	0x0804, 0x96a0, 0x9182, 0x0047, 0x0002, 0xae82, 0xae84, 0xae82,
-	0xae82, 0xae82, 0xae82, 0xae82, 0xae82, 0xae82, 0xae82, 0xae82,
-	0xae82, 0xae84, 0x080c, 0x0d7d, 0x00d6, 0x0096, 0x601f, 0x0000,
-	0x6114, 0x2148, 0xa87b, 0x0000, 0xa883, 0x0000, 0x080c, 0x6d80,
-	0x009e, 0x00de, 0x0804, 0xabed, 0x0026, 0x0036, 0x0056, 0x0066,
+	0x080c, 0x9621, 0x00d6, 0x0096, 0x6114, 0x2148, 0x080c, 0xc832,
+	0x0120, 0xa87b, 0x0006, 0x080c, 0x6d7b, 0x009e, 0x00de, 0x080c,
+	0xabdf, 0x0804, 0x9684, 0x080c, 0x9621, 0x080c, 0x31ef, 0x080c,
+	0xcf66, 0x00d6, 0x0096, 0x6114, 0x2148, 0x080c, 0xc832, 0x0120,
+	0xa87b, 0x0029, 0x080c, 0x6d7b, 0x009e, 0x00de, 0x080c, 0xabdf,
+	0x0804, 0x9684, 0x9182, 0x0047, 0x0002, 0xae72, 0xae74, 0xae72,
+	0xae72, 0xae72, 0xae72, 0xae72, 0xae72, 0xae72, 0xae72, 0xae72,
+	0xae72, 0xae74, 0x080c, 0x0d7d, 0x00d6, 0x0096, 0x601f, 0x0000,
+	0x6114, 0x2148, 0xa87b, 0x0000, 0xa883, 0x0000, 0x080c, 0x6d7b,
+	0x009e, 0x00de, 0x0804, 0xabdf, 0x0026, 0x0036, 0x0056, 0x0066,
 	0x0096, 0x00a6, 0x00f6, 0x0006, 0x080c, 0x103a, 0x000e, 0x090c,
 	0x0d7d, 0xa960, 0x21e8, 0xa95c, 0x9188, 0x0019, 0x21a0, 0x900e,
 	0x20a9, 0x0020, 0x4104, 0xa87a, 0x2079, 0x1800, 0x7990, 0x9188,
 	0x0018, 0x918c, 0x0fff, 0xa972, 0xac76, 0x2950, 0x00a6, 0x2001,
 	0x0205, 0x2003, 0x0000, 0x901e, 0x2029, 0x0001, 0x9182, 0x0034,
-	0x1228, 0x2011, 0x001f, 0x080c, 0xc40b, 0x04c0, 0x2130, 0x2009,
-	0x0034, 0x2011, 0x001f, 0x080c, 0xc40b, 0x96b2, 0x0034, 0xb004,
+	0x1228, 0x2011, 0x001f, 0x080c, 0xc3f8, 0x04c0, 0x2130, 0x2009,
+	0x0034, 0x2011, 0x001f, 0x080c, 0xc3f8, 0x96b2, 0x0034, 0xb004,
 	0x904d, 0x0110, 0x080c, 0x0fec, 0x080c, 0x103a, 0x01d0, 0x8528,
 	0xa867, 0x0110, 0xa86b, 0x0000, 0x2920, 0xb406, 0x968a, 0x003d,
-	0x1230, 0x2608, 0x2011, 0x001b, 0x080c, 0xc40b, 0x00b8, 0x96b2,
-	0x003c, 0x2009, 0x003c, 0x2950, 0x2011, 0x001b, 0x080c, 0xc40b,
+	0x1230, 0x2608, 0x2011, 0x001b, 0x080c, 0xc3f8, 0x00b8, 0x96b2,
+	0x003c, 0x2009, 0x003c, 0x2950, 0x2011, 0x001b, 0x080c, 0xc3f8,
 	0x0c18, 0x2001, 0x0205, 0x2003, 0x0000, 0x00ae, 0x852f, 0x95ad,
 	0x0050, 0xb566, 0xb070, 0xc0fd, 0xb072, 0x0048, 0x2001, 0x0205,
 	0x2003, 0x0000, 0x00ae, 0x852f, 0x95ad, 0x0050, 0xb566, 0x2a48,
-	0xa804, 0xa807, 0x0000, 0x0006, 0x080c, 0x6d80, 0x000e, 0x2048,
+	0xa804, 0xa807, 0x0000, 0x0006, 0x080c, 0x6d7b, 0x000e, 0x2048,
 	0x9005, 0x1db0, 0x00fe, 0x00ae, 0x009e, 0x006e, 0x005e, 0x003e,
 	0x002e, 0x0005, 0x00d6, 0x00f6, 0x0096, 0x0006, 0x080c, 0x103a,
 	0x000e, 0x090c, 0x0d7d, 0xa960, 0x21e8, 0xa95c, 0x9188, 0x0019,
@@ -5403,7 +5401,7 @@ unsigned short risc_code01[] = {
 	0x1800, 0x7990, 0x810c, 0x9188, 0x000c, 0x9182, 0x001a, 0x0210,
 	0x2009, 0x001a, 0x21a8, 0x810b, 0xa972, 0xac76, 0x2e98, 0xa85c,
 	0x9080, 0x001f, 0x20a0, 0x2001, 0x0205, 0x200c, 0x918d, 0x0080,
-	0x2102, 0x4003, 0x2003, 0x0000, 0x080c, 0x6d80, 0x009e, 0x00fe,
+	0x2102, 0x4003, 0x2003, 0x0000, 0x080c, 0x6d7b, 0x009e, 0x00fe,
 	0x00de, 0x0005, 0x0016, 0x00d6, 0x00f6, 0x0096, 0x0016, 0x2001,
 	0x0205, 0x200c, 0x918d, 0x0080, 0x2102, 0x001e, 0x2079, 0x0200,
 	0x2e98, 0xa87c, 0xd0ec, 0x0118, 0x9e80, 0x000c, 0x2098, 0x2021,
@@ -5415,1517 +5413,1521 @@ unsigned short risc_code01[] = {
 	0x2400, 0x9202, 0x2410, 0x9318, 0x9006, 0x2020, 0x22a8, 0xa800,
 	0x9200, 0xa802, 0x20e1, 0x0000, 0x4003, 0x83ff, 0x0180, 0x3300,
 	0x9086, 0x0280, 0x1130, 0x7814, 0x8000, 0x9085, 0x0080, 0x7816,
-	0x2e98, 0x2310, 0x84ff, 0x0904, 0xaf67, 0x0804, 0xaf69, 0x9085,
+	0x2e98, 0x2310, 0x84ff, 0x0904, 0xaf57, 0x0804, 0xaf59, 0x9085,
 	0x0001, 0x7817, 0x0000, 0x009e, 0x00fe, 0x00de, 0x001e, 0x0005,
 	0x00d6, 0x0036, 0x0096, 0x6314, 0x2348, 0xa87a, 0xa982, 0x080c,
-	0x6d74, 0x009e, 0x003e, 0x00de, 0x0005, 0x91b6, 0x0015, 0x1118,
-	0x080c, 0xabed, 0x0030, 0x91b6, 0x0016, 0x190c, 0x0d7d, 0x080c,
-	0xabed, 0x0005, 0x20a9, 0x000e, 0x20e1, 0x0000, 0x2e98, 0x6014,
+	0x6d6f, 0x009e, 0x003e, 0x00de, 0x0005, 0x91b6, 0x0015, 0x1118,
+	0x080c, 0xabdf, 0x0030, 0x91b6, 0x0016, 0x190c, 0x0d7d, 0x080c,
+	0xabdf, 0x0005, 0x20a9, 0x000e, 0x20e1, 0x0000, 0x2e98, 0x6014,
 	0x0096, 0x2048, 0xa860, 0x20e8, 0xa85c, 0x20a0, 0x009e, 0x4003,
-	0x0136, 0x9080, 0x001b, 0x2011, 0x0006, 0x20a9, 0x0001, 0x3418,
-	0x8318, 0x23a0, 0x4003, 0x3318, 0x8318, 0x2398, 0x8211, 0x1db8,
-	0x2011, 0x0006, 0x013e, 0x20a0, 0x3318, 0x8318, 0x2398, 0x4003,
-	0x3418, 0x8318, 0x23a0, 0x8211, 0x1db8, 0x0096, 0x080c, 0xc838,
-	0x0130, 0x6014, 0x2048, 0xa807, 0x0000, 0xa867, 0x0103, 0x009e,
-	0x0804, 0xabed, 0x0096, 0x00d6, 0x0036, 0x7330, 0x9386, 0x0200,
-	0x11a8, 0x6010, 0x00b6, 0x2058, 0xb8d7, 0x0000, 0x00be, 0x6014,
-	0x9005, 0x0130, 0x2048, 0xa807, 0x0000, 0xa867, 0x0103, 0xab32,
-	0x080c, 0xabed, 0x003e, 0x00de, 0x009e, 0x0005, 0x0011, 0x1d48,
-	0x0cc8, 0x0006, 0x0016, 0x080c, 0xcf52, 0x0188, 0x6014, 0x9005,
-	0x1170, 0x600b, 0x0003, 0x601b, 0x0000, 0x604b, 0x0000, 0x2009,
-	0x0022, 0x080c, 0xb3f9, 0x9006, 0x001e, 0x000e, 0x0005, 0x9085,
-	0x0001, 0x0cd0, 0x0096, 0x0016, 0x20a9, 0x0014, 0x9e80, 0x000c,
-	0x20e1, 0x0000, 0x2098, 0x6014, 0x2048, 0xa860, 0x20e8, 0xa85c,
-	0x9080, 0x0002, 0x20a0, 0x4003, 0x2001, 0x0205, 0x2003, 0x0001,
-	0x2099, 0x0260, 0x20a9, 0x0016, 0x4003, 0x20a9, 0x000a, 0xa804,
-	0x2048, 0xa860, 0x20e8, 0xa85c, 0x9080, 0x0002, 0x20a0, 0x4003,
-	0x2001, 0x0205, 0x2003, 0x0002, 0x2099, 0x0260, 0x20a9, 0x0020,
-	0x4003, 0x2003, 0x0000, 0x6014, 0x2048, 0xa800, 0x2048, 0xa867,
-	0x0103, 0x080c, 0xabed, 0x001e, 0x009e, 0x0005, 0x0096, 0x0016,
-	0x900e, 0x7030, 0x9086, 0x0100, 0x0140, 0x7038, 0x9084, 0x00ff,
-	0x800c, 0x703c, 0x9084, 0x00ff, 0x8004, 0x9080, 0x0004, 0x9108,
-	0x810b, 0x2011, 0x0002, 0x2019, 0x000c, 0x6014, 0x2048, 0x080c,
-	0xc40b, 0x080c, 0xc838, 0x0140, 0x6014, 0x2048, 0xa807, 0x0000,
-	0xa864, 0xa8e2, 0xa867, 0x0103, 0x080c, 0xabed, 0x001e, 0x009e,
-	0x0005, 0x0016, 0x2009, 0x0000, 0x7030, 0x9086, 0x0200, 0x0110,
-	0x2009, 0x0001, 0x0096, 0x6014, 0x904d, 0x090c, 0x0d7d, 0xa97a,
-	0x080c, 0x6d80, 0x009e, 0x080c, 0xabed, 0x001e, 0x0005, 0x0016,
-	0x0096, 0x7030, 0x9086, 0x0100, 0x1118, 0x2009, 0x0004, 0x0010,
-	0x7034, 0x800c, 0x810b, 0x2011, 0x000c, 0x2019, 0x000c, 0x6014,
-	0x2048, 0xa804, 0x0096, 0x9005, 0x0108, 0x2048, 0x080c, 0xc40b,
-	0x009e, 0x080c, 0xc838, 0x0148, 0xa804, 0x9005, 0x1158, 0xa807,
-	0x0000, 0xa864, 0xa8e2, 0xa867, 0x0103, 0x080c, 0xabed, 0x009e,
-	0x001e, 0x0005, 0x0086, 0x2040, 0xa030, 0x8007, 0x9086, 0x0100,
-	0x1118, 0x080c, 0xb5b5, 0x00e0, 0xa034, 0x8007, 0x800c, 0x8806,
-	0x8006, 0x8007, 0x90bc, 0x003f, 0x9084, 0xffc0, 0x9080, 0x000c,
-	0xa87b, 0x0000, 0xa883, 0x0000, 0xa897, 0x4000, 0xaaa0, 0xab9c,
-	0xaca8, 0xada4, 0x2031, 0x0000, 0x2041, 0x127e, 0x0019, 0x0d08,
-	0x008e, 0x0898, 0x0096, 0x0006, 0x080c, 0x103a, 0x000e, 0x01b0,
-	0xa8ab, 0x0dcb, 0xa876, 0x000e, 0xa8a2, 0x0006, 0xae6a, 0x2800,
-	0xa89e, 0xa97a, 0xaf72, 0xaa8e, 0xab92, 0xac96, 0xad9a, 0x0086,
-	0x2940, 0x080c, 0x1124, 0x008e, 0x9085, 0x0001, 0x009e, 0x0005,
-	0x00e6, 0x00d6, 0x0026, 0x7008, 0x9084, 0x00ff, 0x6210, 0x00b6,
-	0x2258, 0xba10, 0x00be, 0x9206, 0x1520, 0x700c, 0x6210, 0x00b6,
-	0x2258, 0xba14, 0x00be, 0x9206, 0x11e0, 0x604b, 0x0000, 0x2c68,
-	0x0016, 0x2009, 0x0035, 0x080c, 0xceca, 0x001e, 0x1158, 0x622c,
-	0x2268, 0x2071, 0x026c, 0x6b20, 0x9386, 0x0003, 0x0130, 0x9386,
-	0x0006, 0x0128, 0x080c, 0xabed, 0x0020, 0x0039, 0x0010, 0x080c,
-	0xb22e, 0x002e, 0x00de, 0x00ee, 0x0005, 0x0096, 0x6814, 0x2048,
-	0x9186, 0x0015, 0x0904, 0xb20d, 0x918e, 0x0016, 0x1904, 0xb22c,
-	0x700c, 0x908c, 0xff00, 0x9186, 0x1700, 0x0120, 0x9186, 0x0300,
-	0x1904, 0xb1e7, 0x89ff, 0x1138, 0x6800, 0x9086, 0x000f, 0x0904,
-	0xb1c9, 0x0804, 0xb22a, 0x6808, 0x9086, 0xffff, 0x1904, 0xb20f,
-	0xa87c, 0x9084, 0x0060, 0x9086, 0x0020, 0x1128, 0xa83c, 0xa940,
-	0x9105, 0x1904, 0xb20f, 0x6824, 0xd0b4, 0x1904, 0xb20f, 0x080c,
-	0xca27, 0x6864, 0xa882, 0xa87c, 0xc0dc, 0xc0f4, 0xc0d4, 0xa87e,
-	0x0026, 0x900e, 0x6a18, 0x2001, 0x000a, 0x080c, 0x9166, 0xa884,
-	0x920a, 0x0208, 0x8011, 0xaa86, 0x82ff, 0x002e, 0x1138, 0x00c6,
-	0x2d60, 0x080c, 0xc55e, 0x00ce, 0x0804, 0xb22a, 0x00c6, 0xa868,
-	0xd0fc, 0x1118, 0x080c, 0x60bb, 0x0010, 0x080c, 0x64bf, 0x00ce,
-	0x1904, 0xb20f, 0x00c6, 0x2d60, 0x080c, 0xabed, 0x00ce, 0x0804,
-	0xb22a, 0x00c6, 0x080c, 0xac5f, 0x0198, 0x6017, 0x0000, 0x6810,
-	0x6012, 0x080c, 0xcccc, 0x6023, 0x0003, 0x6904, 0x00c6, 0x2d60,
-	0x080c, 0xabed, 0x00ce, 0x080c, 0xac8c, 0x00ce, 0x0804, 0xb22a,
-	0x2001, 0x1988, 0x2004, 0x684a, 0x00ce, 0x0804, 0xb22a, 0x7008,
-	0x9086, 0x000b, 0x11c8, 0x6010, 0x00b6, 0x2058, 0xb900, 0xc1bc,
-	0xb902, 0x00be, 0x00c6, 0x2d60, 0xa87b, 0x0003, 0x080c, 0xcf0c,
-	0x6007, 0x0085, 0x6003, 0x000b, 0x6023, 0x0002, 0x2009, 0x8020,
-	0x080c, 0x921e, 0x00ce, 0x0430, 0x700c, 0x9086, 0x2a00, 0x1138,
-	0x2001, 0x1988, 0x2004, 0x684a, 0x00e8, 0x04c1, 0x00e8, 0x89ff,
-	0x090c, 0x0d7d, 0x00c6, 0x00d6, 0x2d60, 0xa867, 0x0103, 0xa87b,
-	0x0003, 0x080c, 0x6b96, 0x080c, 0xca27, 0x080c, 0xac28, 0x0026,
-	0x6010, 0x00b6, 0x2058, 0xba3c, 0x080c, 0x6750, 0x00be, 0x002e,
-	0x00de, 0x00ce, 0x080c, 0xabed, 0x009e, 0x0005, 0x9186, 0x0015,
-	0x1128, 0x2001, 0x1988, 0x2004, 0x684a, 0x0068, 0x918e, 0x0016,
-	0x1160, 0x00c6, 0x2d00, 0x2060, 0x080c, 0xe524, 0x080c, 0x88c1,
-	0x080c, 0xabed, 0x00ce, 0x080c, 0xabed, 0x0005, 0x0026, 0x0036,
-	0x0046, 0x7228, 0xacb0, 0xabac, 0xd2f4, 0x0130, 0x2001, 0x1988,
-	0x2004, 0x684a, 0x0804, 0xb2a8, 0x00c6, 0x2d60, 0x080c, 0xc436,
-	0x00ce, 0x6804, 0x9086, 0x0050, 0x1168, 0x00c6, 0x2d00, 0x2060,
-	0x6003, 0x0001, 0x6007, 0x0050, 0x2009, 0x8023, 0x080c, 0x921e,
-	0x00ce, 0x04f0, 0x6800, 0x9086, 0x000f, 0x01a8, 0x89ff, 0x090c,
-	0x0d7d, 0x6800, 0x9086, 0x0004, 0x1190, 0xa87c, 0xd0ac, 0x0178,
-	0xa843, 0x0fff, 0xa83f, 0x0fff, 0xa880, 0xc0fc, 0xa882, 0x2001,
-	0x0001, 0x6832, 0x0400, 0x2001, 0x0007, 0x6832, 0x00e0, 0xa87c,
-	0xd0b4, 0x1150, 0xd0ac, 0x0db8, 0x6824, 0xd0f4, 0x1d48, 0xa838,
-	0xa934, 0x9105, 0x0d80, 0x0c20, 0xd2ec, 0x1d68, 0x7024, 0x9306,
-	0x1118, 0x7020, 0x9406, 0x0d38, 0x7020, 0x683e, 0x7024, 0x683a,
-	0x2001, 0x0005, 0x6832, 0x080c, 0xcbb6, 0x080c, 0x96a0, 0x0010,
-	0x080c, 0xabed, 0x004e, 0x003e, 0x002e, 0x0005, 0x00e6, 0x00d6,
-	0x0026, 0x7008, 0x9084, 0x00ff, 0x6210, 0x00b6, 0x2258, 0xba10,
-	0x00be, 0x9206, 0x1904, 0xb313, 0x700c, 0x6210, 0x00b6, 0x2258,
-	0xba14, 0x00be, 0x9206, 0x1904, 0xb313, 0x6038, 0x2068, 0x6824,
-	0xc0dc, 0x6826, 0x6a20, 0x9286, 0x0007, 0x0904, 0xb313, 0x9286,
-	0x0002, 0x0904, 0xb313, 0x9286, 0x0000, 0x05e8, 0x6808, 0x633c,
-	0x9306, 0x15c8, 0x2071, 0x026c, 0x9186, 0x0015, 0x0570, 0x918e,
-	0x0016, 0x1100, 0x00c6, 0x6038, 0x2060, 0x6104, 0x9186, 0x004b,
-	0x01c0, 0x9186, 0x004c, 0x01a8, 0x9186, 0x004d, 0x0190, 0x9186,
-	0x004e, 0x0178, 0x9186, 0x0052, 0x0160, 0x6014, 0x0096, 0x2048,
-	0x080c, 0xc838, 0x090c, 0x0d7d, 0xa87b, 0x0003, 0x009e, 0x080c,
-	0xcf0c, 0x6007, 0x0085, 0x6003, 0x000b, 0x6023, 0x0002, 0x2009,
-	0x8020, 0x080c, 0x921e, 0x00ce, 0x0030, 0x6038, 0x2070, 0x2001,
-	0x1988, 0x2004, 0x704a, 0x080c, 0xabed, 0x002e, 0x00de, 0x00ee,
-	0x0005, 0x00b6, 0x0096, 0x00f6, 0x6014, 0x2048, 0x6010, 0x2058,
-	0x91b6, 0x0015, 0x0130, 0xba08, 0xbb0c, 0xbc00, 0xc48c, 0xbc02,
-	0x0460, 0x0096, 0x0156, 0x0036, 0x0026, 0x2b48, 0x9e90, 0x0010,
-	0x2019, 0x000a, 0x20a9, 0x0004, 0x080c, 0xbbc2, 0x002e, 0x003e,
-	0x015e, 0x009e, 0x1904, 0xb382, 0x0096, 0x0156, 0x0036, 0x0026,
-	0x2b48, 0x9e90, 0x0014, 0x2019, 0x0006, 0x20a9, 0x0004, 0x080c,
-	0xbbc2, 0x002e, 0x003e, 0x015e, 0x009e, 0x15a0, 0x7238, 0xba0a,
-	0x733c, 0xbb0e, 0xbc00, 0xc48d, 0xbc02, 0xa804, 0x9005, 0x1128,
-	0x00fe, 0x009e, 0x00be, 0x0804, 0xaffd, 0x0096, 0x2048, 0xaa12,
-	0xab16, 0xac0a, 0x009e, 0x8006, 0x8006, 0x8007, 0x90bc, 0x003f,
-	0x9084, 0xffc0, 0x9080, 0x0002, 0x2009, 0x002b, 0xaaa0, 0xab9c,
-	0xaca8, 0xada4, 0x2031, 0x0000, 0x2041, 0x127e, 0x080c, 0xb112,
-	0x0130, 0x00fe, 0x009e, 0x080c, 0xabed, 0x00be, 0x0005, 0x080c,
-	0xb5b5, 0x0cb8, 0x2b78, 0x00f6, 0x080c, 0x31e7, 0x080c, 0xcf67,
-	0x00fe, 0x00c6, 0x080c, 0xab97, 0x2f00, 0x6012, 0x6017, 0x0000,
-	0x6023, 0x0001, 0x6007, 0x0001, 0x6003, 0x0001, 0x2001, 0x0007,
-	0x080c, 0x6575, 0x080c, 0x65a1, 0x080c, 0x9225, 0x080c, 0x96a0,
-	0x00ce, 0x0804, 0xb355, 0x2100, 0x91b2, 0x0053, 0x1a0c, 0x0d7d,
-	0x91b2, 0x0040, 0x1a04, 0xb40b, 0x0002, 0xb3f9, 0xb3f9, 0xb3ef,
-	0xb3f9, 0xb3f9, 0xb3f9, 0xb3ed, 0xb3ed, 0xb3ed, 0xb3ed, 0xb3ed,
-	0xb3ed, 0xb3ed, 0xb3ed, 0xb3ed, 0xb3ed, 0xb3ed, 0xb3ed, 0xb3ed,
-	0xb3ed, 0xb3ed, 0xb3ed, 0xb3ed, 0xb3ed, 0xb3ed, 0xb3ed, 0xb3ed,
-	0xb3ed, 0xb3ed, 0xb3ed, 0xb3ed, 0xb3f9, 0xb3ed, 0xb3f9, 0xb3f9,
-	0xb3ed, 0xb3ed, 0xb3ed, 0xb3ed, 0xb3ed, 0xb3ef, 0xb3ed, 0xb3ed,
-	0xb3ed, 0xb3ed, 0xb3ed, 0xb3ed, 0xb3ed, 0xb3ed, 0xb3ed, 0xb3f9,
-	0xb3f9, 0xb3ed, 0xb3ed, 0xb3ed, 0xb3ed, 0xb3ed, 0xb3ed, 0xb3ed,
-	0xb3ed, 0xb3ed, 0xb3f9, 0xb3ed, 0xb3ed, 0x080c, 0x0d7d, 0x0066,
-	0x00b6, 0x6610, 0x2658, 0xb8d4, 0xc08c, 0xb8d6, 0x00be, 0x006e,
-	0x0000, 0x6003, 0x0001, 0x6106, 0x9186, 0x0032, 0x0118, 0x080c,
-	0x9225, 0x0010, 0x080c, 0x921e, 0x0126, 0x2091, 0x8000, 0x080c,
-	0x96a0, 0x012e, 0x0005, 0x2600, 0x0002, 0xb3f9, 0xb3f9, 0xb41f,
-	0xb3f9, 0xb3f9, 0xb41f, 0xb41f, 0xb41f, 0xb41f, 0xb3f9, 0xb41f,
-	0xb3f9, 0xb41f, 0xb3f9, 0xb41f, 0xb41f, 0xb41f, 0xb41f, 0x080c,
-	0x0d7d, 0x6004, 0x90b2, 0x0053, 0x1a0c, 0x0d7d, 0x91b6, 0x0013,
-	0x0904, 0xb4f6, 0x91b6, 0x0027, 0x1904, 0xb4a2, 0x080c, 0x95de,
-	0x6004, 0x080c, 0xca3c, 0x01b0, 0x080c, 0xca4d, 0x01a8, 0x908e,
-	0x0021, 0x0904, 0xb49f, 0x908e, 0x0022, 0x1130, 0x080c, 0xb029,
-	0x0904, 0xb49b, 0x0804, 0xb49c, 0x908e, 0x003d, 0x0904, 0xb49f,
-	0x0804, 0xb495, 0x080c, 0x321c, 0x2001, 0x0007, 0x080c, 0x6575,
-	0x6010, 0x00b6, 0x2058, 0xb9a0, 0x00be, 0x080c, 0xb5b5, 0x9186,
-	0x007e, 0x1148, 0x2001, 0x1837, 0x2014, 0xc285, 0x080c, 0x74e9,
-	0x1108, 0xc2ad, 0x2202, 0x080c, 0xa896, 0x0036, 0x0026, 0x2019,
-	0x0028, 0x2110, 0x080c, 0xe630, 0x002e, 0x003e, 0x0016, 0x0026,
-	0x0036, 0x2110, 0x2019, 0x0028, 0x080c, 0x93a5, 0x0076, 0x903e,
-	0x080c, 0x9277, 0x6010, 0x00b6, 0x905d, 0x0100, 0x00be, 0x2c08,
-	0x080c, 0xdfeb, 0x007e, 0x003e, 0x002e, 0x001e, 0x080c, 0xa8b2,
-	0x080c, 0xcf67, 0x0016, 0x080c, 0xccc4, 0x080c, 0xabed, 0x001e,
-	0x080c, 0x32fc, 0x080c, 0x96a0, 0x0030, 0x080c, 0xccc4, 0x080c,
-	0xabed, 0x080c, 0x96a0, 0x0005, 0x080c, 0xb5b5, 0x0cb0, 0x080c,
-	0xb5f1, 0x0c98, 0x9186, 0x0015, 0x0118, 0x9186, 0x0016, 0x1140,
-	0x080c, 0xaaa8, 0x0d80, 0x9086, 0x0002, 0x0904, 0xb5fc, 0x0c58,
-	0x9186, 0x0014, 0x1d40, 0x080c, 0x95de, 0x6004, 0x908e, 0x0022,
-	0x1118, 0x080c, 0xb029, 0x09f8, 0x080c, 0x31e7, 0x080c, 0xcf67,
-	0x080c, 0xca3c, 0x1190, 0x080c, 0x321c, 0x6010, 0x00b6, 0x2058,
-	0xb9a0, 0x00be, 0x080c, 0xb5b5, 0x9186, 0x007e, 0x1128, 0x2001,
-	0x1837, 0x200c, 0xc185, 0x2102, 0x0800, 0x080c, 0xca4d, 0x1120,
-	0x080c, 0xb5b5, 0x0804, 0xb495, 0x6004, 0x908e, 0x0032, 0x1160,
-	0x00e6, 0x00f6, 0x2071, 0x189e, 0x2079, 0x0000, 0x080c, 0x35a5,
-	0x00fe, 0x00ee, 0x0804, 0xb495, 0x6004, 0x908e, 0x0021, 0x0d40,
-	0x908e, 0x0022, 0x090c, 0xb5b5, 0x0804, 0xb495, 0x90b2, 0x0040,
-	0x1a04, 0xb595, 0x2008, 0x0002, 0xb53e, 0xb53f, 0xb542, 0xb545,
-	0xb548, 0xb54b, 0xb53c, 0xb53c, 0xb53c, 0xb53c, 0xb53c, 0xb53c,
-	0xb53c, 0xb53c, 0xb53c, 0xb53c, 0xb53c, 0xb53c, 0xb53c, 0xb53c,
-	0xb53c, 0xb53c, 0xb53c, 0xb53c, 0xb53c, 0xb53c, 0xb53c, 0xb53c,
-	0xb53c, 0xb53c, 0xb54e, 0xb557, 0xb53c, 0xb558, 0xb557, 0xb53c,
-	0xb53c, 0xb53c, 0xb53c, 0xb53c, 0xb557, 0xb557, 0xb53c, 0xb53c,
-	0xb53c, 0xb53c, 0xb53c, 0xb53c, 0xb53c, 0xb53c, 0xb580, 0xb557,
-	0xb53c, 0xb553, 0xb53c, 0xb53c, 0xb53c, 0xb554, 0xb53c, 0xb53c,
-	0xb53c, 0xb557, 0xb57b, 0xb53c, 0x080c, 0x0d7d, 0x00c0, 0x2001,
-	0x000b, 0x00e8, 0x2001, 0x0003, 0x00d0, 0x2001, 0x0005, 0x00b8,
-	0x2001, 0x0001, 0x00a0, 0x2001, 0x0009, 0x0088, 0x6003, 0x0005,
-	0x080c, 0x96a0, 0x0058, 0x0018, 0x0010, 0x080c, 0x6575, 0x04b8,
-	0x080c, 0xcf6a, 0x6003, 0x0004, 0x080c, 0x96a0, 0x0005, 0x080c,
-	0x6575, 0x6003, 0x0002, 0x0036, 0x2019, 0x1852, 0x2304, 0x9084,
-	0xff00, 0x1120, 0x2001, 0x1986, 0x201c, 0x0040, 0x8007, 0x909a,
-	0x0004, 0x0ec0, 0x8003, 0x801b, 0x831b, 0x9318, 0x631a, 0x003e,
-	0x080c, 0x96a0, 0x0c18, 0x080c, 0xccc4, 0x080c, 0xabed, 0x08f0,
-	0x00e6, 0x00f6, 0x2071, 0x189e, 0x2079, 0x0000, 0x080c, 0x35a5,
-	0x00fe, 0x00ee, 0x080c, 0x95de, 0x080c, 0xabed, 0x0878, 0x6003,
-	0x0002, 0x080c, 0xcf6a, 0x0804, 0x96a0, 0x2600, 0x2008, 0x0002,
-	0xb5ac, 0xb58f, 0xb5aa, 0xb58f, 0xb58f, 0xb5aa, 0xb5aa, 0xb5aa,
-	0xb5aa, 0xb58f, 0xb5aa, 0xb58f, 0xb5aa, 0xb58f, 0xb5aa, 0xb5aa,
-	0xb5aa, 0xb5aa, 0x080c, 0x0d7d, 0x0096, 0x6014, 0x2048, 0x080c,
-	0x6d80, 0x009e, 0x080c, 0xabed, 0x0005, 0x00e6, 0x0096, 0x0026,
-	0x0016, 0x080c, 0xc838, 0x0568, 0x6014, 0x2048, 0xa864, 0x9086,
-	0x0139, 0x11a8, 0xa894, 0x9086, 0x0056, 0x1148, 0x080c, 0x547b,
-	0x0130, 0x2001, 0x0000, 0x900e, 0x2011, 0x4000, 0x0028, 0x2001,
-	0x0030, 0x900e, 0x2011, 0x4005, 0x080c, 0xce31, 0x0090, 0xa868,
-	0xd0fc, 0x0178, 0xa807, 0x0000, 0x0016, 0x6004, 0x908e, 0x0021,
-	0x0168, 0x908e, 0x003d, 0x0150, 0x001e, 0xa867, 0x0103, 0xa833,
-	0x0100, 0x001e, 0x002e, 0x009e, 0x00ee, 0x0005, 0x001e, 0x0009,
-	0x0cc0, 0x0096, 0x6014, 0x2048, 0xa800, 0x2048, 0xa867, 0x0103,
-	0xa823, 0x8001, 0x009e, 0x0005, 0x00b6, 0x6610, 0x2658, 0xb804,
-	0x9084, 0x00ff, 0x90b2, 0x000c, 0x1a0c, 0x0d7d, 0x6604, 0x96b6,
-	0x004d, 0x1120, 0x080c, 0xcd50, 0x0804, 0xb681, 0x6604, 0x96b6,
-	0x0043, 0x1120, 0x080c, 0xcd99, 0x0804, 0xb681, 0x6604, 0x96b6,
-	0x004b, 0x1120, 0x080c, 0xcdc5, 0x0804, 0xb681, 0x6604, 0x96b6,
-	0x0033, 0x1120, 0x080c, 0xcce6, 0x0804, 0xb681, 0x6604, 0x96b6,
-	0x0028, 0x1120, 0x080c, 0xca86, 0x0804, 0xb681, 0x6604, 0x96b6,
-	0x0029, 0x1120, 0x080c, 0xcac7, 0x0804, 0xb681, 0x6604, 0x96b6,
-	0x001f, 0x1120, 0x080c, 0xafd2, 0x0804, 0xb681, 0x6604, 0x96b6,
-	0x0000, 0x1118, 0x080c, 0xb319, 0x04e0, 0x6604, 0x96b6, 0x0022,
-	0x1118, 0x080c, 0xb00a, 0x04a8, 0x6604, 0x96b6, 0x0035, 0x1118,
-	0x080c, 0xb130, 0x0470, 0x6604, 0x96b6, 0x0039, 0x1118, 0x080c,
-	0xb2ae, 0x0438, 0x6604, 0x96b6, 0x003d, 0x1118, 0x080c, 0xb042,
-	0x0400, 0x6604, 0x96b6, 0x0044, 0x1118, 0x080c, 0xb07e, 0x00c8,
-	0x6604, 0x96b6, 0x0049, 0x1118, 0x080c, 0xb0bf, 0x0090, 0x6604,
-	0x96b6, 0x0041, 0x1118, 0x080c, 0xb0a9, 0x0058, 0x91b6, 0x0015,
-	0x1110, 0x0063, 0x0030, 0x91b6, 0x0016, 0x1128, 0x00be, 0x0804,
-	0xb8db, 0x00be, 0x0005, 0x080c, 0xaca9, 0x0cd8, 0xb69e, 0xb6a1,
-	0xb69e, 0xb6e8, 0xb69e, 0xb84f, 0xb8e8, 0xb69e, 0xb69e, 0xb8b1,
-	0xb69e, 0xb8c7, 0x0096, 0x601f, 0x0000, 0x6014, 0x2048, 0xa800,
-	0x2048, 0xa867, 0x0103, 0x009e, 0x0804, 0xabed, 0xa001, 0xa001,
-	0x0005, 0x00e6, 0x2071, 0x1800, 0x7090, 0x9086, 0x0074, 0x1540,
-	0x080c, 0xdfbc, 0x11b0, 0x6010, 0x00b6, 0x2058, 0x7030, 0xd08c,
-	0x0128, 0xb800, 0xd0bc, 0x0110, 0xc0c5, 0xb802, 0x00f9, 0x00be,
-	0x2001, 0x0006, 0x080c, 0x6575, 0x080c, 0x321c, 0x080c, 0xabed,
-	0x0098, 0x2001, 0x000a, 0x080c, 0x6575, 0x080c, 0x321c, 0x6003,
-	0x0001, 0x6007, 0x0001, 0x080c, 0x9225, 0x080c, 0x96a0, 0x0020,
-	0x2001, 0x0001, 0x080c, 0xb81f, 0x00ee, 0x0005, 0x00d6, 0xb800,
-	0xd084, 0x0160, 0x9006, 0x080c, 0x6561, 0x2069, 0x1847, 0x6804,
-	0xd0a4, 0x0120, 0x2001, 0x0006, 0x080c, 0x65a1, 0x00de, 0x0005,
-	0x00b6, 0x0096, 0x00d6, 0x2011, 0x1824, 0x2204, 0x9086, 0x0074,
-	0x1904, 0xb7f6, 0x6010, 0x2058, 0xbaa0, 0x9286, 0x007e, 0x1120,
-	0x080c, 0xba35, 0x0804, 0xb75a, 0x080c, 0xba2a, 0x6010, 0x2058,
-	0xbaa0, 0x9286, 0x0080, 0x1510, 0x6014, 0x9005, 0x01a8, 0x2048,
-	0xa864, 0x9084, 0x00ff, 0x9086, 0x0039, 0x1140, 0x2001, 0x0000,
-	0x900e, 0x2011, 0x4000, 0x080c, 0xce31, 0x0030, 0xa807, 0x0000,
-	0xa867, 0x0103, 0xa833, 0x0200, 0x2001, 0x0006, 0x080c, 0x6575,
-	0x080c, 0x321c, 0x080c, 0xabed, 0x0804, 0xb7f9, 0x080c, 0xb807,
-	0x6014, 0x9005, 0x0190, 0x2048, 0xa868, 0xd0f4, 0x01e8, 0xa864,
-	0x9084, 0x00ff, 0x9086, 0x0039, 0x1d08, 0x2001, 0x0000, 0x900e,
-	0x2011, 0x4000, 0x080c, 0xce31, 0x08f8, 0x080c, 0xb7fd, 0x0160,
-	0x9006, 0x080c, 0x6561, 0x2001, 0x0004, 0x080c, 0x65a1, 0x2001,
-	0x0007, 0x080c, 0x6575, 0x08a0, 0x2001, 0x0004, 0x080c, 0x6575,
-	0x6003, 0x0001, 0x6007, 0x0003, 0x080c, 0x9225, 0x080c, 0x96a0,
-	0x0804, 0xb7f9, 0xb85c, 0xd0e4, 0x01d8, 0x080c, 0xcc5e, 0x080c,
-	0x74e9, 0x0118, 0xd0dc, 0x1904, 0xb71c, 0x2011, 0x1837, 0x2204,
-	0xc0ad, 0x2012, 0x2001, 0x196d, 0x2004, 0x00f6, 0x2079, 0x0100,
-	0x78e3, 0x0000, 0x080c, 0x266f, 0x78e2, 0x00fe, 0x0804, 0xb71c,
-	0x080c, 0xcc9f, 0x2011, 0x1837, 0x2204, 0xc0a5, 0x2012, 0x0006,
-	0x080c, 0xe14c, 0x000e, 0x1904, 0xb71c, 0xc0b5, 0x2012, 0x2001,
-	0x0006, 0x080c, 0x6575, 0x9006, 0x080c, 0x6561, 0x00c6, 0x2001,
-	0x180f, 0x2004, 0xd09c, 0x0520, 0x00f6, 0x2079, 0x0100, 0x00e6,
-	0x2071, 0x1800, 0x700c, 0x9084, 0x00ff, 0x78e6, 0x707e, 0x7010,
-	0x78ea, 0x7082, 0x908c, 0x00ff, 0x00ee, 0x780c, 0xc0b5, 0x780e,
-	0x00fe, 0x080c, 0x2644, 0x00f6, 0x2100, 0x900e, 0x080c, 0x25fb,
-	0x795e, 0x00fe, 0x9186, 0x0081, 0x01d8, 0x2009, 0x0081, 0x00c8,
-	0x2009, 0x00ef, 0x00f6, 0x2079, 0x0100, 0x79ea, 0x7932, 0x7936,
-	0x780c, 0xc0b5, 0x780e, 0x00fe, 0x080c, 0x2644, 0x00f6, 0x2079,
-	0x1800, 0x7982, 0x2100, 0x900e, 0x080c, 0x25fb, 0x795e, 0x00fe,
-	0x8108, 0x080c, 0x65c4, 0x2b00, 0x00ce, 0x1904, 0xb71c, 0x6012,
-	0x2009, 0x180f, 0x210c, 0xd19c, 0x0150, 0x2009, 0x027c, 0x210c,
-	0x918c, 0x00ff, 0xb912, 0x2009, 0x027d, 0x210c, 0xb916, 0x2001,
-	0x0002, 0x080c, 0x6575, 0x6023, 0x0001, 0x6003, 0x0001, 0x6007,
-	0x0002, 0x080c, 0x9225, 0x080c, 0x96a0, 0x0018, 0x2001, 0x0001,
-	0x0431, 0x00de, 0x009e, 0x00be, 0x0005, 0x2001, 0x1810, 0x2004,
-	0xd0a4, 0x0120, 0x2001, 0x1848, 0x2004, 0xd0ac, 0x0005, 0x00e6,
-	0x080c, 0xe689, 0x0190, 0x2071, 0x0260, 0x7108, 0x720c, 0x918c,
-	0x00ff, 0x1118, 0x9284, 0xff00, 0x0140, 0x6010, 0x2058, 0xb8a0,
-	0x9084, 0xff80, 0x1110, 0xb912, 0xba16, 0x00ee, 0x0005, 0x2030,
-	0x9005, 0x0158, 0x2001, 0x0007, 0x080c, 0x6575, 0x080c, 0x56ee,
-	0x1120, 0x2001, 0x0007, 0x080c, 0x65a1, 0x2600, 0x9005, 0x11b0,
-	0x6014, 0x0096, 0x2048, 0xa868, 0x009e, 0xd0fc, 0x1178, 0x0036,
-	0x0046, 0x6010, 0x00b6, 0x2058, 0xbba0, 0x00be, 0x2021, 0x0004,
-	0x2011, 0x8014, 0x080c, 0x4b07, 0x004e, 0x003e, 0x080c, 0x321c,
-	0x6020, 0x9086, 0x000a, 0x1108, 0x0005, 0x0804, 0xabed, 0x00b6,
-	0x00e6, 0x0026, 0x0016, 0x2071, 0x1800, 0x7090, 0x9086, 0x0014,
-	0x1904, 0xb8a7, 0x080c, 0x56ee, 0x1170, 0x6014, 0x9005, 0x1158,
-	0x0036, 0x0046, 0x6010, 0x2058, 0xbba0, 0x2021, 0x0006, 0x080c,
-	0x4cbe, 0x004e, 0x003e, 0x00d6, 0x6010, 0x2058, 0x080c, 0x66c0,
-	0x080c, 0xb6d6, 0x00de, 0x080c, 0xbafb, 0x1588, 0x6010, 0x2058,
-	0xb890, 0x9005, 0x0560, 0x2001, 0x0006, 0x080c, 0x6575, 0x0096,
-	0x6014, 0x904d, 0x01d0, 0xa864, 0x9084, 0x00ff, 0x9086, 0x0039,
-	0x1140, 0x2001, 0x0000, 0x900e, 0x2011, 0x4000, 0x080c, 0xce31,
-	0x0060, 0xa864, 0x9084, 0x00ff, 0x9086, 0x0029, 0x0130, 0xa807,
-	0x0000, 0xa867, 0x0103, 0xa833, 0x0200, 0x009e, 0x080c, 0x321c,
-	0x6020, 0x9086, 0x000a, 0x0140, 0x080c, 0xabed, 0x0028, 0x080c,
-	0xb5b5, 0x9006, 0x080c, 0xb81f, 0x001e, 0x002e, 0x00ee, 0x00be,
-	0x0005, 0x2011, 0x1824, 0x2204, 0x9086, 0x0014, 0x1160, 0x2001,
-	0x0002, 0x080c, 0x6575, 0x6003, 0x0001, 0x6007, 0x0001, 0x080c,
-	0x9225, 0x0804, 0x96a0, 0x2001, 0x0001, 0x0804, 0xb81f, 0x2030,
-	0x2011, 0x1824, 0x2204, 0x9086, 0x0004, 0x1148, 0x96b6, 0x000b,
-	0x1120, 0x2001, 0x0007, 0x080c, 0x6575, 0x0804, 0xabed, 0x2001,
-	0x0001, 0x0804, 0xb81f, 0x0002, 0xb69e, 0xb8f3, 0xb69e, 0xb934,
-	0xb69e, 0xb9e1, 0xb8e8, 0xb69e, 0xb69e, 0xb9f5, 0xb69e, 0xba07,
-	0x6604, 0x9686, 0x0003, 0x0904, 0xb84f, 0x96b6, 0x001e, 0x1110,
-	0x080c, 0xabed, 0x0005, 0x00b6, 0x00d6, 0x00c6, 0x080c, 0xba19,
-	0x11a0, 0x9006, 0x080c, 0x6561, 0x080c, 0x31e7, 0x080c, 0xcf67,
-	0x2001, 0x0002, 0x080c, 0x6575, 0x6003, 0x0001, 0x6007, 0x0002,
-	0x080c, 0x9225, 0x080c, 0x96a0, 0x0418, 0x2009, 0x026e, 0x2104,
-	0x9086, 0x0009, 0x1160, 0x6010, 0x2058, 0xb840, 0x9084, 0x00ff,
-	0x9005, 0x0170, 0x8001, 0xb842, 0x601b, 0x000a, 0x0088, 0x2009,
-	0x026f, 0x2104, 0x9084, 0xff00, 0x9086, 0x1900, 0x1108, 0x08a0,
-	0x080c, 0x31e7, 0x080c, 0xcf67, 0x2001, 0x0001, 0x080c, 0xb81f,
-	0x00ce, 0x00de, 0x00be, 0x0005, 0x0096, 0x00b6, 0x0026, 0x9016,
-	0x080c, 0xba27, 0x00d6, 0x2069, 0x197c, 0x2d04, 0x9005, 0x0168,
-	0x6010, 0x2058, 0xb8a0, 0x9086, 0x007e, 0x1138, 0x2069, 0x1820,
-	0x2d04, 0x8000, 0x206a, 0x00de, 0x0010, 0x00de, 0x0088, 0x9006,
-	0x080c, 0x6561, 0x2001, 0x0002, 0x080c, 0x6575, 0x6003, 0x0001,
-	0x6007, 0x0002, 0x080c, 0x9225, 0x080c, 0x96a0, 0x0804, 0xb9b1,
-	0x080c, 0xc838, 0x01b0, 0x6014, 0x2048, 0xa864, 0x2010, 0x9086,
-	0x0139, 0x1138, 0x6007, 0x0016, 0x2001, 0x0002, 0x080c, 0xce8b,
-	0x00b0, 0x6014, 0x2048, 0xa864, 0xd0fc, 0x0118, 0x2001, 0x0001,
-	0x0ca8, 0x2001, 0x180e, 0x2004, 0xd0dc, 0x0148, 0x6010, 0x2058,
-	0xb840, 0x9084, 0x00ff, 0x9005, 0x1110, 0x9006, 0x0c38, 0x080c,
-	0xb5b5, 0x2009, 0x026e, 0x2134, 0x96b4, 0x00ff, 0x9686, 0x0005,
-	0x0520, 0x9686, 0x000b, 0x01c8, 0x2009, 0x026f, 0x2104, 0x9084,
-	0xff00, 0x1118, 0x9686, 0x0009, 0x01c0, 0x9086, 0x1900, 0x1168,
-	0x9686, 0x0009, 0x0190, 0x2001, 0x0004, 0x080c, 0x6575, 0x2001,
-	0x0028, 0x601a, 0x6007, 0x0052, 0x0020, 0x2001, 0x0001, 0x080c,
-	0xb81f, 0x002e, 0x00be, 0x009e, 0x0005, 0x9286, 0x0139, 0x0160,
-	0x6014, 0x2048, 0x080c, 0xc838, 0x0140, 0xa864, 0x9086, 0x0139,
-	0x0118, 0xa868, 0xd0fc, 0x0108, 0x0c40, 0x6010, 0x2058, 0xb840,
-	0x9084, 0x00ff, 0x9005, 0x0138, 0x8001, 0xb842, 0x601b, 0x000a,
-	0x6007, 0x0016, 0x08f0, 0xb8a0, 0x9086, 0x007e, 0x1138, 0x00e6,
-	0x2071, 0x1800, 0x080c, 0x5fbc, 0x00ee, 0x0010, 0x080c, 0x31e7,
-	0x0860, 0x080c, 0xba27, 0x1160, 0x2001, 0x0004, 0x080c, 0x6575,
-	0x6003, 0x0001, 0x6007, 0x0003, 0x080c, 0x9225, 0x0804, 0x96a0,
-	0x080c, 0xb5b5, 0x9006, 0x0804, 0xb81f, 0x0489, 0x1160, 0x2001,
-	0x0008, 0x080c, 0x6575, 0x6003, 0x0001, 0x6007, 0x0005, 0x080c,
-	0x9225, 0x0804, 0x96a0, 0x2001, 0x0001, 0x0804, 0xb81f, 0x00f9,
-	0x1160, 0x2001, 0x000a, 0x080c, 0x6575, 0x6003, 0x0001, 0x6007,
-	0x0001, 0x080c, 0x9225, 0x0804, 0x96a0, 0x2001, 0x0001, 0x0804,
-	0xb81f, 0x2009, 0x026e, 0x2104, 0x9086, 0x0003, 0x1138, 0x2009,
-	0x026f, 0x2104, 0x9084, 0xff00, 0x9086, 0x2a00, 0x0005, 0x9085,
-	0x0001, 0x0005, 0x00b6, 0x00c6, 0x0016, 0x6110, 0x2158, 0x080c,
-	0x6634, 0x001e, 0x00ce, 0x00be, 0x0005, 0x00b6, 0x00f6, 0x00e6,
-	0x00d6, 0x0036, 0x0016, 0x6010, 0x2058, 0x2009, 0x1837, 0x2104,
-	0x9085, 0x0003, 0x200a, 0x080c, 0xbacd, 0x0560, 0x2009, 0x1837,
-	0x2104, 0xc0cd, 0x200a, 0x080c, 0x6a67, 0x0158, 0x9006, 0x2020,
-	0x2009, 0x002a, 0x080c, 0xe2c9, 0x2001, 0x180c, 0x200c, 0xc195,
-	0x2102, 0x2019, 0x002a, 0x2009, 0x0001, 0x080c, 0x31a6, 0x00e6,
-	0x2071, 0x1800, 0x080c, 0x2fb2, 0x00ee, 0x00c6, 0x0156, 0x20a9,
-	0x0781, 0x2009, 0x007f, 0x080c, 0x32fc, 0x8108, 0x1f04, 0xba6b,
-	0x015e, 0x00ce, 0x080c, 0xba2a, 0x2071, 0x0260, 0x2079, 0x0200,
-	0x7817, 0x0001, 0x2001, 0x1837, 0x200c, 0xc1c5, 0x7018, 0xd0fc,
-	0x0110, 0xd0dc, 0x0118, 0x7038, 0xd0dc, 0x1108, 0xc1c4, 0x7817,
-	0x0000, 0x2001, 0x1837, 0x2102, 0x2079, 0x0100, 0x2e04, 0x9084,
-	0x00ff, 0x2069, 0x181f, 0x206a, 0x78e6, 0x0006, 0x8e70, 0x2e04,
-	0x2069, 0x1820, 0x206a, 0x78ea, 0x7832, 0x7836, 0x2010, 0x9084,
-	0xff00, 0x001e, 0x9105, 0x2009, 0x182c, 0x200a, 0x2200, 0x9084,
-	0x00ff, 0x2008, 0x080c, 0x2644, 0x080c, 0x74e9, 0x0170, 0x2071,
-	0x0260, 0x2069, 0x1982, 0x7048, 0x206a, 0x704c, 0x6806, 0x7050,
-	0x680a, 0x7054, 0x680e, 0x080c, 0xcc5e, 0x0040, 0x2001, 0x0006,
-	0x080c, 0x6575, 0x080c, 0x321c, 0x080c, 0xabed, 0x001e, 0x003e,
-	0x00de, 0x00ee, 0x00fe, 0x00be, 0x0005, 0x0096, 0x0026, 0x0036,
-	0x00e6, 0x0156, 0x2019, 0x182c, 0x231c, 0x83ff, 0x01f0, 0x2071,
-	0x0260, 0x7200, 0x9294, 0x00ff, 0x7004, 0x9084, 0xff00, 0x9205,
-	0x9306, 0x1198, 0x2011, 0x0276, 0x20a9, 0x0004, 0x2b48, 0x2019,
-	0x000a, 0x080c, 0xbbc2, 0x1148, 0x2011, 0x027a, 0x20a9, 0x0004,
-	0x2019, 0x0006, 0x080c, 0xbbc2, 0x1100, 0x015e, 0x00ee, 0x003e,
-	0x002e, 0x009e, 0x0005, 0x00e6, 0x2071, 0x0260, 0x7034, 0x9086,
-	0x0014, 0x11a8, 0x7038, 0x9086, 0x0800, 0x1188, 0x703c, 0xd0ec,
-	0x0160, 0x9084, 0x0f00, 0x9086, 0x0100, 0x1138, 0x7054, 0xd0a4,
-	0x1110, 0xd0ac, 0x0110, 0x9006, 0x0010, 0x9085, 0x0001, 0x00ee,
-	0x0005, 0x00e6, 0x0096, 0x00c6, 0x0076, 0x0056, 0x0046, 0x0026,
-	0x0006, 0x0126, 0x2091, 0x8000, 0x2029, 0x19f3, 0x252c, 0x2021,
-	0x19fa, 0x2424, 0x2061, 0x1ddc, 0x2071, 0x1800, 0x7254, 0x7074,
-	0x9202, 0x1a04, 0xbb8e, 0x080c, 0x8b90, 0x0904, 0xbb87, 0x080c,
-	0xe2fa, 0x0904, 0xbb87, 0x6720, 0x9786, 0x0007, 0x0904, 0xbb87,
-	0x2500, 0x9c06, 0x0904, 0xbb87, 0x2400, 0x9c06, 0x0904, 0xbb87,
-	0x3e08, 0x9186, 0x0002, 0x1148, 0x6010, 0x9005, 0x0130, 0x00b6,
-	0x2058, 0xb800, 0x00be, 0xd0bc, 0x1590, 0x00c6, 0x6043, 0xffff,
-	0x6000, 0x9086, 0x0004, 0x1110, 0x080c, 0x1a6a, 0x9786, 0x000a,
-	0x0148, 0x080c, 0xca4d, 0x1130, 0x00ce, 0x080c, 0xb5b5, 0x080c,
-	0xac28, 0x00e8, 0x6014, 0x2048, 0x080c, 0xc838, 0x01a8, 0x9786,
-	0x0003, 0x1530, 0xa867, 0x0103, 0xa87c, 0xd0cc, 0x0130, 0x0096,
-	0xa878, 0x2048, 0x080c, 0x0fec, 0x009e, 0xab7a, 0xa877, 0x0000,
-	0x080c, 0x6d74, 0x080c, 0xca27, 0x080c, 0xac28, 0x00ce, 0x9ce0,
-	0x001c, 0x7068, 0x9c02, 0x1210, 0x0804, 0xbb2e, 0x012e, 0x000e,
-	0x002e, 0x004e, 0x005e, 0x007e, 0x00ce, 0x009e, 0x00ee, 0x0005,
-	0x9786, 0x0006, 0x1118, 0x080c, 0xe26c, 0x0c30, 0x9786, 0x0009,
-	0x1148, 0x6000, 0x9086, 0x0004, 0x0d08, 0x2009, 0x004c, 0x080c,
-	0xac8c, 0x08e0, 0x9786, 0x000a, 0x0938, 0x0820, 0x220c, 0x2304,
-	0x9106, 0x1130, 0x8210, 0x8318, 0x1f04, 0xbbae, 0x9006, 0x0005,
-	0x2304, 0x9102, 0x0218, 0x2001, 0x0001, 0x0008, 0x9006, 0x918d,
-	0x0001, 0x0005, 0x0136, 0x01c6, 0x0016, 0x8906, 0x8006, 0x8007,
-	0x908c, 0x003f, 0x21e0, 0x9084, 0xffc0, 0x9300, 0x2098, 0x3518,
-	0x20a9, 0x0001, 0x220c, 0x4002, 0x910e, 0x1140, 0x8210, 0x8319,
-	0x1dc8, 0x9006, 0x001e, 0x01ce, 0x013e, 0x0005, 0x220c, 0x9102,
-	0x0218, 0x2001, 0x0001, 0x0010, 0x2001, 0x0000, 0x918d, 0x0001,
-	0x001e, 0x01ce, 0x013e, 0x0005, 0x220c, 0x810f, 0x2304, 0x9106,
-	0x1130, 0x8210, 0x8318, 0x1f04, 0xbbec, 0x9006, 0x0005, 0x918d,
-	0x0001, 0x0005, 0x6004, 0x908a, 0x0053, 0x1a0c, 0x0d7d, 0x080c,
-	0xca3c, 0x0120, 0x080c, 0xca4d, 0x0158, 0x0028, 0x080c, 0x321c,
-	0x080c, 0xca4d, 0x0128, 0x080c, 0x95de, 0x080c, 0xabed, 0x0005,
-	0x080c, 0xb5b5, 0x0cc0, 0x9182, 0x0057, 0x1220, 0x9182, 0x0040,
-	0x0208, 0x000a, 0x0005, 0xbc32, 0xbc32, 0xbc32, 0xbc32, 0xbc32,
-	0xbc32, 0xbc32, 0xbc32, 0xbc32, 0xbc32, 0xbc32, 0xbc34, 0xbc34,
-	0xbc34, 0xbc34, 0xbc32, 0xbc32, 0xbc32, 0xbc34, 0xbc32, 0xbc32,
-	0xbc32, 0xbc32, 0x080c, 0x0d7d, 0x600b, 0xffff, 0x6003, 0x000f,
-	0x6106, 0x0126, 0x2091, 0x8000, 0x080c, 0xcf6a, 0x2009, 0x8000,
-	0x080c, 0x921e, 0x012e, 0x0005, 0x9186, 0x0013, 0x1128, 0x6004,
-	0x9082, 0x0040, 0x0804, 0xbcb9, 0x9186, 0x0027, 0x1520, 0x080c,
-	0x95de, 0x080c, 0x31e7, 0x080c, 0xcf67, 0x0096, 0x6114, 0x2148,
-	0x080c, 0xc838, 0x0198, 0x080c, 0xca4d, 0x1118, 0x080c, 0xb5b5,
-	0x0068, 0xa867, 0x0103, 0xa87b, 0x0029, 0xa877, 0x0000, 0xa97c,
-	0xc1c5, 0xa97e, 0x080c, 0x6d80, 0x080c, 0xca27, 0x009e, 0x080c,
-	0xabed, 0x0804, 0x96a0, 0x9186, 0x0014, 0x1120, 0x6004, 0x9082,
-	0x0040, 0x0018, 0x080c, 0x0d7d, 0x0005, 0x0002, 0xbc97, 0xbc95,
-	0xbc95, 0xbc95, 0xbc95, 0xbc95, 0xbc95, 0xbc95, 0xbc95, 0xbc95,
-	0xbc95, 0xbcb0, 0xbcb0, 0xbcb0, 0xbcb0, 0xbc95, 0xbcb0, 0xbc95,
-	0xbcb0, 0xbc95, 0xbc95, 0xbc95, 0xbc95, 0x080c, 0x0d7d, 0x080c,
-	0x95de, 0x0096, 0x6114, 0x2148, 0x080c, 0xc838, 0x0168, 0xa867,
-	0x0103, 0xa87b, 0x0006, 0xa877, 0x0000, 0xa880, 0xc0ec, 0xa882,
-	0x080c, 0x6d80, 0x080c, 0xca27, 0x009e, 0x080c, 0xabed, 0x0005,
-	0x080c, 0x95de, 0x080c, 0xca4d, 0x090c, 0xb5b5, 0x080c, 0xabed,
-	0x0005, 0x0002, 0xbcd3, 0xbcd1, 0xbcd1, 0xbcd1, 0xbcd1, 0xbcd1,
-	0xbcd1, 0xbcd1, 0xbcd1, 0xbcd1, 0xbcd1, 0xbcd5, 0xbcd5, 0xbcd5,
-	0xbcd5, 0xbcd1, 0xbcd7, 0xbcd1, 0xbcd5, 0xbcd1, 0xbcd1, 0xbcd1,
-	0xbcd1, 0x080c, 0x0d7d, 0x080c, 0x0d7d, 0x080c, 0x0d7d, 0x080c,
-	0xabed, 0x0804, 0x96a0, 0x9182, 0x0057, 0x1220, 0x9182, 0x0040,
-	0x0208, 0x000a, 0x0005, 0xbcfa, 0xbcfa, 0xbcfa, 0xbcfa, 0xbcfa,
-	0xbd33, 0xbe22, 0xbcfa, 0xbe2e, 0xbcfa, 0xbcfa, 0xbcfa, 0xbcfa,
-	0xbcfa, 0xbcfa, 0xbcfa, 0xbcfa, 0xbcfa, 0xbcfa, 0xbe2e, 0xbcfc,
-	0xbcfa, 0xbe2c, 0x080c, 0x0d7d, 0x00b6, 0x0096, 0x6114, 0x2148,
-	0x6010, 0x2058, 0xb800, 0xd0bc, 0x1508, 0xa87b, 0x0000, 0xa867,
-	0x0103, 0xa877, 0x0000, 0xa87c, 0xd0ac, 0x0128, 0xa834, 0xa938,
-	0x9115, 0x190c, 0xbeb3, 0x080c, 0x6b96, 0x6210, 0x2258, 0xba3c,
-	0x82ff, 0x0110, 0x8211, 0xba3e, 0xb8d0, 0x9005, 0x0110, 0x080c,
-	0x6750, 0x080c, 0xabed, 0x009e, 0x00be, 0x0005, 0xa87c, 0xd0ac,
-	0x09e0, 0xa838, 0xa934, 0x9105, 0x09c0, 0xa880, 0xd0bc, 0x19a8,
-	0x080c, 0xcb7d, 0x0c80, 0x00b6, 0x0096, 0x6114, 0x2148, 0x601c,
-	0xd0fc, 0x1110, 0x7644, 0x0008, 0x9036, 0x96b4, 0x0fff, 0x86ff,
-	0x1590, 0x6010, 0x2058, 0xb800, 0xd0bc, 0x1904, 0xbe11, 0xa87b,
-	0x0000, 0xa867, 0x0103, 0xae76, 0xa87c, 0xd0ac, 0x0128, 0xa834,
-	0xa938, 0x9115, 0x190c, 0xbeb3, 0x080c, 0x6b96, 0x6210, 0x2258,
-	0xba3c, 0x82ff, 0x0110, 0x8211, 0xba3e, 0xb8d0, 0x9005, 0x0110,
-	0x080c, 0x6750, 0x601c, 0xd0fc, 0x1148, 0x7044, 0xd0e4, 0x1904,
-	0xbdf5, 0x080c, 0xabed, 0x009e, 0x00be, 0x0005, 0x2009, 0x0211,
-	0x210c, 0x080c, 0x0d7d, 0x968c, 0x0c00, 0x0150, 0x6010, 0x2058,
-	0xb800, 0xd0bc, 0x1904, 0xbdf9, 0x7348, 0xab92, 0x734c, 0xab8e,
-	0x968c, 0x00ff, 0x9186, 0x0002, 0x0508, 0x9186, 0x0028, 0x1118,
-	0xa87b, 0x001c, 0x00e8, 0xd6dc, 0x01a0, 0xa87b, 0x0015, 0xa87c,
-	0xd0ac, 0x0170, 0xa938, 0xaa34, 0x2100, 0x9205, 0x0148, 0x7048,
-	0x9106, 0x1118, 0x704c, 0x9206, 0x0118, 0xa992, 0xaa8e, 0xc6dc,
-	0x0038, 0xd6d4, 0x0118, 0xa87b, 0x0007, 0x0010, 0xa87b, 0x0000,
-	0xa867, 0x0103, 0xae76, 0x901e, 0xd6c4, 0x01d8, 0x9686, 0x0100,
-	0x1130, 0x7064, 0x9005, 0x1118, 0xc6c4, 0x0804, 0xbd3f, 0x735c,
-	0xab86, 0x83ff, 0x0170, 0x938a, 0x0009, 0x0210, 0x2019, 0x0008,
-	0x0036, 0x2308, 0x2019, 0x0018, 0x2011, 0x0025, 0x080c, 0xc40b,
-	0x003e, 0xd6cc, 0x0904, 0xbd54, 0x7154, 0xa98a, 0x81ff, 0x0904,
-	0xbd54, 0x9192, 0x0021, 0x1278, 0x8304, 0x9098, 0x0018, 0x2011,
-	0x0029, 0x080c, 0xc40b, 0x2011, 0x0205, 0x2013, 0x0000, 0x080c,
-	0xcef7, 0x0804, 0xbd54, 0xa868, 0xd0fc, 0x0120, 0x2009, 0x0020,
-	0xa98a, 0x0c50, 0x00a6, 0x2950, 0x080c, 0xc3aa, 0x00ae, 0x080c,
-	0xcef7, 0x080c, 0xc3fb, 0x0804, 0xbd56, 0x080c, 0xcb40, 0x0804,
-	0xbd6b, 0xa87c, 0xd0ac, 0x0904, 0xbd7c, 0xa880, 0xd0bc, 0x1904,
-	0xbd7c, 0x7348, 0xa838, 0x9306, 0x11c8, 0x734c, 0xa834, 0x931e,
-	0x0904, 0xbd7c, 0xd6d4, 0x0190, 0xab38, 0x9305, 0x0904, 0xbd7c,
-	0x0068, 0xa87c, 0xd0ac, 0x0904, 0xbd47, 0xa838, 0xa934, 0x9105,
-	0x0904, 0xbd47, 0xa880, 0xd0bc, 0x1904, 0xbd47, 0x080c, 0xcb7d,
-	0x0804, 0xbd6b, 0x00f6, 0x2079, 0x026c, 0x7c04, 0x7b00, 0x7e0c,
-	0x7d08, 0x00fe, 0x0021, 0x0005, 0x0011, 0x0005, 0x0005, 0x0096,
-	0x6003, 0x0002, 0x6007, 0x0043, 0x6014, 0x2048, 0xa87c, 0xd0ac,
-	0x0128, 0x009e, 0x0005, 0x2130, 0x2228, 0x0058, 0x2400, 0xa9ac,
-	0x910a, 0x2300, 0xaab0, 0x9213, 0x2600, 0x9102, 0x2500, 0x9203,
-	0x0e90, 0xac46, 0xab4a, 0xae36, 0xad3a, 0x6044, 0xd0fc, 0x190c,
-	0xa8bf, 0x604b, 0x0000, 0x080c, 0x1c30, 0x1118, 0x6144, 0x080c,
-	0x924a, 0x009e, 0x0005, 0x9182, 0x0057, 0x1220, 0x9182, 0x0040,
-	0x0208, 0x000a, 0x0005, 0xbe7a, 0xbe7a, 0xbe7a, 0xbe7a, 0xbe7a,
-	0xbe7a, 0xbe7a, 0xbe7a, 0xbe7a, 0xbe7a, 0xbe7c, 0xbe7a, 0xbe7a,
-	0xbe7a, 0xbe7a, 0xbe8d, 0xbe7a, 0xbe7a, 0xbe7a, 0xbe7a, 0xbeb1,
-	0xbe7a, 0xbe7a, 0x080c, 0x0d7d, 0x6004, 0x9086, 0x0040, 0x1110,
-	0x080c, 0x95de, 0x2019, 0x0001, 0x080c, 0xa118, 0x6003, 0x0002,
-	0x080c, 0xcf6f, 0x080c, 0x963b, 0x0005, 0x6004, 0x9086, 0x0040,
-	0x1110, 0x080c, 0x95de, 0x2019, 0x0001, 0x080c, 0xa118, 0x080c,
-	0x963b, 0x080c, 0x31e7, 0x080c, 0xcf67, 0x0096, 0x6114, 0x2148,
-	0x080c, 0xc838, 0x0150, 0xa867, 0x0103, 0xa87b, 0x0029, 0xa877,
-	0x0000, 0x080c, 0x6d80, 0x080c, 0xca27, 0x009e, 0x080c, 0xabed,
-	0x0005, 0x080c, 0x0d7d, 0xa87b, 0x0015, 0xd1fc, 0x0180, 0xa87b,
-	0x0007, 0x8002, 0x8000, 0x810a, 0x9189, 0x0000, 0x0006, 0x0016,
-	0x2009, 0x1a78, 0x2104, 0x8000, 0x200a, 0x001e, 0x000e, 0xa992,
-	0xa88e, 0x0005, 0x9182, 0x0057, 0x1220, 0x9182, 0x0040, 0x0208,
-	0x000a, 0x0005, 0xbee9, 0xbee9, 0xbee9, 0xbee9, 0xbee9, 0xbeeb,
-	0xbee9, 0xbee9, 0xbfa8, 0xbee9, 0xbee9, 0xbee9, 0xbee9, 0xbee9,
-	0xbee9, 0xbee9, 0xbee9, 0xbee9, 0xbee9, 0xc0ec, 0xbee9, 0xc0f6,
-	0xbee9, 0x080c, 0x0d7d, 0x601c, 0xd0bc, 0x0178, 0xd084, 0x0168,
-	0xd0f4, 0x0120, 0xc084, 0x601e, 0x0804, 0xbcdb, 0x6114, 0x0096,
-	0x2148, 0xa87c, 0xc0e5, 0xa87e, 0x009e, 0x0076, 0x00a6, 0x00e6,
-	0x0096, 0x2071, 0x0260, 0x6114, 0x2150, 0x601c, 0xd0fc, 0x1110,
-	0x7644, 0x0008, 0x9036, 0xb676, 0x96b4, 0x0fff, 0xb77c, 0xc7e5,
-	0xb77e, 0x6210, 0x00b6, 0x2258, 0xba3c, 0x82ff, 0x0110, 0x8211,
-	0xba3e, 0x00be, 0x86ff, 0x0904, 0xbfa1, 0x9694, 0xff00, 0x9284,
-	0x0c00, 0x0120, 0x7048, 0xb092, 0x704c, 0xb08e, 0x9284, 0x0300,
-	0x0904, 0xbfa1, 0x9686, 0x0100, 0x1130, 0x7064, 0x9005, 0x1118,
-	0xc6c4, 0xb676, 0x0c38, 0x080c, 0x103a, 0x090c, 0x0d7d, 0x2900,
-	0xb07a, 0xb77c, 0x97bd, 0x0200, 0xb77e, 0xa867, 0x0103, 0xb068,
-	0xa86a, 0xb06c, 0xa86e, 0xb070, 0xa872, 0x7044, 0x9084, 0xf000,
-	0x9635, 0xae76, 0x968c, 0x0c00, 0x0120, 0x7348, 0xab92, 0x734c,
-	0xab8e, 0x968c, 0x00ff, 0x9186, 0x0002, 0x0180, 0x9186, 0x0028,
-	0x1118, 0xa87b, 0x001c, 0x0060, 0xd6dc, 0x0118, 0xa87b, 0x0015,
-	0x0038, 0xd6d4, 0x0118, 0xa87b, 0x0007, 0x0010, 0xa87b, 0x0000,
-	0xaf7e, 0xb080, 0xa882, 0xb084, 0xa886, 0x901e, 0xd6c4, 0x0190,
-	0x735c, 0xab86, 0x83ff, 0x0170, 0x938a, 0x0009, 0x0210, 0x2019,
-	0x0008, 0x0036, 0x2308, 0x2019, 0x0018, 0x2011, 0x0025, 0x080c,
-	0xc40b, 0x003e, 0xd6cc, 0x01e8, 0x7154, 0xa98a, 0x81ff, 0x01c8,
-	0x9192, 0x0021, 0x1260, 0x8304, 0x9098, 0x0018, 0x2011, 0x0029,
-	0x080c, 0xc40b, 0x2011, 0x0205, 0x2013, 0x0000, 0x0050, 0xb068,
-	0xd0fc, 0x0120, 0x2009, 0x0020, 0xa98a, 0x0c68, 0x2950, 0x080c,
-	0xc3aa, 0x080c, 0x1a48, 0x009e, 0x00ee, 0x00ae, 0x007e, 0x0005,
-	0x2001, 0x1988, 0x2004, 0x604a, 0x0096, 0x6114, 0x2148, 0xa83c,
-	0xa940, 0x9105, 0x1118, 0xa87c, 0xc0dc, 0xa87e, 0x6003, 0x0002,
-	0x080c, 0xcf78, 0x0904, 0xc0e7, 0x604b, 0x0000, 0x6010, 0x00b6,
-	0x2058, 0xb800, 0x00be, 0xd0bc, 0x1500, 0xd1cc, 0x0904, 0xc0a6,
-	0xa978, 0xa868, 0xd0fc, 0x0904, 0xc067, 0x0016, 0xa87c, 0x0006,
-	0xa880, 0x0006, 0x00a6, 0x2150, 0xb174, 0x9184, 0x00ff, 0x90b6,
-	0x0002, 0x0904, 0xc035, 0x9086, 0x0028, 0x1904, 0xc021, 0xa87b,
-	0x001c, 0xb07b, 0x001c, 0x0804, 0xc03d, 0x6024, 0xd0f4, 0x11d0,
-	0xa838, 0xaa34, 0x9205, 0x09c8, 0xa838, 0xaa90, 0x9206, 0x1120,
-	0xa88c, 0xaa34, 0x9206, 0x0988, 0x6024, 0xd0d4, 0x1148, 0xa9ac,
-	0xa834, 0x9102, 0x603a, 0xa9b0, 0xa838, 0x9103, 0x603e, 0x6024,
-	0xc0f5, 0x6026, 0x6010, 0x00b6, 0x2058, 0xb83c, 0x8000, 0xb83e,
-	0x00be, 0x601c, 0xc0fc, 0x601e, 0x9006, 0xa876, 0xa892, 0xa88e,
-	0xa87c, 0xc0e4, 0xa87e, 0xd0cc, 0x0140, 0xc0cc, 0xa87e, 0x0096,
-	0xa878, 0x2048, 0x080c, 0x0fec, 0x009e, 0x080c, 0xcb7d, 0x0804,
-	0xc0e7, 0xd1dc, 0x0158, 0xa87b, 0x0015, 0xb07b, 0x0015, 0x080c,
-	0xce1a, 0x0118, 0xb174, 0xc1dc, 0xb176, 0x0078, 0xd1d4, 0x0128,
-	0xa87b, 0x0007, 0xb07b, 0x0007, 0x0040, 0xa87c, 0xd0ac, 0x0128,
-	0xa834, 0xa938, 0x9115, 0x190c, 0xbeb3, 0xa87c, 0xb07e, 0xa890,
-	0xb092, 0xa88c, 0xb08e, 0xa860, 0x20e8, 0xa85c, 0x9080, 0x0019,
-	0x20a0, 0x20a9, 0x0020, 0x8a06, 0x8006, 0x8007, 0x9094, 0x003f,
-	0x22e0, 0x9084, 0xffc0, 0x9080, 0x0019, 0x2098, 0x4003, 0x00ae,
-	0x000e, 0xa882, 0x000e, 0xa87e, 0x080c, 0xcef7, 0x001e, 0xa874,
-	0x0006, 0x2148, 0x080c, 0x0fec, 0x001e, 0x0804, 0xc0d3, 0x0016,
-	0x00a6, 0x2150, 0xb174, 0x9184, 0x00ff, 0x90b6, 0x0002, 0x01e0,
-	0x9086, 0x0028, 0x1128, 0xa87b, 0x001c, 0xb07b, 0x001c, 0x00e0,
-	0xd1dc, 0x0158, 0xa87b, 0x0015, 0xb07b, 0x0015, 0x080c, 0xce1a,
-	0x0118, 0xb174, 0xc1dc, 0xb176, 0x0078, 0xd1d4, 0x0128, 0xa87b,
-	0x0007, 0xb07b, 0x0007, 0x0040, 0xa87c, 0xd0ac, 0x0128, 0xa834,
-	0xa938, 0x9115, 0x190c, 0xbeb3, 0xa890, 0xb092, 0xa88c, 0xb08e,
-	0xa87c, 0xb07e, 0x00ae, 0x080c, 0x0fec, 0x009e, 0x080c, 0xcef7,
-	0xa974, 0x0016, 0x080c, 0xc3fb, 0x001e, 0x0468, 0xa867, 0x0103,
-	0xa974, 0x9184, 0x00ff, 0x90b6, 0x0002, 0x01b0, 0x9086, 0x0028,
-	0x1118, 0xa87b, 0x001c, 0x00d0, 0xd1dc, 0x0148, 0xa87b, 0x0015,
-	0x080c, 0xce1a, 0x0118, 0xa974, 0xc1dc, 0xa976, 0x0078, 0xd1d4,
-	0x0118, 0xa87b, 0x0007, 0x0050, 0xa87b, 0x0000, 0xa87c, 0xd0ac,
-	0x0128, 0xa834, 0xa938, 0x9115, 0x190c, 0xbeb3, 0xa974, 0x0016,
-	0x080c, 0x6b96, 0x001e, 0x6010, 0x00b6, 0x2058, 0xba3c, 0x82ff,
-	0x0110, 0x8211, 0xba3e, 0xb8d0, 0x9005, 0x0120, 0x0016, 0x080c,
-	0x6750, 0x001e, 0x00be, 0xd1e4, 0x1120, 0x080c, 0xabed, 0x009e,
-	0x0005, 0x080c, 0xcb40, 0x0cd8, 0x6114, 0x0096, 0x2148, 0xa97c,
-	0x080c, 0xcf78, 0x190c, 0x1a56, 0x009e, 0x0005, 0x0096, 0x6114,
-	0x2148, 0xa83c, 0xa940, 0x9105, 0x01e8, 0xa877, 0x0000, 0xa87b,
-	0x0000, 0xa867, 0x0103, 0x00b6, 0x6010, 0x2058, 0xa834, 0xa938,
-	0x9115, 0x11a0, 0x080c, 0x6b96, 0xba3c, 0x8211, 0x0208, 0xba3e,
-	0xb8d0, 0x9005, 0x0110, 0x080c, 0x6750, 0x080c, 0xabed, 0x00be,
-	0x009e, 0x0005, 0xa87c, 0xc0dc, 0xa87e, 0x08f8, 0xb800, 0xd0bc,
-	0x1120, 0xa834, 0x080c, 0xbeb3, 0x0c28, 0xa880, 0xd0bc, 0x1dc8,
-	0x080c, 0xcb7d, 0x0c60, 0x080c, 0x95de, 0x0010, 0x080c, 0x963b,
-	0x601c, 0xd084, 0x0110, 0x080c, 0x1a6a, 0x080c, 0xc838, 0x01f0,
-	0x0096, 0x6114, 0x2148, 0x080c, 0xca4d, 0x1118, 0x080c, 0xb5b5,
-	0x00a0, 0xa867, 0x0103, 0x2009, 0x180c, 0x210c, 0xd18c, 0x1198,
-	0xd184, 0x1170, 0x6108, 0xa97a, 0x918e, 0x0029, 0x1110, 0x080c,
-	0xe621, 0xa877, 0x0000, 0x080c, 0x6d80, 0x009e, 0x0804, 0xac28,
-	0xa87b, 0x0004, 0x0cb0, 0xa87b, 0x0004, 0x0c98, 0x9182, 0x0057,
-	0x1220, 0x9182, 0x0040, 0x0208, 0x000a, 0x0005, 0xc17d, 0xc17d,
-	0xc17d, 0xc17d, 0xc17d, 0xc17f, 0xc17d, 0xc17d, 0xc17d, 0xc17d,
-	0xc17d, 0xc17d, 0xc17d, 0xc17d, 0xc17d, 0xc17d, 0xc17d, 0xc17d,
-	0xc17d, 0xc17d, 0xc1a3, 0xc17d, 0xc17d, 0x080c, 0x0d7d, 0x080c,
-	0x56e2, 0x01f8, 0x6014, 0x7144, 0x918c, 0x0fff, 0x9016, 0xd1c4,
-	0x0118, 0x7264, 0x9294, 0x00ff, 0x0096, 0x904d, 0x0188, 0xa87b,
-	0x0000, 0xa864, 0x9086, 0x0139, 0x0128, 0xa867, 0x0103, 0xa976,
-	0xaa96, 0x0030, 0xa897, 0x4000, 0xa99a, 0xaa9e, 0x080c, 0x6d80,
-	0x009e, 0x0804, 0xabed, 0x080c, 0x56e2, 0x0dd8, 0x6014, 0x900e,
-	0x9016, 0x0c10, 0x9182, 0x0085, 0x0002, 0xc1bc, 0xc1ba, 0xc1ba,
-	0xc1c8, 0xc1ba, 0xc1ba, 0xc1ba, 0xc1ba, 0xc1ba, 0xc1ba, 0xc1ba,
-	0xc1ba, 0xc1ba, 0x080c, 0x0d7d, 0x6003, 0x0001, 0x6106, 0x0126,
-	0x2091, 0x8000, 0x2009, 0x8020, 0x080c, 0x921e, 0x012e, 0x0005,
-	0x0026, 0x0056, 0x00d6, 0x00e6, 0x2071, 0x0260, 0x7224, 0x6216,
-	0x7220, 0x080c, 0xc826, 0x01a0, 0x2268, 0x6800, 0x9086, 0x0000,
-	0x0178, 0x6010, 0x6d10, 0x952e, 0x1158, 0x00c6, 0x2d60, 0x080c,
-	0xc436, 0x00ce, 0x0128, 0x6803, 0x0002, 0x6007, 0x0086, 0x0010,
-	0x6007, 0x0087, 0x6003, 0x0001, 0x2009, 0x8020, 0x080c, 0x921e,
-	0x9280, 0x0004, 0x00b6, 0x2058, 0xb800, 0x00be, 0xd0bc, 0x0140,
-	0x6824, 0xd0ec, 0x0128, 0x00c6, 0x2260, 0x080c, 0xcb7d, 0x00ce,
-	0x00ee, 0x00de, 0x005e, 0x002e, 0x0005, 0x9186, 0x0013, 0x1160,
-	0x6004, 0x908a, 0x0085, 0x0a0c, 0x0d7d, 0x908a, 0x0092, 0x1a0c,
-	0x0d7d, 0x9082, 0x0085, 0x00e2, 0x9186, 0x0027, 0x0120, 0x9186,
-	0x0014, 0x190c, 0x0d7d, 0x080c, 0x95de, 0x0096, 0x6014, 0x2048,
-	0x080c, 0xc838, 0x0140, 0xa867, 0x0103, 0xa877, 0x0000, 0xa87b,
-	0x0029, 0x080c, 0x6d80, 0x009e, 0x080c, 0xac28, 0x0804, 0x96a0,
-	0xc23d, 0xc23f, 0xc23f, 0xc23d, 0xc23d, 0xc23d, 0xc23d, 0xc23d,
-	0xc23d, 0xc23d, 0xc23d, 0xc23d, 0xc23d, 0x080c, 0x0d7d, 0x080c,
-	0xac28, 0x0005, 0x9186, 0x0013, 0x1130, 0x6004, 0x9082, 0x0085,
-	0x2008, 0x0804, 0xc28e, 0x9186, 0x0027, 0x1558, 0x080c, 0x95de,
-	0x080c, 0x31e7, 0x080c, 0xcf67, 0x0096, 0x6014, 0x2048, 0x080c,
-	0xc838, 0x0150, 0xa867, 0x0103, 0xa877, 0x0000, 0xa87b, 0x0029,
-	0x080c, 0x6d80, 0x080c, 0xca27, 0x009e, 0x080c, 0xabed, 0x0005,
-	0x9186, 0x0089, 0x0118, 0x9186, 0x008a, 0x1140, 0x080c, 0xaaa8,
-	0x0128, 0x9086, 0x000c, 0x0904, 0xc2c6, 0x0000, 0x080c, 0xaca9,
-	0x0c70, 0x9186, 0x0014, 0x1d60, 0x080c, 0x95de, 0x0096, 0x6014,
-	0x2048, 0x080c, 0xc838, 0x0d00, 0xa867, 0x0103, 0xa877, 0x0000,
-	0xa87b, 0x0006, 0xa880, 0xc0ec, 0xa882, 0x0890, 0x0002, 0xc29e,
-	0xc29c, 0xc29c, 0xc29c, 0xc29c, 0xc29c, 0xc2b2, 0xc29c, 0xc29c,
-	0xc29c, 0xc29c, 0xc29c, 0xc29c, 0x080c, 0x0d7d, 0x6034, 0x908c,
-	0xff00, 0x810f, 0x9186, 0x0039, 0x0118, 0x9186, 0x0035, 0x1118,
-	0x2001, 0x1986, 0x0010, 0x2001, 0x1987, 0x2004, 0x601a, 0x6003,
-	0x000c, 0x0005, 0x6034, 0x908c, 0xff00, 0x810f, 0x9186, 0x0039,
-	0x0118, 0x9186, 0x0035, 0x1118, 0x2001, 0x1986, 0x0010, 0x2001,
-	0x1987, 0x2004, 0x601a, 0x6003, 0x000e, 0x0005, 0x9182, 0x0092,
-	0x1220, 0x9182, 0x0085, 0x0208, 0x0012, 0x0804, 0xaca9, 0xc2dc,
-	0xc2dc, 0xc2dc, 0xc2dc, 0xc2de, 0xc32b, 0xc2dc, 0xc2dc, 0xc2dc,
-	0xc2dc, 0xc2dc, 0xc2dc, 0xc2dc, 0x080c, 0x0d7d, 0x0096, 0x6010,
-	0x00b6, 0x2058, 0xb800, 0x00be, 0xd0bc, 0x0168, 0x6034, 0x908c,
-	0xff00, 0x810f, 0x9186, 0x0039, 0x0118, 0x9186, 0x0035, 0x1118,
-	0x009e, 0x0804, 0xc33f, 0x080c, 0xc838, 0x1118, 0x080c, 0xca27,
-	0x0068, 0x6014, 0x2048, 0x080c, 0xcf7e, 0x1110, 0x080c, 0xca27,
-	0xa867, 0x0103, 0x080c, 0xcf32, 0x080c, 0x6d80, 0x00d6, 0x2c68,
-	0x080c, 0xab97, 0x01d0, 0x6003, 0x0001, 0x6007, 0x001e, 0x600b,
-	0xffff, 0x2009, 0x026e, 0x210c, 0x613a, 0x2009, 0x026f, 0x210c,
-	0x613e, 0x6910, 0x6112, 0x080c, 0xcccc, 0x695c, 0x615e, 0x6023,
-	0x0001, 0x2009, 0x8020, 0x080c, 0x921e, 0x2d60, 0x00de, 0x080c,
-	0xabed, 0x009e, 0x0005, 0x6010, 0x00b6, 0x2058, 0xb800, 0x00be,
-	0xd0bc, 0x05a0, 0x6034, 0x908c, 0xff00, 0x810f, 0x9186, 0x0035,
-	0x0130, 0x9186, 0x001e, 0x0118, 0x9186, 0x0039, 0x1538, 0x00d6,
-	0x2c68, 0x080c, 0xceca, 0x11f0, 0x080c, 0xab97, 0x01d8, 0x6106,
-	0x6003, 0x0001, 0x6023, 0x0001, 0x6910, 0x6112, 0x692c, 0x612e,
-	0x6930, 0x6132, 0x6934, 0x918c, 0x00ff, 0x6136, 0x6938, 0x613a,
-	0x693c, 0x613e, 0x695c, 0x615e, 0x080c, 0xcccc, 0x2009, 0x8020,
-	0x080c, 0x921e, 0x2d60, 0x00de, 0x0804, 0xabed, 0x0096, 0x6014,
-	0x2048, 0x080c, 0xc838, 0x01c8, 0xa867, 0x0103, 0xa880, 0xd0b4,
-	0x0128, 0xc0ec, 0xa882, 0xa87b, 0x0006, 0x0048, 0xd0bc, 0x0118,
-	0xa87b, 0x0002, 0x0020, 0xa87b, 0x0005, 0x080c, 0xcb3c, 0xa877,
-	0x0000, 0x080c, 0x6d80, 0x080c, 0xca27, 0x009e, 0x0804, 0xabed,
-	0x0016, 0x0096, 0x6014, 0x2048, 0x080c, 0xc838, 0x0140, 0xa867,
-	0x0103, 0xa87b, 0x0028, 0xa877, 0x0000, 0x080c, 0x6d80, 0x009e,
-	0x001e, 0x9186, 0x0013, 0x0158, 0x9186, 0x0014, 0x0130, 0x9186,
-	0x0027, 0x0118, 0x080c, 0xaca9, 0x0020, 0x080c, 0x95de, 0x080c,
-	0xac28, 0x0005, 0x0056, 0x0066, 0x0096, 0x00a6, 0x2029, 0x0001,
-	0x9182, 0x0101, 0x1208, 0x0010, 0x2009, 0x0100, 0x2130, 0x8304,
-	0x9098, 0x0018, 0x2009, 0x0020, 0x2011, 0x0029, 0x080c, 0xc40b,
-	0x96b2, 0x0020, 0xb004, 0x904d, 0x0110, 0x080c, 0x0fec, 0x080c,
-	0x103a, 0x0520, 0x8528, 0xa867, 0x0110, 0xa86b, 0x0000, 0x2920,
-	0xb406, 0x968a, 0x003d, 0x1228, 0x2608, 0x2011, 0x001b, 0x0499,
-	0x00a8, 0x96b2, 0x003c, 0x2009, 0x003c, 0x2950, 0x2011, 0x001b,
-	0x0451, 0x0c28, 0x2001, 0x0205, 0x2003, 0x0000, 0x00ae, 0x852f,
-	0x95ad, 0x0003, 0xb566, 0x95ac, 0x0000, 0x0048, 0x2001, 0x0205,
-	0x2003, 0x0000, 0x00ae, 0x852f, 0x95ad, 0x0003, 0xb566, 0x009e,
-	0x006e, 0x005e, 0x0005, 0x00a6, 0x89ff, 0x0158, 0xa804, 0x9055,
-	0x0130, 0xa807, 0x0000, 0x080c, 0x6d80, 0x2a48, 0x0cb8, 0x080c,
-	0x6d80, 0x00ae, 0x0005, 0x00f6, 0x2079, 0x0200, 0x7814, 0x9085,
-	0x0080, 0x7816, 0xd184, 0x0108, 0x8108, 0x810c, 0x20a9, 0x0001,
-	0xa860, 0x20e8, 0xa85c, 0x9200, 0x20a0, 0x20e1, 0x0000, 0x2300,
-	0x9e00, 0x2098, 0x4003, 0x8318, 0x9386, 0x0020, 0x1148, 0x2018,
-	0x2300, 0x9e00, 0x2098, 0x7814, 0x8000, 0x9085, 0x0080, 0x7816,
-	0x8109, 0x1d80, 0x7817, 0x0000, 0x00fe, 0x0005, 0x0066, 0x0126,
-	0x2091, 0x8000, 0x2031, 0x0001, 0x6020, 0x9084, 0x000f, 0x0083,
-	0x012e, 0x006e, 0x0005, 0x0126, 0x2091, 0x8000, 0x0066, 0x2031,
-	0x0000, 0x6020, 0x9084, 0x000f, 0x001b, 0x006e, 0x012e, 0x0005,
-	0xc488, 0xc488, 0xc483, 0xc4ac, 0xc460, 0xc483, 0xc462, 0xc483,
-	0xc460, 0x90e4, 0xc483, 0xc483, 0xc483, 0xc460, 0xc460, 0xc460,
-	0x080c, 0x0d7d, 0x6010, 0x9080, 0x0000, 0x2004, 0xd0bc, 0x190c,
-	0xc4ac, 0x0036, 0x6014, 0x0096, 0x2048, 0xa880, 0x009e, 0xd0cc,
-	0x0118, 0x2019, 0x000c, 0x0038, 0xd094, 0x0118, 0x2019, 0x000d,
-	0x0010, 0x2019, 0x0010, 0x080c, 0xde1b, 0x6023, 0x0006, 0x6003,
-	0x0007, 0x003e, 0x0005, 0x9006, 0x0005, 0x9085, 0x0001, 0x0005,
-	0x0096, 0x86ff, 0x11e8, 0x6014, 0x2048, 0x080c, 0xc838, 0x01d0,
-	0x6043, 0xffff, 0xa864, 0x9086, 0x0139, 0x1128, 0xa87b, 0x0005,
-	0xa883, 0x0000, 0x0028, 0x900e, 0x2001, 0x0005, 0x080c, 0x6fc0,
-	0x080c, 0xcb3c, 0x080c, 0x6d74, 0x080c, 0xac28, 0x9085, 0x0001,
-	0x009e, 0x0005, 0x9006, 0x0ce0, 0x080c, 0xa896, 0x080c, 0xcf8c,
-	0x6000, 0x908a, 0x0016, 0x1a0c, 0x0d7d, 0x002b, 0x0106, 0x080c,
-	0xa8b2, 0x010e, 0x0005, 0xc4cb, 0xc4f9, 0xc4cd, 0xc520, 0xc4f4,
-	0xc4cb, 0xc483, 0xc488, 0xc488, 0xc483, 0xc483, 0xc483, 0xc483,
-	0xc483, 0xc483, 0xc483, 0x080c, 0x0d7d, 0x86ff, 0x1510, 0x6020,
-	0x9086, 0x0006, 0x01f0, 0x0096, 0x6014, 0x2048, 0x080c, 0xc838,
-	0x0158, 0xa87c, 0xd0cc, 0x0130, 0x0096, 0xa878, 0x2048, 0x080c,
-	0x0fec, 0x009e, 0x080c, 0xcb3c, 0x009e, 0x080c, 0xcf0c, 0x6007,
-	0x0085, 0x6003, 0x000b, 0x6023, 0x0002, 0x2009, 0x8020, 0x080c,
-	0x9200, 0x9085, 0x0001, 0x0005, 0x0066, 0x080c, 0x1a6a, 0x006e,
-	0x08a0, 0x00e6, 0x2071, 0x19e7, 0x7030, 0x9c06, 0x1120, 0x080c,
-	0xa098, 0x00ee, 0x0850, 0x6020, 0x9084, 0x000f, 0x9086, 0x0006,
-	0x1150, 0x0086, 0x0096, 0x2049, 0x0001, 0x2c40, 0x080c, 0xa218,
-	0x009e, 0x008e, 0x0040, 0x0066, 0x080c, 0x9f94, 0x190c, 0x0d7d,
-	0x080c, 0x9fa2, 0x006e, 0x00ee, 0x1904, 0xc4cd, 0x0804, 0xc483,
-	0x0036, 0x00e6, 0x2071, 0x19e7, 0x704c, 0x9c06, 0x1138, 0x901e,
-	0x080c, 0xa118, 0x00ee, 0x003e, 0x0804, 0xc4cd, 0x080c, 0xa34e,
-	0x00ee, 0x003e, 0x1904, 0xc4cd, 0x0804, 0xc483, 0x00c6, 0x0066,
-	0x6020, 0x9084, 0x000f, 0x001b, 0x006e, 0x00ce, 0x0005, 0xc556,
-	0xc618, 0xc77f, 0xc55e, 0xac28, 0xc556, 0xde0d, 0xcf74, 0xc618,
-	0x90ab, 0xc7fe, 0xc54f, 0xc54f, 0xc54f, 0xc54f, 0xc54f, 0x080c,
-	0x0d7d, 0x080c, 0xca4d, 0x1110, 0x080c, 0xb5b5, 0x0005, 0x080c,
-	0x95de, 0x0804, 0xabed, 0x601b, 0x0001, 0x0005, 0x080c, 0xc838,
-	0x0130, 0x6014, 0x0096, 0x2048, 0x2c00, 0xa896, 0x009e, 0x080c,
-	0xa896, 0x080c, 0xcf8c, 0x6000, 0x908a, 0x0016, 0x1a0c, 0x0d7d,
-	0x0013, 0x0804, 0xa8b2, 0xc583, 0xc585, 0xc5af, 0xc5c3, 0xc5ee,
-	0xc583, 0xc556, 0xc556, 0xc556, 0xc5ca, 0xc5ca, 0xc583, 0xc583,
-	0xc583, 0xc583, 0xc5d4, 0x080c, 0x0d7d, 0x00e6, 0x6014, 0x0096,
-	0x2048, 0xa880, 0xc0b5, 0xa882, 0x009e, 0x2071, 0x19e7, 0x7030,
-	0x9c06, 0x01d0, 0x0066, 0x080c, 0x9f94, 0x190c, 0x0d7d, 0x080c,
-	0x9fa2, 0x006e, 0x080c, 0xcf0c, 0x6007, 0x0085, 0x6003, 0x000b,
-	0x6023, 0x0002, 0x2001, 0x1987, 0x2004, 0x601a, 0x2009, 0x8020,
-	0x080c, 0x9200, 0x00ee, 0x0005, 0x601b, 0x0001, 0x0cd8, 0x0096,
-	0x6014, 0x2048, 0xa880, 0xc0b5, 0xa882, 0x009e, 0x080c, 0xcf0c,
-	0x6007, 0x0085, 0x6003, 0x000b, 0x6023, 0x0002, 0x2009, 0x8020,
-	0x080c, 0x9200, 0x0005, 0x080c, 0xa896, 0x080c, 0xaa2a, 0x080c,
-	0xa8b2, 0x0c28, 0x0096, 0x601b, 0x0001, 0x6014, 0x2048, 0xa880,
-	0xc0b5, 0xa882, 0x009e, 0x0005, 0x080c, 0x56e2, 0x01a8, 0x6014,
-	0x0096, 0x904d, 0x0180, 0xa864, 0xa867, 0x0103, 0xa87b, 0x0006,
-	0x9086, 0x0139, 0x1140, 0xa867, 0x0139, 0xa897, 0x4005, 0xa89b,
-	0x0004, 0x080c, 0x6d80, 0x009e, 0x0804, 0xabed, 0x6014, 0x0096,
-	0x904d, 0x0508, 0x080c, 0xcf78, 0x01f0, 0x080c, 0xa8b2, 0x2001,
-	0x180f, 0x2004, 0xd0c4, 0x0110, 0x009e, 0x0005, 0xa884, 0x009e,
-	0x8003, 0x800b, 0x810b, 0x9108, 0x611a, 0x2001, 0x0037, 0x2c08,
-	0x080c, 0x1679, 0x6000, 0x9086, 0x0004, 0x1120, 0x2009, 0x0048,
-	0x080c, 0xac8c, 0x0005, 0x009e, 0x080c, 0x1a6a, 0x0804, 0xc5af,
-	0x6000, 0x908a, 0x0016, 0x1a0c, 0x0d7d, 0x000b, 0x0005, 0xc62f,
-	0xc55b, 0xc631, 0xc62f, 0xc631, 0xc631, 0xc557, 0xc62f, 0xc551,
-	0xc551, 0xc62f, 0xc62f, 0xc62f, 0xc62f, 0xc62f, 0xc62f, 0x080c,
-	0x0d7d, 0x6010, 0x00b6, 0x2058, 0xb804, 0x9084, 0x00ff, 0x00be,
-	0x908a, 0x000c, 0x1a0c, 0x0d7d, 0x00b6, 0x0013, 0x00be, 0x0005,
-	0xc64c, 0xc719, 0xc64e, 0xc68e, 0xc64e, 0xc68e, 0xc64e, 0xc65c,
-	0xc64c, 0xc68e, 0xc64c, 0xc67d, 0x080c, 0x0d7d, 0x6004, 0x908e,
-	0x0016, 0x05c0, 0x908e, 0x0004, 0x05a8, 0x908e, 0x0002, 0x0590,
-	0x908e, 0x0052, 0x0904, 0xc715, 0x6004, 0x080c, 0xca4d, 0x0904,
-	0xc732, 0x908e, 0x0004, 0x1110, 0x080c, 0x321c, 0x908e, 0x0021,
-	0x0904, 0xc736, 0x908e, 0x0022, 0x0904, 0xc77a, 0x908e, 0x003d,
-	0x0904, 0xc736, 0x908e, 0x0039, 0x0904, 0xc73a, 0x908e, 0x0035,
-	0x0904, 0xc73a, 0x908e, 0x001e, 0x0178, 0x908e, 0x0001, 0x1140,
-	0x6010, 0x2058, 0xb804, 0x9084, 0x00ff, 0x9086, 0x0006, 0x0110,
-	0x080c, 0x31e7, 0x080c, 0xb5b5, 0x0804, 0xac28, 0x00c6, 0x00d6,
-	0x6104, 0x9186, 0x0016, 0x0904, 0xc706, 0x9186, 0x0002, 0x1904,
-	0xc6db, 0x2001, 0x1837, 0x2004, 0xd08c, 0x11c8, 0x080c, 0x74e9,
-	0x11b0, 0x080c, 0xcf52, 0x0138, 0x080c, 0x750c, 0x1120, 0x080c,
-	0x73f4, 0x0804, 0xc763, 0x2001, 0x197d, 0x2003, 0x0001, 0x2001,
-	0x1800, 0x2003, 0x0001, 0x080c, 0x741a, 0x0804, 0xc763, 0x6010,
-	0x2058, 0x2001, 0x1837, 0x2004, 0xd0ac, 0x1904, 0xc763, 0xb8a0,
-	0x9084, 0xff80, 0x1904, 0xc763, 0xb840, 0x9084, 0x00ff, 0x9005,
-	0x0190, 0x8001, 0xb842, 0x6017, 0x0000, 0x6023, 0x0007, 0x601b,
-	0x0398, 0x604b, 0x0000, 0x080c, 0xab97, 0x0128, 0x2b00, 0x6012,
-	0x6023, 0x0001, 0x0458, 0x00de, 0x00ce, 0x6004, 0x908e, 0x0002,
-	0x11a0, 0x6010, 0x2058, 0xb8a0, 0x9086, 0x007e, 0x1170, 0x2009,
-	0x1837, 0x2104, 0xc085, 0x200a, 0x00e6, 0x2071, 0x1800, 0x080c,
-	0x5fbc, 0x00ee, 0x080c, 0xb5b5, 0x0030, 0x080c, 0xb5b5, 0x080c,
-	0x31e7, 0x080c, 0xcf67, 0x00e6, 0x0126, 0x2091, 0x8000, 0x080c,
-	0x321c, 0x012e, 0x00ee, 0x080c, 0xac28, 0x0005, 0x2001, 0x0002,
-	0x080c, 0x6575, 0x6003, 0x0001, 0x6007, 0x0002, 0x080c, 0x9225,
-	0x080c, 0x96a0, 0x00de, 0x00ce, 0x0c80, 0x080c, 0x321c, 0x0804,
-	0xc68a, 0x00c6, 0x00d6, 0x6104, 0x9186, 0x0016, 0x0d38, 0x6010,
-	0x2058, 0xb840, 0x9084, 0x00ff, 0x9005, 0x0904, 0xc6db, 0x8001,
-	0xb842, 0x6003, 0x0001, 0x080c, 0x9225, 0x080c, 0x96a0, 0x00de,
-	0x00ce, 0x0898, 0x080c, 0xb5b5, 0x0804, 0xc68c, 0x080c, 0xb5f1,
-	0x0804, 0xc68c, 0x00d6, 0x2c68, 0x6104, 0x080c, 0xceca, 0x00de,
-	0x0118, 0x080c, 0xabed, 0x00f0, 0x6004, 0x8007, 0x6134, 0x918c,
-	0x00ff, 0x9105, 0x6036, 0x6007, 0x0085, 0x6003, 0x000b, 0x6023,
-	0x0002, 0x603c, 0x600a, 0x2001, 0x1987, 0x2004, 0x601a, 0x602c,
-	0x2c08, 0x2060, 0x6024, 0xc0b5, 0x6026, 0x2160, 0x2009, 0x8020,
-	0x080c, 0x921e, 0x0005, 0x00de, 0x00ce, 0x080c, 0xb5b5, 0x080c,
-	0x31e7, 0x00e6, 0x0126, 0x2091, 0x8000, 0x080c, 0x321c, 0x6017,
-	0x0000, 0x6023, 0x0007, 0x601b, 0x0398, 0x604b, 0x0000, 0x012e,
-	0x00ee, 0x0005, 0x080c, 0xb029, 0x1904, 0xc732, 0x0005, 0x6000,
-	0x908a, 0x0016, 0x1a0c, 0x0d7d, 0x0096, 0x00d6, 0x001b, 0x00de,
-	0x009e, 0x0005, 0xc79a, 0xc79a, 0xc79a, 0xc79a, 0xc79a, 0xc79a,
-	0xc79a, 0xc79a, 0xc79a, 0xc556, 0xc79a, 0xc55b, 0xc79c, 0xc55b,
-	0xc7a9, 0xc79a, 0x080c, 0x0d7d, 0x6004, 0x9086, 0x008b, 0x0148,
-	0x6007, 0x008b, 0x6003, 0x000d, 0x2009, 0x8020, 0x080c, 0x921e,
-	0x0005, 0x080c, 0xcf46, 0x0118, 0x080c, 0xcf59, 0x0010, 0x080c,
-	0xcf67, 0x080c, 0xca27, 0x080c, 0xc838, 0x0570, 0x080c, 0x31e7,
-	0x080c, 0xc838, 0x0168, 0x6014, 0x2048, 0xa867, 0x0103, 0xa87b,
-	0x0006, 0xa877, 0x0000, 0xa880, 0xc0ed, 0xa882, 0x080c, 0x6d80,
-	0x2c68, 0x080c, 0xab97, 0x0150, 0x6810, 0x6012, 0x080c, 0xcccc,
-	0x00c6, 0x2d60, 0x080c, 0xac28, 0x00ce, 0x0008, 0x2d60, 0x6017,
-	0x0000, 0x6023, 0x0001, 0x6007, 0x0001, 0x6003, 0x0001, 0x080c,
-	0x9225, 0x080c, 0x96a0, 0x00c8, 0x080c, 0xcf46, 0x0138, 0x6034,
-	0x9086, 0x4000, 0x1118, 0x080c, 0x31e7, 0x08d0, 0x6034, 0x908c,
-	0xff00, 0x810f, 0x9186, 0x0039, 0x0118, 0x9186, 0x0035, 0x1118,
-	0x080c, 0x31e7, 0x0868, 0x080c, 0xac28, 0x0005, 0x6000, 0x908a,
-	0x0016, 0x1a0c, 0x0d7d, 0x0002, 0xc814, 0xc814, 0xc816, 0xc816,
-	0xc816, 0xc814, 0xc814, 0xac28, 0xc814, 0xc814, 0xc814, 0xc814,
-	0xc814, 0xc814, 0xc814, 0xc814, 0x080c, 0x0d7d, 0x080c, 0xa896,
-	0x080c, 0xaa2a, 0x080c, 0xa8b2, 0x6114, 0x0096, 0x2148, 0xa87b,
-	0x0006, 0x080c, 0x6d80, 0x009e, 0x0804, 0xabed, 0x9284, 0x0003,
-	0x1158, 0x9282, 0x1ddc, 0x0240, 0x2001, 0x181a, 0x2004, 0x9202,
-	0x1218, 0x9085, 0x0001, 0x0005, 0x9006, 0x0ce8, 0x0096, 0x0028,
-	0x0096, 0x0006, 0x6014, 0x2048, 0x000e, 0x0006, 0x9984, 0xf000,
-	0x9086, 0xf000, 0x0110, 0x080c, 0x10e5, 0x000e, 0x009e, 0x0005,
-	0x00e6, 0x00c6, 0x0036, 0x0006, 0x0126, 0x2091, 0x8000, 0x2061,
-	0x1ddc, 0x2071, 0x1800, 0x7354, 0x7074, 0x9302, 0x1640, 0x6020,
-	0x9206, 0x11f8, 0x080c, 0xcf52, 0x0180, 0x9286, 0x0001, 0x1168,
-	0x6004, 0x9086, 0x0004, 0x1148, 0x080c, 0x31e7, 0x080c, 0xcf67,
-	0x00c6, 0x080c, 0xac28, 0x00ce, 0x0060, 0x080c, 0xcc3e, 0x0148,
-	0x080c, 0xca4d, 0x1110, 0x080c, 0xb5b5, 0x00c6, 0x080c, 0xabed,
-	0x00ce, 0x9ce0, 0x001c, 0x7068, 0x9c02, 0x1208, 0x08a0, 0x012e,
-	0x000e, 0x003e, 0x00ce, 0x00ee, 0x0005, 0x00e6, 0x00c6, 0x0016,
-	0x9188, 0x1000, 0x210c, 0x81ff, 0x0128, 0x2061, 0x1b32, 0x6112,
-	0x080c, 0x31e7, 0x9006, 0x0010, 0x9085, 0x0001, 0x001e, 0x00ce,
-	0x00ee, 0x0005, 0x00c6, 0x0126, 0x2091, 0x8000, 0x080c, 0xab97,
-	0x01b0, 0x665e, 0x2b00, 0x6012, 0x080c, 0x56e2, 0x0118, 0x080c,
-	0xc969, 0x0168, 0x080c, 0xcccc, 0x6023, 0x0003, 0x2009, 0x004b,
-	0x080c, 0xac8c, 0x9085, 0x0001, 0x012e, 0x00ce, 0x0005, 0x9006,
-	0x0cd8, 0x00c6, 0x0126, 0x2091, 0x8000, 0xbaa0, 0x080c, 0xac5f,
-	0x0580, 0x605f, 0x0000, 0x2b00, 0x6012, 0x080c, 0xcccc, 0x6023,
-	0x0003, 0x0016, 0x080c, 0xa896, 0x080c, 0x93a5, 0x0076, 0x903e,
-	0x080c, 0x9277, 0x2c08, 0x080c, 0xdfeb, 0x007e, 0x080c, 0xa8b2,
-	0x001e, 0xd184, 0x0128, 0x080c, 0xabed, 0x9085, 0x0001, 0x0070,
-	0x080c, 0x56e2, 0x0128, 0xd18c, 0x1170, 0x080c, 0xc969, 0x0148,
-	0x2009, 0x004c, 0x080c, 0xac8c, 0x9085, 0x0001, 0x012e, 0x00ce,
-	0x0005, 0x9006, 0x0cd8, 0x2900, 0x6016, 0x0c90, 0x2009, 0x004d,
-	0x0010, 0x2009, 0x004e, 0x00f6, 0x00c6, 0x0046, 0x0016, 0x080c,
-	0xab97, 0x2c78, 0x0590, 0x7e5e, 0x2b00, 0x7812, 0x7823, 0x0003,
-	0x2021, 0x0005, 0x080c, 0xc97b, 0x9186, 0x004d, 0x0118, 0x9186,
-	0x004e, 0x0148, 0x2001, 0x1980, 0x200c, 0xd1fc, 0x0168, 0x2f60,
-	0x080c, 0xabed, 0x00d0, 0x2001, 0x197f, 0x200c, 0xd1fc, 0x0120,
-	0x2f60, 0x080c, 0xabed, 0x0088, 0x2f60, 0x080c, 0x56e2, 0x0138,
-	0xd18c, 0x1118, 0x04f1, 0x0148, 0x0010, 0x2900, 0x7816, 0x001e,
-	0x0016, 0x080c, 0xac8c, 0x9085, 0x0001, 0x001e, 0x004e, 0x00ce,
-	0x00fe, 0x0005, 0x00f6, 0x00c6, 0x0046, 0x080c, 0xab97, 0x2c78,
-	0x0508, 0x7e5e, 0x2b00, 0x7812, 0x7823, 0x0003, 0x0096, 0x2021,
-	0x0004, 0x0489, 0x009e, 0x2001, 0x197e, 0x200c, 0xd1fc, 0x0120,
-	0x2f60, 0x080c, 0xabed, 0x0060, 0x2f60, 0x080c, 0x56e2, 0x0120,
-	0xd18c, 0x1160, 0x0071, 0x0130, 0x2009, 0x0052, 0x080c, 0xac8c,
-	0x9085, 0x0001, 0x004e, 0x00ce, 0x00fe, 0x0005, 0x2900, 0x7816,
-	0x0c98, 0x00c6, 0x080c, 0x4aa7, 0x00ce, 0x1120, 0x080c, 0xabed,
-	0x9006, 0x0005, 0xa867, 0x0000, 0xa86b, 0x8000, 0x2900, 0x6016,
-	0x9085, 0x0001, 0x0005, 0x0096, 0x0076, 0x0126, 0x2091, 0x8000,
-	0x080c, 0xa896, 0x080c, 0x6804, 0x0158, 0x2001, 0xc982, 0x0006,
-	0x900e, 0x2400, 0x080c, 0x6fc0, 0x080c, 0x6d80, 0x000e, 0x0807,
-	0x2418, 0x080c, 0x95a4, 0xbaa0, 0x0086, 0x2041, 0x0001, 0x2039,
-	0x0001, 0x2608, 0x080c, 0x93bf, 0x008e, 0x080c, 0x9277, 0x2f08,
-	0x2648, 0x080c, 0xdfeb, 0xb93c, 0x81ff, 0x090c, 0x9496, 0x080c,
-	0xa8b2, 0x012e, 0x007e, 0x009e, 0x0005, 0x00c6, 0x0126, 0x2091,
-	0x8000, 0x080c, 0xab97, 0x0190, 0x660a, 0x2b08, 0x6112, 0x080c,
-	0xcccc, 0x6023, 0x0001, 0x2900, 0x6016, 0x2009, 0x001f, 0x080c,
-	0xac8c, 0x9085, 0x0001, 0x012e, 0x00ce, 0x0005, 0x9006, 0x0cd8,
-	0x00c6, 0x0126, 0x2091, 0x8000, 0x080c, 0xac5f, 0x01b8, 0x660a,
-	0x2b08, 0x6112, 0x080c, 0xcccc, 0x6023, 0x0008, 0x2900, 0x6016,
-	0x00f6, 0x2c78, 0x080c, 0x1731, 0x00fe, 0x2009, 0x0021, 0x080c,
-	0xac8c, 0x9085, 0x0001, 0x012e, 0x00ce, 0x0005, 0x9006, 0x0cd8,
-	0x2009, 0x003d, 0x00c6, 0x0126, 0x0016, 0x2091, 0x8000, 0x080c,
-	0xab97, 0x0198, 0x660a, 0x2b08, 0x6112, 0x080c, 0xcccc, 0x6023,
-	0x0001, 0x2900, 0x6016, 0x001e, 0x0016, 0x080c, 0xac8c, 0x9085,
-	0x0001, 0x001e, 0x012e, 0x00ce, 0x0005, 0x9006, 0x0cd0, 0x00c6,
-	0x0126, 0x2091, 0x8000, 0x080c, 0xac5f, 0x0188, 0x2b08, 0x6112,
-	0x080c, 0xcccc, 0x6023, 0x0001, 0x2900, 0x6016, 0x2009, 0x0000,
-	0x080c, 0xac8c, 0x9085, 0x0001, 0x012e, 0x00ce, 0x0005, 0x9006,
-	0x0cd8, 0x2009, 0x0044, 0x0830, 0x2009, 0x0049, 0x0818, 0x0026,
-	0x00b6, 0x6210, 0x2258, 0xba3c, 0x82ff, 0x0118, 0x8211, 0xba3e,
-	0x1140, 0xb8d0, 0x9005, 0x0128, 0xb888, 0x9005, 0x1110, 0xb88b,
-	0x0001, 0x00be, 0x002e, 0x0005, 0x0006, 0x0016, 0x6004, 0x908e,
-	0x0002, 0x0140, 0x908e, 0x0003, 0x0128, 0x908e, 0x0004, 0x0110,
-	0x9085, 0x0001, 0x001e, 0x000e, 0x0005, 0x0006, 0x0096, 0x6020,
-	0x9086, 0x0004, 0x0190, 0x6014, 0x904d, 0x080c, 0xc838, 0x0168,
-	0xa864, 0x9086, 0x0139, 0x0158, 0x6020, 0x9086, 0x0003, 0x0128,
-	0xa868, 0xd0fc, 0x0110, 0x9006, 0x0010, 0x9085, 0x0001, 0x009e,
-	0x000e, 0x0005, 0x00c6, 0x0126, 0x2091, 0x8000, 0x080c, 0xac5f,
-	0x0198, 0x2b08, 0x6112, 0x080c, 0xcccc, 0x6023, 0x0001, 0x2900,
-	0x6016, 0x080c, 0x31e7, 0x2009, 0x0028, 0x080c, 0xac8c, 0x9085,
-	0x0001, 0x012e, 0x00ce, 0x0005, 0x9006, 0x0cd8, 0x9186, 0x0015,
-	0x11a8, 0x2011, 0x1824, 0x2204, 0x9086, 0x0074, 0x1178, 0x00b6,
-	0x080c, 0xb807, 0x00be, 0x080c, 0xba2a, 0x6003, 0x0001, 0x6007,
-	0x0029, 0x080c, 0x9225, 0x080c, 0x96a0, 0x0078, 0x6014, 0x0096,
-	0x2048, 0xa868, 0x009e, 0xd0fc, 0x0148, 0x2001, 0x0001, 0x080c,
-	0xce8b, 0x080c, 0xb5b5, 0x080c, 0xabed, 0x0005, 0x0096, 0x6014,
-	0x904d, 0x090c, 0x0d7d, 0xa87b, 0x0030, 0xa883, 0x0000, 0xa897,
-	0x4005, 0xa89b, 0x0004, 0xa867, 0x0139, 0x0126, 0x2091, 0x8000,
-	0x080c, 0x6d80, 0x012e, 0x009e, 0x080c, 0xabed, 0x0c30, 0x0096,
-	0x9186, 0x0016, 0x1128, 0x2001, 0x0004, 0x080c, 0x6575, 0x00e8,
-	0x9186, 0x0015, 0x1510, 0x2011, 0x1824, 0x2204, 0x9086, 0x0014,
-	0x11e0, 0x6010, 0x00b6, 0x2058, 0x080c, 0x66c0, 0x00be, 0x080c,
-	0xbafb, 0x1198, 0x6010, 0x00b6, 0x2058, 0xb890, 0x00be, 0x9005,
-	0x0160, 0x2001, 0x0006, 0x080c, 0x6575, 0x6014, 0x2048, 0xa868,
-	0xd0fc, 0x0170, 0x080c, 0xaffd, 0x0048, 0x6014, 0x2048, 0xa868,
-	0xd0fc, 0x0528, 0x080c, 0xb5b5, 0x080c, 0xabed, 0x009e, 0x0005,
-	0x6014, 0x6310, 0x2358, 0x904d, 0x090c, 0x0d7d, 0xa87b, 0x0000,
-	0xa883, 0x0000, 0xa897, 0x4000, 0x900e, 0x080c, 0x6914, 0x1108,
-	0xc185, 0xb800, 0xd0bc, 0x0108, 0xc18d, 0xa99a, 0x0126, 0x2091,
-	0x8000, 0x080c, 0x6d80, 0x012e, 0x080c, 0xabed, 0x08f8, 0x6014,
-	0x904d, 0x090c, 0x0d7d, 0xa87b, 0x0030, 0xa883, 0x0000, 0xa897,
-	0x4005, 0xa89b, 0x0004, 0xa867, 0x0139, 0x0126, 0x2091, 0x8000,
-	0x080c, 0x6d80, 0x012e, 0x080c, 0xabed, 0x0840, 0xa878, 0x9086,
-	0x0005, 0x1108, 0x0009, 0x0005, 0xa880, 0xc0ad, 0xa882, 0x0005,
-	0x604b, 0x0000, 0x6017, 0x0000, 0x6003, 0x0001, 0x6007, 0x0050,
-	0x2009, 0x8023, 0x080c, 0x921e, 0x0005, 0x00c6, 0x6010, 0x00b6,
-	0x2058, 0xb800, 0x00be, 0xd0bc, 0x0130, 0x0066, 0x6020, 0x9084,
-	0x000f, 0x001b, 0x006e, 0x00ce, 0x0005, 0xc556, 0xcb6f, 0xcb6f,
-	0xcb72, 0xe318, 0xe333, 0xe336, 0xc556, 0xc556, 0xc556, 0xc556,
-	0xc556, 0xc556, 0xc556, 0xc556, 0xc556, 0x080c, 0x0d7d, 0xa001,
-	0xa001, 0x0005, 0x0096, 0x6014, 0x904d, 0x0118, 0xa87c, 0xd0e4,
-	0x1110, 0x009e, 0x0010, 0x009e, 0x0005, 0x6010, 0x00b6, 0x2058,
-	0xb800, 0x00be, 0xd0bc, 0x0550, 0x2001, 0x1834, 0x2004, 0x9005,
-	0x1540, 0x00f6, 0x2c78, 0x080c, 0xab97, 0x0508, 0x7810, 0x6012,
-	0x080c, 0xcccc, 0x7820, 0x9086, 0x0003, 0x0128, 0x7808, 0x603a,
-	0x2f00, 0x603e, 0x0020, 0x7808, 0x603e, 0x2f00, 0x603a, 0x602e,
-	0x6023, 0x0001, 0x6007, 0x0035, 0x6003, 0x0001, 0x795c, 0x615e,
-	0x2009, 0x8020, 0x080c, 0x921e, 0x2f60, 0x00fe, 0x0005, 0x2f60,
-	0x00fe, 0x2001, 0x1988, 0x2004, 0x604a, 0x0005, 0x0016, 0x0096,
-	0x6814, 0x2048, 0x681c, 0xd0fc, 0xc0fc, 0x681e, 0xa87c, 0x1108,
-	0xd0e4, 0x0180, 0xc0e4, 0xa87e, 0xa877, 0x0000, 0xa893, 0x0000,
-	0xa88f, 0x0000, 0xd0cc, 0x0130, 0xc0cc, 0xa87e, 0xa878, 0x2048,
-	0x080c, 0x0fec, 0x6830, 0x6036, 0x908e, 0x0001, 0x0148, 0x6803,
-	0x0002, 0x9086, 0x0005, 0x0170, 0x9006, 0x602e, 0x6032, 0x00d0,
-	0x681c, 0xc085, 0x681e, 0x6803, 0x0004, 0x6824, 0xc0f4, 0x9085,
-	0x0c00, 0x6826, 0x6814, 0x2048, 0xa8ac, 0x6938, 0x9102, 0xa8b0,
-	0x693c, 0x9103, 0x1e48, 0x683c, 0x602e, 0x6838, 0x9084, 0xfffc,
-	0x683a, 0x6032, 0x2d00, 0x603a, 0x6808, 0x603e, 0x6910, 0x6112,
-	0x695c, 0x615e, 0x6023, 0x0001, 0x6007, 0x0039, 0x6003, 0x0001,
-	0x2009, 0x8020, 0x080c, 0x921e, 0x009e, 0x001e, 0x0005, 0x6024,
-	0xd0d4, 0x0510, 0xd0f4, 0x11f8, 0x6038, 0x940a, 0x603c, 0x9303,
-	0x0230, 0x9105, 0x0120, 0x6024, 0xc0d4, 0xc0f5, 0x0098, 0x643a,
-	0x633e, 0xac3e, 0xab42, 0x0046, 0x0036, 0x2400, 0xacac, 0x9402,
-	0xa836, 0x2300, 0xabb0, 0x9303, 0xa83a, 0x003e, 0x004e, 0x6024,
-	0xc0d4, 0x0000, 0x6026, 0x0005, 0xd0f4, 0x1138, 0xa83c, 0x603a,
-	0xa840, 0x603e, 0x6024, 0xc0f5, 0x6026, 0x0005, 0x0006, 0x0016,
-	0x6004, 0x908e, 0x0034, 0x01b8, 0x908e, 0x0035, 0x01a0, 0x908e,
-	0x0036, 0x0188, 0x908e, 0x0037, 0x0170, 0x908e, 0x0038, 0x0158,
-	0x908e, 0x0039, 0x0140, 0x908e, 0x003a, 0x0128, 0x908e, 0x003b,
-	0x0110, 0x9085, 0x0001, 0x001e, 0x000e, 0x0005, 0x0006, 0x0016,
-	0x0026, 0x0036, 0x00e6, 0x2001, 0x1982, 0x200c, 0x8000, 0x2014,
-	0x2001, 0x0032, 0x080c, 0x9166, 0x2001, 0x1986, 0x82ff, 0x1110,
-	0x2011, 0x0014, 0x2202, 0x2001, 0x1984, 0x200c, 0x8000, 0x2014,
-	0x2071, 0x196c, 0x711a, 0x721e, 0x2001, 0x0064, 0x080c, 0x9166,
-	0x2001, 0x1987, 0x82ff, 0x1110, 0x2011, 0x0014, 0x2202, 0x2001,
-	0x1988, 0x9288, 0x000a, 0x2102, 0x2001, 0x0017, 0x080c, 0xa887,
-	0x2001, 0x1a89, 0x2102, 0x2001, 0x0032, 0x080c, 0x1679, 0x080c,
-	0x6a4c, 0x00ee, 0x003e, 0x002e, 0x001e, 0x000e, 0x0005, 0x0006,
-	0x0016, 0x00e6, 0x2001, 0x1986, 0x2003, 0x0028, 0x2001, 0x1987,
-	0x2003, 0x0014, 0x2071, 0x196c, 0x701b, 0x0000, 0x701f, 0x07d0,
-	0x2001, 0x1988, 0x2009, 0x001e, 0x2102, 0x2001, 0x0017, 0x080c,
-	0xa887, 0x2001, 0x1a89, 0x2102, 0x2001, 0x0032, 0x080c, 0x1679,
-	0x00ee, 0x001e, 0x000e, 0x0005, 0x0096, 0x6060, 0x904d, 0x0110,
-	0x080c, 0x106c, 0x009e, 0x0005, 0x0005, 0x00c6, 0x0126, 0x2091,
-	0x8000, 0x080c, 0xab97, 0x0180, 0x2b08, 0x6112, 0x0ca9, 0x6023,
-	0x0001, 0x2900, 0x6016, 0x2009, 0x0033, 0x080c, 0xac8c, 0x9085,
-	0x0001, 0x012e, 0x00ce, 0x0005, 0x9006, 0x0cd8, 0x0096, 0x00e6,
-	0x00f6, 0x2071, 0x1800, 0x9186, 0x0015, 0x1500, 0x7090, 0x9086,
-	0x0018, 0x11e0, 0x6014, 0x2048, 0xaa3c, 0xd2e4, 0x1160, 0x2c78,
-	0x080c, 0x975f, 0x01d8, 0x707c, 0xaa50, 0x9206, 0x1160, 0x7080,
-	0xaa54, 0x9206, 0x1140, 0x6210, 0x00b6, 0x2258, 0xbaa0, 0x00be,
-	0x900e, 0x080c, 0x323c, 0x080c, 0xaffd, 0x0020, 0x080c, 0xb5b5,
-	0x080c, 0xabed, 0x00fe, 0x00ee, 0x009e, 0x0005, 0x7060, 0xaa54,
-	0x9206, 0x0d48, 0x0c80, 0x00c6, 0x0126, 0x2091, 0x8000, 0x080c,
-	0xab97, 0x0188, 0x2b08, 0x6112, 0x080c, 0xcccc, 0x6023, 0x0001,
-	0x2900, 0x6016, 0x2009, 0x004d, 0x080c, 0xac8c, 0x9085, 0x0001,
-	0x012e, 0x00ce, 0x0005, 0x9006, 0x0cd8, 0x00c6, 0x0126, 0x2091,
-	0x8000, 0x0016, 0x080c, 0xab97, 0x0180, 0x2b08, 0x6112, 0x080c,
-	0xcccc, 0x6023, 0x0001, 0x2900, 0x6016, 0x001e, 0x080c, 0xac8c,
-	0x9085, 0x0001, 0x012e, 0x00ce, 0x0005, 0x001e, 0x9006, 0x0cd0,
-	0x0016, 0x0026, 0x0036, 0x0046, 0x0056, 0x0066, 0x0096, 0x00e6,
-	0x00f6, 0x2071, 0x1800, 0x9186, 0x0015, 0x1568, 0x7190, 0x6014,
-	0x2048, 0xa814, 0x8003, 0x9106, 0x1530, 0x20e1, 0x0000, 0x2001,
-	0x19a0, 0x2003, 0x0000, 0x6014, 0x2048, 0xa830, 0x20a8, 0x8906,
-	0x8006, 0x8007, 0x9094, 0x003f, 0x22e8, 0x9084, 0xffc0, 0x9080,
-	0x001b, 0x20a0, 0x2001, 0x19a0, 0x0016, 0x200c, 0x080c, 0xd565,
-	0x001e, 0xa804, 0x9005, 0x0110, 0x2048, 0x0c38, 0x6014, 0x2048,
-	0xa867, 0x0103, 0x0010, 0x080c, 0xb5b5, 0x080c, 0xabed, 0x00fe,
-	0x00ee, 0x009e, 0x006e, 0x005e, 0x004e, 0x003e, 0x002e, 0x001e,
-	0x0005, 0x0096, 0x00e6, 0x00f6, 0x2071, 0x1800, 0x9186, 0x0015,
-	0x11b8, 0x7090, 0x9086, 0x0004, 0x1198, 0x6014, 0x2048, 0x2c78,
-	0x080c, 0x975f, 0x01a8, 0x707c, 0xaa74, 0x9206, 0x1130, 0x7080,
-	0xaa78, 0x9206, 0x1110, 0x080c, 0x31e7, 0x080c, 0xaffd, 0x0020,
-	0x080c, 0xb5b5, 0x080c, 0xabed, 0x00fe, 0x00ee, 0x009e, 0x0005,
-	0x7060, 0xaa78, 0x9206, 0x0d78, 0x0c80, 0x0096, 0x00e6, 0x00f6,
-	0x2071, 0x1800, 0x9186, 0x0015, 0x1550, 0x7090, 0x9086, 0x0004,
-	0x1530, 0x6014, 0x2048, 0x2c78, 0x080c, 0x975f, 0x05f0, 0x707c,
-	0xaacc, 0x9206, 0x1180, 0x7080, 0xaad0, 0x9206, 0x1160, 0x080c,
-	0x31e7, 0x0016, 0xa998, 0xaab0, 0x9284, 0x1000, 0xc0fd, 0x080c,
-	0x5692, 0x001e, 0x0010, 0x080c, 0x547b, 0x080c, 0xc838, 0x0508,
-	0xa87b, 0x0000, 0xa883, 0x0000, 0xa897, 0x4000, 0x0080, 0x080c,
-	0xc838, 0x01b8, 0x6014, 0x2048, 0x080c, 0x547b, 0x1d70, 0xa87b,
-	0x0030, 0xa883, 0x0000, 0xa897, 0x4005, 0xa89b, 0x0004, 0x0126,
-	0x2091, 0x8000, 0xa867, 0x0139, 0x080c, 0x6d80, 0x012e, 0x080c,
-	0xabed, 0x00fe, 0x00ee, 0x009e, 0x0005, 0x7060, 0xaad0, 0x9206,
-	0x0930, 0x0888, 0x0016, 0x0026, 0xa87c, 0xd0ac, 0x0178, 0xa938,
-	0xaa34, 0x2100, 0x9205, 0x0150, 0xa890, 0x9106, 0x1118, 0xa88c,
-	0x9206, 0x0120, 0xa992, 0xaa8e, 0x9085, 0x0001, 0x002e, 0x001e,
-	0x0005, 0x00b6, 0x00d6, 0x0036, 0x080c, 0xc838, 0x0904, 0xce87,
-	0x0096, 0x6314, 0x2348, 0xa87a, 0xa982, 0x929e, 0x4000, 0x1580,
-	0x6310, 0x00c6, 0x2358, 0x2009, 0x0000, 0xa868, 0xd0f4, 0x1140,
-	0x080c, 0x6914, 0x1108, 0xc185, 0xb800, 0xd0bc, 0x0108, 0xc18d,
-	0xaa96, 0xa99a, 0x20a9, 0x0004, 0xa860, 0x20e8, 0xa85c, 0x9080,
-	0x0031, 0x20a0, 0xb8c4, 0x20e0, 0xb8c8, 0x9080, 0x0006, 0x2098,
-	0x080c, 0x0fb7, 0x20a9, 0x0004, 0xa85c, 0x9080, 0x0035, 0x20a0,
-	0xb8c8, 0x9080, 0x000a, 0x2098, 0x080c, 0x0fb7, 0x00ce, 0x0090,
-	0xaa96, 0x3918, 0x9398, 0x0007, 0x231c, 0x6004, 0x9086, 0x0016,
-	0x0110, 0xa89b, 0x0004, 0xaba2, 0x6310, 0x2358, 0xb804, 0x9084,
-	0x00ff, 0xa89e, 0x080c, 0x6d74, 0x6017, 0x0000, 0x009e, 0x003e,
-	0x00de, 0x00be, 0x0005, 0x0026, 0x0036, 0x0046, 0x00b6, 0x0096,
-	0x00f6, 0x6214, 0x2248, 0x6210, 0x2258, 0x2079, 0x0260, 0x9096,
-	0x0000, 0x11a0, 0xb814, 0x9084, 0x00ff, 0x900e, 0x080c, 0x25fb,
-	0x2118, 0x831f, 0x939c, 0xff00, 0x7838, 0x9084, 0x00ff, 0x931d,
-	0x7c3c, 0x2011, 0x8018, 0x080c, 0x4b07, 0x00a8, 0x9096, 0x0001,
-	0x1148, 0x89ff, 0x0180, 0xa89b, 0x000d, 0x7838, 0xa8a6, 0x783c,
-	0xa8aa, 0x0048, 0x9096, 0x0002, 0x1130, 0xa89b, 0x000d, 0x7838,
-	0xa8a6, 0x783c, 0xa8aa, 0x00fe, 0x009e, 0x00be, 0x004e, 0x003e,
-	0x002e, 0x0005, 0x00c6, 0x0026, 0x0016, 0x9186, 0x0035, 0x0110,
-	0x6a38, 0x0008, 0x6a2c, 0x080c, 0xc826, 0x01f0, 0x2260, 0x6120,
-	0x9186, 0x0003, 0x0118, 0x9186, 0x0006, 0x1190, 0x6838, 0x9206,
-	0x0140, 0x683c, 0x9206, 0x1160, 0x6108, 0x6838, 0x9106, 0x1140,
-	0x0020, 0x6008, 0x693c, 0x9106, 0x1118, 0x6010, 0x6910, 0x9106,
-	0x001e, 0x002e, 0x00ce, 0x0005, 0x9085, 0x0001, 0x0cc8, 0xa974,
-	0xd1cc, 0x0188, 0x918c, 0x00ff, 0x918e, 0x0002, 0x1160, 0xa9a8,
-	0x918c, 0x0f00, 0x810f, 0x918e, 0x0001, 0x1128, 0xa834, 0xa938,
-	0x9115, 0x190c, 0xbeb3, 0x0005, 0x0036, 0x2019, 0x0001, 0x0010,
-	0x0036, 0x901e, 0x0499, 0x01e0, 0x080c, 0xc838, 0x01c8, 0x080c,
-	0xca27, 0x6037, 0x4000, 0x6014, 0x6017, 0x0000, 0x0096, 0x2048,
-	0xa87c, 0x080c, 0xca4d, 0x1118, 0x080c, 0xb5b5, 0x0040, 0xa867,
-	0x0103, 0xa877, 0x0000, 0x83ff, 0x1129, 0x080c, 0x6d80, 0x009e,
-	0x003e, 0x0005, 0xa880, 0xd0b4, 0x0128, 0xa87b, 0x0006, 0xc0ec,
-	0xa882, 0x0048, 0xd0bc, 0x0118, 0xa87b, 0x0002, 0x0020, 0xa87b,
-	0x0005, 0x080c, 0xcb3c, 0xa877, 0x0000, 0x0005, 0x2001, 0x1810,
-	0x2004, 0xd0ec, 0x0005, 0x0006, 0x2001, 0x1810, 0x2004, 0xd0f4,
-	0x000e, 0x0005, 0x0006, 0x2001, 0x1810, 0x2004, 0xd0e4, 0x000e,
-	0x0005, 0x0036, 0x0046, 0x6010, 0x00b6, 0x2058, 0xbba0, 0x00be,
-	0x2021, 0x0007, 0x080c, 0x4cbe, 0x004e, 0x003e, 0x0005, 0x0c51,
-	0x1d81, 0x0005, 0x2001, 0x1986, 0x2004, 0x601a, 0x0005, 0x2001,
-	0x1988, 0x2004, 0x604a, 0x0005, 0x080c, 0xabed, 0x0804, 0x96a0,
-	0x611c, 0xd1fc, 0xa97c, 0x1108, 0xd1e4, 0x0005, 0x601c, 0xd0fc,
-	0xa87c, 0x1108, 0xd0e4, 0x0005, 0x601c, 0xd0fc, 0xc0fc, 0x601e,
-	0xa87c, 0x1108, 0xd0e4, 0x0005, 0x6044, 0xd0fc, 0x0160, 0xd0dc,
+	0x0136, 0x9080, 0x001b, 0x20a0, 0x2011, 0x0006, 0x20a9, 0x0001,
+	0x3418, 0x8318, 0x23a0, 0x4003, 0x3318, 0x8318, 0x2398, 0x8211,
+	0x1db8, 0x2011, 0x0006, 0x013e, 0x20a0, 0x3318, 0x8318, 0x2398,
+	0x4003, 0x3418, 0x8318, 0x23a0, 0x8211, 0x1db8, 0x0096, 0x080c,
+	0xc832, 0x0130, 0x6014, 0x2048, 0xa807, 0x0000, 0xa867, 0x0103,
+	0x009e, 0x0804, 0xabdf, 0x0096, 0x00d6, 0x0036, 0x7330, 0x9386,
+	0x0200, 0x11a8, 0x6010, 0x00b6, 0x2058, 0xb8d7, 0x0000, 0x00be,
+	0x6014, 0x9005, 0x0130, 0x2048, 0xa807, 0x0000, 0xa867, 0x0103,
+	0xab32, 0x080c, 0xabdf, 0x003e, 0x00de, 0x009e, 0x0005, 0x0011,
+	0x1d48, 0x0cc8, 0x0006, 0x0016, 0x080c, 0xcf51, 0x0188, 0x6014,
+	0x9005, 0x1170, 0x600b, 0x0003, 0x601b, 0x0000, 0x604b, 0x0000,
+	0x2009, 0x0022, 0x080c, 0xb3ea, 0x9006, 0x001e, 0x000e, 0x0005,
+	0x9085, 0x0001, 0x0cd0, 0x0096, 0x0016, 0x20a9, 0x0014, 0x9e80,
+	0x000c, 0x20e1, 0x0000, 0x2098, 0x6014, 0x2048, 0xa860, 0x20e8,
+	0xa85c, 0x9080, 0x0002, 0x20a0, 0x4003, 0x2001, 0x0205, 0x2003,
+	0x0001, 0x2099, 0x0260, 0x20a9, 0x0016, 0x4003, 0x20a9, 0x000a,
+	0xa804, 0x2048, 0xa860, 0x20e8, 0xa85c, 0x9080, 0x0002, 0x20a0,
+	0x4003, 0x2001, 0x0205, 0x2003, 0x0002, 0x2099, 0x0260, 0x20a9,
+	0x0020, 0x4003, 0x2003, 0x0000, 0x6014, 0x2048, 0xa800, 0x2048,
+	0xa867, 0x0103, 0x080c, 0xabdf, 0x001e, 0x009e, 0x0005, 0x0096,
+	0x0016, 0x900e, 0x7030, 0x9086, 0x0100, 0x0140, 0x7038, 0x9084,
+	0x00ff, 0x800c, 0x703c, 0x9084, 0x00ff, 0x8004, 0x9080, 0x0004,
+	0x9108, 0x810b, 0x2011, 0x0002, 0x2019, 0x000c, 0x6014, 0x2048,
+	0x080c, 0xc3f8, 0x080c, 0xc832, 0x0140, 0x6014, 0x2048, 0xa807,
+	0x0000, 0xa864, 0xa8e2, 0xa867, 0x0103, 0x080c, 0xabdf, 0x001e,
+	0x009e, 0x0005, 0x0016, 0x2009, 0x0000, 0x7030, 0x9086, 0x0200,
+	0x0110, 0x2009, 0x0001, 0x0096, 0x6014, 0x904d, 0x090c, 0x0d7d,
+	0xa97a, 0x080c, 0x6d7b, 0x009e, 0x080c, 0xabdf, 0x001e, 0x0005,
+	0x0016, 0x0096, 0x7030, 0x9086, 0x0100, 0x1118, 0x2009, 0x0004,
+	0x0010, 0x7034, 0x800c, 0x810b, 0x2011, 0x000c, 0x2019, 0x000c,
+	0x6014, 0x2048, 0xa804, 0x0096, 0x9005, 0x0108, 0x2048, 0x080c,
+	0xc3f8, 0x009e, 0x080c, 0xc832, 0x0148, 0xa804, 0x9005, 0x1158,
+	0xa807, 0x0000, 0xa864, 0xa8e2, 0xa867, 0x0103, 0x080c, 0xabdf,
+	0x009e, 0x001e, 0x0005, 0x0086, 0x2040, 0xa030, 0x8007, 0x9086,
+	0x0100, 0x1118, 0x080c, 0xb5a6, 0x00e0, 0xa034, 0x8007, 0x800c,
+	0x8806, 0x8006, 0x8007, 0x90bc, 0x003f, 0x9084, 0xffc0, 0x9080,
+	0x000c, 0xa87b, 0x0000, 0xa883, 0x0000, 0xa897, 0x4000, 0xaaa0,
+	0xab9c, 0xaca8, 0xada4, 0x2031, 0x0000, 0x2041, 0x1289, 0x0019,
+	0x0d08, 0x008e, 0x0898, 0x0096, 0x0006, 0x080c, 0x103a, 0x000e,
+	0x01b0, 0xa8ab, 0x0dcb, 0xa876, 0x000e, 0xa8a2, 0x0006, 0xae6a,
+	0x2800, 0xa89e, 0xa97a, 0xaf72, 0xaa8e, 0xab92, 0xac96, 0xad9a,
+	0x0086, 0x2940, 0x080c, 0x112f, 0x008e, 0x9085, 0x0001, 0x009e,
+	0x0005, 0x00e6, 0x00d6, 0x0026, 0x7008, 0x9084, 0x00ff, 0x6210,
+	0x00b6, 0x2258, 0xba10, 0x00be, 0x9206, 0x1520, 0x700c, 0x6210,
+	0x00b6, 0x2258, 0xba14, 0x00be, 0x9206, 0x11e0, 0x604b, 0x0000,
+	0x2c68, 0x0016, 0x2009, 0x0035, 0x080c, 0xcec9, 0x001e, 0x1158,
+	0x622c, 0x2268, 0x2071, 0x026c, 0x6b20, 0x9386, 0x0003, 0x0130,
+	0x9386, 0x0006, 0x0128, 0x080c, 0xabdf, 0x0020, 0x0039, 0x0010,
+	0x080c, 0xb21f, 0x002e, 0x00de, 0x00ee, 0x0005, 0x0096, 0x6814,
+	0x2048, 0x9186, 0x0015, 0x0904, 0xb1fe, 0x918e, 0x0016, 0x1904,
+	0xb21d, 0x700c, 0x908c, 0xff00, 0x9186, 0x1700, 0x0120, 0x9186,
+	0x0300, 0x1904, 0xb1d8, 0x89ff, 0x1138, 0x6800, 0x9086, 0x000f,
+	0x0904, 0xb1ba, 0x0804, 0xb21b, 0x6808, 0x9086, 0xffff, 0x1904,
+	0xb200, 0xa87c, 0x9084, 0x0060, 0x9086, 0x0020, 0x1128, 0xa83c,
+	0xa940, 0x9105, 0x1904, 0xb200, 0x6824, 0xd0b4, 0x1904, 0xb200,
+	0x080c, 0xca21, 0x6864, 0xa882, 0xa87c, 0xc0dc, 0xc0f4, 0xc0d4,
+	0xa87e, 0x0026, 0x900e, 0x6a18, 0x2001, 0x000a, 0x080c, 0x9148,
+	0xa884, 0x920a, 0x0208, 0x8011, 0xaa86, 0x82ff, 0x002e, 0x1138,
+	0x00c6, 0x2d60, 0x080c, 0xc54b, 0x00ce, 0x0804, 0xb21b, 0x00c6,
+	0xa868, 0xd0fc, 0x1118, 0x080c, 0x60b6, 0x0010, 0x080c, 0x64ba,
+	0x00ce, 0x1904, 0xb200, 0x00c6, 0x2d60, 0x080c, 0xabdf, 0x00ce,
+	0x0804, 0xb21b, 0x00c6, 0x080c, 0xac4f, 0x0198, 0x6017, 0x0000,
+	0x6810, 0x6012, 0x080c, 0xcccb, 0x6023, 0x0003, 0x6904, 0x00c6,
+	0x2d60, 0x080c, 0xabdf, 0x00ce, 0x080c, 0xac7c, 0x00ce, 0x0804,
+	0xb21b, 0x2001, 0x1987, 0x2004, 0x684a, 0x00ce, 0x0804, 0xb21b,
+	0x7008, 0x9086, 0x000b, 0x11c8, 0x6010, 0x00b6, 0x2058, 0xb900,
+	0xc1bc, 0xb902, 0x00be, 0x00c6, 0x2d60, 0xa87b, 0x0003, 0x080c,
+	0xcf0b, 0x6007, 0x0085, 0x6003, 0x000b, 0x6023, 0x0002, 0x2009,
+	0x8020, 0x080c, 0x9200, 0x00ce, 0x0430, 0x700c, 0x9086, 0x2a00,
+	0x1138, 0x2001, 0x1987, 0x2004, 0x684a, 0x00e8, 0x04c1, 0x00e8,
+	0x89ff, 0x090c, 0x0d7d, 0x00c6, 0x00d6, 0x2d60, 0xa867, 0x0103,
+	0xa87b, 0x0003, 0x080c, 0x6b91, 0x080c, 0xca21, 0x080c, 0xac1a,
+	0x0026, 0x6010, 0x00b6, 0x2058, 0xba3c, 0x080c, 0x674b, 0x00be,
+	0x002e, 0x00de, 0x00ce, 0x080c, 0xabdf, 0x009e, 0x0005, 0x9186,
+	0x0015, 0x1128, 0x2001, 0x1987, 0x2004, 0x684a, 0x0068, 0x918e,
+	0x0016, 0x1160, 0x00c6, 0x2d00, 0x2060, 0x080c, 0xe534, 0x080c,
+	0x88a3, 0x080c, 0xabdf, 0x00ce, 0x080c, 0xabdf, 0x0005, 0x0026,
+	0x0036, 0x0046, 0x7228, 0xacb0, 0xabac, 0xd2f4, 0x0130, 0x2001,
+	0x1987, 0x2004, 0x684a, 0x0804, 0xb299, 0x00c6, 0x2d60, 0x080c,
+	0xc423, 0x00ce, 0x6804, 0x9086, 0x0050, 0x1168, 0x00c6, 0x2d00,
+	0x2060, 0x6003, 0x0001, 0x6007, 0x0050, 0x2009, 0x8023, 0x080c,
+	0x9200, 0x00ce, 0x04f0, 0x6800, 0x9086, 0x000f, 0x01a8, 0x89ff,
+	0x090c, 0x0d7d, 0x6800, 0x9086, 0x0004, 0x1190, 0xa87c, 0xd0ac,
+	0x0178, 0xa843, 0x0fff, 0xa83f, 0x0fff, 0xa880, 0xc0fc, 0xa882,
+	0x2001, 0x0001, 0x6832, 0x0400, 0x2001, 0x0007, 0x6832, 0x00e0,
+	0xa87c, 0xd0b4, 0x1150, 0xd0ac, 0x0db8, 0x6824, 0xd0f4, 0x1d48,
+	0xa838, 0xa934, 0x9105, 0x0d80, 0x0c20, 0xd2ec, 0x1d68, 0x7024,
+	0x9306, 0x1118, 0x7020, 0x9406, 0x0d38, 0x7020, 0x683e, 0x7024,
+	0x683a, 0x2001, 0x0005, 0x6832, 0x080c, 0xcbb5, 0x080c, 0x9684,
+	0x0010, 0x080c, 0xabdf, 0x004e, 0x003e, 0x002e, 0x0005, 0x00e6,
+	0x00d6, 0x0026, 0x7008, 0x9084, 0x00ff, 0x6210, 0x00b6, 0x2258,
+	0xba10, 0x00be, 0x9206, 0x1904, 0xb304, 0x700c, 0x6210, 0x00b6,
+	0x2258, 0xba14, 0x00be, 0x9206, 0x1904, 0xb304, 0x6038, 0x2068,
+	0x6824, 0xc0dc, 0x6826, 0x6a20, 0x9286, 0x0007, 0x0904, 0xb304,
+	0x9286, 0x0002, 0x0904, 0xb304, 0x9286, 0x0000, 0x05e8, 0x6808,
+	0x633c, 0x9306, 0x15c8, 0x2071, 0x026c, 0x9186, 0x0015, 0x0570,
+	0x918e, 0x0016, 0x1100, 0x00c6, 0x6038, 0x2060, 0x6104, 0x9186,
+	0x004b, 0x01c0, 0x9186, 0x004c, 0x01a8, 0x9186, 0x004d, 0x0190,
+	0x9186, 0x004e, 0x0178, 0x9186, 0x0052, 0x0160, 0x6014, 0x0096,
+	0x2048, 0x080c, 0xc832, 0x090c, 0x0d7d, 0xa87b, 0x0003, 0x009e,
+	0x080c, 0xcf0b, 0x6007, 0x0085, 0x6003, 0x000b, 0x6023, 0x0002,
+	0x2009, 0x8020, 0x080c, 0x9200, 0x00ce, 0x0030, 0x6038, 0x2070,
+	0x2001, 0x1987, 0x2004, 0x704a, 0x080c, 0xabdf, 0x002e, 0x00de,
+	0x00ee, 0x0005, 0x00b6, 0x0096, 0x00f6, 0x6014, 0x2048, 0x6010,
+	0x2058, 0x91b6, 0x0015, 0x0130, 0xba08, 0xbb0c, 0xbc00, 0xc48c,
+	0xbc02, 0x0460, 0x0096, 0x0156, 0x0036, 0x0026, 0x2b48, 0x9e90,
+	0x0010, 0x2019, 0x000a, 0x20a9, 0x0004, 0x080c, 0xbbb5, 0x002e,
+	0x003e, 0x015e, 0x009e, 0x1904, 0xb373, 0x0096, 0x0156, 0x0036,
+	0x0026, 0x2b48, 0x9e90, 0x0014, 0x2019, 0x0006, 0x20a9, 0x0004,
+	0x080c, 0xbbb5, 0x002e, 0x003e, 0x015e, 0x009e, 0x15a0, 0x7238,
+	0xba0a, 0x733c, 0xbb0e, 0xbc00, 0xc48d, 0xbc02, 0xa804, 0x9005,
+	0x1128, 0x00fe, 0x009e, 0x00be, 0x0804, 0xafee, 0x0096, 0x2048,
+	0xaa12, 0xab16, 0xac0a, 0x009e, 0x8006, 0x8006, 0x8007, 0x90bc,
+	0x003f, 0x9084, 0xffc0, 0x9080, 0x0002, 0x2009, 0x002b, 0xaaa0,
+	0xab9c, 0xaca8, 0xada4, 0x2031, 0x0000, 0x2041, 0x1289, 0x080c,
+	0xb103, 0x0130, 0x00fe, 0x009e, 0x080c, 0xabdf, 0x00be, 0x0005,
+	0x080c, 0xb5a6, 0x0cb8, 0x2b78, 0x00f6, 0x080c, 0x31ef, 0x080c,
+	0xcf66, 0x00fe, 0x00c6, 0x080c, 0xab89, 0x2f00, 0x6012, 0x6017,
+	0x0000, 0x6023, 0x0001, 0x6007, 0x0001, 0x6003, 0x0001, 0x2001,
+	0x0007, 0x080c, 0x6570, 0x080c, 0x659c, 0x080c, 0x9207, 0x080c,
+	0x9684, 0x00ce, 0x0804, 0xb346, 0x2100, 0x91b2, 0x0053, 0x1a0c,
+	0x0d7d, 0x91b2, 0x0040, 0x1a04, 0xb3fc, 0x0002, 0xb3ea, 0xb3ea,
+	0xb3e0, 0xb3ea, 0xb3ea, 0xb3ea, 0xb3de, 0xb3de, 0xb3de, 0xb3de,
+	0xb3de, 0xb3de, 0xb3de, 0xb3de, 0xb3de, 0xb3de, 0xb3de, 0xb3de,
+	0xb3de, 0xb3de, 0xb3de, 0xb3de, 0xb3de, 0xb3de, 0xb3de, 0xb3de,
+	0xb3de, 0xb3de, 0xb3de, 0xb3de, 0xb3de, 0xb3ea, 0xb3de, 0xb3ea,
+	0xb3ea, 0xb3de, 0xb3de, 0xb3de, 0xb3de, 0xb3de, 0xb3e0, 0xb3de,
+	0xb3de, 0xb3de, 0xb3de, 0xb3de, 0xb3de, 0xb3de, 0xb3de, 0xb3de,
+	0xb3ea, 0xb3ea, 0xb3de, 0xb3de, 0xb3de, 0xb3de, 0xb3de, 0xb3de,
+	0xb3de, 0xb3de, 0xb3de, 0xb3ea, 0xb3de, 0xb3de, 0x080c, 0x0d7d,
+	0x0066, 0x00b6, 0x6610, 0x2658, 0xb8d4, 0xc08c, 0xb8d6, 0x00be,
+	0x006e, 0x0000, 0x6003, 0x0001, 0x6106, 0x9186, 0x0032, 0x0118,
+	0x080c, 0x9207, 0x0010, 0x080c, 0x9200, 0x0126, 0x2091, 0x8000,
+	0x080c, 0x9684, 0x012e, 0x0005, 0x2600, 0x0002, 0xb3ea, 0xb3ea,
+	0xb410, 0xb3ea, 0xb3ea, 0xb410, 0xb410, 0xb410, 0xb410, 0xb3ea,
+	0xb410, 0xb3ea, 0xb410, 0xb3ea, 0xb410, 0xb410, 0xb410, 0xb410,
+	0x080c, 0x0d7d, 0x6004, 0x90b2, 0x0053, 0x1a0c, 0x0d7d, 0x91b6,
+	0x0013, 0x0904, 0xb4e7, 0x91b6, 0x0027, 0x1904, 0xb493, 0x080c,
+	0x95c6, 0x6004, 0x080c, 0xca36, 0x01b0, 0x080c, 0xca47, 0x01a8,
+	0x908e, 0x0021, 0x0904, 0xb490, 0x908e, 0x0022, 0x1130, 0x080c,
+	0xb01a, 0x0904, 0xb48c, 0x0804, 0xb48d, 0x908e, 0x003d, 0x0904,
+	0xb490, 0x0804, 0xb486, 0x080c, 0x321e, 0x2001, 0x0007, 0x080c,
+	0x6570, 0x6010, 0x00b6, 0x2058, 0xb9a0, 0x00be, 0x080c, 0xb5a6,
+	0x9186, 0x007e, 0x1148, 0x2001, 0x1837, 0x2014, 0xc285, 0x080c,
+	0x74c8, 0x1108, 0xc2ad, 0x2202, 0x080c, 0xa888, 0x0036, 0x0026,
+	0x2019, 0x0028, 0x2110, 0x080c, 0xe640, 0x002e, 0x003e, 0x0016,
+	0x0026, 0x0036, 0x2110, 0x2019, 0x0028, 0x080c, 0x938d, 0x0076,
+	0x903e, 0x080c, 0x9256, 0x6010, 0x00b6, 0x905d, 0x0100, 0x00be,
+	0x2c08, 0x080c, 0xdffb, 0x007e, 0x003e, 0x002e, 0x001e, 0x080c,
+	0xa8a4, 0x080c, 0xcf66, 0x0016, 0x080c, 0xccc3, 0x080c, 0xabdf,
+	0x001e, 0x080c, 0x32f8, 0x080c, 0x9684, 0x0030, 0x080c, 0xccc3,
+	0x080c, 0xabdf, 0x080c, 0x9684, 0x0005, 0x080c, 0xb5a6, 0x0cb0,
+	0x080c, 0xb5e2, 0x0c98, 0x9186, 0x0015, 0x0118, 0x9186, 0x0016,
+	0x1140, 0x080c, 0xaa9a, 0x0d80, 0x9086, 0x0002, 0x0904, 0xb5ed,
+	0x0c58, 0x9186, 0x0014, 0x1d40, 0x080c, 0x95c6, 0x6004, 0x908e,
+	0x0022, 0x1118, 0x080c, 0xb01a, 0x09f8, 0x080c, 0x31ef, 0x080c,
+	0xcf66, 0x080c, 0xca36, 0x1190, 0x080c, 0x321e, 0x6010, 0x00b6,
+	0x2058, 0xb9a0, 0x00be, 0x080c, 0xb5a6, 0x9186, 0x007e, 0x1128,
+	0x2001, 0x1837, 0x200c, 0xc185, 0x2102, 0x0800, 0x080c, 0xca47,
+	0x1120, 0x080c, 0xb5a6, 0x0804, 0xb486, 0x6004, 0x908e, 0x0032,
+	0x1160, 0x00e6, 0x00f6, 0x2071, 0x189e, 0x2079, 0x0000, 0x080c,
+	0x3599, 0x00fe, 0x00ee, 0x0804, 0xb486, 0x6004, 0x908e, 0x0021,
+	0x0d40, 0x908e, 0x0022, 0x090c, 0xb5a6, 0x0804, 0xb486, 0x90b2,
+	0x0040, 0x1a04, 0xb586, 0x2008, 0x0002, 0xb52f, 0xb530, 0xb533,
+	0xb536, 0xb539, 0xb53c, 0xb52d, 0xb52d, 0xb52d, 0xb52d, 0xb52d,
+	0xb52d, 0xb52d, 0xb52d, 0xb52d, 0xb52d, 0xb52d, 0xb52d, 0xb52d,
+	0xb52d, 0xb52d, 0xb52d, 0xb52d, 0xb52d, 0xb52d, 0xb52d, 0xb52d,
+	0xb52d, 0xb52d, 0xb52d, 0xb53f, 0xb548, 0xb52d, 0xb549, 0xb548,
+	0xb52d, 0xb52d, 0xb52d, 0xb52d, 0xb52d, 0xb548, 0xb548, 0xb52d,
+	0xb52d, 0xb52d, 0xb52d, 0xb52d, 0xb52d, 0xb52d, 0xb52d, 0xb571,
+	0xb548, 0xb52d, 0xb544, 0xb52d, 0xb52d, 0xb52d, 0xb545, 0xb52d,
+	0xb52d, 0xb52d, 0xb548, 0xb56c, 0xb52d, 0x080c, 0x0d7d, 0x00c0,
+	0x2001, 0x000b, 0x00e8, 0x2001, 0x0003, 0x00d0, 0x2001, 0x0005,
+	0x00b8, 0x2001, 0x0001, 0x00a0, 0x2001, 0x0009, 0x0088, 0x6003,
+	0x0005, 0x080c, 0x9684, 0x0058, 0x0018, 0x0010, 0x080c, 0x6570,
+	0x04b8, 0x080c, 0xcf69, 0x6003, 0x0004, 0x080c, 0x9684, 0x0005,
+	0x080c, 0x6570, 0x6003, 0x0002, 0x0036, 0x2019, 0x1852, 0x2304,
+	0x9084, 0xff00, 0x1120, 0x2001, 0x1985, 0x201c, 0x0040, 0x8007,
+	0x909a, 0x0004, 0x0ec0, 0x8003, 0x801b, 0x831b, 0x9318, 0x631a,
+	0x003e, 0x080c, 0x9684, 0x0c18, 0x080c, 0xccc3, 0x080c, 0xabdf,
+	0x08f0, 0x00e6, 0x00f6, 0x2071, 0x189e, 0x2079, 0x0000, 0x080c,
+	0x3599, 0x00fe, 0x00ee, 0x080c, 0x95c6, 0x080c, 0xabdf, 0x0878,
+	0x6003, 0x0002, 0x080c, 0xcf69, 0x0804, 0x9684, 0x2600, 0x2008,
+	0x0002, 0xb59d, 0xb580, 0xb59b, 0xb580, 0xb580, 0xb59b, 0xb59b,
+	0xb59b, 0xb59b, 0xb580, 0xb59b, 0xb580, 0xb59b, 0xb580, 0xb59b,
+	0xb59b, 0xb59b, 0xb59b, 0x080c, 0x0d7d, 0x0096, 0x6014, 0x2048,
+	0x080c, 0x6d7b, 0x009e, 0x080c, 0xabdf, 0x0005, 0x00e6, 0x0096,
+	0x0026, 0x0016, 0x080c, 0xc832, 0x0568, 0x6014, 0x2048, 0xa864,
+	0x9086, 0x0139, 0x11a8, 0xa894, 0x9086, 0x0056, 0x1148, 0x080c,
+	0x5476, 0x0130, 0x2001, 0x0000, 0x900e, 0x2011, 0x4000, 0x0028,
+	0x2001, 0x0030, 0x900e, 0x2011, 0x4005, 0x080c, 0xce30, 0x0090,
+	0xa868, 0xd0fc, 0x0178, 0xa807, 0x0000, 0x0016, 0x6004, 0x908e,
+	0x0021, 0x0168, 0x908e, 0x003d, 0x0150, 0x001e, 0xa867, 0x0103,
+	0xa833, 0x0100, 0x001e, 0x002e, 0x009e, 0x00ee, 0x0005, 0x001e,
+	0x0009, 0x0cc0, 0x0096, 0x6014, 0x2048, 0xa800, 0x2048, 0xa867,
+	0x0103, 0xa823, 0x8001, 0x009e, 0x0005, 0x00b6, 0x6610, 0x2658,
+	0xb804, 0x9084, 0x00ff, 0x90b2, 0x000c, 0x1a0c, 0x0d7d, 0x6604,
+	0x96b6, 0x004d, 0x1120, 0x080c, 0xcd4f, 0x0804, 0xb672, 0x6604,
+	0x96b6, 0x0043, 0x1120, 0x080c, 0xcd98, 0x0804, 0xb672, 0x6604,
+	0x96b6, 0x004b, 0x1120, 0x080c, 0xcdc4, 0x0804, 0xb672, 0x6604,
+	0x96b6, 0x0033, 0x1120, 0x080c, 0xcce5, 0x0804, 0xb672, 0x6604,
+	0x96b6, 0x0028, 0x1120, 0x080c, 0xca85, 0x0804, 0xb672, 0x6604,
+	0x96b6, 0x0029, 0x1120, 0x080c, 0xcac6, 0x0804, 0xb672, 0x6604,
+	0x96b6, 0x001f, 0x1120, 0x080c, 0xafc2, 0x0804, 0xb672, 0x6604,
+	0x96b6, 0x0000, 0x1118, 0x080c, 0xb30a, 0x04e0, 0x6604, 0x96b6,
+	0x0022, 0x1118, 0x080c, 0xaffb, 0x04a8, 0x6604, 0x96b6, 0x0035,
+	0x1118, 0x080c, 0xb121, 0x0470, 0x6604, 0x96b6, 0x0039, 0x1118,
+	0x080c, 0xb29f, 0x0438, 0x6604, 0x96b6, 0x003d, 0x1118, 0x080c,
+	0xb033, 0x0400, 0x6604, 0x96b6, 0x0044, 0x1118, 0x080c, 0xb06f,
+	0x00c8, 0x6604, 0x96b6, 0x0049, 0x1118, 0x080c, 0xb0b0, 0x0090,
+	0x6604, 0x96b6, 0x0041, 0x1118, 0x080c, 0xb09a, 0x0058, 0x91b6,
+	0x0015, 0x1110, 0x0063, 0x0030, 0x91b6, 0x0016, 0x1128, 0x00be,
+	0x0804, 0xb8ce, 0x00be, 0x0005, 0x080c, 0xac99, 0x0cd8, 0xb68f,
+	0xb692, 0xb68f, 0xb6d9, 0xb68f, 0xb842, 0xb8db, 0xb68f, 0xb68f,
+	0xb8a4, 0xb68f, 0xb8ba, 0x0096, 0x601f, 0x0000, 0x6014, 0x2048,
+	0xa800, 0x2048, 0xa867, 0x0103, 0x009e, 0x0804, 0xabdf, 0xa001,
+	0xa001, 0x0005, 0x00e6, 0x2071, 0x1800, 0x7090, 0x9086, 0x0074,
+	0x1540, 0x080c, 0xdfcc, 0x11b0, 0x6010, 0x00b6, 0x2058, 0x7030,
+	0xd08c, 0x0128, 0xb800, 0xd0bc, 0x0110, 0xc0c5, 0xb802, 0x00f9,
+	0x00be, 0x2001, 0x0006, 0x080c, 0x6570, 0x080c, 0x321e, 0x080c,
+	0xabdf, 0x0098, 0x2001, 0x000a, 0x080c, 0x6570, 0x080c, 0x321e,
+	0x6003, 0x0001, 0x6007, 0x0001, 0x080c, 0x9207, 0x080c, 0x9684,
+	0x0020, 0x2001, 0x0001, 0x080c, 0xb812, 0x00ee, 0x0005, 0x00d6,
+	0xb800, 0xd084, 0x0160, 0x9006, 0x080c, 0x655c, 0x2069, 0x1847,
+	0x6804, 0xd0a4, 0x0120, 0x2001, 0x0006, 0x080c, 0x659c, 0x00de,
+	0x0005, 0x00b6, 0x0096, 0x00d6, 0x2011, 0x1824, 0x2204, 0x9086,
+	0x0074, 0x1904, 0xb7e7, 0x6010, 0x2058, 0xbaa0, 0x9286, 0x007e,
+	0x1120, 0x080c, 0xba28, 0x0804, 0xb74b, 0x080c, 0xba1d, 0x6010,
+	0x2058, 0xbaa0, 0x9286, 0x0080, 0x1510, 0x6014, 0x9005, 0x01a8,
+	0x2048, 0xa864, 0x9084, 0x00ff, 0x9086, 0x0039, 0x1140, 0x2001,
+	0x0000, 0x900e, 0x2011, 0x4000, 0x080c, 0xce30, 0x0030, 0xa807,
+	0x0000, 0xa867, 0x0103, 0xa833, 0x0200, 0x2001, 0x0006, 0x080c,
+	0x6570, 0x080c, 0x321e, 0x080c, 0xabdf, 0x0804, 0xb7ec, 0x080c,
+	0xb7fa, 0x6014, 0x9005, 0x0190, 0x2048, 0xa868, 0xd0f4, 0x01e8,
+	0xa864, 0x9084, 0x00ff, 0x9086, 0x0039, 0x1d08, 0x2001, 0x0000,
+	0x900e, 0x2011, 0x4000, 0x080c, 0xce30, 0x08f8, 0x080c, 0xb7f0,
+	0x0160, 0x9006, 0x080c, 0x655c, 0x2001, 0x0004, 0x080c, 0x659c,
+	0x2001, 0x0007, 0x080c, 0x6570, 0x08a0, 0x2001, 0x0004, 0x080c,
+	0x6570, 0x6003, 0x0001, 0x6007, 0x0003, 0x080c, 0x9207, 0x080c,
+	0x9684, 0x0804, 0xb7ec, 0xb85c, 0xd0e4, 0x01d8, 0x080c, 0xcc5d,
+	0x080c, 0x74c8, 0x0118, 0xd0dc, 0x1904, 0xb70d, 0x2011, 0x1837,
+	0x2204, 0xc0ad, 0x2012, 0x2001, 0x196c, 0x2004, 0x00f6, 0x2079,
+	0x0100, 0x78e3, 0x0000, 0x080c, 0x2688, 0x78e2, 0x00fe, 0x0804,
+	0xb70d, 0x080c, 0xcc9e, 0x2011, 0x1837, 0x2204, 0xc0a5, 0x2012,
+	0x0006, 0x080c, 0xe15c, 0x000e, 0x1904, 0xb70d, 0xc0b5, 0x2012,
+	0x2001, 0x0006, 0x080c, 0x6570, 0x9006, 0x080c, 0x655c, 0x00c6,
+	0x2001, 0x180f, 0x2004, 0xd09c, 0x0520, 0x00f6, 0x2079, 0x0100,
+	0x00e6, 0x2071, 0x1800, 0x700c, 0x9084, 0x00ff, 0x78e6, 0x707e,
+	0x7010, 0x78ea, 0x7082, 0x908c, 0x00ff, 0x00ee, 0x780c, 0xc0b5,
+	0x780e, 0x00fe, 0x080c, 0x265d, 0x00f6, 0x2100, 0x900e, 0x080c,
+	0x2614, 0x795e, 0x00fe, 0x9186, 0x0081, 0x01d8, 0x2009, 0x0081,
+	0x00c8, 0x2009, 0x00ef, 0x00f6, 0x2079, 0x0100, 0x79ea, 0x7932,
+	0x7936, 0x780c, 0xc0b5, 0x780e, 0x00fe, 0x080c, 0x265d, 0x00f6,
+	0x2079, 0x1800, 0x7982, 0x2100, 0x900e, 0x080c, 0x2614, 0x795e,
+	0x00fe, 0x8108, 0x080c, 0x65bf, 0x2b00, 0x00ce, 0x1904, 0xb70d,
+	0x6012, 0x2009, 0x180f, 0x210c, 0xd19c, 0x0150, 0x2009, 0x027c,
+	0x210c, 0x918c, 0x00ff, 0xb912, 0x2009, 0x027d, 0x210c, 0xb916,
+	0x2001, 0x0002, 0x080c, 0x6570, 0x6023, 0x0001, 0x6003, 0x0001,
+	0x6007, 0x0002, 0x080c, 0x9207, 0x080c, 0x9684, 0x0028, 0x080c,
+	0xb5a6, 0x2001, 0x0001, 0x0431, 0x00de, 0x009e, 0x00be, 0x0005,
+	0x2001, 0x1810, 0x2004, 0xd0a4, 0x0120, 0x2001, 0x1848, 0x2004,
+	0xd0ac, 0x0005, 0x00e6, 0x080c, 0xe699, 0x0190, 0x2071, 0x0260,
+	0x7108, 0x720c, 0x918c, 0x00ff, 0x1118, 0x9284, 0xff00, 0x0140,
+	0x6010, 0x2058, 0xb8a0, 0x9084, 0xff80, 0x1110, 0xb912, 0xba16,
+	0x00ee, 0x0005, 0x2030, 0x9005, 0x0158, 0x2001, 0x0007, 0x080c,
+	0x6570, 0x080c, 0x56e9, 0x1120, 0x2001, 0x0007, 0x080c, 0x659c,
+	0x2600, 0x9005, 0x11b0, 0x6014, 0x0096, 0x2048, 0xa868, 0x009e,
+	0xd0fc, 0x1178, 0x0036, 0x0046, 0x6010, 0x00b6, 0x2058, 0xbba0,
+	0x00be, 0x2021, 0x0004, 0x2011, 0x8014, 0x080c, 0x4b09, 0x004e,
+	0x003e, 0x080c, 0x321e, 0x6020, 0x9086, 0x000a, 0x1108, 0x0005,
+	0x0804, 0xabdf, 0x00b6, 0x00e6, 0x0026, 0x0016, 0x2071, 0x1800,
+	0x7090, 0x9086, 0x0014, 0x1904, 0xb89a, 0x080c, 0x56e9, 0x1170,
+	0x6014, 0x9005, 0x1158, 0x0036, 0x0046, 0x6010, 0x2058, 0xbba0,
+	0x2021, 0x0006, 0x080c, 0x4cc0, 0x004e, 0x003e, 0x00d6, 0x6010,
+	0x2058, 0x080c, 0x66bb, 0x080c, 0xb6c7, 0x00de, 0x080c, 0xbaee,
+	0x1588, 0x6010, 0x2058, 0xb890, 0x9005, 0x0560, 0x2001, 0x0006,
+	0x080c, 0x6570, 0x0096, 0x6014, 0x904d, 0x01d0, 0xa864, 0x9084,
+	0x00ff, 0x9086, 0x0039, 0x1140, 0x2001, 0x0000, 0x900e, 0x2011,
+	0x4000, 0x080c, 0xce30, 0x0060, 0xa864, 0x9084, 0x00ff, 0x9086,
+	0x0029, 0x0130, 0xa807, 0x0000, 0xa867, 0x0103, 0xa833, 0x0200,
+	0x009e, 0x080c, 0x321e, 0x6020, 0x9086, 0x000a, 0x0140, 0x080c,
+	0xabdf, 0x0028, 0x080c, 0xb5a6, 0x9006, 0x080c, 0xb812, 0x001e,
+	0x002e, 0x00ee, 0x00be, 0x0005, 0x2011, 0x1824, 0x2204, 0x9086,
+	0x0014, 0x1160, 0x2001, 0x0002, 0x080c, 0x6570, 0x6003, 0x0001,
+	0x6007, 0x0001, 0x080c, 0x9207, 0x0804, 0x9684, 0x2001, 0x0001,
+	0x0804, 0xb812, 0x2030, 0x2011, 0x1824, 0x2204, 0x9086, 0x0004,
+	0x1148, 0x96b6, 0x000b, 0x1120, 0x2001, 0x0007, 0x080c, 0x6570,
+	0x0804, 0xabdf, 0x2001, 0x0001, 0x0804, 0xb812, 0x0002, 0xb68f,
+	0xb8e6, 0xb68f, 0xb927, 0xb68f, 0xb9d4, 0xb8db, 0xb68f, 0xb68f,
+	0xb9e8, 0xb68f, 0xb9fa, 0x6604, 0x9686, 0x0003, 0x0904, 0xb842,
+	0x96b6, 0x001e, 0x1110, 0x080c, 0xabdf, 0x0005, 0x00b6, 0x00d6,
+	0x00c6, 0x080c, 0xba0c, 0x11a0, 0x9006, 0x080c, 0x655c, 0x080c,
+	0x31ef, 0x080c, 0xcf66, 0x2001, 0x0002, 0x080c, 0x6570, 0x6003,
+	0x0001, 0x6007, 0x0002, 0x080c, 0x9207, 0x080c, 0x9684, 0x0418,
+	0x2009, 0x026e, 0x2104, 0x9086, 0x0009, 0x1160, 0x6010, 0x2058,
+	0xb840, 0x9084, 0x00ff, 0x9005, 0x0170, 0x8001, 0xb842, 0x601b,
+	0x000a, 0x0088, 0x2009, 0x026f, 0x2104, 0x9084, 0xff00, 0x9086,
+	0x1900, 0x1108, 0x08a0, 0x080c, 0x31ef, 0x080c, 0xcf66, 0x2001,
+	0x0001, 0x080c, 0xb812, 0x00ce, 0x00de, 0x00be, 0x0005, 0x0096,
+	0x00b6, 0x0026, 0x9016, 0x080c, 0xba1a, 0x00d6, 0x2069, 0x197b,
+	0x2d04, 0x9005, 0x0168, 0x6010, 0x2058, 0xb8a0, 0x9086, 0x007e,
+	0x1138, 0x2069, 0x1820, 0x2d04, 0x8000, 0x206a, 0x00de, 0x0010,
+	0x00de, 0x0088, 0x9006, 0x080c, 0x655c, 0x2001, 0x0002, 0x080c,
+	0x6570, 0x6003, 0x0001, 0x6007, 0x0002, 0x080c, 0x9207, 0x080c,
+	0x9684, 0x0804, 0xb9a4, 0x080c, 0xc832, 0x01b0, 0x6014, 0x2048,
+	0xa864, 0x2010, 0x9086, 0x0139, 0x1138, 0x6007, 0x0016, 0x2001,
+	0x0002, 0x080c, 0xce8a, 0x00b0, 0x6014, 0x2048, 0xa864, 0xd0fc,
+	0x0118, 0x2001, 0x0001, 0x0ca8, 0x2001, 0x180e, 0x2004, 0xd0dc,
+	0x0148, 0x6010, 0x2058, 0xb840, 0x9084, 0x00ff, 0x9005, 0x1110,
+	0x9006, 0x0c38, 0x080c, 0xb5a6, 0x2009, 0x026e, 0x2134, 0x96b4,
+	0x00ff, 0x9686, 0x0005, 0x0520, 0x9686, 0x000b, 0x01c8, 0x2009,
+	0x026f, 0x2104, 0x9084, 0xff00, 0x1118, 0x9686, 0x0009, 0x01c0,
+	0x9086, 0x1900, 0x1168, 0x9686, 0x0009, 0x0190, 0x2001, 0x0004,
+	0x080c, 0x6570, 0x2001, 0x0028, 0x601a, 0x6007, 0x0052, 0x0020,
+	0x2001, 0x0001, 0x080c, 0xb812, 0x002e, 0x00be, 0x009e, 0x0005,
+	0x9286, 0x0139, 0x0160, 0x6014, 0x2048, 0x080c, 0xc832, 0x0140,
+	0xa864, 0x9086, 0x0139, 0x0118, 0xa868, 0xd0fc, 0x0108, 0x0c40,
+	0x6010, 0x2058, 0xb840, 0x9084, 0x00ff, 0x9005, 0x0138, 0x8001,
+	0xb842, 0x601b, 0x000a, 0x6007, 0x0016, 0x08f0, 0xb8a0, 0x9086,
+	0x007e, 0x1138, 0x00e6, 0x2071, 0x1800, 0x080c, 0x5fb7, 0x00ee,
+	0x0010, 0x080c, 0x31ef, 0x0860, 0x080c, 0xba1a, 0x1160, 0x2001,
+	0x0004, 0x080c, 0x6570, 0x6003, 0x0001, 0x6007, 0x0003, 0x080c,
+	0x9207, 0x0804, 0x9684, 0x080c, 0xb5a6, 0x9006, 0x0804, 0xb812,
+	0x0489, 0x1160, 0x2001, 0x0008, 0x080c, 0x6570, 0x6003, 0x0001,
+	0x6007, 0x0005, 0x080c, 0x9207, 0x0804, 0x9684, 0x2001, 0x0001,
+	0x0804, 0xb812, 0x00f9, 0x1160, 0x2001, 0x000a, 0x080c, 0x6570,
+	0x6003, 0x0001, 0x6007, 0x0001, 0x080c, 0x9207, 0x0804, 0x9684,
+	0x2001, 0x0001, 0x0804, 0xb812, 0x2009, 0x026e, 0x2104, 0x9086,
+	0x0003, 0x1138, 0x2009, 0x026f, 0x2104, 0x9084, 0xff00, 0x9086,
+	0x2a00, 0x0005, 0x9085, 0x0001, 0x0005, 0x00b6, 0x00c6, 0x0016,
+	0x6110, 0x2158, 0x080c, 0x662f, 0x001e, 0x00ce, 0x00be, 0x0005,
+	0x00b6, 0x00f6, 0x00e6, 0x00d6, 0x0036, 0x0016, 0x6010, 0x2058,
+	0x2009, 0x1837, 0x2104, 0x9085, 0x0003, 0x200a, 0x080c, 0xbac0,
+	0x0560, 0x2009, 0x1837, 0x2104, 0xc0cd, 0x200a, 0x080c, 0x6a66,
+	0x0158, 0x9006, 0x2020, 0x2009, 0x002a, 0x080c, 0xe2d9, 0x2001,
+	0x180c, 0x200c, 0xc195, 0x2102, 0x2019, 0x002a, 0x2009, 0x0001,
+	0x080c, 0x31b4, 0x00e6, 0x2071, 0x1800, 0x080c, 0x2fc0, 0x00ee,
+	0x00c6, 0x0156, 0x20a9, 0x0781, 0x2009, 0x007f, 0x080c, 0x32f8,
+	0x8108, 0x1f04, 0xba5e, 0x015e, 0x00ce, 0x080c, 0xba1d, 0x2071,
+	0x0260, 0x2079, 0x0200, 0x7817, 0x0001, 0x2001, 0x1837, 0x200c,
+	0xc1c5, 0x7018, 0xd0fc, 0x0110, 0xd0dc, 0x0118, 0x7038, 0xd0dc,
+	0x1108, 0xc1c4, 0x7817, 0x0000, 0x2001, 0x1837, 0x2102, 0x2079,
+	0x0100, 0x2e04, 0x9084, 0x00ff, 0x2069, 0x181f, 0x206a, 0x78e6,
+	0x0006, 0x8e70, 0x2e04, 0x2069, 0x1820, 0x206a, 0x78ea, 0x7832,
+	0x7836, 0x2010, 0x9084, 0xff00, 0x001e, 0x9105, 0x2009, 0x182c,
+	0x200a, 0x2200, 0x9084, 0x00ff, 0x2008, 0x080c, 0x265d, 0x080c,
+	0x74c8, 0x0170, 0x2071, 0x0260, 0x2069, 0x1981, 0x7048, 0x206a,
+	0x704c, 0x6806, 0x7050, 0x680a, 0x7054, 0x680e, 0x080c, 0xcc5d,
+	0x0040, 0x2001, 0x0006, 0x080c, 0x6570, 0x080c, 0x321e, 0x080c,
+	0xabdf, 0x001e, 0x003e, 0x00de, 0x00ee, 0x00fe, 0x00be, 0x0005,
+	0x0096, 0x0026, 0x0036, 0x00e6, 0x0156, 0x2019, 0x182c, 0x231c,
+	0x83ff, 0x01f0, 0x2071, 0x0260, 0x7200, 0x9294, 0x00ff, 0x7004,
+	0x9084, 0xff00, 0x9205, 0x9306, 0x1198, 0x2011, 0x0276, 0x20a9,
+	0x0004, 0x2b48, 0x2019, 0x000a, 0x080c, 0xbbb5, 0x1148, 0x2011,
+	0x027a, 0x20a9, 0x0004, 0x2019, 0x0006, 0x080c, 0xbbb5, 0x1100,
+	0x015e, 0x00ee, 0x003e, 0x002e, 0x009e, 0x0005, 0x00e6, 0x2071,
+	0x0260, 0x7034, 0x9086, 0x0014, 0x11a8, 0x7038, 0x9086, 0x0800,
+	0x1188, 0x703c, 0xd0ec, 0x0160, 0x9084, 0x0f00, 0x9086, 0x0100,
+	0x1138, 0x7054, 0xd0a4, 0x1110, 0xd0ac, 0x0110, 0x9006, 0x0010,
+	0x9085, 0x0001, 0x00ee, 0x0005, 0x00e6, 0x0096, 0x00c6, 0x0076,
+	0x0056, 0x0046, 0x0026, 0x0006, 0x0126, 0x2091, 0x8000, 0x2029,
+	0x19f2, 0x252c, 0x2021, 0x19f9, 0x2424, 0x2061, 0x1ddc, 0x2071,
+	0x1800, 0x7254, 0x7074, 0x9202, 0x1a04, 0xbb81, 0x080c, 0x8b72,
+	0x0904, 0xbb7a, 0x080c, 0xe30a, 0x0904, 0xbb7a, 0x6720, 0x9786,
+	0x0007, 0x0904, 0xbb7a, 0x2500, 0x9c06, 0x0904, 0xbb7a, 0x2400,
+	0x9c06, 0x0904, 0xbb7a, 0x3e08, 0x9186, 0x0002, 0x1148, 0x6010,
+	0x9005, 0x0130, 0x00b6, 0x2058, 0xb800, 0x00be, 0xd0bc, 0x1590,
+	0x00c6, 0x6043, 0xffff, 0x6000, 0x9086, 0x0004, 0x1110, 0x080c,
+	0x1a77, 0x9786, 0x000a, 0x0148, 0x080c, 0xca47, 0x1130, 0x00ce,
+	0x080c, 0xb5a6, 0x080c, 0xac1a, 0x00e8, 0x6014, 0x2048, 0x080c,
+	0xc832, 0x01a8, 0x9786, 0x0003, 0x1530, 0xa867, 0x0103, 0xa87c,
+	0xd0cc, 0x0130, 0x0096, 0xa878, 0x2048, 0x080c, 0x0fec, 0x009e,
+	0xab7a, 0xa877, 0x0000, 0x080c, 0x6d6f, 0x080c, 0xca21, 0x080c,
+	0xac1a, 0x00ce, 0x9ce0, 0x001c, 0x7068, 0x9c02, 0x1210, 0x0804,
+	0xbb21, 0x012e, 0x000e, 0x002e, 0x004e, 0x005e, 0x007e, 0x00ce,
+	0x009e, 0x00ee, 0x0005, 0x9786, 0x0006, 0x1118, 0x080c, 0xe27c,
+	0x0c30, 0x9786, 0x0009, 0x1148, 0x6000, 0x9086, 0x0004, 0x0d08,
+	0x2009, 0x004c, 0x080c, 0xac7c, 0x08e0, 0x9786, 0x000a, 0x0938,
+	0x0820, 0x220c, 0x2304, 0x9106, 0x1130, 0x8210, 0x8318, 0x1f04,
+	0xbba1, 0x9006, 0x0005, 0x2304, 0x9102, 0x0218, 0x2001, 0x0001,
+	0x0008, 0x9006, 0x918d, 0x0001, 0x0005, 0x0136, 0x01c6, 0x0016,
+	0x8906, 0x8006, 0x8007, 0x908c, 0x003f, 0x21e0, 0x9084, 0xffc0,
+	0x9300, 0x2098, 0x3518, 0x20a9, 0x0001, 0x220c, 0x4002, 0x910e,
+	0x1140, 0x8210, 0x8319, 0x1dc8, 0x9006, 0x001e, 0x01ce, 0x013e,
+	0x0005, 0x220c, 0x9102, 0x0218, 0x2001, 0x0001, 0x0010, 0x2001,
+	0x0000, 0x918d, 0x0001, 0x001e, 0x01ce, 0x013e, 0x0005, 0x220c,
+	0x810f, 0x2304, 0x9106, 0x1130, 0x8210, 0x8318, 0x1f04, 0xbbdf,
+	0x9006, 0x0005, 0x918d, 0x0001, 0x0005, 0x6004, 0x908a, 0x0053,
+	0x1a0c, 0x0d7d, 0x080c, 0xca36, 0x0120, 0x080c, 0xca47, 0x0158,
+	0x0028, 0x080c, 0x321e, 0x080c, 0xca47, 0x0128, 0x080c, 0x95c6,
+	0x080c, 0xabdf, 0x0005, 0x080c, 0xb5a6, 0x0cc0, 0x9182, 0x0057,
+	0x1220, 0x9182, 0x0040, 0x0208, 0x000a, 0x0005, 0xbc25, 0xbc25,
+	0xbc25, 0xbc25, 0xbc25, 0xbc25, 0xbc25, 0xbc25, 0xbc25, 0xbc25,
+	0xbc25, 0xbc27, 0xbc27, 0xbc27, 0xbc27, 0xbc25, 0xbc25, 0xbc25,
+	0xbc27, 0xbc25, 0xbc25, 0xbc25, 0xbc25, 0x080c, 0x0d7d, 0x600b,
+	0xffff, 0x6003, 0x000f, 0x6106, 0x0126, 0x2091, 0x8000, 0x080c,
+	0xcf69, 0x2009, 0x8000, 0x080c, 0x9200, 0x012e, 0x0005, 0x9186,
+	0x0013, 0x1128, 0x6004, 0x9082, 0x0040, 0x0804, 0xbcac, 0x9186,
+	0x0027, 0x1520, 0x080c, 0x95c6, 0x080c, 0x31ef, 0x080c, 0xcf66,
+	0x0096, 0x6114, 0x2148, 0x080c, 0xc832, 0x0198, 0x080c, 0xca47,
+	0x1118, 0x080c, 0xb5a6, 0x0068, 0xa867, 0x0103, 0xa87b, 0x0029,
+	0xa877, 0x0000, 0xa97c, 0xc1c5, 0xa97e, 0x080c, 0x6d7b, 0x080c,
+	0xca21, 0x009e, 0x080c, 0xabdf, 0x0804, 0x9684, 0x9186, 0x0014,
+	0x1120, 0x6004, 0x9082, 0x0040, 0x0018, 0x080c, 0x0d7d, 0x0005,
+	0x0002, 0xbc8a, 0xbc88, 0xbc88, 0xbc88, 0xbc88, 0xbc88, 0xbc88,
+	0xbc88, 0xbc88, 0xbc88, 0xbc88, 0xbca3, 0xbca3, 0xbca3, 0xbca3,
+	0xbc88, 0xbca3, 0xbc88, 0xbca3, 0xbc88, 0xbc88, 0xbc88, 0xbc88,
+	0x080c, 0x0d7d, 0x080c, 0x95c6, 0x0096, 0x6114, 0x2148, 0x080c,
+	0xc832, 0x0168, 0xa867, 0x0103, 0xa87b, 0x0006, 0xa877, 0x0000,
+	0xa880, 0xc0ec, 0xa882, 0x080c, 0x6d7b, 0x080c, 0xca21, 0x009e,
+	0x080c, 0xabdf, 0x0005, 0x080c, 0x95c6, 0x080c, 0xca47, 0x090c,
+	0xb5a6, 0x080c, 0xabdf, 0x0005, 0x0002, 0xbcc6, 0xbcc4, 0xbcc4,
+	0xbcc4, 0xbcc4, 0xbcc4, 0xbcc4, 0xbcc4, 0xbcc4, 0xbcc4, 0xbcc4,
+	0xbcc8, 0xbcc8, 0xbcc8, 0xbcc8, 0xbcc4, 0xbcca, 0xbcc4, 0xbcc8,
+	0xbcc4, 0xbcc4, 0xbcc4, 0xbcc4, 0x080c, 0x0d7d, 0x080c, 0x0d7d,
+	0x080c, 0x0d7d, 0x080c, 0xabdf, 0x0804, 0x9684, 0x9182, 0x0057,
+	0x1220, 0x9182, 0x0040, 0x0208, 0x000a, 0x0005, 0xbced, 0xbced,
+	0xbced, 0xbced, 0xbced, 0xbd26, 0xbe15, 0xbced, 0xbe21, 0xbced,
+	0xbced, 0xbced, 0xbced, 0xbced, 0xbced, 0xbced, 0xbced, 0xbced,
+	0xbced, 0xbe21, 0xbcef, 0xbced, 0xbe1f, 0x080c, 0x0d7d, 0x00b6,
+	0x0096, 0x6114, 0x2148, 0x6010, 0x2058, 0xb800, 0xd0bc, 0x1508,
+	0xa87b, 0x0000, 0xa867, 0x0103, 0xa877, 0x0000, 0xa87c, 0xd0ac,
+	0x0128, 0xa834, 0xa938, 0x9115, 0x190c, 0xbea6, 0x080c, 0x6b91,
+	0x6210, 0x2258, 0xba3c, 0x82ff, 0x0110, 0x8211, 0xba3e, 0xb8d0,
+	0x9005, 0x0110, 0x080c, 0x674b, 0x080c, 0xabdf, 0x009e, 0x00be,
+	0x0005, 0xa87c, 0xd0ac, 0x09e0, 0xa838, 0xa934, 0x9105, 0x09c0,
+	0xa880, 0xd0bc, 0x19a8, 0x080c, 0xcb7c, 0x0c80, 0x00b6, 0x0096,
+	0x6114, 0x2148, 0x601c, 0xd0fc, 0x1110, 0x7644, 0x0008, 0x9036,
+	0x96b4, 0x0fff, 0x86ff, 0x1590, 0x6010, 0x2058, 0xb800, 0xd0bc,
+	0x1904, 0xbe04, 0xa87b, 0x0000, 0xa867, 0x0103, 0xae76, 0xa87c,
+	0xd0ac, 0x0128, 0xa834, 0xa938, 0x9115, 0x190c, 0xbea6, 0x080c,
+	0x6b91, 0x6210, 0x2258, 0xba3c, 0x82ff, 0x0110, 0x8211, 0xba3e,
+	0xb8d0, 0x9005, 0x0110, 0x080c, 0x674b, 0x601c, 0xd0fc, 0x1148,
+	0x7044, 0xd0e4, 0x1904, 0xbde8, 0x080c, 0xabdf, 0x009e, 0x00be,
+	0x0005, 0x2009, 0x0211, 0x210c, 0x080c, 0x0d7d, 0x968c, 0x0c00,
+	0x0150, 0x6010, 0x2058, 0xb800, 0xd0bc, 0x1904, 0xbdec, 0x7348,
+	0xab92, 0x734c, 0xab8e, 0x968c, 0x00ff, 0x9186, 0x0002, 0x0508,
+	0x9186, 0x0028, 0x1118, 0xa87b, 0x001c, 0x00e8, 0xd6dc, 0x01a0,
+	0xa87b, 0x0015, 0xa87c, 0xd0ac, 0x0170, 0xa938, 0xaa34, 0x2100,
+	0x9205, 0x0148, 0x7048, 0x9106, 0x1118, 0x704c, 0x9206, 0x0118,
+	0xa992, 0xaa8e, 0xc6dc, 0x0038, 0xd6d4, 0x0118, 0xa87b, 0x0007,
+	0x0010, 0xa87b, 0x0000, 0xa867, 0x0103, 0xae76, 0x901e, 0xd6c4,
+	0x01d8, 0x9686, 0x0100, 0x1130, 0x7064, 0x9005, 0x1118, 0xc6c4,
+	0x0804, 0xbd32, 0x735c, 0xab86, 0x83ff, 0x0170, 0x938a, 0x0009,
+	0x0210, 0x2019, 0x0008, 0x0036, 0x2308, 0x2019, 0x0018, 0x2011,
+	0x0025, 0x080c, 0xc3f8, 0x003e, 0xd6cc, 0x0904, 0xbd47, 0x7154,
+	0xa98a, 0x81ff, 0x0904, 0xbd47, 0x9192, 0x0021, 0x1278, 0x8304,
+	0x9098, 0x0018, 0x2011, 0x0029, 0x080c, 0xc3f8, 0x2011, 0x0205,
+	0x2013, 0x0000, 0x080c, 0xcef6, 0x0804, 0xbd47, 0xa868, 0xd0fc,
+	0x0120, 0x2009, 0x0020, 0xa98a, 0x0c50, 0x00a6, 0x2950, 0x080c,
+	0xc397, 0x00ae, 0x080c, 0xcef6, 0x080c, 0xc3e8, 0x0804, 0xbd49,
+	0x080c, 0xcb3f, 0x0804, 0xbd5e, 0xa87c, 0xd0ac, 0x0904, 0xbd6f,
+	0xa880, 0xd0bc, 0x1904, 0xbd6f, 0x7348, 0xa838, 0x9306, 0x11c8,
+	0x734c, 0xa834, 0x931e, 0x0904, 0xbd6f, 0xd6d4, 0x0190, 0xab38,
+	0x9305, 0x0904, 0xbd6f, 0x0068, 0xa87c, 0xd0ac, 0x0904, 0xbd3a,
+	0xa838, 0xa934, 0x9105, 0x0904, 0xbd3a, 0xa880, 0xd0bc, 0x1904,
+	0xbd3a, 0x080c, 0xcb7c, 0x0804, 0xbd5e, 0x00f6, 0x2079, 0x026c,
+	0x7c04, 0x7b00, 0x7e0c, 0x7d08, 0x00fe, 0x0021, 0x0005, 0x0011,
+	0x0005, 0x0005, 0x0096, 0x6003, 0x0002, 0x6007, 0x0043, 0x6014,
+	0x2048, 0xa87c, 0xd0ac, 0x0128, 0x009e, 0x0005, 0x2130, 0x2228,
+	0x0058, 0x2400, 0xa9ac, 0x910a, 0x2300, 0xaab0, 0x9213, 0x2600,
+	0x9102, 0x2500, 0x9203, 0x0e90, 0xac46, 0xab4a, 0xae36, 0xad3a,
+	0x6044, 0xd0fc, 0x190c, 0xa8b1, 0x604b, 0x0000, 0x080c, 0x1c3d,
+	0x1118, 0x6144, 0x080c, 0x922c, 0x009e, 0x0005, 0x9182, 0x0057,
+	0x1220, 0x9182, 0x0040, 0x0208, 0x000a, 0x0005, 0xbe6d, 0xbe6d,
+	0xbe6d, 0xbe6d, 0xbe6d, 0xbe6d, 0xbe6d, 0xbe6d, 0xbe6d, 0xbe6d,
+	0xbe6f, 0xbe6d, 0xbe6d, 0xbe6d, 0xbe6d, 0xbe80, 0xbe6d, 0xbe6d,
+	0xbe6d, 0xbe6d, 0xbea4, 0xbe6d, 0xbe6d, 0x080c, 0x0d7d, 0x6004,
+	0x9086, 0x0040, 0x1110, 0x080c, 0x95c6, 0x2019, 0x0001, 0x080c,
+	0xa0fa, 0x6003, 0x0002, 0x080c, 0xcf6e, 0x080c, 0x9621, 0x0005,
+	0x6004, 0x9086, 0x0040, 0x1110, 0x080c, 0x95c6, 0x2019, 0x0001,
+	0x080c, 0xa0fa, 0x080c, 0x9621, 0x080c, 0x31ef, 0x080c, 0xcf66,
+	0x0096, 0x6114, 0x2148, 0x080c, 0xc832, 0x0150, 0xa867, 0x0103,
+	0xa87b, 0x0029, 0xa877, 0x0000, 0x080c, 0x6d7b, 0x080c, 0xca21,
+	0x009e, 0x080c, 0xabdf, 0x0005, 0x080c, 0x0d7d, 0xa87b, 0x0015,
+	0xd1fc, 0x0180, 0xa87b, 0x0007, 0x8002, 0x8000, 0x810a, 0x9189,
+	0x0000, 0x0006, 0x0016, 0x2009, 0x1a77, 0x2104, 0x8000, 0x200a,
+	0x001e, 0x000e, 0xa992, 0xa88e, 0x0005, 0x9182, 0x0057, 0x1220,
+	0x9182, 0x0040, 0x0208, 0x000a, 0x0005, 0xbedc, 0xbedc, 0xbedc,
+	0xbedc, 0xbedc, 0xbede, 0xbedc, 0xbedc, 0xbf9b, 0xbedc, 0xbedc,
+	0xbedc, 0xbedc, 0xbedc, 0xbedc, 0xbedc, 0xbedc, 0xbedc, 0xbedc,
+	0xc0d9, 0xbedc, 0xc0e3, 0xbedc, 0x080c, 0x0d7d, 0x601c, 0xd0bc,
+	0x0178, 0xd084, 0x0168, 0xd0f4, 0x0120, 0xc084, 0x601e, 0x0804,
+	0xbcce, 0x6114, 0x0096, 0x2148, 0xa87c, 0xc0e5, 0xa87e, 0x009e,
+	0x0076, 0x00a6, 0x00e6, 0x0096, 0x2071, 0x0260, 0x6114, 0x2150,
+	0x601c, 0xd0fc, 0x1110, 0x7644, 0x0008, 0x9036, 0xb676, 0x96b4,
+	0x0fff, 0xb77c, 0xc7e5, 0xb77e, 0x6210, 0x00b6, 0x2258, 0xba3c,
+	0x82ff, 0x0110, 0x8211, 0xba3e, 0x00be, 0x86ff, 0x0904, 0xbf94,
+	0x9694, 0xff00, 0x9284, 0x0c00, 0x0120, 0x7048, 0xb092, 0x704c,
+	0xb08e, 0x9284, 0x0300, 0x0904, 0xbf94, 0x9686, 0x0100, 0x1130,
+	0x7064, 0x9005, 0x1118, 0xc6c4, 0xb676, 0x0c38, 0x080c, 0x103a,
+	0x090c, 0x0d7d, 0x2900, 0xb07a, 0xb77c, 0x97bd, 0x0200, 0xb77e,
+	0xa867, 0x0103, 0xb068, 0xa86a, 0xb06c, 0xa86e, 0xb070, 0xa872,
+	0x7044, 0x9084, 0xf000, 0x9635, 0xae76, 0x968c, 0x0c00, 0x0120,
+	0x7348, 0xab92, 0x734c, 0xab8e, 0x968c, 0x00ff, 0x9186, 0x0002,
+	0x0180, 0x9186, 0x0028, 0x1118, 0xa87b, 0x001c, 0x0060, 0xd6dc,
+	0x0118, 0xa87b, 0x0015, 0x0038, 0xd6d4, 0x0118, 0xa87b, 0x0007,
+	0x0010, 0xa87b, 0x0000, 0xaf7e, 0xb080, 0xa882, 0xb084, 0xa886,
+	0x901e, 0xd6c4, 0x0190, 0x735c, 0xab86, 0x83ff, 0x0170, 0x938a,
+	0x0009, 0x0210, 0x2019, 0x0008, 0x0036, 0x2308, 0x2019, 0x0018,
+	0x2011, 0x0025, 0x080c, 0xc3f8, 0x003e, 0xd6cc, 0x01e8, 0x7154,
+	0xa98a, 0x81ff, 0x01c8, 0x9192, 0x0021, 0x1260, 0x8304, 0x9098,
+	0x0018, 0x2011, 0x0029, 0x080c, 0xc3f8, 0x2011, 0x0205, 0x2013,
+	0x0000, 0x0050, 0xb068, 0xd0fc, 0x0120, 0x2009, 0x0020, 0xa98a,
+	0x0c68, 0x2950, 0x080c, 0xc397, 0x080c, 0x1a55, 0x009e, 0x00ee,
+	0x00ae, 0x007e, 0x0005, 0x2001, 0x1987, 0x2004, 0x604a, 0x0096,
+	0x6114, 0x2148, 0xa83c, 0xa940, 0x9105, 0x1118, 0xa87c, 0xc0dc,
+	0xa87e, 0x6003, 0x0002, 0x080c, 0xcf77, 0x0904, 0xc0d4, 0x604b,
+	0x0000, 0x6010, 0x00b6, 0x2058, 0xb800, 0x00be, 0xd0bc, 0x1500,
+	0xd1cc, 0x0904, 0xc099, 0xa978, 0xa868, 0xd0fc, 0x0904, 0xc05a,
+	0x0016, 0xa87c, 0x0006, 0xa880, 0x0006, 0x00a6, 0x2150, 0xb174,
+	0x9184, 0x00ff, 0x90b6, 0x0002, 0x0904, 0xc028, 0x9086, 0x0028,
+	0x1904, 0xc014, 0xa87b, 0x001c, 0xb07b, 0x001c, 0x0804, 0xc030,
+	0x6024, 0xd0f4, 0x11d0, 0xa838, 0xaa34, 0x9205, 0x09c8, 0xa838,
+	0xaa90, 0x9206, 0x1120, 0xa88c, 0xaa34, 0x9206, 0x0988, 0x6024,
+	0xd0d4, 0x1148, 0xa9ac, 0xa834, 0x9102, 0x603a, 0xa9b0, 0xa838,
+	0x9103, 0x603e, 0x6024, 0xc0f5, 0x6026, 0x6010, 0x00b6, 0x2058,
+	0xb83c, 0x8000, 0xb83e, 0x00be, 0x601c, 0xc0fc, 0x601e, 0x9006,
+	0xa876, 0xa892, 0xa88e, 0xa87c, 0xc0e4, 0xa87e, 0xd0cc, 0x0140,
+	0xc0cc, 0xa87e, 0x0096, 0xa878, 0x2048, 0x080c, 0x0fec, 0x009e,
+	0x080c, 0xcb7c, 0x0804, 0xc0d4, 0xd1dc, 0x0158, 0xa87b, 0x0015,
+	0xb07b, 0x0015, 0x080c, 0xce19, 0x0118, 0xb174, 0xc1dc, 0xb176,
+	0x0078, 0xd1d4, 0x0128, 0xa87b, 0x0007, 0xb07b, 0x0007, 0x0040,
+	0xa87c, 0xd0ac, 0x0128, 0xa834, 0xa938, 0x9115, 0x190c, 0xbea6,
+	0xa87c, 0xb07e, 0xa890, 0xb092, 0xa88c, 0xb08e, 0xa860, 0x20e8,
+	0xa85c, 0x9080, 0x0019, 0x20a0, 0x20a9, 0x0020, 0x8a06, 0x8006,
+	0x8007, 0x9094, 0x003f, 0x22e0, 0x9084, 0xffc0, 0x9080, 0x0019,
+	0x2098, 0x4003, 0x00ae, 0x000e, 0xa882, 0x000e, 0xa87e, 0x080c,
+	0xcef6, 0x001e, 0xa874, 0x0006, 0x2148, 0x080c, 0x0fec, 0x001e,
+	0x0804, 0xc0c6, 0x0016, 0x00a6, 0x2150, 0xb174, 0x9184, 0x00ff,
+	0x90b6, 0x0002, 0x01e0, 0x9086, 0x0028, 0x1128, 0xa87b, 0x001c,
+	0xb07b, 0x001c, 0x00e0, 0xd1dc, 0x0158, 0xa87b, 0x0015, 0xb07b,
+	0x0015, 0x080c, 0xce19, 0x0118, 0xb174, 0xc1dc, 0xb176, 0x0078,
+	0xd1d4, 0x0128, 0xa87b, 0x0007, 0xb07b, 0x0007, 0x0040, 0xa87c,
+	0xd0ac, 0x0128, 0xa834, 0xa938, 0x9115, 0x190c, 0xbea6, 0xa890,
+	0xb092, 0xa88c, 0xb08e, 0xa87c, 0xb07e, 0x00ae, 0x080c, 0x0fec,
+	0x009e, 0x080c, 0xcef6, 0xa974, 0x0016, 0x080c, 0xc3e8, 0x001e,
+	0x0468, 0xa867, 0x0103, 0xa974, 0x9184, 0x00ff, 0x90b6, 0x0002,
+	0x01b0, 0x9086, 0x0028, 0x1118, 0xa87b, 0x001c, 0x00d0, 0xd1dc,
+	0x0148, 0xa87b, 0x0015, 0x080c, 0xce19, 0x0118, 0xa974, 0xc1dc,
+	0xa976, 0x0078, 0xd1d4, 0x0118, 0xa87b, 0x0007, 0x0050, 0xa87b,
+	0x0000, 0xa87c, 0xd0ac, 0x0128, 0xa834, 0xa938, 0x9115, 0x190c,
+	0xbea6, 0xa974, 0x0016, 0x080c, 0x6b91, 0x001e, 0x6010, 0x00b6,
+	0x2058, 0xb8d0, 0x0016, 0x9005, 0x190c, 0x674b, 0x001e, 0x00be,
+	0xd1e4, 0x1120, 0x080c, 0xabdf, 0x009e, 0x0005, 0x080c, 0xcb3f,
+	0x0cd8, 0x6114, 0x0096, 0x2148, 0xa97c, 0x080c, 0xcf77, 0x190c,
+	0x1a63, 0x009e, 0x0005, 0x0096, 0x6114, 0x2148, 0xa83c, 0xa940,
+	0x9105, 0x01e8, 0xa877, 0x0000, 0xa87b, 0x0000, 0xa867, 0x0103,
+	0x00b6, 0x6010, 0x2058, 0xa834, 0xa938, 0x9115, 0x11a0, 0x080c,
+	0x6b91, 0xba3c, 0x8211, 0x0208, 0xba3e, 0xb8d0, 0x9005, 0x0110,
+	0x080c, 0x674b, 0x080c, 0xabdf, 0x00be, 0x009e, 0x0005, 0xa87c,
+	0xc0dc, 0xa87e, 0x08f8, 0xb800, 0xd0bc, 0x1120, 0xa834, 0x080c,
+	0xbea6, 0x0c28, 0xa880, 0xd0bc, 0x1dc8, 0x080c, 0xcb7c, 0x0c60,
+	0x080c, 0x95c6, 0x0010, 0x080c, 0x9621, 0x601c, 0xd084, 0x0110,
+	0x080c, 0x1a77, 0x080c, 0xc832, 0x01f0, 0x0096, 0x6114, 0x2148,
+	0x080c, 0xca47, 0x1118, 0x080c, 0xb5a6, 0x00a0, 0xa867, 0x0103,
+	0x2009, 0x180c, 0x210c, 0xd18c, 0x1198, 0xd184, 0x1170, 0x6108,
+	0xa97a, 0x918e, 0x0029, 0x1110, 0x080c, 0xe631, 0xa877, 0x0000,
+	0x080c, 0x6d7b, 0x009e, 0x0804, 0xac1a, 0xa87b, 0x0004, 0x0cb0,
+	0xa87b, 0x0004, 0x0c98, 0x9182, 0x0057, 0x1220, 0x9182, 0x0040,
+	0x0208, 0x000a, 0x0005, 0xc16a, 0xc16a, 0xc16a, 0xc16a, 0xc16a,
+	0xc16c, 0xc16a, 0xc16a, 0xc16a, 0xc16a, 0xc16a, 0xc16a, 0xc16a,
+	0xc16a, 0xc16a, 0xc16a, 0xc16a, 0xc16a, 0xc16a, 0xc16a, 0xc190,
+	0xc16a, 0xc16a, 0x080c, 0x0d7d, 0x080c, 0x56dd, 0x01f8, 0x6014,
+	0x7144, 0x918c, 0x0fff, 0x9016, 0xd1c4, 0x0118, 0x7264, 0x9294,
+	0x00ff, 0x0096, 0x904d, 0x0188, 0xa87b, 0x0000, 0xa864, 0x9086,
+	0x0139, 0x0128, 0xa867, 0x0103, 0xa976, 0xaa96, 0x0030, 0xa897,
+	0x4000, 0xa99a, 0xaa9e, 0x080c, 0x6d7b, 0x009e, 0x0804, 0xabdf,
+	0x080c, 0x56dd, 0x0dd8, 0x6014, 0x900e, 0x9016, 0x0c10, 0x9182,
+	0x0085, 0x0002, 0xc1a9, 0xc1a7, 0xc1a7, 0xc1b5, 0xc1a7, 0xc1a7,
+	0xc1a7, 0xc1a7, 0xc1a7, 0xc1a7, 0xc1a7, 0xc1a7, 0xc1a7, 0x080c,
+	0x0d7d, 0x6003, 0x0001, 0x6106, 0x0126, 0x2091, 0x8000, 0x2009,
+	0x8020, 0x080c, 0x9200, 0x012e, 0x0005, 0x0026, 0x0056, 0x00d6,
+	0x00e6, 0x2071, 0x0260, 0x7224, 0x6216, 0x7220, 0x080c, 0xc820,
+	0x01a0, 0x2268, 0x6800, 0x9086, 0x0000, 0x0178, 0x6010, 0x6d10,
+	0x952e, 0x1158, 0x00c6, 0x2d60, 0x080c, 0xc423, 0x00ce, 0x0128,
+	0x6803, 0x0002, 0x6007, 0x0086, 0x0010, 0x6007, 0x0087, 0x6003,
+	0x0001, 0x2009, 0x8020, 0x080c, 0x9200, 0x9280, 0x0004, 0x00b6,
+	0x2058, 0xb800, 0x00be, 0xd0bc, 0x0140, 0x6824, 0xd0ec, 0x0128,
+	0x00c6, 0x2260, 0x080c, 0xcb7c, 0x00ce, 0x00ee, 0x00de, 0x005e,
+	0x002e, 0x0005, 0x9186, 0x0013, 0x1160, 0x6004, 0x908a, 0x0085,
+	0x0a0c, 0x0d7d, 0x908a, 0x0092, 0x1a0c, 0x0d7d, 0x9082, 0x0085,
+	0x00e2, 0x9186, 0x0027, 0x0120, 0x9186, 0x0014, 0x190c, 0x0d7d,
+	0x080c, 0x95c6, 0x0096, 0x6014, 0x2048, 0x080c, 0xc832, 0x0140,
+	0xa867, 0x0103, 0xa877, 0x0000, 0xa87b, 0x0029, 0x080c, 0x6d7b,
+	0x009e, 0x080c, 0xac1a, 0x0804, 0x9684, 0xc22a, 0xc22c, 0xc22c,
+	0xc22a, 0xc22a, 0xc22a, 0xc22a, 0xc22a, 0xc22a, 0xc22a, 0xc22a,
+	0xc22a, 0xc22a, 0x080c, 0x0d7d, 0x080c, 0xac1a, 0x0005, 0x9186,
+	0x0013, 0x1130, 0x6004, 0x9082, 0x0085, 0x2008, 0x0804, 0xc27b,
+	0x9186, 0x0027, 0x1558, 0x080c, 0x95c6, 0x080c, 0x31ef, 0x080c,
+	0xcf66, 0x0096, 0x6014, 0x2048, 0x080c, 0xc832, 0x0150, 0xa867,
+	0x0103, 0xa877, 0x0000, 0xa87b, 0x0029, 0x080c, 0x6d7b, 0x080c,
+	0xca21, 0x009e, 0x080c, 0xabdf, 0x0005, 0x9186, 0x0089, 0x0118,
+	0x9186, 0x008a, 0x1140, 0x080c, 0xaa9a, 0x0128, 0x9086, 0x000c,
+	0x0904, 0xc2b3, 0x0000, 0x080c, 0xac99, 0x0c70, 0x9186, 0x0014,
+	0x1d60, 0x080c, 0x95c6, 0x0096, 0x6014, 0x2048, 0x080c, 0xc832,
+	0x0d00, 0xa867, 0x0103, 0xa877, 0x0000, 0xa87b, 0x0006, 0xa880,
+	0xc0ec, 0xa882, 0x0890, 0x0002, 0xc28b, 0xc289, 0xc289, 0xc289,
+	0xc289, 0xc289, 0xc29f, 0xc289, 0xc289, 0xc289, 0xc289, 0xc289,
+	0xc289, 0x080c, 0x0d7d, 0x6034, 0x908c, 0xff00, 0x810f, 0x9186,
+	0x0039, 0x0118, 0x9186, 0x0035, 0x1118, 0x2001, 0x1985, 0x0010,
+	0x2001, 0x1986, 0x2004, 0x601a, 0x6003, 0x000c, 0x0005, 0x6034,
+	0x908c, 0xff00, 0x810f, 0x9186, 0x0039, 0x0118, 0x9186, 0x0035,
+	0x1118, 0x2001, 0x1985, 0x0010, 0x2001, 0x1986, 0x2004, 0x601a,
+	0x6003, 0x000e, 0x0005, 0x9182, 0x0092, 0x1220, 0x9182, 0x0085,
+	0x0208, 0x0012, 0x0804, 0xac99, 0xc2c9, 0xc2c9, 0xc2c9, 0xc2c9,
+	0xc2cb, 0xc318, 0xc2c9, 0xc2c9, 0xc2c9, 0xc2c9, 0xc2c9, 0xc2c9,
+	0xc2c9, 0x080c, 0x0d7d, 0x0096, 0x6010, 0x00b6, 0x2058, 0xb800,
+	0x00be, 0xd0bc, 0x0168, 0x6034, 0x908c, 0xff00, 0x810f, 0x9186,
+	0x0039, 0x0118, 0x9186, 0x0035, 0x1118, 0x009e, 0x0804, 0xc32c,
+	0x080c, 0xc832, 0x1118, 0x080c, 0xca21, 0x0068, 0x6014, 0x2048,
+	0x080c, 0xcf7d, 0x1110, 0x080c, 0xca21, 0xa867, 0x0103, 0x080c,
+	0xcf31, 0x080c, 0x6d7b, 0x00d6, 0x2c68, 0x080c, 0xab89, 0x01d0,
+	0x6003, 0x0001, 0x6007, 0x001e, 0x600b, 0xffff, 0x2009, 0x026e,
+	0x210c, 0x613a, 0x2009, 0x026f, 0x210c, 0x613e, 0x6910, 0x6112,
+	0x080c, 0xcccb, 0x695c, 0x615e, 0x6023, 0x0001, 0x2009, 0x8020,
+	0x080c, 0x9200, 0x2d60, 0x00de, 0x080c, 0xabdf, 0x009e, 0x0005,
+	0x6010, 0x00b6, 0x2058, 0xb800, 0x00be, 0xd0bc, 0x05a0, 0x6034,
+	0x908c, 0xff00, 0x810f, 0x9186, 0x0035, 0x0130, 0x9186, 0x001e,
+	0x0118, 0x9186, 0x0039, 0x1538, 0x00d6, 0x2c68, 0x080c, 0xcec9,
+	0x11f0, 0x080c, 0xab89, 0x01d8, 0x6106, 0x6003, 0x0001, 0x6023,
+	0x0001, 0x6910, 0x6112, 0x692c, 0x612e, 0x6930, 0x6132, 0x6934,
+	0x918c, 0x00ff, 0x6136, 0x6938, 0x613a, 0x693c, 0x613e, 0x695c,
+	0x615e, 0x080c, 0xcccb, 0x2009, 0x8020, 0x080c, 0x9200, 0x2d60,
+	0x00de, 0x0804, 0xabdf, 0x0096, 0x6014, 0x2048, 0x080c, 0xc832,
+	0x01c8, 0xa867, 0x0103, 0xa880, 0xd0b4, 0x0128, 0xc0ec, 0xa882,
+	0xa87b, 0x0006, 0x0048, 0xd0bc, 0x0118, 0xa87b, 0x0002, 0x0020,
+	0xa87b, 0x0005, 0x080c, 0xcb3b, 0xa877, 0x0000, 0x080c, 0x6d7b,
+	0x080c, 0xca21, 0x009e, 0x0804, 0xabdf, 0x0016, 0x0096, 0x6014,
+	0x2048, 0x080c, 0xc832, 0x0140, 0xa867, 0x0103, 0xa87b, 0x0028,
+	0xa877, 0x0000, 0x080c, 0x6d7b, 0x009e, 0x001e, 0x9186, 0x0013,
+	0x0158, 0x9186, 0x0014, 0x0130, 0x9186, 0x0027, 0x0118, 0x080c,
+	0xac99, 0x0020, 0x080c, 0x95c6, 0x080c, 0xac1a, 0x0005, 0x0056,
+	0x0066, 0x0096, 0x00a6, 0x2029, 0x0001, 0x9182, 0x0101, 0x1208,
+	0x0010, 0x2009, 0x0100, 0x2130, 0x8304, 0x9098, 0x0018, 0x2009,
+	0x0020, 0x2011, 0x0029, 0x080c, 0xc3f8, 0x96b2, 0x0020, 0xb004,
+	0x904d, 0x0110, 0x080c, 0x0fec, 0x080c, 0x103a, 0x0520, 0x8528,
+	0xa867, 0x0110, 0xa86b, 0x0000, 0x2920, 0xb406, 0x968a, 0x003d,
+	0x1228, 0x2608, 0x2011, 0x001b, 0x0499, 0x00a8, 0x96b2, 0x003c,
+	0x2009, 0x003c, 0x2950, 0x2011, 0x001b, 0x0451, 0x0c28, 0x2001,
+	0x0205, 0x2003, 0x0000, 0x00ae, 0x852f, 0x95ad, 0x0003, 0xb566,
+	0x95ac, 0x0000, 0x0048, 0x2001, 0x0205, 0x2003, 0x0000, 0x00ae,
+	0x852f, 0x95ad, 0x0003, 0xb566, 0x009e, 0x006e, 0x005e, 0x0005,
+	0x00a6, 0x89ff, 0x0158, 0xa804, 0x9055, 0x0130, 0xa807, 0x0000,
+	0x080c, 0x6d7b, 0x2a48, 0x0cb8, 0x080c, 0x6d7b, 0x00ae, 0x0005,
+	0x00f6, 0x2079, 0x0200, 0x7814, 0x9085, 0x0080, 0x7816, 0xd184,
+	0x0108, 0x8108, 0x810c, 0x20a9, 0x0001, 0xa860, 0x20e8, 0xa85c,
+	0x9200, 0x20a0, 0x20e1, 0x0000, 0x2300, 0x9e00, 0x2098, 0x4003,
+	0x8318, 0x9386, 0x0020, 0x1148, 0x2018, 0x2300, 0x9e00, 0x2098,
+	0x7814, 0x8000, 0x9085, 0x0080, 0x7816, 0x8109, 0x1d80, 0x7817,
+	0x0000, 0x00fe, 0x0005, 0x0066, 0x0126, 0x2091, 0x8000, 0x2031,
+	0x0001, 0x6020, 0x9084, 0x000f, 0x0083, 0x012e, 0x006e, 0x0005,
+	0x0126, 0x2091, 0x8000, 0x0066, 0x2031, 0x0000, 0x6020, 0x9084,
+	0x000f, 0x001b, 0x006e, 0x012e, 0x0005, 0xc475, 0xc475, 0xc470,
+	0xc499, 0xc44d, 0xc470, 0xc44f, 0xc470, 0xc44d, 0x90c6, 0xc470,
+	0xc470, 0xc470, 0xc44d, 0xc44d, 0xc44d, 0x080c, 0x0d7d, 0x6010,
+	0x9080, 0x0000, 0x2004, 0xd0bc, 0x190c, 0xc499, 0x0036, 0x6014,
+	0x0096, 0x2048, 0xa880, 0x009e, 0xd0cc, 0x0118, 0x2019, 0x000c,
+	0x0038, 0xd094, 0x0118, 0x2019, 0x000d, 0x0010, 0x2019, 0x0010,
+	0x080c, 0xde2a, 0x6023, 0x0006, 0x6003, 0x0007, 0x003e, 0x0005,
+	0x9006, 0x0005, 0x9085, 0x0001, 0x0005, 0x0096, 0x86ff, 0x11e8,
+	0x6014, 0x2048, 0x080c, 0xc832, 0x01d0, 0x6043, 0xffff, 0xa864,
+	0x9086, 0x0139, 0x1128, 0xa87b, 0x0005, 0xa883, 0x0000, 0x0028,
+	0x900e, 0x2001, 0x0005, 0x080c, 0x6faf, 0x080c, 0xcb3b, 0x080c,
+	0x6d6f, 0x080c, 0xac1a, 0x9085, 0x0001, 0x009e, 0x0005, 0x9006,
+	0x0ce0, 0x080c, 0xa888, 0x080c, 0xcf8b, 0x6000, 0x908a, 0x0016,
+	0x1a0c, 0x0d7d, 0x002b, 0x0106, 0x080c, 0xa8a4, 0x010e, 0x0005,
+	0xc4b8, 0xc4e6, 0xc4ba, 0xc50d, 0xc4e1, 0xc4b8, 0xc470, 0xc475,
+	0xc475, 0xc470, 0xc470, 0xc470, 0xc470, 0xc470, 0xc470, 0xc470,
+	0x080c, 0x0d7d, 0x86ff, 0x1510, 0x6020, 0x9086, 0x0006, 0x01f0,
+	0x0096, 0x6014, 0x2048, 0x080c, 0xc832, 0x0158, 0xa87c, 0xd0cc,
+	0x0130, 0x0096, 0xa878, 0x2048, 0x080c, 0x0fec, 0x009e, 0x080c,
+	0xcb3b, 0x009e, 0x080c, 0xcf0b, 0x6007, 0x0085, 0x6003, 0x000b,
+	0x6023, 0x0002, 0x2009, 0x8020, 0x080c, 0x91e2, 0x9085, 0x0001,
+	0x0005, 0x0066, 0x080c, 0x1a77, 0x006e, 0x08a0, 0x00e6, 0x2071,
+	0x19e6, 0x7030, 0x9c06, 0x1120, 0x080c, 0xa07a, 0x00ee, 0x0850,
+	0x6020, 0x9084, 0x000f, 0x9086, 0x0006, 0x1150, 0x0086, 0x0096,
+	0x2049, 0x0001, 0x2c40, 0x080c, 0xa1fa, 0x009e, 0x008e, 0x0040,
+	0x0066, 0x080c, 0x9f76, 0x190c, 0x0d7d, 0x080c, 0x9f84, 0x006e,
+	0x00ee, 0x1904, 0xc4ba, 0x0804, 0xc470, 0x0036, 0x00e6, 0x2071,
+	0x19e6, 0x704c, 0x9c06, 0x1138, 0x901e, 0x080c, 0xa0fa, 0x00ee,
+	0x003e, 0x0804, 0xc4ba, 0x080c, 0xa331, 0x00ee, 0x003e, 0x1904,
+	0xc4ba, 0x0804, 0xc470, 0x00c6, 0x0066, 0x6020, 0x9084, 0x000f,
+	0x001b, 0x006e, 0x00ce, 0x0005, 0xc543, 0xc612, 0xc779, 0xc54b,
+	0xac1a, 0xc543, 0xde1c, 0xcf73, 0xc612, 0x908d, 0xc7f8, 0xc53c,
+	0xc53c, 0xc53c, 0xc53c, 0xc53c, 0x080c, 0x0d7d, 0x080c, 0xca47,
+	0x1110, 0x080c, 0xb5a6, 0x0005, 0x080c, 0x95c6, 0x0804, 0xabdf,
+	0x601b, 0x0001, 0x0005, 0x080c, 0xc832, 0x0130, 0x6014, 0x0096,
+	0x2048, 0x2c00, 0xa896, 0x009e, 0x080c, 0xa888, 0x080c, 0xcf8b,
+	0x6000, 0x908a, 0x0016, 0x1a0c, 0x0d7d, 0x0013, 0x0804, 0xa8a4,
+	0xc570, 0xc572, 0xc59c, 0xc5b0, 0xc5dd, 0xc570, 0xc543, 0xc543,
+	0xc543, 0xc5b7, 0xc5b7, 0xc570, 0xc570, 0xc570, 0xc570, 0xc5c1,
+	0x080c, 0x0d7d, 0x00e6, 0x6014, 0x0096, 0x2048, 0xa880, 0xc0b5,
+	0xa882, 0x009e, 0x2071, 0x19e6, 0x7030, 0x9c06, 0x01d0, 0x0066,
+	0x080c, 0x9f76, 0x190c, 0x0d7d, 0x080c, 0x9f84, 0x006e, 0x080c,
+	0xcf0b, 0x6007, 0x0085, 0x6003, 0x000b, 0x6023, 0x0002, 0x2001,
+	0x1986, 0x2004, 0x601a, 0x2009, 0x8020, 0x080c, 0x91e2, 0x00ee,
+	0x0005, 0x601b, 0x0001, 0x0cd8, 0x0096, 0x6014, 0x2048, 0xa880,
+	0xc0b5, 0xa882, 0x009e, 0x080c, 0xcf0b, 0x6007, 0x0085, 0x6003,
+	0x000b, 0x6023, 0x0002, 0x2009, 0x8020, 0x080c, 0x91e2, 0x0005,
+	0x080c, 0xa888, 0x080c, 0xaa1c, 0x080c, 0xa8a4, 0x0c28, 0x0096,
+	0x601b, 0x0001, 0x6014, 0x2048, 0xa880, 0xc0b5, 0xa882, 0x009e,
+	0x0005, 0x080c, 0x56dd, 0x01b8, 0x6014, 0x0096, 0x904d, 0x0190,
+	0xa864, 0xa867, 0x0103, 0xa87b, 0x0006, 0x9086, 0x0139, 0x1150,
+	0xa867, 0x0139, 0xa87b, 0x0030, 0xa897, 0x4005, 0xa89b, 0x0004,
+	0x080c, 0x6d7b, 0x009e, 0x0804, 0xabdf, 0x6014, 0x0096, 0x904d,
+	0x0560, 0xa97c, 0xd1e4, 0x1158, 0x611c, 0xd1fc, 0x0530, 0x6110,
+	0x00b6, 0x2158, 0xb93c, 0x8109, 0x0208, 0xb93e, 0x00be, 0x080c,
+	0xa8a4, 0x2001, 0x180f, 0x2004, 0xd0c4, 0x0110, 0x009e, 0x0005,
+	0xa884, 0x009e, 0x8003, 0x800b, 0x810b, 0x9108, 0x611a, 0x2001,
+	0x0037, 0x2c08, 0x080c, 0x1686, 0x6000, 0x9086, 0x0004, 0x1120,
+	0x2009, 0x0048, 0x080c, 0xac7c, 0x0005, 0x009e, 0x080c, 0x1a77,
+	0x0804, 0xc59c, 0x6000, 0x908a, 0x0016, 0x1a0c, 0x0d7d, 0x000b,
+	0x0005, 0xc629, 0xc548, 0xc62b, 0xc629, 0xc62b, 0xc62b, 0xc544,
+	0xc629, 0xc53e, 0xc53e, 0xc629, 0xc629, 0xc629, 0xc629, 0xc629,
+	0xc629, 0x080c, 0x0d7d, 0x6010, 0x00b6, 0x2058, 0xb804, 0x9084,
+	0x00ff, 0x00be, 0x908a, 0x000c, 0x1a0c, 0x0d7d, 0x00b6, 0x0013,
+	0x00be, 0x0005, 0xc646, 0xc713, 0xc648, 0xc688, 0xc648, 0xc688,
+	0xc648, 0xc656, 0xc646, 0xc688, 0xc646, 0xc677, 0x080c, 0x0d7d,
+	0x6004, 0x908e, 0x0016, 0x05c0, 0x908e, 0x0004, 0x05a8, 0x908e,
+	0x0002, 0x0590, 0x908e, 0x0052, 0x0904, 0xc70f, 0x6004, 0x080c,
+	0xca47, 0x0904, 0xc72c, 0x908e, 0x0004, 0x1110, 0x080c, 0x321e,
+	0x908e, 0x0021, 0x0904, 0xc730, 0x908e, 0x0022, 0x0904, 0xc774,
+	0x908e, 0x003d, 0x0904, 0xc730, 0x908e, 0x0039, 0x0904, 0xc734,
+	0x908e, 0x0035, 0x0904, 0xc734, 0x908e, 0x001e, 0x0178, 0x908e,
+	0x0001, 0x1140, 0x6010, 0x2058, 0xb804, 0x9084, 0x00ff, 0x9086,
+	0x0006, 0x0110, 0x080c, 0x31ef, 0x080c, 0xb5a6, 0x0804, 0xac1a,
+	0x00c6, 0x00d6, 0x6104, 0x9186, 0x0016, 0x0904, 0xc700, 0x9186,
+	0x0002, 0x1904, 0xc6d5, 0x2001, 0x1837, 0x2004, 0xd08c, 0x11c8,
+	0x080c, 0x74c8, 0x11b0, 0x080c, 0xcf51, 0x0138, 0x080c, 0x74eb,
+	0x1120, 0x080c, 0x73d3, 0x0804, 0xc75d, 0x2001, 0x197c, 0x2003,
+	0x0001, 0x2001, 0x1800, 0x2003, 0x0001, 0x080c, 0x73f9, 0x0804,
+	0xc75d, 0x6010, 0x2058, 0x2001, 0x1837, 0x2004, 0xd0ac, 0x1904,
+	0xc75d, 0xb8a0, 0x9084, 0xff80, 0x1904, 0xc75d, 0xb840, 0x9084,
+	0x00ff, 0x9005, 0x0190, 0x8001, 0xb842, 0x6017, 0x0000, 0x6023,
+	0x0007, 0x601b, 0x0398, 0x604b, 0x0000, 0x080c, 0xab89, 0x0128,
+	0x2b00, 0x6012, 0x6023, 0x0001, 0x0458, 0x00de, 0x00ce, 0x6004,
+	0x908e, 0x0002, 0x11a0, 0x6010, 0x2058, 0xb8a0, 0x9086, 0x007e,
+	0x1170, 0x2009, 0x1837, 0x2104, 0xc085, 0x200a, 0x00e6, 0x2071,
+	0x1800, 0x080c, 0x5fb7, 0x00ee, 0x080c, 0xb5a6, 0x0030, 0x080c,
+	0xb5a6, 0x080c, 0x31ef, 0x080c, 0xcf66, 0x00e6, 0x0126, 0x2091,
+	0x8000, 0x080c, 0x321e, 0x012e, 0x00ee, 0x080c, 0xac1a, 0x0005,
+	0x2001, 0x0002, 0x080c, 0x6570, 0x6003, 0x0001, 0x6007, 0x0002,
+	0x080c, 0x9207, 0x080c, 0x9684, 0x00de, 0x00ce, 0x0c80, 0x080c,
+	0x321e, 0x0804, 0xc684, 0x00c6, 0x00d6, 0x6104, 0x9186, 0x0016,
+	0x0d38, 0x6010, 0x2058, 0xb840, 0x9084, 0x00ff, 0x9005, 0x0904,
+	0xc6d5, 0x8001, 0xb842, 0x6003, 0x0001, 0x080c, 0x9207, 0x080c,
+	0x9684, 0x00de, 0x00ce, 0x0898, 0x080c, 0xb5a6, 0x0804, 0xc686,
+	0x080c, 0xb5e2, 0x0804, 0xc686, 0x00d6, 0x2c68, 0x6104, 0x080c,
+	0xcec9, 0x00de, 0x0118, 0x080c, 0xabdf, 0x00f0, 0x6004, 0x8007,
+	0x6134, 0x918c, 0x00ff, 0x9105, 0x6036, 0x6007, 0x0085, 0x6003,
+	0x000b, 0x6023, 0x0002, 0x603c, 0x600a, 0x2001, 0x1986, 0x2004,
+	0x601a, 0x602c, 0x2c08, 0x2060, 0x6024, 0xc0b5, 0x6026, 0x2160,
+	0x2009, 0x8020, 0x080c, 0x9200, 0x0005, 0x00de, 0x00ce, 0x080c,
+	0xb5a6, 0x080c, 0x31ef, 0x00e6, 0x0126, 0x2091, 0x8000, 0x080c,
+	0x321e, 0x6017, 0x0000, 0x6023, 0x0007, 0x601b, 0x0398, 0x604b,
+	0x0000, 0x012e, 0x00ee, 0x0005, 0x080c, 0xb01a, 0x1904, 0xc72c,
+	0x0005, 0x6000, 0x908a, 0x0016, 0x1a0c, 0x0d7d, 0x0096, 0x00d6,
+	0x001b, 0x00de, 0x009e, 0x0005, 0xc794, 0xc794, 0xc794, 0xc794,
+	0xc794, 0xc794, 0xc794, 0xc794, 0xc794, 0xc543, 0xc794, 0xc548,
+	0xc796, 0xc548, 0xc7a3, 0xc794, 0x080c, 0x0d7d, 0x6004, 0x9086,
+	0x008b, 0x0148, 0x6007, 0x008b, 0x6003, 0x000d, 0x2009, 0x8020,
+	0x080c, 0x9200, 0x0005, 0x080c, 0xcf45, 0x0118, 0x080c, 0xcf58,
+	0x0010, 0x080c, 0xcf66, 0x080c, 0xca21, 0x080c, 0xc832, 0x0570,
+	0x080c, 0x31ef, 0x080c, 0xc832, 0x0168, 0x6014, 0x2048, 0xa867,
+	0x0103, 0xa87b, 0x0006, 0xa877, 0x0000, 0xa880, 0xc0ed, 0xa882,
+	0x080c, 0x6d7b, 0x2c68, 0x080c, 0xab89, 0x0150, 0x6810, 0x6012,
+	0x080c, 0xcccb, 0x00c6, 0x2d60, 0x080c, 0xac1a, 0x00ce, 0x0008,
+	0x2d60, 0x6017, 0x0000, 0x6023, 0x0001, 0x6007, 0x0001, 0x6003,
+	0x0001, 0x080c, 0x9207, 0x080c, 0x9684, 0x00c8, 0x080c, 0xcf45,
+	0x0138, 0x6034, 0x9086, 0x4000, 0x1118, 0x080c, 0x31ef, 0x08d0,
+	0x6034, 0x908c, 0xff00, 0x810f, 0x9186, 0x0039, 0x0118, 0x9186,
+	0x0035, 0x1118, 0x080c, 0x31ef, 0x0868, 0x080c, 0xac1a, 0x0005,
+	0x6000, 0x908a, 0x0016, 0x1a0c, 0x0d7d, 0x0002, 0xc80e, 0xc80e,
+	0xc810, 0xc810, 0xc810, 0xc80e, 0xc80e, 0xac1a, 0xc80e, 0xc80e,
+	0xc80e, 0xc80e, 0xc80e, 0xc80e, 0xc80e, 0xc80e, 0x080c, 0x0d7d,
+	0x080c, 0xa888, 0x080c, 0xaa1c, 0x080c, 0xa8a4, 0x6114, 0x0096,
+	0x2148, 0xa87b, 0x0006, 0x080c, 0x6d7b, 0x009e, 0x0804, 0xabdf,
+	0x9284, 0x0003, 0x1158, 0x9282, 0x1ddc, 0x0240, 0x2001, 0x181a,
+	0x2004, 0x9202, 0x1218, 0x9085, 0x0001, 0x0005, 0x9006, 0x0ce8,
+	0x0096, 0x0028, 0x0096, 0x0006, 0x6014, 0x2048, 0x000e, 0x0006,
+	0x9984, 0xf000, 0x9086, 0xf000, 0x0110, 0x080c, 0x10e5, 0x000e,
+	0x009e, 0x0005, 0x00e6, 0x00c6, 0x0036, 0x0006, 0x0126, 0x2091,
+	0x8000, 0x2061, 0x1ddc, 0x2071, 0x1800, 0x7354, 0x7074, 0x9302,
+	0x1640, 0x6020, 0x9206, 0x11f8, 0x080c, 0xcf51, 0x0180, 0x9286,
+	0x0001, 0x1168, 0x6004, 0x9086, 0x0004, 0x1148, 0x080c, 0x31ef,
+	0x080c, 0xcf66, 0x00c6, 0x080c, 0xac1a, 0x00ce, 0x0060, 0x080c,
+	0xcc3d, 0x0148, 0x080c, 0xca47, 0x1110, 0x080c, 0xb5a6, 0x00c6,
+	0x080c, 0xabdf, 0x00ce, 0x9ce0, 0x001c, 0x7068, 0x9c02, 0x1208,
+	0x08a0, 0x012e, 0x000e, 0x003e, 0x00ce, 0x00ee, 0x0005, 0x00e6,
+	0x00c6, 0x0016, 0x9188, 0x1000, 0x210c, 0x81ff, 0x0128, 0x2061,
+	0x1b31, 0x6112, 0x080c, 0x31ef, 0x9006, 0x0010, 0x9085, 0x0001,
+	0x001e, 0x00ce, 0x00ee, 0x0005, 0x00c6, 0x0126, 0x2091, 0x8000,
+	0x080c, 0xab89, 0x01b0, 0x665e, 0x2b00, 0x6012, 0x080c, 0x56dd,
+	0x0118, 0x080c, 0xc963, 0x0168, 0x080c, 0xcccb, 0x6023, 0x0003,
+	0x2009, 0x004b, 0x080c, 0xac7c, 0x9085, 0x0001, 0x012e, 0x00ce,
+	0x0005, 0x9006, 0x0cd8, 0x00c6, 0x0126, 0x2091, 0x8000, 0xbaa0,
+	0x080c, 0xac4f, 0x0580, 0x605f, 0x0000, 0x2b00, 0x6012, 0x080c,
+	0xcccb, 0x6023, 0x0003, 0x0016, 0x080c, 0xa888, 0x080c, 0x938d,
+	0x0076, 0x903e, 0x080c, 0x9256, 0x2c08, 0x080c, 0xdffb, 0x007e,
+	0x080c, 0xa8a4, 0x001e, 0xd184, 0x0128, 0x080c, 0xabdf, 0x9085,
+	0x0001, 0x0070, 0x080c, 0x56dd, 0x0128, 0xd18c, 0x1170, 0x080c,
+	0xc963, 0x0148, 0x2009, 0x004c, 0x080c, 0xac7c, 0x9085, 0x0001,
+	0x012e, 0x00ce, 0x0005, 0x9006, 0x0cd8, 0x2900, 0x6016, 0x0c90,
+	0x2009, 0x004d, 0x0010, 0x2009, 0x004e, 0x00f6, 0x00c6, 0x0046,
+	0x0016, 0x080c, 0xab89, 0x2c78, 0x0590, 0x7e5e, 0x2b00, 0x7812,
+	0x7823, 0x0003, 0x2021, 0x0005, 0x080c, 0xc975, 0x9186, 0x004d,
+	0x0118, 0x9186, 0x004e, 0x0148, 0x2001, 0x197f, 0x200c, 0xd1fc,
+	0x0168, 0x2f60, 0x080c, 0xabdf, 0x00d0, 0x2001, 0x197e, 0x200c,
+	0xd1fc, 0x0120, 0x2f60, 0x080c, 0xabdf, 0x0088, 0x2f60, 0x080c,
+	0x56dd, 0x0138, 0xd18c, 0x1118, 0x04f1, 0x0148, 0x0010, 0x2900,
+	0x7816, 0x001e, 0x0016, 0x080c, 0xac7c, 0x9085, 0x0001, 0x001e,
+	0x004e, 0x00ce, 0x00fe, 0x0005, 0x00f6, 0x00c6, 0x0046, 0x080c,
+	0xab89, 0x2c78, 0x0508, 0x7e5e, 0x2b00, 0x7812, 0x7823, 0x0003,
+	0x0096, 0x2021, 0x0004, 0x0489, 0x009e, 0x2001, 0x197d, 0x200c,
+	0xd1fc, 0x0120, 0x2f60, 0x080c, 0xabdf, 0x0060, 0x2f60, 0x080c,
+	0x56dd, 0x0120, 0xd18c, 0x1160, 0x0071, 0x0130, 0x2009, 0x0052,
+	0x080c, 0xac7c, 0x9085, 0x0001, 0x004e, 0x00ce, 0x00fe, 0x0005,
+	0x2900, 0x7816, 0x0c98, 0x00c6, 0x080c, 0x4aa9, 0x00ce, 0x1120,
+	0x080c, 0xabdf, 0x9006, 0x0005, 0xa867, 0x0000, 0xa86b, 0x8000,
+	0x2900, 0x6016, 0x9085, 0x0001, 0x0005, 0x0096, 0x0076, 0x0126,
+	0x2091, 0x8000, 0x080c, 0xa888, 0x080c, 0x6802, 0x0158, 0x2001,
+	0xc97c, 0x0006, 0x900e, 0x2400, 0x080c, 0x6faf, 0x080c, 0x6d7b,
+	0x000e, 0x0807, 0x2418, 0x080c, 0x958c, 0xbaa0, 0x0086, 0x2041,
+	0x0001, 0x2039, 0x0001, 0x2608, 0x080c, 0x93a7, 0x008e, 0x080c,
+	0x9256, 0x2f08, 0x2648, 0x080c, 0xdffb, 0xb93c, 0x81ff, 0x090c,
+	0x947e, 0x080c, 0xa8a4, 0x012e, 0x007e, 0x009e, 0x0005, 0x00c6,
+	0x0126, 0x2091, 0x8000, 0x080c, 0xab89, 0x0190, 0x660a, 0x2b08,
+	0x6112, 0x080c, 0xcccb, 0x6023, 0x0001, 0x2900, 0x6016, 0x2009,
+	0x001f, 0x080c, 0xac7c, 0x9085, 0x0001, 0x012e, 0x00ce, 0x0005,
+	0x9006, 0x0cd8, 0x00c6, 0x0126, 0x2091, 0x8000, 0x080c, 0xac4f,
+	0x01b8, 0x660a, 0x2b08, 0x6112, 0x080c, 0xcccb, 0x6023, 0x0008,
+	0x2900, 0x6016, 0x00f6, 0x2c78, 0x080c, 0x173e, 0x00fe, 0x2009,
+	0x0021, 0x080c, 0xac7c, 0x9085, 0x0001, 0x012e, 0x00ce, 0x0005,
+	0x9006, 0x0cd8, 0x2009, 0x003d, 0x00c6, 0x0126, 0x0016, 0x2091,
+	0x8000, 0x080c, 0xab89, 0x0198, 0x660a, 0x2b08, 0x6112, 0x080c,
+	0xcccb, 0x6023, 0x0001, 0x2900, 0x6016, 0x001e, 0x0016, 0x080c,
+	0xac7c, 0x9085, 0x0001, 0x001e, 0x012e, 0x00ce, 0x0005, 0x9006,
+	0x0cd0, 0x00c6, 0x0126, 0x2091, 0x8000, 0x080c, 0xac4f, 0x0188,
+	0x2b08, 0x6112, 0x080c, 0xcccb, 0x6023, 0x0001, 0x2900, 0x6016,
+	0x2009, 0x0000, 0x080c, 0xac7c, 0x9085, 0x0001, 0x012e, 0x00ce,
+	0x0005, 0x9006, 0x0cd8, 0x2009, 0x0044, 0x0830, 0x2009, 0x0049,
+	0x0818, 0x0026, 0x00b6, 0x6210, 0x2258, 0xba3c, 0x82ff, 0x0118,
+	0x8211, 0xba3e, 0x1140, 0xb8d0, 0x9005, 0x0128, 0xb888, 0x9005,
+	0x1110, 0xb88b, 0x0001, 0x00be, 0x002e, 0x0005, 0x0006, 0x0016,
+	0x6004, 0x908e, 0x0002, 0x0140, 0x908e, 0x0003, 0x0128, 0x908e,
+	0x0004, 0x0110, 0x9085, 0x0001, 0x001e, 0x000e, 0x0005, 0x0006,
+	0x0086, 0x0096, 0x6020, 0x9086, 0x0004, 0x01a8, 0x6014, 0x904d,
+	0x080c, 0xc832, 0x0180, 0xa864, 0x9086, 0x0139, 0x0170, 0x6020,
+	0x90c6, 0x0003, 0x0140, 0x90c6, 0x0002, 0x0128, 0xa868, 0xd0fc,
+	0x0110, 0x9006, 0x0010, 0x9085, 0x0001, 0x009e, 0x008e, 0x000e,
+	0x0005, 0x00c6, 0x0126, 0x2091, 0x8000, 0x080c, 0xac4f, 0x0198,
+	0x2b08, 0x6112, 0x080c, 0xcccb, 0x6023, 0x0001, 0x2900, 0x6016,
+	0x080c, 0x31ef, 0x2009, 0x0028, 0x080c, 0xac7c, 0x9085, 0x0001,
+	0x012e, 0x00ce, 0x0005, 0x9006, 0x0cd8, 0x9186, 0x0015, 0x11a8,
+	0x2011, 0x1824, 0x2204, 0x9086, 0x0074, 0x1178, 0x00b6, 0x080c,
+	0xb7fa, 0x00be, 0x080c, 0xba1d, 0x6003, 0x0001, 0x6007, 0x0029,
+	0x080c, 0x9207, 0x080c, 0x9684, 0x0078, 0x6014, 0x0096, 0x2048,
+	0xa868, 0x009e, 0xd0fc, 0x0148, 0x2001, 0x0001, 0x080c, 0xce8a,
+	0x080c, 0xb5a6, 0x080c, 0xabdf, 0x0005, 0x0096, 0x6014, 0x904d,
+	0x090c, 0x0d7d, 0xa87b, 0x0030, 0xa883, 0x0000, 0xa897, 0x4005,
+	0xa89b, 0x0004, 0xa867, 0x0139, 0x0126, 0x2091, 0x8000, 0x080c,
+	0x6d7b, 0x012e, 0x009e, 0x080c, 0xabdf, 0x0c30, 0x0096, 0x9186,
+	0x0016, 0x1128, 0x2001, 0x0004, 0x080c, 0x6570, 0x00e8, 0x9186,
+	0x0015, 0x1510, 0x2011, 0x1824, 0x2204, 0x9086, 0x0014, 0x11e0,
+	0x6010, 0x00b6, 0x2058, 0x080c, 0x66bb, 0x00be, 0x080c, 0xbaee,
+	0x1198, 0x6010, 0x00b6, 0x2058, 0xb890, 0x00be, 0x9005, 0x0160,
+	0x2001, 0x0006, 0x080c, 0x6570, 0x6014, 0x2048, 0xa868, 0xd0fc,
+	0x0170, 0x080c, 0xafee, 0x0048, 0x6014, 0x2048, 0xa868, 0xd0fc,
+	0x0528, 0x080c, 0xb5a6, 0x080c, 0xabdf, 0x009e, 0x0005, 0x6014,
+	0x6310, 0x2358, 0x904d, 0x090c, 0x0d7d, 0xa87b, 0x0000, 0xa883,
+	0x0000, 0xa897, 0x4000, 0x900e, 0x080c, 0x6913, 0x1108, 0xc185,
+	0xb800, 0xd0bc, 0x0108, 0xc18d, 0xa99a, 0x0126, 0x2091, 0x8000,
+	0x080c, 0x6d7b, 0x012e, 0x080c, 0xabdf, 0x08f8, 0x6014, 0x904d,
+	0x090c, 0x0d7d, 0xa87b, 0x0030, 0xa883, 0x0000, 0xa897, 0x4005,
+	0xa89b, 0x0004, 0xa867, 0x0139, 0x0126, 0x2091, 0x8000, 0x080c,
+	0x6d7b, 0x012e, 0x080c, 0xabdf, 0x0840, 0xa878, 0x9086, 0x0005,
+	0x1108, 0x0009, 0x0005, 0xa880, 0xc0ad, 0xa882, 0x0005, 0x604b,
+	0x0000, 0x6017, 0x0000, 0x6003, 0x0001, 0x6007, 0x0050, 0x2009,
+	0x8023, 0x080c, 0x9200, 0x0005, 0x00c6, 0x6010, 0x00b6, 0x2058,
+	0xb800, 0x00be, 0xd0bc, 0x0130, 0x0066, 0x6020, 0x9084, 0x000f,
+	0x001b, 0x006e, 0x00ce, 0x0005, 0xc543, 0xcb6e, 0xcb6e, 0xcb71,
+	0xe328, 0xe343, 0xe346, 0xc543, 0xc543, 0xc543, 0xc543, 0xc543,
+	0xc543, 0xc543, 0xc543, 0xc543, 0x080c, 0x0d7d, 0xa001, 0xa001,
+	0x0005, 0x0096, 0x6014, 0x904d, 0x0118, 0xa87c, 0xd0e4, 0x1110,
+	0x009e, 0x0010, 0x009e, 0x0005, 0x6010, 0x00b6, 0x2058, 0xb800,
+	0x00be, 0xd0bc, 0x0550, 0x2001, 0x1834, 0x2004, 0x9005, 0x1540,
+	0x00f6, 0x2c78, 0x080c, 0xab89, 0x0508, 0x7810, 0x6012, 0x080c,
+	0xcccb, 0x7820, 0x9086, 0x0003, 0x0128, 0x7808, 0x603a, 0x2f00,
+	0x603e, 0x0020, 0x7808, 0x603e, 0x2f00, 0x603a, 0x602e, 0x6023,
+	0x0001, 0x6007, 0x0035, 0x6003, 0x0001, 0x795c, 0x615e, 0x2009,
+	0x8020, 0x080c, 0x9200, 0x2f60, 0x00fe, 0x0005, 0x2f60, 0x00fe,
+	0x2001, 0x1987, 0x2004, 0x604a, 0x0005, 0x0016, 0x0096, 0x6814,
+	0x2048, 0x681c, 0xd0fc, 0xc0fc, 0x681e, 0xa87c, 0x1108, 0xd0e4,
+	0x0180, 0xc0e4, 0xa87e, 0xa877, 0x0000, 0xa893, 0x0000, 0xa88f,
+	0x0000, 0xd0cc, 0x0130, 0xc0cc, 0xa87e, 0xa878, 0x2048, 0x080c,
+	0x0fec, 0x6830, 0x6036, 0x908e, 0x0001, 0x0148, 0x6803, 0x0002,
+	0x9086, 0x0005, 0x0170, 0x9006, 0x602e, 0x6032, 0x00d0, 0x681c,
+	0xc085, 0x681e, 0x6803, 0x0004, 0x6824, 0xc0f4, 0x9085, 0x0c00,
+	0x6826, 0x6814, 0x2048, 0xa8ac, 0x6938, 0x9102, 0xa8b0, 0x693c,
+	0x9103, 0x1e48, 0x683c, 0x602e, 0x6838, 0x9084, 0xfffc, 0x683a,
+	0x6032, 0x2d00, 0x603a, 0x6808, 0x603e, 0x6910, 0x6112, 0x695c,
+	0x615e, 0x6023, 0x0001, 0x6007, 0x0039, 0x6003, 0x0001, 0x2009,
+	0x8020, 0x080c, 0x9200, 0x009e, 0x001e, 0x0005, 0x6024, 0xd0d4,
+	0x0510, 0xd0f4, 0x11f8, 0x6038, 0x940a, 0x603c, 0x9303, 0x0230,
+	0x9105, 0x0120, 0x6024, 0xc0d4, 0xc0f5, 0x0098, 0x643a, 0x633e,
+	0xac3e, 0xab42, 0x0046, 0x0036, 0x2400, 0xacac, 0x9402, 0xa836,
+	0x2300, 0xabb0, 0x9303, 0xa83a, 0x003e, 0x004e, 0x6024, 0xc0d4,
+	0x0000, 0x6026, 0x0005, 0xd0f4, 0x1138, 0xa83c, 0x603a, 0xa840,
+	0x603e, 0x6024, 0xc0f5, 0x6026, 0x0005, 0x0006, 0x0016, 0x6004,
+	0x908e, 0x0034, 0x01b8, 0x908e, 0x0035, 0x01a0, 0x908e, 0x0036,
+	0x0188, 0x908e, 0x0037, 0x0170, 0x908e, 0x0038, 0x0158, 0x908e,
+	0x0039, 0x0140, 0x908e, 0x003a, 0x0128, 0x908e, 0x003b, 0x0110,
+	0x9085, 0x0001, 0x001e, 0x000e, 0x0005, 0x0006, 0x0016, 0x0026,
+	0x0036, 0x00e6, 0x2001, 0x1981, 0x200c, 0x8000, 0x2014, 0x2001,
+	0x0032, 0x080c, 0x9148, 0x2001, 0x1985, 0x82ff, 0x1110, 0x2011,
+	0x0014, 0x2202, 0x2001, 0x1983, 0x200c, 0x8000, 0x2014, 0x2071,
+	0x196b, 0x711a, 0x721e, 0x2001, 0x0064, 0x080c, 0x9148, 0x2001,
+	0x1986, 0x82ff, 0x1110, 0x2011, 0x0014, 0x2202, 0x2001, 0x1987,
+	0x9288, 0x000a, 0x2102, 0x2001, 0x0017, 0x080c, 0xa879, 0x2001,
+	0x1a88, 0x2102, 0x2001, 0x0032, 0x080c, 0x1686, 0x080c, 0x6a4b,
+	0x00ee, 0x003e, 0x002e, 0x001e, 0x000e, 0x0005, 0x0006, 0x0016,
+	0x00e6, 0x2001, 0x1985, 0x2003, 0x0028, 0x2001, 0x1986, 0x2003,
+	0x0014, 0x2071, 0x196b, 0x701b, 0x0000, 0x701f, 0x07d0, 0x2001,
+	0x1987, 0x2009, 0x001e, 0x2102, 0x2001, 0x0017, 0x080c, 0xa879,
+	0x2001, 0x1a88, 0x2102, 0x2001, 0x0032, 0x080c, 0x1686, 0x00ee,
+	0x001e, 0x000e, 0x0005, 0x0096, 0x6060, 0x904d, 0x0110, 0x080c,
+	0x106c, 0x009e, 0x0005, 0x0005, 0x00c6, 0x0126, 0x2091, 0x8000,
+	0x080c, 0xab89, 0x0180, 0x2b08, 0x6112, 0x0ca9, 0x6023, 0x0001,
+	0x2900, 0x6016, 0x2009, 0x0033, 0x080c, 0xac7c, 0x9085, 0x0001,
+	0x012e, 0x00ce, 0x0005, 0x9006, 0x0cd8, 0x0096, 0x00e6, 0x00f6,
+	0x2071, 0x1800, 0x9186, 0x0015, 0x1500, 0x7090, 0x9086, 0x0018,
+	0x11e0, 0x6014, 0x2048, 0xaa3c, 0xd2e4, 0x1160, 0x2c78, 0x080c,
+	0x9743, 0x01d8, 0x707c, 0xaa50, 0x9206, 0x1160, 0x7080, 0xaa54,
+	0x9206, 0x1140, 0x6210, 0x00b6, 0x2258, 0xbaa0, 0x00be, 0x900e,
+	0x080c, 0x323e, 0x080c, 0xafee, 0x0020, 0x080c, 0xb5a6, 0x080c,
+	0xabdf, 0x00fe, 0x00ee, 0x009e, 0x0005, 0x7060, 0xaa54, 0x9206,
+	0x0d48, 0x0c80, 0x00c6, 0x0126, 0x2091, 0x8000, 0x080c, 0xab89,
+	0x0188, 0x2b08, 0x6112, 0x080c, 0xcccb, 0x6023, 0x0001, 0x2900,
+	0x6016, 0x2009, 0x004d, 0x080c, 0xac7c, 0x9085, 0x0001, 0x012e,
+	0x00ce, 0x0005, 0x9006, 0x0cd8, 0x00c6, 0x0126, 0x2091, 0x8000,
+	0x0016, 0x080c, 0xab89, 0x0180, 0x2b08, 0x6112, 0x080c, 0xcccb,
+	0x6023, 0x0001, 0x2900, 0x6016, 0x001e, 0x080c, 0xac7c, 0x9085,
+	0x0001, 0x012e, 0x00ce, 0x0005, 0x001e, 0x9006, 0x0cd0, 0x0016,
+	0x0026, 0x0036, 0x0046, 0x0056, 0x0066, 0x0096, 0x00e6, 0x00f6,
+	0x2071, 0x1800, 0x9186, 0x0015, 0x1568, 0x7190, 0x6014, 0x2048,
+	0xa814, 0x8003, 0x9106, 0x1530, 0x20e1, 0x0000, 0x2001, 0x199f,
+	0x2003, 0x0000, 0x6014, 0x2048, 0xa830, 0x20a8, 0x8906, 0x8006,
+	0x8007, 0x9094, 0x003f, 0x22e8, 0x9084, 0xffc0, 0x9080, 0x001b,
+	0x20a0, 0x2001, 0x199f, 0x0016, 0x200c, 0x080c, 0xd572, 0x001e,
+	0xa804, 0x9005, 0x0110, 0x2048, 0x0c38, 0x6014, 0x2048, 0xa867,
+	0x0103, 0x0010, 0x080c, 0xb5a6, 0x080c, 0xabdf, 0x00fe, 0x00ee,
+	0x009e, 0x006e, 0x005e, 0x004e, 0x003e, 0x002e, 0x001e, 0x0005,
+	0x0096, 0x00e6, 0x00f6, 0x2071, 0x1800, 0x9186, 0x0015, 0x11b8,
+	0x7090, 0x9086, 0x0004, 0x1198, 0x6014, 0x2048, 0x2c78, 0x080c,
+	0x9743, 0x01a8, 0x707c, 0xaa74, 0x9206, 0x1130, 0x7080, 0xaa78,
+	0x9206, 0x1110, 0x080c, 0x31ef, 0x080c, 0xafee, 0x0020, 0x080c,
+	0xb5a6, 0x080c, 0xabdf, 0x00fe, 0x00ee, 0x009e, 0x0005, 0x7060,
+	0xaa78, 0x9206, 0x0d78, 0x0c80, 0x0096, 0x00e6, 0x00f6, 0x2071,
+	0x1800, 0x9186, 0x0015, 0x1550, 0x7090, 0x9086, 0x0004, 0x1530,
+	0x6014, 0x2048, 0x2c78, 0x080c, 0x9743, 0x05f0, 0x707c, 0xaacc,
+	0x9206, 0x1180, 0x7080, 0xaad0, 0x9206, 0x1160, 0x080c, 0x31ef,
+	0x0016, 0xa998, 0xaab0, 0x9284, 0x1000, 0xc0fd, 0x080c, 0x568d,
+	0x001e, 0x0010, 0x080c, 0x5476, 0x080c, 0xc832, 0x0508, 0xa87b,
+	0x0000, 0xa883, 0x0000, 0xa897, 0x4000, 0x0080, 0x080c, 0xc832,
+	0x01b8, 0x6014, 0x2048, 0x080c, 0x5476, 0x1d70, 0xa87b, 0x0030,
+	0xa883, 0x0000, 0xa897, 0x4005, 0xa89b, 0x0004, 0x0126, 0x2091,
+	0x8000, 0xa867, 0x0139, 0x080c, 0x6d7b, 0x012e, 0x080c, 0xabdf,
+	0x00fe, 0x00ee, 0x009e, 0x0005, 0x7060, 0xaad0, 0x9206, 0x0930,
+	0x0888, 0x0016, 0x0026, 0xa87c, 0xd0ac, 0x0178, 0xa938, 0xaa34,
+	0x2100, 0x9205, 0x0150, 0xa890, 0x9106, 0x1118, 0xa88c, 0x9206,
+	0x0120, 0xa992, 0xaa8e, 0x9085, 0x0001, 0x002e, 0x001e, 0x0005,
+	0x00b6, 0x00d6, 0x0036, 0x080c, 0xc832, 0x0904, 0xce86, 0x0096,
+	0x6314, 0x2348, 0xa87a, 0xa982, 0x929e, 0x4000, 0x1580, 0x6310,
+	0x00c6, 0x2358, 0x2009, 0x0000, 0xa868, 0xd0f4, 0x1140, 0x080c,
+	0x6913, 0x1108, 0xc185, 0xb800, 0xd0bc, 0x0108, 0xc18d, 0xaa96,
+	0xa99a, 0x20a9, 0x0004, 0xa860, 0x20e8, 0xa85c, 0x9080, 0x0031,
+	0x20a0, 0xb8c4, 0x20e0, 0xb8c8, 0x9080, 0x0006, 0x2098, 0x080c,
+	0x0fb7, 0x20a9, 0x0004, 0xa85c, 0x9080, 0x0035, 0x20a0, 0xb8c8,
+	0x9080, 0x000a, 0x2098, 0x080c, 0x0fb7, 0x00ce, 0x0090, 0xaa96,
+	0x3918, 0x9398, 0x0007, 0x231c, 0x6004, 0x9086, 0x0016, 0x0110,
+	0xa89b, 0x0004, 0xaba2, 0x6310, 0x2358, 0xb804, 0x9084, 0x00ff,
+	0xa89e, 0x080c, 0x6d6f, 0x6017, 0x0000, 0x009e, 0x003e, 0x00de,
+	0x00be, 0x0005, 0x0026, 0x0036, 0x0046, 0x00b6, 0x0096, 0x00f6,
+	0x6214, 0x2248, 0x6210, 0x2258, 0x2079, 0x0260, 0x9096, 0x0000,
+	0x11a0, 0xb814, 0x9084, 0x00ff, 0x900e, 0x080c, 0x2614, 0x2118,
+	0x831f, 0x939c, 0xff00, 0x7838, 0x9084, 0x00ff, 0x931d, 0x7c3c,
+	0x2011, 0x8018, 0x080c, 0x4b09, 0x00a8, 0x9096, 0x0001, 0x1148,
+	0x89ff, 0x0180, 0xa89b, 0x000d, 0x7838, 0xa8a6, 0x783c, 0xa8aa,
+	0x0048, 0x9096, 0x0002, 0x1130, 0xa89b, 0x000d, 0x7838, 0xa8a6,
+	0x783c, 0xa8aa, 0x00fe, 0x009e, 0x00be, 0x004e, 0x003e, 0x002e,
+	0x0005, 0x00c6, 0x0026, 0x0016, 0x9186, 0x0035, 0x0110, 0x6a38,
+	0x0008, 0x6a2c, 0x080c, 0xc820, 0x01f0, 0x2260, 0x6120, 0x9186,
+	0x0003, 0x0118, 0x9186, 0x0006, 0x1190, 0x6838, 0x9206, 0x0140,
+	0x683c, 0x9206, 0x1160, 0x6108, 0x6838, 0x9106, 0x1140, 0x0020,
+	0x6008, 0x693c, 0x9106, 0x1118, 0x6010, 0x6910, 0x9106, 0x001e,
+	0x002e, 0x00ce, 0x0005, 0x9085, 0x0001, 0x0cc8, 0xa974, 0xd1cc,
+	0x0188, 0x918c, 0x00ff, 0x918e, 0x0002, 0x1160, 0xa9a8, 0x918c,
+	0x0f00, 0x810f, 0x918e, 0x0001, 0x1128, 0xa834, 0xa938, 0x9115,
+	0x190c, 0xbea6, 0x0005, 0x0036, 0x2019, 0x0001, 0x0010, 0x0036,
+	0x901e, 0x0499, 0x01e0, 0x080c, 0xc832, 0x01c8, 0x080c, 0xca21,
+	0x6037, 0x4000, 0x6014, 0x6017, 0x0000, 0x0096, 0x2048, 0xa87c,
+	0x080c, 0xca47, 0x1118, 0x080c, 0xb5a6, 0x0040, 0xa867, 0x0103,
+	0xa877, 0x0000, 0x83ff, 0x1129, 0x080c, 0x6d7b, 0x009e, 0x003e,
+	0x0005, 0xa880, 0xd0b4, 0x0128, 0xa87b, 0x0006, 0xc0ec, 0xa882,
+	0x0048, 0xd0bc, 0x0118, 0xa87b, 0x0002, 0x0020, 0xa87b, 0x0005,
+	0x080c, 0xcb3b, 0xa877, 0x0000, 0x0005, 0x2001, 0x1810, 0x2004,
+	0xd0ec, 0x0005, 0x0006, 0x2001, 0x1810, 0x2004, 0xd0f4, 0x000e,
+	0x0005, 0x0006, 0x2001, 0x1810, 0x2004, 0xd0e4, 0x000e, 0x0005,
+	0x0036, 0x0046, 0x6010, 0x00b6, 0x2058, 0xbba0, 0x00be, 0x2021,
+	0x0007, 0x080c, 0x4cc0, 0x004e, 0x003e, 0x0005, 0x0c51, 0x1d81,
+	0x0005, 0x2001, 0x1985, 0x2004, 0x601a, 0x0005, 0x2001, 0x1987,
+	0x2004, 0x604a, 0x0005, 0x080c, 0xabdf, 0x0804, 0x9684, 0x611c,
+	0xd1fc, 0xa97c, 0x1108, 0xd1e4, 0x0005, 0x601c, 0xd0fc, 0xa87c,
+	0x1108, 0xd0e4, 0x0005, 0x601c, 0xd0fc, 0xc0fc, 0x601e, 0xa87c,
+	0x1108, 0xd0e4, 0x0005, 0x6044, 0xd0fc, 0x1138, 0xd0bc, 0x0198,
+	0xc0bc, 0x6046, 0x6003, 0x0002, 0x0070, 0xd0ac, 0x1160, 0xd0dc,
 	0x1128, 0x908c, 0x000f, 0x9186, 0x0005, 0x1118, 0x6003, 0x0003,
 	0x0010, 0x6003, 0x0001, 0x0005, 0x00b6, 0x0066, 0x6000, 0x90b2,
-	0x0016, 0x1a0c, 0x0d7d, 0x001b, 0x006e, 0x00be, 0x0005, 0xcfb7,
-	0xd6c0, 0xd811, 0xcfb7, 0xcfb7, 0xcfb7, 0xcfb7, 0xcfb7, 0xcfee,
-	0xd893, 0xcfb7, 0xcfb7, 0xcfb7, 0xcfb7, 0xcfb7, 0xcfb7, 0x080c,
+	0x0016, 0x1a0c, 0x0d7d, 0x001b, 0x006e, 0x00be, 0x0005, 0xcfbf,
+	0xd6cd, 0xd81e, 0xcfbf, 0xcfbf, 0xcfbf, 0xcfbf, 0xcfbf, 0xcff6,
+	0xd8a2, 0xcfbf, 0xcfbf, 0xcfbf, 0xcfbf, 0xcfbf, 0xcfbf, 0x080c,
 	0x0d7d, 0x0066, 0x6000, 0x90b2, 0x0016, 0x1a0c, 0x0d7d, 0x0013,
-	0x006e, 0x0005, 0xcfd2, 0xddaa, 0xcfd2, 0xcfd2, 0xcfd2, 0xcfd2,
-	0xcfd2, 0xcfd2, 0xdd59, 0xddfc, 0xcfd2, 0xe453, 0xe487, 0xe453,
-	0xe487, 0xcfd2, 0x080c, 0x0d7d, 0x6000, 0x9082, 0x0016, 0x1a0c,
-	0x0d7d, 0x6000, 0x000a, 0x0005, 0xcfec, 0xda6f, 0xdb38, 0xdb5a,
-	0xdbd5, 0xcfec, 0xdccf, 0xdc5d, 0xd89d, 0xdd31, 0xdd46, 0xcfec,
-	0xcfec, 0xcfec, 0xcfec, 0xcfec, 0x080c, 0x0d7d, 0x91b2, 0x0053,
-	0x1a0c, 0x0d7d, 0x2100, 0x91b2, 0x0040, 0x1a04, 0xd436, 0x0002,
-	0xd038, 0xd227, 0xd038, 0xd038, 0xd038, 0xd230, 0xd038, 0xd038,
-	0xd038, 0xd038, 0xd038, 0xd038, 0xd038, 0xd038, 0xd038, 0xd038,
-	0xd038, 0xd038, 0xd038, 0xd038, 0xd038, 0xd038, 0xd038, 0xd03a,
-	0xd0a1, 0xd0b0, 0xd114, 0xd13f, 0xd1b8, 0xd212, 0xd038, 0xd038,
-	0xd233, 0xd038, 0xd038, 0xd248, 0xd255, 0xd038, 0xd038, 0xd038,
-	0xd038, 0xd038, 0xd2d8, 0xd038, 0xd038, 0xd2ec, 0xd038, 0xd038,
-	0xd2a7, 0xd038, 0xd038, 0xd038, 0xd304, 0xd038, 0xd038, 0xd038,
-	0xd381, 0xd038, 0xd038, 0xd038, 0xd038, 0xd038, 0xd038, 0xd3fe,
-	0x080c, 0x0d7d, 0x080c, 0x6a29, 0x1150, 0x2001, 0x1837, 0x2004,
+	0x006e, 0x0005, 0xcfda, 0xddb9, 0xcfda, 0xcfda, 0xcfda, 0xcfda,
+	0xcfda, 0xcfda, 0xdd68, 0xde0b, 0xcfda, 0xe463, 0xe497, 0xe463,
+	0xe497, 0xcfda, 0x080c, 0x0d7d, 0x6000, 0x9082, 0x0016, 0x1a0c,
+	0x0d7d, 0x6000, 0x000a, 0x0005, 0xcff4, 0xda7e, 0xdb47, 0xdb69,
+	0xdbe4, 0xcff4, 0xdcde, 0xdc6c, 0xd8ac, 0xdd40, 0xdd55, 0xcff4,
+	0xcff4, 0xcff4, 0xcff4, 0xcff4, 0x080c, 0x0d7d, 0x91b2, 0x0053,
+	0x1a0c, 0x0d7d, 0x2100, 0x91b2, 0x0040, 0x1a04, 0xd443, 0x0002,
+	0xd040, 0xd234, 0xd040, 0xd040, 0xd040, 0xd23d, 0xd040, 0xd040,
+	0xd040, 0xd040, 0xd040, 0xd040, 0xd040, 0xd040, 0xd040, 0xd040,
+	0xd040, 0xd040, 0xd040, 0xd040, 0xd040, 0xd040, 0xd040, 0xd042,
+	0xd0a9, 0xd0b8, 0xd11c, 0xd147, 0xd1c0, 0xd21f, 0xd040, 0xd040,
+	0xd240, 0xd040, 0xd040, 0xd255, 0xd262, 0xd040, 0xd040, 0xd040,
+	0xd040, 0xd040, 0xd2e5, 0xd040, 0xd040, 0xd2f9, 0xd040, 0xd040,
+	0xd2b4, 0xd040, 0xd040, 0xd040, 0xd311, 0xd040, 0xd040, 0xd040,
+	0xd38e, 0xd040, 0xd040, 0xd040, 0xd040, 0xd040, 0xd040, 0xd40b,
+	0x080c, 0x0d7d, 0x080c, 0x6a28, 0x1150, 0x2001, 0x1837, 0x2004,
 	0xd0cc, 0x1128, 0x9084, 0x0009, 0x9086, 0x0008, 0x1140, 0x6007,
-	0x0009, 0x602f, 0x0009, 0x6017, 0x0000, 0x0804, 0xd220, 0x080c,
-	0x69c5, 0x00e6, 0x00c6, 0x0036, 0x0026, 0x0016, 0x6210, 0x2258,
-	0xbaa0, 0x0026, 0x2019, 0x0029, 0x080c, 0xa896, 0x080c, 0x93a5,
-	0x0076, 0x903e, 0x080c, 0x9277, 0x2c08, 0x080c, 0xdfeb, 0x007e,
-	0x001e, 0x080c, 0xa8b2, 0x001e, 0x002e, 0x003e, 0x00ce, 0x00ee,
-	0x6610, 0x2658, 0x080c, 0x6634, 0xbe04, 0x9684, 0x00ff, 0x9082,
+	0x0009, 0x602f, 0x0009, 0x6017, 0x0000, 0x0804, 0xd22d, 0x080c,
+	0x69c4, 0x00e6, 0x00c6, 0x0036, 0x0026, 0x0016, 0x6210, 0x2258,
+	0xbaa0, 0x0026, 0x2019, 0x0029, 0x080c, 0xa888, 0x080c, 0x938d,
+	0x0076, 0x903e, 0x080c, 0x9256, 0x2c08, 0x080c, 0xdffb, 0x007e,
+	0x001e, 0x080c, 0xa8a4, 0x001e, 0x002e, 0x003e, 0x00ce, 0x00ee,
+	0x6610, 0x2658, 0x080c, 0x662f, 0xbe04, 0x9684, 0x00ff, 0x9082,
 	0x0006, 0x1268, 0x0016, 0x0026, 0x6210, 0x00b6, 0x2258, 0xbaa0,
-	0x00be, 0x2c08, 0x080c, 0xe6b0, 0x002e, 0x001e, 0x1178, 0x080c,
-	0xdf19, 0x1904, 0xd10c, 0x080c, 0xdeb5, 0x1120, 0x6007, 0x0008,
-	0x0804, 0xd220, 0x6007, 0x0009, 0x0804, 0xd220, 0x080c, 0xe14c,
-	0x0128, 0x080c, 0xdf19, 0x0d78, 0x0804, 0xd10c, 0x6017, 0x1900,
-	0x0c88, 0x080c, 0x3332, 0x1904, 0xd433, 0x6106, 0x080c, 0xde66,
-	0x6007, 0x0006, 0x0804, 0xd220, 0x6007, 0x0007, 0x0804, 0xd220,
-	0x080c, 0xe4c3, 0x1904, 0xd433, 0x080c, 0x3332, 0x1904, 0xd433,
+	0x00be, 0x2c08, 0x080c, 0xe6c0, 0x002e, 0x001e, 0x1178, 0x080c,
+	0xdf29, 0x1904, 0xd114, 0x080c, 0xdec5, 0x1120, 0x6007, 0x0008,
+	0x0804, 0xd22d, 0x6007, 0x0009, 0x0804, 0xd22d, 0x080c, 0xe15c,
+	0x0128, 0x080c, 0xdf29, 0x0d78, 0x0804, 0xd114, 0x6017, 0x1900,
+	0x0c88, 0x080c, 0x3326, 0x1904, 0xd440, 0x6106, 0x080c, 0xde76,
+	0x6007, 0x0006, 0x0804, 0xd22d, 0x6007, 0x0007, 0x0804, 0xd22d,
+	0x080c, 0xe4d3, 0x1904, 0xd440, 0x080c, 0x3326, 0x1904, 0xd440,
 	0x00d6, 0x6610, 0x2658, 0xbe04, 0x9684, 0x00ff, 0x9082, 0x0006,
-	0x1220, 0x2001, 0x0001, 0x080c, 0x6561, 0x96b4, 0xff00, 0x8637,
+	0x1220, 0x2001, 0x0001, 0x080c, 0x655c, 0x96b4, 0xff00, 0x8637,
 	0x9686, 0x0006, 0x0188, 0x9686, 0x0004, 0x0170, 0xbe04, 0x96b4,
 	0x00ff, 0x9686, 0x0006, 0x0140, 0x9686, 0x0004, 0x0128, 0x9686,
 	0x0005, 0x0110, 0x00de, 0x0480, 0x00e6, 0x2071, 0x0260, 0x7034,
 	0x9084, 0x0003, 0x1140, 0x7034, 0x9082, 0x0014, 0x0220, 0x7030,
 	0x9084, 0x0003, 0x0130, 0x00ee, 0x6017, 0x0000, 0x602f, 0x0007,
-	0x00b0, 0x00ee, 0x080c, 0xdf81, 0x1190, 0x9686, 0x0006, 0x1140,
-	0x0026, 0x6210, 0x2258, 0xbaa0, 0x900e, 0x080c, 0x323c, 0x002e,
-	0x080c, 0x66c0, 0x6007, 0x000a, 0x00de, 0x0804, 0xd220, 0x6007,
-	0x000b, 0x00de, 0x0804, 0xd220, 0x080c, 0x31e7, 0x080c, 0xcf67,
-	0x6007, 0x0001, 0x0804, 0xd220, 0x080c, 0xe4c3, 0x1904, 0xd433,
-	0x080c, 0x3332, 0x1904, 0xd433, 0x2071, 0x0260, 0x7034, 0x90b4,
+	0x00b0, 0x00ee, 0x080c, 0xdf91, 0x1190, 0x9686, 0x0006, 0x1140,
+	0x0026, 0x6210, 0x2258, 0xbaa0, 0x900e, 0x080c, 0x323e, 0x002e,
+	0x080c, 0x66bb, 0x6007, 0x000a, 0x00de, 0x0804, 0xd22d, 0x6007,
+	0x000b, 0x00de, 0x0804, 0xd22d, 0x080c, 0x31ef, 0x080c, 0xcf66,
+	0x6007, 0x0001, 0x0804, 0xd22d, 0x080c, 0xe4d3, 0x1904, 0xd440,
+	0x080c, 0x3326, 0x1904, 0xd440, 0x2071, 0x0260, 0x7034, 0x90b4,
 	0x0003, 0x1948, 0x90b2, 0x0014, 0x0a30, 0x7030, 0x9084, 0x0003,
 	0x1910, 0x6610, 0x2658, 0xbe04, 0x9686, 0x0707, 0x09e8, 0x0026,
-	0x6210, 0x2258, 0xbaa0, 0x900e, 0x080c, 0x323c, 0x002e, 0x6007,
-	0x000c, 0x2001, 0x0001, 0x080c, 0xe690, 0x0804, 0xd220, 0x080c,
-	0x6a29, 0x1140, 0x2001, 0x1837, 0x2004, 0x9084, 0x0009, 0x9086,
-	0x0008, 0x1110, 0x0804, 0xd047, 0x080c, 0x69c5, 0x6610, 0x2658,
+	0x6210, 0x2258, 0xbaa0, 0x900e, 0x080c, 0x323e, 0x002e, 0x6007,
+	0x000c, 0x2001, 0x0001, 0x080c, 0xe6a0, 0x0804, 0xd22d, 0x080c,
+	0x6a28, 0x1140, 0x2001, 0x1837, 0x2004, 0x9084, 0x0009, 0x9086,
+	0x0008, 0x1110, 0x0804, 0xd04f, 0x080c, 0x69c4, 0x6610, 0x2658,
 	0xbe04, 0x9684, 0x00ff, 0x9082, 0x0006, 0x06c8, 0x1138, 0x0026,
-	0x2001, 0x0006, 0x080c, 0x65a1, 0x002e, 0x0050, 0x96b4, 0xff00,
-	0x8637, 0x9686, 0x0004, 0x0120, 0x9686, 0x0006, 0x1904, 0xd10c,
-	0x080c, 0xdf8e, 0x1120, 0x6007, 0x000e, 0x0804, 0xd220, 0x0046,
-	0x6410, 0x2458, 0xbca0, 0x0046, 0x080c, 0x31e7, 0x080c, 0xcf67,
+	0x2001, 0x0006, 0x080c, 0x659c, 0x002e, 0x0050, 0x96b4, 0xff00,
+	0x8637, 0x9686, 0x0004, 0x0120, 0x9686, 0x0006, 0x1904, 0xd114,
+	0x080c, 0xdf9e, 0x1120, 0x6007, 0x000e, 0x0804, 0xd22d, 0x0046,
+	0x6410, 0x2458, 0xbca0, 0x0046, 0x080c, 0x31ef, 0x080c, 0xcf66,
 	0x004e, 0x0016, 0x9006, 0x2009, 0x1848, 0x210c, 0xd1a4, 0x0148,
-	0x2009, 0x0029, 0x080c, 0xe2c9, 0x6010, 0x2058, 0xb800, 0xc0e5,
-	0xb802, 0x001e, 0x004e, 0x6007, 0x0001, 0x0804, 0xd220, 0x2001,
-	0x0001, 0x080c, 0x6561, 0x0156, 0x0016, 0x0026, 0x0036, 0x20a9,
-	0x0004, 0x2019, 0x1805, 0x2011, 0x0270, 0x080c, 0xbbae, 0x003e,
+	0x2009, 0x0029, 0x080c, 0xe2d9, 0x6010, 0x2058, 0xb800, 0xc0e5,
+	0xb802, 0x001e, 0x004e, 0x6007, 0x0001, 0x0804, 0xd22d, 0x2001,
+	0x0001, 0x080c, 0x655c, 0x0156, 0x0016, 0x0026, 0x0036, 0x20a9,
+	0x0004, 0x2019, 0x1805, 0x2011, 0x0270, 0x080c, 0xbba1, 0x003e,
 	0x002e, 0x001e, 0x015e, 0x9005, 0x0168, 0x96b4, 0xff00, 0x8637,
-	0x9682, 0x0004, 0x0a04, 0xd10c, 0x9682, 0x0007, 0x0a04, 0xd168,
-	0x0804, 0xd10c, 0x6017, 0x1900, 0x6007, 0x0009, 0x0804, 0xd220,
-	0x080c, 0x6a29, 0x1140, 0x2001, 0x1837, 0x2004, 0x9084, 0x0009,
-	0x9086, 0x0008, 0x1110, 0x0804, 0xd047, 0x080c, 0x69c5, 0x6610,
-	0x2658, 0xbe04, 0x9684, 0x00ff, 0x9082, 0x0006, 0x0698, 0x0150,
-	0x96b4, 0xff00, 0x8637, 0x9686, 0x0004, 0x0120, 0x9686, 0x0006,
-	0x1904, 0xd10c, 0x080c, 0xdfbc, 0x1130, 0x080c, 0xdeb5, 0x1118,
-	0x6007, 0x0010, 0x04e8, 0x0046, 0x6410, 0x2458, 0xbca0, 0x0046,
-	0x080c, 0x31e7, 0x080c, 0xcf67, 0x004e, 0x0016, 0x9006, 0x2009,
-	0x1848, 0x210c, 0xd1a4, 0x0148, 0x2009, 0x0029, 0x080c, 0xe2c9,
-	0x6010, 0x2058, 0xb800, 0xc0e5, 0xb802, 0x001e, 0x004e, 0x6007,
-	0x0001, 0x00f0, 0x080c, 0xe14c, 0x0140, 0x96b4, 0xff00, 0x8637,
-	0x9686, 0x0006, 0x0978, 0x0804, 0xd10c, 0x6017, 0x1900, 0x6007,
-	0x0009, 0x0070, 0x080c, 0x3332, 0x1904, 0xd433, 0x080c, 0xe4c3,
-	0x1904, 0xd433, 0x080c, 0xd600, 0x1904, 0xd10c, 0x6007, 0x0012,
-	0x6003, 0x0001, 0x080c, 0x9225, 0x080c, 0x96a0, 0x0005, 0x6007,
-	0x0001, 0x6003, 0x0001, 0x080c, 0x9225, 0x080c, 0x96a0, 0x0cb0,
-	0x6007, 0x0005, 0x0c68, 0x080c, 0xe4c3, 0x1904, 0xd433, 0x080c,
-	0x3332, 0x1904, 0xd433, 0x080c, 0xd600, 0x1904, 0xd10c, 0x6007,
-	0x0020, 0x6003, 0x0001, 0x080c, 0x9225, 0x080c, 0x96a0, 0x0005,
-	0x080c, 0x3332, 0x1904, 0xd433, 0x6007, 0x0023, 0x6003, 0x0001,
-	0x080c, 0x9225, 0x080c, 0x96a0, 0x0005, 0x080c, 0xe4c3, 0x1904,
-	0xd433, 0x080c, 0x3332, 0x1904, 0xd433, 0x080c, 0xd600, 0x1904,
-	0xd10c, 0x0016, 0x0026, 0x00e6, 0x2071, 0x0260, 0x7244, 0x9286,
-	0xffff, 0x0180, 0x2c08, 0x080c, 0xc826, 0x01b0, 0x2260, 0x7240,
-	0x6008, 0x9206, 0x1188, 0x6010, 0x9190, 0x0004, 0x2214, 0x9206,
-	0x01b8, 0x0050, 0x7240, 0x2c08, 0x9006, 0x080c, 0xe293, 0x1180,
-	0x7244, 0x9286, 0xffff, 0x01b0, 0x2160, 0x6007, 0x0026, 0x6017,
-	0x1700, 0x7214, 0x9296, 0xffff, 0x1180, 0x6007, 0x0025, 0x0068,
-	0x6020, 0x9086, 0x0007, 0x1d80, 0x6004, 0x9086, 0x0024, 0x1110,
-	0x080c, 0xabed, 0x2160, 0x6007, 0x0025, 0x6003, 0x0001, 0x080c,
-	0x9225, 0x080c, 0x96a0, 0x00ee, 0x002e, 0x001e, 0x0005, 0x2001,
-	0x0001, 0x080c, 0x6561, 0x0156, 0x0016, 0x0026, 0x0036, 0x20a9,
-	0x0004, 0x2019, 0x1805, 0x2011, 0x0276, 0x080c, 0xbbae, 0x003e,
-	0x002e, 0x001e, 0x015e, 0x0120, 0x6007, 0x0031, 0x0804, 0xd220,
-	0x080c, 0xb81f, 0x080c, 0x74e9, 0x1190, 0x0006, 0x0026, 0x0036,
-	0x080c, 0x7503, 0x1138, 0x080c, 0x77ed, 0x080c, 0x6029, 0x080c,
-	0x741a, 0x0010, 0x080c, 0x74bd, 0x003e, 0x002e, 0x000e, 0x0005,
-	0x080c, 0x3332, 0x1904, 0xd433, 0x080c, 0xd600, 0x1904, 0xd10c,
-	0x6106, 0x080c, 0xd61c, 0x1120, 0x6007, 0x002b, 0x0804, 0xd220,
-	0x6007, 0x002c, 0x0804, 0xd220, 0x080c, 0xe4c3, 0x1904, 0xd433,
-	0x080c, 0x3332, 0x1904, 0xd433, 0x080c, 0xd600, 0x1904, 0xd10c,
-	0x6106, 0x080c, 0xd621, 0x1120, 0x6007, 0x002e, 0x0804, 0xd220,
-	0x6007, 0x002f, 0x0804, 0xd220, 0x080c, 0x3332, 0x1904, 0xd433,
-	0x00e6, 0x00d6, 0x00c6, 0x6010, 0x2058, 0xb904, 0x9184, 0x00ff,
-	0x9086, 0x0006, 0x0158, 0x9184, 0xff00, 0x8007, 0x9086, 0x0006,
-	0x0128, 0x00ce, 0x00de, 0x00ee, 0x0804, 0xd227, 0x080c, 0x56de,
-	0xd0e4, 0x0904, 0xd37e, 0x2071, 0x026c, 0x7010, 0x603a, 0x7014,
-	0x603e, 0x7108, 0x720c, 0x080c, 0x6a67, 0x0140, 0x6010, 0x2058,
-	0xb810, 0x9106, 0x1118, 0xb814, 0x9206, 0x0510, 0x080c, 0x6a63,
-	0x15b8, 0x2069, 0x1800, 0x6880, 0x9206, 0x1590, 0x687c, 0x9106,
-	0x1578, 0x7210, 0x080c, 0xc826, 0x0590, 0x080c, 0xd4eb, 0x0578,
-	0x080c, 0xe345, 0x0560, 0x622e, 0x6007, 0x0036, 0x6003, 0x0001,
-	0x2009, 0x8020, 0x080c, 0x921e, 0x00ce, 0x00de, 0x00ee, 0x0005,
-	0x7214, 0x9286, 0xffff, 0x0150, 0x080c, 0xc826, 0x01c0, 0x9280,
-	0x0002, 0x2004, 0x7110, 0x9106, 0x1190, 0x08e0, 0x7210, 0x2c08,
-	0x9085, 0x0001, 0x080c, 0xe293, 0x2c10, 0x2160, 0x0140, 0x0890,
-	0x6007, 0x0037, 0x602f, 0x0009, 0x6017, 0x1500, 0x08b8, 0x6007,
-	0x0037, 0x602f, 0x0003, 0x6017, 0x1700, 0x0880, 0x6007, 0x0012,
-	0x0868, 0x080c, 0x3332, 0x1904, 0xd433, 0x6010, 0x2058, 0xb804,
-	0x9084, 0xff00, 0x8007, 0x9086, 0x0006, 0x1904, 0xd227, 0x00e6,
-	0x00d6, 0x00c6, 0x080c, 0x56de, 0xd0e4, 0x0904, 0xd3f6, 0x2069,
-	0x1800, 0x2071, 0x026c, 0x7008, 0x603a, 0x720c, 0x623e, 0x9286,
-	0xffff, 0x1150, 0x7208, 0x00c6, 0x2c08, 0x9085, 0x0001, 0x080c,
-	0xe293, 0x2c10, 0x00ce, 0x05e8, 0x080c, 0xc826, 0x05d0, 0x7108,
-	0x9280, 0x0002, 0x2004, 0x9106, 0x15a0, 0x00c6, 0x0026, 0x2260,
-	0x080c, 0xc436, 0x002e, 0x00ce, 0x7118, 0x918c, 0xff00, 0x810f,
-	0x9186, 0x0001, 0x0178, 0x9186, 0x0005, 0x0118, 0x9186, 0x0007,
-	0x1198, 0x9280, 0x0005, 0x2004, 0x9005, 0x0170, 0x080c, 0xd4eb,
-	0x0904, 0xd377, 0x0056, 0x7510, 0x7614, 0x080c, 0xe35e, 0x005e,
-	0x00ce, 0x00de, 0x00ee, 0x0005, 0x6007, 0x003b, 0x602f, 0x0009,
-	0x6017, 0x2a00, 0x6003, 0x0001, 0x2009, 0x8020, 0x080c, 0x921e,
-	0x0c78, 0x6007, 0x003b, 0x602f, 0x0003, 0x6017, 0x0300, 0x6003,
-	0x0001, 0x2009, 0x8020, 0x080c, 0x921e, 0x0c10, 0x6007, 0x003b,
-	0x602f, 0x000b, 0x6017, 0x0000, 0x0804, 0xd34e, 0x00e6, 0x0026,
-	0x080c, 0x6a29, 0x0550, 0x080c, 0x69c5, 0x080c, 0xe535, 0x1518,
-	0x2071, 0x1800, 0x70dc, 0x9085, 0x0003, 0x70de, 0x00f6, 0x2079,
-	0x0100, 0x72b0, 0x9284, 0x00ff, 0x707e, 0x78e6, 0x9284, 0xff00,
-	0x7280, 0x9205, 0x7082, 0x78ea, 0x00fe, 0x70e7, 0x0000, 0x080c,
-	0x6a67, 0x0120, 0x2011, 0x1a09, 0x2013, 0x07d0, 0xd0ac, 0x1128,
-	0x080c, 0x2fb2, 0x0010, 0x080c, 0xe567, 0x002e, 0x00ee, 0x080c,
-	0xabed, 0x0804, 0xd226, 0x080c, 0xabed, 0x0005, 0x2600, 0x0002,
-	0xd44a, 0xd47b, 0xd48c, 0xd44a, 0xd44a, 0xd44c, 0xd49d, 0xd44a,
-	0xd44a, 0xd44a, 0xd469, 0xd44a, 0xd44a, 0xd44a, 0xd4a8, 0xd4b5,
-	0xd4e6, 0xd44a, 0x080c, 0x0d7d, 0x080c, 0xe4c3, 0x1d20, 0x080c,
-	0x3332, 0x1d08, 0x080c, 0xd600, 0x1148, 0x7038, 0x6016, 0x6007,
-	0x0045, 0x6003, 0x0001, 0x080c, 0x9225, 0x0005, 0x080c, 0x31e7,
-	0x080c, 0xcf67, 0x6007, 0x0001, 0x6003, 0x0001, 0x080c, 0x9225,
-	0x0005, 0x080c, 0xe4c3, 0x1938, 0x080c, 0x3332, 0x1920, 0x080c,
-	0xd600, 0x1d60, 0x703c, 0x6016, 0x6007, 0x004a, 0x6003, 0x0001,
-	0x080c, 0x9225, 0x0005, 0x080c, 0x3332, 0x1904, 0xd433, 0x2009,
-	0x0041, 0x080c, 0xe570, 0x6007, 0x0047, 0x6003, 0x0001, 0x080c,
-	0x9225, 0x080c, 0x96a0, 0x0005, 0x080c, 0x3332, 0x1904, 0xd433,
-	0x2009, 0x0042, 0x080c, 0xe570, 0x6007, 0x0047, 0x6003, 0x0001,
-	0x080c, 0x9225, 0x080c, 0x96a0, 0x0005, 0x080c, 0x3332, 0x1904,
-	0xd433, 0x2009, 0x0046, 0x080c, 0xe570, 0x080c, 0xabed, 0x0005,
-	0x080c, 0xd508, 0x0904, 0xd433, 0x6007, 0x004e, 0x6003, 0x0001,
-	0x080c, 0x9225, 0x080c, 0x96a0, 0x0005, 0x6007, 0x004f, 0x6017,
-	0x0000, 0x7134, 0x918c, 0x00ff, 0x81ff, 0x0508, 0x9186, 0x0001,
-	0x1160, 0x7140, 0x2001, 0x19bd, 0x2004, 0x9106, 0x11b0, 0x7144,
-	0x2001, 0x19be, 0x2004, 0x9106, 0x0190, 0x9186, 0x0002, 0x1168,
-	0x2011, 0x0276, 0x20a9, 0x0004, 0x6010, 0x0096, 0x2048, 0x2019,
-	0x000a, 0x080c, 0xbbc2, 0x009e, 0x0110, 0x6017, 0x0001, 0x6003,
-	0x0001, 0x080c, 0x9225, 0x080c, 0x96a0, 0x0005, 0x6007, 0x0050,
-	0x703c, 0x6016, 0x0ca0, 0x0016, 0x00e6, 0x2071, 0x0260, 0x00b6,
-	0x00c6, 0x2260, 0x6010, 0x2058, 0xb8d4, 0xd084, 0x0150, 0x7128,
-	0x6050, 0x9106, 0x1120, 0x712c, 0x604c, 0x9106, 0x0110, 0x9006,
-	0x0010, 0x9085, 0x0001, 0x00ce, 0x00be, 0x00ee, 0x001e, 0x0005,
-	0x0016, 0x0096, 0x0086, 0x00e6, 0x01c6, 0x01d6, 0x0126, 0x2091,
-	0x8000, 0x2071, 0x1800, 0x7090, 0x908a, 0x00f9, 0x16e8, 0x20e1,
-	0x0000, 0x2001, 0x19a0, 0x2003, 0x0000, 0x080c, 0x1053, 0x05a0,
-	0x2900, 0x6016, 0x7090, 0x8004, 0xa816, 0x908a, 0x001e, 0x02d0,
-	0xa833, 0x001e, 0x20a9, 0x001e, 0xa860, 0x20e8, 0xa85c, 0x9080,
-	0x001b, 0x20a0, 0x2001, 0x19a0, 0x0016, 0x200c, 0x0471, 0x001e,
-	0x2940, 0x080c, 0x1053, 0x01c0, 0x2900, 0xa006, 0x2100, 0x81ff,
-	0x0180, 0x0c18, 0xa832, 0x20a8, 0xa860, 0x20e8, 0xa85c, 0x9080,
-	0x001b, 0x20a0, 0x2001, 0x19a0, 0x0016, 0x200c, 0x00b1, 0x001e,
-	0x0000, 0x9085, 0x0001, 0x0048, 0x2071, 0x1800, 0x7093, 0x0000,
-	0x6014, 0x2048, 0x080c, 0x0fec, 0x9006, 0x012e, 0x01de, 0x01ce,
-	0x00ee, 0x008e, 0x009e, 0x001e, 0x0005, 0x0006, 0x0016, 0x0026,
-	0x0036, 0x00c6, 0x918c, 0xffff, 0x11a8, 0x080c, 0x2189, 0x2099,
-	0x026c, 0x2001, 0x0014, 0x3518, 0x9312, 0x1218, 0x23a8, 0x4003,
-	0x00f8, 0x20a8, 0x4003, 0x22a8, 0x8108, 0x080c, 0x2189, 0x2099,
-	0x0260, 0x0ca8, 0x080c, 0x2189, 0x2061, 0x19a0, 0x6004, 0x2098,
-	0x6008, 0x3518, 0x9312, 0x1218, 0x23a8, 0x4003, 0x0048, 0x20a8,
-	0x4003, 0x22a8, 0x8108, 0x080c, 0x2189, 0x2099, 0x0260, 0x0ca8,
-	0x2061, 0x19a0, 0x2019, 0x0280, 0x3300, 0x931e, 0x0110, 0x6006,
-	0x0020, 0x2001, 0x0260, 0x6006, 0x8108, 0x2162, 0x9292, 0x0021,
-	0x9296, 0xffff, 0x620a, 0x00ce, 0x003e, 0x002e, 0x001e, 0x000e,
-	0x0005, 0x0006, 0x0016, 0x0026, 0x0036, 0x00c6, 0x81ff, 0x11b8,
-	0x080c, 0x21a1, 0x20a1, 0x024c, 0x2001, 0x0014, 0x3518, 0x9312,
-	0x1218, 0x23a8, 0x4003, 0x0418, 0x20a8, 0x4003, 0x82ff, 0x01f8,
-	0x22a8, 0x8108, 0x080c, 0x21a1, 0x20a1, 0x0240, 0x0c98, 0x080c,
-	0x21a1, 0x2061, 0x19a3, 0x6004, 0x20a0, 0x6008, 0x3518, 0x9312,
-	0x1218, 0x23a8, 0x4003, 0x0058, 0x20a8, 0x4003, 0x82ff, 0x0138,
-	0x22a8, 0x8108, 0x080c, 0x21a1, 0x20a1, 0x0240, 0x0c98, 0x2061,
-	0x19a3, 0x2019, 0x0260, 0x3400, 0x931e, 0x0110, 0x6006, 0x0020,
-	0x2001, 0x0240, 0x6006, 0x8108, 0x2162, 0x9292, 0x0021, 0x9296,
-	0xffff, 0x620a, 0x00ce, 0x003e, 0x002e, 0x001e, 0x000e, 0x0005,
-	0x00b6, 0x0066, 0x6610, 0x2658, 0xbe04, 0x96b4, 0xff00, 0x8637,
-	0x9686, 0x0006, 0x0170, 0x9686, 0x0004, 0x0158, 0xbe04, 0x96b4,
-	0x00ff, 0x9686, 0x0006, 0x0128, 0x9686, 0x0004, 0x0110, 0x9085,
-	0x0001, 0x006e, 0x00be, 0x0005, 0x00d6, 0x080c, 0xd696, 0x00de,
-	0x0005, 0x00d6, 0x080c, 0xd6a3, 0x1520, 0x680c, 0x908c, 0xff00,
-	0x6820, 0x9084, 0x00ff, 0x9115, 0x6216, 0x6824, 0x602e, 0xd1e4,
-	0x0130, 0x9006, 0x080c, 0xe690, 0x2009, 0x0001, 0x0078, 0xd1ec,
-	0x0180, 0x6920, 0x918c, 0x00ff, 0x6824, 0x080c, 0x25fb, 0x1148,
-	0x2001, 0x0001, 0x080c, 0xe690, 0x2110, 0x900e, 0x080c, 0x323c,
-	0x0018, 0x9085, 0x0001, 0x0008, 0x9006, 0x00de, 0x0005, 0x00b6,
-	0x00c6, 0x080c, 0xac5f, 0x0598, 0x0016, 0x0026, 0x00c6, 0x2011,
-	0x0263, 0x2204, 0x8211, 0x220c, 0x080c, 0x25fb, 0x1568, 0x080c,
-	0x65c4, 0x1550, 0xbe12, 0xbd16, 0x00ce, 0x002e, 0x001e, 0x2b00,
-	0x6012, 0x080c, 0xe4c3, 0x11c8, 0x080c, 0x3332, 0x11b0, 0x080c,
-	0xd600, 0x0500, 0x2001, 0x0007, 0x080c, 0x6575, 0x2001, 0x0007,
-	0x080c, 0x65a1, 0x6017, 0x0000, 0x6023, 0x0001, 0x6007, 0x0001,
-	0x6003, 0x0001, 0x080c, 0x9225, 0x0010, 0x080c, 0xabed, 0x9085,
-	0x0001, 0x00ce, 0x00be, 0x0005, 0x080c, 0xabed, 0x00ce, 0x002e,
-	0x001e, 0x0ca8, 0x080c, 0xabed, 0x9006, 0x0c98, 0x2069, 0x026d,
-	0x6800, 0x9082, 0x0010, 0x1228, 0x6017, 0x0000, 0x9085, 0x0001,
-	0x0008, 0x9006, 0x0005, 0x6017, 0x0000, 0x2069, 0x026c, 0x6808,
-	0x9084, 0xff00, 0x9086, 0x0800, 0x1190, 0x6904, 0x9186, 0x0018,
-	0x0118, 0x9186, 0x0014, 0x1158, 0x810f, 0x6800, 0x9084, 0x00ff,
-	0x910d, 0x6162, 0x908e, 0x0014, 0x0110, 0x908e, 0x0010, 0x0005,
-	0x6004, 0x90b2, 0x0053, 0x1a0c, 0x0d7d, 0x91b6, 0x0013, 0x1130,
-	0x2008, 0x91b2, 0x0040, 0x1a04, 0xd7e5, 0x0092, 0x91b6, 0x0027,
-	0x0120, 0x91b6, 0x0014, 0x190c, 0x0d7d, 0x2001, 0x0007, 0x080c,
-	0x65a1, 0x080c, 0x95de, 0x080c, 0xac28, 0x080c, 0x96a0, 0x0005,
-	0xd720, 0xd722, 0xd720, 0xd720, 0xd720, 0xd722, 0xd72f, 0xd7e2,
-	0xd77f, 0xd7e2, 0xd793, 0xd7e2, 0xd72f, 0xd7e2, 0xd7da, 0xd7e2,
-	0xd7da, 0xd7e2, 0xd7e2, 0xd720, 0xd720, 0xd720, 0xd720, 0xd720,
-	0xd720, 0xd720, 0xd720, 0xd720, 0xd720, 0xd720, 0xd722, 0xd720,
-	0xd7e2, 0xd720, 0xd720, 0xd7e2, 0xd720, 0xd7df, 0xd7e2, 0xd720,
-	0xd720, 0xd720, 0xd720, 0xd7e2, 0xd7e2, 0xd720, 0xd7e2, 0xd7e2,
-	0xd720, 0xd72a, 0xd720, 0xd720, 0xd720, 0xd720, 0xd7de, 0xd7e2,
-	0xd720, 0xd720, 0xd7e2, 0xd7e2, 0xd720, 0xd720, 0xd720, 0xd720,
-	0x080c, 0x0d7d, 0x080c, 0xcf6a, 0x6003, 0x0002, 0x080c, 0x96a0,
-	0x0804, 0xd7e4, 0x9006, 0x080c, 0x6561, 0x0804, 0xd7e2, 0x080c,
-	0x6a63, 0x1904, 0xd7e2, 0x9006, 0x080c, 0x6561, 0x6010, 0x2058,
-	0xb810, 0x9086, 0x00ff, 0x1140, 0x00f6, 0x2079, 0x1800, 0x78a8,
-	0x8000, 0x78aa, 0x00fe, 0x0428, 0x6010, 0x2058, 0xb884, 0x9005,
-	0x1178, 0x080c, 0xcf52, 0x1904, 0xd7e2, 0x0036, 0x0046, 0xbba0,
-	0x2021, 0x0007, 0x080c, 0x4cbe, 0x004e, 0x003e, 0x0804, 0xd7e2,
-	0x080c, 0x3363, 0x1904, 0xd7e2, 0x2001, 0x1800, 0x2004, 0x9086,
-	0x0002, 0x1138, 0x00f6, 0x2079, 0x1800, 0x78a8, 0x8000, 0x78aa,
-	0x00fe, 0x2001, 0x0002, 0x080c, 0x6575, 0x6023, 0x0001, 0x6003,
-	0x0001, 0x6007, 0x0002, 0x080c, 0x9225, 0x080c, 0x96a0, 0x6110,
-	0x2158, 0x2009, 0x0001, 0x080c, 0x864c, 0x0804, 0xd7e4, 0x6610,
-	0x2658, 0xbe04, 0x96b4, 0xff00, 0x8637, 0x9686, 0x0006, 0x0904,
-	0xd7e2, 0x9686, 0x0004, 0x0904, 0xd7e2, 0x080c, 0x8eca, 0x2001,
-	0x0004, 0x0804, 0xd7e0, 0x2001, 0x1800, 0x2004, 0x9086, 0x0003,
-	0x1158, 0x0036, 0x0046, 0x6010, 0x2058, 0xbba0, 0x2021, 0x0006,
-	0x080c, 0x4cbe, 0x004e, 0x003e, 0x2001, 0x0006, 0x080c, 0xd7fe,
-	0x6610, 0x2658, 0xbe04, 0x0066, 0x96b4, 0xff00, 0x8637, 0x9686,
-	0x0006, 0x006e, 0x0168, 0x2001, 0x0006, 0x080c, 0x65a1, 0x9284,
-	0x00ff, 0x908e, 0x0007, 0x1120, 0x2001, 0x0006, 0x080c, 0x6575,
-	0x080c, 0x6a63, 0x11f8, 0x2001, 0x1837, 0x2004, 0xd0a4, 0x01d0,
-	0xbe04, 0x96b4, 0x00ff, 0x9686, 0x0006, 0x01a0, 0x00f6, 0x2079,
-	0x1800, 0x78a8, 0x8000, 0x78aa, 0x00fe, 0x0804, 0xd769, 0x2001,
-	0x0004, 0x0030, 0x2001, 0x0006, 0x0409, 0x0020, 0x0018, 0x0010,
-	0x080c, 0x65a1, 0x080c, 0xabed, 0x0005, 0x2600, 0x0002, 0xd7f9,
-	0xd7f9, 0xd7f9, 0xd7f9, 0xd7f9, 0xd7fb, 0xd7f9, 0xd7fb, 0xd7f9,
-	0xd7f9, 0xd7fb, 0xd7f9, 0xd7f9, 0xd7f9, 0xd7fb, 0xd7fb, 0xd7fb,
-	0xd7fb, 0x080c, 0x0d7d, 0x080c, 0xabed, 0x0005, 0x0016, 0x00b6,
-	0x00d6, 0x6110, 0x2158, 0xb900, 0xd184, 0x0138, 0x080c, 0x6575,
-	0x9006, 0x080c, 0x6561, 0x080c, 0x321c, 0x00de, 0x00be, 0x001e,
-	0x0005, 0x6610, 0x2658, 0xb804, 0x9084, 0xff00, 0x8007, 0x90b2,
-	0x000c, 0x1a0c, 0x0d7d, 0x91b6, 0x0015, 0x1110, 0x003b, 0x0028,
-	0x91b6, 0x0016, 0x190c, 0x0d7d, 0x006b, 0x0005, 0xb69e, 0xb69e,
-	0xb69e, 0xb69e, 0xb69e, 0xb69e, 0xd87d, 0xd83e, 0xb69e, 0xb69e,
-	0xb69e, 0xb69e, 0xb69e, 0xb69e, 0xb69e, 0xb69e, 0xb69e, 0xb69e,
-	0xd87d, 0xd884, 0xb69e, 0xb69e, 0xb69e, 0xb69e, 0x00f6, 0x080c,
-	0x6a63, 0x11d8, 0x080c, 0xcf52, 0x11c0, 0x6010, 0x905d, 0x01a8,
-	0xb884, 0x9005, 0x0190, 0x9006, 0x080c, 0x6561, 0x2001, 0x0002,
-	0x080c, 0x6575, 0x6023, 0x0001, 0x6003, 0x0001, 0x6007, 0x0002,
-	0x080c, 0x9225, 0x080c, 0x96a0, 0x00f0, 0x2011, 0x0263, 0x2204,
-	0x8211, 0x220c, 0x080c, 0x25fb, 0x11b0, 0x080c, 0x6625, 0x0118,
-	0x080c, 0xabed, 0x0080, 0xb810, 0x0006, 0xb814, 0x0006, 0xb884,
-	0x0006, 0x080c, 0x6043, 0x000e, 0xb886, 0x000e, 0xb816, 0x000e,
-	0xb812, 0x080c, 0xabed, 0x00fe, 0x0005, 0x6604, 0x96b6, 0x001e,
-	0x1110, 0x080c, 0xabed, 0x0005, 0x080c, 0xba27, 0x1148, 0x6003,
-	0x0001, 0x6007, 0x0001, 0x080c, 0x9225, 0x080c, 0x96a0, 0x0010,
-	0x080c, 0xabed, 0x0005, 0x6004, 0x908a, 0x0053, 0x1a0c, 0x0d7d,
-	0x080c, 0x95de, 0x080c, 0xac28, 0x0005, 0x9182, 0x0040, 0x0002,
-	0xd8b3, 0xd8b3, 0xd8b3, 0xd8b3, 0xd8b5, 0xd8b3, 0xd8b3, 0xd8b3,
-	0xd8b3, 0xd8b3, 0xd8b3, 0xd8b3, 0xd8b3, 0xd8b3, 0xd8b3, 0xd8b3,
-	0xd8b3, 0xd8b3, 0xd8b3, 0x080c, 0x0d7d, 0x0096, 0x00b6, 0x00d6,
-	0x00e6, 0x00f6, 0x0046, 0x0026, 0x6210, 0x2258, 0xb8bc, 0x9005,
-	0x11b0, 0x6007, 0x0044, 0x2071, 0x0260, 0x7444, 0x94a4, 0xff00,
-	0x0904, 0xd91c, 0x080c, 0xe684, 0x1170, 0x9486, 0x2000, 0x1158,
-	0x2009, 0x0001, 0x2011, 0x0200, 0x080c, 0x88ec, 0x0020, 0x9026,
-	0x080c, 0xe508, 0x0c30, 0x080c, 0x103a, 0x090c, 0x0d7d, 0x6003,
-	0x0007, 0xa867, 0x010d, 0x9006, 0xa802, 0xa86a, 0xac8a, 0x2c00,
-	0xa88e, 0x6008, 0xa8e2, 0x6010, 0x2058, 0xb8a0, 0x7130, 0xa97a,
-	0x0016, 0xa876, 0xa87f, 0x0000, 0xa883, 0x0000, 0xa887, 0x0036,
-	0x080c, 0x6d80, 0x001e, 0x080c, 0xe684, 0x1904, 0xd97c, 0x9486,
-	0x2000, 0x1130, 0x2019, 0x0017, 0x080c, 0xe239, 0x0804, 0xd97c,
-	0x9486, 0x0200, 0x1120, 0x080c, 0xe1c9, 0x0804, 0xd97c, 0x9486,
-	0x0400, 0x0120, 0x9486, 0x1000, 0x1904, 0xd97c, 0x2019, 0x0002,
-	0x080c, 0xe1e8, 0x0804, 0xd97c, 0x2069, 0x1a6f, 0x6a00, 0xd284,
-	0x0904, 0xd9e6, 0x9284, 0x0300, 0x1904, 0xd9df, 0x6804, 0x9005,
-	0x0904, 0xd9c7, 0x2d78, 0x6003, 0x0007, 0x080c, 0x1053, 0x0904,
-	0xd988, 0x7800, 0xd08c, 0x1118, 0x7804, 0x8001, 0x7806, 0x6017,
-	0x0000, 0x2001, 0x180f, 0x2004, 0xd084, 0x1904, 0xd9ea, 0x9006,
-	0xa802, 0xa867, 0x0116, 0xa86a, 0x6008, 0xa8e2, 0x2c00, 0xa87a,
-	0x6010, 0x2058, 0xb8a0, 0x7130, 0xa9b6, 0xa876, 0xb928, 0xa9ba,
-	0xb92c, 0xa9be, 0xb930, 0xa9c2, 0xb934, 0xa9c6, 0xa883, 0x003d,
-	0x7044, 0x9084, 0x0003, 0x9080, 0xd984, 0x2005, 0xa87e, 0x20a9,
-	0x000a, 0x2001, 0x0270, 0xaa5c, 0x9290, 0x0021, 0x2009, 0x0205,
-	0x200b, 0x0080, 0x20e1, 0x0000, 0xab60, 0x23e8, 0x2098, 0x22a0,
-	0x4003, 0x200b, 0x0000, 0x2001, 0x027a, 0x200c, 0xa9b2, 0x8000,
-	0x200c, 0xa9ae, 0x080c, 0x6d83, 0x002e, 0x004e, 0x00fe, 0x00ee,
-	0x00de, 0x00be, 0x009e, 0x0005, 0x0000, 0x0080, 0x0040, 0x0000,
-	0x2001, 0x1810, 0x2004, 0xd084, 0x0120, 0x080c, 0x103a, 0x1904,
-	0xd931, 0x6017, 0xf100, 0x6003, 0x0001, 0x6007, 0x0041, 0x2009,
-	0xa022, 0x080c, 0x921e, 0x0c00, 0x2069, 0x0260, 0x6848, 0x9084,
-	0xff00, 0x9086, 0x1200, 0x1198, 0x686c, 0x9084, 0x00ff, 0x0016,
-	0x6114, 0x918c, 0xf700, 0x910d, 0x6116, 0x001e, 0x6003, 0x0001,
-	0x6007, 0x0043, 0x2009, 0xa025, 0x080c, 0x921e, 0x0828, 0x6868,
-	0x602e, 0x686c, 0x6032, 0x6017, 0xf200, 0x6003, 0x0001, 0x6007,
-	0x0041, 0x2009, 0xa022, 0x080c, 0x921e, 0x0804, 0xd97c, 0x2001,
-	0x180e, 0x2004, 0xd0ec, 0x0120, 0x2011, 0x8049, 0x080c, 0x4b07,
-	0x6017, 0xf300, 0x0010, 0x6017, 0xf100, 0x6003, 0x0001, 0x6007,
-	0x0041, 0x2009, 0xa022, 0x080c, 0x921e, 0x0804, 0xd97c, 0x6017,
-	0xf500, 0x0c98, 0x6017, 0xf600, 0x0804, 0xd99c, 0x6017, 0xf200,
-	0x0804, 0xd99c, 0xa867, 0x0146, 0xa86b, 0x0000, 0x6008, 0xa886,
-	0x2c00, 0xa87a, 0x7044, 0x9084, 0x0003, 0x9080, 0xd984, 0x2005,
-	0xa87e, 0x2928, 0x6010, 0x2058, 0xb8a0, 0xa876, 0xb828, 0xa88a,
-	0xb82c, 0xa88e, 0xb830, 0xa892, 0xb834, 0xa896, 0xa883, 0x003d,
-	0x2009, 0x0205, 0x2104, 0x9085, 0x0080, 0x200a, 0x20e1, 0x0000,
-	0x2011, 0x0210, 0x2214, 0x9294, 0x0fff, 0xaaa2, 0x9282, 0x0111,
-	0x1a0c, 0x0d7d, 0x8210, 0x821c, 0x2001, 0x026c, 0x2098, 0xa860,
-	0x20e8, 0xa85c, 0x9080, 0x0029, 0x20a0, 0x2011, 0xda66, 0x2041,
-	0x0001, 0x223d, 0x9784, 0x00ff, 0x9322, 0x1208, 0x2300, 0x20a8,
-	0x4003, 0x931a, 0x0530, 0x8210, 0xd7fc, 0x1130, 0x8d68, 0x2d0a,
-	0x2001, 0x0260, 0x2098, 0x0c68, 0x2950, 0x080c, 0x1053, 0x0170,
-	0x2900, 0xb002, 0xa867, 0x0147, 0xa86b, 0x0000, 0xa860, 0x20e8,
-	0xa85c, 0x9080, 0x001b, 0x20a0, 0x8840, 0x08d8, 0x2548, 0xa800,
-	0x902d, 0x0118, 0x080c, 0x106c, 0x0cc8, 0x080c, 0x106c, 0x0804,
-	0xd988, 0x2548, 0x8847, 0x9885, 0x0046, 0xa866, 0x2009, 0x0205,
-	0x200b, 0x0000, 0x080c, 0xe26c, 0x0804, 0xd97c, 0x8010, 0x0004,
-	0x801a, 0x0006, 0x8018, 0x0008, 0x8016, 0x000a, 0x8014, 0x9186,
-	0x0013, 0x1160, 0x6004, 0x908a, 0x0057, 0x1a0c, 0x0d7d, 0x9082,
-	0x0040, 0x0a0c, 0x0d7d, 0x2008, 0x0804, 0xdaf1, 0x9186, 0x0051,
-	0x0108, 0x0040, 0x080c, 0xaaa8, 0x01e8, 0x9086, 0x0002, 0x0904,
-	0xdb38, 0x00c0, 0x9186, 0x0027, 0x0180, 0x9186, 0x0048, 0x0128,
-	0x9186, 0x0014, 0x0150, 0x190c, 0x0d7d, 0x080c, 0xaaa8, 0x0150,
-	0x9086, 0x0004, 0x0904, 0xdbd5, 0x0028, 0x6004, 0x9082, 0x0040,
-	0x2008, 0x001a, 0x080c, 0xaca9, 0x0005, 0xdab8, 0xdaba, 0xdaba,
-	0xdae1, 0xdab8, 0xdab8, 0xdab8, 0xdab8, 0xdab8, 0xdab8, 0xdab8,
-	0xdab8, 0xdab8, 0xdab8, 0xdab8, 0xdab8, 0xdab8, 0xdab8, 0xdab8,
-	0x080c, 0x0d7d, 0x080c, 0x95de, 0x080c, 0x96a0, 0x0036, 0x0096,
-	0x6014, 0x904d, 0x01d8, 0x080c, 0xc838, 0x01c0, 0x6003, 0x0002,
-	0x6010, 0x00b6, 0x2058, 0xb800, 0x00be, 0xd0bc, 0x1178, 0x2019,
-	0x0004, 0x080c, 0xe26c, 0x6017, 0x0000, 0x6018, 0x9005, 0x1120,
-	0x2001, 0x1987, 0x2004, 0x601a, 0x6003, 0x0007, 0x009e, 0x003e,
-	0x0005, 0x0096, 0x080c, 0x95de, 0x080c, 0x96a0, 0x080c, 0xc838,
-	0x0120, 0x6014, 0x2048, 0x080c, 0x106c, 0x080c, 0xac28, 0x009e,
-	0x0005, 0x0002, 0xdb05, 0xdb1a, 0xdb07, 0xdb2f, 0xdb05, 0xdb05,
-	0xdb05, 0xdb05, 0xdb05, 0xdb05, 0xdb05, 0xdb05, 0xdb05, 0xdb05,
-	0xdb05, 0xdb05, 0xdb05, 0xdb05, 0xdb05, 0x080c, 0x0d7d, 0x0096,
-	0x6014, 0x2048, 0xa87c, 0xd0b4, 0x0138, 0x6003, 0x0007, 0x2009,
-	0x0043, 0x080c, 0xac8c, 0x0010, 0x6003, 0x0004, 0x080c, 0x96a0,
-	0x009e, 0x0005, 0x080c, 0xc838, 0x0138, 0x6114, 0x0096, 0x2148,
-	0xa97c, 0x009e, 0xd1ec, 0x1138, 0x080c, 0x88c1, 0x080c, 0xabed,
-	0x080c, 0x96a0, 0x0005, 0x080c, 0xe4cc, 0x0db0, 0x0cc8, 0x6003,
-	0x0001, 0x6007, 0x0041, 0x2009, 0xa022, 0x080c, 0x921e, 0x0005,
-	0x9182, 0x0040, 0x0002, 0xdb4e, 0xdb50, 0xdb4e, 0xdb4e, 0xdb4e,
-	0xdb4e, 0xdb4e, 0xdb4e, 0xdb4e, 0xdb4e, 0xdb4e, 0xdb4e, 0xdb4e,
-	0xdb4e, 0xdb4e, 0xdb4e, 0xdb4e, 0xdb51, 0xdb4e, 0x080c, 0x0d7d,
-	0x0005, 0x00d6, 0x080c, 0x88c1, 0x00de, 0x080c, 0xe524, 0x080c,
-	0xabed, 0x0005, 0x9182, 0x0040, 0x0002, 0xdb70, 0xdb70, 0xdb70,
-	0xdb70, 0xdb70, 0xdb70, 0xdb70, 0xdb70, 0xdb70, 0xdb72, 0xdb9d,
-	0xdb70, 0xdb70, 0xdb70, 0xdb70, 0xdb9d, 0xdb70, 0xdb70, 0xdb70,
-	0x080c, 0x0d7d, 0x6014, 0x0096, 0x2048, 0xa87c, 0xd0fc, 0x0168,
-	0x908c, 0x0003, 0x918e, 0x0002, 0x0180, 0x6144, 0xd1e4, 0x1168,
-	0x2009, 0x0041, 0x009e, 0x0804, 0xdc5d, 0x6003, 0x0007, 0x601b,
-	0x0000, 0x080c, 0x88c1, 0x009e, 0x0005, 0x6014, 0x2048, 0xa97c,
-	0xd1ec, 0x1130, 0x080c, 0x88c1, 0x080c, 0xabed, 0x009e, 0x0005,
-	0x080c, 0xe4cc, 0x0db8, 0x009e, 0x0005, 0x2001, 0x180c, 0x200c,
-	0xc1d4, 0x2102, 0x0036, 0x080c, 0x963b, 0x080c, 0x96a0, 0x6014,
-	0x0096, 0x2048, 0x6010, 0x00b6, 0x2058, 0xb800, 0x00be, 0xd0bc,
-	0x0188, 0xa87c, 0x9084, 0x0003, 0x9086, 0x0002, 0x0140, 0xa8ac,
-	0x6330, 0x931a, 0x6332, 0xa8b0, 0x632c, 0x931b, 0x632e, 0x6003,
-	0x0002, 0x0080, 0x2019, 0x0004, 0x080c, 0xe26c, 0x6018, 0x9005,
-	0x1128, 0x2001, 0x1987, 0x2004, 0x8003, 0x601a, 0x6017, 0x0000,
-	0x6003, 0x0007, 0x009e, 0x003e, 0x0005, 0x9182, 0x0040, 0x0002,
-	0xdbec, 0xdbec, 0xdbec, 0xdbec, 0xdbec, 0xdbec, 0xdbec, 0xdbec,
-	0xdbee, 0xdbec, 0xdbec, 0xdbec, 0xdbec, 0xdbec, 0xdbec, 0xdbec,
-	0xdbec, 0xdbec, 0xdbec, 0xdc39, 0x080c, 0x0d7d, 0x6014, 0x0096,
-	0x2048, 0xa834, 0xaa38, 0x6110, 0x00b6, 0x2158, 0xb900, 0x00be,
-	0xd1bc, 0x1190, 0x920d, 0x1518, 0xa87c, 0xd0fc, 0x0128, 0x2009,
-	0x0041, 0x009e, 0x0804, 0xdc5d, 0x6003, 0x0007, 0x601b, 0x0000,
-	0x080c, 0x88c1, 0x009e, 0x0005, 0x6124, 0xd1f4, 0x1d58, 0x0006,
-	0x0046, 0xacac, 0x9422, 0xa9b0, 0x2200, 0x910b, 0x6030, 0x9420,
-	0x6432, 0x602c, 0x9109, 0x612e, 0x004e, 0x000e, 0x08d8, 0x6110,
-	0x00b6, 0x2158, 0xb900, 0x00be, 0xd1bc, 0x1178, 0x2009, 0x180e,
-	0x210c, 0xd19c, 0x0118, 0x6003, 0x0007, 0x0010, 0x6003, 0x0006,
-	0x00e9, 0x080c, 0x88c3, 0x009e, 0x0005, 0x6003, 0x0002, 0x009e,
-	0x0005, 0x6024, 0xd0f4, 0x0128, 0x080c, 0x1670, 0x1904, 0xdbee,
-	0x0005, 0x6014, 0x0096, 0x2048, 0xa834, 0xa938, 0x009e, 0x9105,
-	0x1120, 0x080c, 0x1670, 0x1904, 0xdbee, 0x0005, 0xd2fc, 0x0140,
-	0x8002, 0x8000, 0x8212, 0x9291, 0x0000, 0x2009, 0x0009, 0x0010,
-	0x2009, 0x0015, 0xaa9a, 0xa896, 0x0005, 0x9182, 0x0040, 0x0208,
-	0x0062, 0x9186, 0x0013, 0x0120, 0x9186, 0x0014, 0x190c, 0x0d7d,
-	0x6024, 0xd0dc, 0x090c, 0x0d7d, 0x0005, 0xdc80, 0xdc8c, 0xdc98,
-	0xdca4, 0xdc80, 0xdc80, 0xdc80, 0xdc80, 0xdc87, 0xdc82, 0xdc82,
-	0xdc80, 0xdc80, 0xdc80, 0xdc80, 0xdc82, 0xdc80, 0xdc82, 0xdc80,
-	0x080c, 0x0d7d, 0x6024, 0xd0dc, 0x090c, 0x0d7d, 0x0005, 0x6014,
-	0x9005, 0x190c, 0x0d7d, 0x0005, 0x6003, 0x0001, 0x6106, 0x0126,
-	0x2091, 0x8000, 0x2009, 0xa022, 0x080c, 0x9200, 0x012e, 0x0005,
-	0x6003, 0x0004, 0x6106, 0x0126, 0x2091, 0x8000, 0x2009, 0xa001,
-	0x080c, 0x921e, 0x012e, 0x0005, 0x6003, 0x0003, 0x6106, 0x080c,
-	0x1c03, 0x0126, 0x2091, 0x8000, 0x6014, 0x0096, 0x2048, 0xa87c,
-	0xd0fc, 0x0188, 0x9084, 0x0003, 0x9086, 0x0002, 0x01a0, 0x6024,
-	0xd0cc, 0x1148, 0xd0c4, 0x1138, 0xa8a8, 0x9005, 0x1120, 0x6144,
-	0x918d, 0xb035, 0x0018, 0x6144, 0x918d, 0xa035, 0x009e, 0x080c,
-	0x9265, 0x012e, 0x0005, 0x6144, 0x918d, 0xa032, 0x0cb8, 0x0126,
-	0x2091, 0x8000, 0x0036, 0x0096, 0x9182, 0x0040, 0x0023, 0x009e,
-	0x003e, 0x012e, 0x0005, 0xdceb, 0xdced, 0xdd02, 0xdd1c, 0xdceb,
-	0xdceb, 0xdceb, 0xdceb, 0xdceb, 0xdceb, 0xdceb, 0xdceb, 0xdceb,
-	0xdceb, 0xdceb, 0xdceb, 0x080c, 0x0d7d, 0x6014, 0x2048, 0xa87c,
-	0xd0fc, 0x0510, 0x909c, 0x0003, 0x939e, 0x0003, 0x01e8, 0x6003,
-	0x0001, 0x6106, 0x0126, 0x2091, 0x8000, 0x2009, 0xa022, 0x080c,
-	0x921e, 0x0470, 0x6014, 0x2048, 0xa87c, 0xd0fc, 0x0168, 0x909c,
-	0x0003, 0x939e, 0x0003, 0x0140, 0x6003, 0x0001, 0x6106, 0x2009,
-	0xa001, 0x080c, 0x921e, 0x00e0, 0x901e, 0x6316, 0x631a, 0x2019,
-	0x0004, 0x080c, 0xe26c, 0x00a0, 0x6014, 0x2048, 0xa87c, 0xd0fc,
-	0x0d98, 0x909c, 0x0003, 0x939e, 0x0003, 0x0d70, 0x6003, 0x0003,
-	0x6106, 0x080c, 0x1c03, 0x6144, 0x918d, 0xa035, 0x080c, 0x9265,
-	0x0005, 0x080c, 0x95de, 0x6114, 0x81ff, 0x0158, 0x0096, 0x2148,
-	0x080c, 0xe621, 0x0036, 0x2019, 0x0029, 0x080c, 0xe26c, 0x003e,
-	0x009e, 0x080c, 0xac28, 0x080c, 0x96a0, 0x0005, 0x080c, 0x963b,
-	0x6114, 0x81ff, 0x0158, 0x0096, 0x2148, 0x080c, 0xe621, 0x0036,
-	0x2019, 0x0029, 0x080c, 0xe26c, 0x003e, 0x009e, 0x080c, 0xac28,
-	0x0005, 0x9182, 0x0085, 0x0002, 0xdd6b, 0xdd69, 0xdd69, 0xdd77,
-	0xdd69, 0xdd69, 0xdd69, 0xdd69, 0xdd69, 0xdd69, 0xdd69, 0xdd69,
-	0xdd69, 0x080c, 0x0d7d, 0x6003, 0x000b, 0x6106, 0x0126, 0x2091,
-	0x8000, 0x2009, 0x8020, 0x080c, 0x921e, 0x012e, 0x0005, 0x0026,
-	0x00e6, 0x080c, 0xe4c3, 0x0118, 0x080c, 0xabed, 0x0440, 0x2071,
-	0x0260, 0x7224, 0x6216, 0x2001, 0x180e, 0x2004, 0xd0e4, 0x0150,
-	0x6010, 0x00b6, 0x2058, 0xbca0, 0x00be, 0x2c00, 0x2011, 0x014e,
-	0x080c, 0xaf1a, 0x7220, 0x080c, 0xe102, 0x0118, 0x6007, 0x0086,
-	0x0040, 0x6007, 0x0087, 0x7224, 0x9296, 0xffff, 0x1110, 0x6007,
-	0x0086, 0x6003, 0x0001, 0x2009, 0x8020, 0x080c, 0x921e, 0x00ee,
-	0x002e, 0x0005, 0x9186, 0x0013, 0x1160, 0x6004, 0x908a, 0x0085,
-	0x0a0c, 0x0d7d, 0x908a, 0x0092, 0x1a0c, 0x0d7d, 0x9082, 0x0085,
-	0x00a2, 0x9186, 0x0027, 0x0130, 0x9186, 0x0014, 0x0118, 0x080c,
-	0xaca9, 0x0050, 0x2001, 0x0007, 0x080c, 0x65a1, 0x080c, 0x95de,
-	0x080c, 0xac28, 0x080c, 0x96a0, 0x0005, 0xddda, 0xdddc, 0xdddc,
-	0xddda, 0xddda, 0xddda, 0xddda, 0xddda, 0xddda, 0xddda, 0xddda,
-	0xddda, 0xddda, 0x080c, 0x0d7d, 0x080c, 0xac28, 0x080c, 0x96a0,
-	0x0005, 0x9182, 0x0085, 0x0a0c, 0x0d7d, 0x9182, 0x0092, 0x1a0c,
-	0x0d7d, 0x9182, 0x0085, 0x0002, 0xddf9, 0xddf9, 0xddf9, 0xddfb,
-	0xddf9, 0xddf9, 0xddf9, 0xddf9, 0xddf9, 0xddf9, 0xddf9, 0xddf9,
-	0xddf9, 0x080c, 0x0d7d, 0x0005, 0x9186, 0x0013, 0x0148, 0x9186,
-	0x0014, 0x0130, 0x9186, 0x0027, 0x0118, 0x080c, 0xaca9, 0x0020,
-	0x080c, 0x95de, 0x080c, 0xac28, 0x0005, 0x0036, 0x080c, 0xe524,
-	0x604b, 0x0000, 0x2019, 0x000b, 0x0031, 0x6023, 0x0006, 0x6003,
-	0x0007, 0x003e, 0x0005, 0x0126, 0x0036, 0x2091, 0x8000, 0x2001,
-	0x0382, 0x2004, 0x9084, 0x0007, 0x0006, 0x9086, 0x0003, 0x0110,
-	0x080c, 0xa896, 0x0086, 0x2c40, 0x0096, 0x904e, 0x080c, 0xa218,
-	0x009e, 0x008e, 0x1550, 0x0076, 0x2c38, 0x080c, 0xa2c3, 0x007e,
-	0x1520, 0x6000, 0x9086, 0x0000, 0x0500, 0x6020, 0x9086, 0x0007,
-	0x01e0, 0x0096, 0x601c, 0xd084, 0x0140, 0x080c, 0xe524, 0x080c,
-	0xcf6a, 0x080c, 0x1a6a, 0x6023, 0x0007, 0x6014, 0x2048, 0x080c,
-	0xc838, 0x0110, 0x080c, 0xe26c, 0x009e, 0x6017, 0x0000, 0x080c,
-	0xe524, 0x6023, 0x0007, 0x080c, 0xcf6a, 0x000e, 0x9086, 0x0003,
-	0x0110, 0x080c, 0xa8b2, 0x003e, 0x012e, 0x0005, 0x00f6, 0x00c6,
+	0x9682, 0x0004, 0x0a04, 0xd114, 0x9682, 0x0007, 0x0a04, 0xd170,
+	0x0804, 0xd114, 0x6017, 0x1900, 0x6007, 0x0009, 0x0804, 0xd22d,
+	0x080c, 0x6a28, 0x1140, 0x2001, 0x1837, 0x2004, 0x9084, 0x0009,
+	0x9086, 0x0008, 0x1110, 0x0804, 0xd04f, 0x080c, 0x69c4, 0x6610,
+	0x2658, 0xbe04, 0x9684, 0x00ff, 0x0006, 0x9086, 0x0001, 0x000e,
+	0x0170, 0x9082, 0x0006, 0x0698, 0x0150, 0x96b4, 0xff00, 0x8637,
+	0x9686, 0x0004, 0x0120, 0x9686, 0x0006, 0x1904, 0xd114, 0x080c,
+	0xdfcc, 0x1130, 0x080c, 0xdec5, 0x1118, 0x6007, 0x0010, 0x04e8,
+	0x0046, 0x6410, 0x2458, 0xbca0, 0x0046, 0x080c, 0x31ef, 0x080c,
+	0xcf66, 0x004e, 0x0016, 0x9006, 0x2009, 0x1848, 0x210c, 0xd1a4,
+	0x0148, 0x2009, 0x0029, 0x080c, 0xe2d9, 0x6010, 0x2058, 0xb800,
+	0xc0e5, 0xb802, 0x001e, 0x004e, 0x6007, 0x0001, 0x00f0, 0x080c,
+	0xe15c, 0x0140, 0x96b4, 0xff00, 0x8637, 0x9686, 0x0006, 0x0978,
+	0x0804, 0xd114, 0x6017, 0x1900, 0x6007, 0x0009, 0x0070, 0x080c,
+	0x3326, 0x1904, 0xd440, 0x080c, 0xe4d3, 0x1904, 0xd440, 0x080c,
+	0xd60d, 0x1904, 0xd114, 0x6007, 0x0012, 0x6003, 0x0001, 0x080c,
+	0x9207, 0x080c, 0x9684, 0x0005, 0x6007, 0x0001, 0x6003, 0x0001,
+	0x080c, 0x9207, 0x080c, 0x9684, 0x0cb0, 0x6007, 0x0005, 0x0c68,
+	0x080c, 0xe4d3, 0x1904, 0xd440, 0x080c, 0x3326, 0x1904, 0xd440,
+	0x080c, 0xd60d, 0x1904, 0xd114, 0x6007, 0x0020, 0x6003, 0x0001,
+	0x080c, 0x9207, 0x080c, 0x9684, 0x0005, 0x080c, 0x3326, 0x1904,
+	0xd440, 0x6007, 0x0023, 0x6003, 0x0001, 0x080c, 0x9207, 0x080c,
+	0x9684, 0x0005, 0x080c, 0xe4d3, 0x1904, 0xd440, 0x080c, 0x3326,
+	0x1904, 0xd440, 0x080c, 0xd60d, 0x1904, 0xd114, 0x0016, 0x0026,
+	0x00e6, 0x2071, 0x0260, 0x7244, 0x9286, 0xffff, 0x0180, 0x2c08,
+	0x080c, 0xc820, 0x01b0, 0x2260, 0x7240, 0x6008, 0x9206, 0x1188,
+	0x6010, 0x9190, 0x0004, 0x2214, 0x9206, 0x01b8, 0x0050, 0x7240,
+	0x2c08, 0x9006, 0x080c, 0xe2a3, 0x1180, 0x7244, 0x9286, 0xffff,
+	0x01b0, 0x2160, 0x6007, 0x0026, 0x6017, 0x1700, 0x7214, 0x9296,
+	0xffff, 0x1180, 0x6007, 0x0025, 0x0068, 0x6020, 0x9086, 0x0007,
+	0x1d80, 0x6004, 0x9086, 0x0024, 0x1110, 0x080c, 0xabdf, 0x2160,
+	0x6007, 0x0025, 0x6003, 0x0001, 0x080c, 0x9207, 0x080c, 0x9684,
+	0x00ee, 0x002e, 0x001e, 0x0005, 0x2001, 0x0001, 0x080c, 0x655c,
+	0x0156, 0x0016, 0x0026, 0x0036, 0x20a9, 0x0004, 0x2019, 0x1805,
+	0x2011, 0x0276, 0x080c, 0xbba1, 0x003e, 0x002e, 0x001e, 0x015e,
+	0x0120, 0x6007, 0x0031, 0x0804, 0xd22d, 0x080c, 0xb812, 0x080c,
+	0x74c8, 0x1190, 0x0006, 0x0026, 0x0036, 0x080c, 0x74e2, 0x1138,
+	0x080c, 0x77cc, 0x080c, 0x6024, 0x080c, 0x73f9, 0x0010, 0x080c,
+	0x749c, 0x003e, 0x002e, 0x000e, 0x0005, 0x080c, 0x3326, 0x1904,
+	0xd440, 0x080c, 0xd60d, 0x1904, 0xd114, 0x6106, 0x080c, 0xd629,
+	0x1120, 0x6007, 0x002b, 0x0804, 0xd22d, 0x6007, 0x002c, 0x0804,
+	0xd22d, 0x080c, 0xe4d3, 0x1904, 0xd440, 0x080c, 0x3326, 0x1904,
+	0xd440, 0x080c, 0xd60d, 0x1904, 0xd114, 0x6106, 0x080c, 0xd62e,
+	0x1120, 0x6007, 0x002e, 0x0804, 0xd22d, 0x6007, 0x002f, 0x0804,
+	0xd22d, 0x080c, 0x3326, 0x1904, 0xd440, 0x00e6, 0x00d6, 0x00c6,
+	0x6010, 0x2058, 0xb904, 0x9184, 0x00ff, 0x9086, 0x0006, 0x0158,
+	0x9184, 0xff00, 0x8007, 0x9086, 0x0006, 0x0128, 0x00ce, 0x00de,
+	0x00ee, 0x0804, 0xd234, 0x080c, 0x56d9, 0xd0e4, 0x0904, 0xd38b,
+	0x2071, 0x026c, 0x7010, 0x603a, 0x7014, 0x603e, 0x7108, 0x720c,
+	0x080c, 0x6a66, 0x0140, 0x6010, 0x2058, 0xb810, 0x9106, 0x1118,
+	0xb814, 0x9206, 0x0510, 0x080c, 0x6a62, 0x15b8, 0x2069, 0x1800,
+	0x6880, 0x9206, 0x1590, 0x687c, 0x9106, 0x1578, 0x7210, 0x080c,
+	0xc820, 0x0590, 0x080c, 0xd4f8, 0x0578, 0x080c, 0xe355, 0x0560,
+	0x622e, 0x6007, 0x0036, 0x6003, 0x0001, 0x2009, 0x8020, 0x080c,
+	0x9200, 0x00ce, 0x00de, 0x00ee, 0x0005, 0x7214, 0x9286, 0xffff,
+	0x0150, 0x080c, 0xc820, 0x01c0, 0x9280, 0x0002, 0x2004, 0x7110,
+	0x9106, 0x1190, 0x08e0, 0x7210, 0x2c08, 0x9085, 0x0001, 0x080c,
+	0xe2a3, 0x2c10, 0x2160, 0x0140, 0x0890, 0x6007, 0x0037, 0x602f,
+	0x0009, 0x6017, 0x1500, 0x08b8, 0x6007, 0x0037, 0x602f, 0x0003,
+	0x6017, 0x1700, 0x0880, 0x6007, 0x0012, 0x0868, 0x080c, 0x3326,
+	0x1904, 0xd440, 0x6010, 0x2058, 0xb804, 0x9084, 0xff00, 0x8007,
+	0x9086, 0x0006, 0x1904, 0xd234, 0x00e6, 0x00d6, 0x00c6, 0x080c,
+	0x56d9, 0xd0e4, 0x0904, 0xd403, 0x2069, 0x1800, 0x2071, 0x026c,
+	0x7008, 0x603a, 0x720c, 0x623e, 0x9286, 0xffff, 0x1150, 0x7208,
+	0x00c6, 0x2c08, 0x9085, 0x0001, 0x080c, 0xe2a3, 0x2c10, 0x00ce,
+	0x05e8, 0x080c, 0xc820, 0x05d0, 0x7108, 0x9280, 0x0002, 0x2004,
+	0x9106, 0x15a0, 0x00c6, 0x0026, 0x2260, 0x080c, 0xc423, 0x002e,
+	0x00ce, 0x7118, 0x918c, 0xff00, 0x810f, 0x9186, 0x0001, 0x0178,
+	0x9186, 0x0005, 0x0118, 0x9186, 0x0007, 0x1198, 0x9280, 0x0005,
+	0x2004, 0x9005, 0x0170, 0x080c, 0xd4f8, 0x0904, 0xd384, 0x0056,
+	0x7510, 0x7614, 0x080c, 0xe36e, 0x005e, 0x00ce, 0x00de, 0x00ee,
+	0x0005, 0x6007, 0x003b, 0x602f, 0x0009, 0x6017, 0x2a00, 0x6003,
+	0x0001, 0x2009, 0x8020, 0x080c, 0x9200, 0x0c78, 0x6007, 0x003b,
+	0x602f, 0x0003, 0x6017, 0x0300, 0x6003, 0x0001, 0x2009, 0x8020,
+	0x080c, 0x9200, 0x0c10, 0x6007, 0x003b, 0x602f, 0x000b, 0x6017,
+	0x0000, 0x0804, 0xd35b, 0x00e6, 0x0026, 0x080c, 0x6a28, 0x0550,
+	0x080c, 0x69c4, 0x080c, 0xe545, 0x1518, 0x2071, 0x1800, 0x70dc,
+	0x9085, 0x0003, 0x70de, 0x00f6, 0x2079, 0x0100, 0x72b0, 0x9284,
+	0x00ff, 0x707e, 0x78e6, 0x9284, 0xff00, 0x7280, 0x9205, 0x7082,
+	0x78ea, 0x00fe, 0x70e7, 0x0000, 0x080c, 0x6a66, 0x0120, 0x2011,
+	0x1a08, 0x2013, 0x07d0, 0xd0ac, 0x1128, 0x080c, 0x2fc0, 0x0010,
+	0x080c, 0xe577, 0x002e, 0x00ee, 0x080c, 0xabdf, 0x0804, 0xd233,
+	0x080c, 0xabdf, 0x0005, 0x2600, 0x0002, 0xd457, 0xd488, 0xd499,
+	0xd457, 0xd457, 0xd459, 0xd4aa, 0xd457, 0xd457, 0xd457, 0xd476,
+	0xd457, 0xd457, 0xd457, 0xd4b5, 0xd4c2, 0xd4f3, 0xd457, 0x080c,
+	0x0d7d, 0x080c, 0xe4d3, 0x1d20, 0x080c, 0x3326, 0x1d08, 0x080c,
+	0xd60d, 0x1148, 0x7038, 0x6016, 0x6007, 0x0045, 0x6003, 0x0001,
+	0x080c, 0x9207, 0x0005, 0x080c, 0x31ef, 0x080c, 0xcf66, 0x6007,
+	0x0001, 0x6003, 0x0001, 0x080c, 0x9207, 0x0005, 0x080c, 0xe4d3,
+	0x1938, 0x080c, 0x3326, 0x1920, 0x080c, 0xd60d, 0x1d60, 0x703c,
+	0x6016, 0x6007, 0x004a, 0x6003, 0x0001, 0x080c, 0x9207, 0x0005,
+	0x080c, 0x3326, 0x1904, 0xd440, 0x2009, 0x0041, 0x080c, 0xe580,
+	0x6007, 0x0047, 0x6003, 0x0001, 0x080c, 0x9207, 0x080c, 0x9684,
+	0x0005, 0x080c, 0x3326, 0x1904, 0xd440, 0x2009, 0x0042, 0x080c,
+	0xe580, 0x6007, 0x0047, 0x6003, 0x0001, 0x080c, 0x9207, 0x080c,
+	0x9684, 0x0005, 0x080c, 0x3326, 0x1904, 0xd440, 0x2009, 0x0046,
+	0x080c, 0xe580, 0x080c, 0xabdf, 0x0005, 0x080c, 0xd515, 0x0904,
+	0xd440, 0x6007, 0x004e, 0x6003, 0x0001, 0x080c, 0x9207, 0x080c,
+	0x9684, 0x0005, 0x6007, 0x004f, 0x6017, 0x0000, 0x7134, 0x918c,
+	0x00ff, 0x81ff, 0x0508, 0x9186, 0x0001, 0x1160, 0x7140, 0x2001,
+	0x19bc, 0x2004, 0x9106, 0x11b0, 0x7144, 0x2001, 0x19bd, 0x2004,
+	0x9106, 0x0190, 0x9186, 0x0002, 0x1168, 0x2011, 0x0276, 0x20a9,
+	0x0004, 0x6010, 0x0096, 0x2048, 0x2019, 0x000a, 0x080c, 0xbbb5,
+	0x009e, 0x0110, 0x6017, 0x0001, 0x6003, 0x0001, 0x080c, 0x9207,
+	0x080c, 0x9684, 0x0005, 0x6007, 0x0050, 0x703c, 0x6016, 0x0ca0,
+	0x0016, 0x00e6, 0x2071, 0x0260, 0x00b6, 0x00c6, 0x2260, 0x6010,
+	0x2058, 0xb8d4, 0xd084, 0x0150, 0x7128, 0x6050, 0x9106, 0x1120,
+	0x712c, 0x604c, 0x9106, 0x0110, 0x9006, 0x0010, 0x9085, 0x0001,
+	0x00ce, 0x00be, 0x00ee, 0x001e, 0x0005, 0x0016, 0x0096, 0x0086,
+	0x00e6, 0x01c6, 0x01d6, 0x0126, 0x2091, 0x8000, 0x2071, 0x1800,
+	0x7090, 0x908a, 0x00f9, 0x16e8, 0x20e1, 0x0000, 0x2001, 0x199f,
+	0x2003, 0x0000, 0x080c, 0x1053, 0x05a0, 0x2900, 0x6016, 0x7090,
+	0x8004, 0xa816, 0x908a, 0x001e, 0x02d0, 0xa833, 0x001e, 0x20a9,
+	0x001e, 0xa860, 0x20e8, 0xa85c, 0x9080, 0x001b, 0x20a0, 0x2001,
+	0x199f, 0x0016, 0x200c, 0x0471, 0x001e, 0x2940, 0x080c, 0x1053,
+	0x01c0, 0x2900, 0xa006, 0x2100, 0x81ff, 0x0180, 0x0c18, 0xa832,
+	0x20a8, 0xa860, 0x20e8, 0xa85c, 0x9080, 0x001b, 0x20a0, 0x2001,
+	0x199f, 0x0016, 0x200c, 0x00b1, 0x001e, 0x0000, 0x9085, 0x0001,
+	0x0048, 0x2071, 0x1800, 0x7093, 0x0000, 0x6014, 0x2048, 0x080c,
+	0x0fec, 0x9006, 0x012e, 0x01de, 0x01ce, 0x00ee, 0x008e, 0x009e,
+	0x001e, 0x0005, 0x0006, 0x0016, 0x0026, 0x0036, 0x00c6, 0x918c,
+	0xffff, 0x11a8, 0x080c, 0x219a, 0x2099, 0x026c, 0x2001, 0x0014,
+	0x3518, 0x9312, 0x1218, 0x23a8, 0x4003, 0x00f8, 0x20a8, 0x4003,
+	0x22a8, 0x8108, 0x080c, 0x219a, 0x2099, 0x0260, 0x0ca8, 0x080c,
+	0x219a, 0x2061, 0x199f, 0x6004, 0x2098, 0x6008, 0x3518, 0x9312,
+	0x1218, 0x23a8, 0x4003, 0x0048, 0x20a8, 0x4003, 0x22a8, 0x8108,
+	0x080c, 0x219a, 0x2099, 0x0260, 0x0ca8, 0x2061, 0x199f, 0x2019,
+	0x0280, 0x3300, 0x931e, 0x0110, 0x6006, 0x0020, 0x2001, 0x0260,
+	0x6006, 0x8108, 0x2162, 0x9292, 0x0021, 0x9296, 0xffff, 0x620a,
+	0x00ce, 0x003e, 0x002e, 0x001e, 0x000e, 0x0005, 0x0006, 0x0016,
+	0x0026, 0x0036, 0x00c6, 0x81ff, 0x11b8, 0x080c, 0x21b2, 0x20a1,
+	0x024c, 0x2001, 0x0014, 0x3518, 0x9312, 0x1218, 0x23a8, 0x4003,
+	0x0418, 0x20a8, 0x4003, 0x82ff, 0x01f8, 0x22a8, 0x8108, 0x080c,
+	0x21b2, 0x20a1, 0x0240, 0x0c98, 0x080c, 0x21b2, 0x2061, 0x19a2,
+	0x6004, 0x20a0, 0x6008, 0x3518, 0x9312, 0x1218, 0x23a8, 0x4003,
+	0x0058, 0x20a8, 0x4003, 0x82ff, 0x0138, 0x22a8, 0x8108, 0x080c,
+	0x21b2, 0x20a1, 0x0240, 0x0c98, 0x2061, 0x19a2, 0x2019, 0x0260,
+	0x3400, 0x931e, 0x0110, 0x6006, 0x0020, 0x2001, 0x0240, 0x6006,
+	0x8108, 0x2162, 0x9292, 0x0021, 0x9296, 0xffff, 0x620a, 0x00ce,
+	0x003e, 0x002e, 0x001e, 0x000e, 0x0005, 0x00b6, 0x0066, 0x6610,
+	0x2658, 0xbe04, 0x96b4, 0xff00, 0x8637, 0x9686, 0x0006, 0x0170,
+	0x9686, 0x0004, 0x0158, 0xbe04, 0x96b4, 0x00ff, 0x9686, 0x0006,
+	0x0128, 0x9686, 0x0004, 0x0110, 0x9085, 0x0001, 0x006e, 0x00be,
+	0x0005, 0x00d6, 0x080c, 0xd6a3, 0x00de, 0x0005, 0x00d6, 0x080c,
+	0xd6b0, 0x1520, 0x680c, 0x908c, 0xff00, 0x6820, 0x9084, 0x00ff,
+	0x9115, 0x6216, 0x6824, 0x602e, 0xd1e4, 0x0130, 0x9006, 0x080c,
+	0xe6a0, 0x2009, 0x0001, 0x0078, 0xd1ec, 0x0180, 0x6920, 0x918c,
+	0x00ff, 0x6824, 0x080c, 0x2614, 0x1148, 0x2001, 0x0001, 0x080c,
+	0xe6a0, 0x2110, 0x900e, 0x080c, 0x323e, 0x0018, 0x9085, 0x0001,
+	0x0008, 0x9006, 0x00de, 0x0005, 0x00b6, 0x00c6, 0x080c, 0xac4f,
+	0x0598, 0x0016, 0x0026, 0x00c6, 0x2011, 0x0263, 0x2204, 0x8211,
+	0x220c, 0x080c, 0x2614, 0x1568, 0x080c, 0x65bf, 0x1550, 0xbe12,
+	0xbd16, 0x00ce, 0x002e, 0x001e, 0x2b00, 0x6012, 0x080c, 0xe4d3,
+	0x11c8, 0x080c, 0x3326, 0x11b0, 0x080c, 0xd60d, 0x0500, 0x2001,
+	0x0007, 0x080c, 0x6570, 0x2001, 0x0007, 0x080c, 0x659c, 0x6017,
+	0x0000, 0x6023, 0x0001, 0x6007, 0x0001, 0x6003, 0x0001, 0x080c,
+	0x9207, 0x0010, 0x080c, 0xabdf, 0x9085, 0x0001, 0x00ce, 0x00be,
+	0x0005, 0x080c, 0xabdf, 0x00ce, 0x002e, 0x001e, 0x0ca8, 0x080c,
+	0xabdf, 0x9006, 0x0c98, 0x2069, 0x026d, 0x6800, 0x9082, 0x0010,
+	0x1228, 0x6017, 0x0000, 0x9085, 0x0001, 0x0008, 0x9006, 0x0005,
+	0x6017, 0x0000, 0x2069, 0x026c, 0x6808, 0x9084, 0xff00, 0x9086,
+	0x0800, 0x1190, 0x6904, 0x9186, 0x0018, 0x0118, 0x9186, 0x0014,
+	0x1158, 0x810f, 0x6800, 0x9084, 0x00ff, 0x910d, 0x6162, 0x908e,
+	0x0014, 0x0110, 0x908e, 0x0010, 0x0005, 0x6004, 0x90b2, 0x0053,
+	0x1a0c, 0x0d7d, 0x91b6, 0x0013, 0x1130, 0x2008, 0x91b2, 0x0040,
+	0x1a04, 0xd7f2, 0x0092, 0x91b6, 0x0027, 0x0120, 0x91b6, 0x0014,
+	0x190c, 0x0d7d, 0x2001, 0x0007, 0x080c, 0x659c, 0x080c, 0x95c6,
+	0x080c, 0xac1a, 0x080c, 0x9684, 0x0005, 0xd72d, 0xd72f, 0xd72d,
+	0xd72d, 0xd72d, 0xd72f, 0xd73c, 0xd7ef, 0xd78c, 0xd7ef, 0xd7a0,
+	0xd7ef, 0xd73c, 0xd7ef, 0xd7e7, 0xd7ef, 0xd7e7, 0xd7ef, 0xd7ef,
+	0xd72d, 0xd72d, 0xd72d, 0xd72d, 0xd72d, 0xd72d, 0xd72d, 0xd72d,
+	0xd72d, 0xd72d, 0xd72d, 0xd72f, 0xd72d, 0xd7ef, 0xd72d, 0xd72d,
+	0xd7ef, 0xd72d, 0xd7ec, 0xd7ef, 0xd72d, 0xd72d, 0xd72d, 0xd72d,
+	0xd7ef, 0xd7ef, 0xd72d, 0xd7ef, 0xd7ef, 0xd72d, 0xd737, 0xd72d,
+	0xd72d, 0xd72d, 0xd72d, 0xd7eb, 0xd7ef, 0xd72d, 0xd72d, 0xd7ef,
+	0xd7ef, 0xd72d, 0xd72d, 0xd72d, 0xd72d, 0x080c, 0x0d7d, 0x080c,
+	0xcf69, 0x6003, 0x0002, 0x080c, 0x9684, 0x0804, 0xd7f1, 0x9006,
+	0x080c, 0x655c, 0x0804, 0xd7ef, 0x080c, 0x6a62, 0x1904, 0xd7ef,
+	0x9006, 0x080c, 0x655c, 0x6010, 0x2058, 0xb810, 0x9086, 0x00ff,
+	0x1140, 0x00f6, 0x2079, 0x1800, 0x78a8, 0x8000, 0x78aa, 0x00fe,
+	0x0428, 0x6010, 0x2058, 0xb884, 0x9005, 0x1178, 0x080c, 0xcf51,
+	0x1904, 0xd7ef, 0x0036, 0x0046, 0xbba0, 0x2021, 0x0007, 0x080c,
+	0x4cc0, 0x004e, 0x003e, 0x0804, 0xd7ef, 0x080c, 0x3357, 0x1904,
+	0xd7ef, 0x2001, 0x1800, 0x2004, 0x9086, 0x0002, 0x1138, 0x00f6,
+	0x2079, 0x1800, 0x78a8, 0x8000, 0x78aa, 0x00fe, 0x2001, 0x0002,
+	0x080c, 0x6570, 0x6023, 0x0001, 0x6003, 0x0001, 0x6007, 0x0002,
+	0x080c, 0x9207, 0x080c, 0x9684, 0x6110, 0x2158, 0x2009, 0x0001,
+	0x080c, 0x862b, 0x0804, 0xd7f1, 0x6610, 0x2658, 0xbe04, 0x96b4,
+	0xff00, 0x8637, 0x9686, 0x0006, 0x0904, 0xd7ef, 0x9686, 0x0004,
+	0x0904, 0xd7ef, 0x080c, 0x8eac, 0x2001, 0x0004, 0x0804, 0xd7ed,
+	0x2001, 0x1800, 0x2004, 0x9086, 0x0003, 0x1158, 0x0036, 0x0046,
+	0x6010, 0x2058, 0xbba0, 0x2021, 0x0006, 0x080c, 0x4cc0, 0x004e,
+	0x003e, 0x2001, 0x0006, 0x080c, 0xd80b, 0x6610, 0x2658, 0xbe04,
+	0x0066, 0x96b4, 0xff00, 0x8637, 0x9686, 0x0006, 0x006e, 0x0168,
+	0x2001, 0x0006, 0x080c, 0x659c, 0x9284, 0x00ff, 0x908e, 0x0007,
+	0x1120, 0x2001, 0x0006, 0x080c, 0x6570, 0x080c, 0x6a62, 0x11f8,
+	0x2001, 0x1837, 0x2004, 0xd0a4, 0x01d0, 0xbe04, 0x96b4, 0x00ff,
+	0x9686, 0x0006, 0x01a0, 0x00f6, 0x2079, 0x1800, 0x78a8, 0x8000,
+	0x78aa, 0x00fe, 0x0804, 0xd776, 0x2001, 0x0004, 0x0030, 0x2001,
+	0x0006, 0x0409, 0x0020, 0x0018, 0x0010, 0x080c, 0x659c, 0x080c,
+	0xabdf, 0x0005, 0x2600, 0x0002, 0xd806, 0xd806, 0xd806, 0xd806,
+	0xd806, 0xd808, 0xd806, 0xd808, 0xd806, 0xd806, 0xd808, 0xd806,
+	0xd806, 0xd806, 0xd808, 0xd808, 0xd808, 0xd808, 0x080c, 0x0d7d,
+	0x080c, 0xabdf, 0x0005, 0x0016, 0x00b6, 0x00d6, 0x6110, 0x2158,
+	0xb900, 0xd184, 0x0138, 0x080c, 0x6570, 0x9006, 0x080c, 0x655c,
+	0x080c, 0x321e, 0x00de, 0x00be, 0x001e, 0x0005, 0x6610, 0x2658,
+	0xb804, 0x9084, 0xff00, 0x8007, 0x90b2, 0x000c, 0x1a0c, 0x0d7d,
+	0x91b6, 0x0015, 0x1110, 0x003b, 0x0028, 0x91b6, 0x0016, 0x190c,
+	0x0d7d, 0x006b, 0x0005, 0xb68f, 0xb68f, 0xb68f, 0xb68f, 0xd8a0,
+	0xb68f, 0xd88a, 0xd84b, 0xb68f, 0xb68f, 0xb68f, 0xb68f, 0xb68f,
+	0xb68f, 0xb68f, 0xb68f, 0xd8a0, 0xb68f, 0xd88a, 0xd891, 0xb68f,
+	0xb68f, 0xb68f, 0xb68f, 0x00f6, 0x080c, 0x6a62, 0x11d8, 0x080c,
+	0xcf51, 0x11c0, 0x6010, 0x905d, 0x01a8, 0xb884, 0x9005, 0x0190,
+	0x9006, 0x080c, 0x655c, 0x2001, 0x0002, 0x080c, 0x6570, 0x6023,
+	0x0001, 0x6003, 0x0001, 0x6007, 0x0002, 0x080c, 0x9207, 0x080c,
+	0x9684, 0x00f0, 0x2011, 0x0263, 0x2204, 0x8211, 0x220c, 0x080c,
+	0x2614, 0x11b0, 0x080c, 0x6620, 0x0118, 0x080c, 0xabdf, 0x0080,
+	0xb810, 0x0006, 0xb814, 0x0006, 0xb884, 0x0006, 0x080c, 0x603e,
+	0x000e, 0xb886, 0x000e, 0xb816, 0x000e, 0xb812, 0x080c, 0xabdf,
+	0x00fe, 0x0005, 0x6604, 0x96b6, 0x001e, 0x1110, 0x080c, 0xabdf,
+	0x0005, 0x080c, 0xba1a, 0x1148, 0x6003, 0x0001, 0x6007, 0x0001,
+	0x080c, 0x9207, 0x080c, 0x9684, 0x0010, 0x080c, 0xabdf, 0x0005,
+	0x0804, 0xabdf, 0x6004, 0x908a, 0x0053, 0x1a0c, 0x0d7d, 0x080c,
+	0x95c6, 0x080c, 0xac1a, 0x0005, 0x9182, 0x0040, 0x0002, 0xd8c2,
+	0xd8c2, 0xd8c2, 0xd8c2, 0xd8c4, 0xd8c2, 0xd8c2, 0xd8c2, 0xd8c2,
+	0xd8c2, 0xd8c2, 0xd8c2, 0xd8c2, 0xd8c2, 0xd8c2, 0xd8c2, 0xd8c2,
+	0xd8c2, 0xd8c2, 0x080c, 0x0d7d, 0x0096, 0x00b6, 0x00d6, 0x00e6,
+	0x00f6, 0x0046, 0x0026, 0x6210, 0x2258, 0xb8bc, 0x9005, 0x11b0,
+	0x6007, 0x0044, 0x2071, 0x0260, 0x7444, 0x94a4, 0xff00, 0x0904,
+	0xd92b, 0x080c, 0xe694, 0x1170, 0x9486, 0x2000, 0x1158, 0x2009,
+	0x0001, 0x2011, 0x0200, 0x080c, 0x88ce, 0x0020, 0x9026, 0x080c,
+	0xe518, 0x0c30, 0x080c, 0x103a, 0x090c, 0x0d7d, 0x6003, 0x0007,
+	0xa867, 0x010d, 0x9006, 0xa802, 0xa86a, 0xac8a, 0x2c00, 0xa88e,
+	0x6008, 0xa8e2, 0x6010, 0x2058, 0xb8a0, 0x7130, 0xa97a, 0x0016,
+	0xa876, 0xa87f, 0x0000, 0xa883, 0x0000, 0xa887, 0x0036, 0x080c,
+	0x6d7b, 0x001e, 0x080c, 0xe694, 0x1904, 0xd98b, 0x9486, 0x2000,
+	0x1130, 0x2019, 0x0017, 0x080c, 0xe249, 0x0804, 0xd98b, 0x9486,
+	0x0200, 0x1120, 0x080c, 0xe1d9, 0x0804, 0xd98b, 0x9486, 0x0400,
+	0x0120, 0x9486, 0x1000, 0x1904, 0xd98b, 0x2019, 0x0002, 0x080c,
+	0xe1f8, 0x0804, 0xd98b, 0x2069, 0x1a6e, 0x6a00, 0xd284, 0x0904,
+	0xd9f5, 0x9284, 0x0300, 0x1904, 0xd9ee, 0x6804, 0x9005, 0x0904,
+	0xd9d6, 0x2d78, 0x6003, 0x0007, 0x080c, 0x1053, 0x0904, 0xd997,
+	0x7800, 0xd08c, 0x1118, 0x7804, 0x8001, 0x7806, 0x6017, 0x0000,
+	0x2001, 0x180f, 0x2004, 0xd084, 0x1904, 0xd9f9, 0x9006, 0xa802,
+	0xa867, 0x0116, 0xa86a, 0x6008, 0xa8e2, 0x2c00, 0xa87a, 0x6010,
+	0x2058, 0xb8a0, 0x7130, 0xa9b6, 0xa876, 0xb928, 0xa9ba, 0xb92c,
+	0xa9be, 0xb930, 0xa9c2, 0xb934, 0xa9c6, 0xa883, 0x003d, 0x7044,
+	0x9084, 0x0003, 0x9080, 0xd993, 0x2005, 0xa87e, 0x20a9, 0x000a,
+	0x2001, 0x0270, 0xaa5c, 0x9290, 0x0021, 0x2009, 0x0205, 0x200b,
+	0x0080, 0x20e1, 0x0000, 0xab60, 0x23e8, 0x2098, 0x22a0, 0x4003,
+	0x200b, 0x0000, 0x2001, 0x027a, 0x200c, 0xa9b2, 0x8000, 0x200c,
+	0xa9ae, 0x080c, 0x6d7e, 0x002e, 0x004e, 0x00fe, 0x00ee, 0x00de,
+	0x00be, 0x009e, 0x0005, 0x0000, 0x0080, 0x0040, 0x0000, 0x2001,
+	0x1810, 0x2004, 0xd084, 0x0120, 0x080c, 0x103a, 0x1904, 0xd940,
+	0x6017, 0xf100, 0x6003, 0x0001, 0x6007, 0x0041, 0x2009, 0xa022,
+	0x080c, 0x9200, 0x0c00, 0x2069, 0x0260, 0x6848, 0x9084, 0xff00,
+	0x9086, 0x1200, 0x1198, 0x686c, 0x9084, 0x00ff, 0x0016, 0x6114,
+	0x918c, 0xf700, 0x910d, 0x6116, 0x001e, 0x6003, 0x0001, 0x6007,
+	0x0043, 0x2009, 0xa025, 0x080c, 0x9200, 0x0828, 0x6868, 0x602e,
+	0x686c, 0x6032, 0x6017, 0xf200, 0x6003, 0x0001, 0x6007, 0x0041,
+	0x2009, 0xa022, 0x080c, 0x9200, 0x0804, 0xd98b, 0x2001, 0x180e,
+	0x2004, 0xd0ec, 0x0120, 0x2011, 0x8049, 0x080c, 0x4b09, 0x6017,
+	0xf300, 0x0010, 0x6017, 0xf100, 0x6003, 0x0001, 0x6007, 0x0041,
+	0x2009, 0xa022, 0x080c, 0x9200, 0x0804, 0xd98b, 0x6017, 0xf500,
+	0x0c98, 0x6017, 0xf600, 0x0804, 0xd9ab, 0x6017, 0xf200, 0x0804,
+	0xd9ab, 0xa867, 0x0146, 0xa86b, 0x0000, 0x6008, 0xa886, 0x2c00,
+	0xa87a, 0x7044, 0x9084, 0x0003, 0x9080, 0xd993, 0x2005, 0xa87e,
+	0x2928, 0x6010, 0x2058, 0xb8a0, 0xa876, 0xb828, 0xa88a, 0xb82c,
+	0xa88e, 0xb830, 0xa892, 0xb834, 0xa896, 0xa883, 0x003d, 0x2009,
+	0x0205, 0x2104, 0x9085, 0x0080, 0x200a, 0x20e1, 0x0000, 0x2011,
+	0x0210, 0x2214, 0x9294, 0x0fff, 0xaaa2, 0x9282, 0x0111, 0x1a0c,
+	0x0d7d, 0x8210, 0x821c, 0x2001, 0x026c, 0x2098, 0xa860, 0x20e8,
+	0xa85c, 0x9080, 0x0029, 0x20a0, 0x2011, 0xda75, 0x2041, 0x0001,
+	0x223d, 0x9784, 0x00ff, 0x9322, 0x1208, 0x2300, 0x20a8, 0x4003,
+	0x931a, 0x0530, 0x8210, 0xd7fc, 0x1130, 0x8d68, 0x2d0a, 0x2001,
+	0x0260, 0x2098, 0x0c68, 0x2950, 0x080c, 0x1053, 0x0170, 0x2900,
+	0xb002, 0xa867, 0x0147, 0xa86b, 0x0000, 0xa860, 0x20e8, 0xa85c,
+	0x9080, 0x001b, 0x20a0, 0x8840, 0x08d8, 0x2548, 0xa800, 0x902d,
+	0x0118, 0x080c, 0x106c, 0x0cc8, 0x080c, 0x106c, 0x0804, 0xd997,
+	0x2548, 0x8847, 0x9885, 0x0046, 0xa866, 0x2009, 0x0205, 0x200b,
+	0x0000, 0x080c, 0xe27c, 0x0804, 0xd98b, 0x8010, 0x0004, 0x801a,
+	0x0006, 0x8018, 0x0008, 0x8016, 0x000a, 0x8014, 0x9186, 0x0013,
+	0x1160, 0x6004, 0x908a, 0x0057, 0x1a0c, 0x0d7d, 0x9082, 0x0040,
+	0x0a0c, 0x0d7d, 0x2008, 0x0804, 0xdb00, 0x9186, 0x0051, 0x0108,
+	0x0040, 0x080c, 0xaa9a, 0x01e8, 0x9086, 0x0002, 0x0904, 0xdb47,
+	0x00c0, 0x9186, 0x0027, 0x0180, 0x9186, 0x0048, 0x0128, 0x9186,
+	0x0014, 0x0150, 0x190c, 0x0d7d, 0x080c, 0xaa9a, 0x0150, 0x9086,
+	0x0004, 0x0904, 0xdbe4, 0x0028, 0x6004, 0x9082, 0x0040, 0x2008,
+	0x001a, 0x080c, 0xac99, 0x0005, 0xdac7, 0xdac9, 0xdac9, 0xdaf0,
+	0xdac7, 0xdac7, 0xdac7, 0xdac7, 0xdac7, 0xdac7, 0xdac7, 0xdac7,
+	0xdac7, 0xdac7, 0xdac7, 0xdac7, 0xdac7, 0xdac7, 0xdac7, 0x080c,
+	0x0d7d, 0x080c, 0x95c6, 0x080c, 0x9684, 0x0036, 0x0096, 0x6014,
+	0x904d, 0x01d8, 0x080c, 0xc832, 0x01c0, 0x6003, 0x0002, 0x6010,
+	0x00b6, 0x2058, 0xb800, 0x00be, 0xd0bc, 0x1178, 0x2019, 0x0004,
+	0x080c, 0xe27c, 0x6017, 0x0000, 0x6018, 0x9005, 0x1120, 0x2001,
+	0x1986, 0x2004, 0x601a, 0x6003, 0x0007, 0x009e, 0x003e, 0x0005,
+	0x0096, 0x080c, 0x95c6, 0x080c, 0x9684, 0x080c, 0xc832, 0x0120,
+	0x6014, 0x2048, 0x080c, 0x106c, 0x080c, 0xac1a, 0x009e, 0x0005,
+	0x0002, 0xdb14, 0xdb29, 0xdb16, 0xdb3e, 0xdb14, 0xdb14, 0xdb14,
+	0xdb14, 0xdb14, 0xdb14, 0xdb14, 0xdb14, 0xdb14, 0xdb14, 0xdb14,
+	0xdb14, 0xdb14, 0xdb14, 0xdb14, 0x080c, 0x0d7d, 0x0096, 0x6014,
+	0x2048, 0xa87c, 0xd0b4, 0x0138, 0x6003, 0x0007, 0x2009, 0x0043,
+	0x080c, 0xac7c, 0x0010, 0x6003, 0x0004, 0x080c, 0x9684, 0x009e,
+	0x0005, 0x080c, 0xc832, 0x0138, 0x6114, 0x0096, 0x2148, 0xa97c,
+	0x009e, 0xd1ec, 0x1138, 0x080c, 0x88a3, 0x080c, 0xabdf, 0x080c,
+	0x9684, 0x0005, 0x080c, 0xe4dc, 0x0db0, 0x0cc8, 0x6003, 0x0001,
+	0x6007, 0x0041, 0x2009, 0xa022, 0x080c, 0x9200, 0x0005, 0x9182,
+	0x0040, 0x0002, 0xdb5d, 0xdb5f, 0xdb5d, 0xdb5d, 0xdb5d, 0xdb5d,
+	0xdb5d, 0xdb5d, 0xdb5d, 0xdb5d, 0xdb5d, 0xdb5d, 0xdb5d, 0xdb5d,
+	0xdb5d, 0xdb5d, 0xdb5d, 0xdb60, 0xdb5d, 0x080c, 0x0d7d, 0x0005,
+	0x00d6, 0x080c, 0x88a3, 0x00de, 0x080c, 0xe534, 0x080c, 0xabdf,
+	0x0005, 0x9182, 0x0040, 0x0002, 0xdb7f, 0xdb7f, 0xdb7f, 0xdb7f,
+	0xdb7f, 0xdb7f, 0xdb7f, 0xdb7f, 0xdb7f, 0xdb81, 0xdbac, 0xdb7f,
+	0xdb7f, 0xdb7f, 0xdb7f, 0xdbac, 0xdb7f, 0xdb7f, 0xdb7f, 0x080c,
+	0x0d7d, 0x6014, 0x0096, 0x2048, 0xa87c, 0xd0fc, 0x0168, 0x908c,
+	0x0003, 0x918e, 0x0002, 0x0180, 0x6144, 0xd1e4, 0x1168, 0x2009,
+	0x0041, 0x009e, 0x0804, 0xdc6c, 0x6003, 0x0007, 0x601b, 0x0000,
+	0x080c, 0x88a3, 0x009e, 0x0005, 0x6014, 0x2048, 0xa97c, 0xd1ec,
+	0x1130, 0x080c, 0x88a3, 0x080c, 0xabdf, 0x009e, 0x0005, 0x080c,
+	0xe4dc, 0x0db8, 0x009e, 0x0005, 0x2001, 0x180c, 0x200c, 0xc1d4,
+	0x2102, 0x0036, 0x080c, 0x9621, 0x080c, 0x9684, 0x6014, 0x0096,
+	0x2048, 0x6010, 0x00b6, 0x2058, 0xb800, 0x00be, 0xd0bc, 0x0188,
+	0xa87c, 0x9084, 0x0003, 0x9086, 0x0002, 0x0140, 0xa8ac, 0x6330,
+	0x931a, 0x6332, 0xa8b0, 0x632c, 0x931b, 0x632e, 0x6003, 0x0002,
+	0x0080, 0x2019, 0x0004, 0x080c, 0xe27c, 0x6018, 0x9005, 0x1128,
+	0x2001, 0x1986, 0x2004, 0x8003, 0x601a, 0x6017, 0x0000, 0x6003,
+	0x0007, 0x009e, 0x003e, 0x0005, 0x9182, 0x0040, 0x0002, 0xdbfb,
+	0xdbfb, 0xdbfb, 0xdbfb, 0xdbfb, 0xdbfb, 0xdbfb, 0xdbfb, 0xdbfd,
+	0xdbfb, 0xdbfb, 0xdbfb, 0xdbfb, 0xdbfb, 0xdbfb, 0xdbfb, 0xdbfb,
+	0xdbfb, 0xdbfb, 0xdc48, 0x080c, 0x0d7d, 0x6014, 0x0096, 0x2048,
+	0xa834, 0xaa38, 0x6110, 0x00b6, 0x2158, 0xb900, 0x00be, 0xd1bc,
+	0x1190, 0x920d, 0x1518, 0xa87c, 0xd0fc, 0x0128, 0x2009, 0x0041,
+	0x009e, 0x0804, 0xdc6c, 0x6003, 0x0007, 0x601b, 0x0000, 0x080c,
+	0x88a3, 0x009e, 0x0005, 0x6124, 0xd1f4, 0x1d58, 0x0006, 0x0046,
+	0xacac, 0x9422, 0xa9b0, 0x2200, 0x910b, 0x6030, 0x9420, 0x6432,
+	0x602c, 0x9109, 0x612e, 0x004e, 0x000e, 0x08d8, 0x6110, 0x00b6,
+	0x2158, 0xb900, 0x00be, 0xd1bc, 0x1178, 0x2009, 0x180e, 0x210c,
+	0xd19c, 0x0118, 0x6003, 0x0007, 0x0010, 0x6003, 0x0006, 0x00e9,
+	0x080c, 0x88a5, 0x009e, 0x0005, 0x6003, 0x0002, 0x009e, 0x0005,
+	0x6024, 0xd0f4, 0x0128, 0x080c, 0x167d, 0x1904, 0xdbfd, 0x0005,
+	0x6014, 0x0096, 0x2048, 0xa834, 0xa938, 0x009e, 0x9105, 0x1120,
+	0x080c, 0x167d, 0x1904, 0xdbfd, 0x0005, 0xd2fc, 0x0140, 0x8002,
+	0x8000, 0x8212, 0x9291, 0x0000, 0x2009, 0x0009, 0x0010, 0x2009,
+	0x0015, 0xaa9a, 0xa896, 0x0005, 0x9182, 0x0040, 0x0208, 0x0062,
+	0x9186, 0x0013, 0x0120, 0x9186, 0x0014, 0x190c, 0x0d7d, 0x6024,
+	0xd0dc, 0x090c, 0x0d7d, 0x0005, 0xdc8f, 0xdc9b, 0xdca7, 0xdcb3,
+	0xdc8f, 0xdc8f, 0xdc8f, 0xdc8f, 0xdc96, 0xdc91, 0xdc91, 0xdc8f,
+	0xdc8f, 0xdc8f, 0xdc8f, 0xdc91, 0xdc8f, 0xdc91, 0xdc8f, 0x080c,
+	0x0d7d, 0x6024, 0xd0dc, 0x090c, 0x0d7d, 0x0005, 0x6014, 0x9005,
+	0x190c, 0x0d7d, 0x0005, 0x6003, 0x0001, 0x6106, 0x0126, 0x2091,
+	0x8000, 0x2009, 0xa022, 0x080c, 0x91e2, 0x012e, 0x0005, 0x6003,
+	0x0004, 0x6106, 0x0126, 0x2091, 0x8000, 0x2009, 0xa001, 0x080c,
+	0x9200, 0x012e, 0x0005, 0x6003, 0x0003, 0x6106, 0x080c, 0x1c10,
+	0x0126, 0x2091, 0x8000, 0x6014, 0x0096, 0x2048, 0xa87c, 0xd0fc,
+	0x0188, 0x9084, 0x0003, 0x9086, 0x0002, 0x01a0, 0x6024, 0xd0cc,
+	0x1148, 0xd0c4, 0x1138, 0xa8a8, 0x9005, 0x1120, 0x6144, 0x918d,
+	0xb035, 0x0018, 0x6144, 0x918d, 0xa035, 0x009e, 0x080c, 0x9247,
+	0x012e, 0x0005, 0x6144, 0x918d, 0xa032, 0x0cb8, 0x0126, 0x2091,
+	0x8000, 0x0036, 0x0096, 0x9182, 0x0040, 0x0023, 0x009e, 0x003e,
+	0x012e, 0x0005, 0xdcfa, 0xdcfc, 0xdd11, 0xdd2b, 0xdcfa, 0xdcfa,
+	0xdcfa, 0xdcfa, 0xdcfa, 0xdcfa, 0xdcfa, 0xdcfa, 0xdcfa, 0xdcfa,
+	0xdcfa, 0xdcfa, 0x080c, 0x0d7d, 0x6014, 0x2048, 0xa87c, 0xd0fc,
+	0x0510, 0x909c, 0x0003, 0x939e, 0x0003, 0x01e8, 0x6003, 0x0001,
+	0x6106, 0x0126, 0x2091, 0x8000, 0x2009, 0xa022, 0x080c, 0x9200,
+	0x0470, 0x6014, 0x2048, 0xa87c, 0xd0fc, 0x0168, 0x909c, 0x0003,
+	0x939e, 0x0003, 0x0140, 0x6003, 0x0001, 0x6106, 0x2009, 0xa001,
+	0x080c, 0x9200, 0x00e0, 0x901e, 0x6316, 0x631a, 0x2019, 0x0004,
+	0x080c, 0xe27c, 0x00a0, 0x6014, 0x2048, 0xa87c, 0xd0fc, 0x0d98,
+	0x909c, 0x0003, 0x939e, 0x0003, 0x0d70, 0x6003, 0x0003, 0x6106,
+	0x080c, 0x1c10, 0x6144, 0x918d, 0xa035, 0x080c, 0x9247, 0x0005,
+	0x080c, 0x95c6, 0x6114, 0x81ff, 0x0158, 0x0096, 0x2148, 0x080c,
+	0xe631, 0x0036, 0x2019, 0x0029, 0x080c, 0xe27c, 0x003e, 0x009e,
+	0x080c, 0xac1a, 0x080c, 0x9684, 0x0005, 0x080c, 0x9621, 0x6114,
+	0x81ff, 0x0158, 0x0096, 0x2148, 0x080c, 0xe631, 0x0036, 0x2019,
+	0x0029, 0x080c, 0xe27c, 0x003e, 0x009e, 0x080c, 0xac1a, 0x0005,
+	0x9182, 0x0085, 0x0002, 0xdd7a, 0xdd78, 0xdd78, 0xdd86, 0xdd78,
+	0xdd78, 0xdd78, 0xdd78, 0xdd78, 0xdd78, 0xdd78, 0xdd78, 0xdd78,
+	0x080c, 0x0d7d, 0x6003, 0x000b, 0x6106, 0x0126, 0x2091, 0x8000,
+	0x2009, 0x8020, 0x080c, 0x9200, 0x012e, 0x0005, 0x0026, 0x00e6,
+	0x080c, 0xe4d3, 0x0118, 0x080c, 0xabdf, 0x0440, 0x2071, 0x0260,
+	0x7224, 0x6216, 0x2001, 0x180e, 0x2004, 0xd0e4, 0x0150, 0x6010,
+	0x00b6, 0x2058, 0xbca0, 0x00be, 0x2c00, 0x2011, 0x014e, 0x080c,
+	0xaf0a, 0x7220, 0x080c, 0xe112, 0x0118, 0x6007, 0x0086, 0x0040,
+	0x6007, 0x0087, 0x7224, 0x9296, 0xffff, 0x1110, 0x6007, 0x0086,
+	0x6003, 0x0001, 0x2009, 0x8020, 0x080c, 0x9200, 0x00ee, 0x002e,
+	0x0005, 0x9186, 0x0013, 0x1160, 0x6004, 0x908a, 0x0085, 0x0a0c,
+	0x0d7d, 0x908a, 0x0092, 0x1a0c, 0x0d7d, 0x9082, 0x0085, 0x00a2,
+	0x9186, 0x0027, 0x0130, 0x9186, 0x0014, 0x0118, 0x080c, 0xac99,
+	0x0050, 0x2001, 0x0007, 0x080c, 0x659c, 0x080c, 0x95c6, 0x080c,
+	0xac1a, 0x080c, 0x9684, 0x0005, 0xdde9, 0xddeb, 0xddeb, 0xdde9,
+	0xdde9, 0xdde9, 0xdde9, 0xdde9, 0xdde9, 0xdde9, 0xdde9, 0xdde9,
+	0xdde9, 0x080c, 0x0d7d, 0x080c, 0xac1a, 0x080c, 0x9684, 0x0005,
+	0x9182, 0x0085, 0x0a0c, 0x0d7d, 0x9182, 0x0092, 0x1a0c, 0x0d7d,
+	0x9182, 0x0085, 0x0002, 0xde08, 0xde08, 0xde08, 0xde0a, 0xde08,
+	0xde08, 0xde08, 0xde08, 0xde08, 0xde08, 0xde08, 0xde08, 0xde08,
+	0x080c, 0x0d7d, 0x0005, 0x9186, 0x0013, 0x0148, 0x9186, 0x0014,
+	0x0130, 0x9186, 0x0027, 0x0118, 0x080c, 0xac99, 0x0020, 0x080c,
+	0x95c6, 0x080c, 0xac1a, 0x0005, 0x0036, 0x080c, 0xe534, 0x604b,
+	0x0000, 0x2019, 0x000b, 0x0031, 0x6023, 0x0006, 0x6003, 0x0007,
+	0x003e, 0x0005, 0x0126, 0x0036, 0x2091, 0x8000, 0x2001, 0x0382,
+	0x2004, 0x9084, 0x0007, 0x0006, 0x9086, 0x0003, 0x0110, 0x080c,
+	0xa888, 0x0086, 0x2c40, 0x0096, 0x904e, 0x080c, 0xa1fa, 0x009e,
+	0x008e, 0x1558, 0x0076, 0x2c38, 0x080c, 0xa2a5, 0x007e, 0x1528,
+	0x6000, 0x9086, 0x0000, 0x0508, 0x6020, 0x9086, 0x0007, 0x01e8,
+	0x0096, 0x601c, 0xd084, 0x0140, 0x080c, 0xe534, 0x080c, 0xcf69,
+	0x080c, 0x1a77, 0x6023, 0x0007, 0x6014, 0x2048, 0x080c, 0xc832,
+	0x0110, 0x080c, 0xe27c, 0x009e, 0x9006, 0x6046, 0x6016, 0x080c,
+	0xe534, 0x6023, 0x0007, 0x080c, 0xcf69, 0x000e, 0x9086, 0x0003,
+	0x0110, 0x080c, 0xa8a4, 0x003e, 0x012e, 0x0005, 0x00f6, 0x00c6,
 	0x00b6, 0x0036, 0x0156, 0x2079, 0x0260, 0x7938, 0x783c, 0x080c,
-	0x25fb, 0x15e8, 0x0016, 0x00c6, 0x080c, 0x6625, 0x15b0, 0x001e,
-	0x00c6, 0x2160, 0x080c, 0xcf67, 0x00ce, 0x002e, 0x0026, 0x0016,
-	0x080c, 0xa896, 0x2019, 0x0029, 0x080c, 0xa38a, 0x080c, 0x93a5,
-	0x0076, 0x903e, 0x080c, 0x9277, 0x007e, 0x001e, 0x0076, 0x903e,
-	0x080c, 0xdfeb, 0x007e, 0x080c, 0xa8b2, 0x0026, 0xba04, 0x9294,
+	0x2614, 0x15e8, 0x0016, 0x00c6, 0x080c, 0x6620, 0x15b0, 0x001e,
+	0x00c6, 0x2160, 0x080c, 0xcf66, 0x00ce, 0x002e, 0x0026, 0x0016,
+	0x080c, 0xa888, 0x2019, 0x0029, 0x080c, 0xa372, 0x080c, 0x938d,
+	0x0076, 0x903e, 0x080c, 0x9256, 0x007e, 0x001e, 0x0076, 0x903e,
+	0x080c, 0xdffb, 0x007e, 0x080c, 0xa8a4, 0x0026, 0xba04, 0x9294,
 	0xff00, 0x8217, 0x9286, 0x0006, 0x0118, 0x9286, 0x0004, 0x1118,
-	0xbaa0, 0x080c, 0x32be, 0x002e, 0xbc84, 0x001e, 0x080c, 0x6043,
+	0xbaa0, 0x080c, 0x32ba, 0x002e, 0xbc84, 0x001e, 0x080c, 0x603e,
 	0xbe12, 0xbd16, 0xbc86, 0x9006, 0x0010, 0x00ce, 0x001e, 0x015e,
 	0x003e, 0x00be, 0x00ce, 0x00fe, 0x0005, 0x00c6, 0x00d6, 0x00b6,
-	0x0016, 0x2009, 0x1824, 0x2104, 0x9086, 0x0074, 0x1904, 0xdf0e,
+	0x0016, 0x2009, 0x1824, 0x2104, 0x9086, 0x0074, 0x1904, 0xdf1e,
 	0x2069, 0x0260, 0x6944, 0x9182, 0x0100, 0x06e0, 0x6940, 0x9184,
-	0x8000, 0x0904, 0xdf0b, 0x2001, 0x197c, 0x2004, 0x9005, 0x1140,
+	0x8000, 0x0904, 0xdf1b, 0x2001, 0x197b, 0x2004, 0x9005, 0x1140,
 	0x6010, 0x2058, 0xb884, 0x9005, 0x0118, 0x9184, 0x0800, 0x0598,
-	0x6948, 0x918a, 0x0001, 0x0648, 0x080c, 0xe689, 0x0118, 0x6978,
+	0x6948, 0x918a, 0x0001, 0x0648, 0x080c, 0xe699, 0x0118, 0x6978,
 	0xd1fc, 0x11b8, 0x2009, 0x0205, 0x200b, 0x0001, 0x693c, 0x81ff,
 	0x1198, 0x6944, 0x9182, 0x0100, 0x02a8, 0x6940, 0x81ff, 0x1178,
 	0x6948, 0x918a, 0x0001, 0x0288, 0x6950, 0x918a, 0x0001, 0x0298,
@@ -6936,115 +6938,115 @@ unsigned short risc_code01[] = {
 	0x0005, 0x00c6, 0x00b6, 0x0026, 0x0036, 0x0156, 0x6210, 0x2258,
 	0xbb04, 0x9394, 0x00ff, 0x9286, 0x0006, 0x0180, 0x9286, 0x0004,
 	0x0168, 0x9394, 0xff00, 0x8217, 0x9286, 0x0006, 0x0138, 0x9286,
-	0x0004, 0x0120, 0x080c, 0x6634, 0x0804, 0xdf7a, 0x2011, 0x0276,
-	0x20a9, 0x0004, 0x0096, 0x2b48, 0x2019, 0x000a, 0x080c, 0xbbc2,
+	0x0004, 0x0120, 0x080c, 0x662f, 0x0804, 0xdf8a, 0x2011, 0x0276,
+	0x20a9, 0x0004, 0x0096, 0x2b48, 0x2019, 0x000a, 0x080c, 0xbbb5,
 	0x009e, 0x15c8, 0x2011, 0x027a, 0x20a9, 0x0004, 0x0096, 0x2b48,
-	0x2019, 0x0006, 0x080c, 0xbbc2, 0x009e, 0x1568, 0x0046, 0x0016,
+	0x2019, 0x0006, 0x080c, 0xbbb5, 0x009e, 0x1568, 0x0046, 0x0016,
 	0xbaa0, 0x2220, 0x9006, 0x2009, 0x1848, 0x210c, 0xd1a4, 0x0138,
-	0x2009, 0x0029, 0x080c, 0xe2c9, 0xb800, 0xc0e5, 0xb802, 0x080c,
-	0xa896, 0x2019, 0x0029, 0x080c, 0x93a5, 0x0076, 0x2039, 0x0000,
-	0x080c, 0x9277, 0x2c08, 0x080c, 0xdfeb, 0x007e, 0x080c, 0xa8b2,
-	0x2001, 0x0007, 0x080c, 0x65a1, 0x2001, 0x0007, 0x080c, 0x6575,
+	0x2009, 0x0029, 0x080c, 0xe2d9, 0xb800, 0xc0e5, 0xb802, 0x080c,
+	0xa888, 0x2019, 0x0029, 0x080c, 0x938d, 0x0076, 0x2039, 0x0000,
+	0x080c, 0x9256, 0x2c08, 0x080c, 0xdffb, 0x007e, 0x080c, 0xa8a4,
+	0x2001, 0x0007, 0x080c, 0x659c, 0x2001, 0x0007, 0x080c, 0x6570,
 	0x001e, 0x004e, 0x9006, 0x015e, 0x003e, 0x002e, 0x00be, 0x00ce,
 	0x0005, 0x00d6, 0x2069, 0x026e, 0x6800, 0x9086, 0x0800, 0x0118,
 	0x6017, 0x0000, 0x0008, 0x9006, 0x00de, 0x0005, 0x00b6, 0x00f6,
 	0x0016, 0x0026, 0x0036, 0x0156, 0x2079, 0x026c, 0x7930, 0x7834,
-	0x080c, 0x25fb, 0x11d0, 0x080c, 0x6625, 0x11b8, 0x2011, 0x0270,
-	0x20a9, 0x0004, 0x0096, 0x2b48, 0x2019, 0x000a, 0x080c, 0xbbc2,
+	0x080c, 0x2614, 0x11d0, 0x080c, 0x6620, 0x11b8, 0x2011, 0x0270,
+	0x20a9, 0x0004, 0x0096, 0x2b48, 0x2019, 0x000a, 0x080c, 0xbbb5,
 	0x009e, 0x1158, 0x2011, 0x0274, 0x20a9, 0x0004, 0x0096, 0x2b48,
-	0x2019, 0x0006, 0x080c, 0xbbc2, 0x009e, 0x015e, 0x003e, 0x002e,
+	0x2019, 0x0006, 0x080c, 0xbbb5, 0x009e, 0x015e, 0x003e, 0x002e,
 	0x001e, 0x00fe, 0x00be, 0x0005, 0x00b6, 0x0006, 0x0016, 0x0026,
 	0x0036, 0x0156, 0x2011, 0x0263, 0x2204, 0x8211, 0x220c, 0x080c,
-	0x25fb, 0x11d0, 0x080c, 0x6625, 0x11b8, 0x2011, 0x0276, 0x20a9,
-	0x0004, 0x0096, 0x2b48, 0x2019, 0x000a, 0x080c, 0xbbc2, 0x009e,
+	0x2614, 0x11d0, 0x080c, 0x6620, 0x11b8, 0x2011, 0x0276, 0x20a9,
+	0x0004, 0x0096, 0x2b48, 0x2019, 0x000a, 0x080c, 0xbbb5, 0x009e,
 	0x1158, 0x2011, 0x027a, 0x20a9, 0x0004, 0x0096, 0x2b48, 0x2019,
-	0x0006, 0x080c, 0xbbc2, 0x009e, 0x015e, 0x003e, 0x002e, 0x001e,
+	0x0006, 0x080c, 0xbbb5, 0x009e, 0x015e, 0x003e, 0x002e, 0x001e,
 	0x000e, 0x00be, 0x0005, 0x00e6, 0x00c6, 0x0086, 0x0076, 0x0066,
-	0x0056, 0x0046, 0x0026, 0x0126, 0x2091, 0x8000, 0x080c, 0xa8f4,
-	0x0106, 0x190c, 0xa896, 0x2740, 0x2029, 0x19f3, 0x252c, 0x2021,
-	0x19fa, 0x2424, 0x2061, 0x1ddc, 0x2071, 0x1800, 0x7654, 0x7074,
-	0x81ff, 0x0150, 0x0006, 0x9186, 0x1b32, 0x000e, 0x0128, 0x8001,
-	0x9602, 0x1a04, 0xe090, 0x0018, 0x9606, 0x0904, 0xe090, 0x080c,
-	0x8b90, 0x0904, 0xe087, 0x2100, 0x9c06, 0x0904, 0xe087, 0x080c,
-	0xe30a, 0x1904, 0xe087, 0x080c, 0xe6a6, 0x0904, 0xe087, 0x080c,
-	0xe2fa, 0x0904, 0xe087, 0x6720, 0x9786, 0x0001, 0x1148, 0x080c,
-	0x3363, 0x0904, 0xe0d2, 0x6004, 0x9086, 0x0000, 0x1904, 0xe0d2,
-	0x9786, 0x0004, 0x0904, 0xe0d2, 0x9786, 0x0007, 0x0904, 0xe087,
-	0x2500, 0x9c06, 0x0904, 0xe087, 0x2400, 0x9c06, 0x0904, 0xe087,
+	0x0056, 0x0046, 0x0026, 0x0126, 0x2091, 0x8000, 0x080c, 0xa8e6,
+	0x0106, 0x190c, 0xa888, 0x2740, 0x2029, 0x19f2, 0x252c, 0x2021,
+	0x19f9, 0x2424, 0x2061, 0x1ddc, 0x2071, 0x1800, 0x7654, 0x7074,
+	0x81ff, 0x0150, 0x0006, 0x9186, 0x1b31, 0x000e, 0x0128, 0x8001,
+	0x9602, 0x1a04, 0xe0a0, 0x0018, 0x9606, 0x0904, 0xe0a0, 0x080c,
+	0x8b72, 0x0904, 0xe097, 0x2100, 0x9c06, 0x0904, 0xe097, 0x080c,
+	0xe31a, 0x1904, 0xe097, 0x080c, 0xe6b6, 0x0904, 0xe097, 0x080c,
+	0xe30a, 0x0904, 0xe097, 0x6720, 0x9786, 0x0001, 0x1148, 0x080c,
+	0x3357, 0x0904, 0xe0e2, 0x6004, 0x9086, 0x0000, 0x1904, 0xe0e2,
+	0x9786, 0x0004, 0x0904, 0xe0e2, 0x9786, 0x0007, 0x0904, 0xe097,
+	0x2500, 0x9c06, 0x0904, 0xe097, 0x2400, 0x9c06, 0x0904, 0xe097,
 	0x88ff, 0x0118, 0x605c, 0x9906, 0x15d0, 0x0096, 0x6043, 0xffff,
-	0x6000, 0x9086, 0x0004, 0x1120, 0x0016, 0x080c, 0x1a6a, 0x001e,
-	0x9786, 0x000a, 0x0148, 0x080c, 0xca4d, 0x1130, 0x080c, 0xb5b5,
-	0x009e, 0x080c, 0xac28, 0x0418, 0x6014, 0x2048, 0x080c, 0xc838,
+	0x6000, 0x9086, 0x0004, 0x1120, 0x0016, 0x080c, 0x1a77, 0x001e,
+	0x9786, 0x000a, 0x0148, 0x080c, 0xca47, 0x1130, 0x080c, 0xb5a6,
+	0x009e, 0x080c, 0xac1a, 0x0418, 0x6014, 0x2048, 0x080c, 0xc832,
 	0x01d8, 0x9786, 0x0003, 0x1588, 0xa867, 0x0103, 0xa87c, 0xd0cc,
 	0x0130, 0x0096, 0xa878, 0x2048, 0x080c, 0x0fec, 0x009e, 0xab7a,
-	0xa877, 0x0000, 0x080c, 0xe621, 0x0016, 0x080c, 0xcb36, 0x080c,
-	0x6d74, 0x001e, 0x080c, 0xca27, 0x009e, 0x080c, 0xac28, 0x9ce0,
-	0x001c, 0x2001, 0x181a, 0x2004, 0x9c02, 0x1210, 0x0804, 0xe004,
-	0x010e, 0x190c, 0xa8b2, 0x012e, 0x002e, 0x004e, 0x005e, 0x006e,
+	0xa877, 0x0000, 0x080c, 0xe631, 0x0016, 0x080c, 0xcb35, 0x080c,
+	0x6d6f, 0x001e, 0x080c, 0xca21, 0x009e, 0x080c, 0xac1a, 0x9ce0,
+	0x001c, 0x2001, 0x181a, 0x2004, 0x9c02, 0x1210, 0x0804, 0xe014,
+	0x010e, 0x190c, 0xa8a4, 0x012e, 0x002e, 0x004e, 0x005e, 0x006e,
 	0x007e, 0x008e, 0x00ce, 0x00ee, 0x0005, 0x9786, 0x0006, 0x1150,
-	0x9386, 0x0005, 0x0128, 0x080c, 0xe621, 0x080c, 0xe26c, 0x08e0,
+	0x9386, 0x0005, 0x0128, 0x080c, 0xe631, 0x080c, 0xe27c, 0x08e0,
 	0x009e, 0x08e8, 0x9786, 0x0009, 0x11f8, 0x6000, 0x9086, 0x0004,
-	0x01c0, 0x6000, 0x9086, 0x0003, 0x11a0, 0x080c, 0x963b, 0x0096,
-	0x6114, 0x2148, 0x080c, 0xc838, 0x0118, 0x6010, 0x080c, 0x6d80,
-	0x009e, 0x00c6, 0x080c, 0xabed, 0x00ce, 0x0036, 0x080c, 0x96a0,
-	0x003e, 0x009e, 0x0804, 0xe087, 0x9786, 0x000a, 0x0904, 0xe06e,
-	0x0804, 0xe06c, 0x81ff, 0x0904, 0xe087, 0x9180, 0x0001, 0x2004,
+	0x01c0, 0x6000, 0x9086, 0x0003, 0x11a0, 0x080c, 0x9621, 0x0096,
+	0x6114, 0x2148, 0x080c, 0xc832, 0x0118, 0x6010, 0x080c, 0x6d7b,
+	0x009e, 0x00c6, 0x080c, 0xabdf, 0x00ce, 0x0036, 0x080c, 0x9684,
+	0x003e, 0x009e, 0x0804, 0xe097, 0x9786, 0x000a, 0x0904, 0xe07e,
+	0x0804, 0xe07c, 0x81ff, 0x0904, 0xe097, 0x9180, 0x0001, 0x2004,
 	0x9086, 0x0018, 0x0138, 0x9180, 0x0001, 0x2004, 0x9086, 0x002d,
-	0x1904, 0xe087, 0x6000, 0x9086, 0x0002, 0x1904, 0xe087, 0x080c,
-	0xca3c, 0x0138, 0x080c, 0xca4d, 0x1904, 0xe087, 0x080c, 0xb5b5,
-	0x0038, 0x080c, 0x321c, 0x080c, 0xca4d, 0x1110, 0x080c, 0xb5b5,
-	0x080c, 0xac28, 0x0804, 0xe087, 0xa864, 0x9084, 0x00ff, 0x9086,
+	0x1904, 0xe097, 0x6000, 0x9086, 0x0002, 0x1904, 0xe097, 0x080c,
+	0xca36, 0x0138, 0x080c, 0xca47, 0x1904, 0xe097, 0x080c, 0xb5a6,
+	0x0038, 0x080c, 0x321e, 0x080c, 0xca47, 0x1110, 0x080c, 0xb5a6,
+	0x080c, 0xac1a, 0x0804, 0xe097, 0xa864, 0x9084, 0x00ff, 0x9086,
 	0x0039, 0x0005, 0x00c6, 0x00e6, 0x0016, 0x2c08, 0x2170, 0x9006,
-	0x080c, 0xe293, 0x001e, 0x0120, 0x6020, 0x9084, 0x000f, 0x001b,
-	0x00ee, 0x00ce, 0x0005, 0xe121, 0xe121, 0xe121, 0xe121, 0xe121,
-	0xe121, 0xe123, 0xe121, 0xe121, 0xe121, 0xe121, 0xac28, 0xac28,
-	0xe121, 0x9006, 0x0005, 0x0036, 0x0046, 0x0016, 0x7010, 0x00b6,
-	0x2058, 0xbca0, 0x00be, 0x2c00, 0x2009, 0x0020, 0x080c, 0xe2c9,
-	0x001e, 0x004e, 0x2019, 0x0002, 0x080c, 0xde1b, 0x003e, 0x9085,
-	0x0001, 0x0005, 0x0096, 0x080c, 0xc838, 0x0140, 0x6014, 0x904d,
-	0x080c, 0xc443, 0x687b, 0x0005, 0x080c, 0x6d80, 0x009e, 0x080c,
-	0xac28, 0x9085, 0x0001, 0x0005, 0x2001, 0x0001, 0x080c, 0x6561,
+	0x080c, 0xe2a3, 0x001e, 0x0120, 0x6020, 0x9084, 0x000f, 0x001b,
+	0x00ee, 0x00ce, 0x0005, 0xe131, 0xe131, 0xe131, 0xe131, 0xe131,
+	0xe131, 0xe133, 0xe131, 0xe131, 0xe131, 0xe131, 0xac1a, 0xac1a,
+	0xe131, 0x9006, 0x0005, 0x0036, 0x0046, 0x0016, 0x7010, 0x00b6,
+	0x2058, 0xbca0, 0x00be, 0x2c00, 0x2009, 0x0020, 0x080c, 0xe2d9,
+	0x001e, 0x004e, 0x2019, 0x0002, 0x080c, 0xde2a, 0x003e, 0x9085,
+	0x0001, 0x0005, 0x0096, 0x080c, 0xc832, 0x0140, 0x6014, 0x904d,
+	0x080c, 0xc430, 0x687b, 0x0005, 0x080c, 0x6d7b, 0x009e, 0x080c,
+	0xac1a, 0x9085, 0x0001, 0x0005, 0x2001, 0x0001, 0x080c, 0x655c,
 	0x0156, 0x0016, 0x0026, 0x0036, 0x20a9, 0x0004, 0x2019, 0x1805,
-	0x2011, 0x0276, 0x080c, 0xbbae, 0x003e, 0x002e, 0x001e, 0x015e,
+	0x2011, 0x0276, 0x080c, 0xbba1, 0x003e, 0x002e, 0x001e, 0x015e,
 	0x9005, 0x0005, 0x00f6, 0x00e6, 0x00c6, 0x0086, 0x0076, 0x0066,
 	0x00b6, 0x0126, 0x2091, 0x8000, 0x2740, 0x2061, 0x1ddc, 0x2079,
-	0x0001, 0x8fff, 0x0904, 0xe1bc, 0x2071, 0x1800, 0x7654, 0x7074,
-	0x8001, 0x9602, 0x1a04, 0xe1bc, 0x88ff, 0x0120, 0x2800, 0x9c06,
-	0x1590, 0x2078, 0x080c, 0xe2fa, 0x0570, 0x2400, 0x9c06, 0x0558,
+	0x0001, 0x8fff, 0x0904, 0xe1cc, 0x2071, 0x1800, 0x7654, 0x7074,
+	0x8001, 0x9602, 0x1a04, 0xe1cc, 0x88ff, 0x0120, 0x2800, 0x9c06,
+	0x1590, 0x2078, 0x080c, 0xe30a, 0x0570, 0x2400, 0x9c06, 0x0558,
 	0x6720, 0x9786, 0x0006, 0x1538, 0x9786, 0x0007, 0x0520, 0x88ff,
 	0x1140, 0x6010, 0x9b06, 0x11f8, 0x85ff, 0x0118, 0x605c, 0x9106,
-	0x11d0, 0x0096, 0x601c, 0xd084, 0x0140, 0x080c, 0xe524, 0x080c,
-	0xcf6a, 0x080c, 0x1a6a, 0x6023, 0x0007, 0x6014, 0x2048, 0x080c,
-	0xc838, 0x0120, 0x0046, 0x080c, 0xe26c, 0x004e, 0x009e, 0x080c,
-	0xac28, 0x88ff, 0x1198, 0x9ce0, 0x001c, 0x2001, 0x181a, 0x2004,
-	0x9c02, 0x1210, 0x0804, 0xe171, 0x9006, 0x012e, 0x00be, 0x006e,
+	0x11d0, 0x0096, 0x601c, 0xd084, 0x0140, 0x080c, 0xe534, 0x080c,
+	0xcf69, 0x080c, 0x1a77, 0x6023, 0x0007, 0x6014, 0x2048, 0x080c,
+	0xc832, 0x0120, 0x0046, 0x080c, 0xe27c, 0x004e, 0x009e, 0x080c,
+	0xac1a, 0x88ff, 0x1198, 0x9ce0, 0x001c, 0x2001, 0x181a, 0x2004,
+	0x9c02, 0x1210, 0x0804, 0xe181, 0x9006, 0x012e, 0x00be, 0x006e,
 	0x007e, 0x008e, 0x00ce, 0x00ee, 0x00fe, 0x0005, 0x98c5, 0x0001,
-	0x0ca0, 0x080c, 0xa896, 0x00b6, 0x0076, 0x0056, 0x0086, 0x9046,
+	0x0ca0, 0x080c, 0xa888, 0x00b6, 0x0076, 0x0056, 0x0086, 0x9046,
 	0x2029, 0x0001, 0x2c20, 0x2019, 0x0002, 0x6210, 0x2258, 0x0096,
-	0x904e, 0x080c, 0xa218, 0x009e, 0x008e, 0x903e, 0x080c, 0xa2c3,
-	0x080c, 0xe162, 0x005e, 0x007e, 0x00be, 0x080c, 0xa8b2, 0x0005,
-	0x080c, 0xa896, 0x00b6, 0x0046, 0x0056, 0x0076, 0x00c6, 0x0156,
+	0x904e, 0x080c, 0xa1fa, 0x009e, 0x008e, 0x903e, 0x080c, 0xa2a5,
+	0x080c, 0xe172, 0x005e, 0x007e, 0x00be, 0x080c, 0xa8a4, 0x0005,
+	0x080c, 0xa888, 0x00b6, 0x0046, 0x0056, 0x0076, 0x00c6, 0x0156,
 	0x2c20, 0x2128, 0x20a9, 0x007f, 0x900e, 0x0016, 0x0036, 0x080c,
-	0x6625, 0x1190, 0x0056, 0x0086, 0x9046, 0x2508, 0x2029, 0x0001,
-	0x0096, 0x904e, 0x080c, 0xa218, 0x009e, 0x008e, 0x903e, 0x080c,
-	0xa2c3, 0x080c, 0xe162, 0x005e, 0x003e, 0x001e, 0x8108, 0x1f04,
-	0xe1f5, 0x015e, 0x00ce, 0x007e, 0x005e, 0x004e, 0x00be, 0x080c,
-	0xa8b2, 0x0005, 0x080c, 0xa896, 0x00b6, 0x0076, 0x0056, 0x6210,
+	0x6620, 0x1190, 0x0056, 0x0086, 0x9046, 0x2508, 0x2029, 0x0001,
+	0x0096, 0x904e, 0x080c, 0xa1fa, 0x009e, 0x008e, 0x903e, 0x080c,
+	0xa2a5, 0x080c, 0xe172, 0x005e, 0x003e, 0x001e, 0x8108, 0x1f04,
+	0xe205, 0x015e, 0x00ce, 0x007e, 0x005e, 0x004e, 0x00be, 0x080c,
+	0xa8a4, 0x0005, 0x080c, 0xa888, 0x00b6, 0x0076, 0x0056, 0x6210,
 	0x2258, 0x0086, 0x9046, 0x2029, 0x0001, 0x2019, 0x0048, 0x0096,
-	0x904e, 0x080c, 0xa218, 0x009e, 0x008e, 0x903e, 0x080c, 0xa2c3,
-	0x2c20, 0x080c, 0xe162, 0x005e, 0x007e, 0x00be, 0x080c, 0xa8b2,
-	0x0005, 0x080c, 0xa896, 0x00b6, 0x0046, 0x0056, 0x0076, 0x00c6,
+	0x904e, 0x080c, 0xa1fa, 0x009e, 0x008e, 0x903e, 0x080c, 0xa2a5,
+	0x2c20, 0x080c, 0xe172, 0x005e, 0x007e, 0x00be, 0x080c, 0xa8a4,
+	0x0005, 0x080c, 0xa888, 0x00b6, 0x0046, 0x0056, 0x0076, 0x00c6,
 	0x0156, 0x2c20, 0x20a9, 0x0800, 0x900e, 0x0016, 0x0036, 0x080c,
-	0x6625, 0x11a0, 0x0086, 0x9046, 0x2828, 0x0046, 0x2021, 0x0001,
-	0x080c, 0xe508, 0x004e, 0x0096, 0x904e, 0x080c, 0xa218, 0x009e,
-	0x008e, 0x903e, 0x080c, 0xa2c3, 0x080c, 0xe162, 0x003e, 0x001e,
-	0x8108, 0x1f04, 0xe245, 0x015e, 0x00ce, 0x007e, 0x005e, 0x004e,
-	0x00be, 0x080c, 0xa8b2, 0x0005, 0x0016, 0x00f6, 0x080c, 0xc836,
+	0x6620, 0x11a0, 0x0086, 0x9046, 0x2828, 0x0046, 0x2021, 0x0001,
+	0x080c, 0xe518, 0x004e, 0x0096, 0x904e, 0x080c, 0xa1fa, 0x009e,
+	0x008e, 0x903e, 0x080c, 0xa2a5, 0x080c, 0xe172, 0x003e, 0x001e,
+	0x8108, 0x1f04, 0xe255, 0x015e, 0x00ce, 0x007e, 0x005e, 0x004e,
+	0x00be, 0x080c, 0xa8a4, 0x0005, 0x0016, 0x00f6, 0x080c, 0xc830,
 	0x0198, 0xa864, 0x9084, 0x00ff, 0x9086, 0x0046, 0x0180, 0xa800,
-	0x907d, 0x0138, 0xa803, 0x0000, 0xab82, 0x080c, 0x6d80, 0x2f48,
-	0x0cb0, 0xab82, 0x080c, 0x6d80, 0x00fe, 0x001e, 0x0005, 0xa800,
-	0x907d, 0x0130, 0xa803, 0x0000, 0x080c, 0x6d80, 0x2f48, 0x0cb8,
-	0x080c, 0x6d80, 0x0c88, 0x00e6, 0x0046, 0x0036, 0x2061, 0x1ddc,
+	0x907d, 0x0138, 0xa803, 0x0000, 0xab82, 0x080c, 0x6d7b, 0x2f48,
+	0x0cb0, 0xab82, 0x080c, 0x6d7b, 0x00fe, 0x001e, 0x0005, 0xa800,
+	0x907d, 0x0130, 0xa803, 0x0000, 0x080c, 0x6d7b, 0x2f48, 0x0cb8,
+	0x080c, 0x6d7b, 0x0c88, 0x00e6, 0x0046, 0x0036, 0x2061, 0x1ddc,
 	0x9005, 0x1138, 0x2071, 0x1800, 0x7454, 0x7074, 0x8001, 0x9402,
 	0x12f8, 0x2100, 0x9c06, 0x0188, 0x6000, 0x9086, 0x0000, 0x0168,
 	0x6008, 0x9206, 0x1150, 0x6320, 0x9386, 0x0009, 0x01b0, 0x6010,
@@ -7052,90 +7054,90 @@ unsigned short risc_code01[] = {
 	0x181a, 0x2004, 0x9c02, 0x1220, 0x0c20, 0x9085, 0x0001, 0x0008,
 	0x9006, 0x003e, 0x004e, 0x00ee, 0x0005, 0x631c, 0xd3c4, 0x1d68,
 	0x0c30, 0x0096, 0x0006, 0x080c, 0x103a, 0x000e, 0x090c, 0x0d7d,
-	0xaae2, 0xa867, 0x010d, 0xa88e, 0x0026, 0x2010, 0x080c, 0xc826,
+	0xaae2, 0xa867, 0x010d, 0xa88e, 0x0026, 0x2010, 0x080c, 0xc820,
 	0x2001, 0x0000, 0x0120, 0x2200, 0x9080, 0x0017, 0x2004, 0x002e,
 	0xa87a, 0x9186, 0x0020, 0x0110, 0xa8e3, 0xffff, 0xa986, 0xac76,
-	0xa87f, 0x0000, 0x2001, 0x198e, 0x2004, 0xa882, 0x9006, 0xa802,
-	0xa86a, 0xa88a, 0x0126, 0x2091, 0x8000, 0x080c, 0x6d80, 0x012e,
+	0xa87f, 0x0000, 0x2001, 0x198d, 0x2004, 0xa882, 0x9006, 0xa802,
+	0xa86a, 0xa88a, 0x0126, 0x2091, 0x8000, 0x080c, 0x6d7b, 0x012e,
 	0x009e, 0x0005, 0x6700, 0x9786, 0x0000, 0x0158, 0x9786, 0x0001,
 	0x0140, 0x9786, 0x000a, 0x0128, 0x9786, 0x0009, 0x0110, 0x9085,
 	0x0001, 0x0005, 0x00e6, 0x6010, 0x9075, 0x0138, 0x00b6, 0x2058,
 	0xb8a0, 0x00be, 0x9206, 0x00ee, 0x0005, 0x9085, 0x0001, 0x0cd8,
 	0x0016, 0x6004, 0x908e, 0x001e, 0x11a0, 0x8007, 0x6134, 0x918c,
 	0x00ff, 0x9105, 0x6036, 0x6007, 0x0085, 0x6003, 0x000b, 0x6023,
-	0x0005, 0x2001, 0x1987, 0x2004, 0x601a, 0x2009, 0x8020, 0x080c,
-	0x921e, 0x001e, 0x0005, 0xa001, 0xa001, 0x0005, 0x6024, 0xd0e4,
-	0x0158, 0xd0cc, 0x0118, 0x080c, 0xcb7d, 0x0030, 0x080c, 0xe524,
-	0x080c, 0x88c1, 0x080c, 0xabed, 0x0005, 0x9280, 0x0008, 0x2004,
-	0x9084, 0x000f, 0x0002, 0xe359, 0xe359, 0xe359, 0xe35b, 0xe359,
-	0xe35b, 0xe35b, 0xe359, 0xe35b, 0xe359, 0xe359, 0xe359, 0xe359,
-	0xe359, 0x9006, 0x0005, 0x9085, 0x0001, 0x0005, 0x9280, 0x0008,
-	0x2004, 0x9084, 0x000f, 0x0002, 0xe372, 0xe372, 0xe372, 0xe372,
-	0xe372, 0xe372, 0xe37f, 0xe372, 0xe372, 0xe372, 0xe372, 0xe372,
-	0xe372, 0xe372, 0x6007, 0x003b, 0x602f, 0x0009, 0x6017, 0x2a00,
-	0x6003, 0x0001, 0x2009, 0x8020, 0x080c, 0x921e, 0x0005, 0x0096,
-	0x00c6, 0x2260, 0x080c, 0xe524, 0x604b, 0x0000, 0x6024, 0xc0f4,
+	0x0005, 0x2001, 0x1986, 0x2004, 0x601a, 0x2009, 0x8020, 0x080c,
+	0x9200, 0x001e, 0x0005, 0xa001, 0xa001, 0x0005, 0x6024, 0xd0e4,
+	0x0158, 0xd0cc, 0x0118, 0x080c, 0xcb7c, 0x0030, 0x080c, 0xe534,
+	0x080c, 0x88a3, 0x080c, 0xabdf, 0x0005, 0x9280, 0x0008, 0x2004,
+	0x9084, 0x000f, 0x0002, 0xe369, 0xe369, 0xe369, 0xe36b, 0xe369,
+	0xe36b, 0xe36b, 0xe369, 0xe36b, 0xe369, 0xe369, 0xe369, 0xe369,
+	0xe369, 0x9006, 0x0005, 0x9085, 0x0001, 0x0005, 0x9280, 0x0008,
+	0x2004, 0x9084, 0x000f, 0x0002, 0xe382, 0xe382, 0xe382, 0xe382,
+	0xe382, 0xe382, 0xe38f, 0xe382, 0xe382, 0xe382, 0xe382, 0xe382,
+	0xe382, 0xe382, 0x6007, 0x003b, 0x602f, 0x0009, 0x6017, 0x2a00,
+	0x6003, 0x0001, 0x2009, 0x8020, 0x080c, 0x9200, 0x0005, 0x0096,
+	0x00c6, 0x2260, 0x080c, 0xe534, 0x604b, 0x0000, 0x6024, 0xc0f4,
 	0xc0e4, 0x6026, 0x603b, 0x0000, 0x00ce, 0x00d6, 0x2268, 0x9186,
-	0x0007, 0x1904, 0xe3d8, 0x6814, 0x9005, 0x0138, 0x2048, 0xa87c,
+	0x0007, 0x1904, 0xe3e8, 0x6814, 0x9005, 0x0138, 0x2048, 0xa87c,
 	0xd0fc, 0x1118, 0x00de, 0x009e, 0x08a8, 0x6007, 0x003a, 0x6003,
-	0x0001, 0x2009, 0x8020, 0x080c, 0x921e, 0x00c6, 0x2d60, 0x6100,
-	0x9186, 0x0002, 0x1904, 0xe44f, 0x6014, 0x9005, 0x1138, 0x6000,
-	0x9086, 0x0007, 0x190c, 0x0d7d, 0x0804, 0xe44f, 0x2048, 0x080c,
-	0xc838, 0x1130, 0x0028, 0x2048, 0xa800, 0x9005, 0x1de0, 0x2900,
+	0x0001, 0x2009, 0x8020, 0x080c, 0x9200, 0x00c6, 0x2d60, 0x6100,
+	0x9186, 0x0002, 0x1904, 0xe45f, 0x6014, 0x9005, 0x1138, 0x6000,
+	0x9086, 0x0007, 0x190c, 0x0d7d, 0x0804, 0xe45f, 0x2048, 0x080c,
+	0xc832, 0x1130, 0x0028, 0x2048, 0xa800, 0x9005, 0x1de0, 0x2900,
 	0x2048, 0xa87c, 0x9084, 0x0003, 0x9086, 0x0002, 0x1168, 0xa87c,
 	0xc0dc, 0xc0f4, 0xa87e, 0xa880, 0xc0fc, 0xa882, 0x2009, 0x0043,
-	0x080c, 0xdc5d, 0x0804, 0xe44f, 0x2009, 0x0041, 0x0804, 0xe449,
+	0x080c, 0xdc6c, 0x0804, 0xe45f, 0x2009, 0x0041, 0x0804, 0xe459,
 	0x9186, 0x0005, 0x15a0, 0x6814, 0x2048, 0xa87c, 0xd0bc, 0x1120,
-	0x00de, 0x009e, 0x0804, 0xe372, 0xd0b4, 0x0128, 0xd0fc, 0x090c,
-	0x0d7d, 0x0804, 0xe393, 0x6007, 0x003a, 0x6003, 0x0001, 0x2009,
-	0x8020, 0x080c, 0x921e, 0x00c6, 0x2d60, 0x6100, 0x9186, 0x0002,
-	0x0120, 0x9186, 0x0004, 0x1904, 0xe44f, 0x6814, 0x2048, 0xa97c,
+	0x00de, 0x009e, 0x0804, 0xe382, 0xd0b4, 0x0128, 0xd0fc, 0x090c,
+	0x0d7d, 0x0804, 0xe3a3, 0x6007, 0x003a, 0x6003, 0x0001, 0x2009,
+	0x8020, 0x080c, 0x9200, 0x00c6, 0x2d60, 0x6100, 0x9186, 0x0002,
+	0x0120, 0x9186, 0x0004, 0x1904, 0xe45f, 0x6814, 0x2048, 0xa97c,
 	0xc1f4, 0xc1dc, 0xa97e, 0xa980, 0xc1fc, 0xc1bc, 0xa982, 0x00f6,
-	0x2c78, 0x080c, 0x1731, 0x00fe, 0x2009, 0x0042, 0x04d0, 0x0036,
+	0x2c78, 0x080c, 0x173e, 0x00fe, 0x2009, 0x0042, 0x04d0, 0x0036,
 	0x080c, 0x103a, 0x090c, 0x0d7d, 0xa867, 0x010d, 0x9006, 0xa802,
 	0xa86a, 0xa88a, 0x2d18, 0xab8e, 0xa887, 0x0045, 0x2c00, 0xa892,
 	0x6038, 0xa8a2, 0x2360, 0x6024, 0xc0dd, 0x6026, 0x6010, 0x00b6,
 	0x2058, 0xb8a0, 0x00be, 0x2004, 0x635c, 0xab7a, 0xa876, 0x9006,
-	0xa87e, 0xa882, 0xad9a, 0xae96, 0xa89f, 0x0001, 0x080c, 0x6d80,
-	0x2019, 0x0045, 0x6008, 0x2068, 0x080c, 0xde1b, 0x2d00, 0x600a,
+	0xa87e, 0xa882, 0xad9a, 0xae96, 0xa89f, 0x0001, 0x080c, 0x6d7b,
+	0x2019, 0x0045, 0x6008, 0x2068, 0x080c, 0xde2a, 0x2d00, 0x600a,
 	0x6023, 0x0006, 0x6003, 0x0007, 0x901e, 0x631a, 0x634a, 0x003e,
-	0x0038, 0x604b, 0x0000, 0x6003, 0x0007, 0x080c, 0xdc5d, 0x00ce,
+	0x0038, 0x604b, 0x0000, 0x6003, 0x0007, 0x080c, 0xdc6c, 0x00ce,
 	0x00de, 0x009e, 0x0005, 0x9186, 0x0013, 0x1128, 0x6004, 0x9082,
-	0x0085, 0x2008, 0x00c2, 0x9186, 0x0027, 0x1178, 0x080c, 0x95de,
-	0x0036, 0x0096, 0x6014, 0x2048, 0x2019, 0x0004, 0x080c, 0xe26c,
-	0x009e, 0x003e, 0x080c, 0x96a0, 0x0005, 0x9186, 0x0014, 0x0d70,
-	0x080c, 0xaca9, 0x0005, 0xe482, 0xe480, 0xe480, 0xe480, 0xe480,
-	0xe480, 0xe482, 0xe480, 0xe480, 0xe480, 0xe480, 0xe480, 0xe480,
-	0x080c, 0x0d7d, 0x6003, 0x000c, 0x080c, 0x96a0, 0x0005, 0x9182,
-	0x0092, 0x1220, 0x9182, 0x0085, 0x0208, 0x001a, 0x080c, 0xaca9,
-	0x0005, 0xe49e, 0xe49e, 0xe49e, 0xe49e, 0xe4a0, 0xe4c0, 0xe49e,
-	0xe49e, 0xe49e, 0xe49e, 0xe49e, 0xe49e, 0xe49e, 0x080c, 0x0d7d,
-	0x00d6, 0x2c68, 0x080c, 0xab97, 0x01b0, 0x6003, 0x0001, 0x6007,
+	0x0085, 0x2008, 0x00c2, 0x9186, 0x0027, 0x1178, 0x080c, 0x95c6,
+	0x0036, 0x0096, 0x6014, 0x2048, 0x2019, 0x0004, 0x080c, 0xe27c,
+	0x009e, 0x003e, 0x080c, 0x9684, 0x0005, 0x9186, 0x0014, 0x0d70,
+	0x080c, 0xac99, 0x0005, 0xe492, 0xe490, 0xe490, 0xe490, 0xe490,
+	0xe490, 0xe492, 0xe490, 0xe490, 0xe490, 0xe490, 0xe490, 0xe490,
+	0x080c, 0x0d7d, 0x6003, 0x000c, 0x080c, 0x9684, 0x0005, 0x9182,
+	0x0092, 0x1220, 0x9182, 0x0085, 0x0208, 0x001a, 0x080c, 0xac99,
+	0x0005, 0xe4ae, 0xe4ae, 0xe4ae, 0xe4ae, 0xe4b0, 0xe4d0, 0xe4ae,
+	0xe4ae, 0xe4ae, 0xe4ae, 0xe4ae, 0xe4ae, 0xe4ae, 0x080c, 0x0d7d,
+	0x00d6, 0x2c68, 0x080c, 0xab89, 0x01b0, 0x6003, 0x0001, 0x6007,
 	0x001e, 0x2009, 0x026e, 0x210c, 0x613a, 0x2009, 0x026f, 0x210c,
 	0x613e, 0x600b, 0xffff, 0x6910, 0x6112, 0x6023, 0x0004, 0x2009,
-	0x8020, 0x080c, 0x921e, 0x2d60, 0x080c, 0xabed, 0x00de, 0x0005,
-	0x080c, 0xabed, 0x0005, 0x00e6, 0x6010, 0x00b6, 0x2058, 0xb800,
+	0x8020, 0x080c, 0x9200, 0x2d60, 0x080c, 0xabdf, 0x00de, 0x0005,
+	0x080c, 0xabdf, 0x0005, 0x00e6, 0x6010, 0x00b6, 0x2058, 0xb800,
 	0x00be, 0xd0ec, 0x00ee, 0x0005, 0x2009, 0x1867, 0x210c, 0xd1ec,
 	0x05b0, 0x6003, 0x0002, 0x6024, 0xc0e5, 0x6026, 0xd0cc, 0x0150,
-	0x2001, 0x1988, 0x2004, 0x604a, 0x2009, 0x1867, 0x210c, 0xd1f4,
+	0x2001, 0x1987, 0x2004, 0x604a, 0x2009, 0x1867, 0x210c, 0xd1f4,
 	0x1520, 0x00a0, 0x2009, 0x1867, 0x210c, 0xd1f4, 0x0128, 0x6024,
-	0xc0e4, 0x6026, 0x9006, 0x00d8, 0x2001, 0x1988, 0x200c, 0x2001,
-	0x1986, 0x2004, 0x9100, 0x9080, 0x000a, 0x604a, 0x6010, 0x00b6,
+	0xc0e4, 0x6026, 0x9006, 0x00d8, 0x2001, 0x1987, 0x200c, 0x2001,
+	0x1985, 0x2004, 0x9100, 0x9080, 0x000a, 0x604a, 0x6010, 0x00b6,
 	0x2058, 0xb8bc, 0x00be, 0x0008, 0x2104, 0x9005, 0x0118, 0x9088,
 	0x0003, 0x0cd0, 0x2c0a, 0x600f, 0x0000, 0x9085, 0x0001, 0x0005,
 	0x0016, 0x00c6, 0x00e6, 0x615c, 0xb8bc, 0x2060, 0x8cff, 0x0180,
 	0x84ff, 0x1118, 0x605c, 0x9106, 0x1138, 0x600c, 0x2072, 0x080c,
-	0x88c1, 0x080c, 0xabed, 0x0010, 0x9cf0, 0x0003, 0x2e64, 0x0c70,
+	0x88a3, 0x080c, 0xabdf, 0x0010, 0x9cf0, 0x0003, 0x2e64, 0x0c70,
 	0x00ee, 0x00ce, 0x001e, 0x0005, 0x00d6, 0x00b6, 0x6010, 0x2058,
 	0xb8bc, 0x2068, 0x9005, 0x0130, 0x9c06, 0x0110, 0x680c, 0x0cd0,
 	0x600c, 0x680e, 0x00be, 0x00de, 0x0005, 0x0026, 0x0036, 0x0156,
 	0x2011, 0x182c, 0x2204, 0x9084, 0x00ff, 0x2019, 0x026e, 0x2334,
 	0x9636, 0x1508, 0x8318, 0x2334, 0x2204, 0x9084, 0xff00, 0x9636,
 	0x11d0, 0x2011, 0x0270, 0x20a9, 0x0004, 0x6010, 0x0096, 0x2048,
-	0x2019, 0x000a, 0x080c, 0xbbc2, 0x009e, 0x1168, 0x2011, 0x0274,
+	0x2019, 0x000a, 0x080c, 0xbbb5, 0x009e, 0x1168, 0x2011, 0x0274,
 	0x20a9, 0x0004, 0x6010, 0x0096, 0x2048, 0x2019, 0x0006, 0x080c,
-	0xbbc2, 0x009e, 0x1100, 0x015e, 0x003e, 0x002e, 0x0005, 0x00e6,
-	0x2071, 0x1800, 0x080c, 0x5fbc, 0x080c, 0x2fb2, 0x00ee, 0x0005,
+	0xbbb5, 0x009e, 0x1100, 0x015e, 0x003e, 0x002e, 0x0005, 0x00e6,
+	0x2071, 0x1800, 0x080c, 0x5fb7, 0x080c, 0x2fc0, 0x00ee, 0x0005,
 	0x0096, 0x0026, 0x080c, 0x103a, 0x090c, 0x0d7d, 0xa85c, 0x9080,
 	0x001a, 0x20a0, 0x20a9, 0x000c, 0xa860, 0x20e8, 0x9006, 0x4004,
 	0x9186, 0x0046, 0x1118, 0xa867, 0x0136, 0x0038, 0xa867, 0x0138,
@@ -7157,25 +7159,25 @@ unsigned short risc_code01[] = {
 	0x2011, 0x026a, 0x0146, 0x01d6, 0x0036, 0x20a9, 0x0001, 0x2019,
 	0x0008, 0xa860, 0x20e8, 0xa85c, 0x9080, 0x0031, 0x20a0, 0x2204,
 	0x8007, 0x4004, 0x8210, 0x8319, 0x1dd0, 0x003e, 0x01ce, 0x013e,
-	0x2011, 0x0205, 0x2013, 0x0000, 0x002e, 0x080c, 0x6d80, 0x009e,
+	0x2011, 0x0205, 0x2013, 0x0000, 0x002e, 0x080c, 0x6d7b, 0x009e,
 	0x0005, 0x00e6, 0x6010, 0x00b6, 0x2058, 0xb800, 0x00be, 0xd0fc,
 	0x0108, 0x0011, 0x00ee, 0x0005, 0xa880, 0xc0e5, 0xa882, 0x0005,
 	0x00e6, 0x00d6, 0x00c6, 0x0076, 0x0066, 0x0056, 0x0046, 0x0026,
-	0x0016, 0x0126, 0x2091, 0x8000, 0x2029, 0x19f3, 0x252c, 0x2021,
-	0x19fa, 0x2424, 0x2061, 0x1ddc, 0x2071, 0x1800, 0x7654, 0x7074,
+	0x0016, 0x0126, 0x2091, 0x8000, 0x2029, 0x19f2, 0x252c, 0x2021,
+	0x19f9, 0x2424, 0x2061, 0x1ddc, 0x2071, 0x1800, 0x7654, 0x7074,
 	0x9606, 0x0578, 0x6720, 0x9786, 0x0001, 0x0118, 0x9786, 0x0008,
 	0x1500, 0x2500, 0x9c06, 0x01e8, 0x2400, 0x9c06, 0x01d0, 0x080c,
-	0xe2fa, 0x01b8, 0x080c, 0xe30a, 0x11a0, 0x6000, 0x9086, 0x0004,
-	0x1120, 0x0016, 0x080c, 0x1a6a, 0x001e, 0x080c, 0xca3c, 0x1110,
-	0x080c, 0x321c, 0x080c, 0xca4d, 0x1110, 0x080c, 0xb5b5, 0x080c,
-	0xac28, 0x9ce0, 0x001c, 0x2001, 0x181a, 0x2004, 0x9c02, 0x1208,
+	0xe30a, 0x01b8, 0x080c, 0xe31a, 0x11a0, 0x6000, 0x9086, 0x0004,
+	0x1120, 0x0016, 0x080c, 0x1a77, 0x001e, 0x080c, 0xca36, 0x1110,
+	0x080c, 0x321e, 0x080c, 0xca47, 0x1110, 0x080c, 0xb5a6, 0x080c,
+	0xac1a, 0x9ce0, 0x001c, 0x2001, 0x181a, 0x2004, 0x9c02, 0x1208,
 	0x0858, 0x012e, 0x001e, 0x002e, 0x004e, 0x005e, 0x006e, 0x007e,
 	0x00ce, 0x00de, 0x00ee, 0x0005, 0x2001, 0x1810, 0x2004, 0xd0dc,
 	0x0005, 0x0006, 0x2001, 0x1837, 0x2004, 0xd09c, 0x000e, 0x0005,
-	0x0006, 0x0036, 0x0046, 0x080c, 0xcf52, 0x0168, 0x2019, 0xffff,
+	0x0006, 0x0036, 0x0046, 0x080c, 0xcf51, 0x0168, 0x2019, 0xffff,
 	0x9005, 0x0128, 0x6010, 0x00b6, 0x2058, 0xbba0, 0x00be, 0x2021,
-	0x0004, 0x080c, 0x4cbe, 0x004e, 0x003e, 0x000e, 0x6004, 0x9086,
-	0x0001, 0x1128, 0x080c, 0xa38a, 0x080c, 0xac28, 0x9006, 0x0005,
+	0x0004, 0x080c, 0x4cc0, 0x004e, 0x003e, 0x000e, 0x6004, 0x9086,
+	0x0001, 0x1128, 0x080c, 0xa372, 0x080c, 0xac1a, 0x9006, 0x0005,
 	0x00e6, 0x00c6, 0x00b6, 0x0046, 0x2061, 0x1ddc, 0x2071, 0x1800,
 	0x7454, 0x7074, 0x8001, 0x9402, 0x12b8, 0x2100, 0x9c06, 0x0148,
 	0x6000, 0x9086, 0x0000, 0x0128, 0x6010, 0x2058, 0xb8a0, 0x9206,
@@ -7194,12 +7196,12 @@ unsigned short risc_code01[] = {
 	0x2071, 0x1840, 0x7014, 0x8000, 0x7016, 0x00ee, 0x000e, 0x012e,
 	0x0005, 0x0001, 0x0002, 0x0004, 0x0008, 0x0010, 0x0020, 0x0040,
 	0x0080, 0x0100, 0x0200, 0x0400, 0x0800, 0x1000, 0x2000, 0x4000,
-	0x8000, 0x7155
+	0x8000, 0x9d27
 };
 #ifdef UNIQUE_FW_NAME
-unsigned short fw2322ipx_length01 = 0xdf42;
+unsigned short fw2322ipx_length01 = 0xdf52;
 #else
-unsigned short risc_code_length01 = 0xdf42;
+unsigned short risc_code_length01 = 0xdf52;
 #endif
 
 /*
@@ -7208,30 +7210,30 @@ unsigned short risc_code_length01 = 0xdf42;
 
 unsigned long rseqipx_code_addr01 = 0x0001c000 ;
 unsigned short rseqipx_code01[] = { 
-0x000b, 0x0003, 0x0000, 0x09d8, 0x0001, 0xc000, 0x0008, 0x8064,
+0x000b, 0x0003, 0x0000, 0x09e6, 0x0001, 0xc000, 0x0008, 0x8064,
 	0x0000, 0x0010, 0x0000, 0x8066, 0x0008, 0x0101, 0x0003, 0xc007,
 	0x0008, 0x80e0, 0x0008, 0xff00, 0x0000, 0x80e2, 0x0008, 0xff00,
 	0x0008, 0x0162, 0x0000, 0x8066, 0x0008, 0xa101, 0x000b, 0xc00f,
 	0x0008, 0x0d02, 0x0000, 0x8060, 0x0000, 0x0400, 0x0003, 0x60c2,
-	0x0003, 0x5817, 0x000b, 0x7ae0, 0x000b, 0x521c, 0x000b, 0xc813,
+	0x0003, 0x5817, 0x000b, 0x7ae3, 0x000b, 0x521c, 0x000b, 0xc813,
 	0x0009, 0xbac0, 0x0000, 0x008a, 0x0003, 0x8813, 0x0000, 0x15fc,
 	0x000b, 0xb013, 0x0009, 0xc4c0, 0x0000, 0x7000, 0x0001, 0xffa0,
-	0x0000, 0x2000, 0x0003, 0x9394, 0x0008, 0x808c, 0x0000, 0x0001,
+	0x0000, 0x2000, 0x0003, 0x939b, 0x0008, 0x808c, 0x0000, 0x0001,
 	0x0007, 0x0000, 0x0007, 0x0000, 0x0000, 0x40d4, 0x000a, 0x4047,
 	0x0008, 0x808c, 0x0000, 0x0002, 0x0007, 0x0000, 0x0003, 0x082e,
 	0x0000, 0x4022, 0x0003, 0x0034, 0x0008, 0x4122, 0x0009, 0xeac0,
-	0x0008, 0xff00, 0x0009, 0xffe0, 0x0008, 0x0500, 0x0003, 0x0bbb,
-	0x0002, 0x4447, 0x000b, 0x8bb8, 0x0008, 0x0bfe, 0x0001, 0x11a0,
-	0x0003, 0x139a, 0x0001, 0x0ca0, 0x0003, 0x139a, 0x0001, 0x9180,
+	0x0008, 0xff00, 0x0009, 0xffe0, 0x0008, 0x0500, 0x000b, 0x0bc2,
+	0x0002, 0x4447, 0x0003, 0x8bbf, 0x0008, 0x0bfe, 0x0001, 0x11a0,
+	0x000b, 0x13a1, 0x0001, 0x0ca0, 0x000b, 0x13a1, 0x0001, 0x9180,
 	0x0000, 0x0004, 0x0000, 0x8060, 0x0000, 0x0400, 0x0008, 0x7f62,
 	0x0000, 0x8066, 0x0008, 0x0009, 0x000b, 0xc042, 0x0008, 0x808c,
 	0x0008, 0x0000, 0x0008, 0x0060, 0x0008, 0x8062, 0x0000, 0x0004,
 	0x0000, 0x8066, 0x0000, 0x0411, 0x0003, 0xc04a, 0x0000, 0x03fe,
-	0x0001, 0x43e0, 0x0003, 0x8b97, 0x0009, 0xc2c0, 0x0008, 0x00ff,
-	0x0001, 0x02e0, 0x0003, 0x8b97, 0x0001, 0x9180, 0x0008, 0x0005,
+	0x0001, 0x43e0, 0x0003, 0x8b9e, 0x0009, 0xc2c0, 0x0008, 0x00ff,
+	0x0001, 0x02e0, 0x0003, 0x8b9e, 0x0001, 0x9180, 0x0008, 0x0005,
 	0x0000, 0x8060, 0x0000, 0x0400, 0x0008, 0x7f62, 0x0000, 0x8066,
-	0x0000, 0x0019, 0x000b, 0xc059, 0x0002, 0x0240, 0x000b, 0x0b94,
-	0x0008, 0x00fc, 0x0003, 0x3397, 0x000a, 0x0244, 0x000b, 0x086b,
+	0x0000, 0x0019, 0x000b, 0xc059, 0x0002, 0x0240, 0x000b, 0x0b9b,
+	0x0008, 0x00fc, 0x0003, 0x339e, 0x000a, 0x0244, 0x000b, 0x086b,
 	0x000c, 0x01f5, 0x0001, 0x9180, 0x0000, 0x0007, 0x0008, 0x7f62,
 	0x0000, 0x8060, 0x0000, 0x0400, 0x0002, 0x0234, 0x0008, 0x7f04,
 	0x0000, 0x8066, 0x0000, 0x040a, 0x000b, 0xc06a, 0x000a, 0x0248,
@@ -7241,7 +7243,7 @@ unsigned short rseqipx_code01[] = {
 	0x0002, 0x3a44, 0x0003, 0x8813, 0x0008, 0x808c, 0x0000, 0x0002,
 	0x0008, 0x1760, 0x0008, 0x8062, 0x0008, 0x000f, 0x0000, 0x8066,
 	0x0008, 0x0011, 0x000b, 0xc081, 0x0008, 0x01fe, 0x0009, 0x42e0,
-	0x000b, 0x8b87, 0x0000, 0x00fe, 0x0001, 0x43e0, 0x000b, 0x8b87,
+	0x000b, 0x8b8e, 0x0000, 0x00fe, 0x0001, 0x43e0, 0x000b, 0x8b8e,
 	0x0000, 0x1734, 0x0000, 0x1530, 0x0008, 0x1632, 0x0008, 0x0d2a,
 	0x0001, 0x9880, 0x0008, 0x0012, 0x0000, 0x8060, 0x0000, 0x0400,
 	0x0008, 0x7f62, 0x0000, 0x8066, 0x0008, 0x1e0a, 0x000b, 0xc093,
@@ -7270,17 +7272,17 @@ unsigned short rseqipx_code01[] = {
 	0x000a, 0x0040, 0x0003, 0x0904, 0x0002, 0x004e, 0x0003, 0x0904,
 	0x0002, 0x0030, 0x0002, 0x7f2f, 0x0000, 0x7f00, 0x0000, 0x8066,
 	0x0008, 0x000a, 0x000b, 0xc0f5, 0x0008, 0x1010, 0x0004, 0x01dc,
-	0x000b, 0xb0fd, 0x000c, 0x035b, 0x000c, 0x01c6, 0x000b, 0x7814,
+	0x000b, 0xb0fd, 0x000c, 0x0362, 0x000c, 0x01c6, 0x000b, 0x7814,
 	0x0003, 0x0013, 0x0000, 0x0806, 0x0008, 0x8010, 0x0000, 0x001f,
-	0x000c, 0x035b, 0x0000, 0x0310, 0x000c, 0x035b, 0x0003, 0x00fb,
+	0x000c, 0x0362, 0x0000, 0x0310, 0x000c, 0x0362, 0x0003, 0x00fb,
 	0x000a, 0x002f, 0x0000, 0x7f00, 0x0000, 0x8066, 0x0008, 0x000a,
 	0x000b, 0xc108, 0x000c, 0x019f, 0x000a, 0x0040, 0x000b, 0x091d,
 	0x000c, 0x020c, 0x0000, 0x8000, 0x0000, 0x0002, 0x0000, 0x8060,
 	0x0000, 0x0400, 0x0009, 0x9080, 0x0008, 0x0006, 0x0008, 0x7f62,
 	0x0000, 0x8066, 0x0008, 0x000a, 0x000b, 0xc116, 0x0000, 0x8072,
 	0x0000, 0x4000, 0x0003, 0x00fb, 0x0008, 0x8010, 0x0008, 0x001e,
-	0x000b, 0x011f, 0x0008, 0x8010, 0x0008, 0x001d, 0x000c, 0x035b,
-	0x0008, 0x1010, 0x000c, 0x035b, 0x000b, 0x0014, 0x0002, 0x4b4e,
+	0x000b, 0x011f, 0x0008, 0x8010, 0x0008, 0x001d, 0x000c, 0x0362,
+	0x0008, 0x1010, 0x000c, 0x0362, 0x000b, 0x0014, 0x0002, 0x4b4e,
 	0x0003, 0x0929, 0x0008, 0x808a, 0x0000, 0x0004, 0x000b, 0x6129,
 	0x000f, 0x8000, 0x0008, 0x808a, 0x0000, 0x0004, 0x000b, 0x0014,
 	0x0000, 0x8060, 0x0000, 0x0400, 0x0009, 0x9080, 0x0008, 0x0011,
@@ -7309,8 +7311,8 @@ unsigned short rseqipx_code01[] = {
 	0x0008, 0x5006, 0x0008, 0x100e, 0x0004, 0x01b3, 0x000b, 0x7814,
 	0x0003, 0x0013, 0x0008, 0x0208, 0x0008, 0x030a, 0x0003, 0x0174,
 	0x000c, 0x019f, 0x0008, 0x808a, 0x0000, 0x0004, 0x0008, 0x8010,
-	0x0008, 0x0021, 0x000c, 0x035b, 0x0008, 0x1010, 0x000c, 0x035b,
-	0x0000, 0x4810, 0x000c, 0x035b, 0x0008, 0x4910, 0x000c, 0x035b,
+	0x0008, 0x0021, 0x000c, 0x0362, 0x0008, 0x1010, 0x000c, 0x0362,
+	0x0000, 0x4810, 0x000c, 0x0362, 0x0008, 0x4910, 0x000c, 0x0362,
 	0x0008, 0x808a, 0x0000, 0x0004, 0x000b, 0x0014, 0x0000, 0x8060,
 	0x0000, 0x0400, 0x0009, 0x9080, 0x0000, 0x0002, 0x0008, 0x7f62,
 	0x0000, 0x8066, 0x0008, 0xb40a, 0x0003, 0xc1a6, 0x000f, 0x4000,
@@ -7343,195 +7345,197 @@ unsigned short rseqipx_code01[] = {
 	0x0007, 0x0000, 0x000a, 0x3945, 0x0003, 0x8a14, 0x000f, 0x4000,
 	0x0000, 0x8072, 0x0000, 0x4000, 0x0007, 0x0000, 0x0007, 0x0000,
 	0x0007, 0x0000, 0x000a, 0x3945, 0x0003, 0x0a0e, 0x000b, 0x0216,
-	0x000a, 0x3a40, 0x000b, 0x8817, 0x0008, 0x2b24, 0x0008, 0x2b24,
-	0x0003, 0x5a20, 0x0008, 0x8054, 0x0000, 0x0002, 0x0002, 0x1242,
-	0x0003, 0x0a64, 0x000a, 0x3a45, 0x000b, 0x0a55, 0x000a, 0x1e10,
-	0x0000, 0x7f3c, 0x0003, 0x0a52, 0x0002, 0x1d00, 0x0000, 0x7f3a,
-	0x0000, 0x0d60, 0x0008, 0x7f62, 0x0000, 0x8066, 0x0008, 0x0009,
-	0x0003, 0xc230, 0x0008, 0x00fc, 0x0003, 0xb24f, 0x0000, 0x1c60,
-	0x0008, 0x8062, 0x0000, 0x0001, 0x0000, 0x8066, 0x0008, 0x0009,
-	0x000b, 0xc238, 0x0008, 0x00fc, 0x0003, 0x3370, 0x0000, 0x0038,
-	0x0008, 0x0060, 0x0008, 0x8062, 0x0000, 0x0019, 0x0000, 0x8066,
-	0x0008, 0x0009, 0x0003, 0xc241, 0x0009, 0x80c0, 0x0008, 0x00ff,
-	0x0008, 0x7f3e, 0x0000, 0x0d60, 0x0008, 0x0efe, 0x0001, 0x1f80,
-	0x0008, 0x7f62, 0x0000, 0x8066, 0x0008, 0x0009, 0x0003, 0xc24b,
-	0x0008, 0x003a, 0x0000, 0x1dfe, 0x000b, 0x022c, 0x0008, 0x0036,
-	0x0004, 0x00a6, 0x000b, 0x0264, 0x0000, 0x8074, 0x0000, 0x2000,
-	0x000b, 0x0264, 0x0002, 0x3a44, 0x000b, 0x0b9d, 0x0000, 0x8074,
-	0x0000, 0x1000, 0x0000, 0x2d0e, 0x0000, 0x2d0e, 0x000b, 0xb36d,
-	0x0008, 0x26fe, 0x0008, 0x26fe, 0x0008, 0x2700, 0x0008, 0x2700,
-	0x0009, 0x00d0, 0x0003, 0x8a74, 0x0000, 0x8074, 0x0008, 0x4040,
-	0x0003, 0x5a64, 0x000b, 0x521c, 0x000a, 0x3a46, 0x0003, 0x8a74,
-	0x0002, 0x3a47, 0x000b, 0x0a6f, 0x0008, 0x8054, 0x0000, 0x0004,
-	0x0000, 0x8074, 0x0000, 0x8000, 0x0003, 0x02d4, 0x0009, 0x92c0,
-	0x0000, 0x0fc8, 0x000b, 0x0813, 0x000a, 0x1246, 0x0003, 0x8b67,
-	0x0000, 0x1a60, 0x0008, 0x8062, 0x0000, 0x0002, 0x0000, 0x8066,
-	0x0000, 0x367a, 0x000b, 0xc279, 0x0009, 0x92c0, 0x0008, 0x0780,
-	0x000b, 0x8b81, 0x0002, 0x124b, 0x000b, 0x0a82, 0x0002, 0x2e4d,
-	0x0002, 0x2e4d, 0x000b, 0x0b6d, 0x000a, 0x3a46, 0x000b, 0x8a92,
-	0x000b, 0x5a84, 0x0008, 0x8054, 0x0000, 0x0004, 0x000a, 0x1243,
-	0x000b, 0x0ad2, 0x0008, 0x8010, 0x0000, 0x000d, 0x000c, 0x035b,
-	0x000a, 0x1948, 0x0003, 0x0a8f, 0x0004, 0x0350, 0x0000, 0x1810,
-	0x000c, 0x035b, 0x0003, 0x02d2, 0x000a, 0x1948, 0x000b, 0x0a96,
-	0x000a, 0x1243, 0x000b, 0x0b70, 0x000a, 0x194d, 0x000b, 0x0a9a,
-	0x000a, 0x1243, 0x0003, 0x0b77, 0x000b, 0x5a9a, 0x0008, 0x8054,
-	0x0000, 0x0004, 0x000a, 0x192e, 0x0008, 0x7f32, 0x000a, 0x1947,
-	0x000b, 0x0acc, 0x0002, 0x194f, 0x000b, 0x0aaa, 0x0004, 0x0350,
-	0x0000, 0x1810, 0x0004, 0x01dc, 0x000b, 0xb2c5, 0x000c, 0x035b,
-	0x000c, 0x01c6, 0x0003, 0x02d2, 0x0000, 0x1a60, 0x0008, 0x8062,
-	0x0000, 0x001f, 0x0000, 0x8066, 0x0008, 0x0009, 0x0003, 0xc2af,
-	0x000a, 0x004c, 0x0003, 0x8acc, 0x0000, 0x8060, 0x0000, 0x0400,
-	0x0001, 0x9880, 0x0000, 0x0007, 0x0008, 0x7f62, 0x0000, 0x8066,
-	0x0000, 0x320a, 0x000b, 0xc2b9, 0x0000, 0x8060, 0x0000, 0x0400,
-	0x0001, 0x9880, 0x0008, 0x0012, 0x0008, 0x7f62, 0x0000, 0x8066,
-	0x0008, 0x1e0a, 0x000b, 0xc2c1, 0x0000, 0x1826, 0x0000, 0x1928,
-	0x0003, 0x02d2, 0x0000, 0x0806, 0x0008, 0x8010, 0x0000, 0x001f,
-	0x000c, 0x035b, 0x0000, 0x0310, 0x000c, 0x035b, 0x0003, 0x02d2,
-	0x0004, 0x0350, 0x0008, 0x8010, 0x0000, 0x0001, 0x000c, 0x035b,
-	0x0000, 0x1810, 0x000c, 0x035b, 0x0000, 0x8074, 0x0008, 0xf000,
-	0x0000, 0x0d30, 0x0002, 0x3a42, 0x000b, 0x8ada, 0x0000, 0x15fc,
-	0x000b, 0xb07a, 0x0003, 0x0013, 0x0000, 0x8074, 0x0000, 0x0501,
-	0x0008, 0x8010, 0x0008, 0x000c, 0x000c, 0x035b, 0x0003, 0x0013,
-	0x0009, 0xbbe0, 0x0008, 0x0030, 0x0003, 0x8af6, 0x0000, 0x18fe,
-	0x0009, 0x3ce0, 0x000b, 0x0af3, 0x0008, 0x15fe, 0x0009, 0x3ce0,
-	0x000b, 0x0af3, 0x0008, 0x13fe, 0x0009, 0x3ce0, 0x000b, 0x8aef,
-	0x000c, 0x0349, 0x0008, 0x0d26, 0x0003, 0x02f0, 0x0004, 0x034b,
-	0x0008, 0x8076, 0x0000, 0x0040, 0x0003, 0x0346, 0x0008, 0x8076,
-	0x0008, 0x0041, 0x0003, 0x0346, 0x0009, 0xbbe0, 0x0000, 0x0032,
-	0x000b, 0x8afb, 0x0008, 0x3c1e, 0x0003, 0x0346, 0x0009, 0xbbe0,
-	0x0000, 0x003b, 0x000b, 0x8b00, 0x0000, 0x3cdc, 0x0003, 0x0346,
-	0x0009, 0xbbe0, 0x0008, 0x0035, 0x000b, 0x8b06, 0x0000, 0x8072,
-	0x0000, 0x8000, 0x0003, 0x04aa, 0x0009, 0xbbe0, 0x0008, 0x0036,
-	0x000b, 0x0bcd, 0x0009, 0xbbe0, 0x0000, 0x0037, 0x000b, 0x8b27,
-	0x0000, 0x18fe, 0x0009, 0x3ce0, 0x0003, 0x8af3, 0x0008, 0x8076,
-	0x0000, 0x0040, 0x0000, 0x1a60, 0x0008, 0x8062, 0x0000, 0x000d,
-	0x0008, 0x2604, 0x0008, 0x2604, 0x0008, 0x2706, 0x0008, 0x2706,
-	0x0000, 0x2808, 0x0000, 0x2808, 0x0000, 0x290a, 0x0000, 0x290a,
-	0x0000, 0x8066, 0x0000, 0x0422, 0x000b, 0xc31e, 0x0004, 0x0350,
-	0x0008, 0x8054, 0x0000, 0x0004, 0x0000, 0x8074, 0x0008, 0xf000,
-	0x0000, 0x8072, 0x0000, 0x8000, 0x0003, 0x02d4, 0x0009, 0xbbe0,
-	0x0000, 0x0038, 0x000b, 0x8b39, 0x0000, 0x18fe, 0x0009, 0x3ce0,
-	0x0003, 0x0b36, 0x0008, 0x15fe, 0x0009, 0x3ce0, 0x000b, 0x8ae9,
-	0x0004, 0x034b, 0x0008, 0x8076, 0x0000, 0x0040, 0x0000, 0x8072,
-	0x0000, 0x8000, 0x0003, 0x0394, 0x0008, 0x8076, 0x0008, 0x0042,
-	0x0003, 0x0346, 0x0009, 0xbbe0, 0x0000, 0x0016, 0x0003, 0x8b46,
-	0x0000, 0x8074, 0x0008, 0x0808, 0x0002, 0x3a44, 0x0003, 0x8816,
-	0x0000, 0x8074, 0x0000, 0x0800, 0x0000, 0x8072, 0x0000, 0x8000,
-	0x000f, 0x8000, 0x0003, 0x0013, 0x0000, 0x8072, 0x0000, 0x8000,
-	0x0003, 0x0013, 0x0002, 0x1430, 0x0003, 0x034c, 0x000a, 0x3d30,
-	0x0000, 0x7f00, 0x0001, 0xbc80, 0x0000, 0x0007, 0x0003, 0x0354,
-	0x000a, 0x1930, 0x0000, 0x7f00, 0x0001, 0x9880, 0x0000, 0x0007,
-	0x0000, 0x8060, 0x0000, 0x0400, 0x0008, 0x7f62, 0x0000, 0x8066,
-	0x0008, 0x000a, 0x000b, 0xc359, 0x000f, 0x4000, 0x000b, 0x235b,
-	0x0008, 0x0870, 0x000f, 0x4000, 0x0009, 0xbac0, 0x0008, 0x0090,
-	0x000b, 0x0b64, 0x0000, 0x8074, 0x0000, 0x0706, 0x000b, 0x0366,
-	0x0000, 0x8074, 0x0000, 0x0703, 0x000f, 0x4000, 0x0008, 0x8010,
-	0x0000, 0x0023, 0x0003, 0x03a2, 0x0008, 0x8010, 0x0000, 0x0008,
-	0x0003, 0x03a2, 0x0008, 0x8010, 0x0008, 0x0022, 0x0003, 0x03a2,
-	0x0004, 0x0350, 0x0008, 0x8010, 0x0000, 0x0007, 0x000c, 0x035b,
-	0x0000, 0x1810, 0x000c, 0x035b, 0x000b, 0x03ac, 0x0004, 0x0350,
-	0x0008, 0x8010, 0x0008, 0x001b, 0x000c, 0x035b, 0x0000, 0x1810,
-	0x000c, 0x035b, 0x0000, 0x8074, 0x0000, 0xf080, 0x0000, 0x0d30,
-	0x0003, 0x0013, 0x0008, 0x8010, 0x0008, 0x0009, 0x0003, 0x03a2,
-	0x0008, 0x8010, 0x0008, 0x0005, 0x0003, 0x03a2, 0x000a, 0x1648,
-	0x000b, 0x8888, 0x0008, 0x808c, 0x0000, 0x0001, 0x0007, 0x0000,
-	0x0008, 0x8010, 0x0000, 0x0004, 0x000a, 0x4143, 0x0003, 0x0888,
-	0x0002, 0x3a44, 0x0003, 0x8813, 0x0008, 0x0d2a, 0x0003, 0x03a2,
-	0x0008, 0x8010, 0x0008, 0x0003, 0x0003, 0x03a4, 0x0008, 0x8010,
-	0x0000, 0x000b, 0x0003, 0x03a4, 0x0008, 0x8010, 0x0000, 0x0002,
-	0x0003, 0x03a4, 0x0002, 0x3a47, 0x000b, 0x8a64, 0x0008, 0x8010,
-	0x0008, 0x0006, 0x0003, 0x03a4, 0x0000, 0x8074, 0x0008, 0xf000,
-	0x000c, 0x035b, 0x000c, 0x035e, 0x000a, 0x3a40, 0x000b, 0x0813,
-	0x0008, 0x8010, 0x0008, 0x000c, 0x000c, 0x035b, 0x0003, 0x0013,
-	0x0000, 0x8074, 0x0000, 0xf080, 0x0000, 0x0d30, 0x0002, 0x2e4d,
-	0x0002, 0x2e4d, 0x000b, 0x0bb5, 0x0008, 0x8054, 0x0000, 0x0019,
-	0x0003, 0x0013, 0x0008, 0x8054, 0x0008, 0x0009, 0x0003, 0x0013,
-	0x0002, 0x3a44, 0x0003, 0x8813, 0x0003, 0x0397, 0x0008, 0x808c,
-	0x0008, 0x0000, 0x0002, 0x4447, 0x0003, 0x0be1, 0x0001, 0xc0c0,
-	0x0008, 0x00ff, 0x0009, 0xffe0, 0x0008, 0x00ff, 0x000b, 0x8bb8,
-	0x0001, 0xc1e0, 0x0008, 0xffff, 0x000b, 0x8bb8, 0x0008, 0x8010,
-	0x0000, 0x0013, 0x000c, 0x035b, 0x0000, 0x8074, 0x0008, 0x0202,
-	0x0003, 0x0013, 0x000a, 0x3a40, 0x000b, 0x8bde, 0x0000, 0x8074,
-	0x0000, 0x0200, 0x0000, 0x3d00, 0x0000, 0x3cfe, 0x0000, 0x8072,
-	0x0000, 0x8000, 0x0001, 0x43e0, 0x0003, 0x8bdc, 0x0000, 0x42fe,
-	0x0001, 0xffc0, 0x0008, 0x00ff, 0x0009, 0x00e0, 0x0003, 0x0bb8,
-	0x0008, 0x0d08, 0x000b, 0x0431, 0x0000, 0x8072, 0x0000, 0x8000,
-	0x0003, 0x0013, 0x0004, 0x04b3, 0x0008, 0x808c, 0x0000, 0x0001,
-	0x0000, 0x04fc, 0x0003, 0x3496, 0x0000, 0x0460, 0x0008, 0x8062,
-	0x0000, 0x0001, 0x0000, 0x8066, 0x0008, 0x0009, 0x000b, 0xc3eb,
-	0x0000, 0x0004, 0x0009, 0x80c0, 0x0008, 0x00ff, 0x0000, 0x7f00,
-	0x0001, 0x80e0, 0x0000, 0x0004, 0x000b, 0x0c05, 0x0001, 0x80e0,
-	0x0008, 0x0005, 0x000b, 0x0c05, 0x0001, 0x80e0, 0x0008, 0x0006,
-	0x000b, 0x0c05, 0x0001, 0x82c0, 0x0008, 0xff00, 0x0008, 0x7f04,
-	0x0009, 0x82e0, 0x0008, 0x0600, 0x000b, 0x0c05, 0x0009, 0x82e0,
-	0x0008, 0x0500, 0x000b, 0x0c05, 0x0009, 0x82e0, 0x0000, 0x0400,
-	0x0003, 0x8c96, 0x0009, 0xc4c0, 0x0000, 0x7000, 0x0009, 0xffe0,
-	0x0000, 0x1000, 0x0003, 0x0c31, 0x0004, 0x04a4, 0x0002, 0x3941,
-	0x0003, 0x0c10, 0x0000, 0x8072, 0x0000, 0x0400, 0x0003, 0x0013,
-	0x0000, 0x0460, 0x0008, 0x80fe, 0x0008, 0x002b, 0x0008, 0x7f62,
-	0x0000, 0x8066, 0x0008, 0x2209, 0x000b, 0xc416, 0x0008, 0x11fc,
-	0x000b, 0x342c, 0x0001, 0x9180, 0x0000, 0x0002, 0x0000, 0x8060,
-	0x0000, 0x0400, 0x0008, 0x7f62, 0x0000, 0x8066, 0x0008, 0x0609,
-	0x000b, 0xc420, 0x0000, 0x42fe, 0x0001, 0xffc0, 0x0008, 0xff00,
-	0x0009, 0x03e0, 0x000b, 0x8c29, 0x0000, 0x8072, 0x0000, 0x0400,
-	0x0003, 0x0052, 0x0001, 0x9180, 0x0008, 0x0003, 0x000b, 0x0413,
-	0x0000, 0x8072, 0x0000, 0x0400, 0x0008, 0x8010, 0x0000, 0x0010,
-	0x000b, 0x0489, 0x0004, 0x04a4, 0x0002, 0x3941, 0x0003, 0x0c37,
-	0x0000, 0x8072, 0x0000, 0x0400, 0x0003, 0x0013, 0x0004, 0x046e,
-	0x0008, 0x11fc, 0x000b, 0xb43f, 0x0000, 0x8072, 0x0000, 0x0400,
-	0x0008, 0x8010, 0x0000, 0x000e, 0x000b, 0x0489, 0x0000, 0x8060,
-	0x0000, 0x0400, 0x0000, 0x04fc, 0x0003, 0xb454, 0x0008, 0x808c,
-	0x0008, 0x0000, 0x0001, 0x9180, 0x0008, 0x0005, 0x0008, 0x7f62,
-	0x0000, 0x8066, 0x0008, 0x0009, 0x000b, 0xc44a, 0x0008, 0x0060,
-	0x0008, 0x8062, 0x0008, 0x001b, 0x0008, 0x4304, 0x0008, 0x4206,
-	0x0000, 0x8066, 0x0000, 0x0412, 0x000b, 0xc452, 0x000b, 0x046b,
-	0x0008, 0x808c, 0x0000, 0x0001, 0x0000, 0x0460, 0x0008, 0x8062,
-	0x0008, 0x002b, 0x0000, 0x8066, 0x0008, 0x0609, 0x000b, 0xc45b,
-	0x0000, 0x8066, 0x0008, 0x220a, 0x000b, 0xc45e, 0x0000, 0x42fe,
-	0x0001, 0xffc0, 0x0008, 0xff00, 0x0008, 0x7f04, 0x0000, 0x8060,
-	0x0000, 0x0400, 0x0001, 0x9180, 0x0000, 0x0002, 0x0008, 0x7f62,
-	0x0000, 0x8066, 0x0008, 0x041a, 0x0003, 0xc46a, 0x0000, 0x8072,
-	0x0000, 0x0400, 0x0003, 0x0052, 0x0000, 0x8060, 0x0000, 0x0400,
-	0x0008, 0x6b62, 0x0000, 0x8066, 0x0000, 0x0411, 0x000b, 0xc473,
-	0x0008, 0x02fe, 0x0009, 0x03e0, 0x000b, 0x8c79, 0x0000, 0x0d22,
-	0x000f, 0x4000, 0x0009, 0x8280, 0x0000, 0x0002, 0x0001, 0x6b80,
-	0x0008, 0x7f62, 0x0000, 0x8066, 0x0008, 0x2209, 0x000b, 0xc47f,
-	0x000a, 0x0200, 0x0001, 0xffc0, 0x0000, 0x0007, 0x0000, 0x7f06,
-	0x0008, 0x6b62, 0x0000, 0x8066, 0x0008, 0x060a, 0x0003, 0xc487,
-	0x000f, 0x4000, 0x0002, 0x3a44, 0x0003, 0x8813, 0x000a, 0x2f44,
-	0x000a, 0x2f44, 0x0003, 0x8b97, 0x0008, 0x808a, 0x0008, 0x0003,
-	0x0000, 0x8074, 0x0000, 0xf080, 0x0003, 0x5c92, 0x0008, 0x8054,
-	0x0000, 0x0019, 0x0003, 0x0013, 0x0002, 0x3a44, 0x0003, 0x8813,
-	0x0008, 0x808c, 0x0008, 0x0000, 0x0008, 0x8010, 0x0008, 0x0011,
-	0x000c, 0x035b, 0x0000, 0x42fe, 0x0001, 0xffc0, 0x0008, 0x00ff,
-	0x0008, 0x7f10, 0x000c, 0x035b, 0x0008, 0x4310, 0x0003, 0x03a4,
-	0x0002, 0x3941, 0x0003, 0x0ca7, 0x000f, 0x4000, 0x0000, 0x8072,
-	0x0008, 0x0404, 0x000f, 0x4000, 0x0008, 0x8010, 0x0008, 0x0012,
-	0x000c, 0x035b, 0x0004, 0x046e, 0x0000, 0x1110, 0x000c, 0x035b,
-	0x0008, 0x11fc, 0x0003, 0xb4ad, 0x0003, 0x0013, 0x0009, 0xc2c0,
-	0x0008, 0x00ff, 0x0000, 0x7f00, 0x0001, 0xc3c0, 0x0008, 0xff00,
-	0x0009, 0x00d0, 0x000b, 0x0cd8, 0x0000, 0x0d0a, 0x0001, 0x8580,
-	0x0000, 0x1000, 0x0008, 0x7f62, 0x0000, 0x8060, 0x0000, 0x0400,
-	0x0000, 0x8066, 0x0000, 0x0809, 0x000b, 0xc4c2, 0x0000, 0x04fc,
-	0x0003, 0x34d1, 0x0000, 0x0460, 0x0008, 0x8062, 0x0000, 0x0004,
-	0x0000, 0x8066, 0x0000, 0x0211, 0x0003, 0xc4ca, 0x0008, 0x01fe,
-	0x0009, 0x00e0, 0x0003, 0x8cd1, 0x0008, 0x02fe, 0x0001, 0x43e0,
-	0x000b, 0x0cd7, 0x0002, 0x0500, 0x0000, 0x7f0a, 0x0009, 0xffe0,
-	0x0000, 0x0800, 0x0003, 0x8cbb, 0x0008, 0x0d08, 0x000f, 0x4000,
-	0x0008, 0x43fe, 0x0001, 0x3e80, 0x0000, 0x0d60, 0x0008, 0x7f62,
-	0x0000, 0x8066, 0x0000, 0x0809, 0x0003, 0xc4de, 0x0000, 0x8060,
-	0x0000, 0x0400, 0x0001, 0x84c0, 0x0008, 0xff00, 0x0002, 0x7f70,
-	0x0009, 0xff80, 0x0000, 0x1000, 0x0008, 0x7f62, 0x0000, 0x8066,
-	0x0000, 0x0809, 0x000b, 0xc4e9, 0x000f, 0x4000, 0xe55a, 0x71f6
+	0x000a, 0x3a40, 0x000b, 0x8817, 0x0001, 0xabd0, 0x0008, 0x0000,
+	0x0000, 0x7f24, 0x000b, 0x5a21, 0x0008, 0x8054, 0x0000, 0x0002,
+	0x0002, 0x1242, 0x0003, 0x0a67, 0x000a, 0x3a45, 0x000b, 0x0a56,
+	0x000a, 0x1e10, 0x0000, 0x7f3c, 0x000b, 0x0a53, 0x0002, 0x1d00,
+	0x0000, 0x7f3a, 0x0000, 0x0d60, 0x0008, 0x7f62, 0x0000, 0x8066,
+	0x0008, 0x0009, 0x000b, 0xc231, 0x0008, 0x00fc, 0x000b, 0xb250,
+	0x0000, 0x1c60, 0x0008, 0x8062, 0x0000, 0x0001, 0x0000, 0x8066,
+	0x0008, 0x0009, 0x0003, 0xc239, 0x0008, 0x00fc, 0x000b, 0x3377,
+	0x0000, 0x0038, 0x0008, 0x0060, 0x0008, 0x8062, 0x0000, 0x0019,
+	0x0000, 0x8066, 0x0008, 0x0009, 0x0003, 0xc242, 0x0009, 0x80c0,
+	0x0008, 0x00ff, 0x0008, 0x7f3e, 0x0000, 0x0d60, 0x0008, 0x0efe,
+	0x0001, 0x1f80, 0x0008, 0x7f62, 0x0000, 0x8066, 0x0008, 0x0009,
+	0x000b, 0xc24c, 0x0008, 0x003a, 0x0000, 0x1dfe, 0x0003, 0x022d,
+	0x0008, 0x0036, 0x0004, 0x00a6, 0x000b, 0x0267, 0x0000, 0x8074,
+	0x0000, 0x2000, 0x000b, 0x0267, 0x0002, 0x3a44, 0x000b, 0x0ba4,
+	0x0000, 0x8074, 0x0000, 0x1000, 0x0001, 0xadd0, 0x0008, 0x0000,
+	0x0008, 0x7f0e, 0x0003, 0xb374, 0x0001, 0xa7d0, 0x0008, 0x0000,
+	0x0000, 0x7f00, 0x0009, 0xa6d0, 0x0008, 0x0000, 0x0009, 0x00d0,
+	0x0003, 0x8a77, 0x0000, 0x8074, 0x0008, 0x4040, 0x0003, 0x5a67,
+	0x000b, 0x521c, 0x000a, 0x3a46, 0x0003, 0x8a77, 0x0002, 0x3a47,
+	0x000b, 0x0a72, 0x0008, 0x8054, 0x0000, 0x0004, 0x0000, 0x8074,
+	0x0000, 0x8000, 0x0003, 0x02d7, 0x0009, 0x92c0, 0x0000, 0x0fc8,
+	0x000b, 0x0813, 0x000a, 0x1246, 0x0003, 0x8b6e, 0x0000, 0x1a60,
+	0x0008, 0x8062, 0x0000, 0x0002, 0x0000, 0x8066, 0x0000, 0x367a,
+	0x000b, 0xc27c, 0x0009, 0x92c0, 0x0008, 0x0780, 0x000b, 0x8b88,
+	0x0002, 0x124b, 0x0003, 0x0a85, 0x0002, 0x2e4d, 0x0002, 0x2e4d,
+	0x0003, 0x0b74, 0x000a, 0x3a46, 0x0003, 0x8a95, 0x000b, 0x5a87,
+	0x0008, 0x8054, 0x0000, 0x0004, 0x000a, 0x1243, 0x0003, 0x0ad5,
+	0x0008, 0x8010, 0x0000, 0x000d, 0x000c, 0x0362, 0x000a, 0x1948,
+	0x0003, 0x0a92, 0x000c, 0x0357, 0x0000, 0x1810, 0x000c, 0x0362,
+	0x000b, 0x02d5, 0x000a, 0x1948, 0x000b, 0x0a99, 0x000a, 0x1243,
+	0x0003, 0x0b77, 0x000a, 0x194d, 0x0003, 0x0a9d, 0x000a, 0x1243,
+	0x0003, 0x0b7e, 0x0003, 0x5a9d, 0x0008, 0x8054, 0x0000, 0x0004,
+	0x000a, 0x192e, 0x0008, 0x7f32, 0x000a, 0x1947, 0x000b, 0x0acf,
+	0x0002, 0x194f, 0x0003, 0x0aad, 0x000c, 0x0357, 0x0000, 0x1810,
+	0x0004, 0x01dc, 0x0003, 0xb2c8, 0x000c, 0x0362, 0x000c, 0x01c6,
+	0x000b, 0x02d5, 0x0000, 0x1a60, 0x0008, 0x8062, 0x0000, 0x001f,
+	0x0000, 0x8066, 0x0008, 0x0009, 0x0003, 0xc2b2, 0x000a, 0x004c,
+	0x0003, 0x8acf, 0x0000, 0x8060, 0x0000, 0x0400, 0x0001, 0x9880,
+	0x0000, 0x0007, 0x0008, 0x7f62, 0x0000, 0x8066, 0x0000, 0x320a,
+	0x000b, 0xc2bc, 0x0000, 0x8060, 0x0000, 0x0400, 0x0001, 0x9880,
+	0x0008, 0x0012, 0x0008, 0x7f62, 0x0000, 0x8066, 0x0008, 0x1e0a,
+	0x000b, 0xc2c4, 0x0000, 0x1826, 0x0000, 0x1928, 0x000b, 0x02d5,
+	0x0000, 0x0806, 0x0008, 0x8010, 0x0000, 0x001f, 0x000c, 0x0362,
+	0x0000, 0x0310, 0x000c, 0x0362, 0x000b, 0x02d5, 0x000c, 0x0357,
+	0x0008, 0x8010, 0x0000, 0x0001, 0x000c, 0x0362, 0x0000, 0x1810,
+	0x000c, 0x0362, 0x0000, 0x8074, 0x0008, 0xf000, 0x0000, 0x0d30,
+	0x0002, 0x3a42, 0x0003, 0x8add, 0x0000, 0x15fc, 0x000b, 0xb07a,
+	0x0003, 0x0013, 0x0000, 0x8074, 0x0000, 0x0501, 0x0008, 0x8010,
+	0x0008, 0x000c, 0x000c, 0x0362, 0x0003, 0x0013, 0x0009, 0xbbe0,
+	0x0008, 0x0030, 0x0003, 0x8af9, 0x0000, 0x18fe, 0x0009, 0x3ce0,
+	0x000b, 0x0af6, 0x0008, 0x15fe, 0x0009, 0x3ce0, 0x000b, 0x0af6,
+	0x0008, 0x13fe, 0x0009, 0x3ce0, 0x000b, 0x8af2, 0x0004, 0x0350,
+	0x0008, 0x0d26, 0x0003, 0x02f3, 0x000c, 0x0352, 0x0008, 0x8076,
+	0x0000, 0x0040, 0x000b, 0x034d, 0x0008, 0x8076, 0x0008, 0x0041,
+	0x000b, 0x034d, 0x0009, 0xbbe0, 0x0000, 0x0032, 0x000b, 0x8afe,
+	0x0008, 0x3c1e, 0x000b, 0x034d, 0x0009, 0xbbe0, 0x0000, 0x003b,
+	0x000b, 0x8b03, 0x0000, 0x3cdc, 0x000b, 0x034d, 0x0009, 0xbbe0,
+	0x0008, 0x0035, 0x000b, 0x8b09, 0x0000, 0x8072, 0x0000, 0x8000,
+	0x0003, 0x04b1, 0x0009, 0xbbe0, 0x0008, 0x0036, 0x0003, 0x0bd4,
+	0x0009, 0xbbe0, 0x0000, 0x0037, 0x000b, 0x8b2e, 0x0000, 0x18fe,
+	0x0009, 0x3ce0, 0x0003, 0x8af6, 0x0008, 0x8076, 0x0000, 0x0040,
+	0x0000, 0x1a60, 0x0008, 0x8062, 0x0000, 0x000d, 0x0009, 0xa6d0,
+	0x0008, 0x0000, 0x0008, 0x7f04, 0x0001, 0xa7d0, 0x0008, 0x0000,
+	0x0000, 0x7f06, 0x0001, 0xa8d0, 0x0008, 0x0000, 0x0008, 0x7f08,
+	0x0009, 0xa9d0, 0x0008, 0x0000, 0x0000, 0x7f0a, 0x0000, 0x8066,
+	0x0000, 0x0422, 0x0003, 0xc325, 0x000c, 0x0357, 0x0008, 0x8054,
+	0x0000, 0x0004, 0x0000, 0x8074, 0x0008, 0xf000, 0x0000, 0x8072,
+	0x0000, 0x8000, 0x0003, 0x02d7, 0x0009, 0xbbe0, 0x0000, 0x0038,
+	0x0003, 0x8b40, 0x0000, 0x18fe, 0x0009, 0x3ce0, 0x000b, 0x0b3d,
+	0x0008, 0x15fe, 0x0009, 0x3ce0, 0x000b, 0x8aec, 0x000c, 0x0352,
+	0x0008, 0x8076, 0x0000, 0x0040, 0x0000, 0x8072, 0x0000, 0x8000,
+	0x0003, 0x039b, 0x0008, 0x8076, 0x0008, 0x0042, 0x000b, 0x034d,
+	0x0009, 0xbbe0, 0x0000, 0x0016, 0x000b, 0x8b4d, 0x0000, 0x8074,
+	0x0008, 0x0808, 0x0002, 0x3a44, 0x0003, 0x8816, 0x0000, 0x8074,
+	0x0000, 0x0800, 0x0000, 0x8072, 0x0000, 0x8000, 0x000f, 0x8000,
+	0x0003, 0x0013, 0x0000, 0x8072, 0x0000, 0x8000, 0x0003, 0x0013,
+	0x0002, 0x1430, 0x000b, 0x0353, 0x000a, 0x3d30, 0x0000, 0x7f00,
+	0x0001, 0xbc80, 0x0000, 0x0007, 0x0003, 0x035b, 0x000a, 0x1930,
+	0x0000, 0x7f00, 0x0001, 0x9880, 0x0000, 0x0007, 0x0000, 0x8060,
+	0x0000, 0x0400, 0x0008, 0x7f62, 0x0000, 0x8066, 0x0008, 0x000a,
+	0x000b, 0xc360, 0x000f, 0x4000, 0x000b, 0x2362, 0x0008, 0x0870,
+	0x000f, 0x4000, 0x0009, 0xbac0, 0x0008, 0x0090, 0x000b, 0x0b6b,
+	0x0000, 0x8074, 0x0000, 0x0706, 0x0003, 0x036d, 0x0000, 0x8074,
+	0x0000, 0x0703, 0x000f, 0x4000, 0x0008, 0x8010, 0x0000, 0x0023,
+	0x000b, 0x03a9, 0x0008, 0x8010, 0x0000, 0x0008, 0x000b, 0x03a9,
+	0x0008, 0x8010, 0x0008, 0x0022, 0x000b, 0x03a9, 0x000c, 0x0357,
+	0x0008, 0x8010, 0x0000, 0x0007, 0x000c, 0x0362, 0x0000, 0x1810,
+	0x000c, 0x0362, 0x0003, 0x03b3, 0x000c, 0x0357, 0x0008, 0x8010,
+	0x0008, 0x001b, 0x000c, 0x0362, 0x0000, 0x1810, 0x000c, 0x0362,
+	0x0000, 0x8074, 0x0000, 0xf080, 0x0000, 0x0d30, 0x0003, 0x0013,
+	0x0008, 0x8010, 0x0008, 0x0009, 0x000b, 0x03a9, 0x0008, 0x8010,
+	0x0008, 0x0005, 0x000b, 0x03a9, 0x000a, 0x1648, 0x000b, 0x8888,
+	0x0008, 0x808c, 0x0000, 0x0001, 0x0007, 0x0000, 0x0008, 0x8010,
+	0x0000, 0x0004, 0x000a, 0x4143, 0x0003, 0x0888, 0x0002, 0x3a44,
+	0x0003, 0x8813, 0x0008, 0x0d2a, 0x000b, 0x03a9, 0x0008, 0x8010,
+	0x0008, 0x0003, 0x0003, 0x03ab, 0x0008, 0x8010, 0x0000, 0x000b,
+	0x0003, 0x03ab, 0x0008, 0x8010, 0x0000, 0x0002, 0x0003, 0x03ab,
+	0x0002, 0x3a47, 0x000b, 0x8a67, 0x0008, 0x8010, 0x0008, 0x0006,
+	0x0003, 0x03ab, 0x0000, 0x8074, 0x0008, 0xf000, 0x000c, 0x0362,
+	0x0004, 0x0365, 0x000a, 0x3a40, 0x000b, 0x0813, 0x0008, 0x8010,
+	0x0008, 0x000c, 0x000c, 0x0362, 0x0003, 0x0013, 0x0000, 0x8074,
+	0x0000, 0xf080, 0x0000, 0x0d30, 0x0002, 0x2e4d, 0x0002, 0x2e4d,
+	0x000b, 0x0bbc, 0x0008, 0x8054, 0x0000, 0x0019, 0x0003, 0x0013,
+	0x0008, 0x8054, 0x0008, 0x0009, 0x0003, 0x0013, 0x0002, 0x3a44,
+	0x0003, 0x8813, 0x0003, 0x039e, 0x0008, 0x808c, 0x0008, 0x0000,
+	0x0002, 0x4447, 0x0003, 0x0be8, 0x0001, 0xc0c0, 0x0008, 0x00ff,
+	0x0009, 0xffe0, 0x0008, 0x00ff, 0x0003, 0x8bbf, 0x0001, 0xc1e0,
+	0x0008, 0xffff, 0x0003, 0x8bbf, 0x0008, 0x8010, 0x0000, 0x0013,
+	0x000c, 0x0362, 0x0000, 0x8074, 0x0008, 0x0202, 0x0003, 0x0013,
+	0x000a, 0x3a40, 0x0003, 0x8be5, 0x0000, 0x8074, 0x0000, 0x0200,
+	0x0000, 0x3d00, 0x0000, 0x3cfe, 0x0000, 0x8072, 0x0000, 0x8000,
+	0x0001, 0x43e0, 0x0003, 0x8be3, 0x0000, 0x42fe, 0x0001, 0xffc0,
+	0x0008, 0x00ff, 0x0009, 0x00e0, 0x000b, 0x0bbf, 0x0008, 0x0d08,
+	0x000b, 0x0438, 0x0000, 0x8072, 0x0000, 0x8000, 0x0003, 0x0013,
+	0x0004, 0x04ba, 0x0008, 0x808c, 0x0000, 0x0001, 0x0000, 0x04fc,
+	0x000b, 0x349d, 0x0000, 0x0460, 0x0008, 0x8062, 0x0000, 0x0001,
+	0x0000, 0x8066, 0x0008, 0x0009, 0x0003, 0xc3f2, 0x0000, 0x0004,
+	0x0009, 0x80c0, 0x0008, 0x00ff, 0x0000, 0x7f00, 0x0001, 0x80e0,
+	0x0000, 0x0004, 0x000b, 0x0c0c, 0x0001, 0x80e0, 0x0008, 0x0005,
+	0x000b, 0x0c0c, 0x0001, 0x80e0, 0x0008, 0x0006, 0x000b, 0x0c0c,
+	0x0001, 0x82c0, 0x0008, 0xff00, 0x0008, 0x7f04, 0x0009, 0x82e0,
+	0x0008, 0x0600, 0x000b, 0x0c0c, 0x0009, 0x82e0, 0x0008, 0x0500,
+	0x000b, 0x0c0c, 0x0009, 0x82e0, 0x0000, 0x0400, 0x000b, 0x8c9d,
+	0x0009, 0xc4c0, 0x0000, 0x7000, 0x0009, 0xffe0, 0x0000, 0x1000,
+	0x0003, 0x0c38, 0x0004, 0x04ab, 0x0002, 0x3941, 0x000b, 0x0c17,
+	0x0000, 0x8072, 0x0000, 0x0400, 0x0003, 0x0013, 0x0000, 0x0460,
+	0x0008, 0x80fe, 0x0008, 0x002b, 0x0008, 0x7f62, 0x0000, 0x8066,
+	0x0008, 0x2209, 0x0003, 0xc41d, 0x0008, 0x11fc, 0x0003, 0x3433,
+	0x0001, 0x9180, 0x0000, 0x0002, 0x0000, 0x8060, 0x0000, 0x0400,
+	0x0008, 0x7f62, 0x0000, 0x8066, 0x0008, 0x0609, 0x0003, 0xc427,
+	0x0000, 0x42fe, 0x0001, 0xffc0, 0x0008, 0xff00, 0x0009, 0x03e0,
+	0x0003, 0x8c30, 0x0000, 0x8072, 0x0000, 0x0400, 0x0003, 0x0052,
+	0x0001, 0x9180, 0x0008, 0x0003, 0x000b, 0x041a, 0x0000, 0x8072,
+	0x0000, 0x0400, 0x0008, 0x8010, 0x0000, 0x0010, 0x0003, 0x0490,
+	0x0004, 0x04ab, 0x0002, 0x3941, 0x0003, 0x0c3e, 0x0000, 0x8072,
+	0x0000, 0x0400, 0x0003, 0x0013, 0x0004, 0x0475, 0x0008, 0x11fc,
+	0x0003, 0xb446, 0x0000, 0x8072, 0x0000, 0x0400, 0x0008, 0x8010,
+	0x0000, 0x000e, 0x0003, 0x0490, 0x0000, 0x8060, 0x0000, 0x0400,
+	0x0000, 0x04fc, 0x0003, 0xb45b, 0x0008, 0x808c, 0x0008, 0x0000,
+	0x0001, 0x9180, 0x0008, 0x0005, 0x0008, 0x7f62, 0x0000, 0x8066,
+	0x0008, 0x0009, 0x000b, 0xc451, 0x0008, 0x0060, 0x0008, 0x8062,
+	0x0008, 0x001b, 0x0008, 0x4304, 0x0008, 0x4206, 0x0000, 0x8066,
+	0x0000, 0x0412, 0x0003, 0xc459, 0x0003, 0x0472, 0x0008, 0x808c,
+	0x0000, 0x0001, 0x0000, 0x0460, 0x0008, 0x8062, 0x0008, 0x002b,
+	0x0000, 0x8066, 0x0008, 0x0609, 0x000b, 0xc462, 0x0000, 0x8066,
+	0x0008, 0x220a, 0x0003, 0xc465, 0x0000, 0x42fe, 0x0001, 0xffc0,
+	0x0008, 0xff00, 0x0008, 0x7f04, 0x0000, 0x8060, 0x0000, 0x0400,
+	0x0001, 0x9180, 0x0000, 0x0002, 0x0008, 0x7f62, 0x0000, 0x8066,
+	0x0008, 0x041a, 0x0003, 0xc471, 0x0000, 0x8072, 0x0000, 0x0400,
+	0x0003, 0x0052, 0x0000, 0x8060, 0x0000, 0x0400, 0x0008, 0x6b62,
+	0x0000, 0x8066, 0x0000, 0x0411, 0x000b, 0xc47a, 0x0008, 0x02fe,
+	0x0009, 0x03e0, 0x000b, 0x8c80, 0x0000, 0x0d22, 0x000f, 0x4000,
+	0x0009, 0x8280, 0x0000, 0x0002, 0x0001, 0x6b80, 0x0008, 0x7f62,
+	0x0000, 0x8066, 0x0008, 0x2209, 0x000b, 0xc486, 0x000a, 0x0200,
+	0x0001, 0xffc0, 0x0000, 0x0007, 0x0000, 0x7f06, 0x0008, 0x6b62,
+	0x0000, 0x8066, 0x0008, 0x060a, 0x0003, 0xc48e, 0x000f, 0x4000,
+	0x0002, 0x3a44, 0x0003, 0x8813, 0x000a, 0x2f44, 0x000a, 0x2f44,
+	0x0003, 0x8b9e, 0x0008, 0x808a, 0x0008, 0x0003, 0x0000, 0x8074,
+	0x0000, 0xf080, 0x000b, 0x5c99, 0x0008, 0x8054, 0x0000, 0x0019,
+	0x0003, 0x0013, 0x0002, 0x3a44, 0x0003, 0x8813, 0x0008, 0x808c,
+	0x0008, 0x0000, 0x0008, 0x8010, 0x0008, 0x0011, 0x000c, 0x0362,
+	0x0000, 0x42fe, 0x0001, 0xffc0, 0x0008, 0x00ff, 0x0008, 0x7f10,
+	0x000c, 0x0362, 0x0008, 0x4310, 0x0003, 0x03ab, 0x0002, 0x3941,
+	0x0003, 0x0cae, 0x000f, 0x4000, 0x0000, 0x8072, 0x0008, 0x0404,
+	0x000f, 0x4000, 0x0008, 0x8010, 0x0008, 0x0012, 0x000c, 0x0362,
+	0x0004, 0x0475, 0x0000, 0x1110, 0x000c, 0x0362, 0x0008, 0x11fc,
+	0x000b, 0xb4b4, 0x0003, 0x0013, 0x0009, 0xc2c0, 0x0008, 0x00ff,
+	0x0000, 0x7f00, 0x0001, 0xc3c0, 0x0008, 0xff00, 0x0009, 0x00d0,
+	0x0003, 0x0cdf, 0x0000, 0x0d0a, 0x0001, 0x8580, 0x0000, 0x1000,
+	0x0008, 0x7f62, 0x0000, 0x8060, 0x0000, 0x0400, 0x0000, 0x8066,
+	0x0000, 0x0809, 0x0003, 0xc4c9, 0x0000, 0x04fc, 0x0003, 0x34d8,
+	0x0000, 0x0460, 0x0008, 0x8062, 0x0000, 0x0004, 0x0000, 0x8066,
+	0x0000, 0x0211, 0x0003, 0xc4d1, 0x0008, 0x01fe, 0x0009, 0x00e0,
+	0x0003, 0x8cd8, 0x0008, 0x02fe, 0x0001, 0x43e0, 0x000b, 0x0cde,
+	0x0002, 0x0500, 0x0000, 0x7f0a, 0x0009, 0xffe0, 0x0000, 0x0800,
+	0x000b, 0x8cc2, 0x0008, 0x0d08, 0x000f, 0x4000, 0x0008, 0x43fe,
+	0x0001, 0x3e80, 0x0000, 0x0d60, 0x0008, 0x7f62, 0x0000, 0x8066,
+	0x0000, 0x0809, 0x000b, 0xc4e5, 0x0000, 0x8060, 0x0000, 0x0400,
+	0x0001, 0x84c0, 0x0008, 0xff00, 0x0002, 0x7f70, 0x0009, 0xff80,
+	0x0000, 0x1000, 0x0008, 0x7f62, 0x0000, 0x8066, 0x0000, 0x0809,
+	0x0003, 0xc4f0, 0x000f, 0x4000, 0xe504, 0x3334
 };
-unsigned short rseqipx_code_length01 = 0x09d8;
+unsigned short rseqipx_code_length01 = 0x09e6;
 /*
  *
  */
 
 unsigned long xseqipx_code_addr01 = 0x0001e000 ;
 unsigned short xseqipx_code01[] = { 
-0x0013, 0x0003, 0x0000, 0x1082, 0x0001, 0xe000, 0x0005, 0x0032,
+0x0013, 0x0003, 0x0000, 0x10d6, 0x0001, 0xe000, 0x0005, 0x0032,
 	0x0000, 0x0010, 0x0015, 0x0033, 0x0010, 0xbb39, 0x000b, 0x8007,
 	0x0004, 0x010b, 0x0014, 0x011d, 0x0010, 0xc000, 0x0000, 0xc001,
 	0x0000, 0xc0b0, 0x0010, 0xc0b1, 0x0010, 0xc0b2, 0x0000, 0xc0b3,
@@ -7544,15 +7548,15 @@ unsigned short xseqipx_code01[] = {
 	0x0010, 0xff00, 0x0005, 0x00d0, 0x0010, 0xff00, 0x0015, 0x00d1,
 	0x0010, 0xff00, 0x0012, 0x3a40, 0x000b, 0x1031, 0x0002, 0x7940,
 	0x001b, 0x112f, 0x0002, 0x3a42, 0x001b, 0x1035, 0x0003, 0xb035,
-	0x0003, 0xa1d8, 0x0002, 0x3a41, 0x001b, 0x1039, 0x0012, 0x7941,
-	0x000b, 0x12f6, 0x0003, 0xe055, 0x0012, 0xd042, 0x0003, 0x103f,
+	0x0013, 0xa1dc, 0x0002, 0x3a41, 0x001b, 0x1039, 0x0012, 0x7941,
+	0x001b, 0x1311, 0x0003, 0xe055, 0x0012, 0xd042, 0x0003, 0x103f,
 	0x0000, 0x75ff, 0x0002, 0xff41, 0x001b, 0x1055, 0x0000, 0x0cfe,
 	0x0003, 0x6049, 0x0002, 0x3a44, 0x000b, 0x1049, 0x0011, 0x02e8,
-	0x0010, 0x0000, 0x0013, 0x1383, 0x0011, 0x02e8, 0x0010, 0x0005,
-	0x0003, 0x1413, 0x0012, 0x3a46, 0x001b, 0x1055, 0x0012, 0xd042,
+	0x0010, 0x0000, 0x0013, 0x13a2, 0x0011, 0x02e8, 0x0010, 0x0005,
+	0x0003, 0x1432, 0x0012, 0x3a46, 0x001b, 0x1055, 0x0012, 0xd042,
 	0x0003, 0x1050, 0x0000, 0x75ff, 0x0012, 0xff40, 0x001b, 0x1055,
 	0x0000, 0x12fe, 0x0013, 0x6055, 0x0001, 0x0fe8, 0x0010, 0x0000,
-	0x0013, 0x1619, 0x0015, 0x0030, 0x0000, 0x0400, 0x0010, 0xc131,
+	0x0003, 0x163f, 0x0015, 0x0030, 0x0000, 0x0400, 0x0010, 0xc131,
 	0x0015, 0x0033, 0x0010, 0xb211, 0x001b, 0x805a, 0x0010, 0xb2ff,
 	0x0001, 0xb3e0, 0x001c, 0x10cd, 0x000b, 0xf02d, 0x0011, 0x3be8,
 	0x0000, 0x0010, 0x001b, 0x1072, 0x0000, 0x0afe, 0x000b, 0x6066,
@@ -7577,11 +7581,11 @@ unsigned short xseqipx_code01[] = {
 	0x000b, 0x10bc, 0x0001, 0x0fe8, 0x0010, 0x0000, 0x0013, 0x10b6,
 	0x0001, 0x0fe8, 0x0000, 0x0002, 0x0013, 0x10b6, 0x0015, 0x0039,
 	0x0010, 0x1010, 0x0013, 0x00ca, 0x0015, 0x0039, 0x0000, 0x5040,
-	0x0015, 0x00b8, 0x0000, 0x0008, 0x0004, 0x083d, 0x0013, 0x00ca,
+	0x0015, 0x00b8, 0x0000, 0x0008, 0x0004, 0x0867, 0x0013, 0x00ca,
 	0x0011, 0x3be8, 0x0010, 0x0017, 0x000b, 0x10c1, 0x0010, 0x3cc3,
 	0x0013, 0x00ca, 0x0011, 0x3be8, 0x0010, 0x0018, 0x001b, 0x10c6,
 	0x0000, 0x3cc2, 0x0013, 0x00ca, 0x0005, 0x00ce, 0x0000, 0x0001,
-	0x0000, 0x3bcf, 0x0004, 0x0801, 0x0015, 0x0039, 0x0000, 0x8000,
+	0x0000, 0x3bcf, 0x0004, 0x0829, 0x0015, 0x0039, 0x0000, 0x8000,
 	0x0013, 0x002d, 0x0001, 0xb288, 0x0000, 0x0002, 0x0001, 0xc180,
 	0x0000, 0xff31, 0x0015, 0x0033, 0x0000, 0xb009, 0x000b, 0x80d3,
 	0x0002, 0xb200, 0x0011, 0xffc8, 0x0000, 0x0007, 0x0010, 0xffb2,
@@ -7610,455 +7614,465 @@ unsigned short xseqipx_code01[] = {
 	0x0012, 0xff40, 0x000b, 0x1031, 0x0015, 0x00d1, 0x0010, 0x0101,
 	0x0013, 0x9134, 0x0005, 0x0079, 0x0000, 0x0001, 0x0013, 0x9137,
 	0x0015, 0x00d1, 0x0000, 0x0100, 0x0011, 0x02e8, 0x0000, 0x0002,
-	0x0003, 0x115d, 0x0011, 0x02e8, 0x0000, 0x0001, 0x0003, 0x1175,
-	0x0011, 0x02e8, 0x0000, 0x0004, 0x0013, 0x1193, 0x0011, 0x02e8,
-	0x0010, 0x0003, 0x0003, 0x11c4, 0x0005, 0x0002, 0x0010, 0x0000,
+	0x0003, 0x1161, 0x0011, 0x02e8, 0x0000, 0x0001, 0x0003, 0x1179,
+	0x0011, 0x02e8, 0x0000, 0x0004, 0x0003, 0x1197, 0x0011, 0x02e8,
+	0x0010, 0x0003, 0x0003, 0x11c8, 0x0005, 0x0002, 0x0010, 0x0000,
 	0x0000, 0xc00e, 0x0000, 0xc00d, 0x0010, 0xc003, 0x0015, 0x0030,
 	0x0000, 0x0400, 0x0001, 0xbd88, 0x0010, 0x0009, 0x0000, 0xff31,
-	0x0015, 0x0033, 0x0010, 0xc00a, 0x001b, 0x8152, 0x0012, 0x3a45,
-	0x0013, 0x115a, 0x0015, 0x003a, 0x0000, 0x2000, 0x0015, 0x003a,
-	0x0010, 0x1010, 0x0004, 0x0829, 0x0012, 0xd042, 0x0013, 0x1031,
-	0x0013, 0x0050, 0x0012, 0x7849, 0x0013, 0x11d2, 0x0010, 0x0dfe,
+	0x0015, 0x0033, 0x0010, 0xc00a, 0x001b, 0x8152, 0x0000, 0xff31,
+	0x0015, 0x0033, 0x0010, 0xc00a, 0x000b, 0x8156, 0x0012, 0x3a45,
+	0x0003, 0x115e, 0x0015, 0x003a, 0x0000, 0x2000, 0x0015, 0x003a,
+	0x0010, 0x1010, 0x0014, 0x0853, 0x0012, 0xd042, 0x0013, 0x1031,
+	0x0013, 0x0050, 0x0012, 0x7849, 0x0003, 0x11d6, 0x0010, 0x0dfe,
 	0x0003, 0x6148, 0x0012, 0x0c10, 0x0010, 0xff0c, 0x0015, 0x0030,
 	0x0000, 0x0400, 0x0011, 0x0d88, 0x0010, 0x0003, 0x0000, 0xff31,
-	0x0015, 0x0033, 0x0000, 0xb309, 0x000b, 0x816a, 0x0010, 0xb3fe,
-	0x0003, 0x6172, 0x0010, 0xb30b, 0x0015, 0x0033, 0x0010, 0xc00a,
-	0x001b, 0x8170, 0x0013, 0x01c7, 0x0000, 0xc00b, 0x0010, 0xc00a,
-	0x0013, 0x01c7, 0x0000, 0x78b0, 0x0012, 0xb044, 0x0013, 0x11d2,
-	0x0002, 0xb049, 0x0013, 0x11d2, 0x0010, 0x71ff, 0x0012, 0xff38,
+	0x0015, 0x0033, 0x0000, 0xb309, 0x001b, 0x816e, 0x0010, 0xb3fe,
+	0x0013, 0x6176, 0x0010, 0xb30b, 0x0015, 0x0033, 0x0010, 0xc00a,
+	0x000b, 0x8174, 0x0013, 0x01cb, 0x0000, 0xc00b, 0x0010, 0xc00a,
+	0x0013, 0x01cb, 0x0000, 0x78b0, 0x0012, 0xb044, 0x0003, 0x11d6,
+	0x0002, 0xb049, 0x0003, 0x11d6, 0x0010, 0x71ff, 0x0012, 0xff38,
 	0x0010, 0xff71, 0x0010, 0x0dfe, 0x0013, 0x6146, 0x0012, 0x0c10,
 	0x0010, 0xff0c, 0x0015, 0x0030, 0x0000, 0x0400, 0x0011, 0x0d88,
 	0x0010, 0x0003, 0x0000, 0xff31, 0x0015, 0x0033, 0x0000, 0xb309,
-	0x000b, 0x8188, 0x0010, 0xb3fe, 0x0003, 0x6190, 0x0000, 0xb309,
-	0x0015, 0x0033, 0x0010, 0xc00a, 0x000b, 0x818e, 0x0013, 0x01c7,
-	0x0010, 0xc009, 0x0000, 0xc008, 0x0013, 0x01c7, 0x0000, 0x78b0,
-	0x0012, 0xb044, 0x0013, 0x11d2, 0x0002, 0xb049, 0x0013, 0x11d2,
+	0x001b, 0x818c, 0x0010, 0xb3fe, 0x0013, 0x6194, 0x0000, 0xb309,
+	0x0015, 0x0033, 0x0010, 0xc00a, 0x001b, 0x8192, 0x0013, 0x01cb,
+	0x0010, 0xc009, 0x0000, 0xc008, 0x0013, 0x01cb, 0x0000, 0x78b0,
+	0x0012, 0xb044, 0x0003, 0x11d6, 0x0002, 0xb049, 0x0003, 0x11d6,
 	0x0010, 0x71ff, 0x0012, 0xff38, 0x0010, 0xff71, 0x0010, 0x0dfe,
 	0x0013, 0x6146, 0x0012, 0x0c10, 0x0010, 0xff0c, 0x0015, 0x0030,
 	0x0000, 0x0400, 0x0011, 0x0d88, 0x0010, 0x0003, 0x0000, 0xff31,
-	0x0015, 0x0033, 0x0000, 0xb309, 0x000b, 0x81a6, 0x0010, 0xb3fe,
-	0x0013, 0x61ae, 0x0000, 0xb305, 0x0015, 0x0033, 0x0010, 0xc00a,
-	0x000b, 0x81ac, 0x0013, 0x01b0, 0x0010, 0xc005, 0x0000, 0xc004,
-	0x0002, 0x033f, 0x0002, 0xff27, 0x0000, 0x0db8, 0x0004, 0x0378,
-	0x0000, 0x0db8, 0x0004, 0x083d, 0x0015, 0x0030, 0x0000, 0x0400,
+	0x0015, 0x0033, 0x0000, 0xb309, 0x000b, 0x81aa, 0x0010, 0xb3fe,
+	0x0003, 0x61b2, 0x0000, 0xb305, 0x0015, 0x0033, 0x0010, 0xc00a,
+	0x001b, 0x81b0, 0x0003, 0x01b4, 0x0010, 0xc005, 0x0000, 0xc004,
+	0x0002, 0x033f, 0x0002, 0xff27, 0x0000, 0x0db8, 0x0014, 0x0397,
+	0x0000, 0x0db8, 0x0004, 0x0867, 0x0015, 0x0030, 0x0000, 0x0400,
 	0x0011, 0xbc88, 0x0010, 0x0000, 0x0000, 0xff31, 0x0015, 0x0033,
-	0x0000, 0xb309, 0x000b, 0x81bd, 0x0011, 0xb3e8, 0x0000, 0x0002,
+	0x0000, 0xb309, 0x001b, 0x81c1, 0x0011, 0xb3e8, 0x0000, 0x0002,
 	0x001b, 0x1146, 0x0005, 0x0002, 0x0010, 0x0005, 0x0003, 0x0148,
-	0x0012, 0x7849, 0x0013, 0x11d2, 0x0003, 0x0148, 0x0000, 0x0db8,
-	0x0012, 0x0345, 0x001b, 0x11cd, 0x0002, 0x033f, 0x0004, 0x0378,
-	0x0013, 0x0146, 0x0002, 0x033f, 0x0002, 0xff27, 0x0004, 0x0378,
-	0x0004, 0x083d, 0x0013, 0x0146, 0x0015, 0x00b8, 0x0000, 0x0001,
-	0x0015, 0x003a, 0x0010, 0x0101, 0x0004, 0x083d, 0x0003, 0x0153,
-	0x0000, 0x2bba, 0x0003, 0xb1d9, 0x0005, 0x002a, 0x0000, 0x0002,
-	0x0001, 0xbac8, 0x0000, 0x0700, 0x000b, 0x12b1, 0x0011, 0x15e8,
-	0x0000, 0x0002, 0x0003, 0x122c, 0x0011, 0x15e8, 0x0000, 0x0001,
-	0x0013, 0x11e8, 0x0005, 0x0015, 0x0010, 0x0000, 0x0003, 0x020f,
-	0x0005, 0x0015, 0x0010, 0x0000, 0x0002, 0xba43, 0x0003, 0x1210,
-	0x0003, 0xb1ec, 0x0005, 0x002a, 0x0000, 0x0004, 0x0012, 0xba42,
-	0x0003, 0x1216, 0x0012, 0x104b, 0x000b, 0x120f, 0x0000, 0x1a30,
-	0x0005, 0x0031, 0x0000, 0x0002, 0x0015, 0x0033, 0x0000, 0x1b2a,
-	0x001b, 0x81f8, 0x0010, 0x20b0, 0x0010, 0x21b1, 0x0010, 0x22b2,
-	0x0010, 0x23b3, 0x0010, 0x24b4, 0x0010, 0x25b5, 0x0010, 0x28b8,
-	0x0010, 0x29b9, 0x0000, 0x1a30, 0x0005, 0x0031, 0x0000, 0x0007,
-	0x0015, 0x0033, 0x0010, 0xb032, 0x000b, 0x8206, 0x0000, 0x1a30,
-	0x0005, 0x0031, 0x0010, 0x000f, 0x0015, 0x0033, 0x0010, 0xb812,
-	0x000b, 0x820c, 0x0005, 0x0015, 0x0010, 0x0000, 0x0013, 0x0035,
-	0x0000, 0x1efe, 0x0003, 0x6224, 0x0014, 0x0256, 0x0000, 0x1efe,
-	0x000c, 0x6256, 0x0003, 0x020f, 0x0000, 0x1a30, 0x0005, 0x0031,
-	0x0000, 0x0020, 0x0015, 0x0033, 0x0000, 0xb009, 0x000b, 0x821b,
-	0x0002, 0xb02f, 0x0000, 0xffb0, 0x0005, 0x0031, 0x0000, 0x0020,
-	0x0015, 0x0033, 0x0000, 0xb00a, 0x000b, 0x8222, 0x0003, 0x01f3,
-	0x0015, 0x00b8, 0x0010, 0x0005, 0x0004, 0x083d, 0x0000, 0x13b8,
-	0x0015, 0x003a, 0x0010, 0x0404, 0x0004, 0x083d, 0x0003, 0x020f,
-	0x0005, 0x0015, 0x0000, 0x0001, 0x0012, 0xba42, 0x0013, 0x1239,
-	0x0013, 0xb230, 0x0010, 0x2bff, 0x0012, 0xff4f, 0x000b, 0x11d8,
-	0x0002, 0xba43, 0x001b, 0x1216, 0x0000, 0x1efe, 0x000c, 0x6256,
-	0x0003, 0x020f, 0x0010, 0x28b8, 0x0010, 0x29b9, 0x0004, 0x02c7,
-	0x0002, 0x3a42, 0x000b, 0x120f, 0x0000, 0x1c30, 0x0015, 0x00ff,
-	0x0000, 0x0002, 0x0002, 0x1f43, 0x001b, 0x1246, 0x0001, 0xff88,
-	0x0000, 0x0002, 0x0003, 0x0248, 0x0001, 0xff88, 0x0000, 0x0004,
-	0x0000, 0xff31, 0x0015, 0x0033, 0x0000, 0xb011, 0x000b, 0x824b,
-	0x0000, 0xb0ff, 0x0011, 0x16a0, 0x0000, 0xff16, 0x000b, 0x24e2,
-	0x0002, 0xb100, 0x0003, 0x0253, 0x0010, 0xb1ff, 0x0001, 0x17a0,
-	0x0010, 0xff17, 0x0013, 0x0216, 0x0000, 0x16ff, 0x0001, 0x18a0,
-	0x0010, 0xff00, 0x001b, 0x225d, 0x0002, 0x1700, 0x0003, 0x12b0,
-	0x0013, 0x025e, 0x0010, 0x17ff, 0x0011, 0x19a0, 0x0003, 0x22b0,
-	0x0011, 0x00d0, 0x0003, 0x12b0, 0x0000, 0x1c30, 0x0000, 0x1b31,
-	0x0015, 0x0033, 0x0000, 0xb131, 0x000b, 0x8266, 0x0003, 0xb267,
-	0x0000, 0xb120, 0x0010, 0xb221, 0x0002, 0x1f43, 0x001b, 0x1273,
-	0x0010, 0xc022, 0x0000, 0xc023, 0x0000, 0xb324, 0x0000, 0xb425,
-	0x0010, 0xb3b5, 0x0000, 0xb4b6, 0x0003, 0x0277, 0x0000, 0xb322,
-	0x0000, 0xb423, 0x0000, 0xb524, 0x0010, 0xb625, 0x0013, 0xb277,
-	0x0005, 0x002a, 0x0000, 0x0001, 0x0012, 0x1500, 0x0000, 0xff15,
-	0x0000, 0x16ff, 0x0001, 0xb580, 0x0000, 0xff16, 0x000b, 0x2282,
-	0x0002, 0x1700, 0x0013, 0x0283, 0x0010, 0x17ff, 0x0001, 0xb680,
-	0x0010, 0xff17, 0x0012, 0x1e10, 0x0010, 0xff1e, 0x0013, 0x62b0,
-	0x0002, 0x1d00, 0x0010, 0xff1d, 0x0010, 0xc030, 0x0000, 0xff31,
-	0x0015, 0x0033, 0x0000, 0xb009, 0x000b, 0x828e, 0x0010, 0xb0fe,
-	0x001b, 0x62af, 0x0000, 0x1c30, 0x0005, 0x0031, 0x0000, 0x0001,
-	0x0015, 0x0033, 0x0000, 0xb009, 0x000b, 0x8296, 0x0010, 0xb0fe,
-	0x001b, 0x629c, 0x0005, 0x00ce, 0x0010, 0x0005, 0x0013, 0x0801,
-	0x0010, 0xb01c, 0x0000, 0x1c30, 0x0005, 0x0031, 0x0000, 0x0019,
-	0x0015, 0x0033, 0x0000, 0xb009, 0x001b, 0x82a2, 0x0001, 0xb0c8,
-	0x0010, 0x00ff, 0x0000, 0xff1f, 0x0010, 0xc030, 0x0011, 0xbe80,
-	0x0000, 0xff31, 0x0015, 0x0033, 0x0000, 0xb009, 0x001b, 0x82ab,
-	0x0000, 0xb01d, 0x0010, 0x1dff, 0x0013, 0x028a, 0x0000, 0xb01b,
-	0x0017, 0x4000, 0x0002, 0x3a41, 0x0003, 0x12b9, 0x0003, 0xb2b3,
-	0x0005, 0x002a, 0x0000, 0x0004, 0x0005, 0x0015, 0x0010, 0x0000,
-	0x0003, 0x020f, 0x0000, 0x1a30, 0x0005, 0x0031, 0x0000, 0x0002,
-	0x0015, 0x0033, 0x0000, 0x1b2a, 0x000b, 0x82be, 0x0015, 0x00b8,
-	0x0000, 0x0004, 0x0004, 0x083d, 0x0000, 0x13b8, 0x0015, 0x003a,
-	0x0010, 0x0404, 0x0004, 0x083d, 0x0013, 0x0039, 0x0002, 0x1e00,
-	0x0010, 0xff1e, 0x0012, 0x1d10, 0x0010, 0xff1d, 0x0010, 0xc030,
-	0x0000, 0xff31, 0x0015, 0x0033, 0x0000, 0xb009, 0x000b, 0x82cf,
-	0x0010, 0xb0fe, 0x000b, 0x62f4, 0x0000, 0x1cff, 0x0001, 0x1ae0,
-	0x0013, 0x12de, 0x0000, 0x1c30, 0x0005, 0x0031, 0x0010, 0x0000,
-	0x0015, 0x0033, 0x0000, 0xb009, 0x001b, 0x82da, 0x0010, 0xb0fe,
-	0x001b, 0x62de, 0x0000, 0x1aff, 0x0000, 0xff1c, 0x0000, 0x1c30,
-	0x0005, 0x0031, 0x0000, 0x0019, 0x0015, 0x0033, 0x0000, 0xb009,
-	0x000b, 0x82e4, 0x0001, 0xb0c8, 0x0010, 0x000f, 0x0000, 0xff1f,
-	0x0001, 0xbf80, 0x0010, 0xff1d, 0x0010, 0xc030, 0x0000, 0xff31,
-	0x0015, 0x0033, 0x0000, 0xb009, 0x000b, 0x82ee, 0x0010, 0xb0fe,
-	0x000b, 0x62f4, 0x0005, 0x00ce, 0x0010, 0x0006, 0x0013, 0x0801,
-	0x0000, 0xb01b, 0x0017, 0x4000, 0x0010, 0x79b0, 0x0000, 0xd0ff,
-	0x0012, 0xff40, 0x001b, 0x1039, 0x0015, 0x00d1, 0x0010, 0x0101,
-	0x0003, 0x92fc, 0x0005, 0x0079, 0x0000, 0x0002, 0x0003, 0x92ff,
-	0x0015, 0x00d1, 0x0000, 0x0100, 0x0010, 0x13fe, 0x0003, 0x6334,
-	0x0012, 0xb04e, 0x001b, 0x1350, 0x0012, 0x784a, 0x0003, 0x1356,
-	0x0000, 0x75ff, 0x0011, 0xffc8, 0x0010, 0x1800, 0x001b, 0x1356,
-	0x0001, 0x0fe8, 0x0000, 0x0001, 0x001b, 0x1318, 0x0015, 0x0030,
-	0x0000, 0x0400, 0x0011, 0x1388, 0x0000, 0x000e, 0x0000, 0xff31,
-	0x0015, 0x0033, 0x0000, 0x8f0a, 0x000b, 0x8316, 0x0013, 0x035c,
-	0x0001, 0x0fe8, 0x0000, 0x0002, 0x000b, 0x1323, 0x0015, 0x0030,
-	0x0000, 0x0400, 0x0005, 0x0031, 0x0000, 0x001a, 0x0015, 0x0033,
-	0x0010, 0xc00a, 0x001b, 0x8321, 0x0013, 0x035c, 0x0001, 0x0fe8,
-	0x0010, 0x0000, 0x0013, 0x132a, 0x0005, 0x00ce, 0x0000, 0x0007,
-	0x0010, 0x0fcf, 0x0013, 0x07fb, 0x0000, 0x13b8, 0x0002, 0x1045,
-	0x0013, 0x1332, 0x0012, 0x103f, 0x0002, 0xff27, 0x0004, 0x0378,
-	0x0004, 0x083d, 0x0003, 0x0334, 0x0012, 0x103f, 0x0004, 0x0378,
-	0x0015, 0x000f, 0x0010, 0x0000, 0x0002, 0x3944, 0x0013, 0x133d,
-	0x0015, 0x0039, 0x0000, 0x5040, 0x0015, 0x00b8, 0x0000, 0x0008,
-	0x0004, 0x083d, 0x0015, 0x0030, 0x0000, 0x0400, 0x0001, 0xbd88,
-	0x0010, 0x000c, 0x0000, 0xff31, 0x0015, 0x0033, 0x0010, 0xc00a,
-	0x001b, 0x8344, 0x0010, 0xc014, 0x0000, 0xc013, 0x0000, 0xc010,
-	0x0002, 0x3a47, 0x0013, 0x134f, 0x0015, 0x003a, 0x0000, 0x8000,
-	0x0015, 0x003a, 0x0010, 0x4040, 0x0014, 0x0806, 0x0013, 0x0039,
-	0x0015, 0x00b8, 0x0010, 0x0003, 0x0015, 0x003a, 0x0010, 0x0202,
-	0x0004, 0x083d, 0x0013, 0x0348, 0x0015, 0x00b8, 0x0000, 0x0002,
-	0x0015, 0x003a, 0x0010, 0x0202, 0x0004, 0x083d, 0x0013, 0x0348,
-	0x0015, 0x0030, 0x0000, 0x0400, 0x0011, 0x1388, 0x0010, 0x0003,
-	0x0000, 0xff31, 0x0015, 0x0033, 0x0000, 0xb009, 0x001b, 0x8363,
-	0x0011, 0x1388, 0x0010, 0x0003, 0x0000, 0xff31, 0x0015, 0x0033,
-	0x0010, 0xc00a, 0x001b, 0x8369, 0x0010, 0xb0fe, 0x0003, 0x636e,
-	0x0000, 0xb012, 0x0003, 0x0370, 0x0010, 0xc012, 0x0010, 0xc011,
-	0x0012, 0x104b, 0x0013, 0x132a, 0x0002, 0x103b, 0x0010, 0xff03,
-	0x0005, 0x0002, 0x0010, 0x0000, 0x0000, 0xc00d, 0x0003, 0x032a,
-	0x0000, 0xffb0, 0x0010, 0xc3b1, 0x0015, 0x0030, 0x0000, 0x0400,
-	0x0001, 0xb888, 0x0010, 0x0011, 0x0000, 0xff31, 0x0015, 0x0033,
-	0x0000, 0xb012, 0x001b, 0x8381, 0x0017, 0x4000, 0x0012, 0x3a43,
-	0x0013, 0x1392, 0x0015, 0x003a, 0x0000, 0x0800, 0x0010, 0x0db0,
-	0x0003, 0x6392, 0x0000, 0x0bff, 0x0001, 0xb0e0, 0x0003, 0x13bb,
-	0x0010, 0x09ff, 0x0001, 0xb0e0, 0x0003, 0x139f, 0x0010, 0x05ff,
-	0x0001, 0xb0e0, 0x0003, 0x1396, 0x0000, 0xc00e, 0x0000, 0x05fe,
-	0x0013, 0x639c, 0x0000, 0x050d, 0x0005, 0x0002, 0x0000, 0x0004,
-	0x0014, 0x041d, 0x0002, 0x3a47, 0x001b, 0x141c, 0x0003, 0x03b6,
-	0x0000, 0x09fe, 0x0013, 0x63b8, 0x0000, 0x090d, 0x0005, 0x0002,
-	0x0000, 0x0001, 0x0014, 0x0436, 0x0015, 0x0030, 0x0000, 0x0400,
-	0x0011, 0x0d88, 0x0000, 0x0004, 0x0000, 0xff31, 0x0015, 0x0033,
-	0x0000, 0xba09, 0x001b, 0x83a9, 0x0011, 0x03c8, 0x0010, 0x000f,
-	0x0000, 0xffb6, 0x0011, 0xb6e8, 0x0000, 0x0001, 0x0013, 0x14ca,
-	0x0011, 0xb6e8, 0x0000, 0x0002, 0x0003, 0x14ec, 0x0011, 0xb6e8,
-	0x0010, 0x0003, 0x0003, 0x15d7, 0x0014, 0x0806, 0x0013, 0x041c,
-	0x0010, 0x0bfe, 0x0013, 0x641c, 0x0010, 0x0b0d, 0x0005, 0x0002,
-	0x0000, 0x0002, 0x0014, 0x0436, 0x0015, 0x0030, 0x0000, 0x0400,
-	0x0011, 0x0d88, 0x0000, 0x0004, 0x0000, 0xff31, 0x0015, 0x0033,
-	0x0000, 0xba09, 0x001b, 0x83c5, 0x0000, 0xb930, 0x0005, 0x0031,
-	0x0010, 0x0021, 0x0015, 0x0033, 0x0000, 0xb009, 0x000b, 0x83cb,
-	0x0001, 0xb0a8, 0x0000, 0x199a, 0x0003, 0x23d1, 0x0005, 0x00b0,
-	0x0000, 0x1999, 0x0012, 0xb050, 0x0000, 0xffb0, 0x0002, 0xff50,
-	0x0002, 0xff50, 0x0001, 0xb080, 0x0000, 0xffb0, 0x0015, 0x0030,
-	0x0000, 0x0400, 0x0011, 0x0d88, 0x0010, 0x0006, 0x0000, 0xff31,
-	0x0015, 0x0033, 0x0000, 0xb00a, 0x001b, 0x83de, 0x0000, 0xb930,
-	0x0005, 0x0031, 0x0000, 0x0019, 0x0015, 0x0033, 0x0000, 0xb009,
-	0x001b, 0x83e4, 0x0001, 0xb0c8, 0x0010, 0x00ff, 0x0001, 0xffe8,
-	0x0010, 0x0048, 0x001b, 0x1445, 0x0005, 0x0002, 0x0010, 0x0006,
-	0x0012, 0x0c10, 0x0010, 0xff0c, 0x0015, 0x0030, 0x0000, 0x0400,
-	0x0011, 0x0d88, 0x0010, 0x0003, 0x0000, 0xff31, 0x0015, 0x0033,
-	0x0010, 0xb109, 0x001b, 0x83f5, 0x0000, 0xb10b, 0x000b, 0x63f9,
-	0x0010, 0xb10a, 0x0015, 0x0033, 0x0010, 0xc00a, 0x000b, 0x83fb,
-	0x0002, 0x032b, 0x0010, 0xff03, 0x0011, 0x0d88, 0x0010, 0x0011,
-	0x0000, 0xff31, 0x0015, 0x0033, 0x0010, 0x030a, 0x000b, 0x8403,
-	0x0000, 0x11fe, 0x000b, 0x6408, 0x0000, 0x0d12, 0x0003, 0x0411,
-	0x0015, 0x0030, 0x0000, 0x0400, 0x0001, 0x1188, 0x0010, 0x0003,
-	0x0000, 0xff31, 0x0010, 0x0db0, 0x0015, 0x0033, 0x0000, 0xb00a,
-	0x001b, 0x8410, 0x0000, 0x0d11, 0x0013, 0x041c, 0x0000, 0x05fe,
-	0x0013, 0x641c, 0x0005, 0x0002, 0x0000, 0x0004, 0x0000, 0x050d,
-	0x0014, 0x041d, 0x0002, 0x3a47, 0x001b, 0x141c, 0x0014, 0x0806,
-	0x0003, 0x0049, 0x0001, 0xc7c8, 0x0010, 0x0028, 0x000b, 0x1435,
-	0x0015, 0x0030, 0x0000, 0x0400, 0x0011, 0x0d88, 0x0010, 0x000a,
-	0x0000, 0xff31, 0x0015, 0x0033, 0x0000, 0xb009, 0x000b, 0x8427,
-	0x0002, 0xb04f, 0x0013, 0x1435, 0x0001, 0x0fe8, 0x0010, 0x0000,
-	0x0013, 0x1433, 0x0001, 0x0fe8, 0x0000, 0x0002, 0x0013, 0x1433,
-	0x0015, 0x003a, 0x0010, 0x8080, 0x0003, 0x0435, 0x0015, 0x003a,
-	0x0010, 0x4040, 0x0017, 0x4000, 0x0015, 0x0030, 0x0000, 0x0400,
-	0x0011, 0x0d88, 0x0010, 0x0011, 0x0000, 0xff31, 0x0015, 0x0033,
-	0x0010, 0x0309, 0x001b, 0x843d, 0x0011, 0x0d88, 0x0010, 0x0005,
-	0x0000, 0xff31, 0x0015, 0x0033, 0x0000, 0xb909, 0x001b, 0x8443,
-	0x0017, 0x4000, 0x0005, 0x00b6, 0x0010, 0x0600, 0x0014, 0x0607,
-	0x0014, 0x04b4, 0x0000, 0xb05a, 0x0000, 0xb15b, 0x0005, 0x0054,
-	0x0010, 0x0829, 0x0010, 0x0d58, 0x0015, 0x0059, 0x0010, 0xffff,
-	0x0000, 0xb930, 0x0005, 0x0031, 0x0010, 0x001e, 0x0015, 0x0033,
-	0x0000, 0xb009, 0x000b, 0x8455, 0x0000, 0xb05c, 0x0005, 0x0031,
-	0x0000, 0x001f, 0x0015, 0x0033, 0x0000, 0xb009, 0x001b, 0x845b,
-	0x0001, 0xb0c8, 0x0010, 0x000f, 0x001b, 0x1462, 0x0015, 0x00ff,
-	0x0010, 0x0005, 0x0003, 0x046a, 0x0002, 0xb040, 0x0003, 0x1467,
-	0x0015, 0x00ff, 0x0000, 0x0004, 0x0003, 0x046a, 0x0001, 0xb0c8,
-	0x0010, 0x0006, 0x0002, 0xff60, 0x0010, 0xffb2, 0x0011, 0x0d88,
-	0x0000, 0x0019, 0x0000, 0xff31, 0x0015, 0x0033, 0x0010, 0xb109,
-	0x001b, 0x8470, 0x0012, 0xb170, 0x0011, 0xffc8, 0x0010, 0xff00,
-	0x0011, 0xb2d0, 0x0010, 0xff60, 0x0002, 0xb045, 0x0013, 0x147b,
-	0x0015, 0x00b2, 0x0000, 0x0002, 0x0013, 0x0485, 0x0002, 0xb046,
-	0x0003, 0x1480, 0x0015, 0x00b2, 0x0000, 0x0001, 0x0013, 0x0485,
-	0x0015, 0x00b2, 0x0010, 0x0000, 0x0000, 0xc0b0, 0x0010, 0xc0b1,
-	0x0003, 0x048b, 0x0000, 0xb930, 0x0005, 0x0031, 0x0010, 0x002b,
-	0x0015, 0x0033, 0x0000, 0xb011, 0x001b, 0x848a, 0x0010, 0xb16a,
-	0x0010, 0xb06b, 0x0000, 0xb261, 0x0015, 0x0044, 0x0010, 0x0018,
-	0x0005, 0x0031, 0x0000, 0x0023, 0x0015, 0x0033, 0x0000, 0x6241,
-	0x001b, 0x8494, 0x0003, 0x9495, 0x0015, 0x00a0, 0x0000, 0x0020,
-	0x0012, 0xd041, 0x001b, 0x1498, 0x0015, 0x00d1, 0x0010, 0x0202,
-	0x0003, 0x949c, 0x0000, 0x75ff, 0x0011, 0xffc8, 0x0000, 0x1804,
-	0x0001, 0xffd8, 0x0010, 0x0009, 0x0013, 0x94a2, 0x0000, 0xff75,
-	0x0013, 0x94a4, 0x0015, 0x00d1, 0x0000, 0x0200, 0x0015, 0x0030,
-	0x0000, 0x0400, 0x0001, 0xbd88, 0x0000, 0x0008, 0x0000, 0xff31,
-	0x0015, 0x00b1, 0x0010, 0x07d0, 0x0005, 0x00b0, 0x0010, 0x0009,
-	0x0015, 0x0033, 0x0000, 0xb012, 0x000b, 0x84b2, 0x0013, 0x041c,
-	0x0000, 0xba30, 0x0005, 0x0031, 0x0010, 0x0035, 0x0015, 0x0033,
-	0x0000, 0xb009, 0x001b, 0x84b9, 0x0002, 0xb040, 0x0003, 0x14c7,
-	0x0000, 0xb7b0, 0x0000, 0xb9b1, 0x0015, 0x0030, 0x0000, 0x0400,
-	0x0011, 0x0d88, 0x0000, 0x0013, 0x0000, 0xff31, 0x0015, 0x0033,
-	0x0000, 0xb012, 0x000b, 0x84c5, 0x0003, 0x04c9, 0x0010, 0xc0b1,
-	0x0000, 0xc0b0, 0x0017, 0x4000, 0x0005, 0x00b6, 0x0010, 0x0500,
-	0x0014, 0x0607, 0x0005, 0x0054, 0x0010, 0x0889, 0x0015, 0x0030,
-	0x0000, 0x0400, 0x0011, 0x0d88, 0x0000, 0x0002, 0x0000, 0xff31,
-	0x0015, 0x0033, 0x0000, 0xb009, 0x001b, 0x84d6, 0x0010, 0xb058,
-	0x0000, 0x0d59, 0x0000, 0xb930, 0x0005, 0x0031, 0x0000, 0x0023,
-	0x0015, 0x0033, 0x0000, 0xb011, 0x000b, 0x84de, 0x0010, 0xb15c,
-	0x0010, 0xb05d, 0x0005, 0x0031, 0x0010, 0x002b, 0x0015, 0x0033,
-	0x0000, 0xb011, 0x001b, 0x84e5, 0x0000, 0xb15e, 0x0000, 0xb05f,
-	0x0003, 0x94e8, 0x0015, 0x00a0, 0x0010, 0x000c, 0x0003, 0x05ec,
-	0x0005, 0x00b6, 0x0000, 0x0700, 0x0014, 0x0607, 0x0015, 0x0030,
-	0x0000, 0x0400, 0x0011, 0x0d88, 0x0010, 0x0009, 0x0000, 0xff31,
-	0x0015, 0x0033, 0x0010, 0xb709, 0x000b, 0x84f6, 0x0012, 0xb749,
-	0x0013, 0x14fc, 0x0005, 0x0054, 0x0010, 0x0889, 0x0013, 0x04fe,
-	0x0005, 0x0054, 0x0010, 0x0898, 0x0015, 0x0030, 0x0000, 0x0400,
-	0x0011, 0x0d88, 0x0000, 0x0002, 0x0000, 0xff31, 0x0015, 0x0033,
-	0x0000, 0xb009, 0x001b, 0x8505, 0x0010, 0xb058, 0x0000, 0x0d59,
-	0x0001, 0xb9a8, 0x0010, 0x00f0, 0x000b, 0x252a, 0x0011, 0x0d88,
+	0x0012, 0x7849, 0x0003, 0x11d6, 0x0003, 0x0148, 0x0000, 0x0db8,
+	0x0012, 0x0345, 0x000b, 0x11d1, 0x0002, 0x033f, 0x0014, 0x0397,
+	0x0013, 0x0146, 0x0002, 0x033f, 0x0002, 0xff27, 0x0014, 0x0397,
+	0x0004, 0x0867, 0x0013, 0x0146, 0x0015, 0x00b8, 0x0000, 0x0001,
+	0x0015, 0x003a, 0x0010, 0x0101, 0x0004, 0x0867, 0x0013, 0x0157,
+	0x0001, 0x2bd8, 0x0010, 0x0000, 0x0000, 0xffba, 0x0003, 0xb1df,
+	0x0005, 0x002a, 0x0000, 0x0002, 0x0001, 0xbac8, 0x0000, 0x0700,
+	0x000b, 0x12cc, 0x0011, 0x15e8, 0x0000, 0x0002, 0x0013, 0x1242,
+	0x0011, 0x15e8, 0x0000, 0x0001, 0x0013, 0x11ee, 0x0005, 0x0015,
+	0x0010, 0x0000, 0x0013, 0x0225, 0x0005, 0x0015, 0x0010, 0x0000,
+	0x0002, 0xba43, 0x0003, 0x1226, 0x0003, 0xb1f2, 0x0005, 0x002a,
+	0x0000, 0x0004, 0x0012, 0xba42, 0x0003, 0x122c, 0x0012, 0x104b,
+	0x001b, 0x1225, 0x0000, 0x1a30, 0x0005, 0x0031, 0x0000, 0x0002,
+	0x0015, 0x0033, 0x0000, 0x1b2a, 0x001b, 0x81fe, 0x0011, 0x20d8,
+	0x0010, 0x0000, 0x0000, 0xffb0, 0x0001, 0x21d8, 0x0010, 0x0000,
+	0x0010, 0xffb1, 0x0001, 0x22d8, 0x0010, 0x0000, 0x0010, 0xffb2,
+	0x0011, 0x23d8, 0x0010, 0x0000, 0x0000, 0xffb3, 0x0001, 0x24d8,
+	0x0010, 0x0000, 0x0010, 0xffb4, 0x0011, 0x25d8, 0x0010, 0x0000,
+	0x0000, 0xffb5, 0x0001, 0x28d8, 0x0010, 0x0000, 0x0010, 0xffb8,
+	0x0011, 0x29d8, 0x0010, 0x0000, 0x0000, 0xffb9, 0x0000, 0x1a30,
+	0x0005, 0x0031, 0x0000, 0x0007, 0x0015, 0x0033, 0x0010, 0xb032,
+	0x001b, 0x821c, 0x0000, 0x1a30, 0x0005, 0x0031, 0x0010, 0x000f,
+	0x0015, 0x0033, 0x0010, 0xb812, 0x000b, 0x8222, 0x0005, 0x0015,
+	0x0010, 0x0000, 0x0013, 0x0035, 0x0000, 0x1efe, 0x0003, 0x623a,
+	0x0014, 0x0271, 0x0000, 0x1efe, 0x000c, 0x6271, 0x0013, 0x0225,
+	0x0000, 0x1a30, 0x0005, 0x0031, 0x0000, 0x0020, 0x0015, 0x0033,
+	0x0000, 0xb009, 0x001b, 0x8231, 0x0002, 0xb02f, 0x0000, 0xffb0,
+	0x0005, 0x0031, 0x0000, 0x0020, 0x0015, 0x0033, 0x0000, 0xb00a,
+	0x001b, 0x8238, 0x0003, 0x01f9, 0x0015, 0x00b8, 0x0010, 0x0005,
+	0x0004, 0x0867, 0x0000, 0x13b8, 0x0015, 0x003a, 0x0010, 0x0404,
+	0x0004, 0x0867, 0x0013, 0x0225, 0x0005, 0x0015, 0x0000, 0x0001,
+	0x0012, 0xba42, 0x0013, 0x1250, 0x0003, 0xb246, 0x0001, 0x2bd8,
+	0x0010, 0x0000, 0x0012, 0xff4f, 0x001b, 0x11dc, 0x0002, 0xba43,
+	0x001b, 0x122c, 0x0000, 0x1efe, 0x000c, 0x6271, 0x0013, 0x0225,
+	0x0001, 0x28d8, 0x0010, 0x0000, 0x0010, 0xffb8, 0x0011, 0x29d8,
+	0x0010, 0x0000, 0x0000, 0xffb9, 0x0014, 0x02e2, 0x0002, 0x3a42,
+	0x001b, 0x1225, 0x0000, 0x1c30, 0x0015, 0x00ff, 0x0000, 0x0002,
+	0x0002, 0x1f43, 0x001b, 0x1261, 0x0001, 0xff88, 0x0000, 0x0002,
+	0x0003, 0x0263, 0x0001, 0xff88, 0x0000, 0x0004, 0x0000, 0xff31,
+	0x0015, 0x0033, 0x0000, 0xb011, 0x000b, 0x8266, 0x0000, 0xb0ff,
+	0x0011, 0x16a0, 0x0000, 0xff16, 0x000b, 0x24e2, 0x0002, 0xb100,
+	0x0013, 0x026e, 0x0010, 0xb1ff, 0x0001, 0x17a0, 0x0010, 0xff17,
+	0x0013, 0x022c, 0x0000, 0x16ff, 0x0001, 0x18a0, 0x0010, 0xff00,
+	0x000b, 0x2278, 0x0002, 0x1700, 0x0003, 0x12cb, 0x0013, 0x0279,
+	0x0010, 0x17ff, 0x0011, 0x19a0, 0x0003, 0x22cb, 0x0011, 0x00d0,
+	0x0003, 0x12cb, 0x0000, 0x1c30, 0x0000, 0x1b31, 0x0015, 0x0033,
+	0x0000, 0xb131, 0x000b, 0x8281, 0x0013, 0xb282, 0x0000, 0xb120,
+	0x0010, 0xb221, 0x0002, 0x1f43, 0x000b, 0x128e, 0x0010, 0xc022,
+	0x0000, 0xc023, 0x0000, 0xb324, 0x0000, 0xb425, 0x0010, 0xb3b5,
+	0x0000, 0xb4b6, 0x0013, 0x0292, 0x0000, 0xb322, 0x0000, 0xb423,
+	0x0000, 0xb524, 0x0010, 0xb625, 0x0003, 0xb292, 0x0005, 0x002a,
+	0x0000, 0x0001, 0x0012, 0x1500, 0x0000, 0xff15, 0x0000, 0x16ff,
+	0x0001, 0xb580, 0x0000, 0xff16, 0x001b, 0x229d, 0x0002, 0x1700,
+	0x0013, 0x029e, 0x0010, 0x17ff, 0x0001, 0xb680, 0x0010, 0xff17,
+	0x0012, 0x1e10, 0x0010, 0xff1e, 0x0013, 0x62cb, 0x0002, 0x1d00,
+	0x0010, 0xff1d, 0x0010, 0xc030, 0x0000, 0xff31, 0x0015, 0x0033,
+	0x0000, 0xb009, 0x000b, 0x82a9, 0x0010, 0xb0fe, 0x001b, 0x62ca,
+	0x0000, 0x1c30, 0x0005, 0x0031, 0x0000, 0x0001, 0x0015, 0x0033,
+	0x0000, 0xb009, 0x000b, 0x82b1, 0x0010, 0xb0fe, 0x001b, 0x62b7,
+	0x0005, 0x00ce, 0x0010, 0x0005, 0x0013, 0x0829, 0x0010, 0xb01c,
+	0x0000, 0x1c30, 0x0005, 0x0031, 0x0000, 0x0019, 0x0015, 0x0033,
+	0x0000, 0xb009, 0x000b, 0x82bd, 0x0001, 0xb0c8, 0x0010, 0x00ff,
+	0x0000, 0xff1f, 0x0010, 0xc030, 0x0011, 0xbe80, 0x0000, 0xff31,
+	0x0015, 0x0033, 0x0000, 0xb009, 0x000b, 0x82c6, 0x0000, 0xb01d,
+	0x0010, 0x1dff, 0x0003, 0x02a5, 0x0000, 0xb01b, 0x0017, 0x4000,
+	0x0002, 0x3a41, 0x0013, 0x12d4, 0x0003, 0xb2ce, 0x0005, 0x002a,
+	0x0000, 0x0004, 0x0005, 0x0015, 0x0010, 0x0000, 0x0013, 0x0225,
+	0x0000, 0x1a30, 0x0005, 0x0031, 0x0000, 0x0002, 0x0015, 0x0033,
+	0x0000, 0x1b2a, 0x001b, 0x82d9, 0x0015, 0x00b8, 0x0000, 0x0004,
+	0x0004, 0x0867, 0x0000, 0x13b8, 0x0015, 0x003a, 0x0010, 0x0404,
+	0x0004, 0x0867, 0x0013, 0x0039, 0x0002, 0x1e00, 0x0010, 0xff1e,
+	0x0012, 0x1d10, 0x0010, 0xff1d, 0x0010, 0xc030, 0x0000, 0xff31,
+	0x0015, 0x0033, 0x0000, 0xb009, 0x001b, 0x82ea, 0x0010, 0xb0fe,
+	0x000b, 0x630f, 0x0000, 0x1cff, 0x0001, 0x1ae0, 0x0013, 0x12f9,
+	0x0000, 0x1c30, 0x0005, 0x0031, 0x0010, 0x0000, 0x0015, 0x0033,
+	0x0000, 0xb009, 0x000b, 0x82f5, 0x0010, 0xb0fe, 0x001b, 0x62f9,
+	0x0000, 0x1aff, 0x0000, 0xff1c, 0x0000, 0x1c30, 0x0005, 0x0031,
+	0x0000, 0x0019, 0x0015, 0x0033, 0x0000, 0xb009, 0x000b, 0x82ff,
+	0x0001, 0xb0c8, 0x0010, 0x000f, 0x0000, 0xff1f, 0x0001, 0xbf80,
+	0x0010, 0xff1d, 0x0010, 0xc030, 0x0000, 0xff31, 0x0015, 0x0033,
+	0x0000, 0xb009, 0x001b, 0x8309, 0x0010, 0xb0fe, 0x000b, 0x630f,
+	0x0005, 0x00ce, 0x0010, 0x0006, 0x0013, 0x0829, 0x0000, 0xb01b,
+	0x0017, 0x4000, 0x0010, 0x79b0, 0x0000, 0xd0ff, 0x0012, 0xff40,
+	0x001b, 0x1039, 0x0015, 0x00d1, 0x0010, 0x0101, 0x0013, 0x9317,
+	0x0005, 0x0079, 0x0000, 0x0002, 0x0003, 0x931a, 0x0015, 0x00d1,
+	0x0000, 0x0100, 0x0010, 0x13fe, 0x0003, 0x634f, 0x0012, 0xb04e,
+	0x001b, 0x136f, 0x0012, 0x784a, 0x0013, 0x1375, 0x0000, 0x75ff,
+	0x0011, 0xffc8, 0x0010, 0x1800, 0x000b, 0x1375, 0x0001, 0x0fe8,
+	0x0000, 0x0001, 0x001b, 0x1333, 0x0015, 0x0030, 0x0000, 0x0400,
+	0x0011, 0x1388, 0x0000, 0x000e, 0x0000, 0xff31, 0x0015, 0x0033,
+	0x0000, 0x8f0a, 0x000b, 0x8331, 0x0013, 0x037b, 0x0001, 0x0fe8,
+	0x0000, 0x0002, 0x000b, 0x133e, 0x0015, 0x0030, 0x0000, 0x0400,
+	0x0005, 0x0031, 0x0000, 0x001a, 0x0015, 0x0033, 0x0010, 0xc00a,
+	0x001b, 0x833c, 0x0013, 0x037b, 0x0001, 0x0fe8, 0x0010, 0x0000,
+	0x0013, 0x1345, 0x0005, 0x00ce, 0x0000, 0x0007, 0x0010, 0x0fcf,
+	0x0013, 0x0823, 0x0000, 0x13b8, 0x0002, 0x1045, 0x0003, 0x134d,
+	0x0012, 0x103f, 0x0002, 0xff27, 0x0014, 0x0397, 0x0004, 0x0867,
+	0x0003, 0x034f, 0x0012, 0x103f, 0x0014, 0x0397, 0x0015, 0x000f,
+	0x0010, 0x0000, 0x0002, 0x3944, 0x0013, 0x1358, 0x0015, 0x0039,
+	0x0000, 0x5040, 0x0015, 0x00b8, 0x0000, 0x0008, 0x0004, 0x0867,
+	0x0015, 0x0030, 0x0000, 0x0400, 0x0001, 0xbd88, 0x0010, 0x000c,
+	0x0000, 0xff31, 0x0015, 0x0033, 0x0010, 0xc00a, 0x001b, 0x835f,
+	0x0000, 0xff31, 0x0015, 0x0033, 0x0010, 0xc00a, 0x001b, 0x8363,
+	0x0010, 0xc014, 0x0000, 0xc013, 0x0000, 0xc010, 0x0002, 0x3a47,
+	0x0013, 0x136e, 0x0015, 0x003a, 0x0000, 0x8000, 0x0015, 0x003a,
+	0x0010, 0x4040, 0x0014, 0x082e, 0x0013, 0x0039, 0x0015, 0x00b8,
+	0x0010, 0x0003, 0x0015, 0x003a, 0x0010, 0x0202, 0x0004, 0x0867,
+	0x0003, 0x0367, 0x0015, 0x00b8, 0x0000, 0x0002, 0x0015, 0x003a,
+	0x0010, 0x0202, 0x0004, 0x0867, 0x0003, 0x0367, 0x0015, 0x0030,
+	0x0000, 0x0400, 0x0011, 0x1388, 0x0010, 0x0003, 0x0000, 0xff31,
+	0x0015, 0x0033, 0x0000, 0xb009, 0x001b, 0x8382, 0x0011, 0x1388,
+	0x0010, 0x0003, 0x0000, 0xff31, 0x0015, 0x0033, 0x0010, 0xc00a,
+	0x001b, 0x8388, 0x0010, 0xb0fe, 0x0013, 0x638d, 0x0000, 0xb012,
+	0x0003, 0x038f, 0x0010, 0xc012, 0x0010, 0xc011, 0x0012, 0x104b,
+	0x0013, 0x1345, 0x0002, 0x103b, 0x0010, 0xff03, 0x0005, 0x0002,
+	0x0010, 0x0000, 0x0000, 0xc00d, 0x0003, 0x0345, 0x0000, 0xffb0,
+	0x0010, 0xc3b1, 0x0015, 0x0030, 0x0000, 0x0400, 0x0001, 0xb888,
+	0x0010, 0x0011, 0x0000, 0xff31, 0x0015, 0x0033, 0x0000, 0xb012,
+	0x001b, 0x83a0, 0x0017, 0x4000, 0x0012, 0x3a43, 0x0003, 0x13b1,
+	0x0015, 0x003a, 0x0000, 0x0800, 0x0010, 0x0db0, 0x0013, 0x63b1,
+	0x0000, 0x0bff, 0x0001, 0xb0e0, 0x0013, 0x13da, 0x0010, 0x09ff,
+	0x0001, 0xb0e0, 0x0003, 0x13be, 0x0010, 0x05ff, 0x0001, 0xb0e0,
+	0x0013, 0x13b5, 0x0000, 0xc00e, 0x0000, 0x05fe, 0x0013, 0x63bb,
+	0x0000, 0x050d, 0x0005, 0x0002, 0x0000, 0x0004, 0x0014, 0x043c,
+	0x0002, 0x3a47, 0x001b, 0x143b, 0x0003, 0x03d5, 0x0000, 0x09fe,
+	0x0013, 0x63d7, 0x0000, 0x090d, 0x0005, 0x0002, 0x0000, 0x0001,
+	0x0014, 0x0455, 0x0015, 0x0030, 0x0000, 0x0400, 0x0011, 0x0d88,
+	0x0000, 0x0004, 0x0000, 0xff31, 0x0015, 0x0033, 0x0000, 0xba09,
+	0x000b, 0x83c8, 0x0011, 0x03c8, 0x0010, 0x000f, 0x0000, 0xffb6,
+	0x0011, 0xb6e8, 0x0000, 0x0001, 0x0003, 0x14ec, 0x0011, 0xb6e8,
+	0x0000, 0x0002, 0x0013, 0x150e, 0x0011, 0xb6e8, 0x0010, 0x0003,
+	0x0013, 0x15fd, 0x0014, 0x082e, 0x0013, 0x043b, 0x0010, 0x0bfe,
+	0x0013, 0x643b, 0x0010, 0x0b0d, 0x0005, 0x0002, 0x0000, 0x0002,
+	0x0014, 0x0455, 0x0015, 0x0030, 0x0000, 0x0400, 0x0011, 0x0d88,
+	0x0000, 0x0004, 0x0000, 0xff31, 0x0015, 0x0033, 0x0000, 0xba09,
+	0x001b, 0x83e4, 0x0000, 0xb930, 0x0005, 0x0031, 0x0010, 0x0021,
+	0x0015, 0x0033, 0x0000, 0xb009, 0x000b, 0x83ea, 0x0001, 0xb0a8,
+	0x0000, 0x199a, 0x0003, 0x23f0, 0x0005, 0x00b0, 0x0000, 0x1999,
+	0x0012, 0xb050, 0x0000, 0xffb0, 0x0002, 0xff50, 0x0002, 0xff50,
+	0x0001, 0xb080, 0x0000, 0xffb0, 0x0015, 0x0030, 0x0000, 0x0400,
+	0x0011, 0x0d88, 0x0010, 0x0006, 0x0000, 0xff31, 0x0015, 0x0033,
+	0x0000, 0xb00a, 0x000b, 0x83fd, 0x0000, 0xb930, 0x0005, 0x0031,
+	0x0000, 0x0019, 0x0015, 0x0033, 0x0000, 0xb009, 0x000b, 0x8403,
+	0x0001, 0xb0c8, 0x0010, 0x00ff, 0x0001, 0xffe8, 0x0010, 0x0048,
+	0x001b, 0x1464, 0x0005, 0x0002, 0x0010, 0x0006, 0x0012, 0x0c10,
+	0x0010, 0xff0c, 0x0015, 0x0030, 0x0000, 0x0400, 0x0011, 0x0d88,
+	0x0010, 0x0003, 0x0000, 0xff31, 0x0015, 0x0033, 0x0010, 0xb109,
+	0x000b, 0x8414, 0x0000, 0xb10b, 0x001b, 0x6418, 0x0010, 0xb10a,
+	0x0015, 0x0033, 0x0010, 0xc00a, 0x001b, 0x841a, 0x0002, 0x032b,
+	0x0010, 0xff03, 0x0011, 0x0d88, 0x0010, 0x0011, 0x0000, 0xff31,
+	0x0015, 0x0033, 0x0010, 0x030a, 0x000b, 0x8422, 0x0000, 0x11fe,
+	0x001b, 0x6427, 0x0000, 0x0d12, 0x0003, 0x0430, 0x0015, 0x0030,
+	0x0000, 0x0400, 0x0001, 0x1188, 0x0010, 0x0003, 0x0000, 0xff31,
+	0x0010, 0x0db0, 0x0015, 0x0033, 0x0000, 0xb00a, 0x001b, 0x842f,
+	0x0000, 0x0d11, 0x0013, 0x043b, 0x0000, 0x05fe, 0x0013, 0x643b,
+	0x0005, 0x0002, 0x0000, 0x0004, 0x0000, 0x050d, 0x0014, 0x043c,
+	0x0002, 0x3a47, 0x001b, 0x143b, 0x0014, 0x082e, 0x0003, 0x0049,
+	0x0001, 0xc7c8, 0x0010, 0x0028, 0x001b, 0x1454, 0x0015, 0x0030,
+	0x0000, 0x0400, 0x0011, 0x0d88, 0x0010, 0x000a, 0x0000, 0xff31,
+	0x0015, 0x0033, 0x0000, 0xb009, 0x001b, 0x8446, 0x0002, 0xb04f,
+	0x0003, 0x1454, 0x0001, 0x0fe8, 0x0010, 0x0000, 0x0003, 0x1452,
+	0x0001, 0x0fe8, 0x0000, 0x0002, 0x0003, 0x1452, 0x0015, 0x003a,
+	0x0010, 0x8080, 0x0013, 0x0454, 0x0015, 0x003a, 0x0010, 0x4040,
+	0x0017, 0x4000, 0x0015, 0x0030, 0x0000, 0x0400, 0x0011, 0x0d88,
+	0x0010, 0x0011, 0x0000, 0xff31, 0x0015, 0x0033, 0x0010, 0x0309,
+	0x000b, 0x845c, 0x0011, 0x0d88, 0x0010, 0x0005, 0x0000, 0xff31,
+	0x0015, 0x0033, 0x0000, 0xb909, 0x001b, 0x8462, 0x0017, 0x4000,
+	0x0005, 0x00b6, 0x0010, 0x0600, 0x0004, 0x062d, 0x0004, 0x04d6,
+	0x0000, 0xb05a, 0x0000, 0xb15b, 0x0005, 0x0054, 0x0010, 0x0829,
+	0x0010, 0x0d58, 0x0015, 0x0059, 0x0010, 0xffff, 0x0000, 0xb930,
+	0x0005, 0x0031, 0x0010, 0x001e, 0x0015, 0x0033, 0x0000, 0xb009,
+	0x000b, 0x8474, 0x0000, 0xb05c, 0x0005, 0x0031, 0x0000, 0x001f,
+	0x0015, 0x0033, 0x0000, 0xb009, 0x001b, 0x847a, 0x0001, 0xb0c8,
+	0x0010, 0x000f, 0x000b, 0x1481, 0x0015, 0x00ff, 0x0010, 0x0005,
+	0x0013, 0x0489, 0x0002, 0xb040, 0x0003, 0x1486, 0x0015, 0x00ff,
+	0x0000, 0x0004, 0x0013, 0x0489, 0x0001, 0xb0c8, 0x0010, 0x0006,
+	0x0002, 0xff60, 0x0010, 0xffb2, 0x0015, 0x0030, 0x0000, 0x0400,
+	0x0011, 0x0d88, 0x0000, 0x0019, 0x0000, 0xff31, 0x0015, 0x0033,
+	0x0010, 0xb109, 0x001b, 0x8491, 0x0012, 0xb170, 0x0011, 0xffc8,
+	0x0010, 0xff00, 0x0011, 0xb2d0, 0x0010, 0xff60, 0x0002, 0xb045,
+	0x0013, 0x149c, 0x0015, 0x00b2, 0x0000, 0x0002, 0x0003, 0x04a6,
+	0x0002, 0xb046, 0x0003, 0x14a1, 0x0015, 0x00b2, 0x0000, 0x0001,
+	0x0003, 0x04a6, 0x0015, 0x00b2, 0x0010, 0x0000, 0x0000, 0xc0b0,
+	0x0010, 0xc0b1, 0x0003, 0x04ac, 0x0000, 0xb930, 0x0005, 0x0031,
+	0x0010, 0x002b, 0x0015, 0x0033, 0x0000, 0xb011, 0x001b, 0x84ab,
+	0x0010, 0xb16a, 0x0010, 0xb06b, 0x0000, 0xb261, 0x0015, 0x0044,
+	0x0010, 0x0018, 0x0000, 0xb930, 0x0005, 0x0031, 0x0000, 0x0023,
+	0x0015, 0x0033, 0x0000, 0x6241, 0x001b, 0x84b6, 0x0003, 0x94b7,
+	0x0015, 0x00a0, 0x0000, 0x0020, 0x0012, 0xd041, 0x001b, 0x14ba,
+	0x0015, 0x00d1, 0x0010, 0x0202, 0x0003, 0x94be, 0x0000, 0x75ff,
+	0x0011, 0xffc8, 0x0000, 0x1804, 0x0001, 0xffd8, 0x0010, 0x0009,
+	0x0013, 0x94c4, 0x0000, 0xff75, 0x0003, 0x94c6, 0x0015, 0x00d1,
+	0x0000, 0x0200, 0x0015, 0x0030, 0x0000, 0x0400, 0x0001, 0xbd88,
+	0x0000, 0x0008, 0x0000, 0xff31, 0x0015, 0x00b1, 0x0010, 0x07d0,
+	0x0005, 0x00b0, 0x0010, 0x0009, 0x0015, 0x0033, 0x0000, 0xb012,
+	0x000b, 0x84d4, 0x0013, 0x043b, 0x0000, 0xba30, 0x0005, 0x0031,
+	0x0010, 0x0035, 0x0015, 0x0033, 0x0000, 0xb009, 0x000b, 0x84db,
+	0x0002, 0xb040, 0x0003, 0x14e9, 0x0000, 0xb7b0, 0x0000, 0xb9b1,
+	0x0015, 0x0030, 0x0000, 0x0400, 0x0011, 0x0d88, 0x0000, 0x0013,
+	0x0000, 0xff31, 0x0015, 0x0033, 0x0000, 0xb012, 0x000b, 0x84e7,
+	0x0003, 0x04eb, 0x0010, 0xc0b1, 0x0000, 0xc0b0, 0x0017, 0x4000,
+	0x0005, 0x00b6, 0x0010, 0x0500, 0x0004, 0x062d, 0x0005, 0x0054,
+	0x0010, 0x0889, 0x0015, 0x0030, 0x0000, 0x0400, 0x0011, 0x0d88,
+	0x0000, 0x0002, 0x0000, 0xff31, 0x0015, 0x0033, 0x0000, 0xb009,
+	0x001b, 0x84f8, 0x0010, 0xb058, 0x0000, 0x0d59, 0x0000, 0xb930,
+	0x0005, 0x0031, 0x0000, 0x0023, 0x0015, 0x0033, 0x0000, 0xb011,
+	0x001b, 0x8500, 0x0010, 0xb15c, 0x0010, 0xb05d, 0x0005, 0x0031,
+	0x0010, 0x002b, 0x0015, 0x0033, 0x0000, 0xb011, 0x000b, 0x8507,
+	0x0000, 0xb15e, 0x0000, 0xb05f, 0x0013, 0x950a, 0x0015, 0x00a0,
+	0x0010, 0x000c, 0x0013, 0x0612, 0x0005, 0x00b6, 0x0000, 0x0700,
+	0x0004, 0x062d, 0x0015, 0x0030, 0x0000, 0x0400, 0x0011, 0x0d88,
+	0x0010, 0x0009, 0x0000, 0xff31, 0x0015, 0x0033, 0x0010, 0xb709,
+	0x001b, 0x8518, 0x0012, 0xb749, 0x0003, 0x151e, 0x0005, 0x0054,
+	0x0010, 0x0889, 0x0003, 0x0520, 0x0005, 0x0054, 0x0010, 0x0898,
+	0x0015, 0x0030, 0x0000, 0x0400, 0x0011, 0x0d88, 0x0000, 0x0002,
+	0x0000, 0xff31, 0x0015, 0x0033, 0x0000, 0xb009, 0x001b, 0x8527,
+	0x0010, 0xb058, 0x0000, 0x0d59, 0x0001, 0xb9a8, 0x0010, 0x00f0,
+	0x001b, 0x254e, 0x0015, 0x0030, 0x0000, 0x0400, 0x0011, 0x0d88,
 	0x0010, 0x0005, 0x0000, 0xff31, 0x0015, 0x0033, 0x0000, 0xb009,
-	0x000b, 0x8510, 0x0001, 0xb0c8, 0x0000, 0xf700, 0x0000, 0xffb0,
-	0x0011, 0xb0e8, 0x0000, 0xf100, 0x0003, 0x1571, 0x0011, 0xb0e8,
-	0x0000, 0xf200, 0x0013, 0x1576, 0x0011, 0xb0e8, 0x0010, 0xf300,
-	0x0003, 0x1599, 0x0011, 0xb0e8, 0x0000, 0xf400, 0x0013, 0x159e,
-	0x0011, 0xb0e8, 0x0010, 0xf500, 0x0003, 0x1571, 0x0011, 0xb0e8,
-	0x0010, 0xf600, 0x0003, 0x15af, 0x0005, 0x00ce, 0x0010, 0x0009,
-	0x0000, 0xb0cf, 0x0013, 0x07fb, 0x0000, 0xb930, 0x0005, 0x0031,
-	0x0000, 0x0025, 0x0015, 0x0033, 0x0000, 0xb039, 0x000b, 0x852f,
-	0x0012, 0xb749, 0x0013, 0x1534, 0x0002, 0xb52c, 0x0000, 0xffb5,
+	0x000b, 0x8534, 0x0001, 0xb0c8, 0x0000, 0xf700, 0x0000, 0xffb0,
+	0x0011, 0xb0e8, 0x0000, 0xf100, 0x0003, 0x1595, 0x0011, 0xb0e8,
+	0x0000, 0xf200, 0x0003, 0x159a, 0x0011, 0xb0e8, 0x0010, 0xf300,
+	0x0013, 0x15bf, 0x0011, 0xb0e8, 0x0000, 0xf400, 0x0013, 0x15c4,
+	0x0011, 0xb0e8, 0x0010, 0xf500, 0x0003, 0x1595, 0x0011, 0xb0e8,
+	0x0010, 0xf600, 0x0013, 0x15d5, 0x0005, 0x00ce, 0x0010, 0x0009,
+	0x0000, 0xb0cf, 0x0013, 0x0823, 0x0000, 0xb930, 0x0005, 0x0031,
+	0x0000, 0x0025, 0x0015, 0x0033, 0x0000, 0xb039, 0x001b, 0x8553,
+	0x0012, 0xb749, 0x0013, 0x1558, 0x0002, 0xb52c, 0x0000, 0xffb5,
 	0x0000, 0xb162, 0x0000, 0xb063, 0x0005, 0x0031, 0x0000, 0x001f,
-	0x0015, 0x0033, 0x0000, 0xb309, 0x001b, 0x853a, 0x0001, 0xb3c8,
-	0x0010, 0x0003, 0x0003, 0x1542, 0x0010, 0xffb2, 0x0001, 0xffe8,
-	0x0010, 0x0003, 0x001b, 0x1544, 0x0000, 0xc2b7, 0x0003, 0x05cb,
-	0x0001, 0xb2e8, 0x0000, 0x0001, 0x0003, 0x154b, 0x0005, 0x00ce,
-	0x0010, 0x000a, 0x0010, 0xb2cf, 0x0013, 0x07fb, 0x0010, 0xb465,
+	0x0015, 0x0033, 0x0000, 0xb309, 0x000b, 0x855e, 0x0001, 0xb3c8,
+	0x0010, 0x0003, 0x0003, 0x1566, 0x0010, 0xffb2, 0x0001, 0xffe8,
+	0x0010, 0x0003, 0x000b, 0x1568, 0x0000, 0xc2b7, 0x0003, 0x05f1,
+	0x0001, 0xb2e8, 0x0000, 0x0001, 0x0003, 0x156f, 0x0005, 0x00ce,
+	0x0010, 0x000a, 0x0010, 0xb2cf, 0x0013, 0x0823, 0x0010, 0xb465,
 	0x0010, 0xb667, 0x0015, 0x00b7, 0x0010, 0x0018, 0x0001, 0xb5c8,
-	0x0010, 0x0300, 0x0013, 0x1570, 0x0012, 0xb548, 0x0013, 0x1557,
+	0x0010, 0x0300, 0x0013, 0x1594, 0x0012, 0xb548, 0x0003, 0x157b,
 	0x0000, 0xb6ff, 0x0011, 0xb780, 0x0010, 0xffb7, 0x0002, 0xb549,
-	0x0003, 0x155c, 0x0010, 0xb4ff, 0x0011, 0xb780, 0x0010, 0xffb7,
+	0x0013, 0x1580, 0x0010, 0xb4ff, 0x0011, 0xb780, 0x0010, 0xffb7,
 	0x0015, 0x0044, 0x0010, 0x0018, 0x0005, 0x0031, 0x0000, 0x002c,
-	0x0015, 0x0033, 0x0000, 0x6841, 0x000b, 0x8562, 0x0015, 0x0044,
+	0x0015, 0x0033, 0x0000, 0x6841, 0x000b, 0x8586, 0x0015, 0x0044,
 	0x0000, 0x0019, 0x0005, 0x0031, 0x0000, 0x0034, 0x0015, 0x0033,
-	0x0000, 0x5029, 0x001b, 0x8569, 0x0015, 0x0044, 0x0000, 0x0008,
-	0x0011, 0xb7c8, 0x0010, 0x0003, 0x0013, 0x1570, 0x0010, 0xff55,
-	0x0003, 0x05cb, 0x0005, 0x00b5, 0x0000, 0x0008, 0x0015, 0x00b7,
-	0x0010, 0x0018, 0x0003, 0x05cb, 0x0011, 0x0d88, 0x0000, 0x000b,
-	0x0000, 0xff31, 0x0015, 0x0033, 0x0000, 0xb011, 0x001b, 0x857b,
-	0x0010, 0xb1ff, 0x0001, 0xb0d0, 0x0003, 0x1584, 0x0005, 0x00b5,
-	0x0010, 0x0b02, 0x0010, 0xb062, 0x0010, 0xb163, 0x0003, 0x0586,
-	0x0005, 0x00b5, 0x0000, 0x0302, 0x0015, 0x0065, 0x0010, 0x0012,
-	0x0005, 0x0067, 0x0000, 0x0008, 0x0015, 0x006c, 0x0000, 0x7000,
-	0x0005, 0x006d, 0x0010, 0x0500, 0x0015, 0x006f, 0x0010, 0x000a,
-	0x0015, 0x0044, 0x0000, 0x0001, 0x0005, 0x0052, 0x0000, 0x2500,
-	0x0015, 0x0044, 0x0000, 0x0008, 0x0015, 0x00b7, 0x0000, 0x0032,
-	0x0003, 0x05cb, 0x0005, 0x00b5, 0x0010, 0x0028, 0x0015, 0x00b7,
-	0x0010, 0x0018, 0x0003, 0x05cb, 0x0005, 0x00b5, 0x0000, 0x0100,
-	0x0005, 0x0067, 0x0000, 0x0008, 0x0015, 0x0030, 0x0000, 0x0400,
-	0x0011, 0x0d88, 0x0010, 0x0018, 0x0000, 0xff31, 0x0015, 0x0033,
-	0x0000, 0xb009, 0x001b, 0x85a9, 0x0001, 0xb0c8, 0x0010, 0x00ff,
-	0x0015, 0x00b7, 0x0000, 0x0020, 0x0003, 0x05cb, 0x0015, 0x0030,
-	0x0000, 0x0400, 0x0011, 0x0d88, 0x0010, 0x0005, 0x0000, 0xff31,
-	0x0015, 0x0033, 0x0000, 0xb609, 0x000b, 0x85b6, 0x0001, 0xb6c8,
-	0x0010, 0xff00, 0x0000, 0xffb0, 0x0015, 0x0033, 0x0000, 0xb00a,
-	0x000b, 0x85bc, 0x0001, 0xb6c8, 0x0010, 0x00ff, 0x0012, 0xff10,
-	0x001b, 0x15c5, 0x0000, 0xffb5, 0x0015, 0x00b7, 0x0010, 0x0018,
-	0x0003, 0x05cb, 0x0010, 0xff63, 0x0005, 0x00b5, 0x0000, 0x0800,
-	0x0015, 0x00b7, 0x0010, 0x0018, 0x0003, 0x05cb, 0x0015, 0x0030,
-	0x0000, 0x0400, 0x0011, 0x0d88, 0x0010, 0x0009, 0x0000, 0xff31,
-	0x0015, 0x0033, 0x0000, 0xb009, 0x001b, 0x85d2, 0x0010, 0xb561,
-	0x0013, 0x95d4, 0x0010, 0xb7a0, 0x0003, 0x05ec, 0x0005, 0x00b6,
-	0x0010, 0x0300, 0x0014, 0x0607, 0x0005, 0x0054, 0x0010, 0x0819,
-	0x0010, 0x0d58, 0x0015, 0x0030, 0x0000, 0x0400, 0x0011, 0x0d88,
-	0x0000, 0x0002, 0x0000, 0xff31, 0x0015, 0x0033, 0x0000, 0xb009,
-	0x001b, 0x85e4, 0x0000, 0xb059, 0x0003, 0x95e6, 0x0010, 0xc0a0,
-	0x0010, 0x71ff, 0x0002, 0xff28, 0x0010, 0xff71, 0x0003, 0x05ec,
-	0x0012, 0xd041, 0x000b, 0x15ec, 0x0015, 0x00d1, 0x0010, 0x0202,
-	0x0000, 0x75ff, 0x0011, 0xffc8, 0x0000, 0x1804, 0x0001, 0xffd8,
-	0x0010, 0x0009, 0x0013, 0x95f5, 0x0000, 0xff75, 0x0003, 0x95f7,
-	0x0015, 0x00d1, 0x0000, 0x0200, 0x0015, 0x0030, 0x0000, 0x0400,
-	0x0001, 0xbd88, 0x0000, 0x0008, 0x0000, 0xff31, 0x0005, 0x00b0,
-	0x0010, 0x0009, 0x0015, 0x00b1, 0x0010, 0x07d0, 0x0015, 0x0033,
-	0x0000, 0xb012, 0x001b, 0x8605, 0x0013, 0x041c, 0x0015, 0x0044,
-	0x0000, 0x0008, 0x0005, 0x0098, 0x0010, 0x0056, 0x0015, 0x0099,
-	0x0000, 0x9575, 0x0004, 0x07c2, 0x0000, 0xb096, 0x0012, 0xb270,
-	0x0010, 0xff56, 0x0014, 0x07e4, 0x0010, 0xb052, 0x0010, 0xb153,
-	0x0000, 0xb6ff, 0x0011, 0xb2d0, 0x0010, 0xff50, 0x0010, 0xb351,
-	0x0017, 0x4000, 0x0015, 0x0030, 0x0000, 0x0400, 0x0001, 0x1288,
-	0x0010, 0x0011, 0x0000, 0xff31, 0x0015, 0x0033, 0x0000, 0x1009,
-	0x000b, 0x8620, 0x0015, 0x000f, 0x0000, 0x0001, 0x0010, 0xc014,
-	0x0000, 0x1213, 0x0015, 0x0030, 0x0000, 0x0400, 0x0011, 0x1388,
-	0x0000, 0x0004, 0x0000, 0xff31, 0x0015, 0x0033, 0x0000, 0xba09,
-	0x000b, 0x862c, 0x0015, 0x0030, 0x0000, 0x0400, 0x0011, 0x1388,
-	0x0010, 0x0005, 0x0000, 0xff31, 0x0015, 0x0033, 0x0000, 0x1a09,
-	0x000b, 0x8634, 0x0012, 0x104b, 0x000b, 0x163d, 0x0000, 0x1a30,
-	0x0005, 0x0031, 0x0000, 0x000b, 0x0015, 0x0033, 0x0000, 0x1621,
-	0x001b, 0x863c, 0x0010, 0x15fe, 0x000b, 0x665c, 0x0014, 0x0683,
-	0x0002, 0x3a42, 0x001b, 0x1682, 0x0001, 0x10c8, 0x0010, 0x000f,
-	0x000b, 0x16e5, 0x0015, 0x0030, 0x0000, 0x0400, 0x0011, 0x1388,
-	0x0000, 0x0008, 0x0000, 0xff31, 0x0015, 0x0033, 0x0000, 0xb009,
-	0x000b, 0x864c, 0x0011, 0xb0e8, 0x0010, 0x0009, 0x0003, 0x1653,
-	0x0011, 0xb0e8, 0x0000, 0x0001, 0x001b, 0x1681, 0x0011, 0x1388,
-	0x0010, 0x000a, 0x0000, 0xff31, 0x0015, 0x0033, 0x0000, 0xb009,
-	0x000b, 0x8658, 0x0002, 0xb04f, 0x001b, 0x1678, 0x0013, 0x0681,
-	0x0015, 0x0030, 0x0000, 0x0400, 0x0011, 0x1388, 0x0010, 0x0003,
-	0x0000, 0xff31, 0x0015, 0x0033, 0x0000, 0xb009, 0x001b, 0x8663,
-	0x0015, 0x0033, 0x0010, 0xc00a, 0x001b, 0x8666, 0x0010, 0xb0fe,
-	0x0003, 0x666b, 0x0000, 0xb012, 0x0003, 0x066d, 0x0010, 0xc012,
-	0x0010, 0xc011, 0x0015, 0x000f, 0x0010, 0x0000, 0x0002, 0x3944,
-	0x0013, 0x1676, 0x0015, 0x0039, 0x0000, 0x5040, 0x0015, 0x00b8,
-	0x0000, 0x0008, 0x0004, 0x083d, 0x0000, 0xc013, 0x0013, 0x0682,
-	0x0010, 0x02fe, 0x0013, 0x667d, 0x0015, 0x003a, 0x0010, 0x2020,
-	0x0013, 0x0682, 0x0015, 0x003a, 0x0000, 0x2000, 0x0015, 0x003a,
-	0x0010, 0x1010, 0x0004, 0x0829, 0x0013, 0x0055, 0x0013, 0xb683,
-	0x0005, 0x002a, 0x0000, 0x0004, 0x0000, 0xba30, 0x0005, 0x0031,
-	0x0010, 0x001b, 0x0015, 0x0033, 0x0000, 0xb009, 0x001b, 0x868b,
-	0x0000, 0xc02c, 0x0000, 0xb02d, 0x0012, 0x104b, 0x0003, 0x16a6,
-	0x0000, 0x1a30, 0x0005, 0x0031, 0x0000, 0x0023, 0x0015, 0x0033,
-	0x0000, 0xb129, 0x001b, 0x8695, 0x0000, 0xb120, 0x0010, 0xb221,
-	0x0000, 0xb322, 0x0000, 0xb423, 0x0000, 0xb524, 0x0000, 0xc025,
-	0x0010, 0xb526, 0x0010, 0xc027, 0x0010, 0xb516, 0x0010, 0xc017,
-	0x0000, 0xb518, 0x0000, 0xc019, 0x0010, 0xc028, 0x0000, 0xc029,
-	0x0010, 0xc01e, 0x0003, 0x06dc, 0x0012, 0x1044, 0x0013, 0x16d6,
-	0x0002, 0x1034, 0x0000, 0xff10, 0x0000, 0x1a30, 0x0005, 0x0031,
-	0x0000, 0x0002, 0x0015, 0x0033, 0x0000, 0x1b29, 0x001b, 0x86af,
-	0x0000, 0x1c30, 0x0000, 0x1b31, 0x0015, 0x0033, 0x0000, 0xb131,
-	0x001b, 0x86b4, 0x0002, 0x1f43, 0x001b, 0x16bb, 0x0010, 0xb3b5,
-	0x0000, 0xb4b6, 0x0000, 0xc0b3, 0x0010, 0xc0b4, 0x0000, 0xb120,
-	0x0010, 0xb221, 0x0000, 0xb322, 0x0000, 0xb423, 0x0000, 0xb524,
-	0x0010, 0xb625, 0x0010, 0xb516, 0x0000, 0xb617, 0x0000, 0x1826,
-	0x0000, 0x1927, 0x0000, 0x1a30, 0x0005, 0x0031, 0x0010, 0x000f,
-	0x0015, 0x0033, 0x0000, 0xb011, 0x001b, 0x86ca, 0x0000, 0xb028,
-	0x0000, 0xb129, 0x0012, 0x1e10, 0x0010, 0xff1e, 0x0003, 0x66dc,
-	0x0002, 0x1d00, 0x0010, 0xff1d, 0x0004, 0x028a, 0x0002, 0x3a42,
-	0x0013, 0x16dc, 0x0013, 0x06e4, 0x0000, 0x1a30, 0x0005, 0x0031,
-	0x0000, 0x0002, 0x0015, 0x0033, 0x0000, 0x1b79, 0x001b, 0x86db,
-	0x0013, 0xb6dc, 0x0005, 0x002a, 0x0000, 0x0001, 0x0005, 0x0015,
-	0x0000, 0x0001, 0x0000, 0x1efe, 0x0013, 0x66e4, 0x0003, 0x0256,
-	0x0017, 0x4000, 0x0000, 0xba30, 0x0005, 0x0031, 0x0010, 0x001b,
-	0x0015, 0x0033, 0x0010, 0xb051, 0x000b, 0x86ea, 0x0000, 0xb0a3,
-	0x0010, 0xb697, 0x0010, 0xb946, 0x0015, 0x00a5, 0x0000, 0x0010,
-	0x0015, 0x0030, 0x0000, 0x0400, 0x0011, 0x1388, 0x0000, 0x0002,
-	0x0000, 0xff31, 0x0015, 0x0033, 0x0000, 0xb509, 0x000b, 0x86f7,
-	0x0014, 0x07e4, 0x0004, 0x07d3, 0x0012, 0xb470, 0x0010, 0xffb4,
-	0x0010, 0xb48e, 0x0010, 0xb08a, 0x0010, 0xb18b, 0x0012, 0x104d,
-	0x0003, 0x1702, 0x0013, 0x072f, 0x0012, 0x104b, 0x0003, 0x1715,
-	0x0005, 0x008c, 0x0010, 0x0829, 0x0010, 0xc08d, 0x0001, 0xb2d8,
-	0x0010, 0x0600, 0x0010, 0xff88, 0x0010, 0xb389, 0x0000, 0x1390,
-	0x0010, 0xb591, 0x0000, 0xc08f, 0x0010, 0x1ab9, 0x0014, 0x04b4,
-	0x0013, 0x9710, 0x0010, 0xb092, 0x0010, 0xb193, 0x0013, 0x9713,
-	0x0013, 0x072a, 0x0005, 0x008c, 0x0000, 0x0809, 0x0015, 0x008d,
-	0x0000, 0x0008, 0x0001, 0xb2d8, 0x0000, 0x0100, 0x0010, 0xff88,
+	0x0000, 0x5029, 0x001b, 0x858d, 0x0015, 0x0044, 0x0000, 0x0008,
+	0x0011, 0xb7c8, 0x0010, 0x0003, 0x0013, 0x1594, 0x0010, 0xff55,
+	0x0003, 0x05f1, 0x0005, 0x00b5, 0x0000, 0x0008, 0x0015, 0x00b7,
+	0x0010, 0x0018, 0x0003, 0x05f1, 0x0015, 0x0030, 0x0000, 0x0400,
+	0x0011, 0x0d88, 0x0000, 0x000b, 0x0000, 0xff31, 0x0015, 0x0033,
+	0x0000, 0xb011, 0x000b, 0x85a1, 0x0010, 0xb1ff, 0x0001, 0xb0d0,
+	0x0003, 0x15aa, 0x0005, 0x00b5, 0x0010, 0x0b02, 0x0010, 0xb062,
+	0x0010, 0xb163, 0x0013, 0x05ac, 0x0005, 0x00b5, 0x0000, 0x0302,
+	0x0015, 0x0065, 0x0010, 0x0012, 0x0005, 0x0067, 0x0000, 0x0008,
+	0x0015, 0x006c, 0x0000, 0x7000, 0x0005, 0x006d, 0x0010, 0x0500,
+	0x0015, 0x006f, 0x0010, 0x000a, 0x0015, 0x0044, 0x0000, 0x0001,
+	0x0005, 0x0052, 0x0000, 0x2500, 0x0015, 0x0044, 0x0000, 0x0008,
+	0x0015, 0x00b7, 0x0000, 0x0032, 0x0003, 0x05f1, 0x0005, 0x00b5,
+	0x0010, 0x0028, 0x0015, 0x00b7, 0x0010, 0x0018, 0x0003, 0x05f1,
+	0x0005, 0x00b5, 0x0000, 0x0100, 0x0005, 0x0067, 0x0000, 0x0008,
+	0x0015, 0x0030, 0x0000, 0x0400, 0x0011, 0x0d88, 0x0010, 0x0018,
+	0x0000, 0xff31, 0x0015, 0x0033, 0x0000, 0xb009, 0x001b, 0x85cf,
+	0x0001, 0xb0c8, 0x0010, 0x00ff, 0x0015, 0x00b7, 0x0000, 0x0020,
+	0x0003, 0x05f1, 0x0015, 0x0030, 0x0000, 0x0400, 0x0011, 0x0d88,
+	0x0010, 0x0005, 0x0000, 0xff31, 0x0015, 0x0033, 0x0000, 0xb609,
+	0x000b, 0x85dc, 0x0001, 0xb6c8, 0x0010, 0xff00, 0x0000, 0xffb0,
+	0x0015, 0x0033, 0x0000, 0xb00a, 0x001b, 0x85e2, 0x0001, 0xb6c8,
+	0x0010, 0x00ff, 0x0012, 0xff10, 0x001b, 0x15eb, 0x0000, 0xffb5,
+	0x0015, 0x00b7, 0x0010, 0x0018, 0x0003, 0x05f1, 0x0010, 0xff63,
+	0x0005, 0x00b5, 0x0000, 0x0800, 0x0015, 0x00b7, 0x0010, 0x0018,
+	0x0003, 0x05f1, 0x0015, 0x0030, 0x0000, 0x0400, 0x0011, 0x0d88,
+	0x0010, 0x0009, 0x0000, 0xff31, 0x0015, 0x0033, 0x0000, 0xb009,
+	0x000b, 0x85f8, 0x0010, 0xb561, 0x0013, 0x95fa, 0x0010, 0xb7a0,
+	0x0013, 0x0612, 0x0005, 0x00b6, 0x0010, 0x0300, 0x0004, 0x062d,
+	0x0005, 0x0054, 0x0010, 0x0819, 0x0010, 0x0d58, 0x0015, 0x0030,
+	0x0000, 0x0400, 0x0011, 0x0d88, 0x0000, 0x0002, 0x0000, 0xff31,
+	0x0015, 0x0033, 0x0000, 0xb009, 0x001b, 0x860a, 0x0000, 0xb059,
+	0x0013, 0x960c, 0x0010, 0xc0a0, 0x0010, 0x71ff, 0x0002, 0xff28,
+	0x0010, 0xff71, 0x0013, 0x0612, 0x0012, 0xd041, 0x001b, 0x1612,
+	0x0015, 0x00d1, 0x0010, 0x0202, 0x0000, 0x75ff, 0x0011, 0xffc8,
+	0x0000, 0x1804, 0x0001, 0xffd8, 0x0010, 0x0009, 0x0013, 0x961b,
+	0x0000, 0xff75, 0x0013, 0x961d, 0x0015, 0x00d1, 0x0000, 0x0200,
+	0x0015, 0x0030, 0x0000, 0x0400, 0x0001, 0xbd88, 0x0000, 0x0008,
+	0x0000, 0xff31, 0x0005, 0x00b0, 0x0010, 0x0009, 0x0015, 0x00b1,
+	0x0010, 0x07d0, 0x0015, 0x0033, 0x0000, 0xb012, 0x001b, 0x862b,
+	0x0013, 0x043b, 0x0015, 0x0044, 0x0000, 0x0008, 0x0005, 0x0098,
+	0x0010, 0x0056, 0x0015, 0x0099, 0x0000, 0x9575, 0x0004, 0x07ea,
+	0x0000, 0xb096, 0x0012, 0xb270, 0x0010, 0xff56, 0x0014, 0x080c,
+	0x0010, 0xb052, 0x0010, 0xb153, 0x0000, 0xb6ff, 0x0011, 0xb2d0,
+	0x0010, 0xff50, 0x0010, 0xb351, 0x0017, 0x4000, 0x0015, 0x0030,
+	0x0000, 0x0400, 0x0001, 0x1288, 0x0010, 0x0011, 0x0000, 0xff31,
+	0x0015, 0x0033, 0x0000, 0x1009, 0x000b, 0x8646, 0x0015, 0x000f,
+	0x0000, 0x0001, 0x0010, 0xc014, 0x0000, 0x1213, 0x0015, 0x0030,
+	0x0000, 0x0400, 0x0011, 0x1388, 0x0000, 0x0004, 0x0000, 0xff31,
+	0x0015, 0x0033, 0x0000, 0xba09, 0x000b, 0x8652, 0x0015, 0x0030,
+	0x0000, 0x0400, 0x0011, 0x1388, 0x0010, 0x0005, 0x0000, 0xff31,
+	0x0015, 0x0033, 0x0000, 0x1a09, 0x001b, 0x865a, 0x0012, 0x104b,
+	0x001b, 0x1663, 0x0000, 0x1a30, 0x0005, 0x0031, 0x0000, 0x000b,
+	0x0015, 0x0033, 0x0000, 0x1621, 0x000b, 0x8662, 0x0010, 0x15fe,
+	0x000b, 0x6682, 0x0004, 0x06a9, 0x0002, 0x3a42, 0x000b, 0x16a8,
+	0x0001, 0x10c8, 0x0010, 0x000f, 0x001b, 0x170b, 0x0015, 0x0030,
+	0x0000, 0x0400, 0x0011, 0x1388, 0x0000, 0x0008, 0x0000, 0xff31,
+	0x0015, 0x0033, 0x0000, 0xb009, 0x001b, 0x8672, 0x0011, 0xb0e8,
+	0x0010, 0x0009, 0x0013, 0x1679, 0x0011, 0xb0e8, 0x0000, 0x0001,
+	0x000b, 0x16a7, 0x0011, 0x1388, 0x0010, 0x000a, 0x0000, 0xff31,
+	0x0015, 0x0033, 0x0000, 0xb009, 0x001b, 0x867e, 0x0002, 0xb04f,
+	0x000b, 0x169e, 0x0003, 0x06a7, 0x0015, 0x0030, 0x0000, 0x0400,
+	0x0011, 0x1388, 0x0010, 0x0003, 0x0000, 0xff31, 0x0015, 0x0033,
+	0x0000, 0xb009, 0x000b, 0x8689, 0x0015, 0x0033, 0x0010, 0xc00a,
+	0x000b, 0x868c, 0x0010, 0xb0fe, 0x0003, 0x6691, 0x0000, 0xb012,
+	0x0013, 0x0693, 0x0010, 0xc012, 0x0010, 0xc011, 0x0015, 0x000f,
+	0x0010, 0x0000, 0x0002, 0x3944, 0x0003, 0x169c, 0x0015, 0x0039,
+	0x0000, 0x5040, 0x0015, 0x00b8, 0x0000, 0x0008, 0x0004, 0x0867,
+	0x0000, 0xc013, 0x0003, 0x06a8, 0x0010, 0x02fe, 0x0013, 0x66a3,
+	0x0015, 0x003a, 0x0010, 0x2020, 0x0003, 0x06a8, 0x0015, 0x003a,
+	0x0000, 0x2000, 0x0015, 0x003a, 0x0010, 0x1010, 0x0014, 0x0853,
+	0x0013, 0x0055, 0x0003, 0xb6a9, 0x0005, 0x002a, 0x0000, 0x0004,
+	0x0000, 0xba30, 0x0005, 0x0031, 0x0010, 0x001b, 0x0015, 0x0033,
+	0x0000, 0xb009, 0x001b, 0x86b1, 0x0000, 0xc02c, 0x0000, 0xb02d,
+	0x0012, 0x104b, 0x0003, 0x16cc, 0x0000, 0x1a30, 0x0005, 0x0031,
+	0x0000, 0x0023, 0x0015, 0x0033, 0x0000, 0xb129, 0x001b, 0x86bb,
+	0x0000, 0xb120, 0x0010, 0xb221, 0x0000, 0xb322, 0x0000, 0xb423,
+	0x0000, 0xb524, 0x0000, 0xc025, 0x0010, 0xb526, 0x0010, 0xc027,
+	0x0010, 0xb516, 0x0010, 0xc017, 0x0000, 0xb518, 0x0000, 0xc019,
+	0x0010, 0xc028, 0x0000, 0xc029, 0x0010, 0xc01e, 0x0013, 0x0702,
+	0x0012, 0x1044, 0x0003, 0x16fc, 0x0002, 0x1034, 0x0000, 0xff10,
+	0x0000, 0x1a30, 0x0005, 0x0031, 0x0000, 0x0002, 0x0015, 0x0033,
+	0x0000, 0x1b29, 0x000b, 0x86d5, 0x0000, 0x1c30, 0x0000, 0x1b31,
+	0x0015, 0x0033, 0x0000, 0xb131, 0x000b, 0x86da, 0x0002, 0x1f43,
+	0x001b, 0x16e1, 0x0010, 0xb3b5, 0x0000, 0xb4b6, 0x0000, 0xc0b3,
+	0x0010, 0xc0b4, 0x0000, 0xb120, 0x0010, 0xb221, 0x0000, 0xb322,
+	0x0000, 0xb423, 0x0000, 0xb524, 0x0010, 0xb625, 0x0010, 0xb516,
+	0x0000, 0xb617, 0x0000, 0x1826, 0x0000, 0x1927, 0x0000, 0x1a30,
+	0x0005, 0x0031, 0x0010, 0x000f, 0x0015, 0x0033, 0x0000, 0xb011,
+	0x001b, 0x86f0, 0x0000, 0xb028, 0x0000, 0xb129, 0x0012, 0x1e10,
+	0x0010, 0xff1e, 0x0013, 0x6702, 0x0002, 0x1d00, 0x0010, 0xff1d,
+	0x0014, 0x02a5, 0x0002, 0x3a42, 0x0003, 0x1702, 0x0003, 0x070a,
+	0x0000, 0x1a30, 0x0005, 0x0031, 0x0000, 0x0002, 0x0015, 0x0033,
+	0x0000, 0x1b79, 0x001b, 0x8701, 0x0003, 0xb702, 0x0005, 0x002a,
+	0x0000, 0x0001, 0x0005, 0x0015, 0x0000, 0x0001, 0x0000, 0x1efe,
+	0x0003, 0x670a, 0x0003, 0x0271, 0x0017, 0x4000, 0x0000, 0xba30,
+	0x0005, 0x0031, 0x0010, 0x001b, 0x0015, 0x0033, 0x0010, 0xb051,
+	0x001b, 0x8710, 0x0000, 0xb0a3, 0x0010, 0xb697, 0x0010, 0xb946,
+	0x0015, 0x00a5, 0x0000, 0x0010, 0x0015, 0x0030, 0x0000, 0x0400,
+	0x0011, 0x1388, 0x0000, 0x0002, 0x0000, 0xff31, 0x0015, 0x0033,
+	0x0000, 0xb509, 0x000b, 0x871d, 0x0014, 0x080c, 0x0004, 0x07fb,
+	0x0012, 0xb470, 0x0010, 0xffb4, 0x0010, 0xb48e, 0x0010, 0xb08a,
+	0x0010, 0xb18b, 0x0012, 0x104d, 0x0013, 0x1728, 0x0003, 0x0755,
+	0x0012, 0x104b, 0x0003, 0x173b, 0x0005, 0x008c, 0x0010, 0x0829,
+	0x0010, 0xc08d, 0x0001, 0xb2d8, 0x0010, 0x0600, 0x0010, 0xff88,
 	0x0010, 0xb389, 0x0000, 0x1390, 0x0010, 0xb591, 0x0000, 0xc08f,
-	0x0000, 0x1a30, 0x0005, 0x0031, 0x0010, 0x000f, 0x0015, 0x0033,
-	0x0000, 0xb011, 0x001b, 0x8725, 0x0013, 0x9726, 0x0000, 0xb192,
-	0x0000, 0xb093, 0x0013, 0x9729, 0x0010, 0x19a1, 0x0000, 0x18a2,
-	0x0015, 0x00b1, 0x0010, 0x0096, 0x0013, 0x079e, 0x0000, 0xb590,
-	0x0010, 0x1391, 0x0001, 0x10c8, 0x0010, 0x000f, 0x0001, 0xffe8,
-	0x0010, 0x0005, 0x0013, 0x1756, 0x0001, 0xb2d8, 0x0000, 0x0700,
-	0x0010, 0xff88, 0x0010, 0xb389, 0x0015, 0x0030, 0x0000, 0x0400,
-	0x0011, 0x1388, 0x0010, 0x0009, 0x0000, 0xff31, 0x0015, 0x0033,
-	0x0000, 0xb009, 0x000b, 0x8741, 0x0002, 0xb049, 0x0003, 0x1749,
-	0x0005, 0x008c, 0x0010, 0x0889, 0x0015, 0x00b1, 0x0010, 0x0096,
-	0x0003, 0x074d, 0x0005, 0x008c, 0x0010, 0x0898, 0x0015, 0x00b1,
-	0x0000, 0x0092, 0x0010, 0xc08d, 0x0000, 0xc08f, 0x0013, 0x974f,
-	0x0000, 0xc092, 0x0010, 0xc093, 0x0013, 0x9752, 0x0010, 0x19a1,
-	0x0000, 0x18a2, 0x0013, 0x079e, 0x0001, 0xb2d8, 0x0000, 0x0100,
-	0x0010, 0xff88, 0x0010, 0xb389, 0x0005, 0x008c, 0x0010, 0x0880,
-	0x0015, 0x008d, 0x0000, 0x0008, 0x0011, 0x1388, 0x0000, 0x000e,
-	0x0000, 0xff31, 0x0015, 0x0033, 0x0000, 0xb009, 0x000b, 0x8763,
+	0x0010, 0x1ab9, 0x0004, 0x04d6, 0x0003, 0x9736, 0x0010, 0xb092,
+	0x0010, 0xb193, 0x0003, 0x9739, 0x0003, 0x0750, 0x0005, 0x008c,
+	0x0000, 0x0809, 0x0015, 0x008d, 0x0000, 0x0008, 0x0001, 0xb2d8,
+	0x0000, 0x0100, 0x0010, 0xff88, 0x0010, 0xb389, 0x0000, 0x1390,
+	0x0010, 0xb591, 0x0000, 0xc08f, 0x0000, 0x1a30, 0x0005, 0x0031,
+	0x0010, 0x000f, 0x0015, 0x0033, 0x0000, 0xb011, 0x000b, 0x874b,
+	0x0013, 0x974c, 0x0000, 0xb192, 0x0000, 0xb093, 0x0013, 0x974f,
+	0x0010, 0x19a1, 0x0000, 0x18a2, 0x0015, 0x00b1, 0x0010, 0x0096,
+	0x0003, 0x07c6, 0x0000, 0xb590, 0x0010, 0x1391, 0x0001, 0x10c8,
+	0x0010, 0x000f, 0x0001, 0xffe8, 0x0010, 0x0005, 0x0003, 0x177c,
+	0x0001, 0xb2d8, 0x0000, 0x0700, 0x0010, 0xff88, 0x0010, 0xb389,
+	0x0015, 0x0030, 0x0000, 0x0400, 0x0011, 0x1388, 0x0010, 0x0009,
+	0x0000, 0xff31, 0x0015, 0x0033, 0x0000, 0xb009, 0x001b, 0x8767,
+	0x0002, 0xb049, 0x0013, 0x176f, 0x0005, 0x008c, 0x0010, 0x0889,
+	0x0015, 0x00b1, 0x0010, 0x0096, 0x0013, 0x0773, 0x0005, 0x008c,
+	0x0010, 0x0898, 0x0015, 0x00b1, 0x0000, 0x0092, 0x0010, 0xc08d,
+	0x0000, 0xc08f, 0x0013, 0x9775, 0x0000, 0xc092, 0x0010, 0xc093,
+	0x0003, 0x9778, 0x0010, 0x19a1, 0x0000, 0x18a2, 0x0003, 0x07c6,
+	0x0001, 0xb2d8, 0x0000, 0x0100, 0x0010, 0xff88, 0x0010, 0xb389,
+	0x0005, 0x008c, 0x0010, 0x0880, 0x0015, 0x008d, 0x0000, 0x0008,
+	0x0015, 0x0030, 0x0000, 0x0400, 0x0011, 0x1388, 0x0000, 0x000e,
+	0x0000, 0xff31, 0x0015, 0x0033, 0x0000, 0xb009, 0x000b, 0x878b,
 	0x0010, 0xb08f, 0x0000, 0xb590, 0x0010, 0x1391, 0x0000, 0x1a30,
 	0x0005, 0x0031, 0x0000, 0x000d, 0x0015, 0x0033, 0x0000, 0xb021,
-	0x000b, 0x876c, 0x0013, 0x976d, 0x0010, 0xb392, 0x0010, 0xb293,
-	0x0013, 0x9770, 0x0000, 0xb1a1, 0x0010, 0xb0a2, 0x0015, 0x0030,
+	0x001b, 0x8794, 0x0003, 0x9795, 0x0010, 0xb392, 0x0010, 0xb293,
+	0x0013, 0x9798, 0x0000, 0xb1a1, 0x0010, 0xb0a2, 0x0015, 0x0030,
 	0x0000, 0x0400, 0x0011, 0x1388, 0x0000, 0x000b, 0x0000, 0xff31,
-	0x0015, 0x0033, 0x0010, 0xb211, 0x001b, 0x877a, 0x0000, 0xb3ff,
-	0x0001, 0xb080, 0x0000, 0xffb3, 0x000b, 0x2781, 0x0002, 0xb200,
-	0x0003, 0x0782, 0x0010, 0xb2ff, 0x0011, 0xb180, 0x0010, 0xffb2,
+	0x0015, 0x0033, 0x0010, 0xb211, 0x001b, 0x87a2, 0x0000, 0xb3ff,
+	0x0001, 0xb080, 0x0000, 0xffb3, 0x000b, 0x27a9, 0x0002, 0xb200,
+	0x0003, 0x07aa, 0x0010, 0xb2ff, 0x0011, 0xb180, 0x0010, 0xffb2,
 	0x0011, 0x1388, 0x0000, 0x000b, 0x0000, 0xff31, 0x0015, 0x0033,
-	0x0010, 0xb212, 0x001b, 0x8789, 0x0015, 0x00b1, 0x0000, 0x0092,
-	0x0002, 0x104c, 0x0013, 0x179c, 0x0011, 0xc2e8, 0x0010, 0x000c,
-	0x001b, 0x1794, 0x0015, 0x00ff, 0x0000, 0x0800, 0x0003, 0x079c,
-	0x0011, 0xc2e8, 0x0000, 0x0020, 0x000b, 0x179a, 0x0015, 0x00ff,
-	0x0010, 0x1800, 0x0003, 0x079c, 0x0015, 0x00ff, 0x0000, 0x1000,
+	0x0010, 0xb212, 0x000b, 0x87b1, 0x0015, 0x00b1, 0x0000, 0x0092,
+	0x0002, 0x104c, 0x0003, 0x17c4, 0x0011, 0xc2e8, 0x0010, 0x000c,
+	0x001b, 0x17bc, 0x0015, 0x00ff, 0x0000, 0x0800, 0x0013, 0x07c4,
+	0x0011, 0xc2e8, 0x0000, 0x0020, 0x001b, 0x17c2, 0x0015, 0x00ff,
+	0x0010, 0x1800, 0x0013, 0x07c4, 0x0015, 0x00ff, 0x0000, 0x1000,
 	0x0011, 0xb1d0, 0x0010, 0xffb1, 0x0015, 0x009a, 0x0010, 0x0036,
-	0x0005, 0x009b, 0x0000, 0x95d5, 0x0012, 0xd041, 0x001b, 0x17a2,
-	0x0015, 0x00d1, 0x0010, 0x0202, 0x0003, 0x97a6, 0x0012, 0x104e,
-	0x0003, 0x17ab, 0x0012, 0xb12f, 0x0010, 0xffb1, 0x0000, 0xb175,
-	0x0003, 0x97ac, 0x0015, 0x00d1, 0x0000, 0x0200, 0x0001, 0x19c8,
-	0x0010, 0xfff0, 0x001b, 0x17b5, 0x0015, 0x00b1, 0x0010, 0x07d0,
-	0x0003, 0x07b7, 0x0015, 0x00b1, 0x0000, 0x1b58, 0x0005, 0x00b0,
+	0x0005, 0x009b, 0x0000, 0x95d5, 0x0012, 0xd041, 0x000b, 0x17ca,
+	0x0015, 0x00d1, 0x0010, 0x0202, 0x0013, 0x97ce, 0x0012, 0x104e,
+	0x0003, 0x17d3, 0x0012, 0xb12f, 0x0010, 0xffb1, 0x0000, 0xb175,
+	0x0003, 0x97d4, 0x0015, 0x00d1, 0x0000, 0x0200, 0x0001, 0x19c8,
+	0x0010, 0xfff0, 0x000b, 0x17dd, 0x0015, 0x00b1, 0x0010, 0x07d0,
+	0x0013, 0x07df, 0x0015, 0x00b1, 0x0000, 0x1b58, 0x0005, 0x00b0,
 	0x0010, 0x0009, 0x0015, 0x0030, 0x0000, 0x0400, 0x0001, 0xbd88,
 	0x0000, 0x000b, 0x0000, 0xff31, 0x0015, 0x0033, 0x0000, 0xb012,
-	0x000b, 0x87c0, 0x0013, 0x0682, 0x0000, 0xba30, 0x0005, 0x0031,
-	0x0010, 0x0021, 0x0015, 0x0033, 0x0010, 0xb019, 0x001b, 0x87c7,
+	0x000b, 0x87e8, 0x0003, 0x06a8, 0x0000, 0xba30, 0x0005, 0x0031,
+	0x0010, 0x0021, 0x0015, 0x0033, 0x0010, 0xb019, 0x001b, 0x87ef,
 	0x0002, 0xb200, 0x0011, 0xffc8, 0x0010, 0x00ff, 0x0010, 0xffb2,
 	0x0010, 0xb2b7, 0x0005, 0x0031, 0x0000, 0x0023, 0x0015, 0x0033,
-	0x0010, 0xb20a, 0x000b, 0x87d1, 0x0017, 0x4000, 0x0000, 0xba30,
+	0x0010, 0xb20a, 0x000b, 0x87f9, 0x0017, 0x4000, 0x0000, 0xba30,
 	0x0005, 0x0031, 0x0000, 0x0023, 0x0015, 0x0033, 0x0010, 0xb409,
-	0x000b, 0x87d8, 0x0002, 0xb400, 0x0011, 0xffc8, 0x0010, 0x00ff,
+	0x000b, 0x8800, 0x0002, 0xb400, 0x0011, 0xffc8, 0x0010, 0x00ff,
 	0x0010, 0xffb4, 0x0010, 0xb4b7, 0x0005, 0x0031, 0x0000, 0x0023,
-	0x0015, 0x0033, 0x0010, 0xb40a, 0x000b, 0x87e2, 0x0017, 0x4000,
-	0x0000, 0xba30, 0x0001, 0xc7c8, 0x0000, 0x0020, 0x000b, 0x17f0,
+	0x0015, 0x0033, 0x0010, 0xb40a, 0x000b, 0x880a, 0x0017, 0x4000,
+	0x0000, 0xba30, 0x0001, 0xc7c8, 0x0000, 0x0020, 0x000b, 0x1818,
 	0x0005, 0x0031, 0x0010, 0x0028, 0x0015, 0x0033, 0x0010, 0xb209,
-	0x001b, 0x87ec, 0x0011, 0xb2c8, 0x0000, 0xff80, 0x0013, 0x17f3,
-	0x0010, 0xc4b0, 0x0010, 0xc5b1, 0x0003, 0x07f5, 0x0010, 0xc6b1,
+	0x000b, 0x8814, 0x0011, 0xb2c8, 0x0000, 0xff80, 0x0013, 0x181b,
+	0x0010, 0xc4b0, 0x0010, 0xc5b1, 0x0003, 0x081d, 0x0010, 0xc6b1,
 	0x0000, 0xc0b0, 0x0005, 0x0031, 0x0000, 0x0004, 0x0015, 0x0033,
-	0x0010, 0xb211, 0x000b, 0x87f9, 0x0017, 0x4000, 0x0015, 0x00b8,
-	0x0010, 0x0009, 0x0015, 0x003a, 0x0010, 0x0707, 0x0004, 0x083d,
+	0x0010, 0xb211, 0x000b, 0x8821, 0x0017, 0x4000, 0x0015, 0x00b8,
+	0x0010, 0x0009, 0x0015, 0x003a, 0x0010, 0x0707, 0x0004, 0x0867,
 	0x0013, 0x002d, 0x0015, 0x00b8, 0x0010, 0x0009, 0x0015, 0x003a,
-	0x0010, 0x0707, 0x0013, 0x083d, 0x0014, 0x0114, 0x0015, 0x0030,
+	0x0010, 0x0707, 0x0013, 0x0867, 0x0014, 0x0114, 0x0015, 0x0030,
 	0x0000, 0x0400, 0x0011, 0x0d88, 0x0000, 0x0004, 0x0000, 0xff31,
-	0x0015, 0x0033, 0x0000, 0xba09, 0x001b, 0x880e, 0x0004, 0x07c2,
+	0x0015, 0x0033, 0x0000, 0xba09, 0x000b, 0x8836, 0x0004, 0x07ea,
 	0x0015, 0x0030, 0x0000, 0x0400, 0x0011, 0x0d88, 0x0000, 0x0010,
-	0x0000, 0xff31, 0x0015, 0x0033, 0x0010, 0xb20a, 0x000b, 0x8817,
-	0x0011, 0x0d88, 0x0010, 0x0011, 0x0000, 0xff31, 0x0015, 0x0033,
-	0x0010, 0x0309, 0x000b, 0x881d, 0x0002, 0x0327, 0x0010, 0xffb2,
-	0x0011, 0x0d88, 0x0010, 0x0011, 0x0000, 0xff31, 0x0015, 0x0033,
-	0x0010, 0xb20a, 0x001b, 0x8825, 0x0015, 0x00b8, 0x0010, 0x0006,
-	0x0013, 0x083d, 0x0004, 0x0126, 0x0004, 0x07c2, 0x0015, 0x0030,
-	0x0000, 0x0400, 0x0011, 0x1388, 0x0000, 0x0010, 0x0000, 0xff31,
-	0x0015, 0x0033, 0x0010, 0xb20a, 0x001b, 0x8832, 0x0012, 0x1027,
-	0x0010, 0xffb2, 0x0011, 0x1388, 0x0010, 0x0011, 0x0000, 0xff31,
-	0x0015, 0x0033, 0x0010, 0xb20a, 0x000b, 0x883a, 0x0015, 0x00b8,
-	0x0000, 0x0007, 0x0003, 0x483d, 0x0000, 0xb838, 0x0017, 0x4000,
-	0xa4bc, 0xa221
+	0x0000, 0xff31, 0x0015, 0x0033, 0x0010, 0xb20a, 0x000b, 0x883f,
+	0x0015, 0x0030, 0x0000, 0x0400, 0x0011, 0x0d88, 0x0010, 0x0011,
+	0x0000, 0xff31, 0x0015, 0x0033, 0x0010, 0x0309, 0x000b, 0x8847,
+	0x0002, 0x0327, 0x0010, 0xffb2, 0x0011, 0x0d88, 0x0010, 0x0011,
+	0x0000, 0xff31, 0x0015, 0x0033, 0x0010, 0xb20a, 0x001b, 0x884f,
+	0x0015, 0x00b8, 0x0010, 0x0006, 0x0013, 0x0867, 0x0004, 0x0126,
+	0x0004, 0x07ea, 0x0015, 0x0030, 0x0000, 0x0400, 0x0011, 0x1388,
+	0x0000, 0x0010, 0x0000, 0xff31, 0x0015, 0x0033, 0x0010, 0xb20a,
+	0x000b, 0x885c, 0x0012, 0x1027, 0x0010, 0xffb2, 0x0011, 0x1388,
+	0x0010, 0x0011, 0x0000, 0xff31, 0x0015, 0x0033, 0x0010, 0xb20a,
+	0x001b, 0x8864, 0x0015, 0x00b8, 0x0000, 0x0007, 0x0003, 0x4867,
+	0x0000, 0xb838, 0x0017, 0x4000, 0xa317, 0x2238
 };
-unsigned short xseqipx_code_length01 = 0x1082;
+unsigned short xseqipx_code_length01 = 0x10d6;
diff --git a/drivers/scsi/qla2xxx/ql6312.c b/drivers/scsi/qla2xxx/ql6312.c
index 9649d9263..6c0720da8 100644
--- a/drivers/scsi/qla2xxx/ql6312.c
+++ b/drivers/scsi/qla2xxx/ql6312.c
@@ -9,7 +9,6 @@
 #include <linux/module.h>
 #include <linux/pci.h>
 
-#include "qla_os.h"
 #include "qla_def.h"
 
 static char qla_driver_name[] = "qla6312";
diff --git a/drivers/scsi/qla2xxx/ql6312_fw.c b/drivers/scsi/qla2xxx/ql6312_fw.c
index 0384b9c92..407bfa9f5 100644
--- a/drivers/scsi/qla2xxx/ql6312_fw.c
+++ b/drivers/scsi/qla2xxx/ql6312_fw.c
@@ -18,7 +18,7 @@
  *************************************************************************/
 
 /*
- *	Firmware Version 3.02.28 (13:56 Apr 03, 2004)
+ *	Firmware Version 3.02.30 (07:52 Jun 16, 2004)
  */
 
 #ifdef UNIQUE_FW_NAME
@@ -28,15 +28,15 @@ unsigned short risc_code_version = 3*1024+2;
 #endif
 
 #ifdef UNIQUE_FW_NAME
-unsigned char fw2300flx_version_str[] = {3, 2,28};
+unsigned char fw2300flx_version_str[] = {3, 2,30};
 #else
-unsigned char firmware_version[] = {3, 2,28};
+unsigned char firmware_version[] = {3, 2,30};
 #endif
 
 #ifdef UNIQUE_FW_NAME
-#define fw2300flx_VERSION_STRING "3.02.28"
+#define fw2300flx_VERSION_STRING "3.02.30"
 #else
-#define FW_VERSION_STRING "3.02.28"
+#define FW_VERSION_STRING "3.02.30"
 #endif
 
 #ifdef UNIQUE_FW_NAME
@@ -50,12 +50,12 @@ unsigned short fw2300flx_code01[] = {
 #else
 unsigned short risc_code01[] = { 
 #endif
-	0x0470, 0x0000, 0x0000, 0xd59a, 0x0000, 0x0003, 0x0002, 0x001c,
+	0x0470, 0x0000, 0x0000, 0xd5bb, 0x0000, 0x0003, 0x0002, 0x001e,
 	0x0317, 0x2043, 0x4f50, 0x5952, 0x4947, 0x4854, 0x2032, 0x3030,
 	0x3120, 0x514c, 0x4f47, 0x4943, 0x2043, 0x4f52, 0x504f, 0x5241,
 	0x5449, 0x4f4e, 0x2049, 0x5350, 0x3233, 0x3030, 0x2046, 0x6972,
 	0x6d77, 0x6172, 0x6520, 0x2056, 0x6572, 0x7369, 0x6f6e, 0x2030,
-	0x332e, 0x3032, 0x2e32, 0x3820, 0x2020, 0x2020, 0x2400, 0x20a9,
+	0x332e, 0x3032, 0x2e33, 0x3020, 0x2020, 0x2020, 0x2400, 0x20a9,
 	0x000f, 0x2001, 0x0000, 0x400f, 0x2091, 0x2200, 0x20a9, 0x000f,
 	0x2001, 0x0000, 0x400f, 0x2091, 0x2400, 0x20a9, 0x000f, 0x2001,
 	0x0000, 0x400f, 0x2091, 0x2600, 0x20a9, 0x000f, 0x2001, 0x0000,
@@ -64,171 +64,171 @@ unsigned short risc_code01[] = {
 	0x2c00, 0x20a9, 0x000f, 0x2001, 0x0000, 0x400f, 0x2091, 0x2e00,
 	0x20a9, 0x000f, 0x2001, 0x0000, 0x400f, 0x2091, 0x2000, 0x2001,
 	0x0000, 0x20c1, 0x0004, 0x20c9, 0x1bff, 0x2059, 0x0000, 0x2b78,
-	0x7883, 0x0004, 0x2089, 0x2b4e, 0x2051, 0x1800, 0x2a70, 0x20e1,
+	0x7883, 0x0004, 0x2089, 0x2b50, 0x2051, 0x1800, 0x2a70, 0x20e1,
 	0x0001, 0x20e9, 0x0001, 0x2009, 0x0000, 0x080c, 0x0e2f, 0x2029,
 	0x2480, 0x2031, 0xffff, 0x2039, 0x2450, 0x2021, 0x0050, 0x20e9,
 	0x0001, 0x20a1, 0x0000, 0x20a9, 0x0800, 0x900e, 0x4104, 0x20e9,
 	0x0001, 0x20a1, 0x1000, 0x900e, 0x2001, 0x0cc0, 0x9084, 0x0fff,
 	0x20a8, 0x4104, 0x2001, 0x0000, 0x9086, 0x0000, 0x0120, 0x21a8,
 	0x4104, 0x8001, 0x1de0, 0x756a, 0x766e, 0x7766, 0x7472, 0x7476,
-	0x00e6, 0x2071, 0x1a98, 0x2472, 0x00ee, 0x20a1, 0x1cd0, 0x716c,
+	0x00e6, 0x2071, 0x1a97, 0x2472, 0x00ee, 0x20a1, 0x1cd0, 0x716c,
 	0x810d, 0x810d, 0x810d, 0x810d, 0x918c, 0x000f, 0x2001, 0x0001,
 	0x9112, 0x900e, 0x21a8, 0x4104, 0x8211, 0x1de0, 0x716c, 0x3400,
 	0x8001, 0x9102, 0x0120, 0x0218, 0x20a8, 0x900e, 0x4104, 0x2009,
 	0x1800, 0x810d, 0x810d, 0x810d, 0x810d, 0x810d, 0x918c, 0x001f,
 	0x2001, 0x0001, 0x9112, 0x20e9, 0x0001, 0x20a1, 0x0800, 0x900e,
 	0x20a9, 0x0800, 0x4104, 0x8211, 0x1dd8, 0x080c, 0x0f03, 0x080c,
-	0x5cdf, 0x080c, 0x9dc8, 0x080c, 0x10ba, 0x080c, 0x129f, 0x080c,
-	0x1a53, 0x080c, 0x0d46, 0x080c, 0x103f, 0x080c, 0x3238, 0x080c,
-	0x72aa, 0x080c, 0x661d, 0x080c, 0x7f73, 0x080c, 0x230a, 0x080c,
-	0x82a0, 0x080c, 0x7933, 0x080c, 0x2147, 0x080c, 0x227b, 0x080c,
-	0x22ff, 0x2091, 0x3009, 0x7883, 0x0000, 0x1004, 0x091d, 0x7880,
+	0x5ce8, 0x080c, 0x9dd8, 0x080c, 0x10ba, 0x080c, 0x129f, 0x080c,
+	0x1a55, 0x080c, 0x0d46, 0x080c, 0x103f, 0x080c, 0x323a, 0x080c,
+	0x7293, 0x080c, 0x6626, 0x080c, 0x7f5c, 0x080c, 0x230c, 0x080c,
+	0x8289, 0x080c, 0x791c, 0x080c, 0x2149, 0x080c, 0x227d, 0x080c,
+	0x2301, 0x2091, 0x3009, 0x7883, 0x0000, 0x1004, 0x091d, 0x7880,
 	0x9086, 0x0002, 0x1190, 0x7883, 0x4000, 0x7837, 0x4000, 0x7833,
 	0x0010, 0x0e04, 0x0911, 0x2091, 0x5000, 0x2091, 0x4080, 0x2001,
 	0x0089, 0x2004, 0xd084, 0x190c, 0x1187, 0x2071, 0x1800, 0x7003,
 	0x0000, 0x2071, 0x1800, 0x7000, 0x908e, 0x0003, 0x1168, 0x080c,
-	0x499e, 0x080c, 0x325f, 0x080c, 0x731b, 0x080c, 0x6add, 0x080c,
-	0x7f9c, 0x080c, 0x2ab8, 0x0c68, 0x000b, 0x0c88, 0x0940, 0x0941,
+	0x49ae, 0x080c, 0x3261, 0x080c, 0x7304, 0x080c, 0x6ad6, 0x080c,
+	0x7f85, 0x080c, 0x2aba, 0x0c68, 0x000b, 0x0c88, 0x0940, 0x0941,
 	0x0ad8, 0x093e, 0x0b8f, 0x0d45, 0x0d45, 0x0d45, 0x080c, 0x0db4,
 	0x0005, 0x0126, 0x00f6, 0x2091, 0x8000, 0x7000, 0x9086, 0x0001,
-	0x1904, 0x0aab, 0x080c, 0x0e71, 0x080c, 0x6fb2, 0x0150, 0x080c,
-	0x6fd5, 0x15a0, 0x2079, 0x0100, 0x7828, 0x9085, 0x1800, 0x782a,
-	0x0468, 0x080c, 0x6ee4, 0x7000, 0x9086, 0x0001, 0x1904, 0x0aab,
-	0x7094, 0x9086, 0x0028, 0x1904, 0x0aab, 0x080c, 0x7f6b, 0x080c,
-	0x7f5d, 0x2001, 0x0161, 0x2003, 0x0001, 0x2079, 0x0100, 0x7827,
-	0xffff, 0x7a28, 0x9295, 0x5e2f, 0x7a2a, 0x2011, 0x6e33, 0x080c,
-	0x8038, 0x2011, 0x6e26, 0x080c, 0x810c, 0x2011, 0x5b3a, 0x080c,
-	0x8038, 0x2011, 0x8030, 0x901e, 0x7392, 0x04d0, 0x080c, 0x53e7,
-	0x2079, 0x0100, 0x7844, 0x9005, 0x1904, 0x0aab, 0x2011, 0x5b3a,
-	0x080c, 0x8038, 0x2011, 0x6e33, 0x080c, 0x8038, 0x2011, 0x6e26,
-	0x080c, 0x810c, 0x2001, 0x0265, 0x2001, 0x0205, 0x2003, 0x0000,
-	0x7840, 0x9084, 0xfffb, 0x7842, 0x2001, 0x1977, 0x2004, 0x9005,
-	0x1140, 0x00c6, 0x2061, 0x0100, 0x080c, 0x5c87, 0x00ce, 0x0804,
-	0x0aab, 0x780f, 0x006b, 0x7a28, 0x080c, 0x6fba, 0x0118, 0x9295,
+	0x1904, 0x0aab, 0x080c, 0x0e71, 0x080c, 0x6f9b, 0x0150, 0x080c,
+	0x6fbe, 0x15a0, 0x2079, 0x0100, 0x7828, 0x9085, 0x1800, 0x782a,
+	0x0468, 0x080c, 0x6ecd, 0x7000, 0x9086, 0x0001, 0x1904, 0x0aab,
+	0x7094, 0x9086, 0x0028, 0x1904, 0x0aab, 0x080c, 0x7f54, 0x080c,
+	0x7f46, 0x2001, 0x0161, 0x2003, 0x0001, 0x2079, 0x0100, 0x7827,
+	0xffff, 0x7a28, 0x9295, 0x5e2f, 0x7a2a, 0x2011, 0x6e1c, 0x080c,
+	0x8021, 0x2011, 0x6e0f, 0x080c, 0x80f5, 0x2011, 0x5b43, 0x080c,
+	0x8021, 0x2011, 0x8030, 0x901e, 0x7392, 0x04d0, 0x080c, 0x53f0,
+	0x2079, 0x0100, 0x7844, 0x9005, 0x1904, 0x0aab, 0x2011, 0x5b43,
+	0x080c, 0x8021, 0x2011, 0x6e1c, 0x080c, 0x8021, 0x2011, 0x6e0f,
+	0x080c, 0x80f5, 0x2001, 0x0265, 0x2001, 0x0205, 0x2003, 0x0000,
+	0x7840, 0x9084, 0xfffb, 0x7842, 0x2001, 0x1976, 0x2004, 0x9005,
+	0x1140, 0x00c6, 0x2061, 0x0100, 0x080c, 0x5c90, 0x00ce, 0x0804,
+	0x0aab, 0x780f, 0x006b, 0x7a28, 0x080c, 0x6fa3, 0x0118, 0x9295,
 	0x5e2f, 0x0010, 0x9295, 0x402f, 0x7a2a, 0x2011, 0x8010, 0x73d4,
-	0x2001, 0x1978, 0x2003, 0x0001, 0x080c, 0x297e, 0x080c, 0x48d9,
+	0x2001, 0x1977, 0x2003, 0x0001, 0x080c, 0x2980, 0x080c, 0x48e9,
 	0x7244, 0xc284, 0x7246, 0x2001, 0x180c, 0x200c, 0xc1ac, 0xc1cc,
-	0x2102, 0x080c, 0x963f, 0x2011, 0x0004, 0x080c, 0xbb27, 0x080c,
-	0x6461, 0x080c, 0x6fb2, 0x1120, 0x080c, 0x29c2, 0x02e0, 0x0400,
-	0x080c, 0x5c8e, 0x0140, 0x7093, 0x0001, 0x70cf, 0x0000, 0x080c,
-	0x55b4, 0x0804, 0x0aab, 0x080c, 0x5386, 0xd094, 0x0188, 0x2011,
-	0x180c, 0x2204, 0xc0cd, 0x2012, 0x080c, 0x538a, 0xd0d4, 0x1118,
-	0x080c, 0x29c2, 0x1270, 0x2011, 0x180c, 0x2204, 0xc0bc, 0x0088,
-	0x080c, 0x538a, 0xd0d4, 0x1db8, 0x2011, 0x180c, 0x2204, 0xc0bd,
-	0x0040, 0x2011, 0x180c, 0x2204, 0xc0bd, 0x2012, 0x080c, 0x655a,
-	0x0008, 0x2012, 0x080c, 0x6520, 0x0120, 0x7a0c, 0xc2b4, 0x7a0e,
-	0x00a8, 0x707b, 0x0000, 0x080c, 0x6fb2, 0x1130, 0x70ac, 0x9005,
-	0x1168, 0x080c, 0xbf63, 0x0050, 0x080c, 0xbf63, 0x70d8, 0xd09c,
-	0x1128, 0x70ac, 0x9005, 0x0110, 0x080c, 0x5c64, 0x70e3, 0x0000,
-	0x70df, 0x0000, 0x70a3, 0x0000, 0x080c, 0x29ca, 0x0228, 0x2011,
-	0x0101, 0x2204, 0xc0c4, 0x2012, 0x72d8, 0x080c, 0x6fb2, 0x1178,
-	0x9016, 0x0016, 0x2009, 0x0002, 0x2019, 0x193e, 0x211a, 0x001e,
+	0x2102, 0x080c, 0x9640, 0x2011, 0x0004, 0x080c, 0xbb3c, 0x080c,
+	0x646a, 0x080c, 0x6f9b, 0x1120, 0x080c, 0x29c4, 0x02e0, 0x0400,
+	0x080c, 0x5c97, 0x0140, 0x7093, 0x0001, 0x70cf, 0x0000, 0x080c,
+	0x55bd, 0x0804, 0x0aab, 0x080c, 0x538f, 0xd094, 0x0188, 0x2011,
+	0x180c, 0x2204, 0xc0cd, 0x2012, 0x080c, 0x5393, 0xd0d4, 0x1118,
+	0x080c, 0x29c4, 0x1270, 0x2011, 0x180c, 0x2204, 0xc0bc, 0x0088,
+	0x080c, 0x5393, 0xd0d4, 0x1db8, 0x2011, 0x180c, 0x2204, 0xc0bd,
+	0x0040, 0x2011, 0x180c, 0x2204, 0xc0bd, 0x2012, 0x080c, 0x6563,
+	0x0008, 0x2012, 0x080c, 0x6529, 0x0120, 0x7a0c, 0xc2b4, 0x7a0e,
+	0x00a8, 0x707b, 0x0000, 0x080c, 0x6f9b, 0x1130, 0x70ac, 0x9005,
+	0x1168, 0x080c, 0xbf7d, 0x0050, 0x080c, 0xbf7d, 0x70d8, 0xd09c,
+	0x1128, 0x70ac, 0x9005, 0x0110, 0x080c, 0x5c6d, 0x70e3, 0x0000,
+	0x70df, 0x0000, 0x70a3, 0x0000, 0x080c, 0x29cc, 0x0228, 0x2011,
+	0x0101, 0x2204, 0xc0c4, 0x2012, 0x72d8, 0x080c, 0x6f9b, 0x1178,
+	0x9016, 0x0016, 0x2009, 0x0002, 0x2019, 0x193d, 0x211a, 0x001e,
 	0x705b, 0xffff, 0x705f, 0x00ef, 0x707f, 0x0000, 0x0020, 0x2019,
-	0x193e, 0x201b, 0x0000, 0x2079, 0x1853, 0x7804, 0xd0ac, 0x0108,
-	0xc295, 0x72da, 0x080c, 0x6fb2, 0x0118, 0x9296, 0x0004, 0x0548,
-	0x2011, 0x0001, 0x080c, 0xbb27, 0x70a7, 0x0000, 0x70ab, 0xffff,
+	0x193d, 0x201b, 0x0000, 0x2079, 0x1853, 0x7804, 0xd0ac, 0x0108,
+	0xc295, 0x72da, 0x080c, 0x6f9b, 0x0118, 0x9296, 0x0004, 0x0548,
+	0x2011, 0x0001, 0x080c, 0xbb3c, 0x70a7, 0x0000, 0x70ab, 0xffff,
 	0x7003, 0x0002, 0x2079, 0x0100, 0x7827, 0x0003, 0x7828, 0x9085,
-	0x0003, 0x782a, 0x00fe, 0x080c, 0x2dbb, 0x2011, 0x0005, 0x080c,
-	0x9771, 0x080c, 0x8973, 0x080c, 0x6fb2, 0x0148, 0x00c6, 0x2061,
+	0x0003, 0x782a, 0x00fe, 0x080c, 0x2dbd, 0x2011, 0x0005, 0x080c,
+	0x9772, 0x080c, 0x896d, 0x080c, 0x6f9b, 0x0148, 0x00c6, 0x2061,
 	0x0100, 0x0016, 0x2009, 0x0002, 0x61e2, 0x001e, 0x00ce, 0x012e,
 	0x0420, 0x70a7, 0x0000, 0x70ab, 0xffff, 0x7003, 0x0002, 0x00f6,
 	0x2079, 0x0100, 0x7827, 0x0003, 0x7828, 0x9085, 0x0003, 0x782a,
-	0x00fe, 0x2011, 0x0005, 0x080c, 0x9771, 0x080c, 0x8973, 0x080c,
-	0x6fb2, 0x0148, 0x00c6, 0x2061, 0x0100, 0x0016, 0x2009, 0x0002,
+	0x00fe, 0x2011, 0x0005, 0x080c, 0x9772, 0x080c, 0x896d, 0x080c,
+	0x6f9b, 0x0148, 0x00c6, 0x2061, 0x0100, 0x0016, 0x2009, 0x0002,
 	0x61e2, 0x001e, 0x00ce, 0x00fe, 0x012e, 0x0005, 0x00c6, 0x00b6,
-	0x080c, 0x6fb2, 0x1118, 0x20a9, 0x0800, 0x0010, 0x20a9, 0x0782,
-	0x080c, 0x6fb2, 0x1110, 0x900e, 0x0010, 0x2009, 0x007e, 0x86ff,
+	0x080c, 0x6f9b, 0x1118, 0x20a9, 0x0800, 0x0010, 0x20a9, 0x0782,
+	0x080c, 0x6f9b, 0x1110, 0x900e, 0x0010, 0x2009, 0x007e, 0x86ff,
 	0x0138, 0x9180, 0x1000, 0x2004, 0x905d, 0x0110, 0xb800, 0xd0bc,
-	0x090c, 0x30d5, 0x8108, 0x1f04, 0x0abf, 0x707b, 0x0000, 0x707c,
+	0x090c, 0x30d7, 0x8108, 0x1f04, 0x0abf, 0x707b, 0x0000, 0x707c,
 	0x9084, 0x00ff, 0x707e, 0x70af, 0x0000, 0x00be, 0x00ce, 0x0005,
 	0x00b6, 0x0126, 0x2091, 0x8000, 0x7000, 0x9086, 0x0002, 0x1904,
-	0x0b8c, 0x70a8, 0x9086, 0xffff, 0x0130, 0x080c, 0x2dbb, 0x080c,
-	0x8973, 0x0804, 0x0b8c, 0x70d8, 0xd0ac, 0x1110, 0xd09c, 0x0540,
+	0x0b8c, 0x70a8, 0x9086, 0xffff, 0x0130, 0x080c, 0x2dbd, 0x080c,
+	0x896d, 0x0804, 0x0b8c, 0x70d8, 0xd0ac, 0x1110, 0xd09c, 0x0540,
 	0xd084, 0x0530, 0x0006, 0x2001, 0x0103, 0x2003, 0x002b, 0x000e,
-	0xd08c, 0x01f0, 0x70dc, 0x9086, 0xffff, 0x01b0, 0x080c, 0x2f46,
-	0x080c, 0x8973, 0x70d8, 0xd094, 0x1904, 0x0b8c, 0x2011, 0x0001,
-	0x080c, 0xc212, 0x0110, 0x2011, 0x0003, 0x901e, 0x080c, 0x2f80,
-	0x080c, 0x8973, 0x0804, 0x0b8c, 0x70e0, 0x9005, 0x1904, 0x0b8c,
+	0xd08c, 0x01f0, 0x70dc, 0x9086, 0xffff, 0x01b0, 0x080c, 0x2f48,
+	0x080c, 0x896d, 0x70d8, 0xd094, 0x1904, 0x0b8c, 0x2011, 0x0001,
+	0x080c, 0xc22c, 0x0110, 0x2011, 0x0003, 0x901e, 0x080c, 0x2f82,
+	0x080c, 0x896d, 0x0804, 0x0b8c, 0x70e0, 0x9005, 0x1904, 0x0b8c,
 	0x70a4, 0x9005, 0x1904, 0x0b8c, 0x70d8, 0xd0a4, 0x0118, 0xd0b4,
-	0x0904, 0x0b8c, 0x080c, 0x6520, 0x1904, 0x0b8c, 0x080c, 0x6573,
-	0x1904, 0x0b8c, 0x080c, 0x655a, 0x01c0, 0x0156, 0x00c6, 0x20a9,
-	0x007f, 0x900e, 0x0016, 0x080c, 0x623e, 0x1118, 0xb800, 0xd0ec,
+	0x0904, 0x0b8c, 0x080c, 0x6529, 0x1904, 0x0b8c, 0x080c, 0x657c,
+	0x1904, 0x0b8c, 0x080c, 0x6563, 0x01c0, 0x0156, 0x00c6, 0x20a9,
+	0x007f, 0x900e, 0x0016, 0x080c, 0x6247, 0x1118, 0xb800, 0xd0ec,
 	0x1138, 0x001e, 0x8108, 0x1f04, 0x0b32, 0x00ce, 0x015e, 0x0028,
 	0x001e, 0x00ce, 0x015e, 0x0804, 0x0b8c, 0x0006, 0x2001, 0x0103,
-	0x2003, 0x006b, 0x000e, 0x2011, 0x1984, 0x080c, 0x0f73, 0x2011,
-	0x199e, 0x080c, 0x0f73, 0x7030, 0xc08c, 0x7032, 0x7003, 0x0003,
-	0x70ab, 0xffff, 0x080c, 0x0e53, 0x9006, 0x080c, 0x260c, 0x0036,
-	0x0046, 0x2019, 0xffff, 0x2021, 0x0006, 0x080c, 0x4a76, 0x004e,
-	0x003e, 0x00f6, 0x2079, 0x0100, 0x080c, 0x6fd5, 0x0150, 0x080c,
-	0x6fb2, 0x7828, 0x0118, 0x9084, 0xe1ff, 0x0010, 0x9084, 0xffdf,
-	0x782a, 0x00fe, 0x2001, 0x19b9, 0x2004, 0x9086, 0x0005, 0x1120,
-	0x2011, 0x0000, 0x080c, 0x9771, 0x2011, 0x0000, 0x080c, 0x977b,
-	0x080c, 0x8973, 0x080c, 0x8a4e, 0x012e, 0x00be, 0x0005, 0x0016,
+	0x2003, 0x006b, 0x000e, 0x2011, 0x1983, 0x080c, 0x0f73, 0x2011,
+	0x199d, 0x080c, 0x0f73, 0x7030, 0xc08c, 0x7032, 0x7003, 0x0003,
+	0x70ab, 0xffff, 0x080c, 0x0e53, 0x9006, 0x080c, 0x260e, 0x0036,
+	0x0046, 0x2019, 0xffff, 0x2021, 0x0006, 0x080c, 0x4a86, 0x004e,
+	0x003e, 0x00f6, 0x2079, 0x0100, 0x080c, 0x6fbe, 0x0150, 0x080c,
+	0x6f9b, 0x7828, 0x0118, 0x9084, 0xe1ff, 0x0010, 0x9084, 0xffdf,
+	0x782a, 0x00fe, 0x2001, 0x19b8, 0x2004, 0x9086, 0x0005, 0x1120,
+	0x2011, 0x0000, 0x080c, 0x9772, 0x2011, 0x0000, 0x080c, 0x977c,
+	0x080c, 0x896d, 0x080c, 0x8a4a, 0x012e, 0x00be, 0x0005, 0x0016,
 	0x0046, 0x00f6, 0x0126, 0x2091, 0x8000, 0x2079, 0x0100, 0x7904,
-	0x918c, 0xfffd, 0x7906, 0x2009, 0x00f7, 0x080c, 0x5c4d, 0x7940,
+	0x918c, 0xfffd, 0x7906, 0x2009, 0x00f7, 0x080c, 0x5c56, 0x7940,
 	0x918c, 0x0010, 0x7942, 0x7924, 0xd1b4, 0x0110, 0x7827, 0x0040,
 	0xd19c, 0x0110, 0x7827, 0x0008, 0x0006, 0x0036, 0x0156, 0x7954,
-	0xd1ac, 0x1904, 0x0c1c, 0x2001, 0x1978, 0x2004, 0x9005, 0x1518,
-	0x080c, 0x2a45, 0x1148, 0x2001, 0x0001, 0x080c, 0x29ad, 0x2001,
-	0x0001, 0x080c, 0x2990, 0x00b8, 0x080c, 0x2a4d, 0x1138, 0x9006,
-	0x080c, 0x29ad, 0x9006, 0x080c, 0x2990, 0x0068, 0x080c, 0x2a55,
-	0x1d50, 0x2001, 0x1969, 0x2004, 0xd0fc, 0x0108, 0x0020, 0x080c,
-	0x27a7, 0x0804, 0x0cfc, 0x080c, 0x6fc3, 0x0148, 0x080c, 0x6fd5,
-	0x1118, 0x080c, 0x72a5, 0x0050, 0x080c, 0x6fba, 0x0dd0, 0x080c,
-	0x72a0, 0x080c, 0x7296, 0x080c, 0x6ee4, 0x0058, 0x080c, 0x6fb2,
-	0x0140, 0x2009, 0x00f8, 0x080c, 0x5c4d, 0x7843, 0x0090, 0x7843,
-	0x0010, 0x20a9, 0x09c4, 0x7820, 0xd09c, 0x1138, 0x080c, 0x6fb2,
+	0xd1ac, 0x1904, 0x0c1c, 0x2001, 0x1977, 0x2004, 0x9005, 0x1518,
+	0x080c, 0x2a47, 0x1148, 0x2001, 0x0001, 0x080c, 0x29af, 0x2001,
+	0x0001, 0x080c, 0x2992, 0x00b8, 0x080c, 0x2a4f, 0x1138, 0x9006,
+	0x080c, 0x29af, 0x9006, 0x080c, 0x2992, 0x0068, 0x080c, 0x2a57,
+	0x1d50, 0x2001, 0x1968, 0x2004, 0xd0fc, 0x0108, 0x0020, 0x080c,
+	0x27a9, 0x0804, 0x0cfc, 0x080c, 0x6fac, 0x0148, 0x080c, 0x6fbe,
+	0x1118, 0x080c, 0x728e, 0x0050, 0x080c, 0x6fa3, 0x0dd0, 0x080c,
+	0x7289, 0x080c, 0x727f, 0x080c, 0x6ecd, 0x0058, 0x080c, 0x6f9b,
+	0x0140, 0x2009, 0x00f8, 0x080c, 0x5c56, 0x7843, 0x0090, 0x7843,
+	0x0010, 0x20a9, 0x09c4, 0x7820, 0xd09c, 0x1138, 0x080c, 0x6f9b,
 	0x0138, 0x7824, 0xd0ac, 0x1904, 0x0d01, 0x1f04, 0x0bfb, 0x0070,
-	0x7824, 0x080c, 0x6fcc, 0x0118, 0xd0ac, 0x1904, 0x0d01, 0x9084,
+	0x7824, 0x080c, 0x6fb5, 0x0118, 0xd0ac, 0x1904, 0x0d01, 0x9084,
 	0x1800, 0x0d98, 0x7003, 0x0001, 0x0804, 0x0d01, 0x2001, 0x0001,
-	0x080c, 0x260c, 0x0804, 0x0d14, 0x2001, 0x1978, 0x2004, 0x9005,
-	0x1518, 0x080c, 0x2a45, 0x1148, 0x2001, 0x0001, 0x080c, 0x29ad,
-	0x2001, 0x0001, 0x080c, 0x2990, 0x00b8, 0x080c, 0x2a4d, 0x1138,
-	0x9006, 0x080c, 0x29ad, 0x9006, 0x080c, 0x2990, 0x0068, 0x080c,
-	0x2a55, 0x1d50, 0x2001, 0x1969, 0x2004, 0xd0fc, 0x0108, 0x0020,
-	0x080c, 0x27a7, 0x0804, 0x0cfc, 0x7850, 0x9085, 0x0040, 0x7852,
-	0x7938, 0x7850, 0x9084, 0xfbcf, 0x7852, 0x080c, 0x2a5d, 0x9085,
+	0x080c, 0x260e, 0x0804, 0x0d14, 0x2001, 0x1977, 0x2004, 0x9005,
+	0x1518, 0x080c, 0x2a47, 0x1148, 0x2001, 0x0001, 0x080c, 0x29af,
+	0x2001, 0x0001, 0x080c, 0x2992, 0x00b8, 0x080c, 0x2a4f, 0x1138,
+	0x9006, 0x080c, 0x29af, 0x9006, 0x080c, 0x2992, 0x0068, 0x080c,
+	0x2a57, 0x1d50, 0x2001, 0x1968, 0x2004, 0xd0fc, 0x0108, 0x0020,
+	0x080c, 0x27a9, 0x0804, 0x0cfc, 0x7850, 0x9085, 0x0040, 0x7852,
+	0x7938, 0x7850, 0x9084, 0xfbcf, 0x7852, 0x080c, 0x2a5f, 0x9085,
 	0x2000, 0x7852, 0x793a, 0x20a9, 0x0046, 0x1d04, 0x0c55, 0x080c,
-	0x80ec, 0x1f04, 0x0c55, 0x7850, 0x9085, 0x0400, 0x9084, 0xdfbf,
-	0x7852, 0x793a, 0x080c, 0x6fc3, 0x0148, 0x080c, 0x6fd5, 0x1118,
-	0x080c, 0x72a5, 0x0050, 0x080c, 0x6fba, 0x0dd0, 0x080c, 0x72a0,
-	0x080c, 0x7296, 0x080c, 0x6ee4, 0x0020, 0x2009, 0x00f8, 0x080c,
-	0x5c4d, 0x20a9, 0x0028, 0xa001, 0x1f04, 0x0c7b, 0x7850, 0x9085,
-	0x1400, 0x7852, 0x080c, 0x6fb2, 0x0120, 0x7843, 0x0090, 0x7843,
-	0x0010, 0x2021, 0xe678, 0x2019, 0xea60, 0x0d0c, 0x80ec, 0x7820,
-	0xd09c, 0x1588, 0x080c, 0x6fb2, 0x0904, 0x0ce1, 0x7824, 0xd0ac,
-	0x1904, 0x0d01, 0x080c, 0x6fd5, 0x1530, 0x0046, 0x2021, 0x0320,
-	0x8421, 0x1df0, 0x004e, 0x7827, 0x1800, 0x080c, 0x2a5d, 0x7824,
+	0x80d5, 0x1f04, 0x0c55, 0x7850, 0x9085, 0x0400, 0x9084, 0xdfbf,
+	0x7852, 0x793a, 0x080c, 0x6fac, 0x0148, 0x080c, 0x6fbe, 0x1118,
+	0x080c, 0x728e, 0x0050, 0x080c, 0x6fa3, 0x0dd0, 0x080c, 0x7289,
+	0x080c, 0x727f, 0x080c, 0x6ecd, 0x0020, 0x2009, 0x00f8, 0x080c,
+	0x5c56, 0x20a9, 0x0028, 0xa001, 0x1f04, 0x0c7b, 0x7850, 0x9085,
+	0x1400, 0x7852, 0x080c, 0x6f9b, 0x0120, 0x7843, 0x0090, 0x7843,
+	0x0010, 0x2021, 0xe678, 0x2019, 0xea60, 0x0d0c, 0x80d5, 0x7820,
+	0xd09c, 0x1588, 0x080c, 0x6f9b, 0x0904, 0x0ce1, 0x7824, 0xd0ac,
+	0x1904, 0x0d01, 0x080c, 0x6fbe, 0x1530, 0x0046, 0x2021, 0x0320,
+	0x8421, 0x1df0, 0x004e, 0x7827, 0x1800, 0x080c, 0x2a5f, 0x7824,
 	0x9084, 0x1800, 0x1168, 0x9484, 0x0fff, 0x1140, 0x2001, 0x1810,
 	0x2004, 0x9084, 0x9000, 0x0110, 0x080c, 0x0d22, 0x8421, 0x1158,
-	0x1d04, 0x0cbc, 0x080c, 0x80ec, 0x080c, 0x72a0, 0x080c, 0x7296,
+	0x1d04, 0x0cbc, 0x080c, 0x80d5, 0x080c, 0x7289, 0x080c, 0x727f,
 	0x7003, 0x0001, 0x04f0, 0x8319, 0x1940, 0x1d04, 0x0cc9, 0x080c,
-	0x80ec, 0x2009, 0x196c, 0x2104, 0x9005, 0x0118, 0x8001, 0x200a,
+	0x80d5, 0x2009, 0x196b, 0x2104, 0x9005, 0x0118, 0x8001, 0x200a,
 	0x1178, 0x200b, 0x000a, 0x7827, 0x0048, 0x20a9, 0x0002, 0x080c,
-	0x2a3e, 0x7924, 0x080c, 0x2a5d, 0xd19c, 0x0110, 0x080c, 0x297e,
-	0x00d8, 0x080c, 0x6fc3, 0x1140, 0x94a2, 0x03e8, 0x1128, 0x080c,
-	0x6f8a, 0x7003, 0x0001, 0x00a8, 0x7827, 0x1800, 0x080c, 0x2a5d,
-	0x7824, 0x080c, 0x6fcc, 0x0110, 0xd0ac, 0x1158, 0x9084, 0x1800,
-	0x0950, 0x7003, 0x0001, 0x0028, 0x2001, 0x0001, 0x080c, 0x260c,
+	0x2a40, 0x7924, 0x080c, 0x2a5f, 0xd19c, 0x0110, 0x080c, 0x2980,
+	0x00d8, 0x080c, 0x6fac, 0x1140, 0x94a2, 0x03e8, 0x1128, 0x080c,
+	0x6f73, 0x7003, 0x0001, 0x00a8, 0x7827, 0x1800, 0x080c, 0x2a5f,
+	0x7824, 0x080c, 0x6fb5, 0x0110, 0xd0ac, 0x1158, 0x9084, 0x1800,
+	0x0950, 0x7003, 0x0001, 0x0028, 0x2001, 0x0001, 0x080c, 0x260e,
 	0x0078, 0x2009, 0x180c, 0x210c, 0xd19c, 0x1120, 0x7904, 0x918d,
 	0x0002, 0x7906, 0x7827, 0x0048, 0x7828, 0x9085, 0x0028, 0x782a,
-	0x7850, 0x9085, 0x0400, 0x7852, 0x2001, 0x1978, 0x2003, 0x0000,
+	0x7850, 0x9085, 0x0400, 0x7852, 0x2001, 0x1977, 0x2003, 0x0000,
 	0x9006, 0x78f2, 0x015e, 0x003e, 0x000e, 0x012e, 0x00fe, 0x004e,
 	0x001e, 0x0005, 0x0006, 0x0016, 0x0036, 0x0046, 0x00b6, 0x00c6,
-	0x00d6, 0x00e6, 0x00f6, 0x0156, 0x0069, 0x0d0c, 0x80ec, 0x015e,
+	0x00d6, 0x00e6, 0x00f6, 0x0156, 0x0069, 0x0d0c, 0x80d5, 0x015e,
 	0x00fe, 0x00ee, 0x00de, 0x00ce, 0x00be, 0x004e, 0x003e, 0x001e,
 	0x000e, 0x0005, 0x00e6, 0x2071, 0x1894, 0x7004, 0x9086, 0x0001,
-	0x1110, 0x080c, 0x325f, 0x00ee, 0x0005, 0x0005, 0x2a70, 0x2061,
-	0x197c, 0x2063, 0x0003, 0x6007, 0x0002, 0x600b, 0x001c, 0x600f,
-	0x0317, 0x2001, 0x194d, 0x900e, 0x2102, 0x7192, 0x2001, 0x0100,
+	0x1110, 0x080c, 0x3261, 0x00ee, 0x0005, 0x0005, 0x2a70, 0x2061,
+	0x197b, 0x2063, 0x0003, 0x6007, 0x0002, 0x600b, 0x001e, 0x600f,
+	0x0317, 0x2001, 0x194c, 0x900e, 0x2102, 0x7192, 0x2001, 0x0100,
 	0x2004, 0x9082, 0x0002, 0x0218, 0x705b, 0xffff, 0x0008, 0x715a,
-	0x7063, 0xffff, 0x717a, 0x717e, 0x080c, 0xbf63, 0x70e7, 0x00c0,
-	0x2061, 0x193d, 0x6003, 0x0909, 0x6106, 0x600b, 0x8800, 0x600f,
+	0x7063, 0xffff, 0x717a, 0x717e, 0x080c, 0xbf7d, 0x70e7, 0x00c0,
+	0x2061, 0x193c, 0x6003, 0x0909, 0x6106, 0x600b, 0x8800, 0x600f,
 	0x0200, 0x6013, 0x00ff, 0x6017, 0x000f, 0x611a, 0x601f, 0x07d0,
-	0x2061, 0x1945, 0x6003, 0x8000, 0x6106, 0x610a, 0x600f, 0x0200,
-	0x6013, 0x00ff, 0x6116, 0x601b, 0x0001, 0x611e, 0x2061, 0x195a,
+	0x2061, 0x1944, 0x6003, 0x8000, 0x6106, 0x610a, 0x600f, 0x0200,
+	0x6013, 0x00ff, 0x6116, 0x601b, 0x0001, 0x611e, 0x2061, 0x1959,
 	0x6003, 0x514c, 0x6007, 0x4f47, 0x600b, 0x4943, 0x600f, 0x2020,
-	0x2001, 0x182b, 0x2102, 0x0005, 0x9016, 0x080c, 0x623e, 0x1178,
+	0x2001, 0x182b, 0x2102, 0x0005, 0x9016, 0x080c, 0x6247, 0x1178,
 	0xb804, 0x90c4, 0x00ff, 0x98c6, 0x0006, 0x0128, 0x90c4, 0xff00,
 	0x98c6, 0x0600, 0x1120, 0x9186, 0x0080, 0x0108, 0x8210, 0x8108,
 	0x9186, 0x0800, 0x1d50, 0x2208, 0x0005, 0x2091, 0x8000, 0x2079,
@@ -236,18 +236,18 @@ unsigned short risc_code01[] = {
 	0x0006, 0x0016, 0x2001, 0x8002, 0x0006, 0x2079, 0x0000, 0x000e,
 	0x7882, 0x7836, 0x001e, 0x798e, 0x000e, 0x788a, 0x000e, 0x7886,
 	0x3900, 0x789a, 0x7833, 0x0012, 0x2091, 0x5000, 0x0156, 0x00d6,
-	0x0036, 0x0026, 0x2079, 0x0300, 0x2069, 0x1a72, 0x7a08, 0x226a,
-	0x2069, 0x1a73, 0x7a18, 0x226a, 0x8d68, 0x7a1c, 0x226a, 0x782c,
-	0x2019, 0x1a80, 0x201a, 0x2019, 0x1a83, 0x9016, 0x7808, 0xd09c,
-	0x0168, 0x7820, 0x201a, 0x8210, 0x8318, 0x9386, 0x1a98, 0x0108,
-	0x0ca8, 0x7808, 0xd09c, 0x0110, 0x2011, 0xdead, 0x2019, 0x1a81,
-	0x782c, 0x201a, 0x8318, 0x221a, 0x7803, 0x0000, 0x2069, 0x1a52,
+	0x0036, 0x0026, 0x2079, 0x0300, 0x2069, 0x1a71, 0x7a08, 0x226a,
+	0x2069, 0x1a72, 0x7a18, 0x226a, 0x8d68, 0x7a1c, 0x226a, 0x782c,
+	0x2019, 0x1a7f, 0x201a, 0x2019, 0x1a82, 0x9016, 0x7808, 0xd09c,
+	0x0168, 0x7820, 0x201a, 0x8210, 0x8318, 0x9386, 0x1a97, 0x0108,
+	0x0ca8, 0x7808, 0xd09c, 0x0110, 0x2011, 0xdead, 0x2019, 0x1a80,
+	0x782c, 0x201a, 0x8318, 0x221a, 0x7803, 0x0000, 0x2069, 0x1a51,
 	0x901e, 0x20a9, 0x0020, 0x7b26, 0x7a28, 0x226a, 0x8d68, 0x8318,
 	0x1f04, 0x0e03, 0x002e, 0x003e, 0x00de, 0x015e, 0x2079, 0x1800,
 	0x7803, 0x0005, 0x2091, 0x4080, 0x2001, 0x0089, 0x2004, 0xd084,
-	0x0180, 0x2001, 0x19ea, 0x2004, 0x9005, 0x0128, 0x2001, 0x008b,
+	0x0180, 0x2001, 0x19e9, 0x2004, 0x9005, 0x0128, 0x2001, 0x008b,
 	0x2004, 0xd0fc, 0x0dd8, 0x2001, 0x008a, 0x2003, 0x0002, 0x2003,
-	0x1001, 0x080c, 0x5395, 0x1108, 0x0099, 0x0cd8, 0x0005, 0x918c,
+	0x1001, 0x080c, 0x539e, 0x1108, 0x0099, 0x0cd8, 0x0005, 0x918c,
 	0x03ff, 0x2001, 0x0003, 0x2004, 0x9084, 0x0600, 0x1118, 0x918d,
 	0x2800, 0x0010, 0x918d, 0x2000, 0x2001, 0x017f, 0x2102, 0x0005,
 	0x0026, 0x0126, 0x2011, 0x0080, 0x080c, 0x0ecb, 0x20a9, 0x0900,
@@ -258,9 +258,9 @@ unsigned short risc_code01[] = {
 	0x70eb, 0x0000, 0x1128, 0x70eb, 0x0fa0, 0x080c, 0x0edd, 0x002e,
 	0x0005, 0x0026, 0x080c, 0x0ed8, 0x0128, 0xd0a4, 0x1138, 0x2011,
 	0xcdd5, 0x0010, 0x2011, 0x0080, 0x080c, 0x0edd, 0x002e, 0x0005,
-	0x0026, 0x70eb, 0x0000, 0x080c, 0x0ed8, 0x1148, 0x080c, 0x2a55,
+	0x0026, 0x70eb, 0x0000, 0x080c, 0x0ed8, 0x1148, 0x080c, 0x2a57,
 	0x1118, 0x2011, 0x8484, 0x0058, 0x2011, 0x8282, 0x0040, 0x080c,
-	0x2a55, 0x1118, 0x2011, 0xcdc5, 0x0010, 0x2011, 0xcac2, 0x080c,
+	0x2a57, 0x1118, 0x2011, 0xcdc5, 0x0010, 0x2011, 0xcac2, 0x080c,
 	0x0edd, 0x002e, 0x0005, 0x00e6, 0x0006, 0x2071, 0x1800, 0xd0b4,
 	0x70e4, 0x1110, 0xc0e4, 0x0048, 0x0006, 0x3b00, 0x9084, 0xff3f,
 	0x20d8, 0x000e, 0x70eb, 0x0000, 0xc0e5, 0x0079, 0x000e, 0x00ee,
@@ -313,7 +313,7 @@ unsigned short risc_code01[] = {
 	0x8000, 0x0016, 0x890e, 0x810e, 0x810f, 0x9184, 0x003f, 0xa862,
 	0x9184, 0xffc0, 0xa85e, 0x001e, 0x0020, 0x00e6, 0x0126, 0x2091,
 	0x8000, 0x2071, 0x1800, 0x702c, 0xa802, 0x2900, 0x702e, 0x70bc,
-	0x8000, 0x70be, 0x080c, 0x7f5d, 0x012e, 0x00ee, 0x0005, 0x2071,
+	0x8000, 0x70be, 0x080c, 0x7f46, 0x012e, 0x00ee, 0x0005, 0x2071,
 	0x1800, 0x9026, 0x2009, 0x0000, 0x2049, 0x0400, 0x2900, 0x702e,
 	0x8940, 0x2800, 0xa802, 0xa95e, 0xa863, 0x0001, 0x8420, 0x9886,
 	0x0440, 0x0120, 0x2848, 0x9188, 0x0040, 0x0c90, 0x2071, 0x1883,
@@ -329,20 +329,20 @@ unsigned short risc_code01[] = {
 	0x02b8, 0x9982, 0x0440, 0x0278, 0x9982, 0x0492, 0x0288, 0x9982,
 	0x0800, 0x1270, 0x0040, 0x9982, 0x0800, 0x0250, 0x2071, 0x1883,
 	0x7010, 0x9902, 0x1228, 0x9085, 0x0001, 0x001e, 0x00ee, 0x0005,
-	0x9006, 0x0cd8, 0x00e6, 0x2071, 0x19e9, 0x7007, 0x0000, 0x9006,
+	0x9006, 0x0cd8, 0x00e6, 0x2071, 0x19e8, 0x7007, 0x0000, 0x9006,
 	0x701e, 0x7022, 0x7002, 0x2071, 0x0000, 0x7010, 0x9085, 0x8044,
 	0x7012, 0x2071, 0x0080, 0x9006, 0x20a9, 0x0040, 0x7022, 0x1f04,
 	0x10ce, 0x702b, 0x0020, 0x00ee, 0x0005, 0x0126, 0x2091, 0x8000,
-	0x00e6, 0xa06f, 0x0000, 0x2071, 0x19e9, 0x701c, 0x9088, 0x19f3,
+	0x00e6, 0xa06f, 0x0000, 0x2071, 0x19e8, 0x701c, 0x9088, 0x19f2,
 	0x280a, 0x8000, 0x9084, 0x003f, 0x701e, 0x7120, 0x9106, 0x090c,
 	0x0db4, 0x7004, 0x9005, 0x1128, 0x00f6, 0x2079, 0x0080, 0x00a9,
 	0x00fe, 0x00ee, 0x012e, 0x0005, 0x0126, 0x2091, 0x8000, 0x00e6,
-	0x2071, 0x19e9, 0x7004, 0x9005, 0x1128, 0x00f6, 0x2079, 0x0080,
+	0x2071, 0x19e8, 0x7004, 0x9005, 0x1128, 0x00f6, 0x2079, 0x0080,
 	0x0021, 0x00fe, 0x00ee, 0x012e, 0x0005, 0x7004, 0x9086, 0x0000,
 	0x1110, 0x7007, 0x0006, 0x7000, 0x0002, 0x1117, 0x1115, 0x1115,
 	0x1115, 0x128e, 0x128e, 0x128e, 0x128e, 0x080c, 0x0db4, 0x701c,
 	0x7120, 0x9106, 0x1148, 0x792c, 0x9184, 0x0001, 0x1120, 0xd1fc,
-	0x1110, 0x7007, 0x0000, 0x0005, 0x0096, 0x9180, 0x19f3, 0x2004,
+	0x1110, 0x7007, 0x0000, 0x0005, 0x0096, 0x9180, 0x19f2, 0x2004,
 	0x700a, 0x2048, 0x8108, 0x918c, 0x003f, 0x7122, 0x782b, 0x0026,
 	0xa88c, 0x7802, 0xa890, 0x7806, 0xa894, 0x780a, 0xa898, 0x780e,
 	0xa878, 0x700e, 0xa870, 0x7016, 0xa874, 0x701a, 0xa868, 0x009e,
@@ -355,8 +355,8 @@ unsigned short risc_code01[] = {
 	0x0040, 0x9182, 0x0040, 0x1210, 0x2110, 0x9006, 0x700e, 0x22a8,
 	0x4006, 0x8203, 0x7812, 0x782b, 0x0020, 0x3300, 0x701a, 0x782b,
 	0x0001, 0x015e, 0x014e, 0x013e, 0x002e, 0x001e, 0x0005, 0x2009,
-	0x19e9, 0x2104, 0xc095, 0x200a, 0x080c, 0x10f4, 0x0005, 0x0016,
-	0x00e6, 0x2071, 0x19e9, 0x00f6, 0x2079, 0x0080, 0x792c, 0xd1bc,
+	0x19e8, 0x2104, 0xc095, 0x200a, 0x080c, 0x10f4, 0x0005, 0x0016,
+	0x00e6, 0x2071, 0x19e8, 0x00f6, 0x2079, 0x0080, 0x792c, 0xd1bc,
 	0x190c, 0x0dad, 0x782b, 0x0002, 0xd1fc, 0x0120, 0x918c, 0x0700,
 	0x7004, 0x0023, 0x00fe, 0x00ee, 0x001e, 0x0005, 0x1105, 0x11ad,
 	0x11e1, 0x0db4, 0x0db4, 0x129a, 0x0db4, 0x918c, 0x0700, 0x1550,
@@ -377,1762 +377,1764 @@ unsigned short risc_code01[] = {
 	0x080f, 0x008e, 0x00de, 0x009e, 0x080c, 0x10f4, 0x0005, 0x00de,
 	0x009e, 0x080c, 0x10f4, 0x0005, 0xa8a8, 0xd08c, 0x0005, 0x0096,
 	0xa0a0, 0x904d, 0x090c, 0x0db4, 0xa06c, 0x908e, 0x0100, 0x0130,
-	0xa87b, 0x0030, 0xa883, 0x0000, 0xa897, 0x4002, 0x080c, 0x687f,
+	0xa87b, 0x0030, 0xa883, 0x0000, 0xa897, 0x4002, 0x080c, 0x6884,
 	0xa09f, 0x0000, 0xa0a3, 0x0000, 0x2848, 0x080c, 0x101d, 0x009e,
 	0x0005, 0x00a6, 0xa0a0, 0x904d, 0x090c, 0x0db4, 0xa06c, 0x908e,
 	0x0100, 0x0128, 0xa87b, 0x0001, 0xa883, 0x0000, 0x00c0, 0xa80c,
 	0x2050, 0xb004, 0x9005, 0x0198, 0xa80e, 0x2050, 0x8006, 0x8006,
 	0x8007, 0x908c, 0x003f, 0x9084, 0xffc0, 0x9080, 0x0002, 0xa076,
 	0xa172, 0xb000, 0xa07a, 0x2810, 0x080c, 0x10d5, 0x00e8, 0xa97c,
-	0xa894, 0x0016, 0x0006, 0x080c, 0x687f, 0x000e, 0x001e, 0xd1fc,
-	0x1138, 0xd1f4, 0x0128, 0x00c6, 0x2060, 0x080c, 0x9e32, 0x00ce,
+	0xa894, 0x0016, 0x0006, 0x080c, 0x6884, 0x000e, 0x001e, 0xd1fc,
+	0x1138, 0xd1f4, 0x0128, 0x00c6, 0x2060, 0x080c, 0x9e42, 0x00ce,
 	0x7008, 0x2048, 0xa89f, 0x0000, 0xa8a3, 0x0000, 0x080c, 0x101d,
 	0x7007, 0x0000, 0x080c, 0x10f4, 0x00ae, 0x0005, 0x0126, 0x2091,
 	0x8000, 0x782b, 0x1001, 0x7007, 0x0005, 0x7000, 0xc094, 0x7002,
 	0x012e, 0x0005, 0x7007, 0x0000, 0x080c, 0x1105, 0x0005, 0x0126,
-	0x2091, 0x2200, 0x2079, 0x0300, 0x2071, 0x1a33, 0x7003, 0x0000,
+	0x2091, 0x2200, 0x2079, 0x0300, 0x2071, 0x1a32, 0x7003, 0x0000,
 	0x78bf, 0x00f6, 0x781b, 0x4800, 0x00c1, 0x7803, 0x0003, 0x780f,
-	0x0000, 0x20a9, 0x0254, 0x2061, 0xd8e3, 0x2c0d, 0x7912, 0xe104,
+	0x0000, 0x20a9, 0x0254, 0x2061, 0xd904, 0x2c0d, 0x7912, 0xe104,
 	0x9ce0, 0x0002, 0x7916, 0x1f04, 0x12b5, 0x7807, 0x0007, 0x7803,
 	0x0000, 0x7803, 0x0001, 0x012e, 0x0005, 0x00c6, 0x7803, 0x0000,
-	0x7808, 0xd09c, 0x0110, 0x7820, 0x0cd8, 0x2001, 0x1a34, 0x2003,
+	0x7808, 0xd09c, 0x0110, 0x7820, 0x0cd8, 0x2001, 0x1a33, 0x2003,
 	0x0000, 0x78ab, 0x0004, 0x78ac, 0xd0ac, 0x1de8, 0x78ab, 0x0002,
 	0x7807, 0x0007, 0x7827, 0x0030, 0x782b, 0x0400, 0x7827, 0x0031,
-	0x782b, 0x1a52, 0x781f, 0xff00, 0x781b, 0xb700, 0x2001, 0x0200,
-	0x2004, 0xd0dc, 0x0110, 0x781f, 0x0303, 0x2061, 0x1a52, 0x602f,
+	0x782b, 0x1a51, 0x781f, 0xff00, 0x781b, 0xb700, 0x2001, 0x0200,
+	0x2004, 0xd0dc, 0x0110, 0x781f, 0x0303, 0x2061, 0x1a51, 0x602f,
 	0x1cd0, 0x2001, 0x1819, 0x2004, 0x9082, 0x1cd0, 0x6032, 0x603b,
-	0x1f26, 0x2001, 0x3138, 0xd0fc, 0x190c, 0x0db4, 0x2001, 0x0003,
-	0x2004, 0xd0d4, 0x1118, 0x783f, 0x3138, 0x0020, 0x9084, 0xc000,
-	0x783f, 0xb138, 0x00ce, 0x0005, 0x0126, 0x2091, 0x2200, 0x7908,
+	0x1f28, 0x2001, 0x313a, 0xd0fc, 0x190c, 0x0db4, 0x2001, 0x0003,
+	0x2004, 0xd0d4, 0x1118, 0x783f, 0x313a, 0x0020, 0x9084, 0xc000,
+	0x783f, 0xb13a, 0x00ce, 0x0005, 0x0126, 0x2091, 0x2200, 0x7908,
 	0x9184, 0x0070, 0x190c, 0x0dad, 0xd19c, 0x0158, 0x7820, 0x908c,
 	0xf000, 0x15e8, 0x908a, 0x0024, 0x1a0c, 0x0db4, 0x0023, 0x012e,
 	0x0005, 0x012e, 0x0005, 0x1347, 0x1347, 0x135e, 0x1363, 0x1367,
-	0x136c, 0x1394, 0x1398, 0x13a6, 0x13aa, 0x1347, 0x1434, 0x1438,
-	0x149b, 0x1347, 0x1347, 0x1347, 0x1347, 0x1347, 0x1347, 0x1347,
+	0x136c, 0x1394, 0x1398, 0x13a6, 0x13aa, 0x1347, 0x1436, 0x143a,
+	0x149d, 0x1347, 0x1347, 0x1347, 0x1347, 0x1347, 0x1347, 0x1347,
 	0x1347, 0x1347, 0x1347, 0x1347, 0x1347, 0x1347, 0x136e, 0x1347,
 	0x1347, 0x1347, 0x1347, 0x1347, 0x1347, 0x134b, 0x1349, 0x080c,
-	0x0db4, 0x080c, 0x0dad, 0x080c, 0x14a2, 0x2009, 0x1a4b, 0x2104,
-	0x8000, 0x200a, 0x080c, 0x7a07, 0x080c, 0x1958, 0x0005, 0x2009,
-	0x0048, 0x2060, 0x080c, 0x9eac, 0x012e, 0x0005, 0x7004, 0xc085,
+	0x0db4, 0x080c, 0x0dad, 0x080c, 0x14a4, 0x2009, 0x1a4a, 0x2104,
+	0x8000, 0x200a, 0x080c, 0x79f0, 0x080c, 0x195a, 0x0005, 0x2009,
+	0x0048, 0x2060, 0x080c, 0x9ebc, 0x012e, 0x0005, 0x7004, 0xc085,
 	0xc0b5, 0x7006, 0x0005, 0x7004, 0xc085, 0x7006, 0x0005, 0x080c,
-	0x14a2, 0x080c, 0x15de, 0x0005, 0x080c, 0x0db4, 0x080c, 0x14a2,
+	0x14a4, 0x080c, 0x15e0, 0x0005, 0x080c, 0x0db4, 0x080c, 0x14a4,
 	0x2060, 0x6014, 0x0096, 0x2048, 0xa83b, 0xffff, 0x009e, 0x2009,
-	0x0048, 0x080c, 0x9eac, 0x2001, 0x015d, 0x2003, 0x0000, 0x2009,
+	0x0048, 0x080c, 0x9ebc, 0x2001, 0x015d, 0x2003, 0x0000, 0x2009,
 	0x03e8, 0x8109, 0x0160, 0x2001, 0x0201, 0x2004, 0x9005, 0x0dc8,
-	0x2001, 0x0218, 0x2004, 0xd0ec, 0x1110, 0x080c, 0x14a7, 0x2001,
+	0x2001, 0x0218, 0x2004, 0xd0ec, 0x1110, 0x080c, 0x14a9, 0x2001,
 	0x0307, 0x2003, 0x8000, 0x0005, 0x7004, 0xc095, 0x7006, 0x0005,
-	0x080c, 0x14a2, 0x2060, 0x6014, 0x0096, 0x2048, 0xa83b, 0xffff,
-	0x009e, 0x2009, 0x0048, 0x080c, 0x9eac, 0x0005, 0x080c, 0x14a2,
-	0x080c, 0x0db4, 0x080c, 0x14a2, 0x080c, 0x141f, 0x7827, 0x0018,
+	0x080c, 0x14a4, 0x2060, 0x6014, 0x0096, 0x2048, 0xa83b, 0xffff,
+	0x009e, 0x2009, 0x0048, 0x080c, 0x9ebc, 0x0005, 0x080c, 0x14a4,
+	0x080c, 0x0db4, 0x080c, 0x14a4, 0x080c, 0x1421, 0x7827, 0x0018,
 	0x79ac, 0xd1dc, 0x0540, 0x7827, 0x0015, 0x7828, 0x782b, 0x0000,
 	0x9065, 0x0138, 0x2001, 0x020d, 0x2003, 0x0050, 0x2003, 0x0020,
 	0x0400, 0x7004, 0x9005, 0x1180, 0x78ab, 0x0004, 0x7827, 0x0018,
 	0x782b, 0x0000, 0xd1bc, 0x090c, 0x0db4, 0x2001, 0x020d, 0x2003,
-	0x0050, 0x2003, 0x0020, 0x0480, 0x78ab, 0x0004, 0x7803, 0x0001,
-	0x080c, 0x1438, 0x0005, 0x7828, 0x782b, 0x0000, 0x9065, 0x090c,
-	0x0db4, 0x6014, 0x2048, 0x78ab, 0x0004, 0x918c, 0x0700, 0x0198,
-	0x080c, 0x7a07, 0x080c, 0x1958, 0x080c, 0xbb17, 0x0158, 0xa9ac,
+	0x0050, 0x2003, 0x0020, 0x0490, 0x78ab, 0x0004, 0x7803, 0x0001,
+	0x080c, 0x143a, 0x0005, 0x7828, 0x782b, 0x0000, 0x9065, 0x090c,
+	0x0db4, 0x6014, 0x2048, 0x78ab, 0x0004, 0x918c, 0x0700, 0x01a8,
+	0x080c, 0x79f0, 0x080c, 0x195a, 0x080c, 0xbb2c, 0x0158, 0xa9ac,
 	0xa936, 0xa9b0, 0xa93a, 0xa83f, 0xffff, 0xa843, 0xffff, 0xa880,
-	0xc0bd, 0xa882, 0x0005, 0x6010, 0x00b6, 0x2058, 0xb800, 0x00be,
-	0xd0bc, 0x6024, 0x190c, 0xbefc, 0x2029, 0x00c8, 0x8529, 0x0128,
-	0x2001, 0x0201, 0x2004, 0x9005, 0x0dc8, 0x7dbc, 0x080c, 0xd88c,
-	0xd5a4, 0x1118, 0x080c, 0x14a7, 0x0005, 0x080c, 0x7a07, 0x080c,
-	0x1958, 0x0005, 0x781f, 0x0300, 0x7803, 0x0001, 0x0005, 0x0016,
-	0x0066, 0x0076, 0x00f6, 0x2079, 0x0300, 0x7908, 0x918c, 0x0007,
-	0x9186, 0x0003, 0x0120, 0x2001, 0x0016, 0x080c, 0x1518, 0x00fe,
-	0x007e, 0x006e, 0x001e, 0x0005, 0x7004, 0xc09d, 0x7006, 0x0005,
-	0x7104, 0x9184, 0x0004, 0x190c, 0x0db4, 0xd184, 0x1189, 0xd19c,
-	0x0158, 0xc19c, 0x7106, 0x2001, 0x020d, 0x2003, 0x0050, 0x2003,
-	0x0020, 0x080c, 0x14a7, 0x0005, 0x81ff, 0x190c, 0x0db4, 0x0005,
-	0xc184, 0xd1b4, 0xc1b4, 0x7106, 0x0016, 0x00e6, 0x15e0, 0x2071,
-	0x0200, 0x080c, 0x15d2, 0x6014, 0x9005, 0x05a8, 0x0096, 0x2048,
-	0xa864, 0x009e, 0x9084, 0x00ff, 0x908e, 0x0029, 0x0160, 0x908e,
-	0x0048, 0x1548, 0x601c, 0xd084, 0x11d8, 0x00f6, 0x2c78, 0x080c,
-	0x1648, 0x00fe, 0x00a8, 0x00f6, 0x2c78, 0x080c, 0x1790, 0x00fe,
-	0x2009, 0x01f4, 0x8109, 0x0160, 0x2001, 0x0201, 0x2004, 0x9005,
-	0x0dc8, 0x2001, 0x0218, 0x2004, 0xd0ec, 0x1110, 0x0401, 0x0040,
-	0x2001, 0x020d, 0x2003, 0x0020, 0x080c, 0x12c5, 0x7803, 0x0001,
-	0x00ee, 0x001e, 0x0005, 0x2001, 0x020d, 0x2003, 0x0050, 0x2003,
-	0x0020, 0x0069, 0x0ca8, 0x0031, 0x2060, 0x2009, 0x0053, 0x080c,
-	0x9eac, 0x0005, 0x7808, 0xd09c, 0x0de8, 0x7820, 0x0005, 0x080c,
-	0x141f, 0x00d6, 0x2069, 0x0200, 0x2009, 0x01f4, 0x8109, 0x0510,
-	0x6804, 0x9005, 0x0dd8, 0x2001, 0x015d, 0x2003, 0x0000, 0x79bc,
-	0xd1a4, 0x1528, 0x79b8, 0x918c, 0x0fff, 0x0180, 0x9182, 0x0841,
-	0x1268, 0x9188, 0x0007, 0x918c, 0x0ff8, 0x810c, 0x810c, 0x810c,
-	0x080c, 0x150a, 0x6827, 0x0001, 0x8109, 0x1dd0, 0x04d9, 0x6827,
-	0x0002, 0x04c1, 0x6804, 0x9005, 0x1130, 0x682c, 0xd0e4, 0x1500,
-	0x6804, 0x9005, 0x0de8, 0x79b8, 0xd1ec, 0x1130, 0x08c0, 0x080c,
-	0x7a07, 0x080c, 0x1958, 0x0090, 0x7827, 0x0015, 0x782b, 0x0000,
-	0x7827, 0x0018, 0x782b, 0x0000, 0x2001, 0x020d, 0x2003, 0x0020,
-	0x2001, 0x0307, 0x2003, 0x0300, 0x7803, 0x0001, 0x00de, 0x0005,
-	0x682c, 0x9084, 0x5400, 0x9086, 0x5400, 0x0d30, 0x7827, 0x0015,
-	0x782b, 0x0000, 0x7803, 0x0001, 0x6800, 0x9085, 0x1800, 0x6802,
-	0x00de, 0x0005, 0x6824, 0x9084, 0x0003, 0x1de0, 0x0005, 0x2001,
-	0x0030, 0x2c08, 0x621c, 0x0021, 0x7830, 0x9086, 0x0041, 0x0005,
-	0x00f6, 0x2079, 0x0300, 0x0006, 0x7808, 0xd09c, 0x0140, 0x0016,
-	0x0026, 0x00c6, 0x080c, 0x130c, 0x00ce, 0x002e, 0x001e, 0x000e,
-	0x0006, 0x7832, 0x7936, 0x7a3a, 0x781b, 0x8080, 0x0059, 0x1118,
-	0x000e, 0x00fe, 0x0005, 0x000e, 0x792c, 0x3900, 0x8000, 0x2004,
-	0x080c, 0x0db4, 0x2009, 0x180c, 0x2104, 0xc0f4, 0x200a, 0x2009,
-	0xff00, 0x8109, 0x0904, 0x1596, 0x7a18, 0x9284, 0x0030, 0x0904,
-	0x1591, 0x9284, 0x0048, 0x9086, 0x0008, 0x1904, 0x1591, 0x2001,
-	0x0109, 0x2004, 0xd08c, 0x01f0, 0x0006, 0x01c6, 0x01d6, 0x0136,
-	0x0146, 0x0156, 0x0126, 0x2091, 0x2800, 0x00f6, 0x0026, 0x0016,
-	0x2009, 0x1a4d, 0x2104, 0x8000, 0x0208, 0x200a, 0x080c, 0x83aa,
-	0x001e, 0x002e, 0x00fe, 0x012e, 0x015e, 0x014e, 0x013e, 0x01de,
-	0x01ce, 0x000e, 0x2001, 0x009b, 0x2004, 0xd0fc, 0x01d0, 0x0006,
-	0x0126, 0x01c6, 0x01d6, 0x0136, 0x0146, 0x0156, 0x00f6, 0x0016,
-	0x2009, 0x1a4e, 0x2104, 0x8000, 0x0208, 0x200a, 0x080c, 0x1d4a,
-	0x001e, 0x00fe, 0x015e, 0x014e, 0x013e, 0x01de, 0x01ce, 0x012e,
-	0x000e, 0x7818, 0xd0bc, 0x1904, 0x1541, 0x0005, 0x2001, 0x180c,
-	0x2004, 0xd0f4, 0x1528, 0x7a18, 0x9284, 0x0030, 0x0508, 0x9284,
-	0x0048, 0x9086, 0x0008, 0x11e0, 0x2001, 0x19c7, 0x2004, 0x9005,
-	0x01b8, 0x2001, 0x1a36, 0x2004, 0x9086, 0x0000, 0x0188, 0x2009,
-	0x1a4c, 0x2104, 0x8000, 0x0208, 0x200a, 0x080c, 0x9430, 0x2009,
-	0x180c, 0x2104, 0xc0f5, 0x200a, 0x2009, 0xff00, 0x0804, 0x1541,
-	0x9085, 0x0001, 0x0005, 0x7832, 0x7936, 0x7a3a, 0x781b, 0x8080,
-	0x080c, 0x153a, 0x1108, 0x0005, 0x792c, 0x3900, 0x8000, 0x2004,
-	0x080c, 0x0db4, 0x7037, 0x0001, 0x7150, 0x7037, 0x0002, 0x7050,
-	0x2060, 0xd1bc, 0x1110, 0x7054, 0x2060, 0x0005, 0x00e6, 0x0016,
-	0x2071, 0x0200, 0x0c79, 0x6124, 0xd1dc, 0x01f8, 0x701c, 0xd08c,
-	0x0904, 0x163d, 0x7017, 0x0000, 0x2001, 0x0264, 0x2004, 0xd0bc,
-	0x0904, 0x163d, 0x2001, 0x0268, 0x00c6, 0x2064, 0x6104, 0x6038,
-	0x00ce, 0x918e, 0x0039, 0x1904, 0x163d, 0x9c06, 0x15f0, 0x0126,
-	0x2091, 0x2600, 0x080c, 0x794e, 0x012e, 0x7358, 0x745c, 0x6014,
-	0x905d, 0x0598, 0x2b48, 0x6010, 0x00b6, 0x2058, 0xb800, 0x00be,
-	0xd0bc, 0x190c, 0xbed7, 0xab42, 0xac3e, 0x2001, 0x1875, 0x2004,
-	0xd0b4, 0x1170, 0x601c, 0xd0e4, 0x1158, 0x6010, 0x00b6, 0x2058,
-	0xb800, 0x00be, 0xd0bc, 0x1120, 0xa83b, 0x7fff, 0xa837, 0xffff,
-	0x080c, 0x1f46, 0x1190, 0x080c, 0x17eb, 0x2a00, 0xa816, 0x0130,
-	0x2800, 0xa80e, 0x2c05, 0xa80a, 0x2c00, 0xa812, 0x7037, 0x0020,
-	0x781f, 0x0300, 0x001e, 0x00ee, 0x0005, 0x7037, 0x0050, 0x7037,
-	0x0020, 0x001e, 0x00ee, 0x080c, 0x14a7, 0x0005, 0x080c, 0x0db4,
-	0x0016, 0x2009, 0x00a0, 0x8109, 0xa001, 0xa001, 0xa001, 0x1dd8,
-	0x001e, 0x2ff0, 0x0126, 0x2091, 0x2200, 0x00c6, 0x3e60, 0x6014,
-	0x2048, 0x2940, 0x903e, 0x2730, 0xa864, 0x2068, 0xa81a, 0x9d84,
-	0x000f, 0x9088, 0x1f26, 0x2165, 0x0002, 0x167c, 0x16c9, 0x167c,
-	0x167c, 0x167c, 0x16ab, 0x167c, 0x1680, 0x1675, 0x16c0, 0x167c,
-	0x167c, 0x167c, 0x1785, 0x1694, 0x168a, 0xa964, 0x918c, 0x00ff,
-	0x918e, 0x0048, 0x0904, 0x16c0, 0x9085, 0x0001, 0x0804, 0x177c,
-	0xa87c, 0xd0bc, 0x0dc8, 0xa890, 0xa842, 0xa88c, 0xa83e, 0xa888,
-	0x0804, 0x16d0, 0xa87c, 0xd0bc, 0x0d78, 0xa890, 0xa842, 0xa88c,
-	0xa83e, 0xa888, 0x0804, 0x171f, 0xa87c, 0xd0bc, 0x0d28, 0xa890,
-	0xa842, 0xa88c, 0xa83e, 0xa804, 0x9045, 0x090c, 0x0db4, 0xa164,
-	0xa91a, 0x91ec, 0x000f, 0x9d80, 0x1f26, 0x2065, 0xa888, 0xd19c,
-	0x1904, 0x171f, 0x0428, 0xa87c, 0xd0ac, 0x0970, 0xa804, 0x9045,
-	0x090c, 0x0db4, 0xa164, 0xa91a, 0x91ec, 0x000f, 0x9d80, 0x1f26,
-	0x2065, 0x9006, 0xa842, 0xa83e, 0xd19c, 0x1904, 0x171f, 0x0080,
-	0xa87c, 0xd0ac, 0x0904, 0x167c, 0x9006, 0xa842, 0xa83e, 0x0804,
-	0x171f, 0xa87c, 0xd0ac, 0x0904, 0x167c, 0x9006, 0xa842, 0xa83e,
-	0x2c05, 0x908a, 0x0036, 0x1a0c, 0x0db4, 0x9082, 0x001b, 0x0002,
-	0x16f3, 0x16f3, 0x16f5, 0x16f3, 0x16f3, 0x16f3, 0x16fb, 0x16f3,
-	0x16f3, 0x16f3, 0x1701, 0x16f3, 0x16f3, 0x16f3, 0x1707, 0x16f3,
-	0x16f3, 0x16f3, 0x170d, 0x16f3, 0x16f3, 0x16f3, 0x1713, 0x16f3,
-	0x16f3, 0x16f3, 0x1719, 0x080c, 0x0db4, 0xa574, 0xa478, 0xa37c,
-	0xa280, 0x0804, 0x1764, 0xa584, 0xa488, 0xa38c, 0xa290, 0x0804,
-	0x1764, 0xa594, 0xa498, 0xa39c, 0xa2a0, 0x0804, 0x1764, 0xa5a4,
-	0xa4a8, 0xa3ac, 0xa2b0, 0x0804, 0x1764, 0xa5b4, 0xa4b8, 0xa3bc,
-	0xa2c0, 0x0804, 0x1764, 0xa5c4, 0xa4c8, 0xa3cc, 0xa2d0, 0x0804,
-	0x1764, 0xa5d4, 0xa4d8, 0xa3dc, 0xa2e0, 0x0804, 0x1764, 0x2c05,
-	0x908a, 0x0034, 0x1a0c, 0x0db4, 0x9082, 0x001b, 0x0002, 0x1742,
-	0x1740, 0x1740, 0x1740, 0x1740, 0x1740, 0x1749, 0x1740, 0x1740,
-	0x1740, 0x1740, 0x1740, 0x1750, 0x1740, 0x1740, 0x1740, 0x1740,
-	0x1740, 0x1757, 0x1740, 0x1740, 0x1740, 0x1740, 0x1740, 0x175e,
-	0x080c, 0x0db4, 0xa56c, 0xa470, 0xa774, 0xa678, 0xa37c, 0xa280,
-	0x00d8, 0xa584, 0xa488, 0xa78c, 0xa690, 0xa394, 0xa298, 0x00a0,
-	0xa59c, 0xa4a0, 0xa7a4, 0xa6a8, 0xa3ac, 0xa2b0, 0x0068, 0xa5b4,
-	0xa4b8, 0xa7bc, 0xa6c0, 0xa3c4, 0xa2c8, 0x0030, 0xa5cc, 0xa4d0,
-	0xa7d4, 0xa6d8, 0xa3dc, 0xa2e0, 0xab2e, 0xaa32, 0xad1e, 0xac22,
-	0xaf26, 0xae2a, 0xa988, 0x8c60, 0x2c1d, 0xa8ac, 0xaab0, 0xa836,
-	0xaa3a, 0x8109, 0xa916, 0x1158, 0x3e60, 0x601c, 0xc085, 0x601e,
-	0xa87c, 0xc0dd, 0xa87e, 0x9006, 0x00ce, 0x012e, 0x0005, 0x2800,
-	0xa80e, 0xab0a, 0x2c00, 0xa812, 0x0c78, 0x0804, 0x167c, 0x0016,
-	0x2009, 0x00a0, 0x8109, 0xa001, 0xa001, 0xa001, 0x1dd8, 0x001e,
-	0x2ff0, 0x0126, 0x2091, 0x2200, 0x00c6, 0x3e60, 0x6014, 0x2048,
-	0x2940, 0xa80e, 0x2061, 0x1f21, 0xa813, 0x1f21, 0x2c05, 0xa80a,
-	0xa964, 0xa91a, 0xa87c, 0xd0ac, 0x090c, 0x0db4, 0x9006, 0xa842,
-	0xa83e, 0x2c05, 0x908a, 0x0034, 0x1a0c, 0x0db4, 0xadcc, 0xacd0,
-	0xafd4, 0xaed8, 0xabdc, 0xaae0, 0xab2e, 0xaa32, 0xad1e, 0xac22,
-	0xaf26, 0xae2a, 0xa8ac, 0xaab0, 0xa836, 0xaa3a, 0xa988, 0xa864,
-	0x9084, 0x00ff, 0x9086, 0x0008, 0x1120, 0x8109, 0xa916, 0x0128,
-	0x0078, 0x918a, 0x0002, 0xa916, 0x1158, 0x3e60, 0x601c, 0xc085,
-	0x601e, 0xa87c, 0xc0dd, 0xa87e, 0x9006, 0x00ce, 0x012e, 0x0005,
-	0xa804, 0x9045, 0x090c, 0x0db4, 0xa80e, 0xa064, 0xa81a, 0x9084,
-	0x000f, 0x9080, 0x1f26, 0x2015, 0x82ff, 0x090c, 0x0db4, 0xaa12,
-	0x2205, 0xa80a, 0x0c10, 0x903e, 0x2730, 0xa880, 0xd0fc, 0x1190,
-	0x2d00, 0x0002, 0x18e0, 0x1842, 0x1842, 0x18e0, 0x18e0, 0x18da,
-	0x18e0, 0x1842, 0x1891, 0x1891, 0x1891, 0x18e0, 0x18e0, 0x18e0,
-	0x18d7, 0x1891, 0xc0fc, 0xa882, 0xab2c, 0xaa30, 0xad1c, 0xac20,
-	0xdd9c, 0x0904, 0x18e2, 0x2c05, 0x908a, 0x0034, 0x1a0c, 0x0db4,
-	0x9082, 0x001b, 0x0002, 0x182e, 0x182c, 0x182c, 0x182c, 0x182c,
-	0x182c, 0x1832, 0x182c, 0x182c, 0x182c, 0x182c, 0x182c, 0x1836,
-	0x182c, 0x182c, 0x182c, 0x182c, 0x182c, 0x183a, 0x182c, 0x182c,
-	0x182c, 0x182c, 0x182c, 0x183e, 0x080c, 0x0db4, 0xa774, 0xa678,
-	0x0804, 0x18e2, 0xa78c, 0xa690, 0x0804, 0x18e2, 0xa7a4, 0xa6a8,
-	0x0804, 0x18e2, 0xa7bc, 0xa6c0, 0x0804, 0x18e2, 0xa7d4, 0xa6d8,
-	0x0804, 0x18e2, 0x2c05, 0x908a, 0x0036, 0x1a0c, 0x0db4, 0x9082,
-	0x001b, 0x0002, 0x1865, 0x1865, 0x1867, 0x1865, 0x1865, 0x1865,
-	0x186d, 0x1865, 0x1865, 0x1865, 0x1873, 0x1865, 0x1865, 0x1865,
-	0x1879, 0x1865, 0x1865, 0x1865, 0x187f, 0x1865, 0x1865, 0x1865,
-	0x1885, 0x1865, 0x1865, 0x1865, 0x188b, 0x080c, 0x0db4, 0xa574,
-	0xa478, 0xa37c, 0xa280, 0x0804, 0x18e2, 0xa584, 0xa488, 0xa38c,
-	0xa290, 0x0804, 0x18e2, 0xa594, 0xa498, 0xa39c, 0xa2a0, 0x0804,
-	0x18e2, 0xa5a4, 0xa4a8, 0xa3ac, 0xa2b0, 0x0804, 0x18e2, 0xa5b4,
-	0xa4b8, 0xa3bc, 0xa2c0, 0x0804, 0x18e2, 0xa5c4, 0xa4c8, 0xa3cc,
-	0xa2d0, 0x0804, 0x18e2, 0xa5d4, 0xa4d8, 0xa3dc, 0xa2e0, 0x0804,
-	0x18e2, 0x2c05, 0x908a, 0x0034, 0x1a0c, 0x0db4, 0x9082, 0x001b,
-	0x0002, 0x18b4, 0x18b2, 0x18b2, 0x18b2, 0x18b2, 0x18b2, 0x18bb,
-	0x18b2, 0x18b2, 0x18b2, 0x18b2, 0x18b2, 0x18c2, 0x18b2, 0x18b2,
-	0x18b2, 0x18b2, 0x18b2, 0x18c9, 0x18b2, 0x18b2, 0x18b2, 0x18b2,
-	0x18b2, 0x18d0, 0x080c, 0x0db4, 0xa56c, 0xa470, 0xa774, 0xa678,
-	0xa37c, 0xa280, 0x0438, 0xa584, 0xa488, 0xa78c, 0xa690, 0xa394,
-	0xa298, 0x0400, 0xa59c, 0xa4a0, 0xa7a4, 0xa6a8, 0xa3ac, 0xa2b0,
-	0x00c8, 0xa5b4, 0xa4b8, 0xa7bc, 0xa6c0, 0xa3c4, 0xa2c8, 0x0090,
-	0xa5cc, 0xa4d0, 0xa7d4, 0xa6d8, 0xa3dc, 0xa2e0, 0x0058, 0x9d86,
-	0x000e, 0x1130, 0x080c, 0x1ede, 0x1904, 0x17eb, 0x900e, 0x0050,
-	0x080c, 0x0db4, 0xab2e, 0xaa32, 0xad1e, 0xac22, 0xaf26, 0xae2a,
-	0x080c, 0x1ede, 0x0005, 0x6014, 0x2048, 0x6118, 0x810c, 0x810c,
-	0x810c, 0x81ff, 0x1118, 0xa887, 0x0001, 0x0008, 0xa986, 0x601b,
-	0x0002, 0xa974, 0xd1dc, 0x1108, 0x0005, 0xa934, 0xa88c, 0x9106,
-	0x1158, 0xa938, 0xa890, 0x9106, 0x1138, 0x601c, 0xc084, 0x601e,
-	0x2009, 0x0048, 0x0804, 0x9eac, 0x0005, 0x0126, 0x00c6, 0x2091,
-	0x2200, 0x00ce, 0x7908, 0x918c, 0x0007, 0x9186, 0x0000, 0x05b0,
-	0x9186, 0x0003, 0x0598, 0x6020, 0x6023, 0x0000, 0x0006, 0x2031,
-	0x0008, 0x00c6, 0x781f, 0x0808, 0x7808, 0xd09c, 0x0120, 0x080c,
-	0x130c, 0x8631, 0x1db8, 0x00ce, 0x781f, 0x0800, 0x2031, 0x0168,
-	0x00c6, 0x7808, 0xd09c, 0x190c, 0x130c, 0x00ce, 0x2001, 0x0038,
-	0x080c, 0x19e5, 0x7930, 0x9186, 0x0040, 0x0160, 0x9186, 0x0042,
-	0x190c, 0x0db4, 0x2001, 0x001e, 0x8001, 0x1df0, 0x8631, 0x1d40,
-	0x080c, 0x19f4, 0x000e, 0x6022, 0x012e, 0x0005, 0x080c, 0x19e1,
-	0x7827, 0x0015, 0x7828, 0x9c06, 0x1db8, 0x782b, 0x0000, 0x0ca0,
-	0x00f6, 0x2079, 0x0300, 0x7803, 0x0000, 0x78ab, 0x0004, 0x00fe,
-	0x080c, 0x6fb2, 0x11b0, 0x2001, 0x0138, 0x2003, 0x0000, 0x2001,
-	0x0160, 0x2003, 0x0000, 0x2011, 0x012c, 0xa001, 0xa001, 0x8211,
-	0x1de0, 0x0081, 0x0066, 0x2031, 0x0000, 0x080c, 0x7062, 0x006e,
-	0x0005, 0x0479, 0x0039, 0x2001, 0x0160, 0x2502, 0x2001, 0x0138,
-	0x2202, 0x0005, 0x00e6, 0x2071, 0x0200, 0x080c, 0x2a69, 0x2009,
-	0x003c, 0x080c, 0x2268, 0x2001, 0x015d, 0x2003, 0x0000, 0x7000,
-	0x9084, 0x003c, 0x1de0, 0x080c, 0x7f5d, 0x70a0, 0x70a2, 0x7098,
-	0x709a, 0x709c, 0x709e, 0x2001, 0x020d, 0x2003, 0x0020, 0x00f6,
-	0x2079, 0x0300, 0x080c, 0x12c5, 0x7803, 0x0001, 0x00fe, 0x00ee,
-	0x0005, 0x2001, 0x0138, 0x2014, 0x2003, 0x0000, 0x2001, 0x0160,
-	0x202c, 0x2003, 0x0000, 0x080c, 0x6fb2, 0x1108, 0x0005, 0x2021,
-	0x0260, 0x2001, 0x0141, 0x201c, 0xd3dc, 0x1168, 0x2001, 0x0109,
-	0x201c, 0x939c, 0x0048, 0x1160, 0x2001, 0x0111, 0x201c, 0x83ff,
-	0x1110, 0x8421, 0x1d70, 0x2001, 0x015d, 0x2003, 0x0000, 0x0005,
-	0x0046, 0x2021, 0x0019, 0x2003, 0x0048, 0xa001, 0xa001, 0x201c,
-	0x939c, 0x0048, 0x0120, 0x8421, 0x1db0, 0x004e, 0x0c60, 0x004e,
-	0x0c40, 0x601c, 0xc084, 0x601e, 0x0005, 0x2c08, 0x621c, 0x080c,
-	0x1518, 0x7930, 0x0005, 0x2c08, 0x621c, 0x080c, 0x15c3, 0x7930,
-	0x0005, 0x8001, 0x1df0, 0x0005, 0x2031, 0x0005, 0x781c, 0x9084,
-	0x0007, 0x0170, 0x2001, 0x0038, 0x0c41, 0x9186, 0x0040, 0x0904,
-	0x1a52, 0x2001, 0x001e, 0x0c69, 0x8631, 0x1d80, 0x080c, 0x0db4,
-	0x781f, 0x0202, 0x2001, 0x015d, 0x2003, 0x0000, 0x2001, 0x0b10,
-	0x0c01, 0x781c, 0xd084, 0x0110, 0x0861, 0x04e0, 0x2001, 0x0030,
-	0x0891, 0x9186, 0x0040, 0x0568, 0x781c, 0xd084, 0x1da8, 0x781f,
-	0x0101, 0x2001, 0x0014, 0x0869, 0x2001, 0x0037, 0x0821, 0x9186,
-	0x0040, 0x0140, 0x2001, 0x0030, 0x080c, 0x19eb, 0x9186, 0x0040,
-	0x190c, 0x0db4, 0x00d6, 0x2069, 0x0200, 0x692c, 0xd1f4, 0x1170,
-	0xd1c4, 0x0160, 0xd19c, 0x0130, 0x6800, 0x9085, 0x1800, 0x6802,
-	0x00de, 0x0080, 0x6908, 0x9184, 0x0007, 0x1db0, 0x00de, 0x781f,
-	0x0100, 0x791c, 0x9184, 0x0007, 0x090c, 0x0db4, 0xa001, 0xa001,
-	0x781f, 0x0200, 0x0005, 0x0126, 0x2091, 0x2400, 0x2071, 0x1a36,
-	0x2079, 0x0090, 0x012e, 0x0005, 0x9280, 0x0005, 0x2004, 0x2048,
-	0xa97c, 0xd1dc, 0x1904, 0x1ae7, 0xa964, 0x9184, 0x0007, 0x0002,
-	0x1a70, 0x1ad2, 0x1a87, 0x1a87, 0x1a87, 0x1aba, 0x1a9a, 0x1a89,
-	0x918c, 0x00ff, 0x9186, 0x0008, 0x1170, 0xa87c, 0xd0b4, 0x0904,
-	0x1d05, 0x9006, 0xa842, 0xa83e, 0xa988, 0x2900, 0xa85a, 0xa813,
-	0x1f21, 0x0804, 0x1ae3, 0x9186, 0x0048, 0x0904, 0x1ad2, 0x080c,
-	0x0db4, 0xa87c, 0xd0b4, 0x0904, 0x1d05, 0xa890, 0xa842, 0xa83a,
-	0xa88c, 0xa83e, 0xa836, 0xa8ac, 0xa846, 0xa8b0, 0xa84a, 0xa988,
-	0x0804, 0x1ada, 0xa864, 0x9084, 0x00ff, 0x9086, 0x001e, 0x1d38,
-	0xa87c, 0xd0b4, 0x0904, 0x1d05, 0xa890, 0xa842, 0xa83a, 0xa88c,
-	0xa83e, 0xa836, 0xa8ac, 0xa846, 0xa8b0, 0xa84a, 0xa804, 0xa85a,
-	0x2040, 0xa064, 0x9084, 0x000f, 0x9080, 0x1f26, 0x2005, 0xa812,
-	0xa988, 0x0448, 0x918c, 0x00ff, 0x9186, 0x0015, 0x1540, 0xa87c,
-	0xd0b4, 0x0904, 0x1d05, 0xa804, 0xa85a, 0x2040, 0xa064, 0x9084,
-	0x000f, 0x9080, 0x1f26, 0x2005, 0xa812, 0xa988, 0x9006, 0xa842,
-	0xa83e, 0x0088, 0xa87c, 0xd0b4, 0x0904, 0x1d05, 0xa988, 0x9006,
-	0xa842, 0xa83e, 0x2900, 0xa85a, 0xa864, 0x9084, 0x000f, 0x9080,
-	0x1f26, 0x2005, 0xa812, 0xa916, 0xa87c, 0xc0dd, 0xa87e, 0x0005,
-	0x00f6, 0x2079, 0x0090, 0x782c, 0xd0fc, 0x190c, 0x1d4a, 0x00e6,
-	0x2071, 0x1a36, 0x7000, 0x9005, 0x1904, 0x1b50, 0x7206, 0x9280,
-	0x0005, 0x204c, 0x9280, 0x0004, 0x2004, 0x782b, 0x0004, 0x00f6,
-	0x2079, 0x0200, 0x7803, 0x0040, 0x00fe, 0x00b6, 0x2058, 0xb86c,
-	0x7836, 0xb890, 0x00be, 0x00f6, 0x2079, 0x0200, 0x7803, 0x0040,
-	0xa001, 0xa001, 0xa001, 0xa001, 0xa001, 0xa001, 0x781a, 0x2079,
-	0x0100, 0x8004, 0x78d6, 0x00fe, 0xa814, 0x2050, 0xa858, 0x2040,
-	0xa810, 0x2060, 0xa064, 0x90ec, 0x000f, 0xa944, 0x791a, 0x7116,
-	0xa848, 0x781e, 0x701a, 0x9006, 0x700e, 0x7012, 0x7004, 0xa940,
-	0xa838, 0x9106, 0x1500, 0xa93c, 0xa834, 0x9106, 0x11e0, 0x0006,
-	0x0016, 0xa938, 0xa834, 0x9105, 0x0118, 0x001e, 0x000e, 0x0098,
-	0x001e, 0x000e, 0x8aff, 0x01c8, 0x0126, 0x2091, 0x8000, 0x2009,
-	0x0306, 0x200b, 0x0808, 0x00d9, 0x0108, 0x00c9, 0x012e, 0x9006,
-	0x00ee, 0x00fe, 0x0005, 0x0036, 0x0046, 0xab38, 0xac34, 0x080c,
-	0x1f46, 0x004e, 0x003e, 0x0d30, 0x0c98, 0x9085, 0x0001, 0x0c80,
-	0x2009, 0x0306, 0x200b, 0x4800, 0x7027, 0x0000, 0x0005, 0x0076,
-	0x0066, 0x0056, 0x0046, 0x0036, 0x0026, 0x8aff, 0x0904, 0x1cfe,
-	0x700c, 0x7214, 0x923a, 0x7010, 0x7218, 0x9203, 0x0a04, 0x1cfd,
-	0x9705, 0x0904, 0x1cfd, 0x903e, 0x2730, 0xa880, 0xd0fc, 0x1190,
-	0x2d00, 0x0002, 0x1c92, 0x1bd2, 0x1bd2, 0x1c92, 0x1c92, 0x1c6f,
-	0x1c92, 0x1bd2, 0x1c76, 0x1c21, 0x1c21, 0x1c92, 0x1c92, 0x1c92,
-	0x1c69, 0x1c21, 0xc0fc, 0xa882, 0xab2c, 0xaa30, 0xad1c, 0xac20,
-	0xdd9c, 0x0904, 0x1c94, 0x2c05, 0x908a, 0x0034, 0x1a0c, 0x0db4,
-	0x9082, 0x001b, 0x0002, 0x1bbe, 0x1bbc, 0x1bbc, 0x1bbc, 0x1bbc,
-	0x1bbc, 0x1bc2, 0x1bbc, 0x1bbc, 0x1bbc, 0x1bbc, 0x1bbc, 0x1bc6,
-	0x1bbc, 0x1bbc, 0x1bbc, 0x1bbc, 0x1bbc, 0x1bca, 0x1bbc, 0x1bbc,
-	0x1bbc, 0x1bbc, 0x1bbc, 0x1bce, 0x080c, 0x0db4, 0xa774, 0xa678,
-	0x0804, 0x1c94, 0xa78c, 0xa690, 0x0804, 0x1c94, 0xa7a4, 0xa6a8,
-	0x0804, 0x1c94, 0xa7bc, 0xa6c0, 0x0804, 0x1c94, 0xa7d4, 0xa6d8,
-	0x0804, 0x1c94, 0x2c05, 0x908a, 0x0036, 0x1a0c, 0x0db4, 0x9082,
-	0x001b, 0x0002, 0x1bf5, 0x1bf5, 0x1bf7, 0x1bf5, 0x1bf5, 0x1bf5,
-	0x1bfd, 0x1bf5, 0x1bf5, 0x1bf5, 0x1c03, 0x1bf5, 0x1bf5, 0x1bf5,
-	0x1c09, 0x1bf5, 0x1bf5, 0x1bf5, 0x1c0f, 0x1bf5, 0x1bf5, 0x1bf5,
-	0x1c15, 0x1bf5, 0x1bf5, 0x1bf5, 0x1c1b, 0x080c, 0x0db4, 0xa574,
-	0xa478, 0xa37c, 0xa280, 0x0804, 0x1c94, 0xa584, 0xa488, 0xa38c,
-	0xa290, 0x0804, 0x1c94, 0xa594, 0xa498, 0xa39c, 0xa2a0, 0x0804,
-	0x1c94, 0xa5a4, 0xa4a8, 0xa3ac, 0xa2b0, 0x0804, 0x1c94, 0xa5b4,
-	0xa4b8, 0xa3bc, 0xa2c0, 0x0804, 0x1c94, 0xa5c4, 0xa4c8, 0xa3cc,
-	0xa2d0, 0x0804, 0x1c94, 0xa5d4, 0xa4d8, 0xa3dc, 0xa2e0, 0x0804,
-	0x1c94, 0x2c05, 0x908a, 0x0034, 0x1a0c, 0x0db4, 0x9082, 0x001b,
-	0x0002, 0x1c44, 0x1c42, 0x1c42, 0x1c42, 0x1c42, 0x1c42, 0x1c4c,
-	0x1c42, 0x1c42, 0x1c42, 0x1c42, 0x1c42, 0x1c54, 0x1c42, 0x1c42,
-	0x1c42, 0x1c42, 0x1c42, 0x1c5b, 0x1c42, 0x1c42, 0x1c42, 0x1c42,
-	0x1c42, 0x1c62, 0x080c, 0x0db4, 0xa56c, 0xa470, 0xa774, 0xa678,
-	0xa37c, 0xa280, 0x0804, 0x1c94, 0xa584, 0xa488, 0xa78c, 0xa690,
-	0xa394, 0xa298, 0x0804, 0x1c94, 0xa59c, 0xa4a0, 0xa7a4, 0xa6a8,
-	0xa3ac, 0xa2b0, 0x04c8, 0xa5b4, 0xa4b8, 0xa7bc, 0xa6c0, 0xa3c4,
-	0xa2c8, 0x0490, 0xa5cc, 0xa4d0, 0xa7d4, 0xa6d8, 0xa3dc, 0xa2e0,
-	0x0458, 0xa864, 0x9084, 0x00ff, 0x9086, 0x001e, 0x1518, 0x080c,
-	0x1ede, 0x1904, 0x1b6d, 0x900e, 0x0804, 0x1cfe, 0xab64, 0x939c,
-	0x00ff, 0x9386, 0x0048, 0x1180, 0x00c6, 0x7004, 0x2060, 0x6004,
-	0x9086, 0x0043, 0x00ce, 0x0904, 0x1c21, 0xab9c, 0x9016, 0xad8c,
-	0xac90, 0xaf94, 0xae98, 0x0040, 0x9386, 0x0008, 0x0904, 0x1c21,
-	0x080c, 0x0db4, 0x080c, 0x0db4, 0x2009, 0x030f, 0x2104, 0xd0fc,
-	0x0530, 0x0066, 0x2009, 0x0306, 0x2104, 0x9084, 0x0030, 0x15c8,
-	0x2031, 0x1000, 0x200b, 0x4000, 0x2600, 0x9302, 0x928b, 0x0000,
-	0xa82e, 0xa932, 0x0278, 0x9105, 0x0168, 0x2011, 0x0000, 0x2618,
-	0x2600, 0x9500, 0xa81e, 0x9481, 0x0000, 0xa822, 0xa880, 0xc0fd,
-	0xa882, 0x0020, 0xa82f, 0x0000, 0xa833, 0x0000, 0x006e, 0x7b12,
-	0x7a16, 0x7d02, 0x7c06, 0x7f0a, 0x7e0e, 0x782b, 0x0001, 0x7000,
-	0x8000, 0x7002, 0xa83c, 0x9300, 0xa83e, 0xa840, 0x9201, 0xa842,
-	0x700c, 0x9300, 0x700e, 0x7010, 0x9201, 0x7012, 0x080c, 0x1ede,
-	0x0428, 0x2031, 0x0080, 0x9584, 0x007f, 0x0108, 0x9632, 0x7124,
-	0x7000, 0x9086, 0x0000, 0x1198, 0xc185, 0x7126, 0x2009, 0x0306,
-	0x2104, 0xd0b4, 0x1904, 0x1ca4, 0x200b, 0x4040, 0x2009, 0x1a4f,
-	0x2104, 0x8000, 0x0a04, 0x1ca4, 0x200a, 0x0804, 0x1ca4, 0xc18d,
-	0x7126, 0xd184, 0x1d58, 0x0804, 0x1ca4, 0x9006, 0x002e, 0x003e,
-	0x004e, 0x005e, 0x006e, 0x007e, 0x0005, 0x080c, 0x0db4, 0x0026,
-	0x2001, 0x0105, 0x2003, 0x0010, 0x782b, 0x0004, 0x7003, 0x0000,
-	0x7004, 0x0016, 0x080c, 0x1b60, 0x001e, 0x2060, 0x6014, 0x2048,
-	0x080c, 0xbb17, 0x0118, 0xa880, 0xc0bd, 0xa882, 0x6020, 0x9086,
-	0x0006, 0x1180, 0x2061, 0x0100, 0x62c8, 0x2001, 0x00fa, 0x8001,
-	0x1df0, 0x60c8, 0x9206, 0x1dc0, 0x60c4, 0xa89a, 0x60c8, 0xa896,
-	0x7004, 0x2060, 0x00c6, 0x080c, 0xb74a, 0x00ce, 0x2001, 0x19c7,
-	0x2004, 0x9c06, 0x1160, 0x2009, 0x0040, 0x080c, 0x2268, 0x080c,
-	0x98ea, 0x2011, 0x0000, 0x080c, 0x977b, 0x080c, 0x8a4e, 0x002e,
-	0x0804, 0x1e8e, 0x0126, 0x2091, 0x2400, 0xa858, 0x2040, 0x792c,
-	0x782b, 0x0002, 0x9184, 0x0700, 0x1904, 0x1d07, 0x7000, 0x0002,
-	0x1e8e, 0x1d5c, 0x1ddc, 0x1e8c, 0x8001, 0x7002, 0x7027, 0x0000,
-	0xd19c, 0x1158, 0x8aff, 0x0904, 0x1da9, 0x080c, 0x1b67, 0x0904,
-	0x1e8e, 0x080c, 0x1b67, 0x0804, 0x1e8e, 0x782b, 0x0004, 0xd194,
-	0x0148, 0xa880, 0xc0fc, 0xa882, 0x8aff, 0x1518, 0xa87c, 0xc0f5,
-	0xa87e, 0x00f8, 0x0026, 0x0036, 0xab3c, 0xaa40, 0x0016, 0x7910,
-	0xa82c, 0x9100, 0xa82e, 0x7914, 0xa830, 0x9101, 0xa832, 0x001e,
-	0x7810, 0x931a, 0x7814, 0x9213, 0x7800, 0xa81e, 0x7804, 0xa822,
-	0xab3e, 0xaa42, 0x003e, 0x002e, 0x080c, 0x1ef9, 0xa880, 0xc0fd,
-	0xa882, 0x2a00, 0xa816, 0x2800, 0xa85a, 0x2c00, 0xa812, 0x7003,
-	0x0000, 0x2009, 0x0306, 0x200b, 0x4800, 0x7027, 0x0000, 0x0804,
-	0x1e8e, 0x00f6, 0x0026, 0x781c, 0x0006, 0x7818, 0x0006, 0x2079,
-	0x0100, 0x7a14, 0x9284, 0x1984, 0x9085, 0x0012, 0x7816, 0x0036,
-	0x2019, 0x1000, 0x8319, 0x090c, 0x0db4, 0x7820, 0xd0bc, 0x1dd0,
-	0x003e, 0x79c8, 0x000e, 0x9102, 0x001e, 0x0006, 0x0016, 0x79c4,
-	0x000e, 0x9103, 0x78c6, 0x000e, 0x78ca, 0x9284, 0x1984, 0x9085,
-	0x0012, 0x7816, 0x002e, 0x00fe, 0x782b, 0x0008, 0x7003, 0x0000,
-	0x080c, 0x1b60, 0x0804, 0x1e8e, 0x8001, 0x7002, 0x7024, 0x8004,
-	0x7026, 0xd194, 0x0170, 0x782c, 0xd0fc, 0x1904, 0x1d4f, 0xd19c,
-	0x1904, 0x1e8a, 0x8aff, 0x0904, 0x1e8e, 0x080c, 0x1b67, 0x0804,
-	0x1e8e, 0x0026, 0x0036, 0xab3c, 0xaa40, 0x080c, 0x1ef9, 0xdd9c,
-	0x1904, 0x1e49, 0x2c05, 0x908a, 0x0036, 0x1a0c, 0x0db4, 0x9082,
-	0x001b, 0x0002, 0x1e1d, 0x1e1d, 0x1e1f, 0x1e1d, 0x1e1d, 0x1e1d,
-	0x1e25, 0x1e1d, 0x1e1d, 0x1e1d, 0x1e2b, 0x1e1d, 0x1e1d, 0x1e1d,
-	0x1e31, 0x1e1d, 0x1e1d, 0x1e1d, 0x1e37, 0x1e1d, 0x1e1d, 0x1e1d,
-	0x1e3d, 0x1e1d, 0x1e1d, 0x1e1d, 0x1e43, 0x080c, 0x0db4, 0xa07c,
-	0x931a, 0xa080, 0x9213, 0x0804, 0x1d7e, 0xa08c, 0x931a, 0xa090,
-	0x9213, 0x0804, 0x1d7e, 0xa09c, 0x931a, 0xa0a0, 0x9213, 0x0804,
-	0x1d7e, 0xa0ac, 0x931a, 0xa0b0, 0x9213, 0x0804, 0x1d7e, 0xa0bc,
-	0x931a, 0xa0c0, 0x9213, 0x0804, 0x1d7e, 0xa0cc, 0x931a, 0xa0d0,
-	0x9213, 0x0804, 0x1d7e, 0xa0dc, 0x931a, 0xa0e0, 0x9213, 0x0804,
-	0x1d7e, 0x2c05, 0x908a, 0x0034, 0x1a0c, 0x0db4, 0x9082, 0x001b,
-	0x0002, 0x1e6c, 0x1e6a, 0x1e6a, 0x1e6a, 0x1e6a, 0x1e6a, 0x1e72,
-	0x1e6a, 0x1e6a, 0x1e6a, 0x1e6a, 0x1e6a, 0x1e78, 0x1e6a, 0x1e6a,
-	0x1e6a, 0x1e6a, 0x1e6a, 0x1e7e, 0x1e6a, 0x1e6a, 0x1e6a, 0x1e6a,
-	0x1e6a, 0x1e84, 0x080c, 0x0db4, 0xa07c, 0x931a, 0xa080, 0x9213,
-	0x0804, 0x1d7e, 0xa094, 0x931a, 0xa098, 0x9213, 0x0804, 0x1d7e,
-	0xa0ac, 0x931a, 0xa0b0, 0x9213, 0x0804, 0x1d7e, 0xa0c4, 0x931a,
-	0xa0c8, 0x9213, 0x0804, 0x1d7e, 0xa0dc, 0x931a, 0xa0e0, 0x9213,
-	0x0804, 0x1d7e, 0x0804, 0x1d7a, 0x080c, 0x0db4, 0x012e, 0x0005,
-	0x00f6, 0x00e6, 0x2071, 0x1a36, 0x7000, 0x9086, 0x0000, 0x0904,
-	0x1ed9, 0x2079, 0x0090, 0x2009, 0x0207, 0x210c, 0xd194, 0x01b8,
-	0x2009, 0x020c, 0x210c, 0x9184, 0x0003, 0x0188, 0x080c, 0xd8d5,
-	0x2001, 0x0133, 0x2004, 0x9005, 0x090c, 0x0db4, 0x0016, 0x2009,
-	0x0040, 0x080c, 0x2268, 0x001e, 0x2001, 0x020c, 0x2102, 0x2009,
-	0x0206, 0x2104, 0x2009, 0x0203, 0x210c, 0x9106, 0x1120, 0x2009,
-	0x0040, 0x080c, 0x2268, 0x782c, 0xd0fc, 0x09a8, 0x080c, 0x1d4a,
-	0x7000, 0x9086, 0x0000, 0x1978, 0x782b, 0x0004, 0x782c, 0xd0ac,
-	0x1de8, 0x2009, 0x0040, 0x080c, 0x2268, 0x782b, 0x0002, 0x7003,
-	0x0000, 0x080c, 0x1b60, 0x00ee, 0x00fe, 0x0005, 0xa880, 0xd0fc,
-	0x11a8, 0x8c60, 0x2c05, 0x9005, 0x0110, 0x8a51, 0x0005, 0xa004,
-	0x9005, 0x0168, 0xa85a, 0x2040, 0xa064, 0x9084, 0x000f, 0x9080,
-	0x1f26, 0x2065, 0x8cff, 0x090c, 0x0db4, 0x8a51, 0x0005, 0x2050,
-	0x0005, 0xa880, 0xd0fc, 0x11b8, 0x8a50, 0x8c61, 0x2c05, 0x9005,
-	0x1190, 0x2800, 0x9906, 0x0120, 0xa000, 0x9005, 0x1108, 0x2900,
-	0x2040, 0xa85a, 0xa064, 0x9084, 0x000f, 0x9080, 0x1f36, 0x2065,
-	0x8cff, 0x090c, 0x0db4, 0x0005, 0x0000, 0x001d, 0x0021, 0x0025,
-	0x0029, 0x002d, 0x0031, 0x0035, 0x0000, 0x001b, 0x0021, 0x0027,
-	0x002d, 0x0033, 0x0000, 0x0000, 0x0023, 0x0000, 0x0000, 0x1f19,
-	0x1f15, 0x0000, 0x0000, 0x1f23, 0x0000, 0x1f19, 0x1f20, 0x1f20,
-	0x1f1d, 0x0000, 0x0000, 0x0000, 0x1f23, 0x1f20, 0x0000, 0x1f1b,
-	0x1f1b, 0x0000, 0x0000, 0x1f23, 0x0000, 0x1f1b, 0x1f21, 0x1f21,
-	0x1f21, 0x0000, 0x0000, 0x0000, 0x1f23, 0x1f21, 0x00c6, 0x00d6,
-	0x0086, 0xab42, 0xac3e, 0xa888, 0x9055, 0x0904, 0x2125, 0x2940,
-	0xa064, 0x90ec, 0x000f, 0x9084, 0x00ff, 0x9086, 0x0008, 0x1118,
-	0x2061, 0x1f21, 0x00d0, 0x9de0, 0x1f26, 0x9d86, 0x0007, 0x0130,
-	0x9d86, 0x000e, 0x0118, 0x9d86, 0x000f, 0x1120, 0xa08c, 0x9422,
-	0xa090, 0x931b, 0x2c05, 0x9065, 0x1140, 0x0310, 0x0804, 0x2125,
-	0xa004, 0x9045, 0x0904, 0x2125, 0x08d8, 0x2c05, 0x9005, 0x0904,
-	0x200d, 0xdd9c, 0x1904, 0x1fc9, 0x908a, 0x0036, 0x1a0c, 0x0db4,
-	0x9082, 0x001b, 0x0002, 0x1f9e, 0x1f9e, 0x1fa0, 0x1f9e, 0x1f9e,
-	0x1f9e, 0x1fa6, 0x1f9e, 0x1f9e, 0x1f9e, 0x1fac, 0x1f9e, 0x1f9e,
-	0x1f9e, 0x1fb2, 0x1f9e, 0x1f9e, 0x1f9e, 0x1fb8, 0x1f9e, 0x1f9e,
-	0x1f9e, 0x1fbe, 0x1f9e, 0x1f9e, 0x1f9e, 0x1fc4, 0x080c, 0x0db4,
-	0xa07c, 0x9422, 0xa080, 0x931b, 0x0804, 0x2003, 0xa08c, 0x9422,
-	0xa090, 0x931b, 0x0804, 0x2003, 0xa09c, 0x9422, 0xa0a0, 0x931b,
-	0x0804, 0x2003, 0xa0ac, 0x9422, 0xa0b0, 0x931b, 0x0804, 0x2003,
-	0xa0bc, 0x9422, 0xa0c0, 0x931b, 0x0804, 0x2003, 0xa0cc, 0x9422,
-	0xa0d0, 0x931b, 0x0804, 0x2003, 0xa0dc, 0x9422, 0xa0e0, 0x931b,
-	0x04d0, 0x908a, 0x0034, 0x1a0c, 0x0db4, 0x9082, 0x001b, 0x0002,
-	0x1feb, 0x1fe9, 0x1fe9, 0x1fe9, 0x1fe9, 0x1fe9, 0x1ff0, 0x1fe9,
-	0x1fe9, 0x1fe9, 0x1fe9, 0x1fe9, 0x1ff5, 0x1fe9, 0x1fe9, 0x1fe9,
-	0x1fe9, 0x1fe9, 0x1ffa, 0x1fe9, 0x1fe9, 0x1fe9, 0x1fe9, 0x1fe9,
-	0x1fff, 0x080c, 0x0db4, 0xa07c, 0x9422, 0xa080, 0x931b, 0x0098,
-	0xa094, 0x9422, 0xa098, 0x931b, 0x0070, 0xa0ac, 0x9422, 0xa0b0,
-	0x931b, 0x0048, 0xa0c4, 0x9422, 0xa0c8, 0x931b, 0x0020, 0xa0dc,
-	0x9422, 0xa0e0, 0x931b, 0x0630, 0x2300, 0x9405, 0x0160, 0x8a51,
-	0x0904, 0x2125, 0x8c60, 0x0804, 0x1f75, 0xa004, 0x9045, 0x0904,
-	0x2125, 0x0804, 0x1f50, 0x8a51, 0x0904, 0x2125, 0x8c60, 0x2c05,
-	0x9005, 0x1158, 0xa004, 0x9045, 0x0904, 0x2125, 0xa064, 0x90ec,
-	0x000f, 0x9de0, 0x1f26, 0x2c05, 0x2060, 0xa880, 0xc0fc, 0xa882,
-	0x0804, 0x211a, 0x2c05, 0x8422, 0x8420, 0x831a, 0x9399, 0x0000,
-	0xac2e, 0xab32, 0xdd9c, 0x1904, 0x20b7, 0x9082, 0x001b, 0x0002,
-	0x2053, 0x2053, 0x2055, 0x2053, 0x2053, 0x2053, 0x2063, 0x2053,
-	0x2053, 0x2053, 0x2071, 0x2053, 0x2053, 0x2053, 0x207f, 0x2053,
-	0x2053, 0x2053, 0x208d, 0x2053, 0x2053, 0x2053, 0x209b, 0x2053,
-	0x2053, 0x2053, 0x20a9, 0x080c, 0x0db4, 0xa17c, 0x2400, 0x9122,
-	0xa180, 0x2300, 0x911b, 0x0a0c, 0x0db4, 0xa074, 0x9420, 0xa078,
-	0x9319, 0x0804, 0x2115, 0xa18c, 0x2400, 0x9122, 0xa190, 0x2300,
-	0x911b, 0x0a0c, 0x0db4, 0xa084, 0x9420, 0xa088, 0x9319, 0x0804,
-	0x2115, 0xa19c, 0x2400, 0x9122, 0xa1a0, 0x2300, 0x911b, 0x0a0c,
-	0x0db4, 0xa094, 0x9420, 0xa098, 0x9319, 0x0804, 0x2115, 0xa1ac,
-	0x2400, 0x9122, 0xa1b0, 0x2300, 0x911b, 0x0a0c, 0x0db4, 0xa0a4,
-	0x9420, 0xa0a8, 0x9319, 0x0804, 0x2115, 0xa1bc, 0x2400, 0x9122,
-	0xa1c0, 0x2300, 0x911b, 0x0a0c, 0x0db4, 0xa0b4, 0x9420, 0xa0b8,
-	0x9319, 0x0804, 0x2115, 0xa1cc, 0x2400, 0x9122, 0xa1d0, 0x2300,
-	0x911b, 0x0a0c, 0x0db4, 0xa0c4, 0x9420, 0xa0c8, 0x9319, 0x0804,
-	0x2115, 0xa1dc, 0x2400, 0x9122, 0xa1e0, 0x2300, 0x911b, 0x0a0c,
-	0x0db4, 0xa0d4, 0x9420, 0xa0d8, 0x9319, 0x0804, 0x2115, 0x9082,
-	0x001b, 0x0002, 0x20d5, 0x20d3, 0x20d3, 0x20d3, 0x20d3, 0x20d3,
-	0x20e2, 0x20d3, 0x20d3, 0x20d3, 0x20d3, 0x20d3, 0x20ef, 0x20d3,
-	0x20d3, 0x20d3, 0x20d3, 0x20d3, 0x20fc, 0x20d3, 0x20d3, 0x20d3,
-	0x20d3, 0x20d3, 0x2109, 0x080c, 0x0db4, 0xa17c, 0x2400, 0x9122,
-	0xa180, 0x2300, 0x911b, 0x0a0c, 0x0db4, 0xa06c, 0x9420, 0xa070,
-	0x9319, 0x0498, 0xa194, 0x2400, 0x9122, 0xa198, 0x2300, 0x911b,
-	0x0a0c, 0x0db4, 0xa084, 0x9420, 0xa088, 0x9319, 0x0430, 0xa1ac,
-	0x2400, 0x9122, 0xa1b0, 0x2300, 0x911b, 0x0a0c, 0x0db4, 0xa09c,
-	0x9420, 0xa0a0, 0x9319, 0x00c8, 0xa1c4, 0x2400, 0x9122, 0xa1c8,
-	0x2300, 0x911b, 0x0a0c, 0x0db4, 0xa0b4, 0x9420, 0xa0b8, 0x9319,
-	0x0060, 0xa1dc, 0x2400, 0x9122, 0xa1e0, 0x2300, 0x911b, 0x0a0c,
-	0x0db4, 0xa0cc, 0x9420, 0xa0d0, 0x9319, 0xac1e, 0xab22, 0xa880,
-	0xc0fd, 0xa882, 0x2800, 0xa85a, 0x2c00, 0xa812, 0x2a00, 0xa816,
-	0x000e, 0x000e, 0x000e, 0x9006, 0x0028, 0x008e, 0x00de, 0x00ce,
-	0x9085, 0x0001, 0x0005, 0x2001, 0x0005, 0x2004, 0xd0bc, 0x190c,
-	0x0dad, 0x9084, 0x0007, 0x0002, 0x2146, 0x1d4a, 0x2146, 0x213c,
-	0x213f, 0x2142, 0x213f, 0x2142, 0x080c, 0x1d4a, 0x0005, 0x080c,
-	0x118f, 0x0005, 0x080c, 0x1d4a, 0x080c, 0x118f, 0x0005, 0x0126,
-	0x2091, 0x2600, 0x2079, 0x0200, 0x2071, 0x0260, 0x2069, 0x1800,
-	0x7817, 0x0000, 0x789b, 0x0814, 0x78a3, 0x0406, 0x789f, 0x0410,
-	0x2009, 0x013b, 0x200b, 0x0400, 0x781b, 0x0002, 0x783b, 0x001f,
-	0x7837, 0x0020, 0x7803, 0x1600, 0x012e, 0x0005, 0x2091, 0x2600,
-	0x781c, 0xd0a4, 0x190c, 0x2265, 0x7900, 0xd1dc, 0x1118, 0x9084,
-	0x0006, 0x001a, 0x9084, 0x000e, 0x0002, 0x218d, 0x2185, 0x794e,
-	0x2185, 0x2187, 0x2187, 0x2187, 0x2187, 0x7934, 0x2185, 0x2189,
-	0x2185, 0x2187, 0x2185, 0x2187, 0x2185, 0x080c, 0x0db4, 0x0031,
-	0x0020, 0x080c, 0x7934, 0x080c, 0x794e, 0x0005, 0x0006, 0x0016,
-	0x0026, 0x080c, 0xd8d5, 0x7930, 0x9184, 0x0003, 0x01c0, 0x2001,
-	0x19c7, 0x2004, 0x9005, 0x0170, 0x2001, 0x0133, 0x2004, 0x9005,
-	0x090c, 0x0db4, 0x00c6, 0x2001, 0x19c7, 0x2064, 0x080c, 0xb74a,
-	0x00ce, 0x00f8, 0x2009, 0x0040, 0x080c, 0x2268, 0x00d0, 0x9184,
-	0x0014, 0x01a0, 0x6a00, 0x9286, 0x0003, 0x0160, 0x080c, 0x6fb2,
-	0x1138, 0x080c, 0x7296, 0x080c, 0x5cd1, 0x080c, 0x6ee4, 0x0010,
-	0x080c, 0x5b90, 0x080c, 0x79fd, 0x0041, 0x0018, 0x9184, 0x9540,
-	0x1dc8, 0x002e, 0x001e, 0x000e, 0x0005, 0x00e6, 0x0036, 0x0046,
-	0x0056, 0x2071, 0x1a33, 0x080c, 0x1958, 0x005e, 0x004e, 0x003e,
-	0x00ee, 0x0005, 0x0126, 0x2091, 0x2e00, 0x2071, 0x1800, 0x7128,
-	0x2001, 0x1940, 0x2102, 0x2001, 0x1948, 0x2102, 0x2001, 0x013b,
-	0x2102, 0x2079, 0x0200, 0x2001, 0x0201, 0x789e, 0x78a3, 0x0200,
-	0x9198, 0x0007, 0x831c, 0x831c, 0x831c, 0x9398, 0x0005, 0x2320,
-	0x9182, 0x0204, 0x1230, 0x2011, 0x0008, 0x8423, 0x8423, 0x8423,
-	0x0488, 0x9182, 0x024c, 0x1240, 0x2011, 0x0007, 0x8403, 0x8003,
-	0x9400, 0x9400, 0x9420, 0x0430, 0x9182, 0x02bc, 0x1238, 0x2011,
-	0x0006, 0x8403, 0x8003, 0x9400, 0x9420, 0x00e0, 0x9182, 0x034c,
-	0x1230, 0x2011, 0x0005, 0x8403, 0x8003, 0x9420, 0x0098, 0x9182,
-	0x042c, 0x1228, 0x2011, 0x0004, 0x8423, 0x8423, 0x0058, 0x9182,
-	0x059c, 0x1228, 0x2011, 0x0003, 0x8403, 0x9420, 0x0018, 0x2011,
-	0x0002, 0x8423, 0x9482, 0x0228, 0x8002, 0x8020, 0x8301, 0x9402,
-	0x0110, 0x0208, 0x8321, 0x8217, 0x8203, 0x9405, 0x789a, 0x012e,
-	0x0005, 0x0006, 0x00d6, 0x2069, 0x0200, 0x6814, 0x9084, 0xffc0,
-	0x910d, 0x6916, 0x00de, 0x000e, 0x0005, 0x00d6, 0x2069, 0x0200,
-	0x9005, 0x6810, 0x0110, 0xc0a5, 0x0008, 0xc0a4, 0x6812, 0x00de,
-	0x0005, 0x0006, 0x00d6, 0x2069, 0x0200, 0x6810, 0x9084, 0xfff8,
-	0x910d, 0x6912, 0x00de, 0x000e, 0x0005, 0x7938, 0x080c, 0x0dad,
-	0x00f6, 0x2079, 0x0200, 0x7902, 0xa001, 0xa001, 0xa001, 0xa001,
-	0xa001, 0xa001, 0x7902, 0xa001, 0xa001, 0xa001, 0xa001, 0xa001,
-	0xa001, 0x00fe, 0x0005, 0x0126, 0x2091, 0x2800, 0x2061, 0x0100,
-	0x2071, 0x1800, 0x2009, 0x0000, 0x080c, 0x2a63, 0x080c, 0x297e,
-	0x6054, 0x8004, 0x8004, 0x8004, 0x8004, 0x9084, 0x000c, 0x6150,
-	0x918c, 0xfff3, 0x9105, 0x6052, 0x6050, 0x9084, 0xb17f, 0x9085,
-	0x2000, 0x6052, 0x2009, 0x196e, 0x2011, 0x196f, 0x6358, 0x939c,
-	0x38f0, 0x2320, 0x080c, 0x29c2, 0x1238, 0x939d, 0x4003, 0x94a5,
-	0x8603, 0x230a, 0x2412, 0x0030, 0x939d, 0x0203, 0x94a5, 0x8603,
-	0x230a, 0x2412, 0x9006, 0x080c, 0x29ad, 0x9006, 0x080c, 0x2990,
-	0x20a9, 0x0012, 0x1d04, 0x22ba, 0x2091, 0x6000, 0x1f04, 0x22ba,
-	0x602f, 0x0100, 0x602f, 0x0000, 0x6050, 0x9085, 0x0400, 0x9084,
-	0xdfff, 0x6052, 0x6024, 0x6026, 0x080c, 0x269c, 0x2009, 0x00ef,
-	0x6132, 0x6136, 0x080c, 0x26ac, 0x60e7, 0x0000, 0x61ea, 0x60e3,
-	0x0002, 0x604b, 0xf7f7, 0x6043, 0x0000, 0x602f, 0x0080, 0x602f,
-	0x0000, 0x6007, 0x149f, 0x60bb, 0x0000, 0x20a9, 0x0018, 0x60bf,
-	0x0000, 0x1f04, 0x22e7, 0x60bb, 0x0000, 0x60bf, 0x0108, 0x60bf,
-	0x0012, 0x60bf, 0x0320, 0x60bf, 0x0018, 0x601b, 0x00f0, 0x601f,
-	0x001e, 0x600f, 0x006b, 0x602b, 0x402f, 0x012e, 0x0005, 0x00f6,
-	0x2079, 0x0140, 0x78c3, 0x0080, 0x78c3, 0x0083, 0x78c3, 0x0000,
-	0x00fe, 0x0005, 0x2001, 0x1834, 0x2003, 0x0000, 0x2001, 0x1833,
-	0x2003, 0x0001, 0x0005, 0x0126, 0x2091, 0x2800, 0x0006, 0x0016,
-	0x0026, 0x6124, 0x9184, 0x5e2c, 0x1118, 0x9184, 0x0007, 0x002a,
-	0x9195, 0x0004, 0x9284, 0x0007, 0x0002, 0x2347, 0x232d, 0x2330,
-	0x2333, 0x2338, 0x233a, 0x233e, 0x2342, 0x080c, 0x82dd, 0x00b8,
-	0x080c, 0x83aa, 0x00a0, 0x080c, 0x83aa, 0x080c, 0x82dd, 0x0078,
-	0x0099, 0x0068, 0x080c, 0x82dd, 0x0079, 0x0048, 0x080c, 0x83aa,
-	0x0059, 0x0028, 0x080c, 0x83aa, 0x080c, 0x82dd, 0x0029, 0x002e,
-	0x001e, 0x000e, 0x012e, 0x0005, 0x00a6, 0x6124, 0x6028, 0xd09c,
-	0x0118, 0xd19c, 0x1904, 0x2595, 0xd1f4, 0x190c, 0x0dad, 0x080c,
-	0x6fb2, 0x0904, 0x23a2, 0x080c, 0xc212, 0x1120, 0x7000, 0x9086,
-	0x0003, 0x0570, 0x6024, 0x9084, 0x1800, 0x0550, 0x080c, 0x6fd5,
-	0x0118, 0x080c, 0x6fc3, 0x1520, 0x6027, 0x0020, 0x6043, 0x0000,
-	0x080c, 0xc212, 0x0168, 0x080c, 0x6fd5, 0x1150, 0x2001, 0x1978,
-	0x2003, 0x0001, 0x6027, 0x1800, 0x080c, 0x6e33, 0x0804, 0x2598,
-	0x70a0, 0x9005, 0x1150, 0x70a3, 0x0001, 0x00d6, 0x2069, 0x0140,
-	0x080c, 0x7009, 0x00de, 0x1904, 0x2598, 0x080c, 0x72a0, 0x0428,
-	0x080c, 0x6fd5, 0x1590, 0x6024, 0x9084, 0x1800, 0x1108, 0x0468,
-	0x080c, 0x72a0, 0x080c, 0x7296, 0x080c, 0x5cd1, 0x080c, 0x6ee4,
-	0x0804, 0x2595, 0xd1ac, 0x1508, 0x6024, 0xd0dc, 0x1170, 0xd0e4,
-	0x1178, 0xd0d4, 0x1190, 0xd0cc, 0x0130, 0x7094, 0x9086, 0x0028,
-	0x1110, 0x080c, 0x7185, 0x0804, 0x2595, 0x080c, 0x729b, 0x0048,
-	0x2001, 0x194e, 0x2003, 0x0002, 0x0020, 0x080c, 0x70eb, 0x0804,
-	0x2595, 0x080c, 0x721f, 0x0804, 0x2595, 0xd1ac, 0x0904, 0x24b6,
-	0x080c, 0x6fb2, 0x11c0, 0x6027, 0x0020, 0x0006, 0x0026, 0x0036,
-	0x080c, 0x6fcc, 0x1158, 0x080c, 0x7296, 0x080c, 0x5cd1, 0x080c,
-	0x6ee4, 0x003e, 0x002e, 0x000e, 0x00ae, 0x0005, 0x003e, 0x002e,
-	0x000e, 0x080c, 0x6f8a, 0x0016, 0x0046, 0x00c6, 0x644c, 0x9486,
-	0xf0f0, 0x1138, 0x2061, 0x0100, 0x644a, 0x6043, 0x0090, 0x6043,
-	0x0010, 0x74d6, 0x948c, 0xff00, 0x7038, 0xd084, 0x0178, 0x9186,
-	0xf800, 0x1160, 0x7044, 0xd084, 0x1148, 0xc085, 0x7046, 0x0036,
-	0x2418, 0x2011, 0x8016, 0x080c, 0x48d9, 0x003e, 0x080c, 0xc20b,
-	0x1904, 0x2493, 0x9196, 0xff00, 0x05a8, 0x705c, 0x9084, 0x00ff,
-	0x810f, 0x81ff, 0x0110, 0x9116, 0x0568, 0x7130, 0xd184, 0x1550,
-	0x080c, 0x3133, 0x0128, 0xc18d, 0x7132, 0x080c, 0x655a, 0x1510,
-	0x6240, 0x9294, 0x0010, 0x0130, 0x6248, 0x9294, 0xff00, 0x9296,
-	0xff00, 0x01c0, 0x7030, 0xd08c, 0x0904, 0x2493, 0x7038, 0xd08c,
-	0x1140, 0x2001, 0x180c, 0x200c, 0xd1ac, 0x1904, 0x2493, 0xc1ad,
-	0x2102, 0x0036, 0x73d4, 0x2011, 0x8013, 0x080c, 0x48d9, 0x003e,
-	0x0804, 0x2493, 0x7038, 0xd08c, 0x1140, 0x2001, 0x180c, 0x200c,
-	0xd1ac, 0x1904, 0x2493, 0xc1ad, 0x2102, 0x0036, 0x73d4, 0x2011,
-	0x8013, 0x080c, 0x48d9, 0x003e, 0x7130, 0xc185, 0x7132, 0x2011,
-	0x1854, 0x220c, 0x00f0, 0x0016, 0x2009, 0x0001, 0x2011, 0x0100,
-	0x080c, 0x822f, 0x2019, 0x000e, 0x00c6, 0x2061, 0x0000, 0x080c,
-	0xd4a6, 0x00ce, 0x9484, 0x00ff, 0x9080, 0x3138, 0x200d, 0x918c,
-	0xff00, 0x810f, 0x2120, 0x9006, 0x2009, 0x000e, 0x080c, 0xd52a,
-	0x001e, 0xd1ac, 0x1148, 0x0016, 0x2009, 0x0002, 0x2019, 0x0004,
-	0x080c, 0x2fa5, 0x001e, 0x0078, 0x0156, 0x00b6, 0x20a9, 0x007f,
-	0x900e, 0x080c, 0x623e, 0x1110, 0x080c, 0x5ceb, 0x8108, 0x1f04,
-	0x2489, 0x00be, 0x015e, 0x00ce, 0x004e, 0x080c, 0x9db8, 0x60e3,
-	0x0000, 0x001e, 0x2001, 0x1800, 0x2014, 0x9296, 0x0004, 0x1170,
-	0xd19c, 0x11a0, 0x2011, 0x180c, 0x2214, 0xd29c, 0x1120, 0x6204,
-	0x9295, 0x0002, 0x6206, 0x6228, 0xc29d, 0x622a, 0x2003, 0x0001,
-	0x2001, 0x1825, 0x2003, 0x0000, 0x6027, 0x0020, 0xd194, 0x0904,
-	0x2595, 0x0016, 0x6220, 0xd2b4, 0x0904, 0x253e, 0x080c, 0x80b8,
-	0x080c, 0x93ac, 0x6027, 0x0004, 0x00f6, 0x2019, 0x19c1, 0x2304,
-	0x907d, 0x0904, 0x250d, 0x7804, 0x9086, 0x0032, 0x15f0, 0x00d6,
-	0x00c6, 0x00e6, 0x0096, 0x2069, 0x0140, 0x782c, 0x685e, 0x7808,
-	0x685a, 0x6043, 0x0002, 0x2001, 0x0003, 0x8001, 0x1df0, 0x6043,
-	0x0000, 0x2001, 0x003c, 0x8001, 0x1df0, 0x080c, 0x2b24, 0x2001,
-	0x001e, 0x8001, 0x0240, 0x20a9, 0x0009, 0x080c, 0x2a3e, 0x6904,
-	0xd1dc, 0x1140, 0x0cb0, 0x2001, 0x0100, 0x080c, 0x2b14, 0x9006,
-	0x080c, 0x2b14, 0x080c, 0x886e, 0x080c, 0x8973, 0x7814, 0x2048,
-	0xa867, 0x0103, 0x2f60, 0x080c, 0x9e32, 0x009e, 0x00ee, 0x00ce,
-	0x00de, 0x00fe, 0x001e, 0x00ae, 0x0005, 0x00fe, 0x00d6, 0x2069,
-	0x0140, 0x6804, 0x9084, 0x4000, 0x0110, 0x080c, 0x2b24, 0x00de,
-	0x00c6, 0x2061, 0x19b8, 0x6028, 0x080c, 0xc212, 0x0120, 0x909a,
-	0x0003, 0x1258, 0x0018, 0x909a, 0x00c8, 0x1238, 0x8000, 0x602a,
-	0x00ce, 0x080c, 0x9388, 0x0804, 0x2594, 0x2061, 0x0100, 0x62c0,
-	0x080c, 0x9c43, 0x2019, 0x19c1, 0x2304, 0x9065, 0x0120, 0x2009,
-	0x0027, 0x080c, 0x9eac, 0x00ce, 0x0804, 0x2594, 0xd2bc, 0x0904,
-	0x2581, 0x080c, 0x80c5, 0x6014, 0x9084, 0x1984, 0x9085, 0x0010,
-	0x6016, 0x6027, 0x0004, 0x00d6, 0x2069, 0x0140, 0x6804, 0x9084,
-	0x4000, 0x0110, 0x080c, 0x2b24, 0x00de, 0x00c6, 0x2061, 0x19b8,
-	0x6044, 0x080c, 0xc212, 0x0120, 0x909a, 0x0003, 0x1628, 0x0018,
-	0x909a, 0x00c8, 0x1608, 0x8000, 0x6046, 0x603c, 0x00ce, 0x9005,
-	0x0558, 0x2009, 0x07d0, 0x080c, 0x80bd, 0x9080, 0x0008, 0x2004,
-	0x9086, 0x0006, 0x1138, 0x6114, 0x918c, 0x1984, 0x918d, 0x0012,
-	0x6116, 0x00d0, 0x6114, 0x918c, 0x1984, 0x918d, 0x0016, 0x6116,
-	0x0098, 0x6027, 0x0004, 0x0080, 0x0036, 0x2019, 0x0001, 0x080c,
-	0x96d8, 0x003e, 0x2019, 0x19c7, 0x2304, 0x9065, 0x0120, 0x2009,
-	0x004f, 0x080c, 0x9eac, 0x00ce, 0x001e, 0xd19c, 0x0904, 0x2607,
-	0x7038, 0xd0ac, 0x1904, 0x25dc, 0x0016, 0x0156, 0x6027, 0x0008,
-	0x6050, 0x9085, 0x0040, 0x6052, 0x6050, 0x9084, 0xfbcf, 0x6052,
-	0x080c, 0x2a5d, 0x9085, 0x2000, 0x6052, 0x20a9, 0x0012, 0x1d04,
-	0x25af, 0x080c, 0x80ec, 0x1f04, 0x25af, 0x6050, 0x9085, 0x0400,
-	0x9084, 0xdfbf, 0x6052, 0x20a9, 0x0028, 0xa001, 0x1f04, 0x25bd,
-	0x6150, 0x9185, 0x1400, 0x6052, 0x20a9, 0x0366, 0x1d04, 0x25c6,
-	0x080c, 0x80ec, 0x6020, 0xd09c, 0x1130, 0x015e, 0x6152, 0x001e,
-	0x6027, 0x0008, 0x04a0, 0x080c, 0x2a25, 0x1f04, 0x25c6, 0x015e,
-	0x6152, 0x001e, 0x6027, 0x0008, 0x0016, 0x6028, 0xc09c, 0x602a,
-	0x080c, 0x9db8, 0x60e3, 0x0000, 0x080c, 0xd8b4, 0x080c, 0xd8cf,
-	0x080c, 0x538a, 0xd0fc, 0x1138, 0x080c, 0xc20b, 0x1120, 0x9085,
-	0x0001, 0x080c, 0x6ff9, 0x9006, 0x080c, 0x2b14, 0x2009, 0x0002,
-	0x080c, 0x2a63, 0x00e6, 0x2071, 0x1800, 0x7003, 0x0004, 0x080c,
-	0x0e80, 0x00ee, 0x6027, 0x0008, 0x080c, 0x0b8f, 0x001e, 0x918c,
-	0xffd0, 0x6126, 0x00ae, 0x0005, 0x0006, 0x0016, 0x0026, 0x0036,
-	0x00e6, 0x00f6, 0x0126, 0x2091, 0x8000, 0x2071, 0x1800, 0x71cc,
-	0x70ce, 0x9116, 0x0904, 0x265b, 0x81ff, 0x01a0, 0x2009, 0x0000,
-	0x080c, 0x2a63, 0x2011, 0x8011, 0x2019, 0x010e, 0x231c, 0x939e,
-	0x0007, 0x1118, 0x2019, 0x0001, 0x0010, 0x2019, 0x0000, 0x080c,
-	0x48d9, 0x0448, 0x2001, 0x1979, 0x200c, 0x81ff, 0x1140, 0x2001,
-	0x0109, 0x2004, 0xd0b4, 0x0118, 0x2019, 0x0003, 0x0008, 0x2118,
-	0x2011, 0x8012, 0x080c, 0x48d9, 0x080c, 0x0e80, 0x080c, 0x538a,
-	0xd0fc, 0x1188, 0x080c, 0xc20b, 0x1170, 0x00c6, 0x080c, 0x26f7,
-	0x080c, 0x963f, 0x2061, 0x0100, 0x2019, 0x0028, 0x2009, 0x0002,
-	0x080c, 0x2fa5, 0x00ce, 0x012e, 0x00fe, 0x00ee, 0x003e, 0x002e,
-	0x001e, 0x000e, 0x0005, 0x2028, 0x918c, 0x00ff, 0x2130, 0x9094,
-	0xff00, 0x11f0, 0x2011, 0x1836, 0x2214, 0xd2ac, 0x11c8, 0x81ff,
-	0x01e8, 0x2011, 0x181e, 0x2204, 0x9106, 0x1190, 0x2011, 0x181f,
-	0x2214, 0x9294, 0xff00, 0x9584, 0xff00, 0x9206, 0x1148, 0x2011,
-	0x181f, 0x2214, 0x9294, 0x00ff, 0x9584, 0x00ff, 0x9206, 0x1120,
-	0x2500, 0x080c, 0x7c57, 0x0048, 0x9584, 0x00ff, 0x9080, 0x3138,
-	0x200d, 0x918c, 0xff00, 0x810f, 0x9006, 0x0005, 0x9080, 0x3138,
-	0x200d, 0x918c, 0x00ff, 0x0005, 0x00d6, 0x2069, 0x0140, 0x2001,
-	0x1817, 0x2003, 0x00ef, 0x20a9, 0x0010, 0x9006, 0x6852, 0x6856,
-	0x1f04, 0x26a7, 0x00de, 0x0005, 0x0006, 0x00d6, 0x0026, 0x2069,
-	0x0140, 0x2001, 0x1817, 0x2102, 0x8114, 0x8214, 0x8214, 0x8214,
-	0x20a9, 0x0010, 0x6853, 0x0000, 0x9006, 0x82ff, 0x1128, 0x9184,
-	0x000f, 0x9080, 0xdd89, 0x2005, 0x6856, 0x8211, 0x1f04, 0x26bc,
-	0x002e, 0x00de, 0x000e, 0x0005, 0x00c6, 0x2061, 0x1800, 0x6030,
-	0x0110, 0xc09d, 0x0008, 0xc09c, 0x6032, 0x00ce, 0x0005, 0x0156,
-	0x00d6, 0x0026, 0x0016, 0x0006, 0x2069, 0x0140, 0x6980, 0x9116,
-	0x0180, 0x9112, 0x1230, 0x8212, 0x8210, 0x22a8, 0x2001, 0x0402,
-	0x0018, 0x22a8, 0x2001, 0x0404, 0x680e, 0x1f04, 0x26ec, 0x680f,
-	0x0000, 0x000e, 0x001e, 0x002e, 0x00de, 0x015e, 0x0005, 0x080c,
-	0x5386, 0xd0c4, 0x0150, 0xd0a4, 0x0140, 0x9006, 0x0046, 0x2020,
-	0x2009, 0x002e, 0x080c, 0xd52a, 0x004e, 0x0005, 0x00f6, 0x0016,
-	0x0026, 0x2079, 0x0140, 0x78c4, 0xd0dc, 0x0904, 0x2763, 0x080c,
-	0x29c2, 0x0660, 0x9084, 0x0700, 0x908e, 0x0600, 0x1120, 0x2011,
-	0x4000, 0x900e, 0x0458, 0x908e, 0x0500, 0x1120, 0x2011, 0x8000,
-	0x900e, 0x0420, 0x908e, 0x0400, 0x1120, 0x9016, 0x2009, 0x0001,
-	0x00e8, 0x908e, 0x0300, 0x1120, 0x9016, 0x2009, 0x0002, 0x00b0,
-	0x908e, 0x0200, 0x1120, 0x9016, 0x2009, 0x0004, 0x0078, 0x908e,
-	0x0100, 0x1548, 0x9016, 0x2009, 0x0008, 0x0040, 0x9084, 0x0700,
-	0x908e, 0x0300, 0x1500, 0x2011, 0x0030, 0x0058, 0x2300, 0x9080,
-	0x0020, 0x2018, 0x080c, 0x8270, 0x928c, 0xff00, 0x0110, 0x2011,
-	0x00ff, 0x2200, 0x8007, 0x9085, 0x004c, 0x78c2, 0x2009, 0x0138,
-	0x220a, 0x080c, 0x6fb2, 0x1118, 0x2009, 0x193e, 0x220a, 0x002e,
-	0x001e, 0x00fe, 0x0005, 0x78c3, 0x0000, 0x0cc8, 0x0126, 0x2091,
-	0x2800, 0x0006, 0x0016, 0x0026, 0x2001, 0x0170, 0x200c, 0x8000,
-	0x2014, 0x9184, 0x0003, 0x0110, 0x080c, 0x0dad, 0x002e, 0x001e,
-	0x000e, 0x012e, 0x0005, 0x2001, 0x0171, 0x2004, 0xd0dc, 0x0168,
-	0x2001, 0x0170, 0x200c, 0x918c, 0x00ff, 0x918e, 0x004c, 0x1128,
-	0x200c, 0x918c, 0xff00, 0x810f, 0x0005, 0x900e, 0x2001, 0x0227,
-	0x2004, 0x8007, 0x9084, 0x00ff, 0x8004, 0x9108, 0x2001, 0x0226,
-	0x2004, 0x8007, 0x9084, 0x00ff, 0x8004, 0x9108, 0x0005, 0x0018,
-	0x000c, 0x0018, 0x0020, 0x1000, 0x0800, 0x1000, 0x1800, 0x0156,
-	0x0006, 0x0016, 0x0026, 0x00e6, 0x2001, 0x1961, 0x2004, 0x908a,
-	0x0007, 0x1a0c, 0x0db4, 0x0033, 0x00ee, 0x002e, 0x001e, 0x000e,
-	0x015e, 0x0005, 0x27c1, 0x27df, 0x2803, 0x2805, 0x282e, 0x2830,
-	0x2832, 0x2001, 0x0001, 0x080c, 0x260c, 0x080c, 0x2a20, 0x2001,
-	0x1963, 0x2003, 0x0000, 0x7828, 0x9084, 0xe1d7, 0x782a, 0x9006,
-	0x20a9, 0x0009, 0x080c, 0x29de, 0x2001, 0x1961, 0x2003, 0x0006,
-	0x2009, 0x001e, 0x2011, 0x2833, 0x080c, 0x80ca, 0x0005, 0x2009,
-	0x1966, 0x200b, 0x0000, 0x2001, 0x196b, 0x2003, 0x0036, 0x2001,
-	0x196a, 0x2003, 0x002a, 0x2001, 0x1963, 0x2003, 0x0001, 0x9006,
-	0x080c, 0x2990, 0x2001, 0xffff, 0x20a9, 0x0009, 0x080c, 0x29de,
-	0x2001, 0x1961, 0x2003, 0x0006, 0x2009, 0x001e, 0x2011, 0x2833,
-	0x080c, 0x80ca, 0x0005, 0x080c, 0x0db4, 0x2001, 0x196b, 0x2003,
-	0x0036, 0x2001, 0x1963, 0x2003, 0x0003, 0x7a38, 0x9294, 0x0005,
-	0x9296, 0x0004, 0x0110, 0x9006, 0x0010, 0x2001, 0x0001, 0x080c,
-	0x2990, 0x2001, 0x1967, 0x2003, 0x0000, 0x2001, 0xffff, 0x20a9,
-	0x0009, 0x080c, 0x29de, 0x2001, 0x1961, 0x2003, 0x0006, 0x2009,
-	0x001e, 0x2011, 0x2833, 0x080c, 0x80ca, 0x0005, 0x080c, 0x0db4,
-	0x080c, 0x0db4, 0x0005, 0x0006, 0x0016, 0x0026, 0x00e6, 0x00f6,
-	0x0156, 0x0126, 0x2091, 0x8000, 0x2079, 0x0100, 0x2001, 0x1963,
-	0x2004, 0x908a, 0x0007, 0x1a0c, 0x0db4, 0x0043, 0x012e, 0x015e,
-	0x00fe, 0x00ee, 0x002e, 0x001e, 0x000e, 0x0005, 0x2855, 0x2875,
-	0x28b5, 0x28e5, 0x2909, 0x2919, 0x291b, 0x080c, 0x29d2, 0x11b0,
-	0x7850, 0x9084, 0xefff, 0x7852, 0x2009, 0x1969, 0x2104, 0x7a38,
-	0x9294, 0x0005, 0x9296, 0x0004, 0x0110, 0xc08d, 0x0008, 0xc085,
-	0x200a, 0x2001, 0x1961, 0x2003, 0x0001, 0x0030, 0x080c, 0x293f,
-	0x2001, 0xffff, 0x080c, 0x27d0, 0x0005, 0x080c, 0x291d, 0x05e0,
-	0x2009, 0x196a, 0x2104, 0x8001, 0x200a, 0x080c, 0x29d2, 0x1178,
-	0x7850, 0x9084, 0xefff, 0x7852, 0x7a38, 0x9294, 0x0005, 0x9296,
-	0x0005, 0x0518, 0x2009, 0x1969, 0x2104, 0xc085, 0x200a, 0x2009,
-	0x1966, 0x2104, 0x8000, 0x200a, 0x9086, 0x0005, 0x0118, 0x080c,
-	0x2925, 0x00c0, 0x200b, 0x0000, 0x7a38, 0x9294, 0x0006, 0x9296,
-	0x0004, 0x0110, 0x9006, 0x0010, 0x2001, 0x0001, 0x080c, 0x29ad,
-	0x2001, 0x1963, 0x2003, 0x0002, 0x0028, 0x2001, 0x1961, 0x2003,
-	0x0003, 0x0010, 0x080c, 0x27f2, 0x0005, 0x080c, 0x291d, 0x0560,
-	0x2009, 0x196a, 0x2104, 0x8001, 0x200a, 0x080c, 0x29d2, 0x1168,
-	0x7850, 0x9084, 0xefff, 0x7852, 0x2001, 0x1961, 0x2003, 0x0003,
-	0x2001, 0x1962, 0x2003, 0x0000, 0x00b8, 0x2009, 0x196a, 0x2104,
-	0x9005, 0x1118, 0x080c, 0x2962, 0x0010, 0x080c, 0x2932, 0x080c,
-	0x2925, 0x2009, 0x1966, 0x200b, 0x0000, 0x2001, 0x1963, 0x2003,
-	0x0001, 0x080c, 0x27f2, 0x0000, 0x0005, 0x04b9, 0x0508, 0x080c,
-	0x29d2, 0x11b8, 0x7850, 0x9084, 0xefff, 0x7852, 0x2009, 0x1967,
-	0x2104, 0x8000, 0x200a, 0x9086, 0x0007, 0x0108, 0x0078, 0x2001,
-	0x196c, 0x2003, 0x000a, 0x2009, 0x1969, 0x2104, 0xc0fd, 0x200a,
-	0x0038, 0x0419, 0x2001, 0x1963, 0x2003, 0x0004, 0x080c, 0x281d,
-	0x0005, 0x0099, 0x0168, 0x080c, 0x29d2, 0x1138, 0x7850, 0x9084,
-	0xefff, 0x7852, 0x080c, 0x2809, 0x0018, 0x0079, 0x080c, 0x281d,
-	0x0005, 0x080c, 0x0db4, 0x080c, 0x0db4, 0x2009, 0x196b, 0x2104,
-	0x8001, 0x200a, 0x090c, 0x297e, 0x0005, 0x7a38, 0x9294, 0x0005,
-	0x9296, 0x0005, 0x0110, 0x9006, 0x0010, 0x2001, 0x0001, 0x080c,
-	0x29ad, 0x0005, 0x7a38, 0x9294, 0x0006, 0x9296, 0x0006, 0x0110,
-	0x9006, 0x0010, 0x2001, 0x0001, 0x080c, 0x2990, 0x0005, 0x2009,
-	0x1966, 0x2104, 0x8000, 0x200a, 0x9086, 0x0005, 0x0108, 0x0068,
-	0x200b, 0x0000, 0x7a38, 0x9294, 0x0006, 0x9296, 0x0006, 0x0110,
-	0x9006, 0x0010, 0x2001, 0x0001, 0x04d9, 0x7a38, 0x9294, 0x0005,
-	0x9296, 0x0005, 0x0110, 0x9006, 0x0010, 0x2001, 0x0001, 0x080c,
-	0x29ad, 0x0005, 0x0086, 0x2001, 0x1969, 0x2004, 0x9084, 0x7fff,
-	0x090c, 0x0db4, 0x2009, 0x1968, 0x2144, 0x8846, 0x280a, 0x9844,
-	0x0dd8, 0xd08c, 0x1120, 0xd084, 0x1120, 0x080c, 0x0db4, 0x9006,
-	0x0010, 0x2001, 0x0001, 0x00a1, 0x008e, 0x0005, 0x0006, 0x0156,
-	0x2001, 0x1961, 0x20a9, 0x0009, 0x2003, 0x0000, 0x8000, 0x1f04,
-	0x2984, 0x2001, 0x1968, 0x2003, 0x8000, 0x015e, 0x000e, 0x0005,
-	0x00f6, 0x2079, 0x0100, 0x9085, 0x0000, 0x0158, 0x7838, 0x9084,
-	0xfff9, 0x9085, 0x0004, 0x783a, 0x2009, 0x196e, 0x210c, 0x795a,
-	0x0050, 0x7838, 0x9084, 0xfffb, 0x9085, 0x0006, 0x783a, 0x2009,
-	0x196f, 0x210c, 0x795a, 0x00fe, 0x0005, 0x00f6, 0x2079, 0x0100,
-	0x9085, 0x0000, 0x0138, 0x7838, 0x9084, 0xfffa, 0x9085, 0x0004,
-	0x783a, 0x0030, 0x7838, 0x9084, 0xfffb, 0x9085, 0x0005, 0x783a,
-	0x00fe, 0x0005, 0x0006, 0x2001, 0x0100, 0x2004, 0x9082, 0x0007,
-	0x000e, 0x0005, 0x0006, 0x2001, 0x0100, 0x2004, 0x9082, 0x0009,
-	0x000e, 0x0005, 0x0156, 0x20a9, 0x0064, 0x7820, 0x080c, 0x2a5d,
-	0xd09c, 0x1110, 0x1f04, 0x29d5, 0x015e, 0x0005, 0x0126, 0x0016,
-	0x0006, 0x2091, 0x8000, 0x7850, 0x9085, 0x0040, 0x7852, 0x7850,
-	0x9084, 0xfbcf, 0x7852, 0x080c, 0x2a5d, 0x9085, 0x2000, 0x7852,
-	0x000e, 0x2008, 0x9186, 0x0000, 0x1118, 0x783b, 0x0007, 0x0090,
-	0x9186, 0x0001, 0x1118, 0x783b, 0x0006, 0x0060, 0x9186, 0x0002,
-	0x1118, 0x783b, 0x0005, 0x0030, 0x9186, 0x0003, 0x1118, 0x783b,
-	0x0004, 0x0000, 0x0006, 0x1d04, 0x2a0b, 0x080c, 0x80ec, 0x1f04,
-	0x2a0b, 0x7850, 0x9085, 0x0400, 0x9084, 0xdfbf, 0x7852, 0x080c,
-	0x2a5d, 0x9085, 0x1000, 0x7852, 0x000e, 0x001e, 0x012e, 0x0005,
-	0x7850, 0x9084, 0xffcf, 0x7852, 0x0005, 0x0006, 0x0156, 0x00f6,
-	0x2079, 0x0100, 0x20a9, 0x000a, 0x7854, 0xd0ac, 0x1130, 0x7820,
-	0xd0e4, 0x1140, 0x1f04, 0x2a2f, 0x0028, 0x7854, 0xd08c, 0x1110,
-	0x1f04, 0x2a35, 0x00fe, 0x015e, 0x000e, 0x0005, 0x1d04, 0x2a3e,
-	0x080c, 0x80ec, 0x1f04, 0x2a3e, 0x0005, 0x0006, 0x2001, 0x196d,
-	0x2004, 0x9086, 0x0000, 0x000e, 0x0005, 0x0006, 0x2001, 0x196d,
-	0x2004, 0x9086, 0x0001, 0x000e, 0x0005, 0x0006, 0x2001, 0x196d,
-	0x2004, 0x9086, 0x0002, 0x000e, 0x0005, 0xa001, 0xa001, 0xa001,
-	0xa001, 0xa001, 0x0005, 0x0006, 0x2001, 0x1979, 0x2102, 0x000e,
-	0x0005, 0x2009, 0x0171, 0x2104, 0xd0dc, 0x0140, 0x2009, 0x0170,
-	0x2104, 0x200b, 0x0080, 0xa001, 0xa001, 0x200a, 0x0005, 0x0036,
-	0x0046, 0x2001, 0x0141, 0x200c, 0x918c, 0xff00, 0x9186, 0x2000,
-	0x0118, 0x9186, 0x0100, 0x1588, 0x2009, 0x00a2, 0x080c, 0x0e2f,
-	0x2019, 0x0160, 0x2324, 0x2011, 0x0003, 0x2009, 0x0169, 0x2104,
-	0x9084, 0x0007, 0x210c, 0x918c, 0x0007, 0x910e, 0x1db0, 0x9086,
-	0x0003, 0x11b8, 0x2304, 0x9402, 0x02a0, 0x1d60, 0x8211, 0x1d68,
-	0x84ff, 0x0170, 0x2001, 0x0141, 0x200c, 0x918c, 0xff00, 0x9186,
-	0x0100, 0x0130, 0x2009, 0x180c, 0x2104, 0xc0dd, 0x200a, 0x0008,
-	0x0419, 0x2009, 0x0000, 0x080c, 0x0e2f, 0x004e, 0x003e, 0x0005,
-	0x2001, 0x180c, 0x2004, 0xd0dc, 0x01b0, 0x2001, 0x0160, 0x2004,
-	0x9005, 0x0140, 0x2001, 0x0141, 0x2004, 0x9084, 0xff00, 0x9086,
-	0x0100, 0x1148, 0x0126, 0x2091, 0x8000, 0x0016, 0x0026, 0x0021,
-	0x002e, 0x001e, 0x012e, 0x0005, 0x00c6, 0x2061, 0x0100, 0x6014,
-	0x0006, 0x2001, 0x0161, 0x2003, 0x0000, 0x6017, 0x0018, 0xa001,
-	0xa001, 0x602f, 0x0008, 0x6104, 0x918e, 0x0010, 0x6106, 0x918e,
-	0x0010, 0x6106, 0x6017, 0x0040, 0x04b9, 0x001e, 0x9184, 0x0003,
-	0x01e0, 0x0036, 0x0016, 0x2019, 0x0141, 0x6124, 0x918c, 0x0028,
-	0x1120, 0x2304, 0x9084, 0x2800, 0x0dc0, 0x001e, 0x919c, 0xffe4,
-	0x9184, 0x0001, 0x0118, 0x9385, 0x0009, 0x6016, 0x9184, 0x0002,
-	0x0118, 0x9385, 0x0012, 0x6016, 0x003e, 0x2001, 0x180c, 0x200c,
-	0xc1dc, 0x2102, 0x00ce, 0x0005, 0x0016, 0x0026, 0x080c, 0x6fcc,
-	0x0108, 0xc0bc, 0x2009, 0x0140, 0x2114, 0x9294, 0x0001, 0x9215,
+	0xc0bd, 0xa882, 0x080c, 0xb75d, 0x0005, 0x6010, 0x00b6, 0x2058,
+	0xb800, 0x00be, 0xd0bc, 0x6024, 0x190c, 0xbf16, 0x2029, 0x00c8,
+	0x8529, 0x0128, 0x2001, 0x0201, 0x2004, 0x9005, 0x0dc8, 0x7dbc,
+	0x080c, 0xd8ad, 0xd5a4, 0x1118, 0x080c, 0x14a9, 0x0005, 0x080c,
+	0x79f0, 0x080c, 0x195a, 0x0005, 0x781f, 0x0300, 0x7803, 0x0001,
+	0x0005, 0x0016, 0x0066, 0x0076, 0x00f6, 0x2079, 0x0300, 0x7908,
+	0x918c, 0x0007, 0x9186, 0x0003, 0x0120, 0x2001, 0x0016, 0x080c,
+	0x151a, 0x00fe, 0x007e, 0x006e, 0x001e, 0x0005, 0x7004, 0xc09d,
+	0x7006, 0x0005, 0x7104, 0x9184, 0x0004, 0x190c, 0x0db4, 0xd184,
+	0x1189, 0xd19c, 0x0158, 0xc19c, 0x7106, 0x2001, 0x020d, 0x2003,
+	0x0050, 0x2003, 0x0020, 0x080c, 0x14a9, 0x0005, 0x81ff, 0x190c,
+	0x0db4, 0x0005, 0xc184, 0xd1b4, 0xc1b4, 0x7106, 0x0016, 0x00e6,
+	0x15e0, 0x2071, 0x0200, 0x080c, 0x15d4, 0x6014, 0x9005, 0x05a8,
+	0x0096, 0x2048, 0xa864, 0x009e, 0x9084, 0x00ff, 0x908e, 0x0029,
+	0x0160, 0x908e, 0x0048, 0x1548, 0x601c, 0xd084, 0x11d8, 0x00f6,
+	0x2c78, 0x080c, 0x164a, 0x00fe, 0x00a8, 0x00f6, 0x2c78, 0x080c,
+	0x1792, 0x00fe, 0x2009, 0x01f4, 0x8109, 0x0160, 0x2001, 0x0201,
+	0x2004, 0x9005, 0x0dc8, 0x2001, 0x0218, 0x2004, 0xd0ec, 0x1110,
+	0x0401, 0x0040, 0x2001, 0x020d, 0x2003, 0x0020, 0x080c, 0x12c5,
+	0x7803, 0x0001, 0x00ee, 0x001e, 0x0005, 0x2001, 0x020d, 0x2003,
+	0x0050, 0x2003, 0x0020, 0x0069, 0x0ca8, 0x0031, 0x2060, 0x2009,
+	0x0053, 0x080c, 0x9ebc, 0x0005, 0x7808, 0xd09c, 0x0de8, 0x7820,
+	0x0005, 0x080c, 0x1421, 0x00d6, 0x2069, 0x0200, 0x2009, 0x01f4,
+	0x8109, 0x0510, 0x6804, 0x9005, 0x0dd8, 0x2001, 0x015d, 0x2003,
+	0x0000, 0x79bc, 0xd1a4, 0x1528, 0x79b8, 0x918c, 0x0fff, 0x0180,
+	0x9182, 0x0841, 0x1268, 0x9188, 0x0007, 0x918c, 0x0ff8, 0x810c,
+	0x810c, 0x810c, 0x080c, 0x150c, 0x6827, 0x0001, 0x8109, 0x1dd0,
+	0x04d9, 0x6827, 0x0002, 0x04c1, 0x6804, 0x9005, 0x1130, 0x682c,
+	0xd0e4, 0x1500, 0x6804, 0x9005, 0x0de8, 0x79b8, 0xd1ec, 0x1130,
+	0x08c0, 0x080c, 0x79f0, 0x080c, 0x195a, 0x0090, 0x7827, 0x0015,
+	0x782b, 0x0000, 0x7827, 0x0018, 0x782b, 0x0000, 0x2001, 0x020d,
+	0x2003, 0x0020, 0x2001, 0x0307, 0x2003, 0x0300, 0x7803, 0x0001,
+	0x00de, 0x0005, 0x682c, 0x9084, 0x5400, 0x9086, 0x5400, 0x0d30,
+	0x7827, 0x0015, 0x782b, 0x0000, 0x7803, 0x0001, 0x6800, 0x9085,
+	0x1800, 0x6802, 0x00de, 0x0005, 0x6824, 0x9084, 0x0003, 0x1de0,
+	0x0005, 0x2001, 0x0030, 0x2c08, 0x621c, 0x0021, 0x7830, 0x9086,
+	0x0041, 0x0005, 0x00f6, 0x2079, 0x0300, 0x0006, 0x7808, 0xd09c,
+	0x0140, 0x0016, 0x0026, 0x00c6, 0x080c, 0x130c, 0x00ce, 0x002e,
+	0x001e, 0x000e, 0x0006, 0x7832, 0x7936, 0x7a3a, 0x781b, 0x8080,
+	0x0059, 0x1118, 0x000e, 0x00fe, 0x0005, 0x000e, 0x792c, 0x3900,
+	0x8000, 0x2004, 0x080c, 0x0db4, 0x2009, 0x180c, 0x2104, 0xc0f4,
+	0x200a, 0x2009, 0xff00, 0x8109, 0x0904, 0x1598, 0x7a18, 0x9284,
+	0x0030, 0x0904, 0x1593, 0x9284, 0x0048, 0x9086, 0x0008, 0x1904,
+	0x1593, 0x2001, 0x0109, 0x2004, 0xd08c, 0x01f0, 0x0006, 0x01c6,
+	0x01d6, 0x0136, 0x0146, 0x0156, 0x0126, 0x2091, 0x2800, 0x00f6,
+	0x0026, 0x0016, 0x2009, 0x1a4c, 0x2104, 0x8000, 0x0208, 0x200a,
+	0x080c, 0x8393, 0x001e, 0x002e, 0x00fe, 0x012e, 0x015e, 0x014e,
+	0x013e, 0x01de, 0x01ce, 0x000e, 0x2001, 0x009b, 0x2004, 0xd0fc,
+	0x01d0, 0x0006, 0x0126, 0x01c6, 0x01d6, 0x0136, 0x0146, 0x0156,
+	0x00f6, 0x0016, 0x2009, 0x1a4d, 0x2104, 0x8000, 0x0208, 0x200a,
+	0x080c, 0x1d4c, 0x001e, 0x00fe, 0x015e, 0x014e, 0x013e, 0x01de,
+	0x01ce, 0x012e, 0x000e, 0x7818, 0xd0bc, 0x1904, 0x1543, 0x0005,
+	0x2001, 0x180c, 0x2004, 0xd0f4, 0x1528, 0x7a18, 0x9284, 0x0030,
+	0x0508, 0x9284, 0x0048, 0x9086, 0x0008, 0x11e0, 0x2001, 0x19c6,
+	0x2004, 0x9005, 0x01b8, 0x2001, 0x1a35, 0x2004, 0x9086, 0x0000,
+	0x0188, 0x2009, 0x1a4b, 0x2104, 0x8000, 0x0208, 0x200a, 0x080c,
+	0x9431, 0x2009, 0x180c, 0x2104, 0xc0f5, 0x200a, 0x2009, 0xff00,
+	0x0804, 0x1543, 0x9085, 0x0001, 0x0005, 0x7832, 0x7936, 0x7a3a,
+	0x781b, 0x8080, 0x080c, 0x153c, 0x1108, 0x0005, 0x792c, 0x3900,
+	0x8000, 0x2004, 0x080c, 0x0db4, 0x7037, 0x0001, 0x7150, 0x7037,
+	0x0002, 0x7050, 0x2060, 0xd1bc, 0x1110, 0x7054, 0x2060, 0x0005,
+	0x00e6, 0x0016, 0x2071, 0x0200, 0x0c79, 0x6124, 0xd1dc, 0x01f8,
+	0x701c, 0xd08c, 0x0904, 0x163f, 0x7017, 0x0000, 0x2001, 0x0264,
+	0x2004, 0xd0bc, 0x0904, 0x163f, 0x2001, 0x0268, 0x00c6, 0x2064,
+	0x6104, 0x6038, 0x00ce, 0x918e, 0x0039, 0x1904, 0x163f, 0x9c06,
+	0x15f0, 0x0126, 0x2091, 0x2600, 0x080c, 0x7937, 0x012e, 0x7358,
+	0x745c, 0x6014, 0x905d, 0x0598, 0x2b48, 0x6010, 0x00b6, 0x2058,
+	0xb800, 0x00be, 0xd0bc, 0x190c, 0xbef1, 0xab42, 0xac3e, 0x2001,
+	0x1875, 0x2004, 0xd0b4, 0x1170, 0x601c, 0xd0e4, 0x1158, 0x6010,
+	0x00b6, 0x2058, 0xb800, 0x00be, 0xd0bc, 0x1120, 0xa83b, 0x7fff,
+	0xa837, 0xffff, 0x080c, 0x1f48, 0x1190, 0x080c, 0x17ed, 0x2a00,
+	0xa816, 0x0130, 0x2800, 0xa80e, 0x2c05, 0xa80a, 0x2c00, 0xa812,
+	0x7037, 0x0020, 0x781f, 0x0300, 0x001e, 0x00ee, 0x0005, 0x7037,
+	0x0050, 0x7037, 0x0020, 0x001e, 0x00ee, 0x080c, 0x14a9, 0x0005,
+	0x080c, 0x0db4, 0x0016, 0x2009, 0x00a0, 0x8109, 0xa001, 0xa001,
+	0xa001, 0x1dd8, 0x001e, 0x2ff0, 0x0126, 0x2091, 0x2200, 0x00c6,
+	0x3e60, 0x6014, 0x2048, 0x2940, 0x903e, 0x2730, 0xa864, 0x2068,
+	0xa81a, 0x9d84, 0x000f, 0x9088, 0x1f28, 0x2165, 0x0002, 0x167e,
+	0x16cb, 0x167e, 0x167e, 0x167e, 0x16ad, 0x167e, 0x1682, 0x1677,
+	0x16c2, 0x167e, 0x167e, 0x167e, 0x1787, 0x1696, 0x168c, 0xa964,
+	0x918c, 0x00ff, 0x918e, 0x0048, 0x0904, 0x16c2, 0x9085, 0x0001,
+	0x0804, 0x177e, 0xa87c, 0xd0bc, 0x0dc8, 0xa890, 0xa842, 0xa88c,
+	0xa83e, 0xa888, 0x0804, 0x16d2, 0xa87c, 0xd0bc, 0x0d78, 0xa890,
+	0xa842, 0xa88c, 0xa83e, 0xa888, 0x0804, 0x1721, 0xa87c, 0xd0bc,
+	0x0d28, 0xa890, 0xa842, 0xa88c, 0xa83e, 0xa804, 0x9045, 0x090c,
+	0x0db4, 0xa164, 0xa91a, 0x91ec, 0x000f, 0x9d80, 0x1f28, 0x2065,
+	0xa888, 0xd19c, 0x1904, 0x1721, 0x0428, 0xa87c, 0xd0ac, 0x0970,
+	0xa804, 0x9045, 0x090c, 0x0db4, 0xa164, 0xa91a, 0x91ec, 0x000f,
+	0x9d80, 0x1f28, 0x2065, 0x9006, 0xa842, 0xa83e, 0xd19c, 0x1904,
+	0x1721, 0x0080, 0xa87c, 0xd0ac, 0x0904, 0x167e, 0x9006, 0xa842,
+	0xa83e, 0x0804, 0x1721, 0xa87c, 0xd0ac, 0x0904, 0x167e, 0x9006,
+	0xa842, 0xa83e, 0x2c05, 0x908a, 0x0036, 0x1a0c, 0x0db4, 0x9082,
+	0x001b, 0x0002, 0x16f5, 0x16f5, 0x16f7, 0x16f5, 0x16f5, 0x16f5,
+	0x16fd, 0x16f5, 0x16f5, 0x16f5, 0x1703, 0x16f5, 0x16f5, 0x16f5,
+	0x1709, 0x16f5, 0x16f5, 0x16f5, 0x170f, 0x16f5, 0x16f5, 0x16f5,
+	0x1715, 0x16f5, 0x16f5, 0x16f5, 0x171b, 0x080c, 0x0db4, 0xa574,
+	0xa478, 0xa37c, 0xa280, 0x0804, 0x1766, 0xa584, 0xa488, 0xa38c,
+	0xa290, 0x0804, 0x1766, 0xa594, 0xa498, 0xa39c, 0xa2a0, 0x0804,
+	0x1766, 0xa5a4, 0xa4a8, 0xa3ac, 0xa2b0, 0x0804, 0x1766, 0xa5b4,
+	0xa4b8, 0xa3bc, 0xa2c0, 0x0804, 0x1766, 0xa5c4, 0xa4c8, 0xa3cc,
+	0xa2d0, 0x0804, 0x1766, 0xa5d4, 0xa4d8, 0xa3dc, 0xa2e0, 0x0804,
+	0x1766, 0x2c05, 0x908a, 0x0034, 0x1a0c, 0x0db4, 0x9082, 0x001b,
+	0x0002, 0x1744, 0x1742, 0x1742, 0x1742, 0x1742, 0x1742, 0x174b,
+	0x1742, 0x1742, 0x1742, 0x1742, 0x1742, 0x1752, 0x1742, 0x1742,
+	0x1742, 0x1742, 0x1742, 0x1759, 0x1742, 0x1742, 0x1742, 0x1742,
+	0x1742, 0x1760, 0x080c, 0x0db4, 0xa56c, 0xa470, 0xa774, 0xa678,
+	0xa37c, 0xa280, 0x00d8, 0xa584, 0xa488, 0xa78c, 0xa690, 0xa394,
+	0xa298, 0x00a0, 0xa59c, 0xa4a0, 0xa7a4, 0xa6a8, 0xa3ac, 0xa2b0,
+	0x0068, 0xa5b4, 0xa4b8, 0xa7bc, 0xa6c0, 0xa3c4, 0xa2c8, 0x0030,
+	0xa5cc, 0xa4d0, 0xa7d4, 0xa6d8, 0xa3dc, 0xa2e0, 0xab2e, 0xaa32,
+	0xad1e, 0xac22, 0xaf26, 0xae2a, 0xa988, 0x8c60, 0x2c1d, 0xa8ac,
+	0xaab0, 0xa836, 0xaa3a, 0x8109, 0xa916, 0x1158, 0x3e60, 0x601c,
+	0xc085, 0x601e, 0xa87c, 0xc0dd, 0xa87e, 0x9006, 0x00ce, 0x012e,
+	0x0005, 0x2800, 0xa80e, 0xab0a, 0x2c00, 0xa812, 0x0c78, 0x0804,
+	0x167e, 0x0016, 0x2009, 0x00a0, 0x8109, 0xa001, 0xa001, 0xa001,
+	0x1dd8, 0x001e, 0x2ff0, 0x0126, 0x2091, 0x2200, 0x00c6, 0x3e60,
+	0x6014, 0x2048, 0x2940, 0xa80e, 0x2061, 0x1f23, 0xa813, 0x1f23,
+	0x2c05, 0xa80a, 0xa964, 0xa91a, 0xa87c, 0xd0ac, 0x090c, 0x0db4,
+	0x9006, 0xa842, 0xa83e, 0x2c05, 0x908a, 0x0034, 0x1a0c, 0x0db4,
+	0xadcc, 0xacd0, 0xafd4, 0xaed8, 0xabdc, 0xaae0, 0xab2e, 0xaa32,
+	0xad1e, 0xac22, 0xaf26, 0xae2a, 0xa8ac, 0xaab0, 0xa836, 0xaa3a,
+	0xa988, 0xa864, 0x9084, 0x00ff, 0x9086, 0x0008, 0x1120, 0x8109,
+	0xa916, 0x0128, 0x0078, 0x918a, 0x0002, 0xa916, 0x1158, 0x3e60,
+	0x601c, 0xc085, 0x601e, 0xa87c, 0xc0dd, 0xa87e, 0x9006, 0x00ce,
+	0x012e, 0x0005, 0xa804, 0x9045, 0x090c, 0x0db4, 0xa80e, 0xa064,
+	0xa81a, 0x9084, 0x000f, 0x9080, 0x1f28, 0x2015, 0x82ff, 0x090c,
+	0x0db4, 0xaa12, 0x2205, 0xa80a, 0x0c10, 0x903e, 0x2730, 0xa880,
+	0xd0fc, 0x1190, 0x2d00, 0x0002, 0x18e2, 0x1844, 0x1844, 0x18e2,
+	0x18e2, 0x18dc, 0x18e2, 0x1844, 0x1893, 0x1893, 0x1893, 0x18e2,
+	0x18e2, 0x18e2, 0x18d9, 0x1893, 0xc0fc, 0xa882, 0xab2c, 0xaa30,
+	0xad1c, 0xac20, 0xdd9c, 0x0904, 0x18e4, 0x2c05, 0x908a, 0x0034,
+	0x1a0c, 0x0db4, 0x9082, 0x001b, 0x0002, 0x1830, 0x182e, 0x182e,
+	0x182e, 0x182e, 0x182e, 0x1834, 0x182e, 0x182e, 0x182e, 0x182e,
+	0x182e, 0x1838, 0x182e, 0x182e, 0x182e, 0x182e, 0x182e, 0x183c,
+	0x182e, 0x182e, 0x182e, 0x182e, 0x182e, 0x1840, 0x080c, 0x0db4,
+	0xa774, 0xa678, 0x0804, 0x18e4, 0xa78c, 0xa690, 0x0804, 0x18e4,
+	0xa7a4, 0xa6a8, 0x0804, 0x18e4, 0xa7bc, 0xa6c0, 0x0804, 0x18e4,
+	0xa7d4, 0xa6d8, 0x0804, 0x18e4, 0x2c05, 0x908a, 0x0036, 0x1a0c,
+	0x0db4, 0x9082, 0x001b, 0x0002, 0x1867, 0x1867, 0x1869, 0x1867,
+	0x1867, 0x1867, 0x186f, 0x1867, 0x1867, 0x1867, 0x1875, 0x1867,
+	0x1867, 0x1867, 0x187b, 0x1867, 0x1867, 0x1867, 0x1881, 0x1867,
+	0x1867, 0x1867, 0x1887, 0x1867, 0x1867, 0x1867, 0x188d, 0x080c,
+	0x0db4, 0xa574, 0xa478, 0xa37c, 0xa280, 0x0804, 0x18e4, 0xa584,
+	0xa488, 0xa38c, 0xa290, 0x0804, 0x18e4, 0xa594, 0xa498, 0xa39c,
+	0xa2a0, 0x0804, 0x18e4, 0xa5a4, 0xa4a8, 0xa3ac, 0xa2b0, 0x0804,
+	0x18e4, 0xa5b4, 0xa4b8, 0xa3bc, 0xa2c0, 0x0804, 0x18e4, 0xa5c4,
+	0xa4c8, 0xa3cc, 0xa2d0, 0x0804, 0x18e4, 0xa5d4, 0xa4d8, 0xa3dc,
+	0xa2e0, 0x0804, 0x18e4, 0x2c05, 0x908a, 0x0034, 0x1a0c, 0x0db4,
+	0x9082, 0x001b, 0x0002, 0x18b6, 0x18b4, 0x18b4, 0x18b4, 0x18b4,
+	0x18b4, 0x18bd, 0x18b4, 0x18b4, 0x18b4, 0x18b4, 0x18b4, 0x18c4,
+	0x18b4, 0x18b4, 0x18b4, 0x18b4, 0x18b4, 0x18cb, 0x18b4, 0x18b4,
+	0x18b4, 0x18b4, 0x18b4, 0x18d2, 0x080c, 0x0db4, 0xa56c, 0xa470,
+	0xa774, 0xa678, 0xa37c, 0xa280, 0x0438, 0xa584, 0xa488, 0xa78c,
+	0xa690, 0xa394, 0xa298, 0x0400, 0xa59c, 0xa4a0, 0xa7a4, 0xa6a8,
+	0xa3ac, 0xa2b0, 0x00c8, 0xa5b4, 0xa4b8, 0xa7bc, 0xa6c0, 0xa3c4,
+	0xa2c8, 0x0090, 0xa5cc, 0xa4d0, 0xa7d4, 0xa6d8, 0xa3dc, 0xa2e0,
+	0x0058, 0x9d86, 0x000e, 0x1130, 0x080c, 0x1ee0, 0x1904, 0x17ed,
+	0x900e, 0x0050, 0x080c, 0x0db4, 0xab2e, 0xaa32, 0xad1e, 0xac22,
+	0xaf26, 0xae2a, 0x080c, 0x1ee0, 0x0005, 0x6014, 0x2048, 0x6118,
+	0x810c, 0x810c, 0x810c, 0x81ff, 0x1118, 0xa887, 0x0001, 0x0008,
+	0xa986, 0x601b, 0x0002, 0xa974, 0xd1dc, 0x1108, 0x0005, 0xa934,
+	0xa88c, 0x9106, 0x1158, 0xa938, 0xa890, 0x9106, 0x1138, 0x601c,
+	0xc084, 0x601e, 0x2009, 0x0048, 0x0804, 0x9ebc, 0x0005, 0x0126,
+	0x00c6, 0x2091, 0x2200, 0x00ce, 0x7908, 0x918c, 0x0007, 0x9186,
+	0x0000, 0x05b0, 0x9186, 0x0003, 0x0598, 0x6020, 0x6023, 0x0000,
+	0x0006, 0x2031, 0x0008, 0x00c6, 0x781f, 0x0808, 0x7808, 0xd09c,
+	0x0120, 0x080c, 0x130c, 0x8631, 0x1db8, 0x00ce, 0x781f, 0x0800,
+	0x2031, 0x0168, 0x00c6, 0x7808, 0xd09c, 0x190c, 0x130c, 0x00ce,
+	0x2001, 0x0038, 0x080c, 0x19e7, 0x7930, 0x9186, 0x0040, 0x0160,
+	0x9186, 0x0042, 0x190c, 0x0db4, 0x2001, 0x001e, 0x8001, 0x1df0,
+	0x8631, 0x1d40, 0x080c, 0x19f6, 0x000e, 0x6022, 0x012e, 0x0005,
+	0x080c, 0x19e3, 0x7827, 0x0015, 0x7828, 0x9c06, 0x1db8, 0x782b,
+	0x0000, 0x0ca0, 0x00f6, 0x2079, 0x0300, 0x7803, 0x0000, 0x78ab,
+	0x0004, 0x00fe, 0x080c, 0x6f9b, 0x11b0, 0x2001, 0x0138, 0x2003,
+	0x0000, 0x2001, 0x0160, 0x2003, 0x0000, 0x2011, 0x012c, 0xa001,
+	0xa001, 0x8211, 0x1de0, 0x0081, 0x0066, 0x2031, 0x0000, 0x080c,
+	0x704b, 0x006e, 0x0005, 0x0479, 0x0039, 0x2001, 0x0160, 0x2502,
+	0x2001, 0x0138, 0x2202, 0x0005, 0x00e6, 0x2071, 0x0200, 0x080c,
+	0x2a6b, 0x2009, 0x003c, 0x080c, 0x226a, 0x2001, 0x015d, 0x2003,
+	0x0000, 0x7000, 0x9084, 0x003c, 0x1de0, 0x080c, 0x7f46, 0x70a0,
+	0x70a2, 0x7098, 0x709a, 0x709c, 0x709e, 0x2001, 0x020d, 0x2003,
+	0x0020, 0x00f6, 0x2079, 0x0300, 0x080c, 0x12c5, 0x7803, 0x0001,
+	0x00fe, 0x00ee, 0x0005, 0x2001, 0x0138, 0x2014, 0x2003, 0x0000,
+	0x2001, 0x0160, 0x202c, 0x2003, 0x0000, 0x080c, 0x6f9b, 0x1108,
+	0x0005, 0x2021, 0x0260, 0x2001, 0x0141, 0x201c, 0xd3dc, 0x1168,
+	0x2001, 0x0109, 0x201c, 0x939c, 0x0048, 0x1160, 0x2001, 0x0111,
+	0x201c, 0x83ff, 0x1110, 0x8421, 0x1d70, 0x2001, 0x015d, 0x2003,
+	0x0000, 0x0005, 0x0046, 0x2021, 0x0019, 0x2003, 0x0048, 0xa001,
+	0xa001, 0x201c, 0x939c, 0x0048, 0x0120, 0x8421, 0x1db0, 0x004e,
+	0x0c60, 0x004e, 0x0c40, 0x601c, 0xc084, 0x601e, 0x0005, 0x2c08,
+	0x621c, 0x080c, 0x151a, 0x7930, 0x0005, 0x2c08, 0x621c, 0x080c,
+	0x15c5, 0x7930, 0x0005, 0x8001, 0x1df0, 0x0005, 0x2031, 0x0005,
+	0x781c, 0x9084, 0x0007, 0x0170, 0x2001, 0x0038, 0x0c41, 0x9186,
+	0x0040, 0x0904, 0x1a54, 0x2001, 0x001e, 0x0c69, 0x8631, 0x1d80,
+	0x080c, 0x0db4, 0x781f, 0x0202, 0x2001, 0x015d, 0x2003, 0x0000,
+	0x2001, 0x0b10, 0x0c01, 0x781c, 0xd084, 0x0110, 0x0861, 0x04e0,
+	0x2001, 0x0030, 0x0891, 0x9186, 0x0040, 0x0568, 0x781c, 0xd084,
+	0x1da8, 0x781f, 0x0101, 0x2001, 0x0014, 0x0869, 0x2001, 0x0037,
+	0x0821, 0x9186, 0x0040, 0x0140, 0x2001, 0x0030, 0x080c, 0x19ed,
+	0x9186, 0x0040, 0x190c, 0x0db4, 0x00d6, 0x2069, 0x0200, 0x692c,
+	0xd1f4, 0x1170, 0xd1c4, 0x0160, 0xd19c, 0x0130, 0x6800, 0x9085,
+	0x1800, 0x6802, 0x00de, 0x0080, 0x6908, 0x9184, 0x0007, 0x1db0,
+	0x00de, 0x781f, 0x0100, 0x791c, 0x9184, 0x0007, 0x090c, 0x0db4,
+	0xa001, 0xa001, 0x781f, 0x0200, 0x0005, 0x0126, 0x2091, 0x2400,
+	0x2071, 0x1a35, 0x2079, 0x0090, 0x012e, 0x0005, 0x9280, 0x0005,
+	0x2004, 0x2048, 0xa97c, 0xd1dc, 0x1904, 0x1ae9, 0xa964, 0x9184,
+	0x0007, 0x0002, 0x1a72, 0x1ad4, 0x1a89, 0x1a89, 0x1a89, 0x1abc,
+	0x1a9c, 0x1a8b, 0x918c, 0x00ff, 0x9186, 0x0008, 0x1170, 0xa87c,
+	0xd0b4, 0x0904, 0x1d07, 0x9006, 0xa842, 0xa83e, 0xa988, 0x2900,
+	0xa85a, 0xa813, 0x1f23, 0x0804, 0x1ae5, 0x9186, 0x0048, 0x0904,
+	0x1ad4, 0x080c, 0x0db4, 0xa87c, 0xd0b4, 0x0904, 0x1d07, 0xa890,
+	0xa842, 0xa83a, 0xa88c, 0xa83e, 0xa836, 0xa8ac, 0xa846, 0xa8b0,
+	0xa84a, 0xa988, 0x0804, 0x1adc, 0xa864, 0x9084, 0x00ff, 0x9086,
+	0x001e, 0x1d38, 0xa87c, 0xd0b4, 0x0904, 0x1d07, 0xa890, 0xa842,
+	0xa83a, 0xa88c, 0xa83e, 0xa836, 0xa8ac, 0xa846, 0xa8b0, 0xa84a,
+	0xa804, 0xa85a, 0x2040, 0xa064, 0x9084, 0x000f, 0x9080, 0x1f28,
+	0x2005, 0xa812, 0xa988, 0x0448, 0x918c, 0x00ff, 0x9186, 0x0015,
+	0x1540, 0xa87c, 0xd0b4, 0x0904, 0x1d07, 0xa804, 0xa85a, 0x2040,
+	0xa064, 0x9084, 0x000f, 0x9080, 0x1f28, 0x2005, 0xa812, 0xa988,
+	0x9006, 0xa842, 0xa83e, 0x0088, 0xa87c, 0xd0b4, 0x0904, 0x1d07,
+	0xa988, 0x9006, 0xa842, 0xa83e, 0x2900, 0xa85a, 0xa864, 0x9084,
+	0x000f, 0x9080, 0x1f28, 0x2005, 0xa812, 0xa916, 0xa87c, 0xc0dd,
+	0xa87e, 0x0005, 0x00f6, 0x2079, 0x0090, 0x782c, 0xd0fc, 0x190c,
+	0x1d4c, 0x00e6, 0x2071, 0x1a35, 0x7000, 0x9005, 0x1904, 0x1b52,
+	0x7206, 0x9280, 0x0005, 0x204c, 0x9280, 0x0004, 0x2004, 0x782b,
+	0x0004, 0x00f6, 0x2079, 0x0200, 0x7803, 0x0040, 0x00fe, 0x00b6,
+	0x2058, 0xb86c, 0x7836, 0xb890, 0x00be, 0x00f6, 0x2079, 0x0200,
+	0x7803, 0x0040, 0xa001, 0xa001, 0xa001, 0xa001, 0xa001, 0xa001,
+	0x781a, 0x2079, 0x0100, 0x8004, 0x78d6, 0x00fe, 0xa814, 0x2050,
+	0xa858, 0x2040, 0xa810, 0x2060, 0xa064, 0x90ec, 0x000f, 0xa944,
+	0x791a, 0x7116, 0xa848, 0x781e, 0x701a, 0x9006, 0x700e, 0x7012,
+	0x7004, 0xa940, 0xa838, 0x9106, 0x1500, 0xa93c, 0xa834, 0x9106,
+	0x11e0, 0x0006, 0x0016, 0xa938, 0xa834, 0x9105, 0x0118, 0x001e,
+	0x000e, 0x0098, 0x001e, 0x000e, 0x8aff, 0x01c8, 0x0126, 0x2091,
+	0x8000, 0x2009, 0x0306, 0x200b, 0x0808, 0x00d9, 0x0108, 0x00c9,
+	0x012e, 0x9006, 0x00ee, 0x00fe, 0x0005, 0x0036, 0x0046, 0xab38,
+	0xac34, 0x080c, 0x1f48, 0x004e, 0x003e, 0x0d30, 0x0c98, 0x9085,
+	0x0001, 0x0c80, 0x2009, 0x0306, 0x200b, 0x4800, 0x7027, 0x0000,
+	0x0005, 0x0076, 0x0066, 0x0056, 0x0046, 0x0036, 0x0026, 0x8aff,
+	0x0904, 0x1d00, 0x700c, 0x7214, 0x923a, 0x7010, 0x7218, 0x9203,
+	0x0a04, 0x1cff, 0x9705, 0x0904, 0x1cff, 0x903e, 0x2730, 0xa880,
+	0xd0fc, 0x1190, 0x2d00, 0x0002, 0x1c94, 0x1bd4, 0x1bd4, 0x1c94,
+	0x1c94, 0x1c71, 0x1c94, 0x1bd4, 0x1c78, 0x1c23, 0x1c23, 0x1c94,
+	0x1c94, 0x1c94, 0x1c6b, 0x1c23, 0xc0fc, 0xa882, 0xab2c, 0xaa30,
+	0xad1c, 0xac20, 0xdd9c, 0x0904, 0x1c96, 0x2c05, 0x908a, 0x0034,
+	0x1a0c, 0x0db4, 0x9082, 0x001b, 0x0002, 0x1bc0, 0x1bbe, 0x1bbe,
+	0x1bbe, 0x1bbe, 0x1bbe, 0x1bc4, 0x1bbe, 0x1bbe, 0x1bbe, 0x1bbe,
+	0x1bbe, 0x1bc8, 0x1bbe, 0x1bbe, 0x1bbe, 0x1bbe, 0x1bbe, 0x1bcc,
+	0x1bbe, 0x1bbe, 0x1bbe, 0x1bbe, 0x1bbe, 0x1bd0, 0x080c, 0x0db4,
+	0xa774, 0xa678, 0x0804, 0x1c96, 0xa78c, 0xa690, 0x0804, 0x1c96,
+	0xa7a4, 0xa6a8, 0x0804, 0x1c96, 0xa7bc, 0xa6c0, 0x0804, 0x1c96,
+	0xa7d4, 0xa6d8, 0x0804, 0x1c96, 0x2c05, 0x908a, 0x0036, 0x1a0c,
+	0x0db4, 0x9082, 0x001b, 0x0002, 0x1bf7, 0x1bf7, 0x1bf9, 0x1bf7,
+	0x1bf7, 0x1bf7, 0x1bff, 0x1bf7, 0x1bf7, 0x1bf7, 0x1c05, 0x1bf7,
+	0x1bf7, 0x1bf7, 0x1c0b, 0x1bf7, 0x1bf7, 0x1bf7, 0x1c11, 0x1bf7,
+	0x1bf7, 0x1bf7, 0x1c17, 0x1bf7, 0x1bf7, 0x1bf7, 0x1c1d, 0x080c,
+	0x0db4, 0xa574, 0xa478, 0xa37c, 0xa280, 0x0804, 0x1c96, 0xa584,
+	0xa488, 0xa38c, 0xa290, 0x0804, 0x1c96, 0xa594, 0xa498, 0xa39c,
+	0xa2a0, 0x0804, 0x1c96, 0xa5a4, 0xa4a8, 0xa3ac, 0xa2b0, 0x0804,
+	0x1c96, 0xa5b4, 0xa4b8, 0xa3bc, 0xa2c0, 0x0804, 0x1c96, 0xa5c4,
+	0xa4c8, 0xa3cc, 0xa2d0, 0x0804, 0x1c96, 0xa5d4, 0xa4d8, 0xa3dc,
+	0xa2e0, 0x0804, 0x1c96, 0x2c05, 0x908a, 0x0034, 0x1a0c, 0x0db4,
+	0x9082, 0x001b, 0x0002, 0x1c46, 0x1c44, 0x1c44, 0x1c44, 0x1c44,
+	0x1c44, 0x1c4e, 0x1c44, 0x1c44, 0x1c44, 0x1c44, 0x1c44, 0x1c56,
+	0x1c44, 0x1c44, 0x1c44, 0x1c44, 0x1c44, 0x1c5d, 0x1c44, 0x1c44,
+	0x1c44, 0x1c44, 0x1c44, 0x1c64, 0x080c, 0x0db4, 0xa56c, 0xa470,
+	0xa774, 0xa678, 0xa37c, 0xa280, 0x0804, 0x1c96, 0xa584, 0xa488,
+	0xa78c, 0xa690, 0xa394, 0xa298, 0x0804, 0x1c96, 0xa59c, 0xa4a0,
+	0xa7a4, 0xa6a8, 0xa3ac, 0xa2b0, 0x04c8, 0xa5b4, 0xa4b8, 0xa7bc,
+	0xa6c0, 0xa3c4, 0xa2c8, 0x0490, 0xa5cc, 0xa4d0, 0xa7d4, 0xa6d8,
+	0xa3dc, 0xa2e0, 0x0458, 0xa864, 0x9084, 0x00ff, 0x9086, 0x001e,
+	0x1518, 0x080c, 0x1ee0, 0x1904, 0x1b6f, 0x900e, 0x0804, 0x1d00,
+	0xab64, 0x939c, 0x00ff, 0x9386, 0x0048, 0x1180, 0x00c6, 0x7004,
+	0x2060, 0x6004, 0x9086, 0x0043, 0x00ce, 0x0904, 0x1c23, 0xab9c,
+	0x9016, 0xad8c, 0xac90, 0xaf94, 0xae98, 0x0040, 0x9386, 0x0008,
+	0x0904, 0x1c23, 0x080c, 0x0db4, 0x080c, 0x0db4, 0x2009, 0x030f,
+	0x2104, 0xd0fc, 0x0530, 0x0066, 0x2009, 0x0306, 0x2104, 0x9084,
+	0x0030, 0x15c8, 0x2031, 0x1000, 0x200b, 0x4000, 0x2600, 0x9302,
+	0x928b, 0x0000, 0xa82e, 0xa932, 0x0278, 0x9105, 0x0168, 0x2011,
+	0x0000, 0x2618, 0x2600, 0x9500, 0xa81e, 0x9481, 0x0000, 0xa822,
+	0xa880, 0xc0fd, 0xa882, 0x0020, 0xa82f, 0x0000, 0xa833, 0x0000,
+	0x006e, 0x7b12, 0x7a16, 0x7d02, 0x7c06, 0x7f0a, 0x7e0e, 0x782b,
+	0x0001, 0x7000, 0x8000, 0x7002, 0xa83c, 0x9300, 0xa83e, 0xa840,
+	0x9201, 0xa842, 0x700c, 0x9300, 0x700e, 0x7010, 0x9201, 0x7012,
+	0x080c, 0x1ee0, 0x0428, 0x2031, 0x0080, 0x9584, 0x007f, 0x0108,
+	0x9632, 0x7124, 0x7000, 0x9086, 0x0000, 0x1198, 0xc185, 0x7126,
+	0x2009, 0x0306, 0x2104, 0xd0b4, 0x1904, 0x1ca6, 0x200b, 0x4040,
+	0x2009, 0x1a4e, 0x2104, 0x8000, 0x0a04, 0x1ca6, 0x200a, 0x0804,
+	0x1ca6, 0xc18d, 0x7126, 0xd184, 0x1d58, 0x0804, 0x1ca6, 0x9006,
+	0x002e, 0x003e, 0x004e, 0x005e, 0x006e, 0x007e, 0x0005, 0x080c,
+	0x0db4, 0x0026, 0x2001, 0x0105, 0x2003, 0x0010, 0x782b, 0x0004,
+	0x7003, 0x0000, 0x7004, 0x0016, 0x080c, 0x1b62, 0x001e, 0x2060,
+	0x6014, 0x2048, 0x080c, 0xbb2c, 0x0118, 0xa880, 0xc0bd, 0xa882,
+	0x6020, 0x9086, 0x0006, 0x1180, 0x2061, 0x0100, 0x62c8, 0x2001,
+	0x00fa, 0x8001, 0x1df0, 0x60c8, 0x9206, 0x1dc0, 0x60c4, 0xa89a,
+	0x60c8, 0xa896, 0x7004, 0x2060, 0x00c6, 0x080c, 0xb75d, 0x00ce,
+	0x2001, 0x19c6, 0x2004, 0x9c06, 0x1160, 0x2009, 0x0040, 0x080c,
+	0x226a, 0x080c, 0x98eb, 0x2011, 0x0000, 0x080c, 0x977c, 0x080c,
+	0x8a4a, 0x002e, 0x0804, 0x1e90, 0x0126, 0x2091, 0x2400, 0xa858,
+	0x2040, 0x792c, 0x782b, 0x0002, 0x9184, 0x0700, 0x1904, 0x1d09,
+	0x7000, 0x0002, 0x1e90, 0x1d5e, 0x1dde, 0x1e8e, 0x8001, 0x7002,
+	0x7027, 0x0000, 0xd19c, 0x1158, 0x8aff, 0x0904, 0x1dab, 0x080c,
+	0x1b69, 0x0904, 0x1e90, 0x080c, 0x1b69, 0x0804, 0x1e90, 0x782b,
+	0x0004, 0xd194, 0x0148, 0xa880, 0xc0fc, 0xa882, 0x8aff, 0x1518,
+	0xa87c, 0xc0f5, 0xa87e, 0x00f8, 0x0026, 0x0036, 0xab3c, 0xaa40,
+	0x0016, 0x7910, 0xa82c, 0x9100, 0xa82e, 0x7914, 0xa830, 0x9101,
+	0xa832, 0x001e, 0x7810, 0x931a, 0x7814, 0x9213, 0x7800, 0xa81e,
+	0x7804, 0xa822, 0xab3e, 0xaa42, 0x003e, 0x002e, 0x080c, 0x1efb,
+	0xa880, 0xc0fd, 0xa882, 0x2a00, 0xa816, 0x2800, 0xa85a, 0x2c00,
+	0xa812, 0x7003, 0x0000, 0x2009, 0x0306, 0x200b, 0x4800, 0x7027,
+	0x0000, 0x0804, 0x1e90, 0x00f6, 0x0026, 0x781c, 0x0006, 0x7818,
+	0x0006, 0x2079, 0x0100, 0x7a14, 0x9284, 0x1984, 0x9085, 0x0012,
+	0x7816, 0x0036, 0x2019, 0x1000, 0x8319, 0x090c, 0x0db4, 0x7820,
+	0xd0bc, 0x1dd0, 0x003e, 0x79c8, 0x000e, 0x9102, 0x001e, 0x0006,
+	0x0016, 0x79c4, 0x000e, 0x9103, 0x78c6, 0x000e, 0x78ca, 0x9284,
+	0x1984, 0x9085, 0x0012, 0x7816, 0x002e, 0x00fe, 0x782b, 0x0008,
+	0x7003, 0x0000, 0x080c, 0x1b62, 0x0804, 0x1e90, 0x8001, 0x7002,
+	0x7024, 0x8004, 0x7026, 0xd194, 0x0170, 0x782c, 0xd0fc, 0x1904,
+	0x1d51, 0xd19c, 0x1904, 0x1e8c, 0x8aff, 0x0904, 0x1e90, 0x080c,
+	0x1b69, 0x0804, 0x1e90, 0x0026, 0x0036, 0xab3c, 0xaa40, 0x080c,
+	0x1efb, 0xdd9c, 0x1904, 0x1e4b, 0x2c05, 0x908a, 0x0036, 0x1a0c,
+	0x0db4, 0x9082, 0x001b, 0x0002, 0x1e1f, 0x1e1f, 0x1e21, 0x1e1f,
+	0x1e1f, 0x1e1f, 0x1e27, 0x1e1f, 0x1e1f, 0x1e1f, 0x1e2d, 0x1e1f,
+	0x1e1f, 0x1e1f, 0x1e33, 0x1e1f, 0x1e1f, 0x1e1f, 0x1e39, 0x1e1f,
+	0x1e1f, 0x1e1f, 0x1e3f, 0x1e1f, 0x1e1f, 0x1e1f, 0x1e45, 0x080c,
+	0x0db4, 0xa07c, 0x931a, 0xa080, 0x9213, 0x0804, 0x1d80, 0xa08c,
+	0x931a, 0xa090, 0x9213, 0x0804, 0x1d80, 0xa09c, 0x931a, 0xa0a0,
+	0x9213, 0x0804, 0x1d80, 0xa0ac, 0x931a, 0xa0b0, 0x9213, 0x0804,
+	0x1d80, 0xa0bc, 0x931a, 0xa0c0, 0x9213, 0x0804, 0x1d80, 0xa0cc,
+	0x931a, 0xa0d0, 0x9213, 0x0804, 0x1d80, 0xa0dc, 0x931a, 0xa0e0,
+	0x9213, 0x0804, 0x1d80, 0x2c05, 0x908a, 0x0034, 0x1a0c, 0x0db4,
+	0x9082, 0x001b, 0x0002, 0x1e6e, 0x1e6c, 0x1e6c, 0x1e6c, 0x1e6c,
+	0x1e6c, 0x1e74, 0x1e6c, 0x1e6c, 0x1e6c, 0x1e6c, 0x1e6c, 0x1e7a,
+	0x1e6c, 0x1e6c, 0x1e6c, 0x1e6c, 0x1e6c, 0x1e80, 0x1e6c, 0x1e6c,
+	0x1e6c, 0x1e6c, 0x1e6c, 0x1e86, 0x080c, 0x0db4, 0xa07c, 0x931a,
+	0xa080, 0x9213, 0x0804, 0x1d80, 0xa094, 0x931a, 0xa098, 0x9213,
+	0x0804, 0x1d80, 0xa0ac, 0x931a, 0xa0b0, 0x9213, 0x0804, 0x1d80,
+	0xa0c4, 0x931a, 0xa0c8, 0x9213, 0x0804, 0x1d80, 0xa0dc, 0x931a,
+	0xa0e0, 0x9213, 0x0804, 0x1d80, 0x0804, 0x1d7c, 0x080c, 0x0db4,
+	0x012e, 0x0005, 0x00f6, 0x00e6, 0x2071, 0x1a35, 0x7000, 0x9086,
+	0x0000, 0x0904, 0x1edb, 0x2079, 0x0090, 0x2009, 0x0207, 0x210c,
+	0xd194, 0x01b8, 0x2009, 0x020c, 0x210c, 0x9184, 0x0003, 0x0188,
+	0x080c, 0xd8f6, 0x2001, 0x0133, 0x2004, 0x9005, 0x090c, 0x0db4,
+	0x0016, 0x2009, 0x0040, 0x080c, 0x226a, 0x001e, 0x2001, 0x020c,
+	0x2102, 0x2009, 0x0206, 0x2104, 0x2009, 0x0203, 0x210c, 0x9106,
+	0x1120, 0x2009, 0x0040, 0x080c, 0x226a, 0x782c, 0xd0fc, 0x09a8,
+	0x080c, 0x1d4c, 0x7000, 0x9086, 0x0000, 0x1978, 0x782b, 0x0004,
+	0x782c, 0xd0ac, 0x1de8, 0x2009, 0x0040, 0x080c, 0x226a, 0x782b,
+	0x0002, 0x7003, 0x0000, 0x080c, 0x1b62, 0x00ee, 0x00fe, 0x0005,
+	0xa880, 0xd0fc, 0x11a8, 0x8c60, 0x2c05, 0x9005, 0x0110, 0x8a51,
+	0x0005, 0xa004, 0x9005, 0x0168, 0xa85a, 0x2040, 0xa064, 0x9084,
+	0x000f, 0x9080, 0x1f28, 0x2065, 0x8cff, 0x090c, 0x0db4, 0x8a51,
+	0x0005, 0x2050, 0x0005, 0xa880, 0xd0fc, 0x11b8, 0x8a50, 0x8c61,
+	0x2c05, 0x9005, 0x1190, 0x2800, 0x9906, 0x0120, 0xa000, 0x9005,
+	0x1108, 0x2900, 0x2040, 0xa85a, 0xa064, 0x9084, 0x000f, 0x9080,
+	0x1f38, 0x2065, 0x8cff, 0x090c, 0x0db4, 0x0005, 0x0000, 0x001d,
+	0x0021, 0x0025, 0x0029, 0x002d, 0x0031, 0x0035, 0x0000, 0x001b,
+	0x0021, 0x0027, 0x002d, 0x0033, 0x0000, 0x0000, 0x0023, 0x0000,
+	0x0000, 0x1f1b, 0x1f17, 0x0000, 0x0000, 0x1f25, 0x0000, 0x1f1b,
+	0x1f22, 0x1f22, 0x1f1f, 0x0000, 0x0000, 0x0000, 0x1f25, 0x1f22,
+	0x0000, 0x1f1d, 0x1f1d, 0x0000, 0x0000, 0x1f25, 0x0000, 0x1f1d,
+	0x1f23, 0x1f23, 0x1f23, 0x0000, 0x0000, 0x0000, 0x1f25, 0x1f23,
+	0x00c6, 0x00d6, 0x0086, 0xab42, 0xac3e, 0xa888, 0x9055, 0x0904,
+	0x2127, 0x2940, 0xa064, 0x90ec, 0x000f, 0x9084, 0x00ff, 0x9086,
+	0x0008, 0x1118, 0x2061, 0x1f23, 0x00d0, 0x9de0, 0x1f28, 0x9d86,
+	0x0007, 0x0130, 0x9d86, 0x000e, 0x0118, 0x9d86, 0x000f, 0x1120,
+	0xa08c, 0x9422, 0xa090, 0x931b, 0x2c05, 0x9065, 0x1140, 0x0310,
+	0x0804, 0x2127, 0xa004, 0x9045, 0x0904, 0x2127, 0x08d8, 0x2c05,
+	0x9005, 0x0904, 0x200f, 0xdd9c, 0x1904, 0x1fcb, 0x908a, 0x0036,
+	0x1a0c, 0x0db4, 0x9082, 0x001b, 0x0002, 0x1fa0, 0x1fa0, 0x1fa2,
+	0x1fa0, 0x1fa0, 0x1fa0, 0x1fa8, 0x1fa0, 0x1fa0, 0x1fa0, 0x1fae,
+	0x1fa0, 0x1fa0, 0x1fa0, 0x1fb4, 0x1fa0, 0x1fa0, 0x1fa0, 0x1fba,
+	0x1fa0, 0x1fa0, 0x1fa0, 0x1fc0, 0x1fa0, 0x1fa0, 0x1fa0, 0x1fc6,
+	0x080c, 0x0db4, 0xa07c, 0x9422, 0xa080, 0x931b, 0x0804, 0x2005,
+	0xa08c, 0x9422, 0xa090, 0x931b, 0x0804, 0x2005, 0xa09c, 0x9422,
+	0xa0a0, 0x931b, 0x0804, 0x2005, 0xa0ac, 0x9422, 0xa0b0, 0x931b,
+	0x0804, 0x2005, 0xa0bc, 0x9422, 0xa0c0, 0x931b, 0x0804, 0x2005,
+	0xa0cc, 0x9422, 0xa0d0, 0x931b, 0x0804, 0x2005, 0xa0dc, 0x9422,
+	0xa0e0, 0x931b, 0x04d0, 0x908a, 0x0034, 0x1a0c, 0x0db4, 0x9082,
+	0x001b, 0x0002, 0x1fed, 0x1feb, 0x1feb, 0x1feb, 0x1feb, 0x1feb,
+	0x1ff2, 0x1feb, 0x1feb, 0x1feb, 0x1feb, 0x1feb, 0x1ff7, 0x1feb,
+	0x1feb, 0x1feb, 0x1feb, 0x1feb, 0x1ffc, 0x1feb, 0x1feb, 0x1feb,
+	0x1feb, 0x1feb, 0x2001, 0x080c, 0x0db4, 0xa07c, 0x9422, 0xa080,
+	0x931b, 0x0098, 0xa094, 0x9422, 0xa098, 0x931b, 0x0070, 0xa0ac,
+	0x9422, 0xa0b0, 0x931b, 0x0048, 0xa0c4, 0x9422, 0xa0c8, 0x931b,
+	0x0020, 0xa0dc, 0x9422, 0xa0e0, 0x931b, 0x0630, 0x2300, 0x9405,
+	0x0160, 0x8a51, 0x0904, 0x2127, 0x8c60, 0x0804, 0x1f77, 0xa004,
+	0x9045, 0x0904, 0x2127, 0x0804, 0x1f52, 0x8a51, 0x0904, 0x2127,
+	0x8c60, 0x2c05, 0x9005, 0x1158, 0xa004, 0x9045, 0x0904, 0x2127,
+	0xa064, 0x90ec, 0x000f, 0x9de0, 0x1f28, 0x2c05, 0x2060, 0xa880,
+	0xc0fc, 0xa882, 0x0804, 0x211c, 0x2c05, 0x8422, 0x8420, 0x831a,
+	0x9399, 0x0000, 0xac2e, 0xab32, 0xdd9c, 0x1904, 0x20b9, 0x9082,
+	0x001b, 0x0002, 0x2055, 0x2055, 0x2057, 0x2055, 0x2055, 0x2055,
+	0x2065, 0x2055, 0x2055, 0x2055, 0x2073, 0x2055, 0x2055, 0x2055,
+	0x2081, 0x2055, 0x2055, 0x2055, 0x208f, 0x2055, 0x2055, 0x2055,
+	0x209d, 0x2055, 0x2055, 0x2055, 0x20ab, 0x080c, 0x0db4, 0xa17c,
+	0x2400, 0x9122, 0xa180, 0x2300, 0x911b, 0x0a0c, 0x0db4, 0xa074,
+	0x9420, 0xa078, 0x9319, 0x0804, 0x2117, 0xa18c, 0x2400, 0x9122,
+	0xa190, 0x2300, 0x911b, 0x0a0c, 0x0db4, 0xa084, 0x9420, 0xa088,
+	0x9319, 0x0804, 0x2117, 0xa19c, 0x2400, 0x9122, 0xa1a0, 0x2300,
+	0x911b, 0x0a0c, 0x0db4, 0xa094, 0x9420, 0xa098, 0x9319, 0x0804,
+	0x2117, 0xa1ac, 0x2400, 0x9122, 0xa1b0, 0x2300, 0x911b, 0x0a0c,
+	0x0db4, 0xa0a4, 0x9420, 0xa0a8, 0x9319, 0x0804, 0x2117, 0xa1bc,
+	0x2400, 0x9122, 0xa1c0, 0x2300, 0x911b, 0x0a0c, 0x0db4, 0xa0b4,
+	0x9420, 0xa0b8, 0x9319, 0x0804, 0x2117, 0xa1cc, 0x2400, 0x9122,
+	0xa1d0, 0x2300, 0x911b, 0x0a0c, 0x0db4, 0xa0c4, 0x9420, 0xa0c8,
+	0x9319, 0x0804, 0x2117, 0xa1dc, 0x2400, 0x9122, 0xa1e0, 0x2300,
+	0x911b, 0x0a0c, 0x0db4, 0xa0d4, 0x9420, 0xa0d8, 0x9319, 0x0804,
+	0x2117, 0x9082, 0x001b, 0x0002, 0x20d7, 0x20d5, 0x20d5, 0x20d5,
+	0x20d5, 0x20d5, 0x20e4, 0x20d5, 0x20d5, 0x20d5, 0x20d5, 0x20d5,
+	0x20f1, 0x20d5, 0x20d5, 0x20d5, 0x20d5, 0x20d5, 0x20fe, 0x20d5,
+	0x20d5, 0x20d5, 0x20d5, 0x20d5, 0x210b, 0x080c, 0x0db4, 0xa17c,
+	0x2400, 0x9122, 0xa180, 0x2300, 0x911b, 0x0a0c, 0x0db4, 0xa06c,
+	0x9420, 0xa070, 0x9319, 0x0498, 0xa194, 0x2400, 0x9122, 0xa198,
+	0x2300, 0x911b, 0x0a0c, 0x0db4, 0xa084, 0x9420, 0xa088, 0x9319,
+	0x0430, 0xa1ac, 0x2400, 0x9122, 0xa1b0, 0x2300, 0x911b, 0x0a0c,
+	0x0db4, 0xa09c, 0x9420, 0xa0a0, 0x9319, 0x00c8, 0xa1c4, 0x2400,
+	0x9122, 0xa1c8, 0x2300, 0x911b, 0x0a0c, 0x0db4, 0xa0b4, 0x9420,
+	0xa0b8, 0x9319, 0x0060, 0xa1dc, 0x2400, 0x9122, 0xa1e0, 0x2300,
+	0x911b, 0x0a0c, 0x0db4, 0xa0cc, 0x9420, 0xa0d0, 0x9319, 0xac1e,
+	0xab22, 0xa880, 0xc0fd, 0xa882, 0x2800, 0xa85a, 0x2c00, 0xa812,
+	0x2a00, 0xa816, 0x000e, 0x000e, 0x000e, 0x9006, 0x0028, 0x008e,
+	0x00de, 0x00ce, 0x9085, 0x0001, 0x0005, 0x2001, 0x0005, 0x2004,
+	0xd0bc, 0x190c, 0x0dad, 0x9084, 0x0007, 0x0002, 0x2148, 0x1d4c,
+	0x2148, 0x213e, 0x2141, 0x2144, 0x2141, 0x2144, 0x080c, 0x1d4c,
+	0x0005, 0x080c, 0x118f, 0x0005, 0x080c, 0x1d4c, 0x080c, 0x118f,
+	0x0005, 0x0126, 0x2091, 0x2600, 0x2079, 0x0200, 0x2071, 0x0260,
+	0x2069, 0x1800, 0x7817, 0x0000, 0x789b, 0x0814, 0x78a3, 0x0406,
+	0x789f, 0x0410, 0x2009, 0x013b, 0x200b, 0x0400, 0x781b, 0x0002,
+	0x783b, 0x001f, 0x7837, 0x0020, 0x7803, 0x1600, 0x012e, 0x0005,
+	0x2091, 0x2600, 0x781c, 0xd0a4, 0x190c, 0x2267, 0x7900, 0xd1dc,
+	0x1118, 0x9084, 0x0006, 0x001a, 0x9084, 0x000e, 0x0002, 0x218f,
+	0x2187, 0x7937, 0x2187, 0x2189, 0x2189, 0x2189, 0x2189, 0x791d,
+	0x2187, 0x218b, 0x2187, 0x2189, 0x2187, 0x2189, 0x2187, 0x080c,
+	0x0db4, 0x0031, 0x0020, 0x080c, 0x791d, 0x080c, 0x7937, 0x0005,
+	0x0006, 0x0016, 0x0026, 0x080c, 0xd8f6, 0x7930, 0x9184, 0x0003,
+	0x01c0, 0x2001, 0x19c6, 0x2004, 0x9005, 0x0170, 0x2001, 0x0133,
+	0x2004, 0x9005, 0x090c, 0x0db4, 0x00c6, 0x2001, 0x19c6, 0x2064,
+	0x080c, 0xb75d, 0x00ce, 0x00f8, 0x2009, 0x0040, 0x080c, 0x226a,
+	0x00d0, 0x9184, 0x0014, 0x01a0, 0x6a00, 0x9286, 0x0003, 0x0160,
+	0x080c, 0x6f9b, 0x1138, 0x080c, 0x727f, 0x080c, 0x5cda, 0x080c,
+	0x6ecd, 0x0010, 0x080c, 0x5b99, 0x080c, 0x79e6, 0x0041, 0x0018,
+	0x9184, 0x9540, 0x1dc8, 0x002e, 0x001e, 0x000e, 0x0005, 0x00e6,
+	0x0036, 0x0046, 0x0056, 0x2071, 0x1a32, 0x080c, 0x195a, 0x005e,
+	0x004e, 0x003e, 0x00ee, 0x0005, 0x0126, 0x2091, 0x2e00, 0x2071,
+	0x1800, 0x7128, 0x2001, 0x193f, 0x2102, 0x2001, 0x1947, 0x2102,
+	0x2001, 0x013b, 0x2102, 0x2079, 0x0200, 0x2001, 0x0201, 0x789e,
+	0x78a3, 0x0200, 0x9198, 0x0007, 0x831c, 0x831c, 0x831c, 0x9398,
+	0x0005, 0x2320, 0x9182, 0x0204, 0x1230, 0x2011, 0x0008, 0x8423,
+	0x8423, 0x8423, 0x0488, 0x9182, 0x024c, 0x1240, 0x2011, 0x0007,
+	0x8403, 0x8003, 0x9400, 0x9400, 0x9420, 0x0430, 0x9182, 0x02bc,
+	0x1238, 0x2011, 0x0006, 0x8403, 0x8003, 0x9400, 0x9420, 0x00e0,
+	0x9182, 0x034c, 0x1230, 0x2011, 0x0005, 0x8403, 0x8003, 0x9420,
+	0x0098, 0x9182, 0x042c, 0x1228, 0x2011, 0x0004, 0x8423, 0x8423,
+	0x0058, 0x9182, 0x059c, 0x1228, 0x2011, 0x0003, 0x8403, 0x9420,
+	0x0018, 0x2011, 0x0002, 0x8423, 0x9482, 0x0228, 0x8002, 0x8020,
+	0x8301, 0x9402, 0x0110, 0x0208, 0x8321, 0x8217, 0x8203, 0x9405,
+	0x789a, 0x012e, 0x0005, 0x0006, 0x00d6, 0x2069, 0x0200, 0x6814,
+	0x9084, 0xffc0, 0x910d, 0x6916, 0x00de, 0x000e, 0x0005, 0x00d6,
+	0x2069, 0x0200, 0x9005, 0x6810, 0x0110, 0xc0a5, 0x0008, 0xc0a4,
+	0x6812, 0x00de, 0x0005, 0x0006, 0x00d6, 0x2069, 0x0200, 0x6810,
+	0x9084, 0xfff8, 0x910d, 0x6912, 0x00de, 0x000e, 0x0005, 0x7938,
+	0x080c, 0x0dad, 0x00f6, 0x2079, 0x0200, 0x7902, 0xa001, 0xa001,
+	0xa001, 0xa001, 0xa001, 0xa001, 0x7902, 0xa001, 0xa001, 0xa001,
+	0xa001, 0xa001, 0xa001, 0x00fe, 0x0005, 0x0126, 0x2091, 0x2800,
+	0x2061, 0x0100, 0x2071, 0x1800, 0x2009, 0x0000, 0x080c, 0x2a65,
+	0x080c, 0x2980, 0x6054, 0x8004, 0x8004, 0x8004, 0x8004, 0x9084,
+	0x000c, 0x6150, 0x918c, 0xfff3, 0x9105, 0x6052, 0x6050, 0x9084,
+	0xb17f, 0x9085, 0x2000, 0x6052, 0x2009, 0x196d, 0x2011, 0x196e,
+	0x6358, 0x939c, 0x38f0, 0x2320, 0x080c, 0x29c4, 0x1238, 0x939d,
+	0x4003, 0x94a5, 0x8603, 0x230a, 0x2412, 0x0030, 0x939d, 0x0203,
+	0x94a5, 0x8603, 0x230a, 0x2412, 0x9006, 0x080c, 0x29af, 0x9006,
+	0x080c, 0x2992, 0x20a9, 0x0012, 0x1d04, 0x22bc, 0x2091, 0x6000,
+	0x1f04, 0x22bc, 0x602f, 0x0100, 0x602f, 0x0000, 0x6050, 0x9085,
+	0x0400, 0x9084, 0xdfff, 0x6052, 0x6024, 0x6026, 0x080c, 0x269e,
+	0x2009, 0x00ef, 0x6132, 0x6136, 0x080c, 0x26ae, 0x60e7, 0x0000,
+	0x61ea, 0x60e3, 0x0002, 0x604b, 0xf7f7, 0x6043, 0x0000, 0x602f,
+	0x0080, 0x602f, 0x0000, 0x6007, 0x149f, 0x60bb, 0x0000, 0x20a9,
+	0x0018, 0x60bf, 0x0000, 0x1f04, 0x22e9, 0x60bb, 0x0000, 0x60bf,
+	0x0108, 0x60bf, 0x0012, 0x60bf, 0x0320, 0x60bf, 0x0018, 0x601b,
+	0x00f0, 0x601f, 0x001e, 0x600f, 0x006b, 0x602b, 0x402f, 0x012e,
+	0x0005, 0x00f6, 0x2079, 0x0140, 0x78c3, 0x0080, 0x78c3, 0x0083,
+	0x78c3, 0x0000, 0x00fe, 0x0005, 0x2001, 0x1834, 0x2003, 0x0000,
+	0x2001, 0x1833, 0x2003, 0x0001, 0x0005, 0x0126, 0x2091, 0x2800,
+	0x0006, 0x0016, 0x0026, 0x6124, 0x9184, 0x5e2c, 0x1118, 0x9184,
+	0x0007, 0x002a, 0x9195, 0x0004, 0x9284, 0x0007, 0x0002, 0x2349,
+	0x232f, 0x2332, 0x2335, 0x233a, 0x233c, 0x2340, 0x2344, 0x080c,
+	0x82c6, 0x00b8, 0x080c, 0x8393, 0x00a0, 0x080c, 0x8393, 0x080c,
+	0x82c6, 0x0078, 0x0099, 0x0068, 0x080c, 0x82c6, 0x0079, 0x0048,
+	0x080c, 0x8393, 0x0059, 0x0028, 0x080c, 0x8393, 0x080c, 0x82c6,
+	0x0029, 0x002e, 0x001e, 0x000e, 0x012e, 0x0005, 0x00a6, 0x6124,
+	0x6028, 0xd09c, 0x0118, 0xd19c, 0x1904, 0x2597, 0xd1f4, 0x190c,
+	0x0dad, 0x080c, 0x6f9b, 0x0904, 0x23a4, 0x080c, 0xc22c, 0x1120,
+	0x7000, 0x9086, 0x0003, 0x0570, 0x6024, 0x9084, 0x1800, 0x0550,
+	0x080c, 0x6fbe, 0x0118, 0x080c, 0x6fac, 0x1520, 0x6027, 0x0020,
+	0x6043, 0x0000, 0x080c, 0xc22c, 0x0168, 0x080c, 0x6fbe, 0x1150,
+	0x2001, 0x1977, 0x2003, 0x0001, 0x6027, 0x1800, 0x080c, 0x6e1c,
+	0x0804, 0x259a, 0x70a0, 0x9005, 0x1150, 0x70a3, 0x0001, 0x00d6,
+	0x2069, 0x0140, 0x080c, 0x6ff2, 0x00de, 0x1904, 0x259a, 0x080c,
+	0x7289, 0x0428, 0x080c, 0x6fbe, 0x1590, 0x6024, 0x9084, 0x1800,
+	0x1108, 0x0468, 0x080c, 0x7289, 0x080c, 0x727f, 0x080c, 0x5cda,
+	0x080c, 0x6ecd, 0x0804, 0x2597, 0xd1ac, 0x1508, 0x6024, 0xd0dc,
+	0x1170, 0xd0e4, 0x1178, 0xd0d4, 0x1190, 0xd0cc, 0x0130, 0x7094,
+	0x9086, 0x0028, 0x1110, 0x080c, 0x716e, 0x0804, 0x2597, 0x080c,
+	0x7284, 0x0048, 0x2001, 0x194d, 0x2003, 0x0002, 0x0020, 0x080c,
+	0x70d4, 0x0804, 0x2597, 0x080c, 0x7208, 0x0804, 0x2597, 0xd1ac,
+	0x0904, 0x24b8, 0x080c, 0x6f9b, 0x11c0, 0x6027, 0x0020, 0x0006,
+	0x0026, 0x0036, 0x080c, 0x6fb5, 0x1158, 0x080c, 0x727f, 0x080c,
+	0x5cda, 0x080c, 0x6ecd, 0x003e, 0x002e, 0x000e, 0x00ae, 0x0005,
+	0x003e, 0x002e, 0x000e, 0x080c, 0x6f73, 0x0016, 0x0046, 0x00c6,
+	0x644c, 0x9486, 0xf0f0, 0x1138, 0x2061, 0x0100, 0x644a, 0x6043,
+	0x0090, 0x6043, 0x0010, 0x74d6, 0x948c, 0xff00, 0x7038, 0xd084,
+	0x0178, 0x9186, 0xf800, 0x1160, 0x7044, 0xd084, 0x1148, 0xc085,
+	0x7046, 0x0036, 0x2418, 0x2011, 0x8016, 0x080c, 0x48e9, 0x003e,
+	0x080c, 0xc225, 0x1904, 0x2495, 0x9196, 0xff00, 0x05a8, 0x705c,
+	0x9084, 0x00ff, 0x810f, 0x81ff, 0x0110, 0x9116, 0x0568, 0x7130,
+	0xd184, 0x1550, 0x080c, 0x3135, 0x0128, 0xc18d, 0x7132, 0x080c,
+	0x6563, 0x1510, 0x6240, 0x9294, 0x0010, 0x0130, 0x6248, 0x9294,
+	0xff00, 0x9296, 0xff00, 0x01c0, 0x7030, 0xd08c, 0x0904, 0x2495,
+	0x7038, 0xd08c, 0x1140, 0x2001, 0x180c, 0x200c, 0xd1ac, 0x1904,
+	0x2495, 0xc1ad, 0x2102, 0x0036, 0x73d4, 0x2011, 0x8013, 0x080c,
+	0x48e9, 0x003e, 0x0804, 0x2495, 0x7038, 0xd08c, 0x1140, 0x2001,
+	0x180c, 0x200c, 0xd1ac, 0x1904, 0x2495, 0xc1ad, 0x2102, 0x0036,
+	0x73d4, 0x2011, 0x8013, 0x080c, 0x48e9, 0x003e, 0x7130, 0xc185,
+	0x7132, 0x2011, 0x1854, 0x220c, 0x00f0, 0x0016, 0x2009, 0x0001,
+	0x2011, 0x0100, 0x080c, 0x8218, 0x2019, 0x000e, 0x00c6, 0x2061,
+	0x0000, 0x080c, 0xd4c7, 0x00ce, 0x9484, 0x00ff, 0x9080, 0x313a,
+	0x200d, 0x918c, 0xff00, 0x810f, 0x2120, 0x9006, 0x2009, 0x000e,
+	0x080c, 0xd54b, 0x001e, 0xd1ac, 0x1148, 0x0016, 0x2009, 0x0002,
+	0x2019, 0x0004, 0x080c, 0x2fa7, 0x001e, 0x0078, 0x0156, 0x00b6,
+	0x20a9, 0x007f, 0x900e, 0x080c, 0x6247, 0x1110, 0x080c, 0x5cf4,
+	0x8108, 0x1f04, 0x248b, 0x00be, 0x015e, 0x00ce, 0x004e, 0x080c,
+	0x9dc8, 0x60e3, 0x0000, 0x001e, 0x2001, 0x1800, 0x2014, 0x9296,
+	0x0004, 0x1170, 0xd19c, 0x11a0, 0x2011, 0x180c, 0x2214, 0xd29c,
+	0x1120, 0x6204, 0x9295, 0x0002, 0x6206, 0x6228, 0xc29d, 0x622a,
+	0x2003, 0x0001, 0x2001, 0x1825, 0x2003, 0x0000, 0x6027, 0x0020,
+	0xd194, 0x0904, 0x2597, 0x0016, 0x6220, 0xd2b4, 0x0904, 0x2540,
+	0x080c, 0x80a1, 0x080c, 0x93ad, 0x6027, 0x0004, 0x00f6, 0x2019,
+	0x19c0, 0x2304, 0x907d, 0x0904, 0x250f, 0x7804, 0x9086, 0x0032,
+	0x15f0, 0x00d6, 0x00c6, 0x00e6, 0x0096, 0x2069, 0x0140, 0x782c,
+	0x685e, 0x7808, 0x685a, 0x6043, 0x0002, 0x2001, 0x0003, 0x8001,
+	0x1df0, 0x6043, 0x0000, 0x2001, 0x003c, 0x8001, 0x1df0, 0x080c,
+	0x2b26, 0x2001, 0x001e, 0x8001, 0x0240, 0x20a9, 0x0009, 0x080c,
+	0x2a40, 0x6904, 0xd1dc, 0x1140, 0x0cb0, 0x2001, 0x0100, 0x080c,
+	0x2b16, 0x9006, 0x080c, 0x2b16, 0x080c, 0x8861, 0x080c, 0x896d,
+	0x7814, 0x2048, 0xa867, 0x0103, 0x2f60, 0x080c, 0x9e42, 0x009e,
+	0x00ee, 0x00ce, 0x00de, 0x00fe, 0x001e, 0x00ae, 0x0005, 0x00fe,
+	0x00d6, 0x2069, 0x0140, 0x6804, 0x9084, 0x4000, 0x0110, 0x080c,
+	0x2b26, 0x00de, 0x00c6, 0x2061, 0x19b7, 0x6028, 0x080c, 0xc22c,
+	0x0120, 0x909a, 0x0003, 0x1258, 0x0018, 0x909a, 0x00c8, 0x1238,
+	0x8000, 0x602a, 0x00ce, 0x080c, 0x9389, 0x0804, 0x2596, 0x2061,
+	0x0100, 0x62c0, 0x080c, 0x9c4e, 0x2019, 0x19c0, 0x2304, 0x9065,
+	0x0120, 0x2009, 0x0027, 0x080c, 0x9ebc, 0x00ce, 0x0804, 0x2596,
+	0xd2bc, 0x0904, 0x2583, 0x080c, 0x80ae, 0x6014, 0x9084, 0x1984,
+	0x9085, 0x0010, 0x6016, 0x6027, 0x0004, 0x00d6, 0x2069, 0x0140,
+	0x6804, 0x9084, 0x4000, 0x0110, 0x080c, 0x2b26, 0x00de, 0x00c6,
+	0x2061, 0x19b7, 0x6044, 0x080c, 0xc22c, 0x0120, 0x909a, 0x0003,
+	0x1628, 0x0018, 0x909a, 0x00c8, 0x1608, 0x8000, 0x6046, 0x603c,
+	0x00ce, 0x9005, 0x0558, 0x2009, 0x07d0, 0x080c, 0x80a6, 0x9080,
+	0x0008, 0x2004, 0x9086, 0x0006, 0x1138, 0x6114, 0x918c, 0x1984,
+	0x918d, 0x0012, 0x6116, 0x00d0, 0x6114, 0x918c, 0x1984, 0x918d,
+	0x0016, 0x6116, 0x0098, 0x6027, 0x0004, 0x0080, 0x0036, 0x2019,
+	0x0001, 0x080c, 0x96d9, 0x003e, 0x2019, 0x19c6, 0x2304, 0x9065,
+	0x0120, 0x2009, 0x004f, 0x080c, 0x9ebc, 0x00ce, 0x001e, 0xd19c,
+	0x0904, 0x2609, 0x7038, 0xd0ac, 0x1904, 0x25de, 0x0016, 0x0156,
+	0x6027, 0x0008, 0x6050, 0x9085, 0x0040, 0x6052, 0x6050, 0x9084,
+	0xfbcf, 0x6052, 0x080c, 0x2a5f, 0x9085, 0x2000, 0x6052, 0x20a9,
+	0x0012, 0x1d04, 0x25b1, 0x080c, 0x80d5, 0x1f04, 0x25b1, 0x6050,
+	0x9085, 0x0400, 0x9084, 0xdfbf, 0x6052, 0x20a9, 0x0028, 0xa001,
+	0x1f04, 0x25bf, 0x6150, 0x9185, 0x1400, 0x6052, 0x20a9, 0x0366,
+	0x1d04, 0x25c8, 0x080c, 0x80d5, 0x6020, 0xd09c, 0x1130, 0x015e,
+	0x6152, 0x001e, 0x6027, 0x0008, 0x04a0, 0x080c, 0x2a27, 0x1f04,
+	0x25c8, 0x015e, 0x6152, 0x001e, 0x6027, 0x0008, 0x0016, 0x6028,
+	0xc09c, 0x602a, 0x080c, 0x9dc8, 0x60e3, 0x0000, 0x080c, 0xd8d5,
+	0x080c, 0xd8f0, 0x080c, 0x5393, 0xd0fc, 0x1138, 0x080c, 0xc225,
+	0x1120, 0x9085, 0x0001, 0x080c, 0x6fe2, 0x9006, 0x080c, 0x2b16,
+	0x2009, 0x0002, 0x080c, 0x2a65, 0x00e6, 0x2071, 0x1800, 0x7003,
+	0x0004, 0x080c, 0x0e80, 0x00ee, 0x6027, 0x0008, 0x080c, 0x0b8f,
+	0x001e, 0x918c, 0xffd0, 0x6126, 0x00ae, 0x0005, 0x0006, 0x0016,
+	0x0026, 0x0036, 0x00e6, 0x00f6, 0x0126, 0x2091, 0x8000, 0x2071,
+	0x1800, 0x71cc, 0x70ce, 0x9116, 0x0904, 0x265d, 0x81ff, 0x01a0,
+	0x2009, 0x0000, 0x080c, 0x2a65, 0x2011, 0x8011, 0x2019, 0x010e,
+	0x231c, 0x939e, 0x0007, 0x1118, 0x2019, 0x0001, 0x0010, 0x2019,
+	0x0000, 0x080c, 0x48e9, 0x0448, 0x2001, 0x1978, 0x200c, 0x81ff,
+	0x1140, 0x2001, 0x0109, 0x2004, 0xd0b4, 0x0118, 0x2019, 0x0003,
+	0x0008, 0x2118, 0x2011, 0x8012, 0x080c, 0x48e9, 0x080c, 0x0e80,
+	0x080c, 0x5393, 0xd0fc, 0x1188, 0x080c, 0xc225, 0x1170, 0x00c6,
+	0x080c, 0x26f9, 0x080c, 0x9640, 0x2061, 0x0100, 0x2019, 0x0028,
+	0x2009, 0x0002, 0x080c, 0x2fa7, 0x00ce, 0x012e, 0x00fe, 0x00ee,
+	0x003e, 0x002e, 0x001e, 0x000e, 0x0005, 0x2028, 0x918c, 0x00ff,
+	0x2130, 0x9094, 0xff00, 0x11f0, 0x2011, 0x1836, 0x2214, 0xd2ac,
+	0x11c8, 0x81ff, 0x01e8, 0x2011, 0x181e, 0x2204, 0x9106, 0x1190,
+	0x2011, 0x181f, 0x2214, 0x9294, 0xff00, 0x9584, 0xff00, 0x9206,
+	0x1148, 0x2011, 0x181f, 0x2214, 0x9294, 0x00ff, 0x9584, 0x00ff,
+	0x9206, 0x1120, 0x2500, 0x080c, 0x7c40, 0x0048, 0x9584, 0x00ff,
+	0x9080, 0x313a, 0x200d, 0x918c, 0xff00, 0x810f, 0x9006, 0x0005,
+	0x9080, 0x313a, 0x200d, 0x918c, 0x00ff, 0x0005, 0x00d6, 0x2069,
+	0x0140, 0x2001, 0x1817, 0x2003, 0x00ef, 0x20a9, 0x0010, 0x9006,
+	0x6852, 0x6856, 0x1f04, 0x26a9, 0x00de, 0x0005, 0x0006, 0x00d6,
+	0x0026, 0x2069, 0x0140, 0x2001, 0x1817, 0x2102, 0x8114, 0x8214,
+	0x8214, 0x8214, 0x20a9, 0x0010, 0x6853, 0x0000, 0x9006, 0x82ff,
+	0x1128, 0x9184, 0x000f, 0x9080, 0xddaa, 0x2005, 0x6856, 0x8211,
+	0x1f04, 0x26be, 0x002e, 0x00de, 0x000e, 0x0005, 0x00c6, 0x2061,
+	0x1800, 0x6030, 0x0110, 0xc09d, 0x0008, 0xc09c, 0x6032, 0x00ce,
+	0x0005, 0x0156, 0x00d6, 0x0026, 0x0016, 0x0006, 0x2069, 0x0140,
+	0x6980, 0x9116, 0x0180, 0x9112, 0x1230, 0x8212, 0x8210, 0x22a8,
+	0x2001, 0x0402, 0x0018, 0x22a8, 0x2001, 0x0404, 0x680e, 0x1f04,
+	0x26ee, 0x680f, 0x0000, 0x000e, 0x001e, 0x002e, 0x00de, 0x015e,
+	0x0005, 0x080c, 0x538f, 0xd0c4, 0x0150, 0xd0a4, 0x0140, 0x9006,
+	0x0046, 0x2020, 0x2009, 0x002e, 0x080c, 0xd54b, 0x004e, 0x0005,
+	0x00f6, 0x0016, 0x0026, 0x2079, 0x0140, 0x78c4, 0xd0dc, 0x0904,
+	0x2765, 0x080c, 0x29c4, 0x0660, 0x9084, 0x0700, 0x908e, 0x0600,
+	0x1120, 0x2011, 0x4000, 0x900e, 0x0458, 0x908e, 0x0500, 0x1120,
+	0x2011, 0x8000, 0x900e, 0x0420, 0x908e, 0x0400, 0x1120, 0x9016,
+	0x2009, 0x0001, 0x00e8, 0x908e, 0x0300, 0x1120, 0x9016, 0x2009,
+	0x0002, 0x00b0, 0x908e, 0x0200, 0x1120, 0x9016, 0x2009, 0x0004,
+	0x0078, 0x908e, 0x0100, 0x1548, 0x9016, 0x2009, 0x0008, 0x0040,
+	0x9084, 0x0700, 0x908e, 0x0300, 0x1500, 0x2011, 0x0030, 0x0058,
+	0x2300, 0x9080, 0x0020, 0x2018, 0x080c, 0x8259, 0x928c, 0xff00,
+	0x0110, 0x2011, 0x00ff, 0x2200, 0x8007, 0x9085, 0x004c, 0x78c2,
+	0x2009, 0x0138, 0x220a, 0x080c, 0x6f9b, 0x1118, 0x2009, 0x193d,
+	0x220a, 0x002e, 0x001e, 0x00fe, 0x0005, 0x78c3, 0x0000, 0x0cc8,
+	0x0126, 0x2091, 0x2800, 0x0006, 0x0016, 0x0026, 0x2001, 0x0170,
+	0x200c, 0x8000, 0x2014, 0x9184, 0x0003, 0x0110, 0x080c, 0x0dad,
+	0x002e, 0x001e, 0x000e, 0x012e, 0x0005, 0x2001, 0x0171, 0x2004,
+	0xd0dc, 0x0168, 0x2001, 0x0170, 0x200c, 0x918c, 0x00ff, 0x918e,
+	0x004c, 0x1128, 0x200c, 0x918c, 0xff00, 0x810f, 0x0005, 0x900e,
+	0x2001, 0x0227, 0x2004, 0x8007, 0x9084, 0x00ff, 0x8004, 0x9108,
+	0x2001, 0x0226, 0x2004, 0x8007, 0x9084, 0x00ff, 0x8004, 0x9108,
+	0x0005, 0x0018, 0x000c, 0x0018, 0x0020, 0x1000, 0x0800, 0x1000,
+	0x1800, 0x0156, 0x0006, 0x0016, 0x0026, 0x00e6, 0x2001, 0x1960,
+	0x2004, 0x908a, 0x0007, 0x1a0c, 0x0db4, 0x0033, 0x00ee, 0x002e,
+	0x001e, 0x000e, 0x015e, 0x0005, 0x27c3, 0x27e1, 0x2805, 0x2807,
+	0x2830, 0x2832, 0x2834, 0x2001, 0x0001, 0x080c, 0x260e, 0x080c,
+	0x2a22, 0x2001, 0x1962, 0x2003, 0x0000, 0x7828, 0x9084, 0xe1d7,
+	0x782a, 0x9006, 0x20a9, 0x0009, 0x080c, 0x29e0, 0x2001, 0x1960,
+	0x2003, 0x0006, 0x2009, 0x001e, 0x2011, 0x2835, 0x080c, 0x80b3,
+	0x0005, 0x2009, 0x1965, 0x200b, 0x0000, 0x2001, 0x196a, 0x2003,
+	0x0036, 0x2001, 0x1969, 0x2003, 0x002a, 0x2001, 0x1962, 0x2003,
+	0x0001, 0x9006, 0x080c, 0x2992, 0x2001, 0xffff, 0x20a9, 0x0009,
+	0x080c, 0x29e0, 0x2001, 0x1960, 0x2003, 0x0006, 0x2009, 0x001e,
+	0x2011, 0x2835, 0x080c, 0x80b3, 0x0005, 0x080c, 0x0db4, 0x2001,
+	0x196a, 0x2003, 0x0036, 0x2001, 0x1962, 0x2003, 0x0003, 0x7a38,
+	0x9294, 0x0005, 0x9296, 0x0004, 0x0110, 0x9006, 0x0010, 0x2001,
+	0x0001, 0x080c, 0x2992, 0x2001, 0x1966, 0x2003, 0x0000, 0x2001,
+	0xffff, 0x20a9, 0x0009, 0x080c, 0x29e0, 0x2001, 0x1960, 0x2003,
+	0x0006, 0x2009, 0x001e, 0x2011, 0x2835, 0x080c, 0x80b3, 0x0005,
+	0x080c, 0x0db4, 0x080c, 0x0db4, 0x0005, 0x0006, 0x0016, 0x0026,
+	0x00e6, 0x00f6, 0x0156, 0x0126, 0x2091, 0x8000, 0x2079, 0x0100,
+	0x2001, 0x1962, 0x2004, 0x908a, 0x0007, 0x1a0c, 0x0db4, 0x0043,
+	0x012e, 0x015e, 0x00fe, 0x00ee, 0x002e, 0x001e, 0x000e, 0x0005,
+	0x2857, 0x2877, 0x28b7, 0x28e7, 0x290b, 0x291b, 0x291d, 0x080c,
+	0x29d4, 0x11b0, 0x7850, 0x9084, 0xefff, 0x7852, 0x2009, 0x1968,
+	0x2104, 0x7a38, 0x9294, 0x0005, 0x9296, 0x0004, 0x0110, 0xc08d,
+	0x0008, 0xc085, 0x200a, 0x2001, 0x1960, 0x2003, 0x0001, 0x0030,
+	0x080c, 0x2941, 0x2001, 0xffff, 0x080c, 0x27d2, 0x0005, 0x080c,
+	0x291f, 0x05e0, 0x2009, 0x1969, 0x2104, 0x8001, 0x200a, 0x080c,
+	0x29d4, 0x1178, 0x7850, 0x9084, 0xefff, 0x7852, 0x7a38, 0x9294,
+	0x0005, 0x9296, 0x0005, 0x0518, 0x2009, 0x1968, 0x2104, 0xc085,
+	0x200a, 0x2009, 0x1965, 0x2104, 0x8000, 0x200a, 0x9086, 0x0005,
+	0x0118, 0x080c, 0x2927, 0x00c0, 0x200b, 0x0000, 0x7a38, 0x9294,
+	0x0006, 0x9296, 0x0004, 0x0110, 0x9006, 0x0010, 0x2001, 0x0001,
+	0x080c, 0x29af, 0x2001, 0x1962, 0x2003, 0x0002, 0x0028, 0x2001,
+	0x1960, 0x2003, 0x0003, 0x0010, 0x080c, 0x27f4, 0x0005, 0x080c,
+	0x291f, 0x0560, 0x2009, 0x1969, 0x2104, 0x8001, 0x200a, 0x080c,
+	0x29d4, 0x1168, 0x7850, 0x9084, 0xefff, 0x7852, 0x2001, 0x1960,
+	0x2003, 0x0003, 0x2001, 0x1961, 0x2003, 0x0000, 0x00b8, 0x2009,
+	0x1969, 0x2104, 0x9005, 0x1118, 0x080c, 0x2964, 0x0010, 0x080c,
+	0x2934, 0x080c, 0x2927, 0x2009, 0x1965, 0x200b, 0x0000, 0x2001,
+	0x1962, 0x2003, 0x0001, 0x080c, 0x27f4, 0x0000, 0x0005, 0x04b9,
+	0x0508, 0x080c, 0x29d4, 0x11b8, 0x7850, 0x9084, 0xefff, 0x7852,
+	0x2009, 0x1966, 0x2104, 0x8000, 0x200a, 0x9086, 0x0007, 0x0108,
+	0x0078, 0x2001, 0x196b, 0x2003, 0x000a, 0x2009, 0x1968, 0x2104,
+	0xc0fd, 0x200a, 0x0038, 0x0419, 0x2001, 0x1962, 0x2003, 0x0004,
+	0x080c, 0x281f, 0x0005, 0x0099, 0x0168, 0x080c, 0x29d4, 0x1138,
+	0x7850, 0x9084, 0xefff, 0x7852, 0x080c, 0x280b, 0x0018, 0x0079,
+	0x080c, 0x281f, 0x0005, 0x080c, 0x0db4, 0x080c, 0x0db4, 0x2009,
+	0x196a, 0x2104, 0x8001, 0x200a, 0x090c, 0x2980, 0x0005, 0x7a38,
+	0x9294, 0x0005, 0x9296, 0x0005, 0x0110, 0x9006, 0x0010, 0x2001,
+	0x0001, 0x080c, 0x29af, 0x0005, 0x7a38, 0x9294, 0x0006, 0x9296,
+	0x0006, 0x0110, 0x9006, 0x0010, 0x2001, 0x0001, 0x080c, 0x2992,
+	0x0005, 0x2009, 0x1965, 0x2104, 0x8000, 0x200a, 0x9086, 0x0005,
+	0x0108, 0x0068, 0x200b, 0x0000, 0x7a38, 0x9294, 0x0006, 0x9296,
+	0x0006, 0x0110, 0x9006, 0x0010, 0x2001, 0x0001, 0x04d9, 0x7a38,
+	0x9294, 0x0005, 0x9296, 0x0005, 0x0110, 0x9006, 0x0010, 0x2001,
+	0x0001, 0x080c, 0x29af, 0x0005, 0x0086, 0x2001, 0x1968, 0x2004,
+	0x9084, 0x7fff, 0x090c, 0x0db4, 0x2009, 0x1967, 0x2144, 0x8846,
+	0x280a, 0x9844, 0x0dd8, 0xd08c, 0x1120, 0xd084, 0x1120, 0x080c,
+	0x0db4, 0x9006, 0x0010, 0x2001, 0x0001, 0x00a1, 0x008e, 0x0005,
+	0x0006, 0x0156, 0x2001, 0x1960, 0x20a9, 0x0009, 0x2003, 0x0000,
+	0x8000, 0x1f04, 0x2986, 0x2001, 0x1967, 0x2003, 0x8000, 0x015e,
+	0x000e, 0x0005, 0x00f6, 0x2079, 0x0100, 0x9085, 0x0000, 0x0158,
+	0x7838, 0x9084, 0xfff9, 0x9085, 0x0004, 0x783a, 0x2009, 0x196d,
+	0x210c, 0x795a, 0x0050, 0x7838, 0x9084, 0xfffb, 0x9085, 0x0006,
+	0x783a, 0x2009, 0x196e, 0x210c, 0x795a, 0x00fe, 0x0005, 0x00f6,
+	0x2079, 0x0100, 0x9085, 0x0000, 0x0138, 0x7838, 0x9084, 0xfffa,
+	0x9085, 0x0004, 0x783a, 0x0030, 0x7838, 0x9084, 0xfffb, 0x9085,
+	0x0005, 0x783a, 0x00fe, 0x0005, 0x0006, 0x2001, 0x0100, 0x2004,
+	0x9082, 0x0007, 0x000e, 0x0005, 0x0006, 0x2001, 0x0100, 0x2004,
+	0x9082, 0x0009, 0x000e, 0x0005, 0x0156, 0x20a9, 0x0064, 0x7820,
+	0x080c, 0x2a5f, 0xd09c, 0x1110, 0x1f04, 0x29d7, 0x015e, 0x0005,
+	0x0126, 0x0016, 0x0006, 0x2091, 0x8000, 0x7850, 0x9085, 0x0040,
+	0x7852, 0x7850, 0x9084, 0xfbcf, 0x7852, 0x080c, 0x2a5f, 0x9085,
+	0x2000, 0x7852, 0x000e, 0x2008, 0x9186, 0x0000, 0x1118, 0x783b,
+	0x0007, 0x0090, 0x9186, 0x0001, 0x1118, 0x783b, 0x0006, 0x0060,
+	0x9186, 0x0002, 0x1118, 0x783b, 0x0005, 0x0030, 0x9186, 0x0003,
+	0x1118, 0x783b, 0x0004, 0x0000, 0x0006, 0x1d04, 0x2a0d, 0x080c,
+	0x80d5, 0x1f04, 0x2a0d, 0x7850, 0x9085, 0x0400, 0x9084, 0xdfbf,
+	0x7852, 0x080c, 0x2a5f, 0x9085, 0x1000, 0x7852, 0x000e, 0x001e,
+	0x012e, 0x0005, 0x7850, 0x9084, 0xffcf, 0x7852, 0x0005, 0x0006,
+	0x0156, 0x00f6, 0x2079, 0x0100, 0x20a9, 0x000a, 0x7854, 0xd0ac,
+	0x1130, 0x7820, 0xd0e4, 0x1140, 0x1f04, 0x2a31, 0x0028, 0x7854,
+	0xd08c, 0x1110, 0x1f04, 0x2a37, 0x00fe, 0x015e, 0x000e, 0x0005,
+	0x1d04, 0x2a40, 0x080c, 0x80d5, 0x1f04, 0x2a40, 0x0005, 0x0006,
+	0x2001, 0x196c, 0x2004, 0x9086, 0x0000, 0x000e, 0x0005, 0x0006,
+	0x2001, 0x196c, 0x2004, 0x9086, 0x0001, 0x000e, 0x0005, 0x0006,
+	0x2001, 0x196c, 0x2004, 0x9086, 0x0002, 0x000e, 0x0005, 0xa001,
+	0xa001, 0xa001, 0xa001, 0xa001, 0x0005, 0x0006, 0x2001, 0x1978,
+	0x2102, 0x000e, 0x0005, 0x2009, 0x0171, 0x2104, 0xd0dc, 0x0140,
+	0x2009, 0x0170, 0x2104, 0x200b, 0x0080, 0xa001, 0xa001, 0x200a,
+	0x0005, 0x0036, 0x0046, 0x2001, 0x0141, 0x200c, 0x918c, 0xff00,
+	0x9186, 0x2000, 0x0118, 0x9186, 0x0100, 0x1588, 0x2009, 0x00a2,
+	0x080c, 0x0e2f, 0x2019, 0x0160, 0x2324, 0x2011, 0x0003, 0x2009,
+	0x0169, 0x2104, 0x9084, 0x0007, 0x210c, 0x918c, 0x0007, 0x910e,
+	0x1db0, 0x9086, 0x0003, 0x11b8, 0x2304, 0x9402, 0x02a0, 0x1d60,
+	0x8211, 0x1d68, 0x84ff, 0x0170, 0x2001, 0x0141, 0x200c, 0x918c,
+	0xff00, 0x9186, 0x0100, 0x0130, 0x2009, 0x180c, 0x2104, 0xc0dd,
+	0x200a, 0x0008, 0x0419, 0x2009, 0x0000, 0x080c, 0x0e2f, 0x004e,
+	0x003e, 0x0005, 0x2001, 0x180c, 0x2004, 0xd0dc, 0x01b0, 0x2001,
+	0x0160, 0x2004, 0x9005, 0x0140, 0x2001, 0x0141, 0x2004, 0x9084,
+	0xff00, 0x9086, 0x0100, 0x1148, 0x0126, 0x2091, 0x8000, 0x0016,
+	0x0026, 0x0021, 0x002e, 0x001e, 0x012e, 0x0005, 0x00c6, 0x2061,
+	0x0100, 0x6014, 0x0006, 0x2001, 0x0161, 0x2003, 0x0000, 0x6017,
+	0x0018, 0xa001, 0xa001, 0x602f, 0x0008, 0x6104, 0x918e, 0x0010,
+	0x6106, 0x918e, 0x0010, 0x6106, 0x6017, 0x0040, 0x04b9, 0x001e,
+	0x9184, 0x0003, 0x01e0, 0x0036, 0x0016, 0x2019, 0x0141, 0x6124,
+	0x918c, 0x0028, 0x1120, 0x2304, 0x9084, 0x2800, 0x0dc0, 0x001e,
+	0x919c, 0xffe4, 0x9184, 0x0001, 0x0118, 0x9385, 0x0009, 0x6016,
+	0x9184, 0x0002, 0x0118, 0x9385, 0x0012, 0x6016, 0x003e, 0x2001,
+	0x180c, 0x200c, 0xc1dc, 0x2102, 0x00ce, 0x0005, 0x0016, 0x0026,
+	0x080c, 0x6fb5, 0x0108, 0xc0bc, 0x2009, 0x0140, 0x2114, 0x9294,
+	0x0001, 0x9215, 0x220a, 0x002e, 0x001e, 0x0005, 0x0016, 0x0026,
+	0x2009, 0x0140, 0x2114, 0x9294, 0x0001, 0x9285, 0x1000, 0x200a,
 	0x220a, 0x002e, 0x001e, 0x0005, 0x0016, 0x0026, 0x2009, 0x0140,
-	0x2114, 0x9294, 0x0001, 0x9285, 0x1000, 0x200a, 0x220a, 0x002e,
-	0x001e, 0x0005, 0x0016, 0x0026, 0x2009, 0x0140, 0x2114, 0x9294,
-	0x0001, 0x9215, 0x220a, 0x002e, 0x001e, 0x0005, 0x0006, 0x0016,
-	0x2009, 0x0140, 0x2104, 0x1128, 0x080c, 0x6fcc, 0x0110, 0xc0bc,
-	0x0008, 0xc0bd, 0x200a, 0x001e, 0x000e, 0x0005, 0x2dba, 0x2dba,
-	0x2bde, 0x2bde, 0x2bea, 0x2bea, 0x2bf6, 0x2bf6, 0x2c04, 0x2c04,
-	0x2c10, 0x2c10, 0x2c1e, 0x2c1e, 0x2c2c, 0x2c2c, 0x2c3e, 0x2c3e,
-	0x2c4a, 0x2c4a, 0x2c58, 0x2c58, 0x2c76, 0x2c76, 0x2c96, 0x2c96,
-	0x2c66, 0x2c66, 0x2c86, 0x2c86, 0x2ca4, 0x2ca4, 0x2c3c, 0x2c3c,
-	0x2c3c, 0x2c3c, 0x2c3c, 0x2c3c, 0x2c3c, 0x2c3c, 0x2c3c, 0x2c3c,
-	0x2c3c, 0x2c3c, 0x2c3c, 0x2c3c, 0x2c3c, 0x2c3c, 0x2c3c, 0x2c3c,
-	0x2c3c, 0x2c3c, 0x2c3c, 0x2c3c, 0x2c3c, 0x2c3c, 0x2c3c, 0x2c3c,
-	0x2c3c, 0x2c3c, 0x2c3c, 0x2c3c, 0x2c3c, 0x2c3c, 0x2cb6, 0x2cb6,
-	0x2cc2, 0x2cc2, 0x2cd0, 0x2cd0, 0x2cde, 0x2cde, 0x2cee, 0x2cee,
-	0x2cfc, 0x2cfc, 0x2d0c, 0x2d0c, 0x2d1c, 0x2d1c, 0x2d2e, 0x2d2e,
-	0x2d3c, 0x2d3c, 0x2d4c, 0x2d4c, 0x2d6e, 0x2d6e, 0x2d90, 0x2d90,
-	0x2d5c, 0x2d5c, 0x2d7f, 0x2d7f, 0x2d9f, 0x2d9f, 0x2c3c, 0x2c3c,
-	0x2c3c, 0x2c3c, 0x2c3c, 0x2c3c, 0x2c3c, 0x2c3c, 0x2c3c, 0x2c3c,
-	0x2c3c, 0x2c3c, 0x2c3c, 0x2c3c, 0x2c3c, 0x2c3c, 0x2c3c, 0x2c3c,
-	0x2c3c, 0x2c3c, 0x2c3c, 0x2c3c, 0x2c3c, 0x2c3c, 0x2c3c, 0x2c3c,
-	0x2c3c, 0x2c3c, 0x2c3c, 0x2c3c, 0x2c3c, 0x2c3c, 0x2c3c, 0x2c3c,
-	0x2c3c, 0x2c3c, 0x2c3c, 0x2c3c, 0x2c3c, 0x2c3c, 0x2c3c, 0x2c3c,
-	0x2c3c, 0x2c3c, 0x2c3c, 0x2c3c, 0x2c3c, 0x2c3c, 0x0106, 0x0006,
-	0x0126, 0x01c6, 0x01d6, 0x0136, 0x0146, 0x0156, 0x080c, 0x2313,
-	0x0804, 0x2db2, 0x0106, 0x0006, 0x0126, 0x01c6, 0x01d6, 0x0136,
-	0x0146, 0x0156, 0x080c, 0x212b, 0x0804, 0x2db2, 0x0106, 0x0006,
-	0x0126, 0x01c6, 0x01d6, 0x0136, 0x0146, 0x0156, 0x080c, 0x212b,
-	0x080c, 0x2313, 0x0804, 0x2db2, 0x0106, 0x0006, 0x0126, 0x01c6,
-	0x01d6, 0x0136, 0x0146, 0x0156, 0x080c, 0x2166, 0x0804, 0x2db2,
+	0x2114, 0x9294, 0x0001, 0x9215, 0x220a, 0x002e, 0x001e, 0x0005,
+	0x0006, 0x0016, 0x2009, 0x0140, 0x2104, 0x1128, 0x080c, 0x6fb5,
+	0x0110, 0xc0bc, 0x0008, 0xc0bd, 0x200a, 0x001e, 0x000e, 0x0005,
+	0x2dbc, 0x2dbc, 0x2be0, 0x2be0, 0x2bec, 0x2bec, 0x2bf8, 0x2bf8,
+	0x2c06, 0x2c06, 0x2c12, 0x2c12, 0x2c20, 0x2c20, 0x2c2e, 0x2c2e,
+	0x2c40, 0x2c40, 0x2c4c, 0x2c4c, 0x2c5a, 0x2c5a, 0x2c78, 0x2c78,
+	0x2c98, 0x2c98, 0x2c68, 0x2c68, 0x2c88, 0x2c88, 0x2ca6, 0x2ca6,
+	0x2c3e, 0x2c3e, 0x2c3e, 0x2c3e, 0x2c3e, 0x2c3e, 0x2c3e, 0x2c3e,
+	0x2c3e, 0x2c3e, 0x2c3e, 0x2c3e, 0x2c3e, 0x2c3e, 0x2c3e, 0x2c3e,
+	0x2c3e, 0x2c3e, 0x2c3e, 0x2c3e, 0x2c3e, 0x2c3e, 0x2c3e, 0x2c3e,
+	0x2c3e, 0x2c3e, 0x2c3e, 0x2c3e, 0x2c3e, 0x2c3e, 0x2c3e, 0x2c3e,
+	0x2cb8, 0x2cb8, 0x2cc4, 0x2cc4, 0x2cd2, 0x2cd2, 0x2ce0, 0x2ce0,
+	0x2cf0, 0x2cf0, 0x2cfe, 0x2cfe, 0x2d0e, 0x2d0e, 0x2d1e, 0x2d1e,
+	0x2d30, 0x2d30, 0x2d3e, 0x2d3e, 0x2d4e, 0x2d4e, 0x2d70, 0x2d70,
+	0x2d92, 0x2d92, 0x2d5e, 0x2d5e, 0x2d81, 0x2d81, 0x2da1, 0x2da1,
+	0x2c3e, 0x2c3e, 0x2c3e, 0x2c3e, 0x2c3e, 0x2c3e, 0x2c3e, 0x2c3e,
+	0x2c3e, 0x2c3e, 0x2c3e, 0x2c3e, 0x2c3e, 0x2c3e, 0x2c3e, 0x2c3e,
+	0x2c3e, 0x2c3e, 0x2c3e, 0x2c3e, 0x2c3e, 0x2c3e, 0x2c3e, 0x2c3e,
+	0x2c3e, 0x2c3e, 0x2c3e, 0x2c3e, 0x2c3e, 0x2c3e, 0x2c3e, 0x2c3e,
+	0x2c3e, 0x2c3e, 0x2c3e, 0x2c3e, 0x2c3e, 0x2c3e, 0x2c3e, 0x2c3e,
+	0x2c3e, 0x2c3e, 0x2c3e, 0x2c3e, 0x2c3e, 0x2c3e, 0x2c3e, 0x2c3e,
 	0x0106, 0x0006, 0x0126, 0x01c6, 0x01d6, 0x0136, 0x0146, 0x0156,
-	0x080c, 0x2313, 0x080c, 0x2166, 0x0804, 0x2db2, 0x0106, 0x0006,
-	0x0126, 0x01c6, 0x01d6, 0x0136, 0x0146, 0x0156, 0x080c, 0x212b,
-	0x080c, 0x2166, 0x0804, 0x2db2, 0x0106, 0x0006, 0x0126, 0x01c6,
-	0x01d6, 0x0136, 0x0146, 0x0156, 0x080c, 0x212b, 0x080c, 0x2313,
-	0x080c, 0x2166, 0x0804, 0x2db2, 0xa001, 0x0cf0, 0x0106, 0x0006,
-	0x0126, 0x01c6, 0x01d6, 0x0136, 0x0146, 0x0156, 0x080c, 0x130c,
-	0x0804, 0x2db2, 0x0106, 0x0006, 0x0126, 0x01c6, 0x01d6, 0x0136,
-	0x0146, 0x0156, 0x080c, 0x2313, 0x080c, 0x130c, 0x0804, 0x2db2,
+	0x080c, 0x2315, 0x0804, 0x2db4, 0x0106, 0x0006, 0x0126, 0x01c6,
+	0x01d6, 0x0136, 0x0146, 0x0156, 0x080c, 0x212d, 0x0804, 0x2db4,
 	0x0106, 0x0006, 0x0126, 0x01c6, 0x01d6, 0x0136, 0x0146, 0x0156,
-	0x080c, 0x212b, 0x080c, 0x130c, 0x0804, 0x2db2, 0x0106, 0x0006,
-	0x0126, 0x01c6, 0x01d6, 0x0136, 0x0146, 0x0156, 0x080c, 0x2313,
-	0x080c, 0x130c, 0x080c, 0x2166, 0x0804, 0x2db2, 0x0106, 0x0006,
-	0x0126, 0x01c6, 0x01d6, 0x0136, 0x0146, 0x0156, 0x080c, 0x212b,
-	0x080c, 0x2313, 0x080c, 0x130c, 0x0804, 0x2db2, 0x0106, 0x0006,
-	0x0126, 0x01c6, 0x01d6, 0x0136, 0x0146, 0x0156, 0x080c, 0x212b,
-	0x080c, 0x130c, 0x080c, 0x2166, 0x0804, 0x2db2, 0x0106, 0x0006,
-	0x0126, 0x01c6, 0x01d6, 0x0136, 0x0146, 0x0156, 0x080c, 0x130c,
-	0x080c, 0x2166, 0x0804, 0x2db2, 0x0106, 0x0006, 0x0126, 0x01c6,
-	0x01d6, 0x0136, 0x0146, 0x0156, 0x080c, 0x212b, 0x080c, 0x2313,
-	0x080c, 0x130c, 0x080c, 0x2166, 0x0804, 0x2db2, 0x0106, 0x0006,
-	0x0126, 0x01c6, 0x01d6, 0x0136, 0x0146, 0x0156, 0x080c, 0x2766,
-	0x0804, 0x2db2, 0x0106, 0x0006, 0x0126, 0x01c6, 0x01d6, 0x0136,
-	0x0146, 0x0156, 0x080c, 0x2766, 0x080c, 0x2313, 0x0804, 0x2db2,
+	0x080c, 0x212d, 0x080c, 0x2315, 0x0804, 0x2db4, 0x0106, 0x0006,
+	0x0126, 0x01c6, 0x01d6, 0x0136, 0x0146, 0x0156, 0x080c, 0x2168,
+	0x0804, 0x2db4, 0x0106, 0x0006, 0x0126, 0x01c6, 0x01d6, 0x0136,
+	0x0146, 0x0156, 0x080c, 0x2315, 0x080c, 0x2168, 0x0804, 0x2db4,
 	0x0106, 0x0006, 0x0126, 0x01c6, 0x01d6, 0x0136, 0x0146, 0x0156,
-	0x080c, 0x2766, 0x080c, 0x212b, 0x0804, 0x2db2, 0x0106, 0x0006,
-	0x0126, 0x01c6, 0x01d6, 0x0136, 0x0146, 0x0156, 0x080c, 0x2766,
-	0x080c, 0x212b, 0x080c, 0x2313, 0x0804, 0x2db2, 0x0106, 0x0006,
-	0x0126, 0x01c6, 0x01d6, 0x0136, 0x0146, 0x0156, 0x080c, 0x2766,
-	0x080c, 0x2166, 0x0804, 0x2db2, 0x0106, 0x0006, 0x0126, 0x01c6,
-	0x01d6, 0x0136, 0x0146, 0x0156, 0x080c, 0x2766, 0x080c, 0x2313,
-	0x080c, 0x2166, 0x0804, 0x2db2, 0x0106, 0x0006, 0x0126, 0x01c6,
-	0x01d6, 0x0136, 0x0146, 0x0156, 0x080c, 0x2766, 0x080c, 0x212b,
-	0x080c, 0x2166, 0x0804, 0x2db2, 0x0106, 0x0006, 0x0126, 0x01c6,
-	0x01d6, 0x0136, 0x0146, 0x0156, 0x080c, 0x2766, 0x080c, 0x212b,
-	0x080c, 0x2313, 0x080c, 0x2166, 0x0804, 0x2db2, 0x0106, 0x0006,
-	0x0126, 0x01c6, 0x01d6, 0x0136, 0x0146, 0x0156, 0x080c, 0x2766,
-	0x080c, 0x130c, 0x0804, 0x2db2, 0x0106, 0x0006, 0x0126, 0x01c6,
-	0x01d6, 0x0136, 0x0146, 0x0156, 0x080c, 0x2766, 0x080c, 0x2313,
-	0x080c, 0x130c, 0x0804, 0x2db2, 0x0106, 0x0006, 0x0126, 0x01c6,
-	0x01d6, 0x0136, 0x0146, 0x0156, 0x080c, 0x2766, 0x080c, 0x212b,
-	0x080c, 0x130c, 0x0804, 0x2db2, 0x0106, 0x0006, 0x0126, 0x01c6,
-	0x01d6, 0x0136, 0x0146, 0x0156, 0x080c, 0x2766, 0x080c, 0x2313,
-	0x080c, 0x130c, 0x080c, 0x2166, 0x0804, 0x2db2, 0x0106, 0x0006,
-	0x0126, 0x01c6, 0x01d6, 0x0136, 0x0146, 0x0156, 0x080c, 0x2766,
-	0x080c, 0x212b, 0x080c, 0x2313, 0x080c, 0x130c, 0x0498, 0x0106,
-	0x0006, 0x0126, 0x01c6, 0x01d6, 0x0136, 0x0146, 0x0156, 0x080c,
-	0x2766, 0x080c, 0x212b, 0x080c, 0x130c, 0x080c, 0x2166, 0x0410,
+	0x080c, 0x212d, 0x080c, 0x2168, 0x0804, 0x2db4, 0x0106, 0x0006,
+	0x0126, 0x01c6, 0x01d6, 0x0136, 0x0146, 0x0156, 0x080c, 0x212d,
+	0x080c, 0x2315, 0x080c, 0x2168, 0x0804, 0x2db4, 0xa001, 0x0cf0,
 	0x0106, 0x0006, 0x0126, 0x01c6, 0x01d6, 0x0136, 0x0146, 0x0156,
-	0x080c, 0x2766, 0x080c, 0x130c, 0x080c, 0x2166, 0x0098, 0x0106,
-	0x0006, 0x0126, 0x01c6, 0x01d6, 0x0136, 0x0146, 0x0156, 0x080c,
-	0x2766, 0x080c, 0x212b, 0x080c, 0x2313, 0x080c, 0x130c, 0x080c,
-	0x2166, 0x0000, 0x015e, 0x014e, 0x013e, 0x01de, 0x01ce, 0x012e,
-	0x000e, 0x010e, 0x000d, 0x00b6, 0x00c6, 0x0026, 0x0046, 0x9026,
-	0x080c, 0x6520, 0x1904, 0x2ec1, 0x72d8, 0x2001, 0x194d, 0x2004,
-	0x9005, 0x1110, 0xd29c, 0x0148, 0xd284, 0x1138, 0xd2bc, 0x1904,
-	0x2ec1, 0x080c, 0x2ec6, 0x0804, 0x2ec1, 0xd2cc, 0x1904, 0x2ec1,
-	0x080c, 0x6fb2, 0x1120, 0x70ab, 0xffff, 0x0804, 0x2ec1, 0xd294,
-	0x0120, 0x70ab, 0xffff, 0x0804, 0x2ec1, 0x080c, 0x312e, 0x0160,
-	0x080c, 0xc212, 0x0128, 0x2001, 0x1817, 0x203c, 0x0804, 0x2e53,
-	0x70ab, 0xffff, 0x0804, 0x2ec1, 0x2001, 0x1817, 0x203c, 0x7290,
-	0xd284, 0x0904, 0x2e53, 0xd28c, 0x1904, 0x2e53, 0x0036, 0x73a8,
-	0x938e, 0xffff, 0x1110, 0x2019, 0x0001, 0x8314, 0x92e0, 0x1c80,
-	0x2c04, 0x938c, 0x0001, 0x0120, 0x9084, 0xff00, 0x8007, 0x0010,
-	0x9084, 0x00ff, 0x970e, 0x05a8, 0x908e, 0x0000, 0x0590, 0x908e,
-	0x00ff, 0x1150, 0x7230, 0xd284, 0x1588, 0x7290, 0xc28d, 0x7292,
-	0x70ab, 0xffff, 0x003e, 0x0478, 0x0026, 0x2011, 0x0010, 0x080c,
-	0x6586, 0x002e, 0x0118, 0x70ab, 0xffff, 0x0410, 0x900e, 0x080c,
-	0x2663, 0x080c, 0x61de, 0x11c0, 0x080c, 0x6562, 0x1168, 0x7030,
-	0xd08c, 0x0130, 0xb800, 0xd0bc, 0x0138, 0x080c, 0x645e, 0x0120,
-	0x080c, 0x2edf, 0x0148, 0x0028, 0x080c, 0x301f, 0x080c, 0x2f0b,
-	0x0118, 0x8318, 0x0804, 0x2e05, 0x73aa, 0x0010, 0x70ab, 0xffff,
-	0x003e, 0x0804, 0x2ec1, 0x9780, 0x3138, 0x203d, 0x97bc, 0xff00,
-	0x873f, 0x2041, 0x007e, 0x70a8, 0x9096, 0xffff, 0x1118, 0x900e,
-	0x28a8, 0x0050, 0x9812, 0x0220, 0x2008, 0x9802, 0x20a8, 0x0020,
-	0x70ab, 0xffff, 0x0804, 0x2ec1, 0x2700, 0x0156, 0x0016, 0x9106,
-	0x0904, 0x2eb6, 0x0026, 0x2011, 0x0010, 0x080c, 0x6586, 0x002e,
-	0x0120, 0x2009, 0xffff, 0x0804, 0x2ebe, 0xc484, 0x080c, 0x623e,
-	0x0138, 0x080c, 0xc212, 0x1590, 0x080c, 0x61de, 0x15b8, 0x0008,
-	0xc485, 0x080c, 0x6562, 0x1130, 0x7030, 0xd08c, 0x01f8, 0xb800,
-	0xd0bc, 0x11e0, 0x7290, 0xd28c, 0x0180, 0x080c, 0x6562, 0x9082,
-	0x0006, 0x02e0, 0xd484, 0x1118, 0x080c, 0x6202, 0x0028, 0x080c,
-	0x30aa, 0x01a0, 0x080c, 0x30d5, 0x0088, 0x080c, 0x301f, 0x080c,
-	0xc212, 0x1160, 0x080c, 0x2f0b, 0x0188, 0x0040, 0x080c, 0xc212,
-	0x1118, 0x080c, 0x30aa, 0x0110, 0x0451, 0x0140, 0x001e, 0x8108,
-	0x015e, 0x1f04, 0x2e6c, 0x70ab, 0xffff, 0x0018, 0x001e, 0x015e,
-	0x71aa, 0x004e, 0x002e, 0x00ce, 0x00be, 0x0005, 0x00c6, 0x0016,
-	0x70ab, 0x0001, 0x2009, 0x007e, 0x080c, 0x61de, 0x1168, 0xb813,
-	0x00ff, 0xb817, 0xfffe, 0x080c, 0x301f, 0x04a9, 0x0128, 0x70d8,
-	0xc0bd, 0x70da, 0x080c, 0xbf63, 0x001e, 0x00ce, 0x0005, 0x0016,
-	0x0076, 0x00d6, 0x00c6, 0x2001, 0x1858, 0x2004, 0x9084, 0x00ff,
-	0xb842, 0x080c, 0x9e7f, 0x01d0, 0x2b00, 0x6012, 0x080c, 0xbf8c,
-	0x6023, 0x0001, 0x9006, 0x080c, 0x617b, 0x2001, 0x0000, 0x080c,
-	0x618f, 0x0126, 0x2091, 0x8000, 0x70a4, 0x8000, 0x70a6, 0x012e,
-	0x2009, 0x0004, 0x080c, 0x9eac, 0x9085, 0x0001, 0x00ce, 0x00de,
-	0x007e, 0x001e, 0x0005, 0x0016, 0x0076, 0x00d6, 0x00c6, 0x2001,
-	0x1858, 0x2004, 0x9084, 0x00ff, 0xb842, 0x080c, 0x9e7f, 0x0548,
-	0x2b00, 0x6012, 0xb800, 0xc0c4, 0xb802, 0xb8a0, 0x9086, 0x007e,
-	0x0140, 0xb804, 0x9084, 0x00ff, 0x9086, 0x0006, 0x1110, 0x080c,
-	0x2fda, 0x080c, 0xbf8c, 0x6023, 0x0001, 0x9006, 0x080c, 0x617b,
-	0x2001, 0x0002, 0x080c, 0x618f, 0x0126, 0x2091, 0x8000, 0x70a4,
-	0x8000, 0x70a6, 0x012e, 0x2009, 0x0002, 0x080c, 0x9eac, 0x9085,
-	0x0001, 0x00ce, 0x00de, 0x007e, 0x001e, 0x0005, 0x00b6, 0x00c6,
-	0x0026, 0x2009, 0x0080, 0x080c, 0x61de, 0x1140, 0xb813, 0x00ff,
-	0xb817, 0xfffc, 0x0039, 0x0110, 0x70df, 0xffff, 0x002e, 0x00ce,
-	0x00be, 0x0005, 0x0016, 0x0076, 0x00d6, 0x00c6, 0x080c, 0x9ddc,
-	0x01d0, 0x2b00, 0x6012, 0x080c, 0xbf8c, 0x6023, 0x0001, 0x9006,
-	0x080c, 0x617b, 0x2001, 0x0002, 0x080c, 0x618f, 0x0126, 0x2091,
-	0x8000, 0x70e0, 0x8000, 0x70e2, 0x012e, 0x2009, 0x0002, 0x080c,
-	0x9eac, 0x9085, 0x0001, 0x00ce, 0x00de, 0x007e, 0x001e, 0x0005,
-	0x00c6, 0x00d6, 0x0126, 0x2091, 0x8000, 0x2009, 0x007f, 0x080c,
-	0x61de, 0x11b8, 0xb813, 0x00ff, 0xb817, 0xfffd, 0xb8bf, 0x0004,
-	0x080c, 0x9ddc, 0x0170, 0x2b00, 0x6012, 0x6316, 0x6023, 0x0001,
-	0x620a, 0x080c, 0xbf8c, 0x2009, 0x0022, 0x080c, 0x9eac, 0x9085,
-	0x0001, 0x012e, 0x00de, 0x00ce, 0x0005, 0x00e6, 0x00c6, 0x0066,
-	0x0036, 0x0026, 0x00b6, 0x21f0, 0x080c, 0x857c, 0x080c, 0x850b,
-	0x080c, 0x9c8a, 0x080c, 0xad77, 0x3e08, 0x2130, 0x81ff, 0x0120,
-	0x20a9, 0x007e, 0x900e, 0x0018, 0x20a9, 0x007f, 0x900e, 0x0016,
-	0x080c, 0x623e, 0x1140, 0x9686, 0x0002, 0x1118, 0xb800, 0xd0bc,
-	0x1110, 0x080c, 0x5ceb, 0x001e, 0x8108, 0x1f04, 0x2fbf, 0x9686,
-	0x0001, 0x190c, 0x3102, 0x00be, 0x002e, 0x003e, 0x006e, 0x00ce,
-	0x00ee, 0x0005, 0x00e6, 0x00c6, 0x0046, 0x0036, 0x0026, 0x0016,
-	0x00b6, 0x6210, 0x2258, 0xbaa0, 0x0026, 0x2019, 0x0029, 0x080c,
-	0x8571, 0x0076, 0x2039, 0x0000, 0x080c, 0x8469, 0x2c08, 0x080c,
-	0xd29b, 0x007e, 0x001e, 0xba10, 0xbb14, 0xbcb0, 0x080c, 0x5ceb,
-	0xba12, 0xbb16, 0xbcb2, 0x00be, 0x001e, 0x002e, 0x003e, 0x004e,
-	0x00ce, 0x00ee, 0x0005, 0x00e6, 0x0006, 0x00b6, 0x6010, 0x2058,
-	0xb8a0, 0x00be, 0x9086, 0x0080, 0x0150, 0x2071, 0x1800, 0x70a4,
-	0x9005, 0x0110, 0x8001, 0x70a6, 0x000e, 0x00ee, 0x0005, 0x2071,
-	0x1800, 0x70e0, 0x9005, 0x0dc0, 0x8001, 0x70e2, 0x0ca8, 0xb800,
-	0xc08c, 0xb802, 0x0005, 0x00f6, 0x00e6, 0x00c6, 0x00b6, 0x0046,
-	0x0036, 0x0026, 0x0016, 0x0156, 0x2178, 0x81ff, 0x1118, 0x20a9,
-	0x0001, 0x0070, 0x080c, 0x5386, 0xd0c4, 0x0138, 0x0030, 0x9006,
-	0x2020, 0x2009, 0x002d, 0x080c, 0xd52a, 0x20a9, 0x0800, 0x9016,
-	0x0026, 0x928e, 0x007e, 0x0904, 0x3089, 0x928e, 0x007f, 0x0904,
-	0x3089, 0x928e, 0x0080, 0x05e8, 0x9288, 0x1000, 0x210c, 0x81ff,
-	0x05c0, 0x8fff, 0x1148, 0x2001, 0x195f, 0x0006, 0x2003, 0x0001,
-	0x04f1, 0x000e, 0x2003, 0x0000, 0x00b6, 0x00c6, 0x2158, 0x2001,
-	0x0001, 0x080c, 0x652c, 0x00ce, 0x00be, 0x2019, 0x0029, 0x080c,
-	0x8571, 0x0076, 0x2039, 0x0000, 0x080c, 0x8469, 0x00b6, 0x00c6,
-	0x0026, 0x2158, 0xba04, 0x9294, 0x00ff, 0x9286, 0x0006, 0x1118,
-	0xb807, 0x0404, 0x0028, 0x2001, 0x0004, 0x8007, 0x9215, 0xba06,
-	0x002e, 0x00ce, 0x00be, 0x0016, 0x2c08, 0x080c, 0xd29b, 0x001e,
-	0x007e, 0x002e, 0x8210, 0x1f04, 0x3040, 0x015e, 0x001e, 0x002e,
-	0x003e, 0x004e, 0x00be, 0x00ce, 0x00ee, 0x00fe, 0x0005, 0x0046,
-	0x0026, 0x0016, 0x080c, 0x5386, 0xd0c4, 0x0140, 0xd0a4, 0x0130,
-	0x9006, 0x2220, 0x2009, 0x0029, 0x080c, 0xd52a, 0x001e, 0x002e,
-	0x004e, 0x0005, 0x0016, 0x0026, 0x0036, 0x00c6, 0x7290, 0x82ff,
-	0x01e8, 0x080c, 0x655a, 0x11d0, 0x2100, 0x080c, 0x2696, 0x81ff,
-	0x01b8, 0x2019, 0x0001, 0x8314, 0x92e0, 0x1c80, 0x2c04, 0xd384,
-	0x0120, 0x9084, 0xff00, 0x8007, 0x0010, 0x9084, 0x00ff, 0x9116,
-	0x0138, 0x9096, 0x00ff, 0x0110, 0x8318, 0x0c68, 0x9085, 0x0001,
-	0x00ce, 0x003e, 0x002e, 0x001e, 0x0005, 0x0016, 0x00c6, 0x0126,
-	0x2091, 0x8000, 0x0036, 0x2019, 0x0029, 0x00a9, 0x003e, 0x9180,
-	0x1000, 0x2004, 0x9065, 0x0158, 0x0016, 0x00c6, 0x2061, 0x1a80,
-	0x001e, 0x6112, 0x080c, 0x2fda, 0x001e, 0x080c, 0x6202, 0x012e,
-	0x00ce, 0x001e, 0x0005, 0x0016, 0x0026, 0x2110, 0x080c, 0x9926,
-	0x080c, 0xd7e2, 0x002e, 0x001e, 0x0005, 0x2001, 0x1836, 0x2004,
-	0xd0cc, 0x0005, 0x00c6, 0x00b6, 0x080c, 0x6fb2, 0x1118, 0x20a9,
-	0x0800, 0x0010, 0x20a9, 0x0782, 0x080c, 0x6fb2, 0x1110, 0x900e,
-	0x0010, 0x2009, 0x007e, 0x9180, 0x1000, 0x2004, 0x905d, 0x0130,
-	0x86ff, 0x0110, 0xb800, 0xd0bc, 0x090c, 0x6202, 0x8108, 0x1f04,
-	0x3113, 0x2061, 0x1800, 0x607b, 0x0000, 0x607c, 0x9084, 0x00ff,
-	0x607e, 0x60af, 0x0000, 0x00be, 0x00ce, 0x0005, 0x2001, 0x1875,
-	0x2004, 0xd0bc, 0x0005, 0x2011, 0x1854, 0x2214, 0xd2ec, 0x0005,
-	0x7eef, 0x7de8, 0x7ce4, 0x80e2, 0x7be1, 0x80e0, 0x80dc, 0x80da,
-	0x7ad9, 0x80d6, 0x80d5, 0x80d4, 0x80d3, 0x80d2, 0x80d1, 0x79ce,
-	0x78cd, 0x80cc, 0x80cb, 0x80ca, 0x80c9, 0x80c7, 0x80c6, 0x77c5,
-	0x76c3, 0x80bc, 0x80ba, 0x75b9, 0x80b6, 0x74b5, 0x73b4, 0x72b3,
-	0x80b2, 0x80b1, 0x80ae, 0x71ad, 0x80ac, 0x70ab, 0x6faa, 0x6ea9,
-	0x80a7, 0x6da6, 0x6ca5, 0x6ba3, 0x6a9f, 0x699e, 0x689d, 0x809b,
-	0x8098, 0x6797, 0x6690, 0x658f, 0x6488, 0x6384, 0x6282, 0x8081,
-	0x8080, 0x617c, 0x607a, 0x8079, 0x5f76, 0x8075, 0x8074, 0x8073,
-	0x8072, 0x8071, 0x806e, 0x5e6d, 0x806c, 0x5d6b, 0x5c6a, 0x5b69,
-	0x8067, 0x5a66, 0x5965, 0x5863, 0x575c, 0x565a, 0x5559, 0x8056,
-	0x8055, 0x5454, 0x5353, 0x5252, 0x5151, 0x504e, 0x4f4d, 0x804c,
-	0x804b, 0x4e4a, 0x4d49, 0x8047, 0x4c46, 0x8045, 0x8043, 0x803c,
-	0x803a, 0x8039, 0x8036, 0x4b35, 0x8034, 0x4a33, 0x4932, 0x4831,
-	0x802e, 0x472d, 0x462c, 0x452b, 0x442a, 0x4329, 0x4227, 0x8026,
-	0x8025, 0x4123, 0x401f, 0x3f1e, 0x3e1d, 0x3d1b, 0x3c18, 0x8017,
-	0x8010, 0x3b0f, 0x3a08, 0x8004, 0x3902, 0x8001, 0x8000, 0x8000,
-	0x3800, 0x3700, 0x3600, 0x8000, 0x3500, 0x8000, 0x8000, 0x8000,
-	0x3400, 0x8000, 0x8000, 0x8000, 0x8000, 0x8000, 0x8000, 0x3300,
-	0x3200, 0x8000, 0x8000, 0x8000, 0x8000, 0x8000, 0x8000, 0x3100,
-	0x3000, 0x8000, 0x8000, 0x2f00, 0x8000, 0x2e00, 0x2d00, 0x2c00,
-	0x8000, 0x8000, 0x8000, 0x2b00, 0x8000, 0x2a00, 0x2900, 0x2800,
-	0x8000, 0x2700, 0x2600, 0x2500, 0x2400, 0x2300, 0x2200, 0x8000,
-	0x8000, 0x2100, 0x2000, 0x1f00, 0x1e00, 0x1d00, 0x1c00, 0x8000,
-	0x8000, 0x1b00, 0x1a00, 0x8000, 0x1900, 0x8000, 0x8000, 0x8000,
-	0x8000, 0x8000, 0x8000, 0x1800, 0x8000, 0x1700, 0x1600, 0x1500,
-	0x8000, 0x1400, 0x1300, 0x1200, 0x1100, 0x1000, 0x0f00, 0x8000,
-	0x8000, 0x0e00, 0x0d00, 0x0c00, 0x0b00, 0x0a00, 0x0900, 0x8000,
-	0x8000, 0x0800, 0x0700, 0x8000, 0x0600, 0x8000, 0x8000, 0x8000,
-	0x0500, 0x0400, 0x0300, 0x8000, 0x0200, 0x8000, 0x8000, 0x8000,
-	0x0100, 0x8000, 0x8000, 0x8000, 0x8000, 0x8000, 0x8000, 0x0000,
-	0x8000, 0x8000, 0x8000, 0x8000, 0x8000, 0x8000, 0x8000, 0x8000,
+	0x080c, 0x130c, 0x0804, 0x2db4, 0x0106, 0x0006, 0x0126, 0x01c6,
+	0x01d6, 0x0136, 0x0146, 0x0156, 0x080c, 0x2315, 0x080c, 0x130c,
+	0x0804, 0x2db4, 0x0106, 0x0006, 0x0126, 0x01c6, 0x01d6, 0x0136,
+	0x0146, 0x0156, 0x080c, 0x212d, 0x080c, 0x130c, 0x0804, 0x2db4,
+	0x0106, 0x0006, 0x0126, 0x01c6, 0x01d6, 0x0136, 0x0146, 0x0156,
+	0x080c, 0x2315, 0x080c, 0x130c, 0x080c, 0x2168, 0x0804, 0x2db4,
+	0x0106, 0x0006, 0x0126, 0x01c6, 0x01d6, 0x0136, 0x0146, 0x0156,
+	0x080c, 0x212d, 0x080c, 0x2315, 0x080c, 0x130c, 0x0804, 0x2db4,
+	0x0106, 0x0006, 0x0126, 0x01c6, 0x01d6, 0x0136, 0x0146, 0x0156,
+	0x080c, 0x212d, 0x080c, 0x130c, 0x080c, 0x2168, 0x0804, 0x2db4,
+	0x0106, 0x0006, 0x0126, 0x01c6, 0x01d6, 0x0136, 0x0146, 0x0156,
+	0x080c, 0x130c, 0x080c, 0x2168, 0x0804, 0x2db4, 0x0106, 0x0006,
+	0x0126, 0x01c6, 0x01d6, 0x0136, 0x0146, 0x0156, 0x080c, 0x212d,
+	0x080c, 0x2315, 0x080c, 0x130c, 0x080c, 0x2168, 0x0804, 0x2db4,
+	0x0106, 0x0006, 0x0126, 0x01c6, 0x01d6, 0x0136, 0x0146, 0x0156,
+	0x080c, 0x2768, 0x0804, 0x2db4, 0x0106, 0x0006, 0x0126, 0x01c6,
+	0x01d6, 0x0136, 0x0146, 0x0156, 0x080c, 0x2768, 0x080c, 0x2315,
+	0x0804, 0x2db4, 0x0106, 0x0006, 0x0126, 0x01c6, 0x01d6, 0x0136,
+	0x0146, 0x0156, 0x080c, 0x2768, 0x080c, 0x212d, 0x0804, 0x2db4,
+	0x0106, 0x0006, 0x0126, 0x01c6, 0x01d6, 0x0136, 0x0146, 0x0156,
+	0x080c, 0x2768, 0x080c, 0x212d, 0x080c, 0x2315, 0x0804, 0x2db4,
+	0x0106, 0x0006, 0x0126, 0x01c6, 0x01d6, 0x0136, 0x0146, 0x0156,
+	0x080c, 0x2768, 0x080c, 0x2168, 0x0804, 0x2db4, 0x0106, 0x0006,
+	0x0126, 0x01c6, 0x01d6, 0x0136, 0x0146, 0x0156, 0x080c, 0x2768,
+	0x080c, 0x2315, 0x080c, 0x2168, 0x0804, 0x2db4, 0x0106, 0x0006,
+	0x0126, 0x01c6, 0x01d6, 0x0136, 0x0146, 0x0156, 0x080c, 0x2768,
+	0x080c, 0x212d, 0x080c, 0x2168, 0x0804, 0x2db4, 0x0106, 0x0006,
+	0x0126, 0x01c6, 0x01d6, 0x0136, 0x0146, 0x0156, 0x080c, 0x2768,
+	0x080c, 0x212d, 0x080c, 0x2315, 0x080c, 0x2168, 0x0804, 0x2db4,
+	0x0106, 0x0006, 0x0126, 0x01c6, 0x01d6, 0x0136, 0x0146, 0x0156,
+	0x080c, 0x2768, 0x080c, 0x130c, 0x0804, 0x2db4, 0x0106, 0x0006,
+	0x0126, 0x01c6, 0x01d6, 0x0136, 0x0146, 0x0156, 0x080c, 0x2768,
+	0x080c, 0x2315, 0x080c, 0x130c, 0x0804, 0x2db4, 0x0106, 0x0006,
+	0x0126, 0x01c6, 0x01d6, 0x0136, 0x0146, 0x0156, 0x080c, 0x2768,
+	0x080c, 0x212d, 0x080c, 0x130c, 0x0804, 0x2db4, 0x0106, 0x0006,
+	0x0126, 0x01c6, 0x01d6, 0x0136, 0x0146, 0x0156, 0x080c, 0x2768,
+	0x080c, 0x2315, 0x080c, 0x130c, 0x080c, 0x2168, 0x0804, 0x2db4,
+	0x0106, 0x0006, 0x0126, 0x01c6, 0x01d6, 0x0136, 0x0146, 0x0156,
+	0x080c, 0x2768, 0x080c, 0x212d, 0x080c, 0x2315, 0x080c, 0x130c,
+	0x0498, 0x0106, 0x0006, 0x0126, 0x01c6, 0x01d6, 0x0136, 0x0146,
+	0x0156, 0x080c, 0x2768, 0x080c, 0x212d, 0x080c, 0x130c, 0x080c,
+	0x2168, 0x0410, 0x0106, 0x0006, 0x0126, 0x01c6, 0x01d6, 0x0136,
+	0x0146, 0x0156, 0x080c, 0x2768, 0x080c, 0x130c, 0x080c, 0x2168,
+	0x0098, 0x0106, 0x0006, 0x0126, 0x01c6, 0x01d6, 0x0136, 0x0146,
+	0x0156, 0x080c, 0x2768, 0x080c, 0x212d, 0x080c, 0x2315, 0x080c,
+	0x130c, 0x080c, 0x2168, 0x0000, 0x015e, 0x014e, 0x013e, 0x01de,
+	0x01ce, 0x012e, 0x000e, 0x010e, 0x000d, 0x00b6, 0x00c6, 0x0026,
+	0x0046, 0x9026, 0x080c, 0x6529, 0x1904, 0x2ec3, 0x72d8, 0x2001,
+	0x194c, 0x2004, 0x9005, 0x1110, 0xd29c, 0x0148, 0xd284, 0x1138,
+	0xd2bc, 0x1904, 0x2ec3, 0x080c, 0x2ec8, 0x0804, 0x2ec3, 0xd2cc,
+	0x1904, 0x2ec3, 0x080c, 0x6f9b, 0x1120, 0x70ab, 0xffff, 0x0804,
+	0x2ec3, 0xd294, 0x0120, 0x70ab, 0xffff, 0x0804, 0x2ec3, 0x080c,
+	0x3130, 0x0160, 0x080c, 0xc22c, 0x0128, 0x2001, 0x1817, 0x203c,
+	0x0804, 0x2e55, 0x70ab, 0xffff, 0x0804, 0x2ec3, 0x2001, 0x1817,
+	0x203c, 0x7290, 0xd284, 0x0904, 0x2e55, 0xd28c, 0x1904, 0x2e55,
+	0x0036, 0x73a8, 0x938e, 0xffff, 0x1110, 0x2019, 0x0001, 0x8314,
+	0x92e0, 0x1c80, 0x2c04, 0x938c, 0x0001, 0x0120, 0x9084, 0xff00,
+	0x8007, 0x0010, 0x9084, 0x00ff, 0x970e, 0x05a8, 0x908e, 0x0000,
+	0x0590, 0x908e, 0x00ff, 0x1150, 0x7230, 0xd284, 0x1588, 0x7290,
+	0xc28d, 0x7292, 0x70ab, 0xffff, 0x003e, 0x0478, 0x0026, 0x2011,
+	0x0010, 0x080c, 0x658f, 0x002e, 0x0118, 0x70ab, 0xffff, 0x0410,
+	0x900e, 0x080c, 0x2665, 0x080c, 0x61e7, 0x11c0, 0x080c, 0x656b,
+	0x1168, 0x7030, 0xd08c, 0x0130, 0xb800, 0xd0bc, 0x0138, 0x080c,
+	0x6467, 0x0120, 0x080c, 0x2ee1, 0x0148, 0x0028, 0x080c, 0x3021,
+	0x080c, 0x2f0d, 0x0118, 0x8318, 0x0804, 0x2e07, 0x73aa, 0x0010,
+	0x70ab, 0xffff, 0x003e, 0x0804, 0x2ec3, 0x9780, 0x313a, 0x203d,
+	0x97bc, 0xff00, 0x873f, 0x2041, 0x007e, 0x70a8, 0x9096, 0xffff,
+	0x1118, 0x900e, 0x28a8, 0x0050, 0x9812, 0x0220, 0x2008, 0x9802,
+	0x20a8, 0x0020, 0x70ab, 0xffff, 0x0804, 0x2ec3, 0x2700, 0x0156,
+	0x0016, 0x9106, 0x0904, 0x2eb8, 0x0026, 0x2011, 0x0010, 0x080c,
+	0x658f, 0x002e, 0x0120, 0x2009, 0xffff, 0x0804, 0x2ec0, 0xc484,
+	0x080c, 0x6247, 0x0138, 0x080c, 0xc22c, 0x1590, 0x080c, 0x61e7,
+	0x15b8, 0x0008, 0xc485, 0x080c, 0x656b, 0x1130, 0x7030, 0xd08c,
+	0x01f8, 0xb800, 0xd0bc, 0x11e0, 0x7290, 0xd28c, 0x0180, 0x080c,
+	0x656b, 0x9082, 0x0006, 0x02e0, 0xd484, 0x1118, 0x080c, 0x620b,
+	0x0028, 0x080c, 0x30ac, 0x01a0, 0x080c, 0x30d7, 0x0088, 0x080c,
+	0x3021, 0x080c, 0xc22c, 0x1160, 0x080c, 0x2f0d, 0x0188, 0x0040,
+	0x080c, 0xc22c, 0x1118, 0x080c, 0x30ac, 0x0110, 0x0451, 0x0140,
+	0x001e, 0x8108, 0x015e, 0x1f04, 0x2e6e, 0x70ab, 0xffff, 0x0018,
+	0x001e, 0x015e, 0x71aa, 0x004e, 0x002e, 0x00ce, 0x00be, 0x0005,
+	0x00c6, 0x0016, 0x70ab, 0x0001, 0x2009, 0x007e, 0x080c, 0x61e7,
+	0x1168, 0xb813, 0x00ff, 0xb817, 0xfffe, 0x080c, 0x3021, 0x04a9,
+	0x0128, 0x70d8, 0xc0bd, 0x70da, 0x080c, 0xbf7d, 0x001e, 0x00ce,
+	0x0005, 0x0016, 0x0076, 0x00d6, 0x00c6, 0x2001, 0x1858, 0x2004,
+	0x9084, 0x00ff, 0xb842, 0x080c, 0x9e8f, 0x01d0, 0x2b00, 0x6012,
+	0x080c, 0xbfa6, 0x6023, 0x0001, 0x9006, 0x080c, 0x6184, 0x2001,
+	0x0000, 0x080c, 0x6198, 0x0126, 0x2091, 0x8000, 0x70a4, 0x8000,
+	0x70a6, 0x012e, 0x2009, 0x0004, 0x080c, 0x9ebc, 0x9085, 0x0001,
+	0x00ce, 0x00de, 0x007e, 0x001e, 0x0005, 0x0016, 0x0076, 0x00d6,
+	0x00c6, 0x2001, 0x1858, 0x2004, 0x9084, 0x00ff, 0xb842, 0x080c,
+	0x9e8f, 0x0548, 0x2b00, 0x6012, 0xb800, 0xc0c4, 0xb802, 0xb8a0,
+	0x9086, 0x007e, 0x0140, 0xb804, 0x9084, 0x00ff, 0x9086, 0x0006,
+	0x1110, 0x080c, 0x2fdc, 0x080c, 0xbfa6, 0x6023, 0x0001, 0x9006,
+	0x080c, 0x6184, 0x2001, 0x0002, 0x080c, 0x6198, 0x0126, 0x2091,
+	0x8000, 0x70a4, 0x8000, 0x70a6, 0x012e, 0x2009, 0x0002, 0x080c,
+	0x9ebc, 0x9085, 0x0001, 0x00ce, 0x00de, 0x007e, 0x001e, 0x0005,
+	0x00b6, 0x00c6, 0x0026, 0x2009, 0x0080, 0x080c, 0x61e7, 0x1140,
+	0xb813, 0x00ff, 0xb817, 0xfffc, 0x0039, 0x0110, 0x70df, 0xffff,
+	0x002e, 0x00ce, 0x00be, 0x0005, 0x0016, 0x0076, 0x00d6, 0x00c6,
+	0x080c, 0x9dec, 0x01d0, 0x2b00, 0x6012, 0x080c, 0xbfa6, 0x6023,
+	0x0001, 0x9006, 0x080c, 0x6184, 0x2001, 0x0002, 0x080c, 0x6198,
+	0x0126, 0x2091, 0x8000, 0x70e0, 0x8000, 0x70e2, 0x012e, 0x2009,
+	0x0002, 0x080c, 0x9ebc, 0x9085, 0x0001, 0x00ce, 0x00de, 0x007e,
+	0x001e, 0x0005, 0x00c6, 0x00d6, 0x0126, 0x2091, 0x8000, 0x2009,
+	0x007f, 0x080c, 0x61e7, 0x11b8, 0xb813, 0x00ff, 0xb817, 0xfffd,
+	0xb8bf, 0x0004, 0x080c, 0x9dec, 0x0170, 0x2b00, 0x6012, 0x6316,
+	0x6023, 0x0001, 0x620a, 0x080c, 0xbfa6, 0x2009, 0x0022, 0x080c,
+	0x9ebc, 0x9085, 0x0001, 0x012e, 0x00de, 0x00ce, 0x0005, 0x00e6,
+	0x00c6, 0x0066, 0x0036, 0x0026, 0x00b6, 0x21f0, 0x080c, 0x856f,
+	0x080c, 0x84f9, 0x080c, 0x9c95, 0x080c, 0xad8a, 0x3e08, 0x2130,
+	0x81ff, 0x0120, 0x20a9, 0x007e, 0x900e, 0x0018, 0x20a9, 0x007f,
+	0x900e, 0x0016, 0x080c, 0x6247, 0x1140, 0x9686, 0x0002, 0x1118,
+	0xb800, 0xd0bc, 0x1110, 0x080c, 0x5cf4, 0x001e, 0x8108, 0x1f04,
+	0x2fc1, 0x9686, 0x0001, 0x190c, 0x3104, 0x00be, 0x002e, 0x003e,
+	0x006e, 0x00ce, 0x00ee, 0x0005, 0x00e6, 0x00c6, 0x0046, 0x0036,
+	0x0026, 0x0016, 0x00b6, 0x6210, 0x2258, 0xbaa0, 0x0026, 0x2019,
+	0x0029, 0x080c, 0x8564, 0x0076, 0x2039, 0x0000, 0x080c, 0x8452,
+	0x2c08, 0x080c, 0xd2bc, 0x007e, 0x001e, 0xba10, 0xbb14, 0xbcb0,
+	0x080c, 0x5cf4, 0xba12, 0xbb16, 0xbcb2, 0x00be, 0x001e, 0x002e,
+	0x003e, 0x004e, 0x00ce, 0x00ee, 0x0005, 0x00e6, 0x0006, 0x00b6,
+	0x6010, 0x2058, 0xb8a0, 0x00be, 0x9086, 0x0080, 0x0150, 0x2071,
+	0x1800, 0x70a4, 0x9005, 0x0110, 0x8001, 0x70a6, 0x000e, 0x00ee,
+	0x0005, 0x2071, 0x1800, 0x70e0, 0x9005, 0x0dc0, 0x8001, 0x70e2,
+	0x0ca8, 0xb800, 0xc08c, 0xb802, 0x0005, 0x00f6, 0x00e6, 0x00c6,
+	0x00b6, 0x0046, 0x0036, 0x0026, 0x0016, 0x0156, 0x2178, 0x81ff,
+	0x1118, 0x20a9, 0x0001, 0x0070, 0x080c, 0x538f, 0xd0c4, 0x0138,
+	0x0030, 0x9006, 0x2020, 0x2009, 0x002d, 0x080c, 0xd54b, 0x20a9,
+	0x0800, 0x9016, 0x0026, 0x928e, 0x007e, 0x0904, 0x308b, 0x928e,
+	0x007f, 0x0904, 0x308b, 0x928e, 0x0080, 0x05e8, 0x9288, 0x1000,
+	0x210c, 0x81ff, 0x05c0, 0x8fff, 0x1148, 0x2001, 0x195e, 0x0006,
+	0x2003, 0x0001, 0x04f1, 0x000e, 0x2003, 0x0000, 0x00b6, 0x00c6,
+	0x2158, 0x2001, 0x0001, 0x080c, 0x6535, 0x00ce, 0x00be, 0x2019,
+	0x0029, 0x080c, 0x8564, 0x0076, 0x2039, 0x0000, 0x080c, 0x8452,
+	0x00b6, 0x00c6, 0x0026, 0x2158, 0xba04, 0x9294, 0x00ff, 0x9286,
+	0x0006, 0x1118, 0xb807, 0x0404, 0x0028, 0x2001, 0x0004, 0x8007,
+	0x9215, 0xba06, 0x002e, 0x00ce, 0x00be, 0x0016, 0x2c08, 0x080c,
+	0xd2bc, 0x001e, 0x007e, 0x002e, 0x8210, 0x1f04, 0x3042, 0x015e,
+	0x001e, 0x002e, 0x003e, 0x004e, 0x00be, 0x00ce, 0x00ee, 0x00fe,
+	0x0005, 0x0046, 0x0026, 0x0016, 0x080c, 0x538f, 0xd0c4, 0x0140,
+	0xd0a4, 0x0130, 0x9006, 0x2220, 0x2009, 0x0029, 0x080c, 0xd54b,
+	0x001e, 0x002e, 0x004e, 0x0005, 0x0016, 0x0026, 0x0036, 0x00c6,
+	0x7290, 0x82ff, 0x01e8, 0x080c, 0x6563, 0x11d0, 0x2100, 0x080c,
+	0x2698, 0x81ff, 0x01b8, 0x2019, 0x0001, 0x8314, 0x92e0, 0x1c80,
+	0x2c04, 0xd384, 0x0120, 0x9084, 0xff00, 0x8007, 0x0010, 0x9084,
+	0x00ff, 0x9116, 0x0138, 0x9096, 0x00ff, 0x0110, 0x8318, 0x0c68,
+	0x9085, 0x0001, 0x00ce, 0x003e, 0x002e, 0x001e, 0x0005, 0x0016,
+	0x00c6, 0x0126, 0x2091, 0x8000, 0x0036, 0x2019, 0x0029, 0x00a9,
+	0x003e, 0x9180, 0x1000, 0x2004, 0x9065, 0x0158, 0x0016, 0x00c6,
+	0x2061, 0x1a7f, 0x001e, 0x6112, 0x080c, 0x2fdc, 0x001e, 0x080c,
+	0x620b, 0x012e, 0x00ce, 0x001e, 0x0005, 0x0016, 0x0026, 0x2110,
+	0x080c, 0x992c, 0x080c, 0xd803, 0x002e, 0x001e, 0x0005, 0x2001,
+	0x1836, 0x2004, 0xd0cc, 0x0005, 0x00c6, 0x00b6, 0x080c, 0x6f9b,
+	0x1118, 0x20a9, 0x0800, 0x0010, 0x20a9, 0x0782, 0x080c, 0x6f9b,
+	0x1110, 0x900e, 0x0010, 0x2009, 0x007e, 0x9180, 0x1000, 0x2004,
+	0x905d, 0x0130, 0x86ff, 0x0110, 0xb800, 0xd0bc, 0x090c, 0x620b,
+	0x8108, 0x1f04, 0x3115, 0x2061, 0x1800, 0x607b, 0x0000, 0x607c,
+	0x9084, 0x00ff, 0x607e, 0x60af, 0x0000, 0x00be, 0x00ce, 0x0005,
+	0x2001, 0x1875, 0x2004, 0xd0bc, 0x0005, 0x2011, 0x1854, 0x2214,
+	0xd2ec, 0x0005, 0x7eef, 0x7de8, 0x7ce4, 0x80e2, 0x7be1, 0x80e0,
+	0x80dc, 0x80da, 0x7ad9, 0x80d6, 0x80d5, 0x80d4, 0x80d3, 0x80d2,
+	0x80d1, 0x79ce, 0x78cd, 0x80cc, 0x80cb, 0x80ca, 0x80c9, 0x80c7,
+	0x80c6, 0x77c5, 0x76c3, 0x80bc, 0x80ba, 0x75b9, 0x80b6, 0x74b5,
+	0x73b4, 0x72b3, 0x80b2, 0x80b1, 0x80ae, 0x71ad, 0x80ac, 0x70ab,
+	0x6faa, 0x6ea9, 0x80a7, 0x6da6, 0x6ca5, 0x6ba3, 0x6a9f, 0x699e,
+	0x689d, 0x809b, 0x8098, 0x6797, 0x6690, 0x658f, 0x6488, 0x6384,
+	0x6282, 0x8081, 0x8080, 0x617c, 0x607a, 0x8079, 0x5f76, 0x8075,
+	0x8074, 0x8073, 0x8072, 0x8071, 0x806e, 0x5e6d, 0x806c, 0x5d6b,
+	0x5c6a, 0x5b69, 0x8067, 0x5a66, 0x5965, 0x5863, 0x575c, 0x565a,
+	0x5559, 0x8056, 0x8055, 0x5454, 0x5353, 0x5252, 0x5151, 0x504e,
+	0x4f4d, 0x804c, 0x804b, 0x4e4a, 0x4d49, 0x8047, 0x4c46, 0x8045,
+	0x8043, 0x803c, 0x803a, 0x8039, 0x8036, 0x4b35, 0x8034, 0x4a33,
+	0x4932, 0x4831, 0x802e, 0x472d, 0x462c, 0x452b, 0x442a, 0x4329,
+	0x4227, 0x8026, 0x8025, 0x4123, 0x401f, 0x3f1e, 0x3e1d, 0x3d1b,
+	0x3c18, 0x8017, 0x8010, 0x3b0f, 0x3a08, 0x8004, 0x3902, 0x8001,
+	0x8000, 0x8000, 0x3800, 0x3700, 0x3600, 0x8000, 0x3500, 0x8000,
+	0x8000, 0x8000, 0x3400, 0x8000, 0x8000, 0x8000, 0x8000, 0x8000,
+	0x8000, 0x3300, 0x3200, 0x8000, 0x8000, 0x8000, 0x8000, 0x8000,
+	0x8000, 0x3100, 0x3000, 0x8000, 0x8000, 0x2f00, 0x8000, 0x2e00,
+	0x2d00, 0x2c00, 0x8000, 0x8000, 0x8000, 0x2b00, 0x8000, 0x2a00,
+	0x2900, 0x2800, 0x8000, 0x2700, 0x2600, 0x2500, 0x2400, 0x2300,
+	0x2200, 0x8000, 0x8000, 0x2100, 0x2000, 0x1f00, 0x1e00, 0x1d00,
+	0x1c00, 0x8000, 0x8000, 0x1b00, 0x1a00, 0x8000, 0x1900, 0x8000,
+	0x8000, 0x8000, 0x8000, 0x8000, 0x8000, 0x1800, 0x8000, 0x1700,
+	0x1600, 0x1500, 0x8000, 0x1400, 0x1300, 0x1200, 0x1100, 0x1000,
+	0x0f00, 0x8000, 0x8000, 0x0e00, 0x0d00, 0x0c00, 0x0b00, 0x0a00,
+	0x0900, 0x8000, 0x8000, 0x0800, 0x0700, 0x8000, 0x0600, 0x8000,
+	0x8000, 0x8000, 0x0500, 0x0400, 0x0300, 0x8000, 0x0200, 0x8000,
+	0x8000, 0x8000, 0x0100, 0x8000, 0x8000, 0x8000, 0x8000, 0x8000,
+	0x8000, 0x0000, 0x8000, 0x8000, 0x8000, 0x8000, 0x8000, 0x8000,
 	0x8000, 0x8000, 0x8000, 0x8000, 0x8000, 0x8000, 0x8000, 0x8000,
-	0x2071, 0x1894, 0x7003, 0x0002, 0x9006, 0x7016, 0x701a, 0x704a,
-	0x704e, 0x700e, 0x7042, 0x7046, 0x703b, 0x18b0, 0x703f, 0x18b0,
-	0x7007, 0x0001, 0x080c, 0x1004, 0x090c, 0x0db4, 0x2900, 0x706a,
-	0xa867, 0x0002, 0xa8ab, 0xdcb0, 0x080c, 0x1004, 0x090c, 0x0db4,
-	0x2900, 0x706e, 0xa867, 0x0002, 0xa8ab, 0xdcb0, 0x0005, 0x2071,
-	0x1894, 0x7004, 0x0002, 0x3267, 0x3268, 0x327b, 0x328f, 0x0005,
-	0x1004, 0x3278, 0x0e04, 0x3278, 0x2079, 0x0000, 0x0126, 0x2091,
-	0x8000, 0x700c, 0x9005, 0x1128, 0x700f, 0x0001, 0x012e, 0x0468,
-	0x0005, 0x012e, 0x0ce8, 0x2079, 0x0000, 0x2061, 0x18ae, 0x2c4c,
-	0xa86c, 0x908e, 0x0100, 0x0128, 0x9086, 0x0200, 0x0904, 0x3363,
-	0x0005, 0x7018, 0x2048, 0x2061, 0x1800, 0x701c, 0x0807, 0x7014,
-	0x2048, 0xa864, 0x9094, 0x00ff, 0x9296, 0x0029, 0x1120, 0xaa78,
-	0xd2fc, 0x0128, 0x0005, 0x9086, 0x0103, 0x0108, 0x0005, 0x2079,
-	0x0000, 0x2061, 0x1800, 0x701c, 0x0807, 0x2061, 0x1800, 0x7880,
-	0x908a, 0x0040, 0x1210, 0x61cc, 0x0042, 0x2100, 0x908a, 0x003f,
-	0x1a04, 0x3360, 0x61cc, 0x0804, 0x32f5, 0x3337, 0x336f, 0x3379,
-	0x337d, 0x3387, 0x338d, 0x3391, 0x33a1, 0x33a4, 0x33ae, 0x33b3,
-	0x33b8, 0x33c3, 0x33ce, 0x33dd, 0x33ec, 0x33fa, 0x3411, 0x342c,
-	0x3360, 0x34d5, 0x3513, 0x35b9, 0x35ca, 0x35ed, 0x3360, 0x3360,
-	0x3360, 0x3625, 0x3641, 0x364a, 0x3679, 0x367f, 0x3360, 0x36c5,
-	0x3360, 0x3360, 0x3360, 0x3360, 0x3360, 0x36d0, 0x36d9, 0x36e1,
-	0x36e3, 0x3360, 0x3360, 0x3360, 0x3360, 0x3360, 0x3360, 0x370f,
-	0x3360, 0x3360, 0x3360, 0x3360, 0x3360, 0x372c, 0x3787, 0x3360,
-	0x3360, 0x3360, 0x3360, 0x3360, 0x3360, 0x0002, 0x37b1, 0x37b4,
-	0x3813, 0x382c, 0x385c, 0x3afa, 0x3360, 0x4f5f, 0x3360, 0x3360,
-	0x3360, 0x3360, 0x3360, 0x3360, 0x3360, 0x3360, 0x33ae, 0x33b3,
-	0x401b, 0x53aa, 0x4031, 0x4fee, 0x503f, 0x5142, 0x3360, 0x51a4,
-	0x51e0, 0x5211, 0x5315, 0x523e, 0x5295, 0x3360, 0x4035, 0x41d6,
-	0x41ec, 0x4211, 0x4276, 0x42ea, 0x430a, 0x4381, 0x43dd, 0x4439,
-	0x443c, 0x4461, 0x4501, 0x4567, 0x456f, 0x46a1, 0x4803, 0x4837,
-	0x4a81, 0x3360, 0x4a9f, 0x4b62, 0x4c38, 0x3360, 0x3360, 0x3360,
-	0x3360, 0x4c9e, 0x4cb9, 0x456f, 0x4eff, 0x714c, 0x0000, 0x2021,
-	0x4000, 0x080c, 0x48b5, 0x0126, 0x2091, 0x8000, 0x0e04, 0x3341,
-	0x0010, 0x012e, 0x0cc0, 0x7c36, 0x9486, 0x4000, 0x0118, 0x7833,
-	0x0011, 0x0010, 0x7833, 0x0010, 0x7c82, 0x7986, 0x7a8a, 0x7b8e,
-	0x2091, 0x4080, 0x2001, 0x0089, 0x2004, 0xd084, 0x190c, 0x1187,
-	0x7007, 0x0001, 0x2091, 0x5000, 0x700f, 0x0000, 0x012e, 0x0005,
-	0x2021, 0x4001, 0x08b0, 0x2021, 0x4002, 0x0898, 0x2021, 0x4003,
-	0x0880, 0x2021, 0x4005, 0x0868, 0x2021, 0x4006, 0x0850, 0x2039,
-	0x0001, 0x902e, 0x2520, 0x7b88, 0x7a8c, 0x7884, 0x7990, 0x0804,
-	0x48c2, 0x7883, 0x0004, 0x7884, 0x0807, 0x2039, 0x0001, 0x902e,
-	0x2520, 0x7b88, 0x7a8c, 0x7884, 0x7990, 0x0804, 0x48c5, 0x7984,
-	0x7888, 0x2114, 0x200a, 0x0804, 0x3337, 0x7984, 0x2114, 0x0804,
-	0x3337, 0x20e1, 0x0000, 0x2099, 0x0021, 0x20e9, 0x0000, 0x20a1,
-	0x0021, 0x20a9, 0x001f, 0x4003, 0x7984, 0x7a88, 0x7b8c, 0x0804,
-	0x3337, 0x7884, 0x2060, 0x04d8, 0x2009, 0x0003, 0x2011, 0x0002,
-	0x2019, 0x001c, 0x789b, 0x0317, 0x0804, 0x3337, 0x2039, 0x0001,
-	0x7d98, 0x7c9c, 0x0800, 0x2039, 0x0001, 0x7d98, 0x7c9c, 0x0848,
-	0x79a0, 0x9182, 0x0040, 0x0210, 0x0804, 0x336c, 0x2138, 0x7d98,
-	0x7c9c, 0x0804, 0x3373, 0x79a0, 0x9182, 0x0040, 0x0210, 0x0804,
-	0x336c, 0x2138, 0x7d98, 0x7c9c, 0x0804, 0x3381, 0x79a0, 0x9182,
-	0x0040, 0x0210, 0x0804, 0x336c, 0x21e8, 0x7984, 0x7888, 0x20a9,
-	0x0001, 0x21a0, 0x4004, 0x0804, 0x3337, 0x2061, 0x0800, 0xe10c,
-	0x9006, 0x2c15, 0x9200, 0x8c60, 0x8109, 0x1dd8, 0x2010, 0x9005,
-	0x0904, 0x3337, 0x0804, 0x3366, 0x79a0, 0x9182, 0x0040, 0x0210,
-	0x0804, 0x336c, 0x21e0, 0x20a9, 0x0001, 0x7984, 0x2198, 0x4012,
-	0x0804, 0x3337, 0x2069, 0x1853, 0x7884, 0x7990, 0x911a, 0x1a04,
-	0x336c, 0x8019, 0x0904, 0x336c, 0x684a, 0x6942, 0x788c, 0x6852,
-	0x7888, 0x6856, 0x9006, 0x685a, 0x685e, 0x080c, 0x72c7, 0x0804,
-	0x3337, 0x2069, 0x1853, 0x7884, 0x7994, 0x911a, 0x1a04, 0x336c,
-	0x8019, 0x0904, 0x336c, 0x684e, 0x6946, 0x788c, 0x6862, 0x7888,
-	0x6866, 0x9006, 0x686a, 0x686e, 0x0126, 0x2091, 0x8000, 0x080c,
-	0x6664, 0x012e, 0x0804, 0x3337, 0x902e, 0x2520, 0x81ff, 0x0120,
-	0x2009, 0x0001, 0x0804, 0x3369, 0x7984, 0x7b88, 0x7a8c, 0x20a9,
-	0x0005, 0x20e9, 0x0001, 0x20a1, 0x189c, 0x4101, 0x080c, 0x4879,
-	0x1120, 0x2009, 0x0002, 0x0804, 0x3369, 0x2009, 0x0020, 0xa85c,
-	0x9080, 0x0019, 0xaf60, 0x080c, 0x48c2, 0x701f, 0x3450, 0x0005,
-	0xa864, 0x2008, 0x9084, 0x00ff, 0x9096, 0x0011, 0x0168, 0x9096,
-	0x0019, 0x0150, 0x9096, 0x0015, 0x0138, 0x9096, 0x0048, 0x0120,
-	0x9096, 0x0029, 0x1904, 0x3369, 0x810f, 0x918c, 0x00ff, 0x0904,
-	0x3369, 0x7112, 0x7010, 0x8001, 0x0560, 0x7012, 0x080c, 0x4879,
-	0x1120, 0x2009, 0x0002, 0x0804, 0x3369, 0x2009, 0x0020, 0x7068,
-	0x2040, 0xa28c, 0xa390, 0xa494, 0xa598, 0x9290, 0x0040, 0x9399,
-	0x0000, 0x94a1, 0x0000, 0x95a9, 0x0000, 0xa85c, 0x9080, 0x0019,
-	0xaf60, 0x080c, 0x48c2, 0x701f, 0x348e, 0x0005, 0xa864, 0x9084,
-	0x00ff, 0x9096, 0x0002, 0x0120, 0x9096, 0x000a, 0x1904, 0x3369,
-	0x0888, 0x7014, 0x2048, 0xa868, 0xc0fd, 0xa86a, 0xa864, 0x9084,
-	0x00ff, 0x9096, 0x0029, 0x1160, 0xc2fd, 0xaa7a, 0x080c, 0x5ddd,
-	0x0150, 0x0126, 0x2091, 0x8000, 0xa87a, 0xa982, 0x012e, 0x0050,
-	0x080c, 0x60f4, 0x1128, 0x7007, 0x0003, 0x701f, 0x34ba, 0x0005,
-	0x080c, 0x6ac6, 0x0126, 0x2091, 0x8000, 0x20a9, 0x0005, 0x20e1,
-	0x0001, 0x2099, 0x189c, 0x400a, 0x2100, 0x9210, 0x9399, 0x0000,
-	0x94a1, 0x0000, 0x95a9, 0x0000, 0xa85c, 0x9080, 0x0019, 0x2009,
-	0x0020, 0x012e, 0xaf60, 0x0804, 0x48c5, 0x2091, 0x8000, 0x7837,
-	0x4000, 0x7833, 0x0010, 0x7883, 0x4000, 0x7887, 0x4953, 0x788b,
-	0x5020, 0x788f, 0x2020, 0x2009, 0x017f, 0x2104, 0x7892, 0x3f00,
-	0x7896, 0x2061, 0x0100, 0x6200, 0x2061, 0x0200, 0x603c, 0x8007,
-	0x9205, 0x789a, 0x2009, 0x04fd, 0x2104, 0x789e, 0x2091, 0x5000,
-	0x2091, 0x4080, 0x2001, 0x0089, 0x2004, 0xd084, 0x0180, 0x2001,
-	0x19ea, 0x2004, 0x9005, 0x0128, 0x2001, 0x008b, 0x2004, 0xd0fc,
-	0x0dd8, 0x2001, 0x008a, 0x2003, 0x0002, 0x2003, 0x1001, 0x2071,
-	0x0080, 0x0804, 0x0427, 0x81ff, 0x1904, 0x3369, 0x7984, 0x080c,
-	0x623e, 0x1904, 0x336c, 0x7e98, 0x9684, 0x3fff, 0x9082, 0x4000,
-	0x1a04, 0x336c, 0x7c88, 0x7d8c, 0x080c, 0x63a1, 0x080c, 0x6370,
-	0x0000, 0x1518, 0x2061, 0x1cd0, 0x0126, 0x2091, 0x8000, 0x6000,
-	0x9086, 0x0000, 0x0148, 0x6014, 0x904d, 0x0130, 0xa86c, 0x9406,
-	0x1118, 0xa870, 0x9506, 0x0150, 0x012e, 0x9ce0, 0x0018, 0x2001,
-	0x1819, 0x2004, 0x9c02, 0x1a04, 0x3369, 0x0c30, 0x080c, 0xb74a,
-	0x012e, 0x0904, 0x3369, 0x0804, 0x3337, 0x900e, 0x2001, 0x0005,
-	0x080c, 0x6ac6, 0x0126, 0x2091, 0x8000, 0x080c, 0xbe0c, 0x080c,
-	0x688c, 0x012e, 0x0804, 0x3337, 0x00a6, 0x2950, 0xb198, 0x080c,
-	0x623e, 0x1904, 0x35a6, 0xb6a4, 0x9684, 0x3fff, 0x9082, 0x4000,
-	0x16e8, 0xb49c, 0xb5a0, 0x080c, 0x63a1, 0x080c, 0x6370, 0x1520,
-	0x2061, 0x1cd0, 0x0126, 0x2091, 0x8000, 0x6000, 0x9086, 0x0000,
-	0x0148, 0x6014, 0x904d, 0x0130, 0xa86c, 0x9406, 0x1118, 0xa870,
-	0x9506, 0x0158, 0x012e, 0x9ce0, 0x0018, 0x2001, 0x1819, 0x2004,
-	0x9c02, 0x2009, 0x000d, 0x12b0, 0x0c28, 0x080c, 0xb74a, 0x012e,
-	0x2009, 0x0003, 0x0178, 0x00e0, 0x900e, 0x2001, 0x0005, 0x080c,
-	0x6ac6, 0x0126, 0x2091, 0x8000, 0x080c, 0xbe0c, 0x080c, 0x687f,
-	0x012e, 0x0070, 0xb097, 0x4005, 0xb19a, 0x0010, 0xb097, 0x4006,
-	0x900e, 0x9085, 0x0001, 0x2001, 0x0030, 0x2a48, 0x00ae, 0x0005,
-	0xb097, 0x4000, 0x9006, 0x918d, 0x0001, 0x2008, 0x2a48, 0x00ae,
-	0x0005, 0x81ff, 0x1904, 0x3369, 0x080c, 0x4890, 0x0904, 0x336c,
-	0x080c, 0x6305, 0x0904, 0x3369, 0x080c, 0x63a7, 0x0904, 0x3369,
-	0x0804, 0x4301, 0x81ff, 0x1904, 0x3369, 0x080c, 0x48ac, 0x0904,
-	0x336c, 0x080c, 0x6435, 0x0904, 0x3369, 0x2019, 0x0005, 0x79a8,
-	0x080c, 0x63c2, 0x0904, 0x3369, 0x7888, 0x908a, 0x1000, 0x1a04,
-	0x336c, 0x8003, 0x800b, 0x810b, 0x9108, 0x080c, 0x8046, 0x7984,
-	0xd184, 0x1904, 0x3337, 0x0804, 0x4301, 0x0126, 0x2091, 0x8000,
-	0x81ff, 0x0118, 0x2009, 0x0001, 0x0450, 0x2029, 0x07ff, 0x6458,
-	0x2400, 0x9506, 0x01f8, 0x2508, 0x080c, 0x623e, 0x11d8, 0x080c,
-	0x6435, 0x1128, 0x2009, 0x0002, 0x62bc, 0x2518, 0x00c0, 0x2019,
-	0x0004, 0x900e, 0x080c, 0x63c2, 0x1118, 0x2009, 0x0006, 0x0078,
-	0x7884, 0x908a, 0x1000, 0x1270, 0x8003, 0x800b, 0x810b, 0x9108,
-	0x080c, 0x8046, 0x8529, 0x1ae0, 0x012e, 0x0804, 0x3337, 0x012e,
-	0x0804, 0x3369, 0x012e, 0x0804, 0x336c, 0x080c, 0x4890, 0x0904,
-	0x336c, 0x080c, 0x6305, 0x0904, 0x3369, 0xbaa0, 0x2019, 0x0005,
-	0x00c6, 0x9066, 0x080c, 0x8571, 0x0076, 0x903e, 0x080c, 0x8469,
-	0x900e, 0x080c, 0xd29b, 0x007e, 0x00ce, 0x080c, 0x63a1, 0x0804,
-	0x3337, 0x080c, 0x4890, 0x0904, 0x336c, 0x080c, 0x63a1, 0x2208,
-	0x0804, 0x3337, 0x0156, 0x00d6, 0x00e6, 0x2069, 0x1906, 0x6810,
-	0x6914, 0x910a, 0x1208, 0x900e, 0x6816, 0x9016, 0x901e, 0x20a9,
-	0x007e, 0x2069, 0x1000, 0x2d04, 0x905d, 0x0118, 0xb84c, 0x0059,
-	0x9210, 0x8d68, 0x1f04, 0x365b, 0x2300, 0x9218, 0x00ee, 0x00de,
-	0x015e, 0x0804, 0x3337, 0x00f6, 0x0016, 0x907d, 0x0138, 0x9006,
-	0x8000, 0x2f0c, 0x81ff, 0x0110, 0x2178, 0x0cd0, 0x001e, 0x00fe,
-	0x0005, 0x2069, 0x1906, 0x6910, 0x62b8, 0x0804, 0x3337, 0x81ff,
-	0x0120, 0x2009, 0x0001, 0x0804, 0x3369, 0x0126, 0x2091, 0x8000,
-	0x080c, 0x539a, 0x0128, 0x2009, 0x0007, 0x012e, 0x0804, 0x3369,
-	0x012e, 0x6158, 0x9190, 0x3138, 0x2215, 0x9294, 0x00ff, 0x6378,
-	0x83ff, 0x0108, 0x627c, 0x67d8, 0x97c4, 0x000a, 0x98c6, 0x000a,
-	0x1118, 0x2031, 0x0001, 0x00e8, 0x97c4, 0x0022, 0x98c6, 0x0022,
-	0x1118, 0x2031, 0x0003, 0x00a8, 0x97c4, 0x0012, 0x98c6, 0x0012,
-	0x1118, 0x2031, 0x0002, 0x0068, 0x080c, 0x6fb2, 0x1118, 0x2031,
-	0x0004, 0x0038, 0xd79c, 0x0120, 0x2009, 0x0005, 0x0804, 0x3369,
-	0x9036, 0x7e9a, 0x7f9e, 0x0804, 0x3337, 0x6148, 0x624c, 0x2019,
-	0x1957, 0x231c, 0x2001, 0x1958, 0x2004, 0x789a, 0x0804, 0x3337,
-	0x0126, 0x2091, 0x8000, 0x6138, 0x623c, 0x6340, 0x012e, 0x0804,
-	0x3337, 0x080c, 0x48ac, 0x0904, 0x336c, 0xba44, 0xbb38, 0x0804,
-	0x3337, 0x080c, 0x0db4, 0x080c, 0x48ac, 0x2110, 0x0904, 0x336c,
-	0xb804, 0x908c, 0x00ff, 0x918e, 0x0006, 0x0140, 0x9084, 0xff00,
-	0x9086, 0x0600, 0x2009, 0x0009, 0x1904, 0x3369, 0x0126, 0x2091,
-	0x8000, 0x2019, 0x0005, 0x00c6, 0x9066, 0x080c, 0x9926, 0x080c,
-	0x8571, 0x0076, 0x903e, 0x080c, 0x8469, 0x900e, 0x080c, 0xd29b,
-	0x007e, 0x00ce, 0xb807, 0x0407, 0x012e, 0x0804, 0x3337, 0x6148,
-	0x624c, 0x7884, 0x604a, 0x7b88, 0x634e, 0x2069, 0x1853, 0x831f,
-	0x9305, 0x6816, 0x788c, 0x2069, 0x1957, 0x2d1c, 0x206a, 0x7e98,
-	0x9682, 0x0014, 0x1210, 0x2031, 0x07d0, 0x2069, 0x1958, 0x2d04,
-	0x266a, 0x789a, 0x0804, 0x3337, 0x0126, 0x2091, 0x8000, 0x6138,
-	0x7884, 0x603a, 0x910e, 0xd1b4, 0x190c, 0x0e9b, 0xd0c4, 0x01a8,
-	0x00d6, 0x78a8, 0x2009, 0x196e, 0x200a, 0x78ac, 0x2011, 0x196f,
-	0x2012, 0x2069, 0x0100, 0x6838, 0x9086, 0x0007, 0x1118, 0x2214,
-	0x6a5a, 0x0010, 0x210c, 0x695a, 0x00de, 0x7888, 0x603e, 0x2011,
-	0x0114, 0x220c, 0x7888, 0xd08c, 0x0118, 0x918d, 0x0080, 0x0010,
-	0x918c, 0xff7f, 0x2112, 0x6140, 0x788c, 0x6042, 0x910e, 0xd1e4,
-	0x190c, 0x0eb1, 0x6040, 0xd0cc, 0x0120, 0x78b0, 0x2011, 0x0114,
-	0x2012, 0x012e, 0x0804, 0x3337, 0x00f6, 0x2079, 0x1800, 0x7a38,
-	0xa898, 0x9084, 0xfebf, 0x9215, 0xa89c, 0x9084, 0xfebf, 0x8002,
-	0x9214, 0x7838, 0x9084, 0x0140, 0x9215, 0x7a3a, 0xa897, 0x4000,
-	0x900e, 0x9085, 0x0001, 0x2001, 0x0000, 0x00fe, 0x0005, 0x7898,
-	0x9005, 0x01a8, 0x7888, 0x9025, 0x0904, 0x336c, 0x788c, 0x902d,
-	0x0904, 0x336c, 0x900e, 0x080c, 0x623e, 0x1120, 0xba44, 0xbb38,
-	0xbc46, 0xbd3a, 0x9186, 0x07ff, 0x0190, 0x8108, 0x0ca0, 0x080c,
-	0x48ac, 0x0904, 0x336c, 0x7888, 0x900d, 0x0904, 0x336c, 0x788c,
-	0x9005, 0x0904, 0x336c, 0xba44, 0xb946, 0xbb38, 0xb83a, 0x0804,
-	0x3337, 0x2011, 0xbc09, 0x0010, 0x2011, 0xbc05, 0x080c, 0x539a,
-	0x1904, 0x3369, 0x00c6, 0x2061, 0x0100, 0x7984, 0x9186, 0x00ff,
-	0x1130, 0x2001, 0x1817, 0x2004, 0x9085, 0xff00, 0x0088, 0x9182,
-	0x007f, 0x16e0, 0x9188, 0x3138, 0x210d, 0x918c, 0x00ff, 0x2001,
-	0x1817, 0x2004, 0x0026, 0x9116, 0x002e, 0x0580, 0x810f, 0x9105,
-	0x0126, 0x2091, 0x8000, 0x0006, 0x080c, 0x9ddc, 0x000e, 0x0510,
-	0x602e, 0x620a, 0x7984, 0x00b6, 0x080c, 0x61e4, 0x2b08, 0x00be,
-	0x1500, 0x6112, 0x6023, 0x0001, 0x080c, 0x4879, 0x01d0, 0x9006,
-	0xa866, 0x7007, 0x0003, 0xa832, 0xa868, 0xc0fd, 0xa86a, 0x701f,
-	0x380c, 0x2900, 0x6016, 0x2009, 0x0032, 0x080c, 0x9eac, 0x012e,
-	0x00ce, 0x0005, 0x012e, 0x00ce, 0x0804, 0x3369, 0x00ce, 0x0804,
-	0x336c, 0x080c, 0x9e32, 0x0cb0, 0xa830, 0x9086, 0x0100, 0x0904,
-	0x3369, 0x0804, 0x3337, 0x2061, 0x1a41, 0x0126, 0x2091, 0x8000,
-	0x6000, 0xd084, 0x0170, 0x6104, 0x6208, 0x2061, 0x1800, 0x6350,
-	0x6070, 0x789a, 0x60bc, 0x789e, 0x60b8, 0x78aa, 0x012e, 0x0804,
-	0x3337, 0x900e, 0x2110, 0x0c88, 0x81ff, 0x1904, 0x3369, 0x080c,
-	0x6fb2, 0x0904, 0x3369, 0x0126, 0x2091, 0x8000, 0x6250, 0x6070,
-	0x9202, 0x0248, 0x9085, 0x0001, 0x080c, 0x26cc, 0x080c, 0x55b4,
-	0x012e, 0x0804, 0x3337, 0x012e, 0x0804, 0x336c, 0x0006, 0x0016,
-	0x00c6, 0x00e6, 0x2001, 0x197a, 0x2070, 0x2061, 0x1853, 0x6008,
-	0x2072, 0x900e, 0x2011, 0x1400, 0x080c, 0x8270, 0x7206, 0x00ee,
-	0x00ce, 0x001e, 0x000e, 0x0005, 0x0126, 0x2091, 0x8000, 0x81ff,
-	0x0128, 0x012e, 0x2021, 0x400b, 0x0804, 0x3339, 0x7884, 0xd0fc,
-	0x0148, 0x2001, 0x002a, 0x2004, 0x9082, 0x00e1, 0x0288, 0x012e,
-	0x0804, 0x336c, 0x2001, 0x002a, 0x2004, 0x2069, 0x1853, 0x6908,
-	0x9102, 0x1230, 0x012e, 0x0804, 0x336c, 0x012e, 0x0804, 0x3369,
-	0x080c, 0x9db1, 0x0dd0, 0x7884, 0xd0fc, 0x0904, 0x38d7, 0x00c6,
-	0x080c, 0x4879, 0x00ce, 0x0d88, 0xa867, 0x0000, 0x7884, 0xa80a,
-	0x7898, 0xa80e, 0x789c, 0xa812, 0x2001, 0x002e, 0x2004, 0xa81a,
-	0x2001, 0x002f, 0x2004, 0xa81e, 0x2001, 0x0030, 0x2004, 0xa822,
-	0x2001, 0x0031, 0x2004, 0xa826, 0x2001, 0x0034, 0x2004, 0xa82a,
-	0x2001, 0x0035, 0x2004, 0xa82e, 0x2001, 0x002a, 0x2004, 0x9080,
-	0x0003, 0x9084, 0x00fc, 0x8004, 0xa816, 0x080c, 0x3a5d, 0x0928,
-	0x7014, 0x2048, 0xad2c, 0xac28, 0xab1c, 0xaa18, 0xa930, 0xa808,
+	0x8000, 0x8000, 0x2071, 0x1894, 0x7003, 0x0002, 0x9006, 0x7016,
+	0x701a, 0x704a, 0x704e, 0x700e, 0x7042, 0x7046, 0x703b, 0x18b0,
+	0x703f, 0x18b0, 0x7007, 0x0001, 0x080c, 0x1004, 0x090c, 0x0db4,
+	0x2900, 0x706a, 0xa867, 0x0002, 0xa8ab, 0xdcb0, 0x080c, 0x1004,
+	0x090c, 0x0db4, 0x2900, 0x706e, 0xa867, 0x0002, 0xa8ab, 0xdcb0,
+	0x0005, 0x2071, 0x1894, 0x7004, 0x0002, 0x3269, 0x326a, 0x327d,
+	0x3291, 0x0005, 0x1004, 0x327a, 0x0e04, 0x327a, 0x2079, 0x0000,
+	0x0126, 0x2091, 0x8000, 0x700c, 0x9005, 0x1128, 0x700f, 0x0001,
+	0x012e, 0x0468, 0x0005, 0x012e, 0x0ce8, 0x2079, 0x0000, 0x2061,
+	0x18ae, 0x2c4c, 0xa86c, 0x908e, 0x0100, 0x0128, 0x9086, 0x0200,
+	0x0904, 0x3365, 0x0005, 0x7018, 0x2048, 0x2061, 0x1800, 0x701c,
+	0x0807, 0x7014, 0x2048, 0xa864, 0x9094, 0x00ff, 0x9296, 0x0029,
+	0x1120, 0xaa78, 0xd2fc, 0x0128, 0x0005, 0x9086, 0x0103, 0x0108,
+	0x0005, 0x2079, 0x0000, 0x2061, 0x1800, 0x701c, 0x0807, 0x2061,
+	0x1800, 0x7880, 0x908a, 0x0040, 0x1210, 0x61cc, 0x0042, 0x2100,
+	0x908a, 0x003f, 0x1a04, 0x3362, 0x61cc, 0x0804, 0x32f7, 0x3339,
+	0x3371, 0x3362, 0x337b, 0x3385, 0x338b, 0x338f, 0x339f, 0x33a3,
+	0x33b9, 0x33bf, 0x33c5, 0x33d0, 0x33db, 0x33ea, 0x33f9, 0x3407,
+	0x341e, 0x3439, 0x3362, 0x34e2, 0x3520, 0x35c6, 0x35d7, 0x35fa,
+	0x3362, 0x3362, 0x3362, 0x3632, 0x364e, 0x3657, 0x3686, 0x368c,
+	0x3362, 0x36d2, 0x3362, 0x3362, 0x3362, 0x3362, 0x3362, 0x36dd,
+	0x36e6, 0x36ee, 0x36f0, 0x3362, 0x3362, 0x3362, 0x3362, 0x3362,
+	0x3362, 0x371c, 0x3362, 0x3362, 0x3362, 0x3362, 0x3362, 0x3739,
+	0x3794, 0x3362, 0x3362, 0x3362, 0x3362, 0x3362, 0x3362, 0x0002,
+	0x37be, 0x37c1, 0x3820, 0x3839, 0x3869, 0x3b07, 0x3362, 0x4f68,
+	0x3362, 0x3362, 0x3362, 0x3362, 0x3362, 0x3362, 0x3362, 0x3362,
+	0x33b9, 0x33bf, 0x4028, 0x53b3, 0x403e, 0x4ff7, 0x5048, 0x514b,
+	0x3362, 0x51ad, 0x51e9, 0x521a, 0x531e, 0x5247, 0x529e, 0x3362,
+	0x4042, 0x41e3, 0x41f9, 0x421e, 0x4283, 0x42f7, 0x4317, 0x438e,
+	0x43ea, 0x4446, 0x4449, 0x446e, 0x450e, 0x4574, 0x457c, 0x46ae,
+	0x4813, 0x4847, 0x4a91, 0x3362, 0x4aaf, 0x4b6b, 0x4c41, 0x3362,
+	0x3362, 0x3362, 0x3362, 0x4ca7, 0x4cc2, 0x457c, 0x4f08, 0x714c,
+	0x0000, 0x2021, 0x4000, 0x080c, 0x48c5, 0x0126, 0x2091, 0x8000,
+	0x0e04, 0x3343, 0x0010, 0x012e, 0x0cc0, 0x7c36, 0x9486, 0x4000,
+	0x0118, 0x7833, 0x0011, 0x0010, 0x7833, 0x0010, 0x7c82, 0x7986,
+	0x7a8a, 0x7b8e, 0x2091, 0x4080, 0x2001, 0x0089, 0x2004, 0xd084,
+	0x190c, 0x1187, 0x7007, 0x0001, 0x2091, 0x5000, 0x700f, 0x0000,
+	0x012e, 0x0005, 0x2021, 0x4001, 0x08b0, 0x2021, 0x4002, 0x0898,
+	0x2021, 0x4003, 0x0880, 0x2021, 0x4005, 0x0868, 0x2021, 0x4006,
+	0x0850, 0x2039, 0x0001, 0x902e, 0x2520, 0x7b88, 0x7a8c, 0x7884,
+	0x7990, 0x0804, 0x48d2, 0x2039, 0x0001, 0x902e, 0x2520, 0x7b88,
+	0x7a8c, 0x7884, 0x7990, 0x0804, 0x48d5, 0x7984, 0x7888, 0x2114,
+	0x200a, 0x0804, 0x3339, 0x7984, 0x2114, 0x0804, 0x3339, 0x20e1,
+	0x0000, 0x2099, 0x0021, 0x20e9, 0x0000, 0x20a1, 0x0021, 0x20a9,
+	0x001f, 0x4003, 0x7984, 0x7a88, 0x7b8c, 0x0804, 0x3339, 0x7884,
+	0x2060, 0x0804, 0x33ec, 0x2009, 0x0003, 0x2011, 0x0002, 0x2019,
+	0x001e, 0x789b, 0x0317, 0x7893, 0xffff, 0x2001, 0x1885, 0x2004,
+	0x9005, 0x0118, 0x7896, 0x0804, 0x3339, 0x7897, 0x0001, 0x0804,
+	0x3339, 0x2039, 0x0001, 0x7d98, 0x7c9c, 0x0804, 0x3375, 0x2039,
+	0x0001, 0x7d98, 0x7c9c, 0x0804, 0x337f, 0x79a0, 0x9182, 0x0040,
+	0x0210, 0x0804, 0x336e, 0x2138, 0x7d98, 0x7c9c, 0x0804, 0x3375,
+	0x79a0, 0x9182, 0x0040, 0x0210, 0x0804, 0x336e, 0x2138, 0x7d98,
+	0x7c9c, 0x0804, 0x337f, 0x79a0, 0x9182, 0x0040, 0x0210, 0x0804,
+	0x336e, 0x21e8, 0x7984, 0x7888, 0x20a9, 0x0001, 0x21a0, 0x4004,
+	0x0804, 0x3339, 0x2061, 0x0800, 0xe10c, 0x9006, 0x2c15, 0x9200,
+	0x8c60, 0x8109, 0x1dd8, 0x2010, 0x9005, 0x0904, 0x3339, 0x0804,
+	0x3368, 0x79a0, 0x9182, 0x0040, 0x0210, 0x0804, 0x336e, 0x21e0,
+	0x20a9, 0x0001, 0x7984, 0x2198, 0x4012, 0x0804, 0x3339, 0x2069,
+	0x1853, 0x7884, 0x7990, 0x911a, 0x1a04, 0x336e, 0x8019, 0x0904,
+	0x336e, 0x684a, 0x6942, 0x788c, 0x6852, 0x7888, 0x6856, 0x9006,
+	0x685a, 0x685e, 0x080c, 0x72b0, 0x0804, 0x3339, 0x2069, 0x1853,
+	0x7884, 0x7994, 0x911a, 0x1a04, 0x336e, 0x8019, 0x0904, 0x336e,
+	0x684e, 0x6946, 0x788c, 0x6862, 0x7888, 0x6866, 0x9006, 0x686a,
+	0x686e, 0x0126, 0x2091, 0x8000, 0x080c, 0x6669, 0x012e, 0x0804,
+	0x3339, 0x902e, 0x2520, 0x81ff, 0x0120, 0x2009, 0x0001, 0x0804,
+	0x336b, 0x7984, 0x7b88, 0x7a8c, 0x20a9, 0x0005, 0x20e9, 0x0001,
+	0x20a1, 0x189c, 0x4101, 0x080c, 0x4889, 0x1120, 0x2009, 0x0002,
+	0x0804, 0x336b, 0x2009, 0x0020, 0xa85c, 0x9080, 0x0019, 0xaf60,
+	0x080c, 0x48d2, 0x701f, 0x345d, 0x0005, 0xa864, 0x2008, 0x9084,
+	0x00ff, 0x9096, 0x0011, 0x0168, 0x9096, 0x0019, 0x0150, 0x9096,
+	0x0015, 0x0138, 0x9096, 0x0048, 0x0120, 0x9096, 0x0029, 0x1904,
+	0x336b, 0x810f, 0x918c, 0x00ff, 0x0904, 0x336b, 0x7112, 0x7010,
+	0x8001, 0x0560, 0x7012, 0x080c, 0x4889, 0x1120, 0x2009, 0x0002,
+	0x0804, 0x336b, 0x2009, 0x0020, 0x7068, 0x2040, 0xa28c, 0xa390,
+	0xa494, 0xa598, 0x9290, 0x0040, 0x9399, 0x0000, 0x94a1, 0x0000,
+	0x95a9, 0x0000, 0xa85c, 0x9080, 0x0019, 0xaf60, 0x080c, 0x48d2,
+	0x701f, 0x349b, 0x0005, 0xa864, 0x9084, 0x00ff, 0x9096, 0x0002,
+	0x0120, 0x9096, 0x000a, 0x1904, 0x336b, 0x0888, 0x7014, 0x2048,
+	0xa868, 0xc0fd, 0xa86a, 0xa864, 0x9084, 0x00ff, 0x9096, 0x0029,
+	0x1160, 0xc2fd, 0xaa7a, 0x080c, 0x5de6, 0x0150, 0x0126, 0x2091,
+	0x8000, 0xa87a, 0xa982, 0x012e, 0x0050, 0x080c, 0x60fd, 0x1128,
+	0x7007, 0x0003, 0x701f, 0x34c7, 0x0005, 0x080c, 0x6abf, 0x0126,
+	0x2091, 0x8000, 0x20a9, 0x0005, 0x20e1, 0x0001, 0x2099, 0x189c,
+	0x400a, 0x2100, 0x9210, 0x9399, 0x0000, 0x94a1, 0x0000, 0x95a9,
+	0x0000, 0xa85c, 0x9080, 0x0019, 0x2009, 0x0020, 0x012e, 0xaf60,
+	0x0804, 0x48d5, 0x2091, 0x8000, 0x7837, 0x4000, 0x7833, 0x0010,
+	0x7883, 0x4000, 0x7887, 0x4953, 0x788b, 0x5020, 0x788f, 0x2020,
+	0x2009, 0x017f, 0x2104, 0x7892, 0x3f00, 0x7896, 0x2061, 0x0100,
+	0x6200, 0x2061, 0x0200, 0x603c, 0x8007, 0x9205, 0x789a, 0x2009,
+	0x04fd, 0x2104, 0x789e, 0x2091, 0x5000, 0x2091, 0x4080, 0x2001,
+	0x0089, 0x2004, 0xd084, 0x0180, 0x2001, 0x19e9, 0x2004, 0x9005,
+	0x0128, 0x2001, 0x008b, 0x2004, 0xd0fc, 0x0dd8, 0x2001, 0x008a,
+	0x2003, 0x0002, 0x2003, 0x1001, 0x2071, 0x0080, 0x0804, 0x0427,
+	0x81ff, 0x1904, 0x336b, 0x7984, 0x080c, 0x6247, 0x1904, 0x336e,
+	0x7e98, 0x9684, 0x3fff, 0x9082, 0x4000, 0x1a04, 0x336e, 0x7c88,
+	0x7d8c, 0x080c, 0x63aa, 0x080c, 0x6379, 0x0000, 0x1518, 0x2061,
+	0x1cd0, 0x0126, 0x2091, 0x8000, 0x6000, 0x9086, 0x0000, 0x0148,
+	0x6014, 0x904d, 0x0130, 0xa86c, 0x9406, 0x1118, 0xa870, 0x9506,
+	0x0150, 0x012e, 0x9ce0, 0x0018, 0x2001, 0x1819, 0x2004, 0x9c02,
+	0x1a04, 0x336b, 0x0c30, 0x080c, 0xb75d, 0x012e, 0x0904, 0x336b,
+	0x0804, 0x3339, 0x900e, 0x2001, 0x0005, 0x080c, 0x6abf, 0x0126,
+	0x2091, 0x8000, 0x080c, 0xbe26, 0x080c, 0x6891, 0x012e, 0x0804,
+	0x3339, 0x00a6, 0x2950, 0xb198, 0x080c, 0x6247, 0x1904, 0x35b3,
+	0xb6a4, 0x9684, 0x3fff, 0x9082, 0x4000, 0x16e8, 0xb49c, 0xb5a0,
+	0x080c, 0x63aa, 0x080c, 0x6379, 0x1520, 0x2061, 0x1cd0, 0x0126,
+	0x2091, 0x8000, 0x6000, 0x9086, 0x0000, 0x0148, 0x6014, 0x904d,
+	0x0130, 0xa86c, 0x9406, 0x1118, 0xa870, 0x9506, 0x0158, 0x012e,
+	0x9ce0, 0x0018, 0x2001, 0x1819, 0x2004, 0x9c02, 0x2009, 0x000d,
+	0x12b0, 0x0c28, 0x080c, 0xb75d, 0x012e, 0x2009, 0x0003, 0x0178,
+	0x00e0, 0x900e, 0x2001, 0x0005, 0x080c, 0x6abf, 0x0126, 0x2091,
+	0x8000, 0x080c, 0xbe26, 0x080c, 0x6884, 0x012e, 0x0070, 0xb097,
+	0x4005, 0xb19a, 0x0010, 0xb097, 0x4006, 0x900e, 0x9085, 0x0001,
+	0x2001, 0x0030, 0x2a48, 0x00ae, 0x0005, 0xb097, 0x4000, 0x9006,
+	0x918d, 0x0001, 0x2008, 0x2a48, 0x00ae, 0x0005, 0x81ff, 0x1904,
+	0x336b, 0x080c, 0x48a0, 0x0904, 0x336e, 0x080c, 0x630e, 0x0904,
+	0x336b, 0x080c, 0x63b0, 0x0904, 0x336b, 0x0804, 0x430e, 0x81ff,
+	0x1904, 0x336b, 0x080c, 0x48bc, 0x0904, 0x336e, 0x080c, 0x643e,
+	0x0904, 0x336b, 0x2019, 0x0005, 0x79a8, 0x080c, 0x63cb, 0x0904,
+	0x336b, 0x7888, 0x908a, 0x1000, 0x1a04, 0x336e, 0x8003, 0x800b,
+	0x810b, 0x9108, 0x080c, 0x802f, 0x7984, 0xd184, 0x1904, 0x3339,
+	0x0804, 0x430e, 0x0126, 0x2091, 0x8000, 0x81ff, 0x0118, 0x2009,
+	0x0001, 0x0450, 0x2029, 0x07ff, 0x6458, 0x2400, 0x9506, 0x01f8,
+	0x2508, 0x080c, 0x6247, 0x11d8, 0x080c, 0x643e, 0x1128, 0x2009,
+	0x0002, 0x62bc, 0x2518, 0x00c0, 0x2019, 0x0004, 0x900e, 0x080c,
+	0x63cb, 0x1118, 0x2009, 0x0006, 0x0078, 0x7884, 0x908a, 0x1000,
+	0x1270, 0x8003, 0x800b, 0x810b, 0x9108, 0x080c, 0x802f, 0x8529,
+	0x1ae0, 0x012e, 0x0804, 0x3339, 0x012e, 0x0804, 0x336b, 0x012e,
+	0x0804, 0x336e, 0x080c, 0x48a0, 0x0904, 0x336e, 0x080c, 0x630e,
+	0x0904, 0x336b, 0xbaa0, 0x2019, 0x0005, 0x00c6, 0x9066, 0x080c,
+	0x8564, 0x0076, 0x903e, 0x080c, 0x8452, 0x900e, 0x080c, 0xd2bc,
+	0x007e, 0x00ce, 0x080c, 0x63aa, 0x0804, 0x3339, 0x080c, 0x48a0,
+	0x0904, 0x336e, 0x080c, 0x63aa, 0x2208, 0x0804, 0x3339, 0x0156,
+	0x00d6, 0x00e6, 0x2069, 0x1906, 0x6810, 0x6914, 0x910a, 0x1208,
+	0x900e, 0x6816, 0x9016, 0x901e, 0x20a9, 0x007e, 0x2069, 0x1000,
+	0x2d04, 0x905d, 0x0118, 0xb84c, 0x0059, 0x9210, 0x8d68, 0x1f04,
+	0x3668, 0x2300, 0x9218, 0x00ee, 0x00de, 0x015e, 0x0804, 0x3339,
+	0x00f6, 0x0016, 0x907d, 0x0138, 0x9006, 0x8000, 0x2f0c, 0x81ff,
+	0x0110, 0x2178, 0x0cd0, 0x001e, 0x00fe, 0x0005, 0x2069, 0x1906,
+	0x6910, 0x62b8, 0x0804, 0x3339, 0x81ff, 0x0120, 0x2009, 0x0001,
+	0x0804, 0x336b, 0x0126, 0x2091, 0x8000, 0x080c, 0x53a3, 0x0128,
+	0x2009, 0x0007, 0x012e, 0x0804, 0x336b, 0x012e, 0x6158, 0x9190,
+	0x313a, 0x2215, 0x9294, 0x00ff, 0x6378, 0x83ff, 0x0108, 0x627c,
+	0x67d8, 0x97c4, 0x000a, 0x98c6, 0x000a, 0x1118, 0x2031, 0x0001,
+	0x00e8, 0x97c4, 0x0022, 0x98c6, 0x0022, 0x1118, 0x2031, 0x0003,
+	0x00a8, 0x97c4, 0x0012, 0x98c6, 0x0012, 0x1118, 0x2031, 0x0002,
+	0x0068, 0x080c, 0x6f9b, 0x1118, 0x2031, 0x0004, 0x0038, 0xd79c,
+	0x0120, 0x2009, 0x0005, 0x0804, 0x336b, 0x9036, 0x7e9a, 0x7f9e,
+	0x0804, 0x3339, 0x6148, 0x624c, 0x2019, 0x1956, 0x231c, 0x2001,
+	0x1957, 0x2004, 0x789a, 0x0804, 0x3339, 0x0126, 0x2091, 0x8000,
+	0x6138, 0x623c, 0x6340, 0x012e, 0x0804, 0x3339, 0x080c, 0x48bc,
+	0x0904, 0x336e, 0xba44, 0xbb38, 0x0804, 0x3339, 0x080c, 0x0db4,
+	0x080c, 0x48bc, 0x2110, 0x0904, 0x336e, 0xb804, 0x908c, 0x00ff,
+	0x918e, 0x0006, 0x0140, 0x9084, 0xff00, 0x9086, 0x0600, 0x2009,
+	0x0009, 0x1904, 0x336b, 0x0126, 0x2091, 0x8000, 0x2019, 0x0005,
+	0x00c6, 0x9066, 0x080c, 0x992c, 0x080c, 0x8564, 0x0076, 0x903e,
+	0x080c, 0x8452, 0x900e, 0x080c, 0xd2bc, 0x007e, 0x00ce, 0xb807,
+	0x0407, 0x012e, 0x0804, 0x3339, 0x6148, 0x624c, 0x7884, 0x604a,
+	0x7b88, 0x634e, 0x2069, 0x1853, 0x831f, 0x9305, 0x6816, 0x788c,
+	0x2069, 0x1956, 0x2d1c, 0x206a, 0x7e98, 0x9682, 0x0014, 0x1210,
+	0x2031, 0x07d0, 0x2069, 0x1957, 0x2d04, 0x266a, 0x789a, 0x0804,
+	0x3339, 0x0126, 0x2091, 0x8000, 0x6138, 0x7884, 0x603a, 0x910e,
+	0xd1b4, 0x190c, 0x0e9b, 0xd0c4, 0x01a8, 0x00d6, 0x78a8, 0x2009,
+	0x196d, 0x200a, 0x78ac, 0x2011, 0x196e, 0x2012, 0x2069, 0x0100,
+	0x6838, 0x9086, 0x0007, 0x1118, 0x2214, 0x6a5a, 0x0010, 0x210c,
+	0x695a, 0x00de, 0x7888, 0x603e, 0x2011, 0x0114, 0x220c, 0x7888,
+	0xd08c, 0x0118, 0x918d, 0x0080, 0x0010, 0x918c, 0xff7f, 0x2112,
+	0x6140, 0x788c, 0x6042, 0x910e, 0xd1e4, 0x190c, 0x0eb1, 0x6040,
+	0xd0cc, 0x0120, 0x78b0, 0x2011, 0x0114, 0x2012, 0x012e, 0x0804,
+	0x3339, 0x00f6, 0x2079, 0x1800, 0x7a38, 0xa898, 0x9084, 0xfebf,
+	0x9215, 0xa89c, 0x9084, 0xfebf, 0x8002, 0x9214, 0x7838, 0x9084,
+	0x0140, 0x9215, 0x7a3a, 0xa897, 0x4000, 0x900e, 0x9085, 0x0001,
+	0x2001, 0x0000, 0x00fe, 0x0005, 0x7898, 0x9005, 0x01a8, 0x7888,
+	0x9025, 0x0904, 0x336e, 0x788c, 0x902d, 0x0904, 0x336e, 0x900e,
+	0x080c, 0x6247, 0x1120, 0xba44, 0xbb38, 0xbc46, 0xbd3a, 0x9186,
+	0x07ff, 0x0190, 0x8108, 0x0ca0, 0x080c, 0x48bc, 0x0904, 0x336e,
+	0x7888, 0x900d, 0x0904, 0x336e, 0x788c, 0x9005, 0x0904, 0x336e,
+	0xba44, 0xb946, 0xbb38, 0xb83a, 0x0804, 0x3339, 0x2011, 0xbc09,
+	0x0010, 0x2011, 0xbc05, 0x080c, 0x53a3, 0x1904, 0x336b, 0x00c6,
+	0x2061, 0x0100, 0x7984, 0x9186, 0x00ff, 0x1130, 0x2001, 0x1817,
+	0x2004, 0x9085, 0xff00, 0x0088, 0x9182, 0x007f, 0x16e0, 0x9188,
+	0x313a, 0x210d, 0x918c, 0x00ff, 0x2001, 0x1817, 0x2004, 0x0026,
+	0x9116, 0x002e, 0x0580, 0x810f, 0x9105, 0x0126, 0x2091, 0x8000,
+	0x0006, 0x080c, 0x9dec, 0x000e, 0x0510, 0x602e, 0x620a, 0x7984,
+	0x00b6, 0x080c, 0x61ed, 0x2b08, 0x00be, 0x1500, 0x6112, 0x6023,
+	0x0001, 0x080c, 0x4889, 0x01d0, 0x9006, 0xa866, 0x7007, 0x0003,
+	0xa832, 0xa868, 0xc0fd, 0xa86a, 0x701f, 0x3819, 0x2900, 0x6016,
+	0x2009, 0x0032, 0x080c, 0x9ebc, 0x012e, 0x00ce, 0x0005, 0x012e,
+	0x00ce, 0x0804, 0x336b, 0x00ce, 0x0804, 0x336e, 0x080c, 0x9e42,
+	0x0cb0, 0xa830, 0x9086, 0x0100, 0x0904, 0x336b, 0x0804, 0x3339,
+	0x2061, 0x1a40, 0x0126, 0x2091, 0x8000, 0x6000, 0xd084, 0x0170,
+	0x6104, 0x6208, 0x2061, 0x1800, 0x6350, 0x6070, 0x789a, 0x60bc,
+	0x789e, 0x60b8, 0x78aa, 0x012e, 0x0804, 0x3339, 0x900e, 0x2110,
+	0x0c88, 0x81ff, 0x1904, 0x336b, 0x080c, 0x6f9b, 0x0904, 0x336b,
+	0x0126, 0x2091, 0x8000, 0x6250, 0x6070, 0x9202, 0x0248, 0x9085,
+	0x0001, 0x080c, 0x26ce, 0x080c, 0x55bd, 0x012e, 0x0804, 0x3339,
+	0x012e, 0x0804, 0x336e, 0x0006, 0x0016, 0x00c6, 0x00e6, 0x2001,
+	0x1979, 0x2070, 0x2061, 0x1853, 0x6008, 0x2072, 0x900e, 0x2011,
+	0x1400, 0x080c, 0x8259, 0x7206, 0x00ee, 0x00ce, 0x001e, 0x000e,
+	0x0005, 0x0126, 0x2091, 0x8000, 0x81ff, 0x0128, 0x012e, 0x2021,
+	0x400b, 0x0804, 0x333b, 0x7884, 0xd0fc, 0x0148, 0x2001, 0x002a,
+	0x2004, 0x9082, 0x00e1, 0x0288, 0x012e, 0x0804, 0x336e, 0x2001,
+	0x002a, 0x2004, 0x2069, 0x1853, 0x6908, 0x9102, 0x1230, 0x012e,
+	0x0804, 0x336e, 0x012e, 0x0804, 0x336b, 0x080c, 0x9dc1, 0x0dd0,
+	0x7884, 0xd0fc, 0x0904, 0x38e4, 0x00c6, 0x080c, 0x4889, 0x00ce,
+	0x0d88, 0xa867, 0x0000, 0x7884, 0xa80a, 0x7898, 0xa80e, 0x789c,
+	0xa812, 0x2001, 0x002e, 0x2004, 0xa81a, 0x2001, 0x002f, 0x2004,
+	0xa81e, 0x2001, 0x0030, 0x2004, 0xa822, 0x2001, 0x0031, 0x2004,
+	0xa826, 0x2001, 0x0034, 0x2004, 0xa82a, 0x2001, 0x0035, 0x2004,
+	0xa82e, 0x2001, 0x002a, 0x2004, 0x9080, 0x0003, 0x9084, 0x00fc,
+	0x8004, 0xa816, 0x080c, 0x3a6a, 0x0928, 0x7014, 0x2048, 0xad2c,
+	0xac28, 0xab1c, 0xaa18, 0xa930, 0xa808, 0xd0b4, 0x1120, 0x2029,
+	0x0000, 0x2021, 0x0000, 0x8906, 0x8006, 0x8007, 0x90bc, 0x003f,
+	0x9084, 0xffc0, 0x9080, 0x001b, 0x080c, 0x48d2, 0x701f, 0x39a7,
+	0x7023, 0x0001, 0x012e, 0x0005, 0x0046, 0x0086, 0x0096, 0x00a6,
+	0x00b6, 0x00c6, 0x00d6, 0x00e6, 0x00f6, 0x080c, 0x3853, 0x2001,
+	0x196f, 0x2003, 0x0000, 0x2021, 0x000a, 0x2061, 0x0100, 0x6104,
+	0x0016, 0x60bb, 0x0000, 0x60bf, 0x32e1, 0x60bf, 0x0012, 0x080c,
+	0x3ad9, 0x080c, 0x3a98, 0x00f6, 0x00e6, 0x0086, 0x2940, 0x2071,
+	0x1a35, 0x2079, 0x0090, 0x00d6, 0x2069, 0x0000, 0x6884, 0xd0b4,
+	0x0140, 0x2001, 0x0035, 0x2004, 0x780e, 0x2001, 0x0034, 0x2004,
+	0x780a, 0x00de, 0x2011, 0x0001, 0x080c, 0x3e6c, 0x008e, 0x00ee,
+	0x00fe, 0x080c, 0x3d99, 0x080c, 0x3c9e, 0x05b8, 0x2001, 0x020b,
+	0x2004, 0x9084, 0x0140, 0x1db8, 0x080c, 0x3ee0, 0x00f6, 0x2079,
+	0x0300, 0x78bc, 0x00fe, 0x908c, 0x0070, 0x1560, 0x2071, 0x0200,
+	0x7037, 0x0000, 0x7050, 0x9084, 0xff00, 0x9086, 0x3200, 0x1510,
+	0x7037, 0x0001, 0x7050, 0x9084, 0xff00, 0x9086, 0xe100, 0x11d0,
+	0x7037, 0x0000, 0x7054, 0x7037, 0x0000, 0x715c, 0x9106, 0x1190,
+	0x2001, 0x181f, 0x2004, 0x9106, 0x1168, 0x00c6, 0x2061, 0x0100,
+	0x6024, 0x9084, 0x1e00, 0x00ce, 0x0138, 0x080c, 0x3ca8, 0x080c,
+	0x3a93, 0x0058, 0x080c, 0x3a93, 0x080c, 0x3e04, 0x080c, 0x3d8f,
+	0x2001, 0x020b, 0x2004, 0xd0e4, 0x0dd8, 0x2001, 0x032a, 0x2003,
+	0x0004, 0x2061, 0x0100, 0x6027, 0x0002, 0x001e, 0x6106, 0x2011,
+	0x020d, 0x2013, 0x0020, 0x60bb, 0x0000, 0x60bf, 0x0108, 0x60bf,
+	0x0012, 0x2001, 0x0004, 0x200c, 0x918c, 0xfffd, 0x2102, 0x080c,
+	0x129f, 0x2009, 0x0028, 0x080c, 0x226a, 0x2001, 0x0227, 0x200c,
+	0x2102, 0x00fe, 0x00ee, 0x00de, 0x00ce, 0x00be, 0x00ae, 0x009e,
+	0x008e, 0x004e, 0x2001, 0x196f, 0x2004, 0x9005, 0x1118, 0x012e,
+	0x0804, 0x3339, 0x012e, 0x2021, 0x400c, 0x0804, 0x333b, 0x0016,
+	0x0026, 0x0036, 0x0046, 0x0056, 0x0076, 0x0086, 0x0096, 0x00d6,
+	0x0156, 0x7014, 0x2048, 0x7020, 0x20a8, 0x8000, 0x7022, 0xa804,
+	0x9005, 0x0904, 0x3a03, 0x2048, 0x1f04, 0x39b7, 0x7068, 0x2040,
+	0xa28c, 0xa390, 0xa494, 0xa598, 0xa930, 0xa808, 0xd0b4, 0x1120,
+	0x2029, 0x0000, 0x2021, 0x0000, 0x0096, 0x7014, 0x2048, 0xa864,
+	0x009e, 0x9086, 0x0103, 0x0170, 0x8906, 0x8006, 0x8007, 0x90bc,
+	0x003f, 0x9084, 0xffc0, 0x9080, 0x001b, 0x080c, 0x48d2, 0x701f,
+	0x39a7, 0x00b0, 0x8906, 0x8006, 0x8007, 0x90bc, 0x003f, 0x9084,
+	0xffc0, 0x9080, 0x001b, 0x21a8, 0x27e0, 0x2098, 0x27e8, 0x20a0,
+	0x0006, 0x080c, 0x0f68, 0x000e, 0x080c, 0x48d5, 0x701f, 0x39a7,
+	0x015e, 0x00de, 0x009e, 0x008e, 0x007e, 0x005e, 0x004e, 0x003e,
+	0x002e, 0x001e, 0x0005, 0x7014, 0x2048, 0xa864, 0x9086, 0x0103,
+	0x1118, 0x701f, 0x3a68, 0x0450, 0x7014, 0x2048, 0xa868, 0xc0fd,
+	0xa86a, 0x2009, 0x007f, 0x080c, 0x61e7, 0x0110, 0x9006, 0x0030,
+	0xb813, 0x00ff, 0xb817, 0xfffd, 0x080c, 0xbff5, 0x015e, 0x00de,
+	0x009e, 0x008e, 0x007e, 0x005e, 0x004e, 0x003e, 0x002e, 0x001e,
+	0x0904, 0x336b, 0x0016, 0x0026, 0x0036, 0x0046, 0x0056, 0x0076,
+	0x0086, 0x0096, 0x00d6, 0x0156, 0x701f, 0x3a3a, 0x7007, 0x0003,
+	0x0804, 0x39f8, 0xa830, 0x9086, 0x0100, 0x2021, 0x400c, 0x0904,
+	0x333b, 0x0076, 0xad10, 0xac0c, 0xab24, 0xaa20, 0xa930, 0xa808,
 	0xd0b4, 0x1120, 0x2029, 0x0000, 0x2021, 0x0000, 0x8906, 0x8006,
-	0x8007, 0x90bc, 0x003f, 0x9084, 0xffc0, 0x9080, 0x001b, 0x080c,
-	0x48c2, 0x701f, 0x399a, 0x7023, 0x0001, 0x012e, 0x0005, 0x0046,
-	0x0086, 0x0096, 0x00a6, 0x00b6, 0x00c6, 0x00d6, 0x00e6, 0x00f6,
-	0x080c, 0x3846, 0x2001, 0x1970, 0x2003, 0x0000, 0x2021, 0x000a,
-	0x2061, 0x0100, 0x6104, 0x0016, 0x60bb, 0x0000, 0x60bf, 0x32e1,
-	0x60bf, 0x0012, 0x080c, 0x3acc, 0x080c, 0x3a8b, 0x00f6, 0x00e6,
-	0x0086, 0x2940, 0x2071, 0x1a36, 0x2079, 0x0090, 0x00d6, 0x2069,
-	0x0000, 0x6884, 0xd0b4, 0x0140, 0x2001, 0x0035, 0x2004, 0x780e,
-	0x2001, 0x0034, 0x2004, 0x780a, 0x00de, 0x2011, 0x0001, 0x080c,
-	0x3e5f, 0x008e, 0x00ee, 0x00fe, 0x080c, 0x3d8c, 0x080c, 0x3c91,
-	0x05b8, 0x2001, 0x020b, 0x2004, 0x9084, 0x0140, 0x1db8, 0x080c,
-	0x3ed3, 0x00f6, 0x2079, 0x0300, 0x78bc, 0x00fe, 0x908c, 0x0070,
-	0x1560, 0x2071, 0x0200, 0x7037, 0x0000, 0x7050, 0x9084, 0xff00,
-	0x9086, 0x3200, 0x1510, 0x7037, 0x0001, 0x7050, 0x9084, 0xff00,
-	0x9086, 0xe100, 0x11d0, 0x7037, 0x0000, 0x7054, 0x7037, 0x0000,
-	0x715c, 0x9106, 0x1190, 0x2001, 0x181f, 0x2004, 0x9106, 0x1168,
-	0x00c6, 0x2061, 0x0100, 0x6024, 0x9084, 0x1e00, 0x00ce, 0x0138,
-	0x080c, 0x3c9b, 0x080c, 0x3a86, 0x0058, 0x080c, 0x3a86, 0x080c,
-	0x3df7, 0x080c, 0x3d82, 0x2001, 0x020b, 0x2004, 0xd0e4, 0x0dd8,
-	0x2001, 0x032a, 0x2003, 0x0004, 0x2061, 0x0100, 0x6027, 0x0002,
-	0x001e, 0x6106, 0x2011, 0x020d, 0x2013, 0x0020, 0x60bb, 0x0000,
-	0x60bf, 0x0108, 0x60bf, 0x0012, 0x2001, 0x0004, 0x200c, 0x918c,
-	0xfffd, 0x2102, 0x080c, 0x129f, 0x2009, 0x0028, 0x080c, 0x2268,
-	0x2001, 0x0227, 0x200c, 0x2102, 0x00fe, 0x00ee, 0x00de, 0x00ce,
-	0x00be, 0x00ae, 0x009e, 0x008e, 0x004e, 0x2001, 0x1970, 0x2004,
-	0x9005, 0x1118, 0x012e, 0x0804, 0x3337, 0x012e, 0x2021, 0x400c,
-	0x0804, 0x3339, 0x0016, 0x0026, 0x0036, 0x0046, 0x0056, 0x0076,
-	0x0086, 0x0096, 0x00d6, 0x0156, 0x7014, 0x2048, 0x7020, 0x20a8,
-	0x8000, 0x7022, 0xa804, 0x9005, 0x0904, 0x39f6, 0x2048, 0x1f04,
-	0x39aa, 0x7068, 0x2040, 0xa28c, 0xa390, 0xa494, 0xa598, 0xa930,
-	0xa808, 0xd0b4, 0x1120, 0x2029, 0x0000, 0x2021, 0x0000, 0x0096,
-	0x7014, 0x2048, 0xa864, 0x009e, 0x9086, 0x0103, 0x0170, 0x8906,
-	0x8006, 0x8007, 0x90bc, 0x003f, 0x9084, 0xffc0, 0x9080, 0x001b,
-	0x080c, 0x48c2, 0x701f, 0x399a, 0x00b0, 0x8906, 0x8006, 0x8007,
-	0x90bc, 0x003f, 0x9084, 0xffc0, 0x9080, 0x001b, 0x21a8, 0x27e0,
-	0x2098, 0x27e8, 0x20a0, 0x0006, 0x080c, 0x0f68, 0x000e, 0x080c,
-	0x48c5, 0x701f, 0x399a, 0x015e, 0x00de, 0x009e, 0x008e, 0x007e,
-	0x005e, 0x004e, 0x003e, 0x002e, 0x001e, 0x0005, 0x7014, 0x2048,
-	0xa864, 0x9086, 0x0103, 0x1118, 0x701f, 0x3a5b, 0x0450, 0x7014,
-	0x2048, 0xa868, 0xc0fd, 0xa86a, 0x2009, 0x007f, 0x080c, 0x61de,
-	0x0110, 0x9006, 0x0030, 0xb813, 0x00ff, 0xb817, 0xfffd, 0x080c,
-	0xbfdb, 0x015e, 0x00de, 0x009e, 0x008e, 0x007e, 0x005e, 0x004e,
-	0x003e, 0x002e, 0x001e, 0x0904, 0x3369, 0x0016, 0x0026, 0x0036,
-	0x0046, 0x0056, 0x0076, 0x0086, 0x0096, 0x00d6, 0x0156, 0x701f,
-	0x3a2d, 0x7007, 0x0003, 0x0804, 0x39eb, 0xa830, 0x9086, 0x0100,
-	0x2021, 0x400c, 0x0904, 0x3339, 0x0076, 0xad10, 0xac0c, 0xab24,
-	0xaa20, 0xa930, 0xa808, 0xd0b4, 0x1120, 0x2029, 0x0000, 0x2021,
-	0x0000, 0x8906, 0x8006, 0x8007, 0x90bc, 0x003f, 0x9084, 0xffc0,
-	0x9080, 0x001b, 0x21a8, 0x27e0, 0x2098, 0x27e8, 0x20a0, 0x0006,
-	0x080c, 0x0f68, 0x000e, 0x080c, 0x48c5, 0x007e, 0x701f, 0x399a,
-	0x7023, 0x0001, 0x0005, 0x0804, 0x3337, 0x0156, 0x00c6, 0xa814,
-	0x908a, 0x001e, 0x0218, 0xa833, 0x001e, 0x0010, 0xa832, 0x0078,
-	0x81ff, 0x0168, 0x0016, 0x080c, 0x4879, 0x001e, 0x0130, 0xa800,
-	0x2040, 0xa008, 0xa80a, 0x2100, 0x0c58, 0x9006, 0x0010, 0x9085,
-	0x0001, 0x00ce, 0x015e, 0x0005, 0x0006, 0x00f6, 0x2079, 0x0000,
-	0x7880, 0x9086, 0x0044, 0x00fe, 0x000e, 0x0005, 0x2001, 0x1970,
-	0x2003, 0x0001, 0x0005, 0x00f6, 0x00e6, 0x00c6, 0x2061, 0x0200,
-	0x2001, 0x197b, 0x2004, 0x601a, 0x2061, 0x0100, 0x2001, 0x197a,
-	0x2004, 0x60ce, 0x6104, 0xc1ac, 0x6106, 0x080c, 0x4879, 0xa813,
-	0x0019, 0xa817, 0x0001, 0x2900, 0xa85a, 0x2001, 0x002e, 0x2004,
-	0xa866, 0x2001, 0x002f, 0x2004, 0xa86a, 0x2061, 0x0090, 0x2079,
-	0x0100, 0x2001, 0x197a, 0x2004, 0x6036, 0x2009, 0x0040, 0x080c,
-	0x2268, 0x2001, 0x002a, 0x2004, 0x9084, 0xfff8, 0xa86e, 0x601a,
-	0xa873, 0x0000, 0x601f, 0x0000, 0x78ca, 0x9006, 0x600a, 0x600e,
-	0x00ce, 0x00ee, 0x00fe, 0x0005, 0x00e6, 0x080c, 0x4879, 0x2940,
-	0xa013, 0x0019, 0xa017, 0x0001, 0x2800, 0xa05a, 0x2001, 0x0030,
-	0x2004, 0xa866, 0x2001, 0x0031, 0x2004, 0xa86a, 0x2001, 0x002a,
-	0x2004, 0x9084, 0xfff8, 0xa86e, 0xa873, 0x0000, 0x2001, 0x032a,
-	0x2003, 0x0004, 0x2001, 0x0300, 0x2003, 0x0000, 0x2001, 0x020d,
-	0x2003, 0x0000, 0x2001, 0x0004, 0x200c, 0x918d, 0x0002, 0x2102,
-	0x00ee, 0x0005, 0x0126, 0x2091, 0x8000, 0x81ff, 0x0148, 0x080c,
-	0x2a55, 0x1130, 0x9006, 0x080c, 0x29ad, 0x9006, 0x080c, 0x2990,
-	0x7884, 0x9084, 0x0007, 0x0002, 0x3b17, 0x3b20, 0x3b29, 0x3b14,
-	0x3b14, 0x3b14, 0x3b14, 0x3b14, 0x012e, 0x0804, 0x336c, 0x2009,
-	0x0114, 0x2104, 0x9085, 0x0800, 0x200a, 0x080c, 0x3ce5, 0x00c0,
-	0x2009, 0x0114, 0x2104, 0x9085, 0x4000, 0x200a, 0x080c, 0x3ce5,
-	0x0078, 0x080c, 0x6fb2, 0x1128, 0x012e, 0x2009, 0x0016, 0x0804,
-	0x3369, 0x81ff, 0x0128, 0x012e, 0x2021, 0x400b, 0x0804, 0x3339,
-	0x0086, 0x0096, 0x00a6, 0x00b6, 0x00c6, 0x00d6, 0x00e6, 0x00f6,
-	0x080c, 0x3846, 0x2009, 0x0101, 0x210c, 0x0016, 0x7ec8, 0x7dcc,
-	0x9006, 0x2068, 0x2060, 0x2058, 0x080c, 0x3fae, 0x080c, 0x3efe,
-	0x903e, 0x2720, 0x00f6, 0x00e6, 0x0086, 0x2940, 0x2071, 0x1a36,
-	0x2079, 0x0090, 0x00d6, 0x2069, 0x0000, 0x6884, 0xd0b4, 0x0120,
-	0x68d4, 0x780e, 0x68d0, 0x780a, 0x00de, 0x2011, 0x0001, 0x080c,
-	0x3e5f, 0x080c, 0x2a5d, 0x080c, 0x2a5d, 0x080c, 0x2a5d, 0x080c,
-	0x2a5d, 0x080c, 0x3e5f, 0x008e, 0x00ee, 0x00fe, 0x080c, 0x3d8c,
-	0x2009, 0x9c40, 0x8109, 0x11b0, 0x080c, 0x3c9b, 0x2001, 0x0004,
-	0x200c, 0x918c, 0xfffd, 0x2102, 0x001e, 0x00fe, 0x00ee, 0x00de,
-	0x00ce, 0x00be, 0x00ae, 0x009e, 0x008e, 0x2009, 0x0017, 0x080c,
-	0x3369, 0x0cf8, 0x2001, 0x020b, 0x2004, 0x9084, 0x0140, 0x1d10,
-	0x00f6, 0x2079, 0x0000, 0x7884, 0x00fe, 0xd0bc, 0x0178, 0x2001,
-	0x0201, 0x200c, 0x81ff, 0x0150, 0x080c, 0x3d6a, 0x2d00, 0x9c05,
-	0x9b05, 0x0120, 0x080c, 0x3c9b, 0x0804, 0x3c48, 0x080c, 0x3ed3,
-	0x080c, 0x3df7, 0x080c, 0x3d4d, 0x080c, 0x3d82, 0x00f6, 0x2079,
-	0x0100, 0x7824, 0xd0ac, 0x0130, 0x8b58, 0x080c, 0x3c9b, 0x00fe,
-	0x0804, 0x3c48, 0x00fe, 0x080c, 0x3c91, 0x1150, 0x8d68, 0x2001,
-	0x0032, 0x2602, 0x2001, 0x0033, 0x2502, 0x080c, 0x3c9b, 0x0080,
-	0x87ff, 0x0138, 0x2001, 0x0201, 0x2004, 0x9005, 0x1908, 0x8739,
-	0x0038, 0x2001, 0x1a33, 0x2004, 0x9086, 0x0000, 0x1904, 0x3b98,
-	0x2001, 0x032f, 0x2003, 0x00f6, 0x8631, 0x1208, 0x8529, 0x2500,
-	0x9605, 0x0904, 0x3c48, 0x7884, 0xd0bc, 0x0128, 0x2d00, 0x9c05,
-	0x9b05, 0x1904, 0x3c48, 0xa013, 0x0019, 0x2001, 0x032a, 0x2003,
-	0x0004, 0x7884, 0xd0ac, 0x1148, 0x2001, 0x1a33, 0x2003, 0x0003,
-	0x2001, 0x032a, 0x2003, 0x0009, 0x0030, 0xa017, 0x0001, 0x78b4,
-	0x9005, 0x0108, 0xa016, 0x2800, 0xa05a, 0x2009, 0x0040, 0x080c,
-	0x2268, 0x2900, 0xa85a, 0xa813, 0x0019, 0x7884, 0xd0a4, 0x1180,
-	0xa817, 0x0000, 0x00c6, 0x20a9, 0x0004, 0x2061, 0x0090, 0x602b,
-	0x0008, 0x2001, 0x0203, 0x2004, 0x1f04, 0x3c1f, 0x00ce, 0x0030,
-	0xa817, 0x0001, 0x78b0, 0x9005, 0x0108, 0xa816, 0x00f6, 0x00c6,
-	0x2079, 0x0100, 0x2061, 0x0090, 0x7827, 0x0002, 0x2001, 0x002a,
-	0x2004, 0x9084, 0xfff8, 0x601a, 0x0006, 0x2001, 0x002b, 0x2004,
-	0x601e, 0x78c6, 0x000e, 0x78ca, 0x00ce, 0x00fe, 0x0804, 0x3b52,
-	0x001e, 0x00c6, 0x2001, 0x032a, 0x2003, 0x0004, 0x2061, 0x0100,
-	0x6027, 0x0002, 0x6106, 0x2011, 0x020d, 0x2013, 0x0020, 0x2001,
-	0x0004, 0x200c, 0x918c, 0xfffd, 0x2102, 0x080c, 0x129f, 0x7884,
-	0x9084, 0x0003, 0x9086, 0x0002, 0x01a0, 0x2009, 0x0028, 0x080c,
-	0x2268, 0x2001, 0x0227, 0x200c, 0x2102, 0x6050, 0x9084, 0xb7ef,
-	0x6052, 0x602f, 0x0000, 0x604b, 0xf7f7, 0x6043, 0x0090, 0x6043,
-	0x0010, 0x00ce, 0x2d08, 0x2c10, 0x2b18, 0x2b00, 0x9c05, 0x9d05,
-	0x00fe, 0x00ee, 0x00de, 0x00ce, 0x00be, 0x00ae, 0x009e, 0x008e,
-	0x1118, 0x012e, 0x0804, 0x3337, 0x012e, 0x2021, 0x400c, 0x0804,
-	0x3339, 0x9085, 0x0001, 0x1d04, 0x3c9a, 0x2091, 0x6000, 0x8420,
-	0x9486, 0x0064, 0x0005, 0x2001, 0x0105, 0x2003, 0x0010, 0x2001,
-	0x032a, 0x2003, 0x0004, 0x2001, 0x1a33, 0x2003, 0x0000, 0x0071,
-	0x2009, 0x0048, 0x080c, 0x2268, 0x2001, 0x0227, 0x2024, 0x2402,
-	0x2001, 0x0109, 0x2003, 0x4000, 0x9026, 0x0005, 0x00f6, 0x00e6,
-	0x2071, 0x1a36, 0x7000, 0x9086, 0x0000, 0x0520, 0x2079, 0x0090,
-	0x2009, 0x0206, 0x2104, 0x2009, 0x0203, 0x210c, 0x9106, 0x1120,
-	0x2009, 0x0040, 0x080c, 0x2268, 0x782c, 0xd0fc, 0x0d88, 0x080c,
-	0x3ed3, 0x7000, 0x9086, 0x0000, 0x1d58, 0x782b, 0x0004, 0x782c,
-	0xd0ac, 0x1de8, 0x2009, 0x0040, 0x080c, 0x2268, 0x782b, 0x0002,
-	0x7003, 0x0000, 0x00ee, 0x00fe, 0x0005, 0x00f6, 0x2079, 0x0100,
-	0x2001, 0x1817, 0x200c, 0x7932, 0x7936, 0x080c, 0x26ac, 0x7850,
-	0x9084, 0xfbff, 0x9085, 0x0030, 0x7852, 0x2019, 0x01f4, 0x8319,
-	0x1df0, 0x9084, 0xffcf, 0x9085, 0x2000, 0x7852, 0x20a9, 0x0046,
-	0x1d04, 0x3d00, 0x2091, 0x6000, 0x1f04, 0x3d00, 0x7850, 0x9085,
-	0x0400, 0x9084, 0xdfff, 0x7852, 0x2001, 0x0021, 0x2004, 0x9084,
-	0x0003, 0x9086, 0x0001, 0x1120, 0x7850, 0x9084, 0xdfff, 0x7852,
-	0x784b, 0xf7f7, 0x7843, 0x0090, 0x7843, 0x0010, 0x20a9, 0x0028,
-	0xa001, 0x1f04, 0x3d20, 0x7850, 0x9085, 0x1400, 0x7852, 0x2019,
-	0x61a8, 0x7854, 0xa001, 0xa001, 0xd08c, 0x1110, 0x8319, 0x1dc8,
-	0x7827, 0x0048, 0x7850, 0x9085, 0x0400, 0x7852, 0x7843, 0x0040,
-	0x2019, 0x01f4, 0xa001, 0xa001, 0x8319, 0x1de0, 0x2001, 0x0100,
-	0x080c, 0x2b14, 0x7827, 0x0020, 0x7843, 0x0000, 0x9006, 0x080c,
-	0x2b14, 0x7827, 0x0048, 0x00fe, 0x0005, 0x7884, 0xd0ac, 0x11c8,
-	0x00f6, 0x00e6, 0x2071, 0x1a33, 0x2079, 0x0320, 0x2001, 0x0201,
-	0x2004, 0x9005, 0x0160, 0x7000, 0x9086, 0x0000, 0x1140, 0x0051,
-	0xd0bc, 0x0108, 0x8738, 0x7003, 0x0003, 0x782b, 0x0019, 0x00ee,
-	0x00fe, 0x0005, 0x00f6, 0x2079, 0x0300, 0x78bc, 0x00fe, 0x908c,
-	0x0070, 0x0178, 0x2009, 0x0032, 0x260a, 0x2009, 0x0033, 0x250a,
-	0xd0b4, 0x0108, 0x8c60, 0xd0ac, 0x0108, 0x8d68, 0xd0a4, 0x0108,
-	0x8b58, 0x0005, 0x00f6, 0x2079, 0x0200, 0x781c, 0xd084, 0x0110,
-	0x7837, 0x0050, 0x00fe, 0x0005, 0x00e6, 0x2071, 0x0100, 0x2001,
-	0x197b, 0x2004, 0x70e2, 0x080c, 0x3a7c, 0x1188, 0x2001, 0x181f,
-	0x2004, 0x2009, 0x181e, 0x210c, 0x918c, 0x00ff, 0x706e, 0x716a,
-	0x7066, 0x918d, 0x3200, 0x7162, 0x7073, 0xe109, 0x0080, 0x702c,
-	0x9085, 0x0002, 0x702e, 0x2009, 0x1817, 0x210c, 0x716e, 0x7063,
-	0x0100, 0x7166, 0x719e, 0x706b, 0x0000, 0x7073, 0x0809, 0x7077,
-	0x0008, 0x7078, 0x9080, 0x0100, 0x707a, 0x7080, 0x8000, 0x7082,
-	0x7087, 0xaaaa, 0x9006, 0x708a, 0x708e, 0x707e, 0x70d6, 0x70ab,
-	0x0036, 0x70af, 0x95d5, 0x7014, 0x9084, 0x1984, 0x9085, 0x0092,
-	0x7016, 0x080c, 0x3ed3, 0x00f6, 0x2071, 0x1a33, 0x2079, 0x0320,
-	0x00d6, 0x2069, 0x0000, 0x6884, 0xd0b4, 0x0120, 0x689c, 0x780e,
-	0x6898, 0x780a, 0x00de, 0x2009, 0x03e8, 0x8109, 0x1df0, 0x792c,
-	0xd1fc, 0x0110, 0x782b, 0x0004, 0x2011, 0x0011, 0x080c, 0x3e5f,
-	0x2011, 0x0001, 0x080c, 0x3e5f, 0x00fe, 0x00ee, 0x0005, 0x00f6,
-	0x00e6, 0x2071, 0x1a33, 0x2079, 0x0320, 0x792c, 0xd1fc, 0x0904,
-	0x3e5c, 0x782b, 0x0002, 0x9026, 0xd19c, 0x1904, 0x3e58, 0x7000,
-	0x0002, 0x3e5c, 0x3e0d, 0x3e3d, 0x3e58, 0xd1bc, 0x1170, 0xd1dc,
-	0x1190, 0x8001, 0x7002, 0x2011, 0x0001, 0x080c, 0x3e5f, 0x0904,
-	0x3e5c, 0x080c, 0x3e5f, 0x0804, 0x3e5c, 0x00f6, 0x2079, 0x0300,
-	0x78bf, 0x0000, 0x00fe, 0x7810, 0x7914, 0x782b, 0x0004, 0x7812,
-	0x7916, 0x2001, 0x0201, 0x200c, 0x81ff, 0x0de8, 0x080c, 0x3d6a,
-	0x2009, 0x0001, 0x00f6, 0x2079, 0x0300, 0x78b8, 0x00fe, 0xd0ec,
-	0x0110, 0x2009, 0x0011, 0x792a, 0x00f8, 0x8001, 0x7002, 0x9184,
-	0x0880, 0x1140, 0x782c, 0xd0fc, 0x1904, 0x3e01, 0x2011, 0x0001,
-	0x00b1, 0x0090, 0xa010, 0x9092, 0x0004, 0x9086, 0x0015, 0x1120,
-	0xa000, 0xa05a, 0x2011, 0x0031, 0xa212, 0xd1dc, 0x1960, 0x0828,
-	0x782b, 0x0004, 0x7003, 0x0000, 0x00ee, 0x00fe, 0x0005, 0xa014,
-	0x9005, 0x0550, 0x8001, 0x0036, 0x0096, 0xa016, 0xa058, 0x2048,
-	0xa010, 0x2009, 0x0031, 0x911a, 0x831c, 0x831c, 0x938a, 0x0007,
-	0x1a0c, 0x0db4, 0x9398, 0x3e8d, 0x231d, 0x083f, 0x9080, 0x0004,
-	0x7a2a, 0x7100, 0x8108, 0x7102, 0x009e, 0x003e, 0x908a, 0x0035,
-	0x1140, 0x0096, 0xa058, 0x2048, 0xa804, 0xa05a, 0x2001, 0x0019,
-	0x009e, 0xa012, 0x9085, 0x0001, 0x0005, 0x3eca, 0x3ec1, 0x3eb8,
-	0x3eaf, 0x3ea6, 0x3e9d, 0x3e94, 0xa964, 0x7902, 0xa968, 0x7906,
-	0xa96c, 0x7912, 0xa970, 0x7916, 0x0005, 0xa974, 0x7902, 0xa978,
-	0x7906, 0xa97c, 0x7912, 0xa980, 0x7916, 0x0005, 0xa984, 0x7902,
-	0xa988, 0x7906, 0xa98c, 0x7912, 0xa990, 0x7916, 0x0005, 0xa994,
-	0x7902, 0xa998, 0x7906, 0xa99c, 0x7912, 0xa9a0, 0x7916, 0x0005,
-	0xa9a4, 0x7902, 0xa9a8, 0x7906, 0xa9ac, 0x7912, 0xa9b0, 0x7916,
-	0x0005, 0xa9b4, 0x7902, 0xa9b8, 0x7906, 0xa9bc, 0x7912, 0xa9c0,
-	0x7916, 0x0005, 0xa9c4, 0x7902, 0xa9c8, 0x7906, 0xa9cc, 0x7912,
-	0xa9d0, 0x7916, 0x0005, 0x00f6, 0x00e6, 0x0086, 0x2071, 0x1a36,
-	0x2079, 0x0090, 0x792c, 0xd1fc, 0x01e8, 0x782b, 0x0002, 0x2940,
-	0x9026, 0x7000, 0x0002, 0x3efa, 0x3ee6, 0x3ef1, 0x8001, 0x7002,
-	0xd19c, 0x1180, 0x2011, 0x0001, 0x080c, 0x3e5f, 0x190c, 0x3e5f,
-	0x0048, 0x8001, 0x7002, 0x782c, 0xd0fc, 0x1d38, 0x2011, 0x0001,
-	0x080c, 0x3e5f, 0x008e, 0x00ee, 0x00fe, 0x0005, 0x00f6, 0x00e6,
-	0x00c6, 0x0086, 0x2061, 0x0200, 0x2001, 0x197b, 0x2004, 0x601a,
-	0x2061, 0x0100, 0x2001, 0x197a, 0x2004, 0x60ce, 0x6104, 0xc1ac,
-	0x6106, 0x2001, 0x002c, 0x2004, 0x9005, 0x0520, 0x2038, 0x2001,
-	0x002e, 0x2024, 0x2001, 0x002f, 0x201c, 0x080c, 0x4879, 0xa813,
-	0x0019, 0xaf16, 0x2900, 0xa85a, 0x978a, 0x0007, 0x0220, 0x2138,
-	0x2009, 0x0007, 0x0010, 0x2708, 0x903e, 0x0096, 0xa858, 0x2048,
-	0xa85c, 0x9080, 0x0019, 0x009e, 0x080c, 0x3f76, 0x1d68, 0x2900,
-	0xa85a, 0x00d0, 0x080c, 0x4879, 0xa813, 0x0019, 0xa817, 0x0001,
+	0x8007, 0x90bc, 0x003f, 0x9084, 0xffc0, 0x9080, 0x001b, 0x21a8,
+	0x27e0, 0x2098, 0x27e8, 0x20a0, 0x0006, 0x080c, 0x0f68, 0x000e,
+	0x080c, 0x48d5, 0x007e, 0x701f, 0x39a7, 0x7023, 0x0001, 0x0005,
+	0x0804, 0x3339, 0x0156, 0x00c6, 0xa814, 0x908a, 0x001e, 0x0218,
+	0xa833, 0x001e, 0x0010, 0xa832, 0x0078, 0x81ff, 0x0168, 0x0016,
+	0x080c, 0x4889, 0x001e, 0x0130, 0xa800, 0x2040, 0xa008, 0xa80a,
+	0x2100, 0x0c58, 0x9006, 0x0010, 0x9085, 0x0001, 0x00ce, 0x015e,
+	0x0005, 0x0006, 0x00f6, 0x2079, 0x0000, 0x7880, 0x9086, 0x0044,
+	0x00fe, 0x000e, 0x0005, 0x2001, 0x196f, 0x2003, 0x0001, 0x0005,
+	0x00f6, 0x00e6, 0x00c6, 0x2061, 0x0200, 0x2001, 0x197a, 0x2004,
+	0x601a, 0x2061, 0x0100, 0x2001, 0x1979, 0x2004, 0x60ce, 0x6104,
+	0xc1ac, 0x6106, 0x080c, 0x4889, 0xa813, 0x0019, 0xa817, 0x0001,
 	0x2900, 0xa85a, 0x2001, 0x002e, 0x2004, 0xa866, 0x2001, 0x002f,
-	0x2004, 0xa86a, 0x2001, 0x002a, 0x2004, 0x9084, 0xfff8, 0xa86e,
-	0x2001, 0x002b, 0x2004, 0xa872, 0x2061, 0x0090, 0x2079, 0x0100,
-	0x2001, 0x197a, 0x2004, 0x6036, 0x2009, 0x0040, 0x080c, 0x2268,
-	0x2001, 0x002a, 0x2004, 0x9084, 0xfff8, 0x601a, 0x0006, 0x2001,
-	0x002b, 0x2004, 0x601e, 0x78c6, 0x000e, 0x78ca, 0x9006, 0x600a,
-	0x600e, 0x008e, 0x00ce, 0x00ee, 0x00fe, 0x0005, 0x00e6, 0x2071,
-	0x0080, 0xaa60, 0x22e8, 0x20a0, 0x20e1, 0x0000, 0x2099, 0x0088,
-	0x702b, 0x0026, 0x7402, 0x7306, 0x9006, 0x700a, 0x700e, 0x810b,
-	0x810b, 0x21a8, 0x810b, 0x7112, 0x702b, 0x0041, 0x702c, 0xd0fc,
-	0x0de8, 0x702b, 0x0002, 0x702b, 0x0040, 0x4005, 0x7400, 0x7304,
-	0x87ff, 0x0190, 0x0086, 0x0096, 0x2940, 0x0086, 0x080c, 0x4879,
-	0x008e, 0xa058, 0x00a6, 0x2050, 0x2900, 0xb006, 0xa05a, 0x00ae,
-	0x009e, 0x008e, 0x9085, 0x0001, 0x00ee, 0x0005, 0x00e6, 0x2001,
-	0x002d, 0x2004, 0x9005, 0x0528, 0x2038, 0x2001, 0x0030, 0x2024,
-	0x2001, 0x0031, 0x201c, 0x080c, 0x4879, 0x2940, 0xa813, 0x0019,
-	0xaf16, 0x2900, 0xa85a, 0x978a, 0x0007, 0x0220, 0x2138, 0x2009,
-	0x0007, 0x0010, 0x2708, 0x903e, 0x0096, 0xa858, 0x2048, 0xa85c,
-	0x9080, 0x0019, 0x009e, 0x080c, 0x3f76, 0x1d68, 0x2900, 0xa85a,
-	0x00d8, 0x080c, 0x4879, 0x2940, 0xa013, 0x0019, 0xa017, 0x0001,
-	0x2800, 0xa05a, 0x2001, 0x0030, 0x2004, 0xa066, 0x2001, 0x0031,
-	0x2004, 0xa06a, 0x2001, 0x002a, 0x2004, 0x9084, 0xfff8, 0xa06e,
-	0x2001, 0x002b, 0x2004, 0xa072, 0x2001, 0x032a, 0x2003, 0x0004,
-	0x7884, 0xd0ac, 0x1180, 0x2001, 0x0101, 0x200c, 0x918d, 0x0200,
-	0x2102, 0xa017, 0x0000, 0x2001, 0x1a33, 0x2003, 0x0003, 0x2001,
-	0x032a, 0x2003, 0x0009, 0x2001, 0x0300, 0x2003, 0x0000, 0x2001,
-	0x020d, 0x2003, 0x0000, 0x2001, 0x0004, 0x200c, 0x918d, 0x0002,
-	0x2102, 0x00ee, 0x0005, 0x0126, 0x2091, 0x8000, 0x20a9, 0x0013,
-	0x20a1, 0x1840, 0x20e9, 0x0001, 0x9006, 0x4004, 0x2009, 0x013c,
-	0x200a, 0x012e, 0x7880, 0x9086, 0x0052, 0x0108, 0x0005, 0x0804,
-	0x3337, 0x7d98, 0x7c9c, 0x0804, 0x342e, 0x080c, 0x6fb2, 0x190c,
-	0x5c96, 0x2069, 0x1853, 0x2d00, 0x2009, 0x0030, 0x7a8c, 0x7b88,
-	0x7c9c, 0x7d98, 0x2039, 0x0001, 0x080c, 0x48c2, 0x701f, 0x4049,
-	0x0005, 0x080c, 0x5395, 0x1130, 0x3b00, 0x3a08, 0xc194, 0xc095,
-	0x20d8, 0x21d0, 0x2069, 0x1853, 0x6800, 0x9005, 0x0904, 0x336c,
-	0x6804, 0xd094, 0x00c6, 0x2061, 0x0100, 0x6104, 0x0138, 0x6200,
-	0x9292, 0x0005, 0x0218, 0x918c, 0xffdf, 0x0010, 0x918d, 0x0020,
-	0x6106, 0x00ce, 0xd08c, 0x00c6, 0x2061, 0x0100, 0x6104, 0x0118,
-	0x918d, 0x0010, 0x0010, 0x918c, 0xffef, 0x6106, 0x00ce, 0xd084,
-	0x0158, 0x6a28, 0x928a, 0x007f, 0x1a04, 0x336c, 0x9288, 0x3138,
-	0x210d, 0x918c, 0x00ff, 0x6162, 0xd0dc, 0x0130, 0x6828, 0x908a,
-	0x007f, 0x1a04, 0x336c, 0x605a, 0x6888, 0x9084, 0x0030, 0x8004,
-	0x8004, 0x8004, 0x8004, 0x0006, 0x2009, 0x1982, 0x9080, 0x279f,
-	0x2005, 0x200a, 0x000e, 0x2009, 0x1983, 0x9080, 0x27a3, 0x2005,
-	0x200a, 0x6808, 0x908a, 0x0100, 0x0a04, 0x336c, 0x908a, 0x0841,
-	0x1a04, 0x336c, 0x9084, 0x0007, 0x1904, 0x336c, 0x680c, 0x9005,
-	0x0904, 0x336c, 0x6810, 0x9005, 0x0904, 0x336c, 0x6848, 0x6940,
-	0x910a, 0x1a04, 0x336c, 0x8001, 0x0904, 0x336c, 0x684c, 0x6944,
-	0x910a, 0x1a04, 0x336c, 0x8001, 0x0904, 0x336c, 0x2009, 0x1952,
-	0x200b, 0x0000, 0x2001, 0x1875, 0x2004, 0xd0c4, 0x0140, 0x7884,
-	0x200a, 0x2009, 0x017f, 0x200a, 0x3b00, 0xc085, 0x20d8, 0x6814,
-	0x908c, 0x00ff, 0x614a, 0x8007, 0x9084, 0x00ff, 0x604e, 0x080c,
-	0x72c7, 0x080c, 0x662f, 0x080c, 0x6664, 0x6808, 0x602a, 0x080c,
-	0x21da, 0x2009, 0x0170, 0x200b, 0x0080, 0xa001, 0xa001, 0x200b,
-	0x0000, 0x0036, 0x6b08, 0x080c, 0x2706, 0x003e, 0x6000, 0x9086,
-	0x0000, 0x1904, 0x41c6, 0x6818, 0x691c, 0x6a20, 0x6b24, 0x8007,
-	0x810f, 0x8217, 0x831f, 0x6016, 0x611a, 0x621e, 0x6322, 0x6c04,
-	0xd4f4, 0x0148, 0x6830, 0x6934, 0x6a38, 0x6b3c, 0x8007, 0x810f,
-	0x8217, 0x831f, 0x0010, 0x9084, 0xf0ff, 0x6006, 0x610a, 0x620e,
-	0x6312, 0x8007, 0x810f, 0x8217, 0x831f, 0x20a9, 0x0004, 0x20a1,
-	0x1984, 0x20e9, 0x0001, 0x4001, 0x20a9, 0x0004, 0x20a1, 0x199e,
-	0x20e9, 0x0001, 0x4001, 0x080c, 0x8141, 0x00c6, 0x900e, 0x20a9,
-	0x0001, 0x6b70, 0xd384, 0x0510, 0x0068, 0x2009, 0x0100, 0x210c,
-	0x918e, 0x0008, 0x1110, 0x839d, 0x0010, 0x83f5, 0x3e18, 0x12b0,
-	0x3508, 0x8109, 0x080c, 0x7892, 0x6878, 0x6016, 0x6874, 0x2008,
-	0x9084, 0xff00, 0x8007, 0x600a, 0x9184, 0x00ff, 0x6006, 0x8108,
-	0x1118, 0x6003, 0x0003, 0x0010, 0x6003, 0x0001, 0x1f04, 0x4135,
-	0x00ce, 0x00c6, 0x2061, 0x196d, 0x2063, 0x0001, 0x9006, 0x080c,
-	0x29ad, 0x9006, 0x080c, 0x2990, 0x0000, 0x00ce, 0x00e6, 0x2c70,
-	0x080c, 0x0e80, 0x00ee, 0x6888, 0xd0ec, 0x0130, 0x2011, 0x0114,
-	0x2204, 0x9085, 0x0100, 0x2012, 0x6a80, 0x9284, 0x0030, 0x9086,
-	0x0030, 0x1128, 0x9294, 0xffcf, 0x9295, 0x0020, 0x6a82, 0x2001,
-	0x194d, 0x6a80, 0x9294, 0x0030, 0x928e, 0x0000, 0x0170, 0x928e,
-	0x0010, 0x0118, 0x928e, 0x0020, 0x0140, 0x2003, 0xaaaa, 0x080c,
-	0x277b, 0x2001, 0x193e, 0x2102, 0x0008, 0x2102, 0x00c6, 0x2061,
-	0x0100, 0x602f, 0x0040, 0x602f, 0x0000, 0x00ce, 0x080c, 0x6fb2,
-	0x0128, 0x080c, 0x4c92, 0x0110, 0x080c, 0x26cc, 0x60d0, 0x9005,
-	0x01c0, 0x6003, 0x0001, 0x2009, 0x41ae, 0x00d0, 0x080c, 0x6fb2,
-	0x1168, 0x2011, 0x6e33, 0x080c, 0x8038, 0x2011, 0x6e26, 0x080c,
-	0x810c, 0x080c, 0x729b, 0x080c, 0x6ee4, 0x0040, 0x080c, 0x5b90,
-	0x0028, 0x6003, 0x0004, 0x2009, 0x41c6, 0x0010, 0x0804, 0x3337,
-	0x2001, 0x0170, 0x2004, 0x9084, 0x00ff, 0x9086, 0x004c, 0x1118,
-	0x2091, 0x30bd, 0x0817, 0x2091, 0x303d, 0x0817, 0x6000, 0x9086,
-	0x0000, 0x0904, 0x3369, 0x2069, 0x1853, 0x7890, 0x6842, 0x7894,
-	0x6846, 0x2d00, 0x2009, 0x0030, 0x7a8c, 0x7b88, 0x7c9c, 0x7d98,
-	0x2039, 0x0001, 0x0804, 0x48c5, 0x9006, 0x080c, 0x26cc, 0x81ff,
-	0x1904, 0x3369, 0x080c, 0x6fb2, 0x11b0, 0x080c, 0x7296, 0x080c,
-	0x5cd1, 0x080c, 0x3133, 0x0118, 0x6130, 0xc18d, 0x6132, 0x080c,
-	0xc212, 0x0130, 0x080c, 0x6fd5, 0x1118, 0x080c, 0x6f8a, 0x0038,
-	0x080c, 0x6ee4, 0x0020, 0x080c, 0x5c96, 0x080c, 0x5b90, 0x0804,
-	0x3337, 0x81ff, 0x1904, 0x3369, 0x080c, 0x6fb2, 0x1110, 0x0804,
-	0x3369, 0x6190, 0x81ff, 0x01a8, 0x704f, 0x0000, 0x2001, 0x1c80,
-	0x2009, 0x0040, 0x7a8c, 0x7b88, 0x7c9c, 0x7d98, 0x0126, 0x2091,
-	0x8000, 0x2039, 0x0001, 0x080c, 0x48c5, 0x701f, 0x3335, 0x012e,
-	0x0005, 0x704f, 0x0001, 0x00d6, 0x2069, 0x1c80, 0x20a9, 0x0040,
-	0x20e9, 0x0001, 0x20a1, 0x1c80, 0x2019, 0xffff, 0x4304, 0x6558,
-	0x9588, 0x3138, 0x210d, 0x918c, 0x00ff, 0x216a, 0x900e, 0x2011,
-	0x0002, 0x2100, 0x9506, 0x01a8, 0x080c, 0x623e, 0x1190, 0xb814,
-	0x821c, 0x0238, 0x9398, 0x1c80, 0x9085, 0xff00, 0x8007, 0x201a,
-	0x0038, 0x9398, 0x1c80, 0x2324, 0x94a4, 0xff00, 0x9405, 0x201a,
-	0x8210, 0x8108, 0x9182, 0x0080, 0x1208, 0x0c18, 0x8201, 0x8007,
-	0x2d0c, 0x9105, 0x206a, 0x00de, 0x20a9, 0x0040, 0x20a1, 0x1c80,
-	0x2099, 0x1c80, 0x080c, 0x5c21, 0x0804, 0x421e, 0x080c, 0x48ac,
-	0x0904, 0x336c, 0x080c, 0x4879, 0x1120, 0x2009, 0x0002, 0x0804,
-	0x3369, 0x080c, 0x5386, 0xd0b4, 0x0558, 0x7884, 0x908e, 0x007e,
-	0x0538, 0x908e, 0x007f, 0x0520, 0x908e, 0x0080, 0x0508, 0x080c,
-	0x312e, 0x1148, 0xb800, 0xd08c, 0x11d8, 0xb804, 0x9084, 0x00ff,
-	0x9086, 0x0006, 0x11a8, 0xa867, 0x0000, 0xa868, 0xc0fd, 0xa86a,
-	0x080c, 0xbce0, 0x1120, 0x2009, 0x0003, 0x0804, 0x3369, 0x7007,
-	0x0003, 0x701f, 0x42ac, 0x0005, 0x080c, 0x48ac, 0x0904, 0x336c,
-	0x20a9, 0x002b, 0xb8b4, 0x20e0, 0xb8b8, 0x2098, 0xa860, 0x20e8,
-	0xa85c, 0x9080, 0x0002, 0x20a0, 0x4003, 0x20a9, 0x0008, 0x9080,
-	0x0006, 0x20a0, 0xb8b4, 0x20e0, 0xb8b8, 0x9080, 0x0006, 0x2098,
-	0x080c, 0x0f68, 0x0070, 0x20a9, 0x0004, 0xa85c, 0x9080, 0x000a,
-	0x20a0, 0xb8b4, 0x20e0, 0xb8b8, 0x9080, 0x000a, 0x2098, 0x080c,
-	0x0f68, 0x8906, 0x8006, 0x8007, 0x90bc, 0x003f, 0x9084, 0xffc0,
-	0x9080, 0x0002, 0x2009, 0x002b, 0x7a8c, 0x7b88, 0x7c9c, 0x7d98,
-	0x0804, 0x48c5, 0x81ff, 0x1904, 0x3369, 0x080c, 0x4890, 0x0904,
-	0x336c, 0x080c, 0x63b0, 0x0904, 0x3369, 0x0058, 0xa878, 0x9005,
-	0x0120, 0x2009, 0x0004, 0x0804, 0x3369, 0xa974, 0xaa94, 0x0804,
-	0x3337, 0x080c, 0x538e, 0x0904, 0x3337, 0x701f, 0x42f6, 0x7007,
-	0x0003, 0x0005, 0x81ff, 0x1904, 0x3369, 0x7888, 0x908a, 0x1000,
-	0x1a04, 0x336c, 0x080c, 0x48ac, 0x0904, 0x336c, 0x080c, 0x6562,
-	0x0120, 0x080c, 0x656a, 0x1904, 0x336c, 0x080c, 0x6435, 0x0904,
-	0x3369, 0x2019, 0x0004, 0x900e, 0x080c, 0x63c2, 0x0904, 0x3369,
-	0x7984, 0x7a88, 0x04c9, 0x08a8, 0xa89c, 0x908a, 0x1000, 0x12f8,
-	0x080c, 0x48aa, 0x01e0, 0x080c, 0x6562, 0x0118, 0x080c, 0x656a,
-	0x11b0, 0x080c, 0x6435, 0x2009, 0x0002, 0x0168, 0x2009, 0x0002,
-	0x2019, 0x0004, 0x080c, 0x63c2, 0x2009, 0x0003, 0x0120, 0xa998,
-	0xaa9c, 0x00d1, 0x0060, 0xa897, 0x4005, 0xa99a, 0x0010, 0xa897,
-	0x4006, 0x900e, 0x9085, 0x0001, 0x2001, 0x0030, 0x0005, 0xa897,
-	0x4000, 0x080c, 0x538e, 0x0110, 0x9006, 0x0018, 0x900e, 0x9085,
-	0x0001, 0x2001, 0x0000, 0x0005, 0x9186, 0x00ff, 0x0110, 0x0071,
-	0x0060, 0x2029, 0x007e, 0x2061, 0x1800, 0x6458, 0x2400, 0x9506,
-	0x0110, 0x2508, 0x0019, 0x8529, 0x1ec8, 0x0005, 0x080c, 0x623e,
-	0x1138, 0x2200, 0x8003, 0x800b, 0x810b, 0x9108, 0x080c, 0x8046,
-	0x0005, 0x81ff, 0x1904, 0x3369, 0x798c, 0x2001, 0x1951, 0x918c,
-	0x8000, 0x2102, 0x080c, 0x4890, 0x0904, 0x336c, 0x080c, 0x6562,
-	0x0120, 0x080c, 0x656a, 0x1904, 0x336c, 0x080c, 0x6305, 0x0904,
-	0x3369, 0x080c, 0x63b9, 0x0904, 0x3369, 0x2001, 0x1951, 0x2004,
-	0xd0fc, 0x1904, 0x3337, 0x0804, 0x4301, 0xa9a0, 0x2001, 0x1951,
-	0x918c, 0x8000, 0xc18d, 0x2102, 0x080c, 0x489d, 0x01a0, 0x080c,
-	0x6562, 0x0118, 0x080c, 0x656a, 0x1170, 0x080c, 0x6305, 0x2009,
-	0x0002, 0x0128, 0x080c, 0x63b9, 0x1170, 0x2009, 0x0003, 0xa897,
-	0x4005, 0xa99a, 0x0010, 0xa897, 0x4006, 0x900e, 0x9085, 0x0001,
-	0x2001, 0x0030, 0x0005, 0xa897, 0x4000, 0x2001, 0x1951, 0x2004,
-	0xd0fc, 0x1128, 0x080c, 0x538e, 0x0110, 0x9006, 0x0018, 0x900e,
-	0x9085, 0x0001, 0x2001, 0x0000, 0x0005, 0x81ff, 0x1904, 0x3369,
-	0x798c, 0x2001, 0x1950, 0x918c, 0x8000, 0x2102, 0x080c, 0x4890,
-	0x0904, 0x336c, 0x080c, 0x6562, 0x0120, 0x080c, 0x656a, 0x1904,
-	0x336c, 0x080c, 0x6305, 0x0904, 0x3369, 0x080c, 0x63a7, 0x0904,
-	0x3369, 0x2001, 0x1950, 0x2004, 0xd0fc, 0x1904, 0x3337, 0x0804,
-	0x4301, 0xa9a0, 0x2001, 0x1950, 0x918c, 0x8000, 0xc18d, 0x2102,
-	0x080c, 0x489d, 0x01a0, 0x080c, 0x6562, 0x0118, 0x080c, 0x656a,
-	0x1170, 0x080c, 0x6305, 0x2009, 0x0002, 0x0128, 0x080c, 0x63a7,
-	0x1170, 0x2009, 0x0003, 0xa897, 0x4005, 0xa99a, 0x0010, 0xa897,
-	0x4006, 0x900e, 0x9085, 0x0001, 0x2001, 0x0030, 0x0005, 0xa897,
-	0x4000, 0x2001, 0x1950, 0x2004, 0xd0fc, 0x1128, 0x080c, 0x538e,
+	0x2004, 0xa86a, 0x2061, 0x0090, 0x2079, 0x0100, 0x2001, 0x1979,
+	0x2004, 0x6036, 0x2009, 0x0040, 0x080c, 0x226a, 0x2001, 0x002a,
+	0x2004, 0x9084, 0xfff8, 0xa86e, 0x601a, 0xa873, 0x0000, 0x601f,
+	0x0000, 0x78ca, 0x9006, 0x600a, 0x600e, 0x00ce, 0x00ee, 0x00fe,
+	0x0005, 0x00e6, 0x080c, 0x4889, 0x2940, 0xa013, 0x0019, 0xa017,
+	0x0001, 0x2800, 0xa05a, 0x2001, 0x0030, 0x2004, 0xa866, 0x2001,
+	0x0031, 0x2004, 0xa86a, 0x2001, 0x002a, 0x2004, 0x9084, 0xfff8,
+	0xa86e, 0xa873, 0x0000, 0x2001, 0x032a, 0x2003, 0x0004, 0x2001,
+	0x0300, 0x2003, 0x0000, 0x2001, 0x020d, 0x2003, 0x0000, 0x2001,
+	0x0004, 0x200c, 0x918d, 0x0002, 0x2102, 0x00ee, 0x0005, 0x0126,
+	0x2091, 0x8000, 0x81ff, 0x0148, 0x080c, 0x2a57, 0x1130, 0x9006,
+	0x080c, 0x29af, 0x9006, 0x080c, 0x2992, 0x7884, 0x9084, 0x0007,
+	0x0002, 0x3b24, 0x3b2d, 0x3b36, 0x3b21, 0x3b21, 0x3b21, 0x3b21,
+	0x3b21, 0x012e, 0x0804, 0x336e, 0x2009, 0x0114, 0x2104, 0x9085,
+	0x0800, 0x200a, 0x080c, 0x3cf2, 0x00c0, 0x2009, 0x0114, 0x2104,
+	0x9085, 0x4000, 0x200a, 0x080c, 0x3cf2, 0x0078, 0x080c, 0x6f9b,
+	0x1128, 0x012e, 0x2009, 0x0016, 0x0804, 0x336b, 0x81ff, 0x0128,
+	0x012e, 0x2021, 0x400b, 0x0804, 0x333b, 0x0086, 0x0096, 0x00a6,
+	0x00b6, 0x00c6, 0x00d6, 0x00e6, 0x00f6, 0x080c, 0x3853, 0x2009,
+	0x0101, 0x210c, 0x0016, 0x7ec8, 0x7dcc, 0x9006, 0x2068, 0x2060,
+	0x2058, 0x080c, 0x3fbb, 0x080c, 0x3f0b, 0x903e, 0x2720, 0x00f6,
+	0x00e6, 0x0086, 0x2940, 0x2071, 0x1a35, 0x2079, 0x0090, 0x00d6,
+	0x2069, 0x0000, 0x6884, 0xd0b4, 0x0120, 0x68d4, 0x780e, 0x68d0,
+	0x780a, 0x00de, 0x2011, 0x0001, 0x080c, 0x3e6c, 0x080c, 0x2a5f,
+	0x080c, 0x2a5f, 0x080c, 0x2a5f, 0x080c, 0x2a5f, 0x080c, 0x3e6c,
+	0x008e, 0x00ee, 0x00fe, 0x080c, 0x3d99, 0x2009, 0x9c40, 0x8109,
+	0x11b0, 0x080c, 0x3ca8, 0x2001, 0x0004, 0x200c, 0x918c, 0xfffd,
+	0x2102, 0x001e, 0x00fe, 0x00ee, 0x00de, 0x00ce, 0x00be, 0x00ae,
+	0x009e, 0x008e, 0x2009, 0x0017, 0x080c, 0x336b, 0x0cf8, 0x2001,
+	0x020b, 0x2004, 0x9084, 0x0140, 0x1d10, 0x00f6, 0x2079, 0x0000,
+	0x7884, 0x00fe, 0xd0bc, 0x0178, 0x2001, 0x0201, 0x200c, 0x81ff,
+	0x0150, 0x080c, 0x3d77, 0x2d00, 0x9c05, 0x9b05, 0x0120, 0x080c,
+	0x3ca8, 0x0804, 0x3c55, 0x080c, 0x3ee0, 0x080c, 0x3e04, 0x080c,
+	0x3d5a, 0x080c, 0x3d8f, 0x00f6, 0x2079, 0x0100, 0x7824, 0xd0ac,
+	0x0130, 0x8b58, 0x080c, 0x3ca8, 0x00fe, 0x0804, 0x3c55, 0x00fe,
+	0x080c, 0x3c9e, 0x1150, 0x8d68, 0x2001, 0x0032, 0x2602, 0x2001,
+	0x0033, 0x2502, 0x080c, 0x3ca8, 0x0080, 0x87ff, 0x0138, 0x2001,
+	0x0201, 0x2004, 0x9005, 0x1908, 0x8739, 0x0038, 0x2001, 0x1a32,
+	0x2004, 0x9086, 0x0000, 0x1904, 0x3ba5, 0x2001, 0x032f, 0x2003,
+	0x00f6, 0x8631, 0x1208, 0x8529, 0x2500, 0x9605, 0x0904, 0x3c55,
+	0x7884, 0xd0bc, 0x0128, 0x2d00, 0x9c05, 0x9b05, 0x1904, 0x3c55,
+	0xa013, 0x0019, 0x2001, 0x032a, 0x2003, 0x0004, 0x7884, 0xd0ac,
+	0x1148, 0x2001, 0x1a32, 0x2003, 0x0003, 0x2001, 0x032a, 0x2003,
+	0x0009, 0x0030, 0xa017, 0x0001, 0x78b4, 0x9005, 0x0108, 0xa016,
+	0x2800, 0xa05a, 0x2009, 0x0040, 0x080c, 0x226a, 0x2900, 0xa85a,
+	0xa813, 0x0019, 0x7884, 0xd0a4, 0x1180, 0xa817, 0x0000, 0x00c6,
+	0x20a9, 0x0004, 0x2061, 0x0090, 0x602b, 0x0008, 0x2001, 0x0203,
+	0x2004, 0x1f04, 0x3c2c, 0x00ce, 0x0030, 0xa817, 0x0001, 0x78b0,
+	0x9005, 0x0108, 0xa816, 0x00f6, 0x00c6, 0x2079, 0x0100, 0x2061,
+	0x0090, 0x7827, 0x0002, 0x2001, 0x002a, 0x2004, 0x9084, 0xfff8,
+	0x601a, 0x0006, 0x2001, 0x002b, 0x2004, 0x601e, 0x78c6, 0x000e,
+	0x78ca, 0x00ce, 0x00fe, 0x0804, 0x3b5f, 0x001e, 0x00c6, 0x2001,
+	0x032a, 0x2003, 0x0004, 0x2061, 0x0100, 0x6027, 0x0002, 0x6106,
+	0x2011, 0x020d, 0x2013, 0x0020, 0x2001, 0x0004, 0x200c, 0x918c,
+	0xfffd, 0x2102, 0x080c, 0x129f, 0x7884, 0x9084, 0x0003, 0x9086,
+	0x0002, 0x01a0, 0x2009, 0x0028, 0x080c, 0x226a, 0x2001, 0x0227,
+	0x200c, 0x2102, 0x6050, 0x9084, 0xb7ef, 0x6052, 0x602f, 0x0000,
+	0x604b, 0xf7f7, 0x6043, 0x0090, 0x6043, 0x0010, 0x00ce, 0x2d08,
+	0x2c10, 0x2b18, 0x2b00, 0x9c05, 0x9d05, 0x00fe, 0x00ee, 0x00de,
+	0x00ce, 0x00be, 0x00ae, 0x009e, 0x008e, 0x1118, 0x012e, 0x0804,
+	0x3339, 0x012e, 0x2021, 0x400c, 0x0804, 0x333b, 0x9085, 0x0001,
+	0x1d04, 0x3ca7, 0x2091, 0x6000, 0x8420, 0x9486, 0x0064, 0x0005,
+	0x2001, 0x0105, 0x2003, 0x0010, 0x2001, 0x032a, 0x2003, 0x0004,
+	0x2001, 0x1a32, 0x2003, 0x0000, 0x0071, 0x2009, 0x0048, 0x080c,
+	0x226a, 0x2001, 0x0227, 0x2024, 0x2402, 0x2001, 0x0109, 0x2003,
+	0x4000, 0x9026, 0x0005, 0x00f6, 0x00e6, 0x2071, 0x1a35, 0x7000,
+	0x9086, 0x0000, 0x0520, 0x2079, 0x0090, 0x2009, 0x0206, 0x2104,
+	0x2009, 0x0203, 0x210c, 0x9106, 0x1120, 0x2009, 0x0040, 0x080c,
+	0x226a, 0x782c, 0xd0fc, 0x0d88, 0x080c, 0x3ee0, 0x7000, 0x9086,
+	0x0000, 0x1d58, 0x782b, 0x0004, 0x782c, 0xd0ac, 0x1de8, 0x2009,
+	0x0040, 0x080c, 0x226a, 0x782b, 0x0002, 0x7003, 0x0000, 0x00ee,
+	0x00fe, 0x0005, 0x00f6, 0x2079, 0x0100, 0x2001, 0x1817, 0x200c,
+	0x7932, 0x7936, 0x080c, 0x26ae, 0x7850, 0x9084, 0xfbff, 0x9085,
+	0x0030, 0x7852, 0x2019, 0x01f4, 0x8319, 0x1df0, 0x9084, 0xffcf,
+	0x9085, 0x2000, 0x7852, 0x20a9, 0x0046, 0x1d04, 0x3d0d, 0x2091,
+	0x6000, 0x1f04, 0x3d0d, 0x7850, 0x9085, 0x0400, 0x9084, 0xdfff,
+	0x7852, 0x2001, 0x0021, 0x2004, 0x9084, 0x0003, 0x9086, 0x0001,
+	0x1120, 0x7850, 0x9084, 0xdfff, 0x7852, 0x784b, 0xf7f7, 0x7843,
+	0x0090, 0x7843, 0x0010, 0x20a9, 0x0028, 0xa001, 0x1f04, 0x3d2d,
+	0x7850, 0x9085, 0x1400, 0x7852, 0x2019, 0x61a8, 0x7854, 0xa001,
+	0xa001, 0xd08c, 0x1110, 0x8319, 0x1dc8, 0x7827, 0x0048, 0x7850,
+	0x9085, 0x0400, 0x7852, 0x7843, 0x0040, 0x2019, 0x01f4, 0xa001,
+	0xa001, 0x8319, 0x1de0, 0x2001, 0x0100, 0x080c, 0x2b16, 0x7827,
+	0x0020, 0x7843, 0x0000, 0x9006, 0x080c, 0x2b16, 0x7827, 0x0048,
+	0x00fe, 0x0005, 0x7884, 0xd0ac, 0x11c8, 0x00f6, 0x00e6, 0x2071,
+	0x1a32, 0x2079, 0x0320, 0x2001, 0x0201, 0x2004, 0x9005, 0x0160,
+	0x7000, 0x9086, 0x0000, 0x1140, 0x0051, 0xd0bc, 0x0108, 0x8738,
+	0x7003, 0x0003, 0x782b, 0x0019, 0x00ee, 0x00fe, 0x0005, 0x00f6,
+	0x2079, 0x0300, 0x78bc, 0x00fe, 0x908c, 0x0070, 0x0178, 0x2009,
+	0x0032, 0x260a, 0x2009, 0x0033, 0x250a, 0xd0b4, 0x0108, 0x8c60,
+	0xd0ac, 0x0108, 0x8d68, 0xd0a4, 0x0108, 0x8b58, 0x0005, 0x00f6,
+	0x2079, 0x0200, 0x781c, 0xd084, 0x0110, 0x7837, 0x0050, 0x00fe,
+	0x0005, 0x00e6, 0x2071, 0x0100, 0x2001, 0x197a, 0x2004, 0x70e2,
+	0x080c, 0x3a89, 0x1188, 0x2001, 0x181f, 0x2004, 0x2009, 0x181e,
+	0x210c, 0x918c, 0x00ff, 0x706e, 0x716a, 0x7066, 0x918d, 0x3200,
+	0x7162, 0x7073, 0xe109, 0x0080, 0x702c, 0x9085, 0x0002, 0x702e,
+	0x2009, 0x1817, 0x210c, 0x716e, 0x7063, 0x0100, 0x7166, 0x719e,
+	0x706b, 0x0000, 0x7073, 0x0809, 0x7077, 0x0008, 0x7078, 0x9080,
+	0x0100, 0x707a, 0x7080, 0x8000, 0x7082, 0x7087, 0xaaaa, 0x9006,
+	0x708a, 0x708e, 0x707e, 0x70d6, 0x70ab, 0x0036, 0x70af, 0x95d5,
+	0x7014, 0x9084, 0x1984, 0x9085, 0x0092, 0x7016, 0x080c, 0x3ee0,
+	0x00f6, 0x2071, 0x1a32, 0x2079, 0x0320, 0x00d6, 0x2069, 0x0000,
+	0x6884, 0xd0b4, 0x0120, 0x689c, 0x780e, 0x6898, 0x780a, 0x00de,
+	0x2009, 0x03e8, 0x8109, 0x1df0, 0x792c, 0xd1fc, 0x0110, 0x782b,
+	0x0004, 0x2011, 0x0011, 0x080c, 0x3e6c, 0x2011, 0x0001, 0x080c,
+	0x3e6c, 0x00fe, 0x00ee, 0x0005, 0x00f6, 0x00e6, 0x2071, 0x1a32,
+	0x2079, 0x0320, 0x792c, 0xd1fc, 0x0904, 0x3e69, 0x782b, 0x0002,
+	0x9026, 0xd19c, 0x1904, 0x3e65, 0x7000, 0x0002, 0x3e69, 0x3e1a,
+	0x3e4a, 0x3e65, 0xd1bc, 0x1170, 0xd1dc, 0x1190, 0x8001, 0x7002,
+	0x2011, 0x0001, 0x080c, 0x3e6c, 0x0904, 0x3e69, 0x080c, 0x3e6c,
+	0x0804, 0x3e69, 0x00f6, 0x2079, 0x0300, 0x78bf, 0x0000, 0x00fe,
+	0x7810, 0x7914, 0x782b, 0x0004, 0x7812, 0x7916, 0x2001, 0x0201,
+	0x200c, 0x81ff, 0x0de8, 0x080c, 0x3d77, 0x2009, 0x0001, 0x00f6,
+	0x2079, 0x0300, 0x78b8, 0x00fe, 0xd0ec, 0x0110, 0x2009, 0x0011,
+	0x792a, 0x00f8, 0x8001, 0x7002, 0x9184, 0x0880, 0x1140, 0x782c,
+	0xd0fc, 0x1904, 0x3e0e, 0x2011, 0x0001, 0x00b1, 0x0090, 0xa010,
+	0x9092, 0x0004, 0x9086, 0x0015, 0x1120, 0xa000, 0xa05a, 0x2011,
+	0x0031, 0xa212, 0xd1dc, 0x1960, 0x0828, 0x782b, 0x0004, 0x7003,
+	0x0000, 0x00ee, 0x00fe, 0x0005, 0xa014, 0x9005, 0x0550, 0x8001,
+	0x0036, 0x0096, 0xa016, 0xa058, 0x2048, 0xa010, 0x2009, 0x0031,
+	0x911a, 0x831c, 0x831c, 0x938a, 0x0007, 0x1a0c, 0x0db4, 0x9398,
+	0x3e9a, 0x231d, 0x083f, 0x9080, 0x0004, 0x7a2a, 0x7100, 0x8108,
+	0x7102, 0x009e, 0x003e, 0x908a, 0x0035, 0x1140, 0x0096, 0xa058,
+	0x2048, 0xa804, 0xa05a, 0x2001, 0x0019, 0x009e, 0xa012, 0x9085,
+	0x0001, 0x0005, 0x3ed7, 0x3ece, 0x3ec5, 0x3ebc, 0x3eb3, 0x3eaa,
+	0x3ea1, 0xa964, 0x7902, 0xa968, 0x7906, 0xa96c, 0x7912, 0xa970,
+	0x7916, 0x0005, 0xa974, 0x7902, 0xa978, 0x7906, 0xa97c, 0x7912,
+	0xa980, 0x7916, 0x0005, 0xa984, 0x7902, 0xa988, 0x7906, 0xa98c,
+	0x7912, 0xa990, 0x7916, 0x0005, 0xa994, 0x7902, 0xa998, 0x7906,
+	0xa99c, 0x7912, 0xa9a0, 0x7916, 0x0005, 0xa9a4, 0x7902, 0xa9a8,
+	0x7906, 0xa9ac, 0x7912, 0xa9b0, 0x7916, 0x0005, 0xa9b4, 0x7902,
+	0xa9b8, 0x7906, 0xa9bc, 0x7912, 0xa9c0, 0x7916, 0x0005, 0xa9c4,
+	0x7902, 0xa9c8, 0x7906, 0xa9cc, 0x7912, 0xa9d0, 0x7916, 0x0005,
+	0x00f6, 0x00e6, 0x0086, 0x2071, 0x1a35, 0x2079, 0x0090, 0x792c,
+	0xd1fc, 0x01e8, 0x782b, 0x0002, 0x2940, 0x9026, 0x7000, 0x0002,
+	0x3f07, 0x3ef3, 0x3efe, 0x8001, 0x7002, 0xd19c, 0x1180, 0x2011,
+	0x0001, 0x080c, 0x3e6c, 0x190c, 0x3e6c, 0x0048, 0x8001, 0x7002,
+	0x782c, 0xd0fc, 0x1d38, 0x2011, 0x0001, 0x080c, 0x3e6c, 0x008e,
+	0x00ee, 0x00fe, 0x0005, 0x00f6, 0x00e6, 0x00c6, 0x0086, 0x2061,
+	0x0200, 0x2001, 0x197a, 0x2004, 0x601a, 0x2061, 0x0100, 0x2001,
+	0x1979, 0x2004, 0x60ce, 0x6104, 0xc1ac, 0x6106, 0x2001, 0x002c,
+	0x2004, 0x9005, 0x0520, 0x2038, 0x2001, 0x002e, 0x2024, 0x2001,
+	0x002f, 0x201c, 0x080c, 0x4889, 0xa813, 0x0019, 0xaf16, 0x2900,
+	0xa85a, 0x978a, 0x0007, 0x0220, 0x2138, 0x2009, 0x0007, 0x0010,
+	0x2708, 0x903e, 0x0096, 0xa858, 0x2048, 0xa85c, 0x9080, 0x0019,
+	0x009e, 0x080c, 0x3f83, 0x1d68, 0x2900, 0xa85a, 0x00d0, 0x080c,
+	0x4889, 0xa813, 0x0019, 0xa817, 0x0001, 0x2900, 0xa85a, 0x2001,
+	0x002e, 0x2004, 0xa866, 0x2001, 0x002f, 0x2004, 0xa86a, 0x2001,
+	0x002a, 0x2004, 0x9084, 0xfff8, 0xa86e, 0x2001, 0x002b, 0x2004,
+	0xa872, 0x2061, 0x0090, 0x2079, 0x0100, 0x2001, 0x1979, 0x2004,
+	0x6036, 0x2009, 0x0040, 0x080c, 0x226a, 0x2001, 0x002a, 0x2004,
+	0x9084, 0xfff8, 0x601a, 0x0006, 0x2001, 0x002b, 0x2004, 0x601e,
+	0x78c6, 0x000e, 0x78ca, 0x9006, 0x600a, 0x600e, 0x008e, 0x00ce,
+	0x00ee, 0x00fe, 0x0005, 0x00e6, 0x2071, 0x0080, 0xaa60, 0x22e8,
+	0x20a0, 0x20e1, 0x0000, 0x2099, 0x0088, 0x702b, 0x0026, 0x7402,
+	0x7306, 0x9006, 0x700a, 0x700e, 0x810b, 0x810b, 0x21a8, 0x810b,
+	0x7112, 0x702b, 0x0041, 0x702c, 0xd0fc, 0x0de8, 0x702b, 0x0002,
+	0x702b, 0x0040, 0x4005, 0x7400, 0x7304, 0x87ff, 0x0190, 0x0086,
+	0x0096, 0x2940, 0x0086, 0x080c, 0x4889, 0x008e, 0xa058, 0x00a6,
+	0x2050, 0x2900, 0xb006, 0xa05a, 0x00ae, 0x009e, 0x008e, 0x9085,
+	0x0001, 0x00ee, 0x0005, 0x00e6, 0x2001, 0x002d, 0x2004, 0x9005,
+	0x0528, 0x2038, 0x2001, 0x0030, 0x2024, 0x2001, 0x0031, 0x201c,
+	0x080c, 0x4889, 0x2940, 0xa813, 0x0019, 0xaf16, 0x2900, 0xa85a,
+	0x978a, 0x0007, 0x0220, 0x2138, 0x2009, 0x0007, 0x0010, 0x2708,
+	0x903e, 0x0096, 0xa858, 0x2048, 0xa85c, 0x9080, 0x0019, 0x009e,
+	0x080c, 0x3f83, 0x1d68, 0x2900, 0xa85a, 0x00d8, 0x080c, 0x4889,
+	0x2940, 0xa013, 0x0019, 0xa017, 0x0001, 0x2800, 0xa05a, 0x2001,
+	0x0030, 0x2004, 0xa066, 0x2001, 0x0031, 0x2004, 0xa06a, 0x2001,
+	0x002a, 0x2004, 0x9084, 0xfff8, 0xa06e, 0x2001, 0x002b, 0x2004,
+	0xa072, 0x2001, 0x032a, 0x2003, 0x0004, 0x7884, 0xd0ac, 0x1180,
+	0x2001, 0x0101, 0x200c, 0x918d, 0x0200, 0x2102, 0xa017, 0x0000,
+	0x2001, 0x1a32, 0x2003, 0x0003, 0x2001, 0x032a, 0x2003, 0x0009,
+	0x2001, 0x0300, 0x2003, 0x0000, 0x2001, 0x020d, 0x2003, 0x0000,
+	0x2001, 0x0004, 0x200c, 0x918d, 0x0002, 0x2102, 0x00ee, 0x0005,
+	0x0126, 0x2091, 0x8000, 0x20a9, 0x0013, 0x20a1, 0x1840, 0x20e9,
+	0x0001, 0x9006, 0x4004, 0x2009, 0x013c, 0x200a, 0x012e, 0x7880,
+	0x9086, 0x0052, 0x0108, 0x0005, 0x0804, 0x3339, 0x7d98, 0x7c9c,
+	0x0804, 0x343b, 0x080c, 0x6f9b, 0x190c, 0x5c9f, 0x2069, 0x1853,
+	0x2d00, 0x2009, 0x0030, 0x7a8c, 0x7b88, 0x7c9c, 0x7d98, 0x2039,
+	0x0001, 0x080c, 0x48d2, 0x701f, 0x4056, 0x0005, 0x080c, 0x539e,
+	0x1130, 0x3b00, 0x3a08, 0xc194, 0xc095, 0x20d8, 0x21d0, 0x2069,
+	0x1853, 0x6800, 0x9005, 0x0904, 0x336e, 0x6804, 0xd094, 0x00c6,
+	0x2061, 0x0100, 0x6104, 0x0138, 0x6200, 0x9292, 0x0005, 0x0218,
+	0x918c, 0xffdf, 0x0010, 0x918d, 0x0020, 0x6106, 0x00ce, 0xd08c,
+	0x00c6, 0x2061, 0x0100, 0x6104, 0x0118, 0x918d, 0x0010, 0x0010,
+	0x918c, 0xffef, 0x6106, 0x00ce, 0xd084, 0x0158, 0x6a28, 0x928a,
+	0x007f, 0x1a04, 0x336e, 0x9288, 0x313a, 0x210d, 0x918c, 0x00ff,
+	0x6162, 0xd0dc, 0x0130, 0x6828, 0x908a, 0x007f, 0x1a04, 0x336e,
+	0x605a, 0x6888, 0x9084, 0x0030, 0x8004, 0x8004, 0x8004, 0x8004,
+	0x0006, 0x2009, 0x1981, 0x9080, 0x27a1, 0x2005, 0x200a, 0x000e,
+	0x2009, 0x1982, 0x9080, 0x27a5, 0x2005, 0x200a, 0x6808, 0x908a,
+	0x0100, 0x0a04, 0x336e, 0x908a, 0x0841, 0x1a04, 0x336e, 0x9084,
+	0x0007, 0x1904, 0x336e, 0x680c, 0x9005, 0x0904, 0x336e, 0x6810,
+	0x9005, 0x0904, 0x336e, 0x6848, 0x6940, 0x910a, 0x1a04, 0x336e,
+	0x8001, 0x0904, 0x336e, 0x684c, 0x6944, 0x910a, 0x1a04, 0x336e,
+	0x8001, 0x0904, 0x336e, 0x2009, 0x1951, 0x200b, 0x0000, 0x2001,
+	0x1875, 0x2004, 0xd0c4, 0x0140, 0x7884, 0x200a, 0x2009, 0x017f,
+	0x200a, 0x3b00, 0xc085, 0x20d8, 0x6814, 0x908c, 0x00ff, 0x614a,
+	0x8007, 0x9084, 0x00ff, 0x604e, 0x080c, 0x72b0, 0x080c, 0x6634,
+	0x080c, 0x6669, 0x6808, 0x602a, 0x080c, 0x21dc, 0x2009, 0x0170,
+	0x200b, 0x0080, 0xa001, 0xa001, 0x200b, 0x0000, 0x0036, 0x6b08,
+	0x080c, 0x2708, 0x003e, 0x6000, 0x9086, 0x0000, 0x1904, 0x41d3,
+	0x6818, 0x691c, 0x6a20, 0x6b24, 0x8007, 0x810f, 0x8217, 0x831f,
+	0x6016, 0x611a, 0x621e, 0x6322, 0x6c04, 0xd4f4, 0x0148, 0x6830,
+	0x6934, 0x6a38, 0x6b3c, 0x8007, 0x810f, 0x8217, 0x831f, 0x0010,
+	0x9084, 0xf0ff, 0x6006, 0x610a, 0x620e, 0x6312, 0x8007, 0x810f,
+	0x8217, 0x831f, 0x20a9, 0x0004, 0x20a1, 0x1983, 0x20e9, 0x0001,
+	0x4001, 0x20a9, 0x0004, 0x20a1, 0x199d, 0x20e9, 0x0001, 0x4001,
+	0x080c, 0x812a, 0x00c6, 0x900e, 0x20a9, 0x0001, 0x6b70, 0xd384,
+	0x0510, 0x0068, 0x2009, 0x0100, 0x210c, 0x918e, 0x0008, 0x1110,
+	0x839d, 0x0010, 0x83f5, 0x3e18, 0x12b0, 0x3508, 0x8109, 0x080c,
+	0x787b, 0x6878, 0x6016, 0x6874, 0x2008, 0x9084, 0xff00, 0x8007,
+	0x600a, 0x9184, 0x00ff, 0x6006, 0x8108, 0x1118, 0x6003, 0x0003,
+	0x0010, 0x6003, 0x0001, 0x1f04, 0x4142, 0x00ce, 0x00c6, 0x2061,
+	0x196c, 0x2063, 0x0001, 0x9006, 0x080c, 0x29af, 0x9006, 0x080c,
+	0x2992, 0x0000, 0x00ce, 0x00e6, 0x2c70, 0x080c, 0x0e80, 0x00ee,
+	0x6888, 0xd0ec, 0x0130, 0x2011, 0x0114, 0x2204, 0x9085, 0x0100,
+	0x2012, 0x6a80, 0x9284, 0x0030, 0x9086, 0x0030, 0x1128, 0x9294,
+	0xffcf, 0x9295, 0x0020, 0x6a82, 0x2001, 0x194c, 0x6a80, 0x9294,
+	0x0030, 0x928e, 0x0000, 0x0170, 0x928e, 0x0010, 0x0118, 0x928e,
+	0x0020, 0x0140, 0x2003, 0xaaaa, 0x080c, 0x277d, 0x2001, 0x193d,
+	0x2102, 0x0008, 0x2102, 0x00c6, 0x2061, 0x0100, 0x602f, 0x0040,
+	0x602f, 0x0000, 0x00ce, 0x080c, 0x6f9b, 0x0128, 0x080c, 0x4c9b,
+	0x0110, 0x080c, 0x26ce, 0x60d0, 0x9005, 0x01c0, 0x6003, 0x0001,
+	0x2009, 0x41bb, 0x00d0, 0x080c, 0x6f9b, 0x1168, 0x2011, 0x6e1c,
+	0x080c, 0x8021, 0x2011, 0x6e0f, 0x080c, 0x80f5, 0x080c, 0x7284,
+	0x080c, 0x6ecd, 0x0040, 0x080c, 0x5b99, 0x0028, 0x6003, 0x0004,
+	0x2009, 0x41d3, 0x0010, 0x0804, 0x3339, 0x2001, 0x0170, 0x2004,
+	0x9084, 0x00ff, 0x9086, 0x004c, 0x1118, 0x2091, 0x30bd, 0x0817,
+	0x2091, 0x303d, 0x0817, 0x6000, 0x9086, 0x0000, 0x0904, 0x336b,
+	0x2069, 0x1853, 0x7890, 0x6842, 0x7894, 0x6846, 0x2d00, 0x2009,
+	0x0030, 0x7a8c, 0x7b88, 0x7c9c, 0x7d98, 0x2039, 0x0001, 0x0804,
+	0x48d5, 0x9006, 0x080c, 0x26ce, 0x81ff, 0x1904, 0x336b, 0x080c,
+	0x6f9b, 0x11b0, 0x080c, 0x727f, 0x080c, 0x5cda, 0x080c, 0x3135,
+	0x0118, 0x6130, 0xc18d, 0x6132, 0x080c, 0xc22c, 0x0130, 0x080c,
+	0x6fbe, 0x1118, 0x080c, 0x6f73, 0x0038, 0x080c, 0x6ecd, 0x0020,
+	0x080c, 0x5c9f, 0x080c, 0x5b99, 0x0804, 0x3339, 0x81ff, 0x1904,
+	0x336b, 0x080c, 0x6f9b, 0x1110, 0x0804, 0x336b, 0x6190, 0x81ff,
+	0x01a8, 0x704f, 0x0000, 0x2001, 0x1c80, 0x2009, 0x0040, 0x7a8c,
+	0x7b88, 0x7c9c, 0x7d98, 0x0126, 0x2091, 0x8000, 0x2039, 0x0001,
+	0x080c, 0x48d5, 0x701f, 0x3337, 0x012e, 0x0005, 0x704f, 0x0001,
+	0x00d6, 0x2069, 0x1c80, 0x20a9, 0x0040, 0x20e9, 0x0001, 0x20a1,
+	0x1c80, 0x2019, 0xffff, 0x4304, 0x6558, 0x9588, 0x313a, 0x210d,
+	0x918c, 0x00ff, 0x216a, 0x900e, 0x2011, 0x0002, 0x2100, 0x9506,
+	0x01a8, 0x080c, 0x6247, 0x1190, 0xb814, 0x821c, 0x0238, 0x9398,
+	0x1c80, 0x9085, 0xff00, 0x8007, 0x201a, 0x0038, 0x9398, 0x1c80,
+	0x2324, 0x94a4, 0xff00, 0x9405, 0x201a, 0x8210, 0x8108, 0x9182,
+	0x0080, 0x1208, 0x0c18, 0x8201, 0x8007, 0x2d0c, 0x9105, 0x206a,
+	0x00de, 0x20a9, 0x0040, 0x20a1, 0x1c80, 0x2099, 0x1c80, 0x080c,
+	0x5c2a, 0x0804, 0x422b, 0x080c, 0x48bc, 0x0904, 0x336e, 0x080c,
+	0x4889, 0x1120, 0x2009, 0x0002, 0x0804, 0x336b, 0x080c, 0x538f,
+	0xd0b4, 0x0558, 0x7884, 0x908e, 0x007e, 0x0538, 0x908e, 0x007f,
+	0x0520, 0x908e, 0x0080, 0x0508, 0x080c, 0x3130, 0x1148, 0xb800,
+	0xd08c, 0x11d8, 0xb804, 0x9084, 0x00ff, 0x9086, 0x0006, 0x11a8,
+	0xa867, 0x0000, 0xa868, 0xc0fd, 0xa86a, 0x080c, 0xbcf5, 0x1120,
+	0x2009, 0x0003, 0x0804, 0x336b, 0x7007, 0x0003, 0x701f, 0x42b9,
+	0x0005, 0x080c, 0x48bc, 0x0904, 0x336e, 0x20a9, 0x002b, 0xb8b4,
+	0x20e0, 0xb8b8, 0x2098, 0xa860, 0x20e8, 0xa85c, 0x9080, 0x0002,
+	0x20a0, 0x4003, 0x20a9, 0x0008, 0x9080, 0x0006, 0x20a0, 0xb8b4,
+	0x20e0, 0xb8b8, 0x9080, 0x0006, 0x2098, 0x080c, 0x0f68, 0x0070,
+	0x20a9, 0x0004, 0xa85c, 0x9080, 0x000a, 0x20a0, 0xb8b4, 0x20e0,
+	0xb8b8, 0x9080, 0x000a, 0x2098, 0x080c, 0x0f68, 0x8906, 0x8006,
+	0x8007, 0x90bc, 0x003f, 0x9084, 0xffc0, 0x9080, 0x0002, 0x2009,
+	0x002b, 0x7a8c, 0x7b88, 0x7c9c, 0x7d98, 0x0804, 0x48d5, 0x81ff,
+	0x1904, 0x336b, 0x080c, 0x48a0, 0x0904, 0x336e, 0x080c, 0x63b9,
+	0x0904, 0x336b, 0x0058, 0xa878, 0x9005, 0x0120, 0x2009, 0x0004,
+	0x0804, 0x336b, 0xa974, 0xaa94, 0x0804, 0x3339, 0x080c, 0x5397,
+	0x0904, 0x3339, 0x701f, 0x4303, 0x7007, 0x0003, 0x0005, 0x81ff,
+	0x1904, 0x336b, 0x7888, 0x908a, 0x1000, 0x1a04, 0x336e, 0x080c,
+	0x48bc, 0x0904, 0x336e, 0x080c, 0x656b, 0x0120, 0x080c, 0x6573,
+	0x1904, 0x336e, 0x080c, 0x643e, 0x0904, 0x336b, 0x2019, 0x0004,
+	0x900e, 0x080c, 0x63cb, 0x0904, 0x336b, 0x7984, 0x7a88, 0x04c9,
+	0x08a8, 0xa89c, 0x908a, 0x1000, 0x12f8, 0x080c, 0x48ba, 0x01e0,
+	0x080c, 0x656b, 0x0118, 0x080c, 0x6573, 0x11b0, 0x080c, 0x643e,
+	0x2009, 0x0002, 0x0168, 0x2009, 0x0002, 0x2019, 0x0004, 0x080c,
+	0x63cb, 0x2009, 0x0003, 0x0120, 0xa998, 0xaa9c, 0x00d1, 0x0060,
+	0xa897, 0x4005, 0xa99a, 0x0010, 0xa897, 0x4006, 0x900e, 0x9085,
+	0x0001, 0x2001, 0x0030, 0x0005, 0xa897, 0x4000, 0x080c, 0x5397,
 	0x0110, 0x9006, 0x0018, 0x900e, 0x9085, 0x0001, 0x2001, 0x0000,
-	0x0005, 0x6100, 0x0804, 0x3337, 0x080c, 0x48ac, 0x0904, 0x336c,
-	0x080c, 0x539a, 0x1904, 0x3369, 0x79a8, 0xd184, 0x1158, 0xb834,
-	0x8007, 0x789e, 0xb830, 0x8007, 0x789a, 0xbb2c, 0x831f, 0xba28,
-	0x8217, 0x0050, 0xb824, 0x8007, 0x789e, 0xb820, 0x8007, 0x789a,
-	0xbb1c, 0x831f, 0xba18, 0x8217, 0xb900, 0x918c, 0x0200, 0x0804,
-	0x3337, 0x78a8, 0x909c, 0x0003, 0xd0b4, 0x1148, 0x939a, 0x0003,
-	0x1a04, 0x3369, 0x6258, 0x7884, 0x9206, 0x1904, 0x44b1, 0x2031,
-	0x1848, 0x2009, 0x013c, 0x2136, 0x2001, 0x1840, 0x2009, 0x000c,
-	0x7a8c, 0x7b88, 0x7c9c, 0x7d98, 0x2039, 0x0001, 0x0006, 0x78a8,
-	0x9084, 0x0080, 0x11c8, 0x0006, 0x0036, 0x2001, 0x1a4f, 0x201c,
-	0x7b9a, 0x2003, 0x0000, 0x2001, 0x1a50, 0x201c, 0x7b9e, 0x2003,
-	0x0000, 0x2001, 0x1a51, 0x201c, 0x7ba2, 0x2003, 0x0000, 0x003e,
-	0x000e, 0x000e, 0x0804, 0x48c5, 0x000e, 0x2031, 0x0000, 0x2061,
-	0x18ae, 0x2c44, 0xa66a, 0xa17a, 0xa772, 0xa076, 0xa28e, 0xa392,
-	0xa496, 0xa59a, 0x080c, 0x10d5, 0x7007, 0x0002, 0x701f, 0x44d1,
-	0x0005, 0x81ff, 0x1904, 0x3369, 0x080c, 0x48ac, 0x0904, 0x336c,
-	0x080c, 0x6562, 0x1904, 0x3369, 0x00c6, 0x080c, 0x4879, 0x00ce,
-	0x0904, 0x3369, 0xa867, 0x0000, 0xa868, 0xc0fd, 0xa86a, 0x7ea8,
-	0x080c, 0xbc86, 0x0904, 0x3369, 0x7007, 0x0003, 0x701f, 0x44eb,
-	0x0005, 0x080c, 0x401b, 0x0006, 0x0036, 0x2001, 0x1a4f, 0x201c,
-	0x7b9a, 0x2003, 0x0000, 0x2001, 0x1a50, 0x201c, 0x7b9e, 0x2003,
-	0x0000, 0x2001, 0x1a51, 0x201c, 0x7ba2, 0x2003, 0x0000, 0x003e,
-	0x000e, 0x0804, 0x3337, 0xa830, 0x9086, 0x0100, 0x0904, 0x3369,
-	0x8906, 0x8006, 0x8007, 0x90bc, 0x003f, 0x9084, 0xffc0, 0x9080,
-	0x001b, 0x2009, 0x000c, 0x7a8c, 0x7b88, 0x7c9c, 0x7d98, 0x0804,
-	0x48c5, 0x9006, 0x080c, 0x26cc, 0x78a8, 0x9084, 0x00ff, 0x9086,
-	0x00ff, 0x0118, 0x81ff, 0x1904, 0x3369, 0x080c, 0x6fb2, 0x0110,
-	0x080c, 0x5c96, 0x7888, 0x908a, 0x1000, 0x1a04, 0x336c, 0x7984,
-	0x9186, 0x00ff, 0x0138, 0x9182, 0x007f, 0x1a04, 0x336c, 0x2100,
-	0x080c, 0x2696, 0x0026, 0x00c6, 0x0126, 0x2091, 0x8000, 0x2061,
-	0x19cb, 0x601b, 0x0000, 0x601f, 0x0000, 0x6073, 0x0000, 0x6077,
-	0x0000, 0x080c, 0x6fb2, 0x1158, 0x080c, 0x7296, 0x080c, 0x5cd1,
-	0x9085, 0x0001, 0x080c, 0x6ff9, 0x080c, 0x6ee4, 0x00d0, 0x080c,
-	0x9db8, 0x2061, 0x0100, 0x2001, 0x1817, 0x2004, 0x9084, 0x00ff,
-	0x810f, 0x9105, 0x604a, 0x6043, 0x0090, 0x6043, 0x0010, 0x2009,
-	0x196a, 0x200b, 0x0000, 0x2009, 0x002d, 0x2011, 0x5bbc, 0x080c,
-	0x80ca, 0x7984, 0x080c, 0x6fb2, 0x1110, 0x2009, 0x00ff, 0x7a88,
-	0x080c, 0x4364, 0x012e, 0x00ce, 0x002e, 0x0804, 0x3337, 0x7984,
-	0x080c, 0x61de, 0x2b08, 0x1904, 0x336c, 0x0804, 0x3337, 0x81ff,
-	0x0120, 0x2009, 0x0001, 0x0804, 0x3369, 0x60d8, 0xd0ac, 0x1130,
-	0xd09c, 0x1120, 0x2009, 0x0005, 0x0804, 0x3369, 0x080c, 0x4879,
-	0x1120, 0x2009, 0x0002, 0x0804, 0x3369, 0x7984, 0x9192, 0x0021,
-	0x1a04, 0x336c, 0x7a8c, 0x7b88, 0x7c9c, 0x7d98, 0xa85c, 0x9080,
-	0x0019, 0x702a, 0xaf60, 0x7736, 0x080c, 0x48c2, 0x701f, 0x459f,
-	0x7880, 0x9086, 0x006e, 0x0110, 0x701f, 0x4e44, 0x0005, 0x2009,
-	0x0080, 0x080c, 0x623e, 0x1118, 0x080c, 0x6562, 0x0120, 0x2021,
-	0x400a, 0x0804, 0x3339, 0x00d6, 0x0096, 0xa964, 0xaa6c, 0xab70,
-	0xac74, 0xad78, 0xae7c, 0xa884, 0x90be, 0x0100, 0x0904, 0x4638,
-	0x90be, 0x0112, 0x0904, 0x4638, 0x90be, 0x0113, 0x0904, 0x4638,
-	0x90be, 0x0114, 0x0904, 0x4638, 0x90be, 0x0117, 0x0904, 0x4638,
-	0x90be, 0x011a, 0x0904, 0x4638, 0x90be, 0x011c, 0x0904, 0x4638,
-	0x90be, 0x0121, 0x0904, 0x461f, 0x90be, 0x0131, 0x0904, 0x461f,
-	0x90be, 0x0171, 0x0904, 0x4638, 0x90be, 0x0173, 0x0904, 0x4638,
-	0x90be, 0x01a1, 0x1128, 0xa894, 0x8007, 0xa896, 0x0804, 0x4643,
-	0x90be, 0x0212, 0x0904, 0x462c, 0x90be, 0x0213, 0x05e8, 0x90be,
-	0x0214, 0x0500, 0x90be, 0x0217, 0x0188, 0x90be, 0x021a, 0x1120,
-	0xa89c, 0x8007, 0xa89e, 0x04e0, 0x90be, 0x021f, 0x05c8, 0x90be,
-	0x0300, 0x05b0, 0x009e, 0x00de, 0x0804, 0x336c, 0x7028, 0x9080,
-	0x0010, 0x2098, 0x20a0, 0x7034, 0x20e0, 0x20e8, 0x20a9, 0x0007,
-	0x080c, 0x4681, 0x7028, 0x9080, 0x000e, 0x2098, 0x20a0, 0x7034,
-	0x20e0, 0x20e8, 0x20a9, 0x0001, 0x080c, 0x4681, 0x00c8, 0x7028,
-	0x9080, 0x000c, 0x2098, 0x20a0, 0x7034, 0x20e0, 0x20e8, 0x20a9,
-	0x0001, 0x080c, 0x468e, 0x00b8, 0x7028, 0x9080, 0x000e, 0x2098,
-	0x20a0, 0x7034, 0x20e0, 0x20e8, 0x20a9, 0x0001, 0x080c, 0x468e,
-	0x7028, 0x9080, 0x000c, 0x2098, 0x20a0, 0x7034, 0x20e0, 0x20e8,
-	0x20a9, 0x0001, 0x04f1, 0x00c6, 0x080c, 0x4879, 0x0550, 0xa868,
-	0xc0fd, 0xa86a, 0xa867, 0x0119, 0x9006, 0xa882, 0xa87f, 0x0020,
-	0xa88b, 0x0001, 0x810b, 0xa9ae, 0xa8b2, 0xaab6, 0xabba, 0xacbe,
-	0xadc2, 0xa9c6, 0xa8ca, 0x00ce, 0x009e, 0x00de, 0xa866, 0xa822,
-	0xa868, 0xc0fd, 0xa86a, 0xa804, 0x2048, 0x080c, 0xbca1, 0x1120,
-	0x2009, 0x0003, 0x0804, 0x3369, 0x7007, 0x0003, 0x701f, 0x4678,
-	0x0005, 0x00ce, 0x009e, 0x00de, 0x2009, 0x0002, 0x0804, 0x3369,
-	0xa820, 0x9086, 0x8001, 0x1904, 0x3337, 0x2009, 0x0004, 0x0804,
-	0x3369, 0x0016, 0x0026, 0x3510, 0x20a9, 0x0002, 0x4002, 0x4104,
-	0x4004, 0x8211, 0x1dc8, 0x002e, 0x001e, 0x0005, 0x0016, 0x0026,
-	0x0036, 0x0046, 0x3520, 0x20a9, 0x0004, 0x4002, 0x4304, 0x4204,
-	0x4104, 0x4004, 0x8421, 0x1db8, 0x004e, 0x003e, 0x002e, 0x001e,
-	0x0005, 0x81ff, 0x0120, 0x2009, 0x0001, 0x0804, 0x3369, 0x60d8,
-	0xd0ac, 0x1160, 0xd09c, 0x0120, 0x2009, 0x0016, 0x0804, 0x3369,
-	0xd09c, 0x1120, 0x2009, 0x0005, 0x0804, 0x3369, 0x7984, 0x78a8,
-	0x2040, 0x080c, 0x9db1, 0x1120, 0x9182, 0x007f, 0x0a04, 0x336c,
-	0x9186, 0x00ff, 0x0904, 0x336c, 0x9182, 0x0800, 0x1a04, 0x336c,
-	0x7a8c, 0x7b88, 0x6078, 0x9306, 0x1140, 0x607c, 0x924e, 0x0904,
-	0x336c, 0x99cc, 0xff00, 0x0904, 0x336c, 0x0126, 0x2091, 0x8000,
-	0x0026, 0x2011, 0x8008, 0x080c, 0x6586, 0x002e, 0x0140, 0x918d,
-	0x8000, 0x080c, 0x65d0, 0x1118, 0x2001, 0x4009, 0x0458, 0x080c,
-	0x4793, 0x0560, 0x90c6, 0x4000, 0x1170, 0x00c6, 0x0006, 0x900e,
-	0x080c, 0x645e, 0x1108, 0xc185, 0xb800, 0xd0bc, 0x0108, 0xc18d,
+	0x0005, 0x9186, 0x00ff, 0x0110, 0x0071, 0x0060, 0x2029, 0x007e,
+	0x2061, 0x1800, 0x6458, 0x2400, 0x9506, 0x0110, 0x2508, 0x0019,
+	0x8529, 0x1ec8, 0x0005, 0x080c, 0x6247, 0x1138, 0x2200, 0x8003,
+	0x800b, 0x810b, 0x9108, 0x080c, 0x802f, 0x0005, 0x81ff, 0x1904,
+	0x336b, 0x798c, 0x2001, 0x1950, 0x918c, 0x8000, 0x2102, 0x080c,
+	0x48a0, 0x0904, 0x336e, 0x080c, 0x656b, 0x0120, 0x080c, 0x6573,
+	0x1904, 0x336e, 0x080c, 0x630e, 0x0904, 0x336b, 0x080c, 0x63c2,
+	0x0904, 0x336b, 0x2001, 0x1950, 0x2004, 0xd0fc, 0x1904, 0x3339,
+	0x0804, 0x430e, 0xa9a0, 0x2001, 0x1950, 0x918c, 0x8000, 0xc18d,
+	0x2102, 0x080c, 0x48ad, 0x01a0, 0x080c, 0x656b, 0x0118, 0x080c,
+	0x6573, 0x1170, 0x080c, 0x630e, 0x2009, 0x0002, 0x0128, 0x080c,
+	0x63c2, 0x1170, 0x2009, 0x0003, 0xa897, 0x4005, 0xa99a, 0x0010,
+	0xa897, 0x4006, 0x900e, 0x9085, 0x0001, 0x2001, 0x0030, 0x0005,
+	0xa897, 0x4000, 0x2001, 0x1950, 0x2004, 0xd0fc, 0x1128, 0x080c,
+	0x5397, 0x0110, 0x9006, 0x0018, 0x900e, 0x9085, 0x0001, 0x2001,
+	0x0000, 0x0005, 0x81ff, 0x1904, 0x336b, 0x798c, 0x2001, 0x194f,
+	0x918c, 0x8000, 0x2102, 0x080c, 0x48a0, 0x0904, 0x336e, 0x080c,
+	0x656b, 0x0120, 0x080c, 0x6573, 0x1904, 0x336e, 0x080c, 0x630e,
+	0x0904, 0x336b, 0x080c, 0x63b0, 0x0904, 0x336b, 0x2001, 0x194f,
+	0x2004, 0xd0fc, 0x1904, 0x3339, 0x0804, 0x430e, 0xa9a0, 0x2001,
+	0x194f, 0x918c, 0x8000, 0xc18d, 0x2102, 0x080c, 0x48ad, 0x01a0,
+	0x080c, 0x656b, 0x0118, 0x080c, 0x6573, 0x1170, 0x080c, 0x630e,
+	0x2009, 0x0002, 0x0128, 0x080c, 0x63b0, 0x1170, 0x2009, 0x0003,
+	0xa897, 0x4005, 0xa99a, 0x0010, 0xa897, 0x4006, 0x900e, 0x9085,
+	0x0001, 0x2001, 0x0030, 0x0005, 0xa897, 0x4000, 0x2001, 0x194f,
+	0x2004, 0xd0fc, 0x1128, 0x080c, 0x5397, 0x0110, 0x9006, 0x0018,
+	0x900e, 0x9085, 0x0001, 0x2001, 0x0000, 0x0005, 0x6100, 0x0804,
+	0x3339, 0x080c, 0x48bc, 0x0904, 0x336e, 0x080c, 0x53a3, 0x1904,
+	0x336b, 0x79a8, 0xd184, 0x1158, 0xb834, 0x8007, 0x789e, 0xb830,
+	0x8007, 0x789a, 0xbb2c, 0x831f, 0xba28, 0x8217, 0x0050, 0xb824,
+	0x8007, 0x789e, 0xb820, 0x8007, 0x789a, 0xbb1c, 0x831f, 0xba18,
+	0x8217, 0xb900, 0x918c, 0x0200, 0x0804, 0x3339, 0x78a8, 0x909c,
+	0x0003, 0xd0b4, 0x1148, 0x939a, 0x0003, 0x1a04, 0x336b, 0x6258,
+	0x7884, 0x9206, 0x1904, 0x44be, 0x2031, 0x1848, 0x2009, 0x013c,
+	0x2136, 0x2001, 0x1840, 0x2009, 0x000c, 0x7a8c, 0x7b88, 0x7c9c,
+	0x7d98, 0x2039, 0x0001, 0x0006, 0x78a8, 0x9084, 0x0080, 0x11c8,
+	0x0006, 0x0036, 0x2001, 0x1a4e, 0x201c, 0x7b9a, 0x2003, 0x0000,
+	0x2001, 0x1a4f, 0x201c, 0x7b9e, 0x2003, 0x0000, 0x2001, 0x1a50,
+	0x201c, 0x7ba2, 0x2003, 0x0000, 0x003e, 0x000e, 0x000e, 0x0804,
+	0x48d5, 0x000e, 0x2031, 0x0000, 0x2061, 0x18ae, 0x2c44, 0xa66a,
+	0xa17a, 0xa772, 0xa076, 0xa28e, 0xa392, 0xa496, 0xa59a, 0x080c,
+	0x10d5, 0x7007, 0x0002, 0x701f, 0x44de, 0x0005, 0x81ff, 0x1904,
+	0x336b, 0x080c, 0x48bc, 0x0904, 0x336e, 0x080c, 0x656b, 0x1904,
+	0x336b, 0x00c6, 0x080c, 0x4889, 0x00ce, 0x0904, 0x336b, 0xa867,
+	0x0000, 0xa868, 0xc0fd, 0xa86a, 0x7ea8, 0x080c, 0xbc9b, 0x0904,
+	0x336b, 0x7007, 0x0003, 0x701f, 0x44f8, 0x0005, 0x080c, 0x4028,
+	0x0006, 0x0036, 0x2001, 0x1a4e, 0x201c, 0x7b9a, 0x2003, 0x0000,
+	0x2001, 0x1a4f, 0x201c, 0x7b9e, 0x2003, 0x0000, 0x2001, 0x1a50,
+	0x201c, 0x7ba2, 0x2003, 0x0000, 0x003e, 0x000e, 0x0804, 0x3339,
+	0xa830, 0x9086, 0x0100, 0x0904, 0x336b, 0x8906, 0x8006, 0x8007,
+	0x90bc, 0x003f, 0x9084, 0xffc0, 0x9080, 0x001b, 0x2009, 0x000c,
+	0x7a8c, 0x7b88, 0x7c9c, 0x7d98, 0x0804, 0x48d5, 0x9006, 0x080c,
+	0x26ce, 0x78a8, 0x9084, 0x00ff, 0x9086, 0x00ff, 0x0118, 0x81ff,
+	0x1904, 0x336b, 0x080c, 0x6f9b, 0x0110, 0x080c, 0x5c9f, 0x7888,
+	0x908a, 0x1000, 0x1a04, 0x336e, 0x7984, 0x9186, 0x00ff, 0x0138,
+	0x9182, 0x007f, 0x1a04, 0x336e, 0x2100, 0x080c, 0x2698, 0x0026,
+	0x00c6, 0x0126, 0x2091, 0x8000, 0x2061, 0x19ca, 0x601b, 0x0000,
+	0x601f, 0x0000, 0x6073, 0x0000, 0x6077, 0x0000, 0x080c, 0x6f9b,
+	0x1158, 0x080c, 0x727f, 0x080c, 0x5cda, 0x9085, 0x0001, 0x080c,
+	0x6fe2, 0x080c, 0x6ecd, 0x00d0, 0x080c, 0x9dc8, 0x2061, 0x0100,
+	0x2001, 0x1817, 0x2004, 0x9084, 0x00ff, 0x810f, 0x9105, 0x604a,
+	0x6043, 0x0090, 0x6043, 0x0010, 0x2009, 0x1969, 0x200b, 0x0000,
+	0x2009, 0x002d, 0x2011, 0x5bc5, 0x080c, 0x80b3, 0x7984, 0x080c,
+	0x6f9b, 0x1110, 0x2009, 0x00ff, 0x7a88, 0x080c, 0x4371, 0x012e,
+	0x00ce, 0x002e, 0x0804, 0x3339, 0x7984, 0x080c, 0x61e7, 0x2b08,
+	0x1904, 0x336e, 0x0804, 0x3339, 0x81ff, 0x0120, 0x2009, 0x0001,
+	0x0804, 0x336b, 0x60d8, 0xd0ac, 0x1130, 0xd09c, 0x1120, 0x2009,
+	0x0005, 0x0804, 0x336b, 0x080c, 0x4889, 0x1120, 0x2009, 0x0002,
+	0x0804, 0x336b, 0x7984, 0x9192, 0x0021, 0x1a04, 0x336e, 0x7a8c,
+	0x7b88, 0x7c9c, 0x7d98, 0xa85c, 0x9080, 0x0019, 0x702a, 0xaf60,
+	0x7736, 0x080c, 0x48d2, 0x701f, 0x45ac, 0x7880, 0x9086, 0x006e,
+	0x0110, 0x701f, 0x4e4d, 0x0005, 0x2009, 0x0080, 0x080c, 0x6247,
+	0x1118, 0x080c, 0x656b, 0x0120, 0x2021, 0x400a, 0x0804, 0x333b,
+	0x00d6, 0x0096, 0xa964, 0xaa6c, 0xab70, 0xac74, 0xad78, 0xae7c,
+	0xa884, 0x90be, 0x0100, 0x0904, 0x4645, 0x90be, 0x0112, 0x0904,
+	0x4645, 0x90be, 0x0113, 0x0904, 0x4645, 0x90be, 0x0114, 0x0904,
+	0x4645, 0x90be, 0x0117, 0x0904, 0x4645, 0x90be, 0x011a, 0x0904,
+	0x4645, 0x90be, 0x011c, 0x0904, 0x4645, 0x90be, 0x0121, 0x0904,
+	0x462c, 0x90be, 0x0131, 0x0904, 0x462c, 0x90be, 0x0171, 0x0904,
+	0x4645, 0x90be, 0x0173, 0x0904, 0x4645, 0x90be, 0x01a1, 0x1128,
+	0xa894, 0x8007, 0xa896, 0x0804, 0x4650, 0x90be, 0x0212, 0x0904,
+	0x4639, 0x90be, 0x0213, 0x05e8, 0x90be, 0x0214, 0x0500, 0x90be,
+	0x0217, 0x0188, 0x90be, 0x021a, 0x1120, 0xa89c, 0x8007, 0xa89e,
+	0x04e0, 0x90be, 0x021f, 0x05c8, 0x90be, 0x0300, 0x05b0, 0x009e,
+	0x00de, 0x0804, 0x336e, 0x7028, 0x9080, 0x0010, 0x2098, 0x20a0,
+	0x7034, 0x20e0, 0x20e8, 0x20a9, 0x0007, 0x080c, 0x468e, 0x7028,
+	0x9080, 0x000e, 0x2098, 0x20a0, 0x7034, 0x20e0, 0x20e8, 0x20a9,
+	0x0001, 0x080c, 0x468e, 0x00c8, 0x7028, 0x9080, 0x000c, 0x2098,
+	0x20a0, 0x7034, 0x20e0, 0x20e8, 0x20a9, 0x0001, 0x080c, 0x469b,
+	0x00b8, 0x7028, 0x9080, 0x000e, 0x2098, 0x20a0, 0x7034, 0x20e0,
+	0x20e8, 0x20a9, 0x0001, 0x080c, 0x469b, 0x7028, 0x9080, 0x000c,
+	0x2098, 0x20a0, 0x7034, 0x20e0, 0x20e8, 0x20a9, 0x0001, 0x04f1,
+	0x00c6, 0x080c, 0x4889, 0x0550, 0xa868, 0xc0fd, 0xa86a, 0xa867,
+	0x0119, 0x9006, 0xa882, 0xa87f, 0x0020, 0xa88b, 0x0001, 0x810b,
+	0xa9ae, 0xa8b2, 0xaab6, 0xabba, 0xacbe, 0xadc2, 0xa9c6, 0xa8ca,
+	0x00ce, 0x009e, 0x00de, 0xa866, 0xa822, 0xa868, 0xc0fd, 0xa86a,
+	0xa804, 0x2048, 0x080c, 0xbcb6, 0x1120, 0x2009, 0x0003, 0x0804,
+	0x336b, 0x7007, 0x0003, 0x701f, 0x4685, 0x0005, 0x00ce, 0x009e,
+	0x00de, 0x2009, 0x0002, 0x0804, 0x336b, 0xa820, 0x9086, 0x8001,
+	0x1904, 0x3339, 0x2009, 0x0004, 0x0804, 0x336b, 0x0016, 0x0026,
+	0x3510, 0x20a9, 0x0002, 0x4002, 0x4104, 0x4004, 0x8211, 0x1dc8,
+	0x002e, 0x001e, 0x0005, 0x0016, 0x0026, 0x0036, 0x0046, 0x3520,
+	0x20a9, 0x0004, 0x4002, 0x4304, 0x4204, 0x4104, 0x4004, 0x8421,
+	0x1db8, 0x004e, 0x003e, 0x002e, 0x001e, 0x0005, 0x81ff, 0x0120,
+	0x2009, 0x0001, 0x0804, 0x336b, 0x60d8, 0xd0ac, 0x1160, 0xd09c,
+	0x0120, 0x2009, 0x0016, 0x0804, 0x336b, 0xd09c, 0x1120, 0x2009,
+	0x0005, 0x0804, 0x336b, 0x7984, 0x78a8, 0x2040, 0x080c, 0x9dc1,
+	0x1120, 0x9182, 0x007f, 0x0a04, 0x336e, 0x9186, 0x00ff, 0x0904,
+	0x336e, 0x9182, 0x0800, 0x1a04, 0x336e, 0x7a8c, 0x7b88, 0x6078,
+	0x9306, 0x1158, 0x607c, 0x924e, 0x0904, 0x336e, 0x080c, 0x9dc1,
+	0x1120, 0x99cc, 0xff00, 0x0904, 0x336e, 0x0126, 0x2091, 0x8000,
+	0x0026, 0x2011, 0x8008, 0x080c, 0x658f, 0x002e, 0x0140, 0x918d,
+	0x8000, 0x080c, 0x65d9, 0x1118, 0x2001, 0x4009, 0x0458, 0x080c,
+	0x47a3, 0x0560, 0x90c6, 0x4000, 0x1170, 0x00c6, 0x0006, 0x900e,
+	0x080c, 0x6467, 0x1108, 0xc185, 0xb800, 0xd0bc, 0x0108, 0xc18d,
 	0x000e, 0x00ce, 0x00b8, 0x90c6, 0x4007, 0x1110, 0x2408, 0x0090,
 	0x90c6, 0x4008, 0x1118, 0x2708, 0x2610, 0x0060, 0x90c6, 0x4009,
 	0x1108, 0x0040, 0x90c6, 0x4006, 0x1108, 0x0020, 0x2001, 0x4005,
-	0x2009, 0x000a, 0x2020, 0x012e, 0x0804, 0x3339, 0x2b00, 0x7026,
-	0x0016, 0x00b6, 0x00c6, 0x00e6, 0x2c70, 0x080c, 0x9e7f, 0x0904,
-	0x4760, 0x2b00, 0x6012, 0x080c, 0xbf8c, 0x2e58, 0x00ee, 0x00e6,
-	0x00c6, 0x080c, 0x4879, 0x00ce, 0x2b70, 0x1158, 0x080c, 0x9e32,
+	0x2009, 0x000a, 0x2020, 0x012e, 0x0804, 0x333b, 0x2b00, 0x7026,
+	0x0016, 0x00b6, 0x00c6, 0x00e6, 0x2c70, 0x080c, 0x9e8f, 0x0904,
+	0x4770, 0x2b00, 0x6012, 0x080c, 0xbfa6, 0x2e58, 0x00ee, 0x00e6,
+	0x00c6, 0x080c, 0x4889, 0x00ce, 0x2b70, 0x1158, 0x080c, 0x9e42,
 	0x00ee, 0x00ce, 0x00be, 0x001e, 0x012e, 0x2009, 0x0002, 0x0804,
-	0x3369, 0x900e, 0xa966, 0xa96a, 0x2900, 0x6016, 0xa932, 0xa868,
-	0xc0fd, 0xd88c, 0x0108, 0xc0f5, 0xa86a, 0x080c, 0x2fda, 0x6023,
-	0x0001, 0x9006, 0x080c, 0x617b, 0x2001, 0x0002, 0x080c, 0x618f,
-	0x2009, 0x0002, 0x080c, 0x9eac, 0x78a8, 0xd094, 0x0138, 0x00ee,
+	0x336b, 0x900e, 0xa966, 0xa96a, 0x2900, 0x6016, 0xa932, 0xa868,
+	0xc0fd, 0xd88c, 0x0108, 0xc0f5, 0xa86a, 0x080c, 0x2fdc, 0x6023,
+	0x0001, 0x9006, 0x080c, 0x6184, 0x2001, 0x0002, 0x080c, 0x6198,
+	0x2009, 0x0002, 0x080c, 0x9ebc, 0x78a8, 0xd094, 0x0138, 0x00ee,
 	0x7024, 0x00e6, 0x2058, 0xb8bc, 0xc08d, 0xb8be, 0x9085, 0x0001,
 	0x00ee, 0x00ce, 0x00be, 0x001e, 0x012e, 0x1120, 0x2009, 0x0003,
-	0x0804, 0x3369, 0x7007, 0x0003, 0x701f, 0x476f, 0x0005, 0xa830,
-	0x2008, 0x918e, 0xdead, 0x1120, 0x2021, 0x4009, 0x0804, 0x3339,
+	0x0804, 0x336b, 0x7007, 0x0003, 0x701f, 0x477f, 0x0005, 0xa830,
+	0x2008, 0x918e, 0xdead, 0x1120, 0x2021, 0x4009, 0x0804, 0x333b,
 	0x9086, 0x0100, 0x7024, 0x2058, 0x1138, 0x2009, 0x0004, 0xba04,
-	0x9294, 0x00ff, 0x0804, 0x52e3, 0x900e, 0xa868, 0xd0f4, 0x1904,
-	0x3337, 0x080c, 0x645e, 0x1108, 0xc185, 0xb800, 0xd0bc, 0x0108,
-	0xc18d, 0x0804, 0x3337, 0x00e6, 0x00d6, 0x0096, 0x83ff, 0x0904,
-	0x47db, 0x902e, 0x080c, 0x9db1, 0x0130, 0x9026, 0x20a9, 0x0800,
+	0x9294, 0x00ff, 0x0804, 0x52ec, 0x900e, 0xa868, 0xd0f4, 0x1904,
+	0x3339, 0x080c, 0x6467, 0x1108, 0xc185, 0xb800, 0xd0bc, 0x0108,
+	0xc18d, 0x0804, 0x3339, 0x00e6, 0x00d6, 0x0096, 0x83ff, 0x0904,
+	0x47eb, 0x902e, 0x080c, 0x9dc1, 0x0130, 0x9026, 0x20a9, 0x0800,
 	0x2071, 0x1000, 0x0030, 0x2021, 0x007f, 0x20a9, 0x0781, 0x2071,
 	0x107f, 0x2e04, 0x9005, 0x11b0, 0x2100, 0x9406, 0x15e8, 0x2428,
 	0x94ce, 0x007f, 0x1120, 0x92ce, 0xfffd, 0x1528, 0x0030, 0x94ce,
 	0x0080, 0x1130, 0x92ce, 0xfffc, 0x11f0, 0x93ce, 0x00ff, 0x11d8,
 	0xc5fd, 0x0450, 0x2058, 0xbf10, 0x2700, 0x9306, 0x11b8, 0xbe14,
 	0x2600, 0x9206, 0x1198, 0x2400, 0x9106, 0x1150, 0xd884, 0x0568,
-	0xd894, 0x1558, 0x080c, 0x6562, 0x1540, 0x2001, 0x4000, 0x0430,
+	0xd894, 0x1558, 0x080c, 0x656b, 0x1540, 0x2001, 0x4000, 0x0430,
 	0x2001, 0x4007, 0x0418, 0x2001, 0x4006, 0x0400, 0x2400, 0x9106,
-	0x1158, 0xbe14, 0x87ff, 0x1128, 0x86ff, 0x0948, 0x080c, 0x9db1,
-	0x1930, 0x2001, 0x4008, 0x0090, 0x8420, 0x8e70, 0x1f04, 0x47a9,
+	0x1158, 0xbe14, 0x87ff, 0x1128, 0x86ff, 0x0948, 0x080c, 0x9dc1,
+	0x1930, 0x2001, 0x4008, 0x0090, 0x8420, 0x8e70, 0x1f04, 0x47b9,
 	0x85ff, 0x1130, 0x2001, 0x4009, 0x0048, 0x2001, 0x0001, 0x0030,
-	0x080c, 0x61de, 0x1dd0, 0xbb12, 0xba16, 0x9006, 0x9005, 0x009e,
+	0x080c, 0x61e7, 0x1dd0, 0xbb12, 0xba16, 0x9006, 0x9005, 0x009e,
 	0x00de, 0x00ee, 0x0005, 0x81ff, 0x0120, 0x2009, 0x0001, 0x0804,
-	0x3369, 0x080c, 0x4879, 0x1120, 0x2009, 0x0002, 0x0804, 0x3369,
+	0x336b, 0x080c, 0x4889, 0x1120, 0x2009, 0x0002, 0x0804, 0x336b,
 	0xa867, 0x0000, 0xa868, 0xc0fd, 0xa86a, 0x7884, 0x9005, 0x0904,
-	0x336c, 0x9096, 0x00ff, 0x0120, 0x9092, 0x0004, 0x1a04, 0x336c,
-	0x2010, 0x2918, 0x080c, 0x2f80, 0x1120, 0x2009, 0x0003, 0x0804,
-	0x3369, 0x7007, 0x0003, 0x701f, 0x482e, 0x0005, 0xa830, 0x9086,
-	0x0100, 0x1904, 0x3337, 0x2009, 0x0004, 0x0804, 0x3369, 0x7984,
-	0x080c, 0x9db1, 0x1120, 0x9182, 0x007f, 0x0a04, 0x336c, 0x9186,
-	0x00ff, 0x0904, 0x336c, 0x9182, 0x0800, 0x1a04, 0x336c, 0x2001,
-	0x9000, 0x080c, 0x533e, 0x1904, 0x3369, 0x0804, 0x3337, 0xa998,
-	0x080c, 0x9db1, 0x1118, 0x9182, 0x007f, 0x0280, 0x9186, 0x00ff,
-	0x0168, 0x9182, 0x0800, 0x1250, 0x2001, 0x9000, 0x080c, 0x533e,
+	0x336e, 0x9096, 0x00ff, 0x0120, 0x9092, 0x0004, 0x1a04, 0x336e,
+	0x2010, 0x2918, 0x080c, 0x2f82, 0x1120, 0x2009, 0x0003, 0x0804,
+	0x336b, 0x7007, 0x0003, 0x701f, 0x483e, 0x0005, 0xa830, 0x9086,
+	0x0100, 0x1904, 0x3339, 0x2009, 0x0004, 0x0804, 0x336b, 0x7984,
+	0x080c, 0x9dc1, 0x1120, 0x9182, 0x007f, 0x0a04, 0x336e, 0x9186,
+	0x00ff, 0x0904, 0x336e, 0x9182, 0x0800, 0x1a04, 0x336e, 0x2001,
+	0x9000, 0x080c, 0x5347, 0x1904, 0x336b, 0x0804, 0x3339, 0xa998,
+	0x080c, 0x9dc1, 0x1118, 0x9182, 0x007f, 0x0280, 0x9186, 0x00ff,
+	0x0168, 0x9182, 0x0800, 0x1250, 0x2001, 0x9000, 0x080c, 0x5347,
 	0x11a8, 0x0060, 0xa897, 0x4005, 0xa99a, 0x0010, 0xa897, 0x4006,
 	0x900e, 0x9085, 0x0001, 0x2001, 0x0030, 0x0005, 0xa897, 0x4000,
 	0x900e, 0x9085, 0x0001, 0x2001, 0x0000, 0x0005, 0x2009, 0x000a,
 	0x0c48, 0x080c, 0x0feb, 0x0198, 0x9006, 0xa802, 0x7014, 0x9005,
 	0x1120, 0x2900, 0x7016, 0x701a, 0x0040, 0x7018, 0xa802, 0x0086,
 	0x2040, 0x2900, 0xa006, 0x701a, 0x008e, 0x9085, 0x0001, 0x0005,
-	0x7984, 0x080c, 0x623e, 0x1130, 0x7e88, 0x9684, 0x3fff, 0x9082,
-	0x4000, 0x0208, 0x905e, 0x8bff, 0x0005, 0xa998, 0x080c, 0x623e,
+	0x7984, 0x080c, 0x6247, 0x1130, 0x7e88, 0x9684, 0x3fff, 0x9082,
+	0x4000, 0x0208, 0x905e, 0x8bff, 0x0005, 0xa998, 0x080c, 0x6247,
 	0x1130, 0xae9c, 0x9684, 0x3fff, 0x9082, 0x4000, 0x0208, 0x905e,
-	0x8bff, 0x0005, 0xae98, 0x0008, 0x7e84, 0x2608, 0x080c, 0x623e,
+	0x8bff, 0x0005, 0xae98, 0x0008, 0x7e84, 0x2608, 0x080c, 0x6247,
 	0x1108, 0x0008, 0x905e, 0x8bff, 0x0005, 0x0016, 0x7114, 0x81ff,
 	0x0128, 0x2148, 0xa904, 0x080c, 0x101d, 0x0cc8, 0x7116, 0x711a,
 	0x001e, 0x0005, 0x2031, 0x0001, 0x0010, 0x2031, 0x0000, 0x2061,
 	0x18ae, 0x2c44, 0xa66a, 0xa17a, 0xa772, 0xa076, 0xa28e, 0xa392,
-	0xa496, 0xa59a, 0x080c, 0x10d5, 0x7007, 0x0002, 0x701f, 0x3337,
+	0xa496, 0xa59a, 0x080c, 0x10d5, 0x7007, 0x0002, 0x701f, 0x3339,
 	0x0005, 0x00f6, 0x0126, 0x2091, 0x8000, 0x2079, 0x0000, 0x2001,
-	0x18a6, 0x2004, 0x9005, 0x1190, 0x0e04, 0x48f6, 0x7a36, 0x7833,
+	0x18a6, 0x2004, 0x9005, 0x1190, 0x0e04, 0x4906, 0x7a36, 0x7833,
 	0x0012, 0x7a82, 0x7b86, 0x7c8a, 0x2091, 0x4080, 0x2001, 0x0089,
-	0x2004, 0xd084, 0x190c, 0x1187, 0x0804, 0x495c, 0x0016, 0x0086,
+	0x2004, 0xd084, 0x190c, 0x1187, 0x0804, 0x496c, 0x0016, 0x0086,
 	0x0096, 0x00c6, 0x00e6, 0x2071, 0x1894, 0x7044, 0x9005, 0x1540,
 	0x7148, 0x9182, 0x0010, 0x0288, 0x7038, 0x2060, 0x080c, 0x0feb,
-	0x0904, 0x4954, 0xa84b, 0x0000, 0x2900, 0x7046, 0x2001, 0x0002,
-	0x9080, 0x1f26, 0x2005, 0xa846, 0x0098, 0x7038, 0x90e0, 0x0004,
+	0x0904, 0x4964, 0xa84b, 0x0000, 0x2900, 0x7046, 0x2001, 0x0002,
+	0x9080, 0x1f28, 0x2005, 0xa846, 0x0098, 0x7038, 0x90e0, 0x0004,
 	0x2001, 0x18b0, 0x9c82, 0x18f0, 0x0210, 0x2061, 0x18b0, 0x2c00,
 	0x703a, 0x7148, 0x81ff, 0x1108, 0x703e, 0x8108, 0x714a, 0x0460,
 	0x7148, 0x8108, 0x714a, 0x7044, 0x2040, 0xa144, 0x2105, 0x0016,
@@ -2140,23 +2142,23 @@ unsigned short risc_code01[] = {
 	0x9005, 0xa146, 0x1520, 0x080c, 0x0feb, 0x1130, 0x8109, 0xa946,
 	0x7148, 0x8109, 0x714a, 0x00d8, 0x9006, 0xa806, 0xa84a, 0xa046,
 	0x2800, 0xa802, 0x2900, 0xa006, 0x7046, 0x2001, 0x0002, 0x9080,
-	0x1f26, 0x2005, 0xa846, 0x0058, 0x2262, 0x6306, 0x640a, 0x00ee,
+	0x1f28, 0x2005, 0xa846, 0x0058, 0x2262, 0x6306, 0x640a, 0x00ee,
 	0x00ce, 0x009e, 0x008e, 0x001e, 0x012e, 0x00fe, 0x0005, 0x2c00,
-	0x9082, 0x001b, 0x0002, 0x497e, 0x497e, 0x4980, 0x497e, 0x497e,
-	0x497e, 0x4984, 0x497e, 0x497e, 0x497e, 0x4988, 0x497e, 0x497e,
-	0x497e, 0x498c, 0x497e, 0x497e, 0x497e, 0x4990, 0x497e, 0x497e,
-	0x497e, 0x4994, 0x497e, 0x497e, 0x497e, 0x4999, 0x080c, 0x0db4,
+	0x9082, 0x001b, 0x0002, 0x498e, 0x498e, 0x4990, 0x498e, 0x498e,
+	0x498e, 0x4994, 0x498e, 0x498e, 0x498e, 0x4998, 0x498e, 0x498e,
+	0x498e, 0x499c, 0x498e, 0x498e, 0x498e, 0x49a0, 0x498e, 0x498e,
+	0x498e, 0x49a4, 0x498e, 0x498e, 0x498e, 0x49a9, 0x080c, 0x0db4,
 	0xa276, 0xa37a, 0xa47e, 0x0898, 0xa286, 0xa38a, 0xa48e, 0x0878,
 	0xa296, 0xa39a, 0xa49e, 0x0858, 0xa2a6, 0xa3aa, 0xa4ae, 0x0838,
 	0xa2b6, 0xa3ba, 0xa4be, 0x0818, 0xa2c6, 0xa3ca, 0xa4ce, 0x0804,
-	0x4957, 0xa2d6, 0xa3da, 0xa4de, 0x0804, 0x4957, 0x00e6, 0x2071,
-	0x1894, 0x7048, 0x9005, 0x0904, 0x4a30, 0x0126, 0x2091, 0x8000,
-	0x0e04, 0x4a2f, 0x00f6, 0x2079, 0x0000, 0x00c6, 0x0096, 0x0086,
+	0x4967, 0xa2d6, 0xa3da, 0xa4de, 0x0804, 0x4967, 0x00e6, 0x2071,
+	0x1894, 0x7048, 0x9005, 0x0904, 0x4a40, 0x0126, 0x2091, 0x8000,
+	0x0e04, 0x4a3f, 0x00f6, 0x2079, 0x0000, 0x00c6, 0x0096, 0x0086,
 	0x0076, 0x9006, 0x2038, 0x7040, 0x2048, 0x9005, 0x0500, 0xa948,
 	0x2105, 0x0016, 0x908a, 0x0036, 0x1a0c, 0x0db4, 0x2060, 0x001e,
-	0x8108, 0x2105, 0x9005, 0xa94a, 0x1904, 0x4a32, 0xa804, 0x9005,
+	0x8108, 0x2105, 0x9005, 0xa94a, 0x1904, 0x4a42, 0xa804, 0x9005,
 	0x090c, 0x0db4, 0x7042, 0x2938, 0x2040, 0xa003, 0x0000, 0x2001,
-	0x0002, 0x9080, 0x1f26, 0x2005, 0xa04a, 0x0804, 0x4a32, 0x703c,
+	0x0002, 0x9080, 0x1f28, 0x2005, 0xa04a, 0x0804, 0x4a42, 0x703c,
 	0x2060, 0x2c14, 0x6304, 0x6408, 0x650c, 0x2200, 0x7836, 0x7833,
 	0x0012, 0x7882, 0x2300, 0x7886, 0x2400, 0x788a, 0x2091, 0x4080,
 	0x2001, 0x0089, 0x2004, 0xd084, 0x190c, 0x1187, 0x87ff, 0x0118,
@@ -2166,2683 +2168,2683 @@ unsigned short risc_code01[] = {
 	0x1508, 0x7238, 0x2c00, 0x9206, 0x0148, 0x9c80, 0x0004, 0x90fa,
 	0x18f0, 0x0210, 0x2001, 0x18b0, 0x703e, 0x00a0, 0x9006, 0x703e,
 	0x703a, 0x7044, 0x9005, 0x090c, 0x0db4, 0x2048, 0xa800, 0x9005,
-	0x1de0, 0x2900, 0x7042, 0x2001, 0x0002, 0x9080, 0x1f26, 0x2005,
+	0x1de0, 0x2900, 0x7042, 0x2001, 0x0002, 0x9080, 0x1f28, 0x2005,
 	0xa84a, 0x0000, 0x007e, 0x008e, 0x009e, 0x00ce, 0x00fe, 0x012e,
-	0x00ee, 0x0005, 0x2c00, 0x9082, 0x001b, 0x0002, 0x4a51, 0x4a51,
-	0x4a53, 0x4a51, 0x4a51, 0x4a51, 0x4a58, 0x4a51, 0x4a51, 0x4a51,
-	0x4a5d, 0x4a51, 0x4a51, 0x4a51, 0x4a62, 0x4a51, 0x4a51, 0x4a51,
-	0x4a67, 0x4a51, 0x4a51, 0x4a51, 0x4a6c, 0x4a51, 0x4a51, 0x4a51,
-	0x4a71, 0x080c, 0x0db4, 0xaa74, 0xab78, 0xac7c, 0x0804, 0x49dd,
-	0xaa84, 0xab88, 0xac8c, 0x0804, 0x49dd, 0xaa94, 0xab98, 0xac9c,
-	0x0804, 0x49dd, 0xaaa4, 0xaba8, 0xacac, 0x0804, 0x49dd, 0xaab4,
-	0xabb8, 0xacbc, 0x0804, 0x49dd, 0xaac4, 0xabc8, 0xaccc, 0x0804,
-	0x49dd, 0xaad4, 0xabd8, 0xacdc, 0x0804, 0x49dd, 0x0026, 0x080c,
-	0x5386, 0xd0c4, 0x0120, 0x2011, 0x8014, 0x080c, 0x48d9, 0x002e,
-	0x0005, 0x81ff, 0x1904, 0x3369, 0x0126, 0x2091, 0x8000, 0x6030,
-	0xc08d, 0xc085, 0xc0ac, 0x6032, 0x080c, 0x6fb2, 0x1158, 0x080c,
-	0x7296, 0x080c, 0x5cd1, 0x9085, 0x0001, 0x080c, 0x6ff9, 0x080c,
-	0x6ee4, 0x0010, 0x080c, 0x5b90, 0x012e, 0x0804, 0x3337, 0x81ff,
-	0x0120, 0x2009, 0x0001, 0x0804, 0x3369, 0x080c, 0x539a, 0x0120,
-	0x2009, 0x0007, 0x0804, 0x3369, 0x080c, 0x655a, 0x0120, 0x2009,
-	0x0008, 0x0804, 0x3369, 0x0026, 0x2011, 0x0010, 0x080c, 0x6586,
-	0x002e, 0x0140, 0x7984, 0x080c, 0x65d0, 0x1120, 0x2009, 0x4009,
-	0x0804, 0x3369, 0x080c, 0x312e, 0x0128, 0x7984, 0x080c, 0x61de,
-	0x1904, 0x336c, 0x080c, 0x48ac, 0x0904, 0x336c, 0x2b00, 0x7026,
-	0x080c, 0x6562, 0x7888, 0x1170, 0x9084, 0x0005, 0x1158, 0x900e,
-	0x080c, 0x645e, 0x1108, 0xc185, 0xb800, 0xd0bc, 0x0108, 0xc18d,
-	0x0804, 0x3337, 0x080c, 0x4879, 0x0904, 0x3369, 0x9006, 0xa866,
-	0xa832, 0xa868, 0xc0fd, 0xa86a, 0x080c, 0xbd3a, 0x0904, 0x3369,
-	0x7888, 0xd094, 0x0118, 0xb8bc, 0xc08d, 0xb8be, 0x7007, 0x0003,
-	0x701f, 0x4b47, 0x0005, 0x2061, 0x1800, 0x080c, 0x539a, 0x2009,
-	0x0007, 0x1578, 0x080c, 0x655a, 0x0118, 0x2009, 0x0008, 0x0448,
-	0x080c, 0x312e, 0x0120, 0xa998, 0x080c, 0x61de, 0x1530, 0x080c,
-	0x48aa, 0x0518, 0x080c, 0x6562, 0xa89c, 0x1168, 0x9084, 0x0005,
-	0x1150, 0x900e, 0x080c, 0x645e, 0x1108, 0xc185, 0xb800, 0xd0bc,
-	0x0108, 0xc18d, 0x00d0, 0xa868, 0xc0fc, 0xa86a, 0x080c, 0xbd3a,
-	0x11e0, 0xa89c, 0xd094, 0x0118, 0xb8bc, 0xc08d, 0xb8be, 0x2009,
-	0x0003, 0xa897, 0x4005, 0xa99a, 0x0010, 0xa897, 0x4006, 0x900e,
-	0x9085, 0x0001, 0x2001, 0x0030, 0x0005, 0xa897, 0x4000, 0xa99a,
-	0x9006, 0x918d, 0x0001, 0x2008, 0x0005, 0x9006, 0x0005, 0xa830,
-	0x2008, 0x918e, 0xdead, 0x1120, 0x2021, 0x4009, 0x0804, 0x3339,
-	0x9086, 0x0100, 0x7024, 0x2058, 0x1110, 0x0804, 0x52e3, 0x900e,
-	0x080c, 0x645e, 0x1108, 0xc185, 0xb800, 0xd0bc, 0x0108, 0xc18d,
-	0x0804, 0x3337, 0x080c, 0x539a, 0x0120, 0x2009, 0x0007, 0x0804,
-	0x3369, 0x7f84, 0x7a8c, 0x7b88, 0x7c9c, 0x7d98, 0x080c, 0x4879,
-	0x1120, 0x2009, 0x0002, 0x0804, 0x3369, 0x900e, 0x2130, 0x7126,
-	0x7132, 0xa860, 0x20e8, 0x7036, 0xa85c, 0x9080, 0x0005, 0x702a,
-	0x20a0, 0x080c, 0x623e, 0x1904, 0x4be5, 0x080c, 0x6562, 0x0120,
-	0x080c, 0x656a, 0x1904, 0x4be5, 0x080c, 0x655a, 0x1130, 0x080c,
-	0x645e, 0x1118, 0xd79c, 0x0904, 0x4be5, 0xd794, 0x1110, 0xd784,
-	0x01a8, 0xb8b4, 0x20e0, 0xb8b8, 0x9080, 0x0006, 0x2098, 0x3400,
-	0xd794, 0x0160, 0x20a9, 0x0008, 0x4003, 0x2098, 0x20a0, 0x3d00,
-	0x20e0, 0x20a9, 0x0002, 0x080c, 0x468e, 0x0048, 0x20a9, 0x0004,
-	0x4003, 0x2098, 0x20a0, 0x3d00, 0x20e0, 0x080c, 0x468e, 0x4104,
-	0xd794, 0x0528, 0xb8b4, 0x20e0, 0xb8b8, 0x2060, 0x9c80, 0x0000,
-	0x2098, 0x20a9, 0x0002, 0x4003, 0x9c80, 0x0003, 0x2098, 0x20a9,
-	0x0001, 0x4005, 0x9c80, 0x0004, 0x2098, 0x3400, 0x20a9, 0x0002,
-	0x4003, 0x2098, 0x20a0, 0x3d00, 0x20e0, 0x080c, 0x4681, 0x9c80,
-	0x0026, 0x2098, 0xb8b4, 0x20e0, 0x20a9, 0x0002, 0x4003, 0xd794,
-	0x0110, 0x96b0, 0x000b, 0x96b0, 0x0005, 0x8108, 0x080c, 0x9db1,
-	0x0118, 0x9186, 0x0800, 0x0040, 0xd78c, 0x0120, 0x9186, 0x0800,
-	0x0170, 0x0018, 0x9186, 0x007e, 0x0150, 0xd794, 0x0118, 0x9686,
-	0x0020, 0x0010, 0x9686, 0x0028, 0x0150, 0x0804, 0x4b81, 0x86ff,
-	0x1120, 0x7124, 0x810b, 0x0804, 0x3337, 0x7033, 0x0001, 0x7122,
-	0x7024, 0x9600, 0x7026, 0x772e, 0x2061, 0x18ae, 0x2c44, 0xa06b,
-	0x0000, 0xa67a, 0x7034, 0xa072, 0x7028, 0xa076, 0xa28e, 0xa392,
-	0xa496, 0xa59a, 0x080c, 0x10d5, 0x7007, 0x0002, 0x701f, 0x4c21,
-	0x0005, 0x7030, 0x9005, 0x1180, 0x7120, 0x7028, 0x20a0, 0x772c,
-	0x9036, 0x7034, 0x20e8, 0x2061, 0x18ae, 0x2c44, 0xa28c, 0xa390,
-	0xa494, 0xa598, 0x0804, 0x4b81, 0x7124, 0x810b, 0x0804, 0x3337,
-	0x2029, 0x007e, 0x7984, 0x7a88, 0x7b8c, 0x7c98, 0x9184, 0xff00,
-	0x8007, 0x90e2, 0x0020, 0x0a04, 0x336c, 0x9502, 0x0a04, 0x336c,
-	0x9184, 0x00ff, 0x90e2, 0x0020, 0x0a04, 0x336c, 0x9502, 0x0a04,
-	0x336c, 0x9284, 0xff00, 0x8007, 0x90e2, 0x0020, 0x0a04, 0x336c,
-	0x9502, 0x0a04, 0x336c, 0x9284, 0x00ff, 0x90e2, 0x0020, 0x0a04,
-	0x336c, 0x9502, 0x0a04, 0x336c, 0x9384, 0xff00, 0x8007, 0x90e2,
-	0x0020, 0x0a04, 0x336c, 0x9502, 0x0a04, 0x336c, 0x9384, 0x00ff,
-	0x90e2, 0x0020, 0x0a04, 0x336c, 0x9502, 0x0a04, 0x336c, 0x9484,
-	0xff00, 0x8007, 0x90e2, 0x0020, 0x0a04, 0x336c, 0x9502, 0x0a04,
-	0x336c, 0x9484, 0x00ff, 0x90e2, 0x0020, 0x0a04, 0x336c, 0x9502,
-	0x0a04, 0x336c, 0x2061, 0x195a, 0x6102, 0x6206, 0x630a, 0x640e,
-	0x0804, 0x3337, 0x0006, 0x080c, 0x5386, 0xd0cc, 0x000e, 0x0005,
-	0x0006, 0x080c, 0x538a, 0xd0bc, 0x000e, 0x0005, 0x6170, 0x7a84,
-	0x6300, 0x82ff, 0x1118, 0x7986, 0x0804, 0x3337, 0x83ff, 0x1904,
-	0x336c, 0x2001, 0xfff0, 0x9200, 0x1a04, 0x336c, 0x2019, 0xffff,
-	0x6074, 0x9302, 0x9200, 0x0a04, 0x336c, 0x7986, 0x6272, 0x0804,
-	0x3337, 0x080c, 0x539a, 0x1904, 0x3369, 0x7c88, 0x7d84, 0x7e98,
-	0x7f8c, 0x080c, 0x4879, 0x0904, 0x3369, 0x900e, 0x901e, 0x7326,
-	0x7332, 0xa860, 0x20e8, 0x7036, 0xa85c, 0x9080, 0x0003, 0x702a,
-	0x20a0, 0x91d8, 0x1000, 0x2b5c, 0x8bff, 0x0178, 0x080c, 0x6562,
-	0x0118, 0x080c, 0x656a, 0x1148, 0x20a9, 0x0001, 0xb814, 0x4004,
+	0x00ee, 0x0005, 0x2c00, 0x9082, 0x001b, 0x0002, 0x4a61, 0x4a61,
+	0x4a63, 0x4a61, 0x4a61, 0x4a61, 0x4a68, 0x4a61, 0x4a61, 0x4a61,
+	0x4a6d, 0x4a61, 0x4a61, 0x4a61, 0x4a72, 0x4a61, 0x4a61, 0x4a61,
+	0x4a77, 0x4a61, 0x4a61, 0x4a61, 0x4a7c, 0x4a61, 0x4a61, 0x4a61,
+	0x4a81, 0x080c, 0x0db4, 0xaa74, 0xab78, 0xac7c, 0x0804, 0x49ed,
+	0xaa84, 0xab88, 0xac8c, 0x0804, 0x49ed, 0xaa94, 0xab98, 0xac9c,
+	0x0804, 0x49ed, 0xaaa4, 0xaba8, 0xacac, 0x0804, 0x49ed, 0xaab4,
+	0xabb8, 0xacbc, 0x0804, 0x49ed, 0xaac4, 0xabc8, 0xaccc, 0x0804,
+	0x49ed, 0xaad4, 0xabd8, 0xacdc, 0x0804, 0x49ed, 0x0026, 0x080c,
+	0x538f, 0xd0c4, 0x0120, 0x2011, 0x8014, 0x080c, 0x48e9, 0x002e,
+	0x0005, 0x81ff, 0x1904, 0x336b, 0x0126, 0x2091, 0x8000, 0x6030,
+	0xc08d, 0xc085, 0xc0ac, 0x6032, 0x080c, 0x6f9b, 0x1158, 0x080c,
+	0x727f, 0x080c, 0x5cda, 0x9085, 0x0001, 0x080c, 0x6fe2, 0x080c,
+	0x6ecd, 0x0010, 0x080c, 0x5b99, 0x012e, 0x0804, 0x3339, 0x81ff,
+	0x0120, 0x2009, 0x0001, 0x0804, 0x336b, 0x080c, 0x53a3, 0x0120,
+	0x2009, 0x0007, 0x0804, 0x336b, 0x080c, 0x6563, 0x0120, 0x2009,
+	0x0008, 0x0804, 0x336b, 0x0026, 0x2011, 0x0010, 0x080c, 0x658f,
+	0x002e, 0x0140, 0x7984, 0x080c, 0x65d9, 0x1120, 0x2009, 0x4009,
+	0x0804, 0x336b, 0x7984, 0x080c, 0x61e7, 0x1904, 0x336e, 0x2b00,
+	0x7026, 0x080c, 0x656b, 0x7888, 0x1170, 0x9084, 0x0005, 0x1158,
+	0x900e, 0x080c, 0x6467, 0x1108, 0xc185, 0xb800, 0xd0bc, 0x0108,
+	0xc18d, 0x0804, 0x3339, 0x080c, 0x4889, 0x0904, 0x336b, 0x9006,
+	0xa866, 0xa832, 0xa868, 0xc0fd, 0xa86a, 0x080c, 0xbd54, 0x0904,
+	0x336b, 0x7888, 0xd094, 0x0118, 0xb8bc, 0xc08d, 0xb8be, 0x7007,
+	0x0003, 0x701f, 0x4b50, 0x0005, 0x2061, 0x1800, 0x080c, 0x53a3,
+	0x2009, 0x0007, 0x1578, 0x080c, 0x6563, 0x0118, 0x2009, 0x0008,
+	0x0448, 0x080c, 0x3130, 0x0120, 0xa998, 0x080c, 0x61e7, 0x1530,
+	0x080c, 0x48ba, 0x0518, 0x080c, 0x656b, 0xa89c, 0x1168, 0x9084,
+	0x0005, 0x1150, 0x900e, 0x080c, 0x6467, 0x1108, 0xc185, 0xb800,
+	0xd0bc, 0x0108, 0xc18d, 0x00d0, 0xa868, 0xc0fc, 0xa86a, 0x080c,
+	0xbd54, 0x11e0, 0xa89c, 0xd094, 0x0118, 0xb8bc, 0xc08d, 0xb8be,
+	0x2009, 0x0003, 0xa897, 0x4005, 0xa99a, 0x0010, 0xa897, 0x4006,
+	0x900e, 0x9085, 0x0001, 0x2001, 0x0030, 0x0005, 0xa897, 0x4000,
+	0xa99a, 0x9006, 0x918d, 0x0001, 0x2008, 0x0005, 0x9006, 0x0005,
+	0xa830, 0x2008, 0x918e, 0xdead, 0x1120, 0x2021, 0x4009, 0x0804,
+	0x333b, 0x9086, 0x0100, 0x7024, 0x2058, 0x1110, 0x0804, 0x52ec,
+	0x900e, 0x080c, 0x6467, 0x1108, 0xc185, 0xb800, 0xd0bc, 0x0108,
+	0xc18d, 0x0804, 0x3339, 0x080c, 0x53a3, 0x0120, 0x2009, 0x0007,
+	0x0804, 0x336b, 0x7f84, 0x7a8c, 0x7b88, 0x7c9c, 0x7d98, 0x080c,
+	0x4889, 0x1120, 0x2009, 0x0002, 0x0804, 0x336b, 0x900e, 0x2130,
+	0x7126, 0x7132, 0xa860, 0x20e8, 0x7036, 0xa85c, 0x9080, 0x0005,
+	0x702a, 0x20a0, 0x080c, 0x6247, 0x1904, 0x4bee, 0x080c, 0x656b,
+	0x0120, 0x080c, 0x6573, 0x1904, 0x4bee, 0x080c, 0x6563, 0x1130,
+	0x080c, 0x6467, 0x1118, 0xd79c, 0x0904, 0x4bee, 0xd794, 0x1110,
+	0xd784, 0x01a8, 0xb8b4, 0x20e0, 0xb8b8, 0x9080, 0x0006, 0x2098,
+	0x3400, 0xd794, 0x0160, 0x20a9, 0x0008, 0x4003, 0x2098, 0x20a0,
+	0x3d00, 0x20e0, 0x20a9, 0x0002, 0x080c, 0x469b, 0x0048, 0x20a9,
+	0x0004, 0x4003, 0x2098, 0x20a0, 0x3d00, 0x20e0, 0x080c, 0x469b,
+	0x4104, 0xd794, 0x0528, 0xb8b4, 0x20e0, 0xb8b8, 0x2060, 0x9c80,
+	0x0000, 0x2098, 0x20a9, 0x0002, 0x4003, 0x9c80, 0x0003, 0x2098,
+	0x20a9, 0x0001, 0x4005, 0x9c80, 0x0004, 0x2098, 0x3400, 0x20a9,
+	0x0002, 0x4003, 0x2098, 0x20a0, 0x3d00, 0x20e0, 0x080c, 0x468e,
+	0x9c80, 0x0026, 0x2098, 0xb8b4, 0x20e0, 0x20a9, 0x0002, 0x4003,
+	0xd794, 0x0110, 0x96b0, 0x000b, 0x96b0, 0x0005, 0x8108, 0x080c,
+	0x9dc1, 0x0118, 0x9186, 0x0800, 0x0040, 0xd78c, 0x0120, 0x9186,
+	0x0800, 0x0170, 0x0018, 0x9186, 0x007e, 0x0150, 0xd794, 0x0118,
+	0x9686, 0x0020, 0x0010, 0x9686, 0x0028, 0x0150, 0x0804, 0x4b8a,
+	0x86ff, 0x1120, 0x7124, 0x810b, 0x0804, 0x3339, 0x7033, 0x0001,
+	0x7122, 0x7024, 0x9600, 0x7026, 0x772e, 0x2061, 0x18ae, 0x2c44,
+	0xa06b, 0x0000, 0xa67a, 0x7034, 0xa072, 0x7028, 0xa076, 0xa28e,
+	0xa392, 0xa496, 0xa59a, 0x080c, 0x10d5, 0x7007, 0x0002, 0x701f,
+	0x4c2a, 0x0005, 0x7030, 0x9005, 0x1180, 0x7120, 0x7028, 0x20a0,
+	0x772c, 0x9036, 0x7034, 0x20e8, 0x2061, 0x18ae, 0x2c44, 0xa28c,
+	0xa390, 0xa494, 0xa598, 0x0804, 0x4b8a, 0x7124, 0x810b, 0x0804,
+	0x3339, 0x2029, 0x007e, 0x7984, 0x7a88, 0x7b8c, 0x7c98, 0x9184,
+	0xff00, 0x8007, 0x90e2, 0x0020, 0x0a04, 0x336e, 0x9502, 0x0a04,
+	0x336e, 0x9184, 0x00ff, 0x90e2, 0x0020, 0x0a04, 0x336e, 0x9502,
+	0x0a04, 0x336e, 0x9284, 0xff00, 0x8007, 0x90e2, 0x0020, 0x0a04,
+	0x336e, 0x9502, 0x0a04, 0x336e, 0x9284, 0x00ff, 0x90e2, 0x0020,
+	0x0a04, 0x336e, 0x9502, 0x0a04, 0x336e, 0x9384, 0xff00, 0x8007,
+	0x90e2, 0x0020, 0x0a04, 0x336e, 0x9502, 0x0a04, 0x336e, 0x9384,
+	0x00ff, 0x90e2, 0x0020, 0x0a04, 0x336e, 0x9502, 0x0a04, 0x336e,
+	0x9484, 0xff00, 0x8007, 0x90e2, 0x0020, 0x0a04, 0x336e, 0x9502,
+	0x0a04, 0x336e, 0x9484, 0x00ff, 0x90e2, 0x0020, 0x0a04, 0x336e,
+	0x9502, 0x0a04, 0x336e, 0x2061, 0x1959, 0x6102, 0x6206, 0x630a,
+	0x640e, 0x0804, 0x3339, 0x0006, 0x080c, 0x538f, 0xd0cc, 0x000e,
+	0x0005, 0x0006, 0x080c, 0x5393, 0xd0bc, 0x000e, 0x0005, 0x6170,
+	0x7a84, 0x6300, 0x82ff, 0x1118, 0x7986, 0x0804, 0x3339, 0x83ff,
+	0x1904, 0x336e, 0x2001, 0xfff0, 0x9200, 0x1a04, 0x336e, 0x2019,
+	0xffff, 0x6074, 0x9302, 0x9200, 0x0a04, 0x336e, 0x7986, 0x6272,
+	0x0804, 0x3339, 0x080c, 0x53a3, 0x1904, 0x336b, 0x7c88, 0x7d84,
+	0x7e98, 0x7f8c, 0x080c, 0x4889, 0x0904, 0x336b, 0x900e, 0x901e,
+	0x7326, 0x7332, 0xa860, 0x20e8, 0x7036, 0xa85c, 0x9080, 0x0003,
+	0x702a, 0x20a0, 0x91d8, 0x1000, 0x2b5c, 0x8bff, 0x0178, 0x080c,
+	0x656b, 0x0118, 0x080c, 0x6573, 0x1148, 0x20a9, 0x0001, 0xb814,
+	0x4004, 0xb810, 0x4004, 0x4104, 0x9398, 0x0003, 0x8108, 0x9182,
+	0x0800, 0x0120, 0x9386, 0x003c, 0x0170, 0x0c20, 0x83ff, 0x1148,
+	0x7224, 0x900e, 0x2001, 0x0003, 0x080c, 0x8259, 0x2208, 0x0804,
+	0x3339, 0x7033, 0x0001, 0x7122, 0x7024, 0x9300, 0x7026, 0x2061,
+	0x18ae, 0x2c44, 0xa06b, 0x0000, 0xa37a, 0x7028, 0xa076, 0x7034,
+	0xa072, 0xa48e, 0xa592, 0xa696, 0xa79a, 0x080c, 0x10d5, 0x7007,
+	0x0002, 0x701f, 0x4d1c, 0x0005, 0x7030, 0x9005, 0x1178, 0x7120,
+	0x7028, 0x20a0, 0x901e, 0x7034, 0x20e8, 0x2061, 0x18ae, 0x2c44,
+	0xa48c, 0xa590, 0xa694, 0xa798, 0x0804, 0x4cda, 0x7224, 0x900e,
+	0x2001, 0x0003, 0x080c, 0x8259, 0x2208, 0x0804, 0x3339, 0x00f6,
+	0x00e6, 0x080c, 0x53a3, 0x2009, 0x0007, 0x1904, 0x4daf, 0x2071,
+	0x1894, 0x745c, 0x84ff, 0x2009, 0x000e, 0x1904, 0x4daf, 0xac9c,
+	0xad98, 0xaea4, 0xafa0, 0x0096, 0x080c, 0x1004, 0x2009, 0x0002,
+	0x0904, 0x4daf, 0x2900, 0x705e, 0x900e, 0x901e, 0x7356, 0x7362,
+	0xa860, 0x7066, 0xa85c, 0x9080, 0x0003, 0x705a, 0x20a0, 0x91d8,
+	0x1000, 0x2b5c, 0x8bff, 0x0178, 0x080c, 0x656b, 0x0118, 0x080c,
+	0x6573, 0x1148, 0xb814, 0x20a9, 0x0001, 0x4004, 0xb810, 0x4004,
+	0x4104, 0x9398, 0x0003, 0x8108, 0x9182, 0x0800, 0x0120, 0x9386,
+	0x003c, 0x01e8, 0x0c20, 0x83ff, 0x11c0, 0x7254, 0x900e, 0x2001,
+	0x0003, 0x080c, 0x8259, 0x2208, 0x009e, 0xa897, 0x4000, 0xa99a,
+	0x715c, 0x81ff, 0x090c, 0x0db4, 0x2148, 0x080c, 0x101d, 0x9006,
+	0x705e, 0x918d, 0x0001, 0x2008, 0x0418, 0x7063, 0x0001, 0x7152,
+	0x7054, 0x9300, 0x7056, 0x2061, 0x18af, 0x2c44, 0xa37a, 0x7058,
+	0xa076, 0x7064, 0xa072, 0xa48e, 0xa592, 0xa696, 0xa79a, 0xa09f,
+	0x4dbb, 0x000e, 0xa0a2, 0x080c, 0x10d5, 0x9006, 0x0048, 0x009e,
+	0xa897, 0x4005, 0xa99a, 0x900e, 0x9085, 0x0001, 0x2001, 0x0030,
+	0x00ee, 0x00fe, 0x0005, 0x00f6, 0xa0a0, 0x904d, 0x090c, 0x0db4,
+	0x00e6, 0x2071, 0x1894, 0xa06c, 0x908e, 0x0100, 0x0138, 0xa87b,
+	0x0030, 0xa883, 0x0000, 0xa897, 0x4002, 0x00d8, 0x7060, 0x9005,
+	0x1158, 0x7150, 0x7058, 0x20a0, 0x901e, 0x7064, 0x20e8, 0xa48c,
+	0xa590, 0xa694, 0xa798, 0x0428, 0xa87b, 0x0000, 0xa883, 0x0000,
+	0xa897, 0x4000, 0x7254, 0x900e, 0x2001, 0x0003, 0x080c, 0x8259,
+	0xaa9a, 0x715c, 0x81ff, 0x090c, 0x0db4, 0x2148, 0x080c, 0x101d,
+	0x705f, 0x0000, 0xa0a0, 0x2048, 0x0126, 0x2091, 0x8000, 0x080c,
+	0x6891, 0x012e, 0xa09f, 0x0000, 0xa0a3, 0x0000, 0x00ee, 0x00fe,
+	0x0005, 0x91d8, 0x1000, 0x2b5c, 0x8bff, 0x0178, 0x080c, 0x656b,
+	0x0118, 0x080c, 0x6573, 0x1148, 0xb814, 0x20a9, 0x0001, 0x4004,
 	0xb810, 0x4004, 0x4104, 0x9398, 0x0003, 0x8108, 0x9182, 0x0800,
-	0x0120, 0x9386, 0x003c, 0x0170, 0x0c20, 0x83ff, 0x1148, 0x7224,
-	0x900e, 0x2001, 0x0003, 0x080c, 0x8270, 0x2208, 0x0804, 0x3337,
-	0x7033, 0x0001, 0x7122, 0x7024, 0x9300, 0x7026, 0x2061, 0x18ae,
-	0x2c44, 0xa06b, 0x0000, 0xa37a, 0x7028, 0xa076, 0x7034, 0xa072,
-	0xa48e, 0xa592, 0xa696, 0xa79a, 0x080c, 0x10d5, 0x7007, 0x0002,
-	0x701f, 0x4d13, 0x0005, 0x7030, 0x9005, 0x1178, 0x7120, 0x7028,
-	0x20a0, 0x901e, 0x7034, 0x20e8, 0x2061, 0x18ae, 0x2c44, 0xa48c,
-	0xa590, 0xa694, 0xa798, 0x0804, 0x4cd1, 0x7224, 0x900e, 0x2001,
-	0x0003, 0x080c, 0x8270, 0x2208, 0x0804, 0x3337, 0x00f6, 0x00e6,
-	0x080c, 0x539a, 0x2009, 0x0007, 0x1904, 0x4da6, 0x2071, 0x1894,
-	0x745c, 0x84ff, 0x2009, 0x000e, 0x1904, 0x4da6, 0xac9c, 0xad98,
-	0xaea4, 0xafa0, 0x0096, 0x080c, 0x1004, 0x2009, 0x0002, 0x0904,
-	0x4da6, 0x2900, 0x705e, 0x900e, 0x901e, 0x7356, 0x7362, 0xa860,
-	0x7066, 0xa85c, 0x9080, 0x0003, 0x705a, 0x20a0, 0x91d8, 0x1000,
-	0x2b5c, 0x8bff, 0x0178, 0x080c, 0x6562, 0x0118, 0x080c, 0x656a,
-	0x1148, 0xb814, 0x20a9, 0x0001, 0x4004, 0xb810, 0x4004, 0x4104,
-	0x9398, 0x0003, 0x8108, 0x9182, 0x0800, 0x0120, 0x9386, 0x003c,
-	0x01e8, 0x0c20, 0x83ff, 0x11c0, 0x7254, 0x900e, 0x2001, 0x0003,
-	0x080c, 0x8270, 0x2208, 0x009e, 0xa897, 0x4000, 0xa99a, 0x715c,
-	0x81ff, 0x090c, 0x0db4, 0x2148, 0x080c, 0x101d, 0x9006, 0x705e,
-	0x918d, 0x0001, 0x2008, 0x0418, 0x7063, 0x0001, 0x7152, 0x7054,
-	0x9300, 0x7056, 0x2061, 0x18af, 0x2c44, 0xa37a, 0x7058, 0xa076,
-	0x7064, 0xa072, 0xa48e, 0xa592, 0xa696, 0xa79a, 0xa09f, 0x4db2,
-	0x000e, 0xa0a2, 0x080c, 0x10d5, 0x9006, 0x0048, 0x009e, 0xa897,
-	0x4005, 0xa99a, 0x900e, 0x9085, 0x0001, 0x2001, 0x0030, 0x00ee,
-	0x00fe, 0x0005, 0x00f6, 0xa0a0, 0x904d, 0x090c, 0x0db4, 0x00e6,
-	0x2071, 0x1894, 0xa06c, 0x908e, 0x0100, 0x0138, 0xa87b, 0x0030,
-	0xa883, 0x0000, 0xa897, 0x4002, 0x00d8, 0x7060, 0x9005, 0x1158,
-	0x7150, 0x7058, 0x20a0, 0x901e, 0x7064, 0x20e8, 0xa48c, 0xa590,
-	0xa694, 0xa798, 0x0428, 0xa87b, 0x0000, 0xa883, 0x0000, 0xa897,
-	0x4000, 0x7254, 0x900e, 0x2001, 0x0003, 0x080c, 0x8270, 0xaa9a,
-	0x715c, 0x81ff, 0x090c, 0x0db4, 0x2148, 0x080c, 0x101d, 0x705f,
-	0x0000, 0xa0a0, 0x2048, 0x0126, 0x2091, 0x8000, 0x080c, 0x688c,
-	0x012e, 0xa09f, 0x0000, 0xa0a3, 0x0000, 0x00ee, 0x00fe, 0x0005,
-	0x91d8, 0x1000, 0x2b5c, 0x8bff, 0x0178, 0x080c, 0x6562, 0x0118,
-	0x080c, 0x656a, 0x1148, 0xb814, 0x20a9, 0x0001, 0x4004, 0xb810,
-	0x4004, 0x4104, 0x9398, 0x0003, 0x8108, 0x9182, 0x0800, 0x0120,
-	0x9386, 0x003c, 0x0518, 0x0c20, 0x83ff, 0x11f0, 0x7154, 0x810c,
-	0xa99a, 0xa897, 0x4000, 0x715c, 0x81ff, 0x090c, 0x0db4, 0x2148,
-	0x080c, 0x101d, 0x9006, 0x705e, 0x918d, 0x0001, 0x2008, 0xa0a0,
-	0x2048, 0x0126, 0x2091, 0x8000, 0x080c, 0x688c, 0x012e, 0xa09f,
-	0x0000, 0xa0a3, 0x0000, 0x0070, 0x7063, 0x0001, 0x7152, 0x7054,
-	0x9300, 0x7056, 0xa37a, 0xa48e, 0xa592, 0xa696, 0xa79a, 0x080c,
-	0x10d5, 0x9006, 0x00ee, 0x0005, 0x0096, 0xa88c, 0x90be, 0x7000,
-	0x0148, 0x90be, 0x7100, 0x0130, 0x90be, 0x7200, 0x0118, 0x009e,
-	0x0804, 0x336c, 0xa884, 0xa988, 0x080c, 0x2663, 0x1518, 0x080c,
-	0x61de, 0x1500, 0x7126, 0xbe12, 0xbd16, 0xae7c, 0x080c, 0x4879,
-	0x01c8, 0x080c, 0x4879, 0x01b0, 0x009e, 0xa867, 0x0000, 0xa868,
-	0xc0fd, 0xa86a, 0xa823, 0x0000, 0xa804, 0x2048, 0x080c, 0xbcc1,
-	0x1120, 0x2009, 0x0003, 0x0804, 0x3369, 0x7007, 0x0003, 0x701f,
-	0x4e7f, 0x0005, 0x009e, 0x2009, 0x0002, 0x0804, 0x3369, 0x7124,
-	0x080c, 0x30d5, 0xa820, 0x9086, 0x8001, 0x1120, 0x2009, 0x0004,
-	0x0804, 0x3369, 0x2900, 0x7022, 0xa804, 0x0096, 0x2048, 0x8906,
-	0x8006, 0x8007, 0x90bc, 0x003f, 0x9084, 0xffc0, 0x009e, 0x9080,
-	0x0002, 0x0076, 0x0006, 0x2098, 0x20a0, 0x27e0, 0x27e8, 0x20a9,
-	0x002a, 0x080c, 0x0f68, 0xaa6c, 0xab70, 0xac74, 0xad78, 0x2061,
-	0x18ae, 0x2c44, 0xa06b, 0x0000, 0xae64, 0xaf8c, 0x97c6, 0x7000,
-	0x0118, 0x97c6, 0x7100, 0x1148, 0x96c2, 0x0004, 0x0600, 0x2009,
-	0x0004, 0x000e, 0x007e, 0x0804, 0x48c5, 0x97c6, 0x7200, 0x11b8,
-	0x96c2, 0x0054, 0x02a0, 0x000e, 0x007e, 0x2061, 0x18ae, 0x2c44,
-	0xa076, 0xa772, 0xa07b, 0x002a, 0xa28e, 0xa392, 0xa496, 0xa59a,
-	0x080c, 0x10d5, 0x7007, 0x0002, 0x701f, 0x4edb, 0x0005, 0x000e,
-	0x007e, 0x0804, 0x336c, 0x7020, 0x2048, 0xa804, 0x2048, 0xa804,
-	0x2048, 0x8906, 0x8006, 0x8007, 0x90bc, 0x003f, 0x9084, 0xffc0,
-	0x9080, 0x0002, 0x2098, 0x20a0, 0x27e0, 0x27e8, 0x20a9, 0x002a,
-	0x080c, 0x0f68, 0x2100, 0x2238, 0x2061, 0x18ae, 0x2c44, 0xa28c,
-	0xa390, 0xa494, 0xa598, 0x2009, 0x002a, 0x0804, 0x48c5, 0x81ff,
-	0x1904, 0x3369, 0x798c, 0x2001, 0x194f, 0x918c, 0x8000, 0x2102,
-	0x080c, 0x4890, 0x0904, 0x336c, 0x080c, 0x6562, 0x0120, 0x080c,
-	0x656a, 0x1904, 0x336c, 0x080c, 0x6305, 0x0904, 0x3369, 0x0126,
-	0x2091, 0x8000, 0x080c, 0x63cb, 0x012e, 0x0904, 0x3369, 0x2001,
-	0x194f, 0x2004, 0xd0fc, 0x1904, 0x3337, 0x0804, 0x4301, 0xa9a0,
-	0x2001, 0x194f, 0x918c, 0x8000, 0xc18d, 0x2102, 0x080c, 0x489d,
-	0x01a0, 0x080c, 0x6562, 0x0118, 0x080c, 0x656a, 0x1170, 0x080c,
-	0x6305, 0x2009, 0x0002, 0x0128, 0x080c, 0x63cb, 0x1170, 0x2009,
-	0x0003, 0xa897, 0x4005, 0xa99a, 0x0010, 0xa897, 0x4006, 0x900e,
-	0x9085, 0x0001, 0x2001, 0x0030, 0x0005, 0xa897, 0x4000, 0x2001,
-	0x194f, 0x2004, 0xd0fc, 0x1128, 0x080c, 0x538e, 0x0110, 0x9006,
-	0x0018, 0x900e, 0x9085, 0x0001, 0x2001, 0x0000, 0x0005, 0x78a8,
-	0xd08c, 0x1118, 0xd084, 0x0904, 0x4276, 0x080c, 0x48ac, 0x0904,
-	0x336c, 0x080c, 0x4879, 0x1120, 0x2009, 0x0002, 0x0804, 0x3369,
-	0x080c, 0x6562, 0x0130, 0x908e, 0x0004, 0x0118, 0x908e, 0x0005,
-	0x15a0, 0x78a8, 0xd08c, 0x0120, 0xb800, 0xc08c, 0xb802, 0x0028,
-	0x080c, 0x5386, 0xd0b4, 0x0904, 0x42b0, 0x7884, 0x908e, 0x007e,
-	0x0904, 0x42b0, 0x908e, 0x007f, 0x0904, 0x42b0, 0x908e, 0x0080,
-	0x0904, 0x42b0, 0xb800, 0xd08c, 0x1904, 0x42b0, 0xa867, 0x0000,
-	0xa868, 0xc0fd, 0xa86a, 0x080c, 0xbce0, 0x1120, 0x2009, 0x0003,
-	0x0804, 0x3369, 0x7007, 0x0003, 0x701f, 0x4fa7, 0x0005, 0x080c,
-	0x48ac, 0x0904, 0x336c, 0x0804, 0x42b0, 0x080c, 0x312e, 0x0108,
-	0x0005, 0x2009, 0x1833, 0x210c, 0x81ff, 0x0120, 0x2009, 0x0001,
-	0x0804, 0x3369, 0x080c, 0x539a, 0x0120, 0x2009, 0x0007, 0x0804,
-	0x3369, 0x080c, 0x655a, 0x0120, 0x2009, 0x0008, 0x0804, 0x3369,
-	0xb89c, 0xd0a4, 0x1118, 0xd0ac, 0x1904, 0x42b0, 0x9006, 0xa866,
-	0xa832, 0xa868, 0xc0fd, 0xa86a, 0x080c, 0xbd3a, 0x1120, 0x2009,
-	0x0003, 0x0804, 0x3369, 0x7007, 0x0003, 0x701f, 0x4fe0, 0x0005,
-	0xa830, 0x9086, 0x0100, 0x1120, 0x2009, 0x0004, 0x0804, 0x52e3,
-	0x080c, 0x48ac, 0x0904, 0x336c, 0x0804, 0x4f79, 0x81ff, 0x2009,
-	0x0001, 0x1904, 0x3369, 0x080c, 0x539a, 0x2009, 0x0007, 0x1904,
-	0x3369, 0x080c, 0x655a, 0x0120, 0x2009, 0x0008, 0x0804, 0x3369,
-	0x080c, 0x48ac, 0x0904, 0x336c, 0x080c, 0x6562, 0x2009, 0x0009,
-	0x1904, 0x3369, 0x080c, 0x4879, 0x2009, 0x0002, 0x0904, 0x3369,
-	0x9006, 0xa866, 0xa832, 0xa868, 0xc0fd, 0xa86a, 0x7988, 0x9194,
-	0xff00, 0x918c, 0x00ff, 0x9006, 0x82ff, 0x1128, 0xc0ed, 0xa952,
-	0x798c, 0xa956, 0x0038, 0x928e, 0x0100, 0x1904, 0x336c, 0xc0e5,
-	0xa952, 0xa956, 0xa83e, 0x080c, 0xbf8d, 0x2009, 0x0003, 0x0904,
-	0x3369, 0x7007, 0x0003, 0x701f, 0x5036, 0x0005, 0xa830, 0x9086,
-	0x0100, 0x2009, 0x0004, 0x0904, 0x3369, 0x0804, 0x3337, 0x7aa8,
-	0x9284, 0xc000, 0x0148, 0xd2ec, 0x01a0, 0x080c, 0x539a, 0x1188,
-	0x2009, 0x0014, 0x0804, 0x3369, 0xd2dc, 0x1568, 0x81ff, 0x2009,
-	0x0001, 0x1904, 0x3369, 0x080c, 0x539a, 0x2009, 0x0007, 0x1904,
-	0x3369, 0xd2f4, 0x0130, 0x9284, 0x5000, 0x080c, 0x5361, 0x0804,
-	0x3337, 0xd2fc, 0x0158, 0x080c, 0x48ac, 0x0904, 0x336c, 0x7984,
-	0x9284, 0x9000, 0x080c, 0x533e, 0x0804, 0x3337, 0x080c, 0x48ac,
-	0x0904, 0x336c, 0xb804, 0x9084, 0x00ff, 0x9086, 0x0006, 0x2009,
-	0x0009, 0x1904, 0x511f, 0x080c, 0x4879, 0x2009, 0x0002, 0x0904,
-	0x511f, 0xa85c, 0x9080, 0x001b, 0xaf60, 0x2009, 0x0008, 0x7a8c,
-	0x7b88, 0x7c9c, 0x7d98, 0x080c, 0x48c2, 0x701f, 0x5090, 0x0005,
-	0xa86c, 0x9086, 0x0500, 0x1138, 0xa870, 0x9005, 0x1120, 0xa874,
-	0x9084, 0xff00, 0x0110, 0x1904, 0x336c, 0xa866, 0xa832, 0xa868,
-	0xc0fd, 0xa86a, 0x080c, 0x48ac, 0x1110, 0x0804, 0x336c, 0x2009,
-	0x0043, 0x080c, 0xbff5, 0x2009, 0x0003, 0x0904, 0x511f, 0x7007,
-	0x0003, 0x701f, 0x50b4, 0x0005, 0xa830, 0x9086, 0x0100, 0x2009,
-	0x0004, 0x0904, 0x511f, 0x7984, 0x7aa8, 0x9284, 0x1000, 0x080c,
-	0x533e, 0x0804, 0x3337, 0x00c6, 0xaab0, 0x9284, 0xc000, 0x0140,
-	0xd2ec, 0x0168, 0x080c, 0x539a, 0x1150, 0x2009, 0x0014, 0x04f0,
-	0x2061, 0x1800, 0x080c, 0x539a, 0x2009, 0x0007, 0x15b8, 0xd2f4,
-	0x0128, 0x9284, 0x5000, 0x080c, 0x5361, 0x0050, 0xd2fc, 0x0178,
-	0x080c, 0x48aa, 0x0588, 0xa998, 0x9284, 0x9000, 0x080c, 0x533e,
-	0xa87b, 0x0000, 0xa883, 0x0000, 0xa897, 0x4000, 0x0438, 0x080c,
-	0x48aa, 0x0510, 0x080c, 0x6562, 0x2009, 0x0009, 0x11b8, 0xa8c4,
-	0x9086, 0x0500, 0x11c8, 0xa8c8, 0x9005, 0x11b0, 0xa8cc, 0x9084,
-	0xff00, 0x1190, 0x080c, 0x48aa, 0x1108, 0x0070, 0x2009, 0x004b,
-	0x080c, 0xbff5, 0x2009, 0x0003, 0x0108, 0x0078, 0x0429, 0x19c0,
-	0xa897, 0x4005, 0xa99a, 0x0010, 0xa897, 0x4006, 0x900e, 0x9085,
-	0x0001, 0x2001, 0x0030, 0x00ce, 0x0005, 0x9006, 0x0ce0, 0x7aa8,
-	0xd2dc, 0x0904, 0x3369, 0x0016, 0x7984, 0x9284, 0x1000, 0xc0fd,
-	0x080c, 0x533e, 0x001e, 0x1904, 0x3369, 0x0804, 0x3337, 0x00f6,
-	0x2d78, 0x0011, 0x00fe, 0x0005, 0xaab0, 0xd2dc, 0x0150, 0x0016,
-	0xa998, 0x9284, 0x1000, 0xc0fd, 0x080c, 0x533e, 0x001e, 0x9085,
-	0x0001, 0x0005, 0x81ff, 0x0120, 0x2009, 0x0001, 0x0804, 0x3369,
-	0x080c, 0x539a, 0x0120, 0x2009, 0x0007, 0x0804, 0x3369, 0x7984,
-	0x7ea8, 0x96b4, 0x00ff, 0x080c, 0x623e, 0x1904, 0x336c, 0x9186,
-	0x007f, 0x0138, 0x080c, 0x6562, 0x0120, 0x2009, 0x0009, 0x0804,
-	0x3369, 0x080c, 0x4879, 0x1120, 0x2009, 0x0002, 0x0804, 0x3369,
-	0xa867, 0x0000, 0xa868, 0xc0fd, 0xa86a, 0x2001, 0x0100, 0x8007,
-	0xa80a, 0x080c, 0xbcfa, 0x1120, 0x2009, 0x0003, 0x0804, 0x3369,
-	0x7007, 0x0003, 0x701f, 0x517d, 0x0005, 0xa808, 0x8007, 0x9086,
-	0x0100, 0x1120, 0x2009, 0x0004, 0x0804, 0x3369, 0xa8e0, 0xa866,
-	0xa810, 0x8007, 0x9084, 0x00ff, 0x800c, 0xa814, 0x8007, 0x9084,
-	0x00ff, 0x8004, 0x9080, 0x0002, 0x9108, 0x8906, 0x8006, 0x8007,
-	0x90bc, 0x003f, 0x9084, 0xffc0, 0x9080, 0x0004, 0x7a8c, 0x7b88,
-	0x7c9c, 0x7d98, 0x0804, 0x48c5, 0x080c, 0x4879, 0x1120, 0x2009,
-	0x0002, 0x0804, 0x3369, 0x7984, 0x9194, 0xff00, 0x918c, 0x00ff,
-	0x8217, 0x82ff, 0x1118, 0x7023, 0x1984, 0x0040, 0x92c6, 0x0001,
-	0x1118, 0x7023, 0x199e, 0x0010, 0x0804, 0x336c, 0x2009, 0x001a,
+	0x0120, 0x9386, 0x003c, 0x0518, 0x0c20, 0x83ff, 0x11f0, 0x7154,
+	0x810c, 0xa99a, 0xa897, 0x4000, 0x715c, 0x81ff, 0x090c, 0x0db4,
+	0x2148, 0x080c, 0x101d, 0x9006, 0x705e, 0x918d, 0x0001, 0x2008,
+	0xa0a0, 0x2048, 0x0126, 0x2091, 0x8000, 0x080c, 0x6891, 0x012e,
+	0xa09f, 0x0000, 0xa0a3, 0x0000, 0x0070, 0x7063, 0x0001, 0x7152,
+	0x7054, 0x9300, 0x7056, 0xa37a, 0xa48e, 0xa592, 0xa696, 0xa79a,
+	0x080c, 0x10d5, 0x9006, 0x00ee, 0x0005, 0x0096, 0xa88c, 0x90be,
+	0x7000, 0x0148, 0x90be, 0x7100, 0x0130, 0x90be, 0x7200, 0x0118,
+	0x009e, 0x0804, 0x336e, 0xa884, 0xa988, 0x080c, 0x2665, 0x1518,
+	0x080c, 0x61e7, 0x1500, 0x7126, 0xbe12, 0xbd16, 0xae7c, 0x080c,
+	0x4889, 0x01c8, 0x080c, 0x4889, 0x01b0, 0x009e, 0xa867, 0x0000,
+	0xa868, 0xc0fd, 0xa86a, 0xa823, 0x0000, 0xa804, 0x2048, 0x080c,
+	0xbcd6, 0x1120, 0x2009, 0x0003, 0x0804, 0x336b, 0x7007, 0x0003,
+	0x701f, 0x4e88, 0x0005, 0x009e, 0x2009, 0x0002, 0x0804, 0x336b,
+	0x7124, 0x080c, 0x30d7, 0xa820, 0x9086, 0x8001, 0x1120, 0x2009,
+	0x0004, 0x0804, 0x336b, 0x2900, 0x7022, 0xa804, 0x0096, 0x2048,
+	0x8906, 0x8006, 0x8007, 0x90bc, 0x003f, 0x9084, 0xffc0, 0x009e,
+	0x9080, 0x0002, 0x0076, 0x0006, 0x2098, 0x20a0, 0x27e0, 0x27e8,
+	0x20a9, 0x002a, 0x080c, 0x0f68, 0xaa6c, 0xab70, 0xac74, 0xad78,
+	0x2061, 0x18ae, 0x2c44, 0xa06b, 0x0000, 0xae64, 0xaf8c, 0x97c6,
+	0x7000, 0x0118, 0x97c6, 0x7100, 0x1148, 0x96c2, 0x0004, 0x0600,
+	0x2009, 0x0004, 0x000e, 0x007e, 0x0804, 0x48d5, 0x97c6, 0x7200,
+	0x11b8, 0x96c2, 0x0054, 0x02a0, 0x000e, 0x007e, 0x2061, 0x18ae,
+	0x2c44, 0xa076, 0xa772, 0xa07b, 0x002a, 0xa28e, 0xa392, 0xa496,
+	0xa59a, 0x080c, 0x10d5, 0x7007, 0x0002, 0x701f, 0x4ee4, 0x0005,
+	0x000e, 0x007e, 0x0804, 0x336e, 0x7020, 0x2048, 0xa804, 0x2048,
+	0xa804, 0x2048, 0x8906, 0x8006, 0x8007, 0x90bc, 0x003f, 0x9084,
+	0xffc0, 0x9080, 0x0002, 0x2098, 0x20a0, 0x27e0, 0x27e8, 0x20a9,
+	0x002a, 0x080c, 0x0f68, 0x2100, 0x2238, 0x2061, 0x18ae, 0x2c44,
+	0xa28c, 0xa390, 0xa494, 0xa598, 0x2009, 0x002a, 0x0804, 0x48d5,
+	0x81ff, 0x1904, 0x336b, 0x798c, 0x2001, 0x194e, 0x918c, 0x8000,
+	0x2102, 0x080c, 0x48a0, 0x0904, 0x336e, 0x080c, 0x656b, 0x0120,
+	0x080c, 0x6573, 0x1904, 0x336e, 0x080c, 0x630e, 0x0904, 0x336b,
+	0x0126, 0x2091, 0x8000, 0x080c, 0x63d4, 0x012e, 0x0904, 0x336b,
+	0x2001, 0x194e, 0x2004, 0xd0fc, 0x1904, 0x3339, 0x0804, 0x430e,
+	0xa9a0, 0x2001, 0x194e, 0x918c, 0x8000, 0xc18d, 0x2102, 0x080c,
+	0x48ad, 0x01a0, 0x080c, 0x656b, 0x0118, 0x080c, 0x6573, 0x1170,
+	0x080c, 0x630e, 0x2009, 0x0002, 0x0128, 0x080c, 0x63d4, 0x1170,
+	0x2009, 0x0003, 0xa897, 0x4005, 0xa99a, 0x0010, 0xa897, 0x4006,
+	0x900e, 0x9085, 0x0001, 0x2001, 0x0030, 0x0005, 0xa897, 0x4000,
+	0x2001, 0x194e, 0x2004, 0xd0fc, 0x1128, 0x080c, 0x5397, 0x0110,
+	0x9006, 0x0018, 0x900e, 0x9085, 0x0001, 0x2001, 0x0000, 0x0005,
+	0x78a8, 0xd08c, 0x1118, 0xd084, 0x0904, 0x4283, 0x080c, 0x48bc,
+	0x0904, 0x336e, 0x080c, 0x4889, 0x1120, 0x2009, 0x0002, 0x0804,
+	0x336b, 0x080c, 0x656b, 0x0130, 0x908e, 0x0004, 0x0118, 0x908e,
+	0x0005, 0x15a0, 0x78a8, 0xd08c, 0x0120, 0xb800, 0xc08c, 0xb802,
+	0x0028, 0x080c, 0x538f, 0xd0b4, 0x0904, 0x42bd, 0x7884, 0x908e,
+	0x007e, 0x0904, 0x42bd, 0x908e, 0x007f, 0x0904, 0x42bd, 0x908e,
+	0x0080, 0x0904, 0x42bd, 0xb800, 0xd08c, 0x1904, 0x42bd, 0xa867,
+	0x0000, 0xa868, 0xc0fd, 0xa86a, 0x080c, 0xbcf5, 0x1120, 0x2009,
+	0x0003, 0x0804, 0x336b, 0x7007, 0x0003, 0x701f, 0x4fb0, 0x0005,
+	0x080c, 0x48bc, 0x0904, 0x336e, 0x0804, 0x42bd, 0x080c, 0x3130,
+	0x0108, 0x0005, 0x2009, 0x1833, 0x210c, 0x81ff, 0x0120, 0x2009,
+	0x0001, 0x0804, 0x336b, 0x080c, 0x53a3, 0x0120, 0x2009, 0x0007,
+	0x0804, 0x336b, 0x080c, 0x6563, 0x0120, 0x2009, 0x0008, 0x0804,
+	0x336b, 0xb89c, 0xd0a4, 0x1118, 0xd0ac, 0x1904, 0x42bd, 0x9006,
+	0xa866, 0xa832, 0xa868, 0xc0fd, 0xa86a, 0x080c, 0xbd54, 0x1120,
+	0x2009, 0x0003, 0x0804, 0x336b, 0x7007, 0x0003, 0x701f, 0x4fe9,
+	0x0005, 0xa830, 0x9086, 0x0100, 0x1120, 0x2009, 0x0004, 0x0804,
+	0x52ec, 0x080c, 0x48bc, 0x0904, 0x336e, 0x0804, 0x4f82, 0x81ff,
+	0x2009, 0x0001, 0x1904, 0x336b, 0x080c, 0x53a3, 0x2009, 0x0007,
+	0x1904, 0x336b, 0x080c, 0x6563, 0x0120, 0x2009, 0x0008, 0x0804,
+	0x336b, 0x080c, 0x48bc, 0x0904, 0x336e, 0x080c, 0x656b, 0x2009,
+	0x0009, 0x1904, 0x336b, 0x080c, 0x4889, 0x2009, 0x0002, 0x0904,
+	0x336b, 0x9006, 0xa866, 0xa832, 0xa868, 0xc0fd, 0xa86a, 0x7988,
+	0x9194, 0xff00, 0x918c, 0x00ff, 0x9006, 0x82ff, 0x1128, 0xc0ed,
+	0xa952, 0x798c, 0xa956, 0x0038, 0x928e, 0x0100, 0x1904, 0x336e,
+	0xc0e5, 0xa952, 0xa956, 0xa83e, 0x080c, 0xbfa7, 0x2009, 0x0003,
+	0x0904, 0x336b, 0x7007, 0x0003, 0x701f, 0x503f, 0x0005, 0xa830,
+	0x9086, 0x0100, 0x2009, 0x0004, 0x0904, 0x336b, 0x0804, 0x3339,
+	0x7aa8, 0x9284, 0xc000, 0x0148, 0xd2ec, 0x01a0, 0x080c, 0x53a3,
+	0x1188, 0x2009, 0x0014, 0x0804, 0x336b, 0xd2dc, 0x1568, 0x81ff,
+	0x2009, 0x0001, 0x1904, 0x336b, 0x080c, 0x53a3, 0x2009, 0x0007,
+	0x1904, 0x336b, 0xd2f4, 0x0130, 0x9284, 0x5000, 0x080c, 0x536a,
+	0x0804, 0x3339, 0xd2fc, 0x0158, 0x080c, 0x48bc, 0x0904, 0x336e,
+	0x7984, 0x9284, 0x9000, 0x080c, 0x5347, 0x0804, 0x3339, 0x080c,
+	0x48bc, 0x0904, 0x336e, 0xb804, 0x9084, 0x00ff, 0x9086, 0x0006,
+	0x2009, 0x0009, 0x1904, 0x5128, 0x080c, 0x4889, 0x2009, 0x0002,
+	0x0904, 0x5128, 0xa85c, 0x9080, 0x001b, 0xaf60, 0x2009, 0x0008,
+	0x7a8c, 0x7b88, 0x7c9c, 0x7d98, 0x080c, 0x48d2, 0x701f, 0x5099,
+	0x0005, 0xa86c, 0x9086, 0x0500, 0x1138, 0xa870, 0x9005, 0x1120,
+	0xa874, 0x9084, 0xff00, 0x0110, 0x1904, 0x336e, 0xa866, 0xa832,
+	0xa868, 0xc0fd, 0xa86a, 0x080c, 0x48bc, 0x1110, 0x0804, 0x336e,
+	0x2009, 0x0043, 0x080c, 0xc00f, 0x2009, 0x0003, 0x0904, 0x5128,
+	0x7007, 0x0003, 0x701f, 0x50bd, 0x0005, 0xa830, 0x9086, 0x0100,
+	0x2009, 0x0004, 0x0904, 0x5128, 0x7984, 0x7aa8, 0x9284, 0x1000,
+	0x080c, 0x5347, 0x0804, 0x3339, 0x00c6, 0xaab0, 0x9284, 0xc000,
+	0x0140, 0xd2ec, 0x0168, 0x080c, 0x53a3, 0x1150, 0x2009, 0x0014,
+	0x04f0, 0x2061, 0x1800, 0x080c, 0x53a3, 0x2009, 0x0007, 0x15b8,
+	0xd2f4, 0x0128, 0x9284, 0x5000, 0x080c, 0x536a, 0x0050, 0xd2fc,
+	0x0178, 0x080c, 0x48ba, 0x0588, 0xa998, 0x9284, 0x9000, 0x080c,
+	0x5347, 0xa87b, 0x0000, 0xa883, 0x0000, 0xa897, 0x4000, 0x0438,
+	0x080c, 0x48ba, 0x0510, 0x080c, 0x656b, 0x2009, 0x0009, 0x11b8,
+	0xa8c4, 0x9086, 0x0500, 0x11c8, 0xa8c8, 0x9005, 0x11b0, 0xa8cc,
+	0x9084, 0xff00, 0x1190, 0x080c, 0x48ba, 0x1108, 0x0070, 0x2009,
+	0x004b, 0x080c, 0xc00f, 0x2009, 0x0003, 0x0108, 0x0078, 0x0429,
+	0x19c0, 0xa897, 0x4005, 0xa99a, 0x0010, 0xa897, 0x4006, 0x900e,
+	0x9085, 0x0001, 0x2001, 0x0030, 0x00ce, 0x0005, 0x9006, 0x0ce0,
+	0x7aa8, 0xd2dc, 0x0904, 0x336b, 0x0016, 0x7984, 0x9284, 0x1000,
+	0xc0fd, 0x080c, 0x5347, 0x001e, 0x1904, 0x336b, 0x0804, 0x3339,
+	0x00f6, 0x2d78, 0x0011, 0x00fe, 0x0005, 0xaab0, 0xd2dc, 0x0150,
+	0x0016, 0xa998, 0x9284, 0x1000, 0xc0fd, 0x080c, 0x5347, 0x001e,
+	0x9085, 0x0001, 0x0005, 0x81ff, 0x0120, 0x2009, 0x0001, 0x0804,
+	0x336b, 0x080c, 0x53a3, 0x0120, 0x2009, 0x0007, 0x0804, 0x336b,
+	0x7984, 0x7ea8, 0x96b4, 0x00ff, 0x080c, 0x6247, 0x1904, 0x336e,
+	0x9186, 0x007f, 0x0138, 0x080c, 0x656b, 0x0120, 0x2009, 0x0009,
+	0x0804, 0x336b, 0x080c, 0x4889, 0x1120, 0x2009, 0x0002, 0x0804,
+	0x336b, 0xa867, 0x0000, 0xa868, 0xc0fd, 0xa86a, 0x2001, 0x0100,
+	0x8007, 0xa80a, 0x080c, 0xbd0f, 0x1120, 0x2009, 0x0003, 0x0804,
+	0x336b, 0x7007, 0x0003, 0x701f, 0x5186, 0x0005, 0xa808, 0x8007,
+	0x9086, 0x0100, 0x1120, 0x2009, 0x0004, 0x0804, 0x336b, 0xa8e0,
+	0xa866, 0xa810, 0x8007, 0x9084, 0x00ff, 0x800c, 0xa814, 0x8007,
+	0x9084, 0x00ff, 0x8004, 0x9080, 0x0002, 0x9108, 0x8906, 0x8006,
+	0x8007, 0x90bc, 0x003f, 0x9084, 0xffc0, 0x9080, 0x0004, 0x7a8c,
+	0x7b88, 0x7c9c, 0x7d98, 0x0804, 0x48d5, 0x080c, 0x4889, 0x1120,
+	0x2009, 0x0002, 0x0804, 0x336b, 0x7984, 0x9194, 0xff00, 0x918c,
+	0x00ff, 0x8217, 0x82ff, 0x1118, 0x7023, 0x1983, 0x0040, 0x92c6,
+	0x0001, 0x1118, 0x7023, 0x199d, 0x0010, 0x0804, 0x336e, 0x2009,
+	0x001a, 0x7a8c, 0x7b88, 0x7c9c, 0x7d98, 0xa85c, 0x9080, 0x0019,
+	0xaf60, 0x080c, 0x48d2, 0x701f, 0x51d6, 0x0005, 0x2001, 0x182d,
+	0x2003, 0x0001, 0xa85c, 0x9080, 0x0019, 0x2098, 0xa860, 0x20e0,
+	0x20a9, 0x001a, 0x7020, 0x20a0, 0x20e9, 0x0001, 0x4003, 0x0804,
+	0x3339, 0x080c, 0x4889, 0x1120, 0x2009, 0x0002, 0x0804, 0x336b,
+	0x7984, 0x9194, 0xff00, 0x918c, 0x00ff, 0x8217, 0x82ff, 0x1118,
+	0x2099, 0x1983, 0x0040, 0x92c6, 0x0001, 0x1118, 0x2099, 0x199d,
+	0x0010, 0x0804, 0x336e, 0xa85c, 0x9080, 0x0019, 0x20a0, 0xa860,
+	0x20e8, 0x20a9, 0x001a, 0x20e1, 0x0001, 0x4003, 0x2009, 0x001a,
 	0x7a8c, 0x7b88, 0x7c9c, 0x7d98, 0xa85c, 0x9080, 0x0019, 0xaf60,
-	0x080c, 0x48c2, 0x701f, 0x51cd, 0x0005, 0x2001, 0x182d, 0x2003,
-	0x0001, 0xa85c, 0x9080, 0x0019, 0x2098, 0xa860, 0x20e0, 0x20a9,
-	0x001a, 0x7020, 0x20a0, 0x20e9, 0x0001, 0x4003, 0x0804, 0x3337,
-	0x080c, 0x4879, 0x1120, 0x2009, 0x0002, 0x0804, 0x3369, 0x7984,
-	0x9194, 0xff00, 0x918c, 0x00ff, 0x8217, 0x82ff, 0x1118, 0x2099,
-	0x1984, 0x0040, 0x92c6, 0x0001, 0x1118, 0x2099, 0x199e, 0x0010,
-	0x0804, 0x336c, 0xa85c, 0x9080, 0x0019, 0x20a0, 0xa860, 0x20e8,
-	0x20a9, 0x001a, 0x20e1, 0x0001, 0x4003, 0x2009, 0x001a, 0x7a8c,
-	0x7b88, 0x7c9c, 0x7d98, 0xa85c, 0x9080, 0x0019, 0xaf60, 0x0804,
-	0x48c5, 0x7884, 0x908a, 0x1000, 0x1a04, 0x336c, 0x0126, 0x2091,
-	0x8000, 0x8003, 0x800b, 0x810b, 0x9108, 0x00c6, 0x2061, 0x19cb,
-	0x6142, 0x00ce, 0x012e, 0x0804, 0x3337, 0x00c6, 0x080c, 0x6fb2,
-	0x1160, 0x080c, 0x7296, 0x080c, 0x5cd1, 0x9085, 0x0001, 0x080c,
-	0x6ff9, 0x080c, 0x6ee4, 0x080c, 0x0db4, 0x2061, 0x1800, 0x6030,
-	0xc09d, 0x6032, 0x080c, 0x5b90, 0x00ce, 0x0005, 0x00c6, 0x2001,
-	0x1800, 0x2004, 0x908e, 0x0000, 0x0904, 0x3369, 0x7884, 0x9005,
-	0x0188, 0x7888, 0x2061, 0x196d, 0x2c0c, 0x2062, 0x080c, 0x2a45,
-	0x01a0, 0x080c, 0x2a4d, 0x0188, 0x080c, 0x2a55, 0x0170, 0x2162,
-	0x0804, 0x336c, 0x2061, 0x0100, 0x6038, 0x9086, 0x0007, 0x1118,
-	0x2009, 0x0001, 0x0010, 0x2009, 0x0000, 0x7884, 0x9086, 0x0002,
-	0x1548, 0x2061, 0x0100, 0x6028, 0xc09c, 0x602a, 0x0026, 0x2011,
-	0x0003, 0x080c, 0x9771, 0x2011, 0x0002, 0x080c, 0x977b, 0x002e,
-	0x080c, 0x9662, 0x0036, 0x901e, 0x080c, 0x96d8, 0x003e, 0x60e3,
-	0x0000, 0x080c, 0xd8b4, 0x080c, 0xd8cf, 0x9085, 0x0001, 0x080c,
-	0x6ff9, 0x9006, 0x080c, 0x2b14, 0x2001, 0x1800, 0x2003, 0x0004,
-	0x6027, 0x0008, 0x00ce, 0x0804, 0x3337, 0x81ff, 0x0120, 0x2009,
-	0x0001, 0x0804, 0x3369, 0x080c, 0x539a, 0x0120, 0x2009, 0x0007,
-	0x0804, 0x3369, 0x7984, 0x7ea8, 0x96b4, 0x00ff, 0x080c, 0x623e,
-	0x1904, 0x336c, 0x9186, 0x007f, 0x0138, 0x080c, 0x6562, 0x0120,
-	0x2009, 0x0009, 0x0804, 0x3369, 0x080c, 0x4879, 0x1120, 0x2009,
-	0x0002, 0x0804, 0x3369, 0xa867, 0x0000, 0xa868, 0xc0fd, 0xa86a,
-	0x080c, 0xbcfd, 0x1120, 0x2009, 0x0003, 0x0804, 0x3369, 0x7007,
-	0x0003, 0x701f, 0x52cc, 0x0005, 0xa830, 0x9086, 0x0100, 0x1120,
-	0x2009, 0x0004, 0x0804, 0x3369, 0xa8e0, 0xa866, 0xa834, 0x8007,
-	0x800c, 0xa85c, 0x9080, 0x000c, 0x7a8c, 0x7b88, 0x7c9c, 0x7d98,
-	0xaf60, 0x0804, 0x48c5, 0xa898, 0x9086, 0x000d, 0x1904, 0x3369,
-	0x2021, 0x4005, 0x0126, 0x2091, 0x8000, 0x0e04, 0x52f0, 0x0010,
-	0x012e, 0x0cc0, 0x7c36, 0x9486, 0x4000, 0x0118, 0x7833, 0x0011,
-	0x0010, 0x7833, 0x0010, 0x7883, 0x4005, 0xa998, 0x7986, 0xa9a4,
-	0x799a, 0xa9a8, 0x799e, 0x080c, 0x48b5, 0x2091, 0x4080, 0x2001,
-	0x0089, 0x2004, 0xd084, 0x190c, 0x1187, 0x7007, 0x0001, 0x2091,
-	0x5000, 0x700f, 0x0000, 0x012e, 0x0005, 0x0126, 0x2091, 0x8000,
-	0x00c6, 0x2061, 0x19cb, 0x7984, 0x6152, 0x614e, 0x6057, 0x0000,
-	0x604b, 0x0009, 0x7898, 0x606a, 0x789c, 0x6066, 0x7888, 0x6062,
-	0x788c, 0x605e, 0x2001, 0x19d9, 0x2044, 0x2001, 0x19e0, 0xa076,
-	0xa060, 0xa072, 0xa07b, 0x0001, 0xa07f, 0x0002, 0xa06b, 0x0000,
-	0xa09f, 0x0000, 0x00ce, 0x012e, 0x0804, 0x3337, 0x0126, 0x2091,
-	0x8000, 0x00b6, 0x00c6, 0x90e4, 0xc000, 0x0128, 0x0006, 0x080c,
-	0xbb64, 0x000e, 0x1198, 0xd0e4, 0x0160, 0x9180, 0x1000, 0x2004,
-	0x905d, 0x0160, 0x080c, 0x5ceb, 0x080c, 0x9db1, 0x0110, 0xb817,
-	0x0000, 0x9006, 0x00ce, 0x00be, 0x012e, 0x0005, 0x9085, 0x0001,
-	0x0cc8, 0x0126, 0x2091, 0x8000, 0x0156, 0x2010, 0x900e, 0x20a9,
-	0x0800, 0x0016, 0x9180, 0x1000, 0x2004, 0x9005, 0x0180, 0x9186,
-	0x007e, 0x0168, 0x9186, 0x007f, 0x0150, 0x9186, 0x0080, 0x0138,
-	0x9186, 0x00ff, 0x0120, 0x0026, 0x2200, 0x0801, 0x002e, 0x001e,
-	0x8108, 0x1f04, 0x5369, 0x015e, 0x012e, 0x0005, 0x2001, 0x1854,
-	0x2004, 0x0005, 0x2001, 0x1873, 0x2004, 0x0005, 0x0006, 0x2001,
-	0x1810, 0x2004, 0xd0d4, 0x000e, 0x0005, 0x2001, 0x180e, 0x2004,
-	0xd0b4, 0x0005, 0x2001, 0x1800, 0x2004, 0x9086, 0x0003, 0x0005,
-	0x0016, 0x00e6, 0x2071, 0x1894, 0x7108, 0x910d, 0x710a, 0x00ee,
-	0x001e, 0x0005, 0x79a4, 0x9182, 0x0081, 0x1a04, 0x336c, 0x810c,
-	0x0016, 0x080c, 0x4879, 0x080c, 0x0ef3, 0x2100, 0x2238, 0x7d84,
-	0x7c88, 0x7b8c, 0x7a90, 0x001e, 0x080c, 0x48c2, 0x701f, 0x53c1,
-	0x0005, 0x2079, 0x0000, 0x7d94, 0x7c98, 0x7ba8, 0x7aac, 0x79a4,
-	0x810c, 0x2061, 0x18ae, 0x2c44, 0xa770, 0xa074, 0x2071, 0x1894,
-	0x080c, 0x48c5, 0x701f, 0x53d5, 0x0005, 0x2061, 0x18ae, 0x2c44,
-	0x0016, 0x0026, 0xa270, 0xa174, 0x080c, 0x0efb, 0x002e, 0x001e,
-	0x080c, 0x0fa8, 0x9006, 0xa802, 0xa806, 0x0804, 0x3337, 0x0126,
-	0x0156, 0x0136, 0x0146, 0x01c6, 0x01d6, 0x00c6, 0x00d6, 0x00e6,
-	0x00f6, 0x2061, 0x0100, 0x2069, 0x0200, 0x2071, 0x1800, 0x6044,
-	0xd0a4, 0x11e8, 0xd084, 0x0118, 0x080c, 0x5590, 0x0068, 0xd08c,
-	0x0118, 0x080c, 0x5499, 0x0040, 0xd094, 0x0118, 0x080c, 0x5469,
-	0x0018, 0xd09c, 0x0108, 0x0099, 0x00fe, 0x00ee, 0x00de, 0x00ce,
-	0x01de, 0x01ce, 0x014e, 0x013e, 0x015e, 0x012e, 0x0005, 0x0016,
-	0x6128, 0xd19c, 0x1110, 0xc19d, 0x612a, 0x001e, 0x0c68, 0x0006,
-	0x7094, 0x9005, 0x000e, 0x0120, 0x7097, 0x0000, 0x708f, 0x0000,
-	0x624c, 0x9286, 0xf0f0, 0x1150, 0x6048, 0x9086, 0xf0f0, 0x0130,
-	0x624a, 0x6043, 0x0090, 0x6043, 0x0010, 0x0490, 0x9294, 0xff00,
-	0x9296, 0xf700, 0x0178, 0x7138, 0xd1a4, 0x1160, 0x6240, 0x9295,
-	0x0100, 0x6242, 0x9294, 0x0010, 0x0128, 0x2009, 0x00f7, 0x080c,
-	0x5c4d, 0x00f0, 0x6040, 0x9084, 0x0010, 0x9085, 0x0140, 0x6042,
-	0x6043, 0x0000, 0x7083, 0x0000, 0x709f, 0x0001, 0x70c3, 0x0000,
-	0x70db, 0x0000, 0x2009, 0x1c80, 0x200b, 0x0000, 0x7093, 0x0000,
-	0x7087, 0x000f, 0x2009, 0x000f, 0x2011, 0x5b33, 0x080c, 0x80ca,
-	0x0005, 0x2001, 0x1875, 0x2004, 0xd08c, 0x0110, 0x705b, 0xffff,
-	0x7084, 0x9005, 0x1528, 0x2011, 0x5b33, 0x080c, 0x8038, 0x6040,
-	0x9094, 0x0010, 0x9285, 0x0020, 0x6042, 0x20a9, 0x00c8, 0x6044,
-	0xd08c, 0x1168, 0x1f04, 0x547f, 0x6242, 0x7097, 0x0000, 0x6040,
-	0x9094, 0x0010, 0x9285, 0x0080, 0x6042, 0x6242, 0x0048, 0x6242,
-	0x7097, 0x0000, 0x708b, 0x0000, 0x9006, 0x080c, 0x5cd6, 0x0000,
-	0x0005, 0x7088, 0x908a, 0x0003, 0x1a0c, 0x0db4, 0x000b, 0x0005,
-	0x54a3, 0x54f4, 0x558f, 0x00f6, 0x0016, 0x6900, 0x918c, 0x0800,
-	0x708b, 0x0001, 0x2001, 0x015d, 0x2003, 0x0000, 0x6803, 0x00fc,
-	0x20a9, 0x0004, 0x6800, 0x9084, 0x00fc, 0x0120, 0x1f04, 0x54b2,
-	0x080c, 0x0db4, 0x68a0, 0x68a2, 0x689c, 0x689e, 0x6898, 0x689a,
-	0xa001, 0x918d, 0x1600, 0x6902, 0x001e, 0x6837, 0x0020, 0x080c,
-	0x5cb2, 0x2079, 0x1c00, 0x7833, 0x1101, 0x7837, 0x0000, 0x20e1,
-	0x0001, 0x2099, 0x1805, 0x20e9, 0x0001, 0x20a1, 0x1c0e, 0x20a9,
-	0x0004, 0x4003, 0x080c, 0x9c3f, 0x20e1, 0x0001, 0x2099, 0x1c00,
-	0x20e9, 0x0000, 0x20a1, 0x0240, 0x20a9, 0x0014, 0x4003, 0x60c3,
-	0x000c, 0x600f, 0x0000, 0x080c, 0x5b64, 0x00fe, 0x9006, 0x708e,
-	0x6043, 0x0008, 0x6042, 0x0005, 0x00f6, 0x708c, 0x708f, 0x0000,
-	0x9025, 0x0904, 0x556c, 0x6020, 0xd0b4, 0x1904, 0x556a, 0x719c,
-	0x81ff, 0x0904, 0x5558, 0x9486, 0x000c, 0x1904, 0x5565, 0x9480,
-	0x0018, 0x8004, 0x20a8, 0x080c, 0x5cab, 0x2011, 0x0260, 0x2019,
-	0x1c00, 0x220c, 0x2304, 0x9106, 0x11e8, 0x8210, 0x8318, 0x1f04,
-	0x5511, 0x6043, 0x0004, 0x2061, 0x0140, 0x605b, 0xbc94, 0x605f,
-	0xf0f0, 0x2061, 0x0100, 0x6043, 0x0006, 0x708b, 0x0002, 0x7097,
-	0x0002, 0x2009, 0x07d0, 0x2011, 0x5b3a, 0x080c, 0x80ca, 0x080c,
-	0x5cb2, 0x04c0, 0x080c, 0x5cab, 0x2079, 0x0260, 0x7930, 0x918e,
-	0x1101, 0x1558, 0x7834, 0x9005, 0x1540, 0x7900, 0x918c, 0x00ff,
-	0x1118, 0x7804, 0x9005, 0x0190, 0x080c, 0x5cab, 0x2011, 0x026e,
-	0x2019, 0x1805, 0x20a9, 0x0004, 0x220c, 0x2304, 0x9102, 0x0230,
-	0x11a0, 0x8210, 0x8318, 0x1f04, 0x554c, 0x0078, 0x709f, 0x0000,
-	0x080c, 0x5cab, 0x20e1, 0x0000, 0x2099, 0x0260, 0x20e9, 0x0001,
-	0x20a1, 0x1c00, 0x20a9, 0x0014, 0x4003, 0x6043, 0x0008, 0x6043,
-	0x0000, 0x0010, 0x00fe, 0x0005, 0x6040, 0x9085, 0x0100, 0x6042,
-	0x6020, 0xd0b4, 0x1db8, 0x080c, 0x9c3f, 0x20e1, 0x0001, 0x2099,
+	0x0804, 0x48d5, 0x7884, 0x908a, 0x1000, 0x1a04, 0x336e, 0x0126,
+	0x2091, 0x8000, 0x8003, 0x800b, 0x810b, 0x9108, 0x00c6, 0x2061,
+	0x19ca, 0x6142, 0x00ce, 0x012e, 0x0804, 0x3339, 0x00c6, 0x080c,
+	0x6f9b, 0x1160, 0x080c, 0x727f, 0x080c, 0x5cda, 0x9085, 0x0001,
+	0x080c, 0x6fe2, 0x080c, 0x6ecd, 0x080c, 0x0db4, 0x2061, 0x1800,
+	0x6030, 0xc09d, 0x6032, 0x080c, 0x5b99, 0x00ce, 0x0005, 0x00c6,
+	0x2001, 0x1800, 0x2004, 0x908e, 0x0000, 0x0904, 0x336b, 0x7884,
+	0x9005, 0x0188, 0x7888, 0x2061, 0x196c, 0x2c0c, 0x2062, 0x080c,
+	0x2a47, 0x01a0, 0x080c, 0x2a4f, 0x0188, 0x080c, 0x2a57, 0x0170,
+	0x2162, 0x0804, 0x336e, 0x2061, 0x0100, 0x6038, 0x9086, 0x0007,
+	0x1118, 0x2009, 0x0001, 0x0010, 0x2009, 0x0000, 0x7884, 0x9086,
+	0x0002, 0x1548, 0x2061, 0x0100, 0x6028, 0xc09c, 0x602a, 0x0026,
+	0x2011, 0x0003, 0x080c, 0x9772, 0x2011, 0x0002, 0x080c, 0x977c,
+	0x002e, 0x080c, 0x9663, 0x0036, 0x901e, 0x080c, 0x96d9, 0x003e,
+	0x60e3, 0x0000, 0x080c, 0xd8d5, 0x080c, 0xd8f0, 0x9085, 0x0001,
+	0x080c, 0x6fe2, 0x9006, 0x080c, 0x2b16, 0x2001, 0x1800, 0x2003,
+	0x0004, 0x6027, 0x0008, 0x00ce, 0x0804, 0x3339, 0x81ff, 0x0120,
+	0x2009, 0x0001, 0x0804, 0x336b, 0x080c, 0x53a3, 0x0120, 0x2009,
+	0x0007, 0x0804, 0x336b, 0x7984, 0x7ea8, 0x96b4, 0x00ff, 0x080c,
+	0x6247, 0x1904, 0x336e, 0x9186, 0x007f, 0x0138, 0x080c, 0x656b,
+	0x0120, 0x2009, 0x0009, 0x0804, 0x336b, 0x080c, 0x4889, 0x1120,
+	0x2009, 0x0002, 0x0804, 0x336b, 0xa867, 0x0000, 0xa868, 0xc0fd,
+	0xa86a, 0x080c, 0xbd12, 0x1120, 0x2009, 0x0003, 0x0804, 0x336b,
+	0x7007, 0x0003, 0x701f, 0x52d5, 0x0005, 0xa830, 0x9086, 0x0100,
+	0x1120, 0x2009, 0x0004, 0x0804, 0x336b, 0xa8e0, 0xa866, 0xa834,
+	0x8007, 0x800c, 0xa85c, 0x9080, 0x000c, 0x7a8c, 0x7b88, 0x7c9c,
+	0x7d98, 0xaf60, 0x0804, 0x48d5, 0xa898, 0x9086, 0x000d, 0x1904,
+	0x336b, 0x2021, 0x4005, 0x0126, 0x2091, 0x8000, 0x0e04, 0x52f9,
+	0x0010, 0x012e, 0x0cc0, 0x7c36, 0x9486, 0x4000, 0x0118, 0x7833,
+	0x0011, 0x0010, 0x7833, 0x0010, 0x7883, 0x4005, 0xa998, 0x7986,
+	0xa9a4, 0x799a, 0xa9a8, 0x799e, 0x080c, 0x48c5, 0x2091, 0x4080,
+	0x2001, 0x0089, 0x2004, 0xd084, 0x190c, 0x1187, 0x7007, 0x0001,
+	0x2091, 0x5000, 0x700f, 0x0000, 0x012e, 0x0005, 0x0126, 0x2091,
+	0x8000, 0x00c6, 0x2061, 0x19ca, 0x7984, 0x6152, 0x614e, 0x6057,
+	0x0000, 0x604b, 0x0009, 0x7898, 0x606a, 0x789c, 0x6066, 0x7888,
+	0x6062, 0x788c, 0x605e, 0x2001, 0x19d8, 0x2044, 0x2001, 0x19df,
+	0xa076, 0xa060, 0xa072, 0xa07b, 0x0001, 0xa07f, 0x0002, 0xa06b,
+	0x0000, 0xa09f, 0x0000, 0x00ce, 0x012e, 0x0804, 0x3339, 0x0126,
+	0x2091, 0x8000, 0x00b6, 0x00c6, 0x90e4, 0xc000, 0x0128, 0x0006,
+	0x080c, 0xbb79, 0x000e, 0x1198, 0xd0e4, 0x0160, 0x9180, 0x1000,
+	0x2004, 0x905d, 0x0160, 0x080c, 0x5cf4, 0x080c, 0x9dc1, 0x0110,
+	0xb817, 0x0000, 0x9006, 0x00ce, 0x00be, 0x012e, 0x0005, 0x9085,
+	0x0001, 0x0cc8, 0x0126, 0x2091, 0x8000, 0x0156, 0x2010, 0x900e,
+	0x20a9, 0x0800, 0x0016, 0x9180, 0x1000, 0x2004, 0x9005, 0x0180,
+	0x9186, 0x007e, 0x0168, 0x9186, 0x007f, 0x0150, 0x9186, 0x0080,
+	0x0138, 0x9186, 0x00ff, 0x0120, 0x0026, 0x2200, 0x0801, 0x002e,
+	0x001e, 0x8108, 0x1f04, 0x5372, 0x015e, 0x012e, 0x0005, 0x2001,
+	0x1854, 0x2004, 0x0005, 0x2001, 0x1873, 0x2004, 0x0005, 0x0006,
+	0x2001, 0x1810, 0x2004, 0xd0d4, 0x000e, 0x0005, 0x2001, 0x180e,
+	0x2004, 0xd0b4, 0x0005, 0x2001, 0x1800, 0x2004, 0x9086, 0x0003,
+	0x0005, 0x0016, 0x00e6, 0x2071, 0x1894, 0x7108, 0x910d, 0x710a,
+	0x00ee, 0x001e, 0x0005, 0x79a4, 0x9182, 0x0081, 0x1a04, 0x336e,
+	0x810c, 0x0016, 0x080c, 0x4889, 0x080c, 0x0ef3, 0x2100, 0x2238,
+	0x7d84, 0x7c88, 0x7b8c, 0x7a90, 0x001e, 0x080c, 0x48d2, 0x701f,
+	0x53ca, 0x0005, 0x2079, 0x0000, 0x7d94, 0x7c98, 0x7ba8, 0x7aac,
+	0x79a4, 0x810c, 0x2061, 0x18ae, 0x2c44, 0xa770, 0xa074, 0x2071,
+	0x1894, 0x080c, 0x48d5, 0x701f, 0x53de, 0x0005, 0x2061, 0x18ae,
+	0x2c44, 0x0016, 0x0026, 0xa270, 0xa174, 0x080c, 0x0efb, 0x002e,
+	0x001e, 0x080c, 0x0fa8, 0x9006, 0xa802, 0xa806, 0x0804, 0x3339,
+	0x0126, 0x0156, 0x0136, 0x0146, 0x01c6, 0x01d6, 0x00c6, 0x00d6,
+	0x00e6, 0x00f6, 0x2061, 0x0100, 0x2069, 0x0200, 0x2071, 0x1800,
+	0x6044, 0xd0a4, 0x11e8, 0xd084, 0x0118, 0x080c, 0x5599, 0x0068,
+	0xd08c, 0x0118, 0x080c, 0x54a2, 0x0040, 0xd094, 0x0118, 0x080c,
+	0x5472, 0x0018, 0xd09c, 0x0108, 0x0099, 0x00fe, 0x00ee, 0x00de,
+	0x00ce, 0x01de, 0x01ce, 0x014e, 0x013e, 0x015e, 0x012e, 0x0005,
+	0x0016, 0x6128, 0xd19c, 0x1110, 0xc19d, 0x612a, 0x001e, 0x0c68,
+	0x0006, 0x7094, 0x9005, 0x000e, 0x0120, 0x7097, 0x0000, 0x708f,
+	0x0000, 0x624c, 0x9286, 0xf0f0, 0x1150, 0x6048, 0x9086, 0xf0f0,
+	0x0130, 0x624a, 0x6043, 0x0090, 0x6043, 0x0010, 0x0490, 0x9294,
+	0xff00, 0x9296, 0xf700, 0x0178, 0x7138, 0xd1a4, 0x1160, 0x6240,
+	0x9295, 0x0100, 0x6242, 0x9294, 0x0010, 0x0128, 0x2009, 0x00f7,
+	0x080c, 0x5c56, 0x00f0, 0x6040, 0x9084, 0x0010, 0x9085, 0x0140,
+	0x6042, 0x6043, 0x0000, 0x7083, 0x0000, 0x709f, 0x0001, 0x70c3,
+	0x0000, 0x70db, 0x0000, 0x2009, 0x1c80, 0x200b, 0x0000, 0x7093,
+	0x0000, 0x7087, 0x000f, 0x2009, 0x000f, 0x2011, 0x5b3c, 0x080c,
+	0x80b3, 0x0005, 0x2001, 0x1875, 0x2004, 0xd08c, 0x0110, 0x705b,
+	0xffff, 0x7084, 0x9005, 0x1528, 0x2011, 0x5b3c, 0x080c, 0x8021,
+	0x6040, 0x9094, 0x0010, 0x9285, 0x0020, 0x6042, 0x20a9, 0x00c8,
+	0x6044, 0xd08c, 0x1168, 0x1f04, 0x5488, 0x6242, 0x7097, 0x0000,
+	0x6040, 0x9094, 0x0010, 0x9285, 0x0080, 0x6042, 0x6242, 0x0048,
+	0x6242, 0x7097, 0x0000, 0x708b, 0x0000, 0x9006, 0x080c, 0x5cdf,
+	0x0000, 0x0005, 0x7088, 0x908a, 0x0003, 0x1a0c, 0x0db4, 0x000b,
+	0x0005, 0x54ac, 0x54fd, 0x5598, 0x00f6, 0x0016, 0x6900, 0x918c,
+	0x0800, 0x708b, 0x0001, 0x2001, 0x015d, 0x2003, 0x0000, 0x6803,
+	0x00fc, 0x20a9, 0x0004, 0x6800, 0x9084, 0x00fc, 0x0120, 0x1f04,
+	0x54bb, 0x080c, 0x0db4, 0x68a0, 0x68a2, 0x689c, 0x689e, 0x6898,
+	0x689a, 0xa001, 0x918d, 0x1600, 0x6902, 0x001e, 0x6837, 0x0020,
+	0x080c, 0x5cbb, 0x2079, 0x1c00, 0x7833, 0x1101, 0x7837, 0x0000,
+	0x20e1, 0x0001, 0x2099, 0x1805, 0x20e9, 0x0001, 0x20a1, 0x1c0e,
+	0x20a9, 0x0004, 0x4003, 0x080c, 0x9c4a, 0x20e1, 0x0001, 0x2099,
 	0x1c00, 0x20e9, 0x0000, 0x20a1, 0x0240, 0x20a9, 0x0014, 0x4003,
-	0x60c3, 0x000c, 0x2011, 0x19c2, 0x2013, 0x0000, 0x708f, 0x0000,
-	0x60a3, 0x0056, 0x60a7, 0x9575, 0x080c, 0x93a3, 0x08d8, 0x0005,
-	0x7094, 0x908a, 0x001d, 0x1a0c, 0x0db4, 0x000b, 0x0005, 0x55c1,
-	0x55d4, 0x55fd, 0x561d, 0x5643, 0x5672, 0x5698, 0x56d0, 0x56f6,
-	0x5724, 0x575f, 0x5797, 0x57b5, 0x57e0, 0x5802, 0x581d, 0x5827,
-	0x585b, 0x5881, 0x58b0, 0x58d6, 0x590e, 0x5952, 0x598f, 0x59b0,
-	0x5a09, 0x5a2b, 0x5a59, 0x5a59, 0x00c6, 0x2061, 0x1800, 0x6003,
-	0x0007, 0x2061, 0x0100, 0x6004, 0x9084, 0xfff9, 0x6006, 0x00ce,
-	0x0005, 0x2061, 0x0140, 0x605b, 0xbc94, 0x605f, 0xf0f0, 0x2061,
-	0x0100, 0x6043, 0x0002, 0x7097, 0x0001, 0x2009, 0x07d0, 0x2011,
-	0x5b3a, 0x080c, 0x80ca, 0x0005, 0x00f6, 0x708c, 0x9086, 0x0014,
-	0x1510, 0x6042, 0x6020, 0xd0b4, 0x11f0, 0x080c, 0x5cab, 0x2079,
-	0x0260, 0x7a30, 0x9296, 0x1102, 0x11a0, 0x7834, 0x9005, 0x1188,
-	0x7a38, 0xd2fc, 0x0128, 0x70c0, 0x9005, 0x1110, 0x70c3, 0x0001,
-	0x2011, 0x5b3a, 0x080c, 0x8038, 0x7097, 0x0010, 0x080c, 0x5827,
-	0x0010, 0x708f, 0x0000, 0x00fe, 0x0005, 0x00f6, 0x7097, 0x0003,
-	0x6043, 0x0004, 0x2011, 0x5b3a, 0x080c, 0x8038, 0x080c, 0x5c2f,
-	0x2079, 0x0240, 0x7833, 0x1102, 0x7837, 0x0000, 0x20a9, 0x0008,
-	0x9f88, 0x000e, 0x200b, 0x0000, 0x8108, 0x1f04, 0x5612, 0x60c3,
-	0x0014, 0x080c, 0x5b64, 0x00fe, 0x0005, 0x00f6, 0x708c, 0x9005,
-	0x0500, 0x2011, 0x5b3a, 0x080c, 0x8038, 0x9086, 0x0014, 0x11b8,
-	0x080c, 0x5cab, 0x2079, 0x0260, 0x7a30, 0x9296, 0x1102, 0x1178,
-	0x7834, 0x9005, 0x1160, 0x7a38, 0xd2fc, 0x0128, 0x70c0, 0x9005,
-	0x1110, 0x70c3, 0x0001, 0x7097, 0x0004, 0x0029, 0x0010, 0x080c,
-	0x5c87, 0x00fe, 0x0005, 0x00f6, 0x7097, 0x0005, 0x080c, 0x5c2f,
-	0x2079, 0x0240, 0x7833, 0x1103, 0x7837, 0x0000, 0x080c, 0x5cab,
-	0x080c, 0x5c8e, 0x1170, 0x7080, 0x9005, 0x1158, 0x7158, 0x9186,
-	0xffff, 0x0138, 0x2011, 0x0008, 0x080c, 0x5ae7, 0x0168, 0x080c,
-	0x5c64, 0x20a9, 0x0008, 0x20e1, 0x0000, 0x2099, 0x026e, 0x20e9,
-	0x0000, 0x20a1, 0x024e, 0x4003, 0x60c3, 0x0014, 0x080c, 0x5b64,
-	0x00fe, 0x0005, 0x00f6, 0x708c, 0x9005, 0x0500, 0x2011, 0x5b3a,
-	0x080c, 0x8038, 0x9086, 0x0014, 0x11b8, 0x080c, 0x5cab, 0x2079,
-	0x0260, 0x7a30, 0x9296, 0x1103, 0x1178, 0x7834, 0x9005, 0x1160,
-	0x7a38, 0xd2fc, 0x0128, 0x70c0, 0x9005, 0x1110, 0x70c3, 0x0001,
-	0x7097, 0x0006, 0x0029, 0x0010, 0x080c, 0x5c87, 0x00fe, 0x0005,
-	0x00f6, 0x7097, 0x0007, 0x080c, 0x5c2f, 0x2079, 0x0240, 0x7833,
-	0x1104, 0x7837, 0x0000, 0x080c, 0x5cab, 0x080c, 0x5c8e, 0x11b8,
-	0x7080, 0x9005, 0x11a0, 0x7160, 0x9186, 0xffff, 0x0180, 0x9180,
-	0x3138, 0x200d, 0x918c, 0xff00, 0x810f, 0x2011, 0x0008, 0x080c,
-	0x5ae7, 0x0180, 0x080c, 0x4c98, 0x0110, 0x080c, 0x26cc, 0x20a9,
-	0x0008, 0x20e1, 0x0000, 0x2099, 0x026e, 0x20e9, 0x0000, 0x20a1,
-	0x024e, 0x4003, 0x60c3, 0x0014, 0x080c, 0x5b64, 0x00fe, 0x0005,
-	0x00f6, 0x708c, 0x9005, 0x0500, 0x2011, 0x5b3a, 0x080c, 0x8038,
-	0x9086, 0x0014, 0x11b8, 0x080c, 0x5cab, 0x2079, 0x0260, 0x7a30,
-	0x9296, 0x1104, 0x1178, 0x7834, 0x9005, 0x1160, 0x7a38, 0xd2fc,
-	0x0128, 0x70c0, 0x9005, 0x1110, 0x70c3, 0x0001, 0x7097, 0x0008,
-	0x0029, 0x0010, 0x080c, 0x5c87, 0x00fe, 0x0005, 0x00f6, 0x7097,
-	0x0009, 0x080c, 0x5c2f, 0x2079, 0x0240, 0x7833, 0x1105, 0x7837,
-	0x0100, 0x080c, 0x5c8e, 0x1150, 0x7080, 0x9005, 0x1138, 0x080c,
-	0x5a5a, 0x1188, 0x9085, 0x0001, 0x080c, 0x26cc, 0x20a9, 0x0008,
-	0x080c, 0x5cab, 0x20e1, 0x0000, 0x2099, 0x026e, 0x20e9, 0x0000,
-	0x20a1, 0x024e, 0x4003, 0x60c3, 0x0014, 0x080c, 0x5b64, 0x0010,
-	0x080c, 0x55b4, 0x00fe, 0x0005, 0x00f6, 0x708c, 0x9005, 0x05a8,
-	0x2011, 0x5b3a, 0x080c, 0x8038, 0x9086, 0x0014, 0x1560, 0x080c,
-	0x5cab, 0x2079, 0x0260, 0x7a30, 0x9296, 0x1105, 0x1520, 0x7834,
-	0x9084, 0x0100, 0x2011, 0x0100, 0x921e, 0x1160, 0x7a38, 0xd2fc,
-	0x0128, 0x70c0, 0x9005, 0x1110, 0x70c3, 0x0001, 0x7097, 0x000a,
-	0x00b1, 0x0098, 0x9005, 0x1178, 0x7a38, 0xd2fc, 0x0128, 0x70c0,
-	0x9005, 0x1110, 0x70c3, 0x0001, 0x7093, 0x0000, 0x7097, 0x000e,
-	0x080c, 0x5802, 0x0010, 0x080c, 0x5c87, 0x00fe, 0x0005, 0x00f6,
-	0x7097, 0x000b, 0x2011, 0x1c0e, 0x20e9, 0x0001, 0x22a0, 0x20a9,
-	0x0040, 0x2019, 0xffff, 0x4304, 0x080c, 0x5c2f, 0x2079, 0x0240,
-	0x7833, 0x1106, 0x7837, 0x0000, 0x080c, 0x5c8e, 0x0118, 0x2013,
-	0x0000, 0x0020, 0x705c, 0x9085, 0x0100, 0x2012, 0x20a9, 0x0040,
-	0x2009, 0x024e, 0x2011, 0x1c0e, 0x220e, 0x8210, 0x8108, 0x9186,
-	0x0260, 0x1128, 0x6810, 0x8000, 0x6812, 0x2009, 0x0240, 0x1f04,
-	0x5784, 0x60c3, 0x0084, 0x080c, 0x5b64, 0x00fe, 0x0005, 0x00f6,
-	0x708c, 0x9005, 0x01c0, 0x2011, 0x5b3a, 0x080c, 0x8038, 0x9086,
-	0x0084, 0x1178, 0x080c, 0x5cab, 0x2079, 0x0260, 0x7a30, 0x9296,
-	0x1106, 0x1138, 0x7834, 0x9005, 0x1120, 0x7097, 0x000c, 0x0029,
-	0x0010, 0x080c, 0x5c87, 0x00fe, 0x0005, 0x00f6, 0x7097, 0x000d,
-	0x080c, 0x5c2f, 0x2079, 0x0240, 0x7833, 0x1107, 0x7837, 0x0000,
-	0x080c, 0x5cab, 0x20a9, 0x0040, 0x2011, 0x026e, 0x2009, 0x024e,
-	0x220e, 0x8210, 0x8108, 0x9186, 0x0260, 0x1150, 0x6810, 0x8000,
-	0x6812, 0x2009, 0x0240, 0x6814, 0x8000, 0x6816, 0x2011, 0x0260,
-	0x1f04, 0x57c8, 0x60c3, 0x0084, 0x080c, 0x5b64, 0x00fe, 0x0005,
-	0x00f6, 0x708c, 0x9005, 0x01e0, 0x2011, 0x5b3a, 0x080c, 0x8038,
-	0x9086, 0x0084, 0x1198, 0x080c, 0x5cab, 0x2079, 0x0260, 0x7a30,
-	0x9296, 0x1107, 0x1158, 0x7834, 0x9005, 0x1140, 0x7093, 0x0001,
-	0x080c, 0x5c01, 0x7097, 0x000e, 0x0029, 0x0010, 0x080c, 0x5c87,
-	0x00fe, 0x0005, 0x918d, 0x0001, 0x080c, 0x5cd6, 0x7097, 0x000f,
-	0x708f, 0x0000, 0x2061, 0x0140, 0x605b, 0xbc85, 0x605f, 0xb5b5,
-	0x2061, 0x0100, 0x6043, 0x0005, 0x6043, 0x0004, 0x2009, 0x07d0,
-	0x2011, 0x5b3a, 0x080c, 0x802c, 0x0005, 0x708c, 0x9005, 0x0130,
-	0x2011, 0x5b3a, 0x080c, 0x8038, 0x7097, 0x0000, 0x0005, 0x7097,
-	0x0011, 0x080c, 0x9c3f, 0x080c, 0x5cab, 0x20e1, 0x0000, 0x2099,
-	0x0260, 0x20e9, 0x0000, 0x20a1, 0x0240, 0x748c, 0x9480, 0x0018,
-	0x9080, 0x0007, 0x9084, 0x03f8, 0x8004, 0x20a8, 0x4003, 0x080c,
-	0x5c8e, 0x11a0, 0x7178, 0x81ff, 0x0188, 0x900e, 0x707c, 0x9084,
-	0x00ff, 0x0160, 0x080c, 0x2663, 0x9186, 0x007e, 0x0138, 0x9186,
-	0x0080, 0x0120, 0x2011, 0x0008, 0x080c, 0x5ae7, 0x60c3, 0x0014,
-	0x080c, 0x5b64, 0x0005, 0x00f6, 0x708c, 0x9005, 0x0500, 0x2011,
-	0x5b3a, 0x080c, 0x8038, 0x9086, 0x0014, 0x11b8, 0x080c, 0x5cab,
+	0x60c3, 0x000c, 0x600f, 0x0000, 0x080c, 0x5b6d, 0x00fe, 0x9006,
+	0x708e, 0x6043, 0x0008, 0x6042, 0x0005, 0x00f6, 0x708c, 0x708f,
+	0x0000, 0x9025, 0x0904, 0x5575, 0x6020, 0xd0b4, 0x1904, 0x5573,
+	0x719c, 0x81ff, 0x0904, 0x5561, 0x9486, 0x000c, 0x1904, 0x556e,
+	0x9480, 0x0018, 0x8004, 0x20a8, 0x080c, 0x5cb4, 0x2011, 0x0260,
+	0x2019, 0x1c00, 0x220c, 0x2304, 0x9106, 0x11e8, 0x8210, 0x8318,
+	0x1f04, 0x551a, 0x6043, 0x0004, 0x2061, 0x0140, 0x605b, 0xbc94,
+	0x605f, 0xf0f0, 0x2061, 0x0100, 0x6043, 0x0006, 0x708b, 0x0002,
+	0x7097, 0x0002, 0x2009, 0x07d0, 0x2011, 0x5b43, 0x080c, 0x80b3,
+	0x080c, 0x5cbb, 0x04c0, 0x080c, 0x5cb4, 0x2079, 0x0260, 0x7930,
+	0x918e, 0x1101, 0x1558, 0x7834, 0x9005, 0x1540, 0x7900, 0x918c,
+	0x00ff, 0x1118, 0x7804, 0x9005, 0x0190, 0x080c, 0x5cb4, 0x2011,
+	0x026e, 0x2019, 0x1805, 0x20a9, 0x0004, 0x220c, 0x2304, 0x9102,
+	0x0230, 0x11a0, 0x8210, 0x8318, 0x1f04, 0x5555, 0x0078, 0x709f,
+	0x0000, 0x080c, 0x5cb4, 0x20e1, 0x0000, 0x2099, 0x0260, 0x20e9,
+	0x0001, 0x20a1, 0x1c00, 0x20a9, 0x0014, 0x4003, 0x6043, 0x0008,
+	0x6043, 0x0000, 0x0010, 0x00fe, 0x0005, 0x6040, 0x9085, 0x0100,
+	0x6042, 0x6020, 0xd0b4, 0x1db8, 0x080c, 0x9c4a, 0x20e1, 0x0001,
+	0x2099, 0x1c00, 0x20e9, 0x0000, 0x20a1, 0x0240, 0x20a9, 0x0014,
+	0x4003, 0x60c3, 0x000c, 0x2011, 0x19c1, 0x2013, 0x0000, 0x708f,
+	0x0000, 0x60a3, 0x0056, 0x60a7, 0x9575, 0x080c, 0x93a4, 0x08d8,
+	0x0005, 0x7094, 0x908a, 0x001d, 0x1a0c, 0x0db4, 0x000b, 0x0005,
+	0x55ca, 0x55dd, 0x5606, 0x5626, 0x564c, 0x567b, 0x56a1, 0x56d9,
+	0x56ff, 0x572d, 0x5768, 0x57a0, 0x57be, 0x57e9, 0x580b, 0x5826,
+	0x5830, 0x5864, 0x588a, 0x58b9, 0x58df, 0x5917, 0x595b, 0x5998,
+	0x59b9, 0x5a12, 0x5a34, 0x5a62, 0x5a62, 0x00c6, 0x2061, 0x1800,
+	0x6003, 0x0007, 0x2061, 0x0100, 0x6004, 0x9084, 0xfff9, 0x6006,
+	0x00ce, 0x0005, 0x2061, 0x0140, 0x605b, 0xbc94, 0x605f, 0xf0f0,
+	0x2061, 0x0100, 0x6043, 0x0002, 0x7097, 0x0001, 0x2009, 0x07d0,
+	0x2011, 0x5b43, 0x080c, 0x80b3, 0x0005, 0x00f6, 0x708c, 0x9086,
+	0x0014, 0x1510, 0x6042, 0x6020, 0xd0b4, 0x11f0, 0x080c, 0x5cb4,
+	0x2079, 0x0260, 0x7a30, 0x9296, 0x1102, 0x11a0, 0x7834, 0x9005,
+	0x1188, 0x7a38, 0xd2fc, 0x0128, 0x70c0, 0x9005, 0x1110, 0x70c3,
+	0x0001, 0x2011, 0x5b43, 0x080c, 0x8021, 0x7097, 0x0010, 0x080c,
+	0x5830, 0x0010, 0x708f, 0x0000, 0x00fe, 0x0005, 0x00f6, 0x7097,
+	0x0003, 0x6043, 0x0004, 0x2011, 0x5b43, 0x080c, 0x8021, 0x080c,
+	0x5c38, 0x2079, 0x0240, 0x7833, 0x1102, 0x7837, 0x0000, 0x20a9,
+	0x0008, 0x9f88, 0x000e, 0x200b, 0x0000, 0x8108, 0x1f04, 0x561b,
+	0x60c3, 0x0014, 0x080c, 0x5b6d, 0x00fe, 0x0005, 0x00f6, 0x708c,
+	0x9005, 0x0500, 0x2011, 0x5b43, 0x080c, 0x8021, 0x9086, 0x0014,
+	0x11b8, 0x080c, 0x5cb4, 0x2079, 0x0260, 0x7a30, 0x9296, 0x1102,
+	0x1178, 0x7834, 0x9005, 0x1160, 0x7a38, 0xd2fc, 0x0128, 0x70c0,
+	0x9005, 0x1110, 0x70c3, 0x0001, 0x7097, 0x0004, 0x0029, 0x0010,
+	0x080c, 0x5c90, 0x00fe, 0x0005, 0x00f6, 0x7097, 0x0005, 0x080c,
+	0x5c38, 0x2079, 0x0240, 0x7833, 0x1103, 0x7837, 0x0000, 0x080c,
+	0x5cb4, 0x080c, 0x5c97, 0x1170, 0x7080, 0x9005, 0x1158, 0x7158,
+	0x9186, 0xffff, 0x0138, 0x2011, 0x0008, 0x080c, 0x5af0, 0x0168,
+	0x080c, 0x5c6d, 0x20a9, 0x0008, 0x20e1, 0x0000, 0x2099, 0x026e,
+	0x20e9, 0x0000, 0x20a1, 0x024e, 0x4003, 0x60c3, 0x0014, 0x080c,
+	0x5b6d, 0x00fe, 0x0005, 0x00f6, 0x708c, 0x9005, 0x0500, 0x2011,
+	0x5b43, 0x080c, 0x8021, 0x9086, 0x0014, 0x11b8, 0x080c, 0x5cb4,
 	0x2079, 0x0260, 0x7a30, 0x9296, 0x1103, 0x1178, 0x7834, 0x9005,
 	0x1160, 0x7a38, 0xd2fc, 0x0128, 0x70c0, 0x9005, 0x1110, 0x70c3,
-	0x0001, 0x7097, 0x0012, 0x0029, 0x0010, 0x708f, 0x0000, 0x00fe,
-	0x0005, 0x00f6, 0x7097, 0x0013, 0x080c, 0x5c3d, 0x2079, 0x0240,
-	0x7833, 0x1103, 0x7837, 0x0000, 0x080c, 0x5cab, 0x080c, 0x5c8e,
-	0x1170, 0x7080, 0x9005, 0x1158, 0x7158, 0x9186, 0xffff, 0x0138,
-	0x2011, 0x0008, 0x080c, 0x5ae7, 0x0168, 0x080c, 0x5c64, 0x20a9,
-	0x0008, 0x20e1, 0x0000, 0x2099, 0x026e, 0x20e9, 0x0000, 0x20a1,
-	0x024e, 0x4003, 0x60c3, 0x0014, 0x080c, 0x5b64, 0x00fe, 0x0005,
-	0x00f6, 0x708c, 0x9005, 0x0500, 0x2011, 0x5b3a, 0x080c, 0x8038,
-	0x9086, 0x0014, 0x11b8, 0x080c, 0x5cab, 0x2079, 0x0260, 0x7a30,
-	0x9296, 0x1104, 0x1178, 0x7834, 0x9005, 0x1160, 0x7a38, 0xd2fc,
-	0x0128, 0x70c0, 0x9005, 0x1110, 0x70c3, 0x0001, 0x7097, 0x0014,
-	0x0029, 0x0010, 0x708f, 0x0000, 0x00fe, 0x0005, 0x00f6, 0x7097,
-	0x0015, 0x080c, 0x5c3d, 0x2079, 0x0240, 0x7833, 0x1104, 0x7837,
-	0x0000, 0x080c, 0x5cab, 0x080c, 0x5c8e, 0x11b8, 0x7080, 0x9005,
-	0x11a0, 0x7160, 0x9186, 0xffff, 0x0180, 0x9180, 0x3138, 0x200d,
-	0x918c, 0xff00, 0x810f, 0x2011, 0x0008, 0x080c, 0x5ae7, 0x0180,
-	0x080c, 0x4c98, 0x0110, 0x080c, 0x26cc, 0x20a9, 0x0008, 0x20e1,
-	0x0000, 0x2099, 0x026e, 0x20e9, 0x0000, 0x20a1, 0x024e, 0x4003,
-	0x60c3, 0x0014, 0x080c, 0x5b64, 0x00fe, 0x0005, 0x00f6, 0x708c,
-	0x9005, 0x05f0, 0x2011, 0x5b3a, 0x080c, 0x8038, 0x9086, 0x0014,
-	0x15a8, 0x080c, 0x5cab, 0x2079, 0x0260, 0x7a30, 0x9296, 0x1105,
-	0x1568, 0x7834, 0x9084, 0x0100, 0x2011, 0x0100, 0x921e, 0x1168,
-	0x9085, 0x0001, 0x080c, 0x5cd6, 0x7a38, 0xd2fc, 0x0128, 0x70c0,
-	0x9005, 0x1110, 0x70c3, 0x0001, 0x0080, 0x9005, 0x11b8, 0x7a38,
-	0xd2fc, 0x0128, 0x70c0, 0x9005, 0x1110, 0x70c3, 0x0001, 0x9085,
-	0x0001, 0x080c, 0x5cd6, 0x7093, 0x0000, 0x7a38, 0xd2f4, 0x0110,
-	0x70db, 0x0008, 0x7097, 0x0016, 0x0029, 0x0010, 0x708f, 0x0000,
-	0x00fe, 0x0005, 0x080c, 0x9c3f, 0x080c, 0x5cab, 0x20e1, 0x0000,
-	0x2099, 0x0260, 0x20e9, 0x0000, 0x20a1, 0x0240, 0x20a9, 0x000e,
-	0x4003, 0x2011, 0x026d, 0x2204, 0x9084, 0x0100, 0x2011, 0x024d,
-	0x2012, 0x2011, 0x026e, 0x7097, 0x0017, 0x080c, 0x5c8e, 0x1150,
-	0x7080, 0x9005, 0x1138, 0x080c, 0x5a5a, 0x1188, 0x9085, 0x0001,
-	0x080c, 0x26cc, 0x20a9, 0x0008, 0x080c, 0x5cab, 0x20e1, 0x0000,
-	0x2099, 0x026e, 0x20e9, 0x0000, 0x20a1, 0x024e, 0x4003, 0x60c3,
-	0x0014, 0x080c, 0x5b64, 0x0010, 0x080c, 0x55b4, 0x0005, 0x00f6,
-	0x708c, 0x9005, 0x01d8, 0x2011, 0x5b3a, 0x080c, 0x8038, 0x9086,
-	0x0084, 0x1190, 0x080c, 0x5cab, 0x2079, 0x0260, 0x7a30, 0x9296,
-	0x1106, 0x1150, 0x7834, 0x9005, 0x1138, 0x9006, 0x080c, 0x5cd6,
-	0x7097, 0x0018, 0x0029, 0x0010, 0x708f, 0x0000, 0x00fe, 0x0005,
-	0x00f6, 0x7097, 0x0019, 0x080c, 0x5c3d, 0x2079, 0x0240, 0x7833,
-	0x1106, 0x7837, 0x0000, 0x080c, 0x5cab, 0x2009, 0x026e, 0x2039,
-	0x1c0e, 0x20a9, 0x0040, 0x213e, 0x8738, 0x8108, 0x9186, 0x0280,
-	0x1128, 0x6814, 0x8000, 0x6816, 0x2009, 0x0260, 0x1f04, 0x59c3,
-	0x2039, 0x1c0e, 0x080c, 0x5c8e, 0x11e8, 0x2728, 0x2514, 0x8207,
-	0x9084, 0x00ff, 0x8000, 0x2018, 0x9294, 0x00ff, 0x8007, 0x9205,
-	0x202a, 0x705c, 0x2310, 0x8214, 0x92a0, 0x1c0e, 0x2414, 0x938c,
-	0x0001, 0x0118, 0x9294, 0xff00, 0x0018, 0x9294, 0x00ff, 0x8007,
-	0x9215, 0x2222, 0x20a9, 0x0040, 0x2009, 0x024e, 0x270e, 0x8738,
-	0x8108, 0x9186, 0x0260, 0x1128, 0x6810, 0x8000, 0x6812, 0x2009,
-	0x0240, 0x1f04, 0x59f6, 0x60c3, 0x0084, 0x080c, 0x5b64, 0x00fe,
-	0x0005, 0x00f6, 0x708c, 0x9005, 0x01e0, 0x2011, 0x5b3a, 0x080c,
-	0x8038, 0x9086, 0x0084, 0x1198, 0x080c, 0x5cab, 0x2079, 0x0260,
+	0x0001, 0x7097, 0x0006, 0x0029, 0x0010, 0x080c, 0x5c90, 0x00fe,
+	0x0005, 0x00f6, 0x7097, 0x0007, 0x080c, 0x5c38, 0x2079, 0x0240,
+	0x7833, 0x1104, 0x7837, 0x0000, 0x080c, 0x5cb4, 0x080c, 0x5c97,
+	0x11b8, 0x7080, 0x9005, 0x11a0, 0x7160, 0x9186, 0xffff, 0x0180,
+	0x9180, 0x313a, 0x200d, 0x918c, 0xff00, 0x810f, 0x2011, 0x0008,
+	0x080c, 0x5af0, 0x0180, 0x080c, 0x4ca1, 0x0110, 0x080c, 0x26ce,
+	0x20a9, 0x0008, 0x20e1, 0x0000, 0x2099, 0x026e, 0x20e9, 0x0000,
+	0x20a1, 0x024e, 0x4003, 0x60c3, 0x0014, 0x080c, 0x5b6d, 0x00fe,
+	0x0005, 0x00f6, 0x708c, 0x9005, 0x0500, 0x2011, 0x5b43, 0x080c,
+	0x8021, 0x9086, 0x0014, 0x11b8, 0x080c, 0x5cb4, 0x2079, 0x0260,
+	0x7a30, 0x9296, 0x1104, 0x1178, 0x7834, 0x9005, 0x1160, 0x7a38,
+	0xd2fc, 0x0128, 0x70c0, 0x9005, 0x1110, 0x70c3, 0x0001, 0x7097,
+	0x0008, 0x0029, 0x0010, 0x080c, 0x5c90, 0x00fe, 0x0005, 0x00f6,
+	0x7097, 0x0009, 0x080c, 0x5c38, 0x2079, 0x0240, 0x7833, 0x1105,
+	0x7837, 0x0100, 0x080c, 0x5c97, 0x1150, 0x7080, 0x9005, 0x1138,
+	0x080c, 0x5a63, 0x1188, 0x9085, 0x0001, 0x080c, 0x26ce, 0x20a9,
+	0x0008, 0x080c, 0x5cb4, 0x20e1, 0x0000, 0x2099, 0x026e, 0x20e9,
+	0x0000, 0x20a1, 0x024e, 0x4003, 0x60c3, 0x0014, 0x080c, 0x5b6d,
+	0x0010, 0x080c, 0x55bd, 0x00fe, 0x0005, 0x00f6, 0x708c, 0x9005,
+	0x05a8, 0x2011, 0x5b43, 0x080c, 0x8021, 0x9086, 0x0014, 0x1560,
+	0x080c, 0x5cb4, 0x2079, 0x0260, 0x7a30, 0x9296, 0x1105, 0x1520,
+	0x7834, 0x9084, 0x0100, 0x2011, 0x0100, 0x921e, 0x1160, 0x7a38,
+	0xd2fc, 0x0128, 0x70c0, 0x9005, 0x1110, 0x70c3, 0x0001, 0x7097,
+	0x000a, 0x00b1, 0x0098, 0x9005, 0x1178, 0x7a38, 0xd2fc, 0x0128,
+	0x70c0, 0x9005, 0x1110, 0x70c3, 0x0001, 0x7093, 0x0000, 0x7097,
+	0x000e, 0x080c, 0x580b, 0x0010, 0x080c, 0x5c90, 0x00fe, 0x0005,
+	0x00f6, 0x7097, 0x000b, 0x2011, 0x1c0e, 0x20e9, 0x0001, 0x22a0,
+	0x20a9, 0x0040, 0x2019, 0xffff, 0x4304, 0x080c, 0x5c38, 0x2079,
+	0x0240, 0x7833, 0x1106, 0x7837, 0x0000, 0x080c, 0x5c97, 0x0118,
+	0x2013, 0x0000, 0x0020, 0x705c, 0x9085, 0x0100, 0x2012, 0x20a9,
+	0x0040, 0x2009, 0x024e, 0x2011, 0x1c0e, 0x220e, 0x8210, 0x8108,
+	0x9186, 0x0260, 0x1128, 0x6810, 0x8000, 0x6812, 0x2009, 0x0240,
+	0x1f04, 0x578d, 0x60c3, 0x0084, 0x080c, 0x5b6d, 0x00fe, 0x0005,
+	0x00f6, 0x708c, 0x9005, 0x01c0, 0x2011, 0x5b43, 0x080c, 0x8021,
+	0x9086, 0x0084, 0x1178, 0x080c, 0x5cb4, 0x2079, 0x0260, 0x7a30,
+	0x9296, 0x1106, 0x1138, 0x7834, 0x9005, 0x1120, 0x7097, 0x000c,
+	0x0029, 0x0010, 0x080c, 0x5c90, 0x00fe, 0x0005, 0x00f6, 0x7097,
+	0x000d, 0x080c, 0x5c38, 0x2079, 0x0240, 0x7833, 0x1107, 0x7837,
+	0x0000, 0x080c, 0x5cb4, 0x20a9, 0x0040, 0x2011, 0x026e, 0x2009,
+	0x024e, 0x220e, 0x8210, 0x8108, 0x9186, 0x0260, 0x1150, 0x6810,
+	0x8000, 0x6812, 0x2009, 0x0240, 0x6814, 0x8000, 0x6816, 0x2011,
+	0x0260, 0x1f04, 0x57d1, 0x60c3, 0x0084, 0x080c, 0x5b6d, 0x00fe,
+	0x0005, 0x00f6, 0x708c, 0x9005, 0x01e0, 0x2011, 0x5b43, 0x080c,
+	0x8021, 0x9086, 0x0084, 0x1198, 0x080c, 0x5cb4, 0x2079, 0x0260,
 	0x7a30, 0x9296, 0x1107, 0x1158, 0x7834, 0x9005, 0x1140, 0x7093,
-	0x0001, 0x080c, 0x5c01, 0x7097, 0x001a, 0x0029, 0x0010, 0x708f,
-	0x0000, 0x00fe, 0x0005, 0x9085, 0x0001, 0x080c, 0x5cd6, 0x7097,
-	0x001b, 0x080c, 0x9c3f, 0x080c, 0x5cab, 0x2011, 0x0260, 0x2009,
-	0x0240, 0x748c, 0x9480, 0x0018, 0x9080, 0x0007, 0x9084, 0x03f8,
-	0x8004, 0x20a8, 0x220e, 0x8210, 0x8108, 0x9186, 0x0260, 0x1150,
-	0x6810, 0x8000, 0x6812, 0x2009, 0x0240, 0x6814, 0x8000, 0x6816,
-	0x2011, 0x0260, 0x1f04, 0x5a42, 0x60c3, 0x0084, 0x080c, 0x5b64,
-	0x0005, 0x0005, 0x0086, 0x0096, 0x2029, 0x1854, 0x252c, 0x20a9,
-	0x0008, 0x2041, 0x1c0e, 0x20e9, 0x0001, 0x28a0, 0x080c, 0x5cab,
-	0x20e1, 0x0000, 0x2099, 0x026e, 0x4003, 0x20a9, 0x0008, 0x2011,
-	0x0007, 0xd5d4, 0x0108, 0x9016, 0x2800, 0x9200, 0x200c, 0x91a6,
-	0xffff, 0x1148, 0xd5d4, 0x0110, 0x8210, 0x0008, 0x8211, 0x1f04,
-	0x5a74, 0x0804, 0x5ae3, 0x82ff, 0x1160, 0xd5d4, 0x0120, 0x91a6,
-	0x3fff, 0x0d90, 0x0020, 0x91a6, 0x3fff, 0x0904, 0x5ae3, 0x918d,
-	0xc000, 0x20a9, 0x0010, 0x2019, 0x0001, 0xd5d4, 0x0110, 0x2019,
-	0x0010, 0x2120, 0xd5d4, 0x0110, 0x8423, 0x0008, 0x8424, 0x1240,
-	0xd5d4, 0x0110, 0x8319, 0x0008, 0x8318, 0x1f04, 0x5a9a, 0x04d8,
-	0x23a8, 0x2021, 0x0001, 0x8426, 0x8425, 0x1f04, 0x5aac, 0x2328,
-	0x8529, 0x92be, 0x0007, 0x0158, 0x0006, 0x2039, 0x0007, 0x2200,
-	0x973a, 0x000e, 0x27a8, 0x95a8, 0x0010, 0x1f04, 0x5abb, 0x755a,
-	0x95c8, 0x3138, 0x292d, 0x95ac, 0x00ff, 0x757e, 0x6532, 0x6536,
-	0x0016, 0x2508, 0x080c, 0x26ac, 0x001e, 0x60e7, 0x0000, 0x65ea,
-	0x2018, 0x2304, 0x9405, 0x201a, 0x7083, 0x0001, 0x20e9, 0x0000,
-	0x20a1, 0x024e, 0x20e1, 0x0001, 0x2898, 0x20a9, 0x0008, 0x4003,
-	0x9085, 0x0001, 0x0008, 0x9006, 0x009e, 0x008e, 0x0005, 0x0156,
-	0x01c6, 0x01d6, 0x0136, 0x0146, 0x22a8, 0x20e1, 0x0000, 0x2099,
-	0x026e, 0x20e9, 0x0000, 0x2011, 0x024e, 0x22a0, 0x4003, 0x014e,
-	0x013e, 0x01de, 0x01ce, 0x015e, 0x2118, 0x9026, 0x2001, 0x0007,
-	0x939a, 0x0010, 0x0218, 0x8420, 0x8001, 0x0cd0, 0x2118, 0x84ff,
-	0x0120, 0x939a, 0x0010, 0x8421, 0x1de0, 0x2021, 0x0001, 0x83ff,
-	0x0118, 0x8423, 0x8319, 0x1de8, 0x9238, 0x2029, 0x026e, 0x9528,
-	0x2504, 0x942c, 0x11b8, 0x9405, 0x203a, 0x715a, 0x91a0, 0x3138,
-	0x242d, 0x95ac, 0x00ff, 0x757e, 0x6532, 0x6536, 0x0016, 0x2508,
-	0x080c, 0x26ac, 0x001e, 0x60e7, 0x0000, 0x65ea, 0x7083, 0x0001,
-	0x9084, 0x0000, 0x0005, 0x00e6, 0x2071, 0x1800, 0x7087, 0x0000,
-	0x00ee, 0x0005, 0x00e6, 0x00f6, 0x2079, 0x0100, 0x2071, 0x0140,
-	0x080c, 0x5bf0, 0x080c, 0x93ac, 0x7004, 0x9084, 0x4000, 0x0110,
-	0x080c, 0x2b24, 0x0126, 0x2091, 0x8000, 0x2071, 0x1825, 0x2073,
-	0x0000, 0x7840, 0x0026, 0x0016, 0x2009, 0x00f7, 0x080c, 0x5c4d,
-	0x001e, 0x9094, 0x0010, 0x9285, 0x0080, 0x7842, 0x7a42, 0x002e,
-	0x012e, 0x00fe, 0x00ee, 0x0005, 0x0126, 0x2091, 0x8000, 0x080c,
-	0x29ca, 0x0228, 0x2011, 0x0101, 0x2204, 0xc0c5, 0x2012, 0x2011,
-	0x19c2, 0x2013, 0x0000, 0x708f, 0x0000, 0x012e, 0x60a3, 0x0056,
-	0x60a7, 0x9575, 0x080c, 0x93a3, 0x6144, 0xd184, 0x0120, 0x7194,
-	0x918d, 0x2000, 0x0018, 0x7188, 0x918d, 0x1000, 0x2011, 0x196a,
-	0x2112, 0x2009, 0x07d0, 0x2011, 0x5b3a, 0x080c, 0x80ca, 0x0005,
-	0x0016, 0x0026, 0x00c6, 0x0126, 0x2091, 0x8000, 0x080c, 0x9db8,
-	0x2009, 0x00f7, 0x080c, 0x5c4d, 0x2061, 0x19cb, 0x900e, 0x611a,
-	0x611e, 0x6172, 0x6176, 0x2061, 0x1800, 0x6003, 0x0001, 0x2061,
-	0x0100, 0x6043, 0x0090, 0x6043, 0x0010, 0x2009, 0x196a, 0x200b,
-	0x0000, 0x2009, 0x002d, 0x2011, 0x5bbc, 0x080c, 0x802c, 0x012e,
-	0x00ce, 0x002e, 0x001e, 0x0005, 0x00e6, 0x0006, 0x0126, 0x2091,
-	0x8000, 0x0471, 0x2071, 0x0100, 0x080c, 0x93ac, 0x2071, 0x0140,
-	0x7004, 0x9084, 0x4000, 0x0110, 0x080c, 0x2b24, 0x080c, 0x6fba,
-	0x0188, 0x080c, 0x6fd5, 0x1170, 0x080c, 0x72a0, 0x0016, 0x080c,
-	0x277b, 0x2001, 0x193e, 0x2102, 0x001e, 0x080c, 0x729b, 0x080c,
-	0x6ee4, 0x0050, 0x2009, 0x0001, 0x080c, 0x2a63, 0x2001, 0x0001,
-	0x080c, 0x260c, 0x080c, 0x5b90, 0x012e, 0x000e, 0x00ee, 0x0005,
-	0x2001, 0x180e, 0x2004, 0xd0bc, 0x0158, 0x0026, 0x0036, 0x2011,
-	0x8017, 0x2001, 0x196a, 0x201c, 0x080c, 0x48d9, 0x003e, 0x002e,
-	0x0005, 0x20a9, 0x0012, 0x20e9, 0x0001, 0x20a1, 0x1c80, 0x080c,
-	0x5cab, 0x20e9, 0x0000, 0x2099, 0x026e, 0x0099, 0x20a9, 0x0020,
-	0x080c, 0x5ca5, 0x2099, 0x0260, 0x20a1, 0x1c92, 0x0051, 0x20a9,
-	0x000e, 0x080c, 0x5ca8, 0x2099, 0x0260, 0x20a1, 0x1cb2, 0x0009,
-	0x0005, 0x0016, 0x0026, 0x3410, 0x3308, 0x2104, 0x8007, 0x2012,
-	0x8108, 0x8210, 0x1f04, 0x5c25, 0x002e, 0x001e, 0x0005, 0x080c,
-	0x9c3f, 0x20e1, 0x0001, 0x2099, 0x1c00, 0x20e9, 0x0000, 0x20a1,
-	0x0240, 0x20a9, 0x000c, 0x4003, 0x0005, 0x080c, 0x9c3f, 0x080c,
-	0x5cab, 0x20e1, 0x0000, 0x2099, 0x0260, 0x20e9, 0x0000, 0x20a1,
-	0x0240, 0x20a9, 0x000c, 0x4003, 0x0005, 0x00c6, 0x0006, 0x2061,
-	0x0100, 0x810f, 0x2001, 0x1833, 0x2004, 0x9005, 0x1138, 0x2001,
-	0x1817, 0x2004, 0x9084, 0x00ff, 0x9105, 0x0010, 0x9185, 0x00f7,
-	0x604a, 0x000e, 0x00ce, 0x0005, 0x0016, 0x0046, 0x080c, 0x655e,
-	0x0158, 0x9006, 0x2020, 0x2009, 0x002a, 0x080c, 0xd52a, 0x2001,
-	0x180c, 0x200c, 0xc195, 0x2102, 0x2019, 0x002a, 0x900e, 0x080c,
-	0x2fa5, 0x080c, 0xc212, 0x0140, 0x0036, 0x2019, 0xffff, 0x2021,
-	0x0007, 0x080c, 0x4a76, 0x003e, 0x004e, 0x001e, 0x0005, 0x080c,
-	0x5b90, 0x7097, 0x0000, 0x708f, 0x0000, 0x0005, 0x0006, 0x2001,
-	0x180c, 0x2004, 0xd09c, 0x0100, 0x000e, 0x0005, 0x0006, 0x0016,
-	0x0126, 0x2091, 0x8000, 0x2001, 0x0101, 0x200c, 0x918d, 0x0006,
-	0x2102, 0x012e, 0x001e, 0x000e, 0x0005, 0x2009, 0x0001, 0x0020,
-	0x2009, 0x0002, 0x0008, 0x900e, 0x6814, 0x9084, 0xffc0, 0x910d,
-	0x6916, 0x0005, 0x00f6, 0x0156, 0x0146, 0x01d6, 0x9006, 0x20a9,
-	0x0080, 0x20e9, 0x0001, 0x20a1, 0x1c00, 0x4004, 0x2079, 0x1c00,
-	0x7803, 0x2200, 0x7807, 0x00ef, 0x780f, 0x00ef, 0x7813, 0x0138,
-	0x7823, 0xffff, 0x7827, 0xffff, 0x01de, 0x014e, 0x015e, 0x00fe,
-	0x0005, 0x2001, 0x1800, 0x2003, 0x0001, 0x0005, 0x2001, 0x1977,
-	0x0118, 0x2003, 0x0001, 0x0010, 0x2003, 0x0000, 0x0005, 0x0156,
-	0x20a9, 0x0800, 0x2009, 0x1000, 0x9006, 0x200a, 0x8108, 0x1f04,
-	0x5ce5, 0x015e, 0x0005, 0x00d6, 0x0036, 0x0156, 0x0136, 0x0146,
-	0x2069, 0x1853, 0x9006, 0xb802, 0xb8be, 0xb807, 0x0707, 0xb80a,
-	0xb80e, 0xb812, 0x9198, 0x3138, 0x231d, 0x939c, 0x00ff, 0xbb16,
-	0x0016, 0x0026, 0xb8b2, 0x080c, 0x9db1, 0x1120, 0x9192, 0x007e,
-	0x1208, 0xbbb2, 0x20a9, 0x0004, 0xb8b4, 0x20e8, 0xb9b8, 0x9198,
-	0x0006, 0x9006, 0x23a0, 0x4004, 0x20a9, 0x0004, 0x9198, 0x000a,
-	0x23a0, 0x4004, 0x002e, 0x001e, 0xb83e, 0xb842, 0xb84e, 0xb852,
-	0xb856, 0xb85a, 0xb85e, 0xb862, 0xb866, 0xb86a, 0xb86f, 0x0100,
-	0xb872, 0xb876, 0xb87a, 0xb88a, 0xb88e, 0xb893, 0x0008, 0xb896,
-	0xb89a, 0xb89e, 0xb8ae, 0xb9a2, 0x0096, 0xb8a4, 0x904d, 0x0110,
-	0x080c, 0x101d, 0xb8a7, 0x0000, 0x009e, 0x9006, 0xb84a, 0x6810,
-	0xb83a, 0x680c, 0xb846, 0x6814, 0x9084, 0x00ff, 0xb842, 0x014e,
-	0x013e, 0x015e, 0x003e, 0x00de, 0x0005, 0x0126, 0x2091, 0x8000,
-	0xa974, 0xae78, 0x9684, 0x3fff, 0x9082, 0x4000, 0x1a04, 0x5dbb,
-	0x9182, 0x0800, 0x1a04, 0x5dbf, 0x2001, 0x180c, 0x2004, 0x9084,
-	0x0003, 0x1904, 0x5dc5, 0x9188, 0x1000, 0x2104, 0x905d, 0x0518,
-	0xb804, 0x9084, 0x00ff, 0x908e, 0x0006, 0x1508, 0xb8a4, 0x900d,
-	0x1904, 0x5dd7, 0xb850, 0x900d, 0x1148, 0xa802, 0x2900, 0xb852,
-	0xb84e, 0x080c, 0x840e, 0x9006, 0x012e, 0x0005, 0x00a6, 0x2150,
-	0x2900, 0xb002, 0xa803, 0x0000, 0x00ae, 0xb852, 0x0c90, 0x2001,
-	0x0005, 0x900e, 0x04b8, 0x2001, 0x0028, 0x900e, 0x0498, 0x9082,
-	0x0006, 0x1290, 0x080c, 0x9db1, 0x1160, 0xb8a0, 0x9084, 0xff80,
-	0x1140, 0xb900, 0xd1fc, 0x0990, 0x2001, 0x0029, 0x2009, 0x1000,
-	0x0408, 0x2001, 0x0028, 0x00a8, 0x2009, 0x180c, 0x210c, 0xd18c,
-	0x0118, 0x2001, 0x0004, 0x0068, 0xd184, 0x0118, 0x2001, 0x0004,
-	0x0040, 0x2001, 0x0029, 0xb900, 0xd1fc, 0x0118, 0x2009, 0x1000,
-	0x0048, 0x900e, 0x0038, 0x2001, 0x0029, 0x900e, 0x0018, 0x2001,
-	0x0029, 0x900e, 0x9005, 0x012e, 0x0005, 0x2001, 0x180c, 0x2004,
-	0xd084, 0x19d0, 0x9188, 0x1000, 0x2104, 0x905d, 0x09a8, 0x080c,
-	0x6562, 0x1990, 0xb800, 0xd0bc, 0x0978, 0x0804, 0x5d6e, 0x080c,
-	0x63da, 0x0904, 0x5d87, 0x0804, 0x5d72, 0x00b6, 0x00e6, 0x0126,
-	0x2091, 0x8000, 0xa974, 0x9182, 0x0800, 0x1a04, 0x5e58, 0x9188,
-	0x1000, 0x2104, 0x905d, 0x0904, 0x5e30, 0xb8a0, 0x9086, 0x007f,
-	0x0178, 0x080c, 0x656a, 0x0160, 0xa994, 0x81ff, 0x0130, 0x908e,
-	0x0004, 0x0130, 0x908e, 0x0005, 0x0118, 0x080c, 0x6562, 0x1598,
-	0xa87c, 0xd0fc, 0x01e0, 0xa894, 0x9005, 0x01c8, 0x2060, 0x0026,
-	0x2010, 0x080c, 0xbb05, 0x002e, 0x1120, 0x2001, 0x0008, 0x0804,
-	0x5e5a, 0x6020, 0x9086, 0x000a, 0x0120, 0x2001, 0x0008, 0x0804,
-	0x5e5a, 0x601a, 0x6003, 0x0008, 0x2900, 0x6016, 0x0058, 0x080c,
-	0x9ddc, 0x05e8, 0x2b00, 0x6012, 0x2900, 0x6016, 0x600b, 0xffff,
-	0x6023, 0x000a, 0x2009, 0x0003, 0x080c, 0x9eac, 0x9006, 0x0458,
-	0x2001, 0x0028, 0x0438, 0x9082, 0x0006, 0x1290, 0x080c, 0x9db1,
-	0x1160, 0xb8a0, 0x9084, 0xff80, 0x1140, 0xb900, 0xd1fc, 0x0900,
-	0x2001, 0x0029, 0x2009, 0x1000, 0x00a8, 0x2001, 0x0028, 0x0090,
-	0x2009, 0x180c, 0x210c, 0xd18c, 0x0118, 0x2001, 0x0004, 0x0050,
-	0xd184, 0x0118, 0x2001, 0x0004, 0x0028, 0x2001, 0x0029, 0x0010,
-	0x2001, 0x0029, 0x9005, 0x012e, 0x00ee, 0x00be, 0x0005, 0x2001,
-	0x002c, 0x0cc0, 0x00f6, 0x00b6, 0x0126, 0x2091, 0x8000, 0xa8e0,
-	0x9005, 0x1550, 0xa8dc, 0x9082, 0x0101, 0x1630, 0xa8c8, 0x9005,
-	0x1518, 0xa8c4, 0x9082, 0x0101, 0x12f8, 0xa974, 0x2079, 0x1800,
-	0x9182, 0x0800, 0x12e8, 0x7830, 0x9084, 0x0003, 0x1130, 0xaa98,
-	0xab94, 0xa878, 0x9084, 0x0007, 0x00ea, 0x7930, 0xd18c, 0x0118,
-	0x2001, 0x0004, 0x0038, 0xd184, 0x0118, 0x2001, 0x0004, 0x0010,
-	0x2001, 0x0029, 0x900e, 0x0038, 0x2001, 0x002c, 0x900e, 0x0018,
-	0x2001, 0x0029, 0x900e, 0x9006, 0x0008, 0x9005, 0x012e, 0x00be,
-	0x00fe, 0x0005, 0x5eef, 0x5eaa, 0x5ec1, 0x5eef, 0x5eef, 0x5eef,
-	0x5eef, 0x5eef, 0x2100, 0x9082, 0x007e, 0x1278, 0x080c, 0x61de,
-	0x0148, 0x9046, 0xb810, 0x9306, 0x1904, 0x5ef7, 0xb814, 0x9206,
-	0x15f0, 0x0028, 0xbb12, 0xba16, 0x0010, 0x080c, 0x4793, 0x0150,
-	0x04b0, 0x080c, 0x623e, 0x1598, 0xb810, 0x9306, 0x1580, 0xb814,
-	0x9206, 0x1568, 0x080c, 0x9ddc, 0x0530, 0x2b00, 0x6012, 0x080c,
-	0xbf8c, 0x2900, 0x6016, 0x600b, 0xffff, 0x6023, 0x000a, 0xa878,
-	0x9086, 0x0001, 0x1170, 0x080c, 0x2fda, 0x9006, 0x080c, 0x617b,
-	0x2001, 0x0002, 0x080c, 0x618f, 0x2001, 0x0200, 0xb86e, 0xb893,
-	0x0002, 0x2009, 0x0003, 0x080c, 0x9eac, 0x9006, 0x0068, 0x2001,
-	0x0001, 0x900e, 0x0038, 0x2001, 0x002c, 0x900e, 0x0018, 0x2001,
-	0x0028, 0x900e, 0x9005, 0x0000, 0x012e, 0x00be, 0x00fe, 0x0005,
-	0x00b6, 0x00f6, 0x00e6, 0x0126, 0x2091, 0x8000, 0xa894, 0x90c6,
-	0x0015, 0x0904, 0x60cc, 0x90c6, 0x0056, 0x0904, 0x60d0, 0x90c6,
-	0x0066, 0x0904, 0x60d4, 0x90c6, 0x0067, 0x0904, 0x60d8, 0x90c6,
-	0x0068, 0x0904, 0x60dc, 0x90c6, 0x0071, 0x0904, 0x60e0, 0x90c6,
-	0x0074, 0x0904, 0x60e4, 0x90c6, 0x007c, 0x0904, 0x60e8, 0x90c6,
-	0x007e, 0x0904, 0x60ec, 0x90c6, 0x0037, 0x0904, 0x60f0, 0x9016,
-	0x2079, 0x1800, 0xa974, 0x9186, 0x00ff, 0x0904, 0x60c7, 0x9182,
-	0x0800, 0x1a04, 0x60c7, 0x080c, 0x623e, 0x1198, 0xb804, 0x9084,
-	0x00ff, 0x9082, 0x0006, 0x1268, 0xa894, 0x90c6, 0x006f, 0x0148,
-	0x080c, 0x9db1, 0x1904, 0x60b0, 0xb8a0, 0x9084, 0xff80, 0x1904,
-	0x60b0, 0xa894, 0x90c6, 0x006f, 0x0158, 0x90c6, 0x005e, 0x0904,
-	0x6010, 0x90c6, 0x0064, 0x0904, 0x6039, 0x2008, 0x0804, 0x5fd3,
-	0xa998, 0xa8b0, 0x2040, 0x080c, 0x9db1, 0x1120, 0x9182, 0x007f,
-	0x0a04, 0x5fd3, 0x9186, 0x00ff, 0x0904, 0x5fd3, 0x9182, 0x0800,
-	0x1a04, 0x5fd3, 0xaaa0, 0xab9c, 0x7878, 0x9306, 0x1188, 0x787c,
-	0x0096, 0x924e, 0x1128, 0x2208, 0x2310, 0x009e, 0x0804, 0x5fd3,
-	0x99cc, 0xff00, 0x009e, 0x1120, 0x2208, 0x2310, 0x0804, 0x5fd3,
-	0x080c, 0x4793, 0x0904, 0x5fdc, 0x900e, 0x9016, 0x90c6, 0x4000,
-	0x1558, 0x0006, 0x080c, 0x645e, 0x1108, 0xc185, 0xb800, 0xd0bc,
-	0x0108, 0xc18d, 0x20a9, 0x0004, 0xa860, 0x20e8, 0xa85c, 0x9080,
-	0x0031, 0x20a0, 0xb8b4, 0x20e0, 0xb8b8, 0x9080, 0x0006, 0x2098,
-	0x080c, 0x0f68, 0x20a9, 0x0004, 0xa860, 0x20e8, 0xa85c, 0x9080,
-	0x0035, 0x20a0, 0xb8b4, 0x20e0, 0xb8b8, 0x9080, 0x000a, 0x2098,
-	0x080c, 0x0f68, 0x000e, 0x00c8, 0x90c6, 0x4007, 0x1110, 0x2408,
-	0x00a0, 0x90c6, 0x4008, 0x1118, 0x2708, 0x2610, 0x0070, 0x90c6,
-	0x4009, 0x1108, 0x0050, 0x90c6, 0x4006, 0x0138, 0x2001, 0x4005,
-	0x2009, 0x000a, 0x0010, 0x2001, 0x4006, 0xa896, 0xa99a, 0xaa9e,
-	0x2001, 0x0030, 0x900e, 0x0470, 0x080c, 0x9ddc, 0x1130, 0x2001,
-	0x4005, 0x2009, 0x0003, 0x9016, 0x0c80, 0x2b00, 0x6012, 0x080c,
-	0xbf8c, 0x2900, 0x6016, 0x6023, 0x0001, 0xa868, 0xd88c, 0x0108,
-	0xc0f5, 0xa86a, 0x0126, 0x2091, 0x8000, 0x080c, 0x2fda, 0x012e,
-	0x9006, 0x080c, 0x617b, 0x2001, 0x0002, 0x080c, 0x618f, 0x2009,
-	0x0002, 0x080c, 0x9eac, 0xa8b0, 0xd094, 0x0118, 0xb8bc, 0xc08d,
-	0xb8be, 0x9006, 0x9005, 0x012e, 0x00ee, 0x00fe, 0x00be, 0x0005,
-	0x080c, 0x539a, 0x0118, 0x2009, 0x0007, 0x00f8, 0xa998, 0xaeb0,
-	0x080c, 0x623e, 0x1904, 0x5fce, 0x9186, 0x007f, 0x0130, 0x080c,
-	0x6562, 0x0118, 0x2009, 0x0009, 0x0080, 0x0096, 0x080c, 0x0feb,
-	0x1120, 0x009e, 0x2009, 0x0002, 0x0040, 0x2900, 0x009e, 0xa806,
-	0x080c, 0xbcfd, 0x19b0, 0x2009, 0x0003, 0x2001, 0x4005, 0x0804,
-	0x5fd5, 0xa998, 0xaeb0, 0x080c, 0x623e, 0x1904, 0x5fce, 0x0096,
-	0x080c, 0x0feb, 0x1128, 0x009e, 0x2009, 0x0002, 0x0804, 0x608d,
-	0x2900, 0x009e, 0xa806, 0x0096, 0x2048, 0x20a9, 0x002b, 0xb8b4,
-	0x20e0, 0xb8b8, 0x2098, 0xa860, 0x20e8, 0xa85c, 0x9080, 0x0002,
-	0x20a0, 0x4003, 0x20a9, 0x0008, 0x9080, 0x0006, 0x20a0, 0xbbb8,
-	0x9398, 0x0006, 0x2398, 0x080c, 0x0f68, 0x009e, 0xa87b, 0x0000,
-	0xa883, 0x0000, 0xa897, 0x4000, 0xd684, 0x1168, 0x080c, 0x5386,
-	0xd0b4, 0x1118, 0xa89b, 0x000b, 0x00e0, 0xb800, 0xd08c, 0x0118,
-	0xa89b, 0x000c, 0x00b0, 0x080c, 0x6562, 0x0118, 0xa89b, 0x0009,
-	0x0080, 0x080c, 0x539a, 0x0118, 0xa89b, 0x0007, 0x0050, 0x080c,
-	0xbce0, 0x1904, 0x6009, 0x2009, 0x0003, 0x2001, 0x4005, 0x0804,
-	0x5fd5, 0xa87b, 0x0030, 0xa897, 0x4005, 0xa804, 0x8006, 0x8006,
-	0x8007, 0x90bc, 0x003f, 0x9084, 0xffc0, 0x9080, 0x0002, 0x2009,
-	0x002b, 0xaaa0, 0xab9c, 0xaca8, 0xada4, 0x2031, 0x0000, 0x2041,
-	0x122f, 0x080c, 0xa334, 0x1904, 0x6009, 0x2009, 0x0002, 0x08e8,
-	0x2001, 0x0028, 0x900e, 0x0804, 0x600a, 0x2009, 0x180c, 0x210c,
-	0xd18c, 0x0118, 0x2001, 0x0004, 0x0038, 0xd184, 0x0118, 0x2001,
-	0x0004, 0x0010, 0x2001, 0x0029, 0x900e, 0x0804, 0x600a, 0x2001,
-	0x0029, 0x900e, 0x0804, 0x600a, 0x080c, 0x355c, 0x0804, 0x600b,
-	0x080c, 0x50c3, 0x0804, 0x600b, 0x080c, 0x432c, 0x0804, 0x600b,
-	0x080c, 0x43a5, 0x0804, 0x600b, 0x080c, 0x4401, 0x0804, 0x600b,
-	0x080c, 0x484f, 0x0804, 0x600b, 0x080c, 0x4afb, 0x0804, 0x600b,
-	0x080c, 0x4d2e, 0x0804, 0x600b, 0x080c, 0x4f27, 0x0804, 0x600b,
-	0x080c, 0x376c, 0x0804, 0x600b, 0x00b6, 0xa974, 0xae78, 0x9684,
-	0x3fff, 0x9082, 0x4000, 0x1618, 0x9182, 0x0800, 0x1268, 0x9188,
-	0x1000, 0x2104, 0x905d, 0x0140, 0x080c, 0x6562, 0x1148, 0x00e9,
-	0x080c, 0x6369, 0x9006, 0x00b0, 0x2001, 0x0028, 0x900e, 0x0090,
-	0x9082, 0x0006, 0x1240, 0xb900, 0xd1fc, 0x0d88, 0x2001, 0x0029,
-	0x2009, 0x1000, 0x0038, 0x2001, 0x0029, 0x900e, 0x0018, 0x2001,
-	0x0029, 0x900e, 0x9005, 0x00be, 0x0005, 0x0126, 0x2091, 0x8000,
-	0xb850, 0x900d, 0x0150, 0x2900, 0x0096, 0x2148, 0xa802, 0x009e,
-	0xa803, 0x0000, 0xb852, 0x012e, 0x0005, 0x2900, 0xb852, 0xb84e,
-	0xa803, 0x0000, 0x0cc0, 0x0126, 0x2091, 0x8000, 0xb84c, 0x9005,
-	0x0170, 0x00e6, 0x2071, 0x19b8, 0x7004, 0x9086, 0x0002, 0x0168,
-	0x00ee, 0xb84c, 0xa802, 0x2900, 0xb84e, 0x012e, 0x0005, 0x2900,
-	0xb852, 0xb84e, 0xa803, 0x0000, 0x0cc0, 0x701c, 0x9b06, 0x1d80,
-	0xb84c, 0x00a6, 0x2050, 0xb000, 0xa802, 0x2900, 0xb002, 0x00ae,
-	0x00ee, 0x012e, 0x0005, 0x0126, 0x2091, 0x8000, 0xb84c, 0x904d,
-	0x0130, 0xa800, 0x9005, 0x1108, 0xb852, 0xb84e, 0x9905, 0x012e,
-	0x0005, 0xb84c, 0x904d, 0x0130, 0xa800, 0x9005, 0x1108, 0xb852,
-	0xb84e, 0x9905, 0x0005, 0x00b6, 0x0126, 0x00c6, 0x0026, 0x2091,
-	0x8000, 0x6210, 0x2258, 0xba00, 0x9005, 0x0110, 0xc285, 0x0008,
-	0xc284, 0xba02, 0x002e, 0x00ce, 0x012e, 0x00be, 0x0005, 0x00b6,
-	0x0126, 0x00c6, 0x2091, 0x8000, 0x6210, 0x2258, 0xba04, 0x0006,
-	0x9086, 0x0006, 0x1170, 0xb89c, 0xd0ac, 0x0158, 0x080c, 0x655e,
-	0x0140, 0x9284, 0xff00, 0x8007, 0x9086, 0x0007, 0x1110, 0x2011,
-	0x0600, 0x000e, 0x9294, 0xff00, 0x9215, 0xba06, 0x0006, 0x9086,
-	0x0006, 0x1120, 0xba90, 0x82ff, 0x090c, 0x0db4, 0x000e, 0x00ce,
-	0x012e, 0x00be, 0x0005, 0x00b6, 0x0126, 0x00c6, 0x2091, 0x8000,
-	0x6210, 0x2258, 0xba04, 0x0006, 0x9086, 0x0006, 0x1168, 0xb89c,
-	0xd0a4, 0x0150, 0x080c, 0x655a, 0x1138, 0x9284, 0x00ff, 0x9086,
-	0x0007, 0x1110, 0x2011, 0x0006, 0x000e, 0x9294, 0x00ff, 0x8007,
-	0x9215, 0xba06, 0x00ce, 0x012e, 0x00be, 0x0005, 0x9182, 0x0800,
-	0x0218, 0x9085, 0x0001, 0x0005, 0x00d6, 0x0026, 0x9190, 0x1000,
-	0x2204, 0x905d, 0x1180, 0x0096, 0x080c, 0x0feb, 0x2958, 0x009e,
-	0x0160, 0x2b00, 0x2012, 0xb85c, 0xb8ba, 0xb860, 0xb8b6, 0x9006,
-	0xb8a6, 0x080c, 0x5ceb, 0x9006, 0x0010, 0x9085, 0x0001, 0x002e,
-	0x00de, 0x0005, 0x00b6, 0x0096, 0x0126, 0x2091, 0x8000, 0x0026,
-	0x9182, 0x0800, 0x0218, 0x9085, 0x0001, 0x0458, 0x00d6, 0x9190,
-	0x1000, 0x2204, 0x905d, 0x0518, 0x2013, 0x0000, 0xb8a4, 0x904d,
-	0x0110, 0x080c, 0x101d, 0x00d6, 0x00c6, 0xb8ac, 0x2060, 0x8cff,
-	0x0168, 0x600c, 0x0006, 0x6014, 0x2048, 0x080c, 0xbb17, 0x0110,
-	0x080c, 0x0f9d, 0x080c, 0x9e32, 0x00ce, 0x0c88, 0x00ce, 0x00de,
-	0x2b48, 0xb8b8, 0xb85e, 0xb8b4, 0xb862, 0x080c, 0x102d, 0x00de,
-	0x9006, 0x002e, 0x012e, 0x009e, 0x00be, 0x0005, 0x0016, 0x9182,
-	0x0800, 0x0218, 0x9085, 0x0001, 0x0030, 0x9188, 0x1000, 0x2104,
-	0x905d, 0x0dc0, 0x9006, 0x001e, 0x0005, 0x00d6, 0x0156, 0x0136,
-	0x0146, 0x9006, 0xb80a, 0xb80e, 0xb800, 0xc08c, 0xb802, 0x080c,
-	0x6fb2, 0x1510, 0xb8a0, 0x9086, 0x007e, 0x0120, 0x080c, 0x9db1,
-	0x11d8, 0x0078, 0x7040, 0xd0e4, 0x01b8, 0x00c6, 0x2061, 0x1953,
-	0x7048, 0x2062, 0x704c, 0x6006, 0x7050, 0x600a, 0x7054, 0x600e,
-	0x00ce, 0x703c, 0x2069, 0x0140, 0x9005, 0x1110, 0x2001, 0x0001,
-	0x6886, 0x2069, 0x1800, 0x68b2, 0x7040, 0xb85e, 0x7048, 0xb862,
-	0x704c, 0xb866, 0x20e1, 0x0000, 0x2099, 0x0276, 0xb8b4, 0x20e8,
-	0xb8b8, 0x9088, 0x000a, 0x21a0, 0x20a9, 0x0004, 0x4003, 0x2099,
-	0x027a, 0x9088, 0x0006, 0x21a0, 0x20a9, 0x0004, 0x4003, 0x2069,
-	0x0200, 0x6817, 0x0001, 0x7040, 0xb86a, 0x7144, 0xb96e, 0x7048,
-	0xb872, 0x7050, 0xb876, 0x2069, 0x0200, 0x6817, 0x0000, 0xb8a0,
-	0x9086, 0x007e, 0x1110, 0x7144, 0xb96e, 0x9182, 0x0211, 0x1218,
-	0x2009, 0x0008, 0x0400, 0x9182, 0x0259, 0x1218, 0x2009, 0x0007,
-	0x00d0, 0x9182, 0x02c1, 0x1218, 0x2009, 0x0006, 0x00a0, 0x9182,
-	0x0349, 0x1218, 0x2009, 0x0005, 0x0070, 0x9182, 0x0421, 0x1218,
-	0x2009, 0x0004, 0x0040, 0x9182, 0x0581, 0x1218, 0x2009, 0x0003,
-	0x0010, 0x2009, 0x0002, 0xb992, 0x014e, 0x013e, 0x015e, 0x00de,
-	0x0005, 0x0016, 0x0026, 0x00e6, 0x2071, 0x0260, 0x7034, 0xb896,
-	0x703c, 0xb89a, 0x7054, 0xb89e, 0x0036, 0xbbbc, 0xc384, 0xba00,
-	0x2009, 0x1873, 0x210c, 0xd0bc, 0x0120, 0xd1ec, 0x0110, 0xc2ad,
-	0x0008, 0xc2ac, 0xd0c4, 0x0148, 0xd1e4, 0x0138, 0xc2bd, 0xd0cc,
-	0x0128, 0xd38c, 0x1108, 0xc385, 0x0008, 0xc2bc, 0xba02, 0xbbbe,
-	0x003e, 0x00ee, 0x002e, 0x001e, 0x0005, 0x0096, 0x0126, 0x2091,
-	0x8000, 0xb8a4, 0x904d, 0x0578, 0xa900, 0x81ff, 0x15c0, 0xaa04,
-	0x9282, 0x0010, 0x16c8, 0x0136, 0x0146, 0x01c6, 0x01d6, 0x8906,
-	0x8006, 0x8007, 0x908c, 0x003f, 0x21e0, 0x9084, 0xffc0, 0x9080,
-	0x0004, 0x2098, 0x2009, 0x0010, 0x20a9, 0x0001, 0x4002, 0x9086,
-	0xffff, 0x0120, 0x8109, 0x1dd0, 0x080c, 0x0db4, 0x3c00, 0x20e8,
-	0x3300, 0x8001, 0x20a0, 0x4604, 0x8210, 0xaa06, 0x01de, 0x01ce,
-	0x014e, 0x013e, 0x0060, 0x080c, 0x0feb, 0x0170, 0x2900, 0xb8a6,
-	0xa803, 0x0000, 0x080c, 0x63fa, 0xa807, 0x0001, 0xae12, 0x9085,
-	0x0001, 0x012e, 0x009e, 0x0005, 0x9006, 0x0cd8, 0x0126, 0x2091,
-	0x8000, 0x0096, 0xb8a4, 0x904d, 0x0188, 0xa800, 0x9005, 0x1150,
-	0x080c, 0x6409, 0x1158, 0xa804, 0x908a, 0x0002, 0x0218, 0x8001,
-	0xa806, 0x0020, 0x080c, 0x101d, 0xb8a7, 0x0000, 0x009e, 0x012e,
-	0x0005, 0x0126, 0x2091, 0x8000, 0x080c, 0x840e, 0x012e, 0x0005,
-	0x901e, 0x0010, 0x2019, 0x0001, 0x900e, 0x0126, 0x2091, 0x8000,
-	0xb84c, 0x2048, 0xb800, 0xd0dc, 0x1170, 0x89ff, 0x0500, 0x83ff,
-	0x0120, 0xa878, 0x9606, 0x0158, 0x0030, 0xa86c, 0x9406, 0x1118,
-	0xa870, 0x9506, 0x0120, 0x2908, 0xa800, 0x2048, 0x0c70, 0x080c,
-	0x97b0, 0xaa00, 0xb84c, 0x9906, 0x1110, 0xba4e, 0x0020, 0x00a6,
-	0x2150, 0xb202, 0x00ae, 0x82ff, 0x1110, 0xb952, 0x89ff, 0x012e,
-	0x0005, 0x9016, 0x0489, 0x1110, 0x2011, 0x0001, 0x0005, 0x080c,
-	0x645e, 0x0128, 0x080c, 0xbbd4, 0x0010, 0x9085, 0x0001, 0x0005,
-	0x080c, 0x645e, 0x0128, 0x080c, 0xbb79, 0x0010, 0x9085, 0x0001,
-	0x0005, 0x080c, 0x645e, 0x0128, 0x080c, 0xbbd1, 0x0010, 0x9085,
-	0x0001, 0x0005, 0x080c, 0x645e, 0x0128, 0x080c, 0xbb98, 0x0010,
-	0x9085, 0x0001, 0x0005, 0x080c, 0x645e, 0x0128, 0x080c, 0xbc15,
-	0x0010, 0x9085, 0x0001, 0x0005, 0xb8a4, 0x900d, 0x1118, 0x9085,
-	0x0001, 0x0005, 0x0136, 0x01c6, 0xa800, 0x9005, 0x11b8, 0x890e,
+	0x0001, 0x080c, 0x5c0a, 0x7097, 0x000e, 0x0029, 0x0010, 0x080c,
+	0x5c90, 0x00fe, 0x0005, 0x918d, 0x0001, 0x080c, 0x5cdf, 0x7097,
+	0x000f, 0x708f, 0x0000, 0x2061, 0x0140, 0x605b, 0xbc85, 0x605f,
+	0xb5b5, 0x2061, 0x0100, 0x6043, 0x0005, 0x6043, 0x0004, 0x2009,
+	0x07d0, 0x2011, 0x5b43, 0x080c, 0x8015, 0x0005, 0x708c, 0x9005,
+	0x0130, 0x2011, 0x5b43, 0x080c, 0x8021, 0x7097, 0x0000, 0x0005,
+	0x7097, 0x0011, 0x080c, 0x9c4a, 0x080c, 0x5cb4, 0x20e1, 0x0000,
+	0x2099, 0x0260, 0x20e9, 0x0000, 0x20a1, 0x0240, 0x748c, 0x9480,
+	0x0018, 0x9080, 0x0007, 0x9084, 0x03f8, 0x8004, 0x20a8, 0x4003,
+	0x080c, 0x5c97, 0x11a0, 0x7178, 0x81ff, 0x0188, 0x900e, 0x707c,
+	0x9084, 0x00ff, 0x0160, 0x080c, 0x2665, 0x9186, 0x007e, 0x0138,
+	0x9186, 0x0080, 0x0120, 0x2011, 0x0008, 0x080c, 0x5af0, 0x60c3,
+	0x0014, 0x080c, 0x5b6d, 0x0005, 0x00f6, 0x708c, 0x9005, 0x0500,
+	0x2011, 0x5b43, 0x080c, 0x8021, 0x9086, 0x0014, 0x11b8, 0x080c,
+	0x5cb4, 0x2079, 0x0260, 0x7a30, 0x9296, 0x1103, 0x1178, 0x7834,
+	0x9005, 0x1160, 0x7a38, 0xd2fc, 0x0128, 0x70c0, 0x9005, 0x1110,
+	0x70c3, 0x0001, 0x7097, 0x0012, 0x0029, 0x0010, 0x708f, 0x0000,
+	0x00fe, 0x0005, 0x00f6, 0x7097, 0x0013, 0x080c, 0x5c46, 0x2079,
+	0x0240, 0x7833, 0x1103, 0x7837, 0x0000, 0x080c, 0x5cb4, 0x080c,
+	0x5c97, 0x1170, 0x7080, 0x9005, 0x1158, 0x7158, 0x9186, 0xffff,
+	0x0138, 0x2011, 0x0008, 0x080c, 0x5af0, 0x0168, 0x080c, 0x5c6d,
+	0x20a9, 0x0008, 0x20e1, 0x0000, 0x2099, 0x026e, 0x20e9, 0x0000,
+	0x20a1, 0x024e, 0x4003, 0x60c3, 0x0014, 0x080c, 0x5b6d, 0x00fe,
+	0x0005, 0x00f6, 0x708c, 0x9005, 0x0500, 0x2011, 0x5b43, 0x080c,
+	0x8021, 0x9086, 0x0014, 0x11b8, 0x080c, 0x5cb4, 0x2079, 0x0260,
+	0x7a30, 0x9296, 0x1104, 0x1178, 0x7834, 0x9005, 0x1160, 0x7a38,
+	0xd2fc, 0x0128, 0x70c0, 0x9005, 0x1110, 0x70c3, 0x0001, 0x7097,
+	0x0014, 0x0029, 0x0010, 0x708f, 0x0000, 0x00fe, 0x0005, 0x00f6,
+	0x7097, 0x0015, 0x080c, 0x5c46, 0x2079, 0x0240, 0x7833, 0x1104,
+	0x7837, 0x0000, 0x080c, 0x5cb4, 0x080c, 0x5c97, 0x11b8, 0x7080,
+	0x9005, 0x11a0, 0x7160, 0x9186, 0xffff, 0x0180, 0x9180, 0x313a,
+	0x200d, 0x918c, 0xff00, 0x810f, 0x2011, 0x0008, 0x080c, 0x5af0,
+	0x0180, 0x080c, 0x4ca1, 0x0110, 0x080c, 0x26ce, 0x20a9, 0x0008,
+	0x20e1, 0x0000, 0x2099, 0x026e, 0x20e9, 0x0000, 0x20a1, 0x024e,
+	0x4003, 0x60c3, 0x0014, 0x080c, 0x5b6d, 0x00fe, 0x0005, 0x00f6,
+	0x708c, 0x9005, 0x05f0, 0x2011, 0x5b43, 0x080c, 0x8021, 0x9086,
+	0x0014, 0x15a8, 0x080c, 0x5cb4, 0x2079, 0x0260, 0x7a30, 0x9296,
+	0x1105, 0x1568, 0x7834, 0x9084, 0x0100, 0x2011, 0x0100, 0x921e,
+	0x1168, 0x9085, 0x0001, 0x080c, 0x5cdf, 0x7a38, 0xd2fc, 0x0128,
+	0x70c0, 0x9005, 0x1110, 0x70c3, 0x0001, 0x0080, 0x9005, 0x11b8,
+	0x7a38, 0xd2fc, 0x0128, 0x70c0, 0x9005, 0x1110, 0x70c3, 0x0001,
+	0x9085, 0x0001, 0x080c, 0x5cdf, 0x7093, 0x0000, 0x7a38, 0xd2f4,
+	0x0110, 0x70db, 0x0008, 0x7097, 0x0016, 0x0029, 0x0010, 0x708f,
+	0x0000, 0x00fe, 0x0005, 0x080c, 0x9c4a, 0x080c, 0x5cb4, 0x20e1,
+	0x0000, 0x2099, 0x0260, 0x20e9, 0x0000, 0x20a1, 0x0240, 0x20a9,
+	0x000e, 0x4003, 0x2011, 0x026d, 0x2204, 0x9084, 0x0100, 0x2011,
+	0x024d, 0x2012, 0x2011, 0x026e, 0x7097, 0x0017, 0x080c, 0x5c97,
+	0x1150, 0x7080, 0x9005, 0x1138, 0x080c, 0x5a63, 0x1188, 0x9085,
+	0x0001, 0x080c, 0x26ce, 0x20a9, 0x0008, 0x080c, 0x5cb4, 0x20e1,
+	0x0000, 0x2099, 0x026e, 0x20e9, 0x0000, 0x20a1, 0x024e, 0x4003,
+	0x60c3, 0x0014, 0x080c, 0x5b6d, 0x0010, 0x080c, 0x55bd, 0x0005,
+	0x00f6, 0x708c, 0x9005, 0x01d8, 0x2011, 0x5b43, 0x080c, 0x8021,
+	0x9086, 0x0084, 0x1190, 0x080c, 0x5cb4, 0x2079, 0x0260, 0x7a30,
+	0x9296, 0x1106, 0x1150, 0x7834, 0x9005, 0x1138, 0x9006, 0x080c,
+	0x5cdf, 0x7097, 0x0018, 0x0029, 0x0010, 0x708f, 0x0000, 0x00fe,
+	0x0005, 0x00f6, 0x7097, 0x0019, 0x080c, 0x5c46, 0x2079, 0x0240,
+	0x7833, 0x1106, 0x7837, 0x0000, 0x080c, 0x5cb4, 0x2009, 0x026e,
+	0x2039, 0x1c0e, 0x20a9, 0x0040, 0x213e, 0x8738, 0x8108, 0x9186,
+	0x0280, 0x1128, 0x6814, 0x8000, 0x6816, 0x2009, 0x0260, 0x1f04,
+	0x59cc, 0x2039, 0x1c0e, 0x080c, 0x5c97, 0x11e8, 0x2728, 0x2514,
+	0x8207, 0x9084, 0x00ff, 0x8000, 0x2018, 0x9294, 0x00ff, 0x8007,
+	0x9205, 0x202a, 0x705c, 0x2310, 0x8214, 0x92a0, 0x1c0e, 0x2414,
+	0x938c, 0x0001, 0x0118, 0x9294, 0xff00, 0x0018, 0x9294, 0x00ff,
+	0x8007, 0x9215, 0x2222, 0x20a9, 0x0040, 0x2009, 0x024e, 0x270e,
+	0x8738, 0x8108, 0x9186, 0x0260, 0x1128, 0x6810, 0x8000, 0x6812,
+	0x2009, 0x0240, 0x1f04, 0x59ff, 0x60c3, 0x0084, 0x080c, 0x5b6d,
+	0x00fe, 0x0005, 0x00f6, 0x708c, 0x9005, 0x01e0, 0x2011, 0x5b43,
+	0x080c, 0x8021, 0x9086, 0x0084, 0x1198, 0x080c, 0x5cb4, 0x2079,
+	0x0260, 0x7a30, 0x9296, 0x1107, 0x1158, 0x7834, 0x9005, 0x1140,
+	0x7093, 0x0001, 0x080c, 0x5c0a, 0x7097, 0x001a, 0x0029, 0x0010,
+	0x708f, 0x0000, 0x00fe, 0x0005, 0x9085, 0x0001, 0x080c, 0x5cdf,
+	0x7097, 0x001b, 0x080c, 0x9c4a, 0x080c, 0x5cb4, 0x2011, 0x0260,
+	0x2009, 0x0240, 0x748c, 0x9480, 0x0018, 0x9080, 0x0007, 0x9084,
+	0x03f8, 0x8004, 0x20a8, 0x220e, 0x8210, 0x8108, 0x9186, 0x0260,
+	0x1150, 0x6810, 0x8000, 0x6812, 0x2009, 0x0240, 0x6814, 0x8000,
+	0x6816, 0x2011, 0x0260, 0x1f04, 0x5a4b, 0x60c3, 0x0084, 0x080c,
+	0x5b6d, 0x0005, 0x0005, 0x0086, 0x0096, 0x2029, 0x1854, 0x252c,
+	0x20a9, 0x0008, 0x2041, 0x1c0e, 0x20e9, 0x0001, 0x28a0, 0x080c,
+	0x5cb4, 0x20e1, 0x0000, 0x2099, 0x026e, 0x4003, 0x20a9, 0x0008,
+	0x2011, 0x0007, 0xd5d4, 0x0108, 0x9016, 0x2800, 0x9200, 0x200c,
+	0x91a6, 0xffff, 0x1148, 0xd5d4, 0x0110, 0x8210, 0x0008, 0x8211,
+	0x1f04, 0x5a7d, 0x0804, 0x5aec, 0x82ff, 0x1160, 0xd5d4, 0x0120,
+	0x91a6, 0x3fff, 0x0d90, 0x0020, 0x91a6, 0x3fff, 0x0904, 0x5aec,
+	0x918d, 0xc000, 0x20a9, 0x0010, 0x2019, 0x0001, 0xd5d4, 0x0110,
+	0x2019, 0x0010, 0x2120, 0xd5d4, 0x0110, 0x8423, 0x0008, 0x8424,
+	0x1240, 0xd5d4, 0x0110, 0x8319, 0x0008, 0x8318, 0x1f04, 0x5aa3,
+	0x04d8, 0x23a8, 0x2021, 0x0001, 0x8426, 0x8425, 0x1f04, 0x5ab5,
+	0x2328, 0x8529, 0x92be, 0x0007, 0x0158, 0x0006, 0x2039, 0x0007,
+	0x2200, 0x973a, 0x000e, 0x27a8, 0x95a8, 0x0010, 0x1f04, 0x5ac4,
+	0x755a, 0x95c8, 0x313a, 0x292d, 0x95ac, 0x00ff, 0x757e, 0x6532,
+	0x6536, 0x0016, 0x2508, 0x080c, 0x26ae, 0x001e, 0x60e7, 0x0000,
+	0x65ea, 0x2018, 0x2304, 0x9405, 0x201a, 0x7083, 0x0001, 0x20e9,
+	0x0000, 0x20a1, 0x024e, 0x20e1, 0x0001, 0x2898, 0x20a9, 0x0008,
+	0x4003, 0x9085, 0x0001, 0x0008, 0x9006, 0x009e, 0x008e, 0x0005,
+	0x0156, 0x01c6, 0x01d6, 0x0136, 0x0146, 0x22a8, 0x20e1, 0x0000,
+	0x2099, 0x026e, 0x20e9, 0x0000, 0x2011, 0x024e, 0x22a0, 0x4003,
+	0x014e, 0x013e, 0x01de, 0x01ce, 0x015e, 0x2118, 0x9026, 0x2001,
+	0x0007, 0x939a, 0x0010, 0x0218, 0x8420, 0x8001, 0x0cd0, 0x2118,
+	0x84ff, 0x0120, 0x939a, 0x0010, 0x8421, 0x1de0, 0x2021, 0x0001,
+	0x83ff, 0x0118, 0x8423, 0x8319, 0x1de8, 0x9238, 0x2029, 0x026e,
+	0x9528, 0x2504, 0x942c, 0x11b8, 0x9405, 0x203a, 0x715a, 0x91a0,
+	0x313a, 0x242d, 0x95ac, 0x00ff, 0x757e, 0x6532, 0x6536, 0x0016,
+	0x2508, 0x080c, 0x26ae, 0x001e, 0x60e7, 0x0000, 0x65ea, 0x7083,
+	0x0001, 0x9084, 0x0000, 0x0005, 0x00e6, 0x2071, 0x1800, 0x7087,
+	0x0000, 0x00ee, 0x0005, 0x00e6, 0x00f6, 0x2079, 0x0100, 0x2071,
+	0x0140, 0x080c, 0x5bf9, 0x080c, 0x93ad, 0x7004, 0x9084, 0x4000,
+	0x0110, 0x080c, 0x2b26, 0x0126, 0x2091, 0x8000, 0x2071, 0x1825,
+	0x2073, 0x0000, 0x7840, 0x0026, 0x0016, 0x2009, 0x00f7, 0x080c,
+	0x5c56, 0x001e, 0x9094, 0x0010, 0x9285, 0x0080, 0x7842, 0x7a42,
+	0x002e, 0x012e, 0x00fe, 0x00ee, 0x0005, 0x0126, 0x2091, 0x8000,
+	0x080c, 0x29cc, 0x0228, 0x2011, 0x0101, 0x2204, 0xc0c5, 0x2012,
+	0x2011, 0x19c1, 0x2013, 0x0000, 0x708f, 0x0000, 0x012e, 0x60a3,
+	0x0056, 0x60a7, 0x9575, 0x080c, 0x93a4, 0x6144, 0xd184, 0x0120,
+	0x7194, 0x918d, 0x2000, 0x0018, 0x7188, 0x918d, 0x1000, 0x2011,
+	0x1969, 0x2112, 0x2009, 0x07d0, 0x2011, 0x5b43, 0x080c, 0x80b3,
+	0x0005, 0x0016, 0x0026, 0x00c6, 0x0126, 0x2091, 0x8000, 0x080c,
+	0x9dc8, 0x2009, 0x00f7, 0x080c, 0x5c56, 0x2061, 0x19ca, 0x900e,
+	0x611a, 0x611e, 0x6172, 0x6176, 0x2061, 0x1800, 0x6003, 0x0001,
+	0x2061, 0x0100, 0x6043, 0x0090, 0x6043, 0x0010, 0x2009, 0x1969,
+	0x200b, 0x0000, 0x2009, 0x002d, 0x2011, 0x5bc5, 0x080c, 0x8015,
+	0x012e, 0x00ce, 0x002e, 0x001e, 0x0005, 0x00e6, 0x0006, 0x0126,
+	0x2091, 0x8000, 0x0471, 0x2071, 0x0100, 0x080c, 0x93ad, 0x2071,
+	0x0140, 0x7004, 0x9084, 0x4000, 0x0110, 0x080c, 0x2b26, 0x080c,
+	0x6fa3, 0x0188, 0x080c, 0x6fbe, 0x1170, 0x080c, 0x7289, 0x0016,
+	0x080c, 0x277d, 0x2001, 0x193d, 0x2102, 0x001e, 0x080c, 0x7284,
+	0x080c, 0x6ecd, 0x0050, 0x2009, 0x0001, 0x080c, 0x2a65, 0x2001,
+	0x0001, 0x080c, 0x260e, 0x080c, 0x5b99, 0x012e, 0x000e, 0x00ee,
+	0x0005, 0x2001, 0x180e, 0x2004, 0xd0bc, 0x0158, 0x0026, 0x0036,
+	0x2011, 0x8017, 0x2001, 0x1969, 0x201c, 0x080c, 0x48e9, 0x003e,
+	0x002e, 0x0005, 0x20a9, 0x0012, 0x20e9, 0x0001, 0x20a1, 0x1c80,
+	0x080c, 0x5cb4, 0x20e9, 0x0000, 0x2099, 0x026e, 0x0099, 0x20a9,
+	0x0020, 0x080c, 0x5cae, 0x2099, 0x0260, 0x20a1, 0x1c92, 0x0051,
+	0x20a9, 0x000e, 0x080c, 0x5cb1, 0x2099, 0x0260, 0x20a1, 0x1cb2,
+	0x0009, 0x0005, 0x0016, 0x0026, 0x3410, 0x3308, 0x2104, 0x8007,
+	0x2012, 0x8108, 0x8210, 0x1f04, 0x5c2e, 0x002e, 0x001e, 0x0005,
+	0x080c, 0x9c4a, 0x20e1, 0x0001, 0x2099, 0x1c00, 0x20e9, 0x0000,
+	0x20a1, 0x0240, 0x20a9, 0x000c, 0x4003, 0x0005, 0x080c, 0x9c4a,
+	0x080c, 0x5cb4, 0x20e1, 0x0000, 0x2099, 0x0260, 0x20e9, 0x0000,
+	0x20a1, 0x0240, 0x20a9, 0x000c, 0x4003, 0x0005, 0x00c6, 0x0006,
+	0x2061, 0x0100, 0x810f, 0x2001, 0x1833, 0x2004, 0x9005, 0x1138,
+	0x2001, 0x1817, 0x2004, 0x9084, 0x00ff, 0x9105, 0x0010, 0x9185,
+	0x00f7, 0x604a, 0x000e, 0x00ce, 0x0005, 0x0016, 0x0046, 0x080c,
+	0x6567, 0x0158, 0x9006, 0x2020, 0x2009, 0x002a, 0x080c, 0xd54b,
+	0x2001, 0x180c, 0x200c, 0xc195, 0x2102, 0x2019, 0x002a, 0x900e,
+	0x080c, 0x2fa7, 0x080c, 0xc22c, 0x0140, 0x0036, 0x2019, 0xffff,
+	0x2021, 0x0007, 0x080c, 0x4a86, 0x003e, 0x004e, 0x001e, 0x0005,
+	0x080c, 0x5b99, 0x7097, 0x0000, 0x708f, 0x0000, 0x0005, 0x0006,
+	0x2001, 0x180c, 0x2004, 0xd09c, 0x0100, 0x000e, 0x0005, 0x0006,
+	0x0016, 0x0126, 0x2091, 0x8000, 0x2001, 0x0101, 0x200c, 0x918d,
+	0x0006, 0x2102, 0x012e, 0x001e, 0x000e, 0x0005, 0x2009, 0x0001,
+	0x0020, 0x2009, 0x0002, 0x0008, 0x900e, 0x6814, 0x9084, 0xffc0,
+	0x910d, 0x6916, 0x0005, 0x00f6, 0x0156, 0x0146, 0x01d6, 0x9006,
+	0x20a9, 0x0080, 0x20e9, 0x0001, 0x20a1, 0x1c00, 0x4004, 0x2079,
+	0x1c00, 0x7803, 0x2200, 0x7807, 0x00ef, 0x780f, 0x00ef, 0x7813,
+	0x0138, 0x7823, 0xffff, 0x7827, 0xffff, 0x01de, 0x014e, 0x015e,
+	0x00fe, 0x0005, 0x2001, 0x1800, 0x2003, 0x0001, 0x0005, 0x2001,
+	0x1976, 0x0118, 0x2003, 0x0001, 0x0010, 0x2003, 0x0000, 0x0005,
+	0x0156, 0x20a9, 0x0800, 0x2009, 0x1000, 0x9006, 0x200a, 0x8108,
+	0x1f04, 0x5cee, 0x015e, 0x0005, 0x00d6, 0x0036, 0x0156, 0x0136,
+	0x0146, 0x2069, 0x1853, 0x9006, 0xb802, 0xb8be, 0xb807, 0x0707,
+	0xb80a, 0xb80e, 0xb812, 0x9198, 0x313a, 0x231d, 0x939c, 0x00ff,
+	0xbb16, 0x0016, 0x0026, 0xb8b2, 0x080c, 0x9dc1, 0x1120, 0x9192,
+	0x007e, 0x1208, 0xbbb2, 0x20a9, 0x0004, 0xb8b4, 0x20e8, 0xb9b8,
+	0x9198, 0x0006, 0x9006, 0x23a0, 0x4004, 0x20a9, 0x0004, 0x9198,
+	0x000a, 0x23a0, 0x4004, 0x002e, 0x001e, 0xb83e, 0xb842, 0xb84e,
+	0xb852, 0xb856, 0xb85a, 0xb85e, 0xb862, 0xb866, 0xb86a, 0xb86f,
+	0x0100, 0xb872, 0xb876, 0xb87a, 0xb88a, 0xb88e, 0xb893, 0x0008,
+	0xb896, 0xb89a, 0xb89e, 0xb8ae, 0xb9a2, 0x0096, 0xb8a4, 0x904d,
+	0x0110, 0x080c, 0x101d, 0xb8a7, 0x0000, 0x009e, 0x9006, 0xb84a,
+	0x6810, 0xb83a, 0x680c, 0xb846, 0x6814, 0x9084, 0x00ff, 0xb842,
+	0x014e, 0x013e, 0x015e, 0x003e, 0x00de, 0x0005, 0x0126, 0x2091,
+	0x8000, 0xa974, 0xae78, 0x9684, 0x3fff, 0x9082, 0x4000, 0x1a04,
+	0x5dc4, 0x9182, 0x0800, 0x1a04, 0x5dc8, 0x2001, 0x180c, 0x2004,
+	0x9084, 0x0003, 0x1904, 0x5dce, 0x9188, 0x1000, 0x2104, 0x905d,
+	0x0518, 0xb804, 0x9084, 0x00ff, 0x908e, 0x0006, 0x1508, 0xb8a4,
+	0x900d, 0x1904, 0x5de0, 0xb850, 0x900d, 0x1148, 0xa802, 0x2900,
+	0xb852, 0xb84e, 0x080c, 0x83f7, 0x9006, 0x012e, 0x0005, 0x00a6,
+	0x2150, 0x2900, 0xb002, 0xa803, 0x0000, 0x00ae, 0xb852, 0x0c90,
+	0x2001, 0x0005, 0x900e, 0x04b8, 0x2001, 0x0028, 0x900e, 0x0498,
+	0x9082, 0x0006, 0x1290, 0x080c, 0x9dc1, 0x1160, 0xb8a0, 0x9084,
+	0xff80, 0x1140, 0xb900, 0xd1fc, 0x0990, 0x2001, 0x0029, 0x2009,
+	0x1000, 0x0408, 0x2001, 0x0028, 0x00a8, 0x2009, 0x180c, 0x210c,
+	0xd18c, 0x0118, 0x2001, 0x0004, 0x0068, 0xd184, 0x0118, 0x2001,
+	0x0004, 0x0040, 0x2001, 0x0029, 0xb900, 0xd1fc, 0x0118, 0x2009,
+	0x1000, 0x0048, 0x900e, 0x0038, 0x2001, 0x0029, 0x900e, 0x0018,
+	0x2001, 0x0029, 0x900e, 0x9005, 0x012e, 0x0005, 0x2001, 0x180c,
+	0x2004, 0xd084, 0x19d0, 0x9188, 0x1000, 0x2104, 0x905d, 0x09a8,
+	0x080c, 0x656b, 0x1990, 0xb800, 0xd0bc, 0x0978, 0x0804, 0x5d77,
+	0x080c, 0x63e3, 0x0904, 0x5d90, 0x0804, 0x5d7b, 0x00b6, 0x00e6,
+	0x0126, 0x2091, 0x8000, 0xa974, 0x9182, 0x0800, 0x1a04, 0x5e61,
+	0x9188, 0x1000, 0x2104, 0x905d, 0x0904, 0x5e39, 0xb8a0, 0x9086,
+	0x007f, 0x0178, 0x080c, 0x6573, 0x0160, 0xa994, 0x81ff, 0x0130,
+	0x908e, 0x0004, 0x0130, 0x908e, 0x0005, 0x0118, 0x080c, 0x656b,
+	0x1598, 0xa87c, 0xd0fc, 0x01e0, 0xa894, 0x9005, 0x01c8, 0x2060,
+	0x0026, 0x2010, 0x080c, 0xbb1a, 0x002e, 0x1120, 0x2001, 0x0008,
+	0x0804, 0x5e63, 0x6020, 0x9086, 0x000a, 0x0120, 0x2001, 0x0008,
+	0x0804, 0x5e63, 0x601a, 0x6003, 0x0008, 0x2900, 0x6016, 0x0058,
+	0x080c, 0x9dec, 0x05e8, 0x2b00, 0x6012, 0x2900, 0x6016, 0x600b,
+	0xffff, 0x6023, 0x000a, 0x2009, 0x0003, 0x080c, 0x9ebc, 0x9006,
+	0x0458, 0x2001, 0x0028, 0x0438, 0x9082, 0x0006, 0x1290, 0x080c,
+	0x9dc1, 0x1160, 0xb8a0, 0x9084, 0xff80, 0x1140, 0xb900, 0xd1fc,
+	0x0900, 0x2001, 0x0029, 0x2009, 0x1000, 0x00a8, 0x2001, 0x0028,
+	0x0090, 0x2009, 0x180c, 0x210c, 0xd18c, 0x0118, 0x2001, 0x0004,
+	0x0050, 0xd184, 0x0118, 0x2001, 0x0004, 0x0028, 0x2001, 0x0029,
+	0x0010, 0x2001, 0x0029, 0x9005, 0x012e, 0x00ee, 0x00be, 0x0005,
+	0x2001, 0x002c, 0x0cc0, 0x00f6, 0x00b6, 0x0126, 0x2091, 0x8000,
+	0xa8e0, 0x9005, 0x1550, 0xa8dc, 0x9082, 0x0101, 0x1630, 0xa8c8,
+	0x9005, 0x1518, 0xa8c4, 0x9082, 0x0101, 0x12f8, 0xa974, 0x2079,
+	0x1800, 0x9182, 0x0800, 0x12e8, 0x7830, 0x9084, 0x0003, 0x1130,
+	0xaa98, 0xab94, 0xa878, 0x9084, 0x0007, 0x00ea, 0x7930, 0xd18c,
+	0x0118, 0x2001, 0x0004, 0x0038, 0xd184, 0x0118, 0x2001, 0x0004,
+	0x0010, 0x2001, 0x0029, 0x900e, 0x0038, 0x2001, 0x002c, 0x900e,
+	0x0018, 0x2001, 0x0029, 0x900e, 0x9006, 0x0008, 0x9005, 0x012e,
+	0x00be, 0x00fe, 0x0005, 0x5ef8, 0x5eb3, 0x5eca, 0x5ef8, 0x5ef8,
+	0x5ef8, 0x5ef8, 0x5ef8, 0x2100, 0x9082, 0x007e, 0x1278, 0x080c,
+	0x61e7, 0x0148, 0x9046, 0xb810, 0x9306, 0x1904, 0x5f00, 0xb814,
+	0x9206, 0x15f0, 0x0028, 0xbb12, 0xba16, 0x0010, 0x080c, 0x47a3,
+	0x0150, 0x04b0, 0x080c, 0x6247, 0x1598, 0xb810, 0x9306, 0x1580,
+	0xb814, 0x9206, 0x1568, 0x080c, 0x9dec, 0x0530, 0x2b00, 0x6012,
+	0x080c, 0xbfa6, 0x2900, 0x6016, 0x600b, 0xffff, 0x6023, 0x000a,
+	0xa878, 0x9086, 0x0001, 0x1170, 0x080c, 0x2fdc, 0x9006, 0x080c,
+	0x6184, 0x2001, 0x0002, 0x080c, 0x6198, 0x2001, 0x0200, 0xb86e,
+	0xb893, 0x0002, 0x2009, 0x0003, 0x080c, 0x9ebc, 0x9006, 0x0068,
+	0x2001, 0x0001, 0x900e, 0x0038, 0x2001, 0x002c, 0x900e, 0x0018,
+	0x2001, 0x0028, 0x900e, 0x9005, 0x0000, 0x012e, 0x00be, 0x00fe,
+	0x0005, 0x00b6, 0x00f6, 0x00e6, 0x0126, 0x2091, 0x8000, 0xa894,
+	0x90c6, 0x0015, 0x0904, 0x60d5, 0x90c6, 0x0056, 0x0904, 0x60d9,
+	0x90c6, 0x0066, 0x0904, 0x60dd, 0x90c6, 0x0067, 0x0904, 0x60e1,
+	0x90c6, 0x0068, 0x0904, 0x60e5, 0x90c6, 0x0071, 0x0904, 0x60e9,
+	0x90c6, 0x0074, 0x0904, 0x60ed, 0x90c6, 0x007c, 0x0904, 0x60f1,
+	0x90c6, 0x007e, 0x0904, 0x60f5, 0x90c6, 0x0037, 0x0904, 0x60f9,
+	0x9016, 0x2079, 0x1800, 0xa974, 0x9186, 0x00ff, 0x0904, 0x60d0,
+	0x9182, 0x0800, 0x1a04, 0x60d0, 0x080c, 0x6247, 0x1198, 0xb804,
+	0x9084, 0x00ff, 0x9082, 0x0006, 0x1268, 0xa894, 0x90c6, 0x006f,
+	0x0148, 0x080c, 0x9dc1, 0x1904, 0x60b9, 0xb8a0, 0x9084, 0xff80,
+	0x1904, 0x60b9, 0xa894, 0x90c6, 0x006f, 0x0158, 0x90c6, 0x005e,
+	0x0904, 0x6019, 0x90c6, 0x0064, 0x0904, 0x6042, 0x2008, 0x0804,
+	0x5fdc, 0xa998, 0xa8b0, 0x2040, 0x080c, 0x9dc1, 0x1120, 0x9182,
+	0x007f, 0x0a04, 0x5fdc, 0x9186, 0x00ff, 0x0904, 0x5fdc, 0x9182,
+	0x0800, 0x1a04, 0x5fdc, 0xaaa0, 0xab9c, 0x7878, 0x9306, 0x1188,
+	0x787c, 0x0096, 0x924e, 0x1128, 0x2208, 0x2310, 0x009e, 0x0804,
+	0x5fdc, 0x99cc, 0xff00, 0x009e, 0x1120, 0x2208, 0x2310, 0x0804,
+	0x5fdc, 0x080c, 0x47a3, 0x0904, 0x5fe5, 0x900e, 0x9016, 0x90c6,
+	0x4000, 0x1558, 0x0006, 0x080c, 0x6467, 0x1108, 0xc185, 0xb800,
+	0xd0bc, 0x0108, 0xc18d, 0x20a9, 0x0004, 0xa860, 0x20e8, 0xa85c,
+	0x9080, 0x0031, 0x20a0, 0xb8b4, 0x20e0, 0xb8b8, 0x9080, 0x0006,
+	0x2098, 0x080c, 0x0f68, 0x20a9, 0x0004, 0xa860, 0x20e8, 0xa85c,
+	0x9080, 0x0035, 0x20a0, 0xb8b4, 0x20e0, 0xb8b8, 0x9080, 0x000a,
+	0x2098, 0x080c, 0x0f68, 0x000e, 0x00c8, 0x90c6, 0x4007, 0x1110,
+	0x2408, 0x00a0, 0x90c6, 0x4008, 0x1118, 0x2708, 0x2610, 0x0070,
+	0x90c6, 0x4009, 0x1108, 0x0050, 0x90c6, 0x4006, 0x0138, 0x2001,
+	0x4005, 0x2009, 0x000a, 0x0010, 0x2001, 0x4006, 0xa896, 0xa99a,
+	0xaa9e, 0x2001, 0x0030, 0x900e, 0x0470, 0x080c, 0x9dec, 0x1130,
+	0x2001, 0x4005, 0x2009, 0x0003, 0x9016, 0x0c80, 0x2b00, 0x6012,
+	0x080c, 0xbfa6, 0x2900, 0x6016, 0x6023, 0x0001, 0xa868, 0xd88c,
+	0x0108, 0xc0f5, 0xa86a, 0x0126, 0x2091, 0x8000, 0x080c, 0x2fdc,
+	0x012e, 0x9006, 0x080c, 0x6184, 0x2001, 0x0002, 0x080c, 0x6198,
+	0x2009, 0x0002, 0x080c, 0x9ebc, 0xa8b0, 0xd094, 0x0118, 0xb8bc,
+	0xc08d, 0xb8be, 0x9006, 0x9005, 0x012e, 0x00ee, 0x00fe, 0x00be,
+	0x0005, 0x080c, 0x53a3, 0x0118, 0x2009, 0x0007, 0x00f8, 0xa998,
+	0xaeb0, 0x080c, 0x6247, 0x1904, 0x5fd7, 0x9186, 0x007f, 0x0130,
+	0x080c, 0x656b, 0x0118, 0x2009, 0x0009, 0x0080, 0x0096, 0x080c,
+	0x0feb, 0x1120, 0x009e, 0x2009, 0x0002, 0x0040, 0x2900, 0x009e,
+	0xa806, 0x080c, 0xbd12, 0x19b0, 0x2009, 0x0003, 0x2001, 0x4005,
+	0x0804, 0x5fde, 0xa998, 0xaeb0, 0x080c, 0x6247, 0x1904, 0x5fd7,
+	0x0096, 0x080c, 0x0feb, 0x1128, 0x009e, 0x2009, 0x0002, 0x0804,
+	0x6096, 0x2900, 0x009e, 0xa806, 0x0096, 0x2048, 0x20a9, 0x002b,
+	0xb8b4, 0x20e0, 0xb8b8, 0x2098, 0xa860, 0x20e8, 0xa85c, 0x9080,
+	0x0002, 0x20a0, 0x4003, 0x20a9, 0x0008, 0x9080, 0x0006, 0x20a0,
+	0xbbb8, 0x9398, 0x0006, 0x2398, 0x080c, 0x0f68, 0x009e, 0xa87b,
+	0x0000, 0xa883, 0x0000, 0xa897, 0x4000, 0xd684, 0x1168, 0x080c,
+	0x538f, 0xd0b4, 0x1118, 0xa89b, 0x000b, 0x00e0, 0xb800, 0xd08c,
+	0x0118, 0xa89b, 0x000c, 0x00b0, 0x080c, 0x656b, 0x0118, 0xa89b,
+	0x0009, 0x0080, 0x080c, 0x53a3, 0x0118, 0xa89b, 0x0007, 0x0050,
+	0x080c, 0xbcf5, 0x1904, 0x6012, 0x2009, 0x0003, 0x2001, 0x4005,
+	0x0804, 0x5fde, 0xa87b, 0x0030, 0xa897, 0x4005, 0xa804, 0x8006,
+	0x8006, 0x8007, 0x90bc, 0x003f, 0x9084, 0xffc0, 0x9080, 0x0002,
+	0x2009, 0x002b, 0xaaa0, 0xab9c, 0xaca8, 0xada4, 0x2031, 0x0000,
+	0x2041, 0x122f, 0x080c, 0xa345, 0x1904, 0x6012, 0x2009, 0x0002,
+	0x08e8, 0x2001, 0x0028, 0x900e, 0x0804, 0x6013, 0x2009, 0x180c,
+	0x210c, 0xd18c, 0x0118, 0x2001, 0x0004, 0x0038, 0xd184, 0x0118,
+	0x2001, 0x0004, 0x0010, 0x2001, 0x0029, 0x900e, 0x0804, 0x6013,
+	0x2001, 0x0029, 0x900e, 0x0804, 0x6013, 0x080c, 0x3569, 0x0804,
+	0x6014, 0x080c, 0x50cc, 0x0804, 0x6014, 0x080c, 0x4339, 0x0804,
+	0x6014, 0x080c, 0x43b2, 0x0804, 0x6014, 0x080c, 0x440e, 0x0804,
+	0x6014, 0x080c, 0x485f, 0x0804, 0x6014, 0x080c, 0x4b04, 0x0804,
+	0x6014, 0x080c, 0x4d37, 0x0804, 0x6014, 0x080c, 0x4f30, 0x0804,
+	0x6014, 0x080c, 0x3779, 0x0804, 0x6014, 0x00b6, 0xa974, 0xae78,
+	0x9684, 0x3fff, 0x9082, 0x4000, 0x1618, 0x9182, 0x0800, 0x1268,
+	0x9188, 0x1000, 0x2104, 0x905d, 0x0140, 0x080c, 0x656b, 0x1148,
+	0x00e9, 0x080c, 0x6372, 0x9006, 0x00b0, 0x2001, 0x0028, 0x900e,
+	0x0090, 0x9082, 0x0006, 0x1240, 0xb900, 0xd1fc, 0x0d88, 0x2001,
+	0x0029, 0x2009, 0x1000, 0x0038, 0x2001, 0x0029, 0x900e, 0x0018,
+	0x2001, 0x0029, 0x900e, 0x9005, 0x00be, 0x0005, 0x0126, 0x2091,
+	0x8000, 0xb850, 0x900d, 0x0150, 0x2900, 0x0096, 0x2148, 0xa802,
+	0x009e, 0xa803, 0x0000, 0xb852, 0x012e, 0x0005, 0x2900, 0xb852,
+	0xb84e, 0xa803, 0x0000, 0x0cc0, 0x0126, 0x2091, 0x8000, 0xb84c,
+	0x9005, 0x0170, 0x00e6, 0x2071, 0x19b7, 0x7004, 0x9086, 0x0002,
+	0x0168, 0x00ee, 0xb84c, 0xa802, 0x2900, 0xb84e, 0x012e, 0x0005,
+	0x2900, 0xb852, 0xb84e, 0xa803, 0x0000, 0x0cc0, 0x701c, 0x9b06,
+	0x1d80, 0xb84c, 0x00a6, 0x2050, 0xb000, 0xa802, 0x2900, 0xb002,
+	0x00ae, 0x00ee, 0x012e, 0x0005, 0x0126, 0x2091, 0x8000, 0xb84c,
+	0x904d, 0x0130, 0xa800, 0x9005, 0x1108, 0xb852, 0xb84e, 0x9905,
+	0x012e, 0x0005, 0xb84c, 0x904d, 0x0130, 0xa800, 0x9005, 0x1108,
+	0xb852, 0xb84e, 0x9905, 0x0005, 0x00b6, 0x0126, 0x00c6, 0x0026,
+	0x2091, 0x8000, 0x6210, 0x2258, 0xba00, 0x9005, 0x0110, 0xc285,
+	0x0008, 0xc284, 0xba02, 0x002e, 0x00ce, 0x012e, 0x00be, 0x0005,
+	0x00b6, 0x0126, 0x00c6, 0x2091, 0x8000, 0x6210, 0x2258, 0xba04,
+	0x0006, 0x9086, 0x0006, 0x1170, 0xb89c, 0xd0ac, 0x0158, 0x080c,
+	0x6567, 0x0140, 0x9284, 0xff00, 0x8007, 0x9086, 0x0007, 0x1110,
+	0x2011, 0x0600, 0x000e, 0x9294, 0xff00, 0x9215, 0xba06, 0x0006,
+	0x9086, 0x0006, 0x1120, 0xba90, 0x82ff, 0x090c, 0x0db4, 0x000e,
+	0x00ce, 0x012e, 0x00be, 0x0005, 0x00b6, 0x0126, 0x00c6, 0x2091,
+	0x8000, 0x6210, 0x2258, 0xba04, 0x0006, 0x9086, 0x0006, 0x1168,
+	0xb89c, 0xd0a4, 0x0150, 0x080c, 0x6563, 0x1138, 0x9284, 0x00ff,
+	0x9086, 0x0007, 0x1110, 0x2011, 0x0006, 0x000e, 0x9294, 0x00ff,
+	0x8007, 0x9215, 0xba06, 0x00ce, 0x012e, 0x00be, 0x0005, 0x9182,
+	0x0800, 0x0218, 0x9085, 0x0001, 0x0005, 0x00d6, 0x0026, 0x9190,
+	0x1000, 0x2204, 0x905d, 0x1180, 0x0096, 0x080c, 0x0feb, 0x2958,
+	0x009e, 0x0160, 0x2b00, 0x2012, 0xb85c, 0xb8ba, 0xb860, 0xb8b6,
+	0x9006, 0xb8a6, 0x080c, 0x5cf4, 0x9006, 0x0010, 0x9085, 0x0001,
+	0x002e, 0x00de, 0x0005, 0x00b6, 0x0096, 0x0126, 0x2091, 0x8000,
+	0x0026, 0x9182, 0x0800, 0x0218, 0x9085, 0x0001, 0x0458, 0x00d6,
+	0x9190, 0x1000, 0x2204, 0x905d, 0x0518, 0x2013, 0x0000, 0xb8a4,
+	0x904d, 0x0110, 0x080c, 0x101d, 0x00d6, 0x00c6, 0xb8ac, 0x2060,
+	0x8cff, 0x0168, 0x600c, 0x0006, 0x6014, 0x2048, 0x080c, 0xbb2c,
+	0x0110, 0x080c, 0x0f9d, 0x080c, 0x9e42, 0x00ce, 0x0c88, 0x00ce,
+	0x00de, 0x2b48, 0xb8b8, 0xb85e, 0xb8b4, 0xb862, 0x080c, 0x102d,
+	0x00de, 0x9006, 0x002e, 0x012e, 0x009e, 0x00be, 0x0005, 0x0016,
+	0x9182, 0x0800, 0x0218, 0x9085, 0x0001, 0x0030, 0x9188, 0x1000,
+	0x2104, 0x905d, 0x0dc0, 0x9006, 0x001e, 0x0005, 0x00d6, 0x0156,
+	0x0136, 0x0146, 0x9006, 0xb80a, 0xb80e, 0xb800, 0xc08c, 0xb802,
+	0x080c, 0x6f9b, 0x1510, 0xb8a0, 0x9086, 0x007e, 0x0120, 0x080c,
+	0x9dc1, 0x11d8, 0x0078, 0x7040, 0xd0e4, 0x01b8, 0x00c6, 0x2061,
+	0x1952, 0x7048, 0x2062, 0x704c, 0x6006, 0x7050, 0x600a, 0x7054,
+	0x600e, 0x00ce, 0x703c, 0x2069, 0x0140, 0x9005, 0x1110, 0x2001,
+	0x0001, 0x6886, 0x2069, 0x1800, 0x68b2, 0x7040, 0xb85e, 0x7048,
+	0xb862, 0x704c, 0xb866, 0x20e1, 0x0000, 0x2099, 0x0276, 0xb8b4,
+	0x20e8, 0xb8b8, 0x9088, 0x000a, 0x21a0, 0x20a9, 0x0004, 0x4003,
+	0x2099, 0x027a, 0x9088, 0x0006, 0x21a0, 0x20a9, 0x0004, 0x4003,
+	0x2069, 0x0200, 0x6817, 0x0001, 0x7040, 0xb86a, 0x7144, 0xb96e,
+	0x7048, 0xb872, 0x7050, 0xb876, 0x2069, 0x0200, 0x6817, 0x0000,
+	0xb8a0, 0x9086, 0x007e, 0x1110, 0x7144, 0xb96e, 0x9182, 0x0211,
+	0x1218, 0x2009, 0x0008, 0x0400, 0x9182, 0x0259, 0x1218, 0x2009,
+	0x0007, 0x00d0, 0x9182, 0x02c1, 0x1218, 0x2009, 0x0006, 0x00a0,
+	0x9182, 0x0349, 0x1218, 0x2009, 0x0005, 0x0070, 0x9182, 0x0421,
+	0x1218, 0x2009, 0x0004, 0x0040, 0x9182, 0x0581, 0x1218, 0x2009,
+	0x0003, 0x0010, 0x2009, 0x0002, 0xb992, 0x014e, 0x013e, 0x015e,
+	0x00de, 0x0005, 0x0016, 0x0026, 0x00e6, 0x2071, 0x0260, 0x7034,
+	0xb896, 0x703c, 0xb89a, 0x7054, 0xb89e, 0x0036, 0xbbbc, 0xc384,
+	0xba00, 0x2009, 0x1873, 0x210c, 0xd0bc, 0x0120, 0xd1ec, 0x0110,
+	0xc2ad, 0x0008, 0xc2ac, 0xd0c4, 0x0148, 0xd1e4, 0x0138, 0xc2bd,
+	0xd0cc, 0x0128, 0xd38c, 0x1108, 0xc385, 0x0008, 0xc2bc, 0xba02,
+	0xbbbe, 0x003e, 0x00ee, 0x002e, 0x001e, 0x0005, 0x0096, 0x0126,
+	0x2091, 0x8000, 0xb8a4, 0x904d, 0x0578, 0xa900, 0x81ff, 0x15c0,
+	0xaa04, 0x9282, 0x0010, 0x16c8, 0x0136, 0x0146, 0x01c6, 0x01d6,
+	0x8906, 0x8006, 0x8007, 0x908c, 0x003f, 0x21e0, 0x9084, 0xffc0,
+	0x9080, 0x0004, 0x2098, 0x2009, 0x0010, 0x20a9, 0x0001, 0x4002,
+	0x9086, 0xffff, 0x0120, 0x8109, 0x1dd0, 0x080c, 0x0db4, 0x3c00,
+	0x20e8, 0x3300, 0x8001, 0x20a0, 0x4604, 0x8210, 0xaa06, 0x01de,
+	0x01ce, 0x014e, 0x013e, 0x0060, 0x080c, 0x0feb, 0x0170, 0x2900,
+	0xb8a6, 0xa803, 0x0000, 0x080c, 0x6403, 0xa807, 0x0001, 0xae12,
+	0x9085, 0x0001, 0x012e, 0x009e, 0x0005, 0x9006, 0x0cd8, 0x0126,
+	0x2091, 0x8000, 0x0096, 0xb8a4, 0x904d, 0x0188, 0xa800, 0x9005,
+	0x1150, 0x080c, 0x6412, 0x1158, 0xa804, 0x908a, 0x0002, 0x0218,
+	0x8001, 0xa806, 0x0020, 0x080c, 0x101d, 0xb8a7, 0x0000, 0x009e,
+	0x012e, 0x0005, 0x0126, 0x2091, 0x8000, 0x080c, 0x83f7, 0x012e,
+	0x0005, 0x901e, 0x0010, 0x2019, 0x0001, 0x900e, 0x0126, 0x2091,
+	0x8000, 0xb84c, 0x2048, 0xb800, 0xd0dc, 0x1170, 0x89ff, 0x0500,
+	0x83ff, 0x0120, 0xa878, 0x9606, 0x0158, 0x0030, 0xa86c, 0x9406,
+	0x1118, 0xa870, 0x9506, 0x0120, 0x2908, 0xa800, 0x2048, 0x0c70,
+	0x080c, 0x97b1, 0xaa00, 0xb84c, 0x9906, 0x1110, 0xba4e, 0x0020,
+	0x00a6, 0x2150, 0xb202, 0x00ae, 0x82ff, 0x1110, 0xb952, 0x89ff,
+	0x012e, 0x0005, 0x9016, 0x0489, 0x1110, 0x2011, 0x0001, 0x0005,
+	0x080c, 0x6467, 0x0128, 0x080c, 0xbbe9, 0x0010, 0x9085, 0x0001,
+	0x0005, 0x080c, 0x6467, 0x0128, 0x080c, 0xbb8e, 0x0010, 0x9085,
+	0x0001, 0x0005, 0x080c, 0x6467, 0x0128, 0x080c, 0xbbe6, 0x0010,
+	0x9085, 0x0001, 0x0005, 0x080c, 0x6467, 0x0128, 0x080c, 0xbbad,
+	0x0010, 0x9085, 0x0001, 0x0005, 0x080c, 0x6467, 0x0128, 0x080c,
+	0xbc2a, 0x0010, 0x9085, 0x0001, 0x0005, 0xb8a4, 0x900d, 0x1118,
+	0x9085, 0x0001, 0x0005, 0x0136, 0x01c6, 0xa800, 0x9005, 0x11b8,
+	0x890e, 0x810e, 0x810f, 0x9184, 0x003f, 0x20e0, 0x9184, 0xffc0,
+	0x9080, 0x0004, 0x2098, 0x20a9, 0x0001, 0x2009, 0x0010, 0x4002,
+	0x9606, 0x0128, 0x8109, 0x1dd8, 0x9085, 0x0001, 0x0008, 0x9006,
+	0x01ce, 0x013e, 0x0005, 0x0146, 0x01d6, 0xa860, 0x20e8, 0xa85c,
+	0x9080, 0x0004, 0x20a0, 0x20a9, 0x0010, 0x2009, 0xffff, 0x4104,
+	0x01de, 0x014e, 0x0136, 0x01c6, 0xa800, 0x9005, 0x11b8, 0x890e,
 	0x810e, 0x810f, 0x9184, 0x003f, 0x20e0, 0x9184, 0xffc0, 0x9080,
 	0x0004, 0x2098, 0x20a9, 0x0001, 0x2009, 0x0010, 0x4002, 0x9606,
-	0x0128, 0x8109, 0x1dd8, 0x9085, 0x0001, 0x0008, 0x9006, 0x01ce,
-	0x013e, 0x0005, 0x0146, 0x01d6, 0xa860, 0x20e8, 0xa85c, 0x9080,
-	0x0004, 0x20a0, 0x20a9, 0x0010, 0x2009, 0xffff, 0x4104, 0x01de,
-	0x014e, 0x0136, 0x01c6, 0xa800, 0x9005, 0x11b8, 0x890e, 0x810e,
-	0x810f, 0x9184, 0x003f, 0x20e0, 0x9184, 0xffc0, 0x9080, 0x0004,
-	0x2098, 0x20a9, 0x0001, 0x2009, 0x0010, 0x4002, 0x9606, 0x0128,
-	0x8109, 0x1dd8, 0x9085, 0x0001, 0x0068, 0x0146, 0x01d6, 0x3300,
-	0x8001, 0x20a0, 0x3c00, 0x20e8, 0x2001, 0xffff, 0x4004, 0x01de,
-	0x014e, 0x9006, 0x01ce, 0x013e, 0x0005, 0x0096, 0x0126, 0x2091,
-	0x8000, 0xb8a4, 0x904d, 0x1128, 0x080c, 0x0feb, 0x0168, 0x2900,
-	0xb8a6, 0x080c, 0x63fa, 0xa803, 0x0001, 0xa807, 0x0000, 0x9085,
-	0x0001, 0x012e, 0x009e, 0x0005, 0x9006, 0x0cd8, 0x0096, 0x0126,
-	0x2091, 0x8000, 0xb8a4, 0x904d, 0x0130, 0xb8a7, 0x0000, 0x080c,
-	0x101d, 0x9085, 0x0001, 0x012e, 0x009e, 0x0005, 0xb89c, 0xd0a4,
-	0x0005, 0x00b6, 0x00f6, 0x080c, 0x6fb2, 0x01b0, 0x71c0, 0x81ff,
-	0x1198, 0x71d8, 0xd19c, 0x0180, 0x2001, 0x007e, 0x9080, 0x1000,
-	0x2004, 0x905d, 0x0148, 0xb804, 0x9084, 0x00ff, 0x9086, 0x0006,
-	0x1118, 0xb800, 0xc0ed, 0xb802, 0x2079, 0x1853, 0x7804, 0x00d0,
-	0x0156, 0x20a9, 0x007f, 0x900e, 0x0016, 0x080c, 0x623e, 0x1168,
-	0xb804, 0x9084, 0xff00, 0x8007, 0x9096, 0x0004, 0x0118, 0x9086,
-	0x0006, 0x1118, 0xb800, 0xc0ed, 0xb802, 0x001e, 0x8108, 0x1f04,
-	0x6484, 0x015e, 0x080c, 0x6520, 0x0120, 0x2001, 0x1956, 0x200c,
-	0x0030, 0x2079, 0x1853, 0x7804, 0x0030, 0x2009, 0x07d0, 0x2011,
-	0x64ae, 0x080c, 0x80ca, 0x00fe, 0x00be, 0x0005, 0x00b6, 0x2011,
-	0x64ae, 0x080c, 0x8038, 0x080c, 0x6520, 0x01d8, 0x2001, 0x107e,
-	0x2004, 0x2058, 0xb900, 0xc1ec, 0xb902, 0x080c, 0x655e, 0x0130,
-	0x2009, 0x07d0, 0x2011, 0x64ae, 0x080c, 0x80ca, 0x00e6, 0x2071,
-	0x1800, 0x9006, 0x707a, 0x705c, 0x707e, 0x080c, 0x2dbb, 0x00ee,
-	0x04b0, 0x0156, 0x00c6, 0x20a9, 0x007f, 0x900e, 0x0016, 0x080c,
-	0x623e, 0x1538, 0xb800, 0xd0ec, 0x0520, 0x0046, 0xbaa0, 0x2220,
-	0x9006, 0x2009, 0x0029, 0x080c, 0xd52a, 0xb800, 0xc0e5, 0xc0ec,
-	0xb802, 0x080c, 0x655a, 0x2001, 0x0707, 0x1128, 0xb804, 0x9084,
-	0x00ff, 0x9085, 0x0700, 0xb806, 0x2019, 0x0029, 0x080c, 0x8571,
-	0x0076, 0x903e, 0x080c, 0x8469, 0x900e, 0x080c, 0xd29b, 0x007e,
-	0x004e, 0x001e, 0x8108, 0x1f04, 0x64d6, 0x00ce, 0x015e, 0x00be,
-	0x0005, 0x00b6, 0x6010, 0x2058, 0xb800, 0xc0ec, 0xb802, 0x00be,
-	0x0005, 0x7810, 0x00b6, 0x2058, 0xb800, 0x00be, 0xd0ac, 0x0005,
-	0x6010, 0x00b6, 0x905d, 0x0108, 0xb800, 0x00be, 0xd0bc, 0x0005,
-	0x00b6, 0x00f6, 0x2001, 0x107e, 0x2004, 0x905d, 0x0110, 0xb800,
-	0xd0ec, 0x00fe, 0x00be, 0x0005, 0x0126, 0x0026, 0x2091, 0x8000,
-	0x0006, 0xbaa0, 0x9290, 0x1000, 0x2204, 0x9b06, 0x190c, 0x0db4,
-	0x000e, 0xba00, 0x9005, 0x0110, 0xc2fd, 0x0008, 0xc2fc, 0xba02,
-	0x002e, 0x012e, 0x0005, 0x2011, 0x1836, 0x2204, 0xd0cc, 0x0138,
-	0x2001, 0x1954, 0x200c, 0x2011, 0x6550, 0x080c, 0x80ca, 0x0005,
-	0x2011, 0x6550, 0x080c, 0x8038, 0x2011, 0x1836, 0x2204, 0xc0cc,
-	0x2012, 0x0005, 0x080c, 0x5386, 0xd0ac, 0x0005, 0x080c, 0x5386,
-	0xd0a4, 0x0005, 0x0016, 0xb904, 0x9184, 0x00ff, 0x908e, 0x0006,
-	0x001e, 0x0005, 0x0016, 0xb904, 0x9184, 0xff00, 0x8007, 0x908e,
-	0x0006, 0x001e, 0x0005, 0x00b6, 0x00f6, 0x080c, 0xc212, 0x0158,
-	0x70d8, 0x9084, 0x0028, 0x0138, 0x2001, 0x107f, 0x2004, 0x905d,
-	0x0110, 0xb8bc, 0xd094, 0x00fe, 0x00be, 0x0005, 0x0006, 0x0016,
-	0x0036, 0x0046, 0x0076, 0x00b6, 0x2001, 0x1817, 0x203c, 0x9780,
-	0x3138, 0x203d, 0x97bc, 0xff00, 0x873f, 0x9006, 0x2018, 0x2008,
-	0x9284, 0x8000, 0x0110, 0x2019, 0x0001, 0x9294, 0x7fff, 0x2100,
-	0x9706, 0x0190, 0x91a0, 0x1000, 0x2404, 0x905d, 0x0168, 0xb804,
-	0x9084, 0x00ff, 0x9086, 0x0006, 0x1138, 0x83ff, 0x0118, 0xb89c,
-	0xd0a4, 0x0110, 0x8211, 0x0158, 0x8108, 0x83ff, 0x0120, 0x9182,
-	0x0800, 0x0e28, 0x0068, 0x9182, 0x007e, 0x0e08, 0x0048, 0x00be,
-	0x007e, 0x004e, 0x003e, 0x001e, 0x9085, 0x0001, 0x000e, 0x0005,
-	0x00be, 0x007e, 0x004e, 0x003e, 0x001e, 0x9006, 0x000e, 0x0005,
-	0x0046, 0x0056, 0x0076, 0x00b6, 0x2100, 0x9084, 0x7fff, 0x9080,
-	0x1000, 0x2004, 0x905d, 0x0130, 0xb804, 0x9084, 0x00ff, 0x9086,
-	0x0006, 0x0550, 0x9184, 0x8000, 0x0580, 0x2001, 0x1817, 0x203c,
-	0x9780, 0x3138, 0x203d, 0x97bc, 0xff00, 0x873f, 0x9006, 0x2020,
-	0x2400, 0x9706, 0x01a0, 0x94a8, 0x1000, 0x2504, 0x905d, 0x0178,
-	0xb804, 0x9084, 0x00ff, 0x9086, 0x0006, 0x1148, 0xb89c, 0xd0a4,
-	0x0130, 0xb814, 0x9206, 0x1118, 0xb810, 0x9306, 0x0128, 0x8420,
-	0x9482, 0x0800, 0x0e28, 0x0048, 0x918c, 0x7fff, 0x00be, 0x007e,
-	0x005e, 0x004e, 0x9085, 0x0001, 0x0005, 0x918c, 0x7fff, 0x00be,
-	0x007e, 0x005e, 0x004e, 0x9006, 0x0005, 0x2071, 0x1906, 0x7003,
-	0x0001, 0x7007, 0x0000, 0x9006, 0x7012, 0x7016, 0x701a, 0x701e,
-	0x700a, 0x7046, 0x2001, 0x1919, 0x2003, 0x0000, 0x0005, 0x0016,
-	0x00e6, 0x2071, 0x191a, 0x900e, 0x710a, 0x080c, 0x5386, 0xd0fc,
-	0x1140, 0x080c, 0x5386, 0x900e, 0xd09c, 0x0108, 0x8108, 0x7102,
-	0x0400, 0x2001, 0x1873, 0x200c, 0x9184, 0x0007, 0x9006, 0x0002,
-	0x6639, 0x6639, 0x6639, 0x6639, 0x6639, 0x6650, 0x665e, 0x6639,
-	0x7003, 0x0003, 0x2009, 0x1874, 0x210c, 0x9184, 0xff00, 0x8007,
-	0x9005, 0x1110, 0x2001, 0x0002, 0x7006, 0x0018, 0x7003, 0x0005,
-	0x0c88, 0x00ee, 0x001e, 0x0005, 0x00e6, 0x2071, 0x0050, 0x684c,
-	0x9005, 0x1150, 0x00e6, 0x2071, 0x1906, 0x7028, 0xc085, 0x702a,
-	0x00ee, 0x9085, 0x0001, 0x0488, 0x6844, 0x9005, 0x0158, 0x080c,
-	0x7308, 0x6a60, 0x9200, 0x7002, 0x6864, 0x9101, 0x7006, 0x9006,
-	0x7012, 0x7016, 0x6860, 0x7002, 0x6864, 0x7006, 0x6868, 0x700a,
-	0x686c, 0x700e, 0x6844, 0x9005, 0x1110, 0x7012, 0x7016, 0x684c,
-	0x701a, 0x701c, 0x9085, 0x0040, 0x701e, 0x7037, 0x0019, 0x702b,
-	0x0001, 0x00e6, 0x2071, 0x1906, 0x7028, 0xc084, 0x702a, 0x7007,
-	0x0001, 0x700b, 0x0000, 0x00ee, 0x9006, 0x00ee, 0x0005, 0xa868,
-	0xd0fc, 0x11d8, 0x00e6, 0x0026, 0x2001, 0x191a, 0x2004, 0x9005,
-	0x0904, 0x6891, 0xa87c, 0xd0bc, 0x1904, 0x6891, 0xa978, 0xa874,
-	0x9105, 0x1904, 0x6891, 0x2001, 0x191a, 0x2004, 0x0002, 0x6891,
-	0x66ea, 0x6726, 0x6726, 0x6891, 0x6726, 0x0005, 0xa868, 0xd0fc,
-	0x1500, 0x00e6, 0x0026, 0x2009, 0x191a, 0x210c, 0x81ff, 0x0904,
-	0x6891, 0xa87c, 0xd0cc, 0x0904, 0x6891, 0xa880, 0x9084, 0x00ff,
-	0x9086, 0x0001, 0x1904, 0x6891, 0x9186, 0x0003, 0x0904, 0x6726,
-	0x9186, 0x0005, 0x0904, 0x6726, 0xa84f, 0x8021, 0xa853, 0x0017,
-	0x0028, 0x0005, 0xa84f, 0x8020, 0xa853, 0x0016, 0x2071, 0x1906,
-	0x701c, 0x9005, 0x1904, 0x6a51, 0x0e04, 0x6a9c, 0x2071, 0x0000,
-	0xa84c, 0x7082, 0xa850, 0x7032, 0xa86c, 0x7086, 0x7036, 0xa870,
-	0x708a, 0x2091, 0x4080, 0x2001, 0x0089, 0x2004, 0xd084, 0x190c,
-	0x1187, 0x2071, 0x1800, 0x2011, 0x0001, 0xa804, 0x900d, 0x702c,
-	0x1158, 0xa802, 0x2900, 0x702e, 0x70bc, 0x9200, 0x70be, 0x080c,
-	0x7f5d, 0x002e, 0x00ee, 0x0005, 0x0096, 0x2148, 0xa904, 0xa802,
-	0x8210, 0x2900, 0x81ff, 0x1dc8, 0x009e, 0x0c58, 0xa84f, 0x0000,
-	0x00f6, 0x2079, 0x0050, 0x2071, 0x1906, 0xa803, 0x0000, 0x7010,
-	0x9005, 0x1904, 0x6815, 0x782c, 0x908c, 0x0780, 0x190c, 0x6bc3,
-	0x8004, 0x8004, 0x8004, 0x9084, 0x0003, 0x0002, 0x6744, 0x6815,
-	0x6769, 0x67b0, 0x080c, 0x0db4, 0x2071, 0x1800, 0x2900, 0x7822,
-	0xa804, 0x900d, 0x1170, 0x2071, 0x19cb, 0x703c, 0x9005, 0x1328,
-	0x2001, 0x191b, 0x2004, 0x8005, 0x703e, 0x00fe, 0x002e, 0x00ee,
-	0x0005, 0x9016, 0x702c, 0x2148, 0xa904, 0xa802, 0x8210, 0x2900,
-	0x81ff, 0x1dc8, 0x702e, 0x70bc, 0x9200, 0x70be, 0x080c, 0x7f5d,
-	0x0c10, 0x2071, 0x1800, 0x2900, 0x7822, 0xa804, 0x900d, 0x1580,
-	0x7824, 0x00e6, 0x2071, 0x0040, 0x712c, 0xd19c, 0x1148, 0x2009,
-	0x182f, 0x210c, 0x918a, 0x0040, 0x0218, 0x7022, 0x00ee, 0x0058,
-	0x00ee, 0x2048, 0x702c, 0xa802, 0x2900, 0x702e, 0x70bc, 0x8000,
-	0x70be, 0x080c, 0x7f5d, 0x782c, 0x9094, 0x0780, 0x190c, 0x6bc3,
-	0xd0a4, 0x19f0, 0x2071, 0x19cb, 0x703c, 0x9005, 0x1328, 0x2001,
-	0x191b, 0x2004, 0x8005, 0x703e, 0x00fe, 0x002e, 0x00ee, 0x0005,
-	0x9016, 0x702c, 0x2148, 0xa904, 0xa802, 0x8210, 0x2900, 0x81ff,
-	0x1dc8, 0x702e, 0x70bc, 0x9200, 0x70be, 0x080c, 0x7f5d, 0x0800,
-	0x0096, 0x00e6, 0x7824, 0x2048, 0x2071, 0x1800, 0x702c, 0xa802,
-	0x2900, 0x702e, 0x70bc, 0x8000, 0x70be, 0x080c, 0x7f5d, 0x782c,
-	0x9094, 0x0780, 0x190c, 0x6bc3, 0xd0a4, 0x1d60, 0x00ee, 0x782c,
-	0x9094, 0x0780, 0x190c, 0x6bc3, 0xd09c, 0x11a0, 0x009e, 0x2900,
-	0x7822, 0xa804, 0x900d, 0x1560, 0x2071, 0x19cb, 0x703c, 0x9005,
-	0x1328, 0x2001, 0x191b, 0x2004, 0x8005, 0x703e, 0x00fe, 0x002e,
-	0x00ee, 0x0005, 0x009e, 0x2908, 0x7010, 0x8000, 0x7012, 0x7018,
-	0x904d, 0x711a, 0x0110, 0xa902, 0x0008, 0x711e, 0x2148, 0xa804,
-	0x900d, 0x1170, 0x2071, 0x19cb, 0x703c, 0x9005, 0x1328, 0x2001,
-	0x191b, 0x2004, 0x8005, 0x703e, 0x00fe, 0x002e, 0x00ee, 0x0005,
+	0x0128, 0x8109, 0x1dd8, 0x9085, 0x0001, 0x0068, 0x0146, 0x01d6,
+	0x3300, 0x8001, 0x20a0, 0x3c00, 0x20e8, 0x2001, 0xffff, 0x4004,
+	0x01de, 0x014e, 0x9006, 0x01ce, 0x013e, 0x0005, 0x0096, 0x0126,
+	0x2091, 0x8000, 0xb8a4, 0x904d, 0x1128, 0x080c, 0x0feb, 0x0168,
+	0x2900, 0xb8a6, 0x080c, 0x6403, 0xa803, 0x0001, 0xa807, 0x0000,
+	0x9085, 0x0001, 0x012e, 0x009e, 0x0005, 0x9006, 0x0cd8, 0x0096,
+	0x0126, 0x2091, 0x8000, 0xb8a4, 0x904d, 0x0130, 0xb8a7, 0x0000,
+	0x080c, 0x101d, 0x9085, 0x0001, 0x012e, 0x009e, 0x0005, 0xb89c,
+	0xd0a4, 0x0005, 0x00b6, 0x00f6, 0x080c, 0x6f9b, 0x01b0, 0x71c0,
+	0x81ff, 0x1198, 0x71d8, 0xd19c, 0x0180, 0x2001, 0x007e, 0x9080,
+	0x1000, 0x2004, 0x905d, 0x0148, 0xb804, 0x9084, 0x00ff, 0x9086,
+	0x0006, 0x1118, 0xb800, 0xc0ed, 0xb802, 0x2079, 0x1853, 0x7804,
+	0x00d0, 0x0156, 0x20a9, 0x007f, 0x900e, 0x0016, 0x080c, 0x6247,
+	0x1168, 0xb804, 0x9084, 0xff00, 0x8007, 0x9096, 0x0004, 0x0118,
+	0x9086, 0x0006, 0x1118, 0xb800, 0xc0ed, 0xb802, 0x001e, 0x8108,
+	0x1f04, 0x648d, 0x015e, 0x080c, 0x6529, 0x0120, 0x2001, 0x1955,
+	0x200c, 0x0030, 0x2079, 0x1853, 0x7804, 0x0030, 0x2009, 0x07d0,
+	0x2011, 0x64b7, 0x080c, 0x80b3, 0x00fe, 0x00be, 0x0005, 0x00b6,
+	0x2011, 0x64b7, 0x080c, 0x8021, 0x080c, 0x6529, 0x01d8, 0x2001,
+	0x107e, 0x2004, 0x2058, 0xb900, 0xc1ec, 0xb902, 0x080c, 0x6567,
+	0x0130, 0x2009, 0x07d0, 0x2011, 0x64b7, 0x080c, 0x80b3, 0x00e6,
+	0x2071, 0x1800, 0x9006, 0x707a, 0x705c, 0x707e, 0x080c, 0x2dbd,
+	0x00ee, 0x04b0, 0x0156, 0x00c6, 0x20a9, 0x007f, 0x900e, 0x0016,
+	0x080c, 0x6247, 0x1538, 0xb800, 0xd0ec, 0x0520, 0x0046, 0xbaa0,
+	0x2220, 0x9006, 0x2009, 0x0029, 0x080c, 0xd54b, 0xb800, 0xc0e5,
+	0xc0ec, 0xb802, 0x080c, 0x6563, 0x2001, 0x0707, 0x1128, 0xb804,
+	0x9084, 0x00ff, 0x9085, 0x0700, 0xb806, 0x2019, 0x0029, 0x080c,
+	0x8564, 0x0076, 0x903e, 0x080c, 0x8452, 0x900e, 0x080c, 0xd2bc,
+	0x007e, 0x004e, 0x001e, 0x8108, 0x1f04, 0x64df, 0x00ce, 0x015e,
+	0x00be, 0x0005, 0x00b6, 0x6010, 0x2058, 0xb800, 0xc0ec, 0xb802,
+	0x00be, 0x0005, 0x7810, 0x00b6, 0x2058, 0xb800, 0x00be, 0xd0ac,
+	0x0005, 0x6010, 0x00b6, 0x905d, 0x0108, 0xb800, 0x00be, 0xd0bc,
+	0x0005, 0x00b6, 0x00f6, 0x2001, 0x107e, 0x2004, 0x905d, 0x0110,
+	0xb800, 0xd0ec, 0x00fe, 0x00be, 0x0005, 0x0126, 0x0026, 0x2091,
+	0x8000, 0x0006, 0xbaa0, 0x9290, 0x1000, 0x2204, 0x9b06, 0x190c,
+	0x0db4, 0x000e, 0xba00, 0x9005, 0x0110, 0xc2fd, 0x0008, 0xc2fc,
+	0xba02, 0x002e, 0x012e, 0x0005, 0x2011, 0x1836, 0x2204, 0xd0cc,
+	0x0138, 0x2001, 0x1953, 0x200c, 0x2011, 0x6559, 0x080c, 0x80b3,
+	0x0005, 0x2011, 0x6559, 0x080c, 0x8021, 0x2011, 0x1836, 0x2204,
+	0xc0cc, 0x2012, 0x0005, 0x080c, 0x538f, 0xd0ac, 0x0005, 0x080c,
+	0x538f, 0xd0a4, 0x0005, 0x0016, 0xb904, 0x9184, 0x00ff, 0x908e,
+	0x0006, 0x001e, 0x0005, 0x0016, 0xb904, 0x9184, 0xff00, 0x8007,
+	0x908e, 0x0006, 0x001e, 0x0005, 0x00b6, 0x00f6, 0x080c, 0xc22c,
+	0x0158, 0x70d8, 0x9084, 0x0028, 0x0138, 0x2001, 0x107f, 0x2004,
+	0x905d, 0x0110, 0xb8bc, 0xd094, 0x00fe, 0x00be, 0x0005, 0x0006,
+	0x0016, 0x0036, 0x0046, 0x0076, 0x00b6, 0x2001, 0x1817, 0x203c,
+	0x9780, 0x313a, 0x203d, 0x97bc, 0xff00, 0x873f, 0x9006, 0x2018,
+	0x2008, 0x9284, 0x8000, 0x0110, 0x2019, 0x0001, 0x9294, 0x7fff,
+	0x2100, 0x9706, 0x0190, 0x91a0, 0x1000, 0x2404, 0x905d, 0x0168,
+	0xb804, 0x9084, 0x00ff, 0x9086, 0x0006, 0x1138, 0x83ff, 0x0118,
+	0xb89c, 0xd0a4, 0x0110, 0x8211, 0x0158, 0x8108, 0x83ff, 0x0120,
+	0x9182, 0x0800, 0x0e28, 0x0068, 0x9182, 0x007e, 0x0e08, 0x0048,
+	0x00be, 0x007e, 0x004e, 0x003e, 0x001e, 0x9085, 0x0001, 0x000e,
+	0x0005, 0x00be, 0x007e, 0x004e, 0x003e, 0x001e, 0x9006, 0x000e,
+	0x0005, 0x0046, 0x0056, 0x0076, 0x00b6, 0x2100, 0x9084, 0x7fff,
+	0x9080, 0x1000, 0x2004, 0x905d, 0x0130, 0xb804, 0x9084, 0x00ff,
+	0x9086, 0x0006, 0x0550, 0x9184, 0x8000, 0x0580, 0x2001, 0x1817,
+	0x203c, 0x9780, 0x313a, 0x203d, 0x97bc, 0xff00, 0x873f, 0x9006,
+	0x2020, 0x2400, 0x9706, 0x01a0, 0x94a8, 0x1000, 0x2504, 0x905d,
+	0x0178, 0xb804, 0x9084, 0x00ff, 0x9086, 0x0006, 0x1148, 0xb89c,
+	0xd0a4, 0x0130, 0xb814, 0x9206, 0x1118, 0xb810, 0x9306, 0x0128,
+	0x8420, 0x9482, 0x0800, 0x0e28, 0x0048, 0x918c, 0x7fff, 0x00be,
+	0x007e, 0x005e, 0x004e, 0x9085, 0x0001, 0x0005, 0x918c, 0x7fff,
+	0x00be, 0x007e, 0x005e, 0x004e, 0x9006, 0x0005, 0x2071, 0x1906,
+	0x7003, 0x0001, 0x7007, 0x0000, 0x9006, 0x7012, 0x7016, 0x701a,
+	0x701e, 0x700a, 0x7046, 0x0005, 0x0016, 0x00e6, 0x2071, 0x1919,
+	0x900e, 0x710a, 0x080c, 0x538f, 0xd0fc, 0x1140, 0x080c, 0x538f,
+	0x900e, 0xd09c, 0x0108, 0x8108, 0x7102, 0x0400, 0x2001, 0x1873,
+	0x200c, 0x9184, 0x0007, 0x9006, 0x0002, 0x663e, 0x663e, 0x663e,
+	0x663e, 0x663e, 0x6655, 0x6663, 0x663e, 0x7003, 0x0003, 0x2009,
+	0x1874, 0x210c, 0x9184, 0xff00, 0x8007, 0x9005, 0x1110, 0x2001,
+	0x0002, 0x7006, 0x0018, 0x7003, 0x0005, 0x0c88, 0x00ee, 0x001e,
+	0x0005, 0x00e6, 0x2071, 0x0050, 0x684c, 0x9005, 0x1150, 0x00e6,
+	0x2071, 0x1906, 0x7028, 0xc085, 0x702a, 0x00ee, 0x9085, 0x0001,
+	0x0488, 0x6844, 0x9005, 0x0158, 0x080c, 0x72f1, 0x6a60, 0x9200,
+	0x7002, 0x6864, 0x9101, 0x7006, 0x9006, 0x7012, 0x7016, 0x6860,
+	0x7002, 0x6864, 0x7006, 0x6868, 0x700a, 0x686c, 0x700e, 0x6844,
+	0x9005, 0x1110, 0x7012, 0x7016, 0x684c, 0x701a, 0x701c, 0x9085,
+	0x0040, 0x701e, 0x7037, 0x0019, 0x702b, 0x0001, 0x00e6, 0x2071,
+	0x1906, 0x7028, 0xc084, 0x702a, 0x7007, 0x0001, 0x700b, 0x0000,
+	0x00ee, 0x9006, 0x00ee, 0x0005, 0xa868, 0xd0fc, 0x11d8, 0x00e6,
+	0x0026, 0x2001, 0x1919, 0x2004, 0x9005, 0x0904, 0x6896, 0xa87c,
+	0xd0bc, 0x1904, 0x6896, 0xa978, 0xa874, 0x9105, 0x1904, 0x6896,
+	0x2001, 0x1919, 0x2004, 0x0002, 0x6896, 0x66ef, 0x672b, 0x672b,
+	0x6896, 0x672b, 0x0005, 0xa868, 0xd0fc, 0x1500, 0x00e6, 0x0026,
+	0x2009, 0x1919, 0x210c, 0x81ff, 0x0904, 0x6896, 0xa87c, 0xd0cc,
+	0x0904, 0x6896, 0xa880, 0x9084, 0x00ff, 0x9086, 0x0001, 0x1904,
+	0x6896, 0x9186, 0x0003, 0x0904, 0x672b, 0x9186, 0x0005, 0x0904,
+	0x672b, 0xa84f, 0x8021, 0xa853, 0x0017, 0x0028, 0x0005, 0xa84f,
+	0x8020, 0xa853, 0x0016, 0x2071, 0x1906, 0x701c, 0x9005, 0x1904,
+	0x6a4a, 0x0e04, 0x6a95, 0x2071, 0x0000, 0xa84c, 0x7082, 0xa850,
+	0x7032, 0xa86c, 0x7086, 0x7036, 0xa870, 0x708a, 0x2091, 0x4080,
+	0x2001, 0x0089, 0x2004, 0xd084, 0x190c, 0x1187, 0x2071, 0x1800,
+	0x2011, 0x0001, 0xa804, 0x900d, 0x702c, 0x1158, 0xa802, 0x2900,
+	0x702e, 0x70bc, 0x9200, 0x70be, 0x080c, 0x7f46, 0x002e, 0x00ee,
+	0x0005, 0x0096, 0x2148, 0xa904, 0xa802, 0x8210, 0x2900, 0x81ff,
+	0x1dc8, 0x009e, 0x0c58, 0xa84f, 0x0000, 0x00f6, 0x2079, 0x0050,
+	0x2071, 0x1906, 0xa803, 0x0000, 0x7010, 0x9005, 0x1904, 0x681a,
+	0x782c, 0x908c, 0x0780, 0x190c, 0x6bbc, 0x8004, 0x8004, 0x8004,
+	0x9084, 0x0003, 0x0002, 0x6749, 0x681a, 0x676e, 0x67b5, 0x080c,
+	0x0db4, 0x2071, 0x1800, 0x2900, 0x7822, 0xa804, 0x900d, 0x1170,
+	0x2071, 0x19ca, 0x703c, 0x9005, 0x1328, 0x2001, 0x191a, 0x2004,
+	0x8005, 0x703e, 0x00fe, 0x002e, 0x00ee, 0x0005, 0x9016, 0x702c,
+	0x2148, 0xa904, 0xa802, 0x8210, 0x2900, 0x81ff, 0x1dc8, 0x702e,
+	0x70bc, 0x9200, 0x70be, 0x080c, 0x7f46, 0x0c10, 0x2071, 0x1800,
+	0x2900, 0x7822, 0xa804, 0x900d, 0x1580, 0x7824, 0x00e6, 0x2071,
+	0x0040, 0x712c, 0xd19c, 0x1148, 0x2009, 0x182f, 0x210c, 0x918a,
+	0x0040, 0x0218, 0x7022, 0x00ee, 0x0058, 0x00ee, 0x2048, 0x702c,
+	0xa802, 0x2900, 0x702e, 0x70bc, 0x8000, 0x70be, 0x080c, 0x7f46,
+	0x782c, 0x9094, 0x0780, 0x190c, 0x6bbc, 0xd0a4, 0x19f0, 0x2071,
+	0x19ca, 0x703c, 0x9005, 0x1328, 0x2001, 0x191a, 0x2004, 0x8005,
+	0x703e, 0x00fe, 0x002e, 0x00ee, 0x0005, 0x9016, 0x702c, 0x2148,
+	0xa904, 0xa802, 0x8210, 0x2900, 0x81ff, 0x1dc8, 0x702e, 0x70bc,
+	0x9200, 0x70be, 0x080c, 0x7f46, 0x0800, 0x0096, 0x00e6, 0x7824,
+	0x2048, 0x2071, 0x1800, 0x702c, 0xa802, 0x2900, 0x702e, 0x70bc,
+	0x8000, 0x70be, 0x080c, 0x7f46, 0x782c, 0x9094, 0x0780, 0x190c,
+	0x6bbc, 0xd0a4, 0x1d60, 0x00ee, 0x782c, 0x9094, 0x0780, 0x190c,
+	0x6bbc, 0xd09c, 0x11a0, 0x009e, 0x2900, 0x7822, 0xa804, 0x900d,
+	0x1560, 0x2071, 0x19ca, 0x703c, 0x9005, 0x1328, 0x2001, 0x191a,
+	0x2004, 0x8005, 0x703e, 0x00fe, 0x002e, 0x00ee, 0x0005, 0x009e,
+	0x2908, 0x7010, 0x8000, 0x7012, 0x7018, 0x904d, 0x711a, 0x0110,
+	0xa902, 0x0008, 0x711e, 0x2148, 0xa804, 0x900d, 0x1170, 0x2071,
+	0x19ca, 0x703c, 0x9005, 0x1328, 0x2001, 0x191a, 0x2004, 0x8005,
+	0x703e, 0x00fe, 0x002e, 0x00ee, 0x0005, 0x2071, 0x1800, 0x9016,
+	0x702c, 0x2148, 0xa904, 0xa802, 0x8210, 0x2900, 0x81ff, 0x1dc8,
+	0x702e, 0x70bc, 0x9200, 0x70be, 0x080c, 0x7f46, 0x00fe, 0x002e,
+	0x00ee, 0x0005, 0x2908, 0x7010, 0x8000, 0x7012, 0x7018, 0x904d,
+	0x711a, 0x0110, 0xa902, 0x0008, 0x711e, 0x2148, 0xa804, 0x900d,
+	0x1904, 0x686f, 0x782c, 0x9094, 0x0780, 0x190c, 0x6bbc, 0xd09c,
+	0x1198, 0x701c, 0x904d, 0x0180, 0x7010, 0x8001, 0x7012, 0x1108,
+	0x701a, 0xa800, 0x701e, 0x2900, 0x7822, 0x782c, 0x9094, 0x0780,
+	0x190c, 0x6bbc, 0xd09c, 0x0d68, 0x782c, 0x9094, 0x0780, 0x190c,
+	0x6bbc, 0xd0a4, 0x01b0, 0x00e6, 0x7824, 0x2048, 0x2071, 0x1800,
+	0x702c, 0xa802, 0x2900, 0x702e, 0x70bc, 0x8000, 0x70be, 0x080c,
+	0x7f46, 0x782c, 0x9094, 0x0780, 0x190c, 0x6bbc, 0xd0a4, 0x1d60,
+	0x00ee, 0x2071, 0x19ca, 0x703c, 0x9005, 0x1328, 0x2001, 0x191a,
+	0x2004, 0x8005, 0x703e, 0x00fe, 0x002e, 0x00ee, 0x0005, 0x00e6,
 	0x2071, 0x1800, 0x9016, 0x702c, 0x2148, 0xa904, 0xa802, 0x8210,
 	0x2900, 0x81ff, 0x1dc8, 0x702e, 0x70bc, 0x9200, 0x70be, 0x080c,
-	0x7f5d, 0x00fe, 0x002e, 0x00ee, 0x0005, 0x2908, 0x7010, 0x8000,
-	0x7012, 0x7018, 0x904d, 0x711a, 0x0110, 0xa902, 0x0008, 0x711e,
-	0x2148, 0xa804, 0x900d, 0x1904, 0x686a, 0x782c, 0x9094, 0x0780,
-	0x190c, 0x6bc3, 0xd09c, 0x1198, 0x701c, 0x904d, 0x0180, 0x7010,
-	0x8001, 0x7012, 0x1108, 0x701a, 0xa800, 0x701e, 0x2900, 0x7822,
-	0x782c, 0x9094, 0x0780, 0x190c, 0x6bc3, 0xd09c, 0x0d68, 0x782c,
-	0x9094, 0x0780, 0x190c, 0x6bc3, 0xd0a4, 0x01b0, 0x00e6, 0x7824,
-	0x2048, 0x2071, 0x1800, 0x702c, 0xa802, 0x2900, 0x702e, 0x70bc,
-	0x8000, 0x70be, 0x080c, 0x7f5d, 0x782c, 0x9094, 0x0780, 0x190c,
-	0x6bc3, 0xd0a4, 0x1d60, 0x00ee, 0x2071, 0x19cb, 0x703c, 0x9005,
-	0x1328, 0x2001, 0x191b, 0x2004, 0x8005, 0x703e, 0x00fe, 0x002e,
-	0x00ee, 0x0005, 0x00e6, 0x2071, 0x1800, 0x9016, 0x702c, 0x2148,
+	0x7f46, 0x00ee, 0x0804, 0x682a, 0xa868, 0xd0fc, 0x1904, 0x68d2,
+	0x0096, 0xa804, 0xa807, 0x0000, 0x904d, 0x190c, 0x0f9d, 0x009e,
+	0x0018, 0xa868, 0xd0fc, 0x15f0, 0x00e6, 0x0026, 0xa84f, 0x0000,
+	0x00f6, 0x2079, 0x0050, 0x2071, 0x1800, 0x70e8, 0x8001, 0x01d0,
+	0x1678, 0x2071, 0x1906, 0xa803, 0x0000, 0x7010, 0x9005, 0x1904,
+	0x69c8, 0x782c, 0x908c, 0x0780, 0x190c, 0x6bbc, 0x8004, 0x8004,
+	0x8004, 0x9084, 0x0003, 0x0002, 0x68d3, 0x69c8, 0x68ee, 0x695b,
+	0x080c, 0x0db4, 0x70eb, 0x0fa0, 0x71e4, 0x8107, 0x9106, 0x9094,
+	0x00c0, 0x9184, 0xff3f, 0x9205, 0x70e6, 0x3b08, 0x3a00, 0x9104,
+	0x918d, 0x00c0, 0x21d8, 0x9084, 0xff3f, 0x9205, 0x20d0, 0x0888,
+	0x70ea, 0x0878, 0x0005, 0x2071, 0x1800, 0x2900, 0x7822, 0xa804,
+	0x900d, 0x1120, 0x00fe, 0x002e, 0x00ee, 0x0005, 0x9016, 0x702c,
+	0x2148, 0xa904, 0xa802, 0x8210, 0x2900, 0x81ff, 0x1dc8, 0x702e,
+	0x70bc, 0x9200, 0x70be, 0x080c, 0x7f46, 0x0c60, 0x2071, 0x1800,
+	0x2900, 0x7822, 0xa804, 0x900d, 0x1904, 0x694a, 0x7830, 0x8007,
+	0x9084, 0x001f, 0x9082, 0x0001, 0x1220, 0x00fe, 0x002e, 0x00ee,
+	0x0005, 0x7824, 0x00e6, 0x2071, 0x0040, 0x712c, 0xd19c, 0x1148,
+	0x2009, 0x182f, 0x210c, 0x918a, 0x0040, 0x0218, 0x7022, 0x00ee,
+	0x0058, 0x00ee, 0x2048, 0x702c, 0xa802, 0x2900, 0x702e, 0x70bc,
+	0x8000, 0x70be, 0x080c, 0x7f46, 0x782c, 0x9094, 0x0780, 0x190c,
+	0x6bbc, 0xd0a4, 0x19f0, 0x0e04, 0x6941, 0x7838, 0x7938, 0x910e,
+	0x1de0, 0x00d6, 0x2069, 0x0000, 0x6836, 0x6833, 0x0013, 0x00de,
+	0x2001, 0x1917, 0x200c, 0xc184, 0x2102, 0x2091, 0x4080, 0x2001,
+	0x0089, 0x2004, 0xd084, 0x190c, 0x1187, 0x00fe, 0x002e, 0x00ee,
+	0x0005, 0x2001, 0x1917, 0x200c, 0xc185, 0x2102, 0x00fe, 0x002e,
+	0x00ee, 0x0005, 0x9016, 0x702c, 0x2148, 0xa904, 0xa802, 0x8210,
+	0x2900, 0x81ff, 0x1dc8, 0x702e, 0x70bc, 0x9200, 0x70be, 0x080c,
+	0x7f46, 0x0804, 0x6901, 0x0096, 0x00e6, 0x7824, 0x2048, 0x2071,
+	0x1800, 0x702c, 0xa802, 0x2900, 0x702e, 0x70bc, 0x8000, 0x70be,
+	0x080c, 0x7f46, 0x782c, 0x9094, 0x0780, 0x190c, 0x6bbc, 0xd0a4,
+	0x1d60, 0x00ee, 0x0e04, 0x699b, 0x7838, 0x7938, 0x910e, 0x1de0,
+	0x00d6, 0x2069, 0x0000, 0x6836, 0x6833, 0x0013, 0x00de, 0x7044,
+	0xc084, 0x7046, 0x2091, 0x4080, 0x2001, 0x0089, 0x2004, 0xd084,
+	0x190c, 0x1187, 0x782c, 0x9094, 0x0780, 0x190c, 0x6bbc, 0xd09c,
+	0x1170, 0x009e, 0x2900, 0x7822, 0xa804, 0x900d, 0x11e0, 0x00fe,
+	0x002e, 0x00ee, 0x0005, 0x7044, 0xc085, 0x7046, 0x0c58, 0x009e,
+	0x2908, 0x7010, 0x8000, 0x7012, 0x7018, 0x904d, 0x711a, 0x0110,
+	0xa902, 0x0008, 0x711e, 0x2148, 0xa804, 0x900d, 0x1120, 0x00fe,
+	0x002e, 0x00ee, 0x0005, 0x2071, 0x1800, 0x9016, 0x702c, 0x2148,
 	0xa904, 0xa802, 0x8210, 0x2900, 0x81ff, 0x1dc8, 0x702e, 0x70bc,
-	0x9200, 0x70be, 0x080c, 0x7f5d, 0x00ee, 0x0804, 0x6825, 0xa868,
-	0xd0fc, 0x1904, 0x68cd, 0x0096, 0xa804, 0xa807, 0x0000, 0x904d,
-	0x190c, 0x0f9d, 0x009e, 0x0018, 0xa868, 0xd0fc, 0x15f0, 0x00e6,
-	0x0026, 0xa84f, 0x0000, 0x00f6, 0x2079, 0x0050, 0x2071, 0x1800,
-	0x70e8, 0x8001, 0x01d0, 0x1678, 0x2071, 0x1906, 0xa803, 0x0000,
-	0x7010, 0x9005, 0x1904, 0x69cb, 0x782c, 0x908c, 0x0780, 0x190c,
-	0x6bc3, 0x8004, 0x8004, 0x8004, 0x9084, 0x0003, 0x0002, 0x68ce,
-	0x69cb, 0x68e9, 0x695a, 0x080c, 0x0db4, 0x70eb, 0x0fa0, 0x71e4,
-	0x8107, 0x9106, 0x9094, 0x00c0, 0x9184, 0xff3f, 0x9205, 0x70e6,
-	0x3b08, 0x3a00, 0x9104, 0x918d, 0x00c0, 0x21d8, 0x9084, 0xff3f,
-	0x9205, 0x20d0, 0x0888, 0x70ea, 0x0878, 0x0005, 0x2071, 0x1800,
-	0x2900, 0x7822, 0xa804, 0x900d, 0x1120, 0x00fe, 0x002e, 0x00ee,
-	0x0005, 0x9016, 0x702c, 0x2148, 0xa904, 0xa802, 0x8210, 0x2900,
-	0x81ff, 0x1dc8, 0x702e, 0x70bc, 0x9200, 0x70be, 0x080c, 0x7f5d,
-	0x0c60, 0x2071, 0x1800, 0x2900, 0x7822, 0xa804, 0x900d, 0x1904,
-	0x6949, 0x7830, 0x8007, 0x9084, 0x001f, 0x9082, 0x0005, 0x1220,
-	0x00fe, 0x002e, 0x00ee, 0x0005, 0x7824, 0x00e6, 0x2071, 0x0040,
-	0x712c, 0xd19c, 0x1148, 0x2009, 0x182f, 0x210c, 0x918a, 0x0040,
-	0x0218, 0x7022, 0x00ee, 0x0058, 0x00ee, 0x2048, 0x702c, 0xa802,
-	0x2900, 0x702e, 0x70bc, 0x8000, 0x70be, 0x080c, 0x7f5d, 0x782c,
-	0x9094, 0x0780, 0x190c, 0x6bc3, 0xd0a4, 0x19f0, 0x0e04, 0x6940,
-	0x7838, 0x7938, 0x910e, 0x1de0, 0x00d6, 0x2069, 0x0000, 0x6836,
-	0x6833, 0x0013, 0x00de, 0x2001, 0x1917, 0x200c, 0xc184, 0x2102,
-	0x2091, 0x4080, 0x2001, 0x0089, 0x2004, 0xd084, 0x190c, 0x1187,
-	0x2009, 0x1919, 0x200b, 0x0000, 0x00fe, 0x002e, 0x00ee, 0x0005,
-	0x2001, 0x1917, 0x200c, 0xc185, 0x2102, 0x00fe, 0x002e, 0x00ee,
-	0x0005, 0x9016, 0x702c, 0x2148, 0xa904, 0xa802, 0x8210, 0x2900,
-	0x81ff, 0x1dc8, 0x702e, 0x70bc, 0x9200, 0x70be, 0x080c, 0x7f5d,
-	0x0804, 0x68fc, 0x0096, 0x00e6, 0x7824, 0x2048, 0x2071, 0x1800,
-	0x702c, 0xa802, 0x2900, 0x702e, 0x70bc, 0x8000, 0x70be, 0x080c,
-	0x7f5d, 0x782c, 0x9094, 0x0780, 0x190c, 0x6bc3, 0xd0a4, 0x1d60,
-	0x00ee, 0x0e04, 0x699e, 0x7838, 0x7938, 0x910e, 0x1de0, 0x00d6,
-	0x2069, 0x0000, 0x6836, 0x6833, 0x0013, 0x00de, 0x7044, 0xc084,
-	0x7046, 0x2091, 0x4080, 0x2001, 0x0089, 0x2004, 0xd084, 0x190c,
-	0x1187, 0x2009, 0x1919, 0x200b, 0x0000, 0x782c, 0x9094, 0x0780,
-	0x190c, 0x6bc3, 0xd09c, 0x1170, 0x009e, 0x2900, 0x7822, 0xa804,
-	0x900d, 0x11e0, 0x00fe, 0x002e, 0x00ee, 0x0005, 0x7044, 0xc085,
-	0x7046, 0x0c58, 0x009e, 0x2908, 0x7010, 0x8000, 0x7012, 0x7018,
-	0x904d, 0x711a, 0x0110, 0xa902, 0x0008, 0x711e, 0x2148, 0xa804,
-	0x900d, 0x1120, 0x00fe, 0x002e, 0x00ee, 0x0005, 0x2071, 0x1800,
-	0x9016, 0x702c, 0x2148, 0xa904, 0xa802, 0x8210, 0x2900, 0x81ff,
-	0x1dc8, 0x702e, 0x70bc, 0x9200, 0x70be, 0x080c, 0x7f5d, 0x00fe,
-	0x002e, 0x00ee, 0x0005, 0x2908, 0x7010, 0x8000, 0x7012, 0x7018,
-	0x904d, 0x711a, 0x0110, 0xa902, 0x0008, 0x711e, 0x2148, 0xa804,
-	0x900d, 0x1904, 0x6a3c, 0x782c, 0x9094, 0x0780, 0x190c, 0x6bc3,
-	0xd09c, 0x11b0, 0x701c, 0x904d, 0x0198, 0xa84c, 0x9005, 0x1180,
-	0x7010, 0x8001, 0x7012, 0x1108, 0x701a, 0xa800, 0x701e, 0x2900,
-	0x7822, 0x782c, 0x9094, 0x0780, 0x190c, 0x6bc3, 0xd09c, 0x0d50,
-	0x782c, 0x9094, 0x0780, 0x190c, 0x6bc3, 0xd0a4, 0x05c8, 0x00e6,
-	0x7824, 0x2048, 0x2071, 0x1800, 0x702c, 0xa802, 0x2900, 0x702e,
-	0x70bc, 0x8000, 0x70be, 0x080c, 0x7f5d, 0x782c, 0x9094, 0x0780,
-	0x190c, 0x6bc3, 0xd0a4, 0x1d60, 0x00ee, 0x0e04, 0x6a35, 0x7838,
-	0x7938, 0x910e, 0x1de0, 0x00d6, 0x2069, 0x0000, 0x6836, 0x6833,
-	0x0013, 0x00de, 0x7044, 0xc084, 0x7046, 0x2091, 0x4080, 0x2001,
-	0x0089, 0x2004, 0xd084, 0x190c, 0x1187, 0x2009, 0x1919, 0x200b,
-	0x0000, 0x00fe, 0x002e, 0x00ee, 0x0005, 0x7044, 0xc085, 0x7046,
-	0x00fe, 0x002e, 0x00ee, 0x0005, 0x00e6, 0x2071, 0x1800, 0x9016,
-	0x702c, 0x2148, 0xa904, 0xa802, 0x8210, 0x2900, 0x81ff, 0x1dc8,
-	0x702e, 0x70bc, 0x9200, 0x70be, 0x080c, 0x7f5d, 0x00ee, 0x0804,
-	0x69db, 0x2071, 0x1906, 0xa803, 0x0000, 0x2908, 0x7010, 0x8000,
-	0x7012, 0x7018, 0x904d, 0x711a, 0x0110, 0xa902, 0x0008, 0x711e,
-	0x2148, 0xa804, 0x900d, 0x1128, 0x1e04, 0x6a7c, 0x002e, 0x00ee,
-	0x0005, 0x2071, 0x1800, 0x9016, 0x702c, 0x2148, 0xa904, 0xa802,
-	0x8210, 0x2900, 0x81ff, 0x1dc8, 0x702e, 0x70bc, 0x9200, 0x70be,
-	0x080c, 0x7f5d, 0x0e04, 0x6a66, 0x2071, 0x1906, 0x701c, 0x2048,
-	0xa84c, 0x900d, 0x0d18, 0x2071, 0x0000, 0x7182, 0xa850, 0x7032,
-	0xa86c, 0x7086, 0x7036, 0xa870, 0x708a, 0x2091, 0x4080, 0x2001,
-	0x0089, 0x2004, 0xd084, 0x190c, 0x1187, 0x2071, 0x1906, 0x080c,
-	0x6baf, 0x002e, 0x00ee, 0x0005, 0x2071, 0x1906, 0xa803, 0x0000,
+	0x9200, 0x70be, 0x080c, 0x7f46, 0x00fe, 0x002e, 0x00ee, 0x0005,
 	0x2908, 0x7010, 0x8000, 0x7012, 0x7018, 0x904d, 0x711a, 0x0110,
-	0xa902, 0x0008, 0x711e, 0x2148, 0xa804, 0x900d, 0x1118, 0x002e,
+	0xa902, 0x0008, 0x711e, 0x2148, 0xa804, 0x900d, 0x1904, 0x6a35,
+	0x782c, 0x9094, 0x0780, 0x190c, 0x6bbc, 0xd09c, 0x11b0, 0x701c,
+	0x904d, 0x0198, 0xa84c, 0x9005, 0x1180, 0x7010, 0x8001, 0x7012,
+	0x1108, 0x701a, 0xa800, 0x701e, 0x2900, 0x7822, 0x782c, 0x9094,
+	0x0780, 0x190c, 0x6bbc, 0xd09c, 0x0d50, 0x782c, 0x9094, 0x0780,
+	0x190c, 0x6bbc, 0xd0a4, 0x05a8, 0x00e6, 0x7824, 0x2048, 0x2071,
+	0x1800, 0x702c, 0xa802, 0x2900, 0x702e, 0x70bc, 0x8000, 0x70be,
+	0x080c, 0x7f46, 0x782c, 0x9094, 0x0780, 0x190c, 0x6bbc, 0xd0a4,
+	0x1d60, 0x00ee, 0x0e04, 0x6a2e, 0x7838, 0x7938, 0x910e, 0x1de0,
+	0x00d6, 0x2069, 0x0000, 0x6836, 0x6833, 0x0013, 0x00de, 0x7044,
+	0xc084, 0x7046, 0x2091, 0x4080, 0x2001, 0x0089, 0x2004, 0xd084,
+	0x190c, 0x1187, 0x00fe, 0x002e, 0x00ee, 0x0005, 0x7044, 0xc085,
+	0x7046, 0x00fe, 0x002e, 0x00ee, 0x0005, 0x00e6, 0x2071, 0x1800,
+	0x9016, 0x702c, 0x2148, 0xa904, 0xa802, 0x8210, 0x2900, 0x81ff,
+	0x1dc8, 0x702e, 0x70bc, 0x9200, 0x70be, 0x080c, 0x7f46, 0x00ee,
+	0x0804, 0x69d8, 0x2071, 0x1906, 0xa803, 0x0000, 0x2908, 0x7010,
+	0x8000, 0x7012, 0x7018, 0x904d, 0x711a, 0x0110, 0xa902, 0x0008,
+	0x711e, 0x2148, 0xa804, 0x900d, 0x1128, 0x1e04, 0x6a75, 0x002e,
 	0x00ee, 0x0005, 0x2071, 0x1800, 0x9016, 0x702c, 0x2148, 0xa904,
 	0xa802, 0x8210, 0x2900, 0x81ff, 0x1dc8, 0x702e, 0x70bc, 0x9200,
-	0x70be, 0x080c, 0x7f5d, 0x002e, 0x00ee, 0x0005, 0x0006, 0xa87c,
-	0x0006, 0xa867, 0x0103, 0x20a9, 0x001c, 0xa860, 0x20e8, 0xa85c,
-	0x9080, 0x001d, 0x20a0, 0x9006, 0x4004, 0x000e, 0x9084, 0x00ff,
-	0xa87e, 0x000e, 0xa87a, 0xa982, 0x0005, 0x2071, 0x1906, 0x7004,
-	0x0002, 0x6ae7, 0x6ae8, 0x6bae, 0x6ae8, 0x0db4, 0x6bae, 0x0005,
-	0x2001, 0x191a, 0x2004, 0x0002, 0x6af2, 0x6af2, 0x6b47, 0x6b48,
-	0x6af2, 0x6b48, 0x0126, 0x2091, 0x8000, 0x1e0c, 0x6bce, 0x701c,
-	0x904d, 0x01e0, 0xa84c, 0x9005, 0x01d8, 0x0e04, 0x6b16, 0xa94c,
-	0x2071, 0x0000, 0x7182, 0xa850, 0x7032, 0xa86c, 0x7086, 0x7036,
-	0xa870, 0x708a, 0x2091, 0x4080, 0x2001, 0x0089, 0x2004, 0xd084,
-	0x190c, 0x1187, 0x2071, 0x1906, 0x080c, 0x6baf, 0x012e, 0x0470,
-	0x2001, 0x005b, 0x2004, 0x9094, 0x0780, 0x190c, 0x6bc3, 0xd09c,
-	0x2071, 0x1906, 0x1510, 0x2071, 0x1906, 0x700f, 0x0001, 0xa964,
-	0x9184, 0x00ff, 0x9086, 0x0003, 0x1130, 0x810f, 0x918c, 0x00ff,
-	0x8101, 0x0108, 0x710e, 0x2900, 0x00d6, 0x2069, 0x0050, 0x6822,
-	0x00de, 0x2071, 0x1906, 0x701c, 0x2048, 0x7010, 0x8001, 0x7012,
-	0xa800, 0x701e, 0x9005, 0x1108, 0x701a, 0x012e, 0x0005, 0x0005,
-	0x00d6, 0x2008, 0x2069, 0x19cb, 0x683c, 0x9005, 0x0760, 0x0158,
-	0x9186, 0x0003, 0x0540, 0x2001, 0x1814, 0x2004, 0x2009, 0x1a98,
-	0x210c, 0x9102, 0x1500, 0x0126, 0x2091, 0x8000, 0x2069, 0x0050,
-	0x693c, 0x6838, 0x9106, 0x0190, 0x0e04, 0x6b7a, 0x2069, 0x0000,
-	0x6837, 0x8040, 0x6833, 0x0012, 0x6883, 0x8040, 0x2091, 0x4080,
-	0x2001, 0x0089, 0x2004, 0xd084, 0x190c, 0x1187, 0x2069, 0x19cb,
-	0x683f, 0xffff, 0x012e, 0x00de, 0x0126, 0x2091, 0x8000, 0x1e0c,
-	0x6c3f, 0x701c, 0x904d, 0x0540, 0x2001, 0x005b, 0x2004, 0x9094,
-	0x0780, 0x15c9, 0xd09c, 0x1500, 0x2071, 0x1906, 0x700f, 0x0001,
+	0x70be, 0x080c, 0x7f46, 0x0e04, 0x6a5f, 0x2071, 0x1906, 0x701c,
+	0x2048, 0xa84c, 0x900d, 0x0d18, 0x2071, 0x0000, 0x7182, 0xa850,
+	0x7032, 0xa86c, 0x7086, 0x7036, 0xa870, 0x708a, 0x2091, 0x4080,
+	0x2001, 0x0089, 0x2004, 0xd084, 0x190c, 0x1187, 0x2071, 0x1906,
+	0x080c, 0x6ba8, 0x002e, 0x00ee, 0x0005, 0x2071, 0x1906, 0xa803,
+	0x0000, 0x2908, 0x7010, 0x8000, 0x7012, 0x7018, 0x904d, 0x711a,
+	0x0110, 0xa902, 0x0008, 0x711e, 0x2148, 0xa804, 0x900d, 0x1118,
+	0x002e, 0x00ee, 0x0005, 0x2071, 0x1800, 0x9016, 0x702c, 0x2148,
+	0xa904, 0xa802, 0x8210, 0x2900, 0x81ff, 0x1dc8, 0x702e, 0x70bc,
+	0x9200, 0x70be, 0x080c, 0x7f46, 0x002e, 0x00ee, 0x0005, 0x0006,
+	0xa87c, 0x0006, 0xa867, 0x0103, 0x20a9, 0x001c, 0xa860, 0x20e8,
+	0xa85c, 0x9080, 0x001d, 0x20a0, 0x9006, 0x4004, 0x000e, 0x9084,
+	0x00ff, 0xa87e, 0x000e, 0xa87a, 0xa982, 0x0005, 0x2071, 0x1906,
+	0x7004, 0x0002, 0x6ae0, 0x6ae1, 0x6ba7, 0x6ae1, 0x0db4, 0x6ba7,
+	0x0005, 0x2001, 0x1919, 0x2004, 0x0002, 0x6aeb, 0x6aeb, 0x6b40,
+	0x6b41, 0x6aeb, 0x6b41, 0x0126, 0x2091, 0x8000, 0x1e0c, 0x6bc7,
+	0x701c, 0x904d, 0x01e0, 0xa84c, 0x9005, 0x01d8, 0x0e04, 0x6b0f,
+	0xa94c, 0x2071, 0x0000, 0x7182, 0xa850, 0x7032, 0xa86c, 0x7086,
+	0x7036, 0xa870, 0x708a, 0x2091, 0x4080, 0x2001, 0x0089, 0x2004,
+	0xd084, 0x190c, 0x1187, 0x2071, 0x1906, 0x080c, 0x6ba8, 0x012e,
+	0x0470, 0x2001, 0x005b, 0x2004, 0x9094, 0x0780, 0x190c, 0x6bbc,
+	0xd09c, 0x2071, 0x1906, 0x1510, 0x2071, 0x1906, 0x700f, 0x0001,
 	0xa964, 0x9184, 0x00ff, 0x9086, 0x0003, 0x1130, 0x810f, 0x918c,
 	0x00ff, 0x8101, 0x0108, 0x710e, 0x2900, 0x00d6, 0x2069, 0x0050,
-	0x6822, 0x00de, 0x701c, 0x2048, 0x7010, 0x8001, 0x7012, 0xa800,
-	0x701e, 0x9005, 0x1108, 0x701a, 0x012e, 0x0005, 0x0005, 0x0126,
-	0x2091, 0x8000, 0x701c, 0x904d, 0x0160, 0x7010, 0x8001, 0x7012,
-	0xa800, 0x701e, 0x9005, 0x1108, 0x701a, 0x012e, 0x080c, 0x101d,
-	0x0005, 0x012e, 0x0005, 0x2091, 0x8000, 0x0e04, 0x6bc5, 0x0006,
-	0x0016, 0x2001, 0x8004, 0x0006, 0x0804, 0x0dbd, 0x0096, 0x00f6,
-	0x2079, 0x0050, 0x7044, 0xd084, 0x01e0, 0xc084, 0x7046, 0x7838,
-	0x7938, 0x910e, 0x1de0, 0x00d6, 0x2069, 0x0000, 0x6836, 0x6833,
-	0x0013, 0x00de, 0x2091, 0x4080, 0x2001, 0x0089, 0x2004, 0xd084,
-	0x190c, 0x1187, 0x2009, 0x1919, 0x200b, 0x0000, 0x00fe, 0x009e,
-	0x0005, 0x782c, 0x9094, 0x0780, 0x1971, 0xd0a4, 0x0db8, 0x2009,
-	0x1919, 0x2104, 0x8000, 0x200a, 0x9082, 0x000f, 0x0e78, 0x00e6,
-	0x2071, 0x1800, 0x7824, 0x00e6, 0x2071, 0x0040, 0x712c, 0xd19c,
-	0x1148, 0x2009, 0x182f, 0x210c, 0x918a, 0x0040, 0x0218, 0x7022,
-	0x00ee, 0x0058, 0x00ee, 0x2048, 0x702c, 0xa802, 0x2900, 0x702e,
-	0x70bc, 0x8000, 0x70be, 0x080c, 0x7f5d, 0x782c, 0x9094, 0x0780,
-	0x190c, 0x6bc3, 0xd0a4, 0x19f0, 0x7838, 0x7938, 0x910e, 0x1de0,
-	0x00d6, 0x2069, 0x0000, 0x6836, 0x6833, 0x0013, 0x00de, 0x2091,
-	0x4080, 0x2001, 0x0089, 0x2004, 0xd084, 0x190c, 0x1187, 0x2009,
-	0x1919, 0x200b, 0x0000, 0x00ee, 0x00fe, 0x009e, 0x0005, 0x00f6,
-	0x2079, 0x0050, 0x7044, 0xd084, 0x01b8, 0xc084, 0x7046, 0x7838,
-	0x7938, 0x910e, 0x1de0, 0x00d6, 0x2069, 0x0000, 0x6836, 0x6833,
-	0x0013, 0x00de, 0x2091, 0x4080, 0x2001, 0x0089, 0x2004, 0xd084,
-	0x190c, 0x1187, 0x00fe, 0x0005, 0x782c, 0x9094, 0x0780, 0x190c,
-	0x6bc3, 0xd0a4, 0x0db8, 0x00e6, 0x2071, 0x1800, 0x7824, 0x2048,
-	0x702c, 0xa802, 0x2900, 0x702e, 0x70bc, 0x8000, 0x70be, 0x080c,
-	0x7f5d, 0x782c, 0x9094, 0x0780, 0x190c, 0x6bc3, 0xd0a4, 0x1d70,
-	0x00d6, 0x2069, 0x0050, 0x693c, 0x2069, 0x191a, 0x6808, 0x690a,
-	0x2069, 0x19cb, 0x9102, 0x1118, 0x683c, 0x9005, 0x1328, 0x2001,
-	0x191b, 0x200c, 0x810d, 0x693e, 0x00de, 0x00ee, 0x00fe, 0x0005,
-	0x7094, 0x908a, 0x0029, 0x1a0c, 0x0db4, 0x9082, 0x001d, 0x001b,
-	0x6027, 0x1e00, 0x0005, 0x6d67, 0x6ced, 0x6d09, 0x6d33, 0x6d56,
-	0x6d96, 0x6da8, 0x6d09, 0x6d7e, 0x6ca8, 0x6cd6, 0x6ca7, 0x0005,
-	0x00d6, 0x2069, 0x0200, 0x6804, 0x9005, 0x1180, 0x6808, 0x9005,
-	0x1518, 0x7097, 0x0028, 0x2069, 0x1960, 0x2d04, 0x7002, 0x080c,
-	0x70eb, 0x6028, 0x9085, 0x0600, 0x602a, 0x00b0, 0x7097, 0x0028,
-	0x2069, 0x1960, 0x2d04, 0x7002, 0x6028, 0x9085, 0x0600, 0x602a,
-	0x00e6, 0x0036, 0x0046, 0x0056, 0x2071, 0x1a33, 0x080c, 0x1958,
-	0x005e, 0x004e, 0x003e, 0x00ee, 0x00de, 0x0005, 0x00d6, 0x2069,
-	0x0200, 0x6804, 0x9005, 0x1178, 0x6808, 0x9005, 0x1160, 0x7097,
-	0x0028, 0x2069, 0x1960, 0x2d04, 0x7002, 0x080c, 0x7185, 0x6028,
-	0x9085, 0x0600, 0x602a, 0x00de, 0x0005, 0x0006, 0x2001, 0x0090,
-	0x080c, 0x2b14, 0x000e, 0x6124, 0xd1e4, 0x1190, 0x080c, 0x6e15,
-	0xd1d4, 0x1160, 0xd1dc, 0x1138, 0xd1cc, 0x0150, 0x7097, 0x0020,
-	0x080c, 0x6e15, 0x0028, 0x7097, 0x001d, 0x0010, 0x7097, 0x001f,
-	0x0005, 0x2001, 0x0088, 0x080c, 0x2b14, 0x6124, 0xd1cc, 0x11e8,
-	0xd1dc, 0x11c0, 0xd1e4, 0x1198, 0x9184, 0x1e00, 0x11d8, 0x080c,
-	0x1982, 0x60e3, 0x0001, 0x600c, 0xc0b4, 0x600e, 0x080c, 0x6fde,
-	0x2001, 0x0080, 0x080c, 0x2b14, 0x7097, 0x0028, 0x0058, 0x7097,
-	0x001e, 0x0040, 0x7097, 0x001d, 0x0028, 0x7097, 0x0020, 0x0010,
-	0x7097, 0x001f, 0x0005, 0x080c, 0x1982, 0x60e3, 0x0001, 0x600c,
-	0xc0b4, 0x600e, 0x080c, 0x6fde, 0x2001, 0x0080, 0x080c, 0x2b14,
-	0x6124, 0xd1d4, 0x1180, 0xd1dc, 0x1158, 0xd1e4, 0x1130, 0x9184,
-	0x1e00, 0x1158, 0x7097, 0x0028, 0x0040, 0x7097, 0x001e, 0x0028,
-	0x7097, 0x001d, 0x0010, 0x7097, 0x001f, 0x0005, 0x2001, 0x00a0,
-	0x080c, 0x2b14, 0x6124, 0xd1dc, 0x1138, 0xd1e4, 0x0138, 0x080c,
-	0x1982, 0x7097, 0x001e, 0x0010, 0x7097, 0x001d, 0x0005, 0x080c,
-	0x6e98, 0x6124, 0xd1dc, 0x1188, 0x080c, 0x6e15, 0x0016, 0x080c,
-	0x1982, 0x001e, 0xd1d4, 0x1128, 0xd1e4, 0x0138, 0x7097, 0x001e,
-	0x0020, 0x7097, 0x001f, 0x080c, 0x6e15, 0x0005, 0x0006, 0x2001,
-	0x00a0, 0x080c, 0x2b14, 0x000e, 0x6124, 0xd1d4, 0x1160, 0xd1cc,
-	0x1150, 0xd1dc, 0x1128, 0xd1e4, 0x0140, 0x7097, 0x001e, 0x0028,
-	0x7097, 0x001d, 0x0010, 0x7097, 0x0021, 0x0005, 0x080c, 0x6e98,
-	0x6124, 0xd1d4, 0x1150, 0xd1dc, 0x1128, 0xd1e4, 0x0140, 0x7097,
-	0x001e, 0x0028, 0x7097, 0x001d, 0x0010, 0x7097, 0x001f, 0x0005,
-	0x0006, 0x2001, 0x0090, 0x080c, 0x2b14, 0x000e, 0x6124, 0xd1d4,
-	0x1178, 0xd1cc, 0x1150, 0xd1dc, 0x1128, 0xd1e4, 0x0158, 0x7097,
-	0x001e, 0x0040, 0x7097, 0x001d, 0x0028, 0x7097, 0x0020, 0x0010,
-	0x7097, 0x001f, 0x0005, 0x0016, 0x00c6, 0x00d6, 0x00e6, 0x0126,
-	0x2061, 0x0100, 0x2069, 0x0140, 0x2071, 0x1800, 0x2091, 0x8000,
-	0x080c, 0x6fb2, 0x11d8, 0x2001, 0x180c, 0x200c, 0xd1b4, 0x01b0,
-	0xc1b4, 0x2102, 0x6027, 0x0200, 0x080c, 0x2a5d, 0x6024, 0xd0cc,
-	0x0148, 0x2001, 0x00a0, 0x080c, 0x2b14, 0x080c, 0x7296, 0x080c,
-	0x5cd1, 0x0428, 0x6028, 0xc0cd, 0x602a, 0x0408, 0x080c, 0x6fcc,
-	0x0150, 0x080c, 0x6fc3, 0x1138, 0x2001, 0x0001, 0x080c, 0x260c,
-	0x080c, 0x6f8a, 0x00a0, 0x080c, 0x6e95, 0x0178, 0x2001, 0x0001,
-	0x080c, 0x260c, 0x7094, 0x9086, 0x001e, 0x0120, 0x7094, 0x9086,
-	0x0022, 0x1118, 0x7097, 0x0025, 0x0010, 0x7097, 0x0021, 0x012e,
-	0x00ee, 0x00de, 0x00ce, 0x001e, 0x0005, 0x0026, 0x2011, 0x6e26,
-	0x080c, 0x810c, 0x002e, 0x0016, 0x0026, 0x2009, 0x0064, 0x2011,
-	0x6e26, 0x080c, 0x8103, 0x002e, 0x001e, 0x0005, 0x00e6, 0x00f6,
-	0x0016, 0x080c, 0x93ac, 0x2071, 0x1800, 0x080c, 0x6dc3, 0x001e,
-	0x00fe, 0x00ee, 0x0005, 0x0016, 0x0026, 0x0036, 0x00c6, 0x00d6,
-	0x00e6, 0x00f6, 0x0126, 0x080c, 0x93ac, 0x2061, 0x0100, 0x2069,
-	0x0140, 0x2071, 0x1800, 0x2091, 0x8000, 0x6028, 0xc09c, 0x602a,
-	0x2011, 0x0003, 0x080c, 0x9771, 0x2011, 0x0002, 0x080c, 0x977b,
-	0x080c, 0x9662, 0x080c, 0x80b8, 0x0036, 0x901e, 0x080c, 0x96d8,
-	0x003e, 0x60e3, 0x0000, 0x080c, 0xd8b4, 0x080c, 0xd8cf, 0x2009,
-	0x0004, 0x080c, 0x2a63, 0x080c, 0x297e, 0x2001, 0x1800, 0x2003,
-	0x0004, 0x6027, 0x0008, 0x2011, 0x6e26, 0x080c, 0x810c, 0x080c,
-	0x6fcc, 0x0118, 0x9006, 0x080c, 0x2b14, 0x080c, 0x0b8f, 0x2001,
-	0x0001, 0x080c, 0x260c, 0x012e, 0x00fe, 0x00ee, 0x00de, 0x00ce,
-	0x003e, 0x002e, 0x001e, 0x0005, 0x0026, 0x00e6, 0x2011, 0x6e33,
-	0x2071, 0x19cb, 0x701c, 0x9206, 0x1118, 0x7018, 0x9005, 0x0110,
-	0x9085, 0x0001, 0x00ee, 0x002e, 0x0005, 0x6020, 0xd09c, 0x0005,
-	0x6800, 0x9084, 0xfffe, 0x9086, 0x00c0, 0x01b8, 0x2001, 0x00c0,
-	0x080c, 0x2b14, 0x0156, 0x20a9, 0x002d, 0x1d04, 0x6ea5, 0x2091,
-	0x6000, 0x1f04, 0x6ea5, 0x015e, 0x00d6, 0x2069, 0x1800, 0x6898,
-	0x8001, 0x0220, 0x0118, 0x689a, 0x00de, 0x0005, 0x689b, 0x0014,
-	0x68e4, 0xd0dc, 0x0dc8, 0x6800, 0x9086, 0x0001, 0x1da8, 0x080c,
-	0x8118, 0x0c90, 0x00c6, 0x00d6, 0x00e6, 0x2061, 0x0100, 0x2069,
-	0x0140, 0x2071, 0x1800, 0x080c, 0x72a5, 0x2001, 0x193e, 0x2003,
-	0x0000, 0x9006, 0x7096, 0x60e2, 0x6886, 0x080c, 0x26d7, 0x9006,
-	0x080c, 0x2b14, 0x080c, 0x5b90, 0x6027, 0xffff, 0x602b, 0x182f,
-	0x00ee, 0x00de, 0x00ce, 0x0005, 0x00c6, 0x00d6, 0x00e6, 0x2061,
-	0x0100, 0x2069, 0x0140, 0x2071, 0x1800, 0x2001, 0x194e, 0x200c,
-	0x9186, 0x0000, 0x0158, 0x9186, 0x0001, 0x0158, 0x9186, 0x0002,
-	0x0158, 0x9186, 0x0003, 0x0158, 0x0804, 0x6f7a, 0x7097, 0x0022,
-	0x0040, 0x7097, 0x0021, 0x0028, 0x7097, 0x0023, 0x0010, 0x7097,
-	0x0024, 0x60e3, 0x0000, 0x6887, 0x0001, 0x2001, 0x0001, 0x080c,
-	0x26d7, 0x0026, 0x080c, 0x9db8, 0x002e, 0x7000, 0x908e, 0x0004,
-	0x0118, 0x602b, 0x0028, 0x0010, 0x602b, 0x0020, 0x0156, 0x0126,
-	0x2091, 0x8000, 0x20a9, 0x0005, 0x6024, 0xd0ac, 0x0150, 0x012e,
-	0x015e, 0x080c, 0xc212, 0x0118, 0x9006, 0x080c, 0x2b3e, 0x0804,
-	0x6f86, 0x6800, 0x9084, 0x00a1, 0xc0bd, 0x6802, 0x080c, 0x2a5d,
-	0x6904, 0xd1d4, 0x1140, 0x2001, 0x0100, 0x080c, 0x2b14, 0x1f04,
-	0x6f24, 0x080c, 0x7009, 0x012e, 0x015e, 0x080c, 0x6fc3, 0x01a8,
-	0x6044, 0x9005, 0x0168, 0x6050, 0x0006, 0x9085, 0x0020, 0x6052,
-	0x080c, 0x7009, 0x9006, 0x8001, 0x1df0, 0x000e, 0x6052, 0x0028,
-	0x6804, 0xd0d4, 0x1110, 0x080c, 0x7009, 0x080c, 0xc212, 0x0118,
-	0x9006, 0x080c, 0x2b3e, 0x0016, 0x0026, 0x7000, 0x908e, 0x0004,
-	0x0130, 0x2009, 0x00c8, 0x2011, 0x6e33, 0x080c, 0x80ca, 0x002e,
-	0x001e, 0x080c, 0x7f54, 0x7034, 0xc085, 0x7036, 0x2001, 0x194e,
-	0x2003, 0x0004, 0x080c, 0x6c90, 0x080c, 0x6fc3, 0x0138, 0x6804,
-	0xd0d4, 0x1120, 0xd0dc, 0x1100, 0x080c, 0x729b, 0x00ee, 0x00de,
-	0x00ce, 0x0005, 0x00c6, 0x00d6, 0x00e6, 0x2061, 0x0100, 0x2069,
-	0x0140, 0x2071, 0x1800, 0x080c, 0x7f6b, 0x080c, 0x7f5d, 0x080c,
-	0x72a5, 0x2001, 0x193e, 0x2003, 0x0000, 0x9006, 0x7096, 0x60e2,
-	0x6886, 0x080c, 0x26d7, 0x9006, 0x080c, 0x2b14, 0x6043, 0x0090,
-	0x6043, 0x0010, 0x6027, 0xffff, 0x602b, 0x182f, 0x00ee, 0x00de,
-	0x00ce, 0x0005, 0x0006, 0x2001, 0x194d, 0x2004, 0x9086, 0xaaaa,
-	0x000e, 0x0005, 0x0006, 0x080c, 0x538a, 0x9084, 0x0030, 0x9086,
-	0x0000, 0x000e, 0x0005, 0x0006, 0x080c, 0x538a, 0x9084, 0x0030,
-	0x9086, 0x0030, 0x000e, 0x0005, 0x0006, 0x080c, 0x538a, 0x9084,
-	0x0030, 0x9086, 0x0010, 0x000e, 0x0005, 0x0006, 0x080c, 0x538a,
-	0x9084, 0x0030, 0x9086, 0x0020, 0x000e, 0x0005, 0x0036, 0x0016,
-	0x2001, 0x180c, 0x2004, 0x908c, 0x0013, 0x0180, 0x0020, 0x080c,
-	0x26f7, 0x900e, 0x0028, 0x080c, 0x655a, 0x1dc8, 0x2009, 0x0002,
-	0x2019, 0x0028, 0x080c, 0x2fa5, 0x9006, 0x0019, 0x001e, 0x003e,
-	0x0005, 0x00e6, 0x2071, 0x180c, 0x2e04, 0x0130, 0x080c, 0xc20b,
-	0x1128, 0x9085, 0x0010, 0x0010, 0x9084, 0xffef, 0x2072, 0x00ee,
-	0x0005, 0x6050, 0x0006, 0x60ec, 0x0006, 0x600c, 0x0006, 0x6004,
-	0x0006, 0x6028, 0x0006, 0x0016, 0x6138, 0x6050, 0x9084, 0xfbff,
-	0x9085, 0x2000, 0x6052, 0x613a, 0x20a9, 0x0012, 0x1d04, 0x701e,
-	0x2091, 0x6000, 0x1f04, 0x701e, 0x602f, 0x0100, 0x602f, 0x0000,
-	0x6050, 0x9085, 0x0400, 0x9084, 0xdfff, 0x6052, 0x613a, 0x001e,
-	0x602f, 0x0040, 0x602f, 0x0000, 0x000e, 0x602a, 0x000e, 0x6006,
-	0x000e, 0x600e, 0x000e, 0x60ee, 0x60e3, 0x0000, 0x6887, 0x0001,
-	0x2001, 0x0001, 0x080c, 0x26d7, 0x2001, 0x00a0, 0x0006, 0x080c,
-	0xc212, 0x000e, 0x0130, 0x080c, 0x2b32, 0x9006, 0x080c, 0x2b3e,
-	0x0010, 0x080c, 0x2b14, 0x000e, 0x6052, 0x6050, 0x0006, 0xc0e5,
-	0x6052, 0x00f6, 0x2079, 0x0100, 0x080c, 0x29d2, 0x00fe, 0x000e,
-	0x6052, 0x0005, 0x0156, 0x0016, 0x0026, 0x0036, 0x00c6, 0x00d6,
-	0x00e6, 0x2061, 0x0100, 0x2069, 0x0140, 0x2071, 0x1800, 0x6020,
-	0x9084, 0x0080, 0x0138, 0x2001, 0x180c, 0x200c, 0xc1c5, 0x2102,
-	0x0804, 0x70dd, 0x2001, 0x180c, 0x200c, 0xc1c4, 0x2102, 0x6028,
-	0x9084, 0xe1ff, 0x602a, 0x6027, 0x0200, 0x2001, 0x0090, 0x080c,
-	0x2b14, 0x20a9, 0x0366, 0x6024, 0xd0cc, 0x1518, 0x1d04, 0x708b,
-	0x2091, 0x6000, 0x1f04, 0x708b, 0x2011, 0x0003, 0x080c, 0x9771,
-	0x2011, 0x0002, 0x080c, 0x977b, 0x080c, 0x9662, 0x901e, 0x080c,
-	0x96d8, 0x2001, 0x00a0, 0x080c, 0x2b14, 0x080c, 0x7296, 0x080c,
-	0x5cd1, 0x080c, 0xc212, 0x0110, 0x080c, 0x0d22, 0x9085, 0x0001,
-	0x0490, 0x86ff, 0x1110, 0x080c, 0x1982, 0x60e3, 0x0000, 0x2001,
-	0x0002, 0x080c, 0x26d7, 0x60e2, 0x2001, 0x0080, 0x080c, 0x2b14,
-	0x20a9, 0x0366, 0x6027, 0x1e00, 0x2009, 0x1e00, 0x080c, 0x2a5d,
-	0x6024, 0x910c, 0x0138, 0x1d04, 0x70c2, 0x2091, 0x6000, 0x1f04,
-	0x70c2, 0x0810, 0x6028, 0x9085, 0x1e00, 0x602a, 0x70b0, 0x9005,
-	0x1118, 0x6887, 0x0001, 0x0008, 0x6886, 0x080c, 0xc212, 0x0110,
-	0x080c, 0x0d22, 0x9006, 0x00ee, 0x00de, 0x00ce, 0x003e, 0x002e,
-	0x001e, 0x015e, 0x0005, 0x0156, 0x0016, 0x0026, 0x0036, 0x00c6,
-	0x00d6, 0x00e6, 0x2061, 0x0100, 0x2071, 0x1800, 0x7000, 0x9086,
-	0x0003, 0x1168, 0x2001, 0x020b, 0x2004, 0x9084, 0x5540, 0x9086,
-	0x5540, 0x1128, 0x2069, 0x1a49, 0x2d04, 0x8000, 0x206a, 0x2069,
-	0x0140, 0x6020, 0x9084, 0x00c0, 0x0120, 0x6884, 0x9005, 0x1904,
-	0x7150, 0x2001, 0x0088, 0x080c, 0x2b14, 0x9006, 0x60e2, 0x6886,
-	0x080c, 0x26d7, 0x2069, 0x0200, 0x6804, 0x9005, 0x1118, 0x6808,
-	0x9005, 0x01c0, 0x6028, 0x9084, 0xfbff, 0x602a, 0x6027, 0x0400,
-	0x2069, 0x1960, 0x7000, 0x206a, 0x7097, 0x0026, 0x7003, 0x0001,
-	0x20a9, 0x0002, 0x1d04, 0x7132, 0x2091, 0x6000, 0x1f04, 0x7132,
-	0x0804, 0x717d, 0x2069, 0x0140, 0x20a9, 0x0384, 0x6027, 0x1e00,
-	0x2009, 0x1e00, 0x080c, 0x2a5d, 0x6024, 0x910c, 0x0508, 0x9084,
-	0x1a00, 0x11f0, 0x1d04, 0x713e, 0x2091, 0x6000, 0x1f04, 0x713e,
-	0x2011, 0x0003, 0x080c, 0x9771, 0x2011, 0x0002, 0x080c, 0x977b,
-	0x080c, 0x9662, 0x901e, 0x080c, 0x96d8, 0x2001, 0x00a0, 0x080c,
-	0x2b14, 0x080c, 0x7296, 0x080c, 0x5cd1, 0x9085, 0x0001, 0x00a8,
-	0x2001, 0x0080, 0x080c, 0x2b14, 0x2069, 0x0140, 0x60e3, 0x0000,
-	0x70b0, 0x9005, 0x1118, 0x6887, 0x0001, 0x0008, 0x6886, 0x2001,
-	0x0002, 0x080c, 0x26d7, 0x60e2, 0x9006, 0x00ee, 0x00de, 0x00ce,
-	0x003e, 0x002e, 0x001e, 0x015e, 0x0005, 0x0156, 0x0016, 0x0026,
-	0x0036, 0x00c6, 0x00d6, 0x00e6, 0x2061, 0x0100, 0x2071, 0x1800,
-	0x6020, 0x9084, 0x00c0, 0x01c8, 0x2011, 0x0003, 0x080c, 0x9771,
-	0x2011, 0x0002, 0x080c, 0x977b, 0x080c, 0x9662, 0x901e, 0x080c,
-	0x96d8, 0x2069, 0x0140, 0x2001, 0x00a0, 0x080c, 0x2b14, 0x080c,
-	0x7296, 0x080c, 0x5cd1, 0x0804, 0x7217, 0x2001, 0x180c, 0x200c,
-	0xd1b4, 0x1160, 0xc1b5, 0x2102, 0x080c, 0x6e1b, 0x2069, 0x0140,
-	0x2001, 0x0080, 0x080c, 0x2b14, 0x60e3, 0x0000, 0x2069, 0x0200,
-	0x6804, 0x9005, 0x1118, 0x6808, 0x9005, 0x0180, 0x6028, 0x9084,
-	0xfdff, 0x602a, 0x6027, 0x0200, 0x2069, 0x1960, 0x7000, 0x206a,
-	0x7097, 0x0027, 0x7003, 0x0001, 0x0804, 0x7217, 0x6027, 0x1e00,
-	0x2009, 0x1e00, 0x080c, 0x2a5d, 0x6024, 0x910c, 0x01c8, 0x9084,
-	0x1c00, 0x11b0, 0x1d04, 0x71d6, 0x0006, 0x0016, 0x00c6, 0x00d6,
-	0x00e6, 0x080c, 0x7f9c, 0x00ee, 0x00de, 0x00ce, 0x001e, 0x000e,
-	0x00e6, 0x2071, 0x19cb, 0x7018, 0x00ee, 0x9005, 0x19f8, 0x01f8,
-	0x0026, 0x2011, 0x6e33, 0x080c, 0x8038, 0x2011, 0x6e26, 0x080c,
-	0x810c, 0x002e, 0x2069, 0x0140, 0x60e3, 0x0000, 0x70b0, 0x9005,
-	0x1118, 0x6887, 0x0001, 0x0008, 0x6886, 0x2001, 0x0002, 0x080c,
-	0x26d7, 0x60e2, 0x2001, 0x180c, 0x200c, 0xc1b4, 0x2102, 0x00ee,
-	0x00de, 0x00ce, 0x003e, 0x002e, 0x001e, 0x015e, 0x0005, 0x0156,
-	0x0016, 0x0026, 0x0036, 0x0046, 0x00c6, 0x00e6, 0x2061, 0x0100,
-	0x2071, 0x1800, 0x080c, 0xc20b, 0x1904, 0x7284, 0x7130, 0xd184,
-	0x1170, 0x080c, 0x3133, 0x0138, 0xc18d, 0x7132, 0x2011, 0x1854,
-	0x2214, 0xd2ac, 0x1120, 0x7030, 0xd08c, 0x0904, 0x7284, 0x2011,
-	0x1854, 0x220c, 0x0438, 0x0016, 0x2019, 0x000e, 0x080c, 0xd4a6,
-	0x0156, 0x00b6, 0x20a9, 0x007f, 0x900e, 0x9186, 0x007e, 0x01a0,
-	0x9186, 0x0080, 0x0188, 0x080c, 0x623e, 0x1170, 0x2120, 0x9006,
-	0x0016, 0x2009, 0x000e, 0x080c, 0xd52a, 0x2009, 0x0001, 0x2011,
-	0x0100, 0x080c, 0x822f, 0x001e, 0x8108, 0x1f04, 0x724d, 0x00be,
-	0x015e, 0x001e, 0xd1ac, 0x1148, 0x0016, 0x2009, 0x0002, 0x2019,
-	0x0004, 0x080c, 0x2fa5, 0x001e, 0x0078, 0x0156, 0x00b6, 0x20a9,
-	0x007f, 0x900e, 0x080c, 0x623e, 0x1110, 0x080c, 0x5ceb, 0x8108,
-	0x1f04, 0x727a, 0x00be, 0x015e, 0x080c, 0x1982, 0x080c, 0x9db8,
-	0x60e3, 0x0000, 0x080c, 0x5cd1, 0x080c, 0x6ee4, 0x00ee, 0x00ce,
-	0x004e, 0x003e, 0x002e, 0x001e, 0x015e, 0x0005, 0x2001, 0x194e,
-	0x2003, 0x0001, 0x0005, 0x2001, 0x194e, 0x2003, 0x0000, 0x0005,
-	0x2001, 0x194d, 0x2003, 0xaaaa, 0x0005, 0x2001, 0x194d, 0x2003,
-	0x0000, 0x0005, 0x2071, 0x18f0, 0x7003, 0x0000, 0x7007, 0x0000,
-	0x080c, 0x1004, 0x090c, 0x0db4, 0xa8ab, 0xdcb0, 0x2900, 0x704e,
-	0x080c, 0x1004, 0x090c, 0x0db4, 0xa8ab, 0xdcb0, 0x2900, 0x7052,
-	0xa867, 0x0000, 0xa86b, 0x0001, 0xa89f, 0x0000, 0x0005, 0x00e6,
-	0x2071, 0x0040, 0x6848, 0x9005, 0x1118, 0x9085, 0x0001, 0x04b0,
-	0x6840, 0x9005, 0x0150, 0x04a1, 0x6a50, 0x9200, 0x7002, 0x6854,
-	0x9101, 0x7006, 0x9006, 0x7012, 0x7016, 0x6850, 0x7002, 0x6854,
-	0x7006, 0x6858, 0x700a, 0x685c, 0x700e, 0x6840, 0x9005, 0x1110,
-	0x7012, 0x7016, 0x6848, 0x701a, 0x701c, 0x9085, 0x0040, 0x701e,
-	0x2001, 0x0019, 0x7036, 0x702b, 0x0001, 0x2001, 0x0004, 0x200c,
-	0x918c, 0xfff7, 0x918d, 0x8000, 0x2102, 0x00d6, 0x2069, 0x18f0,
-	0x6807, 0x0001, 0x00de, 0x080c, 0x7897, 0x9006, 0x00ee, 0x0005,
-	0x900e, 0x0156, 0x20a9, 0x0006, 0x8003, 0x2011, 0x0100, 0x2214,
-	0x9296, 0x0008, 0x1110, 0x818d, 0x0010, 0x81f5, 0x3e08, 0x1f04,
-	0x730c, 0x015e, 0x0005, 0x2079, 0x0040, 0x2071, 0x18f0, 0x7004,
-	0x0002, 0x732b, 0x732c, 0x7363, 0x73be, 0x74ff, 0x7329, 0x7329,
-	0x7529, 0x080c, 0x0db4, 0x0005, 0x2079, 0x0040, 0x782c, 0x908c,
-	0x0780, 0x190c, 0x7923, 0xd0a4, 0x01f0, 0x7824, 0x2048, 0x9006,
-	0xa802, 0xa806, 0xa864, 0x9084, 0x00ff, 0x908a, 0x0040, 0x0608,
-	0x00b8, 0x2001, 0x1800, 0x200c, 0x9186, 0x0003, 0x1160, 0x7104,
-	0x9186, 0x0004, 0x0140, 0x9186, 0x0007, 0x0128, 0x9186, 0x0003,
-	0x19e8, 0x080c, 0x73be, 0x782c, 0xd09c, 0x090c, 0x7897, 0x0005,
-	0x9082, 0x005a, 0x1218, 0x2100, 0x003b, 0x0c18, 0x080c, 0x73f4,
-	0x0c90, 0x00e3, 0x08f0, 0x0005, 0x73f4, 0x73f4, 0x73f4, 0x73f4,
-	0x73f4, 0x73f4, 0x73f4, 0x73f4, 0x7416, 0x73f4, 0x73f4, 0x73f4,
-	0x73f4, 0x73f4, 0x73f4, 0x73f4, 0x73f4, 0x73f4, 0x73f4, 0x73f4,
-	0x73f4, 0x73f4, 0x73f4, 0x73f4, 0x73f4, 0x73f4, 0x73f4, 0x73f4,
-	0x7400, 0x73f4, 0x75fe, 0x73f4, 0x73f4, 0x73f4, 0x7416, 0x73f4,
-	0x7400, 0x763f, 0x7680, 0x76c7, 0x76db, 0x73f4, 0x73f4, 0x7416,
-	0x7400, 0x73f4, 0x73f4, 0x74d3, 0x7786, 0x77a1, 0x73f4, 0x7416,
-	0x73f4, 0x73f4, 0x73f4, 0x73f4, 0x74c9, 0x77a1, 0x73f4, 0x73f4,
-	0x73f4, 0x73f4, 0x73f4, 0x73f4, 0x73f4, 0x73f4, 0x73f4, 0x742a,
-	0x73f4, 0x73f4, 0x73f4, 0x73f4, 0x73f4, 0x73f4, 0x73f4, 0x73f4,
-	0x73f4, 0x78c7, 0x73f4, 0x73f4, 0x73f4, 0x73f4, 0x73f4, 0x743e,
-	0x73f4, 0x73f4, 0x73f4, 0x73f4, 0x73f4, 0x73f4, 0x2079, 0x0040,
-	0x7004, 0x9086, 0x0003, 0x1198, 0x782c, 0x080c, 0x78c0, 0xd0a4,
-	0x0170, 0x7824, 0x2048, 0x9006, 0xa802, 0xa806, 0xa864, 0x9084,
-	0x00ff, 0x908a, 0x001a, 0x1210, 0x002b, 0x0c50, 0x00e9, 0x080c,
-	0x7897, 0x0005, 0x73f4, 0x7400, 0x75ea, 0x73f4, 0x7400, 0x73f4,
-	0x7400, 0x7400, 0x73f4, 0x7400, 0x75ea, 0x7400, 0x7400, 0x7400,
-	0x7400, 0x7400, 0x73f4, 0x7400, 0x75ea, 0x73f4, 0x73f4, 0x7400,
-	0x73f4, 0x73f4, 0x73f4, 0x7400, 0x00e6, 0x2071, 0x18f0, 0x2009,
-	0x0400, 0x0071, 0x00ee, 0x0005, 0x2009, 0x1000, 0x0049, 0x0005,
-	0x2009, 0x2000, 0x0029, 0x0005, 0x2009, 0x0800, 0x0009, 0x0005,
-	0x7007, 0x0001, 0xa868, 0x9084, 0x00ff, 0x9105, 0xa86a, 0x0126,
-	0x2091, 0x8000, 0x080c, 0x688c, 0x012e, 0x0005, 0xa864, 0x8007,
-	0x9084, 0x00ff, 0x0d08, 0x8001, 0x1120, 0x7007, 0x0001, 0x0804,
-	0x75a8, 0x7007, 0x0003, 0x7012, 0x2900, 0x7016, 0x701a, 0x704b,
-	0x75a8, 0x0005, 0xa864, 0x8007, 0x9084, 0x00ff, 0x0968, 0x8001,
-	0x1120, 0x7007, 0x0001, 0x0804, 0x75c3, 0x7007, 0x0003, 0x7012,
-	0x2900, 0x7016, 0x701a, 0x704b, 0x75c3, 0x0005, 0xa864, 0x8007,
-	0x9084, 0x00ff, 0x9086, 0x0001, 0x1904, 0x73fc, 0x7007, 0x0001,
-	0x2009, 0x1833, 0x210c, 0x81ff, 0x1904, 0x74a0, 0xa994, 0x9186,
-	0x006f, 0x0188, 0x9186, 0x0074, 0x15b0, 0x0026, 0x2011, 0x0010,
-	0x080c, 0x6586, 0x002e, 0x0578, 0x0016, 0xa998, 0x080c, 0x65d0,
-	0x001e, 0x1548, 0x0400, 0x080c, 0x6fb2, 0x0140, 0xa897, 0x4005,
-	0xa89b, 0x0016, 0x2001, 0x0030, 0x900e, 0x0438, 0x0026, 0x2011,
-	0x8008, 0x080c, 0x6586, 0x002e, 0x01b0, 0x0016, 0x0026, 0x0036,
-	0xa998, 0xaaa0, 0xab9c, 0x918d, 0x8000, 0x080c, 0x65d0, 0x003e,
-	0x002e, 0x001e, 0x1140, 0xa897, 0x4005, 0xa89b, 0x4009, 0x2001,
-	0x0030, 0x900e, 0x0050, 0xa868, 0x9084, 0x00ff, 0xa86a, 0xa883,
-	0x0000, 0x080c, 0x5f00, 0x1108, 0x0005, 0x0126, 0x2091, 0x8000,
-	0xa867, 0x0139, 0xa87a, 0xa982, 0x080c, 0x688c, 0x012e, 0x0ca0,
-	0xa994, 0x9186, 0x0071, 0x0904, 0x744e, 0x9186, 0x0064, 0x0904,
-	0x744e, 0x9186, 0x007c, 0x0904, 0x744e, 0x9186, 0x0028, 0x0904,
-	0x744e, 0x9186, 0x0038, 0x0904, 0x744e, 0x9186, 0x0078, 0x0904,
-	0x744e, 0x9186, 0x005f, 0x0904, 0x744e, 0x9186, 0x0056, 0x0904,
-	0x744e, 0xa897, 0x4005, 0xa89b, 0x0001, 0x2001, 0x0030, 0x900e,
-	0x0860, 0xa87c, 0x9084, 0x00c0, 0x9086, 0x00c0, 0x1120, 0x7007,
-	0x0001, 0x0804, 0x77b8, 0x2900, 0x7016, 0x701a, 0x20a9, 0x0004,
-	0xa860, 0x20e0, 0xa85c, 0x9080, 0x0030, 0x2098, 0x7050, 0x2040,
-	0xa060, 0x20e8, 0xa05c, 0x9080, 0x0023, 0x20a0, 0x4003, 0xa888,
-	0x7012, 0x9082, 0x0401, 0x1a04, 0x7404, 0xaab4, 0x928a, 0x0002,
-	0x1a04, 0x7404, 0x82ff, 0x1138, 0xa8b8, 0xa9bc, 0x9105, 0x0118,
-	0x2001, 0x7566, 0x0018, 0x9280, 0x755c, 0x2005, 0x7056, 0x7010,
-	0x9015, 0x0904, 0x7547, 0x080c, 0x1004, 0x1118, 0x7007, 0x0004,
-	0x0005, 0x2900, 0x7022, 0x7054, 0x2060, 0xe000, 0xa866, 0x7050,
-	0x2040, 0xa95c, 0xe004, 0x9100, 0xa076, 0xa860, 0xa072, 0xe008,
-	0x920a, 0x1210, 0x900e, 0x2200, 0x7112, 0xe20c, 0x8003, 0x800b,
-	0x9296, 0x0004, 0x0108, 0x9108, 0xa17a, 0x810b, 0xa17e, 0x080c,
-	0x10d5, 0xa06c, 0x908e, 0x0100, 0x0170, 0x9086, 0x0200, 0x0118,
-	0x7007, 0x0007, 0x0005, 0x7020, 0x2048, 0x080c, 0x101d, 0x7014,
-	0x2048, 0x0804, 0x7404, 0x7020, 0x2048, 0x7018, 0xa802, 0xa807,
-	0x0000, 0x2908, 0x2048, 0xa906, 0x711a, 0x0804, 0x74ff, 0x7014,
-	0x2048, 0x7007, 0x0001, 0xa8b4, 0x9005, 0x1128, 0xa8b8, 0xa9bc,
-	0x9105, 0x0108, 0x00b9, 0xa864, 0x9084, 0x00ff, 0x9086, 0x001e,
-	0x0904, 0x77b8, 0x0804, 0x75a8, 0x755e, 0x7562, 0x0002, 0x001d,
-	0x0007, 0x0004, 0x000a, 0x001b, 0x0005, 0x0006, 0x000a, 0x001d,
-	0x0005, 0x0004, 0x0076, 0x0066, 0xafb8, 0xaebc, 0xa804, 0x2050,
-	0xb0c0, 0xb0e2, 0xb0bc, 0xb0de, 0xb0b8, 0xb0d2, 0xb0b4, 0xb0ce,
-	0xb6da, 0xb7d6, 0xb0b0, 0xb0ca, 0xb0ac, 0xb0c6, 0xb0a8, 0xb0ba,
-	0xb0a4, 0xb0b6, 0xb6c2, 0xb7be, 0xb0a0, 0xb0b2, 0xb09c, 0xb0ae,
-	0xb098, 0xb0a2, 0xb094, 0xb09e, 0xb6aa, 0xb7a6, 0xb090, 0xb09a,
-	0xb08c, 0xb096, 0xb088, 0xb08a, 0xb084, 0xb086, 0xb692, 0xb78e,
-	0xb080, 0xb082, 0xb07c, 0xb07e, 0xb078, 0xb072, 0xb074, 0xb06e,
-	0xb67a, 0xb776, 0xb004, 0x9055, 0x1958, 0x006e, 0x007e, 0x0005,
-	0x2009, 0x1833, 0x210c, 0x81ff, 0x1178, 0x080c, 0x5d4d, 0x1108,
-	0x0005, 0x080c, 0x6ac6, 0x0126, 0x2091, 0x8000, 0x080c, 0xbe06,
-	0x080c, 0x688c, 0x012e, 0x0ca0, 0x080c, 0xc20b, 0x1d70, 0x2001,
-	0x0028, 0x900e, 0x0c70, 0x2009, 0x1833, 0x210c, 0x81ff, 0x11d8,
-	0xa888, 0x9005, 0x01e0, 0xa883, 0x0000, 0xa87c, 0xd0f4, 0x0120,
-	0x080c, 0x5e62, 0x1138, 0x0005, 0x9006, 0xa87a, 0x080c, 0x5ddd,
-	0x1108, 0x0005, 0x0126, 0x2091, 0x8000, 0xa87a, 0xa982, 0x080c,
-	0x688c, 0x012e, 0x0cb0, 0x2001, 0x0028, 0x900e, 0x0c98, 0x2001,
-	0x0000, 0x0c80, 0x7018, 0xa802, 0x2908, 0x2048, 0xa906, 0x711a,
-	0x7010, 0x8001, 0x7012, 0x0118, 0x7007, 0x0003, 0x0030, 0x7014,
-	0x2048, 0x7007, 0x0001, 0x7048, 0x080f, 0x0005, 0x00b6, 0x7007,
-	0x0001, 0xa974, 0xa878, 0x9084, 0x00ff, 0x9096, 0x0004, 0x0540,
-	0x20a9, 0x0001, 0x9096, 0x0001, 0x0190, 0x900e, 0x20a9, 0x0800,
-	0x9096, 0x0002, 0x0160, 0x9005, 0x11d8, 0xa974, 0x080c, 0x623e,
-	0x11b8, 0x0066, 0xae80, 0x080c, 0x634e, 0x006e, 0x0088, 0x0046,
-	0x2011, 0x180c, 0x2224, 0xc484, 0x2412, 0x004e, 0x00c6, 0x080c,
-	0x623e, 0x1110, 0x080c, 0x644e, 0x8108, 0x1f04, 0x7627, 0x00ce,
-	0xa87c, 0xd084, 0x1120, 0x080c, 0x101d, 0x00be, 0x0005, 0x0126,
-	0x2091, 0x8000, 0x080c, 0x688c, 0x012e, 0x00be, 0x0005, 0x0126,
-	0x2091, 0x8000, 0x7007, 0x0001, 0x080c, 0x655e, 0x0580, 0x2061,
-	0x1a41, 0x6100, 0xd184, 0x0178, 0xa888, 0x9084, 0x00ff, 0x1550,
-	0x6000, 0xd084, 0x0520, 0x6004, 0x9005, 0x1538, 0x6003, 0x0000,
-	0x600b, 0x0000, 0x00c8, 0x2011, 0x0001, 0xa890, 0x9005, 0x1110,
-	0x2001, 0x001e, 0x8000, 0x6016, 0xa888, 0x9084, 0x00ff, 0x0178,
-	0x6006, 0xa888, 0x8007, 0x9084, 0x00ff, 0x0148, 0x600a, 0xa888,
-	0x8000, 0x1108, 0xc28d, 0x6202, 0x012e, 0x0804, 0x7881, 0x012e,
-	0x0804, 0x787b, 0x012e, 0x0804, 0x7875, 0x012e, 0x0804, 0x7878,
-	0x0126, 0x2091, 0x8000, 0x7007, 0x0001, 0x080c, 0x655e, 0x05e0,
-	0x2061, 0x1a41, 0x6000, 0xd084, 0x05b8, 0x6204, 0x6308, 0xd08c,
-	0x1530, 0xac78, 0x9484, 0x0003, 0x0170, 0xa988, 0x918c, 0x00ff,
-	0x8001, 0x1120, 0x2100, 0x9210, 0x0620, 0x0028, 0x8001, 0x1508,
-	0x2100, 0x9212, 0x02f0, 0x9484, 0x000c, 0x0188, 0xa988, 0x810f,
-	0x918c, 0x00ff, 0x9082, 0x0004, 0x1120, 0x2100, 0x9318, 0x0288,
-	0x0030, 0x9082, 0x0004, 0x1168, 0x2100, 0x931a, 0x0250, 0xa890,
-	0x9005, 0x0110, 0x8000, 0x6016, 0x6206, 0x630a, 0x012e, 0x0804,
-	0x7881, 0x012e, 0x0804, 0x787e, 0x012e, 0x0804, 0x787b, 0x0126,
-	0x2091, 0x8000, 0x7007, 0x0001, 0x2061, 0x1a41, 0x6300, 0xd38c,
-	0x1120, 0x6308, 0x8318, 0x0220, 0x630a, 0x012e, 0x0804, 0x788f,
-	0x012e, 0x0804, 0x787e, 0x00b6, 0x0126, 0x00c6, 0x2091, 0x8000,
-	0x7007, 0x0001, 0xa87c, 0xd0ac, 0x0148, 0x00c6, 0x2061, 0x1a41,
-	0x6000, 0x9084, 0xfcff, 0x6002, 0x00ce, 0x0440, 0xa888, 0x9005,
-	0x05d8, 0xa88c, 0x9065, 0x0598, 0x2001, 0x1833, 0x2004, 0x9005,
-	0x0118, 0x080c, 0x9e62, 0x0068, 0x6017, 0xf400, 0x605b, 0x0000,
-	0xa97c, 0xd1a4, 0x0110, 0xa980, 0x615a, 0x2009, 0x0041, 0x080c,
-	0x9eac, 0xa988, 0x918c, 0xff00, 0x9186, 0x2000, 0x1138, 0x0026,
-	0x900e, 0x2011, 0xfdff, 0x080c, 0x822f, 0x002e, 0xa87c, 0xd0c4,
-	0x0148, 0x2061, 0x1a41, 0x6000, 0xd08c, 0x1120, 0x6008, 0x8000,
-	0x0208, 0x600a, 0x00ce, 0x012e, 0x00be, 0x0804, 0x7881, 0x00ce,
-	0x012e, 0x00be, 0x0804, 0x787b, 0xa984, 0x9186, 0x002e, 0x0d30,
-	0x9186, 0x002d, 0x0d18, 0x9186, 0x0045, 0x0510, 0x9186, 0x002a,
-	0x1130, 0x2001, 0x180c, 0x200c, 0xc194, 0x2102, 0x08b8, 0x9186,
-	0x0020, 0x0158, 0x9186, 0x0029, 0x1d10, 0xa974, 0x080c, 0x623e,
-	0x1968, 0xb800, 0xc0e4, 0xb802, 0x0848, 0xa88c, 0x9065, 0x09b8,
-	0x6007, 0x0024, 0x2001, 0x1957, 0x2004, 0x601a, 0x0804, 0x7716,
-	0xa88c, 0x9065, 0x0960, 0x00e6, 0xa890, 0x9075, 0x2001, 0x1833,
-	0x2004, 0x9005, 0x0150, 0x080c, 0x9e62, 0x8eff, 0x0118, 0x2e60,
-	0x080c, 0x9e62, 0x00ee, 0x0804, 0x7716, 0x6024, 0xc0dc, 0xc0d5,
-	0x6026, 0x2e60, 0x6007, 0x003a, 0xa8a0, 0x9005, 0x0130, 0x6007,
-	0x003b, 0xa8a4, 0x602e, 0xa8a8, 0x6016, 0x6003, 0x0001, 0x080c,
-	0x83f1, 0x080c, 0x8973, 0x00ee, 0x0804, 0x7716, 0x2061, 0x1a41,
-	0x6000, 0xd084, 0x0190, 0xd08c, 0x1904, 0x788f, 0x0126, 0x2091,
-	0x8000, 0x6204, 0x8210, 0x0220, 0x6206, 0x012e, 0x0804, 0x788f,
-	0x012e, 0xa883, 0x0016, 0x0804, 0x7888, 0xa883, 0x0007, 0x0804,
-	0x7888, 0xa864, 0x8007, 0x9084, 0x00ff, 0x0130, 0x8001, 0x1138,
-	0x7007, 0x0001, 0x0069, 0x0005, 0x080c, 0x73fc, 0x0040, 0x7007,
-	0x0003, 0x7012, 0x2900, 0x7016, 0x701a, 0x704b, 0x77b8, 0x0005,
-	0x00b6, 0x00e6, 0x0126, 0x2091, 0x8000, 0x903e, 0x2061, 0x1800,
-	0x61cc, 0x81ff, 0x1904, 0x783a, 0x6130, 0xd194, 0x1904, 0x7864,
-	0xa878, 0x2070, 0x9e82, 0x1cd0, 0x0a04, 0x782e, 0x6064, 0x9e02,
-	0x1a04, 0x782e, 0x7120, 0x9186, 0x0006, 0x1904, 0x7820, 0x7010,
-	0x905d, 0x0904, 0x783a, 0xb800, 0xd0e4, 0x1904, 0x785e, 0x2061,
-	0x1a41, 0x6100, 0x9184, 0x0301, 0x9086, 0x0001, 0x15a0, 0x7024,
-	0xd0dc, 0x1904, 0x7867, 0xa883, 0x0000, 0xa803, 0x0000, 0x2908,
-	0x7014, 0x9005, 0x1198, 0x7116, 0xa87c, 0xd0f4, 0x1904, 0x786a,
-	0x080c, 0x5386, 0xd09c, 0x1118, 0xa87c, 0xc0cc, 0xa87e, 0x2e60,
-	0x080c, 0x814f, 0x012e, 0x00ee, 0x00be, 0x0005, 0x2048, 0xa800,
-	0x9005, 0x1de0, 0xa902, 0x2148, 0xa87c, 0xd0f4, 0x1904, 0x786a,
-	0x012e, 0x00ee, 0x00be, 0x0005, 0x012e, 0x00ee, 0xa883, 0x0006,
-	0x00be, 0x0804, 0x7888, 0xd184, 0x0db8, 0xd1c4, 0x1190, 0x00a0,
-	0xa974, 0x080c, 0x623e, 0x15d0, 0xb800, 0xd0e4, 0x15b8, 0x7120,
-	0x9186, 0x0007, 0x1118, 0xa883, 0x0002, 0x0490, 0xa883, 0x0008,
-	0x0478, 0xa883, 0x000e, 0x0460, 0xa883, 0x0017, 0x0448, 0xa883,
-	0x0035, 0x0430, 0x080c, 0x538a, 0xd0fc, 0x01e8, 0xa878, 0x2070,
-	0x9e82, 0x1cd0, 0x02c0, 0x6064, 0x9e02, 0x12a8, 0x7120, 0x9186,
-	0x0006, 0x1188, 0x7010, 0x905d, 0x0170, 0xb800, 0xd0bc, 0x0158,
-	0x2039, 0x0001, 0x7000, 0x9086, 0x0007, 0x1904, 0x77c4, 0x7003,
-	0x0002, 0x0804, 0x77c4, 0xa883, 0x0028, 0x0010, 0xa883, 0x0029,
-	0x012e, 0x00ee, 0x00be, 0x0420, 0xa883, 0x002a, 0x0cc8, 0xa883,
-	0x0045, 0x0cb0, 0x2e60, 0x2019, 0x0002, 0x601b, 0x0014, 0x080c,
-	0xd0e5, 0x012e, 0x00ee, 0x00be, 0x0005, 0x2009, 0x003e, 0x0058,
-	0x2009, 0x0004, 0x0040, 0x2009, 0x0006, 0x0028, 0x2009, 0x0016,
-	0x0010, 0x2009, 0x0001, 0xa884, 0x9084, 0xff00, 0x9105, 0xa886,
-	0x0126, 0x2091, 0x8000, 0x080c, 0x688c, 0x012e, 0x0005, 0x080c,
-	0x101d, 0x0005, 0x00d6, 0x080c, 0x8146, 0x00de, 0x0005, 0x00d6,
-	0x00e6, 0x0126, 0x2091, 0x8000, 0x2071, 0x0040, 0x702c, 0xd084,
-	0x01d8, 0x908c, 0x0780, 0x190c, 0x7923, 0xd09c, 0x11a8, 0x2071,
-	0x1800, 0x70bc, 0x90ea, 0x0040, 0x0278, 0x8001, 0x70be, 0x702c,
-	0x2048, 0xa800, 0x702e, 0x9006, 0xa802, 0xa806, 0x2071, 0x0040,
-	0x2900, 0x7022, 0x702c, 0x0c28, 0x012e, 0x00ee, 0x00de, 0x0005,
-	0x0006, 0x9084, 0x0780, 0x190c, 0x7923, 0x000e, 0x0005, 0x00d6,
-	0x00c6, 0x0036, 0x0026, 0x0016, 0x00b6, 0x7007, 0x0001, 0xaa74,
-	0x9282, 0x0004, 0x1a04, 0x7914, 0xa97c, 0x9188, 0x1000, 0x2104,
-	0x905d, 0xb804, 0xd284, 0x0140, 0x05e8, 0x8007, 0x9084, 0x00ff,
-	0x9084, 0x0006, 0x1108, 0x04b0, 0x2b10, 0x080c, 0x9ddc, 0x1118,
-	0x080c, 0x9e7f, 0x05a8, 0x6212, 0xa874, 0x0002, 0x78f2, 0x78f7,
-	0x78fa, 0x7900, 0x2019, 0x0002, 0x080c, 0xd4a6, 0x0060, 0x080c,
-	0xd442, 0x0048, 0x2019, 0x0002, 0xa980, 0x080c, 0xd45d, 0x0018,
-	0xa980, 0x080c, 0xd442, 0x080c, 0x9e32, 0xa887, 0x0000, 0x0126,
-	0x2091, 0x8000, 0x080c, 0x688c, 0x012e, 0x00be, 0x001e, 0x002e,
-	0x003e, 0x00ce, 0x00de, 0x0005, 0xa887, 0x0006, 0x0c80, 0xa887,
-	0x0002, 0x0c68, 0xa887, 0x0005, 0x0c50, 0xa887, 0x0004, 0x0c38,
-	0xa887, 0x0007, 0x0c20, 0x2091, 0x8000, 0x0e04, 0x7925, 0x0006,
-	0x0016, 0x2001, 0x8003, 0x0006, 0x0804, 0x0dbd, 0x2001, 0x1833,
-	0x2004, 0x9005, 0x0005, 0x0005, 0x00f6, 0x2079, 0x0300, 0x2001,
-	0x0200, 0x200c, 0xc1e5, 0xc1dc, 0x2102, 0x2009, 0x0218, 0x210c,
-	0xd1ec, 0x1120, 0x080c, 0x14a7, 0x00fe, 0x0005, 0x2001, 0x020d,
-	0x2003, 0x0020, 0x781f, 0x0300, 0x00fe, 0x0005, 0x781c, 0xd08c,
-	0x0904, 0x79a5, 0x68bc, 0x90aa, 0x0005, 0x0a04, 0x7f54, 0x7d44,
-	0x7c40, 0x9584, 0x00f6, 0x1510, 0x9484, 0x7000, 0x0140, 0x908a,
-	0x2000, 0x1260, 0x9584, 0x0700, 0x8007, 0x0804, 0x79ac, 0x7000,
-	0x9084, 0xff00, 0x9086, 0x8100, 0x0da8, 0x00b0, 0x9484, 0x0fff,
-	0x1130, 0x7000, 0x9084, 0xff00, 0x9086, 0x8100, 0x11c0, 0x080c,
-	0xd88c, 0x080c, 0x7e99, 0x7817, 0x0140, 0x00a8, 0x9584, 0x0076,
-	0x1118, 0x080c, 0x7ef7, 0x19c0, 0xd5a4, 0x0148, 0x0046, 0x0056,
-	0x080c, 0x7a07, 0x080c, 0x21cd, 0x005e, 0x004e, 0x0020, 0x080c,
-	0xd88c, 0x7817, 0x0140, 0x080c, 0x6fb2, 0x0168, 0x2001, 0x0111,
-	0x2004, 0xd08c, 0x0140, 0x688f, 0x0000, 0x2001, 0x0110, 0x2003,
-	0x0008, 0x2003, 0x0000, 0x080c, 0x79e8, 0x2001, 0x19c1, 0x2004,
-	0x9005, 0x090c, 0x8973, 0x0005, 0x0002, 0x79be, 0x7cbb, 0x79b5,
-	0x79b5, 0x79b5, 0x79b5, 0x79b5, 0x79b5, 0x7817, 0x0140, 0x2001,
-	0x19c1, 0x2004, 0x9005, 0x090c, 0x8973, 0x0005, 0x7000, 0x908c,
-	0xff00, 0x9194, 0xf000, 0x810f, 0x9484, 0x0fff, 0x688e, 0x9286,
-	0x2000, 0x1150, 0x6800, 0x9086, 0x0001, 0x1118, 0x080c, 0x53e7,
-	0x0070, 0x080c, 0x7a27, 0x0058, 0x9286, 0x3000, 0x1118, 0x080c,
-	0x7bf6, 0x0028, 0x9286, 0x8000, 0x1110, 0x080c, 0x7dc9, 0x7817,
-	0x0140, 0x2001, 0x19c1, 0x2004, 0x9005, 0x090c, 0x8973, 0x0005,
-	0x2001, 0x1810, 0x2004, 0xd08c, 0x0178, 0x2001, 0x1800, 0x2004,
-	0x9086, 0x0003, 0x1148, 0x0026, 0x0036, 0x2011, 0x8048, 0x2518,
-	0x080c, 0x48d9, 0x003e, 0x002e, 0x0005, 0x0036, 0x0046, 0x0056,
-	0x00f6, 0x2079, 0x0200, 0x2019, 0xfffe, 0x7c30, 0x0050, 0x0036,
-	0x0046, 0x0056, 0x00f6, 0x2079, 0x0200, 0x7d44, 0x7c40, 0x2019,
-	0xffff, 0x2001, 0x1810, 0x2004, 0xd08c, 0x0160, 0x2001, 0x1800,
-	0x2004, 0x9086, 0x0003, 0x1130, 0x0026, 0x2011, 0x8048, 0x080c,
-	0x48d9, 0x002e, 0x00fe, 0x005e, 0x004e, 0x003e, 0x0005, 0x00b6,
-	0x00c6, 0x7010, 0x9084, 0xff00, 0x8007, 0x9096, 0x0001, 0x0120,
-	0x9096, 0x0023, 0x1904, 0x7bc7, 0x9186, 0x0023, 0x15c0, 0x080c,
-	0x7e5e, 0x0904, 0x7bc7, 0x6120, 0x9186, 0x0001, 0x0150, 0x9186,
-	0x0004, 0x0138, 0x9186, 0x0008, 0x0120, 0x9186, 0x000a, 0x1904,
-	0x7bc7, 0x7124, 0x610a, 0x7030, 0x908e, 0x0200, 0x1130, 0x2009,
-	0x0015, 0x080c, 0x9eac, 0x0804, 0x7bc7, 0x908e, 0x0214, 0x0118,
-	0x908e, 0x0210, 0x1130, 0x2009, 0x0015, 0x080c, 0x9eac, 0x0804,
-	0x7bc7, 0x908e, 0x0100, 0x1904, 0x7bc7, 0x7034, 0x9005, 0x1904,
-	0x7bc7, 0x2009, 0x0016, 0x080c, 0x9eac, 0x0804, 0x7bc7, 0x9186,
-	0x0022, 0x1904, 0x7bc7, 0x7030, 0x908e, 0x0300, 0x1580, 0x68d8,
-	0xd0a4, 0x0528, 0xc0b5, 0x68da, 0x7100, 0x918c, 0x00ff, 0x697a,
-	0x7004, 0x687e, 0x00f6, 0x2079, 0x0100, 0x79e6, 0x78ea, 0x0006,
-	0x9084, 0x00ff, 0x0016, 0x2008, 0x080c, 0x26ac, 0x7932, 0x7936,
-	0x001e, 0x000e, 0x00fe, 0x080c, 0x2663, 0x695a, 0x703c, 0x00e6,
-	0x2071, 0x0140, 0x7086, 0x2071, 0x1800, 0x70b2, 0x00ee, 0x7034,
-	0x9005, 0x1904, 0x7bc7, 0x2009, 0x0017, 0x0804, 0x7b77, 0x908e,
-	0x0400, 0x1190, 0x7034, 0x9005, 0x1904, 0x7bc7, 0x080c, 0x6fb2,
-	0x0120, 0x2009, 0x001d, 0x0804, 0x7b77, 0x68d8, 0xc0a5, 0x68da,
-	0x2009, 0x0030, 0x0804, 0x7b77, 0x908e, 0x0500, 0x1140, 0x7034,
-	0x9005, 0x1904, 0x7bc7, 0x2009, 0x0018, 0x0804, 0x7b77, 0x908e,
-	0x2010, 0x1120, 0x2009, 0x0019, 0x0804, 0x7b77, 0x908e, 0x2110,
-	0x1120, 0x2009, 0x001a, 0x0804, 0x7b77, 0x908e, 0x5200, 0x1140,
-	0x7034, 0x9005, 0x1904, 0x7bc7, 0x2009, 0x001b, 0x0804, 0x7b77,
-	0x908e, 0x5000, 0x1140, 0x7034, 0x9005, 0x1904, 0x7bc7, 0x2009,
-	0x001c, 0x0804, 0x7b77, 0x908e, 0x1300, 0x1120, 0x2009, 0x0034,
-	0x0804, 0x7b77, 0x908e, 0x1200, 0x1140, 0x7034, 0x9005, 0x1904,
-	0x7bc7, 0x2009, 0x0024, 0x0804, 0x7b77, 0x908c, 0xff00, 0x918e,
-	0x2400, 0x1170, 0x2009, 0x002d, 0x2001, 0x1810, 0x2004, 0xd09c,
-	0x0904, 0x7b77, 0x080c, 0xc8b8, 0x1904, 0x7bc7, 0x0804, 0x7b75,
-	0x908c, 0xff00, 0x918e, 0x5300, 0x1120, 0x2009, 0x002a, 0x0804,
-	0x7b77, 0x908e, 0x0f00, 0x1120, 0x2009, 0x0020, 0x0804, 0x7b77,
-	0x908e, 0x6104, 0x1528, 0x2029, 0x0205, 0x2011, 0x026d, 0x8208,
-	0x2204, 0x9082, 0x0004, 0x8004, 0x8004, 0x20a8, 0x2011, 0x8015,
-	0x211c, 0x8108, 0x0046, 0x2124, 0x080c, 0x48d9, 0x004e, 0x8108,
-	0x0f04, 0x7b43, 0x9186, 0x0280, 0x1d88, 0x2504, 0x8000, 0x202a,
-	0x2009, 0x0260, 0x0c58, 0x202b, 0x0000, 0x2009, 0x0023, 0x0478,
-	0x908e, 0x6000, 0x1118, 0x2009, 0x003f, 0x0448, 0x908e, 0x7800,
-	0x1118, 0x2009, 0x0045, 0x0418, 0x908e, 0x1000, 0x1118, 0x2009,
-	0x004e, 0x00e8, 0x908e, 0x6300, 0x1118, 0x2009, 0x004a, 0x00b8,
-	0x908c, 0xff00, 0x918e, 0x5600, 0x1118, 0x2009, 0x004f, 0x0078,
-	0x908c, 0xff00, 0x918e, 0x5700, 0x1118, 0x2009, 0x0050, 0x0038,
-	0x2009, 0x001d, 0x6838, 0xd0d4, 0x0110, 0x2009, 0x004c, 0x0016,
-	0x2011, 0x0263, 0x2204, 0x8211, 0x220c, 0x080c, 0x2663, 0x1904,
-	0x7bca, 0x080c, 0x61de, 0x1904, 0x7bca, 0xbe12, 0xbd16, 0x001e,
-	0x0016, 0x080c, 0x6fb2, 0x01c0, 0x68d8, 0xd08c, 0x1148, 0x7000,
-	0x9084, 0x00ff, 0x1188, 0x7004, 0x9084, 0xff00, 0x1168, 0x0040,
-	0x6878, 0x9606, 0x1148, 0x687c, 0x9506, 0x9084, 0xff00, 0x1120,
-	0x9584, 0x00ff, 0xb8b2, 0x0080, 0xb8b0, 0x9005, 0x1168, 0x9186,
-	0x0046, 0x1150, 0x6878, 0x9606, 0x1138, 0x687c, 0x9506, 0x9084,
-	0xff00, 0x1110, 0x001e, 0x0098, 0x080c, 0x9ddc, 0x01a8, 0x2b08,
-	0x6112, 0x6023, 0x0004, 0x7120, 0x610a, 0x001e, 0x9186, 0x004c,
-	0x1110, 0x6023, 0x000a, 0x0016, 0x001e, 0x080c, 0x9eac, 0x00ce,
-	0x00be, 0x0005, 0x001e, 0x0cd8, 0x2001, 0x180e, 0x2004, 0xd0ec,
-	0x0120, 0x2011, 0x8049, 0x080c, 0x48d9, 0x080c, 0x9e7f, 0x0d90,
-	0x2b08, 0x6112, 0x6023, 0x0004, 0x7120, 0x610a, 0x001e, 0x0016,
-	0x9186, 0x0017, 0x0118, 0x9186, 0x0030, 0x1128, 0x6007, 0x0009,
-	0x6017, 0x2900, 0x0020, 0x6007, 0x0051, 0x6017, 0x0000, 0x602f,
-	0x0009, 0x6003, 0x0001, 0x080c, 0x8439, 0x08a0, 0x080c, 0x30fd,
-	0x1140, 0x7010, 0x9084, 0xff00, 0x8007, 0x908e, 0x0008, 0x1108,
-	0x0009, 0x0005, 0x00b6, 0x00c6, 0x0046, 0x7000, 0x908c, 0xff00,
-	0x810f, 0x9186, 0x0033, 0x11e8, 0x080c, 0x7e5e, 0x0904, 0x7c53,
-	0x7124, 0x610a, 0x7030, 0x908e, 0x0200, 0x1140, 0x7034, 0x9005,
-	0x15d0, 0x2009, 0x0015, 0x080c, 0x9eac, 0x04a8, 0x908e, 0x0100,
-	0x1590, 0x7034, 0x9005, 0x1578, 0x2009, 0x0016, 0x080c, 0x9eac,
-	0x0450, 0x9186, 0x0032, 0x1538, 0x7030, 0x908e, 0x1400, 0x1518,
-	0x2009, 0x0038, 0x0016, 0x2011, 0x0263, 0x2204, 0x8211, 0x220c,
-	0x080c, 0x2663, 0x11b8, 0x080c, 0x61de, 0x11a0, 0xbe12, 0xbd16,
-	0x080c, 0x9ddc, 0x0178, 0x2b08, 0x6112, 0x080c, 0xbf8c, 0x6023,
-	0x0004, 0x7120, 0x610a, 0x001e, 0x080c, 0x9eac, 0x080c, 0x8973,
-	0x0010, 0x00ce, 0x001e, 0x004e, 0x00ce, 0x00be, 0x0005, 0x00b6,
-	0x0046, 0x00e6, 0x00d6, 0x2028, 0x2130, 0x9696, 0x00ff, 0x11b8,
-	0x9592, 0xfffc, 0x02a0, 0x9596, 0xfffd, 0x1120, 0x2009, 0x007f,
-	0x0804, 0x7cb5, 0x9596, 0xfffe, 0x1120, 0x2009, 0x007e, 0x0804,
-	0x7cb5, 0x9596, 0xfffc, 0x1118, 0x2009, 0x0080, 0x04f0, 0x2011,
-	0x0000, 0x2019, 0x1836, 0x231c, 0xd3ac, 0x0130, 0x9026, 0x20a9,
-	0x0800, 0x2071, 0x1000, 0x0030, 0x2021, 0x0081, 0x20a9, 0x077f,
-	0x2071, 0x1081, 0x2e1c, 0x93dd, 0x0000, 0x1140, 0x82ff, 0x11d0,
-	0x9496, 0x00ff, 0x01b8, 0x2410, 0xc2fd, 0x00a0, 0xbf10, 0x2600,
-	0x9706, 0xb814, 0x1120, 0x9546, 0x1110, 0x2408, 0x00b0, 0x9745,
-	0x1148, 0x94c6, 0x007e, 0x0130, 0x94c6, 0x007f, 0x0118, 0x94c6,
-	0x0080, 0x1d20, 0x8420, 0x8e70, 0x1f04, 0x7c8a, 0x82ff, 0x1118,
-	0x9085, 0x0001, 0x0018, 0xc2fc, 0x2208, 0x9006, 0x00de, 0x00ee,
-	0x004e, 0x00be, 0x0005, 0x7000, 0x908c, 0xff00, 0x810f, 0x9184,
-	0x000f, 0x0002, 0x7cd2, 0x7cd2, 0x7cd2, 0x7e70, 0x7cd2, 0x7cdb,
-	0x7d06, 0x7d94, 0x7cd2, 0x7cd2, 0x7cd2, 0x7cd2, 0x7cd2, 0x7cd2,
-	0x7cd2, 0x7cd2, 0x7817, 0x0140, 0x2001, 0x19c1, 0x2004, 0x9005,
-	0x090c, 0x8973, 0x0005, 0x00b6, 0x7110, 0xd1bc, 0x01e8, 0x7120,
-	0x2160, 0x9c8c, 0x0007, 0x11c0, 0x9c8a, 0x1cd0, 0x02a8, 0x6864,
-	0x9c02, 0x1290, 0x7008, 0x9084, 0x00ff, 0x6110, 0x2158, 0xb910,
-	0x9106, 0x1150, 0x700c, 0xb914, 0x9106, 0x1130, 0x7124, 0x610a,
-	0x2009, 0x0046, 0x080c, 0x9eac, 0x7817, 0x0140, 0x2001, 0x19c1,
-	0x2004, 0x9005, 0x090c, 0x8973, 0x00be, 0x0005, 0x00b6, 0x00c6,
-	0x9484, 0x0fff, 0x0904, 0x7d6a, 0x7110, 0xd1bc, 0x1904, 0x7d6a,
-	0x7108, 0x700c, 0x2028, 0x918c, 0x00ff, 0x2130, 0x9094, 0xff00,
-	0x15b0, 0x81ff, 0x15a0, 0x9080, 0x3138, 0x200d, 0x918c, 0xff00,
-	0x810f, 0x2001, 0x0080, 0x9106, 0x0904, 0x7d6a, 0x080c, 0x61de,
-	0x1904, 0x7d6a, 0xbe12, 0xbd16, 0xb800, 0xd0ec, 0x15d8, 0xba04,
-	0x9294, 0xff00, 0x9286, 0x0600, 0x11a0, 0x080c, 0x9ddc, 0x05e8,
-	0x2b08, 0x7028, 0x604a, 0x702c, 0x6046, 0x6112, 0x6023, 0x0006,
-	0x7120, 0x610a, 0x7130, 0x6156, 0x2009, 0x0044, 0x080c, 0xcb14,
-	0x0408, 0x080c, 0x6562, 0x1138, 0xb807, 0x0606, 0x0c30, 0x190c,
-	0x7c57, 0x11c0, 0x0898, 0x080c, 0x9ddc, 0x2b08, 0x0198, 0x6112,
-	0x6023, 0x0004, 0x7120, 0x610a, 0x9286, 0x0400, 0x1118, 0x6007,
-	0x0005, 0x0010, 0x6007, 0x0001, 0x6003, 0x0001, 0x080c, 0x8439,
-	0x080c, 0x8973, 0x7817, 0x0140, 0x2001, 0x19c1, 0x2004, 0x9005,
-	0x090c, 0x8973, 0x00ce, 0x00be, 0x0005, 0x2001, 0x180e, 0x2004,
-	0xd0ec, 0x0120, 0x2011, 0x8049, 0x080c, 0x48d9, 0x080c, 0x9e7f,
-	0x0d48, 0x2b08, 0x6112, 0x6023, 0x0006, 0x7120, 0x610a, 0x7130,
-	0x6156, 0x6017, 0xf300, 0x6003, 0x0001, 0x6007, 0x0041, 0x080c,
-	0x83f1, 0x080c, 0x8973, 0x08b0, 0x00b6, 0x7110, 0xd1bc, 0x01e8,
-	0x7020, 0x2060, 0x9c84, 0x0007, 0x11c0, 0x9c82, 0x1cd0, 0x02a8,
+	0x6822, 0x00de, 0x2071, 0x1906, 0x701c, 0x2048, 0x7010, 0x8001,
+	0x7012, 0xa800, 0x701e, 0x9005, 0x1108, 0x701a, 0x012e, 0x0005,
+	0x0005, 0x00d6, 0x2008, 0x2069, 0x19ca, 0x683c, 0x9005, 0x0760,
+	0x0158, 0x9186, 0x0003, 0x0540, 0x2001, 0x1814, 0x2004, 0x2009,
+	0x1a97, 0x210c, 0x9102, 0x1500, 0x0126, 0x2091, 0x8000, 0x2069,
+	0x0050, 0x693c, 0x6838, 0x9106, 0x0190, 0x0e04, 0x6b73, 0x2069,
+	0x0000, 0x6837, 0x8040, 0x6833, 0x0012, 0x6883, 0x8040, 0x2091,
+	0x4080, 0x2001, 0x0089, 0x2004, 0xd084, 0x190c, 0x1187, 0x2069,
+	0x19ca, 0x683f, 0xffff, 0x012e, 0x00de, 0x0126, 0x2091, 0x8000,
+	0x1e0c, 0x6c28, 0x701c, 0x904d, 0x0540, 0x2001, 0x005b, 0x2004,
+	0x9094, 0x0780, 0x15c9, 0xd09c, 0x1500, 0x2071, 0x1906, 0x700f,
+	0x0001, 0xa964, 0x9184, 0x00ff, 0x9086, 0x0003, 0x1130, 0x810f,
+	0x918c, 0x00ff, 0x8101, 0x0108, 0x710e, 0x2900, 0x00d6, 0x2069,
+	0x0050, 0x6822, 0x00de, 0x701c, 0x2048, 0x7010, 0x8001, 0x7012,
+	0xa800, 0x701e, 0x9005, 0x1108, 0x701a, 0x012e, 0x0005, 0x0005,
+	0x0126, 0x2091, 0x8000, 0x701c, 0x904d, 0x0160, 0x7010, 0x8001,
+	0x7012, 0xa800, 0x701e, 0x9005, 0x1108, 0x701a, 0x012e, 0x080c,
+	0x101d, 0x0005, 0x012e, 0x0005, 0x2091, 0x8000, 0x0e04, 0x6bbe,
+	0x0006, 0x0016, 0x2001, 0x8004, 0x0006, 0x0804, 0x0dbd, 0x0096,
+	0x00f6, 0x2079, 0x0050, 0x7044, 0xd084, 0x01c0, 0xc084, 0x7046,
+	0x7838, 0x7938, 0x910e, 0x1de0, 0x00d6, 0x2069, 0x0000, 0x6836,
+	0x6833, 0x0013, 0x00de, 0x2091, 0x4080, 0x2001, 0x0089, 0x2004,
+	0xd084, 0x190c, 0x1187, 0x00fe, 0x009e, 0x0005, 0x782c, 0x9094,
+	0x0780, 0x1991, 0xd0a4, 0x0db8, 0x00e6, 0x2071, 0x1800, 0x7824,
+	0x00e6, 0x2071, 0x0040, 0x712c, 0xd19c, 0x1148, 0x2009, 0x182f,
+	0x210c, 0x918a, 0x0040, 0x0218, 0x7022, 0x00ee, 0x0058, 0x00ee,
+	0x2048, 0x702c, 0xa802, 0x2900, 0x702e, 0x70bc, 0x8000, 0x70be,
+	0x080c, 0x7f46, 0x782c, 0x9094, 0x0780, 0x190c, 0x6bbc, 0xd0a4,
+	0x19f0, 0x7838, 0x7938, 0x910e, 0x1de0, 0x00d6, 0x2069, 0x0000,
+	0x6836, 0x6833, 0x0013, 0x00de, 0x2091, 0x4080, 0x2001, 0x0089,
+	0x2004, 0xd084, 0x190c, 0x1187, 0x00ee, 0x00fe, 0x009e, 0x0005,
+	0x00f6, 0x2079, 0x0050, 0x7044, 0xd084, 0x01b8, 0xc084, 0x7046,
+	0x7838, 0x7938, 0x910e, 0x1de0, 0x00d6, 0x2069, 0x0000, 0x6836,
+	0x6833, 0x0013, 0x00de, 0x2091, 0x4080, 0x2001, 0x0089, 0x2004,
+	0xd084, 0x190c, 0x1187, 0x00fe, 0x0005, 0x782c, 0x9094, 0x0780,
+	0x190c, 0x6bbc, 0xd0a4, 0x0db8, 0x00e6, 0x2071, 0x1800, 0x7824,
+	0x2048, 0x702c, 0xa802, 0x2900, 0x702e, 0x70bc, 0x8000, 0x70be,
+	0x080c, 0x7f46, 0x782c, 0x9094, 0x0780, 0x190c, 0x6bbc, 0xd0a4,
+	0x1d70, 0x00d6, 0x2069, 0x0050, 0x693c, 0x2069, 0x1919, 0x6808,
+	0x690a, 0x2069, 0x19ca, 0x9102, 0x1118, 0x683c, 0x9005, 0x1328,
+	0x2001, 0x191a, 0x200c, 0x810d, 0x693e, 0x00de, 0x00ee, 0x00fe,
+	0x0005, 0x7094, 0x908a, 0x0029, 0x1a0c, 0x0db4, 0x9082, 0x001d,
+	0x001b, 0x6027, 0x1e00, 0x0005, 0x6d50, 0x6cd6, 0x6cf2, 0x6d1c,
+	0x6d3f, 0x6d7f, 0x6d91, 0x6cf2, 0x6d67, 0x6c91, 0x6cbf, 0x6c90,
+	0x0005, 0x00d6, 0x2069, 0x0200, 0x6804, 0x9005, 0x1180, 0x6808,
+	0x9005, 0x1518, 0x7097, 0x0028, 0x2069, 0x195f, 0x2d04, 0x7002,
+	0x080c, 0x70d4, 0x6028, 0x9085, 0x0600, 0x602a, 0x00b0, 0x7097,
+	0x0028, 0x2069, 0x195f, 0x2d04, 0x7002, 0x6028, 0x9085, 0x0600,
+	0x602a, 0x00e6, 0x0036, 0x0046, 0x0056, 0x2071, 0x1a32, 0x080c,
+	0x195a, 0x005e, 0x004e, 0x003e, 0x00ee, 0x00de, 0x0005, 0x00d6,
+	0x2069, 0x0200, 0x6804, 0x9005, 0x1178, 0x6808, 0x9005, 0x1160,
+	0x7097, 0x0028, 0x2069, 0x195f, 0x2d04, 0x7002, 0x080c, 0x716e,
+	0x6028, 0x9085, 0x0600, 0x602a, 0x00de, 0x0005, 0x0006, 0x2001,
+	0x0090, 0x080c, 0x2b16, 0x000e, 0x6124, 0xd1e4, 0x1190, 0x080c,
+	0x6dfe, 0xd1d4, 0x1160, 0xd1dc, 0x1138, 0xd1cc, 0x0150, 0x7097,
+	0x0020, 0x080c, 0x6dfe, 0x0028, 0x7097, 0x001d, 0x0010, 0x7097,
+	0x001f, 0x0005, 0x2001, 0x0088, 0x080c, 0x2b16, 0x6124, 0xd1cc,
+	0x11e8, 0xd1dc, 0x11c0, 0xd1e4, 0x1198, 0x9184, 0x1e00, 0x11d8,
+	0x080c, 0x1984, 0x60e3, 0x0001, 0x600c, 0xc0b4, 0x600e, 0x080c,
+	0x6fc7, 0x2001, 0x0080, 0x080c, 0x2b16, 0x7097, 0x0028, 0x0058,
+	0x7097, 0x001e, 0x0040, 0x7097, 0x001d, 0x0028, 0x7097, 0x0020,
+	0x0010, 0x7097, 0x001f, 0x0005, 0x080c, 0x1984, 0x60e3, 0x0001,
+	0x600c, 0xc0b4, 0x600e, 0x080c, 0x6fc7, 0x2001, 0x0080, 0x080c,
+	0x2b16, 0x6124, 0xd1d4, 0x1180, 0xd1dc, 0x1158, 0xd1e4, 0x1130,
+	0x9184, 0x1e00, 0x1158, 0x7097, 0x0028, 0x0040, 0x7097, 0x001e,
+	0x0028, 0x7097, 0x001d, 0x0010, 0x7097, 0x001f, 0x0005, 0x2001,
+	0x00a0, 0x080c, 0x2b16, 0x6124, 0xd1dc, 0x1138, 0xd1e4, 0x0138,
+	0x080c, 0x1984, 0x7097, 0x001e, 0x0010, 0x7097, 0x001d, 0x0005,
+	0x080c, 0x6e81, 0x6124, 0xd1dc, 0x1188, 0x080c, 0x6dfe, 0x0016,
+	0x080c, 0x1984, 0x001e, 0xd1d4, 0x1128, 0xd1e4, 0x0138, 0x7097,
+	0x001e, 0x0020, 0x7097, 0x001f, 0x080c, 0x6dfe, 0x0005, 0x0006,
+	0x2001, 0x00a0, 0x080c, 0x2b16, 0x000e, 0x6124, 0xd1d4, 0x1160,
+	0xd1cc, 0x1150, 0xd1dc, 0x1128, 0xd1e4, 0x0140, 0x7097, 0x001e,
+	0x0028, 0x7097, 0x001d, 0x0010, 0x7097, 0x0021, 0x0005, 0x080c,
+	0x6e81, 0x6124, 0xd1d4, 0x1150, 0xd1dc, 0x1128, 0xd1e4, 0x0140,
+	0x7097, 0x001e, 0x0028, 0x7097, 0x001d, 0x0010, 0x7097, 0x001f,
+	0x0005, 0x0006, 0x2001, 0x0090, 0x080c, 0x2b16, 0x000e, 0x6124,
+	0xd1d4, 0x1178, 0xd1cc, 0x1150, 0xd1dc, 0x1128, 0xd1e4, 0x0158,
+	0x7097, 0x001e, 0x0040, 0x7097, 0x001d, 0x0028, 0x7097, 0x0020,
+	0x0010, 0x7097, 0x001f, 0x0005, 0x0016, 0x00c6, 0x00d6, 0x00e6,
+	0x0126, 0x2061, 0x0100, 0x2069, 0x0140, 0x2071, 0x1800, 0x2091,
+	0x8000, 0x080c, 0x6f9b, 0x11d8, 0x2001, 0x180c, 0x200c, 0xd1b4,
+	0x01b0, 0xc1b4, 0x2102, 0x6027, 0x0200, 0x080c, 0x2a5f, 0x6024,
+	0xd0cc, 0x0148, 0x2001, 0x00a0, 0x080c, 0x2b16, 0x080c, 0x727f,
+	0x080c, 0x5cda, 0x0428, 0x6028, 0xc0cd, 0x602a, 0x0408, 0x080c,
+	0x6fb5, 0x0150, 0x080c, 0x6fac, 0x1138, 0x2001, 0x0001, 0x080c,
+	0x260e, 0x080c, 0x6f73, 0x00a0, 0x080c, 0x6e7e, 0x0178, 0x2001,
+	0x0001, 0x080c, 0x260e, 0x7094, 0x9086, 0x001e, 0x0120, 0x7094,
+	0x9086, 0x0022, 0x1118, 0x7097, 0x0025, 0x0010, 0x7097, 0x0021,
+	0x012e, 0x00ee, 0x00de, 0x00ce, 0x001e, 0x0005, 0x0026, 0x2011,
+	0x6e0f, 0x080c, 0x80f5, 0x002e, 0x0016, 0x0026, 0x2009, 0x0064,
+	0x2011, 0x6e0f, 0x080c, 0x80ec, 0x002e, 0x001e, 0x0005, 0x00e6,
+	0x00f6, 0x0016, 0x080c, 0x93ad, 0x2071, 0x1800, 0x080c, 0x6dac,
+	0x001e, 0x00fe, 0x00ee, 0x0005, 0x0016, 0x0026, 0x0036, 0x00c6,
+	0x00d6, 0x00e6, 0x00f6, 0x0126, 0x080c, 0x93ad, 0x2061, 0x0100,
+	0x2069, 0x0140, 0x2071, 0x1800, 0x2091, 0x8000, 0x6028, 0xc09c,
+	0x602a, 0x2011, 0x0003, 0x080c, 0x9772, 0x2011, 0x0002, 0x080c,
+	0x977c, 0x080c, 0x9663, 0x080c, 0x80a1, 0x0036, 0x901e, 0x080c,
+	0x96d9, 0x003e, 0x60e3, 0x0000, 0x080c, 0xd8d5, 0x080c, 0xd8f0,
+	0x2009, 0x0004, 0x080c, 0x2a65, 0x080c, 0x2980, 0x2001, 0x1800,
+	0x2003, 0x0004, 0x6027, 0x0008, 0x2011, 0x6e0f, 0x080c, 0x80f5,
+	0x080c, 0x6fb5, 0x0118, 0x9006, 0x080c, 0x2b16, 0x080c, 0x0b8f,
+	0x2001, 0x0001, 0x080c, 0x260e, 0x012e, 0x00fe, 0x00ee, 0x00de,
+	0x00ce, 0x003e, 0x002e, 0x001e, 0x0005, 0x0026, 0x00e6, 0x2011,
+	0x6e1c, 0x2071, 0x19ca, 0x701c, 0x9206, 0x1118, 0x7018, 0x9005,
+	0x0110, 0x9085, 0x0001, 0x00ee, 0x002e, 0x0005, 0x6020, 0xd09c,
+	0x0005, 0x6800, 0x9084, 0xfffe, 0x9086, 0x00c0, 0x01b8, 0x2001,
+	0x00c0, 0x080c, 0x2b16, 0x0156, 0x20a9, 0x002d, 0x1d04, 0x6e8e,
+	0x2091, 0x6000, 0x1f04, 0x6e8e, 0x015e, 0x00d6, 0x2069, 0x1800,
+	0x6898, 0x8001, 0x0220, 0x0118, 0x689a, 0x00de, 0x0005, 0x689b,
+	0x0014, 0x68e4, 0xd0dc, 0x0dc8, 0x6800, 0x9086, 0x0001, 0x1da8,
+	0x080c, 0x8101, 0x0c90, 0x00c6, 0x00d6, 0x00e6, 0x2061, 0x0100,
+	0x2069, 0x0140, 0x2071, 0x1800, 0x080c, 0x728e, 0x2001, 0x193d,
+	0x2003, 0x0000, 0x9006, 0x7096, 0x60e2, 0x6886, 0x080c, 0x26d9,
+	0x9006, 0x080c, 0x2b16, 0x080c, 0x5b99, 0x6027, 0xffff, 0x602b,
+	0x182f, 0x00ee, 0x00de, 0x00ce, 0x0005, 0x00c6, 0x00d6, 0x00e6,
+	0x2061, 0x0100, 0x2069, 0x0140, 0x2071, 0x1800, 0x2001, 0x194d,
+	0x200c, 0x9186, 0x0000, 0x0158, 0x9186, 0x0001, 0x0158, 0x9186,
+	0x0002, 0x0158, 0x9186, 0x0003, 0x0158, 0x0804, 0x6f63, 0x7097,
+	0x0022, 0x0040, 0x7097, 0x0021, 0x0028, 0x7097, 0x0023, 0x0010,
+	0x7097, 0x0024, 0x60e3, 0x0000, 0x6887, 0x0001, 0x2001, 0x0001,
+	0x080c, 0x26d9, 0x0026, 0x080c, 0x9dc8, 0x002e, 0x7000, 0x908e,
+	0x0004, 0x0118, 0x602b, 0x0028, 0x0010, 0x602b, 0x0020, 0x0156,
+	0x0126, 0x2091, 0x8000, 0x20a9, 0x0005, 0x6024, 0xd0ac, 0x0150,
+	0x012e, 0x015e, 0x080c, 0xc22c, 0x0118, 0x9006, 0x080c, 0x2b40,
+	0x0804, 0x6f6f, 0x6800, 0x9084, 0x00a1, 0xc0bd, 0x6802, 0x080c,
+	0x2a5f, 0x6904, 0xd1d4, 0x1140, 0x2001, 0x0100, 0x080c, 0x2b16,
+	0x1f04, 0x6f0d, 0x080c, 0x6ff2, 0x012e, 0x015e, 0x080c, 0x6fac,
+	0x01a8, 0x6044, 0x9005, 0x0168, 0x6050, 0x0006, 0x9085, 0x0020,
+	0x6052, 0x080c, 0x6ff2, 0x9006, 0x8001, 0x1df0, 0x000e, 0x6052,
+	0x0028, 0x6804, 0xd0d4, 0x1110, 0x080c, 0x6ff2, 0x080c, 0xc22c,
+	0x0118, 0x9006, 0x080c, 0x2b40, 0x0016, 0x0026, 0x7000, 0x908e,
+	0x0004, 0x0130, 0x2009, 0x00c8, 0x2011, 0x6e1c, 0x080c, 0x80b3,
+	0x002e, 0x001e, 0x080c, 0x7f3d, 0x7034, 0xc085, 0x7036, 0x2001,
+	0x194d, 0x2003, 0x0004, 0x080c, 0x6c79, 0x080c, 0x6fac, 0x0138,
+	0x6804, 0xd0d4, 0x1120, 0xd0dc, 0x1100, 0x080c, 0x7284, 0x00ee,
+	0x00de, 0x00ce, 0x0005, 0x00c6, 0x00d6, 0x00e6, 0x2061, 0x0100,
+	0x2069, 0x0140, 0x2071, 0x1800, 0x080c, 0x7f54, 0x080c, 0x7f46,
+	0x080c, 0x728e, 0x2001, 0x193d, 0x2003, 0x0000, 0x9006, 0x7096,
+	0x60e2, 0x6886, 0x080c, 0x26d9, 0x9006, 0x080c, 0x2b16, 0x6043,
+	0x0090, 0x6043, 0x0010, 0x6027, 0xffff, 0x602b, 0x182f, 0x00ee,
+	0x00de, 0x00ce, 0x0005, 0x0006, 0x2001, 0x194c, 0x2004, 0x9086,
+	0xaaaa, 0x000e, 0x0005, 0x0006, 0x080c, 0x5393, 0x9084, 0x0030,
+	0x9086, 0x0000, 0x000e, 0x0005, 0x0006, 0x080c, 0x5393, 0x9084,
+	0x0030, 0x9086, 0x0030, 0x000e, 0x0005, 0x0006, 0x080c, 0x5393,
+	0x9084, 0x0030, 0x9086, 0x0010, 0x000e, 0x0005, 0x0006, 0x080c,
+	0x5393, 0x9084, 0x0030, 0x9086, 0x0020, 0x000e, 0x0005, 0x0036,
+	0x0016, 0x2001, 0x180c, 0x2004, 0x908c, 0x0013, 0x0180, 0x0020,
+	0x080c, 0x26f9, 0x900e, 0x0028, 0x080c, 0x6563, 0x1dc8, 0x2009,
+	0x0002, 0x2019, 0x0028, 0x080c, 0x2fa7, 0x9006, 0x0019, 0x001e,
+	0x003e, 0x0005, 0x00e6, 0x2071, 0x180c, 0x2e04, 0x0130, 0x080c,
+	0xc225, 0x1128, 0x9085, 0x0010, 0x0010, 0x9084, 0xffef, 0x2072,
+	0x00ee, 0x0005, 0x6050, 0x0006, 0x60ec, 0x0006, 0x600c, 0x0006,
+	0x6004, 0x0006, 0x6028, 0x0006, 0x0016, 0x6138, 0x6050, 0x9084,
+	0xfbff, 0x9085, 0x2000, 0x6052, 0x613a, 0x20a9, 0x0012, 0x1d04,
+	0x7007, 0x2091, 0x6000, 0x1f04, 0x7007, 0x602f, 0x0100, 0x602f,
+	0x0000, 0x6050, 0x9085, 0x0400, 0x9084, 0xdfff, 0x6052, 0x613a,
+	0x001e, 0x602f, 0x0040, 0x602f, 0x0000, 0x000e, 0x602a, 0x000e,
+	0x6006, 0x000e, 0x600e, 0x000e, 0x60ee, 0x60e3, 0x0000, 0x6887,
+	0x0001, 0x2001, 0x0001, 0x080c, 0x26d9, 0x2001, 0x00a0, 0x0006,
+	0x080c, 0xc22c, 0x000e, 0x0130, 0x080c, 0x2b34, 0x9006, 0x080c,
+	0x2b40, 0x0010, 0x080c, 0x2b16, 0x000e, 0x6052, 0x6050, 0x0006,
+	0xc0e5, 0x6052, 0x00f6, 0x2079, 0x0100, 0x080c, 0x29d4, 0x00fe,
+	0x000e, 0x6052, 0x0005, 0x0156, 0x0016, 0x0026, 0x0036, 0x00c6,
+	0x00d6, 0x00e6, 0x2061, 0x0100, 0x2069, 0x0140, 0x2071, 0x1800,
+	0x6020, 0x9084, 0x0080, 0x0138, 0x2001, 0x180c, 0x200c, 0xc1c5,
+	0x2102, 0x0804, 0x70c6, 0x2001, 0x180c, 0x200c, 0xc1c4, 0x2102,
+	0x6028, 0x9084, 0xe1ff, 0x602a, 0x6027, 0x0200, 0x2001, 0x0090,
+	0x080c, 0x2b16, 0x20a9, 0x0366, 0x6024, 0xd0cc, 0x1518, 0x1d04,
+	0x7074, 0x2091, 0x6000, 0x1f04, 0x7074, 0x2011, 0x0003, 0x080c,
+	0x9772, 0x2011, 0x0002, 0x080c, 0x977c, 0x080c, 0x9663, 0x901e,
+	0x080c, 0x96d9, 0x2001, 0x00a0, 0x080c, 0x2b16, 0x080c, 0x727f,
+	0x080c, 0x5cda, 0x080c, 0xc22c, 0x0110, 0x080c, 0x0d22, 0x9085,
+	0x0001, 0x0490, 0x86ff, 0x1110, 0x080c, 0x1984, 0x60e3, 0x0000,
+	0x2001, 0x0002, 0x080c, 0x26d9, 0x60e2, 0x2001, 0x0080, 0x080c,
+	0x2b16, 0x20a9, 0x0366, 0x6027, 0x1e00, 0x2009, 0x1e00, 0x080c,
+	0x2a5f, 0x6024, 0x910c, 0x0138, 0x1d04, 0x70ab, 0x2091, 0x6000,
+	0x1f04, 0x70ab, 0x0810, 0x6028, 0x9085, 0x1e00, 0x602a, 0x70b0,
+	0x9005, 0x1118, 0x6887, 0x0001, 0x0008, 0x6886, 0x080c, 0xc22c,
+	0x0110, 0x080c, 0x0d22, 0x9006, 0x00ee, 0x00de, 0x00ce, 0x003e,
+	0x002e, 0x001e, 0x015e, 0x0005, 0x0156, 0x0016, 0x0026, 0x0036,
+	0x00c6, 0x00d6, 0x00e6, 0x2061, 0x0100, 0x2071, 0x1800, 0x7000,
+	0x9086, 0x0003, 0x1168, 0x2001, 0x020b, 0x2004, 0x9084, 0x5540,
+	0x9086, 0x5540, 0x1128, 0x2069, 0x1a48, 0x2d04, 0x8000, 0x206a,
+	0x2069, 0x0140, 0x6020, 0x9084, 0x00c0, 0x0120, 0x6884, 0x9005,
+	0x1904, 0x7139, 0x2001, 0x0088, 0x080c, 0x2b16, 0x9006, 0x60e2,
+	0x6886, 0x080c, 0x26d9, 0x2069, 0x0200, 0x6804, 0x9005, 0x1118,
+	0x6808, 0x9005, 0x01c0, 0x6028, 0x9084, 0xfbff, 0x602a, 0x6027,
+	0x0400, 0x2069, 0x195f, 0x7000, 0x206a, 0x7097, 0x0026, 0x7003,
+	0x0001, 0x20a9, 0x0002, 0x1d04, 0x711b, 0x2091, 0x6000, 0x1f04,
+	0x711b, 0x0804, 0x7166, 0x2069, 0x0140, 0x20a9, 0x0384, 0x6027,
+	0x1e00, 0x2009, 0x1e00, 0x080c, 0x2a5f, 0x6024, 0x910c, 0x0508,
+	0x9084, 0x1a00, 0x11f0, 0x1d04, 0x7127, 0x2091, 0x6000, 0x1f04,
+	0x7127, 0x2011, 0x0003, 0x080c, 0x9772, 0x2011, 0x0002, 0x080c,
+	0x977c, 0x080c, 0x9663, 0x901e, 0x080c, 0x96d9, 0x2001, 0x00a0,
+	0x080c, 0x2b16, 0x080c, 0x727f, 0x080c, 0x5cda, 0x9085, 0x0001,
+	0x00a8, 0x2001, 0x0080, 0x080c, 0x2b16, 0x2069, 0x0140, 0x60e3,
+	0x0000, 0x70b0, 0x9005, 0x1118, 0x6887, 0x0001, 0x0008, 0x6886,
+	0x2001, 0x0002, 0x080c, 0x26d9, 0x60e2, 0x9006, 0x00ee, 0x00de,
+	0x00ce, 0x003e, 0x002e, 0x001e, 0x015e, 0x0005, 0x0156, 0x0016,
+	0x0026, 0x0036, 0x00c6, 0x00d6, 0x00e6, 0x2061, 0x0100, 0x2071,
+	0x1800, 0x6020, 0x9084, 0x00c0, 0x01c8, 0x2011, 0x0003, 0x080c,
+	0x9772, 0x2011, 0x0002, 0x080c, 0x977c, 0x080c, 0x9663, 0x901e,
+	0x080c, 0x96d9, 0x2069, 0x0140, 0x2001, 0x00a0, 0x080c, 0x2b16,
+	0x080c, 0x727f, 0x080c, 0x5cda, 0x0804, 0x7200, 0x2001, 0x180c,
+	0x200c, 0xd1b4, 0x1160, 0xc1b5, 0x2102, 0x080c, 0x6e04, 0x2069,
+	0x0140, 0x2001, 0x0080, 0x080c, 0x2b16, 0x60e3, 0x0000, 0x2069,
+	0x0200, 0x6804, 0x9005, 0x1118, 0x6808, 0x9005, 0x0180, 0x6028,
+	0x9084, 0xfdff, 0x602a, 0x6027, 0x0200, 0x2069, 0x195f, 0x7000,
+	0x206a, 0x7097, 0x0027, 0x7003, 0x0001, 0x0804, 0x7200, 0x6027,
+	0x1e00, 0x2009, 0x1e00, 0x080c, 0x2a5f, 0x6024, 0x910c, 0x01c8,
+	0x9084, 0x1c00, 0x11b0, 0x1d04, 0x71bf, 0x0006, 0x0016, 0x00c6,
+	0x00d6, 0x00e6, 0x080c, 0x7f85, 0x00ee, 0x00de, 0x00ce, 0x001e,
+	0x000e, 0x00e6, 0x2071, 0x19ca, 0x7018, 0x00ee, 0x9005, 0x19f8,
+	0x01f8, 0x0026, 0x2011, 0x6e1c, 0x080c, 0x8021, 0x2011, 0x6e0f,
+	0x080c, 0x80f5, 0x002e, 0x2069, 0x0140, 0x60e3, 0x0000, 0x70b0,
+	0x9005, 0x1118, 0x6887, 0x0001, 0x0008, 0x6886, 0x2001, 0x0002,
+	0x080c, 0x26d9, 0x60e2, 0x2001, 0x180c, 0x200c, 0xc1b4, 0x2102,
+	0x00ee, 0x00de, 0x00ce, 0x003e, 0x002e, 0x001e, 0x015e, 0x0005,
+	0x0156, 0x0016, 0x0026, 0x0036, 0x0046, 0x00c6, 0x00e6, 0x2061,
+	0x0100, 0x2071, 0x1800, 0x080c, 0xc225, 0x1904, 0x726d, 0x7130,
+	0xd184, 0x1170, 0x080c, 0x3135, 0x0138, 0xc18d, 0x7132, 0x2011,
+	0x1854, 0x2214, 0xd2ac, 0x1120, 0x7030, 0xd08c, 0x0904, 0x726d,
+	0x2011, 0x1854, 0x220c, 0x0438, 0x0016, 0x2019, 0x000e, 0x080c,
+	0xd4c7, 0x0156, 0x00b6, 0x20a9, 0x007f, 0x900e, 0x9186, 0x007e,
+	0x01a0, 0x9186, 0x0080, 0x0188, 0x080c, 0x6247, 0x1170, 0x2120,
+	0x9006, 0x0016, 0x2009, 0x000e, 0x080c, 0xd54b, 0x2009, 0x0001,
+	0x2011, 0x0100, 0x080c, 0x8218, 0x001e, 0x8108, 0x1f04, 0x7236,
+	0x00be, 0x015e, 0x001e, 0xd1ac, 0x1148, 0x0016, 0x2009, 0x0002,
+	0x2019, 0x0004, 0x080c, 0x2fa7, 0x001e, 0x0078, 0x0156, 0x00b6,
+	0x20a9, 0x007f, 0x900e, 0x080c, 0x6247, 0x1110, 0x080c, 0x5cf4,
+	0x8108, 0x1f04, 0x7263, 0x00be, 0x015e, 0x080c, 0x1984, 0x080c,
+	0x9dc8, 0x60e3, 0x0000, 0x080c, 0x5cda, 0x080c, 0x6ecd, 0x00ee,
+	0x00ce, 0x004e, 0x003e, 0x002e, 0x001e, 0x015e, 0x0005, 0x2001,
+	0x194d, 0x2003, 0x0001, 0x0005, 0x2001, 0x194d, 0x2003, 0x0000,
+	0x0005, 0x2001, 0x194c, 0x2003, 0xaaaa, 0x0005, 0x2001, 0x194c,
+	0x2003, 0x0000, 0x0005, 0x2071, 0x18f0, 0x7003, 0x0000, 0x7007,
+	0x0000, 0x080c, 0x1004, 0x090c, 0x0db4, 0xa8ab, 0xdcb0, 0x2900,
+	0x704e, 0x080c, 0x1004, 0x090c, 0x0db4, 0xa8ab, 0xdcb0, 0x2900,
+	0x7052, 0xa867, 0x0000, 0xa86b, 0x0001, 0xa89f, 0x0000, 0x0005,
+	0x00e6, 0x2071, 0x0040, 0x6848, 0x9005, 0x1118, 0x9085, 0x0001,
+	0x04b0, 0x6840, 0x9005, 0x0150, 0x04a1, 0x6a50, 0x9200, 0x7002,
+	0x6854, 0x9101, 0x7006, 0x9006, 0x7012, 0x7016, 0x6850, 0x7002,
+	0x6854, 0x7006, 0x6858, 0x700a, 0x685c, 0x700e, 0x6840, 0x9005,
+	0x1110, 0x7012, 0x7016, 0x6848, 0x701a, 0x701c, 0x9085, 0x0040,
+	0x701e, 0x2001, 0x0019, 0x7036, 0x702b, 0x0001, 0x2001, 0x0004,
+	0x200c, 0x918c, 0xfff7, 0x918d, 0x8000, 0x2102, 0x00d6, 0x2069,
+	0x18f0, 0x6807, 0x0001, 0x00de, 0x080c, 0x7880, 0x9006, 0x00ee,
+	0x0005, 0x900e, 0x0156, 0x20a9, 0x0006, 0x8003, 0x2011, 0x0100,
+	0x2214, 0x9296, 0x0008, 0x1110, 0x818d, 0x0010, 0x81f5, 0x3e08,
+	0x1f04, 0x72f5, 0x015e, 0x0005, 0x2079, 0x0040, 0x2071, 0x18f0,
+	0x7004, 0x0002, 0x7314, 0x7315, 0x734c, 0x73a7, 0x74e8, 0x7312,
+	0x7312, 0x7512, 0x080c, 0x0db4, 0x0005, 0x2079, 0x0040, 0x782c,
+	0x908c, 0x0780, 0x190c, 0x790c, 0xd0a4, 0x01f0, 0x7824, 0x2048,
+	0x9006, 0xa802, 0xa806, 0xa864, 0x9084, 0x00ff, 0x908a, 0x0040,
+	0x0608, 0x00b8, 0x2001, 0x1800, 0x200c, 0x9186, 0x0003, 0x1160,
+	0x7104, 0x9186, 0x0004, 0x0140, 0x9186, 0x0007, 0x0128, 0x9186,
+	0x0003, 0x19e8, 0x080c, 0x73a7, 0x782c, 0xd09c, 0x090c, 0x7880,
+	0x0005, 0x9082, 0x005a, 0x1218, 0x2100, 0x003b, 0x0c18, 0x080c,
+	0x73dd, 0x0c90, 0x00e3, 0x08f0, 0x0005, 0x73dd, 0x73dd, 0x73dd,
+	0x73dd, 0x73dd, 0x73dd, 0x73dd, 0x73dd, 0x73ff, 0x73dd, 0x73dd,
+	0x73dd, 0x73dd, 0x73dd, 0x73dd, 0x73dd, 0x73dd, 0x73dd, 0x73dd,
+	0x73dd, 0x73dd, 0x73dd, 0x73dd, 0x73dd, 0x73dd, 0x73dd, 0x73dd,
+	0x73dd, 0x73e9, 0x73dd, 0x75e7, 0x73dd, 0x73dd, 0x73dd, 0x73ff,
+	0x73dd, 0x73e9, 0x7628, 0x7669, 0x76b0, 0x76c4, 0x73dd, 0x73dd,
+	0x73ff, 0x73e9, 0x73dd, 0x73dd, 0x74bc, 0x776f, 0x778a, 0x73dd,
+	0x73ff, 0x73dd, 0x73dd, 0x73dd, 0x73dd, 0x74b2, 0x778a, 0x73dd,
+	0x73dd, 0x73dd, 0x73dd, 0x73dd, 0x73dd, 0x73dd, 0x73dd, 0x73dd,
+	0x7413, 0x73dd, 0x73dd, 0x73dd, 0x73dd, 0x73dd, 0x73dd, 0x73dd,
+	0x73dd, 0x73dd, 0x78b0, 0x73dd, 0x73dd, 0x73dd, 0x73dd, 0x73dd,
+	0x7427, 0x73dd, 0x73dd, 0x73dd, 0x73dd, 0x73dd, 0x73dd, 0x2079,
+	0x0040, 0x7004, 0x9086, 0x0003, 0x1198, 0x782c, 0x080c, 0x78a9,
+	0xd0a4, 0x0170, 0x7824, 0x2048, 0x9006, 0xa802, 0xa806, 0xa864,
+	0x9084, 0x00ff, 0x908a, 0x001a, 0x1210, 0x002b, 0x0c50, 0x00e9,
+	0x080c, 0x7880, 0x0005, 0x73dd, 0x73e9, 0x75d3, 0x73dd, 0x73e9,
+	0x73dd, 0x73e9, 0x73e9, 0x73dd, 0x73e9, 0x75d3, 0x73e9, 0x73e9,
+	0x73e9, 0x73e9, 0x73e9, 0x73dd, 0x73e9, 0x75d3, 0x73dd, 0x73dd,
+	0x73e9, 0x73dd, 0x73dd, 0x73dd, 0x73e9, 0x00e6, 0x2071, 0x18f0,
+	0x2009, 0x0400, 0x0071, 0x00ee, 0x0005, 0x2009, 0x1000, 0x0049,
+	0x0005, 0x2009, 0x2000, 0x0029, 0x0005, 0x2009, 0x0800, 0x0009,
+	0x0005, 0x7007, 0x0001, 0xa868, 0x9084, 0x00ff, 0x9105, 0xa86a,
+	0x0126, 0x2091, 0x8000, 0x080c, 0x6891, 0x012e, 0x0005, 0xa864,
+	0x8007, 0x9084, 0x00ff, 0x0d08, 0x8001, 0x1120, 0x7007, 0x0001,
+	0x0804, 0x7591, 0x7007, 0x0003, 0x7012, 0x2900, 0x7016, 0x701a,
+	0x704b, 0x7591, 0x0005, 0xa864, 0x8007, 0x9084, 0x00ff, 0x0968,
+	0x8001, 0x1120, 0x7007, 0x0001, 0x0804, 0x75ac, 0x7007, 0x0003,
+	0x7012, 0x2900, 0x7016, 0x701a, 0x704b, 0x75ac, 0x0005, 0xa864,
+	0x8007, 0x9084, 0x00ff, 0x9086, 0x0001, 0x1904, 0x73e5, 0x7007,
+	0x0001, 0x2009, 0x1833, 0x210c, 0x81ff, 0x1904, 0x7489, 0xa994,
+	0x9186, 0x006f, 0x0188, 0x9186, 0x0074, 0x15b0, 0x0026, 0x2011,
+	0x0010, 0x080c, 0x658f, 0x002e, 0x0578, 0x0016, 0xa998, 0x080c,
+	0x65d9, 0x001e, 0x1548, 0x0400, 0x080c, 0x6f9b, 0x0140, 0xa897,
+	0x4005, 0xa89b, 0x0016, 0x2001, 0x0030, 0x900e, 0x0438, 0x0026,
+	0x2011, 0x8008, 0x080c, 0x658f, 0x002e, 0x01b0, 0x0016, 0x0026,
+	0x0036, 0xa998, 0xaaa0, 0xab9c, 0x918d, 0x8000, 0x080c, 0x65d9,
+	0x003e, 0x002e, 0x001e, 0x1140, 0xa897, 0x4005, 0xa89b, 0x4009,
+	0x2001, 0x0030, 0x900e, 0x0050, 0xa868, 0x9084, 0x00ff, 0xa86a,
+	0xa883, 0x0000, 0x080c, 0x5f09, 0x1108, 0x0005, 0x0126, 0x2091,
+	0x8000, 0xa867, 0x0139, 0xa87a, 0xa982, 0x080c, 0x6891, 0x012e,
+	0x0ca0, 0xa994, 0x9186, 0x0071, 0x0904, 0x7437, 0x9186, 0x0064,
+	0x0904, 0x7437, 0x9186, 0x007c, 0x0904, 0x7437, 0x9186, 0x0028,
+	0x0904, 0x7437, 0x9186, 0x0038, 0x0904, 0x7437, 0x9186, 0x0078,
+	0x0904, 0x7437, 0x9186, 0x005f, 0x0904, 0x7437, 0x9186, 0x0056,
+	0x0904, 0x7437, 0xa897, 0x4005, 0xa89b, 0x0001, 0x2001, 0x0030,
+	0x900e, 0x0860, 0xa87c, 0x9084, 0x00c0, 0x9086, 0x00c0, 0x1120,
+	0x7007, 0x0001, 0x0804, 0x77a1, 0x2900, 0x7016, 0x701a, 0x20a9,
+	0x0004, 0xa860, 0x20e0, 0xa85c, 0x9080, 0x0030, 0x2098, 0x7050,
+	0x2040, 0xa060, 0x20e8, 0xa05c, 0x9080, 0x0023, 0x20a0, 0x4003,
+	0xa888, 0x7012, 0x9082, 0x0401, 0x1a04, 0x73ed, 0xaab4, 0x928a,
+	0x0002, 0x1a04, 0x73ed, 0x82ff, 0x1138, 0xa8b8, 0xa9bc, 0x9105,
+	0x0118, 0x2001, 0x754f, 0x0018, 0x9280, 0x7545, 0x2005, 0x7056,
+	0x7010, 0x9015, 0x0904, 0x7530, 0x080c, 0x1004, 0x1118, 0x7007,
+	0x0004, 0x0005, 0x2900, 0x7022, 0x7054, 0x2060, 0xe000, 0xa866,
+	0x7050, 0x2040, 0xa95c, 0xe004, 0x9100, 0xa076, 0xa860, 0xa072,
+	0xe008, 0x920a, 0x1210, 0x900e, 0x2200, 0x7112, 0xe20c, 0x8003,
+	0x800b, 0x9296, 0x0004, 0x0108, 0x9108, 0xa17a, 0x810b, 0xa17e,
+	0x080c, 0x10d5, 0xa06c, 0x908e, 0x0100, 0x0170, 0x9086, 0x0200,
+	0x0118, 0x7007, 0x0007, 0x0005, 0x7020, 0x2048, 0x080c, 0x101d,
+	0x7014, 0x2048, 0x0804, 0x73ed, 0x7020, 0x2048, 0x7018, 0xa802,
+	0xa807, 0x0000, 0x2908, 0x2048, 0xa906, 0x711a, 0x0804, 0x74e8,
+	0x7014, 0x2048, 0x7007, 0x0001, 0xa8b4, 0x9005, 0x1128, 0xa8b8,
+	0xa9bc, 0x9105, 0x0108, 0x00b9, 0xa864, 0x9084, 0x00ff, 0x9086,
+	0x001e, 0x0904, 0x77a1, 0x0804, 0x7591, 0x7547, 0x754b, 0x0002,
+	0x001d, 0x0007, 0x0004, 0x000a, 0x001b, 0x0005, 0x0006, 0x000a,
+	0x001d, 0x0005, 0x0004, 0x0076, 0x0066, 0xafb8, 0xaebc, 0xa804,
+	0x2050, 0xb0c0, 0xb0e2, 0xb0bc, 0xb0de, 0xb0b8, 0xb0d2, 0xb0b4,
+	0xb0ce, 0xb6da, 0xb7d6, 0xb0b0, 0xb0ca, 0xb0ac, 0xb0c6, 0xb0a8,
+	0xb0ba, 0xb0a4, 0xb0b6, 0xb6c2, 0xb7be, 0xb0a0, 0xb0b2, 0xb09c,
+	0xb0ae, 0xb098, 0xb0a2, 0xb094, 0xb09e, 0xb6aa, 0xb7a6, 0xb090,
+	0xb09a, 0xb08c, 0xb096, 0xb088, 0xb08a, 0xb084, 0xb086, 0xb692,
+	0xb78e, 0xb080, 0xb082, 0xb07c, 0xb07e, 0xb078, 0xb072, 0xb074,
+	0xb06e, 0xb67a, 0xb776, 0xb004, 0x9055, 0x1958, 0x006e, 0x007e,
+	0x0005, 0x2009, 0x1833, 0x210c, 0x81ff, 0x1178, 0x080c, 0x5d56,
+	0x1108, 0x0005, 0x080c, 0x6abf, 0x0126, 0x2091, 0x8000, 0x080c,
+	0xbe20, 0x080c, 0x6891, 0x012e, 0x0ca0, 0x080c, 0xc225, 0x1d70,
+	0x2001, 0x0028, 0x900e, 0x0c70, 0x2009, 0x1833, 0x210c, 0x81ff,
+	0x11d8, 0xa888, 0x9005, 0x01e0, 0xa883, 0x0000, 0xa87c, 0xd0f4,
+	0x0120, 0x080c, 0x5e6b, 0x1138, 0x0005, 0x9006, 0xa87a, 0x080c,
+	0x5de6, 0x1108, 0x0005, 0x0126, 0x2091, 0x8000, 0xa87a, 0xa982,
+	0x080c, 0x6891, 0x012e, 0x0cb0, 0x2001, 0x0028, 0x900e, 0x0c98,
+	0x2001, 0x0000, 0x0c80, 0x7018, 0xa802, 0x2908, 0x2048, 0xa906,
+	0x711a, 0x7010, 0x8001, 0x7012, 0x0118, 0x7007, 0x0003, 0x0030,
+	0x7014, 0x2048, 0x7007, 0x0001, 0x7048, 0x080f, 0x0005, 0x00b6,
+	0x7007, 0x0001, 0xa974, 0xa878, 0x9084, 0x00ff, 0x9096, 0x0004,
+	0x0540, 0x20a9, 0x0001, 0x9096, 0x0001, 0x0190, 0x900e, 0x20a9,
+	0x0800, 0x9096, 0x0002, 0x0160, 0x9005, 0x11d8, 0xa974, 0x080c,
+	0x6247, 0x11b8, 0x0066, 0xae80, 0x080c, 0x6357, 0x006e, 0x0088,
+	0x0046, 0x2011, 0x180c, 0x2224, 0xc484, 0x2412, 0x004e, 0x00c6,
+	0x080c, 0x6247, 0x1110, 0x080c, 0x6457, 0x8108, 0x1f04, 0x7610,
+	0x00ce, 0xa87c, 0xd084, 0x1120, 0x080c, 0x101d, 0x00be, 0x0005,
+	0x0126, 0x2091, 0x8000, 0x080c, 0x6891, 0x012e, 0x00be, 0x0005,
+	0x0126, 0x2091, 0x8000, 0x7007, 0x0001, 0x080c, 0x6567, 0x0580,
+	0x2061, 0x1a40, 0x6100, 0xd184, 0x0178, 0xa888, 0x9084, 0x00ff,
+	0x1550, 0x6000, 0xd084, 0x0520, 0x6004, 0x9005, 0x1538, 0x6003,
+	0x0000, 0x600b, 0x0000, 0x00c8, 0x2011, 0x0001, 0xa890, 0x9005,
+	0x1110, 0x2001, 0x001e, 0x8000, 0x6016, 0xa888, 0x9084, 0x00ff,
+	0x0178, 0x6006, 0xa888, 0x8007, 0x9084, 0x00ff, 0x0148, 0x600a,
+	0xa888, 0x8000, 0x1108, 0xc28d, 0x6202, 0x012e, 0x0804, 0x786a,
+	0x012e, 0x0804, 0x7864, 0x012e, 0x0804, 0x785e, 0x012e, 0x0804,
+	0x7861, 0x0126, 0x2091, 0x8000, 0x7007, 0x0001, 0x080c, 0x6567,
+	0x05e0, 0x2061, 0x1a40, 0x6000, 0xd084, 0x05b8, 0x6204, 0x6308,
+	0xd08c, 0x1530, 0xac78, 0x9484, 0x0003, 0x0170, 0xa988, 0x918c,
+	0x00ff, 0x8001, 0x1120, 0x2100, 0x9210, 0x0620, 0x0028, 0x8001,
+	0x1508, 0x2100, 0x9212, 0x02f0, 0x9484, 0x000c, 0x0188, 0xa988,
+	0x810f, 0x918c, 0x00ff, 0x9082, 0x0004, 0x1120, 0x2100, 0x9318,
+	0x0288, 0x0030, 0x9082, 0x0004, 0x1168, 0x2100, 0x931a, 0x0250,
+	0xa890, 0x9005, 0x0110, 0x8000, 0x6016, 0x6206, 0x630a, 0x012e,
+	0x0804, 0x786a, 0x012e, 0x0804, 0x7867, 0x012e, 0x0804, 0x7864,
+	0x0126, 0x2091, 0x8000, 0x7007, 0x0001, 0x2061, 0x1a40, 0x6300,
+	0xd38c, 0x1120, 0x6308, 0x8318, 0x0220, 0x630a, 0x012e, 0x0804,
+	0x7878, 0x012e, 0x0804, 0x7867, 0x00b6, 0x0126, 0x00c6, 0x2091,
+	0x8000, 0x7007, 0x0001, 0xa87c, 0xd0ac, 0x0148, 0x00c6, 0x2061,
+	0x1a40, 0x6000, 0x9084, 0xfcff, 0x6002, 0x00ce, 0x0440, 0xa888,
+	0x9005, 0x05d8, 0xa88c, 0x9065, 0x0598, 0x2001, 0x1833, 0x2004,
+	0x9005, 0x0118, 0x080c, 0x9e72, 0x0068, 0x6017, 0xf400, 0x605b,
+	0x0000, 0xa97c, 0xd1a4, 0x0110, 0xa980, 0x615a, 0x2009, 0x0041,
+	0x080c, 0x9ebc, 0xa988, 0x918c, 0xff00, 0x9186, 0x2000, 0x1138,
+	0x0026, 0x900e, 0x2011, 0xfdff, 0x080c, 0x8218, 0x002e, 0xa87c,
+	0xd0c4, 0x0148, 0x2061, 0x1a40, 0x6000, 0xd08c, 0x1120, 0x6008,
+	0x8000, 0x0208, 0x600a, 0x00ce, 0x012e, 0x00be, 0x0804, 0x786a,
+	0x00ce, 0x012e, 0x00be, 0x0804, 0x7864, 0xa984, 0x9186, 0x002e,
+	0x0d30, 0x9186, 0x002d, 0x0d18, 0x9186, 0x0045, 0x0510, 0x9186,
+	0x002a, 0x1130, 0x2001, 0x180c, 0x200c, 0xc194, 0x2102, 0x08b8,
+	0x9186, 0x0020, 0x0158, 0x9186, 0x0029, 0x1d10, 0xa974, 0x080c,
+	0x6247, 0x1968, 0xb800, 0xc0e4, 0xb802, 0x0848, 0xa88c, 0x9065,
+	0x09b8, 0x6007, 0x0024, 0x2001, 0x1956, 0x2004, 0x601a, 0x0804,
+	0x76ff, 0xa88c, 0x9065, 0x0960, 0x00e6, 0xa890, 0x9075, 0x2001,
+	0x1833, 0x2004, 0x9005, 0x0150, 0x080c, 0x9e72, 0x8eff, 0x0118,
+	0x2e60, 0x080c, 0x9e72, 0x00ee, 0x0804, 0x76ff, 0x6024, 0xc0dc,
+	0xc0d5, 0x6026, 0x2e60, 0x6007, 0x003a, 0xa8a0, 0x9005, 0x0130,
+	0x6007, 0x003b, 0xa8a4, 0x602e, 0xa8a8, 0x6016, 0x6003, 0x0001,
+	0x080c, 0x83da, 0x080c, 0x896d, 0x00ee, 0x0804, 0x76ff, 0x2061,
+	0x1a40, 0x6000, 0xd084, 0x0190, 0xd08c, 0x1904, 0x7878, 0x0126,
+	0x2091, 0x8000, 0x6204, 0x8210, 0x0220, 0x6206, 0x012e, 0x0804,
+	0x7878, 0x012e, 0xa883, 0x0016, 0x0804, 0x7871, 0xa883, 0x0007,
+	0x0804, 0x7871, 0xa864, 0x8007, 0x9084, 0x00ff, 0x0130, 0x8001,
+	0x1138, 0x7007, 0x0001, 0x0069, 0x0005, 0x080c, 0x73e5, 0x0040,
+	0x7007, 0x0003, 0x7012, 0x2900, 0x7016, 0x701a, 0x704b, 0x77a1,
+	0x0005, 0x00b6, 0x00e6, 0x0126, 0x2091, 0x8000, 0x903e, 0x2061,
+	0x1800, 0x61cc, 0x81ff, 0x1904, 0x7823, 0x6130, 0xd194, 0x1904,
+	0x784d, 0xa878, 0x2070, 0x9e82, 0x1cd0, 0x0a04, 0x7817, 0x6064,
+	0x9e02, 0x1a04, 0x7817, 0x7120, 0x9186, 0x0006, 0x1904, 0x7809,
+	0x7010, 0x905d, 0x0904, 0x7823, 0xb800, 0xd0e4, 0x1904, 0x7847,
+	0x2061, 0x1a40, 0x6100, 0x9184, 0x0301, 0x9086, 0x0001, 0x15a0,
+	0x7024, 0xd0dc, 0x1904, 0x7850, 0xa883, 0x0000, 0xa803, 0x0000,
+	0x2908, 0x7014, 0x9005, 0x1198, 0x7116, 0xa87c, 0xd0f4, 0x1904,
+	0x7853, 0x080c, 0x538f, 0xd09c, 0x1118, 0xa87c, 0xc0cc, 0xa87e,
+	0x2e60, 0x080c, 0x8138, 0x012e, 0x00ee, 0x00be, 0x0005, 0x2048,
+	0xa800, 0x9005, 0x1de0, 0xa902, 0x2148, 0xa87c, 0xd0f4, 0x1904,
+	0x7853, 0x012e, 0x00ee, 0x00be, 0x0005, 0x012e, 0x00ee, 0xa883,
+	0x0006, 0x00be, 0x0804, 0x7871, 0xd184, 0x0db8, 0xd1c4, 0x1190,
+	0x00a0, 0xa974, 0x080c, 0x6247, 0x15d0, 0xb800, 0xd0e4, 0x15b8,
+	0x7120, 0x9186, 0x0007, 0x1118, 0xa883, 0x0002, 0x0490, 0xa883,
+	0x0008, 0x0478, 0xa883, 0x000e, 0x0460, 0xa883, 0x0017, 0x0448,
+	0xa883, 0x0035, 0x0430, 0x080c, 0x5393, 0xd0fc, 0x01e8, 0xa878,
+	0x2070, 0x9e82, 0x1cd0, 0x02c0, 0x6064, 0x9e02, 0x12a8, 0x7120,
+	0x9186, 0x0006, 0x1188, 0x7010, 0x905d, 0x0170, 0xb800, 0xd0bc,
+	0x0158, 0x2039, 0x0001, 0x7000, 0x9086, 0x0007, 0x1904, 0x77ad,
+	0x7003, 0x0002, 0x0804, 0x77ad, 0xa883, 0x0028, 0x0010, 0xa883,
+	0x0029, 0x012e, 0x00ee, 0x00be, 0x0420, 0xa883, 0x002a, 0x0cc8,
+	0xa883, 0x0045, 0x0cb0, 0x2e60, 0x2019, 0x0002, 0x601b, 0x0014,
+	0x080c, 0xd106, 0x012e, 0x00ee, 0x00be, 0x0005, 0x2009, 0x003e,
+	0x0058, 0x2009, 0x0004, 0x0040, 0x2009, 0x0006, 0x0028, 0x2009,
+	0x0016, 0x0010, 0x2009, 0x0001, 0xa884, 0x9084, 0xff00, 0x9105,
+	0xa886, 0x0126, 0x2091, 0x8000, 0x080c, 0x6891, 0x012e, 0x0005,
+	0x080c, 0x101d, 0x0005, 0x00d6, 0x080c, 0x812f, 0x00de, 0x0005,
+	0x00d6, 0x00e6, 0x0126, 0x2091, 0x8000, 0x2071, 0x0040, 0x702c,
+	0xd084, 0x01d8, 0x908c, 0x0780, 0x190c, 0x790c, 0xd09c, 0x11a8,
+	0x2071, 0x1800, 0x70bc, 0x90ea, 0x0040, 0x0278, 0x8001, 0x70be,
+	0x702c, 0x2048, 0xa800, 0x702e, 0x9006, 0xa802, 0xa806, 0x2071,
+	0x0040, 0x2900, 0x7022, 0x702c, 0x0c28, 0x012e, 0x00ee, 0x00de,
+	0x0005, 0x0006, 0x9084, 0x0780, 0x190c, 0x790c, 0x000e, 0x0005,
+	0x00d6, 0x00c6, 0x0036, 0x0026, 0x0016, 0x00b6, 0x7007, 0x0001,
+	0xaa74, 0x9282, 0x0004, 0x1a04, 0x78fd, 0xa97c, 0x9188, 0x1000,
+	0x2104, 0x905d, 0xb804, 0xd284, 0x0140, 0x05e8, 0x8007, 0x9084,
+	0x00ff, 0x9084, 0x0006, 0x1108, 0x04b0, 0x2b10, 0x080c, 0x9dec,
+	0x1118, 0x080c, 0x9e8f, 0x05a8, 0x6212, 0xa874, 0x0002, 0x78db,
+	0x78e0, 0x78e3, 0x78e9, 0x2019, 0x0002, 0x080c, 0xd4c7, 0x0060,
+	0x080c, 0xd463, 0x0048, 0x2019, 0x0002, 0xa980, 0x080c, 0xd47e,
+	0x0018, 0xa980, 0x080c, 0xd463, 0x080c, 0x9e42, 0xa887, 0x0000,
+	0x0126, 0x2091, 0x8000, 0x080c, 0x6891, 0x012e, 0x00be, 0x001e,
+	0x002e, 0x003e, 0x00ce, 0x00de, 0x0005, 0xa887, 0x0006, 0x0c80,
+	0xa887, 0x0002, 0x0c68, 0xa887, 0x0005, 0x0c50, 0xa887, 0x0004,
+	0x0c38, 0xa887, 0x0007, 0x0c20, 0x2091, 0x8000, 0x0e04, 0x790e,
+	0x0006, 0x0016, 0x2001, 0x8003, 0x0006, 0x0804, 0x0dbd, 0x2001,
+	0x1833, 0x2004, 0x9005, 0x0005, 0x0005, 0x00f6, 0x2079, 0x0300,
+	0x2001, 0x0200, 0x200c, 0xc1e5, 0xc1dc, 0x2102, 0x2009, 0x0218,
+	0x210c, 0xd1ec, 0x1120, 0x080c, 0x14a9, 0x00fe, 0x0005, 0x2001,
+	0x020d, 0x2003, 0x0020, 0x781f, 0x0300, 0x00fe, 0x0005, 0x781c,
+	0xd08c, 0x0904, 0x798e, 0x68bc, 0x90aa, 0x0005, 0x0a04, 0x7f3d,
+	0x7d44, 0x7c40, 0x9584, 0x00f6, 0x1510, 0x9484, 0x7000, 0x0140,
+	0x908a, 0x2000, 0x1260, 0x9584, 0x0700, 0x8007, 0x0804, 0x7995,
+	0x7000, 0x9084, 0xff00, 0x9086, 0x8100, 0x0da8, 0x00b0, 0x9484,
+	0x0fff, 0x1130, 0x7000, 0x9084, 0xff00, 0x9086, 0x8100, 0x11c0,
+	0x080c, 0xd8ad, 0x080c, 0x7e82, 0x7817, 0x0140, 0x00a8, 0x9584,
+	0x0076, 0x1118, 0x080c, 0x7ee0, 0x19c0, 0xd5a4, 0x0148, 0x0046,
+	0x0056, 0x080c, 0x79f0, 0x080c, 0x21cf, 0x005e, 0x004e, 0x0020,
+	0x080c, 0xd8ad, 0x7817, 0x0140, 0x080c, 0x6f9b, 0x0168, 0x2001,
+	0x0111, 0x2004, 0xd08c, 0x0140, 0x688f, 0x0000, 0x2001, 0x0110,
+	0x2003, 0x0008, 0x2003, 0x0000, 0x080c, 0x79d1, 0x2001, 0x19c0,
+	0x2004, 0x9005, 0x090c, 0x896d, 0x0005, 0x0002, 0x79a7, 0x7ca4,
+	0x799e, 0x799e, 0x799e, 0x799e, 0x799e, 0x799e, 0x7817, 0x0140,
+	0x2001, 0x19c0, 0x2004, 0x9005, 0x090c, 0x896d, 0x0005, 0x7000,
+	0x908c, 0xff00, 0x9194, 0xf000, 0x810f, 0x9484, 0x0fff, 0x688e,
+	0x9286, 0x2000, 0x1150, 0x6800, 0x9086, 0x0001, 0x1118, 0x080c,
+	0x53f0, 0x0070, 0x080c, 0x7a10, 0x0058, 0x9286, 0x3000, 0x1118,
+	0x080c, 0x7bdf, 0x0028, 0x9286, 0x8000, 0x1110, 0x080c, 0x7db2,
+	0x7817, 0x0140, 0x2001, 0x19c0, 0x2004, 0x9005, 0x090c, 0x896d,
+	0x0005, 0x2001, 0x1810, 0x2004, 0xd08c, 0x0178, 0x2001, 0x1800,
+	0x2004, 0x9086, 0x0003, 0x1148, 0x0026, 0x0036, 0x2011, 0x8048,
+	0x2518, 0x080c, 0x48e9, 0x003e, 0x002e, 0x0005, 0x0036, 0x0046,
+	0x0056, 0x00f6, 0x2079, 0x0200, 0x2019, 0xfffe, 0x7c30, 0x0050,
+	0x0036, 0x0046, 0x0056, 0x00f6, 0x2079, 0x0200, 0x7d44, 0x7c40,
+	0x2019, 0xffff, 0x2001, 0x1810, 0x2004, 0xd08c, 0x0160, 0x2001,
+	0x1800, 0x2004, 0x9086, 0x0003, 0x1130, 0x0026, 0x2011, 0x8048,
+	0x080c, 0x48e9, 0x002e, 0x00fe, 0x005e, 0x004e, 0x003e, 0x0005,
+	0x00b6, 0x00c6, 0x7010, 0x9084, 0xff00, 0x8007, 0x9096, 0x0001,
+	0x0120, 0x9096, 0x0023, 0x1904, 0x7bb0, 0x9186, 0x0023, 0x15c0,
+	0x080c, 0x7e47, 0x0904, 0x7bb0, 0x6120, 0x9186, 0x0001, 0x0150,
+	0x9186, 0x0004, 0x0138, 0x9186, 0x0008, 0x0120, 0x9186, 0x000a,
+	0x1904, 0x7bb0, 0x7124, 0x610a, 0x7030, 0x908e, 0x0200, 0x1130,
+	0x2009, 0x0015, 0x080c, 0x9ebc, 0x0804, 0x7bb0, 0x908e, 0x0214,
+	0x0118, 0x908e, 0x0210, 0x1130, 0x2009, 0x0015, 0x080c, 0x9ebc,
+	0x0804, 0x7bb0, 0x908e, 0x0100, 0x1904, 0x7bb0, 0x7034, 0x9005,
+	0x1904, 0x7bb0, 0x2009, 0x0016, 0x080c, 0x9ebc, 0x0804, 0x7bb0,
+	0x9186, 0x0022, 0x1904, 0x7bb0, 0x7030, 0x908e, 0x0300, 0x1580,
+	0x68d8, 0xd0a4, 0x0528, 0xc0b5, 0x68da, 0x7100, 0x918c, 0x00ff,
+	0x697a, 0x7004, 0x687e, 0x00f6, 0x2079, 0x0100, 0x79e6, 0x78ea,
+	0x0006, 0x9084, 0x00ff, 0x0016, 0x2008, 0x080c, 0x26ae, 0x7932,
+	0x7936, 0x001e, 0x000e, 0x00fe, 0x080c, 0x2665, 0x695a, 0x703c,
+	0x00e6, 0x2071, 0x0140, 0x7086, 0x2071, 0x1800, 0x70b2, 0x00ee,
+	0x7034, 0x9005, 0x1904, 0x7bb0, 0x2009, 0x0017, 0x0804, 0x7b60,
+	0x908e, 0x0400, 0x1190, 0x7034, 0x9005, 0x1904, 0x7bb0, 0x080c,
+	0x6f9b, 0x0120, 0x2009, 0x001d, 0x0804, 0x7b60, 0x68d8, 0xc0a5,
+	0x68da, 0x2009, 0x0030, 0x0804, 0x7b60, 0x908e, 0x0500, 0x1140,
+	0x7034, 0x9005, 0x1904, 0x7bb0, 0x2009, 0x0018, 0x0804, 0x7b60,
+	0x908e, 0x2010, 0x1120, 0x2009, 0x0019, 0x0804, 0x7b60, 0x908e,
+	0x2110, 0x1120, 0x2009, 0x001a, 0x0804, 0x7b60, 0x908e, 0x5200,
+	0x1140, 0x7034, 0x9005, 0x1904, 0x7bb0, 0x2009, 0x001b, 0x0804,
+	0x7b60, 0x908e, 0x5000, 0x1140, 0x7034, 0x9005, 0x1904, 0x7bb0,
+	0x2009, 0x001c, 0x0804, 0x7b60, 0x908e, 0x1300, 0x1120, 0x2009,
+	0x0034, 0x0804, 0x7b60, 0x908e, 0x1200, 0x1140, 0x7034, 0x9005,
+	0x1904, 0x7bb0, 0x2009, 0x0024, 0x0804, 0x7b60, 0x908c, 0xff00,
+	0x918e, 0x2400, 0x1170, 0x2009, 0x002d, 0x2001, 0x1810, 0x2004,
+	0xd09c, 0x0904, 0x7b60, 0x080c, 0xc8d7, 0x1904, 0x7bb0, 0x0804,
+	0x7b5e, 0x908c, 0xff00, 0x918e, 0x5300, 0x1120, 0x2009, 0x002a,
+	0x0804, 0x7b60, 0x908e, 0x0f00, 0x1120, 0x2009, 0x0020, 0x0804,
+	0x7b60, 0x908e, 0x6104, 0x1528, 0x2029, 0x0205, 0x2011, 0x026d,
+	0x8208, 0x2204, 0x9082, 0x0004, 0x8004, 0x8004, 0x20a8, 0x2011,
+	0x8015, 0x211c, 0x8108, 0x0046, 0x2124, 0x080c, 0x48e9, 0x004e,
+	0x8108, 0x0f04, 0x7b2c, 0x9186, 0x0280, 0x1d88, 0x2504, 0x8000,
+	0x202a, 0x2009, 0x0260, 0x0c58, 0x202b, 0x0000, 0x2009, 0x0023,
+	0x0478, 0x908e, 0x6000, 0x1118, 0x2009, 0x003f, 0x0448, 0x908e,
+	0x7800, 0x1118, 0x2009, 0x0045, 0x0418, 0x908e, 0x1000, 0x1118,
+	0x2009, 0x004e, 0x00e8, 0x908e, 0x6300, 0x1118, 0x2009, 0x004a,
+	0x00b8, 0x908c, 0xff00, 0x918e, 0x5600, 0x1118, 0x2009, 0x004f,
+	0x0078, 0x908c, 0xff00, 0x918e, 0x5700, 0x1118, 0x2009, 0x0050,
+	0x0038, 0x2009, 0x001d, 0x6838, 0xd0d4, 0x0110, 0x2009, 0x004c,
+	0x0016, 0x2011, 0x0263, 0x2204, 0x8211, 0x220c, 0x080c, 0x2665,
+	0x1904, 0x7bb3, 0x080c, 0x61e7, 0x1904, 0x7bb3, 0xbe12, 0xbd16,
+	0x001e, 0x0016, 0x080c, 0x6f9b, 0x01c0, 0x68d8, 0xd08c, 0x1148,
+	0x7000, 0x9084, 0x00ff, 0x1188, 0x7004, 0x9084, 0xff00, 0x1168,
+	0x0040, 0x6878, 0x9606, 0x1148, 0x687c, 0x9506, 0x9084, 0xff00,
+	0x1120, 0x9584, 0x00ff, 0xb8b2, 0x0080, 0xb8b0, 0x9005, 0x1168,
+	0x9186, 0x0046, 0x1150, 0x6878, 0x9606, 0x1138, 0x687c, 0x9506,
+	0x9084, 0xff00, 0x1110, 0x001e, 0x0098, 0x080c, 0x9dec, 0x01a8,
+	0x2b08, 0x6112, 0x6023, 0x0004, 0x7120, 0x610a, 0x001e, 0x9186,
+	0x004c, 0x1110, 0x6023, 0x000a, 0x0016, 0x001e, 0x080c, 0x9ebc,
+	0x00ce, 0x00be, 0x0005, 0x001e, 0x0cd8, 0x2001, 0x180e, 0x2004,
+	0xd0ec, 0x0120, 0x2011, 0x8049, 0x080c, 0x48e9, 0x080c, 0x9e8f,
+	0x0d90, 0x2b08, 0x6112, 0x6023, 0x0004, 0x7120, 0x610a, 0x001e,
+	0x0016, 0x9186, 0x0017, 0x0118, 0x9186, 0x0030, 0x1128, 0x6007,
+	0x0009, 0x6017, 0x2900, 0x0020, 0x6007, 0x0051, 0x6017, 0x0000,
+	0x602f, 0x0009, 0x6003, 0x0001, 0x080c, 0x8422, 0x08a0, 0x080c,
+	0x30ff, 0x1140, 0x7010, 0x9084, 0xff00, 0x8007, 0x908e, 0x0008,
+	0x1108, 0x0009, 0x0005, 0x00b6, 0x00c6, 0x0046, 0x7000, 0x908c,
+	0xff00, 0x810f, 0x9186, 0x0033, 0x11e8, 0x080c, 0x7e47, 0x0904,
+	0x7c3c, 0x7124, 0x610a, 0x7030, 0x908e, 0x0200, 0x1140, 0x7034,
+	0x9005, 0x15d0, 0x2009, 0x0015, 0x080c, 0x9ebc, 0x04a8, 0x908e,
+	0x0100, 0x1590, 0x7034, 0x9005, 0x1578, 0x2009, 0x0016, 0x080c,
+	0x9ebc, 0x0450, 0x9186, 0x0032, 0x1538, 0x7030, 0x908e, 0x1400,
+	0x1518, 0x2009, 0x0038, 0x0016, 0x2011, 0x0263, 0x2204, 0x8211,
+	0x220c, 0x080c, 0x2665, 0x11b8, 0x080c, 0x61e7, 0x11a0, 0xbe12,
+	0xbd16, 0x080c, 0x9dec, 0x0178, 0x2b08, 0x6112, 0x080c, 0xbfa6,
+	0x6023, 0x0004, 0x7120, 0x610a, 0x001e, 0x080c, 0x9ebc, 0x080c,
+	0x896d, 0x0010, 0x00ce, 0x001e, 0x004e, 0x00ce, 0x00be, 0x0005,
+	0x00b6, 0x0046, 0x00e6, 0x00d6, 0x2028, 0x2130, 0x9696, 0x00ff,
+	0x11b8, 0x9592, 0xfffc, 0x02a0, 0x9596, 0xfffd, 0x1120, 0x2009,
+	0x007f, 0x0804, 0x7c9e, 0x9596, 0xfffe, 0x1120, 0x2009, 0x007e,
+	0x0804, 0x7c9e, 0x9596, 0xfffc, 0x1118, 0x2009, 0x0080, 0x04f0,
+	0x2011, 0x0000, 0x2019, 0x1836, 0x231c, 0xd3ac, 0x0130, 0x9026,
+	0x20a9, 0x0800, 0x2071, 0x1000, 0x0030, 0x2021, 0x0081, 0x20a9,
+	0x077f, 0x2071, 0x1081, 0x2e1c, 0x93dd, 0x0000, 0x1140, 0x82ff,
+	0x11d0, 0x9496, 0x00ff, 0x01b8, 0x2410, 0xc2fd, 0x00a0, 0xbf10,
+	0x2600, 0x9706, 0xb814, 0x1120, 0x9546, 0x1110, 0x2408, 0x00b0,
+	0x9745, 0x1148, 0x94c6, 0x007e, 0x0130, 0x94c6, 0x007f, 0x0118,
+	0x94c6, 0x0080, 0x1d20, 0x8420, 0x8e70, 0x1f04, 0x7c73, 0x82ff,
+	0x1118, 0x9085, 0x0001, 0x0018, 0xc2fc, 0x2208, 0x9006, 0x00de,
+	0x00ee, 0x004e, 0x00be, 0x0005, 0x7000, 0x908c, 0xff00, 0x810f,
+	0x9184, 0x000f, 0x0002, 0x7cbb, 0x7cbb, 0x7cbb, 0x7e59, 0x7cbb,
+	0x7cc4, 0x7cef, 0x7d7d, 0x7cbb, 0x7cbb, 0x7cbb, 0x7cbb, 0x7cbb,
+	0x7cbb, 0x7cbb, 0x7cbb, 0x7817, 0x0140, 0x2001, 0x19c0, 0x2004,
+	0x9005, 0x090c, 0x896d, 0x0005, 0x00b6, 0x7110, 0xd1bc, 0x01e8,
+	0x7120, 0x2160, 0x9c8c, 0x0007, 0x11c0, 0x9c8a, 0x1cd0, 0x02a8,
 	0x6864, 0x9c02, 0x1290, 0x7008, 0x9084, 0x00ff, 0x6110, 0x2158,
 	0xb910, 0x9106, 0x1150, 0x700c, 0xb914, 0x9106, 0x1130, 0x7124,
-	0x610a, 0x2009, 0x0045, 0x080c, 0x9eac, 0x7817, 0x0140, 0x2001,
-	0x19c1, 0x2004, 0x9005, 0x090c, 0x8973, 0x00be, 0x0005, 0x6120,
-	0x9186, 0x0002, 0x0128, 0x9186, 0x0005, 0x0110, 0x9085, 0x0001,
-	0x0005, 0x080c, 0x30fd, 0x1168, 0x7010, 0x9084, 0xff00, 0x8007,
-	0x9086, 0x0000, 0x1130, 0x9184, 0x000f, 0x908a, 0x0006, 0x1208,
-	0x000b, 0x0005, 0x7de0, 0x7de1, 0x7de0, 0x7de0, 0x7e40, 0x7e4f,
-	0x0005, 0x00b6, 0x7110, 0xd1bc, 0x0120, 0x702c, 0xd084, 0x0904,
-	0x7e3e, 0x700c, 0x7108, 0x080c, 0x2663, 0x1904, 0x7e3e, 0x080c,
-	0x61de, 0x1904, 0x7e3e, 0xbe12, 0xbd16, 0x7110, 0xd1bc, 0x01d8,
-	0x080c, 0x6562, 0x0118, 0x9086, 0x0004, 0x1588, 0x00c6, 0x080c,
-	0x7e5e, 0x00ce, 0x05d8, 0x080c, 0x9ddc, 0x2b08, 0x05b8, 0x6112,
-	0x080c, 0xbf8c, 0x6023, 0x0002, 0x7120, 0x610a, 0x2009, 0x0088,
-	0x080c, 0x9eac, 0x0458, 0x080c, 0x6562, 0x0148, 0x9086, 0x0004,
-	0x0130, 0x080c, 0x656a, 0x0118, 0x9086, 0x0004, 0x1180, 0x080c,
-	0x9ddc, 0x2b08, 0x01d8, 0x6112, 0x080c, 0xbf8c, 0x6023, 0x0005,
-	0x7120, 0x610a, 0x2009, 0x0088, 0x080c, 0x9eac, 0x0078, 0x080c,
-	0x9ddc, 0x2b08, 0x0158, 0x6112, 0x080c, 0xbf8c, 0x6023, 0x0004,
-	0x7120, 0x610a, 0x2009, 0x0001, 0x080c, 0x9eac, 0x00be, 0x0005,
-	0x7110, 0xd1bc, 0x0158, 0x00d1, 0x0148, 0x080c, 0x7dbf, 0x1130,
-	0x7124, 0x610a, 0x2009, 0x0089, 0x080c, 0x9eac, 0x0005, 0x7110,
-	0xd1bc, 0x0158, 0x0059, 0x0148, 0x080c, 0x7dbf, 0x1130, 0x7124,
-	0x610a, 0x2009, 0x008a, 0x080c, 0x9eac, 0x0005, 0x7020, 0x2060,
-	0x9c84, 0x0007, 0x1158, 0x9c82, 0x1cd0, 0x0240, 0x2001, 0x1819,
-	0x2004, 0x9c02, 0x1218, 0x9085, 0x0001, 0x0005, 0x9006, 0x0ce8,
-	0x00b6, 0x7110, 0xd1bc, 0x11d8, 0x7024, 0x2060, 0x9c84, 0x0007,
-	0x11b0, 0x9c82, 0x1cd0, 0x0298, 0x6864, 0x9c02, 0x1280, 0x7008,
-	0x9084, 0x00ff, 0x6110, 0x2158, 0xb910, 0x9106, 0x1140, 0x700c,
-	0xb914, 0x9106, 0x1120, 0x2009, 0x0051, 0x080c, 0x9eac, 0x7817,
-	0x0140, 0x2001, 0x19c1, 0x2004, 0x9005, 0x090c, 0x8973, 0x00be,
-	0x0005, 0x2031, 0x0105, 0x0069, 0x0005, 0x2031, 0x0206, 0x0049,
-	0x0005, 0x2031, 0x0207, 0x0029, 0x0005, 0x2031, 0x0213, 0x0009,
-	0x0005, 0x00c6, 0x0096, 0x00f6, 0x7000, 0x9084, 0xf000, 0x9086,
-	0xc000, 0x05d0, 0x080c, 0x9ddc, 0x05b8, 0x0066, 0x00c6, 0x0046,
-	0x2011, 0x0263, 0x2204, 0x8211, 0x220c, 0x080c, 0x2663, 0x15a0,
-	0x080c, 0x61de, 0x1588, 0xbe12, 0xbd16, 0x2b00, 0x004e, 0x00ce,
-	0x6012, 0x080c, 0xbf8c, 0x080c, 0x0feb, 0x0510, 0x2900, 0x605a,
-	0x9006, 0xa802, 0xa866, 0xac6a, 0xa85c, 0x90f8, 0x001b, 0x20a9,
-	0x000e, 0xa860, 0x20e8, 0x20e1, 0x0000, 0x2fa0, 0x2e98, 0x4003,
-	0x006e, 0x6616, 0x6007, 0x003e, 0x6023, 0x0001, 0x6003, 0x0001,
-	0x080c, 0x8439, 0x080c, 0x8973, 0x00fe, 0x009e, 0x00ce, 0x0005,
-	0x080c, 0x9e32, 0x006e, 0x0cc0, 0x004e, 0x00ce, 0x0cc8, 0x00c6,
-	0x7000, 0x908c, 0xff00, 0x9184, 0xf000, 0x810f, 0x9086, 0x2000,
-	0x1904, 0x7f4e, 0x9186, 0x0022, 0x15f0, 0x2001, 0x0111, 0x2004,
-	0x9005, 0x1904, 0x7f50, 0x7030, 0x908e, 0x0400, 0x0904, 0x7f50,
-	0x908e, 0x6000, 0x05e8, 0x908e, 0x5400, 0x05d0, 0x908e, 0x0300,
-	0x11d8, 0x2009, 0x1836, 0x210c, 0xd18c, 0x1590, 0xd1a4, 0x1580,
-	0x080c, 0x6520, 0x0558, 0x68ac, 0x9084, 0x00ff, 0x7100, 0x918c,
-	0x00ff, 0x9106, 0x1518, 0x687c, 0x69ac, 0x918c, 0xff00, 0x9105,
-	0x7104, 0x9106, 0x11d8, 0x00e0, 0x2009, 0x0103, 0x210c, 0xd1b4,
-	0x11a8, 0x908e, 0x5200, 0x09e8, 0x908e, 0x0500, 0x09d0, 0x908e,
-	0x5000, 0x09b8, 0x0058, 0x9186, 0x0023, 0x1140, 0x080c, 0x7e5e,
-	0x0128, 0x6004, 0x9086, 0x0002, 0x0118, 0x0000, 0x9006, 0x0010,
-	0x9085, 0x0001, 0x00ce, 0x0005, 0x00f6, 0x2079, 0x0200, 0x7800,
-	0xc0e5, 0xc0cc, 0x7802, 0x00fe, 0x0005, 0x00f6, 0x2079, 0x1800,
-	0x7834, 0xd084, 0x1130, 0x2079, 0x0200, 0x7800, 0x9085, 0x1200,
-	0x7802, 0x00fe, 0x0005, 0x00e6, 0x2071, 0x1800, 0x7034, 0xc084,
-	0x7036, 0x00ee, 0x0005, 0x2071, 0x19cb, 0x7003, 0x0003, 0x700f,
-	0x0361, 0x9006, 0x701a, 0x7072, 0x7012, 0x7017, 0x1cd0, 0x7007,
-	0x0000, 0x7026, 0x702b, 0x93c2, 0x7032, 0x7037, 0x9430, 0x703f,
-	0xffff, 0x7042, 0x7047, 0x5225, 0x704a, 0x705b, 0x80d3, 0x080c,
-	0x1004, 0x090c, 0x0db4, 0x2900, 0x703a, 0xa867, 0x0003, 0xa86f,
-	0x0100, 0xa8ab, 0xdcb0, 0x0005, 0x2071, 0x19cb, 0x1d04, 0x8027,
-	0x2091, 0x6000, 0x700c, 0x8001, 0x700e, 0x1510, 0x2001, 0x1875,
-	0x2004, 0xd0c4, 0x0158, 0x3a00, 0xd08c, 0x1140, 0x20d1, 0x0000,
-	0x20d1, 0x0001, 0x20d1, 0x0000, 0x080c, 0x0db4, 0x700f, 0x0361,
-	0x7007, 0x0001, 0x0126, 0x2091, 0x8000, 0x080c, 0x8118, 0x7040,
-	0x900d, 0x0148, 0x8109, 0x7142, 0x1130, 0x7044, 0x080f, 0x0018,
-	0x0126, 0x2091, 0x8000, 0x7024, 0x900d, 0x0188, 0x7020, 0x8001,
-	0x7022, 0x1168, 0x7023, 0x0009, 0x8109, 0x7126, 0x9186, 0x03e8,
-	0x1110, 0x7028, 0x080f, 0x81ff, 0x1110, 0x7028, 0x080f, 0x7030,
-	0x900d, 0x0180, 0x702c, 0x8001, 0x702e, 0x1160, 0x702f, 0x0009,
-	0x8109, 0x7132, 0x0128, 0x9184, 0x007f, 0x090c, 0x953d, 0x0010,
-	0x7034, 0x080f, 0x703c, 0x9005, 0x0118, 0x0310, 0x8001, 0x703e,
-	0x704c, 0x900d, 0x0168, 0x7048, 0x8001, 0x704a, 0x1148, 0x704b,
-	0x0009, 0x8109, 0x714e, 0x1120, 0x7150, 0x714e, 0x7058, 0x080f,
-	0x7018, 0x900d, 0x01d8, 0x0016, 0x7070, 0x900d, 0x0158, 0x706c,
-	0x8001, 0x706e, 0x1138, 0x706f, 0x0009, 0x8109, 0x7172, 0x1110,
-	0x7074, 0x080f, 0x001e, 0x7008, 0x8001, 0x700a, 0x1138, 0x700b,
-	0x0009, 0x8109, 0x711a, 0x1110, 0x701c, 0x080f, 0x012e, 0x7004,
-	0x0002, 0x804f, 0x8050, 0x806c, 0x00e6, 0x2071, 0x19cb, 0x7018,
-	0x9005, 0x1120, 0x711a, 0x721e, 0x700b, 0x0009, 0x00ee, 0x0005,
-	0x00e6, 0x0006, 0x2071, 0x19cb, 0x701c, 0x9206, 0x1120, 0x701a,
-	0x701e, 0x7072, 0x7076, 0x000e, 0x00ee, 0x0005, 0x00e6, 0x2071,
-	0x19cb, 0xb888, 0x9102, 0x0208, 0xb98a, 0x00ee, 0x0005, 0x0005,
-	0x00b6, 0x7110, 0x080c, 0x623e, 0x1168, 0xb888, 0x8001, 0x0250,
-	0xb88a, 0x1140, 0x0126, 0x2091, 0x8000, 0x0016, 0x080c, 0x8973,
-	0x001e, 0x012e, 0x8108, 0x9182, 0x0800, 0x0218, 0x900e, 0x7007,
-	0x0002, 0x7112, 0x00be, 0x0005, 0x7014, 0x2060, 0x0126, 0x2091,
-	0x8000, 0x6040, 0x9005, 0x0128, 0x8001, 0x6042, 0x1110, 0x080c,
-	0xbe1d, 0x6018, 0x9005, 0x0528, 0x8001, 0x601a, 0x1510, 0x6120,
-	0x9186, 0x0003, 0x0118, 0x9186, 0x0006, 0x11c8, 0x080c, 0xbb17,
-	0x01b0, 0x6014, 0x2048, 0xa884, 0x908a, 0x199a, 0x0280, 0x9082,
-	0x1999, 0xa886, 0x908a, 0x199a, 0x0210, 0x2001, 0x1999, 0x8003,
-	0x800b, 0x810b, 0x9108, 0x611a, 0xa87c, 0xd0e4, 0x0110, 0x080c,
-	0xb815, 0x012e, 0x9c88, 0x0018, 0x7116, 0x2001, 0x1819, 0x2004,
-	0x9102, 0x0220, 0x7017, 0x1cd0, 0x7007, 0x0000, 0x0005, 0x00e6,
-	0x2071, 0x19cb, 0x7027, 0x07d0, 0x7023, 0x0009, 0x00ee, 0x0005,
-	0x2001, 0x19d4, 0x2003, 0x0000, 0x0005, 0x00e6, 0x2071, 0x19cb,
-	0x7132, 0x702f, 0x0009, 0x00ee, 0x0005, 0x2011, 0x19d7, 0x2013,
-	0x0000, 0x0005, 0x00e6, 0x2071, 0x19cb, 0x711a, 0x721e, 0x700b,
-	0x0009, 0x00ee, 0x0005, 0x0086, 0x0026, 0x7054, 0x8000, 0x7056,
-	0x2001, 0x19d9, 0x2044, 0xa06c, 0x9086, 0x0000, 0x0150, 0x7068,
-	0xa09a, 0x7064, 0xa096, 0x7060, 0xa092, 0x705c, 0xa08e, 0x080c,
-	0x10d5, 0x002e, 0x008e, 0x0005, 0x0006, 0x0016, 0x0096, 0x00a6,
-	0x00b6, 0x00c6, 0x00d6, 0x00e6, 0x00f6, 0x0156, 0x080c, 0x7f9c,
-	0x015e, 0x00fe, 0x00ee, 0x00de, 0x00ce, 0x00be, 0x00ae, 0x009e,
-	0x001e, 0x000e, 0x0005, 0x00e6, 0x2071, 0x19cb, 0x7172, 0x7276,
-	0x706f, 0x0009, 0x00ee, 0x0005, 0x00e6, 0x0006, 0x2071, 0x19cb,
-	0x7074, 0x9206, 0x1110, 0x7072, 0x7076, 0x000e, 0x00ee, 0x0005,
-	0x2069, 0x1800, 0x69e4, 0xd1e4, 0x1518, 0x0026, 0xd1ec, 0x0140,
-	0x6a50, 0x6870, 0x9202, 0x0288, 0x8117, 0x9294, 0x00c0, 0x0088,
-	0x9184, 0x0007, 0x01a0, 0x8109, 0x9184, 0x0007, 0x0110, 0x69e6,
-	0x0070, 0x8107, 0x9084, 0x0007, 0x910d, 0x8107, 0x9106, 0x9094,
-	0x00c0, 0x9184, 0xff3f, 0x9205, 0x68e6, 0x080c, 0x0ecb, 0x002e,
-	0x0005, 0x00c6, 0x2061, 0x1a41, 0x00ce, 0x0005, 0x9184, 0x000f,
-	0x8003, 0x8003, 0x8003, 0x9080, 0x1a41, 0x2060, 0x0005, 0xa884,
-	0x908a, 0x199a, 0x1638, 0x9005, 0x1150, 0x00c6, 0x2061, 0x1a41,
-	0x6014, 0x00ce, 0x9005, 0x1130, 0x2001, 0x001e, 0x0018, 0x908e,
-	0xffff, 0x01b0, 0x8003, 0x800b, 0x810b, 0x9108, 0x611a, 0xa87c,
-	0x908c, 0x00c0, 0x918e, 0x00c0, 0x0904, 0x81d9, 0xd0b4, 0x1168,
-	0xd0bc, 0x1904, 0x81b2, 0x2009, 0x0006, 0x080c, 0x8206, 0x0005,
-	0x900e, 0x0c60, 0x2001, 0x1999, 0x08b0, 0xd0fc, 0x0160, 0x908c,
-	0x0003, 0x0120, 0x918e, 0x0003, 0x1904, 0x8200, 0x908c, 0x2020,
-	0x918e, 0x2020, 0x01a8, 0x6024, 0xd0d4, 0x11e8, 0x2009, 0x1875,
-	0x2104, 0xd084, 0x1138, 0x87ff, 0x1120, 0x2009, 0x0043, 0x0804,
-	0x9eac, 0x0005, 0x87ff, 0x1de8, 0x2009, 0x0042, 0x0804, 0x9eac,
-	0x6110, 0x00b6, 0x2158, 0xb900, 0x00be, 0xd1ac, 0x0d20, 0x6024,
-	0xc0cd, 0x6026, 0x0c00, 0xc0d4, 0x6026, 0xa890, 0x602e, 0xa88c,
-	0x6032, 0x08e0, 0xd0fc, 0x0160, 0x908c, 0x0003, 0x0120, 0x918e,
-	0x0003, 0x1904, 0x8200, 0x908c, 0x2020, 0x918e, 0x2020, 0x0170,
-	0x0076, 0x00f6, 0x2c78, 0x080c, 0x1648, 0x00fe, 0x007e, 0x87ff,
-	0x1120, 0x2009, 0x0042, 0x080c, 0x9eac, 0x0005, 0x6110, 0x00b6,
-	0x2158, 0xb900, 0x00be, 0xd1ac, 0x0d58, 0x6124, 0xc1cd, 0x6126,
-	0x0c38, 0xd0fc, 0x0188, 0x908c, 0x2020, 0x918e, 0x2020, 0x01a8,
-	0x9084, 0x0003, 0x908e, 0x0002, 0x0148, 0x87ff, 0x1120, 0x2009,
-	0x0041, 0x080c, 0x9eac, 0x0005, 0x00b9, 0x0ce8, 0x87ff, 0x1dd8,
-	0x2009, 0x0043, 0x080c, 0x9eac, 0x0cb0, 0x6110, 0x00b6, 0x2158,
-	0xb900, 0x00be, 0xd1ac, 0x0d20, 0x6124, 0xc1cd, 0x6126, 0x0c00,
-	0x2009, 0x0004, 0x0019, 0x0005, 0x2009, 0x0001, 0x0096, 0x080c,
-	0xbb17, 0x0518, 0x6014, 0x2048, 0xa982, 0xa800, 0x6016, 0x9186,
-	0x0001, 0x1188, 0xa97c, 0x918c, 0x8100, 0x918e, 0x8100, 0x1158,
-	0x00c6, 0x2061, 0x1a41, 0x6200, 0xd28c, 0x1120, 0x6204, 0x8210,
-	0x0208, 0x6206, 0x00ce, 0x080c, 0x66c6, 0x6014, 0x904d, 0x0076,
-	0x2039, 0x0000, 0x190c, 0x814f, 0x007e, 0x009e, 0x0005, 0x0156,
-	0x00c6, 0x2061, 0x1a41, 0x6000, 0x81ff, 0x0110, 0x9205, 0x0008,
-	0x9204, 0x6002, 0x00ce, 0x015e, 0x0005, 0x6800, 0xd08c, 0x1138,
-	0x6808, 0x9005, 0x0120, 0x8001, 0x680a, 0x9085, 0x0001, 0x0005,
-	0x0126, 0x2091, 0x8000, 0x0036, 0x0046, 0x20a9, 0x0010, 0x9006,
-	0x8004, 0x2019, 0x0100, 0x231c, 0x93a6, 0x0008, 0x1118, 0x8086,
-	0x818e, 0x0020, 0x80f6, 0x3e00, 0x81f6, 0x3e08, 0x1208, 0x9200,
-	0x1f04, 0x8251, 0x93a6, 0x0008, 0x1118, 0x8086, 0x818e, 0x0020,
-	0x80f6, 0x3e00, 0x81f6, 0x3e08, 0x004e, 0x003e, 0x012e, 0x0005,
-	0x0126, 0x2091, 0x8000, 0x0076, 0x0156, 0x20a9, 0x0010, 0x9005,
-	0x0510, 0x911a, 0x1600, 0x8213, 0x2039, 0x0100, 0x273c, 0x97be,
-	0x0008, 0x1110, 0x818d, 0x0010, 0x81f5, 0x3e08, 0x0228, 0x911a,
-	0x1220, 0x1f04, 0x827b, 0x0028, 0x911a, 0x2308, 0x8210, 0x1f04,
-	0x827b, 0x0006, 0x3200, 0x9084, 0xefff, 0x2080, 0x000e, 0x015e,
-	0x007e, 0x012e, 0x0005, 0x0006, 0x3200, 0x9085, 0x1000, 0x0ca8,
-	0x0126, 0x2091, 0x2800, 0x2079, 0x19b8, 0x012e, 0x00d6, 0x2069,
-	0x19b8, 0x6803, 0x0005, 0x0156, 0x0146, 0x01d6, 0x20e9, 0x0000,
-	0x2069, 0x0200, 0x080c, 0x9c3f, 0x0401, 0x080c, 0x9c2a, 0x00e9,
-	0x080c, 0x9c2d, 0x00d1, 0x080c, 0x9c30, 0x00b9, 0x080c, 0x9c33,
-	0x00a1, 0x080c, 0x9c36, 0x0089, 0x080c, 0x9c39, 0x0071, 0x080c,
-	0x9c3c, 0x0059, 0x01de, 0x014e, 0x015e, 0x2069, 0x0004, 0x2d04,
-	0x9085, 0x8001, 0x206a, 0x00de, 0x0005, 0x20a9, 0x0020, 0x20a1,
-	0x0240, 0x2001, 0x0000, 0x4004, 0x0005, 0x00c6, 0x6027, 0x0001,
-	0x7804, 0x9084, 0x0007, 0x0002, 0x82ee, 0x8312, 0x8351, 0x82f4,
-	0x8312, 0x82ee, 0x82ec, 0x82ec, 0x080c, 0x0db4, 0x080c, 0x80b8,
-	0x080c, 0x8973, 0x00ce, 0x0005, 0x62c0, 0x82ff, 0x1110, 0x00ce,
-	0x0005, 0x2011, 0x5b3a, 0x080c, 0x8038, 0x7828, 0x9092, 0x00c8,
-	0x1228, 0x8000, 0x782a, 0x080c, 0x5b7a, 0x0c88, 0x62c0, 0x080c,
-	0x9c43, 0x080c, 0x5b3a, 0x7807, 0x0003, 0x7827, 0x0000, 0x782b,
-	0x0000, 0x0c28, 0x080c, 0x80b8, 0x6220, 0xd2a4, 0x0160, 0x782b,
-	0x0000, 0x7824, 0x9065, 0x090c, 0x0db4, 0x2009, 0x0013, 0x080c,
-	0x9eac, 0x00ce, 0x0005, 0x00c6, 0x7824, 0x9065, 0x090c, 0x0db4,
-	0x7828, 0x9092, 0xc350, 0x12c0, 0x8000, 0x782a, 0x00ce, 0x080c,
-	0x29ca, 0x0278, 0x00c6, 0x7924, 0x2160, 0x6010, 0x906d, 0x090c,
-	0x0db4, 0x7807, 0x0000, 0x7827, 0x0000, 0x00ce, 0x080c, 0x8973,
-	0x0c00, 0x080c, 0x9388, 0x08e8, 0x2011, 0x0130, 0x2214, 0x080c,
-	0x9c43, 0x080c, 0xd8c9, 0x2009, 0x0014, 0x080c, 0x9eac, 0x00ce,
-	0x0880, 0x2001, 0x19d4, 0x2003, 0x0000, 0x62c0, 0x82ff, 0x1160,
+	0x610a, 0x2009, 0x0046, 0x080c, 0x9ebc, 0x7817, 0x0140, 0x2001,
+	0x19c0, 0x2004, 0x9005, 0x090c, 0x896d, 0x00be, 0x0005, 0x00b6,
+	0x00c6, 0x9484, 0x0fff, 0x0904, 0x7d53, 0x7110, 0xd1bc, 0x1904,
+	0x7d53, 0x7108, 0x700c, 0x2028, 0x918c, 0x00ff, 0x2130, 0x9094,
+	0xff00, 0x15b0, 0x81ff, 0x15a0, 0x9080, 0x313a, 0x200d, 0x918c,
+	0xff00, 0x810f, 0x2001, 0x0080, 0x9106, 0x0904, 0x7d53, 0x080c,
+	0x61e7, 0x1904, 0x7d53, 0xbe12, 0xbd16, 0xb800, 0xd0ec, 0x15d8,
+	0xba04, 0x9294, 0xff00, 0x9286, 0x0600, 0x11a0, 0x080c, 0x9dec,
+	0x05e8, 0x2b08, 0x7028, 0x604a, 0x702c, 0x6046, 0x6112, 0x6023,
+	0x0006, 0x7120, 0x610a, 0x7130, 0x6156, 0x2009, 0x0044, 0x080c,
+	0xcb35, 0x0408, 0x080c, 0x656b, 0x1138, 0xb807, 0x0606, 0x0c30,
+	0x190c, 0x7c40, 0x11c0, 0x0898, 0x080c, 0x9dec, 0x2b08, 0x0198,
+	0x6112, 0x6023, 0x0004, 0x7120, 0x610a, 0x9286, 0x0400, 0x1118,
+	0x6007, 0x0005, 0x0010, 0x6007, 0x0001, 0x6003, 0x0001, 0x080c,
+	0x8422, 0x080c, 0x896d, 0x7817, 0x0140, 0x2001, 0x19c0, 0x2004,
+	0x9005, 0x090c, 0x896d, 0x00ce, 0x00be, 0x0005, 0x2001, 0x180e,
+	0x2004, 0xd0ec, 0x0120, 0x2011, 0x8049, 0x080c, 0x48e9, 0x080c,
+	0x9e8f, 0x0d48, 0x2b08, 0x6112, 0x6023, 0x0006, 0x7120, 0x610a,
+	0x7130, 0x6156, 0x6017, 0xf300, 0x6003, 0x0001, 0x6007, 0x0041,
+	0x080c, 0x83da, 0x080c, 0x896d, 0x08b0, 0x00b6, 0x7110, 0xd1bc,
+	0x01e8, 0x7020, 0x2060, 0x9c84, 0x0007, 0x11c0, 0x9c82, 0x1cd0,
+	0x02a8, 0x6864, 0x9c02, 0x1290, 0x7008, 0x9084, 0x00ff, 0x6110,
+	0x2158, 0xb910, 0x9106, 0x1150, 0x700c, 0xb914, 0x9106, 0x1130,
+	0x7124, 0x610a, 0x2009, 0x0045, 0x080c, 0x9ebc, 0x7817, 0x0140,
+	0x2001, 0x19c0, 0x2004, 0x9005, 0x090c, 0x896d, 0x00be, 0x0005,
+	0x6120, 0x9186, 0x0002, 0x0128, 0x9186, 0x0005, 0x0110, 0x9085,
+	0x0001, 0x0005, 0x080c, 0x30ff, 0x1168, 0x7010, 0x9084, 0xff00,
+	0x8007, 0x9086, 0x0000, 0x1130, 0x9184, 0x000f, 0x908a, 0x0006,
+	0x1208, 0x000b, 0x0005, 0x7dc9, 0x7dca, 0x7dc9, 0x7dc9, 0x7e29,
+	0x7e38, 0x0005, 0x00b6, 0x7110, 0xd1bc, 0x0120, 0x702c, 0xd084,
+	0x0904, 0x7e27, 0x700c, 0x7108, 0x080c, 0x2665, 0x1904, 0x7e27,
+	0x080c, 0x61e7, 0x1904, 0x7e27, 0xbe12, 0xbd16, 0x7110, 0xd1bc,
+	0x01d8, 0x080c, 0x656b, 0x0118, 0x9086, 0x0004, 0x1588, 0x00c6,
+	0x080c, 0x7e47, 0x00ce, 0x05d8, 0x080c, 0x9dec, 0x2b08, 0x05b8,
+	0x6112, 0x080c, 0xbfa6, 0x6023, 0x0002, 0x7120, 0x610a, 0x2009,
+	0x0088, 0x080c, 0x9ebc, 0x0458, 0x080c, 0x656b, 0x0148, 0x9086,
+	0x0004, 0x0130, 0x080c, 0x6573, 0x0118, 0x9086, 0x0004, 0x1180,
+	0x080c, 0x9dec, 0x2b08, 0x01d8, 0x6112, 0x080c, 0xbfa6, 0x6023,
+	0x0005, 0x7120, 0x610a, 0x2009, 0x0088, 0x080c, 0x9ebc, 0x0078,
+	0x080c, 0x9dec, 0x2b08, 0x0158, 0x6112, 0x080c, 0xbfa6, 0x6023,
+	0x0004, 0x7120, 0x610a, 0x2009, 0x0001, 0x080c, 0x9ebc, 0x00be,
+	0x0005, 0x7110, 0xd1bc, 0x0158, 0x00d1, 0x0148, 0x080c, 0x7da8,
+	0x1130, 0x7124, 0x610a, 0x2009, 0x0089, 0x080c, 0x9ebc, 0x0005,
+	0x7110, 0xd1bc, 0x0158, 0x0059, 0x0148, 0x080c, 0x7da8, 0x1130,
+	0x7124, 0x610a, 0x2009, 0x008a, 0x080c, 0x9ebc, 0x0005, 0x7020,
+	0x2060, 0x9c84, 0x0007, 0x1158, 0x9c82, 0x1cd0, 0x0240, 0x2001,
+	0x1819, 0x2004, 0x9c02, 0x1218, 0x9085, 0x0001, 0x0005, 0x9006,
+	0x0ce8, 0x00b6, 0x7110, 0xd1bc, 0x11d8, 0x7024, 0x2060, 0x9c84,
+	0x0007, 0x11b0, 0x9c82, 0x1cd0, 0x0298, 0x6864, 0x9c02, 0x1280,
+	0x7008, 0x9084, 0x00ff, 0x6110, 0x2158, 0xb910, 0x9106, 0x1140,
+	0x700c, 0xb914, 0x9106, 0x1120, 0x2009, 0x0051, 0x080c, 0x9ebc,
+	0x7817, 0x0140, 0x2001, 0x19c0, 0x2004, 0x9005, 0x090c, 0x896d,
+	0x00be, 0x0005, 0x2031, 0x0105, 0x0069, 0x0005, 0x2031, 0x0206,
+	0x0049, 0x0005, 0x2031, 0x0207, 0x0029, 0x0005, 0x2031, 0x0213,
+	0x0009, 0x0005, 0x00c6, 0x0096, 0x00f6, 0x7000, 0x9084, 0xf000,
+	0x9086, 0xc000, 0x05d0, 0x080c, 0x9dec, 0x05b8, 0x0066, 0x00c6,
+	0x0046, 0x2011, 0x0263, 0x2204, 0x8211, 0x220c, 0x080c, 0x2665,
+	0x15a0, 0x080c, 0x61e7, 0x1588, 0xbe12, 0xbd16, 0x2b00, 0x004e,
+	0x00ce, 0x6012, 0x080c, 0xbfa6, 0x080c, 0x0feb, 0x0510, 0x2900,
+	0x605a, 0x9006, 0xa802, 0xa866, 0xac6a, 0xa85c, 0x90f8, 0x001b,
+	0x20a9, 0x000e, 0xa860, 0x20e8, 0x20e1, 0x0000, 0x2fa0, 0x2e98,
+	0x4003, 0x006e, 0x6616, 0x6007, 0x003e, 0x6023, 0x0001, 0x6003,
+	0x0001, 0x080c, 0x8422, 0x080c, 0x896d, 0x00fe, 0x009e, 0x00ce,
+	0x0005, 0x080c, 0x9e42, 0x006e, 0x0cc0, 0x004e, 0x00ce, 0x0cc8,
+	0x00c6, 0x7000, 0x908c, 0xff00, 0x9184, 0xf000, 0x810f, 0x9086,
+	0x2000, 0x1904, 0x7f37, 0x9186, 0x0022, 0x15f0, 0x2001, 0x0111,
+	0x2004, 0x9005, 0x1904, 0x7f39, 0x7030, 0x908e, 0x0400, 0x0904,
+	0x7f39, 0x908e, 0x6000, 0x05e8, 0x908e, 0x5400, 0x05d0, 0x908e,
+	0x0300, 0x11d8, 0x2009, 0x1836, 0x210c, 0xd18c, 0x1590, 0xd1a4,
+	0x1580, 0x080c, 0x6529, 0x0558, 0x68ac, 0x9084, 0x00ff, 0x7100,
+	0x918c, 0x00ff, 0x9106, 0x1518, 0x687c, 0x69ac, 0x918c, 0xff00,
+	0x9105, 0x7104, 0x9106, 0x11d8, 0x00e0, 0x2009, 0x0103, 0x210c,
+	0xd1b4, 0x11a8, 0x908e, 0x5200, 0x09e8, 0x908e, 0x0500, 0x09d0,
+	0x908e, 0x5000, 0x09b8, 0x0058, 0x9186, 0x0023, 0x1140, 0x080c,
+	0x7e47, 0x0128, 0x6004, 0x9086, 0x0002, 0x0118, 0x0000, 0x9006,
+	0x0010, 0x9085, 0x0001, 0x00ce, 0x0005, 0x00f6, 0x2079, 0x0200,
+	0x7800, 0xc0e5, 0xc0cc, 0x7802, 0x00fe, 0x0005, 0x00f6, 0x2079,
+	0x1800, 0x7834, 0xd084, 0x1130, 0x2079, 0x0200, 0x7800, 0x9085,
+	0x1200, 0x7802, 0x00fe, 0x0005, 0x00e6, 0x2071, 0x1800, 0x7034,
+	0xc084, 0x7036, 0x00ee, 0x0005, 0x2071, 0x19ca, 0x7003, 0x0003,
+	0x700f, 0x0361, 0x9006, 0x701a, 0x7072, 0x7012, 0x7017, 0x1cd0,
+	0x7007, 0x0000, 0x7026, 0x702b, 0x93c3, 0x7032, 0x7037, 0x9431,
+	0x703f, 0xffff, 0x7042, 0x7047, 0x522e, 0x704a, 0x705b, 0x80bc,
+	0x080c, 0x1004, 0x090c, 0x0db4, 0x2900, 0x703a, 0xa867, 0x0003,
+	0xa86f, 0x0100, 0xa8ab, 0xdcb0, 0x0005, 0x2071, 0x19ca, 0x1d04,
+	0x8010, 0x2091, 0x6000, 0x700c, 0x8001, 0x700e, 0x1510, 0x2001,
+	0x1875, 0x2004, 0xd0c4, 0x0158, 0x3a00, 0xd08c, 0x1140, 0x20d1,
+	0x0000, 0x20d1, 0x0001, 0x20d1, 0x0000, 0x080c, 0x0db4, 0x700f,
+	0x0361, 0x7007, 0x0001, 0x0126, 0x2091, 0x8000, 0x080c, 0x8101,
+	0x7040, 0x900d, 0x0148, 0x8109, 0x7142, 0x1130, 0x7044, 0x080f,
+	0x0018, 0x0126, 0x2091, 0x8000, 0x7024, 0x900d, 0x0188, 0x7020,
+	0x8001, 0x7022, 0x1168, 0x7023, 0x0009, 0x8109, 0x7126, 0x9186,
+	0x03e8, 0x1110, 0x7028, 0x080f, 0x81ff, 0x1110, 0x7028, 0x080f,
+	0x7030, 0x900d, 0x0180, 0x702c, 0x8001, 0x702e, 0x1160, 0x702f,
+	0x0009, 0x8109, 0x7132, 0x0128, 0x9184, 0x007f, 0x090c, 0x953e,
+	0x0010, 0x7034, 0x080f, 0x703c, 0x9005, 0x0118, 0x0310, 0x8001,
+	0x703e, 0x704c, 0x900d, 0x0168, 0x7048, 0x8001, 0x704a, 0x1148,
+	0x704b, 0x0009, 0x8109, 0x714e, 0x1120, 0x7150, 0x714e, 0x7058,
+	0x080f, 0x7018, 0x900d, 0x01d8, 0x0016, 0x7070, 0x900d, 0x0158,
+	0x706c, 0x8001, 0x706e, 0x1138, 0x706f, 0x0009, 0x8109, 0x7172,
+	0x1110, 0x7074, 0x080f, 0x001e, 0x7008, 0x8001, 0x700a, 0x1138,
+	0x700b, 0x0009, 0x8109, 0x711a, 0x1110, 0x701c, 0x080f, 0x012e,
+	0x7004, 0x0002, 0x8038, 0x8039, 0x8055, 0x00e6, 0x2071, 0x19ca,
+	0x7018, 0x9005, 0x1120, 0x711a, 0x721e, 0x700b, 0x0009, 0x00ee,
+	0x0005, 0x00e6, 0x0006, 0x2071, 0x19ca, 0x701c, 0x9206, 0x1120,
+	0x701a, 0x701e, 0x7072, 0x7076, 0x000e, 0x00ee, 0x0005, 0x00e6,
+	0x2071, 0x19ca, 0xb888, 0x9102, 0x0208, 0xb98a, 0x00ee, 0x0005,
+	0x0005, 0x00b6, 0x7110, 0x080c, 0x6247, 0x1168, 0xb888, 0x8001,
+	0x0250, 0xb88a, 0x1140, 0x0126, 0x2091, 0x8000, 0x0016, 0x080c,
+	0x896d, 0x001e, 0x012e, 0x8108, 0x9182, 0x0800, 0x0218, 0x900e,
+	0x7007, 0x0002, 0x7112, 0x00be, 0x0005, 0x7014, 0x2060, 0x0126,
+	0x2091, 0x8000, 0x6040, 0x9005, 0x0128, 0x8001, 0x6042, 0x1110,
+	0x080c, 0xbe37, 0x6018, 0x9005, 0x0528, 0x8001, 0x601a, 0x1510,
+	0x6120, 0x9186, 0x0003, 0x0118, 0x9186, 0x0006, 0x11c8, 0x080c,
+	0xbb2c, 0x01b0, 0x6014, 0x2048, 0xa884, 0x908a, 0x199a, 0x0280,
+	0x9082, 0x1999, 0xa886, 0x908a, 0x199a, 0x0210, 0x2001, 0x1999,
+	0x8003, 0x800b, 0x810b, 0x9108, 0x611a, 0xa87c, 0xd0e4, 0x0110,
+	0x080c, 0xb828, 0x012e, 0x9c88, 0x0018, 0x7116, 0x2001, 0x1819,
+	0x2004, 0x9102, 0x0220, 0x7017, 0x1cd0, 0x7007, 0x0000, 0x0005,
+	0x00e6, 0x2071, 0x19ca, 0x7027, 0x07d0, 0x7023, 0x0009, 0x00ee,
+	0x0005, 0x2001, 0x19d3, 0x2003, 0x0000, 0x0005, 0x00e6, 0x2071,
+	0x19ca, 0x7132, 0x702f, 0x0009, 0x00ee, 0x0005, 0x2011, 0x19d6,
+	0x2013, 0x0000, 0x0005, 0x00e6, 0x2071, 0x19ca, 0x711a, 0x721e,
+	0x700b, 0x0009, 0x00ee, 0x0005, 0x0086, 0x0026, 0x7054, 0x8000,
+	0x7056, 0x2001, 0x19d8, 0x2044, 0xa06c, 0x9086, 0x0000, 0x0150,
+	0x7068, 0xa09a, 0x7064, 0xa096, 0x7060, 0xa092, 0x705c, 0xa08e,
+	0x080c, 0x10d5, 0x002e, 0x008e, 0x0005, 0x0006, 0x0016, 0x0096,
+	0x00a6, 0x00b6, 0x00c6, 0x00d6, 0x00e6, 0x00f6, 0x0156, 0x080c,
+	0x7f85, 0x015e, 0x00fe, 0x00ee, 0x00de, 0x00ce, 0x00be, 0x00ae,
+	0x009e, 0x001e, 0x000e, 0x0005, 0x00e6, 0x2071, 0x19ca, 0x7172,
+	0x7276, 0x706f, 0x0009, 0x00ee, 0x0005, 0x00e6, 0x0006, 0x2071,
+	0x19ca, 0x7074, 0x9206, 0x1110, 0x7072, 0x7076, 0x000e, 0x00ee,
+	0x0005, 0x2069, 0x1800, 0x69e4, 0xd1e4, 0x1518, 0x0026, 0xd1ec,
+	0x0140, 0x6a50, 0x6870, 0x9202, 0x0288, 0x8117, 0x9294, 0x00c0,
+	0x0088, 0x9184, 0x0007, 0x01a0, 0x8109, 0x9184, 0x0007, 0x0110,
+	0x69e6, 0x0070, 0x8107, 0x9084, 0x0007, 0x910d, 0x8107, 0x9106,
+	0x9094, 0x00c0, 0x9184, 0xff3f, 0x9205, 0x68e6, 0x080c, 0x0ecb,
+	0x002e, 0x0005, 0x00c6, 0x2061, 0x1a40, 0x00ce, 0x0005, 0x9184,
+	0x000f, 0x8003, 0x8003, 0x8003, 0x9080, 0x1a40, 0x2060, 0x0005,
+	0xa884, 0x908a, 0x199a, 0x1638, 0x9005, 0x1150, 0x00c6, 0x2061,
+	0x1a40, 0x6014, 0x00ce, 0x9005, 0x1130, 0x2001, 0x001e, 0x0018,
+	0x908e, 0xffff, 0x01b0, 0x8003, 0x800b, 0x810b, 0x9108, 0x611a,
+	0xa87c, 0x908c, 0x00c0, 0x918e, 0x00c0, 0x0904, 0x81c2, 0xd0b4,
+	0x1168, 0xd0bc, 0x1904, 0x819b, 0x2009, 0x0006, 0x080c, 0x81ef,
+	0x0005, 0x900e, 0x0c60, 0x2001, 0x1999, 0x08b0, 0xd0fc, 0x0160,
+	0x908c, 0x0003, 0x0120, 0x918e, 0x0003, 0x1904, 0x81e9, 0x908c,
+	0x2020, 0x918e, 0x2020, 0x01a8, 0x6024, 0xd0d4, 0x11e8, 0x2009,
+	0x1875, 0x2104, 0xd084, 0x1138, 0x87ff, 0x1120, 0x2009, 0x0043,
+	0x0804, 0x9ebc, 0x0005, 0x87ff, 0x1de8, 0x2009, 0x0042, 0x0804,
+	0x9ebc, 0x6110, 0x00b6, 0x2158, 0xb900, 0x00be, 0xd1ac, 0x0d20,
+	0x6024, 0xc0cd, 0x6026, 0x0c00, 0xc0d4, 0x6026, 0xa890, 0x602e,
+	0xa88c, 0x6032, 0x08e0, 0xd0fc, 0x0160, 0x908c, 0x0003, 0x0120,
+	0x918e, 0x0003, 0x1904, 0x81e9, 0x908c, 0x2020, 0x918e, 0x2020,
+	0x0170, 0x0076, 0x00f6, 0x2c78, 0x080c, 0x164a, 0x00fe, 0x007e,
+	0x87ff, 0x1120, 0x2009, 0x0042, 0x080c, 0x9ebc, 0x0005, 0x6110,
+	0x00b6, 0x2158, 0xb900, 0x00be, 0xd1ac, 0x0d58, 0x6124, 0xc1cd,
+	0x6126, 0x0c38, 0xd0fc, 0x0188, 0x908c, 0x2020, 0x918e, 0x2020,
+	0x01a8, 0x9084, 0x0003, 0x908e, 0x0002, 0x0148, 0x87ff, 0x1120,
+	0x2009, 0x0041, 0x080c, 0x9ebc, 0x0005, 0x00b9, 0x0ce8, 0x87ff,
+	0x1dd8, 0x2009, 0x0043, 0x080c, 0x9ebc, 0x0cb0, 0x6110, 0x00b6,
+	0x2158, 0xb900, 0x00be, 0xd1ac, 0x0d20, 0x6124, 0xc1cd, 0x6126,
+	0x0c00, 0x2009, 0x0004, 0x0019, 0x0005, 0x2009, 0x0001, 0x0096,
+	0x080c, 0xbb2c, 0x0518, 0x6014, 0x2048, 0xa982, 0xa800, 0x6016,
+	0x9186, 0x0001, 0x1188, 0xa97c, 0x918c, 0x8100, 0x918e, 0x8100,
+	0x1158, 0x00c6, 0x2061, 0x1a40, 0x6200, 0xd28c, 0x1120, 0x6204,
+	0x8210, 0x0208, 0x6206, 0x00ce, 0x080c, 0x66cb, 0x6014, 0x904d,
+	0x0076, 0x2039, 0x0000, 0x190c, 0x8138, 0x007e, 0x009e, 0x0005,
+	0x0156, 0x00c6, 0x2061, 0x1a40, 0x6000, 0x81ff, 0x0110, 0x9205,
+	0x0008, 0x9204, 0x6002, 0x00ce, 0x015e, 0x0005, 0x6800, 0xd08c,
+	0x1138, 0x6808, 0x9005, 0x0120, 0x8001, 0x680a, 0x9085, 0x0001,
+	0x0005, 0x0126, 0x2091, 0x8000, 0x0036, 0x0046, 0x20a9, 0x0010,
+	0x9006, 0x8004, 0x2019, 0x0100, 0x231c, 0x93a6, 0x0008, 0x1118,
+	0x8086, 0x818e, 0x0020, 0x80f6, 0x3e00, 0x81f6, 0x3e08, 0x1208,
+	0x9200, 0x1f04, 0x823a, 0x93a6, 0x0008, 0x1118, 0x8086, 0x818e,
+	0x0020, 0x80f6, 0x3e00, 0x81f6, 0x3e08, 0x004e, 0x003e, 0x012e,
+	0x0005, 0x0126, 0x2091, 0x8000, 0x0076, 0x0156, 0x20a9, 0x0010,
+	0x9005, 0x0510, 0x911a, 0x1600, 0x8213, 0x2039, 0x0100, 0x273c,
+	0x97be, 0x0008, 0x1110, 0x818d, 0x0010, 0x81f5, 0x3e08, 0x0228,
+	0x911a, 0x1220, 0x1f04, 0x8264, 0x0028, 0x911a, 0x2308, 0x8210,
+	0x1f04, 0x8264, 0x0006, 0x3200, 0x9084, 0xefff, 0x2080, 0x000e,
+	0x015e, 0x007e, 0x012e, 0x0005, 0x0006, 0x3200, 0x9085, 0x1000,
+	0x0ca8, 0x0126, 0x2091, 0x2800, 0x2079, 0x19b7, 0x012e, 0x00d6,
+	0x2069, 0x19b7, 0x6803, 0x0005, 0x0156, 0x0146, 0x01d6, 0x20e9,
+	0x0000, 0x2069, 0x0200, 0x080c, 0x9c4a, 0x0401, 0x080c, 0x9c35,
+	0x00e9, 0x080c, 0x9c38, 0x00d1, 0x080c, 0x9c3b, 0x00b9, 0x080c,
+	0x9c3e, 0x00a1, 0x080c, 0x9c41, 0x0089, 0x080c, 0x9c44, 0x0071,
+	0x080c, 0x9c47, 0x0059, 0x01de, 0x014e, 0x015e, 0x2069, 0x0004,
+	0x2d04, 0x9085, 0x8001, 0x206a, 0x00de, 0x0005, 0x20a9, 0x0020,
+	0x20a1, 0x0240, 0x2001, 0x0000, 0x4004, 0x0005, 0x00c6, 0x6027,
+	0x0001, 0x7804, 0x9084, 0x0007, 0x0002, 0x82d7, 0x82fb, 0x833a,
+	0x82dd, 0x82fb, 0x82d7, 0x82d5, 0x82d5, 0x080c, 0x0db4, 0x080c,
+	0x80a1, 0x080c, 0x896d, 0x00ce, 0x0005, 0x62c0, 0x82ff, 0x1110,
+	0x00ce, 0x0005, 0x2011, 0x5b43, 0x080c, 0x8021, 0x7828, 0x9092,
+	0x00c8, 0x1228, 0x8000, 0x782a, 0x080c, 0x5b83, 0x0c88, 0x62c0,
+	0x080c, 0x9c4e, 0x080c, 0x5b43, 0x7807, 0x0003, 0x7827, 0x0000,
+	0x782b, 0x0000, 0x0c28, 0x080c, 0x80a1, 0x6220, 0xd2a4, 0x0160,
 	0x782b, 0x0000, 0x7824, 0x9065, 0x090c, 0x0db4, 0x2009, 0x0013,
-	0x080c, 0x9efe, 0x00ce, 0x0005, 0x00b6, 0x00c6, 0x00d6, 0x7824,
-	0x9005, 0x090c, 0x0db4, 0x7828, 0x9092, 0xc350, 0x1648, 0x8000,
-	0x782a, 0x00de, 0x00ce, 0x00be, 0x080c, 0x29ca, 0x02f0, 0x00b6,
-	0x00c6, 0x00d6, 0x781c, 0x905d, 0x090c, 0x0db4, 0xb800, 0xc0dc,
-	0xb802, 0x7924, 0x2160, 0x080c, 0x9e32, 0xb93c, 0x81ff, 0x090c,
-	0x0db4, 0x8109, 0xb93e, 0x7807, 0x0000, 0x7827, 0x0000, 0x00de,
-	0x00ce, 0x00be, 0x080c, 0x8973, 0x0868, 0x080c, 0x9388, 0x0850,
-	0x2011, 0x0130, 0x2214, 0x080c, 0x9c43, 0x080c, 0xd8c9, 0x7824,
-	0x9065, 0x2009, 0x0014, 0x080c, 0x9eac, 0x00de, 0x00ce, 0x00be,
-	0x0804, 0x8362, 0x00c6, 0x2001, 0x009b, 0x2004, 0xd0fc, 0x190c,
-	0x1d4a, 0x6024, 0x6027, 0x0002, 0xd0f4, 0x1580, 0x62c8, 0x60c4,
-	0x9205, 0x1170, 0x783c, 0x9065, 0x0130, 0x2009, 0x0049, 0x080c,
-	0x9eac, 0x00ce, 0x0005, 0x2011, 0x19d7, 0x2013, 0x0000, 0x0cc8,
-	0x793c, 0x81ff, 0x0dc0, 0x7944, 0x9192, 0x7530, 0x12f0, 0x8108,
-	0x7946, 0x793c, 0x9188, 0x0008, 0x210c, 0x918e, 0x0006, 0x1138,
-	0x6014, 0x9084, 0x1984, 0x9085, 0x0012, 0x6016, 0x0c10, 0x6014,
-	0x9084, 0x1984, 0x9085, 0x0016, 0x6016, 0x08d8, 0x793c, 0x2160,
-	0x2009, 0x004a, 0x080c, 0x9eac, 0x08a0, 0x7848, 0xc085, 0x784a,
-	0x0880, 0x0006, 0x0016, 0x00c6, 0x0126, 0x2091, 0x8000, 0x600f,
-	0x0000, 0x2c08, 0x2061, 0x19b8, 0x6020, 0x8000, 0x6022, 0x6010,
-	0x9005, 0x0148, 0x9080, 0x0003, 0x2102, 0x6112, 0x012e, 0x00ce,
-	0x001e, 0x000e, 0x0005, 0x6116, 0x6112, 0x0cc0, 0x00d6, 0x2069,
-	0x19b8, 0xb800, 0xd0d4, 0x0168, 0x6820, 0x8000, 0x6822, 0x9086,
-	0x0001, 0x1110, 0x2b00, 0x681e, 0x00de, 0x0804, 0x8973, 0x00de,
-	0x0005, 0xc0d5, 0xb802, 0x6818, 0x9005, 0x0168, 0xb856, 0xb85b,
-	0x0000, 0x0086, 0x0006, 0x2b00, 0x681a, 0x008e, 0xa05a, 0x008e,
-	0x2069, 0x19b8, 0x0c08, 0xb856, 0xb85a, 0x2b00, 0x681a, 0x681e,
-	0x08d8, 0x0006, 0x0016, 0x00c6, 0x0126, 0x2091, 0x8000, 0x600f,
-	0x0000, 0x2c08, 0x2061, 0x19b8, 0x6020, 0x8000, 0x6022, 0x6008,
-	0x9005, 0x0148, 0x9080, 0x0003, 0x2102, 0x610a, 0x012e, 0x00ce,
-	0x001e, 0x000e, 0x0005, 0x610e, 0x610a, 0x0cc0, 0x00c6, 0x600f,
-	0x0000, 0x2c08, 0x2061, 0x19b8, 0x6034, 0x9005, 0x0130, 0x9080,
-	0x0003, 0x2102, 0x6136, 0x00ce, 0x0005, 0x613a, 0x6136, 0x00ce,
-	0x0005, 0x00f6, 0x00e6, 0x00d6, 0x00c6, 0x00b6, 0x0096, 0x0076,
-	0x0066, 0x0056, 0x0036, 0x0026, 0x0016, 0x0006, 0x0126, 0x902e,
-	0x2071, 0x19b8, 0x7638, 0x2660, 0x2678, 0x2091, 0x8000, 0x8cff,
-	0x0904, 0x84e0, 0x6010, 0x2058, 0xb8a0, 0x9206, 0x1904, 0x84db,
-	0x87ff, 0x0120, 0x6054, 0x9106, 0x1904, 0x84db, 0x703c, 0x9c06,
-	0x1178, 0x0036, 0x2019, 0x0001, 0x080c, 0x96d8, 0x7033, 0x0000,
-	0x9006, 0x703e, 0x7042, 0x7046, 0x704a, 0x003e, 0x2029, 0x0001,
-	0x7038, 0x9c36, 0x1110, 0x660c, 0x763a, 0x7034, 0x9c36, 0x1140,
-	0x2c00, 0x9f36, 0x0118, 0x2f00, 0x7036, 0x0010, 0x7037, 0x0000,
-	0x660c, 0x0066, 0x2c00, 0x9f06, 0x0110, 0x7e0e, 0x0008, 0x2678,
-	0x600f, 0x0000, 0x080c, 0xbb17, 0x01c8, 0x6014, 0x2048, 0x6020,
-	0x9086, 0x0003, 0x1590, 0xa867, 0x0103, 0xab7a, 0xa877, 0x0000,
-	0x0016, 0x0036, 0x0076, 0x080c, 0xbe06, 0x080c, 0xd7d3, 0x080c,
-	0x688c, 0x007e, 0x003e, 0x001e, 0x080c, 0xbd00, 0x080c, 0x9e62,
-	0x00ce, 0x0804, 0x847f, 0x2c78, 0x600c, 0x2060, 0x0804, 0x847f,
-	0x85ff, 0x0120, 0x0036, 0x080c, 0x8a4e, 0x003e, 0x012e, 0x000e,
-	0x001e, 0x002e, 0x003e, 0x005e, 0x006e, 0x007e, 0x009e, 0x00be,
-	0x00ce, 0x00de, 0x00ee, 0x00fe, 0x0005, 0x6020, 0x9086, 0x0006,
-	0x1158, 0x0016, 0x0036, 0x0076, 0x080c, 0xd7d3, 0x080c, 0xd4d5,
-	0x007e, 0x003e, 0x001e, 0x0890, 0x6020, 0x9086, 0x000a, 0x0904,
-	0x84c5, 0x0804, 0x84c3, 0x0006, 0x0066, 0x0096, 0x00c6, 0x00d6,
-	0x00f6, 0x9036, 0x0126, 0x2091, 0x8000, 0x2079, 0x19b8, 0x7838,
-	0x9065, 0x0904, 0x855b, 0x600c, 0x0006, 0x600f, 0x0000, 0x783c,
-	0x9c06, 0x1168, 0x0036, 0x2019, 0x0001, 0x080c, 0x96d8, 0x7833,
-	0x0000, 0x901e, 0x7b3e, 0x7b42, 0x7b46, 0x7b4a, 0x003e, 0x080c,
-	0xbb17, 0x0520, 0x6014, 0x2048, 0x6020, 0x9086, 0x0003, 0x1568,
-	0x3e08, 0x918e, 0x0002, 0x1188, 0x6010, 0x9005, 0x0170, 0x00b6,
-	0x2058, 0xb800, 0x00be, 0xd0bc, 0x0140, 0x6040, 0x9005, 0x1180,
-	0x2001, 0x1959, 0x2004, 0x6042, 0x0058, 0xa867, 0x0103, 0xab7a,
-	0xa877, 0x0000, 0x080c, 0x687f, 0x080c, 0xbd00, 0x080c, 0x9e62,
-	0x000e, 0x0804, 0x8518, 0x7e3a, 0x7e36, 0x012e, 0x00fe, 0x00de,
-	0x00ce, 0x009e, 0x006e, 0x000e, 0x0005, 0x6020, 0x9086, 0x0006,
-	0x1118, 0x080c, 0xd4d5, 0x0c50, 0x6020, 0x9086, 0x000a, 0x09f8,
-	0x08e0, 0x0016, 0x0026, 0x0086, 0x9046, 0x0099, 0x080c, 0x865a,
-	0x008e, 0x002e, 0x001e, 0x0005, 0x00f6, 0x0126, 0x2079, 0x19b8,
-	0x2091, 0x8000, 0x080c, 0x86f1, 0x080c, 0x877f, 0x012e, 0x00fe,
-	0x0005, 0x00b6, 0x0096, 0x00f6, 0x00e6, 0x00d6, 0x00c6, 0x0066,
-	0x0016, 0x0006, 0x0126, 0x2091, 0x8000, 0x2071, 0x19b8, 0x7614,
-	0x2660, 0x2678, 0x8cff, 0x0904, 0x861f, 0x6010, 0x2058, 0xb8a0,
-	0x9206, 0x1904, 0x861a, 0x88ff, 0x0120, 0x6054, 0x9106, 0x1904,
-	0x861a, 0x7024, 0x9c06, 0x1558, 0x2069, 0x0100, 0x6820, 0xd0a4,
-	0x1508, 0x080c, 0x80b8, 0x080c, 0x93ac, 0x68c3, 0x0000, 0x080c,
-	0x98da, 0x7027, 0x0000, 0x0036, 0x2069, 0x0140, 0x6b04, 0x9384,
-	0x1000, 0x0138, 0x2001, 0x0100, 0x080c, 0x2b14, 0x9006, 0x080c,
-	0x2b14, 0x2069, 0x0100, 0x6824, 0xd084, 0x0110, 0x6827, 0x0001,
-	0x003e, 0x0028, 0x6003, 0x0009, 0x630a, 0x0804, 0x861a, 0x7014,
-	0x9c36, 0x1110, 0x660c, 0x7616, 0x7010, 0x9c36, 0x1140, 0x2c00,
-	0x9f36, 0x0118, 0x2f00, 0x7012, 0x0010, 0x7013, 0x0000, 0x660c,
-	0x0066, 0x2c00, 0x9f06, 0x0110, 0x7e0e, 0x0008, 0x2678, 0x600f,
-	0x0000, 0x6014, 0x2048, 0x080c, 0xbb17, 0x01e8, 0x6020, 0x9086,
-	0x0003, 0x1580, 0x080c, 0xbd1d, 0x1118, 0x080c, 0xa7c0, 0x0098,
-	0xa867, 0x0103, 0xab7a, 0xa877, 0x0000, 0x0016, 0x0036, 0x0086,
-	0x080c, 0xbe06, 0x080c, 0xd7d3, 0x080c, 0x688c, 0x008e, 0x003e,
-	0x001e, 0x080c, 0xbd00, 0x080c, 0x9e62, 0x080c, 0x97b0, 0x00ce,
-	0x0804, 0x859a, 0x2c78, 0x600c, 0x2060, 0x0804, 0x859a, 0x012e,
-	0x000e, 0x001e, 0x006e, 0x00ce, 0x00de, 0x00ee, 0x00fe, 0x009e,
-	0x00be, 0x0005, 0x6020, 0x9086, 0x0006, 0x1158, 0x0016, 0x0036,
-	0x0086, 0x080c, 0xd7d3, 0x080c, 0xd4d5, 0x008e, 0x003e, 0x001e,
-	0x08d0, 0x080c, 0xa7c0, 0x6020, 0x9086, 0x0002, 0x1160, 0x6004,
-	0x0006, 0x9086, 0x0085, 0x000e, 0x0904, 0x8600, 0x9086, 0x008b,
-	0x0904, 0x8600, 0x0840, 0x6020, 0x9086, 0x0005, 0x1920, 0x6004,
-	0x0006, 0x9086, 0x0085, 0x000e, 0x09c8, 0x9086, 0x008b, 0x09b0,
-	0x0804, 0x8613, 0x00b6, 0x00a6, 0x0096, 0x00c6, 0x0006, 0x0126,
-	0x2091, 0x8000, 0x9280, 0x1000, 0x2004, 0x905d, 0x0904, 0x86ea,
-	0x00f6, 0x00e6, 0x00d6, 0x0066, 0x2071, 0x19b8, 0xbe54, 0x7018,
-	0x9b06, 0x1108, 0x761a, 0x701c, 0x9b06, 0x1130, 0x86ff, 0x1118,
-	0x7018, 0x701e, 0x0008, 0x761e, 0xb858, 0x904d, 0x0108, 0xae56,
-	0x96d5, 0x0000, 0x0110, 0x2900, 0xb05a, 0xb857, 0x0000, 0xb85b,
-	0x0000, 0xb800, 0xc0d4, 0xc0dc, 0xb802, 0x080c, 0x6171, 0x0904,
-	0x86e6, 0x7624, 0x86ff, 0x0904, 0x86d5, 0x9680, 0x0005, 0x2004,
-	0x9906, 0x15d8, 0x00d6, 0x2069, 0x0100, 0x68c0, 0x9005, 0x0560,
-	0x080c, 0x80b8, 0x080c, 0x93ac, 0x68c3, 0x0000, 0x080c, 0x98da,
-	0x7027, 0x0000, 0x0036, 0x2069, 0x0140, 0x6b04, 0x9384, 0x1000,
-	0x0138, 0x2001, 0x0100, 0x080c, 0x2b14, 0x9006, 0x080c, 0x2b14,
-	0x2069, 0x0100, 0x6824, 0xd084, 0x0110, 0x6827, 0x0001, 0x003e,
-	0x00de, 0x00c6, 0xb83c, 0x9005, 0x0110, 0x8001, 0xb83e, 0x2660,
-	0x080c, 0x9e62, 0x00ce, 0x0048, 0x00de, 0x00c6, 0x2660, 0x6003,
-	0x0009, 0x630a, 0x00ce, 0x0804, 0x868d, 0x89ff, 0x0158, 0xa867,
-	0x0103, 0xab7a, 0xa877, 0x0000, 0x080c, 0xbe06, 0x080c, 0xd7d3,
-	0x080c, 0x688c, 0x080c, 0x97b0, 0x0804, 0x868d, 0x006e, 0x00de,
-	0x00ee, 0x00fe, 0x012e, 0x000e, 0x00ce, 0x009e, 0x00ae, 0x00be,
-	0x0005, 0x0096, 0x0006, 0x0066, 0x00c6, 0x00d6, 0x9036, 0x7814,
-	0x9065, 0x0904, 0x8752, 0x600c, 0x0006, 0x600f, 0x0000, 0x7824,
-	0x9c06, 0x1570, 0x2069, 0x0100, 0x6820, 0xd0a4, 0x1508, 0x080c,
-	0x80b8, 0x080c, 0x93ac, 0x68c3, 0x0000, 0x080c, 0x98da, 0x7827,
-	0x0000, 0x0036, 0x2069, 0x0140, 0x6b04, 0x9384, 0x1000, 0x0138,
-	0x2001, 0x0100, 0x080c, 0x2b14, 0x9006, 0x080c, 0x2b14, 0x2069,
-	0x0100, 0x6824, 0xd084, 0x0110, 0x6827, 0x0001, 0x003e, 0x0040,
-	0x080c, 0x6518, 0x1520, 0x6003, 0x0009, 0x630a, 0x2c30, 0x00f8,
-	0x6014, 0x2048, 0x080c, 0xbb15, 0x01b0, 0x6020, 0x9086, 0x0003,
-	0x1508, 0x080c, 0xbd1d, 0x1118, 0x080c, 0xa7c0, 0x0060, 0x080c,
-	0x6518, 0x1168, 0xa867, 0x0103, 0xab7a, 0xa877, 0x0000, 0x080c,
-	0x688c, 0x080c, 0xbd00, 0x080c, 0x9e62, 0x080c, 0x97b0, 0x000e,
-	0x0804, 0x86f8, 0x7e16, 0x7e12, 0x00de, 0x00ce, 0x006e, 0x000e,
-	0x009e, 0x0005, 0x6020, 0x9086, 0x0006, 0x1118, 0x080c, 0xd4d5,
-	0x0c50, 0x080c, 0xa7c0, 0x6020, 0x9086, 0x0002, 0x1150, 0x6004,
-	0x0006, 0x9086, 0x0085, 0x000e, 0x0990, 0x9086, 0x008b, 0x0978,
-	0x08d0, 0x6020, 0x9086, 0x0005, 0x19b0, 0x6004, 0x0006, 0x9086,
-	0x0085, 0x000e, 0x0d18, 0x9086, 0x008b, 0x0d00, 0x0860, 0x0006,
-	0x0066, 0x0096, 0x00b6, 0x00c6, 0x00d6, 0x7818, 0x905d, 0x0904,
-	0x87ff, 0xb854, 0x0006, 0x9006, 0xb856, 0xb85a, 0xb800, 0xc0d4,
-	0xc0dc, 0xb802, 0x080c, 0x6171, 0x0904, 0x87fc, 0x7e24, 0x86ff,
-	0x0904, 0x87ef, 0x9680, 0x0005, 0x2004, 0x9906, 0x1904, 0x87ef,
-	0x00d6, 0x2069, 0x0100, 0x68c0, 0x9005, 0x0904, 0x87e6, 0x080c,
-	0x80b8, 0x080c, 0x93ac, 0x68c3, 0x0000, 0x080c, 0x98da, 0x7827,
-	0x0000, 0x0036, 0x2069, 0x0140, 0x6b04, 0x9384, 0x1000, 0x0138,
-	0x2001, 0x0100, 0x080c, 0x2b14, 0x9006, 0x080c, 0x2b14, 0x2069,
-	0x0100, 0x6824, 0xd084, 0x0110, 0x6827, 0x0001, 0x003e, 0x00de,
-	0x00c6, 0x3e08, 0x918e, 0x0002, 0x1168, 0xb800, 0xd0bc, 0x0150,
-	0x9680, 0x0010, 0x200c, 0x81ff, 0x1518, 0x2009, 0x1959, 0x210c,
-	0x2102, 0x00f0, 0xb83c, 0x9005, 0x0110, 0x8001, 0xb83e, 0x2660,
-	0x600f, 0x0000, 0x080c, 0x9e62, 0x00ce, 0x0048, 0x00de, 0x00c6,
-	0x2660, 0x6003, 0x0009, 0x630a, 0x00ce, 0x0804, 0x8792, 0x89ff,
-	0x0138, 0xa867, 0x0103, 0xab7a, 0xa877, 0x0000, 0x080c, 0x688c,
-	0x080c, 0x97b0, 0x0804, 0x8792, 0x000e, 0x0804, 0x8786, 0x781e,
-	0x781a, 0x00de, 0x00ce, 0x00be, 0x009e, 0x006e, 0x000e, 0x0005,
-	0x00e6, 0x00d6, 0x0096, 0x0066, 0xb800, 0xd0dc, 0x01a0, 0xb84c,
-	0x904d, 0x0188, 0xa878, 0x9606, 0x1170, 0x2071, 0x19b8, 0x7024,
-	0x9035, 0x0148, 0x9080, 0x0005, 0x2004, 0x9906, 0x1120, 0xb800,
-	0xc0dc, 0xb802, 0x0029, 0x006e, 0x009e, 0x00de, 0x00ee, 0x0005,
-	0x00f6, 0x2079, 0x0100, 0x78c0, 0x9005, 0x1138, 0x00c6, 0x2660,
-	0x6003, 0x0009, 0x630a, 0x00ce, 0x04b8, 0x080c, 0x93ac, 0x78c3,
-	0x0000, 0x080c, 0x98da, 0x7027, 0x0000, 0x0036, 0x2079, 0x0140,
-	0x7b04, 0x9384, 0x1000, 0x0138, 0x2001, 0x0100, 0x080c, 0x2b14,
-	0x9006, 0x080c, 0x2b14, 0x2079, 0x0100, 0x7824, 0xd084, 0x0110,
-	0x7827, 0x0001, 0x080c, 0x98da, 0x003e, 0x080c, 0x6171, 0x00c6,
-	0xb83c, 0x9005, 0x0110, 0x8001, 0xb83e, 0x2660, 0x080c, 0x9e32,
-	0x00ce, 0xa867, 0x0103, 0xab7a, 0xa877, 0x0000, 0x080c, 0xbe06,
-	0x080c, 0x688c, 0x080c, 0x97b0, 0x00fe, 0x0005, 0x00b6, 0x00e6,
-	0x00c6, 0x2011, 0x0101, 0x2204, 0xc0c4, 0x2012, 0x2001, 0x180c,
-	0x2014, 0xc2e4, 0x2202, 0x2071, 0x19b8, 0x7004, 0x9084, 0x0007,
-	0x0002, 0x888b, 0x888f, 0x88a6, 0x88cf, 0x890d, 0x888b, 0x88a6,
-	0x8889, 0x080c, 0x0db4, 0x00ce, 0x00ee, 0x00be, 0x0005, 0x7024,
-	0x9065, 0x0148, 0x7020, 0x8001, 0x7022, 0x600c, 0x9015, 0x0158,
-	0x7216, 0x600f, 0x0000, 0x7007, 0x0000, 0x7027, 0x0000, 0x00ce,
-	0x00ee, 0x00be, 0x0005, 0x7216, 0x7212, 0x0ca8, 0x6010, 0x2058,
-	0x080c, 0x6171, 0xb800, 0xc0dc, 0xb802, 0x7007, 0x0000, 0x7027,
-	0x0000, 0x7020, 0x8001, 0x7022, 0x1148, 0x2001, 0x180c, 0x2014,
-	0xd2ec, 0x1180, 0x00ce, 0x00ee, 0x00be, 0x0005, 0xb854, 0x9015,
-	0x0120, 0x721e, 0x080c, 0x8973, 0x0ca8, 0x7218, 0x721e, 0x080c,
-	0x8973, 0x0c80, 0xc2ec, 0x2202, 0x080c, 0x8a4e, 0x0c58, 0x7024,
-	0x9065, 0x05b8, 0x700c, 0x9c06, 0x1160, 0x080c, 0x97b0, 0x600c,
-	0x9015, 0x0120, 0x720e, 0x600f, 0x0000, 0x0448, 0x720e, 0x720a,
-	0x0430, 0x7014, 0x9c06, 0x1160, 0x080c, 0x97b0, 0x600c, 0x9015,
-	0x0120, 0x7216, 0x600f, 0x0000, 0x00d0, 0x7216, 0x7212, 0x00b8,
-	0x6020, 0x9086, 0x0003, 0x1198, 0x6010, 0x2058, 0x080c, 0x6171,
-	0xb800, 0xc0dc, 0xb802, 0x080c, 0x97b0, 0x701c, 0x9065, 0x0138,
-	0xb854, 0x9015, 0x0110, 0x721e, 0x0010, 0x7218, 0x721e, 0x7027,
-	0x0000, 0x00ce, 0x00ee, 0x00be, 0x0005, 0x7024, 0x9065, 0x0140,
-	0x080c, 0x97b0, 0x600c, 0x9015, 0x0158, 0x720e, 0x600f, 0x0000,
-	0x080c, 0x98da, 0x7027, 0x0000, 0x00ce, 0x00ee, 0x00be, 0x0005,
-	0x720e, 0x720a, 0x0ca8, 0x00d6, 0x2069, 0x19b8, 0x6830, 0x9084,
-	0x0003, 0x0002, 0x8930, 0x8932, 0x8956, 0x892e, 0x080c, 0x0db4,
-	0x00de, 0x0005, 0x00c6, 0x6840, 0x9086, 0x0001, 0x01b8, 0x683c,
-	0x9065, 0x0130, 0x600c, 0x9015, 0x0170, 0x6a3a, 0x600f, 0x0000,
-	0x6833, 0x0000, 0x683f, 0x0000, 0x2011, 0x19d7, 0x2013, 0x0000,
-	0x00ce, 0x00de, 0x0005, 0x683a, 0x6836, 0x0c90, 0x6843, 0x0000,
-	0x6838, 0x9065, 0x0d68, 0x6003, 0x0003, 0x0c50, 0x00c6, 0x9006,
-	0x6842, 0x6846, 0x684a, 0x683c, 0x9065, 0x0160, 0x600c, 0x9015,
-	0x0130, 0x6a3a, 0x600f, 0x0000, 0x683f, 0x0000, 0x0018, 0x683e,
-	0x683a, 0x6836, 0x00ce, 0x00de, 0x0005, 0x2001, 0x180c, 0x200c,
-	0xc1e5, 0x2102, 0x0005, 0x2001, 0x180c, 0x200c, 0xd1ec, 0x0120,
-	0xc1ec, 0x2102, 0x080c, 0x8a4e, 0x2001, 0x19c4, 0x2004, 0x9086,
-	0x0001, 0x0d58, 0x00d6, 0x2069, 0x19b8, 0x6804, 0x9084, 0x0007,
-	0x0002, 0x8993, 0x8a36, 0x8a36, 0x8a36, 0x8a36, 0x8a38, 0x8a36,
-	0x8991, 0x080c, 0x0db4, 0x6820, 0x9005, 0x1110, 0x00de, 0x0005,
-	0x00c6, 0x680c, 0x9065, 0x0150, 0x6807, 0x0004, 0x6826, 0x682b,
-	0x0000, 0x080c, 0x8aa4, 0x00ce, 0x00de, 0x0005, 0x6814, 0x9065,
-	0x0150, 0x6807, 0x0001, 0x6826, 0x682b, 0x0000, 0x080c, 0x8aa4,
-	0x00ce, 0x00de, 0x0005, 0x00b6, 0x00e6, 0x6a1c, 0x92dd, 0x0000,
-	0x0904, 0x8a22, 0xb84c, 0x900d, 0x0118, 0xb888, 0x9005, 0x01a0,
-	0xb854, 0x905d, 0x0120, 0x920e, 0x0904, 0x8a22, 0x0028, 0x6818,
-	0x920e, 0x0904, 0x8a22, 0x2058, 0xb84c, 0x900d, 0x0d88, 0xb888,
-	0x9005, 0x1d70, 0x2b00, 0x681e, 0xbb3c, 0xb838, 0x9302, 0x1e40,
-	0x080c, 0x9e09, 0x0904, 0x8a22, 0x8318, 0xbb3e, 0x6116, 0x2b10,
-	0x6212, 0x0096, 0x2148, 0xa880, 0x9084, 0x00ff, 0x605e, 0xa883,
-	0x0000, 0xa884, 0x009e, 0x908a, 0x199a, 0x0210, 0x2001, 0x1999,
-	0x8003, 0x801b, 0x831b, 0x9318, 0x631a, 0x6114, 0x0096, 0x2148,
-	0xa964, 0x009e, 0x918c, 0x00ff, 0x918e, 0x0048, 0x0538, 0x00f6,
-	0x2c78, 0x2061, 0x0100, 0xbab0, 0x629a, 0x2069, 0x0200, 0x2071,
-	0x0240, 0x080c, 0x8fdc, 0x2069, 0x19b8, 0xbb00, 0xc3dd, 0xbb02,
-	0x6807, 0x0002, 0x2f18, 0x6b26, 0x682b, 0x0000, 0x7823, 0x0003,
-	0x7803, 0x0001, 0x7807, 0x0040, 0x00fe, 0x00ee, 0x00be, 0x00ce,
-	0x00de, 0x0005, 0x00ee, 0x00be, 0x00ce, 0x0cd0, 0xbb00, 0xc3dd,
-	0xbb02, 0x6807, 0x0006, 0x2f18, 0x6b26, 0x682b, 0x0000, 0x080c,
-	0x9c63, 0x00ee, 0x00be, 0x00ce, 0x00de, 0x0005, 0x00de, 0x0005,
-	0x00c6, 0x680c, 0x9065, 0x0138, 0x6807, 0x0004, 0x6826, 0x682b,
-	0x0000, 0x080c, 0x8aa4, 0x00ce, 0x00de, 0x0005, 0x2001, 0x180c,
-	0x2014, 0xc2ed, 0x2202, 0x00de, 0x00fe, 0x0005, 0x00f6, 0x00d6,
-	0x2069, 0x19b8, 0x6830, 0x9086, 0x0000, 0x1548, 0x2001, 0x180c,
-	0x2014, 0xd2e4, 0x0130, 0xc2e4, 0x2202, 0x080c, 0x8982, 0x2069,
-	0x19b8, 0x2001, 0x180c, 0x200c, 0xd1c4, 0x11e0, 0x6838, 0x907d,
-	0x01b0, 0x6a04, 0x9296, 0x0000, 0x1588, 0x6833, 0x0001, 0x683e,
-	0x6847, 0x0000, 0x684b, 0x0000, 0x0126, 0x00f6, 0x2091, 0x2400,
-	0x002e, 0x080c, 0x1ae8, 0x1178, 0x012e, 0x080c, 0x9209, 0x00de,
-	0x00fe, 0x0005, 0xc1c4, 0x2102, 0x0066, 0x2031, 0x0001, 0x080c,
-	0x7062, 0x006e, 0x08d8, 0x012e, 0x6843, 0x0000, 0x7803, 0x0002,
-	0x780c, 0x9015, 0x0140, 0x6a3a, 0x780f, 0x0000, 0x6833, 0x0000,
-	0x683f, 0x0000, 0x0c20, 0x683a, 0x6836, 0x0cc0, 0x6a04, 0x9296,
-	0x0006, 0x0958, 0x0804, 0x8a46, 0x6020, 0x9084, 0x000f, 0x000b,
-	0x0005, 0x8ab8, 0x8abd, 0x8f16, 0x8fa5, 0x8abd, 0x8f16, 0x8fa5,
-	0x8ab8, 0x8abd, 0x8ab8, 0x8ab8, 0x8ab8, 0x8ab8, 0x8ab8, 0x8ab8,
-	0x080c, 0x886e, 0x080c, 0x8973, 0x0005, 0x00b6, 0x0156, 0x0136,
-	0x0146, 0x01c6, 0x01d6, 0x00c6, 0x00d6, 0x00e6, 0x00f6, 0x2069,
-	0x0200, 0x2071, 0x0240, 0x6004, 0x908a, 0x0053, 0x1a0c, 0x0db4,
-	0x6110, 0x2158, 0xb9b0, 0x2c78, 0x2061, 0x0100, 0x619a, 0x908a,
-	0x0040, 0x1a04, 0x8b29, 0x005b, 0x00fe, 0x00ee, 0x00de, 0x00ce,
-	0x01de, 0x01ce, 0x014e, 0x013e, 0x015e, 0x00be, 0x0005, 0x8ca0,
-	0x8cdb, 0x8d04, 0x8da7, 0x8dc8, 0x8dce, 0x8ddb, 0x8de3, 0x8def,
-	0x8df5, 0x8e06, 0x8df5, 0x8e5d, 0x8de3, 0x8e69, 0x8e6f, 0x8def,
-	0x8e6f, 0x8e7b, 0x8b27, 0x8b27, 0x8b27, 0x8b27, 0x8b27, 0x8b27,
-	0x8b27, 0x8b27, 0x8b27, 0x8b27, 0x8b27, 0x958f, 0x95b2, 0x95c3,
-	0x95e3, 0x9615, 0x8ddb, 0x8b27, 0x8ddb, 0x8df5, 0x8b27, 0x8d04,
-	0x8da7, 0x8b27, 0x99c7, 0x8df5, 0x8b27, 0x99e3, 0x8df5, 0x8b27,
-	0x8def, 0x8c9a, 0x8b4a, 0x8b27, 0x99ff, 0x9a6c, 0x9b43, 0x8b27,
-	0x9b50, 0x8dd8, 0x9b7b, 0x8b27, 0x961f, 0x9ba8, 0x8b27, 0x080c,
-	0x0db4, 0x2100, 0x005b, 0x00fe, 0x00ee, 0x00de, 0x00ce, 0x01de,
-	0x01ce, 0x014e, 0x013e, 0x015e, 0x00be, 0x0005, 0x8b48, 0x8b48,
-	0x8b48, 0x8b71, 0x8c1d, 0x8c28, 0x8b48, 0x8b48, 0x8b48, 0x8c6f,
-	0x8c7b, 0x8b8c, 0x8b48, 0x8ba7, 0x8bdb, 0x9d25, 0x9d6a, 0x8df5,
-	0x080c, 0x0db4, 0x00d6, 0x0096, 0x080c, 0x8e8e, 0x7003, 0x2414,
-	0x7007, 0x0018, 0x700b, 0x0800, 0x7814, 0x2048, 0xa83c, 0x700e,
-	0xa850, 0x7022, 0xa854, 0x7026, 0x60c3, 0x0018, 0x080c, 0x9380,
-	0x009e, 0x00de, 0x0005, 0x7810, 0x00b6, 0x2058, 0xb8a0, 0x00be,
-	0x080c, 0x9db1, 0x1118, 0x9084, 0xff80, 0x0110, 0x9085, 0x0001,
-	0x0005, 0x00d6, 0x0096, 0x080c, 0x8e8e, 0x7003, 0x0500, 0x7814,
-	0x2048, 0xa874, 0x700a, 0xa878, 0x700e, 0xa87c, 0x7012, 0xa880,
-	0x7016, 0xa884, 0x701a, 0xa888, 0x701e, 0x60c3, 0x0010, 0x080c,
-	0x9380, 0x009e, 0x00de, 0x0005, 0x00d6, 0x0096, 0x080c, 0x8e8e,
-	0x7003, 0x0500, 0x7814, 0x2048, 0xa8cc, 0x700a, 0xa8d0, 0x700e,
-	0xa8d4, 0x7012, 0xa8d8, 0x7016, 0xa8dc, 0x701a, 0xa8e0, 0x701e,
-	0x60c3, 0x0010, 0x080c, 0x9380, 0x009e, 0x00de, 0x0005, 0x00d6,
-	0x0096, 0x0126, 0x2091, 0x8000, 0x080c, 0x8e8e, 0x20e9, 0x0000,
-	0x2001, 0x1974, 0x2003, 0x0000, 0x7814, 0x2048, 0xa814, 0x8003,
-	0x60c2, 0xa830, 0x20a8, 0xa860, 0x20e0, 0xa85c, 0x9080, 0x001b,
-	0x2098, 0x2001, 0x1974, 0x0016, 0x200c, 0x2001, 0x0001, 0x080c,
-	0x224d, 0x080c, 0xc81a, 0x9006, 0x080c, 0x224d, 0x001e, 0xa804,
-	0x9005, 0x0110, 0x2048, 0x0c28, 0x04d9, 0x080c, 0x9380, 0x012e,
-	0x009e, 0x00de, 0x0005, 0x00d6, 0x0096, 0x0126, 0x2091, 0x8000,
-	0x080c, 0x8ed9, 0x20e9, 0x0000, 0x2001, 0x1974, 0x2003, 0x0000,
-	0x7814, 0x2048, 0xa86f, 0x0200, 0xa873, 0x0000, 0xa814, 0x8003,
-	0x60c2, 0xa830, 0x20a8, 0xa860, 0x20e0, 0xa85c, 0x9080, 0x001b,
-	0x2098, 0x2001, 0x1974, 0x0016, 0x200c, 0x080c, 0xc81a, 0x001e,
-	0xa804, 0x9005, 0x0110, 0x2048, 0x0c60, 0x0051, 0x7814, 0x2048,
-	0x080c, 0x0f9d, 0x080c, 0x9380, 0x012e, 0x009e, 0x00de, 0x0005,
-	0x60c0, 0x8004, 0x9084, 0x0003, 0x9005, 0x0130, 0x9082, 0x0004,
-	0x20a3, 0x0000, 0x8000, 0x1de0, 0x0005, 0x080c, 0x8e8e, 0x7003,
-	0x7800, 0x7808, 0x8007, 0x700a, 0x60c3, 0x0008, 0x0804, 0x9380,
-	0x00d6, 0x00e6, 0x080c, 0x8ed9, 0x7814, 0x9084, 0xff00, 0x2073,
-	0x0200, 0x8e70, 0x8e70, 0x9095, 0x0010, 0x2272, 0x8e70, 0x2073,
-	0x0034, 0x8e70, 0x2069, 0x1805, 0x20a9, 0x0004, 0x2d76, 0x8d68,
-	0x8e70, 0x1f04, 0x8c3e, 0x2069, 0x1801, 0x20a9, 0x0004, 0x2d76,
-	0x8d68, 0x8e70, 0x1f04, 0x8c47, 0x2069, 0x1984, 0x9086, 0xdf00,
-	0x0110, 0x2069, 0x199e, 0x20a9, 0x001a, 0x9e86, 0x0260, 0x1148,
-	0x00c6, 0x2061, 0x0200, 0x6010, 0x8000, 0x6012, 0x00ce, 0x2071,
-	0x0240, 0x2d04, 0x8007, 0x2072, 0x8d68, 0x8e70, 0x1f04, 0x8c55,
-	0x60c3, 0x004c, 0x080c, 0x9380, 0x00ee, 0x00de, 0x0005, 0x080c,
-	0x8e8e, 0x7003, 0x6300, 0x7007, 0x0028, 0x7808, 0x700e, 0x60c3,
-	0x0008, 0x0804, 0x9380, 0x00d6, 0x0026, 0x0016, 0x080c, 0x8ed9,
-	0x7003, 0x0200, 0x7814, 0x700e, 0x00e6, 0x9ef0, 0x0004, 0x2009,
-	0x0001, 0x2011, 0x000c, 0x2073, 0x0800, 0x8e70, 0x2073, 0x0000,
-	0x00ee, 0x7206, 0x710a, 0x62c2, 0x080c, 0x9380, 0x001e, 0x002e,
-	0x00de, 0x0005, 0x2001, 0x1817, 0x2004, 0x609a, 0x0804, 0x9380,
-	0x080c, 0x8e8e, 0x7003, 0x5200, 0x2069, 0x1853, 0x6804, 0xd084,
-	0x0130, 0x6828, 0x0016, 0x080c, 0x2696, 0x710e, 0x001e, 0x20a9,
-	0x0004, 0x20e1, 0x0001, 0x2099, 0x1805, 0x20e9, 0x0000, 0x20a1,
-	0x0250, 0x4003, 0x20a9, 0x0004, 0x2099, 0x1801, 0x20a1, 0x0254,
-	0x4003, 0x080c, 0x9db1, 0x1120, 0xb8a0, 0x9082, 0x007f, 0x0248,
-	0x2001, 0x181e, 0x2004, 0x7032, 0x2001, 0x181f, 0x2004, 0x7036,
-	0x0030, 0x2001, 0x1817, 0x2004, 0x9084, 0x00ff, 0x7036, 0x60c3,
-	0x001c, 0x0804, 0x9380, 0x080c, 0x8e8e, 0x7003, 0x0500, 0x080c,
-	0x9db1, 0x1120, 0xb8a0, 0x9082, 0x007f, 0x0248, 0x2001, 0x181e,
-	0x2004, 0x700a, 0x2001, 0x181f, 0x2004, 0x700e, 0x0030, 0x2001,
-	0x1817, 0x2004, 0x9084, 0x00ff, 0x700e, 0x20a9, 0x0004, 0x20e1,
-	0x0001, 0x2099, 0x1805, 0x20e9, 0x0000, 0x20a1, 0x0250, 0x4003,
-	0x60c3, 0x0010, 0x0804, 0x9380, 0x080c, 0x8e8e, 0x9006, 0x080c,
-	0x652c, 0xb8a0, 0x9086, 0x007e, 0x1130, 0x7003, 0x0400, 0x620c,
-	0xc2b4, 0x620e, 0x0058, 0x7814, 0x0096, 0x904d, 0x0120, 0x9006,
-	0xa89a, 0xa8a6, 0xa8aa, 0x009e, 0x7003, 0x0300, 0xb8a0, 0x9086,
-	0x007e, 0x1904, 0x8d6f, 0x00d6, 0x2069, 0x193d, 0x2001, 0x1836,
-	0x2004, 0xd0a4, 0x0178, 0x6800, 0x700a, 0x6808, 0x9084, 0x2000,
-	0x7012, 0x680c, 0x7016, 0x701f, 0x2710, 0x6818, 0x7022, 0x681c,
-	0x7026, 0x0080, 0x6800, 0x700a, 0x6804, 0x700e, 0x6808, 0x080c,
-	0x6fb2, 0x1118, 0x9084, 0x37ff, 0x0010, 0x9084, 0x3fff, 0x7012,
-	0x680c, 0x7016, 0x00de, 0x20a9, 0x0004, 0x20e1, 0x0001, 0x2099,
-	0x1805, 0x20e9, 0x0000, 0x20a1, 0x0256, 0x4003, 0x20a9, 0x0004,
-	0x2099, 0x1801, 0x20a1, 0x025a, 0x4003, 0x00d6, 0x080c, 0x9c2a,
-	0x2069, 0x1945, 0x2071, 0x024e, 0x6800, 0xc0dd, 0x7002, 0x080c,
-	0x538a, 0xd0e4, 0x0110, 0x680c, 0x700e, 0x00de, 0x04a0, 0x2001,
-	0x1836, 0x2004, 0xd0a4, 0x0168, 0x0016, 0x2009, 0x0002, 0x60e0,
-	0x9106, 0x0130, 0x2100, 0x60e3, 0x0000, 0x080c, 0x26d7, 0x61e2,
-	0x001e, 0x20e1, 0x0001, 0x2099, 0x193d, 0x20e9, 0x0000, 0x20a1,
-	0x024e, 0x20a9, 0x0008, 0x4003, 0x20a9, 0x0004, 0x2099, 0x1805,
-	0x20a1, 0x0256, 0x4003, 0x20a9, 0x0004, 0x2099, 0x1801, 0x20a1,
-	0x025a, 0x4003, 0x080c, 0x9c2a, 0x20a1, 0x024e, 0x20a9, 0x0008,
-	0x2099, 0x1945, 0x4003, 0x60c3, 0x0074, 0x0804, 0x9380, 0x080c,
-	0x8e8e, 0x7003, 0x2010, 0x7007, 0x0014, 0x700b, 0x0800, 0x700f,
-	0x2000, 0x9006, 0x00f6, 0x2079, 0x1853, 0x7904, 0x00fe, 0xd1ac,
-	0x1110, 0x9085, 0x0020, 0x0010, 0x9085, 0x0010, 0x9085, 0x0002,
-	0x00d6, 0x0804, 0x8e3e, 0x7026, 0x60c3, 0x0014, 0x0804, 0x9380,
-	0x080c, 0x8e8e, 0x7003, 0x5000, 0x0804, 0x8d1e, 0x080c, 0x8e8e,
-	0x7003, 0x2110, 0x7007, 0x0014, 0x60c3, 0x0014, 0x0804, 0x9380,
-	0x080c, 0x8ed0, 0x0010, 0x080c, 0x8ed9, 0x7003, 0x0200, 0x60c3,
-	0x0004, 0x0804, 0x9380, 0x080c, 0x8ed9, 0x7003, 0x0100, 0x700b,
-	0x0003, 0x700f, 0x2a00, 0x60c3, 0x0008, 0x0804, 0x9380, 0x080c,
-	0x8ed9, 0x7003, 0x0200, 0x0804, 0x8d1e, 0x080c, 0x8ed9, 0x7003,
-	0x0100, 0x782c, 0x9005, 0x0110, 0x700a, 0x0010, 0x700b, 0x0003,
-	0x7814, 0x700e, 0x60c3, 0x0008, 0x0804, 0x9380, 0x00d6, 0x080c,
-	0x8ed9, 0x7003, 0x0210, 0x7007, 0x0014, 0x700b, 0x0800, 0xb894,
-	0x9086, 0x0014, 0x1198, 0xb99c, 0x9184, 0x0030, 0x0190, 0xb998,
-	0x9184, 0xc000, 0x1140, 0xd1ec, 0x0118, 0x700f, 0x2100, 0x0058,
-	0x700f, 0x0100, 0x0040, 0x700f, 0x0400, 0x0028, 0x700f, 0x0700,
-	0x0010, 0x700f, 0x0800, 0x00f6, 0x2079, 0x1853, 0x7904, 0x00fe,
-	0xd1ac, 0x1110, 0x9085, 0x0020, 0x0010, 0x9085, 0x0010, 0x2009,
-	0x1875, 0x210c, 0xd184, 0x1110, 0x9085, 0x0002, 0x0026, 0x2009,
-	0x1873, 0x210c, 0xd1e4, 0x0150, 0xc0c5, 0xbabc, 0xd28c, 0x1108,
-	0xc0cd, 0x9094, 0x0030, 0x9296, 0x0010, 0x0140, 0xd1ec, 0x0130,
-	0x9094, 0x0030, 0x9296, 0x0010, 0x0108, 0xc0bd, 0x002e, 0x7026,
-	0x60c3, 0x0014, 0x00de, 0x0804, 0x9380, 0x080c, 0x8ed9, 0x7003,
-	0x0210, 0x7007, 0x0014, 0x700f, 0x0100, 0x60c3, 0x0014, 0x0804,
-	0x9380, 0x080c, 0x8ed9, 0x7003, 0x0200, 0x0804, 0x8ca4, 0x080c,
-	0x8ed9, 0x7003, 0x0100, 0x700b, 0x0003, 0x700f, 0x2a00, 0x60c3,
-	0x0008, 0x0804, 0x9380, 0x080c, 0x8ed9, 0x7003, 0x0100, 0x700b,
-	0x000b, 0x60c3, 0x0008, 0x0804, 0x9380, 0x0026, 0x00d6, 0x0036,
-	0x0046, 0x2019, 0x3200, 0x2021, 0x0800, 0x0040, 0x0026, 0x00d6,
-	0x0036, 0x0046, 0x2019, 0x2200, 0x2021, 0x0100, 0x080c, 0x9c3f,
-	0xb810, 0x9305, 0x7002, 0xb814, 0x7006, 0x2069, 0x1800, 0x6878,
-	0x700a, 0x687c, 0x700e, 0x9485, 0x0029, 0x7012, 0x004e, 0x003e,
-	0x00de, 0x080c, 0x936e, 0x721a, 0x9f95, 0x0000, 0x7222, 0x7027,
-	0xffff, 0x2071, 0x024c, 0x002e, 0x0005, 0x0026, 0x080c, 0x9c3f,
-	0x7003, 0x02ff, 0x7007, 0xfffc, 0x00d6, 0x2069, 0x1800, 0x6878,
-	0x700a, 0x687c, 0x700e, 0x00de, 0x7013, 0x2029, 0x0c10, 0x7003,
-	0x0100, 0x7007, 0x0000, 0x700b, 0xfc02, 0x700f, 0x0000, 0x0005,
-	0x0026, 0x00d6, 0x0036, 0x0046, 0x2019, 0x3300, 0x2021, 0x0800,
-	0x0040, 0x0026, 0x00d6, 0x0036, 0x0046, 0x2019, 0x2300, 0x2021,
-	0x0100, 0x080c, 0x9c3f, 0xb810, 0x9305, 0x7002, 0xb814, 0x7006,
-	0x2069, 0x1800, 0xb810, 0x9005, 0x1140, 0xb814, 0x9005, 0x1128,
-	0x700b, 0x00ff, 0x700f, 0xfffe, 0x0020, 0x6878, 0x700a, 0x687c,
-	0x700e, 0x0000, 0x9485, 0x0098, 0x7012, 0x004e, 0x003e, 0x00de,
-	0x080c, 0x936e, 0x721a, 0x7a08, 0x7222, 0x2f10, 0x7226, 0x2071,
-	0x024c, 0x002e, 0x0005, 0x080c, 0x936e, 0x721a, 0x7a08, 0x7222,
-	0x7814, 0x7026, 0x2071, 0x024c, 0x002e, 0x0005, 0x00b6, 0x00c6,
-	0x00d6, 0x00e6, 0x00f6, 0x2069, 0x0200, 0x2071, 0x0240, 0x6004,
-	0x908a, 0x0085, 0x0a0c, 0x0db4, 0x908a, 0x0092, 0x1a0c, 0x0db4,
-	0x6110, 0x2158, 0xb9b0, 0x2c78, 0x2061, 0x0100, 0x619a, 0x9082,
-	0x0085, 0x0033, 0x00fe, 0x00ee, 0x00de, 0x00ce, 0x00be, 0x0005,
-	0x8f47, 0x8f56, 0x8f61, 0x8f45, 0x8f45, 0x8f45, 0x8f47, 0x8f45,
-	0x8f45, 0x8f45, 0x8f45, 0x8f45, 0x8f45, 0x080c, 0x0db4, 0x0411,
-	0x60c3, 0x0000, 0x0026, 0x080c, 0x29ca, 0x0228, 0x2011, 0x0101,
-	0x2204, 0xc0c5, 0x2012, 0x002e, 0x0804, 0x9380, 0x0431, 0x7808,
-	0x700a, 0x7814, 0x700e, 0x7017, 0xffff, 0x60c3, 0x000c, 0x0804,
-	0x9380, 0x0479, 0x7003, 0x0003, 0x7007, 0x0300, 0x60c3, 0x0004,
-	0x0804, 0x9380, 0x0026, 0x080c, 0x9c3f, 0xb810, 0x9085, 0x8100,
+	0x080c, 0x9ebc, 0x00ce, 0x0005, 0x00c6, 0x7824, 0x9065, 0x090c,
+	0x0db4, 0x7828, 0x9092, 0xc350, 0x12c0, 0x8000, 0x782a, 0x00ce,
+	0x080c, 0x29cc, 0x0278, 0x00c6, 0x7924, 0x2160, 0x6010, 0x906d,
+	0x090c, 0x0db4, 0x7807, 0x0000, 0x7827, 0x0000, 0x00ce, 0x080c,
+	0x896d, 0x0c00, 0x080c, 0x9389, 0x08e8, 0x2011, 0x0130, 0x2214,
+	0x080c, 0x9c4e, 0x080c, 0xd8ea, 0x2009, 0x0014, 0x080c, 0x9ebc,
+	0x00ce, 0x0880, 0x2001, 0x19d3, 0x2003, 0x0000, 0x62c0, 0x82ff,
+	0x1160, 0x782b, 0x0000, 0x7824, 0x9065, 0x090c, 0x0db4, 0x2009,
+	0x0013, 0x080c, 0x9f0e, 0x00ce, 0x0005, 0x00b6, 0x00c6, 0x00d6,
+	0x7824, 0x9005, 0x090c, 0x0db4, 0x7828, 0x9092, 0xc350, 0x1648,
+	0x8000, 0x782a, 0x00de, 0x00ce, 0x00be, 0x080c, 0x29cc, 0x02f0,
+	0x00b6, 0x00c6, 0x00d6, 0x781c, 0x905d, 0x090c, 0x0db4, 0xb800,
+	0xc0dc, 0xb802, 0x7924, 0x2160, 0x080c, 0x9e42, 0xb93c, 0x81ff,
+	0x090c, 0x0db4, 0x8109, 0xb93e, 0x7807, 0x0000, 0x7827, 0x0000,
+	0x00de, 0x00ce, 0x00be, 0x080c, 0x896d, 0x0868, 0x080c, 0x9389,
+	0x0850, 0x2011, 0x0130, 0x2214, 0x080c, 0x9c4e, 0x080c, 0xd8ea,
+	0x7824, 0x9065, 0x2009, 0x0014, 0x080c, 0x9ebc, 0x00de, 0x00ce,
+	0x00be, 0x0804, 0x834b, 0x00c6, 0x2001, 0x009b, 0x2004, 0xd0fc,
+	0x190c, 0x1d4c, 0x6024, 0x6027, 0x0002, 0xd0f4, 0x1580, 0x62c8,
+	0x60c4, 0x9205, 0x1170, 0x783c, 0x9065, 0x0130, 0x2009, 0x0049,
+	0x080c, 0x9ebc, 0x00ce, 0x0005, 0x2011, 0x19d6, 0x2013, 0x0000,
+	0x0cc8, 0x793c, 0x81ff, 0x0dc0, 0x7944, 0x9192, 0x7530, 0x12f0,
+	0x8108, 0x7946, 0x793c, 0x9188, 0x0008, 0x210c, 0x918e, 0x0006,
+	0x1138, 0x6014, 0x9084, 0x1984, 0x9085, 0x0012, 0x6016, 0x0c10,
+	0x6014, 0x9084, 0x1984, 0x9085, 0x0016, 0x6016, 0x08d8, 0x793c,
+	0x2160, 0x2009, 0x004a, 0x080c, 0x9ebc, 0x08a0, 0x7848, 0xc085,
+	0x784a, 0x0880, 0x0006, 0x0016, 0x00c6, 0x0126, 0x2091, 0x8000,
+	0x600f, 0x0000, 0x2c08, 0x2061, 0x19b7, 0x6020, 0x8000, 0x6022,
+	0x6010, 0x9005, 0x0148, 0x9080, 0x0003, 0x2102, 0x6112, 0x012e,
+	0x00ce, 0x001e, 0x000e, 0x0005, 0x6116, 0x6112, 0x0cc0, 0x00d6,
+	0x2069, 0x19b7, 0xb800, 0xd0d4, 0x0168, 0x6820, 0x8000, 0x6822,
+	0x9086, 0x0001, 0x1110, 0x2b00, 0x681e, 0x00de, 0x0804, 0x896d,
+	0x00de, 0x0005, 0xc0d5, 0xb802, 0x6818, 0x9005, 0x0168, 0xb856,
+	0xb85b, 0x0000, 0x0086, 0x0006, 0x2b00, 0x681a, 0x008e, 0xa05a,
+	0x008e, 0x2069, 0x19b7, 0x0c08, 0xb856, 0xb85a, 0x2b00, 0x681a,
+	0x681e, 0x08d8, 0x0006, 0x0016, 0x00c6, 0x0126, 0x2091, 0x8000,
+	0x600f, 0x0000, 0x2c08, 0x2061, 0x19b7, 0x6020, 0x8000, 0x6022,
+	0x6008, 0x9005, 0x0148, 0x9080, 0x0003, 0x2102, 0x610a, 0x012e,
+	0x00ce, 0x001e, 0x000e, 0x0005, 0x610e, 0x610a, 0x0cc0, 0x00c6,
+	0x600f, 0x0000, 0x2c08, 0x2061, 0x19b7, 0x6034, 0x9005, 0x0130,
+	0x9080, 0x0003, 0x2102, 0x6136, 0x00ce, 0x0005, 0x613a, 0x6136,
+	0x00ce, 0x0005, 0x00f6, 0x00e6, 0x00d6, 0x00c6, 0x00b6, 0x0096,
+	0x0076, 0x0066, 0x0056, 0x0036, 0x0026, 0x0016, 0x0006, 0x0126,
+	0x902e, 0x2071, 0x19b7, 0x7638, 0x2660, 0x2678, 0x2091, 0x8000,
+	0x8cff, 0x0904, 0x84ce, 0x6010, 0x2058, 0xb8a0, 0x9206, 0x1904,
+	0x84c9, 0x87ff, 0x0120, 0x6054, 0x9106, 0x1904, 0x84c9, 0x703c,
+	0x9c06, 0x1178, 0x0036, 0x2019, 0x0001, 0x080c, 0x96d9, 0x7033,
+	0x0000, 0x9006, 0x703e, 0x7042, 0x7046, 0x704a, 0x003e, 0x2029,
+	0x0001, 0x7038, 0x9c36, 0x1110, 0x660c, 0x763a, 0x7034, 0x9c36,
+	0x1140, 0x2c00, 0x9f36, 0x0118, 0x2f00, 0x7036, 0x0010, 0x7037,
+	0x0000, 0x660c, 0x0066, 0x2c00, 0x9f06, 0x0110, 0x7e0e, 0x0008,
+	0x2678, 0x600f, 0x0000, 0x080c, 0xbb2c, 0x01f0, 0x6014, 0x2048,
+	0x6020, 0x9086, 0x0003, 0x15b8, 0x6004, 0x9086, 0x0040, 0x090c,
+	0x98db, 0xa867, 0x0103, 0xab7a, 0xa877, 0x0000, 0x0016, 0x0036,
+	0x0076, 0x080c, 0xbe20, 0x080c, 0xd7f4, 0x080c, 0x6891, 0x007e,
+	0x003e, 0x001e, 0x080c, 0xbd15, 0x080c, 0x9e72, 0x00ce, 0x0804,
+	0x8468, 0x2c78, 0x600c, 0x2060, 0x0804, 0x8468, 0x85ff, 0x0120,
+	0x0036, 0x080c, 0x8a4a, 0x003e, 0x012e, 0x000e, 0x001e, 0x002e,
+	0x003e, 0x005e, 0x006e, 0x007e, 0x009e, 0x00be, 0x00ce, 0x00de,
+	0x00ee, 0x00fe, 0x0005, 0x6020, 0x9086, 0x0006, 0x1158, 0x0016,
+	0x0036, 0x0076, 0x080c, 0xd7f4, 0x080c, 0xd4f6, 0x007e, 0x003e,
+	0x001e, 0x0890, 0x6020, 0x9086, 0x000a, 0x0904, 0x84b3, 0x0804,
+	0x84ac, 0x0006, 0x0066, 0x0096, 0x00c6, 0x00d6, 0x00f6, 0x9036,
+	0x0126, 0x2091, 0x8000, 0x2079, 0x19b7, 0x7838, 0x9065, 0x0904,
+	0x854e, 0x600c, 0x0006, 0x600f, 0x0000, 0x783c, 0x9c06, 0x1168,
+	0x0036, 0x2019, 0x0001, 0x080c, 0x96d9, 0x7833, 0x0000, 0x901e,
+	0x7b3e, 0x7b42, 0x7b46, 0x7b4a, 0x003e, 0x080c, 0xbb2c, 0x0548,
+	0x6014, 0x2048, 0x6020, 0x9086, 0x0003, 0x1590, 0x3e08, 0x918e,
+	0x0002, 0x1188, 0x6010, 0x9005, 0x0170, 0x00b6, 0x2058, 0xb800,
+	0x00be, 0xd0bc, 0x0140, 0x6040, 0x9005, 0x11a8, 0x2001, 0x1958,
+	0x2004, 0x6042, 0x0080, 0x6004, 0x9086, 0x0040, 0x090c, 0x98db,
+	0xa867, 0x0103, 0xab7a, 0xa877, 0x0000, 0x080c, 0x6884, 0x080c,
+	0xbd15, 0x080c, 0x9e72, 0x000e, 0x0804, 0x8506, 0x7e3a, 0x7e36,
+	0x012e, 0x00fe, 0x00de, 0x00ce, 0x009e, 0x006e, 0x000e, 0x0005,
+	0x6020, 0x9086, 0x0006, 0x1118, 0x080c, 0xd4f6, 0x0c50, 0x6020,
+	0x9086, 0x000a, 0x09f8, 0x08b8, 0x0016, 0x0026, 0x0086, 0x9046,
+	0x0099, 0x080c, 0x864d, 0x008e, 0x002e, 0x001e, 0x0005, 0x00f6,
+	0x0126, 0x2079, 0x19b7, 0x2091, 0x8000, 0x080c, 0x86e4, 0x080c,
+	0x8772, 0x012e, 0x00fe, 0x0005, 0x00b6, 0x0096, 0x00f6, 0x00e6,
+	0x00d6, 0x00c6, 0x0066, 0x0016, 0x0006, 0x0126, 0x2091, 0x8000,
+	0x2071, 0x19b7, 0x7614, 0x2660, 0x2678, 0x8cff, 0x0904, 0x8612,
+	0x6010, 0x2058, 0xb8a0, 0x9206, 0x1904, 0x860d, 0x88ff, 0x0120,
+	0x6054, 0x9106, 0x1904, 0x860d, 0x7024, 0x9c06, 0x1558, 0x2069,
+	0x0100, 0x6820, 0xd0a4, 0x1508, 0x080c, 0x80a1, 0x080c, 0x93ad,
+	0x68c3, 0x0000, 0x080c, 0x98db, 0x7027, 0x0000, 0x0036, 0x2069,
+	0x0140, 0x6b04, 0x9384, 0x1000, 0x0138, 0x2001, 0x0100, 0x080c,
+	0x2b16, 0x9006, 0x080c, 0x2b16, 0x2069, 0x0100, 0x6824, 0xd084,
+	0x0110, 0x6827, 0x0001, 0x003e, 0x0028, 0x6003, 0x0009, 0x630a,
+	0x0804, 0x860d, 0x7014, 0x9c36, 0x1110, 0x660c, 0x7616, 0x7010,
+	0x9c36, 0x1140, 0x2c00, 0x9f36, 0x0118, 0x2f00, 0x7012, 0x0010,
+	0x7013, 0x0000, 0x660c, 0x0066, 0x2c00, 0x9f06, 0x0110, 0x7e0e,
+	0x0008, 0x2678, 0x600f, 0x0000, 0x6014, 0x2048, 0x080c, 0xbb2c,
+	0x01e8, 0x6020, 0x9086, 0x0003, 0x1580, 0x080c, 0xbd32, 0x1118,
+	0x080c, 0xa7d1, 0x0098, 0xa867, 0x0103, 0xab7a, 0xa877, 0x0000,
+	0x0016, 0x0036, 0x0086, 0x080c, 0xbe20, 0x080c, 0xd7f4, 0x080c,
+	0x6891, 0x008e, 0x003e, 0x001e, 0x080c, 0xbd15, 0x080c, 0x9e72,
+	0x080c, 0x97b1, 0x00ce, 0x0804, 0x858d, 0x2c78, 0x600c, 0x2060,
+	0x0804, 0x858d, 0x012e, 0x000e, 0x001e, 0x006e, 0x00ce, 0x00de,
+	0x00ee, 0x00fe, 0x009e, 0x00be, 0x0005, 0x6020, 0x9086, 0x0006,
+	0x1158, 0x0016, 0x0036, 0x0086, 0x080c, 0xd7f4, 0x080c, 0xd4f6,
+	0x008e, 0x003e, 0x001e, 0x08d0, 0x080c, 0xa7d1, 0x6020, 0x9086,
+	0x0002, 0x1160, 0x6004, 0x0006, 0x9086, 0x0085, 0x000e, 0x0904,
+	0x85f3, 0x9086, 0x008b, 0x0904, 0x85f3, 0x0840, 0x6020, 0x9086,
+	0x0005, 0x1920, 0x6004, 0x0006, 0x9086, 0x0085, 0x000e, 0x09c8,
+	0x9086, 0x008b, 0x09b0, 0x0804, 0x8606, 0x00b6, 0x00a6, 0x0096,
+	0x00c6, 0x0006, 0x0126, 0x2091, 0x8000, 0x9280, 0x1000, 0x2004,
+	0x905d, 0x0904, 0x86dd, 0x00f6, 0x00e6, 0x00d6, 0x0066, 0x2071,
+	0x19b7, 0xbe54, 0x7018, 0x9b06, 0x1108, 0x761a, 0x701c, 0x9b06,
+	0x1130, 0x86ff, 0x1118, 0x7018, 0x701e, 0x0008, 0x761e, 0xb858,
+	0x904d, 0x0108, 0xae56, 0x96d5, 0x0000, 0x0110, 0x2900, 0xb05a,
+	0xb857, 0x0000, 0xb85b, 0x0000, 0xb800, 0xc0d4, 0xc0dc, 0xb802,
+	0x080c, 0x617a, 0x0904, 0x86d9, 0x7624, 0x86ff, 0x0904, 0x86c8,
+	0x9680, 0x0005, 0x2004, 0x9906, 0x15d8, 0x00d6, 0x2069, 0x0100,
+	0x68c0, 0x9005, 0x0560, 0x080c, 0x80a1, 0x080c, 0x93ad, 0x68c3,
+	0x0000, 0x080c, 0x98db, 0x7027, 0x0000, 0x0036, 0x2069, 0x0140,
+	0x6b04, 0x9384, 0x1000, 0x0138, 0x2001, 0x0100, 0x080c, 0x2b16,
+	0x9006, 0x080c, 0x2b16, 0x2069, 0x0100, 0x6824, 0xd084, 0x0110,
+	0x6827, 0x0001, 0x003e, 0x00de, 0x00c6, 0xb83c, 0x9005, 0x0110,
+	0x8001, 0xb83e, 0x2660, 0x080c, 0x9e72, 0x00ce, 0x0048, 0x00de,
+	0x00c6, 0x2660, 0x6003, 0x0009, 0x630a, 0x00ce, 0x0804, 0x8680,
+	0x89ff, 0x0158, 0xa867, 0x0103, 0xab7a, 0xa877, 0x0000, 0x080c,
+	0xbe20, 0x080c, 0xd7f4, 0x080c, 0x6891, 0x080c, 0x97b1, 0x0804,
+	0x8680, 0x006e, 0x00de, 0x00ee, 0x00fe, 0x012e, 0x000e, 0x00ce,
+	0x009e, 0x00ae, 0x00be, 0x0005, 0x0096, 0x0006, 0x0066, 0x00c6,
+	0x00d6, 0x9036, 0x7814, 0x9065, 0x0904, 0x8745, 0x600c, 0x0006,
+	0x600f, 0x0000, 0x7824, 0x9c06, 0x1570, 0x2069, 0x0100, 0x6820,
+	0xd0a4, 0x1508, 0x080c, 0x80a1, 0x080c, 0x93ad, 0x68c3, 0x0000,
+	0x080c, 0x98db, 0x7827, 0x0000, 0x0036, 0x2069, 0x0140, 0x6b04,
+	0x9384, 0x1000, 0x0138, 0x2001, 0x0100, 0x080c, 0x2b16, 0x9006,
+	0x080c, 0x2b16, 0x2069, 0x0100, 0x6824, 0xd084, 0x0110, 0x6827,
+	0x0001, 0x003e, 0x0040, 0x080c, 0x6521, 0x1520, 0x6003, 0x0009,
+	0x630a, 0x2c30, 0x00f8, 0x6014, 0x2048, 0x080c, 0xbb2a, 0x01b0,
+	0x6020, 0x9086, 0x0003, 0x1508, 0x080c, 0xbd32, 0x1118, 0x080c,
+	0xa7d1, 0x0060, 0x080c, 0x6521, 0x1168, 0xa867, 0x0103, 0xab7a,
+	0xa877, 0x0000, 0x080c, 0x6891, 0x080c, 0xbd15, 0x080c, 0x9e72,
+	0x080c, 0x97b1, 0x000e, 0x0804, 0x86eb, 0x7e16, 0x7e12, 0x00de,
+	0x00ce, 0x006e, 0x000e, 0x009e, 0x0005, 0x6020, 0x9086, 0x0006,
+	0x1118, 0x080c, 0xd4f6, 0x0c50, 0x080c, 0xa7d1, 0x6020, 0x9086,
+	0x0002, 0x1150, 0x6004, 0x0006, 0x9086, 0x0085, 0x000e, 0x0990,
+	0x9086, 0x008b, 0x0978, 0x08d0, 0x6020, 0x9086, 0x0005, 0x19b0,
+	0x6004, 0x0006, 0x9086, 0x0085, 0x000e, 0x0d18, 0x9086, 0x008b,
+	0x0d00, 0x0860, 0x0006, 0x0066, 0x0096, 0x00b6, 0x00c6, 0x00d6,
+	0x7818, 0x905d, 0x0904, 0x87f2, 0xb854, 0x0006, 0x9006, 0xb856,
+	0xb85a, 0xb800, 0xc0d4, 0xc0dc, 0xb802, 0x080c, 0x617a, 0x0904,
+	0x87ef, 0x7e24, 0x86ff, 0x0904, 0x87e2, 0x9680, 0x0005, 0x2004,
+	0x9906, 0x1904, 0x87e2, 0x00d6, 0x2069, 0x0100, 0x68c0, 0x9005,
+	0x0904, 0x87d9, 0x080c, 0x80a1, 0x080c, 0x93ad, 0x68c3, 0x0000,
+	0x080c, 0x98db, 0x7827, 0x0000, 0x0036, 0x2069, 0x0140, 0x6b04,
+	0x9384, 0x1000, 0x0138, 0x2001, 0x0100, 0x080c, 0x2b16, 0x9006,
+	0x080c, 0x2b16, 0x2069, 0x0100, 0x6824, 0xd084, 0x0110, 0x6827,
+	0x0001, 0x003e, 0x00de, 0x00c6, 0x3e08, 0x918e, 0x0002, 0x1168,
+	0xb800, 0xd0bc, 0x0150, 0x9680, 0x0010, 0x200c, 0x81ff, 0x1518,
+	0x2009, 0x1958, 0x210c, 0x2102, 0x00f0, 0xb83c, 0x9005, 0x0110,
+	0x8001, 0xb83e, 0x2660, 0x600f, 0x0000, 0x080c, 0x9e72, 0x00ce,
+	0x0048, 0x00de, 0x00c6, 0x2660, 0x6003, 0x0009, 0x630a, 0x00ce,
+	0x0804, 0x8785, 0x89ff, 0x0138, 0xa867, 0x0103, 0xab7a, 0xa877,
+	0x0000, 0x080c, 0x6891, 0x080c, 0x97b1, 0x0804, 0x8785, 0x000e,
+	0x0804, 0x8779, 0x781e, 0x781a, 0x00de, 0x00ce, 0x00be, 0x009e,
+	0x006e, 0x000e, 0x0005, 0x00e6, 0x00d6, 0x0096, 0x0066, 0xb800,
+	0xd0dc, 0x01a0, 0xb84c, 0x904d, 0x0188, 0xa878, 0x9606, 0x1170,
+	0x2071, 0x19b7, 0x7024, 0x9035, 0x0148, 0x9080, 0x0005, 0x2004,
+	0x9906, 0x1120, 0xb800, 0xc0dc, 0xb802, 0x0029, 0x006e, 0x009e,
+	0x00de, 0x00ee, 0x0005, 0x00f6, 0x2079, 0x0100, 0x78c0, 0x9005,
+	0x1138, 0x00c6, 0x2660, 0x6003, 0x0009, 0x630a, 0x00ce, 0x04b8,
+	0x080c, 0x93ad, 0x78c3, 0x0000, 0x080c, 0x98db, 0x7027, 0x0000,
+	0x0036, 0x2079, 0x0140, 0x7b04, 0x9384, 0x1000, 0x0138, 0x2001,
+	0x0100, 0x080c, 0x2b16, 0x9006, 0x080c, 0x2b16, 0x2079, 0x0100,
+	0x7824, 0xd084, 0x0110, 0x7827, 0x0001, 0x080c, 0x98db, 0x003e,
+	0x080c, 0x617a, 0x00c6, 0xb83c, 0x9005, 0x0110, 0x8001, 0xb83e,
+	0x2660, 0x080c, 0x9e42, 0x00ce, 0xa867, 0x0103, 0xab7a, 0xa877,
+	0x0000, 0x080c, 0xbe20, 0x080c, 0x6891, 0x080c, 0x97b1, 0x00fe,
+	0x0005, 0x00b6, 0x00e6, 0x00c6, 0x2011, 0x0101, 0x2204, 0xc0c4,
+	0x2012, 0x2001, 0x180c, 0x2014, 0xc2e4, 0x2202, 0x2071, 0x19b7,
+	0x7004, 0x9084, 0x0007, 0x0002, 0x887e, 0x8882, 0x88a0, 0x88c9,
+	0x8907, 0x887e, 0x8899, 0x887c, 0x080c, 0x0db4, 0x00ce, 0x00ee,
+	0x00be, 0x0005, 0x7024, 0x9065, 0x0148, 0x7020, 0x8001, 0x7022,
+	0x600c, 0x9015, 0x0158, 0x7216, 0x600f, 0x0000, 0x7007, 0x0000,
+	0x7027, 0x0000, 0x00ce, 0x00ee, 0x00be, 0x0005, 0x7216, 0x7212,
+	0x0ca8, 0x7007, 0x0000, 0x7027, 0x0000, 0x7020, 0x9005, 0x0070,
+	0x6010, 0x2058, 0x080c, 0x617a, 0xb800, 0xc0dc, 0xb802, 0x7007,
+	0x0000, 0x7027, 0x0000, 0x7020, 0x8001, 0x7022, 0x1148, 0x2001,
+	0x180c, 0x2014, 0xd2ec, 0x1180, 0x00ce, 0x00ee, 0x00be, 0x0005,
+	0xb854, 0x9015, 0x0120, 0x721e, 0x080c, 0x896d, 0x0ca8, 0x7218,
+	0x721e, 0x080c, 0x896d, 0x0c80, 0xc2ec, 0x2202, 0x080c, 0x8a4a,
+	0x0c58, 0x7024, 0x9065, 0x05b8, 0x700c, 0x9c06, 0x1160, 0x080c,
+	0x97b1, 0x600c, 0x9015, 0x0120, 0x720e, 0x600f, 0x0000, 0x0448,
+	0x720e, 0x720a, 0x0430, 0x7014, 0x9c06, 0x1160, 0x080c, 0x97b1,
+	0x600c, 0x9015, 0x0120, 0x7216, 0x600f, 0x0000, 0x00d0, 0x7216,
+	0x7212, 0x00b8, 0x6020, 0x9086, 0x0003, 0x1198, 0x6010, 0x2058,
+	0x080c, 0x617a, 0xb800, 0xc0dc, 0xb802, 0x080c, 0x97b1, 0x701c,
+	0x9065, 0x0138, 0xb854, 0x9015, 0x0110, 0x721e, 0x0010, 0x7218,
+	0x721e, 0x7027, 0x0000, 0x00ce, 0x00ee, 0x00be, 0x0005, 0x7024,
+	0x9065, 0x0140, 0x080c, 0x97b1, 0x600c, 0x9015, 0x0158, 0x720e,
+	0x600f, 0x0000, 0x080c, 0x98db, 0x7027, 0x0000, 0x00ce, 0x00ee,
+	0x00be, 0x0005, 0x720e, 0x720a, 0x0ca8, 0x00d6, 0x2069, 0x19b7,
+	0x6830, 0x9084, 0x0003, 0x0002, 0x892a, 0x892c, 0x8950, 0x8928,
+	0x080c, 0x0db4, 0x00de, 0x0005, 0x00c6, 0x6840, 0x9086, 0x0001,
+	0x01b8, 0x683c, 0x9065, 0x0130, 0x600c, 0x9015, 0x0170, 0x6a3a,
+	0x600f, 0x0000, 0x6833, 0x0000, 0x683f, 0x0000, 0x2011, 0x19d6,
+	0x2013, 0x0000, 0x00ce, 0x00de, 0x0005, 0x683a, 0x6836, 0x0c90,
+	0x6843, 0x0000, 0x6838, 0x9065, 0x0d68, 0x6003, 0x0003, 0x0c50,
+	0x00c6, 0x9006, 0x6842, 0x6846, 0x684a, 0x683c, 0x9065, 0x0160,
+	0x600c, 0x9015, 0x0130, 0x6a3a, 0x600f, 0x0000, 0x683f, 0x0000,
+	0x0018, 0x683e, 0x683a, 0x6836, 0x00ce, 0x00de, 0x0005, 0x2001,
+	0x180c, 0x200c, 0xc1e5, 0x2102, 0x0005, 0x2001, 0x180c, 0x200c,
+	0xd1ec, 0x0120, 0xc1ec, 0x2102, 0x080c, 0x8a4a, 0x2001, 0x19c3,
+	0x2004, 0x9086, 0x0001, 0x0d58, 0x00d6, 0x2069, 0x19b7, 0x6804,
+	0x9084, 0x0007, 0x0002, 0x898d, 0x8a32, 0x8a32, 0x8a32, 0x8a32,
+	0x8a34, 0x8a32, 0x898b, 0x080c, 0x0db4, 0x6820, 0x9005, 0x1110,
+	0x00de, 0x0005, 0x00c6, 0x680c, 0x9065, 0x0150, 0x6807, 0x0004,
+	0x6826, 0x682b, 0x0000, 0x080c, 0x8aa5, 0x00ce, 0x00de, 0x0005,
+	0x6814, 0x9065, 0x0150, 0x6807, 0x0001, 0x6826, 0x682b, 0x0000,
+	0x080c, 0x8aa5, 0x00ce, 0x00de, 0x0005, 0x00b6, 0x00e6, 0x6a1c,
+	0x92dd, 0x0000, 0x0904, 0x8a1c, 0xb84c, 0x900d, 0x0118, 0xb888,
+	0x9005, 0x01a0, 0xb854, 0x905d, 0x0120, 0x920e, 0x0904, 0x8a1c,
+	0x0028, 0x6818, 0x920e, 0x0904, 0x8a1c, 0x2058, 0xb84c, 0x900d,
+	0x0d88, 0xb888, 0x9005, 0x1d70, 0x2b00, 0x681e, 0xbb3c, 0xb838,
+	0x9302, 0x1e40, 0x080c, 0x9e19, 0x0904, 0x8a1c, 0x8318, 0xbb3e,
+	0x6116, 0x2b10, 0x6212, 0x0096, 0x2148, 0xa880, 0x9084, 0x00ff,
+	0x605e, 0xa883, 0x0000, 0xa884, 0x009e, 0x908a, 0x199a, 0x0210,
+	0x2001, 0x1999, 0x8003, 0x801b, 0x831b, 0x9318, 0x631a, 0x6114,
+	0x0096, 0x2148, 0xa964, 0x009e, 0x918c, 0x00ff, 0x918e, 0x0048,
+	0x0538, 0x00f6, 0x2c78, 0x2061, 0x0100, 0xbab0, 0x629a, 0x2069,
+	0x0200, 0x2071, 0x0240, 0x080c, 0x8fdd, 0x2069, 0x19b7, 0xbb00,
+	0xc3dd, 0xbb02, 0x6807, 0x0002, 0x2f18, 0x6b26, 0x682b, 0x0000,
+	0x7823, 0x0003, 0x7803, 0x0001, 0x7807, 0x0040, 0x00fe, 0x00ee,
+	0x00be, 0x00ce, 0x00de, 0x0005, 0x00ee, 0x00be, 0x00ce, 0x0cd0,
+	0x6807, 0x0006, 0x2c18, 0x6b26, 0x6820, 0x8001, 0x6822, 0x682b,
+	0x0000, 0x080c, 0x617a, 0x080c, 0x9c6e, 0x00ee, 0x00be, 0x00ce,
+	0x00de, 0x0005, 0x00de, 0x0005, 0x00c6, 0x680c, 0x9065, 0x0138,
+	0x6807, 0x0004, 0x6826, 0x682b, 0x0000, 0x080c, 0x8aa5, 0x00ce,
+	0x00de, 0x0005, 0x2001, 0x180c, 0x2014, 0xc2ed, 0x2202, 0x00de,
+	0x00fe, 0x0005, 0x00f6, 0x00d6, 0x2069, 0x19b7, 0x6830, 0x9086,
+	0x0000, 0x1548, 0x2001, 0x180c, 0x2014, 0xd2e4, 0x0130, 0xc2e4,
+	0x2202, 0x080c, 0x897c, 0x2069, 0x19b7, 0x2001, 0x180c, 0x200c,
+	0xd1c4, 0x11e0, 0x6838, 0x907d, 0x01b0, 0x6a04, 0x9296, 0x0000,
+	0x1588, 0x6833, 0x0001, 0x683e, 0x6847, 0x0000, 0x684b, 0x0000,
+	0x0126, 0x00f6, 0x2091, 0x2400, 0x002e, 0x080c, 0x1aea, 0x1178,
+	0x012e, 0x080c, 0x920a, 0x00de, 0x00fe, 0x0005, 0xc1c4, 0x2102,
+	0x0066, 0x2031, 0x0001, 0x080c, 0x704b, 0x006e, 0x08d8, 0x012e,
+	0x6843, 0x0000, 0x7803, 0x0002, 0x780c, 0x9015, 0x0140, 0x6a3a,
+	0x780f, 0x0000, 0x6833, 0x0000, 0x683f, 0x0000, 0x0c20, 0x683a,
+	0x6836, 0x0cc0, 0x6a04, 0x9296, 0x0006, 0x1904, 0x8a42, 0x6a30,
+	0x9296, 0x0000, 0x0930, 0x0804, 0x8a42, 0x6020, 0x9084, 0x000f,
+	0x000b, 0x0005, 0x8ab9, 0x8abe, 0x8f17, 0x8fa6, 0x8abe, 0x8f17,
+	0x8fa6, 0x8ab9, 0x8abe, 0x8ab9, 0x8ab9, 0x8ab9, 0x8ab9, 0x8ab9,
+	0x8ab9, 0x080c, 0x8861, 0x080c, 0x896d, 0x0005, 0x00b6, 0x0156,
+	0x0136, 0x0146, 0x01c6, 0x01d6, 0x00c6, 0x00d6, 0x00e6, 0x00f6,
+	0x2069, 0x0200, 0x2071, 0x0240, 0x6004, 0x908a, 0x0053, 0x1a0c,
+	0x0db4, 0x6110, 0x2158, 0xb9b0, 0x2c78, 0x2061, 0x0100, 0x619a,
+	0x908a, 0x0040, 0x1a04, 0x8b2a, 0x005b, 0x00fe, 0x00ee, 0x00de,
+	0x00ce, 0x01de, 0x01ce, 0x014e, 0x013e, 0x015e, 0x00be, 0x0005,
+	0x8ca1, 0x8cdc, 0x8d05, 0x8da8, 0x8dc9, 0x8dcf, 0x8ddc, 0x8de4,
+	0x8df0, 0x8df6, 0x8e07, 0x8df6, 0x8e5e, 0x8de4, 0x8e6a, 0x8e70,
+	0x8df0, 0x8e70, 0x8e7c, 0x8b28, 0x8b28, 0x8b28, 0x8b28, 0x8b28,
+	0x8b28, 0x8b28, 0x8b28, 0x8b28, 0x8b28, 0x8b28, 0x9590, 0x95b3,
+	0x95c4, 0x95e4, 0x9616, 0x8ddc, 0x8b28, 0x8ddc, 0x8df6, 0x8b28,
+	0x8d05, 0x8da8, 0x8b28, 0x99d2, 0x8df6, 0x8b28, 0x99ee, 0x8df6,
+	0x8b28, 0x8df0, 0x8c9b, 0x8b4b, 0x8b28, 0x9a0a, 0x9a77, 0x9b4e,
+	0x8b28, 0x9b5b, 0x8dd9, 0x9b86, 0x8b28, 0x9620, 0x9bb3, 0x8b28,
+	0x080c, 0x0db4, 0x2100, 0x005b, 0x00fe, 0x00ee, 0x00de, 0x00ce,
+	0x01de, 0x01ce, 0x014e, 0x013e, 0x015e, 0x00be, 0x0005, 0x8b49,
+	0x8b49, 0x8b49, 0x8b72, 0x8c1e, 0x8c29, 0x8b49, 0x8b49, 0x8b49,
+	0x8c70, 0x8c7c, 0x8b8d, 0x8b49, 0x8ba8, 0x8bdc, 0x9d35, 0x9d7a,
+	0x8df6, 0x080c, 0x0db4, 0x00d6, 0x0096, 0x080c, 0x8e8f, 0x7003,
+	0x2414, 0x7007, 0x0018, 0x700b, 0x0800, 0x7814, 0x2048, 0xa83c,
+	0x700e, 0xa850, 0x7022, 0xa854, 0x7026, 0x60c3, 0x0018, 0x080c,
+	0x9381, 0x009e, 0x00de, 0x0005, 0x7810, 0x00b6, 0x2058, 0xb8a0,
+	0x00be, 0x080c, 0x9dc1, 0x1118, 0x9084, 0xff80, 0x0110, 0x9085,
+	0x0001, 0x0005, 0x00d6, 0x0096, 0x080c, 0x8e8f, 0x7003, 0x0500,
+	0x7814, 0x2048, 0xa874, 0x700a, 0xa878, 0x700e, 0xa87c, 0x7012,
+	0xa880, 0x7016, 0xa884, 0x701a, 0xa888, 0x701e, 0x60c3, 0x0010,
+	0x080c, 0x9381, 0x009e, 0x00de, 0x0005, 0x00d6, 0x0096, 0x080c,
+	0x8e8f, 0x7003, 0x0500, 0x7814, 0x2048, 0xa8cc, 0x700a, 0xa8d0,
+	0x700e, 0xa8d4, 0x7012, 0xa8d8, 0x7016, 0xa8dc, 0x701a, 0xa8e0,
+	0x701e, 0x60c3, 0x0010, 0x080c, 0x9381, 0x009e, 0x00de, 0x0005,
+	0x00d6, 0x0096, 0x0126, 0x2091, 0x8000, 0x080c, 0x8e8f, 0x20e9,
+	0x0000, 0x2001, 0x1973, 0x2003, 0x0000, 0x7814, 0x2048, 0xa814,
+	0x8003, 0x60c2, 0xa830, 0x20a8, 0xa860, 0x20e0, 0xa85c, 0x9080,
+	0x001b, 0x2098, 0x2001, 0x1973, 0x0016, 0x200c, 0x2001, 0x0001,
+	0x080c, 0x224f, 0x080c, 0xc839, 0x9006, 0x080c, 0x224f, 0x001e,
+	0xa804, 0x9005, 0x0110, 0x2048, 0x0c28, 0x04d9, 0x080c, 0x9381,
+	0x012e, 0x009e, 0x00de, 0x0005, 0x00d6, 0x0096, 0x0126, 0x2091,
+	0x8000, 0x080c, 0x8eda, 0x20e9, 0x0000, 0x2001, 0x1973, 0x2003,
+	0x0000, 0x7814, 0x2048, 0xa86f, 0x0200, 0xa873, 0x0000, 0xa814,
+	0x8003, 0x60c2, 0xa830, 0x20a8, 0xa860, 0x20e0, 0xa85c, 0x9080,
+	0x001b, 0x2098, 0x2001, 0x1973, 0x0016, 0x200c, 0x080c, 0xc839,
+	0x001e, 0xa804, 0x9005, 0x0110, 0x2048, 0x0c60, 0x0051, 0x7814,
+	0x2048, 0x080c, 0x0f9d, 0x080c, 0x9381, 0x012e, 0x009e, 0x00de,
+	0x0005, 0x60c0, 0x8004, 0x9084, 0x0003, 0x9005, 0x0130, 0x9082,
+	0x0004, 0x20a3, 0x0000, 0x8000, 0x1de0, 0x0005, 0x080c, 0x8e8f,
+	0x7003, 0x7800, 0x7808, 0x8007, 0x700a, 0x60c3, 0x0008, 0x0804,
+	0x9381, 0x00d6, 0x00e6, 0x080c, 0x8eda, 0x7814, 0x9084, 0xff00,
+	0x2073, 0x0200, 0x8e70, 0x8e70, 0x9095, 0x0010, 0x2272, 0x8e70,
+	0x2073, 0x0034, 0x8e70, 0x2069, 0x1805, 0x20a9, 0x0004, 0x2d76,
+	0x8d68, 0x8e70, 0x1f04, 0x8c3f, 0x2069, 0x1801, 0x20a9, 0x0004,
+	0x2d76, 0x8d68, 0x8e70, 0x1f04, 0x8c48, 0x2069, 0x1983, 0x9086,
+	0xdf00, 0x0110, 0x2069, 0x199d, 0x20a9, 0x001a, 0x9e86, 0x0260,
+	0x1148, 0x00c6, 0x2061, 0x0200, 0x6010, 0x8000, 0x6012, 0x00ce,
+	0x2071, 0x0240, 0x2d04, 0x8007, 0x2072, 0x8d68, 0x8e70, 0x1f04,
+	0x8c56, 0x60c3, 0x004c, 0x080c, 0x9381, 0x00ee, 0x00de, 0x0005,
+	0x080c, 0x8e8f, 0x7003, 0x6300, 0x7007, 0x0028, 0x7808, 0x700e,
+	0x60c3, 0x0008, 0x0804, 0x9381, 0x00d6, 0x0026, 0x0016, 0x080c,
+	0x8eda, 0x7003, 0x0200, 0x7814, 0x700e, 0x00e6, 0x9ef0, 0x0004,
+	0x2009, 0x0001, 0x2011, 0x000c, 0x2073, 0x0800, 0x8e70, 0x2073,
+	0x0000, 0x00ee, 0x7206, 0x710a, 0x62c2, 0x080c, 0x9381, 0x001e,
+	0x002e, 0x00de, 0x0005, 0x2001, 0x1817, 0x2004, 0x609a, 0x0804,
+	0x9381, 0x080c, 0x8e8f, 0x7003, 0x5200, 0x2069, 0x1853, 0x6804,
+	0xd084, 0x0130, 0x6828, 0x0016, 0x080c, 0x2698, 0x710e, 0x001e,
+	0x20a9, 0x0004, 0x20e1, 0x0001, 0x2099, 0x1805, 0x20e9, 0x0000,
+	0x20a1, 0x0250, 0x4003, 0x20a9, 0x0004, 0x2099, 0x1801, 0x20a1,
+	0x0254, 0x4003, 0x080c, 0x9dc1, 0x1120, 0xb8a0, 0x9082, 0x007f,
+	0x0248, 0x2001, 0x181e, 0x2004, 0x7032, 0x2001, 0x181f, 0x2004,
+	0x7036, 0x0030, 0x2001, 0x1817, 0x2004, 0x9084, 0x00ff, 0x7036,
+	0x60c3, 0x001c, 0x0804, 0x9381, 0x080c, 0x8e8f, 0x7003, 0x0500,
+	0x080c, 0x9dc1, 0x1120, 0xb8a0, 0x9082, 0x007f, 0x0248, 0x2001,
+	0x181e, 0x2004, 0x700a, 0x2001, 0x181f, 0x2004, 0x700e, 0x0030,
+	0x2001, 0x1817, 0x2004, 0x9084, 0x00ff, 0x700e, 0x20a9, 0x0004,
+	0x20e1, 0x0001, 0x2099, 0x1805, 0x20e9, 0x0000, 0x20a1, 0x0250,
+	0x4003, 0x60c3, 0x0010, 0x0804, 0x9381, 0x080c, 0x8e8f, 0x9006,
+	0x080c, 0x6535, 0xb8a0, 0x9086, 0x007e, 0x1130, 0x7003, 0x0400,
+	0x620c, 0xc2b4, 0x620e, 0x0058, 0x7814, 0x0096, 0x904d, 0x0120,
+	0x9006, 0xa89a, 0xa8a6, 0xa8aa, 0x009e, 0x7003, 0x0300, 0xb8a0,
+	0x9086, 0x007e, 0x1904, 0x8d70, 0x00d6, 0x2069, 0x193c, 0x2001,
+	0x1836, 0x2004, 0xd0a4, 0x0178, 0x6800, 0x700a, 0x6808, 0x9084,
+	0x2000, 0x7012, 0x680c, 0x7016, 0x701f, 0x2710, 0x6818, 0x7022,
+	0x681c, 0x7026, 0x0080, 0x6800, 0x700a, 0x6804, 0x700e, 0x6808,
+	0x080c, 0x6f9b, 0x1118, 0x9084, 0x37ff, 0x0010, 0x9084, 0x3fff,
+	0x7012, 0x680c, 0x7016, 0x00de, 0x20a9, 0x0004, 0x20e1, 0x0001,
+	0x2099, 0x1805, 0x20e9, 0x0000, 0x20a1, 0x0256, 0x4003, 0x20a9,
+	0x0004, 0x2099, 0x1801, 0x20a1, 0x025a, 0x4003, 0x00d6, 0x080c,
+	0x9c35, 0x2069, 0x1944, 0x2071, 0x024e, 0x6800, 0xc0dd, 0x7002,
+	0x080c, 0x5393, 0xd0e4, 0x0110, 0x680c, 0x700e, 0x00de, 0x04a0,
+	0x2001, 0x1836, 0x2004, 0xd0a4, 0x0168, 0x0016, 0x2009, 0x0002,
+	0x60e0, 0x9106, 0x0130, 0x2100, 0x60e3, 0x0000, 0x080c, 0x26d9,
+	0x61e2, 0x001e, 0x20e1, 0x0001, 0x2099, 0x193c, 0x20e9, 0x0000,
+	0x20a1, 0x024e, 0x20a9, 0x0008, 0x4003, 0x20a9, 0x0004, 0x2099,
+	0x1805, 0x20a1, 0x0256, 0x4003, 0x20a9, 0x0004, 0x2099, 0x1801,
+	0x20a1, 0x025a, 0x4003, 0x080c, 0x9c35, 0x20a1, 0x024e, 0x20a9,
+	0x0008, 0x2099, 0x1944, 0x4003, 0x60c3, 0x0074, 0x0804, 0x9381,
+	0x080c, 0x8e8f, 0x7003, 0x2010, 0x7007, 0x0014, 0x700b, 0x0800,
+	0x700f, 0x2000, 0x9006, 0x00f6, 0x2079, 0x1853, 0x7904, 0x00fe,
+	0xd1ac, 0x1110, 0x9085, 0x0020, 0x0010, 0x9085, 0x0010, 0x9085,
+	0x0002, 0x00d6, 0x0804, 0x8e3f, 0x7026, 0x60c3, 0x0014, 0x0804,
+	0x9381, 0x080c, 0x8e8f, 0x7003, 0x5000, 0x0804, 0x8d1f, 0x080c,
+	0x8e8f, 0x7003, 0x2110, 0x7007, 0x0014, 0x60c3, 0x0014, 0x0804,
+	0x9381, 0x080c, 0x8ed1, 0x0010, 0x080c, 0x8eda, 0x7003, 0x0200,
+	0x60c3, 0x0004, 0x0804, 0x9381, 0x080c, 0x8eda, 0x7003, 0x0100,
+	0x700b, 0x0003, 0x700f, 0x2a00, 0x60c3, 0x0008, 0x0804, 0x9381,
+	0x080c, 0x8eda, 0x7003, 0x0200, 0x0804, 0x8d1f, 0x080c, 0x8eda,
+	0x7003, 0x0100, 0x782c, 0x9005, 0x0110, 0x700a, 0x0010, 0x700b,
+	0x0003, 0x7814, 0x700e, 0x60c3, 0x0008, 0x0804, 0x9381, 0x00d6,
+	0x080c, 0x8eda, 0x7003, 0x0210, 0x7007, 0x0014, 0x700b, 0x0800,
+	0xb894, 0x9086, 0x0014, 0x1198, 0xb99c, 0x9184, 0x0030, 0x0190,
+	0xb998, 0x9184, 0xc000, 0x1140, 0xd1ec, 0x0118, 0x700f, 0x2100,
+	0x0058, 0x700f, 0x0100, 0x0040, 0x700f, 0x0400, 0x0028, 0x700f,
+	0x0700, 0x0010, 0x700f, 0x0800, 0x00f6, 0x2079, 0x1853, 0x7904,
+	0x00fe, 0xd1ac, 0x1110, 0x9085, 0x0020, 0x0010, 0x9085, 0x0010,
+	0x2009, 0x1875, 0x210c, 0xd184, 0x1110, 0x9085, 0x0002, 0x0026,
+	0x2009, 0x1873, 0x210c, 0xd1e4, 0x0150, 0xc0c5, 0xbabc, 0xd28c,
+	0x1108, 0xc0cd, 0x9094, 0x0030, 0x9296, 0x0010, 0x0140, 0xd1ec,
+	0x0130, 0x9094, 0x0030, 0x9296, 0x0010, 0x0108, 0xc0bd, 0x002e,
+	0x7026, 0x60c3, 0x0014, 0x00de, 0x0804, 0x9381, 0x080c, 0x8eda,
+	0x7003, 0x0210, 0x7007, 0x0014, 0x700f, 0x0100, 0x60c3, 0x0014,
+	0x0804, 0x9381, 0x080c, 0x8eda, 0x7003, 0x0200, 0x0804, 0x8ca5,
+	0x080c, 0x8eda, 0x7003, 0x0100, 0x700b, 0x0003, 0x700f, 0x2a00,
+	0x60c3, 0x0008, 0x0804, 0x9381, 0x080c, 0x8eda, 0x7003, 0x0100,
+	0x700b, 0x000b, 0x60c3, 0x0008, 0x0804, 0x9381, 0x0026, 0x00d6,
+	0x0036, 0x0046, 0x2019, 0x3200, 0x2021, 0x0800, 0x0040, 0x0026,
+	0x00d6, 0x0036, 0x0046, 0x2019, 0x2200, 0x2021, 0x0100, 0x080c,
+	0x9c4a, 0xb810, 0x9305, 0x7002, 0xb814, 0x7006, 0x2069, 0x1800,
+	0x6878, 0x700a, 0x687c, 0x700e, 0x9485, 0x0029, 0x7012, 0x004e,
+	0x003e, 0x00de, 0x080c, 0x936f, 0x721a, 0x9f95, 0x0000, 0x7222,
+	0x7027, 0xffff, 0x2071, 0x024c, 0x002e, 0x0005, 0x0026, 0x080c,
+	0x9c4a, 0x7003, 0x02ff, 0x7007, 0xfffc, 0x00d6, 0x2069, 0x1800,
+	0x6878, 0x700a, 0x687c, 0x700e, 0x00de, 0x7013, 0x2029, 0x0c10,
+	0x7003, 0x0100, 0x7007, 0x0000, 0x700b, 0xfc02, 0x700f, 0x0000,
+	0x0005, 0x0026, 0x00d6, 0x0036, 0x0046, 0x2019, 0x3300, 0x2021,
+	0x0800, 0x0040, 0x0026, 0x00d6, 0x0036, 0x0046, 0x2019, 0x2300,
+	0x2021, 0x0100, 0x080c, 0x9c4a, 0xb810, 0x9305, 0x7002, 0xb814,
+	0x7006, 0x2069, 0x1800, 0xb810, 0x9005, 0x1140, 0xb814, 0x9005,
+	0x1128, 0x700b, 0x00ff, 0x700f, 0xfffe, 0x0020, 0x6878, 0x700a,
+	0x687c, 0x700e, 0x0000, 0x9485, 0x0098, 0x7012, 0x004e, 0x003e,
+	0x00de, 0x080c, 0x936f, 0x721a, 0x7a08, 0x7222, 0x2f10, 0x7226,
+	0x2071, 0x024c, 0x002e, 0x0005, 0x080c, 0x936f, 0x721a, 0x7a08,
+	0x7222, 0x7814, 0x7026, 0x2071, 0x024c, 0x002e, 0x0005, 0x00b6,
+	0x00c6, 0x00d6, 0x00e6, 0x00f6, 0x2069, 0x0200, 0x2071, 0x0240,
+	0x6004, 0x908a, 0x0085, 0x0a0c, 0x0db4, 0x908a, 0x0092, 0x1a0c,
+	0x0db4, 0x6110, 0x2158, 0xb9b0, 0x2c78, 0x2061, 0x0100, 0x619a,
+	0x9082, 0x0085, 0x0033, 0x00fe, 0x00ee, 0x00de, 0x00ce, 0x00be,
+	0x0005, 0x8f48, 0x8f57, 0x8f62, 0x8f46, 0x8f46, 0x8f46, 0x8f48,
+	0x8f46, 0x8f46, 0x8f46, 0x8f46, 0x8f46, 0x8f46, 0x080c, 0x0db4,
+	0x0411, 0x60c3, 0x0000, 0x0026, 0x080c, 0x29cc, 0x0228, 0x2011,
+	0x0101, 0x2204, 0xc0c5, 0x2012, 0x002e, 0x0804, 0x9381, 0x0431,
+	0x7808, 0x700a, 0x7814, 0x700e, 0x7017, 0xffff, 0x60c3, 0x000c,
+	0x0804, 0x9381, 0x0479, 0x7003, 0x0003, 0x7007, 0x0300, 0x60c3,
+	0x0004, 0x0804, 0x9381, 0x0026, 0x080c, 0x9c4a, 0xb810, 0x9085,
+	0x8100, 0x7002, 0xb814, 0x7006, 0x2069, 0x1800, 0x6878, 0x700a,
+	0x687c, 0x700e, 0x7013, 0x0009, 0x0804, 0x8eaa, 0x0026, 0x080c,
+	0x9c4a, 0xb810, 0x9085, 0x8400, 0x7002, 0xb814, 0x7006, 0x2069,
+	0x1800, 0x6878, 0x700a, 0x687c, 0x700e, 0x2001, 0x0099, 0x7012,
+	0x0804, 0x8f0c, 0x0026, 0x080c, 0x9c4a, 0xb810, 0x9085, 0x8500,
 	0x7002, 0xb814, 0x7006, 0x2069, 0x1800, 0x6878, 0x700a, 0x687c,
-	0x700e, 0x7013, 0x0009, 0x0804, 0x8ea9, 0x0026, 0x080c, 0x9c3f,
-	0xb810, 0x9085, 0x8400, 0x7002, 0xb814, 0x7006, 0x2069, 0x1800,
-	0x6878, 0x700a, 0x687c, 0x700e, 0x2001, 0x0099, 0x7012, 0x0804,
-	0x8f0b, 0x0026, 0x080c, 0x9c3f, 0xb810, 0x9085, 0x8500, 0x7002,
+	0x700e, 0x2001, 0x0099, 0x7012, 0x0804, 0x8f0c, 0x00b6, 0x00c6,
+	0x00d6, 0x00e6, 0x00f6, 0x2c78, 0x2069, 0x0200, 0x2071, 0x0240,
+	0x7804, 0x908a, 0x0040, 0x0a0c, 0x0db4, 0x908a, 0x0054, 0x1a0c,
+	0x0db4, 0x7910, 0x2158, 0xb9b0, 0x2061, 0x0100, 0x619a, 0x9082,
+	0x0040, 0x0033, 0x00fe, 0x00ee, 0x00de, 0x00ce, 0x00be, 0x0005,
+	0x8fdd, 0x9099, 0x906c, 0x91bb, 0x8fdb, 0x8fdb, 0x8fdb, 0x8fdb,
+	0x8fdb, 0x8fdb, 0x8fdb, 0x978e, 0x9796, 0x979e, 0x97a6, 0x8fdb,
+	0x9b92, 0x8fdb, 0x9786, 0x080c, 0x0db4, 0x0096, 0x780b, 0xffff,
+	0x080c, 0x9048, 0x7914, 0x2148, 0xa978, 0x7956, 0xae64, 0x96b4,
+	0x00ff, 0x9686, 0x0008, 0x1148, 0xa8b4, 0x7032, 0xa8b8, 0x7036,
+	0xa8bc, 0x703a, 0xa8c0, 0x703e, 0x0008, 0x7132, 0xa97c, 0x9184,
+	0x000f, 0x1118, 0x2001, 0x0005, 0x0040, 0xd184, 0x0118, 0x2001,
+	0x0004, 0x0018, 0x9084, 0x0006, 0x8004, 0x2010, 0x785c, 0x9084,
+	0x00ff, 0x8007, 0x9205, 0x7042, 0xd1ac, 0x0158, 0x7047, 0x0002,
+	0x9686, 0x0008, 0x1118, 0x080c, 0x1789, 0x0010, 0x080c, 0x164a,
+	0x0050, 0xd1b4, 0x0118, 0x7047, 0x0001, 0x0028, 0x7047, 0x0000,
+	0x9016, 0x2230, 0x0010, 0xaab0, 0xaeac, 0x726a, 0x766e, 0x20a9,
+	0x0008, 0x20e9, 0x0000, 0xa860, 0x20e0, 0xa85c, 0x9080, 0x0023,
+	0x2098, 0x20a1, 0x0252, 0x2069, 0x0200, 0x6813, 0x0018, 0x4003,
+	0x6813, 0x0008, 0x60c3, 0x0020, 0x6017, 0x0009, 0x2001, 0x19d3,
+	0x2003, 0x07d0, 0x2001, 0x19d2, 0x2003, 0x0009, 0x009e, 0x0005,
+	0x6813, 0x0008, 0xba8c, 0x8210, 0xb8bc, 0xd084, 0x0128, 0x7a46,
+	0x7b14, 0x7b4a, 0x722e, 0x732a, 0x9294, 0x00ff, 0xba8e, 0x8217,
+	0x721a, 0xba10, 0x9295, 0x0600, 0x7202, 0xba14, 0x7206, 0x2069,
+	0x1800, 0x6a78, 0x720a, 0x6a7c, 0x720e, 0x7013, 0x0829, 0x2f10,
+	0x7222, 0x7027, 0xffff, 0x0005, 0x00d6, 0x0096, 0x0081, 0x7814,
+	0x2048, 0xa890, 0x7002, 0xa88c, 0x7006, 0xa8b0, 0x700a, 0xa8ac,
+	0x700e, 0x60c3, 0x000c, 0x009e, 0x00de, 0x0804, 0x9381, 0x6813,
+	0x0008, 0xb810, 0x9085, 0x0500, 0x7002, 0xb814, 0x7006, 0x2069,
+	0x1800, 0x6878, 0x700a, 0x687c, 0x700e, 0x7013, 0x0889, 0x080c,
+	0x936f, 0x721a, 0x7a08, 0x7222, 0x2f10, 0x7226, 0x2071, 0x024c,
+	0x0005, 0x00d6, 0x0096, 0x080c, 0x9199, 0x7814, 0x2048, 0x080c,
+	0xbb2a, 0x1130, 0x7814, 0x9084, 0x0700, 0x8007, 0x0033, 0x0010,
+	0x9006, 0x001b, 0x009e, 0x00de, 0x0005, 0x90b7, 0x9120, 0x9130,
+	0x9156, 0x9162, 0x9173, 0x917b, 0x90b5, 0x080c, 0x0db4, 0x0016,
+	0x0036, 0xa97c, 0x918c, 0x0003, 0x0118, 0x9186, 0x0003, 0x1198,
+	0xaba8, 0x7824, 0xd0cc, 0x1168, 0x7316, 0xa898, 0x701a, 0xa894,
+	0x701e, 0x003e, 0x001e, 0x2001, 0x1981, 0x2004, 0x60c2, 0x0804,
+	0x9381, 0xc3e5, 0x0c88, 0x9186, 0x0001, 0x190c, 0x0db4, 0xaba8,
+	0x7824, 0xd0cc, 0x1904, 0x911d, 0x7316, 0xa898, 0x701a, 0xa894,
+	0x701e, 0xa8a4, 0x7026, 0xa8ac, 0x702e, 0x2009, 0x0018, 0x9384,
+	0x0300, 0x0570, 0xd3c4, 0x0110, 0xa8ac, 0x9108, 0xd3cc, 0x0110,
+	0xa8a4, 0x9108, 0x6810, 0x9085, 0x0010, 0x6812, 0x2011, 0x0258,
+	0x20e9, 0x0000, 0x22a0, 0x0156, 0x20a9, 0x0008, 0xa860, 0x20e0,
+	0xa85c, 0x9080, 0x002c, 0x2098, 0x4003, 0x6810, 0x8000, 0x6812,
+	0x2011, 0x0240, 0x22a0, 0x20a9, 0x0005, 0x4003, 0x6810, 0xc084,
+	0x6812, 0x015e, 0x9184, 0x0003, 0x0118, 0x2019, 0x0245, 0x201a,
+	0x61c2, 0x003e, 0x001e, 0x0804, 0x9381, 0xc3e5, 0x0804, 0x90dc,
+	0x2011, 0x0008, 0x2001, 0x180f, 0x2004, 0xd0a4, 0x0110, 0x2011,
+	0x0028, 0x7824, 0xd0cc, 0x1110, 0x7216, 0x0470, 0x0ce8, 0xc2e5,
+	0x2011, 0x0302, 0x0016, 0x782c, 0x701a, 0x7930, 0x711e, 0x9105,
+	0x0108, 0xc2dd, 0x001e, 0x7824, 0xd0cc, 0x0108, 0xc2e5, 0x7216,
+	0x7027, 0x0012, 0x702f, 0x0008, 0x7043, 0x7000, 0x7047, 0x0500,
+	0x704f, 0x000a, 0x2069, 0x0200, 0x6813, 0x0009, 0x2071, 0x0240,
+	0x700b, 0x2500, 0x60c3, 0x0032, 0x0804, 0x9381, 0x2011, 0x0028,
+	0x7824, 0xd0cc, 0x1128, 0x7216, 0x60c3, 0x0018, 0x0804, 0x9381,
+	0x0cd0, 0xc2e5, 0x2011, 0x0100, 0x7824, 0xd0cc, 0x0108, 0xc2e5,
+	0x7216, 0x702f, 0x0008, 0x7858, 0x9084, 0x00ff, 0x7036, 0x60c3,
+	0x0020, 0x0804, 0x9381, 0x2011, 0x0008, 0x7824, 0xd0cc, 0x0108,
+	0xc2e5, 0x7216, 0x0c08, 0x0036, 0x7b14, 0x9384, 0xff00, 0x7816,
+	0x9384, 0x00ff, 0x8001, 0x1138, 0x7824, 0xd0cc, 0x0108, 0xc2e5,
+	0x7216, 0x003e, 0x0888, 0x0046, 0x2021, 0x0800, 0x0006, 0x7824,
+	0xd0cc, 0x000e, 0x0108, 0xc4e5, 0x7416, 0x004e, 0x701e, 0x003e,
+	0x0818, 0x00d6, 0x6813, 0x0008, 0xb810, 0x9085, 0x0700, 0x7002,
 	0xb814, 0x7006, 0x2069, 0x1800, 0x6878, 0x700a, 0x687c, 0x700e,
-	0x2001, 0x0099, 0x7012, 0x0804, 0x8f0b, 0x00b6, 0x00c6, 0x00d6,
-	0x00e6, 0x00f6, 0x2c78, 0x2069, 0x0200, 0x2071, 0x0240, 0x7804,
-	0x908a, 0x0040, 0x0a0c, 0x0db4, 0x908a, 0x0054, 0x1a0c, 0x0db4,
-	0x7910, 0x2158, 0xb9b0, 0x2061, 0x0100, 0x619a, 0x9082, 0x0040,
-	0x0033, 0x00fe, 0x00ee, 0x00de, 0x00ce, 0x00be, 0x0005, 0x8fdc,
-	0x9098, 0x906b, 0x91ba, 0x8fda, 0x8fda, 0x8fda, 0x8fda, 0x8fda,
-	0x8fda, 0x8fda, 0x978d, 0x9795, 0x979d, 0x97a5, 0x8fda, 0x9b87,
-	0x8fda, 0x9785, 0x080c, 0x0db4, 0x0096, 0x780b, 0xffff, 0x080c,
-	0x9047, 0x7914, 0x2148, 0xa978, 0x7956, 0xae64, 0x96b4, 0x00ff,
-	0x9686, 0x0008, 0x1148, 0xa8b4, 0x7032, 0xa8b8, 0x7036, 0xa8bc,
-	0x703a, 0xa8c0, 0x703e, 0x0008, 0x7132, 0xa97c, 0x9184, 0x000f,
-	0x1118, 0x2001, 0x0005, 0x0040, 0xd184, 0x0118, 0x2001, 0x0004,
-	0x0018, 0x9084, 0x0006, 0x8004, 0x2010, 0x785c, 0x9084, 0x00ff,
-	0x8007, 0x9205, 0x7042, 0xd1ac, 0x0158, 0x7047, 0x0002, 0x9686,
-	0x0008, 0x1118, 0x080c, 0x1787, 0x0010, 0x080c, 0x1648, 0x0050,
-	0xd1b4, 0x0118, 0x7047, 0x0001, 0x0028, 0x7047, 0x0000, 0x9016,
-	0x2230, 0x0010, 0xaab0, 0xaeac, 0x726a, 0x766e, 0x20a9, 0x0008,
-	0x20e9, 0x0000, 0xa860, 0x20e0, 0xa85c, 0x9080, 0x0023, 0x2098,
-	0x20a1, 0x0252, 0x2069, 0x0200, 0x6813, 0x0018, 0x4003, 0x6813,
-	0x0008, 0x60c3, 0x0020, 0x6017, 0x0009, 0x2001, 0x19d4, 0x2003,
-	0x07d0, 0x2001, 0x19d3, 0x2003, 0x0009, 0x009e, 0x0005, 0x6813,
-	0x0008, 0xba8c, 0x8210, 0xb8bc, 0xd084, 0x0128, 0x7a46, 0x7b14,
-	0x7b4a, 0x722e, 0x732a, 0x9294, 0x00ff, 0xba8e, 0x8217, 0x721a,
-	0xba10, 0x9295, 0x0600, 0x7202, 0xba14, 0x7206, 0x2069, 0x1800,
-	0x6a78, 0x720a, 0x6a7c, 0x720e, 0x7013, 0x0829, 0x2f10, 0x7222,
-	0x7027, 0xffff, 0x0005, 0x00d6, 0x0096, 0x0081, 0x7814, 0x2048,
-	0xa890, 0x7002, 0xa88c, 0x7006, 0xa8b0, 0x700a, 0xa8ac, 0x700e,
-	0x60c3, 0x000c, 0x009e, 0x00de, 0x0804, 0x9380, 0x6813, 0x0008,
-	0xb810, 0x9085, 0x0500, 0x7002, 0xb814, 0x7006, 0x2069, 0x1800,
-	0x6878, 0x700a, 0x687c, 0x700e, 0x7013, 0x0889, 0x080c, 0x936e,
-	0x721a, 0x7a08, 0x7222, 0x2f10, 0x7226, 0x2071, 0x024c, 0x0005,
-	0x00d6, 0x0096, 0x080c, 0x9198, 0x7814, 0x2048, 0x080c, 0xbb15,
-	0x1130, 0x7814, 0x9084, 0x0700, 0x8007, 0x0033, 0x0010, 0x9006,
-	0x001b, 0x009e, 0x00de, 0x0005, 0x90b6, 0x911f, 0x912f, 0x9155,
-	0x9161, 0x9172, 0x917a, 0x90b4, 0x080c, 0x0db4, 0x0016, 0x0036,
-	0xa97c, 0x918c, 0x0003, 0x0118, 0x9186, 0x0003, 0x1198, 0xaba8,
-	0x7824, 0xd0cc, 0x1168, 0x7316, 0xa898, 0x701a, 0xa894, 0x701e,
-	0x003e, 0x001e, 0x2001, 0x1982, 0x2004, 0x60c2, 0x0804, 0x9380,
-	0xc3e5, 0x0c88, 0x9186, 0x0001, 0x190c, 0x0db4, 0xaba8, 0x7824,
-	0xd0cc, 0x1904, 0x911c, 0x7316, 0xa898, 0x701a, 0xa894, 0x701e,
-	0xa8a4, 0x7026, 0xa8ac, 0x702e, 0x2009, 0x0018, 0x9384, 0x0300,
-	0x0570, 0xd3c4, 0x0110, 0xa8ac, 0x9108, 0xd3cc, 0x0110, 0xa8a4,
-	0x9108, 0x6810, 0x9085, 0x0010, 0x6812, 0x2011, 0x0258, 0x20e9,
-	0x0000, 0x22a0, 0x0156, 0x20a9, 0x0008, 0xa860, 0x20e0, 0xa85c,
-	0x9080, 0x002c, 0x2098, 0x4003, 0x6810, 0x8000, 0x6812, 0x2011,
-	0x0240, 0x22a0, 0x20a9, 0x0005, 0x4003, 0x6810, 0xc084, 0x6812,
-	0x015e, 0x9184, 0x0003, 0x0118, 0x2019, 0x0245, 0x201a, 0x61c2,
-	0x003e, 0x001e, 0x0804, 0x9380, 0xc3e5, 0x0804, 0x90db, 0x2011,
-	0x0008, 0x2001, 0x180f, 0x2004, 0xd0a4, 0x0110, 0x2011, 0x0028,
-	0x7824, 0xd0cc, 0x1110, 0x7216, 0x0470, 0x0ce8, 0xc2e5, 0x2011,
-	0x0302, 0x0016, 0x782c, 0x701a, 0x7930, 0x711e, 0x9105, 0x0108,
-	0xc2dd, 0x001e, 0x7824, 0xd0cc, 0x0108, 0xc2e5, 0x7216, 0x7027,
-	0x0012, 0x702f, 0x0008, 0x7043, 0x7000, 0x7047, 0x0500, 0x704f,
-	0x000a, 0x2069, 0x0200, 0x6813, 0x0009, 0x2071, 0x0240, 0x700b,
-	0x2500, 0x60c3, 0x0032, 0x0804, 0x9380, 0x2011, 0x0028, 0x7824,
-	0xd0cc, 0x1128, 0x7216, 0x60c3, 0x0018, 0x0804, 0x9380, 0x0cd0,
-	0xc2e5, 0x2011, 0x0100, 0x7824, 0xd0cc, 0x0108, 0xc2e5, 0x7216,
-	0x702f, 0x0008, 0x7858, 0x9084, 0x00ff, 0x7036, 0x60c3, 0x0020,
-	0x0804, 0x9380, 0x2011, 0x0008, 0x7824, 0xd0cc, 0x0108, 0xc2e5,
-	0x7216, 0x0c08, 0x0036, 0x7b14, 0x9384, 0xff00, 0x7816, 0x9384,
-	0x00ff, 0x8001, 0x1138, 0x7824, 0xd0cc, 0x0108, 0xc2e5, 0x7216,
-	0x003e, 0x0888, 0x0046, 0x2021, 0x0800, 0x0006, 0x7824, 0xd0cc,
-	0x000e, 0x0108, 0xc4e5, 0x7416, 0x004e, 0x701e, 0x003e, 0x0818,
-	0x00d6, 0x6813, 0x0008, 0xb810, 0x9085, 0x0700, 0x7002, 0xb814,
-	0x7006, 0x2069, 0x1800, 0x6878, 0x700a, 0x687c, 0x700e, 0x7824,
-	0xd0cc, 0x1168, 0x7013, 0x0898, 0x080c, 0x936e, 0x721a, 0x7a08,
-	0x7222, 0x2f10, 0x7226, 0x2071, 0x024c, 0x00de, 0x0005, 0x7013,
-	0x0889, 0x0c90, 0x0016, 0x7814, 0x9084, 0x0700, 0x8007, 0x0013,
-	0x001e, 0x0005, 0x91ca, 0x91ca, 0x91cc, 0x91ca, 0x91ca, 0x91ca,
-	0x91e6, 0x91ca, 0x080c, 0x0db4, 0x7914, 0x918c, 0x08ff, 0x918d,
-	0xf600, 0x7916, 0x2009, 0x0003, 0x00b9, 0x2069, 0x1853, 0x6804,
-	0xd0bc, 0x0130, 0x682c, 0x9084, 0x00ff, 0x8007, 0x7032, 0x0010,
-	0x7033, 0x3f00, 0x60c3, 0x0001, 0x0804, 0x9380, 0x2009, 0x0003,
-	0x0019, 0x7033, 0x7f00, 0x0cb0, 0x0016, 0x080c, 0x9c3f, 0x001e,
-	0xb810, 0x9085, 0x0100, 0x7002, 0xb814, 0x7006, 0x2069, 0x1800,
-	0x6a78, 0x720a, 0x6a7c, 0x720e, 0x7013, 0x0888, 0x918d, 0x0008,
-	0x7116, 0x080c, 0x936e, 0x721a, 0x7a08, 0x7222, 0x2f10, 0x7226,
-	0x0005, 0x00b6, 0x0096, 0x00e6, 0x00d6, 0x00c6, 0x0056, 0x0046,
-	0x0036, 0x2061, 0x0100, 0x2071, 0x1800, 0x7810, 0x2058, 0xb8a0,
-	0x2028, 0xb910, 0xba14, 0x7378, 0x747c, 0x7820, 0x90be, 0x0006,
-	0x0904, 0x92dd, 0x90be, 0x000a, 0x1904, 0x9299, 0xb8b0, 0x609e,
-	0x7814, 0x2048, 0xa87c, 0xd0fc, 0x0558, 0xaf90, 0x9784, 0xff00,
-	0x9105, 0x6062, 0x873f, 0x9784, 0xff00, 0x0006, 0x7814, 0x2048,
-	0xa878, 0xc0fc, 0x9005, 0x000e, 0x1160, 0xaf94, 0x87ff, 0x0198,
-	0x2039, 0x0098, 0x9705, 0x6072, 0x7808, 0x6082, 0x2f00, 0x6086,
-	0x0038, 0x9185, 0x2200, 0x6062, 0x6073, 0x0129, 0x6077, 0x0000,
-	0xb8b0, 0x609e, 0x0050, 0x2039, 0x0029, 0x9705, 0x6072, 0x0cc0,
-	0x9185, 0x0200, 0x6062, 0x6073, 0x2029, 0xa87c, 0xd0fc, 0x0118,
-	0xaf94, 0x87ff, 0x1120, 0x2f00, 0x6082, 0x7808, 0x6086, 0x6266,
-	0x636a, 0x646e, 0x6077, 0x0000, 0xb88c, 0x8000, 0x9084, 0x00ff,
-	0xb88e, 0x8007, 0x607a, 0x607f, 0x0000, 0xa838, 0x608a, 0xa834,
-	0x608e, 0xa848, 0x60c6, 0xa844, 0x60ca, 0xb86c, 0x60ce, 0x60af,
-	0x95d5, 0x60d7, 0x0000, 0x080c, 0x9c24, 0x2009, 0x07d0, 0x60c4,
-	0x9084, 0xfff0, 0x9005, 0x0110, 0x2009, 0x1b58, 0x080c, 0x80bd,
-	0x003e, 0x004e, 0x005e, 0x00ce, 0x00de, 0x00ee, 0x009e, 0x00be,
-	0x0005, 0x7804, 0x9086, 0x0040, 0x0904, 0x9319, 0x9185, 0x0100,
-	0x6062, 0x6266, 0x636a, 0x646e, 0x6073, 0x0809, 0x6077, 0x0008,
-	0x60af, 0x95d5, 0x60d7, 0x0000, 0xb88c, 0x8000, 0x9084, 0x00ff,
-	0xb88e, 0x8007, 0x607a, 0x607f, 0x0000, 0x2f00, 0x6082, 0x7808,
-	0x6086, 0x7814, 0x2048, 0xa838, 0x608a, 0xa834, 0x608e, 0xa848,
-	0x60c6, 0xa844, 0x60ca, 0xb86c, 0x60ce, 0xbab0, 0x629e, 0x080c,
-	0x9c24, 0x2009, 0x07d0, 0x60c4, 0x9084, 0xfff0, 0x9005, 0x0110,
-	0x2009, 0x1b58, 0x080c, 0x80bd, 0x003e, 0x004e, 0x005e, 0x00ce,
-	0x00de, 0x00ee, 0x009e, 0x00be, 0x0005, 0x7814, 0x2048, 0xa87c,
-	0x9084, 0x0003, 0x9086, 0x0002, 0x0904, 0x9335, 0x9185, 0x0100,
-	0x6062, 0x6266, 0x636a, 0x646e, 0x6073, 0x0880, 0x6077, 0x0008,
-	0xb88c, 0x8000, 0x9084, 0x00ff, 0xb88e, 0x8007, 0x607a, 0x7838,
-	0x607e, 0x2f00, 0x6086, 0x7808, 0x6082, 0xa890, 0x608a, 0xa88c,
-	0x608e, 0xa8b0, 0x60c6, 0xa8ac, 0x60ca, 0xa8ac, 0x7930, 0x9108,
-	0x7932, 0xa8b0, 0x792c, 0x9109, 0x792e, 0xb86c, 0x60ce, 0x60af,
-	0x95d5, 0x60d7, 0x0000, 0xbab0, 0x629e, 0x080c, 0x9c01, 0x0804,
-	0x92c9, 0xb8bc, 0xd084, 0x0148, 0xb88c, 0x7814, 0x2048, 0xb88c,
-	0x7846, 0xa836, 0x2900, 0xa83a, 0xb04a, 0x9185, 0x0600, 0x6062,
-	0x6266, 0x636a, 0x646e, 0x6073, 0x0829, 0x6077, 0x0000, 0x60af,
-	0x9575, 0x60d7, 0x0000, 0x0804, 0x92ac, 0x9185, 0x0700, 0x6062,
-	0x6266, 0x636a, 0x646e, 0x7824, 0xd0cc, 0x7826, 0x0118, 0x6073,
-	0x0889, 0x0010, 0x6073, 0x0898, 0x6077, 0x0000, 0xb88c, 0x8000,
-	0x9084, 0x00ff, 0xb88e, 0x8007, 0x607a, 0x607f, 0x0000, 0x2f00,
-	0x6086, 0x7808, 0x6082, 0xa838, 0x608a, 0xa834, 0x608e, 0xa848,
-	0x60c6, 0xa844, 0x60ca, 0xb86c, 0x60ce, 0x60af, 0x95d5, 0x60d7,
-	0x0000, 0xbab0, 0x629e, 0x7824, 0xd0cc, 0x0120, 0x080c, 0x9c24,
-	0x0804, 0x92c9, 0x080c, 0x9c01, 0x0804, 0x92c9, 0x7a10, 0x00b6,
-	0x2258, 0xba8c, 0x8210, 0x9294, 0x00ff, 0xba8e, 0x00be, 0x8217,
-	0x0005, 0x00d6, 0x2069, 0x19b8, 0x6843, 0x0001, 0x00de, 0x0005,
-	0x60a3, 0x0056, 0x60a7, 0x9575, 0x00f1, 0x080c, 0x80af, 0x0005,
-	0x0016, 0x2001, 0x180c, 0x200c, 0x9184, 0x0600, 0x9086, 0x0600,
-	0x0128, 0x0089, 0x080c, 0x80af, 0x001e, 0x0005, 0xc1e5, 0x2001,
-	0x180c, 0x2102, 0x2001, 0x19b9, 0x2003, 0x0000, 0x2001, 0x19c1,
-	0x2003, 0x0000, 0x0c88, 0x0006, 0x6014, 0x9084, 0x1804, 0x9085,
-	0x0009, 0x6016, 0x000e, 0x0005, 0x0016, 0x00c6, 0x0006, 0x2061,
-	0x0100, 0x61a4, 0x60a7, 0x95f5, 0x6014, 0x9084, 0x1804, 0x9085,
-	0x0008, 0x6016, 0x000e, 0xa001, 0xa001, 0xa001, 0x61a6, 0x00ce,
-	0x001e, 0x0005, 0x00c6, 0x00d6, 0x0016, 0x0026, 0x2061, 0x0100,
-	0x2069, 0x0140, 0x080c, 0x6fb2, 0x11e8, 0x2001, 0x19d4, 0x2004,
-	0x9005, 0x1904, 0x9412, 0x0066, 0x2031, 0x0001, 0x080c, 0x7062,
-	0x006e, 0x1160, 0x2061, 0x0100, 0x6020, 0xd0b4, 0x1120, 0x6024,
-	0xd084, 0x090c, 0x0db4, 0x080c, 0x80af, 0x0460, 0x00c6, 0x2061,
-	0x19b8, 0x00d0, 0x6904, 0x9194, 0x4000, 0x0548, 0x080c, 0x93ac,
-	0x080c, 0x2b24, 0x00c6, 0x2061, 0x19b8, 0x6128, 0x9192, 0x0008,
-	0x1258, 0x8108, 0x612a, 0x6124, 0x00ce, 0x81ff, 0x0198, 0x080c,
-	0x80af, 0x080c, 0x93a3, 0x0070, 0x6124, 0x91e5, 0x0000, 0x0140,
-	0x080c, 0xd8c9, 0x080c, 0x80b8, 0x2009, 0x0014, 0x080c, 0x9eac,
-	0x00ce, 0x0000, 0x002e, 0x001e, 0x00de, 0x00ce, 0x0005, 0x2001,
-	0x19d4, 0x2004, 0x9005, 0x1db0, 0x00c6, 0x2061, 0x19b8, 0x6128,
-	0x9192, 0x0003, 0x1e08, 0x8108, 0x612a, 0x00ce, 0x080c, 0x80af,
-	0x080c, 0x5b90, 0x2009, 0x1852, 0x2114, 0x8210, 0x220a, 0x0c10,
-	0x0096, 0x00c6, 0x00d6, 0x00e6, 0x0016, 0x0026, 0x080c, 0x80c5,
-	0x2071, 0x19b8, 0x713c, 0x81ff, 0x0904, 0x94a2, 0x2061, 0x0100,
-	0x2069, 0x0140, 0x080c, 0x6fb2, 0x11b0, 0x0036, 0x2019, 0x0002,
-	0x080c, 0x96d8, 0x003e, 0x713c, 0x2160, 0x080c, 0xd8c9, 0x2009,
-	0x004a, 0x080c, 0x9eac, 0x0066, 0x2031, 0x0001, 0x080c, 0x7062,
-	0x006e, 0x0804, 0x94a2, 0x080c, 0x94ae, 0x0904, 0x94a2, 0x6904,
-	0xd1f4, 0x0904, 0x94a9, 0x080c, 0x2b24, 0x00c6, 0x703c, 0x9065,
-	0x090c, 0x0db4, 0x6020, 0x00ce, 0x9086, 0x0006, 0x1528, 0x61c8,
-	0x60c4, 0x9105, 0x1508, 0x2009, 0x180c, 0x2104, 0xd0d4, 0x01e0,
-	0x6214, 0x9294, 0x1800, 0x1128, 0x6224, 0x9294, 0x0002, 0x1510,
-	0x0030, 0xc0d4, 0x200a, 0xd0cc, 0x0110, 0x080c, 0x2a77, 0x6014,
-	0x9084, 0xe7fd, 0x9085, 0x0010, 0x6016, 0x703c, 0x2060, 0x2009,
-	0x0049, 0x080c, 0x9eac, 0x0070, 0x0036, 0x2019, 0x0001, 0x080c,
-	0x96d8, 0x003e, 0x713c, 0x2160, 0x080c, 0xd8c9, 0x2009, 0x004a,
-	0x080c, 0x9eac, 0x002e, 0x001e, 0x00ee, 0x00de, 0x00ce, 0x009e,
-	0x0005, 0xd1ec, 0x1904, 0x9463, 0x0804, 0x9465, 0x00d6, 0x00c6,
-	0x0096, 0x703c, 0x9065, 0x090c, 0x0db4, 0x2001, 0x1836, 0x2004,
-	0xd09c, 0x1904, 0x953a, 0x2001, 0x0306, 0x200c, 0x9184, 0x0030,
-	0x0904, 0x953a, 0x9184, 0x0048, 0x9086, 0x0008, 0x1904, 0x953a,
-	0x2001, 0x020b, 0x2004, 0xd0fc, 0x0904, 0x953a, 0xd08c, 0x0904,
-	0x953a, 0x2009, 0x1a50, 0x2104, 0x8000, 0x0208, 0x200a, 0x2069,
-	0x0100, 0x6914, 0x918c, 0x0184, 0x918d, 0x0010, 0x6916, 0x69c8,
-	0x2011, 0x0020, 0x68c8, 0x9106, 0x1570, 0x8211, 0x1dd8, 0x2001,
-	0x0306, 0x2003, 0x4800, 0x2001, 0x009a, 0x2003, 0x0004, 0x2001,
-	0x1a36, 0x2003, 0x0000, 0x2001, 0x1a3f, 0x2003, 0x0000, 0x6a88,
-	0x698c, 0x2200, 0x9105, 0x1120, 0x2c10, 0x080c, 0x1a5c, 0x0040,
-	0x6014, 0x2048, 0xaa3a, 0xa936, 0x6ac4, 0x69c8, 0xa946, 0xaa4a,
-	0x0126, 0x00c6, 0x2091, 0x2400, 0x002e, 0x080c, 0x1ae8, 0x190c,
-	0x0db4, 0x012e, 0x0090, 0x2009, 0x1a51, 0x2104, 0x8000, 0x0208,
-	0x200a, 0x69c8, 0x2011, 0x0020, 0x8211, 0x1df0, 0x68c8, 0x9106,
-	0x1dc0, 0x69c4, 0x68c8, 0x9105, 0x0160, 0x6824, 0xd08c, 0x0110,
-	0x6827, 0x0002, 0x7048, 0xc085, 0x704a, 0x0079, 0x7048, 0xc084,
-	0x704a, 0x2009, 0x07d0, 0x080c, 0x80bd, 0x9006, 0x009e, 0x00ce,
-	0x00de, 0x0005, 0x9085, 0x0001, 0x0cc8, 0x0026, 0x00e6, 0x2071,
-	0x19b8, 0x7048, 0xd084, 0x01c0, 0x713c, 0x81ff, 0x01a8, 0x2071,
-	0x0100, 0x9188, 0x0008, 0x2114, 0x928e, 0x0006, 0x1138, 0x7014,
-	0x9084, 0x1984, 0x9085, 0x0012, 0x7016, 0x0030, 0x7014, 0x9084,
-	0x1984, 0x9085, 0x0016, 0x7016, 0x00ee, 0x002e, 0x0005, 0x00b6,
-	0x00e6, 0x00d6, 0x00c6, 0x0066, 0x0056, 0x0046, 0x0006, 0x0126,
-	0x2091, 0x8000, 0x6010, 0x2058, 0xbca0, 0x2071, 0x19b8, 0x7018,
-	0x2058, 0x8bff, 0x0190, 0xb8a0, 0x9406, 0x0118, 0xb854, 0x2058,
-	0x0cc0, 0x6014, 0x0096, 0x2048, 0xac6c, 0xad70, 0xae78, 0x009e,
-	0x080c, 0x6370, 0x0110, 0x9085, 0x0001, 0x012e, 0x000e, 0x004e,
-	0x005e, 0x006e, 0x00ce, 0x00de, 0x00ee, 0x00be, 0x0005, 0x080c,
-	0x8e8e, 0x7003, 0x1200, 0x7838, 0x7012, 0x783c, 0x7016, 0x00c6,
-	0x7820, 0x9086, 0x0004, 0x1148, 0x7810, 0x9005, 0x0130, 0x00b6,
-	0x2058, 0xb810, 0xb914, 0x00be, 0x0020, 0x2061, 0x1800, 0x6078,
-	0x617c, 0x9084, 0x00ff, 0x700a, 0x710e, 0x00ce, 0x60c3, 0x002c,
-	0x0804, 0x9380, 0x080c, 0x8e8e, 0x7003, 0x0f00, 0x7808, 0xd09c,
-	0x0128, 0xb810, 0x9084, 0x00ff, 0x700a, 0xb814, 0x700e, 0x60c3,
-	0x0008, 0x0804, 0x9380, 0x0156, 0x080c, 0x8ed9, 0x7003, 0x0200,
-	0x2011, 0x1848, 0x63f0, 0x2312, 0x20a9, 0x0006, 0x2011, 0x1840,
-	0x2019, 0x1841, 0x9ef0, 0x0002, 0x2376, 0x8e70, 0x2276, 0x8e70,
-	0x9398, 0x0002, 0x9290, 0x0002, 0x1f04, 0x95d4, 0x60c3, 0x001c,
-	0x015e, 0x0804, 0x9380, 0x0016, 0x0026, 0x080c, 0x8eb5, 0x080c,
-	0x8ec7, 0x9e80, 0x0004, 0x20e9, 0x0000, 0x20a0, 0x7814, 0x0096,
-	0x2048, 0xa800, 0x2048, 0xa860, 0x20e0, 0xa85c, 0x9080, 0x0021,
-	0x2098, 0x009e, 0x7808, 0x9088, 0x0002, 0x21a8, 0x9192, 0x0010,
-	0x1250, 0x4003, 0x9080, 0x0004, 0x8003, 0x60c2, 0x080c, 0x9380,
-	0x002e, 0x001e, 0x0005, 0x20a9, 0x0010, 0x4003, 0x080c, 0x9c2a,
-	0x20a1, 0x0240, 0x22a8, 0x4003, 0x0c68, 0x080c, 0x8e8e, 0x7003,
-	0x6200, 0x7808, 0x700e, 0x60c3, 0x0008, 0x0804, 0x9380, 0x0016,
-	0x0026, 0x080c, 0x8e8e, 0x20e9, 0x0000, 0x20a1, 0x024c, 0x7814,
+	0x7824, 0xd0cc, 0x1168, 0x7013, 0x0898, 0x080c, 0x936f, 0x721a,
+	0x7a08, 0x7222, 0x2f10, 0x7226, 0x2071, 0x024c, 0x00de, 0x0005,
+	0x7013, 0x0889, 0x0c90, 0x0016, 0x7814, 0x9084, 0x0700, 0x8007,
+	0x0013, 0x001e, 0x0005, 0x91cb, 0x91cb, 0x91cd, 0x91cb, 0x91cb,
+	0x91cb, 0x91e7, 0x91cb, 0x080c, 0x0db4, 0x7914, 0x918c, 0x08ff,
+	0x918d, 0xf600, 0x7916, 0x2009, 0x0003, 0x00b9, 0x2069, 0x1853,
+	0x6804, 0xd0bc, 0x0130, 0x682c, 0x9084, 0x00ff, 0x8007, 0x7032,
+	0x0010, 0x7033, 0x3f00, 0x60c3, 0x0001, 0x0804, 0x9381, 0x2009,
+	0x0003, 0x0019, 0x7033, 0x7f00, 0x0cb0, 0x0016, 0x080c, 0x9c4a,
+	0x001e, 0xb810, 0x9085, 0x0100, 0x7002, 0xb814, 0x7006, 0x2069,
+	0x1800, 0x6a78, 0x720a, 0x6a7c, 0x720e, 0x7013, 0x0888, 0x918d,
+	0x0008, 0x7116, 0x080c, 0x936f, 0x721a, 0x7a08, 0x7222, 0x2f10,
+	0x7226, 0x0005, 0x00b6, 0x0096, 0x00e6, 0x00d6, 0x00c6, 0x0056,
+	0x0046, 0x0036, 0x2061, 0x0100, 0x2071, 0x1800, 0x7810, 0x2058,
+	0xb8a0, 0x2028, 0xb910, 0xba14, 0x7378, 0x747c, 0x7820, 0x90be,
+	0x0006, 0x0904, 0x92de, 0x90be, 0x000a, 0x1904, 0x929a, 0xb8b0,
+	0x609e, 0x7814, 0x2048, 0xa87c, 0xd0fc, 0x0558, 0xaf90, 0x9784,
+	0xff00, 0x9105, 0x6062, 0x873f, 0x9784, 0xff00, 0x0006, 0x7814,
+	0x2048, 0xa878, 0xc0fc, 0x9005, 0x000e, 0x1160, 0xaf94, 0x87ff,
+	0x0198, 0x2039, 0x0098, 0x9705, 0x6072, 0x7808, 0x6082, 0x2f00,
+	0x6086, 0x0038, 0x9185, 0x2200, 0x6062, 0x6073, 0x0129, 0x6077,
+	0x0000, 0xb8b0, 0x609e, 0x0050, 0x2039, 0x0029, 0x9705, 0x6072,
+	0x0cc0, 0x9185, 0x0200, 0x6062, 0x6073, 0x2029, 0xa87c, 0xd0fc,
+	0x0118, 0xaf94, 0x87ff, 0x1120, 0x2f00, 0x6082, 0x7808, 0x6086,
+	0x6266, 0x636a, 0x646e, 0x6077, 0x0000, 0xb88c, 0x8000, 0x9084,
+	0x00ff, 0xb88e, 0x8007, 0x607a, 0x607f, 0x0000, 0xa838, 0x608a,
+	0xa834, 0x608e, 0xa848, 0x60c6, 0xa844, 0x60ca, 0xb86c, 0x60ce,
+	0x60af, 0x95d5, 0x60d7, 0x0000, 0x080c, 0x9c2f, 0x2009, 0x07d0,
+	0x60c4, 0x9084, 0xfff0, 0x9005, 0x0110, 0x2009, 0x1b58, 0x080c,
+	0x80a6, 0x003e, 0x004e, 0x005e, 0x00ce, 0x00de, 0x00ee, 0x009e,
+	0x00be, 0x0005, 0x7804, 0x9086, 0x0040, 0x0904, 0x931a, 0x9185,
+	0x0100, 0x6062, 0x6266, 0x636a, 0x646e, 0x6073, 0x0809, 0x6077,
+	0x0008, 0x60af, 0x95d5, 0x60d7, 0x0000, 0xb88c, 0x8000, 0x9084,
+	0x00ff, 0xb88e, 0x8007, 0x607a, 0x607f, 0x0000, 0x2f00, 0x6082,
+	0x7808, 0x6086, 0x7814, 0x2048, 0xa838, 0x608a, 0xa834, 0x608e,
+	0xa848, 0x60c6, 0xa844, 0x60ca, 0xb86c, 0x60ce, 0xbab0, 0x629e,
+	0x080c, 0x9c2f, 0x2009, 0x07d0, 0x60c4, 0x9084, 0xfff0, 0x9005,
+	0x0110, 0x2009, 0x1b58, 0x080c, 0x80a6, 0x003e, 0x004e, 0x005e,
+	0x00ce, 0x00de, 0x00ee, 0x009e, 0x00be, 0x0005, 0x7814, 0x2048,
+	0xa87c, 0x9084, 0x0003, 0x9086, 0x0002, 0x0904, 0x9336, 0x9185,
+	0x0100, 0x6062, 0x6266, 0x636a, 0x646e, 0x6073, 0x0880, 0x6077,
+	0x0008, 0xb88c, 0x8000, 0x9084, 0x00ff, 0xb88e, 0x8007, 0x607a,
+	0x7838, 0x607e, 0x2f00, 0x6086, 0x7808, 0x6082, 0xa890, 0x608a,
+	0xa88c, 0x608e, 0xa8b0, 0x60c6, 0xa8ac, 0x60ca, 0xa8ac, 0x7930,
+	0x9108, 0x7932, 0xa8b0, 0x792c, 0x9109, 0x792e, 0xb86c, 0x60ce,
+	0x60af, 0x95d5, 0x60d7, 0x0000, 0xbab0, 0x629e, 0x080c, 0x9c0c,
+	0x0804, 0x92ca, 0xb8bc, 0xd084, 0x0148, 0xb88c, 0x7814, 0x2048,
+	0xb88c, 0x7846, 0xa836, 0x2900, 0xa83a, 0xb04a, 0x9185, 0x0600,
+	0x6062, 0x6266, 0x636a, 0x646e, 0x6073, 0x0829, 0x6077, 0x0000,
+	0x60af, 0x9575, 0x60d7, 0x0000, 0x0804, 0x92ad, 0x9185, 0x0700,
+	0x6062, 0x6266, 0x636a, 0x646e, 0x7824, 0xd0cc, 0x7826, 0x0118,
+	0x6073, 0x0889, 0x0010, 0x6073, 0x0898, 0x6077, 0x0000, 0xb88c,
+	0x8000, 0x9084, 0x00ff, 0xb88e, 0x8007, 0x607a, 0x607f, 0x0000,
+	0x2f00, 0x6086, 0x7808, 0x6082, 0xa838, 0x608a, 0xa834, 0x608e,
+	0xa848, 0x60c6, 0xa844, 0x60ca, 0xb86c, 0x60ce, 0x60af, 0x95d5,
+	0x60d7, 0x0000, 0xbab0, 0x629e, 0x7824, 0xd0cc, 0x0120, 0x080c,
+	0x9c2f, 0x0804, 0x92ca, 0x080c, 0x9c0c, 0x0804, 0x92ca, 0x7a10,
+	0x00b6, 0x2258, 0xba8c, 0x8210, 0x9294, 0x00ff, 0xba8e, 0x00be,
+	0x8217, 0x0005, 0x00d6, 0x2069, 0x19b7, 0x6843, 0x0001, 0x00de,
+	0x0005, 0x60a3, 0x0056, 0x60a7, 0x9575, 0x00f1, 0x080c, 0x8098,
+	0x0005, 0x0016, 0x2001, 0x180c, 0x200c, 0x9184, 0x0600, 0x9086,
+	0x0600, 0x0128, 0x0089, 0x080c, 0x8098, 0x001e, 0x0005, 0xc1e5,
+	0x2001, 0x180c, 0x2102, 0x2001, 0x19b8, 0x2003, 0x0000, 0x2001,
+	0x19c0, 0x2003, 0x0000, 0x0c88, 0x0006, 0x6014, 0x9084, 0x1804,
+	0x9085, 0x0009, 0x6016, 0x000e, 0x0005, 0x0016, 0x00c6, 0x0006,
+	0x2061, 0x0100, 0x61a4, 0x60a7, 0x95f5, 0x6014, 0x9084, 0x1804,
+	0x9085, 0x0008, 0x6016, 0x000e, 0xa001, 0xa001, 0xa001, 0x61a6,
+	0x00ce, 0x001e, 0x0005, 0x00c6, 0x00d6, 0x0016, 0x0026, 0x2061,
+	0x0100, 0x2069, 0x0140, 0x080c, 0x6f9b, 0x11e8, 0x2001, 0x19d3,
+	0x2004, 0x9005, 0x1904, 0x9413, 0x0066, 0x2031, 0x0001, 0x080c,
+	0x704b, 0x006e, 0x1160, 0x2061, 0x0100, 0x6020, 0xd0b4, 0x1120,
+	0x6024, 0xd084, 0x090c, 0x0db4, 0x080c, 0x8098, 0x0460, 0x00c6,
+	0x2061, 0x19b7, 0x00d0, 0x6904, 0x9194, 0x4000, 0x0548, 0x080c,
+	0x93ad, 0x080c, 0x2b26, 0x00c6, 0x2061, 0x19b7, 0x6128, 0x9192,
+	0x0008, 0x1258, 0x8108, 0x612a, 0x6124, 0x00ce, 0x81ff, 0x0198,
+	0x080c, 0x8098, 0x080c, 0x93a4, 0x0070, 0x6124, 0x91e5, 0x0000,
+	0x0140, 0x080c, 0xd8ea, 0x080c, 0x80a1, 0x2009, 0x0014, 0x080c,
+	0x9ebc, 0x00ce, 0x0000, 0x002e, 0x001e, 0x00de, 0x00ce, 0x0005,
+	0x2001, 0x19d3, 0x2004, 0x9005, 0x1db0, 0x00c6, 0x2061, 0x19b7,
+	0x6128, 0x9192, 0x0003, 0x1e08, 0x8108, 0x612a, 0x00ce, 0x080c,
+	0x8098, 0x080c, 0x5b99, 0x2009, 0x1852, 0x2114, 0x8210, 0x220a,
+	0x0c10, 0x0096, 0x00c6, 0x00d6, 0x00e6, 0x0016, 0x0026, 0x080c,
+	0x80ae, 0x2071, 0x19b7, 0x713c, 0x81ff, 0x0904, 0x94a3, 0x2061,
+	0x0100, 0x2069, 0x0140, 0x080c, 0x6f9b, 0x11b0, 0x0036, 0x2019,
+	0x0002, 0x080c, 0x96d9, 0x003e, 0x713c, 0x2160, 0x080c, 0xd8ea,
+	0x2009, 0x004a, 0x080c, 0x9ebc, 0x0066, 0x2031, 0x0001, 0x080c,
+	0x704b, 0x006e, 0x0804, 0x94a3, 0x080c, 0x94af, 0x0904, 0x94a3,
+	0x6904, 0xd1f4, 0x0904, 0x94aa, 0x080c, 0x2b26, 0x00c6, 0x703c,
+	0x9065, 0x090c, 0x0db4, 0x6020, 0x00ce, 0x9086, 0x0006, 0x1528,
+	0x61c8, 0x60c4, 0x9105, 0x1508, 0x2009, 0x180c, 0x2104, 0xd0d4,
+	0x01e0, 0x6214, 0x9294, 0x1800, 0x1128, 0x6224, 0x9294, 0x0002,
+	0x1510, 0x0030, 0xc0d4, 0x200a, 0xd0cc, 0x0110, 0x080c, 0x2a79,
+	0x6014, 0x9084, 0xe7fd, 0x9085, 0x0010, 0x6016, 0x703c, 0x2060,
+	0x2009, 0x0049, 0x080c, 0x9ebc, 0x0070, 0x0036, 0x2019, 0x0001,
+	0x080c, 0x96d9, 0x003e, 0x713c, 0x2160, 0x080c, 0xd8ea, 0x2009,
+	0x004a, 0x080c, 0x9ebc, 0x002e, 0x001e, 0x00ee, 0x00de, 0x00ce,
+	0x009e, 0x0005, 0xd1ec, 0x1904, 0x9464, 0x0804, 0x9466, 0x00d6,
+	0x00c6, 0x0096, 0x703c, 0x9065, 0x090c, 0x0db4, 0x2001, 0x1836,
+	0x2004, 0xd09c, 0x1904, 0x953b, 0x2001, 0x0306, 0x200c, 0x9184,
+	0x0030, 0x0904, 0x953b, 0x9184, 0x0048, 0x9086, 0x0008, 0x1904,
+	0x953b, 0x2001, 0x020b, 0x2004, 0xd0fc, 0x0904, 0x953b, 0xd08c,
+	0x0904, 0x953b, 0x2009, 0x1a4f, 0x2104, 0x8000, 0x0208, 0x200a,
+	0x2069, 0x0100, 0x6914, 0x918c, 0x0184, 0x918d, 0x0010, 0x6916,
+	0x69c8, 0x2011, 0x0020, 0x68c8, 0x9106, 0x1570, 0x8211, 0x1dd8,
+	0x2001, 0x0306, 0x2003, 0x4800, 0x2001, 0x009a, 0x2003, 0x0004,
+	0x2001, 0x1a35, 0x2003, 0x0000, 0x2001, 0x1a3e, 0x2003, 0x0000,
+	0x6a88, 0x698c, 0x2200, 0x9105, 0x1120, 0x2c10, 0x080c, 0x1a5e,
+	0x0040, 0x6014, 0x2048, 0xaa3a, 0xa936, 0x6ac4, 0x69c8, 0xa946,
+	0xaa4a, 0x0126, 0x00c6, 0x2091, 0x2400, 0x002e, 0x080c, 0x1aea,
+	0x190c, 0x0db4, 0x012e, 0x0090, 0x2009, 0x1a50, 0x2104, 0x8000,
+	0x0208, 0x200a, 0x69c8, 0x2011, 0x0020, 0x8211, 0x1df0, 0x68c8,
+	0x9106, 0x1dc0, 0x69c4, 0x68c8, 0x9105, 0x0160, 0x6824, 0xd08c,
+	0x0110, 0x6827, 0x0002, 0x7048, 0xc085, 0x704a, 0x0079, 0x7048,
+	0xc084, 0x704a, 0x2009, 0x07d0, 0x080c, 0x80a6, 0x9006, 0x009e,
+	0x00ce, 0x00de, 0x0005, 0x9085, 0x0001, 0x0cc8, 0x0026, 0x00e6,
+	0x2071, 0x19b7, 0x7048, 0xd084, 0x01c0, 0x713c, 0x81ff, 0x01a8,
+	0x2071, 0x0100, 0x9188, 0x0008, 0x2114, 0x928e, 0x0006, 0x1138,
+	0x7014, 0x9084, 0x1984, 0x9085, 0x0012, 0x7016, 0x0030, 0x7014,
+	0x9084, 0x1984, 0x9085, 0x0016, 0x7016, 0x00ee, 0x002e, 0x0005,
+	0x00b6, 0x00e6, 0x00d6, 0x00c6, 0x0066, 0x0056, 0x0046, 0x0006,
+	0x0126, 0x2091, 0x8000, 0x6010, 0x2058, 0xbca0, 0x2071, 0x19b7,
+	0x7018, 0x2058, 0x8bff, 0x0190, 0xb8a0, 0x9406, 0x0118, 0xb854,
+	0x2058, 0x0cc0, 0x6014, 0x0096, 0x2048, 0xac6c, 0xad70, 0xae78,
+	0x009e, 0x080c, 0x6379, 0x0110, 0x9085, 0x0001, 0x012e, 0x000e,
+	0x004e, 0x005e, 0x006e, 0x00ce, 0x00de, 0x00ee, 0x00be, 0x0005,
+	0x080c, 0x8e8f, 0x7003, 0x1200, 0x7838, 0x7012, 0x783c, 0x7016,
+	0x00c6, 0x7820, 0x9086, 0x0004, 0x1148, 0x7810, 0x9005, 0x0130,
+	0x00b6, 0x2058, 0xb810, 0xb914, 0x00be, 0x0020, 0x2061, 0x1800,
+	0x6078, 0x617c, 0x9084, 0x00ff, 0x700a, 0x710e, 0x00ce, 0x60c3,
+	0x002c, 0x0804, 0x9381, 0x080c, 0x8e8f, 0x7003, 0x0f00, 0x7808,
+	0xd09c, 0x0128, 0xb810, 0x9084, 0x00ff, 0x700a, 0xb814, 0x700e,
+	0x60c3, 0x0008, 0x0804, 0x9381, 0x0156, 0x080c, 0x8eda, 0x7003,
+	0x0200, 0x2011, 0x1848, 0x63f0, 0x2312, 0x20a9, 0x0006, 0x2011,
+	0x1840, 0x2019, 0x1841, 0x9ef0, 0x0002, 0x2376, 0x8e70, 0x2276,
+	0x8e70, 0x9398, 0x0002, 0x9290, 0x0002, 0x1f04, 0x95d5, 0x60c3,
+	0x001c, 0x015e, 0x0804, 0x9381, 0x0016, 0x0026, 0x080c, 0x8eb6,
+	0x080c, 0x8ec8, 0x9e80, 0x0004, 0x20e9, 0x0000, 0x20a0, 0x7814,
 	0x0096, 0x2048, 0xa800, 0x2048, 0xa860, 0x20e0, 0xa85c, 0x9080,
-	0x0023, 0x2098, 0x009e, 0x7808, 0x9088, 0x0002, 0x21a8, 0x4003,
-	0x8003, 0x60c2, 0x080c, 0x9380, 0x002e, 0x001e, 0x0005, 0x00e6,
-	0x00c6, 0x0006, 0x0126, 0x2091, 0x8000, 0x2071, 0x19b8, 0x700c,
-	0x2060, 0x8cff, 0x0178, 0x080c, 0xbd1d, 0x1110, 0x080c, 0xa7c0,
-	0x600c, 0x0006, 0x080c, 0xbf84, 0x080c, 0x9e32, 0x080c, 0x97b0,
-	0x00ce, 0x0c78, 0x2c00, 0x700e, 0x700a, 0x012e, 0x000e, 0x00ce,
-	0x00ee, 0x0005, 0x0126, 0x0156, 0x00f6, 0x00e6, 0x00d6, 0x00c6,
-	0x0066, 0x0026, 0x0016, 0x0006, 0x2091, 0x8000, 0x2001, 0x180c,
-	0x200c, 0x918c, 0xe7ff, 0x2102, 0x2069, 0x0100, 0x2079, 0x0140,
-	0x2071, 0x19b8, 0x7024, 0x2060, 0x8cff, 0x01f8, 0x080c, 0x93ac,
-	0x6ac0, 0x68c3, 0x0000, 0x080c, 0x80b8, 0x00c6, 0x2061, 0x0100,
-	0x080c, 0x9c43, 0x00ce, 0x20a9, 0x01f4, 0x0461, 0x2009, 0x0013,
-	0x080c, 0x9eac, 0x000e, 0x001e, 0x002e, 0x006e, 0x00ce, 0x00de,
-	0x00ee, 0x00fe, 0x015e, 0x012e, 0x0005, 0x2001, 0x1800, 0x2004,
-	0x9096, 0x0001, 0x0d78, 0x9096, 0x0004, 0x0d60, 0x080c, 0x80b8,
-	0x6814, 0x9084, 0x0001, 0x0110, 0x68a7, 0x95f5, 0x6817, 0x0008,
-	0x68c3, 0x0000, 0x2011, 0x5b3a, 0x080c, 0x8038, 0x20a9, 0x01f4,
-	0x0009, 0x08c0, 0x6824, 0xd094, 0x0140, 0x6827, 0x0004, 0x7804,
-	0x9084, 0x4000, 0x190c, 0x2b24, 0x0090, 0xd084, 0x0118, 0x6827,
-	0x0001, 0x0010, 0x1f04, 0x96ba, 0x7804, 0x9084, 0x1000, 0x0138,
-	0x2001, 0x0100, 0x080c, 0x2b14, 0x9006, 0x080c, 0x2b14, 0x0005,
-	0x0126, 0x0156, 0x00f6, 0x00e6, 0x00d6, 0x00c6, 0x0066, 0x0026,
-	0x0016, 0x0006, 0x2091, 0x8000, 0x2001, 0x180c, 0x200c, 0x918c,
-	0xdbff, 0x2102, 0x2069, 0x0100, 0x2079, 0x0140, 0x2071, 0x19b8,
-	0x703c, 0x2060, 0x8cff, 0x0904, 0x9766, 0x9386, 0x0002, 0x1128,
-	0x6814, 0x9084, 0x0002, 0x0904, 0x9766, 0x68af, 0x95f5, 0x6817,
-	0x0010, 0x2009, 0x00fa, 0x8109, 0x1df0, 0x69c6, 0x68cb, 0x0008,
-	0x080c, 0x80c5, 0x080c, 0x1e90, 0x0046, 0x2009, 0x00a5, 0x080c,
-	0x0e2f, 0x2021, 0x0169, 0x2404, 0x9084, 0x000f, 0x9086, 0x0004,
-	0x11f8, 0x68af, 0x95f5, 0x68c6, 0x68cb, 0x0008, 0x00e6, 0x00f6,
-	0x2079, 0x0090, 0x2071, 0x1a36, 0x6814, 0x9084, 0x1984, 0x9085,
-	0x0012, 0x6816, 0x782b, 0x0008, 0x7003, 0x0000, 0x00fe, 0x00ee,
-	0x9386, 0x0002, 0x1128, 0x7884, 0x9005, 0x1110, 0x7887, 0x0001,
-	0x2001, 0x1952, 0x200c, 0x080c, 0x0e2f, 0x004e, 0x20a9, 0x03e8,
-	0x6824, 0xd094, 0x0140, 0x6827, 0x0004, 0x7804, 0x9084, 0x4000,
-	0x190c, 0x2b24, 0x0090, 0xd08c, 0x0118, 0x6827, 0x0002, 0x0010,
-	0x1f04, 0x9740, 0x7804, 0x9084, 0x1000, 0x0138, 0x2001, 0x0100,
-	0x080c, 0x2b14, 0x9006, 0x080c, 0x2b14, 0x6827, 0x4000, 0x6824,
-	0x83ff, 0x1120, 0x2009, 0x0049, 0x080c, 0x9eac, 0x000e, 0x001e,
-	0x002e, 0x006e, 0x00ce, 0x00de, 0x00ee, 0x00fe, 0x015e, 0x012e,
-	0x0005, 0x00d6, 0x0126, 0x2091, 0x8000, 0x2069, 0x19b8, 0x6a06,
-	0x012e, 0x00de, 0x0005, 0x00d6, 0x0126, 0x2091, 0x8000, 0x2069,
-	0x19b8, 0x6a32, 0x012e, 0x00de, 0x0005, 0x080c, 0x9047, 0x7854,
-	0x7032, 0x7042, 0x7047, 0x1000, 0x00f8, 0x080c, 0x9047, 0x7854,
-	0x7032, 0x7042, 0x7047, 0x4000, 0x00b8, 0x080c, 0x9047, 0x7854,
-	0x7032, 0x7042, 0x7047, 0x2000, 0x0078, 0x080c, 0x9047, 0x7854,
-	0x7032, 0x7042, 0x7047, 0x0400, 0x0038, 0x080c, 0x9047, 0x7854,
-	0x7032, 0x7042, 0x7047, 0x0200, 0x60c3, 0x0020, 0x0804, 0x9380,
-	0x00e6, 0x2071, 0x19b8, 0x7020, 0x9005, 0x0110, 0x8001, 0x7022,
-	0x00ee, 0x0005, 0x00f6, 0x00e6, 0x00d6, 0x00c6, 0x0076, 0x0066,
-	0x0006, 0x0126, 0x2091, 0x8000, 0x2071, 0x19b8, 0x7614, 0x2660,
-	0x2678, 0x2039, 0x0001, 0x87ff, 0x0904, 0x9855, 0x8cff, 0x0904,
-	0x9855, 0x6020, 0x9086, 0x0006, 0x1904, 0x9850, 0x88ff, 0x0138,
-	0x2800, 0x9c06, 0x1904, 0x9850, 0x2039, 0x0000, 0x0050, 0x6010,
-	0x9b06, 0x1904, 0x9850, 0x85ff, 0x0120, 0x6054, 0x9106, 0x1904,
-	0x9850, 0x7024, 0x9c06, 0x15b0, 0x2069, 0x0100, 0x68c0, 0x9005,
-	0x1160, 0x6824, 0xd084, 0x0148, 0x6827, 0x0001, 0x080c, 0x80b8,
-	0x080c, 0x98da, 0x7027, 0x0000, 0x0428, 0x080c, 0x80b8, 0x6820,
-	0xd0b4, 0x0110, 0x68a7, 0x95f5, 0x6817, 0x0008, 0x68c3, 0x0000,
-	0x080c, 0x98da, 0x7027, 0x0000, 0x0036, 0x2069, 0x0140, 0x6b04,
-	0x9384, 0x1000, 0x0138, 0x2001, 0x0100, 0x080c, 0x2b14, 0x9006,
-	0x080c, 0x2b14, 0x2069, 0x0100, 0x6824, 0xd084, 0x0110, 0x6827,
-	0x0001, 0x003e, 0x7014, 0x9c36, 0x1110, 0x660c, 0x7616, 0x7010,
-	0x9c36, 0x1140, 0x2c00, 0x9f36, 0x0118, 0x2f00, 0x7012, 0x0010,
-	0x7013, 0x0000, 0x660c, 0x0066, 0x2c00, 0x9f06, 0x0110, 0x7e0e,
-	0x0008, 0x2678, 0x89ff, 0x1168, 0x600f, 0x0000, 0x6014, 0x0096,
-	0x2048, 0x080c, 0xbb15, 0x0110, 0x080c, 0xd4d5, 0x009e, 0x080c,
-	0x9e62, 0x080c, 0x97b0, 0x88ff, 0x1190, 0x00ce, 0x0804, 0x97cb,
-	0x2c78, 0x600c, 0x2060, 0x0804, 0x97cb, 0x9006, 0x012e, 0x000e,
-	0x006e, 0x007e, 0x00ce, 0x00de, 0x00ee, 0x00fe, 0x0005, 0x601b,
-	0x0000, 0x00ce, 0x98c5, 0x0001, 0x0c88, 0x00f6, 0x00e6, 0x00d6,
-	0x0096, 0x00c6, 0x0066, 0x0026, 0x0006, 0x0126, 0x2091, 0x8000,
-	0x2071, 0x19b8, 0x7638, 0x2660, 0x2678, 0x8cff, 0x0904, 0x98c9,
-	0x6020, 0x9086, 0x0006, 0x1904, 0x98c4, 0x87ff, 0x0128, 0x2700,
-	0x9c06, 0x1904, 0x98c4, 0x0040, 0x6010, 0x9b06, 0x15e8, 0x85ff,
-	0x0118, 0x6054, 0x9106, 0x15c0, 0x703c, 0x9c06, 0x1168, 0x0036,
-	0x2019, 0x0001, 0x080c, 0x96d8, 0x7033, 0x0000, 0x9006, 0x703e,
-	0x7042, 0x7046, 0x704a, 0x003e, 0x7038, 0x9c36, 0x1110, 0x660c,
-	0x763a, 0x7034, 0x9c36, 0x1140, 0x2c00, 0x9f36, 0x0118, 0x2f00,
-	0x7036, 0x0010, 0x7037, 0x0000, 0x660c, 0x0066, 0x2c00, 0x9f06,
-	0x0110, 0x7e0e, 0x0008, 0x2678, 0x600f, 0x0000, 0x6014, 0x2048,
-	0x080c, 0xbb15, 0x0110, 0x080c, 0xd4d5, 0x080c, 0x9e62, 0x87ff,
-	0x1198, 0x00ce, 0x0804, 0x9875, 0x2c78, 0x600c, 0x2060, 0x0804,
-	0x9875, 0x9006, 0x012e, 0x000e, 0x002e, 0x006e, 0x00ce, 0x009e,
-	0x00de, 0x00ee, 0x00fe, 0x0005, 0x601b, 0x0000, 0x00ce, 0x97bd,
-	0x0001, 0x0c80, 0x00e6, 0x2071, 0x19b8, 0x2001, 0x1800, 0x2004,
-	0x9086, 0x0002, 0x1118, 0x7007, 0x0005, 0x0010, 0x7007, 0x0000,
-	0x00ee, 0x0005, 0x00f6, 0x00e6, 0x00c6, 0x0066, 0x0026, 0x0006,
-	0x0126, 0x2091, 0x8000, 0x2071, 0x19b8, 0x2c10, 0x7638, 0x2660,
-	0x2678, 0x8cff, 0x0518, 0x2200, 0x9c06, 0x11e0, 0x7038, 0x9c36,
-	0x1110, 0x660c, 0x763a, 0x7034, 0x9c36, 0x1140, 0x2c00, 0x9f36,
-	0x0118, 0x2f00, 0x7036, 0x0010, 0x7037, 0x0000, 0x660c, 0x2c00,
-	0x9f06, 0x0110, 0x7e0e, 0x0008, 0x2678, 0x600f, 0x0000, 0x9085,
-	0x0001, 0x0020, 0x2c78, 0x600c, 0x2060, 0x08d8, 0x012e, 0x000e,
-	0x002e, 0x006e, 0x00ce, 0x00ee, 0x00fe, 0x0005, 0x0096, 0x00f6,
-	0x00e6, 0x00d6, 0x00c6, 0x0066, 0x0026, 0x0006, 0x0126, 0x2091,
-	0x8000, 0x2071, 0x19b8, 0x760c, 0x2660, 0x2678, 0x8cff, 0x0904,
-	0x99b6, 0x6010, 0x00b6, 0x2058, 0xb8a0, 0x00be, 0x9206, 0x1904,
-	0x99b1, 0x7024, 0x9c06, 0x1520, 0x2069, 0x0100, 0x68c0, 0x9005,
-	0x0904, 0x998d, 0x080c, 0x93ac, 0x68c3, 0x0000, 0x080c, 0x98da,
-	0x7027, 0x0000, 0x0036, 0x2069, 0x0140, 0x6b04, 0x9384, 0x1000,
-	0x0138, 0x2001, 0x0100, 0x080c, 0x2b14, 0x9006, 0x080c, 0x2b14,
-	0x2069, 0x0100, 0x6824, 0xd084, 0x0110, 0x6827, 0x0001, 0x003e,
-	0x700c, 0x9c36, 0x1110, 0x660c, 0x760e, 0x7008, 0x9c36, 0x1140,
-	0x2c00, 0x9f36, 0x0118, 0x2f00, 0x700a, 0x0010, 0x700b, 0x0000,
-	0x660c, 0x0066, 0x2c00, 0x9f06, 0x0110, 0x7e0e, 0x0008, 0x2678,
-	0x600f, 0x0000, 0x080c, 0xbd0c, 0x1158, 0x080c, 0x3003, 0x080c,
-	0xbd1d, 0x11f0, 0x080c, 0xa7c0, 0x00d8, 0x080c, 0x98da, 0x08c0,
-	0x080c, 0xbd1d, 0x1118, 0x080c, 0xa7c0, 0x0090, 0x6014, 0x2048,
-	0x080c, 0xbb15, 0x0168, 0x6020, 0x9086, 0x0003, 0x1508, 0xa867,
-	0x0103, 0xab7a, 0xa877, 0x0000, 0x080c, 0x687f, 0x080c, 0xbd00,
-	0x080c, 0xbf84, 0x080c, 0x9e62, 0x080c, 0x97b0, 0x00ce, 0x0804,
-	0x9936, 0x2c78, 0x600c, 0x2060, 0x0804, 0x9936, 0x012e, 0x000e,
-	0x002e, 0x006e, 0x00ce, 0x00de, 0x00ee, 0x00fe, 0x009e, 0x0005,
-	0x6020, 0x9086, 0x0006, 0x1d20, 0x080c, 0xd4d5, 0x0c08, 0x00d6,
-	0x080c, 0x8ed9, 0x7003, 0x0200, 0x7007, 0x0014, 0x60c3, 0x0014,
-	0x20e1, 0x0001, 0x2099, 0x195a, 0x20e9, 0x0000, 0x20a1, 0x0250,
-	0x20a9, 0x0004, 0x4003, 0x7023, 0x0004, 0x7027, 0x7878, 0x080c,
-	0x9380, 0x00de, 0x0005, 0x080c, 0x8ed9, 0x700b, 0x0800, 0x7814,
-	0x9084, 0xff00, 0x700e, 0x7814, 0x9084, 0x00ff, 0x7022, 0x782c,
-	0x7026, 0x7858, 0x9084, 0x00ff, 0x9085, 0x0200, 0x7002, 0x7858,
-	0x9084, 0xff00, 0x8007, 0x7006, 0x60c2, 0x0804, 0x9380, 0x00b6,
-	0x00d6, 0x0016, 0x00d6, 0x2f68, 0x2009, 0x0035, 0x080c, 0xc18a,
-	0x00de, 0x1904, 0x9a64, 0x080c, 0x8e8e, 0x7003, 0x1300, 0x782c,
-	0x080c, 0x9b66, 0x2068, 0x6820, 0x9086, 0x0003, 0x0560, 0x7810,
-	0x2058, 0xbaa0, 0x080c, 0x9db1, 0x11d8, 0x9286, 0x007e, 0x1128,
-	0x700b, 0x00ff, 0x700f, 0xfffe, 0x0498, 0x9286, 0x007f, 0x1128,
-	0x700b, 0x00ff, 0x700f, 0xfffd, 0x0458, 0x9284, 0xff80, 0x0180,
-	0x9286, 0x0080, 0x1128, 0x700b, 0x00ff, 0x700f, 0xfffc, 0x0400,
-	0x92d8, 0x1000, 0x2b5c, 0xb810, 0x700a, 0xb814, 0x700e, 0x00c0,
-	0x6098, 0x700e, 0x00a8, 0x080c, 0x9db1, 0x1130, 0x7810, 0x2058,
-	0xb8a0, 0x9082, 0x007e, 0x0250, 0x00d6, 0x2069, 0x181e, 0x2d04,
-	0x700a, 0x8d68, 0x2d04, 0x700e, 0x00de, 0x0010, 0x6034, 0x700e,
-	0x7838, 0x7012, 0x783c, 0x7016, 0x60c3, 0x000c, 0x001e, 0x00de,
-	0x080c, 0x9380, 0x00be, 0x0005, 0x781b, 0x0001, 0x7803, 0x0006,
-	0x001e, 0x00de, 0x00be, 0x0005, 0x792c, 0x9180, 0x0008, 0x200c,
-	0x9186, 0x0006, 0x01c0, 0x9186, 0x0003, 0x0904, 0x9ade, 0x9186,
-	0x0005, 0x0904, 0x9ac7, 0x9186, 0x0004, 0x05d8, 0x9186, 0x0008,
-	0x0904, 0x9acf, 0x7807, 0x0037, 0x782f, 0x0003, 0x7817, 0x1700,
-	0x080c, 0x9b43, 0x0005, 0x080c, 0x9b04, 0x00d6, 0x0026, 0x792c,
-	0x2168, 0x2009, 0x4000, 0x6800, 0x0002, 0x9aa8, 0x9ab3, 0x9aaa,
-	0x9ab3, 0x9aaf, 0x9aa8, 0x9aa8, 0x9ab3, 0x9ab3, 0x9ab3, 0x9ab3,
-	0x9aa8, 0x9aa8, 0x9aa8, 0x9aa8, 0x9aa8, 0x9ab3, 0x9aa8, 0x9ab3,
-	0x080c, 0x0db4, 0x6824, 0xd0e4, 0x0110, 0xd0cc, 0x0110, 0x900e,
-	0x0010, 0x2009, 0x2000, 0x682c, 0x7022, 0x6830, 0x7026, 0x0804,
-	0x9afd, 0x080c, 0x9b04, 0x00d6, 0x0026, 0x792c, 0x2168, 0x2009,
-	0x4000, 0x6a00, 0x9286, 0x0002, 0x1108, 0x900e, 0x04b0, 0x04e1,
-	0x00d6, 0x0026, 0x792c, 0x2168, 0x2009, 0x4000, 0x0470, 0x04a1,
-	0x00d6, 0x0026, 0x792c, 0x2168, 0x2009, 0x4000, 0x9286, 0x0005,
-	0x0118, 0x9286, 0x0002, 0x1108, 0x900e, 0x00f8, 0x0429, 0x00d6,
-	0x0026, 0x792c, 0x2168, 0x6814, 0x0096, 0x2048, 0xa9ac, 0xa834,
-	0x9112, 0xa9b0, 0xa838, 0x009e, 0x9103, 0x7022, 0x7226, 0x792c,
-	0x9180, 0x0000, 0x2004, 0x908e, 0x0002, 0x0130, 0x908e, 0x0004,
-	0x0118, 0x2009, 0x4000, 0x0008, 0x900e, 0x712a, 0x60c3, 0x0018,
-	0x002e, 0x00de, 0x0804, 0x9380, 0x00b6, 0x0036, 0x0046, 0x0056,
-	0x0066, 0x080c, 0x8ed9, 0x9006, 0x7003, 0x0200, 0x7938, 0x710a,
-	0x793c, 0x710e, 0x7810, 0x2058, 0xb8a0, 0x080c, 0x9db1, 0x1118,
-	0x9092, 0x007e, 0x0268, 0x00d6, 0x2069, 0x181e, 0x2d2c, 0x8d68,
-	0x2d34, 0x90d8, 0x1000, 0x2b5c, 0xbb10, 0xbc14, 0x00de, 0x0028,
-	0x901e, 0x6498, 0x2029, 0x0000, 0x6634, 0x782c, 0x9080, 0x0008,
-	0x2004, 0x9086, 0x0003, 0x1128, 0x7512, 0x7616, 0x731a, 0x741e,
-	0x0020, 0x7312, 0x7416, 0x751a, 0x761e, 0x006e, 0x005e, 0x004e,
-	0x003e, 0x00be, 0x0005, 0x080c, 0x8ed9, 0x7003, 0x0100, 0x782c,
-	0x700a, 0x7814, 0x700e, 0x700e, 0x60c3, 0x0008, 0x0804, 0x9380,
-	0x080c, 0x8e85, 0x7003, 0x1400, 0x7838, 0x700a, 0x0079, 0x783c,
-	0x700e, 0x782c, 0x7012, 0x7830, 0x7016, 0x7834, 0x9084, 0x00ff,
-	0x8007, 0x701a, 0x60c3, 0x0010, 0x0804, 0x9380, 0x00e6, 0x2071,
-	0x0240, 0x0006, 0x00f6, 0x2078, 0x7810, 0x00b6, 0x2058, 0xb8bc,
-	0xd084, 0x0120, 0x7848, 0x702a, 0x7844, 0x702e, 0x00be, 0x00fe,
-	0x000e, 0x00ee, 0x0005, 0x080c, 0x8ed0, 0x7003, 0x0100, 0x782c,
-	0x700a, 0x7814, 0x700e, 0x60c3, 0x0008, 0x0804, 0x9380, 0x0021,
-	0x60c3, 0x0000, 0x0804, 0x9380, 0x00d6, 0x080c, 0x9c3f, 0xb810,
-	0x9085, 0x0300, 0x7002, 0xb814, 0x7006, 0x2069, 0x1800, 0x6878,
-	0x700a, 0x687c, 0x700e, 0x7013, 0x0819, 0x080c, 0x936e, 0x721a,
-	0x2f10, 0x7222, 0x7a08, 0x7226, 0x2071, 0x024c, 0x00de, 0x0005,
-	0x00a9, 0x7914, 0x712a, 0x60c3, 0x0000, 0x60a7, 0x9575, 0x0026,
-	0x080c, 0x29ca, 0x0228, 0x2011, 0x0101, 0x2204, 0xc0c5, 0x2012,
-	0x002e, 0x080c, 0x93a3, 0x080c, 0x80af, 0x0005, 0x0036, 0x0096,
-	0x00d6, 0x00e6, 0x7858, 0x2048, 0xaa7c, 0x9296, 0x00c0, 0x9294,
-	0xfffd, 0xaa7e, 0xaa80, 0x9294, 0x0300, 0xaa82, 0xa96c, 0x9194,
-	0x00ff, 0xab74, 0x9384, 0x00ff, 0x908d, 0xc200, 0xa96e, 0x9384,
-	0xff00, 0x9215, 0xaa76, 0xa870, 0xaa78, 0xa87a, 0xaa72, 0x00d6,
-	0x2069, 0x0200, 0x080c, 0x9c3f, 0x00de, 0x20e9, 0x0000, 0x20a1,
-	0x0240, 0x20a9, 0x000a, 0xa860, 0x20e0, 0xa85c, 0x9080, 0x001b,
-	0x2098, 0x4003, 0x60a3, 0x0035, 0xaa68, 0x9294, 0x7000, 0x9286,
-	0x3000, 0x0110, 0x60a3, 0x0037, 0x00ee, 0x00de, 0x009e, 0x003e,
-	0x0005, 0x900e, 0x7814, 0x0096, 0x2048, 0xa87c, 0xd0fc, 0x01c0,
-	0x9084, 0x0003, 0x11a8, 0x2001, 0x180c, 0x2004, 0xd0bc, 0x0180,
-	0x7824, 0xd0cc, 0x1168, 0xd0c4, 0x1158, 0xa8a8, 0x9005, 0x1140,
-	0x2001, 0x180c, 0x200c, 0xc1d5, 0x2102, 0x2009, 0x1983, 0x210c,
-	0x009e, 0x918d, 0x0092, 0x0010, 0x2009, 0x0096, 0x60ab, 0x0036,
-	0x6116, 0x0005, 0x2009, 0x0009, 0x00a0, 0x2009, 0x000a, 0x0088,
-	0x2009, 0x000b, 0x0070, 0x2009, 0x000c, 0x0058, 0x2009, 0x000d,
-	0x0040, 0x2009, 0x000e, 0x0028, 0x2009, 0x000f, 0x0010, 0x2009,
-	0x0008, 0x6912, 0x0005, 0x00d6, 0x9290, 0x0018, 0x8214, 0x20e9,
-	0x0000, 0x2069, 0x0200, 0x6813, 0x0000, 0x22a8, 0x9284, 0x00e0,
-	0x0128, 0x20a9, 0x0020, 0x9292, 0x0020, 0x0008, 0x9016, 0x20a1,
-	0x0240, 0x9006, 0x4004, 0x82ff, 0x0120, 0x6810, 0x8000, 0x6812,
-	0x0c60, 0x00de, 0x0005, 0x00d6, 0x0096, 0x6014, 0x2048, 0xa878,
-	0x6056, 0x9006, 0xa836, 0xa83a, 0xa99c, 0xa946, 0xa84a, 0x6023,
-	0x0003, 0x6007, 0x0040, 0x6003, 0x0003, 0x600b, 0xffff, 0xa817,
-	0x0001, 0xa842, 0xa83e, 0x2900, 0xa85a, 0xa813, 0x1f24, 0x080c,
-	0x8456, 0x0126, 0x2091, 0x8000, 0x080c, 0x8a4e, 0x012e, 0x009e,
-	0x00de, 0x0005, 0x00f6, 0x00e6, 0x00d6, 0x00c6, 0x00a6, 0x0096,
-	0x0066, 0x0126, 0x2091, 0x8000, 0x2071, 0x19b8, 0x760c, 0x2660,
-	0x2678, 0x8cff, 0x0904, 0x9d11, 0x7024, 0x9c06, 0x1520, 0x2069,
-	0x0100, 0x68c0, 0x9005, 0x0904, 0x9ce8, 0x080c, 0x93ac, 0x68c3,
-	0x0000, 0x080c, 0x98da, 0x7027, 0x0000, 0x0036, 0x2069, 0x0140,
-	0x6b04, 0x9384, 0x1000, 0x0138, 0x2001, 0x0100, 0x080c, 0x2b14,
-	0x9006, 0x080c, 0x2b14, 0x2069, 0x0100, 0x6824, 0xd084, 0x0110,
-	0x6827, 0x0001, 0x003e, 0x700c, 0x9c36, 0x1110, 0x660c, 0x760e,
-	0x7008, 0x9c36, 0x1140, 0x2c00, 0x9f36, 0x0118, 0x2f00, 0x700a,
-	0x0010, 0x700b, 0x0000, 0x660c, 0x0066, 0x2c00, 0x9f06, 0x0110,
-	0x7e0e, 0x0008, 0x2678, 0x600f, 0x0000, 0x080c, 0xbd0c, 0x1158,
-	0x080c, 0x3003, 0x080c, 0xbd1d, 0x11f0, 0x080c, 0xa7c0, 0x00d8,
-	0x080c, 0x98da, 0x08c0, 0x080c, 0xbd1d, 0x1118, 0x080c, 0xa7c0,
-	0x0090, 0x6014, 0x2048, 0x080c, 0xbb15, 0x0168, 0x6020, 0x9086,
+	0x0021, 0x2098, 0x009e, 0x7808, 0x9088, 0x0002, 0x21a8, 0x9192,
+	0x0010, 0x1250, 0x4003, 0x9080, 0x0004, 0x8003, 0x60c2, 0x080c,
+	0x9381, 0x002e, 0x001e, 0x0005, 0x20a9, 0x0010, 0x4003, 0x080c,
+	0x9c35, 0x20a1, 0x0240, 0x22a8, 0x4003, 0x0c68, 0x080c, 0x8e8f,
+	0x7003, 0x6200, 0x7808, 0x700e, 0x60c3, 0x0008, 0x0804, 0x9381,
+	0x0016, 0x0026, 0x080c, 0x8e8f, 0x20e9, 0x0000, 0x20a1, 0x024c,
+	0x7814, 0x0096, 0x2048, 0xa800, 0x2048, 0xa860, 0x20e0, 0xa85c,
+	0x9080, 0x0023, 0x2098, 0x009e, 0x7808, 0x9088, 0x0002, 0x21a8,
+	0x4003, 0x8003, 0x60c2, 0x080c, 0x9381, 0x002e, 0x001e, 0x0005,
+	0x00e6, 0x00c6, 0x0006, 0x0126, 0x2091, 0x8000, 0x2071, 0x19b7,
+	0x700c, 0x2060, 0x8cff, 0x0178, 0x080c, 0xbd32, 0x1110, 0x080c,
+	0xa7d1, 0x600c, 0x0006, 0x080c, 0xbf9e, 0x080c, 0x9e42, 0x080c,
+	0x97b1, 0x00ce, 0x0c78, 0x2c00, 0x700e, 0x700a, 0x012e, 0x000e,
+	0x00ce, 0x00ee, 0x0005, 0x0126, 0x0156, 0x00f6, 0x00e6, 0x00d6,
+	0x00c6, 0x0066, 0x0026, 0x0016, 0x0006, 0x2091, 0x8000, 0x2001,
+	0x180c, 0x200c, 0x918c, 0xe7ff, 0x2102, 0x2069, 0x0100, 0x2079,
+	0x0140, 0x2071, 0x19b7, 0x7024, 0x2060, 0x8cff, 0x01f8, 0x080c,
+	0x93ad, 0x6ac0, 0x68c3, 0x0000, 0x080c, 0x80a1, 0x00c6, 0x2061,
+	0x0100, 0x080c, 0x9c4e, 0x00ce, 0x20a9, 0x01f4, 0x0461, 0x2009,
+	0x0013, 0x080c, 0x9ebc, 0x000e, 0x001e, 0x002e, 0x006e, 0x00ce,
+	0x00de, 0x00ee, 0x00fe, 0x015e, 0x012e, 0x0005, 0x2001, 0x1800,
+	0x2004, 0x9096, 0x0001, 0x0d78, 0x9096, 0x0004, 0x0d60, 0x080c,
+	0x80a1, 0x6814, 0x9084, 0x0001, 0x0110, 0x68a7, 0x95f5, 0x6817,
+	0x0008, 0x68c3, 0x0000, 0x2011, 0x5b43, 0x080c, 0x8021, 0x20a9,
+	0x01f4, 0x0009, 0x08c0, 0x6824, 0xd094, 0x0140, 0x6827, 0x0004,
+	0x7804, 0x9084, 0x4000, 0x190c, 0x2b26, 0x0090, 0xd084, 0x0118,
+	0x6827, 0x0001, 0x0010, 0x1f04, 0x96bb, 0x7804, 0x9084, 0x1000,
+	0x0138, 0x2001, 0x0100, 0x080c, 0x2b16, 0x9006, 0x080c, 0x2b16,
+	0x0005, 0x0126, 0x0156, 0x00f6, 0x00e6, 0x00d6, 0x00c6, 0x0066,
+	0x0026, 0x0016, 0x0006, 0x2091, 0x8000, 0x2001, 0x180c, 0x200c,
+	0x918c, 0xdbff, 0x2102, 0x2069, 0x0100, 0x2079, 0x0140, 0x2071,
+	0x19b7, 0x703c, 0x2060, 0x8cff, 0x0904, 0x9767, 0x9386, 0x0002,
+	0x1128, 0x6814, 0x9084, 0x0002, 0x0904, 0x9767, 0x68af, 0x95f5,
+	0x6817, 0x0010, 0x2009, 0x00fa, 0x8109, 0x1df0, 0x69c6, 0x68cb,
+	0x0008, 0x080c, 0x80ae, 0x080c, 0x1e92, 0x0046, 0x2009, 0x00a5,
+	0x080c, 0x0e2f, 0x2021, 0x0169, 0x2404, 0x9084, 0x000f, 0x9086,
+	0x0004, 0x11f8, 0x68af, 0x95f5, 0x68c6, 0x68cb, 0x0008, 0x00e6,
+	0x00f6, 0x2079, 0x0090, 0x2071, 0x1a35, 0x6814, 0x9084, 0x1984,
+	0x9085, 0x0012, 0x6816, 0x782b, 0x0008, 0x7003, 0x0000, 0x00fe,
+	0x00ee, 0x9386, 0x0002, 0x1128, 0x7884, 0x9005, 0x1110, 0x7887,
+	0x0001, 0x2001, 0x1951, 0x200c, 0x080c, 0x0e2f, 0x004e, 0x20a9,
+	0x03e8, 0x6824, 0xd094, 0x0140, 0x6827, 0x0004, 0x7804, 0x9084,
+	0x4000, 0x190c, 0x2b26, 0x0090, 0xd08c, 0x0118, 0x6827, 0x0002,
+	0x0010, 0x1f04, 0x9741, 0x7804, 0x9084, 0x1000, 0x0138, 0x2001,
+	0x0100, 0x080c, 0x2b16, 0x9006, 0x080c, 0x2b16, 0x6827, 0x4000,
+	0x6824, 0x83ff, 0x1120, 0x2009, 0x0049, 0x080c, 0x9ebc, 0x000e,
+	0x001e, 0x002e, 0x006e, 0x00ce, 0x00de, 0x00ee, 0x00fe, 0x015e,
+	0x012e, 0x0005, 0x00d6, 0x0126, 0x2091, 0x8000, 0x2069, 0x19b7,
+	0x6a06, 0x012e, 0x00de, 0x0005, 0x00d6, 0x0126, 0x2091, 0x8000,
+	0x2069, 0x19b7, 0x6a32, 0x012e, 0x00de, 0x0005, 0x080c, 0x9048,
+	0x7854, 0x7032, 0x7042, 0x7047, 0x1000, 0x00f8, 0x080c, 0x9048,
+	0x7854, 0x7032, 0x7042, 0x7047, 0x4000, 0x00b8, 0x080c, 0x9048,
+	0x7854, 0x7032, 0x7042, 0x7047, 0x2000, 0x0078, 0x080c, 0x9048,
+	0x7854, 0x7032, 0x7042, 0x7047, 0x0400, 0x0038, 0x080c, 0x9048,
+	0x7854, 0x7032, 0x7042, 0x7047, 0x0200, 0x60c3, 0x0020, 0x0804,
+	0x9381, 0x00e6, 0x2071, 0x19b7, 0x7020, 0x9005, 0x0110, 0x8001,
+	0x7022, 0x00ee, 0x0005, 0x00f6, 0x00e6, 0x00d6, 0x00c6, 0x0076,
+	0x0066, 0x0006, 0x0126, 0x2091, 0x8000, 0x2071, 0x19b7, 0x7614,
+	0x2660, 0x2678, 0x2039, 0x0001, 0x87ff, 0x0904, 0x9856, 0x8cff,
+	0x0904, 0x9856, 0x6020, 0x9086, 0x0006, 0x1904, 0x9851, 0x88ff,
+	0x0138, 0x2800, 0x9c06, 0x1904, 0x9851, 0x2039, 0x0000, 0x0050,
+	0x6010, 0x9b06, 0x1904, 0x9851, 0x85ff, 0x0120, 0x6054, 0x9106,
+	0x1904, 0x9851, 0x7024, 0x9c06, 0x15b0, 0x2069, 0x0100, 0x68c0,
+	0x9005, 0x1160, 0x6824, 0xd084, 0x0148, 0x6827, 0x0001, 0x080c,
+	0x80a1, 0x080c, 0x98db, 0x7027, 0x0000, 0x0428, 0x080c, 0x80a1,
+	0x6820, 0xd0b4, 0x0110, 0x68a7, 0x95f5, 0x6817, 0x0008, 0x68c3,
+	0x0000, 0x080c, 0x98db, 0x7027, 0x0000, 0x0036, 0x2069, 0x0140,
+	0x6b04, 0x9384, 0x1000, 0x0138, 0x2001, 0x0100, 0x080c, 0x2b16,
+	0x9006, 0x080c, 0x2b16, 0x2069, 0x0100, 0x6824, 0xd084, 0x0110,
+	0x6827, 0x0001, 0x003e, 0x7014, 0x9c36, 0x1110, 0x660c, 0x7616,
+	0x7010, 0x9c36, 0x1140, 0x2c00, 0x9f36, 0x0118, 0x2f00, 0x7012,
+	0x0010, 0x7013, 0x0000, 0x660c, 0x0066, 0x2c00, 0x9f06, 0x0110,
+	0x7e0e, 0x0008, 0x2678, 0x89ff, 0x1168, 0x600f, 0x0000, 0x6014,
+	0x0096, 0x2048, 0x080c, 0xbb2a, 0x0110, 0x080c, 0xd4f6, 0x009e,
+	0x080c, 0x9e72, 0x080c, 0x97b1, 0x88ff, 0x1190, 0x00ce, 0x0804,
+	0x97cc, 0x2c78, 0x600c, 0x2060, 0x0804, 0x97cc, 0x9006, 0x012e,
+	0x000e, 0x006e, 0x007e, 0x00ce, 0x00de, 0x00ee, 0x00fe, 0x0005,
+	0x601b, 0x0000, 0x00ce, 0x98c5, 0x0001, 0x0c88, 0x00f6, 0x00e6,
+	0x00d6, 0x0096, 0x00c6, 0x0066, 0x0026, 0x0006, 0x0126, 0x2091,
+	0x8000, 0x2071, 0x19b7, 0x7638, 0x2660, 0x2678, 0x8cff, 0x0904,
+	0x98ca, 0x6020, 0x9086, 0x0006, 0x1904, 0x98c5, 0x87ff, 0x0128,
+	0x2700, 0x9c06, 0x1904, 0x98c5, 0x0040, 0x6010, 0x9b06, 0x15e8,
+	0x85ff, 0x0118, 0x6054, 0x9106, 0x15c0, 0x703c, 0x9c06, 0x1168,
+	0x0036, 0x2019, 0x0001, 0x080c, 0x96d9, 0x7033, 0x0000, 0x9006,
+	0x703e, 0x7042, 0x7046, 0x704a, 0x003e, 0x7038, 0x9c36, 0x1110,
+	0x660c, 0x763a, 0x7034, 0x9c36, 0x1140, 0x2c00, 0x9f36, 0x0118,
+	0x2f00, 0x7036, 0x0010, 0x7037, 0x0000, 0x660c, 0x0066, 0x2c00,
+	0x9f06, 0x0110, 0x7e0e, 0x0008, 0x2678, 0x600f, 0x0000, 0x6014,
+	0x2048, 0x080c, 0xbb2a, 0x0110, 0x080c, 0xd4f6, 0x080c, 0x9e72,
+	0x87ff, 0x1198, 0x00ce, 0x0804, 0x9876, 0x2c78, 0x600c, 0x2060,
+	0x0804, 0x9876, 0x9006, 0x012e, 0x000e, 0x002e, 0x006e, 0x00ce,
+	0x009e, 0x00de, 0x00ee, 0x00fe, 0x0005, 0x601b, 0x0000, 0x00ce,
+	0x97bd, 0x0001, 0x0c80, 0x00e6, 0x2071, 0x19b7, 0x2001, 0x1800,
+	0x2004, 0x9086, 0x0002, 0x1118, 0x7007, 0x0005, 0x0010, 0x7007,
+	0x0000, 0x00ee, 0x0005, 0x00f6, 0x00e6, 0x00c6, 0x0066, 0x0026,
+	0x0006, 0x0126, 0x2091, 0x8000, 0x2071, 0x19b7, 0x2c10, 0x7638,
+	0x2660, 0x2678, 0x8cff, 0x0540, 0x2200, 0x9c06, 0x1508, 0x7038,
+	0x9c36, 0x1110, 0x660c, 0x763a, 0x7034, 0x9c36, 0x1140, 0x2c00,
+	0x9f36, 0x0118, 0x2f00, 0x7036, 0x0010, 0x7037, 0x0000, 0x660c,
+	0x2c00, 0x9f06, 0x0110, 0x7e0e, 0x0008, 0x2678, 0x600f, 0x0000,
+	0x6004, 0x9086, 0x0040, 0x090c, 0x8861, 0x9085, 0x0001, 0x0020,
+	0x2c78, 0x600c, 0x2060, 0x08b0, 0x012e, 0x000e, 0x002e, 0x006e,
+	0x00ce, 0x00ee, 0x00fe, 0x0005, 0x0096, 0x00f6, 0x00e6, 0x00d6,
+	0x00c6, 0x0066, 0x0026, 0x0006, 0x0126, 0x2091, 0x8000, 0x2071,
+	0x19b7, 0x760c, 0x2660, 0x2678, 0x8cff, 0x0904, 0x99c1, 0x6010,
+	0x00b6, 0x2058, 0xb8a0, 0x00be, 0x9206, 0x1904, 0x99bc, 0x7024,
+	0x9c06, 0x1520, 0x2069, 0x0100, 0x68c0, 0x9005, 0x0904, 0x9993,
+	0x080c, 0x93ad, 0x68c3, 0x0000, 0x080c, 0x98db, 0x7027, 0x0000,
+	0x0036, 0x2069, 0x0140, 0x6b04, 0x9384, 0x1000, 0x0138, 0x2001,
+	0x0100, 0x080c, 0x2b16, 0x9006, 0x080c, 0x2b16, 0x2069, 0x0100,
+	0x6824, 0xd084, 0x0110, 0x6827, 0x0001, 0x003e, 0x700c, 0x9c36,
+	0x1110, 0x660c, 0x760e, 0x7008, 0x9c36, 0x1140, 0x2c00, 0x9f36,
+	0x0118, 0x2f00, 0x700a, 0x0010, 0x700b, 0x0000, 0x660c, 0x0066,
+	0x2c00, 0x9f06, 0x0110, 0x7e0e, 0x0008, 0x2678, 0x600f, 0x0000,
+	0x080c, 0xbd21, 0x1180, 0x080c, 0x3005, 0x080c, 0xbd32, 0x1518,
+	0x080c, 0xa7d1, 0x0400, 0x080c, 0x98db, 0x6824, 0xd084, 0x09b0,
+	0x6827, 0x0001, 0x0898, 0x080c, 0xbd32, 0x1118, 0x080c, 0xa7d1,
+	0x0090, 0x6014, 0x2048, 0x080c, 0xbb2a, 0x0168, 0x6020, 0x9086,
+	0x0003, 0x1508, 0xa867, 0x0103, 0xab7a, 0xa877, 0x0000, 0x080c,
+	0x6884, 0x080c, 0xbd15, 0x080c, 0xbf9e, 0x080c, 0x9e72, 0x080c,
+	0x97b1, 0x00ce, 0x0804, 0x993c, 0x2c78, 0x600c, 0x2060, 0x0804,
+	0x993c, 0x012e, 0x000e, 0x002e, 0x006e, 0x00ce, 0x00de, 0x00ee,
+	0x00fe, 0x009e, 0x0005, 0x6020, 0x9086, 0x0006, 0x1d20, 0x080c,
+	0xd4f6, 0x0c08, 0x00d6, 0x080c, 0x8eda, 0x7003, 0x0200, 0x7007,
+	0x0014, 0x60c3, 0x0014, 0x20e1, 0x0001, 0x2099, 0x1959, 0x20e9,
+	0x0000, 0x20a1, 0x0250, 0x20a9, 0x0004, 0x4003, 0x7023, 0x0004,
+	0x7027, 0x7878, 0x080c, 0x9381, 0x00de, 0x0005, 0x080c, 0x8eda,
+	0x700b, 0x0800, 0x7814, 0x9084, 0xff00, 0x700e, 0x7814, 0x9084,
+	0x00ff, 0x7022, 0x782c, 0x7026, 0x7858, 0x9084, 0x00ff, 0x9085,
+	0x0200, 0x7002, 0x7858, 0x9084, 0xff00, 0x8007, 0x7006, 0x60c2,
+	0x0804, 0x9381, 0x00b6, 0x00d6, 0x0016, 0x00d6, 0x2f68, 0x2009,
+	0x0035, 0x080c, 0xc1a4, 0x00de, 0x1904, 0x9a6f, 0x080c, 0x8e8f,
+	0x7003, 0x1300, 0x782c, 0x080c, 0x9b71, 0x2068, 0x6820, 0x9086,
+	0x0003, 0x0560, 0x7810, 0x2058, 0xbaa0, 0x080c, 0x9dc1, 0x11d8,
+	0x9286, 0x007e, 0x1128, 0x700b, 0x00ff, 0x700f, 0xfffe, 0x0498,
+	0x9286, 0x007f, 0x1128, 0x700b, 0x00ff, 0x700f, 0xfffd, 0x0458,
+	0x9284, 0xff80, 0x0180, 0x9286, 0x0080, 0x1128, 0x700b, 0x00ff,
+	0x700f, 0xfffc, 0x0400, 0x92d8, 0x1000, 0x2b5c, 0xb810, 0x700a,
+	0xb814, 0x700e, 0x00c0, 0x6098, 0x700e, 0x00a8, 0x080c, 0x9dc1,
+	0x1130, 0x7810, 0x2058, 0xb8a0, 0x9082, 0x007e, 0x0250, 0x00d6,
+	0x2069, 0x181e, 0x2d04, 0x700a, 0x8d68, 0x2d04, 0x700e, 0x00de,
+	0x0010, 0x6034, 0x700e, 0x7838, 0x7012, 0x783c, 0x7016, 0x60c3,
+	0x000c, 0x001e, 0x00de, 0x080c, 0x9381, 0x00be, 0x0005, 0x781b,
+	0x0001, 0x7803, 0x0006, 0x001e, 0x00de, 0x00be, 0x0005, 0x792c,
+	0x9180, 0x0008, 0x200c, 0x9186, 0x0006, 0x01c0, 0x9186, 0x0003,
+	0x0904, 0x9ae9, 0x9186, 0x0005, 0x0904, 0x9ad2, 0x9186, 0x0004,
+	0x05d8, 0x9186, 0x0008, 0x0904, 0x9ada, 0x7807, 0x0037, 0x782f,
+	0x0003, 0x7817, 0x1700, 0x080c, 0x9b4e, 0x0005, 0x080c, 0x9b0f,
+	0x00d6, 0x0026, 0x792c, 0x2168, 0x2009, 0x4000, 0x6800, 0x0002,
+	0x9ab3, 0x9abe, 0x9ab5, 0x9abe, 0x9aba, 0x9ab3, 0x9ab3, 0x9abe,
+	0x9abe, 0x9abe, 0x9abe, 0x9ab3, 0x9ab3, 0x9ab3, 0x9ab3, 0x9ab3,
+	0x9abe, 0x9ab3, 0x9abe, 0x080c, 0x0db4, 0x6824, 0xd0e4, 0x0110,
+	0xd0cc, 0x0110, 0x900e, 0x0010, 0x2009, 0x2000, 0x682c, 0x7022,
+	0x6830, 0x7026, 0x0804, 0x9b08, 0x080c, 0x9b0f, 0x00d6, 0x0026,
+	0x792c, 0x2168, 0x2009, 0x4000, 0x6a00, 0x9286, 0x0002, 0x1108,
+	0x900e, 0x04b0, 0x04e1, 0x00d6, 0x0026, 0x792c, 0x2168, 0x2009,
+	0x4000, 0x0470, 0x04a1, 0x00d6, 0x0026, 0x792c, 0x2168, 0x2009,
+	0x4000, 0x9286, 0x0005, 0x0118, 0x9286, 0x0002, 0x1108, 0x900e,
+	0x00f8, 0x0429, 0x00d6, 0x0026, 0x792c, 0x2168, 0x6814, 0x0096,
+	0x2048, 0xa9ac, 0xa834, 0x9112, 0xa9b0, 0xa838, 0x009e, 0x9103,
+	0x7022, 0x7226, 0x792c, 0x9180, 0x0000, 0x2004, 0x908e, 0x0002,
+	0x0130, 0x908e, 0x0004, 0x0118, 0x2009, 0x4000, 0x0008, 0x900e,
+	0x712a, 0x60c3, 0x0018, 0x002e, 0x00de, 0x0804, 0x9381, 0x00b6,
+	0x0036, 0x0046, 0x0056, 0x0066, 0x080c, 0x8eda, 0x9006, 0x7003,
+	0x0200, 0x7938, 0x710a, 0x793c, 0x710e, 0x7810, 0x2058, 0xb8a0,
+	0x080c, 0x9dc1, 0x1118, 0x9092, 0x007e, 0x0268, 0x00d6, 0x2069,
+	0x181e, 0x2d2c, 0x8d68, 0x2d34, 0x90d8, 0x1000, 0x2b5c, 0xbb10,
+	0xbc14, 0x00de, 0x0028, 0x901e, 0x6498, 0x2029, 0x0000, 0x6634,
+	0x782c, 0x9080, 0x0008, 0x2004, 0x9086, 0x0003, 0x1128, 0x7512,
+	0x7616, 0x731a, 0x741e, 0x0020, 0x7312, 0x7416, 0x751a, 0x761e,
+	0x006e, 0x005e, 0x004e, 0x003e, 0x00be, 0x0005, 0x080c, 0x8eda,
+	0x7003, 0x0100, 0x782c, 0x700a, 0x7814, 0x700e, 0x700e, 0x60c3,
+	0x0008, 0x0804, 0x9381, 0x080c, 0x8e86, 0x7003, 0x1400, 0x7838,
+	0x700a, 0x0079, 0x783c, 0x700e, 0x782c, 0x7012, 0x7830, 0x7016,
+	0x7834, 0x9084, 0x00ff, 0x8007, 0x701a, 0x60c3, 0x0010, 0x0804,
+	0x9381, 0x00e6, 0x2071, 0x0240, 0x0006, 0x00f6, 0x2078, 0x7810,
+	0x00b6, 0x2058, 0xb8bc, 0xd084, 0x0120, 0x7848, 0x702a, 0x7844,
+	0x702e, 0x00be, 0x00fe, 0x000e, 0x00ee, 0x0005, 0x080c, 0x8ed1,
+	0x7003, 0x0100, 0x782c, 0x700a, 0x7814, 0x700e, 0x60c3, 0x0008,
+	0x0804, 0x9381, 0x0021, 0x60c3, 0x0000, 0x0804, 0x9381, 0x00d6,
+	0x080c, 0x9c4a, 0xb810, 0x9085, 0x0300, 0x7002, 0xb814, 0x7006,
+	0x2069, 0x1800, 0x6878, 0x700a, 0x687c, 0x700e, 0x7013, 0x0819,
+	0x080c, 0x936f, 0x721a, 0x2f10, 0x7222, 0x7a08, 0x7226, 0x2071,
+	0x024c, 0x00de, 0x0005, 0x00a9, 0x7914, 0x712a, 0x60c3, 0x0000,
+	0x60a7, 0x9575, 0x0026, 0x080c, 0x29cc, 0x0228, 0x2011, 0x0101,
+	0x2204, 0xc0c5, 0x2012, 0x002e, 0x080c, 0x93a4, 0x080c, 0x8098,
+	0x0005, 0x0036, 0x0096, 0x00d6, 0x00e6, 0x7858, 0x2048, 0xaa7c,
+	0x9296, 0x00c0, 0x9294, 0xfffd, 0xaa7e, 0xaa80, 0x9294, 0x0300,
+	0xaa82, 0xa96c, 0x9194, 0x00ff, 0xab74, 0x9384, 0x00ff, 0x908d,
+	0xc200, 0xa96e, 0x9384, 0xff00, 0x9215, 0xaa76, 0xa870, 0xaa78,
+	0xa87a, 0xaa72, 0x00d6, 0x2069, 0x0200, 0x080c, 0x9c4a, 0x00de,
+	0x20e9, 0x0000, 0x20a1, 0x0240, 0x20a9, 0x000a, 0xa860, 0x20e0,
+	0xa85c, 0x9080, 0x001b, 0x2098, 0x4003, 0x60a3, 0x0035, 0xaa68,
+	0x9294, 0x7000, 0x9286, 0x3000, 0x0110, 0x60a3, 0x0037, 0x00ee,
+	0x00de, 0x009e, 0x003e, 0x0005, 0x900e, 0x7814, 0x0096, 0x2048,
+	0xa87c, 0xd0fc, 0x01c0, 0x9084, 0x0003, 0x11a8, 0x2001, 0x180c,
+	0x2004, 0xd0bc, 0x0180, 0x7824, 0xd0cc, 0x1168, 0xd0c4, 0x1158,
+	0xa8a8, 0x9005, 0x1140, 0x2001, 0x180c, 0x200c, 0xc1d5, 0x2102,
+	0x2009, 0x1982, 0x210c, 0x009e, 0x918d, 0x0092, 0x0010, 0x2009,
+	0x0096, 0x60ab, 0x0036, 0x6116, 0x0005, 0x2009, 0x0009, 0x00a0,
+	0x2009, 0x000a, 0x0088, 0x2009, 0x000b, 0x0070, 0x2009, 0x000c,
+	0x0058, 0x2009, 0x000d, 0x0040, 0x2009, 0x000e, 0x0028, 0x2009,
+	0x000f, 0x0010, 0x2009, 0x0008, 0x6912, 0x0005, 0x00d6, 0x9290,
+	0x0018, 0x8214, 0x20e9, 0x0000, 0x2069, 0x0200, 0x6813, 0x0000,
+	0x22a8, 0x9284, 0x00e0, 0x0128, 0x20a9, 0x0020, 0x9292, 0x0020,
+	0x0008, 0x9016, 0x20a1, 0x0240, 0x9006, 0x4004, 0x82ff, 0x0120,
+	0x6810, 0x8000, 0x6812, 0x0c60, 0x00de, 0x0005, 0x00d6, 0x0096,
+	0x6014, 0x2048, 0xa878, 0x6056, 0x9006, 0xa836, 0xa83a, 0xa99c,
+	0xa946, 0xa84a, 0x6023, 0x0003, 0x6007, 0x0040, 0x6003, 0x0003,
+	0x600b, 0xffff, 0xa817, 0x0001, 0xa842, 0xa83e, 0x2900, 0xa85a,
+	0xa813, 0x1f26, 0x080c, 0x843f, 0x0126, 0x2091, 0x8000, 0x080c,
+	0x8a4a, 0x012e, 0x009e, 0x00de, 0x0005, 0x00f6, 0x00e6, 0x00d6,
+	0x00c6, 0x00a6, 0x0096, 0x0066, 0x0126, 0x2091, 0x8000, 0x2071,
+	0x19b7, 0x760c, 0x2660, 0x2678, 0x8cff, 0x0904, 0x9d21, 0x7024,
+	0x9c06, 0x1520, 0x2069, 0x0100, 0x68c0, 0x9005, 0x0904, 0x9cf3,
+	0x080c, 0x93ad, 0x68c3, 0x0000, 0x080c, 0x98db, 0x7027, 0x0000,
+	0x0036, 0x2069, 0x0140, 0x6b04, 0x9384, 0x1000, 0x0138, 0x2001,
+	0x0100, 0x080c, 0x2b16, 0x9006, 0x080c, 0x2b16, 0x2069, 0x0100,
+	0x6824, 0xd084, 0x0110, 0x6827, 0x0001, 0x003e, 0x700c, 0x9c36,
+	0x1110, 0x660c, 0x760e, 0x7008, 0x9c36, 0x1140, 0x2c00, 0x9f36,
+	0x0118, 0x2f00, 0x700a, 0x0010, 0x700b, 0x0000, 0x660c, 0x0066,
+	0x2c00, 0x9f06, 0x0110, 0x7e0e, 0x0008, 0x2678, 0x600f, 0x0000,
+	0x080c, 0xbd21, 0x1180, 0x080c, 0x3005, 0x080c, 0xbd32, 0x1518,
+	0x080c, 0xa7d1, 0x0400, 0x080c, 0x98db, 0x6824, 0xd084, 0x09b0,
+	0x6827, 0x0001, 0x0898, 0x080c, 0xbd32, 0x1118, 0x080c, 0xa7d1,
+	0x0090, 0x6014, 0x2048, 0x080c, 0xbb2a, 0x0168, 0x6020, 0x9086,
 	0x0003, 0x1520, 0xa867, 0x0103, 0xab7a, 0xa877, 0x0000, 0x080c,
-	0x688c, 0x080c, 0xbd00, 0x080c, 0xbf84, 0x080c, 0x9e62, 0x080c,
-	0x97b0, 0x00ce, 0x0804, 0x9c99, 0x2c78, 0x600c, 0x2060, 0x0804,
-	0x9c99, 0x700f, 0x0000, 0x700b, 0x0000, 0x012e, 0x006e, 0x009e,
+	0x6891, 0x080c, 0xbd15, 0x080c, 0xbf9e, 0x080c, 0x9e72, 0x080c,
+	0x97b1, 0x00ce, 0x0804, 0x9ca4, 0x2c78, 0x600c, 0x2060, 0x0804,
+	0x9ca4, 0x700f, 0x0000, 0x700b, 0x0000, 0x012e, 0x006e, 0x009e,
 	0x00ae, 0x00ce, 0x00de, 0x00ee, 0x00fe, 0x0005, 0x6020, 0x9086,
-	0x0006, 0x1d08, 0x080c, 0xd4d5, 0x08f0, 0x00d6, 0x0156, 0x080c,
-	0x8ed9, 0x7a14, 0x82ff, 0x0138, 0x7003, 0x0100, 0x700b, 0x0003,
+	0x0006, 0x1d08, 0x080c, 0xd4f6, 0x08f0, 0x00d6, 0x0156, 0x080c,
+	0x8eda, 0x7a14, 0x82ff, 0x0138, 0x7003, 0x0100, 0x700b, 0x0003,
 	0x60c3, 0x0008, 0x0490, 0x7003, 0x0200, 0x7007, 0x0000, 0x2069,
 	0x1800, 0x901e, 0x6800, 0x9086, 0x0004, 0x1110, 0xc38d, 0x0060,
-	0x080c, 0x6fb2, 0x1110, 0xc3ad, 0x0008, 0xc3a5, 0x6ad8, 0xd29c,
+	0x080c, 0x6f9b, 0x1110, 0xc3ad, 0x0008, 0xc3a5, 0x6ad8, 0xd29c,
 	0x1110, 0xd2ac, 0x0108, 0xc39d, 0x730e, 0x2011, 0x1848, 0x63f0,
 	0x2312, 0x20a9, 0x0006, 0x2011, 0x1840, 0x2019, 0x1841, 0x2071,
 	0x0250, 0x2376, 0x8e70, 0x2276, 0x8e70, 0x9398, 0x0002, 0x9290,
-	0x0002, 0x1f04, 0x9d59, 0x60c3, 0x0020, 0x080c, 0x9380, 0x015e,
-	0x00de, 0x0005, 0x0156, 0x080c, 0x8ed9, 0x7a14, 0x82ff, 0x0168,
+	0x0002, 0x1f04, 0x9d69, 0x60c3, 0x0020, 0x080c, 0x9381, 0x015e,
+	0x00de, 0x0005, 0x0156, 0x080c, 0x8eda, 0x7a14, 0x82ff, 0x0168,
 	0x9286, 0xffff, 0x0118, 0x9282, 0x000e, 0x1238, 0x7003, 0x0100,
 	0x700b, 0x0003, 0x60c3, 0x0008, 0x0488, 0x7003, 0x0200, 0x7007,
-	0x001c, 0x700f, 0x0001, 0x2011, 0x198e, 0x2204, 0x8007, 0x701a,
+	0x001c, 0x700f, 0x0001, 0x2011, 0x198d, 0x2204, 0x8007, 0x701a,
 	0x8210, 0x2204, 0x8007, 0x701e, 0x0421, 0x1120, 0xb8a0, 0x9082,
 	0x007f, 0x0248, 0x2001, 0x181e, 0x2004, 0x7022, 0x2001, 0x181f,
 	0x2004, 0x7026, 0x0030, 0x2001, 0x1817, 0x2004, 0x9084, 0x00ff,
 	0x7026, 0x20a9, 0x0004, 0x20e1, 0x0001, 0x2099, 0x1805, 0x20e9,
 	0x0000, 0x20a1, 0x0256, 0x4003, 0x60c3, 0x001c, 0x015e, 0x0804,
-	0x9380, 0x0006, 0x2001, 0x1836, 0x2004, 0xd0ac, 0x000e, 0x0005,
-	0x2011, 0x0003, 0x080c, 0x9771, 0x2011, 0x0002, 0x080c, 0x977b,
-	0x080c, 0x9662, 0x0036, 0x901e, 0x080c, 0x96d8, 0x003e, 0x0005,
+	0x9381, 0x0006, 0x2001, 0x1836, 0x2004, 0xd0ac, 0x000e, 0x0005,
+	0x2011, 0x0003, 0x080c, 0x9772, 0x2011, 0x0002, 0x080c, 0x977c,
+	0x080c, 0x9663, 0x0036, 0x901e, 0x080c, 0x96d9, 0x003e, 0x0005,
 	0x2071, 0x1883, 0x7000, 0x9005, 0x0140, 0x2001, 0x0976, 0x2071,
 	0x1800, 0x7072, 0x7076, 0x7067, 0xffe0, 0x2071, 0x1800, 0x7070,
 	0x7052, 0x7057, 0x1cd0, 0x0005, 0x00e6, 0x0126, 0x2071, 0x1800,
@@ -4861,42 +4863,42 @@ unsigned short risc_code01[] = {
 	0x6016, 0x601a, 0x6012, 0x6023, 0x0000, 0x6003, 0x0000, 0x601e,
 	0x6056, 0x605a, 0x6026, 0x602a, 0x602e, 0x6032, 0x6036, 0x603a,
 	0x603e, 0x6042, 0x2061, 0x1800, 0x6050, 0x8000, 0x6052, 0x9086,
-	0x0001, 0x0108, 0x0005, 0x0126, 0x2091, 0x8000, 0x080c, 0x8973,
+	0x0001, 0x0108, 0x0005, 0x0126, 0x2091, 0x8000, 0x080c, 0x896d,
 	0x012e, 0x0cc0, 0x0006, 0x6000, 0x9086, 0x0000, 0x01b0, 0x601c,
-	0xd084, 0x190c, 0x190d, 0x6017, 0x0000, 0x6023, 0x0007, 0x2001,
-	0x1957, 0x2004, 0x0006, 0x9082, 0x0051, 0x000e, 0x0208, 0x8004,
-	0x601a, 0x080c, 0xd787, 0x6043, 0x0000, 0x000e, 0x0005, 0x00e6,
+	0xd084, 0x190c, 0x190f, 0x6017, 0x0000, 0x6023, 0x0007, 0x2001,
+	0x1956, 0x2004, 0x0006, 0x9082, 0x0051, 0x000e, 0x0208, 0x8004,
+	0x601a, 0x080c, 0xd7a8, 0x6043, 0x0000, 0x000e, 0x0005, 0x00e6,
 	0x0126, 0x2071, 0x1800, 0x2091, 0x8000, 0x7550, 0x9582, 0x0001,
 	0x0608, 0x7054, 0x2060, 0x6000, 0x9086, 0x0000, 0x0148, 0x9ce0,
 	0x0018, 0x7064, 0x9c02, 0x1208, 0x0cb0, 0x2061, 0x1cd0, 0x0c98,
 	0x6003, 0x0008, 0x8529, 0x7552, 0x9ca8, 0x0018, 0x7064, 0x9502,
 	0x1230, 0x7556, 0x9085, 0x0001, 0x012e, 0x00ee, 0x0005, 0x7057,
 	0x1cd0, 0x0cc0, 0x9006, 0x0cc0, 0x6020, 0x9084, 0x000f, 0x0002,
-	0x9ebf, 0x9ec8, 0x9ee3, 0x9efe, 0xc238, 0xc255, 0xc270, 0x9ebf,
-	0x9ec8, 0x9ebf, 0x9f1a, 0x9ebf, 0x9ebf, 0x9ebf, 0x9ebf, 0x9186,
-	0x0013, 0x1128, 0x080c, 0x886e, 0x080c, 0x8973, 0x0005, 0x0005,
+	0x9ecf, 0x9ed8, 0x9ef3, 0x9f0e, 0xc252, 0xc26f, 0xc28a, 0x9ecf,
+	0x9ed8, 0x9ecf, 0x9f2a, 0x9ecf, 0x9ecf, 0x9ecf, 0x9ecf, 0x9186,
+	0x0013, 0x1128, 0x080c, 0x8861, 0x080c, 0x896d, 0x0005, 0x0005,
 	0x0066, 0x6000, 0x90b2, 0x0016, 0x1a0c, 0x0db4, 0x0013, 0x006e,
-	0x0005, 0x9ee1, 0xa639, 0xa807, 0x9ee1, 0xa895, 0xa1fd, 0x9ee1,
-	0x9ee1, 0xa5bb, 0xae37, 0x9ee1, 0x9ee1, 0x9ee1, 0x9ee1, 0x9ee1,
-	0x9ee1, 0x080c, 0x0db4, 0x0066, 0x6000, 0x90b2, 0x0016, 0x1a0c,
-	0x0db4, 0x0013, 0x006e, 0x0005, 0x9efc, 0xb50b, 0x9efc, 0x9efc,
-	0x9efc, 0x9efc, 0x9efc, 0x9efc, 0xb4b0, 0xb68d, 0x9efc, 0xb54c,
-	0xb5cb, 0xb54c, 0xb5cb, 0x9efc, 0x080c, 0x0db4, 0x6000, 0x9082,
-	0x0016, 0x1a0c, 0x0db4, 0x6000, 0x0002, 0x9f18, 0xae7e, 0xaf63,
-	0xb093, 0xb23e, 0x9f18, 0x9f18, 0x9f18, 0xae52, 0xb43c, 0xb43f,
-	0x9f18, 0x9f18, 0x9f18, 0x9f18, 0xb46e, 0x9f18, 0x9f18, 0x9f18,
+	0x0005, 0x9ef1, 0xa64a, 0xa818, 0x9ef1, 0xa8a6, 0xa20d, 0x9ef1,
+	0x9ef1, 0xa5cc, 0xae4a, 0x9ef1, 0x9ef1, 0x9ef1, 0x9ef1, 0x9ef1,
+	0x9ef1, 0x080c, 0x0db4, 0x0066, 0x6000, 0x90b2, 0x0016, 0x1a0c,
+	0x0db4, 0x0013, 0x006e, 0x0005, 0x9f0c, 0xb51e, 0x9f0c, 0x9f0c,
+	0x9f0c, 0x9f0c, 0x9f0c, 0x9f0c, 0xb4c3, 0xb6a0, 0x9f0c, 0xb55f,
+	0xb5de, 0xb55f, 0xb5de, 0x9f0c, 0x080c, 0x0db4, 0x6000, 0x9082,
+	0x0016, 0x1a0c, 0x0db4, 0x6000, 0x0002, 0x9f28, 0xae91, 0xaf76,
+	0xb0a6, 0xb251, 0x9f28, 0x9f28, 0x9f28, 0xae65, 0xb44f, 0xb452,
+	0x9f28, 0x9f28, 0x9f28, 0x9f28, 0xb481, 0x9f28, 0x9f28, 0x9f28,
 	0x080c, 0x0db4, 0x0066, 0x6000, 0x90b2, 0x0016, 0x1a0c, 0x0db4,
-	0x0013, 0x006e, 0x0005, 0x9f33, 0x9f33, 0x9f76, 0xa015, 0xa0aa,
-	0x9f33, 0x9f33, 0x9f33, 0x9f35, 0x9f33, 0x9f33, 0x9f33, 0x9f33,
-	0x9f33, 0x9f33, 0x9f33, 0x080c, 0x0db4, 0x9186, 0x004c, 0x0588,
+	0x0013, 0x006e, 0x0005, 0x9f43, 0x9f43, 0x9f86, 0xa025, 0xa0ba,
+	0x9f43, 0x9f43, 0x9f43, 0x9f45, 0x9f43, 0x9f43, 0x9f43, 0x9f43,
+	0x9f43, 0x9f43, 0x9f43, 0x080c, 0x0db4, 0x9186, 0x004c, 0x0588,
 	0x9186, 0x0003, 0x190c, 0x0db4, 0x0096, 0x601c, 0xc0ed, 0x601e,
 	0x6003, 0x0003, 0x6106, 0x6014, 0x2048, 0xa87c, 0x9084, 0xa000,
 	0xc0b5, 0xa87e, 0xa8ac, 0xa846, 0xa8b0, 0xa84a, 0x9006, 0xa836,
 	0xa83a, 0xa884, 0x9092, 0x199a, 0x0210, 0x2001, 0x1999, 0x8003,
-	0x8013, 0x8213, 0x9210, 0x621a, 0x009e, 0x2c10, 0x080c, 0x1a5c,
-	0x080c, 0x8456, 0x0126, 0x2091, 0x8000, 0x080c, 0x8a4e, 0x012e,
+	0x8013, 0x8213, 0x9210, 0x621a, 0x009e, 0x2c10, 0x080c, 0x1a5e,
+	0x080c, 0x843f, 0x0126, 0x2091, 0x8000, 0x080c, 0x8a4a, 0x012e,
 	0x0005, 0x6010, 0x00b6, 0x2058, 0xbca0, 0x00be, 0x2c00, 0x080c,
-	0xa0cc, 0x080c, 0xc22a, 0x6003, 0x0007, 0x0005, 0x00d6, 0x0096,
+	0xa0dc, 0x080c, 0xc244, 0x6003, 0x0007, 0x0005, 0x00d6, 0x0096,
 	0x00f6, 0x2079, 0x1800, 0x7a8c, 0x6014, 0x2048, 0xa87c, 0xd0ec,
 	0x1110, 0x9290, 0x0018, 0xac78, 0xc4fc, 0x0046, 0xa8e0, 0x9005,
 	0x1140, 0xa8dc, 0x921a, 0x0140, 0x0220, 0xa87b, 0x0007, 0x2010,
@@ -4905,56 +4907,56 @@ unsigned short risc_code01[] = {
 	0x00f6, 0x2400, 0x9005, 0x1108, 0x009a, 0x2100, 0x9086, 0x0015,
 	0x1118, 0x2001, 0x0001, 0x0038, 0x2100, 0x9086, 0x0016, 0x0118,
 	0x2001, 0x0001, 0x002a, 0x94a4, 0x0007, 0x8423, 0x9405, 0x0002,
-	0x9fdd, 0x9fdd, 0x9fd8, 0x9fdb, 0x9fdd, 0x9fd5, 0x9fc8, 0x9fc8,
-	0x9fc8, 0x9fc8, 0x9fc8, 0x9fc8, 0x9fc8, 0x9fc8, 0x9fc8, 0x9fc8,
+	0x9fed, 0x9fed, 0x9fe8, 0x9feb, 0x9fed, 0x9fe5, 0x9fd8, 0x9fd8,
+	0x9fd8, 0x9fd8, 0x9fd8, 0x9fd8, 0x9fd8, 0x9fd8, 0x9fd8, 0x9fd8,
 	0x00fe, 0x00ee, 0x00de, 0x00ce, 0x002e, 0x001e, 0x000e, 0x004e,
-	0x00fe, 0x009e, 0x00de, 0x080c, 0x0db4, 0x080c, 0xaa76, 0x0028,
-	0x080c, 0xab99, 0x0010, 0x080c, 0xac88, 0x00fe, 0x00ee, 0x00de,
-	0x00ce, 0x002e, 0x001e, 0x2c00, 0xa896, 0x000e, 0x080c, 0xa18a,
+	0x00fe, 0x009e, 0x00de, 0x080c, 0x0db4, 0x080c, 0xaa89, 0x0028,
+	0x080c, 0xabac, 0x0010, 0x080c, 0xac9b, 0x00fe, 0x00ee, 0x00de,
+	0x00ce, 0x002e, 0x001e, 0x2c00, 0xa896, 0x000e, 0x080c, 0xa19a,
 	0x0530, 0xa804, 0xa80e, 0x00a6, 0x2050, 0xb100, 0x00ae, 0x8006,
 	0x8006, 0x8007, 0x90bc, 0x003f, 0x9084, 0xffc0, 0x9080, 0x0002,
 	0xaacc, 0xabd0, 0xacd4, 0xadd8, 0x2031, 0x0000, 0x2041, 0x1249,
-	0x080c, 0xa334, 0x0160, 0x000e, 0x9005, 0x0120, 0x00fe, 0x009e,
-	0x00de, 0x0005, 0x00fe, 0x009e, 0x00de, 0x0804, 0x9e32, 0x2001,
-	0x002c, 0x900e, 0x080c, 0xa1f0, 0x0c70, 0x91b6, 0x0015, 0x0170,
+	0x080c, 0xa345, 0x0160, 0x000e, 0x9005, 0x0120, 0x00fe, 0x009e,
+	0x00de, 0x0005, 0x00fe, 0x009e, 0x00de, 0x0804, 0x9e42, 0x2001,
+	0x002c, 0x900e, 0x080c, 0xa200, 0x0c70, 0x91b6, 0x0015, 0x0170,
 	0x91b6, 0x0016, 0x0158, 0x91b2, 0x0047, 0x0a0c, 0x0db4, 0x91b2,
 	0x0050, 0x1a0c, 0x0db4, 0x9182, 0x0047, 0x00ca, 0x2001, 0x0109,
 	0x2004, 0xd08c, 0x0198, 0x0126, 0x2091, 0x2800, 0x0006, 0x0016,
-	0x0026, 0x080c, 0x83aa, 0x002e, 0x001e, 0x000e, 0x012e, 0xa001,
-	0x6000, 0x9086, 0x0002, 0x1110, 0x0804, 0x9f76, 0x0005, 0xa048,
-	0xa048, 0xa04a, 0xa080, 0xa048, 0xa048, 0xa048, 0xa048, 0xa093,
-	0x080c, 0x0db4, 0x00d6, 0x0016, 0x0096, 0x080c, 0x8923, 0x080c,
-	0x8a4e, 0x6003, 0x0004, 0x6114, 0x2148, 0xa87c, 0xd0fc, 0x01c0,
+	0x0026, 0x080c, 0x8393, 0x002e, 0x001e, 0x000e, 0x012e, 0xa001,
+	0x6000, 0x9086, 0x0002, 0x1110, 0x0804, 0x9f86, 0x0005, 0xa058,
+	0xa058, 0xa05a, 0xa090, 0xa058, 0xa058, 0xa058, 0xa058, 0xa0a3,
+	0x080c, 0x0db4, 0x00d6, 0x0016, 0x0096, 0x080c, 0x891d, 0x080c,
+	0x8a4a, 0x6003, 0x0004, 0x6114, 0x2148, 0xa87c, 0xd0fc, 0x01c0,
 	0xa878, 0xc0fc, 0x9005, 0x1158, 0xa894, 0x9005, 0x0140, 0x2001,
-	0x0000, 0x900e, 0x080c, 0xa1f0, 0x080c, 0x9e32, 0x00a8, 0x6003,
+	0x0000, 0x900e, 0x080c, 0xa200, 0x080c, 0x9e42, 0x00a8, 0x6003,
 	0x0002, 0xa8a4, 0xa9a8, 0x9105, 0x1178, 0xa8ae, 0xa8b2, 0x0c78,
 	0xa87f, 0x0020, 0xa88c, 0xa88a, 0xa8a4, 0xa8ae, 0xa8a8, 0xa8b2,
 	0xa8c7, 0x0000, 0xa8cb, 0x0000, 0x009e, 0x001e, 0x00de, 0x0005,
-	0x080c, 0x8923, 0x00d6, 0x0096, 0x6114, 0x2148, 0x080c, 0xbb17,
-	0x0120, 0xa87b, 0x0006, 0x080c, 0x688c, 0x009e, 0x00de, 0x080c,
-	0x9e32, 0x0804, 0x8a4e, 0x080c, 0x8923, 0x080c, 0x2fda, 0x080c,
-	0xc227, 0x00d6, 0x0096, 0x6114, 0x2148, 0x080c, 0xbb17, 0x0120,
-	0xa87b, 0x0029, 0x080c, 0x688c, 0x009e, 0x00de, 0x080c, 0x9e32,
-	0x0804, 0x8a4e, 0x9182, 0x0047, 0x0002, 0xa0ba, 0xa0bc, 0xa0ba,
-	0xa0ba, 0xa0ba, 0xa0ba, 0xa0ba, 0xa0ba, 0xa0ba, 0xa0ba, 0xa0ba,
-	0xa0ba, 0xa0bc, 0x080c, 0x0db4, 0x00d6, 0x0096, 0x080c, 0x150f,
-	0x6114, 0x2148, 0xa87b, 0x0000, 0xa883, 0x0000, 0x080c, 0x688c,
-	0x009e, 0x00de, 0x0804, 0x9e32, 0x0026, 0x0036, 0x0056, 0x0066,
+	0x080c, 0x891d, 0x00d6, 0x0096, 0x6114, 0x2148, 0x080c, 0xbb2c,
+	0x0120, 0xa87b, 0x0006, 0x080c, 0x6891, 0x009e, 0x00de, 0x080c,
+	0x9e42, 0x0804, 0x8a4a, 0x080c, 0x891d, 0x080c, 0x2fdc, 0x080c,
+	0xc241, 0x00d6, 0x0096, 0x6114, 0x2148, 0x080c, 0xbb2c, 0x0120,
+	0xa87b, 0x0029, 0x080c, 0x6891, 0x009e, 0x00de, 0x080c, 0x9e42,
+	0x0804, 0x8a4a, 0x9182, 0x0047, 0x0002, 0xa0ca, 0xa0cc, 0xa0ca,
+	0xa0ca, 0xa0ca, 0xa0ca, 0xa0ca, 0xa0ca, 0xa0ca, 0xa0ca, 0xa0ca,
+	0xa0ca, 0xa0cc, 0x080c, 0x0db4, 0x00d6, 0x0096, 0x080c, 0x1511,
+	0x6114, 0x2148, 0xa87b, 0x0000, 0xa883, 0x0000, 0x080c, 0x6891,
+	0x009e, 0x00de, 0x0804, 0x9e42, 0x0026, 0x0036, 0x0056, 0x0066,
 	0x0096, 0x00a6, 0x00f6, 0x0006, 0x080c, 0x0feb, 0x000e, 0x090c,
 	0x0db4, 0xa960, 0x21e8, 0xa95c, 0x9188, 0x0019, 0x21a0, 0x900e,
 	0x20a9, 0x0020, 0x4104, 0xa87a, 0x2079, 0x1800, 0x798c, 0x9188,
 	0x0018, 0x918c, 0x0fff, 0xa972, 0xac76, 0x2950, 0x00a6, 0x2001,
 	0x0205, 0x2003, 0x0000, 0x901e, 0x2029, 0x0001, 0x9182, 0x0034,
-	0x1228, 0x2011, 0x001f, 0x080c, 0xb712, 0x04c0, 0x2130, 0x2009,
-	0x0034, 0x2011, 0x001f, 0x080c, 0xb712, 0x96b2, 0x0034, 0xb004,
+	0x1228, 0x2011, 0x001f, 0x080c, 0xb725, 0x04c0, 0x2130, 0x2009,
+	0x0034, 0x2011, 0x001f, 0x080c, 0xb725, 0x96b2, 0x0034, 0xb004,
 	0x904d, 0x0110, 0x080c, 0x0f9d, 0x080c, 0x0feb, 0x01d0, 0x8528,
 	0xa867, 0x0110, 0xa86b, 0x0000, 0x2920, 0xb406, 0x968a, 0x003d,
-	0x1230, 0x2608, 0x2011, 0x001b, 0x080c, 0xb712, 0x00b8, 0x96b2,
-	0x003c, 0x2009, 0x003c, 0x2950, 0x2011, 0x001b, 0x080c, 0xb712,
+	0x1230, 0x2608, 0x2011, 0x001b, 0x080c, 0xb725, 0x00b8, 0x96b2,
+	0x003c, 0x2009, 0x003c, 0x2950, 0x2011, 0x001b, 0x080c, 0xb725,
 	0x0c18, 0x2001, 0x0205, 0x2003, 0x0000, 0x00ae, 0x852f, 0x95ad,
 	0x0050, 0xb566, 0xb070, 0xc0fd, 0xb072, 0x0048, 0x2001, 0x0205,
 	0x2003, 0x0000, 0x00ae, 0x852f, 0x95ad, 0x0050, 0xb566, 0x2a48,
-	0xa804, 0xa807, 0x0000, 0x0006, 0x080c, 0x688c, 0x000e, 0x2048,
+	0xa804, 0xa807, 0x0000, 0x0006, 0x080c, 0x6891, 0x000e, 0x2048,
 	0x9005, 0x1db0, 0x00fe, 0x00ae, 0x009e, 0x006e, 0x005e, 0x003e,
 	0x002e, 0x0005, 0x00d6, 0x00f6, 0x0096, 0x0006, 0x080c, 0x0feb,
 	0x000e, 0x090c, 0x0db4, 0xa960, 0x21e8, 0xa95c, 0x9188, 0x0019,
@@ -4962,7 +4964,7 @@ unsigned short risc_code01[] = {
 	0x1800, 0x798c, 0x810c, 0x9188, 0x000c, 0x9182, 0x001a, 0x0210,
 	0x2009, 0x001a, 0x21a8, 0x810b, 0xa972, 0xac76, 0x2e98, 0xa85c,
 	0x9080, 0x001f, 0x20a0, 0x2001, 0x0205, 0x200c, 0x918d, 0x0080,
-	0x2102, 0x4003, 0x2003, 0x0000, 0x080c, 0x688c, 0x009e, 0x00fe,
+	0x2102, 0x4003, 0x2003, 0x0000, 0x080c, 0x6891, 0x009e, 0x00fe,
 	0x00de, 0x0005, 0x0016, 0x00d6, 0x00f6, 0x0096, 0x0016, 0x2001,
 	0x0205, 0x200c, 0x918d, 0x0080, 0x2102, 0x001e, 0x2079, 0x0200,
 	0x2e98, 0xa87c, 0xd0ec, 0x0118, 0x9e80, 0x000c, 0x2098, 0x2021,
@@ -4974,1922 +4976,1924 @@ unsigned short risc_code01[] = {
 	0x2400, 0x9202, 0x2410, 0x9318, 0x9006, 0x2020, 0x22a8, 0xa800,
 	0x9200, 0xa802, 0x20e1, 0x0000, 0x4003, 0x83ff, 0x0180, 0x3300,
 	0x9086, 0x0280, 0x1130, 0x7814, 0x8000, 0x9085, 0x0080, 0x7816,
-	0x2e98, 0x2310, 0x84ff, 0x0904, 0xa19f, 0x0804, 0xa1a1, 0x9085,
+	0x2e98, 0x2310, 0x84ff, 0x0904, 0xa1af, 0x0804, 0xa1b1, 0x9085,
 	0x0001, 0x7817, 0x0000, 0x009e, 0x00fe, 0x00de, 0x001e, 0x0005,
 	0x00d6, 0x0036, 0x0096, 0x6314, 0x2348, 0xa87a, 0xa982, 0x080c,
-	0x687f, 0x009e, 0x003e, 0x00de, 0x0005, 0x91b6, 0x0015, 0x1118,
-	0x080c, 0x9e32, 0x0030, 0x91b6, 0x0016, 0x190c, 0x0db4, 0x080c,
-	0x9e32, 0x0005, 0x20a9, 0x000e, 0x20e1, 0x0000, 0x2e98, 0x6014,
+	0x6884, 0x009e, 0x003e, 0x00de, 0x0005, 0x91b6, 0x0015, 0x1118,
+	0x080c, 0x9e42, 0x0030, 0x91b6, 0x0016, 0x190c, 0x0db4, 0x080c,
+	0x9e42, 0x0005, 0x20a9, 0x000e, 0x20e1, 0x0000, 0x2e98, 0x6014,
 	0x0096, 0x2048, 0xa860, 0x20e8, 0xa85c, 0x20a0, 0x009e, 0x4003,
-	0x0136, 0x9080, 0x001b, 0x2011, 0x0006, 0x20a9, 0x0001, 0x3418,
-	0x8318, 0x23a0, 0x4003, 0x3318, 0x8318, 0x2398, 0x8211, 0x1db8,
-	0x2011, 0x0006, 0x013e, 0x20a0, 0x3318, 0x8318, 0x2398, 0x4003,
-	0x3418, 0x8318, 0x23a0, 0x8211, 0x1db8, 0x0096, 0x080c, 0xbb17,
-	0x0130, 0x6014, 0x2048, 0xa807, 0x0000, 0xa867, 0x0103, 0x009e,
-	0x0804, 0x9e32, 0x0096, 0x00d6, 0x0036, 0x7330, 0x9386, 0x0200,
-	0x11a8, 0x6010, 0x00b6, 0x2058, 0xb8bf, 0x0000, 0x00be, 0x6014,
-	0x9005, 0x0130, 0x2048, 0xa807, 0x0000, 0xa867, 0x0103, 0xab32,
-	0x080c, 0x9e32, 0x003e, 0x00de, 0x009e, 0x0005, 0x0011, 0x1d48,
-	0x0cc8, 0x0006, 0x0016, 0x080c, 0xc212, 0x0188, 0x6014, 0x9005,
-	0x1170, 0x600b, 0x0003, 0x601b, 0x0000, 0x6043, 0x0000, 0x2009,
-	0x0022, 0x080c, 0xa611, 0x9006, 0x001e, 0x000e, 0x0005, 0x9085,
-	0x0001, 0x0cd0, 0x0096, 0x0016, 0x20a9, 0x0014, 0x9e80, 0x000c,
-	0x20e1, 0x0000, 0x2098, 0x6014, 0x2048, 0xa860, 0x20e8, 0xa85c,
-	0x9080, 0x0002, 0x20a0, 0x4003, 0x2001, 0x0205, 0x2003, 0x0001,
-	0x2099, 0x0260, 0x20a9, 0x0016, 0x4003, 0x20a9, 0x000a, 0xa804,
-	0x2048, 0xa860, 0x20e8, 0xa85c, 0x9080, 0x0002, 0x20a0, 0x4003,
-	0x2001, 0x0205, 0x2003, 0x0002, 0x2099, 0x0260, 0x20a9, 0x0020,
-	0x4003, 0x2003, 0x0000, 0x6014, 0x2048, 0xa800, 0x2048, 0xa867,
-	0x0103, 0x080c, 0x9e32, 0x001e, 0x009e, 0x0005, 0x0096, 0x0016,
-	0x900e, 0x7030, 0x9086, 0x0100, 0x0140, 0x7038, 0x9084, 0x00ff,
-	0x800c, 0x703c, 0x9084, 0x00ff, 0x8004, 0x9080, 0x0004, 0x9108,
-	0x810b, 0x2011, 0x0002, 0x2019, 0x000c, 0x6014, 0x2048, 0x080c,
-	0xb712, 0x080c, 0xbb17, 0x0140, 0x6014, 0x2048, 0xa807, 0x0000,
-	0xa864, 0xa8e2, 0xa867, 0x0103, 0x080c, 0x9e32, 0x001e, 0x009e,
-	0x0005, 0x0016, 0x0096, 0x7030, 0x9086, 0x0100, 0x1118, 0x2009,
-	0x0004, 0x0010, 0x7034, 0x800c, 0x810b, 0x2011, 0x000c, 0x2019,
-	0x000c, 0x6014, 0x2048, 0xa804, 0x0096, 0x9005, 0x0108, 0x2048,
-	0x080c, 0xb712, 0x009e, 0x080c, 0xbb17, 0x0148, 0xa804, 0x9005,
-	0x1158, 0xa807, 0x0000, 0xa864, 0xa8e2, 0xa867, 0x0103, 0x080c,
-	0x9e32, 0x009e, 0x001e, 0x0005, 0x0086, 0x2040, 0xa030, 0x8007,
-	0x9086, 0x0100, 0x1118, 0x080c, 0xa7c0, 0x00e0, 0xa034, 0x8007,
-	0x800c, 0x8806, 0x8006, 0x8007, 0x90bc, 0x003f, 0x9084, 0xffc0,
-	0x9080, 0x000c, 0xa87b, 0x0000, 0xa883, 0x0000, 0xa897, 0x4000,
-	0xaaa0, 0xab9c, 0xaca8, 0xada4, 0x2031, 0x0000, 0x2041, 0x122f,
-	0x0019, 0x0d08, 0x008e, 0x0898, 0x0096, 0x0006, 0x080c, 0x0feb,
-	0x000e, 0x01b0, 0xa8ab, 0x0dcb, 0xa876, 0x000e, 0xa8a2, 0x0006,
-	0xae6a, 0x2800, 0xa89e, 0xa97a, 0xaf72, 0xaa8e, 0xab92, 0xac96,
-	0xad9a, 0x0086, 0x2940, 0x080c, 0x10d5, 0x008e, 0x9085, 0x0001,
-	0x009e, 0x0005, 0x00e6, 0x00d6, 0x0026, 0x7008, 0x9084, 0x00ff,
-	0x6210, 0x00b6, 0x2258, 0xba10, 0x00be, 0x9206, 0x1520, 0x700c,
-	0x6210, 0x00b6, 0x2258, 0xba14, 0x00be, 0x9206, 0x11e0, 0x6043,
-	0x0000, 0x2c68, 0x0016, 0x2009, 0x0035, 0x080c, 0xc18a, 0x001e,
-	0x1158, 0x622c, 0x2268, 0x2071, 0x026c, 0x6b20, 0x9386, 0x0003,
-	0x0130, 0x9386, 0x0006, 0x0128, 0x080c, 0x9e32, 0x0020, 0x0039,
-	0x0010, 0x080c, 0xa446, 0x002e, 0x00de, 0x00ee, 0x0005, 0x0096,
-	0x6814, 0x2048, 0x9186, 0x0015, 0x0904, 0xa42e, 0x918e, 0x0016,
-	0x1904, 0xa444, 0x700c, 0x908c, 0xff00, 0x9186, 0x1700, 0x0120,
-	0x9186, 0x0300, 0x1904, 0xa408, 0x89ff, 0x1138, 0x6800, 0x9086,
-	0x000f, 0x0904, 0xa3eb, 0x0804, 0xa442, 0x6808, 0x9086, 0xffff,
-	0x1904, 0xa430, 0xa87c, 0x9084, 0x0060, 0x9086, 0x0020, 0x1128,
-	0xa83c, 0xa940, 0x9105, 0x1904, 0xa430, 0x6824, 0xd0b4, 0x1904,
-	0xa430, 0x080c, 0xbd00, 0x685c, 0xa882, 0xa87c, 0xc0dc, 0xc0f4,
-	0xc0d4, 0xa87e, 0x0026, 0x900e, 0x6a18, 0x2001, 0x000a, 0x080c,
-	0x8270, 0xa884, 0x920a, 0x0208, 0x8011, 0xaa86, 0x82ff, 0x002e,
-	0x1138, 0x00c6, 0x2d60, 0x080c, 0xb83c, 0x00ce, 0x0804, 0xa442,
-	0x00c6, 0xa868, 0xd0fc, 0x1118, 0x080c, 0x5d4d, 0x0010, 0x080c,
-	0x60f4, 0x00ce, 0x1904, 0xa430, 0x00c6, 0x2d60, 0x080c, 0x9e32,
-	0x00ce, 0x0804, 0xa442, 0x00c6, 0x080c, 0x9e7f, 0x0198, 0x6017,
-	0x0000, 0x6810, 0x6012, 0x080c, 0xbf8c, 0x6023, 0x0003, 0x6904,
-	0x00c6, 0x2d60, 0x080c, 0x9e32, 0x00ce, 0x080c, 0x9eac, 0x00ce,
-	0x0804, 0xa442, 0x2001, 0x1959, 0x2004, 0x6842, 0x00ce, 0x04d0,
-	0x7008, 0x9086, 0x000b, 0x11c8, 0x6010, 0x00b6, 0x2058, 0xb900,
-	0xc1bc, 0xb902, 0x00be, 0x00c6, 0x2d60, 0xa87b, 0x0003, 0x080c,
-	0xc1cc, 0x6007, 0x0085, 0x6003, 0x000b, 0x6023, 0x0002, 0x080c,
-	0x83f1, 0x080c, 0x8973, 0x00ce, 0x00e8, 0x700c, 0x9086, 0x2a00,
-	0x1138, 0x2001, 0x1959, 0x2004, 0x6842, 0x00a0, 0x0479, 0x00a0,
-	0x89ff, 0x090c, 0x0db4, 0x00c6, 0x00d6, 0x2d60, 0xa867, 0x0103,
-	0xa87b, 0x0003, 0x080c, 0x66a7, 0x080c, 0xbd00, 0x080c, 0x9e62,
-	0x00de, 0x00ce, 0x080c, 0x9e32, 0x009e, 0x0005, 0x9186, 0x0015,
-	0x1128, 0x2001, 0x1959, 0x2004, 0x6842, 0x0068, 0x918e, 0x0016,
-	0x1160, 0x00c6, 0x2d00, 0x2060, 0x080c, 0xd787, 0x080c, 0x8204,
-	0x080c, 0x9e32, 0x00ce, 0x080c, 0x9e32, 0x0005, 0x0026, 0x0036,
-	0x0046, 0x7228, 0xacb0, 0xabac, 0xd2f4, 0x0130, 0x2001, 0x1959,
-	0x2004, 0x6842, 0x0804, 0xa4c0, 0x00c6, 0x2d60, 0x080c, 0xb73d,
-	0x00ce, 0x6804, 0x9086, 0x0050, 0x1168, 0x00c6, 0x2d00, 0x2060,
-	0x6003, 0x0001, 0x6007, 0x0050, 0x080c, 0x83f1, 0x080c, 0x8973,
-	0x00ce, 0x04f0, 0x6800, 0x9086, 0x000f, 0x01a8, 0x89ff, 0x090c,
-	0x0db4, 0x6800, 0x9086, 0x0004, 0x1190, 0xa87c, 0xd0ac, 0x0178,
-	0xa843, 0x0fff, 0xa83f, 0x0fff, 0xa880, 0xc0fc, 0xa882, 0x2001,
-	0x0001, 0x6832, 0x0400, 0x2001, 0x0007, 0x6832, 0x00e0, 0xa87c,
-	0xd0b4, 0x1150, 0xd0ac, 0x0db8, 0x6824, 0xd0f4, 0x1d48, 0xa838,
-	0xa934, 0x9105, 0x0d80, 0x0c20, 0xd2ec, 0x1d68, 0x7024, 0x9306,
-	0x1118, 0x7020, 0x9406, 0x0d38, 0x7020, 0x683e, 0x7024, 0x683a,
-	0x2001, 0x0005, 0x6832, 0x080c, 0xbe83, 0x080c, 0x8973, 0x0010,
-	0x080c, 0x9e32, 0x004e, 0x003e, 0x002e, 0x0005, 0x00e6, 0x00d6,
-	0x0026, 0x7008, 0x9084, 0x00ff, 0x6210, 0x00b6, 0x2258, 0xba10,
-	0x00be, 0x9206, 0x1904, 0xa52b, 0x700c, 0x6210, 0x00b6, 0x2258,
-	0xba14, 0x00be, 0x9206, 0x1904, 0xa52b, 0x6038, 0x2068, 0x6824,
-	0xc0dc, 0x6826, 0x6a20, 0x9286, 0x0007, 0x0904, 0xa52b, 0x9286,
-	0x0002, 0x0904, 0xa52b, 0x9286, 0x0000, 0x05e8, 0x6808, 0x633c,
-	0x9306, 0x15c8, 0x2071, 0x026c, 0x9186, 0x0015, 0x0570, 0x918e,
-	0x0016, 0x1100, 0x00c6, 0x6038, 0x2060, 0x6104, 0x9186, 0x004b,
-	0x01c0, 0x9186, 0x004c, 0x01a8, 0x9186, 0x004d, 0x0190, 0x9186,
-	0x004e, 0x0178, 0x9186, 0x0052, 0x0160, 0x6014, 0x0096, 0x2048,
-	0x080c, 0xbb17, 0x090c, 0x0db4, 0xa87b, 0x0003, 0x009e, 0x080c,
-	0xc1cc, 0x6007, 0x0085, 0x6003, 0x000b, 0x6023, 0x0002, 0x080c,
-	0x83f1, 0x080c, 0x8973, 0x00ce, 0x0030, 0x6038, 0x2070, 0x2001,
-	0x1959, 0x2004, 0x7042, 0x080c, 0x9e32, 0x002e, 0x00de, 0x00ee,
-	0x0005, 0x00b6, 0x0096, 0x00f6, 0x6014, 0x2048, 0x6010, 0x2058,
-	0x91b6, 0x0015, 0x0130, 0xba08, 0xbb0c, 0xbc00, 0xc48c, 0xbc02,
-	0x0460, 0x0096, 0x0156, 0x0036, 0x0026, 0x2b48, 0x9e90, 0x0010,
-	0x2019, 0x000a, 0x20a9, 0x0004, 0x080c, 0xae0d, 0x002e, 0x003e,
-	0x015e, 0x009e, 0x1904, 0xa59a, 0x0096, 0x0156, 0x0036, 0x0026,
-	0x2b48, 0x9e90, 0x0014, 0x2019, 0x0006, 0x20a9, 0x0004, 0x080c,
-	0xae0d, 0x002e, 0x003e, 0x015e, 0x009e, 0x15a0, 0x7238, 0xba0a,
-	0x733c, 0xbb0e, 0xbc00, 0xc48d, 0xbc02, 0xa804, 0x9005, 0x1128,
-	0x00fe, 0x009e, 0x00be, 0x0804, 0xa235, 0x0096, 0x2048, 0xaa12,
-	0xab16, 0xac0a, 0x009e, 0x8006, 0x8006, 0x8007, 0x90bc, 0x003f,
-	0x9084, 0xffc0, 0x9080, 0x0002, 0x2009, 0x002b, 0xaaa0, 0xab9c,
-	0xaca8, 0xada4, 0x2031, 0x0000, 0x2041, 0x122f, 0x080c, 0xa334,
-	0x0130, 0x00fe, 0x009e, 0x080c, 0x9e32, 0x00be, 0x0005, 0x080c,
-	0xa7c0, 0x0cb8, 0x2b78, 0x00f6, 0x080c, 0x2fda, 0x080c, 0xc227,
-	0x00fe, 0x00c6, 0x080c, 0x9ddc, 0x2f00, 0x6012, 0x6017, 0x0000,
-	0x6023, 0x0001, 0x6007, 0x0001, 0x6003, 0x0001, 0x2001, 0x0007,
-	0x080c, 0x618f, 0x080c, 0x61bb, 0x080c, 0x8439, 0x080c, 0x8973,
-	0x00ce, 0x0804, 0xa56d, 0x2100, 0x91b2, 0x0053, 0x1a0c, 0x0db4,
-	0x91b2, 0x0040, 0x1a04, 0xa623, 0x0002, 0xa611, 0xa611, 0xa607,
-	0xa611, 0xa611, 0xa611, 0xa605, 0xa605, 0xa605, 0xa605, 0xa605,
-	0xa605, 0xa605, 0xa605, 0xa605, 0xa605, 0xa605, 0xa605, 0xa605,
-	0xa605, 0xa605, 0xa605, 0xa605, 0xa605, 0xa605, 0xa605, 0xa605,
-	0xa605, 0xa605, 0xa605, 0xa605, 0xa611, 0xa605, 0xa611, 0xa611,
-	0xa605, 0xa605, 0xa605, 0xa605, 0xa605, 0xa607, 0xa605, 0xa605,
-	0xa605, 0xa605, 0xa605, 0xa605, 0xa605, 0xa605, 0xa605, 0xa611,
-	0xa611, 0xa605, 0xa605, 0xa605, 0xa605, 0xa605, 0xa605, 0xa605,
-	0xa605, 0xa605, 0xa611, 0xa605, 0xa605, 0x080c, 0x0db4, 0x0066,
-	0x00b6, 0x6610, 0x2658, 0xb8bc, 0xc08c, 0xb8be, 0x00be, 0x006e,
-	0x0000, 0x6003, 0x0001, 0x6106, 0x9186, 0x0032, 0x0118, 0x080c,
-	0x8439, 0x0010, 0x080c, 0x83f1, 0x0126, 0x2091, 0x8000, 0x080c,
-	0x8973, 0x012e, 0x0005, 0x2600, 0x0002, 0xa637, 0xa637, 0xa637,
-	0xa611, 0xa611, 0xa637, 0xa637, 0xa637, 0xa637, 0xa611, 0xa637,
-	0xa611, 0xa637, 0xa611, 0xa637, 0xa637, 0xa637, 0xa637, 0x080c,
-	0x0db4, 0x6004, 0x90b2, 0x0053, 0x1a0c, 0x0db4, 0x91b6, 0x0013,
-	0x0904, 0xa6fb, 0x91b6, 0x0027, 0x1904, 0xa6b6, 0x080c, 0x886e,
-	0x6004, 0x080c, 0xbd0c, 0x01b0, 0x080c, 0xbd1d, 0x01a8, 0x908e,
-	0x0021, 0x0904, 0xa6b3, 0x908e, 0x0022, 0x1130, 0x080c, 0xa261,
-	0x0904, 0xa6af, 0x0804, 0xa6b0, 0x908e, 0x003d, 0x0904, 0xa6b3,
-	0x0804, 0xa6a9, 0x080c, 0x3003, 0x2001, 0x0007, 0x080c, 0x618f,
-	0x6010, 0x00b6, 0x2058, 0xb9a0, 0x00be, 0x080c, 0xa7c0, 0x9186,
-	0x007e, 0x1148, 0x2001, 0x1836, 0x2014, 0xc285, 0x080c, 0x6fb2,
-	0x1108, 0xc2ad, 0x2202, 0x0036, 0x0026, 0x2019, 0x0028, 0x2110,
-	0x080c, 0xd7e2, 0x002e, 0x003e, 0x0016, 0x0026, 0x0036, 0x2110,
-	0x2019, 0x0028, 0x080c, 0x8571, 0x0076, 0x903e, 0x080c, 0x8469,
-	0x6010, 0x00b6, 0x905d, 0x0100, 0x00be, 0x2c08, 0x080c, 0xd29b,
-	0x007e, 0x003e, 0x002e, 0x001e, 0x080c, 0xc227, 0x0016, 0x080c,
-	0xbf84, 0x080c, 0x9e32, 0x001e, 0x080c, 0x30d5, 0x080c, 0x8973,
-	0x0030, 0x080c, 0xbf84, 0x080c, 0x9e32, 0x080c, 0x8973, 0x0005,
-	0x080c, 0xa7c0, 0x0cb0, 0x080c, 0xa7fc, 0x0c98, 0x9186, 0x0014,
-	0x1db0, 0x080c, 0x886e, 0x6004, 0x908e, 0x0022, 0x1118, 0x080c,
-	0xa261, 0x0d68, 0x080c, 0x2fda, 0x080c, 0xc227, 0x080c, 0xbd0c,
-	0x1190, 0x080c, 0x3003, 0x6010, 0x00b6, 0x2058, 0xb9a0, 0x00be,
-	0x080c, 0xa7c0, 0x9186, 0x007e, 0x1128, 0x2001, 0x1836, 0x200c,
-	0xc185, 0x2102, 0x0870, 0x080c, 0xbd1d, 0x1118, 0x080c, 0xa7c0,
-	0x0840, 0x6004, 0x908e, 0x0032, 0x1160, 0x00e6, 0x00f6, 0x2071,
-	0x1894, 0x2079, 0x0000, 0x080c, 0x3369, 0x00fe, 0x00ee, 0x0804,
-	0xa6a9, 0x6004, 0x908e, 0x0021, 0x0d48, 0x908e, 0x0022, 0x090c,
-	0xa7c0, 0x0804, 0xa6a9, 0x90b2, 0x0040, 0x1a04, 0xa7a9, 0x2008,
-	0x0002, 0xa743, 0xa744, 0xa747, 0xa74a, 0xa74d, 0xa750, 0xa741,
-	0xa741, 0xa741, 0xa741, 0xa741, 0xa741, 0xa741, 0xa741, 0xa741,
-	0xa741, 0xa741, 0xa741, 0xa741, 0xa741, 0xa741, 0xa741, 0xa741,
-	0xa741, 0xa741, 0xa741, 0xa741, 0xa741, 0xa741, 0xa741, 0xa753,
-	0xa75e, 0xa741, 0xa760, 0xa75e, 0xa741, 0xa741, 0xa741, 0xa741,
-	0xa741, 0xa75e, 0xa75e, 0xa741, 0xa741, 0xa741, 0xa741, 0xa741,
-	0xa741, 0xa741, 0xa741, 0xa790, 0xa75e, 0xa741, 0xa75a, 0xa741,
-	0xa741, 0xa741, 0xa75b, 0xa741, 0xa741, 0xa741, 0xa75e, 0xa787,
-	0xa741, 0x080c, 0x0db4, 0x00d0, 0x2001, 0x000b, 0x0410, 0x2001,
-	0x0003, 0x00f8, 0x2001, 0x0005, 0x00e0, 0x2001, 0x0001, 0x00c8,
-	0x2001, 0x0009, 0x00b0, 0x080c, 0x886e, 0x6003, 0x0005, 0x080c,
-	0x8973, 0x0070, 0x0018, 0x0010, 0x080c, 0x618f, 0x0804, 0xa7a1,
-	0x080c, 0x886e, 0x080c, 0xc22a, 0x6003, 0x0004, 0x080c, 0x8973,
-	0x0005, 0x080c, 0x618f, 0x080c, 0x886e, 0x6003, 0x0002, 0x0036,
-	0x2019, 0x185e, 0x2304, 0x9084, 0xff00, 0x1120, 0x2001, 0x1957,
-	0x201c, 0x0040, 0x8007, 0x909a, 0x0004, 0x0ec0, 0x8003, 0x801b,
-	0x831b, 0x9318, 0x631a, 0x003e, 0x080c, 0x8973, 0x0c08, 0x080c,
-	0x886e, 0x080c, 0xbf84, 0x080c, 0x9e32, 0x080c, 0x8973, 0x08c0,
-	0x00e6, 0x00f6, 0x2071, 0x1894, 0x2079, 0x0000, 0x080c, 0x3369,
-	0x00fe, 0x00ee, 0x080c, 0x886e, 0x080c, 0x9e32, 0x080c, 0x8973,
-	0x0838, 0x080c, 0x886e, 0x6003, 0x0002, 0x080c, 0xc22a, 0x0804,
-	0x8973, 0x2600, 0x2008, 0x0002, 0xa7be, 0xa7be, 0xa7be, 0xa7a1,
-	0xa7a1, 0xa7be, 0xa7be, 0xa7be, 0xa7be, 0xa7a1, 0xa7be, 0xa7a1,
-	0xa7be, 0xa7a1, 0xa7be, 0xa7be, 0xa7be, 0xa7be, 0x080c, 0x0db4,
-	0x00e6, 0x0096, 0x0026, 0x0016, 0x080c, 0xbb17, 0x0568, 0x6014,
-	0x2048, 0xa864, 0x9086, 0x0139, 0x11a8, 0xa894, 0x9086, 0x0056,
-	0x1148, 0x080c, 0x512f, 0x0130, 0x2001, 0x0000, 0x900e, 0x2011,
-	0x4000, 0x0028, 0x2001, 0x0030, 0x900e, 0x2011, 0x4005, 0x080c,
-	0xc0f1, 0x0090, 0xa868, 0xd0fc, 0x0178, 0xa807, 0x0000, 0x0016,
-	0x6004, 0x908e, 0x0021, 0x0168, 0x908e, 0x003d, 0x0150, 0x001e,
-	0xa867, 0x0103, 0xa833, 0x0100, 0x001e, 0x002e, 0x009e, 0x00ee,
-	0x0005, 0x001e, 0x0009, 0x0cc0, 0x0096, 0x6014, 0x2048, 0xa800,
-	0x2048, 0xa867, 0x0103, 0xa823, 0x8001, 0x009e, 0x0005, 0x00b6,
-	0x6610, 0x2658, 0xb804, 0x9084, 0x00ff, 0x90b2, 0x000c, 0x1a0c,
-	0x0db4, 0x6604, 0x96b6, 0x004d, 0x1120, 0x080c, 0xc010, 0x0804,
-	0xa884, 0x6604, 0x96b6, 0x0043, 0x1120, 0x080c, 0xc059, 0x0804,
-	0xa884, 0x6604, 0x96b6, 0x004b, 0x1120, 0x080c, 0xc085, 0x0804,
-	0xa884, 0x6604, 0x96b6, 0x0033, 0x1120, 0x080c, 0xbfa6, 0x0804,
-	0xa884, 0x6604, 0x96b6, 0x0028, 0x1120, 0x080c, 0xbd56, 0x0804,
-	0xa884, 0x6604, 0x96b6, 0x0029, 0x1120, 0x080c, 0xbd97, 0x0804,
-	0xa884, 0x6604, 0x96b6, 0x001f, 0x1118, 0x080c, 0xa20a, 0x04e0,
-	0x6604, 0x96b6, 0x0000, 0x1118, 0x080c, 0xa531, 0x04a8, 0x6604,
-	0x96b6, 0x0022, 0x1118, 0x080c, 0xa242, 0x0470, 0x6604, 0x96b6,
-	0x0035, 0x1118, 0x080c, 0xa352, 0x0438, 0x6604, 0x96b6, 0x0039,
-	0x1118, 0x080c, 0xa4c6, 0x0400, 0x6604, 0x96b6, 0x003d, 0x1118,
-	0x080c, 0xa27a, 0x00c8, 0x6604, 0x96b6, 0x0044, 0x1118, 0x080c,
-	0xa2b6, 0x0090, 0x6604, 0x96b6, 0x0049, 0x1118, 0x080c, 0xa2e1,
-	0x0058, 0x91b6, 0x0015, 0x1110, 0x0063, 0x0030, 0x91b6, 0x0016,
-	0x1128, 0x00be, 0x0804, 0xab42, 0x00be, 0x0005, 0x080c, 0x9ec7,
-	0x0cd8, 0xa8a1, 0xa8a4, 0xa8a1, 0xa8e8, 0xa8a1, 0xaa76, 0xab4f,
-	0xa8a1, 0xa8a1, 0xab1c, 0xa8a1, 0xab30, 0x0096, 0x080c, 0x150f,
-	0x6014, 0x2048, 0xa800, 0x2048, 0xa867, 0x0103, 0x009e, 0x0804,
-	0x9e32, 0xa001, 0xa001, 0x0005, 0x00e6, 0x2071, 0x1800, 0x708c,
-	0x9086, 0x0074, 0x1540, 0x080c, 0xd26c, 0x11b0, 0x6010, 0x00b6,
-	0x2058, 0x7030, 0xd08c, 0x0128, 0xb800, 0xd0bc, 0x0110, 0xc0c5,
-	0xb802, 0x00e9, 0x00be, 0x2001, 0x0006, 0x080c, 0x618f, 0x080c,
-	0x3003, 0x080c, 0x9e32, 0x0088, 0x2001, 0x000a, 0x080c, 0x618f,
-	0x080c, 0x3003, 0x6003, 0x0001, 0x6007, 0x0001, 0x080c, 0x8439,
-	0x080c, 0x8973, 0x0010, 0x080c, 0xaa61, 0x00ee, 0x0005, 0x00d6,
-	0xb800, 0xd084, 0x0158, 0x9006, 0x080c, 0x617b, 0x2069, 0x1853,
-	0x6804, 0x0020, 0x2001, 0x0006, 0x080c, 0x61bb, 0x00de, 0x0005,
-	0x00b6, 0x0096, 0x00d6, 0x2011, 0x1823, 0x2204, 0x9086, 0x0074,
-	0x1904, 0xaa3a, 0x6010, 0x2058, 0xbaa0, 0x9286, 0x007e, 0x1120,
-	0x080c, 0xac93, 0x0804, 0xa99f, 0x00d6, 0x080c, 0x6fb2, 0x0198,
-	0x0026, 0x2011, 0x0010, 0x080c, 0x6586, 0x002e, 0x05c8, 0x080c,
-	0x539a, 0x1540, 0x6014, 0x2048, 0xa807, 0x0000, 0xa867, 0x0103,
-	0xa833, 0xdead, 0x00f8, 0x0026, 0x2011, 0x8008, 0x080c, 0x6586,
+	0x0136, 0x9080, 0x001b, 0x20a0, 0x2011, 0x0006, 0x20a9, 0x0001,
+	0x3418, 0x8318, 0x23a0, 0x4003, 0x3318, 0x8318, 0x2398, 0x8211,
+	0x1db8, 0x2011, 0x0006, 0x013e, 0x20a0, 0x3318, 0x8318, 0x2398,
+	0x4003, 0x3418, 0x8318, 0x23a0, 0x8211, 0x1db8, 0x0096, 0x080c,
+	0xbb2c, 0x0130, 0x6014, 0x2048, 0xa807, 0x0000, 0xa867, 0x0103,
+	0x009e, 0x0804, 0x9e42, 0x0096, 0x00d6, 0x0036, 0x7330, 0x9386,
+	0x0200, 0x11a8, 0x6010, 0x00b6, 0x2058, 0xb8bf, 0x0000, 0x00be,
+	0x6014, 0x9005, 0x0130, 0x2048, 0xa807, 0x0000, 0xa867, 0x0103,
+	0xab32, 0x080c, 0x9e42, 0x003e, 0x00de, 0x009e, 0x0005, 0x0011,
+	0x1d48, 0x0cc8, 0x0006, 0x0016, 0x080c, 0xc22c, 0x0188, 0x6014,
+	0x9005, 0x1170, 0x600b, 0x0003, 0x601b, 0x0000, 0x6043, 0x0000,
+	0x2009, 0x0022, 0x080c, 0xa622, 0x9006, 0x001e, 0x000e, 0x0005,
+	0x9085, 0x0001, 0x0cd0, 0x0096, 0x0016, 0x20a9, 0x0014, 0x9e80,
+	0x000c, 0x20e1, 0x0000, 0x2098, 0x6014, 0x2048, 0xa860, 0x20e8,
+	0xa85c, 0x9080, 0x0002, 0x20a0, 0x4003, 0x2001, 0x0205, 0x2003,
+	0x0001, 0x2099, 0x0260, 0x20a9, 0x0016, 0x4003, 0x20a9, 0x000a,
+	0xa804, 0x2048, 0xa860, 0x20e8, 0xa85c, 0x9080, 0x0002, 0x20a0,
+	0x4003, 0x2001, 0x0205, 0x2003, 0x0002, 0x2099, 0x0260, 0x20a9,
+	0x0020, 0x4003, 0x2003, 0x0000, 0x6014, 0x2048, 0xa800, 0x2048,
+	0xa867, 0x0103, 0x080c, 0x9e42, 0x001e, 0x009e, 0x0005, 0x0096,
+	0x0016, 0x900e, 0x7030, 0x9086, 0x0100, 0x0140, 0x7038, 0x9084,
+	0x00ff, 0x800c, 0x703c, 0x9084, 0x00ff, 0x8004, 0x9080, 0x0004,
+	0x9108, 0x810b, 0x2011, 0x0002, 0x2019, 0x000c, 0x6014, 0x2048,
+	0x080c, 0xb725, 0x080c, 0xbb2c, 0x0140, 0x6014, 0x2048, 0xa807,
+	0x0000, 0xa864, 0xa8e2, 0xa867, 0x0103, 0x080c, 0x9e42, 0x001e,
+	0x009e, 0x0005, 0x0016, 0x0096, 0x7030, 0x9086, 0x0100, 0x1118,
+	0x2009, 0x0004, 0x0010, 0x7034, 0x800c, 0x810b, 0x2011, 0x000c,
+	0x2019, 0x000c, 0x6014, 0x2048, 0xa804, 0x0096, 0x9005, 0x0108,
+	0x2048, 0x080c, 0xb725, 0x009e, 0x080c, 0xbb2c, 0x0148, 0xa804,
+	0x9005, 0x1158, 0xa807, 0x0000, 0xa864, 0xa8e2, 0xa867, 0x0103,
+	0x080c, 0x9e42, 0x009e, 0x001e, 0x0005, 0x0086, 0x2040, 0xa030,
+	0x8007, 0x9086, 0x0100, 0x1118, 0x080c, 0xa7d1, 0x00e0, 0xa034,
+	0x8007, 0x800c, 0x8806, 0x8006, 0x8007, 0x90bc, 0x003f, 0x9084,
+	0xffc0, 0x9080, 0x000c, 0xa87b, 0x0000, 0xa883, 0x0000, 0xa897,
+	0x4000, 0xaaa0, 0xab9c, 0xaca8, 0xada4, 0x2031, 0x0000, 0x2041,
+	0x122f, 0x0019, 0x0d08, 0x008e, 0x0898, 0x0096, 0x0006, 0x080c,
+	0x0feb, 0x000e, 0x01b0, 0xa8ab, 0x0dcb, 0xa876, 0x000e, 0xa8a2,
+	0x0006, 0xae6a, 0x2800, 0xa89e, 0xa97a, 0xaf72, 0xaa8e, 0xab92,
+	0xac96, 0xad9a, 0x0086, 0x2940, 0x080c, 0x10d5, 0x008e, 0x9085,
+	0x0001, 0x009e, 0x0005, 0x00e6, 0x00d6, 0x0026, 0x7008, 0x9084,
+	0x00ff, 0x6210, 0x00b6, 0x2258, 0xba10, 0x00be, 0x9206, 0x1520,
+	0x700c, 0x6210, 0x00b6, 0x2258, 0xba14, 0x00be, 0x9206, 0x11e0,
+	0x6043, 0x0000, 0x2c68, 0x0016, 0x2009, 0x0035, 0x080c, 0xc1a4,
+	0x001e, 0x1158, 0x622c, 0x2268, 0x2071, 0x026c, 0x6b20, 0x9386,
+	0x0003, 0x0130, 0x9386, 0x0006, 0x0128, 0x080c, 0x9e42, 0x0020,
+	0x0039, 0x0010, 0x080c, 0xa457, 0x002e, 0x00de, 0x00ee, 0x0005,
+	0x0096, 0x6814, 0x2048, 0x9186, 0x0015, 0x0904, 0xa43f, 0x918e,
+	0x0016, 0x1904, 0xa455, 0x700c, 0x908c, 0xff00, 0x9186, 0x1700,
+	0x0120, 0x9186, 0x0300, 0x1904, 0xa419, 0x89ff, 0x1138, 0x6800,
+	0x9086, 0x000f, 0x0904, 0xa3fc, 0x0804, 0xa453, 0x6808, 0x9086,
+	0xffff, 0x1904, 0xa441, 0xa87c, 0x9084, 0x0060, 0x9086, 0x0020,
+	0x1128, 0xa83c, 0xa940, 0x9105, 0x1904, 0xa441, 0x6824, 0xd0b4,
+	0x1904, 0xa441, 0x080c, 0xbd15, 0x685c, 0xa882, 0xa87c, 0xc0dc,
+	0xc0f4, 0xc0d4, 0xa87e, 0x0026, 0x900e, 0x6a18, 0x2001, 0x000a,
+	0x080c, 0x8259, 0xa884, 0x920a, 0x0208, 0x8011, 0xaa86, 0x82ff,
+	0x002e, 0x1138, 0x00c6, 0x2d60, 0x080c, 0xb84f, 0x00ce, 0x0804,
+	0xa453, 0x00c6, 0xa868, 0xd0fc, 0x1118, 0x080c, 0x5d56, 0x0010,
+	0x080c, 0x60fd, 0x00ce, 0x1904, 0xa441, 0x00c6, 0x2d60, 0x080c,
+	0x9e42, 0x00ce, 0x0804, 0xa453, 0x00c6, 0x080c, 0x9e8f, 0x0198,
+	0x6017, 0x0000, 0x6810, 0x6012, 0x080c, 0xbfa6, 0x6023, 0x0003,
+	0x6904, 0x00c6, 0x2d60, 0x080c, 0x9e42, 0x00ce, 0x080c, 0x9ebc,
+	0x00ce, 0x0804, 0xa453, 0x2001, 0x1958, 0x2004, 0x6842, 0x00ce,
+	0x04d0, 0x7008, 0x9086, 0x000b, 0x11c8, 0x6010, 0x00b6, 0x2058,
+	0xb900, 0xc1bc, 0xb902, 0x00be, 0x00c6, 0x2d60, 0xa87b, 0x0003,
+	0x080c, 0xc1e6, 0x6007, 0x0085, 0x6003, 0x000b, 0x6023, 0x0002,
+	0x080c, 0x83da, 0x080c, 0x896d, 0x00ce, 0x00e8, 0x700c, 0x9086,
+	0x2a00, 0x1138, 0x2001, 0x1958, 0x2004, 0x6842, 0x00a0, 0x0479,
+	0x00a0, 0x89ff, 0x090c, 0x0db4, 0x00c6, 0x00d6, 0x2d60, 0xa867,
+	0x0103, 0xa87b, 0x0003, 0x080c, 0x66ac, 0x080c, 0xbd15, 0x080c,
+	0x9e72, 0x00de, 0x00ce, 0x080c, 0x9e42, 0x009e, 0x0005, 0x9186,
+	0x0015, 0x1128, 0x2001, 0x1958, 0x2004, 0x6842, 0x0068, 0x918e,
+	0x0016, 0x1160, 0x00c6, 0x2d00, 0x2060, 0x080c, 0xd7a8, 0x080c,
+	0x81ed, 0x080c, 0x9e42, 0x00ce, 0x080c, 0x9e42, 0x0005, 0x0026,
+	0x0036, 0x0046, 0x7228, 0xacb0, 0xabac, 0xd2f4, 0x0130, 0x2001,
+	0x1958, 0x2004, 0x6842, 0x0804, 0xa4d1, 0x00c6, 0x2d60, 0x080c,
+	0xb750, 0x00ce, 0x6804, 0x9086, 0x0050, 0x1168, 0x00c6, 0x2d00,
+	0x2060, 0x6003, 0x0001, 0x6007, 0x0050, 0x080c, 0x83da, 0x080c,
+	0x896d, 0x00ce, 0x04f0, 0x6800, 0x9086, 0x000f, 0x01a8, 0x89ff,
+	0x090c, 0x0db4, 0x6800, 0x9086, 0x0004, 0x1190, 0xa87c, 0xd0ac,
+	0x0178, 0xa843, 0x0fff, 0xa83f, 0x0fff, 0xa880, 0xc0fc, 0xa882,
+	0x2001, 0x0001, 0x6832, 0x0400, 0x2001, 0x0007, 0x6832, 0x00e0,
+	0xa87c, 0xd0b4, 0x1150, 0xd0ac, 0x0db8, 0x6824, 0xd0f4, 0x1d48,
+	0xa838, 0xa934, 0x9105, 0x0d80, 0x0c20, 0xd2ec, 0x1d68, 0x7024,
+	0x9306, 0x1118, 0x7020, 0x9406, 0x0d38, 0x7020, 0x683e, 0x7024,
+	0x683a, 0x2001, 0x0005, 0x6832, 0x080c, 0xbe9d, 0x080c, 0x896d,
+	0x0010, 0x080c, 0x9e42, 0x004e, 0x003e, 0x002e, 0x0005, 0x00e6,
+	0x00d6, 0x0026, 0x7008, 0x9084, 0x00ff, 0x6210, 0x00b6, 0x2258,
+	0xba10, 0x00be, 0x9206, 0x1904, 0xa53c, 0x700c, 0x6210, 0x00b6,
+	0x2258, 0xba14, 0x00be, 0x9206, 0x1904, 0xa53c, 0x6038, 0x2068,
+	0x6824, 0xc0dc, 0x6826, 0x6a20, 0x9286, 0x0007, 0x0904, 0xa53c,
+	0x9286, 0x0002, 0x0904, 0xa53c, 0x9286, 0x0000, 0x05e8, 0x6808,
+	0x633c, 0x9306, 0x15c8, 0x2071, 0x026c, 0x9186, 0x0015, 0x0570,
+	0x918e, 0x0016, 0x1100, 0x00c6, 0x6038, 0x2060, 0x6104, 0x9186,
+	0x004b, 0x01c0, 0x9186, 0x004c, 0x01a8, 0x9186, 0x004d, 0x0190,
+	0x9186, 0x004e, 0x0178, 0x9186, 0x0052, 0x0160, 0x6014, 0x0096,
+	0x2048, 0x080c, 0xbb2c, 0x090c, 0x0db4, 0xa87b, 0x0003, 0x009e,
+	0x080c, 0xc1e6, 0x6007, 0x0085, 0x6003, 0x000b, 0x6023, 0x0002,
+	0x080c, 0x83da, 0x080c, 0x896d, 0x00ce, 0x0030, 0x6038, 0x2070,
+	0x2001, 0x1958, 0x2004, 0x7042, 0x080c, 0x9e42, 0x002e, 0x00de,
+	0x00ee, 0x0005, 0x00b6, 0x0096, 0x00f6, 0x6014, 0x2048, 0x6010,
+	0x2058, 0x91b6, 0x0015, 0x0130, 0xba08, 0xbb0c, 0xbc00, 0xc48c,
+	0xbc02, 0x0460, 0x0096, 0x0156, 0x0036, 0x0026, 0x2b48, 0x9e90,
+	0x0010, 0x2019, 0x000a, 0x20a9, 0x0004, 0x080c, 0xae20, 0x002e,
+	0x003e, 0x015e, 0x009e, 0x1904, 0xa5ab, 0x0096, 0x0156, 0x0036,
+	0x0026, 0x2b48, 0x9e90, 0x0014, 0x2019, 0x0006, 0x20a9, 0x0004,
+	0x080c, 0xae20, 0x002e, 0x003e, 0x015e, 0x009e, 0x15a0, 0x7238,
+	0xba0a, 0x733c, 0xbb0e, 0xbc00, 0xc48d, 0xbc02, 0xa804, 0x9005,
+	0x1128, 0x00fe, 0x009e, 0x00be, 0x0804, 0xa246, 0x0096, 0x2048,
+	0xaa12, 0xab16, 0xac0a, 0x009e, 0x8006, 0x8006, 0x8007, 0x90bc,
+	0x003f, 0x9084, 0xffc0, 0x9080, 0x0002, 0x2009, 0x002b, 0xaaa0,
+	0xab9c, 0xaca8, 0xada4, 0x2031, 0x0000, 0x2041, 0x122f, 0x080c,
+	0xa345, 0x0130, 0x00fe, 0x009e, 0x080c, 0x9e42, 0x00be, 0x0005,
+	0x080c, 0xa7d1, 0x0cb8, 0x2b78, 0x00f6, 0x080c, 0x2fdc, 0x080c,
+	0xc241, 0x00fe, 0x00c6, 0x080c, 0x9dec, 0x2f00, 0x6012, 0x6017,
+	0x0000, 0x6023, 0x0001, 0x6007, 0x0001, 0x6003, 0x0001, 0x2001,
+	0x0007, 0x080c, 0x6198, 0x080c, 0x61c4, 0x080c, 0x8422, 0x080c,
+	0x896d, 0x00ce, 0x0804, 0xa57e, 0x2100, 0x91b2, 0x0053, 0x1a0c,
+	0x0db4, 0x91b2, 0x0040, 0x1a04, 0xa634, 0x0002, 0xa622, 0xa622,
+	0xa618, 0xa622, 0xa622, 0xa622, 0xa616, 0xa616, 0xa616, 0xa616,
+	0xa616, 0xa616, 0xa616, 0xa616, 0xa616, 0xa616, 0xa616, 0xa616,
+	0xa616, 0xa616, 0xa616, 0xa616, 0xa616, 0xa616, 0xa616, 0xa616,
+	0xa616, 0xa616, 0xa616, 0xa616, 0xa616, 0xa622, 0xa616, 0xa622,
+	0xa622, 0xa616, 0xa616, 0xa616, 0xa616, 0xa616, 0xa618, 0xa616,
+	0xa616, 0xa616, 0xa616, 0xa616, 0xa616, 0xa616, 0xa616, 0xa616,
+	0xa622, 0xa622, 0xa616, 0xa616, 0xa616, 0xa616, 0xa616, 0xa616,
+	0xa616, 0xa616, 0xa616, 0xa622, 0xa616, 0xa616, 0x080c, 0x0db4,
+	0x0066, 0x00b6, 0x6610, 0x2658, 0xb8bc, 0xc08c, 0xb8be, 0x00be,
+	0x006e, 0x0000, 0x6003, 0x0001, 0x6106, 0x9186, 0x0032, 0x0118,
+	0x080c, 0x8422, 0x0010, 0x080c, 0x83da, 0x0126, 0x2091, 0x8000,
+	0x080c, 0x896d, 0x012e, 0x0005, 0x2600, 0x0002, 0xa648, 0xa648,
+	0xa648, 0xa622, 0xa622, 0xa648, 0xa648, 0xa648, 0xa648, 0xa622,
+	0xa648, 0xa622, 0xa648, 0xa622, 0xa648, 0xa648, 0xa648, 0xa648,
+	0x080c, 0x0db4, 0x6004, 0x90b2, 0x0053, 0x1a0c, 0x0db4, 0x91b6,
+	0x0013, 0x0904, 0xa70c, 0x91b6, 0x0027, 0x1904, 0xa6c7, 0x080c,
+	0x8861, 0x6004, 0x080c, 0xbd21, 0x01b0, 0x080c, 0xbd32, 0x01a8,
+	0x908e, 0x0021, 0x0904, 0xa6c4, 0x908e, 0x0022, 0x1130, 0x080c,
+	0xa272, 0x0904, 0xa6c0, 0x0804, 0xa6c1, 0x908e, 0x003d, 0x0904,
+	0xa6c4, 0x0804, 0xa6ba, 0x080c, 0x3005, 0x2001, 0x0007, 0x080c,
+	0x6198, 0x6010, 0x00b6, 0x2058, 0xb9a0, 0x00be, 0x080c, 0xa7d1,
+	0x9186, 0x007e, 0x1148, 0x2001, 0x1836, 0x2014, 0xc285, 0x080c,
+	0x6f9b, 0x1108, 0xc2ad, 0x2202, 0x0036, 0x0026, 0x2019, 0x0028,
+	0x2110, 0x080c, 0xd803, 0x002e, 0x003e, 0x0016, 0x0026, 0x0036,
+	0x2110, 0x2019, 0x0028, 0x080c, 0x8564, 0x0076, 0x903e, 0x080c,
+	0x8452, 0x6010, 0x00b6, 0x905d, 0x0100, 0x00be, 0x2c08, 0x080c,
+	0xd2bc, 0x007e, 0x003e, 0x002e, 0x001e, 0x080c, 0xc241, 0x0016,
+	0x080c, 0xbf9e, 0x080c, 0x9e42, 0x001e, 0x080c, 0x30d7, 0x080c,
+	0x896d, 0x0030, 0x080c, 0xbf9e, 0x080c, 0x9e42, 0x080c, 0x896d,
+	0x0005, 0x080c, 0xa7d1, 0x0cb0, 0x080c, 0xa80d, 0x0c98, 0x9186,
+	0x0014, 0x1db0, 0x080c, 0x8861, 0x6004, 0x908e, 0x0022, 0x1118,
+	0x080c, 0xa272, 0x0d68, 0x080c, 0x2fdc, 0x080c, 0xc241, 0x080c,
+	0xbd21, 0x1190, 0x080c, 0x3005, 0x6010, 0x00b6, 0x2058, 0xb9a0,
+	0x00be, 0x080c, 0xa7d1, 0x9186, 0x007e, 0x1128, 0x2001, 0x1836,
+	0x200c, 0xc185, 0x2102, 0x0870, 0x080c, 0xbd32, 0x1118, 0x080c,
+	0xa7d1, 0x0840, 0x6004, 0x908e, 0x0032, 0x1160, 0x00e6, 0x00f6,
+	0x2071, 0x1894, 0x2079, 0x0000, 0x080c, 0x336b, 0x00fe, 0x00ee,
+	0x0804, 0xa6ba, 0x6004, 0x908e, 0x0021, 0x0d48, 0x908e, 0x0022,
+	0x090c, 0xa7d1, 0x0804, 0xa6ba, 0x90b2, 0x0040, 0x1a04, 0xa7ba,
+	0x2008, 0x0002, 0xa754, 0xa755, 0xa758, 0xa75b, 0xa75e, 0xa761,
+	0xa752, 0xa752, 0xa752, 0xa752, 0xa752, 0xa752, 0xa752, 0xa752,
+	0xa752, 0xa752, 0xa752, 0xa752, 0xa752, 0xa752, 0xa752, 0xa752,
+	0xa752, 0xa752, 0xa752, 0xa752, 0xa752, 0xa752, 0xa752, 0xa752,
+	0xa764, 0xa76f, 0xa752, 0xa771, 0xa76f, 0xa752, 0xa752, 0xa752,
+	0xa752, 0xa752, 0xa76f, 0xa76f, 0xa752, 0xa752, 0xa752, 0xa752,
+	0xa752, 0xa752, 0xa752, 0xa752, 0xa7a1, 0xa76f, 0xa752, 0xa76b,
+	0xa752, 0xa752, 0xa752, 0xa76c, 0xa752, 0xa752, 0xa752, 0xa76f,
+	0xa798, 0xa752, 0x080c, 0x0db4, 0x00d0, 0x2001, 0x000b, 0x0410,
+	0x2001, 0x0003, 0x00f8, 0x2001, 0x0005, 0x00e0, 0x2001, 0x0001,
+	0x00c8, 0x2001, 0x0009, 0x00b0, 0x080c, 0x8861, 0x6003, 0x0005,
+	0x080c, 0x896d, 0x0070, 0x0018, 0x0010, 0x080c, 0x6198, 0x0804,
+	0xa7b2, 0x080c, 0x8861, 0x080c, 0xc244, 0x6003, 0x0004, 0x080c,
+	0x896d, 0x0005, 0x080c, 0x6198, 0x080c, 0x8861, 0x6003, 0x0002,
+	0x0036, 0x2019, 0x185e, 0x2304, 0x9084, 0xff00, 0x1120, 0x2001,
+	0x1956, 0x201c, 0x0040, 0x8007, 0x909a, 0x0004, 0x0ec0, 0x8003,
+	0x801b, 0x831b, 0x9318, 0x631a, 0x003e, 0x080c, 0x896d, 0x0c08,
+	0x080c, 0x8861, 0x080c, 0xbf9e, 0x080c, 0x9e42, 0x080c, 0x896d,
+	0x08c0, 0x00e6, 0x00f6, 0x2071, 0x1894, 0x2079, 0x0000, 0x080c,
+	0x336b, 0x00fe, 0x00ee, 0x080c, 0x8861, 0x080c, 0x9e42, 0x080c,
+	0x896d, 0x0838, 0x080c, 0x8861, 0x6003, 0x0002, 0x080c, 0xc244,
+	0x0804, 0x896d, 0x2600, 0x2008, 0x0002, 0xa7cf, 0xa7cf, 0xa7cf,
+	0xa7b2, 0xa7b2, 0xa7cf, 0xa7cf, 0xa7cf, 0xa7cf, 0xa7b2, 0xa7cf,
+	0xa7b2, 0xa7cf, 0xa7b2, 0xa7cf, 0xa7cf, 0xa7cf, 0xa7cf, 0x080c,
+	0x0db4, 0x00e6, 0x0096, 0x0026, 0x0016, 0x080c, 0xbb2c, 0x0568,
+	0x6014, 0x2048, 0xa864, 0x9086, 0x0139, 0x11a8, 0xa894, 0x9086,
+	0x0056, 0x1148, 0x080c, 0x5138, 0x0130, 0x2001, 0x0000, 0x900e,
+	0x2011, 0x4000, 0x0028, 0x2001, 0x0030, 0x900e, 0x2011, 0x4005,
+	0x080c, 0xc10b, 0x0090, 0xa868, 0xd0fc, 0x0178, 0xa807, 0x0000,
+	0x0016, 0x6004, 0x908e, 0x0021, 0x0168, 0x908e, 0x003d, 0x0150,
+	0x001e, 0xa867, 0x0103, 0xa833, 0x0100, 0x001e, 0x002e, 0x009e,
+	0x00ee, 0x0005, 0x001e, 0x0009, 0x0cc0, 0x0096, 0x6014, 0x2048,
+	0xa800, 0x2048, 0xa867, 0x0103, 0xa823, 0x8001, 0x009e, 0x0005,
+	0x00b6, 0x6610, 0x2658, 0xb804, 0x9084, 0x00ff, 0x90b2, 0x000c,
+	0x1a0c, 0x0db4, 0x6604, 0x96b6, 0x004d, 0x1120, 0x080c, 0xc02a,
+	0x0804, 0xa895, 0x6604, 0x96b6, 0x0043, 0x1120, 0x080c, 0xc073,
+	0x0804, 0xa895, 0x6604, 0x96b6, 0x004b, 0x1120, 0x080c, 0xc09f,
+	0x0804, 0xa895, 0x6604, 0x96b6, 0x0033, 0x1120, 0x080c, 0xbfc0,
+	0x0804, 0xa895, 0x6604, 0x96b6, 0x0028, 0x1120, 0x080c, 0xbd70,
+	0x0804, 0xa895, 0x6604, 0x96b6, 0x0029, 0x1120, 0x080c, 0xbdb1,
+	0x0804, 0xa895, 0x6604, 0x96b6, 0x001f, 0x1118, 0x080c, 0xa21a,
+	0x04e0, 0x6604, 0x96b6, 0x0000, 0x1118, 0x080c, 0xa542, 0x04a8,
+	0x6604, 0x96b6, 0x0022, 0x1118, 0x080c, 0xa253, 0x0470, 0x6604,
+	0x96b6, 0x0035, 0x1118, 0x080c, 0xa363, 0x0438, 0x6604, 0x96b6,
+	0x0039, 0x1118, 0x080c, 0xa4d7, 0x0400, 0x6604, 0x96b6, 0x003d,
+	0x1118, 0x080c, 0xa28b, 0x00c8, 0x6604, 0x96b6, 0x0044, 0x1118,
+	0x080c, 0xa2c7, 0x0090, 0x6604, 0x96b6, 0x0049, 0x1118, 0x080c,
+	0xa2f2, 0x0058, 0x91b6, 0x0015, 0x1110, 0x0063, 0x0030, 0x91b6,
+	0x0016, 0x1128, 0x00be, 0x0804, 0xab55, 0x00be, 0x0005, 0x080c,
+	0x9ed7, 0x0cd8, 0xa8b2, 0xa8b5, 0xa8b2, 0xa8f9, 0xa8b2, 0xaa89,
+	0xab62, 0xa8b2, 0xa8b2, 0xab2f, 0xa8b2, 0xab43, 0x0096, 0x080c,
+	0x1511, 0x6014, 0x2048, 0xa800, 0x2048, 0xa867, 0x0103, 0x009e,
+	0x0804, 0x9e42, 0xa001, 0xa001, 0x0005, 0x00e6, 0x2071, 0x1800,
+	0x708c, 0x9086, 0x0074, 0x1540, 0x080c, 0xd28d, 0x11b0, 0x6010,
+	0x00b6, 0x2058, 0x7030, 0xd08c, 0x0128, 0xb800, 0xd0bc, 0x0110,
+	0xc0c5, 0xb802, 0x00e9, 0x00be, 0x2001, 0x0006, 0x080c, 0x6198,
+	0x080c, 0x3005, 0x080c, 0x9e42, 0x0088, 0x2001, 0x000a, 0x080c,
+	0x6198, 0x080c, 0x3005, 0x6003, 0x0001, 0x6007, 0x0001, 0x080c,
+	0x8422, 0x080c, 0x896d, 0x0010, 0x080c, 0xaa74, 0x00ee, 0x0005,
+	0x00d6, 0xb800, 0xd084, 0x0158, 0x9006, 0x080c, 0x6184, 0x2069,
+	0x1853, 0x6804, 0x0020, 0x2001, 0x0006, 0x080c, 0x61c4, 0x00de,
+	0x0005, 0x00b6, 0x0096, 0x00d6, 0x2011, 0x1823, 0x2204, 0x9086,
+	0x0074, 0x1904, 0xaa4b, 0x6010, 0x2058, 0xbaa0, 0x9286, 0x007e,
+	0x1120, 0x080c, 0xaca6, 0x0804, 0xa9b0, 0x00d6, 0x080c, 0x6f9b,
+	0x0198, 0x0026, 0x2011, 0x0010, 0x080c, 0x658f, 0x002e, 0x05c8,
+	0x080c, 0x53a3, 0x1540, 0x6014, 0x2048, 0xa807, 0x0000, 0xa867,
+	0x0103, 0xa833, 0xdead, 0x00f8, 0x0026, 0x2011, 0x8008, 0x080c,
+	0x658f, 0x002e, 0x0530, 0x6014, 0x2048, 0xa864, 0x9084, 0x00ff,
+	0x9086, 0x0039, 0x1140, 0x2001, 0x0030, 0x900e, 0x2011, 0x4009,
+	0x080c, 0xc10b, 0x0040, 0x6014, 0x2048, 0xa807, 0x0000, 0xa867,
+	0x0103, 0xa833, 0xdead, 0x6010, 0x2058, 0xb9a0, 0x0016, 0x080c,
+	0x3005, 0x080c, 0x9e42, 0x001e, 0x080c, 0x30d7, 0x00de, 0x0804,
+	0xaa4e, 0x00de, 0x080c, 0xac9b, 0x6010, 0x2058, 0xbaa0, 0x9286,
+	0x0080, 0x1510, 0x6014, 0x9005, 0x01a8, 0x2048, 0xa864, 0x9084,
+	0x00ff, 0x9086, 0x0039, 0x1140, 0x2001, 0x0000, 0x900e, 0x2011,
+	0x4000, 0x080c, 0xc10b, 0x0030, 0xa807, 0x0000, 0xa867, 0x0103,
+	0xa833, 0x0200, 0x2001, 0x0006, 0x080c, 0x6198, 0x080c, 0x3005,
+	0x080c, 0x9e42, 0x0804, 0xaa4e, 0x080c, 0xaa5c, 0x6014, 0x9005,
+	0x0190, 0x2048, 0xa868, 0xd0f4, 0x01e8, 0xa864, 0x9084, 0x00ff,
+	0x9086, 0x0039, 0x1d08, 0x2001, 0x0000, 0x900e, 0x2011, 0x4000,
+	0x080c, 0xc10b, 0x08f8, 0x080c, 0xaa52, 0x0160, 0x9006, 0x080c,
+	0x6184, 0x2001, 0x0004, 0x080c, 0x61c4, 0x2001, 0x0007, 0x080c,
+	0x6198, 0x08a0, 0x2001, 0x0004, 0x080c, 0x6198, 0x6003, 0x0001,
+	0x6007, 0x0003, 0x080c, 0x8422, 0x080c, 0x896d, 0x0804, 0xaa4e,
+	0xb85c, 0xd0e4, 0x01d0, 0x080c, 0xbf40, 0x080c, 0x6f9b, 0x0118,
+	0xd0dc, 0x1904, 0xa972, 0x2011, 0x1836, 0x2204, 0xc0ad, 0x2012,
+	0x2001, 0x0002, 0x00f6, 0x2079, 0x0100, 0x78e3, 0x0000, 0x080c,
+	0x26d9, 0x78e2, 0x00fe, 0x0804, 0xa972, 0x080c, 0xbf7d, 0x2011,
+	0x1836, 0x2204, 0xc0a5, 0x2012, 0x0006, 0x080c, 0xd3e6, 0x000e,
+	0x1904, 0xa972, 0xc0b5, 0x2012, 0x2001, 0x0006, 0x080c, 0x6198,
+	0x9006, 0x080c, 0x6184, 0x00c6, 0x2001, 0x180f, 0x2004, 0xd09c,
+	0x0520, 0x00f6, 0x2079, 0x0100, 0x00e6, 0x2071, 0x1800, 0x700c,
+	0x9084, 0x00ff, 0x78e6, 0x707a, 0x7010, 0x78ea, 0x707e, 0x908c,
+	0x00ff, 0x00ee, 0x780c, 0xc0b5, 0x780e, 0x00fe, 0x080c, 0x26ae,
+	0x00f6, 0x2100, 0x900e, 0x080c, 0x2665, 0x795a, 0x00fe, 0x9186,
+	0x0081, 0x01d8, 0x2009, 0x0081, 0x00c8, 0x2009, 0x00ef, 0x00f6,
+	0x2079, 0x0100, 0x79ea, 0x7932, 0x7936, 0x780c, 0xc0b5, 0x780e,
+	0x00fe, 0x080c, 0x26ae, 0x00f6, 0x2079, 0x1800, 0x797e, 0x2100,
+	0x900e, 0x080c, 0x2665, 0x795a, 0x00fe, 0x8108, 0x080c, 0x61e7,
+	0x2b00, 0x00ce, 0x1904, 0xa972, 0x6012, 0x2009, 0x180f, 0x210c,
+	0xd19c, 0x0150, 0x2009, 0x027c, 0x210c, 0x918c, 0x00ff, 0xb912,
+	0x2009, 0x027d, 0x210c, 0xb916, 0x2001, 0x0002, 0x080c, 0x6198,
+	0x6023, 0x0001, 0x6003, 0x0001, 0x6007, 0x0002, 0x080c, 0x8422,
+	0x080c, 0x896d, 0x0018, 0x080c, 0xa7d1, 0x0431, 0x00de, 0x009e,
+	0x00be, 0x0005, 0x2001, 0x1810, 0x2004, 0xd0a4, 0x0120, 0x2001,
+	0x1854, 0x2004, 0xd0ac, 0x0005, 0x00e6, 0x080c, 0xd85c, 0x0190,
+	0x2071, 0x0260, 0x7108, 0x720c, 0x918c, 0x00ff, 0x1118, 0x9284,
+	0xff00, 0x0140, 0x6010, 0x2058, 0xb8a0, 0x9084, 0xff80, 0x1110,
+	0xb912, 0xba16, 0x00ee, 0x0005, 0x2030, 0x2001, 0x0007, 0x080c,
+	0x6198, 0x080c, 0x53a3, 0x1120, 0x2001, 0x0007, 0x080c, 0x61c4,
+	0x080c, 0x3005, 0x6020, 0x9086, 0x000a, 0x1108, 0x0005, 0x0804,
+	0x9e42, 0x00b6, 0x00e6, 0x0026, 0x0016, 0x2071, 0x1800, 0x708c,
+	0x9086, 0x0014, 0x1904, 0xab26, 0x00d6, 0x080c, 0x6f9b, 0x0198,
+	0x0026, 0x2011, 0x0010, 0x080c, 0x658f, 0x002e, 0x05c8, 0x080c,
+	0x53a3, 0x1540, 0x6014, 0x2048, 0xa807, 0x0000, 0xa867, 0x0103,
+	0xa833, 0xdead, 0x00f8, 0x0026, 0x2011, 0x8008, 0x080c, 0x658f,
 	0x002e, 0x0530, 0x6014, 0x2048, 0xa864, 0x9084, 0x00ff, 0x9086,
 	0x0039, 0x1140, 0x2001, 0x0030, 0x900e, 0x2011, 0x4009, 0x080c,
-	0xc0f1, 0x0040, 0x6014, 0x2048, 0xa807, 0x0000, 0xa867, 0x0103,
-	0xa833, 0xdead, 0x6010, 0x2058, 0xb9a0, 0x0016, 0x080c, 0x3003,
-	0x080c, 0x9e32, 0x001e, 0x080c, 0x30d5, 0x00de, 0x0804, 0xaa3b,
-	0x00de, 0x080c, 0xac88, 0x6010, 0x2058, 0xbaa0, 0x9286, 0x0080,
-	0x1510, 0x6014, 0x9005, 0x01a8, 0x2048, 0xa864, 0x9084, 0x00ff,
-	0x9086, 0x0039, 0x1140, 0x2001, 0x0000, 0x900e, 0x2011, 0x4000,
-	0x080c, 0xc0f1, 0x0030, 0xa807, 0x0000, 0xa867, 0x0103, 0xa833,
-	0x0200, 0x2001, 0x0006, 0x080c, 0x618f, 0x080c, 0x3003, 0x080c,
-	0x9e32, 0x0804, 0xaa3b, 0x080c, 0xaa49, 0x6014, 0x9005, 0x0190,
-	0x2048, 0xa868, 0xd0f4, 0x01e8, 0xa864, 0x9084, 0x00ff, 0x9086,
-	0x0039, 0x1d08, 0x2001, 0x0000, 0x900e, 0x2011, 0x4000, 0x080c,
-	0xc0f1, 0x08f8, 0x080c, 0xaa3f, 0x0160, 0x9006, 0x080c, 0x617b,
-	0x2001, 0x0004, 0x080c, 0x61bb, 0x2001, 0x0007, 0x080c, 0x618f,
-	0x08a0, 0x2001, 0x0004, 0x080c, 0x618f, 0x6003, 0x0001, 0x6007,
-	0x0003, 0x080c, 0x8439, 0x080c, 0x8973, 0x0804, 0xaa3b, 0xb85c,
-	0xd0e4, 0x01d0, 0x080c, 0xbf26, 0x080c, 0x6fb2, 0x0118, 0xd0dc,
-	0x1904, 0xa961, 0x2011, 0x1836, 0x2204, 0xc0ad, 0x2012, 0x2001,
-	0x0002, 0x00f6, 0x2079, 0x0100, 0x78e3, 0x0000, 0x080c, 0x26d7,
-	0x78e2, 0x00fe, 0x0804, 0xa961, 0x080c, 0xbf63, 0x2011, 0x1836,
-	0x2204, 0xc0a5, 0x2012, 0x0006, 0x080c, 0xd3c5, 0x000e, 0x1904,
-	0xa961, 0xc0b5, 0x2012, 0x2001, 0x0006, 0x080c, 0x618f, 0x9006,
-	0x080c, 0x617b, 0x00c6, 0x2001, 0x180f, 0x2004, 0xd09c, 0x0520,
-	0x00f6, 0x2079, 0x0100, 0x00e6, 0x2071, 0x1800, 0x700c, 0x9084,
-	0x00ff, 0x78e6, 0x707a, 0x7010, 0x78ea, 0x707e, 0x908c, 0x00ff,
-	0x00ee, 0x780c, 0xc0b5, 0x780e, 0x00fe, 0x080c, 0x26ac, 0x00f6,
-	0x2100, 0x900e, 0x080c, 0x2663, 0x795a, 0x00fe, 0x9186, 0x0081,
-	0x01d8, 0x2009, 0x0081, 0x00c8, 0x2009, 0x00ef, 0x00f6, 0x2079,
-	0x0100, 0x79ea, 0x7932, 0x7936, 0x780c, 0xc0b5, 0x780e, 0x00fe,
-	0x080c, 0x26ac, 0x00f6, 0x2079, 0x1800, 0x797e, 0x2100, 0x900e,
-	0x080c, 0x2663, 0x795a, 0x00fe, 0x8108, 0x080c, 0x61de, 0x2b00,
-	0x00ce, 0x1904, 0xa961, 0x6012, 0x2009, 0x180f, 0x210c, 0xd19c,
-	0x0150, 0x2009, 0x027c, 0x210c, 0x918c, 0x00ff, 0xb912, 0x2009,
-	0x027d, 0x210c, 0xb916, 0x2001, 0x0002, 0x080c, 0x618f, 0x6023,
-	0x0001, 0x6003, 0x0001, 0x6007, 0x0002, 0x080c, 0x8439, 0x080c,
-	0x8973, 0x0008, 0x0431, 0x00de, 0x009e, 0x00be, 0x0005, 0x2001,
-	0x1810, 0x2004, 0xd0a4, 0x0120, 0x2001, 0x1854, 0x2004, 0xd0ac,
-	0x0005, 0x00e6, 0x080c, 0xd83b, 0x0190, 0x2071, 0x0260, 0x7108,
-	0x720c, 0x918c, 0x00ff, 0x1118, 0x9284, 0xff00, 0x0140, 0x6010,
-	0x2058, 0xb8a0, 0x9084, 0xff80, 0x1110, 0xb912, 0xba16, 0x00ee,
-	0x0005, 0x2030, 0x2001, 0x0007, 0x080c, 0x618f, 0x080c, 0x539a,
-	0x1120, 0x2001, 0x0007, 0x080c, 0x61bb, 0x080c, 0x3003, 0x6020,
-	0x9086, 0x000a, 0x1108, 0x0005, 0x0804, 0x9e32, 0x00b6, 0x00e6,
-	0x0026, 0x0016, 0x2071, 0x1800, 0x708c, 0x9086, 0x0014, 0x1904,
-	0xab13, 0x00d6, 0x080c, 0x6fb2, 0x0198, 0x0026, 0x2011, 0x0010,
-	0x080c, 0x6586, 0x002e, 0x05c8, 0x080c, 0x539a, 0x1540, 0x6014,
-	0x2048, 0xa807, 0x0000, 0xa867, 0x0103, 0xa833, 0xdead, 0x00f8,
-	0x0026, 0x2011, 0x8008, 0x080c, 0x6586, 0x002e, 0x0530, 0x6014,
-	0x2048, 0xa864, 0x9084, 0x00ff, 0x9086, 0x0039, 0x1140, 0x2001,
-	0x0030, 0x900e, 0x2011, 0x4009, 0x080c, 0xc0f1, 0x0040, 0x6014,
-	0x2048, 0xa807, 0x0000, 0xa867, 0x0103, 0xa833, 0xdead, 0x6010,
-	0x2058, 0xb9a0, 0x0016, 0x080c, 0x3003, 0x080c, 0x9e32, 0x001e,
-	0x080c, 0x30d5, 0x00de, 0x0804, 0xab17, 0x00de, 0x080c, 0x539a,
-	0x1170, 0x6014, 0x9005, 0x1158, 0x0036, 0x0046, 0x6010, 0x2058,
-	0xbba0, 0x2021, 0x0006, 0x080c, 0x4a76, 0x004e, 0x003e, 0x00d6,
-	0x6010, 0x2058, 0x080c, 0x62d9, 0x080c, 0xa8d7, 0x00de, 0x080c,
-	0xad59, 0x1588, 0x6010, 0x2058, 0xb890, 0x9005, 0x0560, 0x2001,
-	0x0006, 0x080c, 0x618f, 0x0096, 0x6014, 0x904d, 0x01d0, 0xa864,
-	0x9084, 0x00ff, 0x9086, 0x0039, 0x1140, 0x2001, 0x0000, 0x900e,
-	0x2011, 0x4000, 0x080c, 0xc0f1, 0x0060, 0xa864, 0x9084, 0x00ff,
-	0x9086, 0x0029, 0x0130, 0xa807, 0x0000, 0xa867, 0x0103, 0xa833,
-	0x0200, 0x009e, 0x080c, 0x3003, 0x6020, 0x9086, 0x000a, 0x0138,
-	0x080c, 0x9e32, 0x0020, 0x080c, 0xa7c0, 0x080c, 0xaa61, 0x001e,
-	0x002e, 0x00ee, 0x00be, 0x0005, 0x2011, 0x1823, 0x2204, 0x9086,
-	0x0014, 0x1160, 0x2001, 0x0002, 0x080c, 0x618f, 0x6003, 0x0001,
-	0x6007, 0x0001, 0x080c, 0x8439, 0x0804, 0x8973, 0x0804, 0xaa61,
-	0x2030, 0x2011, 0x1823, 0x2204, 0x9086, 0x0004, 0x1148, 0x96b6,
-	0x000b, 0x1120, 0x2001, 0x0007, 0x080c, 0x618f, 0x0804, 0x9e32,
-	0x0804, 0xaa61, 0x0002, 0xa8a1, 0xab5a, 0xa8a1, 0xab99, 0xa8a1,
-	0xac44, 0xab4f, 0xa8a1, 0xa8a1, 0xac57, 0xa8a1, 0xac67, 0x6604,
-	0x9686, 0x0003, 0x0904, 0xaa76, 0x96b6, 0x001e, 0x1110, 0x080c,
-	0x9e32, 0x0005, 0x00b6, 0x00d6, 0x00c6, 0x080c, 0xac77, 0x11a0,
-	0x9006, 0x080c, 0x617b, 0x080c, 0x2fda, 0x080c, 0xc227, 0x2001,
-	0x0002, 0x080c, 0x618f, 0x6003, 0x0001, 0x6007, 0x0002, 0x080c,
-	0x8439, 0x080c, 0x8973, 0x0408, 0x2009, 0x026e, 0x2104, 0x9086,
-	0x0009, 0x1160, 0x6010, 0x2058, 0xb840, 0x9084, 0x00ff, 0x9005,
-	0x0170, 0x8001, 0xb842, 0x601b, 0x000a, 0x0078, 0x2009, 0x026f,
-	0x2104, 0x9084, 0xff00, 0x9086, 0x1900, 0x1108, 0x08a0, 0x080c,
-	0x2fda, 0x080c, 0xc227, 0x080c, 0xaa61, 0x00ce, 0x00de, 0x00be,
-	0x0005, 0x0096, 0x00b6, 0x0026, 0x9016, 0x080c, 0xac85, 0x00d6,
-	0x2069, 0x194d, 0x2d04, 0x9005, 0x0168, 0x6010, 0x2058, 0xb8a0,
-	0x9086, 0x007e, 0x1138, 0x2069, 0x181f, 0x2d04, 0x8000, 0x206a,
-	0x00de, 0x0010, 0x00de, 0x0088, 0x9006, 0x080c, 0x617b, 0x2001,
-	0x0002, 0x080c, 0x618f, 0x6003, 0x0001, 0x6007, 0x0002, 0x080c,
-	0x8439, 0x080c, 0x8973, 0x0804, 0xac14, 0x080c, 0xbb17, 0x01b0,
-	0x6014, 0x2048, 0xa864, 0x2010, 0x9086, 0x0139, 0x1138, 0x6007,
-	0x0016, 0x2001, 0x0002, 0x080c, 0xc14b, 0x00b0, 0x6014, 0x2048,
-	0xa864, 0xd0fc, 0x0118, 0x2001, 0x0001, 0x0ca8, 0x2001, 0x180e,
-	0x2004, 0xd0dc, 0x0148, 0x6010, 0x2058, 0xb840, 0x9084, 0x00ff,
-	0x9005, 0x1110, 0x9006, 0x0c38, 0x080c, 0xa7c0, 0x2009, 0x026e,
-	0x2134, 0x96b4, 0x00ff, 0x9686, 0x0005, 0x0510, 0x9686, 0x000b,
-	0x01c8, 0x2009, 0x026f, 0x2104, 0x9084, 0xff00, 0x1118, 0x9686,
-	0x0009, 0x01b0, 0x9086, 0x1900, 0x1168, 0x9686, 0x0009, 0x0180,
-	0x2001, 0x0004, 0x080c, 0x618f, 0x2001, 0x0028, 0x601a, 0x6007,
-	0x0052, 0x0010, 0x080c, 0xaa61, 0x002e, 0x00be, 0x009e, 0x0005,
-	0x9286, 0x0139, 0x0160, 0x6014, 0x2048, 0x080c, 0xbb17, 0x0140,
-	0xa864, 0x9086, 0x0139, 0x0118, 0xa868, 0xd0fc, 0x0108, 0x0c50,
-	0x6010, 0x2058, 0xb840, 0x9084, 0x00ff, 0x9005, 0x0138, 0x8001,
-	0xb842, 0x601b, 0x000a, 0x6007, 0x0016, 0x08f0, 0xb8a0, 0x9086,
-	0x007e, 0x1138, 0x00e6, 0x2071, 0x1800, 0x080c, 0x5c64, 0x00ee,
-	0x0010, 0x080c, 0x2fda, 0x0870, 0x080c, 0xac85, 0x1160, 0x2001,
-	0x0004, 0x080c, 0x618f, 0x6003, 0x0001, 0x6007, 0x0003, 0x080c,
-	0x8439, 0x0804, 0x8973, 0x080c, 0xa7c0, 0x0804, 0xaa61, 0x0469,
-	0x1160, 0x2001, 0x0008, 0x080c, 0x618f, 0x6003, 0x0001, 0x6007,
-	0x0005, 0x080c, 0x8439, 0x0804, 0x8973, 0x0804, 0xaa61, 0x00e9,
-	0x1160, 0x2001, 0x000a, 0x080c, 0x618f, 0x6003, 0x0001, 0x6007,
-	0x0001, 0x080c, 0x8439, 0x0804, 0x8973, 0x0804, 0xaa61, 0x2009,
-	0x026e, 0x2104, 0x9086, 0x0003, 0x1138, 0x2009, 0x026f, 0x2104,
-	0x9084, 0xff00, 0x9086, 0x2a00, 0x0005, 0x9085, 0x0001, 0x0005,
-	0x00b6, 0x00c6, 0x0016, 0x6110, 0x2158, 0x080c, 0x624d, 0x001e,
-	0x00ce, 0x00be, 0x0005, 0x00b6, 0x00f6, 0x00e6, 0x00d6, 0x0036,
-	0x0016, 0x6010, 0x2058, 0x2009, 0x1836, 0x2104, 0x9085, 0x0003,
-	0x200a, 0x080c, 0xad2b, 0x0560, 0x2009, 0x1836, 0x2104, 0xc0cd,
-	0x200a, 0x080c, 0x655e, 0x0158, 0x9006, 0x2020, 0x2009, 0x002a,
-	0x080c, 0xd52a, 0x2001, 0x180c, 0x200c, 0xc195, 0x2102, 0x2019,
-	0x002a, 0x2009, 0x0001, 0x080c, 0x2fa5, 0x00e6, 0x2071, 0x1800,
-	0x080c, 0x2dbb, 0x00ee, 0x00c6, 0x0156, 0x20a9, 0x0781, 0x2009,
-	0x007f, 0x080c, 0x30d5, 0x8108, 0x1f04, 0xacc9, 0x015e, 0x00ce,
-	0x080c, 0xac88, 0x2071, 0x0260, 0x2079, 0x0200, 0x7817, 0x0001,
-	0x2001, 0x1836, 0x200c, 0xc1c5, 0x7018, 0xd0fc, 0x0110, 0xd0dc,
-	0x0118, 0x7038, 0xd0dc, 0x1108, 0xc1c4, 0x7817, 0x0000, 0x2001,
-	0x1836, 0x2102, 0x2079, 0x0100, 0x2e04, 0x9084, 0x00ff, 0x2069,
-	0x181e, 0x206a, 0x78e6, 0x0006, 0x8e70, 0x2e04, 0x2069, 0x181f,
-	0x206a, 0x78ea, 0x7832, 0x7836, 0x2010, 0x9084, 0xff00, 0x001e,
-	0x9105, 0x2009, 0x182b, 0x200a, 0x2200, 0x9084, 0x00ff, 0x2008,
-	0x080c, 0x26ac, 0x080c, 0x6fb2, 0x0170, 0x2071, 0x0260, 0x2069,
-	0x1953, 0x7048, 0x206a, 0x704c, 0x6806, 0x7050, 0x680a, 0x7054,
-	0x680e, 0x080c, 0xbf26, 0x0040, 0x2001, 0x0006, 0x080c, 0x618f,
-	0x080c, 0x3003, 0x080c, 0x9e32, 0x001e, 0x003e, 0x00de, 0x00ee,
-	0x00fe, 0x00be, 0x0005, 0x0096, 0x0026, 0x0036, 0x00e6, 0x0156,
-	0x2019, 0x182b, 0x231c, 0x83ff, 0x01f0, 0x2071, 0x0260, 0x7200,
-	0x9294, 0x00ff, 0x7004, 0x9084, 0xff00, 0x9205, 0x9306, 0x1198,
-	0x2011, 0x0276, 0x20a9, 0x0004, 0x2b48, 0x2019, 0x000a, 0x080c,
-	0xae0d, 0x1148, 0x2011, 0x027a, 0x20a9, 0x0004, 0x2019, 0x0006,
-	0x080c, 0xae0d, 0x1100, 0x015e, 0x00ee, 0x003e, 0x002e, 0x009e,
-	0x0005, 0x00e6, 0x2071, 0x0260, 0x7034, 0x9086, 0x0014, 0x11a8,
-	0x7038, 0x9086, 0x0800, 0x1188, 0x703c, 0xd0ec, 0x0160, 0x9084,
-	0x0f00, 0x9086, 0x0100, 0x1138, 0x7054, 0xd0a4, 0x1110, 0xd0ac,
-	0x0110, 0x9006, 0x0010, 0x9085, 0x0001, 0x00ee, 0x0005, 0x00e6,
-	0x0096, 0x00c6, 0x0076, 0x0056, 0x0046, 0x0026, 0x0006, 0x0126,
-	0x2091, 0x8000, 0x2029, 0x19c1, 0x252c, 0x2021, 0x19c7, 0x2424,
-	0x2061, 0x1cd0, 0x2071, 0x1800, 0x7250, 0x7070, 0x9202, 0x1a04,
-	0xade5, 0x080c, 0xd55b, 0x0904, 0xadde, 0x6720, 0x9786, 0x0007,
-	0x0904, 0xadde, 0x2500, 0x9c06, 0x0904, 0xadde, 0x2400, 0x9c06,
-	0x05e8, 0x3e08, 0x9186, 0x0002, 0x1148, 0x6010, 0x9005, 0x0130,
-	0x00b6, 0x2058, 0xb800, 0x00be, 0xd0bc, 0x1580, 0x00c6, 0x6000,
-	0x9086, 0x0004, 0x1110, 0x080c, 0x190d, 0x9786, 0x000a, 0x0148,
-	0x080c, 0xbd1d, 0x1130, 0x00ce, 0x080c, 0xa7c0, 0x080c, 0x9e62,
-	0x00e8, 0x6014, 0x2048, 0x080c, 0xbb17, 0x01a8, 0x9786, 0x0003,
-	0x1530, 0xa867, 0x0103, 0xa87c, 0xd0cc, 0x0130, 0x0096, 0xa878,
-	0x2048, 0x080c, 0x0f9d, 0x009e, 0xab7a, 0xa877, 0x0000, 0x080c,
-	0x687f, 0x080c, 0xbd00, 0x080c, 0x9e62, 0x00ce, 0x9ce0, 0x0018,
-	0x7064, 0x9c02, 0x1210, 0x0804, 0xad8c, 0x012e, 0x000e, 0x002e,
-	0x004e, 0x005e, 0x007e, 0x00ce, 0x009e, 0x00ee, 0x0005, 0x9786,
-	0x0006, 0x1118, 0x080c, 0xd4d5, 0x0c30, 0x9786, 0x000a, 0x0998,
-	0x0880, 0x220c, 0x2304, 0x9106, 0x1130, 0x8210, 0x8318, 0x1f04,
-	0xadf9, 0x9006, 0x0005, 0x2304, 0x9102, 0x0218, 0x2001, 0x0001,
-	0x0008, 0x9006, 0x918d, 0x0001, 0x0005, 0x0136, 0x01c6, 0x0016,
-	0x8906, 0x8006, 0x8007, 0x908c, 0x003f, 0x21e0, 0x9084, 0xffc0,
-	0x9300, 0x2098, 0x3518, 0x20a9, 0x0001, 0x220c, 0x4002, 0x910e,
-	0x1140, 0x8210, 0x8319, 0x1dc8, 0x9006, 0x001e, 0x01ce, 0x013e,
-	0x0005, 0x220c, 0x9102, 0x0218, 0x2001, 0x0001, 0x0010, 0x2001,
-	0x0000, 0x918d, 0x0001, 0x001e, 0x01ce, 0x013e, 0x0005, 0x6004,
-	0x908a, 0x0053, 0x1a0c, 0x0db4, 0x080c, 0xbd0c, 0x0120, 0x080c,
-	0xbd1d, 0x0168, 0x0028, 0x080c, 0x3003, 0x080c, 0xbd1d, 0x0138,
-	0x080c, 0x886e, 0x080c, 0x9e32, 0x080c, 0x8973, 0x0005, 0x080c,
-	0xa7c0, 0x0cb0, 0x9182, 0x0054, 0x1220, 0x9182, 0x0040, 0x0208,
-	0x000a, 0x0005, 0xae6e, 0xae6e, 0xae6e, 0xae6e, 0xae6e, 0xae6e,
-	0xae6e, 0xae6e, 0xae6e, 0xae6e, 0xae6e, 0xae70, 0xae70, 0xae70,
-	0xae70, 0xae6e, 0xae6e, 0xae6e, 0xae70, 0xae6e, 0x080c, 0x0db4,
-	0x600b, 0xffff, 0x6003, 0x0001, 0x6106, 0x080c, 0x83f1, 0x0126,
-	0x2091, 0x8000, 0x080c, 0x8973, 0x012e, 0x0005, 0x9186, 0x0013,
-	0x1128, 0x6004, 0x9082, 0x0040, 0x0804, 0xaf25, 0x9186, 0x0027,
-	0x1520, 0x080c, 0x886e, 0x080c, 0x2fda, 0x080c, 0xc227, 0x0096,
-	0x6114, 0x2148, 0x080c, 0xbb17, 0x0198, 0x080c, 0xbd1d, 0x1118,
-	0x080c, 0xa7c0, 0x0068, 0xa867, 0x0103, 0xa87b, 0x0029, 0xa877,
-	0x0000, 0xa97c, 0xc1c5, 0xa97e, 0x080c, 0x688c, 0x080c, 0xbd00,
-	0x009e, 0x080c, 0x9e32, 0x0804, 0x8973, 0x9186, 0x0014, 0x1120,
-	0x6004, 0x9082, 0x0040, 0x04a0, 0x9186, 0x0046, 0x0150, 0x9186,
-	0x0045, 0x0138, 0x9186, 0x0053, 0x0120, 0x9186, 0x0048, 0x190c,
-	0x0db4, 0x2001, 0x0109, 0x2004, 0xd084, 0x0508, 0x0126, 0x2091,
-	0x2800, 0x0006, 0x0016, 0x0026, 0x0036, 0x00f6, 0x00e6, 0x00c6,
-	0x2079, 0x19b8, 0x2071, 0x1800, 0x2061, 0x0100, 0x080c, 0x82dd,
-	0x00ce, 0x00ee, 0x00fe, 0x003e, 0x002e, 0x001e, 0x000e, 0x012e,
-	0xa001, 0x6000, 0x9086, 0x0002, 0x1110, 0x0804, 0xaf63, 0x0005,
-	0x0002, 0xaeff, 0xaefd, 0xaefd, 0xaefd, 0xaefd, 0xaefd, 0xaefd,
-	0xaefd, 0xaefd, 0xaefd, 0xaefd, 0xaf1a, 0xaf1a, 0xaf1a, 0xaf1a,
-	0xaefd, 0xaf1a, 0xaefd, 0xaf1a, 0xaefd, 0x080c, 0x0db4, 0x080c,
-	0x886e, 0x0096, 0x6114, 0x2148, 0x080c, 0xbb17, 0x0168, 0xa867,
-	0x0103, 0xa87b, 0x0006, 0xa877, 0x0000, 0xa880, 0xc0ec, 0xa882,
-	0x080c, 0x688c, 0x080c, 0xbd00, 0x009e, 0x080c, 0x9e32, 0x080c,
-	0x8973, 0x0005, 0x080c, 0x886e, 0x080c, 0xbd1d, 0x090c, 0xa7c0,
-	0x080c, 0x9e32, 0x080c, 0x8973, 0x0005, 0x0002, 0xaf3c, 0xaf3a,
-	0xaf3a, 0xaf3a, 0xaf3a, 0xaf3a, 0xaf3a, 0xaf3a, 0xaf3a, 0xaf3a,
-	0xaf3a, 0xaf53, 0xaf53, 0xaf53, 0xaf53, 0xaf3a, 0xaf5d, 0xaf3a,
-	0xaf53, 0xaf3a, 0x080c, 0x0db4, 0x0096, 0x080c, 0x886e, 0x6014,
-	0x2048, 0x2001, 0x1959, 0x2004, 0x6042, 0xa97c, 0xd1ac, 0x0140,
-	0x6003, 0x0004, 0xa87c, 0x9085, 0x0400, 0xa87e, 0x009e, 0x0005,
-	0x6003, 0x0002, 0x0cb8, 0x080c, 0x886e, 0x080c, 0xc22a, 0x080c,
-	0xc22f, 0x6003, 0x000f, 0x0804, 0x8973, 0x080c, 0x886e, 0x080c,
-	0x9e32, 0x0804, 0x8973, 0x9182, 0x0054, 0x1220, 0x9182, 0x0040,
-	0x0208, 0x000a, 0x0005, 0xaf7f, 0xaf7f, 0xaf7f, 0xaf7f, 0xaf7f,
-	0xaf81, 0xb05e, 0xaf7f, 0xb092, 0xaf7f, 0xaf7f, 0xaf7f, 0xaf7f,
-	0xaf7f, 0xaf7f, 0xaf7f, 0xaf7f, 0xaf7f, 0xaf7f, 0xb092, 0x080c,
-	0x0db4, 0x00b6, 0x0096, 0x6114, 0x2148, 0x7644, 0x96b4, 0x0fff,
-	0x86ff, 0x1528, 0x6010, 0x2058, 0xb800, 0xd0bc, 0x1904, 0xb04d,
-	0xa87b, 0x0000, 0xa867, 0x0103, 0xae76, 0xa87c, 0xd0ac, 0x0128,
-	0xa834, 0xa938, 0x9115, 0x190c, 0xb227, 0x080c, 0x66a7, 0x6210,
-	0x2258, 0xba3c, 0x82ff, 0x0110, 0x8211, 0xba3e, 0x7044, 0xd0e4,
-	0x1904, 0xb031, 0x080c, 0x9e32, 0x009e, 0x00be, 0x0005, 0x968c,
-	0x0c00, 0x0150, 0x6010, 0x2058, 0xb800, 0xd0bc, 0x1904, 0xb035,
-	0x7348, 0xab92, 0x734c, 0xab8e, 0x968c, 0x00ff, 0x9186, 0x0002,
-	0x0508, 0x9186, 0x0028, 0x1118, 0xa87b, 0x001c, 0x00e8, 0xd6dc,
-	0x01a0, 0xa87b, 0x0015, 0xa87c, 0xd0ac, 0x0170, 0xa938, 0xaa34,
-	0x2100, 0x9205, 0x0148, 0x7048, 0x9106, 0x1118, 0x704c, 0x9206,
-	0x0118, 0xa992, 0xaa8e, 0xc6dc, 0x0038, 0xd6d4, 0x0118, 0xa87b,
-	0x0007, 0x0010, 0xa87b, 0x0000, 0xa867, 0x0103, 0xae76, 0x901e,
-	0xd6c4, 0x01d8, 0x9686, 0x0100, 0x1130, 0x7064, 0x9005, 0x1118,
-	0xc6c4, 0x0804, 0xaf88, 0x735c, 0xab86, 0x83ff, 0x0170, 0x938a,
-	0x0009, 0x0210, 0x2019, 0x0008, 0x0036, 0x2308, 0x2019, 0x0018,
-	0x2011, 0x0025, 0x080c, 0xb712, 0x003e, 0xd6cc, 0x0904, 0xaf9d,
-	0x7154, 0xa98a, 0x81ff, 0x0904, 0xaf9d, 0x9192, 0x0021, 0x1278,
-	0x8304, 0x9098, 0x0018, 0x2011, 0x0029, 0x080c, 0xb712, 0x2011,
-	0x0205, 0x2013, 0x0000, 0x080c, 0xc1b7, 0x0804, 0xaf9d, 0xa868,
-	0xd0fc, 0x0120, 0x2009, 0x0020, 0xa98a, 0x0c50, 0x00a6, 0x2950,
-	0x080c, 0xb6b1, 0x00ae, 0x080c, 0xc1b7, 0x080c, 0xb702, 0x0804,
-	0xaf9f, 0x080c, 0xbe10, 0x0804, 0xafac, 0xa87c, 0xd0ac, 0x0904,
-	0xafb8, 0xa880, 0xd0bc, 0x1904, 0xafb8, 0x7348, 0xa838, 0x9306,
-	0x11c8, 0x734c, 0xa834, 0x931e, 0x0904, 0xafb8, 0xd6d4, 0x0190,
-	0xab38, 0x9305, 0x0904, 0xafb8, 0x0068, 0xa87c, 0xd0ac, 0x0904,
-	0xaf90, 0xa838, 0xa934, 0x9105, 0x0904, 0xaf90, 0xa880, 0xd0bc,
-	0x1904, 0xaf90, 0x080c, 0xbe4a, 0x0804, 0xafac, 0x0096, 0x00f6,
-	0x6003, 0x0003, 0x6007, 0x0043, 0x2079, 0x026c, 0x7c04, 0x7b00,
-	0x7e0c, 0x7d08, 0x6014, 0x2048, 0xa87c, 0xd0ac, 0x0140, 0x6003,
-	0x0002, 0x00fe, 0x009e, 0x0005, 0x2130, 0x2228, 0x0058, 0x2400,
-	0xa9ac, 0x910a, 0x2300, 0xaab0, 0x9213, 0x2600, 0x9102, 0x2500,
-	0x9203, 0x0e90, 0xac36, 0xab3a, 0xae46, 0xad4a, 0x00fe, 0x6043,
-	0x0000, 0x2c10, 0x080c, 0x1a5c, 0x080c, 0x8456, 0x080c, 0x8a4e,
-	0x009e, 0x0005, 0x0005, 0x9182, 0x0054, 0x1220, 0x9182, 0x0040,
-	0x0208, 0x000a, 0x0005, 0xb0af, 0xb0af, 0xb0af, 0xb0af, 0xb0af,
-	0xb0b1, 0xb147, 0xb0af, 0xb0af, 0xb15e, 0xb1ea, 0xb0af, 0xb0af,
-	0xb0af, 0xb0af, 0xb1ff, 0xb0af, 0xb0af, 0xb0af, 0xb0af, 0x080c,
-	0x0db4, 0x0076, 0x00a6, 0x00e6, 0x0096, 0x2071, 0x0260, 0x6114,
-	0x2150, 0x7644, 0xb676, 0x96b4, 0x0fff, 0xb77c, 0xc7e5, 0xb77e,
-	0x6210, 0x00b6, 0x2258, 0xba3c, 0x82ff, 0x0110, 0x8211, 0xba3e,
-	0x00be, 0x86ff, 0x0904, 0xb142, 0x9694, 0xff00, 0x9284, 0x0c00,
-	0x0120, 0x7048, 0xb092, 0x704c, 0xb08e, 0x9284, 0x0300, 0x0904,
-	0xb142, 0x080c, 0x0feb, 0x090c, 0x0db4, 0x2900, 0xb07a, 0xb77c,
-	0xc7cd, 0xb77e, 0xa867, 0x0103, 0xb068, 0xa86a, 0xb06c, 0xa86e,
-	0xb070, 0xa872, 0xae76, 0x968c, 0x0c00, 0x0120, 0x7348, 0xab92,
-	0x734c, 0xab8e, 0x968c, 0x00ff, 0x9186, 0x0002, 0x0180, 0x9186,
-	0x0028, 0x1118, 0xa87b, 0x001c, 0x0060, 0xd6dc, 0x0118, 0xa87b,
-	0x0015, 0x0038, 0xd6d4, 0x0118, 0xa87b, 0x0007, 0x0010, 0xa87b,
-	0x0000, 0xaf7e, 0xb080, 0xa882, 0xb084, 0xa886, 0x901e, 0xd6c4,
-	0x0190, 0x735c, 0xab86, 0x83ff, 0x0170, 0x938a, 0x0009, 0x0210,
-	0x2019, 0x0008, 0x0036, 0x2308, 0x2019, 0x0018, 0x2011, 0x0025,
-	0x080c, 0xb712, 0x003e, 0xd6cc, 0x01e8, 0x7154, 0xa98a, 0x81ff,
-	0x01c8, 0x9192, 0x0021, 0x1260, 0x8304, 0x9098, 0x0018, 0x2011,
-	0x0029, 0x080c, 0xb712, 0x2011, 0x0205, 0x2013, 0x0000, 0x0050,
-	0xb068, 0xd0fc, 0x0120, 0x2009, 0x0020, 0xa98a, 0x0c68, 0x2950,
-	0x080c, 0xb6b1, 0x009e, 0x00ee, 0x00ae, 0x007e, 0x0005, 0x00f6,
-	0x00a6, 0x6003, 0x0003, 0x2079, 0x026c, 0x7c04, 0x7b00, 0x7e0c,
-	0x7d08, 0x6014, 0x2050, 0xb436, 0xb33a, 0xb646, 0xb54a, 0x00ae,
-	0x00fe, 0x2c10, 0x080c, 0x1a5c, 0x0804, 0x9379, 0x6003, 0x0002,
-	0x6004, 0x9086, 0x0040, 0x11c8, 0x0096, 0x6014, 0x2048, 0xa87c,
-	0xd0ac, 0x0160, 0x601c, 0xd084, 0x1130, 0x00f6, 0x2c00, 0x2078,
-	0x080c, 0x1648, 0x00fe, 0x6003, 0x0004, 0x0010, 0x6003, 0x0002,
-	0x009e, 0x080c, 0x886e, 0x080c, 0x8973, 0x0096, 0x2001, 0x1959,
-	0x2004, 0x6042, 0x080c, 0x8923, 0x080c, 0x8a4e, 0x6114, 0x2148,
-	0xa97c, 0xd1e4, 0x0904, 0xb1e5, 0xd1cc, 0x05a8, 0xa978, 0xa868,
-	0xd0fc, 0x0538, 0x0016, 0xa87c, 0x0006, 0xa880, 0x0006, 0xa860,
-	0x20e8, 0xa85c, 0x9080, 0x0019, 0x20a0, 0x810e, 0x810e, 0x810f,
-	0x9184, 0x003f, 0x20e0, 0x9184, 0xffc0, 0x9080, 0x0019, 0x2098,
-	0x0156, 0x20a9, 0x0020, 0x4003, 0x015e, 0x000e, 0xa882, 0x000e,
-	0xa87e, 0x001e, 0xa874, 0x0006, 0x2148, 0x080c, 0x0f9d, 0x001e,
-	0x0440, 0x0016, 0x080c, 0x0f9d, 0x009e, 0xa974, 0x0016, 0x080c,
-	0xb702, 0x001e, 0x00f0, 0xa867, 0x0103, 0xa974, 0x9184, 0x00ff,
-	0x90b6, 0x0002, 0x0180, 0x9086, 0x0028, 0x1118, 0xa87b, 0x001c,
-	0x0060, 0xd1dc, 0x0118, 0xa87b, 0x0015, 0x0038, 0xd1d4, 0x0118,
-	0xa87b, 0x0007, 0x0010, 0xa87b, 0x0000, 0x0016, 0x080c, 0x66a7,
-	0x001e, 0xd1e4, 0x1120, 0x080c, 0x9e32, 0x009e, 0x0005, 0x080c,
-	0xbe10, 0x0cd8, 0x6004, 0x9086, 0x0040, 0x1120, 0x080c, 0x886e,
-	0x080c, 0x8973, 0x2019, 0x0001, 0x080c, 0x96d8, 0x6003, 0x0002,
-	0x080c, 0xc22f, 0x080c, 0x8923, 0x080c, 0x8a4e, 0x0005, 0x6004,
-	0x9086, 0x0040, 0x1120, 0x080c, 0x886e, 0x080c, 0x8973, 0x2019,
-	0x0001, 0x080c, 0x96d8, 0x080c, 0x8923, 0x080c, 0x2fda, 0x080c,
-	0xc227, 0x0096, 0x6114, 0x2148, 0x080c, 0xbb17, 0x0150, 0xa867,
-	0x0103, 0xa87b, 0x0029, 0xa877, 0x0000, 0x080c, 0x688c, 0x080c,
-	0xbd00, 0x009e, 0x080c, 0x9e32, 0x080c, 0x8a4e, 0x0005, 0xa87b,
-	0x0015, 0xd1fc, 0x0180, 0xa87b, 0x0007, 0x8002, 0x8000, 0x810a,
-	0x9189, 0x0000, 0x0006, 0x0016, 0x2009, 0x1a4a, 0x2104, 0x8000,
-	0x200a, 0x001e, 0x000e, 0xa992, 0xa88e, 0x0005, 0x9182, 0x0054,
-	0x1220, 0x9182, 0x0040, 0x0208, 0x000a, 0x0005, 0xb25a, 0xb25a,
-	0xb25a, 0xb25a, 0xb25a, 0xb25c, 0xb25a, 0xb25a, 0xb302, 0xb25a,
-	0xb25a, 0xb25a, 0xb25a, 0xb25a, 0xb25a, 0xb25a, 0xb25a, 0xb25a,
-	0xb25a, 0xb433, 0x080c, 0x0db4, 0x0076, 0x00a6, 0x00e6, 0x0096,
+	0xc10b, 0x0040, 0x6014, 0x2048, 0xa807, 0x0000, 0xa867, 0x0103,
+	0xa833, 0xdead, 0x6010, 0x2058, 0xb9a0, 0x0016, 0x080c, 0x3005,
+	0x080c, 0x9e42, 0x001e, 0x080c, 0x30d7, 0x00de, 0x0804, 0xab2a,
+	0x00de, 0x080c, 0x53a3, 0x1170, 0x6014, 0x9005, 0x1158, 0x0036,
+	0x0046, 0x6010, 0x2058, 0xbba0, 0x2021, 0x0006, 0x080c, 0x4a86,
+	0x004e, 0x003e, 0x00d6, 0x6010, 0x2058, 0x080c, 0x62e2, 0x080c,
+	0xa8e8, 0x00de, 0x080c, 0xad6c, 0x1588, 0x6010, 0x2058, 0xb890,
+	0x9005, 0x0560, 0x2001, 0x0006, 0x080c, 0x6198, 0x0096, 0x6014,
+	0x904d, 0x01d0, 0xa864, 0x9084, 0x00ff, 0x9086, 0x0039, 0x1140,
+	0x2001, 0x0000, 0x900e, 0x2011, 0x4000, 0x080c, 0xc10b, 0x0060,
+	0xa864, 0x9084, 0x00ff, 0x9086, 0x0029, 0x0130, 0xa807, 0x0000,
+	0xa867, 0x0103, 0xa833, 0x0200, 0x009e, 0x080c, 0x3005, 0x6020,
+	0x9086, 0x000a, 0x0138, 0x080c, 0x9e42, 0x0020, 0x080c, 0xa7d1,
+	0x080c, 0xaa74, 0x001e, 0x002e, 0x00ee, 0x00be, 0x0005, 0x2011,
+	0x1823, 0x2204, 0x9086, 0x0014, 0x1160, 0x2001, 0x0002, 0x080c,
+	0x6198, 0x6003, 0x0001, 0x6007, 0x0001, 0x080c, 0x8422, 0x0804,
+	0x896d, 0x0804, 0xaa74, 0x2030, 0x2011, 0x1823, 0x2204, 0x9086,
+	0x0004, 0x1148, 0x96b6, 0x000b, 0x1120, 0x2001, 0x0007, 0x080c,
+	0x6198, 0x0804, 0x9e42, 0x0804, 0xaa74, 0x0002, 0xa8b2, 0xab6d,
+	0xa8b2, 0xabac, 0xa8b2, 0xac57, 0xab62, 0xa8b2, 0xa8b2, 0xac6a,
+	0xa8b2, 0xac7a, 0x6604, 0x9686, 0x0003, 0x0904, 0xaa89, 0x96b6,
+	0x001e, 0x1110, 0x080c, 0x9e42, 0x0005, 0x00b6, 0x00d6, 0x00c6,
+	0x080c, 0xac8a, 0x11a0, 0x9006, 0x080c, 0x6184, 0x080c, 0x2fdc,
+	0x080c, 0xc241, 0x2001, 0x0002, 0x080c, 0x6198, 0x6003, 0x0001,
+	0x6007, 0x0002, 0x080c, 0x8422, 0x080c, 0x896d, 0x0408, 0x2009,
+	0x026e, 0x2104, 0x9086, 0x0009, 0x1160, 0x6010, 0x2058, 0xb840,
+	0x9084, 0x00ff, 0x9005, 0x0170, 0x8001, 0xb842, 0x601b, 0x000a,
+	0x0078, 0x2009, 0x026f, 0x2104, 0x9084, 0xff00, 0x9086, 0x1900,
+	0x1108, 0x08a0, 0x080c, 0x2fdc, 0x080c, 0xc241, 0x080c, 0xaa74,
+	0x00ce, 0x00de, 0x00be, 0x0005, 0x0096, 0x00b6, 0x0026, 0x9016,
+	0x080c, 0xac98, 0x00d6, 0x2069, 0x194c, 0x2d04, 0x9005, 0x0168,
+	0x6010, 0x2058, 0xb8a0, 0x9086, 0x007e, 0x1138, 0x2069, 0x181f,
+	0x2d04, 0x8000, 0x206a, 0x00de, 0x0010, 0x00de, 0x0088, 0x9006,
+	0x080c, 0x6184, 0x2001, 0x0002, 0x080c, 0x6198, 0x6003, 0x0001,
+	0x6007, 0x0002, 0x080c, 0x8422, 0x080c, 0x896d, 0x0804, 0xac27,
+	0x080c, 0xbb2c, 0x01b0, 0x6014, 0x2048, 0xa864, 0x2010, 0x9086,
+	0x0139, 0x1138, 0x6007, 0x0016, 0x2001, 0x0002, 0x080c, 0xc165,
+	0x00b0, 0x6014, 0x2048, 0xa864, 0xd0fc, 0x0118, 0x2001, 0x0001,
+	0x0ca8, 0x2001, 0x180e, 0x2004, 0xd0dc, 0x0148, 0x6010, 0x2058,
+	0xb840, 0x9084, 0x00ff, 0x9005, 0x1110, 0x9006, 0x0c38, 0x080c,
+	0xa7d1, 0x2009, 0x026e, 0x2134, 0x96b4, 0x00ff, 0x9686, 0x0005,
+	0x0510, 0x9686, 0x000b, 0x01c8, 0x2009, 0x026f, 0x2104, 0x9084,
+	0xff00, 0x1118, 0x9686, 0x0009, 0x01b0, 0x9086, 0x1900, 0x1168,
+	0x9686, 0x0009, 0x0180, 0x2001, 0x0004, 0x080c, 0x6198, 0x2001,
+	0x0028, 0x601a, 0x6007, 0x0052, 0x0010, 0x080c, 0xaa74, 0x002e,
+	0x00be, 0x009e, 0x0005, 0x9286, 0x0139, 0x0160, 0x6014, 0x2048,
+	0x080c, 0xbb2c, 0x0140, 0xa864, 0x9086, 0x0139, 0x0118, 0xa868,
+	0xd0fc, 0x0108, 0x0c50, 0x6010, 0x2058, 0xb840, 0x9084, 0x00ff,
+	0x9005, 0x0138, 0x8001, 0xb842, 0x601b, 0x000a, 0x6007, 0x0016,
+	0x08f0, 0xb8a0, 0x9086, 0x007e, 0x1138, 0x00e6, 0x2071, 0x1800,
+	0x080c, 0x5c6d, 0x00ee, 0x0010, 0x080c, 0x2fdc, 0x0870, 0x080c,
+	0xac98, 0x1160, 0x2001, 0x0004, 0x080c, 0x6198, 0x6003, 0x0001,
+	0x6007, 0x0003, 0x080c, 0x8422, 0x0804, 0x896d, 0x080c, 0xa7d1,
+	0x0804, 0xaa74, 0x0469, 0x1160, 0x2001, 0x0008, 0x080c, 0x6198,
+	0x6003, 0x0001, 0x6007, 0x0005, 0x080c, 0x8422, 0x0804, 0x896d,
+	0x0804, 0xaa74, 0x00e9, 0x1160, 0x2001, 0x000a, 0x080c, 0x6198,
+	0x6003, 0x0001, 0x6007, 0x0001, 0x080c, 0x8422, 0x0804, 0x896d,
+	0x0804, 0xaa74, 0x2009, 0x026e, 0x2104, 0x9086, 0x0003, 0x1138,
+	0x2009, 0x026f, 0x2104, 0x9084, 0xff00, 0x9086, 0x2a00, 0x0005,
+	0x9085, 0x0001, 0x0005, 0x00b6, 0x00c6, 0x0016, 0x6110, 0x2158,
+	0x080c, 0x6256, 0x001e, 0x00ce, 0x00be, 0x0005, 0x00b6, 0x00f6,
+	0x00e6, 0x00d6, 0x0036, 0x0016, 0x6010, 0x2058, 0x2009, 0x1836,
+	0x2104, 0x9085, 0x0003, 0x200a, 0x080c, 0xad3e, 0x0560, 0x2009,
+	0x1836, 0x2104, 0xc0cd, 0x200a, 0x080c, 0x6567, 0x0158, 0x9006,
+	0x2020, 0x2009, 0x002a, 0x080c, 0xd54b, 0x2001, 0x180c, 0x200c,
+	0xc195, 0x2102, 0x2019, 0x002a, 0x2009, 0x0001, 0x080c, 0x2fa7,
+	0x00e6, 0x2071, 0x1800, 0x080c, 0x2dbd, 0x00ee, 0x00c6, 0x0156,
+	0x20a9, 0x0781, 0x2009, 0x007f, 0x080c, 0x30d7, 0x8108, 0x1f04,
+	0xacdc, 0x015e, 0x00ce, 0x080c, 0xac9b, 0x2071, 0x0260, 0x2079,
+	0x0200, 0x7817, 0x0001, 0x2001, 0x1836, 0x200c, 0xc1c5, 0x7018,
+	0xd0fc, 0x0110, 0xd0dc, 0x0118, 0x7038, 0xd0dc, 0x1108, 0xc1c4,
+	0x7817, 0x0000, 0x2001, 0x1836, 0x2102, 0x2079, 0x0100, 0x2e04,
+	0x9084, 0x00ff, 0x2069, 0x181e, 0x206a, 0x78e6, 0x0006, 0x8e70,
+	0x2e04, 0x2069, 0x181f, 0x206a, 0x78ea, 0x7832, 0x7836, 0x2010,
+	0x9084, 0xff00, 0x001e, 0x9105, 0x2009, 0x182b, 0x200a, 0x2200,
+	0x9084, 0x00ff, 0x2008, 0x080c, 0x26ae, 0x080c, 0x6f9b, 0x0170,
+	0x2071, 0x0260, 0x2069, 0x1952, 0x7048, 0x206a, 0x704c, 0x6806,
+	0x7050, 0x680a, 0x7054, 0x680e, 0x080c, 0xbf40, 0x0040, 0x2001,
+	0x0006, 0x080c, 0x6198, 0x080c, 0x3005, 0x080c, 0x9e42, 0x001e,
+	0x003e, 0x00de, 0x00ee, 0x00fe, 0x00be, 0x0005, 0x0096, 0x0026,
+	0x0036, 0x00e6, 0x0156, 0x2019, 0x182b, 0x231c, 0x83ff, 0x01f0,
+	0x2071, 0x0260, 0x7200, 0x9294, 0x00ff, 0x7004, 0x9084, 0xff00,
+	0x9205, 0x9306, 0x1198, 0x2011, 0x0276, 0x20a9, 0x0004, 0x2b48,
+	0x2019, 0x000a, 0x080c, 0xae20, 0x1148, 0x2011, 0x027a, 0x20a9,
+	0x0004, 0x2019, 0x0006, 0x080c, 0xae20, 0x1100, 0x015e, 0x00ee,
+	0x003e, 0x002e, 0x009e, 0x0005, 0x00e6, 0x2071, 0x0260, 0x7034,
+	0x9086, 0x0014, 0x11a8, 0x7038, 0x9086, 0x0800, 0x1188, 0x703c,
+	0xd0ec, 0x0160, 0x9084, 0x0f00, 0x9086, 0x0100, 0x1138, 0x7054,
+	0xd0a4, 0x1110, 0xd0ac, 0x0110, 0x9006, 0x0010, 0x9085, 0x0001,
+	0x00ee, 0x0005, 0x00e6, 0x0096, 0x00c6, 0x0076, 0x0056, 0x0046,
+	0x0026, 0x0006, 0x0126, 0x2091, 0x8000, 0x2029, 0x19c0, 0x252c,
+	0x2021, 0x19c6, 0x2424, 0x2061, 0x1cd0, 0x2071, 0x1800, 0x7250,
+	0x7070, 0x9202, 0x1a04, 0xadf8, 0x080c, 0xd57c, 0x0904, 0xadf1,
+	0x6720, 0x9786, 0x0007, 0x0904, 0xadf1, 0x2500, 0x9c06, 0x0904,
+	0xadf1, 0x2400, 0x9c06, 0x05e8, 0x3e08, 0x9186, 0x0002, 0x1148,
+	0x6010, 0x9005, 0x0130, 0x00b6, 0x2058, 0xb800, 0x00be, 0xd0bc,
+	0x1580, 0x00c6, 0x6000, 0x9086, 0x0004, 0x1110, 0x080c, 0x190f,
+	0x9786, 0x000a, 0x0148, 0x080c, 0xbd32, 0x1130, 0x00ce, 0x080c,
+	0xa7d1, 0x080c, 0x9e72, 0x00e8, 0x6014, 0x2048, 0x080c, 0xbb2c,
+	0x01a8, 0x9786, 0x0003, 0x1530, 0xa867, 0x0103, 0xa87c, 0xd0cc,
+	0x0130, 0x0096, 0xa878, 0x2048, 0x080c, 0x0f9d, 0x009e, 0xab7a,
+	0xa877, 0x0000, 0x080c, 0x6884, 0x080c, 0xbd15, 0x080c, 0x9e72,
+	0x00ce, 0x9ce0, 0x0018, 0x7064, 0x9c02, 0x1210, 0x0804, 0xad9f,
+	0x012e, 0x000e, 0x002e, 0x004e, 0x005e, 0x007e, 0x00ce, 0x009e,
+	0x00ee, 0x0005, 0x9786, 0x0006, 0x1118, 0x080c, 0xd4f6, 0x0c30,
+	0x9786, 0x000a, 0x0998, 0x0880, 0x220c, 0x2304, 0x9106, 0x1130,
+	0x8210, 0x8318, 0x1f04, 0xae0c, 0x9006, 0x0005, 0x2304, 0x9102,
+	0x0218, 0x2001, 0x0001, 0x0008, 0x9006, 0x918d, 0x0001, 0x0005,
+	0x0136, 0x01c6, 0x0016, 0x8906, 0x8006, 0x8007, 0x908c, 0x003f,
+	0x21e0, 0x9084, 0xffc0, 0x9300, 0x2098, 0x3518, 0x20a9, 0x0001,
+	0x220c, 0x4002, 0x910e, 0x1140, 0x8210, 0x8319, 0x1dc8, 0x9006,
+	0x001e, 0x01ce, 0x013e, 0x0005, 0x220c, 0x9102, 0x0218, 0x2001,
+	0x0001, 0x0010, 0x2001, 0x0000, 0x918d, 0x0001, 0x001e, 0x01ce,
+	0x013e, 0x0005, 0x6004, 0x908a, 0x0053, 0x1a0c, 0x0db4, 0x080c,
+	0xbd21, 0x0120, 0x080c, 0xbd32, 0x0168, 0x0028, 0x080c, 0x3005,
+	0x080c, 0xbd32, 0x0138, 0x080c, 0x8861, 0x080c, 0x9e42, 0x080c,
+	0x896d, 0x0005, 0x080c, 0xa7d1, 0x0cb0, 0x9182, 0x0054, 0x1220,
+	0x9182, 0x0040, 0x0208, 0x000a, 0x0005, 0xae81, 0xae81, 0xae81,
+	0xae81, 0xae81, 0xae81, 0xae81, 0xae81, 0xae81, 0xae81, 0xae81,
+	0xae83, 0xae83, 0xae83, 0xae83, 0xae81, 0xae81, 0xae81, 0xae83,
+	0xae81, 0x080c, 0x0db4, 0x600b, 0xffff, 0x6003, 0x0001, 0x6106,
+	0x080c, 0x83da, 0x0126, 0x2091, 0x8000, 0x080c, 0x896d, 0x012e,
+	0x0005, 0x9186, 0x0013, 0x1128, 0x6004, 0x9082, 0x0040, 0x0804,
+	0xaf38, 0x9186, 0x0027, 0x1520, 0x080c, 0x8861, 0x080c, 0x2fdc,
+	0x080c, 0xc241, 0x0096, 0x6114, 0x2148, 0x080c, 0xbb2c, 0x0198,
+	0x080c, 0xbd32, 0x1118, 0x080c, 0xa7d1, 0x0068, 0xa867, 0x0103,
+	0xa87b, 0x0029, 0xa877, 0x0000, 0xa97c, 0xc1c5, 0xa97e, 0x080c,
+	0x6891, 0x080c, 0xbd15, 0x009e, 0x080c, 0x9e42, 0x0804, 0x896d,
+	0x9186, 0x0014, 0x1120, 0x6004, 0x9082, 0x0040, 0x04a0, 0x9186,
+	0x0046, 0x0150, 0x9186, 0x0045, 0x0138, 0x9186, 0x0053, 0x0120,
+	0x9186, 0x0048, 0x190c, 0x0db4, 0x2001, 0x0109, 0x2004, 0xd084,
+	0x0508, 0x0126, 0x2091, 0x2800, 0x0006, 0x0016, 0x0026, 0x0036,
+	0x00f6, 0x00e6, 0x00c6, 0x2079, 0x19b7, 0x2071, 0x1800, 0x2061,
+	0x0100, 0x080c, 0x82c6, 0x00ce, 0x00ee, 0x00fe, 0x003e, 0x002e,
+	0x001e, 0x000e, 0x012e, 0xa001, 0x6000, 0x9086, 0x0002, 0x1110,
+	0x0804, 0xaf76, 0x0005, 0x0002, 0xaf12, 0xaf10, 0xaf10, 0xaf10,
+	0xaf10, 0xaf10, 0xaf10, 0xaf10, 0xaf10, 0xaf10, 0xaf10, 0xaf2d,
+	0xaf2d, 0xaf2d, 0xaf2d, 0xaf10, 0xaf2d, 0xaf10, 0xaf2d, 0xaf10,
+	0x080c, 0x0db4, 0x080c, 0x8861, 0x0096, 0x6114, 0x2148, 0x080c,
+	0xbb2c, 0x0168, 0xa867, 0x0103, 0xa87b, 0x0006, 0xa877, 0x0000,
+	0xa880, 0xc0ec, 0xa882, 0x080c, 0x6891, 0x080c, 0xbd15, 0x009e,
+	0x080c, 0x9e42, 0x080c, 0x896d, 0x0005, 0x080c, 0x8861, 0x080c,
+	0xbd32, 0x090c, 0xa7d1, 0x080c, 0x9e42, 0x080c, 0x896d, 0x0005,
+	0x0002, 0xaf4f, 0xaf4d, 0xaf4d, 0xaf4d, 0xaf4d, 0xaf4d, 0xaf4d,
+	0xaf4d, 0xaf4d, 0xaf4d, 0xaf4d, 0xaf66, 0xaf66, 0xaf66, 0xaf66,
+	0xaf4d, 0xaf70, 0xaf4d, 0xaf66, 0xaf4d, 0x080c, 0x0db4, 0x0096,
+	0x080c, 0x8861, 0x6014, 0x2048, 0x2001, 0x1958, 0x2004, 0x6042,
+	0xa97c, 0xd1ac, 0x0140, 0x6003, 0x0004, 0xa87c, 0x9085, 0x0400,
+	0xa87e, 0x009e, 0x0005, 0x6003, 0x0002, 0x0cb8, 0x080c, 0x8861,
+	0x080c, 0xc244, 0x080c, 0xc249, 0x6003, 0x000f, 0x0804, 0x896d,
+	0x080c, 0x8861, 0x080c, 0x9e42, 0x0804, 0x896d, 0x9182, 0x0054,
+	0x1220, 0x9182, 0x0040, 0x0208, 0x000a, 0x0005, 0xaf92, 0xaf92,
+	0xaf92, 0xaf92, 0xaf92, 0xaf94, 0xb071, 0xaf92, 0xb0a5, 0xaf92,
+	0xaf92, 0xaf92, 0xaf92, 0xaf92, 0xaf92, 0xaf92, 0xaf92, 0xaf92,
+	0xaf92, 0xb0a5, 0x080c, 0x0db4, 0x00b6, 0x0096, 0x6114, 0x2148,
+	0x7644, 0x96b4, 0x0fff, 0x86ff, 0x1528, 0x6010, 0x2058, 0xb800,
+	0xd0bc, 0x1904, 0xb060, 0xa87b, 0x0000, 0xa867, 0x0103, 0xae76,
+	0xa87c, 0xd0ac, 0x0128, 0xa834, 0xa938, 0x9115, 0x190c, 0xb23a,
+	0x080c, 0x66ac, 0x6210, 0x2258, 0xba3c, 0x82ff, 0x0110, 0x8211,
+	0xba3e, 0x7044, 0xd0e4, 0x1904, 0xb044, 0x080c, 0x9e42, 0x009e,
+	0x00be, 0x0005, 0x968c, 0x0c00, 0x0150, 0x6010, 0x2058, 0xb800,
+	0xd0bc, 0x1904, 0xb048, 0x7348, 0xab92, 0x734c, 0xab8e, 0x968c,
+	0x00ff, 0x9186, 0x0002, 0x0508, 0x9186, 0x0028, 0x1118, 0xa87b,
+	0x001c, 0x00e8, 0xd6dc, 0x01a0, 0xa87b, 0x0015, 0xa87c, 0xd0ac,
+	0x0170, 0xa938, 0xaa34, 0x2100, 0x9205, 0x0148, 0x7048, 0x9106,
+	0x1118, 0x704c, 0x9206, 0x0118, 0xa992, 0xaa8e, 0xc6dc, 0x0038,
+	0xd6d4, 0x0118, 0xa87b, 0x0007, 0x0010, 0xa87b, 0x0000, 0xa867,
+	0x0103, 0xae76, 0x901e, 0xd6c4, 0x01d8, 0x9686, 0x0100, 0x1130,
+	0x7064, 0x9005, 0x1118, 0xc6c4, 0x0804, 0xaf9b, 0x735c, 0xab86,
+	0x83ff, 0x0170, 0x938a, 0x0009, 0x0210, 0x2019, 0x0008, 0x0036,
+	0x2308, 0x2019, 0x0018, 0x2011, 0x0025, 0x080c, 0xb725, 0x003e,
+	0xd6cc, 0x0904, 0xafb0, 0x7154, 0xa98a, 0x81ff, 0x0904, 0xafb0,
+	0x9192, 0x0021, 0x1278, 0x8304, 0x9098, 0x0018, 0x2011, 0x0029,
+	0x080c, 0xb725, 0x2011, 0x0205, 0x2013, 0x0000, 0x080c, 0xc1d1,
+	0x0804, 0xafb0, 0xa868, 0xd0fc, 0x0120, 0x2009, 0x0020, 0xa98a,
+	0x0c50, 0x00a6, 0x2950, 0x080c, 0xb6c4, 0x00ae, 0x080c, 0xc1d1,
+	0x080c, 0xb715, 0x0804, 0xafb2, 0x080c, 0xbe2a, 0x0804, 0xafbf,
+	0xa87c, 0xd0ac, 0x0904, 0xafcb, 0xa880, 0xd0bc, 0x1904, 0xafcb,
+	0x7348, 0xa838, 0x9306, 0x11c8, 0x734c, 0xa834, 0x931e, 0x0904,
+	0xafcb, 0xd6d4, 0x0190, 0xab38, 0x9305, 0x0904, 0xafcb, 0x0068,
+	0xa87c, 0xd0ac, 0x0904, 0xafa3, 0xa838, 0xa934, 0x9105, 0x0904,
+	0xafa3, 0xa880, 0xd0bc, 0x1904, 0xafa3, 0x080c, 0xbe64, 0x0804,
+	0xafbf, 0x0096, 0x00f6, 0x6003, 0x0003, 0x6007, 0x0043, 0x2079,
+	0x026c, 0x7c04, 0x7b00, 0x7e0c, 0x7d08, 0x6014, 0x2048, 0xa87c,
+	0xd0ac, 0x0140, 0x6003, 0x0002, 0x00fe, 0x009e, 0x0005, 0x2130,
+	0x2228, 0x0058, 0x2400, 0xa9ac, 0x910a, 0x2300, 0xaab0, 0x9213,
+	0x2600, 0x9102, 0x2500, 0x9203, 0x0e90, 0xac36, 0xab3a, 0xae46,
+	0xad4a, 0x00fe, 0x6043, 0x0000, 0x2c10, 0x080c, 0x1a5e, 0x080c,
+	0x843f, 0x080c, 0x8a4a, 0x009e, 0x0005, 0x0005, 0x9182, 0x0054,
+	0x1220, 0x9182, 0x0040, 0x0208, 0x000a, 0x0005, 0xb0c2, 0xb0c2,
+	0xb0c2, 0xb0c2, 0xb0c2, 0xb0c4, 0xb15a, 0xb0c2, 0xb0c2, 0xb171,
+	0xb1fd, 0xb0c2, 0xb0c2, 0xb0c2, 0xb0c2, 0xb212, 0xb0c2, 0xb0c2,
+	0xb0c2, 0xb0c2, 0x080c, 0x0db4, 0x0076, 0x00a6, 0x00e6, 0x0096,
 	0x2071, 0x0260, 0x6114, 0x2150, 0x7644, 0xb676, 0x96b4, 0x0fff,
 	0xb77c, 0xc7e5, 0xb77e, 0x6210, 0x00b6, 0x2258, 0xba3c, 0x82ff,
-	0x0110, 0x8211, 0xba3e, 0x00be, 0x86ff, 0x0904, 0xb2fb, 0x9694,
+	0x0110, 0x8211, 0xba3e, 0x00be, 0x86ff, 0x0904, 0xb155, 0x9694,
 	0xff00, 0x9284, 0x0c00, 0x0120, 0x7048, 0xb092, 0x704c, 0xb08e,
-	0x9284, 0x0300, 0x0904, 0xb2fb, 0x9686, 0x0100, 0x1130, 0x7064,
-	0x9005, 0x1118, 0xc6c4, 0xb676, 0x0c38, 0x080c, 0x0feb, 0x090c,
-	0x0db4, 0x2900, 0xb07a, 0xb77c, 0x97bd, 0x0200, 0xb77e, 0xa867,
-	0x0103, 0xb068, 0xa86a, 0xb06c, 0xa86e, 0xb070, 0xa872, 0x7044,
-	0x9084, 0xf000, 0x9635, 0xae76, 0x968c, 0x0c00, 0x0120, 0x7348,
-	0xab92, 0x734c, 0xab8e, 0x968c, 0x00ff, 0x9186, 0x0002, 0x0180,
-	0x9186, 0x0028, 0x1118, 0xa87b, 0x001c, 0x0060, 0xd6dc, 0x0118,
-	0xa87b, 0x0015, 0x0038, 0xd6d4, 0x0118, 0xa87b, 0x0007, 0x0010,
-	0xa87b, 0x0000, 0xaf7e, 0xb080, 0xa882, 0xb084, 0xa886, 0x901e,
-	0xd6c4, 0x0190, 0x735c, 0xab86, 0x83ff, 0x0170, 0x938a, 0x0009,
-	0x0210, 0x2019, 0x0008, 0x0036, 0x2308, 0x2019, 0x0018, 0x2011,
-	0x0025, 0x080c, 0xb712, 0x003e, 0xd6cc, 0x01e8, 0x7154, 0xa98a,
-	0x81ff, 0x01c8, 0x9192, 0x0021, 0x1260, 0x8304, 0x9098, 0x0018,
-	0x2011, 0x0029, 0x080c, 0xb712, 0x2011, 0x0205, 0x2013, 0x0000,
-	0x0050, 0xb068, 0xd0fc, 0x0120, 0x2009, 0x0020, 0xa98a, 0x0c68,
-	0x2950, 0x080c, 0xb6b1, 0x080c, 0x18eb, 0x009e, 0x00ee, 0x00ae,
-	0x007e, 0x0005, 0x2001, 0x1959, 0x2004, 0x6042, 0x0096, 0x6114,
-	0x2148, 0xa83c, 0xa940, 0x9105, 0x1118, 0xa87c, 0xc0dc, 0xa87e,
-	0x6003, 0x0002, 0xa97c, 0xd1e4, 0x0904, 0xb42e, 0x6043, 0x0000,
-	0x6010, 0x00b6, 0x2058, 0xb800, 0x00be, 0xd0bc, 0x1500, 0xd1cc,
-	0x0904, 0xb3fd, 0xa978, 0xa868, 0xd0fc, 0x0904, 0xb3be, 0x0016,
-	0xa87c, 0x0006, 0xa880, 0x0006, 0x00a6, 0x2150, 0xb174, 0x9184,
-	0x00ff, 0x90b6, 0x0002, 0x0904, 0xb38c, 0x9086, 0x0028, 0x1904,
-	0xb378, 0xa87b, 0x001c, 0xb07b, 0x001c, 0x0804, 0xb394, 0x6024,
-	0xd0f4, 0x11d0, 0xa838, 0xaa34, 0x9205, 0x09c8, 0xa838, 0xaa90,
-	0x9206, 0x1120, 0xa88c, 0xaa34, 0x9206, 0x0988, 0x6024, 0xd0d4,
-	0x1148, 0xa9ac, 0xa834, 0x9102, 0x603a, 0xa9b0, 0xa838, 0x9103,
-	0x603e, 0x6024, 0xc0f5, 0x6026, 0x6010, 0x00b6, 0x2058, 0xb83c,
-	0x8000, 0xb83e, 0x00be, 0x9006, 0xa876, 0xa892, 0xa88e, 0xa87c,
-	0xc0e4, 0xa87e, 0xd0cc, 0x0140, 0xc0cc, 0xa87e, 0x0096, 0xa878,
-	0x2048, 0x080c, 0x0f9d, 0x009e, 0x080c, 0xbe4a, 0x0804, 0xb42e,
-	0xd1dc, 0x0158, 0xa87b, 0x0015, 0xb07b, 0x0015, 0x080c, 0xc0da,
-	0x0118, 0xb174, 0xc1dc, 0xb176, 0x0078, 0xd1d4, 0x0128, 0xa87b,
-	0x0007, 0xb07b, 0x0007, 0x0040, 0xa87c, 0xd0ac, 0x0128, 0xa834,
-	0xa938, 0x9115, 0x190c, 0xb227, 0xa87c, 0xb07e, 0xa890, 0xb092,
-	0xa88c, 0xb08e, 0xa860, 0x20e8, 0xa85c, 0x9080, 0x0019, 0x20a0,
-	0x20a9, 0x0020, 0x8a06, 0x8006, 0x8007, 0x9094, 0x003f, 0x22e0,
-	0x9084, 0xffc0, 0x9080, 0x0019, 0x2098, 0x4003, 0x00ae, 0x000e,
-	0xa882, 0x000e, 0xa87e, 0x080c, 0xc1b7, 0x001e, 0xa874, 0x0006,
-	0x2148, 0x080c, 0x0f9d, 0x001e, 0x0804, 0xb42a, 0x0016, 0x00a6,
-	0x2150, 0xb174, 0x9184, 0x00ff, 0x90b6, 0x0002, 0x01e0, 0x9086,
-	0x0028, 0x1128, 0xa87b, 0x001c, 0xb07b, 0x001c, 0x00e0, 0xd1dc,
-	0x0158, 0xa87b, 0x0015, 0xb07b, 0x0015, 0x080c, 0xc0da, 0x0118,
-	0xb174, 0xc1dc, 0xb176, 0x0078, 0xd1d4, 0x0128, 0xa87b, 0x0007,
-	0xb07b, 0x0007, 0x0040, 0xa87c, 0xd0ac, 0x0128, 0xa834, 0xa938,
-	0x9115, 0x190c, 0xb227, 0xa890, 0xb092, 0xa88c, 0xb08e, 0xa87c,
-	0xb07e, 0x00ae, 0x080c, 0x0f9d, 0x009e, 0x080c, 0xc1b7, 0xa974,
-	0x0016, 0x080c, 0xb702, 0x001e, 0x0468, 0xa867, 0x0103, 0xa974,
-	0x9184, 0x00ff, 0x90b6, 0x0002, 0x01b0, 0x9086, 0x0028, 0x1118,
-	0xa87b, 0x001c, 0x00d0, 0xd1dc, 0x0148, 0xa87b, 0x0015, 0x080c,
-	0xc0da, 0x0118, 0xa974, 0xc1dc, 0xa976, 0x0078, 0xd1d4, 0x0118,
-	0xa87b, 0x0007, 0x0050, 0xa87b, 0x0000, 0xa87c, 0xd0ac, 0x0128,
-	0xa834, 0xa938, 0x9115, 0x190c, 0xb227, 0xa974, 0x0016, 0x080c,
-	0x66a7, 0x001e, 0xd1e4, 0x1120, 0x080c, 0x9e32, 0x009e, 0x0005,
-	0x080c, 0xbe10, 0x0cd8, 0x6114, 0x0096, 0x2148, 0xa97c, 0xd1e4,
-	0x190c, 0x18f9, 0x009e, 0x0005, 0x080c, 0x886e, 0x0010, 0x080c,
-	0x8923, 0x080c, 0xbb17, 0x01f0, 0x0096, 0x6114, 0x2148, 0x080c,
-	0xbd1d, 0x1118, 0x080c, 0xa7c0, 0x00a0, 0xa867, 0x0103, 0x2009,
-	0x180c, 0x210c, 0xd18c, 0x11b8, 0xd184, 0x1190, 0x6108, 0xa97a,
-	0x918e, 0x0029, 0x1110, 0x080c, 0xd7d3, 0xa877, 0x0000, 0x080c,
-	0x688c, 0x009e, 0x080c, 0x9e32, 0x080c, 0x8973, 0x0804, 0x8a4e,
-	0xa87b, 0x0004, 0x0c90, 0xa87b, 0x0004, 0x0c78, 0x9182, 0x0054,
-	0x1220, 0x9182, 0x0040, 0x0208, 0x000a, 0x0005, 0xb48a, 0xb48a,
-	0xb48a, 0xb48a, 0xb48a, 0xb48c, 0xb48a, 0xb48a, 0xb48a, 0xb48a,
-	0xb48a, 0xb48a, 0xb48a, 0xb48a, 0xb48a, 0xb48a, 0xb48a, 0xb48a,
-	0xb48a, 0xb48a, 0x080c, 0x0db4, 0x080c, 0x538e, 0x01f8, 0x6014,
-	0x7144, 0x918c, 0x0fff, 0x9016, 0xd1c4, 0x0118, 0x7264, 0x9294,
-	0x00ff, 0x0096, 0x904d, 0x0188, 0xa87b, 0x0000, 0xa864, 0x9086,
-	0x0139, 0x0128, 0xa867, 0x0103, 0xa976, 0xaa96, 0x0030, 0xa897,
-	0x4000, 0xa99a, 0xaa9e, 0x080c, 0x688c, 0x009e, 0x0804, 0x9e32,
-	0x9182, 0x0085, 0x0002, 0xb4c2, 0xb4c0, 0xb4c0, 0xb4ce, 0xb4c0,
-	0xb4c0, 0xb4c0, 0xb4c0, 0xb4c0, 0xb4c0, 0xb4c0, 0xb4c0, 0xb4c0,
-	0x080c, 0x0db4, 0x6003, 0x0001, 0x6106, 0x080c, 0x83f1, 0x0126,
-	0x2091, 0x8000, 0x080c, 0x8973, 0x012e, 0x0005, 0x0026, 0x0056,
-	0x00d6, 0x00e6, 0x2071, 0x0260, 0x7224, 0x6216, 0x7220, 0x080c,
-	0xbb05, 0x01a0, 0x2268, 0x6800, 0x9086, 0x0000, 0x0178, 0x6010,
-	0x6d10, 0x952e, 0x1158, 0x00c6, 0x2d60, 0x080c, 0xb73d, 0x00ce,
-	0x0128, 0x6803, 0x0002, 0x6007, 0x0086, 0x0010, 0x6007, 0x0087,
-	0x6003, 0x0001, 0x080c, 0x83f1, 0x080c, 0x8973, 0x9280, 0x0004,
-	0x00b6, 0x2058, 0xb800, 0x00be, 0xd0bc, 0x0140, 0x6824, 0xd0ec,
-	0x0128, 0x00c6, 0x2260, 0x080c, 0xbe4a, 0x00ce, 0x00ee, 0x00de,
-	0x005e, 0x002e, 0x0005, 0x9186, 0x0013, 0x1160, 0x6004, 0x908a,
-	0x0085, 0x0a0c, 0x0db4, 0x908a, 0x0092, 0x1a0c, 0x0db4, 0x9082,
-	0x0085, 0x00e2, 0x9186, 0x0027, 0x0120, 0x9186, 0x0014, 0x190c,
-	0x0db4, 0x080c, 0x886e, 0x0096, 0x6014, 0x2048, 0x080c, 0xbb17,
-	0x0140, 0xa867, 0x0103, 0xa877, 0x0000, 0xa87b, 0x0029, 0x080c,
-	0x688c, 0x009e, 0x080c, 0x9e62, 0x0804, 0x8973, 0xb543, 0xb545,
-	0xb545, 0xb543, 0xb543, 0xb543, 0xb543, 0xb543, 0xb543, 0xb543,
-	0xb543, 0xb543, 0xb543, 0x080c, 0x0db4, 0x080c, 0x886e, 0x080c,
-	0x9e62, 0x080c, 0x8973, 0x0005, 0x9186, 0x0013, 0x1128, 0x6004,
-	0x9082, 0x0085, 0x2008, 0x04b8, 0x9186, 0x0027, 0x11f8, 0x080c,
-	0x886e, 0x080c, 0x2fda, 0x080c, 0xc227, 0x0096, 0x6014, 0x2048,
-	0x080c, 0xbb17, 0x0150, 0xa867, 0x0103, 0xa877, 0x0000, 0xa87b,
-	0x0029, 0x080c, 0x688c, 0x080c, 0xbd00, 0x009e, 0x080c, 0x9e32,
-	0x080c, 0x8973, 0x0005, 0x080c, 0x9ec7, 0x0ce0, 0x9186, 0x0014,
-	0x1dd0, 0x080c, 0x886e, 0x0096, 0x6014, 0x2048, 0x080c, 0xbb17,
-	0x0d60, 0xa867, 0x0103, 0xa877, 0x0000, 0xa87b, 0x0006, 0xa880,
-	0xc0ec, 0xa882, 0x08f0, 0x0002, 0xb59b, 0xb599, 0xb599, 0xb599,
-	0xb599, 0xb599, 0xb5b3, 0xb599, 0xb599, 0xb599, 0xb599, 0xb599,
-	0xb599, 0x080c, 0x0db4, 0x080c, 0x886e, 0x6034, 0x908c, 0xff00,
-	0x810f, 0x9186, 0x0039, 0x0118, 0x9186, 0x0035, 0x1118, 0x2001,
-	0x1957, 0x0010, 0x2001, 0x1958, 0x2004, 0x601a, 0x6003, 0x000c,
-	0x080c, 0x8973, 0x0005, 0x080c, 0x886e, 0x6034, 0x908c, 0xff00,
-	0x810f, 0x9186, 0x0039, 0x0118, 0x9186, 0x0035, 0x1118, 0x2001,
-	0x1957, 0x0010, 0x2001, 0x1958, 0x2004, 0x601a, 0x6003, 0x000e,
-	0x080c, 0x8973, 0x0005, 0x9182, 0x0092, 0x1220, 0x9182, 0x0085,
-	0x0208, 0x0012, 0x0804, 0x9ec7, 0xb5e1, 0xb5e1, 0xb5e1, 0xb5e1,
-	0xb5e3, 0xb630, 0xb5e1, 0xb5e1, 0xb5e1, 0xb5e1, 0xb5e1, 0xb5e1,
-	0xb5e1, 0x080c, 0x0db4, 0x0096, 0x6010, 0x00b6, 0x2058, 0xb800,
-	0x00be, 0xd0bc, 0x0168, 0x6034, 0x908c, 0xff00, 0x810f, 0x9186,
-	0x0039, 0x0118, 0x9186, 0x0035, 0x1118, 0x009e, 0x0804, 0xb644,
-	0x080c, 0xbb17, 0x1118, 0x080c, 0xbd00, 0x0068, 0x6014, 0x2048,
-	0xa87c, 0xd0e4, 0x1110, 0x080c, 0xbd00, 0xa867, 0x0103, 0x080c,
-	0xc1f2, 0x080c, 0x688c, 0x00d6, 0x2c68, 0x080c, 0x9ddc, 0x01d0,
-	0x6003, 0x0001, 0x6007, 0x001e, 0x600b, 0xffff, 0x2009, 0x026e,
-	0x210c, 0x613a, 0x2009, 0x026f, 0x210c, 0x613e, 0x6910, 0x6112,
-	0x080c, 0xbf8c, 0x6954, 0x6156, 0x6023, 0x0001, 0x080c, 0x83f1,
-	0x080c, 0x8973, 0x2d60, 0x00de, 0x080c, 0x9e32, 0x009e, 0x0005,
-	0x6010, 0x00b6, 0x2058, 0xb800, 0x00be, 0xd0bc, 0x05a0, 0x6034,
-	0x908c, 0xff00, 0x810f, 0x9186, 0x0035, 0x0130, 0x9186, 0x001e,
-	0x0118, 0x9186, 0x0039, 0x1538, 0x00d6, 0x2c68, 0x080c, 0xc18a,
-	0x11f0, 0x080c, 0x9ddc, 0x01d8, 0x6106, 0x6003, 0x0001, 0x6023,
-	0x0001, 0x6910, 0x6112, 0x692c, 0x612e, 0x6930, 0x6132, 0x6934,
-	0x918c, 0x00ff, 0x6136, 0x6938, 0x613a, 0x693c, 0x613e, 0x6954,
-	0x6156, 0x080c, 0xbf8c, 0x080c, 0x83f1, 0x080c, 0x8973, 0x2d60,
-	0x00de, 0x0804, 0x9e32, 0x0096, 0x6014, 0x2048, 0x080c, 0xbb17,
-	0x01c8, 0xa867, 0x0103, 0xa880, 0xd0b4, 0x0128, 0xc0ec, 0xa882,
-	0xa87b, 0x0006, 0x0048, 0xd0bc, 0x0118, 0xa87b, 0x0002, 0x0020,
-	0xa87b, 0x0005, 0x080c, 0xbe0c, 0xa877, 0x0000, 0x080c, 0x688c,
-	0x080c, 0xbd00, 0x009e, 0x0804, 0x9e32, 0x0016, 0x0096, 0x6014,
-	0x2048, 0x080c, 0xbb17, 0x0140, 0xa867, 0x0103, 0xa87b, 0x0028,
-	0xa877, 0x0000, 0x080c, 0x688c, 0x009e, 0x001e, 0x9186, 0x0013,
-	0x0148, 0x9186, 0x0014, 0x0130, 0x9186, 0x0027, 0x0118, 0x080c,
-	0x9ec7, 0x0030, 0x080c, 0x886e, 0x080c, 0x9e62, 0x080c, 0x8973,
-	0x0005, 0x0056, 0x0066, 0x0096, 0x00a6, 0x2029, 0x0001, 0x9182,
-	0x0101, 0x1208, 0x0010, 0x2009, 0x0100, 0x2130, 0x8304, 0x9098,
-	0x0018, 0x2009, 0x0020, 0x2011, 0x0029, 0x080c, 0xb712, 0x96b2,
-	0x0020, 0xb004, 0x904d, 0x0110, 0x080c, 0x0f9d, 0x080c, 0x0feb,
-	0x0520, 0x8528, 0xa867, 0x0110, 0xa86b, 0x0000, 0x2920, 0xb406,
-	0x968a, 0x003d, 0x1228, 0x2608, 0x2011, 0x001b, 0x0499, 0x00a8,
-	0x96b2, 0x003c, 0x2009, 0x003c, 0x2950, 0x2011, 0x001b, 0x0451,
-	0x0c28, 0x2001, 0x0205, 0x2003, 0x0000, 0x00ae, 0x852f, 0x95ad,
-	0x0003, 0xb566, 0x95ac, 0x0000, 0x0048, 0x2001, 0x0205, 0x2003,
-	0x0000, 0x00ae, 0x852f, 0x95ad, 0x0003, 0xb566, 0x009e, 0x006e,
-	0x005e, 0x0005, 0x00a6, 0x89ff, 0x0158, 0xa804, 0x9055, 0x0130,
-	0xa807, 0x0000, 0x080c, 0x688c, 0x2a48, 0x0cb8, 0x080c, 0x688c,
-	0x00ae, 0x0005, 0x00f6, 0x2079, 0x0200, 0x7814, 0x9085, 0x0080,
-	0x7816, 0xd184, 0x0108, 0x8108, 0x810c, 0x20a9, 0x0001, 0xa860,
-	0x20e8, 0xa85c, 0x9200, 0x20a0, 0x20e1, 0x0000, 0x2300, 0x9e00,
-	0x2098, 0x4003, 0x8318, 0x9386, 0x0020, 0x1148, 0x2018, 0x2300,
-	0x9e00, 0x2098, 0x7814, 0x8000, 0x9085, 0x0080, 0x7816, 0x8109,
-	0x1d80, 0x7817, 0x0000, 0x00fe, 0x0005, 0x0066, 0x0126, 0x2091,
-	0x8000, 0x2031, 0x0001, 0x6020, 0x9084, 0x000f, 0x0083, 0x012e,
-	0x006e, 0x0005, 0x0126, 0x2091, 0x8000, 0x0066, 0x2031, 0x0000,
-	0x6020, 0x9084, 0x000f, 0x001b, 0x006e, 0x012e, 0x0005, 0xb778,
-	0xb778, 0xb773, 0xb79a, 0xb766, 0xb773, 0xb79a, 0xb773, 0xb766,
-	0xb766, 0xb773, 0xb773, 0xb773, 0xb766, 0xb766, 0x080c, 0x0db4,
-	0x0036, 0x2019, 0x0010, 0x080c, 0xd0e5, 0x6023, 0x0006, 0x6003,
-	0x0007, 0x003e, 0x0005, 0x9006, 0x0005, 0x9085, 0x0001, 0x0005,
-	0x0096, 0x86ff, 0x11d8, 0x6014, 0x2048, 0x080c, 0xbb17, 0x01c0,
-	0xa864, 0x9086, 0x0139, 0x1128, 0xa87b, 0x0005, 0xa883, 0x0000,
-	0x0028, 0x900e, 0x2001, 0x0005, 0x080c, 0x6ac6, 0x080c, 0xbe0c,
-	0x080c, 0x687f, 0x080c, 0x9e62, 0x9085, 0x0001, 0x009e, 0x0005,
-	0x9006, 0x0ce0, 0x6000, 0x908a, 0x0016, 0x1a0c, 0x0db4, 0x0002,
-	0xb7b0, 0xb7de, 0xb7b2, 0xb7ff, 0xb7d9, 0xb7b0, 0xb773, 0xb778,
-	0xb778, 0xb773, 0xb773, 0xb773, 0xb773, 0xb773, 0xb773, 0xb773,
-	0x080c, 0x0db4, 0x86ff, 0x1510, 0x6020, 0x9086, 0x0006, 0x01f0,
-	0x0096, 0x6014, 0x2048, 0x080c, 0xbb17, 0x0158, 0xa87c, 0xd0cc,
-	0x0130, 0x0096, 0xa878, 0x2048, 0x080c, 0x0f9d, 0x009e, 0x080c,
-	0xbe0c, 0x009e, 0x080c, 0xc1cc, 0x6007, 0x0085, 0x6003, 0x000b,
-	0x6023, 0x0002, 0x080c, 0x83f1, 0x080c, 0x8973, 0x9085, 0x0001,
-	0x0005, 0x0066, 0x080c, 0x190d, 0x006e, 0x08a0, 0x00e6, 0x2071,
-	0x19b8, 0x7024, 0x9c06, 0x1120, 0x080c, 0x9662, 0x00ee, 0x0850,
-	0x6020, 0x9084, 0x000f, 0x9086, 0x0006, 0x1150, 0x0086, 0x0096,
-	0x2049, 0x0001, 0x2c40, 0x080c, 0x97ba, 0x009e, 0x008e, 0x0010,
-	0x080c, 0x955f, 0x00ee, 0x1904, 0xb7b2, 0x0804, 0xb773, 0x0036,
-	0x00e6, 0x2071, 0x19b8, 0x703c, 0x9c06, 0x1138, 0x901e, 0x080c,
-	0x96d8, 0x00ee, 0x003e, 0x0804, 0xb7b2, 0x080c, 0x98ea, 0x00ee,
-	0x003e, 0x1904, 0xb7b2, 0x0804, 0xb773, 0x00c6, 0x6020, 0x9084,
-	0x000f, 0x0013, 0x00ce, 0x0005, 0xb832, 0xb8fb, 0xba62, 0xb83c,
-	0x9e62, 0xb832, 0xd0d7, 0xc234, 0xb8fb, 0xb82b, 0xbae1, 0xb82b,
-	0xb82b, 0xb82b, 0xb82b, 0x080c, 0x0db4, 0x080c, 0xbd1d, 0x1110,
-	0x080c, 0xa7c0, 0x0005, 0x080c, 0x886e, 0x080c, 0x8973, 0x0804,
-	0x9e32, 0x601b, 0x0001, 0x0005, 0x080c, 0xbb17, 0x0130, 0x6014,
-	0x0096, 0x2048, 0x2c00, 0xa896, 0x009e, 0x6000, 0x908a, 0x0016,
-	0x1a0c, 0x0db4, 0x0002, 0xb85b, 0xb85d, 0xb881, 0xb895, 0xb8b9,
-	0xb85b, 0xb832, 0xb832, 0xb832, 0xb895, 0xb895, 0xb85b, 0xb85b,
-	0xb85b, 0xb85b, 0xb89f, 0x080c, 0x0db4, 0x00e6, 0x6014, 0x0096,
-	0x2048, 0xa880, 0xc0b5, 0xa882, 0x009e, 0x2071, 0x19b8, 0x7024,
-	0x9c06, 0x01a0, 0x080c, 0x955f, 0x080c, 0xc1cc, 0x6007, 0x0085,
-	0x6003, 0x000b, 0x6023, 0x0002, 0x2001, 0x1958, 0x2004, 0x601a,
-	0x080c, 0x83f1, 0x080c, 0x8973, 0x00ee, 0x0005, 0x601b, 0x0001,
-	0x0cd8, 0x0096, 0x6014, 0x2048, 0xa880, 0xc0b5, 0xa882, 0x009e,
-	0x080c, 0xc1cc, 0x6007, 0x0085, 0x6003, 0x000b, 0x6023, 0x0002,
-	0x080c, 0x83f1, 0x080c, 0x8973, 0x0005, 0x0096, 0x601b, 0x0001,
-	0x6014, 0x2048, 0xa880, 0xc0b5, 0xa882, 0x009e, 0x0005, 0x080c,
-	0x538e, 0x01a8, 0x6014, 0x0096, 0x904d, 0x0180, 0xa864, 0xa867,
-	0x0103, 0xa87b, 0x0006, 0x9086, 0x0139, 0x1140, 0xa867, 0x0139,
-	0xa897, 0x4005, 0xa89b, 0x0004, 0x080c, 0x688c, 0x009e, 0x0804,
-	0x9e32, 0x6014, 0x0096, 0x904d, 0x05c8, 0xa97c, 0xd1e4, 0x05b0,
-	0x2001, 0x180f, 0x2004, 0xd0c4, 0x0110, 0x009e, 0x0005, 0xa884,
-	0x009e, 0x8003, 0x800b, 0x810b, 0x9108, 0x611a, 0x2001, 0x0030,
-	0x2c08, 0x080c, 0x1518, 0x2001, 0x030c, 0x2004, 0x9086, 0x0041,
-	0x11a0, 0x6014, 0x0096, 0x904d, 0x090c, 0x0db4, 0xa880, 0xd0f4,
-	0x1130, 0xc0f5, 0xa882, 0x009e, 0x601b, 0x0002, 0x0070, 0x009e,
-	0x2001, 0x0037, 0x2c08, 0x080c, 0x1518, 0x6000, 0x9086, 0x0004,
-	0x1120, 0x2009, 0x0048, 0x080c, 0x9eac, 0x0005, 0x009e, 0x080c,
-	0x190d, 0x0804, 0xb881, 0x6000, 0x908a, 0x0016, 0x1a0c, 0x0db4,
-	0x000b, 0x0005, 0xb912, 0xb839, 0xb914, 0xb912, 0xb914, 0xb914,
-	0xb833, 0xb912, 0xb82d, 0xb82d, 0xb912, 0xb912, 0xb912, 0xb912,
-	0xb912, 0xb912, 0x080c, 0x0db4, 0x6010, 0x00b6, 0x2058, 0xb804,
-	0x9084, 0x00ff, 0x00be, 0x908a, 0x000c, 0x1a0c, 0x0db4, 0x00b6,
-	0x0013, 0x00be, 0x0005, 0xb92f, 0xb9fc, 0xb931, 0xb971, 0xb931,
-	0xb971, 0xb931, 0xb93f, 0xb92f, 0xb971, 0xb92f, 0xb960, 0x080c,
-	0x0db4, 0x6004, 0x908e, 0x0016, 0x05c0, 0x908e, 0x0004, 0x05a8,
-	0x908e, 0x0002, 0x0590, 0x908e, 0x0052, 0x0904, 0xb9f8, 0x6004,
-	0x080c, 0xbd1d, 0x0904, 0xba15, 0x908e, 0x0004, 0x1110, 0x080c,
-	0x3003, 0x908e, 0x0021, 0x0904, 0xba19, 0x908e, 0x0022, 0x0904,
-	0xba5d, 0x908e, 0x003d, 0x0904, 0xba19, 0x908e, 0x0039, 0x0904,
-	0xba1d, 0x908e, 0x0035, 0x0904, 0xba1d, 0x908e, 0x001e, 0x0178,
-	0x908e, 0x0001, 0x1140, 0x6010, 0x2058, 0xb804, 0x9084, 0x00ff,
-	0x9086, 0x0006, 0x0110, 0x080c, 0x2fda, 0x080c, 0xa7c0, 0x0804,
-	0x9e62, 0x00c6, 0x00d6, 0x6104, 0x9186, 0x0016, 0x0904, 0xb9e9,
-	0x9186, 0x0002, 0x1904, 0xb9be, 0x2001, 0x1836, 0x2004, 0xd08c,
-	0x11c8, 0x080c, 0x6fb2, 0x11b0, 0x080c, 0xc212, 0x0138, 0x080c,
-	0x6fd5, 0x1120, 0x080c, 0x6ec2, 0x0804, 0xba46, 0x2001, 0x194e,
-	0x2003, 0x0001, 0x2001, 0x1800, 0x2003, 0x0001, 0x080c, 0x6ee4,
-	0x0804, 0xba46, 0x6010, 0x2058, 0x2001, 0x1836, 0x2004, 0xd0ac,
-	0x1904, 0xba46, 0xb8a0, 0x9084, 0xff80, 0x1904, 0xba46, 0xb840,
-	0x9084, 0x00ff, 0x9005, 0x0190, 0x8001, 0xb842, 0x6017, 0x0000,
-	0x6023, 0x0007, 0x601b, 0x0398, 0x6043, 0x0000, 0x080c, 0x9ddc,
-	0x0128, 0x2b00, 0x6012, 0x6023, 0x0001, 0x0458, 0x00de, 0x00ce,
-	0x6004, 0x908e, 0x0002, 0x11a0, 0x6010, 0x2058, 0xb8a0, 0x9086,
-	0x007e, 0x1170, 0x2009, 0x1836, 0x2104, 0xc085, 0x200a, 0x00e6,
-	0x2071, 0x1800, 0x080c, 0x5c64, 0x00ee, 0x080c, 0xa7c0, 0x0030,
-	0x080c, 0xa7c0, 0x080c, 0x2fda, 0x080c, 0xc227, 0x00e6, 0x0126,
-	0x2091, 0x8000, 0x080c, 0x3003, 0x012e, 0x00ee, 0x080c, 0x9e62,
-	0x0005, 0x2001, 0x0002, 0x080c, 0x618f, 0x6003, 0x0001, 0x6007,
-	0x0002, 0x080c, 0x8439, 0x080c, 0x8973, 0x00de, 0x00ce, 0x0c80,
-	0x080c, 0x3003, 0x0804, 0xb96d, 0x00c6, 0x00d6, 0x6104, 0x9186,
-	0x0016, 0x0d38, 0x6010, 0x2058, 0xb840, 0x9084, 0x00ff, 0x9005,
-	0x0904, 0xb9be, 0x8001, 0xb842, 0x6003, 0x0001, 0x080c, 0x8439,
-	0x080c, 0x8973, 0x00de, 0x00ce, 0x0898, 0x080c, 0xa7c0, 0x0804,
-	0xb96f, 0x080c, 0xa7fc, 0x0804, 0xb96f, 0x00d6, 0x2c68, 0x6104,
-	0x080c, 0xc18a, 0x00de, 0x0118, 0x080c, 0x9e32, 0x00f0, 0x6004,
-	0x8007, 0x6134, 0x918c, 0x00ff, 0x9105, 0x6036, 0x6007, 0x0085,
-	0x6003, 0x000b, 0x6023, 0x0002, 0x603c, 0x600a, 0x2001, 0x1958,
-	0x2004, 0x601a, 0x602c, 0x2c08, 0x2060, 0x6024, 0xc0b5, 0x6026,
-	0x2160, 0x080c, 0x83f1, 0x080c, 0x8973, 0x0005, 0x00de, 0x00ce,
-	0x080c, 0xa7c0, 0x080c, 0x2fda, 0x00e6, 0x0126, 0x2091, 0x8000,
-	0x080c, 0x3003, 0x6017, 0x0000, 0x6023, 0x0007, 0x601b, 0x0398,
-	0x6043, 0x0000, 0x012e, 0x00ee, 0x0005, 0x080c, 0xa261, 0x1904,
-	0xba15, 0x0005, 0x6000, 0x908a, 0x0016, 0x1a0c, 0x0db4, 0x0096,
-	0x00d6, 0x001b, 0x00de, 0x009e, 0x0005, 0xba7d, 0xba7d, 0xba7d,
-	0xba7d, 0xba7d, 0xba7d, 0xba7d, 0xba7d, 0xba7d, 0xb832, 0xba7d,
-	0xb839, 0xba7f, 0xb839, 0xba8c, 0xba7d, 0x080c, 0x0db4, 0x6004,
-	0x9086, 0x008b, 0x0148, 0x6007, 0x008b, 0x6003, 0x000d, 0x080c,
-	0x83f1, 0x080c, 0x8973, 0x0005, 0x080c, 0xc206, 0x0118, 0x080c,
-	0xc219, 0x0010, 0x080c, 0xc227, 0x080c, 0xbd00, 0x080c, 0xbb17,
-	0x0570, 0x080c, 0x2fda, 0x080c, 0xbb17, 0x0168, 0x6014, 0x2048,
-	0xa867, 0x0103, 0xa87b, 0x0006, 0xa877, 0x0000, 0xa880, 0xc0ed,
-	0xa882, 0x080c, 0x688c, 0x2c68, 0x080c, 0x9ddc, 0x0150, 0x6810,
-	0x6012, 0x080c, 0xbf8c, 0x00c6, 0x2d60, 0x080c, 0x9e62, 0x00ce,
-	0x0008, 0x2d60, 0x6017, 0x0000, 0x6023, 0x0001, 0x6007, 0x0001,
-	0x6003, 0x0001, 0x080c, 0x8439, 0x080c, 0x8973, 0x00c8, 0x080c,
-	0xc206, 0x0138, 0x6034, 0x9086, 0x4000, 0x1118, 0x080c, 0x2fda,
-	0x08d0, 0x6034, 0x908c, 0xff00, 0x810f, 0x9186, 0x0039, 0x0118,
-	0x9186, 0x0035, 0x1118, 0x080c, 0x2fda, 0x0868, 0x080c, 0x9e62,
-	0x0005, 0x6000, 0x908a, 0x0016, 0x1a0c, 0x0db4, 0x0002, 0xbaf7,
-	0xbaf7, 0xbaf9, 0xbaf9, 0xbaf9, 0xbaf7, 0xbaf7, 0x9e62, 0xbaf7,
-	0xbaf7, 0xbaf7, 0xbaf7, 0xbaf7, 0xbaf7, 0xbaf7, 0xbaf7, 0x080c,
-	0x0db4, 0x080c, 0x98ea, 0x6114, 0x0096, 0x2148, 0xa87b, 0x0006,
-	0x080c, 0x688c, 0x009e, 0x0804, 0x9e32, 0x9284, 0x0007, 0x1158,
-	0x9282, 0x1cd0, 0x0240, 0x2001, 0x1819, 0x2004, 0x9202, 0x1218,
-	0x9085, 0x0001, 0x0005, 0x9006, 0x0ce8, 0x0096, 0x0028, 0x0096,
-	0x0006, 0x6014, 0x2048, 0x000e, 0x0006, 0x9984, 0xf000, 0x9086,
-	0xf000, 0x0110, 0x080c, 0x1096, 0x000e, 0x009e, 0x0005, 0x00e6,
-	0x00c6, 0x0036, 0x0006, 0x0126, 0x2091, 0x8000, 0x2061, 0x1cd0,
-	0x2071, 0x1800, 0x7350, 0x7070, 0x9302, 0x1640, 0x6020, 0x9206,
-	0x11f8, 0x080c, 0xc212, 0x0180, 0x9286, 0x0001, 0x1168, 0x6004,
-	0x9086, 0x0004, 0x1148, 0x080c, 0x2fda, 0x080c, 0xc227, 0x00c6,
-	0x080c, 0x9e62, 0x00ce, 0x0060, 0x080c, 0xbf06, 0x0148, 0x080c,
-	0xbd1d, 0x1110, 0x080c, 0xa7c0, 0x00c6, 0x080c, 0x9e32, 0x00ce,
-	0x9ce0, 0x0018, 0x7064, 0x9c02, 0x1208, 0x08a0, 0x012e, 0x000e,
-	0x003e, 0x00ce, 0x00ee, 0x0005, 0x00e6, 0x00c6, 0x0016, 0x9188,
-	0x1000, 0x210c, 0x81ff, 0x0128, 0x2061, 0x1a80, 0x6112, 0x080c,
-	0x2fda, 0x9006, 0x0010, 0x9085, 0x0001, 0x001e, 0x00ce, 0x00ee,
-	0x0005, 0x00c6, 0x0126, 0x2091, 0x8000, 0x080c, 0x9ddc, 0x01b0,
-	0x6656, 0x2b00, 0x6012, 0x080c, 0x538e, 0x0118, 0x080c, 0xbc44,
-	0x0168, 0x080c, 0xbf8c, 0x6023, 0x0003, 0x2009, 0x004b, 0x080c,
-	0x9eac, 0x9085, 0x0001, 0x012e, 0x00ce, 0x0005, 0x9006, 0x0cd8,
-	0x00c6, 0x0126, 0x2091, 0x8000, 0xbaa0, 0x080c, 0x9e7f, 0x0560,
-	0x6057, 0x0000, 0x2b00, 0x6012, 0x080c, 0xbf8c, 0x6023, 0x0003,
-	0x0016, 0x080c, 0x8571, 0x0076, 0x903e, 0x080c, 0x8469, 0x2c08,
-	0x080c, 0xd29b, 0x007e, 0x001e, 0xd184, 0x0128, 0x080c, 0x9e32,
-	0x9085, 0x0001, 0x0070, 0x080c, 0x538e, 0x0128, 0xd18c, 0x1170,
-	0x080c, 0xbc44, 0x0148, 0x2009, 0x004c, 0x080c, 0x9eac, 0x9085,
-	0x0001, 0x012e, 0x00ce, 0x0005, 0x9006, 0x0cd8, 0x2900, 0x6016,
-	0x0c90, 0x2009, 0x004d, 0x0010, 0x2009, 0x004e, 0x00f6, 0x00c6,
-	0x0046, 0x0016, 0x080c, 0x9ddc, 0x2c78, 0x0590, 0x7e56, 0x2b00,
-	0x7812, 0x7823, 0x0003, 0x2021, 0x0005, 0x080c, 0xbc56, 0x9186,
-	0x004d, 0x0118, 0x9186, 0x004e, 0x0148, 0x2001, 0x1951, 0x200c,
-	0xd1fc, 0x0168, 0x2f60, 0x080c, 0x9e32, 0x00d0, 0x2001, 0x1950,
-	0x200c, 0xd1fc, 0x0120, 0x2f60, 0x080c, 0x9e32, 0x0088, 0x2f60,
-	0x080c, 0x538e, 0x0138, 0xd18c, 0x1118, 0x04f1, 0x0148, 0x0010,
-	0x2900, 0x7816, 0x001e, 0x0016, 0x080c, 0x9eac, 0x9085, 0x0001,
-	0x001e, 0x004e, 0x00ce, 0x00fe, 0x0005, 0x00f6, 0x00c6, 0x0046,
-	0x080c, 0x9ddc, 0x2c78, 0x0508, 0x7e56, 0x2b00, 0x7812, 0x7823,
-	0x0003, 0x0096, 0x2021, 0x0004, 0x0489, 0x009e, 0x2001, 0x194f,
-	0x200c, 0xd1fc, 0x0120, 0x2f60, 0x080c, 0x9e32, 0x0060, 0x2f60,
-	0x080c, 0x538e, 0x0120, 0xd18c, 0x1160, 0x0071, 0x0130, 0x2009,
-	0x0052, 0x080c, 0x9eac, 0x9085, 0x0001, 0x004e, 0x00ce, 0x00fe,
-	0x0005, 0x2900, 0x7816, 0x0c98, 0x00c6, 0x080c, 0x4879, 0x00ce,
-	0x1120, 0x080c, 0x9e32, 0x9006, 0x0005, 0xa867, 0x0000, 0xa86b,
-	0x8000, 0x2900, 0x6016, 0x9085, 0x0001, 0x0005, 0x0096, 0x0076,
-	0x0126, 0x2091, 0x8000, 0x080c, 0x6372, 0x0158, 0x2001, 0xbc5b,
-	0x0006, 0x900e, 0x2400, 0x080c, 0x6ac6, 0x080c, 0x688c, 0x000e,
-	0x0807, 0x2418, 0x080c, 0x8808, 0xbaa0, 0x0086, 0x2041, 0x0001,
-	0x2039, 0x0001, 0x2608, 0x080c, 0x8589, 0x008e, 0x080c, 0x8469,
-	0x2f08, 0x2648, 0x080c, 0xd29b, 0xb93c, 0x81ff, 0x090c, 0x865a,
-	0x080c, 0x8973, 0x012e, 0x007e, 0x009e, 0x0005, 0x00c6, 0x0126,
-	0x2091, 0x8000, 0x080c, 0x9ddc, 0x0190, 0x660a, 0x2b08, 0x6112,
-	0x080c, 0xbf8c, 0x6023, 0x0001, 0x2900, 0x6016, 0x2009, 0x001f,
-	0x080c, 0x9eac, 0x9085, 0x0001, 0x012e, 0x00ce, 0x0005, 0x9006,
-	0x0cd8, 0x00c6, 0x0126, 0x2091, 0x8000, 0x080c, 0x9e7f, 0x01b8,
-	0x660a, 0x2b08, 0x6112, 0x080c, 0xbf8c, 0x6023, 0x0008, 0x2900,
-	0x6016, 0x00f6, 0x2c78, 0x080c, 0x1648, 0x00fe, 0x2009, 0x0021,
-	0x080c, 0x9eac, 0x9085, 0x0001, 0x012e, 0x00ce, 0x0005, 0x9006,
-	0x0cd8, 0x2009, 0x003d, 0x00c6, 0x0126, 0x0016, 0x2091, 0x8000,
-	0x080c, 0x9ddc, 0x0198, 0x660a, 0x2b08, 0x6112, 0x080c, 0xbf8c,
-	0x6023, 0x0001, 0x2900, 0x6016, 0x001e, 0x0016, 0x080c, 0x9eac,
-	0x9085, 0x0001, 0x001e, 0x012e, 0x00ce, 0x0005, 0x9006, 0x0cd0,
-	0x00c6, 0x0126, 0x2091, 0x8000, 0x080c, 0x9e7f, 0x0188, 0x2b08,
-	0x6112, 0x080c, 0xbf8c, 0x6023, 0x0001, 0x2900, 0x6016, 0x2009,
-	0x0000, 0x080c, 0x9eac, 0x9085, 0x0001, 0x012e, 0x00ce, 0x0005,
-	0x9006, 0x0cd8, 0x2009, 0x0044, 0x0830, 0x2009, 0x0049, 0x0818,
-	0x0026, 0x00b6, 0x6210, 0x2258, 0xba3c, 0x82ff, 0x0110, 0x8211,
-	0xba3e, 0x00be, 0x002e, 0x0005, 0x0006, 0x0016, 0x6004, 0x908e,
-	0x0002, 0x0140, 0x908e, 0x0003, 0x0128, 0x908e, 0x0004, 0x0110,
-	0x9085, 0x0001, 0x001e, 0x000e, 0x0005, 0x0006, 0x0096, 0x6020,
-	0x9086, 0x0004, 0x0190, 0x6014, 0x904d, 0x080c, 0xbb17, 0x0168,
-	0xa864, 0x9086, 0x0139, 0x0158, 0x6020, 0x9086, 0x0003, 0x0128,
-	0xa868, 0xd0fc, 0x0110, 0x9006, 0x0010, 0x9085, 0x0001, 0x009e,
-	0x000e, 0x0005, 0x00c6, 0x0126, 0x2091, 0x8000, 0x080c, 0x9e7f,
-	0x0198, 0x2b08, 0x6112, 0x080c, 0xbf8c, 0x6023, 0x0001, 0x2900,
-	0x6016, 0x080c, 0x2fda, 0x2009, 0x0028, 0x080c, 0x9eac, 0x9085,
-	0x0001, 0x012e, 0x00ce, 0x0005, 0x9006, 0x0cd8, 0x9186, 0x0015,
-	0x11a8, 0x2011, 0x1823, 0x2204, 0x9086, 0x0074, 0x1178, 0x00b6,
-	0x080c, 0xaa49, 0x00be, 0x080c, 0xac88, 0x6003, 0x0001, 0x6007,
-	0x0029, 0x080c, 0x8439, 0x080c, 0x8973, 0x0078, 0x6014, 0x0096,
-	0x2048, 0xa868, 0x009e, 0xd0fc, 0x0148, 0x2001, 0x0001, 0x080c,
-	0xc14b, 0x080c, 0xa7c0, 0x080c, 0x9e32, 0x0005, 0x0096, 0x6014,
-	0x904d, 0x090c, 0x0db4, 0xa87b, 0x0030, 0xa883, 0x0000, 0xa897,
-	0x4005, 0xa89b, 0x0004, 0xa867, 0x0139, 0x0126, 0x2091, 0x8000,
-	0x080c, 0x688c, 0x012e, 0x009e, 0x080c, 0x9e32, 0x0c30, 0x0096,
-	0x9186, 0x0016, 0x1128, 0x2001, 0x0004, 0x080c, 0x618f, 0x00e8,
-	0x9186, 0x0015, 0x1510, 0x2011, 0x1823, 0x2204, 0x9086, 0x0014,
-	0x11e0, 0x6010, 0x00b6, 0x2058, 0x080c, 0x62d9, 0x00be, 0x080c,
-	0xad59, 0x1198, 0x6010, 0x00b6, 0x2058, 0xb890, 0x00be, 0x9005,
-	0x0160, 0x2001, 0x0006, 0x080c, 0x618f, 0x6014, 0x2048, 0xa868,
-	0xd0fc, 0x0170, 0x080c, 0xa235, 0x0048, 0x6014, 0x2048, 0xa868,
-	0xd0fc, 0x0528, 0x080c, 0xa7c0, 0x080c, 0x9e32, 0x009e, 0x0005,
-	0x6014, 0x6310, 0x2358, 0x904d, 0x090c, 0x0db4, 0xa87b, 0x0000,
-	0xa883, 0x0000, 0xa897, 0x4000, 0x900e, 0x080c, 0x645e, 0x1108,
-	0xc185, 0xb800, 0xd0bc, 0x0108, 0xc18d, 0xa99a, 0x0126, 0x2091,
-	0x8000, 0x080c, 0x688c, 0x012e, 0x080c, 0x9e32, 0x08f8, 0x6014,
-	0x904d, 0x090c, 0x0db4, 0xa87b, 0x0030, 0xa883, 0x0000, 0xa897,
-	0x4005, 0xa89b, 0x0004, 0xa867, 0x0139, 0x0126, 0x2091, 0x8000,
-	0x080c, 0x688c, 0x012e, 0x080c, 0x9e32, 0x0840, 0xa878, 0x9086,
-	0x0005, 0x1108, 0x0009, 0x0005, 0xa880, 0xc0ad, 0xa882, 0x0005,
-	0x6043, 0x0000, 0x6017, 0x0000, 0x6003, 0x0001, 0x6007, 0x0050,
-	0x080c, 0x83f1, 0x080c, 0x8973, 0x0005, 0x00c6, 0x6010, 0x00b6,
-	0x2058, 0xb800, 0x00be, 0xd0bc, 0x0120, 0x6020, 0x9084, 0x000f,
-	0x0013, 0x00ce, 0x0005, 0xb832, 0xbe3c, 0xbe3c, 0xbe3f, 0xd579,
-	0xd594, 0xd597, 0xb832, 0xb832, 0xb832, 0xb832, 0xb832, 0xb832,
-	0xb832, 0xb832, 0x080c, 0x0db4, 0xa001, 0xa001, 0x0005, 0x0096,
-	0x6014, 0x904d, 0x0118, 0xa87c, 0xd0e4, 0x1110, 0x009e, 0x0010,
-	0x009e, 0x0005, 0x6010, 0x00b6, 0x2058, 0xb800, 0x00be, 0xd0bc,
-	0x0550, 0x2001, 0x1833, 0x2004, 0x9005, 0x1540, 0x00f6, 0x2c78,
-	0x080c, 0x9ddc, 0x0508, 0x7810, 0x6012, 0x080c, 0xbf8c, 0x7820,
-	0x9086, 0x0003, 0x0128, 0x7808, 0x603a, 0x2f00, 0x603e, 0x0020,
-	0x7808, 0x603e, 0x2f00, 0x603a, 0x602e, 0x6023, 0x0001, 0x6007,
-	0x0035, 0x6003, 0x0001, 0x7954, 0x6156, 0x080c, 0x83f1, 0x080c,
-	0x8973, 0x2f60, 0x00fe, 0x0005, 0x2f60, 0x00fe, 0x2001, 0x1959,
-	0x2004, 0x6042, 0x0005, 0x0016, 0x0096, 0x6814, 0x2048, 0xa87c,
-	0xd0e4, 0x0180, 0xc0e4, 0xa87e, 0xa877, 0x0000, 0xa893, 0x0000,
-	0xa88f, 0x0000, 0xd0cc, 0x0130, 0xc0cc, 0xa87e, 0xa878, 0x2048,
-	0x080c, 0x0f9d, 0x6830, 0x6036, 0x908e, 0x0001, 0x0148, 0x6803,
-	0x0002, 0x9086, 0x0005, 0x0170, 0x9006, 0x602e, 0x6032, 0x00d0,
-	0x681c, 0xc085, 0x681e, 0x6803, 0x0004, 0x6824, 0xc0f4, 0x9085,
-	0x0c00, 0x6826, 0x6814, 0x2048, 0xa8ac, 0x6938, 0x9102, 0xa8b0,
-	0x693c, 0x9103, 0x1e48, 0x683c, 0x602e, 0x6838, 0x9084, 0xfffc,
-	0x683a, 0x6032, 0x2d00, 0x603a, 0x6808, 0x603e, 0x6910, 0x6112,
-	0x6954, 0x6156, 0x6023, 0x0001, 0x6007, 0x0039, 0x6003, 0x0001,
-	0x080c, 0x83f1, 0x080c, 0x8973, 0x009e, 0x001e, 0x0005, 0x6024,
-	0xd0d4, 0x0510, 0xd0f4, 0x11f8, 0x6038, 0x940a, 0x603c, 0x9303,
-	0x0230, 0x9105, 0x0120, 0x6024, 0xc0d4, 0xc0f5, 0x0098, 0x643a,
-	0x633e, 0xac3e, 0xab42, 0x0046, 0x0036, 0x2400, 0xacac, 0x9402,
-	0xa836, 0x2300, 0xabb0, 0x9303, 0xa83a, 0x003e, 0x004e, 0x6024,
-	0xc0d4, 0x0000, 0x6026, 0x0005, 0xd0f4, 0x1138, 0xa83c, 0x603a,
-	0xa840, 0x603e, 0x6024, 0xc0f5, 0x6026, 0x0005, 0x0006, 0x0016,
-	0x6004, 0x908e, 0x0034, 0x01b8, 0x908e, 0x0035, 0x01a0, 0x908e,
-	0x0036, 0x0188, 0x908e, 0x0037, 0x0170, 0x908e, 0x0038, 0x0158,
-	0x908e, 0x0039, 0x0140, 0x908e, 0x003a, 0x0128, 0x908e, 0x003b,
-	0x0110, 0x9085, 0x0001, 0x001e, 0x000e, 0x0005, 0x0006, 0x0016,
-	0x0026, 0x0036, 0x00e6, 0x2001, 0x1953, 0x200c, 0x8000, 0x2014,
-	0x2001, 0x0032, 0x080c, 0x8270, 0x2001, 0x1957, 0x82ff, 0x1110,
-	0x2011, 0x0014, 0x2202, 0x2001, 0x1955, 0x200c, 0x8000, 0x2014,
-	0x2071, 0x193d, 0x711a, 0x721e, 0x2001, 0x0064, 0x080c, 0x8270,
-	0x2001, 0x1958, 0x82ff, 0x1110, 0x2011, 0x0014, 0x2202, 0x2001,
-	0x1959, 0x9288, 0x000a, 0x2102, 0x2001, 0x1a61, 0x2102, 0x2001,
-	0x0032, 0x080c, 0x1518, 0x080c, 0x6543, 0x00ee, 0x003e, 0x002e,
-	0x001e, 0x000e, 0x0005, 0x0006, 0x0016, 0x00e6, 0x2001, 0x1957,
-	0x2003, 0x0028, 0x2001, 0x1958, 0x2003, 0x0014, 0x2071, 0x193d,
-	0x701b, 0x0000, 0x701f, 0x07d0, 0x2001, 0x1959, 0x2009, 0x001e,
-	0x2102, 0x2001, 0x1a61, 0x2102, 0x2001, 0x0032, 0x080c, 0x1518,
-	0x00ee, 0x001e, 0x000e, 0x0005, 0x0096, 0x6058, 0x904d, 0x0110,
-	0x080c, 0x101d, 0x009e, 0x0005, 0x0005, 0x00c6, 0x0126, 0x2091,
-	0x8000, 0x080c, 0x9ddc, 0x0180, 0x2b08, 0x6112, 0x0ca9, 0x6023,
-	0x0001, 0x2900, 0x6016, 0x2009, 0x0033, 0x080c, 0x9eac, 0x9085,
-	0x0001, 0x012e, 0x00ce, 0x0005, 0x9006, 0x0cd8, 0x0096, 0x00e6,
-	0x00f6, 0x2071, 0x1800, 0x9186, 0x0015, 0x1500, 0x708c, 0x9086,
-	0x0018, 0x11e0, 0x6014, 0x2048, 0xaa3c, 0xd2e4, 0x1160, 0x2c78,
-	0x080c, 0x8b63, 0x01d8, 0x7078, 0xaa50, 0x9206, 0x1160, 0x707c,
-	0xaa54, 0x9206, 0x1140, 0x6210, 0x00b6, 0x2258, 0xbaa0, 0x00be,
-	0x900e, 0x080c, 0x3023, 0x080c, 0xa235, 0x0020, 0x080c, 0xa7c0,
-	0x080c, 0x9e32, 0x00fe, 0x00ee, 0x009e, 0x0005, 0x705c, 0xaa54,
-	0x9206, 0x0d48, 0x0c80, 0x00c6, 0x0126, 0x2091, 0x8000, 0x080c,
-	0x9ddc, 0x0188, 0x2b08, 0x6112, 0x080c, 0xbf8c, 0x6023, 0x0001,
-	0x2900, 0x6016, 0x2009, 0x004d, 0x080c, 0x9eac, 0x9085, 0x0001,
+	0x9284, 0x0300, 0x0904, 0xb155, 0x080c, 0x0feb, 0x090c, 0x0db4,
+	0x2900, 0xb07a, 0xb77c, 0xc7cd, 0xb77e, 0xa867, 0x0103, 0xb068,
+	0xa86a, 0xb06c, 0xa86e, 0xb070, 0xa872, 0xae76, 0x968c, 0x0c00,
+	0x0120, 0x7348, 0xab92, 0x734c, 0xab8e, 0x968c, 0x00ff, 0x9186,
+	0x0002, 0x0180, 0x9186, 0x0028, 0x1118, 0xa87b, 0x001c, 0x0060,
+	0xd6dc, 0x0118, 0xa87b, 0x0015, 0x0038, 0xd6d4, 0x0118, 0xa87b,
+	0x0007, 0x0010, 0xa87b, 0x0000, 0xaf7e, 0xb080, 0xa882, 0xb084,
+	0xa886, 0x901e, 0xd6c4, 0x0190, 0x735c, 0xab86, 0x83ff, 0x0170,
+	0x938a, 0x0009, 0x0210, 0x2019, 0x0008, 0x0036, 0x2308, 0x2019,
+	0x0018, 0x2011, 0x0025, 0x080c, 0xb725, 0x003e, 0xd6cc, 0x01e8,
+	0x7154, 0xa98a, 0x81ff, 0x01c8, 0x9192, 0x0021, 0x1260, 0x8304,
+	0x9098, 0x0018, 0x2011, 0x0029, 0x080c, 0xb725, 0x2011, 0x0205,
+	0x2013, 0x0000, 0x0050, 0xb068, 0xd0fc, 0x0120, 0x2009, 0x0020,
+	0xa98a, 0x0c68, 0x2950, 0x080c, 0xb6c4, 0x009e, 0x00ee, 0x00ae,
+	0x007e, 0x0005, 0x00f6, 0x00a6, 0x6003, 0x0003, 0x2079, 0x026c,
+	0x7c04, 0x7b00, 0x7e0c, 0x7d08, 0x6014, 0x2050, 0xb436, 0xb33a,
+	0xb646, 0xb54a, 0x00ae, 0x00fe, 0x2c10, 0x080c, 0x1a5e, 0x0804,
+	0x937a, 0x6003, 0x0002, 0x6004, 0x9086, 0x0040, 0x11c8, 0x0096,
+	0x6014, 0x2048, 0xa87c, 0xd0ac, 0x0160, 0x601c, 0xd084, 0x1130,
+	0x00f6, 0x2c00, 0x2078, 0x080c, 0x164a, 0x00fe, 0x6003, 0x0004,
+	0x0010, 0x6003, 0x0002, 0x009e, 0x080c, 0x8861, 0x080c, 0x896d,
+	0x0096, 0x2001, 0x1958, 0x2004, 0x6042, 0x080c, 0x891d, 0x080c,
+	0x8a4a, 0x6114, 0x2148, 0xa97c, 0xd1e4, 0x0904, 0xb1f8, 0xd1cc,
+	0x05a8, 0xa978, 0xa868, 0xd0fc, 0x0538, 0x0016, 0xa87c, 0x0006,
+	0xa880, 0x0006, 0xa860, 0x20e8, 0xa85c, 0x9080, 0x0019, 0x20a0,
+	0x810e, 0x810e, 0x810f, 0x9184, 0x003f, 0x20e0, 0x9184, 0xffc0,
+	0x9080, 0x0019, 0x2098, 0x0156, 0x20a9, 0x0020, 0x4003, 0x015e,
+	0x000e, 0xa882, 0x000e, 0xa87e, 0x001e, 0xa874, 0x0006, 0x2148,
+	0x080c, 0x0f9d, 0x001e, 0x0440, 0x0016, 0x080c, 0x0f9d, 0x009e,
+	0xa974, 0x0016, 0x080c, 0xb715, 0x001e, 0x00f0, 0xa867, 0x0103,
+	0xa974, 0x9184, 0x00ff, 0x90b6, 0x0002, 0x0180, 0x9086, 0x0028,
+	0x1118, 0xa87b, 0x001c, 0x0060, 0xd1dc, 0x0118, 0xa87b, 0x0015,
+	0x0038, 0xd1d4, 0x0118, 0xa87b, 0x0007, 0x0010, 0xa87b, 0x0000,
+	0x0016, 0x080c, 0x66ac, 0x001e, 0xd1e4, 0x1120, 0x080c, 0x9e42,
+	0x009e, 0x0005, 0x080c, 0xbe2a, 0x0cd8, 0x6004, 0x9086, 0x0040,
+	0x1120, 0x080c, 0x8861, 0x080c, 0x896d, 0x2019, 0x0001, 0x080c,
+	0x96d9, 0x6003, 0x0002, 0x080c, 0xc249, 0x080c, 0x891d, 0x080c,
+	0x8a4a, 0x0005, 0x6004, 0x9086, 0x0040, 0x1120, 0x080c, 0x8861,
+	0x080c, 0x896d, 0x2019, 0x0001, 0x080c, 0x96d9, 0x080c, 0x891d,
+	0x080c, 0x2fdc, 0x080c, 0xc241, 0x0096, 0x6114, 0x2148, 0x080c,
+	0xbb2c, 0x0150, 0xa867, 0x0103, 0xa87b, 0x0029, 0xa877, 0x0000,
+	0x080c, 0x6891, 0x080c, 0xbd15, 0x009e, 0x080c, 0x9e42, 0x080c,
+	0x8a4a, 0x0005, 0xa87b, 0x0015, 0xd1fc, 0x0180, 0xa87b, 0x0007,
+	0x8002, 0x8000, 0x810a, 0x9189, 0x0000, 0x0006, 0x0016, 0x2009,
+	0x1a49, 0x2104, 0x8000, 0x200a, 0x001e, 0x000e, 0xa992, 0xa88e,
+	0x0005, 0x9182, 0x0054, 0x1220, 0x9182, 0x0040, 0x0208, 0x000a,
+	0x0005, 0xb26d, 0xb26d, 0xb26d, 0xb26d, 0xb26d, 0xb26f, 0xb26d,
+	0xb26d, 0xb315, 0xb26d, 0xb26d, 0xb26d, 0xb26d, 0xb26d, 0xb26d,
+	0xb26d, 0xb26d, 0xb26d, 0xb26d, 0xb446, 0x080c, 0x0db4, 0x0076,
+	0x00a6, 0x00e6, 0x0096, 0x2071, 0x0260, 0x6114, 0x2150, 0x7644,
+	0xb676, 0x96b4, 0x0fff, 0xb77c, 0xc7e5, 0xb77e, 0x6210, 0x00b6,
+	0x2258, 0xba3c, 0x82ff, 0x0110, 0x8211, 0xba3e, 0x00be, 0x86ff,
+	0x0904, 0xb30e, 0x9694, 0xff00, 0x9284, 0x0c00, 0x0120, 0x7048,
+	0xb092, 0x704c, 0xb08e, 0x9284, 0x0300, 0x0904, 0xb30e, 0x9686,
+	0x0100, 0x1130, 0x7064, 0x9005, 0x1118, 0xc6c4, 0xb676, 0x0c38,
+	0x080c, 0x0feb, 0x090c, 0x0db4, 0x2900, 0xb07a, 0xb77c, 0x97bd,
+	0x0200, 0xb77e, 0xa867, 0x0103, 0xb068, 0xa86a, 0xb06c, 0xa86e,
+	0xb070, 0xa872, 0x7044, 0x9084, 0xf000, 0x9635, 0xae76, 0x968c,
+	0x0c00, 0x0120, 0x7348, 0xab92, 0x734c, 0xab8e, 0x968c, 0x00ff,
+	0x9186, 0x0002, 0x0180, 0x9186, 0x0028, 0x1118, 0xa87b, 0x001c,
+	0x0060, 0xd6dc, 0x0118, 0xa87b, 0x0015, 0x0038, 0xd6d4, 0x0118,
+	0xa87b, 0x0007, 0x0010, 0xa87b, 0x0000, 0xaf7e, 0xb080, 0xa882,
+	0xb084, 0xa886, 0x901e, 0xd6c4, 0x0190, 0x735c, 0xab86, 0x83ff,
+	0x0170, 0x938a, 0x0009, 0x0210, 0x2019, 0x0008, 0x0036, 0x2308,
+	0x2019, 0x0018, 0x2011, 0x0025, 0x080c, 0xb725, 0x003e, 0xd6cc,
+	0x01e8, 0x7154, 0xa98a, 0x81ff, 0x01c8, 0x9192, 0x0021, 0x1260,
+	0x8304, 0x9098, 0x0018, 0x2011, 0x0029, 0x080c, 0xb725, 0x2011,
+	0x0205, 0x2013, 0x0000, 0x0050, 0xb068, 0xd0fc, 0x0120, 0x2009,
+	0x0020, 0xa98a, 0x0c68, 0x2950, 0x080c, 0xb6c4, 0x080c, 0x18ed,
+	0x009e, 0x00ee, 0x00ae, 0x007e, 0x0005, 0x2001, 0x1958, 0x2004,
+	0x6042, 0x0096, 0x6114, 0x2148, 0xa83c, 0xa940, 0x9105, 0x1118,
+	0xa87c, 0xc0dc, 0xa87e, 0x6003, 0x0002, 0xa97c, 0xd1e4, 0x0904,
+	0xb441, 0x6043, 0x0000, 0x6010, 0x00b6, 0x2058, 0xb800, 0x00be,
+	0xd0bc, 0x1500, 0xd1cc, 0x0904, 0xb410, 0xa978, 0xa868, 0xd0fc,
+	0x0904, 0xb3d1, 0x0016, 0xa87c, 0x0006, 0xa880, 0x0006, 0x00a6,
+	0x2150, 0xb174, 0x9184, 0x00ff, 0x90b6, 0x0002, 0x0904, 0xb39f,
+	0x9086, 0x0028, 0x1904, 0xb38b, 0xa87b, 0x001c, 0xb07b, 0x001c,
+	0x0804, 0xb3a7, 0x6024, 0xd0f4, 0x11d0, 0xa838, 0xaa34, 0x9205,
+	0x09c8, 0xa838, 0xaa90, 0x9206, 0x1120, 0xa88c, 0xaa34, 0x9206,
+	0x0988, 0x6024, 0xd0d4, 0x1148, 0xa9ac, 0xa834, 0x9102, 0x603a,
+	0xa9b0, 0xa838, 0x9103, 0x603e, 0x6024, 0xc0f5, 0x6026, 0x6010,
+	0x00b6, 0x2058, 0xb83c, 0x8000, 0xb83e, 0x00be, 0x9006, 0xa876,
+	0xa892, 0xa88e, 0xa87c, 0xc0e4, 0xa87e, 0xd0cc, 0x0140, 0xc0cc,
+	0xa87e, 0x0096, 0xa878, 0x2048, 0x080c, 0x0f9d, 0x009e, 0x080c,
+	0xbe64, 0x0804, 0xb441, 0xd1dc, 0x0158, 0xa87b, 0x0015, 0xb07b,
+	0x0015, 0x080c, 0xc0f4, 0x0118, 0xb174, 0xc1dc, 0xb176, 0x0078,
+	0xd1d4, 0x0128, 0xa87b, 0x0007, 0xb07b, 0x0007, 0x0040, 0xa87c,
+	0xd0ac, 0x0128, 0xa834, 0xa938, 0x9115, 0x190c, 0xb23a, 0xa87c,
+	0xb07e, 0xa890, 0xb092, 0xa88c, 0xb08e, 0xa860, 0x20e8, 0xa85c,
+	0x9080, 0x0019, 0x20a0, 0x20a9, 0x0020, 0x8a06, 0x8006, 0x8007,
+	0x9094, 0x003f, 0x22e0, 0x9084, 0xffc0, 0x9080, 0x0019, 0x2098,
+	0x4003, 0x00ae, 0x000e, 0xa882, 0x000e, 0xa87e, 0x080c, 0xc1d1,
+	0x001e, 0xa874, 0x0006, 0x2148, 0x080c, 0x0f9d, 0x001e, 0x0804,
+	0xb43d, 0x0016, 0x00a6, 0x2150, 0xb174, 0x9184, 0x00ff, 0x90b6,
+	0x0002, 0x01e0, 0x9086, 0x0028, 0x1128, 0xa87b, 0x001c, 0xb07b,
+	0x001c, 0x00e0, 0xd1dc, 0x0158, 0xa87b, 0x0015, 0xb07b, 0x0015,
+	0x080c, 0xc0f4, 0x0118, 0xb174, 0xc1dc, 0xb176, 0x0078, 0xd1d4,
+	0x0128, 0xa87b, 0x0007, 0xb07b, 0x0007, 0x0040, 0xa87c, 0xd0ac,
+	0x0128, 0xa834, 0xa938, 0x9115, 0x190c, 0xb23a, 0xa890, 0xb092,
+	0xa88c, 0xb08e, 0xa87c, 0xb07e, 0x00ae, 0x080c, 0x0f9d, 0x009e,
+	0x080c, 0xc1d1, 0xa974, 0x0016, 0x080c, 0xb715, 0x001e, 0x0468,
+	0xa867, 0x0103, 0xa974, 0x9184, 0x00ff, 0x90b6, 0x0002, 0x01b0,
+	0x9086, 0x0028, 0x1118, 0xa87b, 0x001c, 0x00d0, 0xd1dc, 0x0148,
+	0xa87b, 0x0015, 0x080c, 0xc0f4, 0x0118, 0xa974, 0xc1dc, 0xa976,
+	0x0078, 0xd1d4, 0x0118, 0xa87b, 0x0007, 0x0050, 0xa87b, 0x0000,
+	0xa87c, 0xd0ac, 0x0128, 0xa834, 0xa938, 0x9115, 0x190c, 0xb23a,
+	0xa974, 0x0016, 0x080c, 0x66ac, 0x001e, 0xd1e4, 0x1120, 0x080c,
+	0x9e42, 0x009e, 0x0005, 0x080c, 0xbe2a, 0x0cd8, 0x6114, 0x0096,
+	0x2148, 0xa97c, 0xd1e4, 0x190c, 0x18fb, 0x009e, 0x0005, 0x080c,
+	0x8861, 0x0010, 0x080c, 0x891d, 0x080c, 0xbb2c, 0x01f0, 0x0096,
+	0x6114, 0x2148, 0x080c, 0xbd32, 0x1118, 0x080c, 0xa7d1, 0x00a0,
+	0xa867, 0x0103, 0x2009, 0x180c, 0x210c, 0xd18c, 0x11b8, 0xd184,
+	0x1190, 0x6108, 0xa97a, 0x918e, 0x0029, 0x1110, 0x080c, 0xd7f4,
+	0xa877, 0x0000, 0x080c, 0x6891, 0x009e, 0x080c, 0x9e42, 0x080c,
+	0x896d, 0x0804, 0x8a4a, 0xa87b, 0x0004, 0x0c90, 0xa87b, 0x0004,
+	0x0c78, 0x9182, 0x0054, 0x1220, 0x9182, 0x0040, 0x0208, 0x000a,
+	0x0005, 0xb49d, 0xb49d, 0xb49d, 0xb49d, 0xb49d, 0xb49f, 0xb49d,
+	0xb49d, 0xb49d, 0xb49d, 0xb49d, 0xb49d, 0xb49d, 0xb49d, 0xb49d,
+	0xb49d, 0xb49d, 0xb49d, 0xb49d, 0xb49d, 0x080c, 0x0db4, 0x080c,
+	0x5397, 0x01f8, 0x6014, 0x7144, 0x918c, 0x0fff, 0x9016, 0xd1c4,
+	0x0118, 0x7264, 0x9294, 0x00ff, 0x0096, 0x904d, 0x0188, 0xa87b,
+	0x0000, 0xa864, 0x9086, 0x0139, 0x0128, 0xa867, 0x0103, 0xa976,
+	0xaa96, 0x0030, 0xa897, 0x4000, 0xa99a, 0xaa9e, 0x080c, 0x6891,
+	0x009e, 0x0804, 0x9e42, 0x9182, 0x0085, 0x0002, 0xb4d5, 0xb4d3,
+	0xb4d3, 0xb4e1, 0xb4d3, 0xb4d3, 0xb4d3, 0xb4d3, 0xb4d3, 0xb4d3,
+	0xb4d3, 0xb4d3, 0xb4d3, 0x080c, 0x0db4, 0x6003, 0x0001, 0x6106,
+	0x080c, 0x83da, 0x0126, 0x2091, 0x8000, 0x080c, 0x896d, 0x012e,
+	0x0005, 0x0026, 0x0056, 0x00d6, 0x00e6, 0x2071, 0x0260, 0x7224,
+	0x6216, 0x7220, 0x080c, 0xbb1a, 0x01a0, 0x2268, 0x6800, 0x9086,
+	0x0000, 0x0178, 0x6010, 0x6d10, 0x952e, 0x1158, 0x00c6, 0x2d60,
+	0x080c, 0xb750, 0x00ce, 0x0128, 0x6803, 0x0002, 0x6007, 0x0086,
+	0x0010, 0x6007, 0x0087, 0x6003, 0x0001, 0x080c, 0x83da, 0x080c,
+	0x896d, 0x9280, 0x0004, 0x00b6, 0x2058, 0xb800, 0x00be, 0xd0bc,
+	0x0140, 0x6824, 0xd0ec, 0x0128, 0x00c6, 0x2260, 0x080c, 0xbe64,
+	0x00ce, 0x00ee, 0x00de, 0x005e, 0x002e, 0x0005, 0x9186, 0x0013,
+	0x1160, 0x6004, 0x908a, 0x0085, 0x0a0c, 0x0db4, 0x908a, 0x0092,
+	0x1a0c, 0x0db4, 0x9082, 0x0085, 0x00e2, 0x9186, 0x0027, 0x0120,
+	0x9186, 0x0014, 0x190c, 0x0db4, 0x080c, 0x8861, 0x0096, 0x6014,
+	0x2048, 0x080c, 0xbb2c, 0x0140, 0xa867, 0x0103, 0xa877, 0x0000,
+	0xa87b, 0x0029, 0x080c, 0x6891, 0x009e, 0x080c, 0x9e72, 0x0804,
+	0x896d, 0xb556, 0xb558, 0xb558, 0xb556, 0xb556, 0xb556, 0xb556,
+	0xb556, 0xb556, 0xb556, 0xb556, 0xb556, 0xb556, 0x080c, 0x0db4,
+	0x080c, 0x8861, 0x080c, 0x9e72, 0x080c, 0x896d, 0x0005, 0x9186,
+	0x0013, 0x1128, 0x6004, 0x9082, 0x0085, 0x2008, 0x04b8, 0x9186,
+	0x0027, 0x11f8, 0x080c, 0x8861, 0x080c, 0x2fdc, 0x080c, 0xc241,
+	0x0096, 0x6014, 0x2048, 0x080c, 0xbb2c, 0x0150, 0xa867, 0x0103,
+	0xa877, 0x0000, 0xa87b, 0x0029, 0x080c, 0x6891, 0x080c, 0xbd15,
+	0x009e, 0x080c, 0x9e42, 0x080c, 0x896d, 0x0005, 0x080c, 0x9ed7,
+	0x0ce0, 0x9186, 0x0014, 0x1dd0, 0x080c, 0x8861, 0x0096, 0x6014,
+	0x2048, 0x080c, 0xbb2c, 0x0d60, 0xa867, 0x0103, 0xa877, 0x0000,
+	0xa87b, 0x0006, 0xa880, 0xc0ec, 0xa882, 0x08f0, 0x0002, 0xb5ae,
+	0xb5ac, 0xb5ac, 0xb5ac, 0xb5ac, 0xb5ac, 0xb5c6, 0xb5ac, 0xb5ac,
+	0xb5ac, 0xb5ac, 0xb5ac, 0xb5ac, 0x080c, 0x0db4, 0x080c, 0x8861,
+	0x6034, 0x908c, 0xff00, 0x810f, 0x9186, 0x0039, 0x0118, 0x9186,
+	0x0035, 0x1118, 0x2001, 0x1956, 0x0010, 0x2001, 0x1957, 0x2004,
+	0x601a, 0x6003, 0x000c, 0x080c, 0x896d, 0x0005, 0x080c, 0x8861,
+	0x6034, 0x908c, 0xff00, 0x810f, 0x9186, 0x0039, 0x0118, 0x9186,
+	0x0035, 0x1118, 0x2001, 0x1956, 0x0010, 0x2001, 0x1957, 0x2004,
+	0x601a, 0x6003, 0x000e, 0x080c, 0x896d, 0x0005, 0x9182, 0x0092,
+	0x1220, 0x9182, 0x0085, 0x0208, 0x0012, 0x0804, 0x9ed7, 0xb5f4,
+	0xb5f4, 0xb5f4, 0xb5f4, 0xb5f6, 0xb643, 0xb5f4, 0xb5f4, 0xb5f4,
+	0xb5f4, 0xb5f4, 0xb5f4, 0xb5f4, 0x080c, 0x0db4, 0x0096, 0x6010,
+	0x00b6, 0x2058, 0xb800, 0x00be, 0xd0bc, 0x0168, 0x6034, 0x908c,
+	0xff00, 0x810f, 0x9186, 0x0039, 0x0118, 0x9186, 0x0035, 0x1118,
+	0x009e, 0x0804, 0xb657, 0x080c, 0xbb2c, 0x1118, 0x080c, 0xbd15,
+	0x0068, 0x6014, 0x2048, 0xa87c, 0xd0e4, 0x1110, 0x080c, 0xbd15,
+	0xa867, 0x0103, 0x080c, 0xc20c, 0x080c, 0x6891, 0x00d6, 0x2c68,
+	0x080c, 0x9dec, 0x01d0, 0x6003, 0x0001, 0x6007, 0x001e, 0x600b,
+	0xffff, 0x2009, 0x026e, 0x210c, 0x613a, 0x2009, 0x026f, 0x210c,
+	0x613e, 0x6910, 0x6112, 0x080c, 0xbfa6, 0x6954, 0x6156, 0x6023,
+	0x0001, 0x080c, 0x83da, 0x080c, 0x896d, 0x2d60, 0x00de, 0x080c,
+	0x9e42, 0x009e, 0x0005, 0x6010, 0x00b6, 0x2058, 0xb800, 0x00be,
+	0xd0bc, 0x05a0, 0x6034, 0x908c, 0xff00, 0x810f, 0x9186, 0x0035,
+	0x0130, 0x9186, 0x001e, 0x0118, 0x9186, 0x0039, 0x1538, 0x00d6,
+	0x2c68, 0x080c, 0xc1a4, 0x11f0, 0x080c, 0x9dec, 0x01d8, 0x6106,
+	0x6003, 0x0001, 0x6023, 0x0001, 0x6910, 0x6112, 0x692c, 0x612e,
+	0x6930, 0x6132, 0x6934, 0x918c, 0x00ff, 0x6136, 0x6938, 0x613a,
+	0x693c, 0x613e, 0x6954, 0x6156, 0x080c, 0xbfa6, 0x080c, 0x83da,
+	0x080c, 0x896d, 0x2d60, 0x00de, 0x0804, 0x9e42, 0x0096, 0x6014,
+	0x2048, 0x080c, 0xbb2c, 0x01c8, 0xa867, 0x0103, 0xa880, 0xd0b4,
+	0x0128, 0xc0ec, 0xa882, 0xa87b, 0x0006, 0x0048, 0xd0bc, 0x0118,
+	0xa87b, 0x0002, 0x0020, 0xa87b, 0x0005, 0x080c, 0xbe26, 0xa877,
+	0x0000, 0x080c, 0x6891, 0x080c, 0xbd15, 0x009e, 0x0804, 0x9e42,
+	0x0016, 0x0096, 0x6014, 0x2048, 0x080c, 0xbb2c, 0x0140, 0xa867,
+	0x0103, 0xa87b, 0x0028, 0xa877, 0x0000, 0x080c, 0x6891, 0x009e,
+	0x001e, 0x9186, 0x0013, 0x0148, 0x9186, 0x0014, 0x0130, 0x9186,
+	0x0027, 0x0118, 0x080c, 0x9ed7, 0x0030, 0x080c, 0x8861, 0x080c,
+	0x9e72, 0x080c, 0x896d, 0x0005, 0x0056, 0x0066, 0x0096, 0x00a6,
+	0x2029, 0x0001, 0x9182, 0x0101, 0x1208, 0x0010, 0x2009, 0x0100,
+	0x2130, 0x8304, 0x9098, 0x0018, 0x2009, 0x0020, 0x2011, 0x0029,
+	0x080c, 0xb725, 0x96b2, 0x0020, 0xb004, 0x904d, 0x0110, 0x080c,
+	0x0f9d, 0x080c, 0x0feb, 0x0520, 0x8528, 0xa867, 0x0110, 0xa86b,
+	0x0000, 0x2920, 0xb406, 0x968a, 0x003d, 0x1228, 0x2608, 0x2011,
+	0x001b, 0x0499, 0x00a8, 0x96b2, 0x003c, 0x2009, 0x003c, 0x2950,
+	0x2011, 0x001b, 0x0451, 0x0c28, 0x2001, 0x0205, 0x2003, 0x0000,
+	0x00ae, 0x852f, 0x95ad, 0x0003, 0xb566, 0x95ac, 0x0000, 0x0048,
+	0x2001, 0x0205, 0x2003, 0x0000, 0x00ae, 0x852f, 0x95ad, 0x0003,
+	0xb566, 0x009e, 0x006e, 0x005e, 0x0005, 0x00a6, 0x89ff, 0x0158,
+	0xa804, 0x9055, 0x0130, 0xa807, 0x0000, 0x080c, 0x6891, 0x2a48,
+	0x0cb8, 0x080c, 0x6891, 0x00ae, 0x0005, 0x00f6, 0x2079, 0x0200,
+	0x7814, 0x9085, 0x0080, 0x7816, 0xd184, 0x0108, 0x8108, 0x810c,
+	0x20a9, 0x0001, 0xa860, 0x20e8, 0xa85c, 0x9200, 0x20a0, 0x20e1,
+	0x0000, 0x2300, 0x9e00, 0x2098, 0x4003, 0x8318, 0x9386, 0x0020,
+	0x1148, 0x2018, 0x2300, 0x9e00, 0x2098, 0x7814, 0x8000, 0x9085,
+	0x0080, 0x7816, 0x8109, 0x1d80, 0x7817, 0x0000, 0x00fe, 0x0005,
+	0x0066, 0x0126, 0x2091, 0x8000, 0x2031, 0x0001, 0x6020, 0x9084,
+	0x000f, 0x0083, 0x012e, 0x006e, 0x0005, 0x0126, 0x2091, 0x8000,
+	0x0066, 0x2031, 0x0000, 0x6020, 0x9084, 0x000f, 0x001b, 0x006e,
+	0x012e, 0x0005, 0xb78b, 0xb78b, 0xb786, 0xb7ad, 0xb779, 0xb786,
+	0xb7ad, 0xb786, 0xb779, 0xb779, 0xb786, 0xb786, 0xb786, 0xb779,
+	0xb779, 0x080c, 0x0db4, 0x0036, 0x2019, 0x0010, 0x080c, 0xd106,
+	0x6023, 0x0006, 0x6003, 0x0007, 0x003e, 0x0005, 0x9006, 0x0005,
+	0x9085, 0x0001, 0x0005, 0x0096, 0x86ff, 0x11d8, 0x6014, 0x2048,
+	0x080c, 0xbb2c, 0x01c0, 0xa864, 0x9086, 0x0139, 0x1128, 0xa87b,
+	0x0005, 0xa883, 0x0000, 0x0028, 0x900e, 0x2001, 0x0005, 0x080c,
+	0x6abf, 0x080c, 0xbe26, 0x080c, 0x6884, 0x080c, 0x9e72, 0x9085,
+	0x0001, 0x009e, 0x0005, 0x9006, 0x0ce0, 0x6000, 0x908a, 0x0016,
+	0x1a0c, 0x0db4, 0x0002, 0xb7c3, 0xb7f1, 0xb7c5, 0xb812, 0xb7ec,
+	0xb7c3, 0xb786, 0xb78b, 0xb78b, 0xb786, 0xb786, 0xb786, 0xb786,
+	0xb786, 0xb786, 0xb786, 0x080c, 0x0db4, 0x86ff, 0x1510, 0x6020,
+	0x9086, 0x0006, 0x01f0, 0x0096, 0x6014, 0x2048, 0x080c, 0xbb2c,
+	0x0158, 0xa87c, 0xd0cc, 0x0130, 0x0096, 0xa878, 0x2048, 0x080c,
+	0x0f9d, 0x009e, 0x080c, 0xbe26, 0x009e, 0x080c, 0xc1e6, 0x6007,
+	0x0085, 0x6003, 0x000b, 0x6023, 0x0002, 0x080c, 0x83da, 0x080c,
+	0x896d, 0x9085, 0x0001, 0x0005, 0x0066, 0x080c, 0x190f, 0x006e,
+	0x08a0, 0x00e6, 0x2071, 0x19b7, 0x7024, 0x9c06, 0x1120, 0x080c,
+	0x9663, 0x00ee, 0x0850, 0x6020, 0x9084, 0x000f, 0x9086, 0x0006,
+	0x1150, 0x0086, 0x0096, 0x2049, 0x0001, 0x2c40, 0x080c, 0x97bb,
+	0x009e, 0x008e, 0x0010, 0x080c, 0x9560, 0x00ee, 0x1904, 0xb7c5,
+	0x0804, 0xb786, 0x0036, 0x00e6, 0x2071, 0x19b7, 0x703c, 0x9c06,
+	0x1138, 0x901e, 0x080c, 0x96d9, 0x00ee, 0x003e, 0x0804, 0xb7c5,
+	0x080c, 0x98eb, 0x00ee, 0x003e, 0x1904, 0xb7c5, 0x0804, 0xb786,
+	0x00c6, 0x6020, 0x9084, 0x000f, 0x0013, 0x00ce, 0x0005, 0xb845,
+	0xb910, 0xba77, 0xb84f, 0x9e72, 0xb845, 0xd0f8, 0xc24e, 0xb910,
+	0xb83e, 0xbaf6, 0xb83e, 0xb83e, 0xb83e, 0xb83e, 0x080c, 0x0db4,
+	0x080c, 0xbd32, 0x1110, 0x080c, 0xa7d1, 0x0005, 0x080c, 0x8861,
+	0x080c, 0x896d, 0x0804, 0x9e42, 0x601b, 0x0001, 0x0005, 0x080c,
+	0xbb2c, 0x0130, 0x6014, 0x0096, 0x2048, 0x2c00, 0xa896, 0x009e,
+	0x6000, 0x908a, 0x0016, 0x1a0c, 0x0db4, 0x0002, 0xb86e, 0xb870,
+	0xb894, 0xb8a8, 0xb8ce, 0xb86e, 0xb845, 0xb845, 0xb845, 0xb8a8,
+	0xb8a8, 0xb86e, 0xb86e, 0xb86e, 0xb86e, 0xb8b2, 0x080c, 0x0db4,
+	0x00e6, 0x6014, 0x0096, 0x2048, 0xa880, 0xc0b5, 0xa882, 0x009e,
+	0x2071, 0x19b7, 0x7024, 0x9c06, 0x01a0, 0x080c, 0x9560, 0x080c,
+	0xc1e6, 0x6007, 0x0085, 0x6003, 0x000b, 0x6023, 0x0002, 0x2001,
+	0x1957, 0x2004, 0x601a, 0x080c, 0x83da, 0x080c, 0x896d, 0x00ee,
+	0x0005, 0x601b, 0x0001, 0x0cd8, 0x0096, 0x6014, 0x2048, 0xa880,
+	0xc0b5, 0xa882, 0x009e, 0x080c, 0xc1e6, 0x6007, 0x0085, 0x6003,
+	0x000b, 0x6023, 0x0002, 0x080c, 0x83da, 0x080c, 0x896d, 0x0005,
+	0x0096, 0x601b, 0x0001, 0x6014, 0x2048, 0xa880, 0xc0b5, 0xa882,
+	0x009e, 0x0005, 0x080c, 0x5397, 0x01b8, 0x6014, 0x0096, 0x904d,
+	0x0190, 0xa864, 0xa867, 0x0103, 0xa87b, 0x0006, 0x9086, 0x0139,
+	0x1150, 0xa867, 0x0139, 0xa87b, 0x0030, 0xa897, 0x4005, 0xa89b,
+	0x0004, 0x080c, 0x6891, 0x009e, 0x0804, 0x9e42, 0x6014, 0x0096,
+	0x904d, 0x05c8, 0xa97c, 0xd1e4, 0x05b0, 0x2001, 0x180f, 0x2004,
+	0xd0c4, 0x0110, 0x009e, 0x0005, 0xa884, 0x009e, 0x8003, 0x800b,
+	0x810b, 0x9108, 0x611a, 0x2001, 0x0030, 0x2c08, 0x080c, 0x151a,
+	0x2001, 0x030c, 0x2004, 0x9086, 0x0041, 0x11a0, 0x6014, 0x0096,
+	0x904d, 0x090c, 0x0db4, 0xa880, 0xd0f4, 0x1130, 0xc0f5, 0xa882,
+	0x009e, 0x601b, 0x0002, 0x0070, 0x009e, 0x2001, 0x0037, 0x2c08,
+	0x080c, 0x151a, 0x6000, 0x9086, 0x0004, 0x1120, 0x2009, 0x0048,
+	0x080c, 0x9ebc, 0x0005, 0x009e, 0x080c, 0x190f, 0x0804, 0xb894,
+	0x6000, 0x908a, 0x0016, 0x1a0c, 0x0db4, 0x000b, 0x0005, 0xb927,
+	0xb84c, 0xb929, 0xb927, 0xb929, 0xb929, 0xb846, 0xb927, 0xb840,
+	0xb840, 0xb927, 0xb927, 0xb927, 0xb927, 0xb927, 0xb927, 0x080c,
+	0x0db4, 0x6010, 0x00b6, 0x2058, 0xb804, 0x9084, 0x00ff, 0x00be,
+	0x908a, 0x000c, 0x1a0c, 0x0db4, 0x00b6, 0x0013, 0x00be, 0x0005,
+	0xb944, 0xba11, 0xb946, 0xb986, 0xb946, 0xb986, 0xb946, 0xb954,
+	0xb944, 0xb986, 0xb944, 0xb975, 0x080c, 0x0db4, 0x6004, 0x908e,
+	0x0016, 0x05c0, 0x908e, 0x0004, 0x05a8, 0x908e, 0x0002, 0x0590,
+	0x908e, 0x0052, 0x0904, 0xba0d, 0x6004, 0x080c, 0xbd32, 0x0904,
+	0xba2a, 0x908e, 0x0004, 0x1110, 0x080c, 0x3005, 0x908e, 0x0021,
+	0x0904, 0xba2e, 0x908e, 0x0022, 0x0904, 0xba72, 0x908e, 0x003d,
+	0x0904, 0xba2e, 0x908e, 0x0039, 0x0904, 0xba32, 0x908e, 0x0035,
+	0x0904, 0xba32, 0x908e, 0x001e, 0x0178, 0x908e, 0x0001, 0x1140,
+	0x6010, 0x2058, 0xb804, 0x9084, 0x00ff, 0x9086, 0x0006, 0x0110,
+	0x080c, 0x2fdc, 0x080c, 0xa7d1, 0x0804, 0x9e72, 0x00c6, 0x00d6,
+	0x6104, 0x9186, 0x0016, 0x0904, 0xb9fe, 0x9186, 0x0002, 0x1904,
+	0xb9d3, 0x2001, 0x1836, 0x2004, 0xd08c, 0x11c8, 0x080c, 0x6f9b,
+	0x11b0, 0x080c, 0xc22c, 0x0138, 0x080c, 0x6fbe, 0x1120, 0x080c,
+	0x6eab, 0x0804, 0xba5b, 0x2001, 0x194d, 0x2003, 0x0001, 0x2001,
+	0x1800, 0x2003, 0x0001, 0x080c, 0x6ecd, 0x0804, 0xba5b, 0x6010,
+	0x2058, 0x2001, 0x1836, 0x2004, 0xd0ac, 0x1904, 0xba5b, 0xb8a0,
+	0x9084, 0xff80, 0x1904, 0xba5b, 0xb840, 0x9084, 0x00ff, 0x9005,
+	0x0190, 0x8001, 0xb842, 0x6017, 0x0000, 0x6023, 0x0007, 0x601b,
+	0x0398, 0x6043, 0x0000, 0x080c, 0x9dec, 0x0128, 0x2b00, 0x6012,
+	0x6023, 0x0001, 0x0458, 0x00de, 0x00ce, 0x6004, 0x908e, 0x0002,
+	0x11a0, 0x6010, 0x2058, 0xb8a0, 0x9086, 0x007e, 0x1170, 0x2009,
+	0x1836, 0x2104, 0xc085, 0x200a, 0x00e6, 0x2071, 0x1800, 0x080c,
+	0x5c6d, 0x00ee, 0x080c, 0xa7d1, 0x0030, 0x080c, 0xa7d1, 0x080c,
+	0x2fdc, 0x080c, 0xc241, 0x00e6, 0x0126, 0x2091, 0x8000, 0x080c,
+	0x3005, 0x012e, 0x00ee, 0x080c, 0x9e72, 0x0005, 0x2001, 0x0002,
+	0x080c, 0x6198, 0x6003, 0x0001, 0x6007, 0x0002, 0x080c, 0x8422,
+	0x080c, 0x896d, 0x00de, 0x00ce, 0x0c80, 0x080c, 0x3005, 0x0804,
+	0xb982, 0x00c6, 0x00d6, 0x6104, 0x9186, 0x0016, 0x0d38, 0x6010,
+	0x2058, 0xb840, 0x9084, 0x00ff, 0x9005, 0x0904, 0xb9d3, 0x8001,
+	0xb842, 0x6003, 0x0001, 0x080c, 0x8422, 0x080c, 0x896d, 0x00de,
+	0x00ce, 0x0898, 0x080c, 0xa7d1, 0x0804, 0xb984, 0x080c, 0xa80d,
+	0x0804, 0xb984, 0x00d6, 0x2c68, 0x6104, 0x080c, 0xc1a4, 0x00de,
+	0x0118, 0x080c, 0x9e42, 0x00f0, 0x6004, 0x8007, 0x6134, 0x918c,
+	0x00ff, 0x9105, 0x6036, 0x6007, 0x0085, 0x6003, 0x000b, 0x6023,
+	0x0002, 0x603c, 0x600a, 0x2001, 0x1957, 0x2004, 0x601a, 0x602c,
+	0x2c08, 0x2060, 0x6024, 0xc0b5, 0x6026, 0x2160, 0x080c, 0x83da,
+	0x080c, 0x896d, 0x0005, 0x00de, 0x00ce, 0x080c, 0xa7d1, 0x080c,
+	0x2fdc, 0x00e6, 0x0126, 0x2091, 0x8000, 0x080c, 0x3005, 0x6017,
+	0x0000, 0x6023, 0x0007, 0x601b, 0x0398, 0x6043, 0x0000, 0x012e,
+	0x00ee, 0x0005, 0x080c, 0xa272, 0x1904, 0xba2a, 0x0005, 0x6000,
+	0x908a, 0x0016, 0x1a0c, 0x0db4, 0x0096, 0x00d6, 0x001b, 0x00de,
+	0x009e, 0x0005, 0xba92, 0xba92, 0xba92, 0xba92, 0xba92, 0xba92,
+	0xba92, 0xba92, 0xba92, 0xb845, 0xba92, 0xb84c, 0xba94, 0xb84c,
+	0xbaa1, 0xba92, 0x080c, 0x0db4, 0x6004, 0x9086, 0x008b, 0x0148,
+	0x6007, 0x008b, 0x6003, 0x000d, 0x080c, 0x83da, 0x080c, 0x896d,
+	0x0005, 0x080c, 0xc220, 0x0118, 0x080c, 0xc233, 0x0010, 0x080c,
+	0xc241, 0x080c, 0xbd15, 0x080c, 0xbb2c, 0x0570, 0x080c, 0x2fdc,
+	0x080c, 0xbb2c, 0x0168, 0x6014, 0x2048, 0xa867, 0x0103, 0xa87b,
+	0x0006, 0xa877, 0x0000, 0xa880, 0xc0ed, 0xa882, 0x080c, 0x6891,
+	0x2c68, 0x080c, 0x9dec, 0x0150, 0x6810, 0x6012, 0x080c, 0xbfa6,
+	0x00c6, 0x2d60, 0x080c, 0x9e72, 0x00ce, 0x0008, 0x2d60, 0x6017,
+	0x0000, 0x6023, 0x0001, 0x6007, 0x0001, 0x6003, 0x0001, 0x080c,
+	0x8422, 0x080c, 0x896d, 0x00c8, 0x080c, 0xc220, 0x0138, 0x6034,
+	0x9086, 0x4000, 0x1118, 0x080c, 0x2fdc, 0x08d0, 0x6034, 0x908c,
+	0xff00, 0x810f, 0x9186, 0x0039, 0x0118, 0x9186, 0x0035, 0x1118,
+	0x080c, 0x2fdc, 0x0868, 0x080c, 0x9e72, 0x0005, 0x6000, 0x908a,
+	0x0016, 0x1a0c, 0x0db4, 0x0002, 0xbb0c, 0xbb0c, 0xbb0e, 0xbb0e,
+	0xbb0e, 0xbb0c, 0xbb0c, 0x9e72, 0xbb0c, 0xbb0c, 0xbb0c, 0xbb0c,
+	0xbb0c, 0xbb0c, 0xbb0c, 0xbb0c, 0x080c, 0x0db4, 0x080c, 0x98eb,
+	0x6114, 0x0096, 0x2148, 0xa87b, 0x0006, 0x080c, 0x6891, 0x009e,
+	0x0804, 0x9e42, 0x9284, 0x0007, 0x1158, 0x9282, 0x1cd0, 0x0240,
+	0x2001, 0x1819, 0x2004, 0x9202, 0x1218, 0x9085, 0x0001, 0x0005,
+	0x9006, 0x0ce8, 0x0096, 0x0028, 0x0096, 0x0006, 0x6014, 0x2048,
+	0x000e, 0x0006, 0x9984, 0xf000, 0x9086, 0xf000, 0x0110, 0x080c,
+	0x1096, 0x000e, 0x009e, 0x0005, 0x00e6, 0x00c6, 0x0036, 0x0006,
+	0x0126, 0x2091, 0x8000, 0x2061, 0x1cd0, 0x2071, 0x1800, 0x7350,
+	0x7070, 0x9302, 0x1640, 0x6020, 0x9206, 0x11f8, 0x080c, 0xc22c,
+	0x0180, 0x9286, 0x0001, 0x1168, 0x6004, 0x9086, 0x0004, 0x1148,
+	0x080c, 0x2fdc, 0x080c, 0xc241, 0x00c6, 0x080c, 0x9e72, 0x00ce,
+	0x0060, 0x080c, 0xbf20, 0x0148, 0x080c, 0xbd32, 0x1110, 0x080c,
+	0xa7d1, 0x00c6, 0x080c, 0x9e42, 0x00ce, 0x9ce0, 0x0018, 0x7064,
+	0x9c02, 0x1208, 0x08a0, 0x012e, 0x000e, 0x003e, 0x00ce, 0x00ee,
+	0x0005, 0x00e6, 0x00c6, 0x0016, 0x9188, 0x1000, 0x210c, 0x81ff,
+	0x0128, 0x2061, 0x1a7f, 0x6112, 0x080c, 0x2fdc, 0x9006, 0x0010,
+	0x9085, 0x0001, 0x001e, 0x00ce, 0x00ee, 0x0005, 0x00c6, 0x0126,
+	0x2091, 0x8000, 0x080c, 0x9dec, 0x01b0, 0x6656, 0x2b00, 0x6012,
+	0x080c, 0x5397, 0x0118, 0x080c, 0xbc59, 0x0168, 0x080c, 0xbfa6,
+	0x6023, 0x0003, 0x2009, 0x004b, 0x080c, 0x9ebc, 0x9085, 0x0001,
 	0x012e, 0x00ce, 0x0005, 0x9006, 0x0cd8, 0x00c6, 0x0126, 0x2091,
-	0x8000, 0x0016, 0x080c, 0x9ddc, 0x0180, 0x2b08, 0x6112, 0x080c,
-	0xbf8c, 0x6023, 0x0001, 0x2900, 0x6016, 0x001e, 0x080c, 0x9eac,
-	0x9085, 0x0001, 0x012e, 0x00ce, 0x0005, 0x001e, 0x9006, 0x0cd0,
-	0x0016, 0x0026, 0x0036, 0x0046, 0x0056, 0x0066, 0x0096, 0x00e6,
-	0x00f6, 0x2071, 0x1800, 0x9186, 0x0015, 0x1568, 0x718c, 0x6014,
-	0x2048, 0xa814, 0x8003, 0x9106, 0x1530, 0x20e1, 0x0000, 0x2001,
-	0x1971, 0x2003, 0x0000, 0x6014, 0x2048, 0xa830, 0x20a8, 0x8906,
-	0x8006, 0x8007, 0x9094, 0x003f, 0x22e8, 0x9084, 0xffc0, 0x9080,
-	0x001b, 0x20a0, 0x2001, 0x1971, 0x0016, 0x200c, 0x080c, 0xc7ce,
-	0x001e, 0xa804, 0x9005, 0x0110, 0x2048, 0x0c38, 0x6014, 0x2048,
-	0xa867, 0x0103, 0x0010, 0x080c, 0xa7c0, 0x080c, 0x9e32, 0x00fe,
-	0x00ee, 0x009e, 0x006e, 0x005e, 0x004e, 0x003e, 0x002e, 0x001e,
-	0x0005, 0x0096, 0x00e6, 0x00f6, 0x2071, 0x1800, 0x9186, 0x0015,
-	0x11b8, 0x708c, 0x9086, 0x0004, 0x1198, 0x6014, 0x2048, 0x2c78,
-	0x080c, 0x8b63, 0x01a8, 0x7078, 0xaa74, 0x9206, 0x1130, 0x707c,
-	0xaa78, 0x9206, 0x1110, 0x080c, 0x2fda, 0x080c, 0xa235, 0x0020,
-	0x080c, 0xa7c0, 0x080c, 0x9e32, 0x00fe, 0x00ee, 0x009e, 0x0005,
-	0x705c, 0xaa78, 0x9206, 0x0d78, 0x0c80, 0x0096, 0x00e6, 0x00f6,
-	0x2071, 0x1800, 0x9186, 0x0015, 0x1550, 0x708c, 0x9086, 0x0004,
-	0x1530, 0x6014, 0x2048, 0x2c78, 0x080c, 0x8b63, 0x05f0, 0x7078,
-	0xaacc, 0x9206, 0x1180, 0x707c, 0xaad0, 0x9206, 0x1160, 0x080c,
-	0x2fda, 0x0016, 0xa998, 0xaab0, 0x9284, 0x1000, 0xc0fd, 0x080c,
-	0x533e, 0x001e, 0x0010, 0x080c, 0x512f, 0x080c, 0xbb17, 0x0508,
-	0xa87b, 0x0000, 0xa883, 0x0000, 0xa897, 0x4000, 0x0080, 0x080c,
-	0xbb17, 0x01b8, 0x6014, 0x2048, 0x080c, 0x512f, 0x1d70, 0xa87b,
-	0x0030, 0xa883, 0x0000, 0xa897, 0x4005, 0xa89b, 0x0004, 0x0126,
-	0x2091, 0x8000, 0xa867, 0x0139, 0x080c, 0x688c, 0x012e, 0x080c,
-	0x9e32, 0x00fe, 0x00ee, 0x009e, 0x0005, 0x705c, 0xaad0, 0x9206,
-	0x0930, 0x0888, 0x0016, 0x0026, 0xa87c, 0xd0ac, 0x0178, 0xa938,
-	0xaa34, 0x2100, 0x9205, 0x0150, 0xa890, 0x9106, 0x1118, 0xa88c,
-	0x9206, 0x0120, 0xa992, 0xaa8e, 0x9085, 0x0001, 0x002e, 0x001e,
-	0x0005, 0x00b6, 0x00d6, 0x0036, 0x080c, 0xbb17, 0x0904, 0xc147,
-	0x0096, 0x6314, 0x2348, 0xa87a, 0xa982, 0x929e, 0x4000, 0x1580,
-	0x6310, 0x00c6, 0x2358, 0x2009, 0x0000, 0xa868, 0xd0f4, 0x1140,
-	0x080c, 0x645e, 0x1108, 0xc185, 0xb800, 0xd0bc, 0x0108, 0xc18d,
-	0xaa96, 0xa99a, 0x20a9, 0x0004, 0xa860, 0x20e8, 0xa85c, 0x9080,
-	0x0031, 0x20a0, 0xb8b4, 0x20e0, 0xb8b8, 0x9080, 0x0006, 0x2098,
-	0x080c, 0x0f68, 0x20a9, 0x0004, 0xa85c, 0x9080, 0x0035, 0x20a0,
-	0xb8b8, 0x9080, 0x000a, 0x2098, 0x080c, 0x0f68, 0x00ce, 0x0090,
-	0xaa96, 0x3918, 0x9398, 0x0007, 0x231c, 0x6004, 0x9086, 0x0016,
-	0x0110, 0xa89b, 0x0004, 0xaba2, 0x6310, 0x2358, 0xb804, 0x9084,
-	0x00ff, 0xa89e, 0x080c, 0x687f, 0x6017, 0x0000, 0x009e, 0x003e,
-	0x00de, 0x00be, 0x0005, 0x0026, 0x0036, 0x0046, 0x00b6, 0x0096,
-	0x00f6, 0x6214, 0x2248, 0x6210, 0x2258, 0x2079, 0x0260, 0x9096,
-	0x0000, 0x11a0, 0xb814, 0x9084, 0x00ff, 0x900e, 0x080c, 0x2663,
-	0x2118, 0x831f, 0x939c, 0xff00, 0x7838, 0x9084, 0x00ff, 0x931d,
-	0x7c3c, 0x2011, 0x8018, 0x080c, 0x48d9, 0x00a8, 0x9096, 0x0001,
-	0x1148, 0x89ff, 0x0180, 0xa89b, 0x000d, 0x7838, 0xa8a6, 0x783c,
-	0xa8aa, 0x0048, 0x9096, 0x0002, 0x1130, 0xa89b, 0x000d, 0x7838,
-	0xa8a6, 0x783c, 0xa8aa, 0x00fe, 0x009e, 0x00be, 0x004e, 0x003e,
-	0x002e, 0x0005, 0x00c6, 0x0026, 0x0016, 0x9186, 0x0035, 0x0110,
-	0x6a38, 0x0008, 0x6a2c, 0x080c, 0xbb05, 0x01f0, 0x2260, 0x6120,
-	0x9186, 0x0003, 0x0118, 0x9186, 0x0006, 0x1190, 0x6838, 0x9206,
-	0x0140, 0x683c, 0x9206, 0x1160, 0x6108, 0x6838, 0x9106, 0x1140,
-	0x0020, 0x6008, 0x693c, 0x9106, 0x1118, 0x6010, 0x6910, 0x9106,
-	0x001e, 0x002e, 0x00ce, 0x0005, 0x9085, 0x0001, 0x0cc8, 0xa974,
-	0xd1cc, 0x0188, 0x918c, 0x00ff, 0x918e, 0x0002, 0x1160, 0xa9a8,
-	0x918c, 0x0f00, 0x810f, 0x918e, 0x0001, 0x1128, 0xa834, 0xa938,
-	0x9115, 0x190c, 0xb227, 0x0005, 0x0036, 0x2019, 0x0001, 0x0010,
-	0x0036, 0x901e, 0x0499, 0x01e0, 0x080c, 0xbb17, 0x01c8, 0x080c,
-	0xbd00, 0x6037, 0x4000, 0x6014, 0x6017, 0x0000, 0x0096, 0x2048,
-	0xa87c, 0x080c, 0xbd1d, 0x1118, 0x080c, 0xa7c0, 0x0040, 0xa867,
-	0x0103, 0xa877, 0x0000, 0x83ff, 0x1129, 0x080c, 0x688c, 0x009e,
-	0x003e, 0x0005, 0xa880, 0xd0b4, 0x0128, 0xa87b, 0x0006, 0xc0ec,
-	0xa882, 0x0048, 0xd0bc, 0x0118, 0xa87b, 0x0002, 0x0020, 0xa87b,
-	0x0005, 0x080c, 0xbe0c, 0xa877, 0x0000, 0x0005, 0x2001, 0x1810,
-	0x2004, 0xd0ec, 0x0005, 0x0006, 0x2001, 0x1810, 0x2004, 0xd0f4,
-	0x000e, 0x0005, 0x0006, 0x2001, 0x1810, 0x2004, 0xd0e4, 0x000e,
-	0x0005, 0x0036, 0x0046, 0x6010, 0x00b6, 0x2058, 0xbba0, 0x00be,
-	0x2021, 0x0007, 0x080c, 0x4a76, 0x004e, 0x003e, 0x0005, 0x0c51,
-	0x1d81, 0x0005, 0x2001, 0x1957, 0x2004, 0x601a, 0x0005, 0x2001,
-	0x1959, 0x2004, 0x6042, 0x0005, 0x080c, 0x9e32, 0x0804, 0x8973,
-	0x00b6, 0x0066, 0x6000, 0x90b2, 0x0016, 0x1a0c, 0x0db4, 0x001b,
-	0x006e, 0x00be, 0x0005, 0xc253, 0xc92b, 0xca86, 0xc253, 0xc253,
-	0xc253, 0xc253, 0xc253, 0xc28a, 0xcb08, 0xc253, 0xc253, 0xc253,
-	0xc253, 0xc253, 0xc253, 0x080c, 0x0db4, 0x0066, 0x6000, 0x90b2,
-	0x0016, 0x1a0c, 0x0db4, 0x0013, 0x006e, 0x0005, 0xc26e, 0xd070,
-	0xc26e, 0xc26e, 0xc26e, 0xc26e, 0xc26e, 0xc26e, 0xd01d, 0xd0c4,
-	0xc26e, 0xd6b4, 0xd6ea, 0xd6b4, 0xd6ea, 0xc26e, 0x080c, 0x0db4,
-	0x6000, 0x9082, 0x0016, 0x1a0c, 0x0db4, 0x6000, 0x000a, 0x0005,
-	0xc288, 0xcce5, 0xcdd5, 0xcdf7, 0xceb6, 0xc288, 0xcf94, 0xcf3e,
-	0xcb14, 0xcff3, 0xd008, 0xc288, 0xc288, 0xc288, 0xc288, 0xc288,
-	0x080c, 0x0db4, 0x91b2, 0x0053, 0x1a0c, 0x0db4, 0x2100, 0x91b2,
-	0x0040, 0x1a04, 0xc6cc, 0x0002, 0xc2d4, 0xc4bd, 0xc2d4, 0xc2d4,
-	0xc2d4, 0xc4c6, 0xc2d4, 0xc2d4, 0xc2d4, 0xc2d4, 0xc2d4, 0xc2d4,
-	0xc2d4, 0xc2d4, 0xc2d4, 0xc2d4, 0xc2d4, 0xc2d4, 0xc2d4, 0xc2d4,
-	0xc2d4, 0xc2d4, 0xc2d4, 0xc2d6, 0xc339, 0xc348, 0xc3ac, 0xc3d7,
-	0xc44f, 0xc4a8, 0xc2d4, 0xc2d4, 0xc4c9, 0xc2d4, 0xc2d4, 0xc4de,
-	0xc4eb, 0xc2d4, 0xc2d4, 0xc2d4, 0xc2d4, 0xc2d4, 0xc56e, 0xc2d4,
-	0xc2d4, 0xc582, 0xc2d4, 0xc2d4, 0xc53d, 0xc2d4, 0xc2d4, 0xc2d4,
-	0xc59a, 0xc2d4, 0xc2d4, 0xc2d4, 0xc617, 0xc2d4, 0xc2d4, 0xc2d4,
-	0xc2d4, 0xc2d4, 0xc2d4, 0xc694, 0x080c, 0x0db4, 0x080c, 0x6520,
-	0x1150, 0x2001, 0x1836, 0x2004, 0xd0cc, 0x1128, 0x9084, 0x0009,
-	0x9086, 0x0008, 0x1140, 0x6007, 0x0009, 0x602f, 0x0009, 0x6017,
-	0x0000, 0x0804, 0xc4b6, 0x080c, 0x6509, 0x00e6, 0x00c6, 0x0036,
-	0x0026, 0x0016, 0x6210, 0x2258, 0xbaa0, 0x0026, 0x2019, 0x0029,
-	0x080c, 0x8571, 0x0076, 0x903e, 0x080c, 0x8469, 0x2c08, 0x080c,
-	0xd29b, 0x007e, 0x001e, 0x001e, 0x002e, 0x003e, 0x00ce, 0x00ee,
-	0x6610, 0x2658, 0x080c, 0x624d, 0xbe04, 0x9684, 0x00ff, 0x9082,
-	0x0006, 0x1268, 0x0016, 0x0026, 0x6210, 0x00b6, 0x2258, 0xbaa0,
-	0x00be, 0x2c08, 0x080c, 0xd862, 0x002e, 0x001e, 0x1178, 0x080c,
-	0xd1ce, 0x1904, 0xc3a4, 0x080c, 0xd16a, 0x1120, 0x6007, 0x0008,
-	0x0804, 0xc4b6, 0x6007, 0x0009, 0x0804, 0xc4b6, 0x080c, 0xd3c5,
-	0x0128, 0x080c, 0xd1ce, 0x0d78, 0x0804, 0xc3a4, 0x6017, 0x1900,
-	0x0c88, 0x080c, 0x30fd, 0x1904, 0xc6c9, 0x6106, 0x080c, 0xd11f,
-	0x6007, 0x0006, 0x0804, 0xc4b6, 0x6007, 0x0007, 0x0804, 0xc4b6,
-	0x080c, 0xd726, 0x1904, 0xc6c9, 0x080c, 0x30fd, 0x1904, 0xc6c9,
-	0x00d6, 0x6610, 0x2658, 0xbe04, 0x9684, 0x00ff, 0x9082, 0x0006,
-	0x1220, 0x2001, 0x0001, 0x080c, 0x617b, 0x96b4, 0xff00, 0x8637,
-	0x9686, 0x0006, 0x0188, 0x9686, 0x0004, 0x0170, 0xbe04, 0x96b4,
-	0x00ff, 0x9686, 0x0006, 0x0140, 0x9686, 0x0004, 0x0128, 0x9686,
-	0x0005, 0x0110, 0x00de, 0x0480, 0x00e6, 0x2071, 0x0260, 0x7034,
-	0x9084, 0x0003, 0x1140, 0x7034, 0x9082, 0x0014, 0x0220, 0x7030,
-	0x9084, 0x0003, 0x0130, 0x00ee, 0x6017, 0x0000, 0x602f, 0x0007,
-	0x00b0, 0x00ee, 0x080c, 0xd231, 0x1190, 0x9686, 0x0006, 0x1140,
-	0x0026, 0x6210, 0x2258, 0xbaa0, 0x900e, 0x080c, 0x3023, 0x002e,
-	0x080c, 0x62d9, 0x6007, 0x000a, 0x00de, 0x0804, 0xc4b6, 0x6007,
-	0x000b, 0x00de, 0x0804, 0xc4b6, 0x080c, 0x2fda, 0x080c, 0xc227,
-	0x6007, 0x0001, 0x0804, 0xc4b6, 0x080c, 0xd726, 0x1904, 0xc6c9,
-	0x080c, 0x30fd, 0x1904, 0xc6c9, 0x2071, 0x0260, 0x7034, 0x90b4,
-	0x0003, 0x1948, 0x90b2, 0x0014, 0x0a30, 0x7030, 0x9084, 0x0003,
-	0x1910, 0x6610, 0x2658, 0xbe04, 0x9686, 0x0707, 0x09e8, 0x0026,
-	0x6210, 0x2258, 0xbaa0, 0x900e, 0x080c, 0x3023, 0x002e, 0x6007,
-	0x000c, 0x2001, 0x0001, 0x080c, 0xd842, 0x0804, 0xc4b6, 0x080c,
-	0x6520, 0x1140, 0x2001, 0x1836, 0x2004, 0x9084, 0x0009, 0x9086,
-	0x0008, 0x1110, 0x0804, 0xc2e3, 0x080c, 0x6509, 0x6610, 0x2658,
-	0xbe04, 0x9684, 0x00ff, 0x9082, 0x0006, 0x06c0, 0x1138, 0x0026,
-	0x2001, 0x0006, 0x080c, 0x61bb, 0x002e, 0x0050, 0x96b4, 0xff00,
-	0x8637, 0x9686, 0x0004, 0x0120, 0x9686, 0x0006, 0x1904, 0xc3a4,
-	0x080c, 0xd23e, 0x1120, 0x6007, 0x000e, 0x0804, 0xc4b6, 0x0046,
-	0x6410, 0x2458, 0xbca0, 0x0046, 0x080c, 0x2fda, 0x080c, 0xc227,
-	0x004e, 0x0016, 0x9006, 0x2009, 0x1854, 0x210c, 0x0048, 0x2009,
-	0x0029, 0x080c, 0xd52a, 0x6010, 0x2058, 0xb800, 0xc0e5, 0xb802,
-	0x001e, 0x004e, 0x6007, 0x0001, 0x0804, 0xc4b6, 0x2001, 0x0001,
-	0x080c, 0x617b, 0x0156, 0x0016, 0x0026, 0x0036, 0x20a9, 0x0004,
-	0x2019, 0x1805, 0x2011, 0x0270, 0x080c, 0xadf9, 0x003e, 0x002e,
-	0x001e, 0x015e, 0x9005, 0x0168, 0x96b4, 0xff00, 0x8637, 0x9682,
-	0x0004, 0x0a04, 0xc3a4, 0x9682, 0x0007, 0x0a04, 0xc400, 0x0804,
-	0xc3a4, 0x6017, 0x1900, 0x6007, 0x0009, 0x0804, 0xc4b6, 0x080c,
-	0x6520, 0x1140, 0x2001, 0x1836, 0x2004, 0x9084, 0x0009, 0x9086,
-	0x0008, 0x1110, 0x0804, 0xc2e3, 0x080c, 0x6509, 0x6610, 0x2658,
-	0xbe04, 0x9684, 0x00ff, 0x9082, 0x0006, 0x0690, 0x0150, 0x96b4,
-	0xff00, 0x8637, 0x9686, 0x0004, 0x0120, 0x9686, 0x0006, 0x1904,
-	0xc3a4, 0x080c, 0xd26c, 0x1130, 0x080c, 0xd16a, 0x1118, 0x6007,
-	0x0010, 0x04e0, 0x0046, 0x6410, 0x2458, 0xbca0, 0x0046, 0x080c,
-	0x2fda, 0x080c, 0xc227, 0x004e, 0x0016, 0x9006, 0x2009, 0x1854,
-	0x210c, 0x0048, 0x2009, 0x0029, 0x080c, 0xd52a, 0x6010, 0x2058,
-	0xb800, 0xc0e5, 0xb802, 0x001e, 0x004e, 0x6007, 0x0001, 0x00f0,
-	0x080c, 0xd3c5, 0x0140, 0x96b4, 0xff00, 0x8637, 0x9686, 0x0006,
-	0x0980, 0x0804, 0xc3a4, 0x6017, 0x1900, 0x6007, 0x0009, 0x0070,
-	0x080c, 0x30fd, 0x1904, 0xc6c9, 0x080c, 0xd726, 0x1904, 0xc6c9,
-	0x080c, 0xc869, 0x1904, 0xc3a4, 0x6007, 0x0012, 0x6003, 0x0001,
-	0x080c, 0x8439, 0x080c, 0x8973, 0x0005, 0x6007, 0x0001, 0x6003,
-	0x0001, 0x080c, 0x8439, 0x080c, 0x8973, 0x0cb0, 0x6007, 0x0005,
-	0x0c68, 0x080c, 0xd726, 0x1904, 0xc6c9, 0x080c, 0x30fd, 0x1904,
-	0xc6c9, 0x080c, 0xc869, 0x1904, 0xc3a4, 0x6007, 0x0020, 0x6003,
-	0x0001, 0x080c, 0x8439, 0x080c, 0x8973, 0x0005, 0x080c, 0x30fd,
-	0x1904, 0xc6c9, 0x6007, 0x0023, 0x6003, 0x0001, 0x080c, 0x8439,
-	0x080c, 0x8973, 0x0005, 0x080c, 0xd726, 0x1904, 0xc6c9, 0x080c,
-	0x30fd, 0x1904, 0xc6c9, 0x080c, 0xc869, 0x1904, 0xc3a4, 0x0016,
-	0x0026, 0x00e6, 0x2071, 0x0260, 0x7244, 0x9286, 0xffff, 0x0180,
-	0x2c08, 0x080c, 0xbb05, 0x01b0, 0x2260, 0x7240, 0x6008, 0x9206,
-	0x1188, 0x6010, 0x9190, 0x0004, 0x2214, 0x9206, 0x01b8, 0x0050,
-	0x7240, 0x2c08, 0x9006, 0x080c, 0xd4fc, 0x1180, 0x7244, 0x9286,
-	0xffff, 0x01b0, 0x2160, 0x6007, 0x0026, 0x6017, 0x1700, 0x7214,
-	0x9296, 0xffff, 0x1180, 0x6007, 0x0025, 0x0068, 0x6020, 0x9086,
-	0x0007, 0x1d80, 0x6004, 0x9086, 0x0024, 0x1110, 0x080c, 0x9e32,
-	0x2160, 0x6007, 0x0025, 0x6003, 0x0001, 0x080c, 0x8439, 0x080c,
-	0x8973, 0x00ee, 0x002e, 0x001e, 0x0005, 0x2001, 0x0001, 0x080c,
-	0x617b, 0x0156, 0x0016, 0x0026, 0x0036, 0x20a9, 0x0004, 0x2019,
-	0x1805, 0x2011, 0x0276, 0x080c, 0xadf9, 0x003e, 0x002e, 0x001e,
-	0x015e, 0x0120, 0x6007, 0x0031, 0x0804, 0xc4b6, 0x080c, 0xaa61,
-	0x080c, 0x6fb2, 0x1190, 0x0006, 0x0026, 0x0036, 0x080c, 0x6fcc,
-	0x1138, 0x080c, 0x7296, 0x080c, 0x5cd1, 0x080c, 0x6ee4, 0x0010,
-	0x080c, 0x6f8a, 0x003e, 0x002e, 0x000e, 0x0005, 0x080c, 0x30fd,
-	0x1904, 0xc6c9, 0x080c, 0xc869, 0x1904, 0xc3a4, 0x6106, 0x080c,
-	0xc885, 0x1120, 0x6007, 0x002b, 0x0804, 0xc4b6, 0x6007, 0x002c,
-	0x0804, 0xc4b6, 0x080c, 0xd726, 0x1904, 0xc6c9, 0x080c, 0x30fd,
-	0x1904, 0xc6c9, 0x080c, 0xc869, 0x1904, 0xc3a4, 0x6106, 0x080c,
-	0xc88a, 0x1120, 0x6007, 0x002e, 0x0804, 0xc4b6, 0x6007, 0x002f,
-	0x0804, 0xc4b6, 0x080c, 0x30fd, 0x1904, 0xc6c9, 0x00e6, 0x00d6,
-	0x00c6, 0x6010, 0x2058, 0xb904, 0x9184, 0x00ff, 0x9086, 0x0006,
-	0x0158, 0x9184, 0xff00, 0x8007, 0x9086, 0x0006, 0x0128, 0x00ce,
-	0x00de, 0x00ee, 0x0804, 0xc4bd, 0x080c, 0x538a, 0xd0e4, 0x0904,
-	0xc614, 0x2071, 0x026c, 0x7010, 0x603a, 0x7014, 0x603e, 0x7108,
-	0x720c, 0x080c, 0x655e, 0x0140, 0x6010, 0x2058, 0xb810, 0x9106,
-	0x1118, 0xb814, 0x9206, 0x0510, 0x080c, 0x655a, 0x15b8, 0x2069,
-	0x1800, 0x687c, 0x9206, 0x1590, 0x6878, 0x9106, 0x1578, 0x7210,
-	0x080c, 0xbb05, 0x0590, 0x080c, 0xc754, 0x0578, 0x080c, 0xd5a6,
-	0x0560, 0x622e, 0x6007, 0x0036, 0x6003, 0x0001, 0x080c, 0x83f1,
-	0x080c, 0x8973, 0x00ce, 0x00de, 0x00ee, 0x0005, 0x7214, 0x9286,
-	0xffff, 0x0150, 0x080c, 0xbb05, 0x01c0, 0x9280, 0x0002, 0x2004,
-	0x7110, 0x9106, 0x1190, 0x08e0, 0x7210, 0x2c08, 0x9085, 0x0001,
-	0x080c, 0xd4fc, 0x2c10, 0x2160, 0x0140, 0x0890, 0x6007, 0x0037,
-	0x602f, 0x0009, 0x6017, 0x1500, 0x08b8, 0x6007, 0x0037, 0x602f,
-	0x0003, 0x6017, 0x1700, 0x0880, 0x6007, 0x0012, 0x0868, 0x080c,
-	0x30fd, 0x1904, 0xc6c9, 0x6010, 0x2058, 0xb804, 0x9084, 0xff00,
-	0x8007, 0x9086, 0x0006, 0x1904, 0xc4bd, 0x00e6, 0x00d6, 0x00c6,
-	0x080c, 0x538a, 0xd0e4, 0x0904, 0xc68c, 0x2069, 0x1800, 0x2071,
-	0x026c, 0x7008, 0x603a, 0x720c, 0x623e, 0x9286, 0xffff, 0x1150,
-	0x7208, 0x00c6, 0x2c08, 0x9085, 0x0001, 0x080c, 0xd4fc, 0x2c10,
-	0x00ce, 0x05e8, 0x080c, 0xbb05, 0x05d0, 0x7108, 0x9280, 0x0002,
-	0x2004, 0x9106, 0x15a0, 0x00c6, 0x0026, 0x2260, 0x080c, 0xb73d,
-	0x002e, 0x00ce, 0x7118, 0x918c, 0xff00, 0x810f, 0x9186, 0x0001,
-	0x0178, 0x9186, 0x0005, 0x0118, 0x9186, 0x0007, 0x1198, 0x9280,
-	0x0005, 0x2004, 0x9005, 0x0170, 0x080c, 0xc754, 0x0904, 0xc60d,
-	0x0056, 0x7510, 0x7614, 0x080c, 0xd5bf, 0x005e, 0x00ce, 0x00de,
-	0x00ee, 0x0005, 0x6007, 0x003b, 0x602f, 0x0009, 0x6017, 0x2a00,
-	0x6003, 0x0001, 0x080c, 0x83f1, 0x080c, 0x8973, 0x0c78, 0x6007,
-	0x003b, 0x602f, 0x0003, 0x6017, 0x0300, 0x6003, 0x0001, 0x080c,
-	0x83f1, 0x080c, 0x8973, 0x0c10, 0x6007, 0x003b, 0x602f, 0x000b,
-	0x6017, 0x0000, 0x0804, 0xc5e4, 0x00e6, 0x0026, 0x080c, 0x6520,
-	0x0550, 0x080c, 0x6509, 0x080c, 0xd798, 0x1518, 0x2071, 0x1800,
-	0x70d8, 0x9085, 0x0003, 0x70da, 0x00f6, 0x2079, 0x0100, 0x72ac,
-	0x9284, 0x00ff, 0x707a, 0x78e6, 0x9284, 0xff00, 0x727c, 0x9205,
-	0x707e, 0x78ea, 0x00fe, 0x70e3, 0x0000, 0x080c, 0x655e, 0x0120,
-	0x2011, 0x19d1, 0x2013, 0x07d0, 0xd0ac, 0x1128, 0x080c, 0x2dbb,
-	0x0010, 0x080c, 0xd7ca, 0x002e, 0x00ee, 0x080c, 0x9e32, 0x0804,
-	0xc4bc, 0x080c, 0x9e32, 0x0005, 0x2600, 0x0002, 0xc6e0, 0xc6e0,
-	0xc6e0, 0xc6e0, 0xc6e0, 0xc6e2, 0xc6e0, 0xc6e0, 0xc6e0, 0xc6e0,
-	0xc6ff, 0xc6e0, 0xc6e0, 0xc6e0, 0xc711, 0xc71e, 0xc74f, 0xc6e0,
-	0x080c, 0x0db4, 0x080c, 0xd726, 0x1d20, 0x080c, 0x30fd, 0x1d08,
-	0x080c, 0xc869, 0x1148, 0x7038, 0x6016, 0x6007, 0x0045, 0x6003,
-	0x0001, 0x080c, 0x8439, 0x0005, 0x080c, 0x2fda, 0x080c, 0xc227,
-	0x6007, 0x0001, 0x6003, 0x0001, 0x080c, 0x8439, 0x0005, 0x080c,
-	0xd726, 0x1938, 0x080c, 0x30fd, 0x1920, 0x080c, 0xc869, 0x1d60,
-	0x703c, 0x6016, 0x6007, 0x004a, 0x6003, 0x0001, 0x080c, 0x8439,
-	0x0005, 0x080c, 0xc771, 0x0904, 0xc6c9, 0x6007, 0x004e, 0x6003,
-	0x0001, 0x080c, 0x8439, 0x080c, 0x8973, 0x0005, 0x6007, 0x004f,
-	0x6017, 0x0000, 0x7134, 0x918c, 0x00ff, 0x81ff, 0x0508, 0x9186,
-	0x0001, 0x1160, 0x7140, 0x2001, 0x198e, 0x2004, 0x9106, 0x11b0,
-	0x7144, 0x2001, 0x198f, 0x2004, 0x9106, 0x0190, 0x9186, 0x0002,
-	0x1168, 0x2011, 0x0276, 0x20a9, 0x0004, 0x6010, 0x0096, 0x2048,
-	0x2019, 0x000a, 0x080c, 0xae0d, 0x009e, 0x0110, 0x6017, 0x0001,
-	0x6003, 0x0001, 0x080c, 0x8439, 0x080c, 0x8973, 0x0005, 0x6007,
-	0x0050, 0x703c, 0x6016, 0x0ca0, 0x0016, 0x00e6, 0x2071, 0x0260,
-	0x00b6, 0x00c6, 0x2260, 0x6010, 0x2058, 0xb8bc, 0xd084, 0x0150,
-	0x7128, 0x6048, 0x9106, 0x1120, 0x712c, 0x6044, 0x9106, 0x0110,
-	0x9006, 0x0010, 0x9085, 0x0001, 0x00ce, 0x00be, 0x00ee, 0x001e,
-	0x0005, 0x0016, 0x0096, 0x0086, 0x00e6, 0x01c6, 0x01d6, 0x0126,
-	0x2091, 0x8000, 0x2071, 0x1800, 0x708c, 0x908a, 0x00f9, 0x16e8,
-	0x20e1, 0x0000, 0x2001, 0x1971, 0x2003, 0x0000, 0x080c, 0x1004,
-	0x05a0, 0x2900, 0x6016, 0x708c, 0x8004, 0xa816, 0x908a, 0x001e,
-	0x02d0, 0xa833, 0x001e, 0x20a9, 0x001e, 0xa860, 0x20e8, 0xa85c,
-	0x9080, 0x001b, 0x20a0, 0x2001, 0x1971, 0x0016, 0x200c, 0x0471,
-	0x001e, 0x2940, 0x080c, 0x1004, 0x01c0, 0x2900, 0xa006, 0x2100,
-	0x81ff, 0x0180, 0x0c18, 0xa832, 0x20a8, 0xa860, 0x20e8, 0xa85c,
-	0x9080, 0x001b, 0x20a0, 0x2001, 0x1971, 0x0016, 0x200c, 0x00b1,
-	0x001e, 0x0000, 0x9085, 0x0001, 0x0048, 0x2071, 0x1800, 0x708f,
-	0x0000, 0x6014, 0x2048, 0x080c, 0x0f9d, 0x9006, 0x012e, 0x01de,
-	0x01ce, 0x00ee, 0x008e, 0x009e, 0x001e, 0x0005, 0x0006, 0x0016,
-	0x0026, 0x0036, 0x00c6, 0x918c, 0xffff, 0x11a8, 0x080c, 0x2241,
-	0x2099, 0x026c, 0x2001, 0x0014, 0x3518, 0x9312, 0x1218, 0x23a8,
-	0x4003, 0x00f8, 0x20a8, 0x4003, 0x22a8, 0x8108, 0x080c, 0x2241,
-	0x2099, 0x0260, 0x0ca8, 0x080c, 0x2241, 0x2061, 0x1971, 0x6004,
-	0x2098, 0x6008, 0x3518, 0x9312, 0x1218, 0x23a8, 0x4003, 0x0048,
-	0x20a8, 0x4003, 0x22a8, 0x8108, 0x080c, 0x2241, 0x2099, 0x0260,
-	0x0ca8, 0x2061, 0x1971, 0x2019, 0x0280, 0x3300, 0x931e, 0x0110,
-	0x6006, 0x0020, 0x2001, 0x0260, 0x6006, 0x8108, 0x2162, 0x9292,
-	0x0021, 0x9296, 0xffff, 0x620a, 0x00ce, 0x003e, 0x002e, 0x001e,
-	0x000e, 0x0005, 0x0006, 0x0016, 0x0026, 0x0036, 0x00c6, 0x81ff,
-	0x11b8, 0x080c, 0x2259, 0x20a1, 0x024c, 0x2001, 0x0014, 0x3518,
-	0x9312, 0x1218, 0x23a8, 0x4003, 0x0418, 0x20a8, 0x4003, 0x82ff,
-	0x01f8, 0x22a8, 0x8108, 0x080c, 0x2259, 0x20a1, 0x0240, 0x0c98,
-	0x080c, 0x2259, 0x2061, 0x1974, 0x6004, 0x20a0, 0x6008, 0x3518,
-	0x9312, 0x1218, 0x23a8, 0x4003, 0x0058, 0x20a8, 0x4003, 0x82ff,
-	0x0138, 0x22a8, 0x8108, 0x080c, 0x2259, 0x20a1, 0x0240, 0x0c98,
-	0x2061, 0x1974, 0x2019, 0x0260, 0x3400, 0x931e, 0x0110, 0x6006,
-	0x0020, 0x2001, 0x0240, 0x6006, 0x8108, 0x2162, 0x9292, 0x0021,
+	0x8000, 0xbaa0, 0x080c, 0x9e8f, 0x0560, 0x6057, 0x0000, 0x2b00,
+	0x6012, 0x080c, 0xbfa6, 0x6023, 0x0003, 0x0016, 0x080c, 0x8564,
+	0x0076, 0x903e, 0x080c, 0x8452, 0x2c08, 0x080c, 0xd2bc, 0x007e,
+	0x001e, 0xd184, 0x0128, 0x080c, 0x9e42, 0x9085, 0x0001, 0x0070,
+	0x080c, 0x5397, 0x0128, 0xd18c, 0x1170, 0x080c, 0xbc59, 0x0148,
+	0x2009, 0x004c, 0x080c, 0x9ebc, 0x9085, 0x0001, 0x012e, 0x00ce,
+	0x0005, 0x9006, 0x0cd8, 0x2900, 0x6016, 0x0c90, 0x2009, 0x004d,
+	0x0010, 0x2009, 0x004e, 0x00f6, 0x00c6, 0x0046, 0x0016, 0x080c,
+	0x9dec, 0x2c78, 0x0590, 0x7e56, 0x2b00, 0x7812, 0x7823, 0x0003,
+	0x2021, 0x0005, 0x080c, 0xbc6b, 0x9186, 0x004d, 0x0118, 0x9186,
+	0x004e, 0x0148, 0x2001, 0x1950, 0x200c, 0xd1fc, 0x0168, 0x2f60,
+	0x080c, 0x9e42, 0x00d0, 0x2001, 0x194f, 0x200c, 0xd1fc, 0x0120,
+	0x2f60, 0x080c, 0x9e42, 0x0088, 0x2f60, 0x080c, 0x5397, 0x0138,
+	0xd18c, 0x1118, 0x04f1, 0x0148, 0x0010, 0x2900, 0x7816, 0x001e,
+	0x0016, 0x080c, 0x9ebc, 0x9085, 0x0001, 0x001e, 0x004e, 0x00ce,
+	0x00fe, 0x0005, 0x00f6, 0x00c6, 0x0046, 0x080c, 0x9dec, 0x2c78,
+	0x0508, 0x7e56, 0x2b00, 0x7812, 0x7823, 0x0003, 0x0096, 0x2021,
+	0x0004, 0x0489, 0x009e, 0x2001, 0x194e, 0x200c, 0xd1fc, 0x0120,
+	0x2f60, 0x080c, 0x9e42, 0x0060, 0x2f60, 0x080c, 0x5397, 0x0120,
+	0xd18c, 0x1160, 0x0071, 0x0130, 0x2009, 0x0052, 0x080c, 0x9ebc,
+	0x9085, 0x0001, 0x004e, 0x00ce, 0x00fe, 0x0005, 0x2900, 0x7816,
+	0x0c98, 0x00c6, 0x080c, 0x4889, 0x00ce, 0x1120, 0x080c, 0x9e42,
+	0x9006, 0x0005, 0xa867, 0x0000, 0xa86b, 0x8000, 0x2900, 0x6016,
+	0x9085, 0x0001, 0x0005, 0x0096, 0x0076, 0x0126, 0x2091, 0x8000,
+	0x080c, 0x637b, 0x0158, 0x2001, 0xbc70, 0x0006, 0x900e, 0x2400,
+	0x080c, 0x6abf, 0x080c, 0x6891, 0x000e, 0x0807, 0x2418, 0x080c,
+	0x87fb, 0xbaa0, 0x0086, 0x2041, 0x0001, 0x2039, 0x0001, 0x2608,
+	0x080c, 0x857c, 0x008e, 0x080c, 0x8452, 0x2f08, 0x2648, 0x080c,
+	0xd2bc, 0xb93c, 0x81ff, 0x090c, 0x864d, 0x080c, 0x896d, 0x012e,
+	0x007e, 0x009e, 0x0005, 0x00c6, 0x0126, 0x2091, 0x8000, 0x080c,
+	0x9dec, 0x0190, 0x660a, 0x2b08, 0x6112, 0x080c, 0xbfa6, 0x6023,
+	0x0001, 0x2900, 0x6016, 0x2009, 0x001f, 0x080c, 0x9ebc, 0x9085,
+	0x0001, 0x012e, 0x00ce, 0x0005, 0x9006, 0x0cd8, 0x00c6, 0x0126,
+	0x2091, 0x8000, 0x080c, 0x9e8f, 0x01b8, 0x660a, 0x2b08, 0x6112,
+	0x080c, 0xbfa6, 0x6023, 0x0008, 0x2900, 0x6016, 0x00f6, 0x2c78,
+	0x080c, 0x164a, 0x00fe, 0x2009, 0x0021, 0x080c, 0x9ebc, 0x9085,
+	0x0001, 0x012e, 0x00ce, 0x0005, 0x9006, 0x0cd8, 0x2009, 0x003d,
+	0x00c6, 0x0126, 0x0016, 0x2091, 0x8000, 0x080c, 0x9dec, 0x0198,
+	0x660a, 0x2b08, 0x6112, 0x080c, 0xbfa6, 0x6023, 0x0001, 0x2900,
+	0x6016, 0x001e, 0x0016, 0x080c, 0x9ebc, 0x9085, 0x0001, 0x001e,
+	0x012e, 0x00ce, 0x0005, 0x9006, 0x0cd0, 0x00c6, 0x0126, 0x2091,
+	0x8000, 0x080c, 0x9e8f, 0x0188, 0x2b08, 0x6112, 0x080c, 0xbfa6,
+	0x6023, 0x0001, 0x2900, 0x6016, 0x2009, 0x0000, 0x080c, 0x9ebc,
+	0x9085, 0x0001, 0x012e, 0x00ce, 0x0005, 0x9006, 0x0cd8, 0x2009,
+	0x0044, 0x0830, 0x2009, 0x0049, 0x0818, 0x0026, 0x00b6, 0x6210,
+	0x2258, 0xba3c, 0x82ff, 0x0110, 0x8211, 0xba3e, 0x00be, 0x002e,
+	0x0005, 0x0006, 0x0016, 0x6004, 0x908e, 0x0002, 0x0140, 0x908e,
+	0x0003, 0x0128, 0x908e, 0x0004, 0x0110, 0x9085, 0x0001, 0x001e,
+	0x000e, 0x0005, 0x0006, 0x0086, 0x0096, 0x6020, 0x9086, 0x0004,
+	0x01a8, 0x6014, 0x904d, 0x080c, 0xbb2c, 0x0180, 0xa864, 0x9086,
+	0x0139, 0x0170, 0x6020, 0x90c6, 0x0003, 0x0140, 0x90c6, 0x0002,
+	0x0128, 0xa868, 0xd0fc, 0x0110, 0x9006, 0x0010, 0x9085, 0x0001,
+	0x009e, 0x008e, 0x000e, 0x0005, 0x00c6, 0x0126, 0x2091, 0x8000,
+	0x080c, 0x9e8f, 0x0198, 0x2b08, 0x6112, 0x080c, 0xbfa6, 0x6023,
+	0x0001, 0x2900, 0x6016, 0x080c, 0x2fdc, 0x2009, 0x0028, 0x080c,
+	0x9ebc, 0x9085, 0x0001, 0x012e, 0x00ce, 0x0005, 0x9006, 0x0cd8,
+	0x9186, 0x0015, 0x11a8, 0x2011, 0x1823, 0x2204, 0x9086, 0x0074,
+	0x1178, 0x00b6, 0x080c, 0xaa5c, 0x00be, 0x080c, 0xac9b, 0x6003,
+	0x0001, 0x6007, 0x0029, 0x080c, 0x8422, 0x080c, 0x896d, 0x0078,
+	0x6014, 0x0096, 0x2048, 0xa868, 0x009e, 0xd0fc, 0x0148, 0x2001,
+	0x0001, 0x080c, 0xc165, 0x080c, 0xa7d1, 0x080c, 0x9e42, 0x0005,
+	0x0096, 0x6014, 0x904d, 0x090c, 0x0db4, 0xa87b, 0x0030, 0xa883,
+	0x0000, 0xa897, 0x4005, 0xa89b, 0x0004, 0xa867, 0x0139, 0x0126,
+	0x2091, 0x8000, 0x080c, 0x6891, 0x012e, 0x009e, 0x080c, 0x9e42,
+	0x0c30, 0x0096, 0x9186, 0x0016, 0x1128, 0x2001, 0x0004, 0x080c,
+	0x6198, 0x00e8, 0x9186, 0x0015, 0x1510, 0x2011, 0x1823, 0x2204,
+	0x9086, 0x0014, 0x11e0, 0x6010, 0x00b6, 0x2058, 0x080c, 0x62e2,
+	0x00be, 0x080c, 0xad6c, 0x1198, 0x6010, 0x00b6, 0x2058, 0xb890,
+	0x00be, 0x9005, 0x0160, 0x2001, 0x0006, 0x080c, 0x6198, 0x6014,
+	0x2048, 0xa868, 0xd0fc, 0x0170, 0x080c, 0xa246, 0x0048, 0x6014,
+	0x2048, 0xa868, 0xd0fc, 0x0528, 0x080c, 0xa7d1, 0x080c, 0x9e42,
+	0x009e, 0x0005, 0x6014, 0x6310, 0x2358, 0x904d, 0x090c, 0x0db4,
+	0xa87b, 0x0000, 0xa883, 0x0000, 0xa897, 0x4000, 0x900e, 0x080c,
+	0x6467, 0x1108, 0xc185, 0xb800, 0xd0bc, 0x0108, 0xc18d, 0xa99a,
+	0x0126, 0x2091, 0x8000, 0x080c, 0x6891, 0x012e, 0x080c, 0x9e42,
+	0x08f8, 0x6014, 0x904d, 0x090c, 0x0db4, 0xa87b, 0x0030, 0xa883,
+	0x0000, 0xa897, 0x4005, 0xa89b, 0x0004, 0xa867, 0x0139, 0x0126,
+	0x2091, 0x8000, 0x080c, 0x6891, 0x012e, 0x080c, 0x9e42, 0x0840,
+	0xa878, 0x9086, 0x0005, 0x1108, 0x0009, 0x0005, 0xa880, 0xc0ad,
+	0xa882, 0x0005, 0x6043, 0x0000, 0x6017, 0x0000, 0x6003, 0x0001,
+	0x6007, 0x0050, 0x080c, 0x83da, 0x080c, 0x896d, 0x0005, 0x00c6,
+	0x6010, 0x00b6, 0x2058, 0xb800, 0x00be, 0xd0bc, 0x0120, 0x6020,
+	0x9084, 0x000f, 0x0013, 0x00ce, 0x0005, 0xb845, 0xbe56, 0xbe56,
+	0xbe59, 0xd59a, 0xd5b5, 0xd5b8, 0xb845, 0xb845, 0xb845, 0xb845,
+	0xb845, 0xb845, 0xb845, 0xb845, 0x080c, 0x0db4, 0xa001, 0xa001,
+	0x0005, 0x0096, 0x6014, 0x904d, 0x0118, 0xa87c, 0xd0e4, 0x1110,
+	0x009e, 0x0010, 0x009e, 0x0005, 0x6010, 0x00b6, 0x2058, 0xb800,
+	0x00be, 0xd0bc, 0x0550, 0x2001, 0x1833, 0x2004, 0x9005, 0x1540,
+	0x00f6, 0x2c78, 0x080c, 0x9dec, 0x0508, 0x7810, 0x6012, 0x080c,
+	0xbfa6, 0x7820, 0x9086, 0x0003, 0x0128, 0x7808, 0x603a, 0x2f00,
+	0x603e, 0x0020, 0x7808, 0x603e, 0x2f00, 0x603a, 0x602e, 0x6023,
+	0x0001, 0x6007, 0x0035, 0x6003, 0x0001, 0x7954, 0x6156, 0x080c,
+	0x83da, 0x080c, 0x896d, 0x2f60, 0x00fe, 0x0005, 0x2f60, 0x00fe,
+	0x2001, 0x1958, 0x2004, 0x6042, 0x0005, 0x0016, 0x0096, 0x6814,
+	0x2048, 0xa87c, 0xd0e4, 0x0180, 0xc0e4, 0xa87e, 0xa877, 0x0000,
+	0xa893, 0x0000, 0xa88f, 0x0000, 0xd0cc, 0x0130, 0xc0cc, 0xa87e,
+	0xa878, 0x2048, 0x080c, 0x0f9d, 0x6830, 0x6036, 0x908e, 0x0001,
+	0x0148, 0x6803, 0x0002, 0x9086, 0x0005, 0x0170, 0x9006, 0x602e,
+	0x6032, 0x00d0, 0x681c, 0xc085, 0x681e, 0x6803, 0x0004, 0x6824,
+	0xc0f4, 0x9085, 0x0c00, 0x6826, 0x6814, 0x2048, 0xa8ac, 0x6938,
+	0x9102, 0xa8b0, 0x693c, 0x9103, 0x1e48, 0x683c, 0x602e, 0x6838,
+	0x9084, 0xfffc, 0x683a, 0x6032, 0x2d00, 0x603a, 0x6808, 0x603e,
+	0x6910, 0x6112, 0x6954, 0x6156, 0x6023, 0x0001, 0x6007, 0x0039,
+	0x6003, 0x0001, 0x080c, 0x83da, 0x080c, 0x896d, 0x009e, 0x001e,
+	0x0005, 0x6024, 0xd0d4, 0x0510, 0xd0f4, 0x11f8, 0x6038, 0x940a,
+	0x603c, 0x9303, 0x0230, 0x9105, 0x0120, 0x6024, 0xc0d4, 0xc0f5,
+	0x0098, 0x643a, 0x633e, 0xac3e, 0xab42, 0x0046, 0x0036, 0x2400,
+	0xacac, 0x9402, 0xa836, 0x2300, 0xabb0, 0x9303, 0xa83a, 0x003e,
+	0x004e, 0x6024, 0xc0d4, 0x0000, 0x6026, 0x0005, 0xd0f4, 0x1138,
+	0xa83c, 0x603a, 0xa840, 0x603e, 0x6024, 0xc0f5, 0x6026, 0x0005,
+	0x0006, 0x0016, 0x6004, 0x908e, 0x0034, 0x01b8, 0x908e, 0x0035,
+	0x01a0, 0x908e, 0x0036, 0x0188, 0x908e, 0x0037, 0x0170, 0x908e,
+	0x0038, 0x0158, 0x908e, 0x0039, 0x0140, 0x908e, 0x003a, 0x0128,
+	0x908e, 0x003b, 0x0110, 0x9085, 0x0001, 0x001e, 0x000e, 0x0005,
+	0x0006, 0x0016, 0x0026, 0x0036, 0x00e6, 0x2001, 0x1952, 0x200c,
+	0x8000, 0x2014, 0x2001, 0x0032, 0x080c, 0x8259, 0x2001, 0x1956,
+	0x82ff, 0x1110, 0x2011, 0x0014, 0x2202, 0x2001, 0x1954, 0x200c,
+	0x8000, 0x2014, 0x2071, 0x193c, 0x711a, 0x721e, 0x2001, 0x0064,
+	0x080c, 0x8259, 0x2001, 0x1957, 0x82ff, 0x1110, 0x2011, 0x0014,
+	0x2202, 0x2001, 0x1958, 0x9288, 0x000a, 0x2102, 0x2001, 0x1a60,
+	0x2102, 0x2001, 0x0032, 0x080c, 0x151a, 0x080c, 0x654c, 0x00ee,
+	0x003e, 0x002e, 0x001e, 0x000e, 0x0005, 0x0006, 0x0016, 0x00e6,
+	0x2001, 0x1956, 0x2003, 0x0028, 0x2001, 0x1957, 0x2003, 0x0014,
+	0x2071, 0x193c, 0x701b, 0x0000, 0x701f, 0x07d0, 0x2001, 0x1958,
+	0x2009, 0x001e, 0x2102, 0x2001, 0x1a60, 0x2102, 0x2001, 0x0032,
+	0x080c, 0x151a, 0x00ee, 0x001e, 0x000e, 0x0005, 0x0096, 0x6058,
+	0x904d, 0x0110, 0x080c, 0x101d, 0x009e, 0x0005, 0x0005, 0x00c6,
+	0x0126, 0x2091, 0x8000, 0x080c, 0x9dec, 0x0180, 0x2b08, 0x6112,
+	0x0ca9, 0x6023, 0x0001, 0x2900, 0x6016, 0x2009, 0x0033, 0x080c,
+	0x9ebc, 0x9085, 0x0001, 0x012e, 0x00ce, 0x0005, 0x9006, 0x0cd8,
+	0x0096, 0x00e6, 0x00f6, 0x2071, 0x1800, 0x9186, 0x0015, 0x1500,
+	0x708c, 0x9086, 0x0018, 0x11e0, 0x6014, 0x2048, 0xaa3c, 0xd2e4,
+	0x1160, 0x2c78, 0x080c, 0x8b64, 0x01d8, 0x7078, 0xaa50, 0x9206,
+	0x1160, 0x707c, 0xaa54, 0x9206, 0x1140, 0x6210, 0x00b6, 0x2258,
+	0xbaa0, 0x00be, 0x900e, 0x080c, 0x3025, 0x080c, 0xa246, 0x0020,
+	0x080c, 0xa7d1, 0x080c, 0x9e42, 0x00fe, 0x00ee, 0x009e, 0x0005,
+	0x705c, 0xaa54, 0x9206, 0x0d48, 0x0c80, 0x00c6, 0x0126, 0x2091,
+	0x8000, 0x080c, 0x9dec, 0x0188, 0x2b08, 0x6112, 0x080c, 0xbfa6,
+	0x6023, 0x0001, 0x2900, 0x6016, 0x2009, 0x004d, 0x080c, 0x9ebc,
+	0x9085, 0x0001, 0x012e, 0x00ce, 0x0005, 0x9006, 0x0cd8, 0x00c6,
+	0x0126, 0x2091, 0x8000, 0x0016, 0x080c, 0x9dec, 0x0180, 0x2b08,
+	0x6112, 0x080c, 0xbfa6, 0x6023, 0x0001, 0x2900, 0x6016, 0x001e,
+	0x080c, 0x9ebc, 0x9085, 0x0001, 0x012e, 0x00ce, 0x0005, 0x001e,
+	0x9006, 0x0cd0, 0x0016, 0x0026, 0x0036, 0x0046, 0x0056, 0x0066,
+	0x0096, 0x00e6, 0x00f6, 0x2071, 0x1800, 0x9186, 0x0015, 0x1568,
+	0x718c, 0x6014, 0x2048, 0xa814, 0x8003, 0x9106, 0x1530, 0x20e1,
+	0x0000, 0x2001, 0x1970, 0x2003, 0x0000, 0x6014, 0x2048, 0xa830,
+	0x20a8, 0x8906, 0x8006, 0x8007, 0x9094, 0x003f, 0x22e8, 0x9084,
+	0xffc0, 0x9080, 0x001b, 0x20a0, 0x2001, 0x1970, 0x0016, 0x200c,
+	0x080c, 0xc7ed, 0x001e, 0xa804, 0x9005, 0x0110, 0x2048, 0x0c38,
+	0x6014, 0x2048, 0xa867, 0x0103, 0x0010, 0x080c, 0xa7d1, 0x080c,
+	0x9e42, 0x00fe, 0x00ee, 0x009e, 0x006e, 0x005e, 0x004e, 0x003e,
+	0x002e, 0x001e, 0x0005, 0x0096, 0x00e6, 0x00f6, 0x2071, 0x1800,
+	0x9186, 0x0015, 0x11b8, 0x708c, 0x9086, 0x0004, 0x1198, 0x6014,
+	0x2048, 0x2c78, 0x080c, 0x8b64, 0x01a8, 0x7078, 0xaa74, 0x9206,
+	0x1130, 0x707c, 0xaa78, 0x9206, 0x1110, 0x080c, 0x2fdc, 0x080c,
+	0xa246, 0x0020, 0x080c, 0xa7d1, 0x080c, 0x9e42, 0x00fe, 0x00ee,
+	0x009e, 0x0005, 0x705c, 0xaa78, 0x9206, 0x0d78, 0x0c80, 0x0096,
+	0x00e6, 0x00f6, 0x2071, 0x1800, 0x9186, 0x0015, 0x1550, 0x708c,
+	0x9086, 0x0004, 0x1530, 0x6014, 0x2048, 0x2c78, 0x080c, 0x8b64,
+	0x05f0, 0x7078, 0xaacc, 0x9206, 0x1180, 0x707c, 0xaad0, 0x9206,
+	0x1160, 0x080c, 0x2fdc, 0x0016, 0xa998, 0xaab0, 0x9284, 0x1000,
+	0xc0fd, 0x080c, 0x5347, 0x001e, 0x0010, 0x080c, 0x5138, 0x080c,
+	0xbb2c, 0x0508, 0xa87b, 0x0000, 0xa883, 0x0000, 0xa897, 0x4000,
+	0x0080, 0x080c, 0xbb2c, 0x01b8, 0x6014, 0x2048, 0x080c, 0x5138,
+	0x1d70, 0xa87b, 0x0030, 0xa883, 0x0000, 0xa897, 0x4005, 0xa89b,
+	0x0004, 0x0126, 0x2091, 0x8000, 0xa867, 0x0139, 0x080c, 0x6891,
+	0x012e, 0x080c, 0x9e42, 0x00fe, 0x00ee, 0x009e, 0x0005, 0x705c,
+	0xaad0, 0x9206, 0x0930, 0x0888, 0x0016, 0x0026, 0xa87c, 0xd0ac,
+	0x0178, 0xa938, 0xaa34, 0x2100, 0x9205, 0x0150, 0xa890, 0x9106,
+	0x1118, 0xa88c, 0x9206, 0x0120, 0xa992, 0xaa8e, 0x9085, 0x0001,
+	0x002e, 0x001e, 0x0005, 0x00b6, 0x00d6, 0x0036, 0x080c, 0xbb2c,
+	0x0904, 0xc161, 0x0096, 0x6314, 0x2348, 0xa87a, 0xa982, 0x929e,
+	0x4000, 0x1580, 0x6310, 0x00c6, 0x2358, 0x2009, 0x0000, 0xa868,
+	0xd0f4, 0x1140, 0x080c, 0x6467, 0x1108, 0xc185, 0xb800, 0xd0bc,
+	0x0108, 0xc18d, 0xaa96, 0xa99a, 0x20a9, 0x0004, 0xa860, 0x20e8,
+	0xa85c, 0x9080, 0x0031, 0x20a0, 0xb8b4, 0x20e0, 0xb8b8, 0x9080,
+	0x0006, 0x2098, 0x080c, 0x0f68, 0x20a9, 0x0004, 0xa85c, 0x9080,
+	0x0035, 0x20a0, 0xb8b8, 0x9080, 0x000a, 0x2098, 0x080c, 0x0f68,
+	0x00ce, 0x0090, 0xaa96, 0x3918, 0x9398, 0x0007, 0x231c, 0x6004,
+	0x9086, 0x0016, 0x0110, 0xa89b, 0x0004, 0xaba2, 0x6310, 0x2358,
+	0xb804, 0x9084, 0x00ff, 0xa89e, 0x080c, 0x6884, 0x6017, 0x0000,
+	0x009e, 0x003e, 0x00de, 0x00be, 0x0005, 0x0026, 0x0036, 0x0046,
+	0x00b6, 0x0096, 0x00f6, 0x6214, 0x2248, 0x6210, 0x2258, 0x2079,
+	0x0260, 0x9096, 0x0000, 0x11a0, 0xb814, 0x9084, 0x00ff, 0x900e,
+	0x080c, 0x2665, 0x2118, 0x831f, 0x939c, 0xff00, 0x7838, 0x9084,
+	0x00ff, 0x931d, 0x7c3c, 0x2011, 0x8018, 0x080c, 0x48e9, 0x00a8,
+	0x9096, 0x0001, 0x1148, 0x89ff, 0x0180, 0xa89b, 0x000d, 0x7838,
+	0xa8a6, 0x783c, 0xa8aa, 0x0048, 0x9096, 0x0002, 0x1130, 0xa89b,
+	0x000d, 0x7838, 0xa8a6, 0x783c, 0xa8aa, 0x00fe, 0x009e, 0x00be,
+	0x004e, 0x003e, 0x002e, 0x0005, 0x00c6, 0x0026, 0x0016, 0x9186,
+	0x0035, 0x0110, 0x6a38, 0x0008, 0x6a2c, 0x080c, 0xbb1a, 0x01f0,
+	0x2260, 0x6120, 0x9186, 0x0003, 0x0118, 0x9186, 0x0006, 0x1190,
+	0x6838, 0x9206, 0x0140, 0x683c, 0x9206, 0x1160, 0x6108, 0x6838,
+	0x9106, 0x1140, 0x0020, 0x6008, 0x693c, 0x9106, 0x1118, 0x6010,
+	0x6910, 0x9106, 0x001e, 0x002e, 0x00ce, 0x0005, 0x9085, 0x0001,
+	0x0cc8, 0xa974, 0xd1cc, 0x0188, 0x918c, 0x00ff, 0x918e, 0x0002,
+	0x1160, 0xa9a8, 0x918c, 0x0f00, 0x810f, 0x918e, 0x0001, 0x1128,
+	0xa834, 0xa938, 0x9115, 0x190c, 0xb23a, 0x0005, 0x0036, 0x2019,
+	0x0001, 0x0010, 0x0036, 0x901e, 0x0499, 0x01e0, 0x080c, 0xbb2c,
+	0x01c8, 0x080c, 0xbd15, 0x6037, 0x4000, 0x6014, 0x6017, 0x0000,
+	0x0096, 0x2048, 0xa87c, 0x080c, 0xbd32, 0x1118, 0x080c, 0xa7d1,
+	0x0040, 0xa867, 0x0103, 0xa877, 0x0000, 0x83ff, 0x1129, 0x080c,
+	0x6891, 0x009e, 0x003e, 0x0005, 0xa880, 0xd0b4, 0x0128, 0xa87b,
+	0x0006, 0xc0ec, 0xa882, 0x0048, 0xd0bc, 0x0118, 0xa87b, 0x0002,
+	0x0020, 0xa87b, 0x0005, 0x080c, 0xbe26, 0xa877, 0x0000, 0x0005,
+	0x2001, 0x1810, 0x2004, 0xd0ec, 0x0005, 0x0006, 0x2001, 0x1810,
+	0x2004, 0xd0f4, 0x000e, 0x0005, 0x0006, 0x2001, 0x1810, 0x2004,
+	0xd0e4, 0x000e, 0x0005, 0x0036, 0x0046, 0x6010, 0x00b6, 0x2058,
+	0xbba0, 0x00be, 0x2021, 0x0007, 0x080c, 0x4a86, 0x004e, 0x003e,
+	0x0005, 0x0c51, 0x1d81, 0x0005, 0x2001, 0x1956, 0x2004, 0x601a,
+	0x0005, 0x2001, 0x1958, 0x2004, 0x6042, 0x0005, 0x080c, 0x9e42,
+	0x0804, 0x896d, 0x00b6, 0x0066, 0x6000, 0x90b2, 0x0016, 0x1a0c,
+	0x0db4, 0x001b, 0x006e, 0x00be, 0x0005, 0xc26d, 0xc94a, 0xcaa5,
+	0xc26d, 0xc26d, 0xc26d, 0xc26d, 0xc26d, 0xc2a4, 0xcb29, 0xc26d,
+	0xc26d, 0xc26d, 0xc26d, 0xc26d, 0xc26d, 0x080c, 0x0db4, 0x0066,
+	0x6000, 0x90b2, 0x0016, 0x1a0c, 0x0db4, 0x0013, 0x006e, 0x0005,
+	0xc288, 0xd091, 0xc288, 0xc288, 0xc288, 0xc288, 0xc288, 0xc288,
+	0xd03e, 0xd0e5, 0xc288, 0xd6d5, 0xd70b, 0xd6d5, 0xd70b, 0xc288,
+	0x080c, 0x0db4, 0x6000, 0x9082, 0x0016, 0x1a0c, 0x0db4, 0x6000,
+	0x000a, 0x0005, 0xc2a2, 0xcd06, 0xcdf6, 0xce18, 0xced7, 0xc2a2,
+	0xcfb5, 0xcf5f, 0xcb35, 0xd014, 0xd029, 0xc2a2, 0xc2a2, 0xc2a2,
+	0xc2a2, 0xc2a2, 0x080c, 0x0db4, 0x91b2, 0x0053, 0x1a0c, 0x0db4,
+	0x2100, 0x91b2, 0x0040, 0x1a04, 0xc6eb, 0x0002, 0xc2ee, 0xc4dc,
+	0xc2ee, 0xc2ee, 0xc2ee, 0xc4e5, 0xc2ee, 0xc2ee, 0xc2ee, 0xc2ee,
+	0xc2ee, 0xc2ee, 0xc2ee, 0xc2ee, 0xc2ee, 0xc2ee, 0xc2ee, 0xc2ee,
+	0xc2ee, 0xc2ee, 0xc2ee, 0xc2ee, 0xc2ee, 0xc2f0, 0xc353, 0xc362,
+	0xc3c6, 0xc3f1, 0xc469, 0xc4c7, 0xc2ee, 0xc2ee, 0xc4e8, 0xc2ee,
+	0xc2ee, 0xc4fd, 0xc50a, 0xc2ee, 0xc2ee, 0xc2ee, 0xc2ee, 0xc2ee,
+	0xc58d, 0xc2ee, 0xc2ee, 0xc5a1, 0xc2ee, 0xc2ee, 0xc55c, 0xc2ee,
+	0xc2ee, 0xc2ee, 0xc5b9, 0xc2ee, 0xc2ee, 0xc2ee, 0xc636, 0xc2ee,
+	0xc2ee, 0xc2ee, 0xc2ee, 0xc2ee, 0xc2ee, 0xc6b3, 0x080c, 0x0db4,
+	0x080c, 0x6529, 0x1150, 0x2001, 0x1836, 0x2004, 0xd0cc, 0x1128,
+	0x9084, 0x0009, 0x9086, 0x0008, 0x1140, 0x6007, 0x0009, 0x602f,
+	0x0009, 0x6017, 0x0000, 0x0804, 0xc4d5, 0x080c, 0x6512, 0x00e6,
+	0x00c6, 0x0036, 0x0026, 0x0016, 0x6210, 0x2258, 0xbaa0, 0x0026,
+	0x2019, 0x0029, 0x080c, 0x8564, 0x0076, 0x903e, 0x080c, 0x8452,
+	0x2c08, 0x080c, 0xd2bc, 0x007e, 0x001e, 0x001e, 0x002e, 0x003e,
+	0x00ce, 0x00ee, 0x6610, 0x2658, 0x080c, 0x6256, 0xbe04, 0x9684,
+	0x00ff, 0x9082, 0x0006, 0x1268, 0x0016, 0x0026, 0x6210, 0x00b6,
+	0x2258, 0xbaa0, 0x00be, 0x2c08, 0x080c, 0xd883, 0x002e, 0x001e,
+	0x1178, 0x080c, 0xd1ef, 0x1904, 0xc3be, 0x080c, 0xd18b, 0x1120,
+	0x6007, 0x0008, 0x0804, 0xc4d5, 0x6007, 0x0009, 0x0804, 0xc4d5,
+	0x080c, 0xd3e6, 0x0128, 0x080c, 0xd1ef, 0x0d78, 0x0804, 0xc3be,
+	0x6017, 0x1900, 0x0c88, 0x080c, 0x30ff, 0x1904, 0xc6e8, 0x6106,
+	0x080c, 0xd140, 0x6007, 0x0006, 0x0804, 0xc4d5, 0x6007, 0x0007,
+	0x0804, 0xc4d5, 0x080c, 0xd747, 0x1904, 0xc6e8, 0x080c, 0x30ff,
+	0x1904, 0xc6e8, 0x00d6, 0x6610, 0x2658, 0xbe04, 0x9684, 0x00ff,
+	0x9082, 0x0006, 0x1220, 0x2001, 0x0001, 0x080c, 0x6184, 0x96b4,
+	0xff00, 0x8637, 0x9686, 0x0006, 0x0188, 0x9686, 0x0004, 0x0170,
+	0xbe04, 0x96b4, 0x00ff, 0x9686, 0x0006, 0x0140, 0x9686, 0x0004,
+	0x0128, 0x9686, 0x0005, 0x0110, 0x00de, 0x0480, 0x00e6, 0x2071,
+	0x0260, 0x7034, 0x9084, 0x0003, 0x1140, 0x7034, 0x9082, 0x0014,
+	0x0220, 0x7030, 0x9084, 0x0003, 0x0130, 0x00ee, 0x6017, 0x0000,
+	0x602f, 0x0007, 0x00b0, 0x00ee, 0x080c, 0xd252, 0x1190, 0x9686,
+	0x0006, 0x1140, 0x0026, 0x6210, 0x2258, 0xbaa0, 0x900e, 0x080c,
+	0x3025, 0x002e, 0x080c, 0x62e2, 0x6007, 0x000a, 0x00de, 0x0804,
+	0xc4d5, 0x6007, 0x000b, 0x00de, 0x0804, 0xc4d5, 0x080c, 0x2fdc,
+	0x080c, 0xc241, 0x6007, 0x0001, 0x0804, 0xc4d5, 0x080c, 0xd747,
+	0x1904, 0xc6e8, 0x080c, 0x30ff, 0x1904, 0xc6e8, 0x2071, 0x0260,
+	0x7034, 0x90b4, 0x0003, 0x1948, 0x90b2, 0x0014, 0x0a30, 0x7030,
+	0x9084, 0x0003, 0x1910, 0x6610, 0x2658, 0xbe04, 0x9686, 0x0707,
+	0x09e8, 0x0026, 0x6210, 0x2258, 0xbaa0, 0x900e, 0x080c, 0x3025,
+	0x002e, 0x6007, 0x000c, 0x2001, 0x0001, 0x080c, 0xd863, 0x0804,
+	0xc4d5, 0x080c, 0x6529, 0x1140, 0x2001, 0x1836, 0x2004, 0x9084,
+	0x0009, 0x9086, 0x0008, 0x1110, 0x0804, 0xc2fd, 0x080c, 0x6512,
+	0x6610, 0x2658, 0xbe04, 0x9684, 0x00ff, 0x9082, 0x0006, 0x06c0,
+	0x1138, 0x0026, 0x2001, 0x0006, 0x080c, 0x61c4, 0x002e, 0x0050,
+	0x96b4, 0xff00, 0x8637, 0x9686, 0x0004, 0x0120, 0x9686, 0x0006,
+	0x1904, 0xc3be, 0x080c, 0xd25f, 0x1120, 0x6007, 0x000e, 0x0804,
+	0xc4d5, 0x0046, 0x6410, 0x2458, 0xbca0, 0x0046, 0x080c, 0x2fdc,
+	0x080c, 0xc241, 0x004e, 0x0016, 0x9006, 0x2009, 0x1854, 0x210c,
+	0x0048, 0x2009, 0x0029, 0x080c, 0xd54b, 0x6010, 0x2058, 0xb800,
+	0xc0e5, 0xb802, 0x001e, 0x004e, 0x6007, 0x0001, 0x0804, 0xc4d5,
+	0x2001, 0x0001, 0x080c, 0x6184, 0x0156, 0x0016, 0x0026, 0x0036,
+	0x20a9, 0x0004, 0x2019, 0x1805, 0x2011, 0x0270, 0x080c, 0xae0c,
+	0x003e, 0x002e, 0x001e, 0x015e, 0x9005, 0x0168, 0x96b4, 0xff00,
+	0x8637, 0x9682, 0x0004, 0x0a04, 0xc3be, 0x9682, 0x0007, 0x0a04,
+	0xc41a, 0x0804, 0xc3be, 0x6017, 0x1900, 0x6007, 0x0009, 0x0804,
+	0xc4d5, 0x080c, 0x6529, 0x1140, 0x2001, 0x1836, 0x2004, 0x9084,
+	0x0009, 0x9086, 0x0008, 0x1110, 0x0804, 0xc2fd, 0x080c, 0x6512,
+	0x6610, 0x2658, 0xbe04, 0x9684, 0x00ff, 0x0006, 0x9086, 0x0001,
+	0x000e, 0x0170, 0x9082, 0x0006, 0x0690, 0x0150, 0x96b4, 0xff00,
+	0x8637, 0x9686, 0x0004, 0x0120, 0x9686, 0x0006, 0x1904, 0xc3be,
+	0x080c, 0xd28d, 0x1130, 0x080c, 0xd18b, 0x1118, 0x6007, 0x0010,
+	0x04e0, 0x0046, 0x6410, 0x2458, 0xbca0, 0x0046, 0x080c, 0x2fdc,
+	0x080c, 0xc241, 0x004e, 0x0016, 0x9006, 0x2009, 0x1854, 0x210c,
+	0x0048, 0x2009, 0x0029, 0x080c, 0xd54b, 0x6010, 0x2058, 0xb800,
+	0xc0e5, 0xb802, 0x001e, 0x004e, 0x6007, 0x0001, 0x00f0, 0x080c,
+	0xd3e6, 0x0140, 0x96b4, 0xff00, 0x8637, 0x9686, 0x0006, 0x0980,
+	0x0804, 0xc3be, 0x6017, 0x1900, 0x6007, 0x0009, 0x0070, 0x080c,
+	0x30ff, 0x1904, 0xc6e8, 0x080c, 0xd747, 0x1904, 0xc6e8, 0x080c,
+	0xc888, 0x1904, 0xc3be, 0x6007, 0x0012, 0x6003, 0x0001, 0x080c,
+	0x8422, 0x080c, 0x896d, 0x0005, 0x6007, 0x0001, 0x6003, 0x0001,
+	0x080c, 0x8422, 0x080c, 0x896d, 0x0cb0, 0x6007, 0x0005, 0x0c68,
+	0x080c, 0xd747, 0x1904, 0xc6e8, 0x080c, 0x30ff, 0x1904, 0xc6e8,
+	0x080c, 0xc888, 0x1904, 0xc3be, 0x6007, 0x0020, 0x6003, 0x0001,
+	0x080c, 0x8422, 0x080c, 0x896d, 0x0005, 0x080c, 0x30ff, 0x1904,
+	0xc6e8, 0x6007, 0x0023, 0x6003, 0x0001, 0x080c, 0x8422, 0x080c,
+	0x896d, 0x0005, 0x080c, 0xd747, 0x1904, 0xc6e8, 0x080c, 0x30ff,
+	0x1904, 0xc6e8, 0x080c, 0xc888, 0x1904, 0xc3be, 0x0016, 0x0026,
+	0x00e6, 0x2071, 0x0260, 0x7244, 0x9286, 0xffff, 0x0180, 0x2c08,
+	0x080c, 0xbb1a, 0x01b0, 0x2260, 0x7240, 0x6008, 0x9206, 0x1188,
+	0x6010, 0x9190, 0x0004, 0x2214, 0x9206, 0x01b8, 0x0050, 0x7240,
+	0x2c08, 0x9006, 0x080c, 0xd51d, 0x1180, 0x7244, 0x9286, 0xffff,
+	0x01b0, 0x2160, 0x6007, 0x0026, 0x6017, 0x1700, 0x7214, 0x9296,
+	0xffff, 0x1180, 0x6007, 0x0025, 0x0068, 0x6020, 0x9086, 0x0007,
+	0x1d80, 0x6004, 0x9086, 0x0024, 0x1110, 0x080c, 0x9e42, 0x2160,
+	0x6007, 0x0025, 0x6003, 0x0001, 0x080c, 0x8422, 0x080c, 0x896d,
+	0x00ee, 0x002e, 0x001e, 0x0005, 0x2001, 0x0001, 0x080c, 0x6184,
+	0x0156, 0x0016, 0x0026, 0x0036, 0x20a9, 0x0004, 0x2019, 0x1805,
+	0x2011, 0x0276, 0x080c, 0xae0c, 0x003e, 0x002e, 0x001e, 0x015e,
+	0x0120, 0x6007, 0x0031, 0x0804, 0xc4d5, 0x080c, 0xaa74, 0x080c,
+	0x6f9b, 0x1190, 0x0006, 0x0026, 0x0036, 0x080c, 0x6fb5, 0x1138,
+	0x080c, 0x727f, 0x080c, 0x5cda, 0x080c, 0x6ecd, 0x0010, 0x080c,
+	0x6f73, 0x003e, 0x002e, 0x000e, 0x0005, 0x080c, 0x30ff, 0x1904,
+	0xc6e8, 0x080c, 0xc888, 0x1904, 0xc3be, 0x6106, 0x080c, 0xc8a4,
+	0x1120, 0x6007, 0x002b, 0x0804, 0xc4d5, 0x6007, 0x002c, 0x0804,
+	0xc4d5, 0x080c, 0xd747, 0x1904, 0xc6e8, 0x080c, 0x30ff, 0x1904,
+	0xc6e8, 0x080c, 0xc888, 0x1904, 0xc3be, 0x6106, 0x080c, 0xc8a9,
+	0x1120, 0x6007, 0x002e, 0x0804, 0xc4d5, 0x6007, 0x002f, 0x0804,
+	0xc4d5, 0x080c, 0x30ff, 0x1904, 0xc6e8, 0x00e6, 0x00d6, 0x00c6,
+	0x6010, 0x2058, 0xb904, 0x9184, 0x00ff, 0x9086, 0x0006, 0x0158,
+	0x9184, 0xff00, 0x8007, 0x9086, 0x0006, 0x0128, 0x00ce, 0x00de,
+	0x00ee, 0x0804, 0xc4dc, 0x080c, 0x5393, 0xd0e4, 0x0904, 0xc633,
+	0x2071, 0x026c, 0x7010, 0x603a, 0x7014, 0x603e, 0x7108, 0x720c,
+	0x080c, 0x6567, 0x0140, 0x6010, 0x2058, 0xb810, 0x9106, 0x1118,
+	0xb814, 0x9206, 0x0510, 0x080c, 0x6563, 0x15b8, 0x2069, 0x1800,
+	0x687c, 0x9206, 0x1590, 0x6878, 0x9106, 0x1578, 0x7210, 0x080c,
+	0xbb1a, 0x0590, 0x080c, 0xc773, 0x0578, 0x080c, 0xd5c7, 0x0560,
+	0x622e, 0x6007, 0x0036, 0x6003, 0x0001, 0x080c, 0x83da, 0x080c,
+	0x896d, 0x00ce, 0x00de, 0x00ee, 0x0005, 0x7214, 0x9286, 0xffff,
+	0x0150, 0x080c, 0xbb1a, 0x01c0, 0x9280, 0x0002, 0x2004, 0x7110,
+	0x9106, 0x1190, 0x08e0, 0x7210, 0x2c08, 0x9085, 0x0001, 0x080c,
+	0xd51d, 0x2c10, 0x2160, 0x0140, 0x0890, 0x6007, 0x0037, 0x602f,
+	0x0009, 0x6017, 0x1500, 0x08b8, 0x6007, 0x0037, 0x602f, 0x0003,
+	0x6017, 0x1700, 0x0880, 0x6007, 0x0012, 0x0868, 0x080c, 0x30ff,
+	0x1904, 0xc6e8, 0x6010, 0x2058, 0xb804, 0x9084, 0xff00, 0x8007,
+	0x9086, 0x0006, 0x1904, 0xc4dc, 0x00e6, 0x00d6, 0x00c6, 0x080c,
+	0x5393, 0xd0e4, 0x0904, 0xc6ab, 0x2069, 0x1800, 0x2071, 0x026c,
+	0x7008, 0x603a, 0x720c, 0x623e, 0x9286, 0xffff, 0x1150, 0x7208,
+	0x00c6, 0x2c08, 0x9085, 0x0001, 0x080c, 0xd51d, 0x2c10, 0x00ce,
+	0x05e8, 0x080c, 0xbb1a, 0x05d0, 0x7108, 0x9280, 0x0002, 0x2004,
+	0x9106, 0x15a0, 0x00c6, 0x0026, 0x2260, 0x080c, 0xb750, 0x002e,
+	0x00ce, 0x7118, 0x918c, 0xff00, 0x810f, 0x9186, 0x0001, 0x0178,
+	0x9186, 0x0005, 0x0118, 0x9186, 0x0007, 0x1198, 0x9280, 0x0005,
+	0x2004, 0x9005, 0x0170, 0x080c, 0xc773, 0x0904, 0xc62c, 0x0056,
+	0x7510, 0x7614, 0x080c, 0xd5e0, 0x005e, 0x00ce, 0x00de, 0x00ee,
+	0x0005, 0x6007, 0x003b, 0x602f, 0x0009, 0x6017, 0x2a00, 0x6003,
+	0x0001, 0x080c, 0x83da, 0x080c, 0x896d, 0x0c78, 0x6007, 0x003b,
+	0x602f, 0x0003, 0x6017, 0x0300, 0x6003, 0x0001, 0x080c, 0x83da,
+	0x080c, 0x896d, 0x0c10, 0x6007, 0x003b, 0x602f, 0x000b, 0x6017,
+	0x0000, 0x0804, 0xc603, 0x00e6, 0x0026, 0x080c, 0x6529, 0x0550,
+	0x080c, 0x6512, 0x080c, 0xd7b9, 0x1518, 0x2071, 0x1800, 0x70d8,
+	0x9085, 0x0003, 0x70da, 0x00f6, 0x2079, 0x0100, 0x72ac, 0x9284,
+	0x00ff, 0x707a, 0x78e6, 0x9284, 0xff00, 0x727c, 0x9205, 0x707e,
+	0x78ea, 0x00fe, 0x70e3, 0x0000, 0x080c, 0x6567, 0x0120, 0x2011,
+	0x19d0, 0x2013, 0x07d0, 0xd0ac, 0x1128, 0x080c, 0x2dbd, 0x0010,
+	0x080c, 0xd7eb, 0x002e, 0x00ee, 0x080c, 0x9e42, 0x0804, 0xc4db,
+	0x080c, 0x9e42, 0x0005, 0x2600, 0x0002, 0xc6ff, 0xc6ff, 0xc6ff,
+	0xc6ff, 0xc6ff, 0xc701, 0xc6ff, 0xc6ff, 0xc6ff, 0xc6ff, 0xc71e,
+	0xc6ff, 0xc6ff, 0xc6ff, 0xc730, 0xc73d, 0xc76e, 0xc6ff, 0x080c,
+	0x0db4, 0x080c, 0xd747, 0x1d20, 0x080c, 0x30ff, 0x1d08, 0x080c,
+	0xc888, 0x1148, 0x7038, 0x6016, 0x6007, 0x0045, 0x6003, 0x0001,
+	0x080c, 0x8422, 0x0005, 0x080c, 0x2fdc, 0x080c, 0xc241, 0x6007,
+	0x0001, 0x6003, 0x0001, 0x080c, 0x8422, 0x0005, 0x080c, 0xd747,
+	0x1938, 0x080c, 0x30ff, 0x1920, 0x080c, 0xc888, 0x1d60, 0x703c,
+	0x6016, 0x6007, 0x004a, 0x6003, 0x0001, 0x080c, 0x8422, 0x0005,
+	0x080c, 0xc790, 0x0904, 0xc6e8, 0x6007, 0x004e, 0x6003, 0x0001,
+	0x080c, 0x8422, 0x080c, 0x896d, 0x0005, 0x6007, 0x004f, 0x6017,
+	0x0000, 0x7134, 0x918c, 0x00ff, 0x81ff, 0x0508, 0x9186, 0x0001,
+	0x1160, 0x7140, 0x2001, 0x198d, 0x2004, 0x9106, 0x11b0, 0x7144,
+	0x2001, 0x198e, 0x2004, 0x9106, 0x0190, 0x9186, 0x0002, 0x1168,
+	0x2011, 0x0276, 0x20a9, 0x0004, 0x6010, 0x0096, 0x2048, 0x2019,
+	0x000a, 0x080c, 0xae20, 0x009e, 0x0110, 0x6017, 0x0001, 0x6003,
+	0x0001, 0x080c, 0x8422, 0x080c, 0x896d, 0x0005, 0x6007, 0x0050,
+	0x703c, 0x6016, 0x0ca0, 0x0016, 0x00e6, 0x2071, 0x0260, 0x00b6,
+	0x00c6, 0x2260, 0x6010, 0x2058, 0xb8bc, 0xd084, 0x0150, 0x7128,
+	0x6048, 0x9106, 0x1120, 0x712c, 0x6044, 0x9106, 0x0110, 0x9006,
+	0x0010, 0x9085, 0x0001, 0x00ce, 0x00be, 0x00ee, 0x001e, 0x0005,
+	0x0016, 0x0096, 0x0086, 0x00e6, 0x01c6, 0x01d6, 0x0126, 0x2091,
+	0x8000, 0x2071, 0x1800, 0x708c, 0x908a, 0x00f9, 0x16e8, 0x20e1,
+	0x0000, 0x2001, 0x1970, 0x2003, 0x0000, 0x080c, 0x1004, 0x05a0,
+	0x2900, 0x6016, 0x708c, 0x8004, 0xa816, 0x908a, 0x001e, 0x02d0,
+	0xa833, 0x001e, 0x20a9, 0x001e, 0xa860, 0x20e8, 0xa85c, 0x9080,
+	0x001b, 0x20a0, 0x2001, 0x1970, 0x0016, 0x200c, 0x0471, 0x001e,
+	0x2940, 0x080c, 0x1004, 0x01c0, 0x2900, 0xa006, 0x2100, 0x81ff,
+	0x0180, 0x0c18, 0xa832, 0x20a8, 0xa860, 0x20e8, 0xa85c, 0x9080,
+	0x001b, 0x20a0, 0x2001, 0x1970, 0x0016, 0x200c, 0x00b1, 0x001e,
+	0x0000, 0x9085, 0x0001, 0x0048, 0x2071, 0x1800, 0x708f, 0x0000,
+	0x6014, 0x2048, 0x080c, 0x0f9d, 0x9006, 0x012e, 0x01de, 0x01ce,
+	0x00ee, 0x008e, 0x009e, 0x001e, 0x0005, 0x0006, 0x0016, 0x0026,
+	0x0036, 0x00c6, 0x918c, 0xffff, 0x11a8, 0x080c, 0x2243, 0x2099,
+	0x026c, 0x2001, 0x0014, 0x3518, 0x9312, 0x1218, 0x23a8, 0x4003,
+	0x00f8, 0x20a8, 0x4003, 0x22a8, 0x8108, 0x080c, 0x2243, 0x2099,
+	0x0260, 0x0ca8, 0x080c, 0x2243, 0x2061, 0x1970, 0x6004, 0x2098,
+	0x6008, 0x3518, 0x9312, 0x1218, 0x23a8, 0x4003, 0x0048, 0x20a8,
+	0x4003, 0x22a8, 0x8108, 0x080c, 0x2243, 0x2099, 0x0260, 0x0ca8,
+	0x2061, 0x1970, 0x2019, 0x0280, 0x3300, 0x931e, 0x0110, 0x6006,
+	0x0020, 0x2001, 0x0260, 0x6006, 0x8108, 0x2162, 0x9292, 0x0021,
 	0x9296, 0xffff, 0x620a, 0x00ce, 0x003e, 0x002e, 0x001e, 0x000e,
-	0x0005, 0x00b6, 0x0066, 0x6610, 0x2658, 0xbe04, 0x96b4, 0xff00,
-	0x8637, 0x9686, 0x0006, 0x0170, 0x9686, 0x0004, 0x0158, 0xbe04,
-	0x96b4, 0x00ff, 0x9686, 0x0006, 0x0128, 0x9686, 0x0004, 0x0110,
-	0x9085, 0x0001, 0x006e, 0x00be, 0x0005, 0x00d6, 0x080c, 0xc901,
-	0x00de, 0x0005, 0x00d6, 0x080c, 0xc90e, 0x1520, 0x680c, 0x908c,
-	0xff00, 0x6820, 0x9084, 0x00ff, 0x9115, 0x6216, 0x6824, 0x602e,
-	0xd1e4, 0x0130, 0x9006, 0x080c, 0xd842, 0x2009, 0x0001, 0x0078,
-	0xd1ec, 0x0180, 0x6920, 0x918c, 0x00ff, 0x6824, 0x080c, 0x2663,
-	0x1148, 0x2001, 0x0001, 0x080c, 0xd842, 0x2110, 0x900e, 0x080c,
-	0x3023, 0x0018, 0x9085, 0x0001, 0x0008, 0x9006, 0x00de, 0x0005,
-	0x00b6, 0x00c6, 0x080c, 0x9e7f, 0x05a8, 0x0016, 0x0026, 0x00c6,
-	0x2011, 0x0263, 0x2204, 0x8211, 0x220c, 0x080c, 0x2663, 0x1578,
-	0x080c, 0x61de, 0x1560, 0xbe12, 0xbd16, 0x00ce, 0x002e, 0x001e,
-	0x2b00, 0x6012, 0x080c, 0xd726, 0x11d8, 0x080c, 0x30fd, 0x11c0,
-	0x080c, 0xc869, 0x0510, 0x2001, 0x0007, 0x080c, 0x618f, 0x2001,
-	0x0007, 0x080c, 0x61bb, 0x6017, 0x0000, 0x6023, 0x0001, 0x6007,
-	0x0001, 0x6003, 0x0001, 0x080c, 0x8439, 0x080c, 0x8973, 0x0010,
-	0x080c, 0x9e32, 0x9085, 0x0001, 0x00ce, 0x00be, 0x0005, 0x080c,
-	0x9e32, 0x00ce, 0x002e, 0x001e, 0x0ca8, 0x080c, 0x9e32, 0x9006,
-	0x0c98, 0x2069, 0x026d, 0x6800, 0x9082, 0x0010, 0x1228, 0x6017,
-	0x0000, 0x9085, 0x0001, 0x0008, 0x9006, 0x0005, 0x6017, 0x0000,
-	0x2069, 0x026c, 0x6808, 0x9084, 0xff00, 0x9086, 0x0800, 0x1190,
-	0x6904, 0x9186, 0x0018, 0x0118, 0x9186, 0x0014, 0x1158, 0x810f,
-	0x6800, 0x9084, 0x00ff, 0x910d, 0x615a, 0x908e, 0x0014, 0x0110,
-	0x908e, 0x0010, 0x0005, 0x6004, 0x90b2, 0x0053, 0x1a0c, 0x0db4,
-	0x91b6, 0x0013, 0x1130, 0x2008, 0x91b2, 0x0040, 0x1a04, 0xca56,
-	0x0092, 0x91b6, 0x0027, 0x0120, 0x91b6, 0x0014, 0x190c, 0x0db4,
-	0x2001, 0x0007, 0x080c, 0x61bb, 0x080c, 0x886e, 0x080c, 0x9e62,
-	0x080c, 0x8973, 0x0005, 0xc98b, 0xc98d, 0xc98b, 0xc98b, 0xc98b,
-	0xc98d, 0xc99c, 0xca4f, 0xc9ee, 0xca4f, 0xca00, 0xca4f, 0xc99c,
-	0xca4f, 0xca47, 0xca4f, 0xca47, 0xca4f, 0xca4f, 0xc98b, 0xc98b,
-	0xc98b, 0xc98b, 0xc98b, 0xc98b, 0xc98b, 0xc98b, 0xc98b, 0xc98b,
-	0xc98b, 0xc98d, 0xc98b, 0xca4f, 0xc98b, 0xc98b, 0xca4f, 0xc98b,
-	0xca4c, 0xca4f, 0xc98b, 0xc98b, 0xc98b, 0xc98b, 0xca4f, 0xca4f,
-	0xc98b, 0xca4f, 0xca4f, 0xc98b, 0xc997, 0xc98b, 0xc98b, 0xc98b,
-	0xc98b, 0xca4b, 0xca4f, 0xc98b, 0xc98b, 0xca4f, 0xca4f, 0xc98b,
-	0xc98b, 0xc98b, 0xc98b, 0x080c, 0x0db4, 0x080c, 0x886e, 0x080c,
-	0xc22a, 0x6003, 0x0002, 0x080c, 0x8973, 0x0804, 0xca55, 0x9006,
-	0x080c, 0x617b, 0x0804, 0xca4f, 0x080c, 0x655a, 0x1904, 0xca4f,
-	0x9006, 0x080c, 0x617b, 0x6010, 0x2058, 0xb810, 0x9086, 0x00ff,
-	0x1140, 0x00f6, 0x2079, 0x1800, 0x78a4, 0x8000, 0x78a6, 0x00fe,
-	0x0428, 0x6010, 0x2058, 0xb8b0, 0x9005, 0x1178, 0x080c, 0xc212,
-	0x1904, 0xca4f, 0x0036, 0x0046, 0xbba0, 0x2021, 0x0007, 0x080c,
-	0x4a76, 0x004e, 0x003e, 0x0804, 0xca4f, 0x080c, 0x312e, 0x1904,
-	0xca4f, 0x2001, 0x1800, 0x2004, 0x9086, 0x0002, 0x1138, 0x00f6,
-	0x2079, 0x1800, 0x78a4, 0x8000, 0x78a6, 0x00fe, 0x2001, 0x0002,
-	0x080c, 0x618f, 0x080c, 0x886e, 0x6023, 0x0001, 0x6003, 0x0001,
-	0x6007, 0x0002, 0x080c, 0x8439, 0x080c, 0x8973, 0x6110, 0x2158,
-	0x2009, 0x0001, 0x080c, 0x8046, 0x0804, 0xca55, 0x6610, 0x2658,
-	0xbe04, 0x96b4, 0xff00, 0x8637, 0x9686, 0x0006, 0x0904, 0xca4f,
-	0x9686, 0x0004, 0x0904, 0xca4f, 0x2001, 0x0004, 0x0804, 0xca4d,
-	0x2001, 0x1800, 0x2004, 0x9086, 0x0003, 0x1158, 0x0036, 0x0046,
-	0x6010, 0x2058, 0xbba0, 0x2021, 0x0006, 0x080c, 0x4a76, 0x004e,
-	0x003e, 0x2001, 0x0006, 0x080c, 0xca73, 0x6610, 0x2658, 0xbe04,
-	0x0066, 0x96b4, 0xff00, 0x8637, 0x9686, 0x0006, 0x006e, 0x0168,
-	0x2001, 0x0006, 0x080c, 0x61bb, 0x9284, 0x00ff, 0x908e, 0x0007,
-	0x1120, 0x2001, 0x0006, 0x080c, 0x618f, 0x080c, 0x655a, 0x11f8,
-	0x2001, 0x1836, 0x2004, 0xd0a4, 0x01d0, 0xbe04, 0x96b4, 0x00ff,
-	0x9686, 0x0006, 0x01a0, 0x00f6, 0x2079, 0x1800, 0x78a4, 0x8000,
-	0x78a6, 0x00fe, 0x0804, 0xc9d6, 0x2001, 0x0004, 0x0030, 0x2001,
-	0x0006, 0x0449, 0x0020, 0x0018, 0x0010, 0x080c, 0x61bb, 0x080c,
-	0x886e, 0x080c, 0x9e32, 0x080c, 0x8973, 0x0005, 0x2600, 0x0002,
-	0xca6a, 0xca6a, 0xca6a, 0xca6a, 0xca6a, 0xca6c, 0xca6a, 0xca6a,
-	0xca6a, 0xca6a, 0xca6c, 0xca6a, 0xca6a, 0xca6a, 0xca6c, 0xca6c,
-	0xca6c, 0xca6c, 0x080c, 0x0db4, 0x080c, 0x886e, 0x080c, 0x9e32,
-	0x080c, 0x8973, 0x0005, 0x0016, 0x00b6, 0x00d6, 0x6110, 0x2158,
-	0xb900, 0xd184, 0x0138, 0x080c, 0x618f, 0x9006, 0x080c, 0x617b,
-	0x080c, 0x3003, 0x00de, 0x00be, 0x001e, 0x0005, 0x6610, 0x2658,
-	0xb804, 0x9084, 0xff00, 0x8007, 0x90b2, 0x000c, 0x1a0c, 0x0db4,
-	0x91b6, 0x0015, 0x1110, 0x003b, 0x0028, 0x91b6, 0x0016, 0x190c,
-	0x0db4, 0x006b, 0x0005, 0xa8a1, 0xa8a1, 0xa8a1, 0xa8a1, 0xa8a1,
-	0xa8a1, 0xcaf2, 0xcab3, 0xa8a1, 0xa8a1, 0xa8a1, 0xa8a1, 0xa8a1,
-	0xa8a1, 0xa8a1, 0xa8a1, 0xa8a1, 0xa8a1, 0xcaf2, 0xcaf9, 0xa8a1,
-	0xa8a1, 0xa8a1, 0xa8a1, 0x00f6, 0x080c, 0x655a, 0x11d8, 0x080c,
-	0xc212, 0x11c0, 0x6010, 0x905d, 0x01a8, 0xb8b0, 0x9005, 0x0190,
-	0x9006, 0x080c, 0x617b, 0x2001, 0x0002, 0x080c, 0x618f, 0x6023,
-	0x0001, 0x6003, 0x0001, 0x6007, 0x0002, 0x080c, 0x8439, 0x080c,
-	0x8973, 0x00f0, 0x2011, 0x0263, 0x2204, 0x8211, 0x220c, 0x080c,
-	0x2663, 0x11b0, 0x080c, 0x623e, 0x0118, 0x080c, 0x9e32, 0x0080,
-	0xb810, 0x0006, 0xb814, 0x0006, 0xb8b0, 0x0006, 0x080c, 0x5ceb,
-	0x000e, 0xb8b2, 0x000e, 0xb816, 0x000e, 0xb812, 0x080c, 0x9e32,
-	0x00fe, 0x0005, 0x6604, 0x96b6, 0x001e, 0x1110, 0x080c, 0x9e32,
-	0x0005, 0x080c, 0xac85, 0x1148, 0x6003, 0x0001, 0x6007, 0x0001,
-	0x080c, 0x8439, 0x080c, 0x8973, 0x0010, 0x080c, 0x9e32, 0x0005,
-	0x6004, 0x908a, 0x0053, 0x1a0c, 0x0db4, 0x080c, 0x886e, 0x080c,
-	0x9e62, 0x080c, 0x8973, 0x0005, 0x9182, 0x0040, 0x0002, 0xcb2a,
-	0xcb2a, 0xcb2a, 0xcb2a, 0xcb2c, 0xcb2a, 0xcb2a, 0xcb2a, 0xcb2a,
-	0xcb2a, 0xcb2a, 0xcb2a, 0xcb2a, 0xcb2a, 0xcb2a, 0xcb2a, 0xcb2a,
-	0xcb2a, 0xcb2a, 0x080c, 0x0db4, 0x0096, 0x00b6, 0x00d6, 0x00e6,
-	0x00f6, 0x0046, 0x0026, 0x6210, 0x2258, 0xb8ac, 0x9005, 0x11a8,
-	0x6106, 0x2071, 0x0260, 0x7444, 0x94a4, 0xff00, 0x0904, 0xcb92,
-	0x080c, 0xd836, 0x1170, 0x9486, 0x2000, 0x1158, 0x2009, 0x0001,
-	0x2011, 0x0200, 0x080c, 0x822f, 0x0020, 0x9026, 0x080c, 0xd76b,
-	0x0c38, 0x080c, 0x0feb, 0x090c, 0x0db4, 0x6003, 0x0007, 0xa867,
-	0x010d, 0x9006, 0xa802, 0xa86a, 0xac8a, 0x2c00, 0xa88e, 0x6008,
-	0xa8e2, 0x6010, 0x2058, 0xb8a0, 0x7130, 0xa97a, 0x0016, 0xa876,
-	0xa87f, 0x0000, 0xa883, 0x0000, 0xa887, 0x0036, 0x080c, 0x688c,
-	0x001e, 0x080c, 0xd836, 0x1904, 0xcbf2, 0x9486, 0x2000, 0x1130,
-	0x2019, 0x0017, 0x080c, 0xd4a6, 0x0804, 0xcbf2, 0x9486, 0x0200,
-	0x1120, 0x080c, 0xd442, 0x0804, 0xcbf2, 0x9486, 0x0400, 0x0120,
-	0x9486, 0x1000, 0x1904, 0xcbf2, 0x2019, 0x0002, 0x080c, 0xd45d,
-	0x0804, 0xcbf2, 0x2069, 0x1a41, 0x6a00, 0xd284, 0x0904, 0xcc5c,
-	0x9284, 0x0300, 0x1904, 0xcc55, 0x6804, 0x9005, 0x0904, 0xcc3d,
-	0x2d78, 0x6003, 0x0007, 0x080c, 0x1004, 0x0904, 0xcbfe, 0x7800,
-	0xd08c, 0x1118, 0x7804, 0x8001, 0x7806, 0x6017, 0x0000, 0x2001,
-	0x180f, 0x2004, 0xd084, 0x1904, 0xcc60, 0x9006, 0xa802, 0xa867,
-	0x0116, 0xa86a, 0x6008, 0xa8e2, 0x2c00, 0xa87a, 0x6010, 0x2058,
-	0xb8a0, 0x7130, 0xa9b6, 0xa876, 0xb928, 0xa9ba, 0xb92c, 0xa9be,
-	0xb930, 0xa9c2, 0xb934, 0xa9c6, 0xa883, 0x003d, 0x7044, 0x9084,
-	0x0003, 0x9080, 0xcbfa, 0x2005, 0xa87e, 0x20a9, 0x000a, 0x2001,
-	0x0270, 0xaa5c, 0x9290, 0x0021, 0x2009, 0x0205, 0x200b, 0x0080,
-	0x20e1, 0x0000, 0xab60, 0x23e8, 0x2098, 0x22a0, 0x4003, 0x200b,
-	0x0000, 0x2001, 0x027a, 0x200c, 0xa9b2, 0x8000, 0x200c, 0xa9ae,
-	0x080c, 0x688c, 0x002e, 0x004e, 0x00fe, 0x00ee, 0x00de, 0x00be,
-	0x009e, 0x0005, 0x0000, 0x0080, 0x0040, 0x0000, 0x2001, 0x1810,
-	0x2004, 0xd084, 0x0120, 0x080c, 0x0feb, 0x1904, 0xcba7, 0x6017,
-	0xf100, 0x6003, 0x0001, 0x6007, 0x0041, 0x080c, 0x83f1, 0x080c,
-	0x8973, 0x0c00, 0x2069, 0x0260, 0x6848, 0x9084, 0xff00, 0x9086,
-	0x1200, 0x1198, 0x686c, 0x9084, 0x00ff, 0x0016, 0x6114, 0x918c,
-	0xf700, 0x910d, 0x6116, 0x001e, 0x6003, 0x0001, 0x6007, 0x0043,
-	0x080c, 0x83f1, 0x080c, 0x8973, 0x0828, 0x6868, 0x602e, 0x686c,
-	0x6032, 0x6017, 0xf200, 0x6003, 0x0001, 0x6007, 0x0041, 0x080c,
-	0x83f1, 0x080c, 0x8973, 0x0804, 0xcbf2, 0x2001, 0x180e, 0x2004,
-	0xd0ec, 0x0120, 0x2011, 0x8049, 0x080c, 0x48d9, 0x6017, 0xf300,
-	0x0010, 0x6017, 0xf100, 0x6003, 0x0001, 0x6007, 0x0041, 0x080c,
-	0x83f1, 0x080c, 0x8973, 0x0804, 0xcbf2, 0x6017, 0xf500, 0x0c98,
-	0x6017, 0xf600, 0x0804, 0xcc12, 0x6017, 0xf200, 0x0804, 0xcc12,
-	0xa867, 0x0146, 0xa86b, 0x0000, 0x6008, 0xa886, 0x2c00, 0xa87a,
-	0x7044, 0x9084, 0x0003, 0x9080, 0xcbfa, 0x2005, 0xa87e, 0x2928,
-	0x6010, 0x2058, 0xb8a0, 0xa876, 0xb828, 0xa88a, 0xb82c, 0xa88e,
-	0xb830, 0xa892, 0xb834, 0xa896, 0xa883, 0x003d, 0x2009, 0x0205,
-	0x2104, 0x9085, 0x0080, 0x200a, 0x20e1, 0x0000, 0x2011, 0x0210,
-	0x2214, 0x9294, 0x0fff, 0xaaa2, 0x9282, 0x0111, 0x1a0c, 0x0db4,
-	0x8210, 0x821c, 0x2001, 0x026c, 0x2098, 0xa860, 0x20e8, 0xa85c,
-	0x9080, 0x0029, 0x20a0, 0x2011, 0xccdc, 0x2041, 0x0001, 0x223d,
-	0x9784, 0x00ff, 0x9322, 0x1208, 0x2300, 0x20a8, 0x4003, 0x931a,
-	0x0530, 0x8210, 0xd7fc, 0x1130, 0x8d68, 0x2d0a, 0x2001, 0x0260,
-	0x2098, 0x0c68, 0x2950, 0x080c, 0x1004, 0x0170, 0x2900, 0xb002,
-	0xa867, 0x0147, 0xa86b, 0x0000, 0xa860, 0x20e8, 0xa85c, 0x9080,
-	0x001b, 0x20a0, 0x8840, 0x08d8, 0x2548, 0xa800, 0x902d, 0x0118,
-	0x080c, 0x101d, 0x0cc8, 0x080c, 0x101d, 0x0804, 0xcbfe, 0x2548,
-	0x8847, 0x9885, 0x0046, 0xa866, 0x2009, 0x0205, 0x200b, 0x0000,
-	0x080c, 0xd4d5, 0x0804, 0xcbf2, 0x8010, 0x0004, 0x801a, 0x0006,
-	0x8018, 0x0008, 0x8016, 0x000a, 0x8014, 0x9186, 0x0013, 0x1160,
-	0x6004, 0x908a, 0x0054, 0x1a0c, 0x0db4, 0x9082, 0x0040, 0x0a0c,
-	0x0db4, 0x2008, 0x0804, 0xcd8d, 0x9186, 0x0051, 0x0108, 0x00c0,
-	0x2001, 0x0109, 0x2004, 0xd084, 0x0904, 0xcd3e, 0x0126, 0x2091,
-	0x2800, 0x0006, 0x0016, 0x0026, 0x080c, 0x82dd, 0x002e, 0x001e,
-	0x000e, 0x012e, 0x6000, 0x9086, 0x0002, 0x1580, 0x0804, 0xcdd5,
-	0x9186, 0x0027, 0x0530, 0x9186, 0x0048, 0x0128, 0x9186, 0x0014,
-	0x0500, 0x190c, 0x0db4, 0x2001, 0x0109, 0x2004, 0xd084, 0x01f0,
-	0x00c6, 0x0126, 0x2091, 0x2800, 0x00c6, 0x2061, 0x0100, 0x0006,
-	0x0016, 0x0026, 0x080c, 0x82dd, 0x002e, 0x001e, 0x000e, 0x00ce,
-	0x012e, 0x00ce, 0x6000, 0x9086, 0x0004, 0x190c, 0x0db4, 0x0804,
-	0xceb6, 0x6004, 0x9082, 0x0040, 0x2008, 0x001a, 0x080c, 0x9ec7,
-	0x0005, 0xcd54, 0xcd56, 0xcd56, 0xcd7d, 0xcd54, 0xcd54, 0xcd54,
-	0xcd54, 0xcd54, 0xcd54, 0xcd54, 0xcd54, 0xcd54, 0xcd54, 0xcd54,
-	0xcd54, 0xcd54, 0xcd54, 0xcd54, 0x080c, 0x0db4, 0x080c, 0x886e,
-	0x080c, 0x8973, 0x0036, 0x0096, 0x6014, 0x904d, 0x01d8, 0x080c,
-	0xbb17, 0x01c0, 0x6003, 0x0002, 0x6010, 0x00b6, 0x2058, 0xb800,
-	0x00be, 0xd0bc, 0x1178, 0x2019, 0x0004, 0x080c, 0xd4d5, 0x6017,
-	0x0000, 0x6018, 0x9005, 0x1120, 0x2001, 0x1958, 0x2004, 0x601a,
-	0x6003, 0x0007, 0x009e, 0x003e, 0x0005, 0x0096, 0x080c, 0x886e,
-	0x080c, 0x8973, 0x080c, 0xbb17, 0x0120, 0x6014, 0x2048, 0x080c,
-	0x101d, 0x080c, 0x9e62, 0x009e, 0x0005, 0x0002, 0xcda1, 0xcdb8,
-	0xcda3, 0xcdcf, 0xcda1, 0xcda1, 0xcda1, 0xcda1, 0xcda1, 0xcda1,
-	0xcda1, 0xcda1, 0xcda1, 0xcda1, 0xcda1, 0xcda1, 0xcda1, 0xcda1,
-	0xcda1, 0x080c, 0x0db4, 0x0096, 0x080c, 0x886e, 0x6014, 0x2048,
-	0xa87c, 0xd0b4, 0x0138, 0x6003, 0x0007, 0x2009, 0x0043, 0x080c,
-	0x9eac, 0x0010, 0x6003, 0x0004, 0x080c, 0x8973, 0x009e, 0x0005,
-	0x080c, 0x886e, 0x080c, 0xbb17, 0x0138, 0x6114, 0x0096, 0x2148,
-	0xa97c, 0x009e, 0xd1ec, 0x1138, 0x080c, 0x8204, 0x080c, 0x9e32,
-	0x080c, 0x8973, 0x0005, 0x080c, 0xd72f, 0x0db0, 0x0cc8, 0x080c,
-	0x886e, 0x2009, 0x0041, 0x0804, 0xcf3e, 0x9182, 0x0040, 0x0002,
-	0xcdeb, 0xcded, 0xcdeb, 0xcdeb, 0xcdeb, 0xcdeb, 0xcdeb, 0xcdeb,
-	0xcdeb, 0xcdeb, 0xcdeb, 0xcdeb, 0xcdeb, 0xcdeb, 0xcdeb, 0xcdeb,
-	0xcdeb, 0xcdee, 0xcdeb, 0x080c, 0x0db4, 0x0005, 0x00d6, 0x080c,
-	0x8204, 0x00de, 0x080c, 0xd787, 0x080c, 0x9e32, 0x0005, 0x9182,
-	0x0040, 0x0002, 0xce0d, 0xce0d, 0xce0d, 0xce0d, 0xce0d, 0xce0d,
-	0xce0d, 0xce0d, 0xce0d, 0xce0f, 0xce7e, 0xce0d, 0xce0d, 0xce0d,
-	0xce0d, 0xce7e, 0xce0d, 0xce0d, 0xce0d, 0x080c, 0x0db4, 0x2001,
-	0x0105, 0x2004, 0x9084, 0x1800, 0x01c8, 0x2001, 0x0132, 0x200c,
-	0x2001, 0x0131, 0x2004, 0x9105, 0x1904, 0xce7e, 0x2009, 0x180c,
-	0x2104, 0xd0d4, 0x0904, 0xce7e, 0xc0d4, 0x200a, 0x2009, 0x0105,
-	0x2104, 0x9084, 0xe7fd, 0x9085, 0x0010, 0x200a, 0x2001, 0x1873,
-	0x2004, 0xd0e4, 0x1528, 0x603b, 0x0000, 0x080c, 0x8923, 0x6014,
-	0x0096, 0x2048, 0xa87c, 0xd0fc, 0x0188, 0x908c, 0x0003, 0x918e,
-	0x0002, 0x0508, 0x2001, 0x180c, 0x2004, 0xd0d4, 0x11e0, 0x080c,
-	0x8a4e, 0x2009, 0x0041, 0x009e, 0x0804, 0xcf3e, 0x080c, 0x8a4e,
-	0x6003, 0x0007, 0x601b, 0x0000, 0x080c, 0x8204, 0x009e, 0x0005,
-	0x2001, 0x0100, 0x2004, 0x9082, 0x0005, 0x0aa8, 0x2001, 0x011f,
-	0x2004, 0x603a, 0x0890, 0x2001, 0x180c, 0x200c, 0xc1d4, 0x2102,
-	0xd1cc, 0x0110, 0x080c, 0x2a77, 0x080c, 0x8a4e, 0x6014, 0x2048,
-	0xa97c, 0xd1ec, 0x1130, 0x080c, 0x8204, 0x080c, 0x9e32, 0x009e,
-	0x0005, 0x080c, 0xd72f, 0x0db8, 0x009e, 0x0005, 0x2001, 0x180c,
-	0x200c, 0xc1d4, 0x2102, 0x0036, 0x080c, 0x8923, 0x080c, 0x8a4e,
-	0x6014, 0x0096, 0x2048, 0x6010, 0x00b6, 0x2058, 0xb800, 0x00be,
-	0xd0bc, 0x0188, 0xa87c, 0x9084, 0x0003, 0x9086, 0x0002, 0x0140,
-	0xa8ac, 0x6330, 0x931a, 0x6332, 0xa8b0, 0x632c, 0x931b, 0x632e,
-	0x6003, 0x0002, 0x0080, 0x2019, 0x0004, 0x080c, 0xd4d5, 0x6018,
-	0x9005, 0x1128, 0x2001, 0x1958, 0x2004, 0x8003, 0x601a, 0x6017,
-	0x0000, 0x6003, 0x0007, 0x009e, 0x003e, 0x0005, 0x9182, 0x0040,
-	0x0002, 0xcecd, 0xcecd, 0xcecd, 0xcecd, 0xcecd, 0xcecd, 0xcecd,
-	0xcecd, 0xcecf, 0xcecd, 0xcecd, 0xcecd, 0xcecd, 0xcecd, 0xcecd,
-	0xcecd, 0xcecd, 0xcecd, 0xcecd, 0xcf1a, 0x080c, 0x0db4, 0x6014,
-	0x0096, 0x2048, 0xa834, 0xaa38, 0x6110, 0x00b6, 0x2158, 0xb900,
-	0x00be, 0xd1bc, 0x1190, 0x920d, 0x1518, 0xa87c, 0xd0fc, 0x0128,
-	0x2009, 0x0041, 0x009e, 0x0804, 0xcf3e, 0x6003, 0x0007, 0x601b,
-	0x0000, 0x080c, 0x8204, 0x009e, 0x0005, 0x6124, 0xd1f4, 0x1d58,
-	0x0006, 0x0046, 0xacac, 0x9422, 0xa9b0, 0x2200, 0x910b, 0x6030,
-	0x9420, 0x6432, 0x602c, 0x9109, 0x612e, 0x004e, 0x000e, 0x08d8,
-	0x6110, 0x00b6, 0x2158, 0xb900, 0x00be, 0xd1bc, 0x1178, 0x2009,
-	0x180e, 0x210c, 0xd19c, 0x0118, 0x6003, 0x0007, 0x0010, 0x6003,
-	0x0006, 0x00e9, 0x080c, 0x8206, 0x009e, 0x0005, 0x6003, 0x0002,
-	0x009e, 0x0005, 0x6024, 0xd0f4, 0x0128, 0x080c, 0x150f, 0x1904,
-	0xcecf, 0x0005, 0x6014, 0x0096, 0x2048, 0xa834, 0xa938, 0x009e,
-	0x9105, 0x1120, 0x080c, 0x150f, 0x1904, 0xcecf, 0x0005, 0xd2fc,
-	0x0140, 0x8002, 0x8000, 0x8212, 0x9291, 0x0000, 0x2009, 0x0009,
-	0x0010, 0x2009, 0x0015, 0xaa9a, 0xa896, 0x0005, 0x9182, 0x0040,
-	0x0208, 0x0062, 0x9186, 0x0013, 0x0120, 0x9186, 0x0014, 0x190c,
-	0x0db4, 0x6024, 0xd0dc, 0x090c, 0x0db4, 0x0005, 0xcf61, 0xcf6d,
-	0xcf79, 0xcf85, 0xcf61, 0xcf61, 0xcf61, 0xcf61, 0xcf68, 0xcf63,
-	0xcf63, 0xcf61, 0xcf61, 0xcf61, 0xcf61, 0xcf63, 0xcf61, 0xcf63,
-	0xcf61, 0x080c, 0x0db4, 0x6024, 0xd0dc, 0x090c, 0x0db4, 0x0005,
-	0x6014, 0x9005, 0x190c, 0x0db4, 0x0005, 0x6003, 0x0001, 0x6106,
-	0x080c, 0x83f1, 0x0126, 0x2091, 0x8000, 0x080c, 0x8973, 0x012e,
-	0x0005, 0x6003, 0x0001, 0x6106, 0x080c, 0x83f1, 0x0126, 0x2091,
-	0x8000, 0x080c, 0x8973, 0x012e, 0x0005, 0x6003, 0x0003, 0x6106,
-	0x2c10, 0x080c, 0x1a5c, 0x0126, 0x2091, 0x8000, 0x080c, 0x8456,
-	0x080c, 0x8a4e, 0x012e, 0x0005, 0x0126, 0x2091, 0x8000, 0x0036,
-	0x0096, 0x9182, 0x0040, 0x0023, 0x009e, 0x003e, 0x012e, 0x0005,
-	0xcfb0, 0xcfb2, 0xcfc4, 0xcfde, 0xcfb0, 0xcfb0, 0xcfb0, 0xcfb0,
-	0xcfb0, 0xcfb0, 0xcfb0, 0xcfb0, 0xcfb0, 0xcfb0, 0xcfb0, 0xcfb0,
-	0x080c, 0x0db4, 0x6014, 0x2048, 0xa87c, 0xd0fc, 0x01f8, 0x909c,
-	0x0003, 0x939e, 0x0003, 0x01d0, 0x6003, 0x0001, 0x6106, 0x080c,
-	0x83f1, 0x080c, 0x8973, 0x0470, 0x6014, 0x2048, 0xa87c, 0xd0fc,
-	0x0168, 0x909c, 0x0003, 0x939e, 0x0003, 0x0140, 0x6003, 0x0001,
-	0x6106, 0x080c, 0x83f1, 0x080c, 0x8973, 0x00e0, 0x901e, 0x6316,
-	0x631a, 0x2019, 0x0004, 0x080c, 0xd4d5, 0x00a0, 0x6014, 0x2048,
-	0xa87c, 0xd0fc, 0x0d98, 0x909c, 0x0003, 0x939e, 0x0003, 0x0d70,
-	0x6003, 0x0003, 0x6106, 0x2c10, 0x080c, 0x1a5c, 0x080c, 0x8456,
-	0x080c, 0x8a4e, 0x0005, 0x080c, 0x886e, 0x6114, 0x81ff, 0x0158,
-	0x0096, 0x2148, 0x080c, 0xd7d3, 0x0036, 0x2019, 0x0029, 0x080c,
-	0xd4d5, 0x003e, 0x009e, 0x080c, 0x9e62, 0x080c, 0x8973, 0x0005,
-	0x080c, 0x8923, 0x6114, 0x81ff, 0x0158, 0x0096, 0x2148, 0x080c,
-	0xd7d3, 0x0036, 0x2019, 0x0029, 0x080c, 0xd4d5, 0x003e, 0x009e,
-	0x080c, 0x9e62, 0x080c, 0x8a4e, 0x0005, 0x9182, 0x0085, 0x0002,
-	0xd02f, 0xd02d, 0xd02d, 0xd03b, 0xd02d, 0xd02d, 0xd02d, 0xd02d,
-	0xd02d, 0xd02d, 0xd02d, 0xd02d, 0xd02d, 0x080c, 0x0db4, 0x6003,
-	0x000b, 0x6106, 0x080c, 0x83f1, 0x0126, 0x2091, 0x8000, 0x080c,
-	0x8973, 0x012e, 0x0005, 0x0026, 0x00e6, 0x080c, 0xd726, 0x0118,
-	0x080c, 0x9e32, 0x0450, 0x2071, 0x0260, 0x7224, 0x6216, 0x2001,
-	0x180e, 0x2004, 0xd0e4, 0x0150, 0x6010, 0x00b6, 0x2058, 0xbca0,
-	0x00be, 0x2c00, 0x2011, 0x014e, 0x080c, 0xa152, 0x7220, 0x080c,
-	0xd37b, 0x0118, 0x6007, 0x0086, 0x0040, 0x6007, 0x0087, 0x7224,
-	0x9296, 0xffff, 0x1110, 0x6007, 0x0086, 0x6003, 0x0001, 0x080c,
-	0x83f1, 0x080c, 0x8973, 0x080c, 0x8a4e, 0x00ee, 0x002e, 0x0005,
-	0x9186, 0x0013, 0x1160, 0x6004, 0x908a, 0x0085, 0x0a0c, 0x0db4,
-	0x908a, 0x0092, 0x1a0c, 0x0db4, 0x9082, 0x0085, 0x00a2, 0x9186,
-	0x0027, 0x0130, 0x9186, 0x0014, 0x0118, 0x080c, 0x9ec7, 0x0050,
-	0x2001, 0x0007, 0x080c, 0x61bb, 0x080c, 0x886e, 0x080c, 0x9e62,
-	0x080c, 0x8973, 0x0005, 0xd0a0, 0xd0a2, 0xd0a2, 0xd0a0, 0xd0a0,
-	0xd0a0, 0xd0a0, 0xd0a0, 0xd0a0, 0xd0a0, 0xd0a0, 0xd0a0, 0xd0a0,
-	0x080c, 0x0db4, 0x080c, 0x886e, 0x080c, 0x9e62, 0x080c, 0x8973,
-	0x0005, 0x9182, 0x0085, 0x0a0c, 0x0db4, 0x9182, 0x0092, 0x1a0c,
-	0x0db4, 0x9182, 0x0085, 0x0002, 0xd0c1, 0xd0c1, 0xd0c1, 0xd0c3,
+	0x0005, 0x0006, 0x0016, 0x0026, 0x0036, 0x00c6, 0x81ff, 0x11b8,
+	0x080c, 0x225b, 0x20a1, 0x024c, 0x2001, 0x0014, 0x3518, 0x9312,
+	0x1218, 0x23a8, 0x4003, 0x0418, 0x20a8, 0x4003, 0x82ff, 0x01f8,
+	0x22a8, 0x8108, 0x080c, 0x225b, 0x20a1, 0x0240, 0x0c98, 0x080c,
+	0x225b, 0x2061, 0x1973, 0x6004, 0x20a0, 0x6008, 0x3518, 0x9312,
+	0x1218, 0x23a8, 0x4003, 0x0058, 0x20a8, 0x4003, 0x82ff, 0x0138,
+	0x22a8, 0x8108, 0x080c, 0x225b, 0x20a1, 0x0240, 0x0c98, 0x2061,
+	0x1973, 0x2019, 0x0260, 0x3400, 0x931e, 0x0110, 0x6006, 0x0020,
+	0x2001, 0x0240, 0x6006, 0x8108, 0x2162, 0x9292, 0x0021, 0x9296,
+	0xffff, 0x620a, 0x00ce, 0x003e, 0x002e, 0x001e, 0x000e, 0x0005,
+	0x00b6, 0x0066, 0x6610, 0x2658, 0xbe04, 0x96b4, 0xff00, 0x8637,
+	0x9686, 0x0006, 0x0170, 0x9686, 0x0004, 0x0158, 0xbe04, 0x96b4,
+	0x00ff, 0x9686, 0x0006, 0x0128, 0x9686, 0x0004, 0x0110, 0x9085,
+	0x0001, 0x006e, 0x00be, 0x0005, 0x00d6, 0x080c, 0xc920, 0x00de,
+	0x0005, 0x00d6, 0x080c, 0xc92d, 0x1520, 0x680c, 0x908c, 0xff00,
+	0x6820, 0x9084, 0x00ff, 0x9115, 0x6216, 0x6824, 0x602e, 0xd1e4,
+	0x0130, 0x9006, 0x080c, 0xd863, 0x2009, 0x0001, 0x0078, 0xd1ec,
+	0x0180, 0x6920, 0x918c, 0x00ff, 0x6824, 0x080c, 0x2665, 0x1148,
+	0x2001, 0x0001, 0x080c, 0xd863, 0x2110, 0x900e, 0x080c, 0x3025,
+	0x0018, 0x9085, 0x0001, 0x0008, 0x9006, 0x00de, 0x0005, 0x00b6,
+	0x00c6, 0x080c, 0x9e8f, 0x05a8, 0x0016, 0x0026, 0x00c6, 0x2011,
+	0x0263, 0x2204, 0x8211, 0x220c, 0x080c, 0x2665, 0x1578, 0x080c,
+	0x61e7, 0x1560, 0xbe12, 0xbd16, 0x00ce, 0x002e, 0x001e, 0x2b00,
+	0x6012, 0x080c, 0xd747, 0x11d8, 0x080c, 0x30ff, 0x11c0, 0x080c,
+	0xc888, 0x0510, 0x2001, 0x0007, 0x080c, 0x6198, 0x2001, 0x0007,
+	0x080c, 0x61c4, 0x6017, 0x0000, 0x6023, 0x0001, 0x6007, 0x0001,
+	0x6003, 0x0001, 0x080c, 0x8422, 0x080c, 0x896d, 0x0010, 0x080c,
+	0x9e42, 0x9085, 0x0001, 0x00ce, 0x00be, 0x0005, 0x080c, 0x9e42,
+	0x00ce, 0x002e, 0x001e, 0x0ca8, 0x080c, 0x9e42, 0x9006, 0x0c98,
+	0x2069, 0x026d, 0x6800, 0x9082, 0x0010, 0x1228, 0x6017, 0x0000,
+	0x9085, 0x0001, 0x0008, 0x9006, 0x0005, 0x6017, 0x0000, 0x2069,
+	0x026c, 0x6808, 0x9084, 0xff00, 0x9086, 0x0800, 0x1190, 0x6904,
+	0x9186, 0x0018, 0x0118, 0x9186, 0x0014, 0x1158, 0x810f, 0x6800,
+	0x9084, 0x00ff, 0x910d, 0x615a, 0x908e, 0x0014, 0x0110, 0x908e,
+	0x0010, 0x0005, 0x6004, 0x90b2, 0x0053, 0x1a0c, 0x0db4, 0x91b6,
+	0x0013, 0x1130, 0x2008, 0x91b2, 0x0040, 0x1a04, 0xca75, 0x0092,
+	0x91b6, 0x0027, 0x0120, 0x91b6, 0x0014, 0x190c, 0x0db4, 0x2001,
+	0x0007, 0x080c, 0x61c4, 0x080c, 0x8861, 0x080c, 0x9e72, 0x080c,
+	0x896d, 0x0005, 0xc9aa, 0xc9ac, 0xc9aa, 0xc9aa, 0xc9aa, 0xc9ac,
+	0xc9bb, 0xca6e, 0xca0d, 0xca6e, 0xca1f, 0xca6e, 0xc9bb, 0xca6e,
+	0xca66, 0xca6e, 0xca66, 0xca6e, 0xca6e, 0xc9aa, 0xc9aa, 0xc9aa,
+	0xc9aa, 0xc9aa, 0xc9aa, 0xc9aa, 0xc9aa, 0xc9aa, 0xc9aa, 0xc9aa,
+	0xc9ac, 0xc9aa, 0xca6e, 0xc9aa, 0xc9aa, 0xca6e, 0xc9aa, 0xca6b,
+	0xca6e, 0xc9aa, 0xc9aa, 0xc9aa, 0xc9aa, 0xca6e, 0xca6e, 0xc9aa,
+	0xca6e, 0xca6e, 0xc9aa, 0xc9b6, 0xc9aa, 0xc9aa, 0xc9aa, 0xc9aa,
+	0xca6a, 0xca6e, 0xc9aa, 0xc9aa, 0xca6e, 0xca6e, 0xc9aa, 0xc9aa,
+	0xc9aa, 0xc9aa, 0x080c, 0x0db4, 0x080c, 0x8861, 0x080c, 0xc244,
+	0x6003, 0x0002, 0x080c, 0x896d, 0x0804, 0xca74, 0x9006, 0x080c,
+	0x6184, 0x0804, 0xca6e, 0x080c, 0x6563, 0x1904, 0xca6e, 0x9006,
+	0x080c, 0x6184, 0x6010, 0x2058, 0xb810, 0x9086, 0x00ff, 0x1140,
+	0x00f6, 0x2079, 0x1800, 0x78a4, 0x8000, 0x78a6, 0x00fe, 0x0428,
+	0x6010, 0x2058, 0xb8b0, 0x9005, 0x1178, 0x080c, 0xc22c, 0x1904,
+	0xca6e, 0x0036, 0x0046, 0xbba0, 0x2021, 0x0007, 0x080c, 0x4a86,
+	0x004e, 0x003e, 0x0804, 0xca6e, 0x080c, 0x3130, 0x1904, 0xca6e,
+	0x2001, 0x1800, 0x2004, 0x9086, 0x0002, 0x1138, 0x00f6, 0x2079,
+	0x1800, 0x78a4, 0x8000, 0x78a6, 0x00fe, 0x2001, 0x0002, 0x080c,
+	0x6198, 0x080c, 0x8861, 0x6023, 0x0001, 0x6003, 0x0001, 0x6007,
+	0x0002, 0x080c, 0x8422, 0x080c, 0x896d, 0x6110, 0x2158, 0x2009,
+	0x0001, 0x080c, 0x802f, 0x0804, 0xca74, 0x6610, 0x2658, 0xbe04,
+	0x96b4, 0xff00, 0x8637, 0x9686, 0x0006, 0x0904, 0xca6e, 0x9686,
+	0x0004, 0x0904, 0xca6e, 0x2001, 0x0004, 0x0804, 0xca6c, 0x2001,
+	0x1800, 0x2004, 0x9086, 0x0003, 0x1158, 0x0036, 0x0046, 0x6010,
+	0x2058, 0xbba0, 0x2021, 0x0006, 0x080c, 0x4a86, 0x004e, 0x003e,
+	0x2001, 0x0006, 0x080c, 0xca92, 0x6610, 0x2658, 0xbe04, 0x0066,
+	0x96b4, 0xff00, 0x8637, 0x9686, 0x0006, 0x006e, 0x0168, 0x2001,
+	0x0006, 0x080c, 0x61c4, 0x9284, 0x00ff, 0x908e, 0x0007, 0x1120,
+	0x2001, 0x0006, 0x080c, 0x6198, 0x080c, 0x6563, 0x11f8, 0x2001,
+	0x1836, 0x2004, 0xd0a4, 0x01d0, 0xbe04, 0x96b4, 0x00ff, 0x9686,
+	0x0006, 0x01a0, 0x00f6, 0x2079, 0x1800, 0x78a4, 0x8000, 0x78a6,
+	0x00fe, 0x0804, 0xc9f5, 0x2001, 0x0004, 0x0030, 0x2001, 0x0006,
+	0x0449, 0x0020, 0x0018, 0x0010, 0x080c, 0x61c4, 0x080c, 0x8861,
+	0x080c, 0x9e42, 0x080c, 0x896d, 0x0005, 0x2600, 0x0002, 0xca89,
+	0xca89, 0xca89, 0xca89, 0xca89, 0xca8b, 0xca89, 0xca89, 0xca89,
+	0xca89, 0xca8b, 0xca89, 0xca89, 0xca89, 0xca8b, 0xca8b, 0xca8b,
+	0xca8b, 0x080c, 0x0db4, 0x080c, 0x8861, 0x080c, 0x9e42, 0x080c,
+	0x896d, 0x0005, 0x0016, 0x00b6, 0x00d6, 0x6110, 0x2158, 0xb900,
+	0xd184, 0x0138, 0x080c, 0x6198, 0x9006, 0x080c, 0x6184, 0x080c,
+	0x3005, 0x00de, 0x00be, 0x001e, 0x0005, 0x6610, 0x2658, 0xb804,
+	0x9084, 0xff00, 0x8007, 0x90b2, 0x000c, 0x1a0c, 0x0db4, 0x91b6,
+	0x0015, 0x1110, 0x003b, 0x0028, 0x91b6, 0x0016, 0x190c, 0x0db4,
+	0x006b, 0x0005, 0xa8b2, 0xa8b2, 0xa8b2, 0xa8b2, 0xcb27, 0xa8b2,
+	0xcb11, 0xcad2, 0xa8b2, 0xa8b2, 0xa8b2, 0xa8b2, 0xa8b2, 0xa8b2,
+	0xa8b2, 0xa8b2, 0xcb27, 0xa8b2, 0xcb11, 0xcb18, 0xa8b2, 0xa8b2,
+	0xa8b2, 0xa8b2, 0x00f6, 0x080c, 0x6563, 0x11d8, 0x080c, 0xc22c,
+	0x11c0, 0x6010, 0x905d, 0x01a8, 0xb8b0, 0x9005, 0x0190, 0x9006,
+	0x080c, 0x6184, 0x2001, 0x0002, 0x080c, 0x6198, 0x6023, 0x0001,
+	0x6003, 0x0001, 0x6007, 0x0002, 0x080c, 0x8422, 0x080c, 0x896d,
+	0x00f0, 0x2011, 0x0263, 0x2204, 0x8211, 0x220c, 0x080c, 0x2665,
+	0x11b0, 0x080c, 0x6247, 0x0118, 0x080c, 0x9e42, 0x0080, 0xb810,
+	0x0006, 0xb814, 0x0006, 0xb8b0, 0x0006, 0x080c, 0x5cf4, 0x000e,
+	0xb8b2, 0x000e, 0xb816, 0x000e, 0xb812, 0x080c, 0x9e42, 0x00fe,
+	0x0005, 0x6604, 0x96b6, 0x001e, 0x1110, 0x080c, 0x9e42, 0x0005,
+	0x080c, 0xac98, 0x1148, 0x6003, 0x0001, 0x6007, 0x0001, 0x080c,
+	0x8422, 0x080c, 0x896d, 0x0010, 0x080c, 0x9e42, 0x0005, 0x0804,
+	0x9e42, 0x6004, 0x908a, 0x0053, 0x1a0c, 0x0db4, 0x080c, 0x8861,
+	0x080c, 0x9e72, 0x080c, 0x896d, 0x0005, 0x9182, 0x0040, 0x0002,
+	0xcb4b, 0xcb4b, 0xcb4b, 0xcb4b, 0xcb4d, 0xcb4b, 0xcb4b, 0xcb4b,
+	0xcb4b, 0xcb4b, 0xcb4b, 0xcb4b, 0xcb4b, 0xcb4b, 0xcb4b, 0xcb4b,
+	0xcb4b, 0xcb4b, 0xcb4b, 0x080c, 0x0db4, 0x0096, 0x00b6, 0x00d6,
+	0x00e6, 0x00f6, 0x0046, 0x0026, 0x6210, 0x2258, 0xb8ac, 0x9005,
+	0x11a8, 0x6106, 0x2071, 0x0260, 0x7444, 0x94a4, 0xff00, 0x0904,
+	0xcbb3, 0x080c, 0xd857, 0x1170, 0x9486, 0x2000, 0x1158, 0x2009,
+	0x0001, 0x2011, 0x0200, 0x080c, 0x8218, 0x0020, 0x9026, 0x080c,
+	0xd78c, 0x0c38, 0x080c, 0x0feb, 0x090c, 0x0db4, 0x6003, 0x0007,
+	0xa867, 0x010d, 0x9006, 0xa802, 0xa86a, 0xac8a, 0x2c00, 0xa88e,
+	0x6008, 0xa8e2, 0x6010, 0x2058, 0xb8a0, 0x7130, 0xa97a, 0x0016,
+	0xa876, 0xa87f, 0x0000, 0xa883, 0x0000, 0xa887, 0x0036, 0x080c,
+	0x6891, 0x001e, 0x080c, 0xd857, 0x1904, 0xcc13, 0x9486, 0x2000,
+	0x1130, 0x2019, 0x0017, 0x080c, 0xd4c7, 0x0804, 0xcc13, 0x9486,
+	0x0200, 0x1120, 0x080c, 0xd463, 0x0804, 0xcc13, 0x9486, 0x0400,
+	0x0120, 0x9486, 0x1000, 0x1904, 0xcc13, 0x2019, 0x0002, 0x080c,
+	0xd47e, 0x0804, 0xcc13, 0x2069, 0x1a40, 0x6a00, 0xd284, 0x0904,
+	0xcc7d, 0x9284, 0x0300, 0x1904, 0xcc76, 0x6804, 0x9005, 0x0904,
+	0xcc5e, 0x2d78, 0x6003, 0x0007, 0x080c, 0x1004, 0x0904, 0xcc1f,
+	0x7800, 0xd08c, 0x1118, 0x7804, 0x8001, 0x7806, 0x6017, 0x0000,
+	0x2001, 0x180f, 0x2004, 0xd084, 0x1904, 0xcc81, 0x9006, 0xa802,
+	0xa867, 0x0116, 0xa86a, 0x6008, 0xa8e2, 0x2c00, 0xa87a, 0x6010,
+	0x2058, 0xb8a0, 0x7130, 0xa9b6, 0xa876, 0xb928, 0xa9ba, 0xb92c,
+	0xa9be, 0xb930, 0xa9c2, 0xb934, 0xa9c6, 0xa883, 0x003d, 0x7044,
+	0x9084, 0x0003, 0x9080, 0xcc1b, 0x2005, 0xa87e, 0x20a9, 0x000a,
+	0x2001, 0x0270, 0xaa5c, 0x9290, 0x0021, 0x2009, 0x0205, 0x200b,
+	0x0080, 0x20e1, 0x0000, 0xab60, 0x23e8, 0x2098, 0x22a0, 0x4003,
+	0x200b, 0x0000, 0x2001, 0x027a, 0x200c, 0xa9b2, 0x8000, 0x200c,
+	0xa9ae, 0x080c, 0x6891, 0x002e, 0x004e, 0x00fe, 0x00ee, 0x00de,
+	0x00be, 0x009e, 0x0005, 0x0000, 0x0080, 0x0040, 0x0000, 0x2001,
+	0x1810, 0x2004, 0xd084, 0x0120, 0x080c, 0x0feb, 0x1904, 0xcbc8,
+	0x6017, 0xf100, 0x6003, 0x0001, 0x6007, 0x0041, 0x080c, 0x83da,
+	0x080c, 0x896d, 0x0c00, 0x2069, 0x0260, 0x6848, 0x9084, 0xff00,
+	0x9086, 0x1200, 0x1198, 0x686c, 0x9084, 0x00ff, 0x0016, 0x6114,
+	0x918c, 0xf700, 0x910d, 0x6116, 0x001e, 0x6003, 0x0001, 0x6007,
+	0x0043, 0x080c, 0x83da, 0x080c, 0x896d, 0x0828, 0x6868, 0x602e,
+	0x686c, 0x6032, 0x6017, 0xf200, 0x6003, 0x0001, 0x6007, 0x0041,
+	0x080c, 0x83da, 0x080c, 0x896d, 0x0804, 0xcc13, 0x2001, 0x180e,
+	0x2004, 0xd0ec, 0x0120, 0x2011, 0x8049, 0x080c, 0x48e9, 0x6017,
+	0xf300, 0x0010, 0x6017, 0xf100, 0x6003, 0x0001, 0x6007, 0x0041,
+	0x080c, 0x83da, 0x080c, 0x896d, 0x0804, 0xcc13, 0x6017, 0xf500,
+	0x0c98, 0x6017, 0xf600, 0x0804, 0xcc33, 0x6017, 0xf200, 0x0804,
+	0xcc33, 0xa867, 0x0146, 0xa86b, 0x0000, 0x6008, 0xa886, 0x2c00,
+	0xa87a, 0x7044, 0x9084, 0x0003, 0x9080, 0xcc1b, 0x2005, 0xa87e,
+	0x2928, 0x6010, 0x2058, 0xb8a0, 0xa876, 0xb828, 0xa88a, 0xb82c,
+	0xa88e, 0xb830, 0xa892, 0xb834, 0xa896, 0xa883, 0x003d, 0x2009,
+	0x0205, 0x2104, 0x9085, 0x0080, 0x200a, 0x20e1, 0x0000, 0x2011,
+	0x0210, 0x2214, 0x9294, 0x0fff, 0xaaa2, 0x9282, 0x0111, 0x1a0c,
+	0x0db4, 0x8210, 0x821c, 0x2001, 0x026c, 0x2098, 0xa860, 0x20e8,
+	0xa85c, 0x9080, 0x0029, 0x20a0, 0x2011, 0xccfd, 0x2041, 0x0001,
+	0x223d, 0x9784, 0x00ff, 0x9322, 0x1208, 0x2300, 0x20a8, 0x4003,
+	0x931a, 0x0530, 0x8210, 0xd7fc, 0x1130, 0x8d68, 0x2d0a, 0x2001,
+	0x0260, 0x2098, 0x0c68, 0x2950, 0x080c, 0x1004, 0x0170, 0x2900,
+	0xb002, 0xa867, 0x0147, 0xa86b, 0x0000, 0xa860, 0x20e8, 0xa85c,
+	0x9080, 0x001b, 0x20a0, 0x8840, 0x08d8, 0x2548, 0xa800, 0x902d,
+	0x0118, 0x080c, 0x101d, 0x0cc8, 0x080c, 0x101d, 0x0804, 0xcc1f,
+	0x2548, 0x8847, 0x9885, 0x0046, 0xa866, 0x2009, 0x0205, 0x200b,
+	0x0000, 0x080c, 0xd4f6, 0x0804, 0xcc13, 0x8010, 0x0004, 0x801a,
+	0x0006, 0x8018, 0x0008, 0x8016, 0x000a, 0x8014, 0x9186, 0x0013,
+	0x1160, 0x6004, 0x908a, 0x0054, 0x1a0c, 0x0db4, 0x9082, 0x0040,
+	0x0a0c, 0x0db4, 0x2008, 0x0804, 0xcdae, 0x9186, 0x0051, 0x0108,
+	0x00c0, 0x2001, 0x0109, 0x2004, 0xd084, 0x0904, 0xcd5f, 0x0126,
+	0x2091, 0x2800, 0x0006, 0x0016, 0x0026, 0x080c, 0x82c6, 0x002e,
+	0x001e, 0x000e, 0x012e, 0x6000, 0x9086, 0x0002, 0x1580, 0x0804,
+	0xcdf6, 0x9186, 0x0027, 0x0530, 0x9186, 0x0048, 0x0128, 0x9186,
+	0x0014, 0x0500, 0x190c, 0x0db4, 0x2001, 0x0109, 0x2004, 0xd084,
+	0x01f0, 0x00c6, 0x0126, 0x2091, 0x2800, 0x00c6, 0x2061, 0x0100,
+	0x0006, 0x0016, 0x0026, 0x080c, 0x82c6, 0x002e, 0x001e, 0x000e,
+	0x00ce, 0x012e, 0x00ce, 0x6000, 0x9086, 0x0004, 0x190c, 0x0db4,
+	0x0804, 0xced7, 0x6004, 0x9082, 0x0040, 0x2008, 0x001a, 0x080c,
+	0x9ed7, 0x0005, 0xcd75, 0xcd77, 0xcd77, 0xcd9e, 0xcd75, 0xcd75,
+	0xcd75, 0xcd75, 0xcd75, 0xcd75, 0xcd75, 0xcd75, 0xcd75, 0xcd75,
+	0xcd75, 0xcd75, 0xcd75, 0xcd75, 0xcd75, 0x080c, 0x0db4, 0x080c,
+	0x8861, 0x080c, 0x896d, 0x0036, 0x0096, 0x6014, 0x904d, 0x01d8,
+	0x080c, 0xbb2c, 0x01c0, 0x6003, 0x0002, 0x6010, 0x00b6, 0x2058,
+	0xb800, 0x00be, 0xd0bc, 0x1178, 0x2019, 0x0004, 0x080c, 0xd4f6,
+	0x6017, 0x0000, 0x6018, 0x9005, 0x1120, 0x2001, 0x1957, 0x2004,
+	0x601a, 0x6003, 0x0007, 0x009e, 0x003e, 0x0005, 0x0096, 0x080c,
+	0x8861, 0x080c, 0x896d, 0x080c, 0xbb2c, 0x0120, 0x6014, 0x2048,
+	0x080c, 0x101d, 0x080c, 0x9e72, 0x009e, 0x0005, 0x0002, 0xcdc2,
+	0xcdd9, 0xcdc4, 0xcdf0, 0xcdc2, 0xcdc2, 0xcdc2, 0xcdc2, 0xcdc2,
+	0xcdc2, 0xcdc2, 0xcdc2, 0xcdc2, 0xcdc2, 0xcdc2, 0xcdc2, 0xcdc2,
+	0xcdc2, 0xcdc2, 0x080c, 0x0db4, 0x0096, 0x080c, 0x8861, 0x6014,
+	0x2048, 0xa87c, 0xd0b4, 0x0138, 0x6003, 0x0007, 0x2009, 0x0043,
+	0x080c, 0x9ebc, 0x0010, 0x6003, 0x0004, 0x080c, 0x896d, 0x009e,
+	0x0005, 0x080c, 0x8861, 0x080c, 0xbb2c, 0x0138, 0x6114, 0x0096,
+	0x2148, 0xa97c, 0x009e, 0xd1ec, 0x1138, 0x080c, 0x81ed, 0x080c,
+	0x9e42, 0x080c, 0x896d, 0x0005, 0x080c, 0xd750, 0x0db0, 0x0cc8,
+	0x080c, 0x8861, 0x2009, 0x0041, 0x0804, 0xcf5f, 0x9182, 0x0040,
+	0x0002, 0xce0c, 0xce0e, 0xce0c, 0xce0c, 0xce0c, 0xce0c, 0xce0c,
+	0xce0c, 0xce0c, 0xce0c, 0xce0c, 0xce0c, 0xce0c, 0xce0c, 0xce0c,
+	0xce0c, 0xce0c, 0xce0f, 0xce0c, 0x080c, 0x0db4, 0x0005, 0x00d6,
+	0x080c, 0x81ed, 0x00de, 0x080c, 0xd7a8, 0x080c, 0x9e42, 0x0005,
+	0x9182, 0x0040, 0x0002, 0xce2e, 0xce2e, 0xce2e, 0xce2e, 0xce2e,
+	0xce2e, 0xce2e, 0xce2e, 0xce2e, 0xce30, 0xce9f, 0xce2e, 0xce2e,
+	0xce2e, 0xce2e, 0xce9f, 0xce2e, 0xce2e, 0xce2e, 0x080c, 0x0db4,
+	0x2001, 0x0105, 0x2004, 0x9084, 0x1800, 0x01c8, 0x2001, 0x0132,
+	0x200c, 0x2001, 0x0131, 0x2004, 0x9105, 0x1904, 0xce9f, 0x2009,
+	0x180c, 0x2104, 0xd0d4, 0x0904, 0xce9f, 0xc0d4, 0x200a, 0x2009,
+	0x0105, 0x2104, 0x9084, 0xe7fd, 0x9085, 0x0010, 0x200a, 0x2001,
+	0x1873, 0x2004, 0xd0e4, 0x1528, 0x603b, 0x0000, 0x080c, 0x891d,
+	0x6014, 0x0096, 0x2048, 0xa87c, 0xd0fc, 0x0188, 0x908c, 0x0003,
+	0x918e, 0x0002, 0x0508, 0x2001, 0x180c, 0x2004, 0xd0d4, 0x11e0,
+	0x080c, 0x8a4a, 0x2009, 0x0041, 0x009e, 0x0804, 0xcf5f, 0x080c,
+	0x8a4a, 0x6003, 0x0007, 0x601b, 0x0000, 0x080c, 0x81ed, 0x009e,
+	0x0005, 0x2001, 0x0100, 0x2004, 0x9082, 0x0005, 0x0aa8, 0x2001,
+	0x011f, 0x2004, 0x603a, 0x0890, 0x2001, 0x180c, 0x200c, 0xc1d4,
+	0x2102, 0xd1cc, 0x0110, 0x080c, 0x2a79, 0x080c, 0x8a4a, 0x6014,
+	0x2048, 0xa97c, 0xd1ec, 0x1130, 0x080c, 0x81ed, 0x080c, 0x9e42,
+	0x009e, 0x0005, 0x080c, 0xd750, 0x0db8, 0x009e, 0x0005, 0x2001,
+	0x180c, 0x200c, 0xc1d4, 0x2102, 0x0036, 0x080c, 0x891d, 0x080c,
+	0x8a4a, 0x6014, 0x0096, 0x2048, 0x6010, 0x00b6, 0x2058, 0xb800,
+	0x00be, 0xd0bc, 0x0188, 0xa87c, 0x9084, 0x0003, 0x9086, 0x0002,
+	0x0140, 0xa8ac, 0x6330, 0x931a, 0x6332, 0xa8b0, 0x632c, 0x931b,
+	0x632e, 0x6003, 0x0002, 0x0080, 0x2019, 0x0004, 0x080c, 0xd4f6,
+	0x6018, 0x9005, 0x1128, 0x2001, 0x1957, 0x2004, 0x8003, 0x601a,
+	0x6017, 0x0000, 0x6003, 0x0007, 0x009e, 0x003e, 0x0005, 0x9182,
+	0x0040, 0x0002, 0xceee, 0xceee, 0xceee, 0xceee, 0xceee, 0xceee,
+	0xceee, 0xceee, 0xcef0, 0xceee, 0xceee, 0xceee, 0xceee, 0xceee,
+	0xceee, 0xceee, 0xceee, 0xceee, 0xceee, 0xcf3b, 0x080c, 0x0db4,
+	0x6014, 0x0096, 0x2048, 0xa834, 0xaa38, 0x6110, 0x00b6, 0x2158,
+	0xb900, 0x00be, 0xd1bc, 0x1190, 0x920d, 0x1518, 0xa87c, 0xd0fc,
+	0x0128, 0x2009, 0x0041, 0x009e, 0x0804, 0xcf5f, 0x6003, 0x0007,
+	0x601b, 0x0000, 0x080c, 0x81ed, 0x009e, 0x0005, 0x6124, 0xd1f4,
+	0x1d58, 0x0006, 0x0046, 0xacac, 0x9422, 0xa9b0, 0x2200, 0x910b,
+	0x6030, 0x9420, 0x6432, 0x602c, 0x9109, 0x612e, 0x004e, 0x000e,
+	0x08d8, 0x6110, 0x00b6, 0x2158, 0xb900, 0x00be, 0xd1bc, 0x1178,
+	0x2009, 0x180e, 0x210c, 0xd19c, 0x0118, 0x6003, 0x0007, 0x0010,
+	0x6003, 0x0006, 0x00e9, 0x080c, 0x81ef, 0x009e, 0x0005, 0x6003,
+	0x0002, 0x009e, 0x0005, 0x6024, 0xd0f4, 0x0128, 0x080c, 0x1511,
+	0x1904, 0xcef0, 0x0005, 0x6014, 0x0096, 0x2048, 0xa834, 0xa938,
+	0x009e, 0x9105, 0x1120, 0x080c, 0x1511, 0x1904, 0xcef0, 0x0005,
+	0xd2fc, 0x0140, 0x8002, 0x8000, 0x8212, 0x9291, 0x0000, 0x2009,
+	0x0009, 0x0010, 0x2009, 0x0015, 0xaa9a, 0xa896, 0x0005, 0x9182,
+	0x0040, 0x0208, 0x0062, 0x9186, 0x0013, 0x0120, 0x9186, 0x0014,
+	0x190c, 0x0db4, 0x6024, 0xd0dc, 0x090c, 0x0db4, 0x0005, 0xcf82,
+	0xcf8e, 0xcf9a, 0xcfa6, 0xcf82, 0xcf82, 0xcf82, 0xcf82, 0xcf89,
+	0xcf84, 0xcf84, 0xcf82, 0xcf82, 0xcf82, 0xcf82, 0xcf84, 0xcf82,
+	0xcf84, 0xcf82, 0x080c, 0x0db4, 0x6024, 0xd0dc, 0x090c, 0x0db4,
+	0x0005, 0x6014, 0x9005, 0x190c, 0x0db4, 0x0005, 0x6003, 0x0001,
+	0x6106, 0x080c, 0x83da, 0x0126, 0x2091, 0x8000, 0x080c, 0x896d,
+	0x012e, 0x0005, 0x6003, 0x0001, 0x6106, 0x080c, 0x83da, 0x0126,
+	0x2091, 0x8000, 0x080c, 0x896d, 0x012e, 0x0005, 0x6003, 0x0003,
+	0x6106, 0x2c10, 0x080c, 0x1a5e, 0x0126, 0x2091, 0x8000, 0x080c,
+	0x843f, 0x080c, 0x8a4a, 0x012e, 0x0005, 0x0126, 0x2091, 0x8000,
+	0x0036, 0x0096, 0x9182, 0x0040, 0x0023, 0x009e, 0x003e, 0x012e,
+	0x0005, 0xcfd1, 0xcfd3, 0xcfe5, 0xcfff, 0xcfd1, 0xcfd1, 0xcfd1,
+	0xcfd1, 0xcfd1, 0xcfd1, 0xcfd1, 0xcfd1, 0xcfd1, 0xcfd1, 0xcfd1,
+	0xcfd1, 0x080c, 0x0db4, 0x6014, 0x2048, 0xa87c, 0xd0fc, 0x01f8,
+	0x909c, 0x0003, 0x939e, 0x0003, 0x01d0, 0x6003, 0x0001, 0x6106,
+	0x080c, 0x83da, 0x080c, 0x896d, 0x0470, 0x6014, 0x2048, 0xa87c,
+	0xd0fc, 0x0168, 0x909c, 0x0003, 0x939e, 0x0003, 0x0140, 0x6003,
+	0x0001, 0x6106, 0x080c, 0x83da, 0x080c, 0x896d, 0x00e0, 0x901e,
+	0x6316, 0x631a, 0x2019, 0x0004, 0x080c, 0xd4f6, 0x00a0, 0x6014,
+	0x2048, 0xa87c, 0xd0fc, 0x0d98, 0x909c, 0x0003, 0x939e, 0x0003,
+	0x0d70, 0x6003, 0x0003, 0x6106, 0x2c10, 0x080c, 0x1a5e, 0x080c,
+	0x843f, 0x080c, 0x8a4a, 0x0005, 0x080c, 0x8861, 0x6114, 0x81ff,
+	0x0158, 0x0096, 0x2148, 0x080c, 0xd7f4, 0x0036, 0x2019, 0x0029,
+	0x080c, 0xd4f6, 0x003e, 0x009e, 0x080c, 0x9e72, 0x080c, 0x896d,
+	0x0005, 0x080c, 0x891d, 0x6114, 0x81ff, 0x0158, 0x0096, 0x2148,
+	0x080c, 0xd7f4, 0x0036, 0x2019, 0x0029, 0x080c, 0xd4f6, 0x003e,
+	0x009e, 0x080c, 0x9e72, 0x080c, 0x8a4a, 0x0005, 0x9182, 0x0085,
+	0x0002, 0xd050, 0xd04e, 0xd04e, 0xd05c, 0xd04e, 0xd04e, 0xd04e,
+	0xd04e, 0xd04e, 0xd04e, 0xd04e, 0xd04e, 0xd04e, 0x080c, 0x0db4,
+	0x6003, 0x000b, 0x6106, 0x080c, 0x83da, 0x0126, 0x2091, 0x8000,
+	0x080c, 0x896d, 0x012e, 0x0005, 0x0026, 0x00e6, 0x080c, 0xd747,
+	0x0118, 0x080c, 0x9e42, 0x0450, 0x2071, 0x0260, 0x7224, 0x6216,
+	0x2001, 0x180e, 0x2004, 0xd0e4, 0x0150, 0x6010, 0x00b6, 0x2058,
+	0xbca0, 0x00be, 0x2c00, 0x2011, 0x014e, 0x080c, 0xa162, 0x7220,
+	0x080c, 0xd39c, 0x0118, 0x6007, 0x0086, 0x0040, 0x6007, 0x0087,
+	0x7224, 0x9296, 0xffff, 0x1110, 0x6007, 0x0086, 0x6003, 0x0001,
+	0x080c, 0x83da, 0x080c, 0x896d, 0x080c, 0x8a4a, 0x00ee, 0x002e,
+	0x0005, 0x9186, 0x0013, 0x1160, 0x6004, 0x908a, 0x0085, 0x0a0c,
+	0x0db4, 0x908a, 0x0092, 0x1a0c, 0x0db4, 0x9082, 0x0085, 0x00a2,
+	0x9186, 0x0027, 0x0130, 0x9186, 0x0014, 0x0118, 0x080c, 0x9ed7,
+	0x0050, 0x2001, 0x0007, 0x080c, 0x61c4, 0x080c, 0x8861, 0x080c,
+	0x9e72, 0x080c, 0x896d, 0x0005, 0xd0c1, 0xd0c3, 0xd0c3, 0xd0c1,
 	0xd0c1, 0xd0c1, 0xd0c1, 0xd0c1, 0xd0c1, 0xd0c1, 0xd0c1, 0xd0c1,
-	0xd0c1, 0x080c, 0x0db4, 0x0005, 0x9186, 0x0013, 0x0148, 0x9186,
-	0x0014, 0x0130, 0x9186, 0x0027, 0x0118, 0x080c, 0x9ec7, 0x0030,
-	0x080c, 0x886e, 0x080c, 0x9e62, 0x080c, 0x8973, 0x0005, 0x0036,
-	0x080c, 0xd787, 0x6043, 0x0000, 0x2019, 0x000b, 0x0031, 0x6023,
-	0x0006, 0x6003, 0x0007, 0x003e, 0x0005, 0x0126, 0x0036, 0x2091,
-	0x8000, 0x0086, 0x2c40, 0x0096, 0x904e, 0x080c, 0x97ba, 0x009e,
-	0x008e, 0x1550, 0x0076, 0x2c38, 0x080c, 0x9865, 0x007e, 0x1520,
-	0x6000, 0x9086, 0x0000, 0x0500, 0x6020, 0x9086, 0x0007, 0x01e0,
-	0x0096, 0x601c, 0xd084, 0x0140, 0x080c, 0xd787, 0x080c, 0xc22a,
-	0x080c, 0x190d, 0x6023, 0x0007, 0x6014, 0x2048, 0x080c, 0xbb17,
-	0x0110, 0x080c, 0xd4d5, 0x009e, 0x6017, 0x0000, 0x080c, 0xd787,
-	0x6023, 0x0007, 0x080c, 0xc22a, 0x003e, 0x012e, 0x0005, 0x00f6,
-	0x00c6, 0x00b6, 0x0036, 0x0156, 0x2079, 0x0260, 0x7938, 0x783c,
-	0x080c, 0x2663, 0x15c8, 0x0016, 0x00c6, 0x080c, 0x623e, 0x1590,
-	0x001e, 0x00c6, 0x2160, 0x080c, 0xc227, 0x00ce, 0x002e, 0x0026,
-	0x0016, 0x2019, 0x0029, 0x080c, 0x9926, 0x080c, 0x8571, 0x0076,
-	0x903e, 0x080c, 0x8469, 0x007e, 0x001e, 0x0076, 0x903e, 0x080c,
-	0xd29b, 0x007e, 0x0026, 0xba04, 0x9294, 0xff00, 0x8217, 0x9286,
-	0x0006, 0x0118, 0x9286, 0x0004, 0x1118, 0xbaa0, 0x080c, 0x3097,
-	0x002e, 0xbcb0, 0x001e, 0x080c, 0x5ceb, 0xbe12, 0xbd16, 0xbcb2,
-	0x9006, 0x0010, 0x00ce, 0x001e, 0x015e, 0x003e, 0x00be, 0x00ce,
-	0x00fe, 0x0005, 0x00c6, 0x00d6, 0x00b6, 0x0016, 0x2009, 0x1823,
-	0x2104, 0x9086, 0x0074, 0x1904, 0xd1c3, 0x2069, 0x0260, 0x6944,
-	0x9182, 0x0100, 0x06e0, 0x6940, 0x9184, 0x8000, 0x0904, 0xd1c0,
-	0x2001, 0x194d, 0x2004, 0x9005, 0x1140, 0x6010, 0x2058, 0xb8b0,
-	0x9005, 0x0118, 0x9184, 0x0800, 0x0598, 0x6948, 0x918a, 0x0001,
-	0x0648, 0x080c, 0xd83b, 0x0118, 0x6978, 0xd1fc, 0x11b8, 0x2009,
-	0x0205, 0x200b, 0x0001, 0x693c, 0x81ff, 0x1198, 0x6944, 0x9182,
-	0x0100, 0x02a8, 0x6940, 0x81ff, 0x1178, 0x6948, 0x918a, 0x0001,
-	0x0288, 0x6950, 0x918a, 0x0001, 0x0298, 0x00d0, 0x6017, 0x0100,
-	0x00a0, 0x6017, 0x0300, 0x0088, 0x6017, 0x0500, 0x0070, 0x6017,
-	0x0700, 0x0058, 0x6017, 0x0900, 0x0040, 0x6017, 0x0b00, 0x0028,
-	0x6017, 0x0f00, 0x0010, 0x6017, 0x2d00, 0x9085, 0x0001, 0x0008,
-	0x9006, 0x001e, 0x00be, 0x00de, 0x00ce, 0x0005, 0x00c6, 0x00b6,
-	0x0026, 0x0036, 0x0156, 0x6210, 0x2258, 0xbb04, 0x9394, 0x00ff,
-	0x9286, 0x0006, 0x0180, 0x9286, 0x0004, 0x0168, 0x9394, 0xff00,
-	0x8217, 0x9286, 0x0006, 0x0138, 0x9286, 0x0004, 0x0120, 0x080c,
-	0x624d, 0x0804, 0xd22a, 0x2011, 0x0276, 0x20a9, 0x0004, 0x0096,
-	0x2b48, 0x2019, 0x000a, 0x080c, 0xae0d, 0x009e, 0x15a0, 0x2011,
-	0x027a, 0x20a9, 0x0004, 0x0096, 0x2b48, 0x2019, 0x0006, 0x080c,
-	0xae0d, 0x009e, 0x1540, 0x0046, 0x0016, 0xbaa0, 0x2220, 0x9006,
-	0x2009, 0x1854, 0x210c, 0x0038, 0x2009, 0x0029, 0x080c, 0xd52a,
-	0xb800, 0xc0e5, 0xb802, 0x2019, 0x0029, 0x080c, 0x8571, 0x0076,
-	0x2039, 0x0000, 0x080c, 0x8469, 0x2c08, 0x080c, 0xd29b, 0x007e,
-	0x2001, 0x0007, 0x080c, 0x61bb, 0x2001, 0x0007, 0x080c, 0x618f,
-	0x001e, 0x004e, 0x9006, 0x015e, 0x003e, 0x002e, 0x00be, 0x00ce,
-	0x0005, 0x00d6, 0x2069, 0x026e, 0x6800, 0x9086, 0x0800, 0x0118,
-	0x6017, 0x0000, 0x0008, 0x9006, 0x00de, 0x0005, 0x00b6, 0x00f6,
-	0x0016, 0x0026, 0x0036, 0x0156, 0x2079, 0x026c, 0x7930, 0x7834,
-	0x080c, 0x2663, 0x11d0, 0x080c, 0x623e, 0x11b8, 0x2011, 0x0270,
-	0x20a9, 0x0004, 0x0096, 0x2b48, 0x2019, 0x000a, 0x080c, 0xae0d,
-	0x009e, 0x1158, 0x2011, 0x0274, 0x20a9, 0x0004, 0x0096, 0x2b48,
-	0x2019, 0x0006, 0x080c, 0xae0d, 0x009e, 0x015e, 0x003e, 0x002e,
-	0x001e, 0x00fe, 0x00be, 0x0005, 0x00b6, 0x0006, 0x0016, 0x0026,
-	0x0036, 0x0156, 0x2011, 0x0263, 0x2204, 0x8211, 0x220c, 0x080c,
-	0x2663, 0x11d0, 0x080c, 0x623e, 0x11b8, 0x2011, 0x0276, 0x20a9,
-	0x0004, 0x0096, 0x2b48, 0x2019, 0x000a, 0x080c, 0xae0d, 0x009e,
-	0x1158, 0x2011, 0x027a, 0x20a9, 0x0004, 0x0096, 0x2b48, 0x2019,
-	0x0006, 0x080c, 0xae0d, 0x009e, 0x015e, 0x003e, 0x002e, 0x001e,
-	0x000e, 0x00be, 0x0005, 0x00e6, 0x00c6, 0x0086, 0x0076, 0x0066,
-	0x0056, 0x0046, 0x0026, 0x0126, 0x2091, 0x8000, 0x2740, 0x2029,
-	0x19c1, 0x252c, 0x2021, 0x19c7, 0x2424, 0x2061, 0x1cd0, 0x2071,
-	0x1800, 0x7650, 0x7070, 0x81ff, 0x0150, 0x0006, 0x9186, 0x1a80,
-	0x000e, 0x0128, 0x8001, 0x9602, 0x1a04, 0xd334, 0x0018, 0x9606,
-	0x0904, 0xd334, 0x2100, 0x9c06, 0x0904, 0xd32b, 0x080c, 0xd56b,
-	0x1904, 0xd32b, 0x080c, 0xd858, 0x0904, 0xd32b, 0x080c, 0xd55b,
-	0x0904, 0xd32b, 0x6720, 0x9786, 0x0001, 0x1148, 0x080c, 0x312e,
-	0x0904, 0xd34f, 0x6004, 0x9086, 0x0000, 0x1904, 0xd34f, 0x9786,
-	0x0004, 0x0904, 0xd34f, 0x9786, 0x0007, 0x0904, 0xd32b, 0x2500,
-	0x9c06, 0x0904, 0xd32b, 0x2400, 0x9c06, 0x05e8, 0x88ff, 0x0118,
-	0x6054, 0x9906, 0x15c0, 0x0096, 0x6000, 0x9086, 0x0004, 0x1120,
-	0x0016, 0x080c, 0x190d, 0x001e, 0x9786, 0x000a, 0x0148, 0x080c,
-	0xbd1d, 0x1130, 0x080c, 0xa7c0, 0x009e, 0x080c, 0x9e62, 0x0418,
-	0x6014, 0x2048, 0x080c, 0xbb17, 0x01d8, 0x9786, 0x0003, 0x1570,
-	0xa867, 0x0103, 0xa87c, 0xd0cc, 0x0130, 0x0096, 0xa878, 0x2048,
-	0x080c, 0x0f9d, 0x009e, 0xab7a, 0xa877, 0x0000, 0x080c, 0xd7d3,
-	0x0016, 0x080c, 0xbe06, 0x080c, 0x687f, 0x001e, 0x080c, 0xbd00,
-	0x009e, 0x080c, 0x9e62, 0x9ce0, 0x0018, 0x2001, 0x1819, 0x2004,
-	0x9c02, 0x1210, 0x0804, 0xd2af, 0x012e, 0x002e, 0x004e, 0x005e,
-	0x006e, 0x007e, 0x008e, 0x00ce, 0x00ee, 0x0005, 0x9786, 0x0006,
-	0x1150, 0x9386, 0x0005, 0x0128, 0x080c, 0xd7d3, 0x080c, 0xd4d5,
-	0x08f8, 0x009e, 0x0c00, 0x9786, 0x000a, 0x0920, 0x0808, 0x81ff,
-	0x09d0, 0x9180, 0x0001, 0x2004, 0x9086, 0x0018, 0x0130, 0x9180,
-	0x0001, 0x2004, 0x9086, 0x002d, 0x1970, 0x6000, 0x9086, 0x0002,
-	0x1950, 0x080c, 0xbd0c, 0x0130, 0x080c, 0xbd1d, 0x1920, 0x080c,
-	0xa7c0, 0x0038, 0x080c, 0x3003, 0x080c, 0xbd1d, 0x1110, 0x080c,
-	0xa7c0, 0x080c, 0x9e62, 0x0804, 0xd32b, 0xa864, 0x9084, 0x00ff,
-	0x9086, 0x0039, 0x0005, 0x00c6, 0x00e6, 0x0016, 0x2c08, 0x2170,
-	0x9006, 0x080c, 0xd4fc, 0x001e, 0x0120, 0x6020, 0x9084, 0x000f,
-	0x001b, 0x00ee, 0x00ce, 0x0005, 0xd39a, 0xd39a, 0xd39a, 0xd39a,
-	0xd39a, 0xd39a, 0xd39c, 0xd39a, 0xd39a, 0xd39a, 0xd39a, 0x9e62,
-	0x9e62, 0xd39a, 0x9006, 0x0005, 0x0036, 0x0046, 0x0016, 0x7010,
-	0x00b6, 0x2058, 0xbca0, 0x00be, 0x2c00, 0x2009, 0x0020, 0x080c,
-	0xd52a, 0x001e, 0x004e, 0x2019, 0x0002, 0x080c, 0xd0e5, 0x003e,
-	0x9085, 0x0001, 0x0005, 0x0096, 0x080c, 0xbb17, 0x0140, 0x6014,
-	0x904d, 0x080c, 0xb74a, 0x687b, 0x0005, 0x080c, 0x688c, 0x009e,
-	0x080c, 0x9e62, 0x9085, 0x0001, 0x0005, 0x2001, 0x0001, 0x080c,
-	0x617b, 0x0156, 0x0016, 0x0026, 0x0036, 0x20a9, 0x0004, 0x2019,
-	0x1805, 0x2011, 0x0276, 0x080c, 0xadf9, 0x003e, 0x002e, 0x001e,
-	0x015e, 0x9005, 0x0005, 0x00f6, 0x00e6, 0x00c6, 0x0086, 0x0076,
-	0x0066, 0x00b6, 0x0126, 0x2091, 0x8000, 0x2740, 0x2061, 0x1cd0,
-	0x2079, 0x0001, 0x8fff, 0x0904, 0xd435, 0x2071, 0x1800, 0x7650,
-	0x7070, 0x8001, 0x9602, 0x1a04, 0xd435, 0x88ff, 0x0120, 0x2800,
-	0x9c06, 0x1590, 0x2078, 0x080c, 0xd55b, 0x0570, 0x2400, 0x9c06,
-	0x0558, 0x6720, 0x9786, 0x0006, 0x1538, 0x9786, 0x0007, 0x0520,
-	0x88ff, 0x1140, 0x6010, 0x9b06, 0x11f8, 0x85ff, 0x0118, 0x6054,
-	0x9106, 0x11d0, 0x0096, 0x601c, 0xd084, 0x0140, 0x080c, 0xd787,
-	0x080c, 0xc22a, 0x080c, 0x190d, 0x6023, 0x0007, 0x6014, 0x2048,
-	0x080c, 0xbb17, 0x0120, 0x0046, 0x080c, 0xd4d5, 0x004e, 0x009e,
-	0x080c, 0x9e62, 0x88ff, 0x1198, 0x9ce0, 0x0018, 0x2001, 0x1819,
-	0x2004, 0x9c02, 0x1210, 0x0804, 0xd3ea, 0x9006, 0x012e, 0x00be,
-	0x006e, 0x007e, 0x008e, 0x00ce, 0x00ee, 0x00fe, 0x0005, 0x98c5,
-	0x0001, 0x0ca0, 0x00b6, 0x0076, 0x0056, 0x0086, 0x9046, 0x2029,
-	0x0001, 0x2c20, 0x2019, 0x0002, 0x6210, 0x2258, 0x0096, 0x904e,
-	0x080c, 0x97ba, 0x009e, 0x008e, 0x903e, 0x080c, 0x9865, 0x080c,
-	0xd3db, 0x005e, 0x007e, 0x00be, 0x0005, 0x00b6, 0x0046, 0x0056,
-	0x0076, 0x00c6, 0x0156, 0x2c20, 0x2128, 0x20a9, 0x007f, 0x900e,
-	0x0016, 0x0036, 0x080c, 0x623e, 0x1190, 0x0056, 0x0086, 0x9046,
-	0x2508, 0x2029, 0x0001, 0x0096, 0x904e, 0x080c, 0x97ba, 0x009e,
-	0x008e, 0x903e, 0x080c, 0x9865, 0x080c, 0xd3db, 0x005e, 0x003e,
-	0x001e, 0x8108, 0x1f04, 0xd468, 0x015e, 0x00ce, 0x007e, 0x005e,
-	0x004e, 0x00be, 0x0005, 0x00b6, 0x0076, 0x0056, 0x6210, 0x2258,
-	0x0086, 0x9046, 0x2029, 0x0001, 0x2019, 0x0048, 0x0096, 0x904e,
-	0x080c, 0x97ba, 0x009e, 0x008e, 0x903e, 0x080c, 0x9865, 0x2c20,
-	0x080c, 0xd3db, 0x005e, 0x007e, 0x00be, 0x0005, 0x00b6, 0x0046,
-	0x0056, 0x0076, 0x00c6, 0x0156, 0x2c20, 0x20a9, 0x0800, 0x900e,
-	0x0016, 0x0036, 0x080c, 0x623e, 0x11a0, 0x0086, 0x9046, 0x2828,
-	0x0046, 0x2021, 0x0001, 0x080c, 0xd76b, 0x004e, 0x0096, 0x904e,
-	0x080c, 0x97ba, 0x009e, 0x008e, 0x903e, 0x080c, 0x9865, 0x080c,
-	0xd3db, 0x003e, 0x001e, 0x8108, 0x1f04, 0xd4b0, 0x015e, 0x00ce,
-	0x007e, 0x005e, 0x004e, 0x00be, 0x0005, 0x0016, 0x00f6, 0x080c,
-	0xbb15, 0x0198, 0xa864, 0x9084, 0x00ff, 0x9086, 0x0046, 0x0180,
-	0xa800, 0x907d, 0x0138, 0xa803, 0x0000, 0xab82, 0x080c, 0x688c,
-	0x2f48, 0x0cb0, 0xab82, 0x080c, 0x688c, 0x00fe, 0x001e, 0x0005,
-	0xa800, 0x907d, 0x0130, 0xa803, 0x0000, 0x080c, 0x688c, 0x2f48,
-	0x0cb8, 0x080c, 0x688c, 0x0c88, 0x00e6, 0x0046, 0x0036, 0x2061,
-	0x1cd0, 0x9005, 0x1138, 0x2071, 0x1800, 0x7450, 0x7070, 0x8001,
-	0x9402, 0x12d8, 0x2100, 0x9c06, 0x0168, 0x6000, 0x9086, 0x0000,
-	0x0148, 0x6008, 0x9206, 0x1130, 0x6010, 0x91a0, 0x0004, 0x2424,
-	0x9406, 0x0140, 0x9ce0, 0x0018, 0x2001, 0x1819, 0x2004, 0x9c02,
-	0x1220, 0x0c40, 0x9085, 0x0001, 0x0008, 0x9006, 0x003e, 0x004e,
-	0x00ee, 0x0005, 0x0096, 0x0006, 0x080c, 0x0feb, 0x000e, 0x090c,
-	0x0db4, 0xaae2, 0xa867, 0x010d, 0xa88e, 0x0026, 0x2010, 0x080c,
-	0xbb05, 0x2001, 0x0000, 0x0120, 0x2200, 0x9080, 0x0015, 0x2004,
-	0x002e, 0xa87a, 0x9186, 0x0020, 0x0110, 0xa8e3, 0xffff, 0xa986,
-	0xac76, 0xa87f, 0x0000, 0x2001, 0x195f, 0x2004, 0xa882, 0x9006,
-	0xa802, 0xa86a, 0xa88a, 0x0126, 0x2091, 0x8000, 0x080c, 0x688c,
-	0x012e, 0x009e, 0x0005, 0x6700, 0x9786, 0x0000, 0x0158, 0x9786,
-	0x0001, 0x0140, 0x9786, 0x000a, 0x0128, 0x9786, 0x0009, 0x0110,
-	0x9085, 0x0001, 0x0005, 0x00e6, 0x6010, 0x9075, 0x0138, 0x00b6,
-	0x2058, 0xb8a0, 0x00be, 0x9206, 0x00ee, 0x0005, 0x9085, 0x0001,
-	0x0cd8, 0x0016, 0x6004, 0x908e, 0x001e, 0x11a0, 0x8007, 0x6134,
-	0x918c, 0x00ff, 0x9105, 0x6036, 0x6007, 0x0085, 0x6003, 0x000b,
-	0x6023, 0x0005, 0x2001, 0x1958, 0x2004, 0x601a, 0x080c, 0x83f1,
-	0x080c, 0x8973, 0x001e, 0x0005, 0xa001, 0xa001, 0x0005, 0x6024,
-	0xd0e4, 0x0158, 0xd0cc, 0x0118, 0x080c, 0xbe4a, 0x0030, 0x080c,
-	0xd787, 0x080c, 0x8204, 0x080c, 0x9e32, 0x0005, 0x9280, 0x0008,
-	0x2004, 0x9084, 0x000f, 0x0002, 0xd5ba, 0xd5ba, 0xd5ba, 0xd5bc,
-	0xd5ba, 0xd5bc, 0xd5bc, 0xd5ba, 0xd5bc, 0xd5ba, 0xd5ba, 0xd5ba,
-	0xd5ba, 0xd5ba, 0x9006, 0x0005, 0x9085, 0x0001, 0x0005, 0x9280,
-	0x0008, 0x2004, 0x9084, 0x000f, 0x0002, 0xd5d3, 0xd5d3, 0xd5d3,
-	0xd5d3, 0xd5d3, 0xd5d3, 0xd5e0, 0xd5d3, 0xd5d3, 0xd5d3, 0xd5d3,
-	0xd5d3, 0xd5d3, 0xd5d3, 0x6007, 0x003b, 0x602f, 0x0009, 0x6017,
-	0x2a00, 0x6003, 0x0001, 0x080c, 0x83f1, 0x080c, 0x8973, 0x0005,
-	0x0096, 0x00c6, 0x2260, 0x080c, 0xd787, 0x6043, 0x0000, 0x6024,
-	0xc0f4, 0xc0e4, 0x6026, 0x603b, 0x0000, 0x00ce, 0x00d6, 0x2268,
-	0x9186, 0x0007, 0x1904, 0xd639, 0x6814, 0x9005, 0x0138, 0x2048,
-	0xa87c, 0xd0fc, 0x1118, 0x00de, 0x009e, 0x08a8, 0x6007, 0x003a,
-	0x6003, 0x0001, 0x080c, 0x83f1, 0x080c, 0x8973, 0x00c6, 0x2d60,
-	0x6100, 0x9186, 0x0002, 0x1904, 0xd6b0, 0x6014, 0x9005, 0x1138,
-	0x6000, 0x9086, 0x0007, 0x190c, 0x0db4, 0x0804, 0xd6b0, 0x2048,
-	0x080c, 0xbb17, 0x1130, 0x0028, 0x2048, 0xa800, 0x9005, 0x1de0,
-	0x2900, 0x2048, 0xa87c, 0x9084, 0x0003, 0x9086, 0x0002, 0x1168,
-	0xa87c, 0xc0dc, 0xc0f4, 0xa87e, 0xa880, 0xc0fc, 0xa882, 0x2009,
-	0x0043, 0x080c, 0xcf3e, 0x0804, 0xd6b0, 0x2009, 0x0041, 0x0804,
-	0xd6aa, 0x9186, 0x0005, 0x15a0, 0x6814, 0x2048, 0xa87c, 0xd0bc,
-	0x1120, 0x00de, 0x009e, 0x0804, 0xd5d3, 0xd0b4, 0x0128, 0xd0fc,
-	0x090c, 0x0db4, 0x0804, 0xd5f4, 0x6007, 0x003a, 0x6003, 0x0001,
-	0x080c, 0x83f1, 0x080c, 0x8973, 0x00c6, 0x2d60, 0x6100, 0x9186,
-	0x0002, 0x0120, 0x9186, 0x0004, 0x1904, 0xd6b0, 0x6814, 0x2048,
-	0xa97c, 0xc1f4, 0xc1dc, 0xa97e, 0xa980, 0xc1fc, 0xc1bc, 0xa982,
-	0x00f6, 0x2c78, 0x080c, 0x1648, 0x00fe, 0x2009, 0x0042, 0x04d0,
-	0x0036, 0x080c, 0x0feb, 0x090c, 0x0db4, 0xa867, 0x010d, 0x9006,
-	0xa802, 0xa86a, 0xa88a, 0x2d18, 0xab8e, 0xa887, 0x0045, 0x2c00,
-	0xa892, 0x6038, 0xa8a2, 0x2360, 0x6024, 0xc0dd, 0x6026, 0x6010,
-	0x00b6, 0x2058, 0xb8a0, 0x00be, 0x2004, 0x6354, 0xab7a, 0xa876,
-	0x9006, 0xa87e, 0xa882, 0xad9a, 0xae96, 0xa89f, 0x0001, 0x080c,
-	0x688c, 0x2019, 0x0045, 0x6008, 0x2068, 0x080c, 0xd0e5, 0x2d00,
-	0x600a, 0x6023, 0x0006, 0x6003, 0x0007, 0x901e, 0x631a, 0x6342,
-	0x003e, 0x0038, 0x6043, 0x0000, 0x6003, 0x0007, 0x080c, 0xcf3e,
-	0x00ce, 0x00de, 0x009e, 0x0005, 0x9186, 0x0013, 0x1128, 0x6004,
-	0x9082, 0x0085, 0x2008, 0x00c2, 0x9186, 0x0027, 0x1178, 0x080c,
-	0x886e, 0x0036, 0x0096, 0x6014, 0x2048, 0x2019, 0x0004, 0x080c,
-	0xd4d5, 0x009e, 0x003e, 0x080c, 0x8973, 0x0005, 0x9186, 0x0014,
-	0x0d70, 0x080c, 0x9ec7, 0x0005, 0xd6e3, 0xd6e1, 0xd6e1, 0xd6e1,
-	0xd6e1, 0xd6e1, 0xd6e3, 0xd6e1, 0xd6e1, 0xd6e1, 0xd6e1, 0xd6e1,
-	0xd6e1, 0x080c, 0x0db4, 0x080c, 0x886e, 0x6003, 0x000c, 0x080c,
-	0x8973, 0x0005, 0x9182, 0x0092, 0x1220, 0x9182, 0x0085, 0x0208,
-	0x001a, 0x080c, 0x9ec7, 0x0005, 0xd701, 0xd701, 0xd701, 0xd701,
-	0xd703, 0xd723, 0xd701, 0xd701, 0xd701, 0xd701, 0xd701, 0xd701,
-	0xd701, 0x080c, 0x0db4, 0x00d6, 0x2c68, 0x080c, 0x9ddc, 0x01b0,
-	0x6003, 0x0001, 0x6007, 0x001e, 0x2009, 0x026e, 0x210c, 0x613a,
-	0x2009, 0x026f, 0x210c, 0x613e, 0x600b, 0xffff, 0x6910, 0x6112,
-	0x6023, 0x0004, 0x080c, 0x83f1, 0x080c, 0x8973, 0x2d60, 0x080c,
-	0x9e32, 0x00de, 0x0005, 0x080c, 0x9e32, 0x0005, 0x00e6, 0x6010,
-	0x00b6, 0x2058, 0xb800, 0x00be, 0xd0ec, 0x00ee, 0x0005, 0x2009,
-	0x1873, 0x210c, 0xd1ec, 0x05b0, 0x6003, 0x0002, 0x6024, 0xc0e5,
-	0x6026, 0xd0cc, 0x0150, 0x2001, 0x1959, 0x2004, 0x6042, 0x2009,
-	0x1873, 0x210c, 0xd1f4, 0x1520, 0x00a0, 0x2009, 0x1873, 0x210c,
-	0xd1f4, 0x0128, 0x6024, 0xc0e4, 0x6026, 0x9006, 0x00d8, 0x2001,
-	0x1959, 0x200c, 0x2001, 0x1957, 0x2004, 0x9100, 0x9080, 0x000a,
-	0x6042, 0x6010, 0x00b6, 0x2058, 0xb8ac, 0x00be, 0x0008, 0x2104,
-	0x9005, 0x0118, 0x9088, 0x0003, 0x0cd0, 0x2c0a, 0x600f, 0x0000,
-	0x9085, 0x0001, 0x0005, 0x0016, 0x00c6, 0x00e6, 0x6154, 0xb8ac,
-	0x2060, 0x8cff, 0x0180, 0x84ff, 0x1118, 0x6054, 0x9106, 0x1138,
-	0x600c, 0x2072, 0x080c, 0x8204, 0x080c, 0x9e32, 0x0010, 0x9cf0,
-	0x0003, 0x2e64, 0x0c70, 0x00ee, 0x00ce, 0x001e, 0x0005, 0x00d6,
-	0x00b6, 0x6010, 0x2058, 0xb8ac, 0x2068, 0x9005, 0x0130, 0x9c06,
-	0x0110, 0x680c, 0x0cd0, 0x600c, 0x680e, 0x00be, 0x00de, 0x0005,
-	0x0026, 0x0036, 0x0156, 0x2011, 0x182b, 0x2204, 0x9084, 0x00ff,
-	0x2019, 0x026e, 0x2334, 0x9636, 0x1508, 0x8318, 0x2334, 0x2204,
-	0x9084, 0xff00, 0x9636, 0x11d0, 0x2011, 0x0270, 0x20a9, 0x0004,
-	0x6010, 0x0096, 0x2048, 0x2019, 0x000a, 0x080c, 0xae0d, 0x009e,
-	0x1168, 0x2011, 0x0274, 0x20a9, 0x0004, 0x6010, 0x0096, 0x2048,
-	0x2019, 0x0006, 0x080c, 0xae0d, 0x009e, 0x1100, 0x015e, 0x003e,
-	0x002e, 0x0005, 0x00e6, 0x2071, 0x1800, 0x080c, 0x5c64, 0x080c,
-	0x2dbb, 0x00ee, 0x0005, 0x00e6, 0x6010, 0x00b6, 0x2058, 0xb800,
-	0x00be, 0xd0fc, 0x0108, 0x0011, 0x00ee, 0x0005, 0xa880, 0xc0e5,
-	0xa882, 0x0005, 0x00e6, 0x00d6, 0x00c6, 0x0076, 0x0066, 0x0056,
-	0x0046, 0x0026, 0x0016, 0x0126, 0x2091, 0x8000, 0x2029, 0x19c1,
-	0x252c, 0x2021, 0x19c7, 0x2424, 0x2061, 0x1cd0, 0x2071, 0x1800,
-	0x7650, 0x7070, 0x9606, 0x0578, 0x6720, 0x9786, 0x0001, 0x0118,
-	0x9786, 0x0008, 0x1500, 0x2500, 0x9c06, 0x01e8, 0x2400, 0x9c06,
-	0x01d0, 0x080c, 0xd55b, 0x01b8, 0x080c, 0xd56b, 0x11a0, 0x6000,
-	0x9086, 0x0004, 0x1120, 0x0016, 0x080c, 0x190d, 0x001e, 0x080c,
-	0xbd0c, 0x1110, 0x080c, 0x3003, 0x080c, 0xbd1d, 0x1110, 0x080c,
-	0xa7c0, 0x080c, 0x9e62, 0x9ce0, 0x0018, 0x2001, 0x1819, 0x2004,
-	0x9c02, 0x1208, 0x0858, 0x012e, 0x001e, 0x002e, 0x004e, 0x005e,
-	0x006e, 0x007e, 0x00ce, 0x00de, 0x00ee, 0x0005, 0x2001, 0x1810,
-	0x2004, 0xd0dc, 0x0005, 0x0006, 0x2001, 0x1836, 0x2004, 0xd09c,
-	0x000e, 0x0005, 0x0006, 0x0036, 0x0046, 0x080c, 0xc212, 0x0168,
-	0x2019, 0xffff, 0x9005, 0x0128, 0x6010, 0x00b6, 0x2058, 0xbba0,
-	0x00be, 0x2021, 0x0004, 0x080c, 0x4a76, 0x004e, 0x003e, 0x000e,
-	0x6004, 0x9086, 0x0001, 0x1128, 0x080c, 0x9926, 0x080c, 0x9e62,
-	0x9006, 0x0005, 0x00e6, 0x00c6, 0x00b6, 0x0046, 0x2061, 0x1cd0,
-	0x2071, 0x1800, 0x7450, 0x7070, 0x8001, 0x9402, 0x12b8, 0x2100,
-	0x9c06, 0x0148, 0x6000, 0x9086, 0x0000, 0x0128, 0x6010, 0x2058,
-	0xb8a0, 0x9206, 0x0140, 0x9ce0, 0x0018, 0x2001, 0x1819, 0x2004,
-	0x9c02, 0x1220, 0x0c60, 0x9085, 0x0001, 0x0008, 0x9006, 0x004e,
-	0x00be, 0x00ce, 0x00ee, 0x0005, 0x0126, 0x0006, 0x00e6, 0x0016,
-	0x2091, 0x8000, 0x2071, 0x1840, 0xd5a4, 0x0118, 0x7034, 0x8000,
-	0x7036, 0xd5b4, 0x0118, 0x7030, 0x8000, 0x7032, 0xd5ac, 0x0178,
-	0x2500, 0x9084, 0x0007, 0x908e, 0x0003, 0x0148, 0x908e, 0x0004,
-	0x0130, 0x908e, 0x0005, 0x0118, 0x2071, 0x184a, 0x0089, 0x001e,
-	0x00ee, 0x000e, 0x012e, 0x0005, 0x0126, 0x0006, 0x00e6, 0x2091,
-	0x8000, 0x2071, 0x1842, 0x0021, 0x00ee, 0x000e, 0x012e, 0x0005,
-	0x2e04, 0x8000, 0x2072, 0x1220, 0x8e70, 0x2e04, 0x8000, 0x2072,
-	0x0005, 0x00e6, 0x2071, 0x1840, 0x0c99, 0x00ee, 0x0005, 0x00e6,
-	0x2071, 0x1844, 0x0c69, 0x00ee, 0x0005, 0x0126, 0x0006, 0x00e6,
-	0x2091, 0x8000, 0x2071, 0x1840, 0x7044, 0x8000, 0x7046, 0x00ee,
-	0x000e, 0x012e, 0x0005, 0x0003, 0x000b, 0x04a6, 0x0000, 0xc000,
-	0x0001, 0x8064, 0x0008, 0x0010, 0x0000, 0x8066, 0x0000, 0x0101,
-	0x0008, 0x4407, 0x0003, 0x8060, 0x0000, 0x0400, 0x0000, 0x580d,
-	0x000b, 0x798e, 0x0003, 0x50db, 0x000b, 0x4c0a, 0x0003, 0xbac0,
-	0x0009, 0x008a, 0x0000, 0x0c0a, 0x000b, 0x15fe, 0x0008, 0x340a,
-	0x0003, 0xc4c0, 0x0009, 0x7000, 0x0000, 0xffa0, 0x0001, 0x2000,
-	0x0000, 0x1627, 0x0003, 0x808c, 0x0008, 0x0001, 0x0000, 0x0000,
-	0x0007, 0x4047, 0x000a, 0x808c, 0x0008, 0x0002, 0x0000, 0x0821,
-	0x0003, 0x4022, 0x0000, 0x0022, 0x000b, 0x4122, 0x0008, 0x4447,
-	0x0002, 0x0e4f, 0x000b, 0x0bfe, 0x0008, 0x11a0, 0x0001, 0x122d,
-	0x000b, 0x0ca0, 0x0001, 0x122d, 0x000b, 0x9180, 0x0001, 0x0004,
-	0x0000, 0x8060, 0x0000, 0x0400, 0x0000, 0x7f62, 0x0008, 0x8066,
-	0x0000, 0x0009, 0x0008, 0x4430, 0x000b, 0x808c, 0x0008, 0x0000,
-	0x0008, 0x0060, 0x0008, 0x8062, 0x0008, 0x0004, 0x0000, 0x8066,
-	0x0000, 0x0411, 0x0000, 0x4438, 0x0003, 0x03fe, 0x0000, 0x43e0,
-	0x0001, 0x0e2a, 0x000b, 0xc2c0, 0x0009, 0x00ff, 0x0008, 0x02e0,
-	0x0001, 0x0e2a, 0x000b, 0x9180, 0x0001, 0x0005, 0x0008, 0x8060,
-	0x0000, 0x0400, 0x0000, 0x7f62, 0x0008, 0x8066, 0x0000, 0x0019,
-	0x0000, 0x4447, 0x000b, 0x0240, 0x0002, 0x0a27, 0x000b, 0x00fe,
-	0x0000, 0x322a, 0x000b, 0x112a, 0x0000, 0x002e, 0x0008, 0x022c,
-	0x0008, 0x3a44, 0x0002, 0x0c0a, 0x000b, 0x808c, 0x0008, 0x0002,
-	0x0000, 0x1760, 0x0008, 0x8062, 0x0008, 0x000f, 0x0008, 0x8066,
-	0x0000, 0x0011, 0x0008, 0x4458, 0x0003, 0x01fe, 0x0008, 0x42e0,
-	0x0009, 0x0e1d, 0x0003, 0x00fe, 0x0000, 0x43e0, 0x0001, 0x0e1d,
-	0x0003, 0x1734, 0x0000, 0x1530, 0x0000, 0x1632, 0x0008, 0x0d2a,
-	0x0008, 0x9880, 0x0001, 0x0010, 0x0000, 0x8060, 0x0000, 0x0400,
-	0x0000, 0x7f62, 0x0008, 0x8066, 0x0000, 0x1e0a, 0x0008, 0x446a,
-	0x000b, 0x808a, 0x0008, 0x0003, 0x0008, 0x1a60, 0x0000, 0x8062,
-	0x0008, 0x0002, 0x0000, 0x5870, 0x000b, 0x8066, 0x0000, 0x3679,
-	0x0000, 0x4473, 0x0003, 0x5874, 0x0003, 0x3efe, 0x0008, 0x7f4f,
-	0x0002, 0x087a, 0x000b, 0x0d00, 0x0000, 0x0082, 0x0004, 0x8054,
-	0x0008, 0x0011, 0x0008, 0x8074, 0x0000, 0x1010, 0x0008, 0x1efe,
-	0x0000, 0x300a, 0x000b, 0x00b8, 0x0004, 0x000a, 0x000b, 0x00fe,
-	0x0000, 0x348a, 0x000b, 0x1a60, 0x0000, 0x8062, 0x0008, 0x0007,
-	0x0000, 0x8066, 0x0000, 0x0231, 0x0008, 0x4489, 0x0003, 0x03fe,
-	0x0000, 0x04d0, 0x0001, 0x0cb0, 0x0003, 0x82c0, 0x0001, 0x1f00,
-	0x0000, 0xffa0, 0x0001, 0x0400, 0x0000, 0x089f, 0x0003, 0x14b0,
-	0x0003, 0x01fe, 0x0008, 0x0580, 0x0009, 0x7f06, 0x0000, 0x02fe,
-	0x0008, 0xffc0, 0x0001, 0x00ff, 0x0008, 0x0690, 0x0001, 0x109f,
-	0x0003, 0x7f08, 0x0008, 0x84c0, 0x0001, 0xff00, 0x0008, 0x08b0,
-	0x000b, 0x00fe, 0x0000, 0x34a6, 0x0003, 0x8072, 0x0000, 0x1010,
-	0x0008, 0x3944, 0x0002, 0x08a1, 0x000b, 0x00aa, 0x000b, 0x8072,
-	0x0000, 0x2020, 0x0008, 0x3945, 0x000a, 0x08a6, 0x0003, 0x3946,
-	0x000a, 0x0cb7, 0x000b, 0x0000, 0x0007, 0x3943, 0x000a, 0x08b7,
-	0x0003, 0x00aa, 0x000b, 0x00fe, 0x0000, 0x34b5, 0x000b, 0x8072,
-	0x0000, 0x1000, 0x0000, 0x00b7, 0x000b, 0x8072, 0x0000, 0x2000,
-	0x0000, 0x4000, 0x000f, 0x1c60, 0x0000, 0x1b62, 0x0000, 0x8066,
-	0x0000, 0x0231, 0x0008, 0x44bc, 0x0003, 0x58bd, 0x0003, 0x0140,
-	0x0008, 0x0242, 0x0000, 0x1f43, 0x0002, 0x0ccb, 0x0003, 0x0d44,
-	0x0000, 0x0d46, 0x0008, 0x0348, 0x0008, 0x044a, 0x0008, 0x030a,
-	0x0008, 0x040c, 0x0000, 0x0d06, 0x0000, 0x0d08, 0x0008, 0x00cf,
-	0x000b, 0x0344, 0x0008, 0x0446, 0x0008, 0x0548, 0x0008, 0x064a,
-	0x0000, 0x58cf, 0x0003, 0x3efe, 0x0008, 0x7f4f, 0x0002, 0x08d6,
-	0x000b, 0x8000, 0x0000, 0x0001, 0x0000, 0x0082, 0x0004, 0x8054,
-	0x0008, 0x0001, 0x0000, 0x8074, 0x0000, 0x2020, 0x0008, 0x4000,
-	0x000f, 0x3a40, 0x000a, 0x0c0d, 0x0003, 0x2b24, 0x0008, 0x2b24,
-	0x0008, 0x58df, 0x000b, 0x8054, 0x0008, 0x0002, 0x0000, 0x1242,
-	0x0002, 0x092d, 0x000b, 0x3a45, 0x000a, 0x091c, 0x0003, 0x8072,
-	0x0000, 0x1000, 0x0000, 0x3945, 0x000a, 0x08ec, 0x000b, 0x8072,
-	0x0000, 0x3010, 0x0000, 0x1e10, 0x000a, 0x7f3c, 0x0000, 0x0917,
-	0x000b, 0x1d00, 0x0002, 0x7f3a, 0x0000, 0x0d60, 0x0000, 0x7f62,
-	0x0008, 0x8066, 0x0000, 0x0009, 0x0008, 0x44f5, 0x000b, 0x00fe,
-	0x0000, 0x3514, 0x000b, 0x1c60, 0x0000, 0x8062, 0x0008, 0x0001,
-	0x0000, 0x8066, 0x0000, 0x0009, 0x0008, 0x44fd, 0x0003, 0x00fe,
-	0x0000, 0x3204, 0x000b, 0x0038, 0x0000, 0x0060, 0x0008, 0x8062,
-	0x0008, 0x0019, 0x0000, 0x8066, 0x0000, 0x0009, 0x0008, 0x4506,
-	0x0003, 0x80c0, 0x0009, 0x00ff, 0x0008, 0x7f3e, 0x0008, 0x0d60,
-	0x0000, 0x0efe, 0x0008, 0x1f80, 0x0001, 0x7f62, 0x0008, 0x8066,
-	0x0000, 0x0009, 0x0008, 0x4510, 0x000b, 0x003a, 0x0008, 0x1dfe,
-	0x0000, 0x00f1, 0x0003, 0x0036, 0x0008, 0x00b8, 0x0004, 0x012d,
-	0x0003, 0x8074, 0x0000, 0x2000, 0x0000, 0x8072, 0x0000, 0x2000,
-	0x0000, 0x012d, 0x0003, 0x3a44, 0x0002, 0x0a30, 0x000b, 0x8074,
-	0x0000, 0x1000, 0x0000, 0x8072, 0x0000, 0x1000, 0x0000, 0x2d0e,
-	0x0000, 0x2d0e, 0x0000, 0x3601, 0x0003, 0x26fe, 0x0008, 0x26fe,
-	0x0008, 0x2700, 0x0008, 0x2700, 0x0008, 0x00d0, 0x0009, 0x0d3f,
-	0x0003, 0x8074, 0x0000, 0x4040, 0x0008, 0x592d, 0x000b, 0x50db,
-	0x000b, 0x3a46, 0x000a, 0x0d3f, 0x0003, 0x3a47, 0x0002, 0x093a,
-	0x000b, 0x8054, 0x0008, 0x0004, 0x0000, 0x8074, 0x0000, 0x8000,
-	0x0000, 0x8072, 0x0000, 0x3000, 0x0008, 0x0182, 0x0003, 0x92c0,
-	0x0009, 0x0fc8, 0x0000, 0x080a, 0x0003, 0x1246, 0x000a, 0x0dfb,
-	0x000b, 0x1a60, 0x0000, 0x8062, 0x0008, 0x0002, 0x0000, 0x8066,
-	0x0000, 0x362a, 0x0000, 0x4544, 0x0003, 0x2000, 0x0000, 0x2000,
-	0x0000, 0x2102, 0x0000, 0x2102, 0x0000, 0x2204, 0x0000, 0x2204,
-	0x0000, 0x2306, 0x0000, 0x2306, 0x0000, 0x2408, 0x0000, 0x2408,
-	0x0000, 0x250a, 0x0000, 0x250a, 0x0000, 0x260c, 0x0000, 0x260c,
-	0x0000, 0x270e, 0x0000, 0x270e, 0x0000, 0x2810, 0x0000, 0x2810,
-	0x0000, 0x2912, 0x0000, 0x2912, 0x0000, 0x1a60, 0x0000, 0x8062,
-	0x0008, 0x0007, 0x0000, 0x8066, 0x0000, 0x0052, 0x0000, 0x455e,
-	0x000b, 0x92c0, 0x0009, 0x0780, 0x0008, 0x0e17, 0x0003, 0x124b,
-	0x0002, 0x0967, 0x0003, 0x2e4d, 0x0002, 0x2e4d, 0x0002, 0x0a01,
-	0x0003, 0x3a46, 0x000a, 0x0d74, 0x0003, 0x5969, 0x000b, 0x8054,
-	0x0008, 0x0004, 0x0000, 0x1243, 0x000a, 0x097e, 0x000b, 0x8010,
-	0x0008, 0x000d, 0x0000, 0x01ef, 0x0004, 0x1810, 0x0000, 0x01ef,
-	0x0004, 0x017e, 0x0003, 0x194d, 0x000a, 0x0978, 0x000b, 0x1243,
-	0x000a, 0x0a0b, 0x0003, 0x5978, 0x000b, 0x8054, 0x0008, 0x0004,
-	0x0000, 0x01e4, 0x000c, 0x1810, 0x0000, 0x01ef, 0x0004, 0x8074,
-	0x0000, 0xf000, 0x0008, 0x8072, 0x0000, 0x3000, 0x0008, 0x0d30,
-	0x0000, 0x3a42, 0x0002, 0x0d88, 0x0003, 0x15fe, 0x0008, 0x3451,
-	0x000b, 0x000a, 0x000b, 0x8074, 0x0000, 0x0501, 0x0000, 0x8010,
-	0x0008, 0x000c, 0x0008, 0x01ef, 0x0004, 0x000a, 0x000b, 0xbbe0,
-	0x0009, 0x0030, 0x0008, 0x0d9e, 0x000b, 0x18fe, 0x0000, 0x3ce0,
-	0x0009, 0x099b, 0x0003, 0x15fe, 0x0008, 0x3ce0, 0x0009, 0x099b,
-	0x0003, 0x01df, 0x0004, 0x8076, 0x0008, 0x0040, 0x0000, 0x01dc,
-	0x000b, 0x8076, 0x0008, 0x0041, 0x0008, 0x01dc, 0x000b, 0xbbe0,
-	0x0009, 0x0032, 0x0000, 0x0da3, 0x0003, 0x3c1e, 0x0008, 0x01dc,
-	0x000b, 0xbbe0, 0x0009, 0x0037, 0x0000, 0x0dc1, 0x000b, 0x18fe,
-	0x0000, 0x3ce0, 0x0009, 0x0d9b, 0x000b, 0x8076, 0x0008, 0x0040,
-	0x0000, 0x1a60, 0x0000, 0x8062, 0x0008, 0x000d, 0x0000, 0x2604,
-	0x0008, 0x2604, 0x0008, 0x2706, 0x0008, 0x2706, 0x0008, 0x2808,
-	0x0000, 0x2808, 0x0000, 0x290a, 0x0000, 0x290a, 0x0000, 0x8066,
-	0x0000, 0x0422, 0x0000, 0x45b8, 0x0003, 0x01e4, 0x000c, 0x8054,
-	0x0008, 0x0004, 0x0000, 0x8074, 0x0000, 0xf000, 0x0008, 0x8072,
-	0x0000, 0xb000, 0x0000, 0x0182, 0x0003, 0xbbe0, 0x0009, 0x0038,
-	0x0000, 0x0dd3, 0x000b, 0x18fe, 0x0000, 0x3ce0, 0x0009, 0x09d0,
-	0x0003, 0x15fe, 0x0008, 0x3ce0, 0x0009, 0x0d97, 0x000b, 0x01df,
-	0x0004, 0x8076, 0x0008, 0x0040, 0x0000, 0x8072, 0x0000, 0x8000,
-	0x0000, 0x0227, 0x0003, 0x8076, 0x0008, 0x0042, 0x0008, 0x01dc,
-	0x000b, 0xbbe0, 0x0009, 0x0016, 0x0000, 0x0ddc, 0x000b, 0x3a44,
-	0x0002, 0x0c0c, 0x000b, 0x8072, 0x0000, 0x8000, 0x0000, 0x8000,
-	0x000f, 0x000a, 0x000b, 0x8072, 0x0000, 0x8000, 0x0000, 0x000a,
-	0x000b, 0x3d30, 0x000a, 0x7f00, 0x0000, 0xbc80, 0x0001, 0x0007,
-	0x0000, 0x01e8, 0x0003, 0x1930, 0x000a, 0x7f00, 0x0000, 0x9880,
-	0x0001, 0x0007, 0x0000, 0x8060, 0x0000, 0x0400, 0x0000, 0x7f62,
-	0x0008, 0x8066, 0x0000, 0x000a, 0x0008, 0x45ed, 0x0003, 0x4000,
-	0x000f, 0x21ef, 0x0003, 0x0870, 0x0008, 0x4000, 0x000f, 0xbac0,
-	0x0009, 0x0090, 0x0008, 0x09f8, 0x0003, 0x8074, 0x0000, 0x0706,
-	0x0000, 0x01fa, 0x0003, 0x8074, 0x0000, 0x0703, 0x0000, 0x4000,
-	0x000f, 0x8010, 0x0008, 0x0023, 0x0000, 0x0235, 0x0003, 0x8010,
-	0x0008, 0x0008, 0x0000, 0x0235, 0x0003, 0x8010, 0x0008, 0x0022,
-	0x0008, 0x0235, 0x0003, 0x01e4, 0x000c, 0x8010, 0x0008, 0x0007,
-	0x0000, 0x01ef, 0x0004, 0x1810, 0x0000, 0x01ef, 0x0004, 0x0241,
-	0x0003, 0x01e4, 0x000c, 0x8010, 0x0008, 0x001b, 0x0008, 0x01ef,
-	0x0004, 0x1810, 0x0000, 0x01ef, 0x0004, 0x8074, 0x0000, 0xf080,
-	0x0000, 0x8072, 0x0000, 0x3000, 0x0008, 0x0d30, 0x0000, 0x000a,
-	0x000b, 0x8010, 0x0008, 0x0009, 0x0008, 0x0235, 0x0003, 0x8010,
-	0x0008, 0x0005, 0x0008, 0x0235, 0x0003, 0x808c, 0x0008, 0x0001,
-	0x0000, 0x8010, 0x0008, 0x0004, 0x0000, 0x4143, 0x000a, 0x085f,
-	0x0003, 0x3a44, 0x0002, 0x0c0a, 0x000b, 0x0d2a, 0x0008, 0x0235,
-	0x0003, 0x8010, 0x0008, 0x0003, 0x0008, 0x0239, 0x0003, 0x8010,
-	0x0008, 0x000b, 0x0000, 0x0239, 0x0003, 0x8010, 0x0008, 0x0002,
-	0x0000, 0x0239, 0x0003, 0x3a47, 0x0002, 0x0d2d, 0x0003, 0x8010,
-	0x0008, 0x0006, 0x0008, 0x0239, 0x0003, 0x8074, 0x0000, 0xf000,
-	0x0008, 0x8072, 0x0000, 0x3000, 0x0008, 0x01ef, 0x0004, 0x01f2,
-	0x0004, 0x3a40, 0x000a, 0x080a, 0x0003, 0x8010, 0x0008, 0x000c,
-	0x0008, 0x01ef, 0x0004, 0x000a, 0x000b, 0x8074, 0x0000, 0xf080,
-	0x0000, 0x8072, 0x0000, 0x3000, 0x0008, 0x0d30, 0x0000, 0x2e4d,
-	0x0002, 0x2e4d, 0x0002, 0x0a4c, 0x0003, 0x8054, 0x0008, 0x0019,
-	0x0000, 0x000a, 0x000b, 0x8054, 0x0008, 0x0009, 0x0008, 0x000a,
-	0x000b, 0x3a44, 0x0002, 0x0c0a, 0x000b, 0x022a, 0x000b, 0x15b6,
-	0xf4ac, 0x0001, 0x0002, 0x0004, 0x0008, 0x0010, 0x0020, 0x0040,
-	0x0080, 0x0100, 0x0200, 0x0400, 0x0800, 0x1000, 0x2000, 0x4000,
-	0x8000, 0x89e3
+	0xd0c1, 0x080c, 0x0db4, 0x080c, 0x8861, 0x080c, 0x9e72, 0x080c,
+	0x896d, 0x0005, 0x9182, 0x0085, 0x0a0c, 0x0db4, 0x9182, 0x0092,
+	0x1a0c, 0x0db4, 0x9182, 0x0085, 0x0002, 0xd0e2, 0xd0e2, 0xd0e2,
+	0xd0e4, 0xd0e2, 0xd0e2, 0xd0e2, 0xd0e2, 0xd0e2, 0xd0e2, 0xd0e2,
+	0xd0e2, 0xd0e2, 0x080c, 0x0db4, 0x0005, 0x9186, 0x0013, 0x0148,
+	0x9186, 0x0014, 0x0130, 0x9186, 0x0027, 0x0118, 0x080c, 0x9ed7,
+	0x0030, 0x080c, 0x8861, 0x080c, 0x9e72, 0x080c, 0x896d, 0x0005,
+	0x0036, 0x080c, 0xd7a8, 0x6043, 0x0000, 0x2019, 0x000b, 0x0031,
+	0x6023, 0x0006, 0x6003, 0x0007, 0x003e, 0x0005, 0x0126, 0x0036,
+	0x2091, 0x8000, 0x0086, 0x2c40, 0x0096, 0x904e, 0x080c, 0x97bb,
+	0x009e, 0x008e, 0x1550, 0x0076, 0x2c38, 0x080c, 0x9866, 0x007e,
+	0x1520, 0x6000, 0x9086, 0x0000, 0x0500, 0x6020, 0x9086, 0x0007,
+	0x01e0, 0x0096, 0x601c, 0xd084, 0x0140, 0x080c, 0xd7a8, 0x080c,
+	0xc244, 0x080c, 0x190f, 0x6023, 0x0007, 0x6014, 0x2048, 0x080c,
+	0xbb2c, 0x0110, 0x080c, 0xd4f6, 0x009e, 0x6017, 0x0000, 0x080c,
+	0xd7a8, 0x6023, 0x0007, 0x080c, 0xc244, 0x003e, 0x012e, 0x0005,
+	0x00f6, 0x00c6, 0x00b6, 0x0036, 0x0156, 0x2079, 0x0260, 0x7938,
+	0x783c, 0x080c, 0x2665, 0x15c8, 0x0016, 0x00c6, 0x080c, 0x6247,
+	0x1590, 0x001e, 0x00c6, 0x2160, 0x080c, 0xc241, 0x00ce, 0x002e,
+	0x0026, 0x0016, 0x2019, 0x0029, 0x080c, 0x992c, 0x080c, 0x8564,
+	0x0076, 0x903e, 0x080c, 0x8452, 0x007e, 0x001e, 0x0076, 0x903e,
+	0x080c, 0xd2bc, 0x007e, 0x0026, 0xba04, 0x9294, 0xff00, 0x8217,
+	0x9286, 0x0006, 0x0118, 0x9286, 0x0004, 0x1118, 0xbaa0, 0x080c,
+	0x3099, 0x002e, 0xbcb0, 0x001e, 0x080c, 0x5cf4, 0xbe12, 0xbd16,
+	0xbcb2, 0x9006, 0x0010, 0x00ce, 0x001e, 0x015e, 0x003e, 0x00be,
+	0x00ce, 0x00fe, 0x0005, 0x00c6, 0x00d6, 0x00b6, 0x0016, 0x2009,
+	0x1823, 0x2104, 0x9086, 0x0074, 0x1904, 0xd1e4, 0x2069, 0x0260,
+	0x6944, 0x9182, 0x0100, 0x06e0, 0x6940, 0x9184, 0x8000, 0x0904,
+	0xd1e1, 0x2001, 0x194c, 0x2004, 0x9005, 0x1140, 0x6010, 0x2058,
+	0xb8b0, 0x9005, 0x0118, 0x9184, 0x0800, 0x0598, 0x6948, 0x918a,
+	0x0001, 0x0648, 0x080c, 0xd85c, 0x0118, 0x6978, 0xd1fc, 0x11b8,
+	0x2009, 0x0205, 0x200b, 0x0001, 0x693c, 0x81ff, 0x1198, 0x6944,
+	0x9182, 0x0100, 0x02a8, 0x6940, 0x81ff, 0x1178, 0x6948, 0x918a,
+	0x0001, 0x0288, 0x6950, 0x918a, 0x0001, 0x0298, 0x00d0, 0x6017,
+	0x0100, 0x00a0, 0x6017, 0x0300, 0x0088, 0x6017, 0x0500, 0x0070,
+	0x6017, 0x0700, 0x0058, 0x6017, 0x0900, 0x0040, 0x6017, 0x0b00,
+	0x0028, 0x6017, 0x0f00, 0x0010, 0x6017, 0x2d00, 0x9085, 0x0001,
+	0x0008, 0x9006, 0x001e, 0x00be, 0x00de, 0x00ce, 0x0005, 0x00c6,
+	0x00b6, 0x0026, 0x0036, 0x0156, 0x6210, 0x2258, 0xbb04, 0x9394,
+	0x00ff, 0x9286, 0x0006, 0x0180, 0x9286, 0x0004, 0x0168, 0x9394,
+	0xff00, 0x8217, 0x9286, 0x0006, 0x0138, 0x9286, 0x0004, 0x0120,
+	0x080c, 0x6256, 0x0804, 0xd24b, 0x2011, 0x0276, 0x20a9, 0x0004,
+	0x0096, 0x2b48, 0x2019, 0x000a, 0x080c, 0xae20, 0x009e, 0x15a0,
+	0x2011, 0x027a, 0x20a9, 0x0004, 0x0096, 0x2b48, 0x2019, 0x0006,
+	0x080c, 0xae20, 0x009e, 0x1540, 0x0046, 0x0016, 0xbaa0, 0x2220,
+	0x9006, 0x2009, 0x1854, 0x210c, 0x0038, 0x2009, 0x0029, 0x080c,
+	0xd54b, 0xb800, 0xc0e5, 0xb802, 0x2019, 0x0029, 0x080c, 0x8564,
+	0x0076, 0x2039, 0x0000, 0x080c, 0x8452, 0x2c08, 0x080c, 0xd2bc,
+	0x007e, 0x2001, 0x0007, 0x080c, 0x61c4, 0x2001, 0x0007, 0x080c,
+	0x6198, 0x001e, 0x004e, 0x9006, 0x015e, 0x003e, 0x002e, 0x00be,
+	0x00ce, 0x0005, 0x00d6, 0x2069, 0x026e, 0x6800, 0x9086, 0x0800,
+	0x0118, 0x6017, 0x0000, 0x0008, 0x9006, 0x00de, 0x0005, 0x00b6,
+	0x00f6, 0x0016, 0x0026, 0x0036, 0x0156, 0x2079, 0x026c, 0x7930,
+	0x7834, 0x080c, 0x2665, 0x11d0, 0x080c, 0x6247, 0x11b8, 0x2011,
+	0x0270, 0x20a9, 0x0004, 0x0096, 0x2b48, 0x2019, 0x000a, 0x080c,
+	0xae20, 0x009e, 0x1158, 0x2011, 0x0274, 0x20a9, 0x0004, 0x0096,
+	0x2b48, 0x2019, 0x0006, 0x080c, 0xae20, 0x009e, 0x015e, 0x003e,
+	0x002e, 0x001e, 0x00fe, 0x00be, 0x0005, 0x00b6, 0x0006, 0x0016,
+	0x0026, 0x0036, 0x0156, 0x2011, 0x0263, 0x2204, 0x8211, 0x220c,
+	0x080c, 0x2665, 0x11d0, 0x080c, 0x6247, 0x11b8, 0x2011, 0x0276,
+	0x20a9, 0x0004, 0x0096, 0x2b48, 0x2019, 0x000a, 0x080c, 0xae20,
+	0x009e, 0x1158, 0x2011, 0x027a, 0x20a9, 0x0004, 0x0096, 0x2b48,
+	0x2019, 0x0006, 0x080c, 0xae20, 0x009e, 0x015e, 0x003e, 0x002e,
+	0x001e, 0x000e, 0x00be, 0x0005, 0x00e6, 0x00c6, 0x0086, 0x0076,
+	0x0066, 0x0056, 0x0046, 0x0026, 0x0126, 0x2091, 0x8000, 0x2740,
+	0x2029, 0x19c0, 0x252c, 0x2021, 0x19c6, 0x2424, 0x2061, 0x1cd0,
+	0x2071, 0x1800, 0x7650, 0x7070, 0x81ff, 0x0150, 0x0006, 0x9186,
+	0x1a7f, 0x000e, 0x0128, 0x8001, 0x9602, 0x1a04, 0xd355, 0x0018,
+	0x9606, 0x0904, 0xd355, 0x2100, 0x9c06, 0x0904, 0xd34c, 0x080c,
+	0xd58c, 0x1904, 0xd34c, 0x080c, 0xd879, 0x0904, 0xd34c, 0x080c,
+	0xd57c, 0x0904, 0xd34c, 0x6720, 0x9786, 0x0001, 0x1148, 0x080c,
+	0x3130, 0x0904, 0xd370, 0x6004, 0x9086, 0x0000, 0x1904, 0xd370,
+	0x9786, 0x0004, 0x0904, 0xd370, 0x9786, 0x0007, 0x0904, 0xd34c,
+	0x2500, 0x9c06, 0x0904, 0xd34c, 0x2400, 0x9c06, 0x05e8, 0x88ff,
+	0x0118, 0x6054, 0x9906, 0x15c0, 0x0096, 0x6000, 0x9086, 0x0004,
+	0x1120, 0x0016, 0x080c, 0x190f, 0x001e, 0x9786, 0x000a, 0x0148,
+	0x080c, 0xbd32, 0x1130, 0x080c, 0xa7d1, 0x009e, 0x080c, 0x9e72,
+	0x0418, 0x6014, 0x2048, 0x080c, 0xbb2c, 0x01d8, 0x9786, 0x0003,
+	0x1570, 0xa867, 0x0103, 0xa87c, 0xd0cc, 0x0130, 0x0096, 0xa878,
+	0x2048, 0x080c, 0x0f9d, 0x009e, 0xab7a, 0xa877, 0x0000, 0x080c,
+	0xd7f4, 0x0016, 0x080c, 0xbe20, 0x080c, 0x6884, 0x001e, 0x080c,
+	0xbd15, 0x009e, 0x080c, 0x9e72, 0x9ce0, 0x0018, 0x2001, 0x1819,
+	0x2004, 0x9c02, 0x1210, 0x0804, 0xd2d0, 0x012e, 0x002e, 0x004e,
+	0x005e, 0x006e, 0x007e, 0x008e, 0x00ce, 0x00ee, 0x0005, 0x9786,
+	0x0006, 0x1150, 0x9386, 0x0005, 0x0128, 0x080c, 0xd7f4, 0x080c,
+	0xd4f6, 0x08f8, 0x009e, 0x0c00, 0x9786, 0x000a, 0x0920, 0x0808,
+	0x81ff, 0x09d0, 0x9180, 0x0001, 0x2004, 0x9086, 0x0018, 0x0130,
+	0x9180, 0x0001, 0x2004, 0x9086, 0x002d, 0x1970, 0x6000, 0x9086,
+	0x0002, 0x1950, 0x080c, 0xbd21, 0x0130, 0x080c, 0xbd32, 0x1920,
+	0x080c, 0xa7d1, 0x0038, 0x080c, 0x3005, 0x080c, 0xbd32, 0x1110,
+	0x080c, 0xa7d1, 0x080c, 0x9e72, 0x0804, 0xd34c, 0xa864, 0x9084,
+	0x00ff, 0x9086, 0x0039, 0x0005, 0x00c6, 0x00e6, 0x0016, 0x2c08,
+	0x2170, 0x9006, 0x080c, 0xd51d, 0x001e, 0x0120, 0x6020, 0x9084,
+	0x000f, 0x001b, 0x00ee, 0x00ce, 0x0005, 0xd3bb, 0xd3bb, 0xd3bb,
+	0xd3bb, 0xd3bb, 0xd3bb, 0xd3bd, 0xd3bb, 0xd3bb, 0xd3bb, 0xd3bb,
+	0x9e72, 0x9e72, 0xd3bb, 0x9006, 0x0005, 0x0036, 0x0046, 0x0016,
+	0x7010, 0x00b6, 0x2058, 0xbca0, 0x00be, 0x2c00, 0x2009, 0x0020,
+	0x080c, 0xd54b, 0x001e, 0x004e, 0x2019, 0x0002, 0x080c, 0xd106,
+	0x003e, 0x9085, 0x0001, 0x0005, 0x0096, 0x080c, 0xbb2c, 0x0140,
+	0x6014, 0x904d, 0x080c, 0xb75d, 0x687b, 0x0005, 0x080c, 0x6891,
+	0x009e, 0x080c, 0x9e72, 0x9085, 0x0001, 0x0005, 0x2001, 0x0001,
+	0x080c, 0x6184, 0x0156, 0x0016, 0x0026, 0x0036, 0x20a9, 0x0004,
+	0x2019, 0x1805, 0x2011, 0x0276, 0x080c, 0xae0c, 0x003e, 0x002e,
+	0x001e, 0x015e, 0x9005, 0x0005, 0x00f6, 0x00e6, 0x00c6, 0x0086,
+	0x0076, 0x0066, 0x00b6, 0x0126, 0x2091, 0x8000, 0x2740, 0x2061,
+	0x1cd0, 0x2079, 0x0001, 0x8fff, 0x0904, 0xd456, 0x2071, 0x1800,
+	0x7650, 0x7070, 0x8001, 0x9602, 0x1a04, 0xd456, 0x88ff, 0x0120,
+	0x2800, 0x9c06, 0x1590, 0x2078, 0x080c, 0xd57c, 0x0570, 0x2400,
+	0x9c06, 0x0558, 0x6720, 0x9786, 0x0006, 0x1538, 0x9786, 0x0007,
+	0x0520, 0x88ff, 0x1140, 0x6010, 0x9b06, 0x11f8, 0x85ff, 0x0118,
+	0x6054, 0x9106, 0x11d0, 0x0096, 0x601c, 0xd084, 0x0140, 0x080c,
+	0xd7a8, 0x080c, 0xc244, 0x080c, 0x190f, 0x6023, 0x0007, 0x6014,
+	0x2048, 0x080c, 0xbb2c, 0x0120, 0x0046, 0x080c, 0xd4f6, 0x004e,
+	0x009e, 0x080c, 0x9e72, 0x88ff, 0x1198, 0x9ce0, 0x0018, 0x2001,
+	0x1819, 0x2004, 0x9c02, 0x1210, 0x0804, 0xd40b, 0x9006, 0x012e,
+	0x00be, 0x006e, 0x007e, 0x008e, 0x00ce, 0x00ee, 0x00fe, 0x0005,
+	0x98c5, 0x0001, 0x0ca0, 0x00b6, 0x0076, 0x0056, 0x0086, 0x9046,
+	0x2029, 0x0001, 0x2c20, 0x2019, 0x0002, 0x6210, 0x2258, 0x0096,
+	0x904e, 0x080c, 0x97bb, 0x009e, 0x008e, 0x903e, 0x080c, 0x9866,
+	0x080c, 0xd3fc, 0x005e, 0x007e, 0x00be, 0x0005, 0x00b6, 0x0046,
+	0x0056, 0x0076, 0x00c6, 0x0156, 0x2c20, 0x2128, 0x20a9, 0x007f,
+	0x900e, 0x0016, 0x0036, 0x080c, 0x6247, 0x1190, 0x0056, 0x0086,
+	0x9046, 0x2508, 0x2029, 0x0001, 0x0096, 0x904e, 0x080c, 0x97bb,
+	0x009e, 0x008e, 0x903e, 0x080c, 0x9866, 0x080c, 0xd3fc, 0x005e,
+	0x003e, 0x001e, 0x8108, 0x1f04, 0xd489, 0x015e, 0x00ce, 0x007e,
+	0x005e, 0x004e, 0x00be, 0x0005, 0x00b6, 0x0076, 0x0056, 0x6210,
+	0x2258, 0x0086, 0x9046, 0x2029, 0x0001, 0x2019, 0x0048, 0x0096,
+	0x904e, 0x080c, 0x97bb, 0x009e, 0x008e, 0x903e, 0x080c, 0x9866,
+	0x2c20, 0x080c, 0xd3fc, 0x005e, 0x007e, 0x00be, 0x0005, 0x00b6,
+	0x0046, 0x0056, 0x0076, 0x00c6, 0x0156, 0x2c20, 0x20a9, 0x0800,
+	0x900e, 0x0016, 0x0036, 0x080c, 0x6247, 0x11a0, 0x0086, 0x9046,
+	0x2828, 0x0046, 0x2021, 0x0001, 0x080c, 0xd78c, 0x004e, 0x0096,
+	0x904e, 0x080c, 0x97bb, 0x009e, 0x008e, 0x903e, 0x080c, 0x9866,
+	0x080c, 0xd3fc, 0x003e, 0x001e, 0x8108, 0x1f04, 0xd4d1, 0x015e,
+	0x00ce, 0x007e, 0x005e, 0x004e, 0x00be, 0x0005, 0x0016, 0x00f6,
+	0x080c, 0xbb2a, 0x0198, 0xa864, 0x9084, 0x00ff, 0x9086, 0x0046,
+	0x0180, 0xa800, 0x907d, 0x0138, 0xa803, 0x0000, 0xab82, 0x080c,
+	0x6891, 0x2f48, 0x0cb0, 0xab82, 0x080c, 0x6891, 0x00fe, 0x001e,
+	0x0005, 0xa800, 0x907d, 0x0130, 0xa803, 0x0000, 0x080c, 0x6891,
+	0x2f48, 0x0cb8, 0x080c, 0x6891, 0x0c88, 0x00e6, 0x0046, 0x0036,
+	0x2061, 0x1cd0, 0x9005, 0x1138, 0x2071, 0x1800, 0x7450, 0x7070,
+	0x8001, 0x9402, 0x12d8, 0x2100, 0x9c06, 0x0168, 0x6000, 0x9086,
+	0x0000, 0x0148, 0x6008, 0x9206, 0x1130, 0x6010, 0x91a0, 0x0004,
+	0x2424, 0x9406, 0x0140, 0x9ce0, 0x0018, 0x2001, 0x1819, 0x2004,
+	0x9c02, 0x1220, 0x0c40, 0x9085, 0x0001, 0x0008, 0x9006, 0x003e,
+	0x004e, 0x00ee, 0x0005, 0x0096, 0x0006, 0x080c, 0x0feb, 0x000e,
+	0x090c, 0x0db4, 0xaae2, 0xa867, 0x010d, 0xa88e, 0x0026, 0x2010,
+	0x080c, 0xbb1a, 0x2001, 0x0000, 0x0120, 0x2200, 0x9080, 0x0015,
+	0x2004, 0x002e, 0xa87a, 0x9186, 0x0020, 0x0110, 0xa8e3, 0xffff,
+	0xa986, 0xac76, 0xa87f, 0x0000, 0x2001, 0x195e, 0x2004, 0xa882,
+	0x9006, 0xa802, 0xa86a, 0xa88a, 0x0126, 0x2091, 0x8000, 0x080c,
+	0x6891, 0x012e, 0x009e, 0x0005, 0x6700, 0x9786, 0x0000, 0x0158,
+	0x9786, 0x0001, 0x0140, 0x9786, 0x000a, 0x0128, 0x9786, 0x0009,
+	0x0110, 0x9085, 0x0001, 0x0005, 0x00e6, 0x6010, 0x9075, 0x0138,
+	0x00b6, 0x2058, 0xb8a0, 0x00be, 0x9206, 0x00ee, 0x0005, 0x9085,
+	0x0001, 0x0cd8, 0x0016, 0x6004, 0x908e, 0x001e, 0x11a0, 0x8007,
+	0x6134, 0x918c, 0x00ff, 0x9105, 0x6036, 0x6007, 0x0085, 0x6003,
+	0x000b, 0x6023, 0x0005, 0x2001, 0x1957, 0x2004, 0x601a, 0x080c,
+	0x83da, 0x080c, 0x896d, 0x001e, 0x0005, 0xa001, 0xa001, 0x0005,
+	0x6024, 0xd0e4, 0x0158, 0xd0cc, 0x0118, 0x080c, 0xbe64, 0x0030,
+	0x080c, 0xd7a8, 0x080c, 0x81ed, 0x080c, 0x9e42, 0x0005, 0x9280,
+	0x0008, 0x2004, 0x9084, 0x000f, 0x0002, 0xd5db, 0xd5db, 0xd5db,
+	0xd5dd, 0xd5db, 0xd5dd, 0xd5dd, 0xd5db, 0xd5dd, 0xd5db, 0xd5db,
+	0xd5db, 0xd5db, 0xd5db, 0x9006, 0x0005, 0x9085, 0x0001, 0x0005,
+	0x9280, 0x0008, 0x2004, 0x9084, 0x000f, 0x0002, 0xd5f4, 0xd5f4,
+	0xd5f4, 0xd5f4, 0xd5f4, 0xd5f4, 0xd601, 0xd5f4, 0xd5f4, 0xd5f4,
+	0xd5f4, 0xd5f4, 0xd5f4, 0xd5f4, 0x6007, 0x003b, 0x602f, 0x0009,
+	0x6017, 0x2a00, 0x6003, 0x0001, 0x080c, 0x83da, 0x080c, 0x896d,
+	0x0005, 0x0096, 0x00c6, 0x2260, 0x080c, 0xd7a8, 0x6043, 0x0000,
+	0x6024, 0xc0f4, 0xc0e4, 0x6026, 0x603b, 0x0000, 0x00ce, 0x00d6,
+	0x2268, 0x9186, 0x0007, 0x1904, 0xd65a, 0x6814, 0x9005, 0x0138,
+	0x2048, 0xa87c, 0xd0fc, 0x1118, 0x00de, 0x009e, 0x08a8, 0x6007,
+	0x003a, 0x6003, 0x0001, 0x080c, 0x83da, 0x080c, 0x896d, 0x00c6,
+	0x2d60, 0x6100, 0x9186, 0x0002, 0x1904, 0xd6d1, 0x6014, 0x9005,
+	0x1138, 0x6000, 0x9086, 0x0007, 0x190c, 0x0db4, 0x0804, 0xd6d1,
+	0x2048, 0x080c, 0xbb2c, 0x1130, 0x0028, 0x2048, 0xa800, 0x9005,
+	0x1de0, 0x2900, 0x2048, 0xa87c, 0x9084, 0x0003, 0x9086, 0x0002,
+	0x1168, 0xa87c, 0xc0dc, 0xc0f4, 0xa87e, 0xa880, 0xc0fc, 0xa882,
+	0x2009, 0x0043, 0x080c, 0xcf5f, 0x0804, 0xd6d1, 0x2009, 0x0041,
+	0x0804, 0xd6cb, 0x9186, 0x0005, 0x15a0, 0x6814, 0x2048, 0xa87c,
+	0xd0bc, 0x1120, 0x00de, 0x009e, 0x0804, 0xd5f4, 0xd0b4, 0x0128,
+	0xd0fc, 0x090c, 0x0db4, 0x0804, 0xd615, 0x6007, 0x003a, 0x6003,
+	0x0001, 0x080c, 0x83da, 0x080c, 0x896d, 0x00c6, 0x2d60, 0x6100,
+	0x9186, 0x0002, 0x0120, 0x9186, 0x0004, 0x1904, 0xd6d1, 0x6814,
+	0x2048, 0xa97c, 0xc1f4, 0xc1dc, 0xa97e, 0xa980, 0xc1fc, 0xc1bc,
+	0xa982, 0x00f6, 0x2c78, 0x080c, 0x164a, 0x00fe, 0x2009, 0x0042,
+	0x04d0, 0x0036, 0x080c, 0x0feb, 0x090c, 0x0db4, 0xa867, 0x010d,
+	0x9006, 0xa802, 0xa86a, 0xa88a, 0x2d18, 0xab8e, 0xa887, 0x0045,
+	0x2c00, 0xa892, 0x6038, 0xa8a2, 0x2360, 0x6024, 0xc0dd, 0x6026,
+	0x6010, 0x00b6, 0x2058, 0xb8a0, 0x00be, 0x2004, 0x6354, 0xab7a,
+	0xa876, 0x9006, 0xa87e, 0xa882, 0xad9a, 0xae96, 0xa89f, 0x0001,
+	0x080c, 0x6891, 0x2019, 0x0045, 0x6008, 0x2068, 0x080c, 0xd106,
+	0x2d00, 0x600a, 0x6023, 0x0006, 0x6003, 0x0007, 0x901e, 0x631a,
+	0x6342, 0x003e, 0x0038, 0x6043, 0x0000, 0x6003, 0x0007, 0x080c,
+	0xcf5f, 0x00ce, 0x00de, 0x009e, 0x0005, 0x9186, 0x0013, 0x1128,
+	0x6004, 0x9082, 0x0085, 0x2008, 0x00c2, 0x9186, 0x0027, 0x1178,
+	0x080c, 0x8861, 0x0036, 0x0096, 0x6014, 0x2048, 0x2019, 0x0004,
+	0x080c, 0xd4f6, 0x009e, 0x003e, 0x080c, 0x896d, 0x0005, 0x9186,
+	0x0014, 0x0d70, 0x080c, 0x9ed7, 0x0005, 0xd704, 0xd702, 0xd702,
+	0xd702, 0xd702, 0xd702, 0xd704, 0xd702, 0xd702, 0xd702, 0xd702,
+	0xd702, 0xd702, 0x080c, 0x0db4, 0x080c, 0x8861, 0x6003, 0x000c,
+	0x080c, 0x896d, 0x0005, 0x9182, 0x0092, 0x1220, 0x9182, 0x0085,
+	0x0208, 0x001a, 0x080c, 0x9ed7, 0x0005, 0xd722, 0xd722, 0xd722,
+	0xd722, 0xd724, 0xd744, 0xd722, 0xd722, 0xd722, 0xd722, 0xd722,
+	0xd722, 0xd722, 0x080c, 0x0db4, 0x00d6, 0x2c68, 0x080c, 0x9dec,
+	0x01b0, 0x6003, 0x0001, 0x6007, 0x001e, 0x2009, 0x026e, 0x210c,
+	0x613a, 0x2009, 0x026f, 0x210c, 0x613e, 0x600b, 0xffff, 0x6910,
+	0x6112, 0x6023, 0x0004, 0x080c, 0x83da, 0x080c, 0x896d, 0x2d60,
+	0x080c, 0x9e42, 0x00de, 0x0005, 0x080c, 0x9e42, 0x0005, 0x00e6,
+	0x6010, 0x00b6, 0x2058, 0xb800, 0x00be, 0xd0ec, 0x00ee, 0x0005,
+	0x2009, 0x1873, 0x210c, 0xd1ec, 0x05b0, 0x6003, 0x0002, 0x6024,
+	0xc0e5, 0x6026, 0xd0cc, 0x0150, 0x2001, 0x1958, 0x2004, 0x6042,
+	0x2009, 0x1873, 0x210c, 0xd1f4, 0x1520, 0x00a0, 0x2009, 0x1873,
+	0x210c, 0xd1f4, 0x0128, 0x6024, 0xc0e4, 0x6026, 0x9006, 0x00d8,
+	0x2001, 0x1958, 0x200c, 0x2001, 0x1956, 0x2004, 0x9100, 0x9080,
+	0x000a, 0x6042, 0x6010, 0x00b6, 0x2058, 0xb8ac, 0x00be, 0x0008,
+	0x2104, 0x9005, 0x0118, 0x9088, 0x0003, 0x0cd0, 0x2c0a, 0x600f,
+	0x0000, 0x9085, 0x0001, 0x0005, 0x0016, 0x00c6, 0x00e6, 0x6154,
+	0xb8ac, 0x2060, 0x8cff, 0x0180, 0x84ff, 0x1118, 0x6054, 0x9106,
+	0x1138, 0x600c, 0x2072, 0x080c, 0x81ed, 0x080c, 0x9e42, 0x0010,
+	0x9cf0, 0x0003, 0x2e64, 0x0c70, 0x00ee, 0x00ce, 0x001e, 0x0005,
+	0x00d6, 0x00b6, 0x6010, 0x2058, 0xb8ac, 0x2068, 0x9005, 0x0130,
+	0x9c06, 0x0110, 0x680c, 0x0cd0, 0x600c, 0x680e, 0x00be, 0x00de,
+	0x0005, 0x0026, 0x0036, 0x0156, 0x2011, 0x182b, 0x2204, 0x9084,
+	0x00ff, 0x2019, 0x026e, 0x2334, 0x9636, 0x1508, 0x8318, 0x2334,
+	0x2204, 0x9084, 0xff00, 0x9636, 0x11d0, 0x2011, 0x0270, 0x20a9,
+	0x0004, 0x6010, 0x0096, 0x2048, 0x2019, 0x000a, 0x080c, 0xae20,
+	0x009e, 0x1168, 0x2011, 0x0274, 0x20a9, 0x0004, 0x6010, 0x0096,
+	0x2048, 0x2019, 0x0006, 0x080c, 0xae20, 0x009e, 0x1100, 0x015e,
+	0x003e, 0x002e, 0x0005, 0x00e6, 0x2071, 0x1800, 0x080c, 0x5c6d,
+	0x080c, 0x2dbd, 0x00ee, 0x0005, 0x00e6, 0x6010, 0x00b6, 0x2058,
+	0xb800, 0x00be, 0xd0fc, 0x0108, 0x0011, 0x00ee, 0x0005, 0xa880,
+	0xc0e5, 0xa882, 0x0005, 0x00e6, 0x00d6, 0x00c6, 0x0076, 0x0066,
+	0x0056, 0x0046, 0x0026, 0x0016, 0x0126, 0x2091, 0x8000, 0x2029,
+	0x19c0, 0x252c, 0x2021, 0x19c6, 0x2424, 0x2061, 0x1cd0, 0x2071,
+	0x1800, 0x7650, 0x7070, 0x9606, 0x0578, 0x6720, 0x9786, 0x0001,
+	0x0118, 0x9786, 0x0008, 0x1500, 0x2500, 0x9c06, 0x01e8, 0x2400,
+	0x9c06, 0x01d0, 0x080c, 0xd57c, 0x01b8, 0x080c, 0xd58c, 0x11a0,
+	0x6000, 0x9086, 0x0004, 0x1120, 0x0016, 0x080c, 0x190f, 0x001e,
+	0x080c, 0xbd21, 0x1110, 0x080c, 0x3005, 0x080c, 0xbd32, 0x1110,
+	0x080c, 0xa7d1, 0x080c, 0x9e72, 0x9ce0, 0x0018, 0x2001, 0x1819,
+	0x2004, 0x9c02, 0x1208, 0x0858, 0x012e, 0x001e, 0x002e, 0x004e,
+	0x005e, 0x006e, 0x007e, 0x00ce, 0x00de, 0x00ee, 0x0005, 0x2001,
+	0x1810, 0x2004, 0xd0dc, 0x0005, 0x0006, 0x2001, 0x1836, 0x2004,
+	0xd09c, 0x000e, 0x0005, 0x0006, 0x0036, 0x0046, 0x080c, 0xc22c,
+	0x0168, 0x2019, 0xffff, 0x9005, 0x0128, 0x6010, 0x00b6, 0x2058,
+	0xbba0, 0x00be, 0x2021, 0x0004, 0x080c, 0x4a86, 0x004e, 0x003e,
+	0x000e, 0x6004, 0x9086, 0x0001, 0x1128, 0x080c, 0x992c, 0x080c,
+	0x9e72, 0x9006, 0x0005, 0x00e6, 0x00c6, 0x00b6, 0x0046, 0x2061,
+	0x1cd0, 0x2071, 0x1800, 0x7450, 0x7070, 0x8001, 0x9402, 0x12b8,
+	0x2100, 0x9c06, 0x0148, 0x6000, 0x9086, 0x0000, 0x0128, 0x6010,
+	0x2058, 0xb8a0, 0x9206, 0x0140, 0x9ce0, 0x0018, 0x2001, 0x1819,
+	0x2004, 0x9c02, 0x1220, 0x0c60, 0x9085, 0x0001, 0x0008, 0x9006,
+	0x004e, 0x00be, 0x00ce, 0x00ee, 0x0005, 0x0126, 0x0006, 0x00e6,
+	0x0016, 0x2091, 0x8000, 0x2071, 0x1840, 0xd5a4, 0x0118, 0x7034,
+	0x8000, 0x7036, 0xd5b4, 0x0118, 0x7030, 0x8000, 0x7032, 0xd5ac,
+	0x0178, 0x2500, 0x9084, 0x0007, 0x908e, 0x0003, 0x0148, 0x908e,
+	0x0004, 0x0130, 0x908e, 0x0005, 0x0118, 0x2071, 0x184a, 0x0089,
+	0x001e, 0x00ee, 0x000e, 0x012e, 0x0005, 0x0126, 0x0006, 0x00e6,
+	0x2091, 0x8000, 0x2071, 0x1842, 0x0021, 0x00ee, 0x000e, 0x012e,
+	0x0005, 0x2e04, 0x8000, 0x2072, 0x1220, 0x8e70, 0x2e04, 0x8000,
+	0x2072, 0x0005, 0x00e6, 0x2071, 0x1840, 0x0c99, 0x00ee, 0x0005,
+	0x00e6, 0x2071, 0x1844, 0x0c69, 0x00ee, 0x0005, 0x0126, 0x0006,
+	0x00e6, 0x2091, 0x8000, 0x2071, 0x1840, 0x7044, 0x8000, 0x7046,
+	0x00ee, 0x000e, 0x012e, 0x0005, 0x0003, 0x000b, 0x04a6, 0x0000,
+	0xc000, 0x0001, 0x8064, 0x0008, 0x0010, 0x0000, 0x8066, 0x0000,
+	0x0101, 0x0008, 0x4407, 0x0003, 0x8060, 0x0000, 0x0400, 0x0000,
+	0x580d, 0x000b, 0x798e, 0x0003, 0x50db, 0x000b, 0x4c0a, 0x0003,
+	0xbac0, 0x0009, 0x008a, 0x0000, 0x0c0a, 0x000b, 0x15fe, 0x0008,
+	0x340a, 0x0003, 0xc4c0, 0x0009, 0x7000, 0x0000, 0xffa0, 0x0001,
+	0x2000, 0x0000, 0x1627, 0x0003, 0x808c, 0x0008, 0x0001, 0x0000,
+	0x0000, 0x0007, 0x4047, 0x000a, 0x808c, 0x0008, 0x0002, 0x0000,
+	0x0821, 0x0003, 0x4022, 0x0000, 0x0022, 0x000b, 0x4122, 0x0008,
+	0x4447, 0x0002, 0x0e4f, 0x000b, 0x0bfe, 0x0008, 0x11a0, 0x0001,
+	0x122d, 0x000b, 0x0ca0, 0x0001, 0x122d, 0x000b, 0x9180, 0x0001,
+	0x0004, 0x0000, 0x8060, 0x0000, 0x0400, 0x0000, 0x7f62, 0x0008,
+	0x8066, 0x0000, 0x0009, 0x0008, 0x4430, 0x000b, 0x808c, 0x0008,
+	0x0000, 0x0008, 0x0060, 0x0008, 0x8062, 0x0008, 0x0004, 0x0000,
+	0x8066, 0x0000, 0x0411, 0x0000, 0x4438, 0x0003, 0x03fe, 0x0000,
+	0x43e0, 0x0001, 0x0e2a, 0x000b, 0xc2c0, 0x0009, 0x00ff, 0x0008,
+	0x02e0, 0x0001, 0x0e2a, 0x000b, 0x9180, 0x0001, 0x0005, 0x0008,
+	0x8060, 0x0000, 0x0400, 0x0000, 0x7f62, 0x0008, 0x8066, 0x0000,
+	0x0019, 0x0000, 0x4447, 0x000b, 0x0240, 0x0002, 0x0a27, 0x000b,
+	0x00fe, 0x0000, 0x322a, 0x000b, 0x112a, 0x0000, 0x002e, 0x0008,
+	0x022c, 0x0008, 0x3a44, 0x0002, 0x0c0a, 0x000b, 0x808c, 0x0008,
+	0x0002, 0x0000, 0x1760, 0x0008, 0x8062, 0x0008, 0x000f, 0x0008,
+	0x8066, 0x0000, 0x0011, 0x0008, 0x4458, 0x0003, 0x01fe, 0x0008,
+	0x42e0, 0x0009, 0x0e1d, 0x0003, 0x00fe, 0x0000, 0x43e0, 0x0001,
+	0x0e1d, 0x0003, 0x1734, 0x0000, 0x1530, 0x0000, 0x1632, 0x0008,
+	0x0d2a, 0x0008, 0x9880, 0x0001, 0x0010, 0x0000, 0x8060, 0x0000,
+	0x0400, 0x0000, 0x7f62, 0x0008, 0x8066, 0x0000, 0x1e0a, 0x0008,
+	0x446a, 0x000b, 0x808a, 0x0008, 0x0003, 0x0008, 0x1a60, 0x0000,
+	0x8062, 0x0008, 0x0002, 0x0000, 0x5870, 0x000b, 0x8066, 0x0000,
+	0x3679, 0x0000, 0x4473, 0x0003, 0x5874, 0x0003, 0x3efe, 0x0008,
+	0x7f4f, 0x0002, 0x087a, 0x000b, 0x0d00, 0x0000, 0x0082, 0x0004,
+	0x8054, 0x0008, 0x0011, 0x0008, 0x8074, 0x0000, 0x1010, 0x0008,
+	0x1efe, 0x0000, 0x300a, 0x000b, 0x00b8, 0x0004, 0x000a, 0x000b,
+	0x00fe, 0x0000, 0x348a, 0x000b, 0x1a60, 0x0000, 0x8062, 0x0008,
+	0x0007, 0x0000, 0x8066, 0x0000, 0x0231, 0x0008, 0x4489, 0x0003,
+	0x03fe, 0x0000, 0x04d0, 0x0001, 0x0cb0, 0x0003, 0x82c0, 0x0001,
+	0x1f00, 0x0000, 0xffa0, 0x0001, 0x0400, 0x0000, 0x089f, 0x0003,
+	0x14b0, 0x0003, 0x01fe, 0x0008, 0x0580, 0x0009, 0x7f06, 0x0000,
+	0x02fe, 0x0008, 0xffc0, 0x0001, 0x00ff, 0x0008, 0x0690, 0x0001,
+	0x109f, 0x0003, 0x7f08, 0x0008, 0x84c0, 0x0001, 0xff00, 0x0008,
+	0x08b0, 0x000b, 0x00fe, 0x0000, 0x34a6, 0x0003, 0x8072, 0x0000,
+	0x1010, 0x0008, 0x3944, 0x0002, 0x08a1, 0x000b, 0x00aa, 0x000b,
+	0x8072, 0x0000, 0x2020, 0x0008, 0x3945, 0x000a, 0x08a6, 0x0003,
+	0x3946, 0x000a, 0x0cb7, 0x000b, 0x0000, 0x0007, 0x3943, 0x000a,
+	0x08b7, 0x0003, 0x00aa, 0x000b, 0x00fe, 0x0000, 0x34b5, 0x000b,
+	0x8072, 0x0000, 0x1000, 0x0000, 0x00b7, 0x000b, 0x8072, 0x0000,
+	0x2000, 0x0000, 0x4000, 0x000f, 0x1c60, 0x0000, 0x1b62, 0x0000,
+	0x8066, 0x0000, 0x0231, 0x0008, 0x44bc, 0x0003, 0x58bd, 0x0003,
+	0x0140, 0x0008, 0x0242, 0x0000, 0x1f43, 0x0002, 0x0ccb, 0x0003,
+	0x0d44, 0x0000, 0x0d46, 0x0008, 0x0348, 0x0008, 0x044a, 0x0008,
+	0x030a, 0x0008, 0x040c, 0x0000, 0x0d06, 0x0000, 0x0d08, 0x0008,
+	0x00cf, 0x000b, 0x0344, 0x0008, 0x0446, 0x0008, 0x0548, 0x0008,
+	0x064a, 0x0000, 0x58cf, 0x0003, 0x3efe, 0x0008, 0x7f4f, 0x0002,
+	0x08d6, 0x000b, 0x8000, 0x0000, 0x0001, 0x0000, 0x0082, 0x0004,
+	0x8054, 0x0008, 0x0001, 0x0000, 0x8074, 0x0000, 0x2020, 0x0008,
+	0x4000, 0x000f, 0x3a40, 0x000a, 0x0c0d, 0x0003, 0x2b24, 0x0008,
+	0x2b24, 0x0008, 0x58df, 0x000b, 0x8054, 0x0008, 0x0002, 0x0000,
+	0x1242, 0x0002, 0x092d, 0x000b, 0x3a45, 0x000a, 0x091c, 0x0003,
+	0x8072, 0x0000, 0x1000, 0x0000, 0x3945, 0x000a, 0x08ec, 0x000b,
+	0x8072, 0x0000, 0x3010, 0x0000, 0x1e10, 0x000a, 0x7f3c, 0x0000,
+	0x0917, 0x000b, 0x1d00, 0x0002, 0x7f3a, 0x0000, 0x0d60, 0x0000,
+	0x7f62, 0x0008, 0x8066, 0x0000, 0x0009, 0x0008, 0x44f5, 0x000b,
+	0x00fe, 0x0000, 0x3514, 0x000b, 0x1c60, 0x0000, 0x8062, 0x0008,
+	0x0001, 0x0000, 0x8066, 0x0000, 0x0009, 0x0008, 0x44fd, 0x0003,
+	0x00fe, 0x0000, 0x3204, 0x000b, 0x0038, 0x0000, 0x0060, 0x0008,
+	0x8062, 0x0008, 0x0019, 0x0000, 0x8066, 0x0000, 0x0009, 0x0008,
+	0x4506, 0x0003, 0x80c0, 0x0009, 0x00ff, 0x0008, 0x7f3e, 0x0008,
+	0x0d60, 0x0000, 0x0efe, 0x0008, 0x1f80, 0x0001, 0x7f62, 0x0008,
+	0x8066, 0x0000, 0x0009, 0x0008, 0x4510, 0x000b, 0x003a, 0x0008,
+	0x1dfe, 0x0000, 0x00f1, 0x0003, 0x0036, 0x0008, 0x00b8, 0x0004,
+	0x012d, 0x0003, 0x8074, 0x0000, 0x2000, 0x0000, 0x8072, 0x0000,
+	0x2000, 0x0000, 0x012d, 0x0003, 0x3a44, 0x0002, 0x0a30, 0x000b,
+	0x8074, 0x0000, 0x1000, 0x0000, 0x8072, 0x0000, 0x1000, 0x0000,
+	0x2d0e, 0x0000, 0x2d0e, 0x0000, 0x3601, 0x0003, 0x26fe, 0x0008,
+	0x26fe, 0x0008, 0x2700, 0x0008, 0x2700, 0x0008, 0x00d0, 0x0009,
+	0x0d3f, 0x0003, 0x8074, 0x0000, 0x4040, 0x0008, 0x592d, 0x000b,
+	0x50db, 0x000b, 0x3a46, 0x000a, 0x0d3f, 0x0003, 0x3a47, 0x0002,
+	0x093a, 0x000b, 0x8054, 0x0008, 0x0004, 0x0000, 0x8074, 0x0000,
+	0x8000, 0x0000, 0x8072, 0x0000, 0x3000, 0x0008, 0x0182, 0x0003,
+	0x92c0, 0x0009, 0x0fc8, 0x0000, 0x080a, 0x0003, 0x1246, 0x000a,
+	0x0dfb, 0x000b, 0x1a60, 0x0000, 0x8062, 0x0008, 0x0002, 0x0000,
+	0x8066, 0x0000, 0x362a, 0x0000, 0x4544, 0x0003, 0x2000, 0x0000,
+	0x2000, 0x0000, 0x2102, 0x0000, 0x2102, 0x0000, 0x2204, 0x0000,
+	0x2204, 0x0000, 0x2306, 0x0000, 0x2306, 0x0000, 0x2408, 0x0000,
+	0x2408, 0x0000, 0x250a, 0x0000, 0x250a, 0x0000, 0x260c, 0x0000,
+	0x260c, 0x0000, 0x270e, 0x0000, 0x270e, 0x0000, 0x2810, 0x0000,
+	0x2810, 0x0000, 0x2912, 0x0000, 0x2912, 0x0000, 0x1a60, 0x0000,
+	0x8062, 0x0008, 0x0007, 0x0000, 0x8066, 0x0000, 0x0052, 0x0000,
+	0x455e, 0x000b, 0x92c0, 0x0009, 0x0780, 0x0008, 0x0e17, 0x0003,
+	0x124b, 0x0002, 0x0967, 0x0003, 0x2e4d, 0x0002, 0x2e4d, 0x0002,
+	0x0a01, 0x0003, 0x3a46, 0x000a, 0x0d74, 0x0003, 0x5969, 0x000b,
+	0x8054, 0x0008, 0x0004, 0x0000, 0x1243, 0x000a, 0x097e, 0x000b,
+	0x8010, 0x0008, 0x000d, 0x0000, 0x01ef, 0x0004, 0x1810, 0x0000,
+	0x01ef, 0x0004, 0x017e, 0x0003, 0x194d, 0x000a, 0x0978, 0x000b,
+	0x1243, 0x000a, 0x0a0b, 0x0003, 0x5978, 0x000b, 0x8054, 0x0008,
+	0x0004, 0x0000, 0x01e4, 0x000c, 0x1810, 0x0000, 0x01ef, 0x0004,
+	0x8074, 0x0000, 0xf000, 0x0008, 0x8072, 0x0000, 0x3000, 0x0008,
+	0x0d30, 0x0000, 0x3a42, 0x0002, 0x0d88, 0x0003, 0x15fe, 0x0008,
+	0x3451, 0x000b, 0x000a, 0x000b, 0x8074, 0x0000, 0x0501, 0x0000,
+	0x8010, 0x0008, 0x000c, 0x0008, 0x01ef, 0x0004, 0x000a, 0x000b,
+	0xbbe0, 0x0009, 0x0030, 0x0008, 0x0d9e, 0x000b, 0x18fe, 0x0000,
+	0x3ce0, 0x0009, 0x099b, 0x0003, 0x15fe, 0x0008, 0x3ce0, 0x0009,
+	0x099b, 0x0003, 0x01df, 0x0004, 0x8076, 0x0008, 0x0040, 0x0000,
+	0x01dc, 0x000b, 0x8076, 0x0008, 0x0041, 0x0008, 0x01dc, 0x000b,
+	0xbbe0, 0x0009, 0x0032, 0x0000, 0x0da3, 0x0003, 0x3c1e, 0x0008,
+	0x01dc, 0x000b, 0xbbe0, 0x0009, 0x0037, 0x0000, 0x0dc1, 0x000b,
+	0x18fe, 0x0000, 0x3ce0, 0x0009, 0x0d9b, 0x000b, 0x8076, 0x0008,
+	0x0040, 0x0000, 0x1a60, 0x0000, 0x8062, 0x0008, 0x000d, 0x0000,
+	0x2604, 0x0008, 0x2604, 0x0008, 0x2706, 0x0008, 0x2706, 0x0008,
+	0x2808, 0x0000, 0x2808, 0x0000, 0x290a, 0x0000, 0x290a, 0x0000,
+	0x8066, 0x0000, 0x0422, 0x0000, 0x45b8, 0x0003, 0x01e4, 0x000c,
+	0x8054, 0x0008, 0x0004, 0x0000, 0x8074, 0x0000, 0xf000, 0x0008,
+	0x8072, 0x0000, 0xb000, 0x0000, 0x0182, 0x0003, 0xbbe0, 0x0009,
+	0x0038, 0x0000, 0x0dd3, 0x000b, 0x18fe, 0x0000, 0x3ce0, 0x0009,
+	0x09d0, 0x0003, 0x15fe, 0x0008, 0x3ce0, 0x0009, 0x0d97, 0x000b,
+	0x01df, 0x0004, 0x8076, 0x0008, 0x0040, 0x0000, 0x8072, 0x0000,
+	0x8000, 0x0000, 0x0227, 0x0003, 0x8076, 0x0008, 0x0042, 0x0008,
+	0x01dc, 0x000b, 0xbbe0, 0x0009, 0x0016, 0x0000, 0x0ddc, 0x000b,
+	0x3a44, 0x0002, 0x0c0c, 0x000b, 0x8072, 0x0000, 0x8000, 0x0000,
+	0x8000, 0x000f, 0x000a, 0x000b, 0x8072, 0x0000, 0x8000, 0x0000,
+	0x000a, 0x000b, 0x3d30, 0x000a, 0x7f00, 0x0000, 0xbc80, 0x0001,
+	0x0007, 0x0000, 0x01e8, 0x0003, 0x1930, 0x000a, 0x7f00, 0x0000,
+	0x9880, 0x0001, 0x0007, 0x0000, 0x8060, 0x0000, 0x0400, 0x0000,
+	0x7f62, 0x0008, 0x8066, 0x0000, 0x000a, 0x0008, 0x45ed, 0x0003,
+	0x4000, 0x000f, 0x21ef, 0x0003, 0x0870, 0x0008, 0x4000, 0x000f,
+	0xbac0, 0x0009, 0x0090, 0x0008, 0x09f8, 0x0003, 0x8074, 0x0000,
+	0x0706, 0x0000, 0x01fa, 0x0003, 0x8074, 0x0000, 0x0703, 0x0000,
+	0x4000, 0x000f, 0x8010, 0x0008, 0x0023, 0x0000, 0x0235, 0x0003,
+	0x8010, 0x0008, 0x0008, 0x0000, 0x0235, 0x0003, 0x8010, 0x0008,
+	0x0022, 0x0008, 0x0235, 0x0003, 0x01e4, 0x000c, 0x8010, 0x0008,
+	0x0007, 0x0000, 0x01ef, 0x0004, 0x1810, 0x0000, 0x01ef, 0x0004,
+	0x0241, 0x0003, 0x01e4, 0x000c, 0x8010, 0x0008, 0x001b, 0x0008,
+	0x01ef, 0x0004, 0x1810, 0x0000, 0x01ef, 0x0004, 0x8074, 0x0000,
+	0xf080, 0x0000, 0x8072, 0x0000, 0x3000, 0x0008, 0x0d30, 0x0000,
+	0x000a, 0x000b, 0x8010, 0x0008, 0x0009, 0x0008, 0x0235, 0x0003,
+	0x8010, 0x0008, 0x0005, 0x0008, 0x0235, 0x0003, 0x808c, 0x0008,
+	0x0001, 0x0000, 0x8010, 0x0008, 0x0004, 0x0000, 0x4143, 0x000a,
+	0x085f, 0x0003, 0x3a44, 0x0002, 0x0c0a, 0x000b, 0x0d2a, 0x0008,
+	0x0235, 0x0003, 0x8010, 0x0008, 0x0003, 0x0008, 0x0239, 0x0003,
+	0x8010, 0x0008, 0x000b, 0x0000, 0x0239, 0x0003, 0x8010, 0x0008,
+	0x0002, 0x0000, 0x0239, 0x0003, 0x3a47, 0x0002, 0x0d2d, 0x0003,
+	0x8010, 0x0008, 0x0006, 0x0008, 0x0239, 0x0003, 0x8074, 0x0000,
+	0xf000, 0x0008, 0x8072, 0x0000, 0x3000, 0x0008, 0x01ef, 0x0004,
+	0x01f2, 0x0004, 0x3a40, 0x000a, 0x080a, 0x0003, 0x8010, 0x0008,
+	0x000c, 0x0008, 0x01ef, 0x0004, 0x000a, 0x000b, 0x8074, 0x0000,
+	0xf080, 0x0000, 0x8072, 0x0000, 0x3000, 0x0008, 0x0d30, 0x0000,
+	0x2e4d, 0x0002, 0x2e4d, 0x0002, 0x0a4c, 0x0003, 0x8054, 0x0008,
+	0x0019, 0x0000, 0x000a, 0x000b, 0x8054, 0x0008, 0x0009, 0x0008,
+	0x000a, 0x000b, 0x3a44, 0x0002, 0x0c0a, 0x000b, 0x022a, 0x000b,
+	0x15b6, 0xf4ac, 0x0001, 0x0002, 0x0004, 0x0008, 0x0010, 0x0020,
+	0x0040, 0x0080, 0x0100, 0x0200, 0x0400, 0x0800, 0x1000, 0x2000,
+	0x4000, 0x8000, 0x0a42
 };
 #ifdef UNIQUE_FW_NAME
-unsigned short fw2300flx_length01 = 0xd59a;
+unsigned short fw2300flx_length01 = 0xd5bb;
 #else
-unsigned short risc_code_length01 = 0xd59a;
+unsigned short risc_code_length01 = 0xd5bb;
 #endif
 
diff --git a/drivers/scsi/qla2xxx/ql6322.c b/drivers/scsi/qla2xxx/ql6322.c
index 30e80a56e..ce651454d 100644
--- a/drivers/scsi/qla2xxx/ql6322.c
+++ b/drivers/scsi/qla2xxx/ql6322.c
@@ -9,7 +9,6 @@
 #include <linux/module.h>
 #include <linux/pci.h>
 
-#include "qla_os.h"
 #include "qla_def.h"
 
 static char qla_driver_name[] = "qla6322";
diff --git a/drivers/scsi/qla2xxx/ql6322_fw.c b/drivers/scsi/qla2xxx/ql6322_fw.c
index f8744fa9b..de1cbcbe8 100644
--- a/drivers/scsi/qla2xxx/ql6322_fw.c
+++ b/drivers/scsi/qla2xxx/ql6322_fw.c
@@ -18,7 +18,7 @@
  *************************************************************************/
 
 /*
- *	Firmware Version 3.02.28 (14:05 Apr 03, 2004)
+ *	Firmware Version 3.02.30 (07:56 Jun 16, 2004)
  */
 
 #ifdef UNIQUE_FW_NAME
@@ -28,15 +28,15 @@ unsigned short risc_code_version = 3*1024+2;
 #endif
 
 #ifdef UNIQUE_FW_NAME
-unsigned char fw2322flx_version_str[] = {3, 2,28};
+unsigned char fw2322flx_version_str[] = {3, 2,30};
 #else
-unsigned char firmware_version[] = {3, 2,28};
+unsigned char firmware_version[] = {3, 2,30};
 #endif
 
 #ifdef UNIQUE_FW_NAME
-#define fw2322flx_VERSION_STRING "3.02.28"
+#define fw2322flx_VERSION_STRING "3.02.30"
 #else
-#define FW_VERSION_STRING "3.02.28"
+#define FW_VERSION_STRING "3.02.30"
 #endif
 
 #ifdef UNIQUE_FW_NAME
@@ -50,12 +50,12 @@ unsigned short fw2322flx_code01[] = {
 #else
 unsigned short risc_code01[] = { 
 #endif
-	0x0470, 0x0000, 0x0000, 0xce3b, 0x0000, 0x0003, 0x0002, 0x001c,
+	0x0470, 0x0000, 0x0000, 0xce4c, 0x0000, 0x0003, 0x0002, 0x001e,
 	0x0317, 0x2043, 0x4f50, 0x5952, 0x4947, 0x4854, 0x2032, 0x3030,
 	0x3120, 0x514c, 0x4f47, 0x4943, 0x2043, 0x4f52, 0x504f, 0x5241,
 	0x5449, 0x4f4e, 0x2049, 0x5350, 0x3233, 0x3030, 0x2046, 0x6972,
 	0x6d77, 0x6172, 0x6520, 0x2056, 0x6572, 0x7369, 0x6f6e, 0x2030,
-	0x332e, 0x3032, 0x2e32, 0x3820, 0x2020, 0x2020, 0x2400, 0x20a9,
+	0x332e, 0x3032, 0x2e33, 0x3020, 0x2020, 0x2020, 0x2400, 0x20a9,
 	0x000f, 0x2001, 0x0000, 0x400f, 0x2091, 0x2200, 0x20a9, 0x000f,
 	0x2001, 0x0000, 0x400f, 0x2091, 0x2400, 0x20a9, 0x000f, 0x2001,
 	0x0000, 0x400f, 0x2091, 0x2600, 0x20a9, 0x000f, 0x2001, 0x0000,
@@ -64,161 +64,161 @@ unsigned short risc_code01[] = {
 	0x2c00, 0x20a9, 0x000f, 0x2001, 0x0000, 0x400f, 0x2091, 0x2e00,
 	0x20a9, 0x000f, 0x2001, 0x0000, 0x400f, 0x2091, 0x2000, 0x2001,
 	0x0000, 0x20c1, 0x0004, 0x20c9, 0x1cff, 0x2059, 0x0000, 0x2b78,
-	0x7883, 0x0004, 0x2089, 0x28de, 0x2051, 0x1800, 0x2a70, 0x20e1,
+	0x7883, 0x0004, 0x2089, 0x28ec, 0x2051, 0x1800, 0x2a70, 0x20e1,
 	0x0001, 0x20e9, 0x0001, 0x2009, 0x0000, 0x080c, 0x0e3d, 0x00f6,
-	0x7888, 0x9005, 0x11f8, 0x2061, 0xc000, 0x080c, 0x1efc, 0x1170,
-	0x2079, 0x0300, 0x080c, 0x1f12, 0x2061, 0xe000, 0x080c, 0x1efc,
-	0x1128, 0x2079, 0x0380, 0x080c, 0x1f12, 0x0060, 0x00fe, 0x7883,
+	0x7888, 0x9005, 0x11f8, 0x2061, 0xc000, 0x080c, 0x1f09, 0x1170,
+	0x2079, 0x0300, 0x080c, 0x1f1f, 0x2061, 0xe000, 0x080c, 0x1f09,
+	0x1128, 0x2079, 0x0380, 0x080c, 0x1f1f, 0x0060, 0x00fe, 0x7883,
 	0x4010, 0x7837, 0x4010, 0x7833, 0x0010, 0x2091, 0x5000, 0x2091,
 	0x4080, 0x0cf8, 0x00fe, 0x2029, 0x26c0, 0x2031, 0xffff, 0x2039,
 	0x269c, 0x2021, 0x0050, 0x20e9, 0x0001, 0x20a1, 0x0000, 0x20a9,
 	0x0800, 0x900e, 0x4104, 0x20e9, 0x0001, 0x20a1, 0x1000, 0x900e,
 	0x2001, 0x0dc1, 0x9084, 0x0fff, 0x20a8, 0x4104, 0x2001, 0x0000,
 	0x9086, 0x0000, 0x0120, 0x21a8, 0x4104, 0x8001, 0x1de0, 0x756a,
-	0x766e, 0x7766, 0x7472, 0x7476, 0x00e6, 0x2071, 0x1b1e, 0x2472,
+	0x766e, 0x7766, 0x7472, 0x7476, 0x00e6, 0x2071, 0x1b1d, 0x2472,
 	0x00ee, 0x20a1, 0x1ddc, 0x716c, 0x810d, 0x810d, 0x810d, 0x810d,
 	0x918c, 0x000f, 0x2001, 0x0001, 0x9112, 0x900e, 0x21a8, 0x4104,
 	0x8211, 0x1de0, 0x716c, 0x3400, 0x8001, 0x9102, 0x0120, 0x0218,
 	0x20a8, 0x900e, 0x4104, 0x2009, 0x1800, 0x810d, 0x810d, 0x810d,
 	0x810d, 0x810d, 0x918c, 0x001f, 0x2001, 0x0001, 0x9112, 0x20e9,
 	0x0001, 0x20a1, 0x0800, 0x900e, 0x20a9, 0x0800, 0x4104, 0x8211,
-	0x1dd8, 0x080c, 0x0f3a, 0x080c, 0x5cea, 0x080c, 0x9b7d, 0x080c,
-	0x10f1, 0x080c, 0x12d6, 0x080c, 0x1a5a, 0x080c, 0x8440, 0x080c,
-	0x0cf7, 0x080c, 0x1076, 0x080c, 0x328b, 0x080c, 0x73cb, 0x080c,
-	0x6722, 0x080c, 0x808a, 0x080c, 0x20dd, 0x080c, 0x7a5f, 0x080c,
-	0x1f2b, 0x080c, 0x2065, 0x080c, 0x20d2, 0x2091, 0x3009, 0x7883,
+	0x1dd8, 0x080c, 0x0f3a, 0x080c, 0x5ce5, 0x080c, 0x9b70, 0x080c,
+	0x10f1, 0x080c, 0x12e1, 0x080c, 0x1a67, 0x080c, 0x8422, 0x080c,
+	0x0cf7, 0x080c, 0x1076, 0x080c, 0x327f, 0x080c, 0x73aa, 0x080c,
+	0x6721, 0x080c, 0x8069, 0x080c, 0x20f6, 0x080c, 0x7a3e, 0x080c,
+	0x1f38, 0x080c, 0x2076, 0x080c, 0x20eb, 0x2091, 0x3009, 0x7883,
 	0x0000, 0x1004, 0x0941, 0x7880, 0x9086, 0x0002, 0x1190, 0x7883,
 	0x4000, 0x7837, 0x4000, 0x7833, 0x0010, 0x0e04, 0x0935, 0x2091,
 	0x5000, 0x2091, 0x4080, 0x2001, 0x0089, 0x2004, 0xd084, 0x190c,
-	0x11be, 0x2071, 0x1800, 0x7003, 0x0000, 0x2071, 0x1800, 0x7000,
-	0x908e, 0x0003, 0x1158, 0x080c, 0x499d, 0x080c, 0x32b2, 0x080c,
-	0x7433, 0x080c, 0x6bca, 0x080c, 0x80b3, 0x0c78, 0x000b, 0x0c98,
+	0x11c9, 0x2071, 0x1800, 0x7003, 0x0000, 0x2071, 0x1800, 0x7000,
+	0x908e, 0x0003, 0x1158, 0x080c, 0x499f, 0x080c, 0x32a6, 0x080c,
+	0x7412, 0x080c, 0x6bb9, 0x080c, 0x8092, 0x0c78, 0x000b, 0x0c98,
 	0x0962, 0x0963, 0x0afa, 0x0960, 0x0bab, 0x0cf6, 0x0cf6, 0x0cf6,
 	0x080c, 0x0d65, 0x0005, 0x0126, 0x00f6, 0x2091, 0x8000, 0x7000,
-	0x9086, 0x0001, 0x1904, 0x0acd, 0x080c, 0x0e8d, 0x080c, 0x70b7,
-	0x0150, 0x080c, 0x70da, 0x15b0, 0x2079, 0x0100, 0x7828, 0x9085,
-	0x1800, 0x782a, 0x0478, 0x080c, 0x6fe8, 0x7000, 0x9086, 0x0001,
+	0x9086, 0x0001, 0x1904, 0x0acd, 0x080c, 0x0e8d, 0x080c, 0x7096,
+	0x0150, 0x080c, 0x70b9, 0x15b0, 0x2079, 0x0100, 0x7828, 0x9085,
+	0x1800, 0x782a, 0x0478, 0x080c, 0x6fc7, 0x7000, 0x9086, 0x0001,
 	0x1904, 0x0acd, 0x7094, 0x9086, 0x0028, 0x1904, 0x0acd, 0x080c,
-	0x8082, 0x080c, 0x8074, 0x2001, 0x0161, 0x2003, 0x0001, 0x2079,
-	0x0100, 0x2011, 0xffff, 0x080c, 0x286d, 0x7a28, 0x9295, 0x5e2c,
-	0x7a2a, 0x2011, 0x6f2d, 0x080c, 0x8159, 0x2011, 0x6f20, 0x080c,
-	0x825f, 0x2011, 0x5b41, 0x080c, 0x8159, 0x2011, 0x8030, 0x901e,
-	0x7392, 0x04d0, 0x080c, 0x53ee, 0x2079, 0x0100, 0x7844, 0x9005,
-	0x1904, 0x0acd, 0x2011, 0x5b41, 0x080c, 0x8159, 0x2011, 0x6f2d,
-	0x080c, 0x8159, 0x2011, 0x6f20, 0x080c, 0x825f, 0x2001, 0x0265,
+	0x8061, 0x080c, 0x8053, 0x2001, 0x0161, 0x2003, 0x0001, 0x2079,
+	0x0100, 0x2011, 0xffff, 0x080c, 0x288c, 0x7a28, 0x9295, 0x5e2c,
+	0x7a2a, 0x2011, 0x6f0c, 0x080c, 0x8138, 0x2011, 0x6eff, 0x080c,
+	0x823e, 0x2011, 0x5b3c, 0x080c, 0x8138, 0x2011, 0x8030, 0x901e,
+	0x7392, 0x04d0, 0x080c, 0x53e9, 0x2079, 0x0100, 0x7844, 0x9005,
+	0x1904, 0x0acd, 0x2011, 0x5b3c, 0x080c, 0x8138, 0x2011, 0x6f0c,
+	0x080c, 0x8138, 0x2011, 0x6eff, 0x080c, 0x823e, 0x2001, 0x0265,
 	0x2001, 0x0205, 0x2003, 0x0000, 0x7840, 0x9084, 0xfffb, 0x7842,
-	0x2001, 0x1977, 0x2004, 0x9005, 0x1140, 0x00c6, 0x2061, 0x0100,
-	0x080c, 0x5c92, 0x00ce, 0x0804, 0x0acd, 0x780f, 0x006b, 0x7a28,
-	0x080c, 0x70bf, 0x0118, 0x9295, 0x5e2c, 0x0010, 0x9295, 0x402c,
-	0x7a2a, 0x2011, 0x8010, 0x73d4, 0x2001, 0x1978, 0x2003, 0x0001,
-	0x080c, 0x273f, 0x080c, 0x48d8, 0x7244, 0xc284, 0x7246, 0x2001,
+	0x2001, 0x1976, 0x2004, 0x9005, 0x1140, 0x00c6, 0x2061, 0x0100,
+	0x080c, 0x5c8d, 0x00ce, 0x0804, 0x0acd, 0x780f, 0x006b, 0x7a28,
+	0x080c, 0x709e, 0x0118, 0x9295, 0x5e2c, 0x0010, 0x9295, 0x402c,
+	0x7a2a, 0x2011, 0x8010, 0x73d4, 0x2001, 0x1977, 0x2003, 0x0001,
+	0x080c, 0x2758, 0x080c, 0x48da, 0x7244, 0xc284, 0x7246, 0x2001,
 	0x180c, 0x200c, 0xc1ac, 0xc1cc, 0x2102, 0x2001, 0x0390, 0x2003,
-	0x0400, 0x080c, 0x98c8, 0x080c, 0x91e1, 0x2011, 0x0004, 0x080c,
-	0xb857, 0x080c, 0x98e4, 0x080c, 0x6562, 0x080c, 0x70b7, 0x1120,
-	0x080c, 0x279a, 0x0600, 0x0420, 0x080c, 0x5c99, 0x0140, 0x7093,
-	0x0001, 0x70cf, 0x0000, 0x080c, 0x55bb, 0x0804, 0x0acd, 0x080c,
-	0x538d, 0xd094, 0x01a8, 0x2001, 0x0390, 0x2003, 0x0404, 0x2011,
-	0x180c, 0x2204, 0xc0cd, 0x2012, 0x080c, 0x5391, 0xd0d4, 0x1118,
-	0x080c, 0x279a, 0x1270, 0x2011, 0x180c, 0x2204, 0xc0bc, 0x0088,
-	0x080c, 0x5391, 0xd0d4, 0x1db8, 0x2011, 0x180c, 0x2204, 0xc0bd,
-	0x0040, 0x2011, 0x180c, 0x2204, 0xc0bd, 0x2012, 0x080c, 0x665f,
-	0x0008, 0x2012, 0x080c, 0x6625, 0x0120, 0x7a0c, 0xc2b4, 0x7a0e,
-	0x00a8, 0x707b, 0x0000, 0x080c, 0x70b7, 0x1130, 0x70ac, 0x9005,
+	0x0400, 0x080c, 0x98bb, 0x080c, 0x91c4, 0x2011, 0x0004, 0x080c,
+	0xb852, 0x080c, 0x98d7, 0x080c, 0x6561, 0x080c, 0x7096, 0x1120,
+	0x080c, 0x27b9, 0x0600, 0x0420, 0x080c, 0x5c94, 0x0140, 0x7093,
+	0x0001, 0x70cf, 0x0000, 0x080c, 0x55b6, 0x0804, 0x0acd, 0x080c,
+	0x5388, 0xd094, 0x01a8, 0x2001, 0x0390, 0x2003, 0x0404, 0x2011,
+	0x180c, 0x2204, 0xc0cd, 0x2012, 0x080c, 0x538c, 0xd0d4, 0x1118,
+	0x080c, 0x27b9, 0x1270, 0x2011, 0x180c, 0x2204, 0xc0bc, 0x0088,
+	0x080c, 0x538c, 0xd0d4, 0x1db8, 0x2011, 0x180c, 0x2204, 0xc0bd,
+	0x0040, 0x2011, 0x180c, 0x2204, 0xc0bd, 0x2012, 0x080c, 0x665e,
+	0x0008, 0x2012, 0x080c, 0x6624, 0x0120, 0x7a0c, 0xc2b4, 0x7a0e,
+	0x00a8, 0x707b, 0x0000, 0x080c, 0x7096, 0x1130, 0x70ac, 0x9005,
 	0x1168, 0x080c, 0xbcae, 0x0050, 0x080c, 0xbcae, 0x70d8, 0xd09c,
-	0x1128, 0x70ac, 0x9005, 0x0110, 0x080c, 0x5c6f, 0x70e3, 0x0000,
-	0x70df, 0x0000, 0x70a3, 0x0000, 0x080c, 0x27a2, 0x0228, 0x2011,
-	0x0101, 0x2204, 0xc0c4, 0x2012, 0x72d8, 0x080c, 0x70b7, 0x1178,
-	0x9016, 0x0016, 0x2009, 0x0002, 0x2019, 0x193e, 0x211a, 0x001e,
+	0x1128, 0x70ac, 0x9005, 0x0110, 0x080c, 0x5c6a, 0x70e3, 0x0000,
+	0x70df, 0x0000, 0x70a3, 0x0000, 0x080c, 0x27c1, 0x0228, 0x2011,
+	0x0101, 0x2204, 0xc0c4, 0x2012, 0x72d8, 0x080c, 0x7096, 0x1178,
+	0x9016, 0x0016, 0x2009, 0x0002, 0x2019, 0x193d, 0x211a, 0x001e,
 	0x705b, 0xffff, 0x705f, 0x00ef, 0x707f, 0x0000, 0x0020, 0x2019,
-	0x193e, 0x201b, 0x0000, 0x2079, 0x1853, 0x7804, 0xd0ac, 0x0108,
-	0xc295, 0x72da, 0x080c, 0x70b7, 0x0118, 0x9296, 0x0004, 0x0518,
-	0x2011, 0x0001, 0x080c, 0xb857, 0x70a7, 0x0000, 0x70ab, 0xffff,
-	0x7003, 0x0002, 0x00fe, 0x080c, 0x2ddb, 0x080c, 0x98c8, 0x2011,
-	0x0005, 0x080c, 0x9339, 0x080c, 0x98e4, 0x080c, 0x70b7, 0x0148,
+	0x193d, 0x201b, 0x0000, 0x2079, 0x1853, 0x7804, 0xd0ac, 0x0108,
+	0xc295, 0x72da, 0x080c, 0x7096, 0x0118, 0x9296, 0x0004, 0x0518,
+	0x2011, 0x0001, 0x080c, 0xb852, 0x70a7, 0x0000, 0x70ab, 0xffff,
+	0x7003, 0x0002, 0x00fe, 0x080c, 0x2de9, 0x080c, 0x98bb, 0x2011,
+	0x0005, 0x080c, 0x931c, 0x080c, 0x98d7, 0x080c, 0x7096, 0x0148,
 	0x00c6, 0x2061, 0x0100, 0x0016, 0x2009, 0x0002, 0x61e2, 0x001e,
 	0x00ce, 0x012e, 0x00e0, 0x70a7, 0x0000, 0x70ab, 0xffff, 0x7003,
-	0x0002, 0x080c, 0x98c8, 0x2011, 0x0005, 0x080c, 0x9339, 0x080c,
-	0x98e4, 0x080c, 0x70b7, 0x0148, 0x00c6, 0x2061, 0x0100, 0x0016,
+	0x0002, 0x080c, 0x98bb, 0x2011, 0x0005, 0x080c, 0x931c, 0x080c,
+	0x98d7, 0x080c, 0x7096, 0x0148, 0x00c6, 0x2061, 0x0100, 0x0016,
 	0x2009, 0x0002, 0x61e2, 0x001e, 0x00ce, 0x00fe, 0x012e, 0x0005,
-	0x00c6, 0x00b6, 0x080c, 0x70b7, 0x1118, 0x20a9, 0x0800, 0x0010,
-	0x20a9, 0x0782, 0x080c, 0x70b7, 0x1110, 0x900e, 0x0010, 0x2009,
+	0x00c6, 0x00b6, 0x080c, 0x7096, 0x1118, 0x20a9, 0x0800, 0x0010,
+	0x20a9, 0x0782, 0x080c, 0x7096, 0x1110, 0x900e, 0x0010, 0x2009,
 	0x007e, 0x86ff, 0x0138, 0x9180, 0x1000, 0x2004, 0x905d, 0x0110,
-	0xb800, 0xd0bc, 0x090c, 0x311a, 0x8108, 0x1f04, 0x0ae1, 0x707b,
+	0xb800, 0xd0bc, 0x090c, 0x3116, 0x8108, 0x1f04, 0x0ae1, 0x707b,
 	0x0000, 0x707c, 0x9084, 0x00ff, 0x707e, 0x70af, 0x0000, 0x00be,
 	0x00ce, 0x0005, 0x00b6, 0x0126, 0x2091, 0x8000, 0x7000, 0x9086,
 	0x0002, 0x1904, 0x0ba8, 0x70a8, 0x9086, 0xffff, 0x0120, 0x080c,
-	0x2ddb, 0x0804, 0x0ba8, 0x70d8, 0xd0ac, 0x1110, 0xd09c, 0x0520,
+	0x2de9, 0x0804, 0x0ba8, 0x70d8, 0xd0ac, 0x1110, 0xd09c, 0x0520,
 	0xd084, 0x0510, 0x0006, 0x2001, 0x0103, 0x2003, 0x002b, 0x000e,
-	0xd08c, 0x01d0, 0x70dc, 0x9086, 0xffff, 0x0190, 0x080c, 0x2f66,
+	0xd08c, 0x01d0, 0x70dc, 0x9086, 0xffff, 0x0190, 0x080c, 0x2f74,
 	0x70d8, 0xd094, 0x1904, 0x0ba8, 0x2011, 0x0001, 0x080c, 0xbf61,
-	0x0110, 0x2011, 0x0003, 0x901e, 0x080c, 0x2fa0, 0x0804, 0x0ba8,
+	0x0110, 0x2011, 0x0003, 0x901e, 0x080c, 0x2fae, 0x0804, 0x0ba8,
 	0x70e0, 0x9005, 0x1904, 0x0ba8, 0x70a4, 0x9005, 0x1904, 0x0ba8,
-	0x70d8, 0xd0a4, 0x0118, 0xd0b4, 0x0904, 0x0ba8, 0x080c, 0x6625,
-	0x1904, 0x0ba8, 0x080c, 0x6678, 0x1904, 0x0ba8, 0x080c, 0x665f,
+	0x70d8, 0xd0a4, 0x0118, 0xd0b4, 0x0904, 0x0ba8, 0x080c, 0x6624,
+	0x1904, 0x0ba8, 0x080c, 0x6677, 0x1904, 0x0ba8, 0x080c, 0x665e,
 	0x01c0, 0x0156, 0x00c6, 0x20a9, 0x007f, 0x900e, 0x0016, 0x080c,
-	0x6270, 0x1118, 0xb800, 0xd0ec, 0x1138, 0x001e, 0x8108, 0x1f04,
+	0x626b, 0x1118, 0xb800, 0xd0ec, 0x1138, 0x001e, 0x8108, 0x1f04,
 	0x0b4e, 0x00ce, 0x015e, 0x0028, 0x001e, 0x00ce, 0x015e, 0x0804,
 	0x0ba8, 0x0006, 0x2001, 0x0103, 0x2003, 0x006b, 0x000e, 0x2011,
-	0x1984, 0x080c, 0x0faa, 0x2011, 0x199e, 0x080c, 0x0faa, 0x7030,
+	0x1983, 0x080c, 0x0faa, 0x2011, 0x199d, 0x080c, 0x0faa, 0x7030,
 	0xc08c, 0x7032, 0x7003, 0x0003, 0x70ab, 0xffff, 0x080c, 0x0e61,
-	0x9006, 0x080c, 0x23c9, 0x0036, 0x0046, 0x2019, 0xffff, 0x2021,
-	0x0006, 0x080c, 0x4a75, 0x004e, 0x003e, 0x00f6, 0x2079, 0x0100,
-	0x080c, 0x70da, 0x0150, 0x080c, 0x70b7, 0x7828, 0x0118, 0x9084,
-	0xe1ff, 0x0010, 0x9084, 0xffdf, 0x782a, 0x00fe, 0x080c, 0x98c8,
-	0x2001, 0x19b9, 0x2004, 0x9086, 0x0005, 0x1120, 0x2011, 0x0000,
-	0x080c, 0x9339, 0x2011, 0x0000, 0x080c, 0x9343, 0x080c, 0x98e4,
+	0x9006, 0x080c, 0x23e2, 0x0036, 0x0046, 0x2019, 0xffff, 0x2021,
+	0x0006, 0x080c, 0x4a77, 0x004e, 0x003e, 0x00f6, 0x2079, 0x0100,
+	0x080c, 0x70b9, 0x0150, 0x080c, 0x7096, 0x7828, 0x0118, 0x9084,
+	0xe1ff, 0x0010, 0x9084, 0xffdf, 0x782a, 0x00fe, 0x080c, 0x98bb,
+	0x2001, 0x19b8, 0x2004, 0x9086, 0x0005, 0x1120, 0x2011, 0x0000,
+	0x080c, 0x931c, 0x2011, 0x0000, 0x080c, 0x9326, 0x080c, 0x98d7,
 	0x012e, 0x00be, 0x0005, 0x0016, 0x0026, 0x0046, 0x00f6, 0x0126,
 	0x2091, 0x8000, 0x2079, 0x0100, 0x7904, 0x918c, 0xfffd, 0x7906,
-	0x2009, 0x00f7, 0x080c, 0x5c58, 0x7940, 0x918c, 0x0010, 0x7942,
-	0x7924, 0xd1b4, 0x0120, 0x2011, 0x0040, 0x080c, 0x286d, 0xd19c,
-	0x0120, 0x2011, 0x0008, 0x080c, 0x286d, 0x0006, 0x0036, 0x0156,
-	0x0000, 0x2001, 0x1978, 0x2004, 0x9005, 0x1518, 0x080c, 0x2801,
-	0x1148, 0x2001, 0x0001, 0x080c, 0x276e, 0x2001, 0x0001, 0x080c,
-	0x2751, 0x00b8, 0x080c, 0x2809, 0x1138, 0x9006, 0x080c, 0x276e,
-	0x9006, 0x080c, 0x2751, 0x0068, 0x080c, 0x2811, 0x1d50, 0x2001,
-	0x1969, 0x2004, 0xd0fc, 0x0108, 0x0020, 0x080c, 0x2568, 0x0804,
-	0x0ca9, 0x080c, 0x2890, 0x080c, 0x28d4, 0x20a9, 0x003a, 0x1d04,
-	0x0bff, 0x080c, 0x823f, 0x1f04, 0x0bff, 0x080c, 0x70c8, 0x0148,
-	0x080c, 0x70da, 0x1118, 0x080c, 0x73c6, 0x0050, 0x080c, 0x70bf,
-	0x0dd0, 0x080c, 0x73c1, 0x080c, 0x73b7, 0x080c, 0x6fe8, 0x0020,
-	0x2009, 0x00f8, 0x080c, 0x5c58, 0x7850, 0xc0e5, 0x7852, 0x080c,
-	0x70b7, 0x0120, 0x7843, 0x0090, 0x7843, 0x0010, 0x2021, 0xe678,
-	0x2019, 0xea60, 0x0d0c, 0x823f, 0x7820, 0xd09c, 0x15a0, 0x080c,
-	0x70b7, 0x0904, 0x0c8b, 0x7824, 0xd0ac, 0x1904, 0x0cae, 0x080c,
-	0x70da, 0x1548, 0x0046, 0x2021, 0x0320, 0x8421, 0x1df0, 0x004e,
-	0x2011, 0x1800, 0x080c, 0x286d, 0x080c, 0x2819, 0x7824, 0x9084,
+	0x2009, 0x00f7, 0x080c, 0x5c53, 0x7940, 0x918c, 0x0010, 0x7942,
+	0x7924, 0xd1b4, 0x0120, 0x2011, 0x0040, 0x080c, 0x288c, 0xd19c,
+	0x0120, 0x2011, 0x0008, 0x080c, 0x288c, 0x0006, 0x0036, 0x0156,
+	0x0000, 0x2001, 0x1977, 0x2004, 0x9005, 0x1518, 0x080c, 0x2820,
+	0x1148, 0x2001, 0x0001, 0x080c, 0x2787, 0x2001, 0x0001, 0x080c,
+	0x276a, 0x00b8, 0x080c, 0x2828, 0x1138, 0x9006, 0x080c, 0x2787,
+	0x9006, 0x080c, 0x276a, 0x0068, 0x080c, 0x2830, 0x1d50, 0x2001,
+	0x1968, 0x2004, 0xd0fc, 0x0108, 0x0020, 0x080c, 0x2581, 0x0804,
+	0x0ca9, 0x080c, 0x28af, 0x080c, 0x28e2, 0x20a9, 0x003a, 0x1d04,
+	0x0bff, 0x080c, 0x821e, 0x1f04, 0x0bff, 0x080c, 0x70a7, 0x0148,
+	0x080c, 0x70b9, 0x1118, 0x080c, 0x73a5, 0x0050, 0x080c, 0x709e,
+	0x0dd0, 0x080c, 0x73a0, 0x080c, 0x7396, 0x080c, 0x6fc7, 0x0020,
+	0x2009, 0x00f8, 0x080c, 0x5c53, 0x7850, 0xc0e5, 0x7852, 0x080c,
+	0x7096, 0x0120, 0x7843, 0x0090, 0x7843, 0x0010, 0x2021, 0xe678,
+	0x2019, 0xea60, 0x0d0c, 0x821e, 0x7820, 0xd09c, 0x15a0, 0x080c,
+	0x7096, 0x0904, 0x0c8b, 0x7824, 0xd0ac, 0x1904, 0x0cae, 0x080c,
+	0x70b9, 0x1548, 0x0046, 0x2021, 0x0320, 0x8421, 0x1df0, 0x004e,
+	0x2011, 0x1800, 0x080c, 0x288c, 0x080c, 0x2838, 0x7824, 0x9084,
 	0x1800, 0x1168, 0x9484, 0x0fff, 0x1140, 0x2001, 0x1810, 0x2004,
 	0x9084, 0x9000, 0x0110, 0x080c, 0x0cd1, 0x8421, 0x1160, 0x1d04,
-	0x0c5b, 0x080c, 0x823f, 0x080c, 0x73c1, 0x080c, 0x73b7, 0x7003,
+	0x0c5b, 0x080c, 0x821e, 0x080c, 0x73a0, 0x080c, 0x7396, 0x7003,
 	0x0001, 0x0804, 0x0cae, 0x8319, 0x1928, 0x2001, 0x1810, 0x2004,
 	0x9084, 0x9000, 0x0110, 0x080c, 0x0cd1, 0x1d04, 0x0c71, 0x080c,
-	0x823f, 0x2009, 0x196c, 0x2104, 0x9005, 0x0118, 0x8001, 0x200a,
-	0x1188, 0x200b, 0x000a, 0x2011, 0x0048, 0x080c, 0x286d, 0x20a9,
-	0x0002, 0x080c, 0x27fa, 0x7924, 0x080c, 0x2819, 0xd19c, 0x0110,
-	0x080c, 0x273f, 0x00f0, 0x080c, 0x70c8, 0x1140, 0x94a2, 0x03e8,
-	0x1128, 0x080c, 0x708b, 0x7003, 0x0001, 0x00c0, 0x2011, 0x1800,
-	0x080c, 0x286d, 0x080c, 0x2819, 0x7824, 0x080c, 0x70d1, 0x0110,
+	0x821e, 0x2009, 0x196b, 0x2104, 0x9005, 0x0118, 0x8001, 0x200a,
+	0x1188, 0x200b, 0x000a, 0x2011, 0x0048, 0x080c, 0x288c, 0x20a9,
+	0x0002, 0x080c, 0x2819, 0x7924, 0x080c, 0x2838, 0xd19c, 0x0110,
+	0x080c, 0x2758, 0x00f0, 0x080c, 0x70a7, 0x1140, 0x94a2, 0x03e8,
+	0x1128, 0x080c, 0x706a, 0x7003, 0x0001, 0x00c0, 0x2011, 0x1800,
+	0x080c, 0x288c, 0x080c, 0x2838, 0x7824, 0x080c, 0x70b0, 0x0110,
 	0xd0ac, 0x1160, 0x9084, 0x1800, 0x0904, 0x0c63, 0x7003, 0x0001,
-	0x0028, 0x2001, 0x0001, 0x080c, 0x23c9, 0x00a0, 0x7850, 0xc0e4,
+	0x0028, 0x2001, 0x0001, 0x080c, 0x23e2, 0x00a0, 0x7850, 0xc0e4,
 	0x7852, 0x2009, 0x180c, 0x210c, 0xd19c, 0x1120, 0x7904, 0x918d,
-	0x0002, 0x7906, 0x2011, 0x0048, 0x080c, 0x286d, 0x7828, 0x9085,
-	0x0028, 0x782a, 0x2001, 0x1978, 0x2003, 0x0000, 0x9006, 0x78f2,
+	0x0002, 0x7906, 0x2011, 0x0048, 0x080c, 0x288c, 0x7828, 0x9085,
+	0x0028, 0x782a, 0x2001, 0x1977, 0x2003, 0x0000, 0x9006, 0x78f2,
 	0x015e, 0x003e, 0x000e, 0x012e, 0x00fe, 0x004e, 0x002e, 0x001e,
 	0x0005, 0x0006, 0x0016, 0x0026, 0x0036, 0x0046, 0x00b6, 0x00c6,
-	0x00d6, 0x00e6, 0x00f6, 0x0156, 0x0071, 0x0d0c, 0x823f, 0x015e,
+	0x00d6, 0x00e6, 0x00f6, 0x0156, 0x0071, 0x0d0c, 0x821e, 0x015e,
 	0x00fe, 0x00ee, 0x00de, 0x00ce, 0x00be, 0x004e, 0x003e, 0x002e,
 	0x001e, 0x000e, 0x0005, 0x00e6, 0x2071, 0x1894, 0x7004, 0x9086,
-	0x0001, 0x1110, 0x080c, 0x32b2, 0x00ee, 0x0005, 0x0005, 0x2a70,
-	0x2061, 0x197c, 0x2063, 0x0003, 0x6007, 0x0002, 0x600b, 0x001c,
-	0x600f, 0x0317, 0x2001, 0x194d, 0x900e, 0x2102, 0x7192, 0x2001,
+	0x0001, 0x1110, 0x080c, 0x32a6, 0x00ee, 0x0005, 0x0005, 0x2a70,
+	0x2061, 0x197b, 0x2063, 0x0003, 0x6007, 0x0002, 0x600b, 0x001e,
+	0x600f, 0x0317, 0x2001, 0x194c, 0x900e, 0x2102, 0x7192, 0x2001,
 	0x0100, 0x2004, 0x9082, 0x0002, 0x0218, 0x705b, 0xffff, 0x0008,
 	0x715a, 0x7063, 0xffff, 0x717a, 0x717e, 0x080c, 0xbcae, 0x70eb,
-	0x00c0, 0x2061, 0x193d, 0x6003, 0x0909, 0x6106, 0x600b, 0x8800,
+	0x00c0, 0x2061, 0x193c, 0x6003, 0x0909, 0x6106, 0x600b, 0x8800,
 	0x600f, 0x0200, 0x6013, 0x00ff, 0x6017, 0x000f, 0x611a, 0x601f,
-	0x07d0, 0x2061, 0x1945, 0x6003, 0x8000, 0x6106, 0x610a, 0x600f,
+	0x07d0, 0x2061, 0x1944, 0x6003, 0x8000, 0x6106, 0x610a, 0x600f,
 	0x0200, 0x6013, 0x00ff, 0x6116, 0x601b, 0x0001, 0x611e, 0x2061,
-	0x195a, 0x6003, 0x514c, 0x6007, 0x4f47, 0x600b, 0x4943, 0x600f,
-	0x2020, 0x2001, 0x182b, 0x2102, 0x0005, 0x9016, 0x080c, 0x6270,
+	0x1959, 0x6003, 0x514c, 0x6007, 0x4f47, 0x600b, 0x4943, 0x600f,
+	0x2020, 0x2001, 0x182b, 0x2102, 0x0005, 0x9016, 0x080c, 0x626b,
 	0x1178, 0xb804, 0x90c4, 0x00ff, 0x98c6, 0x0006, 0x0128, 0x90c4,
 	0xff00, 0x98c6, 0x0600, 0x1120, 0x9186, 0x0080, 0x0108, 0x8210,
 	0x8108, 0x9186, 0x0800, 0x1d50, 0x2208, 0x0005, 0x2091, 0x8000,
@@ -226,29 +226,29 @@ unsigned short risc_code01[] = {
 	0x0d67, 0x0006, 0x0016, 0x2001, 0x8002, 0x0006, 0x2079, 0x0000,
 	0x000e, 0x7882, 0x7836, 0x001e, 0x798e, 0x000e, 0x788a, 0x000e,
 	0x7886, 0x3900, 0x789a, 0x7833, 0x0012, 0x2091, 0x5000, 0x0156,
-	0x00d6, 0x0036, 0x0026, 0x2079, 0x0300, 0x2069, 0x1af4, 0x7a08,
-	0x226a, 0x2069, 0x1af5, 0x7a18, 0x226a, 0x8d68, 0x7a1c, 0x226a,
-	0x782c, 0x2019, 0x1b02, 0x201a, 0x2019, 0x1b05, 0x9016, 0x7808,
-	0xd09c, 0x0168, 0x7820, 0x201a, 0x8210, 0x8318, 0x9386, 0x1b1e,
+	0x00d6, 0x0036, 0x0026, 0x2079, 0x0300, 0x2069, 0x1af3, 0x7a08,
+	0x226a, 0x2069, 0x1af4, 0x7a18, 0x226a, 0x8d68, 0x7a1c, 0x226a,
+	0x782c, 0x2019, 0x1b01, 0x201a, 0x2019, 0x1b04, 0x9016, 0x7808,
+	0xd09c, 0x0168, 0x7820, 0x201a, 0x8210, 0x8318, 0x9386, 0x1b1d,
 	0x0108, 0x0ca8, 0x7808, 0xd09c, 0x0110, 0x2011, 0xdead, 0x2019,
-	0x1b03, 0x782c, 0x201a, 0x8318, 0x221a, 0x7803, 0x0000, 0x2069,
-	0x1a4a, 0x901e, 0x20a9, 0x0020, 0x7b26, 0x7a28, 0x226a, 0x8d68,
+	0x1b02, 0x782c, 0x201a, 0x8318, 0x221a, 0x7803, 0x0000, 0x2069,
+	0x1a49, 0x901e, 0x20a9, 0x0020, 0x7b26, 0x7a28, 0x226a, 0x8d68,
 	0x8318, 0x1f04, 0x0db4, 0x0491, 0x002e, 0x003e, 0x00de, 0x015e,
 	0x2079, 0x1800, 0x7803, 0x0005, 0x2091, 0x4080, 0x2001, 0x0089,
-	0x2004, 0xd084, 0x0180, 0x2001, 0x19f3, 0x2004, 0x9005, 0x0128,
+	0x2004, 0xd084, 0x0180, 0x2001, 0x19f2, 0x2004, 0x9005, 0x0128,
 	0x2001, 0x008b, 0x2004, 0xd0fc, 0x0dd8, 0x2001, 0x008a, 0x2003,
-	0x0002, 0x2003, 0x1001, 0x080c, 0x539c, 0x1170, 0x080c, 0x0efb,
-	0x0110, 0x080c, 0x0e4e, 0x080c, 0x539c, 0x1130, 0x2071, 0x1800,
+	0x0002, 0x2003, 0x1001, 0x080c, 0x5397, 0x1170, 0x080c, 0x0efb,
+	0x0110, 0x080c, 0x0e4e, 0x080c, 0x5397, 0x1130, 0x2071, 0x1800,
 	0x2011, 0x8000, 0x080c, 0x0f0f, 0x0c70, 0x0005, 0x2001, 0x0382,
 	0x2004, 0x9084, 0x0007, 0x9086, 0x0001, 0x1120, 0x2001, 0x0015,
-	0x080c, 0x98b9, 0x2079, 0x0380, 0x2069, 0x1ad4, 0x7818, 0x6802,
+	0x080c, 0x98ac, 0x2079, 0x0380, 0x2069, 0x1ad3, 0x7818, 0x6802,
 	0x781c, 0x6806, 0x7840, 0x680a, 0x7844, 0x680e, 0x782c, 0x6812,
-	0x2019, 0x1adf, 0x9016, 0x7808, 0xd09c, 0x0150, 0x7820, 0x201a,
+	0x2019, 0x1ade, 0x9016, 0x7808, 0xd09c, 0x0150, 0x7820, 0x201a,
 	0x8210, 0x8318, 0x8210, 0x9282, 0x0011, 0x0ea8, 0x2011, 0xdead,
 	0x6a2a, 0x7830, 0x681a, 0x7834, 0x681e, 0x7838, 0x6822, 0x783c,
-	0x6826, 0x7803, 0x0000, 0x2069, 0x1a94, 0x901e, 0x20a9, 0x0020,
+	0x6826, 0x7803, 0x0000, 0x2069, 0x1a93, 0x901e, 0x20a9, 0x0020,
 	0x7b26, 0x7828, 0x206a, 0x8d68, 0x8318, 0x1f04, 0x0e28, 0x2069,
-	0x1ab4, 0x2019, 0x00b0, 0x20a9, 0x0020, 0x7b26, 0x7828, 0x206a,
+	0x1ab3, 0x2019, 0x00b0, 0x20a9, 0x0020, 0x7b26, 0x7828, 0x206a,
 	0x8d68, 0x8318, 0x1f04, 0x0e35, 0x0005, 0x918c, 0x03ff, 0x2001,
 	0x0003, 0x2004, 0x9084, 0x0600, 0x1118, 0x918d, 0x6c00, 0x0010,
 	0x918d, 0x6400, 0x2001, 0x017f, 0x2102, 0x0005, 0x0026, 0x0126,
@@ -263,7 +263,7 @@ unsigned short risc_code01[] = {
 	0x0148, 0xd0a4, 0x1138, 0x2011, 0xcdd5, 0x0010, 0x2011, 0x0080,
 	0x080c, 0x0f00, 0x002e, 0x0005, 0x0026, 0x70ef, 0x0000, 0x080c,
 	0x0efb, 0x1130, 0x2011, 0x8040, 0x080c, 0x0f0f, 0x002e, 0x0005,
-	0x080c, 0x2811, 0x1118, 0x2011, 0xcdc5, 0x0010, 0x2011, 0xcac2,
+	0x080c, 0x2830, 0x1118, 0x2011, 0xcdc5, 0x0010, 0x2011, 0xcac2,
 	0x080c, 0x0f00, 0x002e, 0x0005, 0x00e6, 0x0016, 0x0006, 0x2071,
 	0x1800, 0xd0b4, 0x70e8, 0x71e4, 0x1118, 0xc0e4, 0xc1f4, 0x0050,
 	0x0006, 0x3b00, 0x9084, 0xff3e, 0x20d8, 0x000e, 0x70ef, 0x0000,
@@ -320,7 +320,7 @@ unsigned short risc_code01[] = {
 	0x0016, 0x890e, 0x810e, 0x810f, 0x9184, 0x003f, 0xa862, 0x9184,
 	0xffc0, 0xa85e, 0x001e, 0x0020, 0x00e6, 0x0126, 0x2091, 0x8000,
 	0x2071, 0x1800, 0x702c, 0xa802, 0x2900, 0x702e, 0x70bc, 0x8000,
-	0x70be, 0x080c, 0x8074, 0x012e, 0x00ee, 0x0005, 0x2071, 0x1800,
+	0x70be, 0x080c, 0x8053, 0x012e, 0x00ee, 0x0005, 0x2071, 0x1800,
 	0x9026, 0x2009, 0x0000, 0x2049, 0x0400, 0x2900, 0x702e, 0x8940,
 	0x2800, 0xa802, 0xa95e, 0xa863, 0x0001, 0x8420, 0x9886, 0x0440,
 	0x0120, 0x2848, 0x9188, 0x0040, 0x0c90, 0x2071, 0x1883, 0x7000,
@@ -336,5473 +336,5473 @@ unsigned short risc_code01[] = {
 	0x9982, 0x0440, 0x0278, 0x9982, 0x049b, 0x0288, 0x9982, 0x0800,
 	0x1270, 0x0040, 0x9982, 0x0800, 0x0250, 0x2071, 0x1883, 0x7010,
 	0x9902, 0x1228, 0x9085, 0x0001, 0x001e, 0x00ee, 0x0005, 0x9006,
-	0x0cd8, 0x00e6, 0x2071, 0x19f2, 0x7007, 0x0000, 0x9006, 0x701e,
+	0x0cd8, 0x00e6, 0x2071, 0x19f1, 0x7007, 0x0000, 0x9006, 0x701e,
 	0x7022, 0x7002, 0x2071, 0x0000, 0x7010, 0x9085, 0x8044, 0x7012,
-	0x2071, 0x0080, 0x9006, 0x20a9, 0x0040, 0x7022, 0x1f04, 0x1105,
-	0x702b, 0x0020, 0x00ee, 0x0005, 0x0126, 0x2091, 0x8000, 0x00e6,
-	0xa06f, 0x0000, 0x2071, 0x19f2, 0x701c, 0x9088, 0x19fc, 0x280a,
-	0x8000, 0x9084, 0x003f, 0x701e, 0x7120, 0x9106, 0x090c, 0x0d65,
-	0x7004, 0x9005, 0x1128, 0x00f6, 0x2079, 0x0080, 0x00a9, 0x00fe,
-	0x00ee, 0x012e, 0x0005, 0x0126, 0x2091, 0x8000, 0x00e6, 0x2071,
-	0x19f2, 0x7004, 0x9005, 0x1128, 0x00f6, 0x2079, 0x0080, 0x0021,
-	0x00fe, 0x00ee, 0x012e, 0x0005, 0x7004, 0x9086, 0x0000, 0x1110,
-	0x7007, 0x0006, 0x7000, 0x0002, 0x114e, 0x114c, 0x114c, 0x114c,
-	0x12c5, 0x12c5, 0x12c5, 0x12c5, 0x080c, 0x0d65, 0x701c, 0x7120,
-	0x9106, 0x1148, 0x792c, 0x9184, 0x0001, 0x1120, 0xd1fc, 0x1110,
-	0x7007, 0x0000, 0x0005, 0x0096, 0x9180, 0x19fc, 0x2004, 0x700a,
-	0x2048, 0x8108, 0x918c, 0x003f, 0x7122, 0x782b, 0x0026, 0xa88c,
-	0x7802, 0xa890, 0x7806, 0xa894, 0x780a, 0xa898, 0x780e, 0xa878,
-	0x700e, 0xa870, 0x7016, 0xa874, 0x701a, 0xa868, 0x009e, 0xd084,
-	0x0120, 0x7007, 0x0001, 0x0029, 0x0005, 0x7007, 0x0002, 0x00b1,
-	0x0005, 0x0016, 0x0026, 0x710c, 0x2011, 0x0040, 0x9182, 0x0040,
-	0x1210, 0x2110, 0x9006, 0x700e, 0x7212, 0x8203, 0x7812, 0x782b,
-	0x0020, 0x782b, 0x0041, 0x002e, 0x001e, 0x0005, 0x0016, 0x0026,
-	0x0136, 0x0146, 0x0156, 0x7014, 0x20e0, 0x7018, 0x2098, 0x20e9,
-	0x0000, 0x20a1, 0x0088, 0x782b, 0x0026, 0x710c, 0x2011, 0x0040,
-	0x9182, 0x0040, 0x1210, 0x2110, 0x9006, 0x700e, 0x22a8, 0x4006,
-	0x8203, 0x7812, 0x782b, 0x0020, 0x3300, 0x701a, 0x782b, 0x0001,
-	0x015e, 0x014e, 0x013e, 0x002e, 0x001e, 0x0005, 0x2009, 0x19f2,
-	0x2104, 0xc095, 0x200a, 0x080c, 0x112b, 0x0005, 0x0016, 0x00e6,
-	0x2071, 0x19f2, 0x00f6, 0x2079, 0x0080, 0x792c, 0xd1bc, 0x190c,
-	0x0d5e, 0x782b, 0x0002, 0xd1fc, 0x0120, 0x918c, 0x0700, 0x7004,
-	0x0023, 0x00fe, 0x00ee, 0x001e, 0x0005, 0x113c, 0x11e4, 0x1218,
-	0x0d65, 0x0d65, 0x12d1, 0x0d65, 0x918c, 0x0700, 0x1550, 0x0136,
-	0x0146, 0x0156, 0x7014, 0x20e8, 0x7018, 0x20a0, 0x20e1, 0x0000,
-	0x2099, 0x0088, 0x782b, 0x0040, 0x7010, 0x20a8, 0x4005, 0x3400,
-	0x701a, 0x015e, 0x014e, 0x013e, 0x700c, 0x9005, 0x0578, 0x7800,
-	0x7802, 0x7804, 0x7806, 0x080c, 0x1181, 0x0005, 0x7008, 0x0096,
-	0x2048, 0xa86f, 0x0100, 0x009e, 0x7007, 0x0000, 0x080c, 0x113c,
-	0x0005, 0x7008, 0x0096, 0x2048, 0xa86f, 0x0200, 0x009e, 0x0ca0,
-	0x918c, 0x0700, 0x1150, 0x700c, 0x9005, 0x0180, 0x7800, 0x7802,
-	0x7804, 0x7806, 0x080c, 0x1196, 0x0005, 0x7008, 0x0096, 0x2048,
-	0xa86f, 0x0200, 0x009e, 0x7007, 0x0000, 0x0080, 0x0096, 0x7008,
-	0x2048, 0x7800, 0xa88e, 0x7804, 0xa892, 0x7808, 0xa896, 0x780c,
-	0xa89a, 0xa86f, 0x0100, 0x009e, 0x7007, 0x0000, 0x0096, 0x00d6,
-	0x7008, 0x2048, 0x2001, 0x18af, 0x2004, 0x9906, 0x1128, 0xa89c,
-	0x080f, 0x00de, 0x009e, 0x00a0, 0x00de, 0x009e, 0x0096, 0x00d6,
-	0x7008, 0x2048, 0x0081, 0x0150, 0xa89c, 0x0086, 0x2940, 0x080f,
-	0x008e, 0x00de, 0x009e, 0x080c, 0x112b, 0x0005, 0x00de, 0x009e,
-	0x080c, 0x112b, 0x0005, 0xa8a8, 0xd08c, 0x0005, 0x0096, 0xa0a0,
-	0x904d, 0x090c, 0x0d65, 0xa06c, 0x908e, 0x0100, 0x0130, 0xa87b,
-	0x0030, 0xa883, 0x0000, 0xa897, 0x4002, 0x080c, 0x698a, 0xa09f,
-	0x0000, 0xa0a3, 0x0000, 0x2848, 0x080c, 0x1054, 0x009e, 0x0005,
-	0x00a6, 0xa0a0, 0x904d, 0x090c, 0x0d65, 0xa06c, 0x908e, 0x0100,
-	0x0128, 0xa87b, 0x0001, 0xa883, 0x0000, 0x00c0, 0xa80c, 0x2050,
-	0xb004, 0x9005, 0x0198, 0xa80e, 0x2050, 0x8006, 0x8006, 0x8007,
-	0x908c, 0x003f, 0x9084, 0xffc0, 0x9080, 0x0002, 0xa076, 0xa172,
-	0xb000, 0xa07a, 0x2810, 0x080c, 0x110c, 0x00e8, 0xa97c, 0xa894,
-	0x0016, 0x0006, 0x080c, 0x698a, 0x000e, 0x001e, 0xd1fc, 0x1138,
-	0xd1f4, 0x0128, 0x00c6, 0x2060, 0x080c, 0x9be7, 0x00ce, 0x7008,
-	0x2048, 0xa89f, 0x0000, 0xa8a3, 0x0000, 0x080c, 0x1054, 0x7007,
-	0x0000, 0x080c, 0x112b, 0x00ae, 0x0005, 0x0126, 0x2091, 0x8000,
-	0x782b, 0x1001, 0x7007, 0x0005, 0x7000, 0xc094, 0x7002, 0x012e,
-	0x0005, 0x7007, 0x0000, 0x080c, 0x113c, 0x0005, 0x0126, 0x2091,
-	0x2200, 0x2079, 0x0300, 0x2071, 0x1a3c, 0x7003, 0x0000, 0x78bf,
-	0x00f6, 0x0041, 0x7807, 0x0007, 0x7803, 0x0000, 0x7803, 0x0001,
-	0x012e, 0x0005, 0x00c6, 0x7803, 0x0000, 0x2001, 0x0165, 0x2003,
-	0x4198, 0x7808, 0xd09c, 0x0110, 0x7820, 0x0cd8, 0x2001, 0x1a3d,
-	0x2003, 0x0000, 0x78ab, 0x0004, 0x78ac, 0xd0ac, 0x1de8, 0x78ab,
-	0x0002, 0x7807, 0x0007, 0x7827, 0x0030, 0x782b, 0x0400, 0x7827,
-	0x0031, 0x782b, 0x1a4a, 0x781f, 0xff00, 0x781b, 0xff00, 0x2001,
-	0x0200, 0x2004, 0xd0dc, 0x0110, 0x781f, 0x0303, 0x2061, 0x1a4a,
-	0x602f, 0x1ddc, 0x2001, 0x1819, 0x2004, 0x9082, 0x1ddc, 0x6032,
-	0x603b, 0x1cf7, 0x602b, 0x1a8a, 0x6007, 0x1a6a, 0x2061, 0x1a6a,
-	0x00ce, 0x0005, 0x0126, 0x2091, 0x2200, 0x7908, 0x9184, 0x0070,
-	0x190c, 0x0d5e, 0xd19c, 0x05a0, 0x7820, 0x908c, 0xf000, 0x0540,
-	0x2060, 0x6020, 0x9086, 0x0003, 0x1550, 0x6000, 0x9086, 0x0004,
-	0x1530, 0x6114, 0x2148, 0xa876, 0xa87a, 0xa867, 0x0103, 0x080c,
-	0x67ac, 0x00b6, 0x6010, 0x2058, 0xba3c, 0x8211, 0x0208, 0xba3e,
-	0xb8c0, 0x9005, 0x190c, 0x639b, 0x00be, 0x6044, 0xd0fc, 0x190c,
-	0x98f1, 0x080c, 0x9c0f, 0x7808, 0xd09c, 0x19b0, 0x012e, 0x0005,
-	0x908a, 0x0024, 0x1a0c, 0x0d65, 0x002b, 0x012e, 0x0005, 0x04b0,
-	0x012e, 0x0005, 0x138e, 0x13b4, 0x13e4, 0x13e9, 0x13ed, 0x13f2,
-	0x141a, 0x141e, 0x142c, 0x1430, 0x138e, 0x14ba, 0x14be, 0x1521,
-	0x138e, 0x138e, 0x138e, 0x138e, 0x138e, 0x138e, 0x138e, 0x138e,
-	0x138e, 0x138e, 0x138e, 0x138e, 0x138e, 0x13f4, 0x138e, 0x13bc,
-	0x13e1, 0x13a8, 0x138e, 0x13c8, 0x1392, 0x1390, 0x080c, 0x0d65,
-	0x080c, 0x0d5e, 0x080c, 0x1528, 0x2009, 0x1a49, 0x2104, 0x8000,
-	0x200a, 0x080c, 0x7b22, 0x080c, 0x195f, 0x0005, 0x6044, 0xd0fc,
-	0x190c, 0x98f1, 0x2009, 0x0055, 0x080c, 0x9c85, 0x012e, 0x0005,
-	0x080c, 0x1528, 0x2060, 0x6044, 0xd0fc, 0x190c, 0x98f1, 0x2009,
-	0x0055, 0x080c, 0x9c85, 0x0005, 0x2009, 0x0048, 0x080c, 0x1528,
-	0x2060, 0x080c, 0x9c85, 0x0005, 0x2009, 0x0054, 0x080c, 0x1528,
-	0x2060, 0x6044, 0xd0fc, 0x190c, 0x98f1, 0x080c, 0x9c85, 0x0005,
-	0x080c, 0x1528, 0x2060, 0x0056, 0x0066, 0x080c, 0x1528, 0x2028,
-	0x080c, 0x1528, 0x2030, 0x0036, 0x0046, 0x2021, 0x0000, 0x2418,
-	0x2009, 0x0056, 0x080c, 0x9c85, 0x004e, 0x003e, 0x006e, 0x005e,
-	0x0005, 0x080c, 0x1528, 0x0005, 0x7004, 0xc085, 0xc0b5, 0x7006,
-	0x0005, 0x7004, 0xc085, 0x7006, 0x0005, 0x080c, 0x1528, 0x080c,
-	0x15e5, 0x0005, 0x080c, 0x0d65, 0x080c, 0x1528, 0x2060, 0x6014,
-	0x0096, 0x2048, 0xa83b, 0xffff, 0x009e, 0x2009, 0x0048, 0x080c,
-	0x9c85, 0x2001, 0x015d, 0x2003, 0x0000, 0x2009, 0x03e8, 0x8109,
-	0x0160, 0x2001, 0x0201, 0x2004, 0x9005, 0x0dc8, 0x2001, 0x0218,
-	0x2004, 0xd0ec, 0x1110, 0x080c, 0x152d, 0x2001, 0x0307, 0x2003,
-	0x8000, 0x0005, 0x7004, 0xc095, 0x7006, 0x0005, 0x080c, 0x1528,
-	0x2060, 0x6014, 0x0096, 0x2048, 0xa83b, 0xffff, 0x009e, 0x2009,
-	0x0048, 0x080c, 0x9c85, 0x0005, 0x080c, 0x1528, 0x080c, 0x0d65,
-	0x080c, 0x1528, 0x080c, 0x14a5, 0x7827, 0x0018, 0x79ac, 0xd1dc,
-	0x0540, 0x7827, 0x0015, 0x7828, 0x782b, 0x0000, 0x9065, 0x0138,
-	0x2001, 0x020d, 0x2003, 0x0050, 0x2003, 0x0020, 0x0400, 0x7004,
-	0x9005, 0x1180, 0x78ab, 0x0004, 0x7827, 0x0018, 0x782b, 0x0000,
-	0xd1bc, 0x090c, 0x0d65, 0x2001, 0x020d, 0x2003, 0x0050, 0x2003,
-	0x0020, 0x0480, 0x78ab, 0x0004, 0x7803, 0x0001, 0x080c, 0x14be,
-	0x0005, 0x7828, 0x782b, 0x0000, 0x9065, 0x090c, 0x0d65, 0x6014,
-	0x2048, 0x78ab, 0x0004, 0x918c, 0x0700, 0x0198, 0x080c, 0x7b22,
-	0x080c, 0x195f, 0x080c, 0xb847, 0x0158, 0xa9ac, 0xa936, 0xa9b0,
-	0xa93a, 0xa83f, 0xffff, 0xa843, 0xffff, 0xa880, 0xc0bd, 0xa882,
-	0x0005, 0x6010, 0x00b6, 0x2058, 0xb800, 0x00be, 0xd0bc, 0x6024,
-	0x190c, 0xbc43, 0x2029, 0x00c8, 0x8529, 0x0128, 0x2001, 0x0201,
-	0x2004, 0x9005, 0x0dc8, 0x7dbc, 0x080c, 0xd5d3, 0xd5a4, 0x1118,
-	0x080c, 0x152d, 0x0005, 0x080c, 0x7b22, 0x080c, 0x195f, 0x0005,
-	0x781f, 0x0300, 0x7803, 0x0001, 0x0005, 0x0016, 0x0066, 0x0076,
-	0x00f6, 0x2079, 0x0300, 0x7908, 0x918c, 0x0007, 0x9186, 0x0003,
-	0x0120, 0x2001, 0x0016, 0x080c, 0x159e, 0x00fe, 0x007e, 0x006e,
-	0x001e, 0x0005, 0x7004, 0xc09d, 0x7006, 0x0005, 0x7104, 0x9184,
-	0x0004, 0x190c, 0x0d65, 0xd184, 0x1189, 0xd19c, 0x0158, 0xc19c,
-	0x7106, 0x2001, 0x020d, 0x2003, 0x0050, 0x2003, 0x0020, 0x080c,
-	0x152d, 0x0005, 0x81ff, 0x190c, 0x0d65, 0x0005, 0xc184, 0xd1b4,
-	0xc1b4, 0x7106, 0x0016, 0x00e6, 0x15e0, 0x2071, 0x0200, 0x080c,
-	0x15d9, 0x6014, 0x9005, 0x05a8, 0x0096, 0x2048, 0xa864, 0x009e,
-	0x9084, 0x00ff, 0x908e, 0x0029, 0x0160, 0x908e, 0x0048, 0x1548,
-	0x601c, 0xd084, 0x11d8, 0x00f6, 0x2c78, 0x080c, 0x164f, 0x00fe,
-	0x00a8, 0x00f6, 0x2c78, 0x080c, 0x1797, 0x00fe, 0x2009, 0x01f4,
-	0x8109, 0x0160, 0x2001, 0x0201, 0x2004, 0x9005, 0x0dc8, 0x2001,
-	0x0218, 0x2004, 0xd0ec, 0x1110, 0x0401, 0x0040, 0x2001, 0x020d,
-	0x2003, 0x0020, 0x080c, 0x12ea, 0x7803, 0x0001, 0x00ee, 0x001e,
-	0x0005, 0x2001, 0x020d, 0x2003, 0x0050, 0x2003, 0x0020, 0x0069,
-	0x0ca8, 0x0031, 0x2060, 0x2009, 0x0053, 0x080c, 0x9c85, 0x0005,
-	0x7808, 0xd09c, 0x0de8, 0x7820, 0x0005, 0x080c, 0x14a5, 0x00d6,
-	0x2069, 0x0200, 0x2009, 0x01f4, 0x8109, 0x0510, 0x6804, 0x9005,
-	0x0dd8, 0x2001, 0x015d, 0x2003, 0x0000, 0x79bc, 0xd1a4, 0x1528,
-	0x79b8, 0x918c, 0x0fff, 0x0180, 0x9182, 0x0841, 0x1268, 0x9188,
-	0x0007, 0x918c, 0x0ff8, 0x810c, 0x810c, 0x810c, 0x080c, 0x1590,
-	0x6827, 0x0001, 0x8109, 0x1dd0, 0x04d9, 0x6827, 0x0002, 0x04c1,
-	0x6804, 0x9005, 0x1130, 0x682c, 0xd0e4, 0x1500, 0x6804, 0x9005,
-	0x0de8, 0x79b8, 0xd1ec, 0x1130, 0x08c0, 0x080c, 0x7b22, 0x080c,
-	0x195f, 0x0090, 0x7827, 0x0015, 0x782b, 0x0000, 0x7827, 0x0018,
-	0x782b, 0x0000, 0x2001, 0x020d, 0x2003, 0x0020, 0x2001, 0x0307,
-	0x2003, 0x0300, 0x7803, 0x0001, 0x00de, 0x0005, 0x682c, 0x9084,
-	0x5400, 0x9086, 0x5400, 0x0d30, 0x7827, 0x0015, 0x782b, 0x0000,
-	0x7803, 0x0001, 0x6800, 0x9085, 0x1800, 0x6802, 0x00de, 0x0005,
-	0x6824, 0x9084, 0x0003, 0x1de0, 0x0005, 0x2001, 0x0030, 0x2c08,
-	0x621c, 0x0021, 0x7830, 0x9086, 0x0041, 0x0005, 0x00f6, 0x2079,
-	0x0300, 0x0006, 0x7808, 0xd09c, 0x0140, 0x0016, 0x0026, 0x00c6,
-	0x080c, 0x132a, 0x00ce, 0x002e, 0x001e, 0x000e, 0x0006, 0x7832,
-	0x7936, 0x7a3a, 0x781b, 0x8080, 0x0059, 0x1118, 0x000e, 0x00fe,
-	0x0005, 0x000e, 0x792c, 0x3900, 0x8000, 0x2004, 0x080c, 0x0d65,
-	0x2009, 0xff00, 0x8109, 0x0120, 0x7818, 0xd0bc, 0x1dd8, 0x0005,
-	0x9085, 0x0001, 0x0005, 0x7832, 0x7936, 0x7a3a, 0x781b, 0x8080,
-	0x0c79, 0x1108, 0x0005, 0x792c, 0x3900, 0x8000, 0x2004, 0x080c,
-	0x0d65, 0x7037, 0x0001, 0x7150, 0x7037, 0x0002, 0x7050, 0x2060,
-	0xd1bc, 0x1110, 0x7054, 0x2060, 0x0005, 0x00e6, 0x0016, 0x2071,
-	0x0200, 0x0c79, 0x6124, 0xd1dc, 0x01f8, 0x701c, 0xd08c, 0x0904,
-	0x1644, 0x7017, 0x0000, 0x2001, 0x0264, 0x2004, 0xd0bc, 0x0904,
-	0x1644, 0x2001, 0x0268, 0x00c6, 0x2064, 0x6104, 0x6038, 0x00ce,
-	0x918e, 0x0039, 0x1904, 0x1644, 0x9c06, 0x15f0, 0x0126, 0x2091,
-	0x2600, 0x080c, 0x7a7a, 0x012e, 0x7358, 0x745c, 0x6014, 0x905d,
-	0x0598, 0x2b48, 0x6010, 0x00b6, 0x2058, 0xb800, 0x00be, 0xd0bc,
-	0x190c, 0xbc1e, 0xab42, 0xac3e, 0x2001, 0x1875, 0x2004, 0xd0b4,
-	0x1170, 0x601c, 0xd0e4, 0x1158, 0x6010, 0x00b6, 0x2058, 0xb800,
-	0x00be, 0xd0bc, 0x1120, 0xa83b, 0x7fff, 0xa837, 0xffff, 0x080c,
-	0x1d17, 0x1190, 0x080c, 0x17f2, 0x2a00, 0xa816, 0x0130, 0x2800,
-	0xa80e, 0x2c05, 0xa80a, 0x2c00, 0xa812, 0x7037, 0x0020, 0x781f,
-	0x0300, 0x001e, 0x00ee, 0x0005, 0x7037, 0x0050, 0x7037, 0x0020,
-	0x001e, 0x00ee, 0x080c, 0x152d, 0x0005, 0x080c, 0x0d65, 0x0016,
-	0x2009, 0x00a0, 0x8109, 0xa001, 0xa001, 0xa001, 0x1dd8, 0x001e,
-	0x2cf0, 0x0126, 0x2091, 0x2200, 0x00c6, 0x3e60, 0x6014, 0x2048,
-	0x2940, 0x903e, 0x2730, 0xa864, 0x2068, 0xa81a, 0x9d84, 0x000f,
-	0x9088, 0x1cf7, 0x2165, 0x0002, 0x1683, 0x16d0, 0x1683, 0x1683,
-	0x1683, 0x16b2, 0x1683, 0x1687, 0x167c, 0x16c7, 0x1683, 0x1683,
-	0x1683, 0x178c, 0x169b, 0x1691, 0xa964, 0x918c, 0x00ff, 0x918e,
-	0x0048, 0x0904, 0x16c7, 0x9085, 0x0001, 0x0804, 0x1783, 0xa87c,
-	0xd0bc, 0x0dc8, 0xa890, 0xa842, 0xa88c, 0xa83e, 0xa888, 0x0804,
-	0x16d7, 0xa87c, 0xd0bc, 0x0d78, 0xa890, 0xa842, 0xa88c, 0xa83e,
-	0xa888, 0x0804, 0x1726, 0xa87c, 0xd0bc, 0x0d28, 0xa890, 0xa842,
-	0xa88c, 0xa83e, 0xa804, 0x9045, 0x090c, 0x0d65, 0xa164, 0xa91a,
-	0x91ec, 0x000f, 0x9d80, 0x1cf7, 0x2065, 0xa888, 0xd19c, 0x1904,
-	0x1726, 0x0428, 0xa87c, 0xd0ac, 0x0970, 0xa804, 0x9045, 0x090c,
-	0x0d65, 0xa164, 0xa91a, 0x91ec, 0x000f, 0x9d80, 0x1cf7, 0x2065,
-	0x9006, 0xa842, 0xa83e, 0xd19c, 0x1904, 0x1726, 0x0080, 0xa87c,
-	0xd0ac, 0x0904, 0x1683, 0x9006, 0xa842, 0xa83e, 0x0804, 0x1726,
-	0xa87c, 0xd0ac, 0x0904, 0x1683, 0x9006, 0xa842, 0xa83e, 0x2c05,
-	0x908a, 0x0036, 0x1a0c, 0x0d65, 0x9082, 0x001b, 0x0002, 0x16fa,
-	0x16fa, 0x16fc, 0x16fa, 0x16fa, 0x16fa, 0x1702, 0x16fa, 0x16fa,
-	0x16fa, 0x1708, 0x16fa, 0x16fa, 0x16fa, 0x170e, 0x16fa, 0x16fa,
-	0x16fa, 0x1714, 0x16fa, 0x16fa, 0x16fa, 0x171a, 0x16fa, 0x16fa,
-	0x16fa, 0x1720, 0x080c, 0x0d65, 0xa574, 0xa478, 0xa37c, 0xa280,
-	0x0804, 0x176b, 0xa584, 0xa488, 0xa38c, 0xa290, 0x0804, 0x176b,
-	0xa594, 0xa498, 0xa39c, 0xa2a0, 0x0804, 0x176b, 0xa5a4, 0xa4a8,
-	0xa3ac, 0xa2b0, 0x0804, 0x176b, 0xa5b4, 0xa4b8, 0xa3bc, 0xa2c0,
-	0x0804, 0x176b, 0xa5c4, 0xa4c8, 0xa3cc, 0xa2d0, 0x0804, 0x176b,
-	0xa5d4, 0xa4d8, 0xa3dc, 0xa2e0, 0x0804, 0x176b, 0x2c05, 0x908a,
-	0x0034, 0x1a0c, 0x0d65, 0x9082, 0x001b, 0x0002, 0x1749, 0x1747,
-	0x1747, 0x1747, 0x1747, 0x1747, 0x1750, 0x1747, 0x1747, 0x1747,
-	0x1747, 0x1747, 0x1757, 0x1747, 0x1747, 0x1747, 0x1747, 0x1747,
-	0x175e, 0x1747, 0x1747, 0x1747, 0x1747, 0x1747, 0x1765, 0x080c,
-	0x0d65, 0xa56c, 0xa470, 0xa774, 0xa678, 0xa37c, 0xa280, 0x00d8,
-	0xa584, 0xa488, 0xa78c, 0xa690, 0xa394, 0xa298, 0x00a0, 0xa59c,
-	0xa4a0, 0xa7a4, 0xa6a8, 0xa3ac, 0xa2b0, 0x0068, 0xa5b4, 0xa4b8,
-	0xa7bc, 0xa6c0, 0xa3c4, 0xa2c8, 0x0030, 0xa5cc, 0xa4d0, 0xa7d4,
-	0xa6d8, 0xa3dc, 0xa2e0, 0xab2e, 0xaa32, 0xad1e, 0xac22, 0xaf26,
-	0xae2a, 0xa988, 0x8c60, 0x2c1d, 0xa8ac, 0xaab0, 0xa836, 0xaa3a,
-	0x8109, 0xa916, 0x1158, 0x3e60, 0x601c, 0xc085, 0x601e, 0xa87c,
-	0xc0dd, 0xa87e, 0x9006, 0x00ce, 0x012e, 0x0005, 0x2800, 0xa80e,
-	0xab0a, 0x2c00, 0xa812, 0x0c78, 0x0804, 0x1683, 0x0016, 0x2009,
-	0x00a0, 0x8109, 0xa001, 0xa001, 0xa001, 0x1dd8, 0x001e, 0x2ff0,
-	0x0126, 0x2091, 0x2200, 0x00c6, 0x3e60, 0x6014, 0x2048, 0x2940,
-	0xa80e, 0x2061, 0x1cf2, 0xa813, 0x1cf2, 0x2c05, 0xa80a, 0xa964,
-	0xa91a, 0xa87c, 0xd0ac, 0x090c, 0x0d65, 0x9006, 0xa842, 0xa83e,
-	0x2c05, 0x908a, 0x0034, 0x1a0c, 0x0d65, 0xadcc, 0xacd0, 0xafd4,
-	0xaed8, 0xabdc, 0xaae0, 0xab2e, 0xaa32, 0xad1e, 0xac22, 0xaf26,
-	0xae2a, 0xa8ac, 0xaab0, 0xa836, 0xaa3a, 0xa988, 0xa864, 0x9084,
-	0x00ff, 0x9086, 0x0008, 0x1120, 0x8109, 0xa916, 0x0128, 0x0078,
-	0x918a, 0x0002, 0xa916, 0x1158, 0x3e60, 0x601c, 0xc085, 0x601e,
-	0xa87c, 0xc0dd, 0xa87e, 0x9006, 0x00ce, 0x012e, 0x0005, 0xa804,
-	0x9045, 0x090c, 0x0d65, 0xa80e, 0xa064, 0xa81a, 0x9084, 0x000f,
-	0x9080, 0x1cf7, 0x2015, 0x82ff, 0x090c, 0x0d65, 0xaa12, 0x2205,
-	0xa80a, 0x0c10, 0x903e, 0x2730, 0xa880, 0xd0fc, 0x1190, 0x2d00,
-	0x0002, 0x18e7, 0x1849, 0x1849, 0x18e7, 0x18e7, 0x18e1, 0x18e7,
-	0x1849, 0x1898, 0x1898, 0x1898, 0x18e7, 0x18e7, 0x18e7, 0x18de,
-	0x1898, 0xc0fc, 0xa882, 0xab2c, 0xaa30, 0xad1c, 0xac20, 0xdd9c,
-	0x0904, 0x18e9, 0x2c05, 0x908a, 0x0034, 0x1a0c, 0x0d65, 0x9082,
-	0x001b, 0x0002, 0x1835, 0x1833, 0x1833, 0x1833, 0x1833, 0x1833,
-	0x1839, 0x1833, 0x1833, 0x1833, 0x1833, 0x1833, 0x183d, 0x1833,
-	0x1833, 0x1833, 0x1833, 0x1833, 0x1841, 0x1833, 0x1833, 0x1833,
-	0x1833, 0x1833, 0x1845, 0x080c, 0x0d65, 0xa774, 0xa678, 0x0804,
-	0x18e9, 0xa78c, 0xa690, 0x0804, 0x18e9, 0xa7a4, 0xa6a8, 0x0804,
-	0x18e9, 0xa7bc, 0xa6c0, 0x0804, 0x18e9, 0xa7d4, 0xa6d8, 0x0804,
-	0x18e9, 0x2c05, 0x908a, 0x0036, 0x1a0c, 0x0d65, 0x9082, 0x001b,
-	0x0002, 0x186c, 0x186c, 0x186e, 0x186c, 0x186c, 0x186c, 0x1874,
-	0x186c, 0x186c, 0x186c, 0x187a, 0x186c, 0x186c, 0x186c, 0x1880,
-	0x186c, 0x186c, 0x186c, 0x1886, 0x186c, 0x186c, 0x186c, 0x188c,
-	0x186c, 0x186c, 0x186c, 0x1892, 0x080c, 0x0d65, 0xa574, 0xa478,
-	0xa37c, 0xa280, 0x0804, 0x18e9, 0xa584, 0xa488, 0xa38c, 0xa290,
-	0x0804, 0x18e9, 0xa594, 0xa498, 0xa39c, 0xa2a0, 0x0804, 0x18e9,
-	0xa5a4, 0xa4a8, 0xa3ac, 0xa2b0, 0x0804, 0x18e9, 0xa5b4, 0xa4b8,
-	0xa3bc, 0xa2c0, 0x0804, 0x18e9, 0xa5c4, 0xa4c8, 0xa3cc, 0xa2d0,
-	0x0804, 0x18e9, 0xa5d4, 0xa4d8, 0xa3dc, 0xa2e0, 0x0804, 0x18e9,
-	0x2c05, 0x908a, 0x0034, 0x1a0c, 0x0d65, 0x9082, 0x001b, 0x0002,
-	0x18bb, 0x18b9, 0x18b9, 0x18b9, 0x18b9, 0x18b9, 0x18c2, 0x18b9,
-	0x18b9, 0x18b9, 0x18b9, 0x18b9, 0x18c9, 0x18b9, 0x18b9, 0x18b9,
-	0x18b9, 0x18b9, 0x18d0, 0x18b9, 0x18b9, 0x18b9, 0x18b9, 0x18b9,
-	0x18d7, 0x080c, 0x0d65, 0xa56c, 0xa470, 0xa774, 0xa678, 0xa37c,
-	0xa280, 0x0438, 0xa584, 0xa488, 0xa78c, 0xa690, 0xa394, 0xa298,
-	0x0400, 0xa59c, 0xa4a0, 0xa7a4, 0xa6a8, 0xa3ac, 0xa2b0, 0x00c8,
-	0xa5b4, 0xa4b8, 0xa7bc, 0xa6c0, 0xa3c4, 0xa2c8, 0x0090, 0xa5cc,
-	0xa4d0, 0xa7d4, 0xa6d8, 0xa3dc, 0xa2e0, 0x0058, 0x9d86, 0x000e,
-	0x1130, 0x080c, 0x1ccd, 0x1904, 0x17f2, 0x900e, 0x0050, 0x080c,
-	0x0d65, 0xab2e, 0xaa32, 0xad1e, 0xac22, 0xaf26, 0xae2a, 0x080c,
-	0x1ccd, 0x0005, 0x6014, 0x2048, 0x6118, 0x810c, 0x810c, 0x810c,
-	0x81ff, 0x1118, 0xa887, 0x0001, 0x0008, 0xa986, 0x601b, 0x0002,
-	0xa974, 0xd1dc, 0x1108, 0x0005, 0xa934, 0xa88c, 0x9106, 0x1158,
-	0xa938, 0xa890, 0x9106, 0x1138, 0x601c, 0xc084, 0x601e, 0x2009,
-	0x0048, 0x0804, 0x9c85, 0x0005, 0x0126, 0x00c6, 0x2091, 0x2200,
-	0x00ce, 0x7908, 0x918c, 0x0007, 0x9186, 0x0000, 0x05b0, 0x9186,
-	0x0003, 0x0598, 0x6020, 0x6023, 0x0000, 0x0006, 0x2031, 0x0008,
-	0x00c6, 0x781f, 0x0808, 0x7808, 0xd09c, 0x0120, 0x080c, 0x132a,
-	0x8631, 0x1db8, 0x00ce, 0x781f, 0x0800, 0x2031, 0x0168, 0x00c6,
-	0x7808, 0xd09c, 0x190c, 0x132a, 0x00ce, 0x2001, 0x0038, 0x080c,
-	0x19ec, 0x7930, 0x9186, 0x0040, 0x0160, 0x9186, 0x0042, 0x190c,
-	0x0d65, 0x2001, 0x001e, 0x8001, 0x1df0, 0x8631, 0x1d40, 0x080c,
-	0x19fb, 0x000e, 0x6022, 0x012e, 0x0005, 0x080c, 0x19e8, 0x7827,
-	0x0015, 0x7828, 0x9c06, 0x1db8, 0x782b, 0x0000, 0x0ca0, 0x00f6,
-	0x2079, 0x0300, 0x7803, 0x0000, 0x78ab, 0x0004, 0x00fe, 0x080c,
-	0x70b7, 0x11b0, 0x2001, 0x0138, 0x2003, 0x0000, 0x2001, 0x0160,
-	0x2003, 0x0000, 0x2011, 0x012c, 0xa001, 0xa001, 0x8211, 0x1de0,
-	0x0081, 0x2001, 0x0386, 0x2003, 0x2020, 0x080c, 0x7158, 0x0005,
-	0x0479, 0x0039, 0x2001, 0x0160, 0x2502, 0x2001, 0x0138, 0x2202,
-	0x0005, 0x00e6, 0x2071, 0x0200, 0x080c, 0x2825, 0x2009, 0x003c,
-	0x080c, 0x2052, 0x2001, 0x015d, 0x2003, 0x0000, 0x7000, 0x9084,
-	0x003c, 0x1de0, 0x080c, 0x8074, 0x70a0, 0x70a2, 0x7098, 0x709a,
-	0x709c, 0x709e, 0x2001, 0x020d, 0x2003, 0x0020, 0x00f6, 0x2079,
-	0x0300, 0x080c, 0x12ea, 0x7803, 0x0001, 0x00fe, 0x00ee, 0x0005,
-	0x2001, 0x0138, 0x2014, 0x2003, 0x0000, 0x2001, 0x0160, 0x202c,
-	0x2003, 0x0000, 0x080c, 0x70b7, 0x1108, 0x0005, 0x2021, 0x0260,
-	0x2001, 0x0141, 0x201c, 0xd3dc, 0x1168, 0x2001, 0x0109, 0x201c,
-	0x939c, 0x0048, 0x1160, 0x2001, 0x0111, 0x201c, 0x83ff, 0x1110,
-	0x8421, 0x1d70, 0x2001, 0x015d, 0x2003, 0x0000, 0x0005, 0x0046,
-	0x2021, 0x0019, 0x2003, 0x0048, 0xa001, 0xa001, 0x201c, 0x939c,
-	0x0048, 0x0120, 0x8421, 0x1db0, 0x004e, 0x0c60, 0x004e, 0x0c40,
-	0x601c, 0xc084, 0x601e, 0x0005, 0x2c08, 0x621c, 0x080c, 0x159e,
-	0x7930, 0x0005, 0x2c08, 0x621c, 0x080c, 0x15cb, 0x7930, 0x0005,
-	0x8001, 0x1df0, 0x0005, 0x2031, 0x0005, 0x781c, 0x9084, 0x0007,
-	0x0170, 0x2001, 0x0038, 0x0c41, 0x9186, 0x0040, 0x0904, 0x1a59,
-	0x2001, 0x001e, 0x0c69, 0x8631, 0x1d80, 0x080c, 0x0d65, 0x781f,
-	0x0202, 0x2001, 0x015d, 0x2003, 0x0000, 0x2001, 0x0b10, 0x0c01,
-	0x781c, 0xd084, 0x0110, 0x0861, 0x04e0, 0x2001, 0x0030, 0x0891,
-	0x9186, 0x0040, 0x0568, 0x781c, 0xd084, 0x1da8, 0x781f, 0x0101,
-	0x2001, 0x0014, 0x0869, 0x2001, 0x0037, 0x0821, 0x9186, 0x0040,
-	0x0140, 0x2001, 0x0030, 0x080c, 0x19f2, 0x9186, 0x0040, 0x190c,
-	0x0d65, 0x00d6, 0x2069, 0x0200, 0x692c, 0xd1f4, 0x1170, 0xd1c4,
-	0x0160, 0xd19c, 0x0130, 0x6800, 0x9085, 0x1800, 0x6802, 0x00de,
-	0x0080, 0x6908, 0x9184, 0x0007, 0x1db0, 0x00de, 0x781f, 0x0100,
-	0x791c, 0x9184, 0x0007, 0x090c, 0x0d65, 0xa001, 0xa001, 0x781f,
-	0x0200, 0x0005, 0x0126, 0x2091, 0x2400, 0x2079, 0x0380, 0x2001,
-	0x19b8, 0x2070, 0x012e, 0x0005, 0x2cf0, 0x0126, 0x2091, 0x2400,
-	0x3e60, 0x6014, 0x2048, 0xa964, 0xa91a, 0x918c, 0x00ff, 0x9184,
-	0x000f, 0x0002, 0x1a8e, 0x1a8e, 0x1a8e, 0x1a8e, 0x1a8e, 0x1a8e,
-	0x1a8e, 0x1a8e, 0x1a82, 0x1a90, 0x1a8e, 0x1a8e, 0x1a8e, 0x1a8e,
-	0x1a8e, 0x1a8e, 0x9086, 0x0008, 0x1148, 0xa87c, 0xd0b4, 0x0904,
-	0x1c00, 0x2011, 0x1cf2, 0x2205, 0xab88, 0x0068, 0x080c, 0x0d65,
-	0xa87c, 0xd0b4, 0x0904, 0x1c00, 0x9184, 0x000f, 0x9080, 0x1cf7,
-	0x2015, 0x2205, 0xab88, 0x2908, 0xa80a, 0xa90e, 0xaa12, 0xab16,
-	0x9006, 0xa842, 0xa83e, 0x012e, 0x0005, 0x2cf0, 0x0126, 0x2091,
-	0x2400, 0x3e60, 0x6014, 0x2048, 0xa88c, 0xa990, 0xaaac, 0xabb0,
-	0xaa36, 0xab3a, 0xa83e, 0xa942, 0xa846, 0xa94a, 0xa964, 0x918c,
-	0x00ff, 0x9186, 0x001e, 0x0198, 0x2940, 0xa064, 0xa81a, 0x90ec,
-	0x000f, 0x9d80, 0x1cf7, 0x2065, 0x2c05, 0x2808, 0x2c10, 0xab88,
-	0xa80a, 0xa90e, 0xaa12, 0xab16, 0x012e, 0x3e60, 0x0005, 0xa804,
-	0x2040, 0x0c58, 0x2cf0, 0x0126, 0x2091, 0x2400, 0x3e60, 0x6014,
-	0x2048, 0xa97c, 0x2950, 0xd1dc, 0x1904, 0x1bca, 0xc1dd, 0xa97e,
-	0x9006, 0xa842, 0xa83e, 0xa988, 0x8109, 0xa916, 0xa964, 0xa91a,
-	0x9184, 0x000f, 0x9088, 0x1cf7, 0x2145, 0x0002, 0x1afe, 0x1b0c,
-	0x1afe, 0x1afe, 0x1afe, 0x1b00, 0x1afe, 0x1afe, 0x1b61, 0x1b61,
-	0x1afe, 0x1afe, 0x1afe, 0x1b5f, 0x1afe, 0x1afe, 0x080c, 0x0d65,
-	0xa804, 0x2050, 0xb164, 0xa91a, 0x9184, 0x000f, 0x9080, 0x1cf7,
-	0x2045, 0xd19c, 0x1904, 0x1b61, 0x9036, 0x2638, 0x2805, 0x908a,
-	0x0036, 0x1a0c, 0x0d65, 0x9082, 0x001b, 0x0002, 0x1b31, 0x1b31,
-	0x1b33, 0x1b31, 0x1b31, 0x1b31, 0x1b39, 0x1b31, 0x1b31, 0x1b31,
-	0x1b3f, 0x1b31, 0x1b31, 0x1b31, 0x1b45, 0x1b31, 0x1b31, 0x1b31,
-	0x1b4b, 0x1b31, 0x1b31, 0x1b31, 0x1b51, 0x1b31, 0x1b31, 0x1b31,
-	0x1b57, 0x080c, 0x0d65, 0xb574, 0xb478, 0xb37c, 0xb280, 0x0804,
-	0x1ba6, 0xb584, 0xb488, 0xb38c, 0xb290, 0x0804, 0x1ba6, 0xb594,
-	0xb498, 0xb39c, 0xb2a0, 0x0804, 0x1ba6, 0xb5a4, 0xb4a8, 0xb3ac,
-	0xb2b0, 0x0804, 0x1ba6, 0xb5b4, 0xb4b8, 0xb3bc, 0xb2c0, 0x0804,
-	0x1ba6, 0xb5c4, 0xb4c8, 0xb3cc, 0xb2d0, 0x0804, 0x1ba6, 0xb5d4,
-	0xb4d8, 0xb3dc, 0xb2e0, 0x0804, 0x1ba6, 0x0804, 0x1ba6, 0x080c,
-	0x0d65, 0x2805, 0x908a, 0x0034, 0x1a0c, 0x0d65, 0x9082, 0x001b,
-	0x0002, 0x1b84, 0x1b82, 0x1b82, 0x1b82, 0x1b82, 0x1b82, 0x1b8b,
-	0x1b82, 0x1b82, 0x1b82, 0x1b82, 0x1b82, 0x1b92, 0x1b82, 0x1b82,
-	0x1b82, 0x1b82, 0x1b82, 0x1b99, 0x1b82, 0x1b82, 0x1b82, 0x1b82,
-	0x1b82, 0x1ba0, 0x080c, 0x0d65, 0xb56c, 0xb470, 0xb774, 0xb678,
-	0xb37c, 0xb280, 0x00d8, 0xb584, 0xb488, 0xb78c, 0xb690, 0xb394,
-	0xb298, 0x00a0, 0xb59c, 0xb4a0, 0xb7a4, 0xb6a8, 0xb3ac, 0xb2b0,
-	0x0068, 0xb5b4, 0xb4b8, 0xb7bc, 0xb6c0, 0xb3c4, 0xb2c8, 0x0030,
-	0xb5cc, 0xb4d0, 0xb7d4, 0xb6d8, 0xb3dc, 0xb2e0, 0xab2e, 0xaa32,
-	0xad1e, 0xac22, 0xaf26, 0xae2a, 0xa988, 0x8109, 0xa916, 0x1118,
-	0x9006, 0x012e, 0x0005, 0x8840, 0x2805, 0x9005, 0x1168, 0xb004,
-	0x9005, 0x090c, 0x0d65, 0x2050, 0xb164, 0xa91a, 0x9184, 0x000f,
-	0x9080, 0x1cf7, 0x2045, 0x2805, 0x2810, 0x2a08, 0xa80a, 0xa90e,
-	0xaa12, 0x0c30, 0x3e60, 0x6344, 0xd3fc, 0x190c, 0x0d65, 0xa93c,
-	0xaa40, 0xa844, 0x9106, 0x1118, 0xa848, 0x9206, 0x0508, 0x2958,
-	0xab48, 0xac44, 0x2940, 0x080c, 0x1d17, 0x1998, 0x2850, 0x2c40,
-	0xab14, 0xa880, 0xd0fc, 0x1140, 0xa810, 0x2005, 0xa80a, 0x2a00,
-	0xa80e, 0x2009, 0x8015, 0x0070, 0x00c6, 0x3e60, 0x6044, 0xc0a4,
-	0x9085, 0x8005, 0x6046, 0x00ce, 0x8319, 0xab16, 0x1904, 0x1bb3,
-	0x2009, 0x8005, 0x3e60, 0x6044, 0x9105, 0x6046, 0x0804, 0x1bb0,
-	0x080c, 0x0d65, 0x00f6, 0x00e6, 0x0096, 0x00c6, 0x0026, 0x704c,
-	0x9c06, 0x190c, 0x0d65, 0x2079, 0x0090, 0x2001, 0x0105, 0x2003,
-	0x0010, 0x782b, 0x0004, 0x7057, 0x0000, 0x6014, 0x2048, 0x080c,
-	0xb847, 0x0118, 0xa880, 0xc0bd, 0xa882, 0x6020, 0x9086, 0x0006,
-	0x1170, 0x2061, 0x0100, 0x62c8, 0x2001, 0x00fa, 0x8001, 0x1df0,
-	0x60c8, 0x9206, 0x1dc0, 0x60c4, 0xa89a, 0x60c8, 0xa896, 0x704c,
-	0x2060, 0x00c6, 0x080c, 0xb452, 0x080c, 0x98c8, 0x00ce, 0x704c,
-	0x9c06, 0x1150, 0x2009, 0x0040, 0x080c, 0x2052, 0x080c, 0x94b8,
-	0x2011, 0x0000, 0x080c, 0x9343, 0x002e, 0x00ce, 0x009e, 0x00ee,
-	0x00fe, 0x0005, 0x00f6, 0x2079, 0x0090, 0x781c, 0x0006, 0x7818,
-	0x0006, 0x2079, 0x0100, 0x7a14, 0x9284, 0x1984, 0x9085, 0x0012,
-	0x7816, 0x2019, 0x1000, 0x8319, 0x090c, 0x0d65, 0x7820, 0xd0bc,
-	0x1dd0, 0x79c8, 0x000e, 0x9102, 0x001e, 0x0006, 0x0016, 0x79c4,
-	0x000e, 0x9103, 0x78c6, 0x000e, 0x78ca, 0x9284, 0x1984, 0x9085,
-	0x0012, 0x7816, 0x2079, 0x0090, 0x782b, 0x0008, 0x7057, 0x0000,
-	0x00fe, 0x0005, 0x00f6, 0x00e6, 0x2071, 0x19b8, 0x7054, 0x9086,
-	0x0000, 0x0904, 0x1cc8, 0x2079, 0x0090, 0x2009, 0x0207, 0x210c,
-	0xd194, 0x01b8, 0x2009, 0x020c, 0x210c, 0x9184, 0x0003, 0x0188,
-	0x080c, 0xd61c, 0x2001, 0x0133, 0x2004, 0x9005, 0x090c, 0x0d65,
-	0x0016, 0x2009, 0x0040, 0x080c, 0x2052, 0x001e, 0x2001, 0x020c,
-	0x2102, 0x2009, 0x0206, 0x2104, 0x2009, 0x0203, 0x210c, 0x9106,
-	0x1120, 0x2009, 0x0040, 0x080c, 0x2052, 0x782c, 0xd0fc, 0x09a8,
-	0x080c, 0x98e4, 0x782c, 0xd0fc, 0x1de8, 0x080c, 0x98c8, 0x7054,
-	0x9086, 0x0000, 0x1950, 0x782b, 0x0004, 0x782c, 0xd0ac, 0x1de8,
-	0x2009, 0x0040, 0x080c, 0x2052, 0x782b, 0x0002, 0x7057, 0x0000,
-	0x00ee, 0x00fe, 0x0005, 0x080c, 0x0d65, 0x8c60, 0x2c05, 0x9005,
-	0x0110, 0x8a51, 0x0005, 0xa004, 0x9005, 0x0168, 0xa85a, 0x2040,
-	0xa064, 0x9084, 0x000f, 0x9080, 0x1cf7, 0x2065, 0x8cff, 0x090c,
-	0x0d65, 0x8a51, 0x0005, 0x2050, 0x0005, 0x0000, 0x001d, 0x0021,
-	0x0025, 0x0029, 0x002d, 0x0031, 0x0035, 0x0000, 0x001b, 0x0021,
-	0x0027, 0x002d, 0x0033, 0x0000, 0x0000, 0x0023, 0x0000, 0x0000,
-	0x1cea, 0x1ce6, 0x0000, 0x0000, 0x1cf4, 0x0000, 0x1cea, 0x1cf1,
-	0x1cf1, 0x1cee, 0x0000, 0x0000, 0x0000, 0x1cf4, 0x1cf1, 0x0000,
-	0x1cec, 0x1cec, 0x0000, 0x0000, 0x1cf4, 0x0000, 0x1cec, 0x1cf2,
-	0x1cf2, 0x1cf2, 0x0000, 0x0000, 0x0000, 0x1cf4, 0x1cf2, 0x00c6,
-	0x00d6, 0x0086, 0xab42, 0xac3e, 0xa888, 0x9055, 0x0904, 0x1ef6,
-	0x2940, 0xa064, 0x90ec, 0x000f, 0x9084, 0x00ff, 0x9086, 0x0008,
-	0x1118, 0x2061, 0x1cf2, 0x00d0, 0x9de0, 0x1cf7, 0x9d86, 0x0007,
-	0x0130, 0x9d86, 0x000e, 0x0118, 0x9d86, 0x000f, 0x1120, 0xa08c,
-	0x9422, 0xa090, 0x931b, 0x2c05, 0x9065, 0x1140, 0x0310, 0x0804,
-	0x1ef6, 0xa004, 0x9045, 0x0904, 0x1ef6, 0x08d8, 0x2c05, 0x9005,
-	0x0904, 0x1dde, 0xdd9c, 0x1904, 0x1d9a, 0x908a, 0x0036, 0x1a0c,
-	0x0d65, 0x9082, 0x001b, 0x0002, 0x1d6f, 0x1d6f, 0x1d71, 0x1d6f,
-	0x1d6f, 0x1d6f, 0x1d77, 0x1d6f, 0x1d6f, 0x1d6f, 0x1d7d, 0x1d6f,
-	0x1d6f, 0x1d6f, 0x1d83, 0x1d6f, 0x1d6f, 0x1d6f, 0x1d89, 0x1d6f,
-	0x1d6f, 0x1d6f, 0x1d8f, 0x1d6f, 0x1d6f, 0x1d6f, 0x1d95, 0x080c,
-	0x0d65, 0xa07c, 0x9422, 0xa080, 0x931b, 0x0804, 0x1dd4, 0xa08c,
-	0x9422, 0xa090, 0x931b, 0x0804, 0x1dd4, 0xa09c, 0x9422, 0xa0a0,
-	0x931b, 0x0804, 0x1dd4, 0xa0ac, 0x9422, 0xa0b0, 0x931b, 0x0804,
-	0x1dd4, 0xa0bc, 0x9422, 0xa0c0, 0x931b, 0x0804, 0x1dd4, 0xa0cc,
-	0x9422, 0xa0d0, 0x931b, 0x0804, 0x1dd4, 0xa0dc, 0x9422, 0xa0e0,
-	0x931b, 0x04d0, 0x908a, 0x0034, 0x1a0c, 0x0d65, 0x9082, 0x001b,
-	0x0002, 0x1dbc, 0x1dba, 0x1dba, 0x1dba, 0x1dba, 0x1dba, 0x1dc1,
-	0x1dba, 0x1dba, 0x1dba, 0x1dba, 0x1dba, 0x1dc6, 0x1dba, 0x1dba,
-	0x1dba, 0x1dba, 0x1dba, 0x1dcb, 0x1dba, 0x1dba, 0x1dba, 0x1dba,
-	0x1dba, 0x1dd0, 0x080c, 0x0d65, 0xa07c, 0x9422, 0xa080, 0x931b,
-	0x0098, 0xa094, 0x9422, 0xa098, 0x931b, 0x0070, 0xa0ac, 0x9422,
-	0xa0b0, 0x931b, 0x0048, 0xa0c4, 0x9422, 0xa0c8, 0x931b, 0x0020,
-	0xa0dc, 0x9422, 0xa0e0, 0x931b, 0x0630, 0x2300, 0x9405, 0x0160,
-	0x8a51, 0x0904, 0x1ef6, 0x8c60, 0x0804, 0x1d46, 0xa004, 0x9045,
-	0x0904, 0x1ef6, 0x0804, 0x1d21, 0x8a51, 0x0904, 0x1ef6, 0x8c60,
-	0x2c05, 0x9005, 0x1158, 0xa004, 0x9045, 0x0904, 0x1ef6, 0xa064,
-	0x90ec, 0x000f, 0x9de0, 0x1cf7, 0x2c05, 0x2060, 0xa880, 0xc0fc,
-	0xa882, 0x0804, 0x1eeb, 0x2c05, 0x8422, 0x8420, 0x831a, 0x9399,
-	0x0000, 0xac2e, 0xab32, 0xdd9c, 0x1904, 0x1e88, 0x9082, 0x001b,
-	0x0002, 0x1e24, 0x1e24, 0x1e26, 0x1e24, 0x1e24, 0x1e24, 0x1e34,
-	0x1e24, 0x1e24, 0x1e24, 0x1e42, 0x1e24, 0x1e24, 0x1e24, 0x1e50,
-	0x1e24, 0x1e24, 0x1e24, 0x1e5e, 0x1e24, 0x1e24, 0x1e24, 0x1e6c,
-	0x1e24, 0x1e24, 0x1e24, 0x1e7a, 0x080c, 0x0d65, 0xa17c, 0x2400,
-	0x9122, 0xa180, 0x2300, 0x911b, 0x0a0c, 0x0d65, 0xa074, 0x9420,
-	0xa078, 0x9319, 0x0804, 0x1ee6, 0xa18c, 0x2400, 0x9122, 0xa190,
-	0x2300, 0x911b, 0x0a0c, 0x0d65, 0xa084, 0x9420, 0xa088, 0x9319,
-	0x0804, 0x1ee6, 0xa19c, 0x2400, 0x9122, 0xa1a0, 0x2300, 0x911b,
-	0x0a0c, 0x0d65, 0xa094, 0x9420, 0xa098, 0x9319, 0x0804, 0x1ee6,
-	0xa1ac, 0x2400, 0x9122, 0xa1b0, 0x2300, 0x911b, 0x0a0c, 0x0d65,
-	0xa0a4, 0x9420, 0xa0a8, 0x9319, 0x0804, 0x1ee6, 0xa1bc, 0x2400,
-	0x9122, 0xa1c0, 0x2300, 0x911b, 0x0a0c, 0x0d65, 0xa0b4, 0x9420,
-	0xa0b8, 0x9319, 0x0804, 0x1ee6, 0xa1cc, 0x2400, 0x9122, 0xa1d0,
-	0x2300, 0x911b, 0x0a0c, 0x0d65, 0xa0c4, 0x9420, 0xa0c8, 0x9319,
-	0x0804, 0x1ee6, 0xa1dc, 0x2400, 0x9122, 0xa1e0, 0x2300, 0x911b,
-	0x0a0c, 0x0d65, 0xa0d4, 0x9420, 0xa0d8, 0x9319, 0x0804, 0x1ee6,
-	0x9082, 0x001b, 0x0002, 0x1ea6, 0x1ea4, 0x1ea4, 0x1ea4, 0x1ea4,
-	0x1ea4, 0x1eb3, 0x1ea4, 0x1ea4, 0x1ea4, 0x1ea4, 0x1ea4, 0x1ec0,
-	0x1ea4, 0x1ea4, 0x1ea4, 0x1ea4, 0x1ea4, 0x1ecd, 0x1ea4, 0x1ea4,
-	0x1ea4, 0x1ea4, 0x1ea4, 0x1eda, 0x080c, 0x0d65, 0xa17c, 0x2400,
-	0x9122, 0xa180, 0x2300, 0x911b, 0x0a0c, 0x0d65, 0xa06c, 0x9420,
-	0xa070, 0x9319, 0x0498, 0xa194, 0x2400, 0x9122, 0xa198, 0x2300,
-	0x911b, 0x0a0c, 0x0d65, 0xa084, 0x9420, 0xa088, 0x9319, 0x0430,
-	0xa1ac, 0x2400, 0x9122, 0xa1b0, 0x2300, 0x911b, 0x0a0c, 0x0d65,
-	0xa09c, 0x9420, 0xa0a0, 0x9319, 0x00c8, 0xa1c4, 0x2400, 0x9122,
-	0xa1c8, 0x2300, 0x911b, 0x0a0c, 0x0d65, 0xa0b4, 0x9420, 0xa0b8,
-	0x9319, 0x0060, 0xa1dc, 0x2400, 0x9122, 0xa1e0, 0x2300, 0x911b,
-	0x0a0c, 0x0d65, 0xa0cc, 0x9420, 0xa0d0, 0x9319, 0xac1e, 0xab22,
-	0xa880, 0xc0fd, 0xa882, 0x2800, 0xa85a, 0x2c00, 0xa812, 0x2a00,
-	0xa816, 0x000e, 0x000e, 0x000e, 0x9006, 0x0028, 0x008e, 0x00de,
-	0x00ce, 0x9085, 0x0001, 0x0005, 0x00c6, 0x610c, 0x0016, 0x9026,
-	0x2410, 0x6004, 0x9420, 0x9291, 0x0000, 0x2c04, 0x9210, 0x9ce0,
-	0x0002, 0x918a, 0x0002, 0x1da8, 0x9284, 0x000f, 0x9405, 0x001e,
-	0x00ce, 0x0005, 0x7803, 0x0003, 0x780f, 0x0000, 0x6004, 0x7812,
-	0x2c04, 0x7816, 0x9ce0, 0x0002, 0x918a, 0x0002, 0x1db8, 0x0005,
-	0x2001, 0x0005, 0x2004, 0xd0bc, 0x190c, 0x0d5e, 0xd094, 0x0110,
-	0x080c, 0x11c6, 0x0005, 0x0126, 0x2091, 0x2600, 0x2079, 0x0200,
-	0x2071, 0x0260, 0x2069, 0x1800, 0x7817, 0x0000, 0x789b, 0x0814,
-	0x78a3, 0x0406, 0x789f, 0x0410, 0x2009, 0x013b, 0x200b, 0x0400,
-	0x781b, 0x0002, 0x783b, 0x001f, 0x7837, 0x0020, 0x7803, 0x1600,
-	0x012e, 0x0005, 0x2091, 0x2600, 0x781c, 0xd0a4, 0x190c, 0x204f,
-	0x7900, 0xd1dc, 0x1118, 0x9084, 0x0006, 0x001a, 0x9084, 0x000e,
-	0x0002, 0x1f71, 0x1f69, 0x7a7a, 0x1f69, 0x1f6b, 0x1f6b, 0x1f6b,
-	0x1f6b, 0x7a60, 0x1f69, 0x1f6d, 0x1f69, 0x1f6b, 0x1f69, 0x1f6b,
-	0x1f69, 0x080c, 0x0d65, 0x0031, 0x0020, 0x080c, 0x7a60, 0x080c,
-	0x7a7a, 0x0005, 0x0006, 0x0016, 0x0026, 0x080c, 0xd61c, 0x7930,
-	0x9184, 0x0003, 0x01f0, 0x080c, 0x98c8, 0x2001, 0x19cb, 0x2004,
-	0x9005, 0x0180, 0x2001, 0x0133, 0x2004, 0x9005, 0x090c, 0x0d65,
-	0x00c6, 0x2001, 0x19cb, 0x2064, 0x080c, 0x98e4, 0x080c, 0xb452,
-	0x00ce, 0x0408, 0x2009, 0x0040, 0x080c, 0x2052, 0x080c, 0x98e4,
-	0x00d0, 0x9184, 0x0014, 0x01a0, 0x6a00, 0x9286, 0x0003, 0x0160,
-	0x080c, 0x70b7, 0x1138, 0x080c, 0x73b7, 0x080c, 0x5cdc, 0x080c,
-	0x6fe8, 0x0010, 0x080c, 0x5b97, 0x080c, 0x7b18, 0x0041, 0x0018,
-	0x9184, 0x9540, 0x1dc8, 0x002e, 0x001e, 0x000e, 0x0005, 0x00e6,
-	0x0036, 0x0046, 0x0056, 0x2071, 0x1a3c, 0x080c, 0x195f, 0x005e,
-	0x004e, 0x003e, 0x00ee, 0x0005, 0x0126, 0x2091, 0x2e00, 0x2071,
-	0x1800, 0x7128, 0x2001, 0x1940, 0x2102, 0x2001, 0x1948, 0x2102,
-	0x2001, 0x013b, 0x2102, 0x2079, 0x0200, 0x2001, 0x0201, 0x789e,
-	0x78a3, 0x0200, 0x9198, 0x0007, 0x831c, 0x831c, 0x831c, 0x9398,
-	0x0005, 0x2320, 0x9182, 0x0204, 0x1230, 0x2011, 0x0008, 0x8423,
-	0x8423, 0x8423, 0x0488, 0x9182, 0x024c, 0x1240, 0x2011, 0x0007,
-	0x8403, 0x8003, 0x9400, 0x9400, 0x9420, 0x0430, 0x9182, 0x02bc,
-	0x1238, 0x2011, 0x0006, 0x8403, 0x8003, 0x9400, 0x9420, 0x00e0,
-	0x9182, 0x034c, 0x1230, 0x2011, 0x0005, 0x8403, 0x8003, 0x9420,
-	0x0098, 0x9182, 0x042c, 0x1228, 0x2011, 0x0004, 0x8423, 0x8423,
-	0x0058, 0x9182, 0x059c, 0x1228, 0x2011, 0x0003, 0x8403, 0x9420,
-	0x0018, 0x2011, 0x0002, 0x8423, 0x9482, 0x0228, 0x8002, 0x8020,
-	0x8301, 0x9402, 0x0110, 0x0208, 0x8321, 0x8217, 0x8203, 0x9405,
-	0x789a, 0x012e, 0x0005, 0x0006, 0x00d6, 0x2069, 0x0200, 0x6814,
-	0x9084, 0xffc0, 0x910d, 0x6916, 0x00de, 0x000e, 0x0005, 0x00d6,
-	0x2069, 0x0200, 0x9005, 0x6810, 0x0110, 0xc0a5, 0x0008, 0xc0a4,
-	0x6812, 0x00de, 0x0005, 0x0006, 0x00d6, 0x2069, 0x0200, 0x6810,
-	0x9084, 0xfff8, 0x910d, 0x6912, 0x00de, 0x000e, 0x0005, 0x7938,
-	0x080c, 0x0d5e, 0x00f6, 0x2079, 0x0200, 0x7902, 0xa001, 0xa001,
-	0xa001, 0xa001, 0xa001, 0xa001, 0x7902, 0xa001, 0xa001, 0xa001,
-	0xa001, 0xa001, 0xa001, 0x00fe, 0x0005, 0x0126, 0x2091, 0x2800,
-	0x2061, 0x0100, 0x2071, 0x1800, 0x2009, 0x0000, 0x080c, 0x281f,
-	0x080c, 0x273f, 0x080c, 0x2890, 0x9006, 0x080c, 0x276e, 0x9006,
-	0x080c, 0x2751, 0x20a9, 0x0012, 0x1d04, 0x207c, 0x2091, 0x6000,
-	0x1f04, 0x207c, 0x602f, 0x0100, 0x602f, 0x0000, 0x6050, 0x9085,
-	0x0400, 0x9084, 0xdfff, 0x6052, 0x6224, 0x080c, 0x286d, 0x080c,
-	0x245d, 0x2009, 0x00ef, 0x6132, 0x6136, 0x080c, 0x246d, 0x60e7,
-	0x0000, 0x61ea, 0x60e3, 0x0002, 0x604b, 0xf7f7, 0x6043, 0x0000,
-	0x602f, 0x0080, 0x602f, 0x0000, 0x6007, 0x149f, 0x00c6, 0x2061,
-	0x0140, 0x608b, 0x000b, 0x608f, 0x10b8, 0x6093, 0x0000, 0x6097,
-	0x0198, 0x00ce, 0x6004, 0x9085, 0x8000, 0x6006, 0x60bb, 0x0000,
-	0x20a9, 0x0018, 0x60bf, 0x0000, 0x1f04, 0x20ba, 0x60bb, 0x0000,
-	0x60bf, 0x0108, 0x60bf, 0x0012, 0x60bf, 0x0320, 0x60bf, 0x0018,
-	0x601b, 0x00f0, 0x601f, 0x001e, 0x600f, 0x006b, 0x602b, 0x402c,
-	0x012e, 0x0005, 0x00f6, 0x2079, 0x0140, 0x78c3, 0x0080, 0x78c3,
-	0x0083, 0x78c3, 0x0000, 0x00fe, 0x0005, 0x2001, 0x1834, 0x2003,
-	0x0000, 0x2001, 0x1833, 0x2003, 0x0001, 0x0005, 0x0126, 0x2091,
-	0x2800, 0x0006, 0x0016, 0x0026, 0x6124, 0x6028, 0x910c, 0x9184,
-	0x5e2c, 0x1118, 0x9184, 0x0007, 0x002a, 0x9195, 0x0004, 0x9284,
-	0x0007, 0x0002, 0x2105, 0x2102, 0x2102, 0x2102, 0x2104, 0x2102,
-	0x2102, 0x2102, 0x080c, 0x0d65, 0x0029, 0x002e, 0x001e, 0x000e,
-	0x012e, 0x0005, 0x00a6, 0x6124, 0x6028, 0xd09c, 0x0118, 0xd19c,
-	0x1904, 0x2364, 0xd1f4, 0x190c, 0x0d5e, 0x080c, 0x70b7, 0x0904,
-	0x2162, 0x080c, 0xbf61, 0x1120, 0x7000, 0x9086, 0x0003, 0x0580,
-	0x6024, 0x9084, 0x1800, 0x0560, 0x080c, 0x70da, 0x0118, 0x080c,
-	0x70c8, 0x1530, 0x2011, 0x0020, 0x080c, 0x286d, 0x6043, 0x0000,
-	0x080c, 0xbf61, 0x0168, 0x080c, 0x70da, 0x1150, 0x2001, 0x1978,
-	0x2003, 0x0001, 0x6027, 0x1800, 0x080c, 0x6f2d, 0x0804, 0x2367,
-	0x70a0, 0x9005, 0x1150, 0x70a3, 0x0001, 0x00d6, 0x2069, 0x0140,
-	0x080c, 0x710e, 0x00de, 0x1904, 0x2367, 0x080c, 0x73c1, 0x0428,
-	0x080c, 0x70da, 0x1590, 0x6024, 0x9084, 0x1800, 0x1108, 0x0468,
-	0x080c, 0x73c1, 0x080c, 0x73b7, 0x080c, 0x5cdc, 0x080c, 0x6fe8,
-	0x0804, 0x2364, 0xd1ac, 0x1508, 0x6024, 0xd0dc, 0x1170, 0xd0e4,
-	0x1178, 0xd0d4, 0x1190, 0xd0cc, 0x0130, 0x7094, 0x9086, 0x0028,
-	0x1110, 0x080c, 0x729a, 0x0804, 0x2364, 0x080c, 0x73bc, 0x0048,
-	0x2001, 0x194e, 0x2003, 0x0002, 0x0020, 0x080c, 0x71f8, 0x0804,
-	0x2364, 0x080c, 0x733c, 0x0804, 0x2364, 0xd1ac, 0x0904, 0x227e,
-	0x080c, 0x70b7, 0x11d0, 0x2011, 0x0020, 0x080c, 0x286d, 0x0006,
-	0x0026, 0x0036, 0x080c, 0x70d1, 0x1158, 0x080c, 0x73b7, 0x080c,
-	0x5cdc, 0x080c, 0x6fe8, 0x003e, 0x002e, 0x000e, 0x00ae, 0x0005,
-	0x003e, 0x002e, 0x000e, 0x080c, 0x708b, 0x0016, 0x0046, 0x00c6,
-	0x644c, 0x9486, 0xf0f0, 0x1138, 0x2061, 0x0100, 0x644a, 0x6043,
-	0x0090, 0x6043, 0x0010, 0x74d6, 0x948c, 0xff00, 0x7038, 0xd084,
-	0x0178, 0x9186, 0xf800, 0x1160, 0x7044, 0xd084, 0x1148, 0xc085,
-	0x7046, 0x0036, 0x2418, 0x2011, 0x8016, 0x080c, 0x48d8, 0x003e,
-	0x080c, 0xbf5a, 0x1904, 0x2255, 0x9196, 0xff00, 0x05a8, 0x705c,
-	0x9084, 0x00ff, 0x810f, 0x81ff, 0x0110, 0x9116, 0x0568, 0x7130,
-	0xd184, 0x1550, 0x080c, 0x3186, 0x0128, 0xc18d, 0x7132, 0x080c,
-	0x665f, 0x1510, 0x6240, 0x9294, 0x0010, 0x0130, 0x6248, 0x9294,
-	0xff00, 0x9296, 0xff00, 0x01c0, 0x7030, 0xd08c, 0x0904, 0x2255,
-	0x7038, 0xd08c, 0x1140, 0x2001, 0x180c, 0x200c, 0xd1ac, 0x1904,
-	0x2255, 0xc1ad, 0x2102, 0x0036, 0x73d4, 0x2011, 0x8013, 0x080c,
-	0x48d8, 0x003e, 0x0804, 0x2255, 0x7038, 0xd08c, 0x1140, 0x2001,
-	0x180c, 0x200c, 0xd1ac, 0x1904, 0x2255, 0xc1ad, 0x2102, 0x0036,
-	0x73d4, 0x2011, 0x8013, 0x080c, 0x48d8, 0x003e, 0x7130, 0xc185,
-	0x7132, 0x2011, 0x1854, 0x220c, 0x00f0, 0x0016, 0x2009, 0x0001,
-	0x2011, 0x0100, 0x080c, 0x83eb, 0x2019, 0x000e, 0x00c6, 0x2061,
-	0x0000, 0x080c, 0xd1eb, 0x00ce, 0x9484, 0x00ff, 0x9080, 0x318b,
-	0x200d, 0x918c, 0xff00, 0x810f, 0x2120, 0x9006, 0x2009, 0x000e,
-	0x080c, 0xd273, 0x001e, 0xd1ac, 0x1148, 0x0016, 0x2009, 0x0002,
-	0x2019, 0x0004, 0x080c, 0x2fc5, 0x001e, 0x0078, 0x0156, 0x00b6,
-	0x20a9, 0x007f, 0x900e, 0x080c, 0x6270, 0x1110, 0x080c, 0x5cf6,
-	0x8108, 0x1f04, 0x224b, 0x00be, 0x015e, 0x00ce, 0x004e, 0x080c,
-	0x98c8, 0x080c, 0x9b6d, 0x080c, 0x98e4, 0x60e3, 0x0000, 0x001e,
-	0x2001, 0x1800, 0x2014, 0x9296, 0x0004, 0x1170, 0xd19c, 0x11b0,
-	0x2011, 0x180c, 0x2214, 0xd29c, 0x1120, 0x6204, 0x9295, 0x0002,
-	0x6206, 0x6228, 0xc29d, 0x622a, 0x2003, 0x0001, 0x2001, 0x1825,
-	0x2003, 0x0000, 0x2011, 0x0020, 0x080c, 0x286d, 0xd194, 0x0904,
-	0x2364, 0x0016, 0x080c, 0x98c8, 0x6220, 0xd2b4, 0x0904, 0x230c,
-	0x080c, 0x820b, 0x080c, 0x8fb7, 0x2011, 0x0004, 0x080c, 0x286d,
-	0x00f6, 0x2019, 0x19c4, 0x2304, 0x907d, 0x0904, 0x22d9, 0x7804,
-	0x9086, 0x0032, 0x15f0, 0x00d6, 0x00c6, 0x00e6, 0x0096, 0x2069,
-	0x0140, 0x782c, 0x685e, 0x7808, 0x685a, 0x6043, 0x0002, 0x2001,
-	0x0003, 0x8001, 0x1df0, 0x6043, 0x0000, 0x2001, 0x003c, 0x8001,
-	0x1df0, 0x080c, 0x2843, 0x2001, 0x001e, 0x8001, 0x0240, 0x20a9,
-	0x0009, 0x080c, 0x27fa, 0x6904, 0xd1dc, 0x1140, 0x0cb0, 0x2001,
-	0x0100, 0x080c, 0x2833, 0x9006, 0x080c, 0x2833, 0x080c, 0x8874,
-	0x080c, 0x98e4, 0x7814, 0x2048, 0xa867, 0x0103, 0x2f60, 0x080c,
-	0x9be7, 0x009e, 0x00ee, 0x00ce, 0x00de, 0x00fe, 0x001e, 0x00ae,
-	0x0005, 0x00fe, 0x00d6, 0x2069, 0x0140, 0x6804, 0x9084, 0x4000,
-	0x0110, 0x080c, 0x2843, 0x00de, 0x00c6, 0x2061, 0x19b8, 0x6034,
-	0x080c, 0xbf61, 0x0120, 0x909a, 0x0003, 0x1258, 0x0018, 0x909a,
-	0x00c8, 0x1238, 0x8000, 0x6036, 0x00ce, 0x080c, 0x8f8f, 0x0804,
-	0x2361, 0x2061, 0x0100, 0x62c0, 0x080c, 0x97fe, 0x2019, 0x19c4,
-	0x2304, 0x9065, 0x0130, 0x6003, 0x0001, 0x2009, 0x0027, 0x080c,
-	0x9c85, 0x00ce, 0x0804, 0x2361, 0xd2bc, 0x05e0, 0x080c, 0x8218,
-	0x2011, 0x0004, 0x080c, 0x286d, 0x00d6, 0x2069, 0x0140, 0x6804,
-	0x9084, 0x4000, 0x0110, 0x080c, 0x2843, 0x00de, 0x00c6, 0x2061,
-	0x19b8, 0x6050, 0x080c, 0xbf61, 0x0120, 0x909a, 0x0003, 0x1638,
-	0x0018, 0x909a, 0x00c8, 0x1618, 0x8000, 0x6052, 0x604c, 0x00ce,
-	0x9005, 0x0578, 0x2009, 0x07d0, 0x080c, 0x8210, 0x9080, 0x0008,
-	0x2004, 0x9086, 0x0006, 0x1138, 0x2009, 0x1984, 0x2011, 0x0012,
-	0x080c, 0x287c, 0x00f0, 0x2009, 0x1984, 0x2011, 0x0016, 0x080c,
-	0x287c, 0x00b8, 0x2011, 0x0004, 0x080c, 0x286d, 0x0090, 0x0036,
-	0x2019, 0x0001, 0x080c, 0x9286, 0x003e, 0x2019, 0x19cb, 0x2304,
-	0x9065, 0x0130, 0x2009, 0x004f, 0x6003, 0x0003, 0x080c, 0x9c85,
-	0x00ce, 0x080c, 0x98e4, 0x001e, 0xd19c, 0x0904, 0x23c2, 0x7038,
-	0xd0ac, 0x1538, 0x0016, 0x0156, 0x2011, 0x0008, 0x080c, 0x286d,
-	0x6050, 0xc0e5, 0x6052, 0x20a9, 0x0367, 0x1f04, 0x238f, 0x1d04,
-	0x2377, 0x080c, 0x823f, 0x6020, 0xd09c, 0x1db8, 0x00f6, 0x2079,
-	0x0100, 0x080c, 0x27aa, 0x00fe, 0x1d80, 0x6050, 0xc0e4, 0x6052,
-	0x2011, 0x0008, 0x080c, 0x286d, 0x015e, 0x001e, 0x0498, 0x015e,
-	0x001e, 0x0016, 0x6028, 0xc09c, 0x602a, 0x080c, 0x98c8, 0x080c,
-	0x9b6d, 0x080c, 0x98e4, 0x60e3, 0x0000, 0x080c, 0xd5fb, 0x080c,
-	0xd616, 0x080c, 0x5391, 0xd0fc, 0x1138, 0x080c, 0xbf5a, 0x1120,
-	0x9085, 0x0001, 0x080c, 0x70fe, 0x9006, 0x080c, 0x2833, 0x2009,
-	0x0002, 0x080c, 0x281f, 0x00e6, 0x2071, 0x1800, 0x7003, 0x0004,
-	0x080c, 0x0e9c, 0x00ee, 0x2011, 0x0008, 0x080c, 0x286d, 0x080c,
-	0x0bab, 0x001e, 0x918c, 0xffd0, 0x2110, 0x080c, 0x286d, 0x00ae,
-	0x0005, 0x0006, 0x0016, 0x0026, 0x0036, 0x00e6, 0x00f6, 0x0126,
-	0x2091, 0x8000, 0x2071, 0x1800, 0x71cc, 0x70ce, 0x9116, 0x0904,
-	0x241c, 0x81ff, 0x01a0, 0x2009, 0x0000, 0x080c, 0x281f, 0x2011,
-	0x8011, 0x2019, 0x010e, 0x231c, 0x939e, 0x0007, 0x1118, 0x2019,
-	0x0001, 0x0010, 0x2019, 0x0000, 0x080c, 0x48d8, 0x0468, 0x2001,
-	0x1979, 0x200c, 0x81ff, 0x1140, 0x2001, 0x0109, 0x2004, 0xd0b4,
-	0x0118, 0x2019, 0x0003, 0x0008, 0x2118, 0x2011, 0x8012, 0x080c,
-	0x48d8, 0x080c, 0x0e9c, 0x080c, 0x5391, 0xd0fc, 0x11a8, 0x080c,
-	0xbf5a, 0x1190, 0x00c6, 0x080c, 0x24b8, 0x080c, 0x98c8, 0x080c,
-	0x91e1, 0x080c, 0x98e4, 0x2061, 0x0100, 0x2019, 0x0028, 0x2009,
-	0x0002, 0x080c, 0x2fc5, 0x00ce, 0x012e, 0x00fe, 0x00ee, 0x003e,
-	0x002e, 0x001e, 0x000e, 0x0005, 0x2028, 0x918c, 0x00ff, 0x2130,
-	0x9094, 0xff00, 0x11f0, 0x2011, 0x1836, 0x2214, 0xd2ac, 0x11c8,
-	0x81ff, 0x01e8, 0x2011, 0x181e, 0x2204, 0x9106, 0x1190, 0x2011,
-	0x181f, 0x2214, 0x9294, 0xff00, 0x9584, 0xff00, 0x9206, 0x1148,
-	0x2011, 0x181f, 0x2214, 0x9294, 0x00ff, 0x9584, 0x00ff, 0x9206,
-	0x1120, 0x2500, 0x080c, 0x7d70, 0x0048, 0x9584, 0x00ff, 0x9080,
-	0x318b, 0x200d, 0x918c, 0xff00, 0x810f, 0x9006, 0x0005, 0x9080,
-	0x318b, 0x200d, 0x918c, 0x00ff, 0x0005, 0x00d6, 0x2069, 0x0140,
-	0x2001, 0x1817, 0x2003, 0x00ef, 0x20a9, 0x0010, 0x9006, 0x6852,
-	0x6856, 0x1f04, 0x2468, 0x00de, 0x0005, 0x0006, 0x00d6, 0x0026,
-	0x2069, 0x0140, 0x2001, 0x1817, 0x2102, 0x8114, 0x8214, 0x8214,
-	0x8214, 0x20a9, 0x0010, 0x6853, 0x0000, 0x9006, 0x82ff, 0x1128,
-	0x9184, 0x000f, 0x9080, 0xd62a, 0x2005, 0x6856, 0x8211, 0x1f04,
-	0x247d, 0x002e, 0x00de, 0x000e, 0x0005, 0x00c6, 0x2061, 0x1800,
-	0x6030, 0x0110, 0xc09d, 0x0008, 0xc09c, 0x6032, 0x00ce, 0x0005,
-	0x0156, 0x00d6, 0x0026, 0x0016, 0x0006, 0x2069, 0x0140, 0x6980,
-	0x9116, 0x0180, 0x9112, 0x1230, 0x8212, 0x8210, 0x22a8, 0x2001,
-	0x0402, 0x0018, 0x22a8, 0x2001, 0x0404, 0x680e, 0x1f04, 0x24ad,
-	0x680f, 0x0000, 0x000e, 0x001e, 0x002e, 0x00de, 0x015e, 0x0005,
-	0x080c, 0x538d, 0xd0c4, 0x0150, 0xd0a4, 0x0140, 0x9006, 0x0046,
-	0x2020, 0x2009, 0x002e, 0x080c, 0xd273, 0x004e, 0x0005, 0x00f6,
-	0x0016, 0x0026, 0x2079, 0x0140, 0x78c4, 0xd0dc, 0x0904, 0x2524,
-	0x080c, 0x279a, 0x0660, 0x9084, 0x0700, 0x908e, 0x0600, 0x1120,
-	0x2011, 0x4000, 0x900e, 0x0458, 0x908e, 0x0500, 0x1120, 0x2011,
-	0x8000, 0x900e, 0x0420, 0x908e, 0x0400, 0x1120, 0x9016, 0x2009,
-	0x0001, 0x00e8, 0x908e, 0x0300, 0x1120, 0x9016, 0x2009, 0x0002,
-	0x00b0, 0x908e, 0x0200, 0x1120, 0x9016, 0x2009, 0x0004, 0x0078,
-	0x908e, 0x0100, 0x1548, 0x9016, 0x2009, 0x0008, 0x0040, 0x9084,
-	0x0700, 0x908e, 0x0300, 0x1500, 0x2011, 0x0030, 0x0058, 0x2300,
-	0x9080, 0x0020, 0x2018, 0x080c, 0x8419, 0x928c, 0xff00, 0x0110,
-	0x2011, 0x00ff, 0x2200, 0x8007, 0x9085, 0x004c, 0x78c2, 0x2009,
-	0x0138, 0x220a, 0x080c, 0x70b7, 0x1118, 0x2009, 0x193e, 0x220a,
-	0x002e, 0x001e, 0x00fe, 0x0005, 0x78c3, 0x0000, 0x0cc8, 0x0126,
-	0x2091, 0x2800, 0x0006, 0x0016, 0x0026, 0x2001, 0x0170, 0x200c,
-	0x8000, 0x2014, 0x9184, 0x0003, 0x0110, 0x080c, 0x0d5e, 0x002e,
-	0x001e, 0x000e, 0x012e, 0x0005, 0x2001, 0x0171, 0x2004, 0xd0dc,
-	0x0168, 0x2001, 0x0170, 0x200c, 0x918c, 0x00ff, 0x918e, 0x004c,
-	0x1128, 0x200c, 0x918c, 0xff00, 0x810f, 0x0005, 0x900e, 0x2001,
-	0x0227, 0x2004, 0x8007, 0x9084, 0x00ff, 0x8004, 0x9108, 0x2001,
-	0x0226, 0x2004, 0x8007, 0x9084, 0x00ff, 0x8004, 0x9108, 0x0005,
-	0x0018, 0x000c, 0x0018, 0x0020, 0x1000, 0x0800, 0x1000, 0x1800,
-	0x0156, 0x0006, 0x0016, 0x0026, 0x00e6, 0x2001, 0x1961, 0x2004,
-	0x908a, 0x0007, 0x1a0c, 0x0d65, 0x0033, 0x00ee, 0x002e, 0x001e,
-	0x000e, 0x015e, 0x0005, 0x2582, 0x25a0, 0x25c4, 0x25c6, 0x25ef,
-	0x25f1, 0x25f3, 0x2001, 0x0001, 0x080c, 0x23c9, 0x080c, 0x27e4,
-	0x2001, 0x1963, 0x2003, 0x0000, 0x7828, 0x9084, 0xe1d7, 0x782a,
-	0x9006, 0x20a9, 0x0009, 0x080c, 0x27b6, 0x2001, 0x1961, 0x2003,
-	0x0006, 0x2009, 0x001e, 0x2011, 0x25f4, 0x080c, 0x821d, 0x0005,
-	0x2009, 0x1966, 0x200b, 0x0000, 0x2001, 0x196b, 0x2003, 0x0036,
-	0x2001, 0x196a, 0x2003, 0x002a, 0x2001, 0x1963, 0x2003, 0x0001,
-	0x9006, 0x080c, 0x2751, 0x2001, 0xffff, 0x20a9, 0x0009, 0x080c,
-	0x27b6, 0x2001, 0x1961, 0x2003, 0x0006, 0x2009, 0x001e, 0x2011,
-	0x25f4, 0x080c, 0x821d, 0x0005, 0x080c, 0x0d65, 0x2001, 0x196b,
-	0x2003, 0x0036, 0x2001, 0x1963, 0x2003, 0x0003, 0x7a38, 0x9294,
-	0x0005, 0x9296, 0x0004, 0x0110, 0x9006, 0x0010, 0x2001, 0x0001,
-	0x080c, 0x2751, 0x2001, 0x1967, 0x2003, 0x0000, 0x2001, 0xffff,
-	0x20a9, 0x0009, 0x080c, 0x27b6, 0x2001, 0x1961, 0x2003, 0x0006,
-	0x2009, 0x001e, 0x2011, 0x25f4, 0x080c, 0x821d, 0x0005, 0x080c,
-	0x0d65, 0x080c, 0x0d65, 0x0005, 0x0006, 0x0016, 0x0026, 0x00e6,
-	0x00f6, 0x0156, 0x0126, 0x2091, 0x8000, 0x2079, 0x0100, 0x2001,
-	0x1963, 0x2004, 0x908a, 0x0007, 0x1a0c, 0x0d65, 0x0043, 0x012e,
-	0x015e, 0x00fe, 0x00ee, 0x002e, 0x001e, 0x000e, 0x0005, 0x2616,
-	0x2636, 0x2676, 0x26a6, 0x26ca, 0x26da, 0x26dc, 0x080c, 0x27aa,
-	0x11b0, 0x7850, 0x9084, 0xefff, 0x7852, 0x2009, 0x1969, 0x2104,
-	0x7a38, 0x9294, 0x0005, 0x9296, 0x0004, 0x0110, 0xc08d, 0x0008,
-	0xc085, 0x200a, 0x2001, 0x1961, 0x2003, 0x0001, 0x0030, 0x080c,
-	0x2700, 0x2001, 0xffff, 0x080c, 0x2591, 0x0005, 0x080c, 0x26de,
-	0x05e0, 0x2009, 0x196a, 0x2104, 0x8001, 0x200a, 0x080c, 0x27aa,
-	0x1178, 0x7850, 0x9084, 0xefff, 0x7852, 0x7a38, 0x9294, 0x0005,
-	0x9296, 0x0005, 0x0518, 0x2009, 0x1969, 0x2104, 0xc085, 0x200a,
-	0x2009, 0x1966, 0x2104, 0x8000, 0x200a, 0x9086, 0x0005, 0x0118,
-	0x080c, 0x26e6, 0x00c0, 0x200b, 0x0000, 0x7a38, 0x9294, 0x0006,
-	0x9296, 0x0004, 0x0110, 0x9006, 0x0010, 0x2001, 0x0001, 0x080c,
-	0x276e, 0x2001, 0x1963, 0x2003, 0x0002, 0x0028, 0x2001, 0x1961,
-	0x2003, 0x0003, 0x0010, 0x080c, 0x25b3, 0x0005, 0x080c, 0x26de,
-	0x0560, 0x2009, 0x196a, 0x2104, 0x8001, 0x200a, 0x080c, 0x27aa,
-	0x1168, 0x7850, 0x9084, 0xefff, 0x7852, 0x2001, 0x1961, 0x2003,
-	0x0003, 0x2001, 0x1962, 0x2003, 0x0000, 0x00b8, 0x2009, 0x196a,
-	0x2104, 0x9005, 0x1118, 0x080c, 0x2723, 0x0010, 0x080c, 0x26f3,
-	0x080c, 0x26e6, 0x2009, 0x1966, 0x200b, 0x0000, 0x2001, 0x1963,
-	0x2003, 0x0001, 0x080c, 0x25b3, 0x0000, 0x0005, 0x04b9, 0x0508,
-	0x080c, 0x27aa, 0x11b8, 0x7850, 0x9084, 0xefff, 0x7852, 0x2009,
-	0x1967, 0x2104, 0x8000, 0x200a, 0x9086, 0x0007, 0x0108, 0x0078,
-	0x2001, 0x196c, 0x2003, 0x000a, 0x2009, 0x1969, 0x2104, 0xc0fd,
-	0x200a, 0x0038, 0x0419, 0x2001, 0x1963, 0x2003, 0x0004, 0x080c,
-	0x25de, 0x0005, 0x0099, 0x0168, 0x080c, 0x27aa, 0x1138, 0x7850,
-	0x9084, 0xefff, 0x7852, 0x080c, 0x25ca, 0x0018, 0x0079, 0x080c,
-	0x25de, 0x0005, 0x080c, 0x0d65, 0x080c, 0x0d65, 0x2009, 0x196b,
-	0x2104, 0x8001, 0x200a, 0x090c, 0x273f, 0x0005, 0x7a38, 0x9294,
-	0x0005, 0x9296, 0x0005, 0x0110, 0x9006, 0x0010, 0x2001, 0x0001,
-	0x080c, 0x276e, 0x0005, 0x7a38, 0x9294, 0x0006, 0x9296, 0x0006,
-	0x0110, 0x9006, 0x0010, 0x2001, 0x0001, 0x080c, 0x2751, 0x0005,
-	0x2009, 0x1966, 0x2104, 0x8000, 0x200a, 0x9086, 0x0005, 0x0108,
-	0x0068, 0x200b, 0x0000, 0x7a38, 0x9294, 0x0006, 0x9296, 0x0006,
-	0x0110, 0x9006, 0x0010, 0x2001, 0x0001, 0x04d9, 0x7a38, 0x9294,
-	0x0005, 0x9296, 0x0005, 0x0110, 0x9006, 0x0010, 0x2001, 0x0001,
-	0x080c, 0x276e, 0x0005, 0x0086, 0x2001, 0x1969, 0x2004, 0x9084,
-	0x7fff, 0x090c, 0x0d65, 0x2009, 0x1968, 0x2144, 0x8846, 0x280a,
-	0x9844, 0x0dd8, 0xd08c, 0x1120, 0xd084, 0x1120, 0x080c, 0x0d65,
-	0x9006, 0x0010, 0x2001, 0x0001, 0x00a1, 0x008e, 0x0005, 0x0006,
-	0x0156, 0x2001, 0x1961, 0x20a9, 0x0009, 0x2003, 0x0000, 0x8000,
-	0x1f04, 0x2745, 0x2001, 0x1968, 0x2003, 0x8000, 0x015e, 0x000e,
-	0x0005, 0x00f6, 0x2079, 0x0100, 0x9085, 0x0000, 0x0158, 0x7838,
-	0x9084, 0xfff9, 0x9085, 0x0004, 0x783a, 0x2009, 0x196e, 0x210c,
-	0x795a, 0x0050, 0x7838, 0x9084, 0xfffb, 0x9085, 0x0006, 0x783a,
-	0x2009, 0x196f, 0x210c, 0x795a, 0x00fe, 0x0005, 0x00f6, 0x2079,
-	0x0100, 0x9085, 0x0000, 0x0158, 0x7838, 0x9084, 0xfffa, 0x9085,
-	0x0004, 0x783a, 0x7850, 0x9084, 0xfff0, 0x7852, 0x00c8, 0x7838,
-	0x9084, 0xfffb, 0x9085, 0x0005, 0x783a, 0x7850, 0x9084, 0xfff0,
-	0x0016, 0x2009, 0x0003, 0x210c, 0x918c, 0x0600, 0x918e, 0x0400,
-	0x0118, 0x9085, 0x000a, 0x0010, 0x9085, 0x0000, 0x001e, 0x7852,
-	0x00fe, 0x0005, 0x0006, 0x2001, 0x0100, 0x2004, 0x9082, 0x0007,
-	0x000e, 0x0005, 0x0006, 0x2001, 0x0100, 0x2004, 0x9082, 0x0009,
-	0x000e, 0x0005, 0x0156, 0x20a9, 0x0064, 0x7820, 0x080c, 0x2819,
-	0xd09c, 0x1110, 0x1f04, 0x27ad, 0x015e, 0x0005, 0x0126, 0x0016,
-	0x0006, 0x2091, 0x8000, 0x000e, 0x2008, 0x9186, 0x0000, 0x1118,
-	0x783b, 0x0007, 0x0090, 0x9186, 0x0001, 0x1118, 0x783b, 0x0006,
-	0x0060, 0x9186, 0x0002, 0x1118, 0x783b, 0x0005, 0x0030, 0x9186,
-	0x0003, 0x1118, 0x783b, 0x0004, 0x0000, 0x0006, 0x1d04, 0x27d6,
-	0x080c, 0x823f, 0x1f04, 0x27d6, 0x7850, 0x9085, 0x1000, 0x7852,
-	0x000e, 0x001e, 0x012e, 0x0005, 0x080c, 0x28d4, 0x0005, 0x0006,
-	0x0156, 0x00f6, 0x2079, 0x0100, 0x20a9, 0x000a, 0x7854, 0xd0ac,
-	0x1100, 0x7854, 0xd08c, 0x1110, 0x1f04, 0x27f1, 0x00fe, 0x015e,
-	0x000e, 0x0005, 0x1d04, 0x27fa, 0x080c, 0x823f, 0x1f04, 0x27fa,
-	0x0005, 0x0006, 0x2001, 0x196d, 0x2004, 0x9086, 0x0000, 0x000e,
-	0x0005, 0x0006, 0x2001, 0x196d, 0x2004, 0x9086, 0x0001, 0x000e,
-	0x0005, 0x0006, 0x2001, 0x196d, 0x2004, 0x9086, 0x0002, 0x000e,
-	0x0005, 0xa001, 0xa001, 0xa001, 0xa001, 0xa001, 0x0005, 0x0006,
-	0x2001, 0x1979, 0x2102, 0x000e, 0x0005, 0x2009, 0x0171, 0x2104,
-	0xd0dc, 0x0140, 0x2009, 0x0170, 0x2104, 0x200b, 0x0080, 0xa001,
-	0xa001, 0x200a, 0x0005, 0x0016, 0x0026, 0x080c, 0x70d1, 0x0108,
-	0xc0bc, 0x2009, 0x0140, 0x2114, 0x9294, 0x0001, 0x9215, 0x220a,
-	0x002e, 0x001e, 0x0005, 0x0016, 0x0026, 0x2009, 0x0140, 0x2114,
-	0x9294, 0x0001, 0x9285, 0x1000, 0x200a, 0x220a, 0x002e, 0x001e,
-	0x0005, 0x0016, 0x0026, 0x2009, 0x0140, 0x2114, 0x9294, 0x0001,
-	0x9215, 0x220a, 0x002e, 0x001e, 0x0005, 0x0006, 0x0016, 0x2009,
-	0x0140, 0x2104, 0x1128, 0x080c, 0x70d1, 0x0110, 0xc0bc, 0x0008,
-	0xc0bd, 0x200a, 0x001e, 0x000e, 0x0005, 0x00f6, 0x2079, 0x0380,
-	0x7843, 0x0101, 0x7844, 0xd084, 0x1de8, 0x2001, 0x0109, 0x2202,
-	0x7843, 0x0100, 0x00fe, 0x0005, 0x00f6, 0x2079, 0x0380, 0x7843,
-	0x0202, 0x7844, 0xd08c, 0x1de8, 0x2079, 0x0100, 0x7814, 0x9104,
-	0x9205, 0x7a16, 0x2079, 0x0380, 0x7843, 0x0200, 0x00fe, 0x0005,
-	0x0016, 0x0026, 0x0036, 0x00c6, 0x2061, 0x0100, 0x6050, 0x9084,
-	0xfbff, 0x9085, 0x0040, 0x6052, 0x20a9, 0x0002, 0x080c, 0x27fa,
-	0x6050, 0x9085, 0x0400, 0x9084, 0xff9f, 0x6052, 0x20a9, 0x0005,
-	0x080c, 0x27fa, 0x6054, 0xd0bc, 0x090c, 0x0d65, 0x20a9, 0x0005,
-	0x080c, 0x27fa, 0x6054, 0xd0ac, 0x090c, 0x0d65, 0x2009, 0x1980,
-	0x9084, 0x7e00, 0x8007, 0x8004, 0x8004, 0x200a, 0x9085, 0x0000,
-	0x605a, 0x2009, 0x196e, 0x2011, 0x196f, 0x6358, 0x939c, 0x38df,
-	0x2320, 0x939d, 0x0000, 0x94a5, 0x0000, 0x230a, 0x2412, 0x00ce,
-	0x003e, 0x002e, 0x001e, 0x0005, 0x0006, 0x00c6, 0x2061, 0x0100,
-	0x6050, 0xc0cd, 0x6052, 0x00ce, 0x000e, 0x0005, 0x2dda, 0x2dda,
-	0x29de, 0x29de, 0x29ea, 0x29ea, 0x29f6, 0x29f6, 0x2a04, 0x2a04,
-	0x2a10, 0x2a10, 0x2a1e, 0x2a1e, 0x2a2c, 0x2a2c, 0x2a3e, 0x2a3e,
-	0x2a4a, 0x2a4a, 0x2a58, 0x2a58, 0x2a76, 0x2a76, 0x2a96, 0x2a96,
-	0x2a66, 0x2a66, 0x2a86, 0x2a86, 0x2aa4, 0x2aa4, 0x2a3c, 0x2a3c,
-	0x2a3c, 0x2a3c, 0x2a3c, 0x2a3c, 0x2a3c, 0x2a3c, 0x2a3c, 0x2a3c,
-	0x2a3c, 0x2a3c, 0x2a3c, 0x2a3c, 0x2a3c, 0x2a3c, 0x2a3c, 0x2a3c,
-	0x2a3c, 0x2a3c, 0x2a3c, 0x2a3c, 0x2a3c, 0x2a3c, 0x2a3c, 0x2a3c,
-	0x2a3c, 0x2a3c, 0x2a3c, 0x2a3c, 0x2a3c, 0x2a3c, 0x2ab6, 0x2ab6,
-	0x2ac2, 0x2ac2, 0x2ad0, 0x2ad0, 0x2ade, 0x2ade, 0x2aee, 0x2aee,
-	0x2afc, 0x2afc, 0x2b0c, 0x2b0c, 0x2b1c, 0x2b1c, 0x2b2e, 0x2b2e,
-	0x2b3c, 0x2b3c, 0x2b4c, 0x2b4c, 0x2b6e, 0x2b6e, 0x2b92, 0x2b92,
-	0x2b5c, 0x2b5c, 0x2b80, 0x2b80, 0x2ba2, 0x2ba2, 0x2a3c, 0x2a3c,
-	0x2a3c, 0x2a3c, 0x2a3c, 0x2a3c, 0x2a3c, 0x2a3c, 0x2a3c, 0x2a3c,
-	0x2a3c, 0x2a3c, 0x2a3c, 0x2a3c, 0x2a3c, 0x2a3c, 0x2a3c, 0x2a3c,
-	0x2a3c, 0x2a3c, 0x2a3c, 0x2a3c, 0x2a3c, 0x2a3c, 0x2a3c, 0x2a3c,
-	0x2a3c, 0x2a3c, 0x2a3c, 0x2a3c, 0x2a3c, 0x2a3c, 0x2bb6, 0x2bb6,
-	0x2bc2, 0x2bc2, 0x2bd0, 0x2bd0, 0x2bde, 0x2bde, 0x2bee, 0x2bee,
-	0x2bfc, 0x2bfc, 0x2c0c, 0x2c0c, 0x2c1c, 0x2c1c, 0x2c2e, 0x2c2e,
-	0x2c3c, 0x2c3c, 0x2c4c, 0x2c4c, 0x2c5c, 0x2c5c, 0x2c6e, 0x2c6e,
-	0x2c7e, 0x2c7e, 0x2c90, 0x2c90, 0x2ca2, 0x2ca2, 0x2a3c, 0x2a3c,
-	0x2a3c, 0x2a3c, 0x2a3c, 0x2a3c, 0x2a3c, 0x2a3c, 0x2a3c, 0x2a3c,
-	0x2a3c, 0x2a3c, 0x2a3c, 0x2a3c, 0x2a3c, 0x2a3c, 0x2a3c, 0x2a3c,
-	0x2a3c, 0x2a3c, 0x2a3c, 0x2a3c, 0x2a3c, 0x2a3c, 0x2a3c, 0x2a3c,
-	0x2a3c, 0x2a3c, 0x2a3c, 0x2a3c, 0x2a3c, 0x2a3c, 0x2cb6, 0x2cb6,
-	0x2cc4, 0x2cc4, 0x2cd4, 0x2cd4, 0x2ce4, 0x2ce4, 0x2cf6, 0x2cf6,
-	0x2d06, 0x2d06, 0x2d18, 0x2d18, 0x2d2a, 0x2d2a, 0x2d3e, 0x2d3e,
-	0x2d4e, 0x2d4e, 0x2d60, 0x2d60, 0x2d72, 0x2d72, 0x2d86, 0x2d86,
-	0x2d97, 0x2d97, 0x2daa, 0x2daa, 0x2dbd, 0x2dbd, 0x2a3c, 0x2a3c,
-	0x2a3c, 0x2a3c, 0x2a3c, 0x2a3c, 0x2a3c, 0x2a3c, 0x2a3c, 0x2a3c,
-	0x2a3c, 0x2a3c, 0x2a3c, 0x2a3c, 0x2a3c, 0x2a3c, 0x2a3c, 0x2a3c,
-	0x2a3c, 0x2a3c, 0x2a3c, 0x2a3c, 0x2a3c, 0x2a3c, 0x2a3c, 0x2a3c,
-	0x2a3c, 0x2a3c, 0x2a3c, 0x2a3c, 0x2a3c, 0x2a3c, 0x0106, 0x0006,
-	0x0126, 0x01c6, 0x01d6, 0x0136, 0x0146, 0x0156, 0x080c, 0x20e6,
-	0x0804, 0x2dd2, 0x0106, 0x0006, 0x0126, 0x01c6, 0x01d6, 0x0136,
-	0x0146, 0x0156, 0x080c, 0x1f20, 0x0804, 0x2dd2, 0x0106, 0x0006,
-	0x0126, 0x01c6, 0x01d6, 0x0136, 0x0146, 0x0156, 0x080c, 0x1f20,
-	0x080c, 0x20e6, 0x0804, 0x2dd2, 0x0106, 0x0006, 0x0126, 0x01c6,
-	0x01d6, 0x0136, 0x0146, 0x0156, 0x080c, 0x1f4a, 0x0804, 0x2dd2,
+	0x2071, 0x0080, 0x9006, 0x702b, 0x0060, 0x20a9, 0x0040, 0x7022,
+	0x1f04, 0x1107, 0x702b, 0x0060, 0x702b, 0x0020, 0x20a9, 0x0040,
+	0x7022, 0x1f04, 0x1110, 0x702b, 0x0020, 0x00ee, 0x0005, 0x0126,
+	0x2091, 0x8000, 0x00e6, 0xa06f, 0x0000, 0x2071, 0x19f1, 0x701c,
+	0x9088, 0x19fb, 0x280a, 0x8000, 0x9084, 0x003f, 0x701e, 0x7120,
+	0x9106, 0x090c, 0x0d65, 0x7004, 0x9005, 0x1128, 0x00f6, 0x2079,
+	0x0080, 0x00a9, 0x00fe, 0x00ee, 0x012e, 0x0005, 0x0126, 0x2091,
+	0x8000, 0x00e6, 0x2071, 0x19f1, 0x7004, 0x9005, 0x1128, 0x00f6,
+	0x2079, 0x0080, 0x0021, 0x00fe, 0x00ee, 0x012e, 0x0005, 0x7004,
+	0x9086, 0x0000, 0x1110, 0x7007, 0x0006, 0x7000, 0x0002, 0x1159,
+	0x1157, 0x1157, 0x1157, 0x12d0, 0x12d0, 0x12d0, 0x12d0, 0x080c,
+	0x0d65, 0x701c, 0x7120, 0x9106, 0x1148, 0x792c, 0x9184, 0x0001,
+	0x1120, 0xd1fc, 0x1110, 0x7007, 0x0000, 0x0005, 0x0096, 0x9180,
+	0x19fb, 0x2004, 0x700a, 0x2048, 0x8108, 0x918c, 0x003f, 0x7122,
+	0x782b, 0x0026, 0xa88c, 0x7802, 0xa890, 0x7806, 0xa894, 0x780a,
+	0xa898, 0x780e, 0xa878, 0x700e, 0xa870, 0x7016, 0xa874, 0x701a,
+	0xa868, 0x009e, 0xd084, 0x0120, 0x7007, 0x0001, 0x0029, 0x0005,
+	0x7007, 0x0002, 0x00b1, 0x0005, 0x0016, 0x0026, 0x710c, 0x2011,
+	0x0040, 0x9182, 0x0040, 0x1210, 0x2110, 0x9006, 0x700e, 0x7212,
+	0x8203, 0x7812, 0x782b, 0x0020, 0x782b, 0x0041, 0x002e, 0x001e,
+	0x0005, 0x0016, 0x0026, 0x0136, 0x0146, 0x0156, 0x7014, 0x20e0,
+	0x7018, 0x2098, 0x20e9, 0x0000, 0x20a1, 0x0088, 0x782b, 0x0026,
+	0x710c, 0x2011, 0x0040, 0x9182, 0x0040, 0x1210, 0x2110, 0x9006,
+	0x700e, 0x22a8, 0x4006, 0x8203, 0x7812, 0x782b, 0x0020, 0x3300,
+	0x701a, 0x782b, 0x0001, 0x015e, 0x014e, 0x013e, 0x002e, 0x001e,
+	0x0005, 0x2009, 0x19f1, 0x2104, 0xc095, 0x200a, 0x080c, 0x1136,
+	0x0005, 0x0016, 0x00e6, 0x2071, 0x19f1, 0x00f6, 0x2079, 0x0080,
+	0x792c, 0xd1bc, 0x190c, 0x0d5e, 0x782b, 0x0002, 0xd1fc, 0x0120,
+	0x918c, 0x0700, 0x7004, 0x0023, 0x00fe, 0x00ee, 0x001e, 0x0005,
+	0x1147, 0x11ef, 0x1223, 0x0d65, 0x0d65, 0x12dc, 0x0d65, 0x918c,
+	0x0700, 0x1550, 0x0136, 0x0146, 0x0156, 0x7014, 0x20e8, 0x7018,
+	0x20a0, 0x20e1, 0x0000, 0x2099, 0x0088, 0x782b, 0x0040, 0x7010,
+	0x20a8, 0x4005, 0x3400, 0x701a, 0x015e, 0x014e, 0x013e, 0x700c,
+	0x9005, 0x0578, 0x7800, 0x7802, 0x7804, 0x7806, 0x080c, 0x118c,
+	0x0005, 0x7008, 0x0096, 0x2048, 0xa86f, 0x0100, 0x009e, 0x7007,
+	0x0000, 0x080c, 0x1147, 0x0005, 0x7008, 0x0096, 0x2048, 0xa86f,
+	0x0200, 0x009e, 0x0ca0, 0x918c, 0x0700, 0x1150, 0x700c, 0x9005,
+	0x0180, 0x7800, 0x7802, 0x7804, 0x7806, 0x080c, 0x11a1, 0x0005,
+	0x7008, 0x0096, 0x2048, 0xa86f, 0x0200, 0x009e, 0x7007, 0x0000,
+	0x0080, 0x0096, 0x7008, 0x2048, 0x7800, 0xa88e, 0x7804, 0xa892,
+	0x7808, 0xa896, 0x780c, 0xa89a, 0xa86f, 0x0100, 0x009e, 0x7007,
+	0x0000, 0x0096, 0x00d6, 0x7008, 0x2048, 0x2001, 0x18af, 0x2004,
+	0x9906, 0x1128, 0xa89c, 0x080f, 0x00de, 0x009e, 0x00a0, 0x00de,
+	0x009e, 0x0096, 0x00d6, 0x7008, 0x2048, 0x0081, 0x0150, 0xa89c,
+	0x0086, 0x2940, 0x080f, 0x008e, 0x00de, 0x009e, 0x080c, 0x1136,
+	0x0005, 0x00de, 0x009e, 0x080c, 0x1136, 0x0005, 0xa8a8, 0xd08c,
+	0x0005, 0x0096, 0xa0a0, 0x904d, 0x090c, 0x0d65, 0xa06c, 0x908e,
+	0x0100, 0x0130, 0xa87b, 0x0030, 0xa883, 0x0000, 0xa897, 0x4002,
+	0x080c, 0x6985, 0xa09f, 0x0000, 0xa0a3, 0x0000, 0x2848, 0x080c,
+	0x1054, 0x009e, 0x0005, 0x00a6, 0xa0a0, 0x904d, 0x090c, 0x0d65,
+	0xa06c, 0x908e, 0x0100, 0x0128, 0xa87b, 0x0001, 0xa883, 0x0000,
+	0x00c0, 0xa80c, 0x2050, 0xb004, 0x9005, 0x0198, 0xa80e, 0x2050,
+	0x8006, 0x8006, 0x8007, 0x908c, 0x003f, 0x9084, 0xffc0, 0x9080,
+	0x0002, 0xa076, 0xa172, 0xb000, 0xa07a, 0x2810, 0x080c, 0x1117,
+	0x00e8, 0xa97c, 0xa894, 0x0016, 0x0006, 0x080c, 0x6985, 0x000e,
+	0x001e, 0xd1fc, 0x1138, 0xd1f4, 0x0128, 0x00c6, 0x2060, 0x080c,
+	0x9bda, 0x00ce, 0x7008, 0x2048, 0xa89f, 0x0000, 0xa8a3, 0x0000,
+	0x080c, 0x1054, 0x7007, 0x0000, 0x080c, 0x1136, 0x00ae, 0x0005,
+	0x0126, 0x2091, 0x8000, 0x782b, 0x1001, 0x7007, 0x0005, 0x7000,
+	0xc094, 0x7002, 0x012e, 0x0005, 0x7007, 0x0000, 0x080c, 0x1147,
+	0x0005, 0x0126, 0x2091, 0x2200, 0x2079, 0x0300, 0x2071, 0x1a3b,
+	0x7003, 0x0000, 0x78bf, 0x00f6, 0x0041, 0x7807, 0x0007, 0x7803,
+	0x0000, 0x7803, 0x0001, 0x012e, 0x0005, 0x00c6, 0x7803, 0x0000,
+	0x2001, 0x0165, 0x2003, 0x4198, 0x7808, 0xd09c, 0x0110, 0x7820,
+	0x0cd8, 0x2001, 0x1a3c, 0x2003, 0x0000, 0x78ab, 0x0004, 0x78ac,
+	0xd0ac, 0x1de8, 0x78ab, 0x0002, 0x7807, 0x0007, 0x7827, 0x0030,
+	0x782b, 0x0400, 0x7827, 0x0031, 0x782b, 0x1a49, 0x781f, 0xff00,
+	0x781b, 0xff00, 0x2001, 0x0200, 0x2004, 0xd0dc, 0x0110, 0x781f,
+	0x0303, 0x2061, 0x1a49, 0x602f, 0x1ddc, 0x2001, 0x1819, 0x2004,
+	0x9082, 0x1ddc, 0x6032, 0x603b, 0x1d04, 0x602b, 0x1a89, 0x6007,
+	0x1a69, 0x2061, 0x1a69, 0x00ce, 0x0005, 0x0126, 0x2091, 0x2200,
+	0x7908, 0x9184, 0x0070, 0x190c, 0x0d5e, 0xd19c, 0x05a0, 0x7820,
+	0x908c, 0xf000, 0x0540, 0x2060, 0x6020, 0x9086, 0x0003, 0x1550,
+	0x6000, 0x9086, 0x0004, 0x1530, 0x6114, 0x2148, 0xa876, 0xa87a,
+	0xa867, 0x0103, 0x080c, 0x67a7, 0x00b6, 0x6010, 0x2058, 0xba3c,
+	0x8211, 0x0208, 0xba3e, 0xb8c0, 0x9005, 0x190c, 0x6396, 0x00be,
+	0x6044, 0xd0fc, 0x190c, 0x98e4, 0x080c, 0x9c02, 0x7808, 0xd09c,
+	0x19b0, 0x012e, 0x0005, 0x908a, 0x0024, 0x1a0c, 0x0d65, 0x002b,
+	0x012e, 0x0005, 0x04b0, 0x012e, 0x0005, 0x1399, 0x13bf, 0x13ef,
+	0x13f4, 0x13f8, 0x13fd, 0x1425, 0x1429, 0x1437, 0x143b, 0x1399,
+	0x14c7, 0x14cb, 0x152e, 0x1399, 0x1399, 0x1399, 0x1399, 0x1399,
+	0x1399, 0x1399, 0x1399, 0x1399, 0x1399, 0x1399, 0x1399, 0x1399,
+	0x13ff, 0x1399, 0x13c7, 0x13ec, 0x13b3, 0x1399, 0x13d3, 0x139d,
+	0x139b, 0x080c, 0x0d65, 0x080c, 0x0d5e, 0x080c, 0x1535, 0x2009,
+	0x1a48, 0x2104, 0x8000, 0x200a, 0x080c, 0x7b01, 0x080c, 0x196c,
+	0x0005, 0x6044, 0xd0fc, 0x190c, 0x98e4, 0x2009, 0x0055, 0x080c,
+	0x9c76, 0x012e, 0x0005, 0x080c, 0x1535, 0x2060, 0x6044, 0xd0fc,
+	0x190c, 0x98e4, 0x2009, 0x0055, 0x080c, 0x9c76, 0x0005, 0x2009,
+	0x0048, 0x080c, 0x1535, 0x2060, 0x080c, 0x9c76, 0x0005, 0x2009,
+	0x0054, 0x080c, 0x1535, 0x2060, 0x6044, 0xd0fc, 0x190c, 0x98e4,
+	0x080c, 0x9c76, 0x0005, 0x080c, 0x1535, 0x2060, 0x0056, 0x0066,
+	0x080c, 0x1535, 0x2028, 0x080c, 0x1535, 0x2030, 0x0036, 0x0046,
+	0x2021, 0x0000, 0x2418, 0x2009, 0x0056, 0x080c, 0x9c76, 0x004e,
+	0x003e, 0x006e, 0x005e, 0x0005, 0x080c, 0x1535, 0x0005, 0x7004,
+	0xc085, 0xc0b5, 0x7006, 0x0005, 0x7004, 0xc085, 0x7006, 0x0005,
+	0x080c, 0x1535, 0x080c, 0x15f2, 0x0005, 0x080c, 0x0d65, 0x080c,
+	0x1535, 0x2060, 0x6014, 0x0096, 0x2048, 0xa83b, 0xffff, 0x009e,
+	0x2009, 0x0048, 0x080c, 0x9c76, 0x2001, 0x015d, 0x2003, 0x0000,
+	0x2009, 0x03e8, 0x8109, 0x0160, 0x2001, 0x0201, 0x2004, 0x9005,
+	0x0dc8, 0x2001, 0x0218, 0x2004, 0xd0ec, 0x1110, 0x080c, 0x153a,
+	0x2001, 0x0307, 0x2003, 0x8000, 0x0005, 0x7004, 0xc095, 0x7006,
+	0x0005, 0x080c, 0x1535, 0x2060, 0x6014, 0x0096, 0x2048, 0xa83b,
+	0xffff, 0x009e, 0x2009, 0x0048, 0x080c, 0x9c76, 0x0005, 0x080c,
+	0x1535, 0x080c, 0x0d65, 0x080c, 0x1535, 0x080c, 0x14b2, 0x7827,
+	0x0018, 0x79ac, 0xd1dc, 0x0540, 0x7827, 0x0015, 0x7828, 0x782b,
+	0x0000, 0x9065, 0x0138, 0x2001, 0x020d, 0x2003, 0x0050, 0x2003,
+	0x0020, 0x0400, 0x7004, 0x9005, 0x1180, 0x78ab, 0x0004, 0x7827,
+	0x0018, 0x782b, 0x0000, 0xd1bc, 0x090c, 0x0d65, 0x2001, 0x020d,
+	0x2003, 0x0050, 0x2003, 0x0020, 0x0490, 0x78ab, 0x0004, 0x7803,
+	0x0001, 0x080c, 0x14cb, 0x0005, 0x7828, 0x782b, 0x0000, 0x9065,
+	0x090c, 0x0d65, 0x6014, 0x2048, 0x78ab, 0x0004, 0x918c, 0x0700,
+	0x01a8, 0x080c, 0x7b01, 0x080c, 0x196c, 0x080c, 0xb842, 0x0158,
+	0xa9ac, 0xa936, 0xa9b0, 0xa93a, 0xa83f, 0xffff, 0xa843, 0xffff,
+	0xa880, 0xc0bd, 0xa882, 0x080c, 0xb440, 0x0005, 0x6010, 0x00b6,
+	0x2058, 0xb800, 0x00be, 0xd0bc, 0x6024, 0x190c, 0xbc43, 0x2029,
+	0x00c8, 0x8529, 0x0128, 0x2001, 0x0201, 0x2004, 0x9005, 0x0dc8,
+	0x7dbc, 0x080c, 0xd5e4, 0xd5a4, 0x1118, 0x080c, 0x153a, 0x0005,
+	0x080c, 0x7b01, 0x080c, 0x196c, 0x0005, 0x781f, 0x0300, 0x7803,
+	0x0001, 0x0005, 0x0016, 0x0066, 0x0076, 0x00f6, 0x2079, 0x0300,
+	0x7908, 0x918c, 0x0007, 0x9186, 0x0003, 0x0120, 0x2001, 0x0016,
+	0x080c, 0x15ab, 0x00fe, 0x007e, 0x006e, 0x001e, 0x0005, 0x7004,
+	0xc09d, 0x7006, 0x0005, 0x7104, 0x9184, 0x0004, 0x190c, 0x0d65,
+	0xd184, 0x1189, 0xd19c, 0x0158, 0xc19c, 0x7106, 0x2001, 0x020d,
+	0x2003, 0x0050, 0x2003, 0x0020, 0x080c, 0x153a, 0x0005, 0x81ff,
+	0x190c, 0x0d65, 0x0005, 0xc184, 0xd1b4, 0xc1b4, 0x7106, 0x0016,
+	0x00e6, 0x15e0, 0x2071, 0x0200, 0x080c, 0x15e6, 0x6014, 0x9005,
+	0x05a8, 0x0096, 0x2048, 0xa864, 0x009e, 0x9084, 0x00ff, 0x908e,
+	0x0029, 0x0160, 0x908e, 0x0048, 0x1548, 0x601c, 0xd084, 0x11d8,
+	0x00f6, 0x2c78, 0x080c, 0x165c, 0x00fe, 0x00a8, 0x00f6, 0x2c78,
+	0x080c, 0x17a4, 0x00fe, 0x2009, 0x01f4, 0x8109, 0x0160, 0x2001,
+	0x0201, 0x2004, 0x9005, 0x0dc8, 0x2001, 0x0218, 0x2004, 0xd0ec,
+	0x1110, 0x0401, 0x0040, 0x2001, 0x020d, 0x2003, 0x0020, 0x080c,
+	0x12f5, 0x7803, 0x0001, 0x00ee, 0x001e, 0x0005, 0x2001, 0x020d,
+	0x2003, 0x0050, 0x2003, 0x0020, 0x0069, 0x0ca8, 0x0031, 0x2060,
+	0x2009, 0x0053, 0x080c, 0x9c76, 0x0005, 0x7808, 0xd09c, 0x0de8,
+	0x7820, 0x0005, 0x080c, 0x14b2, 0x00d6, 0x2069, 0x0200, 0x2009,
+	0x01f4, 0x8109, 0x0510, 0x6804, 0x9005, 0x0dd8, 0x2001, 0x015d,
+	0x2003, 0x0000, 0x79bc, 0xd1a4, 0x1528, 0x79b8, 0x918c, 0x0fff,
+	0x0180, 0x9182, 0x0841, 0x1268, 0x9188, 0x0007, 0x918c, 0x0ff8,
+	0x810c, 0x810c, 0x810c, 0x080c, 0x159d, 0x6827, 0x0001, 0x8109,
+	0x1dd0, 0x04d9, 0x6827, 0x0002, 0x04c1, 0x6804, 0x9005, 0x1130,
+	0x682c, 0xd0e4, 0x1500, 0x6804, 0x9005, 0x0de8, 0x79b8, 0xd1ec,
+	0x1130, 0x08c0, 0x080c, 0x7b01, 0x080c, 0x196c, 0x0090, 0x7827,
+	0x0015, 0x782b, 0x0000, 0x7827, 0x0018, 0x782b, 0x0000, 0x2001,
+	0x020d, 0x2003, 0x0020, 0x2001, 0x0307, 0x2003, 0x0300, 0x7803,
+	0x0001, 0x00de, 0x0005, 0x682c, 0x9084, 0x5400, 0x9086, 0x5400,
+	0x0d30, 0x7827, 0x0015, 0x782b, 0x0000, 0x7803, 0x0001, 0x6800,
+	0x9085, 0x1800, 0x6802, 0x00de, 0x0005, 0x6824, 0x9084, 0x0003,
+	0x1de0, 0x0005, 0x2001, 0x0030, 0x2c08, 0x621c, 0x0021, 0x7830,
+	0x9086, 0x0041, 0x0005, 0x00f6, 0x2079, 0x0300, 0x0006, 0x7808,
+	0xd09c, 0x0140, 0x0016, 0x0026, 0x00c6, 0x080c, 0x1335, 0x00ce,
+	0x002e, 0x001e, 0x000e, 0x0006, 0x7832, 0x7936, 0x7a3a, 0x781b,
+	0x8080, 0x0059, 0x1118, 0x000e, 0x00fe, 0x0005, 0x000e, 0x792c,
+	0x3900, 0x8000, 0x2004, 0x080c, 0x0d65, 0x2009, 0xff00, 0x8109,
+	0x0120, 0x7818, 0xd0bc, 0x1dd8, 0x0005, 0x9085, 0x0001, 0x0005,
+	0x7832, 0x7936, 0x7a3a, 0x781b, 0x8080, 0x0c79, 0x1108, 0x0005,
+	0x792c, 0x3900, 0x8000, 0x2004, 0x080c, 0x0d65, 0x7037, 0x0001,
+	0x7150, 0x7037, 0x0002, 0x7050, 0x2060, 0xd1bc, 0x1110, 0x7054,
+	0x2060, 0x0005, 0x00e6, 0x0016, 0x2071, 0x0200, 0x0c79, 0x6124,
+	0xd1dc, 0x01f8, 0x701c, 0xd08c, 0x0904, 0x1651, 0x7017, 0x0000,
+	0x2001, 0x0264, 0x2004, 0xd0bc, 0x0904, 0x1651, 0x2001, 0x0268,
+	0x00c6, 0x2064, 0x6104, 0x6038, 0x00ce, 0x918e, 0x0039, 0x1904,
+	0x1651, 0x9c06, 0x15f0, 0x0126, 0x2091, 0x2600, 0x080c, 0x7a59,
+	0x012e, 0x7358, 0x745c, 0x6014, 0x905d, 0x0598, 0x2b48, 0x6010,
+	0x00b6, 0x2058, 0xb800, 0x00be, 0xd0bc, 0x190c, 0xbc1e, 0xab42,
+	0xac3e, 0x2001, 0x1875, 0x2004, 0xd0b4, 0x1170, 0x601c, 0xd0e4,
+	0x1158, 0x6010, 0x00b6, 0x2058, 0xb800, 0x00be, 0xd0bc, 0x1120,
+	0xa83b, 0x7fff, 0xa837, 0xffff, 0x080c, 0x1d24, 0x1190, 0x080c,
+	0x17ff, 0x2a00, 0xa816, 0x0130, 0x2800, 0xa80e, 0x2c05, 0xa80a,
+	0x2c00, 0xa812, 0x7037, 0x0020, 0x781f, 0x0300, 0x001e, 0x00ee,
+	0x0005, 0x7037, 0x0050, 0x7037, 0x0020, 0x001e, 0x00ee, 0x080c,
+	0x153a, 0x0005, 0x080c, 0x0d65, 0x0016, 0x2009, 0x00a0, 0x8109,
+	0xa001, 0xa001, 0xa001, 0x1dd8, 0x001e, 0x2cf0, 0x0126, 0x2091,
+	0x2200, 0x00c6, 0x3e60, 0x6014, 0x2048, 0x2940, 0x903e, 0x2730,
+	0xa864, 0x2068, 0xa81a, 0x9d84, 0x000f, 0x9088, 0x1d04, 0x2165,
+	0x0002, 0x1690, 0x16dd, 0x1690, 0x1690, 0x1690, 0x16bf, 0x1690,
+	0x1694, 0x1689, 0x16d4, 0x1690, 0x1690, 0x1690, 0x1799, 0x16a8,
+	0x169e, 0xa964, 0x918c, 0x00ff, 0x918e, 0x0048, 0x0904, 0x16d4,
+	0x9085, 0x0001, 0x0804, 0x1790, 0xa87c, 0xd0bc, 0x0dc8, 0xa890,
+	0xa842, 0xa88c, 0xa83e, 0xa888, 0x0804, 0x16e4, 0xa87c, 0xd0bc,
+	0x0d78, 0xa890, 0xa842, 0xa88c, 0xa83e, 0xa888, 0x0804, 0x1733,
+	0xa87c, 0xd0bc, 0x0d28, 0xa890, 0xa842, 0xa88c, 0xa83e, 0xa804,
+	0x9045, 0x090c, 0x0d65, 0xa164, 0xa91a, 0x91ec, 0x000f, 0x9d80,
+	0x1d04, 0x2065, 0xa888, 0xd19c, 0x1904, 0x1733, 0x0428, 0xa87c,
+	0xd0ac, 0x0970, 0xa804, 0x9045, 0x090c, 0x0d65, 0xa164, 0xa91a,
+	0x91ec, 0x000f, 0x9d80, 0x1d04, 0x2065, 0x9006, 0xa842, 0xa83e,
+	0xd19c, 0x1904, 0x1733, 0x0080, 0xa87c, 0xd0ac, 0x0904, 0x1690,
+	0x9006, 0xa842, 0xa83e, 0x0804, 0x1733, 0xa87c, 0xd0ac, 0x0904,
+	0x1690, 0x9006, 0xa842, 0xa83e, 0x2c05, 0x908a, 0x0036, 0x1a0c,
+	0x0d65, 0x9082, 0x001b, 0x0002, 0x1707, 0x1707, 0x1709, 0x1707,
+	0x1707, 0x1707, 0x170f, 0x1707, 0x1707, 0x1707, 0x1715, 0x1707,
+	0x1707, 0x1707, 0x171b, 0x1707, 0x1707, 0x1707, 0x1721, 0x1707,
+	0x1707, 0x1707, 0x1727, 0x1707, 0x1707, 0x1707, 0x172d, 0x080c,
+	0x0d65, 0xa574, 0xa478, 0xa37c, 0xa280, 0x0804, 0x1778, 0xa584,
+	0xa488, 0xa38c, 0xa290, 0x0804, 0x1778, 0xa594, 0xa498, 0xa39c,
+	0xa2a0, 0x0804, 0x1778, 0xa5a4, 0xa4a8, 0xa3ac, 0xa2b0, 0x0804,
+	0x1778, 0xa5b4, 0xa4b8, 0xa3bc, 0xa2c0, 0x0804, 0x1778, 0xa5c4,
+	0xa4c8, 0xa3cc, 0xa2d0, 0x0804, 0x1778, 0xa5d4, 0xa4d8, 0xa3dc,
+	0xa2e0, 0x0804, 0x1778, 0x2c05, 0x908a, 0x0034, 0x1a0c, 0x0d65,
+	0x9082, 0x001b, 0x0002, 0x1756, 0x1754, 0x1754, 0x1754, 0x1754,
+	0x1754, 0x175d, 0x1754, 0x1754, 0x1754, 0x1754, 0x1754, 0x1764,
+	0x1754, 0x1754, 0x1754, 0x1754, 0x1754, 0x176b, 0x1754, 0x1754,
+	0x1754, 0x1754, 0x1754, 0x1772, 0x080c, 0x0d65, 0xa56c, 0xa470,
+	0xa774, 0xa678, 0xa37c, 0xa280, 0x00d8, 0xa584, 0xa488, 0xa78c,
+	0xa690, 0xa394, 0xa298, 0x00a0, 0xa59c, 0xa4a0, 0xa7a4, 0xa6a8,
+	0xa3ac, 0xa2b0, 0x0068, 0xa5b4, 0xa4b8, 0xa7bc, 0xa6c0, 0xa3c4,
+	0xa2c8, 0x0030, 0xa5cc, 0xa4d0, 0xa7d4, 0xa6d8, 0xa3dc, 0xa2e0,
+	0xab2e, 0xaa32, 0xad1e, 0xac22, 0xaf26, 0xae2a, 0xa988, 0x8c60,
+	0x2c1d, 0xa8ac, 0xaab0, 0xa836, 0xaa3a, 0x8109, 0xa916, 0x1158,
+	0x3e60, 0x601c, 0xc085, 0x601e, 0xa87c, 0xc0dd, 0xa87e, 0x9006,
+	0x00ce, 0x012e, 0x0005, 0x2800, 0xa80e, 0xab0a, 0x2c00, 0xa812,
+	0x0c78, 0x0804, 0x1690, 0x0016, 0x2009, 0x00a0, 0x8109, 0xa001,
+	0xa001, 0xa001, 0x1dd8, 0x001e, 0x2ff0, 0x0126, 0x2091, 0x2200,
+	0x00c6, 0x3e60, 0x6014, 0x2048, 0x2940, 0xa80e, 0x2061, 0x1cff,
+	0xa813, 0x1cff, 0x2c05, 0xa80a, 0xa964, 0xa91a, 0xa87c, 0xd0ac,
+	0x090c, 0x0d65, 0x9006, 0xa842, 0xa83e, 0x2c05, 0x908a, 0x0034,
+	0x1a0c, 0x0d65, 0xadcc, 0xacd0, 0xafd4, 0xaed8, 0xabdc, 0xaae0,
+	0xab2e, 0xaa32, 0xad1e, 0xac22, 0xaf26, 0xae2a, 0xa8ac, 0xaab0,
+	0xa836, 0xaa3a, 0xa988, 0xa864, 0x9084, 0x00ff, 0x9086, 0x0008,
+	0x1120, 0x8109, 0xa916, 0x0128, 0x0078, 0x918a, 0x0002, 0xa916,
+	0x1158, 0x3e60, 0x601c, 0xc085, 0x601e, 0xa87c, 0xc0dd, 0xa87e,
+	0x9006, 0x00ce, 0x012e, 0x0005, 0xa804, 0x9045, 0x090c, 0x0d65,
+	0xa80e, 0xa064, 0xa81a, 0x9084, 0x000f, 0x9080, 0x1d04, 0x2015,
+	0x82ff, 0x090c, 0x0d65, 0xaa12, 0x2205, 0xa80a, 0x0c10, 0x903e,
+	0x2730, 0xa880, 0xd0fc, 0x1190, 0x2d00, 0x0002, 0x18f4, 0x1856,
+	0x1856, 0x18f4, 0x18f4, 0x18ee, 0x18f4, 0x1856, 0x18a5, 0x18a5,
+	0x18a5, 0x18f4, 0x18f4, 0x18f4, 0x18eb, 0x18a5, 0xc0fc, 0xa882,
+	0xab2c, 0xaa30, 0xad1c, 0xac20, 0xdd9c, 0x0904, 0x18f6, 0x2c05,
+	0x908a, 0x0034, 0x1a0c, 0x0d65, 0x9082, 0x001b, 0x0002, 0x1842,
+	0x1840, 0x1840, 0x1840, 0x1840, 0x1840, 0x1846, 0x1840, 0x1840,
+	0x1840, 0x1840, 0x1840, 0x184a, 0x1840, 0x1840, 0x1840, 0x1840,
+	0x1840, 0x184e, 0x1840, 0x1840, 0x1840, 0x1840, 0x1840, 0x1852,
+	0x080c, 0x0d65, 0xa774, 0xa678, 0x0804, 0x18f6, 0xa78c, 0xa690,
+	0x0804, 0x18f6, 0xa7a4, 0xa6a8, 0x0804, 0x18f6, 0xa7bc, 0xa6c0,
+	0x0804, 0x18f6, 0xa7d4, 0xa6d8, 0x0804, 0x18f6, 0x2c05, 0x908a,
+	0x0036, 0x1a0c, 0x0d65, 0x9082, 0x001b, 0x0002, 0x1879, 0x1879,
+	0x187b, 0x1879, 0x1879, 0x1879, 0x1881, 0x1879, 0x1879, 0x1879,
+	0x1887, 0x1879, 0x1879, 0x1879, 0x188d, 0x1879, 0x1879, 0x1879,
+	0x1893, 0x1879, 0x1879, 0x1879, 0x1899, 0x1879, 0x1879, 0x1879,
+	0x189f, 0x080c, 0x0d65, 0xa574, 0xa478, 0xa37c, 0xa280, 0x0804,
+	0x18f6, 0xa584, 0xa488, 0xa38c, 0xa290, 0x0804, 0x18f6, 0xa594,
+	0xa498, 0xa39c, 0xa2a0, 0x0804, 0x18f6, 0xa5a4, 0xa4a8, 0xa3ac,
+	0xa2b0, 0x0804, 0x18f6, 0xa5b4, 0xa4b8, 0xa3bc, 0xa2c0, 0x0804,
+	0x18f6, 0xa5c4, 0xa4c8, 0xa3cc, 0xa2d0, 0x0804, 0x18f6, 0xa5d4,
+	0xa4d8, 0xa3dc, 0xa2e0, 0x0804, 0x18f6, 0x2c05, 0x908a, 0x0034,
+	0x1a0c, 0x0d65, 0x9082, 0x001b, 0x0002, 0x18c8, 0x18c6, 0x18c6,
+	0x18c6, 0x18c6, 0x18c6, 0x18cf, 0x18c6, 0x18c6, 0x18c6, 0x18c6,
+	0x18c6, 0x18d6, 0x18c6, 0x18c6, 0x18c6, 0x18c6, 0x18c6, 0x18dd,
+	0x18c6, 0x18c6, 0x18c6, 0x18c6, 0x18c6, 0x18e4, 0x080c, 0x0d65,
+	0xa56c, 0xa470, 0xa774, 0xa678, 0xa37c, 0xa280, 0x0438, 0xa584,
+	0xa488, 0xa78c, 0xa690, 0xa394, 0xa298, 0x0400, 0xa59c, 0xa4a0,
+	0xa7a4, 0xa6a8, 0xa3ac, 0xa2b0, 0x00c8, 0xa5b4, 0xa4b8, 0xa7bc,
+	0xa6c0, 0xa3c4, 0xa2c8, 0x0090, 0xa5cc, 0xa4d0, 0xa7d4, 0xa6d8,
+	0xa3dc, 0xa2e0, 0x0058, 0x9d86, 0x000e, 0x1130, 0x080c, 0x1cda,
+	0x1904, 0x17ff, 0x900e, 0x0050, 0x080c, 0x0d65, 0xab2e, 0xaa32,
+	0xad1e, 0xac22, 0xaf26, 0xae2a, 0x080c, 0x1cda, 0x0005, 0x6014,
+	0x2048, 0x6118, 0x810c, 0x810c, 0x810c, 0x81ff, 0x1118, 0xa887,
+	0x0001, 0x0008, 0xa986, 0x601b, 0x0002, 0xa974, 0xd1dc, 0x1108,
+	0x0005, 0xa934, 0xa88c, 0x9106, 0x1158, 0xa938, 0xa890, 0x9106,
+	0x1138, 0x601c, 0xc084, 0x601e, 0x2009, 0x0048, 0x0804, 0x9c76,
+	0x0005, 0x0126, 0x00c6, 0x2091, 0x2200, 0x00ce, 0x7908, 0x918c,
+	0x0007, 0x9186, 0x0000, 0x05b0, 0x9186, 0x0003, 0x0598, 0x6020,
+	0x6023, 0x0000, 0x0006, 0x2031, 0x0008, 0x00c6, 0x781f, 0x0808,
+	0x7808, 0xd09c, 0x0120, 0x080c, 0x1335, 0x8631, 0x1db8, 0x00ce,
+	0x781f, 0x0800, 0x2031, 0x0168, 0x00c6, 0x7808, 0xd09c, 0x190c,
+	0x1335, 0x00ce, 0x2001, 0x0038, 0x080c, 0x19f9, 0x7930, 0x9186,
+	0x0040, 0x0160, 0x9186, 0x0042, 0x190c, 0x0d65, 0x2001, 0x001e,
+	0x8001, 0x1df0, 0x8631, 0x1d40, 0x080c, 0x1a08, 0x000e, 0x6022,
+	0x012e, 0x0005, 0x080c, 0x19f5, 0x7827, 0x0015, 0x7828, 0x9c06,
+	0x1db8, 0x782b, 0x0000, 0x0ca0, 0x00f6, 0x2079, 0x0300, 0x7803,
+	0x0000, 0x78ab, 0x0004, 0x00fe, 0x080c, 0x7096, 0x11b0, 0x2001,
+	0x0138, 0x2003, 0x0000, 0x2001, 0x0160, 0x2003, 0x0000, 0x2011,
+	0x012c, 0xa001, 0xa001, 0x8211, 0x1de0, 0x0081, 0x2001, 0x0386,
+	0x2003, 0x2020, 0x080c, 0x7137, 0x0005, 0x0479, 0x0039, 0x2001,
+	0x0160, 0x2502, 0x2001, 0x0138, 0x2202, 0x0005, 0x00e6, 0x2071,
+	0x0200, 0x080c, 0x2844, 0x2009, 0x003c, 0x080c, 0x2063, 0x2001,
+	0x015d, 0x2003, 0x0000, 0x7000, 0x9084, 0x003c, 0x1de0, 0x080c,
+	0x8053, 0x70a0, 0x70a2, 0x7098, 0x709a, 0x709c, 0x709e, 0x2001,
+	0x020d, 0x2003, 0x0020, 0x00f6, 0x2079, 0x0300, 0x080c, 0x12f5,
+	0x7803, 0x0001, 0x00fe, 0x00ee, 0x0005, 0x2001, 0x0138, 0x2014,
+	0x2003, 0x0000, 0x2001, 0x0160, 0x202c, 0x2003, 0x0000, 0x080c,
+	0x7096, 0x1108, 0x0005, 0x2021, 0x0260, 0x2001, 0x0141, 0x201c,
+	0xd3dc, 0x1168, 0x2001, 0x0109, 0x201c, 0x939c, 0x0048, 0x1160,
+	0x2001, 0x0111, 0x201c, 0x83ff, 0x1110, 0x8421, 0x1d70, 0x2001,
+	0x015d, 0x2003, 0x0000, 0x0005, 0x0046, 0x2021, 0x0019, 0x2003,
+	0x0048, 0xa001, 0xa001, 0x201c, 0x939c, 0x0048, 0x0120, 0x8421,
+	0x1db0, 0x004e, 0x0c60, 0x004e, 0x0c40, 0x601c, 0xc084, 0x601e,
+	0x0005, 0x2c08, 0x621c, 0x080c, 0x15ab, 0x7930, 0x0005, 0x2c08,
+	0x621c, 0x080c, 0x15d8, 0x7930, 0x0005, 0x8001, 0x1df0, 0x0005,
+	0x2031, 0x0005, 0x781c, 0x9084, 0x0007, 0x0170, 0x2001, 0x0038,
+	0x0c41, 0x9186, 0x0040, 0x0904, 0x1a66, 0x2001, 0x001e, 0x0c69,
+	0x8631, 0x1d80, 0x080c, 0x0d65, 0x781f, 0x0202, 0x2001, 0x015d,
+	0x2003, 0x0000, 0x2001, 0x0b10, 0x0c01, 0x781c, 0xd084, 0x0110,
+	0x0861, 0x04e0, 0x2001, 0x0030, 0x0891, 0x9186, 0x0040, 0x0568,
+	0x781c, 0xd084, 0x1da8, 0x781f, 0x0101, 0x2001, 0x0014, 0x0869,
+	0x2001, 0x0037, 0x0821, 0x9186, 0x0040, 0x0140, 0x2001, 0x0030,
+	0x080c, 0x19ff, 0x9186, 0x0040, 0x190c, 0x0d65, 0x00d6, 0x2069,
+	0x0200, 0x692c, 0xd1f4, 0x1170, 0xd1c4, 0x0160, 0xd19c, 0x0130,
+	0x6800, 0x9085, 0x1800, 0x6802, 0x00de, 0x0080, 0x6908, 0x9184,
+	0x0007, 0x1db0, 0x00de, 0x781f, 0x0100, 0x791c, 0x9184, 0x0007,
+	0x090c, 0x0d65, 0xa001, 0xa001, 0x781f, 0x0200, 0x0005, 0x0126,
+	0x2091, 0x2400, 0x2079, 0x0380, 0x2001, 0x19b7, 0x2070, 0x012e,
+	0x0005, 0x2cf0, 0x0126, 0x2091, 0x2400, 0x3e60, 0x6014, 0x2048,
+	0xa964, 0xa91a, 0x918c, 0x00ff, 0x9184, 0x000f, 0x0002, 0x1a9b,
+	0x1a9b, 0x1a9b, 0x1a9b, 0x1a9b, 0x1a9b, 0x1a9b, 0x1a9b, 0x1a8f,
+	0x1a9d, 0x1a9b, 0x1a9b, 0x1a9b, 0x1a9b, 0x1a9b, 0x1a9b, 0x9086,
+	0x0008, 0x1148, 0xa87c, 0xd0b4, 0x0904, 0x1c0d, 0x2011, 0x1cff,
+	0x2205, 0xab88, 0x0068, 0x080c, 0x0d65, 0xa87c, 0xd0b4, 0x0904,
+	0x1c0d, 0x9184, 0x000f, 0x9080, 0x1d04, 0x2015, 0x2205, 0xab88,
+	0x2908, 0xa80a, 0xa90e, 0xaa12, 0xab16, 0x9006, 0xa842, 0xa83e,
+	0x012e, 0x0005, 0x2cf0, 0x0126, 0x2091, 0x2400, 0x3e60, 0x6014,
+	0x2048, 0xa88c, 0xa990, 0xaaac, 0xabb0, 0xaa36, 0xab3a, 0xa83e,
+	0xa942, 0xa846, 0xa94a, 0xa964, 0x918c, 0x00ff, 0x9186, 0x001e,
+	0x0198, 0x2940, 0xa064, 0xa81a, 0x90ec, 0x000f, 0x9d80, 0x1d04,
+	0x2065, 0x2c05, 0x2808, 0x2c10, 0xab88, 0xa80a, 0xa90e, 0xaa12,
+	0xab16, 0x012e, 0x3e60, 0x0005, 0xa804, 0x2040, 0x0c58, 0x2cf0,
+	0x0126, 0x2091, 0x2400, 0x3e60, 0x6014, 0x2048, 0xa97c, 0x2950,
+	0xd1dc, 0x1904, 0x1bd7, 0xc1dd, 0xa97e, 0x9006, 0xa842, 0xa83e,
+	0xa988, 0x8109, 0xa916, 0xa964, 0xa91a, 0x9184, 0x000f, 0x9088,
+	0x1d04, 0x2145, 0x0002, 0x1b0b, 0x1b19, 0x1b0b, 0x1b0b, 0x1b0b,
+	0x1b0d, 0x1b0b, 0x1b0b, 0x1b6e, 0x1b6e, 0x1b0b, 0x1b0b, 0x1b0b,
+	0x1b6c, 0x1b0b, 0x1b0b, 0x080c, 0x0d65, 0xa804, 0x2050, 0xb164,
+	0xa91a, 0x9184, 0x000f, 0x9080, 0x1d04, 0x2045, 0xd19c, 0x1904,
+	0x1b6e, 0x9036, 0x2638, 0x2805, 0x908a, 0x0036, 0x1a0c, 0x0d65,
+	0x9082, 0x001b, 0x0002, 0x1b3e, 0x1b3e, 0x1b40, 0x1b3e, 0x1b3e,
+	0x1b3e, 0x1b46, 0x1b3e, 0x1b3e, 0x1b3e, 0x1b4c, 0x1b3e, 0x1b3e,
+	0x1b3e, 0x1b52, 0x1b3e, 0x1b3e, 0x1b3e, 0x1b58, 0x1b3e, 0x1b3e,
+	0x1b3e, 0x1b5e, 0x1b3e, 0x1b3e, 0x1b3e, 0x1b64, 0x080c, 0x0d65,
+	0xb574, 0xb478, 0xb37c, 0xb280, 0x0804, 0x1bb3, 0xb584, 0xb488,
+	0xb38c, 0xb290, 0x0804, 0x1bb3, 0xb594, 0xb498, 0xb39c, 0xb2a0,
+	0x0804, 0x1bb3, 0xb5a4, 0xb4a8, 0xb3ac, 0xb2b0, 0x0804, 0x1bb3,
+	0xb5b4, 0xb4b8, 0xb3bc, 0xb2c0, 0x0804, 0x1bb3, 0xb5c4, 0xb4c8,
+	0xb3cc, 0xb2d0, 0x0804, 0x1bb3, 0xb5d4, 0xb4d8, 0xb3dc, 0xb2e0,
+	0x0804, 0x1bb3, 0x0804, 0x1bb3, 0x080c, 0x0d65, 0x2805, 0x908a,
+	0x0034, 0x1a0c, 0x0d65, 0x9082, 0x001b, 0x0002, 0x1b91, 0x1b8f,
+	0x1b8f, 0x1b8f, 0x1b8f, 0x1b8f, 0x1b98, 0x1b8f, 0x1b8f, 0x1b8f,
+	0x1b8f, 0x1b8f, 0x1b9f, 0x1b8f, 0x1b8f, 0x1b8f, 0x1b8f, 0x1b8f,
+	0x1ba6, 0x1b8f, 0x1b8f, 0x1b8f, 0x1b8f, 0x1b8f, 0x1bad, 0x080c,
+	0x0d65, 0xb56c, 0xb470, 0xb774, 0xb678, 0xb37c, 0xb280, 0x00d8,
+	0xb584, 0xb488, 0xb78c, 0xb690, 0xb394, 0xb298, 0x00a0, 0xb59c,
+	0xb4a0, 0xb7a4, 0xb6a8, 0xb3ac, 0xb2b0, 0x0068, 0xb5b4, 0xb4b8,
+	0xb7bc, 0xb6c0, 0xb3c4, 0xb2c8, 0x0030, 0xb5cc, 0xb4d0, 0xb7d4,
+	0xb6d8, 0xb3dc, 0xb2e0, 0xab2e, 0xaa32, 0xad1e, 0xac22, 0xaf26,
+	0xae2a, 0xa988, 0x8109, 0xa916, 0x1118, 0x9006, 0x012e, 0x0005,
+	0x8840, 0x2805, 0x9005, 0x1168, 0xb004, 0x9005, 0x090c, 0x0d65,
+	0x2050, 0xb164, 0xa91a, 0x9184, 0x000f, 0x9080, 0x1d04, 0x2045,
+	0x2805, 0x2810, 0x2a08, 0xa80a, 0xa90e, 0xaa12, 0x0c30, 0x3e60,
+	0x6344, 0xd3fc, 0x190c, 0x0d65, 0xa93c, 0xaa40, 0xa844, 0x9106,
+	0x1118, 0xa848, 0x9206, 0x0508, 0x2958, 0xab48, 0xac44, 0x2940,
+	0x080c, 0x1d24, 0x1998, 0x2850, 0x2c40, 0xab14, 0xa880, 0xd0fc,
+	0x1140, 0xa810, 0x2005, 0xa80a, 0x2a00, 0xa80e, 0x2009, 0x8015,
+	0x0070, 0x00c6, 0x3e60, 0x6044, 0xc0a4, 0x9085, 0x8005, 0x6046,
+	0x00ce, 0x8319, 0xab16, 0x1904, 0x1bc0, 0x2009, 0x8005, 0x3e60,
+	0x6044, 0x9105, 0x6046, 0x0804, 0x1bbd, 0x080c, 0x0d65, 0x00f6,
+	0x00e6, 0x0096, 0x00c6, 0x0026, 0x704c, 0x9c06, 0x190c, 0x0d65,
+	0x2079, 0x0090, 0x2001, 0x0105, 0x2003, 0x0010, 0x782b, 0x0004,
+	0x7057, 0x0000, 0x6014, 0x2048, 0x080c, 0xb842, 0x0118, 0xa880,
+	0xc0bd, 0xa882, 0x6020, 0x9086, 0x0006, 0x1170, 0x2061, 0x0100,
+	0x62c8, 0x2001, 0x00fa, 0x8001, 0x1df0, 0x60c8, 0x9206, 0x1dc0,
+	0x60c4, 0xa89a, 0x60c8, 0xa896, 0x704c, 0x2060, 0x00c6, 0x080c,
+	0xb440, 0x080c, 0x98bb, 0x00ce, 0x704c, 0x9c06, 0x1150, 0x2009,
+	0x0040, 0x080c, 0x2063, 0x080c, 0x949c, 0x2011, 0x0000, 0x080c,
+	0x9326, 0x002e, 0x00ce, 0x009e, 0x00ee, 0x00fe, 0x0005, 0x00f6,
+	0x2079, 0x0090, 0x781c, 0x0006, 0x7818, 0x0006, 0x2079, 0x0100,
+	0x7a14, 0x9284, 0x1984, 0x9085, 0x0012, 0x7816, 0x2019, 0x1000,
+	0x8319, 0x090c, 0x0d65, 0x7820, 0xd0bc, 0x1dd0, 0x79c8, 0x000e,
+	0x9102, 0x001e, 0x0006, 0x0016, 0x79c4, 0x000e, 0x9103, 0x78c6,
+	0x000e, 0x78ca, 0x9284, 0x1984, 0x9085, 0x0012, 0x7816, 0x2079,
+	0x0090, 0x782b, 0x0008, 0x7057, 0x0000, 0x00fe, 0x0005, 0x00f6,
+	0x00e6, 0x2071, 0x19b7, 0x7054, 0x9086, 0x0000, 0x0904, 0x1cd5,
+	0x2079, 0x0090, 0x2009, 0x0207, 0x210c, 0xd194, 0x01b8, 0x2009,
+	0x020c, 0x210c, 0x9184, 0x0003, 0x0188, 0x080c, 0xd62d, 0x2001,
+	0x0133, 0x2004, 0x9005, 0x090c, 0x0d65, 0x0016, 0x2009, 0x0040,
+	0x080c, 0x2063, 0x001e, 0x2001, 0x020c, 0x2102, 0x2009, 0x0206,
+	0x2104, 0x2009, 0x0203, 0x210c, 0x9106, 0x1120, 0x2009, 0x0040,
+	0x080c, 0x2063, 0x782c, 0xd0fc, 0x09a8, 0x080c, 0x98d7, 0x782c,
+	0xd0fc, 0x1de8, 0x080c, 0x98bb, 0x7054, 0x9086, 0x0000, 0x1950,
+	0x782b, 0x0004, 0x782c, 0xd0ac, 0x1de8, 0x2009, 0x0040, 0x080c,
+	0x2063, 0x782b, 0x0002, 0x7057, 0x0000, 0x00ee, 0x00fe, 0x0005,
+	0x080c, 0x0d65, 0x8c60, 0x2c05, 0x9005, 0x0110, 0x8a51, 0x0005,
+	0xa004, 0x9005, 0x0168, 0xa85a, 0x2040, 0xa064, 0x9084, 0x000f,
+	0x9080, 0x1d04, 0x2065, 0x8cff, 0x090c, 0x0d65, 0x8a51, 0x0005,
+	0x2050, 0x0005, 0x0000, 0x001d, 0x0021, 0x0025, 0x0029, 0x002d,
+	0x0031, 0x0035, 0x0000, 0x001b, 0x0021, 0x0027, 0x002d, 0x0033,
+	0x0000, 0x0000, 0x0023, 0x0000, 0x0000, 0x1cf7, 0x1cf3, 0x0000,
+	0x0000, 0x1d01, 0x0000, 0x1cf7, 0x1cfe, 0x1cfe, 0x1cfb, 0x0000,
+	0x0000, 0x0000, 0x1d01, 0x1cfe, 0x0000, 0x1cf9, 0x1cf9, 0x0000,
+	0x0000, 0x1d01, 0x0000, 0x1cf9, 0x1cff, 0x1cff, 0x1cff, 0x0000,
+	0x0000, 0x0000, 0x1d01, 0x1cff, 0x00c6, 0x00d6, 0x0086, 0xab42,
+	0xac3e, 0xa888, 0x9055, 0x0904, 0x1f03, 0x2940, 0xa064, 0x90ec,
+	0x000f, 0x9084, 0x00ff, 0x9086, 0x0008, 0x1118, 0x2061, 0x1cff,
+	0x00d0, 0x9de0, 0x1d04, 0x9d86, 0x0007, 0x0130, 0x9d86, 0x000e,
+	0x0118, 0x9d86, 0x000f, 0x1120, 0xa08c, 0x9422, 0xa090, 0x931b,
+	0x2c05, 0x9065, 0x1140, 0x0310, 0x0804, 0x1f03, 0xa004, 0x9045,
+	0x0904, 0x1f03, 0x08d8, 0x2c05, 0x9005, 0x0904, 0x1deb, 0xdd9c,
+	0x1904, 0x1da7, 0x908a, 0x0036, 0x1a0c, 0x0d65, 0x9082, 0x001b,
+	0x0002, 0x1d7c, 0x1d7c, 0x1d7e, 0x1d7c, 0x1d7c, 0x1d7c, 0x1d84,
+	0x1d7c, 0x1d7c, 0x1d7c, 0x1d8a, 0x1d7c, 0x1d7c, 0x1d7c, 0x1d90,
+	0x1d7c, 0x1d7c, 0x1d7c, 0x1d96, 0x1d7c, 0x1d7c, 0x1d7c, 0x1d9c,
+	0x1d7c, 0x1d7c, 0x1d7c, 0x1da2, 0x080c, 0x0d65, 0xa07c, 0x9422,
+	0xa080, 0x931b, 0x0804, 0x1de1, 0xa08c, 0x9422, 0xa090, 0x931b,
+	0x0804, 0x1de1, 0xa09c, 0x9422, 0xa0a0, 0x931b, 0x0804, 0x1de1,
+	0xa0ac, 0x9422, 0xa0b0, 0x931b, 0x0804, 0x1de1, 0xa0bc, 0x9422,
+	0xa0c0, 0x931b, 0x0804, 0x1de1, 0xa0cc, 0x9422, 0xa0d0, 0x931b,
+	0x0804, 0x1de1, 0xa0dc, 0x9422, 0xa0e0, 0x931b, 0x04d0, 0x908a,
+	0x0034, 0x1a0c, 0x0d65, 0x9082, 0x001b, 0x0002, 0x1dc9, 0x1dc7,
+	0x1dc7, 0x1dc7, 0x1dc7, 0x1dc7, 0x1dce, 0x1dc7, 0x1dc7, 0x1dc7,
+	0x1dc7, 0x1dc7, 0x1dd3, 0x1dc7, 0x1dc7, 0x1dc7, 0x1dc7, 0x1dc7,
+	0x1dd8, 0x1dc7, 0x1dc7, 0x1dc7, 0x1dc7, 0x1dc7, 0x1ddd, 0x080c,
+	0x0d65, 0xa07c, 0x9422, 0xa080, 0x931b, 0x0098, 0xa094, 0x9422,
+	0xa098, 0x931b, 0x0070, 0xa0ac, 0x9422, 0xa0b0, 0x931b, 0x0048,
+	0xa0c4, 0x9422, 0xa0c8, 0x931b, 0x0020, 0xa0dc, 0x9422, 0xa0e0,
+	0x931b, 0x0630, 0x2300, 0x9405, 0x0160, 0x8a51, 0x0904, 0x1f03,
+	0x8c60, 0x0804, 0x1d53, 0xa004, 0x9045, 0x0904, 0x1f03, 0x0804,
+	0x1d2e, 0x8a51, 0x0904, 0x1f03, 0x8c60, 0x2c05, 0x9005, 0x1158,
+	0xa004, 0x9045, 0x0904, 0x1f03, 0xa064, 0x90ec, 0x000f, 0x9de0,
+	0x1d04, 0x2c05, 0x2060, 0xa880, 0xc0fc, 0xa882, 0x0804, 0x1ef8,
+	0x2c05, 0x8422, 0x8420, 0x831a, 0x9399, 0x0000, 0xac2e, 0xab32,
+	0xdd9c, 0x1904, 0x1e95, 0x9082, 0x001b, 0x0002, 0x1e31, 0x1e31,
+	0x1e33, 0x1e31, 0x1e31, 0x1e31, 0x1e41, 0x1e31, 0x1e31, 0x1e31,
+	0x1e4f, 0x1e31, 0x1e31, 0x1e31, 0x1e5d, 0x1e31, 0x1e31, 0x1e31,
+	0x1e6b, 0x1e31, 0x1e31, 0x1e31, 0x1e79, 0x1e31, 0x1e31, 0x1e31,
+	0x1e87, 0x080c, 0x0d65, 0xa17c, 0x2400, 0x9122, 0xa180, 0x2300,
+	0x911b, 0x0a0c, 0x0d65, 0xa074, 0x9420, 0xa078, 0x9319, 0x0804,
+	0x1ef3, 0xa18c, 0x2400, 0x9122, 0xa190, 0x2300, 0x911b, 0x0a0c,
+	0x0d65, 0xa084, 0x9420, 0xa088, 0x9319, 0x0804, 0x1ef3, 0xa19c,
+	0x2400, 0x9122, 0xa1a0, 0x2300, 0x911b, 0x0a0c, 0x0d65, 0xa094,
+	0x9420, 0xa098, 0x9319, 0x0804, 0x1ef3, 0xa1ac, 0x2400, 0x9122,
+	0xa1b0, 0x2300, 0x911b, 0x0a0c, 0x0d65, 0xa0a4, 0x9420, 0xa0a8,
+	0x9319, 0x0804, 0x1ef3, 0xa1bc, 0x2400, 0x9122, 0xa1c0, 0x2300,
+	0x911b, 0x0a0c, 0x0d65, 0xa0b4, 0x9420, 0xa0b8, 0x9319, 0x0804,
+	0x1ef3, 0xa1cc, 0x2400, 0x9122, 0xa1d0, 0x2300, 0x911b, 0x0a0c,
+	0x0d65, 0xa0c4, 0x9420, 0xa0c8, 0x9319, 0x0804, 0x1ef3, 0xa1dc,
+	0x2400, 0x9122, 0xa1e0, 0x2300, 0x911b, 0x0a0c, 0x0d65, 0xa0d4,
+	0x9420, 0xa0d8, 0x9319, 0x0804, 0x1ef3, 0x9082, 0x001b, 0x0002,
+	0x1eb3, 0x1eb1, 0x1eb1, 0x1eb1, 0x1eb1, 0x1eb1, 0x1ec0, 0x1eb1,
+	0x1eb1, 0x1eb1, 0x1eb1, 0x1eb1, 0x1ecd, 0x1eb1, 0x1eb1, 0x1eb1,
+	0x1eb1, 0x1eb1, 0x1eda, 0x1eb1, 0x1eb1, 0x1eb1, 0x1eb1, 0x1eb1,
+	0x1ee7, 0x080c, 0x0d65, 0xa17c, 0x2400, 0x9122, 0xa180, 0x2300,
+	0x911b, 0x0a0c, 0x0d65, 0xa06c, 0x9420, 0xa070, 0x9319, 0x0498,
+	0xa194, 0x2400, 0x9122, 0xa198, 0x2300, 0x911b, 0x0a0c, 0x0d65,
+	0xa084, 0x9420, 0xa088, 0x9319, 0x0430, 0xa1ac, 0x2400, 0x9122,
+	0xa1b0, 0x2300, 0x911b, 0x0a0c, 0x0d65, 0xa09c, 0x9420, 0xa0a0,
+	0x9319, 0x00c8, 0xa1c4, 0x2400, 0x9122, 0xa1c8, 0x2300, 0x911b,
+	0x0a0c, 0x0d65, 0xa0b4, 0x9420, 0xa0b8, 0x9319, 0x0060, 0xa1dc,
+	0x2400, 0x9122, 0xa1e0, 0x2300, 0x911b, 0x0a0c, 0x0d65, 0xa0cc,
+	0x9420, 0xa0d0, 0x9319, 0xac1e, 0xab22, 0xa880, 0xc0fd, 0xa882,
+	0x2800, 0xa85a, 0x2c00, 0xa812, 0x2a00, 0xa816, 0x000e, 0x000e,
+	0x000e, 0x9006, 0x0028, 0x008e, 0x00de, 0x00ce, 0x9085, 0x0001,
+	0x0005, 0x00c6, 0x610c, 0x0016, 0x9026, 0x2410, 0x6004, 0x9420,
+	0x9291, 0x0000, 0x2c04, 0x9210, 0x9ce0, 0x0002, 0x918a, 0x0002,
+	0x1da8, 0x9284, 0x000f, 0x9405, 0x001e, 0x00ce, 0x0005, 0x7803,
+	0x0003, 0x780f, 0x0000, 0x6004, 0x7812, 0x2c04, 0x7816, 0x9ce0,
+	0x0002, 0x918a, 0x0002, 0x1db8, 0x0005, 0x2001, 0x0005, 0x2004,
+	0xd0bc, 0x190c, 0x0d5e, 0xd094, 0x0110, 0x080c, 0x11d1, 0x0005,
+	0x0126, 0x2091, 0x2600, 0x2079, 0x0200, 0x2071, 0x0260, 0x2069,
+	0x1800, 0x7817, 0x0000, 0x789b, 0x0814, 0x78a3, 0x0406, 0x789f,
+	0x0410, 0x2009, 0x013b, 0x200b, 0x0400, 0x781b, 0x0002, 0x783b,
+	0x001f, 0x7837, 0x0020, 0x7803, 0x1600, 0x012e, 0x0005, 0x2091,
+	0x2600, 0x781c, 0xd0a4, 0x190c, 0x2060, 0x7900, 0xd1dc, 0x1118,
+	0x9084, 0x0006, 0x001a, 0x9084, 0x000e, 0x0002, 0x1f7e, 0x1f76,
+	0x7a59, 0x1f76, 0x1f78, 0x1f78, 0x1f78, 0x1f78, 0x7a3f, 0x1f76,
+	0x1f7a, 0x1f76, 0x1f78, 0x1f76, 0x1f78, 0x1f76, 0x080c, 0x0d65,
+	0x0031, 0x0020, 0x080c, 0x7a3f, 0x080c, 0x7a59, 0x0005, 0x0006,
+	0x0016, 0x0026, 0x080c, 0xd62d, 0x7930, 0x9184, 0x0003, 0x0510,
+	0x080c, 0x98bb, 0x2001, 0x19ca, 0x2004, 0x9005, 0x01a0, 0x2001,
+	0x0133, 0x2004, 0x9005, 0x090c, 0x0d65, 0x00c6, 0x2001, 0x19ca,
+	0x2064, 0x080c, 0x98d7, 0x080c, 0xb440, 0x2009, 0x0040, 0x080c,
+	0x2063, 0x00ce, 0x0408, 0x2009, 0x0040, 0x080c, 0x2063, 0x080c,
+	0x98d7, 0x00d0, 0x9184, 0x0014, 0x01a0, 0x6a00, 0x9286, 0x0003,
+	0x0160, 0x080c, 0x7096, 0x1138, 0x080c, 0x7396, 0x080c, 0x5cd7,
+	0x080c, 0x6fc7, 0x0010, 0x080c, 0x5b92, 0x080c, 0x7af7, 0x0041,
+	0x0018, 0x9184, 0x9540, 0x1dc8, 0x002e, 0x001e, 0x000e, 0x0005,
+	0x00e6, 0x0036, 0x0046, 0x0056, 0x2071, 0x1a3b, 0x080c, 0x196c,
+	0x005e, 0x004e, 0x003e, 0x00ee, 0x0005, 0x0126, 0x2091, 0x2e00,
+	0x2071, 0x1800, 0x7128, 0x2001, 0x193f, 0x2102, 0x2001, 0x1947,
+	0x2102, 0x2001, 0x013b, 0x2102, 0x2079, 0x0200, 0x2001, 0x0201,
+	0x789e, 0x78a3, 0x0200, 0x9198, 0x0007, 0x831c, 0x831c, 0x831c,
+	0x9398, 0x0005, 0x2320, 0x9182, 0x0204, 0x1230, 0x2011, 0x0008,
+	0x8423, 0x8423, 0x8423, 0x0488, 0x9182, 0x024c, 0x1240, 0x2011,
+	0x0007, 0x8403, 0x8003, 0x9400, 0x9400, 0x9420, 0x0430, 0x9182,
+	0x02bc, 0x1238, 0x2011, 0x0006, 0x8403, 0x8003, 0x9400, 0x9420,
+	0x00e0, 0x9182, 0x034c, 0x1230, 0x2011, 0x0005, 0x8403, 0x8003,
+	0x9420, 0x0098, 0x9182, 0x042c, 0x1228, 0x2011, 0x0004, 0x8423,
+	0x8423, 0x0058, 0x9182, 0x059c, 0x1228, 0x2011, 0x0003, 0x8403,
+	0x9420, 0x0018, 0x2011, 0x0002, 0x8423, 0x9482, 0x0228, 0x8002,
+	0x8020, 0x8301, 0x9402, 0x0110, 0x0208, 0x8321, 0x8217, 0x8203,
+	0x9405, 0x789a, 0x012e, 0x0005, 0x0006, 0x00d6, 0x2069, 0x0200,
+	0x6814, 0x9084, 0xffc0, 0x910d, 0x6916, 0x00de, 0x000e, 0x0005,
+	0x00d6, 0x2069, 0x0200, 0x9005, 0x6810, 0x0110, 0xc0a5, 0x0008,
+	0xc0a4, 0x6812, 0x00de, 0x0005, 0x0006, 0x00d6, 0x2069, 0x0200,
+	0x6810, 0x9084, 0xfff8, 0x910d, 0x6912, 0x00de, 0x000e, 0x0005,
+	0x7938, 0x080c, 0x0d5e, 0x00f6, 0x2079, 0x0200, 0x7902, 0xa001,
+	0xa001, 0xa001, 0xa001, 0xa001, 0xa001, 0x7902, 0xa001, 0xa001,
+	0xa001, 0xa001, 0xa001, 0xa001, 0x00fe, 0x0005, 0x0126, 0x2091,
+	0x2800, 0x2061, 0x0100, 0x2071, 0x1800, 0x2009, 0x0000, 0x080c,
+	0x283e, 0x080c, 0x2758, 0x2001, 0x196d, 0x2003, 0x0000, 0x2001,
+	0x196e, 0x2003, 0x0000, 0x080c, 0x28af, 0x9006, 0x080c, 0x2787,
+	0x9006, 0x080c, 0x276a, 0x20a9, 0x0012, 0x1d04, 0x2095, 0x2091,
+	0x6000, 0x1f04, 0x2095, 0x602f, 0x0100, 0x602f, 0x0000, 0x6050,
+	0x9085, 0x0400, 0x9084, 0xdfff, 0x6052, 0x6224, 0x080c, 0x288c,
+	0x080c, 0x2476, 0x2009, 0x00ef, 0x6132, 0x6136, 0x080c, 0x2486,
+	0x60e7, 0x0000, 0x61ea, 0x60e3, 0x0002, 0x604b, 0xf7f7, 0x6043,
+	0x0000, 0x602f, 0x0080, 0x602f, 0x0000, 0x6007, 0x149f, 0x00c6,
+	0x2061, 0x0140, 0x608b, 0x000b, 0x608f, 0x10b8, 0x6093, 0x0000,
+	0x6097, 0x0198, 0x00ce, 0x6004, 0x9085, 0x8000, 0x6006, 0x60bb,
+	0x0000, 0x20a9, 0x0018, 0x60bf, 0x0000, 0x1f04, 0x20d3, 0x60bb,
+	0x0000, 0x60bf, 0x0108, 0x60bf, 0x0012, 0x60bf, 0x0320, 0x60bf,
+	0x0018, 0x601b, 0x00f0, 0x601f, 0x001e, 0x600f, 0x006b, 0x602b,
+	0x402c, 0x012e, 0x0005, 0x00f6, 0x2079, 0x0140, 0x78c3, 0x0080,
+	0x78c3, 0x0083, 0x78c3, 0x0000, 0x00fe, 0x0005, 0x2001, 0x1834,
+	0x2003, 0x0000, 0x2001, 0x1833, 0x2003, 0x0001, 0x0005, 0x0126,
+	0x2091, 0x2800, 0x0006, 0x0016, 0x0026, 0x6124, 0x6028, 0x910c,
+	0x9184, 0x5e2c, 0x1118, 0x9184, 0x0007, 0x002a, 0x9195, 0x0004,
+	0x9284, 0x0007, 0x0002, 0x211e, 0x211b, 0x211b, 0x211b, 0x211d,
+	0x211b, 0x211b, 0x211b, 0x080c, 0x0d65, 0x0029, 0x002e, 0x001e,
+	0x000e, 0x012e, 0x0005, 0x00a6, 0x6124, 0x6028, 0xd09c, 0x0118,
+	0xd19c, 0x1904, 0x237d, 0xd1f4, 0x190c, 0x0d5e, 0x080c, 0x7096,
+	0x0904, 0x217b, 0x080c, 0xbf61, 0x1120, 0x7000, 0x9086, 0x0003,
+	0x0580, 0x6024, 0x9084, 0x1800, 0x0560, 0x080c, 0x70b9, 0x0118,
+	0x080c, 0x70a7, 0x1530, 0x2011, 0x0020, 0x080c, 0x288c, 0x6043,
+	0x0000, 0x080c, 0xbf61, 0x0168, 0x080c, 0x70b9, 0x1150, 0x2001,
+	0x1977, 0x2003, 0x0001, 0x6027, 0x1800, 0x080c, 0x6f0c, 0x0804,
+	0x2380, 0x70a0, 0x9005, 0x1150, 0x70a3, 0x0001, 0x00d6, 0x2069,
+	0x0140, 0x080c, 0x70ed, 0x00de, 0x1904, 0x2380, 0x080c, 0x73a0,
+	0x0428, 0x080c, 0x70b9, 0x1590, 0x6024, 0x9084, 0x1800, 0x1108,
+	0x0468, 0x080c, 0x73a0, 0x080c, 0x7396, 0x080c, 0x5cd7, 0x080c,
+	0x6fc7, 0x0804, 0x237d, 0xd1ac, 0x1508, 0x6024, 0xd0dc, 0x1170,
+	0xd0e4, 0x1178, 0xd0d4, 0x1190, 0xd0cc, 0x0130, 0x7094, 0x9086,
+	0x0028, 0x1110, 0x080c, 0x7279, 0x0804, 0x237d, 0x080c, 0x739b,
+	0x0048, 0x2001, 0x194d, 0x2003, 0x0002, 0x0020, 0x080c, 0x71d7,
+	0x0804, 0x237d, 0x080c, 0x731b, 0x0804, 0x237d, 0xd1ac, 0x0904,
+	0x2297, 0x080c, 0x7096, 0x11d0, 0x2011, 0x0020, 0x080c, 0x288c,
+	0x0006, 0x0026, 0x0036, 0x080c, 0x70b0, 0x1158, 0x080c, 0x7396,
+	0x080c, 0x5cd7, 0x080c, 0x6fc7, 0x003e, 0x002e, 0x000e, 0x00ae,
+	0x0005, 0x003e, 0x002e, 0x000e, 0x080c, 0x706a, 0x0016, 0x0046,
+	0x00c6, 0x644c, 0x9486, 0xf0f0, 0x1138, 0x2061, 0x0100, 0x644a,
+	0x6043, 0x0090, 0x6043, 0x0010, 0x74d6, 0x948c, 0xff00, 0x7038,
+	0xd084, 0x0178, 0x9186, 0xf800, 0x1160, 0x7044, 0xd084, 0x1148,
+	0xc085, 0x7046, 0x0036, 0x2418, 0x2011, 0x8016, 0x080c, 0x48da,
+	0x003e, 0x080c, 0xbf5a, 0x1904, 0x226e, 0x9196, 0xff00, 0x05a8,
+	0x705c, 0x9084, 0x00ff, 0x810f, 0x81ff, 0x0110, 0x9116, 0x0568,
+	0x7130, 0xd184, 0x1550, 0x080c, 0x317a, 0x0128, 0xc18d, 0x7132,
+	0x080c, 0x665e, 0x1510, 0x6240, 0x9294, 0x0010, 0x0130, 0x6248,
+	0x9294, 0xff00, 0x9296, 0xff00, 0x01c0, 0x7030, 0xd08c, 0x0904,
+	0x226e, 0x7038, 0xd08c, 0x1140, 0x2001, 0x180c, 0x200c, 0xd1ac,
+	0x1904, 0x226e, 0xc1ad, 0x2102, 0x0036, 0x73d4, 0x2011, 0x8013,
+	0x080c, 0x48da, 0x003e, 0x0804, 0x226e, 0x7038, 0xd08c, 0x1140,
+	0x2001, 0x180c, 0x200c, 0xd1ac, 0x1904, 0x226e, 0xc1ad, 0x2102,
+	0x0036, 0x73d4, 0x2011, 0x8013, 0x080c, 0x48da, 0x003e, 0x7130,
+	0xc185, 0x7132, 0x2011, 0x1854, 0x220c, 0x00f0, 0x0016, 0x2009,
+	0x0001, 0x2011, 0x0100, 0x080c, 0x83cd, 0x2019, 0x000e, 0x00c6,
+	0x2061, 0x0000, 0x080c, 0xd1fc, 0x00ce, 0x9484, 0x00ff, 0x9080,
+	0x317f, 0x200d, 0x918c, 0xff00, 0x810f, 0x2120, 0x9006, 0x2009,
+	0x000e, 0x080c, 0xd284, 0x001e, 0xd1ac, 0x1148, 0x0016, 0x2009,
+	0x0002, 0x2019, 0x0004, 0x080c, 0x2fd3, 0x001e, 0x0078, 0x0156,
+	0x00b6, 0x20a9, 0x007f, 0x900e, 0x080c, 0x626b, 0x1110, 0x080c,
+	0x5cf1, 0x8108, 0x1f04, 0x2264, 0x00be, 0x015e, 0x00ce, 0x004e,
+	0x080c, 0x98bb, 0x080c, 0x9b60, 0x080c, 0x98d7, 0x60e3, 0x0000,
+	0x001e, 0x2001, 0x1800, 0x2014, 0x9296, 0x0004, 0x1170, 0xd19c,
+	0x11b0, 0x2011, 0x180c, 0x2214, 0xd29c, 0x1120, 0x6204, 0x9295,
+	0x0002, 0x6206, 0x6228, 0xc29d, 0x622a, 0x2003, 0x0001, 0x2001,
+	0x1825, 0x2003, 0x0000, 0x2011, 0x0020, 0x080c, 0x288c, 0xd194,
+	0x0904, 0x237d, 0x0016, 0x080c, 0x98bb, 0x6220, 0xd2b4, 0x0904,
+	0x2325, 0x080c, 0x81ea, 0x080c, 0x8f9c, 0x2011, 0x0004, 0x080c,
+	0x288c, 0x00f6, 0x2019, 0x19c3, 0x2304, 0x907d, 0x0904, 0x22f2,
+	0x7804, 0x9086, 0x0032, 0x15f0, 0x00d6, 0x00c6, 0x00e6, 0x0096,
+	0x2069, 0x0140, 0x782c, 0x685e, 0x7808, 0x685a, 0x6043, 0x0002,
+	0x2001, 0x0003, 0x8001, 0x1df0, 0x6043, 0x0000, 0x2001, 0x003c,
+	0x8001, 0x1df0, 0x080c, 0x2862, 0x2001, 0x001e, 0x8001, 0x0240,
+	0x20a9, 0x0009, 0x080c, 0x2819, 0x6904, 0xd1dc, 0x1140, 0x0cb0,
+	0x2001, 0x0100, 0x080c, 0x2852, 0x9006, 0x080c, 0x2852, 0x080c,
+	0x885d, 0x080c, 0x98d7, 0x7814, 0x2048, 0xa867, 0x0103, 0x2f60,
+	0x080c, 0x9bda, 0x009e, 0x00ee, 0x00ce, 0x00de, 0x00fe, 0x001e,
+	0x00ae, 0x0005, 0x00fe, 0x00d6, 0x2069, 0x0140, 0x6804, 0x9084,
+	0x4000, 0x0110, 0x080c, 0x2862, 0x00de, 0x00c6, 0x2061, 0x19b7,
+	0x6034, 0x080c, 0xbf61, 0x0120, 0x909a, 0x0003, 0x1258, 0x0018,
+	0x909a, 0x00c8, 0x1238, 0x8000, 0x6036, 0x00ce, 0x080c, 0x8f74,
+	0x0804, 0x237a, 0x2061, 0x0100, 0x62c0, 0x080c, 0x97ec, 0x2019,
+	0x19c3, 0x2304, 0x9065, 0x0130, 0x6003, 0x0001, 0x2009, 0x0027,
+	0x080c, 0x9c76, 0x00ce, 0x0804, 0x237a, 0xd2bc, 0x05e0, 0x080c,
+	0x81f7, 0x2011, 0x0004, 0x080c, 0x288c, 0x00d6, 0x2069, 0x0140,
+	0x6804, 0x9084, 0x4000, 0x0110, 0x080c, 0x2862, 0x00de, 0x00c6,
+	0x2061, 0x19b7, 0x6050, 0x080c, 0xbf61, 0x0120, 0x909a, 0x0003,
+	0x1638, 0x0018, 0x909a, 0x00c8, 0x1618, 0x8000, 0x6052, 0x604c,
+	0x00ce, 0x9005, 0x0578, 0x2009, 0x07d0, 0x080c, 0x81ef, 0x9080,
+	0x0008, 0x2004, 0x9086, 0x0006, 0x1138, 0x2009, 0x1984, 0x2011,
+	0x0012, 0x080c, 0x289b, 0x00f0, 0x2009, 0x1984, 0x2011, 0x0016,
+	0x080c, 0x289b, 0x00b8, 0x2011, 0x0004, 0x080c, 0x288c, 0x0090,
+	0x0036, 0x2019, 0x0001, 0x080c, 0x9269, 0x003e, 0x2019, 0x19ca,
+	0x2304, 0x9065, 0x0130, 0x2009, 0x004f, 0x6003, 0x0003, 0x080c,
+	0x9c76, 0x00ce, 0x080c, 0x98d7, 0x001e, 0xd19c, 0x0904, 0x23db,
+	0x7038, 0xd0ac, 0x1538, 0x0016, 0x0156, 0x2011, 0x0008, 0x080c,
+	0x288c, 0x6050, 0xc0e5, 0x6052, 0x20a9, 0x0367, 0x1f04, 0x23a8,
+	0x1d04, 0x2390, 0x080c, 0x821e, 0x6020, 0xd09c, 0x1db8, 0x00f6,
+	0x2079, 0x0100, 0x080c, 0x27c9, 0x00fe, 0x1d80, 0x6050, 0xc0e4,
+	0x6052, 0x2011, 0x0008, 0x080c, 0x288c, 0x015e, 0x001e, 0x0498,
+	0x015e, 0x001e, 0x0016, 0x6028, 0xc09c, 0x602a, 0x080c, 0x98bb,
+	0x080c, 0x9b60, 0x080c, 0x98d7, 0x60e3, 0x0000, 0x080c, 0xd60c,
+	0x080c, 0xd627, 0x080c, 0x538c, 0xd0fc, 0x1138, 0x080c, 0xbf5a,
+	0x1120, 0x9085, 0x0001, 0x080c, 0x70dd, 0x9006, 0x080c, 0x2852,
+	0x2009, 0x0002, 0x080c, 0x283e, 0x00e6, 0x2071, 0x1800, 0x7003,
+	0x0004, 0x080c, 0x0e9c, 0x00ee, 0x2011, 0x0008, 0x080c, 0x288c,
+	0x080c, 0x0bab, 0x001e, 0x918c, 0xffd0, 0x2110, 0x080c, 0x288c,
+	0x00ae, 0x0005, 0x0006, 0x0016, 0x0026, 0x0036, 0x00e6, 0x00f6,
+	0x0126, 0x2091, 0x8000, 0x2071, 0x1800, 0x71cc, 0x70ce, 0x9116,
+	0x0904, 0x2435, 0x81ff, 0x01a0, 0x2009, 0x0000, 0x080c, 0x283e,
+	0x2011, 0x8011, 0x2019, 0x010e, 0x231c, 0x939e, 0x0007, 0x1118,
+	0x2019, 0x0001, 0x0010, 0x2019, 0x0000, 0x080c, 0x48da, 0x0468,
+	0x2001, 0x1978, 0x200c, 0x81ff, 0x1140, 0x2001, 0x0109, 0x2004,
+	0xd0b4, 0x0118, 0x2019, 0x0003, 0x0008, 0x2118, 0x2011, 0x8012,
+	0x080c, 0x48da, 0x080c, 0x0e9c, 0x080c, 0x538c, 0xd0fc, 0x11a8,
+	0x080c, 0xbf5a, 0x1190, 0x00c6, 0x080c, 0x24d1, 0x080c, 0x98bb,
+	0x080c, 0x91c4, 0x080c, 0x98d7, 0x2061, 0x0100, 0x2019, 0x0028,
+	0x2009, 0x0002, 0x080c, 0x2fd3, 0x00ce, 0x012e, 0x00fe, 0x00ee,
+	0x003e, 0x002e, 0x001e, 0x000e, 0x0005, 0x2028, 0x918c, 0x00ff,
+	0x2130, 0x9094, 0xff00, 0x11f0, 0x2011, 0x1836, 0x2214, 0xd2ac,
+	0x11c8, 0x81ff, 0x01e8, 0x2011, 0x181e, 0x2204, 0x9106, 0x1190,
+	0x2011, 0x181f, 0x2214, 0x9294, 0xff00, 0x9584, 0xff00, 0x9206,
+	0x1148, 0x2011, 0x181f, 0x2214, 0x9294, 0x00ff, 0x9584, 0x00ff,
+	0x9206, 0x1120, 0x2500, 0x080c, 0x7d4f, 0x0048, 0x9584, 0x00ff,
+	0x9080, 0x317f, 0x200d, 0x918c, 0xff00, 0x810f, 0x9006, 0x0005,
+	0x9080, 0x317f, 0x200d, 0x918c, 0x00ff, 0x0005, 0x00d6, 0x2069,
+	0x0140, 0x2001, 0x1817, 0x2003, 0x00ef, 0x20a9, 0x0010, 0x9006,
+	0x6852, 0x6856, 0x1f04, 0x2481, 0x00de, 0x0005, 0x0006, 0x00d6,
+	0x0026, 0x2069, 0x0140, 0x2001, 0x1817, 0x2102, 0x8114, 0x8214,
+	0x8214, 0x8214, 0x20a9, 0x0010, 0x6853, 0x0000, 0x9006, 0x82ff,
+	0x1128, 0x9184, 0x000f, 0x9080, 0xd63b, 0x2005, 0x6856, 0x8211,
+	0x1f04, 0x2496, 0x002e, 0x00de, 0x000e, 0x0005, 0x00c6, 0x2061,
+	0x1800, 0x6030, 0x0110, 0xc09d, 0x0008, 0xc09c, 0x6032, 0x00ce,
+	0x0005, 0x0156, 0x00d6, 0x0026, 0x0016, 0x0006, 0x2069, 0x0140,
+	0x6980, 0x9116, 0x0180, 0x9112, 0x1230, 0x8212, 0x8210, 0x22a8,
+	0x2001, 0x0402, 0x0018, 0x22a8, 0x2001, 0x0404, 0x680e, 0x1f04,
+	0x24c6, 0x680f, 0x0000, 0x000e, 0x001e, 0x002e, 0x00de, 0x015e,
+	0x0005, 0x080c, 0x5388, 0xd0c4, 0x0150, 0xd0a4, 0x0140, 0x9006,
+	0x0046, 0x2020, 0x2009, 0x002e, 0x080c, 0xd284, 0x004e, 0x0005,
+	0x00f6, 0x0016, 0x0026, 0x2079, 0x0140, 0x78c4, 0xd0dc, 0x0904,
+	0x253d, 0x080c, 0x27b9, 0x0660, 0x9084, 0x0700, 0x908e, 0x0600,
+	0x1120, 0x2011, 0x4000, 0x900e, 0x0458, 0x908e, 0x0500, 0x1120,
+	0x2011, 0x8000, 0x900e, 0x0420, 0x908e, 0x0400, 0x1120, 0x9016,
+	0x2009, 0x0001, 0x00e8, 0x908e, 0x0300, 0x1120, 0x9016, 0x2009,
+	0x0002, 0x00b0, 0x908e, 0x0200, 0x1120, 0x9016, 0x2009, 0x0004,
+	0x0078, 0x908e, 0x0100, 0x1548, 0x9016, 0x2009, 0x0008, 0x0040,
+	0x9084, 0x0700, 0x908e, 0x0300, 0x1500, 0x2011, 0x0030, 0x0058,
+	0x2300, 0x9080, 0x0020, 0x2018, 0x080c, 0x83fb, 0x928c, 0xff00,
+	0x0110, 0x2011, 0x00ff, 0x2200, 0x8007, 0x9085, 0x004c, 0x78c2,
+	0x2009, 0x0138, 0x220a, 0x080c, 0x7096, 0x1118, 0x2009, 0x193d,
+	0x220a, 0x002e, 0x001e, 0x00fe, 0x0005, 0x78c3, 0x0000, 0x0cc8,
+	0x0126, 0x2091, 0x2800, 0x0006, 0x0016, 0x0026, 0x2001, 0x0170,
+	0x200c, 0x8000, 0x2014, 0x9184, 0x0003, 0x0110, 0x080c, 0x0d5e,
+	0x002e, 0x001e, 0x000e, 0x012e, 0x0005, 0x2001, 0x0171, 0x2004,
+	0xd0dc, 0x0168, 0x2001, 0x0170, 0x200c, 0x918c, 0x00ff, 0x918e,
+	0x004c, 0x1128, 0x200c, 0x918c, 0xff00, 0x810f, 0x0005, 0x900e,
+	0x2001, 0x0227, 0x2004, 0x8007, 0x9084, 0x00ff, 0x8004, 0x9108,
+	0x2001, 0x0226, 0x2004, 0x8007, 0x9084, 0x00ff, 0x8004, 0x9108,
+	0x0005, 0x0018, 0x000c, 0x0018, 0x0020, 0x1000, 0x0800, 0x1000,
+	0x1800, 0x0156, 0x0006, 0x0016, 0x0026, 0x00e6, 0x2001, 0x1960,
+	0x2004, 0x908a, 0x0007, 0x1a0c, 0x0d65, 0x0033, 0x00ee, 0x002e,
+	0x001e, 0x000e, 0x015e, 0x0005, 0x259b, 0x25b9, 0x25dd, 0x25df,
+	0x2608, 0x260a, 0x260c, 0x2001, 0x0001, 0x080c, 0x23e2, 0x080c,
+	0x2803, 0x2001, 0x1962, 0x2003, 0x0000, 0x7828, 0x9084, 0xe1d7,
+	0x782a, 0x9006, 0x20a9, 0x0009, 0x080c, 0x27d5, 0x2001, 0x1960,
+	0x2003, 0x0006, 0x2009, 0x001e, 0x2011, 0x260d, 0x080c, 0x81fc,
+	0x0005, 0x2009, 0x1965, 0x200b, 0x0000, 0x2001, 0x196a, 0x2003,
+	0x0036, 0x2001, 0x1969, 0x2003, 0x002a, 0x2001, 0x1962, 0x2003,
+	0x0001, 0x9006, 0x080c, 0x276a, 0x2001, 0xffff, 0x20a9, 0x0009,
+	0x080c, 0x27d5, 0x2001, 0x1960, 0x2003, 0x0006, 0x2009, 0x001e,
+	0x2011, 0x260d, 0x080c, 0x81fc, 0x0005, 0x080c, 0x0d65, 0x2001,
+	0x196a, 0x2003, 0x0036, 0x2001, 0x1962, 0x2003, 0x0003, 0x7a38,
+	0x9294, 0x0005, 0x9296, 0x0004, 0x0110, 0x9006, 0x0010, 0x2001,
+	0x0001, 0x080c, 0x276a, 0x2001, 0x1966, 0x2003, 0x0000, 0x2001,
+	0xffff, 0x20a9, 0x0009, 0x080c, 0x27d5, 0x2001, 0x1960, 0x2003,
+	0x0006, 0x2009, 0x001e, 0x2011, 0x260d, 0x080c, 0x81fc, 0x0005,
+	0x080c, 0x0d65, 0x080c, 0x0d65, 0x0005, 0x0006, 0x0016, 0x0026,
+	0x00e6, 0x00f6, 0x0156, 0x0126, 0x2091, 0x8000, 0x2079, 0x0100,
+	0x2001, 0x1962, 0x2004, 0x908a, 0x0007, 0x1a0c, 0x0d65, 0x0043,
+	0x012e, 0x015e, 0x00fe, 0x00ee, 0x002e, 0x001e, 0x000e, 0x0005,
+	0x262f, 0x264f, 0x268f, 0x26bf, 0x26e3, 0x26f3, 0x26f5, 0x080c,
+	0x27c9, 0x11b0, 0x7850, 0x9084, 0xefff, 0x7852, 0x2009, 0x1968,
+	0x2104, 0x7a38, 0x9294, 0x0005, 0x9296, 0x0004, 0x0110, 0xc08d,
+	0x0008, 0xc085, 0x200a, 0x2001, 0x1960, 0x2003, 0x0001, 0x0030,
+	0x080c, 0x2719, 0x2001, 0xffff, 0x080c, 0x25aa, 0x0005, 0x080c,
+	0x26f7, 0x05e0, 0x2009, 0x1969, 0x2104, 0x8001, 0x200a, 0x080c,
+	0x27c9, 0x1178, 0x7850, 0x9084, 0xefff, 0x7852, 0x7a38, 0x9294,
+	0x0005, 0x9296, 0x0005, 0x0518, 0x2009, 0x1968, 0x2104, 0xc085,
+	0x200a, 0x2009, 0x1965, 0x2104, 0x8000, 0x200a, 0x9086, 0x0005,
+	0x0118, 0x080c, 0x26ff, 0x00c0, 0x200b, 0x0000, 0x7a38, 0x9294,
+	0x0006, 0x9296, 0x0004, 0x0110, 0x9006, 0x0010, 0x2001, 0x0001,
+	0x080c, 0x2787, 0x2001, 0x1962, 0x2003, 0x0002, 0x0028, 0x2001,
+	0x1960, 0x2003, 0x0003, 0x0010, 0x080c, 0x25cc, 0x0005, 0x080c,
+	0x26f7, 0x0560, 0x2009, 0x1969, 0x2104, 0x8001, 0x200a, 0x080c,
+	0x27c9, 0x1168, 0x7850, 0x9084, 0xefff, 0x7852, 0x2001, 0x1960,
+	0x2003, 0x0003, 0x2001, 0x1961, 0x2003, 0x0000, 0x00b8, 0x2009,
+	0x1969, 0x2104, 0x9005, 0x1118, 0x080c, 0x273c, 0x0010, 0x080c,
+	0x270c, 0x080c, 0x26ff, 0x2009, 0x1965, 0x200b, 0x0000, 0x2001,
+	0x1962, 0x2003, 0x0001, 0x080c, 0x25cc, 0x0000, 0x0005, 0x04b9,
+	0x0508, 0x080c, 0x27c9, 0x11b8, 0x7850, 0x9084, 0xefff, 0x7852,
+	0x2009, 0x1966, 0x2104, 0x8000, 0x200a, 0x9086, 0x0007, 0x0108,
+	0x0078, 0x2001, 0x196b, 0x2003, 0x000a, 0x2009, 0x1968, 0x2104,
+	0xc0fd, 0x200a, 0x0038, 0x0419, 0x2001, 0x1962, 0x2003, 0x0004,
+	0x080c, 0x25f7, 0x0005, 0x0099, 0x0168, 0x080c, 0x27c9, 0x1138,
+	0x7850, 0x9084, 0xefff, 0x7852, 0x080c, 0x25e3, 0x0018, 0x0079,
+	0x080c, 0x25f7, 0x0005, 0x080c, 0x0d65, 0x080c, 0x0d65, 0x2009,
+	0x196a, 0x2104, 0x8001, 0x200a, 0x090c, 0x2758, 0x0005, 0x7a38,
+	0x9294, 0x0005, 0x9296, 0x0005, 0x0110, 0x9006, 0x0010, 0x2001,
+	0x0001, 0x080c, 0x2787, 0x0005, 0x7a38, 0x9294, 0x0006, 0x9296,
+	0x0006, 0x0110, 0x9006, 0x0010, 0x2001, 0x0001, 0x080c, 0x276a,
+	0x0005, 0x2009, 0x1965, 0x2104, 0x8000, 0x200a, 0x9086, 0x0005,
+	0x0108, 0x0068, 0x200b, 0x0000, 0x7a38, 0x9294, 0x0006, 0x9296,
+	0x0006, 0x0110, 0x9006, 0x0010, 0x2001, 0x0001, 0x04d9, 0x7a38,
+	0x9294, 0x0005, 0x9296, 0x0005, 0x0110, 0x9006, 0x0010, 0x2001,
+	0x0001, 0x080c, 0x2787, 0x0005, 0x0086, 0x2001, 0x1968, 0x2004,
+	0x9084, 0x7fff, 0x090c, 0x0d65, 0x2009, 0x1967, 0x2144, 0x8846,
+	0x280a, 0x9844, 0x0dd8, 0xd08c, 0x1120, 0xd084, 0x1120, 0x080c,
+	0x0d65, 0x9006, 0x0010, 0x2001, 0x0001, 0x00a1, 0x008e, 0x0005,
+	0x0006, 0x0156, 0x2001, 0x1960, 0x20a9, 0x0009, 0x2003, 0x0000,
+	0x8000, 0x1f04, 0x275e, 0x2001, 0x1967, 0x2003, 0x8000, 0x015e,
+	0x000e, 0x0005, 0x00f6, 0x2079, 0x0100, 0x9085, 0x0000, 0x0158,
+	0x7838, 0x9084, 0xfff9, 0x9085, 0x0004, 0x783a, 0x2009, 0x196d,
+	0x210c, 0x795a, 0x0050, 0x7838, 0x9084, 0xfffb, 0x9085, 0x0006,
+	0x783a, 0x2009, 0x196e, 0x210c, 0x795a, 0x00fe, 0x0005, 0x00f6,
+	0x2079, 0x0100, 0x9085, 0x0000, 0x0158, 0x7838, 0x9084, 0xfffa,
+	0x9085, 0x0004, 0x783a, 0x7850, 0x9084, 0xfff0, 0x7852, 0x00f8,
+	0x7838, 0x9084, 0xfffb, 0x9085, 0x0005, 0x783a, 0x7850, 0x9084,
+	0xfff0, 0x0016, 0x2009, 0x017f, 0x210c, 0x918e, 0x0005, 0x0140,
+	0x2009, 0x0003, 0x210c, 0x918c, 0x0600, 0x918e, 0x0400, 0x0118,
+	0x9085, 0x000a, 0x0010, 0x9085, 0x0000, 0x001e, 0x7852, 0x00fe,
+	0x0005, 0x0006, 0x2001, 0x0100, 0x2004, 0x9082, 0x0007, 0x000e,
+	0x0005, 0x0006, 0x2001, 0x0100, 0x2004, 0x9082, 0x0009, 0x000e,
+	0x0005, 0x0156, 0x20a9, 0x0064, 0x7820, 0x080c, 0x2838, 0xd09c,
+	0x1110, 0x1f04, 0x27cc, 0x015e, 0x0005, 0x0126, 0x0016, 0x0006,
+	0x2091, 0x8000, 0x000e, 0x2008, 0x9186, 0x0000, 0x1118, 0x783b,
+	0x0007, 0x0090, 0x9186, 0x0001, 0x1118, 0x783b, 0x0006, 0x0060,
+	0x9186, 0x0002, 0x1118, 0x783b, 0x0005, 0x0030, 0x9186, 0x0003,
+	0x1118, 0x783b, 0x0004, 0x0000, 0x0006, 0x1d04, 0x27f5, 0x080c,
+	0x821e, 0x1f04, 0x27f5, 0x7850, 0x9085, 0x1000, 0x7852, 0x000e,
+	0x001e, 0x012e, 0x0005, 0x080c, 0x28e2, 0x0005, 0x0006, 0x0156,
+	0x00f6, 0x2079, 0x0100, 0x20a9, 0x000a, 0x7854, 0xd0ac, 0x1100,
+	0x7854, 0xd08c, 0x1110, 0x1f04, 0x2810, 0x00fe, 0x015e, 0x000e,
+	0x0005, 0x1d04, 0x2819, 0x080c, 0x821e, 0x1f04, 0x2819, 0x0005,
+	0x0006, 0x2001, 0x196c, 0x2004, 0x9086, 0x0000, 0x000e, 0x0005,
+	0x0006, 0x2001, 0x196c, 0x2004, 0x9086, 0x0001, 0x000e, 0x0005,
+	0x0006, 0x2001, 0x196c, 0x2004, 0x9086, 0x0002, 0x000e, 0x0005,
+	0xa001, 0xa001, 0xa001, 0xa001, 0xa001, 0x0005, 0x0006, 0x2001,
+	0x1978, 0x2102, 0x000e, 0x0005, 0x2009, 0x0171, 0x2104, 0xd0dc,
+	0x0140, 0x2009, 0x0170, 0x2104, 0x200b, 0x0080, 0xa001, 0xa001,
+	0x200a, 0x0005, 0x0016, 0x0026, 0x080c, 0x70b0, 0x0108, 0xc0bc,
+	0x2009, 0x0140, 0x2114, 0x9294, 0x0001, 0x9215, 0x220a, 0x002e,
+	0x001e, 0x0005, 0x0016, 0x0026, 0x2009, 0x0140, 0x2114, 0x9294,
+	0x0001, 0x9285, 0x1000, 0x200a, 0x220a, 0x002e, 0x001e, 0x0005,
+	0x0016, 0x0026, 0x2009, 0x0140, 0x2114, 0x9294, 0x0001, 0x9215,
+	0x220a, 0x002e, 0x001e, 0x0005, 0x0006, 0x0016, 0x2009, 0x0140,
+	0x2104, 0x1128, 0x080c, 0x70b0, 0x0110, 0xc0bc, 0x0008, 0xc0bd,
+	0x200a, 0x001e, 0x000e, 0x0005, 0x00f6, 0x2079, 0x0380, 0x7843,
+	0x0101, 0x7844, 0xd084, 0x1de8, 0x2001, 0x0109, 0x2202, 0x7843,
+	0x0100, 0x00fe, 0x0005, 0x00f6, 0x2079, 0x0380, 0x7843, 0x0202,
+	0x7844, 0xd08c, 0x1de8, 0x2079, 0x0100, 0x7814, 0x9104, 0x9205,
+	0x7a16, 0x2079, 0x0380, 0x7843, 0x0200, 0x00fe, 0x0005, 0x0016,
+	0x0026, 0x0036, 0x00c6, 0x2061, 0x0100, 0x6050, 0x9084, 0xfbff,
+	0x9085, 0x0040, 0x6052, 0x20a9, 0x0002, 0x080c, 0x2819, 0x6050,
+	0x9085, 0x0400, 0x9084, 0xff9f, 0x6052, 0x20a9, 0x0005, 0x080c,
+	0x2819, 0x6054, 0xd0bc, 0x090c, 0x0d65, 0x20a9, 0x0005, 0x080c,
+	0x2819, 0x6054, 0xd0ac, 0x090c, 0x0d65, 0x2009, 0x197f, 0x9084,
+	0x7e00, 0x8007, 0x8004, 0x8004, 0x200a, 0x00ce, 0x003e, 0x002e,
+	0x001e, 0x0005, 0x0006, 0x00c6, 0x2061, 0x0100, 0x6050, 0xc0cd,
+	0x6052, 0x00ce, 0x000e, 0x0005, 0x2de8, 0x2de8, 0x29ec, 0x29ec,
+	0x29f8, 0x29f8, 0x2a04, 0x2a04, 0x2a12, 0x2a12, 0x2a1e, 0x2a1e,
+	0x2a2c, 0x2a2c, 0x2a3a, 0x2a3a, 0x2a4c, 0x2a4c, 0x2a58, 0x2a58,
+	0x2a66, 0x2a66, 0x2a84, 0x2a84, 0x2aa4, 0x2aa4, 0x2a74, 0x2a74,
+	0x2a94, 0x2a94, 0x2ab2, 0x2ab2, 0x2a4a, 0x2a4a, 0x2a4a, 0x2a4a,
+	0x2a4a, 0x2a4a, 0x2a4a, 0x2a4a, 0x2a4a, 0x2a4a, 0x2a4a, 0x2a4a,
+	0x2a4a, 0x2a4a, 0x2a4a, 0x2a4a, 0x2a4a, 0x2a4a, 0x2a4a, 0x2a4a,
+	0x2a4a, 0x2a4a, 0x2a4a, 0x2a4a, 0x2a4a, 0x2a4a, 0x2a4a, 0x2a4a,
+	0x2a4a, 0x2a4a, 0x2a4a, 0x2a4a, 0x2ac4, 0x2ac4, 0x2ad0, 0x2ad0,
+	0x2ade, 0x2ade, 0x2aec, 0x2aec, 0x2afc, 0x2afc, 0x2b0a, 0x2b0a,
+	0x2b1a, 0x2b1a, 0x2b2a, 0x2b2a, 0x2b3c, 0x2b3c, 0x2b4a, 0x2b4a,
+	0x2b5a, 0x2b5a, 0x2b7c, 0x2b7c, 0x2ba0, 0x2ba0, 0x2b6a, 0x2b6a,
+	0x2b8e, 0x2b8e, 0x2bb0, 0x2bb0, 0x2a4a, 0x2a4a, 0x2a4a, 0x2a4a,
+	0x2a4a, 0x2a4a, 0x2a4a, 0x2a4a, 0x2a4a, 0x2a4a, 0x2a4a, 0x2a4a,
+	0x2a4a, 0x2a4a, 0x2a4a, 0x2a4a, 0x2a4a, 0x2a4a, 0x2a4a, 0x2a4a,
+	0x2a4a, 0x2a4a, 0x2a4a, 0x2a4a, 0x2a4a, 0x2a4a, 0x2a4a, 0x2a4a,
+	0x2a4a, 0x2a4a, 0x2a4a, 0x2a4a, 0x2bc4, 0x2bc4, 0x2bd0, 0x2bd0,
+	0x2bde, 0x2bde, 0x2bec, 0x2bec, 0x2bfc, 0x2bfc, 0x2c0a, 0x2c0a,
+	0x2c1a, 0x2c1a, 0x2c2a, 0x2c2a, 0x2c3c, 0x2c3c, 0x2c4a, 0x2c4a,
+	0x2c5a, 0x2c5a, 0x2c6a, 0x2c6a, 0x2c7c, 0x2c7c, 0x2c8c, 0x2c8c,
+	0x2c9e, 0x2c9e, 0x2cb0, 0x2cb0, 0x2a4a, 0x2a4a, 0x2a4a, 0x2a4a,
+	0x2a4a, 0x2a4a, 0x2a4a, 0x2a4a, 0x2a4a, 0x2a4a, 0x2a4a, 0x2a4a,
+	0x2a4a, 0x2a4a, 0x2a4a, 0x2a4a, 0x2a4a, 0x2a4a, 0x2a4a, 0x2a4a,
+	0x2a4a, 0x2a4a, 0x2a4a, 0x2a4a, 0x2a4a, 0x2a4a, 0x2a4a, 0x2a4a,
+	0x2a4a, 0x2a4a, 0x2a4a, 0x2a4a, 0x2cc4, 0x2cc4, 0x2cd2, 0x2cd2,
+	0x2ce2, 0x2ce2, 0x2cf2, 0x2cf2, 0x2d04, 0x2d04, 0x2d14, 0x2d14,
+	0x2d26, 0x2d26, 0x2d38, 0x2d38, 0x2d4c, 0x2d4c, 0x2d5c, 0x2d5c,
+	0x2d6e, 0x2d6e, 0x2d80, 0x2d80, 0x2d94, 0x2d94, 0x2da5, 0x2da5,
+	0x2db8, 0x2db8, 0x2dcb, 0x2dcb, 0x2a4a, 0x2a4a, 0x2a4a, 0x2a4a,
+	0x2a4a, 0x2a4a, 0x2a4a, 0x2a4a, 0x2a4a, 0x2a4a, 0x2a4a, 0x2a4a,
+	0x2a4a, 0x2a4a, 0x2a4a, 0x2a4a, 0x2a4a, 0x2a4a, 0x2a4a, 0x2a4a,
+	0x2a4a, 0x2a4a, 0x2a4a, 0x2a4a, 0x2a4a, 0x2a4a, 0x2a4a, 0x2a4a,
+	0x2a4a, 0x2a4a, 0x2a4a, 0x2a4a, 0x0106, 0x0006, 0x0126, 0x01c6,
+	0x01d6, 0x0136, 0x0146, 0x0156, 0x080c, 0x20ff, 0x0804, 0x2de0,
 	0x0106, 0x0006, 0x0126, 0x01c6, 0x01d6, 0x0136, 0x0146, 0x0156,
-	0x080c, 0x20e6, 0x080c, 0x1f4a, 0x0804, 0x2dd2, 0x0106, 0x0006,
-	0x0126, 0x01c6, 0x01d6, 0x0136, 0x0146, 0x0156, 0x080c, 0x1f20,
-	0x080c, 0x1f4a, 0x0804, 0x2dd2, 0x0106, 0x0006, 0x0126, 0x01c6,
-	0x01d6, 0x0136, 0x0146, 0x0156, 0x080c, 0x1f20, 0x080c, 0x20e6,
-	0x080c, 0x1f4a, 0x0804, 0x2dd2, 0xa001, 0x0cf0, 0x0106, 0x0006,
-	0x0126, 0x01c6, 0x01d6, 0x0136, 0x0146, 0x0156, 0x080c, 0x132a,
-	0x0804, 0x2dd2, 0x0106, 0x0006, 0x0126, 0x01c6, 0x01d6, 0x0136,
-	0x0146, 0x0156, 0x080c, 0x20e6, 0x080c, 0x132a, 0x0804, 0x2dd2,
+	0x080c, 0x1f2d, 0x0804, 0x2de0, 0x0106, 0x0006, 0x0126, 0x01c6,
+	0x01d6, 0x0136, 0x0146, 0x0156, 0x080c, 0x1f2d, 0x080c, 0x20ff,
+	0x0804, 0x2de0, 0x0106, 0x0006, 0x0126, 0x01c6, 0x01d6, 0x0136,
+	0x0146, 0x0156, 0x080c, 0x1f57, 0x0804, 0x2de0, 0x0106, 0x0006,
+	0x0126, 0x01c6, 0x01d6, 0x0136, 0x0146, 0x0156, 0x080c, 0x20ff,
+	0x080c, 0x1f57, 0x0804, 0x2de0, 0x0106, 0x0006, 0x0126, 0x01c6,
+	0x01d6, 0x0136, 0x0146, 0x0156, 0x080c, 0x1f2d, 0x080c, 0x1f57,
+	0x0804, 0x2de0, 0x0106, 0x0006, 0x0126, 0x01c6, 0x01d6, 0x0136,
+	0x0146, 0x0156, 0x080c, 0x1f2d, 0x080c, 0x20ff, 0x080c, 0x1f57,
+	0x0804, 0x2de0, 0xa001, 0x0cf0, 0x0106, 0x0006, 0x0126, 0x01c6,
+	0x01d6, 0x0136, 0x0146, 0x0156, 0x080c, 0x1335, 0x0804, 0x2de0,
 	0x0106, 0x0006, 0x0126, 0x01c6, 0x01d6, 0x0136, 0x0146, 0x0156,
-	0x080c, 0x1f20, 0x080c, 0x132a, 0x0804, 0x2dd2, 0x0106, 0x0006,
-	0x0126, 0x01c6, 0x01d6, 0x0136, 0x0146, 0x0156, 0x080c, 0x20e6,
-	0x080c, 0x132a, 0x080c, 0x1f4a, 0x0804, 0x2dd2, 0x0106, 0x0006,
-	0x0126, 0x01c6, 0x01d6, 0x0136, 0x0146, 0x0156, 0x080c, 0x1f20,
-	0x080c, 0x20e6, 0x080c, 0x132a, 0x0804, 0x2dd2, 0x0106, 0x0006,
-	0x0126, 0x01c6, 0x01d6, 0x0136, 0x0146, 0x0156, 0x080c, 0x1f20,
-	0x080c, 0x132a, 0x080c, 0x1f4a, 0x0804, 0x2dd2, 0x0106, 0x0006,
-	0x0126, 0x01c6, 0x01d6, 0x0136, 0x0146, 0x0156, 0x080c, 0x132a,
-	0x080c, 0x1f4a, 0x0804, 0x2dd2, 0x0106, 0x0006, 0x0126, 0x01c6,
-	0x01d6, 0x0136, 0x0146, 0x0156, 0x080c, 0x1f20, 0x080c, 0x20e6,
-	0x080c, 0x132a, 0x080c, 0x1f4a, 0x0804, 0x2dd2, 0x0106, 0x0006,
-	0x0126, 0x01c6, 0x01d6, 0x0136, 0x0146, 0x0156, 0x080c, 0x2527,
-	0x0804, 0x2dd2, 0x0106, 0x0006, 0x0126, 0x01c6, 0x01d6, 0x0136,
-	0x0146, 0x0156, 0x080c, 0x2527, 0x080c, 0x20e6, 0x0804, 0x2dd2,
+	0x080c, 0x20ff, 0x080c, 0x1335, 0x0804, 0x2de0, 0x0106, 0x0006,
+	0x0126, 0x01c6, 0x01d6, 0x0136, 0x0146, 0x0156, 0x080c, 0x1f2d,
+	0x080c, 0x1335, 0x0804, 0x2de0, 0x0106, 0x0006, 0x0126, 0x01c6,
+	0x01d6, 0x0136, 0x0146, 0x0156, 0x080c, 0x20ff, 0x080c, 0x1335,
+	0x080c, 0x1f57, 0x0804, 0x2de0, 0x0106, 0x0006, 0x0126, 0x01c6,
+	0x01d6, 0x0136, 0x0146, 0x0156, 0x080c, 0x1f2d, 0x080c, 0x20ff,
+	0x080c, 0x1335, 0x0804, 0x2de0, 0x0106, 0x0006, 0x0126, 0x01c6,
+	0x01d6, 0x0136, 0x0146, 0x0156, 0x080c, 0x1f2d, 0x080c, 0x1335,
+	0x080c, 0x1f57, 0x0804, 0x2de0, 0x0106, 0x0006, 0x0126, 0x01c6,
+	0x01d6, 0x0136, 0x0146, 0x0156, 0x080c, 0x1335, 0x080c, 0x1f57,
+	0x0804, 0x2de0, 0x0106, 0x0006, 0x0126, 0x01c6, 0x01d6, 0x0136,
+	0x0146, 0x0156, 0x080c, 0x1f2d, 0x080c, 0x20ff, 0x080c, 0x1335,
+	0x080c, 0x1f57, 0x0804, 0x2de0, 0x0106, 0x0006, 0x0126, 0x01c6,
+	0x01d6, 0x0136, 0x0146, 0x0156, 0x080c, 0x2540, 0x0804, 0x2de0,
 	0x0106, 0x0006, 0x0126, 0x01c6, 0x01d6, 0x0136, 0x0146, 0x0156,
-	0x080c, 0x2527, 0x080c, 0x1f20, 0x0804, 0x2dd2, 0x0106, 0x0006,
-	0x0126, 0x01c6, 0x01d6, 0x0136, 0x0146, 0x0156, 0x080c, 0x2527,
-	0x080c, 0x1f20, 0x080c, 0x20e6, 0x0804, 0x2dd2, 0x0106, 0x0006,
-	0x0126, 0x01c6, 0x01d6, 0x0136, 0x0146, 0x0156, 0x080c, 0x2527,
-	0x080c, 0x1f4a, 0x0804, 0x2dd2, 0x0106, 0x0006, 0x0126, 0x01c6,
-	0x01d6, 0x0136, 0x0146, 0x0156, 0x080c, 0x2527, 0x080c, 0x20e6,
-	0x080c, 0x1f4a, 0x0804, 0x2dd2, 0x0106, 0x0006, 0x0126, 0x01c6,
-	0x01d6, 0x0136, 0x0146, 0x0156, 0x080c, 0x2527, 0x080c, 0x1f20,
-	0x080c, 0x1f4a, 0x0804, 0x2dd2, 0x0106, 0x0006, 0x0126, 0x01c6,
-	0x01d6, 0x0136, 0x0146, 0x0156, 0x080c, 0x2527, 0x080c, 0x1f20,
-	0x080c, 0x20e6, 0x080c, 0x1f4a, 0x0804, 0x2dd2, 0x0106, 0x0006,
-	0x0126, 0x01c6, 0x01d6, 0x0136, 0x0146, 0x0156, 0x080c, 0x2527,
-	0x080c, 0x132a, 0x0804, 0x2dd2, 0x0106, 0x0006, 0x0126, 0x01c6,
-	0x01d6, 0x0136, 0x0146, 0x0156, 0x080c, 0x2527, 0x080c, 0x20e6,
-	0x080c, 0x132a, 0x0804, 0x2dd2, 0x0106, 0x0006, 0x0126, 0x01c6,
-	0x01d6, 0x0136, 0x0146, 0x0156, 0x080c, 0x2527, 0x080c, 0x1f20,
-	0x080c, 0x132a, 0x0804, 0x2dd2, 0x0106, 0x0006, 0x0126, 0x01c6,
-	0x01d6, 0x0136, 0x0146, 0x0156, 0x080c, 0x2527, 0x080c, 0x20e6,
-	0x080c, 0x132a, 0x080c, 0x1f4a, 0x0804, 0x2dd2, 0x0106, 0x0006,
-	0x0126, 0x01c6, 0x01d6, 0x0136, 0x0146, 0x0156, 0x080c, 0x2527,
-	0x080c, 0x1f20, 0x080c, 0x20e6, 0x080c, 0x132a, 0x0804, 0x2dd2,
+	0x080c, 0x2540, 0x080c, 0x20ff, 0x0804, 0x2de0, 0x0106, 0x0006,
+	0x0126, 0x01c6, 0x01d6, 0x0136, 0x0146, 0x0156, 0x080c, 0x2540,
+	0x080c, 0x1f2d, 0x0804, 0x2de0, 0x0106, 0x0006, 0x0126, 0x01c6,
+	0x01d6, 0x0136, 0x0146, 0x0156, 0x080c, 0x2540, 0x080c, 0x1f2d,
+	0x080c, 0x20ff, 0x0804, 0x2de0, 0x0106, 0x0006, 0x0126, 0x01c6,
+	0x01d6, 0x0136, 0x0146, 0x0156, 0x080c, 0x2540, 0x080c, 0x1f57,
+	0x0804, 0x2de0, 0x0106, 0x0006, 0x0126, 0x01c6, 0x01d6, 0x0136,
+	0x0146, 0x0156, 0x080c, 0x2540, 0x080c, 0x20ff, 0x080c, 0x1f57,
+	0x0804, 0x2de0, 0x0106, 0x0006, 0x0126, 0x01c6, 0x01d6, 0x0136,
+	0x0146, 0x0156, 0x080c, 0x2540, 0x080c, 0x1f2d, 0x080c, 0x1f57,
+	0x0804, 0x2de0, 0x0106, 0x0006, 0x0126, 0x01c6, 0x01d6, 0x0136,
+	0x0146, 0x0156, 0x080c, 0x2540, 0x080c, 0x1f2d, 0x080c, 0x20ff,
+	0x080c, 0x1f57, 0x0804, 0x2de0, 0x0106, 0x0006, 0x0126, 0x01c6,
+	0x01d6, 0x0136, 0x0146, 0x0156, 0x080c, 0x2540, 0x080c, 0x1335,
+	0x0804, 0x2de0, 0x0106, 0x0006, 0x0126, 0x01c6, 0x01d6, 0x0136,
+	0x0146, 0x0156, 0x080c, 0x2540, 0x080c, 0x20ff, 0x080c, 0x1335,
+	0x0804, 0x2de0, 0x0106, 0x0006, 0x0126, 0x01c6, 0x01d6, 0x0136,
+	0x0146, 0x0156, 0x080c, 0x2540, 0x080c, 0x1f2d, 0x080c, 0x1335,
+	0x0804, 0x2de0, 0x0106, 0x0006, 0x0126, 0x01c6, 0x01d6, 0x0136,
+	0x0146, 0x0156, 0x080c, 0x2540, 0x080c, 0x20ff, 0x080c, 0x1335,
+	0x080c, 0x1f57, 0x0804, 0x2de0, 0x0106, 0x0006, 0x0126, 0x01c6,
+	0x01d6, 0x0136, 0x0146, 0x0156, 0x080c, 0x2540, 0x080c, 0x1f2d,
+	0x080c, 0x20ff, 0x080c, 0x1335, 0x0804, 0x2de0, 0x0106, 0x0006,
+	0x0126, 0x01c6, 0x01d6, 0x0136, 0x0146, 0x0156, 0x080c, 0x2540,
+	0x080c, 0x1f2d, 0x080c, 0x1335, 0x080c, 0x1f57, 0x0804, 0x2de0,
 	0x0106, 0x0006, 0x0126, 0x01c6, 0x01d6, 0x0136, 0x0146, 0x0156,
-	0x080c, 0x2527, 0x080c, 0x1f20, 0x080c, 0x132a, 0x080c, 0x1f4a,
-	0x0804, 0x2dd2, 0x0106, 0x0006, 0x0126, 0x01c6, 0x01d6, 0x0136,
-	0x0146, 0x0156, 0x080c, 0x2527, 0x080c, 0x132a, 0x080c, 0x1f4a,
-	0x0804, 0x2dd2, 0x0106, 0x0006, 0x0126, 0x01c6, 0x01d6, 0x0136,
-	0x0146, 0x0156, 0x080c, 0x2527, 0x080c, 0x1f20, 0x080c, 0x20e6,
-	0x080c, 0x132a, 0x080c, 0x1f4a, 0x0804, 0x2dd2, 0x0106, 0x0006,
-	0x0126, 0x01c6, 0x01d6, 0x0136, 0x0146, 0x0156, 0x080c, 0x992e,
-	0x0804, 0x2dd2, 0x0106, 0x0006, 0x0126, 0x01c6, 0x01d6, 0x0136,
-	0x0146, 0x0156, 0x080c, 0x992e, 0x080c, 0x20e6, 0x0804, 0x2dd2,
+	0x080c, 0x2540, 0x080c, 0x1335, 0x080c, 0x1f57, 0x0804, 0x2de0,
 	0x0106, 0x0006, 0x0126, 0x01c6, 0x01d6, 0x0136, 0x0146, 0x0156,
-	0x080c, 0x1f20, 0x080c, 0x992e, 0x0804, 0x2dd2, 0x0106, 0x0006,
-	0x0126, 0x01c6, 0x01d6, 0x0136, 0x0146, 0x0156, 0x080c, 0x1f20,
-	0x080c, 0x992e, 0x080c, 0x20e6, 0x0804, 0x2dd2, 0x0106, 0x0006,
-	0x0126, 0x01c6, 0x01d6, 0x0136, 0x0146, 0x0156, 0x080c, 0x992e,
-	0x080c, 0x1f4a, 0x0804, 0x2dd2, 0x0106, 0x0006, 0x0126, 0x01c6,
-	0x01d6, 0x0136, 0x0146, 0x0156, 0x080c, 0x992e, 0x080c, 0x20e6,
-	0x080c, 0x1f4a, 0x0804, 0x2dd2, 0x0106, 0x0006, 0x0126, 0x01c6,
-	0x01d6, 0x0136, 0x0146, 0x0156, 0x080c, 0x1f20, 0x080c, 0x992e,
-	0x080c, 0x1f4a, 0x0804, 0x2dd2, 0x0106, 0x0006, 0x0126, 0x01c6,
-	0x01d6, 0x0136, 0x0146, 0x0156, 0x080c, 0x1f20, 0x080c, 0x992e,
-	0x080c, 0x20e6, 0x080c, 0x1f4a, 0x0804, 0x2dd2, 0x0106, 0x0006,
-	0x0126, 0x01c6, 0x01d6, 0x0136, 0x0146, 0x0156, 0x080c, 0x992e,
-	0x080c, 0x132a, 0x0804, 0x2dd2, 0x0106, 0x0006, 0x0126, 0x01c6,
-	0x01d6, 0x0136, 0x0146, 0x0156, 0x080c, 0x992e, 0x080c, 0x20e6,
-	0x080c, 0x132a, 0x0804, 0x2dd2, 0x0106, 0x0006, 0x0126, 0x01c6,
-	0x01d6, 0x0136, 0x0146, 0x0156, 0x080c, 0x1f20, 0x080c, 0x992e,
-	0x080c, 0x132a, 0x0804, 0x2dd2, 0x0106, 0x0006, 0x0126, 0x01c6,
-	0x01d6, 0x0136, 0x0146, 0x0156, 0x080c, 0x1f20, 0x080c, 0x992e,
-	0x080c, 0x20e6, 0x080c, 0x132a, 0x0804, 0x2dd2, 0x0106, 0x0006,
-	0x0126, 0x01c6, 0x01d6, 0x0136, 0x0146, 0x0156, 0x080c, 0x992e,
-	0x080c, 0x132a, 0x080c, 0x1f4a, 0x0804, 0x2dd2, 0x0106, 0x0006,
-	0x0126, 0x01c6, 0x01d6, 0x0136, 0x0146, 0x0156, 0x080c, 0x992e,
-	0x080c, 0x20e6, 0x080c, 0x132a, 0x080c, 0x1f4a, 0x0804, 0x2dd2,
+	0x080c, 0x2540, 0x080c, 0x1f2d, 0x080c, 0x20ff, 0x080c, 0x1335,
+	0x080c, 0x1f57, 0x0804, 0x2de0, 0x0106, 0x0006, 0x0126, 0x01c6,
+	0x01d6, 0x0136, 0x0146, 0x0156, 0x080c, 0x9921, 0x0804, 0x2de0,
 	0x0106, 0x0006, 0x0126, 0x01c6, 0x01d6, 0x0136, 0x0146, 0x0156,
-	0x080c, 0x1f20, 0x080c, 0x992e, 0x080c, 0x132a, 0x080c, 0x1f4a,
-	0x0804, 0x2dd2, 0x0106, 0x0006, 0x0126, 0x01c6, 0x01d6, 0x0136,
-	0x0146, 0x0156, 0x080c, 0x1f20, 0x080c, 0x992e, 0x080c, 0x20e6,
-	0x080c, 0x132a, 0x080c, 0x1f4a, 0x0804, 0x2dd2, 0x0106, 0x0006,
-	0x0126, 0x01c6, 0x01d6, 0x0136, 0x0146, 0x0156, 0x080c, 0x2527,
-	0x080c, 0x992e, 0x0804, 0x2dd2, 0x0106, 0x0006, 0x0126, 0x01c6,
-	0x01d6, 0x0136, 0x0146, 0x0156, 0x080c, 0x2527, 0x080c, 0x992e,
-	0x080c, 0x20e6, 0x0804, 0x2dd2, 0x0106, 0x0006, 0x0126, 0x01c6,
-	0x01d6, 0x0136, 0x0146, 0x0156, 0x080c, 0x2527, 0x080c, 0x1f20,
-	0x080c, 0x992e, 0x0804, 0x2dd2, 0x0106, 0x0006, 0x0126, 0x01c6,
-	0x01d6, 0x0136, 0x0146, 0x0156, 0x080c, 0x2527, 0x080c, 0x1f20,
-	0x080c, 0x992e, 0x080c, 0x20e6, 0x0804, 0x2dd2, 0x0106, 0x0006,
-	0x0126, 0x01c6, 0x01d6, 0x0136, 0x0146, 0x0156, 0x080c, 0x2527,
-	0x080c, 0x992e, 0x080c, 0x1f4a, 0x0804, 0x2dd2, 0x0106, 0x0006,
-	0x0126, 0x01c6, 0x01d6, 0x0136, 0x0146, 0x0156, 0x080c, 0x2527,
-	0x080c, 0x992e, 0x080c, 0x20e6, 0x080c, 0x1f4a, 0x0804, 0x2dd2,
+	0x080c, 0x9921, 0x080c, 0x20ff, 0x0804, 0x2de0, 0x0106, 0x0006,
+	0x0126, 0x01c6, 0x01d6, 0x0136, 0x0146, 0x0156, 0x080c, 0x1f2d,
+	0x080c, 0x9921, 0x0804, 0x2de0, 0x0106, 0x0006, 0x0126, 0x01c6,
+	0x01d6, 0x0136, 0x0146, 0x0156, 0x080c, 0x1f2d, 0x080c, 0x9921,
+	0x080c, 0x20ff, 0x0804, 0x2de0, 0x0106, 0x0006, 0x0126, 0x01c6,
+	0x01d6, 0x0136, 0x0146, 0x0156, 0x080c, 0x9921, 0x080c, 0x1f57,
+	0x0804, 0x2de0, 0x0106, 0x0006, 0x0126, 0x01c6, 0x01d6, 0x0136,
+	0x0146, 0x0156, 0x080c, 0x9921, 0x080c, 0x20ff, 0x080c, 0x1f57,
+	0x0804, 0x2de0, 0x0106, 0x0006, 0x0126, 0x01c6, 0x01d6, 0x0136,
+	0x0146, 0x0156, 0x080c, 0x1f2d, 0x080c, 0x9921, 0x080c, 0x1f57,
+	0x0804, 0x2de0, 0x0106, 0x0006, 0x0126, 0x01c6, 0x01d6, 0x0136,
+	0x0146, 0x0156, 0x080c, 0x1f2d, 0x080c, 0x9921, 0x080c, 0x20ff,
+	0x080c, 0x1f57, 0x0804, 0x2de0, 0x0106, 0x0006, 0x0126, 0x01c6,
+	0x01d6, 0x0136, 0x0146, 0x0156, 0x080c, 0x9921, 0x080c, 0x1335,
+	0x0804, 0x2de0, 0x0106, 0x0006, 0x0126, 0x01c6, 0x01d6, 0x0136,
+	0x0146, 0x0156, 0x080c, 0x9921, 0x080c, 0x20ff, 0x080c, 0x1335,
+	0x0804, 0x2de0, 0x0106, 0x0006, 0x0126, 0x01c6, 0x01d6, 0x0136,
+	0x0146, 0x0156, 0x080c, 0x1f2d, 0x080c, 0x9921, 0x080c, 0x1335,
+	0x0804, 0x2de0, 0x0106, 0x0006, 0x0126, 0x01c6, 0x01d6, 0x0136,
+	0x0146, 0x0156, 0x080c, 0x1f2d, 0x080c, 0x9921, 0x080c, 0x20ff,
+	0x080c, 0x1335, 0x0804, 0x2de0, 0x0106, 0x0006, 0x0126, 0x01c6,
+	0x01d6, 0x0136, 0x0146, 0x0156, 0x080c, 0x9921, 0x080c, 0x1335,
+	0x080c, 0x1f57, 0x0804, 0x2de0, 0x0106, 0x0006, 0x0126, 0x01c6,
+	0x01d6, 0x0136, 0x0146, 0x0156, 0x080c, 0x9921, 0x080c, 0x20ff,
+	0x080c, 0x1335, 0x080c, 0x1f57, 0x0804, 0x2de0, 0x0106, 0x0006,
+	0x0126, 0x01c6, 0x01d6, 0x0136, 0x0146, 0x0156, 0x080c, 0x1f2d,
+	0x080c, 0x9921, 0x080c, 0x1335, 0x080c, 0x1f57, 0x0804, 0x2de0,
 	0x0106, 0x0006, 0x0126, 0x01c6, 0x01d6, 0x0136, 0x0146, 0x0156,
-	0x080c, 0x2527, 0x080c, 0x1f20, 0x080c, 0x992e, 0x080c, 0x1f4a,
-	0x0804, 0x2dd2, 0x0106, 0x0006, 0x0126, 0x01c6, 0x01d6, 0x0136,
-	0x0146, 0x0156, 0x080c, 0x2527, 0x080c, 0x1f20, 0x080c, 0x992e,
-	0x080c, 0x20e6, 0x080c, 0x1f4a, 0x0804, 0x2dd2, 0x0106, 0x0006,
-	0x0126, 0x01c6, 0x01d6, 0x0136, 0x0146, 0x0156, 0x080c, 0x2527,
-	0x080c, 0x992e, 0x080c, 0x132a, 0x0804, 0x2dd2, 0x0106, 0x0006,
-	0x0126, 0x01c6, 0x01d6, 0x0136, 0x0146, 0x0156, 0x080c, 0x2527,
-	0x080c, 0x992e, 0x080c, 0x20e6, 0x080c, 0x132a, 0x0804, 0x2dd2,
+	0x080c, 0x1f2d, 0x080c, 0x9921, 0x080c, 0x20ff, 0x080c, 0x1335,
+	0x080c, 0x1f57, 0x0804, 0x2de0, 0x0106, 0x0006, 0x0126, 0x01c6,
+	0x01d6, 0x0136, 0x0146, 0x0156, 0x080c, 0x2540, 0x080c, 0x9921,
+	0x0804, 0x2de0, 0x0106, 0x0006, 0x0126, 0x01c6, 0x01d6, 0x0136,
+	0x0146, 0x0156, 0x080c, 0x2540, 0x080c, 0x9921, 0x080c, 0x20ff,
+	0x0804, 0x2de0, 0x0106, 0x0006, 0x0126, 0x01c6, 0x01d6, 0x0136,
+	0x0146, 0x0156, 0x080c, 0x2540, 0x080c, 0x1f2d, 0x080c, 0x9921,
+	0x0804, 0x2de0, 0x0106, 0x0006, 0x0126, 0x01c6, 0x01d6, 0x0136,
+	0x0146, 0x0156, 0x080c, 0x2540, 0x080c, 0x1f2d, 0x080c, 0x9921,
+	0x080c, 0x20ff, 0x0804, 0x2de0, 0x0106, 0x0006, 0x0126, 0x01c6,
+	0x01d6, 0x0136, 0x0146, 0x0156, 0x080c, 0x2540, 0x080c, 0x9921,
+	0x080c, 0x1f57, 0x0804, 0x2de0, 0x0106, 0x0006, 0x0126, 0x01c6,
+	0x01d6, 0x0136, 0x0146, 0x0156, 0x080c, 0x2540, 0x080c, 0x9921,
+	0x080c, 0x20ff, 0x080c, 0x1f57, 0x0804, 0x2de0, 0x0106, 0x0006,
+	0x0126, 0x01c6, 0x01d6, 0x0136, 0x0146, 0x0156, 0x080c, 0x2540,
+	0x080c, 0x1f2d, 0x080c, 0x9921, 0x080c, 0x1f57, 0x0804, 0x2de0,
 	0x0106, 0x0006, 0x0126, 0x01c6, 0x01d6, 0x0136, 0x0146, 0x0156,
-	0x080c, 0x2527, 0x080c, 0x1f20, 0x080c, 0x992e, 0x080c, 0x132a,
-	0x0804, 0x2dd2, 0x0106, 0x0006, 0x0126, 0x01c6, 0x01d6, 0x0136,
-	0x0146, 0x0156, 0x080c, 0x2527, 0x080c, 0x1f20, 0x080c, 0x992e,
-	0x080c, 0x20e6, 0x080c, 0x132a, 0x0804, 0x2dd2, 0x0106, 0x0006,
-	0x0126, 0x01c6, 0x01d6, 0x0136, 0x0146, 0x0156, 0x080c, 0x2527,
-	0x080c, 0x992e, 0x080c, 0x132a, 0x080c, 0x1f4a, 0x04d8, 0x0106,
-	0x0006, 0x0126, 0x01c6, 0x01d6, 0x0136, 0x0146, 0x0156, 0x080c,
-	0x2527, 0x080c, 0x992e, 0x080c, 0x20e6, 0x080c, 0x132a, 0x080c,
-	0x1f4a, 0x0440, 0x0106, 0x0006, 0x0126, 0x01c6, 0x01d6, 0x0136,
-	0x0146, 0x0156, 0x080c, 0x2527, 0x080c, 0x1f20, 0x080c, 0x132a,
-	0x080c, 0x992e, 0x080c, 0x1f4a, 0x00a8, 0x0106, 0x0006, 0x0126,
-	0x01c6, 0x01d6, 0x0136, 0x0146, 0x0156, 0x080c, 0x2527, 0x080c,
-	0x1f20, 0x080c, 0x992e, 0x080c, 0x20e6, 0x080c, 0x132a, 0x080c,
-	0x1f4a, 0x0000, 0x015e, 0x014e, 0x013e, 0x01de, 0x01ce, 0x012e,
-	0x000e, 0x010e, 0x000d, 0x00b6, 0x00c6, 0x0026, 0x0046, 0x9026,
-	0x080c, 0x6625, 0x1904, 0x2ee1, 0x72d8, 0x2001, 0x194d, 0x2004,
-	0x9005, 0x1110, 0xd29c, 0x0148, 0xd284, 0x1138, 0xd2bc, 0x1904,
-	0x2ee1, 0x080c, 0x2ee6, 0x0804, 0x2ee1, 0xd2cc, 0x1904, 0x2ee1,
-	0x080c, 0x70b7, 0x1120, 0x70ab, 0xffff, 0x0804, 0x2ee1, 0xd294,
-	0x0120, 0x70ab, 0xffff, 0x0804, 0x2ee1, 0x080c, 0x3181, 0x0160,
-	0x080c, 0xbf61, 0x0128, 0x2001, 0x1817, 0x203c, 0x0804, 0x2e73,
-	0x70ab, 0xffff, 0x0804, 0x2ee1, 0x2001, 0x1817, 0x203c, 0x7290,
-	0xd284, 0x0904, 0x2e73, 0xd28c, 0x1904, 0x2e73, 0x0036, 0x73a8,
-	0x938e, 0xffff, 0x1110, 0x2019, 0x0001, 0x8314, 0x92e0, 0x1d80,
-	0x2c04, 0x938c, 0x0001, 0x0120, 0x9084, 0xff00, 0x8007, 0x0010,
-	0x9084, 0x00ff, 0x970e, 0x05a8, 0x908e, 0x0000, 0x0590, 0x908e,
-	0x00ff, 0x1150, 0x7230, 0xd284, 0x1588, 0x7290, 0xc28d, 0x7292,
-	0x70ab, 0xffff, 0x003e, 0x0478, 0x0026, 0x2011, 0x0010, 0x080c,
-	0x668b, 0x002e, 0x0118, 0x70ab, 0xffff, 0x0410, 0x900e, 0x080c,
-	0x2424, 0x080c, 0x6210, 0x11c0, 0x080c, 0x6667, 0x1168, 0x7030,
-	0xd08c, 0x0130, 0xb800, 0xd0bc, 0x0138, 0x080c, 0x655f, 0x0120,
-	0x080c, 0x2eff, 0x0148, 0x0028, 0x080c, 0x3057, 0x080c, 0x2f2b,
-	0x0118, 0x8318, 0x0804, 0x2e25, 0x73aa, 0x0010, 0x70ab, 0xffff,
-	0x003e, 0x0804, 0x2ee1, 0x9780, 0x318b, 0x203d, 0x97bc, 0xff00,
-	0x873f, 0x2041, 0x007e, 0x70a8, 0x9096, 0xffff, 0x1118, 0x900e,
-	0x28a8, 0x0050, 0x9812, 0x0220, 0x2008, 0x9802, 0x20a8, 0x0020,
-	0x70ab, 0xffff, 0x0804, 0x2ee1, 0x2700, 0x0156, 0x0016, 0x9106,
-	0x0904, 0x2ed6, 0x0026, 0x2011, 0x0010, 0x080c, 0x668b, 0x002e,
-	0x0120, 0x2009, 0xffff, 0x0804, 0x2ede, 0xc484, 0x080c, 0x6270,
-	0x0138, 0x080c, 0xbf61, 0x1590, 0x080c, 0x6210, 0x15b8, 0x0008,
-	0xc485, 0x080c, 0x6667, 0x1130, 0x7030, 0xd08c, 0x01f8, 0xb800,
-	0xd0bc, 0x11e0, 0x7290, 0xd28c, 0x0180, 0x080c, 0x6667, 0x9082,
-	0x0006, 0x02e0, 0xd484, 0x1118, 0x080c, 0x6234, 0x0028, 0x080c,
-	0x30ef, 0x01a0, 0x080c, 0x311a, 0x0088, 0x080c, 0x3057, 0x080c,
-	0xbf61, 0x1160, 0x080c, 0x2f2b, 0x0188, 0x0040, 0x080c, 0xbf61,
-	0x1118, 0x080c, 0x30ef, 0x0110, 0x0451, 0x0140, 0x001e, 0x8108,
-	0x015e, 0x1f04, 0x2e8c, 0x70ab, 0xffff, 0x0018, 0x001e, 0x015e,
-	0x71aa, 0x004e, 0x002e, 0x00ce, 0x00be, 0x0005, 0x00c6, 0x0016,
-	0x70ab, 0x0001, 0x2009, 0x007e, 0x080c, 0x6210, 0x1168, 0xb813,
-	0x00ff, 0xb817, 0xfffe, 0x080c, 0x3057, 0x04a9, 0x0128, 0x70d8,
-	0xc0bd, 0x70da, 0x080c, 0xbcae, 0x001e, 0x00ce, 0x0005, 0x0016,
-	0x0076, 0x00d6, 0x00c6, 0x2001, 0x1858, 0x2004, 0x9084, 0x00ff,
-	0xb842, 0x080c, 0x9c58, 0x01d0, 0x2b00, 0x6012, 0x080c, 0xbcdb,
-	0x6023, 0x0001, 0x9006, 0x080c, 0x61ad, 0x2001, 0x0000, 0x080c,
-	0x61c1, 0x0126, 0x2091, 0x8000, 0x70a4, 0x8000, 0x70a6, 0x012e,
-	0x2009, 0x0004, 0x080c, 0x9c85, 0x9085, 0x0001, 0x00ce, 0x00de,
-	0x007e, 0x001e, 0x0005, 0x0016, 0x0076, 0x00d6, 0x00c6, 0x2001,
-	0x1858, 0x2004, 0x9084, 0x00ff, 0xb842, 0x080c, 0x9c58, 0x0548,
-	0x2b00, 0x6012, 0xb800, 0xc0c4, 0xb802, 0xb8a0, 0x9086, 0x007e,
-	0x0140, 0xb804, 0x9084, 0x00ff, 0x9086, 0x0006, 0x1110, 0x080c,
-	0x3006, 0x080c, 0xbcdb, 0x6023, 0x0001, 0x9006, 0x080c, 0x61ad,
-	0x2001, 0x0002, 0x080c, 0x61c1, 0x0126, 0x2091, 0x8000, 0x70a4,
-	0x8000, 0x70a6, 0x012e, 0x2009, 0x0002, 0x080c, 0x9c85, 0x9085,
-	0x0001, 0x00ce, 0x00de, 0x007e, 0x001e, 0x0005, 0x00b6, 0x00c6,
-	0x0026, 0x2009, 0x0080, 0x080c, 0x6210, 0x1140, 0xb813, 0x00ff,
-	0xb817, 0xfffc, 0x0039, 0x0110, 0x70df, 0xffff, 0x002e, 0x00ce,
-	0x00be, 0x0005, 0x0016, 0x0076, 0x00d6, 0x00c6, 0x080c, 0x9b91,
-	0x01d0, 0x2b00, 0x6012, 0x080c, 0xbcdb, 0x6023, 0x0001, 0x9006,
-	0x080c, 0x61ad, 0x2001, 0x0002, 0x080c, 0x61c1, 0x0126, 0x2091,
-	0x8000, 0x70e0, 0x8000, 0x70e2, 0x012e, 0x2009, 0x0002, 0x080c,
-	0x9c85, 0x9085, 0x0001, 0x00ce, 0x00de, 0x007e, 0x001e, 0x0005,
-	0x00c6, 0x00d6, 0x0126, 0x2091, 0x8000, 0x2009, 0x007f, 0x080c,
-	0x6210, 0x11b8, 0xb813, 0x00ff, 0xb817, 0xfffd, 0xb8c7, 0x0004,
-	0x080c, 0x9b91, 0x0170, 0x2b00, 0x6012, 0x6316, 0x6023, 0x0001,
-	0x620a, 0x080c, 0xbcdb, 0x2009, 0x0022, 0x080c, 0x9c85, 0x9085,
-	0x0001, 0x012e, 0x00de, 0x00ce, 0x0005, 0x00e6, 0x00c6, 0x0066,
-	0x0036, 0x0026, 0x00b6, 0x21f0, 0x9036, 0x080c, 0x98c8, 0x1110,
-	0x2031, 0x0001, 0x0066, 0x080c, 0x8646, 0x080c, 0x85c6, 0x080c,
-	0x981e, 0x080c, 0xab46, 0x006e, 0x86ff, 0x0110, 0x080c, 0x98e4,
+	0x080c, 0x2540, 0x080c, 0x1f2d, 0x080c, 0x9921, 0x080c, 0x20ff,
+	0x080c, 0x1f57, 0x0804, 0x2de0, 0x0106, 0x0006, 0x0126, 0x01c6,
+	0x01d6, 0x0136, 0x0146, 0x0156, 0x080c, 0x2540, 0x080c, 0x9921,
+	0x080c, 0x1335, 0x0804, 0x2de0, 0x0106, 0x0006, 0x0126, 0x01c6,
+	0x01d6, 0x0136, 0x0146, 0x0156, 0x080c, 0x2540, 0x080c, 0x9921,
+	0x080c, 0x20ff, 0x080c, 0x1335, 0x0804, 0x2de0, 0x0106, 0x0006,
+	0x0126, 0x01c6, 0x01d6, 0x0136, 0x0146, 0x0156, 0x080c, 0x2540,
+	0x080c, 0x1f2d, 0x080c, 0x9921, 0x080c, 0x1335, 0x0804, 0x2de0,
+	0x0106, 0x0006, 0x0126, 0x01c6, 0x01d6, 0x0136, 0x0146, 0x0156,
+	0x080c, 0x2540, 0x080c, 0x1f2d, 0x080c, 0x9921, 0x080c, 0x20ff,
+	0x080c, 0x1335, 0x0804, 0x2de0, 0x0106, 0x0006, 0x0126, 0x01c6,
+	0x01d6, 0x0136, 0x0146, 0x0156, 0x080c, 0x2540, 0x080c, 0x9921,
+	0x080c, 0x1335, 0x080c, 0x1f57, 0x04d8, 0x0106, 0x0006, 0x0126,
+	0x01c6, 0x01d6, 0x0136, 0x0146, 0x0156, 0x080c, 0x2540, 0x080c,
+	0x9921, 0x080c, 0x20ff, 0x080c, 0x1335, 0x080c, 0x1f57, 0x0440,
+	0x0106, 0x0006, 0x0126, 0x01c6, 0x01d6, 0x0136, 0x0146, 0x0156,
+	0x080c, 0x2540, 0x080c, 0x1f2d, 0x080c, 0x1335, 0x080c, 0x9921,
+	0x080c, 0x1f57, 0x00a8, 0x0106, 0x0006, 0x0126, 0x01c6, 0x01d6,
+	0x0136, 0x0146, 0x0156, 0x080c, 0x2540, 0x080c, 0x1f2d, 0x080c,
+	0x9921, 0x080c, 0x20ff, 0x080c, 0x1335, 0x080c, 0x1f57, 0x0000,
+	0x015e, 0x014e, 0x013e, 0x01de, 0x01ce, 0x012e, 0x000e, 0x010e,
+	0x000d, 0x00b6, 0x00c6, 0x0026, 0x0046, 0x9026, 0x080c, 0x6624,
+	0x1904, 0x2eef, 0x72d8, 0x2001, 0x194c, 0x2004, 0x9005, 0x1110,
+	0xd29c, 0x0148, 0xd284, 0x1138, 0xd2bc, 0x1904, 0x2eef, 0x080c,
+	0x2ef4, 0x0804, 0x2eef, 0xd2cc, 0x1904, 0x2eef, 0x080c, 0x7096,
+	0x1120, 0x70ab, 0xffff, 0x0804, 0x2eef, 0xd294, 0x0120, 0x70ab,
+	0xffff, 0x0804, 0x2eef, 0x080c, 0x3175, 0x0160, 0x080c, 0xbf61,
+	0x0128, 0x2001, 0x1817, 0x203c, 0x0804, 0x2e81, 0x70ab, 0xffff,
+	0x0804, 0x2eef, 0x2001, 0x1817, 0x203c, 0x7290, 0xd284, 0x0904,
+	0x2e81, 0xd28c, 0x1904, 0x2e81, 0x0036, 0x73a8, 0x938e, 0xffff,
+	0x1110, 0x2019, 0x0001, 0x8314, 0x92e0, 0x1d80, 0x2c04, 0x938c,
+	0x0001, 0x0120, 0x9084, 0xff00, 0x8007, 0x0010, 0x9084, 0x00ff,
+	0x970e, 0x05a8, 0x908e, 0x0000, 0x0590, 0x908e, 0x00ff, 0x1150,
+	0x7230, 0xd284, 0x1588, 0x7290, 0xc28d, 0x7292, 0x70ab, 0xffff,
+	0x003e, 0x0478, 0x0026, 0x2011, 0x0010, 0x080c, 0x668a, 0x002e,
+	0x0118, 0x70ab, 0xffff, 0x0410, 0x900e, 0x080c, 0x243d, 0x080c,
+	0x620b, 0x11c0, 0x080c, 0x6666, 0x1168, 0x7030, 0xd08c, 0x0130,
+	0xb800, 0xd0bc, 0x0138, 0x080c, 0x655e, 0x0120, 0x080c, 0x2f0d,
+	0x0148, 0x0028, 0x080c, 0x3059, 0x080c, 0x2f39, 0x0118, 0x8318,
+	0x0804, 0x2e33, 0x73aa, 0x0010, 0x70ab, 0xffff, 0x003e, 0x0804,
+	0x2eef, 0x9780, 0x317f, 0x203d, 0x97bc, 0xff00, 0x873f, 0x2041,
+	0x007e, 0x70a8, 0x9096, 0xffff, 0x1118, 0x900e, 0x28a8, 0x0050,
+	0x9812, 0x0220, 0x2008, 0x9802, 0x20a8, 0x0020, 0x70ab, 0xffff,
+	0x0804, 0x2eef, 0x2700, 0x0156, 0x0016, 0x9106, 0x0904, 0x2ee4,
+	0x0026, 0x2011, 0x0010, 0x080c, 0x668a, 0x002e, 0x0120, 0x2009,
+	0xffff, 0x0804, 0x2eec, 0xc484, 0x080c, 0x626b, 0x0138, 0x080c,
+	0xbf61, 0x1590, 0x080c, 0x620b, 0x15b8, 0x0008, 0xc485, 0x080c,
+	0x6666, 0x1130, 0x7030, 0xd08c, 0x01f8, 0xb800, 0xd0bc, 0x11e0,
+	0x7290, 0xd28c, 0x0180, 0x080c, 0x6666, 0x9082, 0x0006, 0x02e0,
+	0xd484, 0x1118, 0x080c, 0x622f, 0x0028, 0x080c, 0x30eb, 0x01a0,
+	0x080c, 0x3116, 0x0088, 0x080c, 0x3059, 0x080c, 0xbf61, 0x1160,
+	0x080c, 0x2f39, 0x0188, 0x0040, 0x080c, 0xbf61, 0x1118, 0x080c,
+	0x30eb, 0x0110, 0x0451, 0x0140, 0x001e, 0x8108, 0x015e, 0x1f04,
+	0x2e9a, 0x70ab, 0xffff, 0x0018, 0x001e, 0x015e, 0x71aa, 0x004e,
+	0x002e, 0x00ce, 0x00be, 0x0005, 0x00c6, 0x0016, 0x70ab, 0x0001,
+	0x2009, 0x007e, 0x080c, 0x620b, 0x1168, 0xb813, 0x00ff, 0xb817,
+	0xfffe, 0x080c, 0x3059, 0x04a9, 0x0128, 0x70d8, 0xc0bd, 0x70da,
+	0x080c, 0xbcae, 0x001e, 0x00ce, 0x0005, 0x0016, 0x0076, 0x00d6,
+	0x00c6, 0x2001, 0x1858, 0x2004, 0x9084, 0x00ff, 0xb842, 0x080c,
+	0x9c49, 0x01d0, 0x2b00, 0x6012, 0x080c, 0xbcdb, 0x6023, 0x0001,
+	0x9006, 0x080c, 0x61a8, 0x2001, 0x0000, 0x080c, 0x61bc, 0x0126,
+	0x2091, 0x8000, 0x70a4, 0x8000, 0x70a6, 0x012e, 0x2009, 0x0004,
+	0x080c, 0x9c76, 0x9085, 0x0001, 0x00ce, 0x00de, 0x007e, 0x001e,
+	0x0005, 0x0016, 0x0076, 0x00d6, 0x00c6, 0x2001, 0x1858, 0x2004,
+	0x9084, 0x00ff, 0xb842, 0x080c, 0x9c49, 0x0548, 0x2b00, 0x6012,
+	0xb800, 0xc0c4, 0xb802, 0xb8a0, 0x9086, 0x007e, 0x0140, 0xb804,
+	0x9084, 0x00ff, 0x9086, 0x0006, 0x1110, 0x080c, 0x300e, 0x080c,
+	0xbcdb, 0x6023, 0x0001, 0x9006, 0x080c, 0x61a8, 0x2001, 0x0002,
+	0x080c, 0x61bc, 0x0126, 0x2091, 0x8000, 0x70a4, 0x8000, 0x70a6,
+	0x012e, 0x2009, 0x0002, 0x080c, 0x9c76, 0x9085, 0x0001, 0x00ce,
+	0x00de, 0x007e, 0x001e, 0x0005, 0x00b6, 0x00c6, 0x0026, 0x2009,
+	0x0080, 0x080c, 0x620b, 0x1140, 0xb813, 0x00ff, 0xb817, 0xfffc,
+	0x0039, 0x0110, 0x70df, 0xffff, 0x002e, 0x00ce, 0x00be, 0x0005,
+	0x0016, 0x0076, 0x00d6, 0x00c6, 0x080c, 0x9b84, 0x01d0, 0x2b00,
+	0x6012, 0x080c, 0xbcdb, 0x6023, 0x0001, 0x9006, 0x080c, 0x61a8,
+	0x2001, 0x0002, 0x080c, 0x61bc, 0x0126, 0x2091, 0x8000, 0x70e0,
+	0x8000, 0x70e2, 0x012e, 0x2009, 0x0002, 0x080c, 0x9c76, 0x9085,
+	0x0001, 0x00ce, 0x00de, 0x007e, 0x001e, 0x0005, 0x00c6, 0x00d6,
+	0x0126, 0x2091, 0x8000, 0x2009, 0x007f, 0x080c, 0x620b, 0x11b8,
+	0xb813, 0x00ff, 0xb817, 0xfffd, 0xb8c7, 0x0004, 0x080c, 0x9b84,
+	0x0170, 0x2b00, 0x6012, 0x6316, 0x6023, 0x0001, 0x620a, 0x080c,
+	0xbcdb, 0x2009, 0x0022, 0x080c, 0x9c76, 0x9085, 0x0001, 0x012e,
+	0x00de, 0x00ce, 0x0005, 0x00e6, 0x00c6, 0x0066, 0x0036, 0x0026,
+	0x00b6, 0x21f0, 0x080c, 0x98bb, 0x0106, 0x080c, 0x862f, 0x080c,
+	0x85aa, 0x080c, 0x980c, 0x080c, 0xab3a, 0x010e, 0x090c, 0x98d7,
 	0x3e08, 0x2130, 0x81ff, 0x0120, 0x20a9, 0x007e, 0x900e, 0x0018,
-	0x20a9, 0x007f, 0x900e, 0x0016, 0x080c, 0x6270, 0x1140, 0x9686,
-	0x0002, 0x1118, 0xb800, 0xd0bc, 0x1110, 0x080c, 0x5cf6, 0x001e,
-	0x8108, 0x1f04, 0x2feb, 0x9686, 0x0001, 0x190c, 0x3155, 0x00be,
+	0x20a9, 0x007f, 0x900e, 0x0016, 0x080c, 0x626b, 0x1140, 0x9686,
+	0x0002, 0x1118, 0xb800, 0xd0bc, 0x1110, 0x080c, 0x5cf1, 0x001e,
+	0x8108, 0x1f04, 0x2ff3, 0x9686, 0x0001, 0x190c, 0x3149, 0x00be,
 	0x002e, 0x003e, 0x006e, 0x00ce, 0x00ee, 0x0005, 0x00e6, 0x00c6,
-	0x0046, 0x0036, 0x0026, 0x0016, 0x00b6, 0x9016, 0x080c, 0x98c8,
-	0x1110, 0x2011, 0x0001, 0x0026, 0x6210, 0x2258, 0xbaa0, 0x0026,
-	0x2019, 0x0029, 0x080c, 0x863b, 0x0076, 0x2039, 0x0000, 0x080c,
-	0x852a, 0x2c08, 0x080c, 0xcfc8, 0x007e, 0x001e, 0x002e, 0x82ff,
-	0x0110, 0x080c, 0x98e4, 0xba10, 0xbb14, 0xbc84, 0x080c, 0x5cf6,
-	0xba12, 0xbb16, 0xbc86, 0x00be, 0x001e, 0x002e, 0x003e, 0x004e,
-	0x00ce, 0x00ee, 0x0005, 0x00e6, 0x0006, 0x00b6, 0x6010, 0x2058,
-	0xb8a0, 0x00be, 0x9086, 0x0080, 0x0150, 0x2071, 0x1800, 0x70a4,
-	0x9005, 0x0110, 0x8001, 0x70a6, 0x000e, 0x00ee, 0x0005, 0x2071,
-	0x1800, 0x70e0, 0x9005, 0x0dc0, 0x8001, 0x70e2, 0x0ca8, 0xb800,
-	0xc08c, 0xb802, 0x0005, 0x00f6, 0x00e6, 0x00c6, 0x00b6, 0x0046,
-	0x0036, 0x0026, 0x0016, 0x0156, 0x2178, 0x9016, 0x080c, 0x98c8,
-	0x1110, 0x2011, 0x0001, 0x0026, 0x81ff, 0x1118, 0x20a9, 0x0001,
-	0x0070, 0x080c, 0x538d, 0xd0c4, 0x0138, 0x0030, 0x9006, 0x2020,
-	0x2009, 0x002d, 0x080c, 0xd273, 0x20a9, 0x0800, 0x9016, 0x0026,
-	0x928e, 0x007e, 0x0904, 0x30c9, 0x928e, 0x007f, 0x0904, 0x30c9,
-	0x928e, 0x0080, 0x05f0, 0x9288, 0x1000, 0x210c, 0x81ff, 0x05c8,
-	0x8fff, 0x1150, 0x2001, 0x195f, 0x0006, 0x2003, 0x0001, 0x080c,
-	0x30dc, 0x000e, 0x2003, 0x0000, 0x00b6, 0x00c6, 0x2158, 0x2001,
-	0x0001, 0x080c, 0x6631, 0x00ce, 0x00be, 0x2019, 0x0029, 0x080c,
-	0x863b, 0x0076, 0x2039, 0x0000, 0x080c, 0x852a, 0x00b6, 0x00c6,
-	0x0026, 0x2158, 0xba04, 0x9294, 0x00ff, 0x9286, 0x0006, 0x1118,
-	0xb807, 0x0404, 0x0028, 0x2001, 0x0004, 0x8007, 0x9215, 0xba06,
-	0x002e, 0x00ce, 0x00be, 0x0016, 0x2c08, 0x080c, 0xcfc8, 0x001e,
-	0x007e, 0x002e, 0x8210, 0x1f04, 0x307f, 0x002e, 0x82ff, 0x0110,
-	0x080c, 0x98e4, 0x015e, 0x001e, 0x002e, 0x003e, 0x004e, 0x00be,
-	0x00ce, 0x00ee, 0x00fe, 0x0005, 0x0046, 0x0026, 0x0016, 0x080c,
-	0x538d, 0xd0c4, 0x0140, 0xd0a4, 0x0130, 0x9006, 0x2220, 0x2009,
-	0x0029, 0x080c, 0xd273, 0x001e, 0x002e, 0x004e, 0x0005, 0x0016,
-	0x0026, 0x0036, 0x00c6, 0x7290, 0x82ff, 0x01e8, 0x080c, 0x665f,
-	0x11d0, 0x2100, 0x080c, 0x2457, 0x81ff, 0x01b8, 0x2019, 0x0001,
-	0x8314, 0x92e0, 0x1d80, 0x2c04, 0xd384, 0x0120, 0x9084, 0xff00,
-	0x8007, 0x0010, 0x9084, 0x00ff, 0x9116, 0x0138, 0x9096, 0x00ff,
-	0x0110, 0x8318, 0x0c68, 0x9085, 0x0001, 0x00ce, 0x003e, 0x002e,
-	0x001e, 0x0005, 0x0016, 0x00c6, 0x0126, 0x2091, 0x8000, 0x0066,
-	0x9036, 0x080c, 0x98c8, 0x1110, 0x2031, 0x0001, 0x0066, 0x0036,
-	0x2019, 0x0029, 0x00d9, 0x003e, 0x006e, 0x86ff, 0x0110, 0x080c,
-	0x98e4, 0x006e, 0x9180, 0x1000, 0x2004, 0x9065, 0x0158, 0x0016,
-	0x00c6, 0x2061, 0x1b02, 0x001e, 0x6112, 0x080c, 0x3006, 0x001e,
-	0x080c, 0x6234, 0x012e, 0x00ce, 0x001e, 0x0005, 0x0016, 0x0026,
-	0x2110, 0x080c, 0x94f4, 0x080c, 0xd529, 0x002e, 0x001e, 0x0005,
-	0x2001, 0x1836, 0x2004, 0xd0cc, 0x0005, 0x00c6, 0x00b6, 0x080c,
-	0x70b7, 0x1118, 0x20a9, 0x0800, 0x0010, 0x20a9, 0x0782, 0x080c,
-	0x70b7, 0x1110, 0x900e, 0x0010, 0x2009, 0x007e, 0x9180, 0x1000,
-	0x2004, 0x905d, 0x0130, 0x86ff, 0x0110, 0xb800, 0xd0bc, 0x090c,
-	0x6234, 0x8108, 0x1f04, 0x3166, 0x2061, 0x1800, 0x607b, 0x0000,
-	0x607c, 0x9084, 0x00ff, 0x607e, 0x60af, 0x0000, 0x00be, 0x00ce,
-	0x0005, 0x2001, 0x1875, 0x2004, 0xd0bc, 0x0005, 0x2011, 0x1854,
-	0x2214, 0xd2ec, 0x0005, 0x7eef, 0x7de8, 0x7ce4, 0x80e2, 0x7be1,
-	0x80e0, 0x80dc, 0x80da, 0x7ad9, 0x80d6, 0x80d5, 0x80d4, 0x80d3,
-	0x80d2, 0x80d1, 0x79ce, 0x78cd, 0x80cc, 0x80cb, 0x80ca, 0x80c9,
-	0x80c7, 0x80c6, 0x77c5, 0x76c3, 0x80bc, 0x80ba, 0x75b9, 0x80b6,
-	0x74b5, 0x73b4, 0x72b3, 0x80b2, 0x80b1, 0x80ae, 0x71ad, 0x80ac,
-	0x70ab, 0x6faa, 0x6ea9, 0x80a7, 0x6da6, 0x6ca5, 0x6ba3, 0x6a9f,
-	0x699e, 0x689d, 0x809b, 0x8098, 0x6797, 0x6690, 0x658f, 0x6488,
-	0x6384, 0x6282, 0x8081, 0x8080, 0x617c, 0x607a, 0x8079, 0x5f76,
-	0x8075, 0x8074, 0x8073, 0x8072, 0x8071, 0x806e, 0x5e6d, 0x806c,
-	0x5d6b, 0x5c6a, 0x5b69, 0x8067, 0x5a66, 0x5965, 0x5863, 0x575c,
-	0x565a, 0x5559, 0x8056, 0x8055, 0x5454, 0x5353, 0x5252, 0x5151,
-	0x504e, 0x4f4d, 0x804c, 0x804b, 0x4e4a, 0x4d49, 0x8047, 0x4c46,
-	0x8045, 0x8043, 0x803c, 0x803a, 0x8039, 0x8036, 0x4b35, 0x8034,
-	0x4a33, 0x4932, 0x4831, 0x802e, 0x472d, 0x462c, 0x452b, 0x442a,
-	0x4329, 0x4227, 0x8026, 0x8025, 0x4123, 0x401f, 0x3f1e, 0x3e1d,
-	0x3d1b, 0x3c18, 0x8017, 0x8010, 0x3b0f, 0x3a08, 0x8004, 0x3902,
-	0x8001, 0x8000, 0x8000, 0x3800, 0x3700, 0x3600, 0x8000, 0x3500,
-	0x8000, 0x8000, 0x8000, 0x3400, 0x8000, 0x8000, 0x8000, 0x8000,
-	0x8000, 0x8000, 0x3300, 0x3200, 0x8000, 0x8000, 0x8000, 0x8000,
-	0x8000, 0x8000, 0x3100, 0x3000, 0x8000, 0x8000, 0x2f00, 0x8000,
-	0x2e00, 0x2d00, 0x2c00, 0x8000, 0x8000, 0x8000, 0x2b00, 0x8000,
-	0x2a00, 0x2900, 0x2800, 0x8000, 0x2700, 0x2600, 0x2500, 0x2400,
-	0x2300, 0x2200, 0x8000, 0x8000, 0x2100, 0x2000, 0x1f00, 0x1e00,
-	0x1d00, 0x1c00, 0x8000, 0x8000, 0x1b00, 0x1a00, 0x8000, 0x1900,
-	0x8000, 0x8000, 0x8000, 0x8000, 0x8000, 0x8000, 0x1800, 0x8000,
-	0x1700, 0x1600, 0x1500, 0x8000, 0x1400, 0x1300, 0x1200, 0x1100,
-	0x1000, 0x0f00, 0x8000, 0x8000, 0x0e00, 0x0d00, 0x0c00, 0x0b00,
-	0x0a00, 0x0900, 0x8000, 0x8000, 0x0800, 0x0700, 0x8000, 0x0600,
-	0x8000, 0x8000, 0x8000, 0x0500, 0x0400, 0x0300, 0x8000, 0x0200,
-	0x8000, 0x8000, 0x8000, 0x0100, 0x8000, 0x8000, 0x8000, 0x8000,
-	0x8000, 0x8000, 0x0000, 0x8000, 0x8000, 0x8000, 0x8000, 0x8000,
+	0x0046, 0x0036, 0x0026, 0x0016, 0x00b6, 0x080c, 0x98bb, 0x0106,
+	0x6210, 0x2258, 0xbaa0, 0x0026, 0x2019, 0x0029, 0x080c, 0x8624,
+	0x0076, 0x2039, 0x0000, 0x080c, 0x8509, 0x2c08, 0x080c, 0xcfd9,
+	0x007e, 0x001e, 0x010e, 0x090c, 0x98d7, 0xba10, 0xbb14, 0xbc84,
+	0x080c, 0x5cf1, 0xba12, 0xbb16, 0xbc86, 0x00be, 0x001e, 0x002e,
+	0x003e, 0x004e, 0x00ce, 0x00ee, 0x0005, 0x00e6, 0x0006, 0x00b6,
+	0x6010, 0x2058, 0xb8a0, 0x00be, 0x9086, 0x0080, 0x0150, 0x2071,
+	0x1800, 0x70a4, 0x9005, 0x0110, 0x8001, 0x70a6, 0x000e, 0x00ee,
+	0x0005, 0x2071, 0x1800, 0x70e0, 0x9005, 0x0dc0, 0x8001, 0x70e2,
+	0x0ca8, 0xb800, 0xc08c, 0xb802, 0x0005, 0x00f6, 0x00e6, 0x00c6,
+	0x00b6, 0x0046, 0x0036, 0x0026, 0x0016, 0x0156, 0x2178, 0x080c,
+	0x98bb, 0x0106, 0x81ff, 0x1118, 0x20a9, 0x0001, 0x0070, 0x080c,
+	0x5388, 0xd0c4, 0x0138, 0x0030, 0x9006, 0x2020, 0x2009, 0x002d,
+	0x080c, 0xd284, 0x20a9, 0x0800, 0x9016, 0x0026, 0x928e, 0x007e,
+	0x0904, 0x30c7, 0x928e, 0x007f, 0x0904, 0x30c7, 0x928e, 0x0080,
+	0x05f0, 0x9288, 0x1000, 0x210c, 0x81ff, 0x05c8, 0x8fff, 0x1150,
+	0x2001, 0x195e, 0x0006, 0x2003, 0x0001, 0x080c, 0x30d8, 0x000e,
+	0x2003, 0x0000, 0x00b6, 0x00c6, 0x2158, 0x2001, 0x0001, 0x080c,
+	0x6630, 0x00ce, 0x00be, 0x2019, 0x0029, 0x080c, 0x8624, 0x0076,
+	0x2039, 0x0000, 0x080c, 0x8509, 0x00b6, 0x00c6, 0x0026, 0x2158,
+	0xba04, 0x9294, 0x00ff, 0x9286, 0x0006, 0x1118, 0xb807, 0x0404,
+	0x0028, 0x2001, 0x0004, 0x8007, 0x9215, 0xba06, 0x002e, 0x00ce,
+	0x00be, 0x0016, 0x2c08, 0x080c, 0xcfd9, 0x001e, 0x007e, 0x002e,
+	0x8210, 0x1f04, 0x307d, 0x010e, 0x090c, 0x98d7, 0x015e, 0x001e,
+	0x002e, 0x003e, 0x004e, 0x00be, 0x00ce, 0x00ee, 0x00fe, 0x0005,
+	0x0046, 0x0026, 0x0016, 0x080c, 0x5388, 0xd0c4, 0x0140, 0xd0a4,
+	0x0130, 0x9006, 0x2220, 0x2009, 0x0029, 0x080c, 0xd284, 0x001e,
+	0x002e, 0x004e, 0x0005, 0x0016, 0x0026, 0x0036, 0x00c6, 0x7290,
+	0x82ff, 0x01e8, 0x080c, 0x665e, 0x11d0, 0x2100, 0x080c, 0x2470,
+	0x81ff, 0x01b8, 0x2019, 0x0001, 0x8314, 0x92e0, 0x1d80, 0x2c04,
+	0xd384, 0x0120, 0x9084, 0xff00, 0x8007, 0x0010, 0x9084, 0x00ff,
+	0x9116, 0x0138, 0x9096, 0x00ff, 0x0110, 0x8318, 0x0c68, 0x9085,
+	0x0001, 0x00ce, 0x003e, 0x002e, 0x001e, 0x0005, 0x0016, 0x00c6,
+	0x0126, 0x2091, 0x8000, 0x080c, 0x98bb, 0x0106, 0x0036, 0x2019,
+	0x0029, 0x00c1, 0x003e, 0x010e, 0x090c, 0x98d7, 0x9180, 0x1000,
+	0x2004, 0x9065, 0x0158, 0x0016, 0x00c6, 0x2061, 0x1b01, 0x001e,
+	0x6112, 0x080c, 0x300e, 0x001e, 0x080c, 0x622f, 0x012e, 0x00ce,
+	0x001e, 0x0005, 0x0016, 0x0026, 0x2110, 0x080c, 0x94dd, 0x080c,
+	0xd53a, 0x002e, 0x001e, 0x0005, 0x2001, 0x1836, 0x2004, 0xd0cc,
+	0x0005, 0x00c6, 0x00b6, 0x080c, 0x7096, 0x1118, 0x20a9, 0x0800,
+	0x0010, 0x20a9, 0x0782, 0x080c, 0x7096, 0x1110, 0x900e, 0x0010,
+	0x2009, 0x007e, 0x9180, 0x1000, 0x2004, 0x905d, 0x0130, 0x86ff,
+	0x0110, 0xb800, 0xd0bc, 0x090c, 0x622f, 0x8108, 0x1f04, 0x315a,
+	0x2061, 0x1800, 0x607b, 0x0000, 0x607c, 0x9084, 0x00ff, 0x607e,
+	0x60af, 0x0000, 0x00be, 0x00ce, 0x0005, 0x2001, 0x1875, 0x2004,
+	0xd0bc, 0x0005, 0x2011, 0x1854, 0x2214, 0xd2ec, 0x0005, 0x7eef,
+	0x7de8, 0x7ce4, 0x80e2, 0x7be1, 0x80e0, 0x80dc, 0x80da, 0x7ad9,
+	0x80d6, 0x80d5, 0x80d4, 0x80d3, 0x80d2, 0x80d1, 0x79ce, 0x78cd,
+	0x80cc, 0x80cb, 0x80ca, 0x80c9, 0x80c7, 0x80c6, 0x77c5, 0x76c3,
+	0x80bc, 0x80ba, 0x75b9, 0x80b6, 0x74b5, 0x73b4, 0x72b3, 0x80b2,
+	0x80b1, 0x80ae, 0x71ad, 0x80ac, 0x70ab, 0x6faa, 0x6ea9, 0x80a7,
+	0x6da6, 0x6ca5, 0x6ba3, 0x6a9f, 0x699e, 0x689d, 0x809b, 0x8098,
+	0x6797, 0x6690, 0x658f, 0x6488, 0x6384, 0x6282, 0x8081, 0x8080,
+	0x617c, 0x607a, 0x8079, 0x5f76, 0x8075, 0x8074, 0x8073, 0x8072,
+	0x8071, 0x806e, 0x5e6d, 0x806c, 0x5d6b, 0x5c6a, 0x5b69, 0x8067,
+	0x5a66, 0x5965, 0x5863, 0x575c, 0x565a, 0x5559, 0x8056, 0x8055,
+	0x5454, 0x5353, 0x5252, 0x5151, 0x504e, 0x4f4d, 0x804c, 0x804b,
+	0x4e4a, 0x4d49, 0x8047, 0x4c46, 0x8045, 0x8043, 0x803c, 0x803a,
+	0x8039, 0x8036, 0x4b35, 0x8034, 0x4a33, 0x4932, 0x4831, 0x802e,
+	0x472d, 0x462c, 0x452b, 0x442a, 0x4329, 0x4227, 0x8026, 0x8025,
+	0x4123, 0x401f, 0x3f1e, 0x3e1d, 0x3d1b, 0x3c18, 0x8017, 0x8010,
+	0x3b0f, 0x3a08, 0x8004, 0x3902, 0x8001, 0x8000, 0x8000, 0x3800,
+	0x3700, 0x3600, 0x8000, 0x3500, 0x8000, 0x8000, 0x8000, 0x3400,
+	0x8000, 0x8000, 0x8000, 0x8000, 0x8000, 0x8000, 0x3300, 0x3200,
+	0x8000, 0x8000, 0x8000, 0x8000, 0x8000, 0x8000, 0x3100, 0x3000,
+	0x8000, 0x8000, 0x2f00, 0x8000, 0x2e00, 0x2d00, 0x2c00, 0x8000,
+	0x8000, 0x8000, 0x2b00, 0x8000, 0x2a00, 0x2900, 0x2800, 0x8000,
+	0x2700, 0x2600, 0x2500, 0x2400, 0x2300, 0x2200, 0x8000, 0x8000,
+	0x2100, 0x2000, 0x1f00, 0x1e00, 0x1d00, 0x1c00, 0x8000, 0x8000,
+	0x1b00, 0x1a00, 0x8000, 0x1900, 0x8000, 0x8000, 0x8000, 0x8000,
+	0x8000, 0x8000, 0x1800, 0x8000, 0x1700, 0x1600, 0x1500, 0x8000,
+	0x1400, 0x1300, 0x1200, 0x1100, 0x1000, 0x0f00, 0x8000, 0x8000,
+	0x0e00, 0x0d00, 0x0c00, 0x0b00, 0x0a00, 0x0900, 0x8000, 0x8000,
+	0x0800, 0x0700, 0x8000, 0x0600, 0x8000, 0x8000, 0x8000, 0x0500,
+	0x0400, 0x0300, 0x8000, 0x0200, 0x8000, 0x8000, 0x8000, 0x0100,
+	0x8000, 0x8000, 0x8000, 0x8000, 0x8000, 0x8000, 0x0000, 0x8000,
 	0x8000, 0x8000, 0x8000, 0x8000, 0x8000, 0x8000, 0x8000, 0x8000,
-	0x8000, 0x8000, 0x8000, 0x2071, 0x1894, 0x7003, 0x0002, 0x9006,
-	0x7016, 0x701a, 0x704a, 0x704e, 0x700e, 0x7042, 0x7046, 0x703b,
-	0x18b0, 0x703f, 0x18b0, 0x7007, 0x0001, 0x080c, 0x103b, 0x090c,
-	0x0d65, 0x2900, 0x706a, 0xa867, 0x0002, 0xa8ab, 0xdcb0, 0x080c,
-	0x103b, 0x090c, 0x0d65, 0x2900, 0x706e, 0xa867, 0x0002, 0xa8ab,
-	0xdcb0, 0x0005, 0x2071, 0x1894, 0x7004, 0x0002, 0x32ba, 0x32bb,
-	0x32ce, 0x32e2, 0x0005, 0x1004, 0x32cb, 0x0e04, 0x32cb, 0x2079,
-	0x0000, 0x0126, 0x2091, 0x8000, 0x700c, 0x9005, 0x1128, 0x700f,
-	0x0001, 0x012e, 0x0468, 0x0005, 0x012e, 0x0ce8, 0x2079, 0x0000,
-	0x2061, 0x18ae, 0x2c4c, 0xa86c, 0x908e, 0x0100, 0x0128, 0x9086,
-	0x0200, 0x0904, 0x33b6, 0x0005, 0x7018, 0x2048, 0x2061, 0x1800,
-	0x701c, 0x0807, 0x7014, 0x2048, 0xa864, 0x9094, 0x00ff, 0x9296,
-	0x0029, 0x1120, 0xaa78, 0xd2fc, 0x0128, 0x0005, 0x9086, 0x0103,
-	0x0108, 0x0005, 0x2079, 0x0000, 0x2061, 0x1800, 0x701c, 0x0807,
-	0x2061, 0x1800, 0x7880, 0x908a, 0x0040, 0x1210, 0x61cc, 0x0042,
-	0x2100, 0x908a, 0x003f, 0x1a04, 0x33b3, 0x61cc, 0x0804, 0x3348,
-	0x338a, 0x33c2, 0x33cc, 0x33d0, 0x33da, 0x33e0, 0x33e4, 0x33f4,
-	0x33f7, 0x3401, 0x3406, 0x340b, 0x3416, 0x3421, 0x3430, 0x343f,
-	0x344d, 0x3464, 0x347f, 0x33b3, 0x3528, 0x3566, 0x360b, 0x361c,
-	0x363f, 0x33b3, 0x33b3, 0x33b3, 0x3677, 0x3697, 0x36a0, 0x36cc,
-	0x36d2, 0x33b3, 0x3718, 0x33b3, 0x33b3, 0x33b3, 0x33b3, 0x33b3,
-	0x3723, 0x372c, 0x3734, 0x3736, 0x33b3, 0x33b3, 0x33b3, 0x33b3,
-	0x33b3, 0x33b3, 0x3766, 0x33b3, 0x33b3, 0x33b3, 0x33b3, 0x33b3,
-	0x3783, 0x37de, 0x33b3, 0x33b3, 0x33b3, 0x33b3, 0x33b3, 0x33b3,
-	0x0002, 0x3808, 0x380b, 0x386a, 0x3883, 0x38b3, 0x3b55, 0x33b3,
-	0x4f5e, 0x33b3, 0x33b3, 0x33b3, 0x33b3, 0x33b3, 0x33b3, 0x33b3,
-	0x33b3, 0x3401, 0x3406, 0x4054, 0x53b1, 0x406a, 0x4fed, 0x503e,
-	0x5141, 0x33b3, 0x51a3, 0x51df, 0x5210, 0x531c, 0x523d, 0x529c,
-	0x33b3, 0x406e, 0x41fe, 0x4214, 0x4239, 0x429e, 0x4312, 0x4332,
-	0x43a9, 0x4405, 0x4461, 0x4464, 0x4489, 0x44fc, 0x4566, 0x456e,
-	0x46a0, 0x4802, 0x4836, 0x4a80, 0x33b3, 0x4a9e, 0x4b61, 0x4c37,
-	0x33b3, 0x33b3, 0x33b3, 0x33b3, 0x4c9d, 0x4cb8, 0x456e, 0x4efe,
-	0x714c, 0x0000, 0x2021, 0x4000, 0x080c, 0x48b4, 0x0126, 0x2091,
-	0x8000, 0x0e04, 0x3394, 0x0010, 0x012e, 0x0cc0, 0x7c36, 0x9486,
-	0x4000, 0x0118, 0x7833, 0x0011, 0x0010, 0x7833, 0x0010, 0x7c82,
-	0x7986, 0x7a8a, 0x7b8e, 0x2091, 0x4080, 0x2001, 0x0089, 0x2004,
-	0xd084, 0x190c, 0x11be, 0x7007, 0x0001, 0x2091, 0x5000, 0x700f,
-	0x0000, 0x012e, 0x0005, 0x2021, 0x4001, 0x08b0, 0x2021, 0x4002,
-	0x0898, 0x2021, 0x4003, 0x0880, 0x2021, 0x4005, 0x0868, 0x2021,
-	0x4006, 0x0850, 0x2039, 0x0001, 0x902e, 0x2520, 0x7b88, 0x7a8c,
-	0x7884, 0x7990, 0x0804, 0x48c1, 0x7883, 0x0004, 0x7884, 0x0807,
+	0x8000, 0x8000, 0x8000, 0x8000, 0x8000, 0x8000, 0x8000, 0x2071,
+	0x1894, 0x7003, 0x0002, 0x9006, 0x7016, 0x701a, 0x704a, 0x704e,
+	0x700e, 0x7042, 0x7046, 0x703b, 0x18b0, 0x703f, 0x18b0, 0x7007,
+	0x0001, 0x080c, 0x103b, 0x090c, 0x0d65, 0x2900, 0x706a, 0xa867,
+	0x0002, 0xa8ab, 0xdcb0, 0x080c, 0x103b, 0x090c, 0x0d65, 0x2900,
+	0x706e, 0xa867, 0x0002, 0xa8ab, 0xdcb0, 0x0005, 0x2071, 0x1894,
+	0x7004, 0x0002, 0x32ae, 0x32af, 0x32c2, 0x32d6, 0x0005, 0x1004,
+	0x32bf, 0x0e04, 0x32bf, 0x2079, 0x0000, 0x0126, 0x2091, 0x8000,
+	0x700c, 0x9005, 0x1128, 0x700f, 0x0001, 0x012e, 0x0468, 0x0005,
+	0x012e, 0x0ce8, 0x2079, 0x0000, 0x2061, 0x18ae, 0x2c4c, 0xa86c,
+	0x908e, 0x0100, 0x0128, 0x9086, 0x0200, 0x0904, 0x33aa, 0x0005,
+	0x7018, 0x2048, 0x2061, 0x1800, 0x701c, 0x0807, 0x7014, 0x2048,
+	0xa864, 0x9094, 0x00ff, 0x9296, 0x0029, 0x1120, 0xaa78, 0xd2fc,
+	0x0128, 0x0005, 0x9086, 0x0103, 0x0108, 0x0005, 0x2079, 0x0000,
+	0x2061, 0x1800, 0x701c, 0x0807, 0x2061, 0x1800, 0x7880, 0x908a,
+	0x0040, 0x1210, 0x61cc, 0x0042, 0x2100, 0x908a, 0x003f, 0x1a04,
+	0x33a7, 0x61cc, 0x0804, 0x333c, 0x337e, 0x33b6, 0x33a7, 0x33c0,
+	0x33ca, 0x33d0, 0x33d4, 0x33e4, 0x33e8, 0x33fe, 0x3404, 0x340a,
+	0x3415, 0x3420, 0x342f, 0x343e, 0x344c, 0x3463, 0x347e, 0x33a7,
+	0x3527, 0x3565, 0x360a, 0x361b, 0x363e, 0x33a7, 0x33a7, 0x33a7,
+	0x3676, 0x3696, 0x369f, 0x36cb, 0x36d1, 0x33a7, 0x3717, 0x33a7,
+	0x33a7, 0x33a7, 0x33a7, 0x33a7, 0x3722, 0x372b, 0x3733, 0x3735,
+	0x33a7, 0x33a7, 0x33a7, 0x33a7, 0x33a7, 0x33a7, 0x3765, 0x33a7,
+	0x33a7, 0x33a7, 0x33a7, 0x33a7, 0x3782, 0x37dd, 0x33a7, 0x33a7,
+	0x33a7, 0x33a7, 0x33a7, 0x33a7, 0x0002, 0x3807, 0x380a, 0x3869,
+	0x3882, 0x38b2, 0x3b54, 0x33a7, 0x4f59, 0x33a7, 0x33a7, 0x33a7,
+	0x33a7, 0x33a7, 0x33a7, 0x33a7, 0x33a7, 0x33fe, 0x3404, 0x4053,
+	0x53ac, 0x4069, 0x4fe8, 0x5039, 0x513c, 0x33a7, 0x519e, 0x51da,
+	0x520b, 0x5317, 0x5238, 0x5297, 0x33a7, 0x406d, 0x41fd, 0x4213,
+	0x4238, 0x429d, 0x4311, 0x4331, 0x43a8, 0x4404, 0x4460, 0x4463,
+	0x4488, 0x44fb, 0x4565, 0x456d, 0x469f, 0x4804, 0x4838, 0x4a82,
+	0x33a7, 0x4aa0, 0x4b5c, 0x4c32, 0x33a7, 0x33a7, 0x33a7, 0x33a7,
+	0x4c98, 0x4cb3, 0x456d, 0x4ef9, 0x714c, 0x0000, 0x2021, 0x4000,
+	0x080c, 0x48b6, 0x0126, 0x2091, 0x8000, 0x0e04, 0x3388, 0x0010,
+	0x012e, 0x0cc0, 0x7c36, 0x9486, 0x4000, 0x0118, 0x7833, 0x0011,
+	0x0010, 0x7833, 0x0010, 0x7c82, 0x7986, 0x7a8a, 0x7b8e, 0x2091,
+	0x4080, 0x2001, 0x0089, 0x2004, 0xd084, 0x190c, 0x11c9, 0x7007,
+	0x0001, 0x2091, 0x5000, 0x700f, 0x0000, 0x012e, 0x0005, 0x2021,
+	0x4001, 0x08b0, 0x2021, 0x4002, 0x0898, 0x2021, 0x4003, 0x0880,
+	0x2021, 0x4005, 0x0868, 0x2021, 0x4006, 0x0850, 0x2039, 0x0001,
+	0x902e, 0x2520, 0x7b88, 0x7a8c, 0x7884, 0x7990, 0x0804, 0x48c3,
 	0x2039, 0x0001, 0x902e, 0x2520, 0x7b88, 0x7a8c, 0x7884, 0x7990,
-	0x0804, 0x48c4, 0x7984, 0x7888, 0x2114, 0x200a, 0x0804, 0x338a,
-	0x7984, 0x2114, 0x0804, 0x338a, 0x20e1, 0x0000, 0x2099, 0x0021,
+	0x0804, 0x48c6, 0x7984, 0x7888, 0x2114, 0x200a, 0x0804, 0x337e,
+	0x7984, 0x2114, 0x0804, 0x337e, 0x20e1, 0x0000, 0x2099, 0x0021,
 	0x20e9, 0x0000, 0x20a1, 0x0021, 0x20a9, 0x001f, 0x4003, 0x7984,
-	0x7a88, 0x7b8c, 0x0804, 0x338a, 0x7884, 0x2060, 0x04d8, 0x2009,
-	0x0003, 0x2011, 0x0002, 0x2019, 0x001c, 0x789b, 0x0317, 0x0804,
-	0x338a, 0x2039, 0x0001, 0x7d98, 0x7c9c, 0x0800, 0x2039, 0x0001,
-	0x7d98, 0x7c9c, 0x0848, 0x79a0, 0x9182, 0x0040, 0x0210, 0x0804,
-	0x33bf, 0x2138, 0x7d98, 0x7c9c, 0x0804, 0x33c6, 0x79a0, 0x9182,
-	0x0040, 0x0210, 0x0804, 0x33bf, 0x2138, 0x7d98, 0x7c9c, 0x0804,
-	0x33d4, 0x79a0, 0x9182, 0x0040, 0x0210, 0x0804, 0x33bf, 0x21e8,
-	0x7984, 0x7888, 0x20a9, 0x0001, 0x21a0, 0x4004, 0x0804, 0x338a,
-	0x2061, 0x0800, 0xe10c, 0x9006, 0x2c15, 0x9200, 0x8c60, 0x8109,
-	0x1dd8, 0x2010, 0x9005, 0x0904, 0x338a, 0x0804, 0x33b9, 0x79a0,
-	0x9182, 0x0040, 0x0210, 0x0804, 0x33bf, 0x21e0, 0x20a9, 0x0001,
-	0x7984, 0x2198, 0x4012, 0x0804, 0x338a, 0x2069, 0x1853, 0x7884,
-	0x7990, 0x911a, 0x1a04, 0x33bf, 0x8019, 0x0904, 0x33bf, 0x684a,
-	0x6942, 0x788c, 0x6852, 0x7888, 0x6856, 0x9006, 0x685a, 0x685e,
-	0x080c, 0x73e8, 0x0804, 0x338a, 0x2069, 0x1853, 0x7884, 0x7994,
-	0x911a, 0x1a04, 0x33bf, 0x8019, 0x0904, 0x33bf, 0x684e, 0x6946,
-	0x788c, 0x6862, 0x7888, 0x6866, 0x9006, 0x686a, 0x686e, 0x0126,
-	0x2091, 0x8000, 0x080c, 0x6769, 0x012e, 0x0804, 0x338a, 0x902e,
-	0x2520, 0x81ff, 0x0120, 0x2009, 0x0001, 0x0804, 0x33bc, 0x7984,
-	0x7b88, 0x7a8c, 0x20a9, 0x0005, 0x20e9, 0x0001, 0x20a1, 0x189c,
-	0x4101, 0x080c, 0x4878, 0x1120, 0x2009, 0x0002, 0x0804, 0x33bc,
-	0x2009, 0x0020, 0xa85c, 0x9080, 0x0019, 0xaf60, 0x080c, 0x48c1,
-	0x701f, 0x34a3, 0x0005, 0xa864, 0x2008, 0x9084, 0x00ff, 0x9096,
-	0x0011, 0x0168, 0x9096, 0x0019, 0x0150, 0x9096, 0x0015, 0x0138,
-	0x9096, 0x0048, 0x0120, 0x9096, 0x0029, 0x1904, 0x33bc, 0x810f,
-	0x918c, 0x00ff, 0x0904, 0x33bc, 0x7112, 0x7010, 0x8001, 0x0560,
-	0x7012, 0x080c, 0x4878, 0x1120, 0x2009, 0x0002, 0x0804, 0x33bc,
-	0x2009, 0x0020, 0x7068, 0x2040, 0xa28c, 0xa390, 0xa494, 0xa598,
-	0x9290, 0x0040, 0x9399, 0x0000, 0x94a1, 0x0000, 0x95a9, 0x0000,
-	0xa85c, 0x9080, 0x0019, 0xaf60, 0x080c, 0x48c1, 0x701f, 0x34e1,
-	0x0005, 0xa864, 0x9084, 0x00ff, 0x9096, 0x0002, 0x0120, 0x9096,
-	0x000a, 0x1904, 0x33bc, 0x0888, 0x7014, 0x2048, 0xa868, 0xc0fd,
-	0xa86a, 0xa864, 0x9084, 0x00ff, 0x9096, 0x0029, 0x1160, 0xc2fd,
-	0xaa7a, 0x080c, 0x5de4, 0x0150, 0x0126, 0x2091, 0x8000, 0xa87a,
-	0xa982, 0x012e, 0x0050, 0x080c, 0x60fb, 0x1128, 0x7007, 0x0003,
-	0x701f, 0x350d, 0x0005, 0x080c, 0x6bb3, 0x0126, 0x2091, 0x8000,
-	0x20a9, 0x0005, 0x20e1, 0x0001, 0x2099, 0x189c, 0x400a, 0x2100,
-	0x9210, 0x9399, 0x0000, 0x94a1, 0x0000, 0x95a9, 0x0000, 0xa85c,
-	0x9080, 0x0019, 0x2009, 0x0020, 0x012e, 0xaf60, 0x0804, 0x48c4,
-	0x2091, 0x8000, 0x7837, 0x4000, 0x7833, 0x0010, 0x7883, 0x4000,
-	0x7887, 0x4953, 0x788b, 0x5020, 0x788f, 0x2020, 0x2009, 0x017f,
-	0x2104, 0x7892, 0x3f00, 0x7896, 0x2061, 0x0100, 0x6200, 0x2061,
-	0x0200, 0x603c, 0x8007, 0x9205, 0x789a, 0x2009, 0x04fd, 0x2104,
-	0x789e, 0x2091, 0x5000, 0x2091, 0x4080, 0x2001, 0x0089, 0x2004,
-	0xd084, 0x0180, 0x2001, 0x19f3, 0x2004, 0x9005, 0x0128, 0x2001,
-	0x008b, 0x2004, 0xd0fc, 0x0dd8, 0x2001, 0x008a, 0x2003, 0x0002,
-	0x2003, 0x1001, 0x2071, 0x0080, 0x0804, 0x0427, 0x81ff, 0x1904,
-	0x33bc, 0x7984, 0x080c, 0x6270, 0x1904, 0x33bf, 0x7e98, 0x9684,
-	0x3fff, 0x9082, 0x4000, 0x1a04, 0x33bf, 0x7c88, 0x7d8c, 0x080c,
-	0x64a2, 0x080c, 0x6433, 0x1518, 0x2061, 0x1ddc, 0x0126, 0x2091,
-	0x8000, 0x6000, 0x9086, 0x0000, 0x0148, 0x6014, 0x904d, 0x0130,
-	0xa86c, 0x9406, 0x1118, 0xa870, 0x9506, 0x0150, 0x012e, 0x9ce0,
-	0x001c, 0x2001, 0x1819, 0x2004, 0x9c02, 0x1a04, 0x33bc, 0x0c30,
-	0x080c, 0xb452, 0x012e, 0x0904, 0x33bc, 0x0804, 0x338a, 0x900e,
-	0x2001, 0x0005, 0x080c, 0x6bb3, 0x0126, 0x2091, 0x8000, 0x080c,
-	0xbb4b, 0x080c, 0x6996, 0x012e, 0x0804, 0x338a, 0x00a6, 0x2950,
-	0xb198, 0x080c, 0x6270, 0x1904, 0x35f8, 0xb6a4, 0x9684, 0x3fff,
-	0x9082, 0x4000, 0x16e8, 0xb49c, 0xb5a0, 0x080c, 0x64a2, 0x080c,
-	0x644d, 0x1520, 0x2061, 0x1ddc, 0x0126, 0x2091, 0x8000, 0x6000,
-	0x9086, 0x0000, 0x0148, 0x6014, 0x904d, 0x0130, 0xa86c, 0x9406,
-	0x1118, 0xa870, 0x9506, 0x0158, 0x012e, 0x9ce0, 0x001c, 0x2001,
-	0x1819, 0x2004, 0x9c02, 0x2009, 0x000d, 0x12b0, 0x0c28, 0x080c,
-	0xb452, 0x012e, 0x2009, 0x0003, 0x0178, 0x00e0, 0x900e, 0x2001,
-	0x0005, 0x080c, 0x6bb3, 0x0126, 0x2091, 0x8000, 0x080c, 0xbb4b,
-	0x080c, 0x698a, 0x012e, 0x0070, 0xb097, 0x4005, 0xb19a, 0x0010,
-	0xb097, 0x4006, 0x900e, 0x9085, 0x0001, 0x2001, 0x0030, 0x2a48,
-	0x00ae, 0x0005, 0xb097, 0x4000, 0x9006, 0x918d, 0x0001, 0x2008,
-	0x2a48, 0x00ae, 0x0005, 0x81ff, 0x1904, 0x33bc, 0x080c, 0x488f,
-	0x0904, 0x33bf, 0x080c, 0x6337, 0x0904, 0x33bc, 0x080c, 0x64a8,
-	0x0904, 0x33bc, 0x0804, 0x4329, 0x81ff, 0x1904, 0x33bc, 0x080c,
-	0x48ab, 0x0904, 0x33bf, 0x080c, 0x6536, 0x0904, 0x33bc, 0x2019,
-	0x0005, 0x79a8, 0x080c, 0x64c3, 0x0904, 0x33bc, 0x7888, 0x908a,
-	0x1000, 0x1a04, 0x33bf, 0x8003, 0x800b, 0x810b, 0x9108, 0x080c,
-	0x8167, 0x7984, 0xd184, 0x1904, 0x338a, 0x0804, 0x4329, 0x0126,
-	0x2091, 0x8000, 0x81ff, 0x0118, 0x2009, 0x0001, 0x0450, 0x2029,
-	0x07ff, 0x6458, 0x2400, 0x9506, 0x01f8, 0x2508, 0x080c, 0x6270,
-	0x11d8, 0x080c, 0x6536, 0x1128, 0x2009, 0x0002, 0x62bc, 0x2518,
-	0x00c0, 0x2019, 0x0004, 0x900e, 0x080c, 0x64c3, 0x1118, 0x2009,
-	0x0006, 0x0078, 0x7884, 0x908a, 0x1000, 0x1270, 0x8003, 0x800b,
-	0x810b, 0x9108, 0x080c, 0x8167, 0x8529, 0x1ae0, 0x012e, 0x0804,
-	0x338a, 0x012e, 0x0804, 0x33bc, 0x012e, 0x0804, 0x33bf, 0x080c,
-	0x488f, 0x0904, 0x33bf, 0x080c, 0x6337, 0x0904, 0x33bc, 0x080c,
-	0x98c8, 0xbaa0, 0x2019, 0x0005, 0x00c6, 0x9066, 0x080c, 0x863b,
-	0x0076, 0x903e, 0x080c, 0x852a, 0x900e, 0x080c, 0xcfc8, 0x007e,
-	0x00ce, 0x080c, 0x98e4, 0x080c, 0x64a2, 0x0804, 0x338a, 0x080c,
-	0x488f, 0x0904, 0x33bf, 0x080c, 0x64a2, 0x2208, 0x0804, 0x338a,
-	0x0156, 0x00d6, 0x00e6, 0x00c6, 0x2069, 0x1906, 0x6810, 0x6914,
-	0x910a, 0x1208, 0x900e, 0x6816, 0x9016, 0x901e, 0x2071, 0x19b8,
-	0x7028, 0x9065, 0x0118, 0x8210, 0x600c, 0x0cd8, 0x2300, 0x9218,
-	0x00ce, 0x00ee, 0x00de, 0x015e, 0x0804, 0x338a, 0x00f6, 0x0016,
-	0x907d, 0x0138, 0x9006, 0x8000, 0x2f0c, 0x81ff, 0x0110, 0x2178,
-	0x0cd0, 0x001e, 0x00fe, 0x0005, 0x2069, 0x1906, 0x6910, 0x62b8,
-	0x0804, 0x338a, 0x81ff, 0x0120, 0x2009, 0x0001, 0x0804, 0x33bc,
-	0x0126, 0x2091, 0x8000, 0x080c, 0x53a1, 0x0128, 0x2009, 0x0007,
-	0x012e, 0x0804, 0x33bc, 0x012e, 0x6158, 0x9190, 0x318b, 0x2215,
-	0x9294, 0x00ff, 0x6378, 0x83ff, 0x0108, 0x627c, 0x67d8, 0x97c4,
-	0x000a, 0x98c6, 0x000a, 0x1118, 0x2031, 0x0001, 0x00e8, 0x97c4,
-	0x0022, 0x98c6, 0x0022, 0x1118, 0x2031, 0x0003, 0x00a8, 0x97c4,
-	0x0012, 0x98c6, 0x0012, 0x1118, 0x2031, 0x0002, 0x0068, 0x080c,
-	0x70b7, 0x1118, 0x2031, 0x0004, 0x0038, 0xd79c, 0x0120, 0x2009,
-	0x0005, 0x0804, 0x33bc, 0x9036, 0x7e9a, 0x7f9e, 0x0804, 0x338a,
-	0x6148, 0x624c, 0x2019, 0x1957, 0x231c, 0x2001, 0x1958, 0x2004,
-	0x789a, 0x0804, 0x338a, 0x0126, 0x2091, 0x8000, 0x6138, 0x623c,
-	0x6340, 0x012e, 0x0804, 0x338a, 0x080c, 0x48ab, 0x0904, 0x33bf,
-	0xba44, 0xbb38, 0x0804, 0x338a, 0x080c, 0x0d65, 0x080c, 0x48ab,
-	0x2110, 0x0904, 0x33bf, 0xb804, 0x908c, 0x00ff, 0x918e, 0x0006,
-	0x0140, 0x9084, 0xff00, 0x9086, 0x0600, 0x2009, 0x0009, 0x1904,
-	0x33bc, 0x0126, 0x2091, 0x8000, 0x2019, 0x0005, 0x00c6, 0x9066,
-	0x080c, 0x98c8, 0x080c, 0x94f4, 0x080c, 0x863b, 0x0076, 0x903e,
-	0x080c, 0x852a, 0x900e, 0x080c, 0xcfc8, 0x007e, 0x00ce, 0x080c,
-	0x98e4, 0xb807, 0x0407, 0x012e, 0x0804, 0x338a, 0x6148, 0x624c,
-	0x7884, 0x604a, 0x7b88, 0x634e, 0x2069, 0x1853, 0x831f, 0x9305,
-	0x6816, 0x788c, 0x2069, 0x1957, 0x2d1c, 0x206a, 0x7e98, 0x9682,
-	0x0014, 0x1210, 0x2031, 0x07d0, 0x2069, 0x1958, 0x2d04, 0x266a,
-	0x789a, 0x0804, 0x338a, 0x0126, 0x2091, 0x8000, 0x6138, 0x7884,
-	0x603a, 0x910e, 0xd1b4, 0x190c, 0x0eb4, 0xd0c4, 0x01a8, 0x00d6,
-	0x78a8, 0x2009, 0x196e, 0x200a, 0x78ac, 0x2011, 0x196f, 0x2012,
-	0x2069, 0x0100, 0x6838, 0x9086, 0x0007, 0x1118, 0x2214, 0x6a5a,
-	0x0010, 0x210c, 0x695a, 0x00de, 0x7888, 0x603e, 0x2011, 0x0116,
-	0x220c, 0x7888, 0xd08c, 0x0118, 0x918d, 0x0040, 0x0010, 0x918c,
-	0xff7f, 0x2112, 0x6140, 0x788c, 0x6042, 0x910e, 0xd1e4, 0x190c,
-	0x0ecf, 0x6040, 0xd0cc, 0x0120, 0x78b0, 0x2011, 0x0114, 0x2012,
-	0x012e, 0x0804, 0x338a, 0x00f6, 0x2079, 0x1800, 0x7a38, 0xa898,
-	0x9084, 0xfebf, 0x9215, 0xa89c, 0x9084, 0xfebf, 0x8002, 0x9214,
-	0x7838, 0x9084, 0x0140, 0x9215, 0x7a3a, 0xa897, 0x4000, 0x900e,
-	0x9085, 0x0001, 0x2001, 0x0000, 0x00fe, 0x0005, 0x7898, 0x9005,
-	0x01a8, 0x7888, 0x9025, 0x0904, 0x33bf, 0x788c, 0x902d, 0x0904,
-	0x33bf, 0x900e, 0x080c, 0x6270, 0x1120, 0xba44, 0xbb38, 0xbc46,
-	0xbd3a, 0x9186, 0x07ff, 0x0190, 0x8108, 0x0ca0, 0x080c, 0x48ab,
-	0x0904, 0x33bf, 0x7888, 0x900d, 0x0904, 0x33bf, 0x788c, 0x9005,
-	0x0904, 0x33bf, 0xba44, 0xb946, 0xbb38, 0xb83a, 0x0804, 0x338a,
-	0x2011, 0xbc09, 0x0010, 0x2011, 0xbc05, 0x080c, 0x53a1, 0x1904,
-	0x33bc, 0x00c6, 0x2061, 0x0100, 0x7984, 0x9186, 0x00ff, 0x1130,
-	0x2001, 0x1817, 0x2004, 0x9085, 0xff00, 0x0088, 0x9182, 0x007f,
-	0x16e0, 0x9188, 0x318b, 0x210d, 0x918c, 0x00ff, 0x2001, 0x1817,
-	0x2004, 0x0026, 0x9116, 0x002e, 0x0580, 0x810f, 0x9105, 0x0126,
-	0x2091, 0x8000, 0x0006, 0x080c, 0x9b91, 0x000e, 0x0510, 0x602e,
-	0x620a, 0x7984, 0x00b6, 0x080c, 0x6216, 0x2b08, 0x00be, 0x1500,
-	0x6112, 0x6023, 0x0001, 0x080c, 0x4878, 0x01d0, 0x9006, 0xa866,
-	0x7007, 0x0003, 0xa832, 0xa868, 0xc0fd, 0xa86a, 0x701f, 0x3863,
-	0x2900, 0x6016, 0x2009, 0x0032, 0x080c, 0x9c85, 0x012e, 0x00ce,
-	0x0005, 0x012e, 0x00ce, 0x0804, 0x33bc, 0x00ce, 0x0804, 0x33bf,
-	0x080c, 0x9be7, 0x0cb0, 0xa830, 0x9086, 0x0100, 0x0904, 0x33bc,
-	0x0804, 0x338a, 0x2061, 0x1a3f, 0x0126, 0x2091, 0x8000, 0x6000,
-	0xd084, 0x0170, 0x6104, 0x6208, 0x2061, 0x1800, 0x6350, 0x6070,
-	0x789a, 0x60bc, 0x789e, 0x60b8, 0x78aa, 0x012e, 0x0804, 0x338a,
-	0x900e, 0x2110, 0x0c88, 0x81ff, 0x1904, 0x33bc, 0x080c, 0x70b7,
-	0x0904, 0x33bc, 0x0126, 0x2091, 0x8000, 0x6250, 0x6070, 0x9202,
-	0x0248, 0x9085, 0x0001, 0x080c, 0x248d, 0x080c, 0x55bb, 0x012e,
-	0x0804, 0x338a, 0x012e, 0x0804, 0x33bf, 0x0006, 0x0016, 0x00c6,
-	0x00e6, 0x2001, 0x197a, 0x2070, 0x2061, 0x1853, 0x6008, 0x2072,
-	0x900e, 0x2011, 0x1400, 0x080c, 0x8419, 0x7206, 0x00ee, 0x00ce,
-	0x001e, 0x000e, 0x0005, 0x0126, 0x2091, 0x8000, 0x81ff, 0x0128,
-	0x012e, 0x2021, 0x400b, 0x0804, 0x338c, 0x7884, 0xd0fc, 0x0148,
-	0x2001, 0x002a, 0x2004, 0x9082, 0x00e1, 0x0288, 0x012e, 0x0804,
-	0x33bf, 0x2001, 0x002a, 0x2004, 0x2069, 0x1853, 0x6908, 0x9102,
-	0x1230, 0x012e, 0x0804, 0x33bf, 0x012e, 0x0804, 0x33bc, 0x080c,
-	0x9b66, 0x0dd0, 0x7884, 0xd0fc, 0x0904, 0x392e, 0x00c6, 0x080c,
-	0x4878, 0x00ce, 0x0d88, 0xa867, 0x0000, 0x7884, 0xa80a, 0x7898,
-	0xa80e, 0x789c, 0xa812, 0x2001, 0x002e, 0x2004, 0xa81a, 0x2001,
-	0x002f, 0x2004, 0xa81e, 0x2001, 0x0030, 0x2004, 0xa822, 0x2001,
-	0x0031, 0x2004, 0xa826, 0x2001, 0x0034, 0x2004, 0xa82a, 0x2001,
-	0x0035, 0x2004, 0xa82e, 0x2001, 0x002a, 0x2004, 0x9080, 0x0003,
-	0x9084, 0x00fc, 0x8004, 0xa816, 0x080c, 0x3ab8, 0x0928, 0x7014,
-	0x2048, 0xad2c, 0xac28, 0xab1c, 0xaa18, 0xa930, 0xa808, 0xd0b4,
-	0x1120, 0x2029, 0x0000, 0x2021, 0x0000, 0x8906, 0x8006, 0x8007,
-	0x90bc, 0x003f, 0x9084, 0xffc0, 0x9080, 0x001b, 0x080c, 0x48c1,
-	0x701f, 0x39f5, 0x7023, 0x0001, 0x012e, 0x0005, 0x080c, 0x98c8,
-	0x0046, 0x0086, 0x0096, 0x00a6, 0x00b6, 0x00c6, 0x00d6, 0x00e6,
-	0x00f6, 0x080c, 0x389d, 0x2001, 0x1970, 0x2003, 0x0000, 0x2021,
-	0x000a, 0x2061, 0x0100, 0x6104, 0x0016, 0x60bb, 0x0000, 0x60bf,
-	0x32e1, 0x60bf, 0x0012, 0x080c, 0x3b27, 0x080c, 0x3ae6, 0x00f6,
-	0x00e6, 0x0086, 0x2940, 0x2071, 0x19b8, 0x2079, 0x0090, 0x00d6,
-	0x2069, 0x0000, 0x6884, 0xd0b4, 0x0140, 0x2001, 0x0035, 0x2004,
-	0x780e, 0x2001, 0x0034, 0x2004, 0x780a, 0x00de, 0x2011, 0x0001,
-	0x080c, 0x3e98, 0x008e, 0x00ee, 0x00fe, 0x080c, 0x3dc5, 0x080c,
-	0x3cf2, 0x05b8, 0x2001, 0x020b, 0x2004, 0x9084, 0x0140, 0x1db8,
-	0x080c, 0x3f0c, 0x00f6, 0x2079, 0x0300, 0x78bc, 0x00fe, 0x908c,
-	0x0070, 0x1560, 0x2071, 0x0200, 0x7037, 0x0000, 0x7050, 0x9084,
-	0xff00, 0x9086, 0x3200, 0x1510, 0x7037, 0x0001, 0x7050, 0x9084,
-	0xff00, 0x9086, 0xe100, 0x11d0, 0x7037, 0x0000, 0x7054, 0x7037,
-	0x0000, 0x715c, 0x9106, 0x1190, 0x2001, 0x181f, 0x2004, 0x9106,
-	0x1168, 0x00c6, 0x2061, 0x0100, 0x6024, 0x9084, 0x1e00, 0x00ce,
-	0x0138, 0x080c, 0x3cfc, 0x080c, 0x3ae1, 0x0058, 0x080c, 0x3ae1,
-	0x080c, 0x3e30, 0x080c, 0x3dbb, 0x2001, 0x020b, 0x2004, 0xd0e4,
-	0x0dd8, 0x2001, 0x032a, 0x2003, 0x0004, 0x2061, 0x0100, 0x6027,
-	0x0002, 0x001e, 0x6106, 0x2011, 0x020d, 0x2013, 0x0020, 0x60bb,
-	0x0000, 0x60bf, 0x0108, 0x60bf, 0x0012, 0x2001, 0x0004, 0x200c,
-	0x918c, 0xfffd, 0x2102, 0x080c, 0x12d6, 0x2009, 0x0028, 0x080c,
-	0x2052, 0x2001, 0x0227, 0x200c, 0x2102, 0x080c, 0x98e4, 0x00fe,
-	0x00ee, 0x00de, 0x00ce, 0x00be, 0x00ae, 0x009e, 0x008e, 0x004e,
-	0x2001, 0x1970, 0x2004, 0x9005, 0x1118, 0x012e, 0x0804, 0x338a,
-	0x012e, 0x2021, 0x400c, 0x0804, 0x338c, 0x0016, 0x0026, 0x0036,
-	0x0046, 0x0056, 0x0076, 0x0086, 0x0096, 0x00d6, 0x0156, 0x7014,
-	0x2048, 0x7020, 0x20a8, 0x8000, 0x7022, 0xa804, 0x9005, 0x0904,
-	0x3a51, 0x2048, 0x1f04, 0x3a05, 0x7068, 0x2040, 0xa28c, 0xa390,
-	0xa494, 0xa598, 0xa930, 0xa808, 0xd0b4, 0x1120, 0x2029, 0x0000,
-	0x2021, 0x0000, 0x0096, 0x7014, 0x2048, 0xa864, 0x009e, 0x9086,
-	0x0103, 0x0170, 0x8906, 0x8006, 0x8007, 0x90bc, 0x003f, 0x9084,
-	0xffc0, 0x9080, 0x001b, 0x080c, 0x48c1, 0x701f, 0x39f5, 0x00b0,
-	0x8906, 0x8006, 0x8007, 0x90bc, 0x003f, 0x9084, 0xffc0, 0x9080,
-	0x001b, 0x21a8, 0x27e0, 0x2098, 0x27e8, 0x20a0, 0x0006, 0x080c,
-	0x0f9f, 0x000e, 0x080c, 0x48c4, 0x701f, 0x39f5, 0x015e, 0x00de,
-	0x009e, 0x008e, 0x007e, 0x005e, 0x004e, 0x003e, 0x002e, 0x001e,
-	0x0005, 0x7014, 0x2048, 0xa864, 0x9086, 0x0103, 0x1118, 0x701f,
-	0x3ab6, 0x0450, 0x7014, 0x2048, 0xa868, 0xc0fd, 0xa86a, 0x2009,
-	0x007f, 0x080c, 0x6210, 0x0110, 0x9006, 0x0030, 0xb813, 0x00ff,
-	0xb817, 0xfffd, 0x080c, 0xbd2a, 0x015e, 0x00de, 0x009e, 0x008e,
-	0x007e, 0x005e, 0x004e, 0x003e, 0x002e, 0x001e, 0x0904, 0x33bc,
-	0x0016, 0x0026, 0x0036, 0x0046, 0x0056, 0x0076, 0x0086, 0x0096,
-	0x00d6, 0x0156, 0x701f, 0x3a88, 0x7007, 0x0003, 0x0804, 0x3a46,
-	0xa830, 0x9086, 0x0100, 0x2021, 0x400c, 0x0904, 0x338c, 0x0076,
-	0xad10, 0xac0c, 0xab24, 0xaa20, 0xa930, 0xa808, 0xd0b4, 0x1120,
+	0x7a88, 0x7b8c, 0x0804, 0x337e, 0x7884, 0x2060, 0x0804, 0x3431,
+	0x2009, 0x0003, 0x2011, 0x0002, 0x2019, 0x001e, 0x789b, 0x0317,
+	0x7893, 0xffff, 0x2001, 0x1885, 0x2004, 0x9005, 0x0118, 0x7896,
+	0x0804, 0x337e, 0x7897, 0x0001, 0x0804, 0x337e, 0x2039, 0x0001,
+	0x7d98, 0x7c9c, 0x0804, 0x33ba, 0x2039, 0x0001, 0x7d98, 0x7c9c,
+	0x0804, 0x33c4, 0x79a0, 0x9182, 0x0040, 0x0210, 0x0804, 0x33b3,
+	0x2138, 0x7d98, 0x7c9c, 0x0804, 0x33ba, 0x79a0, 0x9182, 0x0040,
+	0x0210, 0x0804, 0x33b3, 0x2138, 0x7d98, 0x7c9c, 0x0804, 0x33c4,
+	0x79a0, 0x9182, 0x0040, 0x0210, 0x0804, 0x33b3, 0x21e8, 0x7984,
+	0x7888, 0x20a9, 0x0001, 0x21a0, 0x4004, 0x0804, 0x337e, 0x2061,
+	0x0800, 0xe10c, 0x9006, 0x2c15, 0x9200, 0x8c60, 0x8109, 0x1dd8,
+	0x2010, 0x9005, 0x0904, 0x337e, 0x0804, 0x33ad, 0x79a0, 0x9182,
+	0x0040, 0x0210, 0x0804, 0x33b3, 0x21e0, 0x20a9, 0x0001, 0x7984,
+	0x2198, 0x4012, 0x0804, 0x337e, 0x2069, 0x1853, 0x7884, 0x7990,
+	0x911a, 0x1a04, 0x33b3, 0x8019, 0x0904, 0x33b3, 0x684a, 0x6942,
+	0x788c, 0x6852, 0x7888, 0x6856, 0x9006, 0x685a, 0x685e, 0x080c,
+	0x73c7, 0x0804, 0x337e, 0x2069, 0x1853, 0x7884, 0x7994, 0x911a,
+	0x1a04, 0x33b3, 0x8019, 0x0904, 0x33b3, 0x684e, 0x6946, 0x788c,
+	0x6862, 0x7888, 0x6866, 0x9006, 0x686a, 0x686e, 0x0126, 0x2091,
+	0x8000, 0x080c, 0x6764, 0x012e, 0x0804, 0x337e, 0x902e, 0x2520,
+	0x81ff, 0x0120, 0x2009, 0x0001, 0x0804, 0x33b0, 0x7984, 0x7b88,
+	0x7a8c, 0x20a9, 0x0005, 0x20e9, 0x0001, 0x20a1, 0x189c, 0x4101,
+	0x080c, 0x487a, 0x1120, 0x2009, 0x0002, 0x0804, 0x33b0, 0x2009,
+	0x0020, 0xa85c, 0x9080, 0x0019, 0xaf60, 0x080c, 0x48c3, 0x701f,
+	0x34a2, 0x0005, 0xa864, 0x2008, 0x9084, 0x00ff, 0x9096, 0x0011,
+	0x0168, 0x9096, 0x0019, 0x0150, 0x9096, 0x0015, 0x0138, 0x9096,
+	0x0048, 0x0120, 0x9096, 0x0029, 0x1904, 0x33b0, 0x810f, 0x918c,
+	0x00ff, 0x0904, 0x33b0, 0x7112, 0x7010, 0x8001, 0x0560, 0x7012,
+	0x080c, 0x487a, 0x1120, 0x2009, 0x0002, 0x0804, 0x33b0, 0x2009,
+	0x0020, 0x7068, 0x2040, 0xa28c, 0xa390, 0xa494, 0xa598, 0x9290,
+	0x0040, 0x9399, 0x0000, 0x94a1, 0x0000, 0x95a9, 0x0000, 0xa85c,
+	0x9080, 0x0019, 0xaf60, 0x080c, 0x48c3, 0x701f, 0x34e0, 0x0005,
+	0xa864, 0x9084, 0x00ff, 0x9096, 0x0002, 0x0120, 0x9096, 0x000a,
+	0x1904, 0x33b0, 0x0888, 0x7014, 0x2048, 0xa868, 0xc0fd, 0xa86a,
+	0xa864, 0x9084, 0x00ff, 0x9096, 0x0029, 0x1160, 0xc2fd, 0xaa7a,
+	0x080c, 0x5ddf, 0x0150, 0x0126, 0x2091, 0x8000, 0xa87a, 0xa982,
+	0x012e, 0x0050, 0x080c, 0x60f6, 0x1128, 0x7007, 0x0003, 0x701f,
+	0x350c, 0x0005, 0x080c, 0x6ba2, 0x0126, 0x2091, 0x8000, 0x20a9,
+	0x0005, 0x20e1, 0x0001, 0x2099, 0x189c, 0x400a, 0x2100, 0x9210,
+	0x9399, 0x0000, 0x94a1, 0x0000, 0x95a9, 0x0000, 0xa85c, 0x9080,
+	0x0019, 0x2009, 0x0020, 0x012e, 0xaf60, 0x0804, 0x48c6, 0x2091,
+	0x8000, 0x7837, 0x4000, 0x7833, 0x0010, 0x7883, 0x4000, 0x7887,
+	0x4953, 0x788b, 0x5020, 0x788f, 0x2020, 0x2009, 0x017f, 0x2104,
+	0x7892, 0x3f00, 0x7896, 0x2061, 0x0100, 0x6200, 0x2061, 0x0200,
+	0x603c, 0x8007, 0x9205, 0x789a, 0x2009, 0x04fd, 0x2104, 0x789e,
+	0x2091, 0x5000, 0x2091, 0x4080, 0x2001, 0x0089, 0x2004, 0xd084,
+	0x0180, 0x2001, 0x19f2, 0x2004, 0x9005, 0x0128, 0x2001, 0x008b,
+	0x2004, 0xd0fc, 0x0dd8, 0x2001, 0x008a, 0x2003, 0x0002, 0x2003,
+	0x1001, 0x2071, 0x0080, 0x0804, 0x0427, 0x81ff, 0x1904, 0x33b0,
+	0x7984, 0x080c, 0x626b, 0x1904, 0x33b3, 0x7e98, 0x9684, 0x3fff,
+	0x9082, 0x4000, 0x1a04, 0x33b3, 0x7c88, 0x7d8c, 0x080c, 0x64a1,
+	0x080c, 0x642e, 0x1518, 0x2061, 0x1ddc, 0x0126, 0x2091, 0x8000,
+	0x6000, 0x9086, 0x0000, 0x0148, 0x6014, 0x904d, 0x0130, 0xa86c,
+	0x9406, 0x1118, 0xa870, 0x9506, 0x0150, 0x012e, 0x9ce0, 0x001c,
+	0x2001, 0x1819, 0x2004, 0x9c02, 0x1a04, 0x33b0, 0x0c30, 0x080c,
+	0xb440, 0x012e, 0x0904, 0x33b0, 0x0804, 0x337e, 0x900e, 0x2001,
+	0x0005, 0x080c, 0x6ba2, 0x0126, 0x2091, 0x8000, 0x080c, 0xbb4b,
+	0x080c, 0x6991, 0x012e, 0x0804, 0x337e, 0x00a6, 0x2950, 0xb198,
+	0x080c, 0x626b, 0x1904, 0x35f7, 0xb6a4, 0x9684, 0x3fff, 0x9082,
+	0x4000, 0x16e8, 0xb49c, 0xb5a0, 0x080c, 0x64a1, 0x080c, 0x644b,
+	0x1520, 0x2061, 0x1ddc, 0x0126, 0x2091, 0x8000, 0x6000, 0x9086,
+	0x0000, 0x0148, 0x6014, 0x904d, 0x0130, 0xa86c, 0x9406, 0x1118,
+	0xa870, 0x9506, 0x0158, 0x012e, 0x9ce0, 0x001c, 0x2001, 0x1819,
+	0x2004, 0x9c02, 0x2009, 0x000d, 0x12b0, 0x0c28, 0x080c, 0xb440,
+	0x012e, 0x2009, 0x0003, 0x0178, 0x00e0, 0x900e, 0x2001, 0x0005,
+	0x080c, 0x6ba2, 0x0126, 0x2091, 0x8000, 0x080c, 0xbb4b, 0x080c,
+	0x6985, 0x012e, 0x0070, 0xb097, 0x4005, 0xb19a, 0x0010, 0xb097,
+	0x4006, 0x900e, 0x9085, 0x0001, 0x2001, 0x0030, 0x2a48, 0x00ae,
+	0x0005, 0xb097, 0x4000, 0x9006, 0x918d, 0x0001, 0x2008, 0x2a48,
+	0x00ae, 0x0005, 0x81ff, 0x1904, 0x33b0, 0x080c, 0x4891, 0x0904,
+	0x33b3, 0x080c, 0x6332, 0x0904, 0x33b0, 0x080c, 0x64a7, 0x0904,
+	0x33b0, 0x0804, 0x4328, 0x81ff, 0x1904, 0x33b0, 0x080c, 0x48ad,
+	0x0904, 0x33b3, 0x080c, 0x6535, 0x0904, 0x33b0, 0x2019, 0x0005,
+	0x79a8, 0x080c, 0x64c2, 0x0904, 0x33b0, 0x7888, 0x908a, 0x1000,
+	0x1a04, 0x33b3, 0x8003, 0x800b, 0x810b, 0x9108, 0x080c, 0x8146,
+	0x7984, 0xd184, 0x1904, 0x337e, 0x0804, 0x4328, 0x0126, 0x2091,
+	0x8000, 0x81ff, 0x0118, 0x2009, 0x0001, 0x0450, 0x2029, 0x07ff,
+	0x6458, 0x2400, 0x9506, 0x01f8, 0x2508, 0x080c, 0x626b, 0x11d8,
+	0x080c, 0x6535, 0x1128, 0x2009, 0x0002, 0x62bc, 0x2518, 0x00c0,
+	0x2019, 0x0004, 0x900e, 0x080c, 0x64c2, 0x1118, 0x2009, 0x0006,
+	0x0078, 0x7884, 0x908a, 0x1000, 0x1270, 0x8003, 0x800b, 0x810b,
+	0x9108, 0x080c, 0x8146, 0x8529, 0x1ae0, 0x012e, 0x0804, 0x337e,
+	0x012e, 0x0804, 0x33b0, 0x012e, 0x0804, 0x33b3, 0x080c, 0x4891,
+	0x0904, 0x33b3, 0x080c, 0x6332, 0x0904, 0x33b0, 0x080c, 0x98bb,
+	0xbaa0, 0x2019, 0x0005, 0x00c6, 0x9066, 0x080c, 0x8624, 0x0076,
+	0x903e, 0x080c, 0x8509, 0x900e, 0x080c, 0xcfd9, 0x007e, 0x00ce,
+	0x080c, 0x98d7, 0x080c, 0x64a1, 0x0804, 0x337e, 0x080c, 0x4891,
+	0x0904, 0x33b3, 0x080c, 0x64a1, 0x2208, 0x0804, 0x337e, 0x0156,
+	0x00d6, 0x00e6, 0x00c6, 0x2069, 0x1906, 0x6810, 0x6914, 0x910a,
+	0x1208, 0x900e, 0x6816, 0x9016, 0x901e, 0x2071, 0x19b7, 0x7028,
+	0x9065, 0x0118, 0x8210, 0x600c, 0x0cd8, 0x2300, 0x9218, 0x00ce,
+	0x00ee, 0x00de, 0x015e, 0x0804, 0x337e, 0x00f6, 0x0016, 0x907d,
+	0x0138, 0x9006, 0x8000, 0x2f0c, 0x81ff, 0x0110, 0x2178, 0x0cd0,
+	0x001e, 0x00fe, 0x0005, 0x2069, 0x1906, 0x6910, 0x62b8, 0x0804,
+	0x337e, 0x81ff, 0x0120, 0x2009, 0x0001, 0x0804, 0x33b0, 0x0126,
+	0x2091, 0x8000, 0x080c, 0x539c, 0x0128, 0x2009, 0x0007, 0x012e,
+	0x0804, 0x33b0, 0x012e, 0x6158, 0x9190, 0x317f, 0x2215, 0x9294,
+	0x00ff, 0x6378, 0x83ff, 0x0108, 0x627c, 0x67d8, 0x97c4, 0x000a,
+	0x98c6, 0x000a, 0x1118, 0x2031, 0x0001, 0x00e8, 0x97c4, 0x0022,
+	0x98c6, 0x0022, 0x1118, 0x2031, 0x0003, 0x00a8, 0x97c4, 0x0012,
+	0x98c6, 0x0012, 0x1118, 0x2031, 0x0002, 0x0068, 0x080c, 0x7096,
+	0x1118, 0x2031, 0x0004, 0x0038, 0xd79c, 0x0120, 0x2009, 0x0005,
+	0x0804, 0x33b0, 0x9036, 0x7e9a, 0x7f9e, 0x0804, 0x337e, 0x6148,
+	0x624c, 0x2019, 0x1956, 0x231c, 0x2001, 0x1957, 0x2004, 0x789a,
+	0x0804, 0x337e, 0x0126, 0x2091, 0x8000, 0x6138, 0x623c, 0x6340,
+	0x012e, 0x0804, 0x337e, 0x080c, 0x48ad, 0x0904, 0x33b3, 0xba44,
+	0xbb38, 0x0804, 0x337e, 0x080c, 0x0d65, 0x080c, 0x48ad, 0x2110,
+	0x0904, 0x33b3, 0xb804, 0x908c, 0x00ff, 0x918e, 0x0006, 0x0140,
+	0x9084, 0xff00, 0x9086, 0x0600, 0x2009, 0x0009, 0x1904, 0x33b0,
+	0x0126, 0x2091, 0x8000, 0x2019, 0x0005, 0x00c6, 0x9066, 0x080c,
+	0x98bb, 0x080c, 0x94dd, 0x080c, 0x8624, 0x0076, 0x903e, 0x080c,
+	0x8509, 0x900e, 0x080c, 0xcfd9, 0x007e, 0x00ce, 0x080c, 0x98d7,
+	0xb807, 0x0407, 0x012e, 0x0804, 0x337e, 0x6148, 0x624c, 0x7884,
+	0x604a, 0x7b88, 0x634e, 0x2069, 0x1853, 0x831f, 0x9305, 0x6816,
+	0x788c, 0x2069, 0x1956, 0x2d1c, 0x206a, 0x7e98, 0x9682, 0x0014,
+	0x1210, 0x2031, 0x07d0, 0x2069, 0x1957, 0x2d04, 0x266a, 0x789a,
+	0x0804, 0x337e, 0x0126, 0x2091, 0x8000, 0x6138, 0x7884, 0x603a,
+	0x910e, 0xd1b4, 0x190c, 0x0eb4, 0xd0c4, 0x01a8, 0x00d6, 0x78a8,
+	0x2009, 0x196d, 0x200a, 0x78ac, 0x2011, 0x196e, 0x2012, 0x2069,
+	0x0100, 0x6838, 0x9086, 0x0007, 0x1118, 0x2214, 0x6a5a, 0x0010,
+	0x210c, 0x695a, 0x00de, 0x7888, 0x603e, 0x2011, 0x0116, 0x220c,
+	0x7888, 0xd08c, 0x0118, 0x918d, 0x0040, 0x0010, 0x918c, 0xff7f,
+	0x2112, 0x6140, 0x788c, 0x6042, 0x910e, 0xd1e4, 0x190c, 0x0ecf,
+	0x6040, 0xd0cc, 0x0120, 0x78b0, 0x2011, 0x0114, 0x2012, 0x012e,
+	0x0804, 0x337e, 0x00f6, 0x2079, 0x1800, 0x7a38, 0xa898, 0x9084,
+	0xfebf, 0x9215, 0xa89c, 0x9084, 0xfebf, 0x8002, 0x9214, 0x7838,
+	0x9084, 0x0140, 0x9215, 0x7a3a, 0xa897, 0x4000, 0x900e, 0x9085,
+	0x0001, 0x2001, 0x0000, 0x00fe, 0x0005, 0x7898, 0x9005, 0x01a8,
+	0x7888, 0x9025, 0x0904, 0x33b3, 0x788c, 0x902d, 0x0904, 0x33b3,
+	0x900e, 0x080c, 0x626b, 0x1120, 0xba44, 0xbb38, 0xbc46, 0xbd3a,
+	0x9186, 0x07ff, 0x0190, 0x8108, 0x0ca0, 0x080c, 0x48ad, 0x0904,
+	0x33b3, 0x7888, 0x900d, 0x0904, 0x33b3, 0x788c, 0x9005, 0x0904,
+	0x33b3, 0xba44, 0xb946, 0xbb38, 0xb83a, 0x0804, 0x337e, 0x2011,
+	0xbc09, 0x0010, 0x2011, 0xbc05, 0x080c, 0x539c, 0x1904, 0x33b0,
+	0x00c6, 0x2061, 0x0100, 0x7984, 0x9186, 0x00ff, 0x1130, 0x2001,
+	0x1817, 0x2004, 0x9085, 0xff00, 0x0088, 0x9182, 0x007f, 0x16e0,
+	0x9188, 0x317f, 0x210d, 0x918c, 0x00ff, 0x2001, 0x1817, 0x2004,
+	0x0026, 0x9116, 0x002e, 0x0580, 0x810f, 0x9105, 0x0126, 0x2091,
+	0x8000, 0x0006, 0x080c, 0x9b84, 0x000e, 0x0510, 0x602e, 0x620a,
+	0x7984, 0x00b6, 0x080c, 0x6211, 0x2b08, 0x00be, 0x1500, 0x6112,
+	0x6023, 0x0001, 0x080c, 0x487a, 0x01d0, 0x9006, 0xa866, 0x7007,
+	0x0003, 0xa832, 0xa868, 0xc0fd, 0xa86a, 0x701f, 0x3862, 0x2900,
+	0x6016, 0x2009, 0x0032, 0x080c, 0x9c76, 0x012e, 0x00ce, 0x0005,
+	0x012e, 0x00ce, 0x0804, 0x33b0, 0x00ce, 0x0804, 0x33b3, 0x080c,
+	0x9bda, 0x0cb0, 0xa830, 0x9086, 0x0100, 0x0904, 0x33b0, 0x0804,
+	0x337e, 0x2061, 0x1a3e, 0x0126, 0x2091, 0x8000, 0x6000, 0xd084,
+	0x0170, 0x6104, 0x6208, 0x2061, 0x1800, 0x6350, 0x6070, 0x789a,
+	0x60bc, 0x789e, 0x60b8, 0x78aa, 0x012e, 0x0804, 0x337e, 0x900e,
+	0x2110, 0x0c88, 0x81ff, 0x1904, 0x33b0, 0x080c, 0x7096, 0x0904,
+	0x33b0, 0x0126, 0x2091, 0x8000, 0x6250, 0x6070, 0x9202, 0x0248,
+	0x9085, 0x0001, 0x080c, 0x24a6, 0x080c, 0x55b6, 0x012e, 0x0804,
+	0x337e, 0x012e, 0x0804, 0x33b3, 0x0006, 0x0016, 0x00c6, 0x00e6,
+	0x2001, 0x1979, 0x2070, 0x2061, 0x1853, 0x6008, 0x2072, 0x900e,
+	0x2011, 0x1400, 0x080c, 0x83fb, 0x7206, 0x00ee, 0x00ce, 0x001e,
+	0x000e, 0x0005, 0x0126, 0x2091, 0x8000, 0x81ff, 0x0128, 0x012e,
+	0x2021, 0x400b, 0x0804, 0x3380, 0x7884, 0xd0fc, 0x0148, 0x2001,
+	0x002a, 0x2004, 0x9082, 0x00e1, 0x0288, 0x012e, 0x0804, 0x33b3,
+	0x2001, 0x002a, 0x2004, 0x2069, 0x1853, 0x6908, 0x9102, 0x1230,
+	0x012e, 0x0804, 0x33b3, 0x012e, 0x0804, 0x33b0, 0x080c, 0x9b59,
+	0x0dd0, 0x7884, 0xd0fc, 0x0904, 0x392d, 0x00c6, 0x080c, 0x487a,
+	0x00ce, 0x0d88, 0xa867, 0x0000, 0x7884, 0xa80a, 0x7898, 0xa80e,
+	0x789c, 0xa812, 0x2001, 0x002e, 0x2004, 0xa81a, 0x2001, 0x002f,
+	0x2004, 0xa81e, 0x2001, 0x0030, 0x2004, 0xa822, 0x2001, 0x0031,
+	0x2004, 0xa826, 0x2001, 0x0034, 0x2004, 0xa82a, 0x2001, 0x0035,
+	0x2004, 0xa82e, 0x2001, 0x002a, 0x2004, 0x9080, 0x0003, 0x9084,
+	0x00fc, 0x8004, 0xa816, 0x080c, 0x3ab7, 0x0928, 0x7014, 0x2048,
+	0xad2c, 0xac28, 0xab1c, 0xaa18, 0xa930, 0xa808, 0xd0b4, 0x1120,
 	0x2029, 0x0000, 0x2021, 0x0000, 0x8906, 0x8006, 0x8007, 0x90bc,
-	0x003f, 0x9084, 0xffc0, 0x9080, 0x001b, 0x21a8, 0x27e0, 0x2098,
-	0x27e8, 0x20a0, 0x0006, 0x080c, 0x0f9f, 0x000e, 0x080c, 0x48c4,
-	0x007e, 0x701f, 0x39f5, 0x7023, 0x0001, 0x0005, 0x0804, 0x338a,
-	0x0156, 0x00c6, 0xa814, 0x908a, 0x001e, 0x0218, 0xa833, 0x001e,
-	0x0010, 0xa832, 0x0078, 0x81ff, 0x0168, 0x0016, 0x080c, 0x4878,
-	0x001e, 0x0130, 0xa800, 0x2040, 0xa008, 0xa80a, 0x2100, 0x0c58,
-	0x9006, 0x0010, 0x9085, 0x0001, 0x00ce, 0x015e, 0x0005, 0x0006,
-	0x00f6, 0x2079, 0x0000, 0x7880, 0x9086, 0x0044, 0x00fe, 0x000e,
-	0x0005, 0x2001, 0x1970, 0x2003, 0x0001, 0x0005, 0x00f6, 0x00e6,
-	0x00c6, 0x2061, 0x0200, 0x2001, 0x197b, 0x2004, 0x601a, 0x2061,
-	0x0100, 0x2001, 0x197a, 0x2004, 0x60ce, 0x6104, 0xc1ac, 0x6106,
-	0x080c, 0x4878, 0xa813, 0x0019, 0xa817, 0x0001, 0x2900, 0xa85a,
-	0x2001, 0x002e, 0x2004, 0xa866, 0x2001, 0x002f, 0x2004, 0xa86a,
-	0x2061, 0x0090, 0x2079, 0x0100, 0x2001, 0x197a, 0x2004, 0x6036,
-	0x2009, 0x0040, 0x080c, 0x2052, 0x2001, 0x002a, 0x2004, 0x9084,
-	0xfff8, 0xa86e, 0x601a, 0xa873, 0x0000, 0x601f, 0x0000, 0x78ca,
-	0x9006, 0x600a, 0x600e, 0x00ce, 0x00ee, 0x00fe, 0x0005, 0x00e6,
-	0x080c, 0x4878, 0x2940, 0xa013, 0x0019, 0xa017, 0x0001, 0x2800,
-	0xa05a, 0x2001, 0x0030, 0x2004, 0xa866, 0x2001, 0x0031, 0x2004,
-	0xa86a, 0x2001, 0x002a, 0x2004, 0x9084, 0xfff8, 0xa86e, 0xa873,
-	0x0000, 0x2001, 0x032a, 0x2003, 0x0004, 0x2001, 0x0300, 0x2003,
-	0x0000, 0x2001, 0x020d, 0x2003, 0x0000, 0x2001, 0x0004, 0x200c,
-	0x918d, 0x0002, 0x2102, 0x00ee, 0x0005, 0x0126, 0x2091, 0x8000,
-	0x81ff, 0x0148, 0x080c, 0x2811, 0x1130, 0x9006, 0x080c, 0x276e,
-	0x9006, 0x080c, 0x2751, 0x7884, 0x9084, 0x0007, 0x0002, 0x3b72,
-	0x3b7b, 0x3b84, 0x3b6f, 0x3b6f, 0x3b6f, 0x3b6f, 0x3b6f, 0x012e,
-	0x0804, 0x33bf, 0x2009, 0x0114, 0x2104, 0x9085, 0x0800, 0x200a,
-	0x080c, 0x3d46, 0x00c0, 0x2009, 0x0114, 0x2104, 0x9085, 0x4000,
-	0x200a, 0x080c, 0x3d46, 0x0078, 0x080c, 0x70b7, 0x1128, 0x012e,
-	0x2009, 0x0016, 0x0804, 0x33bc, 0x81ff, 0x0128, 0x012e, 0x2021,
-	0x400b, 0x0804, 0x338c, 0x080c, 0x98c8, 0x0086, 0x0096, 0x00a6,
-	0x00b6, 0x00c6, 0x00d6, 0x00e6, 0x00f6, 0x080c, 0x389d, 0x2009,
-	0x0101, 0x210c, 0x0016, 0x7ec8, 0x7dcc, 0x9006, 0x2068, 0x2060,
-	0x2058, 0x080c, 0x3fe7, 0x080c, 0x3f37, 0x903e, 0x2720, 0x00f6,
-	0x00e6, 0x0086, 0x2940, 0x2071, 0x19b8, 0x2079, 0x0090, 0x00d6,
-	0x2069, 0x0000, 0x6884, 0xd0b4, 0x0120, 0x68d4, 0x780e, 0x68d0,
-	0x780a, 0x00de, 0x2011, 0x0001, 0x080c, 0x3e98, 0x080c, 0x2819,
-	0x080c, 0x2819, 0x080c, 0x2819, 0x080c, 0x2819, 0x080c, 0x3e98,
-	0x008e, 0x00ee, 0x00fe, 0x080c, 0x3dc5, 0x2009, 0x9c40, 0x8109,
-	0x11b0, 0x080c, 0x3cfc, 0x2001, 0x0004, 0x200c, 0x918c, 0xfffd,
-	0x2102, 0x001e, 0x00fe, 0x00ee, 0x00de, 0x00ce, 0x00be, 0x00ae,
-	0x009e, 0x008e, 0x2009, 0x0017, 0x080c, 0x33bc, 0x0cf8, 0x2001,
-	0x020b, 0x2004, 0x9084, 0x0140, 0x1d10, 0x00f6, 0x2079, 0x0000,
-	0x7884, 0x00fe, 0xd0bc, 0x0178, 0x2001, 0x0201, 0x200c, 0x81ff,
-	0x0150, 0x080c, 0x3da3, 0x2d00, 0x9c05, 0x9b05, 0x0120, 0x080c,
-	0x3cfc, 0x0804, 0x3ca5, 0x080c, 0x3f0c, 0x080c, 0x3e30, 0x080c,
-	0x3d86, 0x080c, 0x3dbb, 0x00f6, 0x2079, 0x0100, 0x7824, 0xd0ac,
-	0x0130, 0x8b58, 0x080c, 0x3cfc, 0x00fe, 0x0804, 0x3ca5, 0x00fe,
-	0x080c, 0x3cf2, 0x1150, 0x8d68, 0x2001, 0x0032, 0x2602, 0x2001,
-	0x0033, 0x2502, 0x080c, 0x3cfc, 0x0080, 0x87ff, 0x0138, 0x2001,
-	0x0201, 0x2004, 0x9005, 0x1908, 0x8739, 0x0038, 0x2001, 0x1a3c,
-	0x2004, 0x9086, 0x0000, 0x1904, 0x3bf5, 0x2001, 0x032f, 0x2003,
-	0x00f6, 0x8631, 0x1208, 0x8529, 0x2500, 0x9605, 0x0904, 0x3ca5,
-	0x7884, 0xd0bc, 0x0128, 0x2d00, 0x9c05, 0x9b05, 0x1904, 0x3ca5,
-	0xa013, 0x0019, 0x2001, 0x032a, 0x2003, 0x0004, 0x7884, 0xd0ac,
-	0x1148, 0x2001, 0x1a3c, 0x2003, 0x0003, 0x2001, 0x032a, 0x2003,
-	0x0009, 0x0030, 0xa017, 0x0001, 0x78b4, 0x9005, 0x0108, 0xa016,
-	0x2800, 0xa05a, 0x2009, 0x0040, 0x080c, 0x2052, 0x2900, 0xa85a,
-	0xa813, 0x0019, 0x7884, 0xd0a4, 0x1180, 0xa817, 0x0000, 0x00c6,
-	0x20a9, 0x0004, 0x2061, 0x0090, 0x602b, 0x0008, 0x2001, 0x0203,
-	0x2004, 0x1f04, 0x3c7c, 0x00ce, 0x0030, 0xa817, 0x0001, 0x78b0,
-	0x9005, 0x0108, 0xa816, 0x00f6, 0x00c6, 0x2079, 0x0100, 0x2061,
-	0x0090, 0x7827, 0x0002, 0x2001, 0x002a, 0x2004, 0x9084, 0xfff8,
-	0x601a, 0x0006, 0x2001, 0x002b, 0x2004, 0x601e, 0x78c6, 0x000e,
-	0x78ca, 0x00ce, 0x00fe, 0x0804, 0x3baf, 0x001e, 0x00c6, 0x2001,
-	0x032a, 0x2003, 0x0004, 0x2061, 0x0100, 0x6027, 0x0002, 0x6106,
-	0x2011, 0x020d, 0x2013, 0x0020, 0x2001, 0x0004, 0x200c, 0x918c,
-	0xfffd, 0x2102, 0x080c, 0x12d6, 0x7884, 0x9084, 0x0003, 0x9086,
-	0x0002, 0x01b0, 0x2009, 0x0028, 0x080c, 0x2052, 0x2001, 0x0227,
-	0x200c, 0x2102, 0x6050, 0x9084, 0xb7ff, 0x080c, 0x28d4, 0x6052,
-	0x602f, 0x0000, 0x604b, 0xf7f7, 0x6043, 0x0090, 0x6043, 0x0010,
-	0x080c, 0x98e4, 0x00ce, 0x2d08, 0x2c10, 0x2b18, 0x2b00, 0x9c05,
-	0x9d05, 0x00fe, 0x00ee, 0x00de, 0x00ce, 0x00be, 0x00ae, 0x009e,
-	0x008e, 0x1118, 0x012e, 0x0804, 0x338a, 0x012e, 0x2021, 0x400c,
-	0x0804, 0x338c, 0x9085, 0x0001, 0x1d04, 0x3cfb, 0x2091, 0x6000,
-	0x8420, 0x9486, 0x0064, 0x0005, 0x2001, 0x0105, 0x2003, 0x0010,
-	0x2001, 0x032a, 0x2003, 0x0004, 0x2001, 0x1a3c, 0x2003, 0x0000,
-	0x0071, 0x2009, 0x0048, 0x080c, 0x2052, 0x2001, 0x0227, 0x2024,
-	0x2402, 0x2001, 0x0109, 0x2003, 0x4000, 0x9026, 0x0005, 0x00f6,
-	0x00e6, 0x2071, 0x19b8, 0x7054, 0x9086, 0x0000, 0x0520, 0x2079,
-	0x0090, 0x2009, 0x0206, 0x2104, 0x2009, 0x0203, 0x210c, 0x9106,
-	0x1120, 0x2009, 0x0040, 0x080c, 0x2052, 0x782c, 0xd0fc, 0x0d88,
-	0x080c, 0x3f0c, 0x7054, 0x9086, 0x0000, 0x1d58, 0x782b, 0x0004,
-	0x782c, 0xd0ac, 0x1de8, 0x2009, 0x0040, 0x080c, 0x2052, 0x782b,
-	0x0002, 0x7057, 0x0000, 0x00ee, 0x00fe, 0x0005, 0x00f6, 0x2079,
-	0x0100, 0x2001, 0x1817, 0x200c, 0x7932, 0x7936, 0x080c, 0x246d,
-	0x080c, 0x2890, 0x080c, 0x28d4, 0x784b, 0xf7f7, 0x7843, 0x0090,
-	0x7843, 0x0010, 0x7850, 0xc0e5, 0x7852, 0x2019, 0x61a8, 0x7820,
-	0xd09c, 0x0110, 0x8319, 0x1dd8, 0x7850, 0xc0e4, 0x7852, 0x2011,
-	0x0048, 0x080c, 0x286d, 0x7843, 0x0040, 0x2019, 0x01f4, 0xa001,
-	0xa001, 0x8319, 0x1de0, 0x2001, 0x0100, 0x080c, 0x2833, 0x2011,
-	0x0020, 0x080c, 0x286d, 0x7843, 0x0000, 0x9006, 0x080c, 0x2833,
-	0x2011, 0x0048, 0x080c, 0x286d, 0x00fe, 0x0005, 0x7884, 0xd0ac,
-	0x11c8, 0x00f6, 0x00e6, 0x2071, 0x1a3c, 0x2079, 0x0320, 0x2001,
-	0x0201, 0x2004, 0x9005, 0x0160, 0x7000, 0x9086, 0x0000, 0x1140,
-	0x0051, 0xd0bc, 0x0108, 0x8738, 0x7003, 0x0003, 0x782b, 0x0019,
-	0x00ee, 0x00fe, 0x0005, 0x00f6, 0x2079, 0x0300, 0x78bc, 0x00fe,
-	0x908c, 0x0070, 0x0178, 0x2009, 0x0032, 0x260a, 0x2009, 0x0033,
-	0x250a, 0xd0b4, 0x0108, 0x8c60, 0xd0ac, 0x0108, 0x8d68, 0xd0a4,
-	0x0108, 0x8b58, 0x0005, 0x00f6, 0x2079, 0x0200, 0x781c, 0xd084,
-	0x0110, 0x7837, 0x0050, 0x00fe, 0x0005, 0x00e6, 0x2071, 0x0100,
-	0x2001, 0x197b, 0x2004, 0x70e2, 0x080c, 0x3ad7, 0x1188, 0x2001,
-	0x181f, 0x2004, 0x2009, 0x181e, 0x210c, 0x918c, 0x00ff, 0x706e,
-	0x716a, 0x7066, 0x918d, 0x3200, 0x7162, 0x7073, 0xe109, 0x0080,
-	0x702c, 0x9085, 0x0002, 0x702e, 0x2009, 0x1817, 0x210c, 0x716e,
-	0x7063, 0x0100, 0x7166, 0x719e, 0x706b, 0x0000, 0x7073, 0x0809,
-	0x7077, 0x0008, 0x7078, 0x9080, 0x0100, 0x707a, 0x7080, 0x8000,
-	0x7082, 0x7087, 0xaaaa, 0x9006, 0x708a, 0x708e, 0x707e, 0x70d6,
-	0x70ab, 0x0036, 0x70af, 0x95d5, 0x7014, 0x9084, 0x1984, 0x9085,
-	0x0092, 0x7016, 0x080c, 0x3f0c, 0x00f6, 0x2071, 0x1a3c, 0x2079,
-	0x0320, 0x00d6, 0x2069, 0x0000, 0x6884, 0xd0b4, 0x0120, 0x689c,
-	0x780e, 0x6898, 0x780a, 0x00de, 0x2009, 0x03e8, 0x8109, 0x1df0,
-	0x792c, 0xd1fc, 0x0110, 0x782b, 0x0004, 0x2011, 0x0011, 0x080c,
-	0x3e98, 0x2011, 0x0001, 0x080c, 0x3e98, 0x00fe, 0x00ee, 0x0005,
-	0x00f6, 0x00e6, 0x2071, 0x1a3c, 0x2079, 0x0320, 0x792c, 0xd1fc,
-	0x0904, 0x3e95, 0x782b, 0x0002, 0x9026, 0xd19c, 0x1904, 0x3e91,
-	0x7000, 0x0002, 0x3e95, 0x3e46, 0x3e76, 0x3e91, 0xd1bc, 0x1170,
-	0xd1dc, 0x1190, 0x8001, 0x7002, 0x2011, 0x0001, 0x080c, 0x3e98,
-	0x0904, 0x3e95, 0x080c, 0x3e98, 0x0804, 0x3e95, 0x00f6, 0x2079,
-	0x0300, 0x78bf, 0x0000, 0x00fe, 0x7810, 0x7914, 0x782b, 0x0004,
-	0x7812, 0x7916, 0x2001, 0x0201, 0x200c, 0x81ff, 0x0de8, 0x080c,
-	0x3da3, 0x2009, 0x0001, 0x00f6, 0x2079, 0x0300, 0x78b8, 0x00fe,
-	0xd0ec, 0x0110, 0x2009, 0x0011, 0x792a, 0x00f8, 0x8001, 0x7002,
-	0x9184, 0x0880, 0x1140, 0x782c, 0xd0fc, 0x1904, 0x3e3a, 0x2011,
-	0x0001, 0x00b1, 0x0090, 0xa010, 0x9092, 0x0004, 0x9086, 0x0015,
-	0x1120, 0xa000, 0xa05a, 0x2011, 0x0031, 0xa212, 0xd1dc, 0x1960,
-	0x0828, 0x782b, 0x0004, 0x7003, 0x0000, 0x00ee, 0x00fe, 0x0005,
-	0xa014, 0x9005, 0x0550, 0x8001, 0x0036, 0x0096, 0xa016, 0xa058,
-	0x2048, 0xa010, 0x2009, 0x0031, 0x911a, 0x831c, 0x831c, 0x938a,
-	0x0007, 0x1a0c, 0x0d65, 0x9398, 0x3ec6, 0x231d, 0x083f, 0x9080,
-	0x0004, 0x7a2a, 0x7100, 0x8108, 0x7102, 0x009e, 0x003e, 0x908a,
-	0x0035, 0x1140, 0x0096, 0xa058, 0x2048, 0xa804, 0xa05a, 0x2001,
-	0x0019, 0x009e, 0xa012, 0x9085, 0x0001, 0x0005, 0x3f03, 0x3efa,
-	0x3ef1, 0x3ee8, 0x3edf, 0x3ed6, 0x3ecd, 0xa964, 0x7902, 0xa968,
-	0x7906, 0xa96c, 0x7912, 0xa970, 0x7916, 0x0005, 0xa974, 0x7902,
-	0xa978, 0x7906, 0xa97c, 0x7912, 0xa980, 0x7916, 0x0005, 0xa984,
-	0x7902, 0xa988, 0x7906, 0xa98c, 0x7912, 0xa990, 0x7916, 0x0005,
-	0xa994, 0x7902, 0xa998, 0x7906, 0xa99c, 0x7912, 0xa9a0, 0x7916,
-	0x0005, 0xa9a4, 0x7902, 0xa9a8, 0x7906, 0xa9ac, 0x7912, 0xa9b0,
-	0x7916, 0x0005, 0xa9b4, 0x7902, 0xa9b8, 0x7906, 0xa9bc, 0x7912,
-	0xa9c0, 0x7916, 0x0005, 0xa9c4, 0x7902, 0xa9c8, 0x7906, 0xa9cc,
-	0x7912, 0xa9d0, 0x7916, 0x0005, 0x00f6, 0x00e6, 0x0086, 0x2071,
-	0x19b8, 0x2079, 0x0090, 0x792c, 0xd1fc, 0x01e8, 0x782b, 0x0002,
-	0x2940, 0x9026, 0x7054, 0x0002, 0x3f33, 0x3f1f, 0x3f2a, 0x8001,
-	0x7056, 0xd19c, 0x1180, 0x2011, 0x0001, 0x080c, 0x3e98, 0x190c,
-	0x3e98, 0x0048, 0x8001, 0x7056, 0x782c, 0xd0fc, 0x1d38, 0x2011,
-	0x0001, 0x080c, 0x3e98, 0x008e, 0x00ee, 0x00fe, 0x0005, 0x00f6,
-	0x00e6, 0x00c6, 0x0086, 0x2061, 0x0200, 0x2001, 0x197b, 0x2004,
-	0x601a, 0x2061, 0x0100, 0x2001, 0x197a, 0x2004, 0x60ce, 0x6104,
-	0xc1ac, 0x6106, 0x2001, 0x002c, 0x2004, 0x9005, 0x0520, 0x2038,
-	0x2001, 0x002e, 0x2024, 0x2001, 0x002f, 0x201c, 0x080c, 0x4878,
-	0xa813, 0x0019, 0xaf16, 0x2900, 0xa85a, 0x978a, 0x0007, 0x0220,
-	0x2138, 0x2009, 0x0007, 0x0010, 0x2708, 0x903e, 0x0096, 0xa858,
-	0x2048, 0xa85c, 0x9080, 0x0019, 0x009e, 0x080c, 0x3faf, 0x1d68,
-	0x2900, 0xa85a, 0x00d0, 0x080c, 0x4878, 0xa813, 0x0019, 0xa817,
-	0x0001, 0x2900, 0xa85a, 0x2001, 0x002e, 0x2004, 0xa866, 0x2001,
-	0x002f, 0x2004, 0xa86a, 0x2001, 0x002a, 0x2004, 0x9084, 0xfff8,
-	0xa86e, 0x2001, 0x002b, 0x2004, 0xa872, 0x2061, 0x0090, 0x2079,
-	0x0100, 0x2001, 0x197a, 0x2004, 0x6036, 0x2009, 0x0040, 0x080c,
-	0x2052, 0x2001, 0x002a, 0x2004, 0x9084, 0xfff8, 0x601a, 0x0006,
-	0x2001, 0x002b, 0x2004, 0x601e, 0x78c6, 0x000e, 0x78ca, 0x9006,
-	0x600a, 0x600e, 0x008e, 0x00ce, 0x00ee, 0x00fe, 0x0005, 0x00e6,
-	0x2071, 0x0080, 0xaa60, 0x22e8, 0x20a0, 0x20e1, 0x0000, 0x2099,
-	0x0088, 0x702b, 0x0026, 0x7402, 0x7306, 0x9006, 0x700a, 0x700e,
-	0x810b, 0x810b, 0x21a8, 0x810b, 0x7112, 0x702b, 0x0041, 0x702c,
-	0xd0fc, 0x0de8, 0x702b, 0x0002, 0x702b, 0x0040, 0x4005, 0x7400,
-	0x7304, 0x87ff, 0x0190, 0x0086, 0x0096, 0x2940, 0x0086, 0x080c,
-	0x4878, 0x008e, 0xa058, 0x00a6, 0x2050, 0x2900, 0xb006, 0xa05a,
-	0x00ae, 0x009e, 0x008e, 0x9085, 0x0001, 0x00ee, 0x0005, 0x00e6,
-	0x2001, 0x002d, 0x2004, 0x9005, 0x0528, 0x2038, 0x2001, 0x0030,
-	0x2024, 0x2001, 0x0031, 0x201c, 0x080c, 0x4878, 0x2940, 0xa813,
+	0x003f, 0x9084, 0xffc0, 0x9080, 0x001b, 0x080c, 0x48c3, 0x701f,
+	0x39f4, 0x7023, 0x0001, 0x012e, 0x0005, 0x080c, 0x98bb, 0x0046,
+	0x0086, 0x0096, 0x00a6, 0x00b6, 0x00c6, 0x00d6, 0x00e6, 0x00f6,
+	0x080c, 0x389c, 0x2001, 0x196f, 0x2003, 0x0000, 0x2021, 0x000a,
+	0x2061, 0x0100, 0x6104, 0x0016, 0x60bb, 0x0000, 0x60bf, 0x32e1,
+	0x60bf, 0x0012, 0x080c, 0x3b26, 0x080c, 0x3ae5, 0x00f6, 0x00e6,
+	0x0086, 0x2940, 0x2071, 0x19b7, 0x2079, 0x0090, 0x00d6, 0x2069,
+	0x0000, 0x6884, 0xd0b4, 0x0140, 0x2001, 0x0035, 0x2004, 0x780e,
+	0x2001, 0x0034, 0x2004, 0x780a, 0x00de, 0x2011, 0x0001, 0x080c,
+	0x3e97, 0x008e, 0x00ee, 0x00fe, 0x080c, 0x3dc4, 0x080c, 0x3cf1,
+	0x05b8, 0x2001, 0x020b, 0x2004, 0x9084, 0x0140, 0x1db8, 0x080c,
+	0x3f0b, 0x00f6, 0x2079, 0x0300, 0x78bc, 0x00fe, 0x908c, 0x0070,
+	0x1560, 0x2071, 0x0200, 0x7037, 0x0000, 0x7050, 0x9084, 0xff00,
+	0x9086, 0x3200, 0x1510, 0x7037, 0x0001, 0x7050, 0x9084, 0xff00,
+	0x9086, 0xe100, 0x11d0, 0x7037, 0x0000, 0x7054, 0x7037, 0x0000,
+	0x715c, 0x9106, 0x1190, 0x2001, 0x181f, 0x2004, 0x9106, 0x1168,
+	0x00c6, 0x2061, 0x0100, 0x6024, 0x9084, 0x1e00, 0x00ce, 0x0138,
+	0x080c, 0x3cfb, 0x080c, 0x3ae0, 0x0058, 0x080c, 0x3ae0, 0x080c,
+	0x3e2f, 0x080c, 0x3dba, 0x2001, 0x020b, 0x2004, 0xd0e4, 0x0dd8,
+	0x2001, 0x032a, 0x2003, 0x0004, 0x2061, 0x0100, 0x6027, 0x0002,
+	0x001e, 0x6106, 0x2011, 0x020d, 0x2013, 0x0020, 0x60bb, 0x0000,
+	0x60bf, 0x0108, 0x60bf, 0x0012, 0x2001, 0x0004, 0x200c, 0x918c,
+	0xfffd, 0x2102, 0x080c, 0x12e1, 0x2009, 0x0028, 0x080c, 0x2063,
+	0x2001, 0x0227, 0x200c, 0x2102, 0x080c, 0x98d7, 0x00fe, 0x00ee,
+	0x00de, 0x00ce, 0x00be, 0x00ae, 0x009e, 0x008e, 0x004e, 0x2001,
+	0x196f, 0x2004, 0x9005, 0x1118, 0x012e, 0x0804, 0x337e, 0x012e,
+	0x2021, 0x400c, 0x0804, 0x3380, 0x0016, 0x0026, 0x0036, 0x0046,
+	0x0056, 0x0076, 0x0086, 0x0096, 0x00d6, 0x0156, 0x7014, 0x2048,
+	0x7020, 0x20a8, 0x8000, 0x7022, 0xa804, 0x9005, 0x0904, 0x3a50,
+	0x2048, 0x1f04, 0x3a04, 0x7068, 0x2040, 0xa28c, 0xa390, 0xa494,
+	0xa598, 0xa930, 0xa808, 0xd0b4, 0x1120, 0x2029, 0x0000, 0x2021,
+	0x0000, 0x0096, 0x7014, 0x2048, 0xa864, 0x009e, 0x9086, 0x0103,
+	0x0170, 0x8906, 0x8006, 0x8007, 0x90bc, 0x003f, 0x9084, 0xffc0,
+	0x9080, 0x001b, 0x080c, 0x48c3, 0x701f, 0x39f4, 0x00b0, 0x8906,
+	0x8006, 0x8007, 0x90bc, 0x003f, 0x9084, 0xffc0, 0x9080, 0x001b,
+	0x21a8, 0x27e0, 0x2098, 0x27e8, 0x20a0, 0x0006, 0x080c, 0x0f9f,
+	0x000e, 0x080c, 0x48c6, 0x701f, 0x39f4, 0x015e, 0x00de, 0x009e,
+	0x008e, 0x007e, 0x005e, 0x004e, 0x003e, 0x002e, 0x001e, 0x0005,
+	0x7014, 0x2048, 0xa864, 0x9086, 0x0103, 0x1118, 0x701f, 0x3ab5,
+	0x0450, 0x7014, 0x2048, 0xa868, 0xc0fd, 0xa86a, 0x2009, 0x007f,
+	0x080c, 0x620b, 0x0110, 0x9006, 0x0030, 0xb813, 0x00ff, 0xb817,
+	0xfffd, 0x080c, 0xbd2a, 0x015e, 0x00de, 0x009e, 0x008e, 0x007e,
+	0x005e, 0x004e, 0x003e, 0x002e, 0x001e, 0x0904, 0x33b0, 0x0016,
+	0x0026, 0x0036, 0x0046, 0x0056, 0x0076, 0x0086, 0x0096, 0x00d6,
+	0x0156, 0x701f, 0x3a87, 0x7007, 0x0003, 0x0804, 0x3a45, 0xa830,
+	0x9086, 0x0100, 0x2021, 0x400c, 0x0904, 0x3380, 0x0076, 0xad10,
+	0xac0c, 0xab24, 0xaa20, 0xa930, 0xa808, 0xd0b4, 0x1120, 0x2029,
+	0x0000, 0x2021, 0x0000, 0x8906, 0x8006, 0x8007, 0x90bc, 0x003f,
+	0x9084, 0xffc0, 0x9080, 0x001b, 0x21a8, 0x27e0, 0x2098, 0x27e8,
+	0x20a0, 0x0006, 0x080c, 0x0f9f, 0x000e, 0x080c, 0x48c6, 0x007e,
+	0x701f, 0x39f4, 0x7023, 0x0001, 0x0005, 0x0804, 0x337e, 0x0156,
+	0x00c6, 0xa814, 0x908a, 0x001e, 0x0218, 0xa833, 0x001e, 0x0010,
+	0xa832, 0x0078, 0x81ff, 0x0168, 0x0016, 0x080c, 0x487a, 0x001e,
+	0x0130, 0xa800, 0x2040, 0xa008, 0xa80a, 0x2100, 0x0c58, 0x9006,
+	0x0010, 0x9085, 0x0001, 0x00ce, 0x015e, 0x0005, 0x0006, 0x00f6,
+	0x2079, 0x0000, 0x7880, 0x9086, 0x0044, 0x00fe, 0x000e, 0x0005,
+	0x2001, 0x196f, 0x2003, 0x0001, 0x0005, 0x00f6, 0x00e6, 0x00c6,
+	0x2061, 0x0200, 0x2001, 0x197a, 0x2004, 0x601a, 0x2061, 0x0100,
+	0x2001, 0x1979, 0x2004, 0x60ce, 0x6104, 0xc1ac, 0x6106, 0x080c,
+	0x487a, 0xa813, 0x0019, 0xa817, 0x0001, 0x2900, 0xa85a, 0x2001,
+	0x002e, 0x2004, 0xa866, 0x2001, 0x002f, 0x2004, 0xa86a, 0x2061,
+	0x0090, 0x2079, 0x0100, 0x2001, 0x1979, 0x2004, 0x6036, 0x2009,
+	0x0040, 0x080c, 0x2063, 0x2001, 0x002a, 0x2004, 0x9084, 0xfff8,
+	0xa86e, 0x601a, 0xa873, 0x0000, 0x601f, 0x0000, 0x78ca, 0x9006,
+	0x600a, 0x600e, 0x00ce, 0x00ee, 0x00fe, 0x0005, 0x00e6, 0x080c,
+	0x487a, 0x2940, 0xa013, 0x0019, 0xa017, 0x0001, 0x2800, 0xa05a,
+	0x2001, 0x0030, 0x2004, 0xa866, 0x2001, 0x0031, 0x2004, 0xa86a,
+	0x2001, 0x002a, 0x2004, 0x9084, 0xfff8, 0xa86e, 0xa873, 0x0000,
+	0x2001, 0x032a, 0x2003, 0x0004, 0x2001, 0x0300, 0x2003, 0x0000,
+	0x2001, 0x020d, 0x2003, 0x0000, 0x2001, 0x0004, 0x200c, 0x918d,
+	0x0002, 0x2102, 0x00ee, 0x0005, 0x0126, 0x2091, 0x8000, 0x81ff,
+	0x0148, 0x080c, 0x2830, 0x1130, 0x9006, 0x080c, 0x2787, 0x9006,
+	0x080c, 0x276a, 0x7884, 0x9084, 0x0007, 0x0002, 0x3b71, 0x3b7a,
+	0x3b83, 0x3b6e, 0x3b6e, 0x3b6e, 0x3b6e, 0x3b6e, 0x012e, 0x0804,
+	0x33b3, 0x2009, 0x0114, 0x2104, 0x9085, 0x0800, 0x200a, 0x080c,
+	0x3d45, 0x00c0, 0x2009, 0x0114, 0x2104, 0x9085, 0x4000, 0x200a,
+	0x080c, 0x3d45, 0x0078, 0x080c, 0x7096, 0x1128, 0x012e, 0x2009,
+	0x0016, 0x0804, 0x33b0, 0x81ff, 0x0128, 0x012e, 0x2021, 0x400b,
+	0x0804, 0x3380, 0x080c, 0x98bb, 0x0086, 0x0096, 0x00a6, 0x00b6,
+	0x00c6, 0x00d6, 0x00e6, 0x00f6, 0x080c, 0x389c, 0x2009, 0x0101,
+	0x210c, 0x0016, 0x7ec8, 0x7dcc, 0x9006, 0x2068, 0x2060, 0x2058,
+	0x080c, 0x3fe6, 0x080c, 0x3f36, 0x903e, 0x2720, 0x00f6, 0x00e6,
+	0x0086, 0x2940, 0x2071, 0x19b7, 0x2079, 0x0090, 0x00d6, 0x2069,
+	0x0000, 0x6884, 0xd0b4, 0x0120, 0x68d4, 0x780e, 0x68d0, 0x780a,
+	0x00de, 0x2011, 0x0001, 0x080c, 0x3e97, 0x080c, 0x2838, 0x080c,
+	0x2838, 0x080c, 0x2838, 0x080c, 0x2838, 0x080c, 0x3e97, 0x008e,
+	0x00ee, 0x00fe, 0x080c, 0x3dc4, 0x2009, 0x9c40, 0x8109, 0x11b0,
+	0x080c, 0x3cfb, 0x2001, 0x0004, 0x200c, 0x918c, 0xfffd, 0x2102,
+	0x001e, 0x00fe, 0x00ee, 0x00de, 0x00ce, 0x00be, 0x00ae, 0x009e,
+	0x008e, 0x2009, 0x0017, 0x080c, 0x33b0, 0x0cf8, 0x2001, 0x020b,
+	0x2004, 0x9084, 0x0140, 0x1d10, 0x00f6, 0x2079, 0x0000, 0x7884,
+	0x00fe, 0xd0bc, 0x0178, 0x2001, 0x0201, 0x200c, 0x81ff, 0x0150,
+	0x080c, 0x3da2, 0x2d00, 0x9c05, 0x9b05, 0x0120, 0x080c, 0x3cfb,
+	0x0804, 0x3ca4, 0x080c, 0x3f0b, 0x080c, 0x3e2f, 0x080c, 0x3d85,
+	0x080c, 0x3dba, 0x00f6, 0x2079, 0x0100, 0x7824, 0xd0ac, 0x0130,
+	0x8b58, 0x080c, 0x3cfb, 0x00fe, 0x0804, 0x3ca4, 0x00fe, 0x080c,
+	0x3cf1, 0x1150, 0x8d68, 0x2001, 0x0032, 0x2602, 0x2001, 0x0033,
+	0x2502, 0x080c, 0x3cfb, 0x0080, 0x87ff, 0x0138, 0x2001, 0x0201,
+	0x2004, 0x9005, 0x1908, 0x8739, 0x0038, 0x2001, 0x1a3b, 0x2004,
+	0x9086, 0x0000, 0x1904, 0x3bf4, 0x2001, 0x032f, 0x2003, 0x00f6,
+	0x8631, 0x1208, 0x8529, 0x2500, 0x9605, 0x0904, 0x3ca4, 0x7884,
+	0xd0bc, 0x0128, 0x2d00, 0x9c05, 0x9b05, 0x1904, 0x3ca4, 0xa013,
+	0x0019, 0x2001, 0x032a, 0x2003, 0x0004, 0x7884, 0xd0ac, 0x1148,
+	0x2001, 0x1a3b, 0x2003, 0x0003, 0x2001, 0x032a, 0x2003, 0x0009,
+	0x0030, 0xa017, 0x0001, 0x78b4, 0x9005, 0x0108, 0xa016, 0x2800,
+	0xa05a, 0x2009, 0x0040, 0x080c, 0x2063, 0x2900, 0xa85a, 0xa813,
+	0x0019, 0x7884, 0xd0a4, 0x1180, 0xa817, 0x0000, 0x00c6, 0x20a9,
+	0x0004, 0x2061, 0x0090, 0x602b, 0x0008, 0x2001, 0x0203, 0x2004,
+	0x1f04, 0x3c7b, 0x00ce, 0x0030, 0xa817, 0x0001, 0x78b0, 0x9005,
+	0x0108, 0xa816, 0x00f6, 0x00c6, 0x2079, 0x0100, 0x2061, 0x0090,
+	0x7827, 0x0002, 0x2001, 0x002a, 0x2004, 0x9084, 0xfff8, 0x601a,
+	0x0006, 0x2001, 0x002b, 0x2004, 0x601e, 0x78c6, 0x000e, 0x78ca,
+	0x00ce, 0x00fe, 0x0804, 0x3bae, 0x001e, 0x00c6, 0x2001, 0x032a,
+	0x2003, 0x0004, 0x2061, 0x0100, 0x6027, 0x0002, 0x6106, 0x2011,
+	0x020d, 0x2013, 0x0020, 0x2001, 0x0004, 0x200c, 0x918c, 0xfffd,
+	0x2102, 0x080c, 0x12e1, 0x7884, 0x9084, 0x0003, 0x9086, 0x0002,
+	0x01b0, 0x2009, 0x0028, 0x080c, 0x2063, 0x2001, 0x0227, 0x200c,
+	0x2102, 0x6050, 0x9084, 0xb7ff, 0x080c, 0x28e2, 0x6052, 0x602f,
+	0x0000, 0x604b, 0xf7f7, 0x6043, 0x0090, 0x6043, 0x0010, 0x080c,
+	0x98d7, 0x00ce, 0x2d08, 0x2c10, 0x2b18, 0x2b00, 0x9c05, 0x9d05,
+	0x00fe, 0x00ee, 0x00de, 0x00ce, 0x00be, 0x00ae, 0x009e, 0x008e,
+	0x1118, 0x012e, 0x0804, 0x337e, 0x012e, 0x2021, 0x400c, 0x0804,
+	0x3380, 0x9085, 0x0001, 0x1d04, 0x3cfa, 0x2091, 0x6000, 0x8420,
+	0x9486, 0x0064, 0x0005, 0x2001, 0x0105, 0x2003, 0x0010, 0x2001,
+	0x032a, 0x2003, 0x0004, 0x2001, 0x1a3b, 0x2003, 0x0000, 0x0071,
+	0x2009, 0x0048, 0x080c, 0x2063, 0x2001, 0x0227, 0x2024, 0x2402,
+	0x2001, 0x0109, 0x2003, 0x4000, 0x9026, 0x0005, 0x00f6, 0x00e6,
+	0x2071, 0x19b7, 0x7054, 0x9086, 0x0000, 0x0520, 0x2079, 0x0090,
+	0x2009, 0x0206, 0x2104, 0x2009, 0x0203, 0x210c, 0x9106, 0x1120,
+	0x2009, 0x0040, 0x080c, 0x2063, 0x782c, 0xd0fc, 0x0d88, 0x080c,
+	0x3f0b, 0x7054, 0x9086, 0x0000, 0x1d58, 0x782b, 0x0004, 0x782c,
+	0xd0ac, 0x1de8, 0x2009, 0x0040, 0x080c, 0x2063, 0x782b, 0x0002,
+	0x7057, 0x0000, 0x00ee, 0x00fe, 0x0005, 0x00f6, 0x2079, 0x0100,
+	0x2001, 0x1817, 0x200c, 0x7932, 0x7936, 0x080c, 0x2486, 0x080c,
+	0x28af, 0x080c, 0x28e2, 0x784b, 0xf7f7, 0x7843, 0x0090, 0x7843,
+	0x0010, 0x7850, 0xc0e5, 0x7852, 0x2019, 0x61a8, 0x7820, 0xd09c,
+	0x0110, 0x8319, 0x1dd8, 0x7850, 0xc0e4, 0x7852, 0x2011, 0x0048,
+	0x080c, 0x288c, 0x7843, 0x0040, 0x2019, 0x01f4, 0xa001, 0xa001,
+	0x8319, 0x1de0, 0x2001, 0x0100, 0x080c, 0x2852, 0x2011, 0x0020,
+	0x080c, 0x288c, 0x7843, 0x0000, 0x9006, 0x080c, 0x2852, 0x2011,
+	0x0048, 0x080c, 0x288c, 0x00fe, 0x0005, 0x7884, 0xd0ac, 0x11c8,
+	0x00f6, 0x00e6, 0x2071, 0x1a3b, 0x2079, 0x0320, 0x2001, 0x0201,
+	0x2004, 0x9005, 0x0160, 0x7000, 0x9086, 0x0000, 0x1140, 0x0051,
+	0xd0bc, 0x0108, 0x8738, 0x7003, 0x0003, 0x782b, 0x0019, 0x00ee,
+	0x00fe, 0x0005, 0x00f6, 0x2079, 0x0300, 0x78bc, 0x00fe, 0x908c,
+	0x0070, 0x0178, 0x2009, 0x0032, 0x260a, 0x2009, 0x0033, 0x250a,
+	0xd0b4, 0x0108, 0x8c60, 0xd0ac, 0x0108, 0x8d68, 0xd0a4, 0x0108,
+	0x8b58, 0x0005, 0x00f6, 0x2079, 0x0200, 0x781c, 0xd084, 0x0110,
+	0x7837, 0x0050, 0x00fe, 0x0005, 0x00e6, 0x2071, 0x0100, 0x2001,
+	0x197a, 0x2004, 0x70e2, 0x080c, 0x3ad6, 0x1188, 0x2001, 0x181f,
+	0x2004, 0x2009, 0x181e, 0x210c, 0x918c, 0x00ff, 0x706e, 0x716a,
+	0x7066, 0x918d, 0x3200, 0x7162, 0x7073, 0xe109, 0x0080, 0x702c,
+	0x9085, 0x0002, 0x702e, 0x2009, 0x1817, 0x210c, 0x716e, 0x7063,
+	0x0100, 0x7166, 0x719e, 0x706b, 0x0000, 0x7073, 0x0809, 0x7077,
+	0x0008, 0x7078, 0x9080, 0x0100, 0x707a, 0x7080, 0x8000, 0x7082,
+	0x7087, 0xaaaa, 0x9006, 0x708a, 0x708e, 0x707e, 0x70d6, 0x70ab,
+	0x0036, 0x70af, 0x95d5, 0x7014, 0x9084, 0x1984, 0x9085, 0x0092,
+	0x7016, 0x080c, 0x3f0b, 0x00f6, 0x2071, 0x1a3b, 0x2079, 0x0320,
+	0x00d6, 0x2069, 0x0000, 0x6884, 0xd0b4, 0x0120, 0x689c, 0x780e,
+	0x6898, 0x780a, 0x00de, 0x2009, 0x03e8, 0x8109, 0x1df0, 0x792c,
+	0xd1fc, 0x0110, 0x782b, 0x0004, 0x2011, 0x0011, 0x080c, 0x3e97,
+	0x2011, 0x0001, 0x080c, 0x3e97, 0x00fe, 0x00ee, 0x0005, 0x00f6,
+	0x00e6, 0x2071, 0x1a3b, 0x2079, 0x0320, 0x792c, 0xd1fc, 0x0904,
+	0x3e94, 0x782b, 0x0002, 0x9026, 0xd19c, 0x1904, 0x3e90, 0x7000,
+	0x0002, 0x3e94, 0x3e45, 0x3e75, 0x3e90, 0xd1bc, 0x1170, 0xd1dc,
+	0x1190, 0x8001, 0x7002, 0x2011, 0x0001, 0x080c, 0x3e97, 0x0904,
+	0x3e94, 0x080c, 0x3e97, 0x0804, 0x3e94, 0x00f6, 0x2079, 0x0300,
+	0x78bf, 0x0000, 0x00fe, 0x7810, 0x7914, 0x782b, 0x0004, 0x7812,
+	0x7916, 0x2001, 0x0201, 0x200c, 0x81ff, 0x0de8, 0x080c, 0x3da2,
+	0x2009, 0x0001, 0x00f6, 0x2079, 0x0300, 0x78b8, 0x00fe, 0xd0ec,
+	0x0110, 0x2009, 0x0011, 0x792a, 0x00f8, 0x8001, 0x7002, 0x9184,
+	0x0880, 0x1140, 0x782c, 0xd0fc, 0x1904, 0x3e39, 0x2011, 0x0001,
+	0x00b1, 0x0090, 0xa010, 0x9092, 0x0004, 0x9086, 0x0015, 0x1120,
+	0xa000, 0xa05a, 0x2011, 0x0031, 0xa212, 0xd1dc, 0x1960, 0x0828,
+	0x782b, 0x0004, 0x7003, 0x0000, 0x00ee, 0x00fe, 0x0005, 0xa014,
+	0x9005, 0x0550, 0x8001, 0x0036, 0x0096, 0xa016, 0xa058, 0x2048,
+	0xa010, 0x2009, 0x0031, 0x911a, 0x831c, 0x831c, 0x938a, 0x0007,
+	0x1a0c, 0x0d65, 0x9398, 0x3ec5, 0x231d, 0x083f, 0x9080, 0x0004,
+	0x7a2a, 0x7100, 0x8108, 0x7102, 0x009e, 0x003e, 0x908a, 0x0035,
+	0x1140, 0x0096, 0xa058, 0x2048, 0xa804, 0xa05a, 0x2001, 0x0019,
+	0x009e, 0xa012, 0x9085, 0x0001, 0x0005, 0x3f02, 0x3ef9, 0x3ef0,
+	0x3ee7, 0x3ede, 0x3ed5, 0x3ecc, 0xa964, 0x7902, 0xa968, 0x7906,
+	0xa96c, 0x7912, 0xa970, 0x7916, 0x0005, 0xa974, 0x7902, 0xa978,
+	0x7906, 0xa97c, 0x7912, 0xa980, 0x7916, 0x0005, 0xa984, 0x7902,
+	0xa988, 0x7906, 0xa98c, 0x7912, 0xa990, 0x7916, 0x0005, 0xa994,
+	0x7902, 0xa998, 0x7906, 0xa99c, 0x7912, 0xa9a0, 0x7916, 0x0005,
+	0xa9a4, 0x7902, 0xa9a8, 0x7906, 0xa9ac, 0x7912, 0xa9b0, 0x7916,
+	0x0005, 0xa9b4, 0x7902, 0xa9b8, 0x7906, 0xa9bc, 0x7912, 0xa9c0,
+	0x7916, 0x0005, 0xa9c4, 0x7902, 0xa9c8, 0x7906, 0xa9cc, 0x7912,
+	0xa9d0, 0x7916, 0x0005, 0x00f6, 0x00e6, 0x0086, 0x2071, 0x19b7,
+	0x2079, 0x0090, 0x792c, 0xd1fc, 0x01e8, 0x782b, 0x0002, 0x2940,
+	0x9026, 0x7054, 0x0002, 0x3f32, 0x3f1e, 0x3f29, 0x8001, 0x7056,
+	0xd19c, 0x1180, 0x2011, 0x0001, 0x080c, 0x3e97, 0x190c, 0x3e97,
+	0x0048, 0x8001, 0x7056, 0x782c, 0xd0fc, 0x1d38, 0x2011, 0x0001,
+	0x080c, 0x3e97, 0x008e, 0x00ee, 0x00fe, 0x0005, 0x00f6, 0x00e6,
+	0x00c6, 0x0086, 0x2061, 0x0200, 0x2001, 0x197a, 0x2004, 0x601a,
+	0x2061, 0x0100, 0x2001, 0x1979, 0x2004, 0x60ce, 0x6104, 0xc1ac,
+	0x6106, 0x2001, 0x002c, 0x2004, 0x9005, 0x0520, 0x2038, 0x2001,
+	0x002e, 0x2024, 0x2001, 0x002f, 0x201c, 0x080c, 0x487a, 0xa813,
 	0x0019, 0xaf16, 0x2900, 0xa85a, 0x978a, 0x0007, 0x0220, 0x2138,
 	0x2009, 0x0007, 0x0010, 0x2708, 0x903e, 0x0096, 0xa858, 0x2048,
-	0xa85c, 0x9080, 0x0019, 0x009e, 0x080c, 0x3faf, 0x1d68, 0x2900,
-	0xa85a, 0x00d8, 0x080c, 0x4878, 0x2940, 0xa013, 0x0019, 0xa017,
-	0x0001, 0x2800, 0xa05a, 0x2001, 0x0030, 0x2004, 0xa066, 0x2001,
-	0x0031, 0x2004, 0xa06a, 0x2001, 0x002a, 0x2004, 0x9084, 0xfff8,
-	0xa06e, 0x2001, 0x002b, 0x2004, 0xa072, 0x2001, 0x032a, 0x2003,
-	0x0004, 0x7884, 0xd0ac, 0x1180, 0x2001, 0x0101, 0x200c, 0x918d,
-	0x0200, 0x2102, 0xa017, 0x0000, 0x2001, 0x1a3c, 0x2003, 0x0003,
-	0x2001, 0x032a, 0x2003, 0x0009, 0x2001, 0x0300, 0x2003, 0x0000,
-	0x2001, 0x020d, 0x2003, 0x0000, 0x2001, 0x0004, 0x200c, 0x918d,
-	0x0002, 0x2102, 0x00ee, 0x0005, 0x0126, 0x2091, 0x8000, 0x20a9,
-	0x0013, 0x20a1, 0x1840, 0x20e9, 0x0001, 0x9006, 0x4004, 0x2009,
-	0x013c, 0x200a, 0x012e, 0x7880, 0x9086, 0x0052, 0x0108, 0x0005,
-	0x0804, 0x338a, 0x7d98, 0x7c9c, 0x0804, 0x3481, 0x080c, 0x70b7,
-	0x190c, 0x5ca1, 0x2069, 0x1853, 0x2d00, 0x2009, 0x0030, 0x7a8c,
-	0x7b88, 0x7c9c, 0x7d98, 0x2039, 0x0001, 0x080c, 0x48c1, 0x701f,
-	0x4082, 0x0005, 0x080c, 0x539c, 0x1130, 0x3b00, 0x3a08, 0xc194,
-	0xc095, 0x20d8, 0x21d0, 0x2069, 0x1853, 0x6800, 0x9005, 0x0904,
-	0x33bf, 0x6804, 0xd094, 0x00c6, 0x2061, 0x0100, 0x6104, 0x0138,
-	0x6200, 0x9292, 0x0005, 0x0218, 0x918c, 0xffdf, 0x0010, 0x918d,
-	0x0020, 0x6106, 0x00ce, 0xd08c, 0x00c6, 0x2061, 0x0100, 0x6104,
-	0x0118, 0x918d, 0x0010, 0x0010, 0x918c, 0xffef, 0x6106, 0x00ce,
-	0xd084, 0x0158, 0x6a28, 0x928a, 0x007f, 0x1a04, 0x33bf, 0x9288,
-	0x318b, 0x210d, 0x918c, 0x00ff, 0x6162, 0xd0dc, 0x0130, 0x6828,
-	0x908a, 0x007f, 0x1a04, 0x33bf, 0x605a, 0x6888, 0x9084, 0x0030,
-	0x8004, 0x8004, 0x8004, 0x8004, 0x0006, 0x2009, 0x1982, 0x9080,
-	0x2560, 0x2005, 0x200a, 0x2008, 0x2001, 0x0018, 0x080c, 0x98b9,
-	0x2009, 0x0390, 0x200b, 0x0400, 0x000e, 0x2009, 0x1983, 0x9080,
-	0x2564, 0x2005, 0x200a, 0x6808, 0x908a, 0x0100, 0x0a04, 0x33bf,
-	0x908a, 0x0841, 0x1a04, 0x33bf, 0x9084, 0x0007, 0x1904, 0x33bf,
-	0x680c, 0x9005, 0x0904, 0x33bf, 0x6810, 0x9005, 0x0904, 0x33bf,
-	0x6848, 0x6940, 0x910a, 0x1a04, 0x33bf, 0x8001, 0x0904, 0x33bf,
-	0x684c, 0x6944, 0x910a, 0x1a04, 0x33bf, 0x8001, 0x0904, 0x33bf,
-	0x6814, 0x908c, 0x00ff, 0x614a, 0x8007, 0x9084, 0x00ff, 0x604e,
-	0x080c, 0x73e8, 0x080c, 0x6734, 0x080c, 0x6769, 0x6808, 0x602a,
-	0x080c, 0x1fc4, 0x2009, 0x0170, 0x200b, 0x0080, 0xa001, 0xa001,
-	0x200b, 0x0000, 0x0036, 0x6b08, 0x080c, 0x24c7, 0x003e, 0x6000,
-	0x9086, 0x0000, 0x1904, 0x41ee, 0x6818, 0x691c, 0x6a20, 0x6b24,
-	0x8007, 0x810f, 0x8217, 0x831f, 0x6016, 0x611a, 0x621e, 0x6322,
-	0x6c04, 0xd4f4, 0x0148, 0x6830, 0x6934, 0x6a38, 0x6b3c, 0x8007,
-	0x810f, 0x8217, 0x831f, 0x0010, 0x9084, 0xf0ff, 0x6006, 0x610a,
-	0x620e, 0x6312, 0x8007, 0x810f, 0x8217, 0x831f, 0x20a9, 0x0004,
-	0x20a1, 0x1984, 0x20e9, 0x0001, 0x4001, 0x20a9, 0x0004, 0x20a1,
-	0x199e, 0x20e9, 0x0001, 0x4001, 0x080c, 0x82d0, 0x00c6, 0x900e,
-	0x20a9, 0x0001, 0x6b70, 0xd384, 0x01c8, 0x0020, 0x839d, 0x12b0,
-	0x3508, 0x8109, 0x080c, 0x79be, 0x6878, 0x6016, 0x6874, 0x2008,
-	0x9084, 0xff00, 0x8007, 0x600a, 0x9184, 0x00ff, 0x6006, 0x8108,
-	0x1118, 0x6003, 0x0003, 0x0010, 0x6003, 0x0001, 0x1f04, 0x4166,
-	0x00ce, 0x00c6, 0x2061, 0x196d, 0x2063, 0x0001, 0x9006, 0x080c,
-	0x276e, 0x9006, 0x080c, 0x2751, 0x0000, 0x00ce, 0x00e6, 0x2c70,
-	0x080c, 0x0e9c, 0x00ee, 0x6888, 0xd0ec, 0x0130, 0x2011, 0x0114,
-	0x2204, 0x9085, 0x0180, 0x2012, 0x6a80, 0x9284, 0x0030, 0x9086,
-	0x0030, 0x1128, 0x9294, 0xffcf, 0x9295, 0x0020, 0x6a82, 0x2001,
-	0x194d, 0x6a80, 0x9294, 0x0030, 0x928e, 0x0000, 0x0170, 0x928e,
-	0x0010, 0x0118, 0x928e, 0x0020, 0x0140, 0x2003, 0xaaaa, 0x080c,
-	0x253c, 0x2001, 0x193e, 0x2102, 0x0008, 0x2102, 0x00c6, 0x2061,
-	0x0100, 0x602f, 0x0040, 0x602f, 0x0000, 0x00ce, 0x080c, 0x70b7,
-	0x0128, 0x080c, 0x4c91, 0x0110, 0x080c, 0x248d, 0x60d0, 0x9005,
-	0x01c0, 0x6003, 0x0001, 0x2009, 0x41d6, 0x00d0, 0x080c, 0x70b7,
-	0x1168, 0x2011, 0x6f2d, 0x080c, 0x8159, 0x2011, 0x6f20, 0x080c,
-	0x825f, 0x080c, 0x73bc, 0x080c, 0x6fe8, 0x0040, 0x080c, 0x5b97,
-	0x0028, 0x6003, 0x0004, 0x2009, 0x41ee, 0x0010, 0x0804, 0x338a,
-	0x2001, 0x0170, 0x2004, 0x9084, 0x00ff, 0x9086, 0x004c, 0x1118,
-	0x2091, 0x31bd, 0x0817, 0x2091, 0x313d, 0x0817, 0x6000, 0x9086,
-	0x0000, 0x0904, 0x33bc, 0x2069, 0x1853, 0x7890, 0x6842, 0x7894,
-	0x6846, 0x2d00, 0x2009, 0x0030, 0x7a8c, 0x7b88, 0x7c9c, 0x7d98,
-	0x2039, 0x0001, 0x0804, 0x48c4, 0x9006, 0x080c, 0x248d, 0x81ff,
-	0x1904, 0x33bc, 0x080c, 0x70b7, 0x11b0, 0x080c, 0x73b7, 0x080c,
-	0x5cdc, 0x080c, 0x3186, 0x0118, 0x6130, 0xc18d, 0x6132, 0x080c,
-	0xbf61, 0x0130, 0x080c, 0x70da, 0x1118, 0x080c, 0x708b, 0x0038,
-	0x080c, 0x6fe8, 0x0020, 0x080c, 0x5ca1, 0x080c, 0x5b97, 0x0804,
-	0x338a, 0x81ff, 0x1904, 0x33bc, 0x080c, 0x70b7, 0x1110, 0x0804,
-	0x33bc, 0x6190, 0x81ff, 0x01a8, 0x704f, 0x0000, 0x2001, 0x1d80,
-	0x2009, 0x0040, 0x7a8c, 0x7b88, 0x7c9c, 0x7d98, 0x0126, 0x2091,
-	0x8000, 0x2039, 0x0001, 0x080c, 0x48c4, 0x701f, 0x3388, 0x012e,
-	0x0005, 0x704f, 0x0001, 0x00d6, 0x2069, 0x1d80, 0x20a9, 0x0040,
-	0x20e9, 0x0001, 0x20a1, 0x1d80, 0x2019, 0xffff, 0x4304, 0x6558,
-	0x9588, 0x318b, 0x210d, 0x918c, 0x00ff, 0x216a, 0x900e, 0x2011,
-	0x0002, 0x2100, 0x9506, 0x01a8, 0x080c, 0x6270, 0x1190, 0xb814,
-	0x821c, 0x0238, 0x9398, 0x1d80, 0x9085, 0xff00, 0x8007, 0x201a,
-	0x0038, 0x9398, 0x1d80, 0x2324, 0x94a4, 0xff00, 0x9405, 0x201a,
-	0x8210, 0x8108, 0x9182, 0x0080, 0x1208, 0x0c18, 0x8201, 0x8007,
-	0x2d0c, 0x9105, 0x206a, 0x00de, 0x20a9, 0x0040, 0x20a1, 0x1d80,
-	0x2099, 0x1d80, 0x080c, 0x5c2c, 0x0804, 0x4246, 0x080c, 0x48ab,
-	0x0904, 0x33bf, 0x080c, 0x4878, 0x1120, 0x2009, 0x0002, 0x0804,
-	0x33bc, 0x080c, 0x538d, 0xd0b4, 0x0558, 0x7884, 0x908e, 0x007e,
-	0x0538, 0x908e, 0x007f, 0x0520, 0x908e, 0x0080, 0x0508, 0x080c,
-	0x3181, 0x1148, 0xb800, 0xd08c, 0x11d8, 0xb804, 0x9084, 0x00ff,
-	0x9086, 0x0006, 0x11a8, 0xa867, 0x0000, 0xa868, 0xc0fd, 0xa86a,
-	0x080c, 0xba16, 0x1120, 0x2009, 0x0003, 0x0804, 0x33bc, 0x7007,
-	0x0003, 0x701f, 0x42d4, 0x0005, 0x080c, 0x48ab, 0x0904, 0x33bf,
-	0x20a9, 0x002b, 0xb8b4, 0x20e0, 0xb8b8, 0x2098, 0xa860, 0x20e8,
-	0xa85c, 0x9080, 0x0002, 0x20a0, 0x4003, 0x20a9, 0x0008, 0x9080,
-	0x0006, 0x20a0, 0xb8b4, 0x20e0, 0xb8b8, 0x9080, 0x0006, 0x2098,
-	0x080c, 0x0f9f, 0x0070, 0x20a9, 0x0004, 0xa85c, 0x9080, 0x000a,
-	0x20a0, 0xb8b4, 0x20e0, 0xb8b8, 0x9080, 0x000a, 0x2098, 0x080c,
-	0x0f9f, 0x8906, 0x8006, 0x8007, 0x90bc, 0x003f, 0x9084, 0xffc0,
-	0x9080, 0x0002, 0x2009, 0x002b, 0x7a8c, 0x7b88, 0x7c9c, 0x7d98,
-	0x0804, 0x48c4, 0x81ff, 0x1904, 0x33bc, 0x080c, 0x488f, 0x0904,
-	0x33bf, 0x080c, 0x64b1, 0x0904, 0x33bc, 0x0058, 0xa878, 0x9005,
-	0x0120, 0x2009, 0x0004, 0x0804, 0x33bc, 0xa974, 0xaa94, 0x0804,
-	0x338a, 0x080c, 0x5395, 0x0904, 0x338a, 0x701f, 0x431e, 0x7007,
-	0x0003, 0x0005, 0x81ff, 0x1904, 0x33bc, 0x7888, 0x908a, 0x1000,
-	0x1a04, 0x33bf, 0x080c, 0x48ab, 0x0904, 0x33bf, 0x080c, 0x6667,
-	0x0120, 0x080c, 0x666f, 0x1904, 0x33bf, 0x080c, 0x6536, 0x0904,
-	0x33bc, 0x2019, 0x0004, 0x900e, 0x080c, 0x64c3, 0x0904, 0x33bc,
-	0x7984, 0x7a88, 0x04c9, 0x08a8, 0xa89c, 0x908a, 0x1000, 0x12f8,
-	0x080c, 0x48a9, 0x01e0, 0x080c, 0x6667, 0x0118, 0x080c, 0x666f,
-	0x11b0, 0x080c, 0x6536, 0x2009, 0x0002, 0x0168, 0x2009, 0x0002,
-	0x2019, 0x0004, 0x080c, 0x64c3, 0x2009, 0x0003, 0x0120, 0xa998,
-	0xaa9c, 0x00d1, 0x0060, 0xa897, 0x4005, 0xa99a, 0x0010, 0xa897,
-	0x4006, 0x900e, 0x9085, 0x0001, 0x2001, 0x0030, 0x0005, 0xa897,
-	0x4000, 0x080c, 0x5395, 0x0110, 0x9006, 0x0018, 0x900e, 0x9085,
-	0x0001, 0x2001, 0x0000, 0x0005, 0x9186, 0x00ff, 0x0110, 0x0071,
-	0x0060, 0x2029, 0x007e, 0x2061, 0x1800, 0x6458, 0x2400, 0x9506,
-	0x0110, 0x2508, 0x0019, 0x8529, 0x1ec8, 0x0005, 0x080c, 0x6270,
-	0x1138, 0x2200, 0x8003, 0x800b, 0x810b, 0x9108, 0x080c, 0x8167,
-	0x0005, 0x81ff, 0x1904, 0x33bc, 0x798c, 0x2001, 0x1951, 0x918c,
-	0x8000, 0x2102, 0x080c, 0x488f, 0x0904, 0x33bf, 0x080c, 0x6667,
-	0x0120, 0x080c, 0x666f, 0x1904, 0x33bf, 0x080c, 0x6337, 0x0904,
-	0x33bc, 0x080c, 0x64ba, 0x0904, 0x33bc, 0x2001, 0x1951, 0x2004,
-	0xd0fc, 0x1904, 0x338a, 0x0804, 0x4329, 0xa9a0, 0x2001, 0x1951,
-	0x918c, 0x8000, 0xc18d, 0x2102, 0x080c, 0x489c, 0x01a0, 0x080c,
-	0x6667, 0x0118, 0x080c, 0x666f, 0x1170, 0x080c, 0x6337, 0x2009,
-	0x0002, 0x0128, 0x080c, 0x64ba, 0x1170, 0x2009, 0x0003, 0xa897,
-	0x4005, 0xa99a, 0x0010, 0xa897, 0x4006, 0x900e, 0x9085, 0x0001,
-	0x2001, 0x0030, 0x0005, 0xa897, 0x4000, 0x2001, 0x1951, 0x2004,
-	0xd0fc, 0x1128, 0x080c, 0x5395, 0x0110, 0x9006, 0x0018, 0x900e,
-	0x9085, 0x0001, 0x2001, 0x0000, 0x0005, 0x81ff, 0x1904, 0x33bc,
-	0x798c, 0x2001, 0x1950, 0x918c, 0x8000, 0x2102, 0x080c, 0x488f,
-	0x0904, 0x33bf, 0x080c, 0x6667, 0x0120, 0x080c, 0x666f, 0x1904,
-	0x33bf, 0x080c, 0x6337, 0x0904, 0x33bc, 0x080c, 0x64a8, 0x0904,
-	0x33bc, 0x2001, 0x1950, 0x2004, 0xd0fc, 0x1904, 0x338a, 0x0804,
-	0x4329, 0xa9a0, 0x2001, 0x1950, 0x918c, 0x8000, 0xc18d, 0x2102,
-	0x080c, 0x489c, 0x01a0, 0x080c, 0x6667, 0x0118, 0x080c, 0x666f,
-	0x1170, 0x080c, 0x6337, 0x2009, 0x0002, 0x0128, 0x080c, 0x64a8,
-	0x1170, 0x2009, 0x0003, 0xa897, 0x4005, 0xa99a, 0x0010, 0xa897,
+	0xa85c, 0x9080, 0x0019, 0x009e, 0x080c, 0x3fae, 0x1d68, 0x2900,
+	0xa85a, 0x00d0, 0x080c, 0x487a, 0xa813, 0x0019, 0xa817, 0x0001,
+	0x2900, 0xa85a, 0x2001, 0x002e, 0x2004, 0xa866, 0x2001, 0x002f,
+	0x2004, 0xa86a, 0x2001, 0x002a, 0x2004, 0x9084, 0xfff8, 0xa86e,
+	0x2001, 0x002b, 0x2004, 0xa872, 0x2061, 0x0090, 0x2079, 0x0100,
+	0x2001, 0x1979, 0x2004, 0x6036, 0x2009, 0x0040, 0x080c, 0x2063,
+	0x2001, 0x002a, 0x2004, 0x9084, 0xfff8, 0x601a, 0x0006, 0x2001,
+	0x002b, 0x2004, 0x601e, 0x78c6, 0x000e, 0x78ca, 0x9006, 0x600a,
+	0x600e, 0x008e, 0x00ce, 0x00ee, 0x00fe, 0x0005, 0x00e6, 0x2071,
+	0x0080, 0xaa60, 0x22e8, 0x20a0, 0x20e1, 0x0000, 0x2099, 0x0088,
+	0x702b, 0x0026, 0x7402, 0x7306, 0x9006, 0x700a, 0x700e, 0x810b,
+	0x810b, 0x21a8, 0x810b, 0x7112, 0x702b, 0x0041, 0x702c, 0xd0fc,
+	0x0de8, 0x702b, 0x0002, 0x702b, 0x0040, 0x4005, 0x7400, 0x7304,
+	0x87ff, 0x0190, 0x0086, 0x0096, 0x2940, 0x0086, 0x080c, 0x487a,
+	0x008e, 0xa058, 0x00a6, 0x2050, 0x2900, 0xb006, 0xa05a, 0x00ae,
+	0x009e, 0x008e, 0x9085, 0x0001, 0x00ee, 0x0005, 0x00e6, 0x2001,
+	0x002d, 0x2004, 0x9005, 0x0528, 0x2038, 0x2001, 0x0030, 0x2024,
+	0x2001, 0x0031, 0x201c, 0x080c, 0x487a, 0x2940, 0xa813, 0x0019,
+	0xaf16, 0x2900, 0xa85a, 0x978a, 0x0007, 0x0220, 0x2138, 0x2009,
+	0x0007, 0x0010, 0x2708, 0x903e, 0x0096, 0xa858, 0x2048, 0xa85c,
+	0x9080, 0x0019, 0x009e, 0x080c, 0x3fae, 0x1d68, 0x2900, 0xa85a,
+	0x00d8, 0x080c, 0x487a, 0x2940, 0xa013, 0x0019, 0xa017, 0x0001,
+	0x2800, 0xa05a, 0x2001, 0x0030, 0x2004, 0xa066, 0x2001, 0x0031,
+	0x2004, 0xa06a, 0x2001, 0x002a, 0x2004, 0x9084, 0xfff8, 0xa06e,
+	0x2001, 0x002b, 0x2004, 0xa072, 0x2001, 0x032a, 0x2003, 0x0004,
+	0x7884, 0xd0ac, 0x1180, 0x2001, 0x0101, 0x200c, 0x918d, 0x0200,
+	0x2102, 0xa017, 0x0000, 0x2001, 0x1a3b, 0x2003, 0x0003, 0x2001,
+	0x032a, 0x2003, 0x0009, 0x2001, 0x0300, 0x2003, 0x0000, 0x2001,
+	0x020d, 0x2003, 0x0000, 0x2001, 0x0004, 0x200c, 0x918d, 0x0002,
+	0x2102, 0x00ee, 0x0005, 0x0126, 0x2091, 0x8000, 0x20a9, 0x0013,
+	0x20a1, 0x1840, 0x20e9, 0x0001, 0x9006, 0x4004, 0x2009, 0x013c,
+	0x200a, 0x012e, 0x7880, 0x9086, 0x0052, 0x0108, 0x0005, 0x0804,
+	0x337e, 0x7d98, 0x7c9c, 0x0804, 0x3480, 0x080c, 0x7096, 0x190c,
+	0x5c9c, 0x2069, 0x1853, 0x2d00, 0x2009, 0x0030, 0x7a8c, 0x7b88,
+	0x7c9c, 0x7d98, 0x2039, 0x0001, 0x080c, 0x48c3, 0x701f, 0x4081,
+	0x0005, 0x080c, 0x5397, 0x1130, 0x3b00, 0x3a08, 0xc194, 0xc095,
+	0x20d8, 0x21d0, 0x2069, 0x1853, 0x6800, 0x9005, 0x0904, 0x33b3,
+	0x6804, 0xd094, 0x00c6, 0x2061, 0x0100, 0x6104, 0x0138, 0x6200,
+	0x9292, 0x0005, 0x0218, 0x918c, 0xffdf, 0x0010, 0x918d, 0x0020,
+	0x6106, 0x00ce, 0xd08c, 0x00c6, 0x2061, 0x0100, 0x6104, 0x0118,
+	0x918d, 0x0010, 0x0010, 0x918c, 0xffef, 0x6106, 0x00ce, 0xd084,
+	0x0158, 0x6a28, 0x928a, 0x007f, 0x1a04, 0x33b3, 0x9288, 0x317f,
+	0x210d, 0x918c, 0x00ff, 0x6162, 0xd0dc, 0x0130, 0x6828, 0x908a,
+	0x007f, 0x1a04, 0x33b3, 0x605a, 0x6888, 0x9084, 0x0030, 0x8004,
+	0x8004, 0x8004, 0x8004, 0x0006, 0x2009, 0x1981, 0x9080, 0x2579,
+	0x2005, 0x200a, 0x2008, 0x2001, 0x0018, 0x080c, 0x98ac, 0x2009,
+	0x0390, 0x200b, 0x0400, 0x000e, 0x2009, 0x1982, 0x9080, 0x257d,
+	0x2005, 0x200a, 0x6808, 0x908a, 0x0100, 0x0a04, 0x33b3, 0x908a,
+	0x0841, 0x1a04, 0x33b3, 0x9084, 0x0007, 0x1904, 0x33b3, 0x680c,
+	0x9005, 0x0904, 0x33b3, 0x6810, 0x9005, 0x0904, 0x33b3, 0x6848,
+	0x6940, 0x910a, 0x1a04, 0x33b3, 0x8001, 0x0904, 0x33b3, 0x684c,
+	0x6944, 0x910a, 0x1a04, 0x33b3, 0x8001, 0x0904, 0x33b3, 0x6814,
+	0x908c, 0x00ff, 0x614a, 0x8007, 0x9084, 0x00ff, 0x604e, 0x080c,
+	0x73c7, 0x080c, 0x672f, 0x080c, 0x6764, 0x6808, 0x602a, 0x080c,
+	0x1fd5, 0x2009, 0x0170, 0x200b, 0x0080, 0xa001, 0xa001, 0x200b,
+	0x0000, 0x0036, 0x6b08, 0x080c, 0x24e0, 0x003e, 0x6000, 0x9086,
+	0x0000, 0x1904, 0x41ed, 0x6818, 0x691c, 0x6a20, 0x6b24, 0x8007,
+	0x810f, 0x8217, 0x831f, 0x6016, 0x611a, 0x621e, 0x6322, 0x6c04,
+	0xd4f4, 0x0148, 0x6830, 0x6934, 0x6a38, 0x6b3c, 0x8007, 0x810f,
+	0x8217, 0x831f, 0x0010, 0x9084, 0xf0ff, 0x6006, 0x610a, 0x620e,
+	0x6312, 0x8007, 0x810f, 0x8217, 0x831f, 0x20a9, 0x0004, 0x20a1,
+	0x1983, 0x20e9, 0x0001, 0x4001, 0x20a9, 0x0004, 0x20a1, 0x199d,
+	0x20e9, 0x0001, 0x4001, 0x080c, 0x82af, 0x00c6, 0x900e, 0x20a9,
+	0x0001, 0x6b70, 0xd384, 0x01c8, 0x0020, 0x839d, 0x12b0, 0x3508,
+	0x8109, 0x080c, 0x799d, 0x6878, 0x6016, 0x6874, 0x2008, 0x9084,
+	0xff00, 0x8007, 0x600a, 0x9184, 0x00ff, 0x6006, 0x8108, 0x1118,
+	0x6003, 0x0003, 0x0010, 0x6003, 0x0001, 0x1f04, 0x4165, 0x00ce,
+	0x00c6, 0x2061, 0x196c, 0x2063, 0x0001, 0x9006, 0x080c, 0x2787,
+	0x9006, 0x080c, 0x276a, 0x0000, 0x00ce, 0x00e6, 0x2c70, 0x080c,
+	0x0e9c, 0x00ee, 0x6888, 0xd0ec, 0x0130, 0x2011, 0x0114, 0x2204,
+	0x9085, 0x0180, 0x2012, 0x6a80, 0x9284, 0x0030, 0x9086, 0x0030,
+	0x1128, 0x9294, 0xffcf, 0x9295, 0x0020, 0x6a82, 0x2001, 0x194c,
+	0x6a80, 0x9294, 0x0030, 0x928e, 0x0000, 0x0170, 0x928e, 0x0010,
+	0x0118, 0x928e, 0x0020, 0x0140, 0x2003, 0xaaaa, 0x080c, 0x2555,
+	0x2001, 0x193d, 0x2102, 0x0008, 0x2102, 0x00c6, 0x2061, 0x0100,
+	0x602f, 0x0040, 0x602f, 0x0000, 0x00ce, 0x080c, 0x7096, 0x0128,
+	0x080c, 0x4c8c, 0x0110, 0x080c, 0x24a6, 0x60d0, 0x9005, 0x01c0,
+	0x6003, 0x0001, 0x2009, 0x41d5, 0x00d0, 0x080c, 0x7096, 0x1168,
+	0x2011, 0x6f0c, 0x080c, 0x8138, 0x2011, 0x6eff, 0x080c, 0x823e,
+	0x080c, 0x739b, 0x080c, 0x6fc7, 0x0040, 0x080c, 0x5b92, 0x0028,
+	0x6003, 0x0004, 0x2009, 0x41ed, 0x0010, 0x0804, 0x337e, 0x2001,
+	0x0170, 0x2004, 0x9084, 0x00ff, 0x9086, 0x004c, 0x1118, 0x2091,
+	0x31bd, 0x0817, 0x2091, 0x313d, 0x0817, 0x6000, 0x9086, 0x0000,
+	0x0904, 0x33b0, 0x2069, 0x1853, 0x7890, 0x6842, 0x7894, 0x6846,
+	0x2d00, 0x2009, 0x0030, 0x7a8c, 0x7b88, 0x7c9c, 0x7d98, 0x2039,
+	0x0001, 0x0804, 0x48c6, 0x9006, 0x080c, 0x24a6, 0x81ff, 0x1904,
+	0x33b0, 0x080c, 0x7096, 0x11b0, 0x080c, 0x7396, 0x080c, 0x5cd7,
+	0x080c, 0x317a, 0x0118, 0x6130, 0xc18d, 0x6132, 0x080c, 0xbf61,
+	0x0130, 0x080c, 0x70b9, 0x1118, 0x080c, 0x706a, 0x0038, 0x080c,
+	0x6fc7, 0x0020, 0x080c, 0x5c9c, 0x080c, 0x5b92, 0x0804, 0x337e,
+	0x81ff, 0x1904, 0x33b0, 0x080c, 0x7096, 0x1110, 0x0804, 0x33b0,
+	0x6190, 0x81ff, 0x01a8, 0x704f, 0x0000, 0x2001, 0x1d80, 0x2009,
+	0x0040, 0x7a8c, 0x7b88, 0x7c9c, 0x7d98, 0x0126, 0x2091, 0x8000,
+	0x2039, 0x0001, 0x080c, 0x48c6, 0x701f, 0x337c, 0x012e, 0x0005,
+	0x704f, 0x0001, 0x00d6, 0x2069, 0x1d80, 0x20a9, 0x0040, 0x20e9,
+	0x0001, 0x20a1, 0x1d80, 0x2019, 0xffff, 0x4304, 0x6558, 0x9588,
+	0x317f, 0x210d, 0x918c, 0x00ff, 0x216a, 0x900e, 0x2011, 0x0002,
+	0x2100, 0x9506, 0x01a8, 0x080c, 0x626b, 0x1190, 0xb814, 0x821c,
+	0x0238, 0x9398, 0x1d80, 0x9085, 0xff00, 0x8007, 0x201a, 0x0038,
+	0x9398, 0x1d80, 0x2324, 0x94a4, 0xff00, 0x9405, 0x201a, 0x8210,
+	0x8108, 0x9182, 0x0080, 0x1208, 0x0c18, 0x8201, 0x8007, 0x2d0c,
+	0x9105, 0x206a, 0x00de, 0x20a9, 0x0040, 0x20a1, 0x1d80, 0x2099,
+	0x1d80, 0x080c, 0x5c27, 0x0804, 0x4245, 0x080c, 0x48ad, 0x0904,
+	0x33b3, 0x080c, 0x487a, 0x1120, 0x2009, 0x0002, 0x0804, 0x33b0,
+	0x080c, 0x5388, 0xd0b4, 0x0558, 0x7884, 0x908e, 0x007e, 0x0538,
+	0x908e, 0x007f, 0x0520, 0x908e, 0x0080, 0x0508, 0x080c, 0x3175,
+	0x1148, 0xb800, 0xd08c, 0x11d8, 0xb804, 0x9084, 0x00ff, 0x9086,
+	0x0006, 0x11a8, 0xa867, 0x0000, 0xa868, 0xc0fd, 0xa86a, 0x080c,
+	0xba11, 0x1120, 0x2009, 0x0003, 0x0804, 0x33b0, 0x7007, 0x0003,
+	0x701f, 0x42d3, 0x0005, 0x080c, 0x48ad, 0x0904, 0x33b3, 0x20a9,
+	0x002b, 0xb8b4, 0x20e0, 0xb8b8, 0x2098, 0xa860, 0x20e8, 0xa85c,
+	0x9080, 0x0002, 0x20a0, 0x4003, 0x20a9, 0x0008, 0x9080, 0x0006,
+	0x20a0, 0xb8b4, 0x20e0, 0xb8b8, 0x9080, 0x0006, 0x2098, 0x080c,
+	0x0f9f, 0x0070, 0x20a9, 0x0004, 0xa85c, 0x9080, 0x000a, 0x20a0,
+	0xb8b4, 0x20e0, 0xb8b8, 0x9080, 0x000a, 0x2098, 0x080c, 0x0f9f,
+	0x8906, 0x8006, 0x8007, 0x90bc, 0x003f, 0x9084, 0xffc0, 0x9080,
+	0x0002, 0x2009, 0x002b, 0x7a8c, 0x7b88, 0x7c9c, 0x7d98, 0x0804,
+	0x48c6, 0x81ff, 0x1904, 0x33b0, 0x080c, 0x4891, 0x0904, 0x33b3,
+	0x080c, 0x64b0, 0x0904, 0x33b0, 0x0058, 0xa878, 0x9005, 0x0120,
+	0x2009, 0x0004, 0x0804, 0x33b0, 0xa974, 0xaa94, 0x0804, 0x337e,
+	0x080c, 0x5390, 0x0904, 0x337e, 0x701f, 0x431d, 0x7007, 0x0003,
+	0x0005, 0x81ff, 0x1904, 0x33b0, 0x7888, 0x908a, 0x1000, 0x1a04,
+	0x33b3, 0x080c, 0x48ad, 0x0904, 0x33b3, 0x080c, 0x6666, 0x0120,
+	0x080c, 0x666e, 0x1904, 0x33b3, 0x080c, 0x6535, 0x0904, 0x33b0,
+	0x2019, 0x0004, 0x900e, 0x080c, 0x64c2, 0x0904, 0x33b0, 0x7984,
+	0x7a88, 0x04c9, 0x08a8, 0xa89c, 0x908a, 0x1000, 0x12f8, 0x080c,
+	0x48ab, 0x01e0, 0x080c, 0x6666, 0x0118, 0x080c, 0x666e, 0x11b0,
+	0x080c, 0x6535, 0x2009, 0x0002, 0x0168, 0x2009, 0x0002, 0x2019,
+	0x0004, 0x080c, 0x64c2, 0x2009, 0x0003, 0x0120, 0xa998, 0xaa9c,
+	0x00d1, 0x0060, 0xa897, 0x4005, 0xa99a, 0x0010, 0xa897, 0x4006,
+	0x900e, 0x9085, 0x0001, 0x2001, 0x0030, 0x0005, 0xa897, 0x4000,
+	0x080c, 0x5390, 0x0110, 0x9006, 0x0018, 0x900e, 0x9085, 0x0001,
+	0x2001, 0x0000, 0x0005, 0x9186, 0x00ff, 0x0110, 0x0071, 0x0060,
+	0x2029, 0x007e, 0x2061, 0x1800, 0x6458, 0x2400, 0x9506, 0x0110,
+	0x2508, 0x0019, 0x8529, 0x1ec8, 0x0005, 0x080c, 0x626b, 0x1138,
+	0x2200, 0x8003, 0x800b, 0x810b, 0x9108, 0x080c, 0x8146, 0x0005,
+	0x81ff, 0x1904, 0x33b0, 0x798c, 0x2001, 0x1950, 0x918c, 0x8000,
+	0x2102, 0x080c, 0x4891, 0x0904, 0x33b3, 0x080c, 0x6666, 0x0120,
+	0x080c, 0x666e, 0x1904, 0x33b3, 0x080c, 0x6332, 0x0904, 0x33b0,
+	0x080c, 0x64b9, 0x0904, 0x33b0, 0x2001, 0x1950, 0x2004, 0xd0fc,
+	0x1904, 0x337e, 0x0804, 0x4328, 0xa9a0, 0x2001, 0x1950, 0x918c,
+	0x8000, 0xc18d, 0x2102, 0x080c, 0x489e, 0x01a0, 0x080c, 0x6666,
+	0x0118, 0x080c, 0x666e, 0x1170, 0x080c, 0x6332, 0x2009, 0x0002,
+	0x0128, 0x080c, 0x64b9, 0x1170, 0x2009, 0x0003, 0xa897, 0x4005,
+	0xa99a, 0x0010, 0xa897, 0x4006, 0x900e, 0x9085, 0x0001, 0x2001,
+	0x0030, 0x0005, 0xa897, 0x4000, 0x2001, 0x1950, 0x2004, 0xd0fc,
+	0x1128, 0x080c, 0x5390, 0x0110, 0x9006, 0x0018, 0x900e, 0x9085,
+	0x0001, 0x2001, 0x0000, 0x0005, 0x81ff, 0x1904, 0x33b0, 0x798c,
+	0x2001, 0x194f, 0x918c, 0x8000, 0x2102, 0x080c, 0x4891, 0x0904,
+	0x33b3, 0x080c, 0x6666, 0x0120, 0x080c, 0x666e, 0x1904, 0x33b3,
+	0x080c, 0x6332, 0x0904, 0x33b0, 0x080c, 0x64a7, 0x0904, 0x33b0,
+	0x2001, 0x194f, 0x2004, 0xd0fc, 0x1904, 0x337e, 0x0804, 0x4328,
+	0xa9a0, 0x2001, 0x194f, 0x918c, 0x8000, 0xc18d, 0x2102, 0x080c,
+	0x489e, 0x01a0, 0x080c, 0x6666, 0x0118, 0x080c, 0x666e, 0x1170,
+	0x080c, 0x6332, 0x2009, 0x0002, 0x0128, 0x080c, 0x64a7, 0x1170,
+	0x2009, 0x0003, 0xa897, 0x4005, 0xa99a, 0x0010, 0xa897, 0x4006,
+	0x900e, 0x9085, 0x0001, 0x2001, 0x0030, 0x0005, 0xa897, 0x4000,
+	0x2001, 0x194f, 0x2004, 0xd0fc, 0x1128, 0x080c, 0x5390, 0x0110,
+	0x9006, 0x0018, 0x900e, 0x9085, 0x0001, 0x2001, 0x0000, 0x0005,
+	0x6100, 0x0804, 0x337e, 0x080c, 0x48ad, 0x0904, 0x33b3, 0x080c,
+	0x539c, 0x1904, 0x33b0, 0x79a8, 0xd184, 0x1158, 0xb834, 0x8007,
+	0x789e, 0xb830, 0x8007, 0x789a, 0xbb2c, 0x831f, 0xba28, 0x8217,
+	0x0050, 0xb824, 0x8007, 0x789e, 0xb820, 0x8007, 0x789a, 0xbb1c,
+	0x831f, 0xba18, 0x8217, 0xb900, 0x918c, 0x0200, 0x0804, 0x337e,
+	0x78a8, 0x909c, 0x0003, 0xd0b4, 0x1140, 0x939a, 0x0003, 0x1a04,
+	0x33b0, 0x6258, 0x7884, 0x9206, 0x1560, 0x2031, 0x1848, 0x2009,
+	0x013c, 0x2136, 0x2001, 0x1840, 0x2009, 0x000c, 0x7a8c, 0x7b88,
+	0x7c9c, 0x7d98, 0x2039, 0x0001, 0x0006, 0x78a8, 0x9084, 0x0080,
+	0x1118, 0x000e, 0x0804, 0x48c6, 0x000e, 0x2031, 0x0000, 0x2061,
+	0x18ae, 0x2c44, 0xa66a, 0xa17a, 0xa772, 0xa076, 0xa28e, 0xa392,
+	0xa496, 0xa59a, 0x080c, 0x1117, 0x7007, 0x0002, 0x701f, 0x44e1,
+	0x0005, 0x81ff, 0x1904, 0x33b0, 0x080c, 0x48ad, 0x0904, 0x33b3,
+	0x080c, 0x6666, 0x1904, 0x33b0, 0x00c6, 0x080c, 0x487a, 0x00ce,
+	0x0904, 0x33b0, 0xa867, 0x0000, 0xa868, 0xc0fd, 0xa86a, 0x7ea8,
+	0x080c, 0xb9b7, 0x0904, 0x33b0, 0x7007, 0x0003, 0x701f, 0x44e5,
+	0x0005, 0x080c, 0x4053, 0x0804, 0x337e, 0xa830, 0x9086, 0x0100,
+	0x0904, 0x33b0, 0x8906, 0x8006, 0x8007, 0x90bc, 0x003f, 0x9084,
+	0xffc0, 0x9080, 0x001b, 0x2009, 0x000c, 0x7a8c, 0x7b88, 0x7c9c,
+	0x7d98, 0x0804, 0x48c6, 0x9006, 0x080c, 0x24a6, 0x78a8, 0x9084,
+	0x00ff, 0x9086, 0x00ff, 0x0118, 0x81ff, 0x1904, 0x33b0, 0x080c,
+	0x7096, 0x0110, 0x080c, 0x5c9c, 0x7888, 0x908a, 0x1000, 0x1a04,
+	0x33b3, 0x7984, 0x9186, 0x00ff, 0x0138, 0x9182, 0x007f, 0x1a04,
+	0x33b3, 0x2100, 0x080c, 0x2470, 0x0026, 0x00c6, 0x0126, 0x2091,
+	0x8000, 0x2061, 0x19d3, 0x601b, 0x0000, 0x601f, 0x0000, 0x6073,
+	0x0000, 0x6077, 0x0000, 0x080c, 0x7096, 0x1158, 0x080c, 0x7396,
+	0x080c, 0x5cd7, 0x9085, 0x0001, 0x080c, 0x70dd, 0x080c, 0x6fc7,
+	0x00f0, 0x080c, 0x98bb, 0x080c, 0x9b60, 0x080c, 0x98d7, 0x2061,
+	0x0100, 0x2001, 0x1817, 0x2004, 0x9084, 0x00ff, 0x810f, 0x9105,
+	0x604a, 0x6043, 0x0090, 0x6043, 0x0010, 0x2009, 0x1969, 0x200b,
+	0x0000, 0x2009, 0x002d, 0x2011, 0x5bc2, 0x080c, 0x81fc, 0x7984,
+	0x080c, 0x7096, 0x1110, 0x2009, 0x00ff, 0x7a88, 0x080c, 0x438b,
+	0x012e, 0x00ce, 0x002e, 0x0804, 0x337e, 0x7984, 0x080c, 0x620b,
+	0x2b08, 0x1904, 0x33b3, 0x0804, 0x337e, 0x81ff, 0x0120, 0x2009,
+	0x0001, 0x0804, 0x33b0, 0x60d8, 0xd0ac, 0x1130, 0xd09c, 0x1120,
+	0x2009, 0x0005, 0x0804, 0x33b0, 0x080c, 0x487a, 0x1120, 0x2009,
+	0x0002, 0x0804, 0x33b0, 0x7984, 0x9192, 0x0021, 0x1a04, 0x33b3,
+	0x7a8c, 0x7b88, 0x7c9c, 0x7d98, 0xa85c, 0x9080, 0x0019, 0x702a,
+	0xaf60, 0x7736, 0x080c, 0x48c3, 0x701f, 0x459d, 0x7880, 0x9086,
+	0x006e, 0x0110, 0x701f, 0x4e3e, 0x0005, 0x2009, 0x0080, 0x080c,
+	0x626b, 0x1118, 0x080c, 0x6666, 0x0120, 0x2021, 0x400a, 0x0804,
+	0x3380, 0x00d6, 0x0096, 0xa964, 0xaa6c, 0xab70, 0xac74, 0xad78,
+	0xae7c, 0xa884, 0x90be, 0x0100, 0x0904, 0x4636, 0x90be, 0x0112,
+	0x0904, 0x4636, 0x90be, 0x0113, 0x0904, 0x4636, 0x90be, 0x0114,
+	0x0904, 0x4636, 0x90be, 0x0117, 0x0904, 0x4636, 0x90be, 0x011a,
+	0x0904, 0x4636, 0x90be, 0x011c, 0x0904, 0x4636, 0x90be, 0x0121,
+	0x0904, 0x461d, 0x90be, 0x0131, 0x0904, 0x461d, 0x90be, 0x0171,
+	0x0904, 0x4636, 0x90be, 0x0173, 0x0904, 0x4636, 0x90be, 0x01a1,
+	0x1128, 0xa894, 0x8007, 0xa896, 0x0804, 0x4641, 0x90be, 0x0212,
+	0x0904, 0x462a, 0x90be, 0x0213, 0x05e8, 0x90be, 0x0214, 0x0500,
+	0x90be, 0x0217, 0x0188, 0x90be, 0x021a, 0x1120, 0xa89c, 0x8007,
+	0xa89e, 0x04e0, 0x90be, 0x021f, 0x05c8, 0x90be, 0x0300, 0x05b0,
+	0x009e, 0x00de, 0x0804, 0x33b3, 0x7028, 0x9080, 0x0010, 0x2098,
+	0x20a0, 0x7034, 0x20e0, 0x20e8, 0x20a9, 0x0007, 0x080c, 0x467f,
+	0x7028, 0x9080, 0x000e, 0x2098, 0x20a0, 0x7034, 0x20e0, 0x20e8,
+	0x20a9, 0x0001, 0x080c, 0x467f, 0x00c8, 0x7028, 0x9080, 0x000c,
+	0x2098, 0x20a0, 0x7034, 0x20e0, 0x20e8, 0x20a9, 0x0001, 0x080c,
+	0x468c, 0x00b8, 0x7028, 0x9080, 0x000e, 0x2098, 0x20a0, 0x7034,
+	0x20e0, 0x20e8, 0x20a9, 0x0001, 0x080c, 0x468c, 0x7028, 0x9080,
+	0x000c, 0x2098, 0x20a0, 0x7034, 0x20e0, 0x20e8, 0x20a9, 0x0001,
+	0x04f1, 0x00c6, 0x080c, 0x487a, 0x0550, 0xa868, 0xc0fd, 0xa86a,
+	0xa867, 0x0119, 0x9006, 0xa882, 0xa87f, 0x0020, 0xa88b, 0x0001,
+	0x810b, 0xa9ae, 0xa8b2, 0xaab6, 0xabba, 0xacbe, 0xadc2, 0xa9c6,
+	0xa8ca, 0x00ce, 0x009e, 0x00de, 0xa866, 0xa822, 0xa868, 0xc0fd,
+	0xa86a, 0xa804, 0x2048, 0x080c, 0xb9d2, 0x1120, 0x2009, 0x0003,
+	0x0804, 0x33b0, 0x7007, 0x0003, 0x701f, 0x4676, 0x0005, 0x00ce,
+	0x009e, 0x00de, 0x2009, 0x0002, 0x0804, 0x33b0, 0xa820, 0x9086,
+	0x8001, 0x1904, 0x337e, 0x2009, 0x0004, 0x0804, 0x33b0, 0x0016,
+	0x0026, 0x3510, 0x20a9, 0x0002, 0x4002, 0x4104, 0x4004, 0x8211,
+	0x1dc8, 0x002e, 0x001e, 0x0005, 0x0016, 0x0026, 0x0036, 0x0046,
+	0x3520, 0x20a9, 0x0004, 0x4002, 0x4304, 0x4204, 0x4104, 0x4004,
+	0x8421, 0x1db8, 0x004e, 0x003e, 0x002e, 0x001e, 0x0005, 0x81ff,
+	0x0120, 0x2009, 0x0001, 0x0804, 0x33b0, 0x60d8, 0xd0ac, 0x1160,
+	0xd09c, 0x0120, 0x2009, 0x0016, 0x0804, 0x33b0, 0xd09c, 0x1120,
+	0x2009, 0x0005, 0x0804, 0x33b0, 0x7984, 0x78a8, 0x2040, 0x080c,
+	0x9b59, 0x1120, 0x9182, 0x007f, 0x0a04, 0x33b3, 0x9186, 0x00ff,
+	0x0904, 0x33b3, 0x9182, 0x0800, 0x1a04, 0x33b3, 0x7a8c, 0x7b88,
+	0x6078, 0x9306, 0x1158, 0x607c, 0x924e, 0x0904, 0x33b3, 0x080c,
+	0x9b59, 0x1120, 0x99cc, 0xff00, 0x0904, 0x33b3, 0x0126, 0x2091,
+	0x8000, 0x0026, 0x2011, 0x8008, 0x080c, 0x668a, 0x002e, 0x0140,
+	0x918d, 0x8000, 0x080c, 0x66d4, 0x1118, 0x2001, 0x4009, 0x0458,
+	0x080c, 0x4794, 0x0560, 0x90c6, 0x4000, 0x1170, 0x00c6, 0x0006,
+	0x900e, 0x080c, 0x655e, 0x1108, 0xc185, 0xb800, 0xd0bc, 0x0108,
+	0xc18d, 0x000e, 0x00ce, 0x00b8, 0x90c6, 0x4007, 0x1110, 0x2408,
+	0x0090, 0x90c6, 0x4008, 0x1118, 0x2708, 0x2610, 0x0060, 0x90c6,
+	0x4009, 0x1108, 0x0040, 0x90c6, 0x4006, 0x1108, 0x0020, 0x2001,
+	0x4005, 0x2009, 0x000a, 0x2020, 0x012e, 0x0804, 0x3380, 0x2b00,
+	0x7026, 0x0016, 0x00b6, 0x00c6, 0x00e6, 0x2c70, 0x080c, 0x9c49,
+	0x0904, 0x4761, 0x2b00, 0x6012, 0x080c, 0xbcdb, 0x2e58, 0x00ee,
+	0x00e6, 0x00c6, 0x080c, 0x487a, 0x00ce, 0x2b70, 0x1158, 0x080c,
+	0x9bda, 0x00ee, 0x00ce, 0x00be, 0x001e, 0x012e, 0x2009, 0x0002,
+	0x0804, 0x33b0, 0x900e, 0xa966, 0xa96a, 0x2900, 0x6016, 0xa932,
+	0xa868, 0xc0fd, 0xd88c, 0x0108, 0xc0f5, 0xa86a, 0x080c, 0x300e,
+	0x6023, 0x0001, 0x9006, 0x080c, 0x61a8, 0x2001, 0x0002, 0x080c,
+	0x61bc, 0x2009, 0x0002, 0x080c, 0x9c76, 0x78a8, 0xd094, 0x0138,
+	0x00ee, 0x7024, 0x00e6, 0x2058, 0xb8c4, 0xc08d, 0xb8c6, 0x9085,
+	0x0001, 0x00ee, 0x00ce, 0x00be, 0x001e, 0x012e, 0x1120, 0x2009,
+	0x0003, 0x0804, 0x33b0, 0x7007, 0x0003, 0x701f, 0x4770, 0x0005,
+	0xa830, 0x2008, 0x918e, 0xdead, 0x1120, 0x2021, 0x4009, 0x0804,
+	0x3380, 0x9086, 0x0100, 0x7024, 0x2058, 0x1138, 0x2009, 0x0004,
+	0xba04, 0x9294, 0x00ff, 0x0804, 0x52e5, 0x900e, 0xa868, 0xd0f4,
+	0x1904, 0x337e, 0x080c, 0x655e, 0x1108, 0xc185, 0xb800, 0xd0bc,
+	0x0108, 0xc18d, 0x0804, 0x337e, 0x00e6, 0x00d6, 0x0096, 0x83ff,
+	0x0904, 0x47dc, 0x902e, 0x080c, 0x9b59, 0x0130, 0x9026, 0x20a9,
+	0x0800, 0x2071, 0x1000, 0x0030, 0x2021, 0x007f, 0x20a9, 0x0781,
+	0x2071, 0x107f, 0x2e04, 0x9005, 0x11b0, 0x2100, 0x9406, 0x15e8,
+	0x2428, 0x94ce, 0x007f, 0x1120, 0x92ce, 0xfffd, 0x1528, 0x0030,
+	0x94ce, 0x0080, 0x1130, 0x92ce, 0xfffc, 0x11f0, 0x93ce, 0x00ff,
+	0x11d8, 0xc5fd, 0x0450, 0x2058, 0xbf10, 0x2700, 0x9306, 0x11b8,
+	0xbe14, 0x2600, 0x9206, 0x1198, 0x2400, 0x9106, 0x1150, 0xd884,
+	0x0568, 0xd894, 0x1558, 0x080c, 0x6666, 0x1540, 0x2001, 0x4000,
+	0x0430, 0x2001, 0x4007, 0x0418, 0x2001, 0x4006, 0x0400, 0x2400,
+	0x9106, 0x1158, 0xbe14, 0x87ff, 0x1128, 0x86ff, 0x0948, 0x080c,
+	0x9b59, 0x1930, 0x2001, 0x4008, 0x0090, 0x8420, 0x8e70, 0x1f04,
+	0x47aa, 0x85ff, 0x1130, 0x2001, 0x4009, 0x0048, 0x2001, 0x0001,
+	0x0030, 0x080c, 0x620b, 0x1dd0, 0xbb12, 0xba16, 0x9006, 0x9005,
+	0x009e, 0x00de, 0x00ee, 0x0005, 0x81ff, 0x0120, 0x2009, 0x0001,
+	0x0804, 0x33b0, 0x080c, 0x487a, 0x1120, 0x2009, 0x0002, 0x0804,
+	0x33b0, 0xa867, 0x0000, 0xa868, 0xc0fd, 0xa86a, 0x7884, 0x9005,
+	0x0904, 0x33b3, 0x9096, 0x00ff, 0x0120, 0x9092, 0x0004, 0x1a04,
+	0x33b3, 0x2010, 0x2918, 0x080c, 0x2fae, 0x1120, 0x2009, 0x0003,
+	0x0804, 0x33b0, 0x7007, 0x0003, 0x701f, 0x482f, 0x0005, 0xa830,
+	0x9086, 0x0100, 0x1904, 0x337e, 0x2009, 0x0004, 0x0804, 0x33b0,
+	0x7984, 0x080c, 0x9b59, 0x1120, 0x9182, 0x007f, 0x0a04, 0x33b3,
+	0x9186, 0x00ff, 0x0904, 0x33b3, 0x9182, 0x0800, 0x1a04, 0x33b3,
+	0x2001, 0x9000, 0x080c, 0x5340, 0x1904, 0x33b0, 0x0804, 0x337e,
+	0xa998, 0x080c, 0x9b59, 0x1118, 0x9182, 0x007f, 0x0280, 0x9186,
+	0x00ff, 0x0168, 0x9182, 0x0800, 0x1250, 0x2001, 0x9000, 0x080c,
+	0x5340, 0x11a8, 0x0060, 0xa897, 0x4005, 0xa99a, 0x0010, 0xa897,
 	0x4006, 0x900e, 0x9085, 0x0001, 0x2001, 0x0030, 0x0005, 0xa897,
-	0x4000, 0x2001, 0x1950, 0x2004, 0xd0fc, 0x1128, 0x080c, 0x5395,
-	0x0110, 0x9006, 0x0018, 0x900e, 0x9085, 0x0001, 0x2001, 0x0000,
-	0x0005, 0x6100, 0x0804, 0x338a, 0x080c, 0x48ab, 0x0904, 0x33bf,
-	0x080c, 0x53a1, 0x1904, 0x33bc, 0x79a8, 0xd184, 0x1158, 0xb834,
-	0x8007, 0x789e, 0xb830, 0x8007, 0x789a, 0xbb2c, 0x831f, 0xba28,
-	0x8217, 0x0050, 0xb824, 0x8007, 0x789e, 0xb820, 0x8007, 0x789a,
-	0xbb1c, 0x831f, 0xba18, 0x8217, 0xb900, 0x918c, 0x0200, 0x0804,
-	0x338a, 0x78a8, 0x909c, 0x0003, 0xd0b4, 0x1140, 0x939a, 0x0003,
-	0x1a04, 0x33bc, 0x6258, 0x7884, 0x9206, 0x1560, 0x2031, 0x1848,
-	0x2009, 0x013c, 0x2136, 0x2001, 0x1840, 0x2009, 0x000c, 0x7a8c,
-	0x7b88, 0x7c9c, 0x7d98, 0x2039, 0x0001, 0x0006, 0x78a8, 0x9084,
-	0x0080, 0x1118, 0x000e, 0x0804, 0x48c4, 0x000e, 0x2031, 0x0000,
+	0x4000, 0x900e, 0x9085, 0x0001, 0x2001, 0x0000, 0x0005, 0x2009,
+	0x000a, 0x0c48, 0x080c, 0x1022, 0x0198, 0x9006, 0xa802, 0x7014,
+	0x9005, 0x1120, 0x2900, 0x7016, 0x701a, 0x0040, 0x7018, 0xa802,
+	0x0086, 0x2040, 0x2900, 0xa006, 0x701a, 0x008e, 0x9085, 0x0001,
+	0x0005, 0x7984, 0x080c, 0x626b, 0x1130, 0x7e88, 0x9684, 0x3fff,
+	0x9082, 0x4000, 0x0208, 0x905e, 0x8bff, 0x0005, 0xa998, 0x080c,
+	0x626b, 0x1130, 0xae9c, 0x9684, 0x3fff, 0x9082, 0x4000, 0x0208,
+	0x905e, 0x8bff, 0x0005, 0xae98, 0x0008, 0x7e84, 0x2608, 0x080c,
+	0x626b, 0x1108, 0x0008, 0x905e, 0x8bff, 0x0005, 0x0016, 0x7114,
+	0x81ff, 0x0128, 0x2148, 0xa904, 0x080c, 0x1054, 0x0cc8, 0x7116,
+	0x711a, 0x001e, 0x0005, 0x2031, 0x0001, 0x0010, 0x2031, 0x0000,
 	0x2061, 0x18ae, 0x2c44, 0xa66a, 0xa17a, 0xa772, 0xa076, 0xa28e,
-	0xa392, 0xa496, 0xa59a, 0x080c, 0x110c, 0x7007, 0x0002, 0x701f,
-	0x44e2, 0x0005, 0x81ff, 0x1904, 0x33bc, 0x080c, 0x48ab, 0x0904,
-	0x33bf, 0x080c, 0x6667, 0x1904, 0x33bc, 0x00c6, 0x080c, 0x4878,
-	0x00ce, 0x0904, 0x33bc, 0xa867, 0x0000, 0xa868, 0xc0fd, 0xa86a,
-	0x7ea8, 0x080c, 0xb9bc, 0x0904, 0x33bc, 0x7007, 0x0003, 0x701f,
-	0x44e6, 0x0005, 0x080c, 0x4054, 0x0804, 0x338a, 0xa830, 0x9086,
-	0x0100, 0x0904, 0x33bc, 0x8906, 0x8006, 0x8007, 0x90bc, 0x003f,
-	0x9084, 0xffc0, 0x9080, 0x001b, 0x2009, 0x000c, 0x7a8c, 0x7b88,
-	0x7c9c, 0x7d98, 0x0804, 0x48c4, 0x9006, 0x080c, 0x248d, 0x78a8,
-	0x9084, 0x00ff, 0x9086, 0x00ff, 0x0118, 0x81ff, 0x1904, 0x33bc,
-	0x080c, 0x70b7, 0x0110, 0x080c, 0x5ca1, 0x7888, 0x908a, 0x1000,
-	0x1a04, 0x33bf, 0x7984, 0x9186, 0x00ff, 0x0138, 0x9182, 0x007f,
-	0x1a04, 0x33bf, 0x2100, 0x080c, 0x2457, 0x0026, 0x00c6, 0x0126,
-	0x2091, 0x8000, 0x2061, 0x19d4, 0x601b, 0x0000, 0x601f, 0x0000,
-	0x6073, 0x0000, 0x6077, 0x0000, 0x080c, 0x70b7, 0x1158, 0x080c,
-	0x73b7, 0x080c, 0x5cdc, 0x9085, 0x0001, 0x080c, 0x70fe, 0x080c,
-	0x6fe8, 0x00f0, 0x080c, 0x98c8, 0x080c, 0x9b6d, 0x080c, 0x98e4,
-	0x2061, 0x0100, 0x2001, 0x1817, 0x2004, 0x9084, 0x00ff, 0x810f,
-	0x9105, 0x604a, 0x6043, 0x0090, 0x6043, 0x0010, 0x2009, 0x196a,
-	0x200b, 0x0000, 0x2009, 0x002d, 0x2011, 0x5bc7, 0x080c, 0x821d,
-	0x7984, 0x080c, 0x70b7, 0x1110, 0x2009, 0x00ff, 0x7a88, 0x080c,
-	0x438c, 0x012e, 0x00ce, 0x002e, 0x0804, 0x338a, 0x7984, 0x080c,
-	0x6210, 0x2b08, 0x1904, 0x33bf, 0x0804, 0x338a, 0x81ff, 0x0120,
-	0x2009, 0x0001, 0x0804, 0x33bc, 0x60d8, 0xd0ac, 0x1130, 0xd09c,
-	0x1120, 0x2009, 0x0005, 0x0804, 0x33bc, 0x080c, 0x4878, 0x1120,
-	0x2009, 0x0002, 0x0804, 0x33bc, 0x7984, 0x9192, 0x0021, 0x1a04,
-	0x33bf, 0x7a8c, 0x7b88, 0x7c9c, 0x7d98, 0xa85c, 0x9080, 0x0019,
-	0x702a, 0xaf60, 0x7736, 0x080c, 0x48c1, 0x701f, 0x459e, 0x7880,
-	0x9086, 0x006e, 0x0110, 0x701f, 0x4e43, 0x0005, 0x2009, 0x0080,
-	0x080c, 0x6270, 0x1118, 0x080c, 0x6667, 0x0120, 0x2021, 0x400a,
-	0x0804, 0x338c, 0x00d6, 0x0096, 0xa964, 0xaa6c, 0xab70, 0xac74,
-	0xad78, 0xae7c, 0xa884, 0x90be, 0x0100, 0x0904, 0x4637, 0x90be,
-	0x0112, 0x0904, 0x4637, 0x90be, 0x0113, 0x0904, 0x4637, 0x90be,
-	0x0114, 0x0904, 0x4637, 0x90be, 0x0117, 0x0904, 0x4637, 0x90be,
-	0x011a, 0x0904, 0x4637, 0x90be, 0x011c, 0x0904, 0x4637, 0x90be,
-	0x0121, 0x0904, 0x461e, 0x90be, 0x0131, 0x0904, 0x461e, 0x90be,
-	0x0171, 0x0904, 0x4637, 0x90be, 0x0173, 0x0904, 0x4637, 0x90be,
-	0x01a1, 0x1128, 0xa894, 0x8007, 0xa896, 0x0804, 0x4642, 0x90be,
-	0x0212, 0x0904, 0x462b, 0x90be, 0x0213, 0x05e8, 0x90be, 0x0214,
-	0x0500, 0x90be, 0x0217, 0x0188, 0x90be, 0x021a, 0x1120, 0xa89c,
-	0x8007, 0xa89e, 0x04e0, 0x90be, 0x021f, 0x05c8, 0x90be, 0x0300,
-	0x05b0, 0x009e, 0x00de, 0x0804, 0x33bf, 0x7028, 0x9080, 0x0010,
-	0x2098, 0x20a0, 0x7034, 0x20e0, 0x20e8, 0x20a9, 0x0007, 0x080c,
-	0x4680, 0x7028, 0x9080, 0x000e, 0x2098, 0x20a0, 0x7034, 0x20e0,
-	0x20e8, 0x20a9, 0x0001, 0x080c, 0x4680, 0x00c8, 0x7028, 0x9080,
-	0x000c, 0x2098, 0x20a0, 0x7034, 0x20e0, 0x20e8, 0x20a9, 0x0001,
-	0x080c, 0x468d, 0x00b8, 0x7028, 0x9080, 0x000e, 0x2098, 0x20a0,
-	0x7034, 0x20e0, 0x20e8, 0x20a9, 0x0001, 0x080c, 0x468d, 0x7028,
-	0x9080, 0x000c, 0x2098, 0x20a0, 0x7034, 0x20e0, 0x20e8, 0x20a9,
-	0x0001, 0x04f1, 0x00c6, 0x080c, 0x4878, 0x0550, 0xa868, 0xc0fd,
-	0xa86a, 0xa867, 0x0119, 0x9006, 0xa882, 0xa87f, 0x0020, 0xa88b,
-	0x0001, 0x810b, 0xa9ae, 0xa8b2, 0xaab6, 0xabba, 0xacbe, 0xadc2,
-	0xa9c6, 0xa8ca, 0x00ce, 0x009e, 0x00de, 0xa866, 0xa822, 0xa868,
-	0xc0fd, 0xa86a, 0xa804, 0x2048, 0x080c, 0xb9d7, 0x1120, 0x2009,
-	0x0003, 0x0804, 0x33bc, 0x7007, 0x0003, 0x701f, 0x4677, 0x0005,
-	0x00ce, 0x009e, 0x00de, 0x2009, 0x0002, 0x0804, 0x33bc, 0xa820,
-	0x9086, 0x8001, 0x1904, 0x338a, 0x2009, 0x0004, 0x0804, 0x33bc,
-	0x0016, 0x0026, 0x3510, 0x20a9, 0x0002, 0x4002, 0x4104, 0x4004,
-	0x8211, 0x1dc8, 0x002e, 0x001e, 0x0005, 0x0016, 0x0026, 0x0036,
-	0x0046, 0x3520, 0x20a9, 0x0004, 0x4002, 0x4304, 0x4204, 0x4104,
-	0x4004, 0x8421, 0x1db8, 0x004e, 0x003e, 0x002e, 0x001e, 0x0005,
-	0x81ff, 0x0120, 0x2009, 0x0001, 0x0804, 0x33bc, 0x60d8, 0xd0ac,
-	0x1160, 0xd09c, 0x0120, 0x2009, 0x0016, 0x0804, 0x33bc, 0xd09c,
-	0x1120, 0x2009, 0x0005, 0x0804, 0x33bc, 0x7984, 0x78a8, 0x2040,
-	0x080c, 0x9b66, 0x1120, 0x9182, 0x007f, 0x0a04, 0x33bf, 0x9186,
-	0x00ff, 0x0904, 0x33bf, 0x9182, 0x0800, 0x1a04, 0x33bf, 0x7a8c,
-	0x7b88, 0x6078, 0x9306, 0x1140, 0x607c, 0x924e, 0x0904, 0x33bf,
-	0x99cc, 0xff00, 0x0904, 0x33bf, 0x0126, 0x2091, 0x8000, 0x0026,
-	0x2011, 0x8008, 0x080c, 0x668b, 0x002e, 0x0140, 0x918d, 0x8000,
-	0x080c, 0x66d5, 0x1118, 0x2001, 0x4009, 0x0458, 0x080c, 0x4792,
-	0x0560, 0x90c6, 0x4000, 0x1170, 0x00c6, 0x0006, 0x900e, 0x080c,
-	0x655f, 0x1108, 0xc185, 0xb800, 0xd0bc, 0x0108, 0xc18d, 0x000e,
-	0x00ce, 0x00b8, 0x90c6, 0x4007, 0x1110, 0x2408, 0x0090, 0x90c6,
-	0x4008, 0x1118, 0x2708, 0x2610, 0x0060, 0x90c6, 0x4009, 0x1108,
-	0x0040, 0x90c6, 0x4006, 0x1108, 0x0020, 0x2001, 0x4005, 0x2009,
-	0x000a, 0x2020, 0x012e, 0x0804, 0x338c, 0x2b00, 0x7026, 0x0016,
-	0x00b6, 0x00c6, 0x00e6, 0x2c70, 0x080c, 0x9c58, 0x0904, 0x475f,
-	0x2b00, 0x6012, 0x080c, 0xbcdb, 0x2e58, 0x00ee, 0x00e6, 0x00c6,
-	0x080c, 0x4878, 0x00ce, 0x2b70, 0x1158, 0x080c, 0x9be7, 0x00ee,
-	0x00ce, 0x00be, 0x001e, 0x012e, 0x2009, 0x0002, 0x0804, 0x33bc,
-	0x900e, 0xa966, 0xa96a, 0x2900, 0x6016, 0xa932, 0xa868, 0xc0fd,
-	0xd88c, 0x0108, 0xc0f5, 0xa86a, 0x080c, 0x3006, 0x6023, 0x0001,
-	0x9006, 0x080c, 0x61ad, 0x2001, 0x0002, 0x080c, 0x61c1, 0x2009,
-	0x0002, 0x080c, 0x9c85, 0x78a8, 0xd094, 0x0138, 0x00ee, 0x7024,
-	0x00e6, 0x2058, 0xb8c4, 0xc08d, 0xb8c6, 0x9085, 0x0001, 0x00ee,
-	0x00ce, 0x00be, 0x001e, 0x012e, 0x1120, 0x2009, 0x0003, 0x0804,
-	0x33bc, 0x7007, 0x0003, 0x701f, 0x476e, 0x0005, 0xa830, 0x2008,
-	0x918e, 0xdead, 0x1120, 0x2021, 0x4009, 0x0804, 0x338c, 0x9086,
-	0x0100, 0x7024, 0x2058, 0x1138, 0x2009, 0x0004, 0xba04, 0x9294,
-	0x00ff, 0x0804, 0x52ea, 0x900e, 0xa868, 0xd0f4, 0x1904, 0x338a,
-	0x080c, 0x655f, 0x1108, 0xc185, 0xb800, 0xd0bc, 0x0108, 0xc18d,
-	0x0804, 0x338a, 0x00e6, 0x00d6, 0x0096, 0x83ff, 0x0904, 0x47da,
-	0x902e, 0x080c, 0x9b66, 0x0130, 0x9026, 0x20a9, 0x0800, 0x2071,
-	0x1000, 0x0030, 0x2021, 0x007f, 0x20a9, 0x0781, 0x2071, 0x107f,
-	0x2e04, 0x9005, 0x11b0, 0x2100, 0x9406, 0x15e8, 0x2428, 0x94ce,
-	0x007f, 0x1120, 0x92ce, 0xfffd, 0x1528, 0x0030, 0x94ce, 0x0080,
-	0x1130, 0x92ce, 0xfffc, 0x11f0, 0x93ce, 0x00ff, 0x11d8, 0xc5fd,
-	0x0450, 0x2058, 0xbf10, 0x2700, 0x9306, 0x11b8, 0xbe14, 0x2600,
-	0x9206, 0x1198, 0x2400, 0x9106, 0x1150, 0xd884, 0x0568, 0xd894,
-	0x1558, 0x080c, 0x6667, 0x1540, 0x2001, 0x4000, 0x0430, 0x2001,
-	0x4007, 0x0418, 0x2001, 0x4006, 0x0400, 0x2400, 0x9106, 0x1158,
-	0xbe14, 0x87ff, 0x1128, 0x86ff, 0x0948, 0x080c, 0x9b66, 0x1930,
-	0x2001, 0x4008, 0x0090, 0x8420, 0x8e70, 0x1f04, 0x47a8, 0x85ff,
-	0x1130, 0x2001, 0x4009, 0x0048, 0x2001, 0x0001, 0x0030, 0x080c,
-	0x6210, 0x1dd0, 0xbb12, 0xba16, 0x9006, 0x9005, 0x009e, 0x00de,
-	0x00ee, 0x0005, 0x81ff, 0x0120, 0x2009, 0x0001, 0x0804, 0x33bc,
-	0x080c, 0x4878, 0x1120, 0x2009, 0x0002, 0x0804, 0x33bc, 0xa867,
-	0x0000, 0xa868, 0xc0fd, 0xa86a, 0x7884, 0x9005, 0x0904, 0x33bf,
-	0x9096, 0x00ff, 0x0120, 0x9092, 0x0004, 0x1a04, 0x33bf, 0x2010,
-	0x2918, 0x080c, 0x2fa0, 0x1120, 0x2009, 0x0003, 0x0804, 0x33bc,
-	0x7007, 0x0003, 0x701f, 0x482d, 0x0005, 0xa830, 0x9086, 0x0100,
-	0x1904, 0x338a, 0x2009, 0x0004, 0x0804, 0x33bc, 0x7984, 0x080c,
-	0x9b66, 0x1120, 0x9182, 0x007f, 0x0a04, 0x33bf, 0x9186, 0x00ff,
-	0x0904, 0x33bf, 0x9182, 0x0800, 0x1a04, 0x33bf, 0x2001, 0x9000,
-	0x080c, 0x5345, 0x1904, 0x33bc, 0x0804, 0x338a, 0xa998, 0x080c,
-	0x9b66, 0x1118, 0x9182, 0x007f, 0x0280, 0x9186, 0x00ff, 0x0168,
-	0x9182, 0x0800, 0x1250, 0x2001, 0x9000, 0x080c, 0x5345, 0x11a8,
-	0x0060, 0xa897, 0x4005, 0xa99a, 0x0010, 0xa897, 0x4006, 0x900e,
-	0x9085, 0x0001, 0x2001, 0x0030, 0x0005, 0xa897, 0x4000, 0x900e,
-	0x9085, 0x0001, 0x2001, 0x0000, 0x0005, 0x2009, 0x000a, 0x0c48,
-	0x080c, 0x1022, 0x0198, 0x9006, 0xa802, 0x7014, 0x9005, 0x1120,
-	0x2900, 0x7016, 0x701a, 0x0040, 0x7018, 0xa802, 0x0086, 0x2040,
-	0x2900, 0xa006, 0x701a, 0x008e, 0x9085, 0x0001, 0x0005, 0x7984,
-	0x080c, 0x6270, 0x1130, 0x7e88, 0x9684, 0x3fff, 0x9082, 0x4000,
-	0x0208, 0x905e, 0x8bff, 0x0005, 0xa998, 0x080c, 0x6270, 0x1130,
-	0xae9c, 0x9684, 0x3fff, 0x9082, 0x4000, 0x0208, 0x905e, 0x8bff,
-	0x0005, 0xae98, 0x0008, 0x7e84, 0x2608, 0x080c, 0x6270, 0x1108,
-	0x0008, 0x905e, 0x8bff, 0x0005, 0x0016, 0x7114, 0x81ff, 0x0128,
-	0x2148, 0xa904, 0x080c, 0x1054, 0x0cc8, 0x7116, 0x711a, 0x001e,
-	0x0005, 0x2031, 0x0001, 0x0010, 0x2031, 0x0000, 0x2061, 0x18ae,
-	0x2c44, 0xa66a, 0xa17a, 0xa772, 0xa076, 0xa28e, 0xa392, 0xa496,
-	0xa59a, 0x080c, 0x110c, 0x7007, 0x0002, 0x701f, 0x338a, 0x0005,
-	0x00f6, 0x0126, 0x2091, 0x8000, 0x2079, 0x0000, 0x2001, 0x18a6,
-	0x2004, 0x9005, 0x1190, 0x0e04, 0x48f5, 0x7a36, 0x7833, 0x0012,
-	0x7a82, 0x7b86, 0x7c8a, 0x2091, 0x4080, 0x2001, 0x0089, 0x2004,
-	0xd084, 0x190c, 0x11be, 0x0804, 0x495b, 0x0016, 0x0086, 0x0096,
-	0x00c6, 0x00e6, 0x2071, 0x1894, 0x7044, 0x9005, 0x1540, 0x7148,
-	0x9182, 0x0010, 0x0288, 0x7038, 0x2060, 0x080c, 0x1022, 0x0904,
-	0x4953, 0xa84b, 0x0000, 0x2900, 0x7046, 0x2001, 0x0002, 0x9080,
-	0x1cf7, 0x2005, 0xa846, 0x0098, 0x7038, 0x90e0, 0x0004, 0x2001,
-	0x18b0, 0x9c82, 0x18f0, 0x0210, 0x2061, 0x18b0, 0x2c00, 0x703a,
-	0x7148, 0x81ff, 0x1108, 0x703e, 0x8108, 0x714a, 0x0460, 0x7148,
-	0x8108, 0x714a, 0x7044, 0x2040, 0xa144, 0x2105, 0x0016, 0x908a,
-	0x0036, 0x1a0c, 0x0d65, 0x2060, 0x001e, 0x8108, 0x2105, 0x9005,
-	0xa146, 0x1520, 0x080c, 0x1022, 0x1130, 0x8109, 0xa946, 0x7148,
-	0x8109, 0x714a, 0x00d8, 0x9006, 0xa806, 0xa84a, 0xa046, 0x2800,
-	0xa802, 0x2900, 0xa006, 0x7046, 0x2001, 0x0002, 0x9080, 0x1cf7,
-	0x2005, 0xa846, 0x0058, 0x2262, 0x6306, 0x640a, 0x00ee, 0x00ce,
-	0x009e, 0x008e, 0x001e, 0x012e, 0x00fe, 0x0005, 0x2c00, 0x9082,
-	0x001b, 0x0002, 0x497d, 0x497d, 0x497f, 0x497d, 0x497d, 0x497d,
-	0x4983, 0x497d, 0x497d, 0x497d, 0x4987, 0x497d, 0x497d, 0x497d,
-	0x498b, 0x497d, 0x497d, 0x497d, 0x498f, 0x497d, 0x497d, 0x497d,
-	0x4993, 0x497d, 0x497d, 0x497d, 0x4998, 0x080c, 0x0d65, 0xa276,
-	0xa37a, 0xa47e, 0x0898, 0xa286, 0xa38a, 0xa48e, 0x0878, 0xa296,
-	0xa39a, 0xa49e, 0x0858, 0xa2a6, 0xa3aa, 0xa4ae, 0x0838, 0xa2b6,
-	0xa3ba, 0xa4be, 0x0818, 0xa2c6, 0xa3ca, 0xa4ce, 0x0804, 0x4956,
-	0xa2d6, 0xa3da, 0xa4de, 0x0804, 0x4956, 0x00e6, 0x2071, 0x1894,
-	0x7048, 0x9005, 0x0904, 0x4a2f, 0x0126, 0x2091, 0x8000, 0x0e04,
-	0x4a2e, 0x00f6, 0x2079, 0x0000, 0x00c6, 0x0096, 0x0086, 0x0076,
-	0x9006, 0x2038, 0x7040, 0x2048, 0x9005, 0x0500, 0xa948, 0x2105,
+	0xa392, 0xa496, 0xa59a, 0x080c, 0x1117, 0x7007, 0x0002, 0x701f,
+	0x337e, 0x0005, 0x00f6, 0x0126, 0x2091, 0x8000, 0x2079, 0x0000,
+	0x2001, 0x18a6, 0x2004, 0x9005, 0x1190, 0x0e04, 0x48f7, 0x7a36,
+	0x7833, 0x0012, 0x7a82, 0x7b86, 0x7c8a, 0x2091, 0x4080, 0x2001,
+	0x0089, 0x2004, 0xd084, 0x190c, 0x11c9, 0x0804, 0x495d, 0x0016,
+	0x0086, 0x0096, 0x00c6, 0x00e6, 0x2071, 0x1894, 0x7044, 0x9005,
+	0x1540, 0x7148, 0x9182, 0x0010, 0x0288, 0x7038, 0x2060, 0x080c,
+	0x1022, 0x0904, 0x4955, 0xa84b, 0x0000, 0x2900, 0x7046, 0x2001,
+	0x0002, 0x9080, 0x1d04, 0x2005, 0xa846, 0x0098, 0x7038, 0x90e0,
+	0x0004, 0x2001, 0x18b0, 0x9c82, 0x18f0, 0x0210, 0x2061, 0x18b0,
+	0x2c00, 0x703a, 0x7148, 0x81ff, 0x1108, 0x703e, 0x8108, 0x714a,
+	0x0460, 0x7148, 0x8108, 0x714a, 0x7044, 0x2040, 0xa144, 0x2105,
 	0x0016, 0x908a, 0x0036, 0x1a0c, 0x0d65, 0x2060, 0x001e, 0x8108,
-	0x2105, 0x9005, 0xa94a, 0x1904, 0x4a31, 0xa804, 0x9005, 0x090c,
-	0x0d65, 0x7042, 0x2938, 0x2040, 0xa003, 0x0000, 0x2001, 0x0002,
-	0x9080, 0x1cf7, 0x2005, 0xa04a, 0x0804, 0x4a31, 0x703c, 0x2060,
-	0x2c14, 0x6304, 0x6408, 0x650c, 0x2200, 0x7836, 0x7833, 0x0012,
-	0x7882, 0x2300, 0x7886, 0x2400, 0x788a, 0x2091, 0x4080, 0x2001,
-	0x0089, 0x2004, 0xd084, 0x190c, 0x11be, 0x87ff, 0x0118, 0x2748,
-	0x080c, 0x1054, 0x7048, 0x8001, 0x704a, 0x9005, 0x1170, 0x7040,
-	0x2048, 0x9005, 0x0128, 0x080c, 0x1054, 0x9006, 0x7042, 0x7046,
-	0x703b, 0x18b0, 0x703f, 0x18b0, 0x0420, 0x7040, 0x9005, 0x1508,
-	0x7238, 0x2c00, 0x9206, 0x0148, 0x9c80, 0x0004, 0x90fa, 0x18f0,
-	0x0210, 0x2001, 0x18b0, 0x703e, 0x00a0, 0x9006, 0x703e, 0x703a,
-	0x7044, 0x9005, 0x090c, 0x0d65, 0x2048, 0xa800, 0x9005, 0x1de0,
-	0x2900, 0x7042, 0x2001, 0x0002, 0x9080, 0x1cf7, 0x2005, 0xa84a,
-	0x0000, 0x007e, 0x008e, 0x009e, 0x00ce, 0x00fe, 0x012e, 0x00ee,
-	0x0005, 0x2c00, 0x9082, 0x001b, 0x0002, 0x4a50, 0x4a50, 0x4a52,
-	0x4a50, 0x4a50, 0x4a50, 0x4a57, 0x4a50, 0x4a50, 0x4a50, 0x4a5c,
-	0x4a50, 0x4a50, 0x4a50, 0x4a61, 0x4a50, 0x4a50, 0x4a50, 0x4a66,
-	0x4a50, 0x4a50, 0x4a50, 0x4a6b, 0x4a50, 0x4a50, 0x4a50, 0x4a70,
-	0x080c, 0x0d65, 0xaa74, 0xab78, 0xac7c, 0x0804, 0x49dc, 0xaa84,
-	0xab88, 0xac8c, 0x0804, 0x49dc, 0xaa94, 0xab98, 0xac9c, 0x0804,
-	0x49dc, 0xaaa4, 0xaba8, 0xacac, 0x0804, 0x49dc, 0xaab4, 0xabb8,
-	0xacbc, 0x0804, 0x49dc, 0xaac4, 0xabc8, 0xaccc, 0x0804, 0x49dc,
-	0xaad4, 0xabd8, 0xacdc, 0x0804, 0x49dc, 0x0026, 0x080c, 0x538d,
-	0xd0c4, 0x0120, 0x2011, 0x8014, 0x080c, 0x48d8, 0x002e, 0x0005,
-	0x81ff, 0x1904, 0x33bc, 0x0126, 0x2091, 0x8000, 0x6030, 0xc08d,
-	0xc085, 0xc0ac, 0x6032, 0x080c, 0x70b7, 0x1158, 0x080c, 0x73b7,
-	0x080c, 0x5cdc, 0x9085, 0x0001, 0x080c, 0x70fe, 0x080c, 0x6fe8,
-	0x0010, 0x080c, 0x5b97, 0x012e, 0x0804, 0x338a, 0x81ff, 0x0120,
-	0x2009, 0x0001, 0x0804, 0x33bc, 0x080c, 0x53a1, 0x0120, 0x2009,
-	0x0007, 0x0804, 0x33bc, 0x080c, 0x665f, 0x0120, 0x2009, 0x0008,
-	0x0804, 0x33bc, 0x0026, 0x2011, 0x0010, 0x080c, 0x668b, 0x002e,
-	0x0140, 0x7984, 0x080c, 0x66d5, 0x1120, 0x2009, 0x4009, 0x0804,
-	0x33bc, 0x080c, 0x3181, 0x0128, 0x7984, 0x080c, 0x6210, 0x1904,
-	0x33bf, 0x080c, 0x48ab, 0x0904, 0x33bf, 0x2b00, 0x7026, 0x080c,
-	0x6667, 0x7888, 0x1170, 0x9084, 0x0005, 0x1158, 0x900e, 0x080c,
-	0x655f, 0x1108, 0xc185, 0xb800, 0xd0bc, 0x0108, 0xc18d, 0x0804,
-	0x338a, 0x080c, 0x4878, 0x0904, 0x33bc, 0x9006, 0xa866, 0xa832,
-	0xa868, 0xc0fd, 0xa86a, 0x080c, 0xba79, 0x0904, 0x33bc, 0x7888,
-	0xd094, 0x0118, 0xb8c4, 0xc08d, 0xb8c6, 0x7007, 0x0003, 0x701f,
-	0x4b46, 0x0005, 0x2061, 0x1800, 0x080c, 0x53a1, 0x2009, 0x0007,
-	0x1578, 0x080c, 0x665f, 0x0118, 0x2009, 0x0008, 0x0448, 0x080c,
-	0x3181, 0x0120, 0xa998, 0x080c, 0x6210, 0x1530, 0x080c, 0x48a9,
-	0x0518, 0x080c, 0x6667, 0xa89c, 0x1168, 0x9084, 0x0005, 0x1150,
-	0x900e, 0x080c, 0x655f, 0x1108, 0xc185, 0xb800, 0xd0bc, 0x0108,
-	0xc18d, 0x00d0, 0xa868, 0xc0fc, 0xa86a, 0x080c, 0xba79, 0x11e0,
-	0xa89c, 0xd094, 0x0118, 0xb8c4, 0xc08d, 0xb8c6, 0x2009, 0x0003,
-	0xa897, 0x4005, 0xa99a, 0x0010, 0xa897, 0x4006, 0x900e, 0x9085,
-	0x0001, 0x2001, 0x0030, 0x0005, 0xa897, 0x4000, 0xa99a, 0x9006,
-	0x918d, 0x0001, 0x2008, 0x0005, 0x9006, 0x0005, 0xa830, 0x2008,
-	0x918e, 0xdead, 0x1120, 0x2021, 0x4009, 0x0804, 0x338c, 0x9086,
-	0x0100, 0x7024, 0x2058, 0x1110, 0x0804, 0x52ea, 0x900e, 0x080c,
-	0x655f, 0x1108, 0xc185, 0xb800, 0xd0bc, 0x0108, 0xc18d, 0x0804,
-	0x338a, 0x080c, 0x53a1, 0x0120, 0x2009, 0x0007, 0x0804, 0x33bc,
-	0x7f84, 0x7a8c, 0x7b88, 0x7c9c, 0x7d98, 0x080c, 0x4878, 0x1120,
-	0x2009, 0x0002, 0x0804, 0x33bc, 0x900e, 0x2130, 0x7126, 0x7132,
-	0xa860, 0x20e8, 0x7036, 0xa85c, 0x9080, 0x0005, 0x702a, 0x20a0,
-	0x080c, 0x6270, 0x1904, 0x4be4, 0x080c, 0x6667, 0x0120, 0x080c,
-	0x666f, 0x1904, 0x4be4, 0x080c, 0x665f, 0x1130, 0x080c, 0x655f,
-	0x1118, 0xd79c, 0x0904, 0x4be4, 0xd794, 0x1110, 0xd784, 0x01a8,
-	0xb8b4, 0x20e0, 0xb8b8, 0x9080, 0x0006, 0x2098, 0x3400, 0xd794,
-	0x0160, 0x20a9, 0x0008, 0x4003, 0x2098, 0x20a0, 0x3d00, 0x20e0,
-	0x20a9, 0x0002, 0x080c, 0x468d, 0x0048, 0x20a9, 0x0004, 0x4003,
-	0x2098, 0x20a0, 0x3d00, 0x20e0, 0x080c, 0x468d, 0x4104, 0xd794,
-	0x0528, 0xb8b4, 0x20e0, 0xb8b8, 0x2060, 0x9c80, 0x0000, 0x2098,
-	0x20a9, 0x0002, 0x4003, 0x9c80, 0x0003, 0x2098, 0x20a9, 0x0001,
-	0x4005, 0x9c80, 0x0004, 0x2098, 0x3400, 0x20a9, 0x0002, 0x4003,
-	0x2098, 0x20a0, 0x3d00, 0x20e0, 0x080c, 0x4680, 0x9c80, 0x0026,
-	0x2098, 0xb8b4, 0x20e0, 0x20a9, 0x0002, 0x4003, 0xd794, 0x0110,
-	0x96b0, 0x000b, 0x96b0, 0x0005, 0x8108, 0x080c, 0x9b66, 0x0118,
-	0x9186, 0x0800, 0x0040, 0xd78c, 0x0120, 0x9186, 0x0800, 0x0170,
-	0x0018, 0x9186, 0x007e, 0x0150, 0xd794, 0x0118, 0x9686, 0x0020,
-	0x0010, 0x9686, 0x0028, 0x0150, 0x0804, 0x4b80, 0x86ff, 0x1120,
-	0x7124, 0x810b, 0x0804, 0x338a, 0x7033, 0x0001, 0x7122, 0x7024,
-	0x9600, 0x7026, 0x772e, 0x2061, 0x18ae, 0x2c44, 0xa06b, 0x0000,
-	0xa67a, 0x7034, 0xa072, 0x7028, 0xa076, 0xa28e, 0xa392, 0xa496,
-	0xa59a, 0x080c, 0x110c, 0x7007, 0x0002, 0x701f, 0x4c20, 0x0005,
-	0x7030, 0x9005, 0x1180, 0x7120, 0x7028, 0x20a0, 0x772c, 0x9036,
-	0x7034, 0x20e8, 0x2061, 0x18ae, 0x2c44, 0xa28c, 0xa390, 0xa494,
-	0xa598, 0x0804, 0x4b80, 0x7124, 0x810b, 0x0804, 0x338a, 0x2029,
-	0x007e, 0x7984, 0x7a88, 0x7b8c, 0x7c98, 0x9184, 0xff00, 0x8007,
-	0x90e2, 0x0020, 0x0a04, 0x33bf, 0x9502, 0x0a04, 0x33bf, 0x9184,
-	0x00ff, 0x90e2, 0x0020, 0x0a04, 0x33bf, 0x9502, 0x0a04, 0x33bf,
-	0x9284, 0xff00, 0x8007, 0x90e2, 0x0020, 0x0a04, 0x33bf, 0x9502,
-	0x0a04, 0x33bf, 0x9284, 0x00ff, 0x90e2, 0x0020, 0x0a04, 0x33bf,
-	0x9502, 0x0a04, 0x33bf, 0x9384, 0xff00, 0x8007, 0x90e2, 0x0020,
-	0x0a04, 0x33bf, 0x9502, 0x0a04, 0x33bf, 0x9384, 0x00ff, 0x90e2,
-	0x0020, 0x0a04, 0x33bf, 0x9502, 0x0a04, 0x33bf, 0x9484, 0xff00,
-	0x8007, 0x90e2, 0x0020, 0x0a04, 0x33bf, 0x9502, 0x0a04, 0x33bf,
-	0x9484, 0x00ff, 0x90e2, 0x0020, 0x0a04, 0x33bf, 0x9502, 0x0a04,
-	0x33bf, 0x2061, 0x195a, 0x6102, 0x6206, 0x630a, 0x640e, 0x0804,
-	0x338a, 0x0006, 0x080c, 0x538d, 0xd0cc, 0x000e, 0x0005, 0x0006,
-	0x080c, 0x5391, 0xd0bc, 0x000e, 0x0005, 0x6170, 0x7a84, 0x6300,
-	0x82ff, 0x1118, 0x7986, 0x0804, 0x338a, 0x83ff, 0x1904, 0x33bf,
-	0x2001, 0xfff0, 0x9200, 0x1a04, 0x33bf, 0x2019, 0xffff, 0x6074,
-	0x9302, 0x9200, 0x0a04, 0x33bf, 0x7986, 0x6272, 0x0804, 0x338a,
-	0x080c, 0x53a1, 0x1904, 0x33bc, 0x7c88, 0x7d84, 0x7e98, 0x7f8c,
-	0x080c, 0x4878, 0x0904, 0x33bc, 0x900e, 0x901e, 0x7326, 0x7332,
-	0xa860, 0x20e8, 0x7036, 0xa85c, 0x9080, 0x0003, 0x702a, 0x20a0,
-	0x91d8, 0x1000, 0x2b5c, 0x8bff, 0x0178, 0x080c, 0x6667, 0x0118,
-	0x080c, 0x666f, 0x1148, 0x20a9, 0x0001, 0xb814, 0x4004, 0xb810,
+	0x2105, 0x9005, 0xa146, 0x1520, 0x080c, 0x1022, 0x1130, 0x8109,
+	0xa946, 0x7148, 0x8109, 0x714a, 0x00d8, 0x9006, 0xa806, 0xa84a,
+	0xa046, 0x2800, 0xa802, 0x2900, 0xa006, 0x7046, 0x2001, 0x0002,
+	0x9080, 0x1d04, 0x2005, 0xa846, 0x0058, 0x2262, 0x6306, 0x640a,
+	0x00ee, 0x00ce, 0x009e, 0x008e, 0x001e, 0x012e, 0x00fe, 0x0005,
+	0x2c00, 0x9082, 0x001b, 0x0002, 0x497f, 0x497f, 0x4981, 0x497f,
+	0x497f, 0x497f, 0x4985, 0x497f, 0x497f, 0x497f, 0x4989, 0x497f,
+	0x497f, 0x497f, 0x498d, 0x497f, 0x497f, 0x497f, 0x4991, 0x497f,
+	0x497f, 0x497f, 0x4995, 0x497f, 0x497f, 0x497f, 0x499a, 0x080c,
+	0x0d65, 0xa276, 0xa37a, 0xa47e, 0x0898, 0xa286, 0xa38a, 0xa48e,
+	0x0878, 0xa296, 0xa39a, 0xa49e, 0x0858, 0xa2a6, 0xa3aa, 0xa4ae,
+	0x0838, 0xa2b6, 0xa3ba, 0xa4be, 0x0818, 0xa2c6, 0xa3ca, 0xa4ce,
+	0x0804, 0x4958, 0xa2d6, 0xa3da, 0xa4de, 0x0804, 0x4958, 0x00e6,
+	0x2071, 0x1894, 0x7048, 0x9005, 0x0904, 0x4a31, 0x0126, 0x2091,
+	0x8000, 0x0e04, 0x4a30, 0x00f6, 0x2079, 0x0000, 0x00c6, 0x0096,
+	0x0086, 0x0076, 0x9006, 0x2038, 0x7040, 0x2048, 0x9005, 0x0500,
+	0xa948, 0x2105, 0x0016, 0x908a, 0x0036, 0x1a0c, 0x0d65, 0x2060,
+	0x001e, 0x8108, 0x2105, 0x9005, 0xa94a, 0x1904, 0x4a33, 0xa804,
+	0x9005, 0x090c, 0x0d65, 0x7042, 0x2938, 0x2040, 0xa003, 0x0000,
+	0x2001, 0x0002, 0x9080, 0x1d04, 0x2005, 0xa04a, 0x0804, 0x4a33,
+	0x703c, 0x2060, 0x2c14, 0x6304, 0x6408, 0x650c, 0x2200, 0x7836,
+	0x7833, 0x0012, 0x7882, 0x2300, 0x7886, 0x2400, 0x788a, 0x2091,
+	0x4080, 0x2001, 0x0089, 0x2004, 0xd084, 0x190c, 0x11c9, 0x87ff,
+	0x0118, 0x2748, 0x080c, 0x1054, 0x7048, 0x8001, 0x704a, 0x9005,
+	0x1170, 0x7040, 0x2048, 0x9005, 0x0128, 0x080c, 0x1054, 0x9006,
+	0x7042, 0x7046, 0x703b, 0x18b0, 0x703f, 0x18b0, 0x0420, 0x7040,
+	0x9005, 0x1508, 0x7238, 0x2c00, 0x9206, 0x0148, 0x9c80, 0x0004,
+	0x90fa, 0x18f0, 0x0210, 0x2001, 0x18b0, 0x703e, 0x00a0, 0x9006,
+	0x703e, 0x703a, 0x7044, 0x9005, 0x090c, 0x0d65, 0x2048, 0xa800,
+	0x9005, 0x1de0, 0x2900, 0x7042, 0x2001, 0x0002, 0x9080, 0x1d04,
+	0x2005, 0xa84a, 0x0000, 0x007e, 0x008e, 0x009e, 0x00ce, 0x00fe,
+	0x012e, 0x00ee, 0x0005, 0x2c00, 0x9082, 0x001b, 0x0002, 0x4a52,
+	0x4a52, 0x4a54, 0x4a52, 0x4a52, 0x4a52, 0x4a59, 0x4a52, 0x4a52,
+	0x4a52, 0x4a5e, 0x4a52, 0x4a52, 0x4a52, 0x4a63, 0x4a52, 0x4a52,
+	0x4a52, 0x4a68, 0x4a52, 0x4a52, 0x4a52, 0x4a6d, 0x4a52, 0x4a52,
+	0x4a52, 0x4a72, 0x080c, 0x0d65, 0xaa74, 0xab78, 0xac7c, 0x0804,
+	0x49de, 0xaa84, 0xab88, 0xac8c, 0x0804, 0x49de, 0xaa94, 0xab98,
+	0xac9c, 0x0804, 0x49de, 0xaaa4, 0xaba8, 0xacac, 0x0804, 0x49de,
+	0xaab4, 0xabb8, 0xacbc, 0x0804, 0x49de, 0xaac4, 0xabc8, 0xaccc,
+	0x0804, 0x49de, 0xaad4, 0xabd8, 0xacdc, 0x0804, 0x49de, 0x0026,
+	0x080c, 0x5388, 0xd0c4, 0x0120, 0x2011, 0x8014, 0x080c, 0x48da,
+	0x002e, 0x0005, 0x81ff, 0x1904, 0x33b0, 0x0126, 0x2091, 0x8000,
+	0x6030, 0xc08d, 0xc085, 0xc0ac, 0x6032, 0x080c, 0x7096, 0x1158,
+	0x080c, 0x7396, 0x080c, 0x5cd7, 0x9085, 0x0001, 0x080c, 0x70dd,
+	0x080c, 0x6fc7, 0x0010, 0x080c, 0x5b92, 0x012e, 0x0804, 0x337e,
+	0x81ff, 0x0120, 0x2009, 0x0001, 0x0804, 0x33b0, 0x080c, 0x539c,
+	0x0120, 0x2009, 0x0007, 0x0804, 0x33b0, 0x080c, 0x665e, 0x0120,
+	0x2009, 0x0008, 0x0804, 0x33b0, 0x0026, 0x2011, 0x0010, 0x080c,
+	0x668a, 0x002e, 0x0140, 0x7984, 0x080c, 0x66d4, 0x1120, 0x2009,
+	0x4009, 0x0804, 0x33b0, 0x7984, 0x080c, 0x620b, 0x1904, 0x33b3,
+	0x2b00, 0x7026, 0x080c, 0x6666, 0x7888, 0x1170, 0x9084, 0x0005,
+	0x1158, 0x900e, 0x080c, 0x655e, 0x1108, 0xc185, 0xb800, 0xd0bc,
+	0x0108, 0xc18d, 0x0804, 0x337e, 0x080c, 0x487a, 0x0904, 0x33b0,
+	0x9006, 0xa866, 0xa832, 0xa868, 0xc0fd, 0xa86a, 0x080c, 0xba79,
+	0x0904, 0x33b0, 0x7888, 0xd094, 0x0118, 0xb8c4, 0xc08d, 0xb8c6,
+	0x7007, 0x0003, 0x701f, 0x4b41, 0x0005, 0x2061, 0x1800, 0x080c,
+	0x539c, 0x2009, 0x0007, 0x1578, 0x080c, 0x665e, 0x0118, 0x2009,
+	0x0008, 0x0448, 0x080c, 0x3175, 0x0120, 0xa998, 0x080c, 0x620b,
+	0x1530, 0x080c, 0x48ab, 0x0518, 0x080c, 0x6666, 0xa89c, 0x1168,
+	0x9084, 0x0005, 0x1150, 0x900e, 0x080c, 0x655e, 0x1108, 0xc185,
+	0xb800, 0xd0bc, 0x0108, 0xc18d, 0x00d0, 0xa868, 0xc0fc, 0xa86a,
+	0x080c, 0xba79, 0x11e0, 0xa89c, 0xd094, 0x0118, 0xb8c4, 0xc08d,
+	0xb8c6, 0x2009, 0x0003, 0xa897, 0x4005, 0xa99a, 0x0010, 0xa897,
+	0x4006, 0x900e, 0x9085, 0x0001, 0x2001, 0x0030, 0x0005, 0xa897,
+	0x4000, 0xa99a, 0x9006, 0x918d, 0x0001, 0x2008, 0x0005, 0x9006,
+	0x0005, 0xa830, 0x2008, 0x918e, 0xdead, 0x1120, 0x2021, 0x4009,
+	0x0804, 0x3380, 0x9086, 0x0100, 0x7024, 0x2058, 0x1110, 0x0804,
+	0x52e5, 0x900e, 0x080c, 0x655e, 0x1108, 0xc185, 0xb800, 0xd0bc,
+	0x0108, 0xc18d, 0x0804, 0x337e, 0x080c, 0x539c, 0x0120, 0x2009,
+	0x0007, 0x0804, 0x33b0, 0x7f84, 0x7a8c, 0x7b88, 0x7c9c, 0x7d98,
+	0x080c, 0x487a, 0x1120, 0x2009, 0x0002, 0x0804, 0x33b0, 0x900e,
+	0x2130, 0x7126, 0x7132, 0xa860, 0x20e8, 0x7036, 0xa85c, 0x9080,
+	0x0005, 0x702a, 0x20a0, 0x080c, 0x626b, 0x1904, 0x4bdf, 0x080c,
+	0x6666, 0x0120, 0x080c, 0x666e, 0x1904, 0x4bdf, 0x080c, 0x665e,
+	0x1130, 0x080c, 0x655e, 0x1118, 0xd79c, 0x0904, 0x4bdf, 0xd794,
+	0x1110, 0xd784, 0x01a8, 0xb8b4, 0x20e0, 0xb8b8, 0x9080, 0x0006,
+	0x2098, 0x3400, 0xd794, 0x0160, 0x20a9, 0x0008, 0x4003, 0x2098,
+	0x20a0, 0x3d00, 0x20e0, 0x20a9, 0x0002, 0x080c, 0x468c, 0x0048,
+	0x20a9, 0x0004, 0x4003, 0x2098, 0x20a0, 0x3d00, 0x20e0, 0x080c,
+	0x468c, 0x4104, 0xd794, 0x0528, 0xb8b4, 0x20e0, 0xb8b8, 0x2060,
+	0x9c80, 0x0000, 0x2098, 0x20a9, 0x0002, 0x4003, 0x9c80, 0x0003,
+	0x2098, 0x20a9, 0x0001, 0x4005, 0x9c80, 0x0004, 0x2098, 0x3400,
+	0x20a9, 0x0002, 0x4003, 0x2098, 0x20a0, 0x3d00, 0x20e0, 0x080c,
+	0x467f, 0x9c80, 0x0026, 0x2098, 0xb8b4, 0x20e0, 0x20a9, 0x0002,
+	0x4003, 0xd794, 0x0110, 0x96b0, 0x000b, 0x96b0, 0x0005, 0x8108,
+	0x080c, 0x9b59, 0x0118, 0x9186, 0x0800, 0x0040, 0xd78c, 0x0120,
+	0x9186, 0x0800, 0x0170, 0x0018, 0x9186, 0x007e, 0x0150, 0xd794,
+	0x0118, 0x9686, 0x0020, 0x0010, 0x9686, 0x0028, 0x0150, 0x0804,
+	0x4b7b, 0x86ff, 0x1120, 0x7124, 0x810b, 0x0804, 0x337e, 0x7033,
+	0x0001, 0x7122, 0x7024, 0x9600, 0x7026, 0x772e, 0x2061, 0x18ae,
+	0x2c44, 0xa06b, 0x0000, 0xa67a, 0x7034, 0xa072, 0x7028, 0xa076,
+	0xa28e, 0xa392, 0xa496, 0xa59a, 0x080c, 0x1117, 0x7007, 0x0002,
+	0x701f, 0x4c1b, 0x0005, 0x7030, 0x9005, 0x1180, 0x7120, 0x7028,
+	0x20a0, 0x772c, 0x9036, 0x7034, 0x20e8, 0x2061, 0x18ae, 0x2c44,
+	0xa28c, 0xa390, 0xa494, 0xa598, 0x0804, 0x4b7b, 0x7124, 0x810b,
+	0x0804, 0x337e, 0x2029, 0x007e, 0x7984, 0x7a88, 0x7b8c, 0x7c98,
+	0x9184, 0xff00, 0x8007, 0x90e2, 0x0020, 0x0a04, 0x33b3, 0x9502,
+	0x0a04, 0x33b3, 0x9184, 0x00ff, 0x90e2, 0x0020, 0x0a04, 0x33b3,
+	0x9502, 0x0a04, 0x33b3, 0x9284, 0xff00, 0x8007, 0x90e2, 0x0020,
+	0x0a04, 0x33b3, 0x9502, 0x0a04, 0x33b3, 0x9284, 0x00ff, 0x90e2,
+	0x0020, 0x0a04, 0x33b3, 0x9502, 0x0a04, 0x33b3, 0x9384, 0xff00,
+	0x8007, 0x90e2, 0x0020, 0x0a04, 0x33b3, 0x9502, 0x0a04, 0x33b3,
+	0x9384, 0x00ff, 0x90e2, 0x0020, 0x0a04, 0x33b3, 0x9502, 0x0a04,
+	0x33b3, 0x9484, 0xff00, 0x8007, 0x90e2, 0x0020, 0x0a04, 0x33b3,
+	0x9502, 0x0a04, 0x33b3, 0x9484, 0x00ff, 0x90e2, 0x0020, 0x0a04,
+	0x33b3, 0x9502, 0x0a04, 0x33b3, 0x2061, 0x1959, 0x6102, 0x6206,
+	0x630a, 0x640e, 0x0804, 0x337e, 0x0006, 0x080c, 0x5388, 0xd0cc,
+	0x000e, 0x0005, 0x0006, 0x080c, 0x538c, 0xd0bc, 0x000e, 0x0005,
+	0x6170, 0x7a84, 0x6300, 0x82ff, 0x1118, 0x7986, 0x0804, 0x337e,
+	0x83ff, 0x1904, 0x33b3, 0x2001, 0xfff0, 0x9200, 0x1a04, 0x33b3,
+	0x2019, 0xffff, 0x6074, 0x9302, 0x9200, 0x0a04, 0x33b3, 0x7986,
+	0x6272, 0x0804, 0x337e, 0x080c, 0x539c, 0x1904, 0x33b0, 0x7c88,
+	0x7d84, 0x7e98, 0x7f8c, 0x080c, 0x487a, 0x0904, 0x33b0, 0x900e,
+	0x901e, 0x7326, 0x7332, 0xa860, 0x20e8, 0x7036, 0xa85c, 0x9080,
+	0x0003, 0x702a, 0x20a0, 0x91d8, 0x1000, 0x2b5c, 0x8bff, 0x0178,
+	0x080c, 0x6666, 0x0118, 0x080c, 0x666e, 0x1148, 0x20a9, 0x0001,
+	0xb814, 0x4004, 0xb810, 0x4004, 0x4104, 0x9398, 0x0003, 0x8108,
+	0x9182, 0x0800, 0x0120, 0x9386, 0x003c, 0x0170, 0x0c20, 0x83ff,
+	0x1148, 0x7224, 0x900e, 0x2001, 0x0003, 0x080c, 0x83fb, 0x2208,
+	0x0804, 0x337e, 0x7033, 0x0001, 0x7122, 0x7024, 0x9300, 0x7026,
+	0x2061, 0x18ae, 0x2c44, 0xa06b, 0x0000, 0xa37a, 0x7028, 0xa076,
+	0x7034, 0xa072, 0xa48e, 0xa592, 0xa696, 0xa79a, 0x080c, 0x1117,
+	0x7007, 0x0002, 0x701f, 0x4d0d, 0x0005, 0x7030, 0x9005, 0x1178,
+	0x7120, 0x7028, 0x20a0, 0x901e, 0x7034, 0x20e8, 0x2061, 0x18ae,
+	0x2c44, 0xa48c, 0xa590, 0xa694, 0xa798, 0x0804, 0x4ccb, 0x7224,
+	0x900e, 0x2001, 0x0003, 0x080c, 0x83fb, 0x2208, 0x0804, 0x337e,
+	0x00f6, 0x00e6, 0x080c, 0x539c, 0x2009, 0x0007, 0x1904, 0x4da0,
+	0x2071, 0x1894, 0x745c, 0x84ff, 0x2009, 0x000e, 0x1904, 0x4da0,
+	0xac9c, 0xad98, 0xaea4, 0xafa0, 0x0096, 0x080c, 0x103b, 0x2009,
+	0x0002, 0x0904, 0x4da0, 0x2900, 0x705e, 0x900e, 0x901e, 0x7356,
+	0x7362, 0xa860, 0x7066, 0xa85c, 0x9080, 0x0003, 0x705a, 0x20a0,
+	0x91d8, 0x1000, 0x2b5c, 0x8bff, 0x0178, 0x080c, 0x6666, 0x0118,
+	0x080c, 0x666e, 0x1148, 0xb814, 0x20a9, 0x0001, 0x4004, 0xb810,
 	0x4004, 0x4104, 0x9398, 0x0003, 0x8108, 0x9182, 0x0800, 0x0120,
-	0x9386, 0x003c, 0x0170, 0x0c20, 0x83ff, 0x1148, 0x7224, 0x900e,
-	0x2001, 0x0003, 0x080c, 0x8419, 0x2208, 0x0804, 0x338a, 0x7033,
-	0x0001, 0x7122, 0x7024, 0x9300, 0x7026, 0x2061, 0x18ae, 0x2c44,
-	0xa06b, 0x0000, 0xa37a, 0x7028, 0xa076, 0x7034, 0xa072, 0xa48e,
-	0xa592, 0xa696, 0xa79a, 0x080c, 0x110c, 0x7007, 0x0002, 0x701f,
-	0x4d12, 0x0005, 0x7030, 0x9005, 0x1178, 0x7120, 0x7028, 0x20a0,
-	0x901e, 0x7034, 0x20e8, 0x2061, 0x18ae, 0x2c44, 0xa48c, 0xa590,
-	0xa694, 0xa798, 0x0804, 0x4cd0, 0x7224, 0x900e, 0x2001, 0x0003,
-	0x080c, 0x8419, 0x2208, 0x0804, 0x338a, 0x00f6, 0x00e6, 0x080c,
-	0x53a1, 0x2009, 0x0007, 0x1904, 0x4da5, 0x2071, 0x1894, 0x745c,
-	0x84ff, 0x2009, 0x000e, 0x1904, 0x4da5, 0xac9c, 0xad98, 0xaea4,
-	0xafa0, 0x0096, 0x080c, 0x103b, 0x2009, 0x0002, 0x0904, 0x4da5,
-	0x2900, 0x705e, 0x900e, 0x901e, 0x7356, 0x7362, 0xa860, 0x7066,
-	0xa85c, 0x9080, 0x0003, 0x705a, 0x20a0, 0x91d8, 0x1000, 0x2b5c,
-	0x8bff, 0x0178, 0x080c, 0x6667, 0x0118, 0x080c, 0x666f, 0x1148,
-	0xb814, 0x20a9, 0x0001, 0x4004, 0xb810, 0x4004, 0x4104, 0x9398,
-	0x0003, 0x8108, 0x9182, 0x0800, 0x0120, 0x9386, 0x003c, 0x01e8,
-	0x0c20, 0x83ff, 0x11c0, 0x7254, 0x900e, 0x2001, 0x0003, 0x080c,
-	0x8419, 0x2208, 0x009e, 0xa897, 0x4000, 0xa99a, 0x715c, 0x81ff,
-	0x090c, 0x0d65, 0x2148, 0x080c, 0x1054, 0x9006, 0x705e, 0x918d,
-	0x0001, 0x2008, 0x0418, 0x7063, 0x0001, 0x7152, 0x7054, 0x9300,
-	0x7056, 0x2061, 0x18af, 0x2c44, 0xa37a, 0x7058, 0xa076, 0x7064,
-	0xa072, 0xa48e, 0xa592, 0xa696, 0xa79a, 0xa09f, 0x4db1, 0x000e,
-	0xa0a2, 0x080c, 0x110c, 0x9006, 0x0048, 0x009e, 0xa897, 0x4005,
-	0xa99a, 0x900e, 0x9085, 0x0001, 0x2001, 0x0030, 0x00ee, 0x00fe,
-	0x0005, 0x00f6, 0xa0a0, 0x904d, 0x090c, 0x0d65, 0x00e6, 0x2071,
-	0x1894, 0xa06c, 0x908e, 0x0100, 0x0138, 0xa87b, 0x0030, 0xa883,
-	0x0000, 0xa897, 0x4002, 0x00d8, 0x7060, 0x9005, 0x1158, 0x7150,
-	0x7058, 0x20a0, 0x901e, 0x7064, 0x20e8, 0xa48c, 0xa590, 0xa694,
-	0xa798, 0x0428, 0xa87b, 0x0000, 0xa883, 0x0000, 0xa897, 0x4000,
-	0x7254, 0x900e, 0x2001, 0x0003, 0x080c, 0x8419, 0xaa9a, 0x715c,
-	0x81ff, 0x090c, 0x0d65, 0x2148, 0x080c, 0x1054, 0x705f, 0x0000,
-	0xa0a0, 0x2048, 0x0126, 0x2091, 0x8000, 0x080c, 0x6996, 0x012e,
-	0xa09f, 0x0000, 0xa0a3, 0x0000, 0x00ee, 0x00fe, 0x0005, 0x91d8,
-	0x1000, 0x2b5c, 0x8bff, 0x0178, 0x080c, 0x6667, 0x0118, 0x080c,
-	0x666f, 0x1148, 0xb814, 0x20a9, 0x0001, 0x4004, 0xb810, 0x4004,
-	0x4104, 0x9398, 0x0003, 0x8108, 0x9182, 0x0800, 0x0120, 0x9386,
-	0x003c, 0x0518, 0x0c20, 0x83ff, 0x11f0, 0x7154, 0x810c, 0xa99a,
-	0xa897, 0x4000, 0x715c, 0x81ff, 0x090c, 0x0d65, 0x2148, 0x080c,
-	0x1054, 0x9006, 0x705e, 0x918d, 0x0001, 0x2008, 0xa0a0, 0x2048,
-	0x0126, 0x2091, 0x8000, 0x080c, 0x6996, 0x012e, 0xa09f, 0x0000,
-	0xa0a3, 0x0000, 0x0070, 0x7063, 0x0001, 0x7152, 0x7054, 0x9300,
-	0x7056, 0xa37a, 0xa48e, 0xa592, 0xa696, 0xa79a, 0x080c, 0x110c,
-	0x9006, 0x00ee, 0x0005, 0x0096, 0xa88c, 0x90be, 0x7000, 0x0148,
-	0x90be, 0x7100, 0x0130, 0x90be, 0x7200, 0x0118, 0x009e, 0x0804,
-	0x33bf, 0xa884, 0xa988, 0x080c, 0x2424, 0x1518, 0x080c, 0x6210,
-	0x1500, 0x7126, 0xbe12, 0xbd16, 0xae7c, 0x080c, 0x4878, 0x01c8,
-	0x080c, 0x4878, 0x01b0, 0x009e, 0xa867, 0x0000, 0xa868, 0xc0fd,
-	0xa86a, 0xa823, 0x0000, 0xa804, 0x2048, 0x080c, 0xb9f7, 0x1120,
-	0x2009, 0x0003, 0x0804, 0x33bc, 0x7007, 0x0003, 0x701f, 0x4e7e,
-	0x0005, 0x009e, 0x2009, 0x0002, 0x0804, 0x33bc, 0x7124, 0x080c,
-	0x311a, 0xa820, 0x9086, 0x8001, 0x1120, 0x2009, 0x0004, 0x0804,
-	0x33bc, 0x2900, 0x7022, 0xa804, 0x0096, 0x2048, 0x8906, 0x8006,
-	0x8007, 0x90bc, 0x003f, 0x9084, 0xffc0, 0x009e, 0x9080, 0x0002,
-	0x0076, 0x0006, 0x2098, 0x20a0, 0x27e0, 0x27e8, 0x20a9, 0x002a,
-	0x080c, 0x0f9f, 0xaa6c, 0xab70, 0xac74, 0xad78, 0x2061, 0x18ae,
-	0x2c44, 0xa06b, 0x0000, 0xae64, 0xaf8c, 0x97c6, 0x7000, 0x0118,
-	0x97c6, 0x7100, 0x1148, 0x96c2, 0x0004, 0x0600, 0x2009, 0x0004,
-	0x000e, 0x007e, 0x0804, 0x48c4, 0x97c6, 0x7200, 0x11b8, 0x96c2,
-	0x0054, 0x02a0, 0x000e, 0x007e, 0x2061, 0x18ae, 0x2c44, 0xa076,
-	0xa772, 0xa07b, 0x002a, 0xa28e, 0xa392, 0xa496, 0xa59a, 0x080c,
-	0x110c, 0x7007, 0x0002, 0x701f, 0x4eda, 0x0005, 0x000e, 0x007e,
-	0x0804, 0x33bf, 0x7020, 0x2048, 0xa804, 0x2048, 0xa804, 0x2048,
-	0x8906, 0x8006, 0x8007, 0x90bc, 0x003f, 0x9084, 0xffc0, 0x9080,
-	0x0002, 0x2098, 0x20a0, 0x27e0, 0x27e8, 0x20a9, 0x002a, 0x080c,
-	0x0f9f, 0x2100, 0x2238, 0x2061, 0x18ae, 0x2c44, 0xa28c, 0xa390,
-	0xa494, 0xa598, 0x2009, 0x002a, 0x0804, 0x48c4, 0x81ff, 0x1904,
-	0x33bc, 0x798c, 0x2001, 0x194f, 0x918c, 0x8000, 0x2102, 0x080c,
-	0x488f, 0x0904, 0x33bf, 0x080c, 0x6667, 0x0120, 0x080c, 0x666f,
-	0x1904, 0x33bf, 0x080c, 0x6337, 0x0904, 0x33bc, 0x0126, 0x2091,
-	0x8000, 0x080c, 0x64cc, 0x012e, 0x0904, 0x33bc, 0x2001, 0x194f,
-	0x2004, 0xd0fc, 0x1904, 0x338a, 0x0804, 0x4329, 0xa9a0, 0x2001,
-	0x194f, 0x918c, 0x8000, 0xc18d, 0x2102, 0x080c, 0x489c, 0x01a0,
-	0x080c, 0x6667, 0x0118, 0x080c, 0x666f, 0x1170, 0x080c, 0x6337,
-	0x2009, 0x0002, 0x0128, 0x080c, 0x64cc, 0x1170, 0x2009, 0x0003,
-	0xa897, 0x4005, 0xa99a, 0x0010, 0xa897, 0x4006, 0x900e, 0x9085,
-	0x0001, 0x2001, 0x0030, 0x0005, 0xa897, 0x4000, 0x2001, 0x194f,
-	0x2004, 0xd0fc, 0x1128, 0x080c, 0x5395, 0x0110, 0x9006, 0x0018,
-	0x900e, 0x9085, 0x0001, 0x2001, 0x0000, 0x0005, 0x78a8, 0xd08c,
-	0x1118, 0xd084, 0x0904, 0x429e, 0x080c, 0x48ab, 0x0904, 0x33bf,
-	0x080c, 0x4878, 0x1120, 0x2009, 0x0002, 0x0804, 0x33bc, 0x080c,
-	0x6667, 0x0130, 0x908e, 0x0004, 0x0118, 0x908e, 0x0005, 0x15a0,
-	0x78a8, 0xd08c, 0x0120, 0xb800, 0xc08c, 0xb802, 0x0028, 0x080c,
-	0x538d, 0xd0b4, 0x0904, 0x42d8, 0x7884, 0x908e, 0x007e, 0x0904,
-	0x42d8, 0x908e, 0x007f, 0x0904, 0x42d8, 0x908e, 0x0080, 0x0904,
-	0x42d8, 0xb800, 0xd08c, 0x1904, 0x42d8, 0xa867, 0x0000, 0xa868,
-	0xc0fd, 0xa86a, 0x080c, 0xba16, 0x1120, 0x2009, 0x0003, 0x0804,
-	0x33bc, 0x7007, 0x0003, 0x701f, 0x4fa6, 0x0005, 0x080c, 0x48ab,
-	0x0904, 0x33bf, 0x0804, 0x42d8, 0x080c, 0x3181, 0x0108, 0x0005,
-	0x2009, 0x1833, 0x210c, 0x81ff, 0x0120, 0x2009, 0x0001, 0x0804,
-	0x33bc, 0x080c, 0x53a1, 0x0120, 0x2009, 0x0007, 0x0804, 0x33bc,
-	0x080c, 0x665f, 0x0120, 0x2009, 0x0008, 0x0804, 0x33bc, 0xb89c,
-	0xd0a4, 0x1118, 0xd0ac, 0x1904, 0x42d8, 0x9006, 0xa866, 0xa832,
-	0xa868, 0xc0fd, 0xa86a, 0x080c, 0xba79, 0x1120, 0x2009, 0x0003,
-	0x0804, 0x33bc, 0x7007, 0x0003, 0x701f, 0x4fdf, 0x0005, 0xa830,
-	0x9086, 0x0100, 0x1120, 0x2009, 0x0004, 0x0804, 0x52ea, 0x080c,
-	0x48ab, 0x0904, 0x33bf, 0x0804, 0x4f78, 0x81ff, 0x2009, 0x0001,
-	0x1904, 0x33bc, 0x080c, 0x53a1, 0x2009, 0x0007, 0x1904, 0x33bc,
-	0x080c, 0x665f, 0x0120, 0x2009, 0x0008, 0x0804, 0x33bc, 0x080c,
-	0x48ab, 0x0904, 0x33bf, 0x080c, 0x6667, 0x2009, 0x0009, 0x1904,
-	0x33bc, 0x080c, 0x4878, 0x2009, 0x0002, 0x0904, 0x33bc, 0x9006,
-	0xa866, 0xa832, 0xa868, 0xc0fd, 0xa86a, 0x7988, 0x9194, 0xff00,
-	0x918c, 0x00ff, 0x9006, 0x82ff, 0x1128, 0xc0ed, 0xa952, 0x798c,
-	0xa956, 0x0038, 0x928e, 0x0100, 0x1904, 0x33bf, 0xc0e5, 0xa952,
-	0xa956, 0xa83e, 0x080c, 0xbcdc, 0x2009, 0x0003, 0x0904, 0x33bc,
-	0x7007, 0x0003, 0x701f, 0x5035, 0x0005, 0xa830, 0x9086, 0x0100,
-	0x2009, 0x0004, 0x0904, 0x33bc, 0x0804, 0x338a, 0x7aa8, 0x9284,
-	0xc000, 0x0148, 0xd2ec, 0x01a0, 0x080c, 0x53a1, 0x1188, 0x2009,
-	0x0014, 0x0804, 0x33bc, 0xd2dc, 0x1568, 0x81ff, 0x2009, 0x0001,
-	0x1904, 0x33bc, 0x080c, 0x53a1, 0x2009, 0x0007, 0x1904, 0x33bc,
-	0xd2f4, 0x0130, 0x9284, 0x5000, 0x080c, 0x5368, 0x0804, 0x338a,
-	0xd2fc, 0x0158, 0x080c, 0x48ab, 0x0904, 0x33bf, 0x7984, 0x9284,
-	0x9000, 0x080c, 0x5345, 0x0804, 0x338a, 0x080c, 0x48ab, 0x0904,
-	0x33bf, 0xb804, 0x9084, 0x00ff, 0x9086, 0x0006, 0x2009, 0x0009,
-	0x1904, 0x511e, 0x080c, 0x4878, 0x2009, 0x0002, 0x0904, 0x511e,
-	0xa85c, 0x9080, 0x001b, 0xaf60, 0x2009, 0x0008, 0x7a8c, 0x7b88,
-	0x7c9c, 0x7d98, 0x080c, 0x48c1, 0x701f, 0x508f, 0x0005, 0xa86c,
-	0x9086, 0x0500, 0x1138, 0xa870, 0x9005, 0x1120, 0xa874, 0x9084,
-	0xff00, 0x0110, 0x1904, 0x33bf, 0xa866, 0xa832, 0xa868, 0xc0fd,
-	0xa86a, 0x080c, 0x48ab, 0x1110, 0x0804, 0x33bf, 0x2009, 0x0043,
-	0x080c, 0xbd44, 0x2009, 0x0003, 0x0904, 0x511e, 0x7007, 0x0003,
-	0x701f, 0x50b3, 0x0005, 0xa830, 0x9086, 0x0100, 0x2009, 0x0004,
-	0x0904, 0x511e, 0x7984, 0x7aa8, 0x9284, 0x1000, 0x080c, 0x5345,
-	0x0804, 0x338a, 0x00c6, 0xaab0, 0x9284, 0xc000, 0x0140, 0xd2ec,
-	0x0168, 0x080c, 0x53a1, 0x1150, 0x2009, 0x0014, 0x04f0, 0x2061,
-	0x1800, 0x080c, 0x53a1, 0x2009, 0x0007, 0x15b8, 0xd2f4, 0x0128,
-	0x9284, 0x5000, 0x080c, 0x5368, 0x0050, 0xd2fc, 0x0178, 0x080c,
-	0x48a9, 0x0588, 0xa998, 0x9284, 0x9000, 0x080c, 0x5345, 0xa87b,
-	0x0000, 0xa883, 0x0000, 0xa897, 0x4000, 0x0438, 0x080c, 0x48a9,
-	0x0510, 0x080c, 0x6667, 0x2009, 0x0009, 0x11b8, 0xa8c4, 0x9086,
-	0x0500, 0x11c8, 0xa8c8, 0x9005, 0x11b0, 0xa8cc, 0x9084, 0xff00,
-	0x1190, 0x080c, 0x48a9, 0x1108, 0x0070, 0x2009, 0x004b, 0x080c,
-	0xbd44, 0x2009, 0x0003, 0x0108, 0x0078, 0x0429, 0x19c0, 0xa897,
-	0x4005, 0xa99a, 0x0010, 0xa897, 0x4006, 0x900e, 0x9085, 0x0001,
-	0x2001, 0x0030, 0x00ce, 0x0005, 0x9006, 0x0ce0, 0x7aa8, 0xd2dc,
-	0x0904, 0x33bc, 0x0016, 0x7984, 0x9284, 0x1000, 0xc0fd, 0x080c,
-	0x5345, 0x001e, 0x1904, 0x33bc, 0x0804, 0x338a, 0x00f6, 0x2d78,
-	0x0011, 0x00fe, 0x0005, 0xaab0, 0xd2dc, 0x0150, 0x0016, 0xa998,
-	0x9284, 0x1000, 0xc0fd, 0x080c, 0x5345, 0x001e, 0x9085, 0x0001,
-	0x0005, 0x81ff, 0x0120, 0x2009, 0x0001, 0x0804, 0x33bc, 0x080c,
-	0x53a1, 0x0120, 0x2009, 0x0007, 0x0804, 0x33bc, 0x7984, 0x7ea8,
-	0x96b4, 0x00ff, 0x080c, 0x6270, 0x1904, 0x33bf, 0x9186, 0x007f,
-	0x0138, 0x080c, 0x6667, 0x0120, 0x2009, 0x0009, 0x0804, 0x33bc,
-	0x080c, 0x4878, 0x1120, 0x2009, 0x0002, 0x0804, 0x33bc, 0xa867,
-	0x0000, 0xa868, 0xc0fd, 0xa86a, 0x2001, 0x0100, 0x8007, 0xa80a,
-	0x080c, 0xba30, 0x1120, 0x2009, 0x0003, 0x0804, 0x33bc, 0x7007,
-	0x0003, 0x701f, 0x517c, 0x0005, 0xa808, 0x8007, 0x9086, 0x0100,
-	0x1120, 0x2009, 0x0004, 0x0804, 0x33bc, 0xa8e0, 0xa866, 0xa810,
-	0x8007, 0x9084, 0x00ff, 0x800c, 0xa814, 0x8007, 0x9084, 0x00ff,
-	0x8004, 0x9080, 0x0002, 0x9108, 0x8906, 0x8006, 0x8007, 0x90bc,
-	0x003f, 0x9084, 0xffc0, 0x9080, 0x0004, 0x7a8c, 0x7b88, 0x7c9c,
-	0x7d98, 0x0804, 0x48c4, 0x080c, 0x4878, 0x1120, 0x2009, 0x0002,
-	0x0804, 0x33bc, 0x7984, 0x9194, 0xff00, 0x918c, 0x00ff, 0x8217,
-	0x82ff, 0x1118, 0x7023, 0x1984, 0x0040, 0x92c6, 0x0001, 0x1118,
-	0x7023, 0x199e, 0x0010, 0x0804, 0x33bf, 0x2009, 0x001a, 0x7a8c,
-	0x7b88, 0x7c9c, 0x7d98, 0xa85c, 0x9080, 0x0019, 0xaf60, 0x080c,
-	0x48c1, 0x701f, 0x51cc, 0x0005, 0x2001, 0x182d, 0x2003, 0x0001,
-	0xa85c, 0x9080, 0x0019, 0x2098, 0xa860, 0x20e0, 0x20a9, 0x001a,
-	0x7020, 0x20a0, 0x20e9, 0x0001, 0x4003, 0x0804, 0x338a, 0x080c,
-	0x4878, 0x1120, 0x2009, 0x0002, 0x0804, 0x33bc, 0x7984, 0x9194,
-	0xff00, 0x918c, 0x00ff, 0x8217, 0x82ff, 0x1118, 0x2099, 0x1984,
-	0x0040, 0x92c6, 0x0001, 0x1118, 0x2099, 0x199e, 0x0010, 0x0804,
-	0x33bf, 0xa85c, 0x9080, 0x0019, 0x20a0, 0xa860, 0x20e8, 0x20a9,
-	0x001a, 0x20e1, 0x0001, 0x4003, 0x2009, 0x001a, 0x7a8c, 0x7b88,
-	0x7c9c, 0x7d98, 0xa85c, 0x9080, 0x0019, 0xaf60, 0x0804, 0x48c4,
-	0x7884, 0x908a, 0x1000, 0x1a04, 0x33bf, 0x0126, 0x2091, 0x8000,
-	0x8003, 0x800b, 0x810b, 0x9108, 0x00c6, 0x2061, 0x19d4, 0x6142,
-	0x00ce, 0x012e, 0x0804, 0x338a, 0x00c6, 0x080c, 0x70b7, 0x1160,
-	0x080c, 0x73b7, 0x080c, 0x5cdc, 0x9085, 0x0001, 0x080c, 0x70fe,
-	0x080c, 0x6fe8, 0x080c, 0x0d65, 0x2061, 0x1800, 0x6030, 0xc09d,
-	0x6032, 0x080c, 0x5b97, 0x00ce, 0x0005, 0x00c6, 0x2001, 0x1800,
-	0x2004, 0x908e, 0x0000, 0x0904, 0x33bc, 0x7884, 0x9005, 0x0188,
-	0x7888, 0x2061, 0x196d, 0x2c0c, 0x2062, 0x080c, 0x2801, 0x01a0,
-	0x080c, 0x2809, 0x0188, 0x080c, 0x2811, 0x0170, 0x2162, 0x0804,
-	0x33bf, 0x2061, 0x0100, 0x6038, 0x9086, 0x0007, 0x1118, 0x2009,
-	0x0001, 0x0010, 0x2009, 0x0000, 0x7884, 0x9086, 0x0002, 0x1588,
-	0x2061, 0x0100, 0x6028, 0xc09c, 0x602a, 0x080c, 0x98c8, 0x0026,
-	0x2011, 0x0003, 0x080c, 0x9339, 0x2011, 0x0002, 0x080c, 0x9343,
-	0x002e, 0x080c, 0x9206, 0x0036, 0x901e, 0x080c, 0x9286, 0x003e,
-	0x080c, 0x98e4, 0x60e3, 0x0000, 0x080c, 0xd5fb, 0x080c, 0xd616,
-	0x9085, 0x0001, 0x080c, 0x70fe, 0x9006, 0x080c, 0x2833, 0x2001,
-	0x1800, 0x2003, 0x0004, 0x0026, 0x2011, 0x0008, 0x080c, 0x286d,
-	0x002e, 0x00ce, 0x0804, 0x338a, 0x81ff, 0x0120, 0x2009, 0x0001,
-	0x0804, 0x33bc, 0x080c, 0x53a1, 0x0120, 0x2009, 0x0007, 0x0804,
-	0x33bc, 0x7984, 0x7ea8, 0x96b4, 0x00ff, 0x080c, 0x6270, 0x1904,
-	0x33bf, 0x9186, 0x007f, 0x0138, 0x080c, 0x6667, 0x0120, 0x2009,
-	0x0009, 0x0804, 0x33bc, 0x080c, 0x4878, 0x1120, 0x2009, 0x0002,
-	0x0804, 0x33bc, 0xa867, 0x0000, 0xa868, 0xc0fd, 0xa86a, 0x080c,
-	0xba33, 0x1120, 0x2009, 0x0003, 0x0804, 0x33bc, 0x7007, 0x0003,
-	0x701f, 0x52d3, 0x0005, 0xa830, 0x9086, 0x0100, 0x1120, 0x2009,
-	0x0004, 0x0804, 0x33bc, 0xa8e0, 0xa866, 0xa834, 0x8007, 0x800c,
-	0xa85c, 0x9080, 0x000c, 0x7a8c, 0x7b88, 0x7c9c, 0x7d98, 0xaf60,
-	0x0804, 0x48c4, 0xa898, 0x9086, 0x000d, 0x1904, 0x33bc, 0x2021,
-	0x4005, 0x0126, 0x2091, 0x8000, 0x0e04, 0x52f7, 0x0010, 0x012e,
-	0x0cc0, 0x7c36, 0x9486, 0x4000, 0x0118, 0x7833, 0x0011, 0x0010,
-	0x7833, 0x0010, 0x7883, 0x4005, 0xa998, 0x7986, 0xa9a4, 0x799a,
-	0xa9a8, 0x799e, 0x080c, 0x48b4, 0x2091, 0x4080, 0x2001, 0x0089,
-	0x2004, 0xd084, 0x190c, 0x11be, 0x7007, 0x0001, 0x2091, 0x5000,
-	0x700f, 0x0000, 0x012e, 0x0005, 0x0126, 0x2091, 0x8000, 0x00c6,
-	0x2061, 0x19d4, 0x7984, 0x6152, 0x614e, 0x6057, 0x0000, 0x604b,
-	0x0009, 0x7898, 0x606a, 0x789c, 0x6066, 0x7888, 0x6062, 0x788c,
-	0x605e, 0x2001, 0x19e2, 0x2044, 0x2001, 0x19e9, 0xa076, 0xa060,
-	0xa072, 0xa07b, 0x0001, 0xa07f, 0x0002, 0xa06b, 0x0000, 0xa09f,
-	0x0000, 0x00ce, 0x012e, 0x0804, 0x338a, 0x0126, 0x2091, 0x8000,
-	0x00b6, 0x00c6, 0x90e4, 0xc000, 0x0128, 0x0006, 0x080c, 0xb894,
-	0x000e, 0x1198, 0xd0e4, 0x0160, 0x9180, 0x1000, 0x2004, 0x905d,
-	0x0160, 0x080c, 0x5cf6, 0x080c, 0x9b66, 0x0110, 0xb817, 0x0000,
-	0x9006, 0x00ce, 0x00be, 0x012e, 0x0005, 0x9085, 0x0001, 0x0cc8,
-	0x0126, 0x2091, 0x8000, 0x0156, 0x2010, 0x900e, 0x20a9, 0x0800,
-	0x0016, 0x9180, 0x1000, 0x2004, 0x9005, 0x0180, 0x9186, 0x007e,
-	0x0168, 0x9186, 0x007f, 0x0150, 0x9186, 0x0080, 0x0138, 0x9186,
-	0x00ff, 0x0120, 0x0026, 0x2200, 0x0801, 0x002e, 0x001e, 0x8108,
-	0x1f04, 0x5370, 0x015e, 0x012e, 0x0005, 0x2001, 0x1854, 0x2004,
-	0x0005, 0x2001, 0x1873, 0x2004, 0x0005, 0x0006, 0x2001, 0x1810,
-	0x2004, 0xd0d4, 0x000e, 0x0005, 0x2001, 0x180e, 0x2004, 0xd0b4,
-	0x0005, 0x2001, 0x1800, 0x2004, 0x9086, 0x0003, 0x0005, 0x0016,
-	0x00e6, 0x2071, 0x1894, 0x7108, 0x910d, 0x710a, 0x00ee, 0x001e,
-	0x0005, 0x79a4, 0x9182, 0x0081, 0x1a04, 0x33bf, 0x810c, 0x0016,
-	0x080c, 0x4878, 0x080c, 0x0f2a, 0x2100, 0x2238, 0x7d84, 0x7c88,
-	0x7b8c, 0x7a90, 0x001e, 0x080c, 0x48c1, 0x701f, 0x53c8, 0x0005,
-	0x2079, 0x0000, 0x7d94, 0x7c98, 0x7ba8, 0x7aac, 0x79a4, 0x810c,
-	0x2061, 0x18ae, 0x2c44, 0xa770, 0xa074, 0x2071, 0x1894, 0x080c,
-	0x48c4, 0x701f, 0x53dc, 0x0005, 0x2061, 0x18ae, 0x2c44, 0x0016,
-	0x0026, 0xa270, 0xa174, 0x080c, 0x0f32, 0x002e, 0x001e, 0x080c,
-	0x0fdf, 0x9006, 0xa802, 0xa806, 0x0804, 0x338a, 0x0126, 0x0156,
-	0x0136, 0x0146, 0x01c6, 0x01d6, 0x00c6, 0x00d6, 0x00e6, 0x00f6,
-	0x2061, 0x0100, 0x2069, 0x0200, 0x2071, 0x1800, 0x6044, 0xd0a4,
-	0x11e8, 0xd084, 0x0118, 0x080c, 0x5597, 0x0068, 0xd08c, 0x0118,
-	0x080c, 0x54a0, 0x0040, 0xd094, 0x0118, 0x080c, 0x5470, 0x0018,
-	0xd09c, 0x0108, 0x0099, 0x00fe, 0x00ee, 0x00de, 0x00ce, 0x01de,
-	0x01ce, 0x014e, 0x013e, 0x015e, 0x012e, 0x0005, 0x0016, 0x6128,
-	0xd19c, 0x1110, 0xc19d, 0x612a, 0x001e, 0x0c68, 0x0006, 0x7094,
-	0x9005, 0x000e, 0x0120, 0x7097, 0x0000, 0x708f, 0x0000, 0x624c,
-	0x9286, 0xf0f0, 0x1150, 0x6048, 0x9086, 0xf0f0, 0x0130, 0x624a,
-	0x6043, 0x0090, 0x6043, 0x0010, 0x0490, 0x9294, 0xff00, 0x9296,
-	0xf700, 0x0178, 0x7138, 0xd1a4, 0x1160, 0x6240, 0x9295, 0x0100,
-	0x6242, 0x9294, 0x0010, 0x0128, 0x2009, 0x00f7, 0x080c, 0x5c58,
-	0x00f0, 0x6040, 0x9084, 0x0010, 0x9085, 0x0140, 0x6042, 0x6043,
-	0x0000, 0x7083, 0x0000, 0x709f, 0x0001, 0x70c3, 0x0000, 0x70db,
-	0x0000, 0x2009, 0x1d80, 0x200b, 0x0000, 0x7093, 0x0000, 0x7087,
-	0x000f, 0x2009, 0x000f, 0x2011, 0x5b3a, 0x080c, 0x821d, 0x0005,
-	0x2001, 0x1875, 0x2004, 0xd08c, 0x0110, 0x705b, 0xffff, 0x7084,
-	0x9005, 0x1528, 0x2011, 0x5b3a, 0x080c, 0x8159, 0x6040, 0x9094,
-	0x0010, 0x9285, 0x0020, 0x6042, 0x20a9, 0x00c8, 0x6044, 0xd08c,
-	0x1168, 0x1f04, 0x5486, 0x6242, 0x7097, 0x0000, 0x6040, 0x9094,
-	0x0010, 0x9285, 0x0080, 0x6042, 0x6242, 0x0048, 0x6242, 0x7097,
-	0x0000, 0x708b, 0x0000, 0x9006, 0x080c, 0x5ce1, 0x0000, 0x0005,
-	0x7088, 0x908a, 0x0003, 0x1a0c, 0x0d65, 0x000b, 0x0005, 0x54aa,
-	0x54fb, 0x5596, 0x00f6, 0x0016, 0x6900, 0x918c, 0x0800, 0x708b,
-	0x0001, 0x2001, 0x015d, 0x2003, 0x0000, 0x6803, 0x00fc, 0x20a9,
-	0x0004, 0x6800, 0x9084, 0x00fc, 0x0120, 0x1f04, 0x54b9, 0x080c,
-	0x0d65, 0x68a0, 0x68a2, 0x689c, 0x689e, 0x6898, 0x689a, 0xa001,
-	0x918d, 0x1600, 0x6902, 0x001e, 0x6837, 0x0020, 0x080c, 0x5cbd,
-	0x2079, 0x1d00, 0x7833, 0x1101, 0x7837, 0x0000, 0x20e1, 0x0001,
-	0x2099, 0x1805, 0x20e9, 0x0001, 0x20a1, 0x1d0e, 0x20a9, 0x0004,
-	0x4003, 0x080c, 0x97fa, 0x20e1, 0x0001, 0x2099, 0x1d00, 0x20e9,
-	0x0000, 0x20a1, 0x0240, 0x20a9, 0x0014, 0x4003, 0x60c3, 0x000c,
-	0x600f, 0x0000, 0x080c, 0x5b6b, 0x00fe, 0x9006, 0x708e, 0x6043,
-	0x0008, 0x6042, 0x0005, 0x00f6, 0x708c, 0x708f, 0x0000, 0x9025,
-	0x0904, 0x5573, 0x6020, 0xd0b4, 0x1904, 0x5571, 0x719c, 0x81ff,
-	0x0904, 0x555f, 0x9486, 0x000c, 0x1904, 0x556c, 0x9480, 0x0018,
-	0x8004, 0x20a8, 0x080c, 0x5cb6, 0x2011, 0x0260, 0x2019, 0x1d00,
-	0x220c, 0x2304, 0x9106, 0x11e8, 0x8210, 0x8318, 0x1f04, 0x5518,
-	0x6043, 0x0004, 0x2061, 0x0140, 0x605b, 0xbc94, 0x605f, 0xf0f0,
-	0x2061, 0x0100, 0x6043, 0x0006, 0x708b, 0x0002, 0x7097, 0x0002,
-	0x2009, 0x07d0, 0x2011, 0x5b41, 0x080c, 0x821d, 0x080c, 0x5cbd,
-	0x04c0, 0x080c, 0x5cb6, 0x2079, 0x0260, 0x7930, 0x918e, 0x1101,
-	0x1558, 0x7834, 0x9005, 0x1540, 0x7900, 0x918c, 0x00ff, 0x1118,
-	0x7804, 0x9005, 0x0190, 0x080c, 0x5cb6, 0x2011, 0x026e, 0x2019,
-	0x1805, 0x20a9, 0x0004, 0x220c, 0x2304, 0x9102, 0x0230, 0x11a0,
-	0x8210, 0x8318, 0x1f04, 0x5553, 0x0078, 0x709f, 0x0000, 0x080c,
-	0x5cb6, 0x20e1, 0x0000, 0x2099, 0x0260, 0x20e9, 0x0001, 0x20a1,
-	0x1d00, 0x20a9, 0x0014, 0x4003, 0x6043, 0x0008, 0x6043, 0x0000,
-	0x0010, 0x00fe, 0x0005, 0x6040, 0x9085, 0x0100, 0x6042, 0x6020,
-	0xd0b4, 0x1db8, 0x080c, 0x97fa, 0x20e1, 0x0001, 0x2099, 0x1d00,
-	0x20e9, 0x0000, 0x20a1, 0x0240, 0x20a9, 0x0014, 0x4003, 0x60c3,
-	0x000c, 0x2011, 0x19c5, 0x2013, 0x0000, 0x708f, 0x0000, 0x60a3,
-	0x0056, 0x60a7, 0x9575, 0x080c, 0x8faa, 0x08d8, 0x0005, 0x7094,
-	0x908a, 0x001d, 0x1a0c, 0x0d65, 0x000b, 0x0005, 0x55c8, 0x55db,
-	0x5604, 0x5624, 0x564a, 0x5679, 0x569f, 0x56d7, 0x56fd, 0x572b,
-	0x5766, 0x579e, 0x57bc, 0x57e7, 0x5809, 0x5824, 0x582e, 0x5862,
-	0x5888, 0x58b7, 0x58dd, 0x5915, 0x5959, 0x5996, 0x59b7, 0x5a10,
-	0x5a32, 0x5a60, 0x5a60, 0x00c6, 0x2061, 0x1800, 0x6003, 0x0007,
-	0x2061, 0x0100, 0x6004, 0x9084, 0xfff9, 0x6006, 0x00ce, 0x0005,
-	0x2061, 0x0140, 0x605b, 0xbc94, 0x605f, 0xf0f0, 0x2061, 0x0100,
-	0x6043, 0x0002, 0x7097, 0x0001, 0x2009, 0x07d0, 0x2011, 0x5b41,
-	0x080c, 0x821d, 0x0005, 0x00f6, 0x708c, 0x9086, 0x0014, 0x1510,
-	0x6042, 0x6020, 0xd0b4, 0x11f0, 0x080c, 0x5cb6, 0x2079, 0x0260,
-	0x7a30, 0x9296, 0x1102, 0x11a0, 0x7834, 0x9005, 0x1188, 0x7a38,
-	0xd2fc, 0x0128, 0x70c0, 0x9005, 0x1110, 0x70c3, 0x0001, 0x2011,
-	0x5b41, 0x080c, 0x8159, 0x7097, 0x0010, 0x080c, 0x582e, 0x0010,
-	0x708f, 0x0000, 0x00fe, 0x0005, 0x00f6, 0x7097, 0x0003, 0x6043,
-	0x0004, 0x2011, 0x5b41, 0x080c, 0x8159, 0x080c, 0x5c3a, 0x2079,
-	0x0240, 0x7833, 0x1102, 0x7837, 0x0000, 0x20a9, 0x0008, 0x9f88,
-	0x000e, 0x200b, 0x0000, 0x8108, 0x1f04, 0x5619, 0x60c3, 0x0014,
-	0x080c, 0x5b6b, 0x00fe, 0x0005, 0x00f6, 0x708c, 0x9005, 0x0500,
-	0x2011, 0x5b41, 0x080c, 0x8159, 0x9086, 0x0014, 0x11b8, 0x080c,
-	0x5cb6, 0x2079, 0x0260, 0x7a30, 0x9296, 0x1102, 0x1178, 0x7834,
+	0x9386, 0x003c, 0x01e8, 0x0c20, 0x83ff, 0x11c0, 0x7254, 0x900e,
+	0x2001, 0x0003, 0x080c, 0x83fb, 0x2208, 0x009e, 0xa897, 0x4000,
+	0xa99a, 0x715c, 0x81ff, 0x090c, 0x0d65, 0x2148, 0x080c, 0x1054,
+	0x9006, 0x705e, 0x918d, 0x0001, 0x2008, 0x0418, 0x7063, 0x0001,
+	0x7152, 0x7054, 0x9300, 0x7056, 0x2061, 0x18af, 0x2c44, 0xa37a,
+	0x7058, 0xa076, 0x7064, 0xa072, 0xa48e, 0xa592, 0xa696, 0xa79a,
+	0xa09f, 0x4dac, 0x000e, 0xa0a2, 0x080c, 0x1117, 0x9006, 0x0048,
+	0x009e, 0xa897, 0x4005, 0xa99a, 0x900e, 0x9085, 0x0001, 0x2001,
+	0x0030, 0x00ee, 0x00fe, 0x0005, 0x00f6, 0xa0a0, 0x904d, 0x090c,
+	0x0d65, 0x00e6, 0x2071, 0x1894, 0xa06c, 0x908e, 0x0100, 0x0138,
+	0xa87b, 0x0030, 0xa883, 0x0000, 0xa897, 0x4002, 0x00d8, 0x7060,
+	0x9005, 0x1158, 0x7150, 0x7058, 0x20a0, 0x901e, 0x7064, 0x20e8,
+	0xa48c, 0xa590, 0xa694, 0xa798, 0x0428, 0xa87b, 0x0000, 0xa883,
+	0x0000, 0xa897, 0x4000, 0x7254, 0x900e, 0x2001, 0x0003, 0x080c,
+	0x83fb, 0xaa9a, 0x715c, 0x81ff, 0x090c, 0x0d65, 0x2148, 0x080c,
+	0x1054, 0x705f, 0x0000, 0xa0a0, 0x2048, 0x0126, 0x2091, 0x8000,
+	0x080c, 0x6991, 0x012e, 0xa09f, 0x0000, 0xa0a3, 0x0000, 0x00ee,
+	0x00fe, 0x0005, 0x91d8, 0x1000, 0x2b5c, 0x8bff, 0x0178, 0x080c,
+	0x6666, 0x0118, 0x080c, 0x666e, 0x1148, 0xb814, 0x20a9, 0x0001,
+	0x4004, 0xb810, 0x4004, 0x4104, 0x9398, 0x0003, 0x8108, 0x9182,
+	0x0800, 0x0120, 0x9386, 0x003c, 0x0518, 0x0c20, 0x83ff, 0x11f0,
+	0x7154, 0x810c, 0xa99a, 0xa897, 0x4000, 0x715c, 0x81ff, 0x090c,
+	0x0d65, 0x2148, 0x080c, 0x1054, 0x9006, 0x705e, 0x918d, 0x0001,
+	0x2008, 0xa0a0, 0x2048, 0x0126, 0x2091, 0x8000, 0x080c, 0x6991,
+	0x012e, 0xa09f, 0x0000, 0xa0a3, 0x0000, 0x0070, 0x7063, 0x0001,
+	0x7152, 0x7054, 0x9300, 0x7056, 0xa37a, 0xa48e, 0xa592, 0xa696,
+	0xa79a, 0x080c, 0x1117, 0x9006, 0x00ee, 0x0005, 0x0096, 0xa88c,
+	0x90be, 0x7000, 0x0148, 0x90be, 0x7100, 0x0130, 0x90be, 0x7200,
+	0x0118, 0x009e, 0x0804, 0x33b3, 0xa884, 0xa988, 0x080c, 0x243d,
+	0x1518, 0x080c, 0x620b, 0x1500, 0x7126, 0xbe12, 0xbd16, 0xae7c,
+	0x080c, 0x487a, 0x01c8, 0x080c, 0x487a, 0x01b0, 0x009e, 0xa867,
+	0x0000, 0xa868, 0xc0fd, 0xa86a, 0xa823, 0x0000, 0xa804, 0x2048,
+	0x080c, 0xb9f2, 0x1120, 0x2009, 0x0003, 0x0804, 0x33b0, 0x7007,
+	0x0003, 0x701f, 0x4e79, 0x0005, 0x009e, 0x2009, 0x0002, 0x0804,
+	0x33b0, 0x7124, 0x080c, 0x3116, 0xa820, 0x9086, 0x8001, 0x1120,
+	0x2009, 0x0004, 0x0804, 0x33b0, 0x2900, 0x7022, 0xa804, 0x0096,
+	0x2048, 0x8906, 0x8006, 0x8007, 0x90bc, 0x003f, 0x9084, 0xffc0,
+	0x009e, 0x9080, 0x0002, 0x0076, 0x0006, 0x2098, 0x20a0, 0x27e0,
+	0x27e8, 0x20a9, 0x002a, 0x080c, 0x0f9f, 0xaa6c, 0xab70, 0xac74,
+	0xad78, 0x2061, 0x18ae, 0x2c44, 0xa06b, 0x0000, 0xae64, 0xaf8c,
+	0x97c6, 0x7000, 0x0118, 0x97c6, 0x7100, 0x1148, 0x96c2, 0x0004,
+	0x0600, 0x2009, 0x0004, 0x000e, 0x007e, 0x0804, 0x48c6, 0x97c6,
+	0x7200, 0x11b8, 0x96c2, 0x0054, 0x02a0, 0x000e, 0x007e, 0x2061,
+	0x18ae, 0x2c44, 0xa076, 0xa772, 0xa07b, 0x002a, 0xa28e, 0xa392,
+	0xa496, 0xa59a, 0x080c, 0x1117, 0x7007, 0x0002, 0x701f, 0x4ed5,
+	0x0005, 0x000e, 0x007e, 0x0804, 0x33b3, 0x7020, 0x2048, 0xa804,
+	0x2048, 0xa804, 0x2048, 0x8906, 0x8006, 0x8007, 0x90bc, 0x003f,
+	0x9084, 0xffc0, 0x9080, 0x0002, 0x2098, 0x20a0, 0x27e0, 0x27e8,
+	0x20a9, 0x002a, 0x080c, 0x0f9f, 0x2100, 0x2238, 0x2061, 0x18ae,
+	0x2c44, 0xa28c, 0xa390, 0xa494, 0xa598, 0x2009, 0x002a, 0x0804,
+	0x48c6, 0x81ff, 0x1904, 0x33b0, 0x798c, 0x2001, 0x194e, 0x918c,
+	0x8000, 0x2102, 0x080c, 0x4891, 0x0904, 0x33b3, 0x080c, 0x6666,
+	0x0120, 0x080c, 0x666e, 0x1904, 0x33b3, 0x080c, 0x6332, 0x0904,
+	0x33b0, 0x0126, 0x2091, 0x8000, 0x080c, 0x64cb, 0x012e, 0x0904,
+	0x33b0, 0x2001, 0x194e, 0x2004, 0xd0fc, 0x1904, 0x337e, 0x0804,
+	0x4328, 0xa9a0, 0x2001, 0x194e, 0x918c, 0x8000, 0xc18d, 0x2102,
+	0x080c, 0x489e, 0x01a0, 0x080c, 0x6666, 0x0118, 0x080c, 0x666e,
+	0x1170, 0x080c, 0x6332, 0x2009, 0x0002, 0x0128, 0x080c, 0x64cb,
+	0x1170, 0x2009, 0x0003, 0xa897, 0x4005, 0xa99a, 0x0010, 0xa897,
+	0x4006, 0x900e, 0x9085, 0x0001, 0x2001, 0x0030, 0x0005, 0xa897,
+	0x4000, 0x2001, 0x194e, 0x2004, 0xd0fc, 0x1128, 0x080c, 0x5390,
+	0x0110, 0x9006, 0x0018, 0x900e, 0x9085, 0x0001, 0x2001, 0x0000,
+	0x0005, 0x78a8, 0xd08c, 0x1118, 0xd084, 0x0904, 0x429d, 0x080c,
+	0x48ad, 0x0904, 0x33b3, 0x080c, 0x487a, 0x1120, 0x2009, 0x0002,
+	0x0804, 0x33b0, 0x080c, 0x6666, 0x0130, 0x908e, 0x0004, 0x0118,
+	0x908e, 0x0005, 0x15a0, 0x78a8, 0xd08c, 0x0120, 0xb800, 0xc08c,
+	0xb802, 0x0028, 0x080c, 0x5388, 0xd0b4, 0x0904, 0x42d7, 0x7884,
+	0x908e, 0x007e, 0x0904, 0x42d7, 0x908e, 0x007f, 0x0904, 0x42d7,
+	0x908e, 0x0080, 0x0904, 0x42d7, 0xb800, 0xd08c, 0x1904, 0x42d7,
+	0xa867, 0x0000, 0xa868, 0xc0fd, 0xa86a, 0x080c, 0xba11, 0x1120,
+	0x2009, 0x0003, 0x0804, 0x33b0, 0x7007, 0x0003, 0x701f, 0x4fa1,
+	0x0005, 0x080c, 0x48ad, 0x0904, 0x33b3, 0x0804, 0x42d7, 0x080c,
+	0x3175, 0x0108, 0x0005, 0x2009, 0x1833, 0x210c, 0x81ff, 0x0120,
+	0x2009, 0x0001, 0x0804, 0x33b0, 0x080c, 0x539c, 0x0120, 0x2009,
+	0x0007, 0x0804, 0x33b0, 0x080c, 0x665e, 0x0120, 0x2009, 0x0008,
+	0x0804, 0x33b0, 0xb89c, 0xd0a4, 0x1118, 0xd0ac, 0x1904, 0x42d7,
+	0x9006, 0xa866, 0xa832, 0xa868, 0xc0fd, 0xa86a, 0x080c, 0xba79,
+	0x1120, 0x2009, 0x0003, 0x0804, 0x33b0, 0x7007, 0x0003, 0x701f,
+	0x4fda, 0x0005, 0xa830, 0x9086, 0x0100, 0x1120, 0x2009, 0x0004,
+	0x0804, 0x52e5, 0x080c, 0x48ad, 0x0904, 0x33b3, 0x0804, 0x4f73,
+	0x81ff, 0x2009, 0x0001, 0x1904, 0x33b0, 0x080c, 0x539c, 0x2009,
+	0x0007, 0x1904, 0x33b0, 0x080c, 0x665e, 0x0120, 0x2009, 0x0008,
+	0x0804, 0x33b0, 0x080c, 0x48ad, 0x0904, 0x33b3, 0x080c, 0x6666,
+	0x2009, 0x0009, 0x1904, 0x33b0, 0x080c, 0x487a, 0x2009, 0x0002,
+	0x0904, 0x33b0, 0x9006, 0xa866, 0xa832, 0xa868, 0xc0fd, 0xa86a,
+	0x7988, 0x9194, 0xff00, 0x918c, 0x00ff, 0x9006, 0x82ff, 0x1128,
+	0xc0ed, 0xa952, 0x798c, 0xa956, 0x0038, 0x928e, 0x0100, 0x1904,
+	0x33b3, 0xc0e5, 0xa952, 0xa956, 0xa83e, 0x080c, 0xbcdc, 0x2009,
+	0x0003, 0x0904, 0x33b0, 0x7007, 0x0003, 0x701f, 0x5030, 0x0005,
+	0xa830, 0x9086, 0x0100, 0x2009, 0x0004, 0x0904, 0x33b0, 0x0804,
+	0x337e, 0x7aa8, 0x9284, 0xc000, 0x0148, 0xd2ec, 0x01a0, 0x080c,
+	0x539c, 0x1188, 0x2009, 0x0014, 0x0804, 0x33b0, 0xd2dc, 0x1568,
+	0x81ff, 0x2009, 0x0001, 0x1904, 0x33b0, 0x080c, 0x539c, 0x2009,
+	0x0007, 0x1904, 0x33b0, 0xd2f4, 0x0130, 0x9284, 0x5000, 0x080c,
+	0x5363, 0x0804, 0x337e, 0xd2fc, 0x0158, 0x080c, 0x48ad, 0x0904,
+	0x33b3, 0x7984, 0x9284, 0x9000, 0x080c, 0x5340, 0x0804, 0x337e,
+	0x080c, 0x48ad, 0x0904, 0x33b3, 0xb804, 0x9084, 0x00ff, 0x9086,
+	0x0006, 0x2009, 0x0009, 0x1904, 0x5119, 0x080c, 0x487a, 0x2009,
+	0x0002, 0x0904, 0x5119, 0xa85c, 0x9080, 0x001b, 0xaf60, 0x2009,
+	0x0008, 0x7a8c, 0x7b88, 0x7c9c, 0x7d98, 0x080c, 0x48c3, 0x701f,
+	0x508a, 0x0005, 0xa86c, 0x9086, 0x0500, 0x1138, 0xa870, 0x9005,
+	0x1120, 0xa874, 0x9084, 0xff00, 0x0110, 0x1904, 0x33b3, 0xa866,
+	0xa832, 0xa868, 0xc0fd, 0xa86a, 0x080c, 0x48ad, 0x1110, 0x0804,
+	0x33b3, 0x2009, 0x0043, 0x080c, 0xbd44, 0x2009, 0x0003, 0x0904,
+	0x5119, 0x7007, 0x0003, 0x701f, 0x50ae, 0x0005, 0xa830, 0x9086,
+	0x0100, 0x2009, 0x0004, 0x0904, 0x5119, 0x7984, 0x7aa8, 0x9284,
+	0x1000, 0x080c, 0x5340, 0x0804, 0x337e, 0x00c6, 0xaab0, 0x9284,
+	0xc000, 0x0140, 0xd2ec, 0x0168, 0x080c, 0x539c, 0x1150, 0x2009,
+	0x0014, 0x04f0, 0x2061, 0x1800, 0x080c, 0x539c, 0x2009, 0x0007,
+	0x15b8, 0xd2f4, 0x0128, 0x9284, 0x5000, 0x080c, 0x5363, 0x0050,
+	0xd2fc, 0x0178, 0x080c, 0x48ab, 0x0588, 0xa998, 0x9284, 0x9000,
+	0x080c, 0x5340, 0xa87b, 0x0000, 0xa883, 0x0000, 0xa897, 0x4000,
+	0x0438, 0x080c, 0x48ab, 0x0510, 0x080c, 0x6666, 0x2009, 0x0009,
+	0x11b8, 0xa8c4, 0x9086, 0x0500, 0x11c8, 0xa8c8, 0x9005, 0x11b0,
+	0xa8cc, 0x9084, 0xff00, 0x1190, 0x080c, 0x48ab, 0x1108, 0x0070,
+	0x2009, 0x004b, 0x080c, 0xbd44, 0x2009, 0x0003, 0x0108, 0x0078,
+	0x0429, 0x19c0, 0xa897, 0x4005, 0xa99a, 0x0010, 0xa897, 0x4006,
+	0x900e, 0x9085, 0x0001, 0x2001, 0x0030, 0x00ce, 0x0005, 0x9006,
+	0x0ce0, 0x7aa8, 0xd2dc, 0x0904, 0x33b0, 0x0016, 0x7984, 0x9284,
+	0x1000, 0xc0fd, 0x080c, 0x5340, 0x001e, 0x1904, 0x33b0, 0x0804,
+	0x337e, 0x00f6, 0x2d78, 0x0011, 0x00fe, 0x0005, 0xaab0, 0xd2dc,
+	0x0150, 0x0016, 0xa998, 0x9284, 0x1000, 0xc0fd, 0x080c, 0x5340,
+	0x001e, 0x9085, 0x0001, 0x0005, 0x81ff, 0x0120, 0x2009, 0x0001,
+	0x0804, 0x33b0, 0x080c, 0x539c, 0x0120, 0x2009, 0x0007, 0x0804,
+	0x33b0, 0x7984, 0x7ea8, 0x96b4, 0x00ff, 0x080c, 0x626b, 0x1904,
+	0x33b3, 0x9186, 0x007f, 0x0138, 0x080c, 0x6666, 0x0120, 0x2009,
+	0x0009, 0x0804, 0x33b0, 0x080c, 0x487a, 0x1120, 0x2009, 0x0002,
+	0x0804, 0x33b0, 0xa867, 0x0000, 0xa868, 0xc0fd, 0xa86a, 0x2001,
+	0x0100, 0x8007, 0xa80a, 0x080c, 0xba2b, 0x1120, 0x2009, 0x0003,
+	0x0804, 0x33b0, 0x7007, 0x0003, 0x701f, 0x5177, 0x0005, 0xa808,
+	0x8007, 0x9086, 0x0100, 0x1120, 0x2009, 0x0004, 0x0804, 0x33b0,
+	0xa8e0, 0xa866, 0xa810, 0x8007, 0x9084, 0x00ff, 0x800c, 0xa814,
+	0x8007, 0x9084, 0x00ff, 0x8004, 0x9080, 0x0002, 0x9108, 0x8906,
+	0x8006, 0x8007, 0x90bc, 0x003f, 0x9084, 0xffc0, 0x9080, 0x0004,
+	0x7a8c, 0x7b88, 0x7c9c, 0x7d98, 0x0804, 0x48c6, 0x080c, 0x487a,
+	0x1120, 0x2009, 0x0002, 0x0804, 0x33b0, 0x7984, 0x9194, 0xff00,
+	0x918c, 0x00ff, 0x8217, 0x82ff, 0x1118, 0x7023, 0x1983, 0x0040,
+	0x92c6, 0x0001, 0x1118, 0x7023, 0x199d, 0x0010, 0x0804, 0x33b3,
+	0x2009, 0x001a, 0x7a8c, 0x7b88, 0x7c9c, 0x7d98, 0xa85c, 0x9080,
+	0x0019, 0xaf60, 0x080c, 0x48c3, 0x701f, 0x51c7, 0x0005, 0x2001,
+	0x182d, 0x2003, 0x0001, 0xa85c, 0x9080, 0x0019, 0x2098, 0xa860,
+	0x20e0, 0x20a9, 0x001a, 0x7020, 0x20a0, 0x20e9, 0x0001, 0x4003,
+	0x0804, 0x337e, 0x080c, 0x487a, 0x1120, 0x2009, 0x0002, 0x0804,
+	0x33b0, 0x7984, 0x9194, 0xff00, 0x918c, 0x00ff, 0x8217, 0x82ff,
+	0x1118, 0x2099, 0x1983, 0x0040, 0x92c6, 0x0001, 0x1118, 0x2099,
+	0x199d, 0x0010, 0x0804, 0x33b3, 0xa85c, 0x9080, 0x0019, 0x20a0,
+	0xa860, 0x20e8, 0x20a9, 0x001a, 0x20e1, 0x0001, 0x4003, 0x2009,
+	0x001a, 0x7a8c, 0x7b88, 0x7c9c, 0x7d98, 0xa85c, 0x9080, 0x0019,
+	0xaf60, 0x0804, 0x48c6, 0x7884, 0x908a, 0x1000, 0x1a04, 0x33b3,
+	0x0126, 0x2091, 0x8000, 0x8003, 0x800b, 0x810b, 0x9108, 0x00c6,
+	0x2061, 0x19d3, 0x6142, 0x00ce, 0x012e, 0x0804, 0x337e, 0x00c6,
+	0x080c, 0x7096, 0x1160, 0x080c, 0x7396, 0x080c, 0x5cd7, 0x9085,
+	0x0001, 0x080c, 0x70dd, 0x080c, 0x6fc7, 0x080c, 0x0d65, 0x2061,
+	0x1800, 0x6030, 0xc09d, 0x6032, 0x080c, 0x5b92, 0x00ce, 0x0005,
+	0x00c6, 0x2001, 0x1800, 0x2004, 0x908e, 0x0000, 0x0904, 0x33b0,
+	0x7884, 0x9005, 0x0188, 0x7888, 0x2061, 0x196c, 0x2c0c, 0x2062,
+	0x080c, 0x2820, 0x01a0, 0x080c, 0x2828, 0x0188, 0x080c, 0x2830,
+	0x0170, 0x2162, 0x0804, 0x33b3, 0x2061, 0x0100, 0x6038, 0x9086,
+	0x0007, 0x1118, 0x2009, 0x0001, 0x0010, 0x2009, 0x0000, 0x7884,
+	0x9086, 0x0002, 0x1588, 0x2061, 0x0100, 0x6028, 0xc09c, 0x602a,
+	0x080c, 0x98bb, 0x0026, 0x2011, 0x0003, 0x080c, 0x931c, 0x2011,
+	0x0002, 0x080c, 0x9326, 0x002e, 0x080c, 0x91e9, 0x0036, 0x901e,
+	0x080c, 0x9269, 0x003e, 0x080c, 0x98d7, 0x60e3, 0x0000, 0x080c,
+	0xd60c, 0x080c, 0xd627, 0x9085, 0x0001, 0x080c, 0x70dd, 0x9006,
+	0x080c, 0x2852, 0x2001, 0x1800, 0x2003, 0x0004, 0x0026, 0x2011,
+	0x0008, 0x080c, 0x288c, 0x002e, 0x00ce, 0x0804, 0x337e, 0x81ff,
+	0x0120, 0x2009, 0x0001, 0x0804, 0x33b0, 0x080c, 0x539c, 0x0120,
+	0x2009, 0x0007, 0x0804, 0x33b0, 0x7984, 0x7ea8, 0x96b4, 0x00ff,
+	0x080c, 0x626b, 0x1904, 0x33b3, 0x9186, 0x007f, 0x0138, 0x080c,
+	0x6666, 0x0120, 0x2009, 0x0009, 0x0804, 0x33b0, 0x080c, 0x487a,
+	0x1120, 0x2009, 0x0002, 0x0804, 0x33b0, 0xa867, 0x0000, 0xa868,
+	0xc0fd, 0xa86a, 0x080c, 0xba2e, 0x1120, 0x2009, 0x0003, 0x0804,
+	0x33b0, 0x7007, 0x0003, 0x701f, 0x52ce, 0x0005, 0xa830, 0x9086,
+	0x0100, 0x1120, 0x2009, 0x0004, 0x0804, 0x33b0, 0xa8e0, 0xa866,
+	0xa834, 0x8007, 0x800c, 0xa85c, 0x9080, 0x000c, 0x7a8c, 0x7b88,
+	0x7c9c, 0x7d98, 0xaf60, 0x0804, 0x48c6, 0xa898, 0x9086, 0x000d,
+	0x1904, 0x33b0, 0x2021, 0x4005, 0x0126, 0x2091, 0x8000, 0x0e04,
+	0x52f2, 0x0010, 0x012e, 0x0cc0, 0x7c36, 0x9486, 0x4000, 0x0118,
+	0x7833, 0x0011, 0x0010, 0x7833, 0x0010, 0x7883, 0x4005, 0xa998,
+	0x7986, 0xa9a4, 0x799a, 0xa9a8, 0x799e, 0x080c, 0x48b6, 0x2091,
+	0x4080, 0x2001, 0x0089, 0x2004, 0xd084, 0x190c, 0x11c9, 0x7007,
+	0x0001, 0x2091, 0x5000, 0x700f, 0x0000, 0x012e, 0x0005, 0x0126,
+	0x2091, 0x8000, 0x00c6, 0x2061, 0x19d3, 0x7984, 0x6152, 0x614e,
+	0x6057, 0x0000, 0x604b, 0x0009, 0x7898, 0x606a, 0x789c, 0x6066,
+	0x7888, 0x6062, 0x788c, 0x605e, 0x2001, 0x19e1, 0x2044, 0x2001,
+	0x19e8, 0xa076, 0xa060, 0xa072, 0xa07b, 0x0001, 0xa07f, 0x0002,
+	0xa06b, 0x0000, 0xa09f, 0x0000, 0x00ce, 0x012e, 0x0804, 0x337e,
+	0x0126, 0x2091, 0x8000, 0x00b6, 0x00c6, 0x90e4, 0xc000, 0x0128,
+	0x0006, 0x080c, 0xb88f, 0x000e, 0x1198, 0xd0e4, 0x0160, 0x9180,
+	0x1000, 0x2004, 0x905d, 0x0160, 0x080c, 0x5cf1, 0x080c, 0x9b59,
+	0x0110, 0xb817, 0x0000, 0x9006, 0x00ce, 0x00be, 0x012e, 0x0005,
+	0x9085, 0x0001, 0x0cc8, 0x0126, 0x2091, 0x8000, 0x0156, 0x2010,
+	0x900e, 0x20a9, 0x0800, 0x0016, 0x9180, 0x1000, 0x2004, 0x9005,
+	0x0180, 0x9186, 0x007e, 0x0168, 0x9186, 0x007f, 0x0150, 0x9186,
+	0x0080, 0x0138, 0x9186, 0x00ff, 0x0120, 0x0026, 0x2200, 0x0801,
+	0x002e, 0x001e, 0x8108, 0x1f04, 0x536b, 0x015e, 0x012e, 0x0005,
+	0x2001, 0x1854, 0x2004, 0x0005, 0x2001, 0x1873, 0x2004, 0x0005,
+	0x0006, 0x2001, 0x1810, 0x2004, 0xd0d4, 0x000e, 0x0005, 0x2001,
+	0x180e, 0x2004, 0xd0b4, 0x0005, 0x2001, 0x1800, 0x2004, 0x9086,
+	0x0003, 0x0005, 0x0016, 0x00e6, 0x2071, 0x1894, 0x7108, 0x910d,
+	0x710a, 0x00ee, 0x001e, 0x0005, 0x79a4, 0x9182, 0x0081, 0x1a04,
+	0x33b3, 0x810c, 0x0016, 0x080c, 0x487a, 0x080c, 0x0f2a, 0x2100,
+	0x2238, 0x7d84, 0x7c88, 0x7b8c, 0x7a90, 0x001e, 0x080c, 0x48c3,
+	0x701f, 0x53c3, 0x0005, 0x2079, 0x0000, 0x7d94, 0x7c98, 0x7ba8,
+	0x7aac, 0x79a4, 0x810c, 0x2061, 0x18ae, 0x2c44, 0xa770, 0xa074,
+	0x2071, 0x1894, 0x080c, 0x48c6, 0x701f, 0x53d7, 0x0005, 0x2061,
+	0x18ae, 0x2c44, 0x0016, 0x0026, 0xa270, 0xa174, 0x080c, 0x0f32,
+	0x002e, 0x001e, 0x080c, 0x0fdf, 0x9006, 0xa802, 0xa806, 0x0804,
+	0x337e, 0x0126, 0x0156, 0x0136, 0x0146, 0x01c6, 0x01d6, 0x00c6,
+	0x00d6, 0x00e6, 0x00f6, 0x2061, 0x0100, 0x2069, 0x0200, 0x2071,
+	0x1800, 0x6044, 0xd0a4, 0x11e8, 0xd084, 0x0118, 0x080c, 0x5592,
+	0x0068, 0xd08c, 0x0118, 0x080c, 0x549b, 0x0040, 0xd094, 0x0118,
+	0x080c, 0x546b, 0x0018, 0xd09c, 0x0108, 0x0099, 0x00fe, 0x00ee,
+	0x00de, 0x00ce, 0x01de, 0x01ce, 0x014e, 0x013e, 0x015e, 0x012e,
+	0x0005, 0x0016, 0x6128, 0xd19c, 0x1110, 0xc19d, 0x612a, 0x001e,
+	0x0c68, 0x0006, 0x7094, 0x9005, 0x000e, 0x0120, 0x7097, 0x0000,
+	0x708f, 0x0000, 0x624c, 0x9286, 0xf0f0, 0x1150, 0x6048, 0x9086,
+	0xf0f0, 0x0130, 0x624a, 0x6043, 0x0090, 0x6043, 0x0010, 0x0490,
+	0x9294, 0xff00, 0x9296, 0xf700, 0x0178, 0x7138, 0xd1a4, 0x1160,
+	0x6240, 0x9295, 0x0100, 0x6242, 0x9294, 0x0010, 0x0128, 0x2009,
+	0x00f7, 0x080c, 0x5c53, 0x00f0, 0x6040, 0x9084, 0x0010, 0x9085,
+	0x0140, 0x6042, 0x6043, 0x0000, 0x7083, 0x0000, 0x709f, 0x0001,
+	0x70c3, 0x0000, 0x70db, 0x0000, 0x2009, 0x1d80, 0x200b, 0x0000,
+	0x7093, 0x0000, 0x7087, 0x000f, 0x2009, 0x000f, 0x2011, 0x5b35,
+	0x080c, 0x81fc, 0x0005, 0x2001, 0x1875, 0x2004, 0xd08c, 0x0110,
+	0x705b, 0xffff, 0x7084, 0x9005, 0x1528, 0x2011, 0x5b35, 0x080c,
+	0x8138, 0x6040, 0x9094, 0x0010, 0x9285, 0x0020, 0x6042, 0x20a9,
+	0x00c8, 0x6044, 0xd08c, 0x1168, 0x1f04, 0x5481, 0x6242, 0x7097,
+	0x0000, 0x6040, 0x9094, 0x0010, 0x9285, 0x0080, 0x6042, 0x6242,
+	0x0048, 0x6242, 0x7097, 0x0000, 0x708b, 0x0000, 0x9006, 0x080c,
+	0x5cdc, 0x0000, 0x0005, 0x7088, 0x908a, 0x0003, 0x1a0c, 0x0d65,
+	0x000b, 0x0005, 0x54a5, 0x54f6, 0x5591, 0x00f6, 0x0016, 0x6900,
+	0x918c, 0x0800, 0x708b, 0x0001, 0x2001, 0x015d, 0x2003, 0x0000,
+	0x6803, 0x00fc, 0x20a9, 0x0004, 0x6800, 0x9084, 0x00fc, 0x0120,
+	0x1f04, 0x54b4, 0x080c, 0x0d65, 0x68a0, 0x68a2, 0x689c, 0x689e,
+	0x6898, 0x689a, 0xa001, 0x918d, 0x1600, 0x6902, 0x001e, 0x6837,
+	0x0020, 0x080c, 0x5cb8, 0x2079, 0x1d00, 0x7833, 0x1101, 0x7837,
+	0x0000, 0x20e1, 0x0001, 0x2099, 0x1805, 0x20e9, 0x0001, 0x20a1,
+	0x1d0e, 0x20a9, 0x0004, 0x4003, 0x080c, 0x97e8, 0x20e1, 0x0001,
+	0x2099, 0x1d00, 0x20e9, 0x0000, 0x20a1, 0x0240, 0x20a9, 0x0014,
+	0x4003, 0x60c3, 0x000c, 0x600f, 0x0000, 0x080c, 0x5b66, 0x00fe,
+	0x9006, 0x708e, 0x6043, 0x0008, 0x6042, 0x0005, 0x00f6, 0x708c,
+	0x708f, 0x0000, 0x9025, 0x0904, 0x556e, 0x6020, 0xd0b4, 0x1904,
+	0x556c, 0x719c, 0x81ff, 0x0904, 0x555a, 0x9486, 0x000c, 0x1904,
+	0x5567, 0x9480, 0x0018, 0x8004, 0x20a8, 0x080c, 0x5cb1, 0x2011,
+	0x0260, 0x2019, 0x1d00, 0x220c, 0x2304, 0x9106, 0x11e8, 0x8210,
+	0x8318, 0x1f04, 0x5513, 0x6043, 0x0004, 0x2061, 0x0140, 0x605b,
+	0xbc94, 0x605f, 0xf0f0, 0x2061, 0x0100, 0x6043, 0x0006, 0x708b,
+	0x0002, 0x7097, 0x0002, 0x2009, 0x07d0, 0x2011, 0x5b3c, 0x080c,
+	0x81fc, 0x080c, 0x5cb8, 0x04c0, 0x080c, 0x5cb1, 0x2079, 0x0260,
+	0x7930, 0x918e, 0x1101, 0x1558, 0x7834, 0x9005, 0x1540, 0x7900,
+	0x918c, 0x00ff, 0x1118, 0x7804, 0x9005, 0x0190, 0x080c, 0x5cb1,
+	0x2011, 0x026e, 0x2019, 0x1805, 0x20a9, 0x0004, 0x220c, 0x2304,
+	0x9102, 0x0230, 0x11a0, 0x8210, 0x8318, 0x1f04, 0x554e, 0x0078,
+	0x709f, 0x0000, 0x080c, 0x5cb1, 0x20e1, 0x0000, 0x2099, 0x0260,
+	0x20e9, 0x0001, 0x20a1, 0x1d00, 0x20a9, 0x0014, 0x4003, 0x6043,
+	0x0008, 0x6043, 0x0000, 0x0010, 0x00fe, 0x0005, 0x6040, 0x9085,
+	0x0100, 0x6042, 0x6020, 0xd0b4, 0x1db8, 0x080c, 0x97e8, 0x20e1,
+	0x0001, 0x2099, 0x1d00, 0x20e9, 0x0000, 0x20a1, 0x0240, 0x20a9,
+	0x0014, 0x4003, 0x60c3, 0x000c, 0x2011, 0x19c4, 0x2013, 0x0000,
+	0x708f, 0x0000, 0x60a3, 0x0056, 0x60a7, 0x9575, 0x080c, 0x8f8f,
+	0x08d8, 0x0005, 0x7094, 0x908a, 0x001d, 0x1a0c, 0x0d65, 0x000b,
+	0x0005, 0x55c3, 0x55d6, 0x55ff, 0x561f, 0x5645, 0x5674, 0x569a,
+	0x56d2, 0x56f8, 0x5726, 0x5761, 0x5799, 0x57b7, 0x57e2, 0x5804,
+	0x581f, 0x5829, 0x585d, 0x5883, 0x58b2, 0x58d8, 0x5910, 0x5954,
+	0x5991, 0x59b2, 0x5a0b, 0x5a2d, 0x5a5b, 0x5a5b, 0x00c6, 0x2061,
+	0x1800, 0x6003, 0x0007, 0x2061, 0x0100, 0x6004, 0x9084, 0xfff9,
+	0x6006, 0x00ce, 0x0005, 0x2061, 0x0140, 0x605b, 0xbc94, 0x605f,
+	0xf0f0, 0x2061, 0x0100, 0x6043, 0x0002, 0x7097, 0x0001, 0x2009,
+	0x07d0, 0x2011, 0x5b3c, 0x080c, 0x81fc, 0x0005, 0x00f6, 0x708c,
+	0x9086, 0x0014, 0x1510, 0x6042, 0x6020, 0xd0b4, 0x11f0, 0x080c,
+	0x5cb1, 0x2079, 0x0260, 0x7a30, 0x9296, 0x1102, 0x11a0, 0x7834,
+	0x9005, 0x1188, 0x7a38, 0xd2fc, 0x0128, 0x70c0, 0x9005, 0x1110,
+	0x70c3, 0x0001, 0x2011, 0x5b3c, 0x080c, 0x8138, 0x7097, 0x0010,
+	0x080c, 0x5829, 0x0010, 0x708f, 0x0000, 0x00fe, 0x0005, 0x00f6,
+	0x7097, 0x0003, 0x6043, 0x0004, 0x2011, 0x5b3c, 0x080c, 0x8138,
+	0x080c, 0x5c35, 0x2079, 0x0240, 0x7833, 0x1102, 0x7837, 0x0000,
+	0x20a9, 0x0008, 0x9f88, 0x000e, 0x200b, 0x0000, 0x8108, 0x1f04,
+	0x5614, 0x60c3, 0x0014, 0x080c, 0x5b66, 0x00fe, 0x0005, 0x00f6,
+	0x708c, 0x9005, 0x0500, 0x2011, 0x5b3c, 0x080c, 0x8138, 0x9086,
+	0x0014, 0x11b8, 0x080c, 0x5cb1, 0x2079, 0x0260, 0x7a30, 0x9296,
+	0x1102, 0x1178, 0x7834, 0x9005, 0x1160, 0x7a38, 0xd2fc, 0x0128,
+	0x70c0, 0x9005, 0x1110, 0x70c3, 0x0001, 0x7097, 0x0004, 0x0029,
+	0x0010, 0x080c, 0x5c8d, 0x00fe, 0x0005, 0x00f6, 0x7097, 0x0005,
+	0x080c, 0x5c35, 0x2079, 0x0240, 0x7833, 0x1103, 0x7837, 0x0000,
+	0x080c, 0x5cb1, 0x080c, 0x5c94, 0x1170, 0x7080, 0x9005, 0x1158,
+	0x7158, 0x9186, 0xffff, 0x0138, 0x2011, 0x0008, 0x080c, 0x5ae9,
+	0x0168, 0x080c, 0x5c6a, 0x20a9, 0x0008, 0x20e1, 0x0000, 0x2099,
+	0x026e, 0x20e9, 0x0000, 0x20a1, 0x024e, 0x4003, 0x60c3, 0x0014,
+	0x080c, 0x5b66, 0x00fe, 0x0005, 0x00f6, 0x708c, 0x9005, 0x0500,
+	0x2011, 0x5b3c, 0x080c, 0x8138, 0x9086, 0x0014, 0x11b8, 0x080c,
+	0x5cb1, 0x2079, 0x0260, 0x7a30, 0x9296, 0x1103, 0x1178, 0x7834,
 	0x9005, 0x1160, 0x7a38, 0xd2fc, 0x0128, 0x70c0, 0x9005, 0x1110,
-	0x70c3, 0x0001, 0x7097, 0x0004, 0x0029, 0x0010, 0x080c, 0x5c92,
-	0x00fe, 0x0005, 0x00f6, 0x7097, 0x0005, 0x080c, 0x5c3a, 0x2079,
-	0x0240, 0x7833, 0x1103, 0x7837, 0x0000, 0x080c, 0x5cb6, 0x080c,
-	0x5c99, 0x1170, 0x7080, 0x9005, 0x1158, 0x7158, 0x9186, 0xffff,
-	0x0138, 0x2011, 0x0008, 0x080c, 0x5aee, 0x0168, 0x080c, 0x5c6f,
-	0x20a9, 0x0008, 0x20e1, 0x0000, 0x2099, 0x026e, 0x20e9, 0x0000,
-	0x20a1, 0x024e, 0x4003, 0x60c3, 0x0014, 0x080c, 0x5b6b, 0x00fe,
-	0x0005, 0x00f6, 0x708c, 0x9005, 0x0500, 0x2011, 0x5b41, 0x080c,
-	0x8159, 0x9086, 0x0014, 0x11b8, 0x080c, 0x5cb6, 0x2079, 0x0260,
-	0x7a30, 0x9296, 0x1103, 0x1178, 0x7834, 0x9005, 0x1160, 0x7a38,
-	0xd2fc, 0x0128, 0x70c0, 0x9005, 0x1110, 0x70c3, 0x0001, 0x7097,
-	0x0006, 0x0029, 0x0010, 0x080c, 0x5c92, 0x00fe, 0x0005, 0x00f6,
-	0x7097, 0x0007, 0x080c, 0x5c3a, 0x2079, 0x0240, 0x7833, 0x1104,
-	0x7837, 0x0000, 0x080c, 0x5cb6, 0x080c, 0x5c99, 0x11b8, 0x7080,
-	0x9005, 0x11a0, 0x7160, 0x9186, 0xffff, 0x0180, 0x9180, 0x318b,
-	0x200d, 0x918c, 0xff00, 0x810f, 0x2011, 0x0008, 0x080c, 0x5aee,
-	0x0180, 0x080c, 0x4c97, 0x0110, 0x080c, 0x248d, 0x20a9, 0x0008,
-	0x20e1, 0x0000, 0x2099, 0x026e, 0x20e9, 0x0000, 0x20a1, 0x024e,
-	0x4003, 0x60c3, 0x0014, 0x080c, 0x5b6b, 0x00fe, 0x0005, 0x00f6,
-	0x708c, 0x9005, 0x0500, 0x2011, 0x5b41, 0x080c, 0x8159, 0x9086,
-	0x0014, 0x11b8, 0x080c, 0x5cb6, 0x2079, 0x0260, 0x7a30, 0x9296,
-	0x1104, 0x1178, 0x7834, 0x9005, 0x1160, 0x7a38, 0xd2fc, 0x0128,
-	0x70c0, 0x9005, 0x1110, 0x70c3, 0x0001, 0x7097, 0x0008, 0x0029,
-	0x0010, 0x080c, 0x5c92, 0x00fe, 0x0005, 0x00f6, 0x7097, 0x0009,
-	0x080c, 0x5c3a, 0x2079, 0x0240, 0x7833, 0x1105, 0x7837, 0x0100,
-	0x080c, 0x5c99, 0x1150, 0x7080, 0x9005, 0x1138, 0x080c, 0x5a61,
-	0x1188, 0x9085, 0x0001, 0x080c, 0x248d, 0x20a9, 0x0008, 0x080c,
-	0x5cb6, 0x20e1, 0x0000, 0x2099, 0x026e, 0x20e9, 0x0000, 0x20a1,
-	0x024e, 0x4003, 0x60c3, 0x0014, 0x080c, 0x5b6b, 0x0010, 0x080c,
-	0x55bb, 0x00fe, 0x0005, 0x00f6, 0x708c, 0x9005, 0x05a8, 0x2011,
-	0x5b41, 0x080c, 0x8159, 0x9086, 0x0014, 0x1560, 0x080c, 0x5cb6,
-	0x2079, 0x0260, 0x7a30, 0x9296, 0x1105, 0x1520, 0x7834, 0x9084,
-	0x0100, 0x2011, 0x0100, 0x921e, 0x1160, 0x7a38, 0xd2fc, 0x0128,
-	0x70c0, 0x9005, 0x1110, 0x70c3, 0x0001, 0x7097, 0x000a, 0x00b1,
-	0x0098, 0x9005, 0x1178, 0x7a38, 0xd2fc, 0x0128, 0x70c0, 0x9005,
-	0x1110, 0x70c3, 0x0001, 0x7093, 0x0000, 0x7097, 0x000e, 0x080c,
-	0x5809, 0x0010, 0x080c, 0x5c92, 0x00fe, 0x0005, 0x00f6, 0x7097,
-	0x000b, 0x2011, 0x1d0e, 0x20e9, 0x0001, 0x22a0, 0x20a9, 0x0040,
-	0x2019, 0xffff, 0x4304, 0x080c, 0x5c3a, 0x2079, 0x0240, 0x7833,
-	0x1106, 0x7837, 0x0000, 0x080c, 0x5c99, 0x0118, 0x2013, 0x0000,
-	0x0020, 0x705c, 0x9085, 0x0100, 0x2012, 0x20a9, 0x0040, 0x2009,
-	0x024e, 0x2011, 0x1d0e, 0x220e, 0x8210, 0x8108, 0x9186, 0x0260,
-	0x1128, 0x6810, 0x8000, 0x6812, 0x2009, 0x0240, 0x1f04, 0x578b,
-	0x60c3, 0x0084, 0x080c, 0x5b6b, 0x00fe, 0x0005, 0x00f6, 0x708c,
-	0x9005, 0x01c0, 0x2011, 0x5b41, 0x080c, 0x8159, 0x9086, 0x0084,
-	0x1178, 0x080c, 0x5cb6, 0x2079, 0x0260, 0x7a30, 0x9296, 0x1106,
-	0x1138, 0x7834, 0x9005, 0x1120, 0x7097, 0x000c, 0x0029, 0x0010,
-	0x080c, 0x5c92, 0x00fe, 0x0005, 0x00f6, 0x7097, 0x000d, 0x080c,
-	0x5c3a, 0x2079, 0x0240, 0x7833, 0x1107, 0x7837, 0x0000, 0x080c,
-	0x5cb6, 0x20a9, 0x0040, 0x2011, 0x026e, 0x2009, 0x024e, 0x220e,
-	0x8210, 0x8108, 0x9186, 0x0260, 0x1150, 0x6810, 0x8000, 0x6812,
-	0x2009, 0x0240, 0x6814, 0x8000, 0x6816, 0x2011, 0x0260, 0x1f04,
-	0x57cf, 0x60c3, 0x0084, 0x080c, 0x5b6b, 0x00fe, 0x0005, 0x00f6,
-	0x708c, 0x9005, 0x01e0, 0x2011, 0x5b41, 0x080c, 0x8159, 0x9086,
-	0x0084, 0x1198, 0x080c, 0x5cb6, 0x2079, 0x0260, 0x7a30, 0x9296,
-	0x1107, 0x1158, 0x7834, 0x9005, 0x1140, 0x7093, 0x0001, 0x080c,
-	0x5c0c, 0x7097, 0x000e, 0x0029, 0x0010, 0x080c, 0x5c92, 0x00fe,
-	0x0005, 0x918d, 0x0001, 0x080c, 0x5ce1, 0x7097, 0x000f, 0x708f,
-	0x0000, 0x2061, 0x0140, 0x605b, 0xbc85, 0x605f, 0xb5b5, 0x2061,
-	0x0100, 0x6043, 0x0005, 0x6043, 0x0004, 0x2009, 0x07d0, 0x2011,
-	0x5b41, 0x080c, 0x814d, 0x0005, 0x708c, 0x9005, 0x0130, 0x2011,
-	0x5b41, 0x080c, 0x8159, 0x7097, 0x0000, 0x0005, 0x7097, 0x0011,
-	0x080c, 0x97fa, 0x080c, 0x5cb6, 0x20e1, 0x0000, 0x2099, 0x0260,
-	0x20e9, 0x0000, 0x20a1, 0x0240, 0x748c, 0x9480, 0x0018, 0x9080,
-	0x0007, 0x9084, 0x03f8, 0x8004, 0x20a8, 0x4003, 0x080c, 0x5c99,
-	0x11a0, 0x7178, 0x81ff, 0x0188, 0x900e, 0x707c, 0x9084, 0x00ff,
-	0x0160, 0x080c, 0x2424, 0x9186, 0x007e, 0x0138, 0x9186, 0x0080,
-	0x0120, 0x2011, 0x0008, 0x080c, 0x5aee, 0x60c3, 0x0014, 0x080c,
-	0x5b6b, 0x0005, 0x00f6, 0x708c, 0x9005, 0x0500, 0x2011, 0x5b41,
-	0x080c, 0x8159, 0x9086, 0x0014, 0x11b8, 0x080c, 0x5cb6, 0x2079,
-	0x0260, 0x7a30, 0x9296, 0x1103, 0x1178, 0x7834, 0x9005, 0x1160,
+	0x70c3, 0x0001, 0x7097, 0x0006, 0x0029, 0x0010, 0x080c, 0x5c8d,
+	0x00fe, 0x0005, 0x00f6, 0x7097, 0x0007, 0x080c, 0x5c35, 0x2079,
+	0x0240, 0x7833, 0x1104, 0x7837, 0x0000, 0x080c, 0x5cb1, 0x080c,
+	0x5c94, 0x11b8, 0x7080, 0x9005, 0x11a0, 0x7160, 0x9186, 0xffff,
+	0x0180, 0x9180, 0x317f, 0x200d, 0x918c, 0xff00, 0x810f, 0x2011,
+	0x0008, 0x080c, 0x5ae9, 0x0180, 0x080c, 0x4c92, 0x0110, 0x080c,
+	0x24a6, 0x20a9, 0x0008, 0x20e1, 0x0000, 0x2099, 0x026e, 0x20e9,
+	0x0000, 0x20a1, 0x024e, 0x4003, 0x60c3, 0x0014, 0x080c, 0x5b66,
+	0x00fe, 0x0005, 0x00f6, 0x708c, 0x9005, 0x0500, 0x2011, 0x5b3c,
+	0x080c, 0x8138, 0x9086, 0x0014, 0x11b8, 0x080c, 0x5cb1, 0x2079,
+	0x0260, 0x7a30, 0x9296, 0x1104, 0x1178, 0x7834, 0x9005, 0x1160,
+	0x7a38, 0xd2fc, 0x0128, 0x70c0, 0x9005, 0x1110, 0x70c3, 0x0001,
+	0x7097, 0x0008, 0x0029, 0x0010, 0x080c, 0x5c8d, 0x00fe, 0x0005,
+	0x00f6, 0x7097, 0x0009, 0x080c, 0x5c35, 0x2079, 0x0240, 0x7833,
+	0x1105, 0x7837, 0x0100, 0x080c, 0x5c94, 0x1150, 0x7080, 0x9005,
+	0x1138, 0x080c, 0x5a5c, 0x1188, 0x9085, 0x0001, 0x080c, 0x24a6,
+	0x20a9, 0x0008, 0x080c, 0x5cb1, 0x20e1, 0x0000, 0x2099, 0x026e,
+	0x20e9, 0x0000, 0x20a1, 0x024e, 0x4003, 0x60c3, 0x0014, 0x080c,
+	0x5b66, 0x0010, 0x080c, 0x55b6, 0x00fe, 0x0005, 0x00f6, 0x708c,
+	0x9005, 0x05a8, 0x2011, 0x5b3c, 0x080c, 0x8138, 0x9086, 0x0014,
+	0x1560, 0x080c, 0x5cb1, 0x2079, 0x0260, 0x7a30, 0x9296, 0x1105,
+	0x1520, 0x7834, 0x9084, 0x0100, 0x2011, 0x0100, 0x921e, 0x1160,
+	0x7a38, 0xd2fc, 0x0128, 0x70c0, 0x9005, 0x1110, 0x70c3, 0x0001,
+	0x7097, 0x000a, 0x00b1, 0x0098, 0x9005, 0x1178, 0x7a38, 0xd2fc,
+	0x0128, 0x70c0, 0x9005, 0x1110, 0x70c3, 0x0001, 0x7093, 0x0000,
+	0x7097, 0x000e, 0x080c, 0x5804, 0x0010, 0x080c, 0x5c8d, 0x00fe,
+	0x0005, 0x00f6, 0x7097, 0x000b, 0x2011, 0x1d0e, 0x20e9, 0x0001,
+	0x22a0, 0x20a9, 0x0040, 0x2019, 0xffff, 0x4304, 0x080c, 0x5c35,
+	0x2079, 0x0240, 0x7833, 0x1106, 0x7837, 0x0000, 0x080c, 0x5c94,
+	0x0118, 0x2013, 0x0000, 0x0020, 0x705c, 0x9085, 0x0100, 0x2012,
+	0x20a9, 0x0040, 0x2009, 0x024e, 0x2011, 0x1d0e, 0x220e, 0x8210,
+	0x8108, 0x9186, 0x0260, 0x1128, 0x6810, 0x8000, 0x6812, 0x2009,
+	0x0240, 0x1f04, 0x5786, 0x60c3, 0x0084, 0x080c, 0x5b66, 0x00fe,
+	0x0005, 0x00f6, 0x708c, 0x9005, 0x01c0, 0x2011, 0x5b3c, 0x080c,
+	0x8138, 0x9086, 0x0084, 0x1178, 0x080c, 0x5cb1, 0x2079, 0x0260,
+	0x7a30, 0x9296, 0x1106, 0x1138, 0x7834, 0x9005, 0x1120, 0x7097,
+	0x000c, 0x0029, 0x0010, 0x080c, 0x5c8d, 0x00fe, 0x0005, 0x00f6,
+	0x7097, 0x000d, 0x080c, 0x5c35, 0x2079, 0x0240, 0x7833, 0x1107,
+	0x7837, 0x0000, 0x080c, 0x5cb1, 0x20a9, 0x0040, 0x2011, 0x026e,
+	0x2009, 0x024e, 0x220e, 0x8210, 0x8108, 0x9186, 0x0260, 0x1150,
+	0x6810, 0x8000, 0x6812, 0x2009, 0x0240, 0x6814, 0x8000, 0x6816,
+	0x2011, 0x0260, 0x1f04, 0x57ca, 0x60c3, 0x0084, 0x080c, 0x5b66,
+	0x00fe, 0x0005, 0x00f6, 0x708c, 0x9005, 0x01e0, 0x2011, 0x5b3c,
+	0x080c, 0x8138, 0x9086, 0x0084, 0x1198, 0x080c, 0x5cb1, 0x2079,
+	0x0260, 0x7a30, 0x9296, 0x1107, 0x1158, 0x7834, 0x9005, 0x1140,
+	0x7093, 0x0001, 0x080c, 0x5c07, 0x7097, 0x000e, 0x0029, 0x0010,
+	0x080c, 0x5c8d, 0x00fe, 0x0005, 0x918d, 0x0001, 0x080c, 0x5cdc,
+	0x7097, 0x000f, 0x708f, 0x0000, 0x2061, 0x0140, 0x605b, 0xbc85,
+	0x605f, 0xb5b5, 0x2061, 0x0100, 0x6043, 0x0005, 0x6043, 0x0004,
+	0x2009, 0x07d0, 0x2011, 0x5b3c, 0x080c, 0x812c, 0x0005, 0x708c,
+	0x9005, 0x0130, 0x2011, 0x5b3c, 0x080c, 0x8138, 0x7097, 0x0000,
+	0x0005, 0x7097, 0x0011, 0x080c, 0x97e8, 0x080c, 0x5cb1, 0x20e1,
+	0x0000, 0x2099, 0x0260, 0x20e9, 0x0000, 0x20a1, 0x0240, 0x748c,
+	0x9480, 0x0018, 0x9080, 0x0007, 0x9084, 0x03f8, 0x8004, 0x20a8,
+	0x4003, 0x080c, 0x5c94, 0x11a0, 0x7178, 0x81ff, 0x0188, 0x900e,
+	0x707c, 0x9084, 0x00ff, 0x0160, 0x080c, 0x243d, 0x9186, 0x007e,
+	0x0138, 0x9186, 0x0080, 0x0120, 0x2011, 0x0008, 0x080c, 0x5ae9,
+	0x60c3, 0x0014, 0x080c, 0x5b66, 0x0005, 0x00f6, 0x708c, 0x9005,
+	0x0500, 0x2011, 0x5b3c, 0x080c, 0x8138, 0x9086, 0x0014, 0x11b8,
+	0x080c, 0x5cb1, 0x2079, 0x0260, 0x7a30, 0x9296, 0x1103, 0x1178,
+	0x7834, 0x9005, 0x1160, 0x7a38, 0xd2fc, 0x0128, 0x70c0, 0x9005,
+	0x1110, 0x70c3, 0x0001, 0x7097, 0x0012, 0x0029, 0x0010, 0x708f,
+	0x0000, 0x00fe, 0x0005, 0x00f6, 0x7097, 0x0013, 0x080c, 0x5c43,
+	0x2079, 0x0240, 0x7833, 0x1103, 0x7837, 0x0000, 0x080c, 0x5cb1,
+	0x080c, 0x5c94, 0x1170, 0x7080, 0x9005, 0x1158, 0x7158, 0x9186,
+	0xffff, 0x0138, 0x2011, 0x0008, 0x080c, 0x5ae9, 0x0168, 0x080c,
+	0x5c6a, 0x20a9, 0x0008, 0x20e1, 0x0000, 0x2099, 0x026e, 0x20e9,
+	0x0000, 0x20a1, 0x024e, 0x4003, 0x60c3, 0x0014, 0x080c, 0x5b66,
+	0x00fe, 0x0005, 0x00f6, 0x708c, 0x9005, 0x0500, 0x2011, 0x5b3c,
+	0x080c, 0x8138, 0x9086, 0x0014, 0x11b8, 0x080c, 0x5cb1, 0x2079,
+	0x0260, 0x7a30, 0x9296, 0x1104, 0x1178, 0x7834, 0x9005, 0x1160,
 	0x7a38, 0xd2fc, 0x0128, 0x70c0, 0x9005, 0x1110, 0x70c3, 0x0001,
-	0x7097, 0x0012, 0x0029, 0x0010, 0x708f, 0x0000, 0x00fe, 0x0005,
-	0x00f6, 0x7097, 0x0013, 0x080c, 0x5c48, 0x2079, 0x0240, 0x7833,
-	0x1103, 0x7837, 0x0000, 0x080c, 0x5cb6, 0x080c, 0x5c99, 0x1170,
-	0x7080, 0x9005, 0x1158, 0x7158, 0x9186, 0xffff, 0x0138, 0x2011,
-	0x0008, 0x080c, 0x5aee, 0x0168, 0x080c, 0x5c6f, 0x20a9, 0x0008,
+	0x7097, 0x0014, 0x0029, 0x0010, 0x708f, 0x0000, 0x00fe, 0x0005,
+	0x00f6, 0x7097, 0x0015, 0x080c, 0x5c43, 0x2079, 0x0240, 0x7833,
+	0x1104, 0x7837, 0x0000, 0x080c, 0x5cb1, 0x080c, 0x5c94, 0x11b8,
+	0x7080, 0x9005, 0x11a0, 0x7160, 0x9186, 0xffff, 0x0180, 0x9180,
+	0x317f, 0x200d, 0x918c, 0xff00, 0x810f, 0x2011, 0x0008, 0x080c,
+	0x5ae9, 0x0180, 0x080c, 0x4c92, 0x0110, 0x080c, 0x24a6, 0x20a9,
+	0x0008, 0x20e1, 0x0000, 0x2099, 0x026e, 0x20e9, 0x0000, 0x20a1,
+	0x024e, 0x4003, 0x60c3, 0x0014, 0x080c, 0x5b66, 0x00fe, 0x0005,
+	0x00f6, 0x708c, 0x9005, 0x05f0, 0x2011, 0x5b3c, 0x080c, 0x8138,
+	0x9086, 0x0014, 0x15a8, 0x080c, 0x5cb1, 0x2079, 0x0260, 0x7a30,
+	0x9296, 0x1105, 0x1568, 0x7834, 0x9084, 0x0100, 0x2011, 0x0100,
+	0x921e, 0x1168, 0x9085, 0x0001, 0x080c, 0x5cdc, 0x7a38, 0xd2fc,
+	0x0128, 0x70c0, 0x9005, 0x1110, 0x70c3, 0x0001, 0x0080, 0x9005,
+	0x11b8, 0x7a38, 0xd2fc, 0x0128, 0x70c0, 0x9005, 0x1110, 0x70c3,
+	0x0001, 0x9085, 0x0001, 0x080c, 0x5cdc, 0x7093, 0x0000, 0x7a38,
+	0xd2f4, 0x0110, 0x70db, 0x0008, 0x7097, 0x0016, 0x0029, 0x0010,
+	0x708f, 0x0000, 0x00fe, 0x0005, 0x080c, 0x97e8, 0x080c, 0x5cb1,
+	0x20e1, 0x0000, 0x2099, 0x0260, 0x20e9, 0x0000, 0x20a1, 0x0240,
+	0x20a9, 0x000e, 0x4003, 0x2011, 0x026d, 0x2204, 0x9084, 0x0100,
+	0x2011, 0x024d, 0x2012, 0x2011, 0x026e, 0x7097, 0x0017, 0x080c,
+	0x5c94, 0x1150, 0x7080, 0x9005, 0x1138, 0x080c, 0x5a5c, 0x1188,
+	0x9085, 0x0001, 0x080c, 0x24a6, 0x20a9, 0x0008, 0x080c, 0x5cb1,
 	0x20e1, 0x0000, 0x2099, 0x026e, 0x20e9, 0x0000, 0x20a1, 0x024e,
-	0x4003, 0x60c3, 0x0014, 0x080c, 0x5b6b, 0x00fe, 0x0005, 0x00f6,
-	0x708c, 0x9005, 0x0500, 0x2011, 0x5b41, 0x080c, 0x8159, 0x9086,
-	0x0014, 0x11b8, 0x080c, 0x5cb6, 0x2079, 0x0260, 0x7a30, 0x9296,
-	0x1104, 0x1178, 0x7834, 0x9005, 0x1160, 0x7a38, 0xd2fc, 0x0128,
-	0x70c0, 0x9005, 0x1110, 0x70c3, 0x0001, 0x7097, 0x0014, 0x0029,
-	0x0010, 0x708f, 0x0000, 0x00fe, 0x0005, 0x00f6, 0x7097, 0x0015,
-	0x080c, 0x5c48, 0x2079, 0x0240, 0x7833, 0x1104, 0x7837, 0x0000,
-	0x080c, 0x5cb6, 0x080c, 0x5c99, 0x11b8, 0x7080, 0x9005, 0x11a0,
-	0x7160, 0x9186, 0xffff, 0x0180, 0x9180, 0x318b, 0x200d, 0x918c,
-	0xff00, 0x810f, 0x2011, 0x0008, 0x080c, 0x5aee, 0x0180, 0x080c,
-	0x4c97, 0x0110, 0x080c, 0x248d, 0x20a9, 0x0008, 0x20e1, 0x0000,
-	0x2099, 0x026e, 0x20e9, 0x0000, 0x20a1, 0x024e, 0x4003, 0x60c3,
-	0x0014, 0x080c, 0x5b6b, 0x00fe, 0x0005, 0x00f6, 0x708c, 0x9005,
-	0x05f0, 0x2011, 0x5b41, 0x080c, 0x8159, 0x9086, 0x0014, 0x15a8,
-	0x080c, 0x5cb6, 0x2079, 0x0260, 0x7a30, 0x9296, 0x1105, 0x1568,
-	0x7834, 0x9084, 0x0100, 0x2011, 0x0100, 0x921e, 0x1168, 0x9085,
-	0x0001, 0x080c, 0x5ce1, 0x7a38, 0xd2fc, 0x0128, 0x70c0, 0x9005,
-	0x1110, 0x70c3, 0x0001, 0x0080, 0x9005, 0x11b8, 0x7a38, 0xd2fc,
-	0x0128, 0x70c0, 0x9005, 0x1110, 0x70c3, 0x0001, 0x9085, 0x0001,
-	0x080c, 0x5ce1, 0x7093, 0x0000, 0x7a38, 0xd2f4, 0x0110, 0x70db,
-	0x0008, 0x7097, 0x0016, 0x0029, 0x0010, 0x708f, 0x0000, 0x00fe,
-	0x0005, 0x080c, 0x97fa, 0x080c, 0x5cb6, 0x20e1, 0x0000, 0x2099,
-	0x0260, 0x20e9, 0x0000, 0x20a1, 0x0240, 0x20a9, 0x000e, 0x4003,
-	0x2011, 0x026d, 0x2204, 0x9084, 0x0100, 0x2011, 0x024d, 0x2012,
-	0x2011, 0x026e, 0x7097, 0x0017, 0x080c, 0x5c99, 0x1150, 0x7080,
-	0x9005, 0x1138, 0x080c, 0x5a61, 0x1188, 0x9085, 0x0001, 0x080c,
-	0x248d, 0x20a9, 0x0008, 0x080c, 0x5cb6, 0x20e1, 0x0000, 0x2099,
-	0x026e, 0x20e9, 0x0000, 0x20a1, 0x024e, 0x4003, 0x60c3, 0x0014,
-	0x080c, 0x5b6b, 0x0010, 0x080c, 0x55bb, 0x0005, 0x00f6, 0x708c,
-	0x9005, 0x01d8, 0x2011, 0x5b41, 0x080c, 0x8159, 0x9086, 0x0084,
-	0x1190, 0x080c, 0x5cb6, 0x2079, 0x0260, 0x7a30, 0x9296, 0x1106,
-	0x1150, 0x7834, 0x9005, 0x1138, 0x9006, 0x080c, 0x5ce1, 0x7097,
-	0x0018, 0x0029, 0x0010, 0x708f, 0x0000, 0x00fe, 0x0005, 0x00f6,
-	0x7097, 0x0019, 0x080c, 0x5c48, 0x2079, 0x0240, 0x7833, 0x1106,
-	0x7837, 0x0000, 0x080c, 0x5cb6, 0x2009, 0x026e, 0x2039, 0x1d0e,
-	0x20a9, 0x0040, 0x213e, 0x8738, 0x8108, 0x9186, 0x0280, 0x1128,
-	0x6814, 0x8000, 0x6816, 0x2009, 0x0260, 0x1f04, 0x59ca, 0x2039,
-	0x1d0e, 0x080c, 0x5c99, 0x11e8, 0x2728, 0x2514, 0x8207, 0x9084,
-	0x00ff, 0x8000, 0x2018, 0x9294, 0x00ff, 0x8007, 0x9205, 0x202a,
-	0x705c, 0x2310, 0x8214, 0x92a0, 0x1d0e, 0x2414, 0x938c, 0x0001,
-	0x0118, 0x9294, 0xff00, 0x0018, 0x9294, 0x00ff, 0x8007, 0x9215,
-	0x2222, 0x20a9, 0x0040, 0x2009, 0x024e, 0x270e, 0x8738, 0x8108,
-	0x9186, 0x0260, 0x1128, 0x6810, 0x8000, 0x6812, 0x2009, 0x0240,
-	0x1f04, 0x59fd, 0x60c3, 0x0084, 0x080c, 0x5b6b, 0x00fe, 0x0005,
-	0x00f6, 0x708c, 0x9005, 0x01e0, 0x2011, 0x5b41, 0x080c, 0x8159,
-	0x9086, 0x0084, 0x1198, 0x080c, 0x5cb6, 0x2079, 0x0260, 0x7a30,
-	0x9296, 0x1107, 0x1158, 0x7834, 0x9005, 0x1140, 0x7093, 0x0001,
-	0x080c, 0x5c0c, 0x7097, 0x001a, 0x0029, 0x0010, 0x708f, 0x0000,
-	0x00fe, 0x0005, 0x9085, 0x0001, 0x080c, 0x5ce1, 0x7097, 0x001b,
-	0x080c, 0x97fa, 0x080c, 0x5cb6, 0x2011, 0x0260, 0x2009, 0x0240,
-	0x748c, 0x9480, 0x0018, 0x9080, 0x0007, 0x9084, 0x03f8, 0x8004,
-	0x20a8, 0x220e, 0x8210, 0x8108, 0x9186, 0x0260, 0x1150, 0x6810,
-	0x8000, 0x6812, 0x2009, 0x0240, 0x6814, 0x8000, 0x6816, 0x2011,
-	0x0260, 0x1f04, 0x5a49, 0x60c3, 0x0084, 0x080c, 0x5b6b, 0x0005,
-	0x0005, 0x0086, 0x0096, 0x2029, 0x1854, 0x252c, 0x20a9, 0x0008,
-	0x2041, 0x1d0e, 0x20e9, 0x0001, 0x28a0, 0x080c, 0x5cb6, 0x20e1,
-	0x0000, 0x2099, 0x026e, 0x4003, 0x20a9, 0x0008, 0x2011, 0x0007,
-	0xd5d4, 0x0108, 0x9016, 0x2800, 0x9200, 0x200c, 0x91a6, 0xffff,
-	0x1148, 0xd5d4, 0x0110, 0x8210, 0x0008, 0x8211, 0x1f04, 0x5a7b,
-	0x0804, 0x5aea, 0x82ff, 0x1160, 0xd5d4, 0x0120, 0x91a6, 0x3fff,
-	0x0d90, 0x0020, 0x91a6, 0x3fff, 0x0904, 0x5aea, 0x918d, 0xc000,
-	0x20a9, 0x0010, 0x2019, 0x0001, 0xd5d4, 0x0110, 0x2019, 0x0010,
-	0x2120, 0xd5d4, 0x0110, 0x8423, 0x0008, 0x8424, 0x1240, 0xd5d4,
-	0x0110, 0x8319, 0x0008, 0x8318, 0x1f04, 0x5aa1, 0x04d8, 0x23a8,
-	0x2021, 0x0001, 0x8426, 0x8425, 0x1f04, 0x5ab3, 0x2328, 0x8529,
-	0x92be, 0x0007, 0x0158, 0x0006, 0x2039, 0x0007, 0x2200, 0x973a,
-	0x000e, 0x27a8, 0x95a8, 0x0010, 0x1f04, 0x5ac2, 0x755a, 0x95c8,
-	0x318b, 0x292d, 0x95ac, 0x00ff, 0x757e, 0x6532, 0x6536, 0x0016,
-	0x2508, 0x080c, 0x246d, 0x001e, 0x60e7, 0x0000, 0x65ea, 0x2018,
-	0x2304, 0x9405, 0x201a, 0x7083, 0x0001, 0x20e9, 0x0000, 0x20a1,
-	0x024e, 0x20e1, 0x0001, 0x2898, 0x20a9, 0x0008, 0x4003, 0x9085,
-	0x0001, 0x0008, 0x9006, 0x009e, 0x008e, 0x0005, 0x0156, 0x01c6,
-	0x01d6, 0x0136, 0x0146, 0x22a8, 0x20e1, 0x0000, 0x2099, 0x026e,
-	0x20e9, 0x0000, 0x2011, 0x024e, 0x22a0, 0x4003, 0x014e, 0x013e,
-	0x01de, 0x01ce, 0x015e, 0x2118, 0x9026, 0x2001, 0x0007, 0x939a,
-	0x0010, 0x0218, 0x8420, 0x8001, 0x0cd0, 0x2118, 0x84ff, 0x0120,
-	0x939a, 0x0010, 0x8421, 0x1de0, 0x2021, 0x0001, 0x83ff, 0x0118,
-	0x8423, 0x8319, 0x1de8, 0x9238, 0x2029, 0x026e, 0x9528, 0x2504,
-	0x942c, 0x11b8, 0x9405, 0x203a, 0x715a, 0x91a0, 0x318b, 0x242d,
-	0x95ac, 0x00ff, 0x757e, 0x6532, 0x6536, 0x0016, 0x2508, 0x080c,
-	0x246d, 0x001e, 0x60e7, 0x0000, 0x65ea, 0x7083, 0x0001, 0x9084,
-	0x0000, 0x0005, 0x00e6, 0x2071, 0x1800, 0x7087, 0x0000, 0x00ee,
-	0x0005, 0x00e6, 0x00f6, 0x2079, 0x0100, 0x2071, 0x0140, 0x080c,
-	0x5bfb, 0x080c, 0x8fb7, 0x7004, 0x9084, 0x4000, 0x0110, 0x080c,
-	0x2843, 0x0126, 0x2091, 0x8000, 0x2071, 0x1825, 0x2073, 0x0000,
-	0x7840, 0x0026, 0x0016, 0x2009, 0x00f7, 0x080c, 0x5c58, 0x001e,
-	0x9094, 0x0010, 0x9285, 0x0080, 0x7842, 0x7a42, 0x002e, 0x012e,
-	0x00fe, 0x00ee, 0x0005, 0x0126, 0x2091, 0x8000, 0x080c, 0x27a2,
-	0x0228, 0x2011, 0x0101, 0x2204, 0xc0c5, 0x2012, 0x2011, 0x19c5,
-	0x2013, 0x0000, 0x708f, 0x0000, 0x012e, 0x60a3, 0x0056, 0x60a7,
-	0x9575, 0x080c, 0x8faa, 0x6144, 0xd184, 0x0120, 0x7194, 0x918d,
-	0x2000, 0x0018, 0x7188, 0x918d, 0x1000, 0x2011, 0x196a, 0x2112,
-	0x2009, 0x07d0, 0x2011, 0x5b41, 0x080c, 0x821d, 0x0005, 0x0016,
-	0x0026, 0x00c6, 0x0126, 0x2091, 0x8000, 0x080c, 0x98c8, 0x080c,
-	0x9b6d, 0x080c, 0x98e4, 0x2009, 0x00f7, 0x080c, 0x5c58, 0x2061,
-	0x19d4, 0x900e, 0x611a, 0x611e, 0x6172, 0x6176, 0x2061, 0x1800,
-	0x6003, 0x0001, 0x2061, 0x0100, 0x6043, 0x0090, 0x6043, 0x0010,
-	0x2009, 0x196a, 0x200b, 0x0000, 0x2009, 0x002d, 0x2011, 0x5bc7,
-	0x080c, 0x814d, 0x012e, 0x00ce, 0x002e, 0x001e, 0x0005, 0x00e6,
-	0x0006, 0x0126, 0x2091, 0x8000, 0x0471, 0x2071, 0x0100, 0x080c,
-	0x8fb7, 0x2071, 0x0140, 0x7004, 0x9084, 0x4000, 0x0110, 0x080c,
-	0x2843, 0x080c, 0x70bf, 0x0188, 0x080c, 0x70da, 0x1170, 0x080c,
-	0x73c1, 0x0016, 0x080c, 0x253c, 0x2001, 0x193e, 0x2102, 0x001e,
-	0x080c, 0x73bc, 0x080c, 0x6fe8, 0x0050, 0x2009, 0x0001, 0x080c,
-	0x281f, 0x2001, 0x0001, 0x080c, 0x23c9, 0x080c, 0x5b97, 0x012e,
-	0x000e, 0x00ee, 0x0005, 0x2001, 0x180e, 0x2004, 0xd0bc, 0x0158,
-	0x0026, 0x0036, 0x2011, 0x8017, 0x2001, 0x196a, 0x201c, 0x080c,
-	0x48d8, 0x003e, 0x002e, 0x0005, 0x20a9, 0x0012, 0x20e9, 0x0001,
-	0x20a1, 0x1d80, 0x080c, 0x5cb6, 0x20e9, 0x0000, 0x2099, 0x026e,
-	0x0099, 0x20a9, 0x0020, 0x080c, 0x5cb0, 0x2099, 0x0260, 0x20a1,
-	0x1d92, 0x0051, 0x20a9, 0x000e, 0x080c, 0x5cb3, 0x2099, 0x0260,
-	0x20a1, 0x1db2, 0x0009, 0x0005, 0x0016, 0x0026, 0x3410, 0x3308,
-	0x2104, 0x8007, 0x2012, 0x8108, 0x8210, 0x1f04, 0x5c30, 0x002e,
-	0x001e, 0x0005, 0x080c, 0x97fa, 0x20e1, 0x0001, 0x2099, 0x1d00,
-	0x20e9, 0x0000, 0x20a1, 0x0240, 0x20a9, 0x000c, 0x4003, 0x0005,
-	0x080c, 0x97fa, 0x080c, 0x5cb6, 0x20e1, 0x0000, 0x2099, 0x0260,
-	0x20e9, 0x0000, 0x20a1, 0x0240, 0x20a9, 0x000c, 0x4003, 0x0005,
-	0x00c6, 0x0006, 0x2061, 0x0100, 0x810f, 0x2001, 0x1833, 0x2004,
-	0x9005, 0x1138, 0x2001, 0x1817, 0x2004, 0x9084, 0x00ff, 0x9105,
-	0x0010, 0x9185, 0x00f7, 0x604a, 0x000e, 0x00ce, 0x0005, 0x0016,
-	0x0046, 0x080c, 0x6663, 0x0158, 0x9006, 0x2020, 0x2009, 0x002a,
-	0x080c, 0xd273, 0x2001, 0x180c, 0x200c, 0xc195, 0x2102, 0x2019,
-	0x002a, 0x900e, 0x080c, 0x2fc5, 0x080c, 0xbf61, 0x0140, 0x0036,
-	0x2019, 0xffff, 0x2021, 0x0007, 0x080c, 0x4a75, 0x003e, 0x004e,
-	0x001e, 0x0005, 0x080c, 0x5b97, 0x7097, 0x0000, 0x708f, 0x0000,
-	0x0005, 0x0006, 0x2001, 0x180c, 0x2004, 0xd09c, 0x0100, 0x000e,
-	0x0005, 0x0006, 0x0016, 0x0126, 0x2091, 0x8000, 0x2001, 0x0101,
-	0x200c, 0x918d, 0x0006, 0x2102, 0x012e, 0x001e, 0x000e, 0x0005,
-	0x2009, 0x0001, 0x0020, 0x2009, 0x0002, 0x0008, 0x900e, 0x6814,
-	0x9084, 0xffc0, 0x910d, 0x6916, 0x0005, 0x00f6, 0x0156, 0x0146,
-	0x01d6, 0x9006, 0x20a9, 0x0080, 0x20e9, 0x0001, 0x20a1, 0x1d00,
-	0x4004, 0x2079, 0x1d00, 0x7803, 0x2200, 0x7807, 0x00ef, 0x780f,
-	0x00ef, 0x7813, 0x0138, 0x7823, 0xffff, 0x7827, 0xffff, 0x01de,
-	0x014e, 0x015e, 0x00fe, 0x0005, 0x2001, 0x1800, 0x2003, 0x0001,
-	0x0005, 0x2001, 0x1977, 0x0118, 0x2003, 0x0001, 0x0010, 0x2003,
-	0x0000, 0x0005, 0x0156, 0x20a9, 0x0800, 0x2009, 0x1000, 0x9006,
-	0x200a, 0x8108, 0x1f04, 0x5cf0, 0x015e, 0x0005, 0x00d6, 0x0036,
-	0x0156, 0x0136, 0x0146, 0x2069, 0x1853, 0x9006, 0xb802, 0xb8c6,
-	0xb807, 0x0707, 0xb80a, 0xb80e, 0xb812, 0x9198, 0x318b, 0x231d,
-	0x939c, 0x00ff, 0xbb16, 0x0016, 0x0026, 0xb886, 0x080c, 0x9b66,
-	0x1120, 0x9192, 0x007e, 0x1208, 0xbb86, 0x20a9, 0x0004, 0xb8b4,
-	0x20e8, 0xb9b8, 0x9198, 0x0006, 0x9006, 0x23a0, 0x4004, 0x20a9,
-	0x0004, 0x9198, 0x000a, 0x23a0, 0x4004, 0x002e, 0x001e, 0xb83e,
-	0xb842, 0xb8be, 0xb8c2, 0xb85e, 0xb862, 0xb866, 0xb86a, 0xb86f,
-	0x0100, 0xb872, 0xb876, 0xb87a, 0xb88a, 0xb88e, 0xb893, 0x0008,
-	0xb896, 0xb89a, 0xb89e, 0xb8ae, 0xb9a2, 0x0096, 0xb8a4, 0x904d,
-	0x0110, 0x080c, 0x1054, 0xb8a7, 0x0000, 0x009e, 0x9006, 0xb84a,
-	0x6810, 0xb83a, 0x680c, 0xb846, 0x6814, 0x9084, 0x00ff, 0xb842,
-	0x014e, 0x013e, 0x015e, 0x003e, 0x00de, 0x0005, 0x0126, 0x2091,
-	0x8000, 0xa974, 0xae78, 0x9684, 0x3fff, 0x9082, 0x4000, 0x1a04,
-	0x5db4, 0x9182, 0x0800, 0x1a04, 0x5db8, 0x2001, 0x180c, 0x2004,
-	0x9084, 0x0003, 0x1904, 0x5dbe, 0x9188, 0x1000, 0x2104, 0x905d,
-	0x0198, 0xb804, 0x9084, 0x00ff, 0x908e, 0x0006, 0x1188, 0xb8a4,
-	0x900d, 0x1904, 0x5dd0, 0x080c, 0x612a, 0x9006, 0x012e, 0x0005,
-	0x2001, 0x0005, 0x900e, 0x04b8, 0x2001, 0x0028, 0x900e, 0x0498,
-	0x9082, 0x0006, 0x1290, 0x080c, 0x9b66, 0x1160, 0xb8a0, 0x9084,
-	0xff80, 0x1140, 0xb900, 0xd1fc, 0x0d10, 0x2001, 0x0029, 0x2009,
-	0x1000, 0x0408, 0x2001, 0x0028, 0x00a8, 0x2009, 0x180c, 0x210c,
-	0xd18c, 0x0118, 0x2001, 0x0004, 0x0068, 0xd184, 0x0118, 0x2001,
-	0x0004, 0x0040, 0x2001, 0x0029, 0xb900, 0xd1fc, 0x0118, 0x2009,
-	0x1000, 0x0048, 0x900e, 0x0038, 0x2001, 0x0029, 0x900e, 0x0018,
-	0x2001, 0x0029, 0x900e, 0x9005, 0x012e, 0x0005, 0x2001, 0x180c,
-	0x2004, 0xd084, 0x19d0, 0x9188, 0x1000, 0x2104, 0x9065, 0x09a8,
-	0x080c, 0x6667, 0x1990, 0xb800, 0xd0bc, 0x0978, 0x0804, 0x5d77,
-	0x080c, 0x64db, 0x0904, 0x5d80, 0x0804, 0x5d7b, 0x00e6, 0x2071,
-	0x19b8, 0x7004, 0x9086, 0x0002, 0x1128, 0x7030, 0x9080, 0x0004,
-	0x2004, 0x9b06, 0x00ee, 0x0005, 0x00b6, 0x00e6, 0x0126, 0x2091,
-	0x8000, 0xa974, 0x9182, 0x0800, 0x1a04, 0x5e5f, 0x9188, 0x1000,
-	0x2104, 0x905d, 0x0904, 0x5e37, 0xb8a0, 0x9086, 0x007f, 0x0178,
-	0x080c, 0x666f, 0x0160, 0xa994, 0x81ff, 0x0130, 0x908e, 0x0004,
-	0x0130, 0x908e, 0x0005, 0x0118, 0x080c, 0x6667, 0x1598, 0xa87c,
-	0xd0fc, 0x01e0, 0xa894, 0x9005, 0x01c8, 0x2060, 0x0026, 0x2010,
-	0x080c, 0xb835, 0x002e, 0x1120, 0x2001, 0x0008, 0x0804, 0x5e61,
-	0x6020, 0x9086, 0x000a, 0x0120, 0x2001, 0x0008, 0x0804, 0x5e61,
-	0x601a, 0x6003, 0x0008, 0x2900, 0x6016, 0x0058, 0x080c, 0x9b91,
-	0x05e8, 0x2b00, 0x6012, 0x2900, 0x6016, 0x600b, 0xffff, 0x6023,
-	0x000a, 0x2009, 0x0003, 0x080c, 0x9c85, 0x9006, 0x0458, 0x2001,
-	0x0028, 0x0438, 0x9082, 0x0006, 0x1290, 0x080c, 0x9b66, 0x1160,
-	0xb8a0, 0x9084, 0xff80, 0x1140, 0xb900, 0xd1fc, 0x0900, 0x2001,
-	0x0029, 0x2009, 0x1000, 0x00a8, 0x2001, 0x0028, 0x0090, 0x2009,
-	0x180c, 0x210c, 0xd18c, 0x0118, 0x2001, 0x0004, 0x0050, 0xd184,
-	0x0118, 0x2001, 0x0004, 0x0028, 0x2001, 0x0029, 0x0010, 0x2001,
-	0x0029, 0x9005, 0x012e, 0x00ee, 0x00be, 0x0005, 0x2001, 0x002c,
-	0x0cc0, 0x00f6, 0x00b6, 0x0126, 0x2091, 0x8000, 0xa8e0, 0x9005,
-	0x1550, 0xa8dc, 0x9082, 0x0101, 0x1630, 0xa8c8, 0x9005, 0x1518,
-	0xa8c4, 0x9082, 0x0101, 0x12f8, 0xa974, 0x2079, 0x1800, 0x9182,
-	0x0800, 0x12e8, 0x7830, 0x9084, 0x0003, 0x1130, 0xaa98, 0xab94,
-	0xa878, 0x9084, 0x0007, 0x00ea, 0x7930, 0xd18c, 0x0118, 0x2001,
-	0x0004, 0x0038, 0xd184, 0x0118, 0x2001, 0x0004, 0x0010, 0x2001,
-	0x0029, 0x900e, 0x0038, 0x2001, 0x002c, 0x900e, 0x0018, 0x2001,
-	0x0029, 0x900e, 0x9006, 0x0008, 0x9005, 0x012e, 0x00be, 0x00fe,
-	0x0005, 0x5ef6, 0x5eb1, 0x5ec8, 0x5ef6, 0x5ef6, 0x5ef6, 0x5ef6,
-	0x5ef6, 0x2100, 0x9082, 0x007e, 0x1278, 0x080c, 0x6210, 0x0148,
-	0x9046, 0xb810, 0x9306, 0x1904, 0x5efe, 0xb814, 0x9206, 0x15f0,
-	0x0028, 0xbb12, 0xba16, 0x0010, 0x080c, 0x4792, 0x0150, 0x04b0,
-	0x080c, 0x6270, 0x1598, 0xb810, 0x9306, 0x1580, 0xb814, 0x9206,
-	0x1568, 0x080c, 0x9b91, 0x0530, 0x2b00, 0x6012, 0x080c, 0xbcdb,
-	0x2900, 0x6016, 0x600b, 0xffff, 0x6023, 0x000a, 0xa878, 0x9086,
-	0x0001, 0x1170, 0x080c, 0x3006, 0x9006, 0x080c, 0x61ad, 0x2001,
-	0x0002, 0x080c, 0x61c1, 0x2001, 0x0200, 0xb86e, 0xb893, 0x0002,
-	0x2009, 0x0003, 0x080c, 0x9c85, 0x9006, 0x0068, 0x2001, 0x0001,
-	0x900e, 0x0038, 0x2001, 0x002c, 0x900e, 0x0018, 0x2001, 0x0028,
-	0x900e, 0x9005, 0x0000, 0x012e, 0x00be, 0x00fe, 0x0005, 0x00b6,
-	0x00f6, 0x00e6, 0x0126, 0x2091, 0x8000, 0xa894, 0x90c6, 0x0015,
-	0x0904, 0x60d3, 0x90c6, 0x0056, 0x0904, 0x60d7, 0x90c6, 0x0066,
-	0x0904, 0x60db, 0x90c6, 0x0067, 0x0904, 0x60df, 0x90c6, 0x0068,
-	0x0904, 0x60e3, 0x90c6, 0x0071, 0x0904, 0x60e7, 0x90c6, 0x0074,
-	0x0904, 0x60eb, 0x90c6, 0x007c, 0x0904, 0x60ef, 0x90c6, 0x007e,
-	0x0904, 0x60f3, 0x90c6, 0x0037, 0x0904, 0x60f7, 0x9016, 0x2079,
-	0x1800, 0xa974, 0x9186, 0x00ff, 0x0904, 0x60ce, 0x9182, 0x0800,
-	0x1a04, 0x60ce, 0x080c, 0x6270, 0x1198, 0xb804, 0x9084, 0x00ff,
-	0x9082, 0x0006, 0x1268, 0xa894, 0x90c6, 0x006f, 0x0148, 0x080c,
-	0x9b66, 0x1904, 0x60b7, 0xb8a0, 0x9084, 0xff80, 0x1904, 0x60b7,
-	0xa894, 0x90c6, 0x006f, 0x0158, 0x90c6, 0x005e, 0x0904, 0x6017,
-	0x90c6, 0x0064, 0x0904, 0x6040, 0x2008, 0x0804, 0x5fda, 0xa998,
-	0xa8b0, 0x2040, 0x080c, 0x9b66, 0x1120, 0x9182, 0x007f, 0x0a04,
-	0x5fda, 0x9186, 0x00ff, 0x0904, 0x5fda, 0x9182, 0x0800, 0x1a04,
-	0x5fda, 0xaaa0, 0xab9c, 0x7878, 0x9306, 0x1188, 0x787c, 0x0096,
-	0x924e, 0x1128, 0x2208, 0x2310, 0x009e, 0x0804, 0x5fda, 0x99cc,
-	0xff00, 0x009e, 0x1120, 0x2208, 0x2310, 0x0804, 0x5fda, 0x080c,
-	0x4792, 0x0904, 0x5fe3, 0x900e, 0x9016, 0x90c6, 0x4000, 0x1558,
-	0x0006, 0x080c, 0x655f, 0x1108, 0xc185, 0xb800, 0xd0bc, 0x0108,
-	0xc18d, 0x20a9, 0x0004, 0xa860, 0x20e8, 0xa85c, 0x9080, 0x0031,
-	0x20a0, 0xb8b4, 0x20e0, 0xb8b8, 0x9080, 0x0006, 0x2098, 0x080c,
-	0x0f9f, 0x20a9, 0x0004, 0xa860, 0x20e8, 0xa85c, 0x9080, 0x0035,
-	0x20a0, 0xb8b4, 0x20e0, 0xb8b8, 0x9080, 0x000a, 0x2098, 0x080c,
-	0x0f9f, 0x000e, 0x00c8, 0x90c6, 0x4007, 0x1110, 0x2408, 0x00a0,
-	0x90c6, 0x4008, 0x1118, 0x2708, 0x2610, 0x0070, 0x90c6, 0x4009,
-	0x1108, 0x0050, 0x90c6, 0x4006, 0x0138, 0x2001, 0x4005, 0x2009,
-	0x000a, 0x0010, 0x2001, 0x4006, 0xa896, 0xa99a, 0xaa9e, 0x2001,
-	0x0030, 0x900e, 0x0470, 0x080c, 0x9b91, 0x1130, 0x2001, 0x4005,
-	0x2009, 0x0003, 0x9016, 0x0c80, 0x2b00, 0x6012, 0x080c, 0xbcdb,
-	0x2900, 0x6016, 0x6023, 0x0001, 0xa868, 0xd88c, 0x0108, 0xc0f5,
-	0xa86a, 0x0126, 0x2091, 0x8000, 0x080c, 0x3006, 0x012e, 0x9006,
-	0x080c, 0x61ad, 0x2001, 0x0002, 0x080c, 0x61c1, 0x2009, 0x0002,
-	0x080c, 0x9c85, 0xa8b0, 0xd094, 0x0118, 0xb8c4, 0xc08d, 0xb8c6,
-	0x9006, 0x9005, 0x012e, 0x00ee, 0x00fe, 0x00be, 0x0005, 0x080c,
-	0x53a1, 0x0118, 0x2009, 0x0007, 0x00f8, 0xa998, 0xaeb0, 0x080c,
-	0x6270, 0x1904, 0x5fd5, 0x9186, 0x007f, 0x0130, 0x080c, 0x6667,
-	0x0118, 0x2009, 0x0009, 0x0080, 0x0096, 0x080c, 0x1022, 0x1120,
-	0x009e, 0x2009, 0x0002, 0x0040, 0x2900, 0x009e, 0xa806, 0x080c,
-	0xba33, 0x19b0, 0x2009, 0x0003, 0x2001, 0x4005, 0x0804, 0x5fdc,
-	0xa998, 0xaeb0, 0x080c, 0x6270, 0x1904, 0x5fd5, 0x0096, 0x080c,
-	0x1022, 0x1128, 0x009e, 0x2009, 0x0002, 0x0804, 0x6094, 0x2900,
-	0x009e, 0xa806, 0x0096, 0x2048, 0x20a9, 0x002b, 0xb8b4, 0x20e0,
-	0xb8b8, 0x2098, 0xa860, 0x20e8, 0xa85c, 0x9080, 0x0002, 0x20a0,
-	0x4003, 0x20a9, 0x0008, 0x9080, 0x0006, 0x20a0, 0xbbb8, 0x9398,
-	0x0006, 0x2398, 0x080c, 0x0f9f, 0x009e, 0xa87b, 0x0000, 0xa883,
-	0x0000, 0xa897, 0x4000, 0xd684, 0x1168, 0x080c, 0x538d, 0xd0b4,
-	0x1118, 0xa89b, 0x000b, 0x00e0, 0xb800, 0xd08c, 0x0118, 0xa89b,
-	0x000c, 0x00b0, 0x080c, 0x6667, 0x0118, 0xa89b, 0x0009, 0x0080,
-	0x080c, 0x53a1, 0x0118, 0xa89b, 0x0007, 0x0050, 0x080c, 0xba16,
-	0x1904, 0x6010, 0x2009, 0x0003, 0x2001, 0x4005, 0x0804, 0x5fdc,
-	0xa87b, 0x0030, 0xa897, 0x4005, 0xa804, 0x8006, 0x8006, 0x8007,
-	0x90bc, 0x003f, 0x9084, 0xffc0, 0x9080, 0x0002, 0x2009, 0x002b,
-	0xaaa0, 0xab9c, 0xaca8, 0xada4, 0x2031, 0x0000, 0x2041, 0x1266,
-	0x080c, 0xa0f5, 0x1904, 0x6010, 0x2009, 0x0002, 0x08e8, 0x2001,
-	0x0028, 0x900e, 0x0804, 0x6011, 0x2009, 0x180c, 0x210c, 0xd18c,
-	0x0118, 0x2001, 0x0004, 0x0038, 0xd184, 0x0118, 0x2001, 0x0004,
-	0x0010, 0x2001, 0x0029, 0x900e, 0x0804, 0x6011, 0x2001, 0x0029,
-	0x900e, 0x0804, 0x6011, 0x080c, 0x35ae, 0x0804, 0x6012, 0x080c,
-	0x50c2, 0x0804, 0x6012, 0x080c, 0x4354, 0x0804, 0x6012, 0x080c,
-	0x43cd, 0x0804, 0x6012, 0x080c, 0x4429, 0x0804, 0x6012, 0x080c,
-	0x484e, 0x0804, 0x6012, 0x080c, 0x4afa, 0x0804, 0x6012, 0x080c,
-	0x4d2d, 0x0804, 0x6012, 0x080c, 0x4f26, 0x0804, 0x6012, 0x080c,
-	0x37c3, 0x0804, 0x6012, 0x00b6, 0xa974, 0xae78, 0x9684, 0x3fff,
-	0x9082, 0x4000, 0x1608, 0x9182, 0x0800, 0x1258, 0x9188, 0x1000,
-	0x2104, 0x905d, 0x0130, 0x080c, 0x6667, 0x1138, 0x00d9, 0x9006,
-	0x00b0, 0x2001, 0x0028, 0x900e, 0x0090, 0x9082, 0x0006, 0x1240,
-	0xb900, 0xd1fc, 0x0d98, 0x2001, 0x0029, 0x2009, 0x1000, 0x0038,
-	0x2001, 0x0029, 0x900e, 0x0018, 0x2001, 0x0029, 0x900e, 0x9005,
-	0x00be, 0x0005, 0xa877, 0x0000, 0xb8c0, 0x9005, 0x1904, 0x61a1,
-	0xb888, 0x9005, 0x1904, 0x61a1, 0xb838, 0xb93c, 0x9102, 0x1a04,
-	0x61a1, 0x2b10, 0x080c, 0x9bbe, 0x0904, 0x619d, 0x8108, 0xb93e,
-	0x6212, 0x2900, 0x6016, 0x6023, 0x0003, 0x600b, 0xffff, 0x6007,
-	0x0040, 0xa878, 0x605e, 0xa880, 0x9084, 0x00ff, 0x6066, 0xa883,
-	0x0000, 0xa87c, 0xd0ac, 0x05c0, 0xc0dd, 0xa87e, 0xa888, 0x8001,
-	0x1568, 0x2001, 0x00f8, 0x8001, 0xa001, 0xa001, 0xa001, 0x1dd8,
-	0xa816, 0xa864, 0x9094, 0x00f7, 0x9296, 0x0011, 0x11f8, 0x9084,
-	0x00ff, 0xc0bd, 0x601e, 0xa8ac, 0xaab0, 0xa836, 0xaa3a, 0x2001,
-	0x000f, 0x8001, 0x1df0, 0x2001, 0x8004, 0x6003, 0x0004, 0x6046,
-	0x00f6, 0x2079, 0x0380, 0x7818, 0xd0bc, 0x1de8, 0x7833, 0x0010,
-	0x2c00, 0x7836, 0x781b, 0x8080, 0x00fe, 0x0005, 0x080c, 0x164f,
-	0x601c, 0xc0bd, 0x601e, 0x0c38, 0x0006, 0x2001, 0x00e8, 0x8001,
-	0xa001, 0xa001, 0xa001, 0x1dd8, 0x000e, 0xd0b4, 0x190c, 0x1ad2,
-	0x2001, 0x8004, 0x6003, 0x0002, 0x08d0, 0x81ff, 0x1110, 0xb88b,
-	0x0001, 0x2908, 0xb8bc, 0xb9be, 0x9005, 0x1110, 0xb9c2, 0x0020,
-	0x0096, 0x2048, 0xa902, 0x009e, 0x0005, 0x00b6, 0x0126, 0x00c6,
-	0x0026, 0x2091, 0x8000, 0x6210, 0x2258, 0xba00, 0x9005, 0x0110,
-	0xc285, 0x0008, 0xc284, 0xba02, 0x002e, 0x00ce, 0x012e, 0x00be,
-	0x0005, 0x00b6, 0x0126, 0x00c6, 0x2091, 0x8000, 0x6210, 0x2258,
-	0xba04, 0x0006, 0x9086, 0x0006, 0x1170, 0xb89c, 0xd0ac, 0x0158,
-	0x080c, 0x6663, 0x0140, 0x9284, 0xff00, 0x8007, 0x9086, 0x0007,
-	0x1110, 0x2011, 0x0600, 0x000e, 0x9294, 0xff00, 0x9215, 0xba06,
-	0x0006, 0x9086, 0x0006, 0x1120, 0xba90, 0x82ff, 0x090c, 0x0d65,
-	0x000e, 0x00ce, 0x012e, 0x00be, 0x0005, 0x00b6, 0x0126, 0x00c6,
-	0x2091, 0x8000, 0x6210, 0x2258, 0xba04, 0x0006, 0x9086, 0x0006,
-	0x1168, 0xb89c, 0xd0a4, 0x0150, 0x080c, 0x665f, 0x1138, 0x9284,
-	0x00ff, 0x9086, 0x0007, 0x1110, 0x2011, 0x0006, 0x000e, 0x9294,
-	0x00ff, 0x8007, 0x9215, 0xba06, 0x00ce, 0x012e, 0x00be, 0x0005,
-	0x9182, 0x0800, 0x0218, 0x9085, 0x0001, 0x0005, 0x00d6, 0x0026,
-	0x9190, 0x1000, 0x2204, 0x905d, 0x1180, 0x0096, 0x080c, 0x1022,
-	0x2958, 0x009e, 0x0160, 0x2b00, 0x2012, 0xb85c, 0xb8ba, 0xb860,
-	0xb8b6, 0x9006, 0xb8a6, 0x080c, 0x5cf6, 0x9006, 0x0010, 0x9085,
-	0x0001, 0x002e, 0x00de, 0x0005, 0x00b6, 0x0096, 0x0126, 0x2091,
-	0x8000, 0x0026, 0x9182, 0x0800, 0x0218, 0x9085, 0x0001, 0x0458,
-	0x00d6, 0x9190, 0x1000, 0x2204, 0x905d, 0x0518, 0x2013, 0x0000,
-	0xb8a4, 0x904d, 0x0110, 0x080c, 0x1054, 0x00d6, 0x00c6, 0xb8ac,
-	0x2060, 0x8cff, 0x0168, 0x600c, 0x0006, 0x6014, 0x2048, 0x080c,
-	0xb847, 0x0110, 0x080c, 0x0fd4, 0x080c, 0x9be7, 0x00ce, 0x0c88,
-	0x00ce, 0x00de, 0x2b48, 0xb8b8, 0xb85e, 0xb8b4, 0xb862, 0x080c,
-	0x1064, 0x00de, 0x9006, 0x002e, 0x012e, 0x009e, 0x00be, 0x0005,
-	0x0016, 0x9182, 0x0800, 0x0218, 0x9085, 0x0001, 0x0030, 0x9188,
-	0x1000, 0x2104, 0x905d, 0x0dc0, 0x9006, 0x001e, 0x0005, 0x00d6,
-	0x0156, 0x0136, 0x0146, 0x9006, 0xb80a, 0xb80e, 0xb800, 0xc08c,
-	0xb802, 0x080c, 0x70b7, 0x1510, 0xb8a0, 0x9086, 0x007e, 0x0120,
-	0x080c, 0x9b66, 0x11d8, 0x0078, 0x7040, 0xd0e4, 0x01b8, 0x00c6,
-	0x2061, 0x1953, 0x7048, 0x2062, 0x704c, 0x6006, 0x7050, 0x600a,
-	0x7054, 0x600e, 0x00ce, 0x703c, 0x2069, 0x0140, 0x9005, 0x1110,
-	0x2001, 0x0001, 0x6886, 0x2069, 0x1800, 0x68b2, 0x7040, 0xb85e,
-	0x7048, 0xb862, 0x704c, 0xb866, 0x20e1, 0x0000, 0x2099, 0x0276,
-	0xb8b4, 0x20e8, 0xb8b8, 0x9088, 0x000a, 0x21a0, 0x20a9, 0x0004,
-	0x4003, 0x2099, 0x027a, 0x9088, 0x0006, 0x21a0, 0x20a9, 0x0004,
-	0x4003, 0x2069, 0x0200, 0x6817, 0x0001, 0x7040, 0xb86a, 0x7144,
-	0xb96e, 0x7048, 0xb872, 0x7050, 0xb876, 0x2069, 0x0200, 0x6817,
-	0x0000, 0xb8a0, 0x9086, 0x007e, 0x1110, 0x7144, 0xb96e, 0x9182,
-	0x0211, 0x1218, 0x2009, 0x0008, 0x0400, 0x9182, 0x0259, 0x1218,
-	0x2009, 0x0007, 0x00d0, 0x9182, 0x02c1, 0x1218, 0x2009, 0x0006,
-	0x00a0, 0x9182, 0x0349, 0x1218, 0x2009, 0x0005, 0x0070, 0x9182,
-	0x0421, 0x1218, 0x2009, 0x0004, 0x0040, 0x9182, 0x0581, 0x1218,
-	0x2009, 0x0003, 0x0010, 0x2009, 0x0002, 0xb992, 0x014e, 0x013e,
-	0x015e, 0x00de, 0x0005, 0x0016, 0x0026, 0x00e6, 0x2071, 0x0260,
-	0x7034, 0xb896, 0x703c, 0xb89a, 0x7054, 0xb89e, 0x0036, 0xbbc4,
-	0xc384, 0xba00, 0x2009, 0x1873, 0x210c, 0xd0bc, 0x0120, 0xd1ec,
-	0x0110, 0xc2ad, 0x0008, 0xc2ac, 0xd0c4, 0x0148, 0xd1e4, 0x0138,
-	0xc2bd, 0xd0cc, 0x0128, 0xd38c, 0x1108, 0xc385, 0x0008, 0xc2bc,
-	0xba02, 0xbbc6, 0x003e, 0x00ee, 0x002e, 0x001e, 0x0005, 0x0096,
-	0x0126, 0x2091, 0x8000, 0xb8a4, 0x904d, 0x0578, 0xa900, 0x81ff,
-	0x15c0, 0xaa04, 0x9282, 0x0010, 0x16c8, 0x0136, 0x0146, 0x01c6,
-	0x01d6, 0x8906, 0x8006, 0x8007, 0x908c, 0x003f, 0x21e0, 0x9084,
-	0xffc0, 0x9080, 0x0004, 0x2098, 0x2009, 0x0010, 0x20a9, 0x0001,
-	0x4002, 0x9086, 0xffff, 0x0120, 0x8109, 0x1dd0, 0x080c, 0x0d65,
-	0x3c00, 0x20e8, 0x3300, 0x8001, 0x20a0, 0x4604, 0x8210, 0xaa06,
-	0x01de, 0x01ce, 0x014e, 0x013e, 0x0060, 0x080c, 0x1022, 0x0170,
-	0x2900, 0xb8a6, 0xa803, 0x0000, 0x080c, 0x64fb, 0xa807, 0x0001,
-	0xae12, 0x9085, 0x0001, 0x012e, 0x009e, 0x0005, 0x9006, 0x0cd8,
-	0x0126, 0x2091, 0x8000, 0x0096, 0xb8a4, 0x904d, 0x0188, 0xa800,
-	0x9005, 0x1150, 0x080c, 0x650a, 0x1158, 0xa804, 0x908a, 0x0002,
-	0x0218, 0x8001, 0xa806, 0x0020, 0x080c, 0x1054, 0xb8a7, 0x0000,
-	0x009e, 0x012e, 0x0005, 0x0096, 0x00c6, 0xb888, 0x9005, 0x1904,
-	0x63f4, 0xb8c0, 0x904d, 0x0904, 0x63f4, 0x080c, 0x9bbe, 0x0904,
-	0x63f0, 0x8210, 0xba3e, 0xa800, 0xb8c2, 0x9005, 0x1108, 0xb8be,
-	0x2b00, 0x6012, 0x2900, 0x6016, 0x6023, 0x0003, 0x600b, 0xffff,
-	0x6007, 0x0040, 0xa878, 0x605e, 0xa880, 0x9084, 0x00ff, 0x6066,
-	0xa883, 0x0000, 0xa87c, 0xd0ac, 0x01c8, 0xc0dd, 0xa87e, 0xa888,
-	0x8001, 0x1568, 0xa816, 0xa864, 0x9094, 0x00f7, 0x9296, 0x0011,
-	0x1530, 0x9084, 0x00ff, 0xc0bd, 0x601e, 0xa8ac, 0xaab0, 0xa836,
-	0xaa3a, 0x2001, 0x8004, 0x6003, 0x0004, 0x0030, 0x080c, 0x1ad2,
-	0x2001, 0x8004, 0x6003, 0x0002, 0x6046, 0x2001, 0x0010, 0x2c08,
-	0x080c, 0x98b9, 0xb838, 0xba3c, 0x9202, 0x0a04, 0x63a1, 0x0020,
-	0x82ff, 0x1110, 0xb88b, 0x0001, 0x00ce, 0x009e, 0x0005, 0x080c,
-	0x164f, 0x601c, 0xc0bd, 0x601e, 0x08e0, 0x00b6, 0x0096, 0x0016,
-	0x20a9, 0x0800, 0x900e, 0x0016, 0x080c, 0x6270, 0x1158, 0xb8c0,
-	0x904d, 0x0140, 0x3e00, 0x9086, 0x0002, 0x1118, 0xb800, 0xd0bc,
-	0x1108, 0x0041, 0x001e, 0x8108, 0x1f04, 0x6403, 0x001e, 0x00be,
-	0x009e, 0x0005, 0x0096, 0x0016, 0xb8c0, 0x904d, 0x0188, 0xa800,
-	0xb8c2, 0x9005, 0x1108, 0xb8be, 0x9006, 0xa802, 0xa867, 0x0103,
-	0xab7a, 0xa877, 0x0000, 0x080c, 0xbb45, 0x080c, 0x6996, 0x0c60,
-	0x001e, 0x009e, 0x0005, 0x0086, 0x9046, 0xb8c0, 0x904d, 0x0198,
-	0xa86c, 0x9406, 0x1118, 0xa870, 0x9506, 0x0128, 0x2940, 0xa800,
-	0x904d, 0x0148, 0x0ca8, 0xa800, 0x88ff, 0x1110, 0xb8c2, 0x0008,
-	0xa002, 0xa803, 0x0000, 0x008e, 0x0005, 0x901e, 0x0010, 0x2019,
-	0x0001, 0x00e6, 0x0096, 0x00c6, 0x0086, 0x0026, 0x0126, 0x2091,
-	0x8000, 0x2071, 0x19b8, 0x9046, 0x7028, 0x9065, 0x01e8, 0x6014,
-	0x2068, 0x83ff, 0x0120, 0x605c, 0x9606, 0x0158, 0x0030, 0xa86c,
-	0x9406, 0x1118, 0xa870, 0x9506, 0x0120, 0x2c40, 0x600c, 0x2060,
-	0x0c60, 0x600c, 0x0006, 0x0066, 0x2830, 0x080c, 0x9110, 0x006e,
-	0x000e, 0x83ff, 0x0508, 0x0c08, 0x9046, 0xb8c0, 0x904d, 0x01e0,
-	0x83ff, 0x0120, 0xa878, 0x9606, 0x0158, 0x0030, 0xa86c, 0x9406,
-	0x1118, 0xa870, 0x9506, 0x0120, 0x2940, 0xa800, 0x2048, 0x0c70,
-	0xb8c0, 0xaa00, 0x0026, 0x9906, 0x1110, 0xbac2, 0x0008, 0xa202,
-	0x000e, 0x83ff, 0x0108, 0x0c10, 0x002e, 0x008e, 0x00ce, 0x009e,
-	0x00ee, 0x0005, 0x9016, 0x0489, 0x1110, 0x2011, 0x0001, 0x0005,
-	0x080c, 0x655f, 0x0128, 0x080c, 0xb908, 0x0010, 0x9085, 0x0001,
-	0x0005, 0x080c, 0x655f, 0x0128, 0x080c, 0xb8a9, 0x0010, 0x9085,
-	0x0001, 0x0005, 0x080c, 0x655f, 0x0128, 0x080c, 0xb905, 0x0010,
-	0x9085, 0x0001, 0x0005, 0x080c, 0x655f, 0x0128, 0x080c, 0xb8c8,
-	0x0010, 0x9085, 0x0001, 0x0005, 0x080c, 0x655f, 0x0128, 0x080c,
-	0xb949, 0x0010, 0x9085, 0x0001, 0x0005, 0xb8a4, 0x900d, 0x1118,
-	0x9085, 0x0001, 0x0005, 0x0136, 0x01c6, 0xa800, 0x9005, 0x11b8,
-	0x890e, 0x810e, 0x810f, 0x9184, 0x003f, 0x20e0, 0x9184, 0xffc0,
-	0x9080, 0x0004, 0x2098, 0x20a9, 0x0001, 0x2009, 0x0010, 0x4002,
-	0x9606, 0x0128, 0x8109, 0x1dd8, 0x9085, 0x0001, 0x0008, 0x9006,
-	0x01ce, 0x013e, 0x0005, 0x0146, 0x01d6, 0xa860, 0x20e8, 0xa85c,
-	0x9080, 0x0004, 0x20a0, 0x20a9, 0x0010, 0x2009, 0xffff, 0x4104,
-	0x01de, 0x014e, 0x0136, 0x01c6, 0xa800, 0x9005, 0x11b8, 0x890e,
+	0x4003, 0x60c3, 0x0014, 0x080c, 0x5b66, 0x0010, 0x080c, 0x55b6,
+	0x0005, 0x00f6, 0x708c, 0x9005, 0x01d8, 0x2011, 0x5b3c, 0x080c,
+	0x8138, 0x9086, 0x0084, 0x1190, 0x080c, 0x5cb1, 0x2079, 0x0260,
+	0x7a30, 0x9296, 0x1106, 0x1150, 0x7834, 0x9005, 0x1138, 0x9006,
+	0x080c, 0x5cdc, 0x7097, 0x0018, 0x0029, 0x0010, 0x708f, 0x0000,
+	0x00fe, 0x0005, 0x00f6, 0x7097, 0x0019, 0x080c, 0x5c43, 0x2079,
+	0x0240, 0x7833, 0x1106, 0x7837, 0x0000, 0x080c, 0x5cb1, 0x2009,
+	0x026e, 0x2039, 0x1d0e, 0x20a9, 0x0040, 0x213e, 0x8738, 0x8108,
+	0x9186, 0x0280, 0x1128, 0x6814, 0x8000, 0x6816, 0x2009, 0x0260,
+	0x1f04, 0x59c5, 0x2039, 0x1d0e, 0x080c, 0x5c94, 0x11e8, 0x2728,
+	0x2514, 0x8207, 0x9084, 0x00ff, 0x8000, 0x2018, 0x9294, 0x00ff,
+	0x8007, 0x9205, 0x202a, 0x705c, 0x2310, 0x8214, 0x92a0, 0x1d0e,
+	0x2414, 0x938c, 0x0001, 0x0118, 0x9294, 0xff00, 0x0018, 0x9294,
+	0x00ff, 0x8007, 0x9215, 0x2222, 0x20a9, 0x0040, 0x2009, 0x024e,
+	0x270e, 0x8738, 0x8108, 0x9186, 0x0260, 0x1128, 0x6810, 0x8000,
+	0x6812, 0x2009, 0x0240, 0x1f04, 0x59f8, 0x60c3, 0x0084, 0x080c,
+	0x5b66, 0x00fe, 0x0005, 0x00f6, 0x708c, 0x9005, 0x01e0, 0x2011,
+	0x5b3c, 0x080c, 0x8138, 0x9086, 0x0084, 0x1198, 0x080c, 0x5cb1,
+	0x2079, 0x0260, 0x7a30, 0x9296, 0x1107, 0x1158, 0x7834, 0x9005,
+	0x1140, 0x7093, 0x0001, 0x080c, 0x5c07, 0x7097, 0x001a, 0x0029,
+	0x0010, 0x708f, 0x0000, 0x00fe, 0x0005, 0x9085, 0x0001, 0x080c,
+	0x5cdc, 0x7097, 0x001b, 0x080c, 0x97e8, 0x080c, 0x5cb1, 0x2011,
+	0x0260, 0x2009, 0x0240, 0x748c, 0x9480, 0x0018, 0x9080, 0x0007,
+	0x9084, 0x03f8, 0x8004, 0x20a8, 0x220e, 0x8210, 0x8108, 0x9186,
+	0x0260, 0x1150, 0x6810, 0x8000, 0x6812, 0x2009, 0x0240, 0x6814,
+	0x8000, 0x6816, 0x2011, 0x0260, 0x1f04, 0x5a44, 0x60c3, 0x0084,
+	0x080c, 0x5b66, 0x0005, 0x0005, 0x0086, 0x0096, 0x2029, 0x1854,
+	0x252c, 0x20a9, 0x0008, 0x2041, 0x1d0e, 0x20e9, 0x0001, 0x28a0,
+	0x080c, 0x5cb1, 0x20e1, 0x0000, 0x2099, 0x026e, 0x4003, 0x20a9,
+	0x0008, 0x2011, 0x0007, 0xd5d4, 0x0108, 0x9016, 0x2800, 0x9200,
+	0x200c, 0x91a6, 0xffff, 0x1148, 0xd5d4, 0x0110, 0x8210, 0x0008,
+	0x8211, 0x1f04, 0x5a76, 0x0804, 0x5ae5, 0x82ff, 0x1160, 0xd5d4,
+	0x0120, 0x91a6, 0x3fff, 0x0d90, 0x0020, 0x91a6, 0x3fff, 0x0904,
+	0x5ae5, 0x918d, 0xc000, 0x20a9, 0x0010, 0x2019, 0x0001, 0xd5d4,
+	0x0110, 0x2019, 0x0010, 0x2120, 0xd5d4, 0x0110, 0x8423, 0x0008,
+	0x8424, 0x1240, 0xd5d4, 0x0110, 0x8319, 0x0008, 0x8318, 0x1f04,
+	0x5a9c, 0x04d8, 0x23a8, 0x2021, 0x0001, 0x8426, 0x8425, 0x1f04,
+	0x5aae, 0x2328, 0x8529, 0x92be, 0x0007, 0x0158, 0x0006, 0x2039,
+	0x0007, 0x2200, 0x973a, 0x000e, 0x27a8, 0x95a8, 0x0010, 0x1f04,
+	0x5abd, 0x755a, 0x95c8, 0x317f, 0x292d, 0x95ac, 0x00ff, 0x757e,
+	0x6532, 0x6536, 0x0016, 0x2508, 0x080c, 0x2486, 0x001e, 0x60e7,
+	0x0000, 0x65ea, 0x2018, 0x2304, 0x9405, 0x201a, 0x7083, 0x0001,
+	0x20e9, 0x0000, 0x20a1, 0x024e, 0x20e1, 0x0001, 0x2898, 0x20a9,
+	0x0008, 0x4003, 0x9085, 0x0001, 0x0008, 0x9006, 0x009e, 0x008e,
+	0x0005, 0x0156, 0x01c6, 0x01d6, 0x0136, 0x0146, 0x22a8, 0x20e1,
+	0x0000, 0x2099, 0x026e, 0x20e9, 0x0000, 0x2011, 0x024e, 0x22a0,
+	0x4003, 0x014e, 0x013e, 0x01de, 0x01ce, 0x015e, 0x2118, 0x9026,
+	0x2001, 0x0007, 0x939a, 0x0010, 0x0218, 0x8420, 0x8001, 0x0cd0,
+	0x2118, 0x84ff, 0x0120, 0x939a, 0x0010, 0x8421, 0x1de0, 0x2021,
+	0x0001, 0x83ff, 0x0118, 0x8423, 0x8319, 0x1de8, 0x9238, 0x2029,
+	0x026e, 0x9528, 0x2504, 0x942c, 0x11b8, 0x9405, 0x203a, 0x715a,
+	0x91a0, 0x317f, 0x242d, 0x95ac, 0x00ff, 0x757e, 0x6532, 0x6536,
+	0x0016, 0x2508, 0x080c, 0x2486, 0x001e, 0x60e7, 0x0000, 0x65ea,
+	0x7083, 0x0001, 0x9084, 0x0000, 0x0005, 0x00e6, 0x2071, 0x1800,
+	0x7087, 0x0000, 0x00ee, 0x0005, 0x00e6, 0x00f6, 0x2079, 0x0100,
+	0x2071, 0x0140, 0x080c, 0x5bf6, 0x080c, 0x8f9c, 0x7004, 0x9084,
+	0x4000, 0x0110, 0x080c, 0x2862, 0x0126, 0x2091, 0x8000, 0x2071,
+	0x1825, 0x2073, 0x0000, 0x7840, 0x0026, 0x0016, 0x2009, 0x00f7,
+	0x080c, 0x5c53, 0x001e, 0x9094, 0x0010, 0x9285, 0x0080, 0x7842,
+	0x7a42, 0x002e, 0x012e, 0x00fe, 0x00ee, 0x0005, 0x0126, 0x2091,
+	0x8000, 0x080c, 0x27c1, 0x0228, 0x2011, 0x0101, 0x2204, 0xc0c5,
+	0x2012, 0x2011, 0x19c4, 0x2013, 0x0000, 0x708f, 0x0000, 0x012e,
+	0x60a3, 0x0056, 0x60a7, 0x9575, 0x080c, 0x8f8f, 0x6144, 0xd184,
+	0x0120, 0x7194, 0x918d, 0x2000, 0x0018, 0x7188, 0x918d, 0x1000,
+	0x2011, 0x1969, 0x2112, 0x2009, 0x07d0, 0x2011, 0x5b3c, 0x080c,
+	0x81fc, 0x0005, 0x0016, 0x0026, 0x00c6, 0x0126, 0x2091, 0x8000,
+	0x080c, 0x98bb, 0x080c, 0x9b60, 0x080c, 0x98d7, 0x2009, 0x00f7,
+	0x080c, 0x5c53, 0x2061, 0x19d3, 0x900e, 0x611a, 0x611e, 0x6172,
+	0x6176, 0x2061, 0x1800, 0x6003, 0x0001, 0x2061, 0x0100, 0x6043,
+	0x0090, 0x6043, 0x0010, 0x2009, 0x1969, 0x200b, 0x0000, 0x2009,
+	0x002d, 0x2011, 0x5bc2, 0x080c, 0x812c, 0x012e, 0x00ce, 0x002e,
+	0x001e, 0x0005, 0x00e6, 0x0006, 0x0126, 0x2091, 0x8000, 0x0471,
+	0x2071, 0x0100, 0x080c, 0x8f9c, 0x2071, 0x0140, 0x7004, 0x9084,
+	0x4000, 0x0110, 0x080c, 0x2862, 0x080c, 0x709e, 0x0188, 0x080c,
+	0x70b9, 0x1170, 0x080c, 0x73a0, 0x0016, 0x080c, 0x2555, 0x2001,
+	0x193d, 0x2102, 0x001e, 0x080c, 0x739b, 0x080c, 0x6fc7, 0x0050,
+	0x2009, 0x0001, 0x080c, 0x283e, 0x2001, 0x0001, 0x080c, 0x23e2,
+	0x080c, 0x5b92, 0x012e, 0x000e, 0x00ee, 0x0005, 0x2001, 0x180e,
+	0x2004, 0xd0bc, 0x0158, 0x0026, 0x0036, 0x2011, 0x8017, 0x2001,
+	0x1969, 0x201c, 0x080c, 0x48da, 0x003e, 0x002e, 0x0005, 0x20a9,
+	0x0012, 0x20e9, 0x0001, 0x20a1, 0x1d80, 0x080c, 0x5cb1, 0x20e9,
+	0x0000, 0x2099, 0x026e, 0x0099, 0x20a9, 0x0020, 0x080c, 0x5cab,
+	0x2099, 0x0260, 0x20a1, 0x1d92, 0x0051, 0x20a9, 0x000e, 0x080c,
+	0x5cae, 0x2099, 0x0260, 0x20a1, 0x1db2, 0x0009, 0x0005, 0x0016,
+	0x0026, 0x3410, 0x3308, 0x2104, 0x8007, 0x2012, 0x8108, 0x8210,
+	0x1f04, 0x5c2b, 0x002e, 0x001e, 0x0005, 0x080c, 0x97e8, 0x20e1,
+	0x0001, 0x2099, 0x1d00, 0x20e9, 0x0000, 0x20a1, 0x0240, 0x20a9,
+	0x000c, 0x4003, 0x0005, 0x080c, 0x97e8, 0x080c, 0x5cb1, 0x20e1,
+	0x0000, 0x2099, 0x0260, 0x20e9, 0x0000, 0x20a1, 0x0240, 0x20a9,
+	0x000c, 0x4003, 0x0005, 0x00c6, 0x0006, 0x2061, 0x0100, 0x810f,
+	0x2001, 0x1833, 0x2004, 0x9005, 0x1138, 0x2001, 0x1817, 0x2004,
+	0x9084, 0x00ff, 0x9105, 0x0010, 0x9185, 0x00f7, 0x604a, 0x000e,
+	0x00ce, 0x0005, 0x0016, 0x0046, 0x080c, 0x6662, 0x0158, 0x9006,
+	0x2020, 0x2009, 0x002a, 0x080c, 0xd284, 0x2001, 0x180c, 0x200c,
+	0xc195, 0x2102, 0x2019, 0x002a, 0x900e, 0x080c, 0x2fd3, 0x080c,
+	0xbf61, 0x0140, 0x0036, 0x2019, 0xffff, 0x2021, 0x0007, 0x080c,
+	0x4a77, 0x003e, 0x004e, 0x001e, 0x0005, 0x080c, 0x5b92, 0x7097,
+	0x0000, 0x708f, 0x0000, 0x0005, 0x0006, 0x2001, 0x180c, 0x2004,
+	0xd09c, 0x0100, 0x000e, 0x0005, 0x0006, 0x0016, 0x0126, 0x2091,
+	0x8000, 0x2001, 0x0101, 0x200c, 0x918d, 0x0006, 0x2102, 0x012e,
+	0x001e, 0x000e, 0x0005, 0x2009, 0x0001, 0x0020, 0x2009, 0x0002,
+	0x0008, 0x900e, 0x6814, 0x9084, 0xffc0, 0x910d, 0x6916, 0x0005,
+	0x00f6, 0x0156, 0x0146, 0x01d6, 0x9006, 0x20a9, 0x0080, 0x20e9,
+	0x0001, 0x20a1, 0x1d00, 0x4004, 0x2079, 0x1d00, 0x7803, 0x2200,
+	0x7807, 0x00ef, 0x780f, 0x00ef, 0x7813, 0x0138, 0x7823, 0xffff,
+	0x7827, 0xffff, 0x01de, 0x014e, 0x015e, 0x00fe, 0x0005, 0x2001,
+	0x1800, 0x2003, 0x0001, 0x0005, 0x2001, 0x1976, 0x0118, 0x2003,
+	0x0001, 0x0010, 0x2003, 0x0000, 0x0005, 0x0156, 0x20a9, 0x0800,
+	0x2009, 0x1000, 0x9006, 0x200a, 0x8108, 0x1f04, 0x5ceb, 0x015e,
+	0x0005, 0x00d6, 0x0036, 0x0156, 0x0136, 0x0146, 0x2069, 0x1853,
+	0x9006, 0xb802, 0xb8c6, 0xb807, 0x0707, 0xb80a, 0xb80e, 0xb812,
+	0x9198, 0x317f, 0x231d, 0x939c, 0x00ff, 0xbb16, 0x0016, 0x0026,
+	0xb886, 0x080c, 0x9b59, 0x1120, 0x9192, 0x007e, 0x1208, 0xbb86,
+	0x20a9, 0x0004, 0xb8b4, 0x20e8, 0xb9b8, 0x9198, 0x0006, 0x9006,
+	0x23a0, 0x4004, 0x20a9, 0x0004, 0x9198, 0x000a, 0x23a0, 0x4004,
+	0x002e, 0x001e, 0xb83e, 0xb842, 0xb8be, 0xb8c2, 0xb85e, 0xb862,
+	0xb866, 0xb86a, 0xb86f, 0x0100, 0xb872, 0xb876, 0xb87a, 0xb88a,
+	0xb88e, 0xb893, 0x0008, 0xb896, 0xb89a, 0xb89e, 0xb8ae, 0xb9a2,
+	0x0096, 0xb8a4, 0x904d, 0x0110, 0x080c, 0x1054, 0xb8a7, 0x0000,
+	0x009e, 0x9006, 0xb84a, 0x6810, 0xb83a, 0x680c, 0xb846, 0x6814,
+	0x9084, 0x00ff, 0xb842, 0x014e, 0x013e, 0x015e, 0x003e, 0x00de,
+	0x0005, 0x0126, 0x2091, 0x8000, 0xa974, 0xae78, 0x9684, 0x3fff,
+	0x9082, 0x4000, 0x1a04, 0x5daf, 0x9182, 0x0800, 0x1a04, 0x5db3,
+	0x2001, 0x180c, 0x2004, 0x9084, 0x0003, 0x1904, 0x5db9, 0x9188,
+	0x1000, 0x2104, 0x905d, 0x0198, 0xb804, 0x9084, 0x00ff, 0x908e,
+	0x0006, 0x1188, 0xb8a4, 0x900d, 0x1904, 0x5dcb, 0x080c, 0x6125,
+	0x9006, 0x012e, 0x0005, 0x2001, 0x0005, 0x900e, 0x04b8, 0x2001,
+	0x0028, 0x900e, 0x0498, 0x9082, 0x0006, 0x1290, 0x080c, 0x9b59,
+	0x1160, 0xb8a0, 0x9084, 0xff80, 0x1140, 0xb900, 0xd1fc, 0x0d10,
+	0x2001, 0x0029, 0x2009, 0x1000, 0x0408, 0x2001, 0x0028, 0x00a8,
+	0x2009, 0x180c, 0x210c, 0xd18c, 0x0118, 0x2001, 0x0004, 0x0068,
+	0xd184, 0x0118, 0x2001, 0x0004, 0x0040, 0x2001, 0x0029, 0xb900,
+	0xd1fc, 0x0118, 0x2009, 0x1000, 0x0048, 0x900e, 0x0038, 0x2001,
+	0x0029, 0x900e, 0x0018, 0x2001, 0x0029, 0x900e, 0x9005, 0x012e,
+	0x0005, 0x2001, 0x180c, 0x2004, 0xd084, 0x19d0, 0x9188, 0x1000,
+	0x2104, 0x9065, 0x09a8, 0x080c, 0x6666, 0x1990, 0xb800, 0xd0bc,
+	0x0978, 0x0804, 0x5d72, 0x080c, 0x64da, 0x0904, 0x5d7b, 0x0804,
+	0x5d76, 0x00e6, 0x2071, 0x19b7, 0x7004, 0x9086, 0x0002, 0x1128,
+	0x7030, 0x9080, 0x0004, 0x2004, 0x9b06, 0x00ee, 0x0005, 0x00b6,
+	0x00e6, 0x0126, 0x2091, 0x8000, 0xa974, 0x9182, 0x0800, 0x1a04,
+	0x5e5a, 0x9188, 0x1000, 0x2104, 0x905d, 0x0904, 0x5e32, 0xb8a0,
+	0x9086, 0x007f, 0x0178, 0x080c, 0x666e, 0x0160, 0xa994, 0x81ff,
+	0x0130, 0x908e, 0x0004, 0x0130, 0x908e, 0x0005, 0x0118, 0x080c,
+	0x6666, 0x1598, 0xa87c, 0xd0fc, 0x01e0, 0xa894, 0x9005, 0x01c8,
+	0x2060, 0x0026, 0x2010, 0x080c, 0xb830, 0x002e, 0x1120, 0x2001,
+	0x0008, 0x0804, 0x5e5c, 0x6020, 0x9086, 0x000a, 0x0120, 0x2001,
+	0x0008, 0x0804, 0x5e5c, 0x601a, 0x6003, 0x0008, 0x2900, 0x6016,
+	0x0058, 0x080c, 0x9b84, 0x05e8, 0x2b00, 0x6012, 0x2900, 0x6016,
+	0x600b, 0xffff, 0x6023, 0x000a, 0x2009, 0x0003, 0x080c, 0x9c76,
+	0x9006, 0x0458, 0x2001, 0x0028, 0x0438, 0x9082, 0x0006, 0x1290,
+	0x080c, 0x9b59, 0x1160, 0xb8a0, 0x9084, 0xff80, 0x1140, 0xb900,
+	0xd1fc, 0x0900, 0x2001, 0x0029, 0x2009, 0x1000, 0x00a8, 0x2001,
+	0x0028, 0x0090, 0x2009, 0x180c, 0x210c, 0xd18c, 0x0118, 0x2001,
+	0x0004, 0x0050, 0xd184, 0x0118, 0x2001, 0x0004, 0x0028, 0x2001,
+	0x0029, 0x0010, 0x2001, 0x0029, 0x9005, 0x012e, 0x00ee, 0x00be,
+	0x0005, 0x2001, 0x002c, 0x0cc0, 0x00f6, 0x00b6, 0x0126, 0x2091,
+	0x8000, 0xa8e0, 0x9005, 0x1550, 0xa8dc, 0x9082, 0x0101, 0x1630,
+	0xa8c8, 0x9005, 0x1518, 0xa8c4, 0x9082, 0x0101, 0x12f8, 0xa974,
+	0x2079, 0x1800, 0x9182, 0x0800, 0x12e8, 0x7830, 0x9084, 0x0003,
+	0x1130, 0xaa98, 0xab94, 0xa878, 0x9084, 0x0007, 0x00ea, 0x7930,
+	0xd18c, 0x0118, 0x2001, 0x0004, 0x0038, 0xd184, 0x0118, 0x2001,
+	0x0004, 0x0010, 0x2001, 0x0029, 0x900e, 0x0038, 0x2001, 0x002c,
+	0x900e, 0x0018, 0x2001, 0x0029, 0x900e, 0x9006, 0x0008, 0x9005,
+	0x012e, 0x00be, 0x00fe, 0x0005, 0x5ef1, 0x5eac, 0x5ec3, 0x5ef1,
+	0x5ef1, 0x5ef1, 0x5ef1, 0x5ef1, 0x2100, 0x9082, 0x007e, 0x1278,
+	0x080c, 0x620b, 0x0148, 0x9046, 0xb810, 0x9306, 0x1904, 0x5ef9,
+	0xb814, 0x9206, 0x15f0, 0x0028, 0xbb12, 0xba16, 0x0010, 0x080c,
+	0x4794, 0x0150, 0x04b0, 0x080c, 0x626b, 0x1598, 0xb810, 0x9306,
+	0x1580, 0xb814, 0x9206, 0x1568, 0x080c, 0x9b84, 0x0530, 0x2b00,
+	0x6012, 0x080c, 0xbcdb, 0x2900, 0x6016, 0x600b, 0xffff, 0x6023,
+	0x000a, 0xa878, 0x9086, 0x0001, 0x1170, 0x080c, 0x300e, 0x9006,
+	0x080c, 0x61a8, 0x2001, 0x0002, 0x080c, 0x61bc, 0x2001, 0x0200,
+	0xb86e, 0xb893, 0x0002, 0x2009, 0x0003, 0x080c, 0x9c76, 0x9006,
+	0x0068, 0x2001, 0x0001, 0x900e, 0x0038, 0x2001, 0x002c, 0x900e,
+	0x0018, 0x2001, 0x0028, 0x900e, 0x9005, 0x0000, 0x012e, 0x00be,
+	0x00fe, 0x0005, 0x00b6, 0x00f6, 0x00e6, 0x0126, 0x2091, 0x8000,
+	0xa894, 0x90c6, 0x0015, 0x0904, 0x60ce, 0x90c6, 0x0056, 0x0904,
+	0x60d2, 0x90c6, 0x0066, 0x0904, 0x60d6, 0x90c6, 0x0067, 0x0904,
+	0x60da, 0x90c6, 0x0068, 0x0904, 0x60de, 0x90c6, 0x0071, 0x0904,
+	0x60e2, 0x90c6, 0x0074, 0x0904, 0x60e6, 0x90c6, 0x007c, 0x0904,
+	0x60ea, 0x90c6, 0x007e, 0x0904, 0x60ee, 0x90c6, 0x0037, 0x0904,
+	0x60f2, 0x9016, 0x2079, 0x1800, 0xa974, 0x9186, 0x00ff, 0x0904,
+	0x60c9, 0x9182, 0x0800, 0x1a04, 0x60c9, 0x080c, 0x626b, 0x1198,
+	0xb804, 0x9084, 0x00ff, 0x9082, 0x0006, 0x1268, 0xa894, 0x90c6,
+	0x006f, 0x0148, 0x080c, 0x9b59, 0x1904, 0x60b2, 0xb8a0, 0x9084,
+	0xff80, 0x1904, 0x60b2, 0xa894, 0x90c6, 0x006f, 0x0158, 0x90c6,
+	0x005e, 0x0904, 0x6012, 0x90c6, 0x0064, 0x0904, 0x603b, 0x2008,
+	0x0804, 0x5fd5, 0xa998, 0xa8b0, 0x2040, 0x080c, 0x9b59, 0x1120,
+	0x9182, 0x007f, 0x0a04, 0x5fd5, 0x9186, 0x00ff, 0x0904, 0x5fd5,
+	0x9182, 0x0800, 0x1a04, 0x5fd5, 0xaaa0, 0xab9c, 0x7878, 0x9306,
+	0x1188, 0x787c, 0x0096, 0x924e, 0x1128, 0x2208, 0x2310, 0x009e,
+	0x0804, 0x5fd5, 0x99cc, 0xff00, 0x009e, 0x1120, 0x2208, 0x2310,
+	0x0804, 0x5fd5, 0x080c, 0x4794, 0x0904, 0x5fde, 0x900e, 0x9016,
+	0x90c6, 0x4000, 0x1558, 0x0006, 0x080c, 0x655e, 0x1108, 0xc185,
+	0xb800, 0xd0bc, 0x0108, 0xc18d, 0x20a9, 0x0004, 0xa860, 0x20e8,
+	0xa85c, 0x9080, 0x0031, 0x20a0, 0xb8b4, 0x20e0, 0xb8b8, 0x9080,
+	0x0006, 0x2098, 0x080c, 0x0f9f, 0x20a9, 0x0004, 0xa860, 0x20e8,
+	0xa85c, 0x9080, 0x0035, 0x20a0, 0xb8b4, 0x20e0, 0xb8b8, 0x9080,
+	0x000a, 0x2098, 0x080c, 0x0f9f, 0x000e, 0x00c8, 0x90c6, 0x4007,
+	0x1110, 0x2408, 0x00a0, 0x90c6, 0x4008, 0x1118, 0x2708, 0x2610,
+	0x0070, 0x90c6, 0x4009, 0x1108, 0x0050, 0x90c6, 0x4006, 0x0138,
+	0x2001, 0x4005, 0x2009, 0x000a, 0x0010, 0x2001, 0x4006, 0xa896,
+	0xa99a, 0xaa9e, 0x2001, 0x0030, 0x900e, 0x0470, 0x080c, 0x9b84,
+	0x1130, 0x2001, 0x4005, 0x2009, 0x0003, 0x9016, 0x0c80, 0x2b00,
+	0x6012, 0x080c, 0xbcdb, 0x2900, 0x6016, 0x6023, 0x0001, 0xa868,
+	0xd88c, 0x0108, 0xc0f5, 0xa86a, 0x0126, 0x2091, 0x8000, 0x080c,
+	0x300e, 0x012e, 0x9006, 0x080c, 0x61a8, 0x2001, 0x0002, 0x080c,
+	0x61bc, 0x2009, 0x0002, 0x080c, 0x9c76, 0xa8b0, 0xd094, 0x0118,
+	0xb8c4, 0xc08d, 0xb8c6, 0x9006, 0x9005, 0x012e, 0x00ee, 0x00fe,
+	0x00be, 0x0005, 0x080c, 0x539c, 0x0118, 0x2009, 0x0007, 0x00f8,
+	0xa998, 0xaeb0, 0x080c, 0x626b, 0x1904, 0x5fd0, 0x9186, 0x007f,
+	0x0130, 0x080c, 0x6666, 0x0118, 0x2009, 0x0009, 0x0080, 0x0096,
+	0x080c, 0x1022, 0x1120, 0x009e, 0x2009, 0x0002, 0x0040, 0x2900,
+	0x009e, 0xa806, 0x080c, 0xba2e, 0x19b0, 0x2009, 0x0003, 0x2001,
+	0x4005, 0x0804, 0x5fd7, 0xa998, 0xaeb0, 0x080c, 0x626b, 0x1904,
+	0x5fd0, 0x0096, 0x080c, 0x1022, 0x1128, 0x009e, 0x2009, 0x0002,
+	0x0804, 0x608f, 0x2900, 0x009e, 0xa806, 0x0096, 0x2048, 0x20a9,
+	0x002b, 0xb8b4, 0x20e0, 0xb8b8, 0x2098, 0xa860, 0x20e8, 0xa85c,
+	0x9080, 0x0002, 0x20a0, 0x4003, 0x20a9, 0x0008, 0x9080, 0x0006,
+	0x20a0, 0xbbb8, 0x9398, 0x0006, 0x2398, 0x080c, 0x0f9f, 0x009e,
+	0xa87b, 0x0000, 0xa883, 0x0000, 0xa897, 0x4000, 0xd684, 0x1168,
+	0x080c, 0x5388, 0xd0b4, 0x1118, 0xa89b, 0x000b, 0x00e0, 0xb800,
+	0xd08c, 0x0118, 0xa89b, 0x000c, 0x00b0, 0x080c, 0x6666, 0x0118,
+	0xa89b, 0x0009, 0x0080, 0x080c, 0x539c, 0x0118, 0xa89b, 0x0007,
+	0x0050, 0x080c, 0xba11, 0x1904, 0x600b, 0x2009, 0x0003, 0x2001,
+	0x4005, 0x0804, 0x5fd7, 0xa87b, 0x0030, 0xa897, 0x4005, 0xa804,
+	0x8006, 0x8006, 0x8007, 0x90bc, 0x003f, 0x9084, 0xffc0, 0x9080,
+	0x0002, 0x2009, 0x002b, 0xaaa0, 0xab9c, 0xaca8, 0xada4, 0x2031,
+	0x0000, 0x2041, 0x1271, 0x080c, 0xa0e7, 0x1904, 0x600b, 0x2009,
+	0x0002, 0x08e8, 0x2001, 0x0028, 0x900e, 0x0804, 0x600c, 0x2009,
+	0x180c, 0x210c, 0xd18c, 0x0118, 0x2001, 0x0004, 0x0038, 0xd184,
+	0x0118, 0x2001, 0x0004, 0x0010, 0x2001, 0x0029, 0x900e, 0x0804,
+	0x600c, 0x2001, 0x0029, 0x900e, 0x0804, 0x600c, 0x080c, 0x35ad,
+	0x0804, 0x600d, 0x080c, 0x50bd, 0x0804, 0x600d, 0x080c, 0x4353,
+	0x0804, 0x600d, 0x080c, 0x43cc, 0x0804, 0x600d, 0x080c, 0x4428,
+	0x0804, 0x600d, 0x080c, 0x4850, 0x0804, 0x600d, 0x080c, 0x4af5,
+	0x0804, 0x600d, 0x080c, 0x4d28, 0x0804, 0x600d, 0x080c, 0x4f21,
+	0x0804, 0x600d, 0x080c, 0x37c2, 0x0804, 0x600d, 0x00b6, 0xa974,
+	0xae78, 0x9684, 0x3fff, 0x9082, 0x4000, 0x1608, 0x9182, 0x0800,
+	0x1258, 0x9188, 0x1000, 0x2104, 0x905d, 0x0130, 0x080c, 0x6666,
+	0x1138, 0x00d9, 0x9006, 0x00b0, 0x2001, 0x0028, 0x900e, 0x0090,
+	0x9082, 0x0006, 0x1240, 0xb900, 0xd1fc, 0x0d98, 0x2001, 0x0029,
+	0x2009, 0x1000, 0x0038, 0x2001, 0x0029, 0x900e, 0x0018, 0x2001,
+	0x0029, 0x900e, 0x9005, 0x00be, 0x0005, 0xa877, 0x0000, 0xb8c0,
+	0x9005, 0x1904, 0x619c, 0xb888, 0x9005, 0x1904, 0x619c, 0xb838,
+	0xb93c, 0x9102, 0x1a04, 0x619c, 0x2b10, 0x080c, 0x9bb1, 0x0904,
+	0x6198, 0x8108, 0xb93e, 0x6212, 0x2900, 0x6016, 0x6023, 0x0003,
+	0x600b, 0xffff, 0x6007, 0x0040, 0xa878, 0x605e, 0xa880, 0x9084,
+	0x00ff, 0x6066, 0xa883, 0x0000, 0xa87c, 0xd0ac, 0x05c0, 0xc0dd,
+	0xa87e, 0xa888, 0x8001, 0x1568, 0x2001, 0x00f8, 0x8001, 0xa001,
+	0xa001, 0xa001, 0x1dd8, 0xa816, 0xa864, 0x9094, 0x00f7, 0x9296,
+	0x0011, 0x11f8, 0x9084, 0x00ff, 0xc0bd, 0x601e, 0xa8ac, 0xaab0,
+	0xa836, 0xaa3a, 0x2001, 0x000f, 0x8001, 0x1df0, 0x2001, 0x8004,
+	0x6003, 0x0004, 0x6046, 0x00f6, 0x2079, 0x0380, 0x7818, 0xd0bc,
+	0x1de8, 0x7833, 0x0010, 0x2c00, 0x7836, 0x781b, 0x8080, 0x00fe,
+	0x0005, 0x080c, 0x165c, 0x601c, 0xc0bd, 0x601e, 0x0c38, 0x0006,
+	0x2001, 0x00e8, 0x8001, 0xa001, 0xa001, 0xa001, 0x1dd8, 0x000e,
+	0xd0b4, 0x190c, 0x1adf, 0x2001, 0x8004, 0x6003, 0x0002, 0x08d0,
+	0x81ff, 0x1110, 0xb88b, 0x0001, 0x2908, 0xb8bc, 0xb9be, 0x9005,
+	0x1110, 0xb9c2, 0x0020, 0x0096, 0x2048, 0xa902, 0x009e, 0x0005,
+	0x00b6, 0x0126, 0x00c6, 0x0026, 0x2091, 0x8000, 0x6210, 0x2258,
+	0xba00, 0x9005, 0x0110, 0xc285, 0x0008, 0xc284, 0xba02, 0x002e,
+	0x00ce, 0x012e, 0x00be, 0x0005, 0x00b6, 0x0126, 0x00c6, 0x2091,
+	0x8000, 0x6210, 0x2258, 0xba04, 0x0006, 0x9086, 0x0006, 0x1170,
+	0xb89c, 0xd0ac, 0x0158, 0x080c, 0x6662, 0x0140, 0x9284, 0xff00,
+	0x8007, 0x9086, 0x0007, 0x1110, 0x2011, 0x0600, 0x000e, 0x9294,
+	0xff00, 0x9215, 0xba06, 0x0006, 0x9086, 0x0006, 0x1120, 0xba90,
+	0x82ff, 0x090c, 0x0d65, 0x000e, 0x00ce, 0x012e, 0x00be, 0x0005,
+	0x00b6, 0x0126, 0x00c6, 0x2091, 0x8000, 0x6210, 0x2258, 0xba04,
+	0x0006, 0x9086, 0x0006, 0x1168, 0xb89c, 0xd0a4, 0x0150, 0x080c,
+	0x665e, 0x1138, 0x9284, 0x00ff, 0x9086, 0x0007, 0x1110, 0x2011,
+	0x0006, 0x000e, 0x9294, 0x00ff, 0x8007, 0x9215, 0xba06, 0x00ce,
+	0x012e, 0x00be, 0x0005, 0x9182, 0x0800, 0x0218, 0x9085, 0x0001,
+	0x0005, 0x00d6, 0x0026, 0x9190, 0x1000, 0x2204, 0x905d, 0x1180,
+	0x0096, 0x080c, 0x1022, 0x2958, 0x009e, 0x0160, 0x2b00, 0x2012,
+	0xb85c, 0xb8ba, 0xb860, 0xb8b6, 0x9006, 0xb8a6, 0x080c, 0x5cf1,
+	0x9006, 0x0010, 0x9085, 0x0001, 0x002e, 0x00de, 0x0005, 0x00b6,
+	0x0096, 0x0126, 0x2091, 0x8000, 0x0026, 0x9182, 0x0800, 0x0218,
+	0x9085, 0x0001, 0x0458, 0x00d6, 0x9190, 0x1000, 0x2204, 0x905d,
+	0x0518, 0x2013, 0x0000, 0xb8a4, 0x904d, 0x0110, 0x080c, 0x1054,
+	0x00d6, 0x00c6, 0xb8ac, 0x2060, 0x8cff, 0x0168, 0x600c, 0x0006,
+	0x6014, 0x2048, 0x080c, 0xb842, 0x0110, 0x080c, 0x0fd4, 0x080c,
+	0x9bda, 0x00ce, 0x0c88, 0x00ce, 0x00de, 0x2b48, 0xb8b8, 0xb85e,
+	0xb8b4, 0xb862, 0x080c, 0x1064, 0x00de, 0x9006, 0x002e, 0x012e,
+	0x009e, 0x00be, 0x0005, 0x0016, 0x9182, 0x0800, 0x0218, 0x9085,
+	0x0001, 0x0030, 0x9188, 0x1000, 0x2104, 0x905d, 0x0dc0, 0x9006,
+	0x001e, 0x0005, 0x00d6, 0x0156, 0x0136, 0x0146, 0x9006, 0xb80a,
+	0xb80e, 0xb800, 0xc08c, 0xb802, 0x080c, 0x7096, 0x1510, 0xb8a0,
+	0x9086, 0x007e, 0x0120, 0x080c, 0x9b59, 0x11d8, 0x0078, 0x7040,
+	0xd0e4, 0x01b8, 0x00c6, 0x2061, 0x1952, 0x7048, 0x2062, 0x704c,
+	0x6006, 0x7050, 0x600a, 0x7054, 0x600e, 0x00ce, 0x703c, 0x2069,
+	0x0140, 0x9005, 0x1110, 0x2001, 0x0001, 0x6886, 0x2069, 0x1800,
+	0x68b2, 0x7040, 0xb85e, 0x7048, 0xb862, 0x704c, 0xb866, 0x20e1,
+	0x0000, 0x2099, 0x0276, 0xb8b4, 0x20e8, 0xb8b8, 0x9088, 0x000a,
+	0x21a0, 0x20a9, 0x0004, 0x4003, 0x2099, 0x027a, 0x9088, 0x0006,
+	0x21a0, 0x20a9, 0x0004, 0x4003, 0x2069, 0x0200, 0x6817, 0x0001,
+	0x7040, 0xb86a, 0x7144, 0xb96e, 0x7048, 0xb872, 0x7050, 0xb876,
+	0x2069, 0x0200, 0x6817, 0x0000, 0xb8a0, 0x9086, 0x007e, 0x1110,
+	0x7144, 0xb96e, 0x9182, 0x0211, 0x1218, 0x2009, 0x0008, 0x0400,
+	0x9182, 0x0259, 0x1218, 0x2009, 0x0007, 0x00d0, 0x9182, 0x02c1,
+	0x1218, 0x2009, 0x0006, 0x00a0, 0x9182, 0x0349, 0x1218, 0x2009,
+	0x0005, 0x0070, 0x9182, 0x0421, 0x1218, 0x2009, 0x0004, 0x0040,
+	0x9182, 0x0581, 0x1218, 0x2009, 0x0003, 0x0010, 0x2009, 0x0002,
+	0xb992, 0x014e, 0x013e, 0x015e, 0x00de, 0x0005, 0x0016, 0x0026,
+	0x00e6, 0x2071, 0x0260, 0x7034, 0xb896, 0x703c, 0xb89a, 0x7054,
+	0xb89e, 0x0036, 0xbbc4, 0xc384, 0xba00, 0x2009, 0x1873, 0x210c,
+	0xd0bc, 0x0120, 0xd1ec, 0x0110, 0xc2ad, 0x0008, 0xc2ac, 0xd0c4,
+	0x0148, 0xd1e4, 0x0138, 0xc2bd, 0xd0cc, 0x0128, 0xd38c, 0x1108,
+	0xc385, 0x0008, 0xc2bc, 0xba02, 0xbbc6, 0x003e, 0x00ee, 0x002e,
+	0x001e, 0x0005, 0x0096, 0x0126, 0x2091, 0x8000, 0xb8a4, 0x904d,
+	0x0578, 0xa900, 0x81ff, 0x15c0, 0xaa04, 0x9282, 0x0010, 0x16c8,
+	0x0136, 0x0146, 0x01c6, 0x01d6, 0x8906, 0x8006, 0x8007, 0x908c,
+	0x003f, 0x21e0, 0x9084, 0xffc0, 0x9080, 0x0004, 0x2098, 0x2009,
+	0x0010, 0x20a9, 0x0001, 0x4002, 0x9086, 0xffff, 0x0120, 0x8109,
+	0x1dd0, 0x080c, 0x0d65, 0x3c00, 0x20e8, 0x3300, 0x8001, 0x20a0,
+	0x4604, 0x8210, 0xaa06, 0x01de, 0x01ce, 0x014e, 0x013e, 0x0060,
+	0x080c, 0x1022, 0x0170, 0x2900, 0xb8a6, 0xa803, 0x0000, 0x080c,
+	0x64fa, 0xa807, 0x0001, 0xae12, 0x9085, 0x0001, 0x012e, 0x009e,
+	0x0005, 0x9006, 0x0cd8, 0x0126, 0x2091, 0x8000, 0x0096, 0xb8a4,
+	0x904d, 0x0188, 0xa800, 0x9005, 0x1150, 0x080c, 0x6509, 0x1158,
+	0xa804, 0x908a, 0x0002, 0x0218, 0x8001, 0xa806, 0x0020, 0x080c,
+	0x1054, 0xb8a7, 0x0000, 0x009e, 0x012e, 0x0005, 0x0096, 0x00c6,
+	0xb888, 0x9005, 0x1904, 0x63ef, 0xb8c0, 0x904d, 0x0904, 0x63ef,
+	0x080c, 0x9bb1, 0x0904, 0x63eb, 0x8210, 0xba3e, 0xa800, 0xb8c2,
+	0x9005, 0x1108, 0xb8be, 0x2b00, 0x6012, 0x2900, 0x6016, 0x6023,
+	0x0003, 0x600b, 0xffff, 0x6007, 0x0040, 0xa878, 0x605e, 0xa880,
+	0x9084, 0x00ff, 0x6066, 0xa883, 0x0000, 0xa87c, 0xd0ac, 0x01c8,
+	0xc0dd, 0xa87e, 0xa888, 0x8001, 0x1568, 0xa816, 0xa864, 0x9094,
+	0x00f7, 0x9296, 0x0011, 0x1530, 0x9084, 0x00ff, 0xc0bd, 0x601e,
+	0xa8ac, 0xaab0, 0xa836, 0xaa3a, 0x2001, 0x8004, 0x6003, 0x0004,
+	0x0030, 0x080c, 0x1adf, 0x2001, 0x8004, 0x6003, 0x0002, 0x6046,
+	0x2001, 0x0010, 0x2c08, 0x080c, 0x98ac, 0xb838, 0xba3c, 0x9202,
+	0x0a04, 0x639c, 0x0020, 0x82ff, 0x1110, 0xb88b, 0x0001, 0x00ce,
+	0x009e, 0x0005, 0x080c, 0x165c, 0x601c, 0xc0bd, 0x601e, 0x08e0,
+	0x00b6, 0x0096, 0x0016, 0x20a9, 0x0800, 0x900e, 0x0016, 0x080c,
+	0x626b, 0x1158, 0xb8c0, 0x904d, 0x0140, 0x3e00, 0x9086, 0x0002,
+	0x1118, 0xb800, 0xd0bc, 0x1108, 0x0041, 0x001e, 0x8108, 0x1f04,
+	0x63fe, 0x001e, 0x00be, 0x009e, 0x0005, 0x0096, 0x0016, 0xb8c0,
+	0x904d, 0x0188, 0xa800, 0xb8c2, 0x9005, 0x1108, 0xb8be, 0x9006,
+	0xa802, 0xa867, 0x0103, 0xab7a, 0xa877, 0x0000, 0x080c, 0xbb45,
+	0x080c, 0x6991, 0x0c60, 0x001e, 0x009e, 0x0005, 0x0086, 0x9046,
+	0xb8c0, 0x904d, 0x01b0, 0xa86c, 0x9406, 0x1118, 0xa870, 0x9506,
+	0x0128, 0x2940, 0xa800, 0x904d, 0x0160, 0x0ca8, 0xa800, 0x88ff,
+	0x1128, 0xb8c2, 0x9005, 0x1118, 0xb8be, 0x0008, 0xa002, 0xa803,
+	0x0000, 0x008e, 0x0005, 0x901e, 0x0010, 0x2019, 0x0001, 0x0126,
+	0x2091, 0x8000, 0x00e6, 0x0096, 0x00c6, 0x0086, 0x0026, 0x2071,
+	0x19b7, 0x9046, 0x7028, 0x9065, 0x01e8, 0x6014, 0x2068, 0x83ff,
+	0x0120, 0x605c, 0x9606, 0x0158, 0x0030, 0xa86c, 0x9406, 0x1118,
+	0xa870, 0x9506, 0x0120, 0x2c40, 0x600c, 0x2060, 0x0c60, 0x600c,
+	0x0006, 0x0066, 0x2830, 0x080c, 0x90f3, 0x006e, 0x000e, 0x83ff,
+	0x0508, 0x0c08, 0x9046, 0xb8c0, 0x904d, 0x01e0, 0x83ff, 0x0120,
+	0xa878, 0x9606, 0x0158, 0x0030, 0xa86c, 0x9406, 0x1118, 0xa870,
+	0x9506, 0x0120, 0x2940, 0xa800, 0x2048, 0x0c70, 0xb8c0, 0xaa00,
+	0x0026, 0x9906, 0x1110, 0xbac2, 0x0008, 0xa202, 0x000e, 0x83ff,
+	0x0108, 0x0c10, 0x002e, 0x008e, 0x00ce, 0x009e, 0x00ee, 0x012e,
+	0x0005, 0x9016, 0x0489, 0x1110, 0x2011, 0x0001, 0x0005, 0x080c,
+	0x655e, 0x0128, 0x080c, 0xb903, 0x0010, 0x9085, 0x0001, 0x0005,
+	0x080c, 0x655e, 0x0128, 0x080c, 0xb8a4, 0x0010, 0x9085, 0x0001,
+	0x0005, 0x080c, 0x655e, 0x0128, 0x080c, 0xb900, 0x0010, 0x9085,
+	0x0001, 0x0005, 0x080c, 0x655e, 0x0128, 0x080c, 0xb8c3, 0x0010,
+	0x9085, 0x0001, 0x0005, 0x080c, 0x655e, 0x0128, 0x080c, 0xb944,
+	0x0010, 0x9085, 0x0001, 0x0005, 0xb8a4, 0x900d, 0x1118, 0x9085,
+	0x0001, 0x0005, 0x0136, 0x01c6, 0xa800, 0x9005, 0x11b8, 0x890e,
 	0x810e, 0x810f, 0x9184, 0x003f, 0x20e0, 0x9184, 0xffc0, 0x9080,
 	0x0004, 0x2098, 0x20a9, 0x0001, 0x2009, 0x0010, 0x4002, 0x9606,
-	0x0128, 0x8109, 0x1dd8, 0x9085, 0x0001, 0x0068, 0x0146, 0x01d6,
-	0x3300, 0x8001, 0x20a0, 0x3c00, 0x20e8, 0x2001, 0xffff, 0x4004,
-	0x01de, 0x014e, 0x9006, 0x01ce, 0x013e, 0x0005, 0x0096, 0x0126,
-	0x2091, 0x8000, 0xb8a4, 0x904d, 0x1128, 0x080c, 0x1022, 0x0168,
-	0x2900, 0xb8a6, 0x080c, 0x64fb, 0xa803, 0x0001, 0xa807, 0x0000,
-	0x9085, 0x0001, 0x012e, 0x009e, 0x0005, 0x9006, 0x0cd8, 0x0096,
-	0x0126, 0x2091, 0x8000, 0xb8a4, 0x904d, 0x0130, 0xb8a7, 0x0000,
-	0x080c, 0x1054, 0x9085, 0x0001, 0x012e, 0x009e, 0x0005, 0xb89c,
-	0xd0a4, 0x0005, 0x00b6, 0x00f6, 0x080c, 0x70b7, 0x01b0, 0x71c0,
-	0x81ff, 0x1198, 0x71d8, 0xd19c, 0x0180, 0x2001, 0x007e, 0x9080,
-	0x1000, 0x2004, 0x905d, 0x0148, 0xb804, 0x9084, 0x00ff, 0x9086,
-	0x0006, 0x1118, 0xb800, 0xc0ed, 0xb802, 0x2079, 0x1853, 0x7804,
-	0x00d0, 0x0156, 0x20a9, 0x007f, 0x900e, 0x0016, 0x080c, 0x6270,
-	0x1168, 0xb804, 0x9084, 0xff00, 0x8007, 0x9096, 0x0004, 0x0118,
-	0x9086, 0x0006, 0x1118, 0xb800, 0xc0ed, 0xb802, 0x001e, 0x8108,
-	0x1f04, 0x6585, 0x015e, 0x080c, 0x6625, 0x0120, 0x2001, 0x1956,
-	0x200c, 0x0030, 0x2079, 0x1853, 0x7804, 0x0030, 0x2009, 0x07d0,
-	0x2011, 0x65af, 0x080c, 0x821d, 0x00fe, 0x00be, 0x0005, 0x00b6,
-	0x2011, 0x65af, 0x080c, 0x8159, 0x080c, 0x6625, 0x01d8, 0x2001,
-	0x107e, 0x2004, 0x2058, 0xb900, 0xc1ec, 0xb902, 0x080c, 0x6663,
-	0x0130, 0x2009, 0x07d0, 0x2011, 0x65af, 0x080c, 0x821d, 0x00e6,
-	0x2071, 0x1800, 0x9006, 0x707a, 0x705c, 0x707e, 0x080c, 0x2ddb,
-	0x00ee, 0x04d0, 0x0156, 0x00c6, 0x20a9, 0x007f, 0x900e, 0x0016,
-	0x080c, 0x6270, 0x1558, 0xb800, 0xd0ec, 0x0540, 0x0046, 0xbaa0,
-	0x2220, 0x9006, 0x2009, 0x0029, 0x080c, 0xd273, 0xb800, 0xc0e5,
-	0xc0ec, 0xb802, 0x080c, 0x665f, 0x2001, 0x0707, 0x1128, 0xb804,
-	0x9084, 0x00ff, 0x9085, 0x0700, 0xb806, 0x080c, 0x98c8, 0x2019,
-	0x0029, 0x080c, 0x863b, 0x0076, 0x903e, 0x080c, 0x852a, 0x900e,
-	0x080c, 0xcfc8, 0x007e, 0x004e, 0x080c, 0x98e4, 0x001e, 0x8108,
-	0x1f04, 0x65d7, 0x00ce, 0x015e, 0x00be, 0x0005, 0x00b6, 0x6010,
-	0x2058, 0xb800, 0xc0ec, 0xb802, 0x00be, 0x0005, 0x7810, 0x00b6,
-	0x2058, 0xb800, 0x00be, 0xd0ac, 0x0005, 0x6010, 0x00b6, 0x905d,
-	0x0108, 0xb800, 0x00be, 0xd0bc, 0x0005, 0x00b6, 0x00f6, 0x2001,
-	0x107e, 0x2004, 0x905d, 0x0110, 0xb800, 0xd0ec, 0x00fe, 0x00be,
-	0x0005, 0x0126, 0x0026, 0x2091, 0x8000, 0x0006, 0xbaa0, 0x9290,
-	0x1000, 0x2204, 0x9b06, 0x190c, 0x0d65, 0x000e, 0xba00, 0x9005,
-	0x0110, 0xc2fd, 0x0008, 0xc2fc, 0xba02, 0x002e, 0x012e, 0x0005,
-	0x2011, 0x1836, 0x2204, 0xd0cc, 0x0138, 0x2001, 0x1954, 0x200c,
-	0x2011, 0x6655, 0x080c, 0x821d, 0x0005, 0x2011, 0x6655, 0x080c,
-	0x8159, 0x2011, 0x1836, 0x2204, 0xc0cc, 0x2012, 0x0005, 0x080c,
-	0x538d, 0xd0ac, 0x0005, 0x080c, 0x538d, 0xd0a4, 0x0005, 0x0016,
-	0xb904, 0x9184, 0x00ff, 0x908e, 0x0006, 0x001e, 0x0005, 0x0016,
-	0xb904, 0x9184, 0xff00, 0x8007, 0x908e, 0x0006, 0x001e, 0x0005,
-	0x00b6, 0x00f6, 0x080c, 0xbf61, 0x0158, 0x70d8, 0x9084, 0x0028,
-	0x0138, 0x2001, 0x107f, 0x2004, 0x905d, 0x0110, 0xb8c4, 0xd094,
-	0x00fe, 0x00be, 0x0005, 0x0006, 0x0016, 0x0036, 0x0046, 0x0076,
-	0x00b6, 0x2001, 0x1817, 0x203c, 0x9780, 0x318b, 0x203d, 0x97bc,
-	0xff00, 0x873f, 0x9006, 0x2018, 0x2008, 0x9284, 0x8000, 0x0110,
-	0x2019, 0x0001, 0x9294, 0x7fff, 0x2100, 0x9706, 0x0190, 0x91a0,
-	0x1000, 0x2404, 0x905d, 0x0168, 0xb804, 0x9084, 0x00ff, 0x9086,
-	0x0006, 0x1138, 0x83ff, 0x0118, 0xb89c, 0xd0a4, 0x0110, 0x8211,
-	0x0158, 0x8108, 0x83ff, 0x0120, 0x9182, 0x0800, 0x0e28, 0x0068,
-	0x9182, 0x007e, 0x0e08, 0x0048, 0x00be, 0x007e, 0x004e, 0x003e,
-	0x001e, 0x9085, 0x0001, 0x000e, 0x0005, 0x00be, 0x007e, 0x004e,
-	0x003e, 0x001e, 0x9006, 0x000e, 0x0005, 0x0046, 0x0056, 0x0076,
-	0x00b6, 0x2100, 0x9084, 0x7fff, 0x9080, 0x1000, 0x2004, 0x905d,
-	0x0130, 0xb804, 0x9084, 0x00ff, 0x9086, 0x0006, 0x0550, 0x9184,
-	0x8000, 0x0580, 0x2001, 0x1817, 0x203c, 0x9780, 0x318b, 0x203d,
-	0x97bc, 0xff00, 0x873f, 0x9006, 0x2020, 0x2400, 0x9706, 0x01a0,
-	0x94a8, 0x1000, 0x2504, 0x905d, 0x0178, 0xb804, 0x9084, 0x00ff,
-	0x9086, 0x0006, 0x1148, 0xb89c, 0xd0a4, 0x0130, 0xb814, 0x9206,
-	0x1118, 0xb810, 0x9306, 0x0128, 0x8420, 0x9482, 0x0800, 0x0e28,
-	0x0048, 0x918c, 0x7fff, 0x00be, 0x007e, 0x005e, 0x004e, 0x9085,
-	0x0001, 0x0005, 0x918c, 0x7fff, 0x00be, 0x007e, 0x005e, 0x004e,
-	0x9006, 0x0005, 0x2071, 0x1906, 0x7003, 0x0001, 0x7007, 0x0000,
-	0x9006, 0x7012, 0x7016, 0x701a, 0x701e, 0x700a, 0x7046, 0x2001,
-	0x1919, 0x2003, 0x0000, 0x0005, 0x0016, 0x00e6, 0x2071, 0x191a,
-	0x900e, 0x710a, 0x080c, 0x538d, 0xd0fc, 0x1140, 0x080c, 0x538d,
-	0x900e, 0xd09c, 0x0108, 0x8108, 0x7102, 0x0400, 0x2001, 0x1873,
-	0x200c, 0x9184, 0x0007, 0x9006, 0x0002, 0x673e, 0x673e, 0x673e,
-	0x673e, 0x673e, 0x6755, 0x6763, 0x673e, 0x7003, 0x0003, 0x2009,
-	0x1874, 0x210c, 0x9184, 0xff00, 0x8007, 0x9005, 0x1110, 0x2001,
-	0x0002, 0x7006, 0x0018, 0x7003, 0x0005, 0x0c88, 0x00ee, 0x001e,
-	0x0005, 0x00e6, 0x2071, 0x0050, 0x684c, 0x9005, 0x1150, 0x00e6,
-	0x2071, 0x1906, 0x7028, 0xc085, 0x702a, 0x00ee, 0x9085, 0x0001,
-	0x0488, 0x6844, 0x9005, 0x0158, 0x080c, 0x7429, 0x6a60, 0x9200,
-	0x7002, 0x6864, 0x9101, 0x7006, 0x9006, 0x7012, 0x7016, 0x6860,
-	0x7002, 0x6864, 0x7006, 0x6868, 0x700a, 0x686c, 0x700e, 0x6844,
-	0x9005, 0x1110, 0x7012, 0x7016, 0x684c, 0x701a, 0x701c, 0x9085,
-	0x0040, 0x701e, 0x7037, 0x0019, 0x702b, 0x0001, 0x00e6, 0x2071,
-	0x1906, 0x7028, 0xc084, 0x702a, 0x7007, 0x0001, 0x700b, 0x0000,
-	0x00ee, 0x9006, 0x00ee, 0x0005, 0xa868, 0xd0fc, 0x11d8, 0x00e6,
-	0x0026, 0x2001, 0x191a, 0x2004, 0x9005, 0x0904, 0x699b, 0xa87c,
-	0xd0bc, 0x1904, 0x699b, 0xa978, 0xa874, 0x9105, 0x1904, 0x699b,
-	0x2001, 0x191a, 0x2004, 0x0002, 0x699b, 0x67ef, 0x682b, 0x682b,
-	0x699b, 0x682b, 0x0005, 0xa868, 0xd0fc, 0x1500, 0x00e6, 0x0026,
-	0x2009, 0x191a, 0x210c, 0x81ff, 0x0904, 0x699b, 0xa87c, 0xd0cc,
-	0x0904, 0x699b, 0xa880, 0x9084, 0x00ff, 0x9086, 0x0001, 0x1904,
-	0x699b, 0x9186, 0x0003, 0x0904, 0x682b, 0x9186, 0x0005, 0x0904,
-	0x682b, 0xa84f, 0x8021, 0xa853, 0x0017, 0x0028, 0x0005, 0xa84f,
-	0x8020, 0xa853, 0x0016, 0x2071, 0x1906, 0x701c, 0x9005, 0x1904,
-	0x6b3e, 0x0e04, 0x6b89, 0x2071, 0x0000, 0xa84c, 0x7082, 0xa850,
-	0x7032, 0xa86c, 0x7086, 0x7036, 0xa870, 0x708a, 0x2091, 0x4080,
-	0x2001, 0x0089, 0x2004, 0xd084, 0x190c, 0x11be, 0x2071, 0x1800,
-	0x2011, 0x0001, 0xa804, 0x900d, 0x702c, 0x1158, 0xa802, 0x2900,
-	0x702e, 0x70bc, 0x9200, 0x70be, 0x080c, 0x8074, 0x002e, 0x00ee,
-	0x0005, 0x0096, 0x2148, 0xa904, 0xa802, 0x8210, 0x2900, 0x81ff,
-	0x1dc8, 0x009e, 0x0c58, 0xa84f, 0x0000, 0x00f6, 0x2079, 0x0050,
-	0x2071, 0x1906, 0xa803, 0x0000, 0x7010, 0x9005, 0x1904, 0x6920,
-	0x782c, 0x908c, 0x0780, 0x190c, 0x6cb0, 0x8004, 0x8004, 0x8004,
-	0x9084, 0x0003, 0x0002, 0x6849, 0x6920, 0x686e, 0x68bb, 0x080c,
-	0x0d65, 0x2071, 0x1800, 0x2900, 0x7822, 0xa804, 0x900d, 0x1170,
-	0x2071, 0x19d4, 0x703c, 0x9005, 0x1328, 0x2001, 0x191b, 0x2004,
-	0x8005, 0x703e, 0x00fe, 0x002e, 0x00ee, 0x0005, 0x9016, 0x702c,
-	0x2148, 0xa904, 0xa802, 0x8210, 0x2900, 0x81ff, 0x1dc8, 0x702e,
-	0x70bc, 0x9200, 0x70be, 0x080c, 0x8074, 0x0c10, 0x2071, 0x1800,
-	0x2900, 0x7822, 0xa804, 0x900d, 0x15a8, 0x7824, 0x00e6, 0x2071,
-	0x0040, 0x712c, 0xd19c, 0x1170, 0x2009, 0x182f, 0x210c, 0x918a,
-	0x0040, 0x0240, 0x7022, 0x2001, 0x1dc0, 0x200c, 0x8108, 0x2102,
-	0x00ee, 0x0058, 0x00ee, 0x2048, 0x702c, 0xa802, 0x2900, 0x702e,
-	0x70bc, 0x8000, 0x70be, 0x080c, 0x8074, 0x782c, 0x9094, 0x0780,
-	0x190c, 0x6cb0, 0xd0a4, 0x19c8, 0x2071, 0x19d4, 0x703c, 0x9005,
-	0x1328, 0x2001, 0x191b, 0x2004, 0x8005, 0x703e, 0x00fe, 0x002e,
-	0x00ee, 0x0005, 0x9016, 0x702c, 0x2148, 0xa904, 0xa802, 0x8210,
-	0x2900, 0x81ff, 0x1dc8, 0x702e, 0x70bc, 0x9200, 0x70be, 0x080c,
-	0x8074, 0x0804, 0x6875, 0x0096, 0x00e6, 0x7824, 0x2048, 0x2071,
-	0x1800, 0x702c, 0xa802, 0x2900, 0x702e, 0x70bc, 0x8000, 0x70be,
-	0x080c, 0x8074, 0x782c, 0x9094, 0x0780, 0x190c, 0x6cb0, 0xd0a4,
-	0x1d60, 0x00ee, 0x782c, 0x9094, 0x0780, 0x190c, 0x6cb0, 0xd09c,
-	0x11a0, 0x009e, 0x2900, 0x7822, 0xa804, 0x900d, 0x1560, 0x2071,
-	0x19d4, 0x703c, 0x9005, 0x1328, 0x2001, 0x191b, 0x2004, 0x8005,
-	0x703e, 0x00fe, 0x002e, 0x00ee, 0x0005, 0x009e, 0x2908, 0x7010,
-	0x8000, 0x7012, 0x7018, 0x904d, 0x711a, 0x0110, 0xa902, 0x0008,
-	0x711e, 0x2148, 0xa804, 0x900d, 0x1170, 0x2071, 0x19d4, 0x703c,
-	0x9005, 0x1328, 0x2001, 0x191b, 0x2004, 0x8005, 0x703e, 0x00fe,
-	0x002e, 0x00ee, 0x0005, 0x2071, 0x1800, 0x9016, 0x702c, 0x2148,
+	0x0128, 0x8109, 0x1dd8, 0x9085, 0x0001, 0x0008, 0x9006, 0x01ce,
+	0x013e, 0x0005, 0x0146, 0x01d6, 0xa860, 0x20e8, 0xa85c, 0x9080,
+	0x0004, 0x20a0, 0x20a9, 0x0010, 0x2009, 0xffff, 0x4104, 0x01de,
+	0x014e, 0x0136, 0x01c6, 0xa800, 0x9005, 0x11b8, 0x890e, 0x810e,
+	0x810f, 0x9184, 0x003f, 0x20e0, 0x9184, 0xffc0, 0x9080, 0x0004,
+	0x2098, 0x20a9, 0x0001, 0x2009, 0x0010, 0x4002, 0x9606, 0x0128,
+	0x8109, 0x1dd8, 0x9085, 0x0001, 0x0068, 0x0146, 0x01d6, 0x3300,
+	0x8001, 0x20a0, 0x3c00, 0x20e8, 0x2001, 0xffff, 0x4004, 0x01de,
+	0x014e, 0x9006, 0x01ce, 0x013e, 0x0005, 0x0096, 0x0126, 0x2091,
+	0x8000, 0xb8a4, 0x904d, 0x1128, 0x080c, 0x1022, 0x0168, 0x2900,
+	0xb8a6, 0x080c, 0x64fa, 0xa803, 0x0001, 0xa807, 0x0000, 0x9085,
+	0x0001, 0x012e, 0x009e, 0x0005, 0x9006, 0x0cd8, 0x0096, 0x0126,
+	0x2091, 0x8000, 0xb8a4, 0x904d, 0x0130, 0xb8a7, 0x0000, 0x080c,
+	0x1054, 0x9085, 0x0001, 0x012e, 0x009e, 0x0005, 0xb89c, 0xd0a4,
+	0x0005, 0x00b6, 0x00f6, 0x080c, 0x7096, 0x01b0, 0x71c0, 0x81ff,
+	0x1198, 0x71d8, 0xd19c, 0x0180, 0x2001, 0x007e, 0x9080, 0x1000,
+	0x2004, 0x905d, 0x0148, 0xb804, 0x9084, 0x00ff, 0x9086, 0x0006,
+	0x1118, 0xb800, 0xc0ed, 0xb802, 0x2079, 0x1853, 0x7804, 0x00d0,
+	0x0156, 0x20a9, 0x007f, 0x900e, 0x0016, 0x080c, 0x626b, 0x1168,
+	0xb804, 0x9084, 0xff00, 0x8007, 0x9096, 0x0004, 0x0118, 0x9086,
+	0x0006, 0x1118, 0xb800, 0xc0ed, 0xb802, 0x001e, 0x8108, 0x1f04,
+	0x6584, 0x015e, 0x080c, 0x6624, 0x0120, 0x2001, 0x1955, 0x200c,
+	0x0030, 0x2079, 0x1853, 0x7804, 0x0030, 0x2009, 0x07d0, 0x2011,
+	0x65ae, 0x080c, 0x81fc, 0x00fe, 0x00be, 0x0005, 0x00b6, 0x2011,
+	0x65ae, 0x080c, 0x8138, 0x080c, 0x6624, 0x01d8, 0x2001, 0x107e,
+	0x2004, 0x2058, 0xb900, 0xc1ec, 0xb902, 0x080c, 0x6662, 0x0130,
+	0x2009, 0x07d0, 0x2011, 0x65ae, 0x080c, 0x81fc, 0x00e6, 0x2071,
+	0x1800, 0x9006, 0x707a, 0x705c, 0x707e, 0x080c, 0x2de9, 0x00ee,
+	0x04d0, 0x0156, 0x00c6, 0x20a9, 0x007f, 0x900e, 0x0016, 0x080c,
+	0x626b, 0x1558, 0xb800, 0xd0ec, 0x0540, 0x0046, 0xbaa0, 0x2220,
+	0x9006, 0x2009, 0x0029, 0x080c, 0xd284, 0xb800, 0xc0e5, 0xc0ec,
+	0xb802, 0x080c, 0x665e, 0x2001, 0x0707, 0x1128, 0xb804, 0x9084,
+	0x00ff, 0x9085, 0x0700, 0xb806, 0x080c, 0x98bb, 0x2019, 0x0029,
+	0x080c, 0x8624, 0x0076, 0x903e, 0x080c, 0x8509, 0x900e, 0x080c,
+	0xcfd9, 0x007e, 0x004e, 0x080c, 0x98d7, 0x001e, 0x8108, 0x1f04,
+	0x65d6, 0x00ce, 0x015e, 0x00be, 0x0005, 0x00b6, 0x6010, 0x2058,
+	0xb800, 0xc0ec, 0xb802, 0x00be, 0x0005, 0x7810, 0x00b6, 0x2058,
+	0xb800, 0x00be, 0xd0ac, 0x0005, 0x6010, 0x00b6, 0x905d, 0x0108,
+	0xb800, 0x00be, 0xd0bc, 0x0005, 0x00b6, 0x00f6, 0x2001, 0x107e,
+	0x2004, 0x905d, 0x0110, 0xb800, 0xd0ec, 0x00fe, 0x00be, 0x0005,
+	0x0126, 0x0026, 0x2091, 0x8000, 0x0006, 0xbaa0, 0x9290, 0x1000,
+	0x2204, 0x9b06, 0x190c, 0x0d65, 0x000e, 0xba00, 0x9005, 0x0110,
+	0xc2fd, 0x0008, 0xc2fc, 0xba02, 0x002e, 0x012e, 0x0005, 0x2011,
+	0x1836, 0x2204, 0xd0cc, 0x0138, 0x2001, 0x1953, 0x200c, 0x2011,
+	0x6654, 0x080c, 0x81fc, 0x0005, 0x2011, 0x6654, 0x080c, 0x8138,
+	0x2011, 0x1836, 0x2204, 0xc0cc, 0x2012, 0x0005, 0x080c, 0x5388,
+	0xd0ac, 0x0005, 0x080c, 0x5388, 0xd0a4, 0x0005, 0x0016, 0xb904,
+	0x9184, 0x00ff, 0x908e, 0x0006, 0x001e, 0x0005, 0x0016, 0xb904,
+	0x9184, 0xff00, 0x8007, 0x908e, 0x0006, 0x001e, 0x0005, 0x00b6,
+	0x00f6, 0x080c, 0xbf61, 0x0158, 0x70d8, 0x9084, 0x0028, 0x0138,
+	0x2001, 0x107f, 0x2004, 0x905d, 0x0110, 0xb8c4, 0xd094, 0x00fe,
+	0x00be, 0x0005, 0x0006, 0x0016, 0x0036, 0x0046, 0x0076, 0x00b6,
+	0x2001, 0x1817, 0x203c, 0x9780, 0x317f, 0x203d, 0x97bc, 0xff00,
+	0x873f, 0x9006, 0x2018, 0x2008, 0x9284, 0x8000, 0x0110, 0x2019,
+	0x0001, 0x9294, 0x7fff, 0x2100, 0x9706, 0x0190, 0x91a0, 0x1000,
+	0x2404, 0x905d, 0x0168, 0xb804, 0x9084, 0x00ff, 0x9086, 0x0006,
+	0x1138, 0x83ff, 0x0118, 0xb89c, 0xd0a4, 0x0110, 0x8211, 0x0158,
+	0x8108, 0x83ff, 0x0120, 0x9182, 0x0800, 0x0e28, 0x0068, 0x9182,
+	0x007e, 0x0e08, 0x0048, 0x00be, 0x007e, 0x004e, 0x003e, 0x001e,
+	0x9085, 0x0001, 0x000e, 0x0005, 0x00be, 0x007e, 0x004e, 0x003e,
+	0x001e, 0x9006, 0x000e, 0x0005, 0x0046, 0x0056, 0x0076, 0x00b6,
+	0x2100, 0x9084, 0x7fff, 0x9080, 0x1000, 0x2004, 0x905d, 0x0130,
+	0xb804, 0x9084, 0x00ff, 0x9086, 0x0006, 0x0550, 0x9184, 0x8000,
+	0x0580, 0x2001, 0x1817, 0x203c, 0x9780, 0x317f, 0x203d, 0x97bc,
+	0xff00, 0x873f, 0x9006, 0x2020, 0x2400, 0x9706, 0x01a0, 0x94a8,
+	0x1000, 0x2504, 0x905d, 0x0178, 0xb804, 0x9084, 0x00ff, 0x9086,
+	0x0006, 0x1148, 0xb89c, 0xd0a4, 0x0130, 0xb814, 0x9206, 0x1118,
+	0xb810, 0x9306, 0x0128, 0x8420, 0x9482, 0x0800, 0x0e28, 0x0048,
+	0x918c, 0x7fff, 0x00be, 0x007e, 0x005e, 0x004e, 0x9085, 0x0001,
+	0x0005, 0x918c, 0x7fff, 0x00be, 0x007e, 0x005e, 0x004e, 0x9006,
+	0x0005, 0x2071, 0x1906, 0x7003, 0x0001, 0x7007, 0x0000, 0x9006,
+	0x7012, 0x7016, 0x701a, 0x701e, 0x700a, 0x7046, 0x0005, 0x0016,
+	0x00e6, 0x2071, 0x1919, 0x900e, 0x710a, 0x080c, 0x5388, 0xd0fc,
+	0x1140, 0x080c, 0x5388, 0x900e, 0xd09c, 0x0108, 0x8108, 0x7102,
+	0x0400, 0x2001, 0x1873, 0x200c, 0x9184, 0x0007, 0x9006, 0x0002,
+	0x6739, 0x6739, 0x6739, 0x6739, 0x6739, 0x6750, 0x675e, 0x6739,
+	0x7003, 0x0003, 0x2009, 0x1874, 0x210c, 0x9184, 0xff00, 0x8007,
+	0x9005, 0x1110, 0x2001, 0x0002, 0x7006, 0x0018, 0x7003, 0x0005,
+	0x0c88, 0x00ee, 0x001e, 0x0005, 0x00e6, 0x2071, 0x0050, 0x684c,
+	0x9005, 0x1150, 0x00e6, 0x2071, 0x1906, 0x7028, 0xc085, 0x702a,
+	0x00ee, 0x9085, 0x0001, 0x0488, 0x6844, 0x9005, 0x0158, 0x080c,
+	0x7408, 0x6a60, 0x9200, 0x7002, 0x6864, 0x9101, 0x7006, 0x9006,
+	0x7012, 0x7016, 0x6860, 0x7002, 0x6864, 0x7006, 0x6868, 0x700a,
+	0x686c, 0x700e, 0x6844, 0x9005, 0x1110, 0x7012, 0x7016, 0x684c,
+	0x701a, 0x701c, 0x9085, 0x0040, 0x701e, 0x7037, 0x0019, 0x702b,
+	0x0001, 0x00e6, 0x2071, 0x1906, 0x7028, 0xc084, 0x702a, 0x7007,
+	0x0001, 0x700b, 0x0000, 0x00ee, 0x9006, 0x00ee, 0x0005, 0xa868,
+	0xd0fc, 0x11d8, 0x00e6, 0x0026, 0x2001, 0x1919, 0x2004, 0x9005,
+	0x0904, 0x6996, 0xa87c, 0xd0bc, 0x1904, 0x6996, 0xa978, 0xa874,
+	0x9105, 0x1904, 0x6996, 0x2001, 0x1919, 0x2004, 0x0002, 0x6996,
+	0x67ea, 0x6826, 0x6826, 0x6996, 0x6826, 0x0005, 0xa868, 0xd0fc,
+	0x1500, 0x00e6, 0x0026, 0x2009, 0x1919, 0x210c, 0x81ff, 0x0904,
+	0x6996, 0xa87c, 0xd0cc, 0x0904, 0x6996, 0xa880, 0x9084, 0x00ff,
+	0x9086, 0x0001, 0x1904, 0x6996, 0x9186, 0x0003, 0x0904, 0x6826,
+	0x9186, 0x0005, 0x0904, 0x6826, 0xa84f, 0x8021, 0xa853, 0x0017,
+	0x0028, 0x0005, 0xa84f, 0x8020, 0xa853, 0x0016, 0x2071, 0x1906,
+	0x701c, 0x9005, 0x1904, 0x6b2d, 0x0e04, 0x6b78, 0x2071, 0x0000,
+	0xa84c, 0x7082, 0xa850, 0x7032, 0xa86c, 0x7086, 0x7036, 0xa870,
+	0x708a, 0x2091, 0x4080, 0x2001, 0x0089, 0x2004, 0xd084, 0x190c,
+	0x11c9, 0x2071, 0x1800, 0x2011, 0x0001, 0xa804, 0x900d, 0x702c,
+	0x1158, 0xa802, 0x2900, 0x702e, 0x70bc, 0x9200, 0x70be, 0x080c,
+	0x8053, 0x002e, 0x00ee, 0x0005, 0x0096, 0x2148, 0xa904, 0xa802,
+	0x8210, 0x2900, 0x81ff, 0x1dc8, 0x009e, 0x0c58, 0xa84f, 0x0000,
+	0x00f6, 0x2079, 0x0050, 0x2071, 0x1906, 0xa803, 0x0000, 0x7010,
+	0x9005, 0x1904, 0x691b, 0x782c, 0x908c, 0x0780, 0x190c, 0x6c9f,
+	0x8004, 0x8004, 0x8004, 0x9084, 0x0003, 0x0002, 0x6844, 0x691b,
+	0x6869, 0x68b6, 0x080c, 0x0d65, 0x2071, 0x1800, 0x2900, 0x7822,
+	0xa804, 0x900d, 0x1170, 0x2071, 0x19d3, 0x703c, 0x9005, 0x1328,
+	0x2001, 0x191a, 0x2004, 0x8005, 0x703e, 0x00fe, 0x002e, 0x00ee,
+	0x0005, 0x9016, 0x702c, 0x2148, 0xa904, 0xa802, 0x8210, 0x2900,
+	0x81ff, 0x1dc8, 0x702e, 0x70bc, 0x9200, 0x70be, 0x080c, 0x8053,
+	0x0c10, 0x2071, 0x1800, 0x2900, 0x7822, 0xa804, 0x900d, 0x15a8,
+	0x7824, 0x00e6, 0x2071, 0x0040, 0x712c, 0xd19c, 0x1170, 0x2009,
+	0x182f, 0x210c, 0x918a, 0x0040, 0x0240, 0x7022, 0x2001, 0x1dc0,
+	0x200c, 0x8108, 0x2102, 0x00ee, 0x0058, 0x00ee, 0x2048, 0x702c,
+	0xa802, 0x2900, 0x702e, 0x70bc, 0x8000, 0x70be, 0x080c, 0x8053,
+	0x782c, 0x9094, 0x0780, 0x190c, 0x6c9f, 0xd0a4, 0x19c8, 0x2071,
+	0x19d3, 0x703c, 0x9005, 0x1328, 0x2001, 0x191a, 0x2004, 0x8005,
+	0x703e, 0x00fe, 0x002e, 0x00ee, 0x0005, 0x9016, 0x702c, 0x2148,
 	0xa904, 0xa802, 0x8210, 0x2900, 0x81ff, 0x1dc8, 0x702e, 0x70bc,
-	0x9200, 0x70be, 0x080c, 0x8074, 0x00fe, 0x002e, 0x00ee, 0x0005,
-	0x2908, 0x7010, 0x8000, 0x7012, 0x7018, 0x904d, 0x711a, 0x0110,
-	0xa902, 0x0008, 0x711e, 0x2148, 0xa804, 0x900d, 0x1904, 0x6975,
-	0x782c, 0x9094, 0x0780, 0x190c, 0x6cb0, 0xd09c, 0x1198, 0x701c,
-	0x904d, 0x0180, 0x7010, 0x8001, 0x7012, 0x1108, 0x701a, 0xa800,
-	0x701e, 0x2900, 0x7822, 0x782c, 0x9094, 0x0780, 0x190c, 0x6cb0,
-	0xd09c, 0x0d68, 0x782c, 0x9094, 0x0780, 0x190c, 0x6cb0, 0xd0a4,
-	0x01b0, 0x00e6, 0x7824, 0x2048, 0x2071, 0x1800, 0x702c, 0xa802,
-	0x2900, 0x702e, 0x70bc, 0x8000, 0x70be, 0x080c, 0x8074, 0x782c,
-	0x9094, 0x0780, 0x190c, 0x6cb0, 0xd0a4, 0x1d60, 0x00ee, 0x2071,
-	0x19d4, 0x703c, 0x9005, 0x1328, 0x2001, 0x191b, 0x2004, 0x8005,
-	0x703e, 0x00fe, 0x002e, 0x00ee, 0x0005, 0x00e6, 0x2071, 0x1800,
+	0x9200, 0x70be, 0x080c, 0x8053, 0x0804, 0x6870, 0x0096, 0x00e6,
+	0x7824, 0x2048, 0x2071, 0x1800, 0x702c, 0xa802, 0x2900, 0x702e,
+	0x70bc, 0x8000, 0x70be, 0x080c, 0x8053, 0x782c, 0x9094, 0x0780,
+	0x190c, 0x6c9f, 0xd0a4, 0x1d60, 0x00ee, 0x782c, 0x9094, 0x0780,
+	0x190c, 0x6c9f, 0xd09c, 0x11a0, 0x009e, 0x2900, 0x7822, 0xa804,
+	0x900d, 0x1560, 0x2071, 0x19d3, 0x703c, 0x9005, 0x1328, 0x2001,
+	0x191a, 0x2004, 0x8005, 0x703e, 0x00fe, 0x002e, 0x00ee, 0x0005,
+	0x009e, 0x2908, 0x7010, 0x8000, 0x7012, 0x7018, 0x904d, 0x711a,
+	0x0110, 0xa902, 0x0008, 0x711e, 0x2148, 0xa804, 0x900d, 0x1170,
+	0x2071, 0x19d3, 0x703c, 0x9005, 0x1328, 0x2001, 0x191a, 0x2004,
+	0x8005, 0x703e, 0x00fe, 0x002e, 0x00ee, 0x0005, 0x2071, 0x1800,
 	0x9016, 0x702c, 0x2148, 0xa904, 0xa802, 0x8210, 0x2900, 0x81ff,
-	0x1dc8, 0x702e, 0x70bc, 0x9200, 0x70be, 0x080c, 0x8074, 0x00ee,
-	0x0804, 0x6930, 0xa868, 0xd0fc, 0x1560, 0x0096, 0xa804, 0xa807,
-	0x0000, 0x904d, 0x190c, 0x0fd4, 0x009e, 0x0018, 0xa868, 0xd0fc,
-	0x1500, 0x00e6, 0x0026, 0xa84f, 0x0000, 0x00f6, 0x2079, 0x0050,
-	0x2071, 0x1906, 0xa803, 0x0000, 0x7010, 0x9005, 0x1904, 0x6ab8,
-	0x782c, 0x908c, 0x0780, 0x190c, 0x6cb0, 0x8004, 0x8004, 0x8004,
-	0x9084, 0x0003, 0x0002, 0x69ba, 0x6ab8, 0x69d5, 0x6a47, 0x080c,
-	0x0d65, 0x0005, 0x2071, 0x1800, 0x2900, 0x7822, 0xa804, 0x900d,
-	0x1120, 0x00fe, 0x002e, 0x00ee, 0x0005, 0x9016, 0x702c, 0x2148,
-	0xa904, 0xa802, 0x8210, 0x2900, 0x81ff, 0x1dc8, 0x702e, 0x70bc,
-	0x9200, 0x70be, 0x080c, 0x8074, 0x0c60, 0x2071, 0x1800, 0x2900,
-	0x7822, 0xa804, 0x900d, 0x1904, 0x6a36, 0x7830, 0xd0dc, 0x1120,
-	0x00fe, 0x002e, 0x00ee, 0x0005, 0x7824, 0x00e6, 0x2071, 0x0040,
-	0x712c, 0xd19c, 0x1170, 0x2009, 0x182f, 0x210c, 0x918a, 0x0040,
-	0x0240, 0x7022, 0x2001, 0x1dc0, 0x200c, 0x8108, 0x2102, 0x00ee,
-	0x0058, 0x00ee, 0x2048, 0x702c, 0xa802, 0x2900, 0x702e, 0x70bc,
-	0x8000, 0x70be, 0x080c, 0x8074, 0x782c, 0x9094, 0x0780, 0x190c,
-	0x6cb0, 0xd0a4, 0x19c8, 0x0e04, 0x6a2d, 0x7838, 0x7938, 0x910e,
-	0x1de0, 0x00d6, 0x2069, 0x0000, 0x6836, 0x6833, 0x0013, 0x00de,
-	0x2001, 0x1917, 0x200c, 0xc184, 0x2102, 0x2091, 0x4080, 0x2001,
-	0x0089, 0x2004, 0xd084, 0x190c, 0x11be, 0x2009, 0x1919, 0x200b,
-	0x0000, 0x00fe, 0x002e, 0x00ee, 0x0005, 0x2001, 0x1917, 0x200c,
-	0xc185, 0x2102, 0x00fe, 0x002e, 0x00ee, 0x0005, 0x9016, 0x702c,
-	0x2148, 0xa904, 0xa802, 0x8210, 0x2900, 0x81ff, 0x1dc8, 0x702e,
-	0x70bc, 0x9200, 0x70be, 0x080c, 0x8074, 0x0804, 0x69e4, 0x0096,
-	0x00e6, 0x7824, 0x2048, 0x2071, 0x1800, 0x702c, 0xa802, 0x2900,
-	0x702e, 0x70bc, 0x8000, 0x70be, 0x080c, 0x8074, 0x782c, 0x9094,
-	0x0780, 0x190c, 0x6cb0, 0xd0a4, 0x1d60, 0x00ee, 0x0e04, 0x6a8b,
-	0x7838, 0x7938, 0x910e, 0x1de0, 0x00d6, 0x2069, 0x0000, 0x6836,
-	0x6833, 0x0013, 0x00de, 0x7044, 0xc084, 0x7046, 0x2091, 0x4080,
-	0x2001, 0x0089, 0x2004, 0xd084, 0x190c, 0x11be, 0x2009, 0x1919,
-	0x200b, 0x0000, 0x782c, 0x9094, 0x0780, 0x190c, 0x6cb0, 0xd09c,
-	0x1170, 0x009e, 0x2900, 0x7822, 0xa804, 0x900d, 0x11e0, 0x00fe,
-	0x002e, 0x00ee, 0x0005, 0x7044, 0xc085, 0x7046, 0x0c58, 0x009e,
-	0x2908, 0x7010, 0x8000, 0x7012, 0x7018, 0x904d, 0x711a, 0x0110,
-	0xa902, 0x0008, 0x711e, 0x2148, 0xa804, 0x900d, 0x1120, 0x00fe,
-	0x002e, 0x00ee, 0x0005, 0x2071, 0x1800, 0x9016, 0x702c, 0x2148,
-	0xa904, 0xa802, 0x8210, 0x2900, 0x81ff, 0x1dc8, 0x702e, 0x70bc,
-	0x9200, 0x70be, 0x080c, 0x8074, 0x00fe, 0x002e, 0x00ee, 0x0005,
-	0x2908, 0x7010, 0x8000, 0x7012, 0x7018, 0x904d, 0x711a, 0x0110,
-	0xa902, 0x0008, 0x711e, 0x2148, 0xa804, 0x900d, 0x1904, 0x6b29,
-	0x782c, 0x9094, 0x0780, 0x190c, 0x6cb0, 0xd09c, 0x11b0, 0x701c,
-	0x904d, 0x0198, 0xa84c, 0x9005, 0x1180, 0x7010, 0x8001, 0x7012,
+	0x1dc8, 0x702e, 0x70bc, 0x9200, 0x70be, 0x080c, 0x8053, 0x00fe,
+	0x002e, 0x00ee, 0x0005, 0x2908, 0x7010, 0x8000, 0x7012, 0x7018,
+	0x904d, 0x711a, 0x0110, 0xa902, 0x0008, 0x711e, 0x2148, 0xa804,
+	0x900d, 0x1904, 0x6970, 0x782c, 0x9094, 0x0780, 0x190c, 0x6c9f,
+	0xd09c, 0x1198, 0x701c, 0x904d, 0x0180, 0x7010, 0x8001, 0x7012,
 	0x1108, 0x701a, 0xa800, 0x701e, 0x2900, 0x7822, 0x782c, 0x9094,
-	0x0780, 0x190c, 0x6cb0, 0xd09c, 0x0d50, 0x782c, 0x9094, 0x0780,
-	0x190c, 0x6cb0, 0xd0a4, 0x05c8, 0x00e6, 0x7824, 0x2048, 0x2071,
+	0x0780, 0x190c, 0x6c9f, 0xd09c, 0x0d68, 0x782c, 0x9094, 0x0780,
+	0x190c, 0x6c9f, 0xd0a4, 0x01b0, 0x00e6, 0x7824, 0x2048, 0x2071,
 	0x1800, 0x702c, 0xa802, 0x2900, 0x702e, 0x70bc, 0x8000, 0x70be,
-	0x080c, 0x8074, 0x782c, 0x9094, 0x0780, 0x190c, 0x6cb0, 0xd0a4,
-	0x1d60, 0x00ee, 0x0e04, 0x6b22, 0x7838, 0x7938, 0x910e, 0x1de0,
-	0x00d6, 0x2069, 0x0000, 0x6836, 0x6833, 0x0013, 0x00de, 0x7044,
-	0xc084, 0x7046, 0x2091, 0x4080, 0x2001, 0x0089, 0x2004, 0xd084,
-	0x190c, 0x11be, 0x2009, 0x1919, 0x200b, 0x0000, 0x00fe, 0x002e,
-	0x00ee, 0x0005, 0x7044, 0xc085, 0x7046, 0x00fe, 0x002e, 0x00ee,
-	0x0005, 0x00e6, 0x2071, 0x1800, 0x9016, 0x702c, 0x2148, 0xa904,
-	0xa802, 0x8210, 0x2900, 0x81ff, 0x1dc8, 0x702e, 0x70bc, 0x9200,
-	0x70be, 0x080c, 0x8074, 0x00ee, 0x0804, 0x6ac8, 0x2071, 0x1906,
-	0xa803, 0x0000, 0x2908, 0x7010, 0x8000, 0x7012, 0x7018, 0x904d,
-	0x711a, 0x0110, 0xa902, 0x0008, 0x711e, 0x2148, 0xa804, 0x900d,
-	0x1128, 0x1e04, 0x6b69, 0x002e, 0x00ee, 0x0005, 0x2071, 0x1800,
+	0x080c, 0x8053, 0x782c, 0x9094, 0x0780, 0x190c, 0x6c9f, 0xd0a4,
+	0x1d60, 0x00ee, 0x2071, 0x19d3, 0x703c, 0x9005, 0x1328, 0x2001,
+	0x191a, 0x2004, 0x8005, 0x703e, 0x00fe, 0x002e, 0x00ee, 0x0005,
+	0x00e6, 0x2071, 0x1800, 0x9016, 0x702c, 0x2148, 0xa904, 0xa802,
+	0x8210, 0x2900, 0x81ff, 0x1dc8, 0x702e, 0x70bc, 0x9200, 0x70be,
+	0x080c, 0x8053, 0x00ee, 0x0804, 0x692b, 0xa868, 0xd0fc, 0x1560,
+	0x0096, 0xa804, 0xa807, 0x0000, 0x904d, 0x190c, 0x0fd4, 0x009e,
+	0x0018, 0xa868, 0xd0fc, 0x1500, 0x00e6, 0x0026, 0xa84f, 0x0000,
+	0x00f6, 0x2079, 0x0050, 0x2071, 0x1906, 0xa803, 0x0000, 0x7010,
+	0x9005, 0x1904, 0x6aab, 0x782c, 0x908c, 0x0780, 0x190c, 0x6c9f,
+	0x8004, 0x8004, 0x8004, 0x9084, 0x0003, 0x0002, 0x69b5, 0x6aab,
+	0x69d0, 0x6a3e, 0x080c, 0x0d65, 0x0005, 0x2071, 0x1800, 0x2900,
+	0x7822, 0xa804, 0x900d, 0x1120, 0x00fe, 0x002e, 0x00ee, 0x0005,
 	0x9016, 0x702c, 0x2148, 0xa904, 0xa802, 0x8210, 0x2900, 0x81ff,
-	0x1dc8, 0x702e, 0x70bc, 0x9200, 0x70be, 0x080c, 0x8074, 0x0e04,
-	0x6b53, 0x2071, 0x1906, 0x701c, 0x2048, 0xa84c, 0x900d, 0x0d18,
-	0x2071, 0x0000, 0x7182, 0xa850, 0x7032, 0xa86c, 0x7086, 0x7036,
-	0xa870, 0x708a, 0x2091, 0x4080, 0x2001, 0x0089, 0x2004, 0xd084,
-	0x190c, 0x11be, 0x2071, 0x1906, 0x080c, 0x6c9c, 0x002e, 0x00ee,
-	0x0005, 0x2071, 0x1906, 0xa803, 0x0000, 0x2908, 0x7010, 0x8000,
-	0x7012, 0x7018, 0x904d, 0x711a, 0x0110, 0xa902, 0x0008, 0x711e,
-	0x2148, 0xa804, 0x900d, 0x1118, 0x002e, 0x00ee, 0x0005, 0x2071,
-	0x1800, 0x9016, 0x702c, 0x2148, 0xa904, 0xa802, 0x8210, 0x2900,
-	0x81ff, 0x1dc8, 0x702e, 0x70bc, 0x9200, 0x70be, 0x080c, 0x8074,
-	0x002e, 0x00ee, 0x0005, 0x0006, 0xa87c, 0x0006, 0xa867, 0x0103,
-	0x20a9, 0x001c, 0xa860, 0x20e8, 0xa85c, 0x9080, 0x001d, 0x20a0,
-	0x9006, 0x4004, 0x000e, 0x9084, 0x00ff, 0xa87e, 0x000e, 0xa87a,
-	0xa982, 0x0005, 0x2071, 0x1906, 0x7004, 0x0002, 0x6bd4, 0x6bd5,
-	0x6c9b, 0x6bd5, 0x0d65, 0x6c9b, 0x0005, 0x2001, 0x191a, 0x2004,
-	0x0002, 0x6bdf, 0x6bdf, 0x6c34, 0x6c35, 0x6bdf, 0x6c35, 0x0126,
-	0x2091, 0x8000, 0x1e0c, 0x6cbb, 0x701c, 0x904d, 0x01e0, 0xa84c,
-	0x9005, 0x01d8, 0x0e04, 0x6c03, 0xa94c, 0x2071, 0x0000, 0x7182,
-	0xa850, 0x7032, 0xa86c, 0x7086, 0x7036, 0xa870, 0x708a, 0x2091,
-	0x4080, 0x2001, 0x0089, 0x2004, 0xd084, 0x190c, 0x11be, 0x2071,
-	0x1906, 0x080c, 0x6c9c, 0x012e, 0x0470, 0x2001, 0x005b, 0x2004,
-	0x9094, 0x0780, 0x190c, 0x6cb0, 0xd09c, 0x2071, 0x1906, 0x1510,
-	0x2071, 0x1906, 0x700f, 0x0001, 0xa964, 0x9184, 0x00ff, 0x9086,
-	0x0003, 0x1130, 0x810f, 0x918c, 0x00ff, 0x8101, 0x0108, 0x710e,
-	0x2900, 0x00d6, 0x2069, 0x0050, 0x6822, 0x00de, 0x2071, 0x1906,
-	0x701c, 0x2048, 0x7010, 0x8001, 0x7012, 0xa800, 0x701e, 0x9005,
-	0x1108, 0x701a, 0x012e, 0x0005, 0x0005, 0x00d6, 0x2008, 0x2069,
-	0x19d4, 0x683c, 0x9005, 0x0760, 0x0158, 0x9186, 0x0003, 0x0540,
-	0x2001, 0x1814, 0x2004, 0x2009, 0x1b1e, 0x210c, 0x9102, 0x1500,
-	0x0126, 0x2091, 0x8000, 0x2069, 0x0050, 0x693c, 0x6838, 0x9106,
-	0x0190, 0x0e04, 0x6c67, 0x2069, 0x0000, 0x6837, 0x8040, 0x6833,
-	0x0012, 0x6883, 0x8040, 0x2091, 0x4080, 0x2001, 0x0089, 0x2004,
-	0xd084, 0x190c, 0x11be, 0x2069, 0x19d4, 0x683f, 0xffff, 0x012e,
-	0x00de, 0x0126, 0x2091, 0x8000, 0x1e0c, 0x6d31, 0x701c, 0x904d,
-	0x0540, 0x2001, 0x005b, 0x2004, 0x9094, 0x0780, 0x15c9, 0xd09c,
-	0x1500, 0x2071, 0x1906, 0x700f, 0x0001, 0xa964, 0x9184, 0x00ff,
-	0x9086, 0x0003, 0x1130, 0x810f, 0x918c, 0x00ff, 0x8101, 0x0108,
-	0x710e, 0x2900, 0x00d6, 0x2069, 0x0050, 0x6822, 0x00de, 0x701c,
-	0x2048, 0x7010, 0x8001, 0x7012, 0xa800, 0x701e, 0x9005, 0x1108,
-	0x701a, 0x012e, 0x0005, 0x0005, 0x0126, 0x2091, 0x8000, 0x701c,
-	0x904d, 0x0160, 0x7010, 0x8001, 0x7012, 0xa800, 0x701e, 0x9005,
-	0x1108, 0x701a, 0x012e, 0x080c, 0x1054, 0x0005, 0x012e, 0x0005,
-	0x2091, 0x8000, 0x0e04, 0x6cb2, 0x0006, 0x0016, 0x2001, 0x8004,
-	0x0006, 0x0804, 0x0d6e, 0x0096, 0x00f6, 0x2079, 0x0050, 0x7044,
-	0xd084, 0x01e0, 0xc084, 0x7046, 0x7838, 0x7938, 0x910e, 0x1de0,
-	0x00d6, 0x2069, 0x0000, 0x6836, 0x6833, 0x0013, 0x00de, 0x2091,
-	0x4080, 0x2001, 0x0089, 0x2004, 0xd084, 0x190c, 0x11be, 0x2009,
-	0x1919, 0x200b, 0x0000, 0x00fe, 0x009e, 0x0005, 0x782c, 0x9094,
-	0x0780, 0x1971, 0xd0a4, 0x0db8, 0x2009, 0x1919, 0x2104, 0x8000,
-	0x200a, 0x9082, 0x000f, 0x0e78, 0x00e6, 0x2071, 0x1800, 0x7824,
+	0x1dc8, 0x702e, 0x70bc, 0x9200, 0x70be, 0x080c, 0x8053, 0x0c60,
+	0x2071, 0x1800, 0x2900, 0x7822, 0xa804, 0x900d, 0x1904, 0x6a2d,
+	0x7830, 0xd0dc, 0x1120, 0x00fe, 0x002e, 0x00ee, 0x0005, 0x7824,
 	0x00e6, 0x2071, 0x0040, 0x712c, 0xd19c, 0x1170, 0x2009, 0x182f,
 	0x210c, 0x918a, 0x0040, 0x0240, 0x7022, 0x2001, 0x1dc0, 0x200c,
 	0x8108, 0x2102, 0x00ee, 0x0058, 0x00ee, 0x2048, 0x702c, 0xa802,
-	0x2900, 0x702e, 0x70bc, 0x8000, 0x70be, 0x080c, 0x8074, 0x782c,
-	0x9094, 0x0780, 0x190c, 0x6cb0, 0xd0a4, 0x19c8, 0x7838, 0x7938,
-	0x910e, 0x1de0, 0x00d6, 0x2069, 0x0000, 0x6836, 0x6833, 0x0013,
-	0x00de, 0x2091, 0x4080, 0x2001, 0x0089, 0x2004, 0xd084, 0x190c,
-	0x11be, 0x2009, 0x1919, 0x200b, 0x0000, 0x00ee, 0x00fe, 0x009e,
-	0x0005, 0x00f6, 0x2079, 0x0050, 0x7044, 0xd084, 0x01b8, 0xc084,
-	0x7046, 0x7838, 0x7938, 0x910e, 0x1de0, 0x00d6, 0x2069, 0x0000,
+	0x2900, 0x702e, 0x70bc, 0x8000, 0x70be, 0x080c, 0x8053, 0x782c,
+	0x9094, 0x0780, 0x190c, 0x6c9f, 0xd0a4, 0x19c8, 0x0e04, 0x6a24,
+	0x7838, 0x7938, 0x910e, 0x1de0, 0x00d6, 0x2069, 0x0000, 0x6836,
+	0x6833, 0x0013, 0x00de, 0x2001, 0x1917, 0x200c, 0xc184, 0x2102,
+	0x2091, 0x4080, 0x2001, 0x0089, 0x2004, 0xd084, 0x190c, 0x11c9,
+	0x00fe, 0x002e, 0x00ee, 0x0005, 0x2001, 0x1917, 0x200c, 0xc185,
+	0x2102, 0x00fe, 0x002e, 0x00ee, 0x0005, 0x9016, 0x702c, 0x2148,
+	0xa904, 0xa802, 0x8210, 0x2900, 0x81ff, 0x1dc8, 0x702e, 0x70bc,
+	0x9200, 0x70be, 0x080c, 0x8053, 0x0804, 0x69df, 0x0096, 0x00e6,
+	0x7824, 0x2048, 0x2071, 0x1800, 0x702c, 0xa802, 0x2900, 0x702e,
+	0x70bc, 0x8000, 0x70be, 0x080c, 0x8053, 0x782c, 0x9094, 0x0780,
+	0x190c, 0x6c9f, 0xd0a4, 0x1d60, 0x00ee, 0x0e04, 0x6a7e, 0x7838,
+	0x7938, 0x910e, 0x1de0, 0x00d6, 0x2069, 0x0000, 0x6836, 0x6833,
+	0x0013, 0x00de, 0x7044, 0xc084, 0x7046, 0x2091, 0x4080, 0x2001,
+	0x0089, 0x2004, 0xd084, 0x190c, 0x11c9, 0x782c, 0x9094, 0x0780,
+	0x190c, 0x6c9f, 0xd09c, 0x1170, 0x009e, 0x2900, 0x7822, 0xa804,
+	0x900d, 0x11e0, 0x00fe, 0x002e, 0x00ee, 0x0005, 0x7044, 0xc085,
+	0x7046, 0x0c58, 0x009e, 0x2908, 0x7010, 0x8000, 0x7012, 0x7018,
+	0x904d, 0x711a, 0x0110, 0xa902, 0x0008, 0x711e, 0x2148, 0xa804,
+	0x900d, 0x1120, 0x00fe, 0x002e, 0x00ee, 0x0005, 0x2071, 0x1800,
+	0x9016, 0x702c, 0x2148, 0xa904, 0xa802, 0x8210, 0x2900, 0x81ff,
+	0x1dc8, 0x702e, 0x70bc, 0x9200, 0x70be, 0x080c, 0x8053, 0x00fe,
+	0x002e, 0x00ee, 0x0005, 0x2908, 0x7010, 0x8000, 0x7012, 0x7018,
+	0x904d, 0x711a, 0x0110, 0xa902, 0x0008, 0x711e, 0x2148, 0xa804,
+	0x900d, 0x1904, 0x6b18, 0x782c, 0x9094, 0x0780, 0x190c, 0x6c9f,
+	0xd09c, 0x11b0, 0x701c, 0x904d, 0x0198, 0xa84c, 0x9005, 0x1180,
+	0x7010, 0x8001, 0x7012, 0x1108, 0x701a, 0xa800, 0x701e, 0x2900,
+	0x7822, 0x782c, 0x9094, 0x0780, 0x190c, 0x6c9f, 0xd09c, 0x0d50,
+	0x782c, 0x9094, 0x0780, 0x190c, 0x6c9f, 0xd0a4, 0x05a8, 0x00e6,
+	0x7824, 0x2048, 0x2071, 0x1800, 0x702c, 0xa802, 0x2900, 0x702e,
+	0x70bc, 0x8000, 0x70be, 0x080c, 0x8053, 0x782c, 0x9094, 0x0780,
+	0x190c, 0x6c9f, 0xd0a4, 0x1d60, 0x00ee, 0x0e04, 0x6b11, 0x7838,
+	0x7938, 0x910e, 0x1de0, 0x00d6, 0x2069, 0x0000, 0x6836, 0x6833,
+	0x0013, 0x00de, 0x7044, 0xc084, 0x7046, 0x2091, 0x4080, 0x2001,
+	0x0089, 0x2004, 0xd084, 0x190c, 0x11c9, 0x00fe, 0x002e, 0x00ee,
+	0x0005, 0x7044, 0xc085, 0x7046, 0x00fe, 0x002e, 0x00ee, 0x0005,
+	0x00e6, 0x2071, 0x1800, 0x9016, 0x702c, 0x2148, 0xa904, 0xa802,
+	0x8210, 0x2900, 0x81ff, 0x1dc8, 0x702e, 0x70bc, 0x9200, 0x70be,
+	0x080c, 0x8053, 0x00ee, 0x0804, 0x6abb, 0x2071, 0x1906, 0xa803,
+	0x0000, 0x2908, 0x7010, 0x8000, 0x7012, 0x7018, 0x904d, 0x711a,
+	0x0110, 0xa902, 0x0008, 0x711e, 0x2148, 0xa804, 0x900d, 0x1128,
+	0x1e04, 0x6b58, 0x002e, 0x00ee, 0x0005, 0x2071, 0x1800, 0x9016,
+	0x702c, 0x2148, 0xa904, 0xa802, 0x8210, 0x2900, 0x81ff, 0x1dc8,
+	0x702e, 0x70bc, 0x9200, 0x70be, 0x080c, 0x8053, 0x0e04, 0x6b42,
+	0x2071, 0x1906, 0x701c, 0x2048, 0xa84c, 0x900d, 0x0d18, 0x2071,
+	0x0000, 0x7182, 0xa850, 0x7032, 0xa86c, 0x7086, 0x7036, 0xa870,
+	0x708a, 0x2091, 0x4080, 0x2001, 0x0089, 0x2004, 0xd084, 0x190c,
+	0x11c9, 0x2071, 0x1906, 0x080c, 0x6c8b, 0x002e, 0x00ee, 0x0005,
+	0x2071, 0x1906, 0xa803, 0x0000, 0x2908, 0x7010, 0x8000, 0x7012,
+	0x7018, 0x904d, 0x711a, 0x0110, 0xa902, 0x0008, 0x711e, 0x2148,
+	0xa804, 0x900d, 0x1118, 0x002e, 0x00ee, 0x0005, 0x2071, 0x1800,
+	0x9016, 0x702c, 0x2148, 0xa904, 0xa802, 0x8210, 0x2900, 0x81ff,
+	0x1dc8, 0x702e, 0x70bc, 0x9200, 0x70be, 0x080c, 0x8053, 0x002e,
+	0x00ee, 0x0005, 0x0006, 0xa87c, 0x0006, 0xa867, 0x0103, 0x20a9,
+	0x001c, 0xa860, 0x20e8, 0xa85c, 0x9080, 0x001d, 0x20a0, 0x9006,
+	0x4004, 0x000e, 0x9084, 0x00ff, 0xa87e, 0x000e, 0xa87a, 0xa982,
+	0x0005, 0x2071, 0x1906, 0x7004, 0x0002, 0x6bc3, 0x6bc4, 0x6c8a,
+	0x6bc4, 0x0d65, 0x6c8a, 0x0005, 0x2001, 0x1919, 0x2004, 0x0002,
+	0x6bce, 0x6bce, 0x6c23, 0x6c24, 0x6bce, 0x6c24, 0x0126, 0x2091,
+	0x8000, 0x1e0c, 0x6caa, 0x701c, 0x904d, 0x01e0, 0xa84c, 0x9005,
+	0x01d8, 0x0e04, 0x6bf2, 0xa94c, 0x2071, 0x0000, 0x7182, 0xa850,
+	0x7032, 0xa86c, 0x7086, 0x7036, 0xa870, 0x708a, 0x2091, 0x4080,
+	0x2001, 0x0089, 0x2004, 0xd084, 0x190c, 0x11c9, 0x2071, 0x1906,
+	0x080c, 0x6c8b, 0x012e, 0x0470, 0x2001, 0x005b, 0x2004, 0x9094,
+	0x0780, 0x190c, 0x6c9f, 0xd09c, 0x2071, 0x1906, 0x1510, 0x2071,
+	0x1906, 0x700f, 0x0001, 0xa964, 0x9184, 0x00ff, 0x9086, 0x0003,
+	0x1130, 0x810f, 0x918c, 0x00ff, 0x8101, 0x0108, 0x710e, 0x2900,
+	0x00d6, 0x2069, 0x0050, 0x6822, 0x00de, 0x2071, 0x1906, 0x701c,
+	0x2048, 0x7010, 0x8001, 0x7012, 0xa800, 0x701e, 0x9005, 0x1108,
+	0x701a, 0x012e, 0x0005, 0x0005, 0x00d6, 0x2008, 0x2069, 0x19d3,
+	0x683c, 0x9005, 0x0760, 0x0158, 0x9186, 0x0003, 0x0540, 0x2001,
+	0x1814, 0x2004, 0x2009, 0x1b1d, 0x210c, 0x9102, 0x1500, 0x0126,
+	0x2091, 0x8000, 0x2069, 0x0050, 0x693c, 0x6838, 0x9106, 0x0190,
+	0x0e04, 0x6c56, 0x2069, 0x0000, 0x6837, 0x8040, 0x6833, 0x0012,
+	0x6883, 0x8040, 0x2091, 0x4080, 0x2001, 0x0089, 0x2004, 0xd084,
+	0x190c, 0x11c9, 0x2069, 0x19d3, 0x683f, 0xffff, 0x012e, 0x00de,
+	0x0126, 0x2091, 0x8000, 0x1e0c, 0x6d10, 0x701c, 0x904d, 0x0540,
+	0x2001, 0x005b, 0x2004, 0x9094, 0x0780, 0x15c9, 0xd09c, 0x1500,
+	0x2071, 0x1906, 0x700f, 0x0001, 0xa964, 0x9184, 0x00ff, 0x9086,
+	0x0003, 0x1130, 0x810f, 0x918c, 0x00ff, 0x8101, 0x0108, 0x710e,
+	0x2900, 0x00d6, 0x2069, 0x0050, 0x6822, 0x00de, 0x701c, 0x2048,
+	0x7010, 0x8001, 0x7012, 0xa800, 0x701e, 0x9005, 0x1108, 0x701a,
+	0x012e, 0x0005, 0x0005, 0x0126, 0x2091, 0x8000, 0x701c, 0x904d,
+	0x0160, 0x7010, 0x8001, 0x7012, 0xa800, 0x701e, 0x9005, 0x1108,
+	0x701a, 0x012e, 0x080c, 0x1054, 0x0005, 0x012e, 0x0005, 0x2091,
+	0x8000, 0x0e04, 0x6ca1, 0x0006, 0x0016, 0x2001, 0x8004, 0x0006,
+	0x0804, 0x0d6e, 0x0096, 0x00f6, 0x2079, 0x0050, 0x7044, 0xd084,
+	0x01c0, 0xc084, 0x7046, 0x7838, 0x7938, 0x910e, 0x1de0, 0x00d6,
+	0x2069, 0x0000, 0x6836, 0x6833, 0x0013, 0x00de, 0x2091, 0x4080,
+	0x2001, 0x0089, 0x2004, 0xd084, 0x190c, 0x11c9, 0x00fe, 0x009e,
+	0x0005, 0x782c, 0x9094, 0x0780, 0x1991, 0xd0a4, 0x0db8, 0x00e6,
+	0x2071, 0x1800, 0x7824, 0x00e6, 0x2071, 0x0040, 0x712c, 0xd19c,
+	0x1170, 0x2009, 0x182f, 0x210c, 0x918a, 0x0040, 0x0240, 0x7022,
+	0x2001, 0x1dc0, 0x200c, 0x8108, 0x2102, 0x00ee, 0x0058, 0x00ee,
+	0x2048, 0x702c, 0xa802, 0x2900, 0x702e, 0x70bc, 0x8000, 0x70be,
+	0x080c, 0x8053, 0x782c, 0x9094, 0x0780, 0x190c, 0x6c9f, 0xd0a4,
+	0x19c8, 0x7838, 0x7938, 0x910e, 0x1de0, 0x00d6, 0x2069, 0x0000,
 	0x6836, 0x6833, 0x0013, 0x00de, 0x2091, 0x4080, 0x2001, 0x0089,
-	0x2004, 0xd084, 0x190c, 0x11be, 0x00fe, 0x0005, 0x782c, 0x9094,
-	0x0780, 0x190c, 0x6cb0, 0xd0a4, 0x0db8, 0x00e6, 0x2071, 0x1800,
-	0x7824, 0x2048, 0x702c, 0xa802, 0x2900, 0x702e, 0x70bc, 0x8000,
-	0x70be, 0x080c, 0x8074, 0x782c, 0x9094, 0x0780, 0x190c, 0x6cb0,
-	0xd0a4, 0x1d70, 0x00d6, 0x2069, 0x0050, 0x693c, 0x2069, 0x191a,
-	0x6808, 0x690a, 0x2069, 0x19d4, 0x9102, 0x1118, 0x683c, 0x9005,
-	0x1328, 0x2001, 0x191b, 0x200c, 0x810d, 0x693e, 0x00de, 0x00ee,
-	0x00fe, 0x0005, 0x7094, 0x908a, 0x0029, 0x1a0c, 0x0d65, 0x9082,
-	0x001d, 0x003b, 0x0026, 0x2011, 0x1e00, 0x080c, 0x286d, 0x002e,
-	0x0005, 0x6e5d, 0x6de3, 0x6dff, 0x6e29, 0x6e4c, 0x6e8c, 0x6e9e,
-	0x6dff, 0x6e74, 0x6d9e, 0x6dcc, 0x6d9d, 0x0005, 0x00d6, 0x2069,
-	0x0200, 0x6804, 0x9005, 0x1180, 0x6808, 0x9005, 0x1518, 0x7097,
-	0x0028, 0x2069, 0x1960, 0x2d04, 0x7002, 0x080c, 0x71f8, 0x6028,
-	0x9085, 0x0600, 0x602a, 0x00b0, 0x7097, 0x0028, 0x2069, 0x1960,
-	0x2d04, 0x7002, 0x6028, 0x9085, 0x0600, 0x602a, 0x00e6, 0x0036,
-	0x0046, 0x0056, 0x2071, 0x1a3c, 0x080c, 0x195f, 0x005e, 0x004e,
-	0x003e, 0x00ee, 0x00de, 0x0005, 0x00d6, 0x2069, 0x0200, 0x6804,
-	0x9005, 0x1178, 0x6808, 0x9005, 0x1160, 0x7097, 0x0028, 0x2069,
-	0x1960, 0x2d04, 0x7002, 0x080c, 0x729a, 0x6028, 0x9085, 0x0600,
-	0x602a, 0x00de, 0x0005, 0x0006, 0x2001, 0x0090, 0x080c, 0x2833,
-	0x000e, 0x6124, 0xd1e4, 0x1190, 0x080c, 0x6f0f, 0xd1d4, 0x1160,
-	0xd1dc, 0x1138, 0xd1cc, 0x0150, 0x7097, 0x0020, 0x080c, 0x6f0f,
-	0x0028, 0x7097, 0x001d, 0x0010, 0x7097, 0x001f, 0x0005, 0x2001,
-	0x0088, 0x080c, 0x2833, 0x6124, 0xd1cc, 0x11e8, 0xd1dc, 0x11c0,
-	0xd1e4, 0x1198, 0x9184, 0x1e00, 0x11d8, 0x080c, 0x1989, 0x60e3,
-	0x0001, 0x600c, 0xc0b4, 0x600e, 0x080c, 0x70e3, 0x2001, 0x0080,
-	0x080c, 0x2833, 0x7097, 0x0028, 0x0058, 0x7097, 0x001e, 0x0040,
-	0x7097, 0x001d, 0x0028, 0x7097, 0x0020, 0x0010, 0x7097, 0x001f,
-	0x0005, 0x080c, 0x1989, 0x60e3, 0x0001, 0x600c, 0xc0b4, 0x600e,
-	0x080c, 0x70e3, 0x2001, 0x0080, 0x080c, 0x2833, 0x6124, 0xd1d4,
-	0x1180, 0xd1dc, 0x1158, 0xd1e4, 0x1130, 0x9184, 0x1e00, 0x1158,
-	0x7097, 0x0028, 0x0040, 0x7097, 0x001e, 0x0028, 0x7097, 0x001d,
-	0x0010, 0x7097, 0x001f, 0x0005, 0x2001, 0x00a0, 0x080c, 0x2833,
-	0x6124, 0xd1dc, 0x1138, 0xd1e4, 0x0138, 0x080c, 0x1989, 0x7097,
-	0x001e, 0x0010, 0x7097, 0x001d, 0x0005, 0x080c, 0x6f98, 0x6124,
-	0xd1dc, 0x1188, 0x080c, 0x6f0f, 0x0016, 0x080c, 0x1989, 0x001e,
-	0xd1d4, 0x1128, 0xd1e4, 0x0138, 0x7097, 0x001e, 0x0020, 0x7097,
-	0x001f, 0x080c, 0x6f0f, 0x0005, 0x0006, 0x2001, 0x00a0, 0x080c,
-	0x2833, 0x000e, 0x6124, 0xd1d4, 0x1160, 0xd1cc, 0x1150, 0xd1dc,
-	0x1128, 0xd1e4, 0x0140, 0x7097, 0x001e, 0x0028, 0x7097, 0x001d,
-	0x0010, 0x7097, 0x0021, 0x0005, 0x080c, 0x6f98, 0x6124, 0xd1d4,
-	0x1150, 0xd1dc, 0x1128, 0xd1e4, 0x0140, 0x7097, 0x001e, 0x0028,
-	0x7097, 0x001d, 0x0010, 0x7097, 0x001f, 0x0005, 0x0006, 0x2001,
-	0x0090, 0x080c, 0x2833, 0x000e, 0x6124, 0xd1d4, 0x1178, 0xd1cc,
-	0x1150, 0xd1dc, 0x1128, 0xd1e4, 0x0158, 0x7097, 0x001e, 0x0040,
-	0x7097, 0x001d, 0x0028, 0x7097, 0x0020, 0x0010, 0x7097, 0x001f,
-	0x0005, 0x0016, 0x00c6, 0x00d6, 0x00e6, 0x0126, 0x2061, 0x0100,
-	0x2069, 0x0140, 0x2071, 0x1800, 0x2091, 0x8000, 0x080c, 0x70b7,
-	0x11f8, 0x2001, 0x180c, 0x200c, 0xd1b4, 0x01d0, 0xc1b4, 0x2102,
-	0x0026, 0x2011, 0x0200, 0x080c, 0x286d, 0x002e, 0x080c, 0x2819,
-	0x6024, 0xd0cc, 0x0148, 0x2001, 0x00a0, 0x080c, 0x2833, 0x080c,
-	0x73b7, 0x080c, 0x5cdc, 0x0428, 0x6028, 0xc0cd, 0x602a, 0x0408,
-	0x080c, 0x70d1, 0x0150, 0x080c, 0x70c8, 0x1138, 0x2001, 0x0001,
-	0x080c, 0x23c9, 0x080c, 0x708b, 0x00a0, 0x080c, 0x6f95, 0x0178,
-	0x2001, 0x0001, 0x080c, 0x23c9, 0x7094, 0x9086, 0x001e, 0x0120,
-	0x7094, 0x9086, 0x0022, 0x1118, 0x7097, 0x0025, 0x0010, 0x7097,
-	0x0021, 0x012e, 0x00ee, 0x00de, 0x00ce, 0x001e, 0x0005, 0x0026,
-	0x2011, 0x6f20, 0x080c, 0x825f, 0x002e, 0x0016, 0x0026, 0x2009,
-	0x0064, 0x2011, 0x6f20, 0x080c, 0x8256, 0x002e, 0x001e, 0x0005,
-	0x00e6, 0x00f6, 0x0016, 0x080c, 0x8fb7, 0x2071, 0x1800, 0x080c,
-	0x6eb9, 0x001e, 0x00fe, 0x00ee, 0x0005, 0x0016, 0x0026, 0x0036,
-	0x00c6, 0x00d6, 0x00e6, 0x00f6, 0x0126, 0x080c, 0x8fb7, 0x2061,
-	0x0100, 0x2069, 0x0140, 0x2071, 0x1800, 0x2091, 0x8000, 0x6028,
-	0xc09c, 0x602a, 0x080c, 0x98c8, 0x2011, 0x0003, 0x080c, 0x9339,
-	0x2011, 0x0002, 0x080c, 0x9343, 0x080c, 0x9206, 0x080c, 0x820b,
-	0x0036, 0x901e, 0x080c, 0x9286, 0x003e, 0x080c, 0x98e4, 0x60e3,
-	0x0000, 0x080c, 0xd5fb, 0x080c, 0xd616, 0x2009, 0x0004, 0x080c,
-	0x281f, 0x080c, 0x273f, 0x2001, 0x1800, 0x2003, 0x0004, 0x2011,
-	0x0008, 0x080c, 0x286d, 0x2011, 0x6f20, 0x080c, 0x825f, 0x080c,
-	0x70d1, 0x0118, 0x9006, 0x080c, 0x2833, 0x080c, 0x0bab, 0x2001,
-	0x0001, 0x080c, 0x23c9, 0x012e, 0x00fe, 0x00ee, 0x00de, 0x00ce,
-	0x003e, 0x002e, 0x001e, 0x0005, 0x0026, 0x00e6, 0x2011, 0x6f2d,
-	0x2071, 0x19d4, 0x701c, 0x9206, 0x1118, 0x7018, 0x9005, 0x0110,
-	0x9085, 0x0001, 0x00ee, 0x002e, 0x0005, 0x6020, 0xd09c, 0x0005,
-	0x6800, 0x9084, 0xfffe, 0x9086, 0x00c0, 0x01b8, 0x2001, 0x00c0,
-	0x080c, 0x2833, 0x0156, 0x20a9, 0x002d, 0x1d04, 0x6fa5, 0x2091,
-	0x6000, 0x1f04, 0x6fa5, 0x015e, 0x00d6, 0x2069, 0x1800, 0x6898,
-	0x8001, 0x0220, 0x0118, 0x689a, 0x00de, 0x0005, 0x689b, 0x0014,
-	0x68e8, 0xd0dc, 0x0dc8, 0x6800, 0x9086, 0x0001, 0x1da8, 0x080c,
-	0x826b, 0x0c90, 0x00c6, 0x00d6, 0x00e6, 0x2061, 0x0100, 0x2069,
-	0x0140, 0x2071, 0x1800, 0x080c, 0x73c6, 0x2001, 0x193e, 0x2003,
-	0x0000, 0x9006, 0x7096, 0x60e2, 0x6886, 0x080c, 0x2498, 0x9006,
-	0x080c, 0x2833, 0x080c, 0x5b97, 0x0026, 0x2011, 0xffff, 0x080c,
-	0x286d, 0x002e, 0x602b, 0x182c, 0x00ee, 0x00de, 0x00ce, 0x0005,
-	0x00c6, 0x00d6, 0x00e6, 0x2061, 0x0100, 0x2069, 0x0140, 0x2071,
-	0x1800, 0x2001, 0x194e, 0x200c, 0x9186, 0x0000, 0x0158, 0x9186,
-	0x0001, 0x0158, 0x9186, 0x0002, 0x0158, 0x9186, 0x0003, 0x0158,
-	0x0804, 0x707b, 0x7097, 0x0022, 0x0040, 0x7097, 0x0021, 0x0028,
-	0x7097, 0x0023, 0x0010, 0x7097, 0x0024, 0x60e3, 0x0000, 0x6887,
-	0x0001, 0x2001, 0x0001, 0x080c, 0x2498, 0x080c, 0x98c8, 0x0026,
-	0x080c, 0x9b6d, 0x002e, 0x080c, 0x98e4, 0x7000, 0x908e, 0x0004,
-	0x0118, 0x602b, 0x0028, 0x0010, 0x602b, 0x0020, 0x0156, 0x0126,
-	0x2091, 0x8000, 0x20a9, 0x0005, 0x6024, 0xd0ac, 0x0150, 0x012e,
-	0x015e, 0x080c, 0xbf61, 0x0118, 0x9006, 0x080c, 0x285d, 0x0804,
-	0x7087, 0x6800, 0x9084, 0x00a1, 0xc0bd, 0x6802, 0x080c, 0x2819,
-	0x6904, 0xd1d4, 0x1140, 0x2001, 0x0100, 0x080c, 0x2833, 0x1f04,
-	0x702c, 0x080c, 0x710e, 0x012e, 0x015e, 0x080c, 0x70c8, 0x0170,
-	0x6044, 0x9005, 0x0130, 0x080c, 0x710e, 0x9006, 0x8001, 0x1df0,
-	0x0028, 0x6804, 0xd0d4, 0x1110, 0x080c, 0x710e, 0x080c, 0xbf61,
-	0x0118, 0x9006, 0x080c, 0x285d, 0x0016, 0x0026, 0x7000, 0x908e,
-	0x0004, 0x0130, 0x2009, 0x00c8, 0x2011, 0x6f2d, 0x080c, 0x821d,
-	0x002e, 0x001e, 0x080c, 0x806b, 0x7034, 0xc085, 0x7036, 0x2001,
-	0x194e, 0x2003, 0x0004, 0x080c, 0x6d82, 0x080c, 0x70c8, 0x0138,
-	0x6804, 0xd0d4, 0x1120, 0xd0dc, 0x1100, 0x080c, 0x73bc, 0x00ee,
-	0x00de, 0x00ce, 0x0005, 0x00c6, 0x00d6, 0x00e6, 0x2061, 0x0100,
-	0x2069, 0x0140, 0x2071, 0x1800, 0x080c, 0x8082, 0x080c, 0x8074,
-	0x080c, 0x73c6, 0x2001, 0x193e, 0x2003, 0x0000, 0x9006, 0x7096,
-	0x60e2, 0x6886, 0x080c, 0x2498, 0x9006, 0x080c, 0x2833, 0x6043,
-	0x0090, 0x6043, 0x0010, 0x0026, 0x2011, 0xffff, 0x080c, 0x286d,
-	0x002e, 0x602b, 0x182c, 0x00ee, 0x00de, 0x00ce, 0x0005, 0x0006,
-	0x2001, 0x194d, 0x2004, 0x9086, 0xaaaa, 0x000e, 0x0005, 0x0006,
-	0x080c, 0x5391, 0x9084, 0x0030, 0x9086, 0x0000, 0x000e, 0x0005,
-	0x0006, 0x080c, 0x5391, 0x9084, 0x0030, 0x9086, 0x0030, 0x000e,
-	0x0005, 0x0006, 0x080c, 0x5391, 0x9084, 0x0030, 0x9086, 0x0010,
-	0x000e, 0x0005, 0x0006, 0x080c, 0x5391, 0x9084, 0x0030, 0x9086,
-	0x0020, 0x000e, 0x0005, 0x0036, 0x0016, 0x2001, 0x180c, 0x2004,
-	0x908c, 0x0013, 0x0180, 0x0020, 0x080c, 0x24b8, 0x900e, 0x0028,
-	0x080c, 0x665f, 0x1dc8, 0x2009, 0x0002, 0x2019, 0x0028, 0x080c,
-	0x2fc5, 0x9006, 0x0019, 0x001e, 0x003e, 0x0005, 0x00e6, 0x2071,
-	0x180c, 0x2e04, 0x0130, 0x080c, 0xbf5a, 0x1128, 0x9085, 0x0010,
-	0x0010, 0x9084, 0xffef, 0x2072, 0x00ee, 0x0005, 0x6050, 0x0006,
-	0x60ec, 0x0006, 0x600c, 0x0006, 0x6004, 0x0006, 0x6028, 0x0006,
-	0x602f, 0x0100, 0x602f, 0x0000, 0x602f, 0x0040, 0x602f, 0x0000,
-	0x20a9, 0x0002, 0x080c, 0x27fa, 0x0026, 0x2011, 0x0040, 0x080c,
-	0x286d, 0x002e, 0x000e, 0x602a, 0x000e, 0x6006, 0x000e, 0x600e,
-	0x000e, 0x60ee, 0x60e3, 0x0000, 0x6887, 0x0001, 0x2001, 0x0001,
-	0x080c, 0x2498, 0x2001, 0x00a0, 0x0006, 0x080c, 0xbf61, 0x000e,
-	0x0130, 0x080c, 0x2851, 0x9006, 0x080c, 0x285d, 0x0010, 0x080c,
-	0x2833, 0x000e, 0x6052, 0x6050, 0x0006, 0xc0e5, 0x6052, 0x00f6,
-	0x2079, 0x0100, 0x080c, 0x27aa, 0x00fe, 0x000e, 0x6052, 0x0005,
-	0x0156, 0x0016, 0x0026, 0x0036, 0x00c6, 0x00d6, 0x00e6, 0x2061,
-	0x0100, 0x2069, 0x0140, 0x2071, 0x1800, 0x080c, 0x9926, 0x0158,
-	0x2001, 0x0386, 0x2004, 0xd0b4, 0x1130, 0x2001, 0x0016, 0x080c,
-	0x98b9, 0x0804, 0x71ea, 0x2001, 0x180c, 0x200c, 0xc1c4, 0x2102,
-	0x6028, 0x9084, 0xe1ff, 0x602a, 0x2011, 0x0200, 0x080c, 0x286d,
-	0x2001, 0x0090, 0x080c, 0x2833, 0x20a9, 0x0366, 0x6024, 0xd0cc,
-	0x1558, 0x1d04, 0x7186, 0x2091, 0x6000, 0x1f04, 0x7186, 0x080c,
-	0x98c8, 0x2011, 0x0003, 0x080c, 0x9339, 0x2011, 0x0002, 0x080c,
-	0x9343, 0x080c, 0x9206, 0x901e, 0x080c, 0x9286, 0x2001, 0x0386,
-	0x2003, 0x7000, 0x080c, 0x98e4, 0x2001, 0x00a0, 0x080c, 0x2833,
-	0x080c, 0x73b7, 0x080c, 0x5cdc, 0x080c, 0xbf61, 0x0110, 0x080c,
-	0x0cd1, 0x9085, 0x0001, 0x04e0, 0x2001, 0x0386, 0x2004, 0xd0ac,
-	0x0110, 0x080c, 0x1989, 0x60e3, 0x0000, 0x2001, 0x0002, 0x080c,
-	0x2498, 0x60e2, 0x2001, 0x0080, 0x080c, 0x2833, 0x20a9, 0x0366,
-	0x2011, 0x1e00, 0x080c, 0x286d, 0x2009, 0x1e00, 0x080c, 0x2819,
-	0x6024, 0x910c, 0x0140, 0x1d04, 0x71c8, 0x2091, 0x6000, 0x1f04,
-	0x71c8, 0x0804, 0x718f, 0x2001, 0x0386, 0x2003, 0x7000, 0x6028,
-	0x9085, 0x1e00, 0x602a, 0x70b0, 0x9005, 0x1118, 0x6887, 0x0001,
-	0x0008, 0x6886, 0x080c, 0xbf61, 0x0110, 0x080c, 0x0cd1, 0x9006,
-	0x00ee, 0x00de, 0x00ce, 0x003e, 0x002e, 0x001e, 0x015e, 0x0005,
-	0x0156, 0x0016, 0x0026, 0x0036, 0x00c6, 0x00d6, 0x00e6, 0x2061,
-	0x0100, 0x2071, 0x1800, 0x7000, 0x9086, 0x0003, 0x1168, 0x2001,
-	0x020b, 0x2004, 0x9084, 0x5540, 0x9086, 0x5540, 0x1128, 0x2069,
-	0x1a47, 0x2d04, 0x8000, 0x206a, 0x2069, 0x0140, 0x6020, 0x9084,
-	0x00c0, 0x0120, 0x6884, 0x9005, 0x1904, 0x7261, 0x2001, 0x0088,
-	0x080c, 0x2833, 0x9006, 0x60e2, 0x6886, 0x080c, 0x2498, 0x2069,
-	0x0200, 0x6804, 0x9005, 0x1118, 0x6808, 0x9005, 0x01d0, 0x6028,
-	0x9084, 0xfbff, 0x602a, 0x2011, 0x0400, 0x080c, 0x286d, 0x2069,
-	0x1960, 0x7000, 0x206a, 0x7097, 0x0026, 0x7003, 0x0001, 0x20a9,
-	0x0002, 0x1d04, 0x7241, 0x2091, 0x6000, 0x1f04, 0x7241, 0x0804,
-	0x7292, 0x2069, 0x0140, 0x20a9, 0x0384, 0x2011, 0x1e00, 0x080c,
-	0x286d, 0x2009, 0x1e00, 0x080c, 0x2819, 0x6024, 0x910c, 0x0528,
-	0x9084, 0x1a00, 0x1510, 0x1d04, 0x724d, 0x2091, 0x6000, 0x1f04,
-	0x724d, 0x080c, 0x98c8, 0x2011, 0x0003, 0x080c, 0x9339, 0x2011,
-	0x0002, 0x080c, 0x9343, 0x080c, 0x9206, 0x901e, 0x080c, 0x9286,
-	0x080c, 0x98e4, 0x2001, 0x00a0, 0x080c, 0x2833, 0x080c, 0x73b7,
-	0x080c, 0x5cdc, 0x9085, 0x0001, 0x00a8, 0x2001, 0x0080, 0x080c,
-	0x2833, 0x2069, 0x0140, 0x60e3, 0x0000, 0x70b0, 0x9005, 0x1118,
-	0x6887, 0x0001, 0x0008, 0x6886, 0x2001, 0x0002, 0x080c, 0x2498,
-	0x60e2, 0x9006, 0x00ee, 0x00de, 0x00ce, 0x003e, 0x002e, 0x001e,
-	0x015e, 0x0005, 0x0156, 0x0016, 0x0026, 0x0036, 0x00c6, 0x00d6,
-	0x00e6, 0x2061, 0x0100, 0x2071, 0x1800, 0x6020, 0x9084, 0x00c0,
-	0x01e8, 0x080c, 0x98c8, 0x2011, 0x0003, 0x080c, 0x9339, 0x2011,
-	0x0002, 0x080c, 0x9343, 0x080c, 0x9206, 0x901e, 0x080c, 0x9286,
-	0x080c, 0x98e4, 0x2069, 0x0140, 0x2001, 0x00a0, 0x080c, 0x2833,
-	0x080c, 0x73b7, 0x080c, 0x5cdc, 0x0804, 0x7334, 0x2001, 0x180c,
-	0x200c, 0xd1b4, 0x1160, 0xc1b5, 0x2102, 0x080c, 0x6f15, 0x2069,
-	0x0140, 0x2001, 0x0080, 0x080c, 0x2833, 0x60e3, 0x0000, 0x2069,
-	0x0200, 0x6804, 0x9005, 0x1118, 0x6808, 0x9005, 0x0190, 0x6028,
-	0x9084, 0xfdff, 0x602a, 0x2011, 0x0200, 0x080c, 0x286d, 0x2069,
-	0x1960, 0x7000, 0x206a, 0x7097, 0x0027, 0x7003, 0x0001, 0x0804,
-	0x7334, 0x2011, 0x1e00, 0x080c, 0x286d, 0x2009, 0x1e00, 0x080c,
-	0x2819, 0x6024, 0x910c, 0x01c8, 0x9084, 0x1c00, 0x11b0, 0x1d04,
-	0x72f1, 0x0006, 0x0016, 0x00c6, 0x00d6, 0x00e6, 0x080c, 0x80b3,
-	0x00ee, 0x00de, 0x00ce, 0x001e, 0x000e, 0x00e6, 0x2071, 0x19d4,
-	0x7018, 0x00ee, 0x9005, 0x19e8, 0x01f8, 0x0026, 0x2011, 0x6f2d,
-	0x080c, 0x8159, 0x2011, 0x6f20, 0x080c, 0x825f, 0x002e, 0x2069,
-	0x0140, 0x60e3, 0x0000, 0x70b0, 0x9005, 0x1118, 0x6887, 0x0001,
-	0x0008, 0x6886, 0x2001, 0x0002, 0x080c, 0x2498, 0x60e2, 0x2001,
-	0x180c, 0x200c, 0xc1b4, 0x2102, 0x00ee, 0x00de, 0x00ce, 0x003e,
-	0x002e, 0x001e, 0x015e, 0x0005, 0x0156, 0x0016, 0x0026, 0x0036,
-	0x0046, 0x00c6, 0x00e6, 0x2061, 0x0100, 0x2071, 0x1800, 0x080c,
-	0xbf5a, 0x1904, 0x73a1, 0x7130, 0xd184, 0x1170, 0x080c, 0x3186,
-	0x0138, 0xc18d, 0x7132, 0x2011, 0x1854, 0x2214, 0xd2ac, 0x1120,
-	0x7030, 0xd08c, 0x0904, 0x73a1, 0x2011, 0x1854, 0x220c, 0x0438,
-	0x0016, 0x2019, 0x000e, 0x080c, 0xd1eb, 0x0156, 0x00b6, 0x20a9,
-	0x007f, 0x900e, 0x9186, 0x007e, 0x01a0, 0x9186, 0x0080, 0x0188,
-	0x080c, 0x6270, 0x1170, 0x2120, 0x9006, 0x0016, 0x2009, 0x000e,
-	0x080c, 0xd273, 0x2009, 0x0001, 0x2011, 0x0100, 0x080c, 0x83eb,
-	0x001e, 0x8108, 0x1f04, 0x736a, 0x00be, 0x015e, 0x001e, 0xd1ac,
-	0x1148, 0x0016, 0x2009, 0x0002, 0x2019, 0x0004, 0x080c, 0x2fc5,
-	0x001e, 0x0078, 0x0156, 0x00b6, 0x20a9, 0x007f, 0x900e, 0x080c,
-	0x6270, 0x1110, 0x080c, 0x5cf6, 0x8108, 0x1f04, 0x7397, 0x00be,
-	0x015e, 0x080c, 0x1989, 0x080c, 0x98c8, 0x080c, 0x9b6d, 0x080c,
-	0x98e4, 0x60e3, 0x0000, 0x080c, 0x5cdc, 0x080c, 0x6fe8, 0x00ee,
-	0x00ce, 0x004e, 0x003e, 0x002e, 0x001e, 0x015e, 0x0005, 0x2001,
-	0x194e, 0x2003, 0x0001, 0x0005, 0x2001, 0x194e, 0x2003, 0x0000,
-	0x0005, 0x2001, 0x194d, 0x2003, 0xaaaa, 0x0005, 0x2001, 0x194d,
-	0x2003, 0x0000, 0x0005, 0x2071, 0x18f0, 0x7003, 0x0000, 0x7007,
-	0x0000, 0x080c, 0x103b, 0x090c, 0x0d65, 0xa8ab, 0xdcb0, 0x2900,
-	0x704e, 0x080c, 0x103b, 0x090c, 0x0d65, 0xa8ab, 0xdcb0, 0x2900,
-	0x7052, 0xa867, 0x0000, 0xa86b, 0x0001, 0xa89f, 0x0000, 0x0005,
-	0x00e6, 0x2071, 0x0040, 0x6848, 0x9005, 0x1118, 0x9085, 0x0001,
-	0x04b0, 0x6840, 0x9005, 0x0150, 0x04a1, 0x6a50, 0x9200, 0x7002,
-	0x6854, 0x9101, 0x7006, 0x9006, 0x7012, 0x7016, 0x6850, 0x7002,
-	0x6854, 0x7006, 0x6858, 0x700a, 0x685c, 0x700e, 0x6840, 0x9005,
-	0x1110, 0x7012, 0x7016, 0x6848, 0x701a, 0x701c, 0x9085, 0x0040,
-	0x701e, 0x2001, 0x0019, 0x7036, 0x702b, 0x0001, 0x2001, 0x0004,
-	0x200c, 0x918c, 0xfff7, 0x918d, 0x8000, 0x2102, 0x00d6, 0x2069,
-	0x18f0, 0x6807, 0x0001, 0x00de, 0x080c, 0x79c3, 0x9006, 0x00ee,
-	0x0005, 0x900e, 0x0156, 0x20a9, 0x0006, 0x8003, 0x818d, 0x1f04,
-	0x742d, 0x015e, 0x0005, 0x2079, 0x0040, 0x2071, 0x18f0, 0x7004,
-	0x0002, 0x7443, 0x7444, 0x748f, 0x74ea, 0x762b, 0x7441, 0x7441,
-	0x7655, 0x080c, 0x0d65, 0x0005, 0x2079, 0x0040, 0x2001, 0x1dc0,
-	0x2003, 0x0000, 0x782c, 0x908c, 0x0780, 0x190c, 0x7a4f, 0xd0a4,
-	0x0570, 0x2001, 0x1dc0, 0x2004, 0x9082, 0x0080, 0x1640, 0x1d04,
-	0x7461, 0x2001, 0x19d7, 0x200c, 0x8109, 0x0508, 0x2091, 0x6000,
-	0x2102, 0x7824, 0x2048, 0x9006, 0xa802, 0xa806, 0xa864, 0x9084,
-	0x00ff, 0x908a, 0x0040, 0x0608, 0x00b8, 0x2001, 0x1800, 0x200c,
-	0x9186, 0x0003, 0x1160, 0x7104, 0x9186, 0x0004, 0x0140, 0x9186,
-	0x0007, 0x0128, 0x9186, 0x0003, 0x1968, 0x080c, 0x74ea, 0x782c,
-	0xd09c, 0x090c, 0x79c3, 0x0005, 0x9082, 0x005a, 0x1218, 0x2100,
-	0x003b, 0x0c18, 0x080c, 0x7520, 0x0c90, 0x00e3, 0x08f0, 0x0005,
-	0x7520, 0x7520, 0x7520, 0x7520, 0x7520, 0x7520, 0x7520, 0x7520,
-	0x7542, 0x7520, 0x7520, 0x7520, 0x7520, 0x7520, 0x7520, 0x7520,
-	0x7520, 0x7520, 0x7520, 0x7520, 0x7520, 0x7520, 0x7520, 0x7520,
-	0x7520, 0x7520, 0x7520, 0x7520, 0x752c, 0x7520, 0x772a, 0x7520,
-	0x7520, 0x7520, 0x7542, 0x7520, 0x752c, 0x776b, 0x77ac, 0x77f3,
-	0x7807, 0x7520, 0x7520, 0x7542, 0x752c, 0x7520, 0x7520, 0x75ff,
-	0x78b2, 0x78cd, 0x7520, 0x7542, 0x7520, 0x7520, 0x7520, 0x7520,
-	0x75f5, 0x78cd, 0x7520, 0x7520, 0x7520, 0x7520, 0x7520, 0x7520,
-	0x7520, 0x7520, 0x7520, 0x7556, 0x7520, 0x7520, 0x7520, 0x7520,
-	0x7520, 0x7520, 0x7520, 0x7520, 0x7520, 0x79f3, 0x7520, 0x7520,
-	0x7520, 0x7520, 0x7520, 0x756a, 0x7520, 0x7520, 0x7520, 0x7520,
-	0x7520, 0x7520, 0x2079, 0x0040, 0x7004, 0x9086, 0x0003, 0x1198,
-	0x782c, 0x080c, 0x79ec, 0xd0a4, 0x0170, 0x7824, 0x2048, 0x9006,
-	0xa802, 0xa806, 0xa864, 0x9084, 0x00ff, 0x908a, 0x001a, 0x1210,
-	0x002b, 0x0c50, 0x00e9, 0x080c, 0x79c3, 0x0005, 0x7520, 0x752c,
-	0x7716, 0x7520, 0x752c, 0x7520, 0x752c, 0x752c, 0x7520, 0x752c,
-	0x7716, 0x752c, 0x752c, 0x752c, 0x752c, 0x752c, 0x7520, 0x752c,
-	0x7716, 0x7520, 0x7520, 0x752c, 0x7520, 0x7520, 0x7520, 0x752c,
-	0x00e6, 0x2071, 0x18f0, 0x2009, 0x0400, 0x0071, 0x00ee, 0x0005,
-	0x2009, 0x1000, 0x0049, 0x0005, 0x2009, 0x2000, 0x0029, 0x0005,
-	0x2009, 0x0800, 0x0009, 0x0005, 0x7007, 0x0001, 0xa868, 0x9084,
-	0x00ff, 0x9105, 0xa86a, 0x0126, 0x2091, 0x8000, 0x080c, 0x6996,
-	0x012e, 0x0005, 0xa864, 0x8007, 0x9084, 0x00ff, 0x0d08, 0x8001,
-	0x1120, 0x7007, 0x0001, 0x0804, 0x76d4, 0x7007, 0x0003, 0x7012,
-	0x2900, 0x7016, 0x701a, 0x704b, 0x76d4, 0x0005, 0xa864, 0x8007,
-	0x9084, 0x00ff, 0x0968, 0x8001, 0x1120, 0x7007, 0x0001, 0x0804,
-	0x76ef, 0x7007, 0x0003, 0x7012, 0x2900, 0x7016, 0x701a, 0x704b,
-	0x76ef, 0x0005, 0xa864, 0x8007, 0x9084, 0x00ff, 0x9086, 0x0001,
-	0x1904, 0x7528, 0x7007, 0x0001, 0x2009, 0x1833, 0x210c, 0x81ff,
-	0x1904, 0x75cc, 0xa994, 0x9186, 0x006f, 0x0188, 0x9186, 0x0074,
-	0x15b0, 0x0026, 0x2011, 0x0010, 0x080c, 0x668b, 0x002e, 0x0578,
-	0x0016, 0xa998, 0x080c, 0x66d5, 0x001e, 0x1548, 0x0400, 0x080c,
-	0x70b7, 0x0140, 0xa897, 0x4005, 0xa89b, 0x0016, 0x2001, 0x0030,
-	0x900e, 0x0438, 0x0026, 0x2011, 0x8008, 0x080c, 0x668b, 0x002e,
-	0x01b0, 0x0016, 0x0026, 0x0036, 0xa998, 0xaaa0, 0xab9c, 0x918d,
-	0x8000, 0x080c, 0x66d5, 0x003e, 0x002e, 0x001e, 0x1140, 0xa897,
-	0x4005, 0xa89b, 0x4009, 0x2001, 0x0030, 0x900e, 0x0050, 0xa868,
-	0x9084, 0x00ff, 0xa86a, 0xa883, 0x0000, 0x080c, 0x5f07, 0x1108,
-	0x0005, 0x0126, 0x2091, 0x8000, 0xa867, 0x0139, 0xa87a, 0xa982,
-	0x080c, 0x6996, 0x012e, 0x0ca0, 0xa994, 0x9186, 0x0071, 0x0904,
-	0x757a, 0x9186, 0x0064, 0x0904, 0x757a, 0x9186, 0x007c, 0x0904,
-	0x757a, 0x9186, 0x0028, 0x0904, 0x757a, 0x9186, 0x0038, 0x0904,
-	0x757a, 0x9186, 0x0078, 0x0904, 0x757a, 0x9186, 0x005f, 0x0904,
-	0x757a, 0x9186, 0x0056, 0x0904, 0x757a, 0xa897, 0x4005, 0xa89b,
-	0x0001, 0x2001, 0x0030, 0x900e, 0x0860, 0xa87c, 0x9084, 0x00c0,
-	0x9086, 0x00c0, 0x1120, 0x7007, 0x0001, 0x0804, 0x78e4, 0x2900,
-	0x7016, 0x701a, 0x20a9, 0x0004, 0xa860, 0x20e0, 0xa85c, 0x9080,
-	0x0030, 0x2098, 0x7050, 0x2040, 0xa060, 0x20e8, 0xa05c, 0x9080,
-	0x0023, 0x20a0, 0x4003, 0xa888, 0x7012, 0x9082, 0x0401, 0x1a04,
-	0x7530, 0xaab4, 0x928a, 0x0002, 0x1a04, 0x7530, 0x82ff, 0x1138,
-	0xa8b8, 0xa9bc, 0x9105, 0x0118, 0x2001, 0x7692, 0x0018, 0x9280,
-	0x7688, 0x2005, 0x7056, 0x7010, 0x9015, 0x0904, 0x7673, 0x080c,
-	0x103b, 0x1118, 0x7007, 0x0004, 0x0005, 0x2900, 0x7022, 0x7054,
-	0x2060, 0xe000, 0xa866, 0x7050, 0x2040, 0xa95c, 0xe004, 0x9100,
-	0xa076, 0xa860, 0xa072, 0xe008, 0x920a, 0x1210, 0x900e, 0x2200,
-	0x7112, 0xe20c, 0x8003, 0x800b, 0x9296, 0x0004, 0x0108, 0x9108,
-	0xa17a, 0x810b, 0xa17e, 0x080c, 0x110c, 0xa06c, 0x908e, 0x0100,
-	0x0170, 0x9086, 0x0200, 0x0118, 0x7007, 0x0007, 0x0005, 0x7020,
-	0x2048, 0x080c, 0x1054, 0x7014, 0x2048, 0x0804, 0x7530, 0x7020,
-	0x2048, 0x7018, 0xa802, 0xa807, 0x0000, 0x2908, 0x2048, 0xa906,
-	0x711a, 0x0804, 0x762b, 0x7014, 0x2048, 0x7007, 0x0001, 0xa8b4,
-	0x9005, 0x1128, 0xa8b8, 0xa9bc, 0x9105, 0x0108, 0x00b9, 0xa864,
-	0x9084, 0x00ff, 0x9086, 0x001e, 0x0904, 0x78e4, 0x0804, 0x76d4,
-	0x768a, 0x768e, 0x0002, 0x001d, 0x0007, 0x0004, 0x000a, 0x001b,
-	0x0005, 0x0006, 0x000a, 0x001d, 0x0005, 0x0004, 0x0076, 0x0066,
-	0xafb8, 0xaebc, 0xa804, 0x2050, 0xb0c0, 0xb0e2, 0xb0bc, 0xb0de,
-	0xb0b8, 0xb0d2, 0xb0b4, 0xb0ce, 0xb6da, 0xb7d6, 0xb0b0, 0xb0ca,
-	0xb0ac, 0xb0c6, 0xb0a8, 0xb0ba, 0xb0a4, 0xb0b6, 0xb6c2, 0xb7be,
-	0xb0a0, 0xb0b2, 0xb09c, 0xb0ae, 0xb098, 0xb0a2, 0xb094, 0xb09e,
-	0xb6aa, 0xb7a6, 0xb090, 0xb09a, 0xb08c, 0xb096, 0xb088, 0xb08a,
-	0xb084, 0xb086, 0xb692, 0xb78e, 0xb080, 0xb082, 0xb07c, 0xb07e,
-	0xb078, 0xb072, 0xb074, 0xb06e, 0xb67a, 0xb776, 0xb004, 0x9055,
-	0x1958, 0x006e, 0x007e, 0x0005, 0x2009, 0x1833, 0x210c, 0x81ff,
-	0x1178, 0x080c, 0x5d56, 0x1108, 0x0005, 0x080c, 0x6bb3, 0x0126,
-	0x2091, 0x8000, 0x080c, 0xbb45, 0x080c, 0x6996, 0x012e, 0x0ca0,
-	0x080c, 0xbf5a, 0x1d70, 0x2001, 0x0028, 0x900e, 0x0c70, 0x2009,
-	0x1833, 0x210c, 0x81ff, 0x11d8, 0xa888, 0x9005, 0x01e0, 0xa883,
-	0x0000, 0xa87c, 0xd0f4, 0x0120, 0x080c, 0x5e69, 0x1138, 0x0005,
-	0x9006, 0xa87a, 0x080c, 0x5de4, 0x1108, 0x0005, 0x0126, 0x2091,
-	0x8000, 0xa87a, 0xa982, 0x080c, 0x6996, 0x012e, 0x0cb0, 0x2001,
-	0x0028, 0x900e, 0x0c98, 0x2001, 0x0000, 0x0c80, 0x7018, 0xa802,
-	0x2908, 0x2048, 0xa906, 0x711a, 0x7010, 0x8001, 0x7012, 0x0118,
-	0x7007, 0x0003, 0x0030, 0x7014, 0x2048, 0x7007, 0x0001, 0x7048,
-	0x080f, 0x0005, 0x00b6, 0x7007, 0x0001, 0xa974, 0xa878, 0x9084,
-	0x00ff, 0x9096, 0x0004, 0x0540, 0x20a9, 0x0001, 0x9096, 0x0001,
-	0x0190, 0x900e, 0x20a9, 0x0800, 0x9096, 0x0002, 0x0160, 0x9005,
-	0x11d8, 0xa974, 0x080c, 0x6270, 0x11b8, 0x0066, 0xae80, 0x080c,
-	0x6380, 0x006e, 0x0088, 0x0046, 0x2011, 0x180c, 0x2224, 0xc484,
-	0x2412, 0x004e, 0x00c6, 0x080c, 0x6270, 0x1110, 0x080c, 0x654f,
-	0x8108, 0x1f04, 0x7753, 0x00ce, 0xa87c, 0xd084, 0x1120, 0x080c,
-	0x1054, 0x00be, 0x0005, 0x0126, 0x2091, 0x8000, 0x080c, 0x6996,
-	0x012e, 0x00be, 0x0005, 0x0126, 0x2091, 0x8000, 0x7007, 0x0001,
-	0x080c, 0x6663, 0x0580, 0x2061, 0x1a3f, 0x6100, 0xd184, 0x0178,
-	0xa888, 0x9084, 0x00ff, 0x1550, 0x6000, 0xd084, 0x0520, 0x6004,
-	0x9005, 0x1538, 0x6003, 0x0000, 0x600b, 0x0000, 0x00c8, 0x2011,
-	0x0001, 0xa890, 0x9005, 0x1110, 0x2001, 0x001e, 0x8000, 0x6016,
-	0xa888, 0x9084, 0x00ff, 0x0178, 0x6006, 0xa888, 0x8007, 0x9084,
-	0x00ff, 0x0148, 0x600a, 0xa888, 0x8000, 0x1108, 0xc28d, 0x6202,
-	0x012e, 0x0804, 0x79ad, 0x012e, 0x0804, 0x79a7, 0x012e, 0x0804,
-	0x79a1, 0x012e, 0x0804, 0x79a4, 0x0126, 0x2091, 0x8000, 0x7007,
-	0x0001, 0x080c, 0x6663, 0x05e0, 0x2061, 0x1a3f, 0x6000, 0xd084,
-	0x05b8, 0x6204, 0x6308, 0xd08c, 0x1530, 0xac78, 0x9484, 0x0003,
-	0x0170, 0xa988, 0x918c, 0x00ff, 0x8001, 0x1120, 0x2100, 0x9210,
-	0x0620, 0x0028, 0x8001, 0x1508, 0x2100, 0x9212, 0x02f0, 0x9484,
-	0x000c, 0x0188, 0xa988, 0x810f, 0x918c, 0x00ff, 0x9082, 0x0004,
-	0x1120, 0x2100, 0x9318, 0x0288, 0x0030, 0x9082, 0x0004, 0x1168,
-	0x2100, 0x931a, 0x0250, 0xa890, 0x9005, 0x0110, 0x8000, 0x6016,
-	0x6206, 0x630a, 0x012e, 0x0804, 0x79ad, 0x012e, 0x0804, 0x79aa,
-	0x012e, 0x0804, 0x79a7, 0x0126, 0x2091, 0x8000, 0x7007, 0x0001,
-	0x2061, 0x1a3f, 0x6300, 0xd38c, 0x1120, 0x6308, 0x8318, 0x0220,
-	0x630a, 0x012e, 0x0804, 0x79bb, 0x012e, 0x0804, 0x79aa, 0x00b6,
-	0x0126, 0x00c6, 0x2091, 0x8000, 0x7007, 0x0001, 0xa87c, 0xd0ac,
-	0x0148, 0x00c6, 0x2061, 0x1a3f, 0x6000, 0x9084, 0xfcff, 0x6002,
-	0x00ce, 0x0440, 0xa888, 0x9005, 0x05d8, 0xa88c, 0x9065, 0x0598,
-	0x2001, 0x1833, 0x2004, 0x9005, 0x0118, 0x080c, 0x9c21, 0x0068,
-	0x6017, 0xf400, 0x6063, 0x0000, 0xa97c, 0xd1a4, 0x0110, 0xa980,
-	0x6162, 0x2009, 0x0041, 0x080c, 0x9c85, 0xa988, 0x918c, 0xff00,
-	0x9186, 0x2000, 0x1138, 0x0026, 0x900e, 0x2011, 0xfdff, 0x080c,
-	0x83eb, 0x002e, 0xa87c, 0xd0c4, 0x0148, 0x2061, 0x1a3f, 0x6000,
-	0xd08c, 0x1120, 0x6008, 0x8000, 0x0208, 0x600a, 0x00ce, 0x012e,
-	0x00be, 0x0804, 0x79ad, 0x00ce, 0x012e, 0x00be, 0x0804, 0x79a7,
-	0xa984, 0x9186, 0x002e, 0x0d30, 0x9186, 0x002d, 0x0d18, 0x9186,
-	0x0045, 0x0510, 0x9186, 0x002a, 0x1130, 0x2001, 0x180c, 0x200c,
-	0xc194, 0x2102, 0x08b8, 0x9186, 0x0020, 0x0158, 0x9186, 0x0029,
-	0x1d10, 0xa974, 0x080c, 0x6270, 0x1968, 0xb800, 0xc0e4, 0xb802,
-	0x0848, 0xa88c, 0x9065, 0x09b8, 0x6007, 0x0024, 0x2001, 0x1957,
-	0x2004, 0x601a, 0x0804, 0x7842, 0xa88c, 0x9065, 0x0960, 0x00e6,
-	0xa890, 0x9075, 0x2001, 0x1833, 0x2004, 0x9005, 0x0150, 0x080c,
-	0x9c21, 0x8eff, 0x0118, 0x2e60, 0x080c, 0x9c21, 0x00ee, 0x0804,
-	0x7842, 0x6024, 0xc0dc, 0xc0d5, 0x6026, 0x2e60, 0x6007, 0x003a,
-	0xa8a0, 0x9005, 0x0130, 0x6007, 0x003b, 0xa8a4, 0x602e, 0xa8a8,
-	0x6016, 0x6003, 0x0001, 0x2009, 0x8020, 0x080c, 0x84d1, 0x00ee,
-	0x0804, 0x7842, 0x2061, 0x1a3f, 0x6000, 0xd084, 0x0190, 0xd08c,
-	0x1904, 0x79bb, 0x0126, 0x2091, 0x8000, 0x6204, 0x8210, 0x0220,
-	0x6206, 0x012e, 0x0804, 0x79bb, 0x012e, 0xa883, 0x0016, 0x0804,
-	0x79b4, 0xa883, 0x0007, 0x0804, 0x79b4, 0xa864, 0x8007, 0x9084,
-	0x00ff, 0x0130, 0x8001, 0x1138, 0x7007, 0x0001, 0x0069, 0x0005,
-	0x080c, 0x7528, 0x0040, 0x7007, 0x0003, 0x7012, 0x2900, 0x7016,
-	0x701a, 0x704b, 0x78e4, 0x0005, 0x00b6, 0x00e6, 0x0126, 0x2091,
-	0x8000, 0x903e, 0x2061, 0x1800, 0x61cc, 0x81ff, 0x1904, 0x7966,
-	0x6130, 0xd194, 0x1904, 0x7990, 0xa878, 0x2070, 0x9e82, 0x1ddc,
-	0x0a04, 0x795a, 0x6064, 0x9e02, 0x1a04, 0x795a, 0x7120, 0x9186,
-	0x0006, 0x1904, 0x794c, 0x7010, 0x905d, 0x0904, 0x7966, 0xb800,
-	0xd0e4, 0x1904, 0x798a, 0x2061, 0x1a3f, 0x6100, 0x9184, 0x0301,
-	0x9086, 0x0001, 0x15a0, 0x7024, 0xd0dc, 0x1904, 0x7993, 0xa883,
-	0x0000, 0xa803, 0x0000, 0x2908, 0x7014, 0x9005, 0x1198, 0x7116,
-	0xa87c, 0xd0f4, 0x1904, 0x7996, 0x080c, 0x538d, 0xd09c, 0x1118,
-	0xa87c, 0xc0cc, 0xa87e, 0x2e60, 0x080c, 0x82de, 0x012e, 0x00ee,
-	0x00be, 0x0005, 0x2048, 0xa800, 0x9005, 0x1de0, 0xa902, 0x2148,
-	0xa87c, 0xd0f4, 0x1904, 0x7996, 0x012e, 0x00ee, 0x00be, 0x0005,
-	0x012e, 0x00ee, 0xa883, 0x0006, 0x00be, 0x0804, 0x79b4, 0xd184,
-	0x0db8, 0xd1c4, 0x1190, 0x00a0, 0xa974, 0x080c, 0x6270, 0x15d0,
-	0xb800, 0xd0e4, 0x15b8, 0x7120, 0x9186, 0x0007, 0x1118, 0xa883,
-	0x0002, 0x0490, 0xa883, 0x0008, 0x0478, 0xa883, 0x000e, 0x0460,
-	0xa883, 0x0017, 0x0448, 0xa883, 0x0035, 0x0430, 0x080c, 0x5391,
-	0xd0fc, 0x01e8, 0xa878, 0x2070, 0x9e82, 0x1ddc, 0x02c0, 0x6064,
-	0x9e02, 0x12a8, 0x7120, 0x9186, 0x0006, 0x1188, 0x7010, 0x905d,
-	0x0170, 0xb800, 0xd0bc, 0x0158, 0x2039, 0x0001, 0x7000, 0x9086,
-	0x0007, 0x1904, 0x78f0, 0x7003, 0x0002, 0x0804, 0x78f0, 0xa883,
-	0x0028, 0x0010, 0xa883, 0x0029, 0x012e, 0x00ee, 0x00be, 0x0420,
-	0xa883, 0x002a, 0x0cc8, 0xa883, 0x0045, 0x0cb0, 0x2e60, 0x2019,
-	0x0002, 0x601b, 0x0014, 0x080c, 0xcdf9, 0x012e, 0x00ee, 0x00be,
-	0x0005, 0x2009, 0x003e, 0x0058, 0x2009, 0x0004, 0x0040, 0x2009,
-	0x0006, 0x0028, 0x2009, 0x0016, 0x0010, 0x2009, 0x0001, 0xa884,
-	0x9084, 0xff00, 0x9105, 0xa886, 0x0126, 0x2091, 0x8000, 0x080c,
-	0x6996, 0x012e, 0x0005, 0x080c, 0x1054, 0x0005, 0x00d6, 0x080c,
-	0x82d5, 0x00de, 0x0005, 0x00d6, 0x00e6, 0x0126, 0x2091, 0x8000,
-	0x2071, 0x0040, 0x702c, 0xd084, 0x01d8, 0x908c, 0x0780, 0x190c,
-	0x7a4f, 0xd09c, 0x11a8, 0x2071, 0x1800, 0x70bc, 0x90ea, 0x0040,
-	0x0278, 0x8001, 0x70be, 0x702c, 0x2048, 0xa800, 0x702e, 0x9006,
-	0xa802, 0xa806, 0x2071, 0x0040, 0x2900, 0x7022, 0x702c, 0x0c28,
-	0x012e, 0x00ee, 0x00de, 0x0005, 0x0006, 0x9084, 0x0780, 0x190c,
-	0x7a4f, 0x000e, 0x0005, 0x00d6, 0x00c6, 0x0036, 0x0026, 0x0016,
-	0x00b6, 0x7007, 0x0001, 0xaa74, 0x9282, 0x0004, 0x1a04, 0x7a40,
-	0xa97c, 0x9188, 0x1000, 0x2104, 0x905d, 0xb804, 0xd284, 0x0140,
-	0x05e8, 0x8007, 0x9084, 0x00ff, 0x9084, 0x0006, 0x1108, 0x04b0,
-	0x2b10, 0x080c, 0x9b91, 0x1118, 0x080c, 0x9c58, 0x05a8, 0x6212,
-	0xa874, 0x0002, 0x7a1e, 0x7a23, 0x7a26, 0x7a2c, 0x2019, 0x0002,
-	0x080c, 0xd1eb, 0x0060, 0x080c, 0xd17b, 0x0048, 0x2019, 0x0002,
-	0xa980, 0x080c, 0xd19a, 0x0018, 0xa980, 0x080c, 0xd17b, 0x080c,
-	0x9be7, 0xa887, 0x0000, 0x0126, 0x2091, 0x8000, 0x080c, 0x6996,
-	0x012e, 0x00be, 0x001e, 0x002e, 0x003e, 0x00ce, 0x00de, 0x0005,
-	0xa887, 0x0006, 0x0c80, 0xa887, 0x0002, 0x0c68, 0xa887, 0x0005,
-	0x0c50, 0xa887, 0x0004, 0x0c38, 0xa887, 0x0007, 0x0c20, 0x2091,
-	0x8000, 0x0e04, 0x7a51, 0x0006, 0x0016, 0x2001, 0x8003, 0x0006,
-	0x0804, 0x0d6e, 0x2001, 0x1833, 0x2004, 0x9005, 0x0005, 0x0005,
-	0x00f6, 0x2079, 0x0300, 0x2001, 0x0200, 0x200c, 0xc1e5, 0xc1dc,
-	0x2102, 0x2009, 0x0218, 0x210c, 0xd1ec, 0x1120, 0x080c, 0x152d,
-	0x00fe, 0x0005, 0x2001, 0x020d, 0x2003, 0x0020, 0x781f, 0x0300,
-	0x00fe, 0x0005, 0x781c, 0xd08c, 0x0904, 0x7ad2, 0x68bc, 0x90aa,
-	0x0005, 0x0a04, 0x806b, 0x7d44, 0x7c40, 0xd59c, 0x190c, 0x0d65,
-	0x9584, 0x00f6, 0x1508, 0x9484, 0x7000, 0x0138, 0x908a, 0x2000,
-	0x1258, 0x9584, 0x0700, 0x8007, 0x04f0, 0x7000, 0x9084, 0xff00,
-	0x9086, 0x8100, 0x0db0, 0x00b0, 0x9484, 0x0fff, 0x1130, 0x7000,
-	0x9084, 0xff00, 0x9086, 0x8100, 0x11c0, 0x080c, 0xd5d3, 0x080c,
-	0x7fb2, 0x7817, 0x0140, 0x00a8, 0x9584, 0x0076, 0x1118, 0x080c,
-	0x800e, 0x19c8, 0xd5a4, 0x0148, 0x0046, 0x0056, 0x080c, 0x7b22,
-	0x080c, 0x1fb7, 0x005e, 0x004e, 0x0020, 0x080c, 0xd5d3, 0x7817,
-	0x0140, 0x080c, 0x70b7, 0x0168, 0x2001, 0x0111, 0x2004, 0xd08c,
-	0x0140, 0x688f, 0x0000, 0x2001, 0x0110, 0x2003, 0x0008, 0x2003,
-	0x0000, 0x0489, 0x0005, 0x0002, 0x7adf, 0x7dd4, 0x7adc, 0x7adc,
-	0x7adc, 0x7adc, 0x7adc, 0x7adc, 0x7817, 0x0140, 0x0005, 0x7000,
-	0x908c, 0xff00, 0x9194, 0xf000, 0x810f, 0x9484, 0x0fff, 0x688e,
-	0x9286, 0x2000, 0x1150, 0x6800, 0x9086, 0x0001, 0x1118, 0x080c,
-	0x53ee, 0x0070, 0x080c, 0x7b42, 0x0058, 0x9286, 0x3000, 0x1118,
-	0x080c, 0x7d11, 0x0028, 0x9286, 0x8000, 0x1110, 0x080c, 0x7ee8,
-	0x7817, 0x0140, 0x0005, 0x2001, 0x1810, 0x2004, 0xd08c, 0x0178,
-	0x2001, 0x1800, 0x2004, 0x9086, 0x0003, 0x1148, 0x0026, 0x0036,
-	0x2011, 0x8048, 0x2518, 0x080c, 0x48d8, 0x003e, 0x002e, 0x0005,
-	0x0036, 0x0046, 0x0056, 0x00f6, 0x2079, 0x0200, 0x2019, 0xfffe,
-	0x7c30, 0x0050, 0x0036, 0x0046, 0x0056, 0x00f6, 0x2079, 0x0200,
-	0x7d44, 0x7c40, 0x2019, 0xffff, 0x2001, 0x1810, 0x2004, 0xd08c,
-	0x0160, 0x2001, 0x1800, 0x2004, 0x9086, 0x0003, 0x1130, 0x0026,
-	0x2011, 0x8048, 0x080c, 0x48d8, 0x002e, 0x00fe, 0x005e, 0x004e,
-	0x003e, 0x0005, 0x00b6, 0x00c6, 0x7010, 0x9084, 0xff00, 0x8007,
-	0x9096, 0x0001, 0x0120, 0x9096, 0x0023, 0x1904, 0x7ce2, 0x9186,
-	0x0023, 0x15c0, 0x080c, 0x7f7d, 0x0904, 0x7ce2, 0x6120, 0x9186,
-	0x0001, 0x0150, 0x9186, 0x0004, 0x0138, 0x9186, 0x0008, 0x0120,
-	0x9186, 0x000a, 0x1904, 0x7ce2, 0x7124, 0x610a, 0x7030, 0x908e,
-	0x0200, 0x1130, 0x2009, 0x0015, 0x080c, 0x9c85, 0x0804, 0x7ce2,
-	0x908e, 0x0214, 0x0118, 0x908e, 0x0210, 0x1130, 0x2009, 0x0015,
-	0x080c, 0x9c85, 0x0804, 0x7ce2, 0x908e, 0x0100, 0x1904, 0x7ce2,
-	0x7034, 0x9005, 0x1904, 0x7ce2, 0x2009, 0x0016, 0x080c, 0x9c85,
-	0x0804, 0x7ce2, 0x9186, 0x0022, 0x1904, 0x7ce2, 0x7030, 0x908e,
-	0x0300, 0x1580, 0x68d8, 0xd0a4, 0x0528, 0xc0b5, 0x68da, 0x7100,
-	0x918c, 0x00ff, 0x697a, 0x7004, 0x687e, 0x00f6, 0x2079, 0x0100,
-	0x79e6, 0x78ea, 0x0006, 0x9084, 0x00ff, 0x0016, 0x2008, 0x080c,
-	0x246d, 0x7932, 0x7936, 0x001e, 0x000e, 0x00fe, 0x080c, 0x2424,
-	0x695a, 0x703c, 0x00e6, 0x2071, 0x0140, 0x7086, 0x2071, 0x1800,
-	0x70b2, 0x00ee, 0x7034, 0x9005, 0x1904, 0x7ce2, 0x2009, 0x0017,
-	0x0804, 0x7c92, 0x908e, 0x0400, 0x1190, 0x7034, 0x9005, 0x1904,
-	0x7ce2, 0x080c, 0x70b7, 0x0120, 0x2009, 0x001d, 0x0804, 0x7c92,
-	0x68d8, 0xc0a5, 0x68da, 0x2009, 0x0030, 0x0804, 0x7c92, 0x908e,
-	0x0500, 0x1140, 0x7034, 0x9005, 0x1904, 0x7ce2, 0x2009, 0x0018,
-	0x0804, 0x7c92, 0x908e, 0x2010, 0x1120, 0x2009, 0x0019, 0x0804,
-	0x7c92, 0x908e, 0x2110, 0x1120, 0x2009, 0x001a, 0x0804, 0x7c92,
-	0x908e, 0x5200, 0x1140, 0x7034, 0x9005, 0x1904, 0x7ce2, 0x2009,
-	0x001b, 0x0804, 0x7c92, 0x908e, 0x5000, 0x1140, 0x7034, 0x9005,
-	0x1904, 0x7ce2, 0x2009, 0x001c, 0x0804, 0x7c92, 0x908e, 0x1300,
-	0x1120, 0x2009, 0x0034, 0x0804, 0x7c92, 0x908e, 0x1200, 0x1140,
-	0x7034, 0x9005, 0x1904, 0x7ce2, 0x2009, 0x0024, 0x0804, 0x7c92,
-	0x908c, 0xff00, 0x918e, 0x2400, 0x1170, 0x2009, 0x002d, 0x2001,
-	0x1810, 0x2004, 0xd09c, 0x0904, 0x7c92, 0x080c, 0xc62f, 0x1904,
-	0x7ce2, 0x0804, 0x7c90, 0x908c, 0xff00, 0x918e, 0x5300, 0x1120,
-	0x2009, 0x002a, 0x0804, 0x7c92, 0x908e, 0x0f00, 0x1120, 0x2009,
-	0x0020, 0x0804, 0x7c92, 0x908e, 0x6104, 0x1528, 0x2029, 0x0205,
-	0x2011, 0x026d, 0x8208, 0x2204, 0x9082, 0x0004, 0x8004, 0x8004,
-	0x20a8, 0x2011, 0x8015, 0x211c, 0x8108, 0x0046, 0x2124, 0x080c,
-	0x48d8, 0x004e, 0x8108, 0x0f04, 0x7c5e, 0x9186, 0x0280, 0x1d88,
-	0x2504, 0x8000, 0x202a, 0x2009, 0x0260, 0x0c58, 0x202b, 0x0000,
-	0x2009, 0x0023, 0x0478, 0x908e, 0x6000, 0x1118, 0x2009, 0x003f,
-	0x0448, 0x908e, 0x7800, 0x1118, 0x2009, 0x0045, 0x0418, 0x908e,
-	0x1000, 0x1118, 0x2009, 0x004e, 0x00e8, 0x908e, 0x6300, 0x1118,
-	0x2009, 0x004a, 0x00b8, 0x908c, 0xff00, 0x918e, 0x5600, 0x1118,
-	0x2009, 0x004f, 0x0078, 0x908c, 0xff00, 0x918e, 0x5700, 0x1118,
-	0x2009, 0x0050, 0x0038, 0x2009, 0x001d, 0x6838, 0xd0d4, 0x0110,
-	0x2009, 0x004c, 0x0016, 0x2011, 0x0263, 0x2204, 0x8211, 0x220c,
-	0x080c, 0x2424, 0x1904, 0x7ce5, 0x080c, 0x6210, 0x1904, 0x7ce5,
-	0xbe12, 0xbd16, 0x001e, 0x0016, 0x080c, 0x70b7, 0x01c0, 0x68d8,
-	0xd08c, 0x1148, 0x7000, 0x9084, 0x00ff, 0x1188, 0x7004, 0x9084,
-	0xff00, 0x1168, 0x0040, 0x6878, 0x9606, 0x1148, 0x687c, 0x9506,
-	0x9084, 0xff00, 0x1120, 0x9584, 0x00ff, 0xb886, 0x0080, 0xb884,
-	0x9005, 0x1168, 0x9186, 0x0046, 0x1150, 0x6878, 0x9606, 0x1138,
-	0x687c, 0x9506, 0x9084, 0xff00, 0x1110, 0x001e, 0x0098, 0x080c,
-	0x9b91, 0x01a8, 0x2b08, 0x6112, 0x6023, 0x0004, 0x7120, 0x610a,
-	0x001e, 0x9186, 0x004c, 0x1110, 0x6023, 0x000a, 0x0016, 0x001e,
-	0x080c, 0x9c85, 0x00ce, 0x00be, 0x0005, 0x001e, 0x0cd8, 0x2001,
-	0x180e, 0x2004, 0xd0ec, 0x0120, 0x2011, 0x8049, 0x080c, 0x48d8,
-	0x080c, 0x9c58, 0x0d90, 0x2b08, 0x6112, 0x6023, 0x0004, 0x7120,
-	0x610a, 0x001e, 0x0016, 0x9186, 0x0017, 0x0118, 0x9186, 0x0030,
-	0x1128, 0x6007, 0x0009, 0x6017, 0x2900, 0x0020, 0x6007, 0x0051,
-	0x6017, 0x0000, 0x602f, 0x0009, 0x6003, 0x0001, 0x080c, 0x84d8,
-	0x08a0, 0x080c, 0x3150, 0x1140, 0x7010, 0x9084, 0xff00, 0x8007,
-	0x908e, 0x0008, 0x1108, 0x0009, 0x0005, 0x00b6, 0x00c6, 0x0046,
-	0x7000, 0x908c, 0xff00, 0x810f, 0x9186, 0x0033, 0x11e8, 0x080c,
-	0x7f7d, 0x0904, 0x7d6c, 0x7124, 0x610a, 0x7030, 0x908e, 0x0200,
-	0x1140, 0x7034, 0x9005, 0x15c0, 0x2009, 0x0015, 0x080c, 0x9c85,
-	0x0498, 0x908e, 0x0100, 0x1580, 0x7034, 0x9005, 0x1568, 0x2009,
-	0x0016, 0x080c, 0x9c85, 0x0440, 0x9186, 0x0032, 0x1528, 0x7030,
-	0x908e, 0x1400, 0x1508, 0x2009, 0x0038, 0x0016, 0x2011, 0x0263,
-	0x2204, 0x8211, 0x220c, 0x080c, 0x2424, 0x11a8, 0x080c, 0x6210,
-	0x1190, 0xbe12, 0xbd16, 0x080c, 0x9b91, 0x0168, 0x2b08, 0x6112,
-	0x080c, 0xbcdb, 0x6023, 0x0004, 0x7120, 0x610a, 0x001e, 0x080c,
-	0x9c85, 0x0010, 0x00ce, 0x001e, 0x004e, 0x00ce, 0x00be, 0x0005,
-	0x00b6, 0x0046, 0x00e6, 0x00d6, 0x2028, 0x2130, 0x9696, 0x00ff,
-	0x11b8, 0x9592, 0xfffc, 0x02a0, 0x9596, 0xfffd, 0x1120, 0x2009,
-	0x007f, 0x0804, 0x7dce, 0x9596, 0xfffe, 0x1120, 0x2009, 0x007e,
-	0x0804, 0x7dce, 0x9596, 0xfffc, 0x1118, 0x2009, 0x0080, 0x04f0,
-	0x2011, 0x0000, 0x2019, 0x1836, 0x231c, 0xd3ac, 0x0130, 0x9026,
-	0x20a9, 0x0800, 0x2071, 0x1000, 0x0030, 0x2021, 0x0081, 0x20a9,
-	0x077f, 0x2071, 0x1081, 0x2e1c, 0x93dd, 0x0000, 0x1140, 0x82ff,
-	0x11d0, 0x9496, 0x00ff, 0x01b8, 0x2410, 0xc2fd, 0x00a0, 0xbf10,
-	0x2600, 0x9706, 0xb814, 0x1120, 0x9546, 0x1110, 0x2408, 0x00b0,
-	0x9745, 0x1148, 0x94c6, 0x007e, 0x0130, 0x94c6, 0x007f, 0x0118,
-	0x94c6, 0x0080, 0x1d20, 0x8420, 0x8e70, 0x1f04, 0x7da3, 0x82ff,
-	0x1118, 0x9085, 0x0001, 0x0018, 0xc2fc, 0x2208, 0x9006, 0x00de,
-	0x00ee, 0x004e, 0x00be, 0x0005, 0x7000, 0x908c, 0xff00, 0x810f,
-	0x9184, 0x000f, 0x0002, 0x7deb, 0x7deb, 0x7deb, 0x7f8f, 0x7deb,
-	0x7dee, 0x7e13, 0x7e9c, 0x7deb, 0x7deb, 0x7deb, 0x7deb, 0x7deb,
-	0x7deb, 0x7deb, 0x7deb, 0x7817, 0x0140, 0x0005, 0x00b6, 0x7110,
-	0xd1bc, 0x01e8, 0x7120, 0x2160, 0x9c8c, 0x0003, 0x11c0, 0x9c8a,
-	0x1ddc, 0x02a8, 0x6864, 0x9c02, 0x1290, 0x7008, 0x9084, 0x00ff,
-	0x6110, 0x2158, 0xb910, 0x9106, 0x1150, 0x700c, 0xb914, 0x9106,
-	0x1130, 0x7124, 0x610a, 0x2009, 0x0046, 0x080c, 0x9c85, 0x7817,
-	0x0140, 0x00be, 0x0005, 0x00b6, 0x00c6, 0x9484, 0x0fff, 0x0904,
-	0x7e78, 0x7110, 0xd1bc, 0x1904, 0x7e78, 0x7108, 0x700c, 0x2028,
-	0x918c, 0x00ff, 0x2130, 0x9094, 0xff00, 0x15c8, 0x81ff, 0x15b8,
-	0x9080, 0x318b, 0x200d, 0x918c, 0xff00, 0x810f, 0x2001, 0x0080,
-	0x9106, 0x0904, 0x7e78, 0x9182, 0x0801, 0x1a04, 0x7e78, 0x9190,
-	0x1000, 0x2204, 0x905d, 0x05e0, 0xbe12, 0xbd16, 0xb800, 0xd0ec,
-	0x15b8, 0xba04, 0x9294, 0xff00, 0x9286, 0x0600, 0x1190, 0x080c,
-	0x9b91, 0x0598, 0x2b08, 0x7028, 0x6052, 0x702c, 0x604e, 0x6112,
-	0x6023, 0x0006, 0x7120, 0x610a, 0x7130, 0x615e, 0x080c, 0xc893,
-	0x00f8, 0x080c, 0x6667, 0x1138, 0xb807, 0x0606, 0x0c40, 0x190c,
-	0x7d70, 0x11b0, 0x0880, 0x080c, 0x9b91, 0x2b08, 0x0188, 0x6112,
-	0x6023, 0x0004, 0x7120, 0x610a, 0x9286, 0x0400, 0x1118, 0x6007,
-	0x0005, 0x0010, 0x6007, 0x0001, 0x6003, 0x0001, 0x080c, 0x84d8,
-	0x7817, 0x0140, 0x00ce, 0x00be, 0x0005, 0x2001, 0x180e, 0x2004,
-	0xd0ec, 0x0120, 0x2011, 0x8049, 0x080c, 0x48d8, 0x080c, 0x9c58,
-	0x0d78, 0x2b08, 0x6112, 0x6023, 0x0006, 0x7120, 0x610a, 0x7130,
-	0x615e, 0x6017, 0xf300, 0x6003, 0x0001, 0x6007, 0x0041, 0x2009,
-	0xa022, 0x080c, 0x84d1, 0x08e0, 0x00b6, 0x7110, 0xd1bc, 0x05d0,
-	0x7020, 0x2060, 0x9c84, 0x0003, 0x15a8, 0x9c82, 0x1ddc, 0x0690,
-	0x6864, 0x9c02, 0x1678, 0x9484, 0x0fff, 0x9082, 0x000c, 0x0650,
-	0x7008, 0x9084, 0x00ff, 0x6110, 0x2158, 0xb910, 0x9106, 0x1510,
-	0x700c, 0xb914, 0x9106, 0x11f0, 0x7124, 0x610a, 0x601c, 0xd0fc,
-	0x11c8, 0x2001, 0x0271, 0x2004, 0x9005, 0x1180, 0x9484, 0x0fff,
-	0x9082, 0x000c, 0x0158, 0x0066, 0x2031, 0x0100, 0xa001, 0xa001,
-	0x8631, 0x1de0, 0x006e, 0x601c, 0xd0fc, 0x1120, 0x2009, 0x0045,
-	0x080c, 0x9c85, 0x7817, 0x0140, 0x00be, 0x0005, 0x6120, 0x9186,
-	0x0002, 0x0128, 0x9186, 0x0005, 0x0110, 0x9085, 0x0001, 0x0005,
-	0x080c, 0x3150, 0x1168, 0x7010, 0x9084, 0xff00, 0x8007, 0x9086,
-	0x0000, 0x1130, 0x9184, 0x000f, 0x908a, 0x0006, 0x1208, 0x000b,
-	0x0005, 0x7eff, 0x7f00, 0x7eff, 0x7eff, 0x7f5f, 0x7f6e, 0x0005,
-	0x00b6, 0x7110, 0xd1bc, 0x0120, 0x702c, 0xd084, 0x0904, 0x7f5d,
-	0x700c, 0x7108, 0x080c, 0x2424, 0x1904, 0x7f5d, 0x080c, 0x6210,
-	0x1904, 0x7f5d, 0xbe12, 0xbd16, 0x7110, 0xd1bc, 0x01d8, 0x080c,
-	0x6667, 0x0118, 0x9086, 0x0004, 0x1588, 0x00c6, 0x080c, 0x7f7d,
-	0x00ce, 0x05d8, 0x080c, 0x9b91, 0x2b08, 0x05b8, 0x6112, 0x080c,
-	0xbcdb, 0x6023, 0x0002, 0x7120, 0x610a, 0x2009, 0x0088, 0x080c,
-	0x9c85, 0x0458, 0x080c, 0x6667, 0x0148, 0x9086, 0x0004, 0x0130,
-	0x080c, 0x666f, 0x0118, 0x9086, 0x0004, 0x1180, 0x080c, 0x9b91,
-	0x2b08, 0x01d8, 0x6112, 0x080c, 0xbcdb, 0x6023, 0x0005, 0x7120,
-	0x610a, 0x2009, 0x0088, 0x080c, 0x9c85, 0x0078, 0x080c, 0x9b91,
-	0x2b08, 0x0158, 0x6112, 0x080c, 0xbcdb, 0x6023, 0x0004, 0x7120,
-	0x610a, 0x2009, 0x0001, 0x080c, 0x9c85, 0x00be, 0x0005, 0x7110,
-	0xd1bc, 0x0158, 0x00d1, 0x0148, 0x080c, 0x7ede, 0x1130, 0x7124,
-	0x610a, 0x2009, 0x0089, 0x080c, 0x9c85, 0x0005, 0x7110, 0xd1bc,
-	0x0158, 0x0059, 0x0148, 0x080c, 0x7ede, 0x1130, 0x7124, 0x610a,
-	0x2009, 0x008a, 0x080c, 0x9c85, 0x0005, 0x7020, 0x2060, 0x9c84,
-	0x0003, 0x1158, 0x9c82, 0x1ddc, 0x0240, 0x2001, 0x1819, 0x2004,
-	0x9c02, 0x1218, 0x9085, 0x0001, 0x0005, 0x9006, 0x0ce8, 0x00b6,
-	0x7110, 0xd1bc, 0x11d8, 0x7024, 0x2060, 0x9c84, 0x0003, 0x11b0,
-	0x9c82, 0x1ddc, 0x0298, 0x6864, 0x9c02, 0x1280, 0x7008, 0x9084,
-	0x00ff, 0x6110, 0x2158, 0xb910, 0x9106, 0x1140, 0x700c, 0xb914,
-	0x9106, 0x1120, 0x2009, 0x0051, 0x080c, 0x9c85, 0x7817, 0x0140,
-	0x00be, 0x0005, 0x2031, 0x0105, 0x0069, 0x0005, 0x2031, 0x0206,
-	0x0049, 0x0005, 0x2031, 0x0207, 0x0029, 0x0005, 0x2031, 0x0213,
-	0x0009, 0x0005, 0x00c6, 0x0096, 0x00f6, 0x7000, 0x9084, 0xf000,
-	0x9086, 0xc000, 0x05c0, 0x080c, 0x9b91, 0x05a8, 0x0066, 0x00c6,
-	0x0046, 0x2011, 0x0263, 0x2204, 0x8211, 0x220c, 0x080c, 0x2424,
-	0x1590, 0x080c, 0x6210, 0x1578, 0xbe12, 0xbd16, 0x2b00, 0x004e,
-	0x00ce, 0x6012, 0x080c, 0xbcdb, 0x080c, 0x1022, 0x0500, 0x2900,
-	0x6062, 0x9006, 0xa802, 0xa866, 0xac6a, 0xa85c, 0x90f8, 0x001b,
-	0x20a9, 0x000e, 0xa860, 0x20e8, 0x20e1, 0x0000, 0x2fa0, 0x2e98,
-	0x4003, 0x006e, 0x6616, 0x6007, 0x003e, 0x6023, 0x0001, 0x6003,
-	0x0001, 0x080c, 0x84d8, 0x00fe, 0x009e, 0x00ce, 0x0005, 0x080c,
-	0x9be7, 0x006e, 0x0cc0, 0x004e, 0x00ce, 0x0cc8, 0x00c6, 0x7000,
-	0x908c, 0xff00, 0x9184, 0xf000, 0x810f, 0x9086, 0x2000, 0x1904,
-	0x8065, 0x9186, 0x0022, 0x15f0, 0x2001, 0x0111, 0x2004, 0x9005,
-	0x1904, 0x8067, 0x7030, 0x908e, 0x0400, 0x0904, 0x8067, 0x908e,
-	0x6000, 0x05e8, 0x908e, 0x5400, 0x05d0, 0x908e, 0x0300, 0x11d8,
-	0x2009, 0x1836, 0x210c, 0xd18c, 0x1590, 0xd1a4, 0x1580, 0x080c,
-	0x6625, 0x0558, 0x68ac, 0x9084, 0x00ff, 0x7100, 0x918c, 0x00ff,
-	0x9106, 0x1518, 0x687c, 0x69ac, 0x918c, 0xff00, 0x9105, 0x7104,
-	0x9106, 0x11d8, 0x00e0, 0x2009, 0x0103, 0x210c, 0xd1b4, 0x11a8,
-	0x908e, 0x5200, 0x09e8, 0x908e, 0x0500, 0x09d0, 0x908e, 0x5000,
-	0x09b8, 0x0058, 0x9186, 0x0023, 0x1140, 0x080c, 0x7f7d, 0x0128,
-	0x6004, 0x9086, 0x0002, 0x0118, 0x0000, 0x9006, 0x0010, 0x9085,
-	0x0001, 0x00ce, 0x0005, 0x00f6, 0x2079, 0x0200, 0x7800, 0xc0e5,
-	0xc0cc, 0x7802, 0x00fe, 0x0005, 0x00f6, 0x2079, 0x1800, 0x7834,
-	0xd084, 0x1130, 0x2079, 0x0200, 0x7800, 0x9085, 0x1200, 0x7802,
-	0x00fe, 0x0005, 0x00e6, 0x2071, 0x1800, 0x7034, 0xc084, 0x7036,
-	0x00ee, 0x0005, 0x2071, 0x19d4, 0x7003, 0x0003, 0x700f, 0x0361,
-	0x9006, 0x701a, 0x7072, 0x7012, 0x7017, 0x1ddc, 0x7007, 0x0000,
-	0x7026, 0x702b, 0x8fd9, 0x7032, 0x7037, 0x9056, 0x703f, 0xffff,
-	0x7042, 0x7047, 0x5224, 0x704a, 0x705b, 0x8226, 0x080c, 0x103b,
-	0x090c, 0x0d65, 0x2900, 0x703a, 0xa867, 0x0003, 0xa86f, 0x0100,
-	0xa8ab, 0xdcb0, 0x0005, 0x2071, 0x19d4, 0x1d04, 0x8148, 0x2091,
-	0x6000, 0x700c, 0x8001, 0x700e, 0x1560, 0x2001, 0x1875, 0x2004,
-	0xd0c4, 0x0158, 0x3a00, 0xd08c, 0x1140, 0x20d1, 0x0000, 0x20d1,
-	0x0001, 0x20d1, 0x0000, 0x080c, 0x0d65, 0x700f, 0x0361, 0x7007,
-	0x0001, 0x0126, 0x2091, 0x8000, 0x2069, 0x1800, 0x69e8, 0xd1e4,
-	0x1138, 0xd1dc, 0x1118, 0x080c, 0x8294, 0x0010, 0x080c, 0x826b,
-	0x7040, 0x900d, 0x0148, 0x8109, 0x7142, 0x1130, 0x7044, 0x080f,
-	0x0018, 0x0126, 0x2091, 0x8000, 0x7024, 0x900d, 0x0188, 0x7020,
-	0x8001, 0x7022, 0x1168, 0x7023, 0x0009, 0x8109, 0x7126, 0x9186,
-	0x03e8, 0x1110, 0x7028, 0x080f, 0x81ff, 0x1110, 0x7028, 0x080f,
-	0x7030, 0x900d, 0x0180, 0x702c, 0x8001, 0x702e, 0x1160, 0x702f,
-	0x0009, 0x8109, 0x7132, 0x0128, 0x9184, 0x007f, 0x090c, 0x90de,
-	0x0010, 0x7034, 0x080f, 0x703c, 0x9005, 0x0118, 0x0310, 0x8001,
-	0x703e, 0x704c, 0x900d, 0x0168, 0x7048, 0x8001, 0x704a, 0x1148,
-	0x704b, 0x0009, 0x8109, 0x714e, 0x1120, 0x7150, 0x714e, 0x7058,
-	0x080f, 0x7018, 0x900d, 0x01d8, 0x0016, 0x7070, 0x900d, 0x0158,
-	0x706c, 0x8001, 0x706e, 0x1138, 0x706f, 0x0009, 0x8109, 0x7172,
-	0x1110, 0x7074, 0x080f, 0x001e, 0x7008, 0x8001, 0x700a, 0x1138,
-	0x700b, 0x0009, 0x8109, 0x711a, 0x1110, 0x701c, 0x080f, 0x012e,
-	0x7004, 0x0002, 0x8170, 0x8171, 0x819b, 0x00e6, 0x2071, 0x19d4,
-	0x7018, 0x9005, 0x1120, 0x711a, 0x721e, 0x700b, 0x0009, 0x00ee,
-	0x0005, 0x00e6, 0x0006, 0x2071, 0x19d4, 0x701c, 0x9206, 0x1120,
-	0x701a, 0x701e, 0x7072, 0x7076, 0x000e, 0x00ee, 0x0005, 0x00e6,
-	0x2071, 0x19d4, 0xb888, 0x9102, 0x0208, 0xb98a, 0x00ee, 0x0005,
-	0x0005, 0x00b6, 0x2031, 0x0010, 0x7110, 0x080c, 0x6270, 0x11a8,
-	0xb888, 0x8001, 0x0290, 0xb88a, 0x1180, 0x0126, 0x2091, 0x8000,
-	0x0066, 0xb8c0, 0x9005, 0x0138, 0x0026, 0xba3c, 0x0016, 0x080c,
-	0x639b, 0x001e, 0x002e, 0x006e, 0x012e, 0x8108, 0x9182, 0x0800,
-	0x1220, 0x8631, 0x0128, 0x7112, 0x0c00, 0x900e, 0x7007, 0x0002,
-	0x7112, 0x00be, 0x0005, 0x2031, 0x0010, 0x7014, 0x2060, 0x0126,
-	0x2091, 0x8000, 0x6048, 0x9005, 0x0128, 0x8001, 0x604a, 0x1110,
-	0x080c, 0xbb5c, 0x6018, 0x9005, 0x0904, 0x81ed, 0x00f6, 0x2079,
-	0x0300, 0x7918, 0xd1b4, 0x1904, 0x8200, 0x781b, 0x2020, 0xa001,
-	0x7918, 0xd1b4, 0x0120, 0x781b, 0x2000, 0x0804, 0x8200, 0x8001,
-	0x601a, 0x0106, 0x781b, 0x2000, 0xa001, 0x7918, 0xd1ac, 0x1dd0,
-	0x010e, 0x00fe, 0x1510, 0x6120, 0x9186, 0x0003, 0x0118, 0x9186,
-	0x0006, 0x11c8, 0x080c, 0xb847, 0x01b0, 0x6014, 0x2048, 0xa884,
-	0x908a, 0x199a, 0x0280, 0x9082, 0x1999, 0xa886, 0x908a, 0x199a,
-	0x0210, 0x2001, 0x1999, 0x8003, 0x800b, 0x810b, 0x9108, 0x611a,
-	0x080c, 0xbf8d, 0x0110, 0x080c, 0xb545, 0x012e, 0x9c88, 0x001c,
-	0x7116, 0x2001, 0x1819, 0x2004, 0x9102, 0x1228, 0x8631, 0x0138,
-	0x2160, 0x0804, 0x819f, 0x7017, 0x1ddc, 0x7007, 0x0000, 0x0005,
-	0x00fe, 0x0c58, 0x00e6, 0x2071, 0x19d4, 0x7027, 0x07d0, 0x7023,
-	0x0009, 0x00ee, 0x0005, 0x2001, 0x19dd, 0x2003, 0x0000, 0x0005,
-	0x00e6, 0x2071, 0x19d4, 0x7132, 0x702f, 0x0009, 0x00ee, 0x0005,
-	0x2011, 0x19e0, 0x2013, 0x0000, 0x0005, 0x00e6, 0x2071, 0x19d4,
-	0x711a, 0x721e, 0x700b, 0x0009, 0x00ee, 0x0005, 0x0086, 0x0026,
-	0x7054, 0x8000, 0x7056, 0x2001, 0x19e2, 0x2044, 0xa06c, 0x9086,
-	0x0000, 0x0150, 0x7068, 0xa09a, 0x7064, 0xa096, 0x7060, 0xa092,
-	0x705c, 0xa08e, 0x080c, 0x110c, 0x002e, 0x008e, 0x0005, 0x0006,
-	0x0016, 0x0096, 0x00a6, 0x00b6, 0x00c6, 0x00d6, 0x00e6, 0x00f6,
-	0x0156, 0x080c, 0x80b3, 0x015e, 0x00fe, 0x00ee, 0x00de, 0x00ce,
-	0x00be, 0x00ae, 0x009e, 0x001e, 0x000e, 0x0005, 0x00e6, 0x2071,
-	0x19d4, 0x7172, 0x7276, 0x706f, 0x0009, 0x00ee, 0x0005, 0x00e6,
-	0x0006, 0x2071, 0x19d4, 0x7074, 0x9206, 0x1110, 0x7072, 0x7076,
-	0x000e, 0x00ee, 0x0005, 0x2069, 0x1800, 0x69e8, 0xd1e4, 0x1518,
-	0x0026, 0xd1ec, 0x0140, 0x6a50, 0x6870, 0x9202, 0x0288, 0x8117,
-	0x9294, 0x00c1, 0x0088, 0x9184, 0x0007, 0x01a0, 0x8109, 0x9184,
-	0x0007, 0x0110, 0x69ea, 0x0070, 0x8107, 0x9084, 0x0007, 0x910d,
-	0x8107, 0x9106, 0x9094, 0x00c1, 0x9184, 0xff3e, 0x9205, 0x68ea,
-	0x080c, 0x0eed, 0x002e, 0x0005, 0x69e4, 0x9184, 0x003f, 0x05b8,
-	0x8109, 0x9184, 0x003f, 0x01a8, 0x6a50, 0x6870, 0x9202, 0x0220,
-	0xd1bc, 0x0168, 0xc1bc, 0x0018, 0xd1bc, 0x1148, 0xc1bd, 0x2110,
-	0x00e6, 0x2071, 0x1800, 0x080c, 0x0f0f, 0x00ee, 0x0400, 0x69e6,
-	0x00f0, 0x0026, 0x8107, 0x9094, 0x0007, 0x0128, 0x8001, 0x8007,
-	0x9085, 0x0007, 0x0050, 0x2010, 0x8004, 0x8004, 0x8004, 0x9084,
-	0x0007, 0x9205, 0x8007, 0x9085, 0x0028, 0x9086, 0x0040, 0x2010,
-	0x00e6, 0x2071, 0x1800, 0x080c, 0x0f0f, 0x00ee, 0x002e, 0x0005,
-	0x00c6, 0x2061, 0x1a3f, 0x00ce, 0x0005, 0x9184, 0x000f, 0x8003,
-	0x8003, 0x8003, 0x9080, 0x1a3f, 0x2060, 0x0005, 0xa884, 0x908a,
-	0x199a, 0x1638, 0x9005, 0x1150, 0x00c6, 0x2061, 0x1a3f, 0x6014,
-	0x00ce, 0x9005, 0x1130, 0x2001, 0x001e, 0x0018, 0x908e, 0xffff,
-	0x01b0, 0x8003, 0x800b, 0x810b, 0x9108, 0x611a, 0xa87c, 0x908c,
-	0x00c0, 0x918e, 0x00c0, 0x0904, 0x8395, 0xd0b4, 0x1168, 0xd0bc,
-	0x1904, 0x836e, 0x2009, 0x0006, 0x080c, 0x83c2, 0x0005, 0x900e,
-	0x0c60, 0x2001, 0x1999, 0x08b0, 0xd0fc, 0x05c8, 0x908c, 0x2023,
-	0x1550, 0x87ff, 0x1540, 0x6124, 0x918c, 0x0500, 0x1520, 0x6100,
-	0x918e, 0x0007, 0x1500, 0x2009, 0x1875, 0x210c, 0xd184, 0x11d8,
-	0x6003, 0x0003, 0x6007, 0x0043, 0x6047, 0xb035, 0x080c, 0x1aa5,
-	0xa87c, 0xc0dd, 0xa87e, 0x600f, 0x0000, 0x00f6, 0x2079, 0x0380,
-	0x7818, 0xd0bc, 0x1de8, 0x7833, 0x0013, 0x2c00, 0x7836, 0x781b,
-	0x8080, 0x00fe, 0x0005, 0x908c, 0x0003, 0x0120, 0x918e, 0x0003,
-	0x1904, 0x83bc, 0x908c, 0x2020, 0x918e, 0x2020, 0x01a8, 0x6024,
-	0xd0d4, 0x11e8, 0x2009, 0x1875, 0x2104, 0xd084, 0x1138, 0x87ff,
-	0x1120, 0x2009, 0x0043, 0x0804, 0x9c85, 0x0005, 0x87ff, 0x1de8,
-	0x2009, 0x0042, 0x0804, 0x9c85, 0x6110, 0x00b6, 0x2158, 0xb900,
-	0x00be, 0xd1ac, 0x0d20, 0x6024, 0xc0cd, 0x6026, 0x0c00, 0xc0d4,
-	0x6026, 0xa890, 0x602e, 0xa88c, 0x6032, 0x08e0, 0xd0fc, 0x0160,
-	0x908c, 0x0003, 0x0120, 0x918e, 0x0003, 0x1904, 0x83bc, 0x908c,
-	0x2020, 0x918e, 0x2020, 0x0170, 0x0076, 0x00f6, 0x2c78, 0x080c,
-	0x164f, 0x00fe, 0x007e, 0x87ff, 0x1120, 0x2009, 0x0042, 0x080c,
-	0x9c85, 0x0005, 0x6110, 0x00b6, 0x2158, 0xb900, 0x00be, 0xd1ac,
-	0x0d58, 0x6124, 0xc1cd, 0x6126, 0x0c38, 0xd0fc, 0x0188, 0x908c,
-	0x2020, 0x918e, 0x2020, 0x01a8, 0x9084, 0x0003, 0x908e, 0x0002,
-	0x0148, 0x87ff, 0x1120, 0x2009, 0x0041, 0x080c, 0x9c85, 0x0005,
-	0x00b9, 0x0ce8, 0x87ff, 0x1dd8, 0x2009, 0x0043, 0x080c, 0x9c85,
-	0x0cb0, 0x6110, 0x00b6, 0x2158, 0xb900, 0x00be, 0xd1ac, 0x0d20,
-	0x6124, 0xc1cd, 0x6126, 0x0c00, 0x2009, 0x0004, 0x0019, 0x0005,
-	0x2009, 0x0001, 0x0096, 0x080c, 0xb847, 0x0518, 0x6014, 0x2048,
-	0xa982, 0xa800, 0x6016, 0x9186, 0x0001, 0x1188, 0xa97c, 0x918c,
-	0x8100, 0x918e, 0x8100, 0x1158, 0x00c6, 0x2061, 0x1a3f, 0x6200,
-	0xd28c, 0x1120, 0x6204, 0x8210, 0x0208, 0x6206, 0x00ce, 0x080c,
-	0x67cb, 0x6014, 0x904d, 0x0076, 0x2039, 0x0000, 0x190c, 0x82de,
-	0x007e, 0x009e, 0x0005, 0x0156, 0x00c6, 0x2061, 0x1a3f, 0x6000,
-	0x81ff, 0x0110, 0x9205, 0x0008, 0x9204, 0x6002, 0x00ce, 0x015e,
-	0x0005, 0x6800, 0xd08c, 0x1138, 0x6808, 0x9005, 0x0120, 0x8001,
-	0x680a, 0x9085, 0x0001, 0x0005, 0x0126, 0x2091, 0x8000, 0x0036,
-	0x0046, 0x20a9, 0x0010, 0x9006, 0x8004, 0x8086, 0x818e, 0x1208,
-	0x9200, 0x1f04, 0x840d, 0x8086, 0x818e, 0x004e, 0x003e, 0x012e,
-	0x0005, 0x0126, 0x2091, 0x8000, 0x0076, 0x0156, 0x20a9, 0x0010,
-	0x9005, 0x01c8, 0x911a, 0x12b8, 0x8213, 0x818d, 0x0228, 0x911a,
-	0x1220, 0x1f04, 0x8424, 0x0028, 0x911a, 0x2308, 0x8210, 0x1f04,
-	0x8424, 0x0006, 0x3200, 0x9084, 0xefff, 0x2080, 0x000e, 0x015e,
-	0x007e, 0x012e, 0x0005, 0x0006, 0x3200, 0x9085, 0x1000, 0x0ca8,
-	0x0126, 0x2091, 0x2800, 0x2079, 0x19b8, 0x012e, 0x00d6, 0x2069,
-	0x19b8, 0x6803, 0x0005, 0x0156, 0x0146, 0x01d6, 0x20e9, 0x0000,
-	0x2069, 0x0200, 0x080c, 0x97fa, 0x04a9, 0x080c, 0x97e5, 0x0491,
-	0x080c, 0x97e8, 0x0479, 0x080c, 0x97eb, 0x0461, 0x080c, 0x97ee,
-	0x0449, 0x080c, 0x97f1, 0x0431, 0x080c, 0x97f4, 0x0419, 0x080c,
-	0x97f7, 0x0401, 0x01de, 0x014e, 0x015e, 0x6857, 0x0000, 0x00f6,
-	0x2079, 0x0380, 0x00f9, 0x7807, 0x0003, 0x7803, 0x0000, 0x7803,
-	0x0001, 0x2069, 0x0004, 0x2d04, 0x9084, 0xfffe, 0x9085, 0x8000,
-	0x206a, 0x2069, 0x0100, 0x6828, 0x9084, 0xfffc, 0x682a, 0x00fe,
-	0x00de, 0x0005, 0x20a9, 0x0020, 0x20a1, 0x0240, 0x2001, 0x0000,
-	0x4004, 0x0005, 0x00c6, 0x7803, 0x0000, 0x9006, 0x7827, 0x0030,
-	0x782b, 0x0400, 0x7827, 0x0031, 0x782b, 0x1abf, 0x781f, 0xff00,
-	0x781b, 0xff00, 0x2061, 0x1ab4, 0x602f, 0x19b8, 0x6033, 0x1800,
-	0x6037, 0x19d4, 0x603b, 0x1cf7, 0x603f, 0x1d07, 0x6042, 0x6047,
-	0x1a8a, 0x00ce, 0x0005, 0x2001, 0x0382, 0x2004, 0x9084, 0x0007,
-	0x9086, 0x0001, 0x01b0, 0x00c6, 0x6146, 0x600f, 0x0000, 0x2c08,
-	0x2061, 0x19b8, 0x602c, 0x8000, 0x602e, 0x601c, 0x9005, 0x0130,
-	0x9080, 0x0003, 0x2102, 0x611e, 0x00ce, 0x0005, 0x6122, 0x611e,
-	0x0cd8, 0x6146, 0x2c08, 0x2001, 0x0012, 0x080c, 0x98b9, 0x0005,
-	0x0016, 0x2009, 0x8020, 0x6146, 0x2c08, 0x2001, 0x0382, 0x2004,
-	0x9084, 0x0007, 0x9086, 0x0001, 0x1128, 0x2001, 0x0019, 0x080c,
-	0x98b9, 0x0088, 0x00c6, 0x2061, 0x19b8, 0x602c, 0x8000, 0x602e,
-	0x600c, 0x9005, 0x0128, 0x9080, 0x0003, 0x2102, 0x610e, 0x0010,
-	0x6112, 0x610e, 0x00ce, 0x001e, 0x0005, 0x2001, 0x0382, 0x2004,
-	0x9084, 0x0007, 0x9086, 0x0001, 0x0198, 0x00c6, 0x6146, 0x600f,
-	0x0000, 0x2c08, 0x2061, 0x19b8, 0x6044, 0x9005, 0x0130, 0x9080,
-	0x0003, 0x2102, 0x6146, 0x00ce, 0x0005, 0x614a, 0x6146, 0x0cd8,
-	0x6146, 0x600f, 0x0000, 0x2c08, 0x2001, 0x0013, 0x080c, 0x98b9,
-	0x0005, 0x6044, 0xd0dc, 0x0128, 0x9006, 0x7007, 0x0000, 0x700a,
-	0x7032, 0x0005, 0x00f6, 0x00e6, 0x00d6, 0x00c6, 0x00b6, 0x0096,
-	0x0076, 0x0066, 0x0056, 0x0036, 0x0026, 0x0016, 0x0006, 0x0126,
-	0x902e, 0x2071, 0x19b8, 0x7648, 0x2660, 0x2678, 0x2091, 0x8000,
-	0x8cff, 0x0904, 0x85a3, 0x6010, 0x2058, 0xb8a0, 0x9206, 0x1904,
-	0x859e, 0x87ff, 0x0120, 0x605c, 0x9106, 0x1904, 0x859e, 0x704c,
-	0x9c06, 0x1178, 0x0036, 0x2019, 0x0001, 0x080c, 0x9286, 0x703f,
-	0x0000, 0x9006, 0x704e, 0x706a, 0x7052, 0x706e, 0x003e, 0x2029,
-	0x0001, 0x080c, 0x8521, 0x7048, 0x9c36, 0x1110, 0x660c, 0x764a,
-	0x7044, 0x9c36, 0x1140, 0x2c00, 0x9f36, 0x0118, 0x2f00, 0x7046,
-	0x0010, 0x7047, 0x0000, 0x660c, 0x0066, 0x2c00, 0x9f06, 0x0110,
-	0x7e0e, 0x0008, 0x2678, 0x600f, 0x0000, 0x080c, 0xb847, 0x01c8,
-	0x6014, 0x2048, 0x6020, 0x9086, 0x0003, 0x1560, 0xa867, 0x0103,
-	0xab7a, 0xa877, 0x0000, 0x0016, 0x0036, 0x0076, 0x080c, 0xbb45,
-	0x080c, 0xd51a, 0x080c, 0x6996, 0x007e, 0x003e, 0x001e, 0x080c,
-	0xba36, 0x080c, 0x9c21, 0x00ce, 0x0804, 0x8540, 0x2c78, 0x600c,
-	0x2060, 0x0804, 0x8540, 0x012e, 0x000e, 0x001e, 0x002e, 0x003e,
-	0x005e, 0x006e, 0x007e, 0x009e, 0x00be, 0x00ce, 0x00de, 0x00ee,
-	0x00fe, 0x0005, 0x6020, 0x9086, 0x0006, 0x1158, 0x0016, 0x0036,
-	0x0076, 0x080c, 0xd51a, 0x080c, 0xd21e, 0x007e, 0x003e, 0x001e,
-	0x08c0, 0x6020, 0x9086, 0x000a, 0x0918, 0x0800, 0x0006, 0x0066,
-	0x0096, 0x00c6, 0x00d6, 0x00f6, 0x9036, 0x0126, 0x2091, 0x8000,
-	0x2079, 0x19b8, 0x7848, 0x9065, 0x0904, 0x8625, 0x600c, 0x0006,
-	0x600f, 0x0000, 0x784c, 0x9c06, 0x11a0, 0x0036, 0x2019, 0x0001,
-	0x080c, 0x9286, 0x783f, 0x0000, 0x901e, 0x7b4e, 0x7b6a, 0x7b52,
-	0x7b6e, 0x003e, 0x000e, 0x9005, 0x1118, 0x600c, 0x600f, 0x0000,
-	0x0006, 0x00e6, 0x2f70, 0x080c, 0x8521, 0x00ee, 0x080c, 0xb847,
-	0x0520, 0x6014, 0x2048, 0x6020, 0x9086, 0x0003, 0x1580, 0x3e08,
-	0x918e, 0x0002, 0x1188, 0x6010, 0x9005, 0x0170, 0x00b6, 0x2058,
-	0xb800, 0x00be, 0xd0bc, 0x0140, 0x6048, 0x9005, 0x1198, 0x2001,
-	0x1959, 0x2004, 0x604a, 0x0070, 0xa867, 0x0103, 0xab7a, 0xa877,
-	0x0000, 0x080c, 0x698a, 0x080c, 0xba36, 0x6044, 0xc0fc, 0x6046,
-	0x080c, 0x9c21, 0x000e, 0x0804, 0x85d3, 0x7e4a, 0x7e46, 0x012e,
-	0x00fe, 0x00de, 0x00ce, 0x009e, 0x006e, 0x000e, 0x0005, 0x6020,
-	0x9086, 0x0006, 0x1118, 0x080c, 0xd21e, 0x0c38, 0x6020, 0x9086,
-	0x000a, 0x09e0, 0x08c8, 0x0016, 0x0026, 0x0086, 0x9046, 0x00a9,
-	0x080c, 0x872c, 0x008e, 0x002e, 0x001e, 0x0005, 0x00f6, 0x0126,
-	0x2079, 0x19b8, 0x2091, 0x8000, 0x080c, 0x8775, 0x080c, 0x8809,
-	0x080c, 0x63fd, 0x012e, 0x00fe, 0x0005, 0x00b6, 0x0096, 0x00f6,
-	0x00e6, 0x00d6, 0x00c6, 0x0066, 0x0016, 0x0006, 0x0126, 0x2091,
-	0x8000, 0x2071, 0x19b8, 0x7620, 0x2660, 0x2678, 0x8cff, 0x0904,
-	0x86f1, 0x6010, 0x2058, 0xb8a0, 0x9206, 0x1904, 0x86ec, 0x88ff,
-	0x0120, 0x605c, 0x9106, 0x1904, 0x86ec, 0x7030, 0x9c06, 0x1570,
-	0x2069, 0x0100, 0x6820, 0xd0a4, 0x1508, 0x080c, 0x820b, 0x080c,
-	0x8fb7, 0x68c3, 0x0000, 0x080c, 0x94a2, 0x7033, 0x0000, 0x0036,
-	0x2069, 0x0140, 0x6b04, 0x9384, 0x1000, 0x0138, 0x2001, 0x0100,
-	0x080c, 0x2833, 0x9006, 0x080c, 0x2833, 0x2069, 0x0100, 0x6824,
-	0xd084, 0x0110, 0x6827, 0x0001, 0x003e, 0x0040, 0x7008, 0xc0ad,
-	0x700a, 0x6003, 0x0009, 0x630a, 0x0804, 0x86ec, 0x7020, 0x9c36,
-	0x1110, 0x660c, 0x7622, 0x701c, 0x9c36, 0x1140, 0x2c00, 0x9f36,
-	0x0118, 0x2f00, 0x701e, 0x0010, 0x701f, 0x0000, 0x660c, 0x0066,
-	0x2c00, 0x9f06, 0x0110, 0x7e0e, 0x0008, 0x2678, 0x600f, 0x0000,
-	0x6044, 0xc0fc, 0x6046, 0x6014, 0x2048, 0x080c, 0xb847, 0x01e8,
-	0x6020, 0x9086, 0x0003, 0x1580, 0x080c, 0xba5c, 0x1118, 0x080c,
-	0xa58f, 0x0098, 0xa867, 0x0103, 0xab7a, 0xa877, 0x0000, 0x0016,
-	0x0036, 0x0086, 0x080c, 0xbb45, 0x080c, 0xd51a, 0x080c, 0x6996,
-	0x008e, 0x003e, 0x001e, 0x080c, 0xba36, 0x080c, 0x9c21, 0x080c,
-	0x9378, 0x00ce, 0x0804, 0x8666, 0x2c78, 0x600c, 0x2060, 0x0804,
-	0x8666, 0x012e, 0x000e, 0x001e, 0x006e, 0x00ce, 0x00de, 0x00ee,
-	0x00fe, 0x009e, 0x00be, 0x0005, 0x6020, 0x9086, 0x0006, 0x1158,
-	0x0016, 0x0036, 0x0086, 0x080c, 0xd51a, 0x080c, 0xd21e, 0x008e,
-	0x003e, 0x001e, 0x08d0, 0x080c, 0xa58f, 0x6020, 0x9086, 0x0002,
-	0x1160, 0x6004, 0x0006, 0x9086, 0x0085, 0x000e, 0x0904, 0x86d2,
-	0x9086, 0x008b, 0x0904, 0x86d2, 0x0840, 0x6020, 0x9086, 0x0005,
-	0x1920, 0x6004, 0x0006, 0x9086, 0x0085, 0x000e, 0x09c8, 0x9086,
-	0x008b, 0x09b0, 0x0804, 0x86e5, 0x0006, 0x00f6, 0x00e6, 0x0096,
-	0x00b6, 0x00c6, 0x0066, 0x0016, 0x0126, 0x2091, 0x8000, 0x9280,
-	0x1000, 0x2004, 0x905d, 0x2079, 0x19b8, 0x9036, 0x7828, 0x2060,
-	0x8cff, 0x0538, 0x6010, 0x9b06, 0x1500, 0x6043, 0xffff, 0x080c,
-	0x9a84, 0x01d8, 0x610c, 0x0016, 0x080c, 0x9110, 0x6014, 0x2048,
-	0xa867, 0x0103, 0xab7a, 0xa877, 0x0000, 0x0016, 0x0036, 0x0086,
-	0x080c, 0xbb45, 0x080c, 0xd51a, 0x080c, 0x6996, 0x008e, 0x003e,
-	0x001e, 0x080c, 0x9c21, 0x00ce, 0x08d8, 0x2c30, 0x600c, 0x2060,
-	0x08b8, 0x080c, 0x641a, 0x012e, 0x001e, 0x006e, 0x00ce, 0x00be,
-	0x009e, 0x00ee, 0x00fe, 0x000e, 0x0005, 0x0096, 0x0006, 0x0066,
-	0x00c6, 0x00d6, 0x9036, 0x7820, 0x9065, 0x0904, 0x87dc, 0x600c,
-	0x0006, 0x6044, 0xc0fc, 0x6046, 0x600f, 0x0000, 0x7830, 0x9c06,
-	0x1588, 0x2069, 0x0100, 0x6820, 0xd0a4, 0x1508, 0x080c, 0x820b,
-	0x080c, 0x8fb7, 0x68c3, 0x0000, 0x080c, 0x94a2, 0x7833, 0x0000,
-	0x0036, 0x2069, 0x0140, 0x6b04, 0x9384, 0x1000, 0x0138, 0x2001,
-	0x0100, 0x080c, 0x2833, 0x9006, 0x080c, 0x2833, 0x2069, 0x0100,
-	0x6824, 0xd084, 0x0110, 0x6827, 0x0001, 0x003e, 0x0058, 0x080c,
-	0x661d, 0x1538, 0x6003, 0x0009, 0x630a, 0x7808, 0xc0ad, 0x780a,
-	0x2c30, 0x00f8, 0x6014, 0x2048, 0x080c, 0xb845, 0x01b0, 0x6020,
-	0x9086, 0x0003, 0x1508, 0x080c, 0xba5c, 0x1118, 0x080c, 0xa58f,
-	0x0060, 0x080c, 0x661d, 0x1168, 0xa867, 0x0103, 0xab7a, 0xa877,
-	0x0000, 0x080c, 0x6996, 0x080c, 0xba36, 0x080c, 0x9c21, 0x080c,
-	0x9378, 0x000e, 0x0804, 0x877c, 0x7e22, 0x7e1e, 0x00de, 0x00ce,
-	0x006e, 0x000e, 0x009e, 0x0005, 0x6020, 0x9086, 0x0006, 0x1118,
-	0x080c, 0xd21e, 0x0c50, 0x080c, 0xa58f, 0x6020, 0x9086, 0x0002,
-	0x1150, 0x6004, 0x0006, 0x9086, 0x0085, 0x000e, 0x0990, 0x9086,
-	0x008b, 0x0978, 0x08d0, 0x6020, 0x9086, 0x0005, 0x19b0, 0x6004,
-	0x0006, 0x9086, 0x0085, 0x000e, 0x0d18, 0x9086, 0x008b, 0x0d00,
-	0x0860, 0x0006, 0x0096, 0x00b6, 0x00c6, 0x0066, 0x9036, 0x7828,
-	0x9065, 0x0510, 0x6010, 0x2058, 0x600c, 0x0006, 0x3e08, 0x918e,
-	0x0002, 0x1118, 0xb800, 0xd0bc, 0x11a8, 0x6043, 0xffff, 0x080c,
-	0x9a84, 0x0180, 0x610c, 0x080c, 0x9110, 0x6014, 0x2048, 0xa867,
-	0x0103, 0xab7a, 0xa877, 0x0000, 0x080c, 0x6996, 0x080c, 0x9c21,
-	0x000e, 0x08f0, 0x2c30, 0x0ce0, 0x006e, 0x00ce, 0x00be, 0x009e,
-	0x000e, 0x0005, 0x00e6, 0x00d6, 0x0096, 0x0066, 0x080c, 0x5dd6,
-	0x11b0, 0x2071, 0x19b8, 0x7030, 0x9080, 0x0005, 0x2004, 0x904d,
-	0x0170, 0xa878, 0x9606, 0x1158, 0x2071, 0x19b8, 0x7030, 0x9035,
-	0x0130, 0x9080, 0x0005, 0x2004, 0x9906, 0x1108, 0x0029, 0x006e,
-	0x009e, 0x00de, 0x00ee, 0x0005, 0x00c6, 0x2660, 0x6043, 0xffff,
-	0x080c, 0x9a84, 0x0178, 0x080c, 0x9110, 0x6014, 0x2048, 0xa867,
-	0x0103, 0xab7a, 0xa877, 0x0000, 0x080c, 0xbb45, 0x080c, 0x6996,
-	0x080c, 0x9c21, 0x00ce, 0x0005, 0x00b6, 0x00e6, 0x00c6, 0x080c,
-	0x9926, 0x0106, 0x190c, 0x98c8, 0x2071, 0x0101, 0x2e04, 0xc0c4,
-	0x2072, 0x6044, 0xd0fc, 0x1138, 0x010e, 0x190c, 0x98e4, 0x00ce,
-	0x00ee, 0x00be, 0x0005, 0x2071, 0x19b8, 0x7030, 0x9005, 0x0da0,
-	0x9c06, 0x190c, 0x0d65, 0x7036, 0x080c, 0x820b, 0x7004, 0x9084,
-	0x0007, 0x0002, 0x88a4, 0x88a6, 0x88ad, 0x88b7, 0x88c5, 0x88a4,
-	0x88ad, 0x88a2, 0x080c, 0x0d65, 0x0428, 0x0005, 0x080c, 0x9a6f,
-	0x7007, 0x0000, 0x7033, 0x0000, 0x00e8, 0x0066, 0x9036, 0x080c,
-	0x9110, 0x006e, 0x7007, 0x0000, 0x7033, 0x0000, 0x0098, 0x080c,
-	0x9a5a, 0x0140, 0x080c, 0x9a6f, 0x0128, 0x0066, 0x9036, 0x080c,
-	0x9110, 0x006e, 0x7033, 0x0000, 0x0028, 0x080c, 0x9a5a, 0x080c,
-	0x94a2, 0x0000, 0x010e, 0x190c, 0x98e4, 0x00ce, 0x00ee, 0x00be,
-	0x0005, 0x00d6, 0x00c6, 0x080c, 0x9926, 0x0106, 0x190c, 0x98c8,
-	0x6044, 0xd0fc, 0x1130, 0x010e, 0x190c, 0x98e4, 0x00ce, 0x00de,
-	0x0005, 0x2069, 0x19b8, 0x684c, 0x9005, 0x0da8, 0x9c06, 0x190c,
-	0x0d65, 0x6852, 0x00e6, 0x2d70, 0x080c, 0x8521, 0x00ee, 0x080c,
-	0x8218, 0x0016, 0x2009, 0x0040, 0x080c, 0x2052, 0x001e, 0x683c,
-	0x9084, 0x0003, 0x0002, 0x8901, 0x8902, 0x8920, 0x88ff, 0x080c,
-	0x0d65, 0x0460, 0x6868, 0x9086, 0x0001, 0x0190, 0x600c, 0x9015,
-	0x0160, 0x6a4a, 0x600f, 0x0000, 0x6044, 0xc0fc, 0x6046, 0x9006,
-	0x7042, 0x684e, 0x683f, 0x0000, 0x00c8, 0x684a, 0x6846, 0x0ca0,
-	0x686b, 0x0000, 0x6848, 0x9065, 0x0d78, 0x6003, 0x0002, 0x0c60,
-	0x9006, 0x686a, 0x6852, 0x686e, 0x600c, 0x9015, 0x0120, 0x6a4a,
-	0x600f, 0x0000, 0x0018, 0x684e, 0x684a, 0x6846, 0x684f, 0x0000,
-	0x010e, 0x190c, 0x98e4, 0x00ce, 0x00de, 0x0005, 0x0005, 0x6020,
-	0x9084, 0x000f, 0x000b, 0x0005, 0x894c, 0x894f, 0x8da8, 0x8e37,
-	0x894f, 0x8da8, 0x8e37, 0x894c, 0x894f, 0x894c, 0x894c, 0x894c,
-	0x894c, 0x894c, 0x894c, 0x894c, 0x080c, 0x8874, 0x0005, 0x00b6,
-	0x0156, 0x0136, 0x0146, 0x01c6, 0x01d6, 0x00c6, 0x00d6, 0x00e6,
-	0x00f6, 0x2069, 0x0200, 0x2071, 0x0240, 0x6004, 0x908a, 0x0053,
-	0x1a0c, 0x0d65, 0x6110, 0x2158, 0xb984, 0x2c78, 0x2061, 0x0100,
-	0x619a, 0x908a, 0x0040, 0x1a04, 0x89bb, 0x005b, 0x00fe, 0x00ee,
-	0x00de, 0x00ce, 0x01de, 0x01ce, 0x014e, 0x013e, 0x015e, 0x00be,
-	0x0005, 0x8b32, 0x8b6d, 0x8b96, 0x8c39, 0x8c5a, 0x8c60, 0x8c6d,
-	0x8c75, 0x8c81, 0x8c87, 0x8c98, 0x8c87, 0x8cef, 0x8c75, 0x8cfb,
-	0x8d01, 0x8c81, 0x8d01, 0x8d0d, 0x89b9, 0x89b9, 0x89b9, 0x89b9,
-	0x89b9, 0x89b9, 0x89b9, 0x89b9, 0x89b9, 0x89b9, 0x89b9, 0x9131,
-	0x9154, 0x9165, 0x9185, 0x91b7, 0x8c6d, 0x89b9, 0x8c6d, 0x8c87,
-	0x89b9, 0x8b96, 0x8c39, 0x89b9, 0x9595, 0x8c87, 0x89b9, 0x95b1,
-	0x8c87, 0x89b9, 0x8c81, 0x8b2c, 0x89dc, 0x89b9, 0x95cd, 0x963a,
-	0x971a, 0x89b9, 0x9727, 0x8c6a, 0x9752, 0x89b9, 0x91c1, 0x975e,
-	0x89b9, 0x080c, 0x0d65, 0x2100, 0x005b, 0x00fe, 0x00ee, 0x00de,
-	0x00ce, 0x01de, 0x01ce, 0x014e, 0x013e, 0x015e, 0x00be, 0x0005,
-	0x89da, 0x89da, 0x89da, 0x8a03, 0x8aaf, 0x8aba, 0x89da, 0x89da,
-	0x89da, 0x8b01, 0x8b0d, 0x8a1e, 0x89da, 0x8a39, 0x8a6d, 0x9ada,
-	0x9b1f, 0x8c87, 0x080c, 0x0d65, 0x00d6, 0x0096, 0x080c, 0x8d20,
-	0x7003, 0x2414, 0x7007, 0x0018, 0x700b, 0x0800, 0x7814, 0x2048,
-	0xa83c, 0x700e, 0xa850, 0x7022, 0xa854, 0x7026, 0x60c3, 0x0018,
-	0x080c, 0x8f87, 0x009e, 0x00de, 0x0005, 0x7810, 0x00b6, 0x2058,
-	0xb8a0, 0x00be, 0x080c, 0x9b66, 0x1118, 0x9084, 0xff80, 0x0110,
-	0x9085, 0x0001, 0x0005, 0x00d6, 0x0096, 0x080c, 0x8d20, 0x7003,
-	0x0500, 0x7814, 0x2048, 0xa874, 0x700a, 0xa878, 0x700e, 0xa87c,
-	0x7012, 0xa880, 0x7016, 0xa884, 0x701a, 0xa888, 0x701e, 0x60c3,
-	0x0010, 0x080c, 0x8f87, 0x009e, 0x00de, 0x0005, 0x00d6, 0x0096,
-	0x080c, 0x8d20, 0x7003, 0x0500, 0x7814, 0x2048, 0xa8cc, 0x700a,
-	0xa8d0, 0x700e, 0xa8d4, 0x7012, 0xa8d8, 0x7016, 0xa8dc, 0x701a,
-	0xa8e0, 0x701e, 0x60c3, 0x0010, 0x080c, 0x8f87, 0x009e, 0x00de,
-	0x0005, 0x00d6, 0x0096, 0x0126, 0x2091, 0x8000, 0x080c, 0x8d20,
-	0x20e9, 0x0000, 0x2001, 0x1974, 0x2003, 0x0000, 0x7814, 0x2048,
-	0xa814, 0x8003, 0x60c2, 0xa830, 0x20a8, 0xa860, 0x20e0, 0xa85c,
-	0x9080, 0x001b, 0x2098, 0x2001, 0x1974, 0x0016, 0x200c, 0x2001,
-	0x0001, 0x080c, 0x2037, 0x080c, 0xc591, 0x9006, 0x080c, 0x2037,
-	0x001e, 0xa804, 0x9005, 0x0110, 0x2048, 0x0c28, 0x04d9, 0x080c,
-	0x8f87, 0x012e, 0x009e, 0x00de, 0x0005, 0x00d6, 0x0096, 0x0126,
-	0x2091, 0x8000, 0x080c, 0x8d6b, 0x20e9, 0x0000, 0x2001, 0x1974,
-	0x2003, 0x0000, 0x7814, 0x2048, 0xa86f, 0x0200, 0xa873, 0x0000,
-	0xa814, 0x8003, 0x60c2, 0xa830, 0x20a8, 0xa860, 0x20e0, 0xa85c,
-	0x9080, 0x001b, 0x2098, 0x2001, 0x1974, 0x0016, 0x200c, 0x080c,
-	0xc591, 0x001e, 0xa804, 0x9005, 0x0110, 0x2048, 0x0c60, 0x0051,
-	0x7814, 0x2048, 0x080c, 0x0fd4, 0x080c, 0x8f87, 0x012e, 0x009e,
-	0x00de, 0x0005, 0x60c0, 0x8004, 0x9084, 0x0003, 0x9005, 0x0130,
-	0x9082, 0x0004, 0x20a3, 0x0000, 0x8000, 0x1de0, 0x0005, 0x080c,
-	0x8d20, 0x7003, 0x7800, 0x7808, 0x8007, 0x700a, 0x60c3, 0x0008,
-	0x0804, 0x8f87, 0x00d6, 0x00e6, 0x080c, 0x8d6b, 0x7814, 0x9084,
-	0xff00, 0x2073, 0x0200, 0x8e70, 0x8e70, 0x9095, 0x0010, 0x2272,
-	0x8e70, 0x2073, 0x0034, 0x8e70, 0x2069, 0x1805, 0x20a9, 0x0004,
-	0x2d76, 0x8d68, 0x8e70, 0x1f04, 0x8ad0, 0x2069, 0x1801, 0x20a9,
-	0x0004, 0x2d76, 0x8d68, 0x8e70, 0x1f04, 0x8ad9, 0x2069, 0x1984,
-	0x9086, 0xdf00, 0x0110, 0x2069, 0x199e, 0x20a9, 0x001a, 0x9e86,
-	0x0260, 0x1148, 0x00c6, 0x2061, 0x0200, 0x6010, 0x8000, 0x6012,
-	0x00ce, 0x2071, 0x0240, 0x2d04, 0x8007, 0x2072, 0x8d68, 0x8e70,
-	0x1f04, 0x8ae7, 0x60c3, 0x004c, 0x080c, 0x8f87, 0x00ee, 0x00de,
-	0x0005, 0x080c, 0x8d20, 0x7003, 0x6300, 0x7007, 0x0028, 0x7808,
-	0x700e, 0x60c3, 0x0008, 0x0804, 0x8f87, 0x00d6, 0x0026, 0x0016,
-	0x080c, 0x8d6b, 0x7003, 0x0200, 0x7814, 0x700e, 0x00e6, 0x9ef0,
-	0x0004, 0x2009, 0x0001, 0x2011, 0x000c, 0x2073, 0x0800, 0x8e70,
-	0x2073, 0x0000, 0x00ee, 0x7206, 0x710a, 0x62c2, 0x080c, 0x8f87,
-	0x001e, 0x002e, 0x00de, 0x0005, 0x2001, 0x1817, 0x2004, 0x609a,
-	0x0804, 0x8f87, 0x080c, 0x8d20, 0x7003, 0x5200, 0x2069, 0x1853,
-	0x6804, 0xd084, 0x0130, 0x6828, 0x0016, 0x080c, 0x2457, 0x710e,
-	0x001e, 0x20a9, 0x0004, 0x20e1, 0x0001, 0x2099, 0x1805, 0x20e9,
-	0x0000, 0x20a1, 0x0250, 0x4003, 0x20a9, 0x0004, 0x2099, 0x1801,
-	0x20a1, 0x0254, 0x4003, 0x080c, 0x9b66, 0x1120, 0xb8a0, 0x9082,
-	0x007f, 0x0248, 0x2001, 0x181e, 0x2004, 0x7032, 0x2001, 0x181f,
-	0x2004, 0x7036, 0x0030, 0x2001, 0x1817, 0x2004, 0x9084, 0x00ff,
-	0x7036, 0x60c3, 0x001c, 0x0804, 0x8f87, 0x080c, 0x8d20, 0x7003,
-	0x0500, 0x080c, 0x9b66, 0x1120, 0xb8a0, 0x9082, 0x007f, 0x0248,
-	0x2001, 0x181e, 0x2004, 0x700a, 0x2001, 0x181f, 0x2004, 0x700e,
-	0x0030, 0x2001, 0x1817, 0x2004, 0x9084, 0x00ff, 0x700e, 0x20a9,
-	0x0004, 0x20e1, 0x0001, 0x2099, 0x1805, 0x20e9, 0x0000, 0x20a1,
-	0x0250, 0x4003, 0x60c3, 0x0010, 0x0804, 0x8f87, 0x080c, 0x8d20,
-	0x9006, 0x080c, 0x6631, 0xb8a0, 0x9086, 0x007e, 0x1130, 0x7003,
-	0x0400, 0x620c, 0xc2b4, 0x620e, 0x0058, 0x7814, 0x0096, 0x904d,
-	0x0120, 0x9006, 0xa89a, 0xa8a6, 0xa8aa, 0x009e, 0x7003, 0x0300,
-	0xb8a0, 0x9086, 0x007e, 0x1904, 0x8c01, 0x00d6, 0x2069, 0x193d,
-	0x2001, 0x1836, 0x2004, 0xd0a4, 0x0178, 0x6800, 0x700a, 0x6808,
-	0x9084, 0x2000, 0x7012, 0x680c, 0x7016, 0x701f, 0x2710, 0x6818,
-	0x7022, 0x681c, 0x7026, 0x0080, 0x6800, 0x700a, 0x6804, 0x700e,
-	0x6808, 0x080c, 0x70b7, 0x1118, 0x9084, 0x37ff, 0x0010, 0x9084,
-	0x3fff, 0x7012, 0x680c, 0x7016, 0x00de, 0x20a9, 0x0004, 0x20e1,
-	0x0001, 0x2099, 0x1805, 0x20e9, 0x0000, 0x20a1, 0x0256, 0x4003,
-	0x20a9, 0x0004, 0x2099, 0x1801, 0x20a1, 0x025a, 0x4003, 0x00d6,
-	0x080c, 0x97e5, 0x2069, 0x1945, 0x2071, 0x024e, 0x6800, 0xc0dd,
-	0x7002, 0x080c, 0x5391, 0xd0e4, 0x0110, 0x680c, 0x700e, 0x00de,
-	0x04a0, 0x2001, 0x1836, 0x2004, 0xd0a4, 0x0168, 0x0016, 0x2009,
-	0x0002, 0x60e0, 0x9106, 0x0130, 0x2100, 0x60e3, 0x0000, 0x080c,
-	0x2498, 0x61e2, 0x001e, 0x20e1, 0x0001, 0x2099, 0x193d, 0x20e9,
-	0x0000, 0x20a1, 0x024e, 0x20a9, 0x0008, 0x4003, 0x20a9, 0x0004,
-	0x2099, 0x1805, 0x20a1, 0x0256, 0x4003, 0x20a9, 0x0004, 0x2099,
-	0x1801, 0x20a1, 0x025a, 0x4003, 0x080c, 0x97e5, 0x20a1, 0x024e,
-	0x20a9, 0x0008, 0x2099, 0x1945, 0x4003, 0x60c3, 0x0074, 0x0804,
-	0x8f87, 0x080c, 0x8d20, 0x7003, 0x2010, 0x7007, 0x0014, 0x700b,
-	0x0800, 0x700f, 0x2000, 0x9006, 0x00f6, 0x2079, 0x1853, 0x7904,
-	0x00fe, 0xd1ac, 0x1110, 0x9085, 0x0020, 0x0010, 0x9085, 0x0010,
-	0x9085, 0x0002, 0x00d6, 0x0804, 0x8cd0, 0x7026, 0x60c3, 0x0014,
-	0x0804, 0x8f87, 0x080c, 0x8d20, 0x7003, 0x5000, 0x0804, 0x8bb0,
-	0x080c, 0x8d20, 0x7003, 0x2110, 0x7007, 0x0014, 0x60c3, 0x0014,
-	0x0804, 0x8f87, 0x080c, 0x8d62, 0x0010, 0x080c, 0x8d6b, 0x7003,
-	0x0200, 0x60c3, 0x0004, 0x0804, 0x8f87, 0x080c, 0x8d6b, 0x7003,
-	0x0100, 0x700b, 0x0003, 0x700f, 0x2a00, 0x60c3, 0x0008, 0x0804,
-	0x8f87, 0x080c, 0x8d6b, 0x7003, 0x0200, 0x0804, 0x8bb0, 0x080c,
-	0x8d6b, 0x7003, 0x0100, 0x782c, 0x9005, 0x0110, 0x700a, 0x0010,
-	0x700b, 0x0003, 0x7814, 0x700e, 0x60c3, 0x0008, 0x0804, 0x8f87,
-	0x00d6, 0x080c, 0x8d6b, 0x7003, 0x0210, 0x7007, 0x0014, 0x700b,
-	0x0800, 0xb894, 0x9086, 0x0014, 0x1198, 0xb99c, 0x9184, 0x0030,
-	0x0190, 0xb998, 0x9184, 0xc000, 0x1140, 0xd1ec, 0x0118, 0x700f,
-	0x2100, 0x0058, 0x700f, 0x0100, 0x0040, 0x700f, 0x0400, 0x0028,
-	0x700f, 0x0700, 0x0010, 0x700f, 0x0800, 0x00f6, 0x2079, 0x1853,
-	0x7904, 0x00fe, 0xd1ac, 0x1110, 0x9085, 0x0020, 0x0010, 0x9085,
-	0x0010, 0x2009, 0x1875, 0x210c, 0xd184, 0x1110, 0x9085, 0x0002,
-	0x0026, 0x2009, 0x1873, 0x210c, 0xd1e4, 0x0150, 0xc0c5, 0xbac4,
-	0xd28c, 0x1108, 0xc0cd, 0x9094, 0x0030, 0x9296, 0x0010, 0x0140,
-	0xd1ec, 0x0130, 0x9094, 0x0030, 0x9296, 0x0010, 0x0108, 0xc0bd,
-	0x002e, 0x7026, 0x60c3, 0x0014, 0x00de, 0x0804, 0x8f87, 0x080c,
-	0x8d6b, 0x7003, 0x0210, 0x7007, 0x0014, 0x700f, 0x0100, 0x60c3,
-	0x0014, 0x0804, 0x8f87, 0x080c, 0x8d6b, 0x7003, 0x0200, 0x0804,
-	0x8b36, 0x080c, 0x8d6b, 0x7003, 0x0100, 0x700b, 0x0003, 0x700f,
-	0x2a00, 0x60c3, 0x0008, 0x0804, 0x8f87, 0x080c, 0x8d6b, 0x7003,
-	0x0100, 0x700b, 0x000b, 0x60c3, 0x0008, 0x0804, 0x8f87, 0x0026,
-	0x00d6, 0x0036, 0x0046, 0x2019, 0x3200, 0x2021, 0x0800, 0x0040,
-	0x0026, 0x00d6, 0x0036, 0x0046, 0x2019, 0x2200, 0x2021, 0x0100,
-	0x080c, 0x97fa, 0xb810, 0x9305, 0x7002, 0xb814, 0x7006, 0x2069,
-	0x1800, 0x6878, 0x700a, 0x687c, 0x700e, 0x9485, 0x0029, 0x7012,
-	0x004e, 0x003e, 0x00de, 0x080c, 0x8f7b, 0x721a, 0x9f95, 0x0000,
-	0x7222, 0x7027, 0xffff, 0x2071, 0x024c, 0x002e, 0x0005, 0x0026,
-	0x080c, 0x97fa, 0x7003, 0x02ff, 0x7007, 0xfffc, 0x00d6, 0x2069,
-	0x1800, 0x6878, 0x700a, 0x687c, 0x700e, 0x00de, 0x7013, 0x2029,
-	0x0c10, 0x7003, 0x0100, 0x7007, 0x0000, 0x700b, 0xfc02, 0x700f,
-	0x0000, 0x0005, 0x0026, 0x00d6, 0x0036, 0x0046, 0x2019, 0x3300,
-	0x2021, 0x0800, 0x0040, 0x0026, 0x00d6, 0x0036, 0x0046, 0x2019,
-	0x2300, 0x2021, 0x0100, 0x080c, 0x97fa, 0xb810, 0x9305, 0x7002,
-	0xb814, 0x7006, 0x2069, 0x1800, 0xb810, 0x9005, 0x1140, 0xb814,
-	0x9005, 0x1128, 0x700b, 0x00ff, 0x700f, 0xfffe, 0x0020, 0x6878,
-	0x700a, 0x687c, 0x700e, 0x0000, 0x9485, 0x0098, 0x7012, 0x004e,
-	0x003e, 0x00de, 0x080c, 0x8f7b, 0x721a, 0x7a08, 0x7222, 0x2f10,
-	0x7226, 0x2071, 0x024c, 0x002e, 0x0005, 0x080c, 0x8f7b, 0x721a,
-	0x7a08, 0x7222, 0x7814, 0x7026, 0x2071, 0x024c, 0x002e, 0x0005,
-	0x00b6, 0x00c6, 0x00d6, 0x00e6, 0x00f6, 0x2069, 0x0200, 0x2071,
-	0x0240, 0x6004, 0x908a, 0x0085, 0x0a0c, 0x0d65, 0x908a, 0x0092,
-	0x1a0c, 0x0d65, 0x6110, 0x2158, 0xb984, 0x2c78, 0x2061, 0x0100,
-	0x619a, 0x9082, 0x0085, 0x0033, 0x00fe, 0x00ee, 0x00de, 0x00ce,
-	0x00be, 0x0005, 0x8dd9, 0x8de8, 0x8df3, 0x8dd7, 0x8dd7, 0x8dd7,
-	0x8dd9, 0x8dd7, 0x8dd7, 0x8dd7, 0x8dd7, 0x8dd7, 0x8dd7, 0x080c,
-	0x0d65, 0x0411, 0x60c3, 0x0000, 0x0026, 0x080c, 0x27a2, 0x0228,
-	0x2011, 0x0101, 0x2204, 0xc0c5, 0x2012, 0x002e, 0x0804, 0x8f87,
-	0x0431, 0x7808, 0x700a, 0x7814, 0x700e, 0x7017, 0xffff, 0x60c3,
-	0x000c, 0x0804, 0x8f87, 0x0479, 0x7003, 0x0003, 0x7007, 0x0300,
-	0x60c3, 0x0004, 0x0804, 0x8f87, 0x0026, 0x080c, 0x97fa, 0xb810,
-	0x9085, 0x8100, 0x7002, 0xb814, 0x7006, 0x2069, 0x1800, 0x6878,
-	0x700a, 0x687c, 0x700e, 0x7013, 0x0009, 0x0804, 0x8d3b, 0x0026,
-	0x080c, 0x97fa, 0xb810, 0x9085, 0x8400, 0x7002, 0xb814, 0x7006,
-	0x2069, 0x1800, 0x6878, 0x700a, 0x687c, 0x700e, 0x2001, 0x0099,
-	0x7012, 0x0804, 0x8d9d, 0x0026, 0x080c, 0x97fa, 0xb810, 0x9085,
-	0x8500, 0x7002, 0xb814, 0x7006, 0x2069, 0x1800, 0x6878, 0x700a,
-	0x687c, 0x700e, 0x2001, 0x0099, 0x7012, 0x0804, 0x8d9d, 0x00b6,
-	0x00c6, 0x00d6, 0x00e6, 0x00f6, 0x2c78, 0x2069, 0x0200, 0x2071,
-	0x0240, 0x7804, 0x908a, 0x0040, 0x0a0c, 0x0d65, 0x908a, 0x0057,
-	0x1a0c, 0x0d65, 0x7910, 0x2158, 0xb984, 0x2061, 0x0100, 0x619a,
-	0x9082, 0x0040, 0x0033, 0x00fe, 0x00ee, 0x00de, 0x00ce, 0x00be,
-	0x0005, 0x8e6c, 0x8e6c, 0x8e6c, 0x8e92, 0x8e6c, 0x8e6c, 0x8e6c,
-	0x8e6c, 0x8e6c, 0x8e6c, 0x8e6c, 0x9355, 0x935d, 0x9365, 0x936d,
-	0x8e6c, 0x8e6c, 0x8e6c, 0x934d, 0x080c, 0x0d65, 0x6813, 0x0008,
-	0xba8c, 0x8210, 0xb8c4, 0xd084, 0x0128, 0x7a4e, 0x7b14, 0x7b52,
-	0x722e, 0x732a, 0x9294, 0x00ff, 0xba8e, 0x8217, 0x721a, 0xba10,
-	0x9295, 0x0600, 0x7202, 0xba14, 0x7206, 0x2069, 0x1800, 0x6a78,
-	0x720a, 0x6a7c, 0x720e, 0x7013, 0x0829, 0x2f10, 0x7222, 0x7027,
-	0xffff, 0x0005, 0x0016, 0x7814, 0x9084, 0x0700, 0x8007, 0x0013,
-	0x001e, 0x0005, 0x8ea2, 0x8ea2, 0x8ea4, 0x8ea2, 0x8ea2, 0x8ea2,
-	0x8ebe, 0x8ea2, 0x080c, 0x0d65, 0x7914, 0x918c, 0x08ff, 0x918d,
-	0xf600, 0x7916, 0x2009, 0x0003, 0x00b9, 0x2069, 0x1853, 0x6804,
-	0xd0bc, 0x0130, 0x682c, 0x9084, 0x00ff, 0x8007, 0x7032, 0x0010,
-	0x7033, 0x3f00, 0x60c3, 0x0001, 0x0804, 0x8f87, 0x2009, 0x0003,
-	0x0019, 0x7033, 0x7f00, 0x0cb0, 0x0016, 0x080c, 0x97fa, 0x001e,
-	0xb810, 0x9085, 0x0100, 0x7002, 0xb814, 0x7006, 0x2069, 0x1800,
-	0x6a78, 0x720a, 0x6a7c, 0x720e, 0x7013, 0x0888, 0x918d, 0x0008,
-	0x7116, 0x080c, 0x8f7b, 0x721a, 0x7a08, 0x7222, 0x2f10, 0x7226,
-	0x0005, 0x00b6, 0x0096, 0x00e6, 0x00d6, 0x00c6, 0x0056, 0x0046,
-	0x0036, 0x2061, 0x0100, 0x2071, 0x1800, 0x7810, 0x2058, 0xb8a0,
-	0x2028, 0xb910, 0xba14, 0x7378, 0x747c, 0x7820, 0x0002, 0x8f06,
-	0x8f06, 0x8f06, 0x8f06, 0x8f06, 0x8f06, 0x8f06, 0x8f06, 0x8f06,
-	0x8f06, 0x8f08, 0x8f06, 0x8f06, 0x8f06, 0x8f06, 0x080c, 0x0d65,
-	0xb884, 0x609e, 0x7814, 0x2048, 0xa87c, 0xd0fc, 0x0558, 0xaf90,
-	0x9784, 0xff00, 0x9105, 0x6062, 0x873f, 0x9784, 0xff00, 0x0006,
-	0x7814, 0x2048, 0xa878, 0xc0fc, 0x9005, 0x000e, 0x1160, 0xaf94,
-	0x87ff, 0x0198, 0x2039, 0x0098, 0x9705, 0x6072, 0x7808, 0x6082,
-	0x2f00, 0x6086, 0x0038, 0x9185, 0x2200, 0x6062, 0x6073, 0x0129,
-	0x6077, 0x0000, 0xb884, 0x609e, 0x0050, 0x2039, 0x0029, 0x9705,
-	0x6072, 0x0cc0, 0x9185, 0x0200, 0x6062, 0x6073, 0x2029, 0xa87c,
-	0xd0fc, 0x0118, 0xaf94, 0x87ff, 0x1120, 0x2f00, 0x6082, 0x7808,
-	0x6086, 0x6266, 0x636a, 0x646e, 0x6077, 0x0000, 0xb88c, 0x8000,
-	0x9084, 0x00ff, 0xb88e, 0x8007, 0x607a, 0x607f, 0x0000, 0xa848,
-	0x608a, 0xa844, 0x608e, 0xa838, 0x60c6, 0xa834, 0x60ca, 0xb86c,
-	0x60ce, 0x60af, 0x95d5, 0x60d7, 0x0000, 0x080c, 0x97da, 0x2009,
-	0x07d0, 0x60c4, 0x9084, 0xfff0, 0x9005, 0x0110, 0x2009, 0x1b58,
-	0x080c, 0x8210, 0x003e, 0x004e, 0x005e, 0x00ce, 0x00de, 0x00ee,
-	0x009e, 0x00be, 0x0005, 0x7a40, 0x9294, 0x00ff, 0x8217, 0x0005,
-	0x00d6, 0x2069, 0x19b8, 0x686b, 0x0001, 0x00de, 0x0005, 0x60a3,
-	0x0056, 0x60a7, 0x9575, 0x00f1, 0x080c, 0x8202, 0x0005, 0x0016,
-	0x2001, 0x180c, 0x200c, 0x9184, 0x0600, 0x9086, 0x0600, 0x0128,
-	0x0089, 0x080c, 0x8202, 0x001e, 0x0005, 0xc1e5, 0x2001, 0x180c,
-	0x2102, 0x2001, 0x19b9, 0x2003, 0x0000, 0x2001, 0x19c4, 0x2003,
-	0x0000, 0x0c88, 0x0006, 0x0016, 0x0026, 0x2009, 0x1804, 0x2011,
-	0x0009, 0x080c, 0x287c, 0x002e, 0x001e, 0x000e, 0x0005, 0x0016,
-	0x00c6, 0x0006, 0x080c, 0x9926, 0x0106, 0x190c, 0x98c8, 0x2061,
-	0x0100, 0x61a4, 0x60a7, 0x95f5, 0x0016, 0x0026, 0x2009, 0x1804,
-	0x2011, 0x0008, 0x080c, 0x287c, 0x002e, 0x001e, 0x010e, 0x190c,
-	0x98e4, 0x000e, 0xa001, 0xa001, 0xa001, 0x61a6, 0x00ce, 0x001e,
-	0x0005, 0x00c6, 0x00d6, 0x0016, 0x0026, 0x2061, 0x0100, 0x2069,
-	0x0140, 0x080c, 0x70b7, 0x1510, 0x2001, 0x19dd, 0x2004, 0x9005,
-	0x1904, 0x9038, 0x080c, 0x7158, 0x11a8, 0x2069, 0x0380, 0x6843,
-	0x0101, 0x6844, 0xd084, 0x1de8, 0x2061, 0x0100, 0x6020, 0xd0b4,
-	0x1120, 0x6024, 0xd084, 0x090c, 0x0d65, 0x6843, 0x0100, 0x080c,
-	0x8202, 0x04b0, 0x00c6, 0x2061, 0x19b8, 0x00f0, 0x6904, 0x9194,
-	0x4000, 0x0598, 0x080c, 0x8fb7, 0x080c, 0x2843, 0x00c6, 0x2061,
-	0x19b8, 0x6134, 0x9192, 0x0008, 0x1278, 0x8108, 0x6136, 0x080c,
-	0x98c8, 0x6130, 0x080c, 0x98e4, 0x00ce, 0x81ff, 0x01c8, 0x080c,
-	0x8202, 0x080c, 0x8faa, 0x00a0, 0x080c, 0x98c8, 0x6130, 0x91e5,
-	0x0000, 0x0150, 0x080c, 0xd610, 0x080c, 0x820b, 0x6003, 0x0001,
-	0x2009, 0x0014, 0x080c, 0x9c85, 0x080c, 0x98e4, 0x00ce, 0x0000,
-	0x002e, 0x001e, 0x00de, 0x00ce, 0x0005, 0x2001, 0x19dd, 0x2004,
-	0x9005, 0x1db0, 0x00c6, 0x2061, 0x19b8, 0x6134, 0x9192, 0x0003,
-	0x1ad8, 0x8108, 0x6136, 0x00ce, 0x080c, 0x8202, 0x080c, 0x5b97,
-	0x2009, 0x1852, 0x2114, 0x8210, 0x220a, 0x0c10, 0x0096, 0x00c6,
-	0x00d6, 0x00e6, 0x0016, 0x0026, 0x080c, 0x8218, 0x080c, 0x98c8,
-	0x2001, 0x0387, 0x2003, 0x0202, 0x2071, 0x19b8, 0x714c, 0x81ff,
-	0x0904, 0x90cc, 0x2061, 0x0100, 0x2069, 0x0140, 0x080c, 0x70b7,
-	0x11c0, 0x0036, 0x2019, 0x0002, 0x080c, 0x9286, 0x003e, 0x714c,
-	0x2160, 0x080c, 0xd610, 0x2009, 0x004a, 0x6003, 0x0003, 0x080c,
-	0x9c85, 0x2001, 0x0386, 0x2003, 0x5040, 0x080c, 0x7158, 0x0804,
-	0x90cc, 0x6904, 0xd1f4, 0x0904, 0x90d9, 0x080c, 0x2843, 0x00c6,
-	0x704c, 0x9065, 0x090c, 0x0d65, 0x6020, 0x00ce, 0x9086, 0x0006,
-	0x1518, 0x61c8, 0x60c4, 0x9105, 0x11f8, 0x2009, 0x180c, 0x2104,
-	0xd0d4, 0x01d0, 0x6214, 0x9294, 0x1800, 0x1128, 0x6224, 0x9294,
-	0x0002, 0x1510, 0x0010, 0xc0d4, 0x200a, 0x6014, 0x9084, 0xe7fd,
-	0x9085, 0x0010, 0x6016, 0x704c, 0x2060, 0x080c, 0x88d1, 0x2009,
-	0x0049, 0x080c, 0x9c85, 0x0080, 0x0036, 0x2019, 0x0001, 0x080c,
-	0x9286, 0x003e, 0x714c, 0x2160, 0x080c, 0xd610, 0x2009, 0x004a,
-	0x6003, 0x0003, 0x080c, 0x9c85, 0x2001, 0x0387, 0x2003, 0x0200,
-	0x080c, 0x98e4, 0x002e, 0x001e, 0x00ee, 0x00de, 0x00ce, 0x009e,
-	0x0005, 0xd1ec, 0x1904, 0x908d, 0x0804, 0x908f, 0x0026, 0x00e6,
-	0x2071, 0x19b8, 0x706c, 0xd084, 0x01d0, 0xc084, 0x706e, 0x714c,
-	0x81ff, 0x01a8, 0x2071, 0x0100, 0x9188, 0x0008, 0x2114, 0x928e,
-	0x0006, 0x1138, 0x2009, 0x1984, 0x2011, 0x0012, 0x080c, 0x287c,
-	0x0030, 0x2009, 0x1984, 0x2011, 0x0016, 0x080c, 0x287c, 0x00ee,
-	0x002e, 0x0005, 0x9036, 0x2001, 0x19c2, 0x2004, 0x9005, 0x0128,
-	0x9c06, 0x0128, 0x2c30, 0x600c, 0x0cc8, 0x9085, 0x0001, 0x0005,
-	0x00f6, 0x2079, 0x19b8, 0x610c, 0x9006, 0x600e, 0x6044, 0xc0fc,
-	0x6046, 0x86ff, 0x1140, 0x7824, 0x9c06, 0x1118, 0x7826, 0x782a,
-	0x0050, 0x792a, 0x0040, 0x00c6, 0x2660, 0x610e, 0x00ce, 0x7824,
-	0x9c06, 0x1108, 0x7e26, 0x080c, 0x9378, 0x080c, 0xba36, 0x00fe,
-	0x0005, 0x080c, 0x8d20, 0x7003, 0x1200, 0x7838, 0x7012, 0x783c,
-	0x7016, 0x00c6, 0x7820, 0x9086, 0x0004, 0x1148, 0x7810, 0x9005,
-	0x0130, 0x00b6, 0x2058, 0xb810, 0xb914, 0x00be, 0x0020, 0x2061,
-	0x1800, 0x6078, 0x617c, 0x9084, 0x00ff, 0x700a, 0x710e, 0x00ce,
-	0x60c3, 0x002c, 0x0804, 0x8f87, 0x080c, 0x8d20, 0x7003, 0x0f00,
-	0x7808, 0xd09c, 0x0128, 0xb810, 0x9084, 0x00ff, 0x700a, 0xb814,
-	0x700e, 0x60c3, 0x0008, 0x0804, 0x8f87, 0x0156, 0x080c, 0x8d6b,
-	0x7003, 0x0200, 0x2011, 0x1848, 0x63f0, 0x2312, 0x20a9, 0x0006,
-	0x2011, 0x1840, 0x2019, 0x1841, 0x9ef0, 0x0002, 0x2376, 0x8e70,
-	0x2276, 0x8e70, 0x9398, 0x0002, 0x9290, 0x0002, 0x1f04, 0x9176,
-	0x60c3, 0x001c, 0x015e, 0x0804, 0x8f87, 0x0016, 0x0026, 0x080c,
-	0x8d47, 0x080c, 0x8d59, 0x9e80, 0x0004, 0x20e9, 0x0000, 0x20a0,
-	0x7814, 0x0096, 0x2048, 0xa800, 0x2048, 0xa860, 0x20e0, 0xa85c,
-	0x9080, 0x0021, 0x2098, 0x009e, 0x7808, 0x9088, 0x0002, 0x21a8,
-	0x9192, 0x0010, 0x1250, 0x4003, 0x9080, 0x0004, 0x8003, 0x60c2,
-	0x080c, 0x8f87, 0x002e, 0x001e, 0x0005, 0x20a9, 0x0010, 0x4003,
-	0x080c, 0x97e5, 0x20a1, 0x0240, 0x22a8, 0x4003, 0x0c68, 0x080c,
-	0x8d20, 0x7003, 0x6200, 0x7808, 0x700e, 0x60c3, 0x0008, 0x0804,
-	0x8f87, 0x0016, 0x0026, 0x080c, 0x8d20, 0x20e9, 0x0000, 0x20a1,
-	0x024c, 0x7814, 0x0096, 0x2048, 0xa800, 0x2048, 0xa860, 0x20e0,
-	0xa85c, 0x9080, 0x0023, 0x2098, 0x009e, 0x7808, 0x9088, 0x0002,
-	0x21a8, 0x4003, 0x8003, 0x60c2, 0x080c, 0x8f87, 0x002e, 0x001e,
-	0x0005, 0x00e6, 0x00c6, 0x0006, 0x0126, 0x2091, 0x8000, 0x2071,
-	0x19b8, 0x7010, 0x2060, 0x8cff, 0x0188, 0x080c, 0xba5c, 0x1110,
-	0x080c, 0xa58f, 0x600c, 0x0006, 0x080c, 0xbcd3, 0x600f, 0x0000,
-	0x080c, 0x9be7, 0x080c, 0x9378, 0x00ce, 0x0c68, 0x2c00, 0x7012,
-	0x700e, 0x012e, 0x000e, 0x00ce, 0x00ee, 0x0005, 0x0126, 0x0156,
-	0x00f6, 0x00e6, 0x00d6, 0x00c6, 0x0066, 0x0026, 0x0016, 0x0006,
-	0x2091, 0x8000, 0x2001, 0x180c, 0x200c, 0x918c, 0xe7ff, 0x2102,
-	0x2069, 0x0100, 0x2079, 0x0140, 0x2071, 0x19b8, 0x7030, 0x2060,
-	0x8cff, 0x0548, 0x080c, 0x8fb7, 0x6ac0, 0x68c3, 0x0000, 0x080c,
-	0x820b, 0x00c6, 0x2061, 0x0100, 0x080c, 0x97fe, 0x00ce, 0x20a9,
-	0x01f4, 0x04b1, 0x080c, 0x8874, 0x6044, 0xd0ac, 0x1128, 0x2001,
-	0x1959, 0x2004, 0x604a, 0x0020, 0x2009, 0x0013, 0x080c, 0x9c85,
-	0x000e, 0x001e, 0x002e, 0x006e, 0x00ce, 0x00de, 0x00ee, 0x00fe,
-	0x015e, 0x012e, 0x0005, 0x2001, 0x1800, 0x2004, 0x9096, 0x0001,
-	0x0d78, 0x9096, 0x0004, 0x0d60, 0x080c, 0x820b, 0x6814, 0x9084,
-	0x0001, 0x0110, 0x68a7, 0x95f5, 0x6817, 0x0008, 0x68c3, 0x0000,
-	0x2011, 0x5b41, 0x080c, 0x8159, 0x20a9, 0x01f4, 0x0009, 0x08c0,
-	0x6824, 0xd094, 0x0140, 0x6827, 0x0004, 0x7804, 0x9084, 0x4000,
-	0x190c, 0x2843, 0x0090, 0xd084, 0x0118, 0x6827, 0x0001, 0x0010,
-	0x1f04, 0x9268, 0x7804, 0x9084, 0x1000, 0x0138, 0x2001, 0x0100,
-	0x080c, 0x2833, 0x9006, 0x080c, 0x2833, 0x0005, 0x0126, 0x0156,
-	0x00f6, 0x00e6, 0x00d6, 0x00c6, 0x0066, 0x0026, 0x0016, 0x0006,
-	0x2091, 0x8000, 0x2001, 0x180c, 0x200c, 0x918c, 0xdbff, 0x2102,
-	0x2069, 0x0100, 0x2079, 0x0140, 0x2071, 0x0380, 0x701c, 0x0006,
-	0x701f, 0x0202, 0x2071, 0x19b8, 0x704c, 0x2060, 0x8cff, 0x0904,
-	0x9327, 0x9386, 0x0002, 0x1128, 0x6814, 0x9084, 0x0002, 0x0904,
-	0x9327, 0x68af, 0x95f5, 0x6817, 0x0010, 0x2009, 0x00fa, 0x8109,
-	0x1df0, 0x69c6, 0x68cb, 0x0008, 0x080c, 0x8218, 0x080c, 0x1c7a,
-	0x0046, 0x2009, 0x00a5, 0x080c, 0x0e3d, 0x2021, 0x0169, 0x2404,
-	0x9084, 0x000f, 0x9086, 0x0004, 0x11f8, 0x68af, 0x95f5, 0x68c6,
-	0x68cb, 0x0008, 0x00e6, 0x00f6, 0x2079, 0x0090, 0x2071, 0x19b8,
-	0x6814, 0x9084, 0x1984, 0x9085, 0x0012, 0x6816, 0x782b, 0x0008,
-	0x7057, 0x0000, 0x00fe, 0x00ee, 0x9386, 0x0002, 0x1128, 0x7884,
-	0x9005, 0x1110, 0x7887, 0x0001, 0x0016, 0x2009, 0x0040, 0x080c,
-	0x2052, 0x001e, 0x2009, 0x0000, 0x080c, 0x0e3d, 0x004e, 0x20a9,
-	0x03e8, 0x6824, 0xd094, 0x0140, 0x6827, 0x0004, 0x7804, 0x9084,
-	0x4000, 0x190c, 0x2843, 0x0090, 0xd08c, 0x0118, 0x6827, 0x0002,
-	0x0010, 0x1f04, 0x92f9, 0x7804, 0x9084, 0x1000, 0x0138, 0x2001,
-	0x0100, 0x080c, 0x2833, 0x9006, 0x080c, 0x2833, 0x6827, 0x4000,
-	0x6824, 0x83ff, 0x1160, 0x2009, 0x0049, 0x080c, 0x88d1, 0x6044,
-	0xd0ac, 0x1118, 0x6003, 0x0002, 0x0010, 0x080c, 0x9c85, 0x000e,
-	0x2071, 0x0380, 0xd08c, 0x1110, 0x701f, 0x0200, 0x000e, 0x001e,
-	0x002e, 0x006e, 0x00ce, 0x00de, 0x00ee, 0x00fe, 0x015e, 0x012e,
-	0x0005, 0x00d6, 0x0126, 0x2091, 0x8000, 0x2069, 0x19b8, 0x6a06,
-	0x012e, 0x00de, 0x0005, 0x00d6, 0x0126, 0x2091, 0x8000, 0x2069,
-	0x19b8, 0x6a3e, 0x012e, 0x00de, 0x0005, 0x080c, 0x8e6e, 0x785c,
-	0x7032, 0x7042, 0x7047, 0x1000, 0x00f8, 0x080c, 0x8e6e, 0x785c,
-	0x7032, 0x7042, 0x7047, 0x4000, 0x00b8, 0x080c, 0x8e6e, 0x785c,
-	0x7032, 0x7042, 0x7047, 0x2000, 0x0078, 0x080c, 0x8e6e, 0x785c,
-	0x7032, 0x7042, 0x7047, 0x0400, 0x0038, 0x080c, 0x8e6e, 0x785c,
-	0x7032, 0x7042, 0x7047, 0x0200, 0x60c3, 0x0020, 0x0804, 0x8f87,
-	0x00e6, 0x2071, 0x19b8, 0x702c, 0x9005, 0x0110, 0x8001, 0x702e,
-	0x00ee, 0x0005, 0x00f6, 0x00e6, 0x00d6, 0x00c6, 0x0076, 0x0066,
-	0x0006, 0x0126, 0x2091, 0x8000, 0x2071, 0x19b8, 0x7620, 0x2660,
-	0x2678, 0x2039, 0x0001, 0x87ff, 0x0904, 0x941d, 0x8cff, 0x0904,
-	0x941d, 0x6020, 0x9086, 0x0006, 0x1904, 0x9418, 0x88ff, 0x0138,
-	0x2800, 0x9c06, 0x1904, 0x9418, 0x2039, 0x0000, 0x0050, 0x6010,
-	0x9b06, 0x1904, 0x9418, 0x85ff, 0x0120, 0x605c, 0x9106, 0x1904,
-	0x9418, 0x7030, 0x9c06, 0x15b0, 0x2069, 0x0100, 0x68c0, 0x9005,
-	0x1160, 0x6824, 0xd084, 0x0148, 0x6827, 0x0001, 0x080c, 0x820b,
-	0x080c, 0x94a2, 0x7033, 0x0000, 0x0428, 0x080c, 0x820b, 0x6820,
-	0xd0b4, 0x0110, 0x68a7, 0x95f5, 0x6817, 0x0008, 0x68c3, 0x0000,
-	0x080c, 0x94a2, 0x7033, 0x0000, 0x0036, 0x2069, 0x0140, 0x6b04,
-	0x9384, 0x1000, 0x0138, 0x2001, 0x0100, 0x080c, 0x2833, 0x9006,
-	0x080c, 0x2833, 0x2069, 0x0100, 0x6824, 0xd084, 0x0110, 0x6827,
-	0x0001, 0x003e, 0x7020, 0x9c36, 0x1110, 0x660c, 0x7622, 0x701c,
-	0x9c36, 0x1140, 0x2c00, 0x9f36, 0x0118, 0x2f00, 0x701e, 0x0010,
-	0x701f, 0x0000, 0x660c, 0x0066, 0x2c00, 0x9f06, 0x0110, 0x7e0e,
-	0x0008, 0x2678, 0x89ff, 0x1168, 0x600f, 0x0000, 0x6014, 0x0096,
-	0x2048, 0x080c, 0xb845, 0x0110, 0x080c, 0xd21e, 0x009e, 0x080c,
-	0x9c21, 0x080c, 0x9378, 0x88ff, 0x1190, 0x00ce, 0x0804, 0x9393,
-	0x2c78, 0x600c, 0x2060, 0x0804, 0x9393, 0x9006, 0x012e, 0x000e,
-	0x006e, 0x007e, 0x00ce, 0x00de, 0x00ee, 0x00fe, 0x0005, 0x601b,
-	0x0000, 0x00ce, 0x98c5, 0x0001, 0x0c88, 0x00f6, 0x00e6, 0x00d6,
-	0x0096, 0x00c6, 0x0066, 0x0026, 0x0006, 0x0126, 0x2091, 0x8000,
-	0x2071, 0x19b8, 0x7648, 0x2660, 0x2678, 0x8cff, 0x0904, 0x9491,
-	0x6020, 0x9086, 0x0006, 0x1904, 0x948c, 0x87ff, 0x0128, 0x2700,
-	0x9c06, 0x1904, 0x948c, 0x0040, 0x6010, 0x9b06, 0x15e8, 0x85ff,
-	0x0118, 0x605c, 0x9106, 0x15c0, 0x704c, 0x9c06, 0x1168, 0x0036,
-	0x2019, 0x0001, 0x080c, 0x9286, 0x703f, 0x0000, 0x9006, 0x704e,
-	0x706a, 0x7052, 0x706e, 0x003e, 0x7048, 0x9c36, 0x1110, 0x660c,
-	0x764a, 0x7044, 0x9c36, 0x1140, 0x2c00, 0x9f36, 0x0118, 0x2f00,
-	0x7046, 0x0010, 0x7047, 0x0000, 0x660c, 0x0066, 0x2c00, 0x9f06,
-	0x0110, 0x7e0e, 0x0008, 0x2678, 0x600f, 0x0000, 0x6014, 0x2048,
-	0x080c, 0xb845, 0x0110, 0x080c, 0xd21e, 0x080c, 0x9c21, 0x87ff,
-	0x1198, 0x00ce, 0x0804, 0x943d, 0x2c78, 0x600c, 0x2060, 0x0804,
-	0x943d, 0x9006, 0x012e, 0x000e, 0x002e, 0x006e, 0x00ce, 0x009e,
-	0x00de, 0x00ee, 0x00fe, 0x0005, 0x601b, 0x0000, 0x00ce, 0x97bd,
-	0x0001, 0x0c80, 0x00e6, 0x2071, 0x19b8, 0x7033, 0x0000, 0x7004,
-	0x9086, 0x0003, 0x0158, 0x2001, 0x1800, 0x2004, 0x9086, 0x0002,
-	0x1118, 0x7007, 0x0005, 0x0010, 0x7007, 0x0000, 0x00ee, 0x0005,
-	0x00f6, 0x00e6, 0x00c6, 0x0066, 0x0026, 0x0006, 0x0126, 0x2091,
-	0x8000, 0x2071, 0x19b8, 0x2c10, 0x7648, 0x2660, 0x2678, 0x8cff,
-	0x0518, 0x2200, 0x9c06, 0x11e0, 0x7048, 0x9c36, 0x1110, 0x660c,
-	0x764a, 0x7044, 0x9c36, 0x1140, 0x2c00, 0x9f36, 0x0118, 0x2f00,
-	0x7046, 0x0010, 0x7047, 0x0000, 0x660c, 0x2c00, 0x9f06, 0x0110,
-	0x7e0e, 0x0008, 0x2678, 0x600f, 0x0000, 0x9085, 0x0001, 0x0020,
-	0x2c78, 0x600c, 0x2060, 0x08d8, 0x012e, 0x000e, 0x002e, 0x006e,
-	0x00ce, 0x00ee, 0x00fe, 0x0005, 0x0096, 0x00f6, 0x00e6, 0x00d6,
-	0x00c6, 0x0066, 0x0026, 0x0006, 0x0126, 0x2091, 0x8000, 0x2071,
-	0x19b8, 0x7610, 0x2660, 0x2678, 0x8cff, 0x0904, 0x9584, 0x6010,
-	0x00b6, 0x2058, 0xb8a0, 0x00be, 0x9206, 0x1904, 0x957f, 0x7030,
-	0x9c06, 0x1520, 0x2069, 0x0100, 0x68c0, 0x9005, 0x0904, 0x955b,
-	0x080c, 0x8fb7, 0x68c3, 0x0000, 0x080c, 0x94a2, 0x7033, 0x0000,
+	0x2004, 0xd084, 0x190c, 0x11c9, 0x00ee, 0x00fe, 0x009e, 0x0005,
+	0x00f6, 0x2079, 0x0050, 0x7044, 0xd084, 0x01b8, 0xc084, 0x7046,
+	0x7838, 0x7938, 0x910e, 0x1de0, 0x00d6, 0x2069, 0x0000, 0x6836,
+	0x6833, 0x0013, 0x00de, 0x2091, 0x4080, 0x2001, 0x0089, 0x2004,
+	0xd084, 0x190c, 0x11c9, 0x00fe, 0x0005, 0x782c, 0x9094, 0x0780,
+	0x190c, 0x6c9f, 0xd0a4, 0x0db8, 0x00e6, 0x2071, 0x1800, 0x7824,
+	0x2048, 0x702c, 0xa802, 0x2900, 0x702e, 0x70bc, 0x8000, 0x70be,
+	0x080c, 0x8053, 0x782c, 0x9094, 0x0780, 0x190c, 0x6c9f, 0xd0a4,
+	0x1d70, 0x00d6, 0x2069, 0x0050, 0x693c, 0x2069, 0x1919, 0x6808,
+	0x690a, 0x2069, 0x19d3, 0x9102, 0x1118, 0x683c, 0x9005, 0x1328,
+	0x2001, 0x191a, 0x200c, 0x810d, 0x693e, 0x00de, 0x00ee, 0x00fe,
+	0x0005, 0x7094, 0x908a, 0x0029, 0x1a0c, 0x0d65, 0x9082, 0x001d,
+	0x003b, 0x0026, 0x2011, 0x1e00, 0x080c, 0x288c, 0x002e, 0x0005,
+	0x6e3c, 0x6dc2, 0x6dde, 0x6e08, 0x6e2b, 0x6e6b, 0x6e7d, 0x6dde,
+	0x6e53, 0x6d7d, 0x6dab, 0x6d7c, 0x0005, 0x00d6, 0x2069, 0x0200,
+	0x6804, 0x9005, 0x1180, 0x6808, 0x9005, 0x1518, 0x7097, 0x0028,
+	0x2069, 0x195f, 0x2d04, 0x7002, 0x080c, 0x71d7, 0x6028, 0x9085,
+	0x0600, 0x602a, 0x00b0, 0x7097, 0x0028, 0x2069, 0x195f, 0x2d04,
+	0x7002, 0x6028, 0x9085, 0x0600, 0x602a, 0x00e6, 0x0036, 0x0046,
+	0x0056, 0x2071, 0x1a3b, 0x080c, 0x196c, 0x005e, 0x004e, 0x003e,
+	0x00ee, 0x00de, 0x0005, 0x00d6, 0x2069, 0x0200, 0x6804, 0x9005,
+	0x1178, 0x6808, 0x9005, 0x1160, 0x7097, 0x0028, 0x2069, 0x195f,
+	0x2d04, 0x7002, 0x080c, 0x7279, 0x6028, 0x9085, 0x0600, 0x602a,
+	0x00de, 0x0005, 0x0006, 0x2001, 0x0090, 0x080c, 0x2852, 0x000e,
+	0x6124, 0xd1e4, 0x1190, 0x080c, 0x6eee, 0xd1d4, 0x1160, 0xd1dc,
+	0x1138, 0xd1cc, 0x0150, 0x7097, 0x0020, 0x080c, 0x6eee, 0x0028,
+	0x7097, 0x001d, 0x0010, 0x7097, 0x001f, 0x0005, 0x2001, 0x0088,
+	0x080c, 0x2852, 0x6124, 0xd1cc, 0x11e8, 0xd1dc, 0x11c0, 0xd1e4,
+	0x1198, 0x9184, 0x1e00, 0x11d8, 0x080c, 0x1996, 0x60e3, 0x0001,
+	0x600c, 0xc0b4, 0x600e, 0x080c, 0x70c2, 0x2001, 0x0080, 0x080c,
+	0x2852, 0x7097, 0x0028, 0x0058, 0x7097, 0x001e, 0x0040, 0x7097,
+	0x001d, 0x0028, 0x7097, 0x0020, 0x0010, 0x7097, 0x001f, 0x0005,
+	0x080c, 0x1996, 0x60e3, 0x0001, 0x600c, 0xc0b4, 0x600e, 0x080c,
+	0x70c2, 0x2001, 0x0080, 0x080c, 0x2852, 0x6124, 0xd1d4, 0x1180,
+	0xd1dc, 0x1158, 0xd1e4, 0x1130, 0x9184, 0x1e00, 0x1158, 0x7097,
+	0x0028, 0x0040, 0x7097, 0x001e, 0x0028, 0x7097, 0x001d, 0x0010,
+	0x7097, 0x001f, 0x0005, 0x2001, 0x00a0, 0x080c, 0x2852, 0x6124,
+	0xd1dc, 0x1138, 0xd1e4, 0x0138, 0x080c, 0x1996, 0x7097, 0x001e,
+	0x0010, 0x7097, 0x001d, 0x0005, 0x080c, 0x6f77, 0x6124, 0xd1dc,
+	0x1188, 0x080c, 0x6eee, 0x0016, 0x080c, 0x1996, 0x001e, 0xd1d4,
+	0x1128, 0xd1e4, 0x0138, 0x7097, 0x001e, 0x0020, 0x7097, 0x001f,
+	0x080c, 0x6eee, 0x0005, 0x0006, 0x2001, 0x00a0, 0x080c, 0x2852,
+	0x000e, 0x6124, 0xd1d4, 0x1160, 0xd1cc, 0x1150, 0xd1dc, 0x1128,
+	0xd1e4, 0x0140, 0x7097, 0x001e, 0x0028, 0x7097, 0x001d, 0x0010,
+	0x7097, 0x0021, 0x0005, 0x080c, 0x6f77, 0x6124, 0xd1d4, 0x1150,
+	0xd1dc, 0x1128, 0xd1e4, 0x0140, 0x7097, 0x001e, 0x0028, 0x7097,
+	0x001d, 0x0010, 0x7097, 0x001f, 0x0005, 0x0006, 0x2001, 0x0090,
+	0x080c, 0x2852, 0x000e, 0x6124, 0xd1d4, 0x1178, 0xd1cc, 0x1150,
+	0xd1dc, 0x1128, 0xd1e4, 0x0158, 0x7097, 0x001e, 0x0040, 0x7097,
+	0x001d, 0x0028, 0x7097, 0x0020, 0x0010, 0x7097, 0x001f, 0x0005,
+	0x0016, 0x00c6, 0x00d6, 0x00e6, 0x0126, 0x2061, 0x0100, 0x2069,
+	0x0140, 0x2071, 0x1800, 0x2091, 0x8000, 0x080c, 0x7096, 0x11f8,
+	0x2001, 0x180c, 0x200c, 0xd1b4, 0x01d0, 0xc1b4, 0x2102, 0x0026,
+	0x2011, 0x0200, 0x080c, 0x288c, 0x002e, 0x080c, 0x2838, 0x6024,
+	0xd0cc, 0x0148, 0x2001, 0x00a0, 0x080c, 0x2852, 0x080c, 0x7396,
+	0x080c, 0x5cd7, 0x0428, 0x6028, 0xc0cd, 0x602a, 0x0408, 0x080c,
+	0x70b0, 0x0150, 0x080c, 0x70a7, 0x1138, 0x2001, 0x0001, 0x080c,
+	0x23e2, 0x080c, 0x706a, 0x00a0, 0x080c, 0x6f74, 0x0178, 0x2001,
+	0x0001, 0x080c, 0x23e2, 0x7094, 0x9086, 0x001e, 0x0120, 0x7094,
+	0x9086, 0x0022, 0x1118, 0x7097, 0x0025, 0x0010, 0x7097, 0x0021,
+	0x012e, 0x00ee, 0x00de, 0x00ce, 0x001e, 0x0005, 0x0026, 0x2011,
+	0x6eff, 0x080c, 0x823e, 0x002e, 0x0016, 0x0026, 0x2009, 0x0064,
+	0x2011, 0x6eff, 0x080c, 0x8235, 0x002e, 0x001e, 0x0005, 0x00e6,
+	0x00f6, 0x0016, 0x080c, 0x8f9c, 0x2071, 0x1800, 0x080c, 0x6e98,
+	0x001e, 0x00fe, 0x00ee, 0x0005, 0x0016, 0x0026, 0x0036, 0x00c6,
+	0x00d6, 0x00e6, 0x00f6, 0x0126, 0x080c, 0x8f9c, 0x2061, 0x0100,
+	0x2069, 0x0140, 0x2071, 0x1800, 0x2091, 0x8000, 0x6028, 0xc09c,
+	0x602a, 0x080c, 0x98bb, 0x2011, 0x0003, 0x080c, 0x931c, 0x2011,
+	0x0002, 0x080c, 0x9326, 0x080c, 0x91e9, 0x080c, 0x81ea, 0x0036,
+	0x901e, 0x080c, 0x9269, 0x003e, 0x080c, 0x98d7, 0x60e3, 0x0000,
+	0x080c, 0xd60c, 0x080c, 0xd627, 0x2009, 0x0004, 0x080c, 0x283e,
+	0x080c, 0x2758, 0x2001, 0x1800, 0x2003, 0x0004, 0x2011, 0x0008,
+	0x080c, 0x288c, 0x2011, 0x6eff, 0x080c, 0x823e, 0x080c, 0x70b0,
+	0x0118, 0x9006, 0x080c, 0x2852, 0x080c, 0x0bab, 0x2001, 0x0001,
+	0x080c, 0x23e2, 0x012e, 0x00fe, 0x00ee, 0x00de, 0x00ce, 0x003e,
+	0x002e, 0x001e, 0x0005, 0x0026, 0x00e6, 0x2011, 0x6f0c, 0x2071,
+	0x19d3, 0x701c, 0x9206, 0x1118, 0x7018, 0x9005, 0x0110, 0x9085,
+	0x0001, 0x00ee, 0x002e, 0x0005, 0x6020, 0xd09c, 0x0005, 0x6800,
+	0x9084, 0xfffe, 0x9086, 0x00c0, 0x01b8, 0x2001, 0x00c0, 0x080c,
+	0x2852, 0x0156, 0x20a9, 0x002d, 0x1d04, 0x6f84, 0x2091, 0x6000,
+	0x1f04, 0x6f84, 0x015e, 0x00d6, 0x2069, 0x1800, 0x6898, 0x8001,
+	0x0220, 0x0118, 0x689a, 0x00de, 0x0005, 0x689b, 0x0014, 0x68e8,
+	0xd0dc, 0x0dc8, 0x6800, 0x9086, 0x0001, 0x1da8, 0x080c, 0x824a,
+	0x0c90, 0x00c6, 0x00d6, 0x00e6, 0x2061, 0x0100, 0x2069, 0x0140,
+	0x2071, 0x1800, 0x080c, 0x73a5, 0x2001, 0x193d, 0x2003, 0x0000,
+	0x9006, 0x7096, 0x60e2, 0x6886, 0x080c, 0x24b1, 0x9006, 0x080c,
+	0x2852, 0x080c, 0x5b92, 0x0026, 0x2011, 0xffff, 0x080c, 0x288c,
+	0x002e, 0x602b, 0x182c, 0x00ee, 0x00de, 0x00ce, 0x0005, 0x00c6,
+	0x00d6, 0x00e6, 0x2061, 0x0100, 0x2069, 0x0140, 0x2071, 0x1800,
+	0x2001, 0x194d, 0x200c, 0x9186, 0x0000, 0x0158, 0x9186, 0x0001,
+	0x0158, 0x9186, 0x0002, 0x0158, 0x9186, 0x0003, 0x0158, 0x0804,
+	0x705a, 0x7097, 0x0022, 0x0040, 0x7097, 0x0021, 0x0028, 0x7097,
+	0x0023, 0x0010, 0x7097, 0x0024, 0x60e3, 0x0000, 0x6887, 0x0001,
+	0x2001, 0x0001, 0x080c, 0x24b1, 0x080c, 0x98bb, 0x0026, 0x080c,
+	0x9b60, 0x002e, 0x080c, 0x98d7, 0x7000, 0x908e, 0x0004, 0x0118,
+	0x602b, 0x0028, 0x0010, 0x602b, 0x0020, 0x0156, 0x0126, 0x2091,
+	0x8000, 0x20a9, 0x0005, 0x6024, 0xd0ac, 0x0150, 0x012e, 0x015e,
+	0x080c, 0xbf61, 0x0118, 0x9006, 0x080c, 0x287c, 0x0804, 0x7066,
+	0x6800, 0x9084, 0x00a1, 0xc0bd, 0x6802, 0x080c, 0x2838, 0x6904,
+	0xd1d4, 0x1140, 0x2001, 0x0100, 0x080c, 0x2852, 0x1f04, 0x700b,
+	0x080c, 0x70ed, 0x012e, 0x015e, 0x080c, 0x70a7, 0x0170, 0x6044,
+	0x9005, 0x0130, 0x080c, 0x70ed, 0x9006, 0x8001, 0x1df0, 0x0028,
+	0x6804, 0xd0d4, 0x1110, 0x080c, 0x70ed, 0x080c, 0xbf61, 0x0118,
+	0x9006, 0x080c, 0x287c, 0x0016, 0x0026, 0x7000, 0x908e, 0x0004,
+	0x0130, 0x2009, 0x00c8, 0x2011, 0x6f0c, 0x080c, 0x81fc, 0x002e,
+	0x001e, 0x080c, 0x804a, 0x7034, 0xc085, 0x7036, 0x2001, 0x194d,
+	0x2003, 0x0004, 0x080c, 0x6d61, 0x080c, 0x70a7, 0x0138, 0x6804,
+	0xd0d4, 0x1120, 0xd0dc, 0x1100, 0x080c, 0x739b, 0x00ee, 0x00de,
+	0x00ce, 0x0005, 0x00c6, 0x00d6, 0x00e6, 0x2061, 0x0100, 0x2069,
+	0x0140, 0x2071, 0x1800, 0x080c, 0x8061, 0x080c, 0x8053, 0x080c,
+	0x73a5, 0x2001, 0x193d, 0x2003, 0x0000, 0x9006, 0x7096, 0x60e2,
+	0x6886, 0x080c, 0x24b1, 0x9006, 0x080c, 0x2852, 0x6043, 0x0090,
+	0x6043, 0x0010, 0x0026, 0x2011, 0xffff, 0x080c, 0x288c, 0x002e,
+	0x602b, 0x182c, 0x00ee, 0x00de, 0x00ce, 0x0005, 0x0006, 0x2001,
+	0x194c, 0x2004, 0x9086, 0xaaaa, 0x000e, 0x0005, 0x0006, 0x080c,
+	0x538c, 0x9084, 0x0030, 0x9086, 0x0000, 0x000e, 0x0005, 0x0006,
+	0x080c, 0x538c, 0x9084, 0x0030, 0x9086, 0x0030, 0x000e, 0x0005,
+	0x0006, 0x080c, 0x538c, 0x9084, 0x0030, 0x9086, 0x0010, 0x000e,
+	0x0005, 0x0006, 0x080c, 0x538c, 0x9084, 0x0030, 0x9086, 0x0020,
+	0x000e, 0x0005, 0x0036, 0x0016, 0x2001, 0x180c, 0x2004, 0x908c,
+	0x0013, 0x0180, 0x0020, 0x080c, 0x24d1, 0x900e, 0x0028, 0x080c,
+	0x665e, 0x1dc8, 0x2009, 0x0002, 0x2019, 0x0028, 0x080c, 0x2fd3,
+	0x9006, 0x0019, 0x001e, 0x003e, 0x0005, 0x00e6, 0x2071, 0x180c,
+	0x2e04, 0x0130, 0x080c, 0xbf5a, 0x1128, 0x9085, 0x0010, 0x0010,
+	0x9084, 0xffef, 0x2072, 0x00ee, 0x0005, 0x6050, 0x0006, 0x60ec,
+	0x0006, 0x600c, 0x0006, 0x6004, 0x0006, 0x6028, 0x0006, 0x602f,
+	0x0100, 0x602f, 0x0000, 0x602f, 0x0040, 0x602f, 0x0000, 0x20a9,
+	0x0002, 0x080c, 0x2819, 0x0026, 0x2011, 0x0040, 0x080c, 0x288c,
+	0x002e, 0x000e, 0x602a, 0x000e, 0x6006, 0x000e, 0x600e, 0x000e,
+	0x60ee, 0x60e3, 0x0000, 0x6887, 0x0001, 0x2001, 0x0001, 0x080c,
+	0x24b1, 0x2001, 0x00a0, 0x0006, 0x080c, 0xbf61, 0x000e, 0x0130,
+	0x080c, 0x2870, 0x9006, 0x080c, 0x287c, 0x0010, 0x080c, 0x2852,
+	0x000e, 0x6052, 0x6050, 0x0006, 0xc0e5, 0x6052, 0x00f6, 0x2079,
+	0x0100, 0x080c, 0x27c9, 0x00fe, 0x000e, 0x6052, 0x0005, 0x0156,
+	0x0016, 0x0026, 0x0036, 0x00c6, 0x00d6, 0x00e6, 0x2061, 0x0100,
+	0x2069, 0x0140, 0x2071, 0x1800, 0x080c, 0x9919, 0x0158, 0x2001,
+	0x0386, 0x2004, 0xd0b4, 0x1130, 0x2001, 0x0016, 0x080c, 0x98ac,
+	0x0804, 0x71c9, 0x2001, 0x180c, 0x200c, 0xc1c4, 0x2102, 0x6028,
+	0x9084, 0xe1ff, 0x602a, 0x2011, 0x0200, 0x080c, 0x288c, 0x2001,
+	0x0090, 0x080c, 0x2852, 0x20a9, 0x0366, 0x6024, 0xd0cc, 0x1558,
+	0x1d04, 0x7165, 0x2091, 0x6000, 0x1f04, 0x7165, 0x080c, 0x98bb,
+	0x2011, 0x0003, 0x080c, 0x931c, 0x2011, 0x0002, 0x080c, 0x9326,
+	0x080c, 0x91e9, 0x901e, 0x080c, 0x9269, 0x2001, 0x0386, 0x2003,
+	0x7000, 0x080c, 0x98d7, 0x2001, 0x00a0, 0x080c, 0x2852, 0x080c,
+	0x7396, 0x080c, 0x5cd7, 0x080c, 0xbf61, 0x0110, 0x080c, 0x0cd1,
+	0x9085, 0x0001, 0x04e0, 0x2001, 0x0386, 0x2004, 0xd0ac, 0x0110,
+	0x080c, 0x1996, 0x60e3, 0x0000, 0x2001, 0x0002, 0x080c, 0x24b1,
+	0x60e2, 0x2001, 0x0080, 0x080c, 0x2852, 0x20a9, 0x0366, 0x2011,
+	0x1e00, 0x080c, 0x288c, 0x2009, 0x1e00, 0x080c, 0x2838, 0x6024,
+	0x910c, 0x0140, 0x1d04, 0x71a7, 0x2091, 0x6000, 0x1f04, 0x71a7,
+	0x0804, 0x716e, 0x2001, 0x0386, 0x2003, 0x7000, 0x6028, 0x9085,
+	0x1e00, 0x602a, 0x70b0, 0x9005, 0x1118, 0x6887, 0x0001, 0x0008,
+	0x6886, 0x080c, 0xbf61, 0x0110, 0x080c, 0x0cd1, 0x9006, 0x00ee,
+	0x00de, 0x00ce, 0x003e, 0x002e, 0x001e, 0x015e, 0x0005, 0x0156,
+	0x0016, 0x0026, 0x0036, 0x00c6, 0x00d6, 0x00e6, 0x2061, 0x0100,
+	0x2071, 0x1800, 0x7000, 0x9086, 0x0003, 0x1168, 0x2001, 0x020b,
+	0x2004, 0x9084, 0x5540, 0x9086, 0x5540, 0x1128, 0x2069, 0x1a46,
+	0x2d04, 0x8000, 0x206a, 0x2069, 0x0140, 0x6020, 0x9084, 0x00c0,
+	0x0120, 0x6884, 0x9005, 0x1904, 0x7240, 0x2001, 0x0088, 0x080c,
+	0x2852, 0x9006, 0x60e2, 0x6886, 0x080c, 0x24b1, 0x2069, 0x0200,
+	0x6804, 0x9005, 0x1118, 0x6808, 0x9005, 0x01d0, 0x6028, 0x9084,
+	0xfbff, 0x602a, 0x2011, 0x0400, 0x080c, 0x288c, 0x2069, 0x195f,
+	0x7000, 0x206a, 0x7097, 0x0026, 0x7003, 0x0001, 0x20a9, 0x0002,
+	0x1d04, 0x7220, 0x2091, 0x6000, 0x1f04, 0x7220, 0x0804, 0x7271,
+	0x2069, 0x0140, 0x20a9, 0x0384, 0x2011, 0x1e00, 0x080c, 0x288c,
+	0x2009, 0x1e00, 0x080c, 0x2838, 0x6024, 0x910c, 0x0528, 0x9084,
+	0x1a00, 0x1510, 0x1d04, 0x722c, 0x2091, 0x6000, 0x1f04, 0x722c,
+	0x080c, 0x98bb, 0x2011, 0x0003, 0x080c, 0x931c, 0x2011, 0x0002,
+	0x080c, 0x9326, 0x080c, 0x91e9, 0x901e, 0x080c, 0x9269, 0x080c,
+	0x98d7, 0x2001, 0x00a0, 0x080c, 0x2852, 0x080c, 0x7396, 0x080c,
+	0x5cd7, 0x9085, 0x0001, 0x00a8, 0x2001, 0x0080, 0x080c, 0x2852,
+	0x2069, 0x0140, 0x60e3, 0x0000, 0x70b0, 0x9005, 0x1118, 0x6887,
+	0x0001, 0x0008, 0x6886, 0x2001, 0x0002, 0x080c, 0x24b1, 0x60e2,
+	0x9006, 0x00ee, 0x00de, 0x00ce, 0x003e, 0x002e, 0x001e, 0x015e,
+	0x0005, 0x0156, 0x0016, 0x0026, 0x0036, 0x00c6, 0x00d6, 0x00e6,
+	0x2061, 0x0100, 0x2071, 0x1800, 0x6020, 0x9084, 0x00c0, 0x01e8,
+	0x080c, 0x98bb, 0x2011, 0x0003, 0x080c, 0x931c, 0x2011, 0x0002,
+	0x080c, 0x9326, 0x080c, 0x91e9, 0x901e, 0x080c, 0x9269, 0x080c,
+	0x98d7, 0x2069, 0x0140, 0x2001, 0x00a0, 0x080c, 0x2852, 0x080c,
+	0x7396, 0x080c, 0x5cd7, 0x0804, 0x7313, 0x2001, 0x180c, 0x200c,
+	0xd1b4, 0x1160, 0xc1b5, 0x2102, 0x080c, 0x6ef4, 0x2069, 0x0140,
+	0x2001, 0x0080, 0x080c, 0x2852, 0x60e3, 0x0000, 0x2069, 0x0200,
+	0x6804, 0x9005, 0x1118, 0x6808, 0x9005, 0x0190, 0x6028, 0x9084,
+	0xfdff, 0x602a, 0x2011, 0x0200, 0x080c, 0x288c, 0x2069, 0x195f,
+	0x7000, 0x206a, 0x7097, 0x0027, 0x7003, 0x0001, 0x0804, 0x7313,
+	0x2011, 0x1e00, 0x080c, 0x288c, 0x2009, 0x1e00, 0x080c, 0x2838,
+	0x6024, 0x910c, 0x01c8, 0x9084, 0x1c00, 0x11b0, 0x1d04, 0x72d0,
+	0x0006, 0x0016, 0x00c6, 0x00d6, 0x00e6, 0x080c, 0x8092, 0x00ee,
+	0x00de, 0x00ce, 0x001e, 0x000e, 0x00e6, 0x2071, 0x19d3, 0x7018,
+	0x00ee, 0x9005, 0x19e8, 0x01f8, 0x0026, 0x2011, 0x6f0c, 0x080c,
+	0x8138, 0x2011, 0x6eff, 0x080c, 0x823e, 0x002e, 0x2069, 0x0140,
+	0x60e3, 0x0000, 0x70b0, 0x9005, 0x1118, 0x6887, 0x0001, 0x0008,
+	0x6886, 0x2001, 0x0002, 0x080c, 0x24b1, 0x60e2, 0x2001, 0x180c,
+	0x200c, 0xc1b4, 0x2102, 0x00ee, 0x00de, 0x00ce, 0x003e, 0x002e,
+	0x001e, 0x015e, 0x0005, 0x0156, 0x0016, 0x0026, 0x0036, 0x0046,
+	0x00c6, 0x00e6, 0x2061, 0x0100, 0x2071, 0x1800, 0x080c, 0xbf5a,
+	0x1904, 0x7380, 0x7130, 0xd184, 0x1170, 0x080c, 0x317a, 0x0138,
+	0xc18d, 0x7132, 0x2011, 0x1854, 0x2214, 0xd2ac, 0x1120, 0x7030,
+	0xd08c, 0x0904, 0x7380, 0x2011, 0x1854, 0x220c, 0x0438, 0x0016,
+	0x2019, 0x000e, 0x080c, 0xd1fc, 0x0156, 0x00b6, 0x20a9, 0x007f,
+	0x900e, 0x9186, 0x007e, 0x01a0, 0x9186, 0x0080, 0x0188, 0x080c,
+	0x626b, 0x1170, 0x2120, 0x9006, 0x0016, 0x2009, 0x000e, 0x080c,
+	0xd284, 0x2009, 0x0001, 0x2011, 0x0100, 0x080c, 0x83cd, 0x001e,
+	0x8108, 0x1f04, 0x7349, 0x00be, 0x015e, 0x001e, 0xd1ac, 0x1148,
+	0x0016, 0x2009, 0x0002, 0x2019, 0x0004, 0x080c, 0x2fd3, 0x001e,
+	0x0078, 0x0156, 0x00b6, 0x20a9, 0x007f, 0x900e, 0x080c, 0x626b,
+	0x1110, 0x080c, 0x5cf1, 0x8108, 0x1f04, 0x7376, 0x00be, 0x015e,
+	0x080c, 0x1996, 0x080c, 0x98bb, 0x080c, 0x9b60, 0x080c, 0x98d7,
+	0x60e3, 0x0000, 0x080c, 0x5cd7, 0x080c, 0x6fc7, 0x00ee, 0x00ce,
+	0x004e, 0x003e, 0x002e, 0x001e, 0x015e, 0x0005, 0x2001, 0x194d,
+	0x2003, 0x0001, 0x0005, 0x2001, 0x194d, 0x2003, 0x0000, 0x0005,
+	0x2001, 0x194c, 0x2003, 0xaaaa, 0x0005, 0x2001, 0x194c, 0x2003,
+	0x0000, 0x0005, 0x2071, 0x18f0, 0x7003, 0x0000, 0x7007, 0x0000,
+	0x080c, 0x103b, 0x090c, 0x0d65, 0xa8ab, 0xdcb0, 0x2900, 0x704e,
+	0x080c, 0x103b, 0x090c, 0x0d65, 0xa8ab, 0xdcb0, 0x2900, 0x7052,
+	0xa867, 0x0000, 0xa86b, 0x0001, 0xa89f, 0x0000, 0x0005, 0x00e6,
+	0x2071, 0x0040, 0x6848, 0x9005, 0x1118, 0x9085, 0x0001, 0x04b0,
+	0x6840, 0x9005, 0x0150, 0x04a1, 0x6a50, 0x9200, 0x7002, 0x6854,
+	0x9101, 0x7006, 0x9006, 0x7012, 0x7016, 0x6850, 0x7002, 0x6854,
+	0x7006, 0x6858, 0x700a, 0x685c, 0x700e, 0x6840, 0x9005, 0x1110,
+	0x7012, 0x7016, 0x6848, 0x701a, 0x701c, 0x9085, 0x0040, 0x701e,
+	0x2001, 0x0019, 0x7036, 0x702b, 0x0001, 0x2001, 0x0004, 0x200c,
+	0x918c, 0xfff7, 0x918d, 0x8000, 0x2102, 0x00d6, 0x2069, 0x18f0,
+	0x6807, 0x0001, 0x00de, 0x080c, 0x79a2, 0x9006, 0x00ee, 0x0005,
+	0x900e, 0x0156, 0x20a9, 0x0006, 0x8003, 0x818d, 0x1f04, 0x740c,
+	0x015e, 0x0005, 0x2079, 0x0040, 0x2071, 0x18f0, 0x7004, 0x0002,
+	0x7422, 0x7423, 0x746e, 0x74c9, 0x760a, 0x7420, 0x7420, 0x7634,
+	0x080c, 0x0d65, 0x0005, 0x2079, 0x0040, 0x2001, 0x1dc0, 0x2003,
+	0x0000, 0x782c, 0x908c, 0x0780, 0x190c, 0x7a2e, 0xd0a4, 0x0570,
+	0x2001, 0x1dc0, 0x2004, 0x9082, 0x0080, 0x1640, 0x1d04, 0x7440,
+	0x2001, 0x19d6, 0x200c, 0x8109, 0x0508, 0x2091, 0x6000, 0x2102,
+	0x7824, 0x2048, 0x9006, 0xa802, 0xa806, 0xa864, 0x9084, 0x00ff,
+	0x908a, 0x0040, 0x0608, 0x00b8, 0x2001, 0x1800, 0x200c, 0x9186,
+	0x0003, 0x1160, 0x7104, 0x9186, 0x0004, 0x0140, 0x9186, 0x0007,
+	0x0128, 0x9186, 0x0003, 0x1968, 0x080c, 0x74c9, 0x782c, 0xd09c,
+	0x090c, 0x79a2, 0x0005, 0x9082, 0x005a, 0x1218, 0x2100, 0x003b,
+	0x0c18, 0x080c, 0x74ff, 0x0c90, 0x00e3, 0x08f0, 0x0005, 0x74ff,
+	0x74ff, 0x74ff, 0x74ff, 0x74ff, 0x74ff, 0x74ff, 0x74ff, 0x7521,
+	0x74ff, 0x74ff, 0x74ff, 0x74ff, 0x74ff, 0x74ff, 0x74ff, 0x74ff,
+	0x74ff, 0x74ff, 0x74ff, 0x74ff, 0x74ff, 0x74ff, 0x74ff, 0x74ff,
+	0x74ff, 0x74ff, 0x74ff, 0x750b, 0x74ff, 0x7709, 0x74ff, 0x74ff,
+	0x74ff, 0x7521, 0x74ff, 0x750b, 0x774a, 0x778b, 0x77d2, 0x77e6,
+	0x74ff, 0x74ff, 0x7521, 0x750b, 0x74ff, 0x74ff, 0x75de, 0x7891,
+	0x78ac, 0x74ff, 0x7521, 0x74ff, 0x74ff, 0x74ff, 0x74ff, 0x75d4,
+	0x78ac, 0x74ff, 0x74ff, 0x74ff, 0x74ff, 0x74ff, 0x74ff, 0x74ff,
+	0x74ff, 0x74ff, 0x7535, 0x74ff, 0x74ff, 0x74ff, 0x74ff, 0x74ff,
+	0x74ff, 0x74ff, 0x74ff, 0x74ff, 0x79d2, 0x74ff, 0x74ff, 0x74ff,
+	0x74ff, 0x74ff, 0x7549, 0x74ff, 0x74ff, 0x74ff, 0x74ff, 0x74ff,
+	0x74ff, 0x2079, 0x0040, 0x7004, 0x9086, 0x0003, 0x1198, 0x782c,
+	0x080c, 0x79cb, 0xd0a4, 0x0170, 0x7824, 0x2048, 0x9006, 0xa802,
+	0xa806, 0xa864, 0x9084, 0x00ff, 0x908a, 0x001a, 0x1210, 0x002b,
+	0x0c50, 0x00e9, 0x080c, 0x79a2, 0x0005, 0x74ff, 0x750b, 0x76f5,
+	0x74ff, 0x750b, 0x74ff, 0x750b, 0x750b, 0x74ff, 0x750b, 0x76f5,
+	0x750b, 0x750b, 0x750b, 0x750b, 0x750b, 0x74ff, 0x750b, 0x76f5,
+	0x74ff, 0x74ff, 0x750b, 0x74ff, 0x74ff, 0x74ff, 0x750b, 0x00e6,
+	0x2071, 0x18f0, 0x2009, 0x0400, 0x0071, 0x00ee, 0x0005, 0x2009,
+	0x1000, 0x0049, 0x0005, 0x2009, 0x2000, 0x0029, 0x0005, 0x2009,
+	0x0800, 0x0009, 0x0005, 0x7007, 0x0001, 0xa868, 0x9084, 0x00ff,
+	0x9105, 0xa86a, 0x0126, 0x2091, 0x8000, 0x080c, 0x6991, 0x012e,
+	0x0005, 0xa864, 0x8007, 0x9084, 0x00ff, 0x0d08, 0x8001, 0x1120,
+	0x7007, 0x0001, 0x0804, 0x76b3, 0x7007, 0x0003, 0x7012, 0x2900,
+	0x7016, 0x701a, 0x704b, 0x76b3, 0x0005, 0xa864, 0x8007, 0x9084,
+	0x00ff, 0x0968, 0x8001, 0x1120, 0x7007, 0x0001, 0x0804, 0x76ce,
+	0x7007, 0x0003, 0x7012, 0x2900, 0x7016, 0x701a, 0x704b, 0x76ce,
+	0x0005, 0xa864, 0x8007, 0x9084, 0x00ff, 0x9086, 0x0001, 0x1904,
+	0x7507, 0x7007, 0x0001, 0x2009, 0x1833, 0x210c, 0x81ff, 0x1904,
+	0x75ab, 0xa994, 0x9186, 0x006f, 0x0188, 0x9186, 0x0074, 0x15b0,
+	0x0026, 0x2011, 0x0010, 0x080c, 0x668a, 0x002e, 0x0578, 0x0016,
+	0xa998, 0x080c, 0x66d4, 0x001e, 0x1548, 0x0400, 0x080c, 0x7096,
+	0x0140, 0xa897, 0x4005, 0xa89b, 0x0016, 0x2001, 0x0030, 0x900e,
+	0x0438, 0x0026, 0x2011, 0x8008, 0x080c, 0x668a, 0x002e, 0x01b0,
+	0x0016, 0x0026, 0x0036, 0xa998, 0xaaa0, 0xab9c, 0x918d, 0x8000,
+	0x080c, 0x66d4, 0x003e, 0x002e, 0x001e, 0x1140, 0xa897, 0x4005,
+	0xa89b, 0x4009, 0x2001, 0x0030, 0x900e, 0x0050, 0xa868, 0x9084,
+	0x00ff, 0xa86a, 0xa883, 0x0000, 0x080c, 0x5f02, 0x1108, 0x0005,
+	0x0126, 0x2091, 0x8000, 0xa867, 0x0139, 0xa87a, 0xa982, 0x080c,
+	0x6991, 0x012e, 0x0ca0, 0xa994, 0x9186, 0x0071, 0x0904, 0x7559,
+	0x9186, 0x0064, 0x0904, 0x7559, 0x9186, 0x007c, 0x0904, 0x7559,
+	0x9186, 0x0028, 0x0904, 0x7559, 0x9186, 0x0038, 0x0904, 0x7559,
+	0x9186, 0x0078, 0x0904, 0x7559, 0x9186, 0x005f, 0x0904, 0x7559,
+	0x9186, 0x0056, 0x0904, 0x7559, 0xa897, 0x4005, 0xa89b, 0x0001,
+	0x2001, 0x0030, 0x900e, 0x0860, 0xa87c, 0x9084, 0x00c0, 0x9086,
+	0x00c0, 0x1120, 0x7007, 0x0001, 0x0804, 0x78c3, 0x2900, 0x7016,
+	0x701a, 0x20a9, 0x0004, 0xa860, 0x20e0, 0xa85c, 0x9080, 0x0030,
+	0x2098, 0x7050, 0x2040, 0xa060, 0x20e8, 0xa05c, 0x9080, 0x0023,
+	0x20a0, 0x4003, 0xa888, 0x7012, 0x9082, 0x0401, 0x1a04, 0x750f,
+	0xaab4, 0x928a, 0x0002, 0x1a04, 0x750f, 0x82ff, 0x1138, 0xa8b8,
+	0xa9bc, 0x9105, 0x0118, 0x2001, 0x7671, 0x0018, 0x9280, 0x7667,
+	0x2005, 0x7056, 0x7010, 0x9015, 0x0904, 0x7652, 0x080c, 0x103b,
+	0x1118, 0x7007, 0x0004, 0x0005, 0x2900, 0x7022, 0x7054, 0x2060,
+	0xe000, 0xa866, 0x7050, 0x2040, 0xa95c, 0xe004, 0x9100, 0xa076,
+	0xa860, 0xa072, 0xe008, 0x920a, 0x1210, 0x900e, 0x2200, 0x7112,
+	0xe20c, 0x8003, 0x800b, 0x9296, 0x0004, 0x0108, 0x9108, 0xa17a,
+	0x810b, 0xa17e, 0x080c, 0x1117, 0xa06c, 0x908e, 0x0100, 0x0170,
+	0x9086, 0x0200, 0x0118, 0x7007, 0x0007, 0x0005, 0x7020, 0x2048,
+	0x080c, 0x1054, 0x7014, 0x2048, 0x0804, 0x750f, 0x7020, 0x2048,
+	0x7018, 0xa802, 0xa807, 0x0000, 0x2908, 0x2048, 0xa906, 0x711a,
+	0x0804, 0x760a, 0x7014, 0x2048, 0x7007, 0x0001, 0xa8b4, 0x9005,
+	0x1128, 0xa8b8, 0xa9bc, 0x9105, 0x0108, 0x00b9, 0xa864, 0x9084,
+	0x00ff, 0x9086, 0x001e, 0x0904, 0x78c3, 0x0804, 0x76b3, 0x7669,
+	0x766d, 0x0002, 0x001d, 0x0007, 0x0004, 0x000a, 0x001b, 0x0005,
+	0x0006, 0x000a, 0x001d, 0x0005, 0x0004, 0x0076, 0x0066, 0xafb8,
+	0xaebc, 0xa804, 0x2050, 0xb0c0, 0xb0e2, 0xb0bc, 0xb0de, 0xb0b8,
+	0xb0d2, 0xb0b4, 0xb0ce, 0xb6da, 0xb7d6, 0xb0b0, 0xb0ca, 0xb0ac,
+	0xb0c6, 0xb0a8, 0xb0ba, 0xb0a4, 0xb0b6, 0xb6c2, 0xb7be, 0xb0a0,
+	0xb0b2, 0xb09c, 0xb0ae, 0xb098, 0xb0a2, 0xb094, 0xb09e, 0xb6aa,
+	0xb7a6, 0xb090, 0xb09a, 0xb08c, 0xb096, 0xb088, 0xb08a, 0xb084,
+	0xb086, 0xb692, 0xb78e, 0xb080, 0xb082, 0xb07c, 0xb07e, 0xb078,
+	0xb072, 0xb074, 0xb06e, 0xb67a, 0xb776, 0xb004, 0x9055, 0x1958,
+	0x006e, 0x007e, 0x0005, 0x2009, 0x1833, 0x210c, 0x81ff, 0x1178,
+	0x080c, 0x5d51, 0x1108, 0x0005, 0x080c, 0x6ba2, 0x0126, 0x2091,
+	0x8000, 0x080c, 0xbb45, 0x080c, 0x6991, 0x012e, 0x0ca0, 0x080c,
+	0xbf5a, 0x1d70, 0x2001, 0x0028, 0x900e, 0x0c70, 0x2009, 0x1833,
+	0x210c, 0x81ff, 0x11d8, 0xa888, 0x9005, 0x01e0, 0xa883, 0x0000,
+	0xa87c, 0xd0f4, 0x0120, 0x080c, 0x5e64, 0x1138, 0x0005, 0x9006,
+	0xa87a, 0x080c, 0x5ddf, 0x1108, 0x0005, 0x0126, 0x2091, 0x8000,
+	0xa87a, 0xa982, 0x080c, 0x6991, 0x012e, 0x0cb0, 0x2001, 0x0028,
+	0x900e, 0x0c98, 0x2001, 0x0000, 0x0c80, 0x7018, 0xa802, 0x2908,
+	0x2048, 0xa906, 0x711a, 0x7010, 0x8001, 0x7012, 0x0118, 0x7007,
+	0x0003, 0x0030, 0x7014, 0x2048, 0x7007, 0x0001, 0x7048, 0x080f,
+	0x0005, 0x00b6, 0x7007, 0x0001, 0xa974, 0xa878, 0x9084, 0x00ff,
+	0x9096, 0x0004, 0x0540, 0x20a9, 0x0001, 0x9096, 0x0001, 0x0190,
+	0x900e, 0x20a9, 0x0800, 0x9096, 0x0002, 0x0160, 0x9005, 0x11d8,
+	0xa974, 0x080c, 0x626b, 0x11b8, 0x0066, 0xae80, 0x080c, 0x637b,
+	0x006e, 0x0088, 0x0046, 0x2011, 0x180c, 0x2224, 0xc484, 0x2412,
+	0x004e, 0x00c6, 0x080c, 0x626b, 0x1110, 0x080c, 0x654e, 0x8108,
+	0x1f04, 0x7732, 0x00ce, 0xa87c, 0xd084, 0x1120, 0x080c, 0x1054,
+	0x00be, 0x0005, 0x0126, 0x2091, 0x8000, 0x080c, 0x6991, 0x012e,
+	0x00be, 0x0005, 0x0126, 0x2091, 0x8000, 0x7007, 0x0001, 0x080c,
+	0x6662, 0x0580, 0x2061, 0x1a3e, 0x6100, 0xd184, 0x0178, 0xa888,
+	0x9084, 0x00ff, 0x1550, 0x6000, 0xd084, 0x0520, 0x6004, 0x9005,
+	0x1538, 0x6003, 0x0000, 0x600b, 0x0000, 0x00c8, 0x2011, 0x0001,
+	0xa890, 0x9005, 0x1110, 0x2001, 0x001e, 0x8000, 0x6016, 0xa888,
+	0x9084, 0x00ff, 0x0178, 0x6006, 0xa888, 0x8007, 0x9084, 0x00ff,
+	0x0148, 0x600a, 0xa888, 0x8000, 0x1108, 0xc28d, 0x6202, 0x012e,
+	0x0804, 0x798c, 0x012e, 0x0804, 0x7986, 0x012e, 0x0804, 0x7980,
+	0x012e, 0x0804, 0x7983, 0x0126, 0x2091, 0x8000, 0x7007, 0x0001,
+	0x080c, 0x6662, 0x05e0, 0x2061, 0x1a3e, 0x6000, 0xd084, 0x05b8,
+	0x6204, 0x6308, 0xd08c, 0x1530, 0xac78, 0x9484, 0x0003, 0x0170,
+	0xa988, 0x918c, 0x00ff, 0x8001, 0x1120, 0x2100, 0x9210, 0x0620,
+	0x0028, 0x8001, 0x1508, 0x2100, 0x9212, 0x02f0, 0x9484, 0x000c,
+	0x0188, 0xa988, 0x810f, 0x918c, 0x00ff, 0x9082, 0x0004, 0x1120,
+	0x2100, 0x9318, 0x0288, 0x0030, 0x9082, 0x0004, 0x1168, 0x2100,
+	0x931a, 0x0250, 0xa890, 0x9005, 0x0110, 0x8000, 0x6016, 0x6206,
+	0x630a, 0x012e, 0x0804, 0x798c, 0x012e, 0x0804, 0x7989, 0x012e,
+	0x0804, 0x7986, 0x0126, 0x2091, 0x8000, 0x7007, 0x0001, 0x2061,
+	0x1a3e, 0x6300, 0xd38c, 0x1120, 0x6308, 0x8318, 0x0220, 0x630a,
+	0x012e, 0x0804, 0x799a, 0x012e, 0x0804, 0x7989, 0x00b6, 0x0126,
+	0x00c6, 0x2091, 0x8000, 0x7007, 0x0001, 0xa87c, 0xd0ac, 0x0148,
+	0x00c6, 0x2061, 0x1a3e, 0x6000, 0x9084, 0xfcff, 0x6002, 0x00ce,
+	0x0440, 0xa888, 0x9005, 0x05d8, 0xa88c, 0x9065, 0x0598, 0x2001,
+	0x1833, 0x2004, 0x9005, 0x0118, 0x080c, 0x9c14, 0x0068, 0x6017,
+	0xf400, 0x6063, 0x0000, 0xa97c, 0xd1a4, 0x0110, 0xa980, 0x6162,
+	0x2009, 0x0041, 0x080c, 0x9c76, 0xa988, 0x918c, 0xff00, 0x9186,
+	0x2000, 0x1138, 0x0026, 0x900e, 0x2011, 0xfdff, 0x080c, 0x83cd,
+	0x002e, 0xa87c, 0xd0c4, 0x0148, 0x2061, 0x1a3e, 0x6000, 0xd08c,
+	0x1120, 0x6008, 0x8000, 0x0208, 0x600a, 0x00ce, 0x012e, 0x00be,
+	0x0804, 0x798c, 0x00ce, 0x012e, 0x00be, 0x0804, 0x7986, 0xa984,
+	0x9186, 0x002e, 0x0d30, 0x9186, 0x002d, 0x0d18, 0x9186, 0x0045,
+	0x0510, 0x9186, 0x002a, 0x1130, 0x2001, 0x180c, 0x200c, 0xc194,
+	0x2102, 0x08b8, 0x9186, 0x0020, 0x0158, 0x9186, 0x0029, 0x1d10,
+	0xa974, 0x080c, 0x626b, 0x1968, 0xb800, 0xc0e4, 0xb802, 0x0848,
+	0xa88c, 0x9065, 0x09b8, 0x6007, 0x0024, 0x2001, 0x1956, 0x2004,
+	0x601a, 0x0804, 0x7821, 0xa88c, 0x9065, 0x0960, 0x00e6, 0xa890,
+	0x9075, 0x2001, 0x1833, 0x2004, 0x9005, 0x0150, 0x080c, 0x9c14,
+	0x8eff, 0x0118, 0x2e60, 0x080c, 0x9c14, 0x00ee, 0x0804, 0x7821,
+	0x6024, 0xc0dc, 0xc0d5, 0x6026, 0x2e60, 0x6007, 0x003a, 0xa8a0,
+	0x9005, 0x0130, 0x6007, 0x003b, 0xa8a4, 0x602e, 0xa8a8, 0x6016,
+	0x6003, 0x0001, 0x2009, 0x8020, 0x080c, 0x84b3, 0x00ee, 0x0804,
+	0x7821, 0x2061, 0x1a3e, 0x6000, 0xd084, 0x0190, 0xd08c, 0x1904,
+	0x799a, 0x0126, 0x2091, 0x8000, 0x6204, 0x8210, 0x0220, 0x6206,
+	0x012e, 0x0804, 0x799a, 0x012e, 0xa883, 0x0016, 0x0804, 0x7993,
+	0xa883, 0x0007, 0x0804, 0x7993, 0xa864, 0x8007, 0x9084, 0x00ff,
+	0x0130, 0x8001, 0x1138, 0x7007, 0x0001, 0x0069, 0x0005, 0x080c,
+	0x7507, 0x0040, 0x7007, 0x0003, 0x7012, 0x2900, 0x7016, 0x701a,
+	0x704b, 0x78c3, 0x0005, 0x00b6, 0x00e6, 0x0126, 0x2091, 0x8000,
+	0x903e, 0x2061, 0x1800, 0x61cc, 0x81ff, 0x1904, 0x7945, 0x6130,
+	0xd194, 0x1904, 0x796f, 0xa878, 0x2070, 0x9e82, 0x1ddc, 0x0a04,
+	0x7939, 0x6064, 0x9e02, 0x1a04, 0x7939, 0x7120, 0x9186, 0x0006,
+	0x1904, 0x792b, 0x7010, 0x905d, 0x0904, 0x7945, 0xb800, 0xd0e4,
+	0x1904, 0x7969, 0x2061, 0x1a3e, 0x6100, 0x9184, 0x0301, 0x9086,
+	0x0001, 0x15a0, 0x7024, 0xd0dc, 0x1904, 0x7972, 0xa883, 0x0000,
+	0xa803, 0x0000, 0x2908, 0x7014, 0x9005, 0x1198, 0x7116, 0xa87c,
+	0xd0f4, 0x1904, 0x7975, 0x080c, 0x5388, 0xd09c, 0x1118, 0xa87c,
+	0xc0cc, 0xa87e, 0x2e60, 0x080c, 0x82bd, 0x012e, 0x00ee, 0x00be,
+	0x0005, 0x2048, 0xa800, 0x9005, 0x1de0, 0xa902, 0x2148, 0xa87c,
+	0xd0f4, 0x1904, 0x7975, 0x012e, 0x00ee, 0x00be, 0x0005, 0x012e,
+	0x00ee, 0xa883, 0x0006, 0x00be, 0x0804, 0x7993, 0xd184, 0x0db8,
+	0xd1c4, 0x1190, 0x00a0, 0xa974, 0x080c, 0x626b, 0x15d0, 0xb800,
+	0xd0e4, 0x15b8, 0x7120, 0x9186, 0x0007, 0x1118, 0xa883, 0x0002,
+	0x0490, 0xa883, 0x0008, 0x0478, 0xa883, 0x000e, 0x0460, 0xa883,
+	0x0017, 0x0448, 0xa883, 0x0035, 0x0430, 0x080c, 0x538c, 0xd0fc,
+	0x01e8, 0xa878, 0x2070, 0x9e82, 0x1ddc, 0x02c0, 0x6064, 0x9e02,
+	0x12a8, 0x7120, 0x9186, 0x0006, 0x1188, 0x7010, 0x905d, 0x0170,
+	0xb800, 0xd0bc, 0x0158, 0x2039, 0x0001, 0x7000, 0x9086, 0x0007,
+	0x1904, 0x78cf, 0x7003, 0x0002, 0x0804, 0x78cf, 0xa883, 0x0028,
+	0x0010, 0xa883, 0x0029, 0x012e, 0x00ee, 0x00be, 0x0420, 0xa883,
+	0x002a, 0x0cc8, 0xa883, 0x0045, 0x0cb0, 0x2e60, 0x2019, 0x0002,
+	0x601b, 0x0014, 0x080c, 0xce09, 0x012e, 0x00ee, 0x00be, 0x0005,
+	0x2009, 0x003e, 0x0058, 0x2009, 0x0004, 0x0040, 0x2009, 0x0006,
+	0x0028, 0x2009, 0x0016, 0x0010, 0x2009, 0x0001, 0xa884, 0x9084,
+	0xff00, 0x9105, 0xa886, 0x0126, 0x2091, 0x8000, 0x080c, 0x6991,
+	0x012e, 0x0005, 0x080c, 0x1054, 0x0005, 0x00d6, 0x080c, 0x82b4,
+	0x00de, 0x0005, 0x00d6, 0x00e6, 0x0126, 0x2091, 0x8000, 0x2071,
+	0x0040, 0x702c, 0xd084, 0x01d8, 0x908c, 0x0780, 0x190c, 0x7a2e,
+	0xd09c, 0x11a8, 0x2071, 0x1800, 0x70bc, 0x90ea, 0x0040, 0x0278,
+	0x8001, 0x70be, 0x702c, 0x2048, 0xa800, 0x702e, 0x9006, 0xa802,
+	0xa806, 0x2071, 0x0040, 0x2900, 0x7022, 0x702c, 0x0c28, 0x012e,
+	0x00ee, 0x00de, 0x0005, 0x0006, 0x9084, 0x0780, 0x190c, 0x7a2e,
+	0x000e, 0x0005, 0x00d6, 0x00c6, 0x0036, 0x0026, 0x0016, 0x00b6,
+	0x7007, 0x0001, 0xaa74, 0x9282, 0x0004, 0x1a04, 0x7a1f, 0xa97c,
+	0x9188, 0x1000, 0x2104, 0x905d, 0xb804, 0xd284, 0x0140, 0x05e8,
+	0x8007, 0x9084, 0x00ff, 0x9084, 0x0006, 0x1108, 0x04b0, 0x2b10,
+	0x080c, 0x9b84, 0x1118, 0x080c, 0x9c49, 0x05a8, 0x6212, 0xa874,
+	0x0002, 0x79fd, 0x7a02, 0x7a05, 0x7a0b, 0x2019, 0x0002, 0x080c,
+	0xd1fc, 0x0060, 0x080c, 0xd18c, 0x0048, 0x2019, 0x0002, 0xa980,
+	0x080c, 0xd1ab, 0x0018, 0xa980, 0x080c, 0xd18c, 0x080c, 0x9bda,
+	0xa887, 0x0000, 0x0126, 0x2091, 0x8000, 0x080c, 0x6991, 0x012e,
+	0x00be, 0x001e, 0x002e, 0x003e, 0x00ce, 0x00de, 0x0005, 0xa887,
+	0x0006, 0x0c80, 0xa887, 0x0002, 0x0c68, 0xa887, 0x0005, 0x0c50,
+	0xa887, 0x0004, 0x0c38, 0xa887, 0x0007, 0x0c20, 0x2091, 0x8000,
+	0x0e04, 0x7a30, 0x0006, 0x0016, 0x2001, 0x8003, 0x0006, 0x0804,
+	0x0d6e, 0x2001, 0x1833, 0x2004, 0x9005, 0x0005, 0x0005, 0x00f6,
+	0x2079, 0x0300, 0x2001, 0x0200, 0x200c, 0xc1e5, 0xc1dc, 0x2102,
+	0x2009, 0x0218, 0x210c, 0xd1ec, 0x1120, 0x080c, 0x153a, 0x00fe,
+	0x0005, 0x2001, 0x020d, 0x2003, 0x0020, 0x781f, 0x0300, 0x00fe,
+	0x0005, 0x781c, 0xd08c, 0x0904, 0x7ab1, 0x68bc, 0x90aa, 0x0005,
+	0x0a04, 0x804a, 0x7d44, 0x7c40, 0xd59c, 0x190c, 0x0d65, 0x9584,
+	0x00f6, 0x1508, 0x9484, 0x7000, 0x0138, 0x908a, 0x2000, 0x1258,
+	0x9584, 0x0700, 0x8007, 0x04f0, 0x7000, 0x9084, 0xff00, 0x9086,
+	0x8100, 0x0db0, 0x00b0, 0x9484, 0x0fff, 0x1130, 0x7000, 0x9084,
+	0xff00, 0x9086, 0x8100, 0x11c0, 0x080c, 0xd5e4, 0x080c, 0x7f91,
+	0x7817, 0x0140, 0x00a8, 0x9584, 0x0076, 0x1118, 0x080c, 0x7fed,
+	0x19c8, 0xd5a4, 0x0148, 0x0046, 0x0056, 0x080c, 0x7b01, 0x080c,
+	0x1fc8, 0x005e, 0x004e, 0x0020, 0x080c, 0xd5e4, 0x7817, 0x0140,
+	0x080c, 0x7096, 0x0168, 0x2001, 0x0111, 0x2004, 0xd08c, 0x0140,
+	0x688f, 0x0000, 0x2001, 0x0110, 0x2003, 0x0008, 0x2003, 0x0000,
+	0x0489, 0x0005, 0x0002, 0x7abe, 0x7db3, 0x7abb, 0x7abb, 0x7abb,
+	0x7abb, 0x7abb, 0x7abb, 0x7817, 0x0140, 0x0005, 0x7000, 0x908c,
+	0xff00, 0x9194, 0xf000, 0x810f, 0x9484, 0x0fff, 0x688e, 0x9286,
+	0x2000, 0x1150, 0x6800, 0x9086, 0x0001, 0x1118, 0x080c, 0x53e9,
+	0x0070, 0x080c, 0x7b21, 0x0058, 0x9286, 0x3000, 0x1118, 0x080c,
+	0x7cf0, 0x0028, 0x9286, 0x8000, 0x1110, 0x080c, 0x7ec7, 0x7817,
+	0x0140, 0x0005, 0x2001, 0x1810, 0x2004, 0xd08c, 0x0178, 0x2001,
+	0x1800, 0x2004, 0x9086, 0x0003, 0x1148, 0x0026, 0x0036, 0x2011,
+	0x8048, 0x2518, 0x080c, 0x48da, 0x003e, 0x002e, 0x0005, 0x0036,
+	0x0046, 0x0056, 0x00f6, 0x2079, 0x0200, 0x2019, 0xfffe, 0x7c30,
+	0x0050, 0x0036, 0x0046, 0x0056, 0x00f6, 0x2079, 0x0200, 0x7d44,
+	0x7c40, 0x2019, 0xffff, 0x2001, 0x1810, 0x2004, 0xd08c, 0x0160,
+	0x2001, 0x1800, 0x2004, 0x9086, 0x0003, 0x1130, 0x0026, 0x2011,
+	0x8048, 0x080c, 0x48da, 0x002e, 0x00fe, 0x005e, 0x004e, 0x003e,
+	0x0005, 0x00b6, 0x00c6, 0x7010, 0x9084, 0xff00, 0x8007, 0x9096,
+	0x0001, 0x0120, 0x9096, 0x0023, 0x1904, 0x7cc1, 0x9186, 0x0023,
+	0x15c0, 0x080c, 0x7f5c, 0x0904, 0x7cc1, 0x6120, 0x9186, 0x0001,
+	0x0150, 0x9186, 0x0004, 0x0138, 0x9186, 0x0008, 0x0120, 0x9186,
+	0x000a, 0x1904, 0x7cc1, 0x7124, 0x610a, 0x7030, 0x908e, 0x0200,
+	0x1130, 0x2009, 0x0015, 0x080c, 0x9c76, 0x0804, 0x7cc1, 0x908e,
+	0x0214, 0x0118, 0x908e, 0x0210, 0x1130, 0x2009, 0x0015, 0x080c,
+	0x9c76, 0x0804, 0x7cc1, 0x908e, 0x0100, 0x1904, 0x7cc1, 0x7034,
+	0x9005, 0x1904, 0x7cc1, 0x2009, 0x0016, 0x080c, 0x9c76, 0x0804,
+	0x7cc1, 0x9186, 0x0022, 0x1904, 0x7cc1, 0x7030, 0x908e, 0x0300,
+	0x1580, 0x68d8, 0xd0a4, 0x0528, 0xc0b5, 0x68da, 0x7100, 0x918c,
+	0x00ff, 0x697a, 0x7004, 0x687e, 0x00f6, 0x2079, 0x0100, 0x79e6,
+	0x78ea, 0x0006, 0x9084, 0x00ff, 0x0016, 0x2008, 0x080c, 0x2486,
+	0x7932, 0x7936, 0x001e, 0x000e, 0x00fe, 0x080c, 0x243d, 0x695a,
+	0x703c, 0x00e6, 0x2071, 0x0140, 0x7086, 0x2071, 0x1800, 0x70b2,
+	0x00ee, 0x7034, 0x9005, 0x1904, 0x7cc1, 0x2009, 0x0017, 0x0804,
+	0x7c71, 0x908e, 0x0400, 0x1190, 0x7034, 0x9005, 0x1904, 0x7cc1,
+	0x080c, 0x7096, 0x0120, 0x2009, 0x001d, 0x0804, 0x7c71, 0x68d8,
+	0xc0a5, 0x68da, 0x2009, 0x0030, 0x0804, 0x7c71, 0x908e, 0x0500,
+	0x1140, 0x7034, 0x9005, 0x1904, 0x7cc1, 0x2009, 0x0018, 0x0804,
+	0x7c71, 0x908e, 0x2010, 0x1120, 0x2009, 0x0019, 0x0804, 0x7c71,
+	0x908e, 0x2110, 0x1120, 0x2009, 0x001a, 0x0804, 0x7c71, 0x908e,
+	0x5200, 0x1140, 0x7034, 0x9005, 0x1904, 0x7cc1, 0x2009, 0x001b,
+	0x0804, 0x7c71, 0x908e, 0x5000, 0x1140, 0x7034, 0x9005, 0x1904,
+	0x7cc1, 0x2009, 0x001c, 0x0804, 0x7c71, 0x908e, 0x1300, 0x1120,
+	0x2009, 0x0034, 0x0804, 0x7c71, 0x908e, 0x1200, 0x1140, 0x7034,
+	0x9005, 0x1904, 0x7cc1, 0x2009, 0x0024, 0x0804, 0x7c71, 0x908c,
+	0xff00, 0x918e, 0x2400, 0x1170, 0x2009, 0x002d, 0x2001, 0x1810,
+	0x2004, 0xd09c, 0x0904, 0x7c71, 0x080c, 0xc63d, 0x1904, 0x7cc1,
+	0x0804, 0x7c6f, 0x908c, 0xff00, 0x918e, 0x5300, 0x1120, 0x2009,
+	0x002a, 0x0804, 0x7c71, 0x908e, 0x0f00, 0x1120, 0x2009, 0x0020,
+	0x0804, 0x7c71, 0x908e, 0x6104, 0x1528, 0x2029, 0x0205, 0x2011,
+	0x026d, 0x8208, 0x2204, 0x9082, 0x0004, 0x8004, 0x8004, 0x20a8,
+	0x2011, 0x8015, 0x211c, 0x8108, 0x0046, 0x2124, 0x080c, 0x48da,
+	0x004e, 0x8108, 0x0f04, 0x7c3d, 0x9186, 0x0280, 0x1d88, 0x2504,
+	0x8000, 0x202a, 0x2009, 0x0260, 0x0c58, 0x202b, 0x0000, 0x2009,
+	0x0023, 0x0478, 0x908e, 0x6000, 0x1118, 0x2009, 0x003f, 0x0448,
+	0x908e, 0x7800, 0x1118, 0x2009, 0x0045, 0x0418, 0x908e, 0x1000,
+	0x1118, 0x2009, 0x004e, 0x00e8, 0x908e, 0x6300, 0x1118, 0x2009,
+	0x004a, 0x00b8, 0x908c, 0xff00, 0x918e, 0x5600, 0x1118, 0x2009,
+	0x004f, 0x0078, 0x908c, 0xff00, 0x918e, 0x5700, 0x1118, 0x2009,
+	0x0050, 0x0038, 0x2009, 0x001d, 0x6838, 0xd0d4, 0x0110, 0x2009,
+	0x004c, 0x0016, 0x2011, 0x0263, 0x2204, 0x8211, 0x220c, 0x080c,
+	0x243d, 0x1904, 0x7cc4, 0x080c, 0x620b, 0x1904, 0x7cc4, 0xbe12,
+	0xbd16, 0x001e, 0x0016, 0x080c, 0x7096, 0x01c0, 0x68d8, 0xd08c,
+	0x1148, 0x7000, 0x9084, 0x00ff, 0x1188, 0x7004, 0x9084, 0xff00,
+	0x1168, 0x0040, 0x6878, 0x9606, 0x1148, 0x687c, 0x9506, 0x9084,
+	0xff00, 0x1120, 0x9584, 0x00ff, 0xb886, 0x0080, 0xb884, 0x9005,
+	0x1168, 0x9186, 0x0046, 0x1150, 0x6878, 0x9606, 0x1138, 0x687c,
+	0x9506, 0x9084, 0xff00, 0x1110, 0x001e, 0x0098, 0x080c, 0x9b84,
+	0x01a8, 0x2b08, 0x6112, 0x6023, 0x0004, 0x7120, 0x610a, 0x001e,
+	0x9186, 0x004c, 0x1110, 0x6023, 0x000a, 0x0016, 0x001e, 0x080c,
+	0x9c76, 0x00ce, 0x00be, 0x0005, 0x001e, 0x0cd8, 0x2001, 0x180e,
+	0x2004, 0xd0ec, 0x0120, 0x2011, 0x8049, 0x080c, 0x48da, 0x080c,
+	0x9c49, 0x0d90, 0x2b08, 0x6112, 0x6023, 0x0004, 0x7120, 0x610a,
+	0x001e, 0x0016, 0x9186, 0x0017, 0x0118, 0x9186, 0x0030, 0x1128,
+	0x6007, 0x0009, 0x6017, 0x2900, 0x0020, 0x6007, 0x0051, 0x6017,
+	0x0000, 0x602f, 0x0009, 0x6003, 0x0001, 0x080c, 0x84ba, 0x08a0,
+	0x080c, 0x3144, 0x1140, 0x7010, 0x9084, 0xff00, 0x8007, 0x908e,
+	0x0008, 0x1108, 0x0009, 0x0005, 0x00b6, 0x00c6, 0x0046, 0x7000,
+	0x908c, 0xff00, 0x810f, 0x9186, 0x0033, 0x11e8, 0x080c, 0x7f5c,
+	0x0904, 0x7d4b, 0x7124, 0x610a, 0x7030, 0x908e, 0x0200, 0x1140,
+	0x7034, 0x9005, 0x15c0, 0x2009, 0x0015, 0x080c, 0x9c76, 0x0498,
+	0x908e, 0x0100, 0x1580, 0x7034, 0x9005, 0x1568, 0x2009, 0x0016,
+	0x080c, 0x9c76, 0x0440, 0x9186, 0x0032, 0x1528, 0x7030, 0x908e,
+	0x1400, 0x1508, 0x2009, 0x0038, 0x0016, 0x2011, 0x0263, 0x2204,
+	0x8211, 0x220c, 0x080c, 0x243d, 0x11a8, 0x080c, 0x620b, 0x1190,
+	0xbe12, 0xbd16, 0x080c, 0x9b84, 0x0168, 0x2b08, 0x6112, 0x080c,
+	0xbcdb, 0x6023, 0x0004, 0x7120, 0x610a, 0x001e, 0x080c, 0x9c76,
+	0x0010, 0x00ce, 0x001e, 0x004e, 0x00ce, 0x00be, 0x0005, 0x00b6,
+	0x0046, 0x00e6, 0x00d6, 0x2028, 0x2130, 0x9696, 0x00ff, 0x11b8,
+	0x9592, 0xfffc, 0x02a0, 0x9596, 0xfffd, 0x1120, 0x2009, 0x007f,
+	0x0804, 0x7dad, 0x9596, 0xfffe, 0x1120, 0x2009, 0x007e, 0x0804,
+	0x7dad, 0x9596, 0xfffc, 0x1118, 0x2009, 0x0080, 0x04f0, 0x2011,
+	0x0000, 0x2019, 0x1836, 0x231c, 0xd3ac, 0x0130, 0x9026, 0x20a9,
+	0x0800, 0x2071, 0x1000, 0x0030, 0x2021, 0x0081, 0x20a9, 0x077f,
+	0x2071, 0x1081, 0x2e1c, 0x93dd, 0x0000, 0x1140, 0x82ff, 0x11d0,
+	0x9496, 0x00ff, 0x01b8, 0x2410, 0xc2fd, 0x00a0, 0xbf10, 0x2600,
+	0x9706, 0xb814, 0x1120, 0x9546, 0x1110, 0x2408, 0x00b0, 0x9745,
+	0x1148, 0x94c6, 0x007e, 0x0130, 0x94c6, 0x007f, 0x0118, 0x94c6,
+	0x0080, 0x1d20, 0x8420, 0x8e70, 0x1f04, 0x7d82, 0x82ff, 0x1118,
+	0x9085, 0x0001, 0x0018, 0xc2fc, 0x2208, 0x9006, 0x00de, 0x00ee,
+	0x004e, 0x00be, 0x0005, 0x7000, 0x908c, 0xff00, 0x810f, 0x9184,
+	0x000f, 0x0002, 0x7dca, 0x7dca, 0x7dca, 0x7f6e, 0x7dca, 0x7dcd,
+	0x7df2, 0x7e7b, 0x7dca, 0x7dca, 0x7dca, 0x7dca, 0x7dca, 0x7dca,
+	0x7dca, 0x7dca, 0x7817, 0x0140, 0x0005, 0x00b6, 0x7110, 0xd1bc,
+	0x01e8, 0x7120, 0x2160, 0x9c8c, 0x0003, 0x11c0, 0x9c8a, 0x1ddc,
+	0x02a8, 0x6864, 0x9c02, 0x1290, 0x7008, 0x9084, 0x00ff, 0x6110,
+	0x2158, 0xb910, 0x9106, 0x1150, 0x700c, 0xb914, 0x9106, 0x1130,
+	0x7124, 0x610a, 0x2009, 0x0046, 0x080c, 0x9c76, 0x7817, 0x0140,
+	0x00be, 0x0005, 0x00b6, 0x00c6, 0x9484, 0x0fff, 0x0904, 0x7e57,
+	0x7110, 0xd1bc, 0x1904, 0x7e57, 0x7108, 0x700c, 0x2028, 0x918c,
+	0x00ff, 0x2130, 0x9094, 0xff00, 0x15c8, 0x81ff, 0x15b8, 0x9080,
+	0x317f, 0x200d, 0x918c, 0xff00, 0x810f, 0x2001, 0x0080, 0x9106,
+	0x0904, 0x7e57, 0x9182, 0x0801, 0x1a04, 0x7e57, 0x9190, 0x1000,
+	0x2204, 0x905d, 0x05e0, 0xbe12, 0xbd16, 0xb800, 0xd0ec, 0x15b8,
+	0xba04, 0x9294, 0xff00, 0x9286, 0x0600, 0x1190, 0x080c, 0x9b84,
+	0x0598, 0x2b08, 0x7028, 0x6052, 0x702c, 0x604e, 0x6112, 0x6023,
+	0x0006, 0x7120, 0x610a, 0x7130, 0x615e, 0x080c, 0xc8a3, 0x00f8,
+	0x080c, 0x6666, 0x1138, 0xb807, 0x0606, 0x0c40, 0x190c, 0x7d4f,
+	0x11b0, 0x0880, 0x080c, 0x9b84, 0x2b08, 0x0188, 0x6112, 0x6023,
+	0x0004, 0x7120, 0x610a, 0x9286, 0x0400, 0x1118, 0x6007, 0x0005,
+	0x0010, 0x6007, 0x0001, 0x6003, 0x0001, 0x080c, 0x84ba, 0x7817,
+	0x0140, 0x00ce, 0x00be, 0x0005, 0x2001, 0x180e, 0x2004, 0xd0ec,
+	0x0120, 0x2011, 0x8049, 0x080c, 0x48da, 0x080c, 0x9c49, 0x0d78,
+	0x2b08, 0x6112, 0x6023, 0x0006, 0x7120, 0x610a, 0x7130, 0x615e,
+	0x6017, 0xf300, 0x6003, 0x0001, 0x6007, 0x0041, 0x2009, 0xa022,
+	0x080c, 0x84b3, 0x08e0, 0x00b6, 0x7110, 0xd1bc, 0x05d0, 0x7020,
+	0x2060, 0x9c84, 0x0003, 0x15a8, 0x9c82, 0x1ddc, 0x0690, 0x6864,
+	0x9c02, 0x1678, 0x9484, 0x0fff, 0x9082, 0x000c, 0x0650, 0x7008,
+	0x9084, 0x00ff, 0x6110, 0x2158, 0xb910, 0x9106, 0x1510, 0x700c,
+	0xb914, 0x9106, 0x11f0, 0x7124, 0x610a, 0x601c, 0xd0fc, 0x11c8,
+	0x2001, 0x0271, 0x2004, 0x9005, 0x1180, 0x9484, 0x0fff, 0x9082,
+	0x000c, 0x0158, 0x0066, 0x2031, 0x0100, 0xa001, 0xa001, 0x8631,
+	0x1de0, 0x006e, 0x601c, 0xd0fc, 0x1120, 0x2009, 0x0045, 0x080c,
+	0x9c76, 0x7817, 0x0140, 0x00be, 0x0005, 0x6120, 0x9186, 0x0002,
+	0x0128, 0x9186, 0x0005, 0x0110, 0x9085, 0x0001, 0x0005, 0x080c,
+	0x3144, 0x1168, 0x7010, 0x9084, 0xff00, 0x8007, 0x9086, 0x0000,
+	0x1130, 0x9184, 0x000f, 0x908a, 0x0006, 0x1208, 0x000b, 0x0005,
+	0x7ede, 0x7edf, 0x7ede, 0x7ede, 0x7f3e, 0x7f4d, 0x0005, 0x00b6,
+	0x7110, 0xd1bc, 0x0120, 0x702c, 0xd084, 0x0904, 0x7f3c, 0x700c,
+	0x7108, 0x080c, 0x243d, 0x1904, 0x7f3c, 0x080c, 0x620b, 0x1904,
+	0x7f3c, 0xbe12, 0xbd16, 0x7110, 0xd1bc, 0x01d8, 0x080c, 0x6666,
+	0x0118, 0x9086, 0x0004, 0x1588, 0x00c6, 0x080c, 0x7f5c, 0x00ce,
+	0x05d8, 0x080c, 0x9b84, 0x2b08, 0x05b8, 0x6112, 0x080c, 0xbcdb,
+	0x6023, 0x0002, 0x7120, 0x610a, 0x2009, 0x0088, 0x080c, 0x9c76,
+	0x0458, 0x080c, 0x6666, 0x0148, 0x9086, 0x0004, 0x0130, 0x080c,
+	0x666e, 0x0118, 0x9086, 0x0004, 0x1180, 0x080c, 0x9b84, 0x2b08,
+	0x01d8, 0x6112, 0x080c, 0xbcdb, 0x6023, 0x0005, 0x7120, 0x610a,
+	0x2009, 0x0088, 0x080c, 0x9c76, 0x0078, 0x080c, 0x9b84, 0x2b08,
+	0x0158, 0x6112, 0x080c, 0xbcdb, 0x6023, 0x0004, 0x7120, 0x610a,
+	0x2009, 0x0001, 0x080c, 0x9c76, 0x00be, 0x0005, 0x7110, 0xd1bc,
+	0x0158, 0x00d1, 0x0148, 0x080c, 0x7ebd, 0x1130, 0x7124, 0x610a,
+	0x2009, 0x0089, 0x080c, 0x9c76, 0x0005, 0x7110, 0xd1bc, 0x0158,
+	0x0059, 0x0148, 0x080c, 0x7ebd, 0x1130, 0x7124, 0x610a, 0x2009,
+	0x008a, 0x080c, 0x9c76, 0x0005, 0x7020, 0x2060, 0x9c84, 0x0003,
+	0x1158, 0x9c82, 0x1ddc, 0x0240, 0x2001, 0x1819, 0x2004, 0x9c02,
+	0x1218, 0x9085, 0x0001, 0x0005, 0x9006, 0x0ce8, 0x00b6, 0x7110,
+	0xd1bc, 0x11d8, 0x7024, 0x2060, 0x9c84, 0x0003, 0x11b0, 0x9c82,
+	0x1ddc, 0x0298, 0x6864, 0x9c02, 0x1280, 0x7008, 0x9084, 0x00ff,
+	0x6110, 0x2158, 0xb910, 0x9106, 0x1140, 0x700c, 0xb914, 0x9106,
+	0x1120, 0x2009, 0x0051, 0x080c, 0x9c76, 0x7817, 0x0140, 0x00be,
+	0x0005, 0x2031, 0x0105, 0x0069, 0x0005, 0x2031, 0x0206, 0x0049,
+	0x0005, 0x2031, 0x0207, 0x0029, 0x0005, 0x2031, 0x0213, 0x0009,
+	0x0005, 0x00c6, 0x0096, 0x00f6, 0x7000, 0x9084, 0xf000, 0x9086,
+	0xc000, 0x05c0, 0x080c, 0x9b84, 0x05a8, 0x0066, 0x00c6, 0x0046,
+	0x2011, 0x0263, 0x2204, 0x8211, 0x220c, 0x080c, 0x243d, 0x1590,
+	0x080c, 0x620b, 0x1578, 0xbe12, 0xbd16, 0x2b00, 0x004e, 0x00ce,
+	0x6012, 0x080c, 0xbcdb, 0x080c, 0x1022, 0x0500, 0x2900, 0x6062,
+	0x9006, 0xa802, 0xa866, 0xac6a, 0xa85c, 0x90f8, 0x001b, 0x20a9,
+	0x000e, 0xa860, 0x20e8, 0x20e1, 0x0000, 0x2fa0, 0x2e98, 0x4003,
+	0x006e, 0x6616, 0x6007, 0x003e, 0x6023, 0x0001, 0x6003, 0x0001,
+	0x080c, 0x84ba, 0x00fe, 0x009e, 0x00ce, 0x0005, 0x080c, 0x9bda,
+	0x006e, 0x0cc0, 0x004e, 0x00ce, 0x0cc8, 0x00c6, 0x7000, 0x908c,
+	0xff00, 0x9184, 0xf000, 0x810f, 0x9086, 0x2000, 0x1904, 0x8044,
+	0x9186, 0x0022, 0x15f0, 0x2001, 0x0111, 0x2004, 0x9005, 0x1904,
+	0x8046, 0x7030, 0x908e, 0x0400, 0x0904, 0x8046, 0x908e, 0x6000,
+	0x05e8, 0x908e, 0x5400, 0x05d0, 0x908e, 0x0300, 0x11d8, 0x2009,
+	0x1836, 0x210c, 0xd18c, 0x1590, 0xd1a4, 0x1580, 0x080c, 0x6624,
+	0x0558, 0x68ac, 0x9084, 0x00ff, 0x7100, 0x918c, 0x00ff, 0x9106,
+	0x1518, 0x687c, 0x69ac, 0x918c, 0xff00, 0x9105, 0x7104, 0x9106,
+	0x11d8, 0x00e0, 0x2009, 0x0103, 0x210c, 0xd1b4, 0x11a8, 0x908e,
+	0x5200, 0x09e8, 0x908e, 0x0500, 0x09d0, 0x908e, 0x5000, 0x09b8,
+	0x0058, 0x9186, 0x0023, 0x1140, 0x080c, 0x7f5c, 0x0128, 0x6004,
+	0x9086, 0x0002, 0x0118, 0x0000, 0x9006, 0x0010, 0x9085, 0x0001,
+	0x00ce, 0x0005, 0x00f6, 0x2079, 0x0200, 0x7800, 0xc0e5, 0xc0cc,
+	0x7802, 0x00fe, 0x0005, 0x00f6, 0x2079, 0x1800, 0x7834, 0xd084,
+	0x1130, 0x2079, 0x0200, 0x7800, 0x9085, 0x1200, 0x7802, 0x00fe,
+	0x0005, 0x00e6, 0x2071, 0x1800, 0x7034, 0xc084, 0x7036, 0x00ee,
+	0x0005, 0x2071, 0x19d3, 0x7003, 0x0003, 0x700f, 0x0361, 0x9006,
+	0x701a, 0x7072, 0x7012, 0x7017, 0x1ddc, 0x7007, 0x0000, 0x7026,
+	0x702b, 0x8fbc, 0x7032, 0x7037, 0x9039, 0x703f, 0xffff, 0x7042,
+	0x7047, 0x521f, 0x704a, 0x705b, 0x8205, 0x080c, 0x103b, 0x090c,
+	0x0d65, 0x2900, 0x703a, 0xa867, 0x0003, 0xa86f, 0x0100, 0xa8ab,
+	0xdcb0, 0x0005, 0x2071, 0x19d3, 0x1d04, 0x8127, 0x2091, 0x6000,
+	0x700c, 0x8001, 0x700e, 0x1560, 0x2001, 0x1875, 0x2004, 0xd0c4,
+	0x0158, 0x3a00, 0xd08c, 0x1140, 0x20d1, 0x0000, 0x20d1, 0x0001,
+	0x20d1, 0x0000, 0x080c, 0x0d65, 0x700f, 0x0361, 0x7007, 0x0001,
+	0x0126, 0x2091, 0x8000, 0x2069, 0x1800, 0x69e8, 0xd1e4, 0x1138,
+	0xd1dc, 0x1118, 0x080c, 0x8273, 0x0010, 0x080c, 0x824a, 0x7040,
+	0x900d, 0x0148, 0x8109, 0x7142, 0x1130, 0x7044, 0x080f, 0x0018,
+	0x0126, 0x2091, 0x8000, 0x7024, 0x900d, 0x0188, 0x7020, 0x8001,
+	0x7022, 0x1168, 0x7023, 0x0009, 0x8109, 0x7126, 0x9186, 0x03e8,
+	0x1110, 0x7028, 0x080f, 0x81ff, 0x1110, 0x7028, 0x080f, 0x7030,
+	0x900d, 0x0180, 0x702c, 0x8001, 0x702e, 0x1160, 0x702f, 0x0009,
+	0x8109, 0x7132, 0x0128, 0x9184, 0x007f, 0x090c, 0x90c1, 0x0010,
+	0x7034, 0x080f, 0x703c, 0x9005, 0x0118, 0x0310, 0x8001, 0x703e,
+	0x704c, 0x900d, 0x0168, 0x7048, 0x8001, 0x704a, 0x1148, 0x704b,
+	0x0009, 0x8109, 0x714e, 0x1120, 0x7150, 0x714e, 0x7058, 0x080f,
+	0x7018, 0x900d, 0x01d8, 0x0016, 0x7070, 0x900d, 0x0158, 0x706c,
+	0x8001, 0x706e, 0x1138, 0x706f, 0x0009, 0x8109, 0x7172, 0x1110,
+	0x7074, 0x080f, 0x001e, 0x7008, 0x8001, 0x700a, 0x1138, 0x700b,
+	0x0009, 0x8109, 0x711a, 0x1110, 0x701c, 0x080f, 0x012e, 0x7004,
+	0x0002, 0x814f, 0x8150, 0x817a, 0x00e6, 0x2071, 0x19d3, 0x7018,
+	0x9005, 0x1120, 0x711a, 0x721e, 0x700b, 0x0009, 0x00ee, 0x0005,
+	0x00e6, 0x0006, 0x2071, 0x19d3, 0x701c, 0x9206, 0x1120, 0x701a,
+	0x701e, 0x7072, 0x7076, 0x000e, 0x00ee, 0x0005, 0x00e6, 0x2071,
+	0x19d3, 0xb888, 0x9102, 0x0208, 0xb98a, 0x00ee, 0x0005, 0x0005,
+	0x00b6, 0x2031, 0x0010, 0x7110, 0x080c, 0x626b, 0x11a8, 0xb888,
+	0x8001, 0x0290, 0xb88a, 0x1180, 0x0126, 0x2091, 0x8000, 0x0066,
+	0xb8c0, 0x9005, 0x0138, 0x0026, 0xba3c, 0x0016, 0x080c, 0x6396,
+	0x001e, 0x002e, 0x006e, 0x012e, 0x8108, 0x9182, 0x0800, 0x1220,
+	0x8631, 0x0128, 0x7112, 0x0c00, 0x900e, 0x7007, 0x0002, 0x7112,
+	0x00be, 0x0005, 0x2031, 0x0010, 0x7014, 0x2060, 0x0126, 0x2091,
+	0x8000, 0x6048, 0x9005, 0x0128, 0x8001, 0x604a, 0x1110, 0x080c,
+	0xbb5c, 0x6018, 0x9005, 0x0904, 0x81cc, 0x00f6, 0x2079, 0x0300,
+	0x7918, 0xd1b4, 0x1904, 0x81df, 0x781b, 0x2020, 0xa001, 0x7918,
+	0xd1b4, 0x0120, 0x781b, 0x2000, 0x0804, 0x81df, 0x8001, 0x601a,
+	0x0106, 0x781b, 0x2000, 0xa001, 0x7918, 0xd1ac, 0x1dd0, 0x010e,
+	0x00fe, 0x1510, 0x6120, 0x9186, 0x0003, 0x0118, 0x9186, 0x0006,
+	0x11c8, 0x080c, 0xb842, 0x01b0, 0x6014, 0x2048, 0xa884, 0x908a,
+	0x199a, 0x0280, 0x9082, 0x1999, 0xa886, 0x908a, 0x199a, 0x0210,
+	0x2001, 0x1999, 0x8003, 0x800b, 0x810b, 0x9108, 0x611a, 0x080c,
+	0xbf8d, 0x0110, 0x080c, 0xb533, 0x012e, 0x9c88, 0x001c, 0x7116,
+	0x2001, 0x1819, 0x2004, 0x9102, 0x1228, 0x8631, 0x0138, 0x2160,
+	0x0804, 0x817e, 0x7017, 0x1ddc, 0x7007, 0x0000, 0x0005, 0x00fe,
+	0x0c58, 0x00e6, 0x2071, 0x19d3, 0x7027, 0x07d0, 0x7023, 0x0009,
+	0x00ee, 0x0005, 0x2001, 0x19dc, 0x2003, 0x0000, 0x0005, 0x00e6,
+	0x2071, 0x19d3, 0x7132, 0x702f, 0x0009, 0x00ee, 0x0005, 0x2011,
+	0x19df, 0x2013, 0x0000, 0x0005, 0x00e6, 0x2071, 0x19d3, 0x711a,
+	0x721e, 0x700b, 0x0009, 0x00ee, 0x0005, 0x0086, 0x0026, 0x7054,
+	0x8000, 0x7056, 0x2001, 0x19e1, 0x2044, 0xa06c, 0x9086, 0x0000,
+	0x0150, 0x7068, 0xa09a, 0x7064, 0xa096, 0x7060, 0xa092, 0x705c,
+	0xa08e, 0x080c, 0x1117, 0x002e, 0x008e, 0x0005, 0x0006, 0x0016,
+	0x0096, 0x00a6, 0x00b6, 0x00c6, 0x00d6, 0x00e6, 0x00f6, 0x0156,
+	0x080c, 0x8092, 0x015e, 0x00fe, 0x00ee, 0x00de, 0x00ce, 0x00be,
+	0x00ae, 0x009e, 0x001e, 0x000e, 0x0005, 0x00e6, 0x2071, 0x19d3,
+	0x7172, 0x7276, 0x706f, 0x0009, 0x00ee, 0x0005, 0x00e6, 0x0006,
+	0x2071, 0x19d3, 0x7074, 0x9206, 0x1110, 0x7072, 0x7076, 0x000e,
+	0x00ee, 0x0005, 0x2069, 0x1800, 0x69e8, 0xd1e4, 0x1518, 0x0026,
+	0xd1ec, 0x0140, 0x6a50, 0x6870, 0x9202, 0x0288, 0x8117, 0x9294,
+	0x00c1, 0x0088, 0x9184, 0x0007, 0x01a0, 0x8109, 0x9184, 0x0007,
+	0x0110, 0x69ea, 0x0070, 0x8107, 0x9084, 0x0007, 0x910d, 0x8107,
+	0x9106, 0x9094, 0x00c1, 0x9184, 0xff3e, 0x9205, 0x68ea, 0x080c,
+	0x0eed, 0x002e, 0x0005, 0x69e4, 0x9184, 0x003f, 0x05b8, 0x8109,
+	0x9184, 0x003f, 0x01a8, 0x6a50, 0x6870, 0x9202, 0x0220, 0xd1bc,
+	0x0168, 0xc1bc, 0x0018, 0xd1bc, 0x1148, 0xc1bd, 0x2110, 0x00e6,
+	0x2071, 0x1800, 0x080c, 0x0f0f, 0x00ee, 0x0400, 0x69e6, 0x00f0,
+	0x0026, 0x8107, 0x9094, 0x0007, 0x0128, 0x8001, 0x8007, 0x9085,
+	0x0007, 0x0050, 0x2010, 0x8004, 0x8004, 0x8004, 0x9084, 0x0007,
+	0x9205, 0x8007, 0x9085, 0x0028, 0x9086, 0x0040, 0x2010, 0x00e6,
+	0x2071, 0x1800, 0x080c, 0x0f0f, 0x00ee, 0x002e, 0x0005, 0x00c6,
+	0x2061, 0x1a3e, 0x00ce, 0x0005, 0x9184, 0x000f, 0x8003, 0x8003,
+	0x8003, 0x9080, 0x1a3e, 0x2060, 0x0005, 0xa884, 0x908a, 0x199a,
+	0x1638, 0x9005, 0x1150, 0x00c6, 0x2061, 0x1a3e, 0x6014, 0x00ce,
+	0x9005, 0x1130, 0x2001, 0x001e, 0x0018, 0x908e, 0xffff, 0x01b0,
+	0x8003, 0x800b, 0x810b, 0x9108, 0x611a, 0xa87c, 0x908c, 0x00c0,
+	0x918e, 0x00c0, 0x0904, 0x8377, 0xd0b4, 0x1168, 0xd0bc, 0x1904,
+	0x8350, 0x2009, 0x0006, 0x080c, 0x83a4, 0x0005, 0x900e, 0x0c60,
+	0x2001, 0x1999, 0x08b0, 0xd0fc, 0x05e0, 0x908c, 0x2023, 0x1568,
+	0x87ff, 0x1558, 0xa9a8, 0x81ff, 0x1540, 0x6124, 0x918c, 0x0500,
+	0x1520, 0x6100, 0x918e, 0x0007, 0x1500, 0x2009, 0x1875, 0x210c,
+	0xd184, 0x11d8, 0x6003, 0x0003, 0x6007, 0x0043, 0x6047, 0xb035,
+	0x080c, 0x1ab2, 0xa87c, 0xc0dd, 0xa87e, 0x600f, 0x0000, 0x00f6,
+	0x2079, 0x0380, 0x7818, 0xd0bc, 0x1de8, 0x7833, 0x0013, 0x2c00,
+	0x7836, 0x781b, 0x8080, 0x00fe, 0x0005, 0x908c, 0x0003, 0x0120,
+	0x918e, 0x0003, 0x1904, 0x839e, 0x908c, 0x2020, 0x918e, 0x2020,
+	0x01a8, 0x6024, 0xd0d4, 0x11e8, 0x2009, 0x1875, 0x2104, 0xd084,
+	0x1138, 0x87ff, 0x1120, 0x2009, 0x0043, 0x0804, 0x9c76, 0x0005,
+	0x87ff, 0x1de8, 0x2009, 0x0042, 0x0804, 0x9c76, 0x6110, 0x00b6,
+	0x2158, 0xb900, 0x00be, 0xd1ac, 0x0d20, 0x6024, 0xc0cd, 0x6026,
+	0x0c00, 0xc0d4, 0x6026, 0xa890, 0x602e, 0xa88c, 0x6032, 0x08e0,
+	0xd0fc, 0x0160, 0x908c, 0x0003, 0x0120, 0x918e, 0x0003, 0x1904,
+	0x839e, 0x908c, 0x2020, 0x918e, 0x2020, 0x0170, 0x0076, 0x00f6,
+	0x2c78, 0x080c, 0x165c, 0x00fe, 0x007e, 0x87ff, 0x1120, 0x2009,
+	0x0042, 0x080c, 0x9c76, 0x0005, 0x6110, 0x00b6, 0x2158, 0xb900,
+	0x00be, 0xd1ac, 0x0d58, 0x6124, 0xc1cd, 0x6126, 0x0c38, 0xd0fc,
+	0x0188, 0x908c, 0x2020, 0x918e, 0x2020, 0x01a8, 0x9084, 0x0003,
+	0x908e, 0x0002, 0x0148, 0x87ff, 0x1120, 0x2009, 0x0041, 0x080c,
+	0x9c76, 0x0005, 0x00b9, 0x0ce8, 0x87ff, 0x1dd8, 0x2009, 0x0043,
+	0x080c, 0x9c76, 0x0cb0, 0x6110, 0x00b6, 0x2158, 0xb900, 0x00be,
+	0xd1ac, 0x0d20, 0x6124, 0xc1cd, 0x6126, 0x0c00, 0x2009, 0x0004,
+	0x0019, 0x0005, 0x2009, 0x0001, 0x0096, 0x080c, 0xb842, 0x0518,
+	0x6014, 0x2048, 0xa982, 0xa800, 0x6016, 0x9186, 0x0001, 0x1188,
+	0xa97c, 0x918c, 0x8100, 0x918e, 0x8100, 0x1158, 0x00c6, 0x2061,
+	0x1a3e, 0x6200, 0xd28c, 0x1120, 0x6204, 0x8210, 0x0208, 0x6206,
+	0x00ce, 0x080c, 0x67c6, 0x6014, 0x904d, 0x0076, 0x2039, 0x0000,
+	0x190c, 0x82bd, 0x007e, 0x009e, 0x0005, 0x0156, 0x00c6, 0x2061,
+	0x1a3e, 0x6000, 0x81ff, 0x0110, 0x9205, 0x0008, 0x9204, 0x6002,
+	0x00ce, 0x015e, 0x0005, 0x6800, 0xd08c, 0x1138, 0x6808, 0x9005,
+	0x0120, 0x8001, 0x680a, 0x9085, 0x0001, 0x0005, 0x0126, 0x2091,
+	0x8000, 0x0036, 0x0046, 0x20a9, 0x0010, 0x9006, 0x8004, 0x8086,
+	0x818e, 0x1208, 0x9200, 0x1f04, 0x83ef, 0x8086, 0x818e, 0x004e,
+	0x003e, 0x012e, 0x0005, 0x0126, 0x2091, 0x8000, 0x0076, 0x0156,
+	0x20a9, 0x0010, 0x9005, 0x01c8, 0x911a, 0x12b8, 0x8213, 0x818d,
+	0x0228, 0x911a, 0x1220, 0x1f04, 0x8406, 0x0028, 0x911a, 0x2308,
+	0x8210, 0x1f04, 0x8406, 0x0006, 0x3200, 0x9084, 0xefff, 0x2080,
+	0x000e, 0x015e, 0x007e, 0x012e, 0x0005, 0x0006, 0x3200, 0x9085,
+	0x1000, 0x0ca8, 0x0126, 0x2091, 0x2800, 0x2079, 0x19b7, 0x012e,
+	0x00d6, 0x2069, 0x19b7, 0x6803, 0x0005, 0x0156, 0x0146, 0x01d6,
+	0x20e9, 0x0000, 0x2069, 0x0200, 0x080c, 0x97e8, 0x04a9, 0x080c,
+	0x97d3, 0x0491, 0x080c, 0x97d6, 0x0479, 0x080c, 0x97d9, 0x0461,
+	0x080c, 0x97dc, 0x0449, 0x080c, 0x97df, 0x0431, 0x080c, 0x97e2,
+	0x0419, 0x080c, 0x97e5, 0x0401, 0x01de, 0x014e, 0x015e, 0x6857,
+	0x0000, 0x00f6, 0x2079, 0x0380, 0x00f9, 0x7807, 0x0003, 0x7803,
+	0x0000, 0x7803, 0x0001, 0x2069, 0x0004, 0x2d04, 0x9084, 0xfffe,
+	0x9085, 0x8000, 0x206a, 0x2069, 0x0100, 0x6828, 0x9084, 0xfffc,
+	0x682a, 0x00fe, 0x00de, 0x0005, 0x20a9, 0x0020, 0x20a1, 0x0240,
+	0x2001, 0x0000, 0x4004, 0x0005, 0x00c6, 0x7803, 0x0000, 0x9006,
+	0x7827, 0x0030, 0x782b, 0x0400, 0x7827, 0x0031, 0x782b, 0x1abe,
+	0x781f, 0xff00, 0x781b, 0xff00, 0x2061, 0x1ab3, 0x602f, 0x19b7,
+	0x6033, 0x1800, 0x6037, 0x19d3, 0x603b, 0x1d04, 0x603f, 0x1d14,
+	0x6042, 0x6047, 0x1a89, 0x00ce, 0x0005, 0x2001, 0x0382, 0x2004,
+	0x9084, 0x0007, 0x9086, 0x0001, 0x01b0, 0x00c6, 0x6146, 0x600f,
+	0x0000, 0x2c08, 0x2061, 0x19b7, 0x602c, 0x8000, 0x602e, 0x601c,
+	0x9005, 0x0130, 0x9080, 0x0003, 0x2102, 0x611e, 0x00ce, 0x0005,
+	0x6122, 0x611e, 0x0cd8, 0x6146, 0x2c08, 0x2001, 0x0012, 0x080c,
+	0x98ac, 0x0005, 0x0016, 0x2009, 0x8020, 0x6146, 0x2c08, 0x2001,
+	0x0382, 0x2004, 0x9084, 0x0007, 0x9086, 0x0001, 0x1128, 0x2001,
+	0x0019, 0x080c, 0x98ac, 0x0088, 0x00c6, 0x2061, 0x19b7, 0x602c,
+	0x8000, 0x602e, 0x600c, 0x9005, 0x0128, 0x9080, 0x0003, 0x2102,
+	0x610e, 0x0010, 0x6112, 0x610e, 0x00ce, 0x001e, 0x0005, 0x2001,
+	0x0382, 0x2004, 0x9084, 0x0007, 0x9086, 0x0001, 0x0198, 0x00c6,
+	0x6146, 0x600f, 0x0000, 0x2c08, 0x2061, 0x19b7, 0x6044, 0x9005,
+	0x0130, 0x9080, 0x0003, 0x2102, 0x6146, 0x00ce, 0x0005, 0x614a,
+	0x6146, 0x0cd8, 0x6146, 0x600f, 0x0000, 0x2c08, 0x2001, 0x0013,
+	0x080c, 0x98ac, 0x0005, 0x6044, 0xd0dc, 0x0110, 0x080c, 0x9485,
+	0x0005, 0x00f6, 0x00e6, 0x00d6, 0x00c6, 0x00b6, 0x0096, 0x0076,
+	0x0066, 0x0056, 0x0036, 0x0026, 0x0016, 0x0006, 0x0126, 0x902e,
+	0x2071, 0x19b7, 0x7648, 0x2660, 0x2678, 0x2091, 0x8000, 0x8cff,
+	0x0904, 0x8586, 0x6010, 0x2058, 0xb8a0, 0x9206, 0x1904, 0x8581,
+	0x87ff, 0x0120, 0x605c, 0x9106, 0x1904, 0x8581, 0x704c, 0x9c06,
+	0x1178, 0x0036, 0x2019, 0x0001, 0x080c, 0x9269, 0x703f, 0x0000,
+	0x9006, 0x704e, 0x706a, 0x7052, 0x706e, 0x003e, 0x2029, 0x0001,
+	0x0811, 0x7048, 0x9c36, 0x1110, 0x660c, 0x764a, 0x7044, 0x9c36,
+	0x1140, 0x2c00, 0x9f36, 0x0118, 0x2f00, 0x7046, 0x0010, 0x7047,
+	0x0000, 0x660c, 0x0066, 0x2c00, 0x9f06, 0x0110, 0x7e0e, 0x0008,
+	0x2678, 0x600f, 0x0000, 0x080c, 0xb842, 0x01f0, 0x6014, 0x2048,
+	0x6020, 0x9086, 0x0003, 0x1588, 0x6004, 0x9086, 0x0040, 0x090c,
+	0x9485, 0xa867, 0x0103, 0xab7a, 0xa877, 0x0000, 0x0016, 0x0036,
+	0x0076, 0x080c, 0xbb45, 0x080c, 0xd52b, 0x080c, 0x6991, 0x007e,
+	0x003e, 0x001e, 0x080c, 0xba31, 0x080c, 0x9c14, 0x00ce, 0x0804,
+	0x851f, 0x2c78, 0x600c, 0x2060, 0x0804, 0x851f, 0x012e, 0x000e,
+	0x001e, 0x002e, 0x003e, 0x005e, 0x006e, 0x007e, 0x009e, 0x00be,
+	0x00ce, 0x00de, 0x00ee, 0x00fe, 0x0005, 0x6020, 0x9086, 0x0006,
+	0x1158, 0x0016, 0x0036, 0x0076, 0x080c, 0xd52b, 0x080c, 0xd22f,
+	0x007e, 0x003e, 0x001e, 0x08c0, 0x6020, 0x9086, 0x000a, 0x0918,
+	0x0804, 0x8564, 0x0006, 0x0066, 0x0096, 0x00c6, 0x00d6, 0x00f6,
+	0x9036, 0x0126, 0x2091, 0x8000, 0x2079, 0x19b7, 0x7848, 0x9065,
+	0x0904, 0x860e, 0x600c, 0x0006, 0x600f, 0x0000, 0x784c, 0x9c06,
+	0x11a0, 0x0036, 0x2019, 0x0001, 0x080c, 0x9269, 0x783f, 0x0000,
+	0x901e, 0x7b4e, 0x7b6a, 0x7b52, 0x7b6e, 0x003e, 0x000e, 0x9005,
+	0x1118, 0x600c, 0x600f, 0x0000, 0x0006, 0x00e6, 0x2f70, 0x080c,
+	0x8503, 0x00ee, 0x080c, 0xb842, 0x0548, 0x6014, 0x2048, 0x6020,
+	0x9086, 0x0003, 0x15a8, 0x3e08, 0x918e, 0x0002, 0x1188, 0x6010,
+	0x9005, 0x0170, 0x00b6, 0x2058, 0xb800, 0x00be, 0xd0bc, 0x0140,
+	0x6048, 0x9005, 0x11c0, 0x2001, 0x1958, 0x2004, 0x604a, 0x0098,
+	0x6004, 0x9086, 0x0040, 0x090c, 0x9485, 0xa867, 0x0103, 0xab7a,
+	0xa877, 0x0000, 0x080c, 0x6985, 0x080c, 0xba31, 0x6044, 0xc0fc,
+	0x6046, 0x080c, 0x9c14, 0x000e, 0x0804, 0x85b7, 0x7e4a, 0x7e46,
+	0x012e, 0x00fe, 0x00de, 0x00ce, 0x009e, 0x006e, 0x000e, 0x0005,
+	0x6020, 0x9086, 0x0006, 0x1118, 0x080c, 0xd22f, 0x0c38, 0x6020,
+	0x9086, 0x000a, 0x09e0, 0x08a0, 0x0016, 0x0026, 0x0086, 0x9046,
+	0x00a9, 0x080c, 0x8715, 0x008e, 0x002e, 0x001e, 0x0005, 0x00f6,
+	0x0126, 0x2079, 0x19b7, 0x2091, 0x8000, 0x080c, 0x875e, 0x080c,
+	0x87f2, 0x080c, 0x63f8, 0x012e, 0x00fe, 0x0005, 0x00b6, 0x0096,
+	0x00f6, 0x00e6, 0x00d6, 0x00c6, 0x0066, 0x0016, 0x0006, 0x0126,
+	0x2091, 0x8000, 0x2071, 0x19b7, 0x7620, 0x2660, 0x2678, 0x8cff,
+	0x0904, 0x86da, 0x6010, 0x2058, 0xb8a0, 0x9206, 0x1904, 0x86d5,
+	0x88ff, 0x0120, 0x605c, 0x9106, 0x1904, 0x86d5, 0x7030, 0x9c06,
+	0x1570, 0x2069, 0x0100, 0x6820, 0xd0a4, 0x1508, 0x080c, 0x81ea,
+	0x080c, 0x8f9c, 0x68c3, 0x0000, 0x080c, 0x9485, 0x7033, 0x0000,
 	0x0036, 0x2069, 0x0140, 0x6b04, 0x9384, 0x1000, 0x0138, 0x2001,
-	0x0100, 0x080c, 0x2833, 0x9006, 0x080c, 0x2833, 0x2069, 0x0100,
-	0x6824, 0xd084, 0x0110, 0x6827, 0x0001, 0x003e, 0x7010, 0x9c36,
-	0x1110, 0x660c, 0x7612, 0x700c, 0x9c36, 0x1140, 0x2c00, 0x9f36,
-	0x0118, 0x2f00, 0x700e, 0x0010, 0x700f, 0x0000, 0x660c, 0x0066,
-	0x2c00, 0x9f06, 0x0110, 0x7e0e, 0x0008, 0x2678, 0x600f, 0x0000,
-	0x080c, 0xba4b, 0x1158, 0x080c, 0x303b, 0x080c, 0xba5c, 0x11f0,
-	0x080c, 0xa58f, 0x00d8, 0x080c, 0x94a2, 0x08c0, 0x080c, 0xba5c,
-	0x1118, 0x080c, 0xa58f, 0x0090, 0x6014, 0x2048, 0x080c, 0xb845,
-	0x0168, 0x6020, 0x9086, 0x0003, 0x1508, 0xa867, 0x0103, 0xab7a,
-	0xa877, 0x0000, 0x080c, 0x698a, 0x080c, 0xba36, 0x080c, 0xbcd3,
-	0x080c, 0x9c21, 0x080c, 0x9378, 0x00ce, 0x0804, 0x9504, 0x2c78,
-	0x600c, 0x2060, 0x0804, 0x9504, 0x012e, 0x000e, 0x002e, 0x006e,
-	0x00ce, 0x00de, 0x00ee, 0x00fe, 0x009e, 0x0005, 0x6020, 0x9086,
-	0x0006, 0x1d20, 0x080c, 0xd21e, 0x0c08, 0x00d6, 0x080c, 0x8d6b,
-	0x7003, 0x0200, 0x7007, 0x0014, 0x60c3, 0x0014, 0x20e1, 0x0001,
-	0x2099, 0x195a, 0x20e9, 0x0000, 0x20a1, 0x0250, 0x20a9, 0x0004,
-	0x4003, 0x7023, 0x0004, 0x7027, 0x7878, 0x080c, 0x8f87, 0x00de,
-	0x0005, 0x080c, 0x8d6b, 0x700b, 0x0800, 0x7814, 0x9084, 0xff00,
-	0x700e, 0x7814, 0x9084, 0x00ff, 0x7022, 0x782c, 0x7026, 0x7860,
-	0x9084, 0x00ff, 0x9085, 0x0200, 0x7002, 0x7860, 0x9084, 0xff00,
-	0x8007, 0x7006, 0x60c2, 0x0804, 0x8f87, 0x00b6, 0x00d6, 0x0016,
-	0x00d6, 0x2f68, 0x2009, 0x0035, 0x080c, 0xbed9, 0x00de, 0x1904,
-	0x9632, 0x080c, 0x8d20, 0x7003, 0x1300, 0x782c, 0x080c, 0x973d,
-	0x2068, 0x6820, 0x9086, 0x0003, 0x0560, 0x7810, 0x2058, 0xbaa0,
-	0x080c, 0x9b66, 0x11d8, 0x9286, 0x007e, 0x1128, 0x700b, 0x00ff,
-	0x700f, 0xfffe, 0x0498, 0x9286, 0x007f, 0x1128, 0x700b, 0x00ff,
-	0x700f, 0xfffd, 0x0458, 0x9284, 0xff80, 0x0180, 0x9286, 0x0080,
-	0x1128, 0x700b, 0x00ff, 0x700f, 0xfffc, 0x0400, 0x92d8, 0x1000,
-	0x2b5c, 0xb810, 0x700a, 0xb814, 0x700e, 0x00c0, 0xb884, 0x700e,
-	0x00a8, 0x080c, 0x9b66, 0x1130, 0x7810, 0x2058, 0xb8a0, 0x9082,
-	0x007e, 0x0250, 0x00d6, 0x2069, 0x181e, 0x2d04, 0x700a, 0x8d68,
-	0x2d04, 0x700e, 0x00de, 0x0010, 0x6034, 0x700e, 0x7838, 0x7012,
-	0x783c, 0x7016, 0x60c3, 0x000c, 0x001e, 0x00de, 0x080c, 0x8f87,
-	0x00be, 0x0005, 0x781b, 0x0001, 0x7803, 0x0006, 0x001e, 0x00de,
-	0x00be, 0x0005, 0x792c, 0x9180, 0x0008, 0x200c, 0x9186, 0x0006,
-	0x01c0, 0x9186, 0x0003, 0x0904, 0x96b0, 0x9186, 0x0005, 0x0904,
-	0x9698, 0x9186, 0x0004, 0x05f0, 0x9186, 0x0008, 0x0904, 0x96a1,
-	0x7807, 0x0037, 0x782f, 0x0003, 0x7817, 0x1700, 0x080c, 0x971a,
-	0x0005, 0x080c, 0x96db, 0x00d6, 0x0026, 0x792c, 0x2168, 0x2009,
-	0x4000, 0x6800, 0x6a44, 0xd2fc, 0x11f8, 0x0002, 0x9679, 0x9684,
-	0x967b, 0x9684, 0x9680, 0x9679, 0x9679, 0x9684, 0x9684, 0x9684,
-	0x9684, 0x9679, 0x9679, 0x9679, 0x9679, 0x9679, 0x9684, 0x9679,
-	0x9684, 0x080c, 0x0d65, 0x6824, 0xd0e4, 0x0110, 0xd0cc, 0x0110,
-	0x900e, 0x0010, 0x2009, 0x2000, 0x682c, 0x7022, 0x6830, 0x7026,
-	0x0804, 0x96d4, 0x080c, 0x96db, 0x00d6, 0x0026, 0x792c, 0x2168,
-	0x2009, 0x4000, 0x6a00, 0x9286, 0x0002, 0x1108, 0x900e, 0x04e0,
-	0x080c, 0x96db, 0x00d6, 0x0026, 0x792c, 0x2168, 0x2009, 0x4000,
-	0x0498, 0x04c9, 0x00d6, 0x0026, 0x792c, 0x2168, 0x2009, 0x4000,
-	0x9286, 0x0005, 0x0118, 0x9286, 0x0002, 0x1108, 0x900e, 0x0420,
-	0x0451, 0x00d6, 0x0026, 0x792c, 0x2168, 0x6814, 0x0096, 0x2048,
-	0xa9ac, 0xa834, 0x9112, 0xa9b0, 0xa838, 0x009e, 0x9103, 0x7022,
-	0x7226, 0x792c, 0x9180, 0x0011, 0x2004, 0xd0fc, 0x1148, 0x9180,
-	0x0000, 0x2004, 0x908e, 0x0002, 0x0130, 0x908e, 0x0004, 0x0118,
-	0x2009, 0x4000, 0x0008, 0x900e, 0x712a, 0x60c3, 0x0018, 0x002e,
-	0x00de, 0x0804, 0x8f87, 0x00b6, 0x0036, 0x0046, 0x0056, 0x0066,
-	0x080c, 0x8d6b, 0x9006, 0x7003, 0x0200, 0x7938, 0x710a, 0x793c,
-	0x710e, 0x7810, 0x2058, 0xb8a0, 0x080c, 0x9b66, 0x1118, 0x9092,
-	0x007e, 0x0268, 0x00d6, 0x2069, 0x181e, 0x2d2c, 0x8d68, 0x2d34,
-	0x90d8, 0x1000, 0x2b5c, 0xbb10, 0xbc14, 0x00de, 0x0028, 0x901e,
-	0xbc84, 0x2029, 0x0000, 0x6634, 0x782c, 0x9080, 0x0008, 0x2004,
-	0x9086, 0x0003, 0x1128, 0x7512, 0x7616, 0x731a, 0x741e, 0x0020,
-	0x7312, 0x7416, 0x751a, 0x761e, 0x006e, 0x005e, 0x004e, 0x003e,
-	0x00be, 0x0005, 0x080c, 0x8d6b, 0x7003, 0x0100, 0x782c, 0x700a,
-	0x7814, 0x700e, 0x700e, 0x60c3, 0x0008, 0x0804, 0x8f87, 0x080c,
-	0x8d17, 0x7003, 0x1400, 0x7838, 0x700a, 0x0079, 0x783c, 0x700e,
-	0x782c, 0x7012, 0x7830, 0x7016, 0x7834, 0x9084, 0x00ff, 0x8007,
-	0x701a, 0x60c3, 0x0010, 0x0804, 0x8f87, 0x00e6, 0x2071, 0x0240,
-	0x0006, 0x00f6, 0x2078, 0x7810, 0x00b6, 0x2058, 0xb8c4, 0xd084,
-	0x0120, 0x7850, 0x702a, 0x784c, 0x702e, 0x00be, 0x00fe, 0x000e,
-	0x00ee, 0x0005, 0x080c, 0x8d62, 0x7003, 0x0100, 0x782c, 0x700a,
-	0x7814, 0x700e, 0x60c3, 0x0008, 0x0804, 0x8f87, 0x00a9, 0x7914,
-	0x712a, 0x60c3, 0x0000, 0x60a7, 0x9575, 0x0026, 0x080c, 0x27a2,
-	0x0228, 0x2011, 0x0101, 0x2204, 0xc0c5, 0x2012, 0x002e, 0x080c,
-	0x8faa, 0x080c, 0x8202, 0x0005, 0x0036, 0x0096, 0x00d6, 0x00e6,
-	0x7860, 0x2048, 0xaa7c, 0x9296, 0x00c0, 0x9294, 0xfffd, 0xaa7e,
-	0xaa80, 0x9294, 0x0300, 0xaa82, 0xa96c, 0x9194, 0x00ff, 0xab74,
-	0x9384, 0x00ff, 0x908d, 0xc200, 0xa96e, 0x9384, 0xff00, 0x9215,
-	0xaa76, 0xa870, 0xaa78, 0xa87a, 0xaa72, 0x00d6, 0x2069, 0x0200,
-	0x080c, 0x97fa, 0x00de, 0x20e9, 0x0000, 0x20a1, 0x0240, 0x20a9,
-	0x000a, 0xa860, 0x20e0, 0xa85c, 0x9080, 0x001b, 0x2098, 0x4003,
-	0x60a3, 0x0035, 0xaa68, 0x9294, 0x7000, 0x9286, 0x3000, 0x0110,
-	0x60a3, 0x0037, 0x00ee, 0x00de, 0x009e, 0x003e, 0x0005, 0x900e,
-	0x7814, 0x0096, 0x2048, 0xa87c, 0xd0fc, 0x01c0, 0x9084, 0x0003,
-	0x11a8, 0x2001, 0x180c, 0x2004, 0xd0bc, 0x0180, 0x7824, 0xd0cc,
-	0x1168, 0xd0c4, 0x1158, 0xa8a8, 0x9005, 0x1140, 0x2001, 0x180c,
-	0x200c, 0xc1d5, 0x2102, 0x2009, 0x1983, 0x210c, 0x009e, 0x918d,
-	0x0092, 0x0010, 0x2009, 0x0096, 0x60ab, 0x0036, 0x0026, 0x2110,
-	0x900e, 0x080c, 0x287c, 0x002e, 0x0005, 0x2009, 0x0009, 0x00a0,
-	0x2009, 0x000a, 0x0088, 0x2009, 0x000b, 0x0070, 0x2009, 0x000c,
-	0x0058, 0x2009, 0x000d, 0x0040, 0x2009, 0x000e, 0x0028, 0x2009,
-	0x000f, 0x0010, 0x2009, 0x0008, 0x6912, 0x0005, 0x00d6, 0x9290,
-	0x0018, 0x8214, 0x20e9, 0x0000, 0x2069, 0x0200, 0x6813, 0x0000,
-	0x22a8, 0x9284, 0x00e0, 0x0128, 0x20a9, 0x0020, 0x9292, 0x0020,
-	0x0008, 0x9016, 0x20a1, 0x0240, 0x9006, 0x4004, 0x82ff, 0x0120,
-	0x6810, 0x8000, 0x6812, 0x0c60, 0x00de, 0x0005, 0x00f6, 0x00e6,
-	0x00d6, 0x00c6, 0x00a6, 0x0096, 0x0066, 0x0126, 0x2091, 0x8000,
-	0x2071, 0x19b8, 0x7610, 0x2660, 0x2678, 0x8cff, 0x0904, 0x98a5,
+	0x0100, 0x080c, 0x2852, 0x9006, 0x080c, 0x2852, 0x2069, 0x0100,
+	0x6824, 0xd084, 0x0110, 0x6827, 0x0001, 0x003e, 0x0040, 0x7008,
+	0xc0ad, 0x700a, 0x6003, 0x0009, 0x630a, 0x0804, 0x86d5, 0x7020,
+	0x9c36, 0x1110, 0x660c, 0x7622, 0x701c, 0x9c36, 0x1140, 0x2c00,
+	0x9f36, 0x0118, 0x2f00, 0x701e, 0x0010, 0x701f, 0x0000, 0x660c,
+	0x0066, 0x2c00, 0x9f06, 0x0110, 0x7e0e, 0x0008, 0x2678, 0x600f,
+	0x0000, 0x6044, 0xc0fc, 0x6046, 0x6014, 0x2048, 0x080c, 0xb842,
+	0x01e8, 0x6020, 0x9086, 0x0003, 0x1580, 0x080c, 0xba57, 0x1118,
+	0x080c, 0xa581, 0x0098, 0xa867, 0x0103, 0xab7a, 0xa877, 0x0000,
+	0x0016, 0x0036, 0x0086, 0x080c, 0xbb45, 0x080c, 0xd52b, 0x080c,
+	0x6991, 0x008e, 0x003e, 0x001e, 0x080c, 0xba31, 0x080c, 0x9c14,
+	0x080c, 0x935b, 0x00ce, 0x0804, 0x864f, 0x2c78, 0x600c, 0x2060,
+	0x0804, 0x864f, 0x012e, 0x000e, 0x001e, 0x006e, 0x00ce, 0x00de,
+	0x00ee, 0x00fe, 0x009e, 0x00be, 0x0005, 0x6020, 0x9086, 0x0006,
+	0x1158, 0x0016, 0x0036, 0x0086, 0x080c, 0xd52b, 0x080c, 0xd22f,
+	0x008e, 0x003e, 0x001e, 0x08d0, 0x080c, 0xa581, 0x6020, 0x9086,
+	0x0002, 0x1160, 0x6004, 0x0006, 0x9086, 0x0085, 0x000e, 0x0904,
+	0x86bb, 0x9086, 0x008b, 0x0904, 0x86bb, 0x0840, 0x6020, 0x9086,
+	0x0005, 0x1920, 0x6004, 0x0006, 0x9086, 0x0085, 0x000e, 0x09c8,
+	0x9086, 0x008b, 0x09b0, 0x0804, 0x86ce, 0x0006, 0x00f6, 0x00e6,
+	0x0096, 0x00b6, 0x00c6, 0x0066, 0x0016, 0x0126, 0x2091, 0x8000,
+	0x9280, 0x1000, 0x2004, 0x905d, 0x2079, 0x19b7, 0x9036, 0x7828,
+	0x2060, 0x8cff, 0x0538, 0x6010, 0x9b06, 0x1500, 0x6043, 0xffff,
+	0x080c, 0x9a77, 0x01d8, 0x610c, 0x0016, 0x080c, 0x90f3, 0x6014,
+	0x2048, 0xa867, 0x0103, 0xab7a, 0xa877, 0x0000, 0x0016, 0x0036,
+	0x0086, 0x080c, 0xbb45, 0x080c, 0xd52b, 0x080c, 0x6991, 0x008e,
+	0x003e, 0x001e, 0x080c, 0x9c14, 0x00ce, 0x08d8, 0x2c30, 0x600c,
+	0x2060, 0x08b8, 0x080c, 0x6415, 0x012e, 0x001e, 0x006e, 0x00ce,
+	0x00be, 0x009e, 0x00ee, 0x00fe, 0x000e, 0x0005, 0x0096, 0x0006,
+	0x0066, 0x00c6, 0x00d6, 0x9036, 0x7820, 0x9065, 0x0904, 0x87c5,
+	0x600c, 0x0006, 0x6044, 0xc0fc, 0x6046, 0x600f, 0x0000, 0x7830,
+	0x9c06, 0x1588, 0x2069, 0x0100, 0x6820, 0xd0a4, 0x1508, 0x080c,
+	0x81ea, 0x080c, 0x8f9c, 0x68c3, 0x0000, 0x080c, 0x9485, 0x7833,
+	0x0000, 0x0036, 0x2069, 0x0140, 0x6b04, 0x9384, 0x1000, 0x0138,
+	0x2001, 0x0100, 0x080c, 0x2852, 0x9006, 0x080c, 0x2852, 0x2069,
+	0x0100, 0x6824, 0xd084, 0x0110, 0x6827, 0x0001, 0x003e, 0x0058,
+	0x080c, 0x661c, 0x1538, 0x6003, 0x0009, 0x630a, 0x7808, 0xc0ad,
+	0x780a, 0x2c30, 0x00f8, 0x6014, 0x2048, 0x080c, 0xb840, 0x01b0,
+	0x6020, 0x9086, 0x0003, 0x1508, 0x080c, 0xba57, 0x1118, 0x080c,
+	0xa581, 0x0060, 0x080c, 0x661c, 0x1168, 0xa867, 0x0103, 0xab7a,
+	0xa877, 0x0000, 0x080c, 0x6991, 0x080c, 0xba31, 0x080c, 0x9c14,
+	0x080c, 0x935b, 0x000e, 0x0804, 0x8765, 0x7e22, 0x7e1e, 0x00de,
+	0x00ce, 0x006e, 0x000e, 0x009e, 0x0005, 0x6020, 0x9086, 0x0006,
+	0x1118, 0x080c, 0xd22f, 0x0c50, 0x080c, 0xa581, 0x6020, 0x9086,
+	0x0002, 0x1150, 0x6004, 0x0006, 0x9086, 0x0085, 0x000e, 0x0990,
+	0x9086, 0x008b, 0x0978, 0x08d0, 0x6020, 0x9086, 0x0005, 0x19b0,
+	0x6004, 0x0006, 0x9086, 0x0085, 0x000e, 0x0d18, 0x9086, 0x008b,
+	0x0d00, 0x0860, 0x0006, 0x0096, 0x00b6, 0x00c6, 0x0066, 0x9036,
+	0x7828, 0x9065, 0x0510, 0x6010, 0x2058, 0x600c, 0x0006, 0x3e08,
+	0x918e, 0x0002, 0x1118, 0xb800, 0xd0bc, 0x11a8, 0x6043, 0xffff,
+	0x080c, 0x9a77, 0x0180, 0x610c, 0x080c, 0x90f3, 0x6014, 0x2048,
+	0xa867, 0x0103, 0xab7a, 0xa877, 0x0000, 0x080c, 0x6991, 0x080c,
+	0x9c14, 0x000e, 0x08f0, 0x2c30, 0x0ce0, 0x006e, 0x00ce, 0x00be,
+	0x009e, 0x000e, 0x0005, 0x00e6, 0x00d6, 0x0096, 0x0066, 0x080c,
+	0x5dd1, 0x11b0, 0x2071, 0x19b7, 0x7030, 0x9080, 0x0005, 0x2004,
+	0x904d, 0x0170, 0xa878, 0x9606, 0x1158, 0x2071, 0x19b7, 0x7030,
+	0x9035, 0x0130, 0x9080, 0x0005, 0x2004, 0x9906, 0x1108, 0x0029,
+	0x006e, 0x009e, 0x00de, 0x00ee, 0x0005, 0x00c6, 0x2660, 0x6043,
+	0xffff, 0x080c, 0x9a77, 0x0178, 0x080c, 0x90f3, 0x6014, 0x2048,
+	0xa867, 0x0103, 0xab7a, 0xa877, 0x0000, 0x080c, 0xbb45, 0x080c,
+	0x6991, 0x080c, 0x9c14, 0x00ce, 0x0005, 0x00b6, 0x00e6, 0x00c6,
+	0x080c, 0x98bb, 0x0106, 0x2071, 0x0101, 0x2e04, 0xc0c4, 0x2072,
+	0x6044, 0xd0fc, 0x1138, 0x010e, 0x090c, 0x98d7, 0x00ce, 0x00ee,
+	0x00be, 0x0005, 0x2071, 0x19b7, 0x7030, 0x9005, 0x0da0, 0x9c06,
+	0x190c, 0x0d65, 0x7036, 0x080c, 0x81ea, 0x7004, 0x9084, 0x0007,
+	0x0002, 0x888b, 0x888d, 0x8894, 0x889e, 0x88ac, 0x888b, 0x8899,
+	0x8889, 0x080c, 0x0d65, 0x0428, 0x0005, 0x080c, 0x9a62, 0x7007,
+	0x0000, 0x7033, 0x0000, 0x00e8, 0x0066, 0x9036, 0x080c, 0x90f3,
+	0x006e, 0x7007, 0x0000, 0x7033, 0x0000, 0x0098, 0x080c, 0x9a4d,
+	0x0140, 0x080c, 0x9a62, 0x0128, 0x0066, 0x9036, 0x080c, 0x90f3,
+	0x006e, 0x7033, 0x0000, 0x0028, 0x080c, 0x9a4d, 0x080c, 0x9485,
+	0x0000, 0x010e, 0x190c, 0x98d7, 0x00ce, 0x00ee, 0x00be, 0x0005,
+	0x00d6, 0x00c6, 0x080c, 0x98bb, 0x0106, 0x6044, 0xd0fc, 0x1130,
+	0x010e, 0x090c, 0x98d7, 0x00ce, 0x00de, 0x0005, 0x2069, 0x19b7,
+	0x684c, 0x9005, 0x0da8, 0x9c06, 0x190c, 0x0d65, 0x6852, 0x00e6,
+	0x2d70, 0x080c, 0x8503, 0x00ee, 0x080c, 0x81f7, 0x0016, 0x2009,
+	0x0040, 0x080c, 0x2063, 0x001e, 0x683c, 0x9084, 0x0003, 0x0002,
+	0x88e6, 0x88e7, 0x8905, 0x88e4, 0x080c, 0x0d65, 0x0460, 0x6868,
+	0x9086, 0x0001, 0x0190, 0x600c, 0x9015, 0x0160, 0x6a4a, 0x600f,
+	0x0000, 0x6044, 0xc0fc, 0x6046, 0x9006, 0x7042, 0x684e, 0x683f,
+	0x0000, 0x00c8, 0x684a, 0x6846, 0x0ca0, 0x686b, 0x0000, 0x6848,
+	0x9065, 0x0d78, 0x6003, 0x0002, 0x0c60, 0x9006, 0x686a, 0x6852,
+	0x686e, 0x600c, 0x9015, 0x0120, 0x6a4a, 0x600f, 0x0000, 0x0018,
+	0x684e, 0x684a, 0x6846, 0x684f, 0x0000, 0x010e, 0x190c, 0x98d7,
+	0x00ce, 0x00de, 0x0005, 0x0005, 0x6020, 0x9084, 0x000f, 0x000b,
+	0x0005, 0x8931, 0x8934, 0x8d8d, 0x8e1c, 0x8934, 0x8d8d, 0x8e1c,
+	0x8931, 0x8934, 0x8931, 0x8931, 0x8931, 0x8931, 0x8931, 0x8931,
+	0x8931, 0x080c, 0x885d, 0x0005, 0x00b6, 0x0156, 0x0136, 0x0146,
+	0x01c6, 0x01d6, 0x00c6, 0x00d6, 0x00e6, 0x00f6, 0x2069, 0x0200,
+	0x2071, 0x0240, 0x6004, 0x908a, 0x0053, 0x1a0c, 0x0d65, 0x6110,
+	0x2158, 0xb984, 0x2c78, 0x2061, 0x0100, 0x619a, 0x908a, 0x0040,
+	0x1a04, 0x89a0, 0x005b, 0x00fe, 0x00ee, 0x00de, 0x00ce, 0x01de,
+	0x01ce, 0x014e, 0x013e, 0x015e, 0x00be, 0x0005, 0x8b17, 0x8b52,
+	0x8b7b, 0x8c1e, 0x8c3f, 0x8c45, 0x8c52, 0x8c5a, 0x8c66, 0x8c6c,
+	0x8c7d, 0x8c6c, 0x8cd4, 0x8c5a, 0x8ce0, 0x8ce6, 0x8c66, 0x8ce6,
+	0x8cf2, 0x899e, 0x899e, 0x899e, 0x899e, 0x899e, 0x899e, 0x899e,
+	0x899e, 0x899e, 0x899e, 0x899e, 0x9114, 0x9137, 0x9148, 0x9168,
+	0x919a, 0x8c52, 0x899e, 0x8c52, 0x8c6c, 0x899e, 0x8b7b, 0x8c1e,
+	0x899e, 0x9583, 0x8c6c, 0x899e, 0x959f, 0x8c6c, 0x899e, 0x8c66,
+	0x8b11, 0x89c1, 0x899e, 0x95bb, 0x9628, 0x9708, 0x899e, 0x9715,
+	0x8c4f, 0x9740, 0x899e, 0x91a4, 0x974c, 0x899e, 0x080c, 0x0d65,
+	0x2100, 0x005b, 0x00fe, 0x00ee, 0x00de, 0x00ce, 0x01de, 0x01ce,
+	0x014e, 0x013e, 0x015e, 0x00be, 0x0005, 0x89bf, 0x89bf, 0x89bf,
+	0x89e8, 0x8a94, 0x8a9f, 0x89bf, 0x89bf, 0x89bf, 0x8ae6, 0x8af2,
+	0x8a03, 0x89bf, 0x8a1e, 0x8a52, 0x9acd, 0x9b12, 0x8c6c, 0x080c,
+	0x0d65, 0x00d6, 0x0096, 0x080c, 0x8d05, 0x7003, 0x2414, 0x7007,
+	0x0018, 0x700b, 0x0800, 0x7814, 0x2048, 0xa83c, 0x700e, 0xa850,
+	0x7022, 0xa854, 0x7026, 0x60c3, 0x0018, 0x080c, 0x8f6c, 0x009e,
+	0x00de, 0x0005, 0x7810, 0x00b6, 0x2058, 0xb8a0, 0x00be, 0x080c,
+	0x9b59, 0x1118, 0x9084, 0xff80, 0x0110, 0x9085, 0x0001, 0x0005,
+	0x00d6, 0x0096, 0x080c, 0x8d05, 0x7003, 0x0500, 0x7814, 0x2048,
+	0xa874, 0x700a, 0xa878, 0x700e, 0xa87c, 0x7012, 0xa880, 0x7016,
+	0xa884, 0x701a, 0xa888, 0x701e, 0x60c3, 0x0010, 0x080c, 0x8f6c,
+	0x009e, 0x00de, 0x0005, 0x00d6, 0x0096, 0x080c, 0x8d05, 0x7003,
+	0x0500, 0x7814, 0x2048, 0xa8cc, 0x700a, 0xa8d0, 0x700e, 0xa8d4,
+	0x7012, 0xa8d8, 0x7016, 0xa8dc, 0x701a, 0xa8e0, 0x701e, 0x60c3,
+	0x0010, 0x080c, 0x8f6c, 0x009e, 0x00de, 0x0005, 0x00d6, 0x0096,
+	0x0126, 0x2091, 0x8000, 0x080c, 0x8d05, 0x20e9, 0x0000, 0x2001,
+	0x1973, 0x2003, 0x0000, 0x7814, 0x2048, 0xa814, 0x8003, 0x60c2,
+	0xa830, 0x20a8, 0xa860, 0x20e0, 0xa85c, 0x9080, 0x001b, 0x2098,
+	0x2001, 0x1973, 0x0016, 0x200c, 0x2001, 0x0001, 0x080c, 0x2048,
+	0x080c, 0xc59f, 0x9006, 0x080c, 0x2048, 0x001e, 0xa804, 0x9005,
+	0x0110, 0x2048, 0x0c28, 0x04d9, 0x080c, 0x8f6c, 0x012e, 0x009e,
+	0x00de, 0x0005, 0x00d6, 0x0096, 0x0126, 0x2091, 0x8000, 0x080c,
+	0x8d50, 0x20e9, 0x0000, 0x2001, 0x1973, 0x2003, 0x0000, 0x7814,
+	0x2048, 0xa86f, 0x0200, 0xa873, 0x0000, 0xa814, 0x8003, 0x60c2,
+	0xa830, 0x20a8, 0xa860, 0x20e0, 0xa85c, 0x9080, 0x001b, 0x2098,
+	0x2001, 0x1973, 0x0016, 0x200c, 0x080c, 0xc59f, 0x001e, 0xa804,
+	0x9005, 0x0110, 0x2048, 0x0c60, 0x0051, 0x7814, 0x2048, 0x080c,
+	0x0fd4, 0x080c, 0x8f6c, 0x012e, 0x009e, 0x00de, 0x0005, 0x60c0,
+	0x8004, 0x9084, 0x0003, 0x9005, 0x0130, 0x9082, 0x0004, 0x20a3,
+	0x0000, 0x8000, 0x1de0, 0x0005, 0x080c, 0x8d05, 0x7003, 0x7800,
+	0x7808, 0x8007, 0x700a, 0x60c3, 0x0008, 0x0804, 0x8f6c, 0x00d6,
+	0x00e6, 0x080c, 0x8d50, 0x7814, 0x9084, 0xff00, 0x2073, 0x0200,
+	0x8e70, 0x8e70, 0x9095, 0x0010, 0x2272, 0x8e70, 0x2073, 0x0034,
+	0x8e70, 0x2069, 0x1805, 0x20a9, 0x0004, 0x2d76, 0x8d68, 0x8e70,
+	0x1f04, 0x8ab5, 0x2069, 0x1801, 0x20a9, 0x0004, 0x2d76, 0x8d68,
+	0x8e70, 0x1f04, 0x8abe, 0x2069, 0x1983, 0x9086, 0xdf00, 0x0110,
+	0x2069, 0x199d, 0x20a9, 0x001a, 0x9e86, 0x0260, 0x1148, 0x00c6,
+	0x2061, 0x0200, 0x6010, 0x8000, 0x6012, 0x00ce, 0x2071, 0x0240,
+	0x2d04, 0x8007, 0x2072, 0x8d68, 0x8e70, 0x1f04, 0x8acc, 0x60c3,
+	0x004c, 0x080c, 0x8f6c, 0x00ee, 0x00de, 0x0005, 0x080c, 0x8d05,
+	0x7003, 0x6300, 0x7007, 0x0028, 0x7808, 0x700e, 0x60c3, 0x0008,
+	0x0804, 0x8f6c, 0x00d6, 0x0026, 0x0016, 0x080c, 0x8d50, 0x7003,
+	0x0200, 0x7814, 0x700e, 0x00e6, 0x9ef0, 0x0004, 0x2009, 0x0001,
+	0x2011, 0x000c, 0x2073, 0x0800, 0x8e70, 0x2073, 0x0000, 0x00ee,
+	0x7206, 0x710a, 0x62c2, 0x080c, 0x8f6c, 0x001e, 0x002e, 0x00de,
+	0x0005, 0x2001, 0x1817, 0x2004, 0x609a, 0x0804, 0x8f6c, 0x080c,
+	0x8d05, 0x7003, 0x5200, 0x2069, 0x1853, 0x6804, 0xd084, 0x0130,
+	0x6828, 0x0016, 0x080c, 0x2470, 0x710e, 0x001e, 0x20a9, 0x0004,
+	0x20e1, 0x0001, 0x2099, 0x1805, 0x20e9, 0x0000, 0x20a1, 0x0250,
+	0x4003, 0x20a9, 0x0004, 0x2099, 0x1801, 0x20a1, 0x0254, 0x4003,
+	0x080c, 0x9b59, 0x1120, 0xb8a0, 0x9082, 0x007f, 0x0248, 0x2001,
+	0x181e, 0x2004, 0x7032, 0x2001, 0x181f, 0x2004, 0x7036, 0x0030,
+	0x2001, 0x1817, 0x2004, 0x9084, 0x00ff, 0x7036, 0x60c3, 0x001c,
+	0x0804, 0x8f6c, 0x080c, 0x8d05, 0x7003, 0x0500, 0x080c, 0x9b59,
+	0x1120, 0xb8a0, 0x9082, 0x007f, 0x0248, 0x2001, 0x181e, 0x2004,
+	0x700a, 0x2001, 0x181f, 0x2004, 0x700e, 0x0030, 0x2001, 0x1817,
+	0x2004, 0x9084, 0x00ff, 0x700e, 0x20a9, 0x0004, 0x20e1, 0x0001,
+	0x2099, 0x1805, 0x20e9, 0x0000, 0x20a1, 0x0250, 0x4003, 0x60c3,
+	0x0010, 0x0804, 0x8f6c, 0x080c, 0x8d05, 0x9006, 0x080c, 0x6630,
+	0xb8a0, 0x9086, 0x007e, 0x1130, 0x7003, 0x0400, 0x620c, 0xc2b4,
+	0x620e, 0x0058, 0x7814, 0x0096, 0x904d, 0x0120, 0x9006, 0xa89a,
+	0xa8a6, 0xa8aa, 0x009e, 0x7003, 0x0300, 0xb8a0, 0x9086, 0x007e,
+	0x1904, 0x8be6, 0x00d6, 0x2069, 0x193c, 0x2001, 0x1836, 0x2004,
+	0xd0a4, 0x0178, 0x6800, 0x700a, 0x6808, 0x9084, 0x2000, 0x7012,
+	0x680c, 0x7016, 0x701f, 0x2710, 0x6818, 0x7022, 0x681c, 0x7026,
+	0x0080, 0x6800, 0x700a, 0x6804, 0x700e, 0x6808, 0x080c, 0x7096,
+	0x1118, 0x9084, 0x37ff, 0x0010, 0x9084, 0x3fff, 0x7012, 0x680c,
+	0x7016, 0x00de, 0x20a9, 0x0004, 0x20e1, 0x0001, 0x2099, 0x1805,
+	0x20e9, 0x0000, 0x20a1, 0x0256, 0x4003, 0x20a9, 0x0004, 0x2099,
+	0x1801, 0x20a1, 0x025a, 0x4003, 0x00d6, 0x080c, 0x97d3, 0x2069,
+	0x1944, 0x2071, 0x024e, 0x6800, 0xc0dd, 0x7002, 0x080c, 0x538c,
+	0xd0e4, 0x0110, 0x680c, 0x700e, 0x00de, 0x04a0, 0x2001, 0x1836,
+	0x2004, 0xd0a4, 0x0168, 0x0016, 0x2009, 0x0002, 0x60e0, 0x9106,
+	0x0130, 0x2100, 0x60e3, 0x0000, 0x080c, 0x24b1, 0x61e2, 0x001e,
+	0x20e1, 0x0001, 0x2099, 0x193c, 0x20e9, 0x0000, 0x20a1, 0x024e,
+	0x20a9, 0x0008, 0x4003, 0x20a9, 0x0004, 0x2099, 0x1805, 0x20a1,
+	0x0256, 0x4003, 0x20a9, 0x0004, 0x2099, 0x1801, 0x20a1, 0x025a,
+	0x4003, 0x080c, 0x97d3, 0x20a1, 0x024e, 0x20a9, 0x0008, 0x2099,
+	0x1944, 0x4003, 0x60c3, 0x0074, 0x0804, 0x8f6c, 0x080c, 0x8d05,
+	0x7003, 0x2010, 0x7007, 0x0014, 0x700b, 0x0800, 0x700f, 0x2000,
+	0x9006, 0x00f6, 0x2079, 0x1853, 0x7904, 0x00fe, 0xd1ac, 0x1110,
+	0x9085, 0x0020, 0x0010, 0x9085, 0x0010, 0x9085, 0x0002, 0x00d6,
+	0x0804, 0x8cb5, 0x7026, 0x60c3, 0x0014, 0x0804, 0x8f6c, 0x080c,
+	0x8d05, 0x7003, 0x5000, 0x0804, 0x8b95, 0x080c, 0x8d05, 0x7003,
+	0x2110, 0x7007, 0x0014, 0x60c3, 0x0014, 0x0804, 0x8f6c, 0x080c,
+	0x8d47, 0x0010, 0x080c, 0x8d50, 0x7003, 0x0200, 0x60c3, 0x0004,
+	0x0804, 0x8f6c, 0x080c, 0x8d50, 0x7003, 0x0100, 0x700b, 0x0003,
+	0x700f, 0x2a00, 0x60c3, 0x0008, 0x0804, 0x8f6c, 0x080c, 0x8d50,
+	0x7003, 0x0200, 0x0804, 0x8b95, 0x080c, 0x8d50, 0x7003, 0x0100,
+	0x782c, 0x9005, 0x0110, 0x700a, 0x0010, 0x700b, 0x0003, 0x7814,
+	0x700e, 0x60c3, 0x0008, 0x0804, 0x8f6c, 0x00d6, 0x080c, 0x8d50,
+	0x7003, 0x0210, 0x7007, 0x0014, 0x700b, 0x0800, 0xb894, 0x9086,
+	0x0014, 0x1198, 0xb99c, 0x9184, 0x0030, 0x0190, 0xb998, 0x9184,
+	0xc000, 0x1140, 0xd1ec, 0x0118, 0x700f, 0x2100, 0x0058, 0x700f,
+	0x0100, 0x0040, 0x700f, 0x0400, 0x0028, 0x700f, 0x0700, 0x0010,
+	0x700f, 0x0800, 0x00f6, 0x2079, 0x1853, 0x7904, 0x00fe, 0xd1ac,
+	0x1110, 0x9085, 0x0020, 0x0010, 0x9085, 0x0010, 0x2009, 0x1875,
+	0x210c, 0xd184, 0x1110, 0x9085, 0x0002, 0x0026, 0x2009, 0x1873,
+	0x210c, 0xd1e4, 0x0150, 0xc0c5, 0xbac4, 0xd28c, 0x1108, 0xc0cd,
+	0x9094, 0x0030, 0x9296, 0x0010, 0x0140, 0xd1ec, 0x0130, 0x9094,
+	0x0030, 0x9296, 0x0010, 0x0108, 0xc0bd, 0x002e, 0x7026, 0x60c3,
+	0x0014, 0x00de, 0x0804, 0x8f6c, 0x080c, 0x8d50, 0x7003, 0x0210,
+	0x7007, 0x0014, 0x700f, 0x0100, 0x60c3, 0x0014, 0x0804, 0x8f6c,
+	0x080c, 0x8d50, 0x7003, 0x0200, 0x0804, 0x8b1b, 0x080c, 0x8d50,
+	0x7003, 0x0100, 0x700b, 0x0003, 0x700f, 0x2a00, 0x60c3, 0x0008,
+	0x0804, 0x8f6c, 0x080c, 0x8d50, 0x7003, 0x0100, 0x700b, 0x000b,
+	0x60c3, 0x0008, 0x0804, 0x8f6c, 0x0026, 0x00d6, 0x0036, 0x0046,
+	0x2019, 0x3200, 0x2021, 0x0800, 0x0040, 0x0026, 0x00d6, 0x0036,
+	0x0046, 0x2019, 0x2200, 0x2021, 0x0100, 0x080c, 0x97e8, 0xb810,
+	0x9305, 0x7002, 0xb814, 0x7006, 0x2069, 0x1800, 0x6878, 0x700a,
+	0x687c, 0x700e, 0x9485, 0x0029, 0x7012, 0x004e, 0x003e, 0x00de,
+	0x080c, 0x8f60, 0x721a, 0x9f95, 0x0000, 0x7222, 0x7027, 0xffff,
+	0x2071, 0x024c, 0x002e, 0x0005, 0x0026, 0x080c, 0x97e8, 0x7003,
+	0x02ff, 0x7007, 0xfffc, 0x00d6, 0x2069, 0x1800, 0x6878, 0x700a,
+	0x687c, 0x700e, 0x00de, 0x7013, 0x2029, 0x0c10, 0x7003, 0x0100,
+	0x7007, 0x0000, 0x700b, 0xfc02, 0x700f, 0x0000, 0x0005, 0x0026,
+	0x00d6, 0x0036, 0x0046, 0x2019, 0x3300, 0x2021, 0x0800, 0x0040,
+	0x0026, 0x00d6, 0x0036, 0x0046, 0x2019, 0x2300, 0x2021, 0x0100,
+	0x080c, 0x97e8, 0xb810, 0x9305, 0x7002, 0xb814, 0x7006, 0x2069,
+	0x1800, 0xb810, 0x9005, 0x1140, 0xb814, 0x9005, 0x1128, 0x700b,
+	0x00ff, 0x700f, 0xfffe, 0x0020, 0x6878, 0x700a, 0x687c, 0x700e,
+	0x0000, 0x9485, 0x0098, 0x7012, 0x004e, 0x003e, 0x00de, 0x080c,
+	0x8f60, 0x721a, 0x7a08, 0x7222, 0x2f10, 0x7226, 0x2071, 0x024c,
+	0x002e, 0x0005, 0x080c, 0x8f60, 0x721a, 0x7a08, 0x7222, 0x7814,
+	0x7026, 0x2071, 0x024c, 0x002e, 0x0005, 0x00b6, 0x00c6, 0x00d6,
+	0x00e6, 0x00f6, 0x2069, 0x0200, 0x2071, 0x0240, 0x6004, 0x908a,
+	0x0085, 0x0a0c, 0x0d65, 0x908a, 0x0092, 0x1a0c, 0x0d65, 0x6110,
+	0x2158, 0xb984, 0x2c78, 0x2061, 0x0100, 0x619a, 0x9082, 0x0085,
+	0x0033, 0x00fe, 0x00ee, 0x00de, 0x00ce, 0x00be, 0x0005, 0x8dbe,
+	0x8dcd, 0x8dd8, 0x8dbc, 0x8dbc, 0x8dbc, 0x8dbe, 0x8dbc, 0x8dbc,
+	0x8dbc, 0x8dbc, 0x8dbc, 0x8dbc, 0x080c, 0x0d65, 0x0411, 0x60c3,
+	0x0000, 0x0026, 0x080c, 0x27c1, 0x0228, 0x2011, 0x0101, 0x2204,
+	0xc0c5, 0x2012, 0x002e, 0x0804, 0x8f6c, 0x0431, 0x7808, 0x700a,
+	0x7814, 0x700e, 0x7017, 0xffff, 0x60c3, 0x000c, 0x0804, 0x8f6c,
+	0x0479, 0x7003, 0x0003, 0x7007, 0x0300, 0x60c3, 0x0004, 0x0804,
+	0x8f6c, 0x0026, 0x080c, 0x97e8, 0xb810, 0x9085, 0x8100, 0x7002,
+	0xb814, 0x7006, 0x2069, 0x1800, 0x6878, 0x700a, 0x687c, 0x700e,
+	0x7013, 0x0009, 0x0804, 0x8d20, 0x0026, 0x080c, 0x97e8, 0xb810,
+	0x9085, 0x8400, 0x7002, 0xb814, 0x7006, 0x2069, 0x1800, 0x6878,
+	0x700a, 0x687c, 0x700e, 0x2001, 0x0099, 0x7012, 0x0804, 0x8d82,
+	0x0026, 0x080c, 0x97e8, 0xb810, 0x9085, 0x8500, 0x7002, 0xb814,
+	0x7006, 0x2069, 0x1800, 0x6878, 0x700a, 0x687c, 0x700e, 0x2001,
+	0x0099, 0x7012, 0x0804, 0x8d82, 0x00b6, 0x00c6, 0x00d6, 0x00e6,
+	0x00f6, 0x2c78, 0x2069, 0x0200, 0x2071, 0x0240, 0x7804, 0x908a,
+	0x0040, 0x0a0c, 0x0d65, 0x908a, 0x0057, 0x1a0c, 0x0d65, 0x7910,
+	0x2158, 0xb984, 0x2061, 0x0100, 0x619a, 0x9082, 0x0040, 0x0033,
+	0x00fe, 0x00ee, 0x00de, 0x00ce, 0x00be, 0x0005, 0x8e51, 0x8e51,
+	0x8e51, 0x8e77, 0x8e51, 0x8e51, 0x8e51, 0x8e51, 0x8e51, 0x8e51,
+	0x8e51, 0x9338, 0x9340, 0x9348, 0x9350, 0x8e51, 0x8e51, 0x8e51,
+	0x9330, 0x080c, 0x0d65, 0x6813, 0x0008, 0xba8c, 0x8210, 0xb8c4,
+	0xd084, 0x0128, 0x7a4e, 0x7b14, 0x7b52, 0x722e, 0x732a, 0x9294,
+	0x00ff, 0xba8e, 0x8217, 0x721a, 0xba10, 0x9295, 0x0600, 0x7202,
+	0xba14, 0x7206, 0x2069, 0x1800, 0x6a78, 0x720a, 0x6a7c, 0x720e,
+	0x7013, 0x0829, 0x2f10, 0x7222, 0x7027, 0xffff, 0x0005, 0x0016,
+	0x7814, 0x9084, 0x0700, 0x8007, 0x0013, 0x001e, 0x0005, 0x8e87,
+	0x8e87, 0x8e89, 0x8e87, 0x8e87, 0x8e87, 0x8ea3, 0x8e87, 0x080c,
+	0x0d65, 0x7914, 0x918c, 0x08ff, 0x918d, 0xf600, 0x7916, 0x2009,
+	0x0003, 0x00b9, 0x2069, 0x1853, 0x6804, 0xd0bc, 0x0130, 0x682c,
+	0x9084, 0x00ff, 0x8007, 0x7032, 0x0010, 0x7033, 0x3f00, 0x60c3,
+	0x0001, 0x0804, 0x8f6c, 0x2009, 0x0003, 0x0019, 0x7033, 0x7f00,
+	0x0cb0, 0x0016, 0x080c, 0x97e8, 0x001e, 0xb810, 0x9085, 0x0100,
+	0x7002, 0xb814, 0x7006, 0x2069, 0x1800, 0x6a78, 0x720a, 0x6a7c,
+	0x720e, 0x7013, 0x0888, 0x918d, 0x0008, 0x7116, 0x080c, 0x8f60,
+	0x721a, 0x7a08, 0x7222, 0x2f10, 0x7226, 0x0005, 0x00b6, 0x0096,
+	0x00e6, 0x00d6, 0x00c6, 0x0056, 0x0046, 0x0036, 0x2061, 0x0100,
+	0x2071, 0x1800, 0x7810, 0x2058, 0xb8a0, 0x2028, 0xb910, 0xba14,
+	0x7378, 0x747c, 0x7820, 0x0002, 0x8eeb, 0x8eeb, 0x8eeb, 0x8eeb,
+	0x8eeb, 0x8eeb, 0x8eeb, 0x8eeb, 0x8eeb, 0x8eeb, 0x8eed, 0x8eeb,
+	0x8eeb, 0x8eeb, 0x8eeb, 0x080c, 0x0d65, 0xb884, 0x609e, 0x7814,
+	0x2048, 0xa87c, 0xd0fc, 0x0558, 0xaf90, 0x9784, 0xff00, 0x9105,
+	0x6062, 0x873f, 0x9784, 0xff00, 0x0006, 0x7814, 0x2048, 0xa878,
+	0xc0fc, 0x9005, 0x000e, 0x1160, 0xaf94, 0x87ff, 0x0198, 0x2039,
+	0x0098, 0x9705, 0x6072, 0x7808, 0x6082, 0x2f00, 0x6086, 0x0038,
+	0x9185, 0x2200, 0x6062, 0x6073, 0x0129, 0x6077, 0x0000, 0xb884,
+	0x609e, 0x0050, 0x2039, 0x0029, 0x9705, 0x6072, 0x0cc0, 0x9185,
+	0x0200, 0x6062, 0x6073, 0x2029, 0xa87c, 0xd0fc, 0x0118, 0xaf94,
+	0x87ff, 0x1120, 0x2f00, 0x6082, 0x7808, 0x6086, 0x6266, 0x636a,
+	0x646e, 0x6077, 0x0000, 0xb88c, 0x8000, 0x9084, 0x00ff, 0xb88e,
+	0x8007, 0x607a, 0x607f, 0x0000, 0xa848, 0x608a, 0xa844, 0x608e,
+	0xa838, 0x60c6, 0xa834, 0x60ca, 0xb86c, 0x60ce, 0x60af, 0x95d5,
+	0x60d7, 0x0000, 0x080c, 0x97c8, 0x2009, 0x07d0, 0x60c4, 0x9084,
+	0xfff0, 0x9005, 0x0110, 0x2009, 0x1b58, 0x080c, 0x81ef, 0x003e,
+	0x004e, 0x005e, 0x00ce, 0x00de, 0x00ee, 0x009e, 0x00be, 0x0005,
+	0x7a40, 0x9294, 0x00ff, 0x8217, 0x0005, 0x00d6, 0x2069, 0x19b7,
+	0x686b, 0x0001, 0x00de, 0x0005, 0x60a3, 0x0056, 0x60a7, 0x9575,
+	0x00f1, 0x080c, 0x81e1, 0x0005, 0x0016, 0x2001, 0x180c, 0x200c,
+	0x9184, 0x0600, 0x9086, 0x0600, 0x0128, 0x0089, 0x080c, 0x81e1,
+	0x001e, 0x0005, 0xc1e5, 0x2001, 0x180c, 0x2102, 0x2001, 0x19b8,
+	0x2003, 0x0000, 0x2001, 0x19c3, 0x2003, 0x0000, 0x0c88, 0x0006,
+	0x0016, 0x0026, 0x2009, 0x1804, 0x2011, 0x0009, 0x080c, 0x289b,
+	0x002e, 0x001e, 0x000e, 0x0005, 0x0016, 0x00c6, 0x0006, 0x080c,
+	0x98bb, 0x0106, 0x2061, 0x0100, 0x61a4, 0x60a7, 0x95f5, 0x0016,
+	0x0026, 0x2009, 0x1804, 0x2011, 0x0008, 0x080c, 0x289b, 0x002e,
+	0x001e, 0x010e, 0x090c, 0x98d7, 0x000e, 0xa001, 0xa001, 0xa001,
+	0x61a6, 0x00ce, 0x001e, 0x0005, 0x00c6, 0x00d6, 0x0016, 0x0026,
+	0x2061, 0x0100, 0x2069, 0x0140, 0x080c, 0x7096, 0x1510, 0x2001,
+	0x19dc, 0x2004, 0x9005, 0x1904, 0x901b, 0x080c, 0x7137, 0x11a8,
+	0x2069, 0x0380, 0x6843, 0x0101, 0x6844, 0xd084, 0x1de8, 0x2061,
+	0x0100, 0x6020, 0xd0b4, 0x1120, 0x6024, 0xd084, 0x090c, 0x0d65,
+	0x6843, 0x0100, 0x080c, 0x81e1, 0x04b0, 0x00c6, 0x2061, 0x19b7,
+	0x00f0, 0x6904, 0x9194, 0x4000, 0x0598, 0x080c, 0x8f9c, 0x080c,
+	0x2862, 0x00c6, 0x2061, 0x19b7, 0x6134, 0x9192, 0x0008, 0x1278,
+	0x8108, 0x6136, 0x080c, 0x98bb, 0x6130, 0x080c, 0x98d7, 0x00ce,
+	0x81ff, 0x01c8, 0x080c, 0x81e1, 0x080c, 0x8f8f, 0x00a0, 0x080c,
+	0x98bb, 0x6130, 0x91e5, 0x0000, 0x0150, 0x080c, 0xd621, 0x080c,
+	0x81ea, 0x6003, 0x0001, 0x2009, 0x0014, 0x080c, 0x9c76, 0x080c,
+	0x98d7, 0x00ce, 0x0000, 0x002e, 0x001e, 0x00de, 0x00ce, 0x0005,
+	0x2001, 0x19dc, 0x2004, 0x9005, 0x1db0, 0x00c6, 0x2061, 0x19b7,
+	0x6134, 0x9192, 0x0003, 0x1ad8, 0x8108, 0x6136, 0x00ce, 0x080c,
+	0x81e1, 0x080c, 0x5b92, 0x2009, 0x1852, 0x2114, 0x8210, 0x220a,
+	0x0c10, 0x0096, 0x00c6, 0x00d6, 0x00e6, 0x0016, 0x0026, 0x080c,
+	0x81f7, 0x080c, 0x98bb, 0x2001, 0x0387, 0x2003, 0x0202, 0x2071,
+	0x19b7, 0x714c, 0x81ff, 0x0904, 0x90af, 0x2061, 0x0100, 0x2069,
+	0x0140, 0x080c, 0x7096, 0x11c0, 0x0036, 0x2019, 0x0002, 0x080c,
+	0x9269, 0x003e, 0x714c, 0x2160, 0x080c, 0xd621, 0x2009, 0x004a,
+	0x6003, 0x0003, 0x080c, 0x9c76, 0x2001, 0x0386, 0x2003, 0x5040,
+	0x080c, 0x7137, 0x0804, 0x90af, 0x6904, 0xd1f4, 0x0904, 0x90bc,
+	0x080c, 0x2862, 0x00c6, 0x704c, 0x9065, 0x090c, 0x0d65, 0x6020,
+	0x00ce, 0x9086, 0x0006, 0x1518, 0x61c8, 0x60c4, 0x9105, 0x11f8,
+	0x2009, 0x180c, 0x2104, 0xd0d4, 0x01d0, 0x6214, 0x9294, 0x1800,
+	0x1128, 0x6224, 0x9294, 0x0002, 0x1510, 0x0010, 0xc0d4, 0x200a,
+	0x6014, 0x9084, 0xe7fd, 0x9085, 0x0010, 0x6016, 0x704c, 0x2060,
+	0x080c, 0x88b8, 0x2009, 0x0049, 0x080c, 0x9c76, 0x0080, 0x0036,
+	0x2019, 0x0001, 0x080c, 0x9269, 0x003e, 0x714c, 0x2160, 0x080c,
+	0xd621, 0x2009, 0x004a, 0x6003, 0x0003, 0x080c, 0x9c76, 0x2001,
+	0x0387, 0x2003, 0x0200, 0x080c, 0x98d7, 0x002e, 0x001e, 0x00ee,
+	0x00de, 0x00ce, 0x009e, 0x0005, 0xd1ec, 0x1904, 0x9070, 0x0804,
+	0x9072, 0x0026, 0x00e6, 0x2071, 0x19b7, 0x706c, 0xd084, 0x01d0,
+	0xc084, 0x706e, 0x714c, 0x81ff, 0x01a8, 0x2071, 0x0100, 0x9188,
+	0x0008, 0x2114, 0x928e, 0x0006, 0x1138, 0x2009, 0x1984, 0x2011,
+	0x0012, 0x080c, 0x289b, 0x0030, 0x2009, 0x1984, 0x2011, 0x0016,
+	0x080c, 0x289b, 0x00ee, 0x002e, 0x0005, 0x9036, 0x2001, 0x19c1,
+	0x2004, 0x9005, 0x0128, 0x9c06, 0x0128, 0x2c30, 0x600c, 0x0cc8,
+	0x9085, 0x0001, 0x0005, 0x00f6, 0x2079, 0x19b7, 0x610c, 0x9006,
+	0x600e, 0x6044, 0xc0fc, 0x6046, 0x86ff, 0x1140, 0x7824, 0x9c06,
+	0x1118, 0x7826, 0x782a, 0x0050, 0x792a, 0x0040, 0x00c6, 0x2660,
+	0x610e, 0x00ce, 0x7824, 0x9c06, 0x1108, 0x7e26, 0x080c, 0x935b,
+	0x080c, 0xba31, 0x00fe, 0x0005, 0x080c, 0x8d05, 0x7003, 0x1200,
+	0x7838, 0x7012, 0x783c, 0x7016, 0x00c6, 0x7820, 0x9086, 0x0004,
+	0x1148, 0x7810, 0x9005, 0x0130, 0x00b6, 0x2058, 0xb810, 0xb914,
+	0x00be, 0x0020, 0x2061, 0x1800, 0x6078, 0x617c, 0x9084, 0x00ff,
+	0x700a, 0x710e, 0x00ce, 0x60c3, 0x002c, 0x0804, 0x8f6c, 0x080c,
+	0x8d05, 0x7003, 0x0f00, 0x7808, 0xd09c, 0x0128, 0xb810, 0x9084,
+	0x00ff, 0x700a, 0xb814, 0x700e, 0x60c3, 0x0008, 0x0804, 0x8f6c,
+	0x0156, 0x080c, 0x8d50, 0x7003, 0x0200, 0x2011, 0x1848, 0x63f0,
+	0x2312, 0x20a9, 0x0006, 0x2011, 0x1840, 0x2019, 0x1841, 0x9ef0,
+	0x0002, 0x2376, 0x8e70, 0x2276, 0x8e70, 0x9398, 0x0002, 0x9290,
+	0x0002, 0x1f04, 0x9159, 0x60c3, 0x001c, 0x015e, 0x0804, 0x8f6c,
+	0x0016, 0x0026, 0x080c, 0x8d2c, 0x080c, 0x8d3e, 0x9e80, 0x0004,
+	0x20e9, 0x0000, 0x20a0, 0x7814, 0x0096, 0x2048, 0xa800, 0x2048,
+	0xa860, 0x20e0, 0xa85c, 0x9080, 0x0021, 0x2098, 0x009e, 0x7808,
+	0x9088, 0x0002, 0x21a8, 0x9192, 0x0010, 0x1250, 0x4003, 0x9080,
+	0x0004, 0x8003, 0x60c2, 0x080c, 0x8f6c, 0x002e, 0x001e, 0x0005,
+	0x20a9, 0x0010, 0x4003, 0x080c, 0x97d3, 0x20a1, 0x0240, 0x22a8,
+	0x4003, 0x0c68, 0x080c, 0x8d05, 0x7003, 0x6200, 0x7808, 0x700e,
+	0x60c3, 0x0008, 0x0804, 0x8f6c, 0x0016, 0x0026, 0x080c, 0x8d05,
+	0x20e9, 0x0000, 0x20a1, 0x024c, 0x7814, 0x0096, 0x2048, 0xa800,
+	0x2048, 0xa860, 0x20e0, 0xa85c, 0x9080, 0x0023, 0x2098, 0x009e,
+	0x7808, 0x9088, 0x0002, 0x21a8, 0x4003, 0x8003, 0x60c2, 0x080c,
+	0x8f6c, 0x002e, 0x001e, 0x0005, 0x00e6, 0x00c6, 0x0006, 0x0126,
+	0x2091, 0x8000, 0x2071, 0x19b7, 0x7010, 0x2060, 0x8cff, 0x0188,
+	0x080c, 0xba57, 0x1110, 0x080c, 0xa581, 0x600c, 0x0006, 0x080c,
+	0xbcd3, 0x600f, 0x0000, 0x080c, 0x9bda, 0x080c, 0x935b, 0x00ce,
+	0x0c68, 0x2c00, 0x7012, 0x700e, 0x012e, 0x000e, 0x00ce, 0x00ee,
+	0x0005, 0x0126, 0x0156, 0x00f6, 0x00e6, 0x00d6, 0x00c6, 0x0066,
+	0x0026, 0x0016, 0x0006, 0x2091, 0x8000, 0x2001, 0x180c, 0x200c,
+	0x918c, 0xe7ff, 0x2102, 0x2069, 0x0100, 0x2079, 0x0140, 0x2071,
+	0x19b7, 0x7030, 0x2060, 0x8cff, 0x0548, 0x080c, 0x8f9c, 0x6ac0,
+	0x68c3, 0x0000, 0x080c, 0x81ea, 0x00c6, 0x2061, 0x0100, 0x080c,
+	0x97ec, 0x00ce, 0x20a9, 0x01f4, 0x04b1, 0x080c, 0x885d, 0x6044,
+	0xd0ac, 0x1128, 0x2001, 0x1958, 0x2004, 0x604a, 0x0020, 0x2009,
+	0x0013, 0x080c, 0x9c76, 0x000e, 0x001e, 0x002e, 0x006e, 0x00ce,
+	0x00de, 0x00ee, 0x00fe, 0x015e, 0x012e, 0x0005, 0x2001, 0x1800,
+	0x2004, 0x9096, 0x0001, 0x0d78, 0x9096, 0x0004, 0x0d60, 0x080c,
+	0x81ea, 0x6814, 0x9084, 0x0001, 0x0110, 0x68a7, 0x95f5, 0x6817,
+	0x0008, 0x68c3, 0x0000, 0x2011, 0x5b3c, 0x080c, 0x8138, 0x20a9,
+	0x01f4, 0x0009, 0x08c0, 0x6824, 0xd094, 0x0140, 0x6827, 0x0004,
+	0x7804, 0x9084, 0x4000, 0x190c, 0x2862, 0x0090, 0xd084, 0x0118,
+	0x6827, 0x0001, 0x0010, 0x1f04, 0x924b, 0x7804, 0x9084, 0x1000,
+	0x0138, 0x2001, 0x0100, 0x080c, 0x2852, 0x9006, 0x080c, 0x2852,
+	0x0005, 0x0126, 0x0156, 0x00f6, 0x00e6, 0x00d6, 0x00c6, 0x0066,
+	0x0026, 0x0016, 0x0006, 0x2091, 0x8000, 0x2001, 0x180c, 0x200c,
+	0x918c, 0xdbff, 0x2102, 0x2069, 0x0100, 0x2079, 0x0140, 0x2071,
+	0x0380, 0x701c, 0x0006, 0x701f, 0x0202, 0x2071, 0x19b7, 0x704c,
+	0x2060, 0x8cff, 0x0904, 0x930a, 0x9386, 0x0002, 0x1128, 0x6814,
+	0x9084, 0x0002, 0x0904, 0x930a, 0x68af, 0x95f5, 0x6817, 0x0010,
+	0x2009, 0x00fa, 0x8109, 0x1df0, 0x69c6, 0x68cb, 0x0008, 0x080c,
+	0x81f7, 0x080c, 0x1c87, 0x0046, 0x2009, 0x00a5, 0x080c, 0x0e3d,
+	0x2021, 0x0169, 0x2404, 0x9084, 0x000f, 0x9086, 0x0004, 0x11f8,
+	0x68af, 0x95f5, 0x68c6, 0x68cb, 0x0008, 0x00e6, 0x00f6, 0x2079,
+	0x0090, 0x2071, 0x19b7, 0x6814, 0x9084, 0x1984, 0x9085, 0x0012,
+	0x6816, 0x782b, 0x0008, 0x7057, 0x0000, 0x00fe, 0x00ee, 0x9386,
+	0x0002, 0x1128, 0x7884, 0x9005, 0x1110, 0x7887, 0x0001, 0x0016,
+	0x2009, 0x0040, 0x080c, 0x2063, 0x001e, 0x2009, 0x0000, 0x080c,
+	0x0e3d, 0x004e, 0x20a9, 0x03e8, 0x6824, 0xd094, 0x0140, 0x6827,
+	0x0004, 0x7804, 0x9084, 0x4000, 0x190c, 0x2862, 0x0090, 0xd08c,
+	0x0118, 0x6827, 0x0002, 0x0010, 0x1f04, 0x92dc, 0x7804, 0x9084,
+	0x1000, 0x0138, 0x2001, 0x0100, 0x080c, 0x2852, 0x9006, 0x080c,
+	0x2852, 0x6827, 0x4000, 0x6824, 0x83ff, 0x1160, 0x2009, 0x0049,
+	0x080c, 0x88b8, 0x6044, 0xd0ac, 0x1118, 0x6003, 0x0002, 0x0010,
+	0x080c, 0x9c76, 0x000e, 0x2071, 0x0380, 0xd08c, 0x1110, 0x701f,
+	0x0200, 0x000e, 0x001e, 0x002e, 0x006e, 0x00ce, 0x00de, 0x00ee,
+	0x00fe, 0x015e, 0x012e, 0x0005, 0x00d6, 0x0126, 0x2091, 0x8000,
+	0x2069, 0x19b7, 0x6a06, 0x012e, 0x00de, 0x0005, 0x00d6, 0x0126,
+	0x2091, 0x8000, 0x2069, 0x19b7, 0x6a3e, 0x012e, 0x00de, 0x0005,
+	0x080c, 0x8e53, 0x785c, 0x7032, 0x7042, 0x7047, 0x1000, 0x00f8,
+	0x080c, 0x8e53, 0x785c, 0x7032, 0x7042, 0x7047, 0x4000, 0x00b8,
+	0x080c, 0x8e53, 0x785c, 0x7032, 0x7042, 0x7047, 0x2000, 0x0078,
+	0x080c, 0x8e53, 0x785c, 0x7032, 0x7042, 0x7047, 0x0400, 0x0038,
+	0x080c, 0x8e53, 0x785c, 0x7032, 0x7042, 0x7047, 0x0200, 0x60c3,
+	0x0020, 0x0804, 0x8f6c, 0x00e6, 0x2071, 0x19b7, 0x702c, 0x9005,
+	0x0110, 0x8001, 0x702e, 0x00ee, 0x0005, 0x00f6, 0x00e6, 0x00d6,
+	0x00c6, 0x0076, 0x0066, 0x0006, 0x0126, 0x2091, 0x8000, 0x2071,
+	0x19b7, 0x7620, 0x2660, 0x2678, 0x2039, 0x0001, 0x87ff, 0x0904,
+	0x9400, 0x8cff, 0x0904, 0x9400, 0x6020, 0x9086, 0x0006, 0x1904,
+	0x93fb, 0x88ff, 0x0138, 0x2800, 0x9c06, 0x1904, 0x93fb, 0x2039,
+	0x0000, 0x0050, 0x6010, 0x9b06, 0x1904, 0x93fb, 0x85ff, 0x0120,
+	0x605c, 0x9106, 0x1904, 0x93fb, 0x7030, 0x9c06, 0x15b0, 0x2069,
+	0x0100, 0x68c0, 0x9005, 0x1160, 0x6824, 0xd084, 0x0148, 0x6827,
+	0x0001, 0x080c, 0x81ea, 0x080c, 0x9485, 0x7033, 0x0000, 0x0428,
+	0x080c, 0x81ea, 0x6820, 0xd0b4, 0x0110, 0x68a7, 0x95f5, 0x6817,
+	0x0008, 0x68c3, 0x0000, 0x080c, 0x9485, 0x7033, 0x0000, 0x0036,
+	0x2069, 0x0140, 0x6b04, 0x9384, 0x1000, 0x0138, 0x2001, 0x0100,
+	0x080c, 0x2852, 0x9006, 0x080c, 0x2852, 0x2069, 0x0100, 0x6824,
+	0xd084, 0x0110, 0x6827, 0x0001, 0x003e, 0x7020, 0x9c36, 0x1110,
+	0x660c, 0x7622, 0x701c, 0x9c36, 0x1140, 0x2c00, 0x9f36, 0x0118,
+	0x2f00, 0x701e, 0x0010, 0x701f, 0x0000, 0x660c, 0x0066, 0x2c00,
+	0x9f06, 0x0110, 0x7e0e, 0x0008, 0x2678, 0x89ff, 0x1168, 0x600f,
+	0x0000, 0x6014, 0x0096, 0x2048, 0x080c, 0xb840, 0x0110, 0x080c,
+	0xd22f, 0x009e, 0x080c, 0x9c14, 0x080c, 0x935b, 0x88ff, 0x1190,
+	0x00ce, 0x0804, 0x9376, 0x2c78, 0x600c, 0x2060, 0x0804, 0x9376,
+	0x9006, 0x012e, 0x000e, 0x006e, 0x007e, 0x00ce, 0x00de, 0x00ee,
+	0x00fe, 0x0005, 0x601b, 0x0000, 0x00ce, 0x98c5, 0x0001, 0x0c88,
+	0x00f6, 0x00e6, 0x00d6, 0x0096, 0x00c6, 0x0066, 0x0026, 0x0006,
+	0x0126, 0x2091, 0x8000, 0x2071, 0x19b7, 0x7648, 0x2660, 0x2678,
+	0x8cff, 0x0904, 0x9474, 0x6020, 0x9086, 0x0006, 0x1904, 0x946f,
+	0x87ff, 0x0128, 0x2700, 0x9c06, 0x1904, 0x946f, 0x0040, 0x6010,
+	0x9b06, 0x15e8, 0x85ff, 0x0118, 0x605c, 0x9106, 0x15c0, 0x704c,
+	0x9c06, 0x1168, 0x0036, 0x2019, 0x0001, 0x080c, 0x9269, 0x703f,
+	0x0000, 0x9006, 0x704e, 0x706a, 0x7052, 0x706e, 0x003e, 0x7048,
+	0x9c36, 0x1110, 0x660c, 0x764a, 0x7044, 0x9c36, 0x1140, 0x2c00,
+	0x9f36, 0x0118, 0x2f00, 0x7046, 0x0010, 0x7047, 0x0000, 0x660c,
+	0x0066, 0x2c00, 0x9f06, 0x0110, 0x7e0e, 0x0008, 0x2678, 0x600f,
+	0x0000, 0x6014, 0x2048, 0x080c, 0xb840, 0x0110, 0x080c, 0xd22f,
+	0x080c, 0x9c14, 0x87ff, 0x1198, 0x00ce, 0x0804, 0x9420, 0x2c78,
+	0x600c, 0x2060, 0x0804, 0x9420, 0x9006, 0x012e, 0x000e, 0x002e,
+	0x006e, 0x00ce, 0x009e, 0x00de, 0x00ee, 0x00fe, 0x0005, 0x601b,
+	0x0000, 0x00ce, 0x97bd, 0x0001, 0x0c80, 0x00e6, 0x2071, 0x19b7,
+	0x9006, 0x7032, 0x700a, 0x7004, 0x9086, 0x0003, 0x0158, 0x2001,
+	0x1800, 0x2004, 0x9086, 0x0002, 0x1118, 0x7007, 0x0005, 0x0010,
+	0x7007, 0x0000, 0x00ee, 0x0005, 0x00f6, 0x00e6, 0x00c6, 0x0066,
+	0x0026, 0x0006, 0x0126, 0x2091, 0x8000, 0x2071, 0x19b7, 0x2c10,
+	0x7648, 0x2660, 0x2678, 0x8cff, 0x0540, 0x2200, 0x9c06, 0x1508,
+	0x7048, 0x9c36, 0x1110, 0x660c, 0x764a, 0x7044, 0x9c36, 0x1140,
+	0x2c00, 0x9f36, 0x0118, 0x2f00, 0x7046, 0x0010, 0x7047, 0x0000,
+	0x660c, 0x2c00, 0x9f06, 0x0110, 0x7e0e, 0x0008, 0x2678, 0x600f,
+	0x0000, 0x6004, 0x9086, 0x0040, 0x090c, 0x885d, 0x9085, 0x0001,
+	0x0020, 0x2c78, 0x600c, 0x2060, 0x08b0, 0x012e, 0x000e, 0x002e,
+	0x006e, 0x00ce, 0x00ee, 0x00fe, 0x0005, 0x0096, 0x00f6, 0x00e6,
+	0x00d6, 0x00c6, 0x0066, 0x0026, 0x0006, 0x0126, 0x2091, 0x8000,
+	0x2071, 0x19b7, 0x7610, 0x2660, 0x2678, 0x8cff, 0x0904, 0x9572,
+	0x6010, 0x00b6, 0x2058, 0xb8a0, 0x00be, 0x9206, 0x1904, 0x956d,
 	0x7030, 0x9c06, 0x1520, 0x2069, 0x0100, 0x68c0, 0x9005, 0x0904,
-	0x987c, 0x080c, 0x8fb7, 0x68c3, 0x0000, 0x080c, 0x94a2, 0x7033,
+	0x9544, 0x080c, 0x8f9c, 0x68c3, 0x0000, 0x080c, 0x9485, 0x7033,
 	0x0000, 0x0036, 0x2069, 0x0140, 0x6b04, 0x9384, 0x1000, 0x0138,
-	0x2001, 0x0100, 0x080c, 0x2833, 0x9006, 0x080c, 0x2833, 0x2069,
+	0x2001, 0x0100, 0x080c, 0x2852, 0x9006, 0x080c, 0x2852, 0x2069,
 	0x0100, 0x6824, 0xd084, 0x0110, 0x6827, 0x0001, 0x003e, 0x7010,
 	0x9c36, 0x1110, 0x660c, 0x7612, 0x700c, 0x9c36, 0x1140, 0x2c00,
 	0x9f36, 0x0118, 0x2f00, 0x700e, 0x0010, 0x700f, 0x0000, 0x660c,
 	0x0066, 0x2c00, 0x9f06, 0x0110, 0x7e0e, 0x0008, 0x2678, 0x600f,
-	0x0000, 0x080c, 0xba4b, 0x1158, 0x080c, 0x303b, 0x080c, 0xba5c,
-	0x11f0, 0x080c, 0xa58f, 0x00d8, 0x080c, 0x94a2, 0x08c0, 0x080c,
-	0xba5c, 0x1118, 0x080c, 0xa58f, 0x0090, 0x6014, 0x2048, 0x080c,
-	0xb845, 0x0168, 0x6020, 0x9086, 0x0003, 0x1520, 0xa867, 0x0103,
-	0xab7a, 0xa877, 0x0000, 0x080c, 0x6996, 0x080c, 0xba36, 0x080c,
-	0xbcd3, 0x080c, 0x9c21, 0x080c, 0x9378, 0x00ce, 0x0804, 0x982d,
-	0x2c78, 0x600c, 0x2060, 0x0804, 0x982d, 0x7013, 0x0000, 0x700f,
-	0x0000, 0x012e, 0x006e, 0x009e, 0x00ae, 0x00ce, 0x00de, 0x00ee,
-	0x00fe, 0x0005, 0x6020, 0x9086, 0x0006, 0x1d08, 0x080c, 0xd21e,
-	0x08f0, 0x00f6, 0x0036, 0x2079, 0x0380, 0x7b18, 0xd3bc, 0x1de8,
-	0x7832, 0x7936, 0x7a3a, 0x781b, 0x8080, 0x003e, 0x00fe, 0x0005,
-	0x0016, 0x2001, 0x0382, 0x2004, 0x9084, 0x0007, 0x9086, 0x0001,
-	0x1188, 0x2001, 0x0015, 0x0c29, 0x2009, 0x1000, 0x2001, 0x0382,
-	0x2004, 0x9084, 0x0007, 0x9086, 0x0003, 0x0120, 0x8109, 0x1db0,
-	0x080c, 0x0d65, 0x001e, 0x0005, 0x2001, 0x0382, 0x2004, 0x9084,
-	0x0007, 0x9086, 0x0003, 0x1120, 0x2001, 0x0380, 0x2003, 0x0001,
-	0x0005, 0x0156, 0x0016, 0x0026, 0x00e6, 0x900e, 0x2071, 0x19b8,
-	0x0469, 0x0106, 0x0190, 0x7004, 0x9086, 0x0003, 0x0148, 0x20a9,
-	0x1000, 0x6044, 0xd0fc, 0x01d8, 0x1f04, 0x9901, 0x080c, 0x0d65,
-	0x080c, 0x98c8, 0x6044, 0xd0fc, 0x0190, 0x7030, 0x9c06, 0x1148,
-	0x080c, 0x8874, 0x6044, 0xd0dc, 0x0150, 0xc0dc, 0x6046, 0x700a,
-	0x7042, 0x704c, 0x9c06, 0x190c, 0x0d65, 0x080c, 0x88d1, 0x010e,
-	0x1919, 0x00ee, 0x002e, 0x001e, 0x015e, 0x0005, 0x2001, 0x0382,
-	0x2004, 0x9084, 0x0007, 0x9086, 0x0003, 0x0005, 0x0126, 0x2091,
-	0x2400, 0x7808, 0xd0a4, 0x190c, 0x0d5e, 0xd09c, 0x0128, 0x7820,
-	0x908c, 0xf000, 0x11b8, 0x0012, 0x012e, 0x0005, 0x994e, 0x998c,
-	0x99b3, 0x99e3, 0x99f3, 0x9a04, 0x9a13, 0x9a21, 0x9a32, 0x9a36,
-	0x994e, 0x994e, 0x994e, 0x994e, 0x994e, 0x994e, 0x080c, 0x0d65,
-	0x012e, 0x0005, 0x2060, 0x6044, 0xd0bc, 0x0140, 0xc0bc, 0x6046,
-	0x6000, 0x908a, 0x0016, 0x1a0c, 0x0d65, 0x0012, 0x012e, 0x0005,
-	0x9973, 0x9975, 0x9973, 0x997b, 0x9973, 0x9973, 0x9973, 0x9973,
-	0x9973, 0x9975, 0x9973, 0x9975, 0x9973, 0x9975, 0x9973, 0x9973,
-	0x9973, 0x9975, 0x9973, 0x080c, 0x0d65, 0x2009, 0x0013, 0x080c,
-	0x9c85, 0x012e, 0x0005, 0x6014, 0x2048, 0xa87c, 0xd0dc, 0x0130,
-	0x080c, 0x83c0, 0x080c, 0x9be7, 0x012e, 0x0005, 0x2009, 0x0049,
-	0x080c, 0x9c85, 0x012e, 0x0005, 0x080c, 0x98c8, 0x2001, 0x19dd,
-	0x2003, 0x0000, 0x7030, 0x9065, 0x090c, 0x0d65, 0x7034, 0x9092,
-	0x00c8, 0x1258, 0x8000, 0x7036, 0x7004, 0x9086, 0x0003, 0x0110,
-	0x7007, 0x0000, 0x781f, 0x0808, 0x0040, 0x080c, 0xd610, 0x6003,
-	0x0001, 0x2009, 0x0014, 0x080c, 0x9c85, 0x781f, 0x0100, 0x080c,
-	0x98e4, 0x012e, 0x0005, 0x080c, 0x98c8, 0x714c, 0x81ff, 0x1128,
-	0x2011, 0x19e0, 0x2013, 0x0000, 0x0400, 0x2061, 0x0100, 0x7150,
-	0x9192, 0x7530, 0x12b8, 0x8108, 0x7152, 0x714c, 0x9188, 0x0008,
-	0x210c, 0x918e, 0x0006, 0x1138, 0x6014, 0x9084, 0x1984, 0x9085,
-	0x0012, 0x6016, 0x0050, 0x6014, 0x9084, 0x1984, 0x9085, 0x0016,
-	0x6016, 0x0018, 0x706c, 0xc085, 0x706e, 0x781f, 0x0200, 0x080c,
-	0x98e4, 0x012e, 0x0005, 0x080c, 0x98c8, 0x714c, 0x2160, 0x6003,
-	0x0003, 0x2009, 0x004a, 0x080c, 0x9c85, 0x781f, 0x0200, 0x080c,
-	0x98e4, 0x012e, 0x0005, 0x7808, 0xd09c, 0x0de8, 0x7820, 0x2060,
-	0x6003, 0x0003, 0x080c, 0x98c8, 0x080c, 0x1c02, 0x781f, 0x0400,
-	0x080c, 0x98e4, 0x012e, 0x0005, 0x7808, 0xd09c, 0x0de8, 0x7820,
-	0x2060, 0x080c, 0x98c8, 0x080c, 0x1c4a, 0x781f, 0x0400, 0x080c,
-	0x98e4, 0x012e, 0x0005, 0x7030, 0x9065, 0x0148, 0x6044, 0xc0bc,
-	0x6046, 0x7104, 0x9186, 0x0003, 0x0110, 0x080c, 0x8937, 0x012e,
-	0x0005, 0x00f6, 0x703c, 0x9086, 0x0002, 0x0148, 0x704c, 0x907d,
-	0x0130, 0x7844, 0xc0bc, 0x7846, 0x080c, 0x8ee1, 0x0000, 0x00fe,
-	0x012e, 0x0005, 0x080c, 0x7158, 0x012e, 0x0005, 0x080c, 0x0d65,
-	0x0005, 0x00e6, 0x2071, 0x19b8, 0x6044, 0xc0bc, 0x6046, 0xd0fc,
-	0x01b8, 0x704c, 0x9c06, 0x1190, 0x2019, 0x0001, 0x080c, 0x9286,
-	0x704f, 0x0000, 0x2001, 0x0109, 0x2004, 0xd08c, 0x1138, 0x2001,
-	0x0108, 0x2004, 0xd0bc, 0x1110, 0x703f, 0x0000, 0x080c, 0x94b8,
-	0x00ee, 0x0005, 0x0026, 0x7010, 0x9c06, 0x1178, 0x080c, 0x9378,
-	0x6044, 0xc0fc, 0x6046, 0x600c, 0x9015, 0x0120, 0x7212, 0x600f,
-	0x0000, 0x0010, 0x7212, 0x720e, 0x9006, 0x002e, 0x0005, 0x0026,
-	0x7020, 0x9c06, 0x1178, 0x080c, 0x9378, 0x6044, 0xc0fc, 0x6046,
-	0x600c, 0x9015, 0x0120, 0x7222, 0x600f, 0x0000, 0x0010, 0x7222,
-	0x721e, 0x9006, 0x002e, 0x0005, 0x00d6, 0x0036, 0x7830, 0x9c06,
-	0x1558, 0x2069, 0x0100, 0x68c0, 0x9005, 0x01f8, 0x080c, 0x820b,
-	0x080c, 0x8fb7, 0x68c3, 0x0000, 0x080c, 0x94a2, 0x2069, 0x0140,
-	0x6b04, 0x9384, 0x1000, 0x0138, 0x2001, 0x0100, 0x080c, 0x2833,
-	0x9006, 0x080c, 0x2833, 0x2069, 0x0100, 0x6824, 0xd084, 0x0110,
-	0x6827, 0x0001, 0x9085, 0x0001, 0x0038, 0x7808, 0xc0ad, 0x780a,
-	0x6003, 0x0009, 0x630a, 0x9006, 0x003e, 0x00de, 0x0005, 0x0016,
-	0x0026, 0x0036, 0x6100, 0x2019, 0x0100, 0x2001, 0x0382, 0x2004,
-	0xd09c, 0x0190, 0x00c6, 0x0126, 0x2091, 0x2800, 0x0016, 0x0036,
-	0x080c, 0x992e, 0x003e, 0x001e, 0x012e, 0x00ce, 0x6200, 0x2200,
-	0x9106, 0x0d58, 0x2200, 0x0010, 0x8319, 0x1d38, 0x003e, 0x002e,
-	0x001e, 0x0005, 0x00d6, 0x0156, 0x080c, 0x8d6b, 0x7a14, 0x82ff,
-	0x0138, 0x7003, 0x0100, 0x700b, 0x0003, 0x60c3, 0x0008, 0x0490,
-	0x7003, 0x0200, 0x7007, 0x0000, 0x2069, 0x1800, 0x901e, 0x6800,
-	0x9086, 0x0004, 0x1110, 0xc38d, 0x0060, 0x080c, 0x70b7, 0x1110,
-	0xc3ad, 0x0008, 0xc3a5, 0x6ad8, 0xd29c, 0x1110, 0xd2ac, 0x0108,
-	0xc39d, 0x730e, 0x2011, 0x1848, 0x63f0, 0x2312, 0x20a9, 0x0006,
-	0x2011, 0x1840, 0x2019, 0x1841, 0x2071, 0x0250, 0x2376, 0x8e70,
-	0x2276, 0x8e70, 0x9398, 0x0002, 0x9290, 0x0002, 0x1f04, 0x9b0e,
-	0x60c3, 0x0020, 0x080c, 0x8f87, 0x015e, 0x00de, 0x0005, 0x0156,
-	0x080c, 0x8d6b, 0x7a14, 0x82ff, 0x0168, 0x9286, 0xffff, 0x0118,
-	0x9282, 0x000e, 0x1238, 0x7003, 0x0100, 0x700b, 0x0003, 0x60c3,
-	0x0008, 0x0488, 0x7003, 0x0200, 0x7007, 0x001c, 0x700f, 0x0001,
-	0x2011, 0x198e, 0x2204, 0x8007, 0x701a, 0x8210, 0x2204, 0x8007,
-	0x701e, 0x0421, 0x1120, 0xb8a0, 0x9082, 0x007f, 0x0248, 0x2001,
-	0x181e, 0x2004, 0x7022, 0x2001, 0x181f, 0x2004, 0x7026, 0x0030,
-	0x2001, 0x1817, 0x2004, 0x9084, 0x00ff, 0x7026, 0x20a9, 0x0004,
-	0x20e1, 0x0001, 0x2099, 0x1805, 0x20e9, 0x0000, 0x20a1, 0x0256,
-	0x4003, 0x60c3, 0x001c, 0x015e, 0x0804, 0x8f87, 0x0006, 0x2001,
-	0x1836, 0x2004, 0xd0ac, 0x000e, 0x0005, 0x2011, 0x0003, 0x080c,
-	0x9339, 0x2011, 0x0002, 0x080c, 0x9343, 0x080c, 0x9206, 0x0036,
-	0x901e, 0x080c, 0x9286, 0x003e, 0x0005, 0x2071, 0x1883, 0x7000,
-	0x9005, 0x0140, 0x2001, 0x0812, 0x2071, 0x1800, 0x7072, 0x7076,
-	0x7067, 0xffd4, 0x2071, 0x1800, 0x7070, 0x7052, 0x7057, 0x1ddc,
+	0x0000, 0x080c, 0xba46, 0x1180, 0x080c, 0x303d, 0x080c, 0xba57,
+	0x1518, 0x080c, 0xa581, 0x0400, 0x080c, 0x9485, 0x6824, 0xd084,
+	0x09b0, 0x6827, 0x0001, 0x0898, 0x080c, 0xba57, 0x1118, 0x080c,
+	0xa581, 0x0090, 0x6014, 0x2048, 0x080c, 0xb840, 0x0168, 0x6020,
+	0x9086, 0x0003, 0x1508, 0xa867, 0x0103, 0xab7a, 0xa877, 0x0000,
+	0x080c, 0x6985, 0x080c, 0xba31, 0x080c, 0xbcd3, 0x080c, 0x9c14,
+	0x080c, 0x935b, 0x00ce, 0x0804, 0x94ed, 0x2c78, 0x600c, 0x2060,
+	0x0804, 0x94ed, 0x012e, 0x000e, 0x002e, 0x006e, 0x00ce, 0x00de,
+	0x00ee, 0x00fe, 0x009e, 0x0005, 0x6020, 0x9086, 0x0006, 0x1d20,
+	0x080c, 0xd22f, 0x0c08, 0x00d6, 0x080c, 0x8d50, 0x7003, 0x0200,
+	0x7007, 0x0014, 0x60c3, 0x0014, 0x20e1, 0x0001, 0x2099, 0x1959,
+	0x20e9, 0x0000, 0x20a1, 0x0250, 0x20a9, 0x0004, 0x4003, 0x7023,
+	0x0004, 0x7027, 0x7878, 0x080c, 0x8f6c, 0x00de, 0x0005, 0x080c,
+	0x8d50, 0x700b, 0x0800, 0x7814, 0x9084, 0xff00, 0x700e, 0x7814,
+	0x9084, 0x00ff, 0x7022, 0x782c, 0x7026, 0x7860, 0x9084, 0x00ff,
+	0x9085, 0x0200, 0x7002, 0x7860, 0x9084, 0xff00, 0x8007, 0x7006,
+	0x60c2, 0x0804, 0x8f6c, 0x00b6, 0x00d6, 0x0016, 0x00d6, 0x2f68,
+	0x2009, 0x0035, 0x080c, 0xbed9, 0x00de, 0x1904, 0x9620, 0x080c,
+	0x8d05, 0x7003, 0x1300, 0x782c, 0x080c, 0x972b, 0x2068, 0x6820,
+	0x9086, 0x0003, 0x0560, 0x7810, 0x2058, 0xbaa0, 0x080c, 0x9b59,
+	0x11d8, 0x9286, 0x007e, 0x1128, 0x700b, 0x00ff, 0x700f, 0xfffe,
+	0x0498, 0x9286, 0x007f, 0x1128, 0x700b, 0x00ff, 0x700f, 0xfffd,
+	0x0458, 0x9284, 0xff80, 0x0180, 0x9286, 0x0080, 0x1128, 0x700b,
+	0x00ff, 0x700f, 0xfffc, 0x0400, 0x92d8, 0x1000, 0x2b5c, 0xb810,
+	0x700a, 0xb814, 0x700e, 0x00c0, 0xb884, 0x700e, 0x00a8, 0x080c,
+	0x9b59, 0x1130, 0x7810, 0x2058, 0xb8a0, 0x9082, 0x007e, 0x0250,
+	0x00d6, 0x2069, 0x181e, 0x2d04, 0x700a, 0x8d68, 0x2d04, 0x700e,
+	0x00de, 0x0010, 0x6034, 0x700e, 0x7838, 0x7012, 0x783c, 0x7016,
+	0x60c3, 0x000c, 0x001e, 0x00de, 0x080c, 0x8f6c, 0x00be, 0x0005,
+	0x781b, 0x0001, 0x7803, 0x0006, 0x001e, 0x00de, 0x00be, 0x0005,
+	0x792c, 0x9180, 0x0008, 0x200c, 0x9186, 0x0006, 0x01c0, 0x9186,
+	0x0003, 0x0904, 0x969e, 0x9186, 0x0005, 0x0904, 0x9686, 0x9186,
+	0x0004, 0x05f0, 0x9186, 0x0008, 0x0904, 0x968f, 0x7807, 0x0037,
+	0x782f, 0x0003, 0x7817, 0x1700, 0x080c, 0x9708, 0x0005, 0x080c,
+	0x96c9, 0x00d6, 0x0026, 0x792c, 0x2168, 0x2009, 0x4000, 0x6800,
+	0x6a44, 0xd2fc, 0x11f8, 0x0002, 0x9667, 0x9672, 0x9669, 0x9672,
+	0x966e, 0x9667, 0x9667, 0x9672, 0x9672, 0x9672, 0x9672, 0x9667,
+	0x9667, 0x9667, 0x9667, 0x9667, 0x9672, 0x9667, 0x9672, 0x080c,
+	0x0d65, 0x6824, 0xd0e4, 0x0110, 0xd0cc, 0x0110, 0x900e, 0x0010,
+	0x2009, 0x2000, 0x682c, 0x7022, 0x6830, 0x7026, 0x0804, 0x96c2,
+	0x080c, 0x96c9, 0x00d6, 0x0026, 0x792c, 0x2168, 0x2009, 0x4000,
+	0x6a00, 0x9286, 0x0002, 0x1108, 0x900e, 0x04e0, 0x080c, 0x96c9,
+	0x00d6, 0x0026, 0x792c, 0x2168, 0x2009, 0x4000, 0x0498, 0x04c9,
+	0x00d6, 0x0026, 0x792c, 0x2168, 0x2009, 0x4000, 0x9286, 0x0005,
+	0x0118, 0x9286, 0x0002, 0x1108, 0x900e, 0x0420, 0x0451, 0x00d6,
+	0x0026, 0x792c, 0x2168, 0x6814, 0x0096, 0x2048, 0xa9ac, 0xa834,
+	0x9112, 0xa9b0, 0xa838, 0x009e, 0x9103, 0x7022, 0x7226, 0x792c,
+	0x9180, 0x0011, 0x2004, 0xd0fc, 0x1148, 0x9180, 0x0000, 0x2004,
+	0x908e, 0x0002, 0x0130, 0x908e, 0x0004, 0x0118, 0x2009, 0x4000,
+	0x0008, 0x900e, 0x712a, 0x60c3, 0x0018, 0x002e, 0x00de, 0x0804,
+	0x8f6c, 0x00b6, 0x0036, 0x0046, 0x0056, 0x0066, 0x080c, 0x8d50,
+	0x9006, 0x7003, 0x0200, 0x7938, 0x710a, 0x793c, 0x710e, 0x7810,
+	0x2058, 0xb8a0, 0x080c, 0x9b59, 0x1118, 0x9092, 0x007e, 0x0268,
+	0x00d6, 0x2069, 0x181e, 0x2d2c, 0x8d68, 0x2d34, 0x90d8, 0x1000,
+	0x2b5c, 0xbb10, 0xbc14, 0x00de, 0x0028, 0x901e, 0xbc84, 0x2029,
+	0x0000, 0x6634, 0x782c, 0x9080, 0x0008, 0x2004, 0x9086, 0x0003,
+	0x1128, 0x7512, 0x7616, 0x731a, 0x741e, 0x0020, 0x7312, 0x7416,
+	0x751a, 0x761e, 0x006e, 0x005e, 0x004e, 0x003e, 0x00be, 0x0005,
+	0x080c, 0x8d50, 0x7003, 0x0100, 0x782c, 0x700a, 0x7814, 0x700e,
+	0x700e, 0x60c3, 0x0008, 0x0804, 0x8f6c, 0x080c, 0x8cfc, 0x7003,
+	0x1400, 0x7838, 0x700a, 0x0079, 0x783c, 0x700e, 0x782c, 0x7012,
+	0x7830, 0x7016, 0x7834, 0x9084, 0x00ff, 0x8007, 0x701a, 0x60c3,
+	0x0010, 0x0804, 0x8f6c, 0x00e6, 0x2071, 0x0240, 0x0006, 0x00f6,
+	0x2078, 0x7810, 0x00b6, 0x2058, 0xb8c4, 0xd084, 0x0120, 0x7850,
+	0x702a, 0x784c, 0x702e, 0x00be, 0x00fe, 0x000e, 0x00ee, 0x0005,
+	0x080c, 0x8d47, 0x7003, 0x0100, 0x782c, 0x700a, 0x7814, 0x700e,
+	0x60c3, 0x0008, 0x0804, 0x8f6c, 0x00a9, 0x7914, 0x712a, 0x60c3,
+	0x0000, 0x60a7, 0x9575, 0x0026, 0x080c, 0x27c1, 0x0228, 0x2011,
+	0x0101, 0x2204, 0xc0c5, 0x2012, 0x002e, 0x080c, 0x8f8f, 0x080c,
+	0x81e1, 0x0005, 0x0036, 0x0096, 0x00d6, 0x00e6, 0x7860, 0x2048,
+	0xaa7c, 0x9296, 0x00c0, 0x9294, 0xfffd, 0xaa7e, 0xaa80, 0x9294,
+	0x0300, 0xaa82, 0xa96c, 0x9194, 0x00ff, 0xab74, 0x9384, 0x00ff,
+	0x908d, 0xc200, 0xa96e, 0x9384, 0xff00, 0x9215, 0xaa76, 0xa870,
+	0xaa78, 0xa87a, 0xaa72, 0x00d6, 0x2069, 0x0200, 0x080c, 0x97e8,
+	0x00de, 0x20e9, 0x0000, 0x20a1, 0x0240, 0x20a9, 0x000a, 0xa860,
+	0x20e0, 0xa85c, 0x9080, 0x001b, 0x2098, 0x4003, 0x60a3, 0x0035,
+	0xaa68, 0x9294, 0x7000, 0x9286, 0x3000, 0x0110, 0x60a3, 0x0037,
+	0x00ee, 0x00de, 0x009e, 0x003e, 0x0005, 0x900e, 0x7814, 0x0096,
+	0x2048, 0xa87c, 0xd0fc, 0x01c0, 0x9084, 0x0003, 0x11a8, 0x2001,
+	0x180c, 0x2004, 0xd0bc, 0x0180, 0x7824, 0xd0cc, 0x1168, 0xd0c4,
+	0x1158, 0xa8a8, 0x9005, 0x1140, 0x2001, 0x180c, 0x200c, 0xc1d5,
+	0x2102, 0x2009, 0x1982, 0x210c, 0x009e, 0x918d, 0x0092, 0x0010,
+	0x2009, 0x0096, 0x60ab, 0x0036, 0x0026, 0x2110, 0x900e, 0x080c,
+	0x289b, 0x002e, 0x0005, 0x2009, 0x0009, 0x00a0, 0x2009, 0x000a,
+	0x0088, 0x2009, 0x000b, 0x0070, 0x2009, 0x000c, 0x0058, 0x2009,
+	0x000d, 0x0040, 0x2009, 0x000e, 0x0028, 0x2009, 0x000f, 0x0010,
+	0x2009, 0x0008, 0x6912, 0x0005, 0x00d6, 0x9290, 0x0018, 0x8214,
+	0x20e9, 0x0000, 0x2069, 0x0200, 0x6813, 0x0000, 0x22a8, 0x9284,
+	0x00e0, 0x0128, 0x20a9, 0x0020, 0x9292, 0x0020, 0x0008, 0x9016,
+	0x20a1, 0x0240, 0x9006, 0x4004, 0x82ff, 0x0120, 0x6810, 0x8000,
+	0x6812, 0x0c60, 0x00de, 0x0005, 0x00f6, 0x00e6, 0x00d6, 0x00c6,
+	0x00a6, 0x0096, 0x0066, 0x0126, 0x2091, 0x8000, 0x2071, 0x19b7,
+	0x7610, 0x2660, 0x2678, 0x8cff, 0x0904, 0x9898, 0x7030, 0x9c06,
+	0x1520, 0x2069, 0x0100, 0x68c0, 0x9005, 0x0904, 0x986a, 0x080c,
+	0x8f9c, 0x68c3, 0x0000, 0x080c, 0x9485, 0x7033, 0x0000, 0x0036,
+	0x2069, 0x0140, 0x6b04, 0x9384, 0x1000, 0x0138, 0x2001, 0x0100,
+	0x080c, 0x2852, 0x9006, 0x080c, 0x2852, 0x2069, 0x0100, 0x6824,
+	0xd084, 0x0110, 0x6827, 0x0001, 0x003e, 0x7010, 0x9c36, 0x1110,
+	0x660c, 0x7612, 0x700c, 0x9c36, 0x1140, 0x2c00, 0x9f36, 0x0118,
+	0x2f00, 0x700e, 0x0010, 0x700f, 0x0000, 0x660c, 0x0066, 0x2c00,
+	0x9f06, 0x0110, 0x7e0e, 0x0008, 0x2678, 0x600f, 0x0000, 0x080c,
+	0xba46, 0x1180, 0x080c, 0x303d, 0x080c, 0xba57, 0x1518, 0x080c,
+	0xa581, 0x0400, 0x080c, 0x9485, 0x6824, 0xd084, 0x09b0, 0x6827,
+	0x0001, 0x0898, 0x080c, 0xba57, 0x1118, 0x080c, 0xa581, 0x0090,
+	0x6014, 0x2048, 0x080c, 0xb840, 0x0168, 0x6020, 0x9086, 0x0003,
+	0x1520, 0xa867, 0x0103, 0xab7a, 0xa877, 0x0000, 0x080c, 0x6991,
+	0x080c, 0xba31, 0x080c, 0xbcd3, 0x080c, 0x9c14, 0x080c, 0x935b,
+	0x00ce, 0x0804, 0x981b, 0x2c78, 0x600c, 0x2060, 0x0804, 0x981b,
+	0x7013, 0x0000, 0x700f, 0x0000, 0x012e, 0x006e, 0x009e, 0x00ae,
+	0x00ce, 0x00de, 0x00ee, 0x00fe, 0x0005, 0x6020, 0x9086, 0x0006,
+	0x1d08, 0x080c, 0xd22f, 0x08f0, 0x00f6, 0x0036, 0x2079, 0x0380,
+	0x7b18, 0xd3bc, 0x1de8, 0x7832, 0x7936, 0x7a3a, 0x781b, 0x8080,
+	0x003e, 0x00fe, 0x0005, 0x0016, 0x2001, 0x0382, 0x2004, 0x9084,
+	0x0007, 0x9086, 0x0001, 0x1188, 0x2001, 0x0015, 0x0c29, 0x2009,
+	0x1000, 0x2001, 0x0382, 0x2004, 0x9084, 0x0007, 0x9086, 0x0003,
+	0x0120, 0x8109, 0x1db0, 0x080c, 0x0d65, 0x001e, 0x0005, 0x2001,
+	0x0382, 0x2004, 0x9084, 0x0007, 0x9086, 0x0003, 0x1120, 0x2001,
+	0x0380, 0x2003, 0x0001, 0x0005, 0x0156, 0x0016, 0x0026, 0x00e6,
+	0x900e, 0x2071, 0x19b7, 0x0469, 0x0106, 0x0190, 0x7004, 0x9086,
+	0x0003, 0x0148, 0x20a9, 0x1000, 0x6044, 0xd0fc, 0x01d8, 0x1f04,
+	0x98f4, 0x080c, 0x0d65, 0x080c, 0x98bb, 0x6044, 0xd0fc, 0x0190,
+	0x7030, 0x9c06, 0x1148, 0x080c, 0x885d, 0x6044, 0xd0dc, 0x0150,
+	0xc0dc, 0x6046, 0x700a, 0x7042, 0x704c, 0x9c06, 0x190c, 0x0d65,
+	0x080c, 0x88b8, 0x010e, 0x1919, 0x00ee, 0x002e, 0x001e, 0x015e,
+	0x0005, 0x2001, 0x0382, 0x2004, 0x9084, 0x0007, 0x9086, 0x0003,
+	0x0005, 0x0126, 0x2091, 0x2400, 0x7808, 0xd0a4, 0x190c, 0x0d5e,
+	0xd09c, 0x0128, 0x7820, 0x908c, 0xf000, 0x11b8, 0x0012, 0x012e,
+	0x0005, 0x9941, 0x997f, 0x99a6, 0x99d6, 0x99e6, 0x99f7, 0x9a06,
+	0x9a14, 0x9a25, 0x9a29, 0x9941, 0x9941, 0x9941, 0x9941, 0x9941,
+	0x9941, 0x080c, 0x0d65, 0x012e, 0x0005, 0x2060, 0x6044, 0xd0bc,
+	0x0140, 0xc0bc, 0x6046, 0x6000, 0x908a, 0x0016, 0x1a0c, 0x0d65,
+	0x0012, 0x012e, 0x0005, 0x9966, 0x9968, 0x9966, 0x996e, 0x9966,
+	0x9966, 0x9966, 0x9966, 0x9966, 0x9968, 0x9966, 0x9968, 0x9966,
+	0x9968, 0x9966, 0x9966, 0x9966, 0x9968, 0x9966, 0x080c, 0x0d65,
+	0x2009, 0x0013, 0x080c, 0x9c76, 0x012e, 0x0005, 0x6014, 0x2048,
+	0xa87c, 0xd0dc, 0x0130, 0x080c, 0x83a2, 0x080c, 0x9bda, 0x012e,
+	0x0005, 0x2009, 0x0049, 0x080c, 0x9c76, 0x012e, 0x0005, 0x080c,
+	0x98bb, 0x2001, 0x19dc, 0x2003, 0x0000, 0x7030, 0x9065, 0x090c,
+	0x0d65, 0x7034, 0x9092, 0x00c8, 0x1258, 0x8000, 0x7036, 0x7004,
+	0x9086, 0x0003, 0x0110, 0x7007, 0x0000, 0x781f, 0x0808, 0x0040,
+	0x080c, 0xd621, 0x6003, 0x0001, 0x2009, 0x0014, 0x080c, 0x9c76,
+	0x781f, 0x0100, 0x080c, 0x98d7, 0x012e, 0x0005, 0x080c, 0x98bb,
+	0x714c, 0x81ff, 0x1128, 0x2011, 0x19df, 0x2013, 0x0000, 0x0400,
+	0x2061, 0x0100, 0x7150, 0x9192, 0x7530, 0x12b8, 0x8108, 0x7152,
+	0x714c, 0x9188, 0x0008, 0x210c, 0x918e, 0x0006, 0x1138, 0x6014,
+	0x9084, 0x1984, 0x9085, 0x0012, 0x6016, 0x0050, 0x6014, 0x9084,
+	0x1984, 0x9085, 0x0016, 0x6016, 0x0018, 0x706c, 0xc085, 0x706e,
+	0x781f, 0x0200, 0x080c, 0x98d7, 0x012e, 0x0005, 0x080c, 0x98bb,
+	0x714c, 0x2160, 0x6003, 0x0003, 0x2009, 0x004a, 0x080c, 0x9c76,
+	0x781f, 0x0200, 0x080c, 0x98d7, 0x012e, 0x0005, 0x7808, 0xd09c,
+	0x0de8, 0x7820, 0x2060, 0x6003, 0x0003, 0x080c, 0x98bb, 0x080c,
+	0x1c0f, 0x781f, 0x0400, 0x080c, 0x98d7, 0x012e, 0x0005, 0x7808,
+	0xd09c, 0x0de8, 0x7820, 0x2060, 0x080c, 0x98bb, 0x080c, 0x1c57,
+	0x781f, 0x0400, 0x080c, 0x98d7, 0x012e, 0x0005, 0x7030, 0x9065,
+	0x0148, 0x6044, 0xc0bc, 0x6046, 0x7104, 0x9186, 0x0003, 0x0110,
+	0x080c, 0x891c, 0x012e, 0x0005, 0x00f6, 0x703c, 0x9086, 0x0002,
+	0x0148, 0x704c, 0x907d, 0x0130, 0x7844, 0xc0bc, 0x7846, 0x080c,
+	0x8ec6, 0x0000, 0x00fe, 0x012e, 0x0005, 0x080c, 0x7137, 0x012e,
+	0x0005, 0x080c, 0x0d65, 0x0005, 0x00e6, 0x2071, 0x19b7, 0x6044,
+	0xc0bc, 0x6046, 0xd0fc, 0x01b8, 0x704c, 0x9c06, 0x1190, 0x2019,
+	0x0001, 0x080c, 0x9269, 0x704f, 0x0000, 0x2001, 0x0109, 0x2004,
+	0xd08c, 0x1138, 0x2001, 0x0108, 0x2004, 0xd0bc, 0x1110, 0x703f,
+	0x0000, 0x080c, 0x949c, 0x00ee, 0x0005, 0x0026, 0x7010, 0x9c06,
+	0x1178, 0x080c, 0x935b, 0x6044, 0xc0fc, 0x6046, 0x600c, 0x9015,
+	0x0120, 0x7212, 0x600f, 0x0000, 0x0010, 0x7212, 0x720e, 0x9006,
+	0x002e, 0x0005, 0x0026, 0x7020, 0x9c06, 0x1178, 0x080c, 0x935b,
+	0x6044, 0xc0fc, 0x6046, 0x600c, 0x9015, 0x0120, 0x7222, 0x600f,
+	0x0000, 0x0010, 0x7222, 0x721e, 0x9006, 0x002e, 0x0005, 0x00d6,
+	0x0036, 0x7830, 0x9c06, 0x1558, 0x2069, 0x0100, 0x68c0, 0x9005,
+	0x01f8, 0x080c, 0x81ea, 0x080c, 0x8f9c, 0x68c3, 0x0000, 0x080c,
+	0x9485, 0x2069, 0x0140, 0x6b04, 0x9384, 0x1000, 0x0138, 0x2001,
+	0x0100, 0x080c, 0x2852, 0x9006, 0x080c, 0x2852, 0x2069, 0x0100,
+	0x6824, 0xd084, 0x0110, 0x6827, 0x0001, 0x9085, 0x0001, 0x0038,
+	0x7808, 0xc0ad, 0x780a, 0x6003, 0x0009, 0x630a, 0x9006, 0x003e,
+	0x00de, 0x0005, 0x0016, 0x0026, 0x0036, 0x6100, 0x2019, 0x0100,
+	0x2001, 0x0382, 0x2004, 0xd09c, 0x0190, 0x00c6, 0x0126, 0x2091,
+	0x2800, 0x0016, 0x0036, 0x080c, 0x9921, 0x003e, 0x001e, 0x012e,
+	0x00ce, 0x6200, 0x2200, 0x9106, 0x0d58, 0x2200, 0x0010, 0x8319,
+	0x1d38, 0x003e, 0x002e, 0x001e, 0x0005, 0x00d6, 0x0156, 0x080c,
+	0x8d50, 0x7a14, 0x82ff, 0x0138, 0x7003, 0x0100, 0x700b, 0x0003,
+	0x60c3, 0x0008, 0x0490, 0x7003, 0x0200, 0x7007, 0x0000, 0x2069,
+	0x1800, 0x901e, 0x6800, 0x9086, 0x0004, 0x1110, 0xc38d, 0x0060,
+	0x080c, 0x7096, 0x1110, 0xc3ad, 0x0008, 0xc3a5, 0x6ad8, 0xd29c,
+	0x1110, 0xd2ac, 0x0108, 0xc39d, 0x730e, 0x2011, 0x1848, 0x63f0,
+	0x2312, 0x20a9, 0x0006, 0x2011, 0x1840, 0x2019, 0x1841, 0x2071,
+	0x0250, 0x2376, 0x8e70, 0x2276, 0x8e70, 0x9398, 0x0002, 0x9290,
+	0x0002, 0x1f04, 0x9b01, 0x60c3, 0x0020, 0x080c, 0x8f6c, 0x015e,
+	0x00de, 0x0005, 0x0156, 0x080c, 0x8d50, 0x7a14, 0x82ff, 0x0168,
+	0x9286, 0xffff, 0x0118, 0x9282, 0x000e, 0x1238, 0x7003, 0x0100,
+	0x700b, 0x0003, 0x60c3, 0x0008, 0x0488, 0x7003, 0x0200, 0x7007,
+	0x001c, 0x700f, 0x0001, 0x2011, 0x198d, 0x2204, 0x8007, 0x701a,
+	0x8210, 0x2204, 0x8007, 0x701e, 0x0421, 0x1120, 0xb8a0, 0x9082,
+	0x007f, 0x0248, 0x2001, 0x181e, 0x2004, 0x7022, 0x2001, 0x181f,
+	0x2004, 0x7026, 0x0030, 0x2001, 0x1817, 0x2004, 0x9084, 0x00ff,
+	0x7026, 0x20a9, 0x0004, 0x20e1, 0x0001, 0x2099, 0x1805, 0x20e9,
+	0x0000, 0x20a1, 0x0256, 0x4003, 0x60c3, 0x001c, 0x015e, 0x0804,
+	0x8f6c, 0x0006, 0x2001, 0x1836, 0x2004, 0xd0ac, 0x000e, 0x0005,
+	0x2011, 0x0003, 0x080c, 0x931c, 0x2011, 0x0002, 0x080c, 0x9326,
+	0x080c, 0x91e9, 0x0036, 0x901e, 0x080c, 0x9269, 0x003e, 0x0005,
+	0x2071, 0x1883, 0x7000, 0x9005, 0x0140, 0x2001, 0x0812, 0x2071,
+	0x1800, 0x7072, 0x7076, 0x7067, 0xffd4, 0x2071, 0x1800, 0x7070,
+	0x7052, 0x7057, 0x1ddc, 0x0005, 0x00e6, 0x0126, 0x2071, 0x1800,
+	0x2091, 0x8000, 0x7550, 0x9582, 0x0010, 0x0608, 0x7054, 0x2060,
+	0x6000, 0x9086, 0x0000, 0x0148, 0x9ce0, 0x001c, 0x7064, 0x9c02,
+	0x1208, 0x0cb0, 0x2061, 0x1ddc, 0x0c98, 0x6003, 0x0008, 0x8529,
+	0x7552, 0x9ca8, 0x001c, 0x7064, 0x9502, 0x1230, 0x7556, 0x9085,
+	0x0001, 0x012e, 0x00ee, 0x0005, 0x7057, 0x1ddc, 0x0cc0, 0x9006,
+	0x0cc0, 0x00e6, 0x2071, 0x1800, 0x7550, 0x9582, 0x0010, 0x0600,
+	0x7054, 0x2060, 0x6000, 0x9086, 0x0000, 0x0148, 0x9ce0, 0x001c,
+	0x7064, 0x9c02, 0x1208, 0x0cb0, 0x2061, 0x1ddc, 0x0c98, 0x6003,
+	0x0008, 0x8529, 0x7552, 0x9ca8, 0x001c, 0x7064, 0x9502, 0x1228,
+	0x7556, 0x9085, 0x0001, 0x00ee, 0x0005, 0x7057, 0x1ddc, 0x0cc8,
+	0x9006, 0x0cc8, 0x9c82, 0x1ddc, 0x0a0c, 0x0d65, 0x2001, 0x1819,
+	0x2004, 0x9c02, 0x1a0c, 0x0d65, 0x9006, 0x6006, 0x600a, 0x600e,
+	0x6016, 0x601a, 0x6012, 0x6023, 0x0000, 0x6003, 0x0000, 0x601e,
+	0x605e, 0x6062, 0x6026, 0x602a, 0x602e, 0x6032, 0x6036, 0x603a,
+	0x603e, 0x604a, 0x6046, 0x6042, 0x2061, 0x1800, 0x6050, 0x8000,
+	0x6052, 0x0005, 0x9006, 0x600e, 0x6016, 0x601a, 0x6012, 0x6022,
+	0x6002, 0x601e, 0x605e, 0x6062, 0x604a, 0x6046, 0x2061, 0x1800,
+	0x6050, 0x8000, 0x6052, 0x0005, 0x0006, 0x6000, 0x9086, 0x0000,
+	0x01d0, 0x601c, 0xd084, 0x190c, 0x1921, 0x6023, 0x0007, 0x2001,
+	0x1956, 0x2004, 0x0006, 0x9082, 0x0051, 0x000e, 0x0208, 0x8004,
+	0x601a, 0x080c, 0xd4df, 0x604b, 0x0000, 0x6044, 0xd0fc, 0x1129,
+	0x9006, 0x6046, 0x6016, 0x000e, 0x0005, 0x080c, 0x98bb, 0x0106,
+	0x2001, 0x19ca, 0x2004, 0x9c06, 0x1130, 0x0036, 0x2019, 0x0001,
+	0x080c, 0x9269, 0x003e, 0x080c, 0x949c, 0x010e, 0x090c, 0x98d7,
 	0x0005, 0x00e6, 0x0126, 0x2071, 0x1800, 0x2091, 0x8000, 0x7550,
-	0x9582, 0x0010, 0x0608, 0x7054, 0x2060, 0x6000, 0x9086, 0x0000,
+	0x9582, 0x0001, 0x0608, 0x7054, 0x2060, 0x6000, 0x9086, 0x0000,
 	0x0148, 0x9ce0, 0x001c, 0x7064, 0x9c02, 0x1208, 0x0cb0, 0x2061,
 	0x1ddc, 0x0c98, 0x6003, 0x0008, 0x8529, 0x7552, 0x9ca8, 0x001c,
 	0x7064, 0x9502, 0x1230, 0x7556, 0x9085, 0x0001, 0x012e, 0x00ee,
-	0x0005, 0x7057, 0x1ddc, 0x0cc0, 0x9006, 0x0cc0, 0x00e6, 0x2071,
-	0x1800, 0x7550, 0x9582, 0x0010, 0x0600, 0x7054, 0x2060, 0x6000,
-	0x9086, 0x0000, 0x0148, 0x9ce0, 0x001c, 0x7064, 0x9c02, 0x1208,
-	0x0cb0, 0x2061, 0x1ddc, 0x0c98, 0x6003, 0x0008, 0x8529, 0x7552,
-	0x9ca8, 0x001c, 0x7064, 0x9502, 0x1228, 0x7556, 0x9085, 0x0001,
-	0x00ee, 0x0005, 0x7057, 0x1ddc, 0x0cc8, 0x9006, 0x0cc8, 0x9c82,
-	0x1ddc, 0x0a0c, 0x0d65, 0x2001, 0x1819, 0x2004, 0x9c02, 0x1a0c,
-	0x0d65, 0x9006, 0x6006, 0x600a, 0x600e, 0x6016, 0x601a, 0x6012,
-	0x6023, 0x0000, 0x6003, 0x0000, 0x601e, 0x605e, 0x6062, 0x6026,
-	0x602a, 0x602e, 0x6032, 0x6036, 0x603a, 0x603e, 0x604a, 0x6046,
-	0x6042, 0x2061, 0x1800, 0x6050, 0x8000, 0x6052, 0x0005, 0x9006,
-	0x600e, 0x6016, 0x601a, 0x6012, 0x6022, 0x6002, 0x601e, 0x605e,
-	0x6062, 0x604a, 0x6046, 0x2061, 0x1800, 0x6050, 0x8000, 0x6052,
-	0x0005, 0x0006, 0x6000, 0x9086, 0x0000, 0x01d0, 0x601c, 0xd084,
-	0x190c, 0x1914, 0x6023, 0x0007, 0x2001, 0x1957, 0x2004, 0x0006,
-	0x9082, 0x0051, 0x000e, 0x0208, 0x8004, 0x601a, 0x080c, 0xd4ce,
-	0x604b, 0x0000, 0x6044, 0xd0fc, 0x1129, 0x9006, 0x6046, 0x6016,
-	0x000e, 0x0005, 0x080c, 0x9926, 0x0106, 0x190c, 0x98c8, 0x2001,
-	0x19cb, 0x2004, 0x9c06, 0x1130, 0x0036, 0x2019, 0x0001, 0x080c,
-	0x9286, 0x003e, 0x080c, 0x94b8, 0x010e, 0x190c, 0x98e4, 0x0005,
-	0x00e6, 0x0126, 0x2071, 0x1800, 0x2091, 0x8000, 0x7550, 0x9582,
-	0x0001, 0x0608, 0x7054, 0x2060, 0x6000, 0x9086, 0x0000, 0x0148,
-	0x9ce0, 0x001c, 0x7064, 0x9c02, 0x1208, 0x0cb0, 0x2061, 0x1ddc,
-	0x0c98, 0x6003, 0x0008, 0x8529, 0x7552, 0x9ca8, 0x001c, 0x7064,
-	0x9502, 0x1230, 0x7556, 0x9085, 0x0001, 0x012e, 0x00ee, 0x0005,
-	0x7057, 0x1ddc, 0x0cc0, 0x9006, 0x0cc0, 0x6020, 0x9084, 0x000f,
-	0x0002, 0x9c99, 0x9ca3, 0x9cbe, 0x9cd9, 0xbfab, 0xbfc8, 0xbfe3,
-	0x9c99, 0x9ca3, 0x9c99, 0x9cf5, 0x9c99, 0x9c99, 0x9c99, 0x9c99,
-	0x9c99, 0x9186, 0x0013, 0x1130, 0x6044, 0xd0fc, 0x0110, 0x080c,
-	0x8874, 0x0005, 0x0005, 0x0066, 0x6000, 0x90b2, 0x0016, 0x1a0c,
-	0x0d65, 0x0013, 0x006e, 0x0005, 0x9cbc, 0xa404, 0xa5d6, 0x9cbc,
-	0xa664, 0x9fbe, 0x9cbc, 0x9cbc, 0xa386, 0xac09, 0x9cbc, 0x9cbc,
-	0x9cbc, 0x9cbc, 0x9cbc, 0x9cbc, 0x080c, 0x0d65, 0x0066, 0x6000,
-	0x90b2, 0x0016, 0x1a0c, 0x0d65, 0x0013, 0x006e, 0x0005, 0x9cd7,
-	0xb214, 0x9cd7, 0x9cd7, 0x9cd7, 0x9cd7, 0x9cd7, 0x9cd7, 0xb1b9,
-	0xb397, 0x9cd7, 0xb251, 0xb2d5, 0xb251, 0xb2d5, 0x9cd7, 0x080c,
-	0x0d65, 0x6000, 0x9082, 0x0016, 0x1a0c, 0x0d65, 0x6000, 0x0002,
-	0x9cf3, 0xac53, 0xacea, 0xae6a, 0xaed9, 0x9cf3, 0x9cf3, 0x9cf3,
-	0xac22, 0xb13a, 0xb13d, 0x9cf3, 0x9cf3, 0x9cf3, 0x9cf3, 0xb16d,
-	0x9cf3, 0x9cf3, 0x9cf3, 0x080c, 0x0d65, 0x0066, 0x6000, 0x90b2,
-	0x0016, 0x1a0c, 0x0d65, 0x0013, 0x006e, 0x0005, 0x9d0e, 0x9d0e,
-	0x9d4c, 0x9deb, 0x9e6b, 0x9d0e, 0x9d0e, 0x9d0e, 0x9d10, 0x9d0e,
-	0x9d0e, 0x9d0e, 0x9d0e, 0x9d0e, 0x9d0e, 0x9d0e, 0x080c, 0x0d65,
-	0x9186, 0x004c, 0x0560, 0x9186, 0x0003, 0x190c, 0x0d65, 0x0096,
-	0x601c, 0xc0ed, 0x601e, 0x6003, 0x0003, 0x6106, 0x6014, 0x2048,
-	0xa87c, 0x9084, 0xa000, 0xc0b5, 0xa87e, 0xa8ac, 0xa836, 0xa8b0,
-	0xa83a, 0x9006, 0xa846, 0xa84a, 0xa884, 0x9092, 0x199a, 0x0210,
-	0x2001, 0x1999, 0x8003, 0x8013, 0x8213, 0x9210, 0x621a, 0x009e,
-	0x080c, 0x1a64, 0x2009, 0x8030, 0x080c, 0x8518, 0x0005, 0x6010,
-	0x00b6, 0x2058, 0xbca0, 0x00be, 0x2c00, 0x080c, 0x9e8d, 0x080c,
-	0xbf79, 0x6003, 0x0007, 0x0005, 0x00d6, 0x0096, 0x00f6, 0x2079,
-	0x1800, 0x7a8c, 0x6014, 0x2048, 0xa87c, 0xd0ec, 0x1110, 0x9290,
-	0x0018, 0xac78, 0xc4fc, 0x0046, 0xa8e0, 0x9005, 0x1140, 0xa8dc,
-	0x921a, 0x0140, 0x0220, 0xa87b, 0x0007, 0x2010, 0x0028, 0xa87b,
-	0x0015, 0x0010, 0xa87b, 0x0000, 0x8214, 0xa883, 0x0000, 0xaa02,
-	0x0006, 0x0016, 0x0026, 0x00c6, 0x00d6, 0x00e6, 0x00f6, 0x2400,
-	0x9005, 0x1108, 0x009a, 0x2100, 0x9086, 0x0015, 0x1118, 0x2001,
-	0x0001, 0x0038, 0x2100, 0x9086, 0x0016, 0x0118, 0x2001, 0x0001,
-	0x002a, 0x94a4, 0x0007, 0x8423, 0x9405, 0x0002, 0x9db3, 0x9db3,
-	0x9dae, 0x9db1, 0x9db3, 0x9dab, 0x9d9e, 0x9d9e, 0x9d9e, 0x9d9e,
-	0x9d9e, 0x9d9e, 0x9d9e, 0x9d9e, 0x9d9e, 0x9d9e, 0x00fe, 0x00ee,
-	0x00de, 0x00ce, 0x002e, 0x001e, 0x000e, 0x004e, 0x00fe, 0x009e,
-	0x00de, 0x080c, 0x0d65, 0x080c, 0xa845, 0x0028, 0x080c, 0xa968,
-	0x0010, 0x080c, 0xaa57, 0x00fe, 0x00ee, 0x00de, 0x00ce, 0x002e,
-	0x001e, 0x2c00, 0xa896, 0x000e, 0x080c, 0x9f4b, 0x0530, 0xa804,
-	0xa80e, 0x00a6, 0x2050, 0xb100, 0x00ae, 0x8006, 0x8006, 0x8007,
-	0x90bc, 0x003f, 0x9084, 0xffc0, 0x9080, 0x0002, 0xaacc, 0xabd0,
-	0xacd4, 0xadd8, 0x2031, 0x0000, 0x2041, 0x1280, 0x080c, 0xa0f5,
-	0x0160, 0x000e, 0x9005, 0x0120, 0x00fe, 0x009e, 0x00de, 0x0005,
-	0x00fe, 0x009e, 0x00de, 0x0804, 0x9be7, 0x2001, 0x002c, 0x900e,
-	0x080c, 0x9fb1, 0x0c70, 0x91b6, 0x0015, 0x0170, 0x91b6, 0x0016,
-	0x0158, 0x91b2, 0x0047, 0x0a0c, 0x0d65, 0x91b2, 0x0050, 0x1a0c,
-	0x0d65, 0x9182, 0x0047, 0x0042, 0x080c, 0x9ab7, 0x0120, 0x9086,
-	0x0002, 0x0904, 0x9d4c, 0x0005, 0x9e0d, 0x9e0d, 0x9e0f, 0x9e41,
-	0x9e0d, 0x9e0d, 0x9e0d, 0x9e0d, 0x9e54, 0x080c, 0x0d65, 0x00d6,
-	0x0016, 0x0096, 0x6003, 0x0004, 0x6114, 0x2148, 0xa87c, 0xd0fc,
-	0x01c0, 0xa878, 0xc0fc, 0x9005, 0x1158, 0xa894, 0x9005, 0x0140,
-	0x2001, 0x0000, 0x900e, 0x080c, 0x9fb1, 0x080c, 0x9be7, 0x00a8,
-	0x6003, 0x0002, 0xa8a4, 0xa9a8, 0x9105, 0x1178, 0xa8ae, 0xa8b2,
-	0x0c78, 0xa87f, 0x0020, 0xa88c, 0xa88a, 0xa8a4, 0xa8ae, 0xa8a8,
-	0xa8b2, 0xa8c7, 0x0000, 0xa8cb, 0x0000, 0x009e, 0x001e, 0x00de,
-	0x0005, 0x080c, 0x88d1, 0x00d6, 0x0096, 0x6114, 0x2148, 0x080c,
-	0xb847, 0x0120, 0xa87b, 0x0006, 0x080c, 0x6996, 0x009e, 0x00de,
-	0x080c, 0x9be7, 0x0804, 0x8936, 0x080c, 0x88d1, 0x080c, 0x3006,
-	0x080c, 0xbf76, 0x00d6, 0x0096, 0x6114, 0x2148, 0x080c, 0xb847,
-	0x0120, 0xa87b, 0x0029, 0x080c, 0x6996, 0x009e, 0x00de, 0x080c,
-	0x9be7, 0x0804, 0x8936, 0x9182, 0x0047, 0x0002, 0x9e7b, 0x9e7d,
-	0x9e7b, 0x9e7b, 0x9e7b, 0x9e7b, 0x9e7b, 0x9e7b, 0x9e7b, 0x9e7b,
-	0x9e7b, 0x9e7b, 0x9e7d, 0x080c, 0x0d65, 0x00d6, 0x0096, 0x080c,
-	0x1595, 0x6114, 0x2148, 0xa87b, 0x0000, 0xa883, 0x0000, 0x080c,
-	0x6996, 0x009e, 0x00de, 0x0804, 0x9be7, 0x0026, 0x0036, 0x0056,
-	0x0066, 0x0096, 0x00a6, 0x00f6, 0x0006, 0x080c, 0x1022, 0x000e,
-	0x090c, 0x0d65, 0xa960, 0x21e8, 0xa95c, 0x9188, 0x0019, 0x21a0,
-	0x900e, 0x20a9, 0x0020, 0x4104, 0xa87a, 0x2079, 0x1800, 0x798c,
-	0x9188, 0x0018, 0x918c, 0x0fff, 0xa972, 0xac76, 0x2950, 0x00a6,
-	0x2001, 0x0205, 0x2003, 0x0000, 0x901e, 0x2029, 0x0001, 0x9182,
-	0x0034, 0x1228, 0x2011, 0x001f, 0x080c, 0xb41a, 0x04c0, 0x2130,
-	0x2009, 0x0034, 0x2011, 0x001f, 0x080c, 0xb41a, 0x96b2, 0x0034,
-	0xb004, 0x904d, 0x0110, 0x080c, 0x0fd4, 0x080c, 0x1022, 0x01d0,
-	0x8528, 0xa867, 0x0110, 0xa86b, 0x0000, 0x2920, 0xb406, 0x968a,
-	0x003d, 0x1230, 0x2608, 0x2011, 0x001b, 0x080c, 0xb41a, 0x00b8,
-	0x96b2, 0x003c, 0x2009, 0x003c, 0x2950, 0x2011, 0x001b, 0x080c,
-	0xb41a, 0x0c18, 0x2001, 0x0205, 0x2003, 0x0000, 0x00ae, 0x852f,
-	0x95ad, 0x0050, 0xb566, 0xb070, 0xc0fd, 0xb072, 0x0048, 0x2001,
-	0x0205, 0x2003, 0x0000, 0x00ae, 0x852f, 0x95ad, 0x0050, 0xb566,
-	0x2a48, 0xa804, 0xa807, 0x0000, 0x0006, 0x080c, 0x6996, 0x000e,
-	0x2048, 0x9005, 0x1db0, 0x00fe, 0x00ae, 0x009e, 0x006e, 0x005e,
-	0x003e, 0x002e, 0x0005, 0x00d6, 0x00f6, 0x0096, 0x0006, 0x080c,
-	0x1022, 0x000e, 0x090c, 0x0d65, 0xa960, 0x21e8, 0xa95c, 0x9188,
-	0x0019, 0x21a0, 0x900e, 0x20a9, 0x0020, 0x4104, 0xaa66, 0xa87a,
-	0x2079, 0x1800, 0x798c, 0x810c, 0x9188, 0x000c, 0x9182, 0x001a,
-	0x0210, 0x2009, 0x001a, 0x21a8, 0x810b, 0xa972, 0xac76, 0x2e98,
-	0xa85c, 0x9080, 0x001f, 0x20a0, 0x2001, 0x0205, 0x200c, 0x918d,
-	0x0080, 0x2102, 0x4003, 0x2003, 0x0000, 0x080c, 0x6996, 0x009e,
-	0x00fe, 0x00de, 0x0005, 0x0016, 0x00d6, 0x00f6, 0x0096, 0x0016,
-	0x2001, 0x0205, 0x200c, 0x918d, 0x0080, 0x2102, 0x001e, 0x2079,
-	0x0200, 0x2e98, 0xa87c, 0xd0ec, 0x0118, 0x9e80, 0x000c, 0x2098,
-	0x2021, 0x003e, 0x901e, 0x9282, 0x0020, 0x0218, 0x2011, 0x0020,
-	0x2018, 0x9486, 0x003e, 0x1170, 0x0096, 0x080c, 0x1022, 0x2900,
-	0x009e, 0x05c0, 0xa806, 0x2048, 0xa860, 0x20e8, 0xa85c, 0x9080,
-	0x0002, 0x20a0, 0x3300, 0x908e, 0x0260, 0x0140, 0x2009, 0x0280,
-	0x9102, 0x920a, 0x0218, 0x2010, 0x2100, 0x9318, 0x2200, 0x9402,
-	0x1228, 0x2400, 0x9202, 0x2410, 0x9318, 0x9006, 0x2020, 0x22a8,
-	0xa800, 0x9200, 0xa802, 0x20e1, 0x0000, 0x4003, 0x83ff, 0x0180,
-	0x3300, 0x9086, 0x0280, 0x1130, 0x7814, 0x8000, 0x9085, 0x0080,
-	0x7816, 0x2e98, 0x2310, 0x84ff, 0x0904, 0x9f60, 0x0804, 0x9f62,
-	0x9085, 0x0001, 0x7817, 0x0000, 0x009e, 0x00fe, 0x00de, 0x001e,
-	0x0005, 0x00d6, 0x0036, 0x0096, 0x6314, 0x2348, 0xa87a, 0xa982,
-	0x080c, 0x698a, 0x009e, 0x003e, 0x00de, 0x0005, 0x91b6, 0x0015,
-	0x1118, 0x080c, 0x9be7, 0x0030, 0x91b6, 0x0016, 0x190c, 0x0d65,
-	0x080c, 0x9be7, 0x0005, 0x20a9, 0x000e, 0x20e1, 0x0000, 0x2e98,
-	0x6014, 0x0096, 0x2048, 0xa860, 0x20e8, 0xa85c, 0x20a0, 0x009e,
-	0x4003, 0x0136, 0x9080, 0x001b, 0x2011, 0x0006, 0x20a9, 0x0001,
-	0x3418, 0x8318, 0x23a0, 0x4003, 0x3318, 0x8318, 0x2398, 0x8211,
-	0x1db8, 0x2011, 0x0006, 0x013e, 0x20a0, 0x3318, 0x8318, 0x2398,
-	0x4003, 0x3418, 0x8318, 0x23a0, 0x8211, 0x1db8, 0x0096, 0x080c,
-	0xb847, 0x0130, 0x6014, 0x2048, 0xa807, 0x0000, 0xa867, 0x0103,
-	0x009e, 0x0804, 0x9be7, 0x0096, 0x00d6, 0x0036, 0x7330, 0x9386,
-	0x0200, 0x11a8, 0x6010, 0x00b6, 0x2058, 0xb8c7, 0x0000, 0x00be,
-	0x6014, 0x9005, 0x0130, 0x2048, 0xa807, 0x0000, 0xa867, 0x0103,
-	0xab32, 0x080c, 0x9be7, 0x003e, 0x00de, 0x009e, 0x0005, 0x0011,
-	0x1d48, 0x0cc8, 0x0006, 0x0016, 0x080c, 0xbf61, 0x0188, 0x6014,
-	0x9005, 0x1170, 0x600b, 0x0003, 0x601b, 0x0000, 0x604b, 0x0000,
-	0x2009, 0x0022, 0x080c, 0xa3dc, 0x9006, 0x001e, 0x000e, 0x0005,
-	0x9085, 0x0001, 0x0cd0, 0x0096, 0x0016, 0x20a9, 0x0014, 0x9e80,
-	0x000c, 0x20e1, 0x0000, 0x2098, 0x6014, 0x2048, 0xa860, 0x20e8,
-	0xa85c, 0x9080, 0x0002, 0x20a0, 0x4003, 0x2001, 0x0205, 0x2003,
-	0x0001, 0x2099, 0x0260, 0x20a9, 0x0016, 0x4003, 0x20a9, 0x000a,
-	0xa804, 0x2048, 0xa860, 0x20e8, 0xa85c, 0x9080, 0x0002, 0x20a0,
-	0x4003, 0x2001, 0x0205, 0x2003, 0x0002, 0x2099, 0x0260, 0x20a9,
-	0x0020, 0x4003, 0x2003, 0x0000, 0x6014, 0x2048, 0xa800, 0x2048,
-	0xa867, 0x0103, 0x080c, 0x9be7, 0x001e, 0x009e, 0x0005, 0x0096,
-	0x0016, 0x900e, 0x7030, 0x9086, 0x0100, 0x0140, 0x7038, 0x9084,
-	0x00ff, 0x800c, 0x703c, 0x9084, 0x00ff, 0x8004, 0x9080, 0x0004,
-	0x9108, 0x810b, 0x2011, 0x0002, 0x2019, 0x000c, 0x6014, 0x2048,
-	0x080c, 0xb41a, 0x080c, 0xb847, 0x0140, 0x6014, 0x2048, 0xa807,
-	0x0000, 0xa864, 0xa8e2, 0xa867, 0x0103, 0x080c, 0x9be7, 0x001e,
-	0x009e, 0x0005, 0x0016, 0x0096, 0x7030, 0x9086, 0x0100, 0x1118,
-	0x2009, 0x0004, 0x0010, 0x7034, 0x800c, 0x810b, 0x2011, 0x000c,
-	0x2019, 0x000c, 0x6014, 0x2048, 0xa804, 0x0096, 0x9005, 0x0108,
-	0x2048, 0x080c, 0xb41a, 0x009e, 0x080c, 0xb847, 0x0148, 0xa804,
-	0x9005, 0x1158, 0xa807, 0x0000, 0xa864, 0xa8e2, 0xa867, 0x0103,
-	0x080c, 0x9be7, 0x009e, 0x001e, 0x0005, 0x0086, 0x2040, 0xa030,
-	0x8007, 0x9086, 0x0100, 0x1118, 0x080c, 0xa58f, 0x00e0, 0xa034,
-	0x8007, 0x800c, 0x8806, 0x8006, 0x8007, 0x90bc, 0x003f, 0x9084,
-	0xffc0, 0x9080, 0x000c, 0xa87b, 0x0000, 0xa883, 0x0000, 0xa897,
-	0x4000, 0xaaa0, 0xab9c, 0xaca8, 0xada4, 0x2031, 0x0000, 0x2041,
-	0x1266, 0x0019, 0x0d08, 0x008e, 0x0898, 0x0096, 0x0006, 0x080c,
-	0x1022, 0x000e, 0x01b0, 0xa8ab, 0x0dcb, 0xa876, 0x000e, 0xa8a2,
-	0x0006, 0xae6a, 0x2800, 0xa89e, 0xa97a, 0xaf72, 0xaa8e, 0xab92,
-	0xac96, 0xad9a, 0x0086, 0x2940, 0x080c, 0x110c, 0x008e, 0x9085,
-	0x0001, 0x009e, 0x0005, 0x00e6, 0x00d6, 0x0026, 0x7008, 0x9084,
-	0x00ff, 0x6210, 0x00b6, 0x2258, 0xba10, 0x00be, 0x9206, 0x1520,
-	0x700c, 0x6210, 0x00b6, 0x2258, 0xba14, 0x00be, 0x9206, 0x11e0,
-	0x604b, 0x0000, 0x2c68, 0x0016, 0x2009, 0x0035, 0x080c, 0xbed9,
-	0x001e, 0x1158, 0x622c, 0x2268, 0x2071, 0x026c, 0x6b20, 0x9386,
-	0x0003, 0x0130, 0x9386, 0x0006, 0x0128, 0x080c, 0x9be7, 0x0020,
-	0x0039, 0x0010, 0x080c, 0xa211, 0x002e, 0x00de, 0x00ee, 0x0005,
-	0x0096, 0x6814, 0x2048, 0x9186, 0x0015, 0x0904, 0xa1f0, 0x918e,
-	0x0016, 0x1904, 0xa20f, 0x700c, 0x908c, 0xff00, 0x9186, 0x1700,
-	0x0120, 0x9186, 0x0300, 0x1904, 0xa1ca, 0x89ff, 0x1138, 0x6800,
-	0x9086, 0x000f, 0x0904, 0xa1ac, 0x0804, 0xa20d, 0x6808, 0x9086,
-	0xffff, 0x1904, 0xa1f2, 0xa87c, 0x9084, 0x0060, 0x9086, 0x0020,
-	0x1128, 0xa83c, 0xa940, 0x9105, 0x1904, 0xa1f2, 0x6824, 0xd0b4,
-	0x1904, 0xa1f2, 0x080c, 0xba36, 0x6864, 0xa882, 0xa87c, 0xc0dc,
-	0xc0f4, 0xc0d4, 0xa87e, 0x0026, 0x900e, 0x6a18, 0x2001, 0x000a,
-	0x080c, 0x8419, 0xa884, 0x920a, 0x0208, 0x8011, 0xaa86, 0x82ff,
-	0x002e, 0x1138, 0x00c6, 0x2d60, 0x080c, 0xb56d, 0x00ce, 0x0804,
-	0xa20d, 0x00c6, 0xa868, 0xd0fc, 0x1118, 0x080c, 0x5d56, 0x0010,
-	0x080c, 0x60fb, 0x00ce, 0x1904, 0xa1f2, 0x00c6, 0x2d60, 0x080c,
-	0x9be7, 0x00ce, 0x0804, 0xa20d, 0x00c6, 0x080c, 0x9c58, 0x0198,
-	0x6017, 0x0000, 0x6810, 0x6012, 0x080c, 0xbcdb, 0x6023, 0x0003,
-	0x6904, 0x00c6, 0x2d60, 0x080c, 0x9be7, 0x00ce, 0x080c, 0x9c85,
-	0x00ce, 0x0804, 0xa20d, 0x2001, 0x1959, 0x2004, 0x684a, 0x00ce,
-	0x0804, 0xa20d, 0x7008, 0x9086, 0x000b, 0x11c8, 0x6010, 0x00b6,
-	0x2058, 0xb900, 0xc1bc, 0xb902, 0x00be, 0x00c6, 0x2d60, 0xa87b,
-	0x0003, 0x080c, 0xbf1b, 0x6007, 0x0085, 0x6003, 0x000b, 0x6023,
-	0x0002, 0x2009, 0x8020, 0x080c, 0x84d1, 0x00ce, 0x0430, 0x700c,
-	0x9086, 0x2a00, 0x1138, 0x2001, 0x1959, 0x2004, 0x684a, 0x00e8,
-	0x04c1, 0x00e8, 0x89ff, 0x090c, 0x0d65, 0x00c6, 0x00d6, 0x2d60,
-	0xa867, 0x0103, 0xa87b, 0x0003, 0x080c, 0x67ac, 0x080c, 0xba36,
-	0x080c, 0x9c21, 0x0026, 0x6010, 0x00b6, 0x2058, 0xba3c, 0x080c,
-	0x639b, 0x00be, 0x002e, 0x00de, 0x00ce, 0x080c, 0x9be7, 0x009e,
-	0x0005, 0x9186, 0x0015, 0x1128, 0x2001, 0x1959, 0x2004, 0x684a,
-	0x0068, 0x918e, 0x0016, 0x1160, 0x00c6, 0x2d00, 0x2060, 0x080c,
-	0xd4ce, 0x080c, 0x83c0, 0x080c, 0x9be7, 0x00ce, 0x080c, 0x9be7,
-	0x0005, 0x0026, 0x0036, 0x0046, 0x7228, 0xacb0, 0xabac, 0xd2f4,
-	0x0130, 0x2001, 0x1959, 0x2004, 0x684a, 0x0804, 0xa28b, 0x00c6,
-	0x2d60, 0x080c, 0xb445, 0x00ce, 0x6804, 0x9086, 0x0050, 0x1168,
-	0x00c6, 0x2d00, 0x2060, 0x6003, 0x0001, 0x6007, 0x0050, 0x2009,
-	0x8023, 0x080c, 0x84d1, 0x00ce, 0x04f0, 0x6800, 0x9086, 0x000f,
-	0x01a8, 0x89ff, 0x090c, 0x0d65, 0x6800, 0x9086, 0x0004, 0x1190,
-	0xa87c, 0xd0ac, 0x0178, 0xa843, 0x0fff, 0xa83f, 0x0fff, 0xa880,
-	0xc0fc, 0xa882, 0x2001, 0x0001, 0x6832, 0x0400, 0x2001, 0x0007,
-	0x6832, 0x00e0, 0xa87c, 0xd0b4, 0x1150, 0xd0ac, 0x0db8, 0x6824,
-	0xd0f4, 0x1d48, 0xa838, 0xa934, 0x9105, 0x0d80, 0x0c20, 0xd2ec,
-	0x1d68, 0x7024, 0x9306, 0x1118, 0x7020, 0x9406, 0x0d38, 0x7020,
-	0x683e, 0x7024, 0x683a, 0x2001, 0x0005, 0x6832, 0x080c, 0xbbc5,
-	0x080c, 0x8936, 0x0010, 0x080c, 0x9be7, 0x004e, 0x003e, 0x002e,
-	0x0005, 0x00e6, 0x00d6, 0x0026, 0x7008, 0x9084, 0x00ff, 0x6210,
-	0x00b6, 0x2258, 0xba10, 0x00be, 0x9206, 0x1904, 0xa2f6, 0x700c,
-	0x6210, 0x00b6, 0x2258, 0xba14, 0x00be, 0x9206, 0x1904, 0xa2f6,
-	0x6038, 0x2068, 0x6824, 0xc0dc, 0x6826, 0x6a20, 0x9286, 0x0007,
-	0x0904, 0xa2f6, 0x9286, 0x0002, 0x0904, 0xa2f6, 0x9286, 0x0000,
-	0x05e8, 0x6808, 0x633c, 0x9306, 0x15c8, 0x2071, 0x026c, 0x9186,
-	0x0015, 0x0570, 0x918e, 0x0016, 0x1100, 0x00c6, 0x6038, 0x2060,
-	0x6104, 0x9186, 0x004b, 0x01c0, 0x9186, 0x004c, 0x01a8, 0x9186,
-	0x004d, 0x0190, 0x9186, 0x004e, 0x0178, 0x9186, 0x0052, 0x0160,
-	0x6014, 0x0096, 0x2048, 0x080c, 0xb847, 0x090c, 0x0d65, 0xa87b,
-	0x0003, 0x009e, 0x080c, 0xbf1b, 0x6007, 0x0085, 0x6003, 0x000b,
-	0x6023, 0x0002, 0x2009, 0x8020, 0x080c, 0x84d1, 0x00ce, 0x0030,
-	0x6038, 0x2070, 0x2001, 0x1959, 0x2004, 0x704a, 0x080c, 0x9be7,
-	0x002e, 0x00de, 0x00ee, 0x0005, 0x00b6, 0x0096, 0x00f6, 0x6014,
-	0x2048, 0x6010, 0x2058, 0x91b6, 0x0015, 0x0130, 0xba08, 0xbb0c,
-	0xbc00, 0xc48c, 0xbc02, 0x0460, 0x0096, 0x0156, 0x0036, 0x0026,
-	0x2b48, 0x9e90, 0x0010, 0x2019, 0x000a, 0x20a9, 0x0004, 0x080c,
-	0xabdf, 0x002e, 0x003e, 0x015e, 0x009e, 0x1904, 0xa365, 0x0096,
-	0x0156, 0x0036, 0x0026, 0x2b48, 0x9e90, 0x0014, 0x2019, 0x0006,
-	0x20a9, 0x0004, 0x080c, 0xabdf, 0x002e, 0x003e, 0x015e, 0x009e,
-	0x15a0, 0x7238, 0xba0a, 0x733c, 0xbb0e, 0xbc00, 0xc48d, 0xbc02,
-	0xa804, 0x9005, 0x1128, 0x00fe, 0x009e, 0x00be, 0x0804, 0x9ff6,
-	0x0096, 0x2048, 0xaa12, 0xab16, 0xac0a, 0x009e, 0x8006, 0x8006,
-	0x8007, 0x90bc, 0x003f, 0x9084, 0xffc0, 0x9080, 0x0002, 0x2009,
-	0x002b, 0xaaa0, 0xab9c, 0xaca8, 0xada4, 0x2031, 0x0000, 0x2041,
-	0x1266, 0x080c, 0xa0f5, 0x0130, 0x00fe, 0x009e, 0x080c, 0x9be7,
-	0x00be, 0x0005, 0x080c, 0xa58f, 0x0cb8, 0x2b78, 0x00f6, 0x080c,
-	0x3006, 0x080c, 0xbf76, 0x00fe, 0x00c6, 0x080c, 0x9b91, 0x2f00,
-	0x6012, 0x6017, 0x0000, 0x6023, 0x0001, 0x6007, 0x0001, 0x6003,
-	0x0001, 0x2001, 0x0007, 0x080c, 0x61c1, 0x080c, 0x61ed, 0x080c,
-	0x84d8, 0x080c, 0x8936, 0x00ce, 0x0804, 0xa338, 0x2100, 0x91b2,
-	0x0053, 0x1a0c, 0x0d65, 0x91b2, 0x0040, 0x1a04, 0xa3ee, 0x0002,
-	0xa3dc, 0xa3dc, 0xa3d2, 0xa3dc, 0xa3dc, 0xa3dc, 0xa3d0, 0xa3d0,
-	0xa3d0, 0xa3d0, 0xa3d0, 0xa3d0, 0xa3d0, 0xa3d0, 0xa3d0, 0xa3d0,
-	0xa3d0, 0xa3d0, 0xa3d0, 0xa3d0, 0xa3d0, 0xa3d0, 0xa3d0, 0xa3d0,
-	0xa3d0, 0xa3d0, 0xa3d0, 0xa3d0, 0xa3d0, 0xa3d0, 0xa3d0, 0xa3dc,
-	0xa3d0, 0xa3dc, 0xa3dc, 0xa3d0, 0xa3d0, 0xa3d0, 0xa3d0, 0xa3d0,
-	0xa3d2, 0xa3d0, 0xa3d0, 0xa3d0, 0xa3d0, 0xa3d0, 0xa3d0, 0xa3d0,
-	0xa3d0, 0xa3d0, 0xa3dc, 0xa3dc, 0xa3d0, 0xa3d0, 0xa3d0, 0xa3d0,
-	0xa3d0, 0xa3d0, 0xa3d0, 0xa3d0, 0xa3d0, 0xa3dc, 0xa3d0, 0xa3d0,
-	0x080c, 0x0d65, 0x0066, 0x00b6, 0x6610, 0x2658, 0xb8c4, 0xc08c,
-	0xb8c6, 0x00be, 0x006e, 0x0000, 0x6003, 0x0001, 0x6106, 0x9186,
-	0x0032, 0x0118, 0x080c, 0x84d8, 0x0010, 0x080c, 0x84d1, 0x0126,
-	0x2091, 0x8000, 0x080c, 0x8936, 0x012e, 0x0005, 0x2600, 0x0002,
-	0xa402, 0xa402, 0xa402, 0xa3dc, 0xa3dc, 0xa402, 0xa402, 0xa402,
-	0xa402, 0xa3dc, 0xa402, 0xa3dc, 0xa402, 0xa3dc, 0xa402, 0xa402,
-	0xa402, 0xa402, 0x080c, 0x0d65, 0x6004, 0x90b2, 0x0053, 0x1a0c,
-	0x0d65, 0x91b6, 0x0013, 0x0904, 0xa4d9, 0x91b6, 0x0027, 0x1904,
-	0xa485, 0x080c, 0x8874, 0x6004, 0x080c, 0xba4b, 0x01b0, 0x080c,
-	0xba5c, 0x01a8, 0x908e, 0x0021, 0x0904, 0xa482, 0x908e, 0x0022,
-	0x1130, 0x080c, 0xa022, 0x0904, 0xa47e, 0x0804, 0xa47f, 0x908e,
-	0x003d, 0x0904, 0xa482, 0x0804, 0xa478, 0x080c, 0x303b, 0x2001,
-	0x0007, 0x080c, 0x61c1, 0x6010, 0x00b6, 0x2058, 0xb9a0, 0x00be,
-	0x080c, 0xa58f, 0x9186, 0x007e, 0x1148, 0x2001, 0x1836, 0x2014,
-	0xc285, 0x080c, 0x70b7, 0x1108, 0xc2ad, 0x2202, 0x080c, 0x98c8,
-	0x0036, 0x0026, 0x2019, 0x0028, 0x2110, 0x080c, 0xd529, 0x002e,
-	0x003e, 0x0016, 0x0026, 0x0036, 0x2110, 0x2019, 0x0028, 0x080c,
-	0x863b, 0x0076, 0x903e, 0x080c, 0x852a, 0x6010, 0x00b6, 0x905d,
-	0x0100, 0x00be, 0x2c08, 0x080c, 0xcfc8, 0x007e, 0x003e, 0x002e,
-	0x001e, 0x080c, 0x98e4, 0x080c, 0xbf76, 0x0016, 0x080c, 0xbcd3,
-	0x080c, 0x9be7, 0x001e, 0x080c, 0x311a, 0x080c, 0x8936, 0x0030,
-	0x080c, 0xbcd3, 0x080c, 0x9be7, 0x080c, 0x8936, 0x0005, 0x080c,
-	0xa58f, 0x0cb0, 0x080c, 0xa5cb, 0x0c98, 0x9186, 0x0015, 0x0118,
-	0x9186, 0x0016, 0x1140, 0x080c, 0x9ab7, 0x0d80, 0x9086, 0x0002,
-	0x0904, 0xa5d6, 0x0c58, 0x9186, 0x0014, 0x1d40, 0x080c, 0x8874,
-	0x6004, 0x908e, 0x0022, 0x1118, 0x080c, 0xa022, 0x09f8, 0x080c,
-	0x3006, 0x080c, 0xbf76, 0x080c, 0xba4b, 0x1190, 0x080c, 0x303b,
-	0x6010, 0x00b6, 0x2058, 0xb9a0, 0x00be, 0x080c, 0xa58f, 0x9186,
-	0x007e, 0x1128, 0x2001, 0x1836, 0x200c, 0xc185, 0x2102, 0x0800,
-	0x080c, 0xba5c, 0x1120, 0x080c, 0xa58f, 0x0804, 0xa478, 0x6004,
-	0x908e, 0x0032, 0x1160, 0x00e6, 0x00f6, 0x2071, 0x1894, 0x2079,
-	0x0000, 0x080c, 0x33bc, 0x00fe, 0x00ee, 0x0804, 0xa478, 0x6004,
-	0x908e, 0x0021, 0x0d40, 0x908e, 0x0022, 0x090c, 0xa58f, 0x0804,
-	0xa478, 0x90b2, 0x0040, 0x1a04, 0xa578, 0x2008, 0x0002, 0xa521,
-	0xa522, 0xa525, 0xa528, 0xa52b, 0xa52e, 0xa51f, 0xa51f, 0xa51f,
-	0xa51f, 0xa51f, 0xa51f, 0xa51f, 0xa51f, 0xa51f, 0xa51f, 0xa51f,
-	0xa51f, 0xa51f, 0xa51f, 0xa51f, 0xa51f, 0xa51f, 0xa51f, 0xa51f,
-	0xa51f, 0xa51f, 0xa51f, 0xa51f, 0xa51f, 0xa531, 0xa53a, 0xa51f,
-	0xa53b, 0xa53a, 0xa51f, 0xa51f, 0xa51f, 0xa51f, 0xa51f, 0xa53a,
-	0xa53a, 0xa51f, 0xa51f, 0xa51f, 0xa51f, 0xa51f, 0xa51f, 0xa51f,
-	0xa51f, 0xa563, 0xa53a, 0xa51f, 0xa536, 0xa51f, 0xa51f, 0xa51f,
-	0xa537, 0xa51f, 0xa51f, 0xa51f, 0xa53a, 0xa55e, 0xa51f, 0x080c,
-	0x0d65, 0x00c0, 0x2001, 0x000b, 0x00e8, 0x2001, 0x0003, 0x00d0,
-	0x2001, 0x0005, 0x00b8, 0x2001, 0x0001, 0x00a0, 0x2001, 0x0009,
-	0x0088, 0x6003, 0x0005, 0x080c, 0x8936, 0x0058, 0x0018, 0x0010,
-	0x080c, 0x61c1, 0x04b8, 0x080c, 0xbf79, 0x6003, 0x0004, 0x080c,
-	0x8936, 0x0005, 0x080c, 0x61c1, 0x6003, 0x0002, 0x0036, 0x2019,
-	0x185e, 0x2304, 0x9084, 0xff00, 0x1120, 0x2001, 0x1957, 0x201c,
-	0x0040, 0x8007, 0x909a, 0x0004, 0x0ec0, 0x8003, 0x801b, 0x831b,
-	0x9318, 0x631a, 0x003e, 0x080c, 0x8936, 0x0c18, 0x080c, 0xbcd3,
-	0x080c, 0x9be7, 0x08f0, 0x00e6, 0x00f6, 0x2071, 0x1894, 0x2079,
-	0x0000, 0x080c, 0x33bc, 0x00fe, 0x00ee, 0x080c, 0x8874, 0x080c,
-	0x9be7, 0x0878, 0x6003, 0x0002, 0x080c, 0xbf79, 0x0804, 0x8936,
-	0x2600, 0x2008, 0x0002, 0xa58d, 0xa58d, 0xa58d, 0xa572, 0xa572,
-	0xa58d, 0xa58d, 0xa58d, 0xa58d, 0xa572, 0xa58d, 0xa572, 0xa58d,
-	0xa572, 0xa58d, 0xa58d, 0xa58d, 0xa58d, 0x080c, 0x0d65, 0x00e6,
-	0x0096, 0x0026, 0x0016, 0x080c, 0xb847, 0x0568, 0x6014, 0x2048,
-	0xa864, 0x9086, 0x0139, 0x11a8, 0xa894, 0x9086, 0x0056, 0x1148,
-	0x080c, 0x512e, 0x0130, 0x2001, 0x0000, 0x900e, 0x2011, 0x4000,
-	0x0028, 0x2001, 0x0030, 0x900e, 0x2011, 0x4005, 0x080c, 0xbe40,
-	0x0090, 0xa868, 0xd0fc, 0x0178, 0xa807, 0x0000, 0x0016, 0x6004,
-	0x908e, 0x0021, 0x0168, 0x908e, 0x003d, 0x0150, 0x001e, 0xa867,
-	0x0103, 0xa833, 0x0100, 0x001e, 0x002e, 0x009e, 0x00ee, 0x0005,
-	0x001e, 0x0009, 0x0cc0, 0x0096, 0x6014, 0x2048, 0xa800, 0x2048,
-	0xa867, 0x0103, 0xa823, 0x8001, 0x009e, 0x0005, 0x00b6, 0x6610,
-	0x2658, 0xb804, 0x9084, 0x00ff, 0x90b2, 0x000c, 0x1a0c, 0x0d65,
-	0x6604, 0x96b6, 0x004d, 0x1120, 0x080c, 0xbd5f, 0x0804, 0xa653,
-	0x6604, 0x96b6, 0x0043, 0x1120, 0x080c, 0xbda8, 0x0804, 0xa653,
-	0x6604, 0x96b6, 0x004b, 0x1120, 0x080c, 0xbdd4, 0x0804, 0xa653,
-	0x6604, 0x96b6, 0x0033, 0x1120, 0x080c, 0xbcf5, 0x0804, 0xa653,
-	0x6604, 0x96b6, 0x0028, 0x1120, 0x080c, 0xba95, 0x0804, 0xa653,
-	0x6604, 0x96b6, 0x0029, 0x1120, 0x080c, 0xbad6, 0x0804, 0xa653,
-	0x6604, 0x96b6, 0x001f, 0x1118, 0x080c, 0x9fcb, 0x04e0, 0x6604,
-	0x96b6, 0x0000, 0x1118, 0x080c, 0xa2fc, 0x04a8, 0x6604, 0x96b6,
-	0x0022, 0x1118, 0x080c, 0xa003, 0x0470, 0x6604, 0x96b6, 0x0035,
-	0x1118, 0x080c, 0xa113, 0x0438, 0x6604, 0x96b6, 0x0039, 0x1118,
-	0x080c, 0xa291, 0x0400, 0x6604, 0x96b6, 0x003d, 0x1118, 0x080c,
-	0xa03b, 0x00c8, 0x6604, 0x96b6, 0x0044, 0x1118, 0x080c, 0xa077,
-	0x0090, 0x6604, 0x96b6, 0x0049, 0x1118, 0x080c, 0xa0a2, 0x0058,
-	0x91b6, 0x0015, 0x1110, 0x0063, 0x0030, 0x91b6, 0x0016, 0x1128,
-	0x00be, 0x0804, 0xa911, 0x00be, 0x0005, 0x080c, 0x9ca2, 0x0cd8,
-	0xa670, 0xa673, 0xa670, 0xa6b7, 0xa670, 0xa845, 0xa91e, 0xa670,
-	0xa670, 0xa8eb, 0xa670, 0xa8ff, 0x0096, 0x080c, 0x1595, 0x6014,
-	0x2048, 0xa800, 0x2048, 0xa867, 0x0103, 0x009e, 0x0804, 0x9be7,
-	0xa001, 0xa001, 0x0005, 0x00e6, 0x2071, 0x1800, 0x708c, 0x9086,
-	0x0074, 0x1540, 0x080c, 0xcf99, 0x11b0, 0x6010, 0x00b6, 0x2058,
-	0x7030, 0xd08c, 0x0128, 0xb800, 0xd0bc, 0x0110, 0xc0c5, 0xb802,
-	0x00e9, 0x00be, 0x2001, 0x0006, 0x080c, 0x61c1, 0x080c, 0x303b,
-	0x080c, 0x9be7, 0x0088, 0x2001, 0x000a, 0x080c, 0x61c1, 0x080c,
-	0x303b, 0x6003, 0x0001, 0x6007, 0x0001, 0x080c, 0x84d8, 0x080c,
-	0x8936, 0x0010, 0x080c, 0xa830, 0x00ee, 0x0005, 0x00d6, 0xb800,
-	0xd084, 0x0158, 0x9006, 0x080c, 0x61ad, 0x2069, 0x1853, 0x6804,
-	0x0020, 0x2001, 0x0006, 0x080c, 0x61ed, 0x00de, 0x0005, 0x00b6,
-	0x0096, 0x00d6, 0x2011, 0x1823, 0x2204, 0x9086, 0x0074, 0x1904,
-	0xa809, 0x6010, 0x2058, 0xbaa0, 0x9286, 0x007e, 0x1120, 0x080c,
-	0xaa62, 0x0804, 0xa76e, 0x00d6, 0x080c, 0x70b7, 0x0198, 0x0026,
-	0x2011, 0x0010, 0x080c, 0x668b, 0x002e, 0x05c8, 0x080c, 0x53a1,
-	0x1540, 0x6014, 0x2048, 0xa807, 0x0000, 0xa867, 0x0103, 0xa833,
-	0xdead, 0x00f8, 0x0026, 0x2011, 0x8008, 0x080c, 0x668b, 0x002e,
-	0x0530, 0x6014, 0x2048, 0xa864, 0x9084, 0x00ff, 0x9086, 0x0039,
-	0x1140, 0x2001, 0x0030, 0x900e, 0x2011, 0x4009, 0x080c, 0xbe40,
-	0x0040, 0x6014, 0x2048, 0xa807, 0x0000, 0xa867, 0x0103, 0xa833,
-	0xdead, 0x6010, 0x2058, 0xb9a0, 0x0016, 0x080c, 0x303b, 0x080c,
-	0x9be7, 0x001e, 0x080c, 0x311a, 0x00de, 0x0804, 0xa80a, 0x00de,
-	0x080c, 0xaa57, 0x6010, 0x2058, 0xbaa0, 0x9286, 0x0080, 0x1510,
-	0x6014, 0x9005, 0x01a8, 0x2048, 0xa864, 0x9084, 0x00ff, 0x9086,
-	0x0039, 0x1140, 0x2001, 0x0000, 0x900e, 0x2011, 0x4000, 0x080c,
-	0xbe40, 0x0030, 0xa807, 0x0000, 0xa867, 0x0103, 0xa833, 0x0200,
-	0x2001, 0x0006, 0x080c, 0x61c1, 0x080c, 0x303b, 0x080c, 0x9be7,
-	0x0804, 0xa80a, 0x080c, 0xa818, 0x6014, 0x9005, 0x0190, 0x2048,
-	0xa868, 0xd0f4, 0x01e8, 0xa864, 0x9084, 0x00ff, 0x9086, 0x0039,
-	0x1d08, 0x2001, 0x0000, 0x900e, 0x2011, 0x4000, 0x080c, 0xbe40,
-	0x08f8, 0x080c, 0xa80e, 0x0160, 0x9006, 0x080c, 0x61ad, 0x2001,
-	0x0004, 0x080c, 0x61ed, 0x2001, 0x0007, 0x080c, 0x61c1, 0x08a0,
-	0x2001, 0x0004, 0x080c, 0x61c1, 0x6003, 0x0001, 0x6007, 0x0003,
-	0x080c, 0x84d8, 0x080c, 0x8936, 0x0804, 0xa80a, 0xb85c, 0xd0e4,
-	0x01d0, 0x080c, 0xbc6d, 0x080c, 0x70b7, 0x0118, 0xd0dc, 0x1904,
-	0xa730, 0x2011, 0x1836, 0x2204, 0xc0ad, 0x2012, 0x2001, 0x0002,
-	0x00f6, 0x2079, 0x0100, 0x78e3, 0x0000, 0x080c, 0x2498, 0x78e2,
-	0x00fe, 0x0804, 0xa730, 0x080c, 0xbcae, 0x2011, 0x1836, 0x2204,
-	0xc0a5, 0x2012, 0x0006, 0x080c, 0xd0fe, 0x000e, 0x1904, 0xa730,
-	0xc0b5, 0x2012, 0x2001, 0x0006, 0x080c, 0x61c1, 0x9006, 0x080c,
-	0x61ad, 0x00c6, 0x2001, 0x180f, 0x2004, 0xd09c, 0x0520, 0x00f6,
-	0x2079, 0x0100, 0x00e6, 0x2071, 0x1800, 0x700c, 0x9084, 0x00ff,
-	0x78e6, 0x707a, 0x7010, 0x78ea, 0x707e, 0x908c, 0x00ff, 0x00ee,
-	0x780c, 0xc0b5, 0x780e, 0x00fe, 0x080c, 0x246d, 0x00f6, 0x2100,
-	0x900e, 0x080c, 0x2424, 0x795a, 0x00fe, 0x9186, 0x0081, 0x01d8,
-	0x2009, 0x0081, 0x00c8, 0x2009, 0x00ef, 0x00f6, 0x2079, 0x0100,
-	0x79ea, 0x7932, 0x7936, 0x780c, 0xc0b5, 0x780e, 0x00fe, 0x080c,
-	0x246d, 0x00f6, 0x2079, 0x1800, 0x797e, 0x2100, 0x900e, 0x080c,
-	0x2424, 0x795a, 0x00fe, 0x8108, 0x080c, 0x6210, 0x2b00, 0x00ce,
-	0x1904, 0xa730, 0x6012, 0x2009, 0x180f, 0x210c, 0xd19c, 0x0150,
-	0x2009, 0x027c, 0x210c, 0x918c, 0x00ff, 0xb912, 0x2009, 0x027d,
-	0x210c, 0xb916, 0x2001, 0x0002, 0x080c, 0x61c1, 0x6023, 0x0001,
-	0x6003, 0x0001, 0x6007, 0x0002, 0x080c, 0x84d8, 0x080c, 0x8936,
-	0x0008, 0x0431, 0x00de, 0x009e, 0x00be, 0x0005, 0x2001, 0x1810,
-	0x2004, 0xd0a4, 0x0120, 0x2001, 0x1854, 0x2004, 0xd0ac, 0x0005,
-	0x00e6, 0x080c, 0xd582, 0x0190, 0x2071, 0x0260, 0x7108, 0x720c,
-	0x918c, 0x00ff, 0x1118, 0x9284, 0xff00, 0x0140, 0x6010, 0x2058,
-	0xb8a0, 0x9084, 0xff80, 0x1110, 0xb912, 0xba16, 0x00ee, 0x0005,
-	0x2030, 0x2001, 0x0007, 0x080c, 0x61c1, 0x080c, 0x53a1, 0x1120,
-	0x2001, 0x0007, 0x080c, 0x61ed, 0x080c, 0x303b, 0x6020, 0x9086,
-	0x000a, 0x1108, 0x0005, 0x0804, 0x9be7, 0x00b6, 0x00e6, 0x0026,
-	0x0016, 0x2071, 0x1800, 0x708c, 0x9086, 0x0014, 0x1904, 0xa8e2,
-	0x00d6, 0x080c, 0x70b7, 0x0198, 0x0026, 0x2011, 0x0010, 0x080c,
-	0x668b, 0x002e, 0x05c8, 0x080c, 0x53a1, 0x1540, 0x6014, 0x2048,
-	0xa807, 0x0000, 0xa867, 0x0103, 0xa833, 0xdead, 0x00f8, 0x0026,
-	0x2011, 0x8008, 0x080c, 0x668b, 0x002e, 0x0530, 0x6014, 0x2048,
-	0xa864, 0x9084, 0x00ff, 0x9086, 0x0039, 0x1140, 0x2001, 0x0030,
-	0x900e, 0x2011, 0x4009, 0x080c, 0xbe40, 0x0040, 0x6014, 0x2048,
-	0xa807, 0x0000, 0xa867, 0x0103, 0xa833, 0xdead, 0x6010, 0x2058,
-	0xb9a0, 0x0016, 0x080c, 0x303b, 0x080c, 0x9be7, 0x001e, 0x080c,
-	0x311a, 0x00de, 0x0804, 0xa8e6, 0x00de, 0x080c, 0x53a1, 0x1170,
-	0x6014, 0x9005, 0x1158, 0x0036, 0x0046, 0x6010, 0x2058, 0xbba0,
-	0x2021, 0x0006, 0x080c, 0x4a75, 0x004e, 0x003e, 0x00d6, 0x6010,
-	0x2058, 0x080c, 0x630b, 0x080c, 0xa6a6, 0x00de, 0x080c, 0xab28,
-	0x1588, 0x6010, 0x2058, 0xb890, 0x9005, 0x0560, 0x2001, 0x0006,
-	0x080c, 0x61c1, 0x0096, 0x6014, 0x904d, 0x01d0, 0xa864, 0x9084,
-	0x00ff, 0x9086, 0x0039, 0x1140, 0x2001, 0x0000, 0x900e, 0x2011,
-	0x4000, 0x080c, 0xbe40, 0x0060, 0xa864, 0x9084, 0x00ff, 0x9086,
-	0x0029, 0x0130, 0xa807, 0x0000, 0xa867, 0x0103, 0xa833, 0x0200,
-	0x009e, 0x080c, 0x303b, 0x6020, 0x9086, 0x000a, 0x0138, 0x080c,
-	0x9be7, 0x0020, 0x080c, 0xa58f, 0x080c, 0xa830, 0x001e, 0x002e,
-	0x00ee, 0x00be, 0x0005, 0x2011, 0x1823, 0x2204, 0x9086, 0x0014,
-	0x1160, 0x2001, 0x0002, 0x080c, 0x61c1, 0x6003, 0x0001, 0x6007,
-	0x0001, 0x080c, 0x84d8, 0x0804, 0x8936, 0x0804, 0xa830, 0x2030,
-	0x2011, 0x1823, 0x2204, 0x9086, 0x0004, 0x1148, 0x96b6, 0x000b,
-	0x1120, 0x2001, 0x0007, 0x080c, 0x61c1, 0x0804, 0x9be7, 0x0804,
-	0xa830, 0x0002, 0xa670, 0xa929, 0xa670, 0xa968, 0xa670, 0xaa13,
-	0xa91e, 0xa670, 0xa670, 0xaa26, 0xa670, 0xaa36, 0x6604, 0x9686,
-	0x0003, 0x0904, 0xa845, 0x96b6, 0x001e, 0x1110, 0x080c, 0x9be7,
-	0x0005, 0x00b6, 0x00d6, 0x00c6, 0x080c, 0xaa46, 0x11a0, 0x9006,
-	0x080c, 0x61ad, 0x080c, 0x3006, 0x080c, 0xbf76, 0x2001, 0x0002,
-	0x080c, 0x61c1, 0x6003, 0x0001, 0x6007, 0x0002, 0x080c, 0x84d8,
-	0x080c, 0x8936, 0x0408, 0x2009, 0x026e, 0x2104, 0x9086, 0x0009,
-	0x1160, 0x6010, 0x2058, 0xb840, 0x9084, 0x00ff, 0x9005, 0x0170,
-	0x8001, 0xb842, 0x601b, 0x000a, 0x0078, 0x2009, 0x026f, 0x2104,
-	0x9084, 0xff00, 0x9086, 0x1900, 0x1108, 0x08a0, 0x080c, 0x3006,
-	0x080c, 0xbf76, 0x080c, 0xa830, 0x00ce, 0x00de, 0x00be, 0x0005,
-	0x0096, 0x00b6, 0x0026, 0x9016, 0x080c, 0xaa54, 0x00d6, 0x2069,
-	0x194d, 0x2d04, 0x9005, 0x0168, 0x6010, 0x2058, 0xb8a0, 0x9086,
-	0x007e, 0x1138, 0x2069, 0x181f, 0x2d04, 0x8000, 0x206a, 0x00de,
-	0x0010, 0x00de, 0x0088, 0x9006, 0x080c, 0x61ad, 0x2001, 0x0002,
-	0x080c, 0x61c1, 0x6003, 0x0001, 0x6007, 0x0002, 0x080c, 0x84d8,
-	0x080c, 0x8936, 0x0804, 0xa9e3, 0x080c, 0xb847, 0x01b0, 0x6014,
-	0x2048, 0xa864, 0x2010, 0x9086, 0x0139, 0x1138, 0x6007, 0x0016,
-	0x2001, 0x0002, 0x080c, 0xbe9a, 0x00b0, 0x6014, 0x2048, 0xa864,
-	0xd0fc, 0x0118, 0x2001, 0x0001, 0x0ca8, 0x2001, 0x180e, 0x2004,
-	0xd0dc, 0x0148, 0x6010, 0x2058, 0xb840, 0x9084, 0x00ff, 0x9005,
-	0x1110, 0x9006, 0x0c38, 0x080c, 0xa58f, 0x2009, 0x026e, 0x2134,
-	0x96b4, 0x00ff, 0x9686, 0x0005, 0x0510, 0x9686, 0x000b, 0x01c8,
-	0x2009, 0x026f, 0x2104, 0x9084, 0xff00, 0x1118, 0x9686, 0x0009,
-	0x01b0, 0x9086, 0x1900, 0x1168, 0x9686, 0x0009, 0x0180, 0x2001,
-	0x0004, 0x080c, 0x61c1, 0x2001, 0x0028, 0x601a, 0x6007, 0x0052,
-	0x0010, 0x080c, 0xa830, 0x002e, 0x00be, 0x009e, 0x0005, 0x9286,
-	0x0139, 0x0160, 0x6014, 0x2048, 0x080c, 0xb847, 0x0140, 0xa864,
-	0x9086, 0x0139, 0x0118, 0xa868, 0xd0fc, 0x0108, 0x0c50, 0x6010,
-	0x2058, 0xb840, 0x9084, 0x00ff, 0x9005, 0x0138, 0x8001, 0xb842,
-	0x601b, 0x000a, 0x6007, 0x0016, 0x08f0, 0xb8a0, 0x9086, 0x007e,
-	0x1138, 0x00e6, 0x2071, 0x1800, 0x080c, 0x5c6f, 0x00ee, 0x0010,
-	0x080c, 0x3006, 0x0870, 0x080c, 0xaa54, 0x1160, 0x2001, 0x0004,
-	0x080c, 0x61c1, 0x6003, 0x0001, 0x6007, 0x0003, 0x080c, 0x84d8,
-	0x0804, 0x8936, 0x080c, 0xa58f, 0x0804, 0xa830, 0x0469, 0x1160,
-	0x2001, 0x0008, 0x080c, 0x61c1, 0x6003, 0x0001, 0x6007, 0x0005,
-	0x080c, 0x84d8, 0x0804, 0x8936, 0x0804, 0xa830, 0x00e9, 0x1160,
-	0x2001, 0x000a, 0x080c, 0x61c1, 0x6003, 0x0001, 0x6007, 0x0001,
-	0x080c, 0x84d8, 0x0804, 0x8936, 0x0804, 0xa830, 0x2009, 0x026e,
-	0x2104, 0x9086, 0x0003, 0x1138, 0x2009, 0x026f, 0x2104, 0x9084,
-	0xff00, 0x9086, 0x2a00, 0x0005, 0x9085, 0x0001, 0x0005, 0x00b6,
-	0x00c6, 0x0016, 0x6110, 0x2158, 0x080c, 0x627f, 0x001e, 0x00ce,
-	0x00be, 0x0005, 0x00b6, 0x00f6, 0x00e6, 0x00d6, 0x0036, 0x0016,
-	0x6010, 0x2058, 0x2009, 0x1836, 0x2104, 0x9085, 0x0003, 0x200a,
-	0x080c, 0xaafa, 0x0560, 0x2009, 0x1836, 0x2104, 0xc0cd, 0x200a,
-	0x080c, 0x6663, 0x0158, 0x9006, 0x2020, 0x2009, 0x002a, 0x080c,
-	0xd273, 0x2001, 0x180c, 0x200c, 0xc195, 0x2102, 0x2019, 0x002a,
-	0x2009, 0x0001, 0x080c, 0x2fc5, 0x00e6, 0x2071, 0x1800, 0x080c,
-	0x2ddb, 0x00ee, 0x00c6, 0x0156, 0x20a9, 0x0781, 0x2009, 0x007f,
-	0x080c, 0x311a, 0x8108, 0x1f04, 0xaa98, 0x015e, 0x00ce, 0x080c,
-	0xaa57, 0x2071, 0x0260, 0x2079, 0x0200, 0x7817, 0x0001, 0x2001,
-	0x1836, 0x200c, 0xc1c5, 0x7018, 0xd0fc, 0x0110, 0xd0dc, 0x0118,
-	0x7038, 0xd0dc, 0x1108, 0xc1c4, 0x7817, 0x0000, 0x2001, 0x1836,
-	0x2102, 0x2079, 0x0100, 0x2e04, 0x9084, 0x00ff, 0x2069, 0x181e,
-	0x206a, 0x78e6, 0x0006, 0x8e70, 0x2e04, 0x2069, 0x181f, 0x206a,
-	0x78ea, 0x7832, 0x7836, 0x2010, 0x9084, 0xff00, 0x001e, 0x9105,
-	0x2009, 0x182b, 0x200a, 0x2200, 0x9084, 0x00ff, 0x2008, 0x080c,
-	0x246d, 0x080c, 0x70b7, 0x0170, 0x2071, 0x0260, 0x2069, 0x1953,
-	0x7048, 0x206a, 0x704c, 0x6806, 0x7050, 0x680a, 0x7054, 0x680e,
-	0x080c, 0xbc6d, 0x0040, 0x2001, 0x0006, 0x080c, 0x61c1, 0x080c,
-	0x303b, 0x080c, 0x9be7, 0x001e, 0x003e, 0x00de, 0x00ee, 0x00fe,
-	0x00be, 0x0005, 0x0096, 0x0026, 0x0036, 0x00e6, 0x0156, 0x2019,
-	0x182b, 0x231c, 0x83ff, 0x01f0, 0x2071, 0x0260, 0x7200, 0x9294,
-	0x00ff, 0x7004, 0x9084, 0xff00, 0x9205, 0x9306, 0x1198, 0x2011,
-	0x0276, 0x20a9, 0x0004, 0x2b48, 0x2019, 0x000a, 0x080c, 0xabdf,
-	0x1148, 0x2011, 0x027a, 0x20a9, 0x0004, 0x2019, 0x0006, 0x080c,
-	0xabdf, 0x1100, 0x015e, 0x00ee, 0x003e, 0x002e, 0x009e, 0x0005,
-	0x00e6, 0x2071, 0x0260, 0x7034, 0x9086, 0x0014, 0x11a8, 0x7038,
-	0x9086, 0x0800, 0x1188, 0x703c, 0xd0ec, 0x0160, 0x9084, 0x0f00,
-	0x9086, 0x0100, 0x1138, 0x7054, 0xd0a4, 0x1110, 0xd0ac, 0x0110,
-	0x9006, 0x0010, 0x9085, 0x0001, 0x00ee, 0x0005, 0x00e6, 0x0096,
-	0x00c6, 0x0076, 0x0056, 0x0046, 0x0026, 0x0006, 0x0126, 0x2091,
-	0x8000, 0x2029, 0x19c4, 0x252c, 0x2021, 0x19cb, 0x2424, 0x2061,
-	0x1ddc, 0x2071, 0x1800, 0x7250, 0x7070, 0x9202, 0x1a04, 0xabb7,
-	0x080c, 0xd2a4, 0x0904, 0xabb0, 0x6720, 0x9786, 0x0007, 0x0904,
-	0xabb0, 0x2500, 0x9c06, 0x0904, 0xabb0, 0x2400, 0x9c06, 0x0904,
-	0xabb0, 0x3e08, 0x9186, 0x0002, 0x1148, 0x6010, 0x9005, 0x0130,
-	0x00b6, 0x2058, 0xb800, 0x00be, 0xd0bc, 0x1590, 0x00c6, 0x6043,
-	0xffff, 0x6000, 0x9086, 0x0004, 0x1110, 0x080c, 0x1914, 0x9786,
-	0x000a, 0x0148, 0x080c, 0xba5c, 0x1130, 0x00ce, 0x080c, 0xa58f,
-	0x080c, 0x9c21, 0x00e8, 0x6014, 0x2048, 0x080c, 0xb847, 0x01a8,
-	0x9786, 0x0003, 0x1530, 0xa867, 0x0103, 0xa87c, 0xd0cc, 0x0130,
-	0x0096, 0xa878, 0x2048, 0x080c, 0x0fd4, 0x009e, 0xab7a, 0xa877,
-	0x0000, 0x080c, 0x698a, 0x080c, 0xba36, 0x080c, 0x9c21, 0x00ce,
-	0x9ce0, 0x001c, 0x7064, 0x9c02, 0x1210, 0x0804, 0xab5b, 0x012e,
-	0x000e, 0x002e, 0x004e, 0x005e, 0x007e, 0x00ce, 0x009e, 0x00ee,
-	0x0005, 0x9786, 0x0006, 0x1118, 0x080c, 0xd21e, 0x0c30, 0x9786,
-	0x000a, 0x0998, 0x0880, 0x220c, 0x2304, 0x9106, 0x1130, 0x8210,
-	0x8318, 0x1f04, 0xabcb, 0x9006, 0x0005, 0x2304, 0x9102, 0x0218,
-	0x2001, 0x0001, 0x0008, 0x9006, 0x918d, 0x0001, 0x0005, 0x0136,
-	0x01c6, 0x0016, 0x8906, 0x8006, 0x8007, 0x908c, 0x003f, 0x21e0,
-	0x9084, 0xffc0, 0x9300, 0x2098, 0x3518, 0x20a9, 0x0001, 0x220c,
-	0x4002, 0x910e, 0x1140, 0x8210, 0x8319, 0x1dc8, 0x9006, 0x001e,
-	0x01ce, 0x013e, 0x0005, 0x220c, 0x9102, 0x0218, 0x2001, 0x0001,
-	0x0010, 0x2001, 0x0000, 0x918d, 0x0001, 0x001e, 0x01ce, 0x013e,
-	0x0005, 0x6004, 0x908a, 0x0053, 0x1a0c, 0x0d65, 0x080c, 0xba4b,
-	0x0120, 0x080c, 0xba5c, 0x0158, 0x0028, 0x080c, 0x303b, 0x080c,
-	0xba5c, 0x0128, 0x080c, 0x8874, 0x080c, 0x9be7, 0x0005, 0x080c,
-	0xa58f, 0x0cc0, 0x9182, 0x0057, 0x1220, 0x9182, 0x0040, 0x0208,
-	0x000a, 0x0005, 0xac41, 0xac41, 0xac41, 0xac41, 0xac41, 0xac41,
-	0xac41, 0xac41, 0xac41, 0xac41, 0xac41, 0xac43, 0xac43, 0xac43,
-	0xac43, 0xac41, 0xac41, 0xac41, 0xac43, 0xac41, 0xac41, 0xac41,
-	0xac41, 0x080c, 0x0d65, 0x600b, 0xffff, 0x6003, 0x000f, 0x6106,
-	0x0126, 0x2091, 0x8000, 0x080c, 0xbf79, 0x2009, 0x8000, 0x080c,
-	0x84d1, 0x012e, 0x0005, 0x9186, 0x0013, 0x1128, 0x6004, 0x9082,
-	0x0040, 0x0804, 0xacc8, 0x9186, 0x0027, 0x1520, 0x080c, 0x8874,
-	0x080c, 0x3006, 0x080c, 0xbf76, 0x0096, 0x6114, 0x2148, 0x080c,
-	0xb847, 0x0198, 0x080c, 0xba5c, 0x1118, 0x080c, 0xa58f, 0x0068,
-	0xa867, 0x0103, 0xa87b, 0x0029, 0xa877, 0x0000, 0xa97c, 0xc1c5,
-	0xa97e, 0x080c, 0x6996, 0x080c, 0xba36, 0x009e, 0x080c, 0x9be7,
-	0x0804, 0x8936, 0x9186, 0x0014, 0x1120, 0x6004, 0x9082, 0x0040,
-	0x0018, 0x080c, 0x0d65, 0x0005, 0x0002, 0xaca6, 0xaca4, 0xaca4,
-	0xaca4, 0xaca4, 0xaca4, 0xaca4, 0xaca4, 0xaca4, 0xaca4, 0xaca4,
-	0xacbf, 0xacbf, 0xacbf, 0xacbf, 0xaca4, 0xacbf, 0xaca4, 0xacbf,
-	0xaca4, 0xaca4, 0xaca4, 0xaca4, 0x080c, 0x0d65, 0x080c, 0x8874,
-	0x0096, 0x6114, 0x2148, 0x080c, 0xb847, 0x0168, 0xa867, 0x0103,
-	0xa87b, 0x0006, 0xa877, 0x0000, 0xa880, 0xc0ec, 0xa882, 0x080c,
-	0x6996, 0x080c, 0xba36, 0x009e, 0x080c, 0x9be7, 0x0005, 0x080c,
-	0x8874, 0x080c, 0xba5c, 0x090c, 0xa58f, 0x080c, 0x9be7, 0x0005,
-	0x0002, 0xace2, 0xace0, 0xace0, 0xace0, 0xace0, 0xace0, 0xace0,
-	0xace0, 0xace0, 0xace0, 0xace0, 0xace4, 0xace4, 0xace4, 0xace4,
-	0xace0, 0xace6, 0xace0, 0xace4, 0xace0, 0xace0, 0xace0, 0xace0,
-	0x080c, 0x0d65, 0x080c, 0x0d65, 0x080c, 0x0d65, 0x080c, 0x9be7,
-	0x0804, 0x8936, 0x9182, 0x0057, 0x1220, 0x9182, 0x0040, 0x0208,
-	0x000a, 0x0005, 0xad09, 0xad09, 0xad09, 0xad09, 0xad09, 0xad42,
-	0xae31, 0xad09, 0xae3d, 0xad09, 0xad09, 0xad09, 0xad09, 0xad09,
-	0xad09, 0xad09, 0xad09, 0xad09, 0xad09, 0xae3d, 0xad0b, 0xad09,
-	0xae3b, 0x080c, 0x0d65, 0x00b6, 0x0096, 0x6114, 0x2148, 0x6010,
-	0x2058, 0xb800, 0xd0bc, 0x1508, 0xa87b, 0x0000, 0xa867, 0x0103,
-	0xa877, 0x0000, 0xa87c, 0xd0ac, 0x0128, 0xa834, 0xa938, 0x9115,
-	0x190c, 0xaec2, 0x080c, 0x67ac, 0x6210, 0x2258, 0xba3c, 0x82ff,
-	0x0110, 0x8211, 0xba3e, 0xb8c0, 0x9005, 0x0110, 0x080c, 0x639b,
-	0x080c, 0x9be7, 0x009e, 0x00be, 0x0005, 0xa87c, 0xd0ac, 0x09e0,
-	0xa838, 0xa934, 0x9105, 0x09c0, 0xa880, 0xd0bc, 0x19a8, 0x080c,
-	0xbb8c, 0x0c80, 0x00b6, 0x0096, 0x6114, 0x2148, 0x601c, 0xd0fc,
-	0x1110, 0x7644, 0x0008, 0x9036, 0x96b4, 0x0fff, 0x86ff, 0x1590,
-	0x6010, 0x2058, 0xb800, 0xd0bc, 0x1904, 0xae20, 0xa87b, 0x0000,
-	0xa867, 0x0103, 0xae76, 0xa87c, 0xd0ac, 0x0128, 0xa834, 0xa938,
-	0x9115, 0x190c, 0xaec2, 0x080c, 0x67ac, 0x6210, 0x2258, 0xba3c,
-	0x82ff, 0x0110, 0x8211, 0xba3e, 0xb8c0, 0x9005, 0x0110, 0x080c,
-	0x639b, 0x601c, 0xd0fc, 0x1148, 0x7044, 0xd0e4, 0x1904, 0xae04,
-	0x080c, 0x9be7, 0x009e, 0x00be, 0x0005, 0x2009, 0x0211, 0x210c,
-	0x080c, 0x0d65, 0x968c, 0x0c00, 0x0150, 0x6010, 0x2058, 0xb800,
-	0xd0bc, 0x1904, 0xae08, 0x7348, 0xab92, 0x734c, 0xab8e, 0x968c,
-	0x00ff, 0x9186, 0x0002, 0x0508, 0x9186, 0x0028, 0x1118, 0xa87b,
-	0x001c, 0x00e8, 0xd6dc, 0x01a0, 0xa87b, 0x0015, 0xa87c, 0xd0ac,
-	0x0170, 0xa938, 0xaa34, 0x2100, 0x9205, 0x0148, 0x7048, 0x9106,
-	0x1118, 0x704c, 0x9206, 0x0118, 0xa992, 0xaa8e, 0xc6dc, 0x0038,
-	0xd6d4, 0x0118, 0xa87b, 0x0007, 0x0010, 0xa87b, 0x0000, 0xa867,
-	0x0103, 0xae76, 0x901e, 0xd6c4, 0x01d8, 0x9686, 0x0100, 0x1130,
-	0x7064, 0x9005, 0x1118, 0xc6c4, 0x0804, 0xad4e, 0x735c, 0xab86,
-	0x83ff, 0x0170, 0x938a, 0x0009, 0x0210, 0x2019, 0x0008, 0x0036,
-	0x2308, 0x2019, 0x0018, 0x2011, 0x0025, 0x080c, 0xb41a, 0x003e,
-	0xd6cc, 0x0904, 0xad63, 0x7154, 0xa98a, 0x81ff, 0x0904, 0xad63,
-	0x9192, 0x0021, 0x1278, 0x8304, 0x9098, 0x0018, 0x2011, 0x0029,
-	0x080c, 0xb41a, 0x2011, 0x0205, 0x2013, 0x0000, 0x080c, 0xbf06,
-	0x0804, 0xad63, 0xa868, 0xd0fc, 0x0120, 0x2009, 0x0020, 0xa98a,
-	0x0c50, 0x00a6, 0x2950, 0x080c, 0xb3b9, 0x00ae, 0x080c, 0xbf06,
-	0x080c, 0xb40a, 0x0804, 0xad65, 0x080c, 0xbb4f, 0x0804, 0xad7a,
-	0xa87c, 0xd0ac, 0x0904, 0xad8b, 0xa880, 0xd0bc, 0x1904, 0xad8b,
-	0x7348, 0xa838, 0x9306, 0x11c8, 0x734c, 0xa834, 0x931e, 0x0904,
-	0xad8b, 0xd6d4, 0x0190, 0xab38, 0x9305, 0x0904, 0xad8b, 0x0068,
-	0xa87c, 0xd0ac, 0x0904, 0xad56, 0xa838, 0xa934, 0x9105, 0x0904,
-	0xad56, 0xa880, 0xd0bc, 0x1904, 0xad56, 0x080c, 0xbb8c, 0x0804,
-	0xad7a, 0x00f6, 0x2079, 0x026c, 0x7c04, 0x7b00, 0x7e0c, 0x7d08,
-	0x00fe, 0x0021, 0x0005, 0x0011, 0x0005, 0x0005, 0x0096, 0x6003,
-	0x0002, 0x6007, 0x0043, 0x6014, 0x2048, 0xa87c, 0xd0ac, 0x0128,
-	0x009e, 0x0005, 0x2130, 0x2228, 0x0058, 0x2400, 0xa9ac, 0x910a,
-	0x2300, 0xaab0, 0x9213, 0x2600, 0x9102, 0x2500, 0x9203, 0x0e90,
-	0xac46, 0xab4a, 0xae36, 0xad3a, 0x6044, 0xd0fc, 0x190c, 0x98f1,
-	0x604b, 0x0000, 0x080c, 0x1ad2, 0x1118, 0x6144, 0x080c, 0x84fd,
-	0x009e, 0x0005, 0x9182, 0x0057, 0x1220, 0x9182, 0x0040, 0x0208,
-	0x000a, 0x0005, 0xae89, 0xae89, 0xae89, 0xae89, 0xae89, 0xae89,
-	0xae89, 0xae89, 0xae89, 0xae89, 0xae8b, 0xae89, 0xae89, 0xae89,
-	0xae89, 0xae9c, 0xae89, 0xae89, 0xae89, 0xae89, 0xaec0, 0xae89,
-	0xae89, 0x080c, 0x0d65, 0x6004, 0x9086, 0x0040, 0x1110, 0x080c,
-	0x8874, 0x2019, 0x0001, 0x080c, 0x9286, 0x6003, 0x0002, 0x080c,
-	0xbf7e, 0x080c, 0x88d1, 0x0005, 0x6004, 0x9086, 0x0040, 0x1110,
-	0x080c, 0x8874, 0x2019, 0x0001, 0x080c, 0x9286, 0x080c, 0x88d1,
-	0x080c, 0x3006, 0x080c, 0xbf76, 0x0096, 0x6114, 0x2148, 0x080c,
-	0xb847, 0x0150, 0xa867, 0x0103, 0xa87b, 0x0029, 0xa877, 0x0000,
-	0x080c, 0x6996, 0x080c, 0xba36, 0x009e, 0x080c, 0x9be7, 0x0005,
-	0x080c, 0x0d65, 0xa87b, 0x0015, 0xd1fc, 0x0180, 0xa87b, 0x0007,
-	0x8002, 0x8000, 0x810a, 0x9189, 0x0000, 0x0006, 0x0016, 0x2009,
-	0x1a48, 0x2104, 0x8000, 0x200a, 0x001e, 0x000e, 0xa992, 0xa88e,
-	0x0005, 0x9182, 0x0057, 0x1220, 0x9182, 0x0040, 0x0208, 0x000a,
-	0x0005, 0xaef8, 0xaef8, 0xaef8, 0xaef8, 0xaef8, 0xaefa, 0xaef8,
-	0xaef8, 0xafb7, 0xaef8, 0xaef8, 0xaef8, 0xaef8, 0xaef8, 0xaef8,
-	0xaef8, 0xaef8, 0xaef8, 0xaef8, 0xb0fb, 0xaef8, 0xb105, 0xaef8,
-	0x080c, 0x0d65, 0x601c, 0xd0bc, 0x0178, 0xd084, 0x0168, 0xd0f4,
-	0x0120, 0xc084, 0x601e, 0x0804, 0xacea, 0x6114, 0x0096, 0x2148,
-	0xa87c, 0xc0e5, 0xa87e, 0x009e, 0x0076, 0x00a6, 0x00e6, 0x0096,
-	0x2071, 0x0260, 0x6114, 0x2150, 0x601c, 0xd0fc, 0x1110, 0x7644,
-	0x0008, 0x9036, 0xb676, 0x96b4, 0x0fff, 0xb77c, 0xc7e5, 0xb77e,
-	0x6210, 0x00b6, 0x2258, 0xba3c, 0x82ff, 0x0110, 0x8211, 0xba3e,
-	0x00be, 0x86ff, 0x0904, 0xafb0, 0x9694, 0xff00, 0x9284, 0x0c00,
-	0x0120, 0x7048, 0xb092, 0x704c, 0xb08e, 0x9284, 0x0300, 0x0904,
-	0xafb0, 0x9686, 0x0100, 0x1130, 0x7064, 0x9005, 0x1118, 0xc6c4,
-	0xb676, 0x0c38, 0x080c, 0x1022, 0x090c, 0x0d65, 0x2900, 0xb07a,
-	0xb77c, 0x97bd, 0x0200, 0xb77e, 0xa867, 0x0103, 0xb068, 0xa86a,
-	0xb06c, 0xa86e, 0xb070, 0xa872, 0x7044, 0x9084, 0xf000, 0x9635,
-	0xae76, 0x968c, 0x0c00, 0x0120, 0x7348, 0xab92, 0x734c, 0xab8e,
-	0x968c, 0x00ff, 0x9186, 0x0002, 0x0180, 0x9186, 0x0028, 0x1118,
-	0xa87b, 0x001c, 0x0060, 0xd6dc, 0x0118, 0xa87b, 0x0015, 0x0038,
-	0xd6d4, 0x0118, 0xa87b, 0x0007, 0x0010, 0xa87b, 0x0000, 0xaf7e,
-	0xb080, 0xa882, 0xb084, 0xa886, 0x901e, 0xd6c4, 0x0190, 0x735c,
-	0xab86, 0x83ff, 0x0170, 0x938a, 0x0009, 0x0210, 0x2019, 0x0008,
-	0x0036, 0x2308, 0x2019, 0x0018, 0x2011, 0x0025, 0x080c, 0xb41a,
-	0x003e, 0xd6cc, 0x01e8, 0x7154, 0xa98a, 0x81ff, 0x01c8, 0x9192,
-	0x0021, 0x1260, 0x8304, 0x9098, 0x0018, 0x2011, 0x0029, 0x080c,
-	0xb41a, 0x2011, 0x0205, 0x2013, 0x0000, 0x0050, 0xb068, 0xd0fc,
-	0x0120, 0x2009, 0x0020, 0xa98a, 0x0c68, 0x2950, 0x080c, 0xb3b9,
-	0x080c, 0x18f2, 0x009e, 0x00ee, 0x00ae, 0x007e, 0x0005, 0x2001,
-	0x1959, 0x2004, 0x604a, 0x0096, 0x6114, 0x2148, 0xa83c, 0xa940,
-	0x9105, 0x1118, 0xa87c, 0xc0dc, 0xa87e, 0x6003, 0x0002, 0x080c,
-	0xbf87, 0x0904, 0xb0f6, 0x604b, 0x0000, 0x6010, 0x00b6, 0x2058,
-	0xb800, 0x00be, 0xd0bc, 0x1500, 0xd1cc, 0x0904, 0xb0b5, 0xa978,
-	0xa868, 0xd0fc, 0x0904, 0xb076, 0x0016, 0xa87c, 0x0006, 0xa880,
-	0x0006, 0x00a6, 0x2150, 0xb174, 0x9184, 0x00ff, 0x90b6, 0x0002,
-	0x0904, 0xb044, 0x9086, 0x0028, 0x1904, 0xb030, 0xa87b, 0x001c,
-	0xb07b, 0x001c, 0x0804, 0xb04c, 0x6024, 0xd0f4, 0x11d0, 0xa838,
-	0xaa34, 0x9205, 0x09c8, 0xa838, 0xaa90, 0x9206, 0x1120, 0xa88c,
-	0xaa34, 0x9206, 0x0988, 0x6024, 0xd0d4, 0x1148, 0xa9ac, 0xa834,
-	0x9102, 0x603a, 0xa9b0, 0xa838, 0x9103, 0x603e, 0x6024, 0xc0f5,
-	0x6026, 0x6010, 0x00b6, 0x2058, 0xb83c, 0x8000, 0xb83e, 0x00be,
-	0x601c, 0xc0fc, 0x601e, 0x9006, 0xa876, 0xa892, 0xa88e, 0xa87c,
-	0xc0e4, 0xa87e, 0xd0cc, 0x0140, 0xc0cc, 0xa87e, 0x0096, 0xa878,
-	0x2048, 0x080c, 0x0fd4, 0x009e, 0x080c, 0xbb8c, 0x0804, 0xb0f6,
-	0xd1dc, 0x0158, 0xa87b, 0x0015, 0xb07b, 0x0015, 0x080c, 0xbe29,
-	0x0118, 0xb174, 0xc1dc, 0xb176, 0x0078, 0xd1d4, 0x0128, 0xa87b,
-	0x0007, 0xb07b, 0x0007, 0x0040, 0xa87c, 0xd0ac, 0x0128, 0xa834,
-	0xa938, 0x9115, 0x190c, 0xaec2, 0xa87c, 0xb07e, 0xa890, 0xb092,
-	0xa88c, 0xb08e, 0xa860, 0x20e8, 0xa85c, 0x9080, 0x0019, 0x20a0,
-	0x20a9, 0x0020, 0x8a06, 0x8006, 0x8007, 0x9094, 0x003f, 0x22e0,
-	0x9084, 0xffc0, 0x9080, 0x0019, 0x2098, 0x4003, 0x00ae, 0x000e,
-	0xa882, 0x000e, 0xa87e, 0x080c, 0xbf06, 0x001e, 0xa874, 0x0006,
-	0x2148, 0x080c, 0x0fd4, 0x001e, 0x0804, 0xb0e2, 0x0016, 0x00a6,
-	0x2150, 0xb174, 0x9184, 0x00ff, 0x90b6, 0x0002, 0x01e0, 0x9086,
-	0x0028, 0x1128, 0xa87b, 0x001c, 0xb07b, 0x001c, 0x00e0, 0xd1dc,
-	0x0158, 0xa87b, 0x0015, 0xb07b, 0x0015, 0x080c, 0xbe29, 0x0118,
-	0xb174, 0xc1dc, 0xb176, 0x0078, 0xd1d4, 0x0128, 0xa87b, 0x0007,
-	0xb07b, 0x0007, 0x0040, 0xa87c, 0xd0ac, 0x0128, 0xa834, 0xa938,
-	0x9115, 0x190c, 0xaec2, 0xa890, 0xb092, 0xa88c, 0xb08e, 0xa87c,
-	0xb07e, 0x00ae, 0x080c, 0x0fd4, 0x009e, 0x080c, 0xbf06, 0xa974,
-	0x0016, 0x080c, 0xb40a, 0x001e, 0x0468, 0xa867, 0x0103, 0xa974,
-	0x9184, 0x00ff, 0x90b6, 0x0002, 0x01b0, 0x9086, 0x0028, 0x1118,
-	0xa87b, 0x001c, 0x00d0, 0xd1dc, 0x0148, 0xa87b, 0x0015, 0x080c,
-	0xbe29, 0x0118, 0xa974, 0xc1dc, 0xa976, 0x0078, 0xd1d4, 0x0118,
-	0xa87b, 0x0007, 0x0050, 0xa87b, 0x0000, 0xa87c, 0xd0ac, 0x0128,
-	0xa834, 0xa938, 0x9115, 0x190c, 0xaec2, 0xa974, 0x0016, 0x080c,
-	0x67ac, 0x001e, 0x6010, 0x00b6, 0x2058, 0xba3c, 0x82ff, 0x0110,
-	0x8211, 0xba3e, 0xb8c0, 0x9005, 0x0120, 0x0016, 0x080c, 0x639b,
-	0x001e, 0x00be, 0xd1e4, 0x1120, 0x080c, 0x9be7, 0x009e, 0x0005,
-	0x080c, 0xbb4f, 0x0cd8, 0x6114, 0x0096, 0x2148, 0xa97c, 0x080c,
-	0xbf87, 0x190c, 0x1900, 0x009e, 0x0005, 0x0096, 0x6114, 0x2148,
-	0xa83c, 0xa940, 0x9105, 0x01e8, 0xa877, 0x0000, 0xa87b, 0x0000,
-	0xa867, 0x0103, 0x00b6, 0x6010, 0x2058, 0xa834, 0xa938, 0x9115,
-	0x11a0, 0x080c, 0x67ac, 0xba3c, 0x8211, 0x0208, 0xba3e, 0xb8c0,
-	0x9005, 0x0110, 0x080c, 0x639b, 0x080c, 0x9be7, 0x00be, 0x009e,
-	0x0005, 0xa87c, 0xc0dc, 0xa87e, 0x08f8, 0xb800, 0xd0bc, 0x1120,
-	0xa834, 0x080c, 0xaec2, 0x0c28, 0xa880, 0xd0bc, 0x1dc8, 0x080c,
-	0xbb8c, 0x0c60, 0x080c, 0x8874, 0x0010, 0x080c, 0x88d1, 0x601c,
-	0xd084, 0x0110, 0x080c, 0x1914, 0x080c, 0xb847, 0x01f0, 0x0096,
-	0x6114, 0x2148, 0x080c, 0xba5c, 0x1118, 0x080c, 0xa58f, 0x00a0,
-	0xa867, 0x0103, 0x2009, 0x180c, 0x210c, 0xd18c, 0x1198, 0xd184,
-	0x1170, 0x6108, 0xa97a, 0x918e, 0x0029, 0x1110, 0x080c, 0xd51a,
-	0xa877, 0x0000, 0x080c, 0x6996, 0x009e, 0x0804, 0x9c21, 0xa87b,
-	0x0004, 0x0cb0, 0xa87b, 0x0004, 0x0c98, 0x9182, 0x0057, 0x1220,
-	0x9182, 0x0040, 0x0208, 0x000a, 0x0005, 0xb18c, 0xb18c, 0xb18c,
-	0xb18c, 0xb18c, 0xb18e, 0xb18c, 0xb18c, 0xb18c, 0xb18c, 0xb18c,
-	0xb18c, 0xb18c, 0xb18c, 0xb18c, 0xb18c, 0xb18c, 0xb18c, 0xb18c,
-	0xb18c, 0xb1b2, 0xb18c, 0xb18c, 0x080c, 0x0d65, 0x080c, 0x5395,
-	0x01f8, 0x6014, 0x7144, 0x918c, 0x0fff, 0x9016, 0xd1c4, 0x0118,
-	0x7264, 0x9294, 0x00ff, 0x0096, 0x904d, 0x0188, 0xa87b, 0x0000,
-	0xa864, 0x9086, 0x0139, 0x0128, 0xa867, 0x0103, 0xa976, 0xaa96,
-	0x0030, 0xa897, 0x4000, 0xa99a, 0xaa9e, 0x080c, 0x6996, 0x009e,
-	0x0804, 0x9be7, 0x080c, 0x5395, 0x0dd8, 0x6014, 0x900e, 0x9016,
-	0x0c10, 0x9182, 0x0085, 0x0002, 0xb1cb, 0xb1c9, 0xb1c9, 0xb1d7,
-	0xb1c9, 0xb1c9, 0xb1c9, 0xb1c9, 0xb1c9, 0xb1c9, 0xb1c9, 0xb1c9,
-	0xb1c9, 0x080c, 0x0d65, 0x6003, 0x0001, 0x6106, 0x0126, 0x2091,
-	0x8000, 0x2009, 0x8020, 0x080c, 0x84d1, 0x012e, 0x0005, 0x0026,
-	0x0056, 0x00d6, 0x00e6, 0x2071, 0x0260, 0x7224, 0x6216, 0x7220,
-	0x080c, 0xb835, 0x01a0, 0x2268, 0x6800, 0x9086, 0x0000, 0x0178,
-	0x6010, 0x6d10, 0x952e, 0x1158, 0x00c6, 0x2d60, 0x080c, 0xb445,
-	0x00ce, 0x0128, 0x6803, 0x0002, 0x6007, 0x0086, 0x0010, 0x6007,
-	0x0087, 0x6003, 0x0001, 0x2009, 0x8020, 0x080c, 0x84d1, 0x9280,
-	0x0004, 0x00b6, 0x2058, 0xb800, 0x00be, 0xd0bc, 0x0140, 0x6824,
-	0xd0ec, 0x0128, 0x00c6, 0x2260, 0x080c, 0xbb8c, 0x00ce, 0x00ee,
-	0x00de, 0x005e, 0x002e, 0x0005, 0x9186, 0x0013, 0x1160, 0x6004,
-	0x908a, 0x0085, 0x0a0c, 0x0d65, 0x908a, 0x0092, 0x1a0c, 0x0d65,
-	0x9082, 0x0085, 0x00e2, 0x9186, 0x0027, 0x0120, 0x9186, 0x0014,
-	0x190c, 0x0d65, 0x080c, 0x8874, 0x0096, 0x6014, 0x2048, 0x080c,
-	0xb847, 0x0140, 0xa867, 0x0103, 0xa877, 0x0000, 0xa87b, 0x0029,
-	0x080c, 0x6996, 0x009e, 0x080c, 0x9c21, 0x0804, 0x8936, 0xb24c,
-	0xb24e, 0xb24e, 0xb24c, 0xb24c, 0xb24c, 0xb24c, 0xb24c, 0xb24c,
-	0xb24c, 0xb24c, 0xb24c, 0xb24c, 0x080c, 0x0d65, 0x080c, 0x9c21,
-	0x0005, 0x9186, 0x0013, 0x1130, 0x6004, 0x9082, 0x0085, 0x2008,
-	0x0804, 0xb29d, 0x9186, 0x0027, 0x1558, 0x080c, 0x8874, 0x080c,
-	0x3006, 0x080c, 0xbf76, 0x0096, 0x6014, 0x2048, 0x080c, 0xb847,
-	0x0150, 0xa867, 0x0103, 0xa877, 0x0000, 0xa87b, 0x0029, 0x080c,
-	0x6996, 0x080c, 0xba36, 0x009e, 0x080c, 0x9be7, 0x0005, 0x9186,
-	0x0089, 0x0118, 0x9186, 0x008a, 0x1140, 0x080c, 0x9ab7, 0x0128,
-	0x9086, 0x000c, 0x0904, 0xb2d5, 0x0000, 0x080c, 0x9ca2, 0x0c70,
-	0x9186, 0x0014, 0x1d60, 0x080c, 0x8874, 0x0096, 0x6014, 0x2048,
-	0x080c, 0xb847, 0x0d00, 0xa867, 0x0103, 0xa877, 0x0000, 0xa87b,
-	0x0006, 0xa880, 0xc0ec, 0xa882, 0x0890, 0x0002, 0xb2ad, 0xb2ab,
-	0xb2ab, 0xb2ab, 0xb2ab, 0xb2ab, 0xb2c1, 0xb2ab, 0xb2ab, 0xb2ab,
-	0xb2ab, 0xb2ab, 0xb2ab, 0x080c, 0x0d65, 0x6034, 0x908c, 0xff00,
-	0x810f, 0x9186, 0x0039, 0x0118, 0x9186, 0x0035, 0x1118, 0x2001,
-	0x1957, 0x0010, 0x2001, 0x1958, 0x2004, 0x601a, 0x6003, 0x000c,
-	0x0005, 0x6034, 0x908c, 0xff00, 0x810f, 0x9186, 0x0039, 0x0118,
-	0x9186, 0x0035, 0x1118, 0x2001, 0x1957, 0x0010, 0x2001, 0x1958,
-	0x2004, 0x601a, 0x6003, 0x000e, 0x0005, 0x9182, 0x0092, 0x1220,
-	0x9182, 0x0085, 0x0208, 0x0012, 0x0804, 0x9ca2, 0xb2eb, 0xb2eb,
-	0xb2eb, 0xb2eb, 0xb2ed, 0xb33a, 0xb2eb, 0xb2eb, 0xb2eb, 0xb2eb,
-	0xb2eb, 0xb2eb, 0xb2eb, 0x080c, 0x0d65, 0x0096, 0x6010, 0x00b6,
-	0x2058, 0xb800, 0x00be, 0xd0bc, 0x0168, 0x6034, 0x908c, 0xff00,
-	0x810f, 0x9186, 0x0039, 0x0118, 0x9186, 0x0035, 0x1118, 0x009e,
-	0x0804, 0xb34e, 0x080c, 0xb847, 0x1118, 0x080c, 0xba36, 0x0068,
-	0x6014, 0x2048, 0x080c, 0xbf8d, 0x1110, 0x080c, 0xba36, 0xa867,
-	0x0103, 0x080c, 0xbf41, 0x080c, 0x6996, 0x00d6, 0x2c68, 0x080c,
-	0x9b91, 0x01d0, 0x6003, 0x0001, 0x6007, 0x001e, 0x600b, 0xffff,
-	0x2009, 0x026e, 0x210c, 0x613a, 0x2009, 0x026f, 0x210c, 0x613e,
-	0x6910, 0x6112, 0x080c, 0xbcdb, 0x695c, 0x615e, 0x6023, 0x0001,
-	0x2009, 0x8020, 0x080c, 0x84d1, 0x2d60, 0x00de, 0x080c, 0x9be7,
-	0x009e, 0x0005, 0x6010, 0x00b6, 0x2058, 0xb800, 0x00be, 0xd0bc,
-	0x05a0, 0x6034, 0x908c, 0xff00, 0x810f, 0x9186, 0x0035, 0x0130,
-	0x9186, 0x001e, 0x0118, 0x9186, 0x0039, 0x1538, 0x00d6, 0x2c68,
-	0x080c, 0xbed9, 0x11f0, 0x080c, 0x9b91, 0x01d8, 0x6106, 0x6003,
-	0x0001, 0x6023, 0x0001, 0x6910, 0x6112, 0x692c, 0x612e, 0x6930,
-	0x6132, 0x6934, 0x918c, 0x00ff, 0x6136, 0x6938, 0x613a, 0x693c,
-	0x613e, 0x695c, 0x615e, 0x080c, 0xbcdb, 0x2009, 0x8020, 0x080c,
-	0x84d1, 0x2d60, 0x00de, 0x0804, 0x9be7, 0x0096, 0x6014, 0x2048,
-	0x080c, 0xb847, 0x01c8, 0xa867, 0x0103, 0xa880, 0xd0b4, 0x0128,
-	0xc0ec, 0xa882, 0xa87b, 0x0006, 0x0048, 0xd0bc, 0x0118, 0xa87b,
-	0x0002, 0x0020, 0xa87b, 0x0005, 0x080c, 0xbb4b, 0xa877, 0x0000,
-	0x080c, 0x6996, 0x080c, 0xba36, 0x009e, 0x0804, 0x9be7, 0x0016,
-	0x0096, 0x6014, 0x2048, 0x080c, 0xb847, 0x0140, 0xa867, 0x0103,
-	0xa87b, 0x0028, 0xa877, 0x0000, 0x080c, 0x6996, 0x009e, 0x001e,
-	0x9186, 0x0013, 0x0158, 0x9186, 0x0014, 0x0130, 0x9186, 0x0027,
-	0x0118, 0x080c, 0x9ca2, 0x0020, 0x080c, 0x8874, 0x080c, 0x9c21,
-	0x0005, 0x0056, 0x0066, 0x0096, 0x00a6, 0x2029, 0x0001, 0x9182,
-	0x0101, 0x1208, 0x0010, 0x2009, 0x0100, 0x2130, 0x8304, 0x9098,
-	0x0018, 0x2009, 0x0020, 0x2011, 0x0029, 0x080c, 0xb41a, 0x96b2,
-	0x0020, 0xb004, 0x904d, 0x0110, 0x080c, 0x0fd4, 0x080c, 0x1022,
-	0x0520, 0x8528, 0xa867, 0x0110, 0xa86b, 0x0000, 0x2920, 0xb406,
-	0x968a, 0x003d, 0x1228, 0x2608, 0x2011, 0x001b, 0x0499, 0x00a8,
-	0x96b2, 0x003c, 0x2009, 0x003c, 0x2950, 0x2011, 0x001b, 0x0451,
-	0x0c28, 0x2001, 0x0205, 0x2003, 0x0000, 0x00ae, 0x852f, 0x95ad,
-	0x0003, 0xb566, 0x95ac, 0x0000, 0x0048, 0x2001, 0x0205, 0x2003,
-	0x0000, 0x00ae, 0x852f, 0x95ad, 0x0003, 0xb566, 0x009e, 0x006e,
-	0x005e, 0x0005, 0x00a6, 0x89ff, 0x0158, 0xa804, 0x9055, 0x0130,
-	0xa807, 0x0000, 0x080c, 0x6996, 0x2a48, 0x0cb8, 0x080c, 0x6996,
-	0x00ae, 0x0005, 0x00f6, 0x2079, 0x0200, 0x7814, 0x9085, 0x0080,
-	0x7816, 0xd184, 0x0108, 0x8108, 0x810c, 0x20a9, 0x0001, 0xa860,
-	0x20e8, 0xa85c, 0x9200, 0x20a0, 0x20e1, 0x0000, 0x2300, 0x9e00,
-	0x2098, 0x4003, 0x8318, 0x9386, 0x0020, 0x1148, 0x2018, 0x2300,
-	0x9e00, 0x2098, 0x7814, 0x8000, 0x9085, 0x0080, 0x7816, 0x8109,
-	0x1d80, 0x7817, 0x0000, 0x00fe, 0x0005, 0x0066, 0x0126, 0x2091,
-	0x8000, 0x2031, 0x0001, 0x6020, 0x9084, 0x000f, 0x0083, 0x012e,
-	0x006e, 0x0005, 0x0126, 0x2091, 0x8000, 0x0066, 0x2031, 0x0000,
-	0x6020, 0x9084, 0x000f, 0x001b, 0x006e, 0x012e, 0x0005, 0xb497,
-	0xb497, 0xb492, 0xb4bb, 0xb46f, 0xb492, 0xb471, 0xb492, 0xb46f,
-	0xb46f, 0xb492, 0xb492, 0xb492, 0xb46f, 0xb46f, 0xb46f, 0x080c,
-	0x0d65, 0x6010, 0x9080, 0x0000, 0x2004, 0xd0bc, 0x190c, 0xb4bb,
-	0x0036, 0x6014, 0x0096, 0x2048, 0xa880, 0x009e, 0xd0cc, 0x0118,
-	0x2019, 0x000c, 0x0038, 0xd094, 0x0118, 0x2019, 0x000d, 0x0010,
-	0x2019, 0x0010, 0x080c, 0xcdf9, 0x6023, 0x0006, 0x6003, 0x0007,
-	0x003e, 0x0005, 0x9006, 0x0005, 0x9085, 0x0001, 0x0005, 0x0096,
-	0x86ff, 0x11e8, 0x6014, 0x2048, 0x080c, 0xb847, 0x01d0, 0x6043,
-	0xffff, 0xa864, 0x9086, 0x0139, 0x1128, 0xa87b, 0x0005, 0xa883,
-	0x0000, 0x0028, 0x900e, 0x2001, 0x0005, 0x080c, 0x6bb3, 0x080c,
-	0xbb4b, 0x080c, 0x698a, 0x080c, 0x9c21, 0x9085, 0x0001, 0x009e,
-	0x0005, 0x9006, 0x0ce0, 0x080c, 0x98c8, 0x080c, 0xbf9b, 0x6000,
-	0x908a, 0x0016, 0x1a0c, 0x0d65, 0x002b, 0x0106, 0x080c, 0x98e4,
-	0x010e, 0x0005, 0xb4da, 0xb508, 0xb4dc, 0xb52f, 0xb503, 0xb4da,
-	0xb492, 0xb497, 0xb497, 0xb492, 0xb492, 0xb492, 0xb492, 0xb492,
-	0xb492, 0xb492, 0x080c, 0x0d65, 0x86ff, 0x1510, 0x6020, 0x9086,
-	0x0006, 0x01f0, 0x0096, 0x6014, 0x2048, 0x080c, 0xb847, 0x0158,
-	0xa87c, 0xd0cc, 0x0130, 0x0096, 0xa878, 0x2048, 0x080c, 0x0fd4,
-	0x009e, 0x080c, 0xbb4b, 0x009e, 0x080c, 0xbf1b, 0x6007, 0x0085,
+	0x0005, 0x7057, 0x1ddc, 0x0cc0, 0x9006, 0x0cc0, 0x6020, 0x9084,
+	0x000f, 0x0002, 0x9c8a, 0x9c94, 0x9caf, 0x9cca, 0xbfb4, 0xbfd1,
+	0xbfec, 0x9c8a, 0x9c94, 0x9c8a, 0x9ce6, 0x9c8a, 0x9c8a, 0x9c8a,
+	0x9c8a, 0x9c8a, 0x9186, 0x0013, 0x1130, 0x6044, 0xd0fc, 0x0110,
+	0x080c, 0x885d, 0x0005, 0x0005, 0x0066, 0x6000, 0x90b2, 0x0016,
+	0x1a0c, 0x0d65, 0x0013, 0x006e, 0x0005, 0x9cad, 0xa3f6, 0xa5c8,
+	0x9cad, 0xa656, 0x9faf, 0x9cad, 0x9cad, 0xa378, 0xabfd, 0x9cad,
+	0x9cad, 0x9cad, 0x9cad, 0x9cad, 0x9cad, 0x080c, 0x0d65, 0x0066,
+	0x6000, 0x90b2, 0x0016, 0x1a0c, 0x0d65, 0x0013, 0x006e, 0x0005,
+	0x9cc8, 0xb202, 0x9cc8, 0x9cc8, 0x9cc8, 0x9cc8, 0x9cc8, 0x9cc8,
+	0xb1a7, 0xb385, 0x9cc8, 0xb23f, 0xb2c3, 0xb23f, 0xb2c3, 0x9cc8,
+	0x080c, 0x0d65, 0x6000, 0x9082, 0x0016, 0x1a0c, 0x0d65, 0x6000,
+	0x0002, 0x9ce4, 0xac47, 0xacde, 0xae5e, 0xaecd, 0x9ce4, 0x9ce4,
+	0x9ce4, 0xac16, 0xb128, 0xb12b, 0x9ce4, 0x9ce4, 0x9ce4, 0x9ce4,
+	0xb15b, 0x9ce4, 0x9ce4, 0x9ce4, 0x080c, 0x0d65, 0x0066, 0x6000,
+	0x90b2, 0x0016, 0x1a0c, 0x0d65, 0x0013, 0x006e, 0x0005, 0x9cff,
+	0x9cff, 0x9d3d, 0x9ddc, 0x9e5c, 0x9cff, 0x9cff, 0x9cff, 0x9d01,
+	0x9cff, 0x9cff, 0x9cff, 0x9cff, 0x9cff, 0x9cff, 0x9cff, 0x080c,
+	0x0d65, 0x9186, 0x004c, 0x0560, 0x9186, 0x0003, 0x190c, 0x0d65,
+	0x0096, 0x601c, 0xc0ed, 0x601e, 0x6003, 0x0003, 0x6106, 0x6014,
+	0x2048, 0xa87c, 0x9084, 0xa000, 0xc0b5, 0xa87e, 0xa8ac, 0xa836,
+	0xa8b0, 0xa83a, 0x9006, 0xa846, 0xa84a, 0xa884, 0x9092, 0x199a,
+	0x0210, 0x2001, 0x1999, 0x8003, 0x8013, 0x8213, 0x9210, 0x621a,
+	0x009e, 0x080c, 0x1a71, 0x2009, 0x8030, 0x080c, 0x84fa, 0x0005,
+	0x6010, 0x00b6, 0x2058, 0xbca0, 0x00be, 0x2c00, 0x080c, 0x9e7e,
+	0x080c, 0xbf79, 0x6003, 0x0007, 0x0005, 0x00d6, 0x0096, 0x00f6,
+	0x2079, 0x1800, 0x7a8c, 0x6014, 0x2048, 0xa87c, 0xd0ec, 0x1110,
+	0x9290, 0x0018, 0xac78, 0xc4fc, 0x0046, 0xa8e0, 0x9005, 0x1140,
+	0xa8dc, 0x921a, 0x0140, 0x0220, 0xa87b, 0x0007, 0x2010, 0x0028,
+	0xa87b, 0x0015, 0x0010, 0xa87b, 0x0000, 0x8214, 0xa883, 0x0000,
+	0xaa02, 0x0006, 0x0016, 0x0026, 0x00c6, 0x00d6, 0x00e6, 0x00f6,
+	0x2400, 0x9005, 0x1108, 0x009a, 0x2100, 0x9086, 0x0015, 0x1118,
+	0x2001, 0x0001, 0x0038, 0x2100, 0x9086, 0x0016, 0x0118, 0x2001,
+	0x0001, 0x002a, 0x94a4, 0x0007, 0x8423, 0x9405, 0x0002, 0x9da4,
+	0x9da4, 0x9d9f, 0x9da2, 0x9da4, 0x9d9c, 0x9d8f, 0x9d8f, 0x9d8f,
+	0x9d8f, 0x9d8f, 0x9d8f, 0x9d8f, 0x9d8f, 0x9d8f, 0x9d8f, 0x00fe,
+	0x00ee, 0x00de, 0x00ce, 0x002e, 0x001e, 0x000e, 0x004e, 0x00fe,
+	0x009e, 0x00de, 0x080c, 0x0d65, 0x080c, 0xa839, 0x0028, 0x080c,
+	0xa95c, 0x0010, 0x080c, 0xaa4b, 0x00fe, 0x00ee, 0x00de, 0x00ce,
+	0x002e, 0x001e, 0x2c00, 0xa896, 0x000e, 0x080c, 0x9f3c, 0x0530,
+	0xa804, 0xa80e, 0x00a6, 0x2050, 0xb100, 0x00ae, 0x8006, 0x8006,
+	0x8007, 0x90bc, 0x003f, 0x9084, 0xffc0, 0x9080, 0x0002, 0xaacc,
+	0xabd0, 0xacd4, 0xadd8, 0x2031, 0x0000, 0x2041, 0x128b, 0x080c,
+	0xa0e7, 0x0160, 0x000e, 0x9005, 0x0120, 0x00fe, 0x009e, 0x00de,
+	0x0005, 0x00fe, 0x009e, 0x00de, 0x0804, 0x9bda, 0x2001, 0x002c,
+	0x900e, 0x080c, 0x9fa2, 0x0c70, 0x91b6, 0x0015, 0x0170, 0x91b6,
+	0x0016, 0x0158, 0x91b2, 0x0047, 0x0a0c, 0x0d65, 0x91b2, 0x0050,
+	0x1a0c, 0x0d65, 0x9182, 0x0047, 0x0042, 0x080c, 0x9aaa, 0x0120,
+	0x9086, 0x0002, 0x0904, 0x9d3d, 0x0005, 0x9dfe, 0x9dfe, 0x9e00,
+	0x9e32, 0x9dfe, 0x9dfe, 0x9dfe, 0x9dfe, 0x9e45, 0x080c, 0x0d65,
+	0x00d6, 0x0016, 0x0096, 0x6003, 0x0004, 0x6114, 0x2148, 0xa87c,
+	0xd0fc, 0x01c0, 0xa878, 0xc0fc, 0x9005, 0x1158, 0xa894, 0x9005,
+	0x0140, 0x2001, 0x0000, 0x900e, 0x080c, 0x9fa2, 0x080c, 0x9bda,
+	0x00a8, 0x6003, 0x0002, 0xa8a4, 0xa9a8, 0x9105, 0x1178, 0xa8ae,
+	0xa8b2, 0x0c78, 0xa87f, 0x0020, 0xa88c, 0xa88a, 0xa8a4, 0xa8ae,
+	0xa8a8, 0xa8b2, 0xa8c7, 0x0000, 0xa8cb, 0x0000, 0x009e, 0x001e,
+	0x00de, 0x0005, 0x080c, 0x88b8, 0x00d6, 0x0096, 0x6114, 0x2148,
+	0x080c, 0xb842, 0x0120, 0xa87b, 0x0006, 0x080c, 0x6991, 0x009e,
+	0x00de, 0x080c, 0x9bda, 0x0804, 0x891b, 0x080c, 0x88b8, 0x080c,
+	0x300e, 0x080c, 0xbf76, 0x00d6, 0x0096, 0x6114, 0x2148, 0x080c,
+	0xb842, 0x0120, 0xa87b, 0x0029, 0x080c, 0x6991, 0x009e, 0x00de,
+	0x080c, 0x9bda, 0x0804, 0x891b, 0x9182, 0x0047, 0x0002, 0x9e6c,
+	0x9e6e, 0x9e6c, 0x9e6c, 0x9e6c, 0x9e6c, 0x9e6c, 0x9e6c, 0x9e6c,
+	0x9e6c, 0x9e6c, 0x9e6c, 0x9e6e, 0x080c, 0x0d65, 0x00d6, 0x0096,
+	0x080c, 0x15a2, 0x6114, 0x2148, 0xa87b, 0x0000, 0xa883, 0x0000,
+	0x080c, 0x6991, 0x009e, 0x00de, 0x0804, 0x9bda, 0x0026, 0x0036,
+	0x0056, 0x0066, 0x0096, 0x00a6, 0x00f6, 0x0006, 0x080c, 0x1022,
+	0x000e, 0x090c, 0x0d65, 0xa960, 0x21e8, 0xa95c, 0x9188, 0x0019,
+	0x21a0, 0x900e, 0x20a9, 0x0020, 0x4104, 0xa87a, 0x2079, 0x1800,
+	0x798c, 0x9188, 0x0018, 0x918c, 0x0fff, 0xa972, 0xac76, 0x2950,
+	0x00a6, 0x2001, 0x0205, 0x2003, 0x0000, 0x901e, 0x2029, 0x0001,
+	0x9182, 0x0034, 0x1228, 0x2011, 0x001f, 0x080c, 0xb408, 0x04c0,
+	0x2130, 0x2009, 0x0034, 0x2011, 0x001f, 0x080c, 0xb408, 0x96b2,
+	0x0034, 0xb004, 0x904d, 0x0110, 0x080c, 0x0fd4, 0x080c, 0x1022,
+	0x01d0, 0x8528, 0xa867, 0x0110, 0xa86b, 0x0000, 0x2920, 0xb406,
+	0x968a, 0x003d, 0x1230, 0x2608, 0x2011, 0x001b, 0x080c, 0xb408,
+	0x00b8, 0x96b2, 0x003c, 0x2009, 0x003c, 0x2950, 0x2011, 0x001b,
+	0x080c, 0xb408, 0x0c18, 0x2001, 0x0205, 0x2003, 0x0000, 0x00ae,
+	0x852f, 0x95ad, 0x0050, 0xb566, 0xb070, 0xc0fd, 0xb072, 0x0048,
+	0x2001, 0x0205, 0x2003, 0x0000, 0x00ae, 0x852f, 0x95ad, 0x0050,
+	0xb566, 0x2a48, 0xa804, 0xa807, 0x0000, 0x0006, 0x080c, 0x6991,
+	0x000e, 0x2048, 0x9005, 0x1db0, 0x00fe, 0x00ae, 0x009e, 0x006e,
+	0x005e, 0x003e, 0x002e, 0x0005, 0x00d6, 0x00f6, 0x0096, 0x0006,
+	0x080c, 0x1022, 0x000e, 0x090c, 0x0d65, 0xa960, 0x21e8, 0xa95c,
+	0x9188, 0x0019, 0x21a0, 0x900e, 0x20a9, 0x0020, 0x4104, 0xaa66,
+	0xa87a, 0x2079, 0x1800, 0x798c, 0x810c, 0x9188, 0x000c, 0x9182,
+	0x001a, 0x0210, 0x2009, 0x001a, 0x21a8, 0x810b, 0xa972, 0xac76,
+	0x2e98, 0xa85c, 0x9080, 0x001f, 0x20a0, 0x2001, 0x0205, 0x200c,
+	0x918d, 0x0080, 0x2102, 0x4003, 0x2003, 0x0000, 0x080c, 0x6991,
+	0x009e, 0x00fe, 0x00de, 0x0005, 0x0016, 0x00d6, 0x00f6, 0x0096,
+	0x0016, 0x2001, 0x0205, 0x200c, 0x918d, 0x0080, 0x2102, 0x001e,
+	0x2079, 0x0200, 0x2e98, 0xa87c, 0xd0ec, 0x0118, 0x9e80, 0x000c,
+	0x2098, 0x2021, 0x003e, 0x901e, 0x9282, 0x0020, 0x0218, 0x2011,
+	0x0020, 0x2018, 0x9486, 0x003e, 0x1170, 0x0096, 0x080c, 0x1022,
+	0x2900, 0x009e, 0x05c0, 0xa806, 0x2048, 0xa860, 0x20e8, 0xa85c,
+	0x9080, 0x0002, 0x20a0, 0x3300, 0x908e, 0x0260, 0x0140, 0x2009,
+	0x0280, 0x9102, 0x920a, 0x0218, 0x2010, 0x2100, 0x9318, 0x2200,
+	0x9402, 0x1228, 0x2400, 0x9202, 0x2410, 0x9318, 0x9006, 0x2020,
+	0x22a8, 0xa800, 0x9200, 0xa802, 0x20e1, 0x0000, 0x4003, 0x83ff,
+	0x0180, 0x3300, 0x9086, 0x0280, 0x1130, 0x7814, 0x8000, 0x9085,
+	0x0080, 0x7816, 0x2e98, 0x2310, 0x84ff, 0x0904, 0x9f51, 0x0804,
+	0x9f53, 0x9085, 0x0001, 0x7817, 0x0000, 0x009e, 0x00fe, 0x00de,
+	0x001e, 0x0005, 0x00d6, 0x0036, 0x0096, 0x6314, 0x2348, 0xa87a,
+	0xa982, 0x080c, 0x6985, 0x009e, 0x003e, 0x00de, 0x0005, 0x91b6,
+	0x0015, 0x1118, 0x080c, 0x9bda, 0x0030, 0x91b6, 0x0016, 0x190c,
+	0x0d65, 0x080c, 0x9bda, 0x0005, 0x20a9, 0x000e, 0x20e1, 0x0000,
+	0x2e98, 0x6014, 0x0096, 0x2048, 0xa860, 0x20e8, 0xa85c, 0x20a0,
+	0x009e, 0x4003, 0x0136, 0x9080, 0x001b, 0x20a0, 0x2011, 0x0006,
+	0x20a9, 0x0001, 0x3418, 0x8318, 0x23a0, 0x4003, 0x3318, 0x8318,
+	0x2398, 0x8211, 0x1db8, 0x2011, 0x0006, 0x013e, 0x20a0, 0x3318,
+	0x8318, 0x2398, 0x4003, 0x3418, 0x8318, 0x23a0, 0x8211, 0x1db8,
+	0x0096, 0x080c, 0xb842, 0x0130, 0x6014, 0x2048, 0xa807, 0x0000,
+	0xa867, 0x0103, 0x009e, 0x0804, 0x9bda, 0x0096, 0x00d6, 0x0036,
+	0x7330, 0x9386, 0x0200, 0x11a8, 0x6010, 0x00b6, 0x2058, 0xb8c7,
+	0x0000, 0x00be, 0x6014, 0x9005, 0x0130, 0x2048, 0xa807, 0x0000,
+	0xa867, 0x0103, 0xab32, 0x080c, 0x9bda, 0x003e, 0x00de, 0x009e,
+	0x0005, 0x0011, 0x1d48, 0x0cc8, 0x0006, 0x0016, 0x080c, 0xbf61,
+	0x0188, 0x6014, 0x9005, 0x1170, 0x600b, 0x0003, 0x601b, 0x0000,
+	0x604b, 0x0000, 0x2009, 0x0022, 0x080c, 0xa3ce, 0x9006, 0x001e,
+	0x000e, 0x0005, 0x9085, 0x0001, 0x0cd0, 0x0096, 0x0016, 0x20a9,
+	0x0014, 0x9e80, 0x000c, 0x20e1, 0x0000, 0x2098, 0x6014, 0x2048,
+	0xa860, 0x20e8, 0xa85c, 0x9080, 0x0002, 0x20a0, 0x4003, 0x2001,
+	0x0205, 0x2003, 0x0001, 0x2099, 0x0260, 0x20a9, 0x0016, 0x4003,
+	0x20a9, 0x000a, 0xa804, 0x2048, 0xa860, 0x20e8, 0xa85c, 0x9080,
+	0x0002, 0x20a0, 0x4003, 0x2001, 0x0205, 0x2003, 0x0002, 0x2099,
+	0x0260, 0x20a9, 0x0020, 0x4003, 0x2003, 0x0000, 0x6014, 0x2048,
+	0xa800, 0x2048, 0xa867, 0x0103, 0x080c, 0x9bda, 0x001e, 0x009e,
+	0x0005, 0x0096, 0x0016, 0x900e, 0x7030, 0x9086, 0x0100, 0x0140,
+	0x7038, 0x9084, 0x00ff, 0x800c, 0x703c, 0x9084, 0x00ff, 0x8004,
+	0x9080, 0x0004, 0x9108, 0x810b, 0x2011, 0x0002, 0x2019, 0x000c,
+	0x6014, 0x2048, 0x080c, 0xb408, 0x080c, 0xb842, 0x0140, 0x6014,
+	0x2048, 0xa807, 0x0000, 0xa864, 0xa8e2, 0xa867, 0x0103, 0x080c,
+	0x9bda, 0x001e, 0x009e, 0x0005, 0x0016, 0x0096, 0x7030, 0x9086,
+	0x0100, 0x1118, 0x2009, 0x0004, 0x0010, 0x7034, 0x800c, 0x810b,
+	0x2011, 0x000c, 0x2019, 0x000c, 0x6014, 0x2048, 0xa804, 0x0096,
+	0x9005, 0x0108, 0x2048, 0x080c, 0xb408, 0x009e, 0x080c, 0xb842,
+	0x0148, 0xa804, 0x9005, 0x1158, 0xa807, 0x0000, 0xa864, 0xa8e2,
+	0xa867, 0x0103, 0x080c, 0x9bda, 0x009e, 0x001e, 0x0005, 0x0086,
+	0x2040, 0xa030, 0x8007, 0x9086, 0x0100, 0x1118, 0x080c, 0xa581,
+	0x00e0, 0xa034, 0x8007, 0x800c, 0x8806, 0x8006, 0x8007, 0x90bc,
+	0x003f, 0x9084, 0xffc0, 0x9080, 0x000c, 0xa87b, 0x0000, 0xa883,
+	0x0000, 0xa897, 0x4000, 0xaaa0, 0xab9c, 0xaca8, 0xada4, 0x2031,
+	0x0000, 0x2041, 0x1271, 0x0019, 0x0d08, 0x008e, 0x0898, 0x0096,
+	0x0006, 0x080c, 0x1022, 0x000e, 0x01b0, 0xa8ab, 0x0dcb, 0xa876,
+	0x000e, 0xa8a2, 0x0006, 0xae6a, 0x2800, 0xa89e, 0xa97a, 0xaf72,
+	0xaa8e, 0xab92, 0xac96, 0xad9a, 0x0086, 0x2940, 0x080c, 0x1117,
+	0x008e, 0x9085, 0x0001, 0x009e, 0x0005, 0x00e6, 0x00d6, 0x0026,
+	0x7008, 0x9084, 0x00ff, 0x6210, 0x00b6, 0x2258, 0xba10, 0x00be,
+	0x9206, 0x1520, 0x700c, 0x6210, 0x00b6, 0x2258, 0xba14, 0x00be,
+	0x9206, 0x11e0, 0x604b, 0x0000, 0x2c68, 0x0016, 0x2009, 0x0035,
+	0x080c, 0xbed9, 0x001e, 0x1158, 0x622c, 0x2268, 0x2071, 0x026c,
+	0x6b20, 0x9386, 0x0003, 0x0130, 0x9386, 0x0006, 0x0128, 0x080c,
+	0x9bda, 0x0020, 0x0039, 0x0010, 0x080c, 0xa203, 0x002e, 0x00de,
+	0x00ee, 0x0005, 0x0096, 0x6814, 0x2048, 0x9186, 0x0015, 0x0904,
+	0xa1e2, 0x918e, 0x0016, 0x1904, 0xa201, 0x700c, 0x908c, 0xff00,
+	0x9186, 0x1700, 0x0120, 0x9186, 0x0300, 0x1904, 0xa1bc, 0x89ff,
+	0x1138, 0x6800, 0x9086, 0x000f, 0x0904, 0xa19e, 0x0804, 0xa1ff,
+	0x6808, 0x9086, 0xffff, 0x1904, 0xa1e4, 0xa87c, 0x9084, 0x0060,
+	0x9086, 0x0020, 0x1128, 0xa83c, 0xa940, 0x9105, 0x1904, 0xa1e4,
+	0x6824, 0xd0b4, 0x1904, 0xa1e4, 0x080c, 0xba31, 0x6864, 0xa882,
+	0xa87c, 0xc0dc, 0xc0f4, 0xc0d4, 0xa87e, 0x0026, 0x900e, 0x6a18,
+	0x2001, 0x000a, 0x080c, 0x83fb, 0xa884, 0x920a, 0x0208, 0x8011,
+	0xaa86, 0x82ff, 0x002e, 0x1138, 0x00c6, 0x2d60, 0x080c, 0xb55b,
+	0x00ce, 0x0804, 0xa1ff, 0x00c6, 0xa868, 0xd0fc, 0x1118, 0x080c,
+	0x5d51, 0x0010, 0x080c, 0x60f6, 0x00ce, 0x1904, 0xa1e4, 0x00c6,
+	0x2d60, 0x080c, 0x9bda, 0x00ce, 0x0804, 0xa1ff, 0x00c6, 0x080c,
+	0x9c49, 0x0198, 0x6017, 0x0000, 0x6810, 0x6012, 0x080c, 0xbcdb,
+	0x6023, 0x0003, 0x6904, 0x00c6, 0x2d60, 0x080c, 0x9bda, 0x00ce,
+	0x080c, 0x9c76, 0x00ce, 0x0804, 0xa1ff, 0x2001, 0x1958, 0x2004,
+	0x684a, 0x00ce, 0x0804, 0xa1ff, 0x7008, 0x9086, 0x000b, 0x11c8,
+	0x6010, 0x00b6, 0x2058, 0xb900, 0xc1bc, 0xb902, 0x00be, 0x00c6,
+	0x2d60, 0xa87b, 0x0003, 0x080c, 0xbf1b, 0x6007, 0x0085, 0x6003,
+	0x000b, 0x6023, 0x0002, 0x2009, 0x8020, 0x080c, 0x84b3, 0x00ce,
+	0x0430, 0x700c, 0x9086, 0x2a00, 0x1138, 0x2001, 0x1958, 0x2004,
+	0x684a, 0x00e8, 0x04c1, 0x00e8, 0x89ff, 0x090c, 0x0d65, 0x00c6,
+	0x00d6, 0x2d60, 0xa867, 0x0103, 0xa87b, 0x0003, 0x080c, 0x67a7,
+	0x080c, 0xba31, 0x080c, 0x9c14, 0x0026, 0x6010, 0x00b6, 0x2058,
+	0xba3c, 0x080c, 0x6396, 0x00be, 0x002e, 0x00de, 0x00ce, 0x080c,
+	0x9bda, 0x009e, 0x0005, 0x9186, 0x0015, 0x1128, 0x2001, 0x1958,
+	0x2004, 0x684a, 0x0068, 0x918e, 0x0016, 0x1160, 0x00c6, 0x2d00,
+	0x2060, 0x080c, 0xd4df, 0x080c, 0x83a2, 0x080c, 0x9bda, 0x00ce,
+	0x080c, 0x9bda, 0x0005, 0x0026, 0x0036, 0x0046, 0x7228, 0xacb0,
+	0xabac, 0xd2f4, 0x0130, 0x2001, 0x1958, 0x2004, 0x684a, 0x0804,
+	0xa27d, 0x00c6, 0x2d60, 0x080c, 0xb433, 0x00ce, 0x6804, 0x9086,
+	0x0050, 0x1168, 0x00c6, 0x2d00, 0x2060, 0x6003, 0x0001, 0x6007,
+	0x0050, 0x2009, 0x8023, 0x080c, 0x84b3, 0x00ce, 0x04f0, 0x6800,
+	0x9086, 0x000f, 0x01a8, 0x89ff, 0x090c, 0x0d65, 0x6800, 0x9086,
+	0x0004, 0x1190, 0xa87c, 0xd0ac, 0x0178, 0xa843, 0x0fff, 0xa83f,
+	0x0fff, 0xa880, 0xc0fc, 0xa882, 0x2001, 0x0001, 0x6832, 0x0400,
+	0x2001, 0x0007, 0x6832, 0x00e0, 0xa87c, 0xd0b4, 0x1150, 0xd0ac,
+	0x0db8, 0x6824, 0xd0f4, 0x1d48, 0xa838, 0xa934, 0x9105, 0x0d80,
+	0x0c20, 0xd2ec, 0x1d68, 0x7024, 0x9306, 0x1118, 0x7020, 0x9406,
+	0x0d38, 0x7020, 0x683e, 0x7024, 0x683a, 0x2001, 0x0005, 0x6832,
+	0x080c, 0xbbc5, 0x080c, 0x891b, 0x0010, 0x080c, 0x9bda, 0x004e,
+	0x003e, 0x002e, 0x0005, 0x00e6, 0x00d6, 0x0026, 0x7008, 0x9084,
+	0x00ff, 0x6210, 0x00b6, 0x2258, 0xba10, 0x00be, 0x9206, 0x1904,
+	0xa2e8, 0x700c, 0x6210, 0x00b6, 0x2258, 0xba14, 0x00be, 0x9206,
+	0x1904, 0xa2e8, 0x6038, 0x2068, 0x6824, 0xc0dc, 0x6826, 0x6a20,
+	0x9286, 0x0007, 0x0904, 0xa2e8, 0x9286, 0x0002, 0x0904, 0xa2e8,
+	0x9286, 0x0000, 0x05e8, 0x6808, 0x633c, 0x9306, 0x15c8, 0x2071,
+	0x026c, 0x9186, 0x0015, 0x0570, 0x918e, 0x0016, 0x1100, 0x00c6,
+	0x6038, 0x2060, 0x6104, 0x9186, 0x004b, 0x01c0, 0x9186, 0x004c,
+	0x01a8, 0x9186, 0x004d, 0x0190, 0x9186, 0x004e, 0x0178, 0x9186,
+	0x0052, 0x0160, 0x6014, 0x0096, 0x2048, 0x080c, 0xb842, 0x090c,
+	0x0d65, 0xa87b, 0x0003, 0x009e, 0x080c, 0xbf1b, 0x6007, 0x0085,
 	0x6003, 0x000b, 0x6023, 0x0002, 0x2009, 0x8020, 0x080c, 0x84b3,
-	0x9085, 0x0001, 0x0005, 0x0066, 0x080c, 0x1914, 0x006e, 0x08a0,
-	0x00e6, 0x2071, 0x19b8, 0x7030, 0x9c06, 0x1120, 0x080c, 0x9206,
-	0x00ee, 0x0850, 0x6020, 0x9084, 0x000f, 0x9086, 0x0006, 0x1150,
-	0x0086, 0x0096, 0x2049, 0x0001, 0x2c40, 0x080c, 0x9382, 0x009e,
-	0x008e, 0x0040, 0x0066, 0x080c, 0x9102, 0x190c, 0x0d65, 0x080c,
-	0x9110, 0x006e, 0x00ee, 0x1904, 0xb4dc, 0x0804, 0xb492, 0x0036,
-	0x00e6, 0x2071, 0x19b8, 0x704c, 0x9c06, 0x1138, 0x901e, 0x080c,
-	0x9286, 0x00ee, 0x003e, 0x0804, 0xb4dc, 0x080c, 0x94b8, 0x00ee,
-	0x003e, 0x1904, 0xb4dc, 0x0804, 0xb492, 0x00c6, 0x0066, 0x6020,
-	0x9084, 0x000f, 0x001b, 0x006e, 0x00ce, 0x0005, 0xb565, 0xb627,
-	0xb78e, 0xb56d, 0x9c21, 0xb565, 0xcdeb, 0xbf83, 0xb627, 0xb55e,
-	0xb80d, 0xb55e, 0xb55e, 0xb55e, 0xb55e, 0xb55e, 0x080c, 0x0d65,
-	0x080c, 0xba5c, 0x1110, 0x080c, 0xa58f, 0x0005, 0x080c, 0x8874,
-	0x0804, 0x9be7, 0x601b, 0x0001, 0x0005, 0x080c, 0xb847, 0x0130,
-	0x6014, 0x0096, 0x2048, 0x2c00, 0xa896, 0x009e, 0x080c, 0x98c8,
-	0x080c, 0xbf9b, 0x6000, 0x908a, 0x0016, 0x1a0c, 0x0d65, 0x0013,
-	0x0804, 0x98e4, 0xb592, 0xb594, 0xb5be, 0xb5d2, 0xb5fd, 0xb592,
-	0xb565, 0xb565, 0xb565, 0xb5d9, 0xb5d9, 0xb592, 0xb592, 0xb592,
-	0xb592, 0xb5e3, 0x080c, 0x0d65, 0x00e6, 0x6014, 0x0096, 0x2048,
-	0xa880, 0xc0b5, 0xa882, 0x009e, 0x2071, 0x19b8, 0x7030, 0x9c06,
-	0x01d0, 0x0066, 0x080c, 0x9102, 0x190c, 0x0d65, 0x080c, 0x9110,
-	0x006e, 0x080c, 0xbf1b, 0x6007, 0x0085, 0x6003, 0x000b, 0x6023,
-	0x0002, 0x2001, 0x1958, 0x2004, 0x601a, 0x2009, 0x8020, 0x080c,
-	0x84b3, 0x00ee, 0x0005, 0x601b, 0x0001, 0x0cd8, 0x0096, 0x6014,
-	0x2048, 0xa880, 0xc0b5, 0xa882, 0x009e, 0x080c, 0xbf1b, 0x6007,
-	0x0085, 0x6003, 0x000b, 0x6023, 0x0002, 0x2009, 0x8020, 0x080c,
-	0x84b3, 0x0005, 0x080c, 0x98c8, 0x080c, 0x9a39, 0x080c, 0x98e4,
-	0x0c28, 0x0096, 0x601b, 0x0001, 0x6014, 0x2048, 0xa880, 0xc0b5,
-	0xa882, 0x009e, 0x0005, 0x080c, 0x5395, 0x01a8, 0x6014, 0x0096,
-	0x904d, 0x0180, 0xa864, 0xa867, 0x0103, 0xa87b, 0x0006, 0x9086,
-	0x0139, 0x1140, 0xa867, 0x0139, 0xa897, 0x4005, 0xa89b, 0x0004,
-	0x080c, 0x6996, 0x009e, 0x0804, 0x9be7, 0x6014, 0x0096, 0x904d,
-	0x0508, 0x080c, 0xbf87, 0x01f0, 0x080c, 0x98e4, 0x2001, 0x180f,
-	0x2004, 0xd0c4, 0x0110, 0x009e, 0x0005, 0xa884, 0x009e, 0x8003,
-	0x800b, 0x810b, 0x9108, 0x611a, 0x2001, 0x0037, 0x2c08, 0x080c,
-	0x159e, 0x6000, 0x9086, 0x0004, 0x1120, 0x2009, 0x0048, 0x080c,
-	0x9c85, 0x0005, 0x009e, 0x080c, 0x1914, 0x0804, 0xb5be, 0x6000,
-	0x908a, 0x0016, 0x1a0c, 0x0d65, 0x000b, 0x0005, 0xb63e, 0xb56a,
-	0xb640, 0xb63e, 0xb640, 0xb640, 0xb566, 0xb63e, 0xb560, 0xb560,
-	0xb63e, 0xb63e, 0xb63e, 0xb63e, 0xb63e, 0xb63e, 0x080c, 0x0d65,
-	0x6010, 0x00b6, 0x2058, 0xb804, 0x9084, 0x00ff, 0x00be, 0x908a,
-	0x000c, 0x1a0c, 0x0d65, 0x00b6, 0x0013, 0x00be, 0x0005, 0xb65b,
-	0xb728, 0xb65d, 0xb69d, 0xb65d, 0xb69d, 0xb65d, 0xb66b, 0xb65b,
-	0xb69d, 0xb65b, 0xb68c, 0x080c, 0x0d65, 0x6004, 0x908e, 0x0016,
-	0x05c0, 0x908e, 0x0004, 0x05a8, 0x908e, 0x0002, 0x0590, 0x908e,
-	0x0052, 0x0904, 0xb724, 0x6004, 0x080c, 0xba5c, 0x0904, 0xb741,
-	0x908e, 0x0004, 0x1110, 0x080c, 0x303b, 0x908e, 0x0021, 0x0904,
-	0xb745, 0x908e, 0x0022, 0x0904, 0xb789, 0x908e, 0x003d, 0x0904,
-	0xb745, 0x908e, 0x0039, 0x0904, 0xb749, 0x908e, 0x0035, 0x0904,
-	0xb749, 0x908e, 0x001e, 0x0178, 0x908e, 0x0001, 0x1140, 0x6010,
-	0x2058, 0xb804, 0x9084, 0x00ff, 0x9086, 0x0006, 0x0110, 0x080c,
-	0x3006, 0x080c, 0xa58f, 0x0804, 0x9c21, 0x00c6, 0x00d6, 0x6104,
-	0x9186, 0x0016, 0x0904, 0xb715, 0x9186, 0x0002, 0x1904, 0xb6ea,
-	0x2001, 0x1836, 0x2004, 0xd08c, 0x11c8, 0x080c, 0x70b7, 0x11b0,
-	0x080c, 0xbf61, 0x0138, 0x080c, 0x70da, 0x1120, 0x080c, 0x6fc2,
-	0x0804, 0xb772, 0x2001, 0x194e, 0x2003, 0x0001, 0x2001, 0x1800,
-	0x2003, 0x0001, 0x080c, 0x6fe8, 0x0804, 0xb772, 0x6010, 0x2058,
-	0x2001, 0x1836, 0x2004, 0xd0ac, 0x1904, 0xb772, 0xb8a0, 0x9084,
-	0xff80, 0x1904, 0xb772, 0xb840, 0x9084, 0x00ff, 0x9005, 0x0190,
-	0x8001, 0xb842, 0x6017, 0x0000, 0x6023, 0x0007, 0x601b, 0x0398,
-	0x604b, 0x0000, 0x080c, 0x9b91, 0x0128, 0x2b00, 0x6012, 0x6023,
-	0x0001, 0x0458, 0x00de, 0x00ce, 0x6004, 0x908e, 0x0002, 0x11a0,
-	0x6010, 0x2058, 0xb8a0, 0x9086, 0x007e, 0x1170, 0x2009, 0x1836,
-	0x2104, 0xc085, 0x200a, 0x00e6, 0x2071, 0x1800, 0x080c, 0x5c6f,
-	0x00ee, 0x080c, 0xa58f, 0x0030, 0x080c, 0xa58f, 0x080c, 0x3006,
-	0x080c, 0xbf76, 0x00e6, 0x0126, 0x2091, 0x8000, 0x080c, 0x303b,
-	0x012e, 0x00ee, 0x080c, 0x9c21, 0x0005, 0x2001, 0x0002, 0x080c,
-	0x61c1, 0x6003, 0x0001, 0x6007, 0x0002, 0x080c, 0x84d8, 0x080c,
-	0x8936, 0x00de, 0x00ce, 0x0c80, 0x080c, 0x303b, 0x0804, 0xb699,
-	0x00c6, 0x00d6, 0x6104, 0x9186, 0x0016, 0x0d38, 0x6010, 0x2058,
-	0xb840, 0x9084, 0x00ff, 0x9005, 0x0904, 0xb6ea, 0x8001, 0xb842,
-	0x6003, 0x0001, 0x080c, 0x84d8, 0x080c, 0x8936, 0x00de, 0x00ce,
-	0x0898, 0x080c, 0xa58f, 0x0804, 0xb69b, 0x080c, 0xa5cb, 0x0804,
-	0xb69b, 0x00d6, 0x2c68, 0x6104, 0x080c, 0xbed9, 0x00de, 0x0118,
-	0x080c, 0x9be7, 0x00f0, 0x6004, 0x8007, 0x6134, 0x918c, 0x00ff,
-	0x9105, 0x6036, 0x6007, 0x0085, 0x6003, 0x000b, 0x6023, 0x0002,
-	0x603c, 0x600a, 0x2001, 0x1958, 0x2004, 0x601a, 0x602c, 0x2c08,
-	0x2060, 0x6024, 0xc0b5, 0x6026, 0x2160, 0x2009, 0x8020, 0x080c,
-	0x84d1, 0x0005, 0x00de, 0x00ce, 0x080c, 0xa58f, 0x080c, 0x3006,
-	0x00e6, 0x0126, 0x2091, 0x8000, 0x080c, 0x303b, 0x6017, 0x0000,
-	0x6023, 0x0007, 0x601b, 0x0398, 0x604b, 0x0000, 0x012e, 0x00ee,
-	0x0005, 0x080c, 0xa022, 0x1904, 0xb741, 0x0005, 0x6000, 0x908a,
-	0x0016, 0x1a0c, 0x0d65, 0x0096, 0x00d6, 0x001b, 0x00de, 0x009e,
-	0x0005, 0xb7a9, 0xb7a9, 0xb7a9, 0xb7a9, 0xb7a9, 0xb7a9, 0xb7a9,
-	0xb7a9, 0xb7a9, 0xb565, 0xb7a9, 0xb56a, 0xb7ab, 0xb56a, 0xb7b8,
-	0xb7a9, 0x080c, 0x0d65, 0x6004, 0x9086, 0x008b, 0x0148, 0x6007,
-	0x008b, 0x6003, 0x000d, 0x2009, 0x8020, 0x080c, 0x84d1, 0x0005,
-	0x080c, 0xbf55, 0x0118, 0x080c, 0xbf68, 0x0010, 0x080c, 0xbf76,
-	0x080c, 0xba36, 0x080c, 0xb847, 0x0570, 0x080c, 0x3006, 0x080c,
-	0xb847, 0x0168, 0x6014, 0x2048, 0xa867, 0x0103, 0xa87b, 0x0006,
-	0xa877, 0x0000, 0xa880, 0xc0ed, 0xa882, 0x080c, 0x6996, 0x2c68,
-	0x080c, 0x9b91, 0x0150, 0x6810, 0x6012, 0x080c, 0xbcdb, 0x00c6,
-	0x2d60, 0x080c, 0x9c21, 0x00ce, 0x0008, 0x2d60, 0x6017, 0x0000,
-	0x6023, 0x0001, 0x6007, 0x0001, 0x6003, 0x0001, 0x080c, 0x84d8,
-	0x080c, 0x8936, 0x00c8, 0x080c, 0xbf55, 0x0138, 0x6034, 0x9086,
-	0x4000, 0x1118, 0x080c, 0x3006, 0x08d0, 0x6034, 0x908c, 0xff00,
-	0x810f, 0x9186, 0x0039, 0x0118, 0x9186, 0x0035, 0x1118, 0x080c,
-	0x3006, 0x0868, 0x080c, 0x9c21, 0x0005, 0x6000, 0x908a, 0x0016,
-	0x1a0c, 0x0d65, 0x0002, 0xb823, 0xb823, 0xb825, 0xb825, 0xb825,
-	0xb823, 0xb823, 0x9c21, 0xb823, 0xb823, 0xb823, 0xb823, 0xb823,
-	0xb823, 0xb823, 0xb823, 0x080c, 0x0d65, 0x080c, 0x98c8, 0x080c,
-	0x9a39, 0x080c, 0x98e4, 0x6114, 0x0096, 0x2148, 0xa87b, 0x0006,
-	0x080c, 0x6996, 0x009e, 0x0804, 0x9be7, 0x9284, 0x0003, 0x1158,
-	0x9282, 0x1ddc, 0x0240, 0x2001, 0x1819, 0x2004, 0x9202, 0x1218,
-	0x9085, 0x0001, 0x0005, 0x9006, 0x0ce8, 0x0096, 0x0028, 0x0096,
-	0x0006, 0x6014, 0x2048, 0x000e, 0x0006, 0x9984, 0xf000, 0x9086,
-	0xf000, 0x0110, 0x080c, 0x10cd, 0x000e, 0x009e, 0x0005, 0x00e6,
-	0x00c6, 0x0036, 0x0006, 0x0126, 0x2091, 0x8000, 0x2061, 0x1ddc,
-	0x2071, 0x1800, 0x7350, 0x7070, 0x9302, 0x1640, 0x6020, 0x9206,
-	0x11f8, 0x080c, 0xbf61, 0x0180, 0x9286, 0x0001, 0x1168, 0x6004,
-	0x9086, 0x0004, 0x1148, 0x080c, 0x3006, 0x080c, 0xbf76, 0x00c6,
-	0x080c, 0x9c21, 0x00ce, 0x0060, 0x080c, 0xbc4d, 0x0148, 0x080c,
-	0xba5c, 0x1110, 0x080c, 0xa58f, 0x00c6, 0x080c, 0x9be7, 0x00ce,
-	0x9ce0, 0x001c, 0x7064, 0x9c02, 0x1208, 0x08a0, 0x012e, 0x000e,
-	0x003e, 0x00ce, 0x00ee, 0x0005, 0x00e6, 0x00c6, 0x0016, 0x9188,
-	0x1000, 0x210c, 0x81ff, 0x0128, 0x2061, 0x1b02, 0x6112, 0x080c,
-	0x3006, 0x9006, 0x0010, 0x9085, 0x0001, 0x001e, 0x00ce, 0x00ee,
-	0x0005, 0x00c6, 0x0126, 0x2091, 0x8000, 0x080c, 0x9b91, 0x01b0,
-	0x665e, 0x2b00, 0x6012, 0x080c, 0x5395, 0x0118, 0x080c, 0xb978,
-	0x0168, 0x080c, 0xbcdb, 0x6023, 0x0003, 0x2009, 0x004b, 0x080c,
-	0x9c85, 0x9085, 0x0001, 0x012e, 0x00ce, 0x0005, 0x9006, 0x0cd8,
-	0x00c6, 0x0126, 0x2091, 0x8000, 0xbaa0, 0x080c, 0x9c58, 0x0580,
-	0x605f, 0x0000, 0x2b00, 0x6012, 0x080c, 0xbcdb, 0x6023, 0x0003,
-	0x0016, 0x080c, 0x98c8, 0x080c, 0x863b, 0x0076, 0x903e, 0x080c,
-	0x852a, 0x2c08, 0x080c, 0xcfc8, 0x007e, 0x080c, 0x98e4, 0x001e,
-	0xd184, 0x0128, 0x080c, 0x9be7, 0x9085, 0x0001, 0x0070, 0x080c,
-	0x5395, 0x0128, 0xd18c, 0x1170, 0x080c, 0xb978, 0x0148, 0x2009,
-	0x004c, 0x080c, 0x9c85, 0x9085, 0x0001, 0x012e, 0x00ce, 0x0005,
-	0x9006, 0x0cd8, 0x2900, 0x6016, 0x0c90, 0x2009, 0x004d, 0x0010,
-	0x2009, 0x004e, 0x00f6, 0x00c6, 0x0046, 0x0016, 0x080c, 0x9b91,
-	0x2c78, 0x0590, 0x7e5e, 0x2b00, 0x7812, 0x7823, 0x0003, 0x2021,
-	0x0005, 0x080c, 0xb98a, 0x9186, 0x004d, 0x0118, 0x9186, 0x004e,
-	0x0148, 0x2001, 0x1951, 0x200c, 0xd1fc, 0x0168, 0x2f60, 0x080c,
-	0x9be7, 0x00d0, 0x2001, 0x1950, 0x200c, 0xd1fc, 0x0120, 0x2f60,
-	0x080c, 0x9be7, 0x0088, 0x2f60, 0x080c, 0x5395, 0x0138, 0xd18c,
-	0x1118, 0x04f1, 0x0148, 0x0010, 0x2900, 0x7816, 0x001e, 0x0016,
-	0x080c, 0x9c85, 0x9085, 0x0001, 0x001e, 0x004e, 0x00ce, 0x00fe,
-	0x0005, 0x00f6, 0x00c6, 0x0046, 0x080c, 0x9b91, 0x2c78, 0x0508,
-	0x7e5e, 0x2b00, 0x7812, 0x7823, 0x0003, 0x0096, 0x2021, 0x0004,
-	0x0489, 0x009e, 0x2001, 0x194f, 0x200c, 0xd1fc, 0x0120, 0x2f60,
-	0x080c, 0x9be7, 0x0060, 0x2f60, 0x080c, 0x5395, 0x0120, 0xd18c,
-	0x1160, 0x0071, 0x0130, 0x2009, 0x0052, 0x080c, 0x9c85, 0x9085,
-	0x0001, 0x004e, 0x00ce, 0x00fe, 0x0005, 0x2900, 0x7816, 0x0c98,
-	0x00c6, 0x080c, 0x4878, 0x00ce, 0x1120, 0x080c, 0x9be7, 0x9006,
-	0x0005, 0xa867, 0x0000, 0xa86b, 0x8000, 0x2900, 0x6016, 0x9085,
-	0x0001, 0x0005, 0x0096, 0x0076, 0x0126, 0x2091, 0x8000, 0x080c,
-	0x98c8, 0x080c, 0x644f, 0x0158, 0x2001, 0xb991, 0x0006, 0x900e,
-	0x2400, 0x080c, 0x6bb3, 0x080c, 0x6996, 0x000e, 0x0807, 0x2418,
-	0x080c, 0x883a, 0xbaa0, 0x0086, 0x2041, 0x0001, 0x2039, 0x0001,
-	0x2608, 0x080c, 0x8655, 0x008e, 0x080c, 0x852a, 0x2f08, 0x2648,
-	0x080c, 0xcfc8, 0xb93c, 0x81ff, 0x090c, 0x872c, 0x080c, 0x98e4,
-	0x012e, 0x007e, 0x009e, 0x0005, 0x00c6, 0x0126, 0x2091, 0x8000,
-	0x080c, 0x9b91, 0x0190, 0x660a, 0x2b08, 0x6112, 0x080c, 0xbcdb,
-	0x6023, 0x0001, 0x2900, 0x6016, 0x2009, 0x001f, 0x080c, 0x9c85,
-	0x9085, 0x0001, 0x012e, 0x00ce, 0x0005, 0x9006, 0x0cd8, 0x00c6,
-	0x0126, 0x2091, 0x8000, 0x080c, 0x9c58, 0x01b8, 0x660a, 0x2b08,
-	0x6112, 0x080c, 0xbcdb, 0x6023, 0x0008, 0x2900, 0x6016, 0x00f6,
-	0x2c78, 0x080c, 0x164f, 0x00fe, 0x2009, 0x0021, 0x080c, 0x9c85,
-	0x9085, 0x0001, 0x012e, 0x00ce, 0x0005, 0x9006, 0x0cd8, 0x2009,
-	0x003d, 0x00c6, 0x0126, 0x0016, 0x2091, 0x8000, 0x080c, 0x9b91,
-	0x0198, 0x660a, 0x2b08, 0x6112, 0x080c, 0xbcdb, 0x6023, 0x0001,
-	0x2900, 0x6016, 0x001e, 0x0016, 0x080c, 0x9c85, 0x9085, 0x0001,
-	0x001e, 0x012e, 0x00ce, 0x0005, 0x9006, 0x0cd0, 0x00c6, 0x0126,
-	0x2091, 0x8000, 0x080c, 0x9c58, 0x0188, 0x2b08, 0x6112, 0x080c,
-	0xbcdb, 0x6023, 0x0001, 0x2900, 0x6016, 0x2009, 0x0000, 0x080c,
-	0x9c85, 0x9085, 0x0001, 0x012e, 0x00ce, 0x0005, 0x9006, 0x0cd8,
-	0x2009, 0x0044, 0x0830, 0x2009, 0x0049, 0x0818, 0x0026, 0x00b6,
-	0x6210, 0x2258, 0xba3c, 0x82ff, 0x0118, 0x8211, 0xba3e, 0x1140,
-	0xb8c0, 0x9005, 0x0128, 0xb888, 0x9005, 0x1110, 0xb88b, 0x0001,
-	0x00be, 0x002e, 0x0005, 0x0006, 0x0016, 0x6004, 0x908e, 0x0002,
-	0x0140, 0x908e, 0x0003, 0x0128, 0x908e, 0x0004, 0x0110, 0x9085,
-	0x0001, 0x001e, 0x000e, 0x0005, 0x0006, 0x0096, 0x6020, 0x9086,
-	0x0004, 0x0190, 0x6014, 0x904d, 0x080c, 0xb847, 0x0168, 0xa864,
-	0x9086, 0x0139, 0x0158, 0x6020, 0x9086, 0x0003, 0x0128, 0xa868,
-	0xd0fc, 0x0110, 0x9006, 0x0010, 0x9085, 0x0001, 0x009e, 0x000e,
-	0x0005, 0x00c6, 0x0126, 0x2091, 0x8000, 0x080c, 0x9c58, 0x0198,
+	0x00ce, 0x0030, 0x6038, 0x2070, 0x2001, 0x1958, 0x2004, 0x704a,
+	0x080c, 0x9bda, 0x002e, 0x00de, 0x00ee, 0x0005, 0x00b6, 0x0096,
+	0x00f6, 0x6014, 0x2048, 0x6010, 0x2058, 0x91b6, 0x0015, 0x0130,
+	0xba08, 0xbb0c, 0xbc00, 0xc48c, 0xbc02, 0x0460, 0x0096, 0x0156,
+	0x0036, 0x0026, 0x2b48, 0x9e90, 0x0010, 0x2019, 0x000a, 0x20a9,
+	0x0004, 0x080c, 0xabd3, 0x002e, 0x003e, 0x015e, 0x009e, 0x1904,
+	0xa357, 0x0096, 0x0156, 0x0036, 0x0026, 0x2b48, 0x9e90, 0x0014,
+	0x2019, 0x0006, 0x20a9, 0x0004, 0x080c, 0xabd3, 0x002e, 0x003e,
+	0x015e, 0x009e, 0x15a0, 0x7238, 0xba0a, 0x733c, 0xbb0e, 0xbc00,
+	0xc48d, 0xbc02, 0xa804, 0x9005, 0x1128, 0x00fe, 0x009e, 0x00be,
+	0x0804, 0x9fe8, 0x0096, 0x2048, 0xaa12, 0xab16, 0xac0a, 0x009e,
+	0x8006, 0x8006, 0x8007, 0x90bc, 0x003f, 0x9084, 0xffc0, 0x9080,
+	0x0002, 0x2009, 0x002b, 0xaaa0, 0xab9c, 0xaca8, 0xada4, 0x2031,
+	0x0000, 0x2041, 0x1271, 0x080c, 0xa0e7, 0x0130, 0x00fe, 0x009e,
+	0x080c, 0x9bda, 0x00be, 0x0005, 0x080c, 0xa581, 0x0cb8, 0x2b78,
+	0x00f6, 0x080c, 0x300e, 0x080c, 0xbf76, 0x00fe, 0x00c6, 0x080c,
+	0x9b84, 0x2f00, 0x6012, 0x6017, 0x0000, 0x6023, 0x0001, 0x6007,
+	0x0001, 0x6003, 0x0001, 0x2001, 0x0007, 0x080c, 0x61bc, 0x080c,
+	0x61e8, 0x080c, 0x84ba, 0x080c, 0x891b, 0x00ce, 0x0804, 0xa32a,
+	0x2100, 0x91b2, 0x0053, 0x1a0c, 0x0d65, 0x91b2, 0x0040, 0x1a04,
+	0xa3e0, 0x0002, 0xa3ce, 0xa3ce, 0xa3c4, 0xa3ce, 0xa3ce, 0xa3ce,
+	0xa3c2, 0xa3c2, 0xa3c2, 0xa3c2, 0xa3c2, 0xa3c2, 0xa3c2, 0xa3c2,
+	0xa3c2, 0xa3c2, 0xa3c2, 0xa3c2, 0xa3c2, 0xa3c2, 0xa3c2, 0xa3c2,
+	0xa3c2, 0xa3c2, 0xa3c2, 0xa3c2, 0xa3c2, 0xa3c2, 0xa3c2, 0xa3c2,
+	0xa3c2, 0xa3ce, 0xa3c2, 0xa3ce, 0xa3ce, 0xa3c2, 0xa3c2, 0xa3c2,
+	0xa3c2, 0xa3c2, 0xa3c4, 0xa3c2, 0xa3c2, 0xa3c2, 0xa3c2, 0xa3c2,
+	0xa3c2, 0xa3c2, 0xa3c2, 0xa3c2, 0xa3ce, 0xa3ce, 0xa3c2, 0xa3c2,
+	0xa3c2, 0xa3c2, 0xa3c2, 0xa3c2, 0xa3c2, 0xa3c2, 0xa3c2, 0xa3ce,
+	0xa3c2, 0xa3c2, 0x080c, 0x0d65, 0x0066, 0x00b6, 0x6610, 0x2658,
+	0xb8c4, 0xc08c, 0xb8c6, 0x00be, 0x006e, 0x0000, 0x6003, 0x0001,
+	0x6106, 0x9186, 0x0032, 0x0118, 0x080c, 0x84ba, 0x0010, 0x080c,
+	0x84b3, 0x0126, 0x2091, 0x8000, 0x080c, 0x891b, 0x012e, 0x0005,
+	0x2600, 0x0002, 0xa3f4, 0xa3f4, 0xa3f4, 0xa3ce, 0xa3ce, 0xa3f4,
+	0xa3f4, 0xa3f4, 0xa3f4, 0xa3ce, 0xa3f4, 0xa3ce, 0xa3f4, 0xa3ce,
+	0xa3f4, 0xa3f4, 0xa3f4, 0xa3f4, 0x080c, 0x0d65, 0x6004, 0x90b2,
+	0x0053, 0x1a0c, 0x0d65, 0x91b6, 0x0013, 0x0904, 0xa4cb, 0x91b6,
+	0x0027, 0x1904, 0xa477, 0x080c, 0x885d, 0x6004, 0x080c, 0xba46,
+	0x01b0, 0x080c, 0xba57, 0x01a8, 0x908e, 0x0021, 0x0904, 0xa474,
+	0x908e, 0x0022, 0x1130, 0x080c, 0xa014, 0x0904, 0xa470, 0x0804,
+	0xa471, 0x908e, 0x003d, 0x0904, 0xa474, 0x0804, 0xa46a, 0x080c,
+	0x303d, 0x2001, 0x0007, 0x080c, 0x61bc, 0x6010, 0x00b6, 0x2058,
+	0xb9a0, 0x00be, 0x080c, 0xa581, 0x9186, 0x007e, 0x1148, 0x2001,
+	0x1836, 0x2014, 0xc285, 0x080c, 0x7096, 0x1108, 0xc2ad, 0x2202,
+	0x080c, 0x98bb, 0x0036, 0x0026, 0x2019, 0x0028, 0x2110, 0x080c,
+	0xd53a, 0x002e, 0x003e, 0x0016, 0x0026, 0x0036, 0x2110, 0x2019,
+	0x0028, 0x080c, 0x8624, 0x0076, 0x903e, 0x080c, 0x8509, 0x6010,
+	0x00b6, 0x905d, 0x0100, 0x00be, 0x2c08, 0x080c, 0xcfd9, 0x007e,
+	0x003e, 0x002e, 0x001e, 0x080c, 0x98d7, 0x080c, 0xbf76, 0x0016,
+	0x080c, 0xbcd3, 0x080c, 0x9bda, 0x001e, 0x080c, 0x3116, 0x080c,
+	0x891b, 0x0030, 0x080c, 0xbcd3, 0x080c, 0x9bda, 0x080c, 0x891b,
+	0x0005, 0x080c, 0xa581, 0x0cb0, 0x080c, 0xa5bd, 0x0c98, 0x9186,
+	0x0015, 0x0118, 0x9186, 0x0016, 0x1140, 0x080c, 0x9aaa, 0x0d80,
+	0x9086, 0x0002, 0x0904, 0xa5c8, 0x0c58, 0x9186, 0x0014, 0x1d40,
+	0x080c, 0x885d, 0x6004, 0x908e, 0x0022, 0x1118, 0x080c, 0xa014,
+	0x09f8, 0x080c, 0x300e, 0x080c, 0xbf76, 0x080c, 0xba46, 0x1190,
+	0x080c, 0x303d, 0x6010, 0x00b6, 0x2058, 0xb9a0, 0x00be, 0x080c,
+	0xa581, 0x9186, 0x007e, 0x1128, 0x2001, 0x1836, 0x200c, 0xc185,
+	0x2102, 0x0800, 0x080c, 0xba57, 0x1120, 0x080c, 0xa581, 0x0804,
+	0xa46a, 0x6004, 0x908e, 0x0032, 0x1160, 0x00e6, 0x00f6, 0x2071,
+	0x1894, 0x2079, 0x0000, 0x080c, 0x33b0, 0x00fe, 0x00ee, 0x0804,
+	0xa46a, 0x6004, 0x908e, 0x0021, 0x0d40, 0x908e, 0x0022, 0x090c,
+	0xa581, 0x0804, 0xa46a, 0x90b2, 0x0040, 0x1a04, 0xa56a, 0x2008,
+	0x0002, 0xa513, 0xa514, 0xa517, 0xa51a, 0xa51d, 0xa520, 0xa511,
+	0xa511, 0xa511, 0xa511, 0xa511, 0xa511, 0xa511, 0xa511, 0xa511,
+	0xa511, 0xa511, 0xa511, 0xa511, 0xa511, 0xa511, 0xa511, 0xa511,
+	0xa511, 0xa511, 0xa511, 0xa511, 0xa511, 0xa511, 0xa511, 0xa523,
+	0xa52c, 0xa511, 0xa52d, 0xa52c, 0xa511, 0xa511, 0xa511, 0xa511,
+	0xa511, 0xa52c, 0xa52c, 0xa511, 0xa511, 0xa511, 0xa511, 0xa511,
+	0xa511, 0xa511, 0xa511, 0xa555, 0xa52c, 0xa511, 0xa528, 0xa511,
+	0xa511, 0xa511, 0xa529, 0xa511, 0xa511, 0xa511, 0xa52c, 0xa550,
+	0xa511, 0x080c, 0x0d65, 0x00c0, 0x2001, 0x000b, 0x00e8, 0x2001,
+	0x0003, 0x00d0, 0x2001, 0x0005, 0x00b8, 0x2001, 0x0001, 0x00a0,
+	0x2001, 0x0009, 0x0088, 0x6003, 0x0005, 0x080c, 0x891b, 0x0058,
+	0x0018, 0x0010, 0x080c, 0x61bc, 0x04b8, 0x080c, 0xbf79, 0x6003,
+	0x0004, 0x080c, 0x891b, 0x0005, 0x080c, 0x61bc, 0x6003, 0x0002,
+	0x0036, 0x2019, 0x185e, 0x2304, 0x9084, 0xff00, 0x1120, 0x2001,
+	0x1956, 0x201c, 0x0040, 0x8007, 0x909a, 0x0004, 0x0ec0, 0x8003,
+	0x801b, 0x831b, 0x9318, 0x631a, 0x003e, 0x080c, 0x891b, 0x0c18,
+	0x080c, 0xbcd3, 0x080c, 0x9bda, 0x08f0, 0x00e6, 0x00f6, 0x2071,
+	0x1894, 0x2079, 0x0000, 0x080c, 0x33b0, 0x00fe, 0x00ee, 0x080c,
+	0x885d, 0x080c, 0x9bda, 0x0878, 0x6003, 0x0002, 0x080c, 0xbf79,
+	0x0804, 0x891b, 0x2600, 0x2008, 0x0002, 0xa57f, 0xa57f, 0xa57f,
+	0xa564, 0xa564, 0xa57f, 0xa57f, 0xa57f, 0xa57f, 0xa564, 0xa57f,
+	0xa564, 0xa57f, 0xa564, 0xa57f, 0xa57f, 0xa57f, 0xa57f, 0x080c,
+	0x0d65, 0x00e6, 0x0096, 0x0026, 0x0016, 0x080c, 0xb842, 0x0568,
+	0x6014, 0x2048, 0xa864, 0x9086, 0x0139, 0x11a8, 0xa894, 0x9086,
+	0x0056, 0x1148, 0x080c, 0x5129, 0x0130, 0x2001, 0x0000, 0x900e,
+	0x2011, 0x4000, 0x0028, 0x2001, 0x0030, 0x900e, 0x2011, 0x4005,
+	0x080c, 0xbe40, 0x0090, 0xa868, 0xd0fc, 0x0178, 0xa807, 0x0000,
+	0x0016, 0x6004, 0x908e, 0x0021, 0x0168, 0x908e, 0x003d, 0x0150,
+	0x001e, 0xa867, 0x0103, 0xa833, 0x0100, 0x001e, 0x002e, 0x009e,
+	0x00ee, 0x0005, 0x001e, 0x0009, 0x0cc0, 0x0096, 0x6014, 0x2048,
+	0xa800, 0x2048, 0xa867, 0x0103, 0xa823, 0x8001, 0x009e, 0x0005,
+	0x00b6, 0x6610, 0x2658, 0xb804, 0x9084, 0x00ff, 0x90b2, 0x000c,
+	0x1a0c, 0x0d65, 0x6604, 0x96b6, 0x004d, 0x1120, 0x080c, 0xbd5f,
+	0x0804, 0xa645, 0x6604, 0x96b6, 0x0043, 0x1120, 0x080c, 0xbda8,
+	0x0804, 0xa645, 0x6604, 0x96b6, 0x004b, 0x1120, 0x080c, 0xbdd4,
+	0x0804, 0xa645, 0x6604, 0x96b6, 0x0033, 0x1120, 0x080c, 0xbcf5,
+	0x0804, 0xa645, 0x6604, 0x96b6, 0x0028, 0x1120, 0x080c, 0xba95,
+	0x0804, 0xa645, 0x6604, 0x96b6, 0x0029, 0x1120, 0x080c, 0xbad6,
+	0x0804, 0xa645, 0x6604, 0x96b6, 0x001f, 0x1118, 0x080c, 0x9fbc,
+	0x04e0, 0x6604, 0x96b6, 0x0000, 0x1118, 0x080c, 0xa2ee, 0x04a8,
+	0x6604, 0x96b6, 0x0022, 0x1118, 0x080c, 0x9ff5, 0x0470, 0x6604,
+	0x96b6, 0x0035, 0x1118, 0x080c, 0xa105, 0x0438, 0x6604, 0x96b6,
+	0x0039, 0x1118, 0x080c, 0xa283, 0x0400, 0x6604, 0x96b6, 0x003d,
+	0x1118, 0x080c, 0xa02d, 0x00c8, 0x6604, 0x96b6, 0x0044, 0x1118,
+	0x080c, 0xa069, 0x0090, 0x6604, 0x96b6, 0x0049, 0x1118, 0x080c,
+	0xa094, 0x0058, 0x91b6, 0x0015, 0x1110, 0x0063, 0x0030, 0x91b6,
+	0x0016, 0x1128, 0x00be, 0x0804, 0xa905, 0x00be, 0x0005, 0x080c,
+	0x9c93, 0x0cd8, 0xa662, 0xa665, 0xa662, 0xa6a9, 0xa662, 0xa839,
+	0xa912, 0xa662, 0xa662, 0xa8df, 0xa662, 0xa8f3, 0x0096, 0x080c,
+	0x15a2, 0x6014, 0x2048, 0xa800, 0x2048, 0xa867, 0x0103, 0x009e,
+	0x0804, 0x9bda, 0xa001, 0xa001, 0x0005, 0x00e6, 0x2071, 0x1800,
+	0x708c, 0x9086, 0x0074, 0x1540, 0x080c, 0xcfaa, 0x11b0, 0x6010,
+	0x00b6, 0x2058, 0x7030, 0xd08c, 0x0128, 0xb800, 0xd0bc, 0x0110,
+	0xc0c5, 0xb802, 0x00e9, 0x00be, 0x2001, 0x0006, 0x080c, 0x61bc,
+	0x080c, 0x303d, 0x080c, 0x9bda, 0x0088, 0x2001, 0x000a, 0x080c,
+	0x61bc, 0x080c, 0x303d, 0x6003, 0x0001, 0x6007, 0x0001, 0x080c,
+	0x84ba, 0x080c, 0x891b, 0x0010, 0x080c, 0xa824, 0x00ee, 0x0005,
+	0x00d6, 0xb800, 0xd084, 0x0158, 0x9006, 0x080c, 0x61a8, 0x2069,
+	0x1853, 0x6804, 0x0020, 0x2001, 0x0006, 0x080c, 0x61e8, 0x00de,
+	0x0005, 0x00b6, 0x0096, 0x00d6, 0x2011, 0x1823, 0x2204, 0x9086,
+	0x0074, 0x1904, 0xa7fb, 0x6010, 0x2058, 0xbaa0, 0x9286, 0x007e,
+	0x1120, 0x080c, 0xaa56, 0x0804, 0xa760, 0x00d6, 0x080c, 0x7096,
+	0x0198, 0x0026, 0x2011, 0x0010, 0x080c, 0x668a, 0x002e, 0x05c8,
+	0x080c, 0x539c, 0x1540, 0x6014, 0x2048, 0xa807, 0x0000, 0xa867,
+	0x0103, 0xa833, 0xdead, 0x00f8, 0x0026, 0x2011, 0x8008, 0x080c,
+	0x668a, 0x002e, 0x0530, 0x6014, 0x2048, 0xa864, 0x9084, 0x00ff,
+	0x9086, 0x0039, 0x1140, 0x2001, 0x0030, 0x900e, 0x2011, 0x4009,
+	0x080c, 0xbe40, 0x0040, 0x6014, 0x2048, 0xa807, 0x0000, 0xa867,
+	0x0103, 0xa833, 0xdead, 0x6010, 0x2058, 0xb9a0, 0x0016, 0x080c,
+	0x303d, 0x080c, 0x9bda, 0x001e, 0x080c, 0x3116, 0x00de, 0x0804,
+	0xa7fe, 0x00de, 0x080c, 0xaa4b, 0x6010, 0x2058, 0xbaa0, 0x9286,
+	0x0080, 0x1510, 0x6014, 0x9005, 0x01a8, 0x2048, 0xa864, 0x9084,
+	0x00ff, 0x9086, 0x0039, 0x1140, 0x2001, 0x0000, 0x900e, 0x2011,
+	0x4000, 0x080c, 0xbe40, 0x0030, 0xa807, 0x0000, 0xa867, 0x0103,
+	0xa833, 0x0200, 0x2001, 0x0006, 0x080c, 0x61bc, 0x080c, 0x303d,
+	0x080c, 0x9bda, 0x0804, 0xa7fe, 0x080c, 0xa80c, 0x6014, 0x9005,
+	0x0190, 0x2048, 0xa868, 0xd0f4, 0x01e8, 0xa864, 0x9084, 0x00ff,
+	0x9086, 0x0039, 0x1d08, 0x2001, 0x0000, 0x900e, 0x2011, 0x4000,
+	0x080c, 0xbe40, 0x08f8, 0x080c, 0xa802, 0x0160, 0x9006, 0x080c,
+	0x61a8, 0x2001, 0x0004, 0x080c, 0x61e8, 0x2001, 0x0007, 0x080c,
+	0x61bc, 0x08a0, 0x2001, 0x0004, 0x080c, 0x61bc, 0x6003, 0x0001,
+	0x6007, 0x0003, 0x080c, 0x84ba, 0x080c, 0x891b, 0x0804, 0xa7fe,
+	0xb85c, 0xd0e4, 0x01d0, 0x080c, 0xbc6d, 0x080c, 0x7096, 0x0118,
+	0xd0dc, 0x1904, 0xa722, 0x2011, 0x1836, 0x2204, 0xc0ad, 0x2012,
+	0x2001, 0x0002, 0x00f6, 0x2079, 0x0100, 0x78e3, 0x0000, 0x080c,
+	0x24b1, 0x78e2, 0x00fe, 0x0804, 0xa722, 0x080c, 0xbcae, 0x2011,
+	0x1836, 0x2204, 0xc0a5, 0x2012, 0x0006, 0x080c, 0xd10f, 0x000e,
+	0x1904, 0xa722, 0xc0b5, 0x2012, 0x2001, 0x0006, 0x080c, 0x61bc,
+	0x9006, 0x080c, 0x61a8, 0x00c6, 0x2001, 0x180f, 0x2004, 0xd09c,
+	0x0520, 0x00f6, 0x2079, 0x0100, 0x00e6, 0x2071, 0x1800, 0x700c,
+	0x9084, 0x00ff, 0x78e6, 0x707a, 0x7010, 0x78ea, 0x707e, 0x908c,
+	0x00ff, 0x00ee, 0x780c, 0xc0b5, 0x780e, 0x00fe, 0x080c, 0x2486,
+	0x00f6, 0x2100, 0x900e, 0x080c, 0x243d, 0x795a, 0x00fe, 0x9186,
+	0x0081, 0x01d8, 0x2009, 0x0081, 0x00c8, 0x2009, 0x00ef, 0x00f6,
+	0x2079, 0x0100, 0x79ea, 0x7932, 0x7936, 0x780c, 0xc0b5, 0x780e,
+	0x00fe, 0x080c, 0x2486, 0x00f6, 0x2079, 0x1800, 0x797e, 0x2100,
+	0x900e, 0x080c, 0x243d, 0x795a, 0x00fe, 0x8108, 0x080c, 0x620b,
+	0x2b00, 0x00ce, 0x1904, 0xa722, 0x6012, 0x2009, 0x180f, 0x210c,
+	0xd19c, 0x0150, 0x2009, 0x027c, 0x210c, 0x918c, 0x00ff, 0xb912,
+	0x2009, 0x027d, 0x210c, 0xb916, 0x2001, 0x0002, 0x080c, 0x61bc,
+	0x6023, 0x0001, 0x6003, 0x0001, 0x6007, 0x0002, 0x080c, 0x84ba,
+	0x080c, 0x891b, 0x0018, 0x080c, 0xa581, 0x0431, 0x00de, 0x009e,
+	0x00be, 0x0005, 0x2001, 0x1810, 0x2004, 0xd0a4, 0x0120, 0x2001,
+	0x1854, 0x2004, 0xd0ac, 0x0005, 0x00e6, 0x080c, 0xd593, 0x0190,
+	0x2071, 0x0260, 0x7108, 0x720c, 0x918c, 0x00ff, 0x1118, 0x9284,
+	0xff00, 0x0140, 0x6010, 0x2058, 0xb8a0, 0x9084, 0xff80, 0x1110,
+	0xb912, 0xba16, 0x00ee, 0x0005, 0x2030, 0x2001, 0x0007, 0x080c,
+	0x61bc, 0x080c, 0x539c, 0x1120, 0x2001, 0x0007, 0x080c, 0x61e8,
+	0x080c, 0x303d, 0x6020, 0x9086, 0x000a, 0x1108, 0x0005, 0x0804,
+	0x9bda, 0x00b6, 0x00e6, 0x0026, 0x0016, 0x2071, 0x1800, 0x708c,
+	0x9086, 0x0014, 0x1904, 0xa8d6, 0x00d6, 0x080c, 0x7096, 0x0198,
+	0x0026, 0x2011, 0x0010, 0x080c, 0x668a, 0x002e, 0x05c8, 0x080c,
+	0x539c, 0x1540, 0x6014, 0x2048, 0xa807, 0x0000, 0xa867, 0x0103,
+	0xa833, 0xdead, 0x00f8, 0x0026, 0x2011, 0x8008, 0x080c, 0x668a,
+	0x002e, 0x0530, 0x6014, 0x2048, 0xa864, 0x9084, 0x00ff, 0x9086,
+	0x0039, 0x1140, 0x2001, 0x0030, 0x900e, 0x2011, 0x4009, 0x080c,
+	0xbe40, 0x0040, 0x6014, 0x2048, 0xa807, 0x0000, 0xa867, 0x0103,
+	0xa833, 0xdead, 0x6010, 0x2058, 0xb9a0, 0x0016, 0x080c, 0x303d,
+	0x080c, 0x9bda, 0x001e, 0x080c, 0x3116, 0x00de, 0x0804, 0xa8da,
+	0x00de, 0x080c, 0x539c, 0x1170, 0x6014, 0x9005, 0x1158, 0x0036,
+	0x0046, 0x6010, 0x2058, 0xbba0, 0x2021, 0x0006, 0x080c, 0x4a77,
+	0x004e, 0x003e, 0x00d6, 0x6010, 0x2058, 0x080c, 0x6306, 0x080c,
+	0xa698, 0x00de, 0x080c, 0xab1c, 0x1588, 0x6010, 0x2058, 0xb890,
+	0x9005, 0x0560, 0x2001, 0x0006, 0x080c, 0x61bc, 0x0096, 0x6014,
+	0x904d, 0x01d0, 0xa864, 0x9084, 0x00ff, 0x9086, 0x0039, 0x1140,
+	0x2001, 0x0000, 0x900e, 0x2011, 0x4000, 0x080c, 0xbe40, 0x0060,
+	0xa864, 0x9084, 0x00ff, 0x9086, 0x0029, 0x0130, 0xa807, 0x0000,
+	0xa867, 0x0103, 0xa833, 0x0200, 0x009e, 0x080c, 0x303d, 0x6020,
+	0x9086, 0x000a, 0x0138, 0x080c, 0x9bda, 0x0020, 0x080c, 0xa581,
+	0x080c, 0xa824, 0x001e, 0x002e, 0x00ee, 0x00be, 0x0005, 0x2011,
+	0x1823, 0x2204, 0x9086, 0x0014, 0x1160, 0x2001, 0x0002, 0x080c,
+	0x61bc, 0x6003, 0x0001, 0x6007, 0x0001, 0x080c, 0x84ba, 0x0804,
+	0x891b, 0x0804, 0xa824, 0x2030, 0x2011, 0x1823, 0x2204, 0x9086,
+	0x0004, 0x1148, 0x96b6, 0x000b, 0x1120, 0x2001, 0x0007, 0x080c,
+	0x61bc, 0x0804, 0x9bda, 0x0804, 0xa824, 0x0002, 0xa662, 0xa91d,
+	0xa662, 0xa95c, 0xa662, 0xaa07, 0xa912, 0xa662, 0xa662, 0xaa1a,
+	0xa662, 0xaa2a, 0x6604, 0x9686, 0x0003, 0x0904, 0xa839, 0x96b6,
+	0x001e, 0x1110, 0x080c, 0x9bda, 0x0005, 0x00b6, 0x00d6, 0x00c6,
+	0x080c, 0xaa3a, 0x11a0, 0x9006, 0x080c, 0x61a8, 0x080c, 0x300e,
+	0x080c, 0xbf76, 0x2001, 0x0002, 0x080c, 0x61bc, 0x6003, 0x0001,
+	0x6007, 0x0002, 0x080c, 0x84ba, 0x080c, 0x891b, 0x0408, 0x2009,
+	0x026e, 0x2104, 0x9086, 0x0009, 0x1160, 0x6010, 0x2058, 0xb840,
+	0x9084, 0x00ff, 0x9005, 0x0170, 0x8001, 0xb842, 0x601b, 0x000a,
+	0x0078, 0x2009, 0x026f, 0x2104, 0x9084, 0xff00, 0x9086, 0x1900,
+	0x1108, 0x08a0, 0x080c, 0x300e, 0x080c, 0xbf76, 0x080c, 0xa824,
+	0x00ce, 0x00de, 0x00be, 0x0005, 0x0096, 0x00b6, 0x0026, 0x9016,
+	0x080c, 0xaa48, 0x00d6, 0x2069, 0x194c, 0x2d04, 0x9005, 0x0168,
+	0x6010, 0x2058, 0xb8a0, 0x9086, 0x007e, 0x1138, 0x2069, 0x181f,
+	0x2d04, 0x8000, 0x206a, 0x00de, 0x0010, 0x00de, 0x0088, 0x9006,
+	0x080c, 0x61a8, 0x2001, 0x0002, 0x080c, 0x61bc, 0x6003, 0x0001,
+	0x6007, 0x0002, 0x080c, 0x84ba, 0x080c, 0x891b, 0x0804, 0xa9d7,
+	0x080c, 0xb842, 0x01b0, 0x6014, 0x2048, 0xa864, 0x2010, 0x9086,
+	0x0139, 0x1138, 0x6007, 0x0016, 0x2001, 0x0002, 0x080c, 0xbe9a,
+	0x00b0, 0x6014, 0x2048, 0xa864, 0xd0fc, 0x0118, 0x2001, 0x0001,
+	0x0ca8, 0x2001, 0x180e, 0x2004, 0xd0dc, 0x0148, 0x6010, 0x2058,
+	0xb840, 0x9084, 0x00ff, 0x9005, 0x1110, 0x9006, 0x0c38, 0x080c,
+	0xa581, 0x2009, 0x026e, 0x2134, 0x96b4, 0x00ff, 0x9686, 0x0005,
+	0x0510, 0x9686, 0x000b, 0x01c8, 0x2009, 0x026f, 0x2104, 0x9084,
+	0xff00, 0x1118, 0x9686, 0x0009, 0x01b0, 0x9086, 0x1900, 0x1168,
+	0x9686, 0x0009, 0x0180, 0x2001, 0x0004, 0x080c, 0x61bc, 0x2001,
+	0x0028, 0x601a, 0x6007, 0x0052, 0x0010, 0x080c, 0xa824, 0x002e,
+	0x00be, 0x009e, 0x0005, 0x9286, 0x0139, 0x0160, 0x6014, 0x2048,
+	0x080c, 0xb842, 0x0140, 0xa864, 0x9086, 0x0139, 0x0118, 0xa868,
+	0xd0fc, 0x0108, 0x0c50, 0x6010, 0x2058, 0xb840, 0x9084, 0x00ff,
+	0x9005, 0x0138, 0x8001, 0xb842, 0x601b, 0x000a, 0x6007, 0x0016,
+	0x08f0, 0xb8a0, 0x9086, 0x007e, 0x1138, 0x00e6, 0x2071, 0x1800,
+	0x080c, 0x5c6a, 0x00ee, 0x0010, 0x080c, 0x300e, 0x0870, 0x080c,
+	0xaa48, 0x1160, 0x2001, 0x0004, 0x080c, 0x61bc, 0x6003, 0x0001,
+	0x6007, 0x0003, 0x080c, 0x84ba, 0x0804, 0x891b, 0x080c, 0xa581,
+	0x0804, 0xa824, 0x0469, 0x1160, 0x2001, 0x0008, 0x080c, 0x61bc,
+	0x6003, 0x0001, 0x6007, 0x0005, 0x080c, 0x84ba, 0x0804, 0x891b,
+	0x0804, 0xa824, 0x00e9, 0x1160, 0x2001, 0x000a, 0x080c, 0x61bc,
+	0x6003, 0x0001, 0x6007, 0x0001, 0x080c, 0x84ba, 0x0804, 0x891b,
+	0x0804, 0xa824, 0x2009, 0x026e, 0x2104, 0x9086, 0x0003, 0x1138,
+	0x2009, 0x026f, 0x2104, 0x9084, 0xff00, 0x9086, 0x2a00, 0x0005,
+	0x9085, 0x0001, 0x0005, 0x00b6, 0x00c6, 0x0016, 0x6110, 0x2158,
+	0x080c, 0x627a, 0x001e, 0x00ce, 0x00be, 0x0005, 0x00b6, 0x00f6,
+	0x00e6, 0x00d6, 0x0036, 0x0016, 0x6010, 0x2058, 0x2009, 0x1836,
+	0x2104, 0x9085, 0x0003, 0x200a, 0x080c, 0xaaee, 0x0560, 0x2009,
+	0x1836, 0x2104, 0xc0cd, 0x200a, 0x080c, 0x6662, 0x0158, 0x9006,
+	0x2020, 0x2009, 0x002a, 0x080c, 0xd284, 0x2001, 0x180c, 0x200c,
+	0xc195, 0x2102, 0x2019, 0x002a, 0x2009, 0x0001, 0x080c, 0x2fd3,
+	0x00e6, 0x2071, 0x1800, 0x080c, 0x2de9, 0x00ee, 0x00c6, 0x0156,
+	0x20a9, 0x0781, 0x2009, 0x007f, 0x080c, 0x3116, 0x8108, 0x1f04,
+	0xaa8c, 0x015e, 0x00ce, 0x080c, 0xaa4b, 0x2071, 0x0260, 0x2079,
+	0x0200, 0x7817, 0x0001, 0x2001, 0x1836, 0x200c, 0xc1c5, 0x7018,
+	0xd0fc, 0x0110, 0xd0dc, 0x0118, 0x7038, 0xd0dc, 0x1108, 0xc1c4,
+	0x7817, 0x0000, 0x2001, 0x1836, 0x2102, 0x2079, 0x0100, 0x2e04,
+	0x9084, 0x00ff, 0x2069, 0x181e, 0x206a, 0x78e6, 0x0006, 0x8e70,
+	0x2e04, 0x2069, 0x181f, 0x206a, 0x78ea, 0x7832, 0x7836, 0x2010,
+	0x9084, 0xff00, 0x001e, 0x9105, 0x2009, 0x182b, 0x200a, 0x2200,
+	0x9084, 0x00ff, 0x2008, 0x080c, 0x2486, 0x080c, 0x7096, 0x0170,
+	0x2071, 0x0260, 0x2069, 0x1952, 0x7048, 0x206a, 0x704c, 0x6806,
+	0x7050, 0x680a, 0x7054, 0x680e, 0x080c, 0xbc6d, 0x0040, 0x2001,
+	0x0006, 0x080c, 0x61bc, 0x080c, 0x303d, 0x080c, 0x9bda, 0x001e,
+	0x003e, 0x00de, 0x00ee, 0x00fe, 0x00be, 0x0005, 0x0096, 0x0026,
+	0x0036, 0x00e6, 0x0156, 0x2019, 0x182b, 0x231c, 0x83ff, 0x01f0,
+	0x2071, 0x0260, 0x7200, 0x9294, 0x00ff, 0x7004, 0x9084, 0xff00,
+	0x9205, 0x9306, 0x1198, 0x2011, 0x0276, 0x20a9, 0x0004, 0x2b48,
+	0x2019, 0x000a, 0x080c, 0xabd3, 0x1148, 0x2011, 0x027a, 0x20a9,
+	0x0004, 0x2019, 0x0006, 0x080c, 0xabd3, 0x1100, 0x015e, 0x00ee,
+	0x003e, 0x002e, 0x009e, 0x0005, 0x00e6, 0x2071, 0x0260, 0x7034,
+	0x9086, 0x0014, 0x11a8, 0x7038, 0x9086, 0x0800, 0x1188, 0x703c,
+	0xd0ec, 0x0160, 0x9084, 0x0f00, 0x9086, 0x0100, 0x1138, 0x7054,
+	0xd0a4, 0x1110, 0xd0ac, 0x0110, 0x9006, 0x0010, 0x9085, 0x0001,
+	0x00ee, 0x0005, 0x00e6, 0x0096, 0x00c6, 0x0076, 0x0056, 0x0046,
+	0x0026, 0x0006, 0x0126, 0x2091, 0x8000, 0x2029, 0x19c3, 0x252c,
+	0x2021, 0x19ca, 0x2424, 0x2061, 0x1ddc, 0x2071, 0x1800, 0x7250,
+	0x7070, 0x9202, 0x1a04, 0xabab, 0x080c, 0xd2b5, 0x0904, 0xaba4,
+	0x6720, 0x9786, 0x0007, 0x0904, 0xaba4, 0x2500, 0x9c06, 0x0904,
+	0xaba4, 0x2400, 0x9c06, 0x0904, 0xaba4, 0x3e08, 0x9186, 0x0002,
+	0x1148, 0x6010, 0x9005, 0x0130, 0x00b6, 0x2058, 0xb800, 0x00be,
+	0xd0bc, 0x1590, 0x00c6, 0x6043, 0xffff, 0x6000, 0x9086, 0x0004,
+	0x1110, 0x080c, 0x1921, 0x9786, 0x000a, 0x0148, 0x080c, 0xba57,
+	0x1130, 0x00ce, 0x080c, 0xa581, 0x080c, 0x9c14, 0x00e8, 0x6014,
+	0x2048, 0x080c, 0xb842, 0x01a8, 0x9786, 0x0003, 0x1530, 0xa867,
+	0x0103, 0xa87c, 0xd0cc, 0x0130, 0x0096, 0xa878, 0x2048, 0x080c,
+	0x0fd4, 0x009e, 0xab7a, 0xa877, 0x0000, 0x080c, 0x6985, 0x080c,
+	0xba31, 0x080c, 0x9c14, 0x00ce, 0x9ce0, 0x001c, 0x7064, 0x9c02,
+	0x1210, 0x0804, 0xab4f, 0x012e, 0x000e, 0x002e, 0x004e, 0x005e,
+	0x007e, 0x00ce, 0x009e, 0x00ee, 0x0005, 0x9786, 0x0006, 0x1118,
+	0x080c, 0xd22f, 0x0c30, 0x9786, 0x000a, 0x0998, 0x0880, 0x220c,
+	0x2304, 0x9106, 0x1130, 0x8210, 0x8318, 0x1f04, 0xabbf, 0x9006,
+	0x0005, 0x2304, 0x9102, 0x0218, 0x2001, 0x0001, 0x0008, 0x9006,
+	0x918d, 0x0001, 0x0005, 0x0136, 0x01c6, 0x0016, 0x8906, 0x8006,
+	0x8007, 0x908c, 0x003f, 0x21e0, 0x9084, 0xffc0, 0x9300, 0x2098,
+	0x3518, 0x20a9, 0x0001, 0x220c, 0x4002, 0x910e, 0x1140, 0x8210,
+	0x8319, 0x1dc8, 0x9006, 0x001e, 0x01ce, 0x013e, 0x0005, 0x220c,
+	0x9102, 0x0218, 0x2001, 0x0001, 0x0010, 0x2001, 0x0000, 0x918d,
+	0x0001, 0x001e, 0x01ce, 0x013e, 0x0005, 0x6004, 0x908a, 0x0053,
+	0x1a0c, 0x0d65, 0x080c, 0xba46, 0x0120, 0x080c, 0xba57, 0x0158,
+	0x0028, 0x080c, 0x303d, 0x080c, 0xba57, 0x0128, 0x080c, 0x885d,
+	0x080c, 0x9bda, 0x0005, 0x080c, 0xa581, 0x0cc0, 0x9182, 0x0057,
+	0x1220, 0x9182, 0x0040, 0x0208, 0x000a, 0x0005, 0xac35, 0xac35,
+	0xac35, 0xac35, 0xac35, 0xac35, 0xac35, 0xac35, 0xac35, 0xac35,
+	0xac35, 0xac37, 0xac37, 0xac37, 0xac37, 0xac35, 0xac35, 0xac35,
+	0xac37, 0xac35, 0xac35, 0xac35, 0xac35, 0x080c, 0x0d65, 0x600b,
+	0xffff, 0x6003, 0x000f, 0x6106, 0x0126, 0x2091, 0x8000, 0x080c,
+	0xbf79, 0x2009, 0x8000, 0x080c, 0x84b3, 0x012e, 0x0005, 0x9186,
+	0x0013, 0x1128, 0x6004, 0x9082, 0x0040, 0x0804, 0xacbc, 0x9186,
+	0x0027, 0x1520, 0x080c, 0x885d, 0x080c, 0x300e, 0x080c, 0xbf76,
+	0x0096, 0x6114, 0x2148, 0x080c, 0xb842, 0x0198, 0x080c, 0xba57,
+	0x1118, 0x080c, 0xa581, 0x0068, 0xa867, 0x0103, 0xa87b, 0x0029,
+	0xa877, 0x0000, 0xa97c, 0xc1c5, 0xa97e, 0x080c, 0x6991, 0x080c,
+	0xba31, 0x009e, 0x080c, 0x9bda, 0x0804, 0x891b, 0x9186, 0x0014,
+	0x1120, 0x6004, 0x9082, 0x0040, 0x0018, 0x080c, 0x0d65, 0x0005,
+	0x0002, 0xac9a, 0xac98, 0xac98, 0xac98, 0xac98, 0xac98, 0xac98,
+	0xac98, 0xac98, 0xac98, 0xac98, 0xacb3, 0xacb3, 0xacb3, 0xacb3,
+	0xac98, 0xacb3, 0xac98, 0xacb3, 0xac98, 0xac98, 0xac98, 0xac98,
+	0x080c, 0x0d65, 0x080c, 0x885d, 0x0096, 0x6114, 0x2148, 0x080c,
+	0xb842, 0x0168, 0xa867, 0x0103, 0xa87b, 0x0006, 0xa877, 0x0000,
+	0xa880, 0xc0ec, 0xa882, 0x080c, 0x6991, 0x080c, 0xba31, 0x009e,
+	0x080c, 0x9bda, 0x0005, 0x080c, 0x885d, 0x080c, 0xba57, 0x090c,
+	0xa581, 0x080c, 0x9bda, 0x0005, 0x0002, 0xacd6, 0xacd4, 0xacd4,
+	0xacd4, 0xacd4, 0xacd4, 0xacd4, 0xacd4, 0xacd4, 0xacd4, 0xacd4,
+	0xacd8, 0xacd8, 0xacd8, 0xacd8, 0xacd4, 0xacda, 0xacd4, 0xacd8,
+	0xacd4, 0xacd4, 0xacd4, 0xacd4, 0x080c, 0x0d65, 0x080c, 0x0d65,
+	0x080c, 0x0d65, 0x080c, 0x9bda, 0x0804, 0x891b, 0x9182, 0x0057,
+	0x1220, 0x9182, 0x0040, 0x0208, 0x000a, 0x0005, 0xacfd, 0xacfd,
+	0xacfd, 0xacfd, 0xacfd, 0xad36, 0xae25, 0xacfd, 0xae31, 0xacfd,
+	0xacfd, 0xacfd, 0xacfd, 0xacfd, 0xacfd, 0xacfd, 0xacfd, 0xacfd,
+	0xacfd, 0xae31, 0xacff, 0xacfd, 0xae2f, 0x080c, 0x0d65, 0x00b6,
+	0x0096, 0x6114, 0x2148, 0x6010, 0x2058, 0xb800, 0xd0bc, 0x1508,
+	0xa87b, 0x0000, 0xa867, 0x0103, 0xa877, 0x0000, 0xa87c, 0xd0ac,
+	0x0128, 0xa834, 0xa938, 0x9115, 0x190c, 0xaeb6, 0x080c, 0x67a7,
+	0x6210, 0x2258, 0xba3c, 0x82ff, 0x0110, 0x8211, 0xba3e, 0xb8c0,
+	0x9005, 0x0110, 0x080c, 0x6396, 0x080c, 0x9bda, 0x009e, 0x00be,
+	0x0005, 0xa87c, 0xd0ac, 0x09e0, 0xa838, 0xa934, 0x9105, 0x09c0,
+	0xa880, 0xd0bc, 0x19a8, 0x080c, 0xbb8c, 0x0c80, 0x00b6, 0x0096,
+	0x6114, 0x2148, 0x601c, 0xd0fc, 0x1110, 0x7644, 0x0008, 0x9036,
+	0x96b4, 0x0fff, 0x86ff, 0x1590, 0x6010, 0x2058, 0xb800, 0xd0bc,
+	0x1904, 0xae14, 0xa87b, 0x0000, 0xa867, 0x0103, 0xae76, 0xa87c,
+	0xd0ac, 0x0128, 0xa834, 0xa938, 0x9115, 0x190c, 0xaeb6, 0x080c,
+	0x67a7, 0x6210, 0x2258, 0xba3c, 0x82ff, 0x0110, 0x8211, 0xba3e,
+	0xb8c0, 0x9005, 0x0110, 0x080c, 0x6396, 0x601c, 0xd0fc, 0x1148,
+	0x7044, 0xd0e4, 0x1904, 0xadf8, 0x080c, 0x9bda, 0x009e, 0x00be,
+	0x0005, 0x2009, 0x0211, 0x210c, 0x080c, 0x0d65, 0x968c, 0x0c00,
+	0x0150, 0x6010, 0x2058, 0xb800, 0xd0bc, 0x1904, 0xadfc, 0x7348,
+	0xab92, 0x734c, 0xab8e, 0x968c, 0x00ff, 0x9186, 0x0002, 0x0508,
+	0x9186, 0x0028, 0x1118, 0xa87b, 0x001c, 0x00e8, 0xd6dc, 0x01a0,
+	0xa87b, 0x0015, 0xa87c, 0xd0ac, 0x0170, 0xa938, 0xaa34, 0x2100,
+	0x9205, 0x0148, 0x7048, 0x9106, 0x1118, 0x704c, 0x9206, 0x0118,
+	0xa992, 0xaa8e, 0xc6dc, 0x0038, 0xd6d4, 0x0118, 0xa87b, 0x0007,
+	0x0010, 0xa87b, 0x0000, 0xa867, 0x0103, 0xae76, 0x901e, 0xd6c4,
+	0x01d8, 0x9686, 0x0100, 0x1130, 0x7064, 0x9005, 0x1118, 0xc6c4,
+	0x0804, 0xad42, 0x735c, 0xab86, 0x83ff, 0x0170, 0x938a, 0x0009,
+	0x0210, 0x2019, 0x0008, 0x0036, 0x2308, 0x2019, 0x0018, 0x2011,
+	0x0025, 0x080c, 0xb408, 0x003e, 0xd6cc, 0x0904, 0xad57, 0x7154,
+	0xa98a, 0x81ff, 0x0904, 0xad57, 0x9192, 0x0021, 0x1278, 0x8304,
+	0x9098, 0x0018, 0x2011, 0x0029, 0x080c, 0xb408, 0x2011, 0x0205,
+	0x2013, 0x0000, 0x080c, 0xbf06, 0x0804, 0xad57, 0xa868, 0xd0fc,
+	0x0120, 0x2009, 0x0020, 0xa98a, 0x0c50, 0x00a6, 0x2950, 0x080c,
+	0xb3a7, 0x00ae, 0x080c, 0xbf06, 0x080c, 0xb3f8, 0x0804, 0xad59,
+	0x080c, 0xbb4f, 0x0804, 0xad6e, 0xa87c, 0xd0ac, 0x0904, 0xad7f,
+	0xa880, 0xd0bc, 0x1904, 0xad7f, 0x7348, 0xa838, 0x9306, 0x11c8,
+	0x734c, 0xa834, 0x931e, 0x0904, 0xad7f, 0xd6d4, 0x0190, 0xab38,
+	0x9305, 0x0904, 0xad7f, 0x0068, 0xa87c, 0xd0ac, 0x0904, 0xad4a,
+	0xa838, 0xa934, 0x9105, 0x0904, 0xad4a, 0xa880, 0xd0bc, 0x1904,
+	0xad4a, 0x080c, 0xbb8c, 0x0804, 0xad6e, 0x00f6, 0x2079, 0x026c,
+	0x7c04, 0x7b00, 0x7e0c, 0x7d08, 0x00fe, 0x0021, 0x0005, 0x0011,
+	0x0005, 0x0005, 0x0096, 0x6003, 0x0002, 0x6007, 0x0043, 0x6014,
+	0x2048, 0xa87c, 0xd0ac, 0x0128, 0x009e, 0x0005, 0x2130, 0x2228,
+	0x0058, 0x2400, 0xa9ac, 0x910a, 0x2300, 0xaab0, 0x9213, 0x2600,
+	0x9102, 0x2500, 0x9203, 0x0e90, 0xac46, 0xab4a, 0xae36, 0xad3a,
+	0x6044, 0xd0fc, 0x190c, 0x98e4, 0x604b, 0x0000, 0x080c, 0x1adf,
+	0x1118, 0x6144, 0x080c, 0x84df, 0x009e, 0x0005, 0x9182, 0x0057,
+	0x1220, 0x9182, 0x0040, 0x0208, 0x000a, 0x0005, 0xae7d, 0xae7d,
+	0xae7d, 0xae7d, 0xae7d, 0xae7d, 0xae7d, 0xae7d, 0xae7d, 0xae7d,
+	0xae7f, 0xae7d, 0xae7d, 0xae7d, 0xae7d, 0xae90, 0xae7d, 0xae7d,
+	0xae7d, 0xae7d, 0xaeb4, 0xae7d, 0xae7d, 0x080c, 0x0d65, 0x6004,
+	0x9086, 0x0040, 0x1110, 0x080c, 0x885d, 0x2019, 0x0001, 0x080c,
+	0x9269, 0x6003, 0x0002, 0x080c, 0xbf7e, 0x080c, 0x88b8, 0x0005,
+	0x6004, 0x9086, 0x0040, 0x1110, 0x080c, 0x885d, 0x2019, 0x0001,
+	0x080c, 0x9269, 0x080c, 0x88b8, 0x080c, 0x300e, 0x080c, 0xbf76,
+	0x0096, 0x6114, 0x2148, 0x080c, 0xb842, 0x0150, 0xa867, 0x0103,
+	0xa87b, 0x0029, 0xa877, 0x0000, 0x080c, 0x6991, 0x080c, 0xba31,
+	0x009e, 0x080c, 0x9bda, 0x0005, 0x080c, 0x0d65, 0xa87b, 0x0015,
+	0xd1fc, 0x0180, 0xa87b, 0x0007, 0x8002, 0x8000, 0x810a, 0x9189,
+	0x0000, 0x0006, 0x0016, 0x2009, 0x1a47, 0x2104, 0x8000, 0x200a,
+	0x001e, 0x000e, 0xa992, 0xa88e, 0x0005, 0x9182, 0x0057, 0x1220,
+	0x9182, 0x0040, 0x0208, 0x000a, 0x0005, 0xaeec, 0xaeec, 0xaeec,
+	0xaeec, 0xaeec, 0xaeee, 0xaeec, 0xaeec, 0xafab, 0xaeec, 0xaeec,
+	0xaeec, 0xaeec, 0xaeec, 0xaeec, 0xaeec, 0xaeec, 0xaeec, 0xaeec,
+	0xb0e9, 0xaeec, 0xb0f3, 0xaeec, 0x080c, 0x0d65, 0x601c, 0xd0bc,
+	0x0178, 0xd084, 0x0168, 0xd0f4, 0x0120, 0xc084, 0x601e, 0x0804,
+	0xacde, 0x6114, 0x0096, 0x2148, 0xa87c, 0xc0e5, 0xa87e, 0x009e,
+	0x0076, 0x00a6, 0x00e6, 0x0096, 0x2071, 0x0260, 0x6114, 0x2150,
+	0x601c, 0xd0fc, 0x1110, 0x7644, 0x0008, 0x9036, 0xb676, 0x96b4,
+	0x0fff, 0xb77c, 0xc7e5, 0xb77e, 0x6210, 0x00b6, 0x2258, 0xba3c,
+	0x82ff, 0x0110, 0x8211, 0xba3e, 0x00be, 0x86ff, 0x0904, 0xafa4,
+	0x9694, 0xff00, 0x9284, 0x0c00, 0x0120, 0x7048, 0xb092, 0x704c,
+	0xb08e, 0x9284, 0x0300, 0x0904, 0xafa4, 0x9686, 0x0100, 0x1130,
+	0x7064, 0x9005, 0x1118, 0xc6c4, 0xb676, 0x0c38, 0x080c, 0x1022,
+	0x090c, 0x0d65, 0x2900, 0xb07a, 0xb77c, 0x97bd, 0x0200, 0xb77e,
+	0xa867, 0x0103, 0xb068, 0xa86a, 0xb06c, 0xa86e, 0xb070, 0xa872,
+	0x7044, 0x9084, 0xf000, 0x9635, 0xae76, 0x968c, 0x0c00, 0x0120,
+	0x7348, 0xab92, 0x734c, 0xab8e, 0x968c, 0x00ff, 0x9186, 0x0002,
+	0x0180, 0x9186, 0x0028, 0x1118, 0xa87b, 0x001c, 0x0060, 0xd6dc,
+	0x0118, 0xa87b, 0x0015, 0x0038, 0xd6d4, 0x0118, 0xa87b, 0x0007,
+	0x0010, 0xa87b, 0x0000, 0xaf7e, 0xb080, 0xa882, 0xb084, 0xa886,
+	0x901e, 0xd6c4, 0x0190, 0x735c, 0xab86, 0x83ff, 0x0170, 0x938a,
+	0x0009, 0x0210, 0x2019, 0x0008, 0x0036, 0x2308, 0x2019, 0x0018,
+	0x2011, 0x0025, 0x080c, 0xb408, 0x003e, 0xd6cc, 0x01e8, 0x7154,
+	0xa98a, 0x81ff, 0x01c8, 0x9192, 0x0021, 0x1260, 0x8304, 0x9098,
+	0x0018, 0x2011, 0x0029, 0x080c, 0xb408, 0x2011, 0x0205, 0x2013,
+	0x0000, 0x0050, 0xb068, 0xd0fc, 0x0120, 0x2009, 0x0020, 0xa98a,
+	0x0c68, 0x2950, 0x080c, 0xb3a7, 0x080c, 0x18ff, 0x009e, 0x00ee,
+	0x00ae, 0x007e, 0x0005, 0x2001, 0x1958, 0x2004, 0x604a, 0x0096,
+	0x6114, 0x2148, 0xa83c, 0xa940, 0x9105, 0x1118, 0xa87c, 0xc0dc,
+	0xa87e, 0x6003, 0x0002, 0x080c, 0xbf87, 0x0904, 0xb0e4, 0x604b,
+	0x0000, 0x6010, 0x00b6, 0x2058, 0xb800, 0x00be, 0xd0bc, 0x1500,
+	0xd1cc, 0x0904, 0xb0a9, 0xa978, 0xa868, 0xd0fc, 0x0904, 0xb06a,
+	0x0016, 0xa87c, 0x0006, 0xa880, 0x0006, 0x00a6, 0x2150, 0xb174,
+	0x9184, 0x00ff, 0x90b6, 0x0002, 0x0904, 0xb038, 0x9086, 0x0028,
+	0x1904, 0xb024, 0xa87b, 0x001c, 0xb07b, 0x001c, 0x0804, 0xb040,
+	0x6024, 0xd0f4, 0x11d0, 0xa838, 0xaa34, 0x9205, 0x09c8, 0xa838,
+	0xaa90, 0x9206, 0x1120, 0xa88c, 0xaa34, 0x9206, 0x0988, 0x6024,
+	0xd0d4, 0x1148, 0xa9ac, 0xa834, 0x9102, 0x603a, 0xa9b0, 0xa838,
+	0x9103, 0x603e, 0x6024, 0xc0f5, 0x6026, 0x6010, 0x00b6, 0x2058,
+	0xb83c, 0x8000, 0xb83e, 0x00be, 0x601c, 0xc0fc, 0x601e, 0x9006,
+	0xa876, 0xa892, 0xa88e, 0xa87c, 0xc0e4, 0xa87e, 0xd0cc, 0x0140,
+	0xc0cc, 0xa87e, 0x0096, 0xa878, 0x2048, 0x080c, 0x0fd4, 0x009e,
+	0x080c, 0xbb8c, 0x0804, 0xb0e4, 0xd1dc, 0x0158, 0xa87b, 0x0015,
+	0xb07b, 0x0015, 0x080c, 0xbe29, 0x0118, 0xb174, 0xc1dc, 0xb176,
+	0x0078, 0xd1d4, 0x0128, 0xa87b, 0x0007, 0xb07b, 0x0007, 0x0040,
+	0xa87c, 0xd0ac, 0x0128, 0xa834, 0xa938, 0x9115, 0x190c, 0xaeb6,
+	0xa87c, 0xb07e, 0xa890, 0xb092, 0xa88c, 0xb08e, 0xa860, 0x20e8,
+	0xa85c, 0x9080, 0x0019, 0x20a0, 0x20a9, 0x0020, 0x8a06, 0x8006,
+	0x8007, 0x9094, 0x003f, 0x22e0, 0x9084, 0xffc0, 0x9080, 0x0019,
+	0x2098, 0x4003, 0x00ae, 0x000e, 0xa882, 0x000e, 0xa87e, 0x080c,
+	0xbf06, 0x001e, 0xa874, 0x0006, 0x2148, 0x080c, 0x0fd4, 0x001e,
+	0x0804, 0xb0d6, 0x0016, 0x00a6, 0x2150, 0xb174, 0x9184, 0x00ff,
+	0x90b6, 0x0002, 0x01e0, 0x9086, 0x0028, 0x1128, 0xa87b, 0x001c,
+	0xb07b, 0x001c, 0x00e0, 0xd1dc, 0x0158, 0xa87b, 0x0015, 0xb07b,
+	0x0015, 0x080c, 0xbe29, 0x0118, 0xb174, 0xc1dc, 0xb176, 0x0078,
+	0xd1d4, 0x0128, 0xa87b, 0x0007, 0xb07b, 0x0007, 0x0040, 0xa87c,
+	0xd0ac, 0x0128, 0xa834, 0xa938, 0x9115, 0x190c, 0xaeb6, 0xa890,
+	0xb092, 0xa88c, 0xb08e, 0xa87c, 0xb07e, 0x00ae, 0x080c, 0x0fd4,
+	0x009e, 0x080c, 0xbf06, 0xa974, 0x0016, 0x080c, 0xb3f8, 0x001e,
+	0x0468, 0xa867, 0x0103, 0xa974, 0x9184, 0x00ff, 0x90b6, 0x0002,
+	0x01b0, 0x9086, 0x0028, 0x1118, 0xa87b, 0x001c, 0x00d0, 0xd1dc,
+	0x0148, 0xa87b, 0x0015, 0x080c, 0xbe29, 0x0118, 0xa974, 0xc1dc,
+	0xa976, 0x0078, 0xd1d4, 0x0118, 0xa87b, 0x0007, 0x0050, 0xa87b,
+	0x0000, 0xa87c, 0xd0ac, 0x0128, 0xa834, 0xa938, 0x9115, 0x190c,
+	0xaeb6, 0xa974, 0x0016, 0x080c, 0x67a7, 0x001e, 0x6010, 0x00b6,
+	0x2058, 0xb8c0, 0x0016, 0x9005, 0x190c, 0x6396, 0x001e, 0x00be,
+	0xd1e4, 0x1120, 0x080c, 0x9bda, 0x009e, 0x0005, 0x080c, 0xbb4f,
+	0x0cd8, 0x6114, 0x0096, 0x2148, 0xa97c, 0x080c, 0xbf87, 0x190c,
+	0x190d, 0x009e, 0x0005, 0x0096, 0x6114, 0x2148, 0xa83c, 0xa940,
+	0x9105, 0x01e8, 0xa877, 0x0000, 0xa87b, 0x0000, 0xa867, 0x0103,
+	0x00b6, 0x6010, 0x2058, 0xa834, 0xa938, 0x9115, 0x11a0, 0x080c,
+	0x67a7, 0xba3c, 0x8211, 0x0208, 0xba3e, 0xb8c0, 0x9005, 0x0110,
+	0x080c, 0x6396, 0x080c, 0x9bda, 0x00be, 0x009e, 0x0005, 0xa87c,
+	0xc0dc, 0xa87e, 0x08f8, 0xb800, 0xd0bc, 0x1120, 0xa834, 0x080c,
+	0xaeb6, 0x0c28, 0xa880, 0xd0bc, 0x1dc8, 0x080c, 0xbb8c, 0x0c60,
+	0x080c, 0x885d, 0x0010, 0x080c, 0x88b8, 0x601c, 0xd084, 0x0110,
+	0x080c, 0x1921, 0x080c, 0xb842, 0x01f0, 0x0096, 0x6114, 0x2148,
+	0x080c, 0xba57, 0x1118, 0x080c, 0xa581, 0x00a0, 0xa867, 0x0103,
+	0x2009, 0x180c, 0x210c, 0xd18c, 0x1198, 0xd184, 0x1170, 0x6108,
+	0xa97a, 0x918e, 0x0029, 0x1110, 0x080c, 0xd52b, 0xa877, 0x0000,
+	0x080c, 0x6991, 0x009e, 0x0804, 0x9c14, 0xa87b, 0x0004, 0x0cb0,
+	0xa87b, 0x0004, 0x0c98, 0x9182, 0x0057, 0x1220, 0x9182, 0x0040,
+	0x0208, 0x000a, 0x0005, 0xb17a, 0xb17a, 0xb17a, 0xb17a, 0xb17a,
+	0xb17c, 0xb17a, 0xb17a, 0xb17a, 0xb17a, 0xb17a, 0xb17a, 0xb17a,
+	0xb17a, 0xb17a, 0xb17a, 0xb17a, 0xb17a, 0xb17a, 0xb17a, 0xb1a0,
+	0xb17a, 0xb17a, 0x080c, 0x0d65, 0x080c, 0x5390, 0x01f8, 0x6014,
+	0x7144, 0x918c, 0x0fff, 0x9016, 0xd1c4, 0x0118, 0x7264, 0x9294,
+	0x00ff, 0x0096, 0x904d, 0x0188, 0xa87b, 0x0000, 0xa864, 0x9086,
+	0x0139, 0x0128, 0xa867, 0x0103, 0xa976, 0xaa96, 0x0030, 0xa897,
+	0x4000, 0xa99a, 0xaa9e, 0x080c, 0x6991, 0x009e, 0x0804, 0x9bda,
+	0x080c, 0x5390, 0x0dd8, 0x6014, 0x900e, 0x9016, 0x0c10, 0x9182,
+	0x0085, 0x0002, 0xb1b9, 0xb1b7, 0xb1b7, 0xb1c5, 0xb1b7, 0xb1b7,
+	0xb1b7, 0xb1b7, 0xb1b7, 0xb1b7, 0xb1b7, 0xb1b7, 0xb1b7, 0x080c,
+	0x0d65, 0x6003, 0x0001, 0x6106, 0x0126, 0x2091, 0x8000, 0x2009,
+	0x8020, 0x080c, 0x84b3, 0x012e, 0x0005, 0x0026, 0x0056, 0x00d6,
+	0x00e6, 0x2071, 0x0260, 0x7224, 0x6216, 0x7220, 0x080c, 0xb830,
+	0x01a0, 0x2268, 0x6800, 0x9086, 0x0000, 0x0178, 0x6010, 0x6d10,
+	0x952e, 0x1158, 0x00c6, 0x2d60, 0x080c, 0xb433, 0x00ce, 0x0128,
+	0x6803, 0x0002, 0x6007, 0x0086, 0x0010, 0x6007, 0x0087, 0x6003,
+	0x0001, 0x2009, 0x8020, 0x080c, 0x84b3, 0x9280, 0x0004, 0x00b6,
+	0x2058, 0xb800, 0x00be, 0xd0bc, 0x0140, 0x6824, 0xd0ec, 0x0128,
+	0x00c6, 0x2260, 0x080c, 0xbb8c, 0x00ce, 0x00ee, 0x00de, 0x005e,
+	0x002e, 0x0005, 0x9186, 0x0013, 0x1160, 0x6004, 0x908a, 0x0085,
+	0x0a0c, 0x0d65, 0x908a, 0x0092, 0x1a0c, 0x0d65, 0x9082, 0x0085,
+	0x00e2, 0x9186, 0x0027, 0x0120, 0x9186, 0x0014, 0x190c, 0x0d65,
+	0x080c, 0x885d, 0x0096, 0x6014, 0x2048, 0x080c, 0xb842, 0x0140,
+	0xa867, 0x0103, 0xa877, 0x0000, 0xa87b, 0x0029, 0x080c, 0x6991,
+	0x009e, 0x080c, 0x9c14, 0x0804, 0x891b, 0xb23a, 0xb23c, 0xb23c,
+	0xb23a, 0xb23a, 0xb23a, 0xb23a, 0xb23a, 0xb23a, 0xb23a, 0xb23a,
+	0xb23a, 0xb23a, 0x080c, 0x0d65, 0x080c, 0x9c14, 0x0005, 0x9186,
+	0x0013, 0x1130, 0x6004, 0x9082, 0x0085, 0x2008, 0x0804, 0xb28b,
+	0x9186, 0x0027, 0x1558, 0x080c, 0x885d, 0x080c, 0x300e, 0x080c,
+	0xbf76, 0x0096, 0x6014, 0x2048, 0x080c, 0xb842, 0x0150, 0xa867,
+	0x0103, 0xa877, 0x0000, 0xa87b, 0x0029, 0x080c, 0x6991, 0x080c,
+	0xba31, 0x009e, 0x080c, 0x9bda, 0x0005, 0x9186, 0x0089, 0x0118,
+	0x9186, 0x008a, 0x1140, 0x080c, 0x9aaa, 0x0128, 0x9086, 0x000c,
+	0x0904, 0xb2c3, 0x0000, 0x080c, 0x9c93, 0x0c70, 0x9186, 0x0014,
+	0x1d60, 0x080c, 0x885d, 0x0096, 0x6014, 0x2048, 0x080c, 0xb842,
+	0x0d00, 0xa867, 0x0103, 0xa877, 0x0000, 0xa87b, 0x0006, 0xa880,
+	0xc0ec, 0xa882, 0x0890, 0x0002, 0xb29b, 0xb299, 0xb299, 0xb299,
+	0xb299, 0xb299, 0xb2af, 0xb299, 0xb299, 0xb299, 0xb299, 0xb299,
+	0xb299, 0x080c, 0x0d65, 0x6034, 0x908c, 0xff00, 0x810f, 0x9186,
+	0x0039, 0x0118, 0x9186, 0x0035, 0x1118, 0x2001, 0x1956, 0x0010,
+	0x2001, 0x1957, 0x2004, 0x601a, 0x6003, 0x000c, 0x0005, 0x6034,
+	0x908c, 0xff00, 0x810f, 0x9186, 0x0039, 0x0118, 0x9186, 0x0035,
+	0x1118, 0x2001, 0x1956, 0x0010, 0x2001, 0x1957, 0x2004, 0x601a,
+	0x6003, 0x000e, 0x0005, 0x9182, 0x0092, 0x1220, 0x9182, 0x0085,
+	0x0208, 0x0012, 0x0804, 0x9c93, 0xb2d9, 0xb2d9, 0xb2d9, 0xb2d9,
+	0xb2db, 0xb328, 0xb2d9, 0xb2d9, 0xb2d9, 0xb2d9, 0xb2d9, 0xb2d9,
+	0xb2d9, 0x080c, 0x0d65, 0x0096, 0x6010, 0x00b6, 0x2058, 0xb800,
+	0x00be, 0xd0bc, 0x0168, 0x6034, 0x908c, 0xff00, 0x810f, 0x9186,
+	0x0039, 0x0118, 0x9186, 0x0035, 0x1118, 0x009e, 0x0804, 0xb33c,
+	0x080c, 0xb842, 0x1118, 0x080c, 0xba31, 0x0068, 0x6014, 0x2048,
+	0x080c, 0xbf8d, 0x1110, 0x080c, 0xba31, 0xa867, 0x0103, 0x080c,
+	0xbf41, 0x080c, 0x6991, 0x00d6, 0x2c68, 0x080c, 0x9b84, 0x01d0,
+	0x6003, 0x0001, 0x6007, 0x001e, 0x600b, 0xffff, 0x2009, 0x026e,
+	0x210c, 0x613a, 0x2009, 0x026f, 0x210c, 0x613e, 0x6910, 0x6112,
+	0x080c, 0xbcdb, 0x695c, 0x615e, 0x6023, 0x0001, 0x2009, 0x8020,
+	0x080c, 0x84b3, 0x2d60, 0x00de, 0x080c, 0x9bda, 0x009e, 0x0005,
+	0x6010, 0x00b6, 0x2058, 0xb800, 0x00be, 0xd0bc, 0x05a0, 0x6034,
+	0x908c, 0xff00, 0x810f, 0x9186, 0x0035, 0x0130, 0x9186, 0x001e,
+	0x0118, 0x9186, 0x0039, 0x1538, 0x00d6, 0x2c68, 0x080c, 0xbed9,
+	0x11f0, 0x080c, 0x9b84, 0x01d8, 0x6106, 0x6003, 0x0001, 0x6023,
+	0x0001, 0x6910, 0x6112, 0x692c, 0x612e, 0x6930, 0x6132, 0x6934,
+	0x918c, 0x00ff, 0x6136, 0x6938, 0x613a, 0x693c, 0x613e, 0x695c,
+	0x615e, 0x080c, 0xbcdb, 0x2009, 0x8020, 0x080c, 0x84b3, 0x2d60,
+	0x00de, 0x0804, 0x9bda, 0x0096, 0x6014, 0x2048, 0x080c, 0xb842,
+	0x01c8, 0xa867, 0x0103, 0xa880, 0xd0b4, 0x0128, 0xc0ec, 0xa882,
+	0xa87b, 0x0006, 0x0048, 0xd0bc, 0x0118, 0xa87b, 0x0002, 0x0020,
+	0xa87b, 0x0005, 0x080c, 0xbb4b, 0xa877, 0x0000, 0x080c, 0x6991,
+	0x080c, 0xba31, 0x009e, 0x0804, 0x9bda, 0x0016, 0x0096, 0x6014,
+	0x2048, 0x080c, 0xb842, 0x0140, 0xa867, 0x0103, 0xa87b, 0x0028,
+	0xa877, 0x0000, 0x080c, 0x6991, 0x009e, 0x001e, 0x9186, 0x0013,
+	0x0158, 0x9186, 0x0014, 0x0130, 0x9186, 0x0027, 0x0118, 0x080c,
+	0x9c93, 0x0020, 0x080c, 0x885d, 0x080c, 0x9c14, 0x0005, 0x0056,
+	0x0066, 0x0096, 0x00a6, 0x2029, 0x0001, 0x9182, 0x0101, 0x1208,
+	0x0010, 0x2009, 0x0100, 0x2130, 0x8304, 0x9098, 0x0018, 0x2009,
+	0x0020, 0x2011, 0x0029, 0x080c, 0xb408, 0x96b2, 0x0020, 0xb004,
+	0x904d, 0x0110, 0x080c, 0x0fd4, 0x080c, 0x1022, 0x0520, 0x8528,
+	0xa867, 0x0110, 0xa86b, 0x0000, 0x2920, 0xb406, 0x968a, 0x003d,
+	0x1228, 0x2608, 0x2011, 0x001b, 0x0499, 0x00a8, 0x96b2, 0x003c,
+	0x2009, 0x003c, 0x2950, 0x2011, 0x001b, 0x0451, 0x0c28, 0x2001,
+	0x0205, 0x2003, 0x0000, 0x00ae, 0x852f, 0x95ad, 0x0003, 0xb566,
+	0x95ac, 0x0000, 0x0048, 0x2001, 0x0205, 0x2003, 0x0000, 0x00ae,
+	0x852f, 0x95ad, 0x0003, 0xb566, 0x009e, 0x006e, 0x005e, 0x0005,
+	0x00a6, 0x89ff, 0x0158, 0xa804, 0x9055, 0x0130, 0xa807, 0x0000,
+	0x080c, 0x6991, 0x2a48, 0x0cb8, 0x080c, 0x6991, 0x00ae, 0x0005,
+	0x00f6, 0x2079, 0x0200, 0x7814, 0x9085, 0x0080, 0x7816, 0xd184,
+	0x0108, 0x8108, 0x810c, 0x20a9, 0x0001, 0xa860, 0x20e8, 0xa85c,
+	0x9200, 0x20a0, 0x20e1, 0x0000, 0x2300, 0x9e00, 0x2098, 0x4003,
+	0x8318, 0x9386, 0x0020, 0x1148, 0x2018, 0x2300, 0x9e00, 0x2098,
+	0x7814, 0x8000, 0x9085, 0x0080, 0x7816, 0x8109, 0x1d80, 0x7817,
+	0x0000, 0x00fe, 0x0005, 0x0066, 0x0126, 0x2091, 0x8000, 0x2031,
+	0x0001, 0x6020, 0x9084, 0x000f, 0x0083, 0x012e, 0x006e, 0x0005,
+	0x0126, 0x2091, 0x8000, 0x0066, 0x2031, 0x0000, 0x6020, 0x9084,
+	0x000f, 0x001b, 0x006e, 0x012e, 0x0005, 0xb485, 0xb485, 0xb480,
+	0xb4a9, 0xb45d, 0xb480, 0xb45f, 0xb480, 0xb45d, 0xb45d, 0xb480,
+	0xb480, 0xb480, 0xb45d, 0xb45d, 0xb45d, 0x080c, 0x0d65, 0x6010,
+	0x9080, 0x0000, 0x2004, 0xd0bc, 0x190c, 0xb4a9, 0x0036, 0x6014,
+	0x0096, 0x2048, 0xa880, 0x009e, 0xd0cc, 0x0118, 0x2019, 0x000c,
+	0x0038, 0xd094, 0x0118, 0x2019, 0x000d, 0x0010, 0x2019, 0x0010,
+	0x080c, 0xce09, 0x6023, 0x0006, 0x6003, 0x0007, 0x003e, 0x0005,
+	0x9006, 0x0005, 0x9085, 0x0001, 0x0005, 0x0096, 0x86ff, 0x11e8,
+	0x6014, 0x2048, 0x080c, 0xb842, 0x01d0, 0x6043, 0xffff, 0xa864,
+	0x9086, 0x0139, 0x1128, 0xa87b, 0x0005, 0xa883, 0x0000, 0x0028,
+	0x900e, 0x2001, 0x0005, 0x080c, 0x6ba2, 0x080c, 0xbb4b, 0x080c,
+	0x6985, 0x080c, 0x9c14, 0x9085, 0x0001, 0x009e, 0x0005, 0x9006,
+	0x0ce0, 0x080c, 0x98bb, 0x080c, 0xbf9b, 0x6000, 0x908a, 0x0016,
+	0x1a0c, 0x0d65, 0x002b, 0x0106, 0x080c, 0x98d7, 0x010e, 0x0005,
+	0xb4c8, 0xb4f6, 0xb4ca, 0xb51d, 0xb4f1, 0xb4c8, 0xb480, 0xb485,
+	0xb485, 0xb480, 0xb480, 0xb480, 0xb480, 0xb480, 0xb480, 0xb480,
+	0x080c, 0x0d65, 0x86ff, 0x1510, 0x6020, 0x9086, 0x0006, 0x01f0,
+	0x0096, 0x6014, 0x2048, 0x080c, 0xb842, 0x0158, 0xa87c, 0xd0cc,
+	0x0130, 0x0096, 0xa878, 0x2048, 0x080c, 0x0fd4, 0x009e, 0x080c,
+	0xbb4b, 0x009e, 0x080c, 0xbf1b, 0x6007, 0x0085, 0x6003, 0x000b,
+	0x6023, 0x0002, 0x2009, 0x8020, 0x080c, 0x8495, 0x9085, 0x0001,
+	0x0005, 0x0066, 0x080c, 0x1921, 0x006e, 0x08a0, 0x00e6, 0x2071,
+	0x19b7, 0x7030, 0x9c06, 0x1120, 0x080c, 0x91e9, 0x00ee, 0x0850,
+	0x6020, 0x9084, 0x000f, 0x9086, 0x0006, 0x1150, 0x0086, 0x0096,
+	0x2049, 0x0001, 0x2c40, 0x080c, 0x9365, 0x009e, 0x008e, 0x0040,
+	0x0066, 0x080c, 0x90e5, 0x190c, 0x0d65, 0x080c, 0x90f3, 0x006e,
+	0x00ee, 0x1904, 0xb4ca, 0x0804, 0xb480, 0x0036, 0x00e6, 0x2071,
+	0x19b7, 0x704c, 0x9c06, 0x1138, 0x901e, 0x080c, 0x9269, 0x00ee,
+	0x003e, 0x0804, 0xb4ca, 0x080c, 0x949c, 0x00ee, 0x003e, 0x1904,
+	0xb4ca, 0x0804, 0xb480, 0x00c6, 0x0066, 0x6020, 0x9084, 0x000f,
+	0x001b, 0x006e, 0x00ce, 0x0005, 0xb553, 0xb622, 0xb789, 0xb55b,
+	0x9c14, 0xb553, 0xcdfb, 0xbf83, 0xb622, 0xb54c, 0xb808, 0xb54c,
+	0xb54c, 0xb54c, 0xb54c, 0xb54c, 0x080c, 0x0d65, 0x080c, 0xba57,
+	0x1110, 0x080c, 0xa581, 0x0005, 0x080c, 0x885d, 0x0804, 0x9bda,
+	0x601b, 0x0001, 0x0005, 0x080c, 0xb842, 0x0130, 0x6014, 0x0096,
+	0x2048, 0x2c00, 0xa896, 0x009e, 0x080c, 0x98bb, 0x080c, 0xbf9b,
+	0x6000, 0x908a, 0x0016, 0x1a0c, 0x0d65, 0x0013, 0x0804, 0x98d7,
+	0xb580, 0xb582, 0xb5ac, 0xb5c0, 0xb5ed, 0xb580, 0xb553, 0xb553,
+	0xb553, 0xb5c7, 0xb5c7, 0xb580, 0xb580, 0xb580, 0xb580, 0xb5d1,
+	0x080c, 0x0d65, 0x00e6, 0x6014, 0x0096, 0x2048, 0xa880, 0xc0b5,
+	0xa882, 0x009e, 0x2071, 0x19b7, 0x7030, 0x9c06, 0x01d0, 0x0066,
+	0x080c, 0x90e5, 0x190c, 0x0d65, 0x080c, 0x90f3, 0x006e, 0x080c,
+	0xbf1b, 0x6007, 0x0085, 0x6003, 0x000b, 0x6023, 0x0002, 0x2001,
+	0x1957, 0x2004, 0x601a, 0x2009, 0x8020, 0x080c, 0x8495, 0x00ee,
+	0x0005, 0x601b, 0x0001, 0x0cd8, 0x0096, 0x6014, 0x2048, 0xa880,
+	0xc0b5, 0xa882, 0x009e, 0x080c, 0xbf1b, 0x6007, 0x0085, 0x6003,
+	0x000b, 0x6023, 0x0002, 0x2009, 0x8020, 0x080c, 0x8495, 0x0005,
+	0x080c, 0x98bb, 0x080c, 0x9a2c, 0x080c, 0x98d7, 0x0c28, 0x0096,
+	0x601b, 0x0001, 0x6014, 0x2048, 0xa880, 0xc0b5, 0xa882, 0x009e,
+	0x0005, 0x080c, 0x5390, 0x01b8, 0x6014, 0x0096, 0x904d, 0x0190,
+	0xa864, 0xa867, 0x0103, 0xa87b, 0x0006, 0x9086, 0x0139, 0x1150,
+	0xa867, 0x0139, 0xa87b, 0x0030, 0xa897, 0x4005, 0xa89b, 0x0004,
+	0x080c, 0x6991, 0x009e, 0x0804, 0x9bda, 0x6014, 0x0096, 0x904d,
+	0x0560, 0xa97c, 0xd1e4, 0x1158, 0x611c, 0xd1fc, 0x0530, 0x6110,
+	0x00b6, 0x2158, 0xb93c, 0x8109, 0x0208, 0xb93e, 0x00be, 0x080c,
+	0x98d7, 0x2001, 0x180f, 0x2004, 0xd0c4, 0x0110, 0x009e, 0x0005,
+	0xa884, 0x009e, 0x8003, 0x800b, 0x810b, 0x9108, 0x611a, 0x2001,
+	0x0037, 0x2c08, 0x080c, 0x15ab, 0x6000, 0x9086, 0x0004, 0x1120,
+	0x2009, 0x0048, 0x080c, 0x9c76, 0x0005, 0x009e, 0x080c, 0x1921,
+	0x0804, 0xb5ac, 0x6000, 0x908a, 0x0016, 0x1a0c, 0x0d65, 0x000b,
+	0x0005, 0xb639, 0xb558, 0xb63b, 0xb639, 0xb63b, 0xb63b, 0xb554,
+	0xb639, 0xb54e, 0xb54e, 0xb639, 0xb639, 0xb639, 0xb639, 0xb639,
+	0xb639, 0x080c, 0x0d65, 0x6010, 0x00b6, 0x2058, 0xb804, 0x9084,
+	0x00ff, 0x00be, 0x908a, 0x000c, 0x1a0c, 0x0d65, 0x00b6, 0x0013,
+	0x00be, 0x0005, 0xb656, 0xb723, 0xb658, 0xb698, 0xb658, 0xb698,
+	0xb658, 0xb666, 0xb656, 0xb698, 0xb656, 0xb687, 0x080c, 0x0d65,
+	0x6004, 0x908e, 0x0016, 0x05c0, 0x908e, 0x0004, 0x05a8, 0x908e,
+	0x0002, 0x0590, 0x908e, 0x0052, 0x0904, 0xb71f, 0x6004, 0x080c,
+	0xba57, 0x0904, 0xb73c, 0x908e, 0x0004, 0x1110, 0x080c, 0x303d,
+	0x908e, 0x0021, 0x0904, 0xb740, 0x908e, 0x0022, 0x0904, 0xb784,
+	0x908e, 0x003d, 0x0904, 0xb740, 0x908e, 0x0039, 0x0904, 0xb744,
+	0x908e, 0x0035, 0x0904, 0xb744, 0x908e, 0x001e, 0x0178, 0x908e,
+	0x0001, 0x1140, 0x6010, 0x2058, 0xb804, 0x9084, 0x00ff, 0x9086,
+	0x0006, 0x0110, 0x080c, 0x300e, 0x080c, 0xa581, 0x0804, 0x9c14,
+	0x00c6, 0x00d6, 0x6104, 0x9186, 0x0016, 0x0904, 0xb710, 0x9186,
+	0x0002, 0x1904, 0xb6e5, 0x2001, 0x1836, 0x2004, 0xd08c, 0x11c8,
+	0x080c, 0x7096, 0x11b0, 0x080c, 0xbf61, 0x0138, 0x080c, 0x70b9,
+	0x1120, 0x080c, 0x6fa1, 0x0804, 0xb76d, 0x2001, 0x194d, 0x2003,
+	0x0001, 0x2001, 0x1800, 0x2003, 0x0001, 0x080c, 0x6fc7, 0x0804,
+	0xb76d, 0x6010, 0x2058, 0x2001, 0x1836, 0x2004, 0xd0ac, 0x1904,
+	0xb76d, 0xb8a0, 0x9084, 0xff80, 0x1904, 0xb76d, 0xb840, 0x9084,
+	0x00ff, 0x9005, 0x0190, 0x8001, 0xb842, 0x6017, 0x0000, 0x6023,
+	0x0007, 0x601b, 0x0398, 0x604b, 0x0000, 0x080c, 0x9b84, 0x0128,
+	0x2b00, 0x6012, 0x6023, 0x0001, 0x0458, 0x00de, 0x00ce, 0x6004,
+	0x908e, 0x0002, 0x11a0, 0x6010, 0x2058, 0xb8a0, 0x9086, 0x007e,
+	0x1170, 0x2009, 0x1836, 0x2104, 0xc085, 0x200a, 0x00e6, 0x2071,
+	0x1800, 0x080c, 0x5c6a, 0x00ee, 0x080c, 0xa581, 0x0030, 0x080c,
+	0xa581, 0x080c, 0x300e, 0x080c, 0xbf76, 0x00e6, 0x0126, 0x2091,
+	0x8000, 0x080c, 0x303d, 0x012e, 0x00ee, 0x080c, 0x9c14, 0x0005,
+	0x2001, 0x0002, 0x080c, 0x61bc, 0x6003, 0x0001, 0x6007, 0x0002,
+	0x080c, 0x84ba, 0x080c, 0x891b, 0x00de, 0x00ce, 0x0c80, 0x080c,
+	0x303d, 0x0804, 0xb694, 0x00c6, 0x00d6, 0x6104, 0x9186, 0x0016,
+	0x0d38, 0x6010, 0x2058, 0xb840, 0x9084, 0x00ff, 0x9005, 0x0904,
+	0xb6e5, 0x8001, 0xb842, 0x6003, 0x0001, 0x080c, 0x84ba, 0x080c,
+	0x891b, 0x00de, 0x00ce, 0x0898, 0x080c, 0xa581, 0x0804, 0xb696,
+	0x080c, 0xa5bd, 0x0804, 0xb696, 0x00d6, 0x2c68, 0x6104, 0x080c,
+	0xbed9, 0x00de, 0x0118, 0x080c, 0x9bda, 0x00f0, 0x6004, 0x8007,
+	0x6134, 0x918c, 0x00ff, 0x9105, 0x6036, 0x6007, 0x0085, 0x6003,
+	0x000b, 0x6023, 0x0002, 0x603c, 0x600a, 0x2001, 0x1957, 0x2004,
+	0x601a, 0x602c, 0x2c08, 0x2060, 0x6024, 0xc0b5, 0x6026, 0x2160,
+	0x2009, 0x8020, 0x080c, 0x84b3, 0x0005, 0x00de, 0x00ce, 0x080c,
+	0xa581, 0x080c, 0x300e, 0x00e6, 0x0126, 0x2091, 0x8000, 0x080c,
+	0x303d, 0x6017, 0x0000, 0x6023, 0x0007, 0x601b, 0x0398, 0x604b,
+	0x0000, 0x012e, 0x00ee, 0x0005, 0x080c, 0xa014, 0x1904, 0xb73c,
+	0x0005, 0x6000, 0x908a, 0x0016, 0x1a0c, 0x0d65, 0x0096, 0x00d6,
+	0x001b, 0x00de, 0x009e, 0x0005, 0xb7a4, 0xb7a4, 0xb7a4, 0xb7a4,
+	0xb7a4, 0xb7a4, 0xb7a4, 0xb7a4, 0xb7a4, 0xb553, 0xb7a4, 0xb558,
+	0xb7a6, 0xb558, 0xb7b3, 0xb7a4, 0x080c, 0x0d65, 0x6004, 0x9086,
+	0x008b, 0x0148, 0x6007, 0x008b, 0x6003, 0x000d, 0x2009, 0x8020,
+	0x080c, 0x84b3, 0x0005, 0x080c, 0xbf55, 0x0118, 0x080c, 0xbf68,
+	0x0010, 0x080c, 0xbf76, 0x080c, 0xba31, 0x080c, 0xb842, 0x0570,
+	0x080c, 0x300e, 0x080c, 0xb842, 0x0168, 0x6014, 0x2048, 0xa867,
+	0x0103, 0xa87b, 0x0006, 0xa877, 0x0000, 0xa880, 0xc0ed, 0xa882,
+	0x080c, 0x6991, 0x2c68, 0x080c, 0x9b84, 0x0150, 0x6810, 0x6012,
+	0x080c, 0xbcdb, 0x00c6, 0x2d60, 0x080c, 0x9c14, 0x00ce, 0x0008,
+	0x2d60, 0x6017, 0x0000, 0x6023, 0x0001, 0x6007, 0x0001, 0x6003,
+	0x0001, 0x080c, 0x84ba, 0x080c, 0x891b, 0x00c8, 0x080c, 0xbf55,
+	0x0138, 0x6034, 0x9086, 0x4000, 0x1118, 0x080c, 0x300e, 0x08d0,
+	0x6034, 0x908c, 0xff00, 0x810f, 0x9186, 0x0039, 0x0118, 0x9186,
+	0x0035, 0x1118, 0x080c, 0x300e, 0x0868, 0x080c, 0x9c14, 0x0005,
+	0x6000, 0x908a, 0x0016, 0x1a0c, 0x0d65, 0x0002, 0xb81e, 0xb81e,
+	0xb820, 0xb820, 0xb820, 0xb81e, 0xb81e, 0x9c14, 0xb81e, 0xb81e,
+	0xb81e, 0xb81e, 0xb81e, 0xb81e, 0xb81e, 0xb81e, 0x080c, 0x0d65,
+	0x080c, 0x98bb, 0x080c, 0x9a2c, 0x080c, 0x98d7, 0x6114, 0x0096,
+	0x2148, 0xa87b, 0x0006, 0x080c, 0x6991, 0x009e, 0x0804, 0x9bda,
+	0x9284, 0x0003, 0x1158, 0x9282, 0x1ddc, 0x0240, 0x2001, 0x1819,
+	0x2004, 0x9202, 0x1218, 0x9085, 0x0001, 0x0005, 0x9006, 0x0ce8,
+	0x0096, 0x0028, 0x0096, 0x0006, 0x6014, 0x2048, 0x000e, 0x0006,
+	0x9984, 0xf000, 0x9086, 0xf000, 0x0110, 0x080c, 0x10cd, 0x000e,
+	0x009e, 0x0005, 0x00e6, 0x00c6, 0x0036, 0x0006, 0x0126, 0x2091,
+	0x8000, 0x2061, 0x1ddc, 0x2071, 0x1800, 0x7350, 0x7070, 0x9302,
+	0x1640, 0x6020, 0x9206, 0x11f8, 0x080c, 0xbf61, 0x0180, 0x9286,
+	0x0001, 0x1168, 0x6004, 0x9086, 0x0004, 0x1148, 0x080c, 0x300e,
+	0x080c, 0xbf76, 0x00c6, 0x080c, 0x9c14, 0x00ce, 0x0060, 0x080c,
+	0xbc4d, 0x0148, 0x080c, 0xba57, 0x1110, 0x080c, 0xa581, 0x00c6,
+	0x080c, 0x9bda, 0x00ce, 0x9ce0, 0x001c, 0x7064, 0x9c02, 0x1208,
+	0x08a0, 0x012e, 0x000e, 0x003e, 0x00ce, 0x00ee, 0x0005, 0x00e6,
+	0x00c6, 0x0016, 0x9188, 0x1000, 0x210c, 0x81ff, 0x0128, 0x2061,
+	0x1b01, 0x6112, 0x080c, 0x300e, 0x9006, 0x0010, 0x9085, 0x0001,
+	0x001e, 0x00ce, 0x00ee, 0x0005, 0x00c6, 0x0126, 0x2091, 0x8000,
+	0x080c, 0x9b84, 0x01b0, 0x665e, 0x2b00, 0x6012, 0x080c, 0x5390,
+	0x0118, 0x080c, 0xb973, 0x0168, 0x080c, 0xbcdb, 0x6023, 0x0003,
+	0x2009, 0x004b, 0x080c, 0x9c76, 0x9085, 0x0001, 0x012e, 0x00ce,
+	0x0005, 0x9006, 0x0cd8, 0x00c6, 0x0126, 0x2091, 0x8000, 0xbaa0,
+	0x080c, 0x9c49, 0x0580, 0x605f, 0x0000, 0x2b00, 0x6012, 0x080c,
+	0xbcdb, 0x6023, 0x0003, 0x0016, 0x080c, 0x98bb, 0x080c, 0x8624,
+	0x0076, 0x903e, 0x080c, 0x8509, 0x2c08, 0x080c, 0xcfd9, 0x007e,
+	0x080c, 0x98d7, 0x001e, 0xd184, 0x0128, 0x080c, 0x9bda, 0x9085,
+	0x0001, 0x0070, 0x080c, 0x5390, 0x0128, 0xd18c, 0x1170, 0x080c,
+	0xb973, 0x0148, 0x2009, 0x004c, 0x080c, 0x9c76, 0x9085, 0x0001,
+	0x012e, 0x00ce, 0x0005, 0x9006, 0x0cd8, 0x2900, 0x6016, 0x0c90,
+	0x2009, 0x004d, 0x0010, 0x2009, 0x004e, 0x00f6, 0x00c6, 0x0046,
+	0x0016, 0x080c, 0x9b84, 0x2c78, 0x0590, 0x7e5e, 0x2b00, 0x7812,
+	0x7823, 0x0003, 0x2021, 0x0005, 0x080c, 0xb985, 0x9186, 0x004d,
+	0x0118, 0x9186, 0x004e, 0x0148, 0x2001, 0x1950, 0x200c, 0xd1fc,
+	0x0168, 0x2f60, 0x080c, 0x9bda, 0x00d0, 0x2001, 0x194f, 0x200c,
+	0xd1fc, 0x0120, 0x2f60, 0x080c, 0x9bda, 0x0088, 0x2f60, 0x080c,
+	0x5390, 0x0138, 0xd18c, 0x1118, 0x04f1, 0x0148, 0x0010, 0x2900,
+	0x7816, 0x001e, 0x0016, 0x080c, 0x9c76, 0x9085, 0x0001, 0x001e,
+	0x004e, 0x00ce, 0x00fe, 0x0005, 0x00f6, 0x00c6, 0x0046, 0x080c,
+	0x9b84, 0x2c78, 0x0508, 0x7e5e, 0x2b00, 0x7812, 0x7823, 0x0003,
+	0x0096, 0x2021, 0x0004, 0x0489, 0x009e, 0x2001, 0x194e, 0x200c,
+	0xd1fc, 0x0120, 0x2f60, 0x080c, 0x9bda, 0x0060, 0x2f60, 0x080c,
+	0x5390, 0x0120, 0xd18c, 0x1160, 0x0071, 0x0130, 0x2009, 0x0052,
+	0x080c, 0x9c76, 0x9085, 0x0001, 0x004e, 0x00ce, 0x00fe, 0x0005,
+	0x2900, 0x7816, 0x0c98, 0x00c6, 0x080c, 0x487a, 0x00ce, 0x1120,
+	0x080c, 0x9bda, 0x9006, 0x0005, 0xa867, 0x0000, 0xa86b, 0x8000,
+	0x2900, 0x6016, 0x9085, 0x0001, 0x0005, 0x0096, 0x0076, 0x0126,
+	0x2091, 0x8000, 0x080c, 0x98bb, 0x080c, 0x644d, 0x0158, 0x2001,
+	0xb98c, 0x0006, 0x900e, 0x2400, 0x080c, 0x6ba2, 0x080c, 0x6991,
+	0x000e, 0x0807, 0x2418, 0x080c, 0x8823, 0xbaa0, 0x0086, 0x2041,
+	0x0001, 0x2039, 0x0001, 0x2608, 0x080c, 0x863e, 0x008e, 0x080c,
+	0x8509, 0x2f08, 0x2648, 0x080c, 0xcfd9, 0xb93c, 0x81ff, 0x090c,
+	0x8715, 0x080c, 0x98d7, 0x012e, 0x007e, 0x009e, 0x0005, 0x00c6,
+	0x0126, 0x2091, 0x8000, 0x080c, 0x9b84, 0x0190, 0x660a, 0x2b08,
+	0x6112, 0x080c, 0xbcdb, 0x6023, 0x0001, 0x2900, 0x6016, 0x2009,
+	0x001f, 0x080c, 0x9c76, 0x9085, 0x0001, 0x012e, 0x00ce, 0x0005,
+	0x9006, 0x0cd8, 0x00c6, 0x0126, 0x2091, 0x8000, 0x080c, 0x9c49,
+	0x01b8, 0x660a, 0x2b08, 0x6112, 0x080c, 0xbcdb, 0x6023, 0x0008,
+	0x2900, 0x6016, 0x00f6, 0x2c78, 0x080c, 0x165c, 0x00fe, 0x2009,
+	0x0021, 0x080c, 0x9c76, 0x9085, 0x0001, 0x012e, 0x00ce, 0x0005,
+	0x9006, 0x0cd8, 0x2009, 0x003d, 0x00c6, 0x0126, 0x0016, 0x2091,
+	0x8000, 0x080c, 0x9b84, 0x0198, 0x660a, 0x2b08, 0x6112, 0x080c,
+	0xbcdb, 0x6023, 0x0001, 0x2900, 0x6016, 0x001e, 0x0016, 0x080c,
+	0x9c76, 0x9085, 0x0001, 0x001e, 0x012e, 0x00ce, 0x0005, 0x9006,
+	0x0cd0, 0x00c6, 0x0126, 0x2091, 0x8000, 0x080c, 0x9c49, 0x0188,
+	0x2b08, 0x6112, 0x080c, 0xbcdb, 0x6023, 0x0001, 0x2900, 0x6016,
+	0x2009, 0x0000, 0x080c, 0x9c76, 0x9085, 0x0001, 0x012e, 0x00ce,
+	0x0005, 0x9006, 0x0cd8, 0x2009, 0x0044, 0x0830, 0x2009, 0x0049,
+	0x0818, 0x0026, 0x00b6, 0x6210, 0x2258, 0xba3c, 0x82ff, 0x0118,
+	0x8211, 0xba3e, 0x1140, 0xb8c0, 0x9005, 0x0128, 0xb888, 0x9005,
+	0x1110, 0xb88b, 0x0001, 0x00be, 0x002e, 0x0005, 0x0006, 0x0016,
+	0x6004, 0x908e, 0x0002, 0x0140, 0x908e, 0x0003, 0x0128, 0x908e,
+	0x0004, 0x0110, 0x9085, 0x0001, 0x001e, 0x000e, 0x0005, 0x0006,
+	0x0086, 0x0096, 0x6020, 0x9086, 0x0004, 0x01a8, 0x6014, 0x904d,
+	0x080c, 0xb842, 0x0180, 0xa864, 0x9086, 0x0139, 0x0170, 0x6020,
+	0x90c6, 0x0003, 0x0140, 0x90c6, 0x0002, 0x0128, 0xa868, 0xd0fc,
+	0x0110, 0x9006, 0x0010, 0x9085, 0x0001, 0x009e, 0x008e, 0x000e,
+	0x0005, 0x00c6, 0x0126, 0x2091, 0x8000, 0x080c, 0x9c49, 0x0198,
 	0x2b08, 0x6112, 0x080c, 0xbcdb, 0x6023, 0x0001, 0x2900, 0x6016,
-	0x080c, 0x3006, 0x2009, 0x0028, 0x080c, 0x9c85, 0x9085, 0x0001,
+	0x080c, 0x300e, 0x2009, 0x0028, 0x080c, 0x9c76, 0x9085, 0x0001,
 	0x012e, 0x00ce, 0x0005, 0x9006, 0x0cd8, 0x9186, 0x0015, 0x11a8,
 	0x2011, 0x1823, 0x2204, 0x9086, 0x0074, 0x1178, 0x00b6, 0x080c,
-	0xa818, 0x00be, 0x080c, 0xaa57, 0x6003, 0x0001, 0x6007, 0x0029,
-	0x080c, 0x84d8, 0x080c, 0x8936, 0x0078, 0x6014, 0x0096, 0x2048,
+	0xa80c, 0x00be, 0x080c, 0xaa4b, 0x6003, 0x0001, 0x6007, 0x0029,
+	0x080c, 0x84ba, 0x080c, 0x891b, 0x0078, 0x6014, 0x0096, 0x2048,
 	0xa868, 0x009e, 0xd0fc, 0x0148, 0x2001, 0x0001, 0x080c, 0xbe9a,
-	0x080c, 0xa58f, 0x080c, 0x9be7, 0x0005, 0x0096, 0x6014, 0x904d,
+	0x080c, 0xa581, 0x080c, 0x9bda, 0x0005, 0x0096, 0x6014, 0x904d,
 	0x090c, 0x0d65, 0xa87b, 0x0030, 0xa883, 0x0000, 0xa897, 0x4005,
 	0xa89b, 0x0004, 0xa867, 0x0139, 0x0126, 0x2091, 0x8000, 0x080c,
-	0x6996, 0x012e, 0x009e, 0x080c, 0x9be7, 0x0c30, 0x0096, 0x9186,
-	0x0016, 0x1128, 0x2001, 0x0004, 0x080c, 0x61c1, 0x00e8, 0x9186,
+	0x6991, 0x012e, 0x009e, 0x080c, 0x9bda, 0x0c30, 0x0096, 0x9186,
+	0x0016, 0x1128, 0x2001, 0x0004, 0x080c, 0x61bc, 0x00e8, 0x9186,
 	0x0015, 0x1510, 0x2011, 0x1823, 0x2204, 0x9086, 0x0014, 0x11e0,
-	0x6010, 0x00b6, 0x2058, 0x080c, 0x630b, 0x00be, 0x080c, 0xab28,
+	0x6010, 0x00b6, 0x2058, 0x080c, 0x6306, 0x00be, 0x080c, 0xab1c,
 	0x1198, 0x6010, 0x00b6, 0x2058, 0xb890, 0x00be, 0x9005, 0x0160,
-	0x2001, 0x0006, 0x080c, 0x61c1, 0x6014, 0x2048, 0xa868, 0xd0fc,
-	0x0170, 0x080c, 0x9ff6, 0x0048, 0x6014, 0x2048, 0xa868, 0xd0fc,
-	0x0528, 0x080c, 0xa58f, 0x080c, 0x9be7, 0x009e, 0x0005, 0x6014,
+	0x2001, 0x0006, 0x080c, 0x61bc, 0x6014, 0x2048, 0xa868, 0xd0fc,
+	0x0170, 0x080c, 0x9fe8, 0x0048, 0x6014, 0x2048, 0xa868, 0xd0fc,
+	0x0528, 0x080c, 0xa581, 0x080c, 0x9bda, 0x009e, 0x0005, 0x6014,
 	0x6310, 0x2358, 0x904d, 0x090c, 0x0d65, 0xa87b, 0x0000, 0xa883,
-	0x0000, 0xa897, 0x4000, 0x900e, 0x080c, 0x655f, 0x1108, 0xc185,
+	0x0000, 0xa897, 0x4000, 0x900e, 0x080c, 0x655e, 0x1108, 0xc185,
 	0xb800, 0xd0bc, 0x0108, 0xc18d, 0xa99a, 0x0126, 0x2091, 0x8000,
-	0x080c, 0x6996, 0x012e, 0x080c, 0x9be7, 0x08f8, 0x6014, 0x904d,
+	0x080c, 0x6991, 0x012e, 0x080c, 0x9bda, 0x08f8, 0x6014, 0x904d,
 	0x090c, 0x0d65, 0xa87b, 0x0030, 0xa883, 0x0000, 0xa897, 0x4005,
 	0xa89b, 0x0004, 0xa867, 0x0139, 0x0126, 0x2091, 0x8000, 0x080c,
-	0x6996, 0x012e, 0x080c, 0x9be7, 0x0840, 0xa878, 0x9086, 0x0005,
+	0x6991, 0x012e, 0x080c, 0x9bda, 0x0840, 0xa878, 0x9086, 0x0005,
 	0x1108, 0x0009, 0x0005, 0xa880, 0xc0ad, 0xa882, 0x0005, 0x604b,
 	0x0000, 0x6017, 0x0000, 0x6003, 0x0001, 0x6007, 0x0050, 0x2009,
-	0x8023, 0x080c, 0x84d1, 0x0005, 0x00c6, 0x6010, 0x00b6, 0x2058,
+	0x8023, 0x080c, 0x84b3, 0x0005, 0x00c6, 0x6010, 0x00b6, 0x2058,
 	0xb800, 0x00be, 0xd0bc, 0x0130, 0x0066, 0x6020, 0x9084, 0x000f,
-	0x001b, 0x006e, 0x00ce, 0x0005, 0xb565, 0xbb7e, 0xbb7e, 0xbb81,
-	0xd2c2, 0xd2dd, 0xd2e0, 0xb565, 0xb565, 0xb565, 0xb565, 0xb565,
-	0xb565, 0xb565, 0xb565, 0xb565, 0x080c, 0x0d65, 0xa001, 0xa001,
+	0x001b, 0x006e, 0x00ce, 0x0005, 0xb553, 0xbb7e, 0xbb7e, 0xbb81,
+	0xd2d3, 0xd2ee, 0xd2f1, 0xb553, 0xb553, 0xb553, 0xb553, 0xb553,
+	0xb553, 0xb553, 0xb553, 0xb553, 0x080c, 0x0d65, 0xa001, 0xa001,
 	0x0005, 0x0096, 0x6014, 0x904d, 0x0118, 0xa87c, 0xd0e4, 0x1110,
 	0x009e, 0x0010, 0x009e, 0x0005, 0x6010, 0x00b6, 0x2058, 0xb800,
 	0x00be, 0xd0bc, 0x0550, 0x2001, 0x1833, 0x2004, 0x9005, 0x1540,
-	0x00f6, 0x2c78, 0x080c, 0x9b91, 0x0508, 0x7810, 0x6012, 0x080c,
+	0x00f6, 0x2c78, 0x080c, 0x9b84, 0x0508, 0x7810, 0x6012, 0x080c,
 	0xbcdb, 0x7820, 0x9086, 0x0003, 0x0128, 0x7808, 0x603a, 0x2f00,
 	0x603e, 0x0020, 0x7808, 0x603e, 0x2f00, 0x603a, 0x602e, 0x6023,
 	0x0001, 0x6007, 0x0035, 0x6003, 0x0001, 0x795c, 0x615e, 0x2009,
-	0x8020, 0x080c, 0x84d1, 0x2f60, 0x00fe, 0x0005, 0x2f60, 0x00fe,
-	0x2001, 0x1959, 0x2004, 0x604a, 0x0005, 0x0016, 0x0096, 0x6814,
+	0x8020, 0x080c, 0x84b3, 0x2f60, 0x00fe, 0x0005, 0x2f60, 0x00fe,
+	0x2001, 0x1958, 0x2004, 0x604a, 0x0005, 0x0016, 0x0096, 0x6814,
 	0x2048, 0x681c, 0xd0fc, 0xc0fc, 0x681e, 0xa87c, 0x1108, 0xd0e4,
 	0x0180, 0xc0e4, 0xa87e, 0xa877, 0x0000, 0xa893, 0x0000, 0xa88f,
 	0x0000, 0xd0cc, 0x0130, 0xc0cc, 0xa87e, 0xa878, 0x2048, 0x080c,
@@ -5813,7 +5813,7 @@ unsigned short risc_code01[] = {
 	0x9103, 0x1e48, 0x683c, 0x602e, 0x6838, 0x9084, 0xfffc, 0x683a,
 	0x6032, 0x2d00, 0x603a, 0x6808, 0x603e, 0x6910, 0x6112, 0x695c,
 	0x615e, 0x6023, 0x0001, 0x6007, 0x0039, 0x6003, 0x0001, 0x2009,
-	0x8020, 0x080c, 0x84d1, 0x009e, 0x001e, 0x0005, 0x6024, 0xd0d4,
+	0x8020, 0x080c, 0x84b3, 0x009e, 0x001e, 0x0005, 0x6024, 0xd0d4,
 	0x0510, 0xd0f4, 0x11f8, 0x6038, 0x940a, 0x603c, 0x9303, 0x0230,
 	0x9105, 0x0120, 0x6024, 0xc0d4, 0xc0f5, 0x0098, 0x643a, 0x633e,
 	0xac3e, 0xab42, 0x0046, 0x0036, 0x2400, 0xacac, 0x9402, 0xa836,
@@ -5824,837 +5824,839 @@ unsigned short risc_code01[] = {
 	0x0188, 0x908e, 0x0037, 0x0170, 0x908e, 0x0038, 0x0158, 0x908e,
 	0x0039, 0x0140, 0x908e, 0x003a, 0x0128, 0x908e, 0x003b, 0x0110,
 	0x9085, 0x0001, 0x001e, 0x000e, 0x0005, 0x0006, 0x0016, 0x0026,
-	0x0036, 0x00e6, 0x2001, 0x1953, 0x200c, 0x8000, 0x2014, 0x2001,
-	0x0032, 0x080c, 0x8419, 0x2001, 0x1957, 0x82ff, 0x1110, 0x2011,
-	0x0014, 0x2202, 0x2001, 0x1955, 0x200c, 0x8000, 0x2014, 0x2071,
-	0x193d, 0x711a, 0x721e, 0x2001, 0x0064, 0x080c, 0x8419, 0x2001,
-	0x1958, 0x82ff, 0x1110, 0x2011, 0x0014, 0x2202, 0x2001, 0x1959,
-	0x9288, 0x000a, 0x2102, 0x2001, 0x0017, 0x080c, 0x98b9, 0x2001,
-	0x1a59, 0x2102, 0x2001, 0x0032, 0x080c, 0x159e, 0x080c, 0x6648,
+	0x0036, 0x00e6, 0x2001, 0x1952, 0x200c, 0x8000, 0x2014, 0x2001,
+	0x0032, 0x080c, 0x83fb, 0x2001, 0x1956, 0x82ff, 0x1110, 0x2011,
+	0x0014, 0x2202, 0x2001, 0x1954, 0x200c, 0x8000, 0x2014, 0x2071,
+	0x193c, 0x711a, 0x721e, 0x2001, 0x0064, 0x080c, 0x83fb, 0x2001,
+	0x1957, 0x82ff, 0x1110, 0x2011, 0x0014, 0x2202, 0x2001, 0x1958,
+	0x9288, 0x000a, 0x2102, 0x2001, 0x0017, 0x080c, 0x98ac, 0x2001,
+	0x1a58, 0x2102, 0x2001, 0x0032, 0x080c, 0x15ab, 0x080c, 0x6647,
 	0x00ee, 0x003e, 0x002e, 0x001e, 0x000e, 0x0005, 0x0006, 0x0016,
-	0x00e6, 0x2001, 0x1957, 0x2003, 0x0028, 0x2001, 0x1958, 0x2003,
-	0x0014, 0x2071, 0x193d, 0x701b, 0x0000, 0x701f, 0x07d0, 0x2001,
-	0x1959, 0x2009, 0x001e, 0x2102, 0x2001, 0x0017, 0x080c, 0x98b9,
-	0x2001, 0x1a59, 0x2102, 0x2001, 0x0032, 0x080c, 0x159e, 0x00ee,
+	0x00e6, 0x2001, 0x1956, 0x2003, 0x0028, 0x2001, 0x1957, 0x2003,
+	0x0014, 0x2071, 0x193c, 0x701b, 0x0000, 0x701f, 0x07d0, 0x2001,
+	0x1958, 0x2009, 0x001e, 0x2102, 0x2001, 0x0017, 0x080c, 0x98ac,
+	0x2001, 0x1a58, 0x2102, 0x2001, 0x0032, 0x080c, 0x15ab, 0x00ee,
 	0x001e, 0x000e, 0x0005, 0x0096, 0x6060, 0x904d, 0x0110, 0x080c,
 	0x1054, 0x009e, 0x0005, 0x0005, 0x00c6, 0x0126, 0x2091, 0x8000,
-	0x080c, 0x9b91, 0x0180, 0x2b08, 0x6112, 0x0ca9, 0x6023, 0x0001,
-	0x2900, 0x6016, 0x2009, 0x0033, 0x080c, 0x9c85, 0x9085, 0x0001,
+	0x080c, 0x9b84, 0x0180, 0x2b08, 0x6112, 0x0ca9, 0x6023, 0x0001,
+	0x2900, 0x6016, 0x2009, 0x0033, 0x080c, 0x9c76, 0x9085, 0x0001,
 	0x012e, 0x00ce, 0x0005, 0x9006, 0x0cd8, 0x0096, 0x00e6, 0x00f6,
 	0x2071, 0x1800, 0x9186, 0x0015, 0x1500, 0x708c, 0x9086, 0x0018,
 	0x11e0, 0x6014, 0x2048, 0xaa3c, 0xd2e4, 0x1160, 0x2c78, 0x080c,
-	0x89f5, 0x01d8, 0x7078, 0xaa50, 0x9206, 0x1160, 0x707c, 0xaa54,
+	0x89da, 0x01d8, 0x7078, 0xaa50, 0x9206, 0x1160, 0x707c, 0xaa54,
 	0x9206, 0x1140, 0x6210, 0x00b6, 0x2258, 0xbaa0, 0x00be, 0x900e,
-	0x080c, 0x305b, 0x080c, 0x9ff6, 0x0020, 0x080c, 0xa58f, 0x080c,
-	0x9be7, 0x00fe, 0x00ee, 0x009e, 0x0005, 0x705c, 0xaa54, 0x9206,
-	0x0d48, 0x0c80, 0x00c6, 0x0126, 0x2091, 0x8000, 0x080c, 0x9b91,
+	0x080c, 0x305d, 0x080c, 0x9fe8, 0x0020, 0x080c, 0xa581, 0x080c,
+	0x9bda, 0x00fe, 0x00ee, 0x009e, 0x0005, 0x705c, 0xaa54, 0x9206,
+	0x0d48, 0x0c80, 0x00c6, 0x0126, 0x2091, 0x8000, 0x080c, 0x9b84,
 	0x0188, 0x2b08, 0x6112, 0x080c, 0xbcdb, 0x6023, 0x0001, 0x2900,
-	0x6016, 0x2009, 0x004d, 0x080c, 0x9c85, 0x9085, 0x0001, 0x012e,
+	0x6016, 0x2009, 0x004d, 0x080c, 0x9c76, 0x9085, 0x0001, 0x012e,
 	0x00ce, 0x0005, 0x9006, 0x0cd8, 0x00c6, 0x0126, 0x2091, 0x8000,
-	0x0016, 0x080c, 0x9b91, 0x0180, 0x2b08, 0x6112, 0x080c, 0xbcdb,
-	0x6023, 0x0001, 0x2900, 0x6016, 0x001e, 0x080c, 0x9c85, 0x9085,
+	0x0016, 0x080c, 0x9b84, 0x0180, 0x2b08, 0x6112, 0x080c, 0xbcdb,
+	0x6023, 0x0001, 0x2900, 0x6016, 0x001e, 0x080c, 0x9c76, 0x9085,
 	0x0001, 0x012e, 0x00ce, 0x0005, 0x001e, 0x9006, 0x0cd0, 0x0016,
 	0x0026, 0x0036, 0x0046, 0x0056, 0x0066, 0x0096, 0x00e6, 0x00f6,
 	0x2071, 0x1800, 0x9186, 0x0015, 0x1568, 0x718c, 0x6014, 0x2048,
-	0xa814, 0x8003, 0x9106, 0x1530, 0x20e1, 0x0000, 0x2001, 0x1971,
+	0xa814, 0x8003, 0x9106, 0x1530, 0x20e1, 0x0000, 0x2001, 0x1970,
 	0x2003, 0x0000, 0x6014, 0x2048, 0xa830, 0x20a8, 0x8906, 0x8006,
 	0x8007, 0x9094, 0x003f, 0x22e8, 0x9084, 0xffc0, 0x9080, 0x001b,
-	0x20a0, 0x2001, 0x1971, 0x0016, 0x200c, 0x080c, 0xc545, 0x001e,
+	0x20a0, 0x2001, 0x1970, 0x0016, 0x200c, 0x080c, 0xc553, 0x001e,
 	0xa804, 0x9005, 0x0110, 0x2048, 0x0c38, 0x6014, 0x2048, 0xa867,
-	0x0103, 0x0010, 0x080c, 0xa58f, 0x080c, 0x9be7, 0x00fe, 0x00ee,
+	0x0103, 0x0010, 0x080c, 0xa581, 0x080c, 0x9bda, 0x00fe, 0x00ee,
 	0x009e, 0x006e, 0x005e, 0x004e, 0x003e, 0x002e, 0x001e, 0x0005,
 	0x0096, 0x00e6, 0x00f6, 0x2071, 0x1800, 0x9186, 0x0015, 0x11b8,
 	0x708c, 0x9086, 0x0004, 0x1198, 0x6014, 0x2048, 0x2c78, 0x080c,
-	0x89f5, 0x01a8, 0x7078, 0xaa74, 0x9206, 0x1130, 0x707c, 0xaa78,
-	0x9206, 0x1110, 0x080c, 0x3006, 0x080c, 0x9ff6, 0x0020, 0x080c,
-	0xa58f, 0x080c, 0x9be7, 0x00fe, 0x00ee, 0x009e, 0x0005, 0x705c,
+	0x89da, 0x01a8, 0x7078, 0xaa74, 0x9206, 0x1130, 0x707c, 0xaa78,
+	0x9206, 0x1110, 0x080c, 0x300e, 0x080c, 0x9fe8, 0x0020, 0x080c,
+	0xa581, 0x080c, 0x9bda, 0x00fe, 0x00ee, 0x009e, 0x0005, 0x705c,
 	0xaa78, 0x9206, 0x0d78, 0x0c80, 0x0096, 0x00e6, 0x00f6, 0x2071,
 	0x1800, 0x9186, 0x0015, 0x1550, 0x708c, 0x9086, 0x0004, 0x1530,
-	0x6014, 0x2048, 0x2c78, 0x080c, 0x89f5, 0x05f0, 0x7078, 0xaacc,
-	0x9206, 0x1180, 0x707c, 0xaad0, 0x9206, 0x1160, 0x080c, 0x3006,
-	0x0016, 0xa998, 0xaab0, 0x9284, 0x1000, 0xc0fd, 0x080c, 0x5345,
-	0x001e, 0x0010, 0x080c, 0x512e, 0x080c, 0xb847, 0x0508, 0xa87b,
-	0x0000, 0xa883, 0x0000, 0xa897, 0x4000, 0x0080, 0x080c, 0xb847,
-	0x01b8, 0x6014, 0x2048, 0x080c, 0x512e, 0x1d70, 0xa87b, 0x0030,
+	0x6014, 0x2048, 0x2c78, 0x080c, 0x89da, 0x05f0, 0x7078, 0xaacc,
+	0x9206, 0x1180, 0x707c, 0xaad0, 0x9206, 0x1160, 0x080c, 0x300e,
+	0x0016, 0xa998, 0xaab0, 0x9284, 0x1000, 0xc0fd, 0x080c, 0x5340,
+	0x001e, 0x0010, 0x080c, 0x5129, 0x080c, 0xb842, 0x0508, 0xa87b,
+	0x0000, 0xa883, 0x0000, 0xa897, 0x4000, 0x0080, 0x080c, 0xb842,
+	0x01b8, 0x6014, 0x2048, 0x080c, 0x5129, 0x1d70, 0xa87b, 0x0030,
 	0xa883, 0x0000, 0xa897, 0x4005, 0xa89b, 0x0004, 0x0126, 0x2091,
-	0x8000, 0xa867, 0x0139, 0x080c, 0x6996, 0x012e, 0x080c, 0x9be7,
+	0x8000, 0xa867, 0x0139, 0x080c, 0x6991, 0x012e, 0x080c, 0x9bda,
 	0x00fe, 0x00ee, 0x009e, 0x0005, 0x705c, 0xaad0, 0x9206, 0x0930,
 	0x0888, 0x0016, 0x0026, 0xa87c, 0xd0ac, 0x0178, 0xa938, 0xaa34,
 	0x2100, 0x9205, 0x0150, 0xa890, 0x9106, 0x1118, 0xa88c, 0x9206,
 	0x0120, 0xa992, 0xaa8e, 0x9085, 0x0001, 0x002e, 0x001e, 0x0005,
-	0x00b6, 0x00d6, 0x0036, 0x080c, 0xb847, 0x0904, 0xbe96, 0x0096,
+	0x00b6, 0x00d6, 0x0036, 0x080c, 0xb842, 0x0904, 0xbe96, 0x0096,
 	0x6314, 0x2348, 0xa87a, 0xa982, 0x929e, 0x4000, 0x1580, 0x6310,
 	0x00c6, 0x2358, 0x2009, 0x0000, 0xa868, 0xd0f4, 0x1140, 0x080c,
-	0x655f, 0x1108, 0xc185, 0xb800, 0xd0bc, 0x0108, 0xc18d, 0xaa96,
+	0x655e, 0x1108, 0xc185, 0xb800, 0xd0bc, 0x0108, 0xc18d, 0xaa96,
 	0xa99a, 0x20a9, 0x0004, 0xa860, 0x20e8, 0xa85c, 0x9080, 0x0031,
 	0x20a0, 0xb8b4, 0x20e0, 0xb8b8, 0x9080, 0x0006, 0x2098, 0x080c,
 	0x0f9f, 0x20a9, 0x0004, 0xa85c, 0x9080, 0x0035, 0x20a0, 0xb8b8,
 	0x9080, 0x000a, 0x2098, 0x080c, 0x0f9f, 0x00ce, 0x0090, 0xaa96,
 	0x3918, 0x9398, 0x0007, 0x231c, 0x6004, 0x9086, 0x0016, 0x0110,
 	0xa89b, 0x0004, 0xaba2, 0x6310, 0x2358, 0xb804, 0x9084, 0x00ff,
-	0xa89e, 0x080c, 0x698a, 0x6017, 0x0000, 0x009e, 0x003e, 0x00de,
+	0xa89e, 0x080c, 0x6985, 0x6017, 0x0000, 0x009e, 0x003e, 0x00de,
 	0x00be, 0x0005, 0x0026, 0x0036, 0x0046, 0x00b6, 0x0096, 0x00f6,
 	0x6214, 0x2248, 0x6210, 0x2258, 0x2079, 0x0260, 0x9096, 0x0000,
-	0x11a0, 0xb814, 0x9084, 0x00ff, 0x900e, 0x080c, 0x2424, 0x2118,
+	0x11a0, 0xb814, 0x9084, 0x00ff, 0x900e, 0x080c, 0x243d, 0x2118,
 	0x831f, 0x939c, 0xff00, 0x7838, 0x9084, 0x00ff, 0x931d, 0x7c3c,
-	0x2011, 0x8018, 0x080c, 0x48d8, 0x00a8, 0x9096, 0x0001, 0x1148,
+	0x2011, 0x8018, 0x080c, 0x48da, 0x00a8, 0x9096, 0x0001, 0x1148,
 	0x89ff, 0x0180, 0xa89b, 0x000d, 0x7838, 0xa8a6, 0x783c, 0xa8aa,
 	0x0048, 0x9096, 0x0002, 0x1130, 0xa89b, 0x000d, 0x7838, 0xa8a6,
 	0x783c, 0xa8aa, 0x00fe, 0x009e, 0x00be, 0x004e, 0x003e, 0x002e,
 	0x0005, 0x00c6, 0x0026, 0x0016, 0x9186, 0x0035, 0x0110, 0x6a38,
-	0x0008, 0x6a2c, 0x080c, 0xb835, 0x01f0, 0x2260, 0x6120, 0x9186,
+	0x0008, 0x6a2c, 0x080c, 0xb830, 0x01f0, 0x2260, 0x6120, 0x9186,
 	0x0003, 0x0118, 0x9186, 0x0006, 0x1190, 0x6838, 0x9206, 0x0140,
 	0x683c, 0x9206, 0x1160, 0x6108, 0x6838, 0x9106, 0x1140, 0x0020,
 	0x6008, 0x693c, 0x9106, 0x1118, 0x6010, 0x6910, 0x9106, 0x001e,
 	0x002e, 0x00ce, 0x0005, 0x9085, 0x0001, 0x0cc8, 0xa974, 0xd1cc,
 	0x0188, 0x918c, 0x00ff, 0x918e, 0x0002, 0x1160, 0xa9a8, 0x918c,
 	0x0f00, 0x810f, 0x918e, 0x0001, 0x1128, 0xa834, 0xa938, 0x9115,
-	0x190c, 0xaec2, 0x0005, 0x0036, 0x2019, 0x0001, 0x0010, 0x0036,
-	0x901e, 0x0499, 0x01e0, 0x080c, 0xb847, 0x01c8, 0x080c, 0xba36,
+	0x190c, 0xaeb6, 0x0005, 0x0036, 0x2019, 0x0001, 0x0010, 0x0036,
+	0x901e, 0x0499, 0x01e0, 0x080c, 0xb842, 0x01c8, 0x080c, 0xba31,
 	0x6037, 0x4000, 0x6014, 0x6017, 0x0000, 0x0096, 0x2048, 0xa87c,
-	0x080c, 0xba5c, 0x1118, 0x080c, 0xa58f, 0x0040, 0xa867, 0x0103,
-	0xa877, 0x0000, 0x83ff, 0x1129, 0x080c, 0x6996, 0x009e, 0x003e,
+	0x080c, 0xba57, 0x1118, 0x080c, 0xa581, 0x0040, 0xa867, 0x0103,
+	0xa877, 0x0000, 0x83ff, 0x1129, 0x080c, 0x6991, 0x009e, 0x003e,
 	0x0005, 0xa880, 0xd0b4, 0x0128, 0xa87b, 0x0006, 0xc0ec, 0xa882,
 	0x0048, 0xd0bc, 0x0118, 0xa87b, 0x0002, 0x0020, 0xa87b, 0x0005,
 	0x080c, 0xbb4b, 0xa877, 0x0000, 0x0005, 0x2001, 0x1810, 0x2004,
 	0xd0ec, 0x0005, 0x0006, 0x2001, 0x1810, 0x2004, 0xd0f4, 0x000e,
 	0x0005, 0x0006, 0x2001, 0x1810, 0x2004, 0xd0e4, 0x000e, 0x0005,
 	0x0036, 0x0046, 0x6010, 0x00b6, 0x2058, 0xbba0, 0x00be, 0x2021,
-	0x0007, 0x080c, 0x4a75, 0x004e, 0x003e, 0x0005, 0x0c51, 0x1d81,
-	0x0005, 0x2001, 0x1957, 0x2004, 0x601a, 0x0005, 0x2001, 0x1959,
-	0x2004, 0x604a, 0x0005, 0x080c, 0x9be7, 0x0804, 0x8936, 0x611c,
+	0x0007, 0x080c, 0x4a77, 0x004e, 0x003e, 0x0005, 0x0c51, 0x1d81,
+	0x0005, 0x2001, 0x1956, 0x2004, 0x601a, 0x0005, 0x2001, 0x1958,
+	0x2004, 0x604a, 0x0005, 0x080c, 0x9bda, 0x0804, 0x891b, 0x611c,
 	0xd1fc, 0xa97c, 0x1108, 0xd1e4, 0x0005, 0x601c, 0xd0fc, 0xa87c,
 	0x1108, 0xd0e4, 0x0005, 0x601c, 0xd0fc, 0xc0fc, 0x601e, 0xa87c,
-	0x1108, 0xd0e4, 0x0005, 0x6044, 0xd0fc, 0x0160, 0xd0dc, 0x1128,
-	0x908c, 0x000f, 0x9186, 0x0005, 0x1118, 0x6003, 0x0003, 0x0010,
-	0x6003, 0x0001, 0x0005, 0x00b6, 0x0066, 0x6000, 0x90b2, 0x0016,
-	0x1a0c, 0x0d65, 0x001b, 0x006e, 0x00be, 0x0005, 0xbfc6, 0xc6a0,
-	0xc7ef, 0xbfc6, 0xbfc6, 0xbfc6, 0xbfc6, 0xbfc6, 0xbffd, 0xc871,
-	0xbfc6, 0xbfc6, 0xbfc6, 0xbfc6, 0xbfc6, 0xbfc6, 0x080c, 0x0d65,
-	0x0066, 0x6000, 0x90b2, 0x0016, 0x1a0c, 0x0d65, 0x0013, 0x006e,
-	0x0005, 0xbfe1, 0xcd88, 0xbfe1, 0xbfe1, 0xbfe1, 0xbfe1, 0xbfe1,
-	0xbfe1, 0xcd37, 0xcdda, 0xbfe1, 0xd3fd, 0xd431, 0xd3fd, 0xd431,
-	0xbfe1, 0x080c, 0x0d65, 0x6000, 0x9082, 0x0016, 0x1a0c, 0x0d65,
-	0x6000, 0x000a, 0x0005, 0xbffb, 0xca4d, 0xcb16, 0xcb38, 0xcbb3,
-	0xbffb, 0xccad, 0xcc3b, 0xc87b, 0xcd0f, 0xcd24, 0xbffb, 0xbffb,
-	0xbffb, 0xbffb, 0xbffb, 0x080c, 0x0d65, 0x91b2, 0x0053, 0x1a0c,
-	0x0d65, 0x2100, 0x91b2, 0x0040, 0x1a04, 0xc443, 0x0002, 0xc047,
-	0xc234, 0xc047, 0xc047, 0xc047, 0xc23d, 0xc047, 0xc047, 0xc047,
-	0xc047, 0xc047, 0xc047, 0xc047, 0xc047, 0xc047, 0xc047, 0xc047,
-	0xc047, 0xc047, 0xc047, 0xc047, 0xc047, 0xc047, 0xc049, 0xc0b0,
-	0xc0bf, 0xc123, 0xc14e, 0xc1c6, 0xc21f, 0xc047, 0xc047, 0xc240,
-	0xc047, 0xc047, 0xc255, 0xc262, 0xc047, 0xc047, 0xc047, 0xc047,
-	0xc047, 0xc2e5, 0xc047, 0xc047, 0xc2f9, 0xc047, 0xc047, 0xc2b4,
-	0xc047, 0xc047, 0xc047, 0xc311, 0xc047, 0xc047, 0xc047, 0xc38e,
-	0xc047, 0xc047, 0xc047, 0xc047, 0xc047, 0xc047, 0xc40b, 0x080c,
-	0x0d65, 0x080c, 0x6625, 0x1150, 0x2001, 0x1836, 0x2004, 0xd0cc,
-	0x1128, 0x9084, 0x0009, 0x9086, 0x0008, 0x1140, 0x6007, 0x0009,
-	0x602f, 0x0009, 0x6017, 0x0000, 0x0804, 0xc22d, 0x080c, 0x660e,
-	0x00e6, 0x00c6, 0x0036, 0x0026, 0x0016, 0x6210, 0x2258, 0xbaa0,
-	0x0026, 0x2019, 0x0029, 0x080c, 0x98c8, 0x080c, 0x863b, 0x0076,
-	0x903e, 0x080c, 0x852a, 0x2c08, 0x080c, 0xcfc8, 0x007e, 0x001e,
-	0x080c, 0x98e4, 0x001e, 0x002e, 0x003e, 0x00ce, 0x00ee, 0x6610,
-	0x2658, 0x080c, 0x627f, 0xbe04, 0x9684, 0x00ff, 0x9082, 0x0006,
-	0x1268, 0x0016, 0x0026, 0x6210, 0x00b6, 0x2258, 0xbaa0, 0x00be,
-	0x2c08, 0x080c, 0xd5a9, 0x002e, 0x001e, 0x1178, 0x080c, 0xcef7,
-	0x1904, 0xc11b, 0x080c, 0xce93, 0x1120, 0x6007, 0x0008, 0x0804,
-	0xc22d, 0x6007, 0x0009, 0x0804, 0xc22d, 0x080c, 0xd0fe, 0x0128,
-	0x080c, 0xcef7, 0x0d78, 0x0804, 0xc11b, 0x6017, 0x1900, 0x0c88,
-	0x080c, 0x3150, 0x1904, 0xc440, 0x6106, 0x080c, 0xce44, 0x6007,
-	0x0006, 0x0804, 0xc22d, 0x6007, 0x0007, 0x0804, 0xc22d, 0x080c,
-	0xd46d, 0x1904, 0xc440, 0x080c, 0x3150, 0x1904, 0xc440, 0x00d6,
-	0x6610, 0x2658, 0xbe04, 0x9684, 0x00ff, 0x9082, 0x0006, 0x1220,
-	0x2001, 0x0001, 0x080c, 0x61ad, 0x96b4, 0xff00, 0x8637, 0x9686,
-	0x0006, 0x0188, 0x9686, 0x0004, 0x0170, 0xbe04, 0x96b4, 0x00ff,
-	0x9686, 0x0006, 0x0140, 0x9686, 0x0004, 0x0128, 0x9686, 0x0005,
-	0x0110, 0x00de, 0x0480, 0x00e6, 0x2071, 0x0260, 0x7034, 0x9084,
-	0x0003, 0x1140, 0x7034, 0x9082, 0x0014, 0x0220, 0x7030, 0x9084,
-	0x0003, 0x0130, 0x00ee, 0x6017, 0x0000, 0x602f, 0x0007, 0x00b0,
-	0x00ee, 0x080c, 0xcf5e, 0x1190, 0x9686, 0x0006, 0x1140, 0x0026,
-	0x6210, 0x2258, 0xbaa0, 0x900e, 0x080c, 0x305b, 0x002e, 0x080c,
-	0x630b, 0x6007, 0x000a, 0x00de, 0x0804, 0xc22d, 0x6007, 0x000b,
-	0x00de, 0x0804, 0xc22d, 0x080c, 0x3006, 0x080c, 0xbf76, 0x6007,
-	0x0001, 0x0804, 0xc22d, 0x080c, 0xd46d, 0x1904, 0xc440, 0x080c,
-	0x3150, 0x1904, 0xc440, 0x2071, 0x0260, 0x7034, 0x90b4, 0x0003,
-	0x1948, 0x90b2, 0x0014, 0x0a30, 0x7030, 0x9084, 0x0003, 0x1910,
-	0x6610, 0x2658, 0xbe04, 0x9686, 0x0707, 0x09e8, 0x0026, 0x6210,
-	0x2258, 0xbaa0, 0x900e, 0x080c, 0x305b, 0x002e, 0x6007, 0x000c,
-	0x2001, 0x0001, 0x080c, 0xd589, 0x0804, 0xc22d, 0x080c, 0x6625,
-	0x1140, 0x2001, 0x1836, 0x2004, 0x9084, 0x0009, 0x9086, 0x0008,
-	0x1110, 0x0804, 0xc056, 0x080c, 0x660e, 0x6610, 0x2658, 0xbe04,
-	0x9684, 0x00ff, 0x9082, 0x0006, 0x06c0, 0x1138, 0x0026, 0x2001,
-	0x0006, 0x080c, 0x61ed, 0x002e, 0x0050, 0x96b4, 0xff00, 0x8637,
-	0x9686, 0x0004, 0x0120, 0x9686, 0x0006, 0x1904, 0xc11b, 0x080c,
-	0xcf6b, 0x1120, 0x6007, 0x000e, 0x0804, 0xc22d, 0x0046, 0x6410,
-	0x2458, 0xbca0, 0x0046, 0x080c, 0x3006, 0x080c, 0xbf76, 0x004e,
-	0x0016, 0x9006, 0x2009, 0x1854, 0x210c, 0x0048, 0x2009, 0x0029,
-	0x080c, 0xd273, 0x6010, 0x2058, 0xb800, 0xc0e5, 0xb802, 0x001e,
-	0x004e, 0x6007, 0x0001, 0x0804, 0xc22d, 0x2001, 0x0001, 0x080c,
-	0x61ad, 0x0156, 0x0016, 0x0026, 0x0036, 0x20a9, 0x0004, 0x2019,
-	0x1805, 0x2011, 0x0270, 0x080c, 0xabcb, 0x003e, 0x002e, 0x001e,
-	0x015e, 0x9005, 0x0168, 0x96b4, 0xff00, 0x8637, 0x9682, 0x0004,
-	0x0a04, 0xc11b, 0x9682, 0x0007, 0x0a04, 0xc177, 0x0804, 0xc11b,
-	0x6017, 0x1900, 0x6007, 0x0009, 0x0804, 0xc22d, 0x080c, 0x6625,
-	0x1140, 0x2001, 0x1836, 0x2004, 0x9084, 0x0009, 0x9086, 0x0008,
-	0x1110, 0x0804, 0xc056, 0x080c, 0x660e, 0x6610, 0x2658, 0xbe04,
-	0x9684, 0x00ff, 0x9082, 0x0006, 0x0690, 0x0150, 0x96b4, 0xff00,
-	0x8637, 0x9686, 0x0004, 0x0120, 0x9686, 0x0006, 0x1904, 0xc11b,
-	0x080c, 0xcf99, 0x1130, 0x080c, 0xce93, 0x1118, 0x6007, 0x0010,
-	0x04e0, 0x0046, 0x6410, 0x2458, 0xbca0, 0x0046, 0x080c, 0x3006,
-	0x080c, 0xbf76, 0x004e, 0x0016, 0x9006, 0x2009, 0x1854, 0x210c,
-	0x0048, 0x2009, 0x0029, 0x080c, 0xd273, 0x6010, 0x2058, 0xb800,
-	0xc0e5, 0xb802, 0x001e, 0x004e, 0x6007, 0x0001, 0x00f0, 0x080c,
-	0xd0fe, 0x0140, 0x96b4, 0xff00, 0x8637, 0x9686, 0x0006, 0x0980,
-	0x0804, 0xc11b, 0x6017, 0x1900, 0x6007, 0x0009, 0x0070, 0x080c,
-	0x3150, 0x1904, 0xc440, 0x080c, 0xd46d, 0x1904, 0xc440, 0x080c,
-	0xc5e0, 0x1904, 0xc11b, 0x6007, 0x0012, 0x6003, 0x0001, 0x080c,
-	0x84d8, 0x080c, 0x8936, 0x0005, 0x6007, 0x0001, 0x6003, 0x0001,
-	0x080c, 0x84d8, 0x080c, 0x8936, 0x0cb0, 0x6007, 0x0005, 0x0c68,
-	0x080c, 0xd46d, 0x1904, 0xc440, 0x080c, 0x3150, 0x1904, 0xc440,
-	0x080c, 0xc5e0, 0x1904, 0xc11b, 0x6007, 0x0020, 0x6003, 0x0001,
-	0x080c, 0x84d8, 0x080c, 0x8936, 0x0005, 0x080c, 0x3150, 0x1904,
-	0xc440, 0x6007, 0x0023, 0x6003, 0x0001, 0x080c, 0x84d8, 0x080c,
-	0x8936, 0x0005, 0x080c, 0xd46d, 0x1904, 0xc440, 0x080c, 0x3150,
-	0x1904, 0xc440, 0x080c, 0xc5e0, 0x1904, 0xc11b, 0x0016, 0x0026,
-	0x00e6, 0x2071, 0x0260, 0x7244, 0x9286, 0xffff, 0x0180, 0x2c08,
-	0x080c, 0xb835, 0x01b0, 0x2260, 0x7240, 0x6008, 0x9206, 0x1188,
-	0x6010, 0x9190, 0x0004, 0x2214, 0x9206, 0x01b8, 0x0050, 0x7240,
-	0x2c08, 0x9006, 0x080c, 0xd245, 0x1180, 0x7244, 0x9286, 0xffff,
-	0x01b0, 0x2160, 0x6007, 0x0026, 0x6017, 0x1700, 0x7214, 0x9296,
-	0xffff, 0x1180, 0x6007, 0x0025, 0x0068, 0x6020, 0x9086, 0x0007,
-	0x1d80, 0x6004, 0x9086, 0x0024, 0x1110, 0x080c, 0x9be7, 0x2160,
-	0x6007, 0x0025, 0x6003, 0x0001, 0x080c, 0x84d8, 0x080c, 0x8936,
-	0x00ee, 0x002e, 0x001e, 0x0005, 0x2001, 0x0001, 0x080c, 0x61ad,
-	0x0156, 0x0016, 0x0026, 0x0036, 0x20a9, 0x0004, 0x2019, 0x1805,
-	0x2011, 0x0276, 0x080c, 0xabcb, 0x003e, 0x002e, 0x001e, 0x015e,
-	0x0120, 0x6007, 0x0031, 0x0804, 0xc22d, 0x080c, 0xa830, 0x080c,
-	0x70b7, 0x1190, 0x0006, 0x0026, 0x0036, 0x080c, 0x70d1, 0x1138,
-	0x080c, 0x73b7, 0x080c, 0x5cdc, 0x080c, 0x6fe8, 0x0010, 0x080c,
-	0x708b, 0x003e, 0x002e, 0x000e, 0x0005, 0x080c, 0x3150, 0x1904,
-	0xc440, 0x080c, 0xc5e0, 0x1904, 0xc11b, 0x6106, 0x080c, 0xc5fc,
-	0x1120, 0x6007, 0x002b, 0x0804, 0xc22d, 0x6007, 0x002c, 0x0804,
-	0xc22d, 0x080c, 0xd46d, 0x1904, 0xc440, 0x080c, 0x3150, 0x1904,
-	0xc440, 0x080c, 0xc5e0, 0x1904, 0xc11b, 0x6106, 0x080c, 0xc601,
-	0x1120, 0x6007, 0x002e, 0x0804, 0xc22d, 0x6007, 0x002f, 0x0804,
-	0xc22d, 0x080c, 0x3150, 0x1904, 0xc440, 0x00e6, 0x00d6, 0x00c6,
-	0x6010, 0x2058, 0xb904, 0x9184, 0x00ff, 0x9086, 0x0006, 0x0158,
-	0x9184, 0xff00, 0x8007, 0x9086, 0x0006, 0x0128, 0x00ce, 0x00de,
-	0x00ee, 0x0804, 0xc234, 0x080c, 0x5391, 0xd0e4, 0x0904, 0xc38b,
-	0x2071, 0x026c, 0x7010, 0x603a, 0x7014, 0x603e, 0x7108, 0x720c,
-	0x080c, 0x6663, 0x0140, 0x6010, 0x2058, 0xb810, 0x9106, 0x1118,
-	0xb814, 0x9206, 0x0510, 0x080c, 0x665f, 0x15b8, 0x2069, 0x1800,
-	0x687c, 0x9206, 0x1590, 0x6878, 0x9106, 0x1578, 0x7210, 0x080c,
-	0xb835, 0x0590, 0x080c, 0xc4cb, 0x0578, 0x080c, 0xd2ef, 0x0560,
-	0x622e, 0x6007, 0x0036, 0x6003, 0x0001, 0x2009, 0x8020, 0x080c,
-	0x84d1, 0x00ce, 0x00de, 0x00ee, 0x0005, 0x7214, 0x9286, 0xffff,
-	0x0150, 0x080c, 0xb835, 0x01c0, 0x9280, 0x0002, 0x2004, 0x7110,
-	0x9106, 0x1190, 0x08e0, 0x7210, 0x2c08, 0x9085, 0x0001, 0x080c,
-	0xd245, 0x2c10, 0x2160, 0x0140, 0x0890, 0x6007, 0x0037, 0x602f,
-	0x0009, 0x6017, 0x1500, 0x08b8, 0x6007, 0x0037, 0x602f, 0x0003,
-	0x6017, 0x1700, 0x0880, 0x6007, 0x0012, 0x0868, 0x080c, 0x3150,
-	0x1904, 0xc440, 0x6010, 0x2058, 0xb804, 0x9084, 0xff00, 0x8007,
-	0x9086, 0x0006, 0x1904, 0xc234, 0x00e6, 0x00d6, 0x00c6, 0x080c,
-	0x5391, 0xd0e4, 0x0904, 0xc403, 0x2069, 0x1800, 0x2071, 0x026c,
-	0x7008, 0x603a, 0x720c, 0x623e, 0x9286, 0xffff, 0x1150, 0x7208,
-	0x00c6, 0x2c08, 0x9085, 0x0001, 0x080c, 0xd245, 0x2c10, 0x00ce,
-	0x05e8, 0x080c, 0xb835, 0x05d0, 0x7108, 0x9280, 0x0002, 0x2004,
-	0x9106, 0x15a0, 0x00c6, 0x0026, 0x2260, 0x080c, 0xb445, 0x002e,
-	0x00ce, 0x7118, 0x918c, 0xff00, 0x810f, 0x9186, 0x0001, 0x0178,
-	0x9186, 0x0005, 0x0118, 0x9186, 0x0007, 0x1198, 0x9280, 0x0005,
-	0x2004, 0x9005, 0x0170, 0x080c, 0xc4cb, 0x0904, 0xc384, 0x0056,
-	0x7510, 0x7614, 0x080c, 0xd308, 0x005e, 0x00ce, 0x00de, 0x00ee,
-	0x0005, 0x6007, 0x003b, 0x602f, 0x0009, 0x6017, 0x2a00, 0x6003,
-	0x0001, 0x2009, 0x8020, 0x080c, 0x84d1, 0x0c78, 0x6007, 0x003b,
-	0x602f, 0x0003, 0x6017, 0x0300, 0x6003, 0x0001, 0x2009, 0x8020,
-	0x080c, 0x84d1, 0x0c10, 0x6007, 0x003b, 0x602f, 0x000b, 0x6017,
-	0x0000, 0x0804, 0xc35b, 0x00e6, 0x0026, 0x080c, 0x6625, 0x0550,
-	0x080c, 0x660e, 0x080c, 0xd4df, 0x1518, 0x2071, 0x1800, 0x70d8,
-	0x9085, 0x0003, 0x70da, 0x00f6, 0x2079, 0x0100, 0x72ac, 0x9284,
-	0x00ff, 0x707a, 0x78e6, 0x9284, 0xff00, 0x727c, 0x9205, 0x707e,
-	0x78ea, 0x00fe, 0x70e3, 0x0000, 0x080c, 0x6663, 0x0120, 0x2011,
-	0x19da, 0x2013, 0x07d0, 0xd0ac, 0x1128, 0x080c, 0x2ddb, 0x0010,
-	0x080c, 0xd511, 0x002e, 0x00ee, 0x080c, 0x9be7, 0x0804, 0xc233,
-	0x080c, 0x9be7, 0x0005, 0x2600, 0x0002, 0xc457, 0xc457, 0xc457,
-	0xc457, 0xc457, 0xc459, 0xc457, 0xc457, 0xc457, 0xc457, 0xc476,
-	0xc457, 0xc457, 0xc457, 0xc488, 0xc495, 0xc4c6, 0xc457, 0x080c,
-	0x0d65, 0x080c, 0xd46d, 0x1d20, 0x080c, 0x3150, 0x1d08, 0x080c,
-	0xc5e0, 0x1148, 0x7038, 0x6016, 0x6007, 0x0045, 0x6003, 0x0001,
-	0x080c, 0x84d8, 0x0005, 0x080c, 0x3006, 0x080c, 0xbf76, 0x6007,
-	0x0001, 0x6003, 0x0001, 0x080c, 0x84d8, 0x0005, 0x080c, 0xd46d,
-	0x1938, 0x080c, 0x3150, 0x1920, 0x080c, 0xc5e0, 0x1d60, 0x703c,
-	0x6016, 0x6007, 0x004a, 0x6003, 0x0001, 0x080c, 0x84d8, 0x0005,
-	0x080c, 0xc4e8, 0x0904, 0xc440, 0x6007, 0x004e, 0x6003, 0x0001,
-	0x080c, 0x84d8, 0x080c, 0x8936, 0x0005, 0x6007, 0x004f, 0x6017,
-	0x0000, 0x7134, 0x918c, 0x00ff, 0x81ff, 0x0508, 0x9186, 0x0001,
-	0x1160, 0x7140, 0x2001, 0x198e, 0x2004, 0x9106, 0x11b0, 0x7144,
-	0x2001, 0x198f, 0x2004, 0x9106, 0x0190, 0x9186, 0x0002, 0x1168,
-	0x2011, 0x0276, 0x20a9, 0x0004, 0x6010, 0x0096, 0x2048, 0x2019,
-	0x000a, 0x080c, 0xabdf, 0x009e, 0x0110, 0x6017, 0x0001, 0x6003,
-	0x0001, 0x080c, 0x84d8, 0x080c, 0x8936, 0x0005, 0x6007, 0x0050,
-	0x703c, 0x6016, 0x0ca0, 0x0016, 0x00e6, 0x2071, 0x0260, 0x00b6,
-	0x00c6, 0x2260, 0x6010, 0x2058, 0xb8c4, 0xd084, 0x0150, 0x7128,
-	0x6050, 0x9106, 0x1120, 0x712c, 0x604c, 0x9106, 0x0110, 0x9006,
-	0x0010, 0x9085, 0x0001, 0x00ce, 0x00be, 0x00ee, 0x001e, 0x0005,
-	0x0016, 0x0096, 0x0086, 0x00e6, 0x01c6, 0x01d6, 0x0126, 0x2091,
-	0x8000, 0x2071, 0x1800, 0x708c, 0x908a, 0x00f9, 0x16e8, 0x20e1,
-	0x0000, 0x2001, 0x1971, 0x2003, 0x0000, 0x080c, 0x103b, 0x05a0,
-	0x2900, 0x6016, 0x708c, 0x8004, 0xa816, 0x908a, 0x001e, 0x02d0,
-	0xa833, 0x001e, 0x20a9, 0x001e, 0xa860, 0x20e8, 0xa85c, 0x9080,
-	0x001b, 0x20a0, 0x2001, 0x1971, 0x0016, 0x200c, 0x0471, 0x001e,
-	0x2940, 0x080c, 0x103b, 0x01c0, 0x2900, 0xa006, 0x2100, 0x81ff,
-	0x0180, 0x0c18, 0xa832, 0x20a8, 0xa860, 0x20e8, 0xa85c, 0x9080,
-	0x001b, 0x20a0, 0x2001, 0x1971, 0x0016, 0x200c, 0x00b1, 0x001e,
-	0x0000, 0x9085, 0x0001, 0x0048, 0x2071, 0x1800, 0x708f, 0x0000,
-	0x6014, 0x2048, 0x080c, 0x0fd4, 0x9006, 0x012e, 0x01de, 0x01ce,
-	0x00ee, 0x008e, 0x009e, 0x001e, 0x0005, 0x0006, 0x0016, 0x0026,
-	0x0036, 0x00c6, 0x918c, 0xffff, 0x11a8, 0x080c, 0x202b, 0x2099,
-	0x026c, 0x2001, 0x0014, 0x3518, 0x9312, 0x1218, 0x23a8, 0x4003,
-	0x00f8, 0x20a8, 0x4003, 0x22a8, 0x8108, 0x080c, 0x202b, 0x2099,
-	0x0260, 0x0ca8, 0x080c, 0x202b, 0x2061, 0x1971, 0x6004, 0x2098,
-	0x6008, 0x3518, 0x9312, 0x1218, 0x23a8, 0x4003, 0x0048, 0x20a8,
-	0x4003, 0x22a8, 0x8108, 0x080c, 0x202b, 0x2099, 0x0260, 0x0ca8,
-	0x2061, 0x1971, 0x2019, 0x0280, 0x3300, 0x931e, 0x0110, 0x6006,
-	0x0020, 0x2001, 0x0260, 0x6006, 0x8108, 0x2162, 0x9292, 0x0021,
-	0x9296, 0xffff, 0x620a, 0x00ce, 0x003e, 0x002e, 0x001e, 0x000e,
-	0x0005, 0x0006, 0x0016, 0x0026, 0x0036, 0x00c6, 0x81ff, 0x11b8,
-	0x080c, 0x2043, 0x20a1, 0x024c, 0x2001, 0x0014, 0x3518, 0x9312,
-	0x1218, 0x23a8, 0x4003, 0x0418, 0x20a8, 0x4003, 0x82ff, 0x01f8,
-	0x22a8, 0x8108, 0x080c, 0x2043, 0x20a1, 0x0240, 0x0c98, 0x080c,
-	0x2043, 0x2061, 0x1974, 0x6004, 0x20a0, 0x6008, 0x3518, 0x9312,
-	0x1218, 0x23a8, 0x4003, 0x0058, 0x20a8, 0x4003, 0x82ff, 0x0138,
-	0x22a8, 0x8108, 0x080c, 0x2043, 0x20a1, 0x0240, 0x0c98, 0x2061,
-	0x1974, 0x2019, 0x0260, 0x3400, 0x931e, 0x0110, 0x6006, 0x0020,
-	0x2001, 0x0240, 0x6006, 0x8108, 0x2162, 0x9292, 0x0021, 0x9296,
-	0xffff, 0x620a, 0x00ce, 0x003e, 0x002e, 0x001e, 0x000e, 0x0005,
-	0x00b6, 0x0066, 0x6610, 0x2658, 0xbe04, 0x96b4, 0xff00, 0x8637,
-	0x9686, 0x0006, 0x0170, 0x9686, 0x0004, 0x0158, 0xbe04, 0x96b4,
-	0x00ff, 0x9686, 0x0006, 0x0128, 0x9686, 0x0004, 0x0110, 0x9085,
-	0x0001, 0x006e, 0x00be, 0x0005, 0x00d6, 0x080c, 0xc676, 0x00de,
-	0x0005, 0x00d6, 0x080c, 0xc683, 0x1520, 0x680c, 0x908c, 0xff00,
-	0x6820, 0x9084, 0x00ff, 0x9115, 0x6216, 0x6824, 0x602e, 0xd1e4,
-	0x0130, 0x9006, 0x080c, 0xd589, 0x2009, 0x0001, 0x0078, 0xd1ec,
-	0x0180, 0x6920, 0x918c, 0x00ff, 0x6824, 0x080c, 0x2424, 0x1148,
-	0x2001, 0x0001, 0x080c, 0xd589, 0x2110, 0x900e, 0x080c, 0x305b,
-	0x0018, 0x9085, 0x0001, 0x0008, 0x9006, 0x00de, 0x0005, 0x00b6,
-	0x00c6, 0x080c, 0x9c58, 0x0598, 0x0016, 0x0026, 0x00c6, 0x2011,
-	0x0263, 0x2204, 0x8211, 0x220c, 0x080c, 0x2424, 0x1568, 0x080c,
-	0x6210, 0x1550, 0xbe12, 0xbd16, 0x00ce, 0x002e, 0x001e, 0x2b00,
-	0x6012, 0x080c, 0xd46d, 0x11c8, 0x080c, 0x3150, 0x11b0, 0x080c,
-	0xc5e0, 0x0500, 0x2001, 0x0007, 0x080c, 0x61c1, 0x2001, 0x0007,
-	0x080c, 0x61ed, 0x6017, 0x0000, 0x6023, 0x0001, 0x6007, 0x0001,
-	0x6003, 0x0001, 0x080c, 0x84d8, 0x0010, 0x080c, 0x9be7, 0x9085,
-	0x0001, 0x00ce, 0x00be, 0x0005, 0x080c, 0x9be7, 0x00ce, 0x002e,
-	0x001e, 0x0ca8, 0x080c, 0x9be7, 0x9006, 0x0c98, 0x2069, 0x026d,
-	0x6800, 0x9082, 0x0010, 0x1228, 0x6017, 0x0000, 0x9085, 0x0001,
-	0x0008, 0x9006, 0x0005, 0x6017, 0x0000, 0x2069, 0x026c, 0x6808,
-	0x9084, 0xff00, 0x9086, 0x0800, 0x1190, 0x6904, 0x9186, 0x0018,
-	0x0118, 0x9186, 0x0014, 0x1158, 0x810f, 0x6800, 0x9084, 0x00ff,
-	0x910d, 0x6162, 0x908e, 0x0014, 0x0110, 0x908e, 0x0010, 0x0005,
-	0x6004, 0x90b2, 0x0053, 0x1a0c, 0x0d65, 0x91b6, 0x0013, 0x1130,
-	0x2008, 0x91b2, 0x0040, 0x1a04, 0xc7c3, 0x0092, 0x91b6, 0x0027,
-	0x0120, 0x91b6, 0x0014, 0x190c, 0x0d65, 0x2001, 0x0007, 0x080c,
-	0x61ed, 0x080c, 0x8874, 0x080c, 0x9c21, 0x080c, 0x8936, 0x0005,
-	0xc700, 0xc702, 0xc700, 0xc700, 0xc700, 0xc702, 0xc70f, 0xc7c0,
-	0xc75f, 0xc7c0, 0xc771, 0xc7c0, 0xc70f, 0xc7c0, 0xc7b8, 0xc7c0,
-	0xc7b8, 0xc7c0, 0xc7c0, 0xc700, 0xc700, 0xc700, 0xc700, 0xc700,
-	0xc700, 0xc700, 0xc700, 0xc700, 0xc700, 0xc700, 0xc702, 0xc700,
-	0xc7c0, 0xc700, 0xc700, 0xc7c0, 0xc700, 0xc7bd, 0xc7c0, 0xc700,
-	0xc700, 0xc700, 0xc700, 0xc7c0, 0xc7c0, 0xc700, 0xc7c0, 0xc7c0,
-	0xc700, 0xc70a, 0xc700, 0xc700, 0xc700, 0xc700, 0xc7bc, 0xc7c0,
-	0xc700, 0xc700, 0xc7c0, 0xc7c0, 0xc700, 0xc700, 0xc700, 0xc700,
-	0x080c, 0x0d65, 0x080c, 0xbf79, 0x6003, 0x0002, 0x080c, 0x8936,
-	0x0804, 0xc7c2, 0x9006, 0x080c, 0x61ad, 0x0804, 0xc7c0, 0x080c,
-	0x665f, 0x1904, 0xc7c0, 0x9006, 0x080c, 0x61ad, 0x6010, 0x2058,
-	0xb810, 0x9086, 0x00ff, 0x1140, 0x00f6, 0x2079, 0x1800, 0x78a4,
-	0x8000, 0x78a6, 0x00fe, 0x0428, 0x6010, 0x2058, 0xb884, 0x9005,
-	0x1178, 0x080c, 0xbf61, 0x1904, 0xc7c0, 0x0036, 0x0046, 0xbba0,
-	0x2021, 0x0007, 0x080c, 0x4a75, 0x004e, 0x003e, 0x0804, 0xc7c0,
-	0x080c, 0x3181, 0x1904, 0xc7c0, 0x2001, 0x1800, 0x2004, 0x9086,
-	0x0002, 0x1138, 0x00f6, 0x2079, 0x1800, 0x78a4, 0x8000, 0x78a6,
-	0x00fe, 0x2001, 0x0002, 0x080c, 0x61c1, 0x6023, 0x0001, 0x6003,
-	0x0001, 0x6007, 0x0002, 0x080c, 0x84d8, 0x080c, 0x8936, 0x6110,
-	0x2158, 0x2009, 0x0001, 0x080c, 0x8167, 0x0804, 0xc7c2, 0x6610,
-	0x2658, 0xbe04, 0x96b4, 0xff00, 0x8637, 0x9686, 0x0006, 0x0904,
-	0xc7c0, 0x9686, 0x0004, 0x0904, 0xc7c0, 0x2001, 0x0004, 0x0804,
-	0xc7be, 0x2001, 0x1800, 0x2004, 0x9086, 0x0003, 0x1158, 0x0036,
-	0x0046, 0x6010, 0x2058, 0xbba0, 0x2021, 0x0006, 0x080c, 0x4a75,
-	0x004e, 0x003e, 0x2001, 0x0006, 0x080c, 0xc7dc, 0x6610, 0x2658,
-	0xbe04, 0x0066, 0x96b4, 0xff00, 0x8637, 0x9686, 0x0006, 0x006e,
-	0x0168, 0x2001, 0x0006, 0x080c, 0x61ed, 0x9284, 0x00ff, 0x908e,
-	0x0007, 0x1120, 0x2001, 0x0006, 0x080c, 0x61c1, 0x080c, 0x665f,
-	0x11f8, 0x2001, 0x1836, 0x2004, 0xd0a4, 0x01d0, 0xbe04, 0x96b4,
-	0x00ff, 0x9686, 0x0006, 0x01a0, 0x00f6, 0x2079, 0x1800, 0x78a4,
-	0x8000, 0x78a6, 0x00fe, 0x0804, 0xc749, 0x2001, 0x0004, 0x0030,
-	0x2001, 0x0006, 0x0409, 0x0020, 0x0018, 0x0010, 0x080c, 0x61ed,
-	0x080c, 0x9be7, 0x0005, 0x2600, 0x0002, 0xc7d7, 0xc7d7, 0xc7d7,
-	0xc7d7, 0xc7d7, 0xc7d9, 0xc7d7, 0xc7d7, 0xc7d7, 0xc7d7, 0xc7d9,
-	0xc7d7, 0xc7d7, 0xc7d7, 0xc7d9, 0xc7d9, 0xc7d9, 0xc7d9, 0x080c,
-	0x0d65, 0x080c, 0x9be7, 0x0005, 0x0016, 0x00b6, 0x00d6, 0x6110,
-	0x2158, 0xb900, 0xd184, 0x0138, 0x080c, 0x61c1, 0x9006, 0x080c,
-	0x61ad, 0x080c, 0x303b, 0x00de, 0x00be, 0x001e, 0x0005, 0x6610,
-	0x2658, 0xb804, 0x9084, 0xff00, 0x8007, 0x90b2, 0x000c, 0x1a0c,
-	0x0d65, 0x91b6, 0x0015, 0x1110, 0x003b, 0x0028, 0x91b6, 0x0016,
-	0x190c, 0x0d65, 0x006b, 0x0005, 0xa670, 0xa670, 0xa670, 0xa670,
-	0xa670, 0xa670, 0xc85b, 0xc81c, 0xa670, 0xa670, 0xa670, 0xa670,
-	0xa670, 0xa670, 0xa670, 0xa670, 0xa670, 0xa670, 0xc85b, 0xc862,
-	0xa670, 0xa670, 0xa670, 0xa670, 0x00f6, 0x080c, 0x665f, 0x11d8,
-	0x080c, 0xbf61, 0x11c0, 0x6010, 0x905d, 0x01a8, 0xb884, 0x9005,
-	0x0190, 0x9006, 0x080c, 0x61ad, 0x2001, 0x0002, 0x080c, 0x61c1,
-	0x6023, 0x0001, 0x6003, 0x0001, 0x6007, 0x0002, 0x080c, 0x84d8,
-	0x080c, 0x8936, 0x00f0, 0x2011, 0x0263, 0x2204, 0x8211, 0x220c,
-	0x080c, 0x2424, 0x11b0, 0x080c, 0x6270, 0x0118, 0x080c, 0x9be7,
-	0x0080, 0xb810, 0x0006, 0xb814, 0x0006, 0xb884, 0x0006, 0x080c,
-	0x5cf6, 0x000e, 0xb886, 0x000e, 0xb816, 0x000e, 0xb812, 0x080c,
-	0x9be7, 0x00fe, 0x0005, 0x6604, 0x96b6, 0x001e, 0x1110, 0x080c,
-	0x9be7, 0x0005, 0x080c, 0xaa54, 0x1148, 0x6003, 0x0001, 0x6007,
-	0x0001, 0x080c, 0x84d8, 0x080c, 0x8936, 0x0010, 0x080c, 0x9be7,
-	0x0005, 0x6004, 0x908a, 0x0053, 0x1a0c, 0x0d65, 0x080c, 0x8874,
-	0x080c, 0x9c21, 0x0005, 0x9182, 0x0040, 0x0002, 0xc891, 0xc891,
-	0xc891, 0xc891, 0xc893, 0xc891, 0xc891, 0xc891, 0xc891, 0xc891,
-	0xc891, 0xc891, 0xc891, 0xc891, 0xc891, 0xc891, 0xc891, 0xc891,
-	0xc891, 0x080c, 0x0d65, 0x0096, 0x00b6, 0x00d6, 0x00e6, 0x00f6,
+	0x1108, 0xd0e4, 0x0005, 0x6044, 0xd0fc, 0x1138, 0xd0bc, 0x0198,
+	0xc0bc, 0x6046, 0x6003, 0x0002, 0x0070, 0xd0ac, 0x1160, 0xd0dc,
+	0x1128, 0x908c, 0x000f, 0x9186, 0x0005, 0x1118, 0x6003, 0x0003,
+	0x0010, 0x6003, 0x0001, 0x0005, 0x00b6, 0x0066, 0x6000, 0x90b2,
+	0x0016, 0x1a0c, 0x0d65, 0x001b, 0x006e, 0x00be, 0x0005, 0xbfcf,
+	0xc6ae, 0xc7fd, 0xbfcf, 0xbfcf, 0xbfcf, 0xbfcf, 0xbfcf, 0xc006,
+	0xc881, 0xbfcf, 0xbfcf, 0xbfcf, 0xbfcf, 0xbfcf, 0xbfcf, 0x080c,
+	0x0d65, 0x0066, 0x6000, 0x90b2, 0x0016, 0x1a0c, 0x0d65, 0x0013,
+	0x006e, 0x0005, 0xbfea, 0xcd98, 0xbfea, 0xbfea, 0xbfea, 0xbfea,
+	0xbfea, 0xbfea, 0xcd47, 0xcdea, 0xbfea, 0xd40e, 0xd442, 0xd40e,
+	0xd442, 0xbfea, 0x080c, 0x0d65, 0x6000, 0x9082, 0x0016, 0x1a0c,
+	0x0d65, 0x6000, 0x000a, 0x0005, 0xc004, 0xca5d, 0xcb26, 0xcb48,
+	0xcbc3, 0xc004, 0xccbd, 0xcc4b, 0xc88b, 0xcd1f, 0xcd34, 0xc004,
+	0xc004, 0xc004, 0xc004, 0xc004, 0x080c, 0x0d65, 0x91b2, 0x0053,
+	0x1a0c, 0x0d65, 0x2100, 0x91b2, 0x0040, 0x1a04, 0xc451, 0x0002,
+	0xc050, 0xc242, 0xc050, 0xc050, 0xc050, 0xc24b, 0xc050, 0xc050,
+	0xc050, 0xc050, 0xc050, 0xc050, 0xc050, 0xc050, 0xc050, 0xc050,
+	0xc050, 0xc050, 0xc050, 0xc050, 0xc050, 0xc050, 0xc050, 0xc052,
+	0xc0b9, 0xc0c8, 0xc12c, 0xc157, 0xc1cf, 0xc22d, 0xc050, 0xc050,
+	0xc24e, 0xc050, 0xc050, 0xc263, 0xc270, 0xc050, 0xc050, 0xc050,
+	0xc050, 0xc050, 0xc2f3, 0xc050, 0xc050, 0xc307, 0xc050, 0xc050,
+	0xc2c2, 0xc050, 0xc050, 0xc050, 0xc31f, 0xc050, 0xc050, 0xc050,
+	0xc39c, 0xc050, 0xc050, 0xc050, 0xc050, 0xc050, 0xc050, 0xc419,
+	0x080c, 0x0d65, 0x080c, 0x6624, 0x1150, 0x2001, 0x1836, 0x2004,
+	0xd0cc, 0x1128, 0x9084, 0x0009, 0x9086, 0x0008, 0x1140, 0x6007,
+	0x0009, 0x602f, 0x0009, 0x6017, 0x0000, 0x0804, 0xc23b, 0x080c,
+	0x660d, 0x00e6, 0x00c6, 0x0036, 0x0026, 0x0016, 0x6210, 0x2258,
+	0xbaa0, 0x0026, 0x2019, 0x0029, 0x080c, 0x98bb, 0x080c, 0x8624,
+	0x0076, 0x903e, 0x080c, 0x8509, 0x2c08, 0x080c, 0xcfd9, 0x007e,
+	0x001e, 0x080c, 0x98d7, 0x001e, 0x002e, 0x003e, 0x00ce, 0x00ee,
+	0x6610, 0x2658, 0x080c, 0x627a, 0xbe04, 0x9684, 0x00ff, 0x9082,
+	0x0006, 0x1268, 0x0016, 0x0026, 0x6210, 0x00b6, 0x2258, 0xbaa0,
+	0x00be, 0x2c08, 0x080c, 0xd5ba, 0x002e, 0x001e, 0x1178, 0x080c,
+	0xcf08, 0x1904, 0xc124, 0x080c, 0xcea4, 0x1120, 0x6007, 0x0008,
+	0x0804, 0xc23b, 0x6007, 0x0009, 0x0804, 0xc23b, 0x080c, 0xd10f,
+	0x0128, 0x080c, 0xcf08, 0x0d78, 0x0804, 0xc124, 0x6017, 0x1900,
+	0x0c88, 0x080c, 0x3144, 0x1904, 0xc44e, 0x6106, 0x080c, 0xce55,
+	0x6007, 0x0006, 0x0804, 0xc23b, 0x6007, 0x0007, 0x0804, 0xc23b,
+	0x080c, 0xd47e, 0x1904, 0xc44e, 0x080c, 0x3144, 0x1904, 0xc44e,
+	0x00d6, 0x6610, 0x2658, 0xbe04, 0x9684, 0x00ff, 0x9082, 0x0006,
+	0x1220, 0x2001, 0x0001, 0x080c, 0x61a8, 0x96b4, 0xff00, 0x8637,
+	0x9686, 0x0006, 0x0188, 0x9686, 0x0004, 0x0170, 0xbe04, 0x96b4,
+	0x00ff, 0x9686, 0x0006, 0x0140, 0x9686, 0x0004, 0x0128, 0x9686,
+	0x0005, 0x0110, 0x00de, 0x0480, 0x00e6, 0x2071, 0x0260, 0x7034,
+	0x9084, 0x0003, 0x1140, 0x7034, 0x9082, 0x0014, 0x0220, 0x7030,
+	0x9084, 0x0003, 0x0130, 0x00ee, 0x6017, 0x0000, 0x602f, 0x0007,
+	0x00b0, 0x00ee, 0x080c, 0xcf6f, 0x1190, 0x9686, 0x0006, 0x1140,
+	0x0026, 0x6210, 0x2258, 0xbaa0, 0x900e, 0x080c, 0x305d, 0x002e,
+	0x080c, 0x6306, 0x6007, 0x000a, 0x00de, 0x0804, 0xc23b, 0x6007,
+	0x000b, 0x00de, 0x0804, 0xc23b, 0x080c, 0x300e, 0x080c, 0xbf76,
+	0x6007, 0x0001, 0x0804, 0xc23b, 0x080c, 0xd47e, 0x1904, 0xc44e,
+	0x080c, 0x3144, 0x1904, 0xc44e, 0x2071, 0x0260, 0x7034, 0x90b4,
+	0x0003, 0x1948, 0x90b2, 0x0014, 0x0a30, 0x7030, 0x9084, 0x0003,
+	0x1910, 0x6610, 0x2658, 0xbe04, 0x9686, 0x0707, 0x09e8, 0x0026,
+	0x6210, 0x2258, 0xbaa0, 0x900e, 0x080c, 0x305d, 0x002e, 0x6007,
+	0x000c, 0x2001, 0x0001, 0x080c, 0xd59a, 0x0804, 0xc23b, 0x080c,
+	0x6624, 0x1140, 0x2001, 0x1836, 0x2004, 0x9084, 0x0009, 0x9086,
+	0x0008, 0x1110, 0x0804, 0xc05f, 0x080c, 0x660d, 0x6610, 0x2658,
+	0xbe04, 0x9684, 0x00ff, 0x9082, 0x0006, 0x06c0, 0x1138, 0x0026,
+	0x2001, 0x0006, 0x080c, 0x61e8, 0x002e, 0x0050, 0x96b4, 0xff00,
+	0x8637, 0x9686, 0x0004, 0x0120, 0x9686, 0x0006, 0x1904, 0xc124,
+	0x080c, 0xcf7c, 0x1120, 0x6007, 0x000e, 0x0804, 0xc23b, 0x0046,
+	0x6410, 0x2458, 0xbca0, 0x0046, 0x080c, 0x300e, 0x080c, 0xbf76,
+	0x004e, 0x0016, 0x9006, 0x2009, 0x1854, 0x210c, 0x0048, 0x2009,
+	0x0029, 0x080c, 0xd284, 0x6010, 0x2058, 0xb800, 0xc0e5, 0xb802,
+	0x001e, 0x004e, 0x6007, 0x0001, 0x0804, 0xc23b, 0x2001, 0x0001,
+	0x080c, 0x61a8, 0x0156, 0x0016, 0x0026, 0x0036, 0x20a9, 0x0004,
+	0x2019, 0x1805, 0x2011, 0x0270, 0x080c, 0xabbf, 0x003e, 0x002e,
+	0x001e, 0x015e, 0x9005, 0x0168, 0x96b4, 0xff00, 0x8637, 0x9682,
+	0x0004, 0x0a04, 0xc124, 0x9682, 0x0007, 0x0a04, 0xc180, 0x0804,
+	0xc124, 0x6017, 0x1900, 0x6007, 0x0009, 0x0804, 0xc23b, 0x080c,
+	0x6624, 0x1140, 0x2001, 0x1836, 0x2004, 0x9084, 0x0009, 0x9086,
+	0x0008, 0x1110, 0x0804, 0xc05f, 0x080c, 0x660d, 0x6610, 0x2658,
+	0xbe04, 0x9684, 0x00ff, 0x0006, 0x9086, 0x0001, 0x000e, 0x0170,
+	0x9082, 0x0006, 0x0690, 0x0150, 0x96b4, 0xff00, 0x8637, 0x9686,
+	0x0004, 0x0120, 0x9686, 0x0006, 0x1904, 0xc124, 0x080c, 0xcfaa,
+	0x1130, 0x080c, 0xcea4, 0x1118, 0x6007, 0x0010, 0x04e0, 0x0046,
+	0x6410, 0x2458, 0xbca0, 0x0046, 0x080c, 0x300e, 0x080c, 0xbf76,
+	0x004e, 0x0016, 0x9006, 0x2009, 0x1854, 0x210c, 0x0048, 0x2009,
+	0x0029, 0x080c, 0xd284, 0x6010, 0x2058, 0xb800, 0xc0e5, 0xb802,
+	0x001e, 0x004e, 0x6007, 0x0001, 0x00f0, 0x080c, 0xd10f, 0x0140,
+	0x96b4, 0xff00, 0x8637, 0x9686, 0x0006, 0x0980, 0x0804, 0xc124,
+	0x6017, 0x1900, 0x6007, 0x0009, 0x0070, 0x080c, 0x3144, 0x1904,
+	0xc44e, 0x080c, 0xd47e, 0x1904, 0xc44e, 0x080c, 0xc5ee, 0x1904,
+	0xc124, 0x6007, 0x0012, 0x6003, 0x0001, 0x080c, 0x84ba, 0x080c,
+	0x891b, 0x0005, 0x6007, 0x0001, 0x6003, 0x0001, 0x080c, 0x84ba,
+	0x080c, 0x891b, 0x0cb0, 0x6007, 0x0005, 0x0c68, 0x080c, 0xd47e,
+	0x1904, 0xc44e, 0x080c, 0x3144, 0x1904, 0xc44e, 0x080c, 0xc5ee,
+	0x1904, 0xc124, 0x6007, 0x0020, 0x6003, 0x0001, 0x080c, 0x84ba,
+	0x080c, 0x891b, 0x0005, 0x080c, 0x3144, 0x1904, 0xc44e, 0x6007,
+	0x0023, 0x6003, 0x0001, 0x080c, 0x84ba, 0x080c, 0x891b, 0x0005,
+	0x080c, 0xd47e, 0x1904, 0xc44e, 0x080c, 0x3144, 0x1904, 0xc44e,
+	0x080c, 0xc5ee, 0x1904, 0xc124, 0x0016, 0x0026, 0x00e6, 0x2071,
+	0x0260, 0x7244, 0x9286, 0xffff, 0x0180, 0x2c08, 0x080c, 0xb830,
+	0x01b0, 0x2260, 0x7240, 0x6008, 0x9206, 0x1188, 0x6010, 0x9190,
+	0x0004, 0x2214, 0x9206, 0x01b8, 0x0050, 0x7240, 0x2c08, 0x9006,
+	0x080c, 0xd256, 0x1180, 0x7244, 0x9286, 0xffff, 0x01b0, 0x2160,
+	0x6007, 0x0026, 0x6017, 0x1700, 0x7214, 0x9296, 0xffff, 0x1180,
+	0x6007, 0x0025, 0x0068, 0x6020, 0x9086, 0x0007, 0x1d80, 0x6004,
+	0x9086, 0x0024, 0x1110, 0x080c, 0x9bda, 0x2160, 0x6007, 0x0025,
+	0x6003, 0x0001, 0x080c, 0x84ba, 0x080c, 0x891b, 0x00ee, 0x002e,
+	0x001e, 0x0005, 0x2001, 0x0001, 0x080c, 0x61a8, 0x0156, 0x0016,
+	0x0026, 0x0036, 0x20a9, 0x0004, 0x2019, 0x1805, 0x2011, 0x0276,
+	0x080c, 0xabbf, 0x003e, 0x002e, 0x001e, 0x015e, 0x0120, 0x6007,
+	0x0031, 0x0804, 0xc23b, 0x080c, 0xa824, 0x080c, 0x7096, 0x1190,
+	0x0006, 0x0026, 0x0036, 0x080c, 0x70b0, 0x1138, 0x080c, 0x7396,
+	0x080c, 0x5cd7, 0x080c, 0x6fc7, 0x0010, 0x080c, 0x706a, 0x003e,
+	0x002e, 0x000e, 0x0005, 0x080c, 0x3144, 0x1904, 0xc44e, 0x080c,
+	0xc5ee, 0x1904, 0xc124, 0x6106, 0x080c, 0xc60a, 0x1120, 0x6007,
+	0x002b, 0x0804, 0xc23b, 0x6007, 0x002c, 0x0804, 0xc23b, 0x080c,
+	0xd47e, 0x1904, 0xc44e, 0x080c, 0x3144, 0x1904, 0xc44e, 0x080c,
+	0xc5ee, 0x1904, 0xc124, 0x6106, 0x080c, 0xc60f, 0x1120, 0x6007,
+	0x002e, 0x0804, 0xc23b, 0x6007, 0x002f, 0x0804, 0xc23b, 0x080c,
+	0x3144, 0x1904, 0xc44e, 0x00e6, 0x00d6, 0x00c6, 0x6010, 0x2058,
+	0xb904, 0x9184, 0x00ff, 0x9086, 0x0006, 0x0158, 0x9184, 0xff00,
+	0x8007, 0x9086, 0x0006, 0x0128, 0x00ce, 0x00de, 0x00ee, 0x0804,
+	0xc242, 0x080c, 0x538c, 0xd0e4, 0x0904, 0xc399, 0x2071, 0x026c,
+	0x7010, 0x603a, 0x7014, 0x603e, 0x7108, 0x720c, 0x080c, 0x6662,
+	0x0140, 0x6010, 0x2058, 0xb810, 0x9106, 0x1118, 0xb814, 0x9206,
+	0x0510, 0x080c, 0x665e, 0x15b8, 0x2069, 0x1800, 0x687c, 0x9206,
+	0x1590, 0x6878, 0x9106, 0x1578, 0x7210, 0x080c, 0xb830, 0x0590,
+	0x080c, 0xc4d9, 0x0578, 0x080c, 0xd300, 0x0560, 0x622e, 0x6007,
+	0x0036, 0x6003, 0x0001, 0x2009, 0x8020, 0x080c, 0x84b3, 0x00ce,
+	0x00de, 0x00ee, 0x0005, 0x7214, 0x9286, 0xffff, 0x0150, 0x080c,
+	0xb830, 0x01c0, 0x9280, 0x0002, 0x2004, 0x7110, 0x9106, 0x1190,
+	0x08e0, 0x7210, 0x2c08, 0x9085, 0x0001, 0x080c, 0xd256, 0x2c10,
+	0x2160, 0x0140, 0x0890, 0x6007, 0x0037, 0x602f, 0x0009, 0x6017,
+	0x1500, 0x08b8, 0x6007, 0x0037, 0x602f, 0x0003, 0x6017, 0x1700,
+	0x0880, 0x6007, 0x0012, 0x0868, 0x080c, 0x3144, 0x1904, 0xc44e,
+	0x6010, 0x2058, 0xb804, 0x9084, 0xff00, 0x8007, 0x9086, 0x0006,
+	0x1904, 0xc242, 0x00e6, 0x00d6, 0x00c6, 0x080c, 0x538c, 0xd0e4,
+	0x0904, 0xc411, 0x2069, 0x1800, 0x2071, 0x026c, 0x7008, 0x603a,
+	0x720c, 0x623e, 0x9286, 0xffff, 0x1150, 0x7208, 0x00c6, 0x2c08,
+	0x9085, 0x0001, 0x080c, 0xd256, 0x2c10, 0x00ce, 0x05e8, 0x080c,
+	0xb830, 0x05d0, 0x7108, 0x9280, 0x0002, 0x2004, 0x9106, 0x15a0,
+	0x00c6, 0x0026, 0x2260, 0x080c, 0xb433, 0x002e, 0x00ce, 0x7118,
+	0x918c, 0xff00, 0x810f, 0x9186, 0x0001, 0x0178, 0x9186, 0x0005,
+	0x0118, 0x9186, 0x0007, 0x1198, 0x9280, 0x0005, 0x2004, 0x9005,
+	0x0170, 0x080c, 0xc4d9, 0x0904, 0xc392, 0x0056, 0x7510, 0x7614,
+	0x080c, 0xd319, 0x005e, 0x00ce, 0x00de, 0x00ee, 0x0005, 0x6007,
+	0x003b, 0x602f, 0x0009, 0x6017, 0x2a00, 0x6003, 0x0001, 0x2009,
+	0x8020, 0x080c, 0x84b3, 0x0c78, 0x6007, 0x003b, 0x602f, 0x0003,
+	0x6017, 0x0300, 0x6003, 0x0001, 0x2009, 0x8020, 0x080c, 0x84b3,
+	0x0c10, 0x6007, 0x003b, 0x602f, 0x000b, 0x6017, 0x0000, 0x0804,
+	0xc369, 0x00e6, 0x0026, 0x080c, 0x6624, 0x0550, 0x080c, 0x660d,
+	0x080c, 0xd4f0, 0x1518, 0x2071, 0x1800, 0x70d8, 0x9085, 0x0003,
+	0x70da, 0x00f6, 0x2079, 0x0100, 0x72ac, 0x9284, 0x00ff, 0x707a,
+	0x78e6, 0x9284, 0xff00, 0x727c, 0x9205, 0x707e, 0x78ea, 0x00fe,
+	0x70e3, 0x0000, 0x080c, 0x6662, 0x0120, 0x2011, 0x19d9, 0x2013,
+	0x07d0, 0xd0ac, 0x1128, 0x080c, 0x2de9, 0x0010, 0x080c, 0xd522,
+	0x002e, 0x00ee, 0x080c, 0x9bda, 0x0804, 0xc241, 0x080c, 0x9bda,
+	0x0005, 0x2600, 0x0002, 0xc465, 0xc465, 0xc465, 0xc465, 0xc465,
+	0xc467, 0xc465, 0xc465, 0xc465, 0xc465, 0xc484, 0xc465, 0xc465,
+	0xc465, 0xc496, 0xc4a3, 0xc4d4, 0xc465, 0x080c, 0x0d65, 0x080c,
+	0xd47e, 0x1d20, 0x080c, 0x3144, 0x1d08, 0x080c, 0xc5ee, 0x1148,
+	0x7038, 0x6016, 0x6007, 0x0045, 0x6003, 0x0001, 0x080c, 0x84ba,
+	0x0005, 0x080c, 0x300e, 0x080c, 0xbf76, 0x6007, 0x0001, 0x6003,
+	0x0001, 0x080c, 0x84ba, 0x0005, 0x080c, 0xd47e, 0x1938, 0x080c,
+	0x3144, 0x1920, 0x080c, 0xc5ee, 0x1d60, 0x703c, 0x6016, 0x6007,
+	0x004a, 0x6003, 0x0001, 0x080c, 0x84ba, 0x0005, 0x080c, 0xc4f6,
+	0x0904, 0xc44e, 0x6007, 0x004e, 0x6003, 0x0001, 0x080c, 0x84ba,
+	0x080c, 0x891b, 0x0005, 0x6007, 0x004f, 0x6017, 0x0000, 0x7134,
+	0x918c, 0x00ff, 0x81ff, 0x0508, 0x9186, 0x0001, 0x1160, 0x7140,
+	0x2001, 0x198d, 0x2004, 0x9106, 0x11b0, 0x7144, 0x2001, 0x198e,
+	0x2004, 0x9106, 0x0190, 0x9186, 0x0002, 0x1168, 0x2011, 0x0276,
+	0x20a9, 0x0004, 0x6010, 0x0096, 0x2048, 0x2019, 0x000a, 0x080c,
+	0xabd3, 0x009e, 0x0110, 0x6017, 0x0001, 0x6003, 0x0001, 0x080c,
+	0x84ba, 0x080c, 0x891b, 0x0005, 0x6007, 0x0050, 0x703c, 0x6016,
+	0x0ca0, 0x0016, 0x00e6, 0x2071, 0x0260, 0x00b6, 0x00c6, 0x2260,
+	0x6010, 0x2058, 0xb8c4, 0xd084, 0x0150, 0x7128, 0x6050, 0x9106,
+	0x1120, 0x712c, 0x604c, 0x9106, 0x0110, 0x9006, 0x0010, 0x9085,
+	0x0001, 0x00ce, 0x00be, 0x00ee, 0x001e, 0x0005, 0x0016, 0x0096,
+	0x0086, 0x00e6, 0x01c6, 0x01d6, 0x0126, 0x2091, 0x8000, 0x2071,
+	0x1800, 0x708c, 0x908a, 0x00f9, 0x16e8, 0x20e1, 0x0000, 0x2001,
+	0x1970, 0x2003, 0x0000, 0x080c, 0x103b, 0x05a0, 0x2900, 0x6016,
+	0x708c, 0x8004, 0xa816, 0x908a, 0x001e, 0x02d0, 0xa833, 0x001e,
+	0x20a9, 0x001e, 0xa860, 0x20e8, 0xa85c, 0x9080, 0x001b, 0x20a0,
+	0x2001, 0x1970, 0x0016, 0x200c, 0x0471, 0x001e, 0x2940, 0x080c,
+	0x103b, 0x01c0, 0x2900, 0xa006, 0x2100, 0x81ff, 0x0180, 0x0c18,
+	0xa832, 0x20a8, 0xa860, 0x20e8, 0xa85c, 0x9080, 0x001b, 0x20a0,
+	0x2001, 0x1970, 0x0016, 0x200c, 0x00b1, 0x001e, 0x0000, 0x9085,
+	0x0001, 0x0048, 0x2071, 0x1800, 0x708f, 0x0000, 0x6014, 0x2048,
+	0x080c, 0x0fd4, 0x9006, 0x012e, 0x01de, 0x01ce, 0x00ee, 0x008e,
+	0x009e, 0x001e, 0x0005, 0x0006, 0x0016, 0x0026, 0x0036, 0x00c6,
+	0x918c, 0xffff, 0x11a8, 0x080c, 0x203c, 0x2099, 0x026c, 0x2001,
+	0x0014, 0x3518, 0x9312, 0x1218, 0x23a8, 0x4003, 0x00f8, 0x20a8,
+	0x4003, 0x22a8, 0x8108, 0x080c, 0x203c, 0x2099, 0x0260, 0x0ca8,
+	0x080c, 0x203c, 0x2061, 0x1970, 0x6004, 0x2098, 0x6008, 0x3518,
+	0x9312, 0x1218, 0x23a8, 0x4003, 0x0048, 0x20a8, 0x4003, 0x22a8,
+	0x8108, 0x080c, 0x203c, 0x2099, 0x0260, 0x0ca8, 0x2061, 0x1970,
+	0x2019, 0x0280, 0x3300, 0x931e, 0x0110, 0x6006, 0x0020, 0x2001,
+	0x0260, 0x6006, 0x8108, 0x2162, 0x9292, 0x0021, 0x9296, 0xffff,
+	0x620a, 0x00ce, 0x003e, 0x002e, 0x001e, 0x000e, 0x0005, 0x0006,
+	0x0016, 0x0026, 0x0036, 0x00c6, 0x81ff, 0x11b8, 0x080c, 0x2054,
+	0x20a1, 0x024c, 0x2001, 0x0014, 0x3518, 0x9312, 0x1218, 0x23a8,
+	0x4003, 0x0418, 0x20a8, 0x4003, 0x82ff, 0x01f8, 0x22a8, 0x8108,
+	0x080c, 0x2054, 0x20a1, 0x0240, 0x0c98, 0x080c, 0x2054, 0x2061,
+	0x1973, 0x6004, 0x20a0, 0x6008, 0x3518, 0x9312, 0x1218, 0x23a8,
+	0x4003, 0x0058, 0x20a8, 0x4003, 0x82ff, 0x0138, 0x22a8, 0x8108,
+	0x080c, 0x2054, 0x20a1, 0x0240, 0x0c98, 0x2061, 0x1973, 0x2019,
+	0x0260, 0x3400, 0x931e, 0x0110, 0x6006, 0x0020, 0x2001, 0x0240,
+	0x6006, 0x8108, 0x2162, 0x9292, 0x0021, 0x9296, 0xffff, 0x620a,
+	0x00ce, 0x003e, 0x002e, 0x001e, 0x000e, 0x0005, 0x00b6, 0x0066,
+	0x6610, 0x2658, 0xbe04, 0x96b4, 0xff00, 0x8637, 0x9686, 0x0006,
+	0x0170, 0x9686, 0x0004, 0x0158, 0xbe04, 0x96b4, 0x00ff, 0x9686,
+	0x0006, 0x0128, 0x9686, 0x0004, 0x0110, 0x9085, 0x0001, 0x006e,
+	0x00be, 0x0005, 0x00d6, 0x080c, 0xc684, 0x00de, 0x0005, 0x00d6,
+	0x080c, 0xc691, 0x1520, 0x680c, 0x908c, 0xff00, 0x6820, 0x9084,
+	0x00ff, 0x9115, 0x6216, 0x6824, 0x602e, 0xd1e4, 0x0130, 0x9006,
+	0x080c, 0xd59a, 0x2009, 0x0001, 0x0078, 0xd1ec, 0x0180, 0x6920,
+	0x918c, 0x00ff, 0x6824, 0x080c, 0x243d, 0x1148, 0x2001, 0x0001,
+	0x080c, 0xd59a, 0x2110, 0x900e, 0x080c, 0x305d, 0x0018, 0x9085,
+	0x0001, 0x0008, 0x9006, 0x00de, 0x0005, 0x00b6, 0x00c6, 0x080c,
+	0x9c49, 0x0598, 0x0016, 0x0026, 0x00c6, 0x2011, 0x0263, 0x2204,
+	0x8211, 0x220c, 0x080c, 0x243d, 0x1568, 0x080c, 0x620b, 0x1550,
+	0xbe12, 0xbd16, 0x00ce, 0x002e, 0x001e, 0x2b00, 0x6012, 0x080c,
+	0xd47e, 0x11c8, 0x080c, 0x3144, 0x11b0, 0x080c, 0xc5ee, 0x0500,
+	0x2001, 0x0007, 0x080c, 0x61bc, 0x2001, 0x0007, 0x080c, 0x61e8,
+	0x6017, 0x0000, 0x6023, 0x0001, 0x6007, 0x0001, 0x6003, 0x0001,
+	0x080c, 0x84ba, 0x0010, 0x080c, 0x9bda, 0x9085, 0x0001, 0x00ce,
+	0x00be, 0x0005, 0x080c, 0x9bda, 0x00ce, 0x002e, 0x001e, 0x0ca8,
+	0x080c, 0x9bda, 0x9006, 0x0c98, 0x2069, 0x026d, 0x6800, 0x9082,
+	0x0010, 0x1228, 0x6017, 0x0000, 0x9085, 0x0001, 0x0008, 0x9006,
+	0x0005, 0x6017, 0x0000, 0x2069, 0x026c, 0x6808, 0x9084, 0xff00,
+	0x9086, 0x0800, 0x1190, 0x6904, 0x9186, 0x0018, 0x0118, 0x9186,
+	0x0014, 0x1158, 0x810f, 0x6800, 0x9084, 0x00ff, 0x910d, 0x6162,
+	0x908e, 0x0014, 0x0110, 0x908e, 0x0010, 0x0005, 0x6004, 0x90b2,
+	0x0053, 0x1a0c, 0x0d65, 0x91b6, 0x0013, 0x1130, 0x2008, 0x91b2,
+	0x0040, 0x1a04, 0xc7d1, 0x0092, 0x91b6, 0x0027, 0x0120, 0x91b6,
+	0x0014, 0x190c, 0x0d65, 0x2001, 0x0007, 0x080c, 0x61e8, 0x080c,
+	0x885d, 0x080c, 0x9c14, 0x080c, 0x891b, 0x0005, 0xc70e, 0xc710,
+	0xc70e, 0xc70e, 0xc70e, 0xc710, 0xc71d, 0xc7ce, 0xc76d, 0xc7ce,
+	0xc77f, 0xc7ce, 0xc71d, 0xc7ce, 0xc7c6, 0xc7ce, 0xc7c6, 0xc7ce,
+	0xc7ce, 0xc70e, 0xc70e, 0xc70e, 0xc70e, 0xc70e, 0xc70e, 0xc70e,
+	0xc70e, 0xc70e, 0xc70e, 0xc70e, 0xc710, 0xc70e, 0xc7ce, 0xc70e,
+	0xc70e, 0xc7ce, 0xc70e, 0xc7cb, 0xc7ce, 0xc70e, 0xc70e, 0xc70e,
+	0xc70e, 0xc7ce, 0xc7ce, 0xc70e, 0xc7ce, 0xc7ce, 0xc70e, 0xc718,
+	0xc70e, 0xc70e, 0xc70e, 0xc70e, 0xc7ca, 0xc7ce, 0xc70e, 0xc70e,
+	0xc7ce, 0xc7ce, 0xc70e, 0xc70e, 0xc70e, 0xc70e, 0x080c, 0x0d65,
+	0x080c, 0xbf79, 0x6003, 0x0002, 0x080c, 0x891b, 0x0804, 0xc7d0,
+	0x9006, 0x080c, 0x61a8, 0x0804, 0xc7ce, 0x080c, 0x665e, 0x1904,
+	0xc7ce, 0x9006, 0x080c, 0x61a8, 0x6010, 0x2058, 0xb810, 0x9086,
+	0x00ff, 0x1140, 0x00f6, 0x2079, 0x1800, 0x78a4, 0x8000, 0x78a6,
+	0x00fe, 0x0428, 0x6010, 0x2058, 0xb884, 0x9005, 0x1178, 0x080c,
+	0xbf61, 0x1904, 0xc7ce, 0x0036, 0x0046, 0xbba0, 0x2021, 0x0007,
+	0x080c, 0x4a77, 0x004e, 0x003e, 0x0804, 0xc7ce, 0x080c, 0x3175,
+	0x1904, 0xc7ce, 0x2001, 0x1800, 0x2004, 0x9086, 0x0002, 0x1138,
+	0x00f6, 0x2079, 0x1800, 0x78a4, 0x8000, 0x78a6, 0x00fe, 0x2001,
+	0x0002, 0x080c, 0x61bc, 0x6023, 0x0001, 0x6003, 0x0001, 0x6007,
+	0x0002, 0x080c, 0x84ba, 0x080c, 0x891b, 0x6110, 0x2158, 0x2009,
+	0x0001, 0x080c, 0x8146, 0x0804, 0xc7d0, 0x6610, 0x2658, 0xbe04,
+	0x96b4, 0xff00, 0x8637, 0x9686, 0x0006, 0x0904, 0xc7ce, 0x9686,
+	0x0004, 0x0904, 0xc7ce, 0x2001, 0x0004, 0x0804, 0xc7cc, 0x2001,
+	0x1800, 0x2004, 0x9086, 0x0003, 0x1158, 0x0036, 0x0046, 0x6010,
+	0x2058, 0xbba0, 0x2021, 0x0006, 0x080c, 0x4a77, 0x004e, 0x003e,
+	0x2001, 0x0006, 0x080c, 0xc7ea, 0x6610, 0x2658, 0xbe04, 0x0066,
+	0x96b4, 0xff00, 0x8637, 0x9686, 0x0006, 0x006e, 0x0168, 0x2001,
+	0x0006, 0x080c, 0x61e8, 0x9284, 0x00ff, 0x908e, 0x0007, 0x1120,
+	0x2001, 0x0006, 0x080c, 0x61bc, 0x080c, 0x665e, 0x11f8, 0x2001,
+	0x1836, 0x2004, 0xd0a4, 0x01d0, 0xbe04, 0x96b4, 0x00ff, 0x9686,
+	0x0006, 0x01a0, 0x00f6, 0x2079, 0x1800, 0x78a4, 0x8000, 0x78a6,
+	0x00fe, 0x0804, 0xc757, 0x2001, 0x0004, 0x0030, 0x2001, 0x0006,
+	0x0409, 0x0020, 0x0018, 0x0010, 0x080c, 0x61e8, 0x080c, 0x9bda,
+	0x0005, 0x2600, 0x0002, 0xc7e5, 0xc7e5, 0xc7e5, 0xc7e5, 0xc7e5,
+	0xc7e7, 0xc7e5, 0xc7e5, 0xc7e5, 0xc7e5, 0xc7e7, 0xc7e5, 0xc7e5,
+	0xc7e5, 0xc7e7, 0xc7e7, 0xc7e7, 0xc7e7, 0x080c, 0x0d65, 0x080c,
+	0x9bda, 0x0005, 0x0016, 0x00b6, 0x00d6, 0x6110, 0x2158, 0xb900,
+	0xd184, 0x0138, 0x080c, 0x61bc, 0x9006, 0x080c, 0x61a8, 0x080c,
+	0x303d, 0x00de, 0x00be, 0x001e, 0x0005, 0x6610, 0x2658, 0xb804,
+	0x9084, 0xff00, 0x8007, 0x90b2, 0x000c, 0x1a0c, 0x0d65, 0x91b6,
+	0x0015, 0x1110, 0x003b, 0x0028, 0x91b6, 0x0016, 0x190c, 0x0d65,
+	0x006b, 0x0005, 0xa662, 0xa662, 0xa662, 0xa662, 0xc87f, 0xa662,
+	0xc869, 0xc82a, 0xa662, 0xa662, 0xa662, 0xa662, 0xa662, 0xa662,
+	0xa662, 0xa662, 0xc87f, 0xa662, 0xc869, 0xc870, 0xa662, 0xa662,
+	0xa662, 0xa662, 0x00f6, 0x080c, 0x665e, 0x11d8, 0x080c, 0xbf61,
+	0x11c0, 0x6010, 0x905d, 0x01a8, 0xb884, 0x9005, 0x0190, 0x9006,
+	0x080c, 0x61a8, 0x2001, 0x0002, 0x080c, 0x61bc, 0x6023, 0x0001,
+	0x6003, 0x0001, 0x6007, 0x0002, 0x080c, 0x84ba, 0x080c, 0x891b,
+	0x00f0, 0x2011, 0x0263, 0x2204, 0x8211, 0x220c, 0x080c, 0x243d,
+	0x11b0, 0x080c, 0x626b, 0x0118, 0x080c, 0x9bda, 0x0080, 0xb810,
+	0x0006, 0xb814, 0x0006, 0xb884, 0x0006, 0x080c, 0x5cf1, 0x000e,
+	0xb886, 0x000e, 0xb816, 0x000e, 0xb812, 0x080c, 0x9bda, 0x00fe,
+	0x0005, 0x6604, 0x96b6, 0x001e, 0x1110, 0x080c, 0x9bda, 0x0005,
+	0x080c, 0xaa48, 0x1148, 0x6003, 0x0001, 0x6007, 0x0001, 0x080c,
+	0x84ba, 0x080c, 0x891b, 0x0010, 0x080c, 0x9bda, 0x0005, 0x0804,
+	0x9bda, 0x6004, 0x908a, 0x0053, 0x1a0c, 0x0d65, 0x080c, 0x885d,
+	0x080c, 0x9c14, 0x0005, 0x9182, 0x0040, 0x0002, 0xc8a1, 0xc8a1,
+	0xc8a1, 0xc8a1, 0xc8a3, 0xc8a1, 0xc8a1, 0xc8a1, 0xc8a1, 0xc8a1,
+	0xc8a1, 0xc8a1, 0xc8a1, 0xc8a1, 0xc8a1, 0xc8a1, 0xc8a1, 0xc8a1,
+	0xc8a1, 0x080c, 0x0d65, 0x0096, 0x00b6, 0x00d6, 0x00e6, 0x00f6,
 	0x0046, 0x0026, 0x6210, 0x2258, 0xb8ac, 0x9005, 0x11b0, 0x6007,
-	0x0044, 0x2071, 0x0260, 0x7444, 0x94a4, 0xff00, 0x0904, 0xc8fa,
-	0x080c, 0xd57d, 0x1170, 0x9486, 0x2000, 0x1158, 0x2009, 0x0001,
-	0x2011, 0x0200, 0x080c, 0x83eb, 0x0020, 0x9026, 0x080c, 0xd4b2,
+	0x0044, 0x2071, 0x0260, 0x7444, 0x94a4, 0xff00, 0x0904, 0xc90a,
+	0x080c, 0xd58e, 0x1170, 0x9486, 0x2000, 0x1158, 0x2009, 0x0001,
+	0x2011, 0x0200, 0x080c, 0x83cd, 0x0020, 0x9026, 0x080c, 0xd4c3,
 	0x0c30, 0x080c, 0x1022, 0x090c, 0x0d65, 0x6003, 0x0007, 0xa867,
 	0x010d, 0x9006, 0xa802, 0xa86a, 0xac8a, 0x2c00, 0xa88e, 0x6008,
 	0xa8e2, 0x6010, 0x2058, 0xb8a0, 0x7130, 0xa97a, 0x0016, 0xa876,
-	0xa87f, 0x0000, 0xa883, 0x0000, 0xa887, 0x0036, 0x080c, 0x6996,
-	0x001e, 0x080c, 0xd57d, 0x1904, 0xc95a, 0x9486, 0x2000, 0x1130,
-	0x2019, 0x0017, 0x080c, 0xd1eb, 0x0804, 0xc95a, 0x9486, 0x0200,
-	0x1120, 0x080c, 0xd17b, 0x0804, 0xc95a, 0x9486, 0x0400, 0x0120,
-	0x9486, 0x1000, 0x1904, 0xc95a, 0x2019, 0x0002, 0x080c, 0xd19a,
-	0x0804, 0xc95a, 0x2069, 0x1a3f, 0x6a00, 0xd284, 0x0904, 0xc9c4,
-	0x9284, 0x0300, 0x1904, 0xc9bd, 0x6804, 0x9005, 0x0904, 0xc9a5,
-	0x2d78, 0x6003, 0x0007, 0x080c, 0x103b, 0x0904, 0xc966, 0x7800,
+	0xa87f, 0x0000, 0xa883, 0x0000, 0xa887, 0x0036, 0x080c, 0x6991,
+	0x001e, 0x080c, 0xd58e, 0x1904, 0xc96a, 0x9486, 0x2000, 0x1130,
+	0x2019, 0x0017, 0x080c, 0xd1fc, 0x0804, 0xc96a, 0x9486, 0x0200,
+	0x1120, 0x080c, 0xd18c, 0x0804, 0xc96a, 0x9486, 0x0400, 0x0120,
+	0x9486, 0x1000, 0x1904, 0xc96a, 0x2019, 0x0002, 0x080c, 0xd1ab,
+	0x0804, 0xc96a, 0x2069, 0x1a3e, 0x6a00, 0xd284, 0x0904, 0xc9d4,
+	0x9284, 0x0300, 0x1904, 0xc9cd, 0x6804, 0x9005, 0x0904, 0xc9b5,
+	0x2d78, 0x6003, 0x0007, 0x080c, 0x103b, 0x0904, 0xc976, 0x7800,
 	0xd08c, 0x1118, 0x7804, 0x8001, 0x7806, 0x6017, 0x0000, 0x2001,
-	0x180f, 0x2004, 0xd084, 0x1904, 0xc9c8, 0x9006, 0xa802, 0xa867,
+	0x180f, 0x2004, 0xd084, 0x1904, 0xc9d8, 0x9006, 0xa802, 0xa867,
 	0x0116, 0xa86a, 0x6008, 0xa8e2, 0x2c00, 0xa87a, 0x6010, 0x2058,
 	0xb8a0, 0x7130, 0xa9b6, 0xa876, 0xb928, 0xa9ba, 0xb92c, 0xa9be,
 	0xb930, 0xa9c2, 0xb934, 0xa9c6, 0xa883, 0x003d, 0x7044, 0x9084,
-	0x0003, 0x9080, 0xc962, 0x2005, 0xa87e, 0x20a9, 0x000a, 0x2001,
+	0x0003, 0x9080, 0xc972, 0x2005, 0xa87e, 0x20a9, 0x000a, 0x2001,
 	0x0270, 0xaa5c, 0x9290, 0x0021, 0x2009, 0x0205, 0x200b, 0x0080,
 	0x20e1, 0x0000, 0xab60, 0x23e8, 0x2098, 0x22a0, 0x4003, 0x200b,
 	0x0000, 0x2001, 0x027a, 0x200c, 0xa9b2, 0x8000, 0x200c, 0xa9ae,
-	0x080c, 0x6999, 0x002e, 0x004e, 0x00fe, 0x00ee, 0x00de, 0x00be,
+	0x080c, 0x6994, 0x002e, 0x004e, 0x00fe, 0x00ee, 0x00de, 0x00be,
 	0x009e, 0x0005, 0x0000, 0x0080, 0x0040, 0x0000, 0x2001, 0x1810,
-	0x2004, 0xd084, 0x0120, 0x080c, 0x1022, 0x1904, 0xc90f, 0x6017,
+	0x2004, 0xd084, 0x0120, 0x080c, 0x1022, 0x1904, 0xc91f, 0x6017,
 	0xf100, 0x6003, 0x0001, 0x6007, 0x0041, 0x2009, 0xa022, 0x080c,
-	0x84d1, 0x0c00, 0x2069, 0x0260, 0x6848, 0x9084, 0xff00, 0x9086,
+	0x84b3, 0x0c00, 0x2069, 0x0260, 0x6848, 0x9084, 0xff00, 0x9086,
 	0x1200, 0x1198, 0x686c, 0x9084, 0x00ff, 0x0016, 0x6114, 0x918c,
 	0xf700, 0x910d, 0x6116, 0x001e, 0x6003, 0x0001, 0x6007, 0x0043,
-	0x2009, 0xa025, 0x080c, 0x84d1, 0x0828, 0x6868, 0x602e, 0x686c,
+	0x2009, 0xa025, 0x080c, 0x84b3, 0x0828, 0x6868, 0x602e, 0x686c,
 	0x6032, 0x6017, 0xf200, 0x6003, 0x0001, 0x6007, 0x0041, 0x2009,
-	0xa022, 0x080c, 0x84d1, 0x0804, 0xc95a, 0x2001, 0x180e, 0x2004,
-	0xd0ec, 0x0120, 0x2011, 0x8049, 0x080c, 0x48d8, 0x6017, 0xf300,
+	0xa022, 0x080c, 0x84b3, 0x0804, 0xc96a, 0x2001, 0x180e, 0x2004,
+	0xd0ec, 0x0120, 0x2011, 0x8049, 0x080c, 0x48da, 0x6017, 0xf300,
 	0x0010, 0x6017, 0xf100, 0x6003, 0x0001, 0x6007, 0x0041, 0x2009,
-	0xa022, 0x080c, 0x84d1, 0x0804, 0xc95a, 0x6017, 0xf500, 0x0c98,
-	0x6017, 0xf600, 0x0804, 0xc97a, 0x6017, 0xf200, 0x0804, 0xc97a,
+	0xa022, 0x080c, 0x84b3, 0x0804, 0xc96a, 0x6017, 0xf500, 0x0c98,
+	0x6017, 0xf600, 0x0804, 0xc98a, 0x6017, 0xf200, 0x0804, 0xc98a,
 	0xa867, 0x0146, 0xa86b, 0x0000, 0x6008, 0xa886, 0x2c00, 0xa87a,
-	0x7044, 0x9084, 0x0003, 0x9080, 0xc962, 0x2005, 0xa87e, 0x2928,
+	0x7044, 0x9084, 0x0003, 0x9080, 0xc972, 0x2005, 0xa87e, 0x2928,
 	0x6010, 0x2058, 0xb8a0, 0xa876, 0xb828, 0xa88a, 0xb82c, 0xa88e,
 	0xb830, 0xa892, 0xb834, 0xa896, 0xa883, 0x003d, 0x2009, 0x0205,
 	0x2104, 0x9085, 0x0080, 0x200a, 0x20e1, 0x0000, 0x2011, 0x0210,
 	0x2214, 0x9294, 0x0fff, 0xaaa2, 0x9282, 0x0111, 0x1a0c, 0x0d65,
 	0x8210, 0x821c, 0x2001, 0x026c, 0x2098, 0xa860, 0x20e8, 0xa85c,
-	0x9080, 0x0029, 0x20a0, 0x2011, 0xca44, 0x2041, 0x0001, 0x223d,
+	0x9080, 0x0029, 0x20a0, 0x2011, 0xca54, 0x2041, 0x0001, 0x223d,
 	0x9784, 0x00ff, 0x9322, 0x1208, 0x2300, 0x20a8, 0x4003, 0x931a,
 	0x0530, 0x8210, 0xd7fc, 0x1130, 0x8d68, 0x2d0a, 0x2001, 0x0260,
 	0x2098, 0x0c68, 0x2950, 0x080c, 0x103b, 0x0170, 0x2900, 0xb002,
 	0xa867, 0x0147, 0xa86b, 0x0000, 0xa860, 0x20e8, 0xa85c, 0x9080,
 	0x001b, 0x20a0, 0x8840, 0x08d8, 0x2548, 0xa800, 0x902d, 0x0118,
-	0x080c, 0x1054, 0x0cc8, 0x080c, 0x1054, 0x0804, 0xc966, 0x2548,
+	0x080c, 0x1054, 0x0cc8, 0x080c, 0x1054, 0x0804, 0xc976, 0x2548,
 	0x8847, 0x9885, 0x0046, 0xa866, 0x2009, 0x0205, 0x200b, 0x0000,
-	0x080c, 0xd21e, 0x0804, 0xc95a, 0x8010, 0x0004, 0x801a, 0x0006,
+	0x080c, 0xd22f, 0x0804, 0xc96a, 0x8010, 0x0004, 0x801a, 0x0006,
 	0x8018, 0x0008, 0x8016, 0x000a, 0x8014, 0x9186, 0x0013, 0x1160,
 	0x6004, 0x908a, 0x0057, 0x1a0c, 0x0d65, 0x9082, 0x0040, 0x0a0c,
-	0x0d65, 0x2008, 0x0804, 0xcacf, 0x9186, 0x0051, 0x0108, 0x0040,
-	0x080c, 0x9ab7, 0x01e8, 0x9086, 0x0002, 0x0904, 0xcb16, 0x00c0,
+	0x0d65, 0x2008, 0x0804, 0xcadf, 0x9186, 0x0051, 0x0108, 0x0040,
+	0x080c, 0x9aaa, 0x01e8, 0x9086, 0x0002, 0x0904, 0xcb26, 0x00c0,
 	0x9186, 0x0027, 0x0180, 0x9186, 0x0048, 0x0128, 0x9186, 0x0014,
-	0x0150, 0x190c, 0x0d65, 0x080c, 0x9ab7, 0x0150, 0x9086, 0x0004,
-	0x0904, 0xcbb3, 0x0028, 0x6004, 0x9082, 0x0040, 0x2008, 0x001a,
-	0x080c, 0x9ca2, 0x0005, 0xca96, 0xca98, 0xca98, 0xcabf, 0xca96,
-	0xca96, 0xca96, 0xca96, 0xca96, 0xca96, 0xca96, 0xca96, 0xca96,
-	0xca96, 0xca96, 0xca96, 0xca96, 0xca96, 0xca96, 0x080c, 0x0d65,
-	0x080c, 0x8874, 0x080c, 0x8936, 0x0036, 0x0096, 0x6014, 0x904d,
-	0x01d8, 0x080c, 0xb847, 0x01c0, 0x6003, 0x0002, 0x6010, 0x00b6,
+	0x0150, 0x190c, 0x0d65, 0x080c, 0x9aaa, 0x0150, 0x9086, 0x0004,
+	0x0904, 0xcbc3, 0x0028, 0x6004, 0x9082, 0x0040, 0x2008, 0x001a,
+	0x080c, 0x9c93, 0x0005, 0xcaa6, 0xcaa8, 0xcaa8, 0xcacf, 0xcaa6,
+	0xcaa6, 0xcaa6, 0xcaa6, 0xcaa6, 0xcaa6, 0xcaa6, 0xcaa6, 0xcaa6,
+	0xcaa6, 0xcaa6, 0xcaa6, 0xcaa6, 0xcaa6, 0xcaa6, 0x080c, 0x0d65,
+	0x080c, 0x885d, 0x080c, 0x891b, 0x0036, 0x0096, 0x6014, 0x904d,
+	0x01d8, 0x080c, 0xb842, 0x01c0, 0x6003, 0x0002, 0x6010, 0x00b6,
 	0x2058, 0xb800, 0x00be, 0xd0bc, 0x1178, 0x2019, 0x0004, 0x080c,
-	0xd21e, 0x6017, 0x0000, 0x6018, 0x9005, 0x1120, 0x2001, 0x1958,
+	0xd22f, 0x6017, 0x0000, 0x6018, 0x9005, 0x1120, 0x2001, 0x1957,
 	0x2004, 0x601a, 0x6003, 0x0007, 0x009e, 0x003e, 0x0005, 0x0096,
-	0x080c, 0x8874, 0x080c, 0x8936, 0x080c, 0xb847, 0x0120, 0x6014,
-	0x2048, 0x080c, 0x1054, 0x080c, 0x9c21, 0x009e, 0x0005, 0x0002,
-	0xcae3, 0xcaf8, 0xcae5, 0xcb0d, 0xcae3, 0xcae3, 0xcae3, 0xcae3,
-	0xcae3, 0xcae3, 0xcae3, 0xcae3, 0xcae3, 0xcae3, 0xcae3, 0xcae3,
-	0xcae3, 0xcae3, 0xcae3, 0x080c, 0x0d65, 0x0096, 0x6014, 0x2048,
+	0x080c, 0x885d, 0x080c, 0x891b, 0x080c, 0xb842, 0x0120, 0x6014,
+	0x2048, 0x080c, 0x1054, 0x080c, 0x9c14, 0x009e, 0x0005, 0x0002,
+	0xcaf3, 0xcb08, 0xcaf5, 0xcb1d, 0xcaf3, 0xcaf3, 0xcaf3, 0xcaf3,
+	0xcaf3, 0xcaf3, 0xcaf3, 0xcaf3, 0xcaf3, 0xcaf3, 0xcaf3, 0xcaf3,
+	0xcaf3, 0xcaf3, 0xcaf3, 0x080c, 0x0d65, 0x0096, 0x6014, 0x2048,
 	0xa87c, 0xd0b4, 0x0138, 0x6003, 0x0007, 0x2009, 0x0043, 0x080c,
-	0x9c85, 0x0010, 0x6003, 0x0004, 0x080c, 0x8936, 0x009e, 0x0005,
-	0x080c, 0xb847, 0x0138, 0x6114, 0x0096, 0x2148, 0xa97c, 0x009e,
-	0xd1ec, 0x1138, 0x080c, 0x83c0, 0x080c, 0x9be7, 0x080c, 0x8936,
-	0x0005, 0x080c, 0xd476, 0x0db0, 0x0cc8, 0x6003, 0x0001, 0x6007,
-	0x0041, 0x2009, 0xa022, 0x080c, 0x84d1, 0x0005, 0x9182, 0x0040,
-	0x0002, 0xcb2c, 0xcb2e, 0xcb2c, 0xcb2c, 0xcb2c, 0xcb2c, 0xcb2c,
-	0xcb2c, 0xcb2c, 0xcb2c, 0xcb2c, 0xcb2c, 0xcb2c, 0xcb2c, 0xcb2c,
-	0xcb2c, 0xcb2c, 0xcb2f, 0xcb2c, 0x080c, 0x0d65, 0x0005, 0x00d6,
-	0x080c, 0x83c0, 0x00de, 0x080c, 0xd4ce, 0x080c, 0x9be7, 0x0005,
-	0x9182, 0x0040, 0x0002, 0xcb4e, 0xcb4e, 0xcb4e, 0xcb4e, 0xcb4e,
-	0xcb4e, 0xcb4e, 0xcb4e, 0xcb4e, 0xcb50, 0xcb7b, 0xcb4e, 0xcb4e,
-	0xcb4e, 0xcb4e, 0xcb7b, 0xcb4e, 0xcb4e, 0xcb4e, 0x080c, 0x0d65,
+	0x9c76, 0x0010, 0x6003, 0x0004, 0x080c, 0x891b, 0x009e, 0x0005,
+	0x080c, 0xb842, 0x0138, 0x6114, 0x0096, 0x2148, 0xa97c, 0x009e,
+	0xd1ec, 0x1138, 0x080c, 0x83a2, 0x080c, 0x9bda, 0x080c, 0x891b,
+	0x0005, 0x080c, 0xd487, 0x0db0, 0x0cc8, 0x6003, 0x0001, 0x6007,
+	0x0041, 0x2009, 0xa022, 0x080c, 0x84b3, 0x0005, 0x9182, 0x0040,
+	0x0002, 0xcb3c, 0xcb3e, 0xcb3c, 0xcb3c, 0xcb3c, 0xcb3c, 0xcb3c,
+	0xcb3c, 0xcb3c, 0xcb3c, 0xcb3c, 0xcb3c, 0xcb3c, 0xcb3c, 0xcb3c,
+	0xcb3c, 0xcb3c, 0xcb3f, 0xcb3c, 0x080c, 0x0d65, 0x0005, 0x00d6,
+	0x080c, 0x83a2, 0x00de, 0x080c, 0xd4df, 0x080c, 0x9bda, 0x0005,
+	0x9182, 0x0040, 0x0002, 0xcb5e, 0xcb5e, 0xcb5e, 0xcb5e, 0xcb5e,
+	0xcb5e, 0xcb5e, 0xcb5e, 0xcb5e, 0xcb60, 0xcb8b, 0xcb5e, 0xcb5e,
+	0xcb5e, 0xcb5e, 0xcb8b, 0xcb5e, 0xcb5e, 0xcb5e, 0x080c, 0x0d65,
 	0x6014, 0x0096, 0x2048, 0xa87c, 0xd0fc, 0x0168, 0x908c, 0x0003,
 	0x918e, 0x0002, 0x0180, 0x6144, 0xd1e4, 0x1168, 0x2009, 0x0041,
-	0x009e, 0x0804, 0xcc3b, 0x6003, 0x0007, 0x601b, 0x0000, 0x080c,
-	0x83c0, 0x009e, 0x0005, 0x6014, 0x2048, 0xa97c, 0xd1ec, 0x1130,
-	0x080c, 0x83c0, 0x080c, 0x9be7, 0x009e, 0x0005, 0x080c, 0xd476,
+	0x009e, 0x0804, 0xcc4b, 0x6003, 0x0007, 0x601b, 0x0000, 0x080c,
+	0x83a2, 0x009e, 0x0005, 0x6014, 0x2048, 0xa97c, 0xd1ec, 0x1130,
+	0x080c, 0x83a2, 0x080c, 0x9bda, 0x009e, 0x0005, 0x080c, 0xd487,
 	0x0db8, 0x009e, 0x0005, 0x2001, 0x180c, 0x200c, 0xc1d4, 0x2102,
-	0x0036, 0x080c, 0x88d1, 0x080c, 0x8936, 0x6014, 0x0096, 0x2048,
+	0x0036, 0x080c, 0x88b8, 0x080c, 0x891b, 0x6014, 0x0096, 0x2048,
 	0x6010, 0x00b6, 0x2058, 0xb800, 0x00be, 0xd0bc, 0x0188, 0xa87c,
 	0x9084, 0x0003, 0x9086, 0x0002, 0x0140, 0xa8ac, 0x6330, 0x931a,
 	0x6332, 0xa8b0, 0x632c, 0x931b, 0x632e, 0x6003, 0x0002, 0x0080,
-	0x2019, 0x0004, 0x080c, 0xd21e, 0x6018, 0x9005, 0x1128, 0x2001,
-	0x1958, 0x2004, 0x8003, 0x601a, 0x6017, 0x0000, 0x6003, 0x0007,
-	0x009e, 0x003e, 0x0005, 0x9182, 0x0040, 0x0002, 0xcbca, 0xcbca,
-	0xcbca, 0xcbca, 0xcbca, 0xcbca, 0xcbca, 0xcbca, 0xcbcc, 0xcbca,
-	0xcbca, 0xcbca, 0xcbca, 0xcbca, 0xcbca, 0xcbca, 0xcbca, 0xcbca,
-	0xcbca, 0xcc17, 0x080c, 0x0d65, 0x6014, 0x0096, 0x2048, 0xa834,
+	0x2019, 0x0004, 0x080c, 0xd22f, 0x6018, 0x9005, 0x1128, 0x2001,
+	0x1957, 0x2004, 0x8003, 0x601a, 0x6017, 0x0000, 0x6003, 0x0007,
+	0x009e, 0x003e, 0x0005, 0x9182, 0x0040, 0x0002, 0xcbda, 0xcbda,
+	0xcbda, 0xcbda, 0xcbda, 0xcbda, 0xcbda, 0xcbda, 0xcbdc, 0xcbda,
+	0xcbda, 0xcbda, 0xcbda, 0xcbda, 0xcbda, 0xcbda, 0xcbda, 0xcbda,
+	0xcbda, 0xcc27, 0x080c, 0x0d65, 0x6014, 0x0096, 0x2048, 0xa834,
 	0xaa38, 0x6110, 0x00b6, 0x2158, 0xb900, 0x00be, 0xd1bc, 0x1190,
 	0x920d, 0x1518, 0xa87c, 0xd0fc, 0x0128, 0x2009, 0x0041, 0x009e,
-	0x0804, 0xcc3b, 0x6003, 0x0007, 0x601b, 0x0000, 0x080c, 0x83c0,
+	0x0804, 0xcc4b, 0x6003, 0x0007, 0x601b, 0x0000, 0x080c, 0x83a2,
 	0x009e, 0x0005, 0x6124, 0xd1f4, 0x1d58, 0x0006, 0x0046, 0xacac,
 	0x9422, 0xa9b0, 0x2200, 0x910b, 0x6030, 0x9420, 0x6432, 0x602c,
 	0x9109, 0x612e, 0x004e, 0x000e, 0x08d8, 0x6110, 0x00b6, 0x2158,
 	0xb900, 0x00be, 0xd1bc, 0x1178, 0x2009, 0x180e, 0x210c, 0xd19c,
 	0x0118, 0x6003, 0x0007, 0x0010, 0x6003, 0x0006, 0x00e9, 0x080c,
-	0x83c2, 0x009e, 0x0005, 0x6003, 0x0002, 0x009e, 0x0005, 0x6024,
-	0xd0f4, 0x0128, 0x080c, 0x1595, 0x1904, 0xcbcc, 0x0005, 0x6014,
+	0x83a4, 0x009e, 0x0005, 0x6003, 0x0002, 0x009e, 0x0005, 0x6024,
+	0xd0f4, 0x0128, 0x080c, 0x15a2, 0x1904, 0xcbdc, 0x0005, 0x6014,
 	0x0096, 0x2048, 0xa834, 0xa938, 0x009e, 0x9105, 0x1120, 0x080c,
-	0x1595, 0x1904, 0xcbcc, 0x0005, 0xd2fc, 0x0140, 0x8002, 0x8000,
+	0x15a2, 0x1904, 0xcbdc, 0x0005, 0xd2fc, 0x0140, 0x8002, 0x8000,
 	0x8212, 0x9291, 0x0000, 0x2009, 0x0009, 0x0010, 0x2009, 0x0015,
 	0xaa9a, 0xa896, 0x0005, 0x9182, 0x0040, 0x0208, 0x0062, 0x9186,
 	0x0013, 0x0120, 0x9186, 0x0014, 0x190c, 0x0d65, 0x6024, 0xd0dc,
-	0x090c, 0x0d65, 0x0005, 0xcc5e, 0xcc6a, 0xcc76, 0xcc82, 0xcc5e,
-	0xcc5e, 0xcc5e, 0xcc5e, 0xcc65, 0xcc60, 0xcc60, 0xcc5e, 0xcc5e,
-	0xcc5e, 0xcc5e, 0xcc60, 0xcc5e, 0xcc60, 0xcc5e, 0x080c, 0x0d65,
+	0x090c, 0x0d65, 0x0005, 0xcc6e, 0xcc7a, 0xcc86, 0xcc92, 0xcc6e,
+	0xcc6e, 0xcc6e, 0xcc6e, 0xcc75, 0xcc70, 0xcc70, 0xcc6e, 0xcc6e,
+	0xcc6e, 0xcc6e, 0xcc70, 0xcc6e, 0xcc70, 0xcc6e, 0x080c, 0x0d65,
 	0x6024, 0xd0dc, 0x090c, 0x0d65, 0x0005, 0x6014, 0x9005, 0x190c,
 	0x0d65, 0x0005, 0x6003, 0x0001, 0x6106, 0x0126, 0x2091, 0x8000,
-	0x2009, 0xa022, 0x080c, 0x84b3, 0x012e, 0x0005, 0x6003, 0x0004,
-	0x6106, 0x0126, 0x2091, 0x8000, 0x2009, 0xa001, 0x080c, 0x84d1,
-	0x012e, 0x0005, 0x6003, 0x0003, 0x6106, 0x080c, 0x1aa5, 0x0126,
+	0x2009, 0xa022, 0x080c, 0x8495, 0x012e, 0x0005, 0x6003, 0x0004,
+	0x6106, 0x0126, 0x2091, 0x8000, 0x2009, 0xa001, 0x080c, 0x84b3,
+	0x012e, 0x0005, 0x6003, 0x0003, 0x6106, 0x080c, 0x1ab2, 0x0126,
 	0x2091, 0x8000, 0x6014, 0x0096, 0x2048, 0xa87c, 0xd0fc, 0x0188,
 	0x9084, 0x0003, 0x9086, 0x0002, 0x01a0, 0x6024, 0xd0cc, 0x1148,
 	0xd0c4, 0x1138, 0xa8a8, 0x9005, 0x1120, 0x6144, 0x918d, 0xb035,
-	0x0018, 0x6144, 0x918d, 0xa035, 0x009e, 0x080c, 0x8518, 0x012e,
+	0x0018, 0x6144, 0x918d, 0xa035, 0x009e, 0x080c, 0x84fa, 0x012e,
 	0x0005, 0x6144, 0x918d, 0xa032, 0x0cb8, 0x0126, 0x2091, 0x8000,
 	0x0036, 0x0096, 0x9182, 0x0040, 0x0023, 0x009e, 0x003e, 0x012e,
-	0x0005, 0xccc9, 0xcccb, 0xcce0, 0xccfa, 0xccc9, 0xccc9, 0xccc9,
-	0xccc9, 0xccc9, 0xccc9, 0xccc9, 0xccc9, 0xccc9, 0xccc9, 0xccc9,
-	0xccc9, 0x080c, 0x0d65, 0x6014, 0x2048, 0xa87c, 0xd0fc, 0x0510,
+	0x0005, 0xccd9, 0xccdb, 0xccf0, 0xcd0a, 0xccd9, 0xccd9, 0xccd9,
+	0xccd9, 0xccd9, 0xccd9, 0xccd9, 0xccd9, 0xccd9, 0xccd9, 0xccd9,
+	0xccd9, 0x080c, 0x0d65, 0x6014, 0x2048, 0xa87c, 0xd0fc, 0x0510,
 	0x909c, 0x0003, 0x939e, 0x0003, 0x01e8, 0x6003, 0x0001, 0x6106,
-	0x0126, 0x2091, 0x8000, 0x2009, 0xa022, 0x080c, 0x84d1, 0x0470,
+	0x0126, 0x2091, 0x8000, 0x2009, 0xa022, 0x080c, 0x84b3, 0x0470,
 	0x6014, 0x2048, 0xa87c, 0xd0fc, 0x0168, 0x909c, 0x0003, 0x939e,
 	0x0003, 0x0140, 0x6003, 0x0001, 0x6106, 0x2009, 0xa001, 0x080c,
-	0x84d1, 0x00e0, 0x901e, 0x6316, 0x631a, 0x2019, 0x0004, 0x080c,
-	0xd21e, 0x00a0, 0x6014, 0x2048, 0xa87c, 0xd0fc, 0x0d98, 0x909c,
+	0x84b3, 0x00e0, 0x901e, 0x6316, 0x631a, 0x2019, 0x0004, 0x080c,
+	0xd22f, 0x00a0, 0x6014, 0x2048, 0xa87c, 0xd0fc, 0x0d98, 0x909c,
 	0x0003, 0x939e, 0x0003, 0x0d70, 0x6003, 0x0003, 0x6106, 0x080c,
-	0x1aa5, 0x6144, 0x918d, 0xa035, 0x080c, 0x8518, 0x0005, 0x080c,
-	0x8874, 0x6114, 0x81ff, 0x0158, 0x0096, 0x2148, 0x080c, 0xd51a,
-	0x0036, 0x2019, 0x0029, 0x080c, 0xd21e, 0x003e, 0x009e, 0x080c,
-	0x9c21, 0x080c, 0x8936, 0x0005, 0x080c, 0x88d1, 0x6114, 0x81ff,
-	0x0158, 0x0096, 0x2148, 0x080c, 0xd51a, 0x0036, 0x2019, 0x0029,
-	0x080c, 0xd21e, 0x003e, 0x009e, 0x080c, 0x9c21, 0x0005, 0x9182,
-	0x0085, 0x0002, 0xcd49, 0xcd47, 0xcd47, 0xcd55, 0xcd47, 0xcd47,
-	0xcd47, 0xcd47, 0xcd47, 0xcd47, 0xcd47, 0xcd47, 0xcd47, 0x080c,
+	0x1ab2, 0x6144, 0x918d, 0xa035, 0x080c, 0x84fa, 0x0005, 0x080c,
+	0x885d, 0x6114, 0x81ff, 0x0158, 0x0096, 0x2148, 0x080c, 0xd52b,
+	0x0036, 0x2019, 0x0029, 0x080c, 0xd22f, 0x003e, 0x009e, 0x080c,
+	0x9c14, 0x080c, 0x891b, 0x0005, 0x080c, 0x88b8, 0x6114, 0x81ff,
+	0x0158, 0x0096, 0x2148, 0x080c, 0xd52b, 0x0036, 0x2019, 0x0029,
+	0x080c, 0xd22f, 0x003e, 0x009e, 0x080c, 0x9c14, 0x0005, 0x9182,
+	0x0085, 0x0002, 0xcd59, 0xcd57, 0xcd57, 0xcd65, 0xcd57, 0xcd57,
+	0xcd57, 0xcd57, 0xcd57, 0xcd57, 0xcd57, 0xcd57, 0xcd57, 0x080c,
 	0x0d65, 0x6003, 0x000b, 0x6106, 0x0126, 0x2091, 0x8000, 0x2009,
-	0x8020, 0x080c, 0x84d1, 0x012e, 0x0005, 0x0026, 0x00e6, 0x080c,
-	0xd46d, 0x0118, 0x080c, 0x9be7, 0x0440, 0x2071, 0x0260, 0x7224,
+	0x8020, 0x080c, 0x84b3, 0x012e, 0x0005, 0x0026, 0x00e6, 0x080c,
+	0xd47e, 0x0118, 0x080c, 0x9bda, 0x0440, 0x2071, 0x0260, 0x7224,
 	0x6216, 0x2001, 0x180e, 0x2004, 0xd0e4, 0x0150, 0x6010, 0x00b6,
-	0x2058, 0xbca0, 0x00be, 0x2c00, 0x2011, 0x014e, 0x080c, 0x9f13,
-	0x7220, 0x080c, 0xd0b4, 0x0118, 0x6007, 0x0086, 0x0040, 0x6007,
+	0x2058, 0xbca0, 0x00be, 0x2c00, 0x2011, 0x014e, 0x080c, 0x9f04,
+	0x7220, 0x080c, 0xd0c5, 0x0118, 0x6007, 0x0086, 0x0040, 0x6007,
 	0x0087, 0x7224, 0x9296, 0xffff, 0x1110, 0x6007, 0x0086, 0x6003,
-	0x0001, 0x2009, 0x8020, 0x080c, 0x84d1, 0x00ee, 0x002e, 0x0005,
+	0x0001, 0x2009, 0x8020, 0x080c, 0x84b3, 0x00ee, 0x002e, 0x0005,
 	0x9186, 0x0013, 0x1160, 0x6004, 0x908a, 0x0085, 0x0a0c, 0x0d65,
 	0x908a, 0x0092, 0x1a0c, 0x0d65, 0x9082, 0x0085, 0x00a2, 0x9186,
-	0x0027, 0x0130, 0x9186, 0x0014, 0x0118, 0x080c, 0x9ca2, 0x0050,
-	0x2001, 0x0007, 0x080c, 0x61ed, 0x080c, 0x8874, 0x080c, 0x9c21,
-	0x080c, 0x8936, 0x0005, 0xcdb8, 0xcdba, 0xcdba, 0xcdb8, 0xcdb8,
-	0xcdb8, 0xcdb8, 0xcdb8, 0xcdb8, 0xcdb8, 0xcdb8, 0xcdb8, 0xcdb8,
-	0x080c, 0x0d65, 0x080c, 0x9c21, 0x080c, 0x8936, 0x0005, 0x9182,
+	0x0027, 0x0130, 0x9186, 0x0014, 0x0118, 0x080c, 0x9c93, 0x0050,
+	0x2001, 0x0007, 0x080c, 0x61e8, 0x080c, 0x885d, 0x080c, 0x9c14,
+	0x080c, 0x891b, 0x0005, 0xcdc8, 0xcdca, 0xcdca, 0xcdc8, 0xcdc8,
+	0xcdc8, 0xcdc8, 0xcdc8, 0xcdc8, 0xcdc8, 0xcdc8, 0xcdc8, 0xcdc8,
+	0x080c, 0x0d65, 0x080c, 0x9c14, 0x080c, 0x891b, 0x0005, 0x9182,
 	0x0085, 0x0a0c, 0x0d65, 0x9182, 0x0092, 0x1a0c, 0x0d65, 0x9182,
-	0x0085, 0x0002, 0xcdd7, 0xcdd7, 0xcdd7, 0xcdd9, 0xcdd7, 0xcdd7,
-	0xcdd7, 0xcdd7, 0xcdd7, 0xcdd7, 0xcdd7, 0xcdd7, 0xcdd7, 0x080c,
+	0x0085, 0x0002, 0xcde7, 0xcde7, 0xcde7, 0xcde9, 0xcde7, 0xcde7,
+	0xcde7, 0xcde7, 0xcde7, 0xcde7, 0xcde7, 0xcde7, 0xcde7, 0x080c,
 	0x0d65, 0x0005, 0x9186, 0x0013, 0x0148, 0x9186, 0x0014, 0x0130,
-	0x9186, 0x0027, 0x0118, 0x080c, 0x9ca2, 0x0020, 0x080c, 0x8874,
-	0x080c, 0x9c21, 0x0005, 0x0036, 0x080c, 0xd4ce, 0x604b, 0x0000,
+	0x9186, 0x0027, 0x0118, 0x080c, 0x9c93, 0x0020, 0x080c, 0x885d,
+	0x080c, 0x9c14, 0x0005, 0x0036, 0x080c, 0xd4df, 0x604b, 0x0000,
 	0x2019, 0x000b, 0x0031, 0x6023, 0x0006, 0x6003, 0x0007, 0x003e,
 	0x0005, 0x0126, 0x0036, 0x2091, 0x8000, 0x2001, 0x0382, 0x2004,
-	0x9084, 0x0007, 0x0006, 0x9086, 0x0003, 0x0110, 0x080c, 0x98c8,
-	0x0086, 0x2c40, 0x0096, 0x904e, 0x080c, 0x9382, 0x009e, 0x008e,
-	0x1550, 0x0076, 0x2c38, 0x080c, 0x942d, 0x007e, 0x1520, 0x6000,
-	0x9086, 0x0000, 0x0500, 0x6020, 0x9086, 0x0007, 0x01e0, 0x0096,
-	0x601c, 0xd084, 0x0140, 0x080c, 0xd4ce, 0x080c, 0xbf79, 0x080c,
-	0x1914, 0x6023, 0x0007, 0x6014, 0x2048, 0x080c, 0xb847, 0x0110,
-	0x080c, 0xd21e, 0x009e, 0x6017, 0x0000, 0x080c, 0xd4ce, 0x6023,
-	0x0007, 0x080c, 0xbf79, 0x000e, 0x9086, 0x0003, 0x0110, 0x080c,
-	0x98e4, 0x003e, 0x012e, 0x0005, 0x00f6, 0x00c6, 0x00b6, 0x0036,
-	0x0156, 0x2079, 0x0260, 0x7938, 0x783c, 0x080c, 0x2424, 0x15e8,
-	0x0016, 0x00c6, 0x080c, 0x6270, 0x15b0, 0x001e, 0x00c6, 0x2160,
-	0x080c, 0xbf76, 0x00ce, 0x002e, 0x0026, 0x0016, 0x080c, 0x98c8,
-	0x2019, 0x0029, 0x080c, 0x94f4, 0x080c, 0x863b, 0x0076, 0x903e,
-	0x080c, 0x852a, 0x007e, 0x001e, 0x0076, 0x903e, 0x080c, 0xcfc8,
-	0x007e, 0x080c, 0x98e4, 0x0026, 0xba04, 0x9294, 0xff00, 0x8217,
-	0x9286, 0x0006, 0x0118, 0x9286, 0x0004, 0x1118, 0xbaa0, 0x080c,
-	0x30dc, 0x002e, 0xbc84, 0x001e, 0x080c, 0x5cf6, 0xbe12, 0xbd16,
-	0xbc86, 0x9006, 0x0010, 0x00ce, 0x001e, 0x015e, 0x003e, 0x00be,
-	0x00ce, 0x00fe, 0x0005, 0x00c6, 0x00d6, 0x00b6, 0x0016, 0x2009,
-	0x1823, 0x2104, 0x9086, 0x0074, 0x1904, 0xceec, 0x2069, 0x0260,
-	0x6944, 0x9182, 0x0100, 0x06e0, 0x6940, 0x9184, 0x8000, 0x0904,
-	0xcee9, 0x2001, 0x194d, 0x2004, 0x9005, 0x1140, 0x6010, 0x2058,
-	0xb884, 0x9005, 0x0118, 0x9184, 0x0800, 0x0598, 0x6948, 0x918a,
-	0x0001, 0x0648, 0x080c, 0xd582, 0x0118, 0x6978, 0xd1fc, 0x11b8,
-	0x2009, 0x0205, 0x200b, 0x0001, 0x693c, 0x81ff, 0x1198, 0x6944,
-	0x9182, 0x0100, 0x02a8, 0x6940, 0x81ff, 0x1178, 0x6948, 0x918a,
-	0x0001, 0x0288, 0x6950, 0x918a, 0x0001, 0x0298, 0x00d0, 0x6017,
-	0x0100, 0x00a0, 0x6017, 0x0300, 0x0088, 0x6017, 0x0500, 0x0070,
-	0x6017, 0x0700, 0x0058, 0x6017, 0x0900, 0x0040, 0x6017, 0x0b00,
-	0x0028, 0x6017, 0x0f00, 0x0010, 0x6017, 0x2d00, 0x9085, 0x0001,
-	0x0008, 0x9006, 0x001e, 0x00be, 0x00de, 0x00ce, 0x0005, 0x00c6,
-	0x00b6, 0x0026, 0x0036, 0x0156, 0x6210, 0x2258, 0xbb04, 0x9394,
-	0x00ff, 0x9286, 0x0006, 0x0180, 0x9286, 0x0004, 0x0168, 0x9394,
-	0xff00, 0x8217, 0x9286, 0x0006, 0x0138, 0x9286, 0x0004, 0x0120,
-	0x080c, 0x627f, 0x0804, 0xcf57, 0x2011, 0x0276, 0x20a9, 0x0004,
-	0x0096, 0x2b48, 0x2019, 0x000a, 0x080c, 0xabdf, 0x009e, 0x15c0,
-	0x2011, 0x027a, 0x20a9, 0x0004, 0x0096, 0x2b48, 0x2019, 0x0006,
-	0x080c, 0xabdf, 0x009e, 0x1560, 0x0046, 0x0016, 0xbaa0, 0x2220,
-	0x9006, 0x2009, 0x1854, 0x210c, 0x0038, 0x2009, 0x0029, 0x080c,
-	0xd273, 0xb800, 0xc0e5, 0xb802, 0x080c, 0x98c8, 0x2019, 0x0029,
-	0x080c, 0x863b, 0x0076, 0x2039, 0x0000, 0x080c, 0x852a, 0x2c08,
-	0x080c, 0xcfc8, 0x007e, 0x080c, 0x98e4, 0x2001, 0x0007, 0x080c,
-	0x61ed, 0x2001, 0x0007, 0x080c, 0x61c1, 0x001e, 0x004e, 0x9006,
-	0x015e, 0x003e, 0x002e, 0x00be, 0x00ce, 0x0005, 0x00d6, 0x2069,
-	0x026e, 0x6800, 0x9086, 0x0800, 0x0118, 0x6017, 0x0000, 0x0008,
-	0x9006, 0x00de, 0x0005, 0x00b6, 0x00f6, 0x0016, 0x0026, 0x0036,
-	0x0156, 0x2079, 0x026c, 0x7930, 0x7834, 0x080c, 0x2424, 0x11d0,
-	0x080c, 0x6270, 0x11b8, 0x2011, 0x0270, 0x20a9, 0x0004, 0x0096,
-	0x2b48, 0x2019, 0x000a, 0x080c, 0xabdf, 0x009e, 0x1158, 0x2011,
-	0x0274, 0x20a9, 0x0004, 0x0096, 0x2b48, 0x2019, 0x0006, 0x080c,
-	0xabdf, 0x009e, 0x015e, 0x003e, 0x002e, 0x001e, 0x00fe, 0x00be,
-	0x0005, 0x00b6, 0x0006, 0x0016, 0x0026, 0x0036, 0x0156, 0x2011,
-	0x0263, 0x2204, 0x8211, 0x220c, 0x080c, 0x2424, 0x11d0, 0x080c,
-	0x6270, 0x11b8, 0x2011, 0x0276, 0x20a9, 0x0004, 0x0096, 0x2b48,
-	0x2019, 0x000a, 0x080c, 0xabdf, 0x009e, 0x1158, 0x2011, 0x027a,
-	0x20a9, 0x0004, 0x0096, 0x2b48, 0x2019, 0x0006, 0x080c, 0xabdf,
-	0x009e, 0x015e, 0x003e, 0x002e, 0x001e, 0x000e, 0x00be, 0x0005,
-	0x00e6, 0x00c6, 0x0086, 0x0076, 0x0066, 0x0056, 0x0046, 0x0026,
-	0x0126, 0x2091, 0x8000, 0x080c, 0x9926, 0x0106, 0x190c, 0x98c8,
-	0x2740, 0x2029, 0x19c4, 0x252c, 0x2021, 0x19cb, 0x2424, 0x2061,
-	0x1ddc, 0x2071, 0x1800, 0x7650, 0x7070, 0x81ff, 0x0150, 0x0006,
-	0x9186, 0x1b02, 0x000e, 0x0128, 0x8001, 0x9602, 0x1a04, 0xd069,
-	0x0018, 0x9606, 0x0904, 0xd069, 0x2100, 0x9c06, 0x0904, 0xd060,
-	0x080c, 0xd2b4, 0x1904, 0xd060, 0x080c, 0xd59f, 0x0904, 0xd060,
-	0x080c, 0xd2a4, 0x0904, 0xd060, 0x6720, 0x9786, 0x0001, 0x1148,
-	0x080c, 0x3181, 0x0904, 0xd088, 0x6004, 0x9086, 0x0000, 0x1904,
-	0xd088, 0x9786, 0x0004, 0x0904, 0xd088, 0x9786, 0x0007, 0x0904,
-	0xd060, 0x2500, 0x9c06, 0x0904, 0xd060, 0x2400, 0x9c06, 0x0904,
-	0xd060, 0x88ff, 0x0118, 0x605c, 0x9906, 0x15d0, 0x0096, 0x6043,
-	0xffff, 0x6000, 0x9086, 0x0004, 0x1120, 0x0016, 0x080c, 0x1914,
-	0x001e, 0x9786, 0x000a, 0x0148, 0x080c, 0xba5c, 0x1130, 0x080c,
-	0xa58f, 0x009e, 0x080c, 0x9c21, 0x0418, 0x6014, 0x2048, 0x080c,
-	0xb847, 0x01d8, 0x9786, 0x0003, 0x1588, 0xa867, 0x0103, 0xa87c,
-	0xd0cc, 0x0130, 0x0096, 0xa878, 0x2048, 0x080c, 0x0fd4, 0x009e,
-	0xab7a, 0xa877, 0x0000, 0x080c, 0xd51a, 0x0016, 0x080c, 0xbb45,
-	0x080c, 0x698a, 0x001e, 0x080c, 0xba36, 0x009e, 0x080c, 0x9c21,
-	0x9ce0, 0x001c, 0x2001, 0x1819, 0x2004, 0x9c02, 0x1210, 0x0804,
-	0xcfe1, 0x010e, 0x190c, 0x98e4, 0x012e, 0x002e, 0x004e, 0x005e,
-	0x006e, 0x007e, 0x008e, 0x00ce, 0x00ee, 0x0005, 0x9786, 0x0006,
-	0x1150, 0x9386, 0x0005, 0x0128, 0x080c, 0xd51a, 0x080c, 0xd21e,
-	0x08e0, 0x009e, 0x08e8, 0x9786, 0x000a, 0x0908, 0x0804, 0xd045,
-	0x81ff, 0x09b0, 0x9180, 0x0001, 0x2004, 0x9086, 0x0018, 0x0130,
-	0x9180, 0x0001, 0x2004, 0x9086, 0x002d, 0x1950, 0x6000, 0x9086,
-	0x0002, 0x1930, 0x080c, 0xba4b, 0x0130, 0x080c, 0xba5c, 0x1900,
-	0x080c, 0xa58f, 0x0038, 0x080c, 0x303b, 0x080c, 0xba5c, 0x1110,
-	0x080c, 0xa58f, 0x080c, 0x9c21, 0x0804, 0xd060, 0xa864, 0x9084,
-	0x00ff, 0x9086, 0x0039, 0x0005, 0x00c6, 0x00e6, 0x0016, 0x2c08,
-	0x2170, 0x9006, 0x080c, 0xd245, 0x001e, 0x0120, 0x6020, 0x9084,
-	0x000f, 0x001b, 0x00ee, 0x00ce, 0x0005, 0xd0d3, 0xd0d3, 0xd0d3,
-	0xd0d3, 0xd0d3, 0xd0d3, 0xd0d5, 0xd0d3, 0xd0d3, 0xd0d3, 0xd0d3,
-	0x9c21, 0x9c21, 0xd0d3, 0x9006, 0x0005, 0x0036, 0x0046, 0x0016,
-	0x7010, 0x00b6, 0x2058, 0xbca0, 0x00be, 0x2c00, 0x2009, 0x0020,
-	0x080c, 0xd273, 0x001e, 0x004e, 0x2019, 0x0002, 0x080c, 0xcdf9,
-	0x003e, 0x9085, 0x0001, 0x0005, 0x0096, 0x080c, 0xb847, 0x0140,
-	0x6014, 0x904d, 0x080c, 0xb452, 0x687b, 0x0005, 0x080c, 0x6996,
-	0x009e, 0x080c, 0x9c21, 0x9085, 0x0001, 0x0005, 0x2001, 0x0001,
-	0x080c, 0x61ad, 0x0156, 0x0016, 0x0026, 0x0036, 0x20a9, 0x0004,
-	0x2019, 0x1805, 0x2011, 0x0276, 0x080c, 0xabcb, 0x003e, 0x002e,
-	0x001e, 0x015e, 0x9005, 0x0005, 0x00f6, 0x00e6, 0x00c6, 0x0086,
-	0x0076, 0x0066, 0x00b6, 0x0126, 0x2091, 0x8000, 0x2740, 0x2061,
-	0x1ddc, 0x2079, 0x0001, 0x8fff, 0x0904, 0xd16e, 0x2071, 0x1800,
-	0x7650, 0x7070, 0x8001, 0x9602, 0x1a04, 0xd16e, 0x88ff, 0x0120,
-	0x2800, 0x9c06, 0x1590, 0x2078, 0x080c, 0xd2a4, 0x0570, 0x2400,
-	0x9c06, 0x0558, 0x6720, 0x9786, 0x0006, 0x1538, 0x9786, 0x0007,
-	0x0520, 0x88ff, 0x1140, 0x6010, 0x9b06, 0x11f8, 0x85ff, 0x0118,
-	0x605c, 0x9106, 0x11d0, 0x0096, 0x601c, 0xd084, 0x0140, 0x080c,
-	0xd4ce, 0x080c, 0xbf79, 0x080c, 0x1914, 0x6023, 0x0007, 0x6014,
-	0x2048, 0x080c, 0xb847, 0x0120, 0x0046, 0x080c, 0xd21e, 0x004e,
-	0x009e, 0x080c, 0x9c21, 0x88ff, 0x1198, 0x9ce0, 0x001c, 0x2001,
-	0x1819, 0x2004, 0x9c02, 0x1210, 0x0804, 0xd123, 0x9006, 0x012e,
-	0x00be, 0x006e, 0x007e, 0x008e, 0x00ce, 0x00ee, 0x00fe, 0x0005,
-	0x98c5, 0x0001, 0x0ca0, 0x080c, 0x98c8, 0x00b6, 0x0076, 0x0056,
-	0x0086, 0x9046, 0x2029, 0x0001, 0x2c20, 0x2019, 0x0002, 0x6210,
-	0x2258, 0x0096, 0x904e, 0x080c, 0x9382, 0x009e, 0x008e, 0x903e,
-	0x080c, 0x942d, 0x080c, 0xd114, 0x005e, 0x007e, 0x00be, 0x080c,
-	0x98e4, 0x0005, 0x080c, 0x98c8, 0x00b6, 0x0046, 0x0056, 0x0076,
-	0x00c6, 0x0156, 0x2c20, 0x2128, 0x20a9, 0x007f, 0x900e, 0x0016,
-	0x0036, 0x080c, 0x6270, 0x1190, 0x0056, 0x0086, 0x9046, 0x2508,
-	0x2029, 0x0001, 0x0096, 0x904e, 0x080c, 0x9382, 0x009e, 0x008e,
-	0x903e, 0x080c, 0x942d, 0x080c, 0xd114, 0x005e, 0x003e, 0x001e,
-	0x8108, 0x1f04, 0xd1a7, 0x015e, 0x00ce, 0x007e, 0x005e, 0x004e,
-	0x00be, 0x080c, 0x98e4, 0x0005, 0x080c, 0x98c8, 0x00b6, 0x0076,
-	0x0056, 0x6210, 0x2258, 0x0086, 0x9046, 0x2029, 0x0001, 0x2019,
-	0x0048, 0x0096, 0x904e, 0x080c, 0x9382, 0x009e, 0x008e, 0x903e,
-	0x080c, 0x942d, 0x2c20, 0x080c, 0xd114, 0x005e, 0x007e, 0x00be,
-	0x080c, 0x98e4, 0x0005, 0x080c, 0x98c8, 0x00b6, 0x0046, 0x0056,
-	0x0076, 0x00c6, 0x0156, 0x2c20, 0x20a9, 0x0800, 0x900e, 0x0016,
-	0x0036, 0x080c, 0x6270, 0x11a0, 0x0086, 0x9046, 0x2828, 0x0046,
-	0x2021, 0x0001, 0x080c, 0xd4b2, 0x004e, 0x0096, 0x904e, 0x080c,
-	0x9382, 0x009e, 0x008e, 0x903e, 0x080c, 0x942d, 0x080c, 0xd114,
-	0x003e, 0x001e, 0x8108, 0x1f04, 0xd1f7, 0x015e, 0x00ce, 0x007e,
-	0x005e, 0x004e, 0x00be, 0x080c, 0x98e4, 0x0005, 0x0016, 0x00f6,
-	0x080c, 0xb845, 0x0198, 0xa864, 0x9084, 0x00ff, 0x9086, 0x0046,
-	0x0180, 0xa800, 0x907d, 0x0138, 0xa803, 0x0000, 0xab82, 0x080c,
-	0x6996, 0x2f48, 0x0cb0, 0xab82, 0x080c, 0x6996, 0x00fe, 0x001e,
-	0x0005, 0xa800, 0x907d, 0x0130, 0xa803, 0x0000, 0x080c, 0x6996,
-	0x2f48, 0x0cb8, 0x080c, 0x6996, 0x0c88, 0x00e6, 0x0046, 0x0036,
-	0x2061, 0x1ddc, 0x9005, 0x1138, 0x2071, 0x1800, 0x7450, 0x7070,
-	0x8001, 0x9402, 0x12d8, 0x2100, 0x9c06, 0x0168, 0x6000, 0x9086,
-	0x0000, 0x0148, 0x6008, 0x9206, 0x1130, 0x6010, 0x91a0, 0x0004,
-	0x2424, 0x9406, 0x0140, 0x9ce0, 0x001c, 0x2001, 0x1819, 0x2004,
-	0x9c02, 0x1220, 0x0c40, 0x9085, 0x0001, 0x0008, 0x9006, 0x003e,
-	0x004e, 0x00ee, 0x0005, 0x0096, 0x0006, 0x080c, 0x1022, 0x000e,
-	0x090c, 0x0d65, 0xaae2, 0xa867, 0x010d, 0xa88e, 0x0026, 0x2010,
-	0x080c, 0xb835, 0x2001, 0x0000, 0x0120, 0x2200, 0x9080, 0x0017,
-	0x2004, 0x002e, 0xa87a, 0x9186, 0x0020, 0x0110, 0xa8e3, 0xffff,
-	0xa986, 0xac76, 0xa87f, 0x0000, 0x2001, 0x195f, 0x2004, 0xa882,
-	0x9006, 0xa802, 0xa86a, 0xa88a, 0x0126, 0x2091, 0x8000, 0x080c,
-	0x6996, 0x012e, 0x009e, 0x0005, 0x6700, 0x9786, 0x0000, 0x0158,
-	0x9786, 0x0001, 0x0140, 0x9786, 0x000a, 0x0128, 0x9786, 0x0009,
-	0x0110, 0x9085, 0x0001, 0x0005, 0x00e6, 0x6010, 0x9075, 0x0138,
-	0x00b6, 0x2058, 0xb8a0, 0x00be, 0x9206, 0x00ee, 0x0005, 0x9085,
-	0x0001, 0x0cd8, 0x0016, 0x6004, 0x908e, 0x001e, 0x11a0, 0x8007,
-	0x6134, 0x918c, 0x00ff, 0x9105, 0x6036, 0x6007, 0x0085, 0x6003,
-	0x000b, 0x6023, 0x0005, 0x2001, 0x1958, 0x2004, 0x601a, 0x2009,
-	0x8020, 0x080c, 0x84d1, 0x001e, 0x0005, 0xa001, 0xa001, 0x0005,
-	0x6024, 0xd0e4, 0x0158, 0xd0cc, 0x0118, 0x080c, 0xbb8c, 0x0030,
-	0x080c, 0xd4ce, 0x080c, 0x83c0, 0x080c, 0x9be7, 0x0005, 0x9280,
-	0x0008, 0x2004, 0x9084, 0x000f, 0x0002, 0xd303, 0xd303, 0xd303,
-	0xd305, 0xd303, 0xd305, 0xd305, 0xd303, 0xd305, 0xd303, 0xd303,
-	0xd303, 0xd303, 0xd303, 0x9006, 0x0005, 0x9085, 0x0001, 0x0005,
-	0x9280, 0x0008, 0x2004, 0x9084, 0x000f, 0x0002, 0xd31c, 0xd31c,
-	0xd31c, 0xd31c, 0xd31c, 0xd31c, 0xd329, 0xd31c, 0xd31c, 0xd31c,
-	0xd31c, 0xd31c, 0xd31c, 0xd31c, 0x6007, 0x003b, 0x602f, 0x0009,
-	0x6017, 0x2a00, 0x6003, 0x0001, 0x2009, 0x8020, 0x080c, 0x84d1,
-	0x0005, 0x0096, 0x00c6, 0x2260, 0x080c, 0xd4ce, 0x604b, 0x0000,
-	0x6024, 0xc0f4, 0xc0e4, 0x6026, 0x603b, 0x0000, 0x00ce, 0x00d6,
-	0x2268, 0x9186, 0x0007, 0x1904, 0xd382, 0x6814, 0x9005, 0x0138,
-	0x2048, 0xa87c, 0xd0fc, 0x1118, 0x00de, 0x009e, 0x08a8, 0x6007,
-	0x003a, 0x6003, 0x0001, 0x2009, 0x8020, 0x080c, 0x84d1, 0x00c6,
-	0x2d60, 0x6100, 0x9186, 0x0002, 0x1904, 0xd3f9, 0x6014, 0x9005,
-	0x1138, 0x6000, 0x9086, 0x0007, 0x190c, 0x0d65, 0x0804, 0xd3f9,
-	0x2048, 0x080c, 0xb847, 0x1130, 0x0028, 0x2048, 0xa800, 0x9005,
-	0x1de0, 0x2900, 0x2048, 0xa87c, 0x9084, 0x0003, 0x9086, 0x0002,
-	0x1168, 0xa87c, 0xc0dc, 0xc0f4, 0xa87e, 0xa880, 0xc0fc, 0xa882,
-	0x2009, 0x0043, 0x080c, 0xcc3b, 0x0804, 0xd3f9, 0x2009, 0x0041,
-	0x0804, 0xd3f3, 0x9186, 0x0005, 0x15a0, 0x6814, 0x2048, 0xa87c,
-	0xd0bc, 0x1120, 0x00de, 0x009e, 0x0804, 0xd31c, 0xd0b4, 0x0128,
-	0xd0fc, 0x090c, 0x0d65, 0x0804, 0xd33d, 0x6007, 0x003a, 0x6003,
-	0x0001, 0x2009, 0x8020, 0x080c, 0x84d1, 0x00c6, 0x2d60, 0x6100,
-	0x9186, 0x0002, 0x0120, 0x9186, 0x0004, 0x1904, 0xd3f9, 0x6814,
-	0x2048, 0xa97c, 0xc1f4, 0xc1dc, 0xa97e, 0xa980, 0xc1fc, 0xc1bc,
-	0xa982, 0x00f6, 0x2c78, 0x080c, 0x164f, 0x00fe, 0x2009, 0x0042,
-	0x04d0, 0x0036, 0x080c, 0x1022, 0x090c, 0x0d65, 0xa867, 0x010d,
-	0x9006, 0xa802, 0xa86a, 0xa88a, 0x2d18, 0xab8e, 0xa887, 0x0045,
-	0x2c00, 0xa892, 0x6038, 0xa8a2, 0x2360, 0x6024, 0xc0dd, 0x6026,
-	0x6010, 0x00b6, 0x2058, 0xb8a0, 0x00be, 0x2004, 0x635c, 0xab7a,
-	0xa876, 0x9006, 0xa87e, 0xa882, 0xad9a, 0xae96, 0xa89f, 0x0001,
-	0x080c, 0x6996, 0x2019, 0x0045, 0x6008, 0x2068, 0x080c, 0xcdf9,
-	0x2d00, 0x600a, 0x6023, 0x0006, 0x6003, 0x0007, 0x901e, 0x631a,
-	0x634a, 0x003e, 0x0038, 0x604b, 0x0000, 0x6003, 0x0007, 0x080c,
-	0xcc3b, 0x00ce, 0x00de, 0x009e, 0x0005, 0x9186, 0x0013, 0x1128,
-	0x6004, 0x9082, 0x0085, 0x2008, 0x00c2, 0x9186, 0x0027, 0x1178,
-	0x080c, 0x8874, 0x0036, 0x0096, 0x6014, 0x2048, 0x2019, 0x0004,
-	0x080c, 0xd21e, 0x009e, 0x003e, 0x080c, 0x8936, 0x0005, 0x9186,
-	0x0014, 0x0d70, 0x080c, 0x9ca2, 0x0005, 0xd42c, 0xd42a, 0xd42a,
-	0xd42a, 0xd42a, 0xd42a, 0xd42c, 0xd42a, 0xd42a, 0xd42a, 0xd42a,
-	0xd42a, 0xd42a, 0x080c, 0x0d65, 0x6003, 0x000c, 0x080c, 0x8936,
-	0x0005, 0x9182, 0x0092, 0x1220, 0x9182, 0x0085, 0x0208, 0x001a,
-	0x080c, 0x9ca2, 0x0005, 0xd448, 0xd448, 0xd448, 0xd448, 0xd44a,
-	0xd46a, 0xd448, 0xd448, 0xd448, 0xd448, 0xd448, 0xd448, 0xd448,
-	0x080c, 0x0d65, 0x00d6, 0x2c68, 0x080c, 0x9b91, 0x01b0, 0x6003,
-	0x0001, 0x6007, 0x001e, 0x2009, 0x026e, 0x210c, 0x613a, 0x2009,
-	0x026f, 0x210c, 0x613e, 0x600b, 0xffff, 0x6910, 0x6112, 0x6023,
-	0x0004, 0x2009, 0x8020, 0x080c, 0x84d1, 0x2d60, 0x080c, 0x9be7,
-	0x00de, 0x0005, 0x080c, 0x9be7, 0x0005, 0x00e6, 0x6010, 0x00b6,
-	0x2058, 0xb800, 0x00be, 0xd0ec, 0x00ee, 0x0005, 0x2009, 0x1873,
-	0x210c, 0xd1ec, 0x05b0, 0x6003, 0x0002, 0x6024, 0xc0e5, 0x6026,
-	0xd0cc, 0x0150, 0x2001, 0x1959, 0x2004, 0x604a, 0x2009, 0x1873,
-	0x210c, 0xd1f4, 0x1520, 0x00a0, 0x2009, 0x1873, 0x210c, 0xd1f4,
-	0x0128, 0x6024, 0xc0e4, 0x6026, 0x9006, 0x00d8, 0x2001, 0x1959,
-	0x200c, 0x2001, 0x1957, 0x2004, 0x9100, 0x9080, 0x000a, 0x604a,
-	0x6010, 0x00b6, 0x2058, 0xb8ac, 0x00be, 0x0008, 0x2104, 0x9005,
-	0x0118, 0x9088, 0x0003, 0x0cd0, 0x2c0a, 0x600f, 0x0000, 0x9085,
-	0x0001, 0x0005, 0x0016, 0x00c6, 0x00e6, 0x615c, 0xb8ac, 0x2060,
-	0x8cff, 0x0180, 0x84ff, 0x1118, 0x605c, 0x9106, 0x1138, 0x600c,
-	0x2072, 0x080c, 0x83c0, 0x080c, 0x9be7, 0x0010, 0x9cf0, 0x0003,
-	0x2e64, 0x0c70, 0x00ee, 0x00ce, 0x001e, 0x0005, 0x00d6, 0x00b6,
-	0x6010, 0x2058, 0xb8ac, 0x2068, 0x9005, 0x0130, 0x9c06, 0x0110,
-	0x680c, 0x0cd0, 0x600c, 0x680e, 0x00be, 0x00de, 0x0005, 0x0026,
-	0x0036, 0x0156, 0x2011, 0x182b, 0x2204, 0x9084, 0x00ff, 0x2019,
-	0x026e, 0x2334, 0x9636, 0x1508, 0x8318, 0x2334, 0x2204, 0x9084,
-	0xff00, 0x9636, 0x11d0, 0x2011, 0x0270, 0x20a9, 0x0004, 0x6010,
-	0x0096, 0x2048, 0x2019, 0x000a, 0x080c, 0xabdf, 0x009e, 0x1168,
-	0x2011, 0x0274, 0x20a9, 0x0004, 0x6010, 0x0096, 0x2048, 0x2019,
-	0x0006, 0x080c, 0xabdf, 0x009e, 0x1100, 0x015e, 0x003e, 0x002e,
-	0x0005, 0x00e6, 0x2071, 0x1800, 0x080c, 0x5c6f, 0x080c, 0x2ddb,
-	0x00ee, 0x0005, 0x00e6, 0x6010, 0x00b6, 0x2058, 0xb800, 0x00be,
-	0xd0fc, 0x0108, 0x0011, 0x00ee, 0x0005, 0xa880, 0xc0e5, 0xa882,
-	0x0005, 0x00e6, 0x00d6, 0x00c6, 0x0076, 0x0066, 0x0056, 0x0046,
-	0x0026, 0x0016, 0x0126, 0x2091, 0x8000, 0x2029, 0x19c4, 0x252c,
-	0x2021, 0x19cb, 0x2424, 0x2061, 0x1ddc, 0x2071, 0x1800, 0x7650,
-	0x7070, 0x9606, 0x0578, 0x6720, 0x9786, 0x0001, 0x0118, 0x9786,
-	0x0008, 0x1500, 0x2500, 0x9c06, 0x01e8, 0x2400, 0x9c06, 0x01d0,
-	0x080c, 0xd2a4, 0x01b8, 0x080c, 0xd2b4, 0x11a0, 0x6000, 0x9086,
-	0x0004, 0x1120, 0x0016, 0x080c, 0x1914, 0x001e, 0x080c, 0xba4b,
-	0x1110, 0x080c, 0x303b, 0x080c, 0xba5c, 0x1110, 0x080c, 0xa58f,
-	0x080c, 0x9c21, 0x9ce0, 0x001c, 0x2001, 0x1819, 0x2004, 0x9c02,
-	0x1208, 0x0858, 0x012e, 0x001e, 0x002e, 0x004e, 0x005e, 0x006e,
-	0x007e, 0x00ce, 0x00de, 0x00ee, 0x0005, 0x2001, 0x1810, 0x2004,
-	0xd0dc, 0x0005, 0x0006, 0x2001, 0x1836, 0x2004, 0xd09c, 0x000e,
-	0x0005, 0x0006, 0x0036, 0x0046, 0x080c, 0xbf61, 0x0168, 0x2019,
-	0xffff, 0x9005, 0x0128, 0x6010, 0x00b6, 0x2058, 0xbba0, 0x00be,
-	0x2021, 0x0004, 0x080c, 0x4a75, 0x004e, 0x003e, 0x000e, 0x6004,
-	0x9086, 0x0001, 0x1128, 0x080c, 0x94f4, 0x080c, 0x9c21, 0x9006,
-	0x0005, 0x00e6, 0x00c6, 0x00b6, 0x0046, 0x2061, 0x1ddc, 0x2071,
-	0x1800, 0x7450, 0x7070, 0x8001, 0x9402, 0x12b8, 0x2100, 0x9c06,
-	0x0148, 0x6000, 0x9086, 0x0000, 0x0128, 0x6010, 0x2058, 0xb8a0,
-	0x9206, 0x0140, 0x9ce0, 0x001c, 0x2001, 0x1819, 0x2004, 0x9c02,
-	0x1220, 0x0c60, 0x9085, 0x0001, 0x0008, 0x9006, 0x004e, 0x00be,
-	0x00ce, 0x00ee, 0x0005, 0x0126, 0x0006, 0x00e6, 0x0016, 0x2091,
-	0x8000, 0x2071, 0x1840, 0xd5a4, 0x0118, 0x7034, 0x8000, 0x7036,
-	0xd5b4, 0x0118, 0x7030, 0x8000, 0x7032, 0xd5ac, 0x0178, 0x2500,
-	0x9084, 0x0007, 0x908e, 0x0003, 0x0148, 0x908e, 0x0004, 0x0130,
-	0x908e, 0x0005, 0x0118, 0x2071, 0x184a, 0x0089, 0x001e, 0x00ee,
-	0x000e, 0x012e, 0x0005, 0x0126, 0x0006, 0x00e6, 0x2091, 0x8000,
-	0x2071, 0x1842, 0x0021, 0x00ee, 0x000e, 0x012e, 0x0005, 0x2e04,
-	0x8000, 0x2072, 0x1220, 0x8e70, 0x2e04, 0x8000, 0x2072, 0x0005,
-	0x00e6, 0x2071, 0x1840, 0x0c99, 0x00ee, 0x0005, 0x00e6, 0x2071,
-	0x1844, 0x0c69, 0x00ee, 0x0005, 0x0126, 0x0006, 0x00e6, 0x2091,
-	0x8000, 0x2071, 0x1840, 0x7044, 0x8000, 0x7046, 0x00ee, 0x000e,
-	0x012e, 0x0005, 0x0001, 0x0002, 0x0004, 0x0008, 0x0010, 0x0020,
-	0x0040, 0x0080, 0x0100, 0x0200, 0x0400, 0x0800, 0x1000, 0x2000,
-	0x4000, 0x8000, 0xfddb
+	0x9084, 0x0007, 0x0006, 0x9086, 0x0003, 0x0110, 0x080c, 0x98bb,
+	0x0086, 0x2c40, 0x0096, 0x904e, 0x080c, 0x9365, 0x009e, 0x008e,
+	0x1558, 0x0076, 0x2c38, 0x080c, 0x9410, 0x007e, 0x1528, 0x6000,
+	0x9086, 0x0000, 0x0508, 0x6020, 0x9086, 0x0007, 0x01e8, 0x0096,
+	0x601c, 0xd084, 0x0140, 0x080c, 0xd4df, 0x080c, 0xbf79, 0x080c,
+	0x1921, 0x6023, 0x0007, 0x6014, 0x2048, 0x080c, 0xb842, 0x0110,
+	0x080c, 0xd22f, 0x009e, 0x9006, 0x6046, 0x6016, 0x080c, 0xd4df,
+	0x6023, 0x0007, 0x080c, 0xbf79, 0x000e, 0x9086, 0x0003, 0x0110,
+	0x080c, 0x98d7, 0x003e, 0x012e, 0x0005, 0x00f6, 0x00c6, 0x00b6,
+	0x0036, 0x0156, 0x2079, 0x0260, 0x7938, 0x783c, 0x080c, 0x243d,
+	0x15e8, 0x0016, 0x00c6, 0x080c, 0x626b, 0x15b0, 0x001e, 0x00c6,
+	0x2160, 0x080c, 0xbf76, 0x00ce, 0x002e, 0x0026, 0x0016, 0x080c,
+	0x98bb, 0x2019, 0x0029, 0x080c, 0x94dd, 0x080c, 0x8624, 0x0076,
+	0x903e, 0x080c, 0x8509, 0x007e, 0x001e, 0x0076, 0x903e, 0x080c,
+	0xcfd9, 0x007e, 0x080c, 0x98d7, 0x0026, 0xba04, 0x9294, 0xff00,
+	0x8217, 0x9286, 0x0006, 0x0118, 0x9286, 0x0004, 0x1118, 0xbaa0,
+	0x080c, 0x30d8, 0x002e, 0xbc84, 0x001e, 0x080c, 0x5cf1, 0xbe12,
+	0xbd16, 0xbc86, 0x9006, 0x0010, 0x00ce, 0x001e, 0x015e, 0x003e,
+	0x00be, 0x00ce, 0x00fe, 0x0005, 0x00c6, 0x00d6, 0x00b6, 0x0016,
+	0x2009, 0x1823, 0x2104, 0x9086, 0x0074, 0x1904, 0xcefd, 0x2069,
+	0x0260, 0x6944, 0x9182, 0x0100, 0x06e0, 0x6940, 0x9184, 0x8000,
+	0x0904, 0xcefa, 0x2001, 0x194c, 0x2004, 0x9005, 0x1140, 0x6010,
+	0x2058, 0xb884, 0x9005, 0x0118, 0x9184, 0x0800, 0x0598, 0x6948,
+	0x918a, 0x0001, 0x0648, 0x080c, 0xd593, 0x0118, 0x6978, 0xd1fc,
+	0x11b8, 0x2009, 0x0205, 0x200b, 0x0001, 0x693c, 0x81ff, 0x1198,
+	0x6944, 0x9182, 0x0100, 0x02a8, 0x6940, 0x81ff, 0x1178, 0x6948,
+	0x918a, 0x0001, 0x0288, 0x6950, 0x918a, 0x0001, 0x0298, 0x00d0,
+	0x6017, 0x0100, 0x00a0, 0x6017, 0x0300, 0x0088, 0x6017, 0x0500,
+	0x0070, 0x6017, 0x0700, 0x0058, 0x6017, 0x0900, 0x0040, 0x6017,
+	0x0b00, 0x0028, 0x6017, 0x0f00, 0x0010, 0x6017, 0x2d00, 0x9085,
+	0x0001, 0x0008, 0x9006, 0x001e, 0x00be, 0x00de, 0x00ce, 0x0005,
+	0x00c6, 0x00b6, 0x0026, 0x0036, 0x0156, 0x6210, 0x2258, 0xbb04,
+	0x9394, 0x00ff, 0x9286, 0x0006, 0x0180, 0x9286, 0x0004, 0x0168,
+	0x9394, 0xff00, 0x8217, 0x9286, 0x0006, 0x0138, 0x9286, 0x0004,
+	0x0120, 0x080c, 0x627a, 0x0804, 0xcf68, 0x2011, 0x0276, 0x20a9,
+	0x0004, 0x0096, 0x2b48, 0x2019, 0x000a, 0x080c, 0xabd3, 0x009e,
+	0x15c0, 0x2011, 0x027a, 0x20a9, 0x0004, 0x0096, 0x2b48, 0x2019,
+	0x0006, 0x080c, 0xabd3, 0x009e, 0x1560, 0x0046, 0x0016, 0xbaa0,
+	0x2220, 0x9006, 0x2009, 0x1854, 0x210c, 0x0038, 0x2009, 0x0029,
+	0x080c, 0xd284, 0xb800, 0xc0e5, 0xb802, 0x080c, 0x98bb, 0x2019,
+	0x0029, 0x080c, 0x8624, 0x0076, 0x2039, 0x0000, 0x080c, 0x8509,
+	0x2c08, 0x080c, 0xcfd9, 0x007e, 0x080c, 0x98d7, 0x2001, 0x0007,
+	0x080c, 0x61e8, 0x2001, 0x0007, 0x080c, 0x61bc, 0x001e, 0x004e,
+	0x9006, 0x015e, 0x003e, 0x002e, 0x00be, 0x00ce, 0x0005, 0x00d6,
+	0x2069, 0x026e, 0x6800, 0x9086, 0x0800, 0x0118, 0x6017, 0x0000,
+	0x0008, 0x9006, 0x00de, 0x0005, 0x00b6, 0x00f6, 0x0016, 0x0026,
+	0x0036, 0x0156, 0x2079, 0x026c, 0x7930, 0x7834, 0x080c, 0x243d,
+	0x11d0, 0x080c, 0x626b, 0x11b8, 0x2011, 0x0270, 0x20a9, 0x0004,
+	0x0096, 0x2b48, 0x2019, 0x000a, 0x080c, 0xabd3, 0x009e, 0x1158,
+	0x2011, 0x0274, 0x20a9, 0x0004, 0x0096, 0x2b48, 0x2019, 0x0006,
+	0x080c, 0xabd3, 0x009e, 0x015e, 0x003e, 0x002e, 0x001e, 0x00fe,
+	0x00be, 0x0005, 0x00b6, 0x0006, 0x0016, 0x0026, 0x0036, 0x0156,
+	0x2011, 0x0263, 0x2204, 0x8211, 0x220c, 0x080c, 0x243d, 0x11d0,
+	0x080c, 0x626b, 0x11b8, 0x2011, 0x0276, 0x20a9, 0x0004, 0x0096,
+	0x2b48, 0x2019, 0x000a, 0x080c, 0xabd3, 0x009e, 0x1158, 0x2011,
+	0x027a, 0x20a9, 0x0004, 0x0096, 0x2b48, 0x2019, 0x0006, 0x080c,
+	0xabd3, 0x009e, 0x015e, 0x003e, 0x002e, 0x001e, 0x000e, 0x00be,
+	0x0005, 0x00e6, 0x00c6, 0x0086, 0x0076, 0x0066, 0x0056, 0x0046,
+	0x0026, 0x0126, 0x2091, 0x8000, 0x080c, 0x9919, 0x0106, 0x190c,
+	0x98bb, 0x2740, 0x2029, 0x19c3, 0x252c, 0x2021, 0x19ca, 0x2424,
+	0x2061, 0x1ddc, 0x2071, 0x1800, 0x7650, 0x7070, 0x81ff, 0x0150,
+	0x0006, 0x9186, 0x1b01, 0x000e, 0x0128, 0x8001, 0x9602, 0x1a04,
+	0xd07a, 0x0018, 0x9606, 0x0904, 0xd07a, 0x2100, 0x9c06, 0x0904,
+	0xd071, 0x080c, 0xd2c5, 0x1904, 0xd071, 0x080c, 0xd5b0, 0x0904,
+	0xd071, 0x080c, 0xd2b5, 0x0904, 0xd071, 0x6720, 0x9786, 0x0001,
+	0x1148, 0x080c, 0x3175, 0x0904, 0xd099, 0x6004, 0x9086, 0x0000,
+	0x1904, 0xd099, 0x9786, 0x0004, 0x0904, 0xd099, 0x9786, 0x0007,
+	0x0904, 0xd071, 0x2500, 0x9c06, 0x0904, 0xd071, 0x2400, 0x9c06,
+	0x0904, 0xd071, 0x88ff, 0x0118, 0x605c, 0x9906, 0x15d0, 0x0096,
+	0x6043, 0xffff, 0x6000, 0x9086, 0x0004, 0x1120, 0x0016, 0x080c,
+	0x1921, 0x001e, 0x9786, 0x000a, 0x0148, 0x080c, 0xba57, 0x1130,
+	0x080c, 0xa581, 0x009e, 0x080c, 0x9c14, 0x0418, 0x6014, 0x2048,
+	0x080c, 0xb842, 0x01d8, 0x9786, 0x0003, 0x1588, 0xa867, 0x0103,
+	0xa87c, 0xd0cc, 0x0130, 0x0096, 0xa878, 0x2048, 0x080c, 0x0fd4,
+	0x009e, 0xab7a, 0xa877, 0x0000, 0x080c, 0xd52b, 0x0016, 0x080c,
+	0xbb45, 0x080c, 0x6985, 0x001e, 0x080c, 0xba31, 0x009e, 0x080c,
+	0x9c14, 0x9ce0, 0x001c, 0x2001, 0x1819, 0x2004, 0x9c02, 0x1210,
+	0x0804, 0xcff2, 0x010e, 0x190c, 0x98d7, 0x012e, 0x002e, 0x004e,
+	0x005e, 0x006e, 0x007e, 0x008e, 0x00ce, 0x00ee, 0x0005, 0x9786,
+	0x0006, 0x1150, 0x9386, 0x0005, 0x0128, 0x080c, 0xd52b, 0x080c,
+	0xd22f, 0x08e0, 0x009e, 0x08e8, 0x9786, 0x000a, 0x0908, 0x0804,
+	0xd056, 0x81ff, 0x09b0, 0x9180, 0x0001, 0x2004, 0x9086, 0x0018,
+	0x0130, 0x9180, 0x0001, 0x2004, 0x9086, 0x002d, 0x1950, 0x6000,
+	0x9086, 0x0002, 0x1930, 0x080c, 0xba46, 0x0130, 0x080c, 0xba57,
+	0x1900, 0x080c, 0xa581, 0x0038, 0x080c, 0x303d, 0x080c, 0xba57,
+	0x1110, 0x080c, 0xa581, 0x080c, 0x9c14, 0x0804, 0xd071, 0xa864,
+	0x9084, 0x00ff, 0x9086, 0x0039, 0x0005, 0x00c6, 0x00e6, 0x0016,
+	0x2c08, 0x2170, 0x9006, 0x080c, 0xd256, 0x001e, 0x0120, 0x6020,
+	0x9084, 0x000f, 0x001b, 0x00ee, 0x00ce, 0x0005, 0xd0e4, 0xd0e4,
+	0xd0e4, 0xd0e4, 0xd0e4, 0xd0e4, 0xd0e6, 0xd0e4, 0xd0e4, 0xd0e4,
+	0xd0e4, 0x9c14, 0x9c14, 0xd0e4, 0x9006, 0x0005, 0x0036, 0x0046,
+	0x0016, 0x7010, 0x00b6, 0x2058, 0xbca0, 0x00be, 0x2c00, 0x2009,
+	0x0020, 0x080c, 0xd284, 0x001e, 0x004e, 0x2019, 0x0002, 0x080c,
+	0xce09, 0x003e, 0x9085, 0x0001, 0x0005, 0x0096, 0x080c, 0xb842,
+	0x0140, 0x6014, 0x904d, 0x080c, 0xb440, 0x687b, 0x0005, 0x080c,
+	0x6991, 0x009e, 0x080c, 0x9c14, 0x9085, 0x0001, 0x0005, 0x2001,
+	0x0001, 0x080c, 0x61a8, 0x0156, 0x0016, 0x0026, 0x0036, 0x20a9,
+	0x0004, 0x2019, 0x1805, 0x2011, 0x0276, 0x080c, 0xabbf, 0x003e,
+	0x002e, 0x001e, 0x015e, 0x9005, 0x0005, 0x00f6, 0x00e6, 0x00c6,
+	0x0086, 0x0076, 0x0066, 0x00b6, 0x0126, 0x2091, 0x8000, 0x2740,
+	0x2061, 0x1ddc, 0x2079, 0x0001, 0x8fff, 0x0904, 0xd17f, 0x2071,
+	0x1800, 0x7650, 0x7070, 0x8001, 0x9602, 0x1a04, 0xd17f, 0x88ff,
+	0x0120, 0x2800, 0x9c06, 0x1590, 0x2078, 0x080c, 0xd2b5, 0x0570,
+	0x2400, 0x9c06, 0x0558, 0x6720, 0x9786, 0x0006, 0x1538, 0x9786,
+	0x0007, 0x0520, 0x88ff, 0x1140, 0x6010, 0x9b06, 0x11f8, 0x85ff,
+	0x0118, 0x605c, 0x9106, 0x11d0, 0x0096, 0x601c, 0xd084, 0x0140,
+	0x080c, 0xd4df, 0x080c, 0xbf79, 0x080c, 0x1921, 0x6023, 0x0007,
+	0x6014, 0x2048, 0x080c, 0xb842, 0x0120, 0x0046, 0x080c, 0xd22f,
+	0x004e, 0x009e, 0x080c, 0x9c14, 0x88ff, 0x1198, 0x9ce0, 0x001c,
+	0x2001, 0x1819, 0x2004, 0x9c02, 0x1210, 0x0804, 0xd134, 0x9006,
+	0x012e, 0x00be, 0x006e, 0x007e, 0x008e, 0x00ce, 0x00ee, 0x00fe,
+	0x0005, 0x98c5, 0x0001, 0x0ca0, 0x080c, 0x98bb, 0x00b6, 0x0076,
+	0x0056, 0x0086, 0x9046, 0x2029, 0x0001, 0x2c20, 0x2019, 0x0002,
+	0x6210, 0x2258, 0x0096, 0x904e, 0x080c, 0x9365, 0x009e, 0x008e,
+	0x903e, 0x080c, 0x9410, 0x080c, 0xd125, 0x005e, 0x007e, 0x00be,
+	0x080c, 0x98d7, 0x0005, 0x080c, 0x98bb, 0x00b6, 0x0046, 0x0056,
+	0x0076, 0x00c6, 0x0156, 0x2c20, 0x2128, 0x20a9, 0x007f, 0x900e,
+	0x0016, 0x0036, 0x080c, 0x626b, 0x1190, 0x0056, 0x0086, 0x9046,
+	0x2508, 0x2029, 0x0001, 0x0096, 0x904e, 0x080c, 0x9365, 0x009e,
+	0x008e, 0x903e, 0x080c, 0x9410, 0x080c, 0xd125, 0x005e, 0x003e,
+	0x001e, 0x8108, 0x1f04, 0xd1b8, 0x015e, 0x00ce, 0x007e, 0x005e,
+	0x004e, 0x00be, 0x080c, 0x98d7, 0x0005, 0x080c, 0x98bb, 0x00b6,
+	0x0076, 0x0056, 0x6210, 0x2258, 0x0086, 0x9046, 0x2029, 0x0001,
+	0x2019, 0x0048, 0x0096, 0x904e, 0x080c, 0x9365, 0x009e, 0x008e,
+	0x903e, 0x080c, 0x9410, 0x2c20, 0x080c, 0xd125, 0x005e, 0x007e,
+	0x00be, 0x080c, 0x98d7, 0x0005, 0x080c, 0x98bb, 0x00b6, 0x0046,
+	0x0056, 0x0076, 0x00c6, 0x0156, 0x2c20, 0x20a9, 0x0800, 0x900e,
+	0x0016, 0x0036, 0x080c, 0x626b, 0x11a0, 0x0086, 0x9046, 0x2828,
+	0x0046, 0x2021, 0x0001, 0x080c, 0xd4c3, 0x004e, 0x0096, 0x904e,
+	0x080c, 0x9365, 0x009e, 0x008e, 0x903e, 0x080c, 0x9410, 0x080c,
+	0xd125, 0x003e, 0x001e, 0x8108, 0x1f04, 0xd208, 0x015e, 0x00ce,
+	0x007e, 0x005e, 0x004e, 0x00be, 0x080c, 0x98d7, 0x0005, 0x0016,
+	0x00f6, 0x080c, 0xb840, 0x0198, 0xa864, 0x9084, 0x00ff, 0x9086,
+	0x0046, 0x0180, 0xa800, 0x907d, 0x0138, 0xa803, 0x0000, 0xab82,
+	0x080c, 0x6991, 0x2f48, 0x0cb0, 0xab82, 0x080c, 0x6991, 0x00fe,
+	0x001e, 0x0005, 0xa800, 0x907d, 0x0130, 0xa803, 0x0000, 0x080c,
+	0x6991, 0x2f48, 0x0cb8, 0x080c, 0x6991, 0x0c88, 0x00e6, 0x0046,
+	0x0036, 0x2061, 0x1ddc, 0x9005, 0x1138, 0x2071, 0x1800, 0x7450,
+	0x7070, 0x8001, 0x9402, 0x12d8, 0x2100, 0x9c06, 0x0168, 0x6000,
+	0x9086, 0x0000, 0x0148, 0x6008, 0x9206, 0x1130, 0x6010, 0x91a0,
+	0x0004, 0x2424, 0x9406, 0x0140, 0x9ce0, 0x001c, 0x2001, 0x1819,
+	0x2004, 0x9c02, 0x1220, 0x0c40, 0x9085, 0x0001, 0x0008, 0x9006,
+	0x003e, 0x004e, 0x00ee, 0x0005, 0x0096, 0x0006, 0x080c, 0x1022,
+	0x000e, 0x090c, 0x0d65, 0xaae2, 0xa867, 0x010d, 0xa88e, 0x0026,
+	0x2010, 0x080c, 0xb830, 0x2001, 0x0000, 0x0120, 0x2200, 0x9080,
+	0x0017, 0x2004, 0x002e, 0xa87a, 0x9186, 0x0020, 0x0110, 0xa8e3,
+	0xffff, 0xa986, 0xac76, 0xa87f, 0x0000, 0x2001, 0x195e, 0x2004,
+	0xa882, 0x9006, 0xa802, 0xa86a, 0xa88a, 0x0126, 0x2091, 0x8000,
+	0x080c, 0x6991, 0x012e, 0x009e, 0x0005, 0x6700, 0x9786, 0x0000,
+	0x0158, 0x9786, 0x0001, 0x0140, 0x9786, 0x000a, 0x0128, 0x9786,
+	0x0009, 0x0110, 0x9085, 0x0001, 0x0005, 0x00e6, 0x6010, 0x9075,
+	0x0138, 0x00b6, 0x2058, 0xb8a0, 0x00be, 0x9206, 0x00ee, 0x0005,
+	0x9085, 0x0001, 0x0cd8, 0x0016, 0x6004, 0x908e, 0x001e, 0x11a0,
+	0x8007, 0x6134, 0x918c, 0x00ff, 0x9105, 0x6036, 0x6007, 0x0085,
+	0x6003, 0x000b, 0x6023, 0x0005, 0x2001, 0x1957, 0x2004, 0x601a,
+	0x2009, 0x8020, 0x080c, 0x84b3, 0x001e, 0x0005, 0xa001, 0xa001,
+	0x0005, 0x6024, 0xd0e4, 0x0158, 0xd0cc, 0x0118, 0x080c, 0xbb8c,
+	0x0030, 0x080c, 0xd4df, 0x080c, 0x83a2, 0x080c, 0x9bda, 0x0005,
+	0x9280, 0x0008, 0x2004, 0x9084, 0x000f, 0x0002, 0xd314, 0xd314,
+	0xd314, 0xd316, 0xd314, 0xd316, 0xd316, 0xd314, 0xd316, 0xd314,
+	0xd314, 0xd314, 0xd314, 0xd314, 0x9006, 0x0005, 0x9085, 0x0001,
+	0x0005, 0x9280, 0x0008, 0x2004, 0x9084, 0x000f, 0x0002, 0xd32d,
+	0xd32d, 0xd32d, 0xd32d, 0xd32d, 0xd32d, 0xd33a, 0xd32d, 0xd32d,
+	0xd32d, 0xd32d, 0xd32d, 0xd32d, 0xd32d, 0x6007, 0x003b, 0x602f,
+	0x0009, 0x6017, 0x2a00, 0x6003, 0x0001, 0x2009, 0x8020, 0x080c,
+	0x84b3, 0x0005, 0x0096, 0x00c6, 0x2260, 0x080c, 0xd4df, 0x604b,
+	0x0000, 0x6024, 0xc0f4, 0xc0e4, 0x6026, 0x603b, 0x0000, 0x00ce,
+	0x00d6, 0x2268, 0x9186, 0x0007, 0x1904, 0xd393, 0x6814, 0x9005,
+	0x0138, 0x2048, 0xa87c, 0xd0fc, 0x1118, 0x00de, 0x009e, 0x08a8,
+	0x6007, 0x003a, 0x6003, 0x0001, 0x2009, 0x8020, 0x080c, 0x84b3,
+	0x00c6, 0x2d60, 0x6100, 0x9186, 0x0002, 0x1904, 0xd40a, 0x6014,
+	0x9005, 0x1138, 0x6000, 0x9086, 0x0007, 0x190c, 0x0d65, 0x0804,
+	0xd40a, 0x2048, 0x080c, 0xb842, 0x1130, 0x0028, 0x2048, 0xa800,
+	0x9005, 0x1de0, 0x2900, 0x2048, 0xa87c, 0x9084, 0x0003, 0x9086,
+	0x0002, 0x1168, 0xa87c, 0xc0dc, 0xc0f4, 0xa87e, 0xa880, 0xc0fc,
+	0xa882, 0x2009, 0x0043, 0x080c, 0xcc4b, 0x0804, 0xd40a, 0x2009,
+	0x0041, 0x0804, 0xd404, 0x9186, 0x0005, 0x15a0, 0x6814, 0x2048,
+	0xa87c, 0xd0bc, 0x1120, 0x00de, 0x009e, 0x0804, 0xd32d, 0xd0b4,
+	0x0128, 0xd0fc, 0x090c, 0x0d65, 0x0804, 0xd34e, 0x6007, 0x003a,
+	0x6003, 0x0001, 0x2009, 0x8020, 0x080c, 0x84b3, 0x00c6, 0x2d60,
+	0x6100, 0x9186, 0x0002, 0x0120, 0x9186, 0x0004, 0x1904, 0xd40a,
+	0x6814, 0x2048, 0xa97c, 0xc1f4, 0xc1dc, 0xa97e, 0xa980, 0xc1fc,
+	0xc1bc, 0xa982, 0x00f6, 0x2c78, 0x080c, 0x165c, 0x00fe, 0x2009,
+	0x0042, 0x04d0, 0x0036, 0x080c, 0x1022, 0x090c, 0x0d65, 0xa867,
+	0x010d, 0x9006, 0xa802, 0xa86a, 0xa88a, 0x2d18, 0xab8e, 0xa887,
+	0x0045, 0x2c00, 0xa892, 0x6038, 0xa8a2, 0x2360, 0x6024, 0xc0dd,
+	0x6026, 0x6010, 0x00b6, 0x2058, 0xb8a0, 0x00be, 0x2004, 0x635c,
+	0xab7a, 0xa876, 0x9006, 0xa87e, 0xa882, 0xad9a, 0xae96, 0xa89f,
+	0x0001, 0x080c, 0x6991, 0x2019, 0x0045, 0x6008, 0x2068, 0x080c,
+	0xce09, 0x2d00, 0x600a, 0x6023, 0x0006, 0x6003, 0x0007, 0x901e,
+	0x631a, 0x634a, 0x003e, 0x0038, 0x604b, 0x0000, 0x6003, 0x0007,
+	0x080c, 0xcc4b, 0x00ce, 0x00de, 0x009e, 0x0005, 0x9186, 0x0013,
+	0x1128, 0x6004, 0x9082, 0x0085, 0x2008, 0x00c2, 0x9186, 0x0027,
+	0x1178, 0x080c, 0x885d, 0x0036, 0x0096, 0x6014, 0x2048, 0x2019,
+	0x0004, 0x080c, 0xd22f, 0x009e, 0x003e, 0x080c, 0x891b, 0x0005,
+	0x9186, 0x0014, 0x0d70, 0x080c, 0x9c93, 0x0005, 0xd43d, 0xd43b,
+	0xd43b, 0xd43b, 0xd43b, 0xd43b, 0xd43d, 0xd43b, 0xd43b, 0xd43b,
+	0xd43b, 0xd43b, 0xd43b, 0x080c, 0x0d65, 0x6003, 0x000c, 0x080c,
+	0x891b, 0x0005, 0x9182, 0x0092, 0x1220, 0x9182, 0x0085, 0x0208,
+	0x001a, 0x080c, 0x9c93, 0x0005, 0xd459, 0xd459, 0xd459, 0xd459,
+	0xd45b, 0xd47b, 0xd459, 0xd459, 0xd459, 0xd459, 0xd459, 0xd459,
+	0xd459, 0x080c, 0x0d65, 0x00d6, 0x2c68, 0x080c, 0x9b84, 0x01b0,
+	0x6003, 0x0001, 0x6007, 0x001e, 0x2009, 0x026e, 0x210c, 0x613a,
+	0x2009, 0x026f, 0x210c, 0x613e, 0x600b, 0xffff, 0x6910, 0x6112,
+	0x6023, 0x0004, 0x2009, 0x8020, 0x080c, 0x84b3, 0x2d60, 0x080c,
+	0x9bda, 0x00de, 0x0005, 0x080c, 0x9bda, 0x0005, 0x00e6, 0x6010,
+	0x00b6, 0x2058, 0xb800, 0x00be, 0xd0ec, 0x00ee, 0x0005, 0x2009,
+	0x1873, 0x210c, 0xd1ec, 0x05b0, 0x6003, 0x0002, 0x6024, 0xc0e5,
+	0x6026, 0xd0cc, 0x0150, 0x2001, 0x1958, 0x2004, 0x604a, 0x2009,
+	0x1873, 0x210c, 0xd1f4, 0x1520, 0x00a0, 0x2009, 0x1873, 0x210c,
+	0xd1f4, 0x0128, 0x6024, 0xc0e4, 0x6026, 0x9006, 0x00d8, 0x2001,
+	0x1958, 0x200c, 0x2001, 0x1956, 0x2004, 0x9100, 0x9080, 0x000a,
+	0x604a, 0x6010, 0x00b6, 0x2058, 0xb8ac, 0x00be, 0x0008, 0x2104,
+	0x9005, 0x0118, 0x9088, 0x0003, 0x0cd0, 0x2c0a, 0x600f, 0x0000,
+	0x9085, 0x0001, 0x0005, 0x0016, 0x00c6, 0x00e6, 0x615c, 0xb8ac,
+	0x2060, 0x8cff, 0x0180, 0x84ff, 0x1118, 0x605c, 0x9106, 0x1138,
+	0x600c, 0x2072, 0x080c, 0x83a2, 0x080c, 0x9bda, 0x0010, 0x9cf0,
+	0x0003, 0x2e64, 0x0c70, 0x00ee, 0x00ce, 0x001e, 0x0005, 0x00d6,
+	0x00b6, 0x6010, 0x2058, 0xb8ac, 0x2068, 0x9005, 0x0130, 0x9c06,
+	0x0110, 0x680c, 0x0cd0, 0x600c, 0x680e, 0x00be, 0x00de, 0x0005,
+	0x0026, 0x0036, 0x0156, 0x2011, 0x182b, 0x2204, 0x9084, 0x00ff,
+	0x2019, 0x026e, 0x2334, 0x9636, 0x1508, 0x8318, 0x2334, 0x2204,
+	0x9084, 0xff00, 0x9636, 0x11d0, 0x2011, 0x0270, 0x20a9, 0x0004,
+	0x6010, 0x0096, 0x2048, 0x2019, 0x000a, 0x080c, 0xabd3, 0x009e,
+	0x1168, 0x2011, 0x0274, 0x20a9, 0x0004, 0x6010, 0x0096, 0x2048,
+	0x2019, 0x0006, 0x080c, 0xabd3, 0x009e, 0x1100, 0x015e, 0x003e,
+	0x002e, 0x0005, 0x00e6, 0x2071, 0x1800, 0x080c, 0x5c6a, 0x080c,
+	0x2de9, 0x00ee, 0x0005, 0x00e6, 0x6010, 0x00b6, 0x2058, 0xb800,
+	0x00be, 0xd0fc, 0x0108, 0x0011, 0x00ee, 0x0005, 0xa880, 0xc0e5,
+	0xa882, 0x0005, 0x00e6, 0x00d6, 0x00c6, 0x0076, 0x0066, 0x0056,
+	0x0046, 0x0026, 0x0016, 0x0126, 0x2091, 0x8000, 0x2029, 0x19c3,
+	0x252c, 0x2021, 0x19ca, 0x2424, 0x2061, 0x1ddc, 0x2071, 0x1800,
+	0x7650, 0x7070, 0x9606, 0x0578, 0x6720, 0x9786, 0x0001, 0x0118,
+	0x9786, 0x0008, 0x1500, 0x2500, 0x9c06, 0x01e8, 0x2400, 0x9c06,
+	0x01d0, 0x080c, 0xd2b5, 0x01b8, 0x080c, 0xd2c5, 0x11a0, 0x6000,
+	0x9086, 0x0004, 0x1120, 0x0016, 0x080c, 0x1921, 0x001e, 0x080c,
+	0xba46, 0x1110, 0x080c, 0x303d, 0x080c, 0xba57, 0x1110, 0x080c,
+	0xa581, 0x080c, 0x9c14, 0x9ce0, 0x001c, 0x2001, 0x1819, 0x2004,
+	0x9c02, 0x1208, 0x0858, 0x012e, 0x001e, 0x002e, 0x004e, 0x005e,
+	0x006e, 0x007e, 0x00ce, 0x00de, 0x00ee, 0x0005, 0x2001, 0x1810,
+	0x2004, 0xd0dc, 0x0005, 0x0006, 0x2001, 0x1836, 0x2004, 0xd09c,
+	0x000e, 0x0005, 0x0006, 0x0036, 0x0046, 0x080c, 0xbf61, 0x0168,
+	0x2019, 0xffff, 0x9005, 0x0128, 0x6010, 0x00b6, 0x2058, 0xbba0,
+	0x00be, 0x2021, 0x0004, 0x080c, 0x4a77, 0x004e, 0x003e, 0x000e,
+	0x6004, 0x9086, 0x0001, 0x1128, 0x080c, 0x94dd, 0x080c, 0x9c14,
+	0x9006, 0x0005, 0x00e6, 0x00c6, 0x00b6, 0x0046, 0x2061, 0x1ddc,
+	0x2071, 0x1800, 0x7450, 0x7070, 0x8001, 0x9402, 0x12b8, 0x2100,
+	0x9c06, 0x0148, 0x6000, 0x9086, 0x0000, 0x0128, 0x6010, 0x2058,
+	0xb8a0, 0x9206, 0x0140, 0x9ce0, 0x001c, 0x2001, 0x1819, 0x2004,
+	0x9c02, 0x1220, 0x0c60, 0x9085, 0x0001, 0x0008, 0x9006, 0x004e,
+	0x00be, 0x00ce, 0x00ee, 0x0005, 0x0126, 0x0006, 0x00e6, 0x0016,
+	0x2091, 0x8000, 0x2071, 0x1840, 0xd5a4, 0x0118, 0x7034, 0x8000,
+	0x7036, 0xd5b4, 0x0118, 0x7030, 0x8000, 0x7032, 0xd5ac, 0x0178,
+	0x2500, 0x9084, 0x0007, 0x908e, 0x0003, 0x0148, 0x908e, 0x0004,
+	0x0130, 0x908e, 0x0005, 0x0118, 0x2071, 0x184a, 0x0089, 0x001e,
+	0x00ee, 0x000e, 0x012e, 0x0005, 0x0126, 0x0006, 0x00e6, 0x2091,
+	0x8000, 0x2071, 0x1842, 0x0021, 0x00ee, 0x000e, 0x012e, 0x0005,
+	0x2e04, 0x8000, 0x2072, 0x1220, 0x8e70, 0x2e04, 0x8000, 0x2072,
+	0x0005, 0x00e6, 0x2071, 0x1840, 0x0c99, 0x00ee, 0x0005, 0x00e6,
+	0x2071, 0x1844, 0x0c69, 0x00ee, 0x0005, 0x0126, 0x0006, 0x00e6,
+	0x2091, 0x8000, 0x2071, 0x1840, 0x7044, 0x8000, 0x7046, 0x00ee,
+	0x000e, 0x012e, 0x0005, 0x0001, 0x0002, 0x0004, 0x0008, 0x0010,
+	0x0020, 0x0040, 0x0080, 0x0100, 0x0200, 0x0400, 0x0800, 0x1000,
+	0x2000, 0x4000, 0x8000, 0x9407
 };
 #ifdef UNIQUE_FW_NAME
-unsigned short fw2322flx_length01 = 0xce3b;
+unsigned short fw2322flx_length01 = 0xce4c;
 #else
-unsigned short risc_code_length01 = 0xce3b;
+unsigned short risc_code_length01 = 0xce4c;
 #endif
 
 /*
@@ -6663,28 +6665,28 @@ unsigned short risc_code_length01 = 0xce3b;
 
 unsigned long rseqflx_code_addr01 = 0x0001c000 ;
 unsigned short rseqflx_code01[] = { 
-0x000b, 0x0003, 0x0000, 0x071c, 0x0001, 0xc000, 0x0008, 0x8064,
+0x000b, 0x0003, 0x0000, 0x072a, 0x0001, 0xc000, 0x0008, 0x8064,
 	0x0000, 0x0010, 0x0000, 0x8066, 0x0008, 0x0101, 0x0003, 0xc007,
 	0x0008, 0x80e0, 0x0008, 0xff00, 0x0000, 0x80e2, 0x0008, 0xff00,
 	0x0008, 0x0162, 0x0000, 0x8066, 0x0008, 0xa101, 0x000b, 0xc00f,
 	0x0008, 0x0d02, 0x0000, 0x8060, 0x0000, 0x0400, 0x000b, 0x60af,
-	0x0003, 0x5817, 0x0003, 0x7ac6, 0x0003, 0x5209, 0x000b, 0xc813,
+	0x0003, 0x5817, 0x0003, 0x7ac9, 0x0003, 0x5209, 0x000b, 0xc813,
 	0x0009, 0xbac0, 0x0000, 0x008a, 0x0003, 0x8813, 0x0000, 0x15fc,
 	0x000b, 0xb013, 0x0009, 0xc4c0, 0x0000, 0x7000, 0x0001, 0xffa0,
-	0x0000, 0x2000, 0x000b, 0x9366, 0x0008, 0x808c, 0x0000, 0x0001,
+	0x0000, 0x2000, 0x0003, 0x936d, 0x0008, 0x808c, 0x0000, 0x0001,
 	0x0007, 0x0000, 0x0007, 0x0000, 0x000a, 0x4047, 0x0008, 0x808c,
 	0x0000, 0x0002, 0x0007, 0x0000, 0x0003, 0x082d, 0x0000, 0x4022,
-	0x000b, 0x002e, 0x0008, 0x4122, 0x0002, 0x4447, 0x0003, 0x8b8a,
-	0x0008, 0x0bfe, 0x0001, 0x11a0, 0x0003, 0x136c, 0x0001, 0x0ca0,
-	0x0003, 0x136c, 0x0001, 0x9180, 0x0000, 0x0004, 0x0000, 0x8060,
+	0x000b, 0x002e, 0x0008, 0x4122, 0x0002, 0x4447, 0x0003, 0x8b91,
+	0x0008, 0x0bfe, 0x0001, 0x11a0, 0x000b, 0x1373, 0x0001, 0x0ca0,
+	0x000b, 0x1373, 0x0001, 0x9180, 0x0000, 0x0004, 0x0000, 0x8060,
 	0x0000, 0x0400, 0x0008, 0x7f62, 0x0000, 0x8066, 0x0008, 0x0009,
 	0x000b, 0xc03c, 0x0008, 0x808c, 0x0008, 0x0000, 0x0008, 0x0060,
 	0x0008, 0x8062, 0x0000, 0x0004, 0x0000, 0x8066, 0x0000, 0x0411,
-	0x000b, 0xc044, 0x0000, 0x03fe, 0x0001, 0x43e0, 0x000b, 0x8b69,
-	0x0009, 0xc2c0, 0x0008, 0x00ff, 0x0001, 0x02e0, 0x000b, 0x8b69,
+	0x000b, 0xc044, 0x0000, 0x03fe, 0x0001, 0x43e0, 0x0003, 0x8b70,
+	0x0009, 0xc2c0, 0x0008, 0x00ff, 0x0001, 0x02e0, 0x0003, 0x8b70,
 	0x0001, 0x9180, 0x0008, 0x0005, 0x0000, 0x8060, 0x0000, 0x0400,
 	0x0008, 0x7f62, 0x0000, 0x8066, 0x0000, 0x0019, 0x000b, 0xc053,
-	0x0002, 0x0240, 0x0003, 0x0b66, 0x0008, 0x00fc, 0x000b, 0x3369,
+	0x0002, 0x0240, 0x000b, 0x0b6d, 0x0008, 0x00fc, 0x0003, 0x3370,
 	0x000a, 0x0244, 0x0003, 0x0865, 0x000c, 0x01e2, 0x0001, 0x9180,
 	0x0000, 0x0007, 0x0008, 0x7f62, 0x0000, 0x8060, 0x0000, 0x0400,
 	0x0002, 0x0234, 0x0008, 0x7f04, 0x0000, 0x8066, 0x0000, 0x040a,
@@ -6692,7 +6694,7 @@ unsigned short rseqflx_code01[] = {
 	0x0002, 0x3a44, 0x0003, 0x8813, 0x0008, 0x808c, 0x0000, 0x0002,
 	0x0008, 0x1760, 0x0008, 0x8062, 0x0008, 0x000f, 0x0000, 0x8066,
 	0x0008, 0x0011, 0x000b, 0xc071, 0x0008, 0x01fe, 0x0009, 0x42e0,
-	0x0003, 0x8b5b, 0x0000, 0x00fe, 0x0001, 0x43e0, 0x0003, 0x8b5b,
+	0x0003, 0x8b62, 0x0000, 0x00fe, 0x0001, 0x43e0, 0x0003, 0x8b62,
 	0x0000, 0x1734, 0x0000, 0x1530, 0x0008, 0x1632, 0x0008, 0x0d2a,
 	0x0001, 0x9880, 0x0008, 0x0012, 0x0000, 0x8060, 0x0000, 0x0400,
 	0x0008, 0x7f62, 0x0000, 0x8066, 0x0008, 0x1e0a, 0x0003, 0xc083,
@@ -6720,9 +6722,9 @@ unsigned short rseqflx_code01[] = {
 	0x000b, 0x8907, 0x000a, 0x0040, 0x000b, 0x08f1, 0x0002, 0x004e,
 	0x000b, 0x08f1, 0x0002, 0x0030, 0x0002, 0x7f2f, 0x0000, 0x7f00,
 	0x0000, 0x8066, 0x0008, 0x000a, 0x000b, 0xc0e2, 0x0008, 0x1010,
-	0x000c, 0x01c9, 0x000b, 0xb0ea, 0x000c, 0x032f, 0x0004, 0x01b3,
+	0x000c, 0x01c9, 0x000b, 0xb0ea, 0x0004, 0x0336, 0x0004, 0x01b3,
 	0x000b, 0x7814, 0x0003, 0x0013, 0x0000, 0x0806, 0x0008, 0x8010,
-	0x0000, 0x001f, 0x000c, 0x032f, 0x0000, 0x0310, 0x000c, 0x032f,
+	0x0000, 0x001f, 0x0004, 0x0336, 0x0000, 0x0310, 0x0004, 0x0336,
 	0x000b, 0x00e8, 0x000a, 0x002f, 0x0000, 0x7f00, 0x0000, 0x8066,
 	0x0008, 0x000a, 0x000b, 0xc0f5, 0x0004, 0x018c, 0x000a, 0x0040,
 	0x000b, 0x090a, 0x000c, 0x01f9, 0x0000, 0x8000, 0x0000, 0x0002,
@@ -6730,7 +6732,7 @@ unsigned short rseqflx_code01[] = {
 	0x0008, 0x7f62, 0x0000, 0x8066, 0x0008, 0x000a, 0x0003, 0xc103,
 	0x0000, 0x8072, 0x0000, 0x4000, 0x000b, 0x00e8, 0x0008, 0x8010,
 	0x0008, 0x001e, 0x0003, 0x010c, 0x0008, 0x8010, 0x0008, 0x001d,
-	0x000c, 0x032f, 0x0008, 0x1010, 0x000c, 0x032f, 0x000b, 0x0014,
+	0x0004, 0x0336, 0x0008, 0x1010, 0x0004, 0x0336, 0x000b, 0x0014,
 	0x0002, 0x4b4e, 0x0003, 0x0916, 0x0008, 0x808a, 0x0000, 0x0004,
 	0x000b, 0x6116, 0x000f, 0x8000, 0x0008, 0x808a, 0x0000, 0x0004,
 	0x000b, 0x0014, 0x0000, 0x8060, 0x0000, 0x0400, 0x0009, 0x9080,
@@ -6759,9 +6761,9 @@ unsigned short rseqflx_code01[] = {
 	0x0003, 0xc174, 0x0008, 0x5006, 0x0008, 0x100e, 0x000c, 0x01a0,
 	0x000b, 0x7814, 0x0003, 0x0013, 0x0008, 0x0208, 0x0008, 0x030a,
 	0x000b, 0x0161, 0x0004, 0x018c, 0x0008, 0x808a, 0x0000, 0x0004,
-	0x0008, 0x8010, 0x0008, 0x0021, 0x000c, 0x032f, 0x0008, 0x1010,
-	0x000c, 0x032f, 0x0000, 0x4810, 0x000c, 0x032f, 0x0008, 0x4910,
-	0x000c, 0x032f, 0x0008, 0x808a, 0x0000, 0x0004, 0x000b, 0x0014,
+	0x0008, 0x8010, 0x0008, 0x0021, 0x0004, 0x0336, 0x0008, 0x1010,
+	0x0004, 0x0336, 0x0000, 0x4810, 0x0004, 0x0336, 0x0008, 0x4910,
+	0x0004, 0x0336, 0x0008, 0x808a, 0x0000, 0x0004, 0x000b, 0x0014,
 	0x0000, 0x8060, 0x0000, 0x0400, 0x0009, 0x9080, 0x0000, 0x0002,
 	0x0008, 0x7f62, 0x0000, 0x8066, 0x0008, 0xb40a, 0x0003, 0xc193,
 	0x000f, 0x4000, 0x0000, 0x8060, 0x0000, 0x0400, 0x0000, 0x0a62,
@@ -6793,113 +6795,115 @@ unsigned short rseqflx_code01[] = {
 	0x0008, 0x4040, 0x0007, 0x0000, 0x000a, 0x3945, 0x000b, 0x8a01,
 	0x000f, 0x4000, 0x0000, 0x8072, 0x0000, 0x4000, 0x0007, 0x0000,
 	0x0007, 0x0000, 0x0007, 0x0000, 0x000a, 0x3945, 0x0003, 0x09fb,
-	0x0003, 0x0203, 0x000a, 0x3a40, 0x000b, 0x8817, 0x0008, 0x2b24,
-	0x0008, 0x2b24, 0x0003, 0x5a0d, 0x0008, 0x8054, 0x0000, 0x0002,
-	0x0002, 0x1242, 0x0003, 0x0a51, 0x000a, 0x3a45, 0x000b, 0x0a42,
-	0x000a, 0x1e10, 0x0000, 0x7f3c, 0x000b, 0x0a3f, 0x0002, 0x1d00,
-	0x0000, 0x7f3a, 0x0000, 0x0d60, 0x0008, 0x7f62, 0x0000, 0x8066,
-	0x0008, 0x0009, 0x0003, 0xc21d, 0x0008, 0x00fc, 0x000b, 0xb23c,
-	0x0000, 0x1c60, 0x0008, 0x8062, 0x0000, 0x0001, 0x0000, 0x8066,
-	0x0008, 0x0009, 0x000b, 0xc225, 0x0008, 0x00fc, 0x000b, 0x3344,
-	0x0000, 0x0038, 0x0008, 0x0060, 0x0008, 0x8062, 0x0000, 0x0019,
-	0x0000, 0x8066, 0x0008, 0x0009, 0x0003, 0xc22e, 0x0009, 0x80c0,
-	0x0008, 0x00ff, 0x0008, 0x7f3e, 0x0000, 0x0d60, 0x0008, 0x0efe,
-	0x0001, 0x1f80, 0x0008, 0x7f62, 0x0000, 0x8066, 0x0008, 0x0009,
-	0x000b, 0xc238, 0x0008, 0x003a, 0x0000, 0x1dfe, 0x000b, 0x0219,
-	0x0008, 0x0036, 0x0004, 0x0096, 0x000b, 0x0251, 0x0000, 0x8074,
-	0x0000, 0x2000, 0x000b, 0x0251, 0x0002, 0x3a44, 0x0003, 0x0b6f,
-	0x0000, 0x8074, 0x0000, 0x1000, 0x0000, 0x2d0e, 0x0000, 0x2d0e,
-	0x0003, 0xb341, 0x0008, 0x26fe, 0x0008, 0x26fe, 0x0008, 0x2700,
-	0x0008, 0x2700, 0x0009, 0x00d0, 0x000b, 0x8a61, 0x0000, 0x8074,
-	0x0008, 0x4040, 0x0003, 0x5a51, 0x0003, 0x5209, 0x000a, 0x3a46,
-	0x000b, 0x8a61, 0x0002, 0x3a47, 0x000b, 0x0a5c, 0x0008, 0x8054,
-	0x0000, 0x0004, 0x0000, 0x8074, 0x0000, 0x8000, 0x000b, 0x02ba,
-	0x0009, 0x92c0, 0x0000, 0x0fc8, 0x000b, 0x0813, 0x000a, 0x1246,
-	0x0003, 0x8b3b, 0x0000, 0x1a60, 0x0008, 0x8062, 0x0000, 0x0002,
-	0x0000, 0x8066, 0x0000, 0x367a, 0x0003, 0xc266, 0x0009, 0x92c0,
-	0x0008, 0x0780, 0x000b, 0x8b55, 0x0002, 0x124b, 0x000b, 0x0a6f,
-	0x0002, 0x2e4d, 0x0002, 0x2e4d, 0x0003, 0x0b41, 0x000a, 0x3a46,
-	0x000b, 0x8a7c, 0x000b, 0x5a71, 0x0008, 0x8054, 0x0000, 0x0004,
-	0x000a, 0x1243, 0x000b, 0x0ab8, 0x0008, 0x8010, 0x0000, 0x000d,
-	0x000c, 0x032f, 0x0000, 0x1810, 0x000c, 0x032f, 0x0003, 0x02b8,
-	0x000a, 0x194d, 0x0003, 0x0a80, 0x000a, 0x1243, 0x0003, 0x0b4b,
-	0x0003, 0x5a80, 0x0008, 0x8054, 0x0000, 0x0004, 0x000a, 0x192e,
-	0x0008, 0x7f32, 0x000a, 0x1947, 0x000b, 0x0ab2, 0x0002, 0x194f,
-	0x000b, 0x0a90, 0x0004, 0x0324, 0x0000, 0x1810, 0x000c, 0x01c9,
-	0x0003, 0xb2ab, 0x000c, 0x032f, 0x0004, 0x01b3, 0x0003, 0x02b8,
-	0x0000, 0x1a60, 0x0008, 0x8062, 0x0000, 0x001f, 0x0000, 0x8066,
-	0x0008, 0x0009, 0x0003, 0xc295, 0x000a, 0x004c, 0x0003, 0x8ab2,
-	0x0000, 0x8060, 0x0000, 0x0400, 0x0001, 0x9880, 0x0000, 0x0007,
-	0x0008, 0x7f62, 0x0000, 0x8066, 0x0000, 0x320a, 0x0003, 0xc29f,
-	0x0000, 0x8060, 0x0000, 0x0400, 0x0001, 0x9880, 0x0008, 0x0012,
-	0x0008, 0x7f62, 0x0000, 0x8066, 0x0008, 0x1e0a, 0x000b, 0xc2a7,
-	0x0000, 0x1826, 0x0000, 0x1928, 0x0003, 0x02b8, 0x0000, 0x0806,
-	0x0008, 0x8010, 0x0000, 0x001f, 0x000c, 0x032f, 0x0000, 0x0310,
-	0x000c, 0x032f, 0x0003, 0x02b8, 0x0004, 0x0324, 0x0008, 0x8010,
-	0x0000, 0x0001, 0x000c, 0x032f, 0x0000, 0x1810, 0x000c, 0x032f,
-	0x0000, 0x8074, 0x0008, 0xf000, 0x0000, 0x0d30, 0x0002, 0x3a42,
-	0x0003, 0x8ac0, 0x0000, 0x15fc, 0x0003, 0xb06a, 0x0003, 0x0013,
-	0x0000, 0x8074, 0x0000, 0x0501, 0x0008, 0x8010, 0x0008, 0x000c,
-	0x000c, 0x032f, 0x0003, 0x0013, 0x0009, 0xbbe0, 0x0008, 0x0030,
-	0x000b, 0x8adc, 0x0000, 0x18fe, 0x0009, 0x3ce0, 0x0003, 0x0ad9,
-	0x0008, 0x15fe, 0x0009, 0x3ce0, 0x0003, 0x0ad9, 0x0008, 0x13fe,
-	0x0009, 0x3ce0, 0x000b, 0x8ad5, 0x0004, 0x031d, 0x0008, 0x0d26,
-	0x000b, 0x02d6, 0x000c, 0x031f, 0x0008, 0x8076, 0x0000, 0x0040,
-	0x0003, 0x031a, 0x0008, 0x8076, 0x0008, 0x0041, 0x0003, 0x031a,
-	0x0009, 0xbbe0, 0x0000, 0x0032, 0x0003, 0x8ae1, 0x0008, 0x3c1e,
-	0x0003, 0x031a, 0x0009, 0xbbe0, 0x0000, 0x0037, 0x0003, 0x8aff,
-	0x0000, 0x18fe, 0x0009, 0x3ce0, 0x000b, 0x8ad9, 0x0008, 0x8076,
-	0x0000, 0x0040, 0x0000, 0x1a60, 0x0008, 0x8062, 0x0000, 0x000d,
-	0x0008, 0x2604, 0x0008, 0x2604, 0x0008, 0x2706, 0x0008, 0x2706,
-	0x0000, 0x2808, 0x0000, 0x2808, 0x0000, 0x290a, 0x0000, 0x290a,
-	0x0000, 0x8066, 0x0000, 0x0422, 0x0003, 0xc2f6, 0x0004, 0x0324,
-	0x0008, 0x8054, 0x0000, 0x0004, 0x0000, 0x8074, 0x0008, 0xf000,
-	0x0000, 0x8072, 0x0000, 0x8000, 0x000b, 0x02ba, 0x0009, 0xbbe0,
-	0x0000, 0x0038, 0x000b, 0x8b11, 0x0000, 0x18fe, 0x0009, 0x3ce0,
-	0x000b, 0x0b0e, 0x0008, 0x15fe, 0x0009, 0x3ce0, 0x0003, 0x8acf,
-	0x000c, 0x031f, 0x0008, 0x8076, 0x0000, 0x0040, 0x0000, 0x8072,
-	0x0000, 0x8000, 0x000b, 0x0366, 0x0008, 0x8076, 0x0008, 0x0042,
-	0x0003, 0x031a, 0x0009, 0xbbe0, 0x0000, 0x0016, 0x0003, 0x8b1a,
-	0x0002, 0x3a44, 0x0003, 0x8816, 0x0000, 0x8072, 0x0000, 0x8000,
-	0x000f, 0x8000, 0x0003, 0x0013, 0x0000, 0x8072, 0x0000, 0x8000,
-	0x0003, 0x0013, 0x0002, 0x1430, 0x0003, 0x0320, 0x000a, 0x3d30,
-	0x0000, 0x7f00, 0x0001, 0xbc80, 0x0000, 0x0007, 0x000b, 0x0328,
-	0x000a, 0x1930, 0x0000, 0x7f00, 0x0001, 0x9880, 0x0000, 0x0007,
-	0x0000, 0x8060, 0x0000, 0x0400, 0x0008, 0x7f62, 0x0000, 0x8066,
-	0x0008, 0x000a, 0x000b, 0xc32d, 0x000f, 0x4000, 0x000b, 0x232f,
-	0x0008, 0x0870, 0x000f, 0x4000, 0x0009, 0xbac0, 0x0008, 0x0090,
-	0x000b, 0x0b38, 0x0000, 0x8074, 0x0000, 0x0706, 0x000b, 0x033a,
-	0x0000, 0x8074, 0x0000, 0x0703, 0x000f, 0x4000, 0x0008, 0x8010,
-	0x0000, 0x0023, 0x000b, 0x0374, 0x0008, 0x8010, 0x0000, 0x0008,
-	0x000b, 0x0374, 0x0008, 0x8010, 0x0008, 0x0022, 0x000b, 0x0374,
-	0x0004, 0x0324, 0x0008, 0x8010, 0x0000, 0x0007, 0x000c, 0x032f,
-	0x0000, 0x1810, 0x000c, 0x032f, 0x000b, 0x037e, 0x0004, 0x0324,
-	0x0008, 0x8010, 0x0008, 0x001b, 0x000c, 0x032f, 0x0000, 0x1810,
-	0x000c, 0x032f, 0x0000, 0x8074, 0x0000, 0xf080, 0x0000, 0x0d30,
-	0x0003, 0x0013, 0x0008, 0x8010, 0x0008, 0x0009, 0x000b, 0x0374,
-	0x0008, 0x8010, 0x0008, 0x0005, 0x000b, 0x0374, 0x0008, 0x808c,
-	0x0000, 0x0001, 0x0007, 0x0000, 0x0008, 0x8010, 0x0000, 0x0004,
-	0x000a, 0x4143, 0x0003, 0x0878, 0x0002, 0x3a44, 0x0003, 0x8813,
-	0x0008, 0x0d2a, 0x000b, 0x0374, 0x0008, 0x8010, 0x0008, 0x0003,
-	0x0003, 0x0376, 0x0008, 0x8010, 0x0000, 0x000b, 0x0003, 0x0376,
-	0x0008, 0x8010, 0x0000, 0x0002, 0x0003, 0x0376, 0x0002, 0x3a47,
-	0x000b, 0x8a51, 0x0008, 0x8010, 0x0008, 0x0006, 0x0003, 0x0376,
-	0x0000, 0x8074, 0x0008, 0xf000, 0x000c, 0x032f, 0x000c, 0x0332,
-	0x000a, 0x3a40, 0x000b, 0x0813, 0x0008, 0x8010, 0x0008, 0x000c,
-	0x000c, 0x032f, 0x0003, 0x0013, 0x0000, 0x8074, 0x0000, 0xf080,
-	0x0000, 0x0d30, 0x0002, 0x2e4d, 0x0002, 0x2e4d, 0x0003, 0x0b87,
-	0x0008, 0x8054, 0x0000, 0x0019, 0x0003, 0x0013, 0x0008, 0x8054,
-	0x0008, 0x0009, 0x0003, 0x0013, 0x0002, 0x3a44, 0x0003, 0x8813,
-	0x000b, 0x0369, 0xec89, 0x9da0
+	0x0003, 0x0203, 0x000a, 0x3a40, 0x000b, 0x8817, 0x0001, 0xabd0,
+	0x0008, 0x0000, 0x0000, 0x7f24, 0x0003, 0x5a0e, 0x0008, 0x8054,
+	0x0000, 0x0002, 0x0002, 0x1242, 0x0003, 0x0a54, 0x000a, 0x3a45,
+	0x0003, 0x0a43, 0x000a, 0x1e10, 0x0000, 0x7f3c, 0x0003, 0x0a40,
+	0x0002, 0x1d00, 0x0000, 0x7f3a, 0x0000, 0x0d60, 0x0008, 0x7f62,
+	0x0000, 0x8066, 0x0008, 0x0009, 0x0003, 0xc21e, 0x0008, 0x00fc,
+	0x0003, 0xb23d, 0x0000, 0x1c60, 0x0008, 0x8062, 0x0000, 0x0001,
+	0x0000, 0x8066, 0x0008, 0x0009, 0x000b, 0xc226, 0x0008, 0x00fc,
+	0x000b, 0x334b, 0x0000, 0x0038, 0x0008, 0x0060, 0x0008, 0x8062,
+	0x0000, 0x0019, 0x0000, 0x8066, 0x0008, 0x0009, 0x000b, 0xc22f,
+	0x0009, 0x80c0, 0x0008, 0x00ff, 0x0008, 0x7f3e, 0x0000, 0x0d60,
+	0x0008, 0x0efe, 0x0001, 0x1f80, 0x0008, 0x7f62, 0x0000, 0x8066,
+	0x0008, 0x0009, 0x0003, 0xc239, 0x0008, 0x003a, 0x0000, 0x1dfe,
+	0x000b, 0x021a, 0x0008, 0x0036, 0x0004, 0x0096, 0x000b, 0x0254,
+	0x0000, 0x8074, 0x0000, 0x2000, 0x000b, 0x0254, 0x0002, 0x3a44,
+	0x000b, 0x0b76, 0x0000, 0x8074, 0x0000, 0x1000, 0x0001, 0xadd0,
+	0x0008, 0x0000, 0x0008, 0x7f0e, 0x0003, 0xb348, 0x0001, 0xa7d0,
+	0x0008, 0x0000, 0x0000, 0x7f00, 0x0009, 0xa6d0, 0x0008, 0x0000,
+	0x0009, 0x00d0, 0x000b, 0x8a64, 0x0000, 0x8074, 0x0008, 0x4040,
+	0x0003, 0x5a54, 0x0003, 0x5209, 0x000a, 0x3a46, 0x000b, 0x8a64,
+	0x0002, 0x3a47, 0x000b, 0x0a5f, 0x0008, 0x8054, 0x0000, 0x0004,
+	0x0000, 0x8074, 0x0000, 0x8000, 0x0003, 0x02bd, 0x0009, 0x92c0,
+	0x0000, 0x0fc8, 0x000b, 0x0813, 0x000a, 0x1246, 0x000b, 0x8b42,
+	0x0000, 0x1a60, 0x0008, 0x8062, 0x0000, 0x0002, 0x0000, 0x8066,
+	0x0000, 0x367a, 0x0003, 0xc269, 0x0009, 0x92c0, 0x0008, 0x0780,
+	0x000b, 0x8b5c, 0x0002, 0x124b, 0x000b, 0x0a72, 0x0002, 0x2e4d,
+	0x0002, 0x2e4d, 0x0003, 0x0b48, 0x000a, 0x3a46, 0x000b, 0x8a7f,
+	0x000b, 0x5a74, 0x0008, 0x8054, 0x0000, 0x0004, 0x000a, 0x1243,
+	0x000b, 0x0abb, 0x0008, 0x8010, 0x0000, 0x000d, 0x0004, 0x0336,
+	0x0000, 0x1810, 0x0004, 0x0336, 0x0003, 0x02bb, 0x000a, 0x194d,
+	0x0003, 0x0a83, 0x000a, 0x1243, 0x000b, 0x0b52, 0x0003, 0x5a83,
+	0x0008, 0x8054, 0x0000, 0x0004, 0x000a, 0x192e, 0x0008, 0x7f32,
+	0x000a, 0x1947, 0x0003, 0x0ab5, 0x0002, 0x194f, 0x000b, 0x0a93,
+	0x0004, 0x032b, 0x0000, 0x1810, 0x000c, 0x01c9, 0x0003, 0xb2ae,
+	0x0004, 0x0336, 0x0004, 0x01b3, 0x0003, 0x02bb, 0x0000, 0x1a60,
+	0x0008, 0x8062, 0x0000, 0x001f, 0x0000, 0x8066, 0x0008, 0x0009,
+	0x000b, 0xc298, 0x000a, 0x004c, 0x000b, 0x8ab5, 0x0000, 0x8060,
+	0x0000, 0x0400, 0x0001, 0x9880, 0x0000, 0x0007, 0x0008, 0x7f62,
+	0x0000, 0x8066, 0x0000, 0x320a, 0x000b, 0xc2a2, 0x0000, 0x8060,
+	0x0000, 0x0400, 0x0001, 0x9880, 0x0008, 0x0012, 0x0008, 0x7f62,
+	0x0000, 0x8066, 0x0008, 0x1e0a, 0x0003, 0xc2aa, 0x0000, 0x1826,
+	0x0000, 0x1928, 0x0003, 0x02bb, 0x0000, 0x0806, 0x0008, 0x8010,
+	0x0000, 0x001f, 0x0004, 0x0336, 0x0000, 0x0310, 0x0004, 0x0336,
+	0x0003, 0x02bb, 0x0004, 0x032b, 0x0008, 0x8010, 0x0000, 0x0001,
+	0x0004, 0x0336, 0x0000, 0x1810, 0x0004, 0x0336, 0x0000, 0x8074,
+	0x0008, 0xf000, 0x0000, 0x0d30, 0x0002, 0x3a42, 0x0003, 0x8ac3,
+	0x0000, 0x15fc, 0x0003, 0xb06a, 0x0003, 0x0013, 0x0000, 0x8074,
+	0x0000, 0x0501, 0x0008, 0x8010, 0x0008, 0x000c, 0x0004, 0x0336,
+	0x0003, 0x0013, 0x0009, 0xbbe0, 0x0008, 0x0030, 0x000b, 0x8adf,
+	0x0000, 0x18fe, 0x0009, 0x3ce0, 0x0003, 0x0adc, 0x0008, 0x15fe,
+	0x0009, 0x3ce0, 0x0003, 0x0adc, 0x0008, 0x13fe, 0x0009, 0x3ce0,
+	0x0003, 0x8ad8, 0x0004, 0x0324, 0x0008, 0x0d26, 0x000b, 0x02d9,
+	0x000c, 0x0326, 0x0008, 0x8076, 0x0000, 0x0040, 0x000b, 0x0321,
+	0x0008, 0x8076, 0x0008, 0x0041, 0x000b, 0x0321, 0x0009, 0xbbe0,
+	0x0000, 0x0032, 0x0003, 0x8ae4, 0x0008, 0x3c1e, 0x000b, 0x0321,
+	0x0009, 0xbbe0, 0x0000, 0x0037, 0x000b, 0x8b06, 0x0000, 0x18fe,
+	0x0009, 0x3ce0, 0x000b, 0x8adc, 0x0008, 0x8076, 0x0000, 0x0040,
+	0x0000, 0x1a60, 0x0008, 0x8062, 0x0000, 0x000d, 0x0009, 0xa6d0,
+	0x0008, 0x0000, 0x0008, 0x7f04, 0x0001, 0xa7d0, 0x0008, 0x0000,
+	0x0000, 0x7f06, 0x0001, 0xa8d0, 0x0008, 0x0000, 0x0008, 0x7f08,
+	0x0009, 0xa9d0, 0x0008, 0x0000, 0x0000, 0x7f0a, 0x0000, 0x8066,
+	0x0000, 0x0422, 0x000b, 0xc2fd, 0x0004, 0x032b, 0x0008, 0x8054,
+	0x0000, 0x0004, 0x0000, 0x8074, 0x0008, 0xf000, 0x0000, 0x8072,
+	0x0000, 0x8000, 0x0003, 0x02bd, 0x0009, 0xbbe0, 0x0000, 0x0038,
+	0x000b, 0x8b18, 0x0000, 0x18fe, 0x0009, 0x3ce0, 0x000b, 0x0b15,
+	0x0008, 0x15fe, 0x0009, 0x3ce0, 0x0003, 0x8ad2, 0x000c, 0x0326,
+	0x0008, 0x8076, 0x0000, 0x0040, 0x0000, 0x8072, 0x0000, 0x8000,
+	0x0003, 0x036d, 0x0008, 0x8076, 0x0008, 0x0042, 0x000b, 0x0321,
+	0x0009, 0xbbe0, 0x0000, 0x0016, 0x000b, 0x8b21, 0x0002, 0x3a44,
+	0x0003, 0x8816, 0x0000, 0x8072, 0x0000, 0x8000, 0x000f, 0x8000,
+	0x0003, 0x0013, 0x0000, 0x8072, 0x0000, 0x8000, 0x0003, 0x0013,
+	0x0002, 0x1430, 0x000b, 0x0327, 0x000a, 0x3d30, 0x0000, 0x7f00,
+	0x0001, 0xbc80, 0x0000, 0x0007, 0x0003, 0x032f, 0x000a, 0x1930,
+	0x0000, 0x7f00, 0x0001, 0x9880, 0x0000, 0x0007, 0x0000, 0x8060,
+	0x0000, 0x0400, 0x0008, 0x7f62, 0x0000, 0x8066, 0x0008, 0x000a,
+	0x0003, 0xc334, 0x000f, 0x4000, 0x0003, 0x2336, 0x0008, 0x0870,
+	0x000f, 0x4000, 0x0009, 0xbac0, 0x0008, 0x0090, 0x0003, 0x0b3f,
+	0x0000, 0x8074, 0x0000, 0x0706, 0x000b, 0x0341, 0x0000, 0x8074,
+	0x0000, 0x0703, 0x000f, 0x4000, 0x0008, 0x8010, 0x0000, 0x0023,
+	0x000b, 0x037b, 0x0008, 0x8010, 0x0000, 0x0008, 0x000b, 0x037b,
+	0x0008, 0x8010, 0x0008, 0x0022, 0x000b, 0x037b, 0x0004, 0x032b,
+	0x0008, 0x8010, 0x0000, 0x0007, 0x0004, 0x0336, 0x0000, 0x1810,
+	0x0004, 0x0336, 0x0003, 0x0385, 0x0004, 0x032b, 0x0008, 0x8010,
+	0x0008, 0x001b, 0x0004, 0x0336, 0x0000, 0x1810, 0x0004, 0x0336,
+	0x0000, 0x8074, 0x0000, 0xf080, 0x0000, 0x0d30, 0x0003, 0x0013,
+	0x0008, 0x8010, 0x0008, 0x0009, 0x000b, 0x037b, 0x0008, 0x8010,
+	0x0008, 0x0005, 0x000b, 0x037b, 0x0008, 0x808c, 0x0000, 0x0001,
+	0x0007, 0x0000, 0x0008, 0x8010, 0x0000, 0x0004, 0x000a, 0x4143,
+	0x0003, 0x0878, 0x0002, 0x3a44, 0x0003, 0x8813, 0x0008, 0x0d2a,
+	0x000b, 0x037b, 0x0008, 0x8010, 0x0008, 0x0003, 0x000b, 0x037d,
+	0x0008, 0x8010, 0x0000, 0x000b, 0x000b, 0x037d, 0x0008, 0x8010,
+	0x0000, 0x0002, 0x000b, 0x037d, 0x0002, 0x3a47, 0x000b, 0x8a54,
+	0x0008, 0x8010, 0x0008, 0x0006, 0x000b, 0x037d, 0x0000, 0x8074,
+	0x0008, 0xf000, 0x0004, 0x0336, 0x0004, 0x0339, 0x000a, 0x3a40,
+	0x000b, 0x0813, 0x0008, 0x8010, 0x0008, 0x000c, 0x0004, 0x0336,
+	0x0003, 0x0013, 0x0000, 0x8074, 0x0000, 0xf080, 0x0000, 0x0d30,
+	0x0002, 0x2e4d, 0x0002, 0x2e4d, 0x0003, 0x0b8e, 0x0008, 0x8054,
+	0x0000, 0x0019, 0x0003, 0x0013, 0x0008, 0x8054, 0x0008, 0x0009,
+	0x0003, 0x0013, 0x0002, 0x3a44, 0x0003, 0x8813, 0x0003, 0x0370,
+	0xed0b, 0x60bf
 };
-unsigned short rseqflx_code_length01 = 0x071c;
+unsigned short rseqflx_code_length01 = 0x072a;
 /*
  *
  */
 
 unsigned long xseqflx_code_addr01 = 0x0001e000 ;
 unsigned short xseqflx_code01[] = { 
-0x0013, 0x0003, 0x0000, 0x0fe2, 0x0001, 0xe000, 0x0005, 0x0032,
+0x0013, 0x0003, 0x0000, 0x1036, 0x0001, 0xe000, 0x0005, 0x0032,
 	0x0000, 0x0010, 0x0015, 0x0033, 0x0010, 0xbb39, 0x000b, 0x8007,
 	0x0004, 0x0107, 0x0004, 0x0119, 0x0010, 0xc000, 0x0000, 0xc001,
 	0x0000, 0xc0b0, 0x0010, 0xc0b1, 0x0010, 0xc0b2, 0x0000, 0xc0b3,
@@ -6912,14 +6916,14 @@ unsigned short xseqflx_code01[] = {
 	0x0010, 0xff00, 0x0005, 0x00d0, 0x0010, 0xff00, 0x0015, 0x00d1,
 	0x0010, 0xff00, 0x0012, 0x3a40, 0x000b, 0x1031, 0x0002, 0x7940,
 	0x000b, 0x112b, 0x0002, 0x3a42, 0x001b, 0x1035, 0x0003, 0xb035,
-	0x0013, 0xa1cd, 0x0002, 0x3a41, 0x001b, 0x1039, 0x0012, 0x7941,
-	0x000b, 0x12eb, 0x0013, 0xe051, 0x0012, 0xd042, 0x0003, 0x103f,
+	0x0003, 0xa1d1, 0x0002, 0x3a41, 0x001b, 0x1039, 0x0012, 0x7941,
+	0x001b, 0x1306, 0x0013, 0xe051, 0x0012, 0xd042, 0x0003, 0x103f,
 	0x0000, 0x75ff, 0x0002, 0xff41, 0x000b, 0x1051, 0x0000, 0x0cfe,
-	0x0013, 0x6047, 0x0011, 0x02e8, 0x0010, 0x0000, 0x0003, 0x1371,
-	0x0011, 0x02e8, 0x0010, 0x0005, 0x0013, 0x13fe, 0x0012, 0xd042,
+	0x0013, 0x6047, 0x0011, 0x02e8, 0x0010, 0x0000, 0x0003, 0x1390,
+	0x0011, 0x02e8, 0x0010, 0x0005, 0x0013, 0x141d, 0x0012, 0xd042,
 	0x0013, 0x104c, 0x0000, 0x75ff, 0x0012, 0xff40, 0x000b, 0x1051,
 	0x0000, 0x12fe, 0x0003, 0x6051, 0x0001, 0x0fe8, 0x0010, 0x0000,
-	0x0003, 0x15e8, 0x0015, 0x0030, 0x0000, 0x0400, 0x0010, 0xc131,
+	0x0013, 0x160e, 0x0015, 0x0030, 0x0000, 0x0400, 0x0010, 0xc131,
 	0x0015, 0x0033, 0x0010, 0xb211, 0x001b, 0x8056, 0x0010, 0xb2ff,
 	0x0001, 0xb3e0, 0x000c, 0x10c9, 0x000b, 0xf02d, 0x0011, 0x3be8,
 	0x0000, 0x0010, 0x000b, 0x106e, 0x0000, 0x0afe, 0x001b, 0x6062,
@@ -6944,11 +6948,11 @@ unsigned short xseqflx_code01[] = {
 	0x001b, 0x10b8, 0x0001, 0x0fe8, 0x0010, 0x0000, 0x0003, 0x10b2,
 	0x0001, 0x0fe8, 0x0000, 0x0002, 0x0003, 0x10b2, 0x0015, 0x0039,
 	0x0010, 0x1010, 0x0013, 0x00c6, 0x0015, 0x0039, 0x0000, 0x5040,
-	0x0015, 0x00b8, 0x0000, 0x0008, 0x0014, 0x07ed, 0x0013, 0x00c6,
+	0x0015, 0x00b8, 0x0000, 0x0008, 0x0014, 0x0817, 0x0013, 0x00c6,
 	0x0011, 0x3be8, 0x0010, 0x0017, 0x001b, 0x10bd, 0x0010, 0x3cc3,
 	0x0013, 0x00c6, 0x0011, 0x3be8, 0x0010, 0x0018, 0x000b, 0x10c2,
 	0x0000, 0x3cc2, 0x0013, 0x00c6, 0x0005, 0x00ce, 0x0000, 0x0001,
-	0x0000, 0x3bcf, 0x0014, 0x07b1, 0x0015, 0x0039, 0x0000, 0x8000,
+	0x0000, 0x3bcf, 0x0004, 0x07d9, 0x0015, 0x0039, 0x0000, 0x8000,
 	0x0013, 0x002d, 0x0001, 0xb288, 0x0000, 0x0002, 0x0001, 0xc180,
 	0x0000, 0xff31, 0x0015, 0x0033, 0x0000, 0xb009, 0x001b, 0x80cf,
 	0x0002, 0xb200, 0x0011, 0xffc8, 0x0000, 0x0007, 0x0010, 0xffb2,
@@ -6977,436 +6981,446 @@ unsigned short xseqflx_code01[] = {
 	0x0012, 0xff40, 0x000b, 0x1031, 0x0015, 0x00d1, 0x0010, 0x0101,
 	0x0003, 0x9130, 0x0005, 0x0079, 0x0000, 0x0001, 0x0003, 0x9133,
 	0x0015, 0x00d1, 0x0000, 0x0100, 0x0011, 0x02e8, 0x0000, 0x0002,
-	0x0003, 0x1152, 0x0011, 0x02e8, 0x0000, 0x0001, 0x0013, 0x116a,
-	0x0011, 0x02e8, 0x0000, 0x0004, 0x0013, 0x1188, 0x0011, 0x02e8,
-	0x0010, 0x0003, 0x0003, 0x11b9, 0x0005, 0x0002, 0x0010, 0x0000,
+	0x0013, 0x1156, 0x0011, 0x02e8, 0x0000, 0x0001, 0x0003, 0x116e,
+	0x0011, 0x02e8, 0x0000, 0x0004, 0x0003, 0x118c, 0x0011, 0x02e8,
+	0x0010, 0x0003, 0x0013, 0x11bd, 0x0005, 0x0002, 0x0010, 0x0000,
 	0x0000, 0xc00e, 0x0000, 0xc00d, 0x0010, 0xc003, 0x0015, 0x0030,
 	0x0000, 0x0400, 0x0001, 0xbd88, 0x0010, 0x0009, 0x0000, 0xff31,
-	0x0015, 0x0033, 0x0010, 0xc00a, 0x000b, 0x814e, 0x0012, 0xd042,
-	0x0013, 0x1031, 0x0003, 0x004c, 0x0012, 0x7849, 0x0003, 0x11c7,
+	0x0015, 0x0033, 0x0010, 0xc00a, 0x000b, 0x814e, 0x0000, 0xff31,
+	0x0015, 0x0033, 0x0010, 0xc00a, 0x001b, 0x8152, 0x0012, 0xd042,
+	0x0013, 0x1031, 0x0003, 0x004c, 0x0012, 0x7849, 0x0003, 0x11cb,
 	0x0010, 0x0dfe, 0x0003, 0x6144, 0x0012, 0x0c10, 0x0010, 0xff0c,
 	0x0015, 0x0030, 0x0000, 0x0400, 0x0011, 0x0d88, 0x0010, 0x0003,
-	0x0000, 0xff31, 0x0015, 0x0033, 0x0000, 0xb309, 0x000b, 0x815f,
-	0x0010, 0xb3fe, 0x0013, 0x6167, 0x0010, 0xb30b, 0x0015, 0x0033,
-	0x0010, 0xc00a, 0x000b, 0x8165, 0x0013, 0x01bc, 0x0000, 0xc00b,
-	0x0010, 0xc00a, 0x0013, 0x01bc, 0x0000, 0x78b0, 0x0012, 0xb044,
-	0x0003, 0x11c7, 0x0002, 0xb049, 0x0003, 0x11c7, 0x0010, 0x71ff,
+	0x0000, 0xff31, 0x0015, 0x0033, 0x0000, 0xb309, 0x000b, 0x8163,
+	0x0010, 0xb3fe, 0x0013, 0x616b, 0x0010, 0xb30b, 0x0015, 0x0033,
+	0x0010, 0xc00a, 0x000b, 0x8169, 0x0003, 0x01c0, 0x0000, 0xc00b,
+	0x0010, 0xc00a, 0x0003, 0x01c0, 0x0000, 0x78b0, 0x0012, 0xb044,
+	0x0003, 0x11cb, 0x0002, 0xb049, 0x0003, 0x11cb, 0x0010, 0x71ff,
 	0x0012, 0xff38, 0x0010, 0xff71, 0x0010, 0x0dfe, 0x0003, 0x6142,
 	0x0012, 0x0c10, 0x0010, 0xff0c, 0x0015, 0x0030, 0x0000, 0x0400,
 	0x0011, 0x0d88, 0x0010, 0x0003, 0x0000, 0xff31, 0x0015, 0x0033,
-	0x0000, 0xb309, 0x000b, 0x817d, 0x0010, 0xb3fe, 0x0013, 0x6185,
-	0x0000, 0xb309, 0x0015, 0x0033, 0x0010, 0xc00a, 0x001b, 0x8183,
-	0x0013, 0x01bc, 0x0010, 0xc009, 0x0000, 0xc008, 0x0013, 0x01bc,
-	0x0000, 0x78b0, 0x0012, 0xb044, 0x0003, 0x11c7, 0x0002, 0xb049,
-	0x0003, 0x11c7, 0x0010, 0x71ff, 0x0012, 0xff38, 0x0010, 0xff71,
+	0x0000, 0xb309, 0x000b, 0x8181, 0x0010, 0xb3fe, 0x0013, 0x6189,
+	0x0000, 0xb309, 0x0015, 0x0033, 0x0010, 0xc00a, 0x000b, 0x8187,
+	0x0003, 0x01c0, 0x0010, 0xc009, 0x0000, 0xc008, 0x0003, 0x01c0,
+	0x0000, 0x78b0, 0x0012, 0xb044, 0x0003, 0x11cb, 0x0002, 0xb049,
+	0x0003, 0x11cb, 0x0010, 0x71ff, 0x0012, 0xff38, 0x0010, 0xff71,
 	0x0010, 0x0dfe, 0x0003, 0x6142, 0x0012, 0x0c10, 0x0010, 0xff0c,
 	0x0015, 0x0030, 0x0000, 0x0400, 0x0011, 0x0d88, 0x0010, 0x0003,
-	0x0000, 0xff31, 0x0015, 0x0033, 0x0000, 0xb309, 0x001b, 0x819b,
-	0x0010, 0xb3fe, 0x0003, 0x61a3, 0x0000, 0xb305, 0x0015, 0x0033,
-	0x0010, 0xc00a, 0x001b, 0x81a1, 0x0003, 0x01a5, 0x0010, 0xc005,
+	0x0000, 0xff31, 0x0015, 0x0033, 0x0000, 0xb309, 0x000b, 0x819f,
+	0x0010, 0xb3fe, 0x0013, 0x61a7, 0x0000, 0xb305, 0x0015, 0x0033,
+	0x0010, 0xc00a, 0x000b, 0x81a5, 0x0003, 0x01a9, 0x0010, 0xc005,
 	0x0000, 0xc004, 0x0002, 0x033f, 0x0002, 0xff27, 0x0000, 0x0db8,
-	0x0004, 0x0366, 0x0000, 0x0db8, 0x0014, 0x07ed, 0x0015, 0x0030,
+	0x0014, 0x0385, 0x0000, 0x0db8, 0x0014, 0x0817, 0x0015, 0x0030,
 	0x0000, 0x0400, 0x0011, 0xbc88, 0x0010, 0x0000, 0x0000, 0xff31,
-	0x0015, 0x0033, 0x0000, 0xb309, 0x000b, 0x81b2, 0x0011, 0xb3e8,
+	0x0015, 0x0033, 0x0000, 0xb309, 0x001b, 0x81b6, 0x0011, 0xb3e8,
 	0x0000, 0x0002, 0x000b, 0x1142, 0x0005, 0x0002, 0x0010, 0x0005,
-	0x0003, 0x0144, 0x0012, 0x7849, 0x0003, 0x11c7, 0x0003, 0x0144,
-	0x0000, 0x0db8, 0x0012, 0x0345, 0x001b, 0x11c2, 0x0002, 0x033f,
-	0x0004, 0x0366, 0x0003, 0x0142, 0x0002, 0x033f, 0x0002, 0xff27,
-	0x0004, 0x0366, 0x0014, 0x07ed, 0x0003, 0x0142, 0x0015, 0x00b8,
-	0x0000, 0x0001, 0x0015, 0x003a, 0x0010, 0x0101, 0x0014, 0x07ed,
-	0x0013, 0x014f, 0x0000, 0x2bba, 0x0003, 0xb1ce, 0x0005, 0x002a,
-	0x0000, 0x0002, 0x0001, 0xbac8, 0x0000, 0x0700, 0x000b, 0x12a6,
-	0x0011, 0x15e8, 0x0000, 0x0002, 0x0013, 0x1221, 0x0011, 0x15e8,
-	0x0000, 0x0001, 0x0013, 0x11dd, 0x0005, 0x0015, 0x0010, 0x0000,
-	0x0013, 0x0204, 0x0005, 0x0015, 0x0010, 0x0000, 0x0002, 0xba43,
-	0x0013, 0x1205, 0x0013, 0xb1e1, 0x0005, 0x002a, 0x0000, 0x0004,
-	0x0012, 0xba42, 0x0003, 0x120b, 0x0012, 0x104b, 0x001b, 0x1204,
-	0x0000, 0x1a30, 0x0005, 0x0031, 0x0000, 0x0002, 0x0015, 0x0033,
-	0x0000, 0x1b2a, 0x000b, 0x81ed, 0x0010, 0x20b0, 0x0010, 0x21b1,
-	0x0010, 0x22b2, 0x0010, 0x23b3, 0x0010, 0x24b4, 0x0010, 0x25b5,
-	0x0010, 0x28b8, 0x0010, 0x29b9, 0x0000, 0x1a30, 0x0005, 0x0031,
-	0x0000, 0x0007, 0x0015, 0x0033, 0x0010, 0xb032, 0x001b, 0x81fb,
-	0x0000, 0x1a30, 0x0005, 0x0031, 0x0010, 0x000f, 0x0015, 0x0033,
-	0x0010, 0xb812, 0x001b, 0x8201, 0x0005, 0x0015, 0x0010, 0x0000,
-	0x0013, 0x0035, 0x0000, 0x1efe, 0x0013, 0x6219, 0x0014, 0x024b,
-	0x0000, 0x1efe, 0x000c, 0x624b, 0x0013, 0x0204, 0x0000, 0x1a30,
-	0x0005, 0x0031, 0x0000, 0x0020, 0x0015, 0x0033, 0x0000, 0xb009,
-	0x001b, 0x8210, 0x0002, 0xb02f, 0x0000, 0xffb0, 0x0005, 0x0031,
-	0x0000, 0x0020, 0x0015, 0x0033, 0x0000, 0xb00a, 0x000b, 0x8217,
-	0x0003, 0x01e8, 0x0015, 0x00b8, 0x0010, 0x0005, 0x0014, 0x07ed,
-	0x0000, 0x13b8, 0x0015, 0x003a, 0x0010, 0x0404, 0x0014, 0x07ed,
-	0x0013, 0x0204, 0x0005, 0x0015, 0x0000, 0x0001, 0x0012, 0xba42,
-	0x0013, 0x122e, 0x0003, 0xb225, 0x0010, 0x2bff, 0x0012, 0xff4f,
-	0x001b, 0x11cd, 0x0002, 0xba43, 0x001b, 0x120b, 0x0000, 0x1efe,
-	0x000c, 0x624b, 0x0013, 0x0204, 0x0010, 0x28b8, 0x0010, 0x29b9,
-	0x0004, 0x02bc, 0x0002, 0x3a42, 0x001b, 0x1204, 0x0000, 0x1c30,
-	0x0015, 0x00ff, 0x0000, 0x0002, 0x0002, 0x1f43, 0x001b, 0x123b,
-	0x0001, 0xff88, 0x0000, 0x0002, 0x0013, 0x023d, 0x0001, 0xff88,
-	0x0000, 0x0004, 0x0000, 0xff31, 0x0015, 0x0033, 0x0000, 0xb011,
-	0x001b, 0x8240, 0x0000, 0xb0ff, 0x0011, 0x16a0, 0x0000, 0xff16,
-	0x000b, 0x24e2, 0x0002, 0xb100, 0x0003, 0x0248, 0x0010, 0xb1ff,
-	0x0001, 0x17a0, 0x0010, 0xff17, 0x0013, 0x020b, 0x0000, 0x16ff,
-	0x0001, 0x18a0, 0x0010, 0xff00, 0x001b, 0x2252, 0x0002, 0x1700,
-	0x0013, 0x12a5, 0x0003, 0x0253, 0x0010, 0x17ff, 0x0011, 0x19a0,
-	0x0013, 0x22a5, 0x0011, 0x00d0, 0x0013, 0x12a5, 0x0000, 0x1c30,
-	0x0000, 0x1b31, 0x0015, 0x0033, 0x0000, 0xb131, 0x001b, 0x825b,
-	0x0013, 0xb25c, 0x0000, 0xb120, 0x0010, 0xb221, 0x0002, 0x1f43,
-	0x001b, 0x1268, 0x0010, 0xc022, 0x0000, 0xc023, 0x0000, 0xb324,
-	0x0000, 0xb425, 0x0010, 0xb3b5, 0x0000, 0xb4b6, 0x0003, 0x026c,
-	0x0000, 0xb322, 0x0000, 0xb423, 0x0000, 0xb524, 0x0010, 0xb625,
-	0x0013, 0xb26c, 0x0005, 0x002a, 0x0000, 0x0001, 0x0012, 0x1500,
-	0x0000, 0xff15, 0x0000, 0x16ff, 0x0001, 0xb580, 0x0000, 0xff16,
-	0x000b, 0x2277, 0x0002, 0x1700, 0x0003, 0x0278, 0x0010, 0x17ff,
-	0x0001, 0xb680, 0x0010, 0xff17, 0x0012, 0x1e10, 0x0010, 0xff1e,
-	0x0003, 0x62a5, 0x0002, 0x1d00, 0x0010, 0xff1d, 0x0010, 0xc030,
-	0x0000, 0xff31, 0x0015, 0x0033, 0x0000, 0xb009, 0x001b, 0x8283,
-	0x0010, 0xb0fe, 0x000b, 0x62a4, 0x0000, 0x1c30, 0x0005, 0x0031,
-	0x0000, 0x0001, 0x0015, 0x0033, 0x0000, 0xb009, 0x000b, 0x828b,
-	0x0010, 0xb0fe, 0x000b, 0x6291, 0x0005, 0x00ce, 0x0010, 0x0005,
-	0x0003, 0x07b1, 0x0010, 0xb01c, 0x0000, 0x1c30, 0x0005, 0x0031,
-	0x0000, 0x0019, 0x0015, 0x0033, 0x0000, 0xb009, 0x001b, 0x8297,
-	0x0001, 0xb0c8, 0x0010, 0x00ff, 0x0000, 0xff1f, 0x0010, 0xc030,
-	0x0011, 0xbe80, 0x0000, 0xff31, 0x0015, 0x0033, 0x0000, 0xb009,
-	0x000b, 0x82a0, 0x0000, 0xb01d, 0x0010, 0x1dff, 0x0013, 0x027f,
-	0x0000, 0xb01b, 0x0017, 0x4000, 0x0002, 0x3a41, 0x0003, 0x12ae,
-	0x0003, 0xb2a8, 0x0005, 0x002a, 0x0000, 0x0004, 0x0005, 0x0015,
-	0x0010, 0x0000, 0x0013, 0x0204, 0x0000, 0x1a30, 0x0005, 0x0031,
-	0x0000, 0x0002, 0x0015, 0x0033, 0x0000, 0x1b2a, 0x001b, 0x82b3,
-	0x0015, 0x00b8, 0x0000, 0x0004, 0x0014, 0x07ed, 0x0000, 0x13b8,
-	0x0015, 0x003a, 0x0010, 0x0404, 0x0014, 0x07ed, 0x0013, 0x0039,
-	0x0002, 0x1e00, 0x0010, 0xff1e, 0x0012, 0x1d10, 0x0010, 0xff1d,
-	0x0010, 0xc030, 0x0000, 0xff31, 0x0015, 0x0033, 0x0000, 0xb009,
-	0x001b, 0x82c4, 0x0010, 0xb0fe, 0x000b, 0x62e9, 0x0000, 0x1cff,
-	0x0001, 0x1ae0, 0x0003, 0x12d3, 0x0000, 0x1c30, 0x0005, 0x0031,
-	0x0010, 0x0000, 0x0015, 0x0033, 0x0000, 0xb009, 0x000b, 0x82cf,
-	0x0010, 0xb0fe, 0x000b, 0x62d3, 0x0000, 0x1aff, 0x0000, 0xff1c,
-	0x0000, 0x1c30, 0x0005, 0x0031, 0x0000, 0x0019, 0x0015, 0x0033,
-	0x0000, 0xb009, 0x001b, 0x82d9, 0x0001, 0xb0c8, 0x0010, 0x000f,
-	0x0000, 0xff1f, 0x0001, 0xbf80, 0x0010, 0xff1d, 0x0010, 0xc030,
-	0x0000, 0xff31, 0x0015, 0x0033, 0x0000, 0xb009, 0x001b, 0x82e3,
-	0x0010, 0xb0fe, 0x000b, 0x62e9, 0x0005, 0x00ce, 0x0010, 0x0006,
-	0x0003, 0x07b1, 0x0000, 0xb01b, 0x0017, 0x4000, 0x0010, 0x79b0,
-	0x0000, 0xd0ff, 0x0012, 0xff40, 0x001b, 0x1039, 0x0015, 0x00d1,
-	0x0010, 0x0101, 0x0013, 0x92f1, 0x0005, 0x0079, 0x0000, 0x0002,
-	0x0013, 0x92f4, 0x0015, 0x00d1, 0x0000, 0x0100, 0x0010, 0x13fe,
-	0x0003, 0x6329, 0x0012, 0xb04e, 0x000b, 0x133e, 0x0012, 0x784a,
-	0x0003, 0x1344, 0x0000, 0x75ff, 0x0011, 0xffc8, 0x0010, 0x1800,
-	0x001b, 0x1344, 0x0001, 0x0fe8, 0x0000, 0x0001, 0x000b, 0x130d,
-	0x0015, 0x0030, 0x0000, 0x0400, 0x0011, 0x1388, 0x0000, 0x000e,
-	0x0000, 0xff31, 0x0015, 0x0033, 0x0000, 0x8f0a, 0x000b, 0x830b,
-	0x0003, 0x034a, 0x0001, 0x0fe8, 0x0000, 0x0002, 0x001b, 0x1318,
-	0x0015, 0x0030, 0x0000, 0x0400, 0x0005, 0x0031, 0x0000, 0x001a,
-	0x0015, 0x0033, 0x0010, 0xc00a, 0x000b, 0x8316, 0x0003, 0x034a,
-	0x0001, 0x0fe8, 0x0010, 0x0000, 0x0013, 0x131f, 0x0005, 0x00ce,
-	0x0000, 0x0007, 0x0010, 0x0fcf, 0x0013, 0x07ab, 0x0000, 0x13b8,
-	0x0002, 0x1045, 0x0003, 0x1327, 0x0012, 0x103f, 0x0002, 0xff27,
-	0x0004, 0x0366, 0x0014, 0x07ed, 0x0003, 0x0329, 0x0012, 0x103f,
-	0x0004, 0x0366, 0x0015, 0x000f, 0x0010, 0x0000, 0x0002, 0x3944,
-	0x0013, 0x1332, 0x0015, 0x0039, 0x0000, 0x5040, 0x0015, 0x00b8,
-	0x0000, 0x0008, 0x0014, 0x07ed, 0x0015, 0x0030, 0x0000, 0x0400,
-	0x0001, 0xbd88, 0x0010, 0x000c, 0x0000, 0xff31, 0x0015, 0x0033,
-	0x0010, 0xc00a, 0x001b, 0x8339, 0x0010, 0xc014, 0x0000, 0xc013,
-	0x0000, 0xc010, 0x0013, 0x0039, 0x0015, 0x00b8, 0x0010, 0x0003,
-	0x0015, 0x003a, 0x0010, 0x0202, 0x0014, 0x07ed, 0x0003, 0x033d,
-	0x0015, 0x00b8, 0x0000, 0x0002, 0x0015, 0x003a, 0x0010, 0x0202,
-	0x0014, 0x07ed, 0x0003, 0x033d, 0x0015, 0x0030, 0x0000, 0x0400,
-	0x0011, 0x1388, 0x0010, 0x0003, 0x0000, 0xff31, 0x0015, 0x0033,
-	0x0000, 0xb009, 0x000b, 0x8351, 0x0011, 0x1388, 0x0010, 0x0003,
-	0x0000, 0xff31, 0x0015, 0x0033, 0x0010, 0xc00a, 0x000b, 0x8357,
-	0x0010, 0xb0fe, 0x0013, 0x635c, 0x0000, 0xb012, 0x0003, 0x035e,
-	0x0010, 0xc012, 0x0010, 0xc011, 0x0012, 0x104b, 0x0013, 0x131f,
-	0x0002, 0x103b, 0x0010, 0xff03, 0x0005, 0x0002, 0x0010, 0x0000,
-	0x0000, 0xc00d, 0x0003, 0x031f, 0x0000, 0xffb0, 0x0010, 0xc3b1,
-	0x0015, 0x0030, 0x0000, 0x0400, 0x0001, 0xb888, 0x0010, 0x0011,
-	0x0000, 0xff31, 0x0015, 0x0033, 0x0000, 0xb012, 0x001b, 0x836f,
-	0x0017, 0x4000, 0x0012, 0x3a43, 0x0013, 0x1380, 0x0015, 0x003a,
-	0x0000, 0x0800, 0x0010, 0x0db0, 0x0003, 0x6380, 0x0000, 0x0bff,
-	0x0001, 0xb0e0, 0x0003, 0x13a6, 0x0010, 0x09ff, 0x0001, 0xb0e0,
-	0x0013, 0x138a, 0x0010, 0x05ff, 0x0001, 0xb0e0, 0x0003, 0x1384,
-	0x0000, 0xc00e, 0x0000, 0x05fe, 0x0013, 0x6387, 0x0000, 0x050d,
-	0x0005, 0x0002, 0x0000, 0x0004, 0x0003, 0x03a1, 0x0000, 0x09fe,
-	0x0013, 0x63a3, 0x0000, 0x090d, 0x0005, 0x0002, 0x0000, 0x0001,
-	0x0014, 0x0405, 0x0015, 0x0030, 0x0000, 0x0400, 0x0011, 0x0d88,
-	0x0000, 0x0004, 0x0000, 0xff31, 0x0015, 0x0033, 0x0000, 0xba09,
-	0x000b, 0x8394, 0x0011, 0x03c8, 0x0010, 0x000f, 0x0000, 0xffb6,
-	0x0011, 0xb6e8, 0x0000, 0x0001, 0x0013, 0x1499, 0x0011, 0xb6e8,
-	0x0000, 0x0002, 0x0013, 0x14bb, 0x0011, 0xb6e8, 0x0010, 0x0003,
-	0x0003, 0x15a6, 0x0004, 0x07b6, 0x0013, 0x0404, 0x0010, 0x0bfe,
-	0x0013, 0x6404, 0x0010, 0x0b0d, 0x0005, 0x0002, 0x0000, 0x0002,
-	0x0014, 0x0405, 0x0015, 0x0030, 0x0000, 0x0400, 0x0011, 0x0d88,
-	0x0000, 0x0004, 0x0000, 0xff31, 0x0015, 0x0033, 0x0000, 0xba09,
-	0x000b, 0x83b0, 0x0000, 0xb930, 0x0005, 0x0031, 0x0010, 0x0021,
-	0x0015, 0x0033, 0x0000, 0xb009, 0x000b, 0x83b6, 0x0001, 0xb0a8,
-	0x0000, 0x199a, 0x0013, 0x23bc, 0x0005, 0x00b0, 0x0000, 0x1999,
-	0x0012, 0xb050, 0x0000, 0xffb0, 0x0002, 0xff50, 0x0002, 0xff50,
-	0x0001, 0xb080, 0x0000, 0xffb0, 0x0015, 0x0030, 0x0000, 0x0400,
-	0x0011, 0x0d88, 0x0010, 0x0006, 0x0000, 0xff31, 0x0015, 0x0033,
-	0x0000, 0xb00a, 0x001b, 0x83c9, 0x0000, 0xb930, 0x0005, 0x0031,
-	0x0000, 0x0019, 0x0015, 0x0033, 0x0000, 0xb009, 0x001b, 0x83cf,
-	0x0001, 0xb0c8, 0x0010, 0x00ff, 0x0001, 0xffe8, 0x0010, 0x0048,
-	0x000b, 0x1414, 0x0005, 0x0002, 0x0010, 0x0006, 0x0012, 0x0c10,
-	0x0010, 0xff0c, 0x0015, 0x0030, 0x0000, 0x0400, 0x0011, 0x0d88,
-	0x0010, 0x0003, 0x0000, 0xff31, 0x0015, 0x0033, 0x0010, 0xb109,
-	0x000b, 0x83e0, 0x0000, 0xb10b, 0x000b, 0x63e4, 0x0010, 0xb10a,
-	0x0015, 0x0033, 0x0010, 0xc00a, 0x000b, 0x83e6, 0x0002, 0x032b,
-	0x0010, 0xff03, 0x0011, 0x0d88, 0x0010, 0x0011, 0x0000, 0xff31,
-	0x0015, 0x0033, 0x0010, 0x030a, 0x001b, 0x83ee, 0x0000, 0x11fe,
-	0x000b, 0x63f3, 0x0000, 0x0d12, 0x0013, 0x03fc, 0x0015, 0x0030,
-	0x0000, 0x0400, 0x0001, 0x1188, 0x0010, 0x0003, 0x0000, 0xff31,
-	0x0010, 0x0db0, 0x0015, 0x0033, 0x0000, 0xb00a, 0x000b, 0x83fb,
-	0x0000, 0x0d11, 0x0013, 0x0404, 0x0000, 0x05fe, 0x0013, 0x6404,
-	0x0005, 0x0002, 0x0000, 0x0004, 0x0000, 0x050d, 0x0004, 0x07b6,
-	0x0013, 0x0047, 0x0015, 0x0030, 0x0000, 0x0400, 0x0011, 0x0d88,
-	0x0010, 0x0011, 0x0000, 0xff31, 0x0015, 0x0033, 0x0010, 0x0309,
-	0x000b, 0x840c, 0x0011, 0x0d88, 0x0010, 0x0005, 0x0000, 0xff31,
-	0x0015, 0x0033, 0x0000, 0xb909, 0x000b, 0x8412, 0x0017, 0x4000,
-	0x0005, 0x00b6, 0x0010, 0x0600, 0x0014, 0x05d6, 0x0004, 0x0483,
-	0x0000, 0xb05a, 0x0000, 0xb15b, 0x0005, 0x0054, 0x0010, 0x0829,
-	0x0010, 0x0d58, 0x0015, 0x0059, 0x0010, 0xffff, 0x0000, 0xb930,
-	0x0005, 0x0031, 0x0010, 0x001e, 0x0015, 0x0033, 0x0000, 0xb009,
-	0x000b, 0x8424, 0x0000, 0xb05c, 0x0005, 0x0031, 0x0000, 0x001f,
-	0x0015, 0x0033, 0x0000, 0xb009, 0x001b, 0x842a, 0x0001, 0xb0c8,
-	0x0010, 0x000f, 0x001b, 0x1431, 0x0015, 0x00ff, 0x0010, 0x0005,
-	0x0003, 0x0439, 0x0002, 0xb040, 0x0013, 0x1436, 0x0015, 0x00ff,
-	0x0000, 0x0004, 0x0003, 0x0439, 0x0001, 0xb0c8, 0x0010, 0x0006,
-	0x0002, 0xff60, 0x0010, 0xffb2, 0x0011, 0x0d88, 0x0000, 0x0019,
-	0x0000, 0xff31, 0x0015, 0x0033, 0x0010, 0xb109, 0x000b, 0x843f,
-	0x0012, 0xb170, 0x0011, 0xffc8, 0x0010, 0xff00, 0x0011, 0xb2d0,
-	0x0010, 0xff60, 0x0002, 0xb045, 0x0003, 0x144a, 0x0015, 0x00b2,
-	0x0000, 0x0002, 0x0013, 0x0454, 0x0002, 0xb046, 0x0003, 0x144f,
-	0x0015, 0x00b2, 0x0000, 0x0001, 0x0013, 0x0454, 0x0015, 0x00b2,
-	0x0010, 0x0000, 0x0000, 0xc0b0, 0x0010, 0xc0b1, 0x0003, 0x045a,
-	0x0000, 0xb930, 0x0005, 0x0031, 0x0010, 0x002b, 0x0015, 0x0033,
-	0x0000, 0xb011, 0x000b, 0x8459, 0x0010, 0xb16a, 0x0010, 0xb06b,
-	0x0000, 0xb261, 0x0015, 0x0044, 0x0010, 0x0018, 0x0005, 0x0031,
-	0x0000, 0x0023, 0x0015, 0x0033, 0x0000, 0x6241, 0x000b, 0x8463,
-	0x0013, 0x9464, 0x0015, 0x00a0, 0x0000, 0x0020, 0x0012, 0xd041,
-	0x001b, 0x1467, 0x0015, 0x00d1, 0x0010, 0x0202, 0x0013, 0x946b,
-	0x0000, 0x75ff, 0x0011, 0xffc8, 0x0000, 0x1804, 0x0001, 0xffd8,
-	0x0010, 0x0009, 0x0003, 0x9471, 0x0000, 0xff75, 0x0013, 0x9473,
-	0x0015, 0x00d1, 0x0000, 0x0200, 0x0015, 0x0030, 0x0000, 0x0400,
-	0x0001, 0xbd88, 0x0000, 0x0008, 0x0000, 0xff31, 0x0015, 0x00b1,
-	0x0010, 0x07d0, 0x0005, 0x00b0, 0x0010, 0x0009, 0x0015, 0x0033,
-	0x0000, 0xb012, 0x000b, 0x8481, 0x0013, 0x0404, 0x0000, 0xba30,
-	0x0005, 0x0031, 0x0000, 0x0031, 0x0015, 0x0033, 0x0000, 0xb009,
-	0x000b, 0x8488, 0x0002, 0xb040, 0x0013, 0x1496, 0x0000, 0xb7b0,
-	0x0000, 0xb9b1, 0x0015, 0x0030, 0x0000, 0x0400, 0x0011, 0x0d88,
-	0x0000, 0x0013, 0x0000, 0xff31, 0x0015, 0x0033, 0x0000, 0xb012,
-	0x001b, 0x8494, 0x0013, 0x0498, 0x0010, 0xc0b1, 0x0000, 0xc0b0,
-	0x0017, 0x4000, 0x0005, 0x00b6, 0x0010, 0x0500, 0x0014, 0x05d6,
-	0x0005, 0x0054, 0x0010, 0x0889, 0x0015, 0x0030, 0x0000, 0x0400,
-	0x0011, 0x0d88, 0x0000, 0x0002, 0x0000, 0xff31, 0x0015, 0x0033,
-	0x0000, 0xb009, 0x000b, 0x84a5, 0x0010, 0xb058, 0x0000, 0x0d59,
+	0x0003, 0x0144, 0x0012, 0x7849, 0x0003, 0x11cb, 0x0003, 0x0144,
+	0x0000, 0x0db8, 0x0012, 0x0345, 0x000b, 0x11c6, 0x0002, 0x033f,
+	0x0014, 0x0385, 0x0003, 0x0142, 0x0002, 0x033f, 0x0002, 0xff27,
+	0x0014, 0x0385, 0x0014, 0x0817, 0x0003, 0x0142, 0x0015, 0x00b8,
+	0x0000, 0x0001, 0x0015, 0x003a, 0x0010, 0x0101, 0x0014, 0x0817,
+	0x0003, 0x0153, 0x0001, 0x2bd8, 0x0010, 0x0000, 0x0000, 0xffba,
+	0x0013, 0xb1d4, 0x0005, 0x002a, 0x0000, 0x0002, 0x0001, 0xbac8,
+	0x0000, 0x0700, 0x001b, 0x12c1, 0x0011, 0x15e8, 0x0000, 0x0002,
+	0x0003, 0x1237, 0x0011, 0x15e8, 0x0000, 0x0001, 0x0003, 0x11e3,
+	0x0005, 0x0015, 0x0010, 0x0000, 0x0013, 0x021a, 0x0005, 0x0015,
+	0x0010, 0x0000, 0x0002, 0xba43, 0x0013, 0x121b, 0x0013, 0xb1e7,
+	0x0005, 0x002a, 0x0000, 0x0004, 0x0012, 0xba42, 0x0013, 0x1221,
+	0x0012, 0x104b, 0x001b, 0x121a, 0x0000, 0x1a30, 0x0005, 0x0031,
+	0x0000, 0x0002, 0x0015, 0x0033, 0x0000, 0x1b2a, 0x000b, 0x81f3,
+	0x0011, 0x20d8, 0x0010, 0x0000, 0x0000, 0xffb0, 0x0001, 0x21d8,
+	0x0010, 0x0000, 0x0010, 0xffb1, 0x0001, 0x22d8, 0x0010, 0x0000,
+	0x0010, 0xffb2, 0x0011, 0x23d8, 0x0010, 0x0000, 0x0000, 0xffb3,
+	0x0001, 0x24d8, 0x0010, 0x0000, 0x0010, 0xffb4, 0x0011, 0x25d8,
+	0x0010, 0x0000, 0x0000, 0xffb5, 0x0001, 0x28d8, 0x0010, 0x0000,
+	0x0010, 0xffb8, 0x0011, 0x29d8, 0x0010, 0x0000, 0x0000, 0xffb9,
+	0x0000, 0x1a30, 0x0005, 0x0031, 0x0000, 0x0007, 0x0015, 0x0033,
+	0x0010, 0xb032, 0x000b, 0x8211, 0x0000, 0x1a30, 0x0005, 0x0031,
+	0x0010, 0x000f, 0x0015, 0x0033, 0x0010, 0xb812, 0x000b, 0x8217,
+	0x0005, 0x0015, 0x0010, 0x0000, 0x0013, 0x0035, 0x0000, 0x1efe,
+	0x0013, 0x622f, 0x0014, 0x0266, 0x0000, 0x1efe, 0x000c, 0x6266,
+	0x0013, 0x021a, 0x0000, 0x1a30, 0x0005, 0x0031, 0x0000, 0x0020,
+	0x0015, 0x0033, 0x0000, 0xb009, 0x001b, 0x8226, 0x0002, 0xb02f,
+	0x0000, 0xffb0, 0x0005, 0x0031, 0x0000, 0x0020, 0x0015, 0x0033,
+	0x0000, 0xb00a, 0x000b, 0x822d, 0x0003, 0x01ee, 0x0015, 0x00b8,
+	0x0010, 0x0005, 0x0014, 0x0817, 0x0000, 0x13b8, 0x0015, 0x003a,
+	0x0010, 0x0404, 0x0014, 0x0817, 0x0013, 0x021a, 0x0005, 0x0015,
+	0x0000, 0x0001, 0x0012, 0xba42, 0x0003, 0x1245, 0x0003, 0xb23b,
+	0x0001, 0x2bd8, 0x0010, 0x0000, 0x0012, 0xff4f, 0x000b, 0x11d1,
+	0x0002, 0xba43, 0x000b, 0x1221, 0x0000, 0x1efe, 0x000c, 0x6266,
+	0x0013, 0x021a, 0x0001, 0x28d8, 0x0010, 0x0000, 0x0010, 0xffb8,
+	0x0011, 0x29d8, 0x0010, 0x0000, 0x0000, 0xffb9, 0x0014, 0x02d7,
+	0x0002, 0x3a42, 0x001b, 0x121a, 0x0000, 0x1c30, 0x0015, 0x00ff,
+	0x0000, 0x0002, 0x0002, 0x1f43, 0x000b, 0x1256, 0x0001, 0xff88,
+	0x0000, 0x0002, 0x0013, 0x0258, 0x0001, 0xff88, 0x0000, 0x0004,
+	0x0000, 0xff31, 0x0015, 0x0033, 0x0000, 0xb011, 0x001b, 0x825b,
+	0x0000, 0xb0ff, 0x0011, 0x16a0, 0x0000, 0xff16, 0x000b, 0x24e2,
+	0x0002, 0xb100, 0x0003, 0x0263, 0x0010, 0xb1ff, 0x0001, 0x17a0,
+	0x0010, 0xff17, 0x0003, 0x0221, 0x0000, 0x16ff, 0x0001, 0x18a0,
+	0x0010, 0xff00, 0x001b, 0x226d, 0x0002, 0x1700, 0x0013, 0x12c0,
+	0x0013, 0x026e, 0x0010, 0x17ff, 0x0011, 0x19a0, 0x0013, 0x22c0,
+	0x0011, 0x00d0, 0x0013, 0x12c0, 0x0000, 0x1c30, 0x0000, 0x1b31,
+	0x0015, 0x0033, 0x0000, 0xb131, 0x001b, 0x8276, 0x0013, 0xb277,
+	0x0000, 0xb120, 0x0010, 0xb221, 0x0002, 0x1f43, 0x001b, 0x1283,
+	0x0010, 0xc022, 0x0000, 0xc023, 0x0000, 0xb324, 0x0000, 0xb425,
+	0x0010, 0xb3b5, 0x0000, 0xb4b6, 0x0003, 0x0287, 0x0000, 0xb322,
+	0x0000, 0xb423, 0x0000, 0xb524, 0x0010, 0xb625, 0x0013, 0xb287,
+	0x0005, 0x002a, 0x0000, 0x0001, 0x0012, 0x1500, 0x0000, 0xff15,
+	0x0000, 0x16ff, 0x0001, 0xb580, 0x0000, 0xff16, 0x001b, 0x2292,
+	0x0002, 0x1700, 0x0003, 0x0293, 0x0010, 0x17ff, 0x0001, 0xb680,
+	0x0010, 0xff17, 0x0012, 0x1e10, 0x0010, 0xff1e, 0x0003, 0x62c0,
+	0x0002, 0x1d00, 0x0010, 0xff1d, 0x0010, 0xc030, 0x0000, 0xff31,
+	0x0015, 0x0033, 0x0000, 0xb009, 0x001b, 0x829e, 0x0010, 0xb0fe,
+	0x000b, 0x62bf, 0x0000, 0x1c30, 0x0005, 0x0031, 0x0000, 0x0001,
+	0x0015, 0x0033, 0x0000, 0xb009, 0x000b, 0x82a6, 0x0010, 0xb0fe,
+	0x001b, 0x62ac, 0x0005, 0x00ce, 0x0010, 0x0005, 0x0013, 0x07d9,
+	0x0010, 0xb01c, 0x0000, 0x1c30, 0x0005, 0x0031, 0x0000, 0x0019,
+	0x0015, 0x0033, 0x0000, 0xb009, 0x000b, 0x82b2, 0x0001, 0xb0c8,
+	0x0010, 0x00ff, 0x0000, 0xff1f, 0x0010, 0xc030, 0x0011, 0xbe80,
+	0x0000, 0xff31, 0x0015, 0x0033, 0x0000, 0xb009, 0x000b, 0x82bb,
+	0x0000, 0xb01d, 0x0010, 0x1dff, 0x0003, 0x029a, 0x0000, 0xb01b,
+	0x0017, 0x4000, 0x0002, 0x3a41, 0x0013, 0x12c9, 0x0013, 0xb2c3,
+	0x0005, 0x002a, 0x0000, 0x0004, 0x0005, 0x0015, 0x0010, 0x0000,
+	0x0013, 0x021a, 0x0000, 0x1a30, 0x0005, 0x0031, 0x0000, 0x0002,
+	0x0015, 0x0033, 0x0000, 0x1b2a, 0x001b, 0x82ce, 0x0015, 0x00b8,
+	0x0000, 0x0004, 0x0014, 0x0817, 0x0000, 0x13b8, 0x0015, 0x003a,
+	0x0010, 0x0404, 0x0014, 0x0817, 0x0013, 0x0039, 0x0002, 0x1e00,
+	0x0010, 0xff1e, 0x0012, 0x1d10, 0x0010, 0xff1d, 0x0010, 0xc030,
+	0x0000, 0xff31, 0x0015, 0x0033, 0x0000, 0xb009, 0x001b, 0x82df,
+	0x0010, 0xb0fe, 0x001b, 0x6304, 0x0000, 0x1cff, 0x0001, 0x1ae0,
+	0x0013, 0x12ee, 0x0000, 0x1c30, 0x0005, 0x0031, 0x0010, 0x0000,
+	0x0015, 0x0033, 0x0000, 0xb009, 0x001b, 0x82ea, 0x0010, 0xb0fe,
+	0x001b, 0x62ee, 0x0000, 0x1aff, 0x0000, 0xff1c, 0x0000, 0x1c30,
+	0x0005, 0x0031, 0x0000, 0x0019, 0x0015, 0x0033, 0x0000, 0xb009,
+	0x001b, 0x82f4, 0x0001, 0xb0c8, 0x0010, 0x000f, 0x0000, 0xff1f,
+	0x0001, 0xbf80, 0x0010, 0xff1d, 0x0010, 0xc030, 0x0000, 0xff31,
+	0x0015, 0x0033, 0x0000, 0xb009, 0x001b, 0x82fe, 0x0010, 0xb0fe,
+	0x001b, 0x6304, 0x0005, 0x00ce, 0x0010, 0x0006, 0x0013, 0x07d9,
+	0x0000, 0xb01b, 0x0017, 0x4000, 0x0010, 0x79b0, 0x0000, 0xd0ff,
+	0x0012, 0xff40, 0x001b, 0x1039, 0x0015, 0x00d1, 0x0010, 0x0101,
+	0x0013, 0x930c, 0x0005, 0x0079, 0x0000, 0x0002, 0x0013, 0x930f,
+	0x0015, 0x00d1, 0x0000, 0x0100, 0x0010, 0x13fe, 0x0013, 0x6344,
+	0x0012, 0xb04e, 0x000b, 0x135d, 0x0012, 0x784a, 0x0003, 0x1363,
+	0x0000, 0x75ff, 0x0011, 0xffc8, 0x0010, 0x1800, 0x001b, 0x1363,
+	0x0001, 0x0fe8, 0x0000, 0x0001, 0x001b, 0x1328, 0x0015, 0x0030,
+	0x0000, 0x0400, 0x0011, 0x1388, 0x0000, 0x000e, 0x0000, 0xff31,
+	0x0015, 0x0033, 0x0000, 0x8f0a, 0x000b, 0x8326, 0x0013, 0x0369,
+	0x0001, 0x0fe8, 0x0000, 0x0002, 0x001b, 0x1333, 0x0015, 0x0030,
+	0x0000, 0x0400, 0x0005, 0x0031, 0x0000, 0x001a, 0x0015, 0x0033,
+	0x0010, 0xc00a, 0x000b, 0x8331, 0x0013, 0x0369, 0x0001, 0x0fe8,
+	0x0010, 0x0000, 0x0003, 0x133a, 0x0005, 0x00ce, 0x0000, 0x0007,
+	0x0010, 0x0fcf, 0x0013, 0x07d3, 0x0000, 0x13b8, 0x0002, 0x1045,
+	0x0003, 0x1342, 0x0012, 0x103f, 0x0002, 0xff27, 0x0014, 0x0385,
+	0x0014, 0x0817, 0x0013, 0x0344, 0x0012, 0x103f, 0x0014, 0x0385,
+	0x0015, 0x000f, 0x0010, 0x0000, 0x0002, 0x3944, 0x0003, 0x134d,
+	0x0015, 0x0039, 0x0000, 0x5040, 0x0015, 0x00b8, 0x0000, 0x0008,
+	0x0014, 0x0817, 0x0015, 0x0030, 0x0000, 0x0400, 0x0001, 0xbd88,
+	0x0010, 0x000c, 0x0000, 0xff31, 0x0015, 0x0033, 0x0010, 0xc00a,
+	0x000b, 0x8354, 0x0000, 0xff31, 0x0015, 0x0033, 0x0010, 0xc00a,
+	0x000b, 0x8358, 0x0010, 0xc014, 0x0000, 0xc013, 0x0000, 0xc010,
+	0x0013, 0x0039, 0x0015, 0x00b8, 0x0010, 0x0003, 0x0015, 0x003a,
+	0x0010, 0x0202, 0x0014, 0x0817, 0x0013, 0x035c, 0x0015, 0x00b8,
+	0x0000, 0x0002, 0x0015, 0x003a, 0x0010, 0x0202, 0x0014, 0x0817,
+	0x0013, 0x035c, 0x0015, 0x0030, 0x0000, 0x0400, 0x0011, 0x1388,
+	0x0010, 0x0003, 0x0000, 0xff31, 0x0015, 0x0033, 0x0000, 0xb009,
+	0x000b, 0x8370, 0x0011, 0x1388, 0x0010, 0x0003, 0x0000, 0xff31,
+	0x0015, 0x0033, 0x0010, 0xc00a, 0x000b, 0x8376, 0x0010, 0xb0fe,
+	0x0013, 0x637b, 0x0000, 0xb012, 0x0013, 0x037d, 0x0010, 0xc012,
+	0x0010, 0xc011, 0x0012, 0x104b, 0x0003, 0x133a, 0x0002, 0x103b,
+	0x0010, 0xff03, 0x0005, 0x0002, 0x0010, 0x0000, 0x0000, 0xc00d,
+	0x0013, 0x033a, 0x0000, 0xffb0, 0x0010, 0xc3b1, 0x0015, 0x0030,
+	0x0000, 0x0400, 0x0001, 0xb888, 0x0010, 0x0011, 0x0000, 0xff31,
+	0x0015, 0x0033, 0x0000, 0xb012, 0x001b, 0x838e, 0x0017, 0x4000,
+	0x0012, 0x3a43, 0x0003, 0x139f, 0x0015, 0x003a, 0x0000, 0x0800,
+	0x0010, 0x0db0, 0x0013, 0x639f, 0x0000, 0x0bff, 0x0001, 0xb0e0,
+	0x0003, 0x13c5, 0x0010, 0x09ff, 0x0001, 0xb0e0, 0x0003, 0x13a9,
+	0x0010, 0x05ff, 0x0001, 0xb0e0, 0x0003, 0x13a3, 0x0000, 0xc00e,
+	0x0000, 0x05fe, 0x0013, 0x63a6, 0x0000, 0x050d, 0x0005, 0x0002,
+	0x0000, 0x0004, 0x0013, 0x03c0, 0x0000, 0x09fe, 0x0003, 0x63c2,
+	0x0000, 0x090d, 0x0005, 0x0002, 0x0000, 0x0001, 0x0014, 0x0424,
+	0x0015, 0x0030, 0x0000, 0x0400, 0x0011, 0x0d88, 0x0000, 0x0004,
+	0x0000, 0xff31, 0x0015, 0x0033, 0x0000, 0xba09, 0x000b, 0x83b3,
+	0x0011, 0x03c8, 0x0010, 0x000f, 0x0000, 0xffb6, 0x0011, 0xb6e8,
+	0x0000, 0x0001, 0x0013, 0x14bb, 0x0011, 0xb6e8, 0x0000, 0x0002,
+	0x0013, 0x14dd, 0x0011, 0xb6e8, 0x0010, 0x0003, 0x0003, 0x15cc,
+	0x0014, 0x07de, 0x0013, 0x0423, 0x0010, 0x0bfe, 0x0013, 0x6423,
+	0x0010, 0x0b0d, 0x0005, 0x0002, 0x0000, 0x0002, 0x0014, 0x0424,
+	0x0015, 0x0030, 0x0000, 0x0400, 0x0011, 0x0d88, 0x0000, 0x0004,
+	0x0000, 0xff31, 0x0015, 0x0033, 0x0000, 0xba09, 0x001b, 0x83cf,
+	0x0000, 0xb930, 0x0005, 0x0031, 0x0010, 0x0021, 0x0015, 0x0033,
+	0x0000, 0xb009, 0x000b, 0x83d5, 0x0001, 0xb0a8, 0x0000, 0x199a,
+	0x0003, 0x23db, 0x0005, 0x00b0, 0x0000, 0x1999, 0x0012, 0xb050,
+	0x0000, 0xffb0, 0x0002, 0xff50, 0x0002, 0xff50, 0x0001, 0xb080,
+	0x0000, 0xffb0, 0x0015, 0x0030, 0x0000, 0x0400, 0x0011, 0x0d88,
+	0x0010, 0x0006, 0x0000, 0xff31, 0x0015, 0x0033, 0x0000, 0xb00a,
+	0x001b, 0x83e8, 0x0000, 0xb930, 0x0005, 0x0031, 0x0000, 0x0019,
+	0x0015, 0x0033, 0x0000, 0xb009, 0x001b, 0x83ee, 0x0001, 0xb0c8,
+	0x0010, 0x00ff, 0x0001, 0xffe8, 0x0010, 0x0048, 0x000b, 0x1433,
+	0x0005, 0x0002, 0x0010, 0x0006, 0x0012, 0x0c10, 0x0010, 0xff0c,
+	0x0015, 0x0030, 0x0000, 0x0400, 0x0011, 0x0d88, 0x0010, 0x0003,
+	0x0000, 0xff31, 0x0015, 0x0033, 0x0010, 0xb109, 0x001b, 0x83ff,
+	0x0000, 0xb10b, 0x001b, 0x6403, 0x0010, 0xb10a, 0x0015, 0x0033,
+	0x0010, 0xc00a, 0x000b, 0x8405, 0x0002, 0x032b, 0x0010, 0xff03,
+	0x0011, 0x0d88, 0x0010, 0x0011, 0x0000, 0xff31, 0x0015, 0x0033,
+	0x0010, 0x030a, 0x001b, 0x840d, 0x0000, 0x11fe, 0x001b, 0x6412,
+	0x0000, 0x0d12, 0x0003, 0x041b, 0x0015, 0x0030, 0x0000, 0x0400,
+	0x0001, 0x1188, 0x0010, 0x0003, 0x0000, 0xff31, 0x0010, 0x0db0,
+	0x0015, 0x0033, 0x0000, 0xb00a, 0x001b, 0x841a, 0x0000, 0x0d11,
+	0x0013, 0x0423, 0x0000, 0x05fe, 0x0013, 0x6423, 0x0005, 0x0002,
+	0x0000, 0x0004, 0x0000, 0x050d, 0x0014, 0x07de, 0x0013, 0x0047,
+	0x0015, 0x0030, 0x0000, 0x0400, 0x0011, 0x0d88, 0x0010, 0x0011,
+	0x0000, 0xff31, 0x0015, 0x0033, 0x0010, 0x0309, 0x000b, 0x842b,
+	0x0011, 0x0d88, 0x0010, 0x0005, 0x0000, 0xff31, 0x0015, 0x0033,
+	0x0000, 0xb909, 0x001b, 0x8431, 0x0017, 0x4000, 0x0005, 0x00b6,
+	0x0010, 0x0600, 0x0004, 0x05fc, 0x0014, 0x04a5, 0x0000, 0xb05a,
+	0x0000, 0xb15b, 0x0005, 0x0054, 0x0010, 0x0829, 0x0010, 0x0d58,
+	0x0015, 0x0059, 0x0010, 0xffff, 0x0000, 0xb930, 0x0005, 0x0031,
+	0x0010, 0x001e, 0x0015, 0x0033, 0x0000, 0xb009, 0x001b, 0x8443,
+	0x0000, 0xb05c, 0x0005, 0x0031, 0x0000, 0x001f, 0x0015, 0x0033,
+	0x0000, 0xb009, 0x001b, 0x8449, 0x0001, 0xb0c8, 0x0010, 0x000f,
+	0x000b, 0x1450, 0x0015, 0x00ff, 0x0010, 0x0005, 0x0013, 0x0458,
+	0x0002, 0xb040, 0x0013, 0x1455, 0x0015, 0x00ff, 0x0000, 0x0004,
+	0x0013, 0x0458, 0x0001, 0xb0c8, 0x0010, 0x0006, 0x0002, 0xff60,
+	0x0010, 0xffb2, 0x0015, 0x0030, 0x0000, 0x0400, 0x0011, 0x0d88,
+	0x0000, 0x0019, 0x0000, 0xff31, 0x0015, 0x0033, 0x0010, 0xb109,
+	0x000b, 0x8460, 0x0012, 0xb170, 0x0011, 0xffc8, 0x0010, 0xff00,
+	0x0011, 0xb2d0, 0x0010, 0xff60, 0x0002, 0xb045, 0x0003, 0x146b,
+	0x0015, 0x00b2, 0x0000, 0x0002, 0x0013, 0x0475, 0x0002, 0xb046,
+	0x0003, 0x1470, 0x0015, 0x00b2, 0x0000, 0x0001, 0x0013, 0x0475,
+	0x0015, 0x00b2, 0x0010, 0x0000, 0x0000, 0xc0b0, 0x0010, 0xc0b1,
+	0x0003, 0x047b, 0x0000, 0xb930, 0x0005, 0x0031, 0x0010, 0x002b,
+	0x0015, 0x0033, 0x0000, 0xb011, 0x001b, 0x847a, 0x0010, 0xb16a,
+	0x0010, 0xb06b, 0x0000, 0xb261, 0x0015, 0x0044, 0x0010, 0x0018,
 	0x0000, 0xb930, 0x0005, 0x0031, 0x0000, 0x0023, 0x0015, 0x0033,
-	0x0000, 0xb011, 0x001b, 0x84ad, 0x0010, 0xb15c, 0x0010, 0xb05d,
-	0x0005, 0x0031, 0x0010, 0x002b, 0x0015, 0x0033, 0x0000, 0xb011,
-	0x000b, 0x84b4, 0x0000, 0xb15e, 0x0000, 0xb05f, 0x0003, 0x94b7,
-	0x0015, 0x00a0, 0x0010, 0x000c, 0x0013, 0x05bb, 0x0005, 0x00b6,
-	0x0000, 0x0700, 0x0014, 0x05d6, 0x0015, 0x0030, 0x0000, 0x0400,
-	0x0011, 0x0d88, 0x0010, 0x0009, 0x0000, 0xff31, 0x0015, 0x0033,
-	0x0010, 0xb709, 0x000b, 0x84c5, 0x0012, 0xb749, 0x0003, 0x14cb,
-	0x0005, 0x0054, 0x0010, 0x0889, 0x0013, 0x04cd, 0x0005, 0x0054,
-	0x0010, 0x0898, 0x0015, 0x0030, 0x0000, 0x0400, 0x0011, 0x0d88,
-	0x0000, 0x0002, 0x0000, 0xff31, 0x0015, 0x0033, 0x0000, 0xb009,
-	0x000b, 0x84d4, 0x0010, 0xb058, 0x0000, 0x0d59, 0x0001, 0xb9a8,
-	0x0010, 0x00f0, 0x000b, 0x24f9, 0x0011, 0x0d88, 0x0010, 0x0005,
-	0x0000, 0xff31, 0x0015, 0x0033, 0x0000, 0xb009, 0x001b, 0x84df,
+	0x0000, 0x6241, 0x001b, 0x8485, 0x0013, 0x9486, 0x0015, 0x00a0,
+	0x0000, 0x0020, 0x0012, 0xd041, 0x001b, 0x1489, 0x0015, 0x00d1,
+	0x0010, 0x0202, 0x0003, 0x948d, 0x0000, 0x75ff, 0x0011, 0xffc8,
+	0x0000, 0x1804, 0x0001, 0xffd8, 0x0010, 0x0009, 0x0003, 0x9493,
+	0x0000, 0xff75, 0x0003, 0x9495, 0x0015, 0x00d1, 0x0000, 0x0200,
+	0x0015, 0x0030, 0x0000, 0x0400, 0x0001, 0xbd88, 0x0000, 0x0008,
+	0x0000, 0xff31, 0x0015, 0x00b1, 0x0010, 0x07d0, 0x0005, 0x00b0,
+	0x0010, 0x0009, 0x0015, 0x0033, 0x0000, 0xb012, 0x000b, 0x84a3,
+	0x0013, 0x0423, 0x0000, 0xba30, 0x0005, 0x0031, 0x0000, 0x0031,
+	0x0015, 0x0033, 0x0000, 0xb009, 0x000b, 0x84aa, 0x0002, 0xb040,
+	0x0013, 0x14b8, 0x0000, 0xb7b0, 0x0000, 0xb9b1, 0x0015, 0x0030,
+	0x0000, 0x0400, 0x0011, 0x0d88, 0x0000, 0x0013, 0x0000, 0xff31,
+	0x0015, 0x0033, 0x0000, 0xb012, 0x001b, 0x84b6, 0x0013, 0x04ba,
+	0x0010, 0xc0b1, 0x0000, 0xc0b0, 0x0017, 0x4000, 0x0005, 0x00b6,
+	0x0010, 0x0500, 0x0004, 0x05fc, 0x0005, 0x0054, 0x0010, 0x0889,
+	0x0015, 0x0030, 0x0000, 0x0400, 0x0011, 0x0d88, 0x0000, 0x0002,
+	0x0000, 0xff31, 0x0015, 0x0033, 0x0000, 0xb009, 0x001b, 0x84c7,
+	0x0010, 0xb058, 0x0000, 0x0d59, 0x0000, 0xb930, 0x0005, 0x0031,
+	0x0000, 0x0023, 0x0015, 0x0033, 0x0000, 0xb011, 0x000b, 0x84cf,
+	0x0010, 0xb15c, 0x0010, 0xb05d, 0x0005, 0x0031, 0x0010, 0x002b,
+	0x0015, 0x0033, 0x0000, 0xb011, 0x001b, 0x84d6, 0x0000, 0xb15e,
+	0x0000, 0xb05f, 0x0013, 0x94d9, 0x0015, 0x00a0, 0x0010, 0x000c,
+	0x0013, 0x05e1, 0x0005, 0x00b6, 0x0000, 0x0700, 0x0004, 0x05fc,
+	0x0015, 0x0030, 0x0000, 0x0400, 0x0011, 0x0d88, 0x0010, 0x0009,
+	0x0000, 0xff31, 0x0015, 0x0033, 0x0010, 0xb709, 0x000b, 0x84e7,
+	0x0012, 0xb749, 0x0013, 0x14ed, 0x0005, 0x0054, 0x0010, 0x0889,
+	0x0013, 0x04ef, 0x0005, 0x0054, 0x0010, 0x0898, 0x0015, 0x0030,
+	0x0000, 0x0400, 0x0011, 0x0d88, 0x0000, 0x0002, 0x0000, 0xff31,
+	0x0015, 0x0033, 0x0000, 0xb009, 0x000b, 0x84f6, 0x0010, 0xb058,
+	0x0000, 0x0d59, 0x0001, 0xb9a8, 0x0010, 0x00f0, 0x001b, 0x251d,
+	0x0015, 0x0030, 0x0000, 0x0400, 0x0011, 0x0d88, 0x0010, 0x0005,
+	0x0000, 0xff31, 0x0015, 0x0033, 0x0000, 0xb009, 0x001b, 0x8503,
 	0x0001, 0xb0c8, 0x0000, 0xf700, 0x0000, 0xffb0, 0x0011, 0xb0e8,
-	0x0000, 0xf100, 0x0013, 0x1540, 0x0011, 0xb0e8, 0x0000, 0xf200,
-	0x0013, 0x1545, 0x0011, 0xb0e8, 0x0010, 0xf300, 0x0013, 0x1568,
-	0x0011, 0xb0e8, 0x0000, 0xf400, 0x0013, 0x156d, 0x0011, 0xb0e8,
-	0x0010, 0xf500, 0x0013, 0x1540, 0x0011, 0xb0e8, 0x0010, 0xf600,
-	0x0003, 0x157e, 0x0005, 0x00ce, 0x0010, 0x0009, 0x0000, 0xb0cf,
-	0x0013, 0x07ab, 0x0000, 0xb930, 0x0005, 0x0031, 0x0000, 0x0025,
-	0x0015, 0x0033, 0x0000, 0xb039, 0x001b, 0x84fe, 0x0012, 0xb749,
-	0x0003, 0x1503, 0x0002, 0xb52c, 0x0000, 0xffb5, 0x0000, 0xb162,
+	0x0000, 0xf100, 0x0013, 0x1564, 0x0011, 0xb0e8, 0x0000, 0xf200,
+	0x0003, 0x1569, 0x0011, 0xb0e8, 0x0010, 0xf300, 0x0003, 0x158e,
+	0x0011, 0xb0e8, 0x0000, 0xf400, 0x0003, 0x1593, 0x0011, 0xb0e8,
+	0x0010, 0xf500, 0x0013, 0x1564, 0x0011, 0xb0e8, 0x0010, 0xf600,
+	0x0013, 0x15a4, 0x0005, 0x00ce, 0x0010, 0x0009, 0x0000, 0xb0cf,
+	0x0013, 0x07d3, 0x0000, 0xb930, 0x0005, 0x0031, 0x0000, 0x0025,
+	0x0015, 0x0033, 0x0000, 0xb039, 0x001b, 0x8522, 0x0012, 0xb749,
+	0x0003, 0x1527, 0x0002, 0xb52c, 0x0000, 0xffb5, 0x0000, 0xb162,
 	0x0000, 0xb063, 0x0005, 0x0031, 0x0000, 0x001f, 0x0015, 0x0033,
-	0x0000, 0xb309, 0x001b, 0x8509, 0x0001, 0xb3c8, 0x0010, 0x0003,
-	0x0003, 0x1511, 0x0010, 0xffb2, 0x0001, 0xffe8, 0x0010, 0x0003,
-	0x000b, 0x1513, 0x0000, 0xc2b7, 0x0013, 0x059a, 0x0001, 0xb2e8,
-	0x0000, 0x0001, 0x0013, 0x151a, 0x0005, 0x00ce, 0x0010, 0x000a,
-	0x0010, 0xb2cf, 0x0013, 0x07ab, 0x0010, 0xb465, 0x0010, 0xb667,
+	0x0000, 0xb309, 0x001b, 0x852d, 0x0001, 0xb3c8, 0x0010, 0x0003,
+	0x0003, 0x1535, 0x0010, 0xffb2, 0x0001, 0xffe8, 0x0010, 0x0003,
+	0x000b, 0x1537, 0x0000, 0xc2b7, 0x0013, 0x05c0, 0x0001, 0xb2e8,
+	0x0000, 0x0001, 0x0013, 0x153e, 0x0005, 0x00ce, 0x0010, 0x000a,
+	0x0010, 0xb2cf, 0x0013, 0x07d3, 0x0010, 0xb465, 0x0010, 0xb667,
 	0x0015, 0x00b7, 0x0010, 0x0018, 0x0001, 0xb5c8, 0x0010, 0x0300,
-	0x0003, 0x153f, 0x0012, 0xb548, 0x0013, 0x1526, 0x0000, 0xb6ff,
-	0x0011, 0xb780, 0x0010, 0xffb7, 0x0002, 0xb549, 0x0003, 0x152b,
+	0x0003, 0x1563, 0x0012, 0xb548, 0x0013, 0x154a, 0x0000, 0xb6ff,
+	0x0011, 0xb780, 0x0010, 0xffb7, 0x0002, 0xb549, 0x0013, 0x154f,
 	0x0010, 0xb4ff, 0x0011, 0xb780, 0x0010, 0xffb7, 0x0015, 0x0044,
 	0x0010, 0x0018, 0x0005, 0x0031, 0x0000, 0x002c, 0x0015, 0x0033,
-	0x0000, 0x6841, 0x000b, 0x8531, 0x0015, 0x0044, 0x0000, 0x0019,
+	0x0000, 0x6841, 0x001b, 0x8555, 0x0015, 0x0044, 0x0000, 0x0019,
 	0x0005, 0x0031, 0x0000, 0x0034, 0x0015, 0x0033, 0x0000, 0x5029,
-	0x000b, 0x8538, 0x0015, 0x0044, 0x0000, 0x0008, 0x0011, 0xb7c8,
-	0x0010, 0x0003, 0x0003, 0x153f, 0x0010, 0xff55, 0x0013, 0x059a,
+	0x001b, 0x855c, 0x0015, 0x0044, 0x0000, 0x0008, 0x0011, 0xb7c8,
+	0x0010, 0x0003, 0x0003, 0x1563, 0x0010, 0xff55, 0x0013, 0x05c0,
 	0x0005, 0x00b5, 0x0000, 0x0008, 0x0015, 0x00b7, 0x0010, 0x0018,
-	0x0013, 0x059a, 0x0011, 0x0d88, 0x0000, 0x000b, 0x0000, 0xff31,
-	0x0015, 0x0033, 0x0000, 0xb011, 0x000b, 0x854a, 0x0010, 0xb1ff,
-	0x0001, 0xb0d0, 0x0003, 0x1553, 0x0005, 0x00b5, 0x0010, 0x0b02,
-	0x0010, 0xb062, 0x0010, 0xb163, 0x0013, 0x0555, 0x0005, 0x00b5,
-	0x0000, 0x0302, 0x0015, 0x0065, 0x0010, 0x0012, 0x0005, 0x0067,
-	0x0000, 0x0008, 0x0015, 0x006c, 0x0000, 0x7000, 0x0005, 0x006d,
-	0x0010, 0x0500, 0x0015, 0x006f, 0x0010, 0x000a, 0x0015, 0x0044,
-	0x0000, 0x0001, 0x0005, 0x0052, 0x0000, 0x2500, 0x0015, 0x0044,
-	0x0000, 0x0008, 0x0015, 0x00b7, 0x0000, 0x0032, 0x0013, 0x059a,
-	0x0005, 0x00b5, 0x0010, 0x0028, 0x0015, 0x00b7, 0x0010, 0x0018,
-	0x0013, 0x059a, 0x0005, 0x00b5, 0x0000, 0x0100, 0x0005, 0x0067,
-	0x0000, 0x0008, 0x0015, 0x0030, 0x0000, 0x0400, 0x0011, 0x0d88,
-	0x0010, 0x0018, 0x0000, 0xff31, 0x0015, 0x0033, 0x0000, 0xb009,
-	0x001b, 0x8578, 0x0001, 0xb0c8, 0x0010, 0x00ff, 0x0015, 0x00b7,
-	0x0000, 0x0020, 0x0013, 0x059a, 0x0015, 0x0030, 0x0000, 0x0400,
-	0x0011, 0x0d88, 0x0010, 0x0005, 0x0000, 0xff31, 0x0015, 0x0033,
-	0x0000, 0xb609, 0x000b, 0x8585, 0x0001, 0xb6c8, 0x0010, 0xff00,
-	0x0000, 0xffb0, 0x0015, 0x0033, 0x0000, 0xb00a, 0x001b, 0x858b,
-	0x0001, 0xb6c8, 0x0010, 0x00ff, 0x0012, 0xff10, 0x000b, 0x1594,
-	0x0000, 0xffb5, 0x0015, 0x00b7, 0x0010, 0x0018, 0x0013, 0x059a,
-	0x0010, 0xff63, 0x0005, 0x00b5, 0x0000, 0x0800, 0x0015, 0x00b7,
-	0x0010, 0x0018, 0x0013, 0x059a, 0x0015, 0x0030, 0x0000, 0x0400,
-	0x0011, 0x0d88, 0x0010, 0x0009, 0x0000, 0xff31, 0x0015, 0x0033,
-	0x0000, 0xb009, 0x000b, 0x85a1, 0x0010, 0xb561, 0x0013, 0x95a3,
-	0x0010, 0xb7a0, 0x0013, 0x05bb, 0x0005, 0x00b6, 0x0010, 0x0300,
-	0x0014, 0x05d6, 0x0005, 0x0054, 0x0010, 0x0819, 0x0010, 0x0d58,
-	0x0015, 0x0030, 0x0000, 0x0400, 0x0011, 0x0d88, 0x0000, 0x0002,
-	0x0000, 0xff31, 0x0015, 0x0033, 0x0000, 0xb009, 0x000b, 0x85b3,
-	0x0000, 0xb059, 0x0003, 0x95b5, 0x0010, 0xc0a0, 0x0010, 0x71ff,
-	0x0002, 0xff28, 0x0010, 0xff71, 0x0013, 0x05bb, 0x0012, 0xd041,
-	0x001b, 0x15bb, 0x0015, 0x00d1, 0x0010, 0x0202, 0x0000, 0x75ff,
-	0x0011, 0xffc8, 0x0000, 0x1804, 0x0001, 0xffd8, 0x0010, 0x0009,
-	0x0003, 0x95c4, 0x0000, 0xff75, 0x0013, 0x95c6, 0x0015, 0x00d1,
-	0x0000, 0x0200, 0x0015, 0x0030, 0x0000, 0x0400, 0x0001, 0xbd88,
-	0x0000, 0x0008, 0x0000, 0xff31, 0x0005, 0x00b0, 0x0010, 0x0009,
-	0x0015, 0x00b1, 0x0010, 0x07d0, 0x0015, 0x0033, 0x0000, 0xb012,
-	0x001b, 0x85d4, 0x0013, 0x0404, 0x0015, 0x0044, 0x0000, 0x0008,
-	0x0005, 0x0098, 0x0010, 0x0056, 0x0015, 0x0099, 0x0000, 0x9575,
-	0x0014, 0x0772, 0x0000, 0xb096, 0x0012, 0xb270, 0x0010, 0xff56,
-	0x0004, 0x0794, 0x0010, 0xb052, 0x0010, 0xb153, 0x0000, 0xb6ff,
-	0x0011, 0xb2d0, 0x0010, 0xff50, 0x0010, 0xb351, 0x0017, 0x4000,
-	0x0015, 0x0030, 0x0000, 0x0400, 0x0001, 0x1288, 0x0010, 0x0011,
-	0x0000, 0xff31, 0x0015, 0x0033, 0x0000, 0x1009, 0x000b, 0x85ef,
-	0x0015, 0x000f, 0x0000, 0x0001, 0x0010, 0xc014, 0x0000, 0x1213,
-	0x0015, 0x0030, 0x0000, 0x0400, 0x0011, 0x1388, 0x0000, 0x0004,
-	0x0000, 0xff31, 0x0015, 0x0033, 0x0000, 0xba09, 0x000b, 0x85fb,
-	0x0015, 0x0030, 0x0000, 0x0400, 0x0011, 0x1388, 0x0010, 0x0005,
-	0x0000, 0xff31, 0x0015, 0x0033, 0x0000, 0x1a09, 0x001b, 0x8603,
-	0x0012, 0x104b, 0x001b, 0x160c, 0x0000, 0x1a30, 0x0005, 0x0031,
-	0x0000, 0x000b, 0x0015, 0x0033, 0x0000, 0x1621, 0x000b, 0x860b,
-	0x0010, 0x15fe, 0x001b, 0x6615, 0x0004, 0x0633, 0x0002, 0x3a42,
-	0x000b, 0x1632, 0x0001, 0x10c8, 0x0010, 0x000f, 0x001b, 0x1695,
-	0x0003, 0x0631, 0x0015, 0x0030, 0x0000, 0x0400, 0x0011, 0x1388,
-	0x0010, 0x0003, 0x0000, 0xff31, 0x0015, 0x0033, 0x0000, 0xb009,
-	0x000b, 0x861c, 0x0015, 0x0033, 0x0010, 0xc00a, 0x000b, 0x861f,
-	0x0010, 0xb0fe, 0x0013, 0x6624, 0x0000, 0xb012, 0x0003, 0x0626,
-	0x0010, 0xc012, 0x0010, 0xc011, 0x0015, 0x000f, 0x0010, 0x0000,
-	0x0002, 0x3944, 0x0013, 0x162f, 0x0015, 0x0039, 0x0000, 0x5040,
-	0x0015, 0x00b8, 0x0000, 0x0008, 0x0014, 0x07ed, 0x0000, 0xc013,
-	0x0003, 0x0632, 0x0004, 0x07d9, 0x0003, 0x0051, 0x0003, 0xb633,
-	0x0005, 0x002a, 0x0000, 0x0004, 0x0000, 0xba30, 0x0005, 0x0031,
-	0x0010, 0x001b, 0x0015, 0x0033, 0x0000, 0xb009, 0x000b, 0x863b,
-	0x0000, 0xc02c, 0x0000, 0xb02d, 0x0012, 0x104b, 0x0003, 0x1656,
-	0x0000, 0x1a30, 0x0005, 0x0031, 0x0000, 0x0023, 0x0015, 0x0033,
-	0x0000, 0xb129, 0x000b, 0x8645, 0x0000, 0xb120, 0x0010, 0xb221,
-	0x0000, 0xb322, 0x0000, 0xb423, 0x0000, 0xb524, 0x0000, 0xc025,
-	0x0010, 0xb526, 0x0010, 0xc027, 0x0010, 0xb516, 0x0010, 0xc017,
-	0x0000, 0xb518, 0x0000, 0xc019, 0x0010, 0xc028, 0x0000, 0xc029,
-	0x0010, 0xc01e, 0x0003, 0x068c, 0x0012, 0x1044, 0x0013, 0x1686,
-	0x0002, 0x1034, 0x0000, 0xff10, 0x0000, 0x1a30, 0x0005, 0x0031,
-	0x0000, 0x0002, 0x0015, 0x0033, 0x0000, 0x1b29, 0x001b, 0x865f,
-	0x0000, 0x1c30, 0x0000, 0x1b31, 0x0015, 0x0033, 0x0000, 0xb131,
-	0x000b, 0x8664, 0x0002, 0x1f43, 0x000b, 0x166b, 0x0010, 0xb3b5,
-	0x0000, 0xb4b6, 0x0000, 0xc0b3, 0x0010, 0xc0b4, 0x0000, 0xb120,
-	0x0010, 0xb221, 0x0000, 0xb322, 0x0000, 0xb423, 0x0000, 0xb524,
-	0x0010, 0xb625, 0x0010, 0xb516, 0x0000, 0xb617, 0x0000, 0x1826,
-	0x0000, 0x1927, 0x0000, 0x1a30, 0x0005, 0x0031, 0x0010, 0x000f,
-	0x0015, 0x0033, 0x0000, 0xb011, 0x000b, 0x867a, 0x0000, 0xb028,
-	0x0000, 0xb129, 0x0012, 0x1e10, 0x0010, 0xff1e, 0x0003, 0x668c,
-	0x0002, 0x1d00, 0x0010, 0xff1d, 0x0004, 0x027f, 0x0002, 0x3a42,
-	0x0013, 0x168c, 0x0003, 0x0694, 0x0000, 0x1a30, 0x0005, 0x0031,
-	0x0000, 0x0002, 0x0015, 0x0033, 0x0000, 0x1b79, 0x001b, 0x868b,
-	0x0013, 0xb68c, 0x0005, 0x002a, 0x0000, 0x0001, 0x0005, 0x0015,
-	0x0000, 0x0001, 0x0000, 0x1efe, 0x0003, 0x6694, 0x0003, 0x024b,
-	0x0017, 0x4000, 0x0000, 0xba30, 0x0005, 0x0031, 0x0010, 0x001b,
-	0x0015, 0x0033, 0x0010, 0xb051, 0x001b, 0x869a, 0x0000, 0xb0a3,
-	0x0010, 0xb697, 0x0010, 0xb946, 0x0015, 0x00a5, 0x0000, 0x0010,
-	0x0015, 0x0030, 0x0000, 0x0400, 0x0011, 0x1388, 0x0000, 0x0002,
-	0x0000, 0xff31, 0x0015, 0x0033, 0x0000, 0xb509, 0x000b, 0x86a7,
-	0x0004, 0x0794, 0x0004, 0x0783, 0x0012, 0xb470, 0x0010, 0xffb4,
-	0x0010, 0xb48e, 0x0010, 0xb08a, 0x0010, 0xb18b, 0x0012, 0x104d,
-	0x0003, 0x16b2, 0x0003, 0x06df, 0x0012, 0x104b, 0x0003, 0x16c5,
-	0x0005, 0x008c, 0x0010, 0x0829, 0x0010, 0xc08d, 0x0001, 0xb2d8,
-	0x0010, 0x0600, 0x0010, 0xff88, 0x0010, 0xb389, 0x0000, 0x1390,
-	0x0010, 0xb591, 0x0000, 0xc08f, 0x0010, 0x1ab9, 0x0004, 0x0483,
-	0x0013, 0x96c0, 0x0010, 0xb092, 0x0010, 0xb193, 0x0013, 0x96c3,
-	0x0003, 0x06da, 0x0005, 0x008c, 0x0000, 0x0809, 0x0015, 0x008d,
-	0x0000, 0x0008, 0x0001, 0xb2d8, 0x0000, 0x0100, 0x0010, 0xff88,
+	0x0013, 0x05c0, 0x0015, 0x0030, 0x0000, 0x0400, 0x0011, 0x0d88,
+	0x0000, 0x000b, 0x0000, 0xff31, 0x0015, 0x0033, 0x0000, 0xb011,
+	0x000b, 0x8570, 0x0010, 0xb1ff, 0x0001, 0xb0d0, 0x0013, 0x1579,
+	0x0005, 0x00b5, 0x0010, 0x0b02, 0x0010, 0xb062, 0x0010, 0xb163,
+	0x0013, 0x057b, 0x0005, 0x00b5, 0x0000, 0x0302, 0x0015, 0x0065,
+	0x0010, 0x0012, 0x0005, 0x0067, 0x0000, 0x0008, 0x0015, 0x006c,
+	0x0000, 0x7000, 0x0005, 0x006d, 0x0010, 0x0500, 0x0015, 0x006f,
+	0x0010, 0x000a, 0x0015, 0x0044, 0x0000, 0x0001, 0x0005, 0x0052,
+	0x0000, 0x2500, 0x0015, 0x0044, 0x0000, 0x0008, 0x0015, 0x00b7,
+	0x0000, 0x0032, 0x0013, 0x05c0, 0x0005, 0x00b5, 0x0010, 0x0028,
+	0x0015, 0x00b7, 0x0010, 0x0018, 0x0013, 0x05c0, 0x0005, 0x00b5,
+	0x0000, 0x0100, 0x0005, 0x0067, 0x0000, 0x0008, 0x0015, 0x0030,
+	0x0000, 0x0400, 0x0011, 0x0d88, 0x0010, 0x0018, 0x0000, 0xff31,
+	0x0015, 0x0033, 0x0000, 0xb009, 0x000b, 0x859e, 0x0001, 0xb0c8,
+	0x0010, 0x00ff, 0x0015, 0x00b7, 0x0000, 0x0020, 0x0013, 0x05c0,
+	0x0015, 0x0030, 0x0000, 0x0400, 0x0011, 0x0d88, 0x0010, 0x0005,
+	0x0000, 0xff31, 0x0015, 0x0033, 0x0000, 0xb609, 0x000b, 0x85ab,
+	0x0001, 0xb6c8, 0x0010, 0xff00, 0x0000, 0xffb0, 0x0015, 0x0033,
+	0x0000, 0xb00a, 0x001b, 0x85b1, 0x0001, 0xb6c8, 0x0010, 0x00ff,
+	0x0012, 0xff10, 0x000b, 0x15ba, 0x0000, 0xffb5, 0x0015, 0x00b7,
+	0x0010, 0x0018, 0x0013, 0x05c0, 0x0010, 0xff63, 0x0005, 0x00b5,
+	0x0000, 0x0800, 0x0015, 0x00b7, 0x0010, 0x0018, 0x0013, 0x05c0,
+	0x0015, 0x0030, 0x0000, 0x0400, 0x0011, 0x0d88, 0x0010, 0x0009,
+	0x0000, 0xff31, 0x0015, 0x0033, 0x0000, 0xb009, 0x000b, 0x85c7,
+	0x0010, 0xb561, 0x0013, 0x95c9, 0x0010, 0xb7a0, 0x0013, 0x05e1,
+	0x0005, 0x00b6, 0x0010, 0x0300, 0x0004, 0x05fc, 0x0005, 0x0054,
+	0x0010, 0x0819, 0x0010, 0x0d58, 0x0015, 0x0030, 0x0000, 0x0400,
+	0x0011, 0x0d88, 0x0000, 0x0002, 0x0000, 0xff31, 0x0015, 0x0033,
+	0x0000, 0xb009, 0x000b, 0x85d9, 0x0000, 0xb059, 0x0013, 0x95db,
+	0x0010, 0xc0a0, 0x0010, 0x71ff, 0x0002, 0xff28, 0x0010, 0xff71,
+	0x0013, 0x05e1, 0x0012, 0xd041, 0x001b, 0x15e1, 0x0015, 0x00d1,
+	0x0010, 0x0202, 0x0000, 0x75ff, 0x0011, 0xffc8, 0x0000, 0x1804,
+	0x0001, 0xffd8, 0x0010, 0x0009, 0x0003, 0x95ea, 0x0000, 0xff75,
+	0x0003, 0x95ec, 0x0015, 0x00d1, 0x0000, 0x0200, 0x0015, 0x0030,
+	0x0000, 0x0400, 0x0001, 0xbd88, 0x0000, 0x0008, 0x0000, 0xff31,
+	0x0005, 0x00b0, 0x0010, 0x0009, 0x0015, 0x00b1, 0x0010, 0x07d0,
+	0x0015, 0x0033, 0x0000, 0xb012, 0x001b, 0x85fa, 0x0013, 0x0423,
+	0x0015, 0x0044, 0x0000, 0x0008, 0x0005, 0x0098, 0x0010, 0x0056,
+	0x0015, 0x0099, 0x0000, 0x9575, 0x0014, 0x079a, 0x0000, 0xb096,
+	0x0012, 0xb270, 0x0010, 0xff56, 0x0004, 0x07bc, 0x0010, 0xb052,
+	0x0010, 0xb153, 0x0000, 0xb6ff, 0x0011, 0xb2d0, 0x0010, 0xff50,
+	0x0010, 0xb351, 0x0017, 0x4000, 0x0015, 0x0030, 0x0000, 0x0400,
+	0x0001, 0x1288, 0x0010, 0x0011, 0x0000, 0xff31, 0x0015, 0x0033,
+	0x0000, 0x1009, 0x000b, 0x8615, 0x0015, 0x000f, 0x0000, 0x0001,
+	0x0010, 0xc014, 0x0000, 0x1213, 0x0015, 0x0030, 0x0000, 0x0400,
+	0x0011, 0x1388, 0x0000, 0x0004, 0x0000, 0xff31, 0x0015, 0x0033,
+	0x0000, 0xba09, 0x001b, 0x8621, 0x0015, 0x0030, 0x0000, 0x0400,
+	0x0011, 0x1388, 0x0010, 0x0005, 0x0000, 0xff31, 0x0015, 0x0033,
+	0x0000, 0x1a09, 0x000b, 0x8629, 0x0012, 0x104b, 0x000b, 0x1632,
+	0x0000, 0x1a30, 0x0005, 0x0031, 0x0000, 0x000b, 0x0015, 0x0033,
+	0x0000, 0x1621, 0x000b, 0x8631, 0x0010, 0x15fe, 0x001b, 0x663b,
+	0x0004, 0x0659, 0x0002, 0x3a42, 0x000b, 0x1658, 0x0001, 0x10c8,
+	0x0010, 0x000f, 0x001b, 0x16bb, 0x0003, 0x0657, 0x0015, 0x0030,
+	0x0000, 0x0400, 0x0011, 0x1388, 0x0010, 0x0003, 0x0000, 0xff31,
+	0x0015, 0x0033, 0x0000, 0xb009, 0x001b, 0x8642, 0x0015, 0x0033,
+	0x0010, 0xc00a, 0x000b, 0x8645, 0x0010, 0xb0fe, 0x0003, 0x664a,
+	0x0000, 0xb012, 0x0003, 0x064c, 0x0010, 0xc012, 0x0010, 0xc011,
+	0x0015, 0x000f, 0x0010, 0x0000, 0x0002, 0x3944, 0x0003, 0x1655,
+	0x0015, 0x0039, 0x0000, 0x5040, 0x0015, 0x00b8, 0x0000, 0x0008,
+	0x0014, 0x0817, 0x0000, 0xc013, 0x0003, 0x0658, 0x0014, 0x0803,
+	0x0003, 0x0051, 0x0003, 0xb659, 0x0005, 0x002a, 0x0000, 0x0004,
+	0x0000, 0xba30, 0x0005, 0x0031, 0x0010, 0x001b, 0x0015, 0x0033,
+	0x0000, 0xb009, 0x000b, 0x8661, 0x0000, 0xc02c, 0x0000, 0xb02d,
+	0x0012, 0x104b, 0x0013, 0x167c, 0x0000, 0x1a30, 0x0005, 0x0031,
+	0x0000, 0x0023, 0x0015, 0x0033, 0x0000, 0xb129, 0x000b, 0x866b,
+	0x0000, 0xb120, 0x0010, 0xb221, 0x0000, 0xb322, 0x0000, 0xb423,
+	0x0000, 0xb524, 0x0000, 0xc025, 0x0010, 0xb526, 0x0010, 0xc027,
+	0x0010, 0xb516, 0x0010, 0xc017, 0x0000, 0xb518, 0x0000, 0xc019,
+	0x0010, 0xc028, 0x0000, 0xc029, 0x0010, 0xc01e, 0x0013, 0x06b2,
+	0x0012, 0x1044, 0x0003, 0x16ac, 0x0002, 0x1034, 0x0000, 0xff10,
+	0x0000, 0x1a30, 0x0005, 0x0031, 0x0000, 0x0002, 0x0015, 0x0033,
+	0x0000, 0x1b29, 0x000b, 0x8685, 0x0000, 0x1c30, 0x0000, 0x1b31,
+	0x0015, 0x0033, 0x0000, 0xb131, 0x000b, 0x868a, 0x0002, 0x1f43,
+	0x000b, 0x1691, 0x0010, 0xb3b5, 0x0000, 0xb4b6, 0x0000, 0xc0b3,
+	0x0010, 0xc0b4, 0x0000, 0xb120, 0x0010, 0xb221, 0x0000, 0xb322,
+	0x0000, 0xb423, 0x0000, 0xb524, 0x0010, 0xb625, 0x0010, 0xb516,
+	0x0000, 0xb617, 0x0000, 0x1826, 0x0000, 0x1927, 0x0000, 0x1a30,
+	0x0005, 0x0031, 0x0010, 0x000f, 0x0015, 0x0033, 0x0000, 0xb011,
+	0x001b, 0x86a0, 0x0000, 0xb028, 0x0000, 0xb129, 0x0012, 0x1e10,
+	0x0010, 0xff1e, 0x0013, 0x66b2, 0x0002, 0x1d00, 0x0010, 0xff1d,
+	0x0014, 0x029a, 0x0002, 0x3a42, 0x0003, 0x16b2, 0x0003, 0x06ba,
+	0x0000, 0x1a30, 0x0005, 0x0031, 0x0000, 0x0002, 0x0015, 0x0033,
+	0x0000, 0x1b79, 0x001b, 0x86b1, 0x0003, 0xb6b2, 0x0005, 0x002a,
+	0x0000, 0x0001, 0x0005, 0x0015, 0x0000, 0x0001, 0x0000, 0x1efe,
+	0x0003, 0x66ba, 0x0003, 0x0266, 0x0017, 0x4000, 0x0000, 0xba30,
+	0x0005, 0x0031, 0x0010, 0x001b, 0x0015, 0x0033, 0x0010, 0xb051,
+	0x001b, 0x86c0, 0x0000, 0xb0a3, 0x0010, 0xb697, 0x0010, 0xb946,
+	0x0015, 0x00a5, 0x0000, 0x0010, 0x0015, 0x0030, 0x0000, 0x0400,
+	0x0011, 0x1388, 0x0000, 0x0002, 0x0000, 0xff31, 0x0015, 0x0033,
+	0x0000, 0xb509, 0x000b, 0x86cd, 0x0004, 0x07bc, 0x0004, 0x07ab,
+	0x0012, 0xb470, 0x0010, 0xffb4, 0x0010, 0xb48e, 0x0010, 0xb08a,
+	0x0010, 0xb18b, 0x0012, 0x104d, 0x0003, 0x16d8, 0x0003, 0x0705,
+	0x0012, 0x104b, 0x0003, 0x16eb, 0x0005, 0x008c, 0x0010, 0x0829,
+	0x0010, 0xc08d, 0x0001, 0xb2d8, 0x0010, 0x0600, 0x0010, 0xff88,
 	0x0010, 0xb389, 0x0000, 0x1390, 0x0010, 0xb591, 0x0000, 0xc08f,
-	0x0000, 0x1a30, 0x0005, 0x0031, 0x0010, 0x000f, 0x0015, 0x0033,
-	0x0000, 0xb011, 0x000b, 0x86d5, 0x0003, 0x96d6, 0x0000, 0xb192,
-	0x0000, 0xb093, 0x0003, 0x96d9, 0x0010, 0x19a1, 0x0000, 0x18a2,
-	0x0015, 0x00b1, 0x0010, 0x0096, 0x0003, 0x074e, 0x0000, 0xb590,
-	0x0010, 0x1391, 0x0001, 0x10c8, 0x0010, 0x000f, 0x0001, 0xffe8,
-	0x0010, 0x0005, 0x0013, 0x1706, 0x0001, 0xb2d8, 0x0000, 0x0700,
-	0x0010, 0xff88, 0x0010, 0xb389, 0x0015, 0x0030, 0x0000, 0x0400,
-	0x0011, 0x1388, 0x0010, 0x0009, 0x0000, 0xff31, 0x0015, 0x0033,
-	0x0000, 0xb009, 0x000b, 0x86f1, 0x0002, 0xb049, 0x0003, 0x16f9,
-	0x0005, 0x008c, 0x0010, 0x0889, 0x0015, 0x00b1, 0x0010, 0x0096,
-	0x0003, 0x06fd, 0x0005, 0x008c, 0x0010, 0x0898, 0x0015, 0x00b1,
-	0x0000, 0x0092, 0x0010, 0xc08d, 0x0000, 0xc08f, 0x0013, 0x96ff,
-	0x0000, 0xc092, 0x0010, 0xc093, 0x0013, 0x9702, 0x0010, 0x19a1,
-	0x0000, 0x18a2, 0x0003, 0x074e, 0x0001, 0xb2d8, 0x0000, 0x0100,
-	0x0010, 0xff88, 0x0010, 0xb389, 0x0005, 0x008c, 0x0010, 0x0880,
-	0x0015, 0x008d, 0x0000, 0x0008, 0x0011, 0x1388, 0x0000, 0x000e,
-	0x0000, 0xff31, 0x0015, 0x0033, 0x0000, 0xb009, 0x001b, 0x8713,
+	0x0010, 0x1ab9, 0x0014, 0x04a5, 0x0003, 0x96e6, 0x0010, 0xb092,
+	0x0010, 0xb193, 0x0003, 0x96e9, 0x0003, 0x0700, 0x0005, 0x008c,
+	0x0000, 0x0809, 0x0015, 0x008d, 0x0000, 0x0008, 0x0001, 0xb2d8,
+	0x0000, 0x0100, 0x0010, 0xff88, 0x0010, 0xb389, 0x0000, 0x1390,
+	0x0010, 0xb591, 0x0000, 0xc08f, 0x0000, 0x1a30, 0x0005, 0x0031,
+	0x0010, 0x000f, 0x0015, 0x0033, 0x0000, 0xb011, 0x000b, 0x86fb,
+	0x0013, 0x96fc, 0x0000, 0xb192, 0x0000, 0xb093, 0x0013, 0x96ff,
+	0x0010, 0x19a1, 0x0000, 0x18a2, 0x0015, 0x00b1, 0x0010, 0x0096,
+	0x0013, 0x0776, 0x0000, 0xb590, 0x0010, 0x1391, 0x0001, 0x10c8,
+	0x0010, 0x000f, 0x0001, 0xffe8, 0x0010, 0x0005, 0x0003, 0x172c,
+	0x0001, 0xb2d8, 0x0000, 0x0700, 0x0010, 0xff88, 0x0010, 0xb389,
+	0x0015, 0x0030, 0x0000, 0x0400, 0x0011, 0x1388, 0x0010, 0x0009,
+	0x0000, 0xff31, 0x0015, 0x0033, 0x0000, 0xb009, 0x000b, 0x8717,
+	0x0002, 0xb049, 0x0003, 0x171f, 0x0005, 0x008c, 0x0010, 0x0889,
+	0x0015, 0x00b1, 0x0010, 0x0096, 0x0013, 0x0723, 0x0005, 0x008c,
+	0x0010, 0x0898, 0x0015, 0x00b1, 0x0000, 0x0092, 0x0010, 0xc08d,
+	0x0000, 0xc08f, 0x0013, 0x9725, 0x0000, 0xc092, 0x0010, 0xc093,
+	0x0003, 0x9728, 0x0010, 0x19a1, 0x0000, 0x18a2, 0x0013, 0x0776,
+	0x0001, 0xb2d8, 0x0000, 0x0100, 0x0010, 0xff88, 0x0010, 0xb389,
+	0x0005, 0x008c, 0x0010, 0x0880, 0x0015, 0x008d, 0x0000, 0x0008,
+	0x0015, 0x0030, 0x0000, 0x0400, 0x0011, 0x1388, 0x0000, 0x000e,
+	0x0000, 0xff31, 0x0015, 0x0033, 0x0000, 0xb009, 0x001b, 0x873b,
 	0x0010, 0xb08f, 0x0000, 0xb590, 0x0010, 0x1391, 0x0000, 0x1a30,
 	0x0005, 0x0031, 0x0000, 0x000d, 0x0015, 0x0033, 0x0000, 0xb021,
-	0x001b, 0x871c, 0x0003, 0x971d, 0x0010, 0xb392, 0x0010, 0xb293,
-	0x0013, 0x9720, 0x0000, 0xb1a1, 0x0010, 0xb0a2, 0x0015, 0x0030,
+	0x000b, 0x8744, 0x0013, 0x9745, 0x0010, 0xb392, 0x0010, 0xb293,
+	0x0003, 0x9748, 0x0000, 0xb1a1, 0x0010, 0xb0a2, 0x0015, 0x0030,
 	0x0000, 0x0400, 0x0011, 0x1388, 0x0000, 0x000b, 0x0000, 0xff31,
-	0x0015, 0x0033, 0x0010, 0xb211, 0x001b, 0x872a, 0x0000, 0xb3ff,
-	0x0001, 0xb080, 0x0000, 0xffb3, 0x001b, 0x2731, 0x0002, 0xb200,
-	0x0013, 0x0732, 0x0010, 0xb2ff, 0x0011, 0xb180, 0x0010, 0xffb2,
+	0x0015, 0x0033, 0x0010, 0xb211, 0x001b, 0x8752, 0x0000, 0xb3ff,
+	0x0001, 0xb080, 0x0000, 0xffb3, 0x000b, 0x2759, 0x0002, 0xb200,
+	0x0003, 0x075a, 0x0010, 0xb2ff, 0x0011, 0xb180, 0x0010, 0xffb2,
 	0x0011, 0x1388, 0x0000, 0x000b, 0x0000, 0xff31, 0x0015, 0x0033,
-	0x0010, 0xb212, 0x000b, 0x8739, 0x0015, 0x00b1, 0x0000, 0x0092,
-	0x0002, 0x104c, 0x0003, 0x174c, 0x0011, 0xc2e8, 0x0010, 0x000c,
-	0x000b, 0x1744, 0x0015, 0x00ff, 0x0000, 0x0800, 0x0013, 0x074c,
-	0x0011, 0xc2e8, 0x0000, 0x0020, 0x001b, 0x174a, 0x0015, 0x00ff,
-	0x0010, 0x1800, 0x0013, 0x074c, 0x0015, 0x00ff, 0x0000, 0x1000,
+	0x0010, 0xb212, 0x001b, 0x8761, 0x0015, 0x00b1, 0x0000, 0x0092,
+	0x0002, 0x104c, 0x0013, 0x1774, 0x0011, 0xc2e8, 0x0010, 0x000c,
+	0x000b, 0x176c, 0x0015, 0x00ff, 0x0000, 0x0800, 0x0003, 0x0774,
+	0x0011, 0xc2e8, 0x0000, 0x0020, 0x000b, 0x1772, 0x0015, 0x00ff,
+	0x0010, 0x1800, 0x0003, 0x0774, 0x0015, 0x00ff, 0x0000, 0x1000,
 	0x0011, 0xb1d0, 0x0010, 0xffb1, 0x0015, 0x009a, 0x0010, 0x0036,
-	0x0005, 0x009b, 0x0000, 0x95d5, 0x0012, 0xd041, 0x001b, 0x1752,
-	0x0015, 0x00d1, 0x0010, 0x0202, 0x0003, 0x9756, 0x0012, 0x104e,
-	0x0003, 0x175b, 0x0012, 0xb12f, 0x0010, 0xffb1, 0x0000, 0xb175,
-	0x0003, 0x975c, 0x0015, 0x00d1, 0x0000, 0x0200, 0x0001, 0x19c8,
-	0x0010, 0xfff0, 0x000b, 0x1765, 0x0015, 0x00b1, 0x0010, 0x07d0,
-	0x0013, 0x0767, 0x0015, 0x00b1, 0x0000, 0x1b58, 0x0005, 0x00b0,
+	0x0005, 0x009b, 0x0000, 0x95d5, 0x0012, 0xd041, 0x001b, 0x177a,
+	0x0015, 0x00d1, 0x0010, 0x0202, 0x0003, 0x977e, 0x0012, 0x104e,
+	0x0003, 0x1783, 0x0012, 0xb12f, 0x0010, 0xffb1, 0x0000, 0xb175,
+	0x0003, 0x9784, 0x0015, 0x00d1, 0x0000, 0x0200, 0x0001, 0x19c8,
+	0x0010, 0xfff0, 0x000b, 0x178d, 0x0015, 0x00b1, 0x0010, 0x07d0,
+	0x0013, 0x078f, 0x0015, 0x00b1, 0x0000, 0x1b58, 0x0005, 0x00b0,
 	0x0010, 0x0009, 0x0015, 0x0030, 0x0000, 0x0400, 0x0001, 0xbd88,
 	0x0000, 0x000b, 0x0000, 0xff31, 0x0015, 0x0033, 0x0000, 0xb012,
-	0x001b, 0x8770, 0x0003, 0x0632, 0x0000, 0xba30, 0x0005, 0x0031,
-	0x0010, 0x0021, 0x0015, 0x0033, 0x0010, 0xb019, 0x000b, 0x8777,
+	0x001b, 0x8798, 0x0003, 0x0658, 0x0000, 0xba30, 0x0005, 0x0031,
+	0x0010, 0x0021, 0x0015, 0x0033, 0x0010, 0xb019, 0x000b, 0x879f,
 	0x0002, 0xb200, 0x0011, 0xffc8, 0x0010, 0x00ff, 0x0010, 0xffb2,
 	0x0010, 0xb2b7, 0x0005, 0x0031, 0x0000, 0x0023, 0x0015, 0x0033,
-	0x0010, 0xb20a, 0x000b, 0x8781, 0x0017, 0x4000, 0x0000, 0xba30,
+	0x0010, 0xb20a, 0x000b, 0x87a9, 0x0017, 0x4000, 0x0000, 0xba30,
 	0x0005, 0x0031, 0x0000, 0x0023, 0x0015, 0x0033, 0x0010, 0xb409,
-	0x000b, 0x8788, 0x0002, 0xb400, 0x0011, 0xffc8, 0x0010, 0x00ff,
+	0x001b, 0x87b0, 0x0002, 0xb400, 0x0011, 0xffc8, 0x0010, 0x00ff,
 	0x0010, 0xffb4, 0x0010, 0xb4b7, 0x0005, 0x0031, 0x0000, 0x0023,
-	0x0015, 0x0033, 0x0010, 0xb40a, 0x001b, 0x8792, 0x0017, 0x4000,
-	0x0000, 0xba30, 0x0001, 0xc7c8, 0x0000, 0x0020, 0x000b, 0x17a0,
+	0x0015, 0x0033, 0x0010, 0xb40a, 0x001b, 0x87ba, 0x0017, 0x4000,
+	0x0000, 0xba30, 0x0001, 0xc7c8, 0x0000, 0x0020, 0x001b, 0x17c8,
 	0x0005, 0x0031, 0x0010, 0x0028, 0x0015, 0x0033, 0x0010, 0xb209,
-	0x000b, 0x879c, 0x0011, 0xb2c8, 0x0000, 0xff80, 0x0013, 0x17a3,
-	0x0010, 0xc4b0, 0x0010, 0xc5b1, 0x0003, 0x07a5, 0x0010, 0xc6b1,
+	0x001b, 0x87c4, 0x0011, 0xb2c8, 0x0000, 0xff80, 0x0003, 0x17cb,
+	0x0010, 0xc4b0, 0x0010, 0xc5b1, 0x0013, 0x07cd, 0x0010, 0xc6b1,
 	0x0000, 0xc0b0, 0x0005, 0x0031, 0x0000, 0x0004, 0x0015, 0x0033,
-	0x0010, 0xb211, 0x000b, 0x87a9, 0x0017, 0x4000, 0x0015, 0x00b8,
-	0x0010, 0x0009, 0x0015, 0x003a, 0x0010, 0x0707, 0x0014, 0x07ed,
+	0x0010, 0xb211, 0x000b, 0x87d1, 0x0017, 0x4000, 0x0015, 0x00b8,
+	0x0010, 0x0009, 0x0015, 0x003a, 0x0010, 0x0707, 0x0014, 0x0817,
 	0x0013, 0x002d, 0x0015, 0x00b8, 0x0010, 0x0009, 0x0015, 0x003a,
-	0x0010, 0x0707, 0x0003, 0x07ed, 0x0004, 0x0110, 0x0015, 0x0030,
+	0x0010, 0x0707, 0x0003, 0x0817, 0x0004, 0x0110, 0x0015, 0x0030,
 	0x0000, 0x0400, 0x0011, 0x0d88, 0x0000, 0x0004, 0x0000, 0xff31,
-	0x0015, 0x0033, 0x0000, 0xba09, 0x000b, 0x87be, 0x0014, 0x0772,
+	0x0015, 0x0033, 0x0000, 0xba09, 0x001b, 0x87e6, 0x0014, 0x079a,
 	0x0015, 0x0030, 0x0000, 0x0400, 0x0011, 0x0d88, 0x0000, 0x0010,
-	0x0000, 0xff31, 0x0015, 0x0033, 0x0010, 0xb20a, 0x001b, 0x87c7,
-	0x0011, 0x0d88, 0x0010, 0x0011, 0x0000, 0xff31, 0x0015, 0x0033,
-	0x0010, 0x0309, 0x001b, 0x87cd, 0x0002, 0x0327, 0x0010, 0xffb2,
-	0x0011, 0x0d88, 0x0010, 0x0011, 0x0000, 0xff31, 0x0015, 0x0033,
-	0x0010, 0xb20a, 0x001b, 0x87d5, 0x0015, 0x00b8, 0x0010, 0x0006,
-	0x0003, 0x07ed, 0x0014, 0x0122, 0x0014, 0x0772, 0x0015, 0x0030,
-	0x0000, 0x0400, 0x0011, 0x1388, 0x0000, 0x0010, 0x0000, 0xff31,
-	0x0015, 0x0033, 0x0010, 0xb20a, 0x000b, 0x87e2, 0x0012, 0x1027,
-	0x0010, 0xffb2, 0x0011, 0x1388, 0x0010, 0x0011, 0x0000, 0xff31,
-	0x0015, 0x0033, 0x0010, 0xb20a, 0x001b, 0x87ea, 0x0015, 0x00b8,
-	0x0000, 0x0007, 0x0013, 0x47ed, 0x0000, 0xb838, 0x0017, 0x4000,
-	0xa85a, 0x97da
+	0x0000, 0xff31, 0x0015, 0x0033, 0x0010, 0xb20a, 0x001b, 0x87ef,
+	0x0015, 0x0030, 0x0000, 0x0400, 0x0011, 0x0d88, 0x0010, 0x0011,
+	0x0000, 0xff31, 0x0015, 0x0033, 0x0010, 0x0309, 0x001b, 0x87f7,
+	0x0002, 0x0327, 0x0010, 0xffb2, 0x0011, 0x0d88, 0x0010, 0x0011,
+	0x0000, 0xff31, 0x0015, 0x0033, 0x0010, 0xb20a, 0x000b, 0x87ff,
+	0x0015, 0x00b8, 0x0010, 0x0006, 0x0003, 0x0817, 0x0014, 0x0122,
+	0x0014, 0x079a, 0x0015, 0x0030, 0x0000, 0x0400, 0x0011, 0x1388,
+	0x0000, 0x0010, 0x0000, 0xff31, 0x0015, 0x0033, 0x0010, 0xb20a,
+	0x000b, 0x880c, 0x0012, 0x1027, 0x0010, 0xffb2, 0x0011, 0x1388,
+	0x0010, 0x0011, 0x0000, 0xff31, 0x0015, 0x0033, 0x0010, 0xb20a,
+	0x000b, 0x8814, 0x0015, 0x00b8, 0x0000, 0x0007, 0x0013, 0x4817,
+	0x0000, 0xb838, 0x0017, 0x4000, 0xa5a5, 0x1ab5
 };
-unsigned short xseqflx_code_length01 = 0x0fe2;
+unsigned short xseqflx_code_length01 = 0x1036;
diff --git a/drivers/scsi/qla2xxx/qla_dbg.c b/drivers/scsi/qla2xxx/qla_dbg.c
index af381fa6f..23f43ec5e 100644
--- a/drivers/scsi/qla2xxx/qla_dbg.c
+++ b/drivers/scsi/qla2xxx/qla_dbg.c
@@ -16,10 +16,10 @@
  * General Public License for more details.
  *
  */
-#include "qla_os.h"
-
 #include "qla_def.h"
 
+#include <linux/delay.h>
+
 static int qla_uprintf(char **, char *, ...);
 
 /**
@@ -40,9 +40,10 @@ qla2300_fw_dump(scsi_qla_host_t *ha, int hardware_locked)
 	uint16_t	*dmp_reg;
 	unsigned long	flags;
 	struct qla2300_fw_dump	*fw;
+	uint32_t	dump_size, data_ram_cnt;
 
 	reg = ha->iobase;
-	risc_address = 0;
+	risc_address = data_ram_cnt = 0;
 	mb0 = mb2 = 0;
 	flags = 0;
 
@@ -57,13 +58,15 @@ qla2300_fw_dump(scsi_qla_host_t *ha, int hardware_locked)
 	}
 
 	/* Allocate (large) dump buffer. */
-	ha->fw_dump_order = get_order(sizeof(struct qla2300_fw_dump));
+	dump_size = sizeof(struct qla2300_fw_dump);
+	dump_size += (ha->fw_memory_size - 0x11000) * sizeof(uint16_t);
+	ha->fw_dump_order = get_order(dump_size);
 	ha->fw_dump = (struct qla2300_fw_dump *) __get_free_pages(GFP_ATOMIC,
 	    ha->fw_dump_order);
 	if (ha->fw_dump == NULL) {
 		qla_printk(KERN_WARNING, ha,
-		    "Unable to allocated memory for firmware dump (%d/%Zd).\n",
-		    ha->fw_dump_order, sizeof(struct qla2300_fw_dump));
+		    "Unable to allocated memory for firmware dump (%d/%d).\n",
+		    ha->fw_dump_order, dump_size);
 		goto qla2300_fw_dump_failed;
 	}
 	fw = ha->fw_dump;
@@ -304,10 +307,11 @@ qla2300_fw_dump(scsi_qla_host_t *ha, int hardware_locked)
 	if (rval == QLA_SUCCESS) {
 		/* Get data SRAM. */
 		risc_address = 0x11000;
+		data_ram_cnt = ha->fw_memory_size - risc_address + 1;
  		WRT_MAILBOX_REG(ha, reg, 0, MBC_READ_RAM_EXTENDED);
 		clear_bit(MBX_INTERRUPT, &ha->mbx_cmd_flags);
 	}
-	for (cnt = 0; cnt < sizeof(fw->data_ram) / 2 && rval == QLA_SUCCESS;
+	for (cnt = 0; cnt < data_ram_cnt && rval == QLA_SUCCESS;
 	    cnt++, risc_address++) {
  		WRT_MAILBOX_REG(ha, reg, 1, LSW(risc_address));
  		WRT_MAILBOX_REG(ha, reg, 8, MSW(risc_address));
@@ -386,6 +390,7 @@ qla2300_ascii_fw_dump(scsi_qla_host_t *ha)
 	char *uiter;
 	char fw_info[30];
 	struct qla2300_fw_dump *fw;
+	uint32_t data_ram_cnt;
 
 	uiter = ha->fw_dump_buffer;
 	fw = ha->fw_dump;
@@ -550,7 +555,8 @@ qla2300_ascii_fw_dump(scsi_qla_host_t *ha)
 	}
 
 	qla_uprintf(&uiter, "\n\nData RAM Dump:");
-	for (cnt = 0; cnt < sizeof (fw->data_ram) / 2; cnt++) {
+	data_ram_cnt = ha->fw_memory_size - 0x11000 + 1;
+	for (cnt = 0; cnt < data_ram_cnt; cnt++) {
 		if (cnt % 8 == 0) {
 			qla_uprintf(&uiter, "\n%05x: ", cnt + 0x11000);
 		}
diff --git a/drivers/scsi/qla2xxx/qla_dbg.h b/drivers/scsi/qla2xxx/qla_dbg.h
index 90087abdd..d7f56c761 100644
--- a/drivers/scsi/qla2xxx/qla_dbg.h
+++ b/drivers/scsi/qla2xxx/qla_dbg.h
@@ -182,7 +182,9 @@
 /*
  * Firmware Dump structure definition
  */
-#define FW_DUMP_SIZE	0xBC000		/* bytes */
+#define FW_DUMP_SIZE_128K	0xBC000
+#define FW_DUMP_SIZE_512K	0x2FC000
+#define FW_DUMP_SIZE_1M		0x5FC000
 
 struct qla2300_fw_dump {
 	uint16_t hccr;
@@ -205,7 +207,7 @@ struct qla2300_fw_dump {
 	uint16_t fpm_b1_reg[64];
 	uint16_t risc_ram[0xf800];
 	uint16_t stack_ram[0x1000];
-	uint16_t data_ram[0xF000];
+	uint16_t data_ram[1];
 };
 
 struct qla2100_fw_dump {
diff --git a/drivers/scsi/qla2xxx/qla_def.h b/drivers/scsi/qla2xxx/qla_def.h
index 9d9045be3..96de77053 100644
--- a/drivers/scsi/qla2xxx/qla_def.h
+++ b/drivers/scsi/qla2xxx/qla_def.h
@@ -20,6 +20,24 @@
 #ifndef __QLA_DEF_H
 #define __QLA_DEF_H
 
+#include <linux/kernel.h>
+#include <linux/init.h>
+#include <linux/types.h>
+#include <linux/module.h>
+#include <linux/list.h>
+#include <linux/pci.h>
+#include <linux/sched.h>
+#include <linux/slab.h>
+#include <linux/mempool.h>
+#include <linux/spinlock.h>
+#include <linux/completion.h>
+#include <asm/semaphore.h>
+
+#include <scsi/scsi.h>
+#include <scsi/scsi_host.h>
+#include <scsi/scsi_device.h>
+#include <scsi/scsi_cmnd.h>
+
 /* XXX(hch): move to pci_ids.h */
 #ifndef PCI_DEVICE_ID_QLOGIC_ISP2300
 #define PCI_DEVICE_ID_QLOGIC_ISP2300	0x2300
@@ -264,10 +282,6 @@ typedef struct srb {
 #define SRB_ERR_DEVICE	3		/* Request failed -- "device error" */
 #define SRB_ERR_OTHER	4
 
-	/* Segment/entries counts */
-	uint16_t	req_cnt;	/* !0 indicates counts determined */
-	uint16_t	tot_dsds;
-
 	/* SRB magic number */
 	uint16_t magic;
 #define SRB_MAGIC       0x10CB
@@ -1307,8 +1321,7 @@ typedef struct {
 #define SS_RESIDUAL_UNDER		BIT_11
 #define SS_RESIDUAL_OVER		BIT_10
 #define SS_SENSE_LEN_VALID		BIT_9
-#define SS_RESIDUAL_LEN_VALID		BIT_8	/* ISP2100 only */
-#define SS_RESPONSE_INFO_LEN_VALID	BIT_8	/* ISP2200 and 23xx */
+#define SS_RESPONSE_INFO_LEN_VALID	BIT_8
 
 #define SS_RESERVE_CONFLICT		(BIT_4 | BIT_3)
 #define SS_BUSY_CONDITION		BIT_3
@@ -2272,7 +2285,8 @@ typedef struct scsi_qla_host {
 	mbx_cmd_t	*mcp;
 	unsigned long	mbx_cmd_flags;
 #define MBX_INTERRUPT	1
-#define MBX_INTR_WAIT   2
+#define MBX_INTR_WAIT	2
+#define MBX_UPDATE_FLASH_ACTIVE	3
 
 	spinlock_t	mbx_reg_lock;   /* Mbx Cmd Register Lock */
 
@@ -2308,6 +2322,7 @@ typedef struct scsi_qla_host {
 	uint16_t	fw_minor_version;
 	uint16_t	fw_subminor_version;
 	uint16_t	fw_attributes;
+	uint32_t	fw_memory_size;
 	uint32_t	fw_transfer_size;
 
 	uint16_t	fw_options[16];		/* slots: 1,2,3,10,11 */
@@ -2423,4 +2438,17 @@ struct _qla2x00stats  {
 #include "qla_inline.h"
 #include "qla_listops.h"
 
+/*
+* String arrays
+*/
+#define LINESIZE    256
+#define MAXARGS      26
+
+#define CMD_SP(Cmnd)		((Cmnd)->SCp.ptr)
+#define CMD_COMPL_STATUS(Cmnd)  ((Cmnd)->SCp.this_residual)
+#define CMD_RESID_LEN(Cmnd)	((Cmnd)->SCp.buffers_residual)
+#define CMD_SCSI_STATUS(Cmnd)	((Cmnd)->SCp.Status)
+#define CMD_ACTUAL_SNSLEN(Cmnd)	((Cmnd)->SCp.Message)
+#define CMD_ENTRY_STATUS(Cmnd)	((Cmnd)->SCp.have_data_in)
+
 #endif
diff --git a/drivers/scsi/qla2xxx/qla_gbl.h b/drivers/scsi/qla2xxx/qla_gbl.h
index 78bde6063..1b54cde88 100644
--- a/drivers/scsi/qla2xxx/qla_gbl.h
+++ b/drivers/scsi/qla2xxx/qla_gbl.h
@@ -23,6 +23,8 @@
 #ifndef __QLA_GBL_H
 #define	__QLA_GBL_H
 
+#include <linux/interrupt.h>
+
 extern void qla2x00_remove_one(struct pci_dev *);
 extern int qla2x00_probe_one(struct pci_dev *, struct qla_board_info *);
 
@@ -64,6 +66,7 @@ extern int qlport_down_retry;
 extern int ql2xmaxqdepth;
 extern int displayConfig;
 extern int ql2xplogiabsentdevice;
+extern int ql2xenablezio;
 extern int ql2xintrdelaytimer;
 extern int ql2xloginretrycount;
 
@@ -74,8 +77,6 @@ extern int ql2xsuspendcount;
 #if defined(MODULE)
 extern char *ql2xopts;
 #endif
-extern struct list_head qla_hostlist;
-extern rwlock_t qla_hostlist_lock;
 
 extern char *qla2x00_get_fw_version_str(struct scsi_qla_host *, char *);
 
@@ -140,7 +141,7 @@ qla2x00_execute_fw(scsi_qla_host_t *);
 
 extern void
 qla2x00_get_fw_version(scsi_qla_host_t *, uint16_t *,
-    uint16_t *, uint16_t *, uint16_t *);
+    uint16_t *, uint16_t *, uint16_t *, uint32_t *);
 
 extern int
 qla2x00_get_fw_options(scsi_qla_host_t *, uint16_t *);
diff --git a/drivers/scsi/qla2xxx/qla_gs.c b/drivers/scsi/qla2xxx/qla_gs.c
index 2789f890a..531dad958 100644
--- a/drivers/scsi/qla2xxx/qla_gs.c
+++ b/drivers/scsi/qla2xxx/qla_gs.c
@@ -16,8 +16,6 @@
  * General Public License for more details.
  *
  */
-#include "qla_os.h"
-
 #include "qla_def.h"
 
 static inline ms_iocb_entry_t *
diff --git a/drivers/scsi/qla2xxx/qla_init.c b/drivers/scsi/qla2xxx/qla_init.c
index ccc153198..e31b5fe3e 100644
--- a/drivers/scsi/qla2xxx/qla_init.c
+++ b/drivers/scsi/qla2xxx/qla_init.c
@@ -16,8 +16,10 @@
  * General Public License for more details.
  *
  */
-#include "qla_os.h"
 #include "qla_def.h"
+
+#include <linux/delay.h>
+
 #include "qla_devtbl.h"
 
 /* XXX(hch): this is ugly, but we don't want to pull in exioctl.h */
@@ -107,8 +109,8 @@ qla2x00_initialize_adapter(scsi_qla_host_t *ha)
 	uint32_t wait_time;
 
 	/* Clear adapter flags. */
-	ha->flags.online = FALSE;
-	ha->flags.reset_active = FALSE;
+	ha->flags.online = 0;
+	ha->flags.reset_active = 0;
 	atomic_set(&ha->loop_down_timer, LOOP_DOWN_TIME);
 	atomic_set(&ha->loop_state, LOOP_DOWN);
 	ha->device_flags = 0;
@@ -220,17 +222,12 @@ check_fw_ready_again:
 	} while (restart_risc && retry--);
 
 	if (rval == QLA_SUCCESS) {
-		/* Retrieve firmware information */
-		qla2x00_get_fw_version(ha, &ha->fw_major_version,
-		    &ha->fw_minor_version, &ha->fw_subminor_version,
-		    &ha->fw_attributes);
-
 		clear_bit(RESET_MARKER_NEEDED, &ha->dpc_flags);
 		ha->marker_needed = 1;
 		qla2x00_marker(ha, 0, 0, MK_SYNC_ALL);
 		ha->marker_needed = 0;
 
-		ha->flags.online = TRUE;
+		ha->flags.online = 1;
 	} else {
 		DEBUG2_3(printk("%s(): **** FAILED ****\n", __func__));
 	}
@@ -730,6 +727,14 @@ qla2x00_setup_chip(scsi_qla_host_t *ha)
 			    "firmware.\n", ha->host_no));
 
 			rval = qla2x00_execute_fw(ha);
+			/* Retrieve firmware information. */
+			if (rval == QLA_SUCCESS && ha->fw_major_version == 0) {
+				qla2x00_get_fw_version(ha,
+				    &ha->fw_major_version,
+				    &ha->fw_minor_version,
+				    &ha->fw_subminor_version,
+				    &ha->fw_attributes, &ha->fw_memory_size);
+			}
 		}
 		else {
 			DEBUG2(printk(KERN_INFO
@@ -941,7 +946,8 @@ qla2x00_fw_ready(scsi_qla_host_t *ha)
 			rval = QLA_FUNCTION_FAILED;
 
 			if (atomic_read(&ha->loop_down_timer) &&
-			    fw_state >= FSTATE_LOSS_OF_SYNC) {
+			    (fw_state >= FSTATE_LOSS_OF_SYNC ||
+				fw_state == FSTATE_WAIT_AL_PA)) {
 				/* Loop down. Timeout on min_wait for states
 				 * other than Wait for Login. 
 				 */	
@@ -1110,7 +1116,7 @@ qla2x00_nvram_config(scsi_qla_host_t *ha)
 	nvram_t *nv    = (nvram_t *)ha->request_ring;
 	uint16_t  *wptr  = (uint16_t *)ha->request_ring;
 	device_reg_t *reg = ha->iobase;
-	uint16_t  timer_mode;
+	uint8_t  timer_mode;
 
 	rval = QLA_SUCCESS;
 
@@ -1164,7 +1170,7 @@ qla2x00_nvram_config(scsi_qla_host_t *ha)
 		} else if (IS_QLA2200(ha)) {
 			nv->firmware_options[0] = BIT_2 | BIT_1;
 			nv->firmware_options[1] = BIT_7 | BIT_5;
-			nv->add_firmware_options[0] = BIT_5 | BIT_4;
+			nv->add_firmware_options[0] = BIT_5;
 			nv->add_firmware_options[1] = BIT_5 | BIT_4;
 			nv->frame_payload_size = __constant_cpu_to_le16(1024);
 		} else if (IS_QLA2100(ha)) {
@@ -1262,6 +1268,16 @@ qla2x00_nvram_config(scsi_qla_host_t *ha)
 		}
 	} else if (IS_QLA2200(ha)) {
 		nv->firmware_options[0] |= BIT_2;
+		/*
+		 * 'Point-to-point preferred, else loop' is not a safe
+		 * connection mode setting.
+		 */
+		if ((nv->add_firmware_options[0] & (BIT_6 | BIT_5 | BIT_4)) ==
+		    (BIT_5 | BIT_4)) {
+			/* Force 'loop preferred, else point-to-point'. */
+			nv->add_firmware_options[0] &= ~(BIT_6 | BIT_5 | BIT_4);
+			nv->add_firmware_options[0] |= BIT_5;
+		}
 		strcpy(ha->model_number, "QLA22xx");
 	} else /*if (IS_QLA2100(ha))*/ {
 		strcpy(ha->model_number, "QLA2100");
@@ -1417,23 +1433,22 @@ qla2x00_nvram_config(scsi_qla_host_t *ha)
 
 		ha->flags.process_response_queue = 1;
 	} else {
-		/* TEST ZIO:
-		 *
-		 * icb->add_firmware_options[0] &=
-		 *    ~(BIT_3 | BIT_2 | BIT_1 | BIT_0);
-		 * icb->add_firmware_options[0] |= (BIT_2 | BIT_0);
-		 */
+		/* Enable ZIO -- Support mode 5 only. */
 		timer_mode = icb->add_firmware_options[0] &
 		    (BIT_3 | BIT_2 | BIT_1 | BIT_0);
-		if (timer_mode == 5) {
+		icb->add_firmware_options[0] &=
+		    ~(BIT_3 | BIT_2 | BIT_1 | BIT_0);
+		if (ql2xenablezio)
+			timer_mode = BIT_2 | BIT_0;
+		if (timer_mode == (BIT_2 | BIT_0)) {
 			DEBUG2(printk("scsi(%ld): ZIO enabled; timer delay "
 			    "(%d).\n", ha->host_no, ql2xintrdelaytimer));
 			qla_printk(KERN_INFO, ha,
 			    "ZIO enabled; timer delay (%d).\n",
 			    ql2xintrdelaytimer);
 
+			icb->add_firmware_options[0] |= timer_mode;
 			icb->interrupt_delay_timer = ql2xintrdelaytimer;
-	
 			ha->flags.process_response_queue = 1;
 		}
 	}
@@ -1539,20 +1554,20 @@ qla2x00_configure_loop(scsi_qla_host_t *ha)
 	if (ha->current_topology == ISP_CFG_FL &&
 	    (test_bit(LOCAL_LOOP_UPDATE, &flags))) {
 
-		ha->flags.rscn_queue_overflow = TRUE;
+		ha->flags.rscn_queue_overflow = 1;
 		set_bit(RSCN_UPDATE, &flags);
 
 	} else if (ha->current_topology == ISP_CFG_F &&
 	    (test_bit(LOCAL_LOOP_UPDATE, &flags))) {
 
-		ha->flags.rscn_queue_overflow = TRUE;
+		ha->flags.rscn_queue_overflow = 1;
 		set_bit(RSCN_UPDATE, &flags);
 		clear_bit(LOCAL_LOOP_UPDATE, &flags);
 
 	} else if (!ha->flags.online ||
 	    (test_bit(ABORT_ISP_ACTIVE, &flags))) {
 
-		ha->flags.rscn_queue_overflow = TRUE;
+		ha->flags.rscn_queue_overflow = 1;
 		set_bit(RSCN_UPDATE, &flags);
 		set_bit(LOCAL_LOOP_UPDATE, &flags);
 	}
@@ -2328,13 +2343,13 @@ qla2x00_configure_fabric(scsi_qla_host_t *ha)
 	do {
 		/* Ensure we are logged into the SNS. */
 		qla2x00_login_fabric(ha, SIMPLE_NAME_SERVER, 0xff, 0xff, 0xfc,
-		    mb, BIT_0);
+		    mb, BIT_1 | BIT_0);
 		if (mb[0] != MBS_COMMAND_COMPLETE) {
-			qla_printk(KERN_INFO, ha,
+			DEBUG2(qla_printk(KERN_INFO, ha,
 			    "Failed SNS login: loop_id=%x mb[0]=%x mb[1]=%x "
 			    "mb[2]=%x mb[6]=%x mb[7]=%x\n", SIMPLE_NAME_SERVER,
-			    mb[0], mb[1], mb[2], mb[6], mb[7]);
-			return (QLA_FUNCTION_FAILED);
+			    mb[0], mb[1], mb[2], mb[6], mb[7]));
+			return (QLA_SUCCESS);
 		}
 
 		if (test_and_clear_bit(REGISTER_FC4_NEEDED, &ha->dpc_flags)) {
@@ -2578,11 +2593,6 @@ qla2x00_find_all_fabric_devs(scsi_qla_host_t *ha, struct list_head *new_fcports)
 		if ((new_fcport->d_id.b.domain & 0xf0) == 0xf0)
 			continue;
 
-		/* Bypass if same domain and area of adapter. */
-		if ((new_fcport->d_id.b24 & 0xffff00) ==
-		    (ha->d_id.b24 & 0xffff00))
-			continue;
-
 		/* Locate matching device in database. */
 		found = 0;
 		list_for_each_entry(fcport, &ha->fcports, list) {
@@ -2592,6 +2602,15 @@ qla2x00_find_all_fabric_devs(scsi_qla_host_t *ha, struct list_head *new_fcports)
 
 			found++;
 
+			/*
+			 * If address the same and state FCS_ONLINE, nothing
+			 * changed.
+			 */
+			if (fcport->d_id.b24 == new_fcport->d_id.b24 &&
+			    atomic_read(&fcport->state) == FCS_ONLINE) {
+				break;
+			}
+
 			/*
 			 * If device was not a fabric device before.
 			 */
@@ -2604,15 +2623,6 @@ qla2x00_find_all_fabric_devs(scsi_qla_host_t *ha, struct list_head *new_fcports)
 				break;
 			}
 
-			/*
-			 * If address the same and state FCS_ONLINE, nothing
-			 * changed.
-			 */
-			if (fcport->d_id.b24 == new_fcport->d_id.b24 &&
-			    atomic_read(&fcport->state) == FCS_ONLINE) {
-				break;
-			}
-
 			/*
 			 * Port ID changed or device was marked to be updated;
 			 * Log it out if still logged in and mark it for
@@ -2882,7 +2892,7 @@ qla2x00_fabric_dev_login(scsi_qla_host_t *ha, fc_port_t *fcport,
 
 	rval = qla2x00_fabric_login(ha, fcport, next_loopid);
 	if (rval == QLA_SUCCESS) {
-		rval = qla2x00_get_port_database(ha, fcport, BIT_1 | BIT_0);
+		rval = qla2x00_get_port_database(ha, fcport, 0);
 		if (rval != QLA_SUCCESS) {
 			qla2x00_fabric_logout(ha, fcport->loop_id);
 		} else {
@@ -3095,7 +3105,7 @@ qla2x00_loop_resync(scsi_qla_host_t *ha)
 				wait_time &&
 				(test_bit(LOOP_RESYNC_NEEDED, &ha->dpc_flags)));
 		}
-		qla2x00_restart_queues(ha, TRUE);
+		qla2x00_restart_queues(ha, 1);
 	}
 
 	if (test_bit(ISP_ABORT_NEEDED, &ha->dpc_flags)) {
@@ -4098,7 +4108,7 @@ qla2x00_abort_isp(scsi_qla_host_t *ha)
 	uint8_t        status = 0;
 
 	if (ha->flags.online) {
-		ha->flags.online = FALSE;
+		ha->flags.online = 0;
 		clear_bit(ISP_ABORT_NEEDED, &ha->dpc_flags);
 		qla2x00_stats.ispAbort++;
 		ha->total_isp_aborts++;  /* used by ioctl */
@@ -4108,10 +4118,14 @@ qla2x00_abort_isp(scsi_qla_host_t *ha)
 		    "Performing ISP error recovery - ha= %p.\n", ha);
 		qla2x00_reset_chip(ha);
 
+		atomic_set(&ha->loop_down_timer, LOOP_DOWN_TIME);
 		if (atomic_read(&ha->loop_state) != LOOP_DOWN) {
 			atomic_set(&ha->loop_state, LOOP_DOWN);
-			atomic_set(&ha->loop_down_timer, LOOP_DOWN_TIME);
 			qla2x00_mark_all_devices_lost(ha);
+		} else {
+			if (!atomic_read(&ha->loop_down_timer))
+				atomic_set(&ha->loop_down_timer,
+				    LOOP_DOWN_TIME);
 		}
 
 		spin_lock_irqsave(&ha->hardware_lock, flags);
@@ -4123,23 +4137,27 @@ qla2x00_abort_isp(scsi_qla_host_t *ha)
 				if (ha->actthreads)
 					ha->actthreads--;
 				sp->lun_queue->out_cnt--;
-				sp->flags = 0;
 
 				/*
 				 * Set the cmd host_byte status depending on
 				 * whether the scsi_error_handler is
 				 * active or not.
  				 */
-				if (ha->host->eh_active != EH_ACTIVE) {
-					sp->cmd->result = DID_BUS_BUSY << 16;
+				if (sp->flags & SRB_TAPE) {
+					sp->cmd->result = DID_NO_CONNECT << 16;
 				} else {
-					sp->cmd->result = DID_RESET << 16;
+					if (ha->host->eh_active != EH_ACTIVE)
+						sp->cmd->result =
+						    DID_BUS_BUSY << 16;
+					else
+						sp->cmd->result =
+						    DID_RESET << 16;
 				}
+				sp->flags = 0;
 				sp->cmd->host_scribble = (unsigned char *)NULL;
 				add_to_done_queue(ha, sp);
 			}
 		}
-
 		spin_unlock_irqrestore(&ha->hardware_lock, flags);
 
 		qla2x00_nvram_config(ha);
@@ -4155,20 +4173,20 @@ qla2x00_abort_isp(scsi_qla_host_t *ha)
 				ha->marker_needed = 1;
 			}
 
-			ha->flags.online = TRUE;
+			ha->flags.online = 1;
 
 			/* Enable ISP interrupts. */
 			qla2x00_enable_intrs(ha);
 
 			/* v2.19.5b6 Return all commands */
-			qla2x00_abort_queues(ha, TRUE);
+			qla2x00_abort_queues(ha, 1);
 
 			/* Restart queues that may have been stopped. */
-			qla2x00_restart_queues(ha,TRUE);
+			qla2x00_restart_queues(ha, 1);
 			ha->isp_abort_cnt = 0; 
 			clear_bit(ISP_ABORT_RETRY, &ha->dpc_flags);
 		} else {	/* failed the ISP abort */
-			ha->flags.online = TRUE;
+			ha->flags.online = 1;
 			if (test_bit(ISP_ABORT_RETRY, &ha->dpc_flags)) {
 				if (ha->isp_abort_cnt == 0) {
  					qla_printk(KERN_WARNING, ha,
@@ -4179,8 +4197,8 @@ qla2x00_abort_isp(scsi_qla_host_t *ha)
 					 * completely.
 					 */
 					qla2x00_reset_adapter(ha);
-					qla2x00_abort_queues(ha, FALSE);
-					ha->flags.online = FALSE;
+					qla2x00_abort_queues(ha, 0);
+					ha->flags.online = 0;
 					clear_bit(ISP_ABORT_RETRY,
 					    &ha->dpc_flags);
 					status = 0;
@@ -4235,7 +4253,7 @@ qla2x00_restart_isp(scsi_qla_host_t *ha)
 
 	/* If firmware needs to be loaded */
 	if (qla2x00_isp_firmware(ha)) {
-		ha->flags.online = FALSE;
+		ha->flags.online = 0;
 		if (!(status = qla2x00_chip_diag(ha))) {
 			if (IS_QLA2100(ha) || IS_QLA2200(ha)) {
 				status = qla2x00_setup_chip(ha);
@@ -4274,7 +4292,7 @@ qla2x00_restart_isp(scsi_qla_host_t *ha)
 					"status = %d\n",
 					__func__,
 					status);)
-			ha->flags.online = TRUE;
+			ha->flags.online = 1;
 			/* Wait at most MAX_TARGET RSCNs for a stable link. */
 			wait_time = 256;
 			do {
@@ -4311,7 +4329,7 @@ qla2x00_reset_adapter(scsi_qla_host_t *ha)
 	unsigned long flags = 0;
 	device_reg_t *reg = ha->iobase;
 
-	ha->flags.online = FALSE;
+	ha->flags.online = 0;
 	qla2x00_disable_intrs(ha);
 	/* Reset RISC processor. */
 	spin_lock_irqsave(&ha->hardware_lock, flags);
diff --git a/drivers/scsi/qla2xxx/qla_inline.h b/drivers/scsi/qla2xxx/qla_inline.h
index fa6f6dd1b..9bd7757b9 100644
--- a/drivers/scsi/qla2xxx/qla_inline.h
+++ b/drivers/scsi/qla2xxx/qla_inline.h
@@ -165,7 +165,7 @@ static __inline__ int qla2x00_is_wwn_zero(uint8_t *);
  *      wwn = Pointer to WW name to check
  *
  * Returns:
- *      TRUE if name is 0 else FALSE
+ *      1 if name is 0x00 else 0
  *
  * Context:
  *      Kernel context.
@@ -179,7 +179,7 @@ qla2x00_is_wwn_zero(uint8_t *wwn)
 		if (*wwn != 0)
 			break;
 	}
-	/* if zero return TRUE */
+	/* if zero return 1 */
 	if (cnt == WWN_SIZE)
 		return (1);
 	else
diff --git a/drivers/scsi/qla2xxx/qla_iocb.c b/drivers/scsi/qla2xxx/qla_iocb.c
index 0baccf130..710a88d67 100644
--- a/drivers/scsi/qla2xxx/qla_iocb.c
+++ b/drivers/scsi/qla2xxx/qla_iocb.c
@@ -17,9 +17,11 @@
  *
  ******************************************************************************/
 
-#include "qla_os.h"
 #include "qla_def.h"
 
+#include <linux/blkdev.h>
+#include <linux/delay.h>
+
 static inline uint16_t qla2x00_get_cmd_direction(struct scsi_cmnd *cmd);
 static inline cont_entry_t *qla2x00_prep_cont_type0_iocb(scsi_qla_host_t *);
 static inline cont_a64_entry_t *qla2x00_prep_cont_type1_iocb(scsi_qla_host_t *);
@@ -42,28 +44,6 @@ qla2x00_get_cmd_direction(struct scsi_cmnd *cmd)
 		cflags = CF_WRITE;
 	else if (cmd->sc_data_direction == DMA_FROM_DEVICE)
 		cflags = CF_READ;
-	else {
-		switch (cmd->data_cmnd[0]) {
-		case WRITE_6:
-		case WRITE_10:
-		case WRITE_12:
-		case WRITE_BUFFER:
-		case WRITE_LONG:
-		case WRITE_SAME:
-		case WRITE_VERIFY:
-		case WRITE_VERIFY_12:
-		case FORMAT_UNIT:
-		case SEND_VOLUME_TAG:
-		case MODE_SELECT:
-		case SEND_DIAGNOSTIC:
-		case MODE_SELECT_10:
-			cflags = CF_WRITE;
-			break;
-		default:
-			cflags = CF_READ;
-			break;
-		}
-	}
 	return (cflags);
 }
 
@@ -350,11 +330,12 @@ qla2x00_start_scsi(srb_t *sp)
 	uint32_t	*clr_ptr;
 	uint32_t        index;
 	uint32_t	handle;
-	uint16_t	cnt;
 	cmd_entry_t	*cmd_pkt;
 	uint32_t        timeout;
 	struct scatterlist *sg;
-
+	uint16_t	cnt;
+	uint16_t	req_cnt;
+	uint16_t	tot_dsds;
 	device_reg_t	*reg;
 
 	/* Setup device pointers. */
@@ -372,72 +353,60 @@ qla2x00_start_scsi(srb_t *sp)
 		ha->marker_needed = 0;
 	}
 
-	/* Calculate number of segments and entries required. */
-	if (sp->req_cnt == 0) {
-		sp->tot_dsds = 0;
-		if (cmd->use_sg) {
-			sg = (struct scatterlist *) cmd->request_buffer;
-			sp->tot_dsds = pci_map_sg(ha->pdev, sg, cmd->use_sg,
-			    cmd->sc_data_direction);
-		} else if (cmd->request_bufflen) {
-		    sp->tot_dsds++;
-		}
-		sp->req_cnt = (ha->calc_request_entries)(sp->tot_dsds);
-	}
-
 	/* Acquire ring specific lock */
 	spin_lock_irqsave(&ha->hardware_lock, flags);
 
-	if (ha->req_q_cnt < (sp->req_cnt + 2)) {
-		/* Calculate number of free request entries */
-		cnt = RD_REG_WORD_RELAXED(ISP_REQ_Q_OUT(ha, reg));
-		if (ha->req_ring_index < cnt)
-			ha->req_q_cnt = cnt - ha->req_ring_index;
-		else
-			ha->req_q_cnt = ha->request_q_length -
-			    (ha->req_ring_index - cnt);
-	}
-
-	/* If no room for request in request ring */
-	if (ha->req_q_cnt < (sp->req_cnt + 2)) {
-		DEBUG5(printk("scsi(%ld): in-ptr=%x req_q_cnt=%x "
-		    "tot_dsds=%x.\n",
-		    ha->host_no, ha->req_ring_index, ha->req_q_cnt,
-		    sp->tot_dsds));
-
-		goto queuing_error;
-	}
-
 	/* Check for room in outstanding command list. */
 	handle = ha->current_outstanding_cmd;
 	for (index = 1; index < MAX_OUTSTANDING_COMMANDS; index++) {
 		handle++;
 		if (handle == MAX_OUTSTANDING_COMMANDS)
 			handle = 1;
-		if (ha->outstanding_cmds[handle] == 0) {
-			ha->current_outstanding_cmd = handle;
+		if (ha->outstanding_cmds[handle] == 0)
 			break;
-		}
 	}
-	if (index == MAX_OUTSTANDING_COMMANDS) {
-		DEBUG5(printk("scsi(%ld): Unable to queue command -- NO ROOM "
-		    "IN OUTSTANDING ARRAY (req_q_cnt=%x).\n",
-		    ha->host_no, ha->req_q_cnt));
+	if (index == MAX_OUTSTANDING_COMMANDS)
 		goto queuing_error;
+
+	/* Calculate the number of request entries needed. */
+	req_cnt = (ha->calc_request_entries)(cmd->request->nr_hw_segments);
+	if (ha->req_q_cnt < (req_cnt + 2)) {
+		cnt = RD_REG_WORD_RELAXED(ISP_REQ_Q_OUT(ha, reg));
+		if (ha->req_ring_index < cnt)
+			ha->req_q_cnt = cnt - ha->req_ring_index;
+		else
+			ha->req_q_cnt = ha->request_q_length -
+			    (ha->req_ring_index - cnt);
+	}
+	if (ha->req_q_cnt < (req_cnt + 2))
+		goto queuing_error;
+
+	/* Finally, we have enough space, now perform mappings. */
+	tot_dsds = 0;
+	if (cmd->use_sg) {
+		sg = (struct scatterlist *) cmd->request_buffer;
+		tot_dsds = pci_map_sg(ha->pdev, sg, cmd->use_sg,
+		    cmd->sc_data_direction);
+		if (tot_dsds == 0)
+			goto queuing_error;
+	} else if (cmd->request_bufflen) {
+	    tot_dsds++;
 	}
+	req_cnt = (ha->calc_request_entries)(tot_dsds);
 
 	/* Build command packet */
+	ha->current_outstanding_cmd = handle;
 	ha->outstanding_cmds[handle] = sp;
 	sp->ha = ha;
 	sp->cmd->host_scribble = (unsigned char *)(unsigned long)handle;
-	ha->req_q_cnt -= sp->req_cnt;
+	ha->req_q_cnt -= req_cnt;
 
 	cmd_pkt = (cmd_entry_t *)ha->request_ring_ptr;
 	cmd_pkt->handle = handle;
 	/* Zero out remaining portion of packet. */
 	clr_ptr = (uint32_t *)cmd_pkt + 2;
 	memset(clr_ptr, 0, REQUEST_ENTRY_SIZE - 8);
-	cmd_pkt->dseg_count = cpu_to_le16(sp->tot_dsds);
+	cmd_pkt->dseg_count = cpu_to_le16(tot_dsds);
 
 	/* Set target ID */
 	SET_TARGET_ID(ha, cmd_pkt->target, fclun->fcport->loop_id);
@@ -477,10 +446,11 @@ qla2x00_start_scsi(srb_t *sp)
 	cmd_pkt->byte_count = cpu_to_le32((uint32_t)cmd->request_bufflen);
 
 	/* Build IOCB segments */
-	(ha->build_scsi_iocbs)(sp, cmd_pkt, sp->tot_dsds);
+	(ha->build_scsi_iocbs)(sp, cmd_pkt, tot_dsds);
 
 	/* Set total data segment count. */
-	cmd_pkt->entry_count = (uint8_t)sp->req_cnt;
+	cmd_pkt->entry_count = (uint8_t)req_cnt;
+	wmb();
 
 	/* Adjust ring index. */
 	ha->req_ring_index++;
@@ -541,6 +511,7 @@ __qla2x00_marker(scsi_qla_host_t *ha, uint16_t loop_id, uint16_t lun,
 		pkt->lun = cpu_to_le16(lun);
 		SET_TARGET_ID(ha, pkt->target, loop_id);
 	}
+	wmb();
 
 	/* Issue command to ISP */
 	qla2x00_isp_cmd(ha);
diff --git a/drivers/scsi/qla2xxx/qla_isr.c b/drivers/scsi/qla2xxx/qla_isr.c
index 382a4fe93..f9284fd87 100644
--- a/drivers/scsi/qla2xxx/qla_isr.c
+++ b/drivers/scsi/qla2xxx/qla_isr.c
@@ -16,9 +16,6 @@
  * General Public License for more details.
  *
  */
-
-#include "qla_os.h"
-
 #include "qla_def.h"
 
 static void qla2x00_mbx_completion(scsi_qla_host_t *, uint16_t);
@@ -109,7 +106,25 @@ qla2x00_intr_handler(int irq, void *dev_id, struct pt_regs *regs)
 			}
 		} else /* IS_QLA23XX(ha) */ {
 			stat = RD_REG_DWORD(&reg->u.isp2300.host_status);
-			if ((stat & HSR_RISC_INT) == 0)
+			if (stat & HSR_RISC_PAUSED) {
+				hccr = RD_REG_WORD(&reg->hccr);
+				if (hccr & (BIT_15 | BIT_13 | BIT_11 | BIT_8))
+					qla_printk(KERN_INFO, ha,
+					    "Parity error -- HCCR=%x.\n", hccr);
+				else
+					qla_printk(KERN_INFO, ha,
+					    "RISC paused -- HCCR=%x\n", hccr);
+
+				/*
+				 * Issue a "HARD" reset in order for the RISC
+				 * interrupt bit to be cleared.  Schedule a big
+				 * hammmer to get out of the RISC PAUSED state.
+				 */
+				WRT_REG_WORD(&reg->hccr, HCCR_RESET_RISC);
+				RD_REG_WORD(&reg->hccr);
+				set_bit(ISP_ABORT_NEEDED, &ha->dpc_flags);
+				break;
+			} else if ((stat & HSR_RISC_INT) == 0)
 				break;
 
 			mbx = MSW(stat);
@@ -139,29 +154,9 @@ qla2x00_intr_handler(int irq, void *dev_id, struct pt_regs *regs)
 				qla2x00_async_event(ha, mbx);
 				break;
 			default:
-				hccr = RD_REG_WORD(&reg->hccr);
-				if (hccr & HCCR_RISC_PAUSE) {
-					qla_printk(KERN_INFO, ha,
-					    "RISC paused, dumping HCCR=%x\n",
-					    hccr);
-
-					/*
-					 * Issue a "HARD" reset in order for
-					 * the RISC interrupt bit to be
-					 * cleared.  Schedule a big hammmer to
-					 * get out of the RISC PAUSED state.
-					 */
-					WRT_REG_WORD(&reg->hccr,
-					    HCCR_RESET_RISC);
-					RD_REG_WORD(&reg->hccr);
-					set_bit(ISP_ABORT_NEEDED,
-					    &ha->dpc_flags);
-					break;
-				} else {
-					DEBUG2(printk("scsi(%ld): Unrecognized "
-					    "interrupt type (%d)\n",
-					    ha->host_no, stat & 0xff));
-				}
+				DEBUG2(printk("scsi(%ld): Unrecognized "
+				    "interrupt type (%d)\n",
+				    ha->host_no, stat & 0xff));
 				break;
 			}
 			WRT_REG_WORD(&reg->hccr, HCCR_CLR_RISC_INT);
@@ -235,7 +230,7 @@ qla2x00_mbx_completion(scsi_qla_host_t *ha, uint16_t mb0)
 	device_reg_t	*reg = ha->iobase;
 
 	/* Load return mailbox registers. */
-	ha->flags.mbox_int = TRUE;
+	ha->flags.mbox_int = 1;
 	ha->mailbox_out[0] = mb0;
 	wptr = (uint16_t *)MAILBOX_REG(ha, reg, 1);
 
@@ -344,7 +339,6 @@ qla2x00_async_event(scsi_qla_host_t *ha, uint32_t mbx)
 		break;
 	}
 
-	mb[0] = LSW(mbx);
 	switch (mb[0]) {
 	case MBA_SCSI_COMPLETION:	/* Fast Post */
 		if (!ha->flags.online)
@@ -692,7 +686,7 @@ qla2x00_process_completed_request(struct scsi_qla_host *ha, uint32_t index)
 	sp = ha->outstanding_cmds[index];
 	if (sp) {
 		/* Free outstanding command slot. */
-		ha->outstanding_cmds[index] = 0;
+		ha->outstanding_cmds[index] = NULL;
 
 		if (ha->actthreads)
 			ha->actthreads--;
@@ -827,7 +821,7 @@ qla2x00_status_entry(scsi_qla_host_t *ha, sts_entry_t *pkt)
 	uint16_t	comp_status;
 	uint16_t	scsi_status;
 	uint8_t		lscsi_status;
-	uint32_t	resid;
+	int32_t		resid;
 	uint8_t		sense_sz = 0;
 	uint16_t	rsp_info_len;
 
@@ -842,7 +836,7 @@ qla2x00_status_entry(scsi_qla_host_t *ha, sts_entry_t *pkt)
 	/* Validate handle. */
 	if (pkt->handle < MAX_OUTSTANDING_COMMANDS) {
 		sp = ha->outstanding_cmds[pkt->handle];
-		ha->outstanding_cmds[pkt->handle] = 0;
+		ha->outstanding_cmds[pkt->handle] = NULL;
 	} else
 		sp = NULL;
 
@@ -948,6 +942,11 @@ qla2x00_status_entry(scsi_qla_host_t *ha, sts_entry_t *pkt)
 			cp->result = DID_OK << 16;
 			break;
 		}
+		if (scsi_status & (SS_RESIDUAL_UNDER | SS_RESIDUAL_OVER)) {
+			resid = le32_to_cpu(pkt->residual_length);
+			cp->resid = resid;
+			CMD_RESID_LEN(cp) = resid;
+		}
 		if (lscsi_status == SS_BUSY_CONDITION) {
 			cp->result = DID_BUS_BUSY << 16 | lscsi_status;
 			break;
@@ -1009,7 +1008,10 @@ qla2x00_status_entry(scsi_qla_host_t *ha, sts_entry_t *pkt)
 		    ha->host_no, t, l, comp_status, scsi_status));
 
 		resid = le32_to_cpu(pkt->residual_length);
-		CMD_RESID_LEN(cp) = resid;
+		if (scsi_status & SS_RESIDUAL_UNDER) {
+			cp->resid = resid;
+			CMD_RESID_LEN(cp) = resid;
+		}
 
 		/*
 		 * Check to see if SCSI Status is non zero. If so report SCSI 
@@ -1085,7 +1087,6 @@ qla2x00_status_entry(scsi_qla_host_t *ha, sts_entry_t *pkt)
 			}
 
 			/* Handle mid-layer underflow */
-			cp->resid = resid;
 			if ((unsigned)(cp->request_bufflen - resid) <
 			    cp->underflow) {
 				qla_printk(KERN_INFO, ha,
@@ -1319,7 +1320,7 @@ qla2x00_error_entry(scsi_qla_host_t *ha, sts_entry_t *pkt)
 
 	if (sp) {
 		/* Free outstanding command slot. */
-		ha->outstanding_cmds[pkt->handle] = 0;
+		ha->outstanding_cmds[pkt->handle] = NULL;
 		if (ha->actthreads)
 			ha->actthreads--;
 		sp->lun_queue->out_cnt--;
@@ -1382,7 +1383,7 @@ qla2x00_ms_entry(scsi_qla_host_t *ha, ms_iocb_entry_t *pkt)
 	CMD_ENTRY_STATUS(sp->cmd) = pkt->entry_status;
 
 	/* Free outstanding command slot. */
-	ha->outstanding_cmds[pkt->handle1] = 0;
+	ha->outstanding_cmds[pkt->handle1] = NULL;
 
 	add_to_done_queue(ha, sp);
 }
diff --git a/drivers/scsi/qla2xxx/qla_mbx.c b/drivers/scsi/qla2xxx/qla_mbx.c
index 8fbe3fdd7..eadc3d4d2 100644
--- a/drivers/scsi/qla2xxx/qla_mbx.c
+++ b/drivers/scsi/qla2xxx/qla_mbx.c
@@ -16,11 +16,9 @@
  * General Public License for more details.
  *
  */
-
-#include "qla_os.h"
-
 #include "qla_def.h"
 
+#include <linux/delay.h>
 
 static void
 qla2x00_mbx_sem_timeout(unsigned long data)
@@ -89,7 +87,7 @@ qla2x00_mailbox_command(scsi_qla_host_t *ha, mbx_cmd_t *mcp)
 		}
 	}
 
-	ha->flags.mbox_busy = TRUE;
+	ha->flags.mbox_busy = 1;
 	/* Save mailbox command for debug */
 	ha->mcp = mcp;
 
@@ -135,7 +133,7 @@ qla2x00_mailbox_command(scsi_qla_host_t *ha, mbx_cmd_t *mcp)
 #endif
 
 	/* Issue set host interrupt command to send cmd out. */
-	ha->flags.mbox_int = FALSE;
+	ha->flags.mbox_int = 0;
 	clear_bit(MBX_INTERRUPT, &ha->mbx_cmd_flags);
 
 	/* Unlock mbx registers and wait for interrupt */
@@ -216,7 +214,7 @@ qla2x00_mailbox_command(scsi_qla_host_t *ha, mbx_cmd_t *mcp)
 		    command);)
 
 		/* Got interrupt. Clear the flag. */
-		ha->flags.mbox_int = FALSE;
+		ha->flags.mbox_int = 0;
 		clear_bit(MBX_INTERRUPT, &ha->mbx_cmd_flags);
 
 		if (ha->mailbox_out[0] != MBS_COMMAND_COMPLETE) {
@@ -257,7 +255,7 @@ qla2x00_mailbox_command(scsi_qla_host_t *ha, mbx_cmd_t *mcp)
 	if (!abort_active)
 		spin_unlock_irqrestore(&ha->mbx_reg_lock, mbx_flags);
 
-	ha->flags.mbox_busy = FALSE;
+	ha->flags.mbox_busy = 0;
 
 	/* Clean up */
 	ha->mcp = NULL;
@@ -546,7 +544,7 @@ qla2x00_execute_fw(scsi_qla_host_t *ha)
  */
 void
 qla2x00_get_fw_version(scsi_qla_host_t *ha, uint16_t *major, uint16_t *minor,
-    uint16_t *subminor, uint16_t *attributes)
+    uint16_t *subminor, uint16_t *attributes, uint32_t *memory)
 {
 	int		rval;
 	mbx_cmd_t	mc;
@@ -556,7 +554,7 @@ qla2x00_get_fw_version(scsi_qla_host_t *ha, uint16_t *major, uint16_t *minor,
 
 	mcp->mb[0] = MBC_GET_FIRMWARE_VERSION;
 	mcp->out_mb = MBX_0;
-	mcp->in_mb = MBX_6|MBX_3|MBX_2|MBX_1|MBX_0;
+	mcp->in_mb = MBX_6|MBX_5|MBX_4|MBX_3|MBX_2|MBX_1|MBX_0;
 	mcp->flags = 0;
 	mcp->tov = 30;
 	rval = qla2x00_mailbox_command(ha, mcp);
@@ -566,6 +564,10 @@ qla2x00_get_fw_version(scsi_qla_host_t *ha, uint16_t *major, uint16_t *minor,
 	*minor = mcp->mb[2];
 	*subminor = mcp->mb[3];
 	*attributes = mcp->mb[6];
+	if (IS_QLA2100(ha) || IS_QLA2200(ha))
+		*memory = 0x1FFFF;			/* Defaults to 128KB. */
+	else
+		*memory = (mcp->mb[5] << 16) | mcp->mb[4];
 
 	if (rval != QLA_SUCCESS) {
 		/*EMPTY*/
@@ -1431,35 +1433,37 @@ qla2x00_get_port_database(scsi_qla_host_t *ha, fc_port_t *fcport, uint8_t opt)
 	mcp->flags = MBX_DMA_IN;
 	mcp->tov = (ha->login_timeout * 2) + (ha->login_timeout / 2);
 	rval = qla2x00_mailbox_command(ha, mcp);
+	if (rval != QLA_SUCCESS)
+		goto gpd_error_out;
 
-	if (rval == QLA_SUCCESS) {
-		/* Names are little-endian. */
-		memcpy(fcport->node_name, pd->node_name, WWN_SIZE);
-		memcpy(fcport->port_name, pd->port_name, WWN_SIZE);
-
-		/* Get port_id of device. */
-		fcport->d_id.b.al_pa = pd->port_id[2];
-		fcport->d_id.b.area = pd->port_id[3];
-		fcport->d_id.b.domain = pd->port_id[0];
-		fcport->d_id.b.rsvd_1 = 0;
-
-		/* Check for device require authentication. */
-		pd->common_features & BIT_5 ? (fcport->flags |= FCF_AUTH_REQ) :
-		    (fcport->flags &= ~FCF_AUTH_REQ);
-
-		/* If not target must be initiator or unknown type. */
-		if ((pd->prli_svc_param_word_3[0] & BIT_4) == 0) {
-			fcport->port_type = FCT_INITIATOR;
-		} else {
-			fcport->port_type = FCT_TARGET;
-
-			/* Check for logged in. */
-			if (pd->master_state != PD_STATE_PORT_LOGGED_IN &&
-			    pd->slave_state != PD_STATE_PORT_LOGGED_IN)
-				rval = QLA_FUNCTION_FAILED;
-		}
+	/* Check for logged in state. */
+	if (pd->master_state != PD_STATE_PORT_LOGGED_IN &&
+	    pd->slave_state != PD_STATE_PORT_LOGGED_IN) {
+		rval = QLA_FUNCTION_FAILED;
+		goto gpd_error_out;
 	}
 
+	/* Names are little-endian. */
+	memcpy(fcport->node_name, pd->node_name, WWN_SIZE);
+	memcpy(fcport->port_name, pd->port_name, WWN_SIZE);
+
+	/* Get port_id of device. */
+	fcport->d_id.b.al_pa = pd->port_id[2];
+	fcport->d_id.b.area = pd->port_id[3];
+	fcport->d_id.b.domain = pd->port_id[0];
+	fcport->d_id.b.rsvd_1 = 0;
+
+	/* Check for device require authentication. */
+	pd->common_features & BIT_5 ? (fcport->flags |= FCF_AUTH_REQ) :
+	    (fcport->flags &= ~FCF_AUTH_REQ);
+
+	/* If not target must be initiator or unknown type. */
+	if ((pd->prli_svc_param_word_3[0] & BIT_4) == 0)
+		fcport->port_type = FCT_INITIATOR;
+	else
+		fcport->port_type = FCT_TARGET;
+
+gpd_error_out:
 	pci_free_consistent(ha->pdev, PORT_DATABASE_SIZE, pd, pd_dma);
 
 	if (rval != QLA_SUCCESS) {
diff --git a/drivers/scsi/qla2xxx/qla_os.c b/drivers/scsi/qla2xxx/qla_os.c
index cf3b81211..dd5aaba4e 100644
--- a/drivers/scsi/qla2xxx/qla_os.c
+++ b/drivers/scsi/qla2xxx/qla_os.c
@@ -16,10 +16,17 @@
  * General Public License for more details.
  *
  */
-
-#include "qla_os.h"
 #include "qla_def.h"
 
+#include <linux/moduleparam.h>
+#include <linux/vmalloc.h>
+#include <linux/smp_lock.h>
+
+#include <scsi/scsi_tcq.h>
+#include <scsi/scsicam.h>
+#include <scsi/scsi_transport.h>
+#include <scsi/scsi_transport_fc.h>
+
 /*
  * Driver version
  */
@@ -46,72 +53,79 @@ int apiHBAInstance;
  * Module parameter information and variables
  */
 int ql2xmaxqdepth;
-module_param(ql2xmaxqdepth, int, 0);
+module_param(ql2xmaxqdepth, int, S_IRUGO|S_IWUSR);
 MODULE_PARM_DESC(ql2xmaxqdepth,
 		"Maximum queue depth to report for target devices.");
 
 int ql2xlogintimeout = 20;
-module_param(ql2xlogintimeout, int, 0);
+module_param(ql2xlogintimeout, int, S_IRUGO|S_IRUSR);
 MODULE_PARM_DESC(ql2xlogintimeout,
 		"Login timeout value in seconds.");
 
 int qlport_down_retry;
-module_param(qlport_down_retry, int, 0);
+module_param(qlport_down_retry, int, S_IRUGO|S_IRUSR);
 MODULE_PARM_DESC(qlport_down_retry,
 		"Maximum number of command retries to a port that returns"
 		"a PORT-DOWN status.");
 
 int ql2xretrycount = 20;
-module_param(ql2xretrycount, int, 0);
+module_param(ql2xretrycount, int, S_IRUGO|S_IWUSR);
 MODULE_PARM_DESC(ql2xretrycount,
 		"Maximum number of mid-layer retries allowed for a command.  "
 		"Default value is 20, ");
 
 int displayConfig;
-module_param(displayConfig, int, 0);
+module_param(displayConfig, int, S_IRUGO|S_IWUSR);
 MODULE_PARM_DESC(displayConfig,
 		"If 1 then display the configuration used in /etc/modprobe.conf.");
 
 int ql2xplogiabsentdevice;
-module_param(ql2xplogiabsentdevice, int, 0);
+module_param(ql2xplogiabsentdevice, int, S_IRUGO|S_IWUSR);
 MODULE_PARM_DESC(ql2xplogiabsentdevice,
 		"Option to enable PLOGI to devices that are not present after "
 		"a Fabric scan.  This is needed for several broken switches."
 		"Default is 0 - no PLOGI. 1 - perfom PLOGI.");
 
+int ql2xenablezio = 0;
+module_param(ql2xenablezio, int, S_IRUGO|S_IRUSR);
+MODULE_PARM_DESC(ql2xenablezio,
+		"Option to enable ZIO:If 1 then enable it otherwise" 
+		" use the default set in the NVRAM."
+		" Default is 0 : disabled");
+
 int ql2xintrdelaytimer = 10;
-module_param(ql2xintrdelaytimer, int, 0);
+module_param(ql2xintrdelaytimer, int, S_IRUGO|S_IRUSR);
 MODULE_PARM_DESC(ql2xintrdelaytimer,
 		"ZIO: Waiting time for Firmware before it generates an "
 		"interrupt to the host to notify completion of request.");
 
 int ConfigRequired;
-module_param(ConfigRequired, int, 0);
+module_param(ConfigRequired, int, S_IRUGO|S_IRUSR);
 MODULE_PARM_DESC(ConfigRequired,
 		"If 1, then only configured devices passed in through the"
 		"ql2xopts parameter will be presented to the OS");
 
 int Bind = BIND_BY_PORT_NAME;
-module_param(Bind, int, 0);
+module_param(Bind, int, S_IRUGO|S_IRUSR);
 MODULE_PARM_DESC(Bind,
 		"Target persistent binding method: "
 		"0 by Portname (default); 1 by PortID; 2 by Nodename. ");
 
 int ql2xsuspendcount = SUSPEND_COUNT;
-module_param(ql2xsuspendcount, int, 0);
+module_param(ql2xsuspendcount, int, S_IRUGO|S_IWUSR);
 MODULE_PARM_DESC(ql2xsuspendcount,
 		"Number of 6-second suspend iterations to perform while a "
 		"target returns a <NOT READY> status.  Default is 10 "
 		"iterations.");
 
 int ql2xdoinitscan = 1;
-module_param(ql2xdoinitscan, int, 0);
+module_param(ql2xdoinitscan, int, S_IRUGO|S_IWUSR);
 MODULE_PARM_DESC(ql2xdoinitscan,
 		"Signal mid-layer to perform scan after driver load: 0 -- no "
 		"signal sent to mid-layer.");
 
 int ql2xloginretrycount = 0;
-module_param(ql2xloginretrycount, int, 0);
+module_param(ql2xloginretrycount, int, S_IRUGO|S_IRUSR);
 MODULE_PARM_DESC(ql2xloginretrycount,
 		"Specify an alternate value for the NVRAM login retry count.");
 
@@ -128,13 +142,6 @@ struct info_str {
 static void copy_mem_info(struct info_str *, char *, int);
 static int copy_info(struct info_str *, char *, ...);
 
-
-/*
- * List of host adapters
- */
-LIST_HEAD(qla_hostlist);
-rwlock_t qla_hostlist_lock = RW_LOCK_UNLOCKED;
-
 static void qla2x00_free_device(scsi_qla_host_t *);
 
 static void qla2x00_config_dma_addressing(scsi_qla_host_t *ha);
@@ -147,7 +154,7 @@ static int qla2xxx_eh_abort(struct scsi_cmnd *);
 static int qla2xxx_eh_device_reset(struct scsi_cmnd *);
 static int qla2xxx_eh_bus_reset(struct scsi_cmnd *);
 static int qla2xxx_eh_host_reset(struct scsi_cmnd *);
-static uint8_t qla2x00_loop_reset(scsi_qla_host_t *ha);
+static int qla2x00_loop_reset(scsi_qla_host_t *ha);
 static int qla2x00_device_reset(scsi_qla_host_t *, fc_port_t *);
 
 static int qla2x00_proc_info(struct Scsi_Host *, char *, char **,
@@ -183,8 +190,6 @@ static struct scsi_transport_template *qla2xxx_transport_template = NULL;
 
 static void qla2x00_display_fc_names(scsi_qla_host_t *);
 
-void qla2x00_blink_led(scsi_qla_host_t *);
-
 /* TODO Convert to inlines
  *
  * Timer routines
@@ -457,6 +462,7 @@ static ssize_t qla2x00_sysfs_write_fw_dump(struct kobject *kobj, char *buf,
 	struct scsi_qla_host *ha = to_qla_host(dev_to_shost(container_of(kobj,
 	    struct device, kobj)));
 	int reading;
+	uint32_t dump_size;
 
 	if (off != 0)
 		return (0);
@@ -482,11 +488,16 @@ static ssize_t qla2x00_sysfs_write_fw_dump(struct kobject *kobj, char *buf,
 		if (ha->fw_dump != NULL && !ha->fw_dump_reading) {
 			ha->fw_dump_reading = 1;
 
-			ha->fw_dump_buffer = (char *)vmalloc(FW_DUMP_SIZE);
+			dump_size = FW_DUMP_SIZE_1M;
+			if (ha->fw_memory_size < 0x20000) 
+				dump_size = FW_DUMP_SIZE_128K;
+			else if (ha->fw_memory_size < 0x80000) 
+				dump_size = FW_DUMP_SIZE_512K;
+			ha->fw_dump_buffer = (char *)vmalloc(dump_size);
 			if (ha->fw_dump_buffer == NULL) {
 				qla_printk(KERN_WARNING, ha,
 				    "Unable to allocate memory for firmware "
-				    "dump buffer (%d).\n", FW_DUMP_SIZE);
+				    "dump buffer (%d).\n", dump_size);
 
 				ha->fw_dump_reading = 0;
 				return (count);
@@ -494,7 +505,7 @@ static ssize_t qla2x00_sysfs_write_fw_dump(struct kobject *kobj, char *buf,
 			qla_printk(KERN_INFO, ha,
 			    "Firmware dump ready for read on (%ld).\n",
 			    ha->host_no);
-			memset(ha->fw_dump_buffer, 0, FW_DUMP_SIZE);
+			memset(ha->fw_dump_buffer, 0, dump_size);
 			if (IS_QLA2100(ha) || IS_QLA2200(ha))
  				qla2100_ascii_fw_dump(ha);
  			else
@@ -878,39 +889,38 @@ qla2x00_queuecommand(struct scsi_cmnd *cmd, void (*fn)(struct scsi_cmnd *))
 static int
 qla2x00_eh_wait_on_command(scsi_qla_host_t *ha, struct scsi_cmnd *cmd)
 {
-#define ABORT_WAIT_TIME	10 /* seconds */
+#define ABORT_POLLING_PERIOD	HZ
+#define ABORT_WAIT_TIME		((10 * HZ) / (ABORT_POLLING_PERIOD))
 
 	int		found = 0;
 	int		done = 0;
-	srb_t		*rp;
+	srb_t		*rp = NULL;
 	struct list_head *list, *temp;
-	u_long		cpu_flags = 0;
 	u_long		max_wait_time = ABORT_WAIT_TIME;
 
 	do {
 		/* Check on done queue */
-		if (!found) {
-			spin_lock_irqsave(&ha->list_lock, cpu_flags);
-			list_for_each_safe(list, temp, &ha->done_queue) {
-				rp = list_entry(list, srb_t, list);
+		spin_lock(&ha->list_lock);
+		list_for_each_safe(list, temp, &ha->done_queue) {
+			rp = list_entry(list, srb_t, list);
 
-				/*
-				* Found command.  Just exit and wait for the
-				* cmd sent to OS.
-			 	*/
-				if (cmd == rp->cmd) {
-					found++;
-					DEBUG3(printk("%s: found in done "
-							"queue.\n", __func__);)
-					break;
-				}
+			/*
+			 * Found command. Just exit and wait for the cmd sent
+			 * to OS.
+			*/
+			if (cmd == rp->cmd) {
+				found++;
+				DEBUG3(printk("%s: found in done queue.\n",
+				    __func__);)
+				break;
 			}
-			spin_unlock_irqrestore(&ha->list_lock, cpu_flags);
 		}
+		spin_unlock(&ha->list_lock);
 
-		/* Checking to see if its returned to OS */
-		rp = (srb_t *) CMD_SP(cmd);
-		if (rp == NULL ) {
+		/* Complete the cmd right away. */
+		if (found) { 
+			qla2x00_delete_from_done_queue(ha, rp);
+			sp_put(ha, rp);
 			done++;
 			break;
 		}
@@ -918,20 +928,14 @@ qla2x00_eh_wait_on_command(scsi_qla_host_t *ha, struct scsi_cmnd *cmd)
 		spin_unlock_irq(ha->host->host_lock);
 
 		set_current_state(TASK_UNINTERRUPTIBLE);
-		schedule_timeout(2*HZ);
+		schedule_timeout(ABORT_POLLING_PERIOD);
 
 		spin_lock_irq(ha->host->host_lock);
 
 	} while ((max_wait_time--));
 
-	if (done) {
+	if (done)
 		DEBUG2(printk(KERN_INFO "%s: found cmd=%p.\n", __func__, cmd));
-	} else if (found) {
-		/* Immediately return command to the mid-layer */
-		qla2x00_delete_from_done_queue(ha, rp);
-		sp_put(ha, rp);
-		done++;
-	}
 
 	return (done);
 }
@@ -953,7 +957,7 @@ qla2x00_eh_wait_on_command(scsi_qla_host_t *ha, struct scsi_cmnd *cmd)
  *    Success (Adapter is online) : 0
  *    Failed  (Adapter is offline/disabled) : 1
  */
-static inline int 
+int 
 qla2x00_wait_for_hba_online(scsi_qla_host_t *ha)
 {
 	int 	 return_status;
@@ -962,16 +966,15 @@ qla2x00_wait_for_hba_online(scsi_qla_host_t *ha)
 	wait_online = jiffies + (MAX_LOOP_TIMEOUT * HZ); 
 	while (((test_bit(ISP_ABORT_NEEDED, &ha->dpc_flags)) ||
 	    test_bit(ABORT_ISP_ACTIVE, &ha->dpc_flags) ||
-	    test_bit(ISP_ABORT_RETRY, &ha->dpc_flags)) &&
-		time_before(jiffies, wait_online)) {
+	    test_bit(ISP_ABORT_RETRY, &ha->dpc_flags) ||
+	    ha->dpc_active) && time_before(jiffies, wait_online)) {
 
 		set_current_state(TASK_UNINTERRUPTIBLE);
 		schedule_timeout(HZ);
 	}
-	if (ha->flags.online == TRUE) 
+	if (ha->flags.online) 
 		return_status = QLA_SUCCESS; 
 	else
-		/* Adapter is disabled/offline */
 		return_status = QLA_FUNCTION_FAILED;
 
 	DEBUG2(printk("%s return_status=%d\n",__func__,return_status));
@@ -1046,7 +1049,6 @@ qla2xxx_eh_abort(struct scsi_cmnd *cmd)
 	struct Scsi_Host *host;
 	uint8_t		found = 0;
 	unsigned int	b, t, l;
-	unsigned long	flags;
 
 	/* Get the SCSI request ptr */
 	sp = (srb_t *) CMD_SP(cmd);
@@ -1061,7 +1063,7 @@ qla2xxx_eh_abort(struct scsi_cmnd *cmd)
 		qla_printk(KERN_INFO, to_qla_host(cmd->device->host),
 		    "qla2xxx_eh_abort: cmd already done sp=%p\n", sp);
 		DEBUG(printk("qla2xxx_eh_abort: cmd already done sp=%p\n", sp);)
-		return(SUCCESS);
+		return SUCCESS;
 	}
 	if (sp) {
 		DEBUG(printk("qla2xxx_eh_abort: refcount %i \n",
@@ -1092,7 +1094,7 @@ qla2xxx_eh_abort(struct scsi_cmnd *cmd)
 			"qla2x00: (%x:%x:%x) No LUN queue.\n", b, t, l);
 
 		/* no action - we don't have command */
-		return(FAILED);
+		return FAILED;
 	}
 
 	DEBUG2(printk("scsi(%ld): ABORTing cmd=%p sp=%p jiffies = 0x%lx, "
@@ -1102,16 +1104,15 @@ qla2xxx_eh_abort(struct scsi_cmnd *cmd)
 	DEBUG2(qla2x00_print_scsi_cmd(cmd));
 
 	spin_unlock_irq(ha->host->host_lock);
-	/* Blocking call-Does context switching if abort isp is active etc */  
 	if (qla2x00_wait_for_hba_online(ha) != QLA_SUCCESS) {
 		DEBUG2(printk("%s failed:board disabled\n", __func__);)
 		spin_lock_irq(ha->host->host_lock);
-		return (FAILED);
+		return FAILED;
 	}
 	spin_lock_irq(ha->host->host_lock);
 
 	/* Search done queue */
-	spin_lock_irqsave(&ha->list_lock,flags);
+	spin_lock(&ha->list_lock);
 	list_for_each_safe(list, temp, &ha->done_queue) {
 		rp = list_entry(list, srb_t, list);
 
@@ -1128,7 +1129,7 @@ qla2xxx_eh_abort(struct scsi_cmnd *cmd)
 
 		break;
 	} /* list_for_each_safe() */
-	spin_unlock_irqrestore(&ha->list_lock, flags);
+	spin_unlock(&ha->list_lock);
 
 	/*
 	 * Return immediately if the aborted command was already in the done
@@ -1149,7 +1150,7 @@ qla2xxx_eh_abort(struct scsi_cmnd *cmd)
 	DEBUG3(printk("qla2xxx_eh_abort: searching sp %p in retry "
 		    "queue.\n", sp);)
 
-	spin_lock_irqsave(&ha->list_lock, flags);
+	spin_lock(&ha->list_lock);
 	list_for_each_safe(list, temp, &ha->retry_queue) {
 		rp = list_entry(list, srb_t, list);
 
@@ -1170,7 +1171,7 @@ qla2xxx_eh_abort(struct scsi_cmnd *cmd)
 		break;
 
 	} 
-	spin_unlock_irqrestore(&ha->list_lock, flags);
+	spin_unlock(&ha->list_lock);
 
 
 	/*
@@ -1181,7 +1182,7 @@ qla2xxx_eh_abort(struct scsi_cmnd *cmd)
 		DEBUG3(printk("qla2xxx_eh_abort: searching sp %p "
 		    "in pending queue.\n", sp);)
 
-		spin_lock_irqsave(&vis_ha->list_lock, flags);
+		spin_lock(&vis_ha->list_lock);
 		list_for_each_safe(list, temp, &vis_ha->pending_queue) {
 			rp = list_entry(list, srb_t, list);
 
@@ -1205,14 +1206,14 @@ qla2xxx_eh_abort(struct scsi_cmnd *cmd)
 			found++;
 			break;
 		} /* list_for_each_safe() */
-		spin_unlock_irqrestore(&vis_ha->list_lock, flags);
+		spin_unlock(&vis_ha->list_lock);
 	} /*End of if !found */
 
 	if (!found) {  /* find the command in our active list */
 		DEBUG3(printk("qla2xxx_eh_abort: searching sp %p "
 		    "in outstanding queue.\n", sp);)
 
-		spin_lock_irqsave(&ha->hardware_lock, flags);
+		spin_lock(&ha->hardware_lock);
 		for (i = 1; i < MAX_OUTSTANDING_COMMANDS; i++) {
 			sp = ha->outstanding_cmds[i];
 
@@ -1231,8 +1232,8 @@ qla2xxx_eh_abort(struct scsi_cmnd *cmd)
 			/* Get a reference to the sp and drop the lock.*/
 			sp_get(ha, sp);
 
-			spin_unlock_irqrestore(&ha->hardware_lock, flags);
-			spin_unlock(ha->host->host_lock);
+			spin_unlock(&ha->hardware_lock);
+			spin_unlock_irq(ha->host->host_lock);
 
 			if (qla2x00_abort_command(ha, sp)) {
 				DEBUG2(printk("qla2xxx_eh_abort: abort_command "
@@ -1247,7 +1248,7 @@ qla2xxx_eh_abort(struct scsi_cmnd *cmd)
 			sp_put(ha,sp);
 
 			spin_lock_irq(ha->host->host_lock);
-			spin_lock_irqsave(&ha->hardware_lock, flags);
+			spin_lock(&ha->hardware_lock);
 
 			/*
 			 * Regardless of mailbox command status, go check on
@@ -1256,11 +1257,11 @@ qla2xxx_eh_abort(struct scsi_cmnd *cmd)
 			break;
 
 		}/*End of for loop */
-		spin_unlock_irqrestore(&ha->hardware_lock, flags);
+		spin_unlock(&ha->hardware_lock);
 
 	} /*End of if !found */
 
-	  /*Waiting for our command in done_queue to be returned to OS.*/
+	/* Waiting for our command in done_queue to be returned to OS.*/
 	if (qla2x00_eh_wait_on_command(ha, cmd) != 0) {
 		DEBUG2(printk("qla2xxx_eh_abort: cmd returned back to OS.\n");)
 		return_status = SUCCESS;
@@ -1275,7 +1276,7 @@ qla2xxx_eh_abort(struct scsi_cmnd *cmd)
 	DEBUG2(printk("qla2xxx_eh_abort: Exiting. return_status=0x%x.\n",
 	    return_status));
 
-	return(return_status);
+	return return_status;
 }
 
 /**************************************************************************
@@ -1297,7 +1298,6 @@ qla2x00_eh_wait_for_pending_target_commands(scsi_qla_host_t *ha, unsigned int t)
 {
 	int	cnt;
 	int	status;
-	unsigned long	flags;
 	srb_t		*sp;
 	struct scsi_cmnd *cmd;
 
@@ -1308,11 +1308,11 @@ qla2x00_eh_wait_for_pending_target_commands(scsi_qla_host_t *ha, unsigned int t)
 	 * array
 	 */
 	for (cnt = 1; cnt < MAX_OUTSTANDING_COMMANDS; cnt++) {
-		spin_lock_irqsave(&ha->hardware_lock, flags);
+		spin_lock(&ha->hardware_lock);
 		sp = ha->outstanding_cmds[cnt];
 		if (sp) {
 			cmd = sp->cmd;
-			spin_unlock_irqrestore(&ha->hardware_lock, flags);
+			spin_unlock(&ha->hardware_lock);
 			if (cmd->device->id == t) {
 				if (!qla2x00_eh_wait_on_command(ha, cmd)) {
 					status = 1;
@@ -1321,7 +1321,7 @@ qla2x00_eh_wait_for_pending_target_commands(scsi_qla_host_t *ha, unsigned int t)
 			}
 		}
 		else {
-			spin_unlock_irqrestore(&ha->hardware_lock, flags);
+			spin_unlock(&ha->hardware_lock);
 		}
 	}
 	return (status);
@@ -1356,7 +1356,6 @@ qla2xxx_eh_device_reset(struct scsi_cmnd *cmd)
 	os_tgt_t	*tq;
 	os_lun_t	*lq;
 	fc_port_t	*fcport_to_reset;
-	unsigned long	flags;
 	srb_t		*rp;
 	struct list_head *list, *temp;
 
@@ -1404,7 +1403,7 @@ qla2xxx_eh_device_reset(struct scsi_cmnd *cmd)
 	    ha->dpc_flags, cmd->result, cmd->allowed, cmd->state));
 
  	/* Clear commands from the retry queue. */
- 	spin_lock_irqsave(&ha->list_lock, flags);
+ 	spin_lock(&ha->list_lock);
  	list_for_each_safe(list, temp, &ha->retry_queue) {
  		rp = list_entry(list, srb_t, list);
  
@@ -1418,11 +1417,10 @@ qla2xxx_eh_device_reset(struct scsi_cmnd *cmd)
  		rp->cmd->result = DID_RESET << 16;
  		__add_to_done_queue(ha, rp);
  	}
- 	spin_unlock_irqrestore(&ha->list_lock, flags);
+ 	spin_unlock(&ha->list_lock);
 
 	spin_unlock_irq(ha->host->host_lock);
 
-	/* Blocking call-Does context switching if abort isp is active etc */  
 	if (qla2x00_wait_for_hba_online(ha) != QLA_SUCCESS) {
 		DEBUG2(printk(KERN_INFO
 		    "%s failed:board disabled\n",__func__));
@@ -1431,7 +1429,6 @@ qla2xxx_eh_device_reset(struct scsi_cmnd *cmd)
 		goto eh_dev_reset_done;
 	}
 
-	/* Blocking call-Does context switching if loop is Not Ready */
 	if (qla2x00_wait_for_loop_ready(ha) == QLA_SUCCESS) {
 		if (qla2x00_device_reset(ha, fcport_to_reset) == 0) {
 			return_status = SUCCESS;
@@ -1455,7 +1452,7 @@ qla2xxx_eh_device_reset(struct scsi_cmnd *cmd)
 
 	if (return_status == FAILED) {
 		DEBUG3(printk("%s(%ld): device reset failed\n",
-		    __func__,ha->host_no));
+		    __func__, ha->host_no));
 		qla_printk(KERN_INFO, ha, "%s: device reset failed\n",
 		    __func__);
 
@@ -1513,7 +1510,6 @@ qla2x00_eh_wait_for_pending_commands(scsi_qla_host_t *ha)
 {
 	int	cnt;
 	int	status;
-	unsigned long	flags;
 	srb_t		*sp;
 	struct scsi_cmnd *cmd;
 
@@ -1524,17 +1520,17 @@ qla2x00_eh_wait_for_pending_commands(scsi_qla_host_t *ha)
 	 * array
 	 */
 	for (cnt = 1; cnt < MAX_OUTSTANDING_COMMANDS; cnt++) {
-		spin_lock_irqsave(&ha->hardware_lock, flags);
+		spin_lock(&ha->hardware_lock);
 		sp = ha->outstanding_cmds[cnt];
 		if (sp) {
 			cmd = sp->cmd;
-			spin_unlock_irqrestore(&ha->hardware_lock, flags);
+			spin_unlock(&ha->hardware_lock);
 			status = qla2x00_eh_wait_on_command(ha, cmd);
 			if (status == 0)
 				break;
 		}
 		else {
-			spin_unlock_irqrestore(&ha->hardware_lock, flags);
+			spin_unlock(&ha->hardware_lock);
 		}
 	}
 	return (status);
@@ -1572,16 +1568,14 @@ qla2xxx_eh_bus_reset(struct scsi_cmnd *cmd)
 
 	spin_unlock_irq(ha->host->host_lock);
 
-	/* Blocking call-Does context switching if abort isp is active etc*/  
 	if (qla2x00_wait_for_hba_online(ha) != QLA_SUCCESS) {
 		DEBUG2(printk("%s failed:board disabled\n",__func__));
 		spin_lock_irq(ha->host->host_lock);
 		return FAILED;
 	}
 
-	/* Blocking call-Does context switching if loop is Not Ready */ 
 	if (qla2x00_wait_for_loop_ready(ha) == QLA_SUCCESS) {
-		if (qla2x00_loop_reset(ha)) 
+		if (qla2x00_loop_reset(ha) == QLA_SUCCESS) 
 			rval = SUCCESS;
 	}
 
@@ -1639,7 +1633,6 @@ qla2xxx_eh_host_reset(struct scsi_cmnd *cmd)
 
 	spin_unlock_irq(ha->host->host_lock);
 
-	/* Blocking call-Does context switching if abort isp is active etc*/  
 	if (qla2x00_wait_for_hba_online(ha) != QLA_SUCCESS)
 		goto board_disabled;
 
@@ -1697,10 +1690,10 @@ qla2xxx_eh_host_reset(struct scsi_cmnd *cmd)
 * Returns:
 *      0 = success
 */
-static uint8_t
+static int
 qla2x00_loop_reset(scsi_qla_host_t *ha)
 {
-	uint8_t  status = QLA_SUCCESS;
+	int status = QLA_SUCCESS;
 	uint16_t t;
 	os_tgt_t        *tq;
 
@@ -2111,15 +2104,9 @@ int qla2x00_probe_one(struct pci_dev *pdev, struct qla_board_info *brd_info)
 	}
 	spin_unlock_irqrestore(&ha->hardware_lock, flags);
 
-
 	/* Enable chip interrupts. */
 	qla2x00_enable_intrs(ha);
 
-	/* Insert new entry into the list of adapters */
-	write_lock(&qla_hostlist_lock);
-	list_add_tail(&ha->list, &qla_hostlist);
-	write_unlock(&qla_hostlist_lock);
-
 	/* v2.19.5b6 */
 	/*
 	 * Wait around max loop_reset_delay secs for the devices to come
@@ -2181,10 +2168,6 @@ void qla2x00_remove_one(struct pci_dev *pdev)
 
 	ha = pci_get_drvdata(pdev);
 
-	write_lock(&qla_hostlist_lock);
-	list_del(&ha->list);
-	write_unlock(&qla_hostlist_lock);
-
 	sysfs_remove_bin_file(&ha->host->shost_gendev.kobj,
 	    &sysfs_fw_dump_attr);
 	sysfs_remove_bin_file(&ha->host->shost_gendev.kobj, &sysfs_nvram_attr);
@@ -2234,7 +2217,7 @@ qla2x00_free_device(scsi_qla_host_t *ha)
 	qla2x00_mem_free(ha);
 
 
-	ha->flags.online = FALSE;
+	ha->flags.online = 0;
 
 	/* Detach interrupts */
 	if (ha->pdev->irq)
@@ -2305,12 +2288,12 @@ copy_info(struct info_str *info, char *fmt, ...)
 *
 * inout : decides the direction of the dataflow and the meaning of the
 *         variables
-* buffer: If inout==FALSE data is being written to it else read from it
+* buffer: If inout==0 data is being written to it else read from it
 *         (ptr to a page buffer)
-* *start: If inout==FALSE start of the valid data in the buffer
-* offset: If inout==FALSE starting offset from the beginning of all
+* *start: If inout==0 start of the valid data in the buffer
+* offset: If inout==0 starting offset from the beginning of all
 *         possible data to return.
-* length: If inout==FALSE max number of bytes to be written into the buffer
+* length: If inout==0 max number of bytes to be written into the buffer
 *         else number of bytes in "buffer"
 * Returns:
 *         < 0:  error. errno value.
@@ -2328,7 +2311,6 @@ qla2x00_proc_info(struct Scsi_Host *shost, char *buffer,
 	uint32_t        tmp_sn;
 	uint32_t	*flags;
 	uint8_t		*loop_state;
-	int	found;
 	scsi_qla_host_t *ha;
 	char fw_info[30];
  
@@ -2336,29 +2318,9 @@ qla2x00_proc_info(struct Scsi_Host *shost, char *buffer,
 	    "Entering proc_info buff_in=%p, offset=0x%lx, length=0x%x\n",
 	    buffer, offset, length);)
 
-	ha = NULL;
-
-	/* Find the host that was specified */
-	found = 0;
-	read_lock(&qla_hostlist_lock);
-	list_for_each_entry(ha, &qla_hostlist, list) {
-		if (ha->host == shost) {
-			found++;
-			break;
-		}
-	}
-	read_unlock(&qla_hostlist_lock);
+	ha = (scsi_qla_host_t *) shost->hostdata;
 
-	/* if host wasn't found then exit */
-	if (!found) {
-		DEBUG2_3(printk(KERN_WARNING
-		    "%s: Can't find adapter for host %p\n", 
-		    __func__, shost);)
-
-		return (retval);
-	}
-
-	if (inout == TRUE) {
+	if (inout) {
 		/* Has data been written to the file? */
 		DEBUG3(printk(
 		    "%s: has data been written to the file. \n",
@@ -2522,6 +2484,7 @@ qla2x00_proc_info(struct Scsi_Host *shost, char *buffer,
 		    tq->port_name[4], tq->port_name[5],
 		    tq->port_name[6], tq->port_name[7]);
 	}
+
 	copy_info(&info, "\nSCSI LUN Information:\n");
 	copy_info(&info,
 	    "(Id:Lun)  * - indicates lun is not registered with the OS.\n");
@@ -3421,10 +3384,15 @@ qla2x00_do_dpc(void *data)
 				    fcport->login_retry) {
 
 					fcport->login_retry--;
-					if (fcport->flags & FCF_FABRIC_DEVICE)
+					if (fcport->flags & FCF_FABRIC_DEVICE) {
+						if (fcport->flags &
+						    FCF_TAPE_PRESENT)
+							qla2x00_fabric_logout(
+							    ha,
+							    fcport->loop_id);
 						status = qla2x00_fabric_login(
 						    ha, fcport, &next_loopid);
-					else 	
+					} else
 						status =
 						    qla2x00_local_device_login(
 							ha, fcport->loop_id);
@@ -3494,7 +3462,7 @@ qla2x00_do_dpc(void *data)
 			DEBUG(printk("scsi(%ld): qla2x00_restart_queues()\n",
 			    ha->host_no));
 
-			qla2x00_restart_queues(ha,FALSE);
+			qla2x00_restart_queues(ha, 0);
 
 			DEBUG(printk("scsi(%ld): qla2x00_restart_queues - end\n",
 			    ha->host_no));
@@ -3505,7 +3473,7 @@ qla2x00_do_dpc(void *data)
 			DEBUG(printk("scsi(%ld): qla2x00_abort_queues()\n",
 			    ha->host_no));
 				
-			qla2x00_abort_queues(ha, FALSE);
+			qla2x00_abort_queues(ha, 0);
 
 			DEBUG(printk("scsi(%ld): qla2x00_abort_queues - end\n",
 			    ha->host_no));
@@ -3596,8 +3564,6 @@ qla2x00_rst_aen(scsi_qla_host_t *ha)
 	if (ha->flags.online && !ha->flags.reset_active &&
 	    !atomic_read(&ha->loop_down_timer) &&
 	    !(test_bit(ABORT_ISP_ACTIVE, &ha->dpc_flags))) {
-
-		/* 10/15 ha->flags.reset_active = TRUE; */
 		do {
 			clear_bit(RESET_MARKER_NEEDED, &ha->dpc_flags);
 
@@ -3608,8 +3574,6 @@ qla2x00_rst_aen(scsi_qla_host_t *ha)
 			ha->marker_needed = 1;
 		} while (!atomic_read(&ha->loop_down_timer) &&
 		    (test_bit(RESET_MARKER_NEEDED, &ha->dpc_flags)));
-
-		/* 10/15 ha->flags.reset_active = FALSE; */
 	}
 }
 
@@ -3627,80 +3591,11 @@ qla2x00_get_new_sp(scsi_qla_host_t *ha)
 	srb_t *sp;
 
 	sp = mempool_alloc(ha->srb_mempool, GFP_KERNEL);
-	if (sp) {
+	if (sp)
 		atomic_set(&sp->ref_count, 1);
-		sp->req_cnt = 0;
-	}
 	return (sp);
 }
 
-/**************************************************************************
- * qla2x00_blink_led
- *
- * Description:
- *   This function sets the colour of the LED while preserving the
- *   unsued GPIO pins every sec.
- *
- * Input:
- *       ha - Host adapter structure
- *      
- * Return:
- * 	None
- *
- * Context: qla2x00_timer() Interrupt
- ***************************************************************************/
-void
-qla2x00_blink_led(scsi_qla_host_t *ha)
-{
-	uint16_t	gpio_enable, gpio_data, led_color;
-	unsigned long	cpu_flags = 0;
-	device_reg_t	*reg = ha->iobase;
-
-	/* Save the Original GPIOE */ 
-	spin_lock_irqsave(&ha->hardware_lock, cpu_flags);
-	gpio_enable = RD_REG_WORD(&reg->gpioe);
-	gpio_data = RD_REG_WORD(&reg->gpiod);
-	spin_unlock_irqrestore(&ha->hardware_lock, cpu_flags);
-
-	DEBUG2(printk("%s Original data of gpio_enable_reg=0x%x"
-	    " gpio_data_reg=0x%x\n",
-	    __func__,gpio_enable,gpio_data));
-
-	if (ha->beacon_green_on){
-		led_color = GPIO_LED_GREEN_ON_AMBER_OFF;
-		ha->beacon_green_on = 0;
-	} else {
-		led_color = GPIO_LED_GREEN_OFF_AMBER_OFF;
-		ha->beacon_green_on = 1;
-	}
-
-	/* Set the modified gpio_enable values */
-	gpio_enable |= GPIO_LED_GREEN_ON_AMBER_OFF;
-
-	DEBUG2(printk("%s Before writing enable : gpio_enable_reg=0x%x"
-	    " gpio_data_reg=0x%x led_color=0x%x\n",
-	    __func__, gpio_enable, gpio_data, led_color));
-
-	spin_lock_irqsave(&ha->hardware_lock, cpu_flags);
-	WRT_REG_WORD(&reg->gpioe,gpio_enable);
-	spin_unlock_irqrestore(&ha->hardware_lock, cpu_flags);
-
-	/* Clear out the previously set LED colour */
-	gpio_data &= ~GPIO_LED_GREEN_ON_AMBER_OFF;
-
-	/* Set the new input LED colour to GPIOD */
-	gpio_data |= led_color;
-
-	DEBUG2(printk("%s Before writing data: gpio_enable_reg=0x%x"
-	    " gpio_data_reg=0x%x led_color=0x%x\n",
-	    __func__,gpio_enable,gpio_data,led_color));
-
-	/* Set the modified gpio_data values */
-	spin_lock_irqsave(&ha->hardware_lock, cpu_flags);
-	WRT_REG_WORD(&reg->gpiod,gpio_data);
-	spin_unlock_irqrestore(&ha->hardware_lock, cpu_flags);
-}
-
 /**************************************************************************
 *   qla2x00_timer
 *
@@ -3718,6 +3613,8 @@ qla2x00_timer(scsi_qla_host_t *ha)
 	os_lun_t *lq;
 	os_tgt_t *tq;
 	int		start_dpc = 0;
+	int		index;
+	srb_t		*sp;
 
 	/*
 	 * We try and restart any request in the retry queue every second.
@@ -3735,11 +3632,6 @@ qla2x00_timer(scsi_qla_host_t *ha)
 		start_dpc++;
 	}
 
-	/* Check if beacon LED needs to be blinked */
-	if (!IS_QLA2100(ha) && !IS_QLA2200(ha) && ha->beacon_blink_led)
-		qla2x00_blink_led(ha);
-
-
 	/*
 	 * Ports - Port down timer.
 	 *
@@ -3826,7 +3718,6 @@ qla2x00_timer(scsi_qla_host_t *ha)
 	if (atomic_read(&ha->loop_down_timer) > 0 &&
 	    !(test_bit(ABORT_ISP_ACTIVE, &ha->dpc_flags)) && ha->flags.online) {
 
-		/* dg 10/30 if (atomic_read(&ha->loop_down_timer) == LOOP_DOWN_TIME) { */
 		if (atomic_read(&ha->loop_down_timer) ==
 		    ha->loop_down_abort_time) {
 
@@ -3837,6 +3728,22 @@ qla2x00_timer(scsi_qla_host_t *ha)
 			if (!IS_QLA2100(ha) && ha->link_down_timeout)
 				atomic_set(&ha->loop_state, LOOP_DEAD); 
 
+			/* Schedule an ISP abort to return any tape commands. */
+			spin_lock_irqsave(&ha->hardware_lock, cpu_flags);
+			for (index = 1; index < MAX_OUTSTANDING_COMMANDS;
+			    index++) {
+				sp = ha->outstanding_cmds[index];
+				if (!sp)
+					continue;
+				if (!(sp->fclun->fcport->flags &
+				    FCF_TAPE_PRESENT))
+					continue;
+
+				set_bit(ISP_ABORT_NEEDED, &ha->dpc_flags);
+				break;
+			}
+			spin_unlock_irqrestore(&ha->hardware_lock, cpu_flags);
+
 			set_bit(ABORT_QUEUES_NEEDED, &ha->dpc_flags);
 			start_dpc++;
 		}
diff --git a/drivers/scsi/qla2xxx/qla_rscn.c b/drivers/scsi/qla2xxx/qla_rscn.c
index c522d03c1..f2050f9dd 100644
--- a/drivers/scsi/qla2xxx/qla_rscn.c
+++ b/drivers/scsi/qla2xxx/qla_rscn.c
@@ -16,8 +16,6 @@
  * General Public License for more details.
  *
  */
-#include "qla_os.h"
-
 #include "qla_def.h"
 
 /**
@@ -438,6 +436,7 @@ qla2x00_send_abort_iocb(scsi_qla_host_t *ha, struct io_descriptor *iodesc,
 	    cpu_to_le16(iodesc->remote_fcport->loop_id);
 	mbxentry->mb2 = LSW(handle_to_abort);
 	mbxentry->mb3 = MSW(handle_to_abort);
+	wmb();
 
 	qla2x00_add_iodesc_timer(iodesc);
 
@@ -514,6 +513,7 @@ qla2x00_send_adisc_iocb(scsi_qla_host_t *ha, struct io_descriptor *iodesc,
 	mbxentry->mb6 = cpu_to_le16(MSW(MSD(ha->iodesc_pd_dma)));
 	mbxentry->mb7 = cpu_to_le16(LSW(MSD(ha->iodesc_pd_dma)));
 	mbxentry->mb10 = __constant_cpu_to_le16(BIT_0);
+	wmb();
 
 	qla2x00_add_iodesc_timer(iodesc);
 
@@ -625,6 +625,7 @@ qla2x00_send_logout_iocb(scsi_qla_host_t *ha, struct io_descriptor *iodesc,
 	mbxentry->mb0 = __constant_cpu_to_le16(MBC_LOGOUT_FABRIC_PORT);
 	mbxentry->mb1 = mbxentry->loop_id.extended =
 	    cpu_to_le16(iodesc->remote_fcport->loop_id);
+	wmb();
 
 	qla2x00_add_iodesc_timer(iodesc);
 
@@ -702,6 +703,7 @@ qla2x00_send_login_iocb(scsi_qla_host_t *ha, struct io_descriptor *iodesc,
 	mbxentry->mb2 = cpu_to_le16(d_id->b.domain);
 	mbxentry->mb3 = cpu_to_le16(d_id->b.area << 8 | d_id->b.al_pa);
 	mbxentry->mb10 = __constant_cpu_to_le16(BIT_0);
+	wmb();
 
 	qla2x00_add_iodesc_timer(iodesc);
 
diff --git a/drivers/scsi/qla2xxx/qla_sup.c b/drivers/scsi/qla2xxx/qla_sup.c
index c6b027c93..5196a746d 100644
--- a/drivers/scsi/qla2xxx/qla_sup.c
+++ b/drivers/scsi/qla2xxx/qla_sup.c
@@ -17,9 +17,11 @@
  *
  ******************************************************************************/
 
-#include "qla_os.h"
 #include "qla_def.h"
 
+#include <linux/delay.h>
+#include <asm/uaccess.h>
+
 static uint16_t qla2x00_nvram_request(scsi_qla_host_t *, uint32_t);
 static void qla2x00_nv_deselect(scsi_qla_host_t *);
 static void qla2x00_nv_write(scsi_qla_host_t *, uint16_t);
diff --git a/drivers/scsi/qla2xxx/qla_version.h b/drivers/scsi/qla2xxx/qla_version.h
index a2cccee20..1dc4c9594 100644
--- a/drivers/scsi/qla2xxx/qla_version.h
+++ b/drivers/scsi/qla2xxx/qla_version.h
@@ -19,9 +19,9 @@
 /*
  * Driver version 
  */
-#define QLA2XXX_VERSION      "8.00.00b12-k"
+#define QLA2XXX_VERSION      "8.00.00b14-k"
 
 #define QLA_DRIVER_MAJOR_VER	8
 #define QLA_DRIVER_MINOR_VER	0
 #define QLA_DRIVER_PATCH_VER	0
-#define QLA_DRIVER_BETA_VER	12
+#define QLA_DRIVER_BETA_VER	14
diff --git a/drivers/scsi/qlogicfas.c b/drivers/scsi/qlogicfas.c
index 1641932a7..03dbd6707 100644
--- a/drivers/scsi/qlogicfas.c
+++ b/drivers/scsi/qlogicfas.c
@@ -32,7 +32,7 @@
 #include <asm/dma.h>
 
 #include "scsi.h"
-#include "hosts.h"
+#include <scsi/scsi_host.h>
 #include "qlogicfas408.h"
 
 /* Set the following to 2 to use normal interrupt (active high/totempole-
diff --git a/drivers/scsi/qlogicfas408.c b/drivers/scsi/qlogicfas408.c
index 32c9cd413..5b6ce0a88 100644
--- a/drivers/scsi/qlogicfas408.c
+++ b/drivers/scsi/qlogicfas408.c
@@ -56,7 +56,7 @@
 #include <asm/dma.h>
 
 #include "scsi.h"
-#include "hosts.h"
+#include <scsi/scsi_host.h>
 #include "qlogicfas408.h"
 
 /*----------------------------------------------------------------*/
diff --git a/drivers/scsi/qlogicfc.c b/drivers/scsi/qlogicfc.c
index 015fd8d5b..ef1fdfdc3 100644
--- a/drivers/scsi/qlogicfc.c
+++ b/drivers/scsi/qlogicfc.c
@@ -64,7 +64,7 @@
 #include <asm/io.h>
 #include <asm/irq.h>
 #include "scsi.h"
-#include "hosts.h"
+#include <scsi/scsi_host.h>
 
 #define pci64_dma_hi32(a) ((u32) (0xffffffff & (((u64)(a))>>32)))
 #define pci64_dma_lo32(a) ((u32) (0xffffffff & (((u64)(a)))))
@@ -100,6 +100,7 @@
 
 #define DEFAULT_LOOP_COUNT	1000000000
 
+#define ISP_TIMEOUT (2*HZ)
 /* End Configuration section ************************************************ */
 
 #include <linux/module.h>
@@ -1305,7 +1306,7 @@ int isp2x00_queuecommand(Scsi_Cmnd * Cmnd, void (*done) (Scsi_Cmnd *))
 		cmd->control_flags = cpu_to_le16(CFLAG_READ);
 
 	if (Cmnd->device->tagged_supported) {
-		if ((jiffies - hostdata->tag_ages[Cmnd->device->id]) > (2 * SCSI_TIMEOUT)) {
+		if ((jiffies - hostdata->tag_ages[Cmnd->device->id]) > (2 * ISP_TIMEOUT)) {
 			cmd->control_flags |= cpu_to_le16(CFLAG_ORDERED_TAG);
 			hostdata->tag_ages[Cmnd->device->id] = jiffies;
 		} else
diff --git a/drivers/scsi/qlogicisp.c b/drivers/scsi/qlogicisp.c
index ecce3a3d7..1be526c1c 100644
--- a/drivers/scsi/qlogicisp.c
+++ b/drivers/scsi/qlogicisp.c
@@ -36,7 +36,7 @@
 #include <asm/irq.h>
 #include <asm/byteorder.h>
 #include "scsi.h"
-#include "hosts.h"
+#include <scsi/scsi_host.h>
 #include "qlogicisp.h"
 
 /* Configuration section *****************************************************/
diff --git a/drivers/scsi/sata_nv.c b/drivers/scsi/sata_nv.c
index bf1932e49..29248d608 100644
--- a/drivers/scsi/sata_nv.c
+++ b/drivers/scsi/sata_nv.c
@@ -20,6 +20,11 @@
  *  If you do not delete the provisions above, a recipient may use your
  *  version of this file under either the OSL or the GPL.
  *
+ *  0.02
+ *     - Added support for CK804 SATA controller.
+ *
+ *  0.01
+ *     - Initial revision.
  */
 
 #include <linux/config.h>
@@ -35,7 +40,7 @@
 #include <linux/libata.h>
 
 #define DRV_NAME			"sata_nv"
-#define DRV_VERSION			"0.01"
+#define DRV_VERSION			"0.02"
 
 #define NV_PORTS			2
 #define NV_PIO_MASK			0x1f
@@ -46,6 +51,7 @@
 #define NV_PORT1_SCR_REG_OFFSET		0x40
 
 #define NV_INT_STATUS			0x10
+#define NV_INT_STATUS_CK804		0x440
 #define NV_INT_STATUS_PDEV_INT		0x01
 #define NV_INT_STATUS_PDEV_PM		0x02
 #define NV_INT_STATUS_PDEV_ADDED	0x04
@@ -62,6 +68,7 @@
 					NV_INT_STATUS_SDEV_HOTPLUG)
 
 #define NV_INT_ENABLE			0x11
+#define NV_INT_ENABLE_CK804		0x441
 #define NV_INT_ENABLE_PDEV_MASK		0x01
 #define NV_INT_ENABLE_PDEV_PM		0x02
 #define NV_INT_ENABLE_PDEV_ADDED	0x04
@@ -80,30 +87,86 @@
 #define NV_INT_CONFIG			0x12
 #define NV_INT_CONFIG_METHD		0x01 // 0 = INT, 1 = SMI
 
+// For PCI config register 20
+#define NV_MCP_SATA_CFG_20		0x50
+#define NV_MCP_SATA_CFG_20_SATA_SPACE_EN	0x04
+
 static int nv_init_one (struct pci_dev *pdev, const struct pci_device_id *ent);
 irqreturn_t nv_interrupt (int irq, void *dev_instance, struct pt_regs *regs);
 static u32 nv_scr_read (struct ata_port *ap, unsigned int sc_reg);
 static void nv_scr_write (struct ata_port *ap, unsigned int sc_reg, u32 val);
 static void nv_host_stop (struct ata_host_set *host_set);
+static void nv_enable_hotplug(struct ata_probe_ent *probe_ent);
+static void nv_disable_hotplug(struct ata_host_set *host_set);
+static void nv_check_hotplug(struct ata_host_set *host_set);
+static void nv_enable_hotplug_ck804(struct ata_probe_ent *probe_ent);
+static void nv_disable_hotplug_ck804(struct ata_host_set *host_set);
+static void nv_check_hotplug_ck804(struct ata_host_set *host_set);
+
+enum nv_host_type
+{
+	NFORCE2,
+	NFORCE3,
+	CK804
+};
 
 static struct pci_device_id nv_pci_tbl[] = {
 	{ PCI_VENDOR_ID_NVIDIA, PCI_DEVICE_ID_NVIDIA_NFORCE2S_SATA,
-		PCI_ANY_ID, PCI_ANY_ID, },
+		PCI_ANY_ID, PCI_ANY_ID, 0, 0, NFORCE2 },
 	{ PCI_VENDOR_ID_NVIDIA, PCI_DEVICE_ID_NVIDIA_NFORCE3S_SATA,
-		PCI_ANY_ID, PCI_ANY_ID, },
+		PCI_ANY_ID, PCI_ANY_ID, 0, 0, NFORCE3 },
 	{ PCI_VENDOR_ID_NVIDIA, PCI_DEVICE_ID_NVIDIA_NFORCE3S_SATA2,
-		PCI_ANY_ID, PCI_ANY_ID, },
+		PCI_ANY_ID, PCI_ANY_ID, 0, 0, NFORCE3 },
 	{ PCI_VENDOR_ID_NVIDIA, PCI_DEVICE_ID_NVIDIA_NFORCE_CK804_SATA,
-		PCI_ANY_ID, PCI_ANY_ID, },
+		PCI_ANY_ID, PCI_ANY_ID, 0, 0, CK804 },
 	{ PCI_VENDOR_ID_NVIDIA, PCI_DEVICE_ID_NVIDIA_NFORCE_CK804_SATA2,
-		PCI_ANY_ID, PCI_ANY_ID, },
+		PCI_ANY_ID, PCI_ANY_ID, 0, 0, CK804 },
 	{ PCI_VENDOR_ID_NVIDIA, PCI_DEVICE_ID_NVIDIA_NFORCE_MCP04_SATA,
-		PCI_ANY_ID, PCI_ANY_ID, },
+		PCI_ANY_ID, PCI_ANY_ID, 0, 0, CK804 },
 	{ PCI_VENDOR_ID_NVIDIA, PCI_DEVICE_ID_NVIDIA_NFORCE_MCP04_SATA2,
-		PCI_ANY_ID, PCI_ANY_ID, },
+		PCI_ANY_ID, PCI_ANY_ID, 0, 0, CK804 },
 	{ 0, } /* terminate list */
 };
 
+#define NV_HOST_FLAGS_SCR_MMIO	0x00000001
+
+struct nv_host_desc
+{
+	enum nv_host_type	host_type;
+	unsigned long		host_flags;
+	void			(*enable_hotplug)(struct ata_probe_ent *probe_ent);
+	void			(*disable_hotplug)(struct ata_host_set *host_set);
+	void			(*check_hotplug)(struct ata_host_set *host_set);
+
+};
+static struct nv_host_desc nv_device_tbl[] = {
+	{
+		.host_type	= NFORCE2,
+		.host_flags	= 0x00000000,
+		.enable_hotplug	= nv_enable_hotplug,
+		.disable_hotplug= nv_disable_hotplug,
+		.check_hotplug	= nv_check_hotplug,
+	},
+	{
+		.host_type	= NFORCE3,
+		.host_flags	= 0x00000000,
+		.enable_hotplug	= nv_enable_hotplug,
+		.disable_hotplug= nv_disable_hotplug,
+		.check_hotplug	= nv_check_hotplug,
+	},
+	{	.host_type	= CK804,
+		.host_flags	= NV_HOST_FLAGS_SCR_MMIO,
+		.enable_hotplug	= nv_enable_hotplug_ck804,
+		.disable_hotplug= nv_disable_hotplug_ck804,
+		.check_hotplug	= nv_check_hotplug_ck804,
+	},
+};
+
+struct nv_host
+{
+	struct nv_host_desc	*host_desc;
+};
+
 static struct pci_driver nv_pci_driver = {
 	.name			= DRV_NAME,
 	.id_table		= nv_pci_tbl,
@@ -158,11 +221,10 @@ MODULE_DEVICE_TABLE(pci, nv_pci_tbl);
 irqreturn_t nv_interrupt (int irq, void *dev_instance, struct pt_regs *regs)
 {
 	struct ata_host_set *host_set = dev_instance;
+	struct nv_host *host = host_set->private_data;
 	unsigned int i;
 	unsigned int handled = 0;
 	unsigned long flags;
-	u8 intr_status;
-	u8 intr_enable;
 
 	spin_lock_irqsave(&host_set->lock, flags);
 
@@ -178,35 +240,11 @@ irqreturn_t nv_interrupt (int irq, void *dev_instance, struct pt_regs *regs)
 				handled += ata_host_intr(ap, qc);
 		}
 
-		intr_status = inb(ap->ioaddr.scr_addr + NV_INT_STATUS);
-		intr_enable = inb(ap->ioaddr.scr_addr + NV_INT_ENABLE);
-
-		// Clear interrupt status.
-		outb(0xff, ap->ioaddr.scr_addr + NV_INT_STATUS);
-
-		if (intr_status & NV_INT_STATUS_HOTPLUG) {
-			if (intr_status & NV_INT_STATUS_PDEV_ADDED) {
-				printk(KERN_WARNING "ata%u: "
-					"Primary device added\n", ap->id);
-			}
-
-			if (intr_status & NV_INT_STATUS_PDEV_REMOVED) {
-				printk(KERN_WARNING "ata%u: "
-					"Primary device removed\n", ap->id);
-			}
-
-			if (intr_status & NV_INT_STATUS_SDEV_ADDED) {
-				printk(KERN_WARNING "ata%u: "
-					"Secondary device added\n", ap->id);
-			}
-
-			if (intr_status & NV_INT_STATUS_SDEV_REMOVED) {
-				printk(KERN_WARNING "ata%u: "
-					"Secondary device removed\n", ap->id);
-			}
-		}
 	}
 
+	if (host->host_desc->check_hotplug)
+		host->host_desc->check_hotplug(host_set);
+
 	spin_unlock_irqrestore(&host_set->lock, flags);
 
 	return IRQ_RETVAL(handled);
@@ -214,41 +252,48 @@ irqreturn_t nv_interrupt (int irq, void *dev_instance, struct pt_regs *regs)
 
 static u32 nv_scr_read (struct ata_port *ap, unsigned int sc_reg)
 {
+	struct ata_host_set *host_set = ap->host_set;
+	struct nv_host *host = host_set->private_data;
+
 	if (sc_reg > SCR_CONTROL)
 		return 0xffffffffU;
 
-	return inl(ap->ioaddr.scr_addr + (sc_reg * 4));
+	if (host->host_desc->host_flags & NV_HOST_FLAGS_SCR_MMIO)
+		return readl(ap->ioaddr.scr_addr + (sc_reg * 4));
+	else
+		return inl(ap->ioaddr.scr_addr + (sc_reg * 4));
 }
 
 static void nv_scr_write (struct ata_port *ap, unsigned int sc_reg, u32 val)
 {
+	struct ata_host_set *host_set = ap->host_set;
+	struct nv_host *host = host_set->private_data;
+
 	if (sc_reg > SCR_CONTROL)
 		return;
 
-	outl(val, ap->ioaddr.scr_addr + (sc_reg * 4));
+	if (host->host_desc->host_flags & NV_HOST_FLAGS_SCR_MMIO)
+		writel(val, ap->ioaddr.scr_addr + (sc_reg * 4));
+	else
+		outl(val, ap->ioaddr.scr_addr + (sc_reg * 4));
 }
 
 static void nv_host_stop (struct ata_host_set *host_set)
 {
-	int i;
+	struct nv_host *host = host_set->private_data;
 
-	for (i=0; i<host_set->n_ports; i++) {
-		u8 intr_mask;
+	// Disable hotplug event interrupts.
+	if (host->host_desc->disable_hotplug)
+		host->host_desc->disable_hotplug(host_set);
 
-		// Disable hotplug event interrupts.
-		intr_mask = inb(host_set->ports[i]->ioaddr.scr_addr +
-				NV_INT_ENABLE);
-		intr_mask &= ~(NV_INT_ENABLE_HOTPLUG);
-		outb(intr_mask, host_set->ports[i]->ioaddr.scr_addr +
-				NV_INT_ENABLE);
-	}
+	kfree(host);
 }
 
 static int nv_init_one (struct pci_dev *pdev, const struct pci_device_id *ent)
 {
 	static int printed_version = 0;
+	struct nv_host *host;
 	struct ata_probe_ent *probe_ent = NULL;
-	int i;
 	int rc;
 
 	if (!printed_version++)
@@ -275,6 +320,14 @@ static int nv_init_one (struct pci_dev *pdev, const struct pci_device_id *ent)
 		goto err_out_regions;
 	}
 
+	host = kmalloc(sizeof(struct nv_host), GFP_KERNEL);
+	if (!host) {
+		rc = -ENOMEM;
+		goto err_out_free_ent;
+	}
+
+	host->host_desc = &nv_device_tbl[ent->driver_data];
+
 	memset(probe_ent, 0, sizeof(*probe_ent));
 	INIT_LIST_HEAD(&probe_ent->node);
 
@@ -284,6 +337,7 @@ static int nv_init_one (struct pci_dev *pdev, const struct pci_device_id *ent)
 				ATA_FLAG_SATA_RESET |
 				ATA_FLAG_SRST |
 				ATA_FLAG_NO_LEGACY;
+
 	probe_ent->port_ops = &nv_ops;
 	probe_ent->n_ports = NV_PORTS;
 	probe_ent->irq = pdev->irq;
@@ -298,8 +352,6 @@ static int nv_init_one (struct pci_dev *pdev, const struct pci_device_id *ent)
 		pci_resource_start(pdev, 1) | ATA_PCI_CTL_OFS;
 	probe_ent->port[0].bmdma_addr =
 		pci_resource_start(pdev, 4) | NV_PORT0_BMDMA_REG_OFFSET;
-	probe_ent->port[0].scr_addr =
-		pci_resource_start(pdev, 5) | NV_PORT0_SCR_REG_OFFSET;
 
 	probe_ent->port[1].cmd_addr = pci_resource_start(pdev, 2);
 	ata_std_ports(&probe_ent->port[1]);
@@ -308,31 +360,48 @@ static int nv_init_one (struct pci_dev *pdev, const struct pci_device_id *ent)
 		pci_resource_start(pdev, 3) | ATA_PCI_CTL_OFS;
 	probe_ent->port[1].bmdma_addr =
 		pci_resource_start(pdev, 4) | NV_PORT1_BMDMA_REG_OFFSET;
-	probe_ent->port[1].scr_addr =
-		pci_resource_start(pdev, 5) | NV_PORT1_SCR_REG_OFFSET;
 
-	pci_set_master(pdev);
+	probe_ent->private_data = host;
 
-	rc = ata_device_add(probe_ent);
-	if (rc != NV_PORTS)
-		goto err_out_regions;
+	if (host->host_desc->host_flags & NV_HOST_FLAGS_SCR_MMIO) {
+		unsigned long base;
 
-	// Enable hotplug event interrupts.
-	for (i=0; i<probe_ent->n_ports; i++) {
-		u8 intr_mask;
+		probe_ent->mmio_base = ioremap(pci_resource_start(pdev, 5),
+				pci_resource_len(pdev, 5));
+		if (probe_ent->mmio_base == NULL)
+			goto err_out_free_ent;
+
+		base = (unsigned long)probe_ent->mmio_base;
 
-		outb(NV_INT_STATUS_HOTPLUG, probe_ent->port[i].scr_addr +
-						NV_INT_STATUS);
+		probe_ent->port[0].scr_addr =
+			base + NV_PORT0_SCR_REG_OFFSET;
+		probe_ent->port[1].scr_addr =
+			base + NV_PORT1_SCR_REG_OFFSET;
+	} else {
 
-		intr_mask = inb(probe_ent->port[i].scr_addr + NV_INT_ENABLE);
-		intr_mask |= NV_INT_ENABLE_HOTPLUG;
-		outb(intr_mask, probe_ent->port[i].scr_addr + NV_INT_ENABLE);
+		probe_ent->port[0].scr_addr =
+			pci_resource_start(pdev, 5) | NV_PORT0_SCR_REG_OFFSET;
+		probe_ent->port[1].scr_addr =
+			pci_resource_start(pdev, 5) | NV_PORT1_SCR_REG_OFFSET;
 	}
 
+	pci_set_master(pdev);
+
+	// Enable hotplug event interrupts.
+	if (host->host_desc->enable_hotplug)
+		host->host_desc->enable_hotplug(probe_ent);
+
+	rc = ata_device_add(probe_ent);
+	if (rc != NV_PORTS)
+		goto err_out_free_ent;
+
 	kfree(probe_ent);
 
 	return 0;
 
+err_out_free_ent:
+	kfree(probe_ent);
+
 err_out_regions:
 	pci_release_regions(pdev);
 
@@ -341,6 +410,119 @@ err_out:
 	return rc;
 }
 
+static void nv_enable_hotplug(struct ata_probe_ent *probe_ent)
+{
+	u8 intr_mask;
+
+	outb(NV_INT_STATUS_HOTPLUG,
+		(unsigned long)probe_ent->mmio_base + NV_INT_STATUS);
+
+	intr_mask = inb((unsigned long)probe_ent->mmio_base + NV_INT_ENABLE);
+	intr_mask |= NV_INT_ENABLE_HOTPLUG;
+
+	outb(intr_mask, (unsigned long)probe_ent->mmio_base + NV_INT_ENABLE);
+}
+
+static void nv_disable_hotplug(struct ata_host_set *host_set)
+{
+	u8 intr_mask;
+
+	intr_mask = inb((unsigned long)host_set->mmio_base + NV_INT_ENABLE);
+
+	intr_mask &= ~(NV_INT_ENABLE_HOTPLUG);
+
+	outb(intr_mask, (unsigned long)host_set->mmio_base + NV_INT_ENABLE);
+}
+
+static void nv_check_hotplug(struct ata_host_set *host_set)
+{
+	u8 intr_status;
+
+	intr_status = inb((unsigned long)host_set->mmio_base + NV_INT_STATUS);
+
+	// Clear interrupt status.
+	outb(0xff, (unsigned long)host_set->mmio_base + NV_INT_STATUS);
+
+	if (intr_status & NV_INT_STATUS_HOTPLUG) {
+		if (intr_status & NV_INT_STATUS_PDEV_ADDED)
+			printk(KERN_WARNING "nv_sata: "
+				"Primary device added\n");
+
+		if (intr_status & NV_INT_STATUS_PDEV_REMOVED)
+			printk(KERN_WARNING "nv_sata: "
+				"Primary device removed\n");
+
+		if (intr_status & NV_INT_STATUS_SDEV_ADDED)
+			printk(KERN_WARNING "nv_sata: "
+				"Secondary device added\n");
+
+		if (intr_status & NV_INT_STATUS_SDEV_REMOVED)
+			printk(KERN_WARNING "nv_sata: "
+				"Secondary device removed\n");
+	}
+}
+
+static void nv_enable_hotplug_ck804(struct ata_probe_ent *probe_ent)
+{
+	u8 intr_mask;
+	u8 regval;
+
+	pci_read_config_byte(probe_ent->pdev, NV_MCP_SATA_CFG_20, &regval);
+	regval |= NV_MCP_SATA_CFG_20_SATA_SPACE_EN;
+	pci_write_config_byte(probe_ent->pdev, NV_MCP_SATA_CFG_20, regval);
+
+	writeb(NV_INT_STATUS_HOTPLUG, probe_ent->mmio_base + NV_INT_STATUS_CK804);
+
+	intr_mask = readb(probe_ent->mmio_base + NV_INT_ENABLE_CK804);
+	intr_mask |= NV_INT_ENABLE_HOTPLUG;
+
+	writeb(intr_mask, probe_ent->mmio_base + NV_INT_ENABLE_CK804);
+}
+
+static void nv_disable_hotplug_ck804(struct ata_host_set *host_set)
+{
+	u8 intr_mask;
+	u8 regval;
+
+	intr_mask = readb(host_set->mmio_base + NV_INT_ENABLE_CK804);
+
+	intr_mask &= ~(NV_INT_ENABLE_HOTPLUG);
+
+	writeb(intr_mask, host_set->mmio_base + NV_INT_ENABLE_CK804);
+
+	pci_read_config_byte(host_set->pdev, NV_MCP_SATA_CFG_20, &regval);
+	regval &= ~NV_MCP_SATA_CFG_20_SATA_SPACE_EN;
+	pci_write_config_byte(host_set->pdev, NV_MCP_SATA_CFG_20, regval);
+}
+
+static void nv_check_hotplug_ck804(struct ata_host_set *host_set)
+{
+	u8 intr_status;
+
+	intr_status = readb(host_set->mmio_base + NV_INT_STATUS_CK804);
+
+	// Clear interrupt status.
+	writeb(0xff, host_set->mmio_base + NV_INT_STATUS_CK804);
+
+	if (intr_status & NV_INT_STATUS_HOTPLUG) {
+		if (intr_status & NV_INT_STATUS_PDEV_ADDED)
+			printk(KERN_WARNING "nv_sata: "
+				"Primary device added\n");
+
+		if (intr_status & NV_INT_STATUS_PDEV_REMOVED)
+			printk(KERN_WARNING "nv_sata: "
+				"Primary device removed\n");
+
+		if (intr_status & NV_INT_STATUS_SDEV_ADDED)
+			printk(KERN_WARNING "nv_sata: "
+				"Secondary device added\n");
+
+		if (intr_status & NV_INT_STATUS_SDEV_REMOVED)
+			printk(KERN_WARNING "nv_sata: "
+				"Secondary device removed\n");
+	}
+}
+
 static int __init nv_init(void)
 {
 	return pci_module_init(&nv_pci_driver);
diff --git a/drivers/scsi/sata_promise.c b/drivers/scsi/sata_promise.c
index 268b2c345..a2eefb6bc 100644
--- a/drivers/scsi/sata_promise.c
+++ b/drivers/scsi/sata_promise.c
@@ -74,18 +74,19 @@ struct pdc_port_priv {
 static u32 pdc_sata_scr_read (struct ata_port *ap, unsigned int sc_reg);
 static void pdc_sata_scr_write (struct ata_port *ap, unsigned int sc_reg, u32 val);
 static int pdc_sata_init_one (struct pci_dev *pdev, const struct pci_device_id *ent);
-static void pdc_dma_setup(struct ata_queued_cmd *qc);
 static void pdc_dma_start(struct ata_queued_cmd *qc);
 static irqreturn_t pdc_interrupt (int irq, void *dev_instance, struct pt_regs *regs);
 static void pdc_eng_timeout(struct ata_port *ap);
 static int pdc_port_start(struct ata_port *ap);
 static void pdc_port_stop(struct ata_port *ap);
 static void pdc_phy_reset(struct ata_port *ap);
-static void pdc_fill_sg(struct ata_queued_cmd *qc);
+static void pdc_qc_prep(struct ata_queued_cmd *qc);
 static void pdc_tf_load_mmio(struct ata_port *ap, struct ata_taskfile *tf);
 static void pdc_exec_command_mmio(struct ata_port *ap, struct ata_taskfile *tf);
 static inline void pdc_dma_complete (struct ata_port *ap,
                                      struct ata_queued_cmd *qc, int have_err);
+static void pdc_irq_clear(struct ata_port *ap);
+static int pdc_qc_issue_prot(struct ata_queued_cmd *qc);
 
 static Scsi_Host_Template pdc_sata_sht = {
 	.module			= THIS_MODULE,
@@ -112,11 +113,11 @@ static struct ata_port_operations pdc_sata_ops = {
 	.check_status		= ata_check_status_mmio,
 	.exec_command		= pdc_exec_command_mmio,
 	.phy_reset		= pdc_phy_reset,
-	.bmdma_setup            = pdc_dma_setup,
-	.bmdma_start            = pdc_dma_start,
-	.fill_sg		= pdc_fill_sg,
+	.qc_prep		= pdc_qc_prep,
+	.qc_issue		= pdc_qc_issue_prot,
 	.eng_timeout		= pdc_eng_timeout,
 	.irq_handler		= pdc_interrupt,
+	.irq_clear		= pdc_irq_clear,
 	.scr_read		= pdc_sata_scr_read,
 	.scr_write		= pdc_sata_scr_write,
 	.port_start		= pdc_port_start,
@@ -261,14 +262,14 @@ static void pdc_sata_scr_write (struct ata_port *ap, unsigned int sc_reg,
 	writel(val, (void *) ap->ioaddr.scr_addr + (sc_reg * 4));
 }
 
-static void pdc_fill_sg(struct ata_queued_cmd *qc)
+static void pdc_qc_prep(struct ata_queued_cmd *qc)
 {
 	struct pdc_port_priv *pp = qc->ap->private_data;
 	unsigned int i;
 
 	VPRINTK("ENTER\n");
 
-	ata_fill_sg(qc);
+	ata_qc_prep(qc);
 
 	i = pdc_pkt_header(&qc->tf, qc->ap->prd_dma,  qc->dev->devno, pp->pkt);
 
@@ -378,6 +379,14 @@ static inline unsigned int pdc_host_intr( struct ata_port *ap,
         return handled;
 }
 
+static void pdc_irq_clear(struct ata_port *ap)
+{
+	struct ata_host_set *host_set = ap->host_set;
+	void *mmio = host_set->mmio_base;
+
+	readl(mmio + PDC_INT_SEQMASK);
+}
+
 static irqreturn_t pdc_interrupt (int irq, void *dev_instance, struct pt_regs *regs)
 {
 	struct ata_host_set *host_set = dev_instance;
@@ -431,13 +440,7 @@ static irqreturn_t pdc_interrupt (int irq, void *dev_instance, struct pt_regs *r
 	return IRQ_RETVAL(handled);
 }
 
-static void pdc_dma_setup(struct ata_queued_cmd *qc)
-{
-	/* nothing for now.  later, we will call standard
-	 * code in libata-core for ATAPI here */
-}
-
-static void pdc_dma_start(struct ata_queued_cmd *qc)
+static inline void pdc_dma_start(struct ata_queued_cmd *qc)
 {
 	struct ata_port *ap = qc->ap;
 	struct pdc_port_priv *pp = ap->private_data;
@@ -455,17 +458,35 @@ static void pdc_dma_start(struct ata_queued_cmd *qc)
 	readl((void *) ap->ioaddr.cmd_addr + PDC_PKT_SUBMIT); /* flush */
 }
 
+static int pdc_qc_issue_prot(struct ata_queued_cmd *qc)
+{
+	switch (qc->tf.protocol) {
+	case ATA_PROT_DMA:
+		pdc_dma_start(qc);
+		return 0;
+
+	case ATA_PROT_ATAPI_DMA:
+		BUG();
+		break;
+
+	default:
+		break;
+	}
+
+	return ata_qc_issue_prot(qc);
+}
+
 static void pdc_tf_load_mmio(struct ata_port *ap, struct ata_taskfile *tf)
 {
-	if (tf->protocol != ATA_PROT_DMA)
-		ata_tf_load_mmio(ap, tf);
+	WARN_ON (tf->protocol == ATA_PROT_DMA);
+	ata_tf_load_mmio(ap, tf);
 }
 
 
 static void pdc_exec_command_mmio(struct ata_port *ap, struct ata_taskfile *tf)
 {
-	if (tf->protocol != ATA_PROT_DMA)
-		ata_exec_command_mmio(ap, tf);
+	WARN_ON (tf->protocol == ATA_PROT_DMA);
+	ata_exec_command_mmio(ap, tf);
 }
 
 
diff --git a/drivers/scsi/sata_sil.c b/drivers/scsi/sata_sil.c
index 33ae676e2..72a89d1be 100644
--- a/drivers/scsi/sata_sil.c
+++ b/drivers/scsi/sata_sil.c
@@ -86,6 +86,7 @@ struct sil_drivelist {
 	{ "ST360015AS",		SIL_QUIRK_MOD15WRITE },
 	{ "ST380023AS",		SIL_QUIRK_MOD15WRITE },
 	{ "ST3120023AS",	SIL_QUIRK_MOD15WRITE },
+	{ "ST3160023AS",	SIL_QUIRK_MOD15WRITE },
 	{ "ST340014ASL",	SIL_QUIRK_MOD15WRITE },
 	{ "ST360014ASL",	SIL_QUIRK_MOD15WRITE },
 	{ "ST380011ASL",	SIL_QUIRK_MOD15WRITE },
@@ -131,9 +132,11 @@ static struct ata_port_operations sil_ops = {
 	.post_set_mode		= sil_post_set_mode,
 	.bmdma_setup            = ata_bmdma_setup_mmio,
 	.bmdma_start            = ata_bmdma_start_mmio,
-	.fill_sg		= ata_fill_sg,
+	.qc_prep		= ata_qc_prep,
+	.qc_issue		= ata_qc_issue_prot,
 	.eng_timeout		= ata_eng_timeout,
 	.irq_handler		= ata_interrupt,
+	.irq_clear		= ata_bmdma_irq_clear,
 	.scr_read		= sil_scr_read,
 	.scr_write		= sil_scr_write,
 	.port_start		= ata_port_start,
@@ -302,6 +305,7 @@ static void sil_dev_config(struct ata_port *ap, struct ata_device *dev)
 		       ap->id, dev->devno);
 		ap->host->max_sectors = 15;
 		ap->host->hostt->max_sectors = 15;
+		dev->flags |= ATA_DFLAG_LOCK_SECTORS;
 		return;
 	}
 
diff --git a/drivers/scsi/sata_sis.c b/drivers/scsi/sata_sis.c
index 8965ee281..88b7a02ea 100644
--- a/drivers/scsi/sata_sis.c
+++ b/drivers/scsi/sata_sis.c
@@ -100,9 +100,11 @@ static struct ata_port_operations sis_ops = {
 	.phy_reset		= sata_phy_reset,
 	.bmdma_setup            = ata_bmdma_setup_pio,
 	.bmdma_start            = ata_bmdma_start_pio,
-	.fill_sg		= ata_fill_sg,
+	.qc_prep		= ata_qc_prep,
+	.qc_issue		= ata_qc_issue_prot,
 	.eng_timeout		= ata_eng_timeout,
 	.irq_handler		= ata_interrupt,
+	.irq_clear		= ata_bmdma_irq_clear,
 	.scr_read		= sis_scr_read,
 	.scr_write		= sis_scr_write,
 	.port_start		= ata_port_start,
diff --git a/drivers/scsi/sata_svw.c b/drivers/scsi/sata_svw.c
index 60841abc4..398f24f27 100644
--- a/drivers/scsi/sata_svw.c
+++ b/drivers/scsi/sata_svw.c
@@ -233,9 +233,11 @@ static struct ata_port_operations k2_sata_ops = {
 	.phy_reset		= sata_phy_reset,
 	.bmdma_setup            = ata_bmdma_setup_mmio,
 	.bmdma_start            = ata_bmdma_start_mmio,
-	.fill_sg		= ata_fill_sg,
+	.qc_prep		= ata_qc_prep,
+	.qc_issue		= ata_qc_issue_prot,
 	.eng_timeout		= ata_eng_timeout,
 	.irq_handler		= ata_interrupt,
+	.irq_clear		= ata_bmdma_irq_clear,
 	.scr_read		= k2_sata_scr_read,
 	.scr_write		= k2_sata_scr_write,
 	.port_start		= ata_port_start,
diff --git a/drivers/scsi/sata_sx4.c b/drivers/scsi/sata_sx4.c
index 3268fdf7e..b54fd87e3 100644
--- a/drivers/scsi/sata_sx4.c
+++ b/drivers/scsi/sata_sx4.c
@@ -153,7 +153,7 @@ static void pdc_eng_timeout(struct ata_port *ap);
 static void pdc_20621_phy_reset (struct ata_port *ap);
 static int pdc_port_start(struct ata_port *ap);
 static void pdc_port_stop(struct ata_port *ap);
-static void pdc20621_fill_sg(struct ata_queued_cmd *qc);
+static void pdc20621_qc_prep(struct ata_queued_cmd *qc);
 static void pdc_tf_load_mmio(struct ata_port *ap, struct ata_taskfile *tf);
 static void pdc_exec_command_mmio(struct ata_port *ap, struct ata_taskfile *tf);
 static void pdc20621_host_stop(struct ata_host_set *host_set);
@@ -171,6 +171,7 @@ static void pdc20621_get_from_dimm(struct ata_probe_ent *pe,
 #endif
 static void pdc20621_put_to_dimm(struct ata_probe_ent *pe, 
 				 void *psource, u32 offset, u32 size);
+static void pdc20621_irq_clear(struct ata_port *ap);
 
 
 static Scsi_Host_Template pdc_sata_sht = {
@@ -200,9 +201,11 @@ static struct ata_port_operations pdc_20621_ops = {
 	.phy_reset		= pdc_20621_phy_reset,
 	.bmdma_setup            = pdc20621_dma_setup,
 	.bmdma_start            = pdc20621_dma_start,
-	.fill_sg		= pdc20621_fill_sg,
+	.qc_prep		= pdc20621_qc_prep,
+	.qc_issue		= ata_qc_issue_prot,
 	.eng_timeout		= pdc_eng_timeout,
 	.irq_handler		= pdc20621_interrupt,
+	.irq_clear		= pdc20621_irq_clear,
 	.port_start		= pdc_port_start,
 	.port_stop		= pdc_port_stop,
 	.host_stop		= pdc20621_host_stop,
@@ -434,7 +437,7 @@ static inline void pdc20621_host_pkt(struct ata_taskfile *tf, u8 *buf,
 		buf32[dw + 3]);
 }
 
-static void pdc20621_fill_sg(struct ata_queued_cmd *qc)
+static void pdc20621_qc_prep(struct ata_queued_cmd *qc)
 {
 	struct scatterlist *sg = qc->sg;
 	struct ata_port *ap = qc->ap;
@@ -446,6 +449,9 @@ static void pdc20621_fill_sg(struct ata_queued_cmd *qc)
 	unsigned int i, last, idx, total_len = 0, sgt_len;
 	u32 *buf = (u32 *) &pp->dimm_buf[PDC_DIMM_HEADER_SZ];
 
+	if (!(qc->flags & ATA_QCFLAG_DMAMAP))
+		return;
+
 	VPRINTK("ata%u: ENTER\n", ap->id);
 
 	/* hard-code chip #0 */
@@ -699,6 +705,16 @@ static inline unsigned int pdc20621_host_intr( struct ata_port *ap,
 	return handled;
 }
 
+static void pdc20621_irq_clear(struct ata_port *ap)
+{
+	struct ata_host_set *host_set = ap->host_set;
+	void *mmio = host_set->mmio_base;
+
+	mmio += PDC_CHIP0_OFS;
+
+	readl(mmio + PDC_20621_SEQMASK);
+}
+
 static irqreturn_t pdc20621_interrupt (int irq, void *dev_instance, struct pt_regs *regs)
 {
 	struct ata_host_set *host_set = dev_instance;
diff --git a/drivers/scsi/sata_via.c b/drivers/scsi/sata_via.c
index 46d385128..993edfc99 100644
--- a/drivers/scsi/sata_via.c
+++ b/drivers/scsi/sata_via.c
@@ -108,10 +108,13 @@ static struct ata_port_operations svia_sata_ops = {
 
 	.bmdma_setup            = ata_bmdma_setup_pio,
 	.bmdma_start            = ata_bmdma_start_pio,
-	.fill_sg		= ata_fill_sg,
+	.qc_prep		= ata_qc_prep,
+	.qc_issue		= ata_qc_issue_prot,
+
 	.eng_timeout		= ata_eng_timeout,
 
 	.irq_handler		= ata_interrupt,
+	.irq_clear		= ata_bmdma_irq_clear,
 
 	.scr_read		= svia_scr_read,
 	.scr_write		= svia_scr_write,
diff --git a/drivers/scsi/sata_vsc.c b/drivers/scsi/sata_vsc.c
index e0ad17121..d63a339cc 100644
--- a/drivers/scsi/sata_vsc.c
+++ b/drivers/scsi/sata_vsc.c
@@ -215,9 +215,11 @@ static struct ata_port_operations vsc_sata_ops = {
 	.phy_reset		= sata_phy_reset,
 	.bmdma_setup            = ata_bmdma_setup_mmio,
 	.bmdma_start            = ata_bmdma_start_mmio,
-	.fill_sg		= ata_fill_sg,
+	.qc_prep		= ata_qc_prep,
+	.qc_issue		= ata_qc_issue_prot,
 	.eng_timeout		= ata_eng_timeout,
 	.irq_handler		= vsc_sata_interrupt,
+	.irq_clear		= ata_bmdma_irq_clear,
 	.scr_read		= vsc_sata_scr_read,
 	.scr_write		= vsc_sata_scr_write,
 	.port_start		= ata_port_start,
diff --git a/drivers/scsi/scsi.c b/drivers/scsi/scsi.c
index 12f81878f..17dce6657 100644
--- a/drivers/scsi/scsi.c
+++ b/drivers/scsi/scsi.c
@@ -56,8 +56,14 @@
 #include <linux/notifier.h>
 #include <linux/cpu.h>
 
+#include <scsi/scsi.h>
+#include <scsi/scsi_cmnd.h>
+#include <scsi/scsi_dbg.h>
+#include <scsi/scsi_device.h>
+#include <scsi/scsi_eh.h>
 #include <scsi/scsi_host.h>
-#include "scsi.h"
+#include <scsi/scsi_tcq.h>
+#include <scsi/scsi_request.h>
 
 #include "scsi_priv.h"
 #include "scsi_logging.h"
@@ -400,7 +406,7 @@ void scsi_log_send(struct scsi_cmnd *cmd)
 			 * output in scsi_log_completion.
 			 */
 			printk("                 ");
-			print_command(cmd->cmnd);
+			scsi_print_command(cmd);
 			if (level > 3) {
 				printk(KERN_INFO "buffer = 0x%p, bufflen = %d,"
 				       " done = 0x%p, queuecommand 0x%p\n",
@@ -468,13 +474,13 @@ void scsi_log_completion(struct scsi_cmnd *cmd, int disposition)
 				printk("UNKNOWN");
 			}
 			printk(" %8x ", cmd->result);
-			print_command(cmd->cmnd);
+			scsi_print_command(cmd);
 			if (status_byte(cmd->result) & CHECK_CONDITION) {
 				/*
 				 * XXX The print_sense formatting/prefix
 				 * doesn't match this function.
 				 */
-				print_sense("", cmd);
+				scsi_print_sense("", cmd);
 			}
 			if (level > 3) {
 				printk(KERN_INFO "scsi host busy %d failed %d\n",
@@ -689,8 +695,6 @@ static DEFINE_PER_CPU(struct list_head, scsi_done_q);
  */
 void scsi_done(struct scsi_cmnd *cmd)
 {
-	unsigned long flags;
-
 	/*
 	 * We don't have to worry about this one timing out any more.
 	 * If we are unable to remove the timer, then the command
@@ -701,6 +705,14 @@ void scsi_done(struct scsi_cmnd *cmd)
 	 */
 	if (!scsi_delete_timer(cmd))
 		return;
+	__scsi_done(cmd);
+}
+
+/* Private entry to scsi_done() to complete a command when the timer
+ * isn't running --- used by scsi_times_out */
+void __scsi_done(struct scsi_cmnd *cmd)
+{
+	unsigned long flags;
 
 	/*
 	 * Set the serial numbers back to zero
diff --git a/drivers/scsi/scsi.h b/drivers/scsi/scsi.h
index fd5c8a381..cb6b5fbb7 100644
--- a/drivers/scsi/scsi.h
+++ b/drivers/scsi/scsi.h
@@ -11,6 +11,11 @@
  *       add scatter-gather, multiple outstanding request, and other
  *       enhancements.
  */
+/*
+ * NOTE:  this file only contains compatibility glue for old drivers.  All
+ * these wrappers will be removed sooner or later.  For new code please use
+ * the interfaces declared in the headers in include/scsi/
+ */
 
 #ifndef _SCSI_H
 #define _SCSI_H
@@ -18,6 +23,7 @@
 #include <linux/config.h>	    /* for CONFIG_SCSI_LOGGING */
 
 #include <scsi/scsi_cmnd.h>
+#include <scsi/scsi_dbg.h>
 #include <scsi/scsi_device.h>
 #include <scsi/scsi_eh.h>
 #include <scsi/scsi_request.h>
@@ -34,33 +40,12 @@
 #define FALSE 0
 #endif
 
-#ifdef DEBUG
-#define SCSI_TIMEOUT (5*HZ)
-#else
-#define SCSI_TIMEOUT (2*HZ)
-#endif
-
 struct Scsi_Host;
 struct scsi_cmnd;
 struct scsi_device;
 struct scsi_target;
 struct scatterlist;
 
-/*
- * Prototypes for functions in constants.c
- * Some of these used to live in constants.h
- */
-extern void print_Scsi_Cmnd(struct scsi_cmnd *);
-extern void print_command(unsigned char *);
-extern void print_sense(const char *, struct scsi_cmnd *);
-extern void print_req_sense(const char *, struct scsi_request *);
-extern void print_driverbyte(int scsiresult);
-extern void print_hostbyte(int scsiresult);
-extern void print_status(unsigned char status);
-extern int print_msg(const unsigned char *);
-extern const char *scsi_sense_key_string(unsigned char);
-extern const char *scsi_extd_sense_format(unsigned char, unsigned char);
-
 /*
  * Legacy dma direction interfaces.
  *
@@ -76,6 +61,42 @@ extern const char *scsi_extd_sense_format(unsigned char, unsigned char);
 #define scsi_to_pci_dma_dir(scsi_dir)	((int)(scsi_dir))
 #define scsi_to_sbus_dma_dir(scsi_dir)	((int)(scsi_dir))
 
+/*
+ * Old names for debug prettyprinting functions.
+ */
+static inline void print_Scsi_Cmnd(struct scsi_cmnd *cmd)
+{
+	return scsi_print_command(cmd);
+}
+static inline void print_command(unsigned char *cdb)
+{
+	return __scsi_print_command(cdb);
+}
+static inline void print_sense(const char *devclass, struct scsi_cmnd *cmd)
+{
+	return scsi_print_sense(devclass, cmd);
+}
+static inline void print_req_sense(const char *devclass, struct scsi_request *req)
+{
+	return scsi_print_req_sense(devclass, req);
+}
+static inline void print_driverbyte(int scsiresult)
+{
+	return scsi_print_driverbyte(scsiresult);
+}
+static inline void print_hostbyte(int scsiresult)
+{
+	return scsi_print_hostbyte(scsiresult);
+}
+static inline void print_status(unsigned char status)
+{
+	return scsi_print_status(status);
+}
+static inline int print_msg(const unsigned char *msg)
+{
+	return scsi_print_msg(msg);
+}
+
 /*
  * This is the crap from the old error handling code.  We have it in a special
  * place so that we can more easily delete it later on.
diff --git a/drivers/scsi/scsi_debug.c b/drivers/scsi/scsi_debug.c
index da7dfb3d9..b9509840a 100644
--- a/drivers/scsi/scsi_debug.c
+++ b/drivers/scsi/scsi_debug.c
@@ -1,4 +1,4 @@
-/* 
+/*
  *  linux/kernel/scsi_debug.c
  * vvvvvvvvvvvvvvvvvvvvvvv Original vvvvvvvvvvvvvvvvvvvvvvvvvvvvvvv
  *  Copyright (C) 1992  Eric Youngdale
@@ -7,9 +7,9 @@
  *  anything out of the ordinary is seen.
  * ^^^^^^^^^^^^^^^^^^^^^^^ Original ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  *
- *  This version is more generic, simulating a variable number of disk 
- *  (or disk like devices) sharing a common amount of RAM 
- *  
+ *  This version is more generic, simulating a variable number of disk
+ *  (or disk like devices) sharing a common amount of RAM
+ *
  *
  *  For documentation see http://www.torque.net/sg/sdebug25.html
  *
@@ -43,7 +43,7 @@
 
 #include <linux/blkdev.h>
 #include "scsi.h"
-#include "hosts.h"
+#include <scsi/scsi_host.h>
 #include <scsi/scsicam.h>
 
 #include <linux/stat.h>
@@ -55,7 +55,8 @@
 #include "scsi_logging.h"
 #include "scsi_debug.h"
 
-static const char * scsi_debug_version_str = "Version: 1.71 (20031007)";
+#define SCSI_DEBUG_VERSION "1.73"
+static const char * scsi_debug_version_date = "20040518";
 
 /* Additional Sense Code (ASC) used */
 #define NO_ADDED_SENSE 0x0
@@ -76,11 +77,13 @@ static const char * scsi_debug_version_str = "Version: 1.71 (20031007)";
 /* With these defaults, this driver will make 1 host with 1 target
  * (id 0) containing 1 logical unit (lun 0). That is 1 device.
  */
+#define DEF_DELAY   1
 #define DEF_DEV_SIZE_MB   8
 #define DEF_EVERY_NTH   0
-#define DEF_DELAY   1
-#define DEF_SCSI_LEVEL   3
+#define DEF_NUM_PARTS   0
 #define DEF_OPTS   0
+#define DEF_SCSI_LEVEL   3
+#define DEF_PTYPE   0
 
 /* bit mask values for scsi_debug_opts */
 #define SCSI_DEBUG_OPT_NOISE   1
@@ -101,19 +104,21 @@ static const char * scsi_debug_version_str = "Version: 1.71 (20031007)";
  * or "peripheral device" addressing (value 0) */
 #define SAM2_LUN_ADDRESS_METHOD 0
 
+static int scsi_debug_add_host = DEF_NUM_HOST;
+static int scsi_debug_delay = DEF_DELAY;
 static int scsi_debug_dev_size_mb = DEF_DEV_SIZE_MB;
-static int scsi_debug_num_tgts = DEF_NUM_TGTS; /* targets per host */
-static int scsi_debug_opts = DEF_OPTS;
 static int scsi_debug_every_nth = DEF_EVERY_NTH;
-static int scsi_debug_cmnd_count = 0;
-static int scsi_debug_delay = DEF_DELAY;
 static int scsi_debug_max_luns = DEF_MAX_LUNS;
+static int scsi_debug_num_parts = DEF_NUM_PARTS;
+static int scsi_debug_num_tgts = DEF_NUM_TGTS; /* targets per host */
+static int scsi_debug_opts = DEF_OPTS;
 static int scsi_debug_scsi_level = DEF_SCSI_LEVEL;
-static int scsi_debug_add_host = DEF_NUM_HOST;
+static int scsi_debug_ptype = DEF_PTYPE; /* SCSI peripheral type (0==disk) */
+
+static int scsi_debug_cmnd_count = 0;
 
 #define DEV_READONLY(TGT)      (0)
 #define DEV_REMOVEABLE(TGT)    (0)
-#define PERIPH_DEVICE_TYPE(TGT) (TYPE_DISK);
 
 static unsigned long sdebug_store_size;	/* in bytes */
 static sector_t sdebug_capacity;	/* in sectors */
@@ -129,6 +134,8 @@ static int sdebug_sectors_per;		/* sectors per cylinder */
 #define SECT_SIZE (1 << POW2_SECT_SIZE)
 #define SECT_SIZE_PER(TGT) SECT_SIZE
 
+#define SDEBUG_MAX_PARTS 4
+
 #define SDEBUG_SENSE_LEN 32
 
 struct sdebug_dev_info {
@@ -215,7 +222,7 @@ static struct device_driver sdebug_driverfs_driver = {
 	.remove         = sdebug_driver_remove,
 };
 
-static const int check_condition_result = 
+static const int check_condition_result =
 		(DRIVER_SENSE << 24) | SAM_STAT_CHECK_CONDITION;
 
 /* function declarations */
@@ -224,7 +231,7 @@ static int resp_inquiry(unsigned char * cmd, int target, unsigned char * buff,
 static int resp_mode_sense(unsigned char * cmd, int target,
 			   unsigned char * buff, int bufflen,
 			   struct sdebug_dev_info * devip);
-static int resp_read(struct scsi_cmnd * SCpnt, int upper_blk, int block, 
+static int resp_read(struct scsi_cmnd * SCpnt, int upper_blk, int block,
 		     int num, struct sdebug_dev_info * devip);
 static int resp_write(struct scsi_cmnd * SCpnt, int upper_blk, int block,
 		      int num, struct sdebug_dev_info * devip);
@@ -232,14 +239,15 @@ static int resp_report_luns(unsigned char * cmd, unsigned char * buff,
 			    int bufflen, struct sdebug_dev_info * devip);
 static void timer_intr_handler(unsigned long);
 static struct sdebug_dev_info * devInfoReg(struct scsi_device * sdev);
-static void mk_sense_buffer(struct sdebug_dev_info * devip, int key, 
+static void mk_sense_buffer(struct sdebug_dev_info * devip, int key,
 			    int asc, int asq, int inbandLen);
-static int check_reset(struct scsi_cmnd * SCpnt, 
+static int check_reset(struct scsi_cmnd * SCpnt,
 		       struct sdebug_dev_info * devip);
-static int schedule_resp(struct scsi_cmnd * cmnd, 
-			 struct sdebug_dev_info * devip, 
+static int schedule_resp(struct scsi_cmnd * cmnd,
+			 struct sdebug_dev_info * devip,
 			 done_funct_t done, int scsi_result, int delta_jiff);
-static void init_all_queued(void);
+static void __init sdebug_build_parts(unsigned char * ramp);
+static void __init init_all_queued(void);
 static void stop_all_queued(void);
 static int stop_queued_cmnd(struct scsi_cmnd * cmnd);
 static int inquiry_evpd_83(unsigned char * arr, int dev_id_num,
@@ -249,6 +257,8 @@ static void do_remove_driverfs_files(void);
 
 static int sdebug_add_adapter(void);
 static void sdebug_remove_adapter(void);
+static void sdebug_max_tgts_luns(void);
+
 static struct device pseudo_primary;
 static struct bus_type pseudo_lld_bus;
 
@@ -257,7 +267,7 @@ static unsigned char * scatg2virt(const struct scatterlist * sclp)
 	if (NULL == sclp)
 		return NULL;
 	else if (sclp->page)
-		return (unsigned char *)page_address(sclp->page) + 
+		return (unsigned char *)page_address(sclp->page) +
 		       sclp->offset;
 	else
 		return NULL;
@@ -288,7 +298,7 @@ int scsi_debug_queuecommand(struct scsi_cmnd * SCpnt, done_funct_t done)
 		bufflen = sgpnt[0].length;
 		/* READ and WRITE process scatterlist themselves */
 	}
-	else 
+	else
 		buff = (unsigned char *) SCpnt->request_buffer;
 	if (NULL == buff) {
 		buff = spare_buff;	/* assume cmd moves no data */
@@ -304,11 +314,11 @@ int scsi_debug_queuecommand(struct scsi_cmnd * SCpnt, done_funct_t done)
         }
 
 	if (SCpnt->device->lun >= scsi_debug_max_luns)
-		return schedule_resp(SCpnt, NULL, done, 
+		return schedule_resp(SCpnt, NULL, done,
 				     DID_NO_CONNECT << 16, 0);
 	devip = devInfoReg(SCpnt->device);
 	if (NULL == devip)
-		return schedule_resp(SCpnt, NULL, done, 
+		return schedule_resp(SCpnt, NULL, done,
 				     DID_NO_CONNECT << 16, 0);
 
         if ((scsi_debug_every_nth > 0) &&
@@ -331,7 +341,7 @@ int scsi_debug_queuecommand(struct scsi_cmnd * SCpnt, done_funct_t done)
 		 * shouldn't need to call REQUEST_SENSE */
 		if (devip) {
 			sbuff = devip->sense_buff;
-			memcpy(buff, sbuff, (bufflen < SDEBUG_SENSE_LEN) ? 
+			memcpy(buff, sbuff, (bufflen < SDEBUG_SENSE_LEN) ?
 					     bufflen : SDEBUG_SENSE_LEN);
 			mk_sense_buffer(devip, 0, NO_ADDED_SENSE, 0, 7);
 		} else {
@@ -392,29 +402,29 @@ int scsi_debug_queuecommand(struct scsi_cmnd * SCpnt, done_funct_t done)
 			break;
 		upper_blk = 0;
 		if ((*cmd) == READ_16) {
-			upper_blk = cmd[5] + (cmd[4] << 8) + 
+			upper_blk = cmd[5] + (cmd[4] << 8) +
 				    (cmd[3] << 16) + (cmd[2] << 24);
-			block = cmd[9] + (cmd[8] << 8) + 
+			block = cmd[9] + (cmd[8] << 8) +
 				(cmd[7] << 16) + (cmd[6] << 24);
-			num = cmd[13] + (cmd[12] << 8) + 
+			num = cmd[13] + (cmd[12] << 8) +
 				(cmd[11] << 16) + (cmd[10] << 24);
 		} else if ((*cmd) == READ_12) {
-			block = cmd[5] + (cmd[4] << 8) + 
+			block = cmd[5] + (cmd[4] << 8) +
 				(cmd[3] << 16) + (cmd[2] << 24);
-			num = cmd[9] + (cmd[8] << 8) + 
+			num = cmd[9] + (cmd[8] << 8) +
 				(cmd[7] << 16) + (cmd[6] << 24);
 		} else if ((*cmd) == READ_10) {
-			block = cmd[5] + (cmd[4] << 8) + 
+			block = cmd[5] + (cmd[4] << 8) +
 				(cmd[3] << 16) + (cmd[2] << 24);
 			num = cmd[8] + (cmd[7] << 8);
 		} else {
-			block = cmd[3] + (cmd[2] << 8) + 
+			block = cmd[3] + (cmd[2] << 8) +
 				((cmd[1] & 0x1f) << 16);
 			num = cmd[4];
 		}
 		errsts = resp_read(SCpnt, upper_blk, block, num, devip);
 		if (inj_recovered && (0 == errsts)) {
-			mk_sense_buffer(devip, RECOVERED_ERROR, 
+			mk_sense_buffer(devip, RECOVERED_ERROR,
 					THRESHHOLD_EXCEEDED, 0, 18);
 			errsts = check_condition_result;
 		}
@@ -430,29 +440,29 @@ int scsi_debug_queuecommand(struct scsi_cmnd * SCpnt, done_funct_t done)
 			break;
 		upper_blk = 0;
 		if ((*cmd) == WRITE_16) {
-			upper_blk = cmd[5] + (cmd[4] << 8) + 
+			upper_blk = cmd[5] + (cmd[4] << 8) +
 				    (cmd[3] << 16) + (cmd[2] << 24);
-			block = cmd[9] + (cmd[8] << 8) + 
+			block = cmd[9] + (cmd[8] << 8) +
 				(cmd[7] << 16) + (cmd[6] << 24);
-			num = cmd[13] + (cmd[12] << 8) + 
+			num = cmd[13] + (cmd[12] << 8) +
 				(cmd[11] << 16) + (cmd[10] << 24);
 		} else if ((*cmd) == WRITE_12) {
-			block = cmd[5] + (cmd[4] << 8) + 
+			block = cmd[5] + (cmd[4] << 8) +
 				(cmd[3] << 16) + (cmd[2] << 24);
-			num = cmd[9] + (cmd[8] << 8) + 
+			num = cmd[9] + (cmd[8] << 8) +
 				(cmd[7] << 16) + (cmd[6] << 24);
 		} else if ((*cmd) == WRITE_10) {
-			block = cmd[5] + (cmd[4] << 8) + 
+			block = cmd[5] + (cmd[4] << 8) +
 				(cmd[3] << 16) + (cmd[2] << 24);
 			num = cmd[8] + (cmd[7] << 8);
 		} else {
-			block = cmd[3] + (cmd[2] << 8) + 
+			block = cmd[3] + (cmd[2] << 8) +
 				((cmd[1] & 0x1f) << 16);
 			num = cmd[4];
 		}
 		errsts = resp_write(SCpnt, upper_blk, block, num, devip);
 		if (inj_recovered && (0 == errsts)) {
-			mk_sense_buffer(devip, RECOVERED_ERROR, 
+			mk_sense_buffer(devip, RECOVERED_ERROR,
 					THRESHHOLD_EXCEEDED, 0, 18);
 			errsts = check_condition_result;
 		}
@@ -474,7 +484,7 @@ int scsi_debug_queuecommand(struct scsi_cmnd * SCpnt, done_funct_t done)
 	return schedule_resp(SCpnt, devip, done, errsts, scsi_debug_delay);
 }
 
-static int scsi_debug_ioctl(struct scsi_device *dev, int cmd, void *arg)
+static int scsi_debug_ioctl(struct scsi_device *dev, int cmd, void __user *arg)
 {
 	if (SCSI_DEBUG_OPT_NOISE & scsi_debug_opts) {
 		printk(KERN_INFO "scsi_debug: ioctl: cmd=0x%x\n", cmd);
@@ -500,7 +510,7 @@ static const char * vendor_id = "Linux   ";
 static const char * product_id = "scsi_debug      ";
 static const char * product_rev = "0004";
 
-static int inquiry_evpd_83(unsigned char * arr, int dev_id_num, 
+static int inquiry_evpd_83(unsigned char * arr, int dev_id_num,
 			   const char * dev_id_str, int dev_id_str_len)
 {
 	int num;
@@ -537,7 +547,7 @@ static int resp_inquiry(unsigned char * cmd, int target, unsigned char * buff,
 {
 	unsigned char pq_pdt;
 	unsigned char arr[SDEBUG_MAX_INQ_ARR_SZ];
-	int min_len = bufflen > SDEBUG_MAX_INQ_ARR_SZ ? 
+	int min_len = bufflen > SDEBUG_MAX_INQ_ARR_SZ ?
 			SDEBUG_MAX_INQ_ARR_SZ : bufflen;
 
 	if (bufflen < cmd[4])
@@ -545,7 +555,7 @@ static int resp_inquiry(unsigned char * cmd, int target, unsigned char * buff,
 		       "< alloc_length=%d\n", bufflen, (int)cmd[4]);
 	memset(buff, 0, bufflen);
 	memset(arr, 0, SDEBUG_MAX_INQ_ARR_SZ);
-	pq_pdt = PERIPH_DEVICE_TYPE(target);
+	pq_pdt = (scsi_debug_ptype & 0x1f);
 	arr[0] = pq_pdt;
 	if (0x2 & cmd[1]) {  /* CMDDT bit set */
 		mk_sense_buffer(devip, ILLEGAL_REQUEST, INVALID_FIELD_IN_CDB,
@@ -573,11 +583,11 @@ static int resp_inquiry(unsigned char * cmd, int target, unsigned char * buff,
 						 dev_id_str, len);
 		} else {
 			/* Illegal request, invalid field in cdb */
-			mk_sense_buffer(devip, ILLEGAL_REQUEST, 
+			mk_sense_buffer(devip, ILLEGAL_REQUEST,
 					INVALID_FIELD_IN_CDB, 0, 18);
 			return check_condition_result;
 		}
-		memcpy(buff, arr, min_len); 
+		memcpy(buff, arr, min_len);
 		return 0;
 	}
 	/* drops through here for a standard inquiry */
@@ -592,11 +602,11 @@ static int resp_inquiry(unsigned char * cmd, int target, unsigned char * buff,
 	return 0;
 }
 
-/* <<Following mode page info copied from ST318451LW>> */ 
+/* <<Following mode page info copied from ST318451LW>> */
 
 static int resp_err_recov_pg(unsigned char * p, int pcontrol, int target)
 {	/* Read-Write Error Recovery page for mode_sense */
-	unsigned char err_recov_pg[] = {0x1, 0xa, 0xc0, 11, 240, 0, 0, 0, 
+	unsigned char err_recov_pg[] = {0x1, 0xa, 0xc0, 11, 240, 0, 0, 0,
 					5, 0, 0xff, 0xff};
 
 	memcpy(p, err_recov_pg, sizeof(err_recov_pg));
@@ -607,7 +617,7 @@ static int resp_err_recov_pg(unsigned char * p, int pcontrol, int target)
 
 static int resp_disconnect_pg(unsigned char * p, int pcontrol, int target)
 { 	/* Disconnect-Reconnect page for mode_sense */
-	unsigned char disconnect_pg[] = {0x2, 0xe, 128, 128, 0, 10, 0, 0, 
+	unsigned char disconnect_pg[] = {0x2, 0xe, 128, 128, 0, 10, 0, 0,
 					 0, 0, 0, 0, 0, 0, 0, 0};
 
 	memcpy(p, disconnect_pg, sizeof(disconnect_pg));
@@ -636,7 +646,7 @@ static int resp_format_pg(unsigned char * p, int pcontrol, int target)
 
 static int resp_caching_pg(unsigned char * p, int pcontrol, int target)
 { 	/* Caching page for mode_sense */
-	unsigned char caching_pg[] = {0x8, 18, 0x14, 0, 0xff, 0xff, 0, 0, 
+	unsigned char caching_pg[] = {0x8, 18, 0x14, 0, 0xff, 0xff, 0, 0,
 		0xff, 0xff, 0xff, 0xff, 0x80, 0x14, 0, 0,     0, 0, 0, 0};
 
 	memcpy(p, caching_pg, sizeof(caching_pg));
@@ -678,7 +688,7 @@ static int resp_mode_sense(unsigned char * cmd, int target,
 	int alloc_len, msense_6, offset, len;
 	unsigned char * ap;
 	unsigned char arr[SDEBUG_MAX_MSENSE_SZ];
-	int min_len = bufflen > SDEBUG_MAX_MSENSE_SZ ? 
+	int min_len = bufflen > SDEBUG_MAX_MSENSE_SZ ?
 			SDEBUG_MAX_MSENSE_SZ : bufflen;
 
 	SCSI_LOG_LLQUEUE(3, printk("Mode sense ...(%p %d)\n", buff, bufflen));
@@ -753,14 +763,14 @@ static int resp_mode_sense(unsigned char * cmd, int target,
 		arr[0] = offset - 1;
 	else {
 		offset -= 2;
-		arr[0] = (offset >> 8) & 0xff; 
-		arr[1] = offset & 0xff; 
+		arr[0] = (offset >> 8) & 0xff;
+		arr[1] = offset & 0xff;
 	}
 	memcpy(buff, arr, min_len);
 	return 0;
 }
 
-static int resp_read(struct scsi_cmnd * SCpnt, int upper_blk, int block, 
+static int resp_read(struct scsi_cmnd * SCpnt, int upper_blk, int block,
 		     int num, struct sdebug_dev_info * devip)
 {
         unsigned char *buff = (unsigned char *) SCpnt->request_buffer;
@@ -770,14 +780,14 @@ static int resp_read(struct scsi_cmnd * SCpnt, int upper_blk, int block,
 	unsigned long iflags;
 
 	if (upper_blk || (block + num > sdebug_capacity)) {
-		mk_sense_buffer(devip, ILLEGAL_REQUEST, ADDR_OUT_OF_RANGE, 
+		mk_sense_buffer(devip, ILLEGAL_REQUEST, ADDR_OUT_OF_RANGE,
 				0, 18);
 		return check_condition_result;
 	}
 	if ((SCSI_DEBUG_OPT_MEDIUM_ERR & scsi_debug_opts) &&
-	    (block <= OPT_MEDIUM_ERR_ADDR) && 
+	    (block <= OPT_MEDIUM_ERR_ADDR) &&
 	    ((block + num) > OPT_MEDIUM_ERR_ADDR)) {
-		mk_sense_buffer(devip, MEDIUM_ERROR, UNRECOVERED_READ_ERR, 
+		mk_sense_buffer(devip, MEDIUM_ERROR, UNRECOVERED_READ_ERR,
 				0, 18);
 		/* claim unrecoverable read error */
 		return check_condition_result;
@@ -785,7 +795,7 @@ static int resp_read(struct scsi_cmnd * SCpnt, int upper_blk, int block,
 	read_lock_irqsave(&atomic_rw, iflags);
         sgcount = 0;
 	nbytes = bufflen;
-	/* printk(KERN_INFO "scsi_debug_read: block=%d, tot_bufflen=%d\n", 
+	/* printk(KERN_INFO "scsi_debug_read: block=%d, tot_bufflen=%d\n",
 	       block, bufflen); */
 	if (SCpnt->use_sg) {
 		sgcount = 0;
@@ -857,7 +867,7 @@ static int resp_write(struct scsi_cmnd * SCpnt, int upper_blk, int block,
 static int resp_report_luns(unsigned char * cmd, unsigned char * buff,
 			    int bufflen, struct sdebug_dev_info * devip)
 {
-	unsigned int alloc_len; 
+	unsigned int alloc_len;
 	int lun_cnt, i, upper;
 	int select_report = (int)cmd[2];
 	struct scsi_lun *one_lun;
@@ -868,19 +878,19 @@ static int resp_report_luns(unsigned char * cmd, unsigned char * buff,
 			       	0, 18);
 		return check_condition_result;
 	}
-	if (bufflen > 8) { /* can produce response with up to 16k luns 
+	if (bufflen > 8) { /* can produce response with up to 16k luns
 			      (lun 0 to lun 16383) */
 		memset(buff, 0, bufflen);
 		lun_cnt = scsi_debug_max_luns;
 		buff[2] = ((sizeof(struct scsi_lun) * lun_cnt) >> 8) & 0xff;
 		buff[3] = (sizeof(struct scsi_lun) * lun_cnt) & 0xff;
-		lun_cnt = min((int)((bufflen - 8) / sizeof(struct scsi_lun)), 
+		lun_cnt = min((int)((bufflen - 8) / sizeof(struct scsi_lun)),
 			      lun_cnt);
 		one_lun = (struct scsi_lun *) &buff[8];
 		for (i = 0; i < lun_cnt; i++) {
 			upper = (i >> 8) & 0x3f;
 			if (upper)
-				one_lun[i].scsi_lun[0] = 
+				one_lun[i].scsi_lun[0] =
 				    (upper | (SAM2_LUN_ADDRESS_METHOD << 6));
 			one_lun[i].scsi_lun[1] = i & 0xff;
 		}
@@ -926,7 +936,7 @@ static int scsi_debug_slave_alloc(struct scsi_device * sdp)
 
 static int scsi_debug_slave_configure(struct scsi_device * sdp)
 {
-	struct sdebug_dev_info * devip; 
+	struct sdebug_dev_info * devip;
 
 	if (SCSI_DEBUG_OPT_NOISE & scsi_debug_opts)
 		printk(KERN_INFO "scsi_debug: slave_configure <%u %u %u %u>\n",
@@ -936,14 +946,14 @@ static int scsi_debug_slave_configure(struct scsi_device * sdp)
 	devip = devInfoReg(sdp);
 	sdp->hostdata = devip;
 	if (sdp->host->cmd_per_lun)
-		scsi_adjust_queue_depth(sdp, SDEBUG_TAGGED_QUEUING, 
+		scsi_adjust_queue_depth(sdp, SDEBUG_TAGGED_QUEUING,
 					sdp->host->cmd_per_lun);
 	return 0;
 }
 
 static void scsi_debug_slave_destroy(struct scsi_device * sdp)
 {
-	struct sdebug_dev_info * devip = 
+	struct sdebug_dev_info * devip =
 				(struct sdebug_dev_info *)sdp->hostdata;
 
 	if (SCSI_DEBUG_OPT_NOISE & scsi_debug_opts)
@@ -980,6 +990,18 @@ static struct sdebug_dev_info * devInfoReg(struct scsi_device * sdev)
 				open_devip = devip;
 		}
 	}
+	if (NULL == open_devip) { /* try and make a new one */
+		open_devip = kmalloc(sizeof(*open_devip),GFP_KERNEL);
+		if (NULL == open_devip) {
+			printk(KERN_ERR "%s: out of memory at line %d\n",
+				__FUNCTION__, __LINE__);
+			return NULL;
+		}
+		memset(open_devip, 0, sizeof(*open_devip));
+		open_devip->sdbg_host = sdbg_host;
+		list_add_tail(&open_devip->dev_list,
+		&sdbg_host->dev_info_list);
+	}
         if (open_devip) {
 		open_devip->channel = sdev->channel;
 		open_devip->target = sdev->id;
@@ -994,7 +1016,7 @@ static struct sdebug_dev_info * devInfoReg(struct scsi_device * sdev)
         return NULL;
 }
 
-static void mk_sense_buffer(struct sdebug_dev_info * devip, int key, 
+static void mk_sense_buffer(struct sdebug_dev_info * devip, int key,
 			    int asc, int asq, int inbandLen)
 {
 	unsigned char * sbuff;
@@ -1029,7 +1051,7 @@ static int scsi_debug_biosparam(struct scsi_device *sdev,
 		printk(KERN_INFO "scsi_debug: biosparam\n");
 	buf = scsi_bios_ptable(bdev);
 	if (buf) {
-		res = scsi_partsize(buf, capacity, 
+		res = scsi_partsize(buf, capacity,
 				    &info[2], &info[0], &info[1]);
 		kfree(buf);
 		if (! res)
@@ -1138,7 +1160,7 @@ static void stop_all_queued(void)
 }
 
 /* Initializes timers in queued array */
-static void init_all_queued(void)
+static void __init init_all_queued(void)
 {
 	unsigned long iflags;
 	int k;
@@ -1154,11 +1176,61 @@ static void init_all_queued(void)
 	spin_unlock_irqrestore(&queued_arr_lock, iflags);
 }
 
-static int schedule_resp(struct scsi_cmnd * cmnd, 
+static void __init sdebug_build_parts(unsigned char * ramp)
+{
+	struct partition * pp;
+	int starts[SDEBUG_MAX_PARTS + 2];
+	int sectors_per_part, num_sectors, k;
+	int heads_by_sects, start_sec, end_sec;
+
+	/* assume partition table already zeroed */
+	if ((scsi_debug_num_parts < 1) || (sdebug_store_size < 1048576))
+		return;
+	if (scsi_debug_num_parts > SDEBUG_MAX_PARTS) {
+		scsi_debug_num_parts = SDEBUG_MAX_PARTS;
+		printk(KERN_WARNING "scsi_debug:build_parts: reducing "
+				    "partitions to %d\n", SDEBUG_MAX_PARTS);
+	}
+	num_sectors = (int)(sdebug_store_size / SECT_SIZE);
+	sectors_per_part = (num_sectors - sdebug_sectors_per)
+			   / scsi_debug_num_parts;
+	heads_by_sects = sdebug_heads * sdebug_sectors_per;
+        starts[0] = sdebug_sectors_per;
+	for (k = 1; k < scsi_debug_num_parts; ++k)
+		starts[k] = ((k * sectors_per_part) / heads_by_sects)
+			    * heads_by_sects;
+	starts[scsi_debug_num_parts] = num_sectors;
+	starts[scsi_debug_num_parts + 1] = 0;
+
+	ramp[510] = 0x55;	/* magic partition markings */
+	ramp[511] = 0xAA;
+	pp = (struct partition *)(ramp + 0x1be);
+	for (k = 0; starts[k + 1]; ++k, ++pp) {
+		start_sec = starts[k];
+		end_sec = starts[k + 1] - 1;
+		pp->boot_ind = 0;
+
+		pp->cyl = start_sec / heads_by_sects;
+		pp->head = (start_sec - (pp->cyl * heads_by_sects))
+			   / sdebug_sectors_per;
+		pp->sector = (start_sec % sdebug_sectors_per) + 1;
+
+		pp->end_cyl = end_sec / heads_by_sects;
+		pp->end_head = (end_sec - (pp->end_cyl * heads_by_sects))
+			       / sdebug_sectors_per;
+		pp->end_sector = (end_sec % sdebug_sectors_per) + 1;
+
+		pp->start_sect = start_sec;
+		pp->nr_sects = end_sec - start_sec + 1;
+		pp->sys_ind = 0x83;	/* plain Linux partition */
+	}
+}
+
+static int schedule_resp(struct scsi_cmnd * cmnd,
 			 struct sdebug_dev_info * devip,
 			 done_funct_t done, int scsi_result, int delta_jiff)
 {
-	int k, num; 
+	int k, num;
 
 	if ((SCSI_DEBUG_OPT_NOISE & scsi_debug_opts) && cmnd) {
 		printk(KERN_INFO "scsi_debug: cmd ");
@@ -1176,7 +1248,7 @@ static int schedule_resp(struct scsi_cmnd * cmnd,
 	if (cmnd && devip) {
 		/* simulate autosense by this driver */
 		if (SAM_STAT_CHECK_CONDITION == (scsi_result & 0xff))
-			memcpy(cmnd->sense_buffer, devip->sense_buff, 
+			memcpy(cmnd->sense_buffer, devip->sense_buff,
 			       (SCSI_SENSE_BUFFERSIZE > SDEBUG_SENSE_LEN) ?
 			       SDEBUG_SENSE_LEN : SCSI_SENSE_BUFFERSIZE);
 	}
@@ -1219,38 +1291,43 @@ static int schedule_resp(struct scsi_cmnd * cmnd,
 
 /* Set 'perm' (4th argument) to 0 to disable module_param's definition
  * of sysfs parameters (which module_param doesn't yet support).
- * Sysfs parameters defined explicitly below. 
+ * Sysfs parameters defined explicitly below.
  */
-module_param_named(num_tgts, scsi_debug_num_tgts, int, 0);
-module_param_named(max_luns, scsi_debug_max_luns, int, 0);
-module_param_named(scsi_level, scsi_debug_scsi_level, int, 0);
+module_param_named(add_host, scsi_debug_add_host, int, 0); /* perm=0644 */
+module_param_named(delay, scsi_debug_delay, int, 0); /* perm=0644 */
 module_param_named(dev_size_mb, scsi_debug_dev_size_mb, int, 0);
-module_param_named(opts, scsi_debug_opts, int, 0); /* perm=0644 */
 module_param_named(every_nth, scsi_debug_every_nth, int, 0);
-module_param_named(delay, scsi_debug_delay, int, 0); /* perm=0644 */
-module_param_named(add_host, scsi_debug_add_host, int, 0); /* perm=0644 */
+module_param_named(max_luns, scsi_debug_max_luns, int, 0);
+module_param_named(num_parts, scsi_debug_num_parts, int, 0);
+module_param_named(num_tgts, scsi_debug_num_tgts, int, 0);
+module_param_named(opts, scsi_debug_opts, int, 0); /* perm=0644 */
+module_param_named(ptype, scsi_debug_ptype, int, 0);
+module_param_named(scsi_level, scsi_debug_scsi_level, int, 0);
 
 MODULE_AUTHOR("Eric Youngdale + Douglas Gilbert");
 MODULE_DESCRIPTION("SCSI debug adapter driver");
 MODULE_LICENSE("GPL");
+MODULE_VERSION(SCSI_DEBUG_VERSION);
 
-MODULE_PARM_DESC(num_tgts, "number of SCSI targets per host to simulate");
-MODULE_PARM_DESC(max_luns, "number of SCSI LUNs per target to simulate");
-MODULE_PARM_DESC(scsi_level, "SCSI level to simulate");
+MODULE_PARM_DESC(add_host, "0..127 hosts allowed(def=1)");
+MODULE_PARM_DESC(delay, "# of jiffies to delay response(def=1)");
 MODULE_PARM_DESC(dev_size_mb, "size in MB of ram shared by devs");
-MODULE_PARM_DESC(opts, "1->noise, 2->medium_error, 4->...");
 MODULE_PARM_DESC(every_nth, "timeout every nth command(def=100)");
-MODULE_PARM_DESC(delay, "# of jiffies to delay response(def=1)");
-MODULE_PARM_DESC(add_host, "0..127 hosts allowed(def=1)");
+MODULE_PARM_DESC(max_luns, "number of SCSI LUNs per target to simulate");
+MODULE_PARM_DESC(num_parts, "number of partitions(def=0)");
+MODULE_PARM_DESC(num_tgts, "number of SCSI targets per host to simulate");
+MODULE_PARM_DESC(opts, "1->noise, 2->medium_error, 4->...");
+MODULE_PARM_DESC(ptype, "SCSI peripheral type(def=0[disk])");
+MODULE_PARM_DESC(scsi_level, "SCSI level to simulate");
 
 
 static char sdebug_info[256];
 
 static const char * scsi_debug_info(struct Scsi_Host * shp)
 {
-	sprintf(sdebug_info, "scsi_debug, %s, num_tgts=%d, "
-		"dev_size_mb=%d, opts=0x%x", scsi_debug_version_str,
-		scsi_debug_num_tgts, scsi_debug_dev_size_mb,
+	sprintf(sdebug_info, "scsi_debug, version %s [%s], "
+		"dev_size_mb=%d, opts=0x%x", SCSI_DEBUG_VERSION,
+		scsi_debug_version_date, scsi_debug_dev_size_mb,
 		scsi_debug_opts);
 	return sdebug_info;
 }
@@ -1282,14 +1359,15 @@ static int scsi_debug_proc_info(struct Scsi_Host *host, char *buffer, char **sta
 		return length;
 	}
 	begin = 0;
-	pos = len = sprintf(buffer, "scsi_debug adapter driver, %s\n"
+	pos = len = sprintf(buffer, "scsi_debug adapter driver, version "
+	    "%s [%s]\n"
 	    "num_tgts=%d, shared (ram) size=%d MB, opts=0x%x, "
 	    "every_nth=%d(curr:%d)\n"
 	    "delay=%d, max_luns=%d, scsi_level=%d\n"
 	    "sector_size=%d bytes, cylinders=%d, heads=%d, sectors=%d\n"
-	    "number of aborts=%d, device_reset=%d, bus_resets=%d, " 
+	    "number of aborts=%d, device_reset=%d, bus_resets=%d, "
 	    "host_resets=%d\n",
-	    scsi_debug_version_str, scsi_debug_num_tgts, 
+	    SCSI_DEBUG_VERSION, scsi_debug_version_date, scsi_debug_num_tgts,
 	    scsi_debug_dev_size_mb, scsi_debug_opts, scsi_debug_every_nth,
 	    scsi_debug_cmnd_count, scsi_debug_delay,
 	    scsi_debug_max_luns, scsi_debug_scsi_level,
@@ -1306,12 +1384,12 @@ static int scsi_debug_proc_info(struct Scsi_Host *host, char *buffer, char **sta
 	return len;
 }
 
-static ssize_t sdebug_delay_show(struct device_driver * ddp, char * buf) 
+static ssize_t sdebug_delay_show(struct device_driver * ddp, char * buf)
 {
         return scnprintf(buf, PAGE_SIZE, "%d\n", scsi_debug_delay);
 }
 
-static ssize_t sdebug_delay_store(struct device_driver * ddp, 
+static ssize_t sdebug_delay_store(struct device_driver * ddp,
 				  const char * buf, size_t count)
 {
         int delay;
@@ -1325,15 +1403,15 @@ static ssize_t sdebug_delay_store(struct device_driver * ddp,
 	}
 	return -EINVAL;
 }
-DRIVER_ATTR(delay, S_IRUGO | S_IWUSR, sdebug_delay_show, 
-	    sdebug_delay_store)
+DRIVER_ATTR(delay, S_IRUGO | S_IWUSR, sdebug_delay_show,
+	    sdebug_delay_store);
 
-static ssize_t sdebug_opts_show(struct device_driver * ddp, char * buf) 
+static ssize_t sdebug_opts_show(struct device_driver * ddp, char * buf)
 {
         return scnprintf(buf, PAGE_SIZE, "0x%x\n", scsi_debug_opts);
 }
 
-static ssize_t sdebug_opts_store(struct device_driver * ddp, 
+static ssize_t sdebug_opts_store(struct device_driver * ddp,
 				 const char * buf, size_t count)
 {
         int opts;
@@ -1354,38 +1432,62 @@ opts_done:
 	scsi_debug_cmnd_count = 0;
 	return count;
 }
-DRIVER_ATTR(opts, S_IRUGO | S_IWUSR, sdebug_opts_show, 
-	    sdebug_opts_store)
+DRIVER_ATTR(opts, S_IRUGO | S_IWUSR, sdebug_opts_show,
+	    sdebug_opts_store);
+
+static ssize_t sdebug_ptype_show(struct device_driver * ddp, char * buf)
+{
+        return scnprintf(buf, PAGE_SIZE, "%d\n", scsi_debug_ptype);
+}
+static ssize_t sdebug_ptype_store(struct device_driver * ddp,
+				  const char * buf, size_t count)
+{
+        int n;
+
+	if ((count > 0) && (1 == sscanf(buf, "%d", &n)) && (n >= 0)) {
+		scsi_debug_ptype = n;
+		return count;
+	}
+	return -EINVAL;
+}
+DRIVER_ATTR(ptype, S_IRUGO | S_IWUSR, sdebug_ptype_show, sdebug_ptype_store);
 
-static ssize_t sdebug_num_tgts_show(struct device_driver * ddp, char * buf) 
+static ssize_t sdebug_num_tgts_show(struct device_driver * ddp, char * buf)
 {
         return scnprintf(buf, PAGE_SIZE, "%d\n", scsi_debug_num_tgts);
 }
-static ssize_t sdebug_num_tgts_store(struct device_driver * ddp, 
+static ssize_t sdebug_num_tgts_store(struct device_driver * ddp,
 				     const char * buf, size_t count)
 {
         int n;
 
 	if ((count > 0) && (1 == sscanf(buf, "%d", &n)) && (n >= 0)) {
 		scsi_debug_num_tgts = n;
+		sdebug_max_tgts_luns();
 		return count;
 	}
 	return -EINVAL;
 }
-DRIVER_ATTR(num_tgts, S_IRUGO | S_IWUSR, sdebug_num_tgts_show, 
-	    sdebug_num_tgts_store) 
+DRIVER_ATTR(num_tgts, S_IRUGO | S_IWUSR, sdebug_num_tgts_show,
+	    sdebug_num_tgts_store);
 
-static ssize_t sdebug_dev_size_mb_show(struct device_driver * ddp, char * buf) 
+static ssize_t sdebug_dev_size_mb_show(struct device_driver * ddp, char * buf)
 {
         return scnprintf(buf, PAGE_SIZE, "%d\n", scsi_debug_dev_size_mb);
 }
-DRIVER_ATTR(dev_size_mb, S_IRUGO, sdebug_dev_size_mb_show, NULL) 
+DRIVER_ATTR(dev_size_mb, S_IRUGO, sdebug_dev_size_mb_show, NULL);
+
+static ssize_t sdebug_num_parts_show(struct device_driver * ddp, char * buf)
+{
+        return scnprintf(buf, PAGE_SIZE, "%d\n", scsi_debug_num_parts);
+}
+DRIVER_ATTR(num_parts, S_IRUGO, sdebug_num_parts_show, NULL);
 
-static ssize_t sdebug_every_nth_show(struct device_driver * ddp, char * buf) 
+static ssize_t sdebug_every_nth_show(struct device_driver * ddp, char * buf)
 {
         return scnprintf(buf, PAGE_SIZE, "%d\n", scsi_debug_every_nth);
 }
-static ssize_t sdebug_every_nth_store(struct device_driver * ddp, 
+static ssize_t sdebug_every_nth_store(struct device_driver * ddp,
 				      const char * buf, size_t count)
 {
         int nth;
@@ -1398,38 +1500,39 @@ static ssize_t sdebug_every_nth_store(struct device_driver * ddp,
 	return -EINVAL;
 }
 DRIVER_ATTR(every_nth, S_IRUGO | S_IWUSR, sdebug_every_nth_show,
-	    sdebug_every_nth_store) 
+	    sdebug_every_nth_store);
 
-static ssize_t sdebug_max_luns_show(struct device_driver * ddp, char * buf) 
+static ssize_t sdebug_max_luns_show(struct device_driver * ddp, char * buf)
 {
         return scnprintf(buf, PAGE_SIZE, "%d\n", scsi_debug_max_luns);
 }
-static ssize_t sdebug_max_luns_store(struct device_driver * ddp, 
+static ssize_t sdebug_max_luns_store(struct device_driver * ddp,
 				     const char * buf, size_t count)
 {
         int n;
 
 	if ((count > 0) && (1 == sscanf(buf, "%d", &n)) && (n >= 0)) {
 		scsi_debug_max_luns = n;
+		sdebug_max_tgts_luns();
 		return count;
 	}
 	return -EINVAL;
 }
-DRIVER_ATTR(max_luns, S_IRUGO | S_IWUSR, sdebug_max_luns_show, 
-	    sdebug_max_luns_store) 
+DRIVER_ATTR(max_luns, S_IRUGO | S_IWUSR, sdebug_max_luns_show,
+	    sdebug_max_luns_store);
 
-static ssize_t sdebug_scsi_level_show(struct device_driver * ddp, char * buf) 
+static ssize_t sdebug_scsi_level_show(struct device_driver * ddp, char * buf)
 {
         return scnprintf(buf, PAGE_SIZE, "%d\n", scsi_debug_scsi_level);
 }
-DRIVER_ATTR(scsi_level, S_IRUGO, sdebug_scsi_level_show, NULL) 
+DRIVER_ATTR(scsi_level, S_IRUGO, sdebug_scsi_level_show, NULL);
 
-static ssize_t sdebug_add_host_show(struct device_driver * ddp, char * buf) 
+static ssize_t sdebug_add_host_show(struct device_driver * ddp, char * buf)
 {
         return scnprintf(buf, PAGE_SIZE, "%d\n", scsi_debug_add_host);
 }
 
-static ssize_t sdebug_add_host_store(struct device_driver * ddp, 
+static ssize_t sdebug_add_host_store(struct device_driver * ddp,
 				     const char * buf, size_t count)
 {
         int delta_hosts;
@@ -1459,30 +1562,34 @@ static ssize_t sdebug_add_host_store(struct device_driver * ddp,
 	return count;
 }
 DRIVER_ATTR(add_host, S_IRUGO | S_IWUSR, sdebug_add_host_show, 
-	    sdebug_add_host_store)
+	    sdebug_add_host_store);
 
 static void do_create_driverfs_files(void)
 {
+	driver_create_file(&sdebug_driverfs_driver, &driver_attr_add_host);
 	driver_create_file(&sdebug_driverfs_driver, &driver_attr_delay);
-	driver_create_file(&sdebug_driverfs_driver, &driver_attr_opts);
-	driver_create_file(&sdebug_driverfs_driver, &driver_attr_num_tgts);
 	driver_create_file(&sdebug_driverfs_driver, &driver_attr_dev_size_mb);
 	driver_create_file(&sdebug_driverfs_driver, &driver_attr_every_nth);
 	driver_create_file(&sdebug_driverfs_driver, &driver_attr_max_luns);
+	driver_create_file(&sdebug_driverfs_driver, &driver_attr_num_tgts);
+	driver_create_file(&sdebug_driverfs_driver, &driver_attr_num_parts);
+	driver_create_file(&sdebug_driverfs_driver, &driver_attr_ptype);
+	driver_create_file(&sdebug_driverfs_driver, &driver_attr_opts);
 	driver_create_file(&sdebug_driverfs_driver, &driver_attr_scsi_level);
-	driver_create_file(&sdebug_driverfs_driver, &driver_attr_add_host);
 }
 
 static void do_remove_driverfs_files(void)
 {
-	driver_remove_file(&sdebug_driverfs_driver, &driver_attr_add_host);
 	driver_remove_file(&sdebug_driverfs_driver, &driver_attr_scsi_level);
+	driver_remove_file(&sdebug_driverfs_driver, &driver_attr_opts);
+	driver_remove_file(&sdebug_driverfs_driver, &driver_attr_ptype);
+	driver_remove_file(&sdebug_driverfs_driver, &driver_attr_num_parts);
+	driver_remove_file(&sdebug_driverfs_driver, &driver_attr_num_tgts);
 	driver_remove_file(&sdebug_driverfs_driver, &driver_attr_max_luns);
 	driver_remove_file(&sdebug_driverfs_driver, &driver_attr_every_nth);
 	driver_remove_file(&sdebug_driverfs_driver, &driver_attr_dev_size_mb);
-	driver_remove_file(&sdebug_driverfs_driver, &driver_attr_num_tgts);
-	driver_remove_file(&sdebug_driverfs_driver, &driver_attr_opts);
 	driver_remove_file(&sdebug_driverfs_driver, &driver_attr_delay);
+	driver_remove_file(&sdebug_driverfs_driver, &driver_attr_add_host);
 }
 
 static int __init scsi_debug_init(void)
@@ -1491,23 +1598,25 @@ static int __init scsi_debug_init(void)
 	int host_to_add;
 	int k;
 
+	if (scsi_debug_dev_size_mb < 1)
+		scsi_debug_dev_size_mb = 1;  /* force minimum 1 MB ramdisk */
 	sdebug_store_size = (unsigned long)scsi_debug_dev_size_mb * 1048576;
 	sdebug_capacity = sdebug_store_size / SECT_SIZE;
 
 	/* play around with geometry, don't waste too much on track 0 */
 	sdebug_heads = 8;
 	sdebug_sectors_per = 32;
-	if (scsi_debug_dev_size_mb >= 16) 
+	if (scsi_debug_dev_size_mb >= 16)
 		sdebug_heads = 32;
 	else if (scsi_debug_dev_size_mb >= 256)
 		sdebug_heads = 64;
-	sdebug_cylinders_per = (unsigned long)sdebug_capacity / 
+	sdebug_cylinders_per = (unsigned long)sdebug_capacity /
 			       (sdebug_sectors_per * sdebug_heads);
-	if (sdebug_cylinders_per >= 1024) { 
+	if (sdebug_cylinders_per >= 1024) {
 		/* other LLDs do this; implies >= 1GB ram disk ... */
 		sdebug_heads = 255;
 		sdebug_sectors_per = 63;
-		sdebug_cylinders_per = (unsigned long)sdebug_capacity / 
+		sdebug_cylinders_per = (unsigned long)sdebug_capacity /
 			       (sdebug_sectors_per * sdebug_heads);
 	}
 
@@ -1518,6 +1627,8 @@ static int __init scsi_debug_init(void)
 		return -ENOMEM;
 	}
 	memset(fake_storep, 0, sz);
+	if (scsi_debug_num_parts > 0)
+		sdebug_build_parts(fake_storep);
 
 	init_all_queued();
 
@@ -1575,7 +1686,7 @@ static struct device pseudo_primary = {
 	.release	= pseudo_0_release,
 };
 
-static int pseudo_lld_bus_match(struct device *dev, 
+static int pseudo_lld_bus_match(struct device *dev,
                           struct device_driver *dev_driver)
 {
         return 1;
@@ -1737,3 +1848,21 @@ static int sdebug_driver_remove(struct device * dev)
         scsi_host_put(sdbg_host->shost);
         return 0;
 }
+
+static void sdebug_max_tgts_luns(void)
+{
+	struct sdebug_host_info * sdbg_host;
+	struct Scsi_Host *hpnt;
+
+	spin_lock(&sdebug_host_list_lock);
+	list_for_each_entry(sdbg_host, &sdebug_host_list, host_list) {
+		hpnt = sdbg_host->shost;
+		if ((hpnt->this_id >= 0) &&
+		    (scsi_debug_num_tgts > hpnt->this_id))
+			hpnt->max_id = scsi_debug_num_tgts + 1;
+		else
+			hpnt->max_id = scsi_debug_num_tgts;
+		hpnt->max_lun = scsi_debug_max_luns;
+	}
+	spin_unlock(&sdebug_host_list_lock);
+}
diff --git a/drivers/scsi/scsi_debug.h b/drivers/scsi/scsi_debug.h
index 58f98af39..965dd5e76 100644
--- a/drivers/scsi/scsi_debug.h
+++ b/drivers/scsi/scsi_debug.h
@@ -5,9 +5,9 @@
 static int scsi_debug_slave_alloc(struct scsi_device *);
 static int scsi_debug_slave_configure(struct scsi_device *);
 static void scsi_debug_slave_destroy(struct scsi_device *);
-static int scsi_debug_queuecommand(struct scsi_cmnd *, 
+static int scsi_debug_queuecommand(struct scsi_cmnd *,
 				   void (*done) (struct scsi_cmnd *));
-static int scsi_debug_ioctl(struct scsi_device *, int, void *);
+static int scsi_debug_ioctl(struct scsi_device *, int, void __user *);
 static int scsi_debug_biosparam(struct scsi_device *, struct block_device *,
 		sector_t, int[]);
 static int scsi_debug_abort(struct scsi_cmnd *);
@@ -17,9 +17,6 @@ static int scsi_debug_host_reset(struct scsi_cmnd *);
 static int scsi_debug_proc_info(struct Scsi_Host *, char *, char **, off_t, int, int);
 static const char * scsi_debug_info(struct Scsi_Host *);
 
-/*
- * This driver is written for the lk 2.5 series
- */
 #define SCSI_DEBUG_CANQUEUE  255 	/* needs to be >= 1 */
 
 #define SCSI_DEBUG_MAX_CMD_LEN 16
diff --git a/drivers/scsi/scsi_devinfo.c b/drivers/scsi/scsi_devinfo.c
index cb97efc6c..0153b7747 100644
--- a/drivers/scsi/scsi_devinfo.c
+++ b/drivers/scsi/scsi_devinfo.c
@@ -6,12 +6,13 @@
 #include <linux/moduleparam.h>
 #include <linux/proc_fs.h>
 #include <linux/seq_file.h>
+
+#include <scsi/scsi_device.h>
 #include <scsi/scsi_devinfo.h>
 
-#include "scsi.h"
-#include "hosts.h"
 #include "scsi_priv.h"
 
+
 /*
  * scsi_dev_info_list: structure to hold black/white listed devices.
  */
@@ -27,7 +28,7 @@ struct scsi_dev_info_list {
 static const char spaces[] = "                "; /* 16 of them */
 static unsigned scsi_default_dev_flags;
 static LIST_HEAD(scsi_dev_info_list);
-static __init char scsi_dev_flags[256];
+static __initdata char scsi_dev_flags[256];
 
 /*
  * scsi_static_device_list: deprecated list of devices that require
@@ -117,8 +118,10 @@ static struct {
 	 */
 	{"ADAPTEC", "AACRAID", NULL, BLIST_FORCELUN},
 	{"ADAPTEC", "Adaptec 5400S", NULL, BLIST_FORCELUN},
-	{"BELKIN", "USB 2 HS-CF", "1.95",  BLIST_SPARSELUN},
+	{"AFT PRO", "-IX CF", "0.0>", BLIST_FORCELUN},
+	{"BELKIN", "USB 2 HS-CF", "1.95",  BLIST_FORCELUN},
 	{"CANON", "IPUBJD", NULL, BLIST_SPARSELUN},
+	{"CBOX3", "USB Storage-SMC", "300A", BLIST_FORCELUN},
 	{"CMD", "CRA-7280", NULL, BLIST_SPARSELUN},	/* CMD RAID Controller */
 	{"CNSI", "G7324", NULL, BLIST_SPARSELUN},	/* Chaparral G7324 RAID */
 	{"CNSi", "G8324", NULL, BLIST_SPARSELUN},	/* Chaparral G8324 RAID */
@@ -126,7 +129,7 @@ static struct {
 	{"COMPAQ", "CR3500", NULL, BLIST_FORCELUN},
 	{"COMPAQ", "MSA1000", NULL, BLIST_SPARSELUN | BLIST_NOSTARTONADD},
 	{"COMPAQ", "MSA1000 VOLUME", NULL, BLIST_SPARSELUN | BLIST_NOSTARTONADD},
-	{"COMPAQ", "HSV110", NULL, BLIST_SPARSELUN | BLIST_NOSTARTONADD},
+	{"COMPAQ", "HSV110", NULL, BLIST_REPORTLUN2 | BLIST_NOSTARTONADD},
 	{"DDN", "SAN DataDirector", "*", BLIST_SPARSELUN},
 	{"DEC", "HSG80", NULL, BLIST_SPARSELUN | BLIST_NOSTARTONADD},
 	{"DELL", "PV660F", NULL, BLIST_SPARSELUN},
@@ -139,6 +142,7 @@ static struct {
 	{"EMC", "SYMMETRIX", NULL, BLIST_SPARSELUN | BLIST_LARGELUN | BLIST_FORCELUN},
 	{"EMULEX", "MD21/S2     ESDI", NULL, BLIST_SINGLELUN},
 	{"FSC", "CentricStor", "*", BLIST_SPARSELUN | BLIST_LARGELUN},
+	{"Generic", "USB SD Reader", "1.00", BLIST_FORCELUN},
 	{"Generic", "USB Storage-SMC", "0180", BLIST_FORCELUN},
 	{"Generic", "USB Storage-SMC", "0207", BLIST_FORCELUN},
 	{"HITACHI", "DF400", "*", BLIST_SPARSELUN},
@@ -147,7 +151,7 @@ static struct {
 	{"HP", "A6189A", NULL, BLIST_SPARSELUN | BLIST_LARGELUN},	/* HP VA7400 */
 	{"HP", "OPEN-", "*", BLIST_SPARSELUN | BLIST_LARGELUN}, /* HP XP Arrays */
 	{"HP", "NetRAID-4M", NULL, BLIST_FORCELUN},
-	{"HP", "HSV100", NULL, BLIST_SPARSELUN | BLIST_NOSTARTONADD},
+	{"HP", "HSV100", NULL, BLIST_REPORTLUN2 | BLIST_NOSTARTONADD},
 	{"HP", "C1557A", NULL, BLIST_FORCELUN},
 	{"IBM", "AuSaV1S2", NULL, BLIST_FORCELUN},
 	{"IBM", "ProFibre 4000R", "*", BLIST_SPARSELUN | BLIST_LARGELUN},
@@ -155,12 +159,15 @@ static struct {
 	{"IOMEGA", "Io20S         *F", NULL, BLIST_KEY},
 	{"INSITE", "Floptical   F*8I", NULL, BLIST_KEY},
 	{"INSITE", "I325VM", NULL, BLIST_KEY},
+	{"iRiver", "iFP Mass Driver", NULL, BLIST_NOT_LOCKABLE | BLIST_INQUIRY_36},
 	{"LASOUND", "CDX7405", "3.10", BLIST_MAX5LUN | BLIST_SINGLELUN},
 	{"MATSHITA", "PD-1", NULL, BLIST_FORCELUN | BLIST_SINGLELUN},
+	{"MATSHITA", "DMC-LC5", NULL, BLIST_NOT_LOCKABLE | BLIST_INQUIRY_36},
+	{"MATSHITA", "DMC-LC40", NULL, BLIST_NOT_LOCKABLE | BLIST_INQUIRY_36},
 	{"Medion", "Flash XL  MMC/SD", "2.6D", BLIST_FORCELUN},
 	{"MegaRAID", "LD", NULL, BLIST_FORCELUN},
 	{"MICROP", "4110", NULL, BLIST_NOTQ},
-	{"MYLEX", "DACARMRB", "*", BLIST_SPARSELUN | BLIST_LARGELUN},
+	{"MYLEX", "DACARMRB", "*", BLIST_REPORTLUN2},
 	{"nCipher", "Fastness Crypto", NULL, BLIST_FORCELUN},
 	{"NAKAMICH", "MJ-4.8S", NULL, BLIST_FORCELUN | BLIST_SINGLELUN},
 	{"NAKAMICH", "MJ-5.16S", NULL, BLIST_FORCELUN | BLIST_SINGLELUN},
@@ -171,9 +178,10 @@ static struct {
 	{"PIONEER", "CD-ROM DRM-602X", NULL, BLIST_FORCELUN | BLIST_SINGLELUN},
 	{"PIONEER", "CD-ROM DRM-604X", NULL, BLIST_FORCELUN | BLIST_SINGLELUN},
 	{"REGAL", "CDC-4X", NULL, BLIST_MAX5LUN | BLIST_SINGLELUN},
+	{"SanDisk", "ImageMate CF-SD1", NULL, BLIST_FORCELUN},
 	{"SGI", "RAID3", "*", BLIST_SPARSELUN},
 	{"SGI", "RAID5", "*", BLIST_SPARSELUN},
-	{"SGI", "TP9100", "*", BLIST_SPARSELUN | BLIST_LARGELUN},
+	{"SGI", "TP9100", "*", BLIST_REPORTLUN2},
 	{"SMSC", "USB 2 HS-CF", NULL, BLIST_SPARSELUN},
 	{"SONY", "CD-ROM CDU-8001", NULL, BLIST_BORKEN},
 	{"SONY", "TSL", NULL, BLIST_FORCELUN},		/* DDS3 & DDS4 autoloaders */
@@ -182,6 +190,7 @@ static struct {
 	{"TEXEL", "CD-ROM", "1.06", BLIST_BORKEN},
 	{"TOSHIBA", "CDROM", NULL, BLIST_ISROM},
 	{"TOSHIBA", "CD-ROM", NULL, BLIST_ISROM},
+	{"USB2.0", "SMARTMEDIA/XD", NULL, BLIST_FORCELUN},
 	{"XYRATEX", "RS", "*", BLIST_SPARSELUN | BLIST_LARGELUN},
 	{"Zzyzx", "RocketStor 500S", NULL, BLIST_SPARSELUN},
 	{"Zzyzx", "RocketStor 2000", NULL, BLIST_SPARSELUN},
@@ -483,7 +492,7 @@ void scsi_exit_devinfo(void)
 	struct scsi_dev_info_list *devinfo;
 
 #ifdef CONFIG_SCSI_PROC_FS
-	remove_proc_entry("scsi/device_info", 0);
+	remove_proc_entry("scsi/device_info", NULL);
 #endif
 
 	list_for_each_safe(lh, lh_next, &scsi_dev_info_list) {
diff --git a/drivers/scsi/scsi_error.c b/drivers/scsi/scsi_error.c
index 58ac2319a..288f2fde9 100644
--- a/drivers/scsi/scsi_error.c
+++ b/drivers/scsi/scsi_error.c
@@ -23,28 +23,27 @@
 #include <linux/interrupt.h>
 #include <linux/blkdev.h>
 #include <linux/smp_lock.h>
-#include <scsi/scsi_ioctl.h>
 
-#include "scsi.h"
-#include "hosts.h"
+#include <scsi/scsi.h>
+#include <scsi/scsi_dbg.h>
+#include <scsi/scsi_device.h>
+#include <scsi/scsi_eh.h>
+#include <scsi/scsi_host.h>
+#include <scsi/scsi_ioctl.h>
+#include <scsi/scsi_request.h>
 
 #include "scsi_priv.h"
 #include "scsi_logging.h"
 
-#ifdef DEBUG
-#define SENSE_TIMEOUT SCSI_TIMEOUT
-#else
-#define SENSE_TIMEOUT (10*HZ)
-#endif
-
-#define START_UNIT_TIMEOUT (30*HZ)
+#define SENSE_TIMEOUT		(10*HZ)
+#define START_UNIT_TIMEOUT	(30*HZ)
 
 /*
  * These should *probably* be handled by the host itself.
  * Since it is allowed to sleep, it probably should.
  */
-#define BUS_RESET_SETTLE_TIME   10*HZ
-#define HOST_RESET_SETTLE_TIME  10*HZ
+#define BUS_RESET_SETTLE_TIME   (10*HZ)
+#define HOST_RESET_SETTLE_TIME  (10*HZ)
 
 /* called with shost->host_lock held */
 void scsi_eh_wakeup(struct Scsi_Host *shost)
@@ -167,6 +166,24 @@ int scsi_delete_timer(struct scsi_cmnd *scmd)
 void scsi_times_out(struct scsi_cmnd *scmd)
 {
 	scsi_log_completion(scmd, TIMEOUT_ERROR);
+
+	if (scmd->device->host->hostt->eh_timed_out)
+		switch (scmd->device->host->hostt->eh_timed_out(scmd)) {
+		case EH_HANDLED:
+			__scsi_done(scmd);
+			return;
+		case EH_RESET_TIMER:
+			/* This allows a single retry even of a command
+			 * with allowed == 0 */
+			if (scmd->retries++ > scmd->allowed)
+				break;
+			scsi_add_timer(scmd, scmd->timeout_per_command,
+				       scsi_times_out);
+			return;
+		case EH_NOT_HANDLED:
+			break;
+		}
+
 	if (unlikely(!scsi_eh_scmd_add(scmd, SCSI_EH_CANCEL_CMD))) {
 		panic("Error handler thread not present at %p %p %s %d",
 		      scmd, scmd->device->host, __FILE__, __LINE__);
@@ -660,7 +677,7 @@ static int scsi_eh_get_sense(struct list_head *work_q,
 		SCSI_LOG_ERROR_RECOVERY(3, printk("sense requested for %p"
 						  " result %x\n", scmd,
 						  scmd->result));
-		SCSI_LOG_ERROR_RECOVERY(3, print_sense("bh", scmd));
+		SCSI_LOG_ERROR_RECOVERY(3, scsi_print_sense("bh", scmd));
 
 		rtn = scsi_decide_disposition(scmd);
 
@@ -1026,7 +1043,8 @@ static int scsi_try_bus_reset(struct scsi_cmnd *scmd)
 	spin_unlock_irqrestore(scmd->device->host->host_lock, flags);
 
 	if (rtn == SUCCESS) {
-		scsi_sleep(BUS_RESET_SETTLE_TIME);
+		if (!scmd->device->host->hostt->skip_settle_delay)
+			scsi_sleep(BUS_RESET_SETTLE_TIME);
 		spin_lock_irqsave(scmd->device->host->host_lock, flags);
 		scsi_report_bus_reset(scmd->device->host, scmd->device->channel);
 		spin_unlock_irqrestore(scmd->device->host->host_lock, flags);
@@ -1057,7 +1075,8 @@ static int scsi_try_host_reset(struct scsi_cmnd *scmd)
 	spin_unlock_irqrestore(scmd->device->host->host_lock, flags);
 
 	if (rtn == SUCCESS) {
-		scsi_sleep(HOST_RESET_SETTLE_TIME);
+		if (!scmd->device->host->hostt->skip_settle_delay)
+			scsi_sleep(HOST_RESET_SETTLE_TIME);
 		spin_lock_irqsave(scmd->device->host->host_lock, flags);
 		scsi_report_bus_reset(scmd->device->host, scmd->device->channel);
 		spin_unlock_irqrestore(scmd->device->host->host_lock, flags);
diff --git a/drivers/scsi/scsi_ioctl.c b/drivers/scsi/scsi_ioctl.c
index 03390c078..bc5869b10 100644
--- a/drivers/scsi/scsi_ioctl.c
+++ b/drivers/scsi/scsi_ioctl.c
@@ -5,23 +5,21 @@
  *   for the ones that remain
  */
 #include <linux/module.h>
-
-#include <asm/io.h>
-#include <asm/uaccess.h>
-#include <asm/system.h>
-#include <asm/page.h>
-
+#include <linux/blkdev.h>
 #include <linux/interrupt.h>
 #include <linux/errno.h>
 #include <linux/kernel.h>
 #include <linux/sched.h>
 #include <linux/mm.h>
 #include <linux/string.h>
+#include <asm/uaccess.h>
 
-#include <linux/blkdev.h>
-#include "scsi.h"
-#include "hosts.h"
+#include <scsi/scsi.h>
+#include <scsi/scsi_device.h>
+#include <scsi/scsi_eh.h>
+#include <scsi/scsi_host.h>
 #include <scsi/scsi_ioctl.h>
+#include <scsi/scsi_request.h>
 
 #include "scsi_logging.h"
 
@@ -447,19 +445,3 @@ int scsi_ioctl(struct scsi_device *sdev, int cmd, void __user *arg)
 	}
 	return -EINVAL;
 }
-
-/*
- * Just like scsi_ioctl, only callable from kernel space with no 
- * fs segment fiddling.
- */
-
-int kernel_scsi_ioctl(struct scsi_device *sdev, int cmd, void *arg)
-{
-	mm_segment_t oldfs;
-	int tmp;
-	oldfs = get_fs();
-	set_fs(get_ds());
-	tmp = scsi_ioctl(sdev, cmd, arg);
-	set_fs(oldfs);
-	return tmp;
-}
diff --git a/drivers/scsi/scsi_lib.c b/drivers/scsi/scsi_lib.c
index f77d2e8c7..e30d3f2bf 100644
--- a/drivers/scsi/scsi_lib.c
+++ b/drivers/scsi/scsi_lib.c
@@ -16,9 +16,13 @@
 #include <linux/init.h>
 #include <linux/pci.h>
 
+#include <scsi/scsi.h>
+#include <scsi/scsi_dbg.h>
+#include <scsi/scsi_device.h>
 #include <scsi/scsi_driver.h>
+#include <scsi/scsi_eh.h>
 #include <scsi/scsi_host.h>
-#include "scsi.h"
+#include <scsi/scsi_request.h>
 
 #include "scsi_priv.h"
 #include "scsi_logging.h"
@@ -255,7 +259,6 @@ void scsi_wait_req(struct scsi_request *sreq, const void *cmnd, void *buffer,
 	sreq->sr_request->rq_status = RQ_SCSI_BUSY;
 	scsi_do_req(sreq, cmnd, buffer, bufflen, scsi_wait_done,
 			timeout, retries);
-	generic_unplug_device(sreq->sr_device->request_queue);
 	wait_for_completion(&wait);
 	sreq->sr_request->waiting = NULL;
 	if (sreq->sr_request->rq_status != RQ_SCSI_DONE)
@@ -838,8 +841,8 @@ void scsi_io_completion(struct scsi_cmnd *cmd, unsigned int good_bytes,
 			printk("scsi%d: ERROR on channel %d, id %d, lun %d, CDB: ",
 			       cmd->device->host->host_no, (int) cmd->device->channel,
 			       (int) cmd->device->id, (int) cmd->device->lun);
-			print_command(cmd->data_cmnd);
-			print_sense("", cmd);
+			__scsi_print_command(cmd->data_cmnd);
+			scsi_print_sense("", cmd);
 			cmd = scsi_end_request(cmd, 0, block_bytes, 1);
 			return;
 		default:
@@ -863,7 +866,7 @@ void scsi_io_completion(struct scsi_cmnd *cmd, unsigned int good_bytes,
 		       cmd->device->lun, result);
 
 		if (driver_byte(result) & DRIVER_SENSE)
-			print_sense("", cmd);
+			scsi_print_sense("", cmd);
 		/*
 		 * Mark a single buffer as not uptodate.  Queue the remainder.
 		 * We sometimes get this cruft in the event that a medium error
diff --git a/drivers/scsi/scsi_module.c b/drivers/scsi/scsi_module.c
index b8cc3ead9..d835a505b 100644
--- a/drivers/scsi/scsi_module.c
+++ b/drivers/scsi/scsi_module.c
@@ -12,7 +12,7 @@
 #include <linux/module.h>
 
 #include "scsi.h"
-#include "hosts.h"
+#include <scsi/scsi_host.h>
 
 
 static int __init init_this_scsi_driver(void)
diff --git a/drivers/scsi/scsi_priv.h b/drivers/scsi/scsi_priv.h
index 5b0fdc0c3..4dfb3db63 100644
--- a/drivers/scsi/scsi_priv.h
+++ b/drivers/scsi/scsi_priv.h
@@ -82,6 +82,7 @@ extern int scsi_insert_special_req(struct scsi_request *sreq, int);
 extern void scsi_init_cmd_from_req(struct scsi_cmnd *cmd,
 		struct scsi_request *sreq);
 extern void __scsi_release_request(struct scsi_request *sreq);
+extern void __scsi_done(struct scsi_cmnd *cmd);
 #ifdef CONFIG_SCSI_LOGGING
 void scsi_log_send(struct scsi_cmnd *cmd);
 void scsi_log_completion(struct scsi_cmnd *cmd, int disposition);
diff --git a/drivers/scsi/scsi_proc.c b/drivers/scsi/scsi_proc.c
index 00e160ac4..a50958b1b 100644
--- a/drivers/scsi/scsi_proc.c
+++ b/drivers/scsi/scsi_proc.c
@@ -27,8 +27,9 @@
 #include <linux/seq_file.h>
 #include <asm/uaccess.h>
 
+#include <scsi/scsi.h>
+#include <scsi/scsi_device.h>
 #include <scsi/scsi_host.h>
-#include "scsi.h"
 
 #include "scsi_priv.h"
 #include "scsi_logging.h"
@@ -311,7 +312,7 @@ int __init scsi_init_procfs(void)
 {
 	struct proc_dir_entry *pde;
 
-	proc_scsi = proc_mkdir("scsi", 0);
+	proc_scsi = proc_mkdir("scsi", NULL);
 	if (!proc_scsi)
 		goto err1;
 
@@ -323,13 +324,13 @@ int __init scsi_init_procfs(void)
 	return 0;
 
 err2:
-	remove_proc_entry("scsi", 0);
+	remove_proc_entry("scsi", NULL);
 err1:
 	return -ENOMEM;
 }
 
 void scsi_exit_procfs(void)
 {
-	remove_proc_entry("scsi/scsi", 0);
-	remove_proc_entry("scsi", 0);
+	remove_proc_entry("scsi/scsi", NULL);
+	remove_proc_entry("scsi", NULL);
 }
diff --git a/drivers/scsi/scsi_scan.c b/drivers/scsi/scsi_scan.c
index 699d274b6..166cb9ab3 100644
--- a/drivers/scsi/scsi_scan.c
+++ b/drivers/scsi/scsi_scan.c
@@ -32,11 +32,13 @@
 #include <linux/blkdev.h>
 #include <asm/semaphore.h>
 
+#include <scsi/scsi.h>
+#include <scsi/scsi_device.h>
 #include <scsi/scsi_driver.h>
 #include <scsi/scsi_devinfo.h>
 #include <scsi/scsi_host.h>
+#include <scsi/scsi_request.h>
 #include <scsi/scsi_transport.h>
-#include "scsi.h"
 
 #include "scsi_priv.h"
 #include "scsi_logging.h"
@@ -44,6 +46,11 @@
 #define ALLOC_FAILURE_MSG	KERN_ERR "%s: Allocation failure during" \
 	" SCSI scanning, some SCSI devices might not be configured\n"
 
+/*
+ * Default timeout
+ */
+#define SCSI_TIMEOUT (2*HZ)
+
 /*
  * Prefix values for the SCSI id's (stored in driverfs name field)
  */
@@ -656,6 +663,9 @@ static int scsi_add_lun(struct scsi_device *sdev, char *inq_result, int *bflags)
 	if (*bflags & BLIST_MS_192_BYTES_FOR_3F)
 		sdev->use_192_bytes_for_3f = 1;
 
+	if (*bflags & BLIST_NOT_LOCKABLE)
+		sdev->lockable = 0;
+
 	if(sdev->host->hostt->slave_configure)
 		sdev->host->hostt->slave_configure(sdev);
 
diff --git a/drivers/scsi/scsi_syms.c b/drivers/scsi/scsi_syms.c
index 48126e176..9da2db4ee 100644
--- a/drivers/scsi/scsi_syms.c
+++ b/drivers/scsi/scsi_syms.c
@@ -5,24 +5,15 @@
 #include <linux/config.h>
 #include <linux/module.h>
 
-#include <linux/sched.h>
-#include <linux/timer.h>
-#include <linux/string.h>
-#include <linux/slab.h>
-#include <linux/ioport.h>
-#include <linux/kernel.h>
-#include <linux/blkdev.h>
-#include <linux/fs.h>
-
-#include <asm/system.h>
-#include <asm/irq.h>
-#include <asm/dma.h>
-
+#include <scsi/scsi.h>
+#include <scsi/scsi_dbg.h>
+#include <scsi/scsi_device.h>
 #include <scsi/scsi_driver.h>
+#include <scsi/scsi_eh.h>
 #include <scsi/scsi_host.h>
 #include <scsi/scsi_ioctl.h>
+#include <scsi/scsi_request.h>
 #include <scsi/scsicam.h>
-#include "scsi.h"
 
 #include "scsi_logging.h"
 
@@ -46,15 +37,14 @@ EXPORT_SYMBOL(scsicam_bios_param);
 EXPORT_SYMBOL(scsi_partsize);
 EXPORT_SYMBOL(scsi_bios_ptable);
 EXPORT_SYMBOL(scsi_ioctl);
-EXPORT_SYMBOL(print_command);
-EXPORT_SYMBOL(print_sense);
-EXPORT_SYMBOL(print_req_sense);
-EXPORT_SYMBOL(print_msg);
-EXPORT_SYMBOL(print_status);
+EXPORT_SYMBOL(scsi_print_command);
+EXPORT_SYMBOL(__scsi_print_command);
+EXPORT_SYMBOL(scsi_print_sense);
+EXPORT_SYMBOL(scsi_print_req_sense);
+EXPORT_SYMBOL(scsi_print_msg);
+EXPORT_SYMBOL(scsi_print_status);
 EXPORT_SYMBOL(scsi_sense_key_string);
 EXPORT_SYMBOL(scsi_extd_sense_format);
-EXPORT_SYMBOL(kernel_scsi_ioctl);
-EXPORT_SYMBOL(print_Scsi_Cmnd);
 EXPORT_SYMBOL(scsi_block_when_processing_errors);
 EXPORT_SYMBOL(scsi_ioctl_send_command);
 EXPORT_SYMBOL(scsi_set_medium_removal);
diff --git a/drivers/scsi/scsi_sysfs.c b/drivers/scsi/scsi_sysfs.c
index fceb6f9a1..a8855d324 100644
--- a/drivers/scsi/scsi_sysfs.c
+++ b/drivers/scsi/scsi_sysfs.c
@@ -12,9 +12,10 @@
 #include <linux/blkdev.h>
 #include <linux/device.h>
 
+#include <scsi/scsi.h>
+#include <scsi/scsi_device.h>
 #include <scsi/scsi_host.h>
 #include <scsi/scsi_transport.h>
-#include "scsi.h"
 
 #include "scsi_priv.h"
 #include "scsi_logging.h"
@@ -99,7 +100,7 @@ show_##name (struct class_device *class_dev, char *buf)			\
  */
 #define shost_rd_attr2(name, field, format_string)			\
 	shost_show_function(name, field, format_string)			\
-static CLASS_DEVICE_ATTR(name, S_IRUGO, show_##name, NULL)
+static CLASS_DEVICE_ATTR(name, S_IRUGO, show_##name, NULL);
 
 #define shost_rd_attr(field, format_string) \
 shost_rd_attr2(field, field, format_string)
@@ -228,8 +229,8 @@ sdev_show_##field (struct device *dev, char *buf)				\
  * read only field.
  */
 #define sdev_rd_attr(field, format_string)				\
-	sdev_show_function(field, format_string)				\
-static DEVICE_ATTR(field, S_IRUGO, sdev_show_##field, NULL)
+	sdev_show_function(field, format_string)			\
+static DEVICE_ATTR(field, S_IRUGO, sdev_show_##field, NULL);
 
 
 /*
@@ -247,7 +248,7 @@ sdev_store_##field (struct device *dev, const char *buf, size_t count)	\
 	snscanf (buf, 20, format_string, &sdev->field);			\
 	return count;							\
 }									\
-static DEVICE_ATTR(field, S_IRUGO | S_IWUSR, sdev_show_##field, sdev_store_##field)
+static DEVICE_ATTR(field, S_IRUGO | S_IWUSR, sdev_show_##field, sdev_store_##field);
 
 /* Currently we don't export bit fields, but we might in future,
  * so leave this code in */
@@ -272,7 +273,7 @@ sdev_store_##field (struct device *dev, const char *buf, size_t count)	\
 	}								\
 	return ret;							\
 }									\
-static DEVICE_ATTR(field, S_IRUGO | S_IWUSR, sdev_show_##field, sdev_store_##field)
+static DEVICE_ATTR(field, S_IRUGO | S_IWUSR, sdev_show_##field, sdev_store_##field);
 
 /*
  * scsi_sdev_check_buf_bit: return 0 if buf is "0", return 1 if buf is "1",
@@ -320,7 +321,7 @@ sdev_store_timeout (struct device *dev, const char *buf, size_t count)
 	sdev->timeout = timeout * HZ;
 	return count;
 }
-static DEVICE_ATTR(timeout, S_IRUGO | S_IWUSR, sdev_show_timeout, sdev_store_timeout)
+static DEVICE_ATTR(timeout, S_IRUGO | S_IWUSR, sdev_show_timeout, sdev_store_timeout);
 
 static ssize_t
 store_rescan_field (struct device *dev, const char *buf, size_t count) 
@@ -328,7 +329,7 @@ store_rescan_field (struct device *dev, const char *buf, size_t count)
 	scsi_rescan_device(dev);
 	return count;
 }
-static DEVICE_ATTR(rescan, S_IWUSR, NULL, store_rescan_field)
+static DEVICE_ATTR(rescan, S_IWUSR, NULL, store_rescan_field);
 
 static ssize_t sdev_store_delete(struct device *dev, const char *buf,
 				 size_t count)
@@ -624,4 +625,4 @@ int scsi_sysfs_add_host(struct Scsi_Host *shost)
 
 /* A blank transport template that is used in drivers that don't
  * yet implement Transport Attributes */
-struct scsi_transport_template blank_transport_template = { 0, };
+struct scsi_transport_template blank_transport_template = { NULL, };
diff --git a/drivers/scsi/scsi_transport_spi.c b/drivers/scsi/scsi_transport_spi.c
index f2cd32a14..9c41eefb9 100644
--- a/drivers/scsi/scsi_transport_spi.c
+++ b/drivers/scsi/scsi_transport_spi.c
@@ -152,7 +152,7 @@ store_spi_transport_##field(struct class_device *cdev, const char *buf, \
 	spi_transport_store_function(field, format_string)		\
 static CLASS_DEVICE_ATTR(field, S_IRUGO | S_IWUSR,			\
 			 show_spi_transport_##field,			\
-			 store_spi_transport_##field)
+			 store_spi_transport_##field);
 
 /* The Parallel SCSI Tranport Attributes: */
 spi_transport_rd_attr(offset, "%d\n");
@@ -173,7 +173,7 @@ store_spi_revalidate(struct class_device *cdev, const char *buf, size_t count)
 	spi_dv_device(sdev);
 	return count;
 }
-static CLASS_DEVICE_ATTR(revalidate, S_IWUSR, NULL, store_spi_revalidate)
+static CLASS_DEVICE_ATTR(revalidate, S_IWUSR, NULL, store_spi_revalidate);
 
 /* Translate the period into ns according to the current spec
  * for SDTR/PPR messages */
@@ -390,10 +390,11 @@ spi_dv_retrain(struct scsi_request *sreq, u8 *buffer, u8 *ptr,
 {
 	struct spi_internal *i = to_spi_internal(sreq->sr_host->transportt);
 	struct scsi_device *sdev = sreq->sr_device;
-	int period, prevperiod = 0; 
+	int period = 0, prevperiod = 0; 
 
 
 	for (;;) {
+		int newperiod;
 		if (compare_fn(sreq, buffer, ptr, DV_LOOPS))
 			/* Successful DV */
 			break;
@@ -401,7 +402,8 @@ spi_dv_retrain(struct scsi_request *sreq, u8 *buffer, u8 *ptr,
 		/* OK, retrain, fallback */
 		if (i->f->get_period)
 			i->f->get_period(sdev);
-		period = spi_period(sdev);
+		newperiod = spi_period(sdev);
+		period = newperiod > period ? newperiod : period;
 		if (period < 0x0d)
 			period++;
 		else
diff --git a/drivers/scsi/scsicam.c b/drivers/scsi/scsicam.c
index d17702eec..920a1b717 100644
--- a/drivers/scsi/scsicam.c
+++ b/drivers/scsi/scsicam.c
@@ -11,17 +11,16 @@
  */
 
 #include <linux/module.h>
-
 #include <linux/fs.h>
 #include <linux/genhd.h>
 #include <linux/kernel.h>
 #include <linux/blkdev.h>
 #include <linux/buffer_head.h>
 #include <asm/unaligned.h>
-#include "scsi.h"
-#include "hosts.h"
+
 #include <scsi/scsicam.h>
 
+
 static int setsize(unsigned long capacity, unsigned int *cyls, unsigned int *hds,
 		   unsigned int *secs);
 
diff --git a/drivers/scsi/scsiiom.c b/drivers/scsi/scsiiom.c
index b9285e51a..89b957673 100644
--- a/drivers/scsi/scsiiom.c
+++ b/drivers/scsi/scsiiom.c
@@ -6,19 +6,19 @@
  ***********************************************************************/
 /* $Id: scsiiom.c,v 2.55.2.17 2000/12/20 00:39:37 garloff Exp $ */
 static void __inline__
-dc390_freetag (PDCB pDCB, PSRB pSRB)
+dc390_freetag (struct dc390_dcb* pDCB, struct dc390_srb* pSRB)
 {
 	if (pSRB->TagNumber < 255) {
 		pDCB->TagMask &= ~(1 << pSRB->TagNumber);   /* free tag mask */
 		pSRB->TagNumber = 255;
 	}
-};
+}
 
 
-static UCHAR
-dc390_StartSCSI( PACB pACB, PDCB pDCB, PSRB pSRB )
+static u8
+dc390_StartSCSI( struct dc390_acb* pACB, struct dc390_dcb* pDCB, struct dc390_srb* pSRB )
 {
-    UCHAR cmd; UCHAR  disc_allowed, try_sync_nego;
+    u8 cmd; u8  disc_allowed, try_sync_nego;
 
     pSRB->ScsiPhase = SCSI_NOP0;
 
@@ -69,13 +69,13 @@ dc390_StartSCSI( PACB pACB, PDCB pDCB, PSRB pSRB )
     /* Change 99/05/31: Don't use tags when not disconnecting (BUSY) */
     if ((pDCB->SyncMode & EN_TAG_QUEUEING) && disc_allowed)
       {
-	UCHAR tag_no = 0;
+	u8 tag_no = 0;
 	while ((1 << tag_no) & pDCB->TagMask) tag_no++;
 	if (tag_no >= sizeof (pDCB->TagMask)*8 || tag_no >= pDCB->MaxCommand) { 
 		printk (KERN_WARNING "DC390: Out of tags for Dev. %02x %02x\n", pDCB->TargetID, pDCB->TargetLUN); 
 		return 1;
 		//goto no_tag;
-	};
+	}
 	DC390_write8 (ScsiFifo, SIMPLE_QUEUE_TAG);
 	pDCB->TagMask |= (1 << tag_no); pSRB->TagNumber = tag_no;
 	DC390_write8 (ScsiFifo, tag_no);
@@ -86,13 +86,13 @@ dc390_StartSCSI( PACB pACB, PDCB pDCB, PSRB pSRB )
       {
 //      no_tag:
 	DEBUG1(printk (KERN_DEBUG "DC390: Select w%s/DisCn for Cmd %li (SRB %p), No TagQ\n", (disc_allowed?"":"o"), pSRB->pcmd->pid, pSRB));
-      };
+      }
 
     pSRB->SRBState = SRB_START_;
 
     if (try_sync_nego)
       { 
-	UCHAR Sync_Off = pDCB->SyncOffset;
+	u8 Sync_Off = pDCB->SyncOffset;
         DEBUG0(printk (KERN_INFO "DC390: NEW Sync Nego code triggered (%i %i)\n", pDCB->TargetID, pDCB->TargetLUN));
 	pSRB->MsgOutBuf[0] = EXTENDED_MESSAGE;
 	pSRB->MsgOutBuf[1] = 3;
@@ -104,7 +104,7 @@ dc390_StartSCSI( PACB pACB, PDCB pDCB, PSRB pSRB )
 	//pSRB->SRBState = SRB_MSGOUT_;
 	pSRB->SRBState |= DO_SYNC_NEGO;
 	cmd = SEL_W_ATN_STOP;
-      };
+      }
 
     /* Command is written in CommandPhase, if SEL_W_ATN_STOP ... */
     if (cmd != SEL_W_ATN_STOP)
@@ -121,11 +121,11 @@ dc390_StartSCSI( PACB pACB, PDCB pDCB, PSRB pSRB )
 	  }
 	else	/* write cmnd to bus */ 
 	  {
-	    PUCHAR ptr; UCHAR i;
-	    ptr = (PUCHAR) pSRB->pcmd->cmnd;
+	    u8 *ptr; u8 i;
+	    ptr = (u8 *) pSRB->pcmd->cmnd;
 	    for (i=0; i<pSRB->pcmd->cmd_len; i++)
 	      DC390_write8 (ScsiFifo, *(ptr++));
-	  };
+	  }
       }
     DEBUG0(if (pACB->pActiveDCB)	\
 	   printk (KERN_WARNING "DC390: ActiveDCB != 0\n"));
@@ -141,7 +141,7 @@ dc390_StartSCSI( PACB pACB, PDCB pDCB, PSRB pSRB )
 	//DC390_write8 (ScsiCmd, CLEAR_FIFO_CMD);
 	pACB->SelLost++;
 	return 1;
-    };
+    }
     DC390_write8 (ScsiCmd, cmd);
     pACB->pActiveDCB = pDCB; pDCB->pActiveSRB = pSRB;
     pACB->Connected = 1;
@@ -154,18 +154,17 @@ dc390_StartSCSI( PACB pACB, PDCB pDCB, PSRB pSRB )
 
 #if DMA_INT
 /* This is similar to AM53C974.c ... */
-static UCHAR 
-dc390_dma_intr (PACB pACB)
+static u8 
+dc390_dma_intr (struct dc390_acb* pACB)
 {
-  PSRB pSRB;
-  UCHAR dstate;
-  DEBUG0(USHORT pstate;PDEVDECL1);
+  struct dc390_srb* pSRB;
+  u8 dstate;
+  DEBUG0(u16 pstate; struct pci_dev *pdev = pACB->pdev);
   
-  DEBUG0(PDEVSET1);
-  DEBUG0(PCI_READ_CONFIG_WORD (PDEV, PCI_STATUS, &pstate));
+  DEBUG0(pci_read_config_word(pdev, PCI_STATUS, &pstate));
   DEBUG0(if (pstate & (PCI_STATUS_SIG_SYSTEM_ERROR | PCI_STATUS_DETECTED_PARITY))\
 	{ printk(KERN_WARNING "DC390: PCI state = %04x!\n", pstate); \
-	  PCI_WRITE_CONFIG_WORD (PDEV, PCI_STATUS, (PCI_STATUS_SIG_SYSTEM_ERROR | PCI_STATUS_DETECTED_PARITY));});
+	  pci_write_config_word(pdev, PCI_STATUS, (PCI_STATUS_SIG_SYSTEM_ERROR | PCI_STATUS_DETECTED_PARITY));});
 
   dstate = DC390_read8 (DMA_Status); 
 
@@ -176,10 +175,10 @@ dc390_dma_intr (PACB pACB)
     {
 	printk (KERN_ERR "DC390: DMA error (%02x)!\n", dstate);
 	return dstate;
-    };
+    }
   if (dstate & DMA_XFER_DONE)
     {
-	UINT residual, xferCnt; int ctr = 6000000;
+	u32 residual, xferCnt; int ctr = 6000000;
 	if (! (DC390_read8 (DMA_Cmd) & READ_DIRECTION))
 	  {
 	    do
@@ -217,19 +216,18 @@ dc390_dma_intr (PACB pACB)
 static irqreturn_t __inline__
 DC390_Interrupt( int irq, void *dev_id, struct pt_regs *regs)
 {
-    PACB   pACB, pACB2;
-    PDCB   pDCB;
-    PSRB   pSRB;
-    UCHAR  sstatus=0;
-    UCHAR  phase;
-    void   (*stateV)( PACB, PSRB, PUCHAR );
-    UCHAR  istate, istatus;
+    struct dc390_acb *pACB, *pACB2;
+    struct dc390_dcb *pDCB;
+    struct dc390_srb *pSRB;
+    u8  sstatus=0;
+    u8  phase;
+    void   (*stateV)( struct dc390_acb*, struct dc390_srb*, u8 *);
+    u8  istate, istatus;
 #if DMA_INT
-    UCHAR  dstatus;
+    u8  dstatus;
 #endif
-    DC390_IFLAGS;
 
-    pACB = (PACB)dev_id;
+    pACB = (struct dc390_acb*)dev_id;
     for (pACB2 = dc390_pACB_start; (pACB2 && pACB2 != pACB); pACB2 = pACB2->pNextACB);
     if (!pACB2)
     {
@@ -244,23 +242,23 @@ DC390_Interrupt( int irq, void *dev_id, struct pt_regs *regs)
     DEBUG1(printk (KERN_DEBUG "sstatus=%02x,", sstatus));
 
 #if DMA_INT
-    DC390_LOCK_IO(pACB->pScsiHost);
+    spin_lock_irq(pACB->pScsiHost->host_lock);
     dstatus = dc390_dma_intr (pACB);
-    DC390_UNLOCK_IO(pACB->pScsiHost);
+    spin_unlock_irq(pACB->pScsiHost->host_lock);
 
     DEBUG1(printk (KERN_DEBUG "dstatus=%02x,", dstatus));
     if (! (dstatus & SCSI_INTERRUPT))
       {
 	DEBUG0(printk (KERN_WARNING "DC390 Int w/o SCSI actions (only DMA?)\n"));
 	return IRQ_NONE;
-      };
+      }
 #else
     //DC390_write32 (DMA_ScsiBusCtrl, WRT_ERASE_DMA_STAT | EN_INT_ON_PCI_ABORT);
     //dstatus = DC390_read8 (DMA_Status);
     //DC390_write32 (DMA_ScsiBusCtrl, EN_INT_ON_PCI_ABORT);
 #endif
 
-    DC390_LOCK_IO(pACB->pScsiHost);
+    spin_lock_irq(pACB->pScsiHost->host_lock);
 
     istate = DC390_read8 (Intern_State);
     istatus = DC390_read8 (INT_Status); /* This clears Scsi_Status, Intern_State and INT_Status ! */
@@ -313,7 +311,7 @@ DC390_Interrupt( int irq, void *dev_id, struct pt_regs *regs)
 	{
 		printk (KERN_ERR "DC390: Suc. op/ Serv. req: pActiveDCB = 0!\n");
 		goto unlock;
-	};
+	}
 	pSRB = pDCB->pActiveSRB;
 	if( pDCB->DCBFlag & ABORT_DEV_ )
 	  dc390_EnableMsgOut_Abort (pACB, pSRB);
@@ -324,15 +322,14 @@ DC390_Interrupt( int irq, void *dev_id, struct pt_regs *regs)
 	( *stateV )( pACB, pSRB, &sstatus );
 
 	pSRB->ScsiPhase = sstatus & 7;
-	phase = (UCHAR) sstatus & 7;
+	phase = (u8) sstatus & 7;
 	DEBUG1(printk (KERN_INFO "DC390: [%i]%s(1) (%02x)\n", phase, dc390_p1_str[phase], sstatus));
 	stateV = (void *) dc390_phase1[phase];
 	( *stateV )( pACB, pSRB, &sstatus );
-	goto unlock;
     }
 
  unlock:
-    DC390_UNLOCK_IO(pACB->pScsiHost);
+    spin_unlock_irq(pACB->pScsiHost->host_lock);
     return IRQ_HANDLED;
 }
 
@@ -347,12 +344,12 @@ static irqreturn_t do_DC390_Interrupt( int irq, void *dev_id, struct pt_regs *re
 }
 
 static void
-dc390_DataOut_0( PACB pACB, PSRB pSRB, PUCHAR psstatus)
+dc390_DataOut_0( struct dc390_acb* pACB, struct dc390_srb* pSRB, u8 *psstatus)
 {
-    UCHAR   sstatus;
-    PSGL    psgl;
-    UINT    ResidCnt, xferCnt;
-    UCHAR   dstate = 0;
+    u8   sstatus;
+    struct scatterlist *psgl;
+    u32    ResidCnt, xferCnt;
+    u8   dstate = 0;
 
     sstatus = *psstatus;
 
@@ -363,10 +360,20 @@ dc390_DataOut_0( PACB pACB, PSRB pSRB, PUCHAR psstatus)
 
 	if( sstatus & COUNT_2_ZERO )
 	{
-	    int ctr = 6000000; /* only try for about a second */
-	    while( --ctr && !((dstate = DC390_read8 (DMA_Status)) & DMA_XFER_DONE) && pSRB->SGToBeXferLen );
-	    if (!ctr) printk (KERN_CRIT "DC390: Deadlock in DataOut_0: DMA aborted unfinished: %06x bytes remain!!\n", DC390_read32 (DMA_Wk_ByteCntr));
-	    dc390_laststatus &= ~0xff000000; dc390_laststatus |= dstate << 24;
+	    unsigned long timeout = jiffies + HZ;
+
+	    /* Function called from the ISR with the host_lock held and interrupts disabled */
+	    if (pSRB->SGToBeXferLen)
+		while (time_before(jiffies, timeout) && !((dstate = DC390_read8 (DMA_Status)) & DMA_XFER_DONE)) {
+		    spin_unlock_irq(pACB->pScsiHost->host_lock);
+		    udelay(50);
+		    spin_lock_irq(pACB->pScsiHost->host_lock);
+		}
+	    if (!time_before(jiffies, timeout))
+		printk (KERN_CRIT "DC390: Deadlock in DataOut_0: DMA aborted unfinished: %06x bytes remain!!\n",
+			DC390_read32 (DMA_Wk_ByteCntr));
+	    dc390_laststatus &= ~0xff000000;
+	    dc390_laststatus |= dstate << 24;
 	    pSRB->TotalXferredLen += pSRB->SGToBeXferLen;
 	    pSRB->SGIndex++;
 	    if( pSRB->SGIndex < pSRB->SGcount )
@@ -382,10 +389,10 @@ dc390_DataOut_0( PACB pACB, PSRB pSRB, PUCHAR psstatus)
 	}
 	else
 	{
-	    ResidCnt  = (UINT) DC390_read8 (Current_Fifo) & 0x1f;
-	    ResidCnt |= (UINT) DC390_read8 (CtcReg_High) << 16;
-	    ResidCnt |= (UINT) DC390_read8 (CtcReg_Mid) << 8; 
-	    ResidCnt += (UINT) DC390_read8 (CtcReg_Low);
+	    ResidCnt  = (u32) DC390_read8 (Current_Fifo) & 0x1f;
+	    ResidCnt |= (u32) DC390_read8 (CtcReg_High) << 16;
+	    ResidCnt |= (u32) DC390_read8 (CtcReg_Mid) << 8; 
+	    ResidCnt += (u32) DC390_read8 (CtcReg_Low);
 
 	    xferCnt = pSRB->SGToBeXferLen - ResidCnt;
 	    pSRB->SGBusAddr += xferCnt;
@@ -401,13 +408,13 @@ dc390_DataOut_0( PACB pACB, PSRB pSRB, PUCHAR psstatus)
 }
 
 static void
-dc390_DataIn_0( PACB pACB, PSRB pSRB, PUCHAR psstatus)
+dc390_DataIn_0( struct dc390_acb* pACB, struct dc390_srb* pSRB, u8 *psstatus)
 {
-    UCHAR   sstatus, residual, bval;
-    PSGL    psgl;
-    UINT    ResidCnt, i;
-    ULONG   xferCnt;
-    PUCHAR  ptr;
+    u8   sstatus, residual, bval;
+    struct scatterlist *psgl;
+    u32    ResidCnt, i;
+    unsigned long   xferCnt;
+    u8      *ptr;
 
     sstatus = *psstatus;
 
@@ -418,15 +425,26 @@ dc390_DataIn_0( PACB pACB, PSRB pSRB, PUCHAR psstatus)
 
 	if( sstatus & COUNT_2_ZERO )
 	{
-	    int ctr = 6000000; /* only try for about a second */
 	    int dstate = 0;
-	    while( --ctr && !((dstate = DC390_read8 (DMA_Status)) & DMA_XFER_DONE) && pSRB->SGToBeXferLen );
-	    if (!ctr) printk (KERN_CRIT "DC390: Deadlock in DataIn_0: DMA aborted unfinished: %06x bytes remain!!\n", DC390_read32 (DMA_Wk_ByteCntr));
-	    if (!ctr) printk (KERN_CRIT "DC390: DataIn_0: DMA State: %i\n", dstate);
-	    dc390_laststatus &= ~0xff000000; dc390_laststatus |= dstate << 24;
-	    DEBUG1(ResidCnt = ((ULONG) DC390_read8 (CtcReg_High) << 16)	\
-		+ ((ULONG) DC390_read8 (CtcReg_Mid) << 8)		\
-		+ ((ULONG) DC390_read8 (CtcReg_Low)));
+	    unsigned long timeout = jiffies + HZ;
+
+	    /* Function called from the ISR with the host_lock held and interrupts disabled */
+	    if (pSRB->SGToBeXferLen)
+		while (time_before(jiffies, timeout) && !((dstate = DC390_read8 (DMA_Status)) & DMA_XFER_DONE)) {
+		    spin_unlock_irq(pACB->pScsiHost->host_lock);
+		    udelay(50);
+		    spin_lock_irq(pACB->pScsiHost->host_lock);
+		}
+	    if (!time_before(jiffies, timeout)) {
+		printk (KERN_CRIT "DC390: Deadlock in DataIn_0: DMA aborted unfinished: %06x bytes remain!!\n",
+			DC390_read32 (DMA_Wk_ByteCntr));
+		printk (KERN_CRIT "DC390: DataIn_0: DMA State: %i\n", dstate);
+	    }
+	    dc390_laststatus &= ~0xff000000;
+	    dc390_laststatus |= dstate << 24;
+	    DEBUG1(ResidCnt = ((unsigned long) DC390_read8 (CtcReg_High) << 16)	\
+		+ ((unsigned long) DC390_read8 (CtcReg_Mid) << 8)		\
+		+ ((unsigned long) DC390_read8 (CtcReg_Low)));
 	    DEBUG1(printk (KERN_DEBUG "Count_2_Zero (ResidCnt=%i,ToBeXfer=%li),", ResidCnt, pSRB->SGToBeXferLen));
 
 	    DC390_write8 (DMA_Cmd, READ_DIRECTION+DMA_IDLE_CMD); /* | DMA_INT */
@@ -482,11 +500,11 @@ din_1:
 	    dc390_laststatus &= ~0xff000000; dc390_laststatus |= bval << 24;
 
 	    DEBUG1(printk (KERN_DEBUG "Blast: Read %i times DMA_Status %02x", 0xa000-i, bval));
-	    ResidCnt = (UINT) DC390_read8 (CtcReg_High);
+	    ResidCnt = (u32) DC390_read8 (CtcReg_High);
 	    ResidCnt <<= 8;
-	    ResidCnt |= (UINT) DC390_read8 (CtcReg_Mid);
+	    ResidCnt |= (u32) DC390_read8 (CtcReg_Mid);
 	    ResidCnt <<= 8;
-	    ResidCnt |= (UINT) DC390_read8 (CtcReg_Low);
+	    ResidCnt |= (u32) DC390_read8 (CtcReg_Low);
 
 	    xferCnt = pSRB->SGToBeXferLen - ResidCnt;
 	    pSRB->SGBusAddr += xferCnt;
@@ -496,7 +514,7 @@ din_1:
 	    if( residual )
 	    {
 		bval = DC390_read8 (ScsiFifo);	    /* get one residual byte */
-		ptr = (PUCHAR) bus_to_virt( pSRB->SGBusAddr );
+		ptr = (u8 *) bus_to_virt( pSRB->SGBusAddr );
 		*ptr = bval;
 		pSRB->SGBusAddr++; xferCnt++;
 		pSRB->TotalXferredLen++;
@@ -515,12 +533,12 @@ din_1:
 }
 
 static void
-dc390_Command_0( PACB pACB, PSRB pSRB, PUCHAR psstatus)
+dc390_Command_0( struct dc390_acb* pACB, struct dc390_srb* pSRB, u8 *psstatus)
 {
 }
 
 static void
-dc390_Status_0( PACB pACB, PSRB pSRB, PUCHAR psstatus)
+dc390_Status_0( struct dc390_acb* pACB, struct dc390_srb* pSRB, u8 *psstatus)
 {
 
     pSRB->TargetStatus = DC390_read8 (ScsiFifo);
@@ -533,7 +551,7 @@ dc390_Status_0( PACB pACB, PSRB pSRB, PUCHAR psstatus)
 }
 
 static void
-dc390_MsgOut_0( PACB pACB, PSRB pSRB, PUCHAR psstatus)
+dc390_MsgOut_0( struct dc390_acb* pACB, struct dc390_srb* pSRB, u8 *psstatus)
 {
     if( pSRB->SRBState & (SRB_UNEXPECT_RESEL+SRB_ABORT_SENT) )
 	*psstatus = SCSI_NOP0;
@@ -542,33 +560,33 @@ dc390_MsgOut_0( PACB pACB, PSRB pSRB, PUCHAR psstatus)
 
 
 static void __inline__
-dc390_reprog (PACB pACB, PDCB pDCB)
+dc390_reprog (struct dc390_acb* pACB, struct dc390_dcb* pDCB)
 {
   DC390_write8 (Sync_Period, pDCB->SyncPeriod);
   DC390_write8 (Sync_Offset, pDCB->SyncOffset);
   DC390_write8 (CtrlReg3, pDCB->CtrlR3);
   DC390_write8 (CtrlReg4, pDCB->CtrlR4);
   dc390_SetXferRate (pACB, pDCB);
-};
+}
 
 
 #ifdef DC390_DEBUG0
 static void
-dc390_printMsg (UCHAR *MsgBuf, UCHAR len)
+dc390_printMsg (u8 *MsgBuf, u8 len)
 {
   int i;
   printk (" %02x", MsgBuf[0]);
   for (i = 1; i < len; i++)
     printk (" %02x", MsgBuf[i]);
   printk ("\n");
-};
+}
 #endif
 
 #define DC390_ENABLE_MSGOUT DC390_write8 (ScsiCmd, SET_ATN_CMD)
 
 /* reject_msg */
 static void __inline__
-dc390_MsgIn_reject (PACB pACB, PSRB pSRB)
+dc390_MsgIn_reject (struct dc390_acb* pACB, struct dc390_srb* pSRB)
 {
   pSRB->MsgOutBuf[0] = MESSAGE_REJECT;
   pSRB->MsgCnt = 1; DC390_ENABLE_MSGOUT;
@@ -577,18 +595,18 @@ dc390_MsgIn_reject (PACB pACB, PSRB pSRB)
 
 /* abort command */
 static void __inline__
-dc390_EnableMsgOut_Abort ( PACB pACB, PSRB pSRB )
+dc390_EnableMsgOut_Abort ( struct dc390_acb* pACB, struct dc390_srb* pSRB )
 {
     pSRB->MsgOutBuf[0] = ABORT; 
     pSRB->MsgCnt = 1; DC390_ENABLE_MSGOUT;
     pSRB->pSRBDCB->DCBFlag &= ~ABORT_DEV_;
 }
 
-static PSRB
-dc390_MsgIn_QTag (PACB pACB, PDCB pDCB, UCHAR tag)
+static struct dc390_srb*
+dc390_MsgIn_QTag (struct dc390_acb* pACB, struct dc390_dcb* pDCB, u8 tag)
 {
-  PSRB lastSRB = pDCB->pGoingLast;
-  PSRB pSRB = pDCB->pGoingSRB;
+  struct dc390_srb* lastSRB = pDCB->pGoingLast;
+  struct dc390_srb* pSRB = pDCB->pGoingSRB;
 
   if (pSRB)
     {
@@ -626,9 +644,9 @@ dc390_MsgIn_QTag (PACB pACB, PDCB pDCB, UCHAR tag)
 
 /* set async transfer mode */
 static void 
-dc390_MsgIn_set_async (PACB pACB, PSRB pSRB)
+dc390_MsgIn_set_async (struct dc390_acb* pACB, struct dc390_srb* pSRB)
 {
-  PDCB pDCB = pSRB->pSRBDCB;
+  struct dc390_dcb* pDCB = pSRB->pSRBDCB;
   if (!(pSRB->SRBState & DO_SYNC_NEGO)) 
     printk (KERN_INFO "DC390: Target %i initiates Non-Sync?\n", pDCB->TargetID);
   pSRB->SRBState &= ~DO_SYNC_NEGO;
@@ -644,13 +662,13 @@ dc390_MsgIn_set_async (PACB pACB, PSRB pSRB)
 
 /* set sync transfer mode */
 static void
-dc390_MsgIn_set_sync (PACB pACB, PSRB pSRB)
+dc390_MsgIn_set_sync (struct dc390_acb* pACB, struct dc390_srb* pSRB)
 {
-  UCHAR bval;
-  USHORT wval, wval1;
-  PDCB pDCB = pSRB->pSRBDCB;
-  UCHAR oldsyncperiod = pDCB->SyncPeriod;
-  UCHAR oldsyncoffset = pDCB->SyncOffset;
+  u8 bval;
+  u16 wval, wval1;
+  struct dc390_dcb* pDCB = pSRB->pSRBDCB;
+  u8 oldsyncperiod = pDCB->SyncPeriod;
+  u8 oldsyncoffset = pDCB->SyncOffset;
   
   if (!(pSRB->SRBState & DO_SYNC_NEGO))
     {
@@ -671,11 +689,11 @@ dc390_MsgIn_set_sync (PACB pACB, PSRB pSRB)
 	{
 	  printk (KERN_INFO "DC390: Set sync nego period to %ins\n", pDCB->NegoPeriod << 2);
 	  pSRB->MsgInBuf[3] = pDCB->NegoPeriod;
-	};
+	}
       memcpy (pSRB->MsgOutBuf, pSRB->MsgInBuf, 5);
       pSRB->MsgCnt = 5;
       DC390_ENABLE_MSGOUT;
-    };
+    }
 
   pSRB->SRBState &= ~DO_SYNC_NEGO;
   pDCB->SyncMode |= SYNC_ENABLE+SYNC_NEGO_DONE;
@@ -683,7 +701,7 @@ dc390_MsgIn_set_sync (PACB pACB, PSRB pSRB)
   pDCB->SyncOffset |= pSRB->MsgInBuf[4];
   pDCB->NegoPeriod = pSRB->MsgInBuf[3];
 
-  wval = (USHORT) pSRB->MsgInBuf[3];
+  wval = (u16) pSRB->MsgInBuf[3];
   wval = wval << 2; wval -= 3; wval1 = wval / 25;	/* compute speed */
   if( (wval1 * 25) != wval) wval1++;
   bval = FAST_CLK+FAST_SCSI;	/* fast clock / fast scsi */
@@ -703,7 +721,7 @@ dc390_MsgIn_set_sync (PACB pACB, PSRB pSRB)
     }
 
   pDCB->CtrlR3 = bval;
-  pDCB->SyncPeriod = (UCHAR)wval1;
+  pDCB->SyncPeriod = (u8)wval1;
   
   if ((oldsyncperiod != wval1 || oldsyncoffset != pDCB->SyncOffset) && pDCB->TargetLUN == 0)
     {
@@ -713,26 +731,26 @@ dc390_MsgIn_set_sync (PACB pACB, PSRB pSRB)
     }
   
   dc390_reprog (pACB, pDCB);
-};
+}
 
 
 /* handle RESTORE_PTR */
 /* I presume, this command is already mapped, so, have to remap. */
 static void 
-dc390_restore_ptr (PACB pACB, PSRB pSRB)
+dc390_restore_ptr (struct dc390_acb* pACB, struct dc390_srb* pSRB)
 {
-    Scsi_Cmnd* pcmd = pSRB->pcmd;
-    PSGL psgl;
+    struct scsi_cmnd *pcmd = pSRB->pcmd;
+    struct scatterlist *psgl;
     pSRB->TotalXferredLen = 0;
     pSRB->SGIndex = 0;
     if (pcmd->use_sg) {
-	pSRB->pSegmentList = (PSGL) pcmd->request_buffer;
+	pSRB->pSegmentList = (struct scatterlist *)pcmd->request_buffer;
 	psgl = pSRB->pSegmentList;
 	//dc390_pci_sync(pSRB);
 
-	while (pSRB->TotalXferredLen + (ULONG) sg_dma_len(psgl) < pSRB->Saved_Ptr)
+	while (pSRB->TotalXferredLen + (unsigned long) sg_dma_len(psgl) < pSRB->Saved_Ptr)
 	{
-	    pSRB->TotalXferredLen += (ULONG) sg_dma_len(psgl);
+	    pSRB->TotalXferredLen += (unsigned long) sg_dma_len(psgl);
 	    pSRB->SGIndex++;
 	    if( pSRB->SGIndex < pSRB->SGcount )
 	    {
@@ -754,14 +772,14 @@ dc390_restore_ptr (PACB pACB, PSRB pSRB)
 
 	sg_dma_len(&pSRB->Segmentx) = pcmd->request_bufflen - pSRB->Saved_Ptr;
 	pSRB->SGcount = 1;
-	pSRB->pSegmentList = (PSGL) &pSRB->Segmentx;
+	pSRB->pSegmentList = (struct scatterlist *) &pSRB->Segmentx;
     } else {
 	 pSRB->SGcount = 0;
 	 printk (KERN_INFO "DC390: RESTORE_PTR message for Transfer without Scatter-Gather ??\n");
     }
 
   pSRB->TotalXferredLen = pSRB->Saved_Ptr;
-};
+}
 
 
 /* According to the docs, the AM53C974 reads the message and 
@@ -773,8 +791,8 @@ dc390_restore_ptr (PACB pACB, PSRB pSRB)
 /* The old implementation was correct. Sigh! */
 
 /* Check if the message is complete */
-static UCHAR __inline__
-dc390_MsgIn_complete (UCHAR *msgbuf, UINT len)
+static u8 __inline__
+dc390_MsgIn_complete (u8 *msgbuf, u32 len)
 { 
   if (*msgbuf == EXTENDED_MESSAGE)
   {
@@ -789,10 +807,10 @@ dc390_MsgIn_complete (UCHAR *msgbuf, UINT len)
 
 
 /* read and eval received messages */
-void
-dc390_MsgIn_0( PACB pACB, PSRB pSRB, PUCHAR psstatus)
+static void
+dc390_MsgIn_0( struct dc390_acb* pACB, struct dc390_srb* pSRB, u8 *psstatus)
 {
-    PDCB   pDCB = pACB->pActiveDCB;
+    struct dc390_dcb*   pDCB = pACB->pActiveDCB;
 
     /* Read the msg */
 
@@ -832,12 +850,12 @@ dc390_MsgIn_0( PACB pACB, PSRB pSRB, PUCHAR psstatus)
 		  dc390_MsgIn_set_async (pACB, pSRB);
 		else
 		  dc390_MsgIn_set_sync (pACB, pSRB);
-	      };
+	      }
 	    
 	    // nothing has to be done
 	  case COMMAND_COMPLETE: break;
 	    
-	    // SAVE POINTER may be ignored as we have the PSRB associated with the
+	    // SAVE POINTER may be ignored as we have the struct dc390_srb* associated with the
 	    // scsi command. Thanks, Gerard, for pointing it out.
 	  case SAVE_POINTERS: 
 	    pSRB->Saved_Ptr = pSRB->TotalXferredLen;
@@ -864,11 +882,11 @@ dc390_MsgIn_0( PACB pACB, PSRB pSRB, PUCHAR psstatus)
 
 
 static void
-dc390_DataIO_Comm( PACB pACB, PSRB pSRB, UCHAR ioDir)
+dc390_DataIO_Comm( struct dc390_acb* pACB, struct dc390_srb* pSRB, u8 ioDir)
 {
-    PSGL   psgl;
-    ULONG  lval;
-    PDCB   pDCB = pACB->pActiveDCB;
+    struct scatterlist *psgl;
+    unsigned long  lval;
+    struct dc390_dcb*   pDCB = pACB->pActiveDCB;
 
     if (pSRB == pACB->pTmpSRB)
     {
@@ -894,11 +912,11 @@ dc390_DataIO_Comm( PACB pACB, PSRB pSRB, UCHAR ioDir)
 	}
 	lval = pSRB->SGToBeXferLen;
 	DEBUG1(printk (KERN_DEBUG " DC390: Start transfer: %li bytes (address %08lx)\n", lval, pSRB->SGBusAddr));
-	DC390_write8 (CtcReg_Low, (UCHAR) lval);
+	DC390_write8 (CtcReg_Low, (u8) lval);
 	lval >>= 8;
-	DC390_write8 (CtcReg_Mid, (UCHAR) lval);
+	DC390_write8 (CtcReg_Mid, (u8) lval);
 	lval >>= 8;
-	DC390_write8 (CtcReg_High, (UCHAR) lval);
+	DC390_write8 (CtcReg_High, (u8) lval);
 
 	DC390_write32 (DMA_XferCnt, pSRB->SGToBeXferLen);
 	DC390_write32 (DMA_XferAddr, pSRB->SGBusAddr);
@@ -937,36 +955,36 @@ dc390_DataIO_Comm( PACB pACB, PSRB pSRB, UCHAR ioDir)
 
 
 static void
-dc390_DataOutPhase( PACB pACB, PSRB pSRB, PUCHAR psstatus)
+dc390_DataOutPhase( struct dc390_acb* pACB, struct dc390_srb* pSRB, u8 *psstatus)
 {
     dc390_DataIO_Comm (pACB, pSRB, WRITE_DIRECTION);
 }
 
 static void
-dc390_DataInPhase( PACB pACB, PSRB pSRB, PUCHAR psstatus)
+dc390_DataInPhase( struct dc390_acb* pACB, struct dc390_srb* pSRB, u8 *psstatus)
 {
     dc390_DataIO_Comm (pACB, pSRB, READ_DIRECTION);
 }
 
-void
-dc390_CommandPhase( PACB pACB, PSRB pSRB, PUCHAR psstatus)
+static void
+dc390_CommandPhase( struct dc390_acb* pACB, struct dc390_srb* pSRB, u8 *psstatus)
 {
-    PDCB   pDCB;
-    UCHAR  i, cnt;
-    PUCHAR ptr;
+    struct dc390_dcb*   pDCB;
+    u8  i, cnt;
+    u8     *ptr;
 
     DC390_write8 (ScsiCmd, RESET_ATN_CMD);
     DC390_write8 (ScsiCmd, CLEAR_FIFO_CMD);
     if( !(pSRB->SRBFlag & AUTO_REQSENSE) )
     {
-	cnt = (UCHAR) pSRB->pcmd->cmd_len;
-	ptr = (PUCHAR) pSRB->pcmd->cmnd;
+	cnt = (u8) pSRB->pcmd->cmd_len;
+	ptr = (u8 *) pSRB->pcmd->cmnd;
 	for(i=0; i < cnt; i++)
 	    DC390_write8 (ScsiFifo, *(ptr++));
     }
     else
     {
-	UCHAR bval = 0;
+	u8 bval = 0;
 	DC390_write8 (ScsiFifo, REQUEST_SENSE);
 	pDCB = pACB->pActiveDCB;
 	DC390_write8 (ScsiFifo, pDCB->TargetLUN << 5);
@@ -981,7 +999,7 @@ dc390_CommandPhase( PACB pACB, PSRB pSRB, PUCHAR psstatus)
 }
 
 static void
-dc390_StatusPhase( PACB pACB, PSRB pSRB, PUCHAR psstatus)
+dc390_StatusPhase( struct dc390_acb* pACB, struct dc390_srb* pSRB, u8 *psstatus)
 {
     DC390_write8 (ScsiCmd, CLEAR_FIFO_CMD);
     pSRB->SRBState = SRB_STATUS;
@@ -989,12 +1007,12 @@ dc390_StatusPhase( PACB pACB, PSRB pSRB, PUCHAR psstatus)
     //DC390_write8 (DMA_Cmd, DMA_IDLE_CMD);
 }
 
-void
-dc390_MsgOutPhase( PACB pACB, PSRB pSRB, PUCHAR psstatus)
+static void
+dc390_MsgOutPhase( struct dc390_acb* pACB, struct dc390_srb* pSRB, u8 *psstatus)
 {
-    UCHAR   bval, i, cnt;
-    PUCHAR  ptr;
-    PDCB    pDCB;
+    u8   bval, i, cnt;
+    u8     *ptr;
+    struct dc390_dcb*    pDCB;
 
     DC390_write8 (ScsiCmd, CLEAR_FIFO_CMD);
     pDCB = pACB->pActiveDCB;
@@ -1003,7 +1021,7 @@ dc390_MsgOutPhase( PACB pACB, PSRB pSRB, PUCHAR psstatus)
 	cnt = pSRB->MsgCnt;
 	if( cnt )
 	{
-	    ptr = (PUCHAR) pSRB->MsgOutBuf;
+	    ptr = (u8 *) pSRB->MsgOutBuf;
 	    for(i=0; i < cnt; i++)
 		DC390_write8 (ScsiFifo, *(ptr++));
 	    pSRB->MsgCnt = 0;
@@ -1043,7 +1061,7 @@ mop1:
 }
 
 static void
-dc390_MsgInPhase( PACB pACB, PSRB pSRB, PUCHAR psstatus)
+dc390_MsgInPhase( struct dc390_acb* pACB, struct dc390_srb* pSRB, u8 *psstatus)
 {
     DC390_write8 (ScsiCmd, CLEAR_FIFO_CMD);
     if( !(pSRB->SRBState & SRB_MSGIN) )
@@ -1056,21 +1074,21 @@ dc390_MsgInPhase( PACB pACB, PSRB pSRB, PUCHAR psstatus)
 }
 
 static void
-dc390_Nop_0( PACB pACB, PSRB pSRB, PUCHAR psstatus)
+dc390_Nop_0( struct dc390_acb* pACB, struct dc390_srb* pSRB, u8 *psstatus)
 {
 }
 
 static void
-dc390_Nop_1( PACB pACB, PSRB pSRB, PUCHAR psstatus)
+dc390_Nop_1( struct dc390_acb* pACB, struct dc390_srb* pSRB, u8 *psstatus)
 {
 }
 
 
 static void
-dc390_SetXferRate( PACB pACB, PDCB pDCB )
+dc390_SetXferRate( struct dc390_acb* pACB, struct dc390_dcb* pDCB )
 {
-    UCHAR  bval, i, cnt;
-    PDCB   ptr;
+    u8  bval, i, cnt;
+    struct dc390_dcb*   ptr;
 
     if( !(pDCB->TargetLUN) )
     {
@@ -1097,12 +1115,12 @@ dc390_SetXferRate( PACB pACB, PDCB pDCB )
 }
 
 
-void
-dc390_Disconnect( PACB pACB )
+static void
+dc390_Disconnect( struct dc390_acb* pACB )
 {
-    PDCB   pDCB;
-    PSRB   pSRB, psrb;
-    UCHAR  i, cnt;
+    struct dc390_dcb *pDCB;
+    struct dc390_srb *pSRB, *psrb;
+    u8  i, cnt;
 
     DEBUG0(printk(KERN_INFO "DISC,"));
 
@@ -1111,10 +1129,9 @@ dc390_Disconnect( PACB pACB )
     pDCB = pACB->pActiveDCB;
     if (!pDCB)
      {
-	int j = 400;
 	DEBUG0(printk(KERN_ERR "ACB:%p->ActiveDCB:%p IOPort:%04x IRQ:%02x !\n",\
 	       pACB, pDCB, pACB->IOPortBase, pACB->IRQLevel));
-	while (--j) udelay (1000);
+	mdelay(400);
 	DC390_read8 (INT_Status);	/* Reset Pending INT */
 	DC390_write8 (ScsiCmd, EN_SEL_RESEL);
 	return;
@@ -1179,12 +1196,12 @@ disc1:
 }
 
 
-void
-dc390_Reselect( PACB pACB )
+static void
+dc390_Reselect( struct dc390_acb* pACB )
 {
-    PDCB   pDCB;
-    PSRB   pSRB;
-    UCHAR  id, lun;
+    struct dc390_dcb*   pDCB;
+    struct dc390_srb*   pSRB;
+    u8  id, lun;
 
     DEBUG0(printk(KERN_INFO "RSEL,"));
     pACB->Connected = 1;
@@ -1265,60 +1282,19 @@ dc390_Reselect( PACB pACB )
     DC390_write8 (ScsiCmd, MSG_ACCEPTED_CMD);	/* ;to release the /ACK signal */
 }
 
-
-static void 
-dc390_remove_dev (PACB pACB, PDCB pDCB)
-{
-   PDCB pPrevDCB = pACB->pLinkDCB;
-
-   if (pDCB->GoingSRBCnt > 1)
-     {
-	DCBDEBUG(printk (KERN_INFO "DC390: Driver won't free DCB (ID %i, LUN %i): 0x%08x because of SRBCnt %i\n",\
-		pDCB->TargetID, pDCB->TargetLUN, (int)pDCB, pDCB->GoingSRBCnt));
-	return;
-     };
-   pACB->DCBmap[pDCB->TargetID] &= ~(1 << pDCB->TargetLUN);
-   
-   // The first one
-   if (pDCB == pACB->pLinkDCB) 
-   {
-	// The last one
-	if (pACB->pLastDCB == pDCB) {
-		pDCB->pNextDCB = 0; pACB->pLastDCB = 0;
-	}
-	pACB->pLinkDCB = pDCB->pNextDCB;
-   }
-   else
-   {
-	while (pPrevDCB->pNextDCB != pDCB) pPrevDCB = pPrevDCB->pNextDCB;
-	pPrevDCB->pNextDCB = pDCB->pNextDCB;
-	if (pDCB == pACB->pLastDCB) pACB->pLastDCB = pPrevDCB;
-   }
-
-   DCBDEBUG(printk (KERN_INFO "DC390: Driver about to free DCB (ID %i, LUN %i): %p\n",\
-	   pDCB->TargetID, pDCB->TargetLUN, pDCB));
-   if (pDCB == pACB->pActiveDCB) pACB->pActiveDCB = 0;
-   if (pDCB == pACB->pLinkDCB) pACB->pLinkDCB = pDCB->pNextDCB;
-   if (pDCB == pACB->pDCBRunRobin) pACB->pDCBRunRobin = pDCB->pNextDCB;
-   kfree (pDCB); 
-   pACB->DCBCnt--;
-   /* pACB->DeviceCnt--; */
-};
-
-
-static UCHAR __inline__
+static u8 __inline__
 dc390_tagq_blacklist (char* name)
 {
-   UCHAR i;
+   u8 i;
    for(i=0; i<BADDEVCNT; i++)
      if (memcmp (name, dc390_baddevname1[i], 28) == 0)
 	return 1;
    return 0;
-};
+}
    
 
 static void 
-dc390_disc_tagq_set (PDCB pDCB, PSCSI_INQDATA ptr)
+dc390_disc_tagq_set (struct dc390_dcb* pDCB, PSCSI_INQDATA ptr)
 {
    /* Check for SCSI format (ANSI and Response data format) */
    if ( (ptr->Vers & 0x07) >= 2 || (ptr->RDF & 0x0F) == 2 )
@@ -1336,37 +1312,38 @@ dc390_disc_tagq_set (PDCB pDCB, PSCSI_INQDATA ptr)
 	else
 	     pDCB->MaxCommand = 1;
      }
-};
+}
 
 
 static void 
-dc390_add_dev (PACB pACB, PDCB pDCB, PSCSI_INQDATA ptr)
+dc390_add_dev (struct dc390_acb* pACB, struct dc390_dcb* pDCB, PSCSI_INQDATA ptr)
 {
-   UCHAR bval1 = ptr->DevType & SCSI_DEVTYPE;
+   u8 bval1 = ptr->DevType & SCSI_DEVTYPE;
    pDCB->DevType = bval1;
    /* if (bval1 == TYPE_DISK || bval1 == TYPE_MOD) */
 	dc390_disc_tagq_set (pDCB, ptr);
-};
+}
 
 
-void
-dc390_SRBdone( PACB pACB, PDCB pDCB, PSRB pSRB )
+static void
+dc390_SRBdone( struct dc390_acb* pACB, struct dc390_dcb* pDCB, struct dc390_srb* pSRB )
 {
-    UCHAR  bval, status, i, DCB_removed;
-    PSCSICMD pcmd;
+    u8  bval, status, i;
+    struct scsi_cmnd *pcmd;
     PSCSI_INQDATA  ptr;
-    PSGL   ptr2;
-    ULONG  swlval;
+    struct scatterlist *ptr2;
+    unsigned long  swlval;
 
     pcmd = pSRB->pcmd;
     /* KG: Moved pci_unmap here */
     dc390_pci_unmap(pSRB);
 
-    DCB_removed = 0;
     status = pSRB->TargetStatus;
-    ptr = (PSCSI_INQDATA) (pcmd->request_buffer);
-    if( pcmd->use_sg )
-	ptr = (PSCSI_INQDATA) sg_dma_address((PSGL) ptr);
+    if (pcmd->use_sg) {
+	    ptr2 = (struct scatterlist *) (pcmd->request_buffer);
+	    ptr = (PSCSI_INQDATA) (page_address(ptr2->page) + ptr2->offset);
+    } else
+	    ptr = (PSCSI_INQDATA) (pcmd->request_buffer);
 	
     DEBUG0(printk (" SRBdone (%02x,%08x), SRB %p, pid %li\n", status, pcmd->result,\
 		pSRB, pcmd->pid));
@@ -1403,7 +1380,7 @@ dc390_SRBdone( PACB pACB, PDCB pDCB, PSRB pSRB )
 	}
 	if(pSRB->RetryCnt == 0)
 	{
-	    //(UINT)(pSRB->pcmd->cmnd[0]) = pSRB->Segment0[0];
+	    //(u32)(pSRB->pcmd->cmnd[0]) = pSRB->Segment0[0];
 	    pSRB->TotalXferredLen = pSRB->SavedTotXLen;
 	    if( (pSRB->TotalXferredLen) &&
 		(pSRB->TotalXferredLen >= pcmd->underflow) )
@@ -1411,7 +1388,7 @@ dc390_SRBdone( PACB pACB, PDCB pDCB, PSRB pSRB )
 	    else
 		  pcmd->result = MK_RES_LNX(DRIVER_SENSE,DID_OK,0,CHECK_CONDITION);
 		  REMOVABLEDEBUG(printk(KERN_INFO "Cmd=%02x,Result=%08x,XferL=%08x\n",pSRB->pcmd->cmnd[0],\
-			(UINT) pcmd->result, (UINT) pSRB->TotalXferredLen));
+			(u32) pcmd->result, (u32) pSRB->TotalXferredLen));
 	    goto ckc_e;
 	}
 	else /* Retry */
@@ -1419,19 +1396,17 @@ dc390_SRBdone( PACB pACB, PDCB pDCB, PSRB pSRB )
 	    pSRB->RetryCnt--;
 	    pSRB->AdaptStatus = 0;
 	    pSRB->TargetStatus = 0;
-	    //*((PUINT) &(pSRB->CmdBlock[0])) = pSRB->Segment0[0];
-	    //*((PUINT) &(pSRB->CmdBlock[4])) = pSRB->Segment0[1];
 	    /* Don't retry on TEST_UNIT_READY */
 	    if( pSRB->pcmd->cmnd[0] == TEST_UNIT_READY /* || pSRB->pcmd->cmnd[0] == START_STOP */)
 	    {
 		pcmd->result = MK_RES_LNX(DRIVER_SENSE,DID_OK,0,CHECK_CONDITION);
 		REMOVABLEDEBUG(printk(KERN_INFO "Cmd=%02x, Result=%08x, XferL=%08x\n",pSRB->pcmd->cmnd[0],\
-		       (UINT) pcmd->result, (UINT) pSRB->TotalXferredLen));
+		       (u32) pcmd->result, (u32) pSRB->TotalXferredLen));
 		goto ckc_e;
 	    }
 	    SET_RES_DRV(pcmd->result,DRIVER_SENSE);
 	    pcmd->use_sg	 = pSRB->SavedSGCount;
-	    //pSRB->ScsiCmdLen	 = (UCHAR) (pSRB->Segment1[0] >> 8);
+	    //pSRB->ScsiCmdLen	 = (u8) (pSRB->Segment1[0] >> 8);
 	    DEBUG0 (printk ("DC390: RETRY pid %li (%02x), target %02i-%02i\n", pcmd->pid, pcmd->cmnd[0], pcmd->device->id, pcmd->device->lun));
 	    pSRB->SGIndex = 0;
 	    pSRB->TotalXferredLen = 0;
@@ -1461,14 +1436,14 @@ dc390_SRBdone( PACB pACB, PDCB pDCB, PSRB pSRB )
 		    ptr2++;
 		}
 		REMOVABLEDEBUG(printk(KERN_INFO "XferredLen=%08x,NotXferLen=%08x\n",\
-			(UINT) pSRB->TotalXferredLen, (UINT) swlval));
+			(u32) pSRB->TotalXferredLen, (u32) swlval));
 	    }
 	    dc390_RequestSense( pACB, pDCB, pSRB );
 	    return;
 	}
 	else if( status_byte(status) == QUEUE_FULL )
 	{
-	    bval = (UCHAR) pDCB->GoingSRBCnt;
+	    bval = (u8) pDCB->GoingSRBCnt;
 	    bval--;
 	    pDCB->MaxCommand = bval;
 	    dc390_freetag (pDCB, pSRB);
@@ -1564,55 +1539,22 @@ ckc_e:
 				   pcmd->sense_buffer[2], pcmd->sense_buffer[3]);
 	    else printk ("\n");
 #endif
-	    if( (host_byte(pcmd->result) != DID_OK && !(status_byte(pcmd->result) & CHECK_CONDITION) && !(status_byte(pcmd->result) & BUSY)) ||
-	       ((driver_byte(pcmd->result) & DRIVER_SENSE) && (pcmd->sense_buffer[0] & 0x70) == 0x70 &&
-		(pcmd->sense_buffer[2] & 0xf) == ILLEGAL_REQUEST) || host_byte(pcmd->result) & DID_ERROR )
-	    {
-	       /* device not present: remove */ 
-	       //dc390_Going_remove (pDCB, pSRB);
-	       dc390_remove_dev (pACB, pDCB); DCB_removed = 1;
-	       
-	       if( (pcmd->device->id == pACB->pScsiHost->max_id - 1) &&
-		  ((pcmd->device->lun == 0) || (pcmd->device->lun == pACB->pScsiHost->max_lun - 1)) )
-		 pACB->scan_devices = 0;
-	    }
-	    else
-	    {
-	        /* device present: add */
-		if( (pcmd->device->id == pACB->pScsiHost->max_id - 1) && 
-		    (pcmd->device->lun == pACB->pScsiHost->max_lun - 1) )
-		    pACB->scan_devices = END_SCAN ;
-	        /* pACB->DeviceCnt++; */ /* Dev is added on INQUIRY */
-	    }
 	}
     }
-   
-    //if( pSRB->pcmd->cmnd[0] == INQUIRY && 
-    //  (host_byte(pcmd->result) == DID_OK || status_byte(pcmd->result) & CHECK_CONDITION) )
+
     if( pcmd->cmnd[0] == INQUIRY && 
 	(pcmd->result == (DID_OK << 16) || status_byte(pcmd->result) & CHECK_CONDITION) )
      {
-	if ((ptr->DevType & SCSI_DEVTYPE) == TYPE_NODEV && !DCB_removed)
-	  {
-	     //printk ("DC390: Type = nodev! (%02i-%i)\n", pcmd->target, pcmd->lun);
-	     /* device not present: remove */
-	     //dc390_Going_remove (pDCB, pSRB);
-	     dc390_remove_dev (pACB, pDCB); DCB_removed = 1;
-	  }
-	else
+	if ((ptr->DevType & SCSI_DEVTYPE) != TYPE_NODEV)
 	  {
 	     /* device found: add */ 
 	     dc390_add_dev (pACB, pDCB, ptr);
-	     if (pACB->scan_devices) pACB->DeviceCnt++;
 	  }
-	if( (pcmd->device->id == pACB->pScsiHost->max_id - 1) &&
-	    (pcmd->device->lun == pACB->pScsiHost->max_lun - 1) )
-	  pACB->scan_devices = 0;
-     };
+     }
 
     pcmd->resid = pcmd->request_bufflen - pSRB->TotalXferredLen;
 
-    if (!DCB_removed) dc390_Going_remove (pDCB, pSRB);
+    dc390_Going_remove (pDCB, pSRB);
     /* Add to free list */
     dc390_Free_insert (pACB, pSRB);
 
@@ -1625,13 +1567,13 @@ ckc_e:
 
 
 /* Remove all SRBs from Going list and inform midlevel */
-void
-dc390_DoingSRB_Done( PACB pACB, PSCSICMD cmd )
+static void
+dc390_DoingSRB_Done(struct dc390_acb* pACB, struct scsi_cmnd *cmd)
 {
-    PDCB   pDCB, pdcb;
-    PSRB   psrb, psrb2;
-    UCHAR  i;
-    PSCSICMD pcmd;
+    struct dc390_dcb *pDCB, *pdcb;
+    struct dc390_srb *psrb, *psrb2;
+    u8  i;
+    struct scsi_cmnd *pcmd;
 
     pDCB = pACB->pLinkDCB;
     pdcb = pDCB;
@@ -1667,7 +1609,7 @@ dc390_DoingSRB_Done( PACB pACB, PSCSICMD cmd )
 
 
 static void
-dc390_ResetSCSIBus( PACB pACB )
+dc390_ResetSCSIBus( struct dc390_acb* pACB )
 {
     //DC390_write8 (ScsiCmd, RST_DEVICE_CMD);
     //udelay (250);
@@ -1682,7 +1624,7 @@ dc390_ResetSCSIBus( PACB pACB )
 }
 
 static void
-dc390_ScsiRstDetect( PACB pACB )
+dc390_ScsiRstDetect( struct dc390_acb* pACB )
 {
     printk ("DC390: Rst_Detect: laststat = %08x\n", dc390_laststatus);
     //DEBUG0(printk(KERN_INFO "RST_DETECT,"));
@@ -1715,9 +1657,9 @@ dc390_ScsiRstDetect( PACB pACB )
 
 
 static void __inline__
-dc390_RequestSense( PACB pACB, PDCB pDCB, PSRB pSRB )
+dc390_RequestSense( struct dc390_acb* pACB, struct dc390_dcb* pDCB, struct dc390_srb* pSRB )
 {
-    PSCSICMD  pcmd;
+    struct scsi_cmnd *pcmd;
 
     pcmd = pSRB->pcmd;
 
@@ -1725,9 +1667,9 @@ dc390_RequestSense( PACB pACB, PDCB pDCB, PSRB pSRB )
 	    pcmd->cmnd[0], pDCB->TargetID, pDCB->TargetLUN));
 
     pSRB->SRBFlag |= AUTO_REQSENSE;
-    //pSRB->Segment0[0] = (UINT) pSRB->CmdBlock[0];
-    //pSRB->Segment0[1] = (UINT) pSRB->CmdBlock[4];
-    //pSRB->Segment1[0] = ((UINT)(pcmd->cmd_len) << 8) + pSRB->SGcount;
+    //pSRB->Segment0[0] = (u32) pSRB->CmdBlock[0];
+    //pSRB->Segment0[1] = (u32) pSRB->CmdBlock[4];
+    //pSRB->Segment1[0] = ((u32)(pcmd->cmd_len) << 8) + pSRB->SGcount;
     //pSRB->Segment1[1] = pSRB->TotalXferredLen;
     pSRB->SavedSGCount = pcmd->use_sg;
     pSRB->SavedTotXLen = pSRB->TotalXferredLen;
@@ -1740,8 +1682,8 @@ dc390_RequestSense( PACB pACB, PDCB pDCB, PSRB pSRB )
 
     //pSRB->CmdBlock[0] = REQUEST_SENSE;
     //pSRB->CmdBlock[1] = pDCB->TargetLUN << 5;
-    //(USHORT) pSRB->CmdBlock[2] = 0;
-    //(USHORT) pSRB->CmdBlock[4] = sizeof(pcmd->sense_buffer);
+    //(u16) pSRB->CmdBlock[2] = 0;
+    //(u16) pSRB->CmdBlock[4] = sizeof(pcmd->sense_buffer);
     //pSRB->ScsiCmdLen = 6;
 
     pSRB->TotalXferredLen = 0;
@@ -1755,9 +1697,8 @@ dc390_RequestSense( PACB pACB, PDCB pDCB, PSRB pSRB )
 
 
 static void __inline__
-dc390_InvalidCmd( PACB pACB )
+dc390_InvalidCmd( struct dc390_acb* pACB )
 {
     if( pACB->pActiveDCB->pActiveSRB->SRBState & (SRB_START_+SRB_MSGOUT) )
 	DC390_write8 (ScsiCmd, CLEAR_FIFO_CMD);
 }
-
diff --git a/drivers/scsi/sd.c b/drivers/scsi/sd.c
index 9d29d78e1..8fd459060 100644
--- a/drivers/scsi/sd.c
+++ b/drivers/scsi/sd.c
@@ -44,18 +44,20 @@
 #include <linux/errno.h>
 #include <linux/interrupt.h>
 #include <linux/init.h>
-#include <linux/reboot.h>
-#include <linux/vmalloc.h>
 #include <linux/blkdev.h>
 #include <linux/blkpg.h>
 #include <linux/kref.h>
 #include <asm/uaccess.h>
 
-#include "scsi.h"
-#include "hosts.h"
-
+#include <scsi/scsi.h>
+#include <scsi/scsi_cmnd.h>
+#include <scsi/scsi_dbg.h>
+#include <scsi/scsi_device.h>
 #include <scsi/scsi_driver.h>
+#include <scsi/scsi_eh.h>
+#include <scsi/scsi_host.h>
 #include <scsi/scsi_ioctl.h>
+#include <scsi/scsi_request.h>
 #include <scsi/scsicam.h>
 
 #include "scsi_logging.h"
@@ -592,7 +594,7 @@ static int sd_ioctl(struct inode * inode, struct file * filp,
 		case SCSI_IOCTL_GET_BUS_NUMBER:
 			return scsi_ioctl(sdp, cmd, p);
 		default:
-			error = scsi_cmd_ioctl(disk, cmd, p);
+			error = scsi_cmd_ioctl(filp, disk, cmd, p);
 			if (error != -ENOTTY)
 				return error;
 	}
@@ -763,13 +765,13 @@ static void sd_rw_intr(struct scsi_cmnd * SCpnt)
 				good_bytes = 0;
 			break;
 
-		case RECOVERED_ERROR:
+		case RECOVERED_ERROR: /* an error occurred, but it recovered */
+		case NO_SENSE: /* LLDD got sense data */
 			/*
-			 * An error occurred, but it recovered.  Inform the
-			 * user, but make sure that it's not treated as a
-			 * hard error.
+			 * Inform the user, but make sure that it's not treated
+			 * as a hard error.
 			 */
-			print_sense("sd", SCpnt);
+			scsi_print_sense("sd", SCpnt);
 			SCpnt->result = 0;
 			SCpnt->sense_buffer[0] = 0x0;
 			good_bytes = this_count;
@@ -918,7 +920,7 @@ sd_spinup_disk(struct scsi_disk *sdkp, char *diskname,
 			 * probably pointless to loop */
 			if(!spintime) {
 				printk(KERN_NOTICE "%s: Unit Not Ready, sense:\n", diskname);
-				print_req_sense("", SRpnt);
+				scsi_print_req_sense("", SRpnt);
 			}
 			break;
 		}
@@ -987,7 +989,7 @@ repeat:
 		       driver_byte(the_result));
 
 		if (driver_byte(the_result) & DRIVER_SENSE)
-			print_req_sense("sd", SRpnt);
+			scsi_print_req_sense("sd", SRpnt);
 		else
 			printk("%s : sense not available. \n", diskname);
 
@@ -1542,7 +1544,7 @@ static void sd_shutdown(struct device *dev)
 				    status_byte(res), msg_byte(res),
 				    host_byte(res), driver_byte(res));
 			if (driver_byte(res) & DRIVER_SENSE)
-				print_req_sense("sd", sreq);
+				scsi_print_req_sense("sd", sreq);
 	}
 	
 	scsi_release_request(sreq);
diff --git a/drivers/scsi/seagate.c b/drivers/scsi/seagate.c
index 3a73cc7e6..43102408d 100644
--- a/drivers/scsi/seagate.c
+++ b/drivers/scsi/seagate.c
@@ -103,7 +103,7 @@
 #include <asm/uaccess.h>
 
 #include "scsi.h"
-#include "hosts.h"
+#include <scsi/scsi_host.h>
 #include "seagate.h"
 
 #include <scsi/scsi_ioctl.h>
diff --git a/drivers/scsi/sg.c b/drivers/scsi/sg.c
index 5db8178c3..7b0665d8b 100644
--- a/drivers/scsi/sg.c
+++ b/drivers/scsi/sg.c
@@ -42,7 +42,6 @@ static int sg_version_num = 30531;	/* 2 digits for each component */
 #include <linux/fcntl.h>
 #include <linux/init.h>
 #include <linux/poll.h>
-#include <linux/vmalloc.h>
 #include <linux/smp_lock.h>
 #include <linux/moduleparam.h>
 #include <linux/devfs_fs_kernel.h>
@@ -51,7 +50,7 @@ static int sg_version_num = 30531;	/* 2 digits for each component */
 
 #include <linux/blkdev.h>
 #include "scsi.h"
-#include "hosts.h"
+#include <scsi/scsi_host.h>
 #include <scsi/scsi_driver.h>
 #include <scsi/scsi_ioctl.h>
 #include <scsi/sg.h>
@@ -60,7 +59,7 @@ static int sg_version_num = 30531;	/* 2 digits for each component */
 
 #ifdef CONFIG_SCSI_PROC_FS
 #include <linux/proc_fs.h>
-static char *sg_version_date = "20040513";
+static char *sg_version_date = "20040516";
 
 static int sg_proc_init(void);
 static void sg_proc_cleanup(void);
@@ -73,7 +72,7 @@ static void sg_proc_cleanup(void);
 #define SG_ALLOW_DIO_DEF 0
 #define SG_ALLOW_DIO_CODE /* compile out by commenting this define */
 
-#define SG_MAX_DEVS 8192
+#define SG_MAX_DEVS 32768
 
 /*
  * Suppose you want to calculate the formula muldiv(x,m,d)=int(x * m / d)
@@ -235,6 +234,7 @@ sg_open(struct inode *inode, struct file *filp)
 	int res;
 	int retval;
 
+	nonseekable_open(inode, filp);
 	SCSI_LOG_TIMEOUT(3, printk("sg_open: dev=%d, flags=0x%x\n", dev, flags));
 	sdp = sg_get_dev(dev);
 	if ((!sdp) || (!sdp->device))
@@ -344,7 +344,6 @@ sg_read(struct file *filp, char __user *buf, size_t count, loff_t * ppos)
 		return -ENXIO;
 	SCSI_LOG_TIMEOUT(3, printk("sg_read: %s, count=%d\n",
 				   sdp->disk->disk_name, (int) count));
-	if (ppos != &filp->f_pos) ;	/* FIXME: Hmm.  Seek to the right place, or fail?  */
 	if ((k = verify_area(VERIFY_WRITE, buf, count)))
 		return k;
 	if (sfp->force_packid && (count >= SZ_SG_HEADER)) {
@@ -502,7 +501,6 @@ sg_write(struct file *filp, const char __user *buf, size_t count, loff_t * ppos)
 	if (!((filp->f_flags & O_NONBLOCK) ||
 	      scsi_block_when_processing_errors(sdp->device)))
 		return -ENXIO;
-	if (ppos != &filp->f_pos) ;	/* FIXME: Hmm.  Seek to the right place, or fail?  */
 
 	if ((k = verify_area(VERIFY_READ, buf, count)))
 		return k;	/* protects following copy_from_user()s + get_user()s */
@@ -718,10 +716,22 @@ sg_common_write(Sg_fd * sfp, Sg_request * srp,
 		    (void *) SRpnt->sr_buffer, hp->dxfer_len,
 		    sg_cmd_done, timeout, SG_DEFAULT_RETRIES);
 	/* dxfer_len overwrites SRpnt->sr_bufflen, hence need for b_malloc_len */
-	generic_unplug_device(q);
 	return 0;
 }
 
+static inline unsigned
+sg_jif_to_ms(int jifs)
+{
+	if (jifs <= 0)
+		return 0U;
+	else {
+		unsigned int j = (unsigned int) jifs;
+		return (j <
+			(UINT_MAX / 1000)) ? ((j * 1000) / HZ) : ((j / HZ) *
+								  1000);
+	}
+}
+
 static int
 sg_ioctl(struct inode *inode, struct file *filp,
 	 unsigned int cmd_in, unsigned long arg)
@@ -1331,9 +1341,11 @@ static int sg_alloc(struct gendisk *disk, struct scsi_device *scsidp)
 	void *old_sg_dev_arr = NULL;
 	int k, error;
 
-	sdp = vmalloc(sizeof(Sg_device));
-	if (!sdp)
+	sdp = kmalloc(sizeof(Sg_device), GFP_KERNEL);
+	if (!sdp) {
+		printk(KERN_WARNING "kmalloc Sg_device failure\n");
 		return -ENOMEM;
+	}
 
 	write_lock_irqsave(&sg_dev_arr_lock, iflags);
 	if (unlikely(sg_nr_dev >= sg_dev_max)) {	/* try to resize */
@@ -1341,7 +1353,7 @@ static int sg_alloc(struct gendisk *disk, struct scsi_device *scsidp)
 		int tmp_dev_max = sg_nr_dev + SG_DEV_ARR_LUMP;
 		write_unlock_irqrestore(&sg_dev_arr_lock, iflags);
 
-		tmp_da = vmalloc(tmp_dev_max * sizeof(Sg_device *));
+		tmp_da = kmalloc(tmp_dev_max * sizeof(Sg_device *), GFP_KERNEL);
 		if (unlikely(!tmp_da))
 			goto expand_failed;
 
@@ -1375,12 +1387,12 @@ static int sg_alloc(struct gendisk *disk, struct scsi_device *scsidp)
 
  out:
 	if (error < 0)
-		vfree(sdp);
-	vfree(old_sg_dev_arr);
+		kfree(sdp);
+	kfree(old_sg_dev_arr);
 	return error;
 
  expand_failed:
-	printk(KERN_ERR "sg_alloc: device array cannot be resized\n");
+	printk(KERN_WARNING "sg_alloc: device array cannot be resized\n");
 	error = -ENOMEM;
 	goto out;
 
@@ -1404,20 +1416,26 @@ sg_add(struct class_device *cl_dev)
 	int error, k;
 
 	disk = alloc_disk(1);
-	if (!disk)
+	if (!disk) {
+		printk(KERN_WARNING "alloc_disk failed\n");
 		return -ENOMEM;
+	}
 	disk->major = SCSI_GENERIC_MAJOR;
 
 	error = -ENOMEM;
 	cdev = cdev_alloc();
-	if (!cdev)
+	if (!cdev) {
+		printk(KERN_WARNING "cdev_alloc failed\n");
 		goto out;
+	}
 	cdev->owner = THIS_MODULE;
 	cdev->ops = &sg_fops;
 
 	error = sg_alloc(disk, scsidp);
-	if (error < 0)
+	if (error < 0) {
+		printk(KERN_WARNING "sg_alloc failed\n");
 		goto out;
+	}
 	k = error;
 	sdp = sg_dev_arr[k];
 
@@ -1525,7 +1543,7 @@ sg_remove(struct class_device *cl_dev)
 		put_disk(sdp->disk);
 		sdp->disk = NULL;
 		if (NULL == sdp->headfp)
-			vfree((char *) sdp);
+			kfree((char *) sdp);
 	}
 
 	if (delay)
@@ -1590,7 +1608,7 @@ exit_sg(void)
 	unregister_chrdev_region(MKDEV(SCSI_GENERIC_MAJOR, 0),
 				 SG_MAX_DEVS);
 	if (sg_dev_arr != NULL) {
-		vfree((char *) sg_dev_arr);
+		kfree((char *) sg_dev_arr);
 		sg_dev_arr = NULL;
 	}
 	sg_dev_max = 0;
@@ -2398,7 +2416,7 @@ sg_add_sfp(Sg_device * sdp, int dev)
 	Sg_fd *sfp;
 	unsigned long iflags;
 
-	sfp = (Sg_fd *) sg_page_malloc(sizeof (Sg_fd), 0, 0);
+	sfp = (Sg_fd *) sg_page_malloc(sizeof (Sg_fd), 0, NULL);
 	if (!sfp)
 		return NULL;
 	memset(sfp, 0, sizeof (Sg_fd));
@@ -2492,7 +2510,7 @@ sg_remove_sfp(Sg_device * sdp, Sg_fd * sfp)
 			}
 			if (k < maxd)
 				sg_dev_arr[k] = NULL;
-			vfree((char *) sdp);
+			kfree((char *) sdp);
 			res = 1;
 		}
 		write_unlock_irqrestore(&sg_dev_arr_lock, iflags);
@@ -2580,19 +2598,6 @@ sg_ms_to_jif(unsigned int msecs)
 		    : (((int) msecs / 1000) * HZ);
 }
 
-static inline unsigned
-sg_jif_to_ms(int jifs)
-{
-	if (jifs <= 0)
-		return 0U;
-	else {
-		unsigned int j = (unsigned int) jifs;
-		return (j <
-			(UINT_MAX / 1000)) ? ((j * 1000) / HZ) : ((j / HZ) *
-								  1000);
-	}
-}
-
 static unsigned char allow_ops[] = { TEST_UNIT_READY, REQUEST_SENSE,
 	INQUIRY, READ_CAPACITY, READ_BUFFER, READ_6, READ_10, READ_12,
 	MODE_SENSE, MODE_SENSE_10, LOG_SENSE
@@ -2808,7 +2813,7 @@ sg_proc_write_adio(struct file *filp, const char __user *buffer,
 	if (copy_from_user(buff, buffer, num))
 		return -EFAULT;
 	buff[num] = '\0';
-	sg_allow_dio = simple_strtoul(buff, 0, 10) ? 1 : 0;
+	sg_allow_dio = simple_strtoul(buff, NULL, 10) ? 1 : 0;
 	return count;
 }
 
@@ -2831,7 +2836,7 @@ sg_proc_write_dressz(struct file *filp, const char __user *buffer,
 	if (copy_from_user(buff, buffer, num))
 		return -EFAULT;
 	buff[num] = '\0';
-	k = simple_strtoul(buff, 0, 10);
+	k = simple_strtoul(buff, NULL, 10);
 	if (k <= 1048576) {	/* limit "big buff" to 1 MB */
 		sg_big_buff = k;
 		return count;
diff --git a/drivers/scsi/sgiwd93.c b/drivers/scsi/sgiwd93.c
index dd5627cbe..270f2aa88 100644
--- a/drivers/scsi/sgiwd93.c
+++ b/drivers/scsi/sgiwd93.c
@@ -31,7 +31,7 @@
 #include <asm/io.h>
 
 #include "scsi.h"
-#include "hosts.h"
+#include <scsi/scsi_host.h>
 #include "wd33c93.h"
 #include "sgiwd93.h"
 
diff --git a/drivers/scsi/sim710.c b/drivers/scsi/sim710.c
index 2a833d3e5..f73bf835d 100644
--- a/drivers/scsi/sim710.c
+++ b/drivers/scsi/sim710.c
@@ -35,9 +35,8 @@
 #include <linux/mca.h>
 #include <linux/eisa.h>
 #include <linux/interrupt.h>
+#include <scsi/scsi_host.h>
 
-#include "scsi.h"
-#include "hosts.h"
 #include "53c700.h"
 
 
@@ -86,7 +85,7 @@ param_setup(char *str)
 }
 __setup("sim710=", param_setup);
 
-static Scsi_Host_Template sim710_driver_template = {
+static struct scsi_host_template sim710_driver_template = {
 	.name			= "LSI (Symbios) 710 MCA/EISA",
 	.proc_name		= "sim710",
 	.this_id		= 7,
diff --git a/drivers/scsi/sr.c b/drivers/scsi/sr.c
index 9c3ddba40..b80aa283c 100644
--- a/drivers/scsi/sr.c
+++ b/drivers/scsi/sr.c
@@ -46,11 +46,14 @@
 #include <linux/blkdev.h>
 #include <asm/uaccess.h>
 
-#include "scsi.h"
-#include "hosts.h"
-
+#include <scsi/scsi.h>
+#include <scsi/scsi_dbg.h>
+#include <scsi/scsi_device.h>
 #include <scsi/scsi_driver.h>
+#include <scsi/scsi_eh.h>
+#include <scsi/scsi_host.h>
 #include <scsi/scsi_ioctl.h>	/* For the door lock/unlock commands */
+#include <scsi/scsi_request.h>
 
 #include "scsi_logging.h"
 #include "sr.h"
@@ -180,7 +183,7 @@ int sr_media_change(struct cdrom_device_info *cdi, int slot)
 		return -EINVAL;
 	}
 
-	retval = scsi_ioctl(cd->device, SCSI_IOCTL_TEST_UNIT_READY, 0);
+	retval = scsi_ioctl(cd->device, SCSI_IOCTL_TEST_UNIT_READY, NULL);
 	if (retval) {
 		/* Unable to test, unit probably not ready.  This usually
 		 * means there is no disc in the drive.  Mark as changed,
@@ -282,7 +285,7 @@ static void rw_intr(struct scsi_cmnd * SCpnt)
 			 * user, but make sure that it's not treated as a
 			 * hard error.
 			 */
-			print_sense("sr", SCpnt);
+			scsi_print_sense("sr", SCpnt);
 			SCpnt->result = 0;
 			SCpnt->sense_buffer[0] = 0x0;
 			good_bytes = this_count;
@@ -335,11 +338,11 @@ static int sr_init_command(struct scsi_cmnd * SCpnt)
 
 		memcpy(SCpnt->cmnd, rq->cmd, sizeof(SCpnt->cmnd));
 		if (!rq->data_len)
-			SCpnt->sc_data_direction = SCSI_DATA_NONE;
+			SCpnt->sc_data_direction = DMA_NONE;
 		else if (rq_data_dir(rq) == WRITE)
-			SCpnt->sc_data_direction = SCSI_DATA_WRITE;
+			SCpnt->sc_data_direction = DMA_TO_DEVICE;
 		else
-			SCpnt->sc_data_direction = SCSI_DATA_READ;
+			SCpnt->sc_data_direction = DMA_FROM_DEVICE;
 
 		this_count = rq->data_len;
 		if (rq->timeout)
@@ -375,10 +378,10 @@ static int sr_init_command(struct scsi_cmnd * SCpnt)
 		if (!cd->device->writeable)
 			return 0;
 		SCpnt->cmnd[0] = WRITE_10;
-		SCpnt->sc_data_direction = SCSI_DATA_WRITE;
+		SCpnt->sc_data_direction = DMA_TO_DEVICE;
 	} else if (rq_data_dir(SCpnt->request) == READ) {
 		SCpnt->cmnd[0] = READ_10;
-		SCpnt->sc_data_direction = SCSI_DATA_READ;
+		SCpnt->sc_data_direction = DMA_FROM_DEVICE;
 	} else {
 		blk_dump_rq_flags(SCpnt->request, "Unknown sr command");
 		return 0;
@@ -501,7 +504,7 @@ static int sr_block_ioctl(struct inode *inode, struct file *file, unsigned cmd,
                 case SCSI_IOCTL_GET_BUS_NUMBER:
                         return scsi_ioctl(sdev, cmd, (void __user *)arg);
 	}
-	return cdrom_ioctl(&cd->cdi, inode, cmd, arg);
+	return cdrom_ioctl(file, &cd->cdi, inode, cmd, arg);
 }
 
 static int sr_block_media_changed(struct gendisk *disk)
@@ -674,7 +677,7 @@ static void get_sectorsize(struct scsi_cd *cd)
 		memset(buffer, 0, 8);
 
 		/* Do the command and wait.. */
-		SRpnt->sr_data_direction = SCSI_DATA_READ;
+		SRpnt->sr_data_direction = DMA_FROM_DEVICE;
 		scsi_wait_req(SRpnt, (void *) cmd, (void *) buffer,
 			      8, SR_TIMEOUT, MAX_RETRIES);
 
@@ -754,12 +757,11 @@ Enomem:
 static void get_capabilities(struct scsi_cd *cd)
 {
 	unsigned char *buffer;
-	int rc, n, mrw_write = 0, mrw = 1,ram_write=0;
 	struct scsi_mode_data data;
 	struct scsi_request *SRpnt;
 	unsigned char cmd[MAX_COMMAND_SIZE];
 	unsigned int the_result;
-	int retries;
+	int retries, rc, n;
 
 	static char *loadmech[] =
 	{
@@ -773,9 +775,6 @@ static void get_capabilities(struct scsi_cd *cd)
 		""
 	};
 
-	/* Set read only initially */
-	set_disk_ro(cd->disk, 1);
-
 	/* allocate a request for the TEST_UNIT_READY */
 	SRpnt = scsi_allocate_request(cd->device, GFP_KERNEL);
 	if (!SRpnt) {
@@ -831,19 +830,6 @@ static void get_capabilities(struct scsi_cd *cd)
 		return;
 	}
 
-	if (cdrom_is_mrw(&cd->cdi, &mrw_write)) {
-		mrw = 0;
-		cd->cdi.mask |= CDC_MRW;
-		cd->cdi.mask |= CDC_MRW_W;
-	}
-	if (!mrw_write)
-		cd->cdi.mask |= CDC_MRW_W;
-
-	if (cdrom_is_random_writable(&cd->cdi, &ram_write))
-		cd->cdi.mask |= CDC_RAM;
-	if (!ram_write)
-		cd->cdi.mask |= CDC_RAM;
-
 	n = data.header_length + data.block_descriptor_length;
 	cd->cdi.speed = ((buffer[n + 8] << 8) + buffer[n + 9]) / 176;
 	cd->readcd_known = 1;
@@ -896,7 +882,6 @@ static void get_capabilities(struct scsi_cd *cd)
 	if ((cd->cdi.mask & (CDC_DVD_RAM | CDC_MRW_W | CDC_RAM)) !=
 			(CDC_DVD_RAM | CDC_MRW_W | CDC_RAM)) {
 		cd->device->writeable = 1;
-		set_disk_ro(cd->disk, 0);
 	}
 
 	scsi_release_request(SRpnt);
diff --git a/drivers/scsi/sr.h b/drivers/scsi/sr.h
index bfbabb6a4..0b3178007 100644
--- a/drivers/scsi/sr.h
+++ b/drivers/scsi/sr.h
@@ -17,18 +17,20 @@
 #ifndef _SR_H
 #define _SR_H
 
-#include "scsi.h"
 #include <linux/genhd.h>
 #include <linux/kref.h>
 
+struct scsi_device;
+
 /* The CDROM is fairly slow, so we need a little extra time */
 /* In fact, it is very slow if it has to spin up first */
 #define IOCTL_TIMEOUT 30*HZ
 
+
 typedef struct scsi_cd {
 	struct scsi_driver *driver;
 	unsigned capacity;	/* size in blocks                       */
-	Scsi_Device *device;
+	struct scsi_device *device;
 	unsigned int vendor;	/* vendor code, see sr_vendor.c         */
 	unsigned long ms_offset;	/* for reading multisession-CD's        */
 	unsigned needs_sector_size:1;	/* needs to get sector size */
diff --git a/drivers/scsi/sr_ioctl.c b/drivers/scsi/sr_ioctl.c
index 3fc83dc73..7d24b57c2 100644
--- a/drivers/scsi/sr_ioctl.c
+++ b/drivers/scsi/sr_ioctl.c
@@ -10,9 +10,13 @@
 #include <asm/io.h>
 #include <asm/uaccess.h>
 
-#include "scsi.h"
-#include "hosts.h"
+#include <scsi/scsi.h>
+#include <scsi/scsi_dbg.h>
+#include <scsi/scsi_device.h>
+#include <scsi/scsi_eh.h>
+#include <scsi/scsi_host.h>
 #include <scsi/scsi_ioctl.h>
+#include <scsi/scsi_request.h>
 
 #include "sr.h"
 
@@ -65,7 +69,7 @@ static int sr_fake_playtrkind(struct cdrom_device_info *cdi, struct cdrom_ti *ti
 	cgc.cmd[6] = trk1_te.cdte_addr.msf.minute;
 	cgc.cmd[7] = trk1_te.cdte_addr.msf.second;
 	cgc.cmd[8] = trk1_te.cdte_addr.msf.frame;
-	cgc.data_direction = SCSI_DATA_NONE;
+	cgc.data_direction = DMA_NONE;
 	cgc.timeout = IOCTL_TIMEOUT;
 	return sr_do_ioctl(cdi->handle, &cgc);
 }
@@ -138,7 +142,7 @@ int sr_do_ioctl(Scsi_CD *cd, struct packet_command *cgc)
 			if (!cgc->quiet)
 				printk(KERN_INFO "%s: CDROM not ready.  Make sure there is a disc in the drive.\n", cd->cdi.name);
 #ifdef DEBUG
-			print_req_sense("sr", SRpnt);
+			scsi_print_req_sense("sr", SRpnt);
 #endif
 			err = -ENOMEDIUM;
 			break;
@@ -149,14 +153,14 @@ int sr_do_ioctl(Scsi_CD *cd, struct packet_command *cgc)
 				/* sense: Invalid command operation code */
 				err = -EDRIVE_CANT_DO_THIS;
 #ifdef DEBUG
-			print_command(cgc->cmd);
-			print_req_sense("sr", SRpnt);
+			__scsi_print_command(cgc->cmd);
+			scsi_print_req_sense("sr", SRpnt);
 #endif
 			break;
 		default:
 			printk(KERN_ERR "%s: CDROM (ioctl) error, command: ", cd->cdi.name);
-			print_command(cgc->cmd);
-			print_req_sense("sr", SRpnt);
+			__scsi_print_command(cgc->cmd);
+			scsi_print_req_sense("sr", SRpnt);
 			err = -EIO;
 		}
 	}
@@ -183,7 +187,7 @@ static int test_unit_ready(Scsi_CD *cd)
 	memset(&cgc, 0, sizeof(struct packet_command));
 	cgc.cmd[0] = GPCMD_TEST_UNIT_READY;
 	cgc.quiet = 1;
-	cgc.data_direction = SCSI_DATA_NONE;
+	cgc.data_direction = DMA_NONE;
 	cgc.timeout = IOCTL_TIMEOUT;
 	return sr_do_ioctl(cd, &cgc);
 }
@@ -196,7 +200,7 @@ int sr_tray_move(struct cdrom_device_info *cdi, int pos)
 	memset(&cgc, 0, sizeof(struct packet_command));
 	cgc.cmd[0] = GPCMD_START_STOP_UNIT;
 	cgc.cmd[4] = (pos == 0) ? 0x03 /* close */ : 0x02 /* eject */ ;
-	cgc.data_direction = SCSI_DATA_NONE;
+	cgc.data_direction = DMA_NONE;
 	cgc.timeout = IOCTL_TIMEOUT;
 	return sr_do_ioctl(cd, &cgc);
 }
@@ -280,7 +284,7 @@ int sr_get_mcn(struct cdrom_device_info *cdi, struct cdrom_mcn *mcn)
 	cgc.cmd[8] = 24;
 	cgc.buffer = buffer;
 	cgc.buflen = 24;
-	cgc.data_direction = SCSI_DATA_READ;
+	cgc.data_direction = DMA_FROM_DEVICE;
 	cgc.timeout = IOCTL_TIMEOUT;
 	result = sr_do_ioctl(cd, &cgc);
 
@@ -310,7 +314,7 @@ int sr_select_speed(struct cdrom_device_info *cdi, int speed)
 	cgc.cmd[0] = GPCMD_SET_SPEED;	/* SET CD SPEED */
 	cgc.cmd[2] = (speed >> 8) & 0xff;	/* MSB for speed (in kbytes/sec) */
 	cgc.cmd[3] = speed & 0xff;	/* LSB */
-	cgc.data_direction = SCSI_DATA_NONE;
+	cgc.data_direction = DMA_NONE;
 	cgc.timeout = IOCTL_TIMEOUT;
 
 	if (sr_do_ioctl(cd, &cgc))
@@ -331,6 +335,9 @@ int sr_audio_ioctl(struct cdrom_device_info *cdi, unsigned int cmd, void *arg)
 	int result;
 	unsigned char *buffer = kmalloc(32, GFP_KERNEL | SR_GFP_DMA(cd));
 
+	if (!buffer)
+		return -ENOMEM;
+
 	memset(&cgc, 0, sizeof(struct packet_command));
 	cgc.timeout = IOCTL_TIMEOUT;
 
@@ -344,7 +351,7 @@ int sr_audio_ioctl(struct cdrom_device_info *cdi, unsigned int cmd, void *arg)
 			cgc.buffer = buffer;
 			cgc.buflen = 12;
 			cgc.quiet = 1;
-			cgc.data_direction = SCSI_DATA_READ;
+			cgc.data_direction = DMA_FROM_DEVICE;
 
 			result = sr_do_ioctl(cd, &cgc);
 
@@ -364,7 +371,7 @@ int sr_audio_ioctl(struct cdrom_device_info *cdi, unsigned int cmd, void *arg)
 			cgc.cmd[8] = 12;		/* LSB of length */
 			cgc.buffer = buffer;
 			cgc.buflen = 12;
-			cgc.data_direction = SCSI_DATA_READ;
+			cgc.data_direction = DMA_FROM_DEVICE;
 
 			result = sr_do_ioctl(cd, &cgc);
 
@@ -390,7 +397,7 @@ int sr_audio_ioctl(struct cdrom_device_info *cdi, unsigned int cmd, void *arg)
 		cgc.cmd[5] = ti->cdti_ind0;
 		cgc.cmd[7] = ti->cdti_trk1;
 		cgc.cmd[8] = ti->cdti_ind1;
-		cgc.data_direction = SCSI_DATA_NONE;
+		cgc.data_direction = DMA_NONE;
 
 		result = sr_do_ioctl(cd, &cgc);
 		if (result == -EDRIVE_CANT_DO_THIS)
@@ -459,7 +466,7 @@ static int sr_read_cd(Scsi_CD *cd, unsigned char *dest, int lba, int format, int
 	}
 	cgc.buffer = dest;
 	cgc.buflen = blksize;
-	cgc.data_direction = SCSI_DATA_READ;
+	cgc.data_direction = DMA_FROM_DEVICE;
 	cgc.timeout = IOCTL_TIMEOUT;
 	return sr_do_ioctl(cd, &cgc);
 }
@@ -500,7 +507,7 @@ static int sr_read_sector(Scsi_CD *cd, int lba, int blksize, unsigned char *dest
 	cgc.cmd[8] = 1;
 	cgc.buffer = dest;
 	cgc.buflen = blksize;
-	cgc.data_direction = SCSI_DATA_READ;
+	cgc.data_direction = DMA_FROM_DEVICE;
 	cgc.timeout = IOCTL_TIMEOUT;
 	rc = sr_do_ioctl(cd, &cgc);
 
diff --git a/drivers/scsi/sr_vendor.c b/drivers/scsi/sr_vendor.c
index 2f7894e70..78274dc91 100644
--- a/drivers/scsi/sr_vendor.c
+++ b/drivers/scsi/sr_vendor.c
@@ -35,16 +35,18 @@
  */
 
 #include <linux/config.h>
+#include <linux/cdrom.h>
 #include <linux/errno.h>
 #include <linux/string.h>
 #include <linux/bcd.h>
-
 #include <linux/blkdev.h>
-#include "scsi.h"
-#include "hosts.h"
+
+#include <scsi/scsi.h>
+#include <scsi/scsi_cmnd.h>
+#include <scsi/scsi_device.h>
+#include <scsi/scsi_host.h>
 #include <scsi/scsi_ioctl.h>
 
-#include <linux/cdrom.h>
 #include "sr.h"
 
 #if 0
@@ -135,7 +137,7 @@ int sr_set_blocklength(Scsi_CD *cd, int blocklength)
 	modesel->block_length_lo = blocklength & 0xff;
 	cgc.buffer = buffer;
 	cgc.buflen = sizeof(*modesel);
-	cgc.data_direction = SCSI_DATA_WRITE;
+	cgc.data_direction = DMA_TO_DEVICE;
 	cgc.timeout = VENDOR_TIMEOUT;
 	if (0 == (rc = sr_do_ioctl(cd, &cgc))) {
 		cd->device->sector_size = blocklength;
@@ -182,7 +184,7 @@ int sr_cd_check(struct cdrom_device_info *cdi)
 		cgc.buffer = buffer;
 		cgc.buflen = 12;
 		cgc.quiet = 1;
-		cgc.data_direction = SCSI_DATA_READ;
+		cgc.data_direction = DMA_FROM_DEVICE;
 		cgc.timeout = VENDOR_TIMEOUT;
 		rc = sr_do_ioctl(cd, &cgc);
 		if (rc != 0)
@@ -210,7 +212,7 @@ int sr_cd_check(struct cdrom_device_info *cdi)
 			cgc.buffer = buffer;
 			cgc.buflen = 0x16;
 			cgc.quiet = 1;
-			cgc.data_direction = SCSI_DATA_READ;
+			cgc.data_direction = DMA_FROM_DEVICE;
 			cgc.timeout = VENDOR_TIMEOUT;
 			rc = sr_do_ioctl(cd, &cgc);
 			if (rc != 0)
@@ -239,7 +241,7 @@ int sr_cd_check(struct cdrom_device_info *cdi)
 			cgc.buffer = buffer;
 			cgc.buflen = 4;
 			cgc.quiet = 1;
-			cgc.data_direction = SCSI_DATA_READ;
+			cgc.data_direction = DMA_FROM_DEVICE;
 			cgc.timeout = VENDOR_TIMEOUT;
 			rc = sr_do_ioctl(cd, &cgc);
 			if (rc == -EINVAL) {
@@ -268,7 +270,7 @@ int sr_cd_check(struct cdrom_device_info *cdi)
 		cgc.buffer = buffer;
 		cgc.buflen = 0x04;
 		cgc.quiet = 1;
-		cgc.data_direction = SCSI_DATA_READ;
+		cgc.data_direction = DMA_FROM_DEVICE;
 		cgc.timeout = VENDOR_TIMEOUT;
 		rc = sr_do_ioctl(cd, &cgc);
 		if (rc != 0) {
@@ -286,7 +288,7 @@ int sr_cd_check(struct cdrom_device_info *cdi)
 		cgc.buffer = buffer;
 		cgc.buflen = 12;
 		cgc.quiet = 1;
-		cgc.data_direction = SCSI_DATA_READ;
+		cgc.data_direction = DMA_FROM_DEVICE;
 		cgc.timeout = VENDOR_TIMEOUT;
 		rc = sr_do_ioctl(cd, &cgc);
 		if (rc != 0) {
diff --git a/drivers/scsi/st.c b/drivers/scsi/st.c
index 0e2891593..5fa0153da 100644
--- a/drivers/scsi/st.c
+++ b/drivers/scsi/st.c
@@ -58,7 +58,7 @@ static char *verstr = "20040403";
 
 
 #include "scsi.h"
-#include "hosts.h"
+#include <scsi/scsi_host.h>
 
 #include <scsi/scsi_driver.h>
 #include <scsi/scsi_ioctl.h>
@@ -1001,6 +1001,7 @@ static int st_open(struct inode *inode, struct file *filp)
 	int dev = TAPE_NR(inode);
 	char *name;
 
+	nonseekable_open(inode, filp);
 	write_lock(&st_dev_arr_lock);
 	if (dev >= st_dev_max || scsi_tapes == NULL ||
 	    ((STp = scsi_tapes[dev]) == NULL)) {
@@ -1203,7 +1204,7 @@ static int st_release(struct inode *inode, struct file *filp)
 }
 
 /* The checks common to both reading and writing */
-static ssize_t rw_checks(Scsi_Tape *STp, struct file *filp, size_t count, loff_t *ppos)
+static ssize_t rw_checks(Scsi_Tape *STp, struct file *filp, size_t count)
 {
 	ssize_t retval = 0;
 
@@ -1218,12 +1219,6 @@ static ssize_t rw_checks(Scsi_Tape *STp, struct file *filp, size_t count, loff_t
 		goto out;
 	}
 
-	if (ppos != &filp->f_pos) {
-		/* "A request was outside the capabilities of the device." */
-		retval = (-ENXIO);
-		goto out;
-	}
-
 	if (STp->ready != ST_READY) {
 		if (STp->ready == ST_NO_TAPE)
 			retval = (-ENOMEDIUM);
@@ -1367,7 +1362,7 @@ st_write(struct file *filp, const char __user *buf, size_t count, loff_t * ppos)
 	if (down_interruptible(&STp->lock))
 		return -ERESTARTSYS;
 
-	retval = rw_checks(STp, filp, count, ppos);
+	retval = rw_checks(STp, filp, count);
 	if (retval || count == 0)
 		goto out;
 
@@ -1833,7 +1828,7 @@ st_read(struct file *filp, char __user *buf, size_t count, loff_t * ppos)
 	if (down_interruptible(&STp->lock))
 		return -ERESTARTSYS;
 
-	retval = rw_checks(STp, filp, count, ppos);
+	retval = rw_checks(STp, filp, count);
 	if (retval || count == 0)
 		goto out;
 
@@ -3413,7 +3408,7 @@ static int st_ioctl(struct inode *inode, struct file *file,
 		case SCSI_IOCTL_GET_BUS_NUMBER:
 			break;
 		default:
-			i = scsi_cmd_ioctl(STp->disk, cmd_in, p);
+			i = scsi_cmd_ioctl(file, STp->disk, cmd_in, p);
 			if (i != -ENOTTY)
 				return i;
 			break;
@@ -3974,7 +3969,7 @@ static int st_remove(struct device *dev)
 	for (i = 0; i < st_dev_max; i++) {
 		tpnt = scsi_tapes[i];
 		if (tpnt != NULL && tpnt->device == SDp) {
-			scsi_tapes[i] = 0;
+			scsi_tapes[i] = NULL;
 			st_nr_dev--;
 			write_unlock(&st_dev_arr_lock);
 			devfs_unregister_tape(tpnt->disk->number);
diff --git a/drivers/scsi/sun3_scsi.c b/drivers/scsi/sun3_scsi.c
index e8b76276c..f1070c80a 100644
--- a/drivers/scsi/sun3_scsi.c
+++ b/drivers/scsi/sun3_scsi.c
@@ -75,7 +75,7 @@
 #define REAL_DMA
 
 #include "scsi.h"
-#include "hosts.h"
+#include <scsi/scsi_host.h>
 #include "sun3_scsi.h"
 #include "NCR5380.h"
 
diff --git a/drivers/scsi/sun3_scsi_vme.c b/drivers/scsi/sun3_scsi_vme.c
index f82831b79..4cf3e2e7d 100644
--- a/drivers/scsi/sun3_scsi_vme.c
+++ b/drivers/scsi/sun3_scsi_vme.c
@@ -41,7 +41,7 @@
 #define REAL_DMA
 
 #include "scsi.h"
-#include "hosts.h"
+#include <scsi/scsi_host.h>
 #include "sun3_scsi.h"
 #include "NCR5380.h"
 
diff --git a/drivers/scsi/sun3x_esp.c b/drivers/scsi/sun3x_esp.c
index 985a9ef8b..f2b934cd9 100644
--- a/drivers/scsi/sun3x_esp.c
+++ b/drivers/scsi/sun3x_esp.c
@@ -16,7 +16,7 @@
 #include <linux/interrupt.h>
 
 #include "scsi.h"
-#include "hosts.h"
+#include <scsi/scsi_host.h>
 #include "NCR53C9x.h"
 
 #include <asm/sun3x.h>
diff --git a/drivers/scsi/sym53c416.c b/drivers/scsi/sym53c416.c
index de21eabe9..de5cc5912 100644
--- a/drivers/scsi/sym53c416.c
+++ b/drivers/scsi/sym53c416.c
@@ -43,7 +43,7 @@
 #include <linux/blkdev.h>
 #include <linux/isapnp.h>
 #include "scsi.h"
-#include "hosts.h"
+#include <scsi/scsi_host.h>
 #include "sym53c416.h"
 
 #define VERSION_STRING        "Version 1.0.0-ac"
@@ -622,12 +622,13 @@ void sym53c416_probe(void)
 	int ints[2];
 
 	ints[0] = 1;
-	for(; *base; base++)
-	{
-		if(!check_region(*base, IO_RANGE) && sym53c416_test(*base))
-		{
-			ints[1] = *base;
-			sym53c416_setup(NULL, ints);
+	for(; *base; base++) {
+		if (request_region(*base, IO_RANGE, ID)) {
+			if (sym53c416_test(*base)) {
+				ints[1] = *base;
+				sym53c416_setup(NULL, ints);
+			}
+			release_region(*base, IO_RANGE);
 		}
 	}
 }
@@ -702,44 +703,42 @@ int __init sym53c416_detect(Scsi_Host_Template *tpnt)
 	sym53c416_probe();
 
 	/* Now we register and set up each host adapter found... */
-	for(count = 0, i = 0; i < host_index; i++)
-	{
-		if(!sym53c416_test(hosts[i].base))
+	for(count = 0, i = 0; i < host_index; i++) {
+		if (!request_region(hosts[i].base, IO_RANGE, ID))
+			continue;
+		if (!sym53c416_test(hosts[i].base)) {
 			printk(KERN_WARNING "No sym53c416 found at address 0x%03x\n", hosts[i].base);
-		else
-		{
-			if(hosts[i].irq == 0)
-			/* We don't have an irq yet, so we should probe for one */
-				if((hosts[i].irq = sym53c416_probeirq(hosts[i].base, hosts[i].scsi_id)) == 0)
-					printk(KERN_WARNING "IRQ autoprobing failed for sym53c416 at address 0x%03x\n", hosts[i].base);
-			if(hosts[i].irq && !check_region(hosts[i].base, IO_RANGE))
-			{
-				shpnt = scsi_register(tpnt, 0);
-				if(shpnt==NULL)
-					continue;
-				spin_lock_irqsave(&sym53c416_lock, flags);
-				/* Request for specified IRQ */
-				if(request_irq(hosts[i].irq, sym53c416_intr_handle, 0, ID, shpnt))
-				{
-					spin_unlock_irqrestore(&sym53c416_lock, flags);
-					printk(KERN_ERR "sym53c416: Unable to assign IRQ %d\n", hosts[i].irq);
-					scsi_unregister(shpnt);
-				}
-				else
-				{
-					/* Inform the kernel of our IO range */
-					request_region(hosts[i].base, IO_RANGE, ID);
-					shpnt->unique_id = hosts[i].base;
-					shpnt->io_port = hosts[i].base;
-					shpnt->n_io_port = IO_RANGE;
-					shpnt->irq = hosts[i].irq;
-					shpnt->this_id = hosts[i].scsi_id;
-					sym53c416_init(hosts[i].base, hosts[i].scsi_id);
-					count++;
-					spin_unlock_irqrestore(&sym53c416_lock, flags);
-				}
-			}
+			goto fail_release_region;
 		}
+
+		/* We don't have an irq yet, so we should probe for one */
+		if (!hosts[i].irq)
+			hosts[i].irq = sym53c416_probeirq(hosts[i].base, hosts[i].scsi_id);
+		if (!hosts[i].irq)
+			goto fail_release_region;
+	
+		shpnt = scsi_register(tpnt, 0);
+		if (!shpnt)
+			goto fail_release_region;
+		/* Request for specified IRQ */
+		if (request_irq(hosts[i].irq, sym53c416_intr_handle, 0, ID, shpnt))
+			goto fail_free_host;
+
+		spin_lock_irqsave(&sym53c416_lock, flags);
+		shpnt->unique_id = hosts[i].base;
+		shpnt->io_port = hosts[i].base;
+		shpnt->n_io_port = IO_RANGE;
+		shpnt->irq = hosts[i].irq;
+		shpnt->this_id = hosts[i].scsi_id;
+		sym53c416_init(hosts[i].base, hosts[i].scsi_id);
+		count++;
+		spin_unlock_irqrestore(&sym53c416_lock, flags);
+		continue;
+
+ fail_free_host:
+		scsi_unregister(shpnt);
+ fail_release_region:
+		release_region(hosts[i].base, IO_RANGE);
 	}
 	return count;
 }
diff --git a/drivers/scsi/sym53c8xx_2/sym_fw.c b/drivers/scsi/sym53c8xx_2/sym_fw.c
index 2494bf3d4..0c9eb07a1 100644
--- a/drivers/scsi/sym53c8xx_2/sym_fw.c
+++ b/drivers/scsi/sym53c8xx_2/sym_fw.c
@@ -383,7 +383,7 @@ sym_find_firmware(struct sym_pci_chip *chip)
 		return &sym_fw1;
 #endif
 	else
-		return 0;
+		return NULL;
 }
 
 /*
diff --git a/drivers/scsi/sym53c8xx_2/sym_glue.c b/drivers/scsi/sym53c8xx_2/sym_glue.c
index 3eafcb8d3..22238315d 100644
--- a/drivers/scsi/sym53c8xx_2/sym_glue.c
+++ b/drivers/scsi/sym53c8xx_2/sym_glue.c
@@ -868,7 +868,7 @@ static void __sym_eh_done(struct scsi_cmnd *cmd, int timed_out)
 	}
 
 	/* Revert everything */
-	SYM_UCMD_PTR(cmd)->eh_wait = 0;
+	SYM_UCMD_PTR(cmd)->eh_wait = NULL;
 	cmd->scsi_done = ep->old_done;
 
 	/* Wake up the eh thread if it wants to sleep */
@@ -965,7 +965,7 @@ prepare:
 
 	/* On error, restore everything and cross fingers :) */
 	if (sts) {
-		SYM_UCMD_PTR(cmd)->eh_wait = 0;
+		SYM_UCMD_PTR(cmd)->eh_wait = NULL;
 		cmd->scsi_done = ep->old_done;
 		to_do = SYM_EH_DO_IGNORE;
 	}
@@ -1568,7 +1568,7 @@ static int sym53c8xx_proc_info(struct Scsi_Host *host, char *buffer,
 			char **start, off_t offset, int length, int func)
 {
 	struct host_data *host_data;
-	struct sym_hcb *np = 0;
+	struct sym_hcb *np = NULL;
 	int retv;
 
 	host_data = (struct host_data *) host->hostdata;
@@ -1915,7 +1915,7 @@ static inline void sym_get_nvram(struct sym_device *devp, struct sym_nvram *nvp)
 static struct sym_driver_setup
 	sym_driver_safe_setup __initdata = SYM_LINUX_DRIVER_SAFE_SETUP;
 #ifdef	MODULE
-char *sym53c8xx = 0;	/* command line passed by insmod */
+char *sym53c8xx;	/* command line passed by insmod */
 MODULE_PARM(sym53c8xx, "s");
 #endif
 
diff --git a/drivers/scsi/sym53c8xx_2/sym_glue.h b/drivers/scsi/sym53c8xx_2/sym_glue.h
index 3ff1e6568..60d48b750 100644
--- a/drivers/scsi/sym53c8xx_2/sym_glue.h
+++ b/drivers/scsi/sym53c8xx_2/sym_glue.h
@@ -481,7 +481,7 @@ void sym_mfree(void *m, int size, char *name);
 
 static __inline m_addr_t sym_m_get_dma_mem_cluster(m_pool_p mp, m_vtob_p vbp)
 {
-	void *vaddr = 0;
+	void *vaddr = NULL;
 	dma_addr_t baddr = 0;
 
 	vaddr = pci_alloc_consistent(mp->dev_dmat,SYM_MEM_CLUSTER_SIZE, &baddr);
diff --git a/drivers/scsi/sym53c8xx_2/sym_hipd.c b/drivers/scsi/sym53c8xx_2/sym_hipd.c
index c4f6c265f..25a27f998 100644
--- a/drivers/scsi/sym53c8xx_2/sym_hipd.c
+++ b/drivers/scsi/sym53c8xx_2/sym_hipd.c
@@ -1302,7 +1302,7 @@ static void sym_log_hard_error(hcb_p np, u_short sist, u_char dstat)
 	} else {
 		script_ofs	= dsp;
 		script_size	= 0;
-		script_base	= 0;
+		script_base	= NULL;
 		script_name	= "mem";
 	}
 
@@ -1440,7 +1440,7 @@ sym_lookup_pci_chip_table (u_short device_id, u_char revision)
 		return chip;
 	}
 
-	return 0;
+	return NULL;
 }
 
 #if SYM_CONF_DMA_ADDRESSING_MODE == 2
@@ -2490,7 +2490,7 @@ static void sym_int_ma (hcb_p np)
 	 *  try to find the interrupted script command,
 	 *  and the address at which to continue.
 	 */
-	vdsp	= 0;
+	vdsp	= NULL;
 	nxtdsp	= 0;
 	if	(dsp >  np->scripta_ba &&
 		 dsp <= np->scripta_ba + np->scripta_sz) {
@@ -3400,7 +3400,7 @@ static void sym_sir_task_recovery(hcb_p np, int num)
 		 *  we are not in race.
 		 */
 		i = 0;
-		cp = 0;
+		cp = NULL;
 		FOR_EACH_QUEUED_ELEMENT(&np->busy_ccbq, qp) {
 			cp = sym_que_entry(qp, struct sym_ccb, link_ccbq);
 			if (cp->host_status != HS_BUSY &&
@@ -3516,7 +3516,7 @@ static void sym_sir_task_recovery(hcb_p np, int num)
 		 *  abort for this target.
 		 */
 		i = 0;
-		cp = 0;
+		cp = NULL;
 		FOR_EACH_QUEUED_ELEMENT(&np->busy_ccbq, qp) {
 			cp = sym_que_entry(qp, struct sym_ccb, link_ccbq);
 			if (cp->host_status != HS_DISCONNECT)
@@ -3698,7 +3698,7 @@ static int sym_evaluate_dp(hcb_p np, ccb_p cp, u32 scr, int *ofs)
 	else if (dp_scr == SCRIPTA_BA (np, pm1_data))
 		pm = &cp->phys.pm1;
 	else
-		pm = 0;
+		pm = NULL;
 
 	if (pm) {
 		dp_scr  = scr_to_cpu(pm->ret);
@@ -4946,7 +4946,7 @@ void sym_free_ccb (hcb_p np, ccb_p cp)
 	 *  used for negotiation, clear this info in the tcb.
 	 */
 	if (cp == tp->nego_cp)
-		tp->nego_cp = 0;
+		tp->nego_cp = NULL;
 
 #ifdef SYM_CONF_IARB_SUPPORT
 	/*
@@ -4965,7 +4965,7 @@ void sym_free_ccb (hcb_p np, ccb_p cp)
 	/*
 	 *  Make this CCB available.
 	 */
-	cp->cam_ccb = 0;
+	cp->cam_ccb = NULL;
 	cp->host_status = HS_IDLE;
 	sym_remque(&cp->link_ccbq);
 	sym_insque_head(&cp->link_ccbq, &np->free_ccbq);
@@ -4997,7 +4997,7 @@ void sym_free_ccb (hcb_p np, ccb_p cp)
  */
 static ccb_p sym_alloc_ccb(hcb_p np)
 {
-	ccb_p cp = 0;
+	ccb_p cp = NULL;
 	int hcode;
 
 	/*
@@ -5005,7 +5005,7 @@ static ccb_p sym_alloc_ccb(hcb_p np)
 	 *  queue to the controller.
 	 */
 	if (np->actccbs >= SYM_CONF_MAX_START)
-		return 0;
+		return NULL;
 
 	/*
 	 *  Allocate memory for this CCB.
@@ -5076,7 +5076,7 @@ out_free:
 			sym_mfree_dma(cp->sns_bbuf,SYM_SNS_BBUF_LEN,"SNS_BBUF");
 		sym_mfree_dma(cp, sizeof(*cp), "CCB");
 	}
-	return 0;
+	return NULL;
 }
 
 /*
@@ -5134,7 +5134,7 @@ lcb_p sym_alloc_lcb (hcb_p np, u_char tn, u_char ln)
 	 *  allocation for not probed LUNs.
 	 */
 	if (!sym_is_bit(tp->lun_map, ln))
-		return 0;
+		return NULL;
 
 	/*
 	 *  Initialize the target control block if not yet.
@@ -5242,7 +5242,7 @@ static void sym_alloc_lcb_tags (hcb_p np, u_char tn, u_char ln)
 	lp->cb_tags = sym_calloc(SYM_CONF_MAX_TASK, "CB_TAGS");
 	if (!lp->cb_tags) {
 		sym_mfree_dma(lp->itlq_tbl, SYM_CONF_MAX_TASK*4, "ITLQ_TBL");
-		lp->itlq_tbl = 0;
+		lp->itlq_tbl = NULL;
 		goto fail;
 	}
 
@@ -5471,7 +5471,7 @@ int sym_abort_scsiio(hcb_p np, cam_ccb_p ccb, int timed_out)
 	/*
 	 *  Look up our CCB control block.
 	 */
-	cp = 0;
+	cp = NULL;
 	FOR_EACH_QUEUED_ELEMENT(&np->busy_ccbq, qp) {
 		ccb_p cp2 = sym_que_entry(qp, struct sym_ccb, link_ccbq);
 		if (cp2->cam_ccb == ccb) {
diff --git a/drivers/scsi/sym53c8xx_2/sym_hipd.h b/drivers/scsi/sym53c8xx_2/sym_hipd.h
index 1e136a2b9..aa246dd0f 100644
--- a/drivers/scsi/sym53c8xx_2/sym_hipd.h
+++ b/drivers/scsi/sym53c8xx_2/sym_hipd.h
@@ -613,10 +613,10 @@ struct sym_pmc {
  *  LUN(s) > 0.
  */
 #if SYM_CONF_MAX_LUN <= 1
-#define sym_lp(np, tp, lun) (!lun) ? (tp)->lun0p : 0
+#define sym_lp(np, tp, lun) (!lun) ? (tp)->lun0p : NULL
 #else
 #define sym_lp(np, tp, lun) \
-	(!lun) ? (tp)->lun0p : (tp)->lunmp ? (tp)->lunmp[(lun)] : 0
+	(!lun) ? (tp)->lun0p : (tp)->lunmp ? (tp)->lunmp[(lun)] : NULL
 #endif
 
 /*
diff --git a/drivers/scsi/sym53c8xx_2/sym_malloc.c b/drivers/scsi/sym53c8xx_2/sym_malloc.c
index 6641f35f8..c0df21ca2 100644
--- a/drivers/scsi/sym53c8xx_2/sym_malloc.c
+++ b/drivers/scsi/sym53c8xx_2/sym_malloc.c
@@ -83,7 +83,7 @@ static void *___sym_malloc(m_pool_p mp, int size)
 	m_link_p h = mp->h;
 
 	if (size > SYM_MEM_CLUSTER_SIZE)
-		return 0;
+		return NULL;
 
 	while (size > s) {
 		s <<= 1;
@@ -95,7 +95,7 @@ static void *___sym_malloc(m_pool_p mp, int size)
 		if (s == SYM_MEM_CLUSTER_SIZE) {
 			h[j].next = (m_link_p) M_GET_MEM_CLUSTER();
 			if (h[j].next)
-				h[j].next->next = 0;
+				h[j].next->next = NULL;
 			break;
 		}
 		++j;
@@ -108,7 +108,7 @@ static void *___sym_malloc(m_pool_p mp, int size)
 			j -= 1;
 			s >>= 1;
 			h[j].next = (m_link_p) (a+s);
-			h[j].next->next = 0;
+			h[j].next->next = NULL;
 		}
 	}
 #ifdef DEBUG
@@ -225,10 +225,10 @@ static void ___mp0_free_mem_cluster(m_pool_p mp, m_addr_t m)
 
 #ifdef	SYM_MEM_FREE_UNUSED
 static struct sym_m_pool mp0 =
-	{0, ___mp0_get_mem_cluster, ___mp0_free_mem_cluster};
+	{NULL, ___mp0_get_mem_cluster, ___mp0_free_mem_cluster};
 #else
 static struct sym_m_pool mp0 =
-	{0, ___mp0_get_mem_cluster};
+	{NULL, ___mp0_get_mem_cluster};
 #endif
 
 /*
@@ -310,7 +310,7 @@ static __inline m_pool_p ___get_dma_pool(m_pool_ident_t dev_dmat)
 /* Create a new memory DMAable pool (when fetch failed) */
 static m_pool_p ___cre_dma_pool(m_pool_ident_t dev_dmat)
 {
-	m_pool_p mp = 0;
+	m_pool_p mp = NULL;
 
 	mp = __sym_calloc(&mp0, sizeof(*mp), "MPOOL");
 	if (mp) {
@@ -327,7 +327,7 @@ static m_pool_p ___cre_dma_pool(m_pool_ident_t dev_dmat)
 	}
 	if (mp)
 		__sym_mfree(&mp0, mp, sizeof(*mp), "MPOOL");
-	return 0;
+	return NULL;
 }
 
 #ifdef	SYM_MEM_FREE_UNUSED
@@ -352,7 +352,7 @@ static void ___del_dma_pool(m_pool_p p)
 void *__sym_calloc_dma_unlocked(m_pool_ident_t dev_dmat, int size, char *name)
 {
 	m_pool_p mp;
-	void *m = 0;
+	void *m = NULL;
 
 	mp = ___get_dma_pool(dev_dmat);
 	if (!mp)
@@ -392,7 +392,7 @@ u32 __vtobus_unlocked(m_pool_ident_t dev_dmat, void *m)
 {
 	m_pool_p mp;
 	int hc = VTOB_HASH_CODE(m);
-	m_vtob_p vp = 0;
+	m_vtob_p vp = NULL;
 	m_addr_t a = ((m_addr_t) m) & ~SYM_MEM_CLUSTER_MASK;
 
 	mp = ___get_dma_pool(dev_dmat);
diff --git a/drivers/scsi/sym53c8xx_2/sym_misc.h b/drivers/scsi/sym53c8xx_2/sym_misc.h
index d8320da66..4568f0c22 100644
--- a/drivers/scsi/sym53c8xx_2/sym_misc.h
+++ b/drivers/scsi/sym53c8xx_2/sym_misc.h
@@ -151,7 +151,7 @@ static __inline struct sym_quehead *sym_remque_head(struct sym_quehead *head)
 	if (elem != head)
 		__sym_que_del(head, elem->flink);
 	else
-		elem = 0;
+		elem = NULL;
 	return elem;
 }
 
diff --git a/drivers/scsi/sym53c8xx_2/sym_nvram.c b/drivers/scsi/sym53c8xx_2/sym_nvram.c
index cfaa02c11..2bb4b3f3e 100644
--- a/drivers/scsi/sym53c8xx_2/sym_nvram.c
+++ b/drivers/scsi/sym53c8xx_2/sym_nvram.c
@@ -330,7 +330,7 @@ static void S24C16_write_ack(struct sym_device *np, u_char write_bit, u_char *gp
 			    u_char *gpcntl)
 {
 	OUTB (nc_gpcntl, *gpcntl & 0xfe);
-	S24C16_do_bit(np, 0, write_bit, gpreg);
+	S24C16_do_bit(np, NULL, write_bit, gpreg);
 	OUTB (nc_gpcntl, *gpcntl);
 }
 
@@ -356,7 +356,7 @@ static void S24C16_write_byte(struct sym_device *np, u_char *ack_data, u_char wr
 	int x;
 	
 	for (x = 0; x < 8; x++)
-		S24C16_do_bit(np, 0, (write_data >> (7 - x)) & 0x01, gpreg);
+		S24C16_do_bit(np, NULL, (write_data >> (7 - x)) & 0x01, gpreg);
 		
 	S24C16_read_ack(np, ack_data, gpreg, gpcntl);
 }
diff --git a/drivers/scsi/sym53c8xx_comm.h b/drivers/scsi/sym53c8xx_comm.h
index ce819093a..640802075 100644
--- a/drivers/scsi/sym53c8xx_comm.h
+++ b/drivers/scsi/sym53c8xx_comm.h
@@ -71,8 +71,6 @@
 **==========================================================
 */
 
-#define SCSI_NCR_DYNAMIC_DMA_MAPPING
-
 /*==========================================================
 **
 **	Miscallaneous defines.
@@ -81,22 +79,12 @@
 */
 
 #define u_char		unsigned char
-#define u_short		unsigned short
-#define u_int		unsigned int
 #define u_long		unsigned long
 
-#ifndef bcmp
-#define bcmp(s, d, n)	memcmp((d), (s), (n))
-#endif
-
 #ifndef bzero
 #define bzero(d, n)	memset((d), 0, (n))
 #endif
  
-#ifndef offsetof
-#define offsetof(t, m)	((size_t) (&((t *)0)->m))
-#endif
-
 /*==========================================================
 **
 **	assert ()
@@ -222,7 +210,7 @@ static inline struct xpt_quehead *xpt_remque_head(struct xpt_quehead *head)
 	if (elem != head)
 		__xpt_que_del(head, elem->flink);
 	else
-		elem = 0;
+		elem = NULL;
 	return elem;
 }
 
@@ -353,7 +341,6 @@ typedef struct m_link {		/* Link between free memory chunks */
 	struct m_link *next;
 } m_link_s;
 
-#ifdef	SCSI_NCR_DYNAMIC_DMA_MAPPING
 typedef struct m_vtob {		/* Virtual to Bus address translation */
 	struct m_vtob *next;
 	m_addr_t vaddr;
@@ -364,10 +351,8 @@ typedef struct m_vtob {		/* Virtual to Bus address translation */
 #define VTOB_HASH_MASK		(VTOB_HASH_SIZE-1)
 #define VTOB_HASH_CODE(m)	\
 	((((m_addr_t) (m)) >> MEMO_CLUSTER_SHIFT) & VTOB_HASH_MASK)
-#endif
 
 typedef struct m_pool {		/* Memory pool of a given kind */
-#ifdef	SCSI_NCR_DYNAMIC_DMA_MAPPING
 	m_bush_t bush;
 	m_addr_t (*getp)(struct m_pool *);
 	void (*freep)(struct m_pool *, m_addr_t);
@@ -378,10 +363,6 @@ typedef struct m_pool {		/* Memory pool of a given kind */
 	int nump;
 	m_vtob_s *(vtob[VTOB_HASH_SIZE]);
 	struct m_pool *next;
-#else
-#define M_GETP()		__GetFreePages(MEMO_GFP_FLAGS, MEMO_PAGE_ORDER)
-#define M_FREEP(p)		free_pages(p, MEMO_PAGE_ORDER)
-#endif	/* SCSI_NCR_DYNAMIC_DMA_MAPPING */
 	struct m_link h[PAGE_SHIFT-MEMO_SHIFT+MEMO_PAGE_ORDER+1];
 } m_pool_s;
 
@@ -394,7 +375,7 @@ static void *___m_alloc(m_pool_s *mp, int size)
 	m_link_s *h = mp->h;
 
 	if (size > (PAGE_SIZE << MEMO_PAGE_ORDER))
-		return 0;
+		return NULL;
 
 	while (size > s) {
 		s <<= 1;
@@ -406,7 +387,7 @@ static void *___m_alloc(m_pool_s *mp, int size)
 		if (s == (PAGE_SIZE << MEMO_PAGE_ORDER)) {
 			h[j].next = (m_link_s *) M_GETP();
 			if (h[j].next)
-				h[j].next->next = 0;
+				h[j].next->next = NULL;
 			break;
 		}
 		++j;
@@ -419,7 +400,7 @@ static void *___m_alloc(m_pool_s *mp, int size)
 			j -= 1;
 			s >>= 1;
 			h[j].next = (m_link_s *) (a+s);
-			h[j].next->next = 0;
+			h[j].next->next = NULL;
 		}
 	}
 #ifdef DEBUG
@@ -508,12 +489,6 @@ static void __m_free(m_pool_s *mp, void *ptr, int size, char *name)
  * memory accessed by the PCI chip. `mp0' is the default not DMAable pool.
  */
 
-#ifndef	SCSI_NCR_DYNAMIC_DMA_MAPPING
-
-static m_pool_s mp0;
-
-#else
-
 static m_addr_t ___mp0_getp(m_pool_s *mp)
 {
 	m_addr_t m = GetPages();
@@ -528,24 +503,12 @@ static void ___mp0_freep(m_pool_s *mp, m_addr_t m)
 	--mp->nump;
 }
 
-static m_pool_s mp0 = {0, ___mp0_getp, ___mp0_freep};
-
-#endif	/* SCSI_NCR_DYNAMIC_DMA_MAPPING */
+static m_pool_s mp0 = {NULL, ___mp0_getp, ___mp0_freep};
 
 /*
  * DMAable pools.
  */
 
-#ifndef	SCSI_NCR_DYNAMIC_DMA_MAPPING
-
-/* Without pci bus iommu support, all the memory is assumed DMAable */
-
-#define __m_calloc_dma(b, s, n)		m_calloc(s, n)
-#define __m_free_dma(b, p, s, n)	m_free(p, s, n)
-#define __vtobus(b, p)			virt_to_bus(p)
-
-#else
-
 /*
  * With pci bus iommu support, we maintain one pool per pcidev and a 
  * hashed reverse table for virtual to bus physical address translations.
@@ -632,7 +595,7 @@ static void *__m_calloc_dma(m_bush_t bush, int size, char *name)
 {
 	u_long flags;
 	struct m_pool *mp;
-	void *m = 0;
+	void *m = NULL;
 
 	NCR_LOCK_DRIVER(flags);
 	mp = ___get_dma_pool(bush);
@@ -666,7 +629,7 @@ static m_addr_t __vtobus(m_bush_t bush, void *m)
 	u_long flags;
 	m_pool_s *mp;
 	int hc = VTOB_HASH_CODE(m);
-	m_vtob_s *vp = 0;
+	m_vtob_s *vp = NULL;
 	m_addr_t a = ((m_addr_t) m) & ~MEMO_CLUSTER_MASK;
 
 	NCR_LOCK_DRIVER(flags);
@@ -680,8 +643,6 @@ static m_addr_t __vtobus(m_bush_t bush, void *m)
 	return vp ? vp->baddr + (((m_addr_t) m) - a) : 0;
 }
 
-#endif	/* SCSI_NCR_DYNAMIC_DMA_MAPPING */
-
 #define _m_calloc_dma(np, s, n)		__m_calloc_dma(np->dev, s, n)
 #define _m_free_dma(np, p, s, n)	__m_free_dma(np->dev, p, s, n)
 #define m_calloc_dma(s, n)		_m_calloc_dma(np, s, n)
@@ -693,23 +654,6 @@ static m_addr_t __vtobus(m_bush_t bush, void *m)
  *  Deal with DMA mapping/unmapping.
  */
 
-#ifndef SCSI_NCR_DYNAMIC_DMA_MAPPING
-
-/* Linux versions prior to pci bus iommu kernel interface */
-
-#define __unmap_scsi_data(dev, cmd)	do {; } while (0)
-#define __map_scsi_single_data(dev, cmd) (__vtobus(dev,(cmd)->request_buffer))
-#define __map_scsi_sg_data(dev, cmd)	((cmd)->use_sg)
-#define __sync_scsi_data_for_cpu(dev, cmd)	do {; } while (0)
-#define __sync_scsi_data_for_device(dev, cmd)	do {; } while (0)
-
-#define scsi_sg_dma_address(sc)		vtobus((sc)->address)
-#define scsi_sg_dma_len(sc)		((sc)->length)
-
-#else
-
-/* Linux version with pci bus iommu kernel interface */
-
 /* To keep track of the dma mapping (sg/single) that has been set */
 #define __data_mapped	SCp.phase
 #define __data_mapping	SCp.have_data_in
@@ -800,65 +744,14 @@ static void __sync_scsi_data_for_device(struct device *dev, Scsi_Cmnd *cmd)
 #define scsi_sg_dma_address(sc)		sg_dma_address(sc)
 #define scsi_sg_dma_len(sc)		sg_dma_len(sc)
 
-#endif	/* SCSI_NCR_DYNAMIC_DMA_MAPPING */
-
 #define unmap_scsi_data(np, cmd)	__unmap_scsi_data(np->dev, cmd)
 #define map_scsi_single_data(np, cmd)	__map_scsi_single_data(np->dev, cmd)
 #define map_scsi_sg_data(np, cmd)	__map_scsi_sg_data(np->dev, cmd)
 #define sync_scsi_data_for_cpu(np, cmd)	__sync_scsi_data_for_cpu(np->dev, cmd)
 #define sync_scsi_data_for_device(np, cmd) __sync_scsi_data_for_device(np->dev, cmd)
 
-/*==========================================================
-**
-**	SCSI data transfer direction
-**
-**	Until some linux kernel version near 2.3.40, 
-**	low-level scsi drivers were not told about data 
-**	transfer direction. We check the existence of this 
-**	feature that has been expected for a _long_ time by 
-**	all SCSI driver developers by just testing against 
-**	the definition of SCSI_DATA_UNKNOWN. Indeed this is 
-**	a hack, but testing against a kernel version would 
-**	have been a shame. ;-)
-**
-**==========================================================
-*/
-#ifdef	SCSI_DATA_UNKNOWN
-
 #define scsi_data_direction(cmd)	(cmd->sc_data_direction)
 
-#else
-
-#define	SCSI_DATA_UNKNOWN	0
-#define	SCSI_DATA_WRITE		1
-#define	SCSI_DATA_READ		2
-#define	SCSI_DATA_NONE		3
-
-static __inline__ int scsi_data_direction(Scsi_Cmnd *cmd)
-{
-	int direction;
-
-	switch((int) cmd->cmnd[0]) {
-	case 0x08:  /*	READ(6)				08 */
-	case 0x28:  /*	READ(10)			28 */
-	case 0xA8:  /*	READ(12)			A8 */
-		direction = SCSI_DATA_READ;
-		break;
-	case 0x0A:  /*	WRITE(6)			0A */
-	case 0x2A:  /*	WRITE(10)			2A */
-	case 0xAA:  /*	WRITE(12)			AA */
-		direction = SCSI_DATA_WRITE;
-		break;
-	default:
-		direction = SCSI_DATA_UNKNOWN;
-		break;
-	}
-
-	return direction;
-}
-
-#endif	/* SCSI_DATA_UNKNOWN */
-
 /*==========================================================
 **
 **	Driver setup.
@@ -881,602 +774,6 @@ static struct ncr_driver_setup
 #define bootverbose (np->verbose)
 
 
-/*==========================================================
-**
-**	NVRAM detection and reading.
-**	 
-**	Currently supported:
-**	- 24C16 EEPROM with both Symbios and Tekram layout.
-**	- 93C46 EEPROM with Tekram layout.
-**
-**==========================================================
-*/
-
-#ifdef SCSI_NCR_NVRAM_SUPPORT
-/*
- *  24C16 EEPROM reading.
- *
- *  GPOI0 - data in/data out
- *  GPIO1 - clock
- *  Symbios NVRAM wiring now also used by Tekram.
- */
-
-#define SET_BIT 0
-#define CLR_BIT 1
-#define SET_CLK 2
-#define CLR_CLK 3
-
-/*
- *  Set/clear data/clock bit in GPIO0
- */
-static void __init
-S24C16_set_bit(ncr_slot *np, u_char write_bit, u_char *gpreg, int bit_mode)
-{
-	UDELAY (5);
-	switch (bit_mode){
-	case SET_BIT:
-		*gpreg |= write_bit;
-		break;
-	case CLR_BIT:
-		*gpreg &= 0xfe;
-		break;
-	case SET_CLK:
-		*gpreg |= 0x02;
-		break;
-	case CLR_CLK:
-		*gpreg &= 0xfd;
-		break;
-
-	}
-	OUTB (nc_gpreg, *gpreg);
-	UDELAY (5);
-}
-
-/*
- *  Send START condition to NVRAM to wake it up.
- */
-static void __init S24C16_start(ncr_slot *np, u_char *gpreg)
-{
-	S24C16_set_bit(np, 1, gpreg, SET_BIT);
-	S24C16_set_bit(np, 0, gpreg, SET_CLK);
-	S24C16_set_bit(np, 0, gpreg, CLR_BIT);
-	S24C16_set_bit(np, 0, gpreg, CLR_CLK);
-}
-
-/*
- *  Send STOP condition to NVRAM - puts NVRAM to sleep... ZZzzzz!!
- */
-static void __init S24C16_stop(ncr_slot *np, u_char *gpreg)
-{
-	S24C16_set_bit(np, 0, gpreg, SET_CLK);
-	S24C16_set_bit(np, 1, gpreg, SET_BIT);
-}
-
-/*
- *  Read or write a bit to the NVRAM,
- *  read if GPIO0 input else write if GPIO0 output
- */
-static void __init 
-S24C16_do_bit(ncr_slot *np, u_char *read_bit, u_char write_bit, u_char *gpreg)
-{
-	S24C16_set_bit(np, write_bit, gpreg, SET_BIT);
-	S24C16_set_bit(np, 0, gpreg, SET_CLK);
-	if (read_bit)
-		*read_bit = INB (nc_gpreg);
-	S24C16_set_bit(np, 0, gpreg, CLR_CLK);
-	S24C16_set_bit(np, 0, gpreg, CLR_BIT);
-}
-
-/*
- *  Output an ACK to the NVRAM after reading,
- *  change GPIO0 to output and when done back to an input
- */
-static void __init
-S24C16_write_ack(ncr_slot *np, u_char write_bit, u_char *gpreg, u_char *gpcntl)
-{
-	OUTB (nc_gpcntl, *gpcntl & 0xfe);
-	S24C16_do_bit(np, 0, write_bit, gpreg);
-	OUTB (nc_gpcntl, *gpcntl);
-}
-
-/*
- *  Input an ACK from NVRAM after writing,
- *  change GPIO0 to input and when done back to an output
- */
-static void __init 
-S24C16_read_ack(ncr_slot *np, u_char *read_bit, u_char *gpreg, u_char *gpcntl)
-{
-	OUTB (nc_gpcntl, *gpcntl | 0x01);
-	S24C16_do_bit(np, read_bit, 1, gpreg);
-	OUTB (nc_gpcntl, *gpcntl);
-}
-
-/*
- *  WRITE a byte to the NVRAM and then get an ACK to see it was accepted OK,
- *  GPIO0 must already be set as an output
- */
-static void __init 
-S24C16_write_byte(ncr_slot *np, u_char *ack_data, u_char write_data, 
-		  u_char *gpreg, u_char *gpcntl)
-{
-	int x;
-	
-	for (x = 0; x < 8; x++)
-		S24C16_do_bit(np, 0, (write_data >> (7 - x)) & 0x01, gpreg);
-		
-	S24C16_read_ack(np, ack_data, gpreg, gpcntl);
-}
-
-/*
- *  READ a byte from the NVRAM and then send an ACK to say we have got it,
- *  GPIO0 must already be set as an input
- */
-static void __init 
-S24C16_read_byte(ncr_slot *np, u_char *read_data, u_char ack_data, 
-	         u_char *gpreg, u_char *gpcntl)
-{
-	int x;
-	u_char read_bit;
-
-	*read_data = 0;
-	for (x = 0; x < 8; x++) {
-		S24C16_do_bit(np, &read_bit, 1, gpreg);
-		*read_data |= ((read_bit & 0x01) << (7 - x));
-	}
-
-	S24C16_write_ack(np, ack_data, gpreg, gpcntl);
-}
-
-/*
- *  Read 'len' bytes starting at 'offset'.
- */
-static int __init 
-sym_read_S24C16_nvram (ncr_slot *np, int offset, u_char *data, int len)
-{
-	u_char	gpcntl, gpreg;
-	u_char	old_gpcntl, old_gpreg;
-	u_char	ack_data;
-	int	retv = 1;
-	int	x;
-
-	/* save current state of GPCNTL and GPREG */
-	old_gpreg	= INB (nc_gpreg);
-	old_gpcntl	= INB (nc_gpcntl);
-	gpcntl		= old_gpcntl & 0x1c;
-
-	/* set up GPREG & GPCNTL to set GPIO0 and GPIO1 in to known state */
-	OUTB (nc_gpreg,  old_gpreg);
-	OUTB (nc_gpcntl, gpcntl);
-
-	/* this is to set NVRAM into a known state with GPIO0/1 both low */
-	gpreg = old_gpreg;
-	S24C16_set_bit(np, 0, &gpreg, CLR_CLK);
-	S24C16_set_bit(np, 0, &gpreg, CLR_BIT);
-		
-	/* now set NVRAM inactive with GPIO0/1 both high */
-	S24C16_stop(np, &gpreg);
-	
-	/* activate NVRAM */
-	S24C16_start(np, &gpreg);
-
-	/* write device code and random address MSB */
-	S24C16_write_byte(np, &ack_data,
-		0xa0 | ((offset >> 7) & 0x0e), &gpreg, &gpcntl);
-	if (ack_data & 0x01)
-		goto out;
-
-	/* write random address LSB */
-	S24C16_write_byte(np, &ack_data,
-		offset & 0xff, &gpreg, &gpcntl);
-	if (ack_data & 0x01)
-		goto out;
-
-	/* regenerate START state to set up for reading */
-	S24C16_start(np, &gpreg);
-	
-	/* rewrite device code and address MSB with read bit set (lsb = 0x01) */
-	S24C16_write_byte(np, &ack_data,
-		0xa1 | ((offset >> 7) & 0x0e), &gpreg, &gpcntl);
-	if (ack_data & 0x01)
-		goto out;
-
-	/* now set up GPIO0 for inputting data */
-	gpcntl |= 0x01;
-	OUTB (nc_gpcntl, gpcntl);
-		
-	/* input all requested data - only part of total NVRAM */
-	for (x = 0; x < len; x++) 
-		S24C16_read_byte(np, &data[x], (x == (len-1)), &gpreg, &gpcntl);
-
-	/* finally put NVRAM back in inactive mode */
-	gpcntl &= 0xfe;
-	OUTB (nc_gpcntl, gpcntl);
-	S24C16_stop(np, &gpreg);
-	retv = 0;
-out:
-	/* return GPIO0/1 to original states after having accessed NVRAM */
-	OUTB (nc_gpcntl, old_gpcntl);
-	OUTB (nc_gpreg,  old_gpreg);
-
-	return retv;
-}
-
-#undef SET_BIT
-#undef CLR_BIT
-#undef SET_CLK
-#undef CLR_CLK
-
-/*
- *  Try reading Symbios NVRAM.
- *  Return 0 if OK.
- */
-static int __init sym_read_Symbios_nvram (ncr_slot *np, Symbios_nvram *nvram)
-{
-	static u_char Symbios_trailer[6] = {0xfe, 0xfe, 0, 0, 0, 0};
-	u_char *data = (u_char *) nvram;
-	int len  = sizeof(*nvram);
-	u_short	csum;
-	int x;
-
-	/* probe the 24c16 and read the SYMBIOS 24c16 area */
-	if (sym_read_S24C16_nvram (np, SYMBIOS_NVRAM_ADDRESS, data, len))
-		return 1;
-
-	/* check valid NVRAM signature, verify byte count and checksum */
-	if (nvram->type != 0 ||
-	    memcmp(nvram->trailer, Symbios_trailer, 6) ||
-	    nvram->byte_count != len - 12)
-		return 1;
-
-	/* verify checksum */
-	for (x = 6, csum = 0; x < len - 6; x++)
-		csum += data[x];
-	if (csum != nvram->checksum)
-		return 1;
-
-	return 0;
-}
-
-/*
- *  93C46 EEPROM reading.
- *
- *  GPOI0 - data in
- *  GPIO1 - data out
- *  GPIO2 - clock
- *  GPIO4 - chip select
- *
- *  Used by Tekram.
- */
-
-/*
- *  Pulse clock bit in GPIO0
- */
-static void __init T93C46_Clk(ncr_slot *np, u_char *gpreg)
-{
-	OUTB (nc_gpreg, *gpreg | 0x04);
-	UDELAY (2);
-	OUTB (nc_gpreg, *gpreg);
-}
-
-/* 
- *  Read bit from NVRAM
- */
-static void __init T93C46_Read_Bit(ncr_slot *np, u_char *read_bit, u_char *gpreg)
-{
-	UDELAY (2);
-	T93C46_Clk(np, gpreg);
-	*read_bit = INB (nc_gpreg);
-}
-
-/*
- *  Write bit to GPIO0
- */
-static void __init T93C46_Write_Bit(ncr_slot *np, u_char write_bit, u_char *gpreg)
-{
-	if (write_bit & 0x01)
-		*gpreg |= 0x02;
-	else
-		*gpreg &= 0xfd;
-		
-	*gpreg |= 0x10;
-		
-	OUTB (nc_gpreg, *gpreg);
-	UDELAY (2);
-
-	T93C46_Clk(np, gpreg);
-}
-
-/*
- *  Send STOP condition to NVRAM - puts NVRAM to sleep... ZZZzzz!!
- */
-static void __init T93C46_Stop(ncr_slot *np, u_char *gpreg)
-{
-	*gpreg &= 0xef;
-	OUTB (nc_gpreg, *gpreg);
-	UDELAY (2);
-
-	T93C46_Clk(np, gpreg);
-}
-
-/*
- *  Send read command and address to NVRAM
- */
-static void __init 
-T93C46_Send_Command(ncr_slot *np, u_short write_data, 
-		    u_char *read_bit, u_char *gpreg)
-{
-	int x;
-
-	/* send 9 bits, start bit (1), command (2), address (6)  */
-	for (x = 0; x < 9; x++)
-		T93C46_Write_Bit(np, (u_char) (write_data >> (8 - x)), gpreg);
-
-	*read_bit = INB (nc_gpreg);
-}
-
-/*
- *  READ 2 bytes from the NVRAM
- */
-static void __init 
-T93C46_Read_Word(ncr_slot *np, u_short *nvram_data, u_char *gpreg)
-{
-	int x;
-	u_char read_bit;
-
-	*nvram_data = 0;
-	for (x = 0; x < 16; x++) {
-		T93C46_Read_Bit(np, &read_bit, gpreg);
-
-		if (read_bit & 0x01)
-			*nvram_data |=  (0x01 << (15 - x));
-		else
-			*nvram_data &= ~(0x01 << (15 - x));
-	}
-}
-
-/*
- *  Read Tekram NvRAM data.
- */
-static int __init 
-T93C46_Read_Data(ncr_slot *np, u_short *data,int len,u_char *gpreg)
-{
-	u_char	read_bit;
-	int	x;
-
-	for (x = 0; x < len; x++)  {
-
-		/* output read command and address */
-		T93C46_Send_Command(np, 0x180 | x, &read_bit, gpreg);
-		if (read_bit & 0x01)
-			return 1; /* Bad */
-		T93C46_Read_Word(np, &data[x], gpreg);
-		T93C46_Stop(np, gpreg);
-	}
-
-	return 0;
-}
-
-/*
- *  Try reading 93C46 Tekram NVRAM.
- */
-static int __init 
-sym_read_T93C46_nvram (ncr_slot *np, Tekram_nvram *nvram)
-{
-	u_char gpcntl, gpreg;
-	u_char old_gpcntl, old_gpreg;
-	int retv = 1;
-
-	/* save current state of GPCNTL and GPREG */
-	old_gpreg	= INB (nc_gpreg);
-	old_gpcntl	= INB (nc_gpcntl);
-
-	/* set up GPREG & GPCNTL to set GPIO0/1/2/4 in to known state, 0 in,
-	   1/2/4 out */
-	gpreg = old_gpreg & 0xe9;
-	OUTB (nc_gpreg, gpreg);
-	gpcntl = (old_gpcntl & 0xe9) | 0x09;
-	OUTB (nc_gpcntl, gpcntl);
-
-	/* input all of NVRAM, 64 words */
-	retv = T93C46_Read_Data(np, (u_short *) nvram,
-				sizeof(*nvram) / sizeof(short), &gpreg);
-	
-	/* return GPIO0/1/2/4 to original states after having accessed NVRAM */
-	OUTB (nc_gpcntl, old_gpcntl);
-	OUTB (nc_gpreg,  old_gpreg);
-
-	return retv;
-}
-
-/*
- *  Try reading Tekram NVRAM.
- *  Return 0 if OK.
- */
-static int __init 
-sym_read_Tekram_nvram (ncr_slot *np, u_short device_id, Tekram_nvram *nvram)
-{
-	u_char *data = (u_char *) nvram;
-	int len = sizeof(*nvram);
-	u_short	csum;
-	int x;
-
-	switch (device_id) {
-	case PCI_DEVICE_ID_NCR_53C885:
-	case PCI_DEVICE_ID_NCR_53C895:
-	case PCI_DEVICE_ID_NCR_53C896:
-		x = sym_read_S24C16_nvram(np, TEKRAM_24C16_NVRAM_ADDRESS,
-					  data, len);
-		break;
-	case PCI_DEVICE_ID_NCR_53C875:
-		x = sym_read_S24C16_nvram(np, TEKRAM_24C16_NVRAM_ADDRESS,
-					  data, len);
-		if (!x)
-			break;
-	default:
-		x = sym_read_T93C46_nvram(np, nvram);
-		break;
-	}
-	if (x)
-		return 1;
-
-	/* verify checksum */
-	for (x = 0, csum = 0; x < len - 1; x += 2)
-		csum += data[x] + (data[x+1] << 8);
-	if (csum != 0x1234)
-		return 1;
-
-	return 0;
-}
-
-#endif	/* SCSI_NCR_NVRAM_SUPPORT */
-
-/*===================================================================
-**
-**    Detect and try to read SYMBIOS and TEKRAM NVRAM.
-**
-**    Data can be used to order booting of boards.
-**
-**    Data is saved in ncr_device structure if NVRAM found. This
-**    is then used to find drive boot order for ncr_attach().
-**
-**    NVRAM data is passed to Scsi_Host_Template later during 
-**    ncr_attach() for any device set up.
-**
-**===================================================================
-*/
-#ifdef SCSI_NCR_NVRAM_SUPPORT
-static void __init ncr_get_nvram(struct ncr_device *devp, ncr_nvram *nvp)
-{
-	devp->nvram = nvp;
-	if (!nvp)
-		return;
-	/*
-	**    Get access to chip IO registers
-	*/
-#ifdef SCSI_NCR_IOMAPPED
-	request_region(devp->slot.io_port, 128, NAME53C8XX);
-	devp->slot.base_io = devp->slot.io_port;
-#else
-	devp->slot.reg = 
-		(struct ncr_reg *) remap_pci_mem(devp->slot.base_c, 128);
-	if (!devp->slot.reg)
-		return;
-#endif
-
-	/*
-	**    Try to read SYMBIOS nvram.
-	**    Try to read TEKRAM nvram if Symbios nvram not found.
-	*/
-	if	(!sym_read_Symbios_nvram(&devp->slot, &nvp->data.Symbios))
-		nvp->type = SCSI_NCR_SYMBIOS_NVRAM;
-	else if	(!sym_read_Tekram_nvram(&devp->slot, devp->chip.device_id,
-					&nvp->data.Tekram))
-		nvp->type = SCSI_NCR_TEKRAM_NVRAM;
-	else {
-		nvp->type = 0;
-		devp->nvram = 0;
-	}
-
-	/*
-	** Release access to chip IO registers
-	*/
-#ifdef SCSI_NCR_IOMAPPED
-	release_region(devp->slot.base_io, 128);
-#else
-	unmap_pci_mem((u_long) devp->slot.reg, 128ul);
-#endif
-
-}
-
-/*===================================================================
-**
-**	Display the content of NVRAM for debugging purpose.
-**
-**===================================================================
-*/
-#ifdef	SCSI_NCR_DEBUG_NVRAM
-static void __init ncr_display_Symbios_nvram(Symbios_nvram *nvram)
-{
-	int i;
-
-	/* display Symbios nvram host data */
-	printk(KERN_DEBUG NAME53C8XX ": HOST ID=%d%s%s%s%s%s\n",
-		nvram->host_id & 0x0f,
-		(nvram->flags  & SYMBIOS_SCAM_ENABLE)	? " SCAM"	:"",
-		(nvram->flags  & SYMBIOS_PARITY_ENABLE)	? " PARITY"	:"",
-		(nvram->flags  & SYMBIOS_VERBOSE_MSGS)	? " VERBOSE"	:"", 
-		(nvram->flags  & SYMBIOS_CHS_MAPPING)	? " CHS_ALT"	:"", 
-		(nvram->flags1 & SYMBIOS_SCAN_HI_LO)	? " HI_LO"	:"");
-
-	/* display Symbios nvram drive data */
-	for (i = 0 ; i < 15 ; i++) {
-		struct Symbios_target *tn = &nvram->target[i];
-		printk(KERN_DEBUG NAME53C8XX 
-		"-%d:%s%s%s%s WIDTH=%d SYNC=%d TMO=%d\n",
-		i,
-		(tn->flags & SYMBIOS_DISCONNECT_ENABLE)	? " DISC"	: "",
-		(tn->flags & SYMBIOS_SCAN_AT_BOOT_TIME)	? " SCAN_BOOT"	: "",
-		(tn->flags & SYMBIOS_SCAN_LUNS)		? " SCAN_LUNS"	: "",
-		(tn->flags & SYMBIOS_QUEUE_TAGS_ENABLED)? " TCQ"	: "",
-		tn->bus_width,
-		tn->sync_period / 4,
-		tn->timeout);
-	}
-}
-
-static u_char Tekram_boot_delay[7] __initdata = {3, 5, 10, 20, 30, 60, 120};
-
-static void __init ncr_display_Tekram_nvram(Tekram_nvram *nvram)
-{
-	int i, tags, boot_delay;
-	char *rem;
-
-	/* display Tekram nvram host data */
-	tags = 2 << nvram->max_tags_index;
-	boot_delay = 0;
-	if (nvram->boot_delay_index < 6)
-		boot_delay = Tekram_boot_delay[nvram->boot_delay_index];
-	switch((nvram->flags & TEKRAM_REMOVABLE_FLAGS) >> 6) {
-	default:
-	case 0:	rem = "";			break;
-	case 1: rem = " REMOVABLE=boot device";	break;
-	case 2: rem = " REMOVABLE=all";		break;
-	}
-
-	printk(KERN_DEBUG NAME53C8XX
-		": HOST ID=%d%s%s%s%s%s%s%s%s%s BOOT DELAY=%d tags=%d\n",
-		nvram->host_id & 0x0f,
-		(nvram->flags1 & SYMBIOS_SCAM_ENABLE)	? " SCAM"	:"",
-		(nvram->flags & TEKRAM_MORE_THAN_2_DRIVES) ? " >2DRIVES":"",
-		(nvram->flags & TEKRAM_DRIVES_SUP_1GB)	? " >1GB"	:"",
-		(nvram->flags & TEKRAM_RESET_ON_POWER_ON) ? " RESET"	:"",
-		(nvram->flags & TEKRAM_ACTIVE_NEGATION)	? " ACT_NEG"	:"",
-		(nvram->flags & TEKRAM_IMMEDIATE_SEEK)	? " IMM_SEEK"	:"",
-		(nvram->flags & TEKRAM_SCAN_LUNS)	? " SCAN_LUNS"	:"",
-		(nvram->flags1 & TEKRAM_F2_F6_ENABLED)	? " F2_F6"	:"",
-		rem, boot_delay, tags);
-
-	/* display Tekram nvram drive data */
-	for (i = 0; i <= 15; i++) {
-		int sync, j;
-		struct Tekram_target *tn = &nvram->target[i];
-		j = tn->sync_index & 0xf;
-		sync = Tekram_sync[j];
-		printk(KERN_DEBUG NAME53C8XX "-%d:%s%s%s%s%s%s PERIOD=%d\n",
-		i,
-		(tn->flags & TEKRAM_PARITY_CHECK)	? " PARITY"	: "",
-		(tn->flags & TEKRAM_SYNC_NEGO)		? " SYNC"	: "",
-		(tn->flags & TEKRAM_DISCONNECT_ENABLE)	? " DISC"	: "",
-		(tn->flags & TEKRAM_START_CMD)		? " START"	: "",
-		(tn->flags & TEKRAM_TAGGED_COMMANDS)	? " TCQ"	: "",
-		(tn->flags & TEKRAM_WIDE_NEGO)		? " WIDE"	: "",
-		sync);
-	}
-}
-#endif /* SCSI_NCR_DEBUG_NVRAM */
-#endif	/* SCSI_NCR_NVRAM_SUPPORT */
-
-
 /*===================================================================
 **
 **	Utility routines that protperly return data through /proc FS.
diff --git a/drivers/scsi/sym53c8xx_defs.h b/drivers/scsi/sym53c8xx_defs.h
index 001364cc4..28881d052 100644
--- a/drivers/scsi/sym53c8xx_defs.h
+++ b/drivers/scsi/sym53c8xx_defs.h
@@ -64,31 +64,9 @@
 #ifndef SYM53C8XX_DEFS_H
 #define SYM53C8XX_DEFS_H
 
-/*
-**	Check supported Linux versions
-*/
-
 #include <linux/config.h>
 
-/*
- * NCR PQS/PDS special device support.
- */
-#ifdef CONFIG_SCSI_NCR53C8XX_PQS_PDS
-#define SCSI_NCR_PQS_PDS_SUPPORT
-#endif
-
-/*
- *	No more an option, enabled by default.
- */
-#ifndef CONFIG_SCSI_NCR53C8XX_NO_NVRAM
-# ifndef CONFIG_SCSI_NCR53C8XX_NVRAM_DETECT
-#  define CONFIG_SCSI_NCR53C8XX_NVRAM_DETECT
-# endif
-#endif
-
-/*
-**	These options are not tunable from 'make config'
-*/
+/* These options are not tunable from 'make config' */
 #define	SCSI_NCR_PROC_INFO_SUPPORT
 
 /*
@@ -97,7 +75,6 @@
 */
 #define SCSI_NCR_BOOT_COMMAND_LINE_SUPPORT
 #define SCSI_NCR_DEBUG_INFO_SUPPORT
-#define SCSI_NCR_PCI_FIX_UP_SUPPORT
 #ifdef	SCSI_NCR_PROC_INFO_SUPPORT
 #	define	SCSI_NCR_USER_COMMAND_SUPPORT
 #	define	SCSI_NCR_USER_INFO_SUPPORT
@@ -111,18 +88,6 @@
 #	define SCSI_NCR_ENABLE_INTEGRITY_CHECK
 #endif
 
-/*==========================================================
-**
-** nvram settings - #define SCSI_NCR_NVRAM_SUPPORT to enable
-**
-**==========================================================
-*/
-
-#ifdef CONFIG_SCSI_NCR53C8XX_NVRAM_DETECT
-#define SCSI_NCR_NVRAM_SUPPORT
-/* #define SCSI_NCR_DEBUG_NVRAM */
-#endif
-
 /* ---------------------------------------------------------------------
 ** Take into account kernel configured parameters.
 ** Most of these options can be overridden at startup by a command line.
@@ -171,15 +136,6 @@
 #define	SCSI_NCR_SETUP_DEFAULT_TAGS	(0)
 #endif
 
-/*
- * Use normal IO if configured. Forced for alpha.
- */
-#if defined(CONFIG_SCSI_NCR53C8XX_IOMAPPED)
-#define	SCSI_NCR_IOMAPPED
-#elif defined(__alpha__)
-#define	SCSI_NCR_IOMAPPED
-#endif
-
 /*
  * Immediate arbitration
  */
@@ -331,8 +287,6 @@
 #define SCSI_NCR_MAX_LUN	(1)
 #endif
 
-#ifndef HOSTS_C
-
 /*
 **	These simple macros limit expression involving 
 **	kernel time values (jiffies) to some that have 
@@ -388,15 +342,6 @@
 #define	outw_raw	outw
 #define	outl_raw	outl
 
-#if defined(__i386__)	/* i386 implements full FLAT memory/MMIO model */
-#define readb_raw(a)	(*(volatile unsigned char *) (a))
-#define readw_raw(a)	(*(volatile unsigned short *) (a))
-#define readl_raw(a)	(*(volatile unsigned int *) (a))
-#define writeb_raw(b,a)	((*(volatile unsigned char *) (a)) = (b))
-#define writew_raw(b,a)	((*(volatile unsigned short *) (a)) = (b))
-#define writel_raw(b,a)	((*(volatile unsigned int *) (a)) = (b))
-
-#else	/* Other little-endian */
 #define	readb_raw	readb
 #define	readw_raw	readw
 #define	readl_raw	readl
@@ -404,7 +349,6 @@
 #define	writew_raw	writew
 #define	writel_raw	writel
 
-#endif
 #endif
 
 #if !defined(__hppa__) && !defined(__mips__)
@@ -413,18 +357,6 @@
 #endif
 #endif
 
-
-/*
- *  IA32 architecture does not reorder STORES and prevents
- *  LOADS from passing STORES. It is called `program order' 
- *  by Intel and allows device drivers to deal with memory 
- *  ordering by only ensuring that the code is not reordered  
- *  by the compiler when ordering is required.
- *  Other architectures implement a weaker ordering that 
- *  requires memory barriers (and also IO barriers when they 
- *  make sense) to be used.
- */
-
 #define MEMORY_BARRIER()	mb()
 
 
@@ -476,13 +408,6 @@
 /*
  *  Access to the controller chip.
  *
- *  If SCSI_NCR_IOMAPPED is defined, the driver will use 
- *  normal IOs instead of the MEMORY MAPPED IO method  
- *  recommended by PCI specifications.
- *  If all PCI bridges, host brigdes and architectures 
- *  would have been correctly designed for PCI, this 
- *  option would be useless.
- *
  *  If the CPU and the NCR use same endian-ness addressing,
  *  no byte reordering is needed for accessing chip io 
  *  registers. Functions suffixed by '_raw' are assumed 
@@ -493,42 +418,6 @@
  *  blah, ...
  */
 
-#if defined(SCSI_NCR_IOMAPPED)
-/*
- *  IO mapped only input / ouput
- */
-
-#define	INB_OFF(o)		inb (np->base_io + ncr_offb(o))
-#define	OUTB_OFF(o, val)	outb ((val), np->base_io + ncr_offb(o))
-
-#if	defined(__BIG_ENDIAN) && !defined(SCSI_NCR_BIG_ENDIAN)
-
-#define	INW_OFF(o)		inw_l2b (np->base_io + ncr_offw(o))
-#define	INL_OFF(o)		inl_l2b (np->base_io + (o))
-
-#define	OUTW_OFF(o, val)	outw_b2l ((val), np->base_io + ncr_offw(o))
-#define	OUTL_OFF(o, val)	outl_b2l ((val), np->base_io + (o))
-
-#elif	defined(__LITTLE_ENDIAN) && defined(SCSI_NCR_BIG_ENDIAN)
-
-#define	INW_OFF(o)		inw_b2l (np->base_io + ncr_offw(o))
-#define	INL_OFF(o)		inl_b2l (np->base_io + (o))
-
-#define	OUTW_OFF(o, val)	outw_l2b ((val), np->base_io + ncr_offw(o))
-#define	OUTL_OFF(o, val)	outl_l2b ((val), np->base_io + (o))
-
-#else
-
-#define	INW_OFF(o)		inw_raw (np->base_io + ncr_offw(o))
-#define	INL_OFF(o)		inl_raw (np->base_io + (o))
-
-#define	OUTW_OFF(o, val)	outw_raw ((val), np->base_io + ncr_offw(o))
-#define	OUTL_OFF(o, val)	outl_raw ((val), np->base_io + (o))
-
-#endif	/* ENDIANs */
-
-#else	/* defined SCSI_NCR_IOMAPPED */
-
 /*
  *  MEMORY mapped IO input / output
  */
@@ -572,8 +461,6 @@
 
 #endif
 
-#endif	/* defined SCSI_NCR_IOMAPPED */
-
 #define INB(r)		INB_OFF (offsetof(struct ncr_reg,r))
 #define INW(r)		INW_OFF (offsetof(struct ncr_reg,r))
 #define INL(r)		INL_OFF (offsetof(struct ncr_reg,r))
@@ -611,86 +498,11 @@
 	} while (0)
 
 
-/*
-**	NCR53C8XX Device Ids
-*/
-
-#ifndef PSEUDO_720_ID
-#define PSEUDO_720_ID 0x5a00
-#endif
-
-#ifndef PCI_DEVICE_ID_NCR_53C810
-#define PCI_DEVICE_ID_NCR_53C810 1
-#endif
-
-#ifndef PCI_DEVICE_ID_NCR_53C810AP
-#define PCI_DEVICE_ID_NCR_53C810AP 5
-#endif
-
-#ifndef PCI_DEVICE_ID_NCR_53C815
-#define PCI_DEVICE_ID_NCR_53C815 4
-#endif
-
-#ifndef PCI_DEVICE_ID_NCR_53C820
-#define PCI_DEVICE_ID_NCR_53C820 2
-#endif
-
-#ifndef PCI_DEVICE_ID_NCR_53C825
-#define PCI_DEVICE_ID_NCR_53C825 3
-#endif
-
-#ifndef PCI_DEVICE_ID_NCR_53C860
-#define PCI_DEVICE_ID_NCR_53C860 6
-#endif
-
-#ifndef PCI_DEVICE_ID_NCR_53C875
-#define PCI_DEVICE_ID_NCR_53C875 0xf
-#endif
-
-#ifndef PCI_DEVICE_ID_NCR_53C875J
-#define PCI_DEVICE_ID_NCR_53C875J 0x8f
-#endif
-
-#ifndef PCI_DEVICE_ID_NCR_53C885
-#define PCI_DEVICE_ID_NCR_53C885 0xd
-#endif
-
-#ifndef PCI_DEVICE_ID_NCR_53C895
-#define PCI_DEVICE_ID_NCR_53C895 0xc
-#endif
-
-#ifndef PCI_DEVICE_ID_NCR_53C896
-#define PCI_DEVICE_ID_NCR_53C896 0xb
-#endif
-
-#ifndef PCI_DEVICE_ID_NCR_53C895A
-#define PCI_DEVICE_ID_NCR_53C895A 0x12
-#endif
-
-#ifndef PCI_DEVICE_ID_NCR_53C875A
-#define PCI_DEVICE_ID_NCR_53C875A 0x13
-#endif
-
-#ifndef PCI_DEVICE_ID_NCR_53C1510D
-#define PCI_DEVICE_ID_NCR_53C1510D 0xa
-#endif
-
-#ifndef PCI_DEVICE_ID_LSI_53C1010
-#define PCI_DEVICE_ID_LSI_53C1010 0x20
-#endif
-
-#ifndef PCI_DEVICE_ID_LSI_53C1010_66
-#define PCI_DEVICE_ID_LSI_53C1010_66 0x21
-#endif
-
-
 /*
 **   NCR53C8XX devices features table.
 */
-typedef struct {
-	unsigned short	device_id;
+struct ncr_chip {
 	unsigned short	revision_id;
-	char	*name;
 	unsigned char	burst_max;	/* log-base-2 of max burst */
 	unsigned char	offset_max;
 	unsigned char	nr_divisor;
@@ -698,7 +510,6 @@ typedef struct {
 #define FE_LED0		(1<<0)
 #define FE_WIDE		(1<<1)    /* Wide data transfers */
 #define FE_ULTRA	(1<<2)	  /* Ultra speed 20Mtrans/sec */
-#define FE_ULTRA2	(1<<3)	  /* Ultra 2 - 40 Mtrans/sec */
 #define FE_DBLR		(1<<4)	  /* Clock doubler present */
 #define FE_QUAD		(1<<5)	  /* Clock quadrupler present */
 #define FE_ERL		(1<<6)    /* Enable read line */
@@ -717,7 +528,6 @@ typedef struct {
 #define FE_NOPM		(1<<19)   /* Scripts handles phase mismatch */
 #define FE_LEDC		(1<<20)   /* Hardware control of LED */
 #define FE_DIFF		(1<<21)   /* Support Differential SCSI */
-#define FE_ULTRA3	(1<<22)   /* Ultra-3 80Mtrans/sec */
 #define FE_66MHZ 	(1<<23)   /* 66MHz PCI Support */
 #define FE_DAC	 	(1<<24)   /* Support DAC cycles (64 bit addressing) */
 #define FE_ISTAT1 	(1<<25)   /* Have ISTAT1, MBOX0, MBOX1 registers */
@@ -727,116 +537,10 @@ typedef struct {
 #define FE_EA		(1<<29)   /* 720: Enable Ack */
 
 #define FE_CACHE_SET	(FE_ERL|FE_CLSE|FE_WRIE|FE_ERMP)
-#define FE_SCSI_SET	(FE_WIDE|FE_ULTRA|FE_ULTRA2|FE_DBLR|FE_QUAD|F_CLK80)
+#define FE_SCSI_SET	(FE_WIDE|FE_ULTRA|FE_DBLR|FE_QUAD|F_CLK80)
 #define FE_SPECIAL_SET	(FE_CACHE_SET|FE_BOF|FE_DFS|FE_LDSTR|FE_PFEN|FE_RAM)
-} ncr_chip;
-
-/*
-**	DEL 397 - 53C875 Rev 3 - Part Number 609-0392410 - ITEM 3.
-**	Memory Read transaction terminated by a retry followed by 
-**	Memory Read Line command.
-*/
-#define FE_CACHE0_SET	(FE_CACHE_SET & ~FE_ERL)
-
-/*
-**	DEL 397 - 53C875 Rev 3 - Part Number 609-0392410 - ITEM 5.
-**	On paper, this errata is harmless. But it is a good reason for 
-**	using a shorter programmed burst length (64 DWORDS instead of 128).
-*/
+};
 
-#define SCSI_NCR_CHIP_TABLE						\
-{									\
- {PSEUDO_720_ID, 0x0f, "720",  3,  8, 4,				\
- FE_WIDE|FE_DIFF|FE_EHP|FE_MUX|FE_EA}					\
- ,									\
- {PCI_DEVICE_ID_NCR_53C810, 0x0f, "810",  4,  8, 4,			\
- FE_ERL}								\
- ,									\
- {PCI_DEVICE_ID_NCR_53C810, 0xff, "810a", 4,  8, 4,			\
- FE_CACHE_SET|FE_LDSTR|FE_PFEN|FE_BOF}					\
- ,									\
- {PCI_DEVICE_ID_NCR_53C815, 0xff, "815",  4,  8, 4,			\
- FE_ERL|FE_BOF}								\
- ,									\
- {PCI_DEVICE_ID_NCR_53C820, 0xff, "820",  4,  8, 4,			\
- FE_WIDE|FE_ERL}							\
- ,									\
- {PCI_DEVICE_ID_NCR_53C825, 0x0f, "825",  4,  8, 4,			\
- FE_WIDE|FE_ERL|FE_BOF|FE_DIFF}						\
- ,									\
- {PCI_DEVICE_ID_NCR_53C825, 0xff, "825a", 6,  8, 4,			\
- FE_WIDE|FE_CACHE0_SET|FE_BOF|FE_DFS|FE_LDSTR|FE_PFEN|FE_RAM|FE_DIFF}	\
- ,									\
- {PCI_DEVICE_ID_NCR_53C860, 0xff, "860",  4,  8, 5,			\
- FE_ULTRA|FE_CACHE_SET|FE_BOF|FE_LDSTR|FE_PFEN}				\
- ,									\
- {PCI_DEVICE_ID_NCR_53C875, 0x01, "875",  6, 16, 5,			\
- FE_WIDE|FE_ULTRA|FE_CACHE0_SET|FE_BOF|FE_DFS|FE_LDSTR|FE_PFEN|		\
- FE_RAM|FE_DIFF|FE_VARCLK}						\
- ,									\
- {PCI_DEVICE_ID_NCR_53C875, 0xff, "875",  6, 16, 5,			\
- FE_WIDE|FE_ULTRA|FE_DBLR|FE_CACHE0_SET|FE_BOF|FE_DFS|FE_LDSTR|FE_PFEN|	\
- FE_RAM|FE_DIFF|FE_VARCLK}						\
- ,									\
- {PCI_DEVICE_ID_NCR_53C875J,0xff, "875J", 6, 16, 5,			\
- FE_WIDE|FE_ULTRA|FE_DBLR|FE_CACHE0_SET|FE_BOF|FE_DFS|FE_LDSTR|FE_PFEN|	\
- FE_RAM|FE_VARCLK}							\
- ,									\
- {PCI_DEVICE_ID_NCR_53C885, 0xff, "885",  6, 16, 5,			\
- FE_WIDE|FE_ULTRA|FE_DBLR|FE_CACHE0_SET|FE_BOF|FE_DFS|FE_LDSTR|FE_PFEN|	\
- FE_RAM|FE_DIFF|FE_VARCLK}						\
- ,									\
- {PCI_DEVICE_ID_NCR_53C895, 0xff, "895",  6, 31, 7,			\
- FE_WIDE|FE_ULTRA2|FE_QUAD|FE_CACHE_SET|FE_BOF|FE_DFS|FE_LDSTR|FE_PFEN|	\
- FE_RAM}								\
- ,									\
- {PCI_DEVICE_ID_NCR_53C896, 0xff, "896",  6, 31, 7,			\
- FE_WIDE|FE_ULTRA2|FE_QUAD|FE_CACHE_SET|FE_BOF|FE_DFS|FE_LDSTR|FE_PFEN|	\
- FE_RAM|FE_RAM8K|FE_64BIT|FE_DAC|FE_IO256|FE_NOPM|FE_LEDC|FE_ISTAT1}	\
- ,									\
- {PCI_DEVICE_ID_NCR_53C895A, 0xff, "895a",  6, 31, 7,			\
- FE_WIDE|FE_ULTRA2|FE_QUAD|FE_CACHE_SET|FE_BOF|FE_DFS|FE_LDSTR|FE_PFEN|	\
- FE_RAM|FE_RAM8K|FE_DAC|FE_IO256|FE_NOPM|FE_LEDC}			\
- ,									\
- {PCI_DEVICE_ID_NCR_53C875A, 0xff, "875a",  6, 31, 7,			\
- FE_WIDE|FE_ULTRA|FE_QUAD|FE_CACHE_SET|FE_BOF|FE_DFS|FE_LDSTR|FE_PFEN|	\
- FE_RAM|FE_DAC|FE_IO256|FE_NOPM|FE_LEDC}				\
- ,									\
- {PCI_DEVICE_ID_NCR_53C1510D, 0xff, "1510D",  7, 31, 7,			\
- FE_WIDE|FE_ULTRA2|FE_QUAD|FE_CACHE_SET|FE_BOF|FE_DFS|FE_LDSTR|FE_PFEN|	\
- FE_RAM|FE_IO256}							\
- ,									\
- {PCI_DEVICE_ID_LSI_53C1010, 0xff, "1010-33",  6, 62, 7,		\
- FE_WIDE|FE_QUAD|FE_CACHE_SET|FE_BOF|FE_DFS|FE_LDSTR|FE_PFEN|FE_ISTAT1|	\
- FE_RAM|FE_RAM8K|FE_64BIT|FE_DAC|FE_IO256|FE_NOPM|FE_LEDC|FE_ULTRA3}	\
- ,									\
- {PCI_DEVICE_ID_LSI_53C1010_66, 0xff, "1010-66",  6, 62, 7,		\
- FE_WIDE|FE_QUAD|FE_CACHE_SET|FE_BOF|FE_DFS|FE_LDSTR|FE_PFEN|FE_ISTAT1|	\
- FE_RAM|FE_RAM8K|FE_64BIT|FE_DAC|FE_IO256|FE_NOPM|FE_LEDC|FE_ULTRA3|	\
- FE_66MHZ}								\
-}
-
-/*
- * List of supported NCR chip ids
- */
-#define SCSI_NCR_CHIP_IDS		\
-{					\
-	PSEUDO_720_ID,		\
-	PCI_DEVICE_ID_NCR_53C810,	\
-	PCI_DEVICE_ID_NCR_53C815,	\
-	PCI_DEVICE_ID_NCR_53C820,	\
-	PCI_DEVICE_ID_NCR_53C825,	\
-	PCI_DEVICE_ID_NCR_53C860,	\
-	PCI_DEVICE_ID_NCR_53C875,	\
-	PCI_DEVICE_ID_NCR_53C875J,	\
-	PCI_DEVICE_ID_NCR_53C885,	\
-	PCI_DEVICE_ID_NCR_53C895,	\
-	PCI_DEVICE_ID_NCR_53C896,	\
-	PCI_DEVICE_ID_NCR_53C895A,	\
-	PCI_DEVICE_ID_NCR_53C1510D,	\
- 	PCI_DEVICE_ID_LSI_53C1010,	\
- 	PCI_DEVICE_ID_LSI_53C1010_66	\
-}
 
 /*
 **	Driver setup structure.
@@ -846,30 +550,30 @@ typedef struct {
 */
 #define SCSI_NCR_MAX_EXCLUDES 8
 struct ncr_driver_setup {
-	u_char	master_parity;
-	u_char	scsi_parity;
-	u_char	disconnection;
-	u_char	special_features;
-	u_char	force_sync_nego;
-	u_char	reverse_probe;
-	u_char	pci_fix_up;
-	u_char	use_nvram;
-	u_char	verbose;
-	u_char	default_tags;
-	u_short	default_sync;
-	u_short	debug;
-	u_char	burst_max;
-	u_char	led_pin;
-	u_char	max_wide;
-	u_char	settle_delay;
-	u_char	diff_support;
-	u_char	irqm;
-	u_char	bus_check;
-	u_char	optimize;
-	u_char	recovery;
-	u_char	host_id;
-	u_short	iarb;
-	u_long	excludes[SCSI_NCR_MAX_EXCLUDES];
+	u8	master_parity;
+	u8	scsi_parity;
+	u8	disconnection;
+	u8	special_features;
+	u8	force_sync_nego;
+	u8	reverse_probe;
+	u8	pci_fix_up;
+	u8	use_nvram;
+	u8	verbose;
+	u8	default_tags;
+	u16	default_sync;
+	u16	debug;
+	u8	burst_max;
+	u8	led_pin;
+	u8	max_wide;
+	u8	settle_delay;
+	u8	diff_support;
+	u8	irqm;
+	u8	bus_check;
+	u8	optimize;
+	u8	recovery;
+	u8	host_id;
+	u16	iarb;
+	u32	excludes[SCSI_NCR_MAX_EXCLUDES];
 	char	tag_ctrl[100];
 };
 
@@ -935,136 +639,6 @@ struct ncr_driver_setup {
 	255					\
 }
 
-#ifdef SCSI_NCR_NVRAM_SUPPORT
-/*
-**	Symbios NvRAM data format
-*/
-#define SYMBIOS_NVRAM_SIZE 368
-#define SYMBIOS_NVRAM_ADDRESS 0x100
-
-struct Symbios_nvram {
-/* Header 6 bytes */
-	u_short type;		/* 0x0000 */
-	u_short byte_count;	/* excluding header/trailer */
-	u_short checksum;
-
-/* Controller set up 20 bytes */
-	u_char	v_major;	/* 0x00 */
-	u_char	v_minor;	/* 0x30 */
-	u32	boot_crc;
-	u_short	flags;
-#define SYMBIOS_SCAM_ENABLE	(1)
-#define SYMBIOS_PARITY_ENABLE	(1<<1)
-#define SYMBIOS_VERBOSE_MSGS	(1<<2)
-#define SYMBIOS_CHS_MAPPING	(1<<3)
-#define SYMBIOS_NO_NVRAM	(1<<3)	/* ??? */
-	u_short	flags1;
-#define SYMBIOS_SCAN_HI_LO	(1)
-	u_short	term_state;
-#define SYMBIOS_TERM_CANT_PROGRAM	(0)
-#define SYMBIOS_TERM_ENABLED		(1)
-#define SYMBIOS_TERM_DISABLED		(2)
-	u_short	rmvbl_flags;
-#define SYMBIOS_RMVBL_NO_SUPPORT	(0)
-#define SYMBIOS_RMVBL_BOOT_DEVICE	(1)
-#define SYMBIOS_RMVBL_MEDIA_INSTALLED	(2)
-	u_char	host_id;
-	u_char	num_hba;	/* 0x04 */
-	u_char	num_devices;	/* 0x10 */
-	u_char	max_scam_devices;	/* 0x04 */
-	u_char	num_valid_scam_devives;	/* 0x00 */
-	u_char	rsvd;
-
-/* Boot order 14 bytes * 4 */
-	struct Symbios_host{
-		u_short	type;		/* 4:8xx / 0:nok */
-		u_short	device_id;	/* PCI device id */
-		u_short	vendor_id;	/* PCI vendor id */
-		u_char	bus_nr;		/* PCI bus number */
-		u_char	device_fn;	/* PCI device/function number << 3*/
-		u_short	word8;
-		u_short	flags;
-#define	SYMBIOS_INIT_SCAN_AT_BOOT	(1)
-		u_short	io_port;	/* PCI io_port address */
-	} host[4];
-
-/* Targets 8 bytes * 16 */
-	struct Symbios_target {
-		u_char	flags;
-#define SYMBIOS_DISCONNECT_ENABLE	(1)
-#define SYMBIOS_SCAN_AT_BOOT_TIME	(1<<1)
-#define SYMBIOS_SCAN_LUNS		(1<<2)
-#define SYMBIOS_QUEUE_TAGS_ENABLED	(1<<3)
-		u_char	rsvd;
-		u_char	bus_width;	/* 0x08/0x10 */
-		u_char	sync_offset;
-		u_short	sync_period;	/* 4*period factor */
-		u_short	timeout;
-	} target[16];
-/* Scam table 8 bytes * 4 */
-	struct Symbios_scam {
-		u_short	id;
-		u_short	method;
-#define SYMBIOS_SCAM_DEFAULT_METHOD	(0)
-#define SYMBIOS_SCAM_DONT_ASSIGN	(1)
-#define SYMBIOS_SCAM_SET_SPECIFIC_ID	(2)
-#define SYMBIOS_SCAM_USE_ORDER_GIVEN	(3)
-		u_short status;
-#define SYMBIOS_SCAM_UNKNOWN		(0)
-#define SYMBIOS_SCAM_DEVICE_NOT_FOUND	(1)
-#define SYMBIOS_SCAM_ID_NOT_SET		(2)
-#define SYMBIOS_SCAM_ID_VALID		(3)
-		u_char	target_id;
-		u_char	rsvd;
-	} scam[4];
-
-	u_char	spare_devices[15*8];
-	u_char	trailer[6];		/* 0xfe 0xfe 0x00 0x00 0x00 0x00 */
-};
-typedef struct Symbios_nvram	Symbios_nvram;
-typedef struct Symbios_host	Symbios_host;
-typedef struct Symbios_target	Symbios_target;
-typedef struct Symbios_scam	Symbios_scam;
-
-/*
-**	Tekram NvRAM data format.
-*/
-#define TEKRAM_NVRAM_SIZE 64
-#define TEKRAM_93C46_NVRAM_ADDRESS 0
-#define TEKRAM_24C16_NVRAM_ADDRESS 0x40
-
-struct Tekram_nvram {
-	struct Tekram_target {
-		u_char	flags;
-#define	TEKRAM_PARITY_CHECK		(1)
-#define TEKRAM_SYNC_NEGO		(1<<1)
-#define TEKRAM_DISCONNECT_ENABLE	(1<<2)
-#define	TEKRAM_START_CMD		(1<<3)
-#define TEKRAM_TAGGED_COMMANDS		(1<<4)
-#define TEKRAM_WIDE_NEGO		(1<<5)
-		u_char	sync_index;
-		u_short	word2;
-	} target[16];
-	u_char	host_id;
-	u_char	flags;
-#define TEKRAM_MORE_THAN_2_DRIVES	(1)
-#define TEKRAM_DRIVES_SUP_1GB		(1<<1)
-#define	TEKRAM_RESET_ON_POWER_ON	(1<<2)
-#define TEKRAM_ACTIVE_NEGATION		(1<<3)
-#define TEKRAM_IMMEDIATE_SEEK		(1<<4)
-#define	TEKRAM_SCAN_LUNS		(1<<5)
-#define	TEKRAM_REMOVABLE_FLAGS		(3<<6)	/* 0: disable; 1: boot device; 2:all */
-	u_char	boot_delay_index;
-	u_char	max_tags_index;
-	u_short	flags1;
-#define TEKRAM_F2_F6_ENABLED		(1)
-	u_short	spare[29];
-};
-typedef struct Tekram_nvram	Tekram_nvram;
-typedef struct Tekram_target	Tekram_target;
-
-#endif /* SCSI_NCR_NVRAM_SUPPORT */
-
 /**************** ORIGINAL CONTENT of ncrreg.h from FreeBSD ******************/
 
 /*-----------------------------------------------------------------
@@ -1075,38 +649,38 @@ typedef struct Tekram_target	Tekram_target;
 */
 
 struct ncr_reg {
-/*00*/  u_char    nc_scntl0;    /* full arb., ena parity, par->ATN  */
+/*00*/  u8	nc_scntl0;    /* full arb., ena parity, par->ATN  */
 
-/*01*/  u_char    nc_scntl1;    /* no reset                         */
+/*01*/  u8	nc_scntl1;    /* no reset                         */
         #define   ISCON   0x10  /* connected to scsi		    */
         #define   CRST    0x08  /* force reset                      */
         #define   IARB    0x02  /* immediate arbitration            */
 
-/*02*/  u_char    nc_scntl2;    /* no disconnect expected           */
+/*02*/  u8	nc_scntl2;    /* no disconnect expected           */
 	#define   SDU     0x80  /* cmd: disconnect will raise error */
 	#define   CHM     0x40  /* sta: chained mode                */
 	#define   WSS     0x08  /* sta: wide scsi send           [W]*/
 	#define   WSR     0x01  /* sta: wide scsi received       [W]*/
 
-/*03*/  u_char    nc_scntl3;    /* cnf system clock dependent       */
+/*03*/  u8	nc_scntl3;    /* cnf system clock dependent       */
 	#define   EWS     0x08  /* cmd: enable wide scsi         [W]*/
 	#define   ULTRA   0x80  /* cmd: ULTRA enable                */
 				/* bits 0-2, 7 rsvd for C1010       */
 
-/*04*/  u_char    nc_scid;	/* cnf host adapter scsi address    */
+/*04*/  u8	nc_scid;	/* cnf host adapter scsi address    */
 	#define   RRE     0x40  /* r/w:e enable response to resel.  */
 	#define   SRE     0x20  /* r/w:e enable response to select  */
 
-/*05*/  u_char    nc_sxfer;	/* ### Sync speed and count         */
+/*05*/  u8	nc_sxfer;	/* ### Sync speed and count         */
 				/* bits 6-7 rsvd for C1010          */
 
-/*06*/  u_char    nc_sdid;	/* ### Destination-ID               */
+/*06*/  u8	nc_sdid;	/* ### Destination-ID               */
 
-/*07*/  u_char    nc_gpreg;	/* ??? IO-Pins                      */
+/*07*/  u8	nc_gpreg;	/* ??? IO-Pins                      */
 
-/*08*/  u_char    nc_sfbr;	/* ### First byte in phase          */
+/*08*/  u8	nc_sfbr;	/* ### First byte in phase          */
 
-/*09*/  u_char    nc_socl;
+/*09*/  u8	nc_socl;
 	#define   CREQ	  0x80	/* r/w: SCSI-REQ                    */
 	#define   CACK	  0x40	/* r/w: SCSI-ACK                    */
 	#define   CBSY	  0x20	/* r/w: SCSI-BSY                    */
@@ -1116,11 +690,11 @@ struct ncr_reg {
 	#define   CC_D	  0x02	/* r/w: SCSI-C_D                    */
 	#define   CI_O	  0x01	/* r/w: SCSI-I_O                    */
 
-/*0a*/  u_char    nc_ssid;
+/*0a*/  u8	nc_ssid;
 
-/*0b*/  u_char    nc_sbcl;
+/*0b*/  u8	nc_sbcl;
 
-/*0c*/  u_char    nc_dstat;
+/*0c*/  u8	nc_dstat;
         #define   DFE     0x80  /* sta: dma fifo empty              */
         #define   MDPE    0x40  /* int: master data parity error    */
         #define   BF      0x20  /* int: script: bus fault           */
@@ -1129,7 +703,7 @@ struct ncr_reg {
         #define   SIR     0x04  /* int: script: interrupt instruct. */
         #define   IID     0x01  /* int: script: illegal instruct.   */
 
-/*0d*/  u_char    nc_sstat0;
+/*0d*/  u8	nc_sstat0;
         #define   ILF     0x80  /* sta: data in SIDL register lsb   */
         #define   ORF     0x40  /* sta: data in SODR register lsb   */
         #define   OLF     0x20  /* sta: data in SODL register lsb   */
@@ -1139,22 +713,22 @@ struct ncr_reg {
         #define   IRST    0x02  /* sta: scsi reset signal           */
         #define   SDP     0x01  /* sta: scsi parity signal          */
 
-/*0e*/  u_char    nc_sstat1;
+/*0e*/  u8	nc_sstat1;
 	#define   FF3210  0xf0	/* sta: bytes in the scsi fifo      */
 
-/*0f*/  u_char    nc_sstat2;
+/*0f*/  u8	nc_sstat2;
         #define   ILF1    0x80  /* sta: data in SIDL register msb[W]*/
         #define   ORF1    0x40  /* sta: data in SODR register msb[W]*/
         #define   OLF1    0x20  /* sta: data in SODL register msb[W]*/
         #define   DM      0x04  /* sta: DIFFSENS mismatch (895/6 only) */
         #define   LDSC    0x02  /* sta: disconnect & reconnect      */
 
-/*10*/  u_char    nc_dsa;	/* --> Base page                    */
-/*11*/  u_char    nc_dsa1;
-/*12*/  u_char    nc_dsa2;
-/*13*/  u_char    nc_dsa3;
+/*10*/  u8	nc_dsa;	/* --> Base page                    */
+/*11*/  u8	nc_dsa1;
+/*12*/  u8	nc_dsa2;
+/*13*/  u8	nc_dsa3;
 
-/*14*/  u_char    nc_istat;	/* --> Main Command and status      */
+/*14*/  u8	nc_istat;	/* --> Main Command and status      */
         #define   CABRT   0x80  /* cmd: abort current operation     */
         #define   SRST    0x40  /* mod: reset chip                  */
         #define   SIGP    0x20  /* r/w: message from host to ncr    */
@@ -1164,23 +738,23 @@ struct ncr_reg {
         #define   SIP     0x02  /* sta: scsi-interrupt              */
         #define   DIP     0x01  /* sta: host/script interrupt       */
 
-/*15*/  u_char    nc_istat1;	/* 896 and later cores only */
+/*15*/  u8	nc_istat1;	/* 896 and later cores only */
         #define   FLSH    0x04  /* sta: chip is flushing            */
         #define   SRUN    0x02  /* sta: scripts are running         */
         #define   SIRQD   0x01  /* r/w: disable INT pin             */
 
-/*16*/  u_char    nc_mbox0;	/* 896 and later cores only */
-/*17*/  u_char    nc_mbox1;	/* 896 and later cores only */
+/*16*/  u8	nc_mbox0;	/* 896 and later cores only */
+/*17*/  u8	nc_mbox1;	/* 896 and later cores only */
 
-/*18*/	u_char	  nc_ctest0;
+/*18*/	u8	nc_ctest0;
 	#define   EHP     0x04	/* 720 even host parity             */
-/*19*/  u_char    nc_ctest1;
+/*19*/  u8	nc_ctest1;
 
-/*1a*/  u_char    nc_ctest2;
+/*1a*/  u8	nc_ctest2;
 	#define   CSIGP   0x40
 				/* bits 0-2,7 rsvd for C1010        */
 
-/*1b*/  u_char    nc_ctest3;
+/*1b*/  u8	nc_ctest3;
 	#define   FLF     0x08  /* cmd: flush dma fifo              */
 	#define   CLF	  0x04	/* cmd: clear dma fifo		    */
 	#define   FM      0x02  /* mod: fetch pin mode              */
@@ -1189,38 +763,38 @@ struct ncr_reg {
 
 /*1c*/  u32    nc_temp;	/* ### Temporary stack              */
 
-/*20*/	u_char	  nc_dfifo;
-/*21*/  u_char    nc_ctest4;
+/*20*/	u8	nc_dfifo;
+/*21*/  u8	nc_ctest4;
 	#define   MUX     0x80  /* 720 host bus multiplex mode      */
 	#define   BDIS    0x80  /* mod: burst disable               */
 	#define   MPEE    0x08  /* mod: master parity error enable  */
 
-/*22*/  u_char    nc_ctest5;
+/*22*/  u8	nc_ctest5;
 	#define   DFS     0x20  /* mod: dma fifo size               */
 				/* bits 0-1, 3-7 rsvd for C1010          */
-/*23*/  u_char    nc_ctest6;
+/*23*/  u8	nc_ctest6;
 
 /*24*/  u32    nc_dbc;	/* ### Byte count and command       */
 /*28*/  u32    nc_dnad;	/* ### Next command register        */
 /*2c*/  u32    nc_dsp;	/* --> Script Pointer               */
 /*30*/  u32    nc_dsps;	/* --> Script pointer save/opcode#2 */
 
-/*34*/  u_char     nc_scratcha;  /* Temporary register a            */
-/*35*/  u_char     nc_scratcha1;
-/*36*/  u_char     nc_scratcha2;
-/*37*/  u_char     nc_scratcha3;
+/*34*/  u8	nc_scratcha;  /* Temporary register a            */
+/*35*/  u8	nc_scratcha1;
+/*36*/  u8	nc_scratcha2;
+/*37*/  u8	nc_scratcha3;
 
-/*38*/  u_char    nc_dmode;
+/*38*/  u8	nc_dmode;
 	#define   BL_2    0x80  /* mod: burst length shift value +2 */
 	#define   BL_1    0x40  /* mod: burst length shift value +1 */
 	#define   ERL     0x08  /* mod: enable read line            */
 	#define   ERMP    0x04  /* mod: enable read multiple        */
 	#define   BOF     0x02  /* mod: burst op code fetch         */
 
-/*39*/  u_char    nc_dien;
-/*3a*/  u_char    nc_sbr;
+/*39*/  u8	nc_dien;
+/*3a*/  u8	nc_sbr;
 
-/*3b*/  u_char    nc_dcntl;	/* --> Script execution control     */
+/*3b*/  u8	nc_dcntl;	/* --> Script execution control     */
 	#define   CLSE    0x80  /* mod: cache line size enable      */
 	#define   PFF     0x40  /* cmd: pre-fetch flush             */
 	#define   PFEN    0x20  /* mod: pre-fetch enable            */
@@ -1232,10 +806,10 @@ struct ncr_reg {
  	#define	  NOCOM   0x01	/* cmd: protect sfbr while reselect */
 				/* bits 0-1 rsvd for C1010          */
 
-/*3c*/  u32    nc_adder;
+/*3c*/  u32	nc_adder;
 
-/*40*/  u_short   nc_sien;	/* -->: interrupt enable            */
-/*42*/  u_short   nc_sist;	/* <--: interrupt status            */
+/*40*/  u16	nc_sien;	/* -->: interrupt enable            */
+/*42*/  u16	nc_sist;	/* <--: interrupt status            */
         #define   SBMC    0x1000/* sta: SCSI Bus Mode Change (895/6 only) */
         #define   STO     0x0400/* sta: timeout (select)            */
         #define   GEN     0x0200/* sta: timeout (general)           */
@@ -1249,34 +823,34 @@ struct ncr_reg {
         #define   RST     0x02  /* sta: scsi bus reset detected     */
         #define   PAR     0x01  /* sta: scsi parity error           */
 
-/*44*/  u_char    nc_slpar;
-/*45*/  u_char    nc_swide;
-/*46*/  u_char    nc_macntl;
-/*47*/  u_char    nc_gpcntl;
-/*48*/  u_char    nc_stime0;    /* cmd: timeout for select&handshake*/
-/*49*/  u_char    nc_stime1;    /* cmd: timeout user defined        */
-/*4a*/  u_short   nc_respid;    /* sta: Reselect-IDs                */
+/*44*/  u8	nc_slpar;
+/*45*/  u8	nc_swide;
+/*46*/  u8	nc_macntl;
+/*47*/  u8	nc_gpcntl;
+/*48*/  u8	nc_stime0;    /* cmd: timeout for select&handshake*/
+/*49*/  u8	nc_stime1;    /* cmd: timeout user defined        */
+/*4a*/  u16   nc_respid;    /* sta: Reselect-IDs                */
 
-/*4c*/  u_char    nc_stest0;
+/*4c*/  u8	nc_stest0;
 
-/*4d*/  u_char    nc_stest1;
+/*4d*/  u8	nc_stest1;
 	#define   SCLK    0x80	/* Use the PCI clock as SCSI clock	*/
 	#define   DBLEN   0x08	/* clock doubler running		*/
 	#define   DBLSEL  0x04	/* clock doubler selected		*/
   
 
-/*4e*/  u_char    nc_stest2;
+/*4e*/  u8	nc_stest2;
 	#define   ROF     0x40	/* reset scsi offset (after gross error!) */
 	#define   DIF     0x20  /* 720 SCSI differential mode             */
 	#define   EXT     0x02  /* extended filtering                     */
 
-/*4f*/  u_char    nc_stest3;
+/*4f*/  u8	nc_stest3;
 	#define   TE     0x80	/* c: tolerAnt enable */
 	#define   HSC    0x20	/* c: Halt SCSI Clock */
 	#define   CSF    0x02	/* c: clear scsi fifo */
 
-/*50*/  u_short   nc_sidl;	/* Lowlevel: latched from scsi data */
-/*52*/  u_char    nc_stest4;
+/*50*/  u16   nc_sidl;	/* Lowlevel: latched from scsi data */
+/*52*/  u8	nc_stest4;
 	#define   SMODE  0xc0	/* SCSI bus mode      (895/6 only) */
 	#define    SMODE_HVD 0x40	/* High Voltage Differential       */
 	#define    SMODE_SE  0x80	/* Single Ended                    */
@@ -1284,9 +858,9 @@ struct ncr_reg {
 	#define   LCKFRQ 0x20	/* Frequency Lock (895/6 only)     */
 				/* bits 0-5 rsvd for C1010          */
 
-/*53*/  u_char    nc_53_;
-/*54*/  u_short   nc_sodl;	/* Lowlevel: data out to scsi data  */
-/*56*/	u_char    nc_ccntl0;	/* Chip Control 0 (896)             */
+/*53*/  u8	nc_53_;
+/*54*/  u16	nc_sodl;	/* Lowlevel: data out to scsi data  */
+/*56*/	u8	nc_ccntl0;	/* Chip Control 0 (896)             */
 	#define   ENPMJ  0x80	/* Enable Phase Mismatch Jump       */
 	#define   PMJCTL 0x40	/* Phase Mismatch Jump Control      */
 	#define   ENNDJ  0x20	/* Enable Non Data PM Jump          */
@@ -1294,7 +868,7 @@ struct ncr_reg {
 	#define   DILS   0x02	/* Disable Internal Load/Store      */
 	#define   DPR    0x01	/* Disable Pipe Req                 */
 
-/*57*/	u_char    nc_ccntl1;	/* Chip Control 1 (896)             */
+/*57*/	u8	nc_ccntl1;	/* Chip Control 1 (896)             */
 	#define   ZMOD   0x80	/* High Impedance Mode              */
 	#define	  DIC	 0x10	/* Disable Internal Cycles	    */
 	#define   DDAC   0x08	/* Disable Dual Address Cycle       */
@@ -1302,23 +876,23 @@ struct ncr_reg {
 	#define   EXTIBMV 0x02	/* Enable 64-bit Table Ind. BMOV    */
 	#define   EXDBMV 0x01	/* Enable 64-bit Direct BMOV        */
 
-/*58*/  u_short   nc_sbdl;	/* Lowlevel: data from scsi data    */
-/*5a*/  u_short   nc_5a_;
-
-/*5c*/  u_char    nc_scr0;	/* Working register B               */
-/*5d*/  u_char    nc_scr1;	/*                                  */
-/*5e*/  u_char    nc_scr2;	/*                                  */
-/*5f*/  u_char    nc_scr3;	/*                                  */
-
-/*60*/  u_char    nc_scrx[64];	/* Working register C-R             */
-/*a0*/	u32   nc_mmrs;	/* Memory Move Read Selector        */
-/*a4*/	u32   nc_mmws;	/* Memory Move Write Selector       */
-/*a8*/	u32   nc_sfs;	/* Script Fetch Selector            */
-/*ac*/	u32   nc_drs;	/* DSA Relative Selector            */
-/*b0*/	u32   nc_sbms;	/* Static Block Move Selector       */
-/*b4*/	u32   nc_dbms;	/* Dynamic Block Move Selector      */
-/*b8*/	u32   nc_dnad64;	/* DMA Next Address 64              */
-/*bc*/	u_short   nc_scntl4;    /* C1010 only                       */
+/*58*/  u16	nc_sbdl;	/* Lowlevel: data from scsi data    */
+/*5a*/  u16	nc_5a_;
+
+/*5c*/  u8	nc_scr0;	/* Working register B               */
+/*5d*/  u8	nc_scr1;	/*                                  */
+/*5e*/  u8	nc_scr2;	/*                                  */
+/*5f*/  u8	nc_scr3;	/*                                  */
+
+/*60*/  u8	nc_scrx[64];	/* Working register C-R             */
+/*a0*/	u32	nc_mmrs;	/* Memory Move Read Selector        */
+/*a4*/	u32	nc_mmws;	/* Memory Move Write Selector       */
+/*a8*/	u32	nc_sfs;		/* Script Fetch Selector            */
+/*ac*/	u32	nc_drs;		/* DSA Relative Selector            */
+/*b0*/	u32	nc_sbms;	/* Static Block Move Selector       */
+/*b4*/	u32	nc_dbms;	/* Dynamic Block Move Selector      */
+/*b8*/	u32	nc_dnad64;	/* DMA Next Address 64              */
+/*bc*/	u16	nc_scntl4;	/* C1010 only                       */
 	#define   U3EN   0x80	/* Enable Ultra 3                   */
 	#define   AIPEN	 0x40   /* Allow check upper byte lanes     */
 	#define   XCLKH_DT 0x08 /* Extra clock of data hold on DT
@@ -1326,37 +900,37 @@ struct ncr_reg {
 	#define   XCLKH_ST 0x04 /* Extra clock of data hold on ST
 					transfer edge	            */
 
-/*be*/  u_char   nc_aipcntl0;	/* Epat Control 1 C1010 only        */
-/*bf*/  u_char   nc_aipcntl1;	/* AIP Control C1010_66 Only        */
-
-/*c0*/	u32   nc_pmjad1;	/* Phase Mismatch Jump Address 1    */
-/*c4*/	u32   nc_pmjad2;	/* Phase Mismatch Jump Address 2    */
-/*c8*/	u_char    nc_rbc;	/* Remaining Byte Count             */
-/*c9*/	u_char    nc_rbc1;	/*                                  */
-/*ca*/	u_char    nc_rbc2;	/*                                  */
-/*cb*/	u_char    nc_rbc3;	/*                                  */
-
-/*cc*/	u_char    nc_ua;	/* Updated Address                  */
-/*cd*/	u_char    nc_ua1;	/*                                  */
-/*ce*/	u_char    nc_ua2;	/*                                  */
-/*cf*/	u_char    nc_ua3;	/*                                  */
-/*d0*/	u32   nc_esa;	/* Entry Storage Address            */
-/*d4*/	u_char    nc_ia;	/* Instruction Address              */
-/*d5*/	u_char    nc_ia1;
-/*d6*/	u_char    nc_ia2;
-/*d7*/	u_char    nc_ia3;
-/*d8*/	u32   nc_sbc;	/* SCSI Byte Count (3 bytes only)   */
-/*dc*/	u32   nc_csbc;	/* Cumulative SCSI Byte Count       */
-
-                                /* Following for C1010 only         */
-/*e0*/ u_short    nc_crcpad;    /* CRC Value                        */
-/*e2*/ u_char     nc_crccntl0;  /* CRC control register             */
+/*be*/  u8	nc_aipcntl0;	/* Epat Control 1 C1010 only        */
+/*bf*/  u8	nc_aipcntl1;	/* AIP Control C1010_66 Only        */
+
+/*c0*/	u32	nc_pmjad1;	/* Phase Mismatch Jump Address 1    */
+/*c4*/	u32	nc_pmjad2;	/* Phase Mismatch Jump Address 2    */
+/*c8*/	u8	nc_rbc;		/* Remaining Byte Count             */
+/*c9*/	u8	nc_rbc1;	/*                                  */
+/*ca*/	u8	nc_rbc2;	/*                                  */
+/*cb*/	u8	nc_rbc3;	/*                                  */
+
+/*cc*/	u8	nc_ua;		/* Updated Address                  */
+/*cd*/	u8	nc_ua1;		/*                                  */
+/*ce*/	u8	nc_ua2;		/*                                  */
+/*cf*/	u8	nc_ua3;		/*                                  */
+/*d0*/	u32	nc_esa;		/* Entry Storage Address            */
+/*d4*/	u8	nc_ia;		/* Instruction Address              */
+/*d5*/	u8	nc_ia1;
+/*d6*/	u8	nc_ia2;
+/*d7*/	u8	nc_ia3;
+/*d8*/	u32	nc_sbc;		/* SCSI Byte Count (3 bytes only)   */
+/*dc*/	u32	nc_csbc;	/* Cumulative SCSI Byte Count       */
+
+				/* Following for C1010 only         */
+/*e0*/  u16	nc_crcpad;	/* CRC Value                        */
+/*e2*/  u8	nc_crccntl0;	/* CRC control register             */
 	#define   SNDCRC  0x10	/* Send CRC Request                 */
-/*e3*/ u_char     nc_crccntl1;  /* CRC control register             */
-/*e4*/ u32    nc_crcdata;   /* CRC data register                */ 
-/*e8*/ u32	  nc_e8_;	/* rsvd 			    */
-/*ec*/ u32	  nc_ec_;	/* rsvd 			    */
-/*f0*/ u_short    nc_dfbc;      /* DMA FIFO byte count              */ 
+/*e3*/  u8	nc_crccntl1;	/* CRC control register             */
+/*e4*/  u32	nc_crcdata;	/* CRC data register                */ 
+/*e8*/  u32	nc_e8_;		/* rsvd 			    */
+/*ec*/  u32	nc_ec_;		/* rsvd 			    */
+/*f0*/  u16	nc_dfbc;	/* DMA FIFO byte count              */ 
 
 };
 
@@ -1449,17 +1023,17 @@ struct scr_tblmove {
 
 #ifdef SCSI_NCR_BIG_ENDIAN
 struct scr_tblsel {
-        u_char  sel_scntl3;
-        u_char  sel_id;
-        u_char  sel_sxfer;
-        u_char  sel_scntl4;	
+        u8	sel_scntl3;
+        u8	sel_id;
+        u8	sel_sxfer;
+        u8	sel_scntl4;	
 };
 #else
 struct scr_tblsel {
-        u_char  sel_scntl4;	
-        u_char  sel_sxfer;
-        u_char  sel_id;
-        u_char  sel_scntl3;
+        u8	sel_scntl4;	
+        u8	sel_sxfer;
+        u8	sel_id;
+        u8	sel_scntl3;
 };
 #endif
 
@@ -1763,6 +1337,4 @@ struct scr_tblsel {
  * End of ncrreg from FreeBSD
  */
 
-#endif /* !defined HOSTS_C */
-
 #endif /* defined SYM53C8XX_DEFS_H */
diff --git a/drivers/scsi/t128.c b/drivers/scsi/t128.c
index addbdb529..7ef1b8c92 100644
--- a/drivers/scsi/t128.c
+++ b/drivers/scsi/t128.c
@@ -118,7 +118,7 @@
 #include <linux/delay.h>
 
 #include "scsi.h"
-#include "hosts.h"
+#include <scsi/scsi_host.h>
 #include "t128.h"
 #define AUTOPROBE_IRQ
 #include "NCR5380.h"
diff --git a/drivers/scsi/tmscsim.c b/drivers/scsi/tmscsim.c
index c9c6cbc26..1b324b800 100644
--- a/drivers/scsi/tmscsim.c
+++ b/drivers/scsi/tmscsim.c
@@ -172,6 +172,11 @@
  *	2.1b1 04/01/31	GL	(applied 05.04) Remove internal		*
  *				command-queuing.			*
  *	2.1b2 04/02/01	CH	(applied 05.04) Fix error-handling	*
+ *	2.1c  04/05/23  GL	Update to use the new pci_driver API,	*
+ *				some scsi EH updates, more cleanup.	*
+ *	2.1d  04/05/27	GL	Moved setting of scan_devices to	*
+ *				slave_alloc/_configure/_destroy, as	*
+ *				suggested by CH.			*
  ***********************************************************************/
 
 /* Uncomment SA_INTERRUPT, if the driver refuses to share its IRQ with other devices */
@@ -216,11 +221,8 @@
 #endif
 #define DCBDEBUG1(x) C_NOP
 
-/* Includes */
+#include <linux/config.h>
 #include <linux/module.h>
-#include <asm/dma.h>
-#include <asm/io.h>
-#include <asm/system.h>
 #include <linux/delay.h>
 #include <linux/signal.h>
 #include <linux/sched.h>
@@ -230,45 +232,30 @@
 #include <linux/pci.h>
 #include <linux/proc_fs.h>
 #include <linux/string.h>
-#include <linux/ctype.h>
 #include <linux/mm.h>
-#include <linux/config.h>
-#include <linux/version.h>
 #include <linux/blkdev.h>
 #include <linux/timer.h>
 #include <linux/interrupt.h>
+#include <linux/init.h>
+#include <linux/spinlock.h>
+#include <asm/io.h>
 
+#if 0
+#include <scsi/scsi.h>
+#include <scsi/scsi_cmnd.h>
+#include <scsi/scsi_device.h>
+#else
 #include "scsi.h"
-#include "hosts.h"
-#include <linux/stat.h>
+#endif
+#include <scsi/scsi_host.h>
 #include <scsi/scsicam.h>
 
 #include "dc390.h"
 
 #define PCI_DEVICE_ID_AMD53C974 	PCI_DEVICE_ID_AMD_SCSI
 
-/* Locking */
-
-/* Note: Starting from 2.1.9x, the mid-level scsi code issues a 
- * spinlock_irqsave (&io_request_lock) before calling the driver's 
- * routines, so we don't need to lock, except in the IRQ handler.
- * The policy 3, let the midlevel scsi code do the io_request_locks
- * and us locking on a driver specific lock, shouldn't hurt anybody; it
- * just causes a minor performance degradation for setting the locks.
- */
-
-/* spinlock things
- * level 3: lock on both adapter specific locks and (global) io_request_lock
- * level 2: lock on adapter specific locks only
- * level 1: rely on the locking of the mid level code (io_request_lock)
- * undef  : traditional save_flags; cli; restore_flags;
- */
-
-#include <linux/init.h>
-#include <linux/spinlock.h>
 
-#if defined(MODULE)
-static struct pci_device_id tmscsim_pci_tbl[] = {
+ static struct pci_device_id tmscsim_pci_tbl[] = {
 	{
 		.vendor		= PCI_VENDOR_ID_AMD,
 		.device		= PCI_DEVICE_ID_AMD53C974,
@@ -278,91 +265,61 @@ static struct pci_device_id tmscsim_pci_tbl[] = {
 	{ }		/* Terminating entry */
 };
 MODULE_DEVICE_TABLE(pci, tmscsim_pci_tbl);
-#endif
-	
-#define USE_SPINLOCKS 1
-
-#define DC390_IFLAGS unsigned long iflags
-#define DC390_LOCK_IO(dev) spin_lock_irqsave (((struct Scsi_Host *)dev)->host_lock, iflags)
-#define DC390_UNLOCK_IO(dev) spin_unlock_irqrestore (((struct Scsi_Host *)dev)->host_lock, iflags)
-
-/* These macros are used for uniform access to 2.0.x and 2.1.x PCI config space*/
-
-#define PDEV pdev
-#define PDEVDECL struct pci_dev *pdev
-#define PDEVDECL0 struct pci_dev *pdev = NULL
-#define PDEVDECL1 struct pci_dev *pdev
-#define PDEVSET pACB->pdev=pdev
-#define PDEVSET1 pdev=pACB->pdev
-#define PCI_WRITE_CONFIG_BYTE(pd, rv, bv) pci_write_config_byte (pd, rv, bv)
-#define PCI_READ_CONFIG_BYTE(pd, rv, bv) pci_read_config_byte (pd, rv, bv)
-#define PCI_WRITE_CONFIG_WORD(pd, rv, bv) pci_write_config_word (pd, rv, bv)
-#define PCI_READ_CONFIG_WORD(pd, rv, bv) pci_read_config_word (pd, rv, bv)
-#define PCI_PRESENT (1)
-#define PCI_GET_IO_AND_IRQ do{io_port = pci_resource_start (pdev, 0); irq = pdev->irq;} while(0)
 
 #include "tmscsim.h"
 
-#ifndef __init
-# define __init
-#endif
-
-static UCHAR dc390_StartSCSI( PACB pACB, PDCB pDCB, PSRB pSRB );
-static void dc390_DataOut_0( PACB pACB, PSRB pSRB, PUCHAR psstatus);
-static void dc390_DataIn_0( PACB pACB, PSRB pSRB, PUCHAR psstatus);
-static void dc390_Command_0( PACB pACB, PSRB pSRB, PUCHAR psstatus);
-static void dc390_Status_0( PACB pACB, PSRB pSRB, PUCHAR psstatus);
-static void dc390_MsgOut_0( PACB pACB, PSRB pSRB, PUCHAR psstatus);
-static void dc390_MsgIn_0( PACB pACB, PSRB pSRB, PUCHAR psstatus);
-static void dc390_DataOutPhase( PACB pACB, PSRB pSRB, PUCHAR psstatus);
-static void dc390_DataInPhase( PACB pACB, PSRB pSRB, PUCHAR psstatus);
-static void dc390_CommandPhase( PACB pACB, PSRB pSRB, PUCHAR psstatus);
-static void dc390_StatusPhase( PACB pACB, PSRB pSRB, PUCHAR psstatus);
-static void dc390_MsgOutPhase( PACB pACB, PSRB pSRB, PUCHAR psstatus);
-static void dc390_MsgInPhase( PACB pACB, PSRB pSRB, PUCHAR psstatus);
-static void dc390_Nop_0( PACB pACB, PSRB pSRB, PUCHAR psstatus);
-static void dc390_Nop_1( PACB pACB, PSRB pSRB, PUCHAR psstatus);
-
-static void dc390_SetXferRate( PACB pACB, PDCB pDCB );
-static void dc390_Disconnect( PACB pACB );
-static void dc390_Reselect( PACB pACB );
-static void dc390_SRBdone( PACB pACB, PDCB pDCB, PSRB pSRB );
-static void dc390_DoingSRB_Done( PACB pACB, PSCSICMD cmd );
-static void dc390_ScsiRstDetect( PACB pACB );
-static void dc390_ResetSCSIBus( PACB pACB );
-static void __inline__ dc390_RequestSense( PACB pACB, PDCB pDCB, PSRB pSRB );
-static void __inline__ dc390_InvalidCmd( PACB pACB );
-static void __inline__ dc390_EnableMsgOut_Abort (PACB, PSRB);
-static void dc390_remove_dev (PACB pACB, PDCB pDCB);
+static u8 dc390_StartSCSI( struct dc390_acb* pACB, struct dc390_dcb* pDCB, struct dc390_srb* pSRB );
+static void dc390_DataOut_0( struct dc390_acb* pACB, struct dc390_srb* pSRB, u8 *psstatus);
+static void dc390_DataIn_0( struct dc390_acb* pACB, struct dc390_srb* pSRB, u8 *psstatus);
+static void dc390_Command_0( struct dc390_acb* pACB, struct dc390_srb* pSRB, u8 *psstatus);
+static void dc390_Status_0( struct dc390_acb* pACB, struct dc390_srb* pSRB, u8 *psstatus);
+static void dc390_MsgOut_0( struct dc390_acb* pACB, struct dc390_srb* pSRB, u8 *psstatus);
+static void dc390_MsgIn_0( struct dc390_acb* pACB, struct dc390_srb* pSRB, u8 *psstatus);
+static void dc390_DataOutPhase( struct dc390_acb* pACB, struct dc390_srb* pSRB, u8 *psstatus);
+static void dc390_DataInPhase( struct dc390_acb* pACB, struct dc390_srb* pSRB, u8 *psstatus);
+static void dc390_CommandPhase( struct dc390_acb* pACB, struct dc390_srb* pSRB, u8 *psstatus);
+static void dc390_StatusPhase( struct dc390_acb* pACB, struct dc390_srb* pSRB, u8 *psstatus);
+static void dc390_MsgOutPhase( struct dc390_acb* pACB, struct dc390_srb* pSRB, u8 *psstatus);
+static void dc390_MsgInPhase( struct dc390_acb* pACB, struct dc390_srb* pSRB, u8 *psstatus);
+static void dc390_Nop_0( struct dc390_acb* pACB, struct dc390_srb* pSRB, u8 *psstatus);
+static void dc390_Nop_1( struct dc390_acb* pACB, struct dc390_srb* pSRB, u8 *psstatus);
+
+static void dc390_SetXferRate( struct dc390_acb* pACB, struct dc390_dcb* pDCB );
+static void dc390_Disconnect( struct dc390_acb* pACB );
+static void dc390_Reselect( struct dc390_acb* pACB );
+static void dc390_SRBdone( struct dc390_acb* pACB, struct dc390_dcb* pDCB, struct dc390_srb* pSRB );
+static void dc390_DoingSRB_Done( struct dc390_acb* pACB, struct scsi_cmnd * cmd);
+static void dc390_ScsiRstDetect( struct dc390_acb* pACB );
+static void dc390_ResetSCSIBus( struct dc390_acb* pACB );
+static void __inline__ dc390_RequestSense( struct dc390_acb* pACB, struct dc390_dcb* pDCB, struct dc390_srb* pSRB );
+static void __inline__ dc390_InvalidCmd( struct dc390_acb* pACB );
+static void __inline__ dc390_EnableMsgOut_Abort (struct dc390_acb*, struct dc390_srb*);
 static irqreturn_t do_DC390_Interrupt( int, void *, struct pt_regs *);
 
-static int    dc390_initAdapter( PSH psh, ULONG io_port, UCHAR Irq, UCHAR index );
-static void   dc390_initDCB( PACB pACB, PDCB *ppDCB, UCHAR id, UCHAR lun);
-static void   dc390_updateDCB (PACB pACB, PDCB pDCB);
+static int    dc390_initAdapter(struct Scsi_Host *psh, unsigned long io_port, u8 Irq, u8 index );
+static void   dc390_updateDCB (struct dc390_acb* pACB, struct dc390_dcb* pDCB);
 
-static int DC390_release(struct Scsi_Host *host);
-static int dc390_shutdown (struct Scsi_Host *host);
+static int DC390_proc_info (struct Scsi_Host *shpnt, char *buffer, char **start,
+			    off_t offset, int length, int inout);
 
-static PACB	dc390_pACB_start= NULL;
-static PACB	dc390_pACB_current = NULL;
-static ULONG	dc390_lastabortedpid = 0;
-static UINT	dc390_laststatus = 0;
-static UCHAR	dc390_adapterCnt = 0;
+static struct dc390_acb*	dc390_pACB_start= NULL;
+static struct dc390_acb*	dc390_pACB_current = NULL;
+static unsigned long	dc390_lastabortedpid = 0;
+static u32	dc390_laststatus = 0;
+static u8	dc390_adapterCnt = 0;
 
 /* Startup values, to be overriden on the commandline */
 static int tmscsim[] = {-2, -2, -2, -2, -2, -2};
+static int tmscsim_paramnum = ARRAY_SIZE(tmscsim);
 
-#if defined(MODULE)
-MODULE_PARM(tmscsim, "1-6i");
+module_param_array(tmscsim, int, tmscsim_paramnum, 0);
 MODULE_PARM_DESC(tmscsim, "Host SCSI ID, Speed (0=10MHz), Device Flags, Adapter Flags, Max Tags (log2(tags)-1), DelayReset (s)");
 MODULE_AUTHOR("C.L. Huang / Kurt Garloff");
 MODULE_DESCRIPTION("SCSI host adapter driver for Tekram DC390 and other AMD53C974A based PCI SCSI adapters");
 MODULE_LICENSE("GPL");
-
 MODULE_SUPPORTED_DEVICE("sd,sr,sg,st");
-#endif
 
-static PVOID dc390_phase0[]={
+static void *dc390_phase0[]={
        dc390_DataOut_0,
        dc390_DataIn_0,
        dc390_Command_0,
@@ -374,7 +331,7 @@ static PVOID dc390_phase0[]={
        dc390_Nop_1
        };
 
-static PVOID dc390_phase1[]={
+static void *dc390_phase1[]={
        dc390_DataOutPhase,
        dc390_DataInPhase,
        dc390_CommandPhase,
@@ -413,15 +370,15 @@ static char* dc390_p1_str[] = {
 #endif   
 
 /* Devices erroneously pretending to be able to do TagQ */
-static UCHAR  dc390_baddevname1[2][28] ={
+static u8  dc390_baddevname1[2][28] ={
        "SEAGATE ST3390N         9546",
        "HP      C3323-300       4269"};
 #define BADDEVCNT	2
 
 static char*  dc390_adapname = "DC390";
-static UCHAR  dc390_eepromBuf[MAX_ADAPTER_NUM][EE_LEN];
-static UCHAR  dc390_clock_period1[] = {4, 5, 6, 7, 8, 10, 13, 20};
-static UCHAR  dc390_clock_speed[] = {100,80,67,57,50, 40, 31, 20};
+static u8  dc390_eepromBuf[MAX_ADAPTER_NUM][EE_LEN];
+static u8  dc390_clock_period1[] = {4, 5, 6, 7, 8, 10, 13, 20};
+static u8  dc390_clock_speed[] = {100,80,67,57,50, 40, 31, 20};
 
 /***********************************************************************
  * Functions for access to DC390 EEPROM
@@ -430,51 +387,50 @@ static UCHAR  dc390_clock_speed[] = {100,80,67,57,50, 40, 31, 20};
  **********************************************************************/
 
 
-static void __init dc390_EnDisableCE( UCHAR mode, PDEVDECL, PUCHAR regval )
+static void __devinit dc390_EnDisableCE(u8 mode, struct pci_dev *pdev, u8 *regval)
 {
-    UCHAR bval;
+    u8 bval;
 
     bval = 0;
     if(mode == ENABLE_CE)
 	*regval = 0xc0;
     else
 	*regval = 0x80;
-    PCI_WRITE_CONFIG_BYTE(PDEV, *regval, bval);
+    pci_write_config_byte(pdev, *regval, bval);
     if(mode == DISABLE_CE)
-        PCI_WRITE_CONFIG_BYTE(PDEV, *regval, bval);
+        pci_write_config_byte(pdev, *regval, bval);
     udelay(160);
 }
 
 
 /* Override EEprom values with explicitly set values */
-static void __init dc390_EEprom_Override (UCHAR index)
+static void __devinit dc390_EEprom_Override (u8 index)
 {
-    PUCHAR ptr;
-    UCHAR  id;
-    ptr = (PUCHAR) dc390_eepromBuf[index];
+    u8 *ptr = (u8 *) dc390_eepromBuf[index];
+    u8 id;
     
     /* Adapter Settings */
     if (tmscsim[0] != -2)
-	ptr[EE_ADAPT_SCSI_ID] = (UCHAR)tmscsim[0];	/* Adapter ID */
+	ptr[EE_ADAPT_SCSI_ID] = (u8)tmscsim[0];	/* Adapter ID */
     if (tmscsim[3] != -2)
-	ptr[EE_MODE2] = (UCHAR)tmscsim[3];
+	ptr[EE_MODE2] = (u8)tmscsim[3];
     if (tmscsim[5] != -2)
 	ptr[EE_DELAY] = tmscsim[5];			/* Reset delay */
     if (tmscsim[4] != -2)
-	ptr[EE_TAG_CMD_NUM] = (UCHAR)tmscsim[4];	/* Tagged Cmds */
+	ptr[EE_TAG_CMD_NUM] = (u8)tmscsim[4];	/* Tagged Cmds */
     
     /* Device Settings */
     for (id = 0; id < MAX_SCSI_ID; id++)
     {
 	if (tmscsim[2] != -2)
-		ptr[id<<2] = (UCHAR)tmscsim[2];		/* EE_MODE1 */
+		ptr[id<<2] = (u8)tmscsim[2];		/* EE_MODE1 */
 	if (tmscsim[1] != -2)
-		ptr[(id<<2) + 1] = (UCHAR)tmscsim[1];	/* EE_Speed */
+		ptr[(id<<2) + 1] = (u8)tmscsim[1];	/* EE_Speed */
     }
 }
 
 /* Handle "-1" case */
-static void __init dc390_check_for_safe_settings (void)
+static void __devinit dc390_check_for_safe_settings (void)
 {
 	if (tmscsim[0] == -1 || tmscsim[0] > 15) /* modules-2.0.0 passes -1 as string */
 	{
@@ -497,7 +453,7 @@ static int __initdata tmscsim_def[] = {7, 0 /* 10MHz */,
 		, 3 /* 16 Tags per LUN */, 1 /* s delay after Reset */ };
 
 /* Copy defaults over set values where missing */
-static void __init dc390_fill_with_defaults (void)
+static void __devinit dc390_fill_with_defaults (void)
 {
 	int i;
 	PARSEDEBUG(printk(KERN_INFO "DC390: setup %08x %08x %08x %08x %08x %08x\n", tmscsim[0],\
@@ -514,6 +470,7 @@ static void __init dc390_fill_with_defaults (void)
 	if (tmscsim[5] > 180) tmscsim[5] = 180;
 }
 
+#ifndef MODULE
 /* Override defaults on cmdline:
  * tmscsim: AdaptID, MaxSpeed (Index), DevMode (Bitmapped), AdaptMode (Bitmapped)
  */
@@ -533,40 +490,40 @@ static int __init dc390_setup (char *str)
 	/* dc390_checkparams (); */
 	return 1;
 }
-#ifndef MODULE
+
 __setup("tmscsim=", dc390_setup);
 #endif
 
-static void __init dc390_EEpromOutDI( PDEVDECL, PUCHAR regval, UCHAR Carry )
+static void __devinit dc390_EEpromOutDI(struct pci_dev *pdev, u8 *regval, u8 Carry)
 {
-    UCHAR bval;
+    u8 bval;
 
     bval = 0;
     if(Carry)
     {
 	bval = 0x40;
 	*regval = 0x80;
-	PCI_WRITE_CONFIG_BYTE(PDEV, *regval, bval);
+	pci_write_config_byte(pdev, *regval, bval);
     }
     udelay(160);
     bval |= 0x80;
-    PCI_WRITE_CONFIG_BYTE(PDEV, *regval, bval);
+    pci_write_config_byte(pdev, *regval, bval);
     udelay(160);
     bval = 0;
-    PCI_WRITE_CONFIG_BYTE(PDEV, *regval, bval);
+    pci_write_config_byte(pdev, *regval, bval);
     udelay(160);
 }
 
 
-static UCHAR __init dc390_EEpromInDO( PDEVDECL )
+static u8 __devinit dc390_EEpromInDO(struct pci_dev *pdev)
 {
-    UCHAR bval;
+    u8 bval;
 
-    PCI_WRITE_CONFIG_BYTE(PDEV, 0x80, 0x80);
+    pci_write_config_byte(pdev, 0x80, 0x80);
     udelay(160);
-    PCI_WRITE_CONFIG_BYTE(PDEV, 0x80, 0x40);
+    pci_write_config_byte(pdev, 0x80, 0x40);
     udelay(160);
-    PCI_READ_CONFIG_BYTE(PDEV, 0x00, &bval);
+    pci_read_config_byte(pdev, 0x00, &bval);
     if(bval == 0x22)
 	return(1);
     else
@@ -574,68 +531,68 @@ static UCHAR __init dc390_EEpromInDO( PDEVDECL )
 }
 
 
-static USHORT __init dc390_EEpromGetData1( PDEVDECL )
+static u16 __devinit dc390_EEpromGetData1(struct pci_dev *pdev)
 {
-    UCHAR i;
-    UCHAR carryFlag;
-    USHORT wval;
+    u8 i;
+    u8 carryFlag;
+    u16 wval;
 
     wval = 0;
     for(i=0; i<16; i++)
     {
 	wval <<= 1;
-	carryFlag = dc390_EEpromInDO(PDEV);
+	carryFlag = dc390_EEpromInDO(pdev);
 	wval |= carryFlag;
     }
     return(wval);
 }
 
 
-static void __init dc390_Prepare( PDEVDECL, PUCHAR regval, UCHAR EEpromCmd )
+static void __devinit dc390_Prepare(struct pci_dev *pdev, u8 *regval, u8 EEpromCmd)
 {
-    UCHAR i,j;
-    UCHAR carryFlag;
+    u8 i,j;
+    u8 carryFlag;
 
     carryFlag = 1;
     j = 0x80;
     for(i=0; i<9; i++)
     {
-	dc390_EEpromOutDI(PDEV,regval,carryFlag);
+	dc390_EEpromOutDI(pdev, regval, carryFlag);
 	carryFlag = (EEpromCmd & j) ? 1 : 0;
 	j >>= 1;
     }
 }
 
 
-static void __init dc390_ReadEEprom( PDEVDECL, PUSHORT ptr)
+static void __devinit dc390_ReadEEprom(struct pci_dev *pdev, u16 *ptr)
 {
-    UCHAR   regval,cmd;
-    UCHAR   i;
+    u8   regval,cmd;
+    u8   i;
 
     cmd = EEPROM_READ;
     for(i=0; i<0x40; i++)
     {
-	dc390_EnDisableCE(ENABLE_CE, PDEV, &regval);
-	dc390_Prepare(PDEV, &regval, cmd++);
-	*ptr++ = dc390_EEpromGetData1(PDEV);
-	dc390_EnDisableCE(DISABLE_CE, PDEV, &regval);
+	dc390_EnDisableCE(ENABLE_CE, pdev, &regval);
+	dc390_Prepare(pdev, &regval, cmd++);
+	*ptr++ = dc390_EEpromGetData1(pdev);
+	dc390_EnDisableCE(DISABLE_CE, pdev, &regval);
     }
 }
 
 
-static void __init dc390_interpret_delay (UCHAR index)
+static void __devinit dc390_interpret_delay (u8 index)
 {
     char interpd [] = {1,3,5,10,16,30,60,120};
     dc390_eepromBuf[index][EE_DELAY] = interpd [dc390_eepromBuf[index][EE_DELAY]];
 }
 
-static UCHAR __init dc390_CheckEEpromCheckSum( PDEVDECL, UCHAR index )
+static u8 __devinit dc390_CheckEEpromCheckSum(struct pci_dev *pdev, u8 index)
 {
-    UCHAR  i;
+    u8  i;
     char  EEbuf[128];
-    USHORT wval, *ptr = (PUSHORT)EEbuf;
+    u16 wval, *ptr = (u16 *)EEbuf;
 
-    dc390_ReadEEprom( PDEV, ptr );
+    dc390_ReadEEprom(pdev, ptr);
     memcpy (dc390_eepromBuf[index], EEbuf, EE_ADAPT_SCSI_ID);
     memcpy (&dc390_eepromBuf[index][EE_ADAPT_SCSI_ID], 
 	    &EEbuf[REAL_EE_ADAPT_SCSI_ID], EE_LEN - EE_ADAPT_SCSI_ID);
@@ -653,9 +610,9 @@ static UCHAR __init dc390_CheckEEpromCheckSum( PDEVDECL, UCHAR index )
  * (DCBs, SRBs, Queueing)
  *
  **********************************************************************/
-static PDCB __inline__ dc390_findDCB ( PACB pACB, UCHAR id, UCHAR lun)
+static struct dc390_dcb __inline__ *dc390_findDCB ( struct dc390_acb* pACB, u8 id, u8 lun)
 {
-   PDCB pDCB = pACB->pLinkDCB; if (!pDCB) return 0;
+   struct dc390_dcb* pDCB = pACB->pLinkDCB; if (!pDCB) return 0;
    while (pDCB->TargetID != id || pDCB->TargetLUN != lun)
      {
 	pDCB = pDCB->pNextDCB;
@@ -685,26 +642,10 @@ static PDCB __inline__ dc390_findDCB ( PACB pACB, UCHAR id, UCHAR lun)
  * Lists are managed using two pointers and eventually a counter
  */
 
-
-#if 0
-/* Look for a SCSI cmd in a SRB queue */
-static PSRB dc390_find_cmd_in_SRBq (PSCSICMD cmd, PSRB queue)
-{
-    PSRB q = queue;
-    while (q)
-    {
-	if (q->pcmd == cmd) return q;
-	q = q->pNextSRB;
-	if (q == queue) return 0;
-    }
-    return q;
-}
-#endif
-
 /* Return next free SRB */
-static __inline__ PSRB dc390_Free_get ( PACB pACB )
+static __inline__ struct dc390_srb* dc390_Free_get ( struct dc390_acb* pACB )
 {
-    PSRB   pSRB;
+    struct dc390_srb*   pSRB;
 
     pSRB = pACB->pFreeSRB;
     DEBUG0(printk ("DC390: Get Free SRB %p\n", pSRB));
@@ -718,7 +659,7 @@ static __inline__ PSRB dc390_Free_get ( PACB pACB )
 }
 
 /* Insert SRB oin top of free list */
-static __inline__ void dc390_Free_insert (PACB pACB, PSRB pSRB)
+static __inline__ void dc390_Free_insert (struct dc390_acb* pACB, struct dc390_srb* pSRB)
 {
     DEBUG0(printk ("DC390: Free SRB %p\n", pSRB));
     pSRB->pNextSRB = pACB->pFreeSRB;
@@ -727,7 +668,7 @@ static __inline__ void dc390_Free_insert (PACB pACB, PSRB pSRB)
 
 
 /* Inserts a SRB to the top of the Waiting list */
-static __inline__ void dc390_Waiting_insert ( PDCB pDCB, PSRB pSRB )
+static __inline__ void dc390_Waiting_insert ( struct dc390_dcb* pDCB, struct dc390_srb* pSRB )
 {
     DEBUG0(printk ("DC390: Insert pSRB %p cmd %li to Waiting\n", pSRB, pSRB->pcmd->pid));
     pSRB->pNextSRB = pDCB->pWaitingSRB;
@@ -739,7 +680,7 @@ static __inline__ void dc390_Waiting_insert ( PDCB pDCB, PSRB pSRB )
 
 
 /* Queue SRB to waiting list */
-static __inline__ void dc390_Waiting_append ( PDCB pDCB, PSRB pSRB)
+static __inline__ void dc390_Waiting_append ( struct dc390_dcb* pDCB, struct dc390_srb* pSRB)
 {
 	DEBUG0(printk ("DC390: Append pSRB %p cmd %li to Waiting\n", pSRB, pSRB->pcmd->pid));
     if( pDCB->pWaitingSRB )
@@ -753,7 +694,7 @@ static __inline__ void dc390_Waiting_append ( PDCB pDCB, PSRB pSRB)
     pDCB->pDCBACB->CmdInQ++;
 }
 
-static __inline__ void dc390_Going_append (PDCB pDCB, PSRB pSRB)
+static __inline__ void dc390_Going_append (struct dc390_dcb* pDCB, struct dc390_srb* pSRB)
 {
     pDCB->GoingSRBCnt++;
     DEBUG0(printk("DC390: Append SRB %p to Going\n", pSRB));
@@ -768,14 +709,14 @@ static __inline__ void dc390_Going_append (PDCB pDCB, PSRB pSRB)
     pSRB->pNextSRB = NULL;
 }
 
-static __inline__ void dc390_Going_remove (PDCB pDCB, PSRB pSRB)
+static __inline__ void dc390_Going_remove (struct dc390_dcb* pDCB, struct dc390_srb* pSRB)
 {
 	DEBUG0(printk("DC390: Remove SRB %p from Going\n", pSRB));
    if (pSRB == pDCB->pGoingSRB)
 	pDCB->pGoingSRB = pSRB->pNextSRB;
    else
      {
-	PSRB psrb = pDCB->pGoingSRB;
+	struct dc390_srb* psrb = pDCB->pGoingSRB;
 	while (psrb && psrb->pNextSRB != pSRB)
 	  psrb = psrb->pNextSRB;
 	if (!psrb) 
@@ -788,7 +729,7 @@ static __inline__ void dc390_Going_remove (PDCB pDCB, PSRB pSRB)
 }
 
 /* Moves SRB from Going list to the top of Waiting list */
-static void dc390_Going_to_Waiting ( PDCB pDCB, PSRB pSRB )
+static void dc390_Going_to_Waiting ( struct dc390_dcb* pDCB, struct dc390_srb* pSRB )
 {
     DEBUG0(printk(KERN_INFO "DC390: Going_to_Waiting (SRB %p) pid = %li\n", pSRB, pSRB->pcmd->pid));
     /* Remove SRB from Going */
@@ -799,7 +740,7 @@ static void dc390_Going_to_Waiting ( PDCB pDCB, PSRB pSRB )
 }
 
 /* Moves first SRB from Waiting list to Going list */
-static __inline__ void dc390_Waiting_to_Going ( PDCB pDCB, PSRB pSRB )
+static __inline__ void dc390_Waiting_to_Going ( struct dc390_dcb* pDCB, struct dc390_srb* pSRB )
 {	
 	/* Remove from waiting list */
 	DEBUG0(printk("DC390: Remove SRB %p from head of Waiting\n", pSRB));
@@ -811,7 +752,7 @@ static __inline__ void dc390_Waiting_to_Going ( PDCB pDCB, PSRB pSRB )
 
 static void DC390_waiting_timed_out (unsigned long ptr);
 /* Sets the timer to wake us up */
-static void dc390_waiting_timer (PACB pACB, unsigned long to)
+static void dc390_waiting_timer (struct dc390_acb* pACB, unsigned long to)
 {
 	if (timer_pending (&pACB->Waiting_Timer)) return;
 	init_timer (&pACB->Waiting_Timer);
@@ -826,10 +767,10 @@ static void dc390_waiting_timer (PACB pACB, unsigned long to)
 
 
 /* Send the next command from the waiting list to the bus */
-static void dc390_Waiting_process ( PACB pACB )
+static void dc390_Waiting_process ( struct dc390_acb* pACB )
 {
-    PDCB   ptr, ptr1;
-    PSRB   pSRB;
+    struct dc390_dcb *ptr, *ptr1;
+    struct dc390_srb *pSRB;
 
     if( (pACB->pActiveDCB) || (pACB->ACBFlag & (RESET_DETECT+RESET_DONE+RESET_DEV) ) )
 	return;
@@ -864,24 +805,24 @@ static void dc390_Waiting_process ( PACB pACB )
 /* Wake up waiting queue */
 static void DC390_waiting_timed_out (unsigned long ptr)
 {
-	PACB pACB = (PACB)ptr;
-	DC390_IFLAGS;
+	struct dc390_acb* pACB = (struct dc390_acb*)ptr;
+	unsigned long iflags;
 	DEBUG0(printk ("DC390: Debug: Waiting queue woken up by timer!\n"));
-	DC390_LOCK_IO(pACB->pScsiHost);
+	spin_lock_irqsave(pACB->pScsiHost->host_lock, iflags);
 	dc390_Waiting_process (pACB);
-	DC390_UNLOCK_IO(pACB->pScsiHost);
+	spin_unlock_irqrestore(pACB->pScsiHost->host_lock, iflags);
 }
 
 /***********************************************************************
- * Function: static void dc390_SendSRB (PACB pACB, PSRB pSRB)
+ * Function: static void dc390_SendSRB (struct dc390_acb* pACB, struct dc390_srb* pSRB)
  *
  * Purpose: Send SCSI Request Block (pSRB) to adapter (pACB)
  *
  ***********************************************************************/
 
-static void dc390_SendSRB( PACB pACB, PSRB pSRB )
+static void dc390_SendSRB( struct dc390_acb* pACB, struct dc390_srb* pSRB )
 {
-    PDCB   pDCB;
+    struct dc390_dcb*   pDCB;
 
     pDCB = pSRB->pSRBDCB;
     if( (pDCB->MaxCommand <= pDCB->GoingSRBCnt) || (pACB->pActiveDCB) ||
@@ -913,85 +854,91 @@ static void dc390_SendSRB( PACB pACB, PSRB pSRB )
     }
 }
 
+static struct scatterlist* dc390_sg_build_single(struct scatterlist *sg, void *addr, unsigned int length)
+{
+	memset(sg, 0, sizeof(struct scatterlist));
+	sg->page	= virt_to_page(addr);
+	sg->length	= length;
+	sg->offset	= (unsigned long)addr & ~PAGE_MASK;
+	return sg;
+}
 
 /* Create pci mapping */
-static int dc390_pci_map (PSRB pSRB)
+static int dc390_pci_map (struct dc390_srb* pSRB)
 {
 	int error = 0;
-	Scsi_Cmnd *pcmd = pSRB->pcmd;
+	struct scsi_cmnd *pcmd = pSRB->pcmd;
 	struct pci_dev *pdev = pSRB->pSRBDCB->pDCBACB->pdev;
 	dc390_cmd_scp_t* cmdp = ((dc390_cmd_scp_t*)(&pcmd->SCp));
+
 	/* Map sense buffer */
 	if (pSRB->SRBFlag & AUTO_REQSENSE) {
-		sg_dma_address(&pSRB->Segmentx) = cmdp->saved_dma_handle = 
-			pci_map_page(pdev, virt_to_page(pcmd->sense_buffer),
-				     (unsigned long)pcmd->sense_buffer & ~PAGE_MASK, sizeof(pcmd->sense_buffer),
-				     DMA_FROM_DEVICE);
-		sg_dma_len(&pSRB->Segmentx) = sizeof(pcmd->sense_buffer);
-		pSRB->SGcount = 1;
-		pSRB->pSegmentList = (PSGL) &pSRB->Segmentx;
+		pSRB->pSegmentList	= dc390_sg_build_single(&pSRB->Segmentx, pcmd->sense_buffer, sizeof(pcmd->sense_buffer));
+		pSRB->SGcount		= pci_map_sg(pdev, pSRB->pSegmentList, 1,
+						     DMA_FROM_DEVICE);
+		cmdp->saved_dma_handle	= sg_dma_address(pSRB->pSegmentList);
+
+		/* TODO: error handling */
+		if (pSRB->SGcount != 1)
+			error = 1;
 		DEBUG1(printk("%s(): Mapped sense buffer %p at %x\n", __FUNCTION__, pcmd->sense_buffer, cmdp->saved_dma_handle));
-	/* Make SG list */	
+	/* Map SG list */
 	} else if (pcmd->use_sg) {
-		pSRB->pSegmentList = (PSGL) pcmd->request_buffer;
-		pSRB->SGcount = pci_map_sg(pdev, pSRB->pSegmentList,
-					   pcmd->use_sg,
-					   scsi_to_pci_dma_dir(pcmd->sc_data_direction));
+		pSRB->pSegmentList	= (struct scatterlist *) pcmd->request_buffer;
+		pSRB->SGcount		= pci_map_sg(pdev, pSRB->pSegmentList, pcmd->use_sg,
+						     pcmd->sc_data_direction);
 		/* TODO: error handling */
 		if (!pSRB->SGcount)
 			error = 1;
-		DEBUG1(printk("%s(): Mapped SG %p with %d (%d) elements\n", __FUNCTION__, pcmd->request_buffer, pSRB->SGcount, pcmd->use_sg));
+		DEBUG1(printk("%s(): Mapped SG %p with %d (%d) elements\n",\
+			      __FUNCTION__, pcmd->request_buffer, pSRB->SGcount, pcmd->use_sg));
 	/* Map single segment */
 	} else if (pcmd->request_buffer && pcmd->request_bufflen) {
-		sg_dma_address(&pSRB->Segmentx) = cmdp->saved_dma_handle =
-			pci_map_page(pdev, virt_to_page(pcmd->request_buffer),
-				     (unsigned long)pcmd->request_buffer & ~PAGE_MASK,
-				     pcmd->request_bufflen, scsi_to_pci_dma_dir(pcmd->sc_data_direction));
+		pSRB->pSegmentList	= dc390_sg_build_single(&pSRB->Segmentx, pcmd->request_buffer, pcmd->request_bufflen);
+		pSRB->SGcount		= pci_map_sg(pdev, pSRB->pSegmentList, 1,
+						     pcmd->sc_data_direction);
+		cmdp->saved_dma_handle	= sg_dma_address(pSRB->pSegmentList);
+
 		/* TODO: error handling */
-		sg_dma_len(&pSRB->Segmentx) = pcmd->request_bufflen;
-		pSRB->SGcount = 1;
-		pSRB->pSegmentList = (PSGL) &pSRB->Segmentx;
+		if (pSRB->SGcount != 1)
+			error = 1;
 		DEBUG1(printk("%s(): Mapped request buffer %p at %x\n", __FUNCTION__, pcmd->request_buffer, cmdp->saved_dma_handle));
 	/* No mapping !? */	
     	} else
 		pSRB->SGcount = 0;
+
 	return error;
 }
 
 /* Remove pci mapping */
-static void dc390_pci_unmap (PSRB pSRB)
+static void dc390_pci_unmap (struct dc390_srb* pSRB)
 {
-	Scsi_Cmnd* pcmd = pSRB->pcmd;
+	struct scsi_cmnd *pcmd = pSRB->pcmd;
 	struct pci_dev *pdev = pSRB->pSRBDCB->pDCBACB->pdev;
-	dc390_cmd_scp_t* cmdp = ((dc390_cmd_scp_t*)(&pcmd->SCp));
+	DEBUG1(dc390_cmd_scp_t* cmdp = ((dc390_cmd_scp_t*)(&pcmd->SCp)));
 
 	if (pSRB->SRBFlag) {
-		pci_unmap_page(pdev, cmdp->saved_dma_handle,
-			       sizeof(pcmd->sense_buffer), DMA_FROM_DEVICE);
+		pci_unmap_sg(pdev, &pSRB->Segmentx, 1, DMA_FROM_DEVICE);
 		DEBUG1(printk("%s(): Unmapped sense buffer at %x\n", __FUNCTION__, cmdp->saved_dma_handle));
 	} else if (pcmd->use_sg) {
-		pci_unmap_sg(pdev, pcmd->request_buffer, pcmd->use_sg,
-			     scsi_to_pci_dma_dir(pcmd->sc_data_direction));
+		pci_unmap_sg(pdev, pcmd->request_buffer, pcmd->use_sg, pcmd->sc_data_direction);
 		DEBUG1(printk("%s(): Unmapped SG at %p with %d elements\n", __FUNCTION__, pcmd->request_buffer, pcmd->use_sg));
 	} else if (pcmd->request_buffer && pcmd->request_bufflen) {
-		pci_unmap_page(pdev,
-			       cmdp->saved_dma_handle,
-			       pcmd->request_bufflen,
-			       scsi_to_pci_dma_dir(pcmd->sc_data_direction));
+		pci_unmap_sg(pdev, &pSRB->Segmentx, 1, pcmd->sc_data_direction);
 		DEBUG1(printk("%s(): Unmapped request buffer at %x\n", __FUNCTION__, cmdp->saved_dma_handle));
 	}
 }
 
 
 /***********************************************************************
- * Function: static void dc390_BuildSRB (Scsi_Cmd *pcmd, PDCB pDCB, 
- * 					 PSRB pSRB)
+ * Function: static void dc390_BuildSRB (Scsi_Cmd *pcmd, struct dc390_dcb* pDCB, 
+ * 					 struct dc390_srb* pSRB)
  *
  * Purpose: Prepare SRB for being sent to Device DCB w/ command *pcmd
  *
  ***********************************************************************/
 
-static void dc390_BuildSRB (Scsi_Cmnd* pcmd, PDCB pDCB, PSRB pSRB)
+static void dc390_BuildSRB (struct scsi_cmnd *pcmd, struct dc390_dcb* pDCB, struct dc390_srb* pSRB)
 {
     pSRB->pSRBDCB = pDCB;
     pSRB->pcmd = pcmd;
@@ -1019,8 +966,8 @@ static void dc390_BuildSRB (Scsi_Cmnd* pcmd, PDCB pDCB, PSRB pSRB)
 }
 
 /***********************************************************************
- * Function : static int DC390_queue_command (Scsi_Cmnd *cmd,
- *					       void (*done)(Scsi_Cmnd *))
+ * Function : static int DC390_queue_command (struct scsi_cmnd *cmd,
+ *					       void (*done)(struct scsi_cmnd *))
  *
  * Purpose : enqueues a SCSI command
  *
@@ -1031,17 +978,18 @@ static void dc390_BuildSRB (Scsi_Cmnd* pcmd, PDCB pDCB, PSRB pSRB)
  * 2.0.x: always return 0
  * 2.1.x: old model: (use_new_eh_code == 0): like 2.0.x
  *	  TO BE DONE:
- *	  new model: return 0 if successful
- *	  	     return 1 if command cannot be queued (queue full)
+ *	  new model: return 0 if successful, or must not be re-queued
+ *		     return 1 if command cannot be queued (queue full)
  *		     command will be inserted in midlevel queue then ...
  *
  ***********************************************************************/
 
-static int DC390_queue_command (Scsi_Cmnd *cmd, void (* done)(Scsi_Cmnd *))
+static int DC390_queue_command(struct scsi_cmnd *cmd,
+		void (* done)(struct scsi_cmnd *))
 {
-    PDCB   pDCB;
-    PSRB   pSRB;
-    PACB   pACB = (PACB) cmd->device->host->hostdata;
+    struct dc390_dcb*   pDCB = (struct dc390_dcb*) cmd->device->hostdata;
+    struct dc390_srb*   pSRB;
+    struct dc390_acb*   pACB = (struct dc390_acb*) cmd->device->host->hostdata;
 
     DEBUG0(/*  if(pACB->scan_devices) */	\
 	printk(KERN_INFO "DC390: Queue Cmd=%02x,Tgt=%d,LUN=%d (pid=%li), buffer=%p\n",\
@@ -1050,42 +998,19 @@ static int DC390_queue_command (Scsi_Cmnd *cmd, void (* done)(Scsi_Cmnd *))
     /* TODO: Change the policy: Always accept TEST_UNIT_READY or INQUIRY 
      * commands and alloc a DCB for the device if not yet there. DCB will
      * be removed in dc390_SRBdone if SEL_TIMEOUT */
-
-    if( (pACB->scan_devices == END_SCAN) && (cmd->cmnd[0] != INQUIRY) )
-	pACB->scan_devices = 0;
-
-    else if( (pACB->scan_devices) && (cmd->cmnd[0] == READ_6) )
-	pACB->scan_devices = 0;
-
-    if( (pACB->scan_devices || cmd->cmnd[0] == TEST_UNIT_READY || cmd->cmnd[0] == INQUIRY) && 
-       !(pACB->DCBmap[cmd->device->id] & (1 << cmd->device->lun)) )
-    {
-        pACB->scan_devices = 1;
-
-	dc390_initDCB( pACB, &pDCB, cmd->device->id, cmd->device->lun );
-	if (!pDCB)
-	  {
-	    printk (KERN_ERR "DC390: kmalloc for DCB failed, target %02x lun %02x\n", 
-		    cmd->device->id, cmd->device->lun);
-	    goto fail;
-	  }
-            
-    }
-    else if( !(pACB->scan_devices) && !(pACB->DCBmap[cmd->device->id] & (1 << cmd->device->lun)) )
-    {
+    if (!(pACB->scan_devices) && !(pACB->DCBmap[cmd->device->id] & (1 << cmd->device->lun))) {
 	printk(KERN_INFO "DC390: Ignore target %02x lun %02x\n",
 		cmd->device->id, cmd->device->lun); 
 	goto fail;
     }
-    else
-    {
-	pDCB = dc390_findDCB (pACB, cmd->device->id, cmd->device->lun);
-	if (!pDCB)
-	 {  /* should never happen */
-	    printk (KERN_ERR "DC390: no DCB failed, target %02x lun %02x\n", 
-		    cmd->device->id, cmd->device->lun);
-	    goto fail;
-	 }
+
+    /* Should it be: BUG_ON(!pDCB); ? */
+
+    if (!pDCB)
+    {  /* should never happen */
+	printk (KERN_ERR "DC390: no DCB found, target %02x lun %02x\n", 
+		cmd->device->id, cmd->device->lun);
+	goto fail;
     }
 
     pACB->Cmds++;
@@ -1208,7 +1133,7 @@ static int DC390_bios_param (struct scsi_device *sdev, struct block_device *bdev
 			     sector_t capacity, int geom[])
 {
     int heads, sectors, cylinders;
-    PACB pACB = (PACB) sdev->host->hostdata;
+    struct dc390_acb* pACB = (struct dc390_acb*) sdev->host->hostdata;
     int ret_code = -1;
     int size = capacity;
     unsigned char *buf;
@@ -1248,9 +1173,11 @@ static int DC390_bios_param (struct scsi_device *sdev, struct block_device *bdev
 }
 #endif
 
-static void dc390_dumpinfo (PACB pACB, PDCB pDCB, PSRB pSRB)
+static void dc390_dumpinfo (struct dc390_acb* pACB, struct dc390_dcb* pDCB, struct dc390_srb* pSRB)
 {
-    USHORT pstat; PDEVDECL1;
+    struct pci_dev *pdev;
+    u16 pstat;
+
     if (!pDCB) pDCB = pACB->pActiveDCB;
     if (!pSRB && pDCB) pSRB = pDCB->pActiveSRB;
 
@@ -1284,14 +1211,16 @@ static void dc390_dumpinfo (PACB pACB, PDCB pDCB, PSRB pSRB)
 	    DC390_read32(DMA_Wk_ByteCntr), DC390_read32(DMA_Wk_AddrCntr),
 	    DC390_read8(DMA_Status), DC390_read32(DMA_ScsiBusCtrl));
     DC390_write32 (DMA_ScsiBusCtrl, EN_INT_ON_PCI_ABORT);
-    PDEVSET1; PCI_READ_CONFIG_WORD(PDEV, PCI_STATUS, &pstat);
+
+    pdev = pACB->pdev;
+    pci_read_config_word(pdev, PCI_STATUS, &pstat);
     printk ("DC390: Register dump: PCI Status: %04x\n", pstat);
-    printk ("DC390: In case of driver trouble read linux/Documentation/scsi/tmscsim.txt\n");
+    printk ("DC390: In case of driver trouble read Documentation/scsi/tmscsim.txt\n");
 }
 
 
 /***********************************************************************
- * Function : int DC390_abort (Scsi_Cmnd *cmd)
+ * Function : int DC390_abort (struct scsi_cmnd *cmd)
  *
  * Purpose : Abort an errant SCSI command
  *
@@ -1302,19 +1231,18 @@ static void dc390_dumpinfo (PACB pACB, PDCB pDCB, PSRB pSRB)
  * Status: Buggy !
  ***********************************************************************/
 
-static int DC390_abort (Scsi_Cmnd *cmd)
+static int DC390_abort (struct scsi_cmnd *cmd)
 {
-    PDCB  pDCB;
-    PSRB  pSRB, psrb;
-    UINT  count, i;
+    struct dc390_dcb *pDCB = (struct dc390_dcb*) cmd->device->hostdata;
+    struct dc390_srb *pSRB, *psrb;
+    u32  count, i;
     int   status;
-    //ULONG sbac;
-    PACB  pACB = (PACB) cmd->device->host->hostdata;
+    //unsigned long sbac;
+    struct dc390_acb *pACB = (struct dc390_acb*) cmd->device->host->hostdata;
 
     printk ("DC390: Abort command (pid %li, Device %02i-%02i)\n",
 	    cmd->pid, cmd->device->id, cmd->device->lun);
 
-    pDCB = dc390_findDCB (pACB, cmd->device->id, cmd->device->lun);
     if( !pDCB ) goto  NOT_RUN;
 
     /* Added 98/07/02 KG */
@@ -1434,9 +1362,9 @@ ABO_X:
 }
 
 
-static void dc390_ResetDevParam( PACB pACB )
+static void dc390_ResetDevParam( struct dc390_acb* pACB )
 {
-    PDCB   pDCB, pdcb;
+    struct dc390_dcb *pDCB, *pdcb;
 
     pDCB = pACB->pLinkDCB;
     if (! pDCB) return;
@@ -1459,11 +1387,11 @@ static void dc390_ResetDevParam( PACB pACB )
 
 #if 0
 /* Moves all SRBs from Going to Waiting for all DCBs */
-static void dc390_RecoverSRB( PACB pACB )
+static void dc390_RecoverSRB( struct dc390_acb* pACB )
 {
-    PDCB   pDCB, pdcb;
-    PSRB   psrb, psrb2;
-    UINT   cnt, i;
+    struct dc390_dcb *pDCB, *pdcb;
+    struct dc390_srb *psrb, *psrb2;
+    u32   cnt, i;
 
     pDCB = pACB->pLinkDCB;
     if( !pDCB ) return;
@@ -1498,7 +1426,7 @@ static void dc390_RecoverSRB( PACB pACB )
 #endif
 
 /***********************************************************************
- * Function : int DC390_reset (Scsi_Cmnd *cmd, ...)
+ * Function : int DC390_reset (struct scsi_cmnd *cmd, ...)
  *
  * Purpose : perform a hard reset on the SCSI bus
  *
@@ -1508,10 +1436,10 @@ static void dc390_RecoverSRB( PACB pACB )
  * Returns : 0 on success.
  ***********************************************************************/
 
-static int DC390_reset (Scsi_Cmnd *cmd)
+static int DC390_reset (struct scsi_cmnd *cmd)
 {
-    UCHAR   bval;
-    PACB    pACB = (PACB) cmd->device->host->hostdata;
+    u8   bval;
+    struct dc390_acb*    pACB = (struct dc390_acb*) cmd->device->host->hostdata;
 
     printk(KERN_INFO "DC390: RESET ... ");
 
@@ -1548,101 +1476,13 @@ static int DC390_reset (Scsi_Cmnd *cmd)
 
 #include "scsiiom.c"
 
-
-/***********************************************************************
- * Function : static void dc390_initDCB()
- *
- * Purpose :  initialize the internal structures for a DCB (to be malloced)
- *
- * Inputs : SCSI id and lun
- ***********************************************************************/
-
-static void dc390_initDCB( PACB pACB, PDCB *ppDCB, UCHAR id, UCHAR lun )
-{
-    PEEprom	prom;
-    UCHAR	index;
-    PDCB pDCB, pDCB2;
-
-    pDCB = kmalloc (sizeof(DC390_DCB), GFP_ATOMIC);
-    DCBDEBUG(printk (KERN_INFO "DC390: alloc mem for DCB (ID %i, LUN %i): %p\n",	\
-		     id, lun, pDCB));
- 
-    *ppDCB = pDCB;
-    if (!pDCB) return;
-    pDCB2 = 0;
-    if( pACB->DCBCnt == 0 )
-    {
-	pACB->pLinkDCB = pDCB;
-	pACB->pDCBRunRobin = pDCB;
-    }
-    else
-    {
-	pACB->pLastDCB->pNextDCB = pDCB;
-    }
-   
-    pACB->DCBCnt++;
-   
-    pDCB->pNextDCB = pACB->pLinkDCB;
-    pACB->pLastDCB = pDCB;
-
-    pDCB->pDCBACB = pACB;
-    pDCB->TargetID = id;
-    pDCB->TargetLUN = lun;
-    pDCB->pWaitingSRB = NULL;
-    pDCB->pGoingSRB = NULL;
-    pDCB->GoingSRBCnt = 0;
-    pDCB->WaitSRBCnt = 0;
-    pDCB->pActiveSRB = NULL;
-    pDCB->TagMask = 0;
-    pDCB->MaxCommand = 1;
-    index = pACB->AdapterIndex;
-    pDCB->DCBFlag = 0;
-
-    /* Is there a corresp. LUN==0 device ? */
-    if (lun != 0)
-	pDCB2 = dc390_findDCB (pACB, id, 0);
-    prom = (PEEprom) &dc390_eepromBuf[index][id << 2];
-    /* Some values are for all LUNs: Copy them */
-    /* In a clean way: We would have an own structure for a SCSI-ID */
-    if (pDCB2)
-    {
-      pDCB->DevMode = pDCB2->DevMode;
-      pDCB->SyncMode = pDCB2->SyncMode;
-      pDCB->SyncPeriod = pDCB2->SyncPeriod;
-      pDCB->SyncOffset = pDCB2->SyncOffset;
-      pDCB->NegoPeriod = pDCB2->NegoPeriod;
-      
-      pDCB->CtrlR3 = pDCB2->CtrlR3;
-      pDCB->CtrlR4 = pDCB2->CtrlR4;
-      pDCB->Inquiry7 = pDCB2->Inquiry7;
-    }
-    else
-    {		
-      pDCB->DevMode = prom->EE_MODE1;
-      pDCB->SyncMode = 0;
-      pDCB->SyncPeriod = 0;
-      pDCB->SyncOffset = 0;
-      pDCB->NegoPeriod = (dc390_clock_period1[prom->EE_SPEED] * 25) >> 2;
-            
-      pDCB->CtrlR3 = FAST_CLK;
-      
-      pDCB->CtrlR4 = pACB->glitch_cfg | CTRL4_RESERVED;
-      if( dc390_eepromBuf[index][EE_MODE2] & ACTIVE_NEGATION)
-	pDCB->CtrlR4 |= NEGATE_REQACKDATA | NEGATE_REQACK;
-      pDCB->Inquiry7 = 0;
-    }
-
-    pACB->DCBmap[id] |= (1 << lun);
-    dc390_updateDCB(pACB, pDCB);
-}
-
 /***********************************************************************
  * Function : static void dc390_updateDCB()
  *
  * Purpose :  Set the configuration dependent DCB parameters
  ***********************************************************************/
 
-static void dc390_updateDCB (PACB pACB, PDCB pDCB)
+static void dc390_updateDCB (struct dc390_acb* pACB, struct dc390_dcb* pDCB)
 {
   pDCB->SyncMode &= EN_TAG_QUEUEING | SYNC_NEGO_DONE /*| EN_ATN_STOP*/;
   if (pDCB->DevMode & TAG_QUEUEING_) {
@@ -1674,15 +1514,15 @@ static void dc390_updateDCB (PACB pACB, PDCB pDCB)
  * Inputs : psrb - pointer to this scsi request block structure
  ***********************************************************************/
 
-static void __inline__ dc390_initSRB( PSRB psrb )
+static void __inline__ dc390_initSRB( struct dc390_srb* psrb )
 {
   /* psrb->PhysSRB = virt_to_phys( psrb ); */
 }
 
 
-static void dc390_linkSRB( PACB pACB )
+static void dc390_linkSRB( struct dc390_acb* pACB )
 {
-    UINT   count, i;
+    u32   count, i;
 
     count = pACB->SRBCount;
     for( i=0; i<count; i++)
@@ -1705,10 +1545,10 @@ static void dc390_linkSRB( PACB pACB )
  *	    io_port, Irq, index: Resources and adapter index
  ***********************************************************************/
 
-static void __init dc390_initACB (PSH psh, ULONG io_port, UCHAR Irq, UCHAR index)
+static void __devinit dc390_initACB (struct Scsi_Host *psh, unsigned long io_port, u8 Irq, u8 index)
 {
-    PACB    pACB;
-    UCHAR   i;
+    struct dc390_acb*    pACB;
+    u8   i;
 
     psh->can_queue = MAX_CMD_QUEUE;
     psh->cmd_per_lun = MAX_CMD_PER_LUN;
@@ -1721,10 +1561,10 @@ static void __init dc390_initACB (PSH psh, ULONG io_port, UCHAR Irq, UCHAR index
     psh->dma_channel = -1;
     psh->last_reset = jiffies;
 	
-    pACB = (PACB) psh->hostdata;
+    pACB = (struct dc390_acb*) psh->hostdata;
 
     pACB->pScsiHost = psh;
-    pACB->IOPortBase = (USHORT) io_port;
+    pACB->IOPortBase = (u16) io_port;
     pACB->IRQLevel = Irq;
 
     DEBUG0(printk (KERN_INFO "DC390: Adapter index %i, ID %i, IO 0x%08x, IRQ 0x%02x\n",	\
@@ -1745,8 +1585,6 @@ static void __init dc390_initACB (PSH psh, ULONG io_port, UCHAR Irq, UCHAR index
     pACB->SRBCount = MAX_SRB_CNT;
     pACB->AdapterIndex = index;
     pACB->status = 0;
-    psh->this_id = dc390_eepromBuf[index][EE_ADAPT_SCSI_ID];
-    pACB->DeviceCnt = 0;
     pACB->DCBCnt = 0;
     pACB->TagMaxNum = 2 << dc390_eepromBuf[index][EE_TAG_CMD_NUM];
     pACB->ACBFlag = 0;
@@ -1778,13 +1616,13 @@ static void __init dc390_initACB (PSH psh, ULONG io_port, UCHAR Irq, UCHAR index
  * Outputs: 0 on success, -1 on error
  ***********************************************************************/
 
-static int __init dc390_initAdapter (PSH psh, ULONG io_port, UCHAR Irq, UCHAR index)
+static int __devinit dc390_initAdapter (struct Scsi_Host *psh, unsigned long io_port, u8 Irq, u8 index)
 {
-    PACB   pACB, pACB2;
-    UCHAR  dstate;
+    struct dc390_acb *pACB, *pACB2;
+    u8  dstate;
     int    i;
     
-    pACB = (PACB) psh->hostdata;
+    pACB = (struct dc390_acb*) psh->hostdata;
 
     if (request_region (io_port, psh->n_io_port, "tmscsim") == NULL) {
 	printk(KERN_ERR "DC390: register IO ports error!\n");
@@ -1849,120 +1687,256 @@ static int __init dc390_initAdapter (PSH psh, ULONG io_port, UCHAR Irq, UCHAR in
 }
 
 
-/***********************************************************************
- * Function : static int DC390_init (struct Scsi_Host *host, ...)
- *
- * Purpose :  initialize the internal structures for a given SCSI host
- *
- * Inputs : host - pointer to this host adapter's structure
- *	    io_port - IO ports mapped to this adapter
- *	    Irq - IRQ assigned to this adpater
- *	    struct pci_dev - PCI access handle
- *	    index - Adapter index
- *
- * Outputs: 0 on success, -1 on error
- *
- * Note: written in capitals, because the locking is only done here,
- *	not in DC390_detect, called from outside 
- ***********************************************************************/
+static void __devinit dc390_set_pci_cfg (struct pci_dev *pdev)
+{
+	u16 cmd;
+
+	pci_read_config_word(pdev, PCI_COMMAND, &cmd);
+	cmd |= PCI_COMMAND_SERR | PCI_COMMAND_PARITY | PCI_COMMAND_IO;
+	pci_write_config_word(pdev, PCI_COMMAND, cmd);
+	pci_write_config_word(pdev, PCI_STATUS, (PCI_STATUS_SIG_SYSTEM_ERROR | PCI_STATUS_DETECTED_PARITY));
+}
 
-static int __init DC390_init (PSHT psht, ULONG io_port, UCHAR Irq, struct pci_dev *pdev, UCHAR index)
+/**
+ * dc390_slave_alloc - Called by the scsi mid layer to tell us about a new
+ * scsi device that we need to deal with.
+ *
+ * @scsi_device: The new scsi device that we need to handle.
+ */
+static int dc390_slave_alloc(struct scsi_device *scsi_device)
 {
-    PSH   psh;
-    PACB  pACB;
+	struct dc390_acb *pACB = (struct dc390_acb*) scsi_device->host->hostdata;
+	struct dc390_dcb *pDCB, *pDCB2 = 0;
+	uint id = scsi_device->id;
+	uint lun = scsi_device->lun;
 
-    if (dc390_CheckEEpromCheckSum (PDEV, index))
-    {
-	int speed;
-	dc390_adapname = "AM53C974";
-	printk (KERN_INFO "DC390_init: No EEPROM found! Trying default settings ...\n");
-	dc390_check_for_safe_settings ();
-	dc390_fill_with_defaults ();
-	dc390_EEprom_Override (index);
-	speed = dc390_clock_speed[tmscsim[1]];
-	printk (KERN_INFO "DC390: Used defaults: AdaptID=%i, SpeedIdx=%i (%i.%i MHz),"
-		" DevMode=0x%02x, AdaptMode=0x%02x, TaggedCmnds=%i (%i), DelayReset=%is\n", 
-		tmscsim[0], tmscsim[1], speed/10, speed%10,
-		(UCHAR)tmscsim[2], (UCHAR)tmscsim[3], tmscsim[4], 2 << (tmscsim[4]), tmscsim[5]);
-    }
-    else
-    {
-	dc390_check_for_safe_settings ();
-	dc390_EEprom_Override (index);
-    }
+	pDCB = kmalloc(sizeof(struct dc390_dcb), GFP_KERNEL);
+	if (!pDCB)
+		return -ENOMEM;
+	memset(pDCB, 0, sizeof(struct dc390_dcb));
+
+	if (!pACB->DCBCnt++) {
+		pACB->pLinkDCB = pDCB;
+		pACB->pDCBRunRobin = pDCB;
+	} else {
+		pACB->pLastDCB->pNextDCB = pDCB;
+	}
    
-    psh = scsi_register( psht, sizeof(DC390_ACB) );
-    if( !psh ) return( -1 );
-	
-    scsi_set_device(psh, &pdev->dev);
-    pACB = (PACB) psh->hostdata;
+	pDCB->pNextDCB = pACB->pLinkDCB;
+	pACB->pLastDCB = pDCB;
 
-    DEBUG0(printk(KERN_INFO "DC390: pSH = %8x, Index %02i\n", (UINT) psh, index));
+	pDCB->pDCBACB = pACB;
+	pDCB->TargetID = id;
+	pDCB->TargetLUN = lun;
+	pDCB->MaxCommand = 1;
 
-    dc390_initACB( psh, io_port, Irq, index );
-        
-    PDEVSET;
+	/*
+	 * Some values are for all LUNs: Copy them 
+	 * In a clean way: We would have an own structure for a SCSI-ID 
+	 */
+	if (lun && (pDCB2 = dc390_findDCB(pACB, id, 0))) {
+		pDCB->DevMode = pDCB2->DevMode;
+		pDCB->SyncMode = pDCB2->SyncMode;
+		pDCB->SyncPeriod = pDCB2->SyncPeriod;
+		pDCB->SyncOffset = pDCB2->SyncOffset;
+		pDCB->NegoPeriod = pDCB2->NegoPeriod;
+      
+		pDCB->CtrlR3 = pDCB2->CtrlR3;
+		pDCB->CtrlR4 = pDCB2->CtrlR4;
+		pDCB->Inquiry7 = pDCB2->Inquiry7;
+	} else {
+		u8 index = pACB->AdapterIndex;
+		PEEprom prom = (PEEprom) &dc390_eepromBuf[index][id << 2];
+
+		pDCB->DevMode = prom->EE_MODE1;
+		pDCB->NegoPeriod =
+			(dc390_clock_period1[prom->EE_SPEED] * 25) >> 2;
+		pDCB->CtrlR3 = FAST_CLK;
+		pDCB->CtrlR4 = pACB->glitch_cfg | CTRL4_RESERVED;
+		if (dc390_eepromBuf[index][EE_MODE2] & ACTIVE_NEGATION)
+			pDCB->CtrlR4 |= NEGATE_REQACKDATA | NEGATE_REQACK;
+	}
 
-    if( !dc390_initAdapter( psh, io_port, Irq, index ) )
-    {
-	DEBUG0(printk("DC390: pACB = %8x, pDCBmap = %8x, pSRB_array = %8x\n",\
-		      (UINT) pACB, (UINT) pACB->DCBmap, (UINT) pACB->SRB_array));
-	DEBUG0(printk("DC390: ACB size= %4x, DCB size= %4x, SRB size= %4x\n",\
-		      sizeof(DC390_ACB), sizeof(DC390_DCB), sizeof(DC390_SRB) ));
-        return (0);
-    }
-    else
-    {
-	scsi_unregister( psh );
-	return( -1 );
-    }
+	pACB->DCBmap[id] |= (1 << lun);
+	dc390_updateDCB(pACB, pDCB);
+
+	pACB->scan_devices = 1;
+	scsi_device->hostdata = pDCB;
+	return 0;
 }
 
-static void __init dc390_set_pci_cfg (PDEVDECL)
+/**
+ * dc390_slave_destroy - Called by the scsi mid layer to tell us about a
+ * device that is going away.
+ *
+ * @scsi_device: The scsi device that we need to remove.
+ */
+static void dc390_slave_destroy(struct scsi_device *scsi_device)
 {
-	USHORT cmd;
-	PCI_READ_CONFIG_WORD (PDEV, PCI_COMMAND, &cmd);
-	cmd |= PCI_COMMAND_SERR | PCI_COMMAND_PARITY | PCI_COMMAND_IO;
-	PCI_WRITE_CONFIG_WORD (PDEV, PCI_COMMAND, cmd);
-	PCI_WRITE_CONFIG_WORD (PDEV, PCI_STATUS, (PCI_STATUS_SIG_SYSTEM_ERROR | PCI_STATUS_DETECTED_PARITY));
+	struct dc390_acb* pACB = (struct dc390_acb*) scsi_device->host->hostdata;
+	struct dc390_dcb* pDCB = (struct dc390_dcb*) scsi_device->hostdata;
+	struct dc390_dcb* pPrevDCB = pACB->pLinkDCB;
+
+	pACB->scan_devices = 0;
+
+	BUG_ON(pDCB->GoingSRBCnt > 1);
+	
+	pACB->DCBmap[pDCB->TargetID] &= ~(1 << pDCB->TargetLUN);
+   
+	if (pDCB == pACB->pLinkDCB) {
+		if (pACB->pLastDCB == pDCB) {
+			pDCB->pNextDCB = NULL;
+			pACB->pLastDCB = NULL;
+		}
+		pACB->pLinkDCB = pDCB->pNextDCB;
+	} else {
+		while (pPrevDCB->pNextDCB != pDCB)
+			pPrevDCB = pPrevDCB->pNextDCB;
+		pPrevDCB->pNextDCB = pDCB->pNextDCB;
+		if (pDCB == pACB->pLastDCB)
+			pACB->pLastDCB = pPrevDCB;
+	}
+
+	if (pDCB == pACB->pActiveDCB)
+		pACB->pActiveDCB = NULL;
+	if (pDCB == pACB->pLinkDCB)
+		pACB->pLinkDCB = pDCB->pNextDCB;
+	if (pDCB == pACB->pDCBRunRobin)
+		pACB->pDCBRunRobin = pDCB->pNextDCB;
+	kfree(pDCB); 
+	
+	pACB->DCBCnt--;
 }
 
-int __init DC390_detect (Scsi_Host_Template *psht)
+static int dc390_slave_configure(struct scsi_device *scsi_device)
 {
-    struct pci_dev *pdev = NULL;
-    UCHAR   irq;
-    ULONG   io_port;
+	struct dc390_acb* pACB = (struct dc390_acb*) scsi_device->host->hostdata;
+	pACB->scan_devices = 0;
+	return 0;
+}
 
-    dc390_pACB_start = NULL;
+static struct scsi_host_template driver_template = {
+	.module			= THIS_MODULE,
+	.proc_name		= "tmscsim", 
+	.proc_info		= DC390_proc_info,
+	.name			= DC390_BANNER " V" DC390_VERSION,
+	.slave_alloc		= dc390_slave_alloc,
+	.slave_configure	= dc390_slave_configure,
+	.slave_destroy		= dc390_slave_destroy,
+	.queuecommand		= DC390_queue_command,
+	.eh_abort_handler	= DC390_abort,
+	.eh_bus_reset_handler	= DC390_reset,
+	.bios_param		= DC390_bios_param,
+	.can_queue		= 42,
+	.this_id		= 7,
+	.sg_tablesize		= SG_ALL,
+	.cmd_per_lun		= 16,
+	.use_clustering		= DISABLE_CLUSTERING,
+};
 
-    if ( PCI_PRESENT )
-	    while ((pdev = pci_find_device(PCI_VENDOR_ID_AMD, PCI_DEVICE_ID_AMD53C974, pdev)))
-	{
-	    if (pci_enable_device (pdev))
-		continue;
+static int __devinit dc390_init_one(struct pci_dev *dev,
+				    const struct pci_device_id *id)
+{
+	struct Scsi_Host *scsi_host;
+	unsigned long io_port;
+	u8 irq;
+	struct dc390_acb*  pACB;
+	int ret = -ENOMEM;
+
+	if (pci_enable_device(dev))
+		return -ENODEV;
+
+	io_port = pci_resource_start(dev, 0);
+	irq = dev->irq;
+
+	/* allocate scsi host information (includes out adapter) */
+	scsi_host = scsi_host_alloc(&driver_template, sizeof(struct dc390_acb));
+	if (!scsi_host)
+		goto nomem;
+
+	pACB = (struct dc390_acb*) scsi_host->hostdata;
+
+	if (dc390_CheckEEpromCheckSum (dev, dc390_adapterCnt)) {
+		int speed;
+		dc390_adapname = "AM53C974";
+		printk(KERN_INFO "DC390_init: No EEPROM found! Trying default settings ...\n");
+		dc390_check_for_safe_settings();
+		dc390_fill_with_defaults();
+		dc390_EEprom_Override(dc390_adapterCnt);
+		speed = dc390_clock_speed[tmscsim[1]];
+		printk(KERN_INFO "DC390: Used defaults: AdaptID=%i, SpeedIdx=%i (%i.%i MHz),"
+		       " DevMode=0x%02x, AdaptMode=0x%02x, TaggedCmnds=%i (%i), DelayReset=%is\n", 
+		       tmscsim[0], tmscsim[1], speed/10, speed%10,
+		       (u8)tmscsim[2], (u8)tmscsim[3], tmscsim[4], 2 << (tmscsim[4]), tmscsim[5]);
+	} else {
+		dc390_check_for_safe_settings();
+		dc390_EEprom_Override(dc390_adapterCnt);
+	}
 
-	    if (pci_set_dma_mask(pdev, 0xffffffff)) {
-		    printk(KERN_ERR "DC390(%i): No suitable DMA available.\n", dc390_adapterCnt);
-		    continue;
-	    }
-	    PCI_GET_IO_AND_IRQ;
-	    DEBUG0(printk(KERN_INFO "DC390(%i): IO_PORT=%04x,IRQ=%x\n", dc390_adapterCnt, (UINT) io_port, irq));
+	DEBUG0(printk(KERN_INFO "DC390: pSH = %8x, Index %02i\n", (u32) scsi_host, dc390_adapterCnt));
 
-	    if( !DC390_init(psht, io_port, irq, PDEV, dc390_adapterCnt))
-	    {
-		pci_set_master(pdev);
-		dc390_set_pci_cfg (PDEV);
-		dc390_adapterCnt++;
-	    }
+	dc390_initACB(scsi_host, io_port, irq, dc390_adapterCnt);
+
+	pACB->pdev = dev;
+
+	if (dc390_initAdapter(scsi_host, io_port, irq, dc390_adapterCnt)) {
+		scsi_unregister(scsi_host);
+		ret = -EBUSY;
+		goto busy;
 	}
-    else
-	printk (KERN_ERR "DC390: No PCI BIOS found!\n");
-   
-    if (dc390_adapterCnt)
-	psht->proc_name = "tmscsim";
 
-    printk(KERN_INFO "DC390: %i adapters found\n", dc390_adapterCnt);
-    return( dc390_adapterCnt );
+	pci_set_master(dev);
+	dc390_set_pci_cfg(dev);
+	dc390_adapterCnt++;
+
+	/* get the scsi mid level to scan for new devices on the bus */
+	if (scsi_add_host(scsi_host, &dev->dev)) {
+		ret = -ENODEV;
+		goto nodev;
+	}
+	pci_set_drvdata(dev, scsi_host);
+	scsi_scan_host(scsi_host);
+
+	return 0;
+
+nodev:
+busy:
+	scsi_host_put(scsi_host);
+nomem:
+	pci_disable_device(dev);
+	return ret;
+}
+
+/**
+ * dc390_remove_one - Called to remove a single instance of the adapter.
+ *
+ * @dev: The PCI device to remove.
+ */
+static void __devexit dc390_remove_one(struct pci_dev *dev)
+{
+	struct Scsi_Host *scsi_host = pci_get_drvdata(dev);
+	unsigned long iflags;
+	struct dc390_acb* pACB = (struct dc390_acb*) scsi_host->hostdata;
+	u8 bval;
+
+	scsi_remove_host(scsi_host);
+
+	spin_lock_irqsave(scsi_host->host_lock, iflags);
+	pACB->ACBFlag = RESET_DEV;
+	bval = DC390_read8(CtrlReg1) | DIS_INT_ON_SCSI_RST;
+	DC390_write8 (CtrlReg1, bval);	/* disable interrupt */
+	if (pACB->Gmode2 & RST_SCSI_BUS)
+		dc390_ResetSCSIBus(pACB);
+	spin_unlock_irqrestore(scsi_host->host_lock, iflags);
+
+	del_timer_sync(&pACB->Waiting_Timer);
+
+	free_irq(scsi_host->irq, pACB);
+	release_region(scsi_host->io_port, scsi_host->n_io_port);
+
+	pci_disable_device(dev);
+	scsi_host_put(scsi_host);
+	pci_set_drvdata(dev, NULL);
 }
 
 /********************************************************************
@@ -1997,19 +1971,19 @@ static int DC390_proc_info (struct Scsi_Host *shpnt, char *buffer, char **start,
 {
   int dev, spd, spd1;
   char *pos = buffer;
-  PACB pACB;
-  PDCB pDCB;
+  struct dc390_acb* pACB;
+  struct dc390_dcb* pDCB;
 
   pACB = dc390_pACB_start;
 
-  while(pACB != (PACB)-1)
+  while(pACB != (struct dc390_acb*)-1)
      {
 	if (shpnt == pACB->pScsiHost)
 		break;
 	pACB = pACB->pNextACB;
      }
 
-  if (pACB == (PACB)-1) return(-ESRCH);
+  if (pACB == (struct dc390_acb*)-1) return(-ESRCH);
 
   if(inout) /* Has data been written to the file ? */
       return -ENOSYS;
@@ -2035,7 +2009,7 @@ static int DC390_proc_info (struct Scsi_Host *shpnt, char *buffer, char **start,
   SPRINTF("            Lost arbitrations %i, Sel. connected %i, Connected: %s\n", 
 	  pACB->SelLost, pACB->SelConn, pACB->Connected? "Yes": "No");
    
-  SPRINTF("Nr of attached devices: %i, Nr of DCBs: %i\n", pACB->DeviceCnt, pACB->DCBCnt);
+  SPRINTF("Nr of DCBs: %i\n", pACB->DCBCnt);
   SPRINTF("Map of attached LUNs: %02x %02x %02x %02x %02x %02x %02x %02x\n",
 	  pACB->DCBmap[0], pACB->DCBmap[1], pACB->DCBmap[2], pACB->DCBmap[3], 
 	  pACB->DCBmap[4], pACB->DCBmap[5], pACB->DCBmap[6], pACB->DCBmap[7]);
@@ -2070,7 +2044,7 @@ static int DC390_proc_info (struct Scsi_Host *shpnt, char *buffer, char **start,
 	
     for (dev = 0; dev < pACB->DCBCnt; dev++)
     {
-	PSRB pSRB;
+	struct dc390_srb* pSRB;
 	if (pDCB->WaitSRBCnt) 
 		    SPRINTF ("DCB (%02i-%i): Waiting: %i:", pDCB->TargetID, pDCB->TargetLUN,
 			     pDCB->WaitSRBCnt);
@@ -2111,90 +2085,22 @@ static int DC390_proc_info (struct Scsi_Host *shpnt, char *buffer, char **start,
 #undef YESNO
 #undef SPRINTF
 
-/***********************************************************************
- * Function : static int dc390_shutdown (struct Scsi_Host *host)
- *
- * Purpose : does a clean (we hope) shutdown of the SCSI chip.
- *	     Use prior to dumping core, unloading the driver, etc.
- *
- * Returns : 0 on success
- ***********************************************************************/
-static int dc390_shutdown (struct Scsi_Host *host)
-{
-    UCHAR    bval;
-    PACB pACB = (PACB)(host->hostdata);
-   
-/*  pACB->soft_reset(host); */
-
-    printk(KERN_INFO "DC390: shutdown\n");
-
-    pACB->ACBFlag = RESET_DEV;
-    bval = DC390_read8 (CtrlReg1);
-    bval |= DIS_INT_ON_SCSI_RST;
-    DC390_write8 (CtrlReg1, bval);	/* disable interrupt */
-    if (pACB->Gmode2 & RST_SCSI_BUS)
-		dc390_ResetSCSIBus (pACB);
-
-    if (timer_pending (&pACB->Waiting_Timer)) del_timer (&pACB->Waiting_Timer);
-    return( 0 );
-}
+static struct pci_driver dc390_driver = {
+	.name           = "tmscsim",
+	.id_table       = tmscsim_pci_tbl,
+	.probe          = dc390_init_one,
+	.remove         = __devexit_p(dc390_remove_one),
+};
 
-static void dc390_freeDCBs (struct Scsi_Host *host)
+static int __init dc390_module_init(void)
 {
-    PDCB pDCB, nDCB;
-    PACB pACB = (PACB)(host->hostdata);
-    
-    pDCB = pACB->pLinkDCB;
-    if (!pDCB) return;
-    do
-    {
-	nDCB = pDCB->pNextDCB;
-	DCBDEBUG(printk (KERN_INFO "DC390: Free DCB (ID %i, LUN %i): %p\n",\
-			 pDCB->TargetID, pDCB->TargetLUN, pDCB));
-	//kfree (pDCB);
-	dc390_remove_dev (pACB, pDCB);
-	pDCB = nDCB;
-    } while (pDCB && pACB->pLinkDCB);
-
+	return pci_module_init(&dc390_driver);
 }
 
-static int DC390_release (struct Scsi_Host *host)
+static void __exit dc390_module_exit(void)
 {
-    DC390_IFLAGS;
-    PACB pACB = (PACB)(host->hostdata);
-
-    DC390_LOCK_IO(host);
-
-    /* TO DO: We should check for outstanding commands first. */
-    dc390_shutdown (host);
-
-    if (host->irq != SCSI_IRQ_NONE)
-    {
-	DEBUG0(printk(KERN_INFO "DC390: Free IRQ %i\n",host->irq));
-	free_irq (host->irq, pACB);
-    }
-
-    release_region(host->io_port,host->n_io_port);
-    dc390_freeDCBs (host);
-    DC390_UNLOCK_IO(host);
-    scsi_unregister(host);
-    return( 1 );
+	pci_unregister_driver(&dc390_driver);
 }
 
-static Scsi_Host_Template driver_template = {
-   .proc_name      = "tmscsim", 
-   .proc_info      = DC390_proc_info,
-   .name           = DC390_BANNER " V" DC390_VERSION,
-   .detect         = DC390_detect,
-   .release        = DC390_release,
-   .queuecommand   = DC390_queue_command,
-   .eh_abort_handler		= DC390_abort,
-   .eh_bus_reset_handler	= DC390_reset,
-   .bios_param     = DC390_bios_param,
-   .can_queue      = 42,
-   .this_id        = 7,
-   .sg_tablesize   = SG_ALL,
-   .cmd_per_lun    = 16,
-   .use_clustering = DISABLE_CLUSTERING,
-};
-#include "scsi_module.c"
+module_init(dc390_module_init);
+module_exit(dc390_module_exit);
diff --git a/drivers/scsi/tmscsim.h b/drivers/scsi/tmscsim.h
index fd12e6062..62e9f8791 100644
--- a/drivers/scsi/tmscsim.h
+++ b/drivers/scsi/tmscsim.h
@@ -22,8 +22,6 @@
 
 #define SEL_TIMEOUT		153	/* 250 ms selection timeout (@ 40 MHz) */
 
-#define END_SCAN		2
-
 #define pci_dma_lo32(a)			(a & 0xffffffff)
 
 typedef u8		UCHAR;	/*  8 bits */
@@ -31,222 +29,167 @@ typedef u16		USHORT;	/* 16 bits */
 typedef u32		UINT;	/* 32 bits */
 typedef unsigned long	ULONG;	/* 32/64 bits */
 
-typedef UCHAR		*PUCHAR;
-typedef USHORT		*PUSHORT;
-typedef UINT		*PUINT;
-typedef ULONG		*PULONG;
-typedef Scsi_Host_Template	*PSHT;
-typedef struct Scsi_Host	*PSH;
-typedef Scsi_Device	*PSCSIDEV;
-typedef Scsi_Cmnd	*PSCSICMD;
-typedef void		*PVOID;
-typedef struct scatterlist  *PSGL, SGL;
-
-
-/*;-----------------------------------------------------------------------*/
-typedef  struct  _SyncMsg
-{
-UCHAR		ExtendMsg;
-UCHAR		ExtMsgLen;
-UCHAR		SyncXferReq;
-UCHAR		Period;
-UCHAR		ReqOffset;
-} SyncMsg;
-/*;-----------------------------------------------------------------------*/
-typedef  struct  _Capacity
-{
-ULONG		BlockCount;
-ULONG		BlockLength;
-} Capacity;
-/*;-----------------------------------------------------------------------*/
-typedef  struct  _SGentry
-{
-ULONG		SGXferDataPtr;
-ULONG		SGXferDataLen;
-} SGentry;
-
-typedef  struct  _SGentry1
-{
-ULONG		SGXLen;
-ULONG		SGXPtr;
-} SGentry1, *PSGE;
-
 
 /*
 ;-----------------------------------------------------------------------
 ; SCSI Request Block
 ;-----------------------------------------------------------------------
 */
-struct	_SRB
+struct dc390_srb
 {
-//UCHAR		CmdBlock[12];
+//u8		CmdBlock[12];
 
-struct _SRB	*pNextSRB;
-struct _DCB	*pSRBDCB;
-PSCSICMD	pcmd;
-PSGL		pSegmentList;
+struct dc390_srb	*pNextSRB;
+struct dc390_dcb	*pSRBDCB;
+struct scsi_cmnd	*pcmd;
+struct scatterlist	*pSegmentList;
 
 /* 0x10: */
-SGL		Segmentx;	/* make a one entry of S/G list table */
+struct scatterlist Segmentx;	/* make a one entry of S/G list table */
 
 /* 0x1c: */
-ULONG		SGBusAddr;	/*;a segment starting address as seen by AM53C974A*/
-ULONG		SGToBeXferLen;	/*; to be xfer length */
-ULONG		TotalXferredLen;
-ULONG		SavedTotXLen;
-UINT		SRBState;
+unsigned long	SGBusAddr;	/*;a segment starting address as seen by AM53C974A*/
+unsigned long	SGToBeXferLen;	/*; to be xfer length */
+unsigned long	TotalXferredLen;
+unsigned long	SavedTotXLen;
+u32		SRBState;
 
 /* 0x30: */
-UCHAR		SRBStatus;
-UCHAR		SRBFlag;	/*; b0-AutoReqSense,b6-Read,b7-write */
+u8		SRBStatus;
+u8		SRBFlag;	/*; b0-AutoReqSense,b6-Read,b7-write */
 				/*; b4-settimeout,b5-Residual valid */
-UCHAR		AdaptStatus;
-UCHAR		TargetStatus;
+u8		AdaptStatus;
+u8		TargetStatus;
 
-UCHAR		ScsiPhase;
-UCHAR		TagNumber;
-UCHAR		SGIndex;
-UCHAR		SGcount;
+u8		ScsiPhase;
+u8		TagNumber;
+u8		SGIndex;
+u8		SGcount;
 
 /* 0x38: */
-UCHAR		MsgCnt;
-UCHAR		EndMessage;
-UCHAR		RetryCnt;
-UCHAR		SavedSGCount;			
+u8		MsgCnt;
+u8		EndMessage;
+u8		RetryCnt;
+u8		SavedSGCount;			
 
-ULONG		Saved_Ptr;
+unsigned long	Saved_Ptr;
 
 /* 0x40: */
-UCHAR		MsgInBuf[6];
-UCHAR		MsgOutBuf[6];
+u8		MsgInBuf[6];
+u8		MsgOutBuf[6];
 
-//UCHAR		IORBFlag;	/*;81h-Reset, 2-retry */
+//u8		IORBFlag;	/*;81h-Reset, 2-retry */
 /* 0x4c: */
 };
 
 
-typedef  struct  _SRB	 DC390_SRB, *PSRB;
-
 /*
 ;-----------------------------------------------------------------------
 ; Device Control Block
 ;-----------------------------------------------------------------------
 */
-struct	_DCB
+struct dc390_dcb
 {
-struct _DCB	*pNextDCB;
-struct _ACB	*pDCBACB;
-
-/* Aborted Commands */
-//PSCSICMD	AboIORBhead;
-//PSCSICMD	AboIORBtail;
-//ULONG		AboIORBcnt;
+struct dc390_dcb	*pNextDCB;
+struct dc390_acb	*pDCBACB;
 
 /* 0x08: */
 /* Queued SRBs */
-PSRB		pWaitingSRB;
-PSRB		pWaitLast;
-PSRB		pGoingSRB;
-PSRB		pGoingLast;
-PSRB		pActiveSRB;
-UCHAR		WaitSRBCnt;	/* Not used */
-UCHAR		GoingSRBCnt;
+struct dc390_srb	*pWaitingSRB;
+struct dc390_srb	*pWaitLast;
+struct dc390_srb	*pGoingSRB;
+struct dc390_srb	*pGoingLast;
+struct dc390_srb	*pActiveSRB;
+u8		WaitSRBCnt;	/* Not used */
+u8		GoingSRBCnt;
 
-UCHAR		DevType;
-UCHAR		MaxCommand;
+u8		DevType;
+u8		MaxCommand;
 
 /* 0x20: */
-UINT		TagMask;
+u32		TagMask;
 
-UCHAR		TargetID;	/*; SCSI Target ID  (SCSI Only) */
-UCHAR		TargetLUN;	/*; SCSI Log.  Unit (SCSI Only) */
-UCHAR		DevMode;
-UCHAR		DCBFlag;
+u8		TargetID;	/*; SCSI Target ID  (SCSI Only) */
+u8		TargetLUN;	/*; SCSI Log.  Unit (SCSI Only) */
+u8		DevMode;
+u8		DCBFlag;
 
-UCHAR		CtrlR1;
-UCHAR		CtrlR3;
-UCHAR		CtrlR4;
-UCHAR		Inquiry7;
+u8		CtrlR1;
+u8		CtrlR3;
+u8		CtrlR4;
+u8		Inquiry7;
 
 /* 0x2c: */
-UCHAR		SyncMode;	/*; 0:async mode */
-UCHAR		NegoPeriod;	/*;for nego. */
-UCHAR		SyncPeriod;	/*;for reg. */
-UCHAR		SyncOffset;	/*;for reg. and nego.(low nibble) */
+u8		SyncMode;	/*; 0:async mode */
+u8		NegoPeriod;	/*;for nego. */
+u8		SyncPeriod;	/*;for reg. */
+u8		SyncOffset;	/*;for reg. and nego.(low nibble) */
 
 /* 0x30:*/
-//UCHAR		InqDataBuf[8];
-//UCHAR		CapacityBuf[8];
+//u8		InqDataBuf[8];
+//u8		CapacityBuf[8];
 ///* 0x40: */
 };
 
-typedef  struct  _DCB	 DC390_DCB, *PDCB;
+
 /*
 ;-----------------------------------------------------------------------
 ; Adapter Control Block
 ;-----------------------------------------------------------------------
 */
-struct	_ACB
+struct dc390_acb
 {
-PSH		pScsiHost;
-struct _ACB	*pNextACB;
-USHORT		IOPortBase;
-UCHAR		IRQLevel;
-UCHAR		status;
-
-UCHAR		SRBCount;
-UCHAR		AdapterIndex;	/*; nth Adapter this driver */
-UCHAR		DeviceCnt;
-UCHAR		DCBCnt;
-
-/* 0x10: */
-UCHAR		TagMaxNum;
-UCHAR		ACBFlag;
-UCHAR		Gmode2;
-UCHAR		scan_devices;
+struct Scsi_Host *pScsiHost;
+struct dc390_acb	*pNextACB;
+u16		IOPortBase;
+u8		IRQLevel;
+u8		status;
+
+u8		SRBCount;
+u8		AdapterIndex;	/*; nth Adapter this driver */
+u8		DCBCnt;
+
+u8		TagMaxNum;
+u8		ACBFlag;
+u8		Gmode2;
+u8		scan_devices;
+
+struct dc390_dcb	*pLinkDCB;
+struct dc390_dcb	*pLastDCB;
+struct dc390_dcb	*pDCBRunRobin;
+
+struct dc390_dcb	*pActiveDCB;
+struct dc390_srb	*pFreeSRB;
+struct dc390_srb	*pTmpSRB;
+
+u8		msgin123[4];
+u8		DCBmap[MAX_SCSI_ID];
+u8		Connected;
+u8		pad;
 
-PDCB		pLinkDCB;
-PDCB		pLastDCB;
-PDCB		pDCBRunRobin;
-
-PDCB		pActiveDCB;
-PSRB		pFreeSRB;
-PSRB		pTmpSRB;
-
-/* 0x2c: */
-UCHAR		msgin123[4];
-UCHAR		DCBmap[MAX_SCSI_ID];
-UCHAR		Connected;
-UCHAR		pad;
-
-/* 0x30: */
 #if defined(USE_SPINLOCKS) && USE_SPINLOCKS > 1 && (defined(CONFIG_SMP) || DEBUG_SPINLOCKS > 0)
 spinlock_t	lock;
 #endif
-UCHAR		sel_timeout;
-UCHAR		glitch_cfg;
-
-UCHAR		MsgLen;
-UCHAR		Ignore_IRQ;	/* Not used */
-
-PDEVDECL1;			/* Pointer to PCI cfg. space */
-/* 0x40/0x3c: */
-ULONG		Cmds;
-UINT		SelLost;
-UINT		SelConn;
-UINT		CmdInQ;
-UINT		CmdOutOfSRB;
+u8		sel_timeout;
+u8		glitch_cfg;
+
+u8		MsgLen;
+u8		Ignore_IRQ;	/* Not used */
+
+struct pci_dev	*pdev;
+
+unsigned long	Cmds;
+u32		SelLost;
+u32		SelConn;
+u32		CmdInQ;
+u32		CmdOutOfSRB;
 	
-/* 0x54/0x50: */
 struct timer_list	Waiting_Timer;
-/* 0x68/0x64: */
-DC390_SRB	TmpSRB;
-/* 0xcc/0xc8: */
-DC390_SRB	SRB_array[MAX_SRB_CNT]; 	/* 50 SRBs */
-/* 0xfa4/0xfa0: */
+
+struct dc390_srb	TmpSRB;
+struct dc390_srb	SRB_array[MAX_SRB_CNT]; 	/* 50 SRBs */
 };
 
-typedef  struct  _ACB	 DC390_ACB, *PACB;
 
 /*;-----------------------------------------------------------------------*/
 
@@ -411,17 +354,17 @@ typedef struct {
 
 typedef struct	_SCSIInqData { /* INQUIRY */
 
-	UCHAR	 DevType;		/* Periph Qualifier & Periph Dev Type*/
-	UCHAR	 RMB_TypeMod;		/* rem media bit & Dev Type Modifier */
-	UCHAR	 Vers;			/* ISO, ECMA, & ANSI versions	     */
-	UCHAR	 RDF;			/* AEN, TRMIOP, & response data format*/
-	UCHAR	 AddLen;		/* length of additional data	     */
-	UCHAR	 Res1;			/* reserved			     */
-	UCHAR	 Res2;			/* reserved			     */
-	UCHAR	 Flags; 		/* RelADr,Wbus32,Wbus16,Sync,etc.    */
-	UCHAR	 VendorID[8];		/* Vendor Identification	     */
-	UCHAR	 ProductID[16]; 	/* Product Identification	     */
-	UCHAR	 ProductRev[4]; 	/* Product Revision		     */
+	u8	 DevType;		/* Periph Qualifier & Periph Dev Type*/
+	u8	 RMB_TypeMod;		/* rem media bit & Dev Type Modifier */
+	u8	 Vers;			/* ISO, ECMA, & ANSI versions	     */
+	u8	 RDF;			/* AEN, TRMIOP, & response data format*/
+	u8	 AddLen;		/* length of additional data	     */
+	u8	 Res1;			/* reserved			     */
+	u8	 Res2;			/* reserved			     */
+	u8	 Flags; 		/* RelADr,Wbus32,Wbus16,Sync,etc.    */
+	u8	 VendorID[8];		/* Vendor Identification	     */
+	u8	 ProductID[16]; 	/* Product Identification	     */
+	u8	 ProductRev[4]; 	/* Product Revision		     */
 
 
 } SCSI_INQDATA, *PSCSI_INQDATA;
@@ -470,10 +413,10 @@ typedef struct	_SCSIInqData { /* INQUIRY */
 */
 typedef  struct  _EEprom
 {
-UCHAR	EE_MODE1;
-UCHAR	EE_SPEED;
-UCHAR	xx1;
-UCHAR	xx2;
+u8	EE_MODE1;
+u8	EE_SPEED;
+u8	xx1;
+u8	xx2;
 } EEprom, *PEEprom;
 
 #define REAL_EE_ADAPT_SCSI_ID 64
@@ -685,7 +628,7 @@ UCHAR	xx2;
 	(inb (pACB->IOPortBase + (address)))
 
 #define DC390_read8_(address, base)		\
-	(inb ((USHORT)(base) + (address)))
+	(inb ((u16)(base) + (address)))
 
 #define DC390_read16(address)			\
 	(inw (pACB->IOPortBase + (address)))
@@ -697,7 +640,7 @@ UCHAR	xx2;
 	outb ((value), pACB->IOPortBase + (address))
 
 #define DC390_write8_(address,value,base)	\
-	outb ((value), (USHORT)(base) + (address))
+	outb ((value), (u16)(base) + (address))
 
 #define DC390_write16(address,value)		\
 	outw ((value), pACB->IOPortBase + (address))
diff --git a/drivers/scsi/u14-34f.c b/drivers/scsi/u14-34f.c
index e274843d1..b2f69d7a8 100644
--- a/drivers/scsi/u14-34f.c
+++ b/drivers/scsi/u14-34f.c
@@ -423,7 +423,7 @@
 #include <linux/spinlock.h>
 #include <scsi/scsicam.h>
 #include "scsi.h"
-#include "hosts.h"
+#include <scsi/scsi_host.h>
 #include <asm/dma.h>
 #include <asm/irq.h>
 
diff --git a/drivers/scsi/ultrastor.c b/drivers/scsi/ultrastor.c
index 65554c41b..cb0a05d56 100644
--- a/drivers/scsi/ultrastor.c
+++ b/drivers/scsi/ultrastor.c
@@ -145,7 +145,7 @@
 
 #define ULTRASTOR_PRIVATE	/* Get the private stuff from ultrastor.h */
 #include "scsi.h"
-#include "hosts.h"
+#include <scsi/scsi_host.h>
 #include "ultrastor.h"
 
 #define FALSE 0
@@ -948,9 +948,9 @@ static int ultrastor_abort(Scsi_Cmnd *SCpnt)
 	return SCSI_ABORT_NOT_RUNNING;
 
     if (config.mscp[mscp_index].SCint != SCpnt) panic("Bad abort");
-    config.mscp[mscp_index].SCint = 0;
+    config.mscp[mscp_index].SCint = NULL;
     done = config.mscp[mscp_index].done;
-    config.mscp[mscp_index].done = 0;
+    config.mscp[mscp_index].done = NULL;
     SCpnt->result = DID_ABORT << 16;
     
     /* Take the host lock to guard against scsi layer re-entry */
@@ -1000,9 +1000,9 @@ static int ultrastor_host_reset(Scsi_Cmnd * SCpnt)
 	  {
 	    config.mscp[i].SCint->result = DID_RESET << 16;
 	    config.mscp[i].done(config.mscp[i].SCint);
-	    config.mscp[i].done = 0;
+	    config.mscp[i].done = NULL;
 	  }
-	config.mscp[i].SCint = 0;
+	config.mscp[i].SCint = NULL;
       }
 #endif
 
@@ -1083,7 +1083,7 @@ static void ultrastor_interrupt(int irq, void *dev_id, struct pt_regs *regs)
 	if (icm_status == 3) {
 	    void (*done)(Scsi_Cmnd *) = mscp->done;
 	    if (done) {
-		mscp->done = 0;
+		mscp->done = NULL;
 		mscp->SCint->result = DID_ABORT << 16;
 		done(mscp->SCint);
 	    }
@@ -1114,7 +1114,7 @@ static void ultrastor_interrupt(int irq, void *dev_id, struct pt_regs *regs)
        once we call done, we may get another command queued before this
        interrupt service routine can return. */
     done = mscp->done;
-    mscp->done = 0;
+    mscp->done = NULL;
 
     /* Let the higher levels know that we're done */
     switch (mscp->adapter_status)
@@ -1138,7 +1138,7 @@ static void ultrastor_interrupt(int irq, void *dev_id, struct pt_regs *regs)
 
     SCtmp->result = status | mscp->target_status;
 
-    SCtmp->host_scribble = 0;
+    SCtmp->host_scribble = NULL;
 
     /* Free up mscp block for next command */
 #if ULTRASTOR_MAX_CMDS == 1
diff --git a/drivers/scsi/wd33c93.c b/drivers/scsi/wd33c93.c
index 19dba62ce..6bb37d329 100644
--- a/drivers/scsi/wd33c93.c
+++ b/drivers/scsi/wd33c93.c
@@ -82,8 +82,10 @@
 #include <linux/blkdev.h>
 #include <asm/irq.h>
 
-#include "scsi.h"
-#include "hosts.h"
+#include <scsi/scsi.h>
+#include <scsi/scsi_cmnd.h>
+#include <scsi/scsi_device.h>
+#include <scsi/scsi_host.h>
 
 #include "wd33c93.h"
 
@@ -299,17 +301,6 @@ read_1_byte(const wd33c93_regs regs)
 	return x;
 }
 
-/* The 33c93 needs to be told which direction a command transfers its
- * data; we use this function to figure it out. Returns true if there
- * will be a DATA_OUT phase with this command, false otherwise.
- * (Thanks to Joerg Dorchain for the research and suggestion.)
- */
-static inline int
-is_dir_out(Scsi_Cmnd * cmd)
-{
-	return cmd->sc_data_direction == SCSI_DATA_WRITE;
-}
-
 static struct sx_period sx_table[] = {
 	{1, 0x20},
 	{252, 0x20},
@@ -348,17 +339,18 @@ calc_sync_xfer(unsigned int period, unsigned int offset)
 }
 
 int
-wd33c93_queuecommand(Scsi_Cmnd * cmd, void (*done) (Scsi_Cmnd *))
+wd33c93_queuecommand(struct scsi_cmnd *cmd,
+		void (*done)(struct scsi_cmnd *))
 {
 	struct WD33C93_hostdata *hostdata;
-	Scsi_Cmnd *tmp;
+	struct scsi_cmnd *tmp;
 
 	hostdata = (struct WD33C93_hostdata *) cmd->device->host->hostdata;
 
 	DB(DB_QUEUE_COMMAND,
 	   printk("Q-%d-%02x-%ld( ", cmd->device->id, cmd->cmnd[0], cmd->pid))
 
-/* Set up a few fields in the Scsi_Cmnd structure for our own use:
+/* Set up a few fields in the scsi_cmnd structure for our own use:
  *  - host_scribble is the pointer to the next cmd in the input queue
  *  - scsi_done points to the routine we call when a cmd is finished
  *  - result is what you'd expect
@@ -426,8 +418,9 @@ wd33c93_queuecommand(Scsi_Cmnd * cmd, void (*done) (Scsi_Cmnd *))
 		cmd->host_scribble = (uchar *) hostdata->input_Q;
 		hostdata->input_Q = cmd;
 	} else {		/* find the end of the queue */
-		for (tmp = (Scsi_Cmnd *) hostdata->input_Q; tmp->host_scribble;
-		     tmp = (Scsi_Cmnd *) tmp->host_scribble) ;
+		for (tmp = (struct scsi_cmnd *) hostdata->input_Q;
+		     tmp->host_scribble;
+		     tmp = (struct scsi_cmnd *) tmp->host_scribble) ;
 		tmp->host_scribble = (uchar *) cmd;
 	}
 
@@ -459,7 +452,7 @@ wd33c93_execute(struct Scsi_Host *instance)
 	struct WD33C93_hostdata *hostdata =
 	    (struct WD33C93_hostdata *) instance->hostdata;
 	const wd33c93_regs regs = hostdata->regs;
-	Scsi_Cmnd *cmd, *prev;
+	struct scsi_cmnd *cmd, *prev;
 
 	DB(DB_EXECUTE, printk("EX("))
 	if (hostdata->selecting || hostdata->connected) {
@@ -472,13 +465,13 @@ wd33c93_execute(struct Scsi_Host *instance)
 	 * for an idle target/lun.
 	 */
 
-	cmd = (Scsi_Cmnd *) hostdata->input_Q;
+	cmd = (struct scsi_cmnd *) hostdata->input_Q;
 	prev = 0;
 	while (cmd) {
 		if (!(hostdata->busy[cmd->device->id] & (1 << cmd->device->lun)))
 			break;
 		prev = cmd;
-		cmd = (Scsi_Cmnd *) cmd->host_scribble;
+		cmd = (struct scsi_cmnd *) cmd->host_scribble;
 	}
 
 	/* quit if queue empty or all possible targets are busy */
@@ -493,7 +486,7 @@ wd33c93_execute(struct Scsi_Host *instance)
 	if (prev)
 		prev->host_scribble = cmd->host_scribble;
 	else
-		hostdata->input_Q = (Scsi_Cmnd *) cmd->host_scribble;
+		hostdata->input_Q = (struct scsi_cmnd *) cmd->host_scribble;
 
 #ifdef PROC_STATISTICS
 	hostdata->cmd_cnt[cmd->device->id]++;
@@ -503,7 +496,7 @@ wd33c93_execute(struct Scsi_Host *instance)
 	 * Start the selection process
 	 */
 
-	if (is_dir_out(cmd))
+	if (cmd->sc_data_direction == DMA_TO_DEVICE)
 		write_wd33c93(regs, WD_DESTINATION_ID, cmd->device->id);
 	else
 		write_wd33c93(regs, WD_DESTINATION_ID, cmd->device->id | DSTID_DPD);
@@ -542,12 +535,12 @@ wd33c93_execute(struct Scsi_Host *instance)
 		goto yes;
 	if (!(hostdata->input_Q))	/* input_Q empty? */
 		goto no;
-	for (prev = (Scsi_Cmnd *) hostdata->input_Q; prev;
-	     prev = (Scsi_Cmnd *) prev->host_scribble) {
+	for (prev = (struct scsi_cmnd *) hostdata->input_Q; prev;
+	     prev = (struct scsi_cmnd *) prev->host_scribble) {
 		if ((prev->device->id != cmd->device->id) ||
 		    (prev->device->lun != cmd->device->lun)) {
-			for (prev = (Scsi_Cmnd *) hostdata->input_Q; prev;
-			     prev = (Scsi_Cmnd *) prev->host_scribble)
+			for (prev = (struct scsi_cmnd *) hostdata->input_Q; prev;
+			     prev = (struct scsi_cmnd *) prev->host_scribble)
 				prev->SCp.phase = 1;
 			goto yes;
 		}
@@ -635,8 +628,8 @@ wd33c93_execute(struct Scsi_Host *instance)
 
 		if ((cmd->SCp.phase == 0) && (hostdata->no_dma == 0)) {
 			if (hostdata->dma_setup(cmd,
-						(is_dir_out(cmd)) ? DATA_OUT_DIR
-						: DATA_IN_DIR))
+			    (cmd->sc_data_direction == DMA_TO_DEVICE) ?
+			     DATA_OUT_DIR : DATA_IN_DIR))
 				write_wd33c93_count(regs, 0);	/* guarantee a DATA_PHASE interrupt */
 			else {
 				write_wd33c93_count(regs,
@@ -699,7 +692,8 @@ transfer_pio(const wd33c93_regs regs, uchar * buf, int cnt,
 }
 
 static void
-transfer_bytes(const wd33c93_regs regs, Scsi_Cmnd * cmd, int data_in_dir)
+transfer_bytes(const wd33c93_regs regs, struct scsi_cmnd *cmd,
+		int data_in_dir)
 {
 	struct WD33C93_hostdata *hostdata;
 	unsigned long length;
@@ -774,7 +768,7 @@ wd33c93_intr(struct Scsi_Host *instance)
 	struct WD33C93_hostdata *hostdata =
 	    (struct WD33C93_hostdata *) instance->hostdata;
 	const wd33c93_regs regs = hostdata->regs;
-	Scsi_Cmnd *patch, *cmd;
+	struct scsi_cmnd *patch, *cmd;
 	uchar asr, sr, phs, id, lun, *ucp, msg;
 	unsigned long length, flags;
 
@@ -788,7 +782,7 @@ wd33c93_intr(struct Scsi_Host *instance)
 	hostdata->int_cnt++;
 #endif
 
-	cmd = (Scsi_Cmnd *) hostdata->connected;	/* assume we're connected */
+	cmd = (struct scsi_cmnd *) hostdata->connected;	/* assume we're connected */
 	sr = read_wd33c93(regs, WD_SCSI_STATUS);	/* clear the interrupt */
 	phs = read_wd33c93(regs, WD_COMMAND_PHASE);
 
@@ -828,7 +822,7 @@ wd33c93_intr(struct Scsi_Host *instance)
 		    if (hostdata->state == S_RUNNING_LEVEL2)
 			hostdata->connected = NULL;
 		else {
-			cmd = (Scsi_Cmnd *) hostdata->selecting;	/* get a valid cmd */
+			cmd = (struct scsi_cmnd *) hostdata->selecting;	/* get a valid cmd */
 			hostdata->selecting = NULL;
 		}
 
@@ -861,7 +855,7 @@ wd33c93_intr(struct Scsi_Host *instance)
 	case CSR_SELECT:
 		DB(DB_INTR, printk("SELECT"))
 		    hostdata->connected = cmd =
-		    (Scsi_Cmnd *) hostdata->selecting;
+		    (struct scsi_cmnd *) hostdata->selecting;
 		hostdata->selecting = NULL;
 
 		/* construct an IDENTIFY message with correct disconnect bit */
@@ -1307,7 +1301,7 @@ wd33c93_intr(struct Scsi_Host *instance)
 		    if (hostdata->level2 <= L2_NONE) {
 
 			if (hostdata->selecting) {
-				cmd = (Scsi_Cmnd *) hostdata->selecting;
+				cmd = (struct scsi_cmnd *) hostdata->selecting;
 				hostdata->selecting = NULL;
 				hostdata->busy[cmd->device->id] &= ~(1 << cmd->device->lun);
 				cmd->host_scribble =
@@ -1399,13 +1393,13 @@ wd33c93_intr(struct Scsi_Host *instance)
 
 		/* Now we look for the command that's reconnecting. */
 
-		cmd = (Scsi_Cmnd *) hostdata->disconnected_Q;
+		cmd = (struct scsi_cmnd *) hostdata->disconnected_Q;
 		patch = NULL;
 		while (cmd) {
 			if (id == cmd->device->id && lun == cmd->device->lun)
 				break;
 			patch = cmd;
-			cmd = (Scsi_Cmnd *) cmd->host_scribble;
+			cmd = (struct scsi_cmnd *) cmd->host_scribble;
 		}
 
 		/* Hmm. Couldn't find a valid command.... What to do? */
@@ -1424,7 +1418,7 @@ wd33c93_intr(struct Scsi_Host *instance)
 			patch->host_scribble = cmd->host_scribble;
 		else
 			hostdata->disconnected_Q =
-			    (Scsi_Cmnd *) cmd->host_scribble;
+			    (struct scsi_cmnd *) cmd->host_scribble;
 		hostdata->connected = cmd;
 
 		/* We don't need to worry about 'initialize_SCp()' or 'hostdata->busy[]'
@@ -1432,7 +1426,7 @@ wd33c93_intr(struct Scsi_Host *instance)
 		 * But we DO need to fix the DPD bit so it's correct for this command.
 		 */
 
-		if (is_dir_out(cmd))
+		if (cmd->sc_data_direction == DMA_TO_DEVICE)
 			write_wd33c93(regs, WD_DESTINATION_ID, cmd->device->id);
 		else
 			write_wd33c93(regs, WD_DESTINATION_ID,
@@ -1522,7 +1516,7 @@ reset_wd33c93(struct Scsi_Host *instance)
 }
 
 int
-wd33c93_host_reset(Scsi_Cmnd * SCpnt)
+wd33c93_host_reset(struct scsi_cmnd * SCpnt)
 {
 	struct Scsi_Host *instance;
 	struct WD33C93_hostdata *hostdata;
@@ -1557,12 +1551,12 @@ wd33c93_host_reset(Scsi_Cmnd * SCpnt)
 }
 
 int
-wd33c93_abort(Scsi_Cmnd * cmd)
+wd33c93_abort(struct scsi_cmnd * cmd)
 {
 	struct Scsi_Host *instance;
 	struct WD33C93_hostdata *hostdata;
 	wd33c93_regs regs;
-	Scsi_Cmnd *tmp, *prev;
+	struct scsi_cmnd *tmp, *prev;
 
 	disable_irq(cmd->device->host->irq);
 
@@ -1575,7 +1569,7 @@ wd33c93_abort(Scsi_Cmnd * cmd)
  *     from the input_Q.
  */
 
-	tmp = (Scsi_Cmnd *) hostdata->input_Q;
+	tmp = (struct scsi_cmnd *) hostdata->input_Q;
 	prev = 0;
 	while (tmp) {
 		if (tmp == cmd) {
@@ -1583,7 +1577,7 @@ wd33c93_abort(Scsi_Cmnd * cmd)
 				prev->host_scribble = cmd->host_scribble;
 			else
 				hostdata->input_Q =
-				    (Scsi_Cmnd *) cmd->host_scribble;
+				    (struct scsi_cmnd *) cmd->host_scribble;
 			cmd->host_scribble = NULL;
 			cmd->result = DID_ABORT << 16;
 			printk
@@ -1594,7 +1588,7 @@ wd33c93_abort(Scsi_Cmnd * cmd)
 			return SUCCESS;
 		}
 		prev = tmp;
-		tmp = (Scsi_Cmnd *) tmp->host_scribble;
+		tmp = (struct scsi_cmnd *) tmp->host_scribble;
 	}
 
 /*
@@ -1675,7 +1669,7 @@ wd33c93_abort(Scsi_Cmnd * cmd)
  * an ABORT_SNOOZE and hope for the best...
  */
 
-	tmp = (Scsi_Cmnd *) hostdata->disconnected_Q;
+	tmp = (struct scsi_cmnd *) hostdata->disconnected_Q;
 	while (tmp) {
 		if (tmp == cmd) {
 			printk
@@ -1685,7 +1679,7 @@ wd33c93_abort(Scsi_Cmnd * cmd)
 			enable_irq(cmd->device->host->irq);
 			return FAILED;
 		}
-		tmp = (Scsi_Cmnd *) tmp->host_scribble;
+		tmp = (struct scsi_cmnd *) tmp->host_scribble;
 	}
 
 /*
@@ -1921,7 +1915,7 @@ wd33c93_proc_info(struct Scsi_Host *instance, char *buf, char **start, off_t off
 	char *bp;
 	char tbuf[128];
 	struct WD33C93_hostdata *hd;
-	Scsi_Cmnd *cmd;
+	struct scsi_cmnd *cmd;
 	int x, i;
 	static int stop = 0;
 
@@ -2022,7 +2016,7 @@ wd33c93_proc_info(struct Scsi_Host *instance, char *buf, char **start, off_t off
 	if (hd->proc & PR_CONNECTED) {
 		strcat(bp, "\nconnected:     ");
 		if (hd->connected) {
-			cmd = (Scsi_Cmnd *) hd->connected;
+			cmd = (struct scsi_cmnd *) hd->connected;
 			sprintf(tbuf, " %ld-%d:%d(%02x)",
 				cmd->pid, cmd->device->id, cmd->device->lun, cmd->cmnd[0]);
 			strcat(bp, tbuf);
@@ -2030,22 +2024,22 @@ wd33c93_proc_info(struct Scsi_Host *instance, char *buf, char **start, off_t off
 	}
 	if (hd->proc & PR_INPUTQ) {
 		strcat(bp, "\ninput_Q:       ");
-		cmd = (Scsi_Cmnd *) hd->input_Q;
+		cmd = (struct scsi_cmnd *) hd->input_Q;
 		while (cmd) {
 			sprintf(tbuf, " %ld-%d:%d(%02x)",
 				cmd->pid, cmd->device->id, cmd->device->lun, cmd->cmnd[0]);
 			strcat(bp, tbuf);
-			cmd = (Scsi_Cmnd *) cmd->host_scribble;
+			cmd = (struct scsi_cmnd *) cmd->host_scribble;
 		}
 	}
 	if (hd->proc & PR_DISCQ) {
 		strcat(bp, "\ndisconnected_Q:");
-		cmd = (Scsi_Cmnd *) hd->disconnected_Q;
+		cmd = (struct scsi_cmnd *) hd->disconnected_Q;
 		while (cmd) {
 			sprintf(tbuf, " %ld-%d:%d(%02x)",
 				cmd->pid, cmd->device->id, cmd->device->lun, cmd->cmnd[0]);
 			strcat(bp, tbuf);
-			cmd = (Scsi_Cmnd *) cmd->host_scribble;
+			cmd = (struct scsi_cmnd *) cmd->host_scribble;
 		}
 	}
 	strcat(bp, "\n");
diff --git a/drivers/scsi/wd33c93.h b/drivers/scsi/wd33c93.h
index b5d2a2a4d..6a7ebbc60 100644
--- a/drivers/scsi/wd33c93.h
+++ b/drivers/scsi/wd33c93.h
@@ -196,9 +196,9 @@ typedef struct {
 } wd33c93_regs;
 
 
-typedef int (*dma_setup_t) (Scsi_Cmnd *SCpnt, int dir_in);
-typedef void (*dma_stop_t) (struct Scsi_Host *instance, Scsi_Cmnd *SCpnt,
-             int status);
+typedef int (*dma_setup_t) (struct scsi_cmnd *SCpnt, int dir_in);
+typedef void (*dma_stop_t) (struct Scsi_Host *instance,
+		struct scsi_cmnd *SCpnt, int status);
 
 
 #define ILLEGAL_STATUS_BYTE   0xff
@@ -234,10 +234,10 @@ struct WD33C93_hostdata {
     uchar            *dma_bounce_buffer;
     unsigned int     dma_bounce_len;
     volatile uchar   busy[8];          /* index = target, bit = lun */
-    volatile Scsi_Cmnd *input_Q;       /* commands waiting to be started */
-    volatile Scsi_Cmnd *selecting;     /* trying to select this command */
-    volatile Scsi_Cmnd *connected;     /* currently connected command */
-    volatile Scsi_Cmnd *disconnected_Q;/* commands waiting for reconnect */
+    volatile struct scsi_cmnd *input_Q;       /* commands waiting to be started */
+    volatile struct scsi_cmnd *selecting;     /* trying to select this command */
+    volatile struct scsi_cmnd *connected;     /* currently connected command */
+    volatile struct scsi_cmnd *disconnected_Q;/* commands waiting for reconnect */
     uchar            state;            /* what we are currently doing */
     uchar            dma;              /* current state of DMA (on/off) */
     uchar            level2;           /* extent to which Level-2 commands are used */
@@ -335,11 +335,12 @@ struct WD33C93_hostdata {
 
 void wd33c93_init (struct Scsi_Host *instance, const wd33c93_regs regs,
          dma_setup_t setup, dma_stop_t stop, int clock_freq);
-int wd33c93_abort (Scsi_Cmnd *cmd);
-int wd33c93_queuecommand (Scsi_Cmnd *cmd, void (*done)(Scsi_Cmnd *));
+int wd33c93_abort (struct scsi_cmnd *cmd);
+int wd33c93_queuecommand (struct scsi_cmnd *cmd,
+		void (*done)(struct scsi_cmnd *));
 void wd33c93_intr (struct Scsi_Host *instance);
 int wd33c93_proc_info(struct Scsi_Host *, char *, char **, off_t, int, int);
-int wd33c93_host_reset (Scsi_Cmnd *);
+int wd33c93_host_reset (struct scsi_cmnd *);
 void wd33c93_release(void);
 
 #endif /* WD33C93_H */
diff --git a/drivers/scsi/wd7000.c b/drivers/scsi/wd7000.c
index 167733100..193e40c18 100644
--- a/drivers/scsi/wd7000.c
+++ b/drivers/scsi/wd7000.c
@@ -183,8 +183,10 @@
 #include <asm/dma.h>
 #include <asm/io.h>
 
-#include "scsi.h"
-#include "hosts.h"
+#include <scsi/scsi.h>
+#include <scsi/scsi_cmnd.h>
+#include <scsi/scsi_device.h>
+#include <scsi/scsi_host.h>
 #include <scsi/scsicam.h>
 
 
@@ -218,7 +220,7 @@
  *  In this version, sg_tablesize now defaults to WD7000_SG, and will
  *  be set to SG_NONE for older boards.  This is the reverse of the
  *  previous default, and was changed so that the driver-level
- *  Scsi_Host_Template would reflect the driver's support for scatter/
+ *  scsi_host_template would reflect the driver's support for scatter/
  *  gather.
  *
  *  Also, it has been reported that boards at Revision 6 support scatter/
@@ -435,8 +437,8 @@ typedef struct initCmd {
  *  carrying SCB addresses to/from the 7000-FASST2.
  *
  *  Note also since SCBs are not "permanently" associated with mailboxes,
- *  there is no need to keep a global list of Scsi_Cmnd pointers indexed
- *  by OGMB.   Again, SCBs reference their Scsi_Cmnds directly, so mailbox
+ *  there is no need to keep a global list of scsi_cmnd pointers indexed
+ *  by OGMB.   Again, SCBs reference their scsi_cmnds directly, so mailbox
  *  indices need not be involved.
  */
 
@@ -463,7 +465,7 @@ typedef struct scb {		/* Command Control Block 5.4.1               */
 	unchar direc;		/* Transfer Direction                        */
 	unchar reserved2[6];	/* SCSI Command Descriptor Block             */
 	/* end of hardware SCB                       */
-	Scsi_Cmnd *SCpnt;	/* Scsi_Cmnd using this SCB                  */
+	struct scsi_cmnd *SCpnt;/* scsi_cmnd using this SCB                  */
 	Sgb sgb[WD7000_SG];	/* Scatter/gather list for this SCB          */
 	Adapter *host;		/* host adapter                              */
 	struct scb *next;	/* for lists of scbs                         */
@@ -799,8 +801,8 @@ static inline void wd7000_enable_dma(Adapter * host)
 
 static inline short WAIT(unsigned port, unsigned mask, unsigned allof, unsigned noneof)
 {
-	register unsigned WAITbits;
-	register unsigned long WAITtimeout = jiffies + WAITnexttimeout;
+	unsigned WAITbits;
+	unsigned long WAITtimeout = jiffies + WAITnexttimeout;
 
 	while (time_before_eq(jiffies, WAITtimeout)) {
 		WAITbits = inb(port) & mask;
@@ -846,10 +848,10 @@ static inline int command_out(Adapter * host, unchar * cmd, int len)
  */
 static inline Scb *alloc_scbs(struct Scsi_Host *host, int needed)
 {
-	register Scb *scb, *p = NULL;
+	Scb *scb, *p = NULL;
 	unsigned long flags;
-	register unsigned long timeout = jiffies + WAITnexttimeout;
-	register unsigned long now;
+	unsigned long timeout = jiffies + WAITnexttimeout;
+	unsigned long now;
 	int i;
 
 	if (needed <= 0)
@@ -936,7 +938,7 @@ static int mail_out(Adapter * host, Scb * scbptr)
  *  Note: this can also be used for ICBs; just cast to the parm type.
  */
 {
-	register int i, ogmb;
+	int i, ogmb;
 	unsigned long flags;
 	unchar start_ogmb;
 	Mailbox *ogmbs = host->mb.ogmb;
@@ -1034,23 +1036,26 @@ static int make_code(unsigned hosterr, unsigned scsierr)
 
 #define wd7000_intr_ack(host)   outb (0, host->iobase + ASC_INTR_ACK)
 
-static void wd7000_intr_handle(int irq, void *dev_id, struct pt_regs *regs)
+
+static irqreturn_t wd7000_intr(int irq, void *dev_id, struct pt_regs *regs)
 {
-	register int flag, icmb, errstatus, icmb_status;
-	register int host_error, scsi_error;
-	register Scb *scb;	/* for SCSI commands */
-	register IcbAny *icb;	/* for host commands */
-	register Scsi_Cmnd *SCpnt;
 	Adapter *host = (Adapter *) dev_id;
+	int flag, icmb, errstatus, icmb_status;
+	int host_error, scsi_error;
+	Scb *scb;	/* for SCSI commands */
+	IcbAny *icb;	/* for host commands */
+	struct scsi_cmnd *SCpnt;
 	Mailbox *icmbs = host->mb.icmb;
+	unsigned long flags;
 
+	spin_lock_irqsave(host->sh->host_lock, flags);
 	host->int_counter++;
 
-	dprintk("wd7000_intr_handle: irq = %d, host = 0x%06lx\n", irq, (long) host);
+	dprintk("wd7000_intr: irq = %d, host = 0x%06lx\n", irq, (long) host);
 
 	flag = inb(host->iobase + ASC_INTR_STAT);
 
-	dprintk("wd7000_intr_handle: intr stat = 0x%02x\n", flag);
+	dprintk("wd7000_intr: intr stat = 0x%02x\n", flag);
 
 	if (!(inb(host->iobase + ASC_STAT) & INT_IM)) {
 		/* NB: these are _very_ possible if IRQ 15 is being used, since
@@ -1061,79 +1066,70 @@ static void wd7000_intr_handle(int irq, void *dev_id, struct pt_regs *regs)
 		 * can sort these out.  Otherwise, electrical noise and other such
 		 * problems would be indistinguishable from valid interrupts...
 		 */
-		dprintk("wd7000_intr_handle: phantom interrupt...\n");
-		wd7000_intr_ack(host);
-		return;
+		dprintk("wd7000_intr: phantom interrupt...\n");
+		goto ack;
 	}
 
-	if (flag & MB_INTR) {
-		/* The interrupt is for a mailbox */
-		if (!(flag & IMB_INTR)) {
-			dprintk("wd7000_intr_handle: free outgoing mailbox\n");
-			/*
-			 * If sleep_on() and the "interrupt on free OGMB" command are
-			 * used in mail_out(), wake_up() should correspondingly be called
-			 * here.  For now, we don't need to do anything special.
-			 */
-			wd7000_intr_ack(host);
-			return;
-		} else {
-			/* The interrupt is for an incoming mailbox */
-			icmb = flag & MB_MASK;
-			icmb_status = icmbs[icmb].status;
-			if (icmb_status & 0x80) {	/* unsolicited - result in ICMB */
-				dprintk("wd7000_intr_handle: unsolicited interrupt 0x%02x\n", icmb_status);
-				wd7000_intr_ack(host);
-				return;
-			}
-			/* Aaaargh! (Zaga) */
-			scb = isa_bus_to_virt(scsi2int((unchar *) icmbs[icmb].scbptr));
-			icmbs[icmb].status = 0;
-			if (!(scb->op & ICB_OP_MASK)) {	/* an SCB is done */
-				SCpnt = scb->SCpnt;
-				if (--(SCpnt->SCp.phase) <= 0) {	/* all scbs are done */
-					host_error = scb->vue | (icmb_status << 8);
-					scsi_error = scb->status;
-					errstatus = make_code(host_error, scsi_error);
-					SCpnt->result = errstatus;
-
-					free_scb(scb);
-
-					SCpnt->scsi_done(SCpnt);
-				}
-			} else {	/* an ICB is done */
-				icb = (IcbAny *) scb;
-				icb->status = icmb_status;
-				icb->phase = 0;
-			}
-		}		/* incoming mailbox */
+	if (!(flag & MB_INTR))
+		goto ack;
+
+	/* The interrupt is for a mailbox */
+	if (!(flag & IMB_INTR)) {
+		dprintk("wd7000_intr: free outgoing mailbox\n");
+		/*
+		 * If sleep_on() and the "interrupt on free OGMB" command are
+		 * used in mail_out(), wake_up() should correspondingly be called
+		 * here.  For now, we don't need to do anything special.
+		 */
+		goto ack;
 	}
 
-	wd7000_intr_ack(host);
+	/* The interrupt is for an incoming mailbox */
+	icmb = flag & MB_MASK;
+	icmb_status = icmbs[icmb].status;
+	if (icmb_status & 0x80) {	/* unsolicited - result in ICMB */
+		dprintk("wd7000_intr: unsolicited interrupt 0x%02x\n", icmb_status);
+		goto ack;
+	}
 
-	dprintk("wd7000_intr_handle: return from interrupt handler\n");
-}
+	/* Aaaargh! (Zaga) */
+	scb = isa_bus_to_virt(scsi2int((unchar *) icmbs[icmb].scbptr));
+	icmbs[icmb].status = 0;
+	if (scb->op & ICB_OP_MASK) {	/* an SCB is done */
+		icb = (IcbAny *) scb;
+		icb->status = icmb_status;
+		icb->phase = 0;
+		goto ack;
+	}
 
-static irqreturn_t do_wd7000_intr_handle(int irq, void *dev_id,
-					struct pt_regs *regs)
-{
-	unsigned long flags;
-	struct Scsi_Host *host = dev_id;
+	SCpnt = scb->SCpnt;
+	if (--(SCpnt->SCp.phase) <= 0) {	/* all scbs are done */
+		host_error = scb->vue | (icmb_status << 8);
+		scsi_error = scb->status;
+		errstatus = make_code(host_error, scsi_error);
+		SCpnt->result = errstatus;
 
-	spin_lock_irqsave(host->host_lock, flags);
-	wd7000_intr_handle(irq, dev_id, regs);
-	spin_unlock_irqrestore(host->host_lock, flags);
+		free_scb(scb);
+
+		SCpnt->scsi_done(SCpnt);
+	}
+
+ ack:
+	dprintk("wd7000_intr: return from interrupt handler\n");
+	wd7000_intr_ack(host);
+
+	spin_unlock_irqrestore(host->sh->host_lock, flags);
 	return IRQ_HANDLED;
 }
 
-
-static int wd7000_queuecommand(Scsi_Cmnd * SCpnt, void (*done) (Scsi_Cmnd *))
+static int wd7000_queuecommand(struct scsi_cmnd *SCpnt,
+		void (*done)(struct scsi_cmnd *))
 {
-	register Scb *scb;
-	register Sgb *sgb;
-	register unchar *cdb = (unchar *) SCpnt->cmnd;
-	register unchar idlun;
-	register short cdblen;
+	Scb *scb;
+	Sgb *sgb;
+	unchar *cdb = (unchar *) SCpnt->cmnd;
+	unchar idlun;
+	short cdblen;
 	Adapter *host = (Adapter *) SCpnt->device->host->hostdata;
 
 	cdblen = SCpnt->cmd_len;
@@ -1293,7 +1289,7 @@ static int wd7000_init(Adapter * host)
 		return 0;
 
 
-	if (request_irq(host->irq, do_wd7000_intr_handle, SA_INTERRUPT, "wd7000", host)) {
+	if (request_irq(host->irq, wd7000_intr, SA_INTERRUPT, "wd7000", host)) {
 		printk("wd7000_init: can't get IRQ %d.\n", host->irq);
 		return (0);
 	}
@@ -1434,7 +1430,7 @@ static int wd7000_proc_info(struct Scsi_Host *host, char *buffer, char **start,
  *
  */
 
-static int wd7000_detect(Scsi_Host_Template * tpnt)
+static int wd7000_detect(struct scsi_host_template *tpnt)
 {
 	short present = 0, biosaddr_ptr, sig_ptr, i, pass;
 	short biosptr[NUM_CONFIGS];
@@ -1605,6 +1601,7 @@ static int wd7000_release(struct Scsi_Host *shost)
 	return 0;
 }
 
+#if 0
 /*
  *  I have absolutely NO idea how to do an abort with the WD7000...
  */
@@ -1619,27 +1616,13 @@ static int wd7000_abort(Scsi_Cmnd * SCpnt)
 	}
 	return FAILED;
 }
-
-
-/*
- *  I also have no idea how to do a reset...
- */
-
-static int wd7000_bus_reset(Scsi_Cmnd * SCpnt)
-{
-	return FAILED;
-}
-
-static int wd7000_device_reset(Scsi_Cmnd * SCpnt)
-{
-	return FAILED;
-}
+#endif
 
 /*
  *  Last resort. Reinitialize the board.
  */
 
-static int wd7000_host_reset(Scsi_Cmnd * SCpnt)
+static int wd7000_host_reset(struct scsi_cmnd *SCpnt)
 {
 	Adapter *host = (Adapter *) SCpnt->device->host->hostdata;
 
@@ -1649,7 +1632,6 @@ static int wd7000_host_reset(Scsi_Cmnd * SCpnt)
 	return SUCCESS;
 }
 
-
 /*
  *  This was borrowed directly from aha1542.c. (Zaga)
  */
@@ -1705,15 +1687,13 @@ MODULE_AUTHOR("Thomas Wuensche, John Boyd, Miroslav Zagorac");
 MODULE_DESCRIPTION("Driver for the WD7000 series ISA controllers");
 MODULE_LICENSE("GPL");
 
-static Scsi_Host_Template driver_template = {
+static struct scsi_host_template driver_template = {
 	.proc_name		= "wd7000",
 	.proc_info		= wd7000_proc_info,
 	.name			= "Western Digital WD-7000",
 	.detect			= wd7000_detect,
 	.release		= wd7000_release,
 	.queuecommand		= wd7000_queuecommand,
-	.eh_bus_reset_handler	= wd7000_bus_reset,
-	.eh_device_reset_handler = wd7000_device_reset,
 	.eh_host_reset_handler	= wd7000_host_reset,
 	.bios_param		= wd7000_biosparam,
 	.can_queue		= WD7000_Q,
diff --git a/drivers/scsi/zalon.c b/drivers/scsi/zalon.c
index 10c7741fa..9b946fd6d 100644
--- a/drivers/scsi/zalon.c
+++ b/drivers/scsi/zalon.c
@@ -4,27 +4,13 @@
  */
 
 #include <linux/init.h>
-#include <linux/types.h>
-#include <linux/stat.h>
-#include <linux/mm.h>
-#include <linux/blkdev.h>
-#include <linux/sched.h>
-#include <linux/version.h>
-#include <linux/config.h>
+#include <linux/interrupt.h>
 #include <linux/module.h>
-
-#include <scsi/scsicam.h>
-
-#include <asm/page.h>
-#include <asm/pgtable.h>
-#include <asm/irq.h>
+#include <linux/types.h>
 #include <asm/hardware.h>
-#include <asm/delay.h>
 #include <asm/io.h>
 
 #include "../parisc/gsc.h"
-#include "scsi.h"
-#include "hosts.h"
 
 #include "ncr53c8xx.h"
 
@@ -40,20 +26,18 @@ MODULE_LICENSE("GPL");
 #define IO_MODULE_IO_COMMAND	(12*4)
 #define IO_MODULE_IO_STATUS	(13*4)
 
-#define IOSTATUS_RY             0x40
-#define IOSTATUS_FE             0x80
-#define IOIIDATA_SMINT5L        0x40000000
-#define IOIIDATA_MINT5EN        0x20000000
-#define IOIIDATA_PACKEN         0x10000000
-#define IOIIDATA_PREFETCHEN     0x08000000
-#define IOIIDATA_IOII           0x00000020
+#define IOSTATUS_RY		0x40
+#define IOSTATUS_FE		0x80
+#define IOIIDATA_SMINT5L	0x40000000
+#define IOIIDATA_MINT5EN	0x20000000
+#define IOIIDATA_PACKEN		0x10000000
+#define IOIIDATA_PREFETCHEN	0x08000000
+#define IOIIDATA_IOII		0x00000020
 
 #define CMD_RESET		5
 
-static ncr_chip zalon720_chip __initdata = {
-	.device_id =	PSEUDO_720_ID,
+static struct ncr_chip zalon720_chip __initdata = {
 	.revision_id =	0x0f,
-	.name =		"720",
 	.burst_max =	3,
 	.offset_max =	8,
 	.nr_divisor =	4,
@@ -93,7 +77,7 @@ lasi_scsi_clock(void * hpa, int defaultclock)
 }
 #endif
 
-static Scsi_Host_Template zalon7xx_template = {
+static struct scsi_host_template zalon7xx_template = {
 	.module		= THIS_MODULE,
 	.proc_name	= "zalon7xx",
 };
@@ -123,7 +107,7 @@ zalon_probe(struct parisc_device *dev)
 	/* Setup the interrupts first.
 	** Later on request_irq() will register the handler.
 	*/
-        irq = gsc_alloc_irq(&gsc_irq);
+	irq = gsc_alloc_irq(&gsc_irq);
 
 	printk("%s: Zalon vers field is 0x%x, IRQ %d\n", __FUNCTION__,
 		zalon_vers, irq);
@@ -155,7 +139,7 @@ zalon_probe(struct parisc_device *dev)
 
 	if (request_irq(irq, ncr53c8xx_intr, SA_SHIRQ, dev->dev.bus_id, host)) {
 		printk(KERN_ERR "%s: irq problem with %d, detaching\n ",
-		       dev->dev.bus_id, irq);
+			dev->dev.bus_id, irq);
 		goto fail;
 	}
 
diff --git a/drivers/serial/8250.c b/drivers/serial/8250.c
index d61f7a24f..4906b5751 100644
--- a/drivers/serial/8250.c
+++ b/drivers/serial/8250.c
@@ -1687,8 +1687,6 @@ static void serial8250_release_port(struct uart_port *port)
 	struct uart_8250_port *up = (struct uart_8250_port *)port;
 	unsigned long start, offset = 0, size = 0;
 
-	if (!(up->port.flags & UPF_RESOURCES))
-		return;
 	if (up->port.type == PORT_RSA) {
 		offset = UART_RSA_BASE << up->port.regshift;
 		size = 8;
@@ -1733,16 +1731,14 @@ static int serial8250_request_port(struct uart_port *port)
 	struct resource *res = NULL, *res_rsa = NULL;
 	int ret = 0;
 
-	if (up->port.flags & UPF_RESOURCES) {
-		if (up->port.type == PORT_RSA) {
-			ret = serial8250_request_rsa_resource(up, &res_rsa);
-			if (ret < 0)
-				return ret;
-		}
-
-		ret = serial8250_request_std_resource(up, &res);
+	if (up->port.type == PORT_RSA) {
+		ret = serial8250_request_rsa_resource(up, &res_rsa);
+		if (ret < 0)
+			return ret;
 	}
 
+	ret = serial8250_request_std_resource(up, &res);
+
 	/*
 	 * If we have a mapbase, then request that as well.
 	 */
@@ -1782,17 +1778,13 @@ static void serial8250_config_port(struct uart_port *port, int flags)
 	 * Find the region that we can probe for.  This in turn
 	 * tells us whether we can probe for the type of port.
 	 */
-	if (up->port.flags & UPF_RESOURCES) {
-		ret = serial8250_request_std_resource(up, &res_std);
-		if (ret < 0)
-			return;
+	ret = serial8250_request_std_resource(up, &res_std);
+	if (ret < 0)
+		return;
 
-		ret = serial8250_request_rsa_resource(up, &res_rsa);
-		if (ret < 0)
-			probeflags &= ~PROBE_RSA;
-	} else {
+	ret = serial8250_request_rsa_resource(up, &res_rsa);
+	if (ret < 0)
 		probeflags &= ~PROBE_RSA;
-	}
 
 	if (flags & UART_CONFIG_TYPE)
 		autoconfig(up, probeflags);
@@ -1867,8 +1859,7 @@ static void __init serial8250_isa_init_ports(void)
 		up->port.iobase   = old_serial_port[i].port;
 		up->port.irq      = irq_canonicalize(old_serial_port[i].irq);
 		up->port.uartclk  = old_serial_port[i].baud_base * 16;
-		up->port.flags    = old_serial_port[i].flags |
-				    UPF_RESOURCES;
+		up->port.flags    = old_serial_port[i].flags;
 		up->port.hub6     = old_serial_port[i].hub6;
 		up->port.membase  = old_serial_port[i].iomem_base;
 		up->port.iotype   = old_serial_port[i].io_type;
@@ -2013,7 +2004,7 @@ static int __init serial8250_console_setup(struct console *co, char *options)
 	return uart_set_options(port, co, baud, parity, bits, flow);
 }
 
-extern struct uart_driver serial8250_reg;
+static struct uart_driver serial8250_reg;
 static struct console serial8250_console = {
 	.name		= "ttyS",
 	.write		= serial8250_console_write,
diff --git a/drivers/serial/8250_acorn.c b/drivers/serial/8250_acorn.c
index d46b9f98e..2e69f6c53 100644
--- a/drivers/serial/8250_acorn.c
+++ b/drivers/serial/8250_acorn.c
@@ -43,8 +43,7 @@ serial_register_onedev(unsigned long baddr, void *vaddr, int irq, unsigned int b
 
 	memset(&req, 0, sizeof(req));
 	req.irq			= irq;
-	req.flags		= UPF_AUTOPROBE | UPF_RESOURCES |
-				  UPF_SHARE_IRQ;
+	req.flags		= UPF_AUTOPROBE | UPF_SHARE_IRQ;
 	req.baud_base		= baud_base;
 	req.io_type		= UPIO_MEM;
 	req.iomem_base		= vaddr;
diff --git a/drivers/serial/8250_acpi.c b/drivers/serial/8250_acpi.c
index d8c8a8157..ec25d59a1 100644
--- a/drivers/serial/8250_acpi.c
+++ b/drivers/serial/8250_acpi.c
@@ -57,28 +57,18 @@ static acpi_status acpi_serial_port(struct serial_struct *req,
 static acpi_status acpi_serial_ext_irq(struct serial_struct *req,
 				       struct acpi_resource_ext_irq *ext_irq)
 {
-	if (ext_irq->number_of_interrupts > 0) {
-#ifdef CONFIG_IA64
-		req->irq = acpi_register_irq(ext_irq->interrupts[0],
-	                  ext_irq->active_high_low, ext_irq->edge_level);
-#else
-		req->irq = ext_irq->interrupts[0];
-#endif
-	}
+	if (ext_irq->number_of_interrupts > 0)
+		req->irq = acpi_register_gsi(ext_irq->interrupts[0],
+	                  ext_irq->edge_level, ext_irq->active_high_low);
 	return AE_OK;
 }
 
 static acpi_status acpi_serial_irq(struct serial_struct *req,
 				   struct acpi_resource_irq *irq)
 {
-	if (irq->number_of_interrupts > 0) {
-#ifdef CONFIG_IA64
-		req->irq = acpi_register_irq(irq->interrupts[0],
-	                  irq->active_high_low, irq->edge_level);
-#else
-		req->irq = irq->interrupts[0];
-#endif
-	}
+	if (irq->number_of_interrupts > 0)
+		req->irq = acpi_register_gsi(irq->interrupts[0],
+	                  irq->edge_level, irq->active_high_low);
 	return AE_OK;
 }
 
@@ -133,7 +123,7 @@ static int acpi_serial_add(struct acpi_device *device)
 	}
 
 	serial_req.baud_base = BASE_BAUD;
-	serial_req.flags = UPF_SKIP_TEST | UPF_BOOT_AUTOCONF | UPF_RESOURCES;
+	serial_req.flags = UPF_SKIP_TEST | UPF_BOOT_AUTOCONF;
 
 	priv->line = register_serial(&serial_req);
 	if (priv->line < 0) {
diff --git a/drivers/serial/8250_pci.c b/drivers/serial/8250_pci.c
index 3b3427e0b..34b367778 100644
--- a/drivers/serial/8250_pci.c
+++ b/drivers/serial/8250_pci.c
@@ -497,7 +497,7 @@ static struct timedia_struct {
 	{ 2, timedia_dual_port },
 	{ 4, timedia_quad_port },
 	{ 8, timedia_eight_port },
-	{ 0, 0 }
+	{ 0, NULL }
 };
 
 static int __devinit pci_timedia_init(struct pci_dev *dev)
@@ -574,8 +574,7 @@ titan_400l_800l_setup(struct pci_dev *dev, struct pci_board *board,
 
 static int __devinit pci_xircom_init(struct pci_dev *dev)
 {
-	__set_current_state(TASK_UNINTERRUPTIBLE);
-	schedule_timeout(HZ/10);
+	msleep(100);
 	return 0;
 }
 
@@ -1665,7 +1664,7 @@ pciserial_init_one(struct pci_dev *dev, const struct pci_device_id *ent)
 	for (i = 0; i < nr_ports; i++) {
 		memset(&serial_req, 0, sizeof(serial_req));
 		serial_req.flags = UPF_SKIP_TEST | UPF_AUTOPROBE |
-				   UPF_RESOURCES | UPF_SHARE_IRQ;
+				   UPF_SHARE_IRQ;
 		serial_req.baud_base = board->base_baud;
 		serial_req.irq = get_pci_irq(dev, board, i);
 		if (quirk->setup(dev, board, &serial_req, i))
diff --git a/drivers/serial/8250_pnp.c b/drivers/serial/8250_pnp.c
index abbbe3fc3..efa91660a 100644
--- a/drivers/serial/8250_pnp.c
+++ b/drivers/serial/8250_pnp.c
@@ -334,7 +334,7 @@ static char *modem_names[] __devinitdata = {
 	"MODEM", "Modem", "modem", "FAX", "Fax", "fax",
 	"56K", "56k", "K56", "33.6", "28.8", "14.4",
 	"33,600", "28,800", "14,400", "33.600", "28.800", "14.400",
-	"33600", "28800", "14400", "V.90", "V.34", "V.32", 0
+	"33600", "28800", "14400", "V.90", "V.34", "V.32", NULL
 };
 
 static int __devinit check_name(char *name)
@@ -361,9 +361,6 @@ static int __devinit check_resources(struct pnp_option *option)
 			    ((port->min == 0x2f8) ||
 			     (port->min == 0x3f8) ||
 			     (port->min == 0x2e8) ||
-#ifdef CONFIG_X86_PC9800
-			     (port->min == 0x8b0) ||
-#endif
 			     (port->min == 0x3e8)))
 				return 1;
 	}
@@ -416,7 +413,7 @@ serial_pnp_probe(struct pnp_dev * dev, const struct pnp_device_id *dev_id)
 	       serial_req.port, serial_req.irq, serial_req.io_type);
 #endif
 
-	serial_req.flags = UPF_SKIP_TEST | UPF_AUTOPROBE  | UPF_RESOURCES;
+	serial_req.flags = UPF_SKIP_TEST | UPF_AUTOPROBE;
 	serial_req.baud_base = 115200;
 	line = register_serial(&serial_req);
 
diff --git a/drivers/serial/Kconfig b/drivers/serial/Kconfig
index 8e6060f42..74a0b9cad 100644
--- a/drivers/serial/Kconfig
+++ b/drivers/serial/Kconfig
@@ -10,6 +10,7 @@ menu "Serial drivers"
 # The new 8250/16550 serial drivers
 config SERIAL_8250
 	tristate "8250/16550 and compatible serial support"
+	depends on (BROKEN || !SPARC64)
 	select SERIAL_CORE
 	---help---
 	  This selects whether you want to include the driver for the standard
@@ -62,15 +63,6 @@ config SERIAL_8250_CONSOLE
 
 	  If unsure, say N.
 
-config SERIAL_8250_HCDP
-	bool "Console device discovery via EFI HCDP table"
-	depends on IA64
-	depends on SERIAL_8250_CONSOLE=y
-	---help---
-	  If you wish to make the serial console port described by the EFI
-	  HCDP table available for use as serial console, say Y here.  See
-	  <http://www.dig64.org/specifications/DIG64_HCDPv10a_01.pdf>.
-
 config SERIAL_8250_CS
 	tristate "8250/16550 PCMCIA device support"
 	depends on PCMCIA && SERIAL_8250
@@ -518,19 +510,6 @@ config V850E_UART_CONSOLE
 	depends on V850E_UART
 	select SERIAL_CORE_CONSOLE
 
-config SERIAL98
-	tristate "PC-9800 8251-based primary serial port support"
-	depends on X86_PC9800
-	select SERIAL_CORE
-	help
-	  If you want to use standard primary serial ports on PC-9800, 
-	  say Y.  Otherwise, say N.
-
-config SERIAL98_CONSOLE
-        bool "Support for console on PC-9800 standard serial port"
-        depends on SERIAL98=y
-	select SERIAL_CORE_CONSOLE
-
 config SERIAL_SH_SCI
 	tristate "SH SCI(F) serial port support"
 	depends on SUPERH || H8300
@@ -616,5 +595,123 @@ config SERIAL_PMACZILOG_CONSOLE
 	  on your PowerMac as the console, you can do so by answering
 	  Y to this option.
 
-endmenu
+config SERIAL_LH7A40X
+	tristate "Sharp LH7A40X embedded UART support"
+	depends on ARM && ARCH_LH7A40X
+	select SERIAL_CORE
+	help
+	  This enables support for the three on-board UARTs of the
+	  Sharp LH7A40X series CPUs.  Choose Y or M.
 
+config SERIAL_LH7A40X_CONSOLE
+	bool "Support for connsole on Sharp LH7A40X serial port"
+	depends on SERIAL_LH7A40X=y
+	select SERIAL_CORE_CONSOLE
+	help
+	  Say Y here if you wish to use one of the serial ports as the
+	  system console--the system console is the device which
+	  receives all kernel messages and warnings and which allows
+	  logins in single user mode.
+
+	  Even if you say Y here, the currently visible framebuffer console
+	  (/dev/tty0) will still be used as the default system console, but
+	  you can alter that using a kernel command line, for example
+	  "console=ttyAM1".
+
+config SERIAL_CPM
+	tristate "CPM SCC/SMC serial port support"
+	depends on CPM2 || 8xx
+	select SERIAL_CORE
+	help
+	  This driver supports the SCC and SMC serial ports on Motorola 
+	  embedded PowerPC that contain a CPM1 (8xx) or CPM2 (8xxx)
+
+config SERIAL_CPM_CONSOLE
+	bool "Support for console on CPM SCC/SMC serial port"
+	depends on SERIAL_CPM=y
+	select SERIAL_CORE_CONSOLE
+	help
+	  Say Y here if you wish to use a SCC or SMC CPM UART as the system
+	  console (the system console is the device which receives all kernel
+	  messages and warnings and which allows logins in single user mode).
+
+	  Even if you say Y here, the currently visible framebuffer console
+	  (/dev/tty0) will still be used as the system console by default, but
+	  you can alter that using a kernel command line option such as
+	  "console=ttyCPM0". (Try "man bootparam" or see the documentation of
+	  your boot loader (lilo or loadlin) about how to pass options to the
+	  kernel at boot time.)
+
+config SERIAL_CPM_SCC1
+	bool "Support for SCC1 serial port"
+	depends on SERIAL_CPM=y
+	help
+	  Select the is option to use SCC1 as a serial port
+
+config SERIAL_CPM_SCC2
+	bool "Support for SCC2 serial port"
+	depends on SERIAL_CPM=y
+	help
+	  Select the is option to use SCC2 as a serial port
+
+config SERIAL_CPM_SCC3
+	bool "Support for SCC3 serial port"
+	depends on SERIAL_CPM=y
+	help
+	  Select the is option to use SCC3 as a serial port
+
+config SERIAL_CPM_SCC4
+	bool "Support for SCC4 serial port"
+	depends on SERIAL_CPM=y
+	help
+	  Select the is option to use SCC4 as a serial port
+
+config SERIAL_CPM_SMC1
+	bool "Support for SMC1 serial port"
+	depends on SERIAL_CPM=y
+	help
+	  Select the is option to use SMC1 as a serial port
+
+config SERIAL_CPM_SMC2
+	bool "Support for SMC2 serial port"
+	depends on SERIAL_CPM=y
+	help
+	  Select the is option to use SMC2 as a serial port
+
+config SERIAL_SGI_L1_CONSOLE
+	bool "SGI Altix L1 serial console support"
+	depends on IA64_GENERIC || IA64_SGI_SN2
+	select SERIAL_CORE
+	help
+		If you have an SGI Altix and you would like to use the system
+		controller serial port as your console (you want this!),
+		say Y.  Otherwise, say N.
+
+config SERIAL_MPC52xx
+	tristate "Freescale MPC52xx family PSC serial support"
+	depends on PPC_MPC52xx
+	select SERIAL_CORE
+	help
+	  This drivers support the MPC52xx PSC serial ports. If you would
+	  like to use them, you must answer Y or M to this option. Not that
+	  for use as console, it must be included in kernel and not as a
+	  module.
+
+config SERIAL_MPC52xx_CONSOLE
+	bool "Console on a Freescale MPC52xx family PSC serial port"
+	depends on SERIAL_MPC52xx=y
+	select SERIAL_CORE_CONSOLE
+	help
+	  Select this options if you'd like to use one of the PSC serial port
+	  of the Freescale MPC52xx family as a console.
+
+config SERIAL_MPC52xx_CONSOLE_BAUD
+	int "Freescale MPC52xx family PSC serial port baud"
+	depends on SERIAL_MPC52xx_CONSOLE=y
+	default "9600"
+	help
+	  Select the MPC52xx console baud rate.
+	  This value is only used if the bootloader doesn't pass in the
+	  console baudrate
+
+endmenu
diff --git a/drivers/serial/Makefile b/drivers/serial/Makefile
index 1252dfb2c..dbe2e5f76 100644
--- a/drivers/serial/Makefile
+++ b/drivers/serial/Makefile
@@ -9,7 +9,6 @@ serial-8250-$(CONFIG_SERIAL_8250_ACPI) += 8250_acpi.o
 serial-8250-$(CONFIG_GSC) += 8250_gsc.o
 serial-8250-$(CONFIG_PCI) += 8250_pci.o
 serial-8250-$(CONFIG_PNP) += 8250_pnp.o
-serial-8250-$(CONFIG_SERIAL_8250_HCDP) += 8250_hcdp.o
 
 obj-$(CONFIG_SERIAL_CORE) += serial_core.o
 obj-$(CONFIG_SERIAL_21285) += 21285.o
@@ -33,9 +32,12 @@ obj-$(CONFIG_SERIAL_68328) += 68328serial.o
 obj-$(CONFIG_SERIAL_68360) += 68360serial.o
 obj-$(CONFIG_SERIAL_COLDFIRE) += mcfserial.o
 obj-$(CONFIG_V850E_UART) += v850e_uart.o
-obj-$(CONFIG_SERIAL98) += serial98.o
 obj-$(CONFIG_SERIAL_PMACZILOG) += pmac_zilog.o
+obj-$(CONFIG_SERIAL_LH7A40X) += serial_lh7a40x.o
 obj-$(CONFIG_SERIAL_AU1X00) += au1x00_uart.o
 obj-$(CONFIG_SERIAL_DZ) += dz.o
 obj-$(CONFIG_SERIAL_SH_SCI) += sh-sci.o
 obj-$(CONFIG_SERIAL_BAST_SIO) += bast_sio.o
+obj-$(CONFIG_SERIAL_SGI_L1_CONSOLE) += sn_console.o
+obj-$(CONFIG_SERIAL_CPM) += cpm_uart/
+obj-$(CONFIG_SERIAL_MPC52xx) += mpc52xx_uart.o
diff --git a/drivers/serial/amba-pl011.c b/drivers/serial/amba-pl011.c
index f90247482..c91f6b149 100644
--- a/drivers/serial/amba-pl011.c
+++ b/drivers/serial/amba-pl011.c
@@ -44,6 +44,7 @@
 #include <asm/io.h>
 #include <asm/irq.h>
 #include <asm/hardware/amba.h>
+#include <asm/hardware/clock.h>
 
 #if defined(CONFIG_SERIAL_AMBA_PL011_CONSOLE) && defined(CONFIG_MAGIC_SYSRQ)
 #define SUPPORT_SYSRQ
@@ -68,6 +69,7 @@
  */
 struct uart_amba_port {
 	struct uart_port	port;
+	struct clk		*clk;
 	unsigned int		im;	/* interrupt mask */
 	unsigned int		old_status;
 };
@@ -351,12 +353,21 @@ static int pl011_startup(struct uart_port *port)
 	unsigned int cr;
 	int retval;
 
+	/*
+	 * Try to enable the clock producer.
+	 */
+	retval = clk_enable(uap->clk);
+	if (retval)
+		goto out;
+
+	uap->port.uartclk = clk_get_rate(uap->clk);
+
 	/*
 	 * Allocate the IRQ
 	 */
 	retval = request_irq(uap->port.irq, pl011_int, 0, "uart-pl011", uap);
 	if (retval)
-		goto out;
+		goto clk_dis;
 
 	writew(UART011_IFLS_RX4_8|UART011_IFLS_TX4_8,
 	       uap->port.membase + UART011_IFLS);
@@ -391,6 +402,8 @@ static int pl011_startup(struct uart_port *port)
 
 	return 0;
 
+ clk_dis:
+	clk_disable(uap->clk);
  out:
 	return retval;
 }
@@ -425,6 +438,11 @@ static void pl011_shutdown(struct uart_port *port)
 	val = readw(uap->port.membase + UART011_LCRH);
 	val &= ~(UART01x_LCRH_BRK | UART01x_LCRH_FEN);
 	writew(val, uap->port.membase + UART011_LCRH);
+
+	/*
+	 * Shut down the clock producer
+	 */
+	clk_disable(uap->clk);
 }
 
 static void
@@ -594,38 +612,40 @@ static struct uart_amba_port *amba_ports[UART_NR];
 #ifdef CONFIG_SERIAL_AMBA_PL011_CONSOLE
 
 static inline void
-pl011_console_write_char(struct uart_port *port, char ch)
+pl011_console_write_char(struct uart_amba_port *uap, char ch)
 {
 	unsigned int status;
 
 	do {
-		status = readw(port->membase + UART01x_FR);
+		status = readw(uap->port.membase + UART01x_FR);
 	} while (status & UART01x_FR_TXFF);
-	writew(ch, port->membase + UART01x_DR);
+	writew(ch, uap->port.membase + UART01x_DR);
 }
 
 static void
 pl011_console_write(struct console *co, const char *s, unsigned int count)
 {
-	struct uart_port *port = &amba_ports[co->index]->port;
+	struct uart_amba_port *uap = amba_ports[co->index];
 	unsigned int status, old_cr, new_cr;
 	int i;
 
+	clk_enable(uap->clk);
+
 	/*
 	 *	First save the CR then disable the interrupts
 	 */
-	old_cr = readw(port->membase + UART011_CR);
+	old_cr = readw(uap->port.membase + UART011_CR);
 	new_cr = old_cr & ~UART011_CR_CTSEN;
 	new_cr |= UART01x_CR_UARTEN | UART011_CR_TXE;
-	writew(new_cr, port->membase + UART011_CR);
+	writew(new_cr, uap->port.membase + UART011_CR);
 
 	/*
 	 *	Now, do each character
 	 */
 	for (i = 0; i < count; i++) {
-		pl011_console_write_char(port, s[i]);
+		pl011_console_write_char(uap, s[i]);
 		if (s[i] == '\n')
-			pl011_console_write_char(port, '\r');
+			pl011_console_write_char(uap, '\r');
 	}
 
 	/*
@@ -633,19 +653,21 @@ pl011_console_write(struct console *co, const char *s, unsigned int count)
 	 *	and restore the TCR
 	 */
 	do {
-		status = readw(port->membase + UART01x_FR);
+		status = readw(uap->port.membase + UART01x_FR);
 	} while (status & UART01x_FR_BUSY);
-	writew(old_cr, port->membase + UART011_CR);
+	writew(old_cr, uap->port.membase + UART011_CR);
+
+	clk_disable(uap->clk);
 }
 
 static void __init
-pl011_console_get_options(struct uart_port *port, int *baud,
+pl011_console_get_options(struct uart_amba_port *uap, int *baud,
 			     int *parity, int *bits)
 {
-	if (readw(port->membase + UART011_CR) & UART01x_CR_UARTEN) {
+	if (readw(uap->port.membase + UART011_CR) & UART01x_CR_UARTEN) {
 		unsigned int lcr_h, ibrd, fbrd;
 
-		lcr_h = readw(port->membase + UART011_LCRH);
+		lcr_h = readw(uap->port.membase + UART011_LCRH);
 
 		*parity = 'n';
 		if (lcr_h & UART01x_LCRH_PEN) {
@@ -660,10 +682,10 @@ pl011_console_get_options(struct uart_port *port, int *baud,
 		else
 			*bits = 8;
 
-		ibrd = readw(port->membase + UART011_IBRD);
-		fbrd = readw(port->membase + UART011_FBRD);
+		ibrd = readw(uap->port.membase + UART011_IBRD);
+		fbrd = readw(uap->port.membase + UART011_FBRD);
 
-		*baud = port->uartclk * 4 / (64 * ibrd + fbrd);
+		*baud = uap->port.uartclk * 4 / (64 * ibrd + fbrd);
 	}
 }
 
@@ -685,10 +707,12 @@ static int __init pl011_console_setup(struct console *co, char *options)
 		co->index = 0;
 	uap = amba_ports[co->index];
 
+	uap->port.uartclk = clk_get_rate(uap->clk);
+
 	if (options)
 		uart_parse_options(options, &baud, &parity, &bits, &flow);
 	else
-		pl011_console_get_options(&uap->port, &baud, &parity, &bits);
+		pl011_console_get_options(uap, &baud, &parity, &bits);
 
 	return uart_set_options(&uap->port, co, baud, parity, bits, flow);
 }
@@ -747,16 +771,21 @@ static int pl011_probe(struct amba_device *dev, void *id)
 	}
 
 	memset(uap, 0, sizeof(struct uart_amba_port));
+	uap->clk = clk_get(&dev->dev, "UARTCLK");
+	if (IS_ERR(uap->clk)) {
+		ret = PTR_ERR(uap->clk);
+		goto unmap;
+	}
+
+	ret = clk_use(uap->clk);
+	if (ret)
+		goto putclk;
+
 	uap->port.dev = &dev->dev;
 	uap->port.mapbase = dev->res.start;
 	uap->port.membase = base;
 	uap->port.iotype = UPIO_MEM;
 	uap->port.irq = dev->irq[0];
-#if 0 /* FIXME */
-	uap->port.uartclk = 14745600;
-#else
-	uap->port.uartclk = 24000000;
-#endif
 	uap->port.fifosize = 16;
 	uap->port.ops = &amba_pl011_pops;
 	uap->port.flags = UPF_BOOT_AUTOCONF;
@@ -769,6 +798,10 @@ static int pl011_probe(struct amba_device *dev, void *id)
 	if (ret) {
 		amba_set_drvdata(dev, NULL);
 		amba_ports[i] = NULL;
+		clk_unuse(uap->clk);
+ putclk:
+		clk_put(uap->clk);
+ unmap:
 		iounmap(base);
  free:
 		kfree(uap);
@@ -791,6 +824,8 @@ static int pl011_remove(struct amba_device *dev)
 			amba_ports[i] = NULL;
 
 	iounmap(uap->port.membase);
+	clk_unuse(uap->clk);
+	clk_put(uap->clk);
 	kfree(uap);
 	return 0;
 }
diff --git a/drivers/serial/au1x00_uart.c b/drivers/serial/au1x00_uart.c
index 9b9eeb2cc..f1c524aca 100644
--- a/drivers/serial/au1x00_uart.c
+++ b/drivers/serial/au1x00_uart.c
@@ -969,9 +969,7 @@ static int serial8250_request_port(struct uart_port *port)
 	struct resource *res = NULL, *res_rsa = NULL;
 	int ret = 0;
 
-	if (up->port.flags & UPF_RESOURCES) {
-		ret = serial8250_request_std_resource(up, &res);
-	}
+	ret = serial8250_request_std_resource(up, &res);
 
 	/*
 	 * If we have a mapbase, then request that as well.
@@ -1072,8 +1070,7 @@ static void __init serial8250_isa_init_ports(void)
 		up->port.iobase   = old_serial_port[i].port;
 		up->port.irq      = old_serial_port[i].irq;
 		up->port.uartclk  = get_au1x00_uart_baud_base();
-		up->port.flags    = old_serial_port[i].flags |
-				    UPF_RESOURCES;
+		up->port.flags    = old_serial_port[i].flags;
 		up->port.hub6     = old_serial_port[i].hub6;
 		up->port.membase  = old_serial_port[i].iomem_base;
 		up->port.iotype   = old_serial_port[i].io_type;
diff --git a/drivers/serial/bast_sio.c b/drivers/serial/bast_sio.c
index ea9fd71b5..698514d16 100644
--- a/drivers/serial/bast_sio.c
+++ b/drivers/serial/bast_sio.c
@@ -24,7 +24,7 @@ static int __init serial_bast_register(unsigned long port, unsigned int irq)
 	printk("BAST: SuperIO serial (%08lx,%d)\n", port, irq);
 #endif
 
-	serial_req.flags      = UPF_AUTOPROBE | UPF_RESOURCES | UPF_SHARE_IRQ;
+	serial_req.flags      = UPF_AUTOPROBE | UPF_SHARE_IRQ;
 	serial_req.baud_base  = BASE_BAUD;
 	serial_req.irq        = irq;
 	serial_req.io_type    = UPIO_MEM;
diff --git a/drivers/serial/cpm_uart/cpm_uart_core.c b/drivers/serial/cpm_uart/cpm_uart_core.c
index 0612e9453..34f4c6737 100644
--- a/drivers/serial/cpm_uart/cpm_uart_core.c
+++ b/drivers/serial/cpm_uart/cpm_uart_core.c
@@ -64,8 +64,9 @@ int cpm_uart_nr;
 /**************************************************************/
 
 static int  cpm_uart_tx_pump(struct uart_port *port);
-static void cpm_uart_init_smc(struct uart_cpm_port *pinfo, int bits, u16 cval);
-static void cpm_uart_init_scc(struct uart_cpm_port *pinfo, int sbits, u16 sval);
+static void cpm_uart_init_smc(struct uart_cpm_port *pinfo);
+static void cpm_uart_init_scc(struct uart_cpm_port *pinfo);
+static void cpm_uart_initbd(struct uart_cpm_port *pinfo);
 
 /**************************************************************/
 
@@ -133,10 +134,6 @@ static void cpm_uart_start_tx(struct uart_port *port, unsigned int tty_start)
 
 	pr_debug("CPM uart[%d]:start tx\n", port->line);
 
-	/* if in the middle of discarding return */
-	if (IS_DISCARDING(pinfo))
-		return;
-
 	if (IS_SMC(pinfo)) {
 		if (smcp->smc_smcm & SMCM_TX)
 			return;
@@ -362,6 +359,7 @@ static irqreturn_t cpm_uart_int(int irq, void *data, struct pt_regs *regs)
 static int cpm_uart_startup(struct uart_port *port)
 {
 	int retval;
+	struct uart_cpm_port *pinfo = (struct uart_cpm_port *)port;
 
 	pr_debug("CPM uart[%d]:startup\n", port->line);
 
@@ -370,6 +368,14 @@ static int cpm_uart_startup(struct uart_port *port)
 	if (retval)
 		return retval;
 
+	/* Startup rx-int */
+	if (IS_SMC(pinfo)) {
+		pinfo->smcp->smc_smcm |= SMCM_RX;
+		pinfo->smcp->smc_smcmr |= SMCMR_REN;
+	} else {
+		pinfo->sccp->scc_sccm |= UART_SCCM_RX;
+	}
+
 	return 0;
 }
 
@@ -400,7 +406,8 @@ static void cpm_uart_shutdown(struct uart_port *port)
 		}
 
 		/* Shut them really down and reinit buffer descriptors */
-		cpm_line_cr_cmd(line, CPM_CR_INIT_TRX);
+		cpm_line_cr_cmd(line, CPM_CR_STOP_TX);
+		cpm_uart_initbd(pinfo);
 	}
 }
 
@@ -409,57 +416,14 @@ static void cpm_uart_set_termios(struct uart_port *port,
 {
 	int baud;
 	unsigned long flags;
-	u16 cval, scval;
+	u16 cval, scval, prev_mode;
 	int bits, sbits;
 	struct uart_cpm_port *pinfo = (struct uart_cpm_port *)port;
-	int line = pinfo - cpm_uart_ports;
-	volatile cbd_t *bdp;
+	volatile smc_t *smcp = pinfo->smcp;
+	volatile scc_t *sccp = pinfo->sccp;
 
 	pr_debug("CPM uart[%d]:set_termios\n", port->line);
 
-	spin_lock_irqsave(&port->lock, flags);
-	/* disable uart interrupts */
-	if (IS_SMC(pinfo))
-		pinfo->smcp->smc_smcm &= ~(SMCM_RX | SMCM_TX);
-	else
-		pinfo->sccp->scc_sccm &= ~(UART_SCCM_TX | UART_SCCM_RX);
-	pinfo->flags |= FLAG_DISCARDING;
-	spin_unlock_irqrestore(&port->lock, flags);
-
-	/* if previous configuration exists wait for tx to finish */
-	if (pinfo->baud != 0 && pinfo->bits != 0) {
-
-		/* point to the last txed bd */
-		bdp = pinfo->tx_cur;
-		if (bdp == pinfo->tx_bd_base)
-			bdp = pinfo->tx_bd_base + (pinfo->tx_nrfifos - 1);
-		else
-			bdp--;
-
-		/* wait for it to be transmitted */
-		while ((bdp->cbd_sc & BD_SC_READY) != 0)
-			schedule();
-
-		/* and delay for the hw fifo to drain */
-		udelay((3 * 1000000 * pinfo->bits) / pinfo->baud);
-	}
-
-	spin_lock_irqsave(&port->lock, flags);
-
-	/* Send the CPM an initialize command. */
-	cpm_line_cr_cmd(line, CPM_CR_STOP_TX);
-
-	/* Stop uart */
-	if (IS_SMC(pinfo))
-		pinfo->smcp->smc_smcmr &= ~(SMCMR_REN | SMCMR_TEN);
-	else
-		pinfo->sccp->scc_gsmrl &= ~(SCC_GSMRL_ENR | SCC_GSMRL_ENT);
-
-	/* Send the CPM an initialize command. */
-	cpm_line_cr_cmd(line, CPM_CR_INIT_TRX);
-
-	spin_unlock_irqrestore(&port->lock, flags);
-
 	baud = uart_get_baud_rate(port, termios, old, 0, port->uartclk / 16);
 
 	/* Character length programmed into the mode register is the
@@ -541,24 +505,24 @@ static void cpm_uart_set_termios(struct uart_port *port,
 	
 	spin_lock_irqsave(&port->lock, flags);
 
-	cpm_set_brg(pinfo->brg - 1, baud);
-
 	/* Start bit has not been added (so don't, because we would just
 	 * subtract it later), and we need to add one for the number of
 	 * stops bits (there is always at least one).
 	 */
 	bits++;
+	if (IS_SMC(pinfo)) {
+		/* Set the mode register.  We want to keep a copy of the
+		 * enables, because we want to put them back if they were
+		 * present.
+		 */
+		prev_mode = smcp->smc_smcmr;
+		smcp->smc_smcmr = smcr_mk_clen(bits) | cval | SMCMR_SM_UART;
+		smcp->smc_smcmr |= (prev_mode & (SMCMR_REN | SMCMR_TEN));
+	} else {
+		sccp->scc_psmr = (sbits << 12) | scval;
+	}
 
-	/* re-init */
-	if (IS_SMC(pinfo))
-		cpm_uart_init_smc(pinfo, bits, cval);
-	else
-		cpm_uart_init_scc(pinfo, sbits, scval);
-
-	pinfo->baud = baud;
-	pinfo->bits = bits;
-
-	pinfo->flags &= ~FLAG_DISCARDING;
+	cpm_set_brg(pinfo->brg - 1, baud);
 	spin_unlock_irqrestore(&port->lock, flags);
 
 }
@@ -661,44 +625,58 @@ static int cpm_uart_tx_pump(struct uart_port *port)
 	return 1;
 }
 
-static void cpm_uart_init_scc(struct uart_cpm_port *pinfo, int bits, u16 scval)
+/*
+ * init buffer descriptors
+ */
+static void cpm_uart_initbd(struct uart_cpm_port *pinfo)
 {
-	int line = pinfo - cpm_uart_ports;
-	volatile scc_t *scp;
-	volatile scc_uart_t *sup;
+	int i;
 	u8 *mem_addr;
 	volatile cbd_t *bdp;
-	int i;
 
-	pr_debug("CPM uart[%d]:init_scc\n", pinfo->port.line);
-
-	scp = pinfo->sccp;
-	sup = pinfo->sccup;
+	pr_debug("CPM uart[%d]:initbd\n", pinfo->port.line);
 
 	/* Set the physical address of the host memory
 	 * buffers in the buffer descriptors, and the
 	 * virtual address for us to work with.
 	 */
-	pinfo->rx_cur = pinfo->rx_bd_base;
 	mem_addr = pinfo->mem_addr;
-	for (bdp = pinfo->rx_bd_base, i = 0; i < pinfo->rx_nrfifos; i++, bdp++) {
+	bdp = pinfo->rx_cur = pinfo->rx_bd_base;
+	for (i = 0; i < (pinfo->rx_nrfifos - 1); i++, bdp++) {
 		bdp->cbd_bufaddr = virt_to_bus(mem_addr);
-		bdp->cbd_sc = BD_SC_EMPTY | BD_SC_INTRPT | (i < (pinfo->rx_nrfifos - 1) ? 0 : BD_SC_WRAP);
+		bdp->cbd_sc = BD_SC_EMPTY | BD_SC_INTRPT;
 		mem_addr += pinfo->rx_fifosize;
 	}
+	
+	bdp->cbd_bufaddr = virt_to_bus(mem_addr);
+	bdp->cbd_sc = BD_SC_WRAP | BD_SC_EMPTY | BD_SC_INTRPT;
 
 	/* Set the physical address of the host memory
 	 * buffers in the buffer descriptors, and the
 	 * virtual address for us to work with.
 	 */
 	mem_addr = pinfo->mem_addr + L1_CACHE_ALIGN(pinfo->rx_nrfifos * pinfo->rx_fifosize);
-	pinfo->tx_cur = pinfo->tx_bd_base;
-	for (bdp = pinfo->tx_bd_base, i = 0; i < pinfo->tx_nrfifos; i++, bdp++) {
+	bdp = pinfo->tx_cur = pinfo->tx_bd_base;
+	for (i = 0; i < (pinfo->tx_nrfifos - 1); i++, bdp++) {
 		bdp->cbd_bufaddr = virt_to_bus(mem_addr);
-		bdp->cbd_sc = BD_SC_INTRPT | (i < (pinfo->tx_nrfifos - 1) ? 0 : BD_SC_WRAP);
+		bdp->cbd_sc = BD_SC_INTRPT;
 		mem_addr += pinfo->tx_fifosize;
-		bdp++;
 	}
+	
+	bdp->cbd_bufaddr = virt_to_bus(mem_addr);
+	bdp->cbd_sc = BD_SC_WRAP | BD_SC_INTRPT;
+}
+
+static void cpm_uart_init_scc(struct uart_cpm_port *pinfo)
+{
+	int line = pinfo - cpm_uart_ports;
+	volatile scc_t *scp;
+	volatile scc_uart_t *sup;
+
+	pr_debug("CPM uart[%d]:init_scc\n", pinfo->port.line);
+
+	scp = pinfo->sccp;
+	sup = pinfo->sccup;
 
 	/* Store address */
 	pinfo->sccup->scc_genscc.scc_rbase = (unsigned char *)pinfo->rx_bd_base - DPRAM_BASE;
@@ -742,52 +720,25 @@ static void cpm_uart_init_scc(struct uart_cpm_port *pinfo, int bits, u16 scval)
 	    (SCC_GSMRL_MODE_UART | SCC_GSMRL_TDCR_16 | SCC_GSMRL_RDCR_16);
 
 	/* Enable rx interrupts  and clear all pending events.  */
-	scp->scc_sccm = UART_SCCM_RX;
+	scp->scc_sccm = 0;
 	scp->scc_scce = 0xffff;
 	scp->scc_dsr = 0x7e7e;
-	scp->scc_psmr = (bits << 12) | scval;
+	scp->scc_psmr = 0x3000;
 
 	scp->scc_gsmrl |= (SCC_GSMRL_ENR | SCC_GSMRL_ENT);
 }
 
-static void cpm_uart_init_smc(struct uart_cpm_port *pinfo, int bits, u16 cval)
+static void cpm_uart_init_smc(struct uart_cpm_port *pinfo)
 {
 	int line = pinfo - cpm_uart_ports;
 	volatile smc_t *sp;
 	volatile smc_uart_t *up;
-	volatile u8 *mem_addr;
-	volatile cbd_t *bdp;
-	int i;
 
 	pr_debug("CPM uart[%d]:init_smc\n", pinfo->port.line);
 
 	sp = pinfo->smcp;
 	up = pinfo->smcup;
 
-	/* Set the physical address of the host memory
-	 * buffers in the buffer descriptors, and the
-	 * virtual address for us to work with.
-	 */
-	mem_addr = pinfo->mem_addr;
-	pinfo->rx_cur = pinfo->rx_bd_base;
-	for (bdp = pinfo->rx_bd_base, i = 0; i < pinfo->rx_nrfifos; i++, bdp++) {
-		bdp->cbd_bufaddr = virt_to_bus(mem_addr);
-		bdp->cbd_sc = BD_SC_EMPTY | BD_SC_INTRPT | (i < (pinfo->rx_nrfifos - 1) ? 0 : BD_SC_WRAP);
-		mem_addr += pinfo->rx_fifosize;
-	}
-
-	/* Set the physical address of the host memory
-	 * buffers in the buffer descriptors, and the
-	 * virtual address for us to work with.
-	 */
-	mem_addr = pinfo->mem_addr + L1_CACHE_ALIGN(pinfo->rx_nrfifos * pinfo->rx_fifosize);
-	pinfo->tx_cur = pinfo->tx_bd_base;
-	for (bdp = pinfo->tx_bd_base, i = 0; i < pinfo->tx_nrfifos; i++, bdp++) {
-		bdp->cbd_bufaddr = virt_to_bus(mem_addr);
-		bdp->cbd_sc = BD_SC_INTRPT | (i < (pinfo->tx_nrfifos - 1) ? 0 : BD_SC_WRAP);
-		mem_addr += pinfo->tx_fifosize;
-	}
-
 	/* Store address */
 	pinfo->smcup->smc_rbase = (u_char *)pinfo->rx_bd_base - DPRAM_BASE;
 	pinfo->smcup->smc_tbase = (u_char *)pinfo->tx_bd_base - DPRAM_BASE;
@@ -804,11 +755,13 @@ static void cpm_uart_init_smc(struct uart_cpm_port *pinfo, int bits, u16 cval)
 
 	cpm_line_cr_cmd(line, CPM_CR_INIT_TRX);
 
-	/* Set UART mode, according to the parameters */
-	sp->smc_smcmr = smcr_mk_clen(bits) | cval | SMCMR_SM_UART;
+	/* Set UART mode, 8 bit, no parity, one stop.
+	 * Enable receive and transmit.
+	 */
+	sp->smc_smcmr = smcr_mk_clen(9) | SMCMR_SM_UART;
 
 	/* Enable only rx interrupts clear all pending events. */
-	sp->smc_smcm = SMCM_RX;
+	sp->smc_smcm = 0;
 	sp->smc_smce = 0xff;
 
 	sp->smc_smcmr |= (SMCMR_REN | SMCMR_TEN);
@@ -836,10 +789,21 @@ static int cpm_uart_request_port(struct uart_port *port)
 	if (pinfo->set_lineif)
 		pinfo->set_lineif(pinfo);
 
+	if (IS_SMC(pinfo)) {
+		pinfo->smcp->smc_smcm &= ~(SMCM_RX | SMCM_TX);
+		pinfo->smcp->smc_smcmr &= ~(SMCMR_REN | SMCMR_TEN);
+	} else {
+		pinfo->sccp->scc_sccm &= ~(UART_SCCM_TX | UART_SCCM_RX);
+		pinfo->sccp->scc_gsmrl &= ~(SCC_GSMRL_ENR | SCC_GSMRL_ENT);
+	}
+
 	ret = cpm_uart_allocbuf(pinfo, 0);
+
 	if (ret)
 		return ret;
 
+	cpm_uart_initbd(pinfo);
+
 	return 0;
 }
 
@@ -975,9 +939,6 @@ static void cpm_uart_console_write(struct console *co, const char *s,
 	volatile cbd_t *bdp, *bdbase;
 	volatile unsigned char *cp;
 
-	if (IS_DISCARDING(pinfo))
-		return;
-
 	/* Get the address of the host memory buffer.
 	 */
 	bdp = pinfo->tx_cur;
@@ -1085,10 +1046,26 @@ static int __init cpm_uart_console_setup(struct console *co, char *options)
 	if (pinfo->set_lineif)
 		pinfo->set_lineif(pinfo);
 
+	if (IS_SMC(pinfo)) {
+		pinfo->smcp->smc_smcm &= ~(SMCM_RX | SMCM_TX);
+		pinfo->smcp->smc_smcmr &= ~(SMCMR_REN | SMCMR_TEN);
+	} else {
+		pinfo->sccp->scc_sccm &= ~(UART_SCCM_TX | UART_SCCM_RX);
+		pinfo->sccp->scc_gsmrl &= ~(SCC_GSMRL_ENR | SCC_GSMRL_ENT);
+	}
+
 	ret = cpm_uart_allocbuf(pinfo, 1);
+
 	if (ret)
 		return ret;
 
+	cpm_uart_initbd(pinfo);
+
+	if (IS_SMC(pinfo))
+		cpm_uart_init_smc(pinfo);
+	else
+		cpm_uart_init_scc(pinfo);
+
 	uart_set_options(port, co, baud, parity, bits, flow);
 
 	return 0;
diff --git a/drivers/serial/cpm_uart/cpm_uart_cpm1.c b/drivers/serial/cpm_uart/cpm_uart_cpm1.c
index 7c940b5b5..a9ab04731 100644
--- a/drivers/serial/cpm_uart/cpm_uart_cpm1.c
+++ b/drivers/serial/cpm_uart/cpm_uart_cpm1.c
@@ -130,20 +130,20 @@ int cpm_uart_allocbuf(struct uart_cpm_port *pinfo, unsigned int is_con)
 {
 	int dpmemsz, memsz;
 	u8 *dp_mem;
-	uint dp_addr;
+	uint dp_offset;
 	u8 *mem_addr;
-	dma_addr_t dma_addr;
+	dma_addr_t dma_addr = 0;
 
 	pr_debug("CPM uart[%d]:allocbuf\n", pinfo->port.line);
 
 	dpmemsz = sizeof(cbd_t) * (pinfo->rx_nrfifos + pinfo->tx_nrfifos);
-	dp_mem = m8xx_cpm_dpalloc(dpmemsz);
-	if (dp_mem == NULL) {
+	dp_offset = cpm_dpalloc(dpmemsz, 8);
+	if (IS_DPERR(dp_offset)) {
 		printk(KERN_ERR
 		       "cpm_uart_cpm1.c: could not allocate buffer descriptors\n");
 		return -ENOMEM;
 	}
-	dp_addr = m8xx_cpm_dpram_offset(dp_mem);
+	dp_mem = cpm_dpram_addr(dp_offset);
 
 	memsz = L1_CACHE_ALIGN(pinfo->rx_nrfifos * pinfo->rx_fifosize) +
 	    L1_CACHE_ALIGN(pinfo->tx_nrfifos * pinfo->tx_fifosize);
@@ -155,13 +155,13 @@ int cpm_uart_allocbuf(struct uart_cpm_port *pinfo, unsigned int is_con)
 					      GFP_KERNEL);
 
 	if (mem_addr == NULL) {
-		m8xx_cpm_dpfree(dp_mem);
+		cpm_dpfree(dp_offset);
 		printk(KERN_ERR
 		       "cpm_uart_cpm1.c: could not allocate coherent memory\n");
 		return -ENOMEM;
 	}
 
-	pinfo->dp_addr = dp_addr;
+	pinfo->dp_addr = dp_offset;
 	pinfo->mem_addr = mem_addr;
 	pinfo->dma_addr = dma_addr;
 
@@ -183,7 +183,7 @@ void cpm_uart_freebuf(struct uart_cpm_port *pinfo)
 					 pinfo->tx_fifosize), pinfo->mem_addr,
 			  pinfo->dma_addr);
 
-	m8xx_cpm_dpfree(m8xx_cpm_dpram_addr(pinfo->dp_addr));
+	cpm_dpfree(pinfo->dp_addr);
 }
 
 /* Setup any dynamic params in the uart desc */
diff --git a/drivers/serial/cpm_uart/cpm_uart_cpm1.h b/drivers/serial/cpm_uart/cpm_uart_cpm1.h
index 155050b7c..5d867ab58 100644
--- a/drivers/serial/cpm_uart/cpm_uart_cpm1.h
+++ b/drivers/serial/cpm_uart/cpm_uart_cpm1.h
@@ -25,7 +25,7 @@
 
 static inline void cpm_set_brg(int brg, int baud)
 {
-	m8xx_cpm_setbrg(brg, baud);
+	cpm_setbrg(brg, baud);
 }
 
 static inline void cpm_set_scc_fcr(volatile scc_uart_t * sup)
diff --git a/drivers/serial/cpm_uart/cpm_uart_cpm2.c b/drivers/serial/cpm_uart/cpm_uart_cpm2.c
index d2566889d..0c12f28e0 100644
--- a/drivers/serial/cpm_uart/cpm_uart_cpm2.c
+++ b/drivers/serial/cpm_uart/cpm_uart_cpm2.c
@@ -182,21 +182,21 @@ int cpm_uart_allocbuf(struct uart_cpm_port *pinfo, unsigned int is_con)
 {
 	int dpmemsz, memsz;
 	u8 *dp_mem;
-	uint dp_addr;
+	uint dp_offset;
 	u8 *mem_addr;
 	dma_addr_t dma_addr = 0;
 
 	pr_debug("CPM uart[%d]:allocbuf\n", pinfo->port.line);
 
 	dpmemsz = sizeof(cbd_t) * (pinfo->rx_nrfifos + pinfo->tx_nrfifos);
-	dp_mem = cpm2_dpalloc(dpmemsz, 8);
-	if (dp_mem == NULL) {
+	dp_offset = cpm_dpalloc(dpmemsz, 8);
+	if (IS_DPERR(dp_offset)) {
 		printk(KERN_ERR
-		       "cpm_uart_cpm1.c: could not allocate buffer descriptors\n");
+		       "cpm_uart_cpm.c: could not allocate buffer descriptors\n");
 		return -ENOMEM;
 	}
 
-	dp_addr = cpm2_dpram_offset(dp_mem);
+	dp_mem = cpm_dpram_addr(dp_offset);
 
 	memsz = L1_CACHE_ALIGN(pinfo->rx_nrfifos * pinfo->rx_fifosize) +
 	    L1_CACHE_ALIGN(pinfo->tx_nrfifos * pinfo->tx_fifosize);
@@ -207,13 +207,13 @@ int cpm_uart_allocbuf(struct uart_cpm_port *pinfo, unsigned int is_con)
 					      GFP_KERNEL);
 
 	if (mem_addr == NULL) {
-		cpm2_dpfree(dp_mem);
+		cpm_dpfree(dp_offset);
 		printk(KERN_ERR
-		       "cpm_uart_cpm1.c: could not allocate coherent memory\n");
+		       "cpm_uart_cpm.c: could not allocate coherent memory\n");
 		return -ENOMEM;
 	}
 
-	pinfo->dp_addr = dp_addr;
+	pinfo->dp_addr = dp_offset;
 	pinfo->mem_addr = mem_addr;
 	pinfo->dma_addr = dma_addr;
 
@@ -235,7 +235,7 @@ void cpm_uart_freebuf(struct uart_cpm_port *pinfo)
 					 pinfo->tx_fifosize), pinfo->mem_addr,
 			  pinfo->dma_addr);
 
-	cpm2_dpfree(&pinfo->dp_addr);
+	cpm_dpfree(pinfo->dp_addr);
 }
 
 /* Setup any dynamic params in the uart desc */
diff --git a/drivers/serial/cpm_uart/cpm_uart_cpm2.h b/drivers/serial/cpm_uart/cpm_uart_cpm2.h
index eb620bd98..4793fecf8 100644
--- a/drivers/serial/cpm_uart/cpm_uart_cpm2.h
+++ b/drivers/serial/cpm_uart/cpm_uart_cpm2.h
@@ -25,7 +25,7 @@
 
 static inline void cpm_set_brg(int brg, int baud)
 {
-	cpm2_setbrg(brg, baud);
+	cpm_setbrg(brg, baud);
 }
 
 static inline void cpm_set_scc_fcr(volatile scc_uart_t * sup)
diff --git a/drivers/serial/pmac_zilog.c b/drivers/serial/pmac_zilog.c
index d452d4b40..72586594b 100644
--- a/drivers/serial/pmac_zilog.c
+++ b/drivers/serial/pmac_zilog.c
@@ -245,7 +245,7 @@ static struct tty_struct *pmz_receive_chars(struct uart_pmac_port *uap,
 			if (tty->flip.count >= TTY_FLIPBUF_SIZE)
 				drop = 1;
 			if (ZS_IS_ASLEEP(uap))
-				return 0;
+				return NULL;
 			if (!ZS_IS_OPEN(uap))
 				goto retry;
 		}
@@ -1433,6 +1433,7 @@ static int __init pmz_init_port(struct uart_pmac_port *uap)
 			ioremap(np->addrs[np->n_addrs - 1].address, 0x1000);
 		if (uap->rx_dma_regs == NULL) {	
 			iounmap((void *)uap->tx_dma_regs);
+			uap->tx_dma_regs = NULL;
 			uap->flags &= ~PMACZILOG_FLAG_HAS_DMA;
 			goto no_dma;
 		}
@@ -1507,10 +1508,13 @@ static void pmz_dispose_port(struct uart_pmac_port *uap)
 {
 	struct device_node *np;
 
-	iounmap((void *)uap->control_reg);
 	np = uap->node;
+	iounmap((void *)uap->rx_dma_regs);
+	iounmap((void *)uap->tx_dma_regs);
+	iounmap((void *)uap->control_reg);
 	uap->node = NULL;
 	of_node_put(np);
+	memset(uap, 0, sizeof(struct uart_pmac_port));
 }
 
 /*
@@ -1797,7 +1801,7 @@ static int __init pmz_register(void)
 	 * Register this driver with the serial core
 	 */
 	rc = uart_register_driver(&pmz_uart_reg);
-	if (rc != 0)
+	if (rc)
 		return rc;
 
 	/*
@@ -1807,10 +1811,19 @@ static int __init pmz_register(void)
 		struct uart_pmac_port *uport = &pmz_ports[i];
 		/* NULL node may happen on wallstreet */
 		if (uport->node != NULL)
-			uart_add_one_port(&pmz_uart_reg, &uport->port);
+			rc = uart_add_one_port(&pmz_uart_reg, &uport->port);
+		if (rc)
+			goto err_out;
 	}
 
 	return 0;
+err_out:
+	while (i-- > 0) {
+		struct uart_pmac_port *uport = &pmz_ports[i];
+		uart_remove_one_port(&pmz_uart_reg, &uport->port);
+	}
+	uart_unregister_driver(&pmz_uart_reg);
+	return rc;
 }
 
 static struct of_match pmz_match[] = 
@@ -1840,6 +1853,7 @@ static struct macio_driver pmz_driver =
 
 static int __init init_pmz(void)
 {
+	int rc, i;
 	printk(KERN_INFO "%s\n", version);
 
 	/* 
@@ -1861,7 +1875,16 @@ static int __init init_pmz(void)
 	/*
 	 * Now we register with the serial layer
 	 */
-	pmz_register();
+	rc = pmz_register();
+	if (rc) {
+		printk(KERN_ERR 
+			"pmac_zilog: Error registering serial device, disabling pmac_zilog.\n"
+		 	"pmac_zilog: Did another serial driver already claim the minors?\n"); 
+		/* effectively "pmz_unprobe()" */
+		for (i=0; i < pmz_ports_count; i++)
+			pmz_dispose_port(&pmz_ports[i]);
+		return rc;
+	}
 	
 	/*
 	 * Then we register the macio driver itself
@@ -1985,8 +2008,6 @@ static int __init pmz_console_init(void)
 	/* Probe ports */
 	pmz_probe();
 
-#ifdef CONFIG_SERIAL_PMACZILOG_CONSOLE
-#endif
 	/* TODO: Autoprobe console based on OF */
 	/* pmz_console.index = i; */
 	register_console(&pmz_console);
diff --git a/drivers/serial/pxa.c b/drivers/serial/pxa.c
index 082e1b552..cb6b4f3ec 100644
--- a/drivers/serial/pxa.c
+++ b/drivers/serial/pxa.c
@@ -35,6 +35,7 @@
 #include <linux/circ_buf.h>
 #include <linux/delay.h>
 #include <linux/interrupt.h>
+#include <linux/device.h>
 
 #include <asm/io.h>
 #include <asm/hardware.h>
@@ -571,14 +572,9 @@ serial_pxa_pm(struct uart_port *port, unsigned int state,
 	      unsigned int oldstate)
 {
 	struct uart_pxa_port *up = (struct uart_pxa_port *)port;
-	if (state) {
-		/* sleep */
-		CKEN &= ~up->cken;
-	} else {
-		/* wake */
-		CKEN |= up->cken;
+	pxa_set_cken(up->cken, !state);
+	if (!state)
 		udelay(1);
-	}
 }
 
 static void serial_pxa_release_port(struct uart_port *port)
@@ -809,26 +805,76 @@ static struct uart_driver serial_pxa_reg = {
 	.cons		= PXA_CONSOLE,
 };
 
-static int __init serial_pxa_init(void)
+static int serial_pxa_suspend(struct device *_dev, u32 state, u32 level)
 {
-	int i, ret;
+        struct uart_pxa_port *sport = dev_get_drvdata(_dev);
 
-	ret = uart_register_driver(&serial_pxa_reg);
-	if (ret)
-		return ret;
+        if (sport && level == SUSPEND_DISABLE)
+                uart_suspend_port(&serial_pxa_reg, &sport->port);
+
+        return 0;
+}
+
+static int serial_pxa_resume(struct device *_dev, u32 level)
+{
+        struct uart_pxa_port *sport = dev_get_drvdata(_dev);
 
-	for (i = 0; i < ARRAY_SIZE(serial_pxa_ports); i++)
-		uart_add_one_port(&serial_pxa_reg, &serial_pxa_ports[i].port);
+        if (sport && level == RESUME_ENABLE)
+                uart_resume_port(&serial_pxa_reg, &sport->port);
 
+        return 0;
+}
+
+static int serial_pxa_probe(struct device *_dev)
+{
+	struct platform_device *dev = to_platform_device(_dev);
+
+	serial_pxa_ports[dev->id].port.dev = _dev;
+	uart_add_one_port(&serial_pxa_reg, &serial_pxa_ports[dev->id].port);
+	dev_set_drvdata(_dev, &serial_pxa_ports[dev->id]);
 	return 0;
 }
 
-static void __exit serial_pxa_exit(void)
+static int serial_pxa_remove(struct device *_dev)
 {
-	int i;
+	struct uart_pxa_port *sport = dev_get_drvdata(_dev);
+
+	dev_set_drvdata(_dev, NULL);
+
+	if (sport)
+		uart_remove_one_port(&serial_pxa_reg, &sport->port);
+
+	return 0;
+}
+
+static struct device_driver serial_pxa_driver = {
+        .name           = "pxa2xx-uart",
+        .bus            = &platform_bus_type,
+        .probe          = serial_pxa_probe,
+        .remove         = serial_pxa_remove,
+
+	.suspend	= serial_pxa_suspend,
+	.resume		= serial_pxa_resume,
+};
+
+int __init serial_pxa_init(void)
+{
+	int ret;
 
-	for (i = 0; i < ARRAY_SIZE(serial_pxa_ports); i++)
-		uart_remove_one_port(&serial_pxa_reg, &serial_pxa_ports[i].port);
+	ret = uart_register_driver(&serial_pxa_reg);
+	if (ret != 0)
+		return ret;
+
+	ret = driver_register(&serial_pxa_driver);
+	if (ret != 0)
+		uart_unregister_driver(&serial_pxa_reg);
+
+	return ret;
+}
+
+void __exit serial_pxa_exit(void)
+{
+        driver_unregister(&serial_pxa_driver);
 	uart_unregister_driver(&serial_pxa_reg);
 }
 
diff --git a/drivers/serial/serial_core.c b/drivers/serial/serial_core.c
index 774ad38b8..24ef1cbf5 100644
--- a/drivers/serial/serial_core.c
+++ b/drivers/serial/serial_core.c
@@ -1923,7 +1923,7 @@ int uart_suspend_port(struct uart_driver *drv, struct uart_port *port)
 	 * Disable the console device before suspending.
 	 */
 	if (uart_console(port))
-		port->cons->flags &= ~CON_ENABLED;
+		console_stop(port->cons);
 
 	uart_change_pm(state, 3);
 
@@ -1945,7 +1945,7 @@ int uart_resume_port(struct uart_driver *drv, struct uart_port *port)
 	 */
 	if (uart_console(port)) {
 		uart_change_speed(state, NULL);
-		port->cons->flags |= CON_ENABLED;
+		console_start(port->cons);
 	}
 
 	if (state->info && state->info->flags & UIF_INITIALIZED) {
diff --git a/drivers/serial/sh-sci.c b/drivers/serial/sh-sci.c
index f5f3e08bf..a6639f467 100644
--- a/drivers/serial/sh-sci.c
+++ b/drivers/serial/sh-sci.c
@@ -90,12 +90,12 @@ static struct uart_driver sci_uart_driver;
 
 #if defined(CONFIG_SH_STANDARD_BIOS) || defined(CONFIG_SH_KGDB)
 
-static void handle_error(struct sci_port *port)
+static void handle_error(struct uart_port *port)
 {				/* Clear error flags */
 	sci_out(port, SCxSR, SCxSR_ERROR_CLEAR(port));
 }
 
-static int get_char(struct sci_port *port)
+static int get_char(struct uart_port *port)
 {
 	unsigned long flags;
 	unsigned short status;
@@ -332,11 +332,11 @@ static void sci_init_pins_sci(struct uart_port *port, unsigned int cflag)
 
 #if defined(SCIF_ONLY) || defined(SCI_AND_SCIF)
 #if defined(CONFIG_CPU_SH3)
-/* For SH7707, SH7709, SH7709A, SH7729 */
+/* For SH7707, SH7709, SH7709A, SH7729, SH7300*/
 static void sci_init_pins_scif(struct uart_port *port, unsigned int cflag)
 {
 	unsigned int fcr_val = 0;
-
+#if !defined(CONFIG_CPU_SUBTYPE_SH7300) /* SH7300 doesn't use RTS/CTS */
 	{
 		unsigned short data;
 
@@ -360,6 +360,7 @@ static void sci_init_pins_scif(struct uart_port *port, unsigned int cflag)
 		/* Set /RTS2 (bit6) = 0 */
 		ctrl_outb(data&0xbf, SCPDR);
 	}
+#endif
 	sci_out(port, SCFCR, fcr_val);
 }
 
@@ -420,7 +421,7 @@ static void sci_transmit_chars(struct uart_port *port)
 
 #if !defined(SCI_ONLY)
 	if (port->type == PORT_SCIF) {
-		txroom = 16 - (sci_in(port, SCFDR)>>8);
+		txroom = SCIF_TXROOM_MAX - (sci_in(port, SCFDR)>>8);
 	} else {
 		txroom = (sci_in(port, SCxSR) & SCI_TDRE)?1:0;
 	}
@@ -488,7 +489,7 @@ static inline void sci_receive_chars(struct uart_port *port,
 	while (1) {
 #if !defined(SCI_ONLY)
 		if (port->type == PORT_SCIF) {
-			count = sci_in(port, SCFDR)&0x001f;
+			count = sci_in(port, SCFDR)&SCIF_RFDC_MASK ;
 		} else {
 			count = (sci_in(port, SCxSR)&SCxSR_RDxF(port))?1:0;
 		}
@@ -671,8 +672,7 @@ static inline int sci_handle_breaks(struct uart_port *port)
 		pr_debug("sci: BREAK detected\n");
 	}
 
-#if defined(CONFIG_CPU_SUBTYPE_SH7750) || defined(CONFIG_CPU_SUBTYPE_ST40STB1) || \
-    defined(CONFIG_CPU_SUBTYPE_SH7760)
+#if defined(SCIF_ORER)
 	/* XXX: Handle SCIF overrun error */
 	if (port->type == PORT_SCIF && (sci_in(port, SCLSR) & SCIF_ORER) != 0) {
 		sci_out(port, SCLSR, 0);
@@ -726,6 +726,19 @@ static irqreturn_t sci_er_interrupt(int irq, void *ptr, struct pt_regs *regs)
 			sci_out(port, SCxSR, SCxSR_RDxF_CLEAR(port));
 		}
 	} else {
+#if defined(SCIF_ORER)
+		if((sci_in(port, SCLSR) & SCIF_ORER) != 0) {
+			struct tty_struct *tty = port->info->tty;
+
+			sci_out(port, SCLSR, 0);
+			if(tty->flip.count<TTY_FLIPBUF_SIZE) {
+				*tty->flip.flag_buf_ptr++ = TTY_OVERRUN;
+				tty->flip.count++;
+				tty_flip_buffer_push(tty);
+				pr_debug("scif: overrun error\n");
+			}
+		}
+#endif
 		sci_rx_interrupt(irq, ptr, regs);
 	}
 
@@ -748,6 +761,30 @@ static irqreturn_t sci_br_interrupt(int irq, void *ptr, struct pt_regs *regs)
 	return IRQ_HANDLED;
 }
 
+static irqreturn_t sci_mpxed_interrupt(int irq, void *ptr, struct pt_regs *regs)
+{
+        unsigned short ssr_status, scr_status;
+        struct uart_port *port = ptr;
+
+        ssr_status = sci_in(port,SCxSR);
+        scr_status = sci_in(port,SCSCR);
+
+	/* Tx Interrupt */
+        if ((ssr_status&0x0020) && (scr_status&0x0080))
+                sci_tx_interrupt(irq, ptr, regs);
+	/* Rx Interrupt */
+        if ((ssr_status&0x0002) && (scr_status&0x0040))
+                sci_rx_interrupt(irq, ptr, regs);
+	/* Error Interrupt */
+        if ((ssr_status&0x0080) && (scr_status&0x0400))
+                sci_er_interrupt(irq, ptr, regs);
+	/* Break Interrupt */
+        if ((ssr_status&0x0010) && (scr_status&0x0200))
+                sci_br_interrupt(irq, ptr, regs);
+
+	return IRQ_HANDLED;
+}
+
 #ifdef CONFIG_CPU_FREQ
 /*
  * Here we define a transistion notifier so that we can update all of our
@@ -797,14 +834,26 @@ static int sci_request_irq(struct sci_port *port)
 	const char *desc[] = { "SCI Receive Error", "SCI Receive Data Full",
 			       "SCI Transmit Data Empty", "SCI Break" };
 
-	for (i = 0; i < ARRAY_SIZE(handlers); i++) {
-		if (!port->irqs[i])
-			continue;
-		if (request_irq(port->irqs[i], handlers[i], SA_INTERRUPT,
-				desc[i], port)) {
+	if (port->irqs[0] == port->irqs[1]) {
+		if (!port->irqs[0]) {
+			printk(KERN_ERR "sci: Cannot allocate irq.(IRQ=0)\n");
+			return -ENODEV;
+		}
+		if (request_irq(port->irqs[0], sci_mpxed_interrupt, SA_INTERRUPT,
+				"sci", port)) {
 			printk(KERN_ERR "sci: Cannot allocate irq.\n");
 			return -ENODEV;
 		}
+	} else {
+		for (i = 0; i < ARRAY_SIZE(handlers); i++) {
+			if (!port->irqs[i])
+				continue;
+			if (request_irq(port->irqs[i], handlers[i], SA_INTERRUPT,
+					desc[i], port)) {
+				printk(KERN_ERR "sci: Cannot allocate irq.\n");
+				return -ENODEV;
+			}
+		}
 	}
 
 	return 0;
@@ -814,11 +863,18 @@ static void sci_free_irq(struct sci_port *port)
 {
 	int i;
 
-	for (i = 0; i < ARRAY_SIZE(port->irqs); i++) {
-		if (!port->irqs[i])
-			continue;
-
-		free_irq(port->irqs[i], port);
+        if (port->irqs[0] == port->irqs[1]) {
+                if (!port->irqs[0])
+                        printk("sci: sci_free_irq error\n");
+		else
+                        free_irq(port->irqs[0], port);
+        } else {
+		for (i = 0; i < ARRAY_SIZE(port->irqs); i++) {
+			if (!port->irqs[i])
+				continue;
+
+			free_irq(port->irqs[i], port);
+		}
 	}
 }
 
@@ -873,7 +929,7 @@ static void sci_start_rx(struct uart_port *port, unsigned int tty_start)
 	/* Set RIE (Receive Interrupt Enable) bit in SCSCR */
 	local_irq_save(flags);
 	ctrl = sci_in(port, SCSCR);
-	ctrl |= SCI_CTRL_FLAGS_RIE;
+	ctrl |= SCI_CTRL_FLAGS_RIE | SCI_CTRL_FLAGS_REIE;
 	sci_out(port, SCSCR, ctrl);
 	local_irq_restore(flags);
 }
@@ -886,7 +942,7 @@ static void sci_stop_rx(struct uart_port *port)
 	/* Clear RIE (Receive Interrupt Enable) bit in SCSCR */
 	local_irq_save(flags);
 	ctrl = sci_in(port, SCSCR);
-	ctrl &= ~SCI_CTRL_FLAGS_RIE;
+	ctrl &= ~(SCI_CTRL_FLAGS_RIE | SCI_CTRL_FLAGS_REIE);
 	sci_out(port, SCSCR, ctrl);
 	local_irq_restore(flags);
 }
@@ -976,7 +1032,7 @@ static void sci_set_termios(struct uart_port *port, struct termios *termios,
 		case 38400:	t = BPS_38400;	break;
 		case 57600:	t = BPS_57600;	break;
 		case 115200:	t = BPS_115200;	break;
-		default:	t = BPS_115200; break;
+		default:	t = SCBRR_VALUE(baud); break;
 	}
 
 	if (t > 0) {
@@ -1026,6 +1082,13 @@ static void sci_config_port(struct uart_port *port, int flags)
 	struct sci_port *s = &sci_ports[port->line];
 
 	port->type = s->type;
+
+#if defined(CONFIG_CPU_SUBTYPE_SH5_101) || defined(CONFIG_CPU_SUBTYPE_SH5_103)
+	if (port->mapbase == 0)
+		port->mapbase = onchip_remap(SCIF_ADDR_SH5, 1024, "SCIF");
+
+	port->membase = (void *)port->mapbase;
+#endif
 }
 
 static int sci_verify_port(struct uart_port *port, struct serial_struct *ser)
@@ -1119,6 +1182,36 @@ static struct sci_port sci_ports[SCI_NPORTS] = {
 		.irqs		= SH3_IRDA_IRQS,
 		.init_pins	= sci_init_pins_irda,
 	}
+#elif defined(CONFIG_CPU_SUBTYPE_SH7300)
+	{
+		.port	= {
+			.membase	= (void *)0xA4430000,
+			.mapbase	= 0xA4430000,
+			.iotype		= SERIAL_IO_MEM,
+			.irq		= 25,
+			.ops		= &sci_uart_ops,
+			.flags		= ASYNC_BOOT_AUTOCONF,
+			.line		= 0,
+		},
+		.type		= PORT_SCIF,
+		.irqs		= SH7300_SCIF0_IRQS,
+		.init_pins	= sci_init_pins_scif,
+	},
+#elif defined(CONFIG_SH_RTS7751R2D)
+	{
+		.port	= {
+			.membase	= (void *)0xffe80000,
+			.mapbase	= 0xffe80000,
+			.iotype		= SERIAL_IO_MEM,
+			.irq		= 43,
+			.ops		= &sci_uart_ops,
+			.flags		= ASYNC_BOOT_AUTOCONF,
+			.line		= 0,
+		},
+		.type		= PORT_SCIF,
+		.irqs		= SH4_SCIF_IRQS,
+		.init_pins	= sci_init_pins_scif,
+	},
 #elif defined(CONFIG_CPU_SUBTYPE_SH7750) || defined(CONFIG_CPU_SUBTYPE_SH7751)
 	{
 		.port	= {
@@ -1220,6 +1313,19 @@ static struct sci_port sci_ports[SCI_NPORTS] = {
 		.irqs		= SH4_SCIF_IRQS,
 		.init_pins	= sci_init_pins_scif,
 	},
+#elif defined(CONFIG_CPU_SUBTYPE_SH5_101) || defined(CONFIG_CPU_SUBTYPE_SH5_103)
+	{
+		.port	= {
+			.iotype		= SERIAL_IO_MEM,
+			.irq		= 42,
+			.ops		= &sci_uart_ops,
+			.flags		= ASYNC_BOOT_AUTOCONF,
+			.line		= 0,
+		},
+		.type		= PORT_SCIF,
+		.irqs		= SH5_SCIF_IRQS,
+		.init_pins	= sci_init_pins_scif,
+	},
 #elif defined(CONFIG_H83007) || defined(CONFIG_H83068)
 	{
 		.port	= {
@@ -1338,6 +1444,11 @@ static int __init serial_console_setup(struct console *co, char *options)
 	port = &serial_console_port->port;
 	port->type = serial_console_port->type;
 
+#ifdef CONFIG_SUPERH64
+	/* This is especially needed on sh64 to remap the SCIF */
+	sci_config_port(port, 0);
+#endif
+
 	/*
 	 * We need to set the initial uartclk here, since otherwise it will
 	 * only ever be setup at sci_init() time.
@@ -1374,18 +1485,7 @@ static struct console serial_console = {
 
 static int __init sci_console_init(void)
 {
-#ifdef CONFIG_SH_EARLY_PRINTK
-	extern void sh_console_unregister(void);
-
-	/*
-	 * Now that the real console is available, unregister the one we
-	 * used while first booting.
-	 */
-	sh_console_unregister();
-#endif
-
 	register_console(&serial_console);
-
 	return 0;
 }
 
@@ -1452,7 +1552,6 @@ static struct console kgdb_console = {
 static int __init kgdb_console_init(void)
 {
         register_console(&kgdb_console);
-
 	return 0;
 }
 
diff --git a/drivers/serial/sh-sci.h b/drivers/serial/sh-sci.h
index 21312ddb7..bf248f18a 100644
--- a/drivers/serial/sh-sci.h
+++ b/drivers/serial/sh-sci.h
@@ -7,6 +7,7 @@
  *  Copyright (C) 2000  Greg Banks
  *  Copyright (C) 2002, 2003  Paul Mundt
  *  Modified to support multiple serial ports. Stuart Menefy (May 2000).
+ *  Modified to support SH7300(SH-Mobile) SCIF. Takashi Kusuda (Jun 2003).
  *  Modified to support H8/300 Series Yoshinori Sato (Feb 2004).
  */
 #include <linux/config.h>
@@ -36,12 +37,14 @@
 #define SH7760_SCIF0_IRQS { 52, 53, 55, 54 }
 #define SH7760_SCIF1_IRQS { 72, 73, 75, 74 }
 #define SH7760_SCIF2_IRQS { 76, 77, 79, 78 }
+#define SH7300_SCIF0_IRQS {80,  80,  80,  80 }
 #define H8300H_SCI_IRQS0 {52, 53, 54,   0 }
 #define H8300H_SCI_IRQS1 {56, 57, 58,   0 }
 #define H8300H_SCI_IRQS2 {60, 61, 62,   0 }
 #define H8S_SCI_IRQS0 {88, 89, 90,   0 }
 #define H8S_SCI_IRQS1 {92, 93, 94,   0 }
 #define H8S_SCI_IRQS2 {96, 97, 98,   0 }
+#define SH5_SCIF_IRQS {39, 40, 42,   0 }
 
 #if defined(CONFIG_CPU_SUBTYPE_SH7708)
 # define SCI_NPORTS 1
@@ -54,6 +57,13 @@
 # define SCPDR  0xA4000136 /* 8  bit SCI and SCIF */
 # define SCSCR_INIT(port)          0x30 /* TIE=0,RIE=0,TE=1,RE=1 */
 # define SCI_AND_SCIF
+#elif defined(CONFIG_SH_RTS7751R2D)
+# define SCI_NPORTS 1
+# define SCSPTR1 0xffe0001c /* 8  bit SCI */
+# define SCSPTR2 0xFFE80020 /* 16 bit SCIF */
+# define SCIF_ORER 0x0001   /* overrun error bit */
+# define SCSCR_INIT(port) 0x3a /* TIE=0,RIE=0,TE=1,RE=1,REIE=1 */
+# define SCIF_ONLY
 #elif defined(CONFIG_CPU_SUBTYPE_SH7750) || defined(CONFIG_CPU_SUBTYPE_SH7751)
 # define SCI_NPORTS 2
 # define SCSPTR1 0xffe0001c /* 8  bit SCI */
@@ -68,9 +78,15 @@
 # define SCSPTR0 0xfe600000 /* 16 bit SCIF */
 # define SCSPTR1 0xfe610000 /* 16 bit SCIF */
 # define SCSPTR2 0xfe620000 /* 16 bit SCIF */
-# define SCIF_ORDER 0x0001  /* overrun error bit */
+# define SCIF_ORER 0x0001  /* overrun error bit */
 # define SCSCR_INIT(port)          0x38 /* TIE=0,RIE=0,TE=1,RE=1,REIE=1 */
 # define SCIF_ONLY
+#elif defined(CONFIG_CPU_SUBTYPE_SH7300)
+# define SCI_NPORTS 1
+# define SCPCR  0xA4050116        /* 16 bit SCIF */
+# define SCPDR  0xA4050136        /* 16 bit SCIF */
+# define SCSCR_INIT(port)  0x0030 /* TIE=0,RIE=0,TE=1,RE=1 */
+# define SCIF_ONLY
 #elif defined(CONFIG_CPU_SUBTYPE_ST40STB1)
 # define SCI_NPORTS 2
 # define SCSPTR1 0xffe00020 /* 16 bit SCIF */
@@ -78,6 +94,22 @@
 # define SCIF_ORER 0x0001   /* overrun error bit */
 # define SCSCR_INIT(port)          0x38 /* TIE=0,RIE=0,TE=1,RE=1,REIE=1 */
 # define SCIF_ONLY
+#elif defined(CONFIG_CPU_SUBTYPE_SH5_101) || defined(CONFIG_CPU_SUBTYPE_SH5_103)
+# include <asm/hardware.h>
+# define SCIF_BASE_ADDR    0x01030000
+# define SCIF_ADDR_SH5     PHYS_PERIPHERAL_BLOCK+SCIF_BASE_ADDR
+# define SCIF_PTR2_OFFS    0x0000020
+# define SCIF_LSR2_OFFS    0x0000024
+# define SCI_NPORTS 1
+# define SCI_INIT { \
+  { {}, PORT_SCIF, 0, \
+     SH5_SCIF_IRQS, sci_init_pins_scif }  \
+}
+# define SCSPTR2           ((port->mapbase)+SCIF_PTR2_OFFS) /* 16 bit SCIF */
+# define SCLSR2            ((port->mapbase)+SCIF_LSR2_OFFS) /* 16 bit SCIF */
+# define SCSCR_INIT(port)  0x38                           /* TIE=0,RIE=0,
+							     TE=1,RE=1,REIE=1 */
+# define SCIF_ONLY
 #elif defined(CONFIG_H83007) || defined(CONFIG_H83068)
 # define SCI_NPORTS 3
 # define SCSCR_INIT(port)          0x30 /* TIE=0,RIE=0,TE=1,RE=1 */
@@ -97,7 +129,11 @@
 #define SCI_CTRL_FLAGS_RIE  0x40 /* all */
 #define SCI_CTRL_FLAGS_TE   0x20 /* all */
 #define SCI_CTRL_FLAGS_RE   0x10 /* all */
-/*      SCI_CTRL_FLAGS_REIE 0x08  * 7750 SCIF */
+#if defined(CONFIG_CPU_SUBTYPE_SH7750) || defined(CONFIG_CPU_SUBTYPE_SH7751)
+#define SCI_CTRL_FLAGS_REIE 0x08 /* 7750 SCIF */
+#else
+#define SCI_CTRL_FLAGS_REIE 0
+#endif
 /*      SCI_CTRL_FLAGS_MPIE 0x08  * 7707 SCI, 7708 SCI, 7709 SCI, 7750 SCI */
 /*      SCI_CTRL_FLAGS_TEIE 0x04  * 7707 SCI, 7708 SCI, 7709 SCI, 7750 SCI */
 /*      SCI_CTRL_FLAGS_CKE1 0x02  * all */
@@ -125,7 +161,16 @@
 #define SCIF_RDF   0x0002 /* 7707 SCIF, 7709 SCIF, 7750 SCIF */
 #define SCIF_DR    0x0001 /* 7707 SCIF, 7709 SCIF, 7750 SCIF */
 
+#if defined(CONFIG_CPU_SUBTYPE_SH7300)
+#define SCIF_ORER    0x0200
+#define SCIF_ERRORS ( SCIF_PER | SCIF_FER | SCIF_ER | SCIF_BRK | SCIF_ORER)
+#define SCIF_RFDC_MASK 0x007f
+#define SCIF_TXROOM_MAX 64
+#else
 #define SCIF_ERRORS ( SCIF_PER | SCIF_FER | SCIF_ER | SCIF_BRK)
+#define SCIF_RFDC_MASK 0x001f
+#define SCIF_TXROOM_MAX 16
+#endif
 
 #if defined(SCI_ONLY)
 # define SCxSR_TEND(port)		SCI_TEND
@@ -145,14 +190,25 @@
 # define SCxSR_ERRORS(port)		SCIF_ERRORS
 # define SCxSR_RDxF(port)               SCIF_RDF
 # define SCxSR_TDxE(port)               SCIF_TDFE
+#if defined(CONFIG_CPU_SUBTYPE_SH7300)
+# define SCxSR_ORER(port)		SCIF_ORER
+#else
 # define SCxSR_ORER(port)		0x0000
+#endif
 # define SCxSR_FER(port)		SCIF_FER
 # define SCxSR_PER(port)		SCIF_PER
 # define SCxSR_BRK(port)		SCIF_BRK
+#if defined(CONFIG_CPU_SUBTYPE_SH7300)
+# define SCxSR_RDxF_CLEAR(port)         (sci_in(port,SCxSR)&0xfffc)
+# define SCxSR_ERROR_CLEAR(port)        (sci_in(port,SCxSR)&0xfd73)
+# define SCxSR_TDxE_CLEAR(port)         (sci_in(port,SCxSR)&0xffdf)
+# define SCxSR_BREAK_CLEAR(port)        (sci_in(port,SCxSR)&0xffe3)
+#else
 # define SCxSR_RDxF_CLEAR(port)		0x00fc
 # define SCxSR_ERROR_CLEAR(port)	0x0073
 # define SCxSR_TDxE_CLEAR(port)		0x00df
 # define SCxSR_BREAK_CLEAR(port)   	0x00e3
+#endif
 #else
 # define SCxSR_TEND(port)	 (((port)->type == PORT_SCI) ? SCI_TEND   : SCIF_TEND)
 # define SCxSR_ERRORS(port)	 (((port)->type == PORT_SCI) ? SCI_ERRORS : SCIF_ERRORS)
@@ -171,6 +227,7 @@
 /* SCFCR */
 #define SCFCR_RFRST 0x0002
 #define SCFCR_TFRST 0x0004
+#define SCFCR_TCRST 0x4000
 #define SCFCR_MCE   0x0008
 
 #define SCI_MAJOR		204
@@ -250,12 +307,17 @@ struct sci_port {
   }
 
 #ifdef CONFIG_CPU_SH3
+#if defined(CONFIG_CPU_SUBTYPE_SH7300)
+#define SCIF_FNS(name, scif_offset, scif_size) \
+  CPU_SCIF_FNS(name, scif_offset, scif_size)
+#else
 #define SCIx_FNS(name, sh3_sci_offset, sh3_sci_size, sh4_sci_offset, sh4_sci_size, \
 		 sh3_scif_offset, sh3_scif_size, sh4_scif_offset, sh4_scif_size, \
                  h8_sci_offset, h8_sci_size) \
   CPU_SCIx_FNS(name, sh3_sci_offset, sh3_sci_size, sh3_scif_offset, sh3_scif_size)
 #define SCIF_FNS(name, sh3_scif_offset, sh3_scif_size, sh4_scif_offset, sh4_scif_size) \
   CPU_SCIF_FNS(name, sh3_scif_offset, sh3_scif_size)
+#endif
 #elif defined(__H8300H__) || defined(__H8300S__)
 #define SCIx_FNS(name, sh3_sci_offset, sh3_sci_size, sh4_sci_offset, sh4_sci_size, \
 		 sh3_scif_offset, sh3_scif_size, sh4_scif_offset, sh4_scif_size, \
@@ -271,6 +333,19 @@ struct sci_port {
   CPU_SCIF_FNS(name, sh4_scif_offset, sh4_scif_size)
 #endif
 
+#if defined(CONFIG_CPU_SUBTYPE_SH7300)
+SCIF_FNS(SCSMR,  0x00, 16)
+SCIF_FNS(SCBRR,  0x04,  8)
+SCIF_FNS(SCSCR,  0x08, 16)
+SCIF_FNS(SCTDSR, 0x0c,  8)
+SCIF_FNS(SCFER,  0x10, 16)
+SCIF_FNS(SCxSR,  0x14, 16)
+SCIF_FNS(SCFCR,  0x18, 16)
+SCIF_FNS(SCFDR,  0x1c, 16)
+SCIF_FNS(SCxTDR, 0x20,  8)
+SCIF_FNS(SCxRDR, 0x24,  8)
+SCIF_FNS(SCLSR,  0x24, 16)
+#else
 /*      reg      SCI/SH3   SCI/SH4  SCIF/SH3   SCIF/SH4  SCI/H8*/
 /*      name     off  sz   off  sz   off  sz   off  sz   off  sz*/
 SCIx_FNS(SCSMR,  0x00,  8, 0x00,  8, 0x00,  8, 0x00, 16, 0x00,  8)
@@ -281,8 +356,9 @@ SCIx_FNS(SCxSR,  0x08,  8, 0x10,  8, 0x08, 16, 0x10, 16, 0x04,  8)
 SCIx_FNS(SCxRDR, 0x0a,  8, 0x14,  8, 0x0A,  8, 0x14,  8, 0x05,  8)
 SCIF_FNS(SCFCR,                      0x0c,  8, 0x18, 16)
 SCIF_FNS(SCFDR,                      0x0e, 16, 0x1C, 16)
+SCIF_FNS(SCSPTR,                        0,  0, 0x20, 16)
 SCIF_FNS(SCLSR,                         0,  0, 0x24, 16)
-
+#endif
 #define sci_in(port, reg) sci_##reg##_in(port)
 #define sci_out(port, reg, value) sci_##reg##_out(port, value)
 
@@ -369,6 +445,13 @@ static inline int sci_rxd_in(struct uart_port *port)
 	if (port->mapbase == 0xfe620000)
 		return ctrl_inw(SCSPTR2) & 0x0001 ? 1 : 0; /* SCIF */
 }
+#elif defined(CONFIG_CPU_SUBTYPE_SH7300)
+static inline int sci_rxd_in(struct uart_port *port)
+{
+        if (port->mapbase == 0xa4430000)
+                return ctrl_inb(SCPDR)&0x01 ? 1 : 0; /* SCIF0 */
+        return 1;
+}
 #elif defined(CONFIG_CPU_SUBTYPE_ST40STB1)
 static inline int sci_rxd_in(struct uart_port *port)
 {
@@ -378,6 +461,11 @@ static inline int sci_rxd_in(struct uart_port *port)
 		return ctrl_inw(SCSPTR2)&0x0001 ? 1 : 0; /* SCIF */
 
 }
+#elif defined(CONFIG_CPU_SUBTYPE_SH5_101) || defined(CONFIG_CPU_SUBTYPE_SH5_103)
+static inline int sci_rxd_in(struct uart_port *port)
+{
+         return sci_in(port, SCSPTR)&0x0001 ? 1 : 0; /* SCIF */
+}
 #elif defined(__H8300H__) || defined(__H8300S__)
 static inline int sci_rxd_in(struct uart_port *port)
 {
@@ -420,7 +508,9 @@ static inline int sci_rxd_in(struct uart_port *port)
 
 #define PCLK           (current_cpu_data.module_clock)
 
-#if !defined(__H8300H__) && !defined(__H8300S__)
+#if defined(CONFIG_CPU_SUBTYPE_SH7300)
+#define SCBRR_VALUE(bps) ((PCLK+16*bps)/(16*bps)-1)
+#elif !defined(__H8300H__) && !defined(__H8300S__)
 #define SCBRR_VALUE(bps) ((PCLK+16*bps)/(32*bps)-1)
 #else
 #define SCBRR_VALUE(bps) (((CONFIG_CPU_CLOCK*1000/32)/bps)-1)
diff --git a/drivers/serial/suncore.c b/drivers/serial/suncore.c
index 93909ed99..5fc4a6217 100644
--- a/drivers/serial/suncore.c
+++ b/drivers/serial/suncore.c
@@ -90,13 +90,13 @@ no_options:
 	cflag = CREAD | HUPCL | CLOCAL;
 
 	s = mode;
-	baud = simple_strtoul(s, 0, 0);
+	baud = simple_strtoul(s, NULL, 0);
 	s = strchr(s, ',');
-	bits = simple_strtoul(++s, 0, 0);
+	bits = simple_strtoul(++s, NULL, 0);
 	s = strchr(s, ',');
 	parity = *(++s);
 	s = strchr(s, ',');
-	stop = simple_strtoul(++s, 0, 0);
+	stop = simple_strtoul(++s, NULL, 0);
 	s = strchr(s, ',');
 	/* XXX handshake is not handled here. */
 
diff --git a/drivers/serial/sunsu.c b/drivers/serial/sunsu.c
index d72a7aaf2..02586518a 100644
--- a/drivers/serial/sunsu.c
+++ b/drivers/serial/sunsu.c
@@ -1045,7 +1045,7 @@ static void sunsu_autoconfig(struct uart_sunsu_port *up)
 {
 	unsigned char status1, status2, scratch, scratch2, scratch3;
 	unsigned char save_lcr, save_mcr;
-	struct linux_ebus_device *dev = 0;
+	struct linux_ebus_device *dev = NULL;
 	struct linux_ebus *ebus;
 #ifdef CONFIG_SPARC64
 	struct sparc_isa_bridge *isa_br;
diff --git a/drivers/tc/zs.c b/drivers/tc/zs.c
index 2904b0a28..7391ae649 100644
--- a/drivers/tc/zs.c
+++ b/drivers/tc/zs.c
@@ -67,7 +67,7 @@
 #include <asm/uaccess.h>
 #include <asm/wbflush.h>
 #include <asm/bootinfo.h>
-#ifdef CONFIG_DECSTATION
+#ifdef CONFIG_MACH_DECSTATION
 #include <asm/dec/interrupts.h>
 #include <asm/dec/machtype.h>
 #include <asm/dec/tc.h>
@@ -111,7 +111,7 @@ struct zs_parms {
 
 static struct zs_parms *zs_parms;
 
-#ifdef CONFIG_DECSTATION
+#ifdef CONFIG_MACH_DECSTATION
 static struct zs_parms ds_parms = {
 	scc0 : SCC0,
 	scc1 : SCC1,
@@ -132,7 +132,7 @@ static struct zs_parms baget_parms = {
 };
 #endif
 
-#ifdef CONFIG_DECSTATION
+#ifdef CONFIG_MACH_DECSTATION
 #define DS_BUS_PRESENT (IOASIC)
 #else
 #define DS_BUS_PRESENT 0
@@ -1689,7 +1689,7 @@ static void __init probe_sccs(void)
 	 * system_base for this case :-(. HK
 	 */
 	switch(mips_machtype) {
-#ifdef CONFIG_DECSTATION
+#ifdef CONFIG_MACH_DECSTATION
 	case MACH_DS5000_2X0:
 		system_base = 0xbf800000;
 		n_chips = 2;
diff --git a/drivers/telephony/ixj.c b/drivers/telephony/ixj.c
index 5778788a2..1d0a2e1a7 100644
--- a/drivers/telephony/ixj.c
+++ b/drivers/telephony/ixj.c
@@ -461,8 +461,8 @@ static void DAA_Coeff_Japan(IXJ *j);
 static int ixj_init_filter(IXJ *j, IXJ_FILTER * jf);
 static int ixj_init_filter_raw(IXJ *j, IXJ_FILTER_RAW * jfr);
 static int ixj_init_tone(IXJ *j, IXJ_TONE * ti);
-static int ixj_build_cadence(IXJ *j, IXJ_CADENCE * cp);
-static int ixj_build_filter_cadence(IXJ *j, IXJ_FILTER_CADENCE * cp);
+static int ixj_build_cadence(IXJ *j, IXJ_CADENCE __user * cp);
+static int ixj_build_filter_cadence(IXJ *j, IXJ_FILTER_CADENCE __user * cp);
 /* Serial Control Interface funtions */
 static int SCI_Control(IXJ *j, int control);
 static int SCI_Prepare(IXJ *j);
@@ -2855,7 +2855,7 @@ static void alaw2ulaw(unsigned char *buff, unsigned long len)
 	}
 }
 
-static ssize_t ixj_read(struct file * file_p, char *buf, size_t length, loff_t * ppos)
+static ssize_t ixj_read(struct file * file_p, char __user *buf, size_t length, loff_t * ppos)
 {
 	unsigned long i = *ppos;
 	IXJ * j = get_ixj(NUM(file_p->f_dentry->d_inode));
@@ -2910,7 +2910,7 @@ static ssize_t ixj_read(struct file * file_p, char *buf, size_t length, loff_t *
 	}
 }
 
-static ssize_t ixj_enhanced_read(struct file * file_p, char *buf, size_t length,
+static ssize_t ixj_enhanced_read(struct file * file_p, char __user *buf, size_t length,
 			  loff_t * ppos)
 {
 	int pre_retval;
@@ -2935,7 +2935,7 @@ static ssize_t ixj_enhanced_read(struct file * file_p, char *buf, size_t length,
 	return read_retval;
 }
 
-static ssize_t ixj_write(struct file *file_p, const char *buf, size_t count, loff_t * ppos)
+static ssize_t ixj_write(struct file *file_p, const char __user *buf, size_t count, loff_t * ppos)
 {
 	unsigned long i = *ppos;
 	IXJ *j = file_p->private_data;
@@ -2989,7 +2989,7 @@ static ssize_t ixj_write(struct file *file_p, const char *buf, size_t count, lof
 	return min(count, j->write_buffer_size);
 }
 
-static ssize_t ixj_enhanced_write(struct file * file_p, const char *buf, size_t count, loff_t * ppos)
+static ssize_t ixj_enhanced_write(struct file * file_p, const char __user *buf, size_t count, loff_t * ppos)
 {
 	int pre_retval;
 	ssize_t write_retval = 0;
@@ -5938,31 +5938,41 @@ static void ixj_testram(IXJ *j)
 	ixj_WriteDSPCommand(0x3001, j);	/* Test External SRAM */
 }
 
-static int ixj_build_cadence(IXJ *j, IXJ_CADENCE * cp)
+static int ixj_build_cadence(IXJ *j, IXJ_CADENCE __user * cp)
 {
-	IXJ_CADENCE *lcp;
+	ixj_cadence *lcp;
+	IXJ_CADENCE_ELEMENT __user *cep;
 	IXJ_CADENCE_ELEMENT *lcep;
 	IXJ_TONE ti;
+	int err;
 
-	lcp = kmalloc(sizeof(IXJ_CADENCE), GFP_KERNEL);
+	lcp = kmalloc(sizeof(ixj_cadence), GFP_KERNEL);
 	if (lcp == NULL)
 		return -ENOMEM;
-	if (copy_from_user(lcp, (char *) cp, sizeof(IXJ_CADENCE)) || (unsigned)lcp->elements_used >= ~0U/sizeof(IXJ_CADENCE_ELEMENT) )
-        {
-                kfree(lcp);
-                return -EFAULT;
-        }
+
+	err = -EFAULT;
+	if (copy_from_user(&lcp->elements_used,
+			   &cp->elements_used, sizeof(int)))
+		goto out;
+	if (copy_from_user(&lcp->termination,
+			   &cp->termination, sizeof(IXJ_CADENCE_TERM)))
+		goto out;
+	if (get_user(cep, &cp->ce))
+		goto out;
+
+	err = -EINVAL;
+	if ((unsigned)lcp->elements_used >= ~0U/sizeof(IXJ_CADENCE_ELEMENT))
+		goto out;
+
+	err = -ENOMEM;
 	lcep = kmalloc(sizeof(IXJ_CADENCE_ELEMENT) * lcp->elements_used, GFP_KERNEL);
-	if (lcep == NULL) {
-		kfree(lcp);
-		return -ENOMEM;
-	}
-	if (copy_from_user(lcep, lcp->ce, sizeof(IXJ_CADENCE_ELEMENT) * lcp->elements_used))
-	{
-		kfree(lcep);
-		kfree(lcp);
-		return -EFAULT;
-	}
+	if (!lcep)
+		goto out;
+
+	err = -EFAULT;
+	if (copy_from_user(lcep, cep, sizeof(IXJ_CADENCE_ELEMENT) * lcp->elements_used))
+		goto out1;
+
 	if (j->cadence_t) {
 		kfree(j->cadence_t->ce);
 		kfree(j->cadence_t);
@@ -5982,9 +5992,14 @@ static int ixj_build_cadence(IXJ *j, IXJ_CADENCE * cp)
 	}
 	ixj_play_tone(j, lcp->ce[0].index);
 	return 1;
+out1:
+	kfree(lcep);
+out:
+	kfree(lcp);
+	return err;
 }
 
-static int ixj_build_filter_cadence(IXJ *j, IXJ_FILTER_CADENCE * cp)
+static int ixj_build_filter_cadence(IXJ *j, IXJ_FILTER_CADENCE __user * cp)
 {
 	IXJ_FILTER_CADENCE *lcp;
 	lcp = kmalloc(sizeof(IXJ_FILTER_CADENCE), GFP_KERNEL);
@@ -5994,7 +6009,7 @@ static int ixj_build_filter_cadence(IXJ *j, IXJ_FILTER_CADENCE * cp)
 		}
 		return -ENOMEM;
         }
-	if (copy_from_user(lcp, (char *) cp, sizeof(IXJ_FILTER_CADENCE))) {
+	if (copy_from_user(lcp, cp, sizeof(IXJ_FILTER_CADENCE))) {
 		if(ixjdebug & 0x0001) {
 			printk(KERN_INFO "Could not copy cadence to kernel\n");
 		}
@@ -6206,6 +6221,7 @@ static int ixj_ioctl(struct inode *inode, struct file *file_p, unsigned int cmd,
 	IXJ_TONE ti;
 	IXJ_FILTER jf;
 	IXJ_FILTER_RAW jfr;
+	void __user *argp = (void __user *)arg;
 
 	unsigned int raise, mant;
 	unsigned int minor = iminor(inode);
@@ -6251,7 +6267,7 @@ static int ixj_ioctl(struct inode *inode, struct file *file_p, unsigned int cmd,
 		retval = j->serial;
 		break;
 	case IXJCTL_VERSION:
-		if (copy_to_user((char *) arg, ixj_c_revision, strlen(ixj_c_revision))) 
+		if (copy_to_user(argp, ixj_c_revision, strlen(ixj_c_revision))) 
 			retval = -EFAULT;
 		break;
 	case PHONE_RING_CADENCE:
@@ -6259,7 +6275,7 @@ static int ixj_ioctl(struct inode *inode, struct file *file_p, unsigned int cmd,
 		break;
 	case IXJCTL_CIDCW:
 		if(arg) {
-			if (copy_from_user(&j->cid_send, (char *)arg, sizeof(PHONE_CID))) {
+			if (copy_from_user(&j->cid_send, argp, sizeof(PHONE_CID))) {
 				retval = -EFAULT;
 				break;
 			}
@@ -6274,7 +6290,7 @@ static int ixj_ioctl(struct inode *inode, struct file *file_p, unsigned int cmd,
                 /* Fall through */
  	case PHONE_RING_START:
 		if(arg) {
-			if (copy_from_user(&j->cid_send, (char *)arg, sizeof(PHONE_CID))) {
+			if (copy_from_user(&j->cid_send, argp, sizeof(PHONE_CID))) {
 				retval = -EFAULT;
 				break;
 			}
@@ -6432,22 +6448,22 @@ static int ixj_ioctl(struct inode *inode, struct file *file_p, unsigned int cmd,
 			samplerate = arg;
 		break;
 	case IXJCTL_DRYBUFFER_READ:
-		put_user(j->drybuffer, (unsigned long *) arg);
+		put_user(j->drybuffer, (unsigned long __user *) argp);
 		break;
 	case IXJCTL_DRYBUFFER_CLEAR:
 		j->drybuffer = 0;
 		break;
 	case IXJCTL_FRAMES_READ:
-		put_user(j->framesread, (unsigned long *) arg);
+		put_user(j->framesread, (unsigned long __user *) argp);
 		break;
 	case IXJCTL_FRAMES_WRITTEN:
-		put_user(j->frameswritten, (unsigned long *) arg);
+		put_user(j->frameswritten, (unsigned long __user *) argp);
 		break;
 	case IXJCTL_READ_WAIT:
-		put_user(j->read_wait, (unsigned long *) arg);
+		put_user(j->read_wait, (unsigned long __user *) argp);
 		break;
 	case IXJCTL_WRITE_WAIT:
-		put_user(j->write_wait, (unsigned long *) arg);
+		put_user(j->write_wait, (unsigned long __user *) argp);
 		break;
 	case PHONE_MAXRINGS:
 		j->maxrings = arg;
@@ -6573,7 +6589,7 @@ static int ixj_ioctl(struct inode *inode, struct file *file_p, unsigned int cmd,
                         12, 10, 16, 9, 8, 48, 5,
                         40, 40, 80, 40, 40, 6
                 };
-                if(copy_from_user(&pd, (void *)arg, sizeof(pd))) {
+                if(copy_from_user(&pd, argp, sizeof(pd))) {
                         retval = -EFAULT;
 			break;
 		}
@@ -6590,7 +6606,7 @@ static int ixj_ioctl(struct inode *inode, struct file *file_p, unsigned int cmd,
                         default:val=proto_size[pd.type]*3;break;
                 }
                 pd.buf_min=pd.buf_max=pd.buf_opt=val;
-                if(copy_to_user((void *)arg, &pd, sizeof(pd)))
+                if(copy_to_user(argp, &pd, sizeof(pd)))
                         retval = -EFAULT;
         	break;
         }
@@ -6644,7 +6660,7 @@ static int ixj_ioctl(struct inode *inode, struct file *file_p, unsigned int cmd,
 		ixj_write_vmwi(j, arg);
 		break;
 	case IXJCTL_CID:
-		if (copy_to_user((char *) arg, &j->cid, sizeof(PHONE_CID))) 
+		if (copy_to_user(argp, &j->cid, sizeof(PHONE_CID))) 
 			retval = -EFAULT;
 		j->ex.bits.caller_id = 0;
 		break;
@@ -6666,13 +6682,13 @@ static int ixj_ioctl(struct inode *inode, struct file *file_p, unsigned int cmd,
 		break;
 	case PHONE_CAPABILITIES_LIST:
 		add_caps(j);
-		if (copy_to_user((char *) arg, j->caplist, sizeof(struct phone_capability) * j->caps)) 
+		if (copy_to_user(argp, j->caplist, sizeof(struct phone_capability) * j->caps)) 
 			retval = -EFAULT;
 		break;
 	case PHONE_CAPABILITIES_CHECK:
 		{
 			struct phone_capability cap;
-			if (copy_from_user(&cap, (char *) arg, sizeof(cap))) 
+			if (copy_from_user(&cap, argp, sizeof(cap))) 
 				retval = -EFAULT;
 			else {
 				add_caps(j);
@@ -6688,12 +6704,12 @@ static int ixj_ioctl(struct inode *inode, struct file *file_p, unsigned int cmd,
 		j->ex.bits.pstn_ring = 0;
 		break;
 	case IXJCTL_SET_FILTER:
-		if (copy_from_user(&jf, (char *) arg, sizeof(jf))) 
+		if (copy_from_user(&jf, argp, sizeof(jf))) 
 			retval = -EFAULT;
 		retval = ixj_init_filter(j, &jf);
 		break;
 	case IXJCTL_SET_FILTER_RAW:
-		if (copy_from_user(&jfr, (char *) arg, sizeof(jfr))) 
+		if (copy_from_user(&jfr, argp, sizeof(jfr))) 
 			retval = -EFAULT;
 		else
 			retval = ixj_init_filter_raw(j, &jfr);
@@ -6705,19 +6721,19 @@ static int ixj_ioctl(struct inode *inode, struct file *file_p, unsigned int cmd,
 			retval = j->filter_hist[arg];
 		break;
 	case IXJCTL_INIT_TONE:
-		if (copy_from_user(&ti, (char *) arg, sizeof(ti)))
+		if (copy_from_user(&ti, argp, sizeof(ti)))
 			retval = -EFAULT;
 		else
 			retval = ixj_init_tone(j, &ti);
 		break;
 	case IXJCTL_TONE_CADENCE:
-		retval = ixj_build_cadence(j, (IXJ_CADENCE *) arg);
+		retval = ixj_build_cadence(j, argp);
 		break;
 	case IXJCTL_FILTER_CADENCE:
-		retval = ixj_build_filter_cadence(j, (IXJ_FILTER_CADENCE *) arg);
+		retval = ixj_build_filter_cadence(j, argp);
 		break;
 	case IXJCTL_SIGCTL:
-		if (copy_from_user(&j->sigdef, (char *)arg, sizeof(IXJ_SIGDEF))) {
+		if (copy_from_user(&j->sigdef, argp, sizeof(IXJ_SIGDEF))) {
 			retval = -EFAULT;
 			break;
 		}
@@ -7741,6 +7757,7 @@ int __init ixj_probe_isapnp(int *cnt)
 			}
 
 			j = ixj_alloc();
+			j->DSPbase = pnp_port_start(dev,0);
 			request_region(j->DSPbase, 16, "ixj DSP");
 
 			if (func != 0x110)
diff --git a/drivers/telephony/ixj.h b/drivers/telephony/ixj.h
index 65d837d5f..ad23b28e6 100644
--- a/drivers/telephony/ixj.h
+++ b/drivers/telephony/ixj.h
@@ -1166,6 +1166,12 @@ typedef struct {
 *
 ******************************************************************************/
 
+typedef struct {
+	int elements_used;
+	IXJ_CADENCE_TERM termination;
+	IXJ_CADENCE_ELEMENT *ce;
+} ixj_cadence;
+
 typedef struct {
 	struct phone_device p;
 	struct timer_list timer;
@@ -1220,8 +1226,8 @@ typedef struct {
 	char tone_index;
 	char tone_state;
 	char maxrings;
-	IXJ_CADENCE *cadence_t;
-	IXJ_CADENCE *cadence_r;
+	ixj_cadence *cadence_t;
+	ixj_cadence *cadence_r;
 	int tone_cadence_state;
 	IXJ_CADENCE_F cadence_f[6];
 	DTMF dtmf;
diff --git a/drivers/telephony/phonedev.c b/drivers/telephony/phonedev.c
index 3300eeb1f..3c987f49f 100644
--- a/drivers/telephony/phonedev.c
+++ b/drivers/telephony/phonedev.c
@@ -28,7 +28,7 @@
 
 #include <linux/kmod.h>
 #include <linux/sem.h>
-
+#include <linux/devfs_fs_kernel.h>
 
 #define PHONE_NUM_DEVICES	256
 
@@ -105,6 +105,8 @@ int phone_register_device(struct phone_device *p, int unit)
 		if (phone_device[i] == NULL) {
 			phone_device[i] = p;
 			p->minor = i;
+			devfs_mk_cdev(MKDEV(PHONE_MAJOR,i),
+				S_IFCHR|S_IRUSR|S_IWUSR, "phone/%d", i);
 			up(&phone_lock);
 			return 0;
 		}
@@ -122,6 +124,7 @@ void phone_unregister_device(struct phone_device *pfd)
 	down(&phone_lock);
 	if (phone_device[pfd->minor] != pfd)
 		panic("phone: bad unregister");
+	devfs_remove("phone/%d", pfd->minor);
 	phone_device[pfd->minor] = NULL;
 	up(&phone_lock);
 }
diff --git a/drivers/usb/Kconfig b/drivers/usb/Kconfig
index 4c74401ae..0e805e4f3 100644
--- a/drivers/usb/Kconfig
+++ b/drivers/usb/Kconfig
@@ -7,7 +7,7 @@ menu "USB support"
 # ARM SA1111 chips have a non-PCI based "OHCI-compatible" USB host interface.
 config USB
 	tristate "Support for Host-side USB"
-	depends on PCI || SA1111 || ARCH_OMAP1510 || ARCH_OMAP1610
+	depends on PCI || SA1111 || ARCH_OMAP1510 || ARCH_OMAP1610 || ARCH_LH7A404
 	---help---
 	  Universal Serial Bus (USB) is a specification for a serial bus
 	  subsystem which offers higher speeds and more features than the
diff --git a/drivers/usb/class/audio.c b/drivers/usb/class/audio.c
index 4aa223576..42f60fa37 100644
--- a/drivers/usb/class/audio.c
+++ b/drivers/usb/class/audio.c
@@ -212,9 +212,6 @@
 
 #define dprintk(x)
 
-#undef abs
-extern int abs(int __x) __attribute_const__; /* Shut up warning */
-
 /* --------------------------------------------------------------------- */
 
 /*
@@ -398,17 +395,6 @@ struct usb_audio_state {
 
 /* --------------------------------------------------------------------- */
 
-/* prevent picking up a bogus abs macro */
-#undef abs
-static inline int abs(int x)
-{
-        if (x < 0)
-		return -x;
-	return x;
-}
-                                
-/* --------------------------------------------------------------------- */
-
 static inline unsigned ld2(unsigned int x)
 {
 	unsigned r = 0;
@@ -1988,7 +1974,7 @@ static int usb_audio_open_mixdev(struct inode *inode, struct file *file)
 	s->count++;
 
 	up(&open_sem);
-	return 0;
+	return nonseekable_open(inode, file);
 }
 
 static int usb_audio_release_mixdev(struct inode *inode, struct file *file)
@@ -2008,6 +1994,7 @@ static int usb_audio_ioctl_mixdev(struct inode *inode, struct file *file, unsign
 {
 	struct usb_mixerdev *ms = (struct usb_mixerdev *)file->private_data;
 	int i, j, val;
+	int __user *user_arg = (int __user *)arg;
 
 	if (!ms->state->usbdev)
 		return -ENODEV;
@@ -2034,7 +2021,7 @@ static int usb_audio_ioctl_mixdev(struct inode *inode, struct file *file, unsign
 		return 0;
 	}
 	if (cmd == OSS_GETVERSION)
-		return put_user(SOUND_VERSION, (int *)arg);
+		return put_user(SOUND_VERSION, user_arg);
 	if (_IOC_TYPE(cmd) != 'M' || _IOC_SIZE(cmd) != sizeof(int))
 		return -EINVAL;
 	if (_IOC_DIR(cmd) == _IOC_READ) {
@@ -2043,27 +2030,27 @@ static int usb_audio_ioctl_mixdev(struct inode *inode, struct file *file, unsign
 			val = get_rec_src(ms);
 			if (val < 0)
 				return val;
-			return put_user(val, (int *)arg);
+			return put_user(val, user_arg);
 
 		case SOUND_MIXER_DEVMASK: /* Arg contains a bit for each supported device */
 			for (val = i = 0; i < ms->numch; i++)
 				val |= 1 << ms->ch[i].osschannel;
-			return put_user(val, (int *)arg);
+			return put_user(val, user_arg);
 
 		case SOUND_MIXER_RECMASK: /* Arg contains a bit for each supported recording source */
 			for (val = i = 0; i < ms->numch; i++)
 				if (ms->ch[i].slctunitid)
 					val |= 1 << ms->ch[i].osschannel;
-			return put_user(val, (int *)arg);
+			return put_user(val, user_arg);
 
 		case SOUND_MIXER_STEREODEVS: /* Mixer channels supporting stereo */
 			for (val = i = 0; i < ms->numch; i++)
 				if (ms->ch[i].flags & (MIXFLG_STEREOIN | MIXFLG_STEREOOUT))
 					val |= 1 << ms->ch[i].osschannel;
-			return put_user(val, (int *)arg);
+			return put_user(val, user_arg);
 			
 		case SOUND_MIXER_CAPS:
-			return put_user(SOUND_CAP_EXCL_INPUT, (int *)arg);
+			return put_user(SOUND_CAP_EXCL_INPUT, user_arg);
 
 		default:
 			i = _IOC_NR(cmd);
@@ -2071,7 +2058,7 @@ static int usb_audio_ioctl_mixdev(struct inode *inode, struct file *file, unsign
 				return -EINVAL;
 			for (j = 0; j < ms->numch; j++) {
 				if (ms->ch[j].osschannel == i) {
-					return put_user(ms->ch[j].value, (int *)arg);
+					return put_user(ms->ch[j].value, user_arg);
 				}
 			}
 			return -EINVAL;
@@ -2082,7 +2069,7 @@ static int usb_audio_ioctl_mixdev(struct inode *inode, struct file *file, unsign
 	ms->modcnt++;
 	switch (_IOC_NR(cmd)) {
 	case SOUND_MIXER_RECSRC: /* Arg contains a bit for each recording source */
-		if (get_user(val, (int *)arg))
+		if (get_user(val, user_arg))
 			return -EFAULT;
 		return set_rec_src(ms, val);
 
@@ -2093,11 +2080,11 @@ static int usb_audio_ioctl_mixdev(struct inode *inode, struct file *file, unsign
 		for (j = 0; j < ms->numch && ms->ch[j].osschannel != i; j++);
 		if (j >= ms->numch)
 			return -EINVAL;
-		if (get_user(val, (int *)arg))
+		if (get_user(val, user_arg))
 			return -EFAULT;
 		if (wrmixer(ms, j, val))
 			return -EIO;
-		return put_user(ms->ch[j].value, (int *)arg);
+		return put_user(ms->ch[j].value, user_arg);
 	}
 }
 
@@ -2160,8 +2147,6 @@ static ssize_t usb_audio_read(struct file *file, char __user *buffer, size_t cou
 	unsigned int ptr;
 	int cnt, err;
 
-	if (ppos != &file->f_pos)
-		return -ESPIPE;
 	if (as->usbin.dma.mapped)
 		return -ENXIO;
 	if (!as->usbin.dma.ready && (ret = prog_dmabuf_in(as)))
@@ -2229,8 +2214,6 @@ static ssize_t usb_audio_write(struct file *file, const char __user *buffer, siz
 	unsigned int start_thr;
 	int cnt, err;
 
-	if (ppos != &file->f_pos)
-		return -ESPIPE;
 	if (as->usbout.dma.mapped)
 		return -ENXIO;
 	if (!as->usbout.dma.ready && (ret = prog_dmabuf_out(as)))
@@ -2370,6 +2353,7 @@ static int usb_audio_ioctl(struct inode *inode, struct file *file, unsigned int
 {
 	struct usb_audiodev *as = (struct usb_audiodev *)file->private_data;
 	struct usb_audio_state *s = as->state;
+	int __user *user_arg = (int __user *)arg;
 	unsigned long flags;
 	audio_buf_info abinfo;
 	count_info cinfo;
@@ -2387,7 +2371,7 @@ static int usb_audio_ioctl(struct inode *inode, struct file *file, unsigned int
 #endif
 	switch (cmd) {
 	case OSS_GETVERSION:
-		return put_user(SOUND_VERSION, (int *)arg);
+		return put_user(SOUND_VERSION, user_arg);
 
 	case SNDCTL_DSP_SYNC:
 		if (file->f_mode & FMODE_WRITE)
@@ -2399,7 +2383,7 @@ static int usb_audio_ioctl(struct inode *inode, struct file *file, unsigned int
 
 	case SNDCTL_DSP_GETCAPS:
 		return put_user(DSP_CAP_DUPLEX | DSP_CAP_REALTIME | DSP_CAP_TRIGGER | 
-				DSP_CAP_MMAP | DSP_CAP_BATCH, (int *)arg);
+				DSP_CAP_MMAP | DSP_CAP_BATCH, user_arg);
 
 	case SNDCTL_DSP_RESET:
 		if (file->f_mode & FMODE_WRITE) {
@@ -2413,7 +2397,7 @@ static int usb_audio_ioctl(struct inode *inode, struct file *file, unsigned int
 		return 0;
 
 	case SNDCTL_DSP_SPEED:
-		if (get_user(val, (int *)arg))
+		if (get_user(val, user_arg))
 			return -EFAULT;
 		if (val >= 0) {
 			if (val < 4000)
@@ -2423,10 +2407,12 @@ static int usb_audio_ioctl(struct inode *inode, struct file *file, unsigned int
 			if (set_format(as, file->f_mode, AFMT_QUERY, val))
 				return -EIO;
 		}
-		return put_user((file->f_mode & FMODE_READ) ? as->usbin.dma.srate : as->usbout.dma.srate, (int *)arg);
+		return put_user((file->f_mode & FMODE_READ) ? 
+				as->usbin.dma.srate : as->usbout.dma.srate,
+				user_arg);
 
 	case SNDCTL_DSP_STEREO:
-		if (get_user(val, (int *)arg))
+		if (get_user(val, user_arg))
 			return -EFAULT;
 		val2 = (file->f_mode & FMODE_READ) ? as->usbin.dma.format : as->usbout.dma.format;
 		if (val)
@@ -2438,7 +2424,7 @@ static int usb_audio_ioctl(struct inode *inode, struct file *file, unsigned int
 		return 0;
 
 	case SNDCTL_DSP_CHANNELS:
-		if (get_user(val, (int *)arg))
+		if (get_user(val, user_arg))
 			return -EFAULT;
 		if (val != 0) {
 			val2 = (file->f_mode & FMODE_READ) ? as->usbin.dma.format : as->usbout.dma.format;
@@ -2450,14 +2436,14 @@ static int usb_audio_ioctl(struct inode *inode, struct file *file, unsigned int
 				return -EIO;
 		}
 		val2 = (file->f_mode & FMODE_READ) ? as->usbin.dma.format : as->usbout.dma.format;
-		return put_user(AFMT_ISSTEREO(val2) ? 2 : 1, (int *)arg);
+		return put_user(AFMT_ISSTEREO(val2) ? 2 : 1, user_arg);
 
 	case SNDCTL_DSP_GETFMTS: /* Returns a mask */
 		return put_user(AFMT_U8 | AFMT_U16_LE | AFMT_U16_BE |
-				AFMT_S8 | AFMT_S16_LE | AFMT_S16_BE, (int *)arg);
+				AFMT_S8 | AFMT_S16_LE | AFMT_S16_BE, user_arg);
 
 	case SNDCTL_DSP_SETFMT: /* Selects ONE fmt*/
-		if (get_user(val, (int *)arg))
+		if (get_user(val, user_arg))
 			return -EFAULT;
 		if (val != AFMT_QUERY) {
 			if (hweight32(val) != 1)
@@ -2471,7 +2457,7 @@ static int usb_audio_ioctl(struct inode *inode, struct file *file, unsigned int
 				return -EIO;
 		}
 		val2 = (file->f_mode & FMODE_READ) ? as->usbin.dma.format : as->usbout.dma.format;
-		return put_user(val2 & ~AFMT_STEREO, (int *)arg);
+		return put_user(val2 & ~AFMT_STEREO, user_arg);
 
 	case SNDCTL_DSP_POST:
 		return 0;
@@ -2482,10 +2468,10 @@ static int usb_audio_ioctl(struct inode *inode, struct file *file, unsigned int
 			val |= PCM_ENABLE_INPUT;
 		if (file->f_mode & FMODE_WRITE && as->usbout.flags & FLG_RUNNING) 
 			val |= PCM_ENABLE_OUTPUT;
-		return put_user(val, (int *)arg);
+		return put_user(val, user_arg);
 
 	case SNDCTL_DSP_SETTRIGGER:
-		if (get_user(val, (int *)arg))
+		if (get_user(val, user_arg))
 			return -EFAULT;
 		if (file->f_mode & FMODE_READ) {
 			if (val & PCM_ENABLE_INPUT) {
@@ -2543,7 +2529,7 @@ static int usb_audio_ioctl(struct inode *inode, struct file *file, unsigned int
 		spin_lock_irqsave(&as->lock, flags);
 		val = as->usbout.dma.count;
 		spin_unlock_irqrestore(&as->lock, flags);
-		return put_user(val, (int *)arg);
+		return put_user(val, user_arg);
 
 	case SNDCTL_DSP_GETIPTR:
 		if (!(file->f_mode & FMODE_READ))
@@ -2577,14 +2563,14 @@ static int usb_audio_ioctl(struct inode *inode, struct file *file, unsigned int
 		if (file->f_mode & FMODE_WRITE) {
 			if ((val = prog_dmabuf_out(as)))
 				return val;
-			return put_user(as->usbout.dma.fragsize, (int *)arg);
+			return put_user(as->usbout.dma.fragsize, user_arg);
 		}
 		if ((val = prog_dmabuf_in(as)))
 			return val;
-		return put_user(as->usbin.dma.fragsize, (int *)arg);
+		return put_user(as->usbin.dma.fragsize, user_arg);
 
 	case SNDCTL_DSP_SETFRAGMENT:
-		if (get_user(val, (int *)arg))
+		if (get_user(val, user_arg))
 			return -EFAULT;
 		if (file->f_mode & FMODE_READ) {
 			as->usbin.dma.ossfragshift = val & 0xffff;
@@ -2612,7 +2598,7 @@ static int usb_audio_ioctl(struct inode *inode, struct file *file, unsigned int
 		if ((file->f_mode & FMODE_READ && as->usbin.dma.subdivision) ||
 		    (file->f_mode & FMODE_WRITE && as->usbout.dma.subdivision))
 			return -EINVAL;
-		if (get_user(val, (int *)arg))
+		if (get_user(val, user_arg))
 			return -EFAULT;
 		if (val != 1 && val != 2 && val != 4)
 			return -EINVAL;
@@ -2623,15 +2609,17 @@ static int usb_audio_ioctl(struct inode *inode, struct file *file, unsigned int
 		return 0;
 
 	case SOUND_PCM_READ_RATE:
-		return put_user((file->f_mode & FMODE_READ) ? as->usbin.dma.srate : as->usbout.dma.srate, (int *)arg);
+		return put_user((file->f_mode & FMODE_READ) ? 
+				as->usbin.dma.srate : as->usbout.dma.srate,
+				user_arg);
 
 	case SOUND_PCM_READ_CHANNELS:
 		val2 = (file->f_mode & FMODE_READ) ? as->usbin.dma.format : as->usbout.dma.format;
-		return put_user(AFMT_ISSTEREO(val2) ? 2 : 1, (int *)arg);
+		return put_user(AFMT_ISSTEREO(val2) ? 2 : 1, user_arg);
 
 	case SOUND_PCM_READ_BITS:
 		val2 = (file->f_mode & FMODE_READ) ? as->usbin.dma.format : as->usbout.dma.format;
-		return put_user(AFMT_IS16BIT(val2) ? 16 : 8, (int *)arg);
+		return put_user(AFMT_IS16BIT(val2) ? 16 : 8, user_arg);
 
 	case SOUND_PCM_WRITE_FILTER:
 	case SNDCTL_DSP_SETSYNCRO:
@@ -2696,7 +2684,7 @@ static int usb_audio_open(struct inode *inode, struct file *file)
 	as->open_mode |= file->f_mode & (FMODE_READ | FMODE_WRITE);
 	s->count++;
 	up(&open_sem);
-	return 0;
+	return nonseekable_open(inode, file);
 }
 
 static int usb_audio_release(struct inode *inode, struct file *file)
diff --git a/drivers/usb/class/cdc-acm.c b/drivers/usb/class/cdc-acm.c
index 0c2ca79b5..3fae8a6e4 100644
--- a/drivers/usb/class/cdc-acm.c
+++ b/drivers/usb/class/cdc-acm.c
@@ -5,6 +5,7 @@
  * Copyright (c) 1999 Pavel Machek	<pavel@suse.cz>
  * Copyright (c) 1999 Johannes Erdfelt	<johannes@erdfelt.com>
  * Copyright (c) 2000 Vojtech Pavlik	<vojtech@suse.cz>
+ * Copyright (c) 2004 Oliver Neukum	<oliver@neukum.name>
  *
  * USB Abstract Control Model driver for USB modems and ISDN adapters
  *
@@ -27,6 +28,7 @@
  *	v0.22 - probe only the control interface. if usbcore doesn't choose the
  *		config we want, sysadmin changes bConfigurationValue in sysfs.
  *	v0.23 - use softirq for rx processing, as needed by tty layer
+ *	v0.24 - change probe method to evaluate CDC union descriptor
  */
 
 /*
@@ -59,6 +61,9 @@
 #include <asm/uaccess.h>
 #include <linux/usb.h>
 #include <asm/byteorder.h>
+#include <asm/unaligned.h>
+
+#include "cdc-acm.h"
 
 /*
  * Version Information
@@ -67,102 +72,12 @@
 #define DRIVER_AUTHOR "Armin Fuerst, Pavel Machek, Johannes Erdfelt, Vojtech Pavlik"
 #define DRIVER_DESC "USB Abstract Control Model driver for USB modems and ISDN adapters"
 
-/*
- * CMSPAR, some architectures can't have space and mark parity.
- */
-
-#ifndef CMSPAR
-#define CMSPAR			0
-#endif
-
-/*
- * Major and minor numbers.
- */
-
-#define ACM_TTY_MAJOR		166
-#define ACM_TTY_MINORS		32
-
-/*
- * Requests.
- */
-
-#define USB_RT_ACM		(USB_TYPE_CLASS | USB_RECIP_INTERFACE)
-
-#define ACM_REQ_COMMAND		0x00
-#define ACM_REQ_RESPONSE	0x01
-#define ACM_REQ_SET_FEATURE	0x02
-#define ACM_REQ_GET_FEATURE	0x03
-#define ACM_REQ_CLEAR_FEATURE	0x04
-
-#define ACM_REQ_SET_LINE	0x20
-#define ACM_REQ_GET_LINE	0x21
-#define ACM_REQ_SET_CONTROL	0x22
-#define ACM_REQ_SEND_BREAK	0x23
-
-/*
- * IRQs.
- */
-
-#define ACM_IRQ_NETWORK		0x00
-#define ACM_IRQ_LINE_STATE	0x20
-
-/*
- * Output control lines.
- */
-
-#define ACM_CTRL_DTR		0x01
-#define ACM_CTRL_RTS		0x02
-
-/*
- * Input control lines and line errors.
- */
-
-#define ACM_CTRL_DCD		0x01
-#define ACM_CTRL_DSR		0x02
-#define ACM_CTRL_BRK		0x04
-#define ACM_CTRL_RI		0x08
-
-#define ACM_CTRL_FRAMING	0x10
-#define ACM_CTRL_PARITY		0x20
-#define ACM_CTRL_OVERRUN	0x40
-
-/*
- * Line speed and caracter encoding.
- */
-
-struct acm_line {
-	__u32 speed;
-	__u8 stopbits;
-	__u8 parity;
-	__u8 databits;
-} __attribute__ ((packed));
-
-/*
- * Internal driver structures.
- */
-
-struct acm {
-	struct usb_device *dev;				/* the corresponding usb device */
-	struct usb_interface *control;			/* control interface */
-	struct usb_interface *data;			/* data interface */
-	struct tty_struct *tty;				/* the corresponding tty */
-	struct urb *ctrlurb, *readurb, *writeurb;	/* urbs */
-	struct acm_line line;				/* line coding (bits, stop, parity) */
-	struct work_struct work;			/* work queue entry for line discipline waking up */
-	struct tasklet_struct bh;			/* rx processing */
-	unsigned int ctrlin;				/* input control lines (DCD, DSR, RI, break, overruns) */
-	unsigned int ctrlout;				/* output control lines (DTR, RTS) */
-	unsigned int writesize;				/* max packet size for the output bulk endpoint */
-	unsigned int used;				/* someone has this acm's device open */
-	unsigned int minor;				/* acm minor number */
-	unsigned char throttle;				/* throttled by tty layer */
-	unsigned char clocal;				/* termios CLOCAL */
-};
-
 static struct usb_driver acm_driver;
 static struct tty_driver *acm_tty_driver;
 static struct acm *acm_table[ACM_TTY_MINORS];
 
+static DECLARE_MUTEX(open_sem);
+
 #define ACM_READY(acm)	(acm && acm->dev && acm->used)
 
 /*
@@ -195,7 +110,7 @@ static void acm_ctrl_irq(struct urb *urb, struct pt_regs *regs)
 {
 	struct acm *acm = urb->context;
 	struct usb_ctrlrequest *dr = urb->transfer_buffer;
-	unsigned char *data = (unsigned char *)(dr + 1);
+	unsigned char *data;
 	int newctrl;
 	int status;
 
@@ -217,6 +132,7 @@ static void acm_ctrl_irq(struct urb *urb, struct pt_regs *regs)
 	if (!ACM_READY(acm))
 		goto exit;
 
+	data = (unsigned char *)(dr + 1);
 	switch (dr->bRequest) {
 
 		case ACM_IRQ_NETWORK:
@@ -226,7 +142,7 @@ static void acm_ctrl_irq(struct urb *urb, struct pt_regs *regs)
 
 		case ACM_IRQ_LINE_STATE:
 
-			newctrl = le16_to_cpup((__u16 *) data);
+			newctrl = le16_to_cpu(get_unaligned((__u16 *) data));
 
 			if (acm->tty && !acm->clocal && (acm->ctrlin & ~newctrl & ACM_CTRL_DCD)) {
 				dbg("calling hangup");
@@ -259,6 +175,7 @@ exit:
 static void acm_read_bulk(struct urb *urb, struct pt_regs *regs)
 {
 	struct acm *acm = urb->context;
+	dbg("Entering acm_read_bulk with status %d\n", urb->status);
 
 	if (!ACM_READY(acm))
 		return;
@@ -277,6 +194,7 @@ static void acm_rx_tasklet(unsigned long _acm)
 	struct tty_struct *tty = acm->tty;
 	unsigned char *data = urb->transfer_buffer;
 	int i = 0;
+	dbg("Entering acm_rx_tasklet");
 
 	if (urb->actual_length > 0 && !acm->throttle)  {
 		for (i = 0; i < urb->actual_length && !acm->throttle; i++) {
@@ -287,14 +205,20 @@ static void acm_rx_tasklet(unsigned long _acm)
 			}
 			tty_insert_flip_char(tty, data[i], 0);
 		}
+		dbg("Handed %d bytes to tty layer", i+1);
 		tty_flip_buffer_push(tty);
 	}
 
+	spin_lock(&acm->throttle_lock);
 	if (acm->throttle) {
+		dbg("Throtteling noticed");
 		memmove(data, data + i, urb->actual_length - i);
 		urb->actual_length -= i;
+		acm->resubmit_to_unthrottle = 1;
+		spin_unlock(&acm->throttle_lock);
 		return;
 	}
+	spin_unlock(&acm->throttle_lock);
 
 	urb->actual_length = 0;
 	urb->dev = acm->dev;
@@ -308,21 +232,25 @@ static void acm_rx_tasklet(unsigned long _acm)
 static void acm_write_bulk(struct urb *urb, struct pt_regs *regs)
 {
 	struct acm *acm = (struct acm *)urb->context;
+	dbg("Entering acm_write_bulk with status %d\n", urb->status);
 
 	if (!ACM_READY(acm))
-		return;
+		goto out;
 
 	if (urb->status)
 		dbg("nonzero write bulk status received: %d", urb->status);
 
 	schedule_work(&acm->work);
+out:
+	acm->ready_for_write = 1;
 }
 
 static void acm_softint(void *private)
 {
 	struct acm *acm = private;
 	struct tty_struct *tty = acm->tty;
-
+	dbg("Entering acm_softint.\n");
+	
 	if (!ACM_READY(acm))
 		return;
 
@@ -339,6 +267,7 @@ static void acm_softint(void *private)
 static int acm_tty_open(struct tty_struct *tty, struct file *filp)
 {
 	struct acm *acm = acm_table[tty->index];
+	dbg("Entering acm_tty_open.\n");
 
 	if (!acm || !acm->dev)
 		return -EINVAL;
@@ -346,30 +275,43 @@ static int acm_tty_open(struct tty_struct *tty, struct file *filp)
 	tty->driver_data = acm;
 	acm->tty = tty;
 
-        lock_kernel();
+        down(&open_sem);
 
-	if (acm->used++) {
-                unlock_kernel();
-                return 0;
+	if (acm->used) {
+		goto done;
         }
 
-        unlock_kernel();
-
 	acm->ctrlurb->dev = acm->dev;
-	if (usb_submit_urb(acm->ctrlurb, GFP_KERNEL))
+	if (usb_submit_urb(acm->ctrlurb, GFP_KERNEL)) {
 		dbg("usb_submit_urb(ctrl irq) failed");
+		goto bail_out;
+	}
 
 	acm->readurb->dev = acm->dev;
-	if (usb_submit_urb(acm->readurb, GFP_KERNEL))
+	if (usb_submit_urb(acm->readurb, GFP_KERNEL)) {
 		dbg("usb_submit_urb(read bulk) failed");
+		goto bail_out_and_unlink;
+	}
 
-	acm_set_control(acm, acm->ctrlout = ACM_CTRL_DTR | ACM_CTRL_RTS);
+	if (0 > acm_set_control(acm, acm->ctrlout = ACM_CTRL_DTR | ACM_CTRL_RTS))
+		goto full_bailout;
 
 	/* force low_latency on so that our tty_push actually forces the data through, 
 	   otherwise it is scheduled, and with high data rates data can get lost. */
 	tty->low_latency = 1;
 
+done:
+	acm->used++;
+	up(&open_sem);
 	return 0;
+
+full_bailout:
+	usb_unlink_urb(acm->readurb);
+bail_out_and_unlink:
+	usb_unlink_urb(acm->ctrlurb);
+bail_out:
+	up(&open_sem);
+	return -EIO;
 }
 
 static void acm_tty_close(struct tty_struct *tty, struct file *filp)
@@ -379,6 +321,7 @@ static void acm_tty_close(struct tty_struct *tty, struct file *filp)
 	if (!acm || !acm->used)
 		return;
 
+	down(&open_sem);
 	if (!--acm->used) {
 		if (acm->dev) {
 			acm_set_control(acm, acm->ctrlout = 0);
@@ -394,35 +337,40 @@ static void acm_tty_close(struct tty_struct *tty, struct file *filp)
 			kfree(acm);
 		}
 	}
+	up(&open_sem);
 }
 
 static int acm_tty_write(struct tty_struct *tty, int from_user, const unsigned char *buf, int count)
 {
 	struct acm *acm = tty->driver_data;
 	int stat;
+	dbg("Entering acm_tty_write to write %d bytes from %s space,\n", count, from_user ? "user" : "kernel");
 
 	if (!ACM_READY(acm))
 		return -EINVAL;
-	if (acm->writeurb->status == -EINPROGRESS)
+	if (!acm->ready_for_write)
 		return 0;
 	if (!count)
 		return 0;
 
 	count = (count > acm->writesize) ? acm->writesize : count;
 
+	dbg("Get %d bytes from %s space...", count, from_user ? "user" : "kernel");
 	if (from_user) {
-		if (copy_from_user(acm->writeurb->transfer_buffer, (void __user *)buf, count))
+		if (copy_from_user(acm->write_buffer, (void __user *)buf, count))
 			return -EFAULT;
 	} else
-		memcpy(acm->writeurb->transfer_buffer, buf, count);
+		memcpy(acm->write_buffer, buf, count);
+	dbg("  Successfully copied.\n");
 
 	acm->writeurb->transfer_buffer_length = count;
 	acm->writeurb->dev = acm->dev;
 
-	/* GFP_KERNEL probably works if from_user */
-	stat = usb_submit_urb(acm->writeurb, GFP_ATOMIC);
+	acm->ready_for_write = 0;
+	stat = usb_submit_urb(acm->writeurb, GFP_NOIO);
 	if (stat < 0) {
 		dbg("usb_submit_urb(write bulk) failed");
+		acm->ready_for_write = 1;
 		return stat;
 	}
 
@@ -434,7 +382,7 @@ static int acm_tty_write_room(struct tty_struct *tty)
 	struct acm *acm = tty->driver_data;
 	if (!ACM_READY(acm))
 		return -EINVAL;
-	return acm->writeurb->status == -EINPROGRESS ? 0 : acm->writesize;
+	return !acm->ready_for_write ? 0 : acm->writesize;
 }
 
 static int acm_tty_chars_in_buffer(struct tty_struct *tty)
@@ -442,7 +390,7 @@ static int acm_tty_chars_in_buffer(struct tty_struct *tty)
 	struct acm *acm = tty->driver_data;
 	if (!ACM_READY(acm))
 		return -EINVAL;
-	return acm->writeurb->status == -EINPROGRESS ? acm->writeurb->transfer_buffer_length : 0;
+	return !acm->ready_for_write ? acm->writeurb->transfer_buffer_length : 0;
 }
 
 static void acm_tty_throttle(struct tty_struct *tty)
@@ -450,7 +398,9 @@ static void acm_tty_throttle(struct tty_struct *tty)
 	struct acm *acm = tty->driver_data;
 	if (!ACM_READY(acm))
 		return;
+	spin_lock_bh(&acm->throttle_lock);
 	acm->throttle = 1;
+	spin_unlock_bh(&acm->throttle_lock);
 }
 
 static void acm_tty_unthrottle(struct tty_struct *tty)
@@ -458,9 +408,13 @@ static void acm_tty_unthrottle(struct tty_struct *tty)
 	struct acm *acm = tty->driver_data;
 	if (!ACM_READY(acm))
 		return;
+	spin_lock_bh(&acm->throttle_lock);
 	acm->throttle = 0;
-	if (acm->readurb->status != -EINPROGRESS)
+	spin_unlock_bh(&acm->throttle_lock);
+	if (acm->resubmit_to_unthrottle) {
+		acm->resubmit_to_unthrottle = 0;
 		acm_read_bulk(acm->readurb, NULL);
+	}
 }
 
 static void acm_tty_break_ctl(struct tty_struct *tty, int state)
@@ -567,77 +521,121 @@ static void acm_tty_set_termios(struct tty_struct *tty, struct termios *termios_
  * USB probe and disconnect routines.
  */
 
-#define CHECK_XFERTYPE(descr, xfer_type) (((descr)->bmAttributes & USB_ENDPOINT_XFERTYPE_MASK) == xfer_type)
-			
 static int acm_probe (struct usb_interface *intf,
 		      const struct usb_device_id *id)
 {
-	struct usb_device *dev;
+	struct union_desc *union_header = NULL;
+	char *buffer = intf->altsetting->extra;
+	int buflen = intf->altsetting->extralen;
+	struct usb_interface *control_interface;
+	struct usb_interface *data_interface;
+	struct usb_endpoint_descriptor *epctrl;
+	struct usb_endpoint_descriptor *epread;
+	struct usb_endpoint_descriptor *epwrite;
+	struct usb_device *usb_dev = interface_to_usbdev(intf);
 	struct acm *acm;
-	struct usb_host_config *cfacm;
-	struct usb_interface *data = NULL;
-	struct usb_host_interface *ifcom, *ifdata = NULL;
-	struct usb_endpoint_descriptor *epctrl = NULL;
-	struct usb_endpoint_descriptor *epread = NULL;
-	struct usb_endpoint_descriptor *epwrite = NULL;
-	int readsize, ctrlsize, minor, j;
-	unsigned char *buf;
-
-	dev = interface_to_usbdev (intf);
-
-	cfacm = dev->actconfig;
-
-	/* We know we're probe()d with the control interface. */
-	ifcom = intf->cur_altsetting;
-
-	/* ACM doesn't guarantee the data interface is
-	 * adjacent to the control interface, or that if one
-	 * is there it's not for call management ... so find
-	 * it
-	 */
-	for (j = 0; j < cfacm->desc.bNumInterfaces; j++) {
-		ifdata = cfacm->interface[j]->cur_altsetting;
-		data = cfacm->interface[j];
-
-		if (ifdata->desc.bInterfaceClass == USB_CLASS_CDC_DATA
-		    && ifdata->desc.bNumEndpoints == 2) {
-			
-			epctrl = &ifcom->endpoint[0].desc;
-			epread = &ifdata->endpoint[0].desc;
-			epwrite = &ifdata->endpoint[1].desc;
-
-			if ((epctrl->bEndpointAddress & USB_DIR_IN) != USB_DIR_IN
-			    || !CHECK_XFERTYPE(epctrl,  USB_ENDPOINT_XFER_INT)
-			    || !CHECK_XFERTYPE(epread,  USB_ENDPOINT_XFER_BULK)
-			    || !CHECK_XFERTYPE(epwrite, USB_ENDPOINT_XFER_BULK)
-			    || ((epread->bEndpointAddress & USB_DIR_IN)
-			        ^ (epwrite->bEndpointAddress & USB_DIR_IN)) != USB_DIR_IN) {
-				/* not suitable */
-				goto next_interface;
-			}
-			
-			if ((epread->bEndpointAddress & USB_DIR_IN) != USB_DIR_IN) {
-				/* descriptors are swapped */
-				epread = &ifdata->endpoint[1].desc;
-				epwrite = &ifdata->endpoint[0].desc;
-			}
-			dev_dbg(&intf->dev, "found data interface at %d\n", j);
-			break;
-		} else {
-next_interface:
-			ifdata = NULL;
-			data = NULL;
+	int minor;
+	int ctrlsize,readsize;
+	u8 *buf;
+	u8 ac_management_function = 0;
+	u8 call_management_function = 0;
+	int call_interface_num = -1;
+	int data_interface_num;
+
+	if (!buffer) {
+		err("Wierd descriptor references");
+		return -EINVAL;
+	}
+
+	while (buflen > 0) {
+		if (buffer [1] != USB_DT_CS_INTERFACE) {
+			err("skipping garbage");
+			goto next_desc;
 		}
+
+		switch (buffer [2]) {
+			case CDC_UNION_TYPE: /* we've found it */
+				if (union_header) {
+					err("More than one union descriptor, skipping ...");
+					goto next_desc;
+				}
+				union_header = (struct union_desc *)buffer;
+				break;
+			case CDC_COUNTRY_TYPE: /* maybe somehow export */
+				break; /* for now we ignore it */
+			case CDC_AC_MANAGEMENT_TYPE:
+				ac_management_function = buffer[3];
+				break;
+			case CDC_CALL_MANAGEMENT_TYPE:
+				call_management_function = buffer[3];
+				call_interface_num = buffer[4];
+				if ((call_management_function & 3) != 3)
+					err("This device cannot do calls on its own. It is no modem.");
+				break;
+				
+			default:
+				err("Ignoring extra header");
+				break;
+			}
+next_desc:
+		buflen -= buffer[0];
+		buffer += buffer[0];
 	}
 
-	/* there's been a problem */
-	if (!ifdata) {
-		dev_dbg(&intf->dev, "data interface not found\n");
+	if (!union_header) {
+		dev_dbg(&intf->dev,"No union descriptor, giving up\n");
 		return -ENODEV;
+	}
+
+	control_interface = usb_ifnum_to_if(usb_dev, union_header->bMasterInterface0);
+	data_interface = usb_ifnum_to_if(usb_dev, (data_interface_num = union_header->bSlaveInterface0));
+	if (!control_interface || !data_interface) {
+		dev_dbg(&intf->dev,"no interfaces\n");
+		return -ENODEV;
+	}
+	
+	if (data_interface_num != call_interface_num)
+		dev_dbg(&intf->dev,"Seperate call control interface. That is not fully supported.");
+
+	if (usb_interface_claimed(data_interface)) { /* valid in this context */
+		dev_dbg(&intf->dev,"The data interface isn't available\n");
+		return -EBUSY;
+	}
+
+	/*workaround for switched interfaces */
+	if (data_interface->cur_altsetting->desc.bInterfaceClass != CDC_DATA_INTERFACE_TYPE) {
+		if (control_interface->cur_altsetting->desc.bInterfaceClass == CDC_DATA_INTERFACE_TYPE) {
+			struct usb_interface *t;
+			dev_dbg(&intf->dev,"Your device has switched interfaces.\n");
 
+			t = control_interface;
+			control_interface = data_interface;
+			data_interface = t;
+		} else {
+			return -EINVAL;
+		}
 	}
+	if (data_interface->cur_altsetting->desc.bNumEndpoints < 2)
+		return -EINVAL;
+
+	epctrl = &control_interface->cur_altsetting->endpoint[0].desc;
+	epread = &data_interface->cur_altsetting->endpoint[0].desc;
+	epwrite = &data_interface->cur_altsetting->endpoint[1].desc;
 
+
+	/* workaround for switched endpoints */
+	if ((epread->bEndpointAddress & USB_DIR_IN) != USB_DIR_IN) {
+		/* descriptors are swapped */
+		struct usb_endpoint_descriptor *t;
+		dev_dbg(&intf->dev,"The data interface has switched endpoints\n");
+		
+		t = epread;
+		epread = epwrite;
+		epwrite = t;
+	}
+	dbg("interfaces are valid");
 	for (minor = 0; minor < ACM_TTY_MINORS && acm_table[minor]; minor++);
+
 	if (acm_table[minor]) {
 		err("no more free acm devices");
 		return -ENODEV;
@@ -645,76 +643,77 @@ next_interface:
 
 	if (!(acm = kmalloc(sizeof(struct acm), GFP_KERNEL))) {
 		dev_dbg(&intf->dev, "out of memory (acm kmalloc)\n");
-		return -ENOMEM;
+		goto alloc_fail;
 	}
-	
 	memset(acm, 0, sizeof(struct acm));
 
 	ctrlsize = epctrl->wMaxPacketSize;
 	readsize = epread->wMaxPacketSize;
 	acm->writesize = epwrite->wMaxPacketSize;
-	acm->control = intf;
-	acm->data = data;
+	acm->control = control_interface;
+	acm->data = data_interface;
 	acm->minor = minor;
-	acm->dev = dev;
-
+	acm->dev = usb_dev;
+	acm->ctrl_caps = ac_management_function;
+	acm->ctrlsize = ctrlsize;
+	acm->readsize = readsize;
 	acm->bh.func = acm_rx_tasklet;
 	acm->bh.data = (unsigned long) acm;
 	INIT_WORK(&acm->work, acm_softint, acm);
+	spin_lock_init(&acm->throttle_lock);
+	acm->ready_for_write = 1;
 
-	if (!(buf = kmalloc(ctrlsize + readsize + acm->writesize, GFP_KERNEL))) {
-		dev_dbg(&intf->dev, "out of memory (buf kmalloc)\n");
-		kfree(acm);
-		return -ENOMEM;
+	buf = usb_buffer_alloc(usb_dev, ctrlsize, GFP_KERNEL, &acm->ctrl_dma);
+	if (!buf) {
+		dev_dbg(&intf->dev, "out of memory (ctrl buffer alloc)\n");
+		goto alloc_fail2;
 	}
+	acm->ctrl_buffer = buf;
+
+	buf = usb_buffer_alloc(usb_dev, readsize, GFP_KERNEL, &acm->read_dma);
+	if (!buf) {
+		dev_dbg(&intf->dev, "out of memory (read buffer alloc)\n");
+		goto alloc_fail3;
+	}
+	acm->read_buffer = buf;
+
+	buf = usb_buffer_alloc(usb_dev, acm->writesize, GFP_KERNEL, &acm->write_dma);
+	if (!buf) {
+		dev_dbg(&intf->dev, "out of memory (write buffer alloc)\n");
+		goto alloc_fail4;
+	}
+	acm->write_buffer = buf;	
 
 	acm->ctrlurb = usb_alloc_urb(0, GFP_KERNEL);
 	if (!acm->ctrlurb) {
 		dev_dbg(&intf->dev, "out of memory (ctrlurb kmalloc)\n");
-		kfree(acm);
-		kfree(buf);
-		return -ENOMEM;
+		goto alloc_fail5;
 	}
 	acm->readurb = usb_alloc_urb(0, GFP_KERNEL);
 	if (!acm->readurb) {
 		dev_dbg(&intf->dev, "out of memory (readurb kmalloc)\n");
-		usb_free_urb(acm->ctrlurb);
-		kfree(acm);
-		kfree(buf);
-		return -ENOMEM;
+		goto alloc_fail6;
 	}
 	acm->writeurb = usb_alloc_urb(0, GFP_KERNEL);
 	if (!acm->writeurb) {
 		dev_dbg(&intf->dev, "out of memory (writeurb kmalloc)\n");
-		usb_free_urb(acm->readurb);
-		usb_free_urb(acm->ctrlurb);
-		kfree(acm);
-		kfree(buf);
-		return -ENOMEM;
+		goto alloc_fail7;
 	}
 
-	usb_fill_int_urb(acm->ctrlurb, dev, usb_rcvintpipe(dev, epctrl->bEndpointAddress),
-		buf, ctrlsize, acm_ctrl_irq, acm, epctrl->bInterval);
+	usb_fill_int_urb(acm->ctrlurb, usb_dev, usb_rcvintpipe(usb_dev, epctrl->bEndpointAddress),
+			 acm->ctrl_buffer, ctrlsize, acm_ctrl_irq, acm, epctrl->bInterval);
+	acm->ctrlurb->transfer_flags |= URB_NO_TRANSFER_DMA_MAP;
+	acm->ctrlurb->transfer_dma = acm->ctrl_dma;
 
-	usb_fill_bulk_urb(acm->readurb, dev, usb_rcvbulkpipe(dev, epread->bEndpointAddress),
-		buf += ctrlsize, readsize, acm_read_bulk, acm);
-	acm->readurb->transfer_flags |= URB_NO_FSBR;
+	usb_fill_bulk_urb(acm->readurb, usb_dev, usb_rcvbulkpipe(usb_dev, epread->bEndpointAddress),
+			  acm->read_buffer, readsize, acm_read_bulk, acm);
+	acm->readurb->transfer_flags |= URB_NO_FSBR | URB_NO_TRANSFER_DMA_MAP;
+	acm->readurb->transfer_dma = acm->read_dma;
 
-	usb_fill_bulk_urb(acm->writeurb, dev, usb_sndbulkpipe(dev, epwrite->bEndpointAddress),
-		buf += readsize, acm->writesize, acm_write_bulk, acm);
-	acm->writeurb->transfer_flags |= URB_NO_FSBR;
-
-	if ( (j = usb_driver_claim_interface(&acm_driver, data, acm)) != 0) {
-		err("claim failed");
-		usb_free_urb(acm->ctrlurb);
-		usb_free_urb(acm->readurb);
-		usb_free_urb(acm->writeurb);
-		kfree(acm);
-		kfree(buf);
-		return j;
-	} 
-
-	tty_register_device(acm_tty_driver, minor, &intf->dev);
+	usb_fill_bulk_urb(acm->writeurb, usb_dev, usb_sndbulkpipe(usb_dev, epwrite->bEndpointAddress),
+			  acm->write_buffer, acm->writesize, acm_write_bulk, acm);
+	acm->writeurb->transfer_flags |= URB_NO_FSBR | URB_NO_TRANSFER_DMA_MAP;
+	acm->writeurb->transfer_dma = acm->write_dma;
 
 	dev_info(&intf->dev, "ttyACM%d: USB ACM device\n", minor);
 
@@ -724,21 +723,41 @@ next_interface:
 	acm->line.databits = 8;
 	acm_set_line(acm, &acm->line);
 
+	usb_driver_claim_interface(&acm_driver, data_interface, acm);
+
+	tty_register_device(acm_tty_driver, minor, &intf->dev);
+
 	acm_table[minor] = acm;
 	usb_set_intfdata (intf, acm);
 	return 0;
+
+alloc_fail7:
+	usb_free_urb(acm->readurb);
+alloc_fail6:
+	usb_free_urb(acm->ctrlurb);
+alloc_fail5:
+	usb_buffer_free(usb_dev, acm->writesize, acm->write_buffer, acm->write_dma);
+alloc_fail4:
+	usb_buffer_free(usb_dev, readsize, acm->read_buffer, acm->read_dma);
+alloc_fail3:
+	usb_buffer_free(usb_dev, ctrlsize, acm->ctrl_buffer, acm->ctrl_dma);
+alloc_fail2:
+	kfree(acm);
+alloc_fail:
+	return -ENOMEM;
 }
-#undef CHECK_XFERTYPE
 
 static void acm_disconnect(struct usb_interface *intf)
 {
 	struct acm *acm = usb_get_intfdata (intf);
+	struct usb_device *usb_dev = interface_to_usbdev(intf);
 
 	if (!acm || !acm->dev) {
 		dbg("disconnect on nonexisting interface");
 		return;
 	}
 
+	down(&open_sem);
 	acm->dev = NULL;
 	usb_set_intfdata (intf, NULL);
 
@@ -746,7 +765,11 @@ static void acm_disconnect(struct usb_interface *intf)
 	usb_unlink_urb(acm->readurb);
 	usb_unlink_urb(acm->writeurb);
 
-	kfree(acm->ctrlurb->transfer_buffer);
+	flush_scheduled_work(); /* wait for acm_softint */
+
+	usb_buffer_free(usb_dev, acm->writesize, acm->write_buffer, acm->write_dma);
+	usb_buffer_free(usb_dev, acm->readsize, acm->read_buffer, acm->read_dma);
+	usb_buffer_free(usb_dev, acm->ctrlsize, acm->ctrl_buffer, acm->ctrl_dma);
 
 	usb_driver_release_interface(&acm_driver, acm->data);
 
@@ -757,9 +780,12 @@ static void acm_disconnect(struct usb_interface *intf)
 		usb_free_urb(acm->readurb);
 		usb_free_urb(acm->writeurb);
 		kfree(acm);
+		up(&open_sem);
 		return;
 	}
 
+	up(&open_sem);
+
 	if (acm->tty)
 		tty_hangup(acm->tty);
 }
diff --git a/drivers/usb/class/cdc-acm.h b/drivers/usb/class/cdc-acm.h
index 2e4f49a0c..bf72f278b 100644
--- a/drivers/usb/class/cdc-acm.h
+++ b/drivers/usb/class/cdc-acm.h
@@ -86,17 +86,23 @@ struct acm {
 	struct usb_interface *data;			/* data interface */
 	struct tty_struct *tty;				/* the corresponding tty */
 	struct urb *ctrlurb, *readurb, *writeurb;	/* urbs */
+	u8 *ctrl_buffer, *read_buffer, *write_buffer;	/* buffers of urbs */
+	dma_addr_t ctrl_dma, read_dma, write_dma;	/* dma handles of buffers */
 	struct acm_line line;				/* line coding (bits, stop, parity) */
 	struct work_struct work;			/* work queue entry for line discipline waking up */
 	struct tasklet_struct bh;			/* rx processing */
+	spinlock_t throttle_lock;			/* synchronize throtteling and read callback */
 	unsigned int ctrlin;				/* input control lines (DCD, DSR, RI, break, overruns) */
 	unsigned int ctrlout;				/* output control lines (DTR, RTS) */
 	unsigned int writesize;				/* max packet size for the output bulk endpoint */
+	unsigned int readsize,ctrlsize;			/* buffer sizes for freeing */
 	unsigned int used;				/* someone has this acm's device open */
 	unsigned int minor;				/* acm minor number */
 	unsigned char throttle;				/* throttled by tty layer */
 	unsigned char clocal;				/* termios CLOCAL */
 	unsigned char ready_for_write;			/* write urb can be used */
+	unsigned char resubmit_to_unthrottle;		/* throtteling has disabled the read urb */
+	unsigned int ctrl_caps;				/* control capabilities from the class specific header */
 };
 
 /* "Union Functional Descriptor" from CDC spec 5.2.3.X */
@@ -110,6 +116,12 @@ struct union_desc {
 	/* ... and there could be other slave interfaces */
 } __attribute__ ((packed));
 
-#define CDC_UNION_TYPE		0x06
+/* class specific descriptor types */
+#define CDC_CALL_MANAGEMENT_TYPE	0x01
+#define CDC_AC_MANAGEMENT_TYPE		0x02
+#define CDC_UNION_TYPE			0x06
+#define CDC_COUNTRY_TYPE		0x07
+
 #define CDC_DATA_INTERFACE_TYPE	0x0a
 
+
diff --git a/drivers/usb/class/usb-midi.c b/drivers/usb/class/usb-midi.c
index 3546b9b96..6a6dbac49 100644
--- a/drivers/usb/class/usb-midi.c
+++ b/drivers/usb/class/usb-midi.c
@@ -646,9 +646,6 @@ static ssize_t usb_midi_read(struct file *file, char __user *buffer, size_t coun
 	ssize_t ret;
 	DECLARE_WAITQUEUE(wait, current);
 
-	if ( ppos != &file->f_pos ) {
-		return -ESPIPE;
-	}
 	if ( !access_ok(VERIFY_READ, buffer, count) ) {
 		return -EFAULT;
 	}
@@ -728,9 +725,6 @@ static ssize_t usb_midi_write(struct file *file, const char __user *buffer, size
 	ssize_t ret;
 	unsigned long int flags;
 
-	if ( ppos != &file->f_pos ) {
-		return -ESPIPE;
-	}
 	if ( !access_ok(VERIFY_READ, buffer, count) ) {
 		return -EFAULT;
 	}
@@ -920,7 +914,7 @@ static int usb_midi_open(struct inode *inode, struct file *file)
 	printk(KERN_INFO "usb-midi: Open Succeeded. minor= %d.\n", minor);
 #endif
 
-	return 0; /** Success. **/
+	return nonseekable_open(inode, file); /** Success. **/
 }
 
 
@@ -951,7 +945,7 @@ static int usb_midi_release(struct inode *inode, struct file *file)
 	if ( m->open_mode & FMODE_READ ) {
 	        unsigned long int flagsep;
 	        spin_lock_irqsave( &m->min.ep->lock, flagsep );
-                m->min.ep->cables[m->min.cableId] = 0; // discard cable
+                m->min.ep->cables[m->min.cableId] = NULL; // discard cable
                 m->min.ep->readers -= 1;
 		m->open_mode &= ~FMODE_READ;
 		if ( m->min.ep->readers == 0 &&
@@ -967,7 +961,7 @@ static int usb_midi_release(struct inode *inode, struct file *file)
 	up(&open_sem);
 	wake_up(&open_wait);
 
-	file->private_data = 0;
+	file->private_data = NULL;
 	return 0;
 }
 
@@ -1294,7 +1288,7 @@ static struct usb_midi_device *parse_descriptor( struct usb_device *d, unsigned
 	unsigned char jack2string[256];
 #endif
 
-	u = 0;
+	u = NULL;
 	/* find audiocontrol interface */
 	p1 = find_csinterface_descriptor( buffer, bufSize, NULL,
 					  MS_HEADER, ifnum, altSetting);
@@ -1314,7 +1308,7 @@ static struct usb_midi_device *parse_descriptor( struct usb_device *d, unsigned
 	if ( !u ) {
 		return NULL;
 	}
-	u->deviceName = 0;
+	u->deviceName = NULL;
 	u->idVendor = d->descriptor.idVendor;
 	u->idProduct = d->descriptor.idProduct;
 	u->interface = ifnum;
@@ -1388,7 +1382,7 @@ static struct usb_midi_device *parse_descriptor( struct usb_device *d, unsigned
 
 	if (quirks==0) {
 		/* MIDISTREAM */
-		p2 = 0;
+		p2 = NULL;
 		for (p1 = find_descriptor(buffer, bufSize, NULL, USB_DT_ENDPOINT,
 					  ifnum, altSetting ); p1; p1 = next ) {
 			next = find_descriptor(buffer, bufSize, p1, USB_DT_ENDPOINT,
@@ -1397,7 +1391,7 @@ static struct usb_midi_device *parse_descriptor( struct usb_device *d, unsigned
 					     ifnum, altSetting ); 
 
 			if ( p2 && next && ( p2 > next ) )
-				p2 = 0;
+				p2 = NULL;
 
 			if ( p1[0] < 9 || !p2 || p2[0] < 4 )
 				continue;
@@ -1940,8 +1934,8 @@ static int detect_by_hand(struct usb_device *d, unsigned int ifnum, struct usb_m
 	if ( ucable < 0 || ucable > 15 )
 		ucable = 0;
 
-	u.deviceName = 0; /* A flag for alloc_usb_midi_device to get device name
-			     from device. */
+	u.deviceName = NULL; /* A flag for alloc_usb_midi_device to get device
+				name from device. */
 	u.idVendor   = uvendor;
 	u.idProduct  = uproduct;
 	u.interface  = uinterface;
diff --git a/drivers/usb/class/usblp.c b/drivers/usb/class/usblp.c
index 8836be095..b6da40067 100644
--- a/drivers/usb/class/usblp.c
+++ b/drivers/usb/class/usblp.c
@@ -75,6 +75,7 @@
 #define IOCNR_HP_SET_CHANNEL		4
 #define IOCNR_GET_BUS_ADDRESS		5
 #define IOCNR_GET_VID_PID		6
+#define IOCNR_SOFT_RESET		7
 /* Get device_id string: */
 #define LPIOC_GET_DEVICE_ID(len) _IOC(_IOC_READ, 'P', IOCNR_GET_DEVICE_ID, len)
 /* The following ioctls were added for http://hpoj.sourceforge.net: */
@@ -90,6 +91,8 @@
 #define LPIOC_GET_BUS_ADDRESS(len) _IOC(_IOC_READ, 'P', IOCNR_GET_BUS_ADDRESS, len)
 /* Get two-int array: [0]=vendor ID, [1]=product ID: */
 #define LPIOC_GET_VID_PID(len) _IOC(_IOC_READ, 'P', IOCNR_GET_VID_PID, len)
+/* Perform class specific soft reset */
+#define LPIOC_SOFT_RESET _IOC(_IOC_NONE, 'P', IOCNR_SOFT_RESET, 0);
 
 /*
  * A DEVICE_ID string may include the printer's serial number.
@@ -587,6 +590,13 @@ static int usblp_ioctl(struct inode *inode, struct file *file, unsigned int cmd,
 					usblp->minor, twoints[0], twoints[1]);
 				break;
 
+			case IOCNR_SOFT_RESET:
+				if (_IOC_DIR(cmd) != _IOC_NONE) {
+					retval = -EINVAL;
+					goto done;
+				}
+				retval = usblp_reset(usblp);
+				break;
 			default:
 				retval = -ENOTTY;
 		}
@@ -761,6 +771,7 @@ static ssize_t usblp_read(struct file *file, char __user *buffer, size_t count,
 			usblp->minor, usblp->readurb->status);
 		usblp->readurb->dev = usblp->dev;
  		usblp->readcount = 0;
+		usblp->rcomplete = 0;
 		if (usb_submit_urb(usblp->readurb, GFP_KERNEL) < 0)
 			dbg("error submitting urb");
 		count = -EIO;
@@ -840,7 +851,7 @@ static int usblp_probe(struct usb_interface *intf,
 		       const struct usb_device_id *id)
 {
 	struct usb_device *dev = interface_to_usbdev (intf);
-	struct usblp *usblp = 0;
+	struct usblp *usblp = NULL;
 	int protocol;
 	int retval;
 
@@ -1008,7 +1019,7 @@ static int usblp_select_alts(struct usblp *usblp)
 			continue;
 
 		/* Look for bulk OUT and IN endpoints. */
-		epwrite = epread = 0;
+		epwrite = epread = NULL;
 		for (e = 0; e < ifd->desc.bNumEndpoints; e++) {
 			epd = &ifd->endpoint[e].desc;
 
diff --git a/drivers/usb/core/buffer.c b/drivers/usb/core/buffer.c
index a649e32d9..1e2a42ad3 100644
--- a/drivers/usb/core/buffer.c
+++ b/drivers/usb/core/buffer.c
@@ -94,7 +94,7 @@ void hcd_buffer_destroy (struct usb_hcd *hcd)
 		struct dma_pool		*pool = hcd->pool [i];
 		if (pool) {
 			dma_pool_destroy (pool);
-			hcd->pool [i] = 0;
+			hcd->pool[i] = NULL;
 		}
 	}
 }
diff --git a/drivers/usb/core/config.c b/drivers/usb/core/config.c
index 06f667d33..ae7ec7405 100644
--- a/drivers/usb/core/config.c
+++ b/drivers/usb/core/config.c
@@ -414,7 +414,7 @@ void usb_destroy_configuration(struct usb_device *dev)
 			kfree(dev->rawdescriptors[i]);
 
 		kfree(dev->rawdescriptors);
-		dev->rawdescriptors = 0;
+		dev->rawdescriptors = NULL;
 	}
 
 	for (c = 0; c < dev->descriptor.bNumConfigurations; c++) {
@@ -426,7 +426,7 @@ void usb_destroy_configuration(struct usb_device *dev)
 		}
 	}
 	kfree(dev->config);
-	dev->config = 0;
+	dev->config = NULL;
 }
 
 
diff --git a/drivers/usb/core/devices.c b/drivers/usb/core/devices.c
index 30b4378aa..5541363b6 100644
--- a/drivers/usb/core/devices.c
+++ b/drivers/usb/core/devices.c
@@ -589,6 +589,8 @@ static ssize_t usb_device_read(struct file *file, char __user *buf, size_t nbyte
 		bus = list_entry(buslist, struct usb_bus, bus_list);
 
 		/* recurse through all children of the root hub */
+		if (!bus->root_hub)
+			continue;
 		down(&bus->root_hub->serialize);
 		ret = usb_device_dump(&buf, &nbytes, &skip_bytes, ppos, bus->root_hub, bus, 0, 0, 0);
 		up(&bus->root_hub->serialize);
diff --git a/drivers/usb/core/devio.c b/drivers/usb/core/devio.c
index 29799129a..6f969a4da 100644
--- a/drivers/usb/core/devio.c
+++ b/drivers/usb/core/devio.c
@@ -269,7 +269,7 @@ static void async_completed(struct urb *urb, struct pt_regs *regs)
 		sinfo.si_signo = as->signr;
 		sinfo.si_errno = as->urb->status;
 		sinfo.si_code = SI_ASYNCIO;
-		sinfo.si_addr = (void *)as->userurb;
+		sinfo.si_addr = as->userurb;
 		send_sig_info(as->signr, &sinfo, as->task);
 	}
         wake_up(&ps->wait);
@@ -290,8 +290,11 @@ static void destroy_async (struct dev_state *ps, struct list_head *list)
 		spin_lock_irqsave(&ps->lock, flags);
 	}
 	spin_unlock_irqrestore(&ps->lock, flags);
-	while ((as = async_getcompleted(ps)))
+	as = async_getcompleted(ps);
+	while (as) {
 		free_async(as);
+		as = async_getcompleted(ps);
+	}
 }
 
 static void destroy_async_on_interface (struct dev_state *ps, unsigned int ifnum)
@@ -558,7 +561,7 @@ static int proc_control(struct dev_state *ps, void __user *arg)
 			if (usbfs_snoop) {
 				dev_info(&dev->dev, "control read: data ");
 				for (j = 0; j < ctrl.wLength; ++j)
-					printk ("%02x ", (unsigned char)((char *)ctrl.data)[j]);
+					printk ("%02x ", (unsigned char)(tbuf)[j]);
 				printk("\n");
 			}
 			if (copy_to_user(ctrl.data, tbuf, ctrl.wLength)) {
@@ -578,7 +581,7 @@ static int proc_control(struct dev_state *ps, void __user *arg)
 		if (usbfs_snoop) {
 			dev_info(&dev->dev, "control write: data: ");
 			for (j = 0; j < ctrl.wLength; ++j)
-				printk ("%02x ", (unsigned char)((char *)ctrl.data)[j]);
+				printk ("%02x ", (unsigned char)(tbuf)[j]);
 			printk("\n");
 		}
 		i = usb_control_msg(dev, usb_sndctrlpipe(dev, 0), ctrl.bRequest, ctrl.bRequestType,
@@ -968,29 +971,27 @@ static int proc_unlinkurb(struct dev_state *ps, void __user *arg)
 static int processcompl(struct async *as)
 {
 	struct urb *urb = as->urb;
+	struct usbdevfs_urb __user *userurb = as->userurb;
 	unsigned int i;
 
 	if (as->userbuffer)
 		if (copy_to_user(as->userbuffer, urb->transfer_buffer, urb->transfer_buffer_length))
 			return -EFAULT;
-	if (put_user(urb->status,
-		     &((struct usbdevfs_urb *)as->userurb)->status))
+	if (put_user(urb->status, &userurb->status))
 		return -EFAULT;
-	if (put_user(urb->actual_length,
-		     &((struct usbdevfs_urb *)as->userurb)->actual_length))
+	if (put_user(urb->actual_length, &userurb->actual_length))
 		return -EFAULT;
-	if (put_user(urb->error_count,
-		     &((struct usbdevfs_urb *)as->userurb)->error_count))
+	if (put_user(urb->error_count, &userurb->error_count))
 		return -EFAULT;
 
 	if (!(usb_pipeisoc(urb->pipe)))
 		return 0;
 	for (i = 0; i < urb->number_of_packets; i++) {
 		if (put_user(urb->iso_frame_desc[i].actual_length,
-			     &((struct usbdevfs_urb *)as->userurb)->iso_frame_desc[i].actual_length))
+			     &userurb->iso_frame_desc[i].actual_length))
 			return -EFAULT;
 		if (put_user(urb->iso_frame_desc[i].status,
-			     &((struct usbdevfs_urb *)as->userurb)->iso_frame_desc[i].status))
+			     &userurb->iso_frame_desc[i].status))
 			return -EFAULT;
 	}
 	return 0;
@@ -1089,10 +1090,10 @@ static int proc_ioctl (struct dev_state *ps, void __user *arg)
 {
 	struct usbdevfs_ioctl	ctrl;
 	int			size;
-	void			*buf = 0;
+	void			*buf = NULL;
 	int			retval = 0;
-	struct usb_interface    *intf = 0;
-	struct usb_driver       *driver = 0;
+	struct usb_interface    *intf = NULL;
+	struct usb_driver       *driver = NULL;
 
 	/* get input parameters and alloc buffer */
 	if (copy_from_user(&ctrl, arg, sizeof (ctrl)))
diff --git a/drivers/usb/core/file.c b/drivers/usb/core/file.c
index 39fdceaf5..c74404332 100644
--- a/drivers/usb/core/file.c
+++ b/drivers/usb/core/file.c
@@ -79,14 +79,25 @@ static struct class usb_class = {
 
 int usb_major_init(void)
 {
-	if (register_chrdev(USB_MAJOR, "usb", &usb_fops)) {
+	int error;
+
+	error = register_chrdev(USB_MAJOR, "usb", &usb_fops);
+	if (error) {
 		err("unable to get major %d for usb devices", USB_MAJOR);
-		return -EBUSY;
+		goto out;
+	}
+
+	error = class_register(&usb_class);
+	if (error) {
+		err("class_register failed for usb devices");
+		unregister_chrdev(USB_MAJOR, "usb");
+		goto out;
 	}
 
 	devfs_mk_dir("usb");
-	class_register(&usb_class);
-	return 0;
+
+out:
+	return error;
 }
 
 void usb_major_cleanup(void)
diff --git a/drivers/usb/core/hcd-pci.c b/drivers/usb/core/hcd-pci.c
index da209adc3..e7a7ba513 100644
--- a/drivers/usb/core/hcd-pci.c
+++ b/drivers/usb/core/hcd-pci.c
@@ -229,7 +229,6 @@ EXPORT_SYMBOL (usb_hcd_pci_probe);
 void usb_hcd_pci_remove (struct pci_dev *dev)
 {
 	struct usb_hcd		*hcd;
-	struct usb_device	*hub;
 
 	hcd = pci_get_drvdata(dev);
 	if (!hcd)
@@ -239,17 +238,16 @@ void usb_hcd_pci_remove (struct pci_dev *dev)
 	if (in_interrupt ())
 		BUG ();
 
-	hub = hcd->self.root_hub;
 	if (HCD_IS_RUNNING (hcd->state))
 		hcd->state = USB_STATE_QUIESCING;
 
 	dev_dbg (hcd->self.controller, "roothub graceful disconnect\n");
-	usb_disconnect (&hub);
+	usb_disconnect (&hcd->self.root_hub);
 
 	hcd->driver->stop (hcd);
 	hcd_buffer_destroy (hcd);
 	hcd->state = USB_STATE_HALT;
-	pci_set_drvdata (dev, 0);
+	pci_set_drvdata(dev, NULL);
 
 	free_irq (hcd->irq, hcd);
 	if (hcd->driver->flags & HCD_MEMORY) {
diff --git a/drivers/usb/core/hcd.c b/drivers/usb/core/hcd.c
index 04a8b324d..cd2268ad1 100644
--- a/drivers/usb/core/hcd.c
+++ b/drivers/usb/core/hcd.c
@@ -102,6 +102,9 @@ EXPORT_SYMBOL_GPL (usb_bus_list_lock);
 /* used when updating hcd data */
 static spinlock_t hcd_data_lock = SPIN_LOCK_UNLOCKED;
 
+/* wait queue for synchronous unlinks */
+DECLARE_WAIT_QUEUE_HEAD(usb_kill_urb_queue);
+
 /*-------------------------------------------------------------------------*/
 
 /*
@@ -326,7 +329,7 @@ static int rh_call_control (struct usb_hcd *hcd, struct urb *urb)
 {
 	struct usb_ctrlrequest *cmd;
  	u16		typeReq, wValue, wIndex, wLength;
-	const u8	*bufp = 0;
+	const u8	*bufp = NULL;
 	u8		*ubuf = urb->transfer_buffer;
 	int		len = 0;
 	int		patch_wakeup = 0;
@@ -536,7 +539,7 @@ static void rh_report_status (unsigned long ptr)
 		hcd->rh_timer.data = 0;
 		urb->actual_length = length;
 		urb->status = 0;
-		urb->hcpriv = 0;
+		urb->hcpriv = NULL;
 	} else
 		mod_timer (&hcd->rh_timer, jiffies + HZ/4);
 	spin_unlock (&hcd_data_lock);
@@ -569,7 +572,7 @@ static int rh_urb_enqueue (struct usb_hcd *hcd, struct urb *urb)
 
 /*-------------------------------------------------------------------------*/
 
-void usb_rh_status_dequeue (struct usb_hcd *hcd, struct urb *urb)
+int usb_rh_status_dequeue (struct usb_hcd *hcd, struct urb *urb)
 {
 	unsigned long	flags;
 
@@ -578,9 +581,10 @@ void usb_rh_status_dequeue (struct usb_hcd *hcd, struct urb *urb)
 	hcd->rh_timer.data = 0;
 
 	local_irq_save (flags);
-	urb->hcpriv = 0;
+	urb->hcpriv = NULL;
 	usb_hcd_giveback_urb (hcd, urb, NULL);
 	local_irq_restore (flags);
+	return 0;
 }
 
 /*-------------------------------------------------------------------------*/
@@ -622,9 +626,9 @@ static struct class usb_host_class = {
 	.release	= &usb_host_release,
 };
 
-void usb_host_init(void)
+int usb_host_init(void)
 {
-	class_register(&usb_host_class);
+	return class_register(&usb_host_class);
 }
 
 void usb_host_cleanup(void)
@@ -764,8 +768,9 @@ EXPORT_SYMBOL (usb_deregister_bus);
  *
  * The USB host controller calls this function to register the root hub
  * properly with the USB subsystem.  It sets up the device properly in
- * the device model tree, and then calls usb_new_device() to register the
- * usb device.  It also assigns the root hub's USB address (always 1).
+ * the device tree and stores the root_hub pointer in the bus structure,
+ * then calls usb_new_device() to register the usb device.  It also
+ * assigns the root hub's USB address (always 1).
  */
 int usb_register_root_hub (struct usb_device *usb_dev, struct device *parent_dev)
 {
@@ -777,7 +782,10 @@ int usb_register_root_hub (struct usb_device *usb_dev, struct device *parent_dev
 	memset (&usb_dev->bus->devmap.devicemap, 0,
 			sizeof usb_dev->bus->devmap.devicemap);
 	set_bit (devnum, usb_dev->bus->devmap.devicemap);
-	usb_dev->state = USB_STATE_ADDRESS;
+	usb_set_device_state(usb_dev, USB_STATE_ADDRESS);
+
+	down (&usb_bus_list_lock);
+	usb_dev->bus->root_hub = usb_dev;
 
 	usb_dev->epmaxpacketin[0] = usb_dev->epmaxpacketout[0] = 64;
 	retval = usb_get_device_descriptor(usb_dev, USB_DT_DEVICE_SIZE);
@@ -787,14 +795,15 @@ int usb_register_root_hub (struct usb_device *usb_dev, struct device *parent_dev
 		return (retval < 0) ? retval : -EMSGSIZE;
 	}
 
-	(void) usb_get_dev (usb_dev);
 	down (&usb_dev->serialize);
 	retval = usb_new_device (usb_dev);
-	if (retval)
+	up (&usb_dev->serialize);
+	if (retval) {
+		usb_dev->bus->root_hub = NULL;
 		dev_err (parent_dev, "can't register root hub for %s, %d\n",
 				usb_dev->dev.bus_id, retval);
-	up (&usb_dev->serialize);
-	usb_put_dev (usb_dev);
+	}
+	up (&usb_bus_list_lock);
 	return retval;
 }
 EXPORT_SYMBOL (usb_register_root_hub);
@@ -1024,7 +1033,6 @@ static int hcd_alloc_dev (struct usb_device *udev)
 static void urb_unlink (struct urb *urb)
 {
 	unsigned long		flags;
-	struct usb_device	*dev;
 
 	/* Release any periodic transfer bandwidth */
 	if (urb->bandwidth)
@@ -1035,9 +1043,8 @@ static void urb_unlink (struct urb *urb)
 
 	spin_lock_irqsave (&hcd_data_lock, flags);
 	list_del_init (&urb->urb_list);
-	dev = urb->dev;
 	spin_unlock_irqrestore (&hcd_data_lock, flags);
-	usb_put_dev (dev);
+	usb_put_dev (urb->dev);
 }
 
 
@@ -1074,23 +1081,28 @@ static int hcd_submit_urb (struct urb *urb, int mem_flags)
 	// FIXME:  verify that quiescing hc works right (RH cleans up)
 
 	spin_lock_irqsave (&hcd_data_lock, flags);
-	if (HCD_IS_RUNNING (hcd->state) && hcd->state != USB_STATE_QUIESCING) {
+	if (unlikely (urb->reject))
+		status = -EPERM;
+	else if (HCD_IS_RUNNING (hcd->state) &&
+			hcd->state != USB_STATE_QUIESCING) {
 		usb_get_dev (urb->dev);
 		list_add_tail (&urb->urb_list, &dev->urb_list);
 		status = 0;
-	} else {
-		INIT_LIST_HEAD (&urb->urb_list);
+	} else
 		status = -ESHUTDOWN;
-	}
 	spin_unlock_irqrestore (&hcd_data_lock, flags);
-	if (status)
+	if (status) {
+		INIT_LIST_HEAD (&urb->urb_list);
 		return status;
+	}
 
 	/* increment urb's reference count as part of giving it to the HCD
 	 * (which now controls it).  HCD guarantees that it either returns
 	 * an error or calls giveback(), but not both.
 	 */
 	urb = usb_get_urb (urb);
+	atomic_inc (&urb->use_count);
+
 	if (urb->dev == hcd->self.root_hub) {
 		/* NOTE:  requirement on hub callers (usbfs and the hub
 		 * driver, for now) that URBs' urb->transfer_buffer be
@@ -1127,9 +1139,12 @@ static int hcd_submit_urb (struct urb *urb, int mem_flags)
 
 	status = hcd->driver->urb_enqueue (hcd, urb, mem_flags);
 done:
-	if (status) {
-		usb_put_urb (urb);
+	if (unlikely (status)) {
 		urb_unlink (urb);
+		atomic_dec (&urb->use_count);
+		if (urb->reject)
+			wake_up (&usb_kill_urb_queue);
+		usb_put_urb (urb);
 	}
 	return status;
 }
@@ -1152,60 +1167,39 @@ static int hcd_get_frame_number (struct usb_device *udev)
  * soon as practical.  we've already set up the urb's return status,
  * but we can't know if the callback completed already.
  */
-static void
+static int
 unlink1 (struct usb_hcd *hcd, struct urb *urb)
 {
+	int		value;
+
 	if (urb == (struct urb *) hcd->rh_timer.data)
-		usb_rh_status_dequeue (hcd, urb);
+		value = usb_rh_status_dequeue (hcd, urb);
 	else {
-		int		value;
 
-		/* failures "should" be harmless */
+		/* The only reason an HCD might fail this call is if
+		 * it has not yet fully queued the urb to begin with.
+		 * Such failures should be harmless. */
 		value = hcd->driver->urb_dequeue (hcd, urb);
-		if (value != 0)
-			dev_dbg (hcd->self.controller,
-				"dequeue %p --> %d\n",
-				urb, value);
 	}
-}
-
-struct completion_splice {		// modified urb context:
-	/* did we complete? */
-	struct completion	done;
 
-	/* original urb data */
-	usb_complete_t		complete;
-	void			*context;
-};
-
-static void unlink_complete (struct urb *urb, struct pt_regs *regs)
-{
-	struct completion_splice	*splice;
-
-	splice = (struct completion_splice *) urb->context;
-
-	/* issue original completion call */
-	urb->complete = splice->complete;
-	urb->context = splice->context;
-	urb->complete (urb, regs);
-
-	/* then let the synchronous unlink call complete */
-	complete (&splice->done);
+	if (value != 0)
+		dev_dbg (hcd->self.controller, "dequeue %p --> %d\n",
+				urb, value);
+	return value;
 }
 
 /*
- * called in any context; note ASYNC_UNLINK restrictions
+ * called in any context
  *
  * caller guarantees urb won't be recycled till both unlink()
  * and the urb's completion function return
  */
-static int hcd_unlink_urb (struct urb *urb)
+static int hcd_unlink_urb (struct urb *urb, int status)
 {
 	struct hcd_dev			*dev;
-	struct usb_hcd			*hcd = 0;
-	struct device			*sys = 0;
+	struct usb_hcd			*hcd = NULL;
+	struct device			*sys = NULL;
 	unsigned long			flags;
-	struct completion_splice	splice;
 	struct list_head		*tmp;
 	int				retval;
 
@@ -1257,8 +1251,6 @@ static int hcd_unlink_urb (struct urb *urb)
 
 	/* Any status except -EINPROGRESS means something already started to
 	 * unlink this URB from the hardware.  So there's no more work to do.
-	 *
-	 * FIXME use better explicit urb state
 	 */
 	if (urb->status != -EINPROGRESS) {
 		retval = -EBUSY;
@@ -1276,62 +1268,19 @@ static int hcd_unlink_urb (struct urb *urb)
 		hcd->saw_irq = 1;
 	}
 
-	/* maybe set up to block until the urb's completion fires.  the
-	 * lower level hcd code is always async, locking on urb->status
-	 * updates; an intercepted completion unblocks us.
-	 */
-	if (!(urb->transfer_flags & URB_ASYNC_UNLINK)) {
-		if (in_interrupt ()) {
-			dev_dbg (hcd->self.controller, 
-				"non-async unlink in_interrupt");
-			retval = -EWOULDBLOCK;
-			goto done;
-		}
-		/* synchronous unlink: block till we see the completion */
-		init_completion (&splice.done);
-		splice.complete = urb->complete;
-		splice.context = urb->context;
-		urb->complete = unlink_complete;
-		urb->context = &splice;
-		urb->status = -ENOENT;
-	} else {
-		/* asynchronous unlink */
-		urb->status = -ECONNRESET;
-	}
+	urb->status = status;
+
 	spin_unlock (&hcd_data_lock);
 	spin_unlock_irqrestore (&urb->lock, flags);
 
-	// FIXME remove splicing, so this becomes unlink1 (hcd, urb);
-	if (urb == (struct urb *) hcd->rh_timer.data) {
-		usb_rh_status_dequeue (hcd, urb);
-		retval = 0;
-	} else {
-		retval = hcd->driver->urb_dequeue (hcd, urb);
-
-		/* hcds shouldn't really fail these calls, but... */
-		if (retval) {
-			dev_dbg (sys, "dequeue %p --> %d\n", urb, retval);
-			if (!(urb->transfer_flags & URB_ASYNC_UNLINK)) {
-				spin_lock_irqsave (&urb->lock, flags);
-				urb->complete = splice.complete;
-				urb->context = splice.context;
-				spin_unlock_irqrestore (&urb->lock, flags);
-			}
-			goto bye;
-		}
-	}
-
-    	/* block till giveback, if needed */
-	if (urb->transfer_flags & URB_ASYNC_UNLINK)
-		return -EINPROGRESS;
-
-	wait_for_completion (&splice.done);
-	return 0;
+	retval = unlink1 (hcd, urb);
+	if (retval == 0)
+		retval = -EINPROGRESS;
+	return retval;
 
 done:
 	spin_unlock (&hcd_data_lock);
 	spin_unlock_irqrestore (&urb->lock, flags);
-bye:
 	if (retval != -EIDRM && sys && sys->driver)
 		dev_dbg (sys, "hcd_unlink_urb %p fail %d\n", urb, retval);
 	return retval;
@@ -1432,6 +1381,32 @@ rescan:
 
 /*-------------------------------------------------------------------------*/
 
+#ifdef	CONFIG_USB_SUSPEND
+
+static int hcd_hub_suspend (struct usb_bus *bus)
+{
+	struct usb_hcd		*hcd;
+
+	hcd = container_of (bus, struct usb_hcd, self);
+	if (hcd->driver->hub_suspend)
+		return hcd->driver->hub_suspend (hcd);
+	return 0;
+}
+
+static int hcd_hub_resume (struct usb_bus *bus)
+{
+	struct usb_hcd		*hcd;
+
+	hcd = container_of (bus, struct usb_hcd, self);
+	if (hcd->driver->hub_resume)
+		return hcd->driver->hub_resume (hcd);
+	return 0;
+}
+
+#endif
+
+/*-------------------------------------------------------------------------*/
+
 /* called by khubd, rmmod, apmd, or other thread for hcd-private cleanup.
  * we're guaranteed that the device is fully quiesced.  also, that each
  * endpoint has been hcd_endpoint_disabled.
@@ -1486,6 +1461,10 @@ struct usb_operations usb_hcd_operations = {
 	.buffer_alloc =		hcd_buffer_alloc,
 	.buffer_free =		hcd_buffer_free,
 	.disable =		hcd_endpoint_disable,
+#ifdef	CONFIG_USB_SUSPEND
+	.hub_suspend =		hcd_hub_suspend,
+	.hub_resume =		hcd_hub_resume,
+#endif
 };
 EXPORT_SYMBOL (usb_hcd_operations);
 
@@ -1531,6 +1510,9 @@ void usb_hcd_giveback_urb (struct usb_hcd *hcd, struct urb *urb, struct pt_regs
 
 	/* pass ownership to the completion handler */
 	urb->complete (urb, regs);
+	atomic_dec (&urb->use_count);
+	if (unlikely (urb->reject))
+		wake_up (&usb_kill_urb_queue);
 	usb_put_urb (urb);
 }
 EXPORT_SYMBOL (usb_hcd_giveback_urb);
@@ -1574,11 +1556,13 @@ static void hcd_panic (void *_hcd)
 	unsigned		i;
 
 	/* hc's root hub is removed later removed in hcd->stop() */
-	hub->state = USB_STATE_NOTATTACHED;
+	down (&hub->serialize);
+	usb_set_device_state(hub, USB_STATE_NOTATTACHED);
 	for (i = 0; i < hub->maxchild; i++) {
 		if (hub->children [i])
 			usb_disconnect (&hub->children [i]);
 	}
+	up (&hub->serialize);
 }
 
 /**
diff --git a/drivers/usb/core/hcd.h b/drivers/usb/core/hcd.h
index f56fa8026..89b6fc2e3 100644
--- a/drivers/usb/core/hcd.h
+++ b/drivers/usb/core/hcd.h
@@ -142,7 +142,7 @@ struct usb_operations {
 	int (*deallocate)(struct usb_device *);
 	int (*get_frame_number) (struct usb_device *usb_dev);
 	int (*submit_urb) (struct urb *urb, int mem_flags);
-	int (*unlink_urb) (struct urb *urb);
+	int (*unlink_urb) (struct urb *urb, int status);
 
 	/* allocate dma-consistent buffer for URB_DMA_NOMAPPING */
 	void *(*buffer_alloc)(struct usb_bus *bus, size_t size,
@@ -152,6 +152,10 @@ struct usb_operations {
 			void *addr, dma_addr_t dma);
 
 	void (*disable)(struct usb_device *udev, int bEndpointAddress);
+
+	/* global suspend/resume of bus */
+	int (*hub_suspend)(struct usb_bus *);
+	int (*hub_resume)(struct usb_bus *);
 };
 
 /* each driver provides one of these, and hardware init support */
@@ -173,6 +177,9 @@ struct hc_driver {
 	int	(*reset) (struct usb_hcd *hcd);
 	int	(*start) (struct usb_hcd *hcd);
 
+	/* NOTE:  these suspend/resume calls relate to the HC as
+	 * a whole, not just the root hub; they're for bus glue.
+	 */
 	/* called after all devices were suspended */
 	int	(*suspend) (struct usb_hcd *hcd, u32 state);
 
@@ -203,11 +210,13 @@ struct hc_driver {
 	int		(*hub_control) (struct usb_hcd *hcd,
 				u16 typeReq, u16 wValue, u16 wIndex,
 				char *buf, u16 wLength);
+	int		(*hub_suspend)(struct usb_hcd *);
+	int		(*hub_resume)(struct usb_hcd *);
 };
 
 extern void usb_hcd_giveback_urb (struct usb_hcd *hcd, struct urb *urb, struct pt_regs *regs);
 extern void usb_bus_init (struct usb_bus *bus);
-extern void usb_rh_status_dequeue (struct usb_hcd *hcd, struct urb *urb);
+extern int usb_rh_status_dequeue (struct usb_hcd *hcd, struct urb *urb);
 
 #ifdef CONFIG_PCI
 struct pci_dev;
@@ -244,17 +253,10 @@ extern struct usb_device *usb_alloc_dev(struct usb_device *parent,
 					struct usb_bus *, unsigned port);
 extern int usb_new_device(struct usb_device *dev);
 extern void usb_disconnect(struct usb_device **);
-extern void usb_choose_address(struct usb_device *dev);
-extern void usb_release_address(struct usb_device *dev);
 
-/* exported to hub driver ONLY to support usb_reset_device () */
 extern int usb_get_configuration(struct usb_device *dev);
 extern void usb_destroy_configuration(struct usb_device *dev);
 
-/* use these only before the device's address has been set */
-#define usb_snddefctrl(dev)		((PIPE_CONTROL << 30))
-#define usb_rcvdefctrl(dev)		((PIPE_CONTROL << 30) | USB_DIR_IN)
-
 /*-------------------------------------------------------------------------*/
 
 /*
@@ -346,7 +348,8 @@ extern void usb_deregister_bus (struct usb_bus *);
 extern int usb_register_root_hub (struct usb_device *usb_dev,
 		struct device *parent_dev);
 
-static inline int hcd_register_root (struct usb_hcd *hcd)
+static inline int hcd_register_root (struct usb_device *usb_dev,
+		struct usb_hcd *hcd)
 {
 	/* hcd->driver->start() reported can_wakeup, probably with
 	 * assistance from board's boot firmware.
@@ -356,8 +359,7 @@ static inline int hcd_register_root (struct usb_hcd *hcd)
 		dev_dbg (hcd->self.controller, "supports USB remote wakeup\n");
 	hcd->remote_wakeup = hcd->can_wakeup;
 
-	return usb_register_root_hub (
-		hcd_to_bus (hcd)->root_hub, hcd->self.controller);
+	return usb_register_root_hub (usb_dev, hcd->self.controller);
 }
 
 /*-------------------------------------------------------------------------*/
@@ -366,6 +368,7 @@ static inline int hcd_register_root (struct usb_hcd *hcd)
 
 extern struct list_head usb_bus_list;
 extern struct semaphore usb_bus_list_lock;
+extern wait_queue_head_t usb_kill_urb_queue;
 
 extern struct usb_bus *usb_bus_get (struct usb_bus *bus);
 extern void usb_bus_put (struct usb_bus *bus);
diff --git a/drivers/usb/core/hub.c b/drivers/usb/core/hub.c
index cdade3278..b13fe4040 100644
--- a/drivers/usb/core/hub.c
+++ b/drivers/usb/core/hub.c
@@ -9,6 +9,11 @@
  */
 
 #include <linux/config.h>
+#ifdef CONFIG_USB_DEBUG
+	#define DEBUG
+#else
+	#undef DEBUG
+#endif
 #include <linux/kernel.h>
 #include <linux/errno.h>
 #include <linux/module.h>
@@ -19,11 +24,6 @@
 #include <linux/slab.h>
 #include <linux/smp_lock.h>
 #include <linux/ioctl.h>
-#ifdef CONFIG_USB_DEBUG
-	#define DEBUG
-#else
-	#undef DEBUG
-#endif
 #include <linux/usb.h>
 #include <linux/usbdevice_fs.h>
 #include <linux/suspend.h>
@@ -36,11 +36,13 @@
 #include "hcd.h"
 #include "hub.h"
 
+/* Protect all struct usb_device state members */
+static spinlock_t device_state_lock = SPIN_LOCK_UNLOCKED;
+
 /* Wakes up khubd */
 static spinlock_t hub_event_lock = SPIN_LOCK_UNLOCKED;
 
 static LIST_HEAD(hub_event_list);	/* List of hubs needing servicing */
-static LIST_HEAD(hub_list);		/* List of all hubs (for cleanup) */
 
 static DECLARE_WAIT_QUEUE_HEAD(khubd_wait);
 static pid_t khubd_pid = 0;			/* PID of khubd */
@@ -136,7 +138,7 @@ static void set_port_led(
 static void led_work (void *__hub)
 {
 	struct usb_hub		*hub = __hub;
-	struct usb_device	*hdev = interface_to_usbdev (hub->intf);
+	struct usb_device	*hdev = hub->hdev;
 	unsigned		i;
 	unsigned		changed = 0;
 	int			cursor = -1;
@@ -229,19 +231,14 @@ static void hub_irq(struct urb *urb, struct pt_regs *regs)
 {
 	struct usb_hub *hub = (struct usb_hub *)urb->context;
 	int status;
-
-	spin_lock(&hub_event_lock);
-	hub->urb_active = 0;
-	if (hub->urb_complete) {	/* disconnect or rmmod */
-		complete(hub->urb_complete);
-		goto done;
-	}
+	int i;
+	unsigned long bits;
 
 	switch (urb->status) {
 	case -ENOENT:		/* synchronous unlink */
 	case -ECONNRESET:	/* async unlink */
 	case -ESHUTDOWN:	/* hardware going away */
-		goto done;
+		return;
 
 	default:		/* presumably an error */
 		/* Cause a hub reset after 10 consecutive errors */
@@ -253,35 +250,37 @@ static void hub_irq(struct urb *urb, struct pt_regs *regs)
 	
 	/* let khubd handle things */
 	case 0:			/* we got data:  port status changed */
+		bits = 0;
+		for (i = 0; i < urb->actual_length; ++i)
+			bits |= ((unsigned long) ((*hub->buffer)[i]))
+					<< (i*8);
+		hub->event_bits[0] = bits;
 		break;
 	}
 
 	hub->nerrors = 0;
 
 	/* Something happened, let khubd figure it out */
+	spin_lock(&hub_event_lock);
 	if (list_empty(&hub->event_list)) {
-		list_add(&hub->event_list, &hub_event_list);
+		list_add_tail(&hub->event_list, &hub_event_list);
 		wake_up(&khubd_wait);
 	}
+	spin_unlock(&hub_event_lock);
 
 resubmit:
 	if ((status = usb_submit_urb (hub->urb, GFP_ATOMIC)) != 0
-			/* ENODEV means we raced disconnect() */
-			&& status != -ENODEV)
-		dev_err (&hub->intf->dev, "resubmit --> %d\n", urb->status);
-	if (status == 0)
-		hub->urb_active = 1;
-done:
-	spin_unlock(&hub_event_lock);
+			&& status != -ENODEV && status != -EPERM)
+		dev_err (&hub->intf->dev, "resubmit --> %d\n", status);
 }
 
 /* USB 2.0 spec Section 11.24.2.3 */
 static inline int
 hub_clear_tt_buffer (struct usb_device *hdev, u16 devinfo, u16 tt)
 {
-	return usb_control_msg (hdev, usb_rcvctrlpipe (hdev, 0),
-		HUB_CLEAR_TT_BUFFER, USB_RT_PORT,
-		devinfo, tt, 0, 0, HZ);
+	return usb_control_msg(hdev, usb_rcvctrlpipe(hdev, 0),
+			       HUB_CLEAR_TT_BUFFER, USB_RT_PORT, devinfo,
+			       tt, NULL, 0, HZ);
 }
 
 /*
@@ -299,7 +298,7 @@ static void hub_tt_kevent (void *arg)
 	while (!list_empty (&hub->tt.clear_list)) {
 		struct list_head	*temp;
 		struct usb_tt_clear	*clear;
-		struct usb_device	*hdev;
+		struct usb_device	*hdev = hub->hdev;
 		int			status;
 
 		temp = hub->tt.clear_list.next;
@@ -308,7 +307,6 @@ static void hub_tt_kevent (void *arg)
 
 		/* drop lock so HCD can concurrently report other TT errors */
 		spin_unlock_irqrestore (&hub->tt.lock, flags);
-		hdev = interface_to_usbdev (hub->intf);
 		status = hub_clear_tt_buffer (hdev, clear->devinfo, clear->tt);
 		spin_lock_irqsave (&hub->tt.lock, flags);
 
@@ -369,15 +367,14 @@ void usb_hub_tt_clear_buffer (struct usb_device *udev, int pipe)
 
 static void hub_power_on(struct usb_hub *hub)
 {
-	struct usb_device *hdev;
 	int i;
 
 	/* if hub supports power switching, enable power on each port */
 	if ((hub->descriptor->wHubCharacteristics & HUB_CHAR_LPSM) < 2) {
 		dev_dbg(&hub->intf->dev, "enabling power on all ports\n");
-		hdev = interface_to_usbdev(hub->intf);
 		for (i = 0; i < hub->descriptor->bNbrPorts; i++)
-			set_port_feature(hdev, i + 1, USB_PORT_FEAT_POWER);
+			set_port_feature(hub->hdev, i + 1,
+					USB_PORT_FEAT_POWER);
 	}
 
 	/* Wait for power to be enabled */
@@ -387,10 +384,9 @@ static void hub_power_on(struct usb_hub *hub)
 static int hub_hub_status(struct usb_hub *hub,
 		u16 *status, u16 *change)
 {
-	struct usb_device *hdev = interface_to_usbdev (hub->intf);
 	int ret;
 
-	ret = get_hub_status(hdev, &hub->status->hub);
+	ret = get_hub_status(hub->hdev, &hub->status->hub);
 	if (ret < 0)
 		dev_err (&hub->intf->dev,
 			"%s failed (err = %d)\n", __FUNCTION__, ret);
@@ -405,7 +401,7 @@ static int hub_hub_status(struct usb_hub *hub,
 static int hub_configure(struct usb_hub *hub,
 	struct usb_endpoint_descriptor *endpoint)
 {
-	struct usb_device *hdev = interface_to_usbdev (hub->intf);
+	struct usb_device *hdev = hub->hdev;
 	struct device *hub_dev = &hub->intf->dev;
 	u16 hubstatus, hubchange;
 	unsigned int pipe;
@@ -603,7 +599,6 @@ static int hub_configure(struct usb_hub *hub,
 		message = "couldn't submit status urb";
 		goto fail;
 	}
-	hub->urb_active = 1;
 
 	/* Wake up khubd */
 	wake_up(&khubd_wait);
@@ -631,27 +626,26 @@ static unsigned highspeed_hubs;
 static void hub_disconnect(struct usb_interface *intf)
 {
 	struct usb_hub *hub = usb_get_intfdata (intf);
-	DECLARE_COMPLETION(urb_complete);
-	unsigned long flags;
+	struct usb_device *hdev;
 
 	if (!hub)
 		return;
+	hdev = hub->hdev;
 
-	if (interface_to_usbdev(intf)->speed == USB_SPEED_HIGH)
+	if (hdev->speed == USB_SPEED_HIGH)
 		highspeed_hubs--;
 
 	usb_set_intfdata (intf, NULL);
-	spin_lock_irqsave(&hub_event_lock, flags);
-	hub->urb_complete = &urb_complete;
 
-	/* Delete it and then reset it */
-	list_del_init(&hub->event_list);
-	list_del_init(&hub->hub_list);
-
-	spin_unlock_irqrestore(&hub_event_lock, flags);
+	if (hub->urb) {
+		usb_kill_urb(hub->urb);
+		usb_free_urb(hub->urb);
+		hub->urb = NULL;
+	}
 
-	down(&hub->khubd_sem); /* Wait for khubd to leave this hub alone. */
-	up(&hub->khubd_sem);
+	spin_lock_irq(&hub_event_lock);
+	list_del_init(&hub->event_list);
+	spin_unlock_irq(&hub_event_lock);
 
 	/* assuming we used keventd, it must quiesce too */
 	if (hub->has_indicators)
@@ -659,14 +653,6 @@ static void hub_disconnect(struct usb_interface *intf)
 	if (hub->has_indicators || hub->tt.hub)
 		flush_scheduled_work ();
 
-	if (hub->urb) {
-		usb_unlink_urb(hub->urb);
-		if (hub->urb_active)
-			wait_for_completion(&urb_complete);
-		usb_free_urb(hub->urb);
-		hub->urb = NULL;
-	}
-
 	if (hub->descriptor) {
 		kfree(hub->descriptor);
 		hub->descriptor = NULL;
@@ -678,8 +664,7 @@ static void hub_disconnect(struct usb_interface *intf)
 	}
 
 	if (hub->buffer) {
-		usb_buffer_free(interface_to_usbdev(intf),
-				sizeof(*hub->buffer), hub->buffer,
+		usb_buffer_free(hdev, sizeof(*hub->buffer), hub->buffer,
 				hub->buffer_dma);
 		hub->buffer = NULL;
 	}
@@ -695,7 +680,6 @@ static int hub_probe(struct usb_interface *intf, const struct usb_device_id *id)
 	struct usb_device *hdev;
 	struct usb_hub *hub;
 	struct device *hub_dev;
-	unsigned long flags;
 
 	desc = intf->cur_altsetting;
 	hdev = interface_to_usbdev(intf);
@@ -711,23 +695,19 @@ descriptor_error:
 	}
 
 	/* Multiple endpoints? What kind of mutant ninja-hub is this? */
-	if (desc->desc.bNumEndpoints != 1) {
+	if (desc->desc.bNumEndpoints != 1)
 		goto descriptor_error;
-	}
 
 	endpoint = &desc->endpoint[0].desc;
 
 	/* Output endpoint? Curiouser and curiouser.. */
-	if (!(endpoint->bEndpointAddress & USB_DIR_IN)) {
+	if (!(endpoint->bEndpointAddress & USB_DIR_IN))
 		goto descriptor_error;
-	}
 
 	/* If it's not an interrupt endpoint, we'd better punt! */
 	if ((endpoint->bmAttributes & USB_ENDPOINT_XFERTYPE_MASK)
-			!= USB_ENDPOINT_XFER_INT) {
+			!= USB_ENDPOINT_XFER_INT)
 		goto descriptor_error;
-		return -EIO;
-	}
 
 	/* We found a hub */
 	dev_info (hub_dev, "USB hub found\n");
@@ -742,15 +722,9 @@ descriptor_error:
 
 	INIT_LIST_HEAD(&hub->event_list);
 	hub->intf = intf;
-	init_MUTEX(&hub->khubd_sem);
+	hub->hdev = hdev;
 	INIT_WORK(&hub->leds, led_work, hub);
 
-	/* Record the new hub's existence */
-	spin_lock_irqsave(&hub_event_lock, flags);
-	INIT_LIST_HEAD(&hub->hub_list);
-	list_add(&hub->hub_list, &hub_list);
-	spin_unlock_irqrestore(&hub_event_lock, flags);
-
 	usb_set_intfdata (intf, hub);
 
 	if (hdev->speed == USB_SPEED_HIGH)
@@ -800,7 +774,7 @@ hub_ioctl(struct usb_interface *intf, unsigned int code, void *user_data)
 
 static int hub_reset(struct usb_hub *hub)
 {
-	struct usb_device *hdev = interface_to_usbdev(hub->intf);
+	struct usb_device *hdev = hub->hdev;
 	int i;
 
 	/* Disconnect any attached devices */
@@ -811,7 +785,7 @@ static int hub_reset(struct usb_hub *hub)
 
 	/* Attempt to reset the hub */
 	if (hub->urb)
-		usb_unlink_urb(hub->urb);
+		usb_kill_urb(hub->urb);
 	else
 		return -1;
 
@@ -827,6 +801,7 @@ static int hub_reset(struct usb_hub *hub)
 	return 0;
 }
 
+/* FIXME!  This routine should be subsumed into hub_reset */
 static void hub_start_disconnect(struct usb_device *hdev)
 {
 	struct usb_device *parent = hdev->parent;
@@ -845,6 +820,289 @@ static void hub_start_disconnect(struct usb_device *hdev)
 	dev_err(&hdev->dev, "cannot disconnect hub!\n");
 }
 
+
+static void recursively_mark_NOTATTACHED(struct usb_device *udev)
+{
+	int i;
+
+	for (i = 0; i < udev->maxchild; ++i) {
+		if (udev->children[i])
+			recursively_mark_NOTATTACHED(udev->children[i]);
+	}
+	udev->state = USB_STATE_NOTATTACHED;
+}
+
+/**
+ * usb_set_device_state - change a device's current state (usbcore-internal)
+ * @udev: pointer to device whose state should be changed
+ * @new_state: new state value to be stored
+ *
+ * udev->state is _not_ protected by the udev->serialize semaphore.  This
+ * is so that devices can be marked as disconnected as soon as possible,
+ * without having to wait for the semaphore to be released.  Instead,
+ * changes to the state must be protected by the device_state_lock spinlock.
+ *
+ * Once a device has been added to the device tree, all changes to its state
+ * should be made using this routine.  The state should _not_ be set directly.
+ *
+ * If udev->state is already USB_STATE_NOTATTACHED then no change is made.
+ * Otherwise udev->state is set to new_state, and if new_state is
+ * USB_STATE_NOTATTACHED then all of udev's descendant's states are also set
+ * to USB_STATE_NOTATTACHED.
+ */
+void usb_set_device_state(struct usb_device *udev,
+		enum usb_device_state new_state)
+{
+	unsigned long flags;
+
+	spin_lock_irqsave(&device_state_lock, flags);
+	if (udev->state == USB_STATE_NOTATTACHED)
+		;	/* do nothing */
+	else if (new_state != USB_STATE_NOTATTACHED)
+		udev->state = new_state;
+	else
+		recursively_mark_NOTATTACHED(udev);
+	spin_unlock_irqrestore(&device_state_lock, flags);
+}
+
+
+static void choose_address(struct usb_device *udev)
+{
+	int		devnum;
+	struct usb_bus	*bus = udev->bus;
+
+	/* If khubd ever becomes multithreaded, this will need a lock */
+
+	/* Try to allocate the next devnum beginning at bus->devnum_next. */
+	devnum = find_next_zero_bit(bus->devmap.devicemap, 128,
+			bus->devnum_next);
+	if (devnum >= 128)
+		devnum = find_next_zero_bit(bus->devmap.devicemap, 128, 1);
+
+	bus->devnum_next = ( devnum >= 127 ? 1 : devnum + 1);
+
+	if (devnum < 128) {
+		set_bit(devnum, bus->devmap.devicemap);
+		udev->devnum = devnum;
+	}
+}
+
+static void release_address(struct usb_device *udev)
+{
+	if (udev->devnum > 0) {
+		clear_bit(udev->devnum, udev->bus->devmap.devicemap);
+		udev->devnum = -1;
+	}
+}
+
+/**
+ * usb_disconnect - disconnect a device (usbcore-internal)
+ * @pdev: pointer to device being disconnected
+ * Context: !in_interrupt ()
+ *
+ * Something got disconnected. Get rid of it, and all of its children.
+ * If *pdev is a normal device then the parent hub should be locked.
+ * If *pdev is a root hub then this routine will acquire the
+ * usb_bus_list_lock on behalf of the caller.
+ *
+ * Only hub drivers (including virtual root hub drivers for host
+ * controllers) should ever call this.
+ *
+ * This call is synchronous, and may not be used in an interrupt context.
+ */
+void usb_disconnect(struct usb_device **pdev)
+{
+	struct usb_device	*udev = *pdev;
+	int			i;
+
+	if (!udev) {
+		pr_debug ("%s nodev\n", __FUNCTION__);
+		return;
+	}
+
+	/* mark the device as inactive, so any further urb submissions for
+	 * this device will fail.
+	 */
+	usb_set_device_state(udev, USB_STATE_NOTATTACHED);
+
+	/* lock the bus list on behalf of HCDs unregistering their root hubs */
+	if (!udev->parent)
+		down(&usb_bus_list_lock);
+	down(&udev->serialize);
+
+	dev_info (&udev->dev, "USB disconnect, address %d\n", udev->devnum);
+
+	/* Free up all the children before we remove this device */
+	for (i = 0; i < USB_MAXCHILDREN; i++) {
+		if (udev->children[i])
+			usb_disconnect(&udev->children[i]);
+	}
+
+	/* deallocate hcd/hardware state ... nuking all pending urbs and
+	 * cleaning up all state associated with the current configuration
+	 */
+	usb_disable_device(udev, 0);
+
+	/* Free the device number, remove the /proc/bus/usb entry and
+	 * the sysfs attributes, and delete the parent's children[]
+	 * (or root_hub) pointer.
+	 */
+	dev_dbg (&udev->dev, "unregistering device\n");
+	release_address(udev);
+	usbfs_remove_device(udev);
+	usb_remove_sysfs_dev_files(udev);
+
+	/* Avoid races with recursively_mark_NOTATTACHED() */
+	spin_lock_irq(&device_state_lock);
+	*pdev = NULL;
+	spin_unlock_irq(&device_state_lock);
+
+	up(&udev->serialize);
+	if (!udev->parent)
+		up(&usb_bus_list_lock);
+
+	device_unregister(&udev->dev);
+}
+
+static int choose_configuration(struct usb_device *udev)
+{
+	int c, i;
+
+	/* NOTE: this should interact with hub power budgeting */
+
+	c = udev->config[0].desc.bConfigurationValue;
+	if (udev->descriptor.bNumConfigurations != 1) {
+		for (i = 0; i < udev->descriptor.bNumConfigurations; i++) {
+			struct usb_interface_descriptor	*desc;
+
+			/* heuristic:  Linux is more likely to have class
+			 * drivers, so avoid vendor-specific interfaces.
+			 */
+			desc = &udev->config[i].intf_cache[0]
+					->altsetting->desc;
+			if (desc->bInterfaceClass == USB_CLASS_VENDOR_SPEC)
+				continue;
+			/* COMM/2/all is CDC ACM, except 0xff is MSFT RNDIS */
+			if (desc->bInterfaceClass == USB_CLASS_COMM
+					&& desc->bInterfaceSubClass == 2
+					&& desc->bInterfaceProtocol == 0xff)
+				continue;
+			c = udev->config[i].desc.bConfigurationValue;
+			break;
+		}
+		dev_info(&udev->dev,
+			"configuration #%d chosen from %d choices\n",
+			c, udev->descriptor.bNumConfigurations);
+	}
+	return c;
+}
+
+#ifdef DEBUG
+static void show_string(struct usb_device *udev, char *id, int index)
+{
+	char *buf;
+
+	if (!index)
+		return;
+	if (!(buf = kmalloc(256, GFP_KERNEL)))
+		return;
+	if (usb_string(udev, index, buf, 256) > 0)
+		dev_printk(KERN_INFO, &udev->dev, "%s: %s\n", id, buf);
+	kfree(buf);
+}
+
+#else
+static inline void show_string(struct usb_device *udev, char *id, int index)
+{}
+#endif
+
+/**
+ * usb_new_device - perform initial device setup (usbcore-internal)
+ * @udev: newly addressed device (in ADDRESS state)
+ *
+ * This is called with devices which have been enumerated, but not yet
+ * configured.  The device descriptor is available, but not descriptors
+ * for any device configuration.  The caller must have locked udev and
+ * either the parent hub (if udev is a normal device) or else the
+ * usb_bus_list_lock (if udev is a root hub).  The parent's pointer to
+ * udev has already been installed, but udev is not yet visible through
+ * sysfs or other filesystem code.
+ *
+ * Returns 0 for success (device is configured and listed, with its
+ * interfaces, in sysfs); else a negative errno value.
+ *
+ * This call is synchronous, and may not be used in an interrupt context.
+ *
+ * Only the hub driver should ever call this; root hub registration
+ * uses it indirectly.
+ */
+int usb_new_device(struct usb_device *udev)
+{
+	int err;
+	int c;
+
+	err = usb_get_configuration(udev);
+	if (err < 0) {
+		dev_err(&udev->dev, "can't read configurations, error %d\n",
+			err);
+		goto fail;
+	}
+
+	/* Tell the world! */
+	dev_dbg(&udev->dev, "new device strings: Mfr=%d, Product=%d, "
+			"SerialNumber=%d\n",
+			udev->descriptor.iManufacturer,
+			udev->descriptor.iProduct,
+			udev->descriptor.iSerialNumber);
+
+	if (udev->descriptor.iProduct)
+		show_string(udev, "Product",
+				udev->descriptor.iProduct);
+	if (udev->descriptor.iManufacturer)
+		show_string(udev, "Manufacturer",
+				udev->descriptor.iManufacturer);
+	if (udev->descriptor.iSerialNumber)
+		show_string(udev, "SerialNumber",
+				udev->descriptor.iSerialNumber);
+
+	/* put device-specific files into sysfs */
+	err = device_add (&udev->dev);
+	if (err) {
+		dev_err(&udev->dev, "can't device_add, error %d\n", err);
+		goto fail;
+	}
+	usb_create_sysfs_dev_files (udev);
+
+	/* choose and set the configuration. that registers the interfaces
+	 * with the driver core, and lets usb device drivers bind to them.
+	 */
+	c = choose_configuration(udev);
+	if (c < 0)
+		dev_warn(&udev->dev,
+				"can't choose an initial configuration\n");
+	else {
+		err = usb_set_configuration(udev, c);
+		if (err) {
+			dev_err(&udev->dev, "can't set config #%d, error %d\n",
+					c, err);
+			usb_remove_sysfs_dev_files(udev);
+			device_del(&udev->dev);
+			goto fail;
+		}
+	}
+
+	/* USB device state == configured ... usable */
+
+	/* add a /proc/bus/usb entry */
+	usbfs_add_device(udev);
+	return 0;
+
+fail:
+	usb_set_device_state(udev, USB_STATE_NOTATTACHED);
+	return err;
+}
+
+
 static int hub_port_status(struct usb_device *hdev, int port,
 			       u16 *status, u16 *change)
 {
@@ -934,16 +1192,20 @@ static int hub_port_reset(struct usb_device *hdev, int port,
 
 	/* Reset the port */
 	for (i = 0; i < PORT_RESET_TRIES; i++) {
-		set_port_feature(hdev, port + 1, USB_PORT_FEAT_RESET);
+		status = set_port_feature(hdev, port + 1, USB_PORT_FEAT_RESET);
+		if (status)
+			dev_err(hub_dev, "cannot reset port %d (err = %d)\n",
+					port + 1, status);
+		else
+			status = hub_port_wait_reset(hdev, port, udev, delay);
 
 		/* return on disconnect or reset */
-		status = hub_port_wait_reset(hdev, port, udev, delay);
 		if (status == -ENOTCONN || status == 0) {
 			clear_port_feature(hdev,
 				port + 1, USB_PORT_FEAT_C_RESET);
-			udev->state = status
+			usb_set_device_state(udev, status
 					? USB_STATE_NOTATTACHED
-					: USB_STATE_DEFAULT;
+					: USB_STATE_DEFAULT);
 			return status;
 		}
 
@@ -964,6 +1226,9 @@ static int hub_port_disable(struct usb_device *hdev, int port)
 {
 	int ret;
 
+	if (hdev->children[port])
+		usb_set_device_state(hdev->children[port],
+				USB_STATE_NOTATTACHED);
 	ret = clear_port_feature(hdev, port + 1, USB_PORT_FEAT_ENABLE);
 	if (ret)
 		dev_err(hubdev(hdev), "cannot disable port %d (err = %d)\n",
@@ -972,60 +1237,92 @@ static int hub_port_disable(struct usb_device *hdev, int port)
 	return ret;
 }
 
+#ifdef	CONFIG_USB_SUSPEND
+
+	/* no USB_SUSPEND yet! */
+
+#else	/* !CONFIG_USB_SUSPEND */
+
+int usb_suspend_device(struct usb_device *udev, u32 state)
+{
+	return 0;
+}
+
+int usb_resume_device(struct usb_device *udev)
+{
+	return 0;
+}
+
+#define	hub_suspend		NULL
+#define	hub_resume		NULL
+#define	remote_wakeup(x)	0
+
+#endif	/* CONFIG_USB_SUSPEND */
+
+EXPORT_SYMBOL(usb_suspend_device);
+EXPORT_SYMBOL(usb_resume_device);
+
+
+
 /* USB 2.0 spec, 7.1.7.3 / fig 7-29:
  *
  * Between connect detection and reset signaling there must be a delay
- * of 100ms at least for debounce and power-settling. The corresponding
+ * of 100ms at least for debounce and power-settling.  The corresponding
  * timer shall restart whenever the downstream port detects a disconnect.
  * 
- * Apparently there are some bluetooth and irda-dongles and a number
- * of low-speed devices which require longer delays of about 200-400ms.
+ * Apparently there are some bluetooth and irda-dongles and a number of
+ * low-speed devices for which this debounce period may last over a second.
  * Not covered by the spec - but easy to deal with.
  *
- * This implementation uses 400ms minimum debounce timeout and checks
- * every 25ms for transient disconnects to restart the delay.
+ * This implementation uses a 1500ms total debounce timeout; if the
+ * connection isn't stable by then it returns -ETIMEDOUT.  It checks
+ * every 25ms for transient disconnects.  When the port status has been
+ * unchanged for 100ms it returns the port status.
  */
 
-#define HUB_DEBOUNCE_TIMEOUT	400
-#define HUB_DEBOUNCE_STEP	 25
-#define HUB_DEBOUNCE_STABLE	  4
+#define HUB_DEBOUNCE_TIMEOUT	1500
+#define HUB_DEBOUNCE_STEP	  25
+#define HUB_DEBOUNCE_STABLE	 100
 
 static int hub_port_debounce(struct usb_device *hdev, int port)
 {
 	int ret;
-	int delay_time, stable_count;
+	int total_time, stable_time = 0;
 	u16 portchange, portstatus;
-	unsigned connection;
-
-	connection = 0;
-	stable_count = 0;
-	for (delay_time = 0; delay_time < HUB_DEBOUNCE_TIMEOUT; delay_time += HUB_DEBOUNCE_STEP) {
-		msleep(HUB_DEBOUNCE_STEP);
+	unsigned connection = 0xffff;
 
+	for (total_time = 0; ; total_time += HUB_DEBOUNCE_STEP) {
 		ret = hub_port_status(hdev, port, &portstatus, &portchange);
 		if (ret < 0)
 			return ret;
 
-		if ((portstatus & USB_PORT_STAT_CONNECTION) == connection) {
-			if (connection) {
-				if (++stable_count == HUB_DEBOUNCE_STABLE)
-					break;
-			}
+		if (!(portchange & USB_PORT_STAT_C_CONNECTION) &&
+		     (portstatus & USB_PORT_STAT_CONNECTION) == connection) {
+			stable_time += HUB_DEBOUNCE_STEP;
+			if (stable_time >= HUB_DEBOUNCE_STABLE)
+				break;
 		} else {
-			stable_count = 0;
+			stable_time = 0;
+			connection = portstatus & USB_PORT_STAT_CONNECTION;
 		}
-		connection = portstatus & USB_PORT_STAT_CONNECTION;
 
-		if ((portchange & USB_PORT_STAT_C_CONNECTION)) {
-			clear_port_feature(hdev, port+1, USB_PORT_FEAT_C_CONNECTION);
+		if (portchange & USB_PORT_STAT_C_CONNECTION) {
+			clear_port_feature(hdev, port+1,
+					USB_PORT_FEAT_C_CONNECTION);
 		}
+
+		if (total_time >= HUB_DEBOUNCE_TIMEOUT)
+			break;
+		msleep(HUB_DEBOUNCE_STEP);
 	}
 
 	dev_dbg (hubdev (hdev),
-		"debounce: port %d: delay %dms stable %d status 0x%x\n",
-		port + 1, delay_time, stable_count, portstatus);
+		"debounce: port %d: total %dms stable %dms status 0x%x\n",
+		port + 1, total_time, stable_time, portstatus);
 
-	return (portstatus & USB_PORT_STAT_CONNECTION) ? 0 : -ENOTCONN;
+	if (stable_time < HUB_DEBOUNCE_STABLE)
+		return -ETIMEDOUT;
+	return portstatus;
 }
 
 static int hub_set_address(struct usb_device *udev)
@@ -1037,21 +1334,22 @@ static int hub_set_address(struct usb_device *udev)
 	if (udev->state != USB_STATE_DEFAULT &&
 			udev->state != USB_STATE_ADDRESS)
 		return -EINVAL;
-	retval = usb_control_msg(udev, usb_snddefctrl(udev),
+	retval = usb_control_msg(udev, (PIPE_CONTROL << 30) /* Address 0 */,
 		USB_REQ_SET_ADDRESS, 0, udev->devnum, 0,
 		NULL, 0, HZ * USB_CTRL_SET_TIMEOUT);
 	if (retval == 0)
-		udev->state = USB_STATE_ADDRESS;
+		usb_set_device_state(udev, USB_STATE_ADDRESS);
 	return retval;
 }
 
-/* reset device, (re)assign address, get device descriptor.
- * device connection is stable, no more debouncing needed.
- * returns device in USB_STATE_ADDRESS, except on error.
- * on error return, device is no longer usable (ref dropped).
+/* Reset device, (re)assign address, get device descriptor.
+ * Device connection must be stable, no more debouncing needed.
+ * Returns device in USB_STATE_ADDRESS, except on error.
  *
- * caller owns dev->serialize for the device, guarding against
- * config changes and disconnect processing.
+ * If this is called for an already-existing device (as part of
+ * usb_reset_device), the caller must own the device lock.  For a
+ * newly detected device that is not accessible through any global
+ * pointers, it's not necessary to lock the device.
  */
 static int
 hub_port_init (struct usb_device *hdev, struct usb_device *udev, int port)
@@ -1065,8 +1363,11 @@ hub_port_init (struct usb_device *hdev, struct usb_device *udev, int port)
 	/* root hub ports have a slightly longer reset period
 	 * (from USB 2.0 spec, section 7.1.7.5)
 	 */
-	if (!hdev->parent)
+	if (!hdev->parent) {
 		delay = HUB_ROOT_RESET_TIME;
+		if (port + 1 == hdev->bus->otg_port)
+			hdev->bus->b_hnp_enable = 0;
+	}
 
 	/* Some low speed devices have problems with the quick delay, so */
 	/*  be a bit pessimistic with those devices. RHbug #23670 */
@@ -1109,33 +1410,9 @@ hub_port_init (struct usb_device *hdev, struct usb_device *udev, int port)
 	udev->epmaxpacketin [0] = i;
 	udev->epmaxpacketout[0] = i;
  
-	/* set the address */
-	if (udev->devnum <= 0) {
-		usb_choose_address(udev);
-		if (udev->devnum <= 0)
-			goto fail;
-
-		/* Set up TT records, if needed  */
-		if (hdev->tt) {
-			udev->tt = hdev->tt;
-			udev->ttport = hdev->ttport;
-		} else if (udev->speed != USB_SPEED_HIGH
-				&& hdev->speed == USB_SPEED_HIGH) {
-			struct usb_hub	*hub;
- 
-			hub = usb_get_intfdata (hdev->actconfig
-							->interface[0]);
-			udev->tt = &hub->tt;
-			udev->ttport = port + 1;
-		}
-
-		/* force the right log message (below) at low speed */
-		oldspeed = USB_SPEED_UNKNOWN;
-	}
- 
 	dev_info (&udev->dev,
 			"%s %s speed USB device using address %d\n",
-			(oldspeed == USB_SPEED_UNKNOWN) ? "new" : "reset",
+			(udev->config) ? "reset" : "new",
 			({ char *speed; switch (udev->speed) {
 			case USB_SPEED_LOW:	speed = "low";	break;
 			case USB_SPEED_FULL:	speed = "full";	break;
@@ -1143,6 +1420,19 @@ hub_port_init (struct usb_device *hdev, struct usb_device *udev, int port)
 			default: 		speed = "?";	break;
 			}; speed;}),
 			udev->devnum);
+
+	/* Set up TT records, if needed  */
+	if (hdev->tt) {
+		udev->tt = hdev->tt;
+		udev->ttport = hdev->ttport;
+	} else if (udev->speed != USB_SPEED_HIGH
+			&& hdev->speed == USB_SPEED_HIGH) {
+		struct usb_hub *hub;
+
+		hub = usb_get_intfdata(hdev->actconfig->interface[0]);
+		udev->tt = &hub->tt;
+		udev->ttport = port + 1;
+	}
  
 	/* Why interleave GET_DESCRIPTOR and SET_ADDRESS this way?
 	 * Because device hardware and firmware is sometimes buggy in
@@ -1164,12 +1454,7 @@ hub_port_init (struct usb_device *hdev, struct usb_device *udev, int port)
 			dev_err(&udev->dev,
 				"device not accepting address %d, error %d\n",
 				udev->devnum, retval);
- fail:
-			hub_port_disable(hdev, port);
-			usb_release_address(udev);
-			usb_put_dev(udev);
-			up(&usb_address0_sem);
-			return retval;
+			goto fail;
 		}
  
 		/* cope with hardware quirkiness:
@@ -1192,7 +1477,8 @@ hub_port_init (struct usb_device *hdev, struct usb_device *udev, int port)
 	if (udev->speed == USB_SPEED_FULL
 			&& (udev->epmaxpacketin [0]
 				!= udev->descriptor.bMaxPacketSize0)) {
-		usb_disable_endpoint(udev, 0);
+		usb_disable_endpoint(udev, 0 + USB_DIR_IN);
+		usb_disable_endpoint(udev, 0 + USB_DIR_OUT);
 		usb_endpoint_running(udev, 0, 1);
 		usb_endpoint_running(udev, 0, 0);
 		udev->epmaxpacketin [0] = udev->descriptor.bMaxPacketSize0;
@@ -1208,11 +1494,11 @@ hub_port_init (struct usb_device *hdev, struct usb_device *udev, int port)
 		goto fail;
 	}
 
-	/* now dev is visible to other tasks */
-	hdev->children[port] = udev;
+	retval = 0;
 
+fail:
 	up(&usb_address0_sem);
-	return 0;
+	return retval;
 }
 
 static void
@@ -1240,8 +1526,9 @@ check_highspeed (struct usb_hub *hub, struct usb_device *udev, int port)
 }
 
 static unsigned
-hub_power_remaining (struct usb_hub *hub, struct usb_device *hdev)
+hub_power_remaining (struct usb_hub *hub)
 {
+	struct usb_device *hdev = hub->hdev;
 	int remaining;
 	unsigned i;
 
@@ -1251,16 +1538,25 @@ hub_power_remaining (struct usb_hub *hub, struct usb_device *hdev)
 
 	for (i = 0; i < hdev->maxchild; i++) {
 		struct usb_device	*udev = hdev->children[i];
-		int			delta;
+		int			delta, ceiling;
 
 		if (!udev)
 			continue;
 
+		/* 100mA per-port ceiling, or 8mA for OTG ports */
+		if (i != (udev->bus->otg_port - 1) || hdev->parent)
+			ceiling = 50;
+		else
+			ceiling = 4;
+
 		if (udev->actconfig)
 			delta = udev->actconfig->desc.bMaxPower;
 		else
-			delta = 50;
+			delta = ceiling;
 		// dev_dbg(&udev->dev, "budgeted %dmA\n", 2 * delta);
+		if (delta > ceiling)
+			dev_warn(&udev->dev, "%dmA over %dmA budget!\n",
+				2 * (delta - ceiling), 2 * ceiling);
 		remaining -= delta;
 	}
 	if (remaining < 0) {
@@ -1271,20 +1567,24 @@ hub_power_remaining (struct usb_hub *hub, struct usb_device *hdev)
 	}
 	return remaining;
 }
- 
+
+/* Handle physical or logical connection change events.
+ * This routine is called when:
+ * 	a port connection-change occurs;
+ *	a port enable-change occurs (often caused by EMI);
+ *	usb_reset_device() encounters changed descriptors (as from
+ *		a firmware download)
+ */
 static void hub_port_connect_change(struct usb_hub *hub, int port,
 					u16 portstatus, u16 portchange)
 {
-	struct usb_device *hdev = interface_to_usbdev(hub->intf);
+	struct usb_device *hdev = hub->hdev;
 	struct device *hub_dev = &hub->intf->dev;
 	int status, i;
  
 	dev_dbg (hub_dev,
 		"port %d, status %04x, change %04x, %s\n",
 		port + 1, portstatus, portchange, portspeed (portstatus));
- 
-	/* Clear the connection change status */
-	clear_port_feature(hdev, port + 1, USB_PORT_FEAT_C_CONNECTION);
 
 	if (hub->has_indicators) {
 		set_port_led(hdev, port + 1, HUB_LED_AUTO);
@@ -1294,6 +1594,18 @@ static void hub_port_connect_change(struct usb_hub *hub, int port,
 	/* Disconnect any existing devices under this port */
 	if (hdev->children[port])
 		usb_disconnect(&hdev->children[port]);
+	clear_bit(port, hub->change_bits);
+
+	if (portchange & USB_PORT_STAT_C_CONNECTION) {
+		status = hub_port_debounce(hdev, port);
+		if (status < 0) {
+			dev_err (hub_dev,
+				"connect-debounce failed, port %d disabled\n",
+				port+1);
+			goto done;
+		}
+		portstatus = status;
+	}
 
 	/* Return now if nothing is connected */
 	if (!(portstatus & USB_PORT_STAT_CONNECTION)) {
@@ -1308,13 +1620,6 @@ static void hub_port_connect_change(struct usb_hub *hub, int port,
   			goto done;
 		return;
 	}
-  
-	if (hub_port_debounce(hdev, port)) {
-		dev_err (hub_dev,
-			"connect-debounce failed, port %d disabled\n",
-			port+1);
-		goto done;
-	}
 
 	for (i = 0; i < SET_CONFIG_TRIES; i++) {
 		struct usb_device *udev;
@@ -1328,21 +1633,21 @@ static void hub_port_connect_change(struct usb_hub *hub, int port,
 				"couldn't allocate port %d usb_device\n", port+1);
 			goto done;
 		}
-		udev->state = USB_STATE_POWERED;
-	  
-		/* hub can tell if it's lowspeed already:  D- pullup (not D+) */
-		if (portstatus & USB_PORT_STAT_LOW_SPEED)
-			udev->speed = USB_SPEED_LOW;
-		else
-			udev->speed = USB_SPEED_UNKNOWN;
 
-		/* reset, set address, get descriptor, add to hub's children */
-		down (&udev->serialize);
+		usb_set_device_state(udev, USB_STATE_POWERED);
+		udev->speed = USB_SPEED_UNKNOWN;
+ 
+		/* set the address */
+		choose_address(udev);
+		if (udev->devnum <= 0) {
+			status = -ENOTCONN;	/* Don't retry */
+			goto loop;
+		}
+
+		/* reset and get descriptor */
 		status = hub_port_init(hdev, udev, port);
-		if (status == -ENOTCONN)
-			break;
 		if (status < 0)
-			continue;
+			goto loop;
 
 		/* consecutive bus-powered hubs aren't reliable; they can
 		 * violate the voltage drop budget.  if the new child has
@@ -1358,7 +1663,7 @@ static void hub_port_connect_change(struct usb_hub *hub, int port,
 					&devstat);
 			if (status < 0) {
 				dev_dbg(&udev->dev, "get status %d ?\n", status);
-				continue;
+				goto loop;
 			}
 			cpu_to_le16s(&devstat);
 			if ((devstat & (1 << USB_DEVICE_SELF_POWERED)) == 0) {
@@ -1370,10 +1675,8 @@ static void hub_port_connect_change(struct usb_hub *hub, int port,
 						INDICATOR_AMBER_BLINK;
 					schedule_work (&hub->leds);
 				}
-				hdev->children[port] = NULL;
-				usb_put_dev(udev);
-				hub_port_disable(hdev, port);
-				return;
+				status = -ENOTCONN;	/* Don't retry */
+				goto loop;
 			}
 		}
  
@@ -1383,21 +1686,54 @@ static void hub_port_connect_change(struct usb_hub *hub, int port,
 				&& highspeed_hubs != 0)
 			check_highspeed (hub, udev, port);
 
+		/* Store the parent's children[] pointer.  At this point
+		 * udev becomes globally accessible, although presumably
+		 * no one will look at it until hdev is unlocked.
+		 */
+		down (&udev->serialize);
+		status = 0;
+
+		/* We mustn't add new devices if the parent hub has
+		 * been disconnected; we would race with the
+		 * recursively_mark_NOTATTACHED() routine.
+		 */
+		spin_lock_irq(&device_state_lock);
+		if (hdev->state == USB_STATE_NOTATTACHED)
+			status = -ENOTCONN;
+		else
+			hdev->children[port] = udev;
+		spin_unlock_irq(&device_state_lock);
+
 		/* Run it through the hoops (find a driver, etc) */
-		status = usb_new_device(udev);
-		if (status != 0) {
-			hdev->children[port] = NULL;
-			continue;
+		if (!status) {
+			status = usb_new_device(udev);
+			if (status) {
+				spin_lock_irq(&device_state_lock);
+				hdev->children[port] = NULL;
+				spin_unlock_irq(&device_state_lock);
+			}
 		}
+
 		up (&udev->serialize);
+		if (status)
+			goto loop;
 
-		status = hub_power_remaining(hub, hdev);
+		status = hub_power_remaining(hub);
 		if (status)
 			dev_dbg(hub_dev,
 				"%dmA power budget left\n",
 				2 * status);
 
 		return;
+
+loop:
+		hub_port_disable(hdev, port);
+		usb_disable_endpoint(udev, 0 + USB_DIR_IN);
+		usb_disable_endpoint(udev, 0 + USB_DIR_OUT);
+		release_address(udev);
+		usb_put_dev(udev);
+		if (status == -ENOTCONN)
+			break;
 	}
  
 done:
@@ -1406,7 +1742,6 @@ done:
 
 static void hub_events(void)
 {
-	unsigned long flags;
 	struct list_head *tmp;
 	struct usb_device *hdev;
 	struct usb_hub *hub;
@@ -1416,6 +1751,7 @@ static void hub_events(void)
 	u16 portstatus;
 	u16 portchange;
 	int i, ret;
+	int connect_change;
 
 	/*
 	 *  We restart the list every time to avoid a deadlock with
@@ -1424,24 +1760,32 @@ static void hub_events(void)
 	 * Not the most efficient, but avoids deadlocks.
 	 */
 	while (1) {
-		spin_lock_irqsave(&hub_event_lock, flags);
 
-		if (list_empty(&hub_event_list))
+		/* Grab the first entry at the beginning of the list */
+		spin_lock_irq(&hub_event_lock);
+		if (list_empty(&hub_event_list)) {
+			spin_unlock_irq(&hub_event_lock);
 			break;
+		}
 
-		/* Grab the next entry from the beginning of the list */
 		tmp = hub_event_list.next;
+		list_del_init(tmp);
 
 		hub = list_entry(tmp, struct usb_hub, event_list);
-		hdev = interface_to_usbdev(hub->intf);
+		hdev = hub->hdev;
 		hub_dev = &hub->intf->dev;
 
-		list_del_init(tmp);
-
-		if (unlikely(down_trylock(&hub->khubd_sem)))
-			BUG();	/* never blocks, we were on list */
+		usb_get_dev(hdev);
+		spin_unlock_irq(&hub_event_lock);
 
-		spin_unlock_irqrestore(&hub_event_lock, flags);
+		/* Lock the device, then check to see if we were
+		 * disconnected while waiting for the lock to succeed. */
+		down(&hdev->serialize);
+		if (hdev->state != USB_STATE_CONFIGURED ||
+				!hdev->actconfig ||
+				hub != usb_get_intfdata(
+					hdev->actconfig->interface[0]))
+			goto loop;
 
 		if (hub->error) {
 			dev_dbg (hub_dev, "resetting for error %d\n",
@@ -1450,27 +1794,38 @@ static void hub_events(void)
 			if (hub_reset(hub)) {
 				dev_dbg (hub_dev,
 					"can't reset; disconnecting\n");
-				up(&hub->khubd_sem);
 				hub_start_disconnect(hdev);
-				continue;
+				goto loop;
 			}
 
 			hub->nerrors = 0;
 			hub->error = 0;
 		}
 
+		/* deal with port status changes */
 		for (i = 0; i < hub->descriptor->bNbrPorts; i++) {
-			ret = hub_port_status(hdev, i, &portstatus, &portchange);
-			if (ret < 0) {
+			connect_change = test_bit(i, hub->change_bits);
+			if (!test_and_clear_bit(i+1, hub->event_bits) &&
+					!connect_change)
+				continue;
+
+			ret = hub_port_status(hdev, i,
+					&portstatus, &portchange);
+			if (ret < 0)
 				continue;
-			}
 
 			if (portchange & USB_PORT_STAT_C_CONNECTION) {
-				hub_port_connect_change(hub, i, portstatus, portchange);
-			} else if (portchange & USB_PORT_STAT_C_ENABLE) {
-				dev_dbg (hub_dev,
-					"port %d enable change, status %08x\n",
-					i + 1, portstatus);
+				clear_port_feature(hdev,
+					i + 1, USB_PORT_FEAT_C_CONNECTION);
+				connect_change = 1;
+			}
+
+			if (portchange & USB_PORT_STAT_C_ENABLE) {
+				if (!connect_change)
+					dev_dbg (hub_dev,
+						"port %d enable change, "
+						"status %08x\n",
+						i + 1, portstatus);
 				clear_port_feature(hdev,
 					i + 1, USB_PORT_FEAT_C_ENABLE);
 
@@ -1481,24 +1836,29 @@ static void hub_events(void)
 				 * Works at least with mouse driver. 
 				 */
 				if (!(portstatus & USB_PORT_STAT_ENABLE)
-				    && (portstatus & USB_PORT_STAT_CONNECTION)
-				    && (hdev->children[i])) {
+				    && !connect_change
+				    && hdev->children[i]) {
 					dev_err (hub_dev,
 					    "port %i "
 					    "disabled by hub (EMI?), "
-					    "re-enabling...",
+					    "re-enabling...\n",
 						i + 1);
-					hub_port_connect_change(hub,
-						i, portstatus, portchange);
+					connect_change = 1;
 				}
 			}
 
 			if (portchange & USB_PORT_STAT_C_SUSPEND) {
+				clear_port_feature(hdev, i + 1,
+					USB_PORT_FEAT_C_SUSPEND);
+				if (hdev->children[i])
+					ret = remote_wakeup(hdev->children[i]);
+				else
+					ret = -ENODEV;
 				dev_dbg (hub_dev,
-					"suspend change on port %d\n",
-					i + 1);
-				clear_port_feature(hdev,
-					i + 1,  USB_PORT_FEAT_C_SUSPEND);
+					"resume on port %d, status %d\n",
+					i + 1, ret);
+				if (ret < 0)
+					ret = hub_port_disable(hdev, i);
 			}
 			
 			if (portchange & USB_PORT_STAT_C_OVERCURRENT) {
@@ -1517,10 +1877,16 @@ static void hub_events(void)
 				clear_port_feature(hdev,
 					i + 1, USB_PORT_FEAT_C_RESET);
 			}
+
+			if (connect_change)
+				hub_port_connect_change(hub, i,
+						portstatus, portchange);
 		} /* end for i */
 
 		/* deal with hub status changes */
-		if (hub_hub_status(hub, &hubstatus, &hubchange) < 0)
+		if (test_and_clear_bit(0, hub->event_bits) == 0)
+			;	/* do nothing */
+		else if (hub_hub_status(hub, &hubstatus, &hubchange) < 0)
 			dev_err (hub_dev, "get_hub_status failed\n");
 		else {
 			if (hubchange & HUB_CHANGE_LOCAL_POWER) {
@@ -1534,10 +1900,12 @@ static void hub_events(void)
                         	hub_power_on(hub);
 			}
 		}
-		up(&hub->khubd_sem);
-        } /* end while (1) */
 
-	spin_unlock_irqrestore(&hub_event_lock, flags);
+loop:
+		up(&hdev->serialize);
+		usb_put_dev(hdev);
+
+        } /* end while (1) */
 }
 
 static int hub_thread(void *__unused)
@@ -1577,13 +1945,12 @@ static struct usb_driver hub_driver = {
 	.name =		"hub",
 	.probe =	hub_probe,
 	.disconnect =	hub_disconnect,
+	.suspend =	hub_suspend,
+	.resume =	hub_resume,
 	.ioctl =	hub_ioctl,
 	.id_table =	hub_id_table,
 };
 
-/*
- * This should be a separate module.
- */
 int usb_hub_init(void)
 {
 	pid_t pid;
@@ -1659,23 +2026,34 @@ static int config_descriptors_changed(struct usb_device *udev)
 				!= 0) {
 			dev_dbg(&udev->dev, "config index %d changed (#%d)\n",
 				index, buf->bConfigurationValue);
-/* FIXME enable this when we can re-enumerate after reset;
- * until then DFU-ish drivers need this and other workarounds
- */
-//			break;
+			break;
 		}
 	}
 	kfree(buf);
 	return index != udev->descriptor.bNumConfigurations;
 }
 
-/*
+/**
+ * usb_reset_devce - perform a USB port reset to reinitialize a device
+ * @udev: device to reset (not in SUSPENDED or NOTATTACHED state)
+ *
  * WARNING - don't reset any device unless drivers for all of its
  * interfaces are expecting that reset!  Maybe some driver->reset()
  * method should eventually help ensure sufficient cooperation.
  *
- * This is the same as usb_reset_device() except that the caller
- * already holds dev->serialize.  For example, it's safe to use
+ * Do a port reset, reassign the device's address, and establish its
+ * former operating configuration.  If the reset fails, or the device's
+ * descriptors change from their values before the reset, or the original
+ * configuration and altsettings cannot be restored, a flag will be set
+ * telling khubd to pretend the device has been disconnected and then
+ * re-connected.  All drivers will be unbound, and the device will be
+ * re-enumerated and probed all over again.
+ *
+ * Returns 0 if the reset succeeded, -ENODEV if the device has been
+ * flagged for logical disconnection, or some other negative error code
+ * if the reset wasn't even attempted.
+ *
+ * The caller must own the device lock.  For example, it's safe to use
  * this from a driver probe() routine after downloading new firmware.
  */
 int __usb_reset_device(struct usb_device *udev)
@@ -1683,13 +2061,23 @@ int __usb_reset_device(struct usb_device *udev)
 	struct usb_device *parent = udev->parent;
 	struct usb_device_descriptor descriptor = udev->descriptor;
 	int i, ret, port = -1;
+	struct usb_hub *hub;
 
+	if (udev->state == USB_STATE_NOTATTACHED ||
+			udev->state == USB_STATE_SUSPENDED) {
+		dev_dbg(&udev->dev, "device reset not allowed in state %d\n",
+				udev->state);
+		return -EINVAL;
+	}
+
+	/* FIXME: This should be legal for regular hubs.  Root hubs may
+	 * have special requirements. */
 	if (udev->maxchild) {
 		/* this requires hub- or hcd-specific logic;
 		 * see hub_reset() and OHCI hc_restart()
 		 */
 		dev_dbg(&udev->dev, "%s for hub!\n", __FUNCTION__);
-		return -EINVAL;
+		return -EISDIR;
 	}
 
 	for (i = 0; i < parent->maxchild; i++)
@@ -1698,8 +2086,11 @@ int __usb_reset_device(struct usb_device *udev)
 			break;
 		}
 
-	if (port < 0)
+	if (port < 0) {
+		/* If this ever happens, it's very bad */
+		dev_err(&udev->dev, "Can't locate device's port!\n");
 		return -ENOENT;
+	}
 
 	ret = hub_port_init(parent, udev, port);
 	if (ret < 0)
@@ -1726,7 +2117,7 @@ int __usb_reset_device(struct usb_device *udev)
 			udev->actconfig->desc.bConfigurationValue, ret);
 		goto re_enumerate;
   	}
-	udev->state = USB_STATE_CONFIGURED;
+	usb_set_device_state(udev, USB_STATE_CONFIGURED);
 
 	for (i = 0; i < udev->actconfig->desc.bNumInterfaces; i++) {
 		struct usb_interface *intf = udev->actconfig->interface[i];
@@ -1751,8 +2142,18 @@ int __usb_reset_device(struct usb_device *udev)
 	return 0;
  
 re_enumerate:
-	/* FIXME make some task re-enumerate; don't just mark unusable */
-	udev->state = USB_STATE_NOTATTACHED;
+	hub_port_disable(parent, port);
+
+	hub = usb_get_intfdata(parent->actconfig->interface[0]);
+	set_bit(port, hub->change_bits);
+
+	spin_lock_irq(&hub_event_lock);
+	if (list_empty(&hub->event_list)) {
+		list_add_tail(&hub->event_list, &hub_event_list);
+		wake_up(&khubd_wait);
+	}
+	spin_unlock_irq(&hub_event_lock);
+
 	return -ENODEV;
 }
 EXPORT_SYMBOL(__usb_reset_device);
diff --git a/drivers/usb/core/hub.h b/drivers/usb/core/hub.h
index a24b1afa7..9e81738fd 100644
--- a/drivers/usb/core/hub.h
+++ b/drivers/usb/core/hub.h
@@ -187,9 +187,8 @@ extern void usb_hub_tt_clear_buffer (struct usb_device *dev, int pipe);
 
 struct usb_hub {
 	struct usb_interface	*intf;		/* the "real" device */
+	struct usb_device	*hdev;
 	struct urb		*urb;		/* for interrupt polling pipe */
-	struct completion	*urb_complete;	/* wait for urb to end */
-	unsigned int		urb_active:1;
 
 	/* buffer for urb ... 1 bit each for hub and children, rounded up */
 	char			(*buffer)[(USB_MAXCHILDREN + 1 + 7) / 8];
@@ -202,11 +201,15 @@ struct usb_hub {
 	int			error;		/* last reported error */
 	int			nerrors;	/* track consecutive errors */
 
-	struct list_head	hub_list;	/* all hubs */
 	struct list_head	event_list;	/* hubs w/data or errs ready */
+	unsigned long		event_bits[1];	/* status change bitmask */
+	unsigned long		change_bits[1];	/* ports with logical connect
+							status change */
+#if USB_MAXCHILDREN > 31 /* 8*sizeof(unsigned long) - 1 */
+#error event_bits[] is too short!
+#endif
 
 	struct usb_hub_descriptor *descriptor;	/* class descriptor */
-	struct semaphore	khubd_sem;
 	struct usb_tt		tt;		/* Transaction Translator */
 
 	u8			power_budget;	/* in 2mA units; or zero */
@@ -216,4 +219,15 @@ struct usb_hub {
 	struct work_struct	leds;
 };
 
+/* use this for low-powered root hubs */
+static inline void
+hub_set_power_budget (struct usb_device *hubdev, unsigned mA)
+{
+	struct usb_hub	*hub;
+
+	hub = (struct usb_hub *)
+		usb_get_intfdata (hubdev->actconfig->interface[0]);
+	hub->power_budget = min(mA,(unsigned)500)/2;
+}
+
 #endif /* __LINUX_HUB_H */
diff --git a/drivers/usb/core/inode.c b/drivers/usb/core/inode.c
index e9046f684..d73c3ad45 100644
--- a/drivers/usb/core/inode.c
+++ b/drivers/usb/core/inode.c
@@ -48,6 +48,7 @@ static struct vfsmount *usbdevfs_mount;
 static struct vfsmount *usbfs_mount;
 static int usbdevfs_mount_count;	/* = 0 */
 static int usbfs_mount_count;	/* = 0 */
+static int ignore_mount = 0;
 
 static struct dentry *devices_usbdevfs_dentry;
 static struct dentry *devices_usbfs_dentry;
@@ -88,6 +89,17 @@ static int parse_options(struct super_block *s, char *data)
 	char *p;
 	int option;
 
+	/* (re)set to defaults. */
+	devuid = 0;
+	busuid = 0;
+	listuid = 0;
+	devgid = 0;
+	busgid = 0;
+	listgid = 0;
+	devmode = S_IWUSR | S_IRUGO;
+	busmode = S_IXUGO | S_IRUGO;
+	listmode = S_IRUGO;
+
 	while ((p = strsep(&data, ",")) != NULL) {
 		substring_t args[MAX_OPT_ARGS];
 		int token;
@@ -151,6 +163,89 @@ static int parse_options(struct super_block *s, char *data)
 	return 0;
 }
 
+static void update_special(struct dentry *special)
+{
+	special->d_inode->i_uid = listuid;
+	special->d_inode->i_gid = listgid;
+	special->d_inode->i_mode = S_IFREG | listmode;
+}
+
+static void update_dev(struct dentry *dev)
+{
+	dev->d_inode->i_uid = devuid;
+	dev->d_inode->i_gid = devgid;
+	dev->d_inode->i_mode = S_IFREG | devmode;
+}
+
+static void update_bus(struct dentry *bus)
+{
+	struct dentry *dev = NULL;
+
+	bus->d_inode->i_uid = busuid;
+	bus->d_inode->i_gid = busgid;
+	bus->d_inode->i_mode = S_IFDIR | busmode;
+
+	down(&bus->d_inode->i_sem);
+
+	list_for_each_entry(dev, &bus->d_subdirs, d_child)
+		if (dev->d_inode)
+			update_dev(dev);
+
+	up(&bus->d_inode->i_sem);
+}
+
+static void update_sb(struct super_block *sb)
+{
+	struct dentry *root = sb->s_root;
+	struct dentry *bus = NULL;
+
+	if (!root)
+		return;
+
+	down(&root->d_inode->i_sem);
+
+	list_for_each_entry(bus, &root->d_subdirs, d_child) {
+		if (bus->d_inode) {
+			switch (S_IFMT & bus->d_inode->i_mode) {
+			case S_IFDIR:
+				update_bus(bus);
+				break;
+			case S_IFREG:
+				update_special(bus);
+				break;
+			default:
+				warn("Unknown node %s mode %x found on remount!\n",bus->d_name.name,bus->d_inode->i_mode);
+				break;
+			}
+		}
+	}
+
+	up(&root->d_inode->i_sem);
+}
+
+static int remount(struct super_block *sb, int *flags, char *data)
+{
+	/* If this is not a real mount,
+	 * i.e. it's a simple_pin_fs from create_special_files,
+	 * then ignore it.
+	 */
+	if (ignore_mount)
+		return 0;
+
+	if (parse_options(sb, data)) {
+		warn("usbfs: mount parameter error:");
+		return -EINVAL;
+	}
+
+	if (usbfs_mount && usbfs_mount->mnt_sb)
+		update_sb(usbfs_mount->mnt_sb);
+
+	if (usbdevfs_mount && usbdevfs_mount->mnt_sb)
+		update_sb(usbdevfs_mount->mnt_sb);
+
+	return 0;
+}
+
 static struct inode *usbfs_get_inode (struct super_block *sb, int mode, dev_t dev)
 {
 	struct inode *inode = new_inode(sb);
@@ -349,6 +444,7 @@ static struct inode_operations usbfs_dir_inode_operations = {
 static struct super_operations usbfs_ops = {
 	.statfs =	simple_statfs,
 	.drop_inode =	generic_delete_inode,
+	.remount_fs =	remount,
 };
 
 static int usbfs_fill_super(struct super_block *sb, void *data, int silent)
@@ -356,11 +452,6 @@ static int usbfs_fill_super(struct super_block *sb, void *data, int silent)
 	struct inode *inode;
 	struct dentry *root;
 
-	if (parse_options(sb, data)) {
-		warn("usbfs: mount parameter error:");
-		return -EINVAL;
-	}
-
 	sb->s_blocksize = PAGE_CACHE_SIZE;
 	sb->s_blocksize_bits = PAGE_CACHE_SHIFT;
 	sb->s_magic = USBDEVICE_SUPER_MAGIC;
@@ -523,6 +614,11 @@ static int create_special_files (void)
 	struct dentry *parent;
 	int retval;
 
+	/* the simple_pin_fs calls will call remount with no options
+	 * without this flag that would overwrite the real mount options (if any)
+	 */
+	ignore_mount = 1;
+
 	/* create the devices special file */
 	retval = simple_pin_fs("usbdevfs", &usbdevfs_mount, &usbdevfs_mount_count);
 	if (retval) {
@@ -536,6 +632,8 @@ static int create_special_files (void)
 		goto error_clean_usbdevfs_mount;
 	}
 
+	ignore_mount = 0;
+
 	parent = usbfs_mount->mnt_sb->s_root;
 	devices_usbfs_dentry = fs_create_file ("devices",
 					       listmode | S_IFREG, parent,
diff --git a/drivers/usb/core/message.c b/drivers/usb/core/message.c
index 6304f2750..e0eacc28a 100644
--- a/drivers/usb/core/message.c
+++ b/drivers/usb/core/message.c
@@ -91,8 +91,8 @@ int usb_internal_control_msg(struct usb_device *usb_dev, unsigned int pipe,
 	if (!urb)
 		return -ENOMEM;
   
-	usb_fill_control_urb(urb, usb_dev, pipe, (unsigned char*)cmd, data, len,
-		   usb_api_blocking_completion, 0);
+	usb_fill_control_urb(urb, usb_dev, pipe, (unsigned char *)cmd, data,
+			     len, usb_api_blocking_completion, NULL);
 
 	retv = usb_start_wait_urb(urb, timeout, &length);
 	if (retv < 0)
@@ -190,7 +190,7 @@ int usb_bulk_msg(struct usb_device *usb_dev, unsigned int pipe,
 		return -ENOMEM;
 
 	usb_fill_bulk_urb(urb, usb_dev, pipe, data, len,
-		    usb_api_blocking_completion, 0);
+			  usb_api_blocking_completion, NULL);
 
 	return usb_start_wait_urb(urb,timeout,actual_length);
 }
@@ -203,11 +203,11 @@ static void sg_clean (struct usb_sg_request *io)
 		while (io->entries--)
 			usb_free_urb (io->urbs [io->entries]);
 		kfree (io->urbs);
-		io->urbs = 0;
+		io->urbs = NULL;
 	}
 	if (io->dev->dev.dma_mask != 0)
 		usb_buffer_unmap_sg (io->dev, io->pipe, io->sg, io->nents);
-	io->dev = 0;
+	io->dev = NULL;
 }
 
 static void sg_complete (struct urb *urb, struct pt_regs *regs)
@@ -260,7 +260,7 @@ static void sg_complete (struct urb *urb, struct pt_regs *regs)
 				found = 1;
 		}
 	}
-	urb->dev = 0;
+	urb->dev = NULL;
 
 	/* on the last completion, signal usb_sg_wait() */
 	io->bytes += urb->actual_length;
@@ -356,7 +356,7 @@ int usb_sg_init (
 			goto nomem;
 		}
 
-		io->urbs [i]->dev = 0;
+		io->urbs [i]->dev = NULL;
 		io->urbs [i]->pipe = pipe;
 		io->urbs [i]->interval = period;
 		io->urbs [i]->transfer_flags = urb_flags;
@@ -459,7 +459,7 @@ void usb_sg_wait (struct usb_sg_request *io)
 		case -ENXIO:	// hc didn't queue this one
 		case -EAGAIN:
 		case -ENOMEM:
-			io->urbs [i]->dev = 0;
+			io->urbs[i]->dev = NULL;
 			retval = 0;
 			i--;
 			yield ();
@@ -485,7 +485,7 @@ void usb_sg_wait (struct usb_sg_request *io)
 				complete (&io->complete);
 			spin_unlock_irq (&io->lock);
 
-			io->urbs [i]->dev = 0;
+			io->urbs[i]->dev = NULL;
 			io->urbs [i]->status = retval;
 			dev_dbg (&io->dev->dev, "%s, submit --> %d\n",
 				__FUNCTION__, retval);
@@ -566,22 +566,19 @@ void usb_sg_cancel (struct usb_sg_request *io)
  */
 int usb_get_descriptor(struct usb_device *dev, unsigned char type, unsigned char index, void *buf, int size)
 {
-	int i = 5;
+	int i;
 	int result;
 	
 	memset(buf,0,size);	// Make sure we parse really received data
 
-	while (i--) {
+	for (i = 0; i < 3; ++i) {
 		/* retry on length 0 or stall; some devices are flakey */
-		if ((result = usb_control_msg(dev, usb_rcvctrlpipe(dev, 0),
-				    USB_REQ_GET_DESCRIPTOR, USB_DIR_IN,
-				    (type << 8) + index, 0, buf, size,
-				    HZ * USB_CTRL_GET_TIMEOUT)) > 0
-				|| result != -EPIPE)
+		result = usb_control_msg(dev, usb_rcvctrlpipe(dev, 0),
+				USB_REQ_GET_DESCRIPTOR, USB_DIR_IN,
+				(type << 8) + index, 0, buf, size,
+				HZ * USB_CTRL_GET_TIMEOUT);
+		if (!(result == 0 || result == -EPIPE))
 			break;
-
-		dev_dbg (&dev->dev, "RETRY descriptor, result %d\n", result);
-		result = -ENOMSG;
 	}
 	return result;
 }
@@ -608,12 +605,128 @@ int usb_get_descriptor(struct usb_device *dev, unsigned char type, unsigned char
  * Returns the number of bytes received on success, or else the status code
  * returned by the underlying usb_control_msg() call.
  */
-int usb_get_string(struct usb_device *dev, unsigned short langid, unsigned char index, void *buf, int size)
+int usb_get_string(struct usb_device *dev, unsigned short langid,
+		unsigned char index, void *buf, int size)
 {
-	return usb_control_msg(dev, usb_rcvctrlpipe(dev, 0),
-		USB_REQ_GET_DESCRIPTOR, USB_DIR_IN,
-		(USB_DT_STRING << 8) + index, langid, buf, size,
-		HZ * USB_CTRL_GET_TIMEOUT);
+	int i;
+	int result;
+
+	for (i = 0; i < 3; ++i) {
+		/* retry on length 0 or stall; some devices are flakey */
+		result = usb_control_msg(dev, usb_rcvctrlpipe(dev, 0),
+			USB_REQ_GET_DESCRIPTOR, USB_DIR_IN,
+			(USB_DT_STRING << 8) + index, langid, buf, size,
+			HZ * USB_CTRL_GET_TIMEOUT);
+		if (!(result == 0 || result == -EPIPE))
+			break;
+	}
+	return result;
+}
+
+static int usb_string_sub(struct usb_device *dev, unsigned int langid,
+		unsigned int index, unsigned char *buf)
+{
+	int rc;
+
+	/* Try to read the string descriptor by asking for the maximum
+	 * possible number of bytes */
+	rc = usb_get_string(dev, langid, index, buf, 255);
+
+	/* If that failed try to read the descriptor length, then
+	 * ask for just that many bytes */
+	if (rc < 0) {
+		rc = usb_get_string(dev, langid, index, buf, 2);
+		if (rc == 2)
+			rc = usb_get_string(dev, langid, index, buf, buf[0]);
+	}
+
+	if (rc >= 0) {
+		/* There might be extra junk at the end of the descriptor */
+		if (buf[0] < rc)
+			rc = buf[0];
+		if (rc < 2)
+			rc = -EINVAL;
+	}
+	return rc;
+}
+
+/**
+ * usb_string - returns ISO 8859-1 version of a string descriptor
+ * @dev: the device whose string descriptor is being retrieved
+ * @index: the number of the descriptor
+ * @buf: where to put the string
+ * @size: how big is "buf"?
+ * Context: !in_interrupt ()
+ * 
+ * This converts the UTF-16LE encoded strings returned by devices, from
+ * usb_get_string_descriptor(), to null-terminated ISO-8859-1 encoded ones
+ * that are more usable in most kernel contexts.  Note that all characters
+ * in the chosen descriptor that can't be encoded using ISO-8859-1
+ * are converted to the question mark ("?") character, and this function
+ * chooses strings in the first language supported by the device.
+ *
+ * The ASCII (or, redundantly, "US-ASCII") character set is the seven-bit
+ * subset of ISO 8859-1. ISO-8859-1 is the eight-bit subset of Unicode,
+ * and is appropriate for use many uses of English and several other
+ * Western European languages.  (But it doesn't include the "Euro" symbol.)
+ *
+ * This call is synchronous, and may not be used in an interrupt context.
+ *
+ * Returns length of the string (>= 0) or usb_control_msg status (< 0).
+ */
+int usb_string(struct usb_device *dev, int index, char *buf, size_t size)
+{
+	unsigned char *tbuf;
+	int err;
+	unsigned int u, idx;
+
+	if (size <= 0 || !buf || !index)
+		return -EINVAL;
+	buf[0] = 0;
+	tbuf = kmalloc(256, GFP_KERNEL);
+	if (!tbuf)
+		return -ENOMEM;
+
+	/* get langid for strings if it's not yet known */
+	if (!dev->have_langid) {
+		err = usb_string_sub(dev, 0, 0, tbuf);
+		if (err < 0) {
+			dev_err (&dev->dev,
+				"string descriptor 0 read error: %d\n",
+				err);
+			goto errout;
+		} else if (err < 4) {
+			dev_err (&dev->dev, "string descriptor 0 too short\n");
+			err = -EINVAL;
+			goto errout;
+		} else {
+			dev->have_langid = -1;
+			dev->string_langid = tbuf[2] | (tbuf[3]<< 8);
+				/* always use the first langid listed */
+			dev_dbg (&dev->dev, "default language 0x%04x\n",
+				dev->string_langid);
+		}
+	}
+	
+	err = usb_string_sub(dev, dev->string_langid, index, tbuf);
+	if (err < 0)
+		goto errout;
+
+	size--;		/* leave room for trailing NULL char in output buffer */
+	for (idx = 0, u = 2; u < err; u += 2) {
+		if (idx >= size)
+			break;
+		if (tbuf[u+1])			/* high byte */
+			buf[idx++] = '?';  /* non ISO-8859-1 character */
+		else
+			buf[idx++] = tbuf[u];
+	}
+	buf[idx] = 0;
+	err = idx;
+
+ errout:
+	kfree(tbuf);
+	return err;
 }
 
 /**
@@ -830,6 +943,7 @@ void usb_disable_device(struct usb_device *dev, int skip_ep0)
 			interface = dev->actconfig->interface[i];
 			dev_dbg (&dev->dev, "unregistering interface %s\n",
 				interface->dev.bus_id);
+			usb_remove_sysfs_intf_files(interface);
 			device_del (&interface->dev);
 		}
 
@@ -840,9 +954,9 @@ void usb_disable_device(struct usb_device *dev, int skip_ep0)
 			put_device (&dev->actconfig->interface[i]->dev);
 			dev->actconfig->interface[i] = NULL;
 		}
-		dev->actconfig = 0;
+		dev->actconfig = NULL;
 		if (dev->state == USB_STATE_CONFIGURED)
-			dev->state = USB_STATE_ADDRESS;
+			usb_set_device_state(dev, USB_STATE_ADDRESS);
 	}
 }
 
@@ -1047,7 +1161,7 @@ int usb_reset_configuration(struct usb_device *dev)
 			config->desc.bConfigurationValue, 0,
 			NULL, 0, HZ * USB_CTRL_SET_TIMEOUT);
 	if (retval < 0) {
-		dev->state = USB_STATE_ADDRESS;
+		usb_set_device_state(dev, USB_STATE_ADDRESS);
 		return retval;
 	}
 
@@ -1185,9 +1299,9 @@ free_interfaces:
 
 	dev->actconfig = cp;
 	if (!cp)
-		dev->state = USB_STATE_ADDRESS;
+		usb_set_device_state(dev, USB_STATE_ADDRESS);
 	else {
-		dev->state = USB_STATE_CONFIGURED;
+		usb_set_device_state(dev, USB_STATE_CONFIGURED);
 
 		/* Initialize the new interface structures and the
 		 * hc/hcd/usbcore interface/endpoint state.
@@ -1259,102 +1373,6 @@ free_interfaces:
 	return ret;
 }
 
-/**
- * usb_string - returns ISO 8859-1 version of a string descriptor
- * @dev: the device whose string descriptor is being retrieved
- * @index: the number of the descriptor
- * @buf: where to put the string
- * @size: how big is "buf"?
- * Context: !in_interrupt ()
- * 
- * This converts the UTF-16LE encoded strings returned by devices, from
- * usb_get_string_descriptor(), to null-terminated ISO-8859-1 encoded ones
- * that are more usable in most kernel contexts.  Note that all characters
- * in the chosen descriptor that can't be encoded using ISO-8859-1
- * are converted to the question mark ("?") character, and this function
- * chooses strings in the first language supported by the device.
- *
- * The ASCII (or, redundantly, "US-ASCII") character set is the seven-bit
- * subset of ISO 8859-1. ISO-8859-1 is the eight-bit subset of Unicode,
- * and is appropriate for use many uses of English and several other
- * Western European languages.  (But it doesn't include the "Euro" symbol.)
- *
- * This call is synchronous, and may not be used in an interrupt context.
- *
- * Returns length of the string (>= 0) or usb_control_msg status (< 0).
- */
-int usb_string(struct usb_device *dev, int index, char *buf, size_t size)
-{
-	unsigned char *tbuf;
-	int err, len;
-	unsigned int u, idx;
-
-	if (size <= 0 || !buf || !index)
-		return -EINVAL;
-	buf[0] = 0;
-	tbuf = kmalloc(256, GFP_KERNEL);
-	if (!tbuf)
-		return -ENOMEM;
-
-	/* get langid for strings if it's not yet known */
-	if (!dev->have_langid) {
-		err = usb_get_descriptor(dev, USB_DT_STRING, 0, tbuf, 4);
-		if (err < 0) {
-			dev_err (&dev->dev,
-				"string descriptor 0 read error: %d\n",
-				err);
-			goto errout;
-		} else if (err < 4 || tbuf[0] < 4) {
-			dev_err (&dev->dev, "string descriptor 0 too short\n");
-			err = -EINVAL;
-			goto errout;
-		} else {
-			dev->have_langid = -1;
-			dev->string_langid = tbuf[2] | (tbuf[3]<< 8);
-				/* always use the first langid listed */
-			dev_dbg (&dev->dev, "default language 0x%04x\n",
-				dev->string_langid);
-		}
-	}
-
-	/*
-	 * ask for the length of the string 
-	 */
-
-	err = usb_get_string(dev, dev->string_langid, index, tbuf, 2);
-	if (err == -EPIPE) {
-		dev_dbg(&dev->dev, "RETRY string %d read/%d\n", index, 2);
-		err = usb_get_string(dev, dev->string_langid, index, tbuf, 2);
-	}
-	if(err<2)
-		goto errout;
-	len=tbuf[0];	
-	
-	err = usb_get_string(dev, dev->string_langid, index, tbuf, len);
-	if (err == -EPIPE) {
-		dev_dbg(&dev->dev, "RETRY string %d read/%d\n", index, len);
-		err = usb_get_string(dev, dev->string_langid, index, tbuf, len);
-	}
-	if (err < 0)
-		goto errout;
-
-	size--;		/* leave room for trailing NULL char in output buffer */
-	for (idx = 0, u = 2; u < err; u += 2) {
-		if (idx >= size)
-			break;
-		if (tbuf[u+1])			/* high byte */
-			buf[idx++] = '?';  /* non ISO-8859-1 character */
-		else
-			buf[idx++] = tbuf[u];
-	}
-	buf[idx] = 0;
-	err = idx;
-
- errout:
-	kfree(tbuf);
-	return err;
-}
-
 // synchronous request completion model
 EXPORT_SYMBOL(usb_control_msg);
 EXPORT_SYMBOL(usb_bulk_msg);
diff --git a/drivers/usb/core/sysfs.c b/drivers/usb/core/sysfs.c
index 38c64f656..78c5ca2f1 100644
--- a/drivers/usb/core/sysfs.c
+++ b/drivers/usb/core/sysfs.c
@@ -2,8 +2,8 @@
  * drivers/usb/core/sysfs.c
  *
  * (C) Copyright 2002 David Brownell
- * (C) Copyright 2002 Greg Kroah-Hartman
- * (C) Copyright 2002 IBM Corp.
+ * (C) Copyright 2002,2004 Greg Kroah-Hartman
+ * (C) Copyright 2002,2004 IBM Corp.
  *
  * All of the sysfs file attributes for usb devices and interfaces.
  *
@@ -162,29 +162,35 @@ usb_descriptor_attr (bDeviceSubClass, "%02x\n")
 usb_descriptor_attr (bDeviceProtocol, "%02x\n")
 usb_descriptor_attr (bNumConfigurations, "%d\n")
 
+static struct attribute *dev_attrs[] = {
+	/* current configuration's attributes */
+	&dev_attr_bNumInterfaces.attr,
+	&dev_attr_bConfigurationValue.attr,
+	&dev_attr_bmAttributes.attr,
+	&dev_attr_bMaxPower.attr,
+	/* device attributes */
+	&dev_attr_idVendor.attr,
+	&dev_attr_idProduct.attr,
+	&dev_attr_bcdDevice.attr,
+	&dev_attr_bDeviceClass.attr,
+	&dev_attr_bDeviceSubClass.attr,
+	&dev_attr_bDeviceProtocol.attr,
+	&dev_attr_bNumConfigurations.attr,
+	&dev_attr_speed.attr,
+	&dev_attr_devnum.attr,
+	&dev_attr_version.attr,
+	&dev_attr_maxchild.attr,
+	NULL,
+};
+static struct attribute_group dev_attr_grp = {
+	.attrs = dev_attrs,
+};
 
 void usb_create_sysfs_dev_files (struct usb_device *udev)
 {
 	struct device *dev = &udev->dev;
 
-	/* current configuration's attributes */
-	device_create_file (dev, &dev_attr_bNumInterfaces);
-	device_create_file (dev, &dev_attr_bConfigurationValue);
-	device_create_file (dev, &dev_attr_bmAttributes);
-	device_create_file (dev, &dev_attr_bMaxPower);
-
-	/* device attributes */
-	device_create_file (dev, &dev_attr_idVendor);
-	device_create_file (dev, &dev_attr_idProduct);
-	device_create_file (dev, &dev_attr_bcdDevice);
-	device_create_file (dev, &dev_attr_bDeviceClass);
-	device_create_file (dev, &dev_attr_bDeviceSubClass);
-	device_create_file (dev, &dev_attr_bDeviceProtocol);
-	device_create_file (dev, &dev_attr_bNumConfigurations);
-
-	/* speed varies depending on how you connect the device */
-	device_create_file (dev, &dev_attr_speed);
-	// FIXME iff there are other speed configs, show how many
+	sysfs_create_group(&dev->kobj, &dev_attr_grp);
 
 	if (udev->descriptor.iManufacturer)
 		device_create_file (dev, &dev_attr_manufacturer);
@@ -192,10 +198,20 @@ void usb_create_sysfs_dev_files (struct usb_device *udev)
 		device_create_file (dev, &dev_attr_product);
 	if (udev->descriptor.iSerialNumber)
 		device_create_file (dev, &dev_attr_serial);
+}
+
+void usb_remove_sysfs_dev_files (struct usb_device *udev)
+{
+	struct device *dev = &udev->dev;
 
-	device_create_file (dev, &dev_attr_devnum);
-	device_create_file (dev, &dev_attr_version);
-	device_create_file (dev, &dev_attr_maxchild);
+	sysfs_remove_group(&dev->kobj, &dev_attr_grp);
+
+	if (udev->descriptor.iManufacturer)
+		device_remove_file(dev, &dev_attr_manufacturer);
+	if (udev->descriptor.iProduct)
+		device_remove_file(dev, &dev_attr_product);
+	if (udev->descriptor.iSerialNumber)
+		device_remove_file(dev, &dev_attr_serial);
 }
 
 /* Interface fields */
@@ -217,13 +233,26 @@ usb_intf_attr (bInterfaceSubClass, "%02x\n")
 usb_intf_attr (bInterfaceProtocol, "%02x\n")
 usb_intf_attr (iInterface, "%02x\n")
 
+static struct attribute *intf_attrs[] = {
+	&dev_attr_bInterfaceNumber.attr,
+	&dev_attr_bAlternateSetting.attr,
+	&dev_attr_bNumEndpoints.attr,
+	&dev_attr_bInterfaceClass.attr,
+	&dev_attr_bInterfaceSubClass.attr,
+	&dev_attr_bInterfaceProtocol.attr,
+	&dev_attr_iInterface.attr,
+	NULL,
+};
+static struct attribute_group intf_attr_grp = {
+	.attrs = intf_attrs,
+};
+
 void usb_create_sysfs_intf_files (struct usb_interface *intf)
 {
-	device_create_file (&intf->dev, &dev_attr_bInterfaceNumber);
-	device_create_file (&intf->dev, &dev_attr_bAlternateSetting);
-	device_create_file (&intf->dev, &dev_attr_bNumEndpoints);
-	device_create_file (&intf->dev, &dev_attr_bInterfaceClass);
-	device_create_file (&intf->dev, &dev_attr_bInterfaceSubClass);
-	device_create_file (&intf->dev, &dev_attr_bInterfaceProtocol);
-	device_create_file (&intf->dev, &dev_attr_iInterface);
+	sysfs_create_group(&intf->dev.kobj, &intf_attr_grp);
+}
+
+void usb_remove_sysfs_intf_files (struct usb_interface *intf)
+{
+	sysfs_remove_group(&intf->dev.kobj, &intf_attr_grp);
 }
diff --git a/drivers/usb/core/urb.c b/drivers/usb/core/urb.c
index 25d5d1926..777f34ea6 100644
--- a/drivers/usb/core/urb.c
+++ b/drivers/usb/core/urb.c
@@ -77,7 +77,7 @@ struct urb *usb_alloc_urb(int iso_packets, int mem_flags)
 
 /**
  * usb_free_urb - frees the memory used by a urb when all users of it are finished
- * @urb: pointer to the urb to free
+ * @urb: pointer to the urb to free, may be NULL
  *
  * Must be called when a user of a urb is finished with it.  When the last user
  * of the urb calls this function, the memory of the urb is freed.
@@ -93,7 +93,7 @@ void usb_free_urb(struct urb *urb)
 
 /**
  * usb_get_urb - increments the reference count of the urb
- * @urb: pointer to the urb to modify
+ * @urb: pointer to the urb to modify, may be NULL
  *
  * This must be  called whenever a urb is transferred from a device driver to a
  * host controller driver.  This allows proper reference counting to happen
@@ -398,7 +398,8 @@ int usb_submit_urb(struct urb *urb, int mem_flags)
 
 /**
  * usb_unlink_urb - abort/cancel a transfer request for an endpoint
- * @urb: pointer to urb describing a previously submitted request
+ * @urb: pointer to urb describing a previously submitted request,
+ *	may be NULL
  *
  * This routine cancels an in-progress request.  URBs complete only
  * once per submission, and may be canceled only once per submission.
@@ -407,26 +408,25 @@ int usb_submit_urb(struct urb *urb, int mem_flags)
  * canceled (rather than any other code) and will quickly be removed
  * from host controller data structures.
  *
- * When the URB_ASYNC_UNLINK transfer flag for the URB is clear, this
- * request is synchronous.  Success is indicated by returning zero,
- * at which time the urb will have been unlinked and its completion
- * handler will have been called with urb->status == -ENOENT.  Failure is
- * indicated by any other return value.
- *
- * The synchronous cancelation mode may not be used
- * when unlinking an urb from an interrupt context, such as a bottom
- * half or a completion handler; or when holding a spinlock; or in
- * other cases when the caller can't schedule().
+ * In the past, clearing the URB_ASYNC_UNLINK transfer flag for the
+ * URB indicated that the request was synchronous.  This usage is now
+ * deprecated; if the flag is clear the call will be forwarded to
+ * usb_kill_urb() and the return value will be 0.  In the future, drivers
+ * should call usb_kill_urb() directly for synchronous unlinking.
  *
  * When the URB_ASYNC_UNLINK transfer flag for the URB is set, this
  * request is asynchronous.  Success is indicated by returning -EINPROGRESS,
- * at which time the urb will normally not have been unlinked.
- * The completion function will see urb->status == -ECONNRESET.  Failure
- * is indicated by any other return value.
+ * at which time the URB will normally have been unlinked but not yet
+ * given back to the device driver.  When it is called, the completion
+ * function will see urb->status == -ECONNRESET.  Failure is indicated
+ * by any other return value.  Unlinking will fail when the URB is not
+ * currently "linked" (i.e., it was never submitted, or it was unlinked
+ * before, or the hardware is already finished with it), even if the
+ * completion handler has not yet run.
  *
  * Unlinking and Endpoint Queues:
  *
- * Host Controller Driver (HCDs) place all the URBs for a particular
+ * Host Controller Drivers (HCDs) place all the URBs for a particular
  * endpoint in a queue.  Normally the queue advances as the controller
  * hardware processes each request.  But when an URB terminates with any
  * fault (such as an error, or being unlinked) its queue stops, at least
@@ -449,16 +449,57 @@ int usb_submit_urb(struct urb *urb, int mem_flags)
  * An unlinked URB may leave a gap in the stream of packets.  It is undefined
  * whether such gaps can be filled in.
  *
- * When control URBs terminates with an error, it is likely that the
+ * When a control URB terminates with an error, it is likely that the
  * status stage of the transfer will not take place, even if it is merely
  * a soft error resulting from a short-packet with URB_SHORT_NOT_OK set.
  */
 int usb_unlink_urb(struct urb *urb)
 {
-	if (urb && urb->dev && urb->dev->bus && urb->dev->bus->op)
-		return urb->dev->bus->op->unlink_urb(urb);
-	else
+	if (!urb)
+		return -EINVAL;
+	if (!(urb->transfer_flags & URB_ASYNC_UNLINK)) {
+		usb_kill_urb(urb);
+		return 0;
+	}
+	if (!(urb->dev && urb->dev->bus && urb->dev->bus->op))
 		return -ENODEV;
+	return urb->dev->bus->op->unlink_urb(urb, -ECONNRESET);
+}
+
+/**
+ * usb_kill_urb - cancel a transfer request and wait for it to finish
+ * @urb: pointer to URB describing a previously submitted request,
+ *	may be NULL
+ *
+ * This routine cancels an in-progress request.  It is guaranteed that
+ * upon return all completion handlers will have finished and the URB
+ * will be totally idle and available for reuse.  These features make
+ * this an ideal way to stop I/O in a disconnect() callback or close()
+ * function.  If the request has not already finished or been unlinked
+ * the completion handler will see urb->status == -ENOENT.
+ *
+ * While the routine is running, attempts to resubmit the URB will fail
+ * with error -EPERM.  Thus even if the URB's completion handler always
+ * tries to resubmit, it will not succeed and the URB will become idle.
+ *
+ * This routine may not be used in an interrupt context (such as a bottom
+ * half or a completion handler), or when holding a spinlock, or in other
+ * situations where the caller can't schedule().
+ */
+void usb_kill_urb(struct urb *urb)
+{
+	if (!(urb && urb->dev && urb->dev->bus && urb->dev->bus->op))
+		return;
+	spin_lock_irq(&urb->lock);
+	++urb->reject;
+	spin_unlock_irq(&urb->lock);
+
+	urb->dev->bus->op->unlink_urb(urb, -ENOENT);
+	wait_event(usb_kill_urb_queue, atomic_read(&urb->use_count) == 0);
+
+	spin_lock_irq(&urb->lock);
+	--urb->reject;
+	spin_unlock_irq(&urb->lock);
 }
 
 EXPORT_SYMBOL(usb_init_urb);
@@ -467,4 +508,5 @@ EXPORT_SYMBOL(usb_free_urb);
 EXPORT_SYMBOL(usb_get_urb);
 EXPORT_SYMBOL(usb_submit_urb);
 EXPORT_SYMBOL(usb_unlink_urb);
+EXPORT_SYMBOL(usb_kill_urb);
 
diff --git a/drivers/usb/core/usb.c b/drivers/usb/core/usb.c
index 3c2ddb5d0..324e16caf 100644
--- a/drivers/usb/core/usb.c
+++ b/drivers/usb/core/usb.c
@@ -649,7 +649,7 @@ static int usb_hotplug (struct device *dev, char **envp, int num_envp,
 		scratch += length;
 
 	}
-	envp [i++] = 0;
+	envp[i++] = NULL;
 
 	return 0;
 }
@@ -883,6 +883,8 @@ struct usb_device *usb_find_device(u16 vendor_id, u16 product_id)
 	     buslist != &usb_bus_list; 
 	     buslist = buslist->next) {
 		bus = container_of(buslist, struct usb_bus, bus_list);
+		if (!bus->root_hub)
+			continue;
 		dev = match_device(bus->root_hub, vendor_id, product_id);
 		if (dev)
 			goto exit;
@@ -944,235 +946,6 @@ int __usb_get_extra_descriptor(char *buffer, unsigned size,
 	return -1;
 }
 
-/**
- * usb_disconnect - disconnect a device (usbcore-internal)
- * @pdev: pointer to device being disconnected
- * Context: !in_interrupt ()
- *
- * Something got disconnected. Get rid of it, and all of its children.
- *
- * Only hub drivers (including virtual root hub drivers for host
- * controllers) should ever call this.
- *
- * This call is synchronous, and may not be used in an interrupt context.
- */
-void usb_disconnect(struct usb_device **pdev)
-{
-	struct usb_device	*dev = *pdev;
-	struct usb_bus		*bus;
-	struct usb_operations	*ops;
-	int			i;
-
-	might_sleep ();
-
-	if (!dev) {
-		pr_debug ("%s nodev\n", __FUNCTION__);
-		return;
-	}
-	bus = dev->bus;
-	if (!bus) {
-		pr_debug ("%s nobus\n", __FUNCTION__);
-		return;
-	}
-	ops = bus->op;
-
-	*pdev = NULL;
-
-	/* mark the device as inactive, so any further urb submissions for
-	 * this device will fail.
-	 */
-	dev->state = USB_STATE_NOTATTACHED;
-	down(&dev->serialize);
-
-	dev_info (&dev->dev, "USB disconnect, address %d\n", dev->devnum);
-
-	/* Free up all the children before we remove this device */
-	for (i = 0; i < USB_MAXCHILDREN; i++) {
-		struct usb_device **child = dev->children + i;
-		if (*child)
-			usb_disconnect(child);
-	}
-
-	/* deallocate hcd/hardware state ... nuking all pending urbs and
-	 * cleaning up all state associated with the current configuration
-	 */
-	usb_disable_device(dev, 0);
-
-	/* Free the device number and remove the /proc/bus/usb entry */
-	dev_dbg (&dev->dev, "unregistering device\n");
-	usb_release_address(dev);
-	usbfs_remove_device(dev);
-	up(&dev->serialize);
-	device_unregister(&dev->dev);
-}
-
-/**
- * usb_choose_address - pick device address (usbcore-internal)
- * @dev: newly detected device (in DEFAULT state)
- *
- * Picks a device address.  It's up to the hub (or root hub) driver
- * to handle and manage enumeration, starting from the DEFAULT state.
- * Only hub drivers (but not virtual root hub drivers for host
- * controllers) should ever call this.
- */
-void usb_choose_address(struct usb_device *dev)
-{
-	int devnum;
-	// FIXME needs locking for SMP!!
-	/* why? this is called only from the hub thread, 
-	 * which hopefully doesn't run on multiple CPU's simultaneously 8-)
-	 */
-
-	/* Try to allocate the next devnum beginning at bus->devnum_next. */
-	devnum = find_next_zero_bit(dev->bus->devmap.devicemap, 128, dev->bus->devnum_next);
-	if (devnum >= 128)
-		devnum = find_next_zero_bit(dev->bus->devmap.devicemap, 128, 1);
-
-	dev->bus->devnum_next = ( devnum >= 127 ? 1 : devnum + 1);
-
-	if (devnum < 128) {
-		set_bit(devnum, dev->bus->devmap.devicemap);
-		dev->devnum = devnum;
-	}
-}
-
-/**
- * usb_release_address - deallocate device address (usbcore-internal)
- * @dev: newly removed device
- *
- * Removes and deallocates the address assigned to a device.
- * Only hub drivers (but not virtual root hub drivers for host
- * controllers) should ever call this.
- */
-void usb_release_address(struct usb_device *dev)
-{
-	if (dev->devnum > 0) {
-		clear_bit(dev->devnum, dev->bus->devmap.devicemap);
-		dev->devnum = -1;
-	}
-}
-
-
-static inline void usb_show_string(struct usb_device *dev, char *id, int index)
-{
-	char *buf;
-
-	if (!index)
-		return;
-	if (!(buf = kmalloc(256, GFP_KERNEL)))
-		return;
-	if (usb_string(dev, index, buf, 256) > 0)
-		dev_printk(KERN_INFO, &dev->dev, "%s: %s\n", id, buf);
-	kfree(buf);
-}
-
-static int usb_choose_configuration(struct usb_device *dev)
-{
-	int c, i;
-
-	c = dev->config[0].desc.bConfigurationValue;
-	if (dev->descriptor.bNumConfigurations != 1) {
-		for (i = 0; i < dev->descriptor.bNumConfigurations; i++) {
-			struct usb_interface_descriptor	*desc;
-
-			/* heuristic:  Linux is more likely to have class
-			 * drivers, so avoid vendor-specific interfaces.
-			 */
-			desc = &dev->config[i].intf_cache[0]
-					->altsetting->desc;
-			if (desc->bInterfaceClass == USB_CLASS_VENDOR_SPEC)
-				continue;
-			/* COMM/2/all is CDC ACM, except 0xff is MSFT RNDIS */
-			if (desc->bInterfaceClass == USB_CLASS_COMM
-					&& desc->bInterfaceSubClass == 2
-					&& desc->bInterfaceProtocol == 0xff)
-				continue;
-			c = dev->config[i].desc.bConfigurationValue;
-			break;
-		}
-		dev_info(&dev->dev,
-			"configuration #%d chosen from %d choices\n",
-			c, dev->descriptor.bNumConfigurations);
-	}
-	return c;
-}
-
-/*
- * usb_new_device - perform initial device setup (usbcore-internal)
- * @dev: newly addressed device (in ADDRESS state)
- *
- * This is called with devices which have been enumerated, but not yet
- * configured.  The device descriptor is available, but not descriptors
- * for any device configuration.  The caller owns dev->serialize, and
- * the device is not visible through sysfs or other filesystem code.
- *
- * Returns 0 for success (device is configured and listed, with its
- * interfaces, in sysfs); else a negative errno value.  On error, one
- * reference count to the device has been dropped.
- *
- * This call is synchronous, and may not be used in an interrupt context.
- *
- * Only the hub driver should ever call this; root hub registration
- * uses it only indirectly.
- */
-int usb_new_device(struct usb_device *dev)
-{
-	int err;
-	int c;
-
-	err = usb_get_configuration(dev);
-	if (err < 0) {
-		dev_err(&dev->dev, "can't read configurations, error %d\n",
-			err);
-		goto fail;
-	}
-
-	/* Tell the world! */
-	dev_dbg(&dev->dev, "new device strings: Mfr=%d, Product=%d, SerialNumber=%d\n",
-		dev->descriptor.iManufacturer, dev->descriptor.iProduct, dev->descriptor.iSerialNumber);
-
-#ifdef DEBUG
-	if (dev->descriptor.iProduct)
-		usb_show_string(dev, "Product", dev->descriptor.iProduct);
-	if (dev->descriptor.iManufacturer)
-		usb_show_string(dev, "Manufacturer", dev->descriptor.iManufacturer);
-	if (dev->descriptor.iSerialNumber)
-		usb_show_string(dev, "SerialNumber", dev->descriptor.iSerialNumber);
-#endif
-
-	/* put device-specific files into sysfs */
-	err = device_add (&dev->dev);
-	if (err) {
-		dev_err(&dev->dev, "can't device_add, error %d\n", err);
-		goto fail;
-	}
-	usb_create_sysfs_dev_files (dev);
-
-	/* choose and set the configuration. that registers the interfaces
-	 * with the driver core, and lets usb device drivers bind to them.
-	 * NOTE:  should interact with hub power budgeting.
-	 */
-	c = usb_choose_configuration(dev);
-	err = usb_set_configuration(dev, c);
-	if (err) {
-		dev_err(&dev->dev, "can't set config #%d, error %d\n", c, err);
-		device_del(&dev->dev);
-		goto fail;
-	}
-
-	/* USB device state == configured ... usable */
-
-	/* add a /proc/bus/usb entry */
-	usbfs_add_device(dev);
-
-	return 0;
-fail:
-	dev->state = USB_STATE_NOTATTACHED;
-	usb_release_address(dev);
-	usb_put_dev(dev);
-	return err;
-}
-
 /**
  * usb_buffer_alloc - allocate dma-consistent buffer for URB_NO_xxx_DMA_MAP
  * @dev: device the buffer will be used with
@@ -1202,7 +975,7 @@ void *usb_buffer_alloc (
 )
 {
 	if (!dev || !dev->bus || !dev->bus->op || !dev->bus->op->buffer_alloc)
-		return 0;
+		return NULL;
 	return dev->bus->op->buffer_alloc (dev->bus, size, mem_flags, dma);
 }
 
@@ -1254,7 +1027,7 @@ struct urb *usb_buffer_map (struct urb *urb)
 			|| !urb->dev
 			|| !(bus = urb->dev->bus)
 			|| !(controller = bus->controller))
-		return 0;
+		return NULL;
 
 	if (controller->dma_mask) {
 		urb->transfer_dma = dma_map_single (controller,
@@ -1448,13 +1221,15 @@ void usb_buffer_unmap_sg (struct usb_device *dev, unsigned pipe,
 			usb_pipein (pipe) ? DMA_FROM_DEVICE : DMA_TO_DEVICE);
 }
 
-static int usb_device_suspend(struct device *dev, u32 state)
+static int usb_generic_suspend(struct device *dev, u32 state)
 {
 	struct usb_interface *intf;
 	struct usb_driver *driver;
 
+	if (dev->driver == &usb_generic_driver)
+		return usb_suspend_device (to_usb_device(dev), state);
+
 	if ((dev->driver == NULL) ||
-	    (dev->driver == &usb_generic_driver) ||
 	    (dev->driver_data == &usb_generic_driver_data))
 		return 0;
 
@@ -1466,13 +1241,16 @@ static int usb_device_suspend(struct device *dev, u32 state)
 	return 0;
 }
 
-static int usb_device_resume(struct device *dev)
+static int usb_generic_resume(struct device *dev)
 {
 	struct usb_interface *intf;
 	struct usb_driver *driver;
 
+	/* devices resume through their hub */
+	if (dev->driver == &usb_generic_driver)
+		return usb_resume_device (to_usb_device(dev));
+
 	if ((dev->driver == NULL) ||
-	    (dev->driver == &usb_generic_driver) ||
 	    (dev->driver_data == &usb_generic_driver_data))
 		return 0;
 
@@ -1488,8 +1266,8 @@ struct bus_type usb_bus_type = {
 	.name =		"usb",
 	.match =	usb_device_match,
 	.hotplug =	usb_hotplug,
-	.suspend =	usb_device_suspend,
-	.resume =	usb_device_resume,
+	.suspend =	usb_generic_suspend,
+	.resume =	usb_generic_resume,
 };
 
 #ifndef MODULE
@@ -1527,7 +1305,9 @@ static int __init usb_init(void)
 	retval = bus_register(&usb_bus_type);
 	if (retval) 
 		goto out;
-	usb_host_init();
+	retval = usb_host_init();
+	if (retval)
+		goto host_init_failed;
 	retval = usb_major_init();
 	if (retval)
 		goto major_init_failed;
@@ -1549,6 +1329,7 @@ fs_init_failed:
 	usb_major_cleanup();	
 major_init_failed:
 	usb_host_cleanup();
+host_init_failed:
 	bus_unregister(&usb_bus_type);
 out:
 	return retval;
diff --git a/drivers/usb/core/usb.h b/drivers/usb/core/usb.h
index 886b79daa..7d978af3a 100644
--- a/drivers/usb/core/usb.h
+++ b/drivers/usb/core/usb.h
@@ -1,7 +1,9 @@
 /* Functions local to drivers/usb/core/ */
 
 extern void usb_create_sysfs_dev_files (struct usb_device *dev);
+extern void usb_remove_sysfs_dev_files (struct usb_device *dev);
 extern void usb_create_sysfs_intf_files (struct usb_interface *intf);
+extern void usb_remove_sysfs_intf_files (struct usb_interface *intf);
 extern int usb_probe_interface (struct device *dev);
 extern int usb_unbind_interface (struct device *dev);
 
@@ -19,5 +21,8 @@ extern int usb_get_device_descriptor(struct usb_device *dev,
 		unsigned int size);
 extern int usb_set_configuration(struct usb_device *dev, int configuration);
 
+extern void usb_set_device_state(struct usb_device *udev,
+		enum usb_device_state new_state);
+
 /* for labeling diagnostics */
 extern const char *usbcore_name;
diff --git a/drivers/usb/gadget/Kconfig b/drivers/usb/gadget/Kconfig
index 71c1cdc34..9189fb0da 100644
--- a/drivers/usb/gadget/Kconfig
+++ b/drivers/usb/gadget/Kconfig
@@ -208,6 +208,16 @@ config USB_ZERO
 	  Say "y" to link the driver statically, or "m" to build a
 	  dynamically linked module called "g_zero".
 
+config USB_ZERO_HNPTEST
+	boolean "HNP Test Device"
+	depends on USB_ZERO && USB_OTG
+	help
+	  You can configure this device to enumerate using the device
+	  identifiers of the USB-OTG test device.  That means that when
+	  this gadget connects to another OTG device, with this one using
+	  the "B-Peripheral" role, that device will use HNP to let this
+	  one serve as the USB host instead (in the "B-Host" role).
+
 config USB_ETH
 	tristate "Ethernet Gadget"
 	depends on NET
diff --git a/drivers/usb/gadget/dummy_hcd.c b/drivers/usb/gadget/dummy_hcd.c
index 5fd8ea6f6..4c1b157cf 100644
--- a/drivers/usb/gadget/dummy_hcd.c
+++ b/drivers/usb/gadget/dummy_hcd.c
@@ -146,8 +146,6 @@ struct dummy {
 	u8				fifo_buf [FIFO_SIZE];
 	u16				devstatus;
 
-	struct hcd_dev			*hdev;
-
 	/*
 	 * MASTER/HOST side support
 	 */
@@ -159,6 +157,8 @@ struct dummy {
 	struct completion		released;
 	unsigned			resuming:1;
 	unsigned long			re_timeout;
+
+	struct usb_device		*udev;
 };
 
 static struct dummy	*the_controller;
@@ -739,11 +739,9 @@ stop_activity (struct dummy *dum, struct usb_gadget_driver *driver)
 	struct dummy_ep	*ep;
 
 	/* prevent any more requests */
-	dum->hdev = 0;
 	dum->address = 0;
 
-	/* this might not succeed ... */
-	del_timer (&dum->timer);
+	/* The timer is left running so that outstanding URBs can fail */
 
 	/* nuke any pending requests first, so driver i/o is quiesced */
 	list_for_each_entry (ep, &dum->gadget.ep_list, ep.ep_list)
@@ -784,7 +782,6 @@ usb_gadget_unregister_driver (struct usb_gadget_driver *driver)
 
 	driver_unregister (&driver->driver);
 
-	del_timer_sync (&dum->timer);
 	return 0;
 }
 EXPORT_SYMBOL (usb_gadget_unregister_driver);
@@ -825,8 +822,12 @@ static int dummy_urb_enqueue (
 	dum = container_of (hcd, struct dummy, hcd);
 	spin_lock_irqsave (&dum->lock, flags);
 
-	if (!dum->hdev)
-		dum->hdev = urb->dev->hcpriv;
+	if (!dum->udev) {
+		dum->udev = urb->dev;
+		usb_get_dev (dum->udev);
+	} else if (unlikely (dum->udev != urb->dev))
+		dev_err (hardware, "usb_device address has changed!\n");
+
 	urb->hcpriv = dum;
 	if (usb_pipetype (urb->pipe) == PIPE_CONTROL)
 		urb->error_count = 1;		/* mark as a new urb */
@@ -994,10 +995,17 @@ static int periodic_bytes (struct dummy *dum, struct dummy_ep *ep)
 	return limit;
 }
 
+#define is_active(dum)	((dum->port_status & \
+		(USB_PORT_STAT_CONNECTION | USB_PORT_STAT_ENABLE | \
+			USB_PORT_STAT_SUSPEND)) \
+		== (USB_PORT_STAT_CONNECTION | USB_PORT_STAT_ENABLE))
+
 static struct dummy_ep *find_endpoint (struct dummy *dum, u8 address)
 {
 	int		i;
 
+	if (!is_active (dum))
+		return NULL;
 	if ((address & ~USB_DIR_IN) == 0)
 		return &dum->ep [0];
 	for (i = 1; i < DUMMY_ENDPOINTS; i++) {
@@ -1011,6 +1019,8 @@ static struct dummy_ep *find_endpoint (struct dummy *dum, u8 address)
 	return NULL;
 }
 
+#undef is_active
+
 #define Dev_Request	(USB_TYPE_STANDARD | USB_RECIP_DEVICE)
 #define Dev_InRequest	(Dev_Request | USB_DIR_IN)
 #define Intf_Request	(USB_TYPE_STANDARD | USB_RECIP_INTERFACE)
@@ -1024,17 +1034,12 @@ static struct dummy_ep *find_endpoint (struct dummy *dum, u8 address)
 static void dummy_timer (unsigned long _dum)
 {
 	struct dummy		*dum = (struct dummy *) _dum;
-	struct hcd_dev		*hdev = dum->hdev;
+	struct hcd_dev		*hdev;
 	struct list_head	*entry, *tmp;
 	unsigned long		flags;
 	int			limit, total;
 	int			i;
 
-	if (!hdev) {
-		dev_err (hardware, "timer fired with device gone?\n");
-		return;
-	}
-
 	/* simplistic model for one frame's bandwidth */
 	switch (dum->gadget.speed) {
 	case USB_SPEED_LOW:
@@ -1055,6 +1060,14 @@ static void dummy_timer (unsigned long _dum)
 
 	/* look at each urb queued by the host side driver */
 	spin_lock_irqsave (&dum->lock, flags);
+
+	if (!dum->udev) {
+		dev_err (hardware, "timer fired with no URBs pending?\n");
+		spin_unlock_irqrestore (&dum->lock, flags);
+		return;
+	}
+	hdev = dum->udev->hcpriv;
+
 	for (i = 0; i < DUMMY_ENDPOINTS; i++) {
 		if (!ep_name [i])
 			break;
@@ -1152,11 +1165,6 @@ restart:
 			case USB_REQ_SET_ADDRESS:
 				if (setup.bRequestType != Dev_Request)
 					break;
-				if (dum->address != 0) {
-					maybe_set_status (urb, -ETIMEDOUT);
-					urb->actual_length = 0;
-					goto return_urb;
-				}
 				dum->address = setup.wValue;
 				maybe_set_status (urb, 0);
 				dev_dbg (hardware, "set_address = %d\n",
@@ -1331,7 +1339,11 @@ return_urb:
 
 	/* want a 1 msec delay here */
 	if (!list_empty (&hdev->urb_list))
-		mod_timer (&dum->timer, jiffies + 1);
+		mod_timer (&dum->timer, jiffies + msecs_to_jiffies(1));
+	else {
+		usb_put_dev (dum->udev);
+		dum->udev = NULL;
+	}
 
 	spin_unlock_irqrestore (&dum->lock, flags);
 }
@@ -1404,9 +1416,8 @@ static int dummy_hub_control (
 			break;
 		case USB_PORT_FEAT_POWER:
 			dum->port_status = 0;
-			dum->address = 0;
-			dum->hdev = 0;
 			dum->resuming = 0;
+			stop_activity(dum, dum->driver);
 			break;
 		default:
 			dum->port_status &= ~(1 << wValue);
@@ -1569,10 +1580,12 @@ show_urbs (struct device *dev, char *buf)
 	struct urb		*urb;
 	size_t			size = 0;
 	unsigned long		flags;
+	struct hcd_dev		*hdev;
 
 	spin_lock_irqsave (&dum->lock, flags);
-	if (dum->hdev) {
-		list_for_each_entry (urb, &dum->hdev->urb_list, urb_list) {
+	if (dum->udev) {
+		hdev = dum->udev->hcpriv;
+		list_for_each_entry (urb, &hdev->urb_list, urb_list) {
 			size_t		temp;
 
 			temp = show_urb (buf, PAGE_SIZE - size, urb);
@@ -1657,7 +1670,7 @@ clean0:
 	INIT_LIST_HEAD (&hcd->dev_list);
 	usb_register_bus (bus);
 
-	bus->root_hub = root = usb_alloc_dev (0, bus, 0);
+	root = usb_alloc_dev (0, bus, 0);
 	if (!root) {
 		retval = -ENOMEM;
 clean1:
@@ -1671,14 +1684,16 @@ clean1:
 	root->speed = USB_SPEED_HIGH;
 
 	/* ...then configured, so khubd sees us. */
-	if ((retval = hcd_register_root (&dum->hcd)) != 0) {
-		bus->root_hub = 0;
+	if ((retval = hcd_register_root (root, &dum->hcd)) != 0) {
 		usb_put_dev (root);
 clean2:
 		dum->hcd.state = USB_STATE_QUIESCING;
 		goto clean1;
 	}
 
+	/* only show a low-power port: just 8mA */
+	hub_set_power_budget (root, 8);
+
 	dum->started = 1;
 
 	if ((retval = dummy_register_udc (dum)) != 0) {
diff --git a/drivers/usb/gadget/epautoconf.c b/drivers/usb/gadget/epautoconf.c
index a67ba2632..2d529f15b 100644
--- a/drivers/usb/gadget/epautoconf.c
+++ b/drivers/usb/gadget/epautoconf.c
@@ -192,7 +192,7 @@ find_ep (struct usb_gadget *gadget, const char *name)
 		if (0 == strcmp (ep->name, name))
 			return ep;
 	}
-	return 0;
+	return NULL;
 }
 
 /**
@@ -280,7 +280,7 @@ struct usb_ep * __init usb_ep_autoconfig (
 	}
 
 	/* Fail */
-	return 0;
+	return NULL;
 }
 
 /**
@@ -297,7 +297,7 @@ void __init usb_ep_autoconfig_reset (struct usb_gadget *gadget)
 	struct usb_ep	*ep;
 
 	list_for_each_entry (ep, &gadget->ep_list, ep_list) {
-		ep->driver_data = 0;
+		ep->driver_data = NULL;
 	}
 #ifdef	MANY_ENDPOINTS
 	in_epnum = 0;
diff --git a/drivers/usb/gadget/ether.c b/drivers/usb/gadget/ether.c
index 2891eeeef..174afd47b 100644
--- a/drivers/usb/gadget/ether.c
+++ b/drivers/usb/gadget/ether.c
@@ -118,6 +118,7 @@ struct eth_dev {
 	unsigned		zlp:1;
 	unsigned		cdc:1;
 	unsigned		rndis:1;
+	unsigned		suspended:1;
 	u16			cdc_filter;
 	unsigned long		todo;
 #define	WORK_RX_MEMORY		0
@@ -233,7 +234,7 @@ MODULE_PARM_DESC(host_addr, "Host Ethernet Address");
 /* For CDC-incapable hardware, choose the simple cdc subset.
  * Anything that talks bulk (without notable bugs) can do this.
  */
-#ifdef CONFIG_USB_GADGET_PXA
+#ifdef CONFIG_USB_GADGET_PXA2XX
 #define	DEV_CONFIG_SUBSET
 #endif
 
@@ -337,6 +338,9 @@ module_param (qmult, uint, S_IRUGO|S_IWUSR);
  *
  * NOTE:  Controllers like superh_udc should probably be able to use
  * an RNDIS-only configuration.
+ *
+ * FIXME define some higher-powered configurations to make it easier
+ * to recharge batteries ...
  */
 
 #define DEV_CONFIG_VALUE	1	/* cdc or subset */
@@ -360,6 +364,14 @@ device_desc = {
 	.bNumConfigurations =	1,
 };
 
+static struct usb_otg_descriptor
+otg_descriptor = {
+	.bLength =		sizeof otg_descriptor,
+	.bDescriptorType =	USB_DT_OTG,
+
+	.bmAttributes =		USB_OTG_SRP,
+};
+
 static struct usb_config_descriptor
 eth_config = {
 	.bLength =		sizeof eth_config,
@@ -374,7 +386,7 @@ eth_config = {
 };
 
 #ifdef	CONFIG_USB_ETH_RNDIS
-static const struct usb_config_descriptor 
+static struct usb_config_descriptor 
 rndis_config = {
 	.bLength =              sizeof rndis_config,
 	.bDescriptorType =      USB_DT_CONFIG,
@@ -670,7 +682,8 @@ fs_sink_desc = {
 	.bmAttributes =		USB_ENDPOINT_XFER_BULK,
 };
 
-static const struct usb_descriptor_header *fs_eth_function [10] = {
+static const struct usb_descriptor_header *fs_eth_function [11] = {
+	(struct usb_descriptor_header *) &otg_descriptor,
 #ifdef DEV_CONFIG_CDC
 	/* "cdc" mode descriptors */
 	(struct usb_descriptor_header *) &control_intf,
@@ -684,24 +697,25 @@ static const struct usb_descriptor_header *fs_eth_function [10] = {
 	(struct usb_descriptor_header *) &data_intf,
 	(struct usb_descriptor_header *) &fs_source_desc,
 	(struct usb_descriptor_header *) &fs_sink_desc,
-	0,
+	NULL,
 #endif /* DEV_CONFIG_CDC */
 };
 
 static inline void __init fs_subset_descriptors(void)
 {
 #ifdef DEV_CONFIG_SUBSET
-	fs_eth_function[0] = (struct usb_descriptor_header *) &subset_data_intf;
-	fs_eth_function[1] = (struct usb_descriptor_header *) &fs_source_desc;
-	fs_eth_function[2] = (struct usb_descriptor_header *) &fs_sink_desc;
-	fs_eth_function[3] = 0;
+	fs_eth_function[1] = (struct usb_descriptor_header *) &subset_data_intf;
+	fs_eth_function[2] = (struct usb_descriptor_header *) &fs_source_desc;
+	fs_eth_function[3] = (struct usb_descriptor_header *) &fs_sink_desc;
+	fs_eth_function[4] = NULL;
 #else
-	fs_eth_function[0] = 0;
+	fs_eth_function[1] = NULL;
 #endif
 }
 
 #ifdef	CONFIG_USB_ETH_RNDIS
 static const struct usb_descriptor_header *fs_rndis_function [] = {
+	(struct usb_descriptor_header *) &otg_descriptor,
 	/* control interface matches ACM, not Ethernet */
 	(struct usb_descriptor_header *) &rndis_control_intf,
 	(struct usb_descriptor_header *) &header_desc,
@@ -713,7 +727,7 @@ static const struct usb_descriptor_header *fs_rndis_function [] = {
 	(struct usb_descriptor_header *) &rndis_data_intf,
 	(struct usb_descriptor_header *) &fs_source_desc,
 	(struct usb_descriptor_header *) &fs_sink_desc,
-	0,
+	NULL,
 };
 #endif
 
@@ -765,7 +779,8 @@ dev_qualifier = {
 	.bNumConfigurations =	1,
 };
 
-static const struct usb_descriptor_header *hs_eth_function [10] = {
+static const struct usb_descriptor_header *hs_eth_function [11] = {
+	(struct usb_descriptor_header *) &otg_descriptor,
 #ifdef DEV_CONFIG_CDC
 	/* "cdc" mode descriptors */
 	(struct usb_descriptor_header *) &control_intf,
@@ -779,24 +794,25 @@ static const struct usb_descriptor_header *hs_eth_function [10] = {
 	(struct usb_descriptor_header *) &data_intf,
 	(struct usb_descriptor_header *) &hs_source_desc,
 	(struct usb_descriptor_header *) &hs_sink_desc,
-	0,
+	NULL,
 #endif /* DEV_CONFIG_CDC */
 };
 
 static inline void __init hs_subset_descriptors(void)
 {
 #ifdef DEV_CONFIG_SUBSET
-	hs_eth_function[0] = (struct usb_descriptor_header *) &subset_data_intf;
-	hs_eth_function[1] = (struct usb_descriptor_header *) &fs_source_desc;
-	hs_eth_function[2] = (struct usb_descriptor_header *) &fs_sink_desc;
-	hs_eth_function[3] = 0;
+	hs_eth_function[1] = (struct usb_descriptor_header *) &subset_data_intf;
+	hs_eth_function[2] = (struct usb_descriptor_header *) &fs_source_desc;
+	hs_eth_function[3] = (struct usb_descriptor_header *) &fs_sink_desc;
+	hs_eth_function[4] = NULL;
 #else
-	hs_eth_function[0] = 0;
+	hs_eth_function[1] = NULL;
 #endif
 }
 
 #ifdef	CONFIG_USB_ETH_RNDIS
 static const struct usb_descriptor_header *hs_rndis_function [] = {
+	(struct usb_descriptor_header *) &otg_descriptor,
 	/* control interface matches ACM, not Ethernet */
 	(struct usb_descriptor_header *) &rndis_control_intf,
 	(struct usb_descriptor_header *) &header_desc,
@@ -808,7 +824,7 @@ static const struct usb_descriptor_header *hs_rndis_function [] = {
 	(struct usb_descriptor_header *) &rndis_data_intf,
 	(struct usb_descriptor_header *) &hs_source_desc,
 	(struct usb_descriptor_header *) &hs_sink_desc,
-	0,
+	NULL,
 };
 #endif
 
@@ -869,18 +885,20 @@ static struct usb_gadget_strings	stringtab = {
  * complications: class descriptors, and an altsetting.
  */
 static int
-config_buf (enum usb_device_speed speed, u8 *buf, u8 type, unsigned index)
+config_buf (enum usb_device_speed speed,
+	u8 *buf, u8 type,
+	unsigned index, int is_otg)
 {
-	int				len;
+	int					len;
+	const struct usb_config_descriptor	*config;
+	const struct usb_descriptor_header	**function;
 #ifdef CONFIG_USB_GADGET_DUALSPEED
 	int				hs = (speed == USB_SPEED_HIGH);
 
 	if (type == USB_DT_OTHER_SPEED_CONFIG)
 		hs = !hs;
-#define which_config(t)	(hs ? & t ## _config   : & t ## _config)
 #define which_fn(t)	(hs ? & hs_ ## t ## _function : & fs_ ## t ## _function)
 #else
-#define	which_config(t)	(& t ## _config)
 #define	which_fn(t)	(& fs_ ## t ## _function)
 #endif
 
@@ -891,15 +909,23 @@ config_buf (enum usb_device_speed speed, u8 *buf, u8 type, unsigned index)
 	/* list the RNDIS config first, to make Microsoft's drivers
 	 * happy. DOCSIS 1.0 needs this too.
 	 */
-	if (device_desc.bNumConfigurations == 2 && index == 0)
-		len = usb_gadget_config_buf (which_config (rndis), buf,
-			USB_BUFSIZ, (const struct usb_descriptor_header **)
-				which_fn (rndis));
-	else
+	if (device_desc.bNumConfigurations == 2 && index == 0) {
+		config = &rndis_config;
+		function = (const struct usb_descriptor_header **)
+				which_fn (rndis);
+	} else
 #endif
-		len = usb_gadget_config_buf (which_config (eth), buf,
-			USB_BUFSIZ, (const struct usb_descriptor_header **)
-				which_fn (eth));
+	{
+		config = &eth_config;
+		function = (const struct usb_descriptor_header **)
+				which_fn (eth);
+	}
+
+	/* for now, don't advertise srp-only devices */
+	if (!is_otg)
+		function++;
+
+	len = usb_gadget_config_buf (config, buf, USB_BUFSIZ, function);
 	if (len < 0)
 		return len;
 	((struct usb_config_descriptor *) buf)->bDescriptorType = type;
@@ -1050,8 +1076,8 @@ set_ether_config (struct eth_dev *dev, int gfp_flags)
 		if (dev->status_ep)
 			(void) usb_ep_disable (dev->status_ep);
 #endif
-		dev->status_ep = 0;
-		dev->status = 0;
+		dev->status_ep = NULL;
+		dev->status = NULL;
 #if defined(DEV_CONFIG_SUBSET) || defined(CONFIG_USB_ETH_RNDIS)
 		if (dev->rndis || !dev->cdc) {
 			if (dev->in_ep)
@@ -1060,10 +1086,10 @@ set_ether_config (struct eth_dev *dev, int gfp_flags)
 				(void) usb_ep_disable (dev->out_ep);
 		}
 #endif
-		dev->in_ep = 0;
-		dev->in = 0;
-		dev->out_ep = 0;
-		dev->out = 0;
+		dev->in_ep = NULL;
+		dev->in = NULL;
+		dev->out_ep = NULL;
+		dev->out = NULL;
 	} else
 
 	/* activate non-CDC configs right away
@@ -1110,7 +1136,7 @@ static void eth_reset_config (struct eth_dev *dev)
 			list_del (&req->list);
 			usb_ep_free_request (dev->in_ep, req);
 		}
-		dev->in_ep = 0;
+		dev->in_ep = NULL;
 	}
 	if (dev->out_ep) {
 		usb_ep_disable (dev->out_ep);
@@ -1120,12 +1146,12 @@ static void eth_reset_config (struct eth_dev *dev)
 			list_del (&req->list);
 			usb_ep_free_request (dev->out_ep, req);
 		}
-		dev->out_ep = 0;
+		dev->out_ep = NULL;
 	}
 
 	if (dev->status_ep) {
 		usb_ep_disable (dev->status_ep);
-		dev->status_ep = 0;
+		dev->status_ep = NULL;
 	}
 	dev->config = 0;
 }
@@ -1345,24 +1371,23 @@ static void eth_setup_complete (struct usb_ep *ep, struct usb_request *req)
 
 static void rndis_response_complete (struct usb_ep *ep, struct usb_request *req)
 {
-	struct eth_dev          *dev = ep->driver_data;
-	
 	if (req->status || req->actual != req->length)
 		DEBUG (dev, "rndis response complete --> %d, %d/%d\n",
 		       req->status, req->actual, req->length);
 
 	/* done sending after CDC_GET_ENCAPSULATED_RESPONSE */
-	rndis_free_response (dev->rndis_config, req->buf);
 }
 
 static void rndis_command_complete (struct usb_ep *ep, struct usb_request *req)
 {
 	struct eth_dev          *dev = ep->driver_data;
+	int			status;
 	
 	/* received RNDIS command from CDC_SEND_ENCAPSULATED_COMMAND */
 	spin_lock(&dev->lock);
-	if (rndis_msg_parser (dev->rndis_config, (u8 *) req->buf))
-		ERROR(dev, "%s: rndis parse error\n", __FUNCTION__ );
+	status = rndis_msg_parser (dev->rndis_config, (u8 *) req->buf);
+	if (status < 0)
+		ERROR(dev, "%s: rndis parse error %d\n", __FUNCTION__, status);
 	spin_unlock(&dev->lock);
 }
 
@@ -1387,6 +1412,7 @@ eth_setup (struct usb_gadget *gadget, const struct usb_ctrlrequest *ctrl)
 	/* descriptors just go into the pre-allocated ep0 buffer,
 	 * while config change events may enable network traffic.
 	 */
+	req->complete = eth_setup_complete;
 	switch (ctrl->bRequest) {
 
 	case USB_REQ_GET_DESCRIPTOR:
@@ -1414,7 +1440,8 @@ eth_setup (struct usb_gadget *gadget, const struct usb_ctrlrequest *ctrl)
 		case USB_DT_CONFIG:
 			value = config_buf (gadget->speed, req->buf,
 					ctrl->wValue >> 8,
-					ctrl->wValue & 0xff);
+					ctrl->wValue & 0xff,
+					gadget->is_otg);
 			if (value >= 0)
 				value = min (ctrl->wLength, (u16) value);
 			break;
@@ -1431,6 +1458,10 @@ eth_setup (struct usb_gadget *gadget, const struct usb_ctrlrequest *ctrl)
 	case USB_REQ_SET_CONFIGURATION:
 		if (ctrl->bRequestType != 0)
 			break;
+		if (gadget->a_hnp_support)
+			DEBUG (dev, "HNP available\n");
+		else if (gadget->a_alt_hnp_support)
+			DEBUG (dev, "HNP needs a different root port\n");
 		spin_lock (&dev->lock);
 		value = eth_set_config (dev, ctrl->wValue, GFP_ATOMIC);
 		spin_unlock (&dev->lock);
@@ -1580,6 +1611,7 @@ done_set_intf:
 			if (buf) {
 				memcpy (req->buf, buf, value);
 				req->complete = rndis_response_complete;
+				rndis_free_response(dev->rndis_config, buf);
 			}
 			/* else stalls ... spec says to avoid that */
 		}
@@ -1596,6 +1628,8 @@ done_set_intf:
 	/* respond with data transfer before status phase? */
 	if (value >= 0) {
 		req->length = value;
+		req->zero = value < ctrl->wLength
+				&& (value % gadget->ep0->maxpacket) == 0;
 		value = usb_ep_queue (gadget->ep0, req, GFP_ATOMIC);
 		if (value < 0) {
 			DEBUG (dev, "ep_queue --> %d\n", value);
@@ -1721,9 +1755,10 @@ rx_submit (struct eth_dev *dev, struct usb_request *req, int gfp_flags)
 
 	/* Padding up to RX_EXTRA handles minor disagreements with host.
 	 * Normally we use the USB "terminate on short read" convention;
-	 * so allow up to (N*maxpacket)-1, since that memory is normally
-	 * already allocated.  Major loss of synch means -EOVERFLOW; any
-	 * obviously corrupted packets will automatically be discarded. 
+	 * so allow up to (N*maxpacket), since that memory is normally
+	 * already allocated.  Some hardware doesn't deal well with short
+	 * reads (e.g. DMA must be N*maxpacket), so for now don't trim a
+	 * byte off the end (to force hardware errors on overflow).
 	 *
 	 * RNDIS uses internal framing, and explicitly allows senders to
 	 * pad to end-of-packet.  That's potentially nice for speed,
@@ -1736,10 +1771,6 @@ rx_submit (struct eth_dev *dev, struct usb_request *req, int gfp_flags)
 		size += sizeof (struct rndis_packet_msg_type);
 #endif	
 	size -= size % dev->out_ep->maxpacket;
-#ifdef CONFIG_USB_ETH_RNDIS
-	if (!dev->rndis)
-#endif	
-		size--;
 
 	if ((skb = alloc_skb (size, gfp_flags)) == 0) {
 		DEBUG (dev, "no rx skb\n");
@@ -1797,7 +1828,7 @@ static void rx_complete (struct usb_ep *ep, struct usb_request *req)
 		 * use skb buffers.
 		 */
 		status = netif_rx (skb);
-		skb = 0;
+		skb = NULL;
 		break;
 
 	/* software-driven interface shutdown */
@@ -1831,7 +1862,7 @@ quiesce:
 clean:
 		/* nobody reading rx_reqs, so no dev->lock */
 		list_add (&req->list, &dev->rx_reqs);
-		req = 0;
+		req = NULL;
 	}
 	if (req)
 		rx_submit (dev, req, GFP_ATOMIC);
@@ -1966,7 +1997,7 @@ static int eth_start_xmit (struct sk_buff *skb, struct net_device *net)
 	struct eth_dev		*dev = (struct eth_dev *) net->priv;
 	int			length = skb->len;
 	int			retval;
-	struct usb_request	*req = 0;
+	struct usb_request	*req = NULL;
 	unsigned long		flags;
 
 	/* FIXME check dev->cdc_filter to decide whether to send this,
@@ -2064,6 +2095,16 @@ static void rndis_send_media_state (struct eth_dev *dev, int connect)
 	}
 }
 
+static void rndis_control_ack_complete (struct usb_ep *ep, struct usb_request *req)
+{
+	if (req->status || req->actual != req->length)
+		DEBUG (dev, "rndis control ack complete --> %d, %d/%d\n",
+		       req->status, req->actual, req->length);
+
+	usb_ep_free_buffer(ep, req->buf, req->dma, 8);
+	usb_ep_free_request(ep, req);
+}
+
 static int rndis_control_ack (struct net_device *net)
 {
 	struct eth_dev          *dev = (struct eth_dev *) net->priv;
@@ -2095,7 +2136,7 @@ static int rndis_control_ack (struct net_device *net)
 	 * CDC_NOTIFY_RESPONSE_AVAILABLE should work too
 	 */
 	resp->length = 8;
-	resp->complete = rndis_response_complete;
+	resp->complete = rndis_control_ack_complete;
 	
 	*((u32 *) resp->buf) = __constant_cpu_to_le32 (1);
 	*((u32 *) resp->buf + 1) = __constant_cpu_to_le32 (0);
@@ -2103,7 +2144,7 @@ static int rndis_control_ack (struct net_device *net)
 	length = usb_ep_queue (dev->status_ep, resp, GFP_ATOMIC);
 	if (length < 0) {
 		resp->status = 0;
-		rndis_response_complete (dev->status_ep, resp);
+		rndis_control_ack_complete (dev->status_ep, resp);
 	}
 	
 	return 0;
@@ -2199,7 +2240,7 @@ eth_unbind (struct usb_gadget *gadget)
 				dev->req->buf, dev->req->dma,
 				USB_BUFSIZ);
 		usb_ep_free_request (gadget->ep0, dev->req);
-		dev->req = 0;
+		dev->req = NULL;
 	}
 
 	unregister_netdev (dev->net);
@@ -2207,7 +2248,7 @@ eth_unbind (struct usb_gadget *gadget)
 
 	/* assuming we used keventd, it must quiesce too */
 	flush_scheduled_work ();
-	set_gadget_data (gadget, 0);
+	set_gadget_data (gadget, NULL);
 }
 
 static u8 __init nibble (unsigned char c)
@@ -2302,17 +2343,6 @@ eth_bind (struct usb_gadget *gadget)
 		UTS_SYSNAME " " UTS_RELEASE "/%s",
 		gadget->name);
 
-	/* CDC subset ... recognized by Linux since 2.4.10, but Windows
-	 * drivers aren't widely available.
-	 */
-	if (!cdc) {
-		device_desc.bDeviceClass = USB_CLASS_VENDOR_SPEC;
-		device_desc.idVendor =
-			__constant_cpu_to_le16(SIMPLE_VENDOR_NUM);
-		device_desc.idProduct =
-			__constant_cpu_to_le16(SIMPLE_PRODUCT_NUM);
-	}
-
 	/* If there's an RNDIS configuration, that's what Windows wants to
 	 * be using ... so use these product IDs here and in the "linux.inf"
 	 * needed to install MSFT drivers.  Current Linux kernels will use
@@ -2326,6 +2356,16 @@ eth_bind (struct usb_gadget *gadget)
 			__constant_cpu_to_le16(RNDIS_PRODUCT_NUM);
 		snprintf (product_desc, sizeof product_desc,
 			"RNDIS/%s", driver_desc);
+
+	/* CDC subset ... recognized by Linux since 2.4.10, but Windows
+	 * drivers aren't widely available.
+	 */
+	} else if (!cdc) {
+		device_desc.bDeviceClass = USB_CLASS_VENDOR_SPEC;
+		device_desc.idVendor =
+			__constant_cpu_to_le16(SIMPLE_VENDOR_NUM);
+		device_desc.idProduct =
+			__constant_cpu_to_le16(SIMPLE_PRODUCT_NUM);
 	}
 
 	/* support optional vendor/distro customization */
@@ -2363,6 +2403,7 @@ autoconf_fail:
 	EP_OUT_NAME = ep->name;
 	ep->driver_data = ep;	/* claim */
 
+#if defined(DEV_CONFIG_CDC) || defined(CONFIG_USB_ETH_RNDIS)
 	/* CDC Ethernet control interface doesn't require a status endpoint.
 	 * Since some hosts expect one, try to allocate one anyway.
 	 */
@@ -2376,13 +2417,12 @@ autoconf_fail:
 				"can't run RNDIS on %s\n",
 				gadget->name);
 			return -ENODEV;
-#ifdef	DEV_CONFIG_CDC
 		} else if (cdc) {
 			control_intf.bNumEndpoints = 0;
 			/* FIXME remove endpoint from descriptor list */
-#endif
 		}
 	}
+#endif
 
 	/* one config:  cdc, else minimal subset */
 	if (!cdc) {
@@ -2418,6 +2458,14 @@ autoconf_fail:
 	device_desc.bMaxPacketSize0 = gadget->ep0->maxpacket;
 	usb_gadget_set_selfpowered (gadget);
 
+	if (gadget->is_otg) {
+		otg_descriptor.bmAttributes |= USB_OTG_HNP,
+		eth_config.bmAttributes |= USB_CONFIG_ATT_WAKEUP;
+#ifdef	CONFIG_USB_ETH_RNDIS
+		rndis_config.bmAttributes |= USB_CONFIG_ATT_WAKEUP;
+#endif
+	}
+
  	net = alloc_etherdev (sizeof *dev);
  	if (!net)
 		return status;
@@ -2436,7 +2484,7 @@ autoconf_fail:
 
 	/* Module params for these addresses should come from ID proms.
 	 * The host side address is used with CDC and RNDIS, and commonly
-	 * end ups in a persistent config database.
+	 * ends up in a persistent config database.
 	 */
 	get_ether_addr(dev_addr, net->dev_addr);
 	if (cdc || rndis) {
@@ -2554,6 +2602,26 @@ fail:
 
 /*-------------------------------------------------------------------------*/
 
+static void
+eth_suspend (struct usb_gadget *gadget)
+{
+	struct eth_dev		*dev = get_gadget_data (gadget);
+
+	DEBUG (dev, "suspend\n");
+	dev->suspended = 1;
+}
+
+static void
+eth_resume (struct usb_gadget *gadget)
+{
+	struct eth_dev		*dev = get_gadget_data (gadget);
+
+	DEBUG (dev, "resume\n");
+	dev->suspended = 0;
+}
+
+/*-------------------------------------------------------------------------*/
+
 static struct usb_gadget_driver eth_driver = {
 #ifdef CONFIG_USB_GADGET_DUALSPEED
 	.speed		= USB_SPEED_HIGH,
@@ -2567,6 +2635,9 @@ static struct usb_gadget_driver eth_driver = {
 	.setup		= eth_setup,
 	.disconnect	= eth_disconnect,
 
+	.suspend	= eth_suspend,
+	.resume		= eth_resume,
+
 	.driver 	= {
 		.name		= (char *) shortname,
 		// .shutdown = ...
diff --git a/drivers/usb/gadget/file_storage.c b/drivers/usb/gadget/file_storage.c
index 55f424691..9b978911e 100644
--- a/drivers/usb/gadget/file_storage.c
+++ b/drivers/usb/gadget/file_storage.c
@@ -1465,6 +1465,8 @@ static int fsg_setup(struct usb_gadget *gadget,
 	/* Respond with data/status or defer until later? */
 	if (rc >= 0 && rc != DELAYED_STATUS) {
 		fsg->ep0req->length = rc;
+		fsg->ep0req->zero = rc < ctrl->wLength
+				&& (rc % gadget->ep0->maxpacket) == 0;
 		fsg->ep0req_name = (ctrl->bRequestType & USB_DIR_IN ?
 				"ep0-in" : "ep0-out");
 		rc = ep0_queue(fsg);
@@ -2501,7 +2503,7 @@ static int send_status(struct fsg_dev *fsg)
 		/* Store and send the Bulk-only CSW */
 		csw->Signature = __constant_cpu_to_le32(USB_BULK_CS_SIG);
 		csw->Tag = fsg->tag;
-		csw->Residue = fsg->residue;
+		csw->Residue = cpu_to_le32(fsg->residue);
 		csw->Status = status;
 
 		bh->inreq->length = USB_BULK_CS_WRAP_LEN;
@@ -2947,7 +2949,7 @@ static int received_cbw(struct fsg_dev *fsg, struct fsg_buffhd *bh)
 		fsg->data_dir = DATA_DIR_TO_HOST;
 	else
 		fsg->data_dir = DATA_DIR_FROM_HOST;
-	fsg->data_size = cbw->DataTransferLength;
+	fsg->data_size = le32_to_cpu(cbw->DataTransferLength);
 	if (fsg->data_size == 0)
 		fsg->data_dir = DATA_DIR_NONE;
 	fsg->lun = cbw->Lun;
@@ -3671,7 +3673,7 @@ static void fsg_unbind(struct usb_gadget *gadget)
 		usb_ep_free_request(fsg->ep0, req);
 	}
 
-	set_gadget_data(gadget, 0);
+	set_gadget_data(gadget, NULL);
 }
 
 
@@ -3834,6 +3836,7 @@ static int __init fsg_bind(struct usb_gadget *gadget)
 	}
 
 	/* Find all the endpoints we will use */
+	usb_ep_autoconfig_reset(gadget);
 	ep = usb_ep_autoconfig(gadget, &fs_bulk_in_desc);
 	if (!ep)
 		goto autoconf_fail;
diff --git a/drivers/usb/gadget/inode.c b/drivers/usb/gadget/inode.c
index 394bfbd8d..c746ecbe1 100644
--- a/drivers/usb/gadget/inode.c
+++ b/drivers/usb/gadget/inode.c
@@ -20,7 +20,7 @@
  */
 
 
-#define	DEBUG 1			/* data to help fault diagnosis */
+// #define	DEBUG 			/* data to help fault diagnosis */
 // #define	VERBOSE		/* extra debug messages (success too) */
 
 #include <linux/init.h>
@@ -44,7 +44,8 @@
  * The gadgetfs API maps each endpoint to a file descriptor so that you
  * can use standard synchronous read/write calls for I/O.  There's some
  * O_NONBLOCK and O_ASYNC/FASYNC style i/o support.  Example usermode
- * drivers show how this works in practice.
+ * drivers show how this works in practice.  You can also use AIO to
+ * eliminate I/O gaps between requests, to help when streaming data.
  *
  * Key parts that must be USB-specific are protocols defining how the
  * read/write operations relate to the hardware state machines.  There
@@ -70,7 +71,7 @@
  */
 
 #define	DRIVER_DESC	"USB Gadget filesystem"
-#define	DRIVER_VERSION	"20 Aug 2003"
+#define	DRIVER_VERSION	"18 Nov 2003"
 
 static const char driver_desc [] = DRIVER_DESC;
 static const char shortname [] = "gadgetfs";
@@ -170,7 +171,7 @@ static struct dev_data *dev_new (void)
 
 	dev = kmalloc (sizeof *dev, GFP_KERNEL);
 	if (!dev)
-		return 0;
+		return NULL;
 	memset (dev, 0, sizeof *dev);
 	dev->state = STATE_DEV_DISABLED;
 	atomic_set (&dev->count, 1);
@@ -252,6 +253,10 @@ static void put_ep (struct ep_data *data)
 #define CHIP			"goku_udc"
 #endif
 
+#ifdef	CONFIG_USB_GADGET_OMAP
+#define CHIP			"omap_udc"
+#endif
+
 #ifdef	CONFIG_USB_GADGET_SA1100
 #define CHIP			"sa1100"
 #endif
@@ -539,6 +544,177 @@ static int ep_ioctl (struct inode *inode, struct file *fd,
 	return status;
 }
 
+/*----------------------------------------------------------------------*/
+
+/* ASYNCHRONOUS ENDPOINT I/O OPERATIONS (bulk/intr/iso) */
+
+struct kiocb_priv {
+	struct usb_request	*req;
+	struct ep_data		*epdata;
+	void			*buf;
+	char __user		*ubuf;
+	unsigned		actual;
+};
+
+static int ep_aio_cancel(struct kiocb *iocb, struct io_event *e)
+{
+	struct kiocb_priv	*priv = (void *) &iocb->private;
+	struct ep_data		*epdata;
+	int			value;
+
+	local_irq_disable();
+	epdata = priv->epdata;
+	// spin_lock(&epdata->dev->lock);
+	kiocbSetCancelled(iocb);
+	if (likely(epdata && epdata->ep && priv->req))
+		value = usb_ep_dequeue (epdata->ep, priv->req);
+	else
+		value = -EINVAL;
+	// spin_unlock(&epdata->dev->lock);
+	local_irq_enable();
+
+	aio_put_req(iocb);
+	return value;
+}
+
+static long ep_aio_read_retry(struct kiocb *iocb)
+{
+	struct kiocb_priv	*priv = (void *) &iocb->private;
+	int			status = priv->actual;
+
+	/* we "retry" to get the right mm context for this: */
+	status = copy_to_user(priv->ubuf, priv->buf, priv->actual);
+	if (unlikely(0 != status))
+		status = -EFAULT;
+	else
+		status = priv->actual;
+	kfree(priv->buf);
+	aio_put_req(iocb);
+	return status;
+}
+
+static void ep_aio_complete(struct usb_ep *ep, struct usb_request *req)
+{
+	struct kiocb		*iocb = req->context;
+	struct kiocb_priv	*priv = (void *) &iocb->private;
+	struct ep_data		*epdata = priv->epdata;
+
+	/* lock against disconnect (and ideally, cancel) */
+	spin_lock(&epdata->dev->lock);
+	priv->req = NULL;
+	priv->epdata = NULL;
+	if (NULL == iocb->ki_retry
+			|| unlikely(0 == req->actual)
+			|| unlikely(kiocbIsCancelled(iocb))) {
+		kfree(req->buf);
+		/* aio_complete() reports bytes-transferred _and_ faults */
+		if (unlikely(kiocbIsCancelled(iocb)))
+			aio_put_req(iocb);
+		else
+			aio_complete(iocb,
+				req->actual ? req->actual : req->status,
+				req->status);
+	} else {
+		/* retry() won't report both; so we hide some faults */
+		if (unlikely(0 != req->status))
+			DBG(epdata->dev, "%s fault %d len %d\n",
+				ep->name, req->status, req->actual);
+
+		priv->buf = req->buf;
+		priv->actual = req->actual;
+		kick_iocb(iocb);
+	}
+	spin_unlock(&epdata->dev->lock);
+
+	usb_ep_free_request(ep, req);
+	put_ep(epdata);
+}
+
+static ssize_t
+ep_aio_rwtail(struct kiocb *iocb, char *buf, size_t len, struct ep_data *epdata)
+{
+	struct kiocb_priv	*priv = (void *) &iocb->private;
+	struct usb_request	*req;
+	ssize_t			value;
+
+	value = get_ready_ep(iocb->ki_filp->f_flags, epdata);
+	if (unlikely(value < 0)) {
+		kfree(buf);
+		return value;
+	}
+
+	iocb->ki_cancel = ep_aio_cancel;
+	get_ep(epdata);
+	priv->epdata = epdata;
+	priv->actual = 0;
+
+	/* each kiocb is coupled to one usb_request, but we can't
+	 * allocate or submit those if the host disconnected.
+	 */
+	spin_lock_irq(&epdata->dev->lock);
+	if (likely(epdata->ep)) {
+		req = usb_ep_alloc_request(epdata->ep, GFP_ATOMIC);
+		if (likely(req)) {
+			priv->req = req;
+			req->buf = buf;
+			req->length = len;
+			req->complete = ep_aio_complete;
+			req->context = iocb;
+			value = usb_ep_queue(epdata->ep, req, GFP_ATOMIC);
+			if (unlikely(0 != value))
+				usb_ep_free_request(epdata->ep, req);
+		} else
+			value = -EAGAIN;
+	} else
+		value = -ENODEV;
+	spin_unlock_irq(&epdata->dev->lock);
+
+	up(&epdata->lock);
+
+	if (unlikely(value))
+		put_ep(epdata);
+	else
+		value = -EIOCBQUEUED;
+	return value;
+}
+
+static ssize_t
+ep_aio_read(struct kiocb *iocb, char __user *ubuf, size_t len, loff_t o)
+{
+	struct kiocb_priv	*priv = (void *) &iocb->private;
+	struct ep_data		*epdata = iocb->ki_filp->private_data;
+	char			*buf;
+
+	if (unlikely(epdata->desc.bEndpointAddress & USB_DIR_IN))
+		return -EINVAL;
+	buf = kmalloc(len, GFP_KERNEL);
+	if (unlikely(!buf))
+		return -ENOMEM;
+	iocb->ki_retry = ep_aio_read_retry;
+	priv->ubuf = ubuf;
+	return ep_aio_rwtail(iocb, buf, len, epdata);
+}
+
+static ssize_t
+ep_aio_write(struct kiocb *iocb, const char __user *ubuf, size_t len, loff_t o)
+{
+	struct ep_data		*epdata = iocb->ki_filp->private_data;
+	char			*buf;
+
+	if (unlikely(!(epdata->desc.bEndpointAddress & USB_DIR_IN)))
+		return -EINVAL;
+	buf = kmalloc(len, GFP_KERNEL);
+	if (unlikely(!buf))
+		return -ENOMEM;
+	if (unlikely(copy_from_user(buf, ubuf, len) != 0)) {
+		kfree(buf);
+		return -EFAULT;
+	}
+	return ep_aio_rwtail(iocb, buf, len, epdata);
+}
+
+/*----------------------------------------------------------------------*/
+
 /* used after endpoint configuration */
 static struct file_operations ep_io_operations = {
 	.owner =	THIS_MODULE,
@@ -547,8 +723,8 @@ static struct file_operations ep_io_operations = {
 	.ioctl =	ep_ioctl,
 	.release =	ep_release,
 
-	// .aio_read =	ep_aio_read,
-	// .aio_write =	ep_aio_write,
+	.aio_read =	ep_aio_read,
+	.aio_write =	ep_aio_write,
 };
 
 /* ENDPOINT INITIALIZATION
@@ -565,7 +741,7 @@ static struct file_operations ep_io_operations = {
  * speed descriptor, then optional high speed descriptor.
  */
 static ssize_t
-ep_config (struct file *fd, const char *buf, size_t len, loff_t *ptr)
+ep_config (struct file *fd, const char __user *buf, size_t len, loff_t *ptr)
 {
 	struct ep_data		*data = fd->private_data;
 	struct usb_ep		*ep;
@@ -772,7 +948,7 @@ static int setup_req (struct usb_ep *ep, struct usb_request *req, u16 len)
 }
 
 static ssize_t
-ep0_read (struct file *fd, char *buf, size_t len, loff_t *ptr)
+ep0_read (struct file *fd, char __user *buf, size_t len, loff_t *ptr)
 {
 	struct dev_data			*dev = fd->private_data;
 	ssize_t				retval;
@@ -953,7 +1129,7 @@ next_event (struct dev_data *dev, enum usb_gadgetfs_event_type type)
 }
 
 static ssize_t
-ep0_write (struct file *fd, const char *buf, size_t len, loff_t *ptr)
+ep0_write (struct file *fd, const char __user *buf, size_t len, loff_t *ptr)
 {
 	struct dev_data		*dev = fd->private_data;
 	ssize_t			retval = -ESRCH;
@@ -1032,7 +1208,7 @@ dev_release (struct inode *inode, struct file *fd)
 
 	fasync_helper (-1, fd, 0, &dev->fasync);
 	kfree (dev->buf);
-	dev->buf = 0;
+	dev->buf = NULL;
 	put_dev (dev);
 
 	/* other endpoints were all decoupled from this device */
@@ -1184,7 +1360,7 @@ gadgetfs_setup (struct usb_gadget *gadget, const struct usb_ctrlrequest *ctrl)
 
 	req->buf = dev->rbuf;
 	req->dma = DMA_ADDR_INVALID;
-	req->context = 0;
+	req->context = NULL;
 	value = -EOPNOTSUPP;
 	switch (ctrl->bRequest) {
 
@@ -1320,6 +1496,8 @@ delegate:
 	/* proceed with data transfer and status phases? */
 	if (value >= 0 && dev->state != STATE_SETUP) {
 		req->length = value;
+		req->zero = value < ctrl->wLength
+				&& (value % gadget->ep0->maxpacket) == 0;
 		value = usb_ep_queue (gadget->ep0, req, GFP_ATOMIC);
 		if (value < 0) {
 			DBG (dev, "ep_queue --> %d\n", value);
@@ -1350,7 +1528,7 @@ restart:
 		ep = list_entry (entry, struct ep_data, epfiles);
 		list_del_init (&ep->epfiles);
 		dentry = ep->dentry;
-		ep->dentry = 0;
+		ep->dentry = NULL;
 		parent = dentry->d_parent->d_inode;
 
 		/* break link to controller */
@@ -1358,7 +1536,7 @@ restart:
 			(void) usb_ep_disable (ep->ep);
 		ep->state = STATE_EP_UNBOUND;
 		usb_ep_free_request (ep->ep, ep->req);
-		ep->ep = 0;
+		ep->ep = NULL;
 		wake_up (&ep->wait);
 		put_ep (ep);
 
@@ -1438,8 +1616,8 @@ gadgetfs_unbind (struct usb_gadget *gadget)
 	spin_unlock_irq (&dev->lock);
 
 	destroy_ep_files (dev);
-	gadget->ep0->driver_data = 0;
-	set_gadget_data (gadget, 0);
+	gadget->ep0->driver_data = NULL;
+	set_gadget_data (gadget, NULL);
 
 	/* we've already been disconnected ... no i/o is active */
 	if (dev->req)
@@ -1472,7 +1650,7 @@ gadgetfs_bind (struct usb_gadget *gadget)
 	dev->req = usb_ep_alloc_request (gadget->ep0, GFP_KERNEL);
 	if (!dev->req)
 		goto enomem;
-	dev->req->context = 0;
+	dev->req->context = NULL;
 	dev->req->complete = epio_complete;
 
 	if (activate_ep_files (dev) < 0)
@@ -1589,7 +1767,7 @@ static int is_valid_config (struct usb_config_descriptor *config)
 }
 
 static ssize_t
-dev_config (struct file *fd, const char *buf, size_t len, loff_t *ptr)
+dev_config (struct file *fd, const char __user *buf, size_t len, loff_t *ptr)
 {
 	struct dev_data		*dev = fd->private_data;
 	ssize_t			value = len, length = len;
@@ -1661,7 +1839,7 @@ dev_config (struct file *fd, const char *buf, size_t len, loff_t *ptr)
 	value = usb_gadget_register_driver (&gadgetfs_driver);
 	if (value != 0) {
 		kfree (dev->buf);
-		dev->buf = 0;
+		dev->buf = NULL;
 	} else {
 		/* at this point "good" hardware has for the first time
 		 * let the USB the host see us.  alternatively, if users
@@ -1681,7 +1859,7 @@ fail:
 	spin_unlock_irq (&dev->lock);
 	pr_debug ("%s: %s fail %Zd, %p\n", shortname, __FUNCTION__, value, dev);
 	kfree (dev->buf);
-	dev->buf = 0;
+	dev->buf = NULL;
 	return value;
 }
 
@@ -1770,13 +1948,13 @@ gadgetfs_create_file (struct super_block *sb, char const *name,
 	qname.hash = full_name_hash (qname.name, qname.len);
 	dentry = d_alloc (sb->s_root, &qname);
 	if (!dentry)
-		return 0;
+		return NULL;
 
 	inode = gadgetfs_make_inode (sb, data, fops,
 			S_IFREG | (default_perm & S_IRWXUGO));
 	if (!inode) {
 		dput(dentry);
-		return 0;
+		return NULL;
 	}
 	d_add (dentry, inode);
 	*dentry_p = dentry;
@@ -1806,7 +1984,7 @@ gadgetfs_fill_super (struct super_block *sb, void *opts, int silent)
 
 	/* root inode */
 	inode = gadgetfs_make_inode (sb,
-			0, &simple_dir_operations,
+			NULL, &simple_dir_operations,
 			S_IFDIR | S_IRUGO | S_IXUGO);
 	if (!inode)
 		return -ENOMEM;
@@ -1853,7 +2031,7 @@ gadgetfs_kill_sb (struct super_block *sb)
 	kill_litter_super (sb);
 	if (the_device) {
 		put_dev (the_device);
-		the_device = 0;
+		the_device = NULL;
 	}
 }
 
diff --git a/drivers/usb/gadget/ndis.h b/drivers/usb/gadget/ndis.h
index 611eac8bb..c553bbf68 100644
--- a/drivers/usb/gadget/ndis.h
+++ b/drivers/usb/gadget/ndis.h
@@ -26,11 +26,41 @@
 #define NDIS_STATUS_MULTICAST_EXISTS      0xC001000A
 #define NDIS_STATUS_MULTICAST_NOT_FOUND   0xC001000B
 
+enum NDIS_DEVICE_POWER_STATE {
+	NdisDeviceStateUnspecified = 0,
+	NdisDeviceStateD0,
+	NdisDeviceStateD1,
+	NdisDeviceStateD2,
+	NdisDeviceStateD3,
+	NdisDeviceStateMaximum
+};
+
+struct NDIS_PM_WAKE_UP_CAPABILITIES {
+	enum NDIS_DEVICE_POWER_STATE  MinMagicPacketWakeUp;
+	enum NDIS_DEVICE_POWER_STATE  MinPatternWakeUp;
+	enum NDIS_DEVICE_POWER_STATE  MinLinkChangeWakeUp;
+};
+
 /* NDIS_PNP_CAPABILITIES.Flags constants */
 #define NDIS_DEVICE_WAKE_UP_ENABLE                0x00000001
 #define NDIS_DEVICE_WAKE_ON_PATTERN_MATCH_ENABLE  0x00000002
 #define NDIS_DEVICE_WAKE_ON_MAGIC_PACKET_ENABLE   0x00000004
 
+struct NDIS_PNP_CAPABILITIES {
+	u32					Flags;
+	struct NDIS_PM_WAKE_UP_CAPABILITIES	WakeUpCapabilities;
+};
+
+struct NDIS_PM_PACKET_PATTERN {
+	u32	Priority;
+	u32	Reserved;
+	u32	MaskSize;
+	u32	PatternOffset;
+	u32	PatternSize;
+	u32	PatternFlags;
+};
+
+
 /* Required Object IDs (OIDs) */
 #define OID_GEN_SUPPORTED_LIST            0x00010101
 #define OID_GEN_HARDWARE_STATUS           0x00010102
diff --git a/drivers/usb/gadget/net2280.c b/drivers/usb/gadget/net2280.c
index 2ae830960..880b1f799 100644
--- a/drivers/usb/gadget/net2280.c
+++ b/drivers/usb/gadget/net2280.c
@@ -182,7 +182,7 @@ net2280_enable (struct usb_ep *_ep, const struct usb_endpoint_descriptor *desc)
 	if (ep->dma && (max % 4) != 0 && use_dma_chaining) {
 		DEBUG (ep->dev, "%s, no dma for maxpacket %d\n",
 			ep->ep.name, ep->ep.maxpacket);
-		ep->dma = 0;
+		ep->dma = NULL;
 	}
 
 	/* set type, direction, address; reset fifo counters */
@@ -280,7 +280,7 @@ static void ep_reset (struct net2280_regs *regs, struct net2280_ep *ep)
 {
 	u32		tmp;
 
-	ep->desc = 0;
+	ep->desc = NULL;
 	INIT_LIST_HEAD (&ep->queue);
 
 	ep->ep.maxpacket = ~0;
@@ -374,12 +374,12 @@ net2280_alloc_request (struct usb_ep *_ep, int gfp_flags)
 	struct net2280_request	*req;
 
 	if (!_ep)
-		return 0;
+		return NULL;
 	ep = container_of (_ep, struct net2280_ep, ep);
 
 	req = kmalloc (sizeof *req, gfp_flags);
 	if (!req)
-		return 0;
+		return NULL;
 
 	memset (req, 0, sizeof *req);
 	req->req.dma = DMA_ADDR_INVALID;
@@ -393,7 +393,7 @@ net2280_alloc_request (struct usb_ep *_ep, int gfp_flags)
 				&req->td_dma);
 		if (!td) {
 			kfree (req);
-			return 0;
+			return NULL;
 		}
 		td->dmacount = 0;	/* not VALID */
 		td->dmaaddr = __constant_cpu_to_le32 (DMA_ADDR_INVALID);
@@ -463,7 +463,7 @@ net2280_alloc_buffer (
 
 	ep = container_of (_ep, struct net2280_ep, ep);
 	if (!_ep)
-		return 0;
+		return NULL;
 	*dma = DMA_ADDR_INVALID;
 
 #if	defined(USE_KMALLOC)
@@ -530,7 +530,7 @@ write_fifo (struct net2280_ep *ep, struct usb_request *req)
 		total = req->length - req->actual;
 	} else {
 		total = 0;
-		buf = 0;
+		buf = NULL;
 	}
 
 	/* write just one packet at a time */
@@ -966,7 +966,7 @@ net2280_queue (struct usb_ep *_ep, struct usb_request *_req, int gfp_flags)
 						if (ep->num == 0)
 							allow_status (ep);
 						/* don't queue it */
-						req = 0;
+						req = NULL;
 					} else
 						s = readl (&ep->regs->ep_stat);
 				}
@@ -1095,7 +1095,7 @@ static void restart_dma (struct net2280_ep *ep)
 	 *  OUT:  was "usb-short", we must restart.
 	 */
 	if (ep->is_in && !req->valid) {
-		struct net2280_request	*entry, *prev = 0;
+		struct net2280_request	*entry, *prev = NULL;
 		int			reqmode, done = 0;
 
 		DEBUG (ep->dev, "%s dma hiccup td %p\n", ep->ep.name, req->td);
@@ -1220,7 +1220,7 @@ static int net2280_dequeue (struct usb_ep *_ep, struct usb_request *_req)
 			DEBUG (ep->dev, "unlink (%s) pio\n", _ep->name);
 			done (ep, req, -ECONNRESET);
 		}
-		req = 0;
+		req = NULL;
 
 	/* patch up hardware chaining data */
 	} else if (ep->dma && use_dma_chaining) {
@@ -1902,6 +1902,8 @@ static void ep0_start (struct net2280 *dev)
 		, &dev->usb->stdrsp);
 	writel (  (1 << USB_ROOT_PORT_WAKEUP_ENABLE)
 		| (1 << SELF_POWERED_USB_DEVICE)
+		/* erratum 0102 workaround */
+		| ((dev->chiprev == 0100) ? 0 : 1) << SUSPEND_IMMEDIATELY
 		| (1 << REMOTE_WAKEUP_SUPPORT)
 		| (1 << USB_DETECT_ENABLE)
 		| (1 << SELF_POWERED_STATUS)
@@ -1917,6 +1919,7 @@ static void ep0_start (struct net2280 *dev)
 		| (1 << PCI_RETRY_ABORT_INTERRUPT_ENABLE)
 		| (1 << VBUS_INTERRUPT_ENABLE)
 		| (1 << ROOT_PORT_RESET_INTERRUPT_ENABLE)
+		| (1 << SUSPEND_REQUEST_CHANGE_INTERRUPT_ENABLE)
 		, &dev->regs->pciirqenb1);
 
 	/* don't leave any writes posted */
@@ -1954,15 +1957,15 @@ int usb_gadget_register_driver (struct usb_gadget_driver *driver)
 		dev->ep [i].irqs = 0;
 
 	/* hook up the driver ... */
-	driver->driver.bus = 0;
+	driver->driver.bus = NULL;
 	dev->driver = driver;
 	dev->gadget.dev.driver = &driver->driver;
 	retval = driver->bind (&dev->gadget);
 	if (retval) {
 		DEBUG (dev, "bind to driver %s --> %d\n",
 				driver->driver.name, retval);
-		dev->driver = 0;
-		dev->gadget.dev.driver = 0;
+		dev->driver = NULL;
+		dev->gadget.dev.driver = NULL;
 		return retval;
 	}
 
@@ -1992,7 +1995,7 @@ stop_activity (struct net2280 *dev, struct usb_gadget_driver *driver)
 
 	/* don't disconnect if it's not connected */
 	if (dev->gadget.speed == USB_SPEED_UNKNOWN)
-		driver = 0;
+		driver = NULL;
 
 	/* stop hardware; prevent new request submissions;
 	 * and kill any outstanding requests.
@@ -2026,8 +2029,8 @@ int usb_gadget_unregister_driver (struct usb_gadget_driver *driver)
 	spin_unlock_irqrestore (&dev->lock, flags);
 
 	driver->unbind (&dev->gadget);
-	dev->gadget.dev.driver = 0;
-	dev->driver = 0;
+	dev->gadget.dev.driver = NULL;
+	dev->driver = NULL;
 
 	net2280_led_active (dev, 0);
 	device_remove_file (&dev->pdev->dev, &dev_attr_function);
@@ -2056,7 +2059,7 @@ static void handle_ep_small (struct net2280_ep *ep)
 		req = list_entry (ep->queue.next,
 			struct net2280_request, queue);
 	else
-		req = 0;
+		req = NULL;
 
 	/* ack all, and handle what we care about */
 	t = readl (&ep->regs->ep_stat);
@@ -2095,7 +2098,7 @@ static void handle_ep_small (struct net2280_ep *ep)
 					set_halt (ep);
 					mode = 2;
 				} else if (!req && ep->stopped)
-					write_fifo (ep, 0);
+					write_fifo (ep, NULL);
 			}
 		} else {
 			/* status; stop NAKing */
@@ -2115,7 +2118,7 @@ static void handle_ep_small (struct net2280_ep *ep)
 				ep->stopped = 1;
 				if (req)
 					done (ep, req, -EOVERFLOW);
-				req = 0;
+				req = NULL;
 			}
 		}
 	}
@@ -2142,7 +2145,7 @@ static void handle_ep_small (struct net2280_ep *ep)
 				scan_dma_completions (ep);
 				if (unlikely (list_empty (&ep->queue)
 						|| ep->out_overflow)) {
-					req = 0;
+					req = NULL;
 					break;
 				}
 				req = list_entry (ep->queue.next,
@@ -2156,7 +2159,7 @@ static void handle_ep_small (struct net2280_ep *ep)
 					count &= DMA_BYTE_COUNT_MASK;
 					if (readl (&ep->dma->dmadesc)
 							!= req->td_dma)
-						req = 0;
+						req = NULL;
 					break;
 				}
 				udelay(1);
@@ -2209,7 +2212,7 @@ static void handle_ep_small (struct net2280_ep *ep)
 			if (ep->num == 0) {
 				/* wait for control status */
 				if (mode != 2)
-					req = 0;
+					req = NULL;
 			} else if (!req->req.zero || len != ep->ep.maxpacket)
 				mode = 2;
 		}
@@ -2231,13 +2234,13 @@ static void handle_ep_small (struct net2280_ep *ep)
 			 */
 			if (!ep->stopped)
 				allow_status (ep);
-			req = 0;
+			req = NULL;
 		} else {
 			if (!list_empty (&ep->queue) && !ep->stopped)
 				req = list_entry (ep->queue.next,
 					struct net2280_request, queue);
 			else
-				req = 0;
+				req = NULL;
 			if (req && !ep->is_in)
 				stop_out_naking (ep);
 		}
@@ -2272,7 +2275,7 @@ get_ep_by_addr (struct net2280 *dev, u16 wIndex)
 		if ((wIndex & 0x0f) == (bEndpointAddress & 0x0f))
 			return ep;
 	}
-	return 0;
+	return NULL;
 }
 
 static void handle_stat0_irqs (struct net2280 *dev, u32 stat)
@@ -2513,19 +2516,24 @@ static void handle_stat1_irqs (struct net2280 *dev, u32 stat)
 			return;
 	}
 
-	/* NOTE: we don't actually suspend the hardware; that starts to
-	 * interact with PCI power management, and needs something like a
-	 * controller->suspend() call to clear SUSPEND_REQUEST_INTERRUPT.
-	 * we shouldn't see resume interrupts.
-	 * for rev 0100, this also avoids erratum 0102.
+	/* NOTE: chip stays in PCI D0 state for now, but it could
+	 * enter D1 to save more power
 	 */
 	tmp = (1 << SUSPEND_REQUEST_CHANGE_INTERRUPT);
 	if (stat & tmp) {
-		if (dev->driver->suspend)
-			dev->driver->suspend (&dev->gadget);
+		writel (tmp, &dev->regs->irqstat1);
+		if (stat & (1 << SUSPEND_REQUEST_INTERRUPT)) {
+			if (dev->driver->suspend)
+				dev->driver->suspend (&dev->gadget);
+			/* we use SUSPEND_IMMEDIATELY */
+			stat &= ~(1 << SUSPEND_REQUEST_INTERRUPT);
+		} else {
+			if (dev->driver->resume)
+				dev->driver->resume (&dev->gadget);
+			/* at high speed, note erratum 0133 */
+		}
 		stat &= ~tmp;
 	}
-	stat &= ~(1 << SUSPEND_REQUEST_INTERRUPT);
 
 	/* clear any other status/irqs */
 	if (stat)
@@ -2533,6 +2541,7 @@ static void handle_stat1_irqs (struct net2280 *dev, u32 stat)
 
 	/* some status we can just ignore */
 	stat &= ~((1 << CONTROL_STATUS_INTERRUPT)
+			| (1 << SUSPEND_REQUEST_INTERRUPT)
 			| (1 << RESUME_INTERRUPT)
 			| (1 << SOF_INTERRUPT));
 	if (!stat)
@@ -2698,11 +2707,11 @@ static void net2280_remove (struct pci_dev *pdev)
 		pci_disable_device (pdev);
 	device_unregister (&dev->gadget.dev);
 	device_remove_file (&pdev->dev, &dev_attr_registers);
-	pci_set_drvdata (pdev, 0);
+	pci_set_drvdata (pdev, NULL);
 
 	INFO (dev, "unbind\n");
 
-	the_controller = 0;
+	the_controller = NULL;
 }
 
 /* wrap this driver around the specified device, but
@@ -2713,7 +2722,7 @@ static int net2280_probe (struct pci_dev *pdev, const struct pci_device_id *id)
 {
 	struct net2280		*dev;
 	unsigned long		resource, len;
-	void			*base = 0;
+	void			*base = NULL;
 	int			retval, i;
 	char			buf [8], *bufp;
 
diff --git a/drivers/usb/gadget/pxa2xx_udc.c b/drivers/usb/gadget/pxa2xx_udc.c
index 4ad4d2f7f..63e538a57 100644
--- a/drivers/usb/gadget/pxa2xx_udc.c
+++ b/drivers/usb/gadget/pxa2xx_udc.c
@@ -1406,7 +1406,7 @@ static void udc_disable(struct pxa2xx_udc *dev)
 
 #ifdef	CONFIG_ARCH_PXA
         /* Disable clock for USB device */
-        CKEN &= ~CKEN11_USB;
+	pxa_set_cken(CKEN11_USB, 0);
 #endif
 
 	ep0_idle (dev);
@@ -1452,7 +1452,7 @@ static void udc_enable (struct pxa2xx_udc *dev)
 
 #ifdef	CONFIG_ARCH_PXA
         /* Enable clock for USB device */
-        CKEN |= CKEN11_USB;
+	pxa_set_cken(CKEN11_USB, 1);
 #endif
 
 	/* try to clear these bits before we enable the udc */
@@ -2539,7 +2539,7 @@ static int __exit pxa2xx_udc_remove(struct device *_dev)
 /*-------------------------------------------------------------------------*/
 
 static struct device_driver udc_driver = {
-	.name		= (char *) driver_name,
+	.name		= "pxa2xx-udc",
 	.bus		= &platform_bus_type,
 	.probe		= pxa2xx_udc_probe,
 	.remove		= __exit_p(pxa2xx_udc_remove),
diff --git a/drivers/usb/gadget/rndis.c b/drivers/usb/gadget/rndis.c
index fd4e8002e..1cd445a01 100644
--- a/drivers/usb/gadget/rndis.c
+++ b/drivers/usb/gadget/rndis.c
@@ -18,6 +18,9 @@
  * 
  * 03/25/2004 Kai-Uwe Bloem <linux-development@auerswald.de>
  * 		Fixed rndis_rm_hdr length bug.
+ *
+ * Copyright (C) 2004 by David Brownell
+ *		updates to merge with Linux 2.6, better match RNDIS spec
  */
 
 #include <linux/config.h>
@@ -35,28 +38,34 @@
 #include <asm/byteorder.h>
 #include <asm/system.h>
 
+
+#undef	RNDIS_PM
+#undef	VERBOSE
+
 #include "rndis.h"
 
 
 /* The driver for your USB chip needs to support ep0 OUT to work with
- * RNDIS, plus the same three descriptors as CDC Ethernet.
+ * RNDIS, plus all three CDC Ethernet endpoints (interrupt not optional).
  *
  * Windows hosts need an INF file like Documentation/usb/linux.inf
+ * and will be happier if you provide the host_addr module parameter.
  */
 
-#ifndef	__LITTLE_ENDIAN
-#warning this code is missing all cpu_to_leXX() calls ...
-#endif
-
 #if 0
-#define DEBUG if (rndis_debug) printk 
+#define DEBUG(str,args...) do { \
+	if (rndis_debug) \
+		printk(KERN_DEBUG str , ## args ); \
+	} while (0)
 static int rndis_debug = 0;
 
 module_param (rndis_debug, bool, 0);
 MODULE_PARM_DESC (rndis_debug, "enable debugging");
 
 #else
-#define DEBUG(str,args...) do{}while(0)
+
+#define rndis_debug		0
+#define DEBUG(str,args...)	do{}while(0)
 #endif
 
 #define RNDIS_MAX_CONFIGS	1
@@ -79,16 +88,14 @@ static int rndis_keepalive_response (int configNr,
 
 static rndis_resp_t *rndis_add_response (int configNr, u32 length);
 
-/* FIXME OMITTED OIDs, that RNDIS-on-USB "must" support, include
- *  - power management (OID_PNP_CAPABILITIES, ...)
- *  - network wakeup (OID_PNP_ENABLE_WAKE_UP, ...)
- */
 
 /* NDIS Functions */
 static int gen_ndis_query_resp (int configNr, u32 OID, rndis_resp_t *r)
 {
 	int 			retval = -ENOTSUPP;
 	u32 			length = 0;
+	u32			*tmp;
+	int			i, count;
 	rndis_query_cmplt_type	*resp;
 
 	if (!r) return -ENOMEM;
@@ -97,11 +104,17 @@ static int gen_ndis_query_resp (int configNr, u32 OID, rndis_resp_t *r)
 	if (!resp) return -ENOMEM;
 	
 	switch (OID) {
+
+	/* general oids (table 4-1) */
+
 	/* mandatory */
 	case OID_GEN_SUPPORTED_LIST:
 		DEBUG ("%s: OID_GEN_SUPPORTED_LIST\n", __FUNCTION__);
 		length = sizeof (oid_supported_list);
-		memcpy ((u8 *) resp + 24, oid_supported_list, length); 
+		count  = length / sizeof (u32);
+		tmp = (u32 *) ((u8 *)resp + 24);
+		for (i = 0; i < count; i++)
+			tmp[i] = cpu_to_le32 (oid_supported_list[i]);
 		retval = 0;
 		break;
 		
@@ -115,7 +128,7 @@ static int gen_ndis_query_resp (int configNr, u32 OID, rndis_resp_t *r)
 		 * reddite ergo quae sunt Caesaris Caesari
 		 * et quae sunt Dei Deo!
 		 */
-		*((u32 *) resp + 6) = 0;
+		*((u32 *) resp + 6) = __constant_cpu_to_le32 (0);
 		retval = 0;
 		break;
 		
@@ -123,7 +136,8 @@ static int gen_ndis_query_resp (int configNr, u32 OID, rndis_resp_t *r)
 	case OID_GEN_MEDIA_SUPPORTED:
 		DEBUG("%s: OID_GEN_MEDIA_SUPPORTED\n", __FUNCTION__);
 		length = 4;
-		*((u32 *) resp + 6) = rndis_per_dev_params [configNr].medium;
+		*((u32 *) resp + 6) = cpu_to_le32 (
+					rndis_per_dev_params [configNr].medium);
 		retval = 0;
 		break;
 		
@@ -132,24 +146,21 @@ static int gen_ndis_query_resp (int configNr, u32 OID, rndis_resp_t *r)
 		DEBUG("%s: OID_GEN_MEDIA_IN_USE\n", __FUNCTION__);
 		length = 4;
 		/* one medium, one transport... (maybe you do it better) */
-		*((u32 *) resp + 6) = rndis_per_dev_params [configNr].medium;
+		*((u32 *) resp + 6) = cpu_to_le32 (
+					rndis_per_dev_params [configNr].medium);
 		retval = 0;
 		break;
 		
-	case OID_GEN_MAXIMUM_LOOKAHEAD:
-		DEBUG("%s: OID_GEN_MAXIMUM_LOOKAHEAD\n", __FUNCTION__);
-		break;
-		
 	/* mandatory */
 	case OID_GEN_MAXIMUM_FRAME_SIZE:
 		DEBUG("%s: OID_GEN_MAXIMUM_FRAME_SIZE\n", __FUNCTION__);
 		if (rndis_per_dev_params [configNr].dev) {
 			length = 4;
-			*((u32 *) resp + 6) = rndis_per_dev_params [configNr]
-						.dev->mtu;
+			*((u32 *) resp + 6) = cpu_to_le32 (
+				rndis_per_dev_params [configNr].dev->mtu);
 			retval = 0;
 		} else {
-			*((u32 *) resp + 6) = 0;
+			*((u32 *) resp + 6) = __constant_cpu_to_le32 (0);
 			retval = 0;
 		}
 		break;
@@ -160,30 +171,20 @@ static int gen_ndis_query_resp (int configNr, u32 OID, rndis_resp_t *r)
 		length = 4;
 		if (rndis_per_dev_params [configNr].media_state
 			== NDIS_MEDIA_STATE_DISCONNECTED)
-		    *((u32 *) resp + 6) = 0;
+		    *((u32 *) resp + 6) = __constant_cpu_to_le32 (0);
 		else
-		    *((u32 *) resp + 6) = rndis_per_dev_params [configNr].speed;
+		    *((u32 *) resp + 6) = cpu_to_le32 (
+				rndis_per_dev_params [configNr].speed);
 		retval = 0;
 		break;
-		
-	case OID_GEN_TRANSMIT_BUFFER_SPACE:
-		DEBUG("%s: OID_GEN_TRANSMIT_BUFFER_SPACE\n", __FUNCTION__);
-		length = 4;
-		*((u32 *) resp + 6) = 0;
-		retval = 0;
-		break;
-		
-	case OID_GEN_RECEIVE_BUFFER_SPACE:
-		DEBUG("%s: OID_GEN_RECEIVE_BUFFER_SPACE\n", __FUNCTION__);
-		break;
-		
+
 	/* mandatory */
 	case OID_GEN_TRANSMIT_BLOCK_SIZE:
 		DEBUG("%s: OID_GEN_TRANSMIT_BLOCK_SIZE\n", __FUNCTION__);
 		if (rndis_per_dev_params [configNr].dev) {
 			length = 4;
-			*((u32 *) resp + 6) = rndis_per_dev_params [configNr]
-						.dev->mtu;
+			*((u32 *) resp + 6) = cpu_to_le32 (
+				rndis_per_dev_params [configNr].dev->mtu);
 			retval = 0;
 		}
 		break;
@@ -193,8 +194,8 @@ static int gen_ndis_query_resp (int configNr, u32 OID, rndis_resp_t *r)
 		DEBUG("%s: OID_GEN_RECEIVE_BLOCK_SIZE\n", __FUNCTION__);
 		if (rndis_per_dev_params [configNr].dev) {
 			length = 4;
-			*((u32 *) resp + 6) = rndis_per_dev_params [configNr]
-						.dev->mtu;
+			*((u32 *) resp + 6) = cpu_to_le32 (
+				rndis_per_dev_params [configNr].dev->mtu);
 			retval = 0;
 		}
 		break;
@@ -203,7 +204,8 @@ static int gen_ndis_query_resp (int configNr, u32 OID, rndis_resp_t *r)
 	case OID_GEN_VENDOR_ID:
 		DEBUG("%s: OID_GEN_VENDOR_ID\n", __FUNCTION__);
 		length = 4;
-		*((u32 *) resp + 6) = rndis_per_dev_params [configNr].vendorID;
+		*((u32 *) resp + 6) = cpu_to_le32 (
+			rndis_per_dev_params [configNr].vendorID);
 		retval = 0;
 		break;
 		
@@ -216,129 +218,92 @@ static int gen_ndis_query_resp (int configNr, u32 OID, rndis_resp_t *r)
 		retval = 0;
 		break;
 
+	case OID_GEN_VENDOR_DRIVER_VERSION:
+		DEBUG("%s: OID_GEN_VENDOR_DRIVER_VERSION\n", __FUNCTION__);
+		length = 4;
+		/* Created as LE */
+		*((u32 *) resp + 6) = rndis_driver_version;
+		retval = 0;
+		break;
+
 	/* mandatory */
 	case OID_GEN_CURRENT_PACKET_FILTER:
 		DEBUG("%s: OID_GEN_CURRENT_PACKET_FILTER\n", __FUNCTION__);
 		length = 4;
-		*((u32 *) resp + 6) = rndis_per_dev_params[configNr].filter;
+		*((u32 *) resp + 6) = cpu_to_le32 (
+					rndis_per_dev_params[configNr].filter);
 		retval = 0;
 		break;
-		
-	case OID_GEN_CURRENT_LOOKAHEAD:
-		DEBUG("%s: OID_GEN_CURRENT_LOOKAHEAD\n", __FUNCTION__);
-		break;
-		
-	case OID_GEN_DRIVER_VERSION:
-		DEBUG("%s: OID_GEN_DRIVER_VERSION\n", __FUNCTION__);
-		break;
-		
+
 	/* mandatory */
 	case OID_GEN_MAXIMUM_TOTAL_SIZE:
 		DEBUG("%s: OID_GEN_MAXIMUM_TOTAL_SIZE\n", __FUNCTION__);
 		length = 4;
-		*((u32 *) resp + 6) = RNDIS_MAX_TOTAL_SIZE;
-		retval = 0;
-		break;
-		
-	case OID_GEN_PROTOCOL_OPTIONS:
-		DEBUG("%s: OID_GEN_PROTOCOL_OPTIONS\n", __FUNCTION__);
-		break;
-		
-	case OID_GEN_MAC_OPTIONS:
-		DEBUG("%s: OID_GEN_MAC_OPTIONS\n", __FUNCTION__);
-		length = 4;
-		*((u32 *) resp + 6) = NDIS_MAC_OPTION_RECEIVE_SERIALIZED | 
-		    NDIS_MAC_OPTION_FULL_DUPLEX;
+		*((u32 *) resp + 6) = __constant_cpu_to_le32(
+					RNDIS_MAX_TOTAL_SIZE);
 		retval = 0;
 		break;
-		
+
 	/* mandatory */
 	case OID_GEN_MEDIA_CONNECT_STATUS:
 		DEBUG("%s: OID_GEN_MEDIA_CONNECT_STATUS\n", __FUNCTION__);
 		length = 4;
-		*((u32 *) resp + 6) = rndis_per_dev_params [configNr]
-						.media_state;
+		*((u32 *) resp + 6) = cpu_to_le32 (
+					rndis_per_dev_params [configNr]
+						.media_state);
 		retval = 0;
 		break;
-		
-	case OID_GEN_MAXIMUM_SEND_PACKETS:
-		DEBUG("%s: OID_GEN_MAXIMUM_SEND_PACKETS\n", __FUNCTION__);
-		break;
-		
-	/* mandatory */
-	case OID_GEN_VENDOR_DRIVER_VERSION:
-		DEBUG("%s: OID_GEN_VENDOR_DRIVER_VERSION\n", __FUNCTION__);
-		length = 4;
-		*((u32 *) resp + 6) = rndis_driver_version;
-		retval = 0;
-		break;
-		
-	case OID_GEN_SUPPORTED_GUIDS:
-		DEBUG("%s: OID_GEN_SUPPORTED_GUIDS\n", __FUNCTION__);
-		break;
-		
-	case OID_GEN_NETWORK_LAYER_ADDRESSES:
-		DEBUG("%s: OID_GEN_NETWORK_LAYER_ADDRESSES\n", __FUNCTION__);
-		break;
-		
-	case OID_GEN_TRANSPORT_HEADER_OFFSET:
-		DEBUG("%s: OID_GEN_TRANSPORT_HEADER_OFFSET\n", __FUNCTION__);
-		break;
-		
-	case OID_GEN_MACHINE_NAME:
-		DEBUG("%s: OID_GEN_MACHINE_NAME\n", __FUNCTION__);
-		break;
-		
-	case OID_GEN_RNDIS_CONFIG_PARAMETER:
-		DEBUG("%s: OID_GEN_RNDIS_CONFIG_PARAMETER\n", __FUNCTION__);
+
+	case OID_GEN_PHYSICAL_MEDIUM:
+		DEBUG("%s: OID_GEN_PHYSICAL_MEDIUM\n", __FUNCTION__);
 		length = 4;
-		*((u32 *) resp + 6) = 0;
+		*((u32 *) resp + 6) = __constant_cpu_to_le32 (0);
 		retval = 0;
 		break;
-		
-	case OID_GEN_VLAN_ID:
-		DEBUG("%s: OID_GEN_VLAN_ID\n", __FUNCTION__);
-		break;
-		
-	case OID_GEN_MEDIA_CAPABILITIES:
-		DEBUG("%s: OID_GEN_MEDIA_CAPABILITIES\n", __FUNCTION__);
-		break;
-		
-	case OID_GEN_PHYSICAL_MEDIUM:
-		DEBUG("%s: OID_GEN_PHYSICAL_MEDIUM\n", __FUNCTION__);
+
+	/* The RNDIS specification is incomplete/wrong.   Some versions
+	 * of MS-Windows expect OIDs that aren't specified there.  Other
+	 * versions emit undefined RNDIS messages. DOCUMENT ALL THESE!
+	 */
+	case OID_GEN_MAC_OPTIONS:		/* from WinME */
+		DEBUG("%s: OID_GEN_MAC_OPTIONS\n", __FUNCTION__);
 		length = 4;
-		*((u32 *) resp + 6) = 0;
+		*((u32 *) resp + 6) = __constant_cpu_to_le32(
+			  NDIS_MAC_OPTION_RECEIVE_SERIALIZED
+			| NDIS_MAC_OPTION_FULL_DUPLEX);
 		retval = 0;
 		break;
-		
+
+	/* statistics OIDs (table 4-2) */
+
 	/* mandatory */
 	case OID_GEN_XMIT_OK:
 		DEBUG("%s: OID_GEN_XMIT_OK\n", __FUNCTION__);
 		if (rndis_per_dev_params [configNr].stats) {
 			length = 4;
-			*((u32 *) resp + 6) = rndis_per_dev_params [configNr]
-					.stats->tx_packets - 
+			*((u32 *) resp + 6) = cpu_to_le32 (
+			    rndis_per_dev_params [configNr].stats->tx_packets - 
 			    rndis_per_dev_params [configNr].stats->tx_errors -
-			    rndis_per_dev_params [configNr].stats->tx_dropped;
+			    rndis_per_dev_params [configNr].stats->tx_dropped);
 			retval = 0;
 		} else {
-			*((u32 *) resp + 6) = 0;
+			*((u32 *) resp + 6) = __constant_cpu_to_le32 (0);
 			retval = 0;
 		}
 		break;
-		
+
 	/* mandatory */
 	case OID_GEN_RCV_OK:
 		DEBUG("%s: OID_GEN_RCV_OK\n", __FUNCTION__);
 		if (rndis_per_dev_params [configNr].stats) {
 			length = 4;
-			*((u32 *) resp + 6) = rndis_per_dev_params [configNr].
-					stats->rx_packets - 
+			*((u32 *) resp + 6) = cpu_to_le32 (
+			    rndis_per_dev_params [configNr].stats->rx_packets - 
 			    rndis_per_dev_params [configNr].stats->rx_errors -
-			    rndis_per_dev_params [configNr].stats->rx_dropped;
+			    rndis_per_dev_params [configNr].stats->rx_dropped);
 			retval = 0;
 		} else {
-			*((u32 *) resp + 6) = 0;
+			*((u32 *) resp + 6) = __constant_cpu_to_le32 (0);
 			retval = 0;
 		}
 		break;
@@ -348,11 +313,12 @@ static int gen_ndis_query_resp (int configNr, u32 OID, rndis_resp_t *r)
 		DEBUG("%s: OID_GEN_XMIT_ERROR\n", __FUNCTION__);
 		if (rndis_per_dev_params [configNr].stats) {
 			length = 4;
-			*((u32 *) resp + 6) = rndis_per_dev_params [configNr].
-					stats->tx_errors;
+			*((u32 *) resp + 6) = cpu_to_le32 (
+				rndis_per_dev_params [configNr]
+					.stats->tx_errors);
 			retval = 0;
 		} else {
-			*((u32 *) resp + 6) = 0;
+			*((u32 *) resp + 6) = __constant_cpu_to_le32 (0);
 			retval = 0;
 		}
 		break;
@@ -361,11 +327,12 @@ static int gen_ndis_query_resp (int configNr, u32 OID, rndis_resp_t *r)
 	case OID_GEN_RCV_ERROR:
 		DEBUG("%s: OID_GEN_RCV_ERROR\n", __FUNCTION__);
 		if (rndis_per_dev_params [configNr].stats) {
-			*((u32 *) resp + 6) = rndis_per_dev_params [configNr].
-					stats->rx_errors;
+			*((u32 *) resp + 6) = cpu_to_le32 (
+				rndis_per_dev_params [configNr]
+					.stats->rx_errors);
 			retval = 0;
 		} else {
-			*((u32 *) resp + 6) = 0;
+			*((u32 *) resp + 6) = __constant_cpu_to_le32 (0);
 			retval = 0;
 		}
 		break;
@@ -374,15 +341,17 @@ static int gen_ndis_query_resp (int configNr, u32 OID, rndis_resp_t *r)
 	case OID_GEN_RCV_NO_BUFFER:
 		DEBUG("%s: OID_GEN_RCV_NO_BUFFER\n", __FUNCTION__);
 		if (rndis_per_dev_params [configNr].stats) {
-			*((u32 *) resp + 6) = rndis_per_dev_params [configNr].
-					stats->rx_dropped;
+			*((u32 *) resp + 6) = cpu_to_le32 (
+				rndis_per_dev_params [configNr]
+					.stats->rx_dropped);
 			retval = 0;
 		} else {
-			*((u32 *) resp + 6) = 0;
+			*((u32 *) resp + 6) = __constant_cpu_to_le32 (0);
 			retval = 0;
 		}
 		break;
-		
+
+#ifdef	RNDIS_OPTIONAL_STATS
 	case OID_GEN_DIRECTED_BYTES_XMIT:
 		DEBUG("%s: OID_GEN_DIRECTED_BYTES_XMIT\n", __FUNCTION__);
 		/* 
@@ -392,14 +361,17 @@ static int gen_ndis_query_resp (int configNr, u32 OID, rndis_resp_t *r)
 		 */
 		if (rndis_per_dev_params [configNr].stats) {
 			length = 4;
-			*((u32 *) resp + 6) = (rndis_per_dev_params [configNr].
-					stats->tx_packets - 
-			    rndis_per_dev_params [configNr].stats->tx_errors -
-			    rndis_per_dev_params [configNr].stats->tx_dropped)
-					*123;
+			*((u32 *) resp + 6) = cpu_to_le32 (
+				(rndis_per_dev_params [configNr]
+					.stats->tx_packets - 
+				 rndis_per_dev_params [configNr]
+					 .stats->tx_errors -
+				 rndis_per_dev_params [configNr]
+					 .stats->tx_dropped)
+				* 123);
 			retval = 0;
 		} else {
-			*((u32 *) resp + 6) = 0;
+			*((u32 *) resp + 6) = __constant_cpu_to_le32 (0);
 			retval = 0;
 		}
 		break;
@@ -409,14 +381,17 @@ static int gen_ndis_query_resp (int configNr, u32 OID, rndis_resp_t *r)
 		/* dito */
 		if (rndis_per_dev_params [configNr].stats) {
 			length = 4;
-			*((u32 *) resp + 6) = (rndis_per_dev_params [configNr].
-					stats->tx_packets - 
-			    rndis_per_dev_params [configNr].stats->tx_errors -
-			    rndis_per_dev_params [configNr].stats->tx_dropped)
-			    		/123;
+			*((u32 *) resp + 6) = cpu_to_le32 (
+				(rndis_per_dev_params [configNr]
+					.stats->tx_packets - 
+				 rndis_per_dev_params [configNr]
+					 .stats->tx_errors -
+				 rndis_per_dev_params [configNr]
+					 .stats->tx_dropped)
+				/ 123);
 			retval = 0;
 		} else {
-			*((u32 *) resp + 6) = 0;
+			*((u32 *) resp + 6) = __constant_cpu_to_le32 (0);
 			retval = 0;
 		}
 		break;
@@ -424,11 +399,12 @@ static int gen_ndis_query_resp (int configNr, u32 OID, rndis_resp_t *r)
 	case OID_GEN_MULTICAST_BYTES_XMIT:
 		DEBUG("%s: OID_GEN_MULTICAST_BYTES_XMIT\n", __FUNCTION__);
 		if (rndis_per_dev_params [configNr].stats) {
-			*((u32 *) resp + 6) = rndis_per_dev_params [configNr].
-					stats->multicast*1234;
+			*((u32 *) resp + 6) = cpu_to_le32 (
+				rndis_per_dev_params [configNr]
+					.stats->multicast*1234);
 			retval = 0;
 		} else {
-			*((u32 *) resp + 6) = 0;
+			*((u32 *) resp + 6) = __constant_cpu_to_le32 (0);
 			retval = 0;
 		}
 		break;
@@ -436,11 +412,12 @@ static int gen_ndis_query_resp (int configNr, u32 OID, rndis_resp_t *r)
 	case OID_GEN_MULTICAST_FRAMES_XMIT:
 		DEBUG("%s: OID_GEN_MULTICAST_FRAMES_XMIT\n", __FUNCTION__);
 		if (rndis_per_dev_params [configNr].stats) {
-			*((u32 *) resp + 6) = rndis_per_dev_params [configNr].
-					stats->multicast;
+			*((u32 *) resp + 6) = cpu_to_le32 (
+				rndis_per_dev_params [configNr]
+					.stats->multicast);
 			retval = 0;
 		} else {
-			*((u32 *) resp + 6) = 0;
+			*((u32 *) resp + 6) = __constant_cpu_to_le32 (0);
 			retval = 0;
 		}
 		break;
@@ -448,11 +425,12 @@ static int gen_ndis_query_resp (int configNr, u32 OID, rndis_resp_t *r)
 	case OID_GEN_BROADCAST_BYTES_XMIT:
 		DEBUG("%s: OID_GEN_BROADCAST_BYTES_XMIT\n", __FUNCTION__);
 		if (rndis_per_dev_params [configNr].stats) {
-			*((u32 *) resp + 6) = rndis_per_dev_params [configNr].
-					stats->tx_packets/42*255;
+			*((u32 *) resp + 6) = cpu_to_le32 (
+				rndis_per_dev_params [configNr]
+					.stats->tx_packets/42*255);
 			retval = 0;
 		} else {
-			*((u32 *) resp + 6) = 0;
+			*((u32 *) resp + 6) = __constant_cpu_to_le32 (0);
 			retval = 0;
 		}
 		break;
@@ -460,35 +438,37 @@ static int gen_ndis_query_resp (int configNr, u32 OID, rndis_resp_t *r)
 	case OID_GEN_BROADCAST_FRAMES_XMIT:
 		DEBUG("%s: OID_GEN_BROADCAST_FRAMES_XMIT\n", __FUNCTION__);
 		if (rndis_per_dev_params [configNr].stats) {
-			*((u32 *) resp + 6) = rndis_per_dev_params [configNr].
-					stats->tx_packets/42;
+			*((u32 *) resp + 6) = cpu_to_le32 (
+				rndis_per_dev_params [configNr]
+					.stats->tx_packets/42);
 			retval = 0;
 		} else {
-			*((u32 *) resp + 6) = 0;
+			*((u32 *) resp + 6) = __constant_cpu_to_le32 (0);
 			retval = 0;
 		}
 		break;
 		
 	case OID_GEN_DIRECTED_BYTES_RCV:
 		DEBUG("%s: OID_GEN_DIRECTED_BYTES_RCV\n", __FUNCTION__);
-		*((u32 *) resp + 6) = 0;
+		*((u32 *) resp + 6) = __constant_cpu_to_le32 (0);
 		retval = 0;
 		break;
 		
 	case OID_GEN_DIRECTED_FRAMES_RCV:
 		DEBUG("%s: OID_GEN_DIRECTED_FRAMES_RCV\n", __FUNCTION__);
-		*((u32 *) resp + 6) = 0;
+		*((u32 *) resp + 6) = __constant_cpu_to_le32 (0);
 		retval = 0;
 		break;
 		
 	case OID_GEN_MULTICAST_BYTES_RCV:
 		DEBUG("%s: OID_GEN_MULTICAST_BYTES_RCV\n", __FUNCTION__);
 		if (rndis_per_dev_params [configNr].stats) {
-			*((u32 *) resp + 6) = rndis_per_dev_params [configNr].
-					stats->multicast*1111;
+			*((u32 *) resp + 6) = cpu_to_le32 (
+				rndis_per_dev_params [configNr]
+					.stats->multicast * 1111);
 			retval = 0;
 		} else {
-			*((u32 *) resp + 6) = 0;
+			*((u32 *) resp + 6) = __constant_cpu_to_le32 (0);
 			retval = 0;
 		}
 		break;
@@ -496,11 +476,12 @@ static int gen_ndis_query_resp (int configNr, u32 OID, rndis_resp_t *r)
 	case OID_GEN_MULTICAST_FRAMES_RCV:
 		DEBUG("%s: OID_GEN_MULTICAST_FRAMES_RCV\n", __FUNCTION__);
 		if (rndis_per_dev_params [configNr].stats) {
-			*((u32 *) resp + 6) = rndis_per_dev_params [configNr].
-					stats->multicast;
+			*((u32 *) resp + 6) = cpu_to_le32 (
+				rndis_per_dev_params [configNr]
+					.stats->multicast);
 			retval = 0;
 		} else {
-			*((u32 *) resp + 6) = 0;
+			*((u32 *) resp + 6) = __constant_cpu_to_le32 (0);
 			retval = 0;
 		}
 		break;
@@ -508,11 +489,12 @@ static int gen_ndis_query_resp (int configNr, u32 OID, rndis_resp_t *r)
 	case OID_GEN_BROADCAST_BYTES_RCV:
 		DEBUG("%s: OID_GEN_BROADCAST_BYTES_RCV\n", __FUNCTION__);
 		if (rndis_per_dev_params [configNr].stats) {
-			*((u32 *) resp + 6) = rndis_per_dev_params [configNr].
-					stats->rx_packets/42*255;
+			*((u32 *) resp + 6) = cpu_to_le32 (
+				rndis_per_dev_params [configNr]
+					.stats->rx_packets/42*255);
 			retval = 0;
 		} else {
-			*((u32 *) resp + 6) = 0;
+			*((u32 *) resp + 6) = __constant_cpu_to_le32 (0);
 			retval = 0;
 		}
 		break;
@@ -520,11 +502,12 @@ static int gen_ndis_query_resp (int configNr, u32 OID, rndis_resp_t *r)
 	case OID_GEN_BROADCAST_FRAMES_RCV:
 		DEBUG("%s: OID_GEN_BROADCAST_FRAMES_RCV\n", __FUNCTION__);
 		if (rndis_per_dev_params [configNr].stats) {
-			*((u32 *) resp + 6) = rndis_per_dev_params [configNr].
-					stats->rx_packets/42;
+			*((u32 *) resp + 6) = cpu_to_le32 (
+				rndis_per_dev_params [configNr]
+					.stats->rx_packets/42);
 			retval = 0;
 		} else {
-			*((u32 *) resp + 6) = 0;
+			*((u32 *) resp + 6) = __constant_cpu_to_le32 (0);
 			retval = 0;
 		}
 		break;
@@ -532,61 +515,25 @@ static int gen_ndis_query_resp (int configNr, u32 OID, rndis_resp_t *r)
 	case OID_GEN_RCV_CRC_ERROR:
 		DEBUG("%s: OID_GEN_RCV_CRC_ERROR\n", __FUNCTION__);
 		if (rndis_per_dev_params [configNr].stats) {
-			*((u32 *) resp + 6) = rndis_per_dev_params [configNr].
-					stats->rx_crc_errors;
+			*((u32 *) resp + 6) = cpu_to_le32 (
+				rndis_per_dev_params [configNr]
+					.stats->rx_crc_errors);
 			retval = 0;
 		} else {
-			*((u32 *) resp + 6) = 0;
+			*((u32 *) resp + 6) = __constant_cpu_to_le32 (0);
 			retval = 0;
 		}
 		break;
 		
 	case OID_GEN_TRANSMIT_QUEUE_LENGTH:
 		DEBUG("%s: OID_GEN_TRANSMIT_QUEUE_LENGTH\n", __FUNCTION__);
-		*((u32 *) resp + 6) = 0;
+		*((u32 *) resp + 6) = __constant_cpu_to_le32 (0);
 		retval = 0;
 		break;
-		
-	case OID_GEN_GET_TIME_CAPS:
-		DEBUG("%s: OID_GEN_GET_TIME_CAPS\n", __FUNCTION__);
-		break;
-		
-	case OID_GEN_GET_NETCARD_TIME:
-		DEBUG("%s: OID_GEN_GET_NETCARD_TIME\n", __FUNCTION__);
-		break;
-		
-	case OID_GEN_NETCARD_LOAD:
-		DEBUG("%s: OID_GEN_NETCARD_LOAD\n", __FUNCTION__);
-		break;
-		
-	case OID_GEN_DEVICE_PROFILE:
-		DEBUG("%s: OID_GEN_DEVICE_PROFILE\n", __FUNCTION__);
-		break;
-		
-	case OID_GEN_INIT_TIME_MS:
-		DEBUG("%s: OID_GEN_INIT_TIME_MS\n", __FUNCTION__);
-		break;
-		
-	case OID_GEN_RESET_COUNTS:
-		DEBUG("%s: OID_GEN_RESET_COUNTS\n", __FUNCTION__);
-		break;
-		
-	case OID_GEN_MEDIA_SENSE_COUNTS:
-		DEBUG("%s: OID_GEN_MEDIA_SENSE_COUNTS\n", __FUNCTION__);
-		break;
-		
-	case OID_GEN_FRIENDLY_NAME:
-		DEBUG("%s: OID_GEN_FRIENDLY_NAME\n", __FUNCTION__);
-		break;
-		
-	case OID_GEN_MINIPORT_INFO:
-		DEBUG("%s: OID_GEN_MINIPORT_INFO\n", __FUNCTION__);
-		break;
-		
-	case OID_GEN_RESET_VERIFY_PARAMETERS:
-		DEBUG("%s: OID_GEN_RESET_VERIFY_PARAMETERS\n", __FUNCTION__);
-		break;
-		
+#endif	/* RNDIS_OPTIONAL_STATS */
+
+	/* ieee802.3 OIDs (table 4-3) */
+
 	/* mandatory */
 	case OID_802_3_PERMANENT_ADDRESS:
 		DEBUG("%s: OID_802_3_PERMANENT_ADDRESS\n", __FUNCTION__);
@@ -597,7 +544,7 @@ static int gen_ndis_query_resp (int configNr, u32 OID, rndis_resp_t *r)
 				length);
 			retval = 0;
 		} else {
-			*((u32 *) resp + 6) = 0;
+			*((u32 *) resp + 6) = __constant_cpu_to_le32 (0);
 			retval = 0;
 		}
 		break;
@@ -619,7 +566,7 @@ static int gen_ndis_query_resp (int configNr, u32 OID, rndis_resp_t *r)
 		DEBUG("%s: OID_802_3_MULTICAST_LIST\n", __FUNCTION__);
 		length = 4;
 		/* Multicast base address only */
-		*((u32 *) resp + 6) = 0xE0000000;
+		*((u32 *) resp + 6) = __constant_cpu_to_le32 (0xE0000000);
 		retval = 0;
 		break;
 		
@@ -628,22 +575,25 @@ static int gen_ndis_query_resp (int configNr, u32 OID, rndis_resp_t *r)
 		DEBUG("%s: OID_802_3_MAXIMUM_LIST_SIZE\n", __FUNCTION__);
 		 length = 4;
 		/* Multicast base address only */
-		*((u32 *) resp + 6) = 1;
+		*((u32 *) resp + 6) = __constant_cpu_to_le32 (1);
 		retval = 0;
 		break;
 		
 	case OID_802_3_MAC_OPTIONS:
 		DEBUG("%s: OID_802_3_MAC_OPTIONS\n", __FUNCTION__);
 		break;
-		
+
+	/* ieee802.3 statistics OIDs (table 4-4) */
+
 	/* mandatory */
 	case OID_802_3_RCV_ERROR_ALIGNMENT:
 		DEBUG("%s: OID_802_3_RCV_ERROR_ALIGNMENT\n", __FUNCTION__);
 		if (rndis_per_dev_params [configNr].stats)
 		{
 			length = 4;
-			*((u32 *) resp + 6) = rndis_per_dev_params [configNr]
-					.stats->rx_frame_errors;
+			*((u32 *) resp + 6) = cpu_to_le32 (
+				rndis_per_dev_params [configNr]
+					.stats->rx_frame_errors);
 			retval = 0;
 		}
 		break;
@@ -652,7 +602,7 @@ static int gen_ndis_query_resp (int configNr, u32 OID, rndis_resp_t *r)
 	case OID_802_3_XMIT_ONE_COLLISION:
 		DEBUG("%s: OID_802_3_XMIT_ONE_COLLISION\n", __FUNCTION__);
 		length = 4;
-		*((u32 *) resp + 6) = 0;
+		*((u32 *) resp + 6) = __constant_cpu_to_le32 (0);
 		retval = 0;
 		break;
 		
@@ -660,10 +610,11 @@ static int gen_ndis_query_resp (int configNr, u32 OID, rndis_resp_t *r)
 	case OID_802_3_XMIT_MORE_COLLISIONS:
 		DEBUG("%s: OID_802_3_XMIT_MORE_COLLISIONS\n", __FUNCTION__);
 		length = 4;
-		*((u32 *) resp + 6) = 0;
+		*((u32 *) resp + 6) = __constant_cpu_to_le32 (0);
 		retval = 0;
 		break;
 		
+#ifdef	RNDIS_OPTIONAL_STATS
 	case OID_802_3_XMIT_DEFERRED:
 		DEBUG("%s: OID_802_3_XMIT_DEFERRED\n", __FUNCTION__);
 		/* TODO */
@@ -698,14 +649,46 @@ static int gen_ndis_query_resp (int configNr, u32 OID, rndis_resp_t *r)
 		DEBUG("%s: OID_802_3_XMIT_LATE_COLLISIONS\n", __FUNCTION__);
 		/* TODO */
 		break;		
-		
-	default: printk (KERN_ERR "%s: unknown OID 0x%08X\n", 
+#endif	/* RNDIS_OPTIONAL_STATS */
+
+#ifdef	RNDIS_PM
+	/* power management OIDs (table 4-5) */
+	case OID_PNP_CAPABILITIES:
+		DEBUG("%s: OID_PNP_CAPABILITIES\n", __FUNCTION__);
+
+		/* just PM, and remote wakeup on link status change
+		 * (not magic packet or pattern match)
+		 */
+		length = sizeof (struct NDIS_PNP_CAPABILITIES);
+		memset (resp, 0, length);
+		{
+			struct NDIS_PNP_CAPABILITIES *caps = (void *) resp;
+
+			caps->Flags = NDIS_DEVICE_WAKE_UP_ENABLE;
+			caps->WakeUpCapabilities.MinLinkChangeWakeUp 
+				 = NdisDeviceStateD3;
+
+			/* FIXME then use usb_gadget_wakeup(), and
+			 * set USB_CONFIG_ATT_WAKEUP in config desc
+			 */
+		}
+		retval = 0;
+		break;
+	case OID_PNP_QUERY_POWER:
+		DEBUG("%s: OID_PNP_QUERY_POWER\n", __FUNCTION__);
+		/* sure, handle any power state that maps to USB suspend */
+		retval = 0;
+		break;
+#endif
+
+	default:
+		printk (KERN_WARNING "%s: query unknown OID 0x%08X\n", 
 			 __FUNCTION__, OID);
 	}
 	
-	resp->InformationBufferOffset = 16;
-	resp->InformationBufferLength = length;
-	resp->MessageLength = 24 + length;
+	resp->InformationBufferOffset = __constant_cpu_to_le32 (16);
+	resp->InformationBufferLength = cpu_to_le32 (length);
+	resp->MessageLength = cpu_to_le32 (24 + length);
 	r->length = 24 + length;
 	return retval;
 }
@@ -715,9 +698,7 @@ static int gen_ndis_set_resp (u8 configNr, u32 OID, u8 *buf, u32 buf_len,
 {
 	rndis_set_cmplt_type		*resp;
 	int 				i, retval = -ENOTSUPP;
-	struct rndis_config_parameter	*param;
 	struct rndis_params		*params;
-	u8 *cp;
 
 	if (!r)
 		return -ENOMEM;
@@ -725,20 +706,37 @@ static int gen_ndis_set_resp (u8 configNr, u32 OID, u8 *buf, u32 buf_len,
 	if (!resp)
 		return -ENOMEM;
 
-	cp = (u8 *)resp;
+	DEBUG("set OID %08x value, len %d:\n", OID, buf_len);
+	for (i = 0; i < buf_len; i += 16) {
+		DEBUG ("%03d: "
+			" %02x %02x %02x %02x"
+			" %02x %02x %02x %02x"
+			" %02x %02x %02x %02x"
+			" %02x %02x %02x %02x"
+			"\n",
+			i,
+			buf[i], buf [i+1],
+				buf[i+2], buf[i+3],
+			buf[i+4], buf [i+5],
+				buf[i+6], buf[i+7],
+			buf[i+8], buf [i+9],
+				buf[i+10], buf[i+11],
+			buf[i+12], buf [i+13],
+				buf[i+14], buf[i+15]);
+	}
 
 	switch (OID) {
 	case OID_GEN_CURRENT_PACKET_FILTER:
 		params = &rndis_per_dev_params [configNr];
 		retval = 0;
 
-		/* FIXME use this NDIS_PACKET_TYPE_* bitflags to
+		/* FIXME use these NDIS_PACKET_TYPE_* bitflags to
 		 * filter packets in hard_start_xmit()
 		 * NDIS_PACKET_TYPE_x == CDC_PACKET_TYPE_x for x in:
 		 *	PROMISCUOUS, DIRECTED,
 		 *	MULTICAST, ALL_MULTICAST, BROADCAST
 		 */
-		params->filter = *(u32 *)buf;
+		params->filter = cpu_to_le32p((u32 *)buf);
 		DEBUG("%s: OID_GEN_CURRENT_PACKET_FILTER %08x\n",
 			__FUNCTION__, params->filter);
 
@@ -763,23 +761,40 @@ static int gen_ndis_set_resp (u8 configNr, u32 OID, u8 *buf, u32 buf_len,
 		DEBUG("%s: OID_802_3_MULTICAST_LIST\n", __FUNCTION__);
 		retval = 0;
 		break;
-		
+#if 0
 	case OID_GEN_RNDIS_CONFIG_PARAMETER:
-		DEBUG("%s: OID_GEN_RNDIS_CONFIG_PARAMETER\n", __FUNCTION__);
+		{
+		struct rndis_config_parameter	*param;
 		param = (struct rndis_config_parameter *) buf;
-		if (param) {
-			for (i = 0; i < param->ParameterNameLength; i++) {
-				DEBUG ("%c", 
-				       *(buf + param->ParameterNameOffset + i));
-			}
-			DEBUG ("\n");
+		DEBUG("%s: OID_GEN_RNDIS_CONFIG_PARAMETER '%*s'\n",
+			__FUNCTION__,
+			min(cpu_to_le32(param->ParameterNameLength),80),
+			buf + param->ParameterNameOffset);
+		retval = 0;
 		}
-		
+		break;
+#endif
+
+#ifdef	RNDIS_PM
+	case OID_PNP_SET_POWER:
+		DEBUG ("OID_PNP_SET_POWER\n");
+		/* sure, handle any power state that maps to USB suspend */
 		retval = 0;
 		break;
-		
-	default: printk (KERN_ERR "%s: unknown OID 0x%08X\n", 
-			 __FUNCTION__, OID);
+
+	case OID_PNP_ENABLE_WAKE_UP:
+		/* always-connected ... */
+		DEBUG ("OID_PNP_ENABLE_WAKE_UP\n");
+		retval = 0;
+		break;
+
+	// no PM resume patterns supported (specified where?)
+	// so OID_PNP_{ADD,REMOVE}_WAKE_UP_PATTERN always fails
+#endif
+
+	default:
+		printk (KERN_WARNING "%s: set unknown OID 0x%08X, size %d\n", 
+			 __FUNCTION__, OID, buf_len);
 	}
 	
 	return retval;
@@ -804,22 +819,24 @@ static int rndis_init_response (int configNr, rndis_init_msg_type *buf)
 	
 	if (!resp) return -ENOMEM;
 	
-	resp->MessageType = REMOTE_NDIS_INITIALIZE_CMPLT;
-	resp->MessageLength = 52;
-	resp->RequestID = buf->RequestID;
-	resp->Status = RNDIS_STATUS_SUCCESS;
-	resp->MajorVersion = RNDIS_MAJOR_VERSION;
-	resp->MinorVersion = RNDIS_MINOR_VERSION;
-	resp->DeviceFlags = RNDIS_DF_CONNECTIONLESS;
-	resp->Medium = RNDIS_MEDIUM_802_3;
-	resp->MaxPacketsPerTransfer = 1;
-	resp->MaxTransferSize = rndis_per_dev_params [configNr].dev->mtu
+	resp->MessageType = __constant_cpu_to_le32 (
+			REMOTE_NDIS_INITIALIZE_CMPLT);
+	resp->MessageLength = __constant_cpu_to_le32 (52);
+	resp->RequestID = buf->RequestID; /* Still LE in msg buffer */
+	resp->Status = __constant_cpu_to_le32 (RNDIS_STATUS_SUCCESS);
+	resp->MajorVersion = __constant_cpu_to_le32 (RNDIS_MAJOR_VERSION);
+	resp->MinorVersion = __constant_cpu_to_le32 (RNDIS_MINOR_VERSION);
+	resp->DeviceFlags = __constant_cpu_to_le32 (RNDIS_DF_CONNECTIONLESS);
+	resp->Medium = __constant_cpu_to_le32 (RNDIS_MEDIUM_802_3);
+	resp->MaxPacketsPerTransfer = __constant_cpu_to_le32 (1);
+	resp->MaxTransferSize = cpu_to_le32 (
+		  rndis_per_dev_params [configNr].dev->mtu
 		+ sizeof (struct ethhdr)
 		+ sizeof (struct rndis_packet_msg_type)
-		+ 22;
-	resp->PacketAlignmentFactor = 0;
-	resp->AFListOffset = 0;
-	resp->AFListSize = 0;
+		+ 22);
+	resp->PacketAlignmentFactor = __constant_cpu_to_le32 (0);
+	resp->AFListOffset = __constant_cpu_to_le32 (0);
+	resp->AFListSize = __constant_cpu_to_le32 (0);
 	
 	if (rndis_per_dev_params [configNr].ack)
 	    rndis_per_dev_params [configNr].ack (
@@ -833,7 +850,7 @@ static int rndis_query_response (int configNr, rndis_query_msg_type *buf)
 	rndis_query_cmplt_type *resp;
 	rndis_resp_t            *r;
 	
-	DEBUG("%s: OID = %08X\n", __FUNCTION__, buf->OID);
+	// DEBUG("%s: OID = %08X\n", __FUNCTION__, cpu_to_le32(buf->OID));
 	if (!rndis_per_dev_params [configNr].dev) return -ENOTSUPP;
 	
 	/* 
@@ -847,17 +864,18 @@ static int rndis_query_response (int configNr, rndis_query_msg_type *buf)
 	
 	if (!resp) return -ENOMEM;
 	
-	resp->MessageType = REMOTE_NDIS_QUERY_CMPLT;
-	resp->MessageLength = 24;
-	resp->RequestID = buf->RequestID;
+	resp->MessageType = __constant_cpu_to_le32 (REMOTE_NDIS_QUERY_CMPLT);
+	resp->MessageLength = __constant_cpu_to_le32 (24);
+	resp->RequestID = buf->RequestID; /* Still LE in msg buffer */
 	
-	if (gen_ndis_query_resp (configNr, buf->OID, r)) {
+	if (gen_ndis_query_resp (configNr, cpu_to_le32 (buf->OID), r)) {
 		/* OID not supported */
-		resp->Status = RNDIS_STATUS_NOT_SUPPORTED;
-		resp->InformationBufferLength = 0;
-		resp->InformationBufferOffset = 0;
+		resp->Status = __constant_cpu_to_le32 (
+				RNDIS_STATUS_NOT_SUPPORTED);
+		resp->InformationBufferLength = __constant_cpu_to_le32 (0);
+		resp->InformationBufferOffset = __constant_cpu_to_le32 (0);
 	} else
-		resp->Status = RNDIS_STATUS_SUCCESS;
+		resp->Status = __constant_cpu_to_le32 (RNDIS_STATUS_SUCCESS);
 	
 	if (rndis_per_dev_params [configNr].ack)
 	    rndis_per_dev_params [configNr].ack (
@@ -867,38 +885,42 @@ static int rndis_query_response (int configNr, rndis_query_msg_type *buf)
 
 static int rndis_set_response (int configNr, rndis_set_msg_type *buf)
 {
+	u32			BufLength, BufOffset;
 	rndis_set_cmplt_type	*resp;
 	rndis_resp_t		*r;
-	int			i;
 	
 	r = rndis_add_response (configNr, sizeof (rndis_set_cmplt_type));
 	
 	if (!r) return -ENOMEM;
 	resp = (rndis_set_cmplt_type *) r->buf;
 	if (!resp) return -ENOMEM;
-	
-	DEBUG("%s: Length: %d\n", __FUNCTION__, buf->InformationBufferLength);
-	DEBUG("%s: Offset: %d\n", __FUNCTION__, buf->InformationBufferOffset);
+
+	BufLength = cpu_to_le32 (buf->InformationBufferLength);
+	BufOffset = cpu_to_le32 (buf->InformationBufferOffset);
+
+#ifdef	VERBOSE
+	DEBUG("%s: Length: %d\n", __FUNCTION__, BufLength);
+	DEBUG("%s: Offset: %d\n", __FUNCTION__, BufOffset);
 	DEBUG("%s: InfoBuffer: ", __FUNCTION__);
 	
-	for (i = 0; i < buf->InformationBufferLength; i++) {
-		DEBUG ("%02x ", *(((u8 *) buf) + i + 12 +
-		       buf->InformationBufferOffset));
+	for (i = 0; i < BufLength; i++) {
+		DEBUG ("%02x ", *(((u8 *) buf) + i + 8 + BufOffset));
 	}
 	
 	DEBUG ("\n");
+#endif
 	
-	resp->MessageType = REMOTE_NDIS_SET_CMPLT;
-	resp->MessageLength = 16;
-	resp->RequestID = buf->RequestID;
-	if (gen_ndis_set_resp (configNr, buf->OID, 
-			       ((u8 *) buf) + 28, 
-			       buf->InformationBufferLength, r))
-	    resp->Status = RNDIS_STATUS_NOT_SUPPORTED;
-	else resp->Status = RNDIS_STATUS_SUCCESS;
+	resp->MessageType = __constant_cpu_to_le32 (REMOTE_NDIS_SET_CMPLT);
+	resp->MessageLength = __constant_cpu_to_le32 (16);
+	resp->RequestID = buf->RequestID; /* Still LE in msg buffer */
+	if (gen_ndis_set_resp (configNr, cpu_to_le32 (buf->OID), 
+			       ((u8 *) buf) + 8 + BufOffset, BufLength, r))
+	    resp->Status = __constant_cpu_to_le32 (RNDIS_STATUS_NOT_SUPPORTED);
+	else resp->Status = __constant_cpu_to_le32 (RNDIS_STATUS_SUCCESS);
 	
 	if (rndis_per_dev_params [configNr].ack)
-	    rndis_per_dev_params [configNr].ack (rndis_per_dev_params [configNr].dev);
+	    rndis_per_dev_params [configNr].ack (
+	    		rndis_per_dev_params [configNr].dev);
 	
 	return 0;
 }
@@ -914,10 +936,11 @@ static int rndis_reset_response (int configNr, rndis_reset_msg_type *buf)
 	resp = (rndis_reset_cmplt_type *) r->buf;
 	if (!resp) return -ENOMEM;
 	
-	resp->MessageType = REMOTE_NDIS_RESET_CMPLT;
-	resp->MessageLength = 16;
-	resp->Status = RNDIS_STATUS_SUCCESS;
-	resp->AddressingReset = 1; /* resent information */
+	resp->MessageType = __constant_cpu_to_le32 (REMOTE_NDIS_RESET_CMPLT);
+	resp->MessageLength = __constant_cpu_to_le32 (16);
+	resp->Status = __constant_cpu_to_le32 (RNDIS_STATUS_SUCCESS);
+	/* resent information */
+	resp->AddressingReset = __constant_cpu_to_le32 (1);
 	
 	if (rndis_per_dev_params [configNr].ack)
 	    rndis_per_dev_params [configNr].ack (
@@ -938,10 +961,11 @@ static int rndis_keepalive_response (int configNr,
 	resp = (rndis_keepalive_cmplt_type *) r->buf;
 	if (!resp) return -ENOMEM;
 		
-	resp->MessageType = REMOTE_NDIS_KEEPALIVE_CMPLT;
-	resp->MessageLength = 16;
-	resp->RequestID = buf->RequestID;
-	resp->Status = RNDIS_STATUS_SUCCESS;
+	resp->MessageType = __constant_cpu_to_le32 (
+			REMOTE_NDIS_KEEPALIVE_CMPLT);
+	resp->MessageLength = __constant_cpu_to_le32 (16);
+	resp->RequestID = buf->RequestID; /* Still LE in msg buffer */
+	resp->Status = __constant_cpu_to_le32 (RNDIS_STATUS_SUCCESS);
 	
 	if (rndis_per_dev_params [configNr].ack)
 	    rndis_per_dev_params [configNr].ack (
@@ -969,11 +993,12 @@ static int rndis_indicate_status_msg (int configNr, u32 status)
 	resp = (rndis_indicate_status_msg_type *) r->buf;
 	if (!resp) return -ENOMEM;
 	
-	resp->MessageType = REMOTE_NDIS_INDICATE_STATUS_MSG;
-	resp->MessageLength = 20;
-	resp->Status = status;
-	resp->StatusBufferLength = 0;
-	resp->StatusBufferOffset = 0;
+	resp->MessageType = __constant_cpu_to_le32 (
+			REMOTE_NDIS_INDICATE_STATUS_MSG);
+	resp->MessageLength = __constant_cpu_to_le32 (20);
+	resp->Status = cpu_to_le32 (status);
+	resp->StatusBufferLength = __constant_cpu_to_le32 (0);
+	resp->StatusBufferOffset = __constant_cpu_to_le32 (0);
 	
 	if (rndis_per_dev_params [configNr].ack) 
 	    rndis_per_dev_params [configNr].ack (
@@ -1014,8 +1039,8 @@ int rndis_msg_parser (u8 configNr, u8 *buf)
 		return -ENOMEM;
 	
 	tmp = (u32 *) buf; 
-	MsgType = *tmp;
-	MsgLength = *(tmp + 1);
+	MsgType   = cpu_to_le32p(tmp++);
+	MsgLength = cpu_to_le32p(tmp++);
 	
 	if (configNr >= RNDIS_MAX_CONFIGS)
 		return -ENOTSUPP;
@@ -1025,14 +1050,14 @@ int rndis_msg_parser (u8 configNr, u8 *buf)
 	switch (MsgType)
 	{
 	case REMOTE_NDIS_INITIALIZE_MSG:
-		DEBUG(KERN_INFO "%s: REMOTE_NDIS_INITIALIZE_MSG\n", 
+		DEBUG("%s: REMOTE_NDIS_INITIALIZE_MSG\n", 
 			__FUNCTION__ );
 		params->state = RNDIS_INITIALIZED;
 		return  rndis_init_response (configNr,
 					     (rndis_init_msg_type *) buf);
 		
 	case REMOTE_NDIS_HALT_MSG:
-		DEBUG(KERN_INFO "%s: REMOTE_NDIS_HALT_MSG\n",
+		DEBUG("%s: REMOTE_NDIS_HALT_MSG\n",
 			__FUNCTION__ );
 		params->state = RNDIS_UNINITIALIZED;
 		if (params->dev) {
@@ -1042,34 +1067,57 @@ int rndis_msg_parser (u8 configNr, u8 *buf)
 		return 0;
 		
 	case REMOTE_NDIS_QUERY_MSG:
-		DEBUG(KERN_INFO "%s: REMOTE_NDIS_QUERY_MSG\n", 
-			__FUNCTION__ );
 		return rndis_query_response (configNr, 
 					     (rndis_query_msg_type *) buf);
 		
 	case REMOTE_NDIS_SET_MSG:
-		DEBUG(KERN_INFO "%s: REMOTE_NDIS_SET_MSG\n", 
-			__FUNCTION__ );
 		return rndis_set_response (configNr, 
 					   (rndis_set_msg_type *) buf);
 		
 	case REMOTE_NDIS_RESET_MSG:
-		DEBUG(KERN_INFO "%s: REMOTE_NDIS_RESET_MSG\n", 
+		DEBUG("%s: REMOTE_NDIS_RESET_MSG\n", 
 			__FUNCTION__ );
 		return rndis_reset_response (configNr,
 					     (rndis_reset_msg_type *) buf);
 
 	case REMOTE_NDIS_KEEPALIVE_MSG:
 		/* For USB: host does this every 5 seconds */
-		DEBUG(KERN_INFO "%s: REMOTE_NDIS_KEEPALIVE_MSG\n", 
+#ifdef	VERBOSE
+		DEBUG("%s: REMOTE_NDIS_KEEPALIVE_MSG\n", 
 			__FUNCTION__ );
+#endif
 		return rndis_keepalive_response (configNr,
 						 (rndis_keepalive_msg_type *) 
 						 buf);
 		
 	default: 
-		printk (KERN_ERR "%s: unknown RNDIS Message Type 0x%08X\n", 
-			__FUNCTION__ , MsgType);
+		/* At least Windows XP emits some undefined RNDIS messages.
+		 * In one case those messages seemed to relate to the host
+		 * suspending itself.
+		 */
+		printk (KERN_WARNING
+			"%s: unknown RNDIS message 0x%08X len %d\n", 
+			__FUNCTION__ , MsgType, MsgLength);
+		{
+			unsigned i;
+			for (i = 0; i < MsgLength; i += 16) {
+				DEBUG ("%03d: "
+					" %02x %02x %02x %02x"
+					" %02x %02x %02x %02x"
+					" %02x %02x %02x %02x"
+					" %02x %02x %02x %02x"
+					"\n",
+					i,
+					buf[i], buf [i+1],
+						buf[i+2], buf[i+3],
+					buf[i+4], buf [i+5],
+						buf[i+6], buf[i+7],
+					buf[i+8], buf [i+9],
+						buf[i+10], buf[i+11],
+					buf[i+12], buf [i+13],
+						buf[i+14], buf[i+15]);
+			}
+		}
 		break;
 	}
 	
@@ -1079,13 +1127,12 @@ int rndis_msg_parser (u8 configNr, u8 *buf)
 int rndis_register (int (* rndis_control_ack) (struct net_device *))
 {
 	u8 i;
-	DEBUG("%s: ", __FUNCTION__ );
 	
 	for (i = 0; i < RNDIS_MAX_CONFIGS; i++) {
 		if (!rndis_per_dev_params [i].used) {
 			rndis_per_dev_params [i].used = 1;
 			rndis_per_dev_params [i].ack = rndis_control_ack;
-			DEBUG("configNr = %d\n", i);
+			DEBUG("%s: configNr = %d\n", __FUNCTION__, i);
 			return i;
 		}
 	}
@@ -1145,10 +1192,10 @@ void rndis_add_hdr (struct sk_buff *skb)
 	if (!skb) return;
 	skb_push (skb, sizeof (struct rndis_packet_msg_type));
 	memset (skb->data, 0, sizeof (struct rndis_packet_msg_type));
-	*((u32 *) skb->data) = 1;
-	*((u32 *) skb->data + 1) = skb->len;
-	*((u32 *) skb->data + 2) = 36;
-	*((u32 *) skb->data + 3) = skb->len - 44;
+	*((u32 *) skb->data) = __constant_cpu_to_le32 (1);
+	*((u32 *) skb->data + 1) = cpu_to_le32(skb->len);
+	*((u32 *) skb->data + 2) = __constant_cpu_to_le32 (36);
+	*((u32 *) skb->data + 3) = cpu_to_le32(skb->len - 44);
 	
 	return;
 }
@@ -1208,14 +1255,16 @@ static rndis_resp_t *rndis_add_response (int configNr, u32 length)
 
 int rndis_rm_hdr (u8 *buf, u32 *length)
 {
-	u32 i, messageLen, dataOffset;
+	u32 i, messageLen, dataOffset, *tmp;
 	
+	tmp = (u32 *) buf; 
+
 	if (!buf || !length) return -1;
-	if (*((u32 *) buf) != 1) return -1;
+	if (cpu_to_le32p(tmp++) != 1) return -1;
 	
-	messageLen = *((u32 *) buf + 1);
-	
-	dataOffset = *((u32 *) buf + 2) + 8;
+	messageLen = cpu_to_le32p(tmp++);
+	dataOffset = cpu_to_le32p(tmp++) + 8;
+
 	if (messageLen < dataOffset || messageLen > *length) return -1;
 	
 	for (i = dataOffset; i < messageLen; i++)
@@ -1271,14 +1320,18 @@ int rndis_proc_read (char *page, char **start, off_t off, int count, int *eof,
 	return len;
 }
 
-int rndis_proc_write (struct file *file, const char *buffer, 
+int rndis_proc_write (struct file *file, const char __user *buffer, 
 		      unsigned long count, void *data)
 {
+	rndis_params *p = data;
 	u32 speed = 0;
 	int i, fl_speed = 0;
 	
 	for (i = 0; i < count; i++) {
-		switch (*buffer) {
+		char c;
+		if (get_user(c, buffer))
+			return -EFAULT;
+		switch (c) {
 		case '0':
 		case '1':
 		case '2':
@@ -1290,21 +1343,19 @@ int rndis_proc_write (struct file *file, const char *buffer,
 		case '8':
 		case '9':
 			fl_speed = 1;
-			speed = speed*10 + *buffer - '0';
+			speed = speed*10 + c - '0';
 			break;
 		case 'C':
 		case 'c':
-			rndis_signal_connect (((rndis_params *) data)
-				->confignr);
+			rndis_signal_connect (p->confignr);
 			break;
 		case 'D':
 		case 'd':
-			rndis_signal_disconnect (((rndis_params *) data)
-				->confignr);
+			rndis_signal_disconnect(p->confignr);
 			break;
 		default: 
-			if (fl_speed) ((rndis_params *) data)->speed = speed;
-			else DEBUG ("%c is not valid\n", *buffer);
+			if (fl_speed) p->speed = speed;
+			else DEBUG ("%c is not valid\n", c);
 			break;
 		}
 		
diff --git a/drivers/usb/gadget/rndis.h b/drivers/usb/gadget/rndis.h
index 150ec8e5a..fa7d90854 100644
--- a/drivers/usb/gadget/rndis.h
+++ b/drivers/usb/gadget/rndis.h
@@ -59,10 +59,18 @@
 
 #define RNDIS_MEDIUM_802_3		0x00000000U
 
+/* from drivers/net/sk98lin/h/skgepnmi.h */
+#define OID_PNP_CAPABILITIES			0xFD010100
+#define OID_PNP_SET_POWER			0xFD010101
+#define OID_PNP_QUERY_POWER			0xFD010102
+#define OID_PNP_ADD_WAKE_UP_PATTERN		0xFD010103
+#define OID_PNP_REMOVE_WAKE_UP_PATTERN		0xFD010104
+#define OID_PNP_ENABLE_WAKE_UP			0xFD010106
+
+
 /* supported OIDs */
 static const u32 oid_supported_list [] = 
 {
-	/* mandatory general */
 	/* the general stuff */
 	OID_GEN_SUPPORTED_LIST,
 	OID_GEN_HARDWARE_STATUS,
@@ -70,7 +78,6 @@ static const u32 oid_supported_list [] =
 	OID_GEN_MEDIA_IN_USE,
 	OID_GEN_MAXIMUM_FRAME_SIZE,
 	OID_GEN_LINK_SPEED,
-	OID_GEN_TRANSMIT_BUFFER_SPACE,
 	OID_GEN_TRANSMIT_BLOCK_SIZE,
 	OID_GEN_RECEIVE_BLOCK_SIZE,
 	OID_GEN_VENDOR_ID,
@@ -78,10 +85,11 @@ static const u32 oid_supported_list [] =
 	OID_GEN_VENDOR_DRIVER_VERSION,
 	OID_GEN_CURRENT_PACKET_FILTER,
 	OID_GEN_MAXIMUM_TOTAL_SIZE,
-	OID_GEN_MAC_OPTIONS,
 	OID_GEN_MEDIA_CONNECT_STATUS,
 	OID_GEN_PHYSICAL_MEDIUM,
+#if 0
 	OID_GEN_RNDIS_CONFIG_PARAMETER,
+#endif
 	
 	/* the statistical stuff */
 	OID_GEN_XMIT_OK,
@@ -89,6 +97,7 @@ static const u32 oid_supported_list [] =
 	OID_GEN_XMIT_ERROR,
 	OID_GEN_RCV_ERROR,
 	OID_GEN_RCV_NO_BUFFER,
+#ifdef	RNDIS_OPTIONAL_STATS
 	OID_GEN_DIRECTED_BYTES_XMIT,
 	OID_GEN_DIRECTED_FRAMES_XMIT,
 	OID_GEN_MULTICAST_BYTES_XMIT,
@@ -103,6 +112,7 @@ static const u32 oid_supported_list [] =
 	OID_GEN_BROADCAST_FRAMES_RCV,
 	OID_GEN_RCV_CRC_ERROR,
 	OID_GEN_TRANSMIT_QUEUE_LENGTH,
+#endif	/* RNDIS_OPTIONAL_STATS */
 
     	/* mandatory 802.3 */
 	/* the general stuff */
@@ -115,7 +125,30 @@ static const u32 oid_supported_list [] =
 	/* the statistical stuff */
 	OID_802_3_RCV_ERROR_ALIGNMENT,
 	OID_802_3_XMIT_ONE_COLLISION,
-	OID_802_3_XMIT_MORE_COLLISIONS
+	OID_802_3_XMIT_MORE_COLLISIONS,
+#ifdef	RNDIS_OPTIONAL_STATS
+	OID_802_3_XMIT_DEFERRED,
+	OID_802_3_XMIT_MAX_COLLISIONS,
+	OID_802_3_RCV_OVERRUN,
+	OID_802_3_XMIT_UNDERRUN,
+	OID_802_3_XMIT_HEARTBEAT_FAILURE,
+	OID_802_3_XMIT_TIMES_CRS_LOST,
+	OID_802_3_XMIT_LATE_COLLISIONS,
+#endif	/* RNDIS_OPTIONAL_STATS */
+
+#ifdef	RNDIS_PM
+	/* PM and wakeup are mandatory for USB: */
+
+	/* power management */
+	OID_PNP_CAPABILITIES,
+	OID_PNP_QUERY_POWER,
+	OID_PNP_SET_POWER,
+
+	/* wake up host */
+	OID_PNP_ENABLE_WAKE_UP,
+	OID_PNP_ADD_WAKE_UP_PATTERN,
+	OID_PNP_REMOVE_WAKE_UP_PATTERN,
+#endif
 };
 
 
diff --git a/drivers/usb/gadget/serial.c b/drivers/usb/gadget/serial.c
index ba646704d..ebfc22b2a 100644
--- a/drivers/usb/gadget/serial.c
+++ b/drivers/usb/gadget/serial.c
@@ -249,6 +249,20 @@ static const char EP_IN_NAME[] =	"ep1in-bulk";
 #define hw_optimize(g)			do {} while (0)
 #endif
 
+#ifdef	CONFIG_USB_GADGET_OMAP
+#define CHIP			"omap"
+#define EP0_MAXPACKET			64
+static const char EP_OUT_NAME [] = "ep2out-bulk";
+#define EP_OUT_NUM	2
+static const char EP_IN_NAME [] = "ep1in-bulk";
+#define EP_IN_NUM	1
+#define SELFPOWER 			USB_CONFIG_ATT_SELFPOWER
+/* supports remote wakeup, but this driver doesn't */
+
+/* no hw optimizations to apply */
+#define hw_optimize(g) do {} while (0)
+#endif
+
 
 /*
  * SA-1100 UDC:  widely used in first gen Linux-capable PDAs.
@@ -1573,6 +1587,8 @@ static int gs_setup(struct usb_gadget *gadget, const struct usb_ctrlrequest *ctr
 	/* respond with data transfer before status phase? */
 	if (ret >= 0) {
 		req->length = ret;
+		req->zero = ret < ctrl->wLength
+				&& (ret % gadget->ep0->maxpacket) == 0;
 		ret = usb_ep_queue(gadget->ep0, req, GFP_ATOMIC);
 		if (ret < 0) {
 			printk(KERN_ERR
diff --git a/drivers/usb/gadget/zero.c b/drivers/usb/gadget/zero.c
index d779790d1..4fa5e1c8f 100644
--- a/drivers/usb/gadget/zero.c
+++ b/drivers/usb/gadget/zero.c
@@ -194,8 +194,13 @@ module_param (loopdefault, bool, S_IRUGO|S_IWUSR);
  * DO NOT REUSE THESE IDs with a protocol-incompatible driver!!  Ever!!
  * Instead:  allocate your own, using normal USB-IF procedures.
  */
+#ifndef	CONFIG_USB_ZERO_HNPTEST
 #define DRIVER_VENDOR_NUM	0x0525		/* NetChip */
 #define DRIVER_PRODUCT_NUM	0xa4a0		/* Linux-USB "Gadget Zero" */
+#else
+#define DRIVER_VENDOR_NUM	0x1a0a		/* OTG test device IDs */
+#define DRIVER_PRODUCT_NUM	0xbadd
+#endif
 
 /*-------------------------------------------------------------------------*/
 
@@ -259,6 +264,14 @@ loopback_config = {
 	.bMaxPower =		1,	/* self-powered */
 };
 
+static struct usb_otg_descriptor
+otg_descriptor = {
+	.bLength =		sizeof otg_descriptor,
+	.bDescriptorType =	USB_DT_OTG,
+
+	.bmAttributes =		USB_OTG_SRP,
+};
+
 /* one interface in each configuration */
 
 static const struct usb_interface_descriptor
@@ -302,17 +315,19 @@ fs_sink_desc = {
 };
 
 static const struct usb_descriptor_header *fs_source_sink_function [] = {
+	(struct usb_descriptor_header *) &otg_descriptor,
 	(struct usb_descriptor_header *) &source_sink_intf,
 	(struct usb_descriptor_header *) &fs_sink_desc,
 	(struct usb_descriptor_header *) &fs_source_desc,
-	0,
+	NULL,
 };
 
 static const struct usb_descriptor_header *fs_loopback_function [] = {
+	(struct usb_descriptor_header *) &otg_descriptor,
 	(struct usb_descriptor_header *) &loopback_intf,
 	(struct usb_descriptor_header *) &fs_sink_desc,
 	(struct usb_descriptor_header *) &fs_source_desc,
-	0,
+	NULL,
 };
 
 #ifdef	CONFIG_USB_GADGET_DUALSPEED
@@ -356,17 +371,19 @@ dev_qualifier = {
 };
 
 static const struct usb_descriptor_header *hs_source_sink_function [] = {
+	(struct usb_descriptor_header *) &otg_descriptor,
 	(struct usb_descriptor_header *) &source_sink_intf,
 	(struct usb_descriptor_header *) &hs_source_desc,
 	(struct usb_descriptor_header *) &hs_sink_desc,
-	0,
+	NULL,
 };
 
 static const struct usb_descriptor_header *hs_loopback_function [] = {
+	(struct usb_descriptor_header *) &otg_descriptor,
 	(struct usb_descriptor_header *) &loopback_intf,
 	(struct usb_descriptor_header *) &hs_source_desc,
 	(struct usb_descriptor_header *) &hs_sink_desc,
-	0,
+	NULL,
 };
 
 /* maxpacket and other transfer characteristics vary by speed. */
@@ -444,6 +461,10 @@ config_buf (struct usb_gadget *gadget,
 			? fs_source_sink_function
 			: fs_loopback_function;
 
+	/* for now, don't advertise srp-only devices */
+	if (!gadget->is_otg)
+		function++;
+
 	len = usb_gadget_config_buf (is_source_sink
 					? &source_sink_config
 					: &loopback_config,
@@ -468,7 +489,7 @@ alloc_ep_req (struct usb_ep *ep, unsigned length)
 				&req->dma, GFP_ATOMIC);
 		if (!req->buf) {
 			usb_ep_free_request (ep, req);
-			req = 0;
+			req = NULL;
 		}
 	}
 	return req;
@@ -485,7 +506,7 @@ static void free_ep_req (struct usb_ep *ep, struct usb_request *req)
 
 /* optionally require specific source/sink data patterns  */
 
-static inline int
+static int
 check_read_data (
 	struct zero_dev		*dev,
 	struct usb_ep		*ep,
@@ -519,7 +540,7 @@ check_read_data (
 	return 0;
 }
 
-static inline void
+static void
 reinit_write_data (
 	struct zero_dev		*dev,
 	struct usb_ep		*ep,
@@ -599,7 +620,7 @@ source_sink_start_ep (struct usb_ep *ep, int gfp_flags)
 
 	req = alloc_ep_req (ep, buflen);
 	if (!req)
-		return 0;
+		return NULL;
 
 	memset (req->buf, 0, req->length);
 	req->complete = source_sink_complete;
@@ -613,7 +634,7 @@ source_sink_start_ep (struct usb_ep *ep, int gfp_flags)
 
 		ERROR (dev, "start %s --> %d\n", ep->name, status);
 		free_ep_req (ep, req);
-		req = 0;
+		req = NULL;
 	}
 
 	return req;
@@ -804,13 +825,14 @@ static void zero_reset_config (struct zero_dev *dev)
 	 */
 	if (dev->in_ep) {
 		usb_ep_disable (dev->in_ep);
-		dev->in_ep = 0;
+		dev->in_ep = NULL;
 	}
 	if (dev->out_ep) {
 		usb_ep_disable (dev->out_ep);
-		dev->out_ep = 0;
+		dev->out_ep = NULL;
 	}
 	dev->config = 0;
+	del_timer (&dev->resume);
 }
 
 /* change our operational config.  this code must agree with the code
@@ -902,6 +924,7 @@ zero_setup (struct usb_gadget *gadget, const struct usb_ctrlrequest *ctrl)
 	/* usually this stores reply data in the pre-allocated ep0 buffer,
 	 * but config change events will reconfigure hardware.
 	 */
+	req->zero = 0;
 	switch (ctrl->bRequest) {
 
 	case USB_REQ_GET_DESCRIPTOR:
@@ -951,6 +974,12 @@ zero_setup (struct usb_gadget *gadget, const struct usb_ctrlrequest *ctrl)
 	case USB_REQ_SET_CONFIGURATION:
 		if (ctrl->bRequestType != 0)
 			goto unknown;
+		if (gadget->a_hnp_support)
+			DBG (dev, "HNP available\n");
+		else if (gadget->a_alt_hnp_support)
+			DBG (dev, "HNP needs a different root port\n");
+		else
+			VDBG (dev, "HNP inactive\n");
 		spin_lock (&dev->lock);
 		value = zero_set_config (dev, ctrl->wValue, GFP_ATOMIC);
 		spin_unlock (&dev->lock);
@@ -1037,6 +1066,8 @@ unknown:
 	/* respond with data transfer before status phase? */
 	if (value >= 0) {
 		req->length = value;
+		req->zero = value < ctrl->wLength
+				&& (value % gadget->ep0->maxpacket) == 0;
 		value = usb_ep_queue (gadget->ep0, req, GFP_ATOMIC);
 		if (value < 0) {
 			DBG (dev, "ep_queue --> %d\n", value);
@@ -1078,8 +1109,10 @@ zero_autoresume (unsigned long _dev)
 	/* normally the host would be woken up for something
 	 * more significant than just a timer firing...
 	 */
-	status = usb_gadget_wakeup (dev->gadget);
-	DBG (dev, "wakeup --> %d\n", status);
+	if (dev->gadget->speed != USB_SPEED_UNKNOWN) {
+		status = usb_gadget_wakeup (dev->gadget);
+		DBG (dev, "wakeup --> %d\n", status);
+	}
 }
 
 /*-------------------------------------------------------------------------*/
@@ -1096,7 +1129,7 @@ zero_unbind (struct usb_gadget *gadget)
 		free_ep_req (gadget->ep0, dev->req);
 	del_timer_sync (&dev->resume);
 	kfree (dev);
-	set_gadget_data (gadget, 0);
+	set_gadget_data (gadget, NULL);
 }
 
 static int
@@ -1197,6 +1230,12 @@ autoconf_fail:
 	hs_sink_desc.bEndpointAddress = fs_sink_desc.bEndpointAddress;
 #endif
 
+	if (gadget->is_otg) {
+		otg_descriptor.bmAttributes |= USB_OTG_HNP,
+		source_sink_config.bmAttributes |= USB_CONFIG_ATT_WAKEUP;
+		loopback_config.bmAttributes |= USB_CONFIG_ATT_WAKEUP;
+	}
+
 	usb_gadget_set_selfpowered (gadget);
 
 	init_timer (&dev->resume);
diff --git a/drivers/usb/host/ehci-dbg.c b/drivers/usb/host/ehci-dbg.c
index 8ade5dec0..ad32ba159 100644
--- a/drivers/usb/host/ehci-dbg.c
+++ b/drivers/usb/host/ehci-dbg.c
@@ -536,7 +536,7 @@ show_periodic (struct class_device *class_dev, char *buf)
 					if (p.qh->qh_next.ptr)
 						temp = scnprintf (next, size,
 							" ...");
-					p.ptr = 0;
+					p.ptr = NULL;
 					break;
 				}
 				/* show more info the first time around */
diff --git a/drivers/usb/host/ehci-hcd.c b/drivers/usb/host/ehci-hcd.c
index 08fb7643b..d3bb7b508 100644
--- a/drivers/usb/host/ehci-hcd.c
+++ b/drivers/usb/host/ehci-hcd.c
@@ -290,16 +290,17 @@ static int bios_handoff (struct ehci_hcd *ehci, int where, u32 cap)
 {
 	if (cap & (1 << 16)) {
 		int msec = 500;
+		struct pci_dev *pdev = to_pci_dev(ehci->hcd.self.controller);
 
 		/* request handoff to OS */
-		cap &= 1 << 24;
-		pci_write_config_dword (to_pci_dev(ehci->hcd.self.controller), where, cap);
+		cap |= 1 << 24;
+		pci_write_config_dword(pdev, where, cap);
 
 		/* and wait a while for it to happen */
 		do {
 			msleep(10);
 			msec -= 10;
-			pci_read_config_dword (to_pci_dev(ehci->hcd.self.controller), where, &cap);
+			pci_read_config_dword(pdev, where, &cap);
 		} while ((cap & (1 << 16)) && msec);
 		if (cap & (1 << 16)) {
 			ehci_err (ehci, "BIOS handoff failed (%d, %04x)\n",
@@ -414,7 +415,7 @@ static int ehci_start (struct usb_hcd *hcd)
 	else					// N microframes cached
 		ehci->i_thresh = 2 + HCC_ISOC_THRES (hcc_params);
 
-	ehci->reclaim = 0;
+	ehci->reclaim = NULL;
 	ehci->next_uframe = -1;
 
 	/* controller state:  unknown --> reset */
@@ -424,7 +425,6 @@ static int ehci_start (struct usb_hcd *hcd)
 		ehci_mem_cleanup (ehci);
 		return retval;
 	}
-	writel (INTR_MASK, &ehci->regs->intr_enable);
 	writel (ehci->periodic_dma, &ehci->regs->frame_list);
 
 #ifdef	CONFIG_PCI
@@ -462,7 +462,7 @@ static int ehci_start (struct usb_hcd *hcd)
 	 * its dummy is used in hw_alt_next of many tds, to prevent the qh
 	 * from automatically advancing to the next td after short reads.
 	 */
-	ehci->async->qh_next.qh = 0;
+	ehci->async->qh_next.qh = NULL;
 	ehci->async->hw_next = QH_NEXT (ehci->async->qh_dma);
 	ehci->async->hw_info1 = cpu_to_le32 (QH_HEAD);
 	ehci->async->hw_token = cpu_to_le32 (QTD_STS_HALT);
@@ -520,7 +520,7 @@ static int ehci_start (struct usb_hcd *hcd)
 
 	/* wire up the root hub */
 	bus = hcd_to_bus (hcd);
-	bus->root_hub = udev = usb_alloc_dev (NULL, bus, 0);
+	udev = usb_alloc_dev (NULL, bus, 0);
 	if (!udev) {
 done2:
 		ehci_mem_cleanup (ehci);
@@ -530,7 +530,8 @@ done2:
 	/*
 	 * Start, enabling full USB 2.0 functionality ... usb 1.1 devices
 	 * are explicitly handed to companion controller(s), so no TT is
-	 * involved with the root hub.
+	 * involved with the root hub.  (Except where one is integrated,
+	 * and there's no companion controller unless maybe for USB OTG.)
 	 */
 	ehci->reboot_notifier.notifier_call = ehci_reboot;
 	register_reboot_notifier (&ehci->reboot_notifier);
@@ -553,16 +554,17 @@ done2:
 	 * and device drivers may start it running.
 	 */
 	udev->speed = USB_SPEED_HIGH;
-	if (hcd_register_root (hcd) != 0) {
+	if (hcd_register_root (udev, hcd) != 0) {
 		if (hcd->state == USB_STATE_RUNNING)
 			ehci_ready (ehci);
 		ehci_reset (ehci);
-		bus->root_hub = 0;
 		usb_put_dev (udev); 
 		retval = -ENODEV;
 		goto done2;
 	}
 
+	writel (INTR_MASK, &ehci->regs->intr_enable); /* Turn On Interrupts */
+
 	create_debug_files (ehci);
 
 	return 0;
@@ -573,6 +575,7 @@ done2:
 static void ehci_stop (struct usb_hcd *hcd)
 {
 	struct ehci_hcd		*ehci = hcd_to_ehci (hcd);
+	u8			rh_ports, port;
 
 	ehci_dbg (ehci, "stop\n");
 
@@ -584,7 +587,16 @@ static void ehci_stop (struct usb_hcd *hcd)
 		return;
 	}
 	del_timer_sync (&ehci->watchdog);
+
+	/* Turn off port power on all root hub ports. */
+	rh_ports = HCS_N_PORTS (ehci->hcs_params);
+	for (port = 1; port <= rh_ports; port++) {
+		ehci_hub_control(hcd, ClearPortFeature, USB_PORT_FEAT_POWER,
+			port, NULL, 0);
+	}
+
 	ehci_reset (ehci);
+	writel (0, &ehci->regs->intr_enable);
 
 	/* let companion controllers work when we aren't */
 	writel (0, &ehci->regs->configured_flag);
@@ -635,7 +647,7 @@ static int ehci_suspend (struct usb_hcd *hcd, u32 state)
 		msleep (100);
 
 #ifdef	CONFIG_USB_SUSPEND
-	(void) usb_suspend_device (hcd->self.root_hub);
+	(void) usb_suspend_device (hcd->self.root_hub, state);
 #else
 	/* FIXME lock root hub */
 	(void) ehci_hub_suspend (hcd);
@@ -704,12 +716,6 @@ static irqreturn_t ehci_irq (struct usb_hcd *hcd, struct pt_regs *regs)
 
 	status = readl (&ehci->regs->status);
 
-	/* shared irq */
-	if (status == 0) {
-		spin_unlock (&ehci->lock);
-		return IRQ_NONE;
-	}
-
 	/* e.g. cardbus physical eject */
 	if (status == ~(u32) 0) {
 		ehci_dbg (ehci, "device removed\n");
@@ -717,8 +723,10 @@ static irqreturn_t ehci_irq (struct usb_hcd *hcd, struct pt_regs *regs)
 	}
 
 	status &= INTR_MASK;
-	if (!status)			/* irq sharing? */
-		goto done;
+	if (!status) {			/* irq sharing? */
+		spin_unlock(&ehci->lock);
+		return IRQ_NONE;
+	}
 
 	/* clear (just) interrupts */
 	writel (status, &ehci->regs->status);
@@ -789,7 +797,6 @@ dead:
 
 	if (bh)
 		ehci_work (ehci, regs);
-done:
 	spin_unlock (&ehci->lock);
 	return IRQ_HANDLED;
 }
@@ -978,7 +985,7 @@ idle_timeout:
 			list_empty (&qh->qtd_list) ? "" : "(has tds)");
 		break;
 	}
-	dev->ep [epnum] = 0;
+	dev->ep[epnum] = NULL;
 done:
 	spin_unlock_irqrestore (&ehci->lock, flags);
 	return;
@@ -1029,6 +1036,8 @@ static const struct hc_driver ehci_driver = {
 	 */
 	.hub_status_data =	ehci_hub_status_data,
 	.hub_control =		ehci_hub_control,
+	.hub_suspend =		ehci_hub_suspend,
+	.hub_resume =		ehci_hub_resume,
 };
 
 /*-------------------------------------------------------------------------*/
diff --git a/drivers/usb/host/ehci-hub.c b/drivers/usb/host/ehci-hub.c
index f72102345..452c73ede 100644
--- a/drivers/usb/host/ehci-hub.c
+++ b/drivers/usb/host/ehci-hub.c
@@ -71,7 +71,7 @@ static int ehci_hub_suspend (struct usb_hcd *hcd)
 	writel (ehci->command & ~CMD_RUN, &ehci->regs->command);
 	if (ehci->reclaim)
 		ehci->reclaim_ready = 1;
-	ehci_work (ehci, 0);
+	ehci_work(ehci, NULL);
 	(void) handshake (&ehci->regs->status, STS_HALT, STS_HALT, 2000);
 
 	root->dev.power.power_state = 3;
diff --git a/drivers/usb/host/ehci-mem.c b/drivers/usb/host/ehci-mem.c
index 5f9381622..31f311d53 100644
--- a/drivers/usb/host/ehci-mem.c
+++ b/drivers/usb/host/ehci-mem.c
@@ -47,7 +47,7 @@ static struct usb_hcd *ehci_hcd_alloc (void)
 		ehci->hcd.product_desc = "EHCI Host Controller";
 		return &ehci->hcd;
 	}
-	return 0;
+	return NULL;
 }
 
 static void ehci_hcd_free (struct usb_hcd *hcd)
@@ -125,7 +125,7 @@ static struct ehci_qh *ehci_qh_alloc (struct ehci_hcd *ehci, int flags)
 	if (qh->dummy == 0) {
 		ehci_dbg (ehci, "no dummy td\n");
 		dma_pool_free (ehci->qh_pool, qh, qh->qh_dma);
-		qh = 0;
+		qh = NULL;
 	}
 	return qh;
 }
@@ -153,36 +153,36 @@ static void ehci_mem_cleanup (struct ehci_hcd *ehci)
 {
 	if (ehci->async)
 		qh_put (ehci->async);
-	ehci->async = 0;
+	ehci->async = NULL;
 
 	/* DMA consistent memory and pools */
 	if (ehci->qtd_pool)
 		dma_pool_destroy (ehci->qtd_pool);
-	ehci->qtd_pool = 0;
+	ehci->qtd_pool = NULL;
 
 	if (ehci->qh_pool) {
 		dma_pool_destroy (ehci->qh_pool);
-		ehci->qh_pool = 0;
+		ehci->qh_pool = NULL;
 	}
 
 	if (ehci->itd_pool)
 		dma_pool_destroy (ehci->itd_pool);
-	ehci->itd_pool = 0;
+	ehci->itd_pool = NULL;
 
 	if (ehci->sitd_pool)
 		dma_pool_destroy (ehci->sitd_pool);
-	ehci->sitd_pool = 0;
+	ehci->sitd_pool = NULL;
 
 	if (ehci->periodic)
 		dma_free_coherent (ehci->hcd.self.controller,
 			ehci->periodic_size * sizeof (u32),
 			ehci->periodic, ehci->periodic_dma);
-	ehci->periodic = 0;
+	ehci->periodic = NULL;
 
 	/* shadow periodic table */
 	if (ehci->pshadow)
 		kfree (ehci->pshadow);
-	ehci->pshadow = 0;
+	ehci->pshadow = NULL;
 }
 
 /* remember to add cleanup code (above) if you add anything here */
diff --git a/drivers/usb/host/ehci-q.c b/drivers/usb/host/ehci-q.c
index 7c39b86d1..be39e7aba 100644
--- a/drivers/usb/host/ehci-q.c
+++ b/drivers/usb/host/ehci-q.c
@@ -197,7 +197,7 @@ ehci_urb_done (struct ehci_hcd *ehci, struct urb *urb, struct pt_regs *regs)
 	}
 
 	spin_lock (&urb->lock);
-	urb->hcpriv = 0;
+	urb->hcpriv = NULL;
 	switch (urb->status) {
 	case -EINPROGRESS:		/* success */
 		urb->status = 0;
@@ -242,7 +242,7 @@ ehci_urb_done (struct ehci_hcd *ehci, struct urb *urb, struct pt_regs *regs)
 static unsigned
 qh_completions (struct ehci_hcd *ehci, struct ehci_qh *qh, struct pt_regs *regs)
 {
-	struct ehci_qtd		*last = 0, *end = qh->dummy;
+	struct ehci_qtd		*last = NULL, *end = qh->dummy;
 	struct list_head	*entry, *tmp;
 	int			stopped;
 	unsigned		count = 0;
@@ -282,7 +282,7 @@ qh_completions (struct ehci_hcd *ehci, struct ehci_qh *qh, struct pt_regs *regs)
 				count++;
 			}
 			ehci_qtd_free (ehci, last);
-			last = 0;
+			last = NULL;
 		}
 
 		/* ignore urbs submitted during completions we reported */
@@ -383,7 +383,7 @@ halt:
 					struct ehci_qtd, qtd_list);
 			/* first qtd may already be partially processed */
 			if (cpu_to_le32 (end->qtd_dma) == qh->hw_current)
-				end = 0;
+				end = NULL;
 		}
 		if (end)
 			qh_update (ehci, qh, end);
@@ -440,7 +440,7 @@ qh_urb_transaction (
 	 */
 	qtd = ehci_qtd_alloc (ehci, flags);
 	if (unlikely (!qtd))
-		return 0;
+		return NULL;
 	list_add_tail (&qtd->qtd_list, head);
 	qtd->urb = urb;
 
@@ -555,7 +555,7 @@ qh_urb_transaction (
 
 cleanup:
 	qtd_list_free (ehci, urb, head);
-	return 0;
+	return NULL;
 }
 
 /*-------------------------------------------------------------------------*/
@@ -709,7 +709,7 @@ qh_make (
  		dbg ("bogus dev %p speed %d", urb->dev, urb->dev->speed);
 done:
 		qh_put (qh);
-		return 0;
+		return NULL;
 	}
 
 	/* NOTE:  if (PIPE_INTERRUPT) { scheduler sets s-mask } */
@@ -780,19 +780,19 @@ static struct ehci_qh *qh_append_tds (
 	void			**ptr
 )
 {
-	struct ehci_qh		*qh = 0;
+	struct ehci_qh		*qh = NULL;
 
 	qh = (struct ehci_qh *) *ptr;
-	if (unlikely (qh == 0)) {
+	if (unlikely (qh == NULL)) {
 		/* can't sleep here, we have ehci->lock... */
 		qh = qh_make (ehci, urb, GFP_ATOMIC);
 		*ptr = qh;
 	}
-	if (likely (qh != 0)) {
+	if (likely (qh != NULL)) {
 		struct ehci_qtd	*qtd;
 
 		if (unlikely (list_empty (qtd_list)))
-			qtd = 0;
+			qtd = NULL;
 		else
 			qtd = list_entry (qtd_list->next, struct ehci_qtd,
 					qtd_list);
@@ -900,7 +900,7 @@ submit_async (
 	struct hcd_dev		*dev;
 	int			epnum;
 	unsigned long		flags;
-	struct ehci_qh		*qh = 0;
+	struct ehci_qh		*qh = NULL;
 
 	qtd = list_entry (qtd_list->next, struct ehci_qtd, qtd_list);
 	dev = (struct hcd_dev *)urb->dev->hcpriv;
@@ -950,14 +950,14 @@ static void end_unlink_async (struct ehci_hcd *ehci, struct pt_regs *regs)
 
 	// qh->hw_next = cpu_to_le32 (qh->qh_dma);
 	qh->qh_state = QH_STATE_IDLE;
-	qh->qh_next.qh = 0;
+	qh->qh_next.qh = NULL;
 	qh_put (qh);			// refcount from reclaim 
 
 	/* other unlink(s) may be pending (in QH_STATE_UNLINK_WAIT) */
 	next = qh->reclaim;
 	ehci->reclaim = next;
 	ehci->reclaim_ready = 0;
-	qh->reclaim = 0;
+	qh->reclaim = NULL;
 
 	qh_completions (ehci, qh, regs);
 
@@ -976,7 +976,7 @@ static void end_unlink_async (struct ehci_hcd *ehci, struct pt_regs *regs)
 	}
 
 	if (next) {
-		ehci->reclaim = 0;
+		ehci->reclaim = NULL;
 		start_unlink_async (ehci, next);
 	}
 }
diff --git a/drivers/usb/host/ehci-sched.c b/drivers/usb/host/ehci-sched.c
index 3682fb948..10df2665e 100644
--- a/drivers/usb/host/ehci-sched.c
+++ b/drivers/usb/host/ehci-sched.c
@@ -89,7 +89,7 @@ static int periodic_unlink (struct ehci_hcd *ehci, unsigned frame, void *ptr)
 
 	/* unlink from shadow list; HCD won't see old structure again */
 	*prev_p = *next_p;
-	next_p->ptr = 0;
+	next_p->ptr = NULL;
 
 	return 1;
 }
@@ -317,7 +317,7 @@ static void intr_deschedule (
 	} while (frame < ehci->periodic_size);
 
 	qh->qh_state = QH_STATE_UNLINK;
-	qh->qh_next.ptr = 0;
+	qh->qh_next.ptr = NULL;
 	ehci->periodic_sched--;
 
 	/* maybe turn off periodic schedule */
@@ -483,7 +483,7 @@ static int qh_schedule (struct ehci_hcd *ehci, struct ehci_qh *qh)
 		qh->start = frame;
 
 		/* reset S-frame and (maybe) C-frame masks */
-		qh->hw_info2 &= ~0xffff;
+		qh->hw_info2 &= ~__constant_cpu_to_le32(0xffff);
 		qh->hw_info2 |= cpu_to_le32 (1 << uframe) | c_mask;
 	} else
 		dbg ("reused previous qh %p schedule", qh);
@@ -718,7 +718,7 @@ iso_stream_put(struct ehci_hcd *ehci, struct ehci_iso_stream *stream)
 
 		is_in = (stream->bEndpointAddress & USB_DIR_IN) ? 0x10 : 0;
 		stream->bEndpointAddress &= 0x0f;
-		dev->ep [is_in + stream->bEndpointAddress] = 0;
+		dev->ep[is_in + stream->bEndpointAddress] = NULL;
 
 		if (stream->rescheduled) {
 			ehci_info (ehci, "ep%d%s-iso rescheduled "
@@ -772,7 +772,7 @@ iso_stream_find (struct ehci_hcd *ehci, struct urb *urb)
 		ehci_dbg (ehci, "dev %s ep%d%s, not iso??\n",
 			urb->dev->devpath, epnum & 0x0f,
 			(epnum & 0x10) ? "in" : "out");
-		stream = 0;
+		stream = NULL;
 	}
 
 	/* caller guarantees an eventual matching iso_stream_put */
@@ -896,7 +896,7 @@ itd_urb_transaction (
 			list_del (&itd->itd_list);
 			itd_dma = itd->itd_dma;
 		} else
-			itd = 0;
+			itd = NULL;
 
 		if (!itd) {
 			spin_unlock_irqrestore (&ehci->lock, flags);
@@ -1116,7 +1116,7 @@ iso_stream_schedule (
 
 fail:
 	iso_sched_free (stream, sched);
-	urb->hcpriv = 0;
+	urb->hcpriv = NULL;
 	return status;
 
 ready:
@@ -1215,8 +1215,8 @@ itd_link_urb (
 	hcd_to_bus (&ehci->hcd)->bandwidth_isoc_reqs++;
 
 	/* fill iTDs uframe by uframe */
-	for (packet = 0, itd = 0; packet < urb->number_of_packets; ) {
-		if (itd == 0) {
+	for (packet = 0, itd = NULL; packet < urb->number_of_packets; ) {
+		if (itd == NULL) {
 			/* ASSERT:  we have all necessary itds */
 			// BUG_ON (list_empty (&iso_sched->td_list));
 
@@ -1247,14 +1247,14 @@ itd_link_urb (
 		if (((next_uframe >> 3) != frame)
 				|| packet == urb->number_of_packets) {
 			itd_link (ehci, frame % ehci->periodic_size, itd);
-			itd = 0;
+			itd = NULL;
 		}
 	}
 	stream->next_uframe = next_uframe;
 
 	/* don't need that schedule data any more */
 	iso_sched_free (stream, iso_sched);
-	urb->hcpriv = 0;
+	urb->hcpriv = NULL;
 
 	timer_action (ehci, TIMER_IO_WATCHDOG);
 	if (unlikely (!ehci->periodic_sched++))
@@ -1311,8 +1311,8 @@ itd_complete (
 	}
 
 	usb_put_urb (urb);
-	itd->urb = 0;
-	itd->stream = 0;
+	itd->urb = NULL;
+	itd->stream = NULL;
 	list_move (&itd->itd_list, &stream->free_list);
 	iso_stream_put (ehci, stream);
 
@@ -1328,7 +1328,7 @@ itd_complete (
 	/* give urb back to the driver ... can be out-of-order */
 	dev = usb_get_dev (urb->dev);
 	ehci_urb_done (ehci, urb, regs);
-	urb = 0;
+	urb = NULL;
 
 	/* defer stopping schedule; completion can submit */
 	ehci->periodic_sched--;
@@ -1499,7 +1499,7 @@ sitd_urb_transaction (
 			list_del (&sitd->sitd_list);
 			sitd_dma = sitd->sitd_dma;
 		} else
-			sitd = 0;
+			sitd = NULL;
 
 		if (!sitd) {
 			spin_unlock_irqrestore (&ehci->lock, flags);
@@ -1600,7 +1600,7 @@ sitd_link_urb (
 	hcd_to_bus (&ehci->hcd)->bandwidth_isoc_reqs++;
 
 	/* fill sITDs frame by frame */
-	for (packet = 0, sitd = 0;
+	for (packet = 0, sitd = NULL;
 			packet < urb->number_of_packets;
 			packet++) {
 
@@ -1626,7 +1626,7 @@ sitd_link_urb (
 
 	/* don't need that schedule data any more */
 	iso_sched_free (stream, sched);
-	urb->hcpriv = 0;
+	urb->hcpriv = NULL;
 
 	timer_action (ehci, TIMER_IO_WATCHDOG);
 	if (!ehci->periodic_sched++)
@@ -1673,8 +1673,8 @@ sitd_complete (
 	}
 
 	usb_put_urb (urb);
-	sitd->urb = 0;
-	sitd->stream = 0;
+	sitd->urb = NULL;
+	sitd->stream = NULL;
 	list_move (&sitd->sitd_list, &stream->free_list);
 	stream->depth -= stream->interval << 3;
 	iso_stream_put (ehci, stream);
@@ -1691,7 +1691,7 @@ sitd_complete (
 	/* give urb back to the driver */
 	dev = usb_get_dev (urb->dev);
 	ehci_urb_done (ehci, urb, regs);
-	urb = 0;
+	urb = NULL;
 
 	/* defer stopping schedule; completion can submit */
 	ehci->periodic_sched--;
@@ -1903,7 +1903,7 @@ restart:
 				dbg ("corrupt type %d frame %d shadow %p",
 					type, frame, q.ptr);
 				// BUG ();
-				q.ptr = 0;
+				q.ptr = NULL;
 			}
 
 			/* assume completion callbacks modify the queue */
diff --git a/drivers/usb/host/hc_simple.c b/drivers/usb/host/hc_simple.c
index f970656f0..8a464917e 100644
--- a/drivers/usb/host/hc_simple.c
+++ b/drivers/usb/host/hc_simple.c
@@ -189,7 +189,7 @@ static int hci_submit_urb (struct urb * urb, int mem_flags)
  *
  * Return: 0 if success or error code 
  **************************************************************************/
-static int hci_unlink_urb (struct urb * urb)
+static int hci_unlink_urb (struct urb * urb, int status)
 {
 	unsigned long flags;
 	hci_t *hci;
@@ -219,45 +219,21 @@ static int hci_unlink_urb (struct urb * urb)
 	if (!list_empty (&urb->urb_list) && urb->status == -EINPROGRESS) {
 		/* URB active? */
 
-		if (urb->transfer_flags & URB_ASYNC_UNLINK) {
-			/* asynchronous with callback */
-			/* relink the urb to the del list */
-			list_move (&urb->urb_list, &hci->del_list);
-			spin_unlock_irqrestore (&usb_urb_lock, flags);
-		} else {
-			/* synchronous without callback */
-
-			add_wait_queue (&hci->waitq, &wait);
-
-			set_current_state (TASK_UNINTERRUPTIBLE);
-			comp = urb->complete;
-			urb->complete = NULL;
-
-			/* relink the urb to the del list */
-			list_move(&urb->urb_list, &hci->del_list);
-
-			spin_unlock_irqrestore (&usb_urb_lock, flags);
-
-			schedule_timeout (HZ / 50);
-
-			if (!list_empty (&urb->urb_list))
-				list_del (&urb->urb_list);
-
-			urb->complete = comp;
-			urb->hcpriv = NULL;
-			remove_wait_queue (&hci->waitq, &wait);
-		}
+		/* asynchronous with callback */
+		/* relink the urb to the del list */
+		list_move (&urb->urb_list, &hci->del_list);
+		urb->status = status;
+		spin_unlock_irqrestore (&usb_urb_lock, flags);
 	} else {
 		/* hcd does not own URB but we keep the driver happy anyway */
 		spin_unlock_irqrestore (&usb_urb_lock, flags);
 
-		if (urb->complete && (urb->transfer_flags & URB_ASYNC_UNLINK)) {
-			urb->status = -ENOENT;
+		if (urb->complete) {
+			urb->status = status;
 			urb->actual_length = 0;
 			urb->complete (urb, NULL);
-			urb->status = 0;
-		} else {
-			urb->status = -ENOENT;
+			if (urb->reject)
+				wake_up (&usb_kill_urb_queue);
 		}
 	}
 
diff --git a/drivers/usb/host/hc_sl811_rh.c b/drivers/usb/host/hc_sl811_rh.c
index a4dd4628e..aaaa705bc 100644
--- a/drivers/usb/host/hc_sl811_rh.c
+++ b/drivers/usb/host/hc_sl811_rh.c
@@ -557,18 +557,24 @@ static int rh_unlink_urb (struct urb * urb)
 static int rh_connect_rh (hci_t * hci)
 {
 	struct usb_device *usb_dev;
+	int retval;
 
 	hci->rh.devnum = 0;
 	usb_dev = usb_alloc_dev (NULL, hci->bus, 0);
 	if (!usb_dev)
 		return -ENOMEM;
 
-	hci->bus->root_hub = usb_dev;
 	usb_dev->devnum = 1;
 	usb_dev->bus->devnum_next = usb_dev->devnum + 1;
 	set_bit (usb_dev->devnum, usb_dev->bus->devmap.devicemap);
 
-	if (usb_new_device (usb_dev) != 0) {
+	down (&usb_bus_list_lock);
+	hci->bus->root_hub = usb_dev;
+	retval = usb_new_device (usb_dev);
+	if (retval != 0)
+		hci->bus->root_hub = NULL;
+	up (&usb_bus_list_lock);
+	if (retval != 0) {
 		usb_put_dev (usb_dev);
 		return -ENODEV;
 	}
diff --git a/drivers/usb/host/ohci-dbg.c b/drivers/usb/host/ohci-dbg.c
index 3918eb3f2..54daaacdc 100644
--- a/drivers/usb/host/ohci-dbg.c
+++ b/drivers/usb/host/ohci-dbg.c
@@ -134,13 +134,13 @@ ohci_dump_status (struct ohci_hcd *controller, char **next, unsigned *size)
 	struct ohci_regs	*regs = controller->regs;
 	u32			temp;
 
-	temp = readl (&regs->revision) & 0xff;
+	temp = ohci_readl (&regs->revision) & 0xff;
 	ohci_dbg_sw (controller, next, size,
 		"OHCI %d.%d, %s legacy support registers\n",
 		0x03 & (temp >> 4), (temp & 0x0f),
 		(temp & 0x10) ? "with" : "NO");
 
-	temp = readl (&regs->control);
+	temp = ohci_readl (&regs->control);
 	ohci_dbg_sw (controller, next, size,
 		"control 0x%03x%s%s%s HCFS=%s%s%s%s%s CBSR=%d\n",
 		temp,
@@ -155,7 +155,7 @@ ohci_dump_status (struct ohci_hcd *controller, char **next, unsigned *size)
 		temp & OHCI_CTRL_CBSR
 		);
 
-	temp = readl (&regs->cmdstatus);
+	temp = ohci_readl (&regs->cmdstatus);
 	ohci_dbg_sw (controller, next, size,
 		"cmdstatus 0x%05x SOC=%d%s%s%s%s\n", temp,
 		(temp & OHCI_SOC) >> 16,
@@ -166,26 +166,26 @@ ohci_dump_status (struct ohci_hcd *controller, char **next, unsigned *size)
 		);
 
 	ohci_dump_intr_mask (controller, "intrstatus",
-			readl (&regs->intrstatus), next, size);
+			ohci_readl (&regs->intrstatus), next, size);
 	ohci_dump_intr_mask (controller, "intrenable",
-			readl (&regs->intrenable), next, size);
+			ohci_readl (&regs->intrenable), next, size);
 	// intrdisable always same as intrenable
 
 	maybe_print_eds (controller, "ed_periodcurrent",
-			readl (&regs->ed_periodcurrent), next, size);
+			ohci_readl (&regs->ed_periodcurrent), next, size);
 
 	maybe_print_eds (controller, "ed_controlhead",
-			readl (&regs->ed_controlhead), next, size);
+			ohci_readl (&regs->ed_controlhead), next, size);
 	maybe_print_eds (controller, "ed_controlcurrent",
-			readl (&regs->ed_controlcurrent), next, size);
+			ohci_readl (&regs->ed_controlcurrent), next, size);
 
 	maybe_print_eds (controller, "ed_bulkhead",
-			readl (&regs->ed_bulkhead), next, size);
+			ohci_readl (&regs->ed_bulkhead), next, size);
 	maybe_print_eds (controller, "ed_bulkcurrent",
-			readl (&regs->ed_bulkcurrent), next, size);
+			ohci_readl (&regs->ed_bulkcurrent), next, size);
 
 	maybe_print_eds (controller, "donehead",
-			readl (&regs->donehead), next, size);
+			ohci_readl (&regs->donehead), next, size);
 }
 
 #define dbg_port_sw(hc,num,value,next,size) \
@@ -266,11 +266,11 @@ static void ohci_dump (struct ohci_hcd *controller, int verbose)
 	ohci_dbg (controller, "OHCI controller state\n");
 
 	// dumps some of the state we know about
-	ohci_dump_status (controller, NULL, 0);
+	ohci_dump_status (controller, NULL, NULL);
 	if (controller->hcca)
 		ohci_dbg (controller,
 			"hcca frame #%04x\n", OHCI_FRAME_NO(controller->hcca));
-	ohci_dump_roothub (controller, 1, NULL, 0);
+	ohci_dump_roothub (controller, 1, NULL, NULL);
 }
 
 static const char data0 [] = "DATA0";
@@ -574,7 +574,7 @@ show_periodic (struct class_device *class_dev, char *buf)
 			} else {
 				/* we've seen it and what's after */
 				temp = 0;
-				ed = 0;
+				ed = NULL;
 			}
 
 		} while (ed);
@@ -637,7 +637,7 @@ show_registers (struct class_device *class_dev, char *buf)
 			"hcca frame 0x%04x\n", OHCI_FRAME_NO(ohci->hcca));
 
 	/* other registers mostly affect frame timings */
-	rdata = readl (&regs->fminterval);
+	rdata = ohci_readl (&regs->fminterval);
 	temp = scnprintf (next, size,
 			"fmintvl 0x%08x %sFSMPS=0x%04x FI=0x%04x\n",
 			rdata, (rdata >> 31) ? " FIT" : "",
@@ -645,20 +645,20 @@ show_registers (struct class_device *class_dev, char *buf)
 	size -= temp;
 	next += temp;
 
-	rdata = readl (&regs->fmremaining);
+	rdata = ohci_readl (&regs->fmremaining);
 	temp = scnprintf (next, size, "fmremaining 0x%08x %sFR=0x%04x\n",
 			rdata, (rdata >> 31) ? " FRT" : "",
 			rdata & 0x3fff);
 	size -= temp;
 	next += temp;
 
-	rdata = readl (&regs->periodicstart);
+	rdata = ohci_readl (&regs->periodicstart);
 	temp = scnprintf (next, size, "periodicstart 0x%04x\n",
 			rdata & 0x3fff);
 	size -= temp;
 	next += temp;
 
-	rdata = readl (&regs->lsthresh);
+	rdata = ohci_readl (&regs->lsthresh);
 	temp = scnprintf (next, size, "lsthresh 0x%04x\n",
 			rdata & 0x3fff);
 	size -= temp;
diff --git a/drivers/usb/host/ohci-hcd.c b/drivers/usb/host/ohci-hcd.c
index b5279a019..d13e98e35 100644
--- a/drivers/usb/host/ohci-hcd.c
+++ b/drivers/usb/host/ohci-hcd.c
@@ -17,6 +17,7 @@
  *
  * History:
  * 
+ * 2004/03/24 LH7A404 support (Durgesh Pattamatta & Marc Singer)
  * 2004/02/04 use generic dma_* functions instead of pci_* (dsaxena@plexity.net)
  * 2003/02/24 show registers in sysfs (Kevin Brosius)
  *
@@ -228,7 +229,7 @@ static int ohci_urb_enqueue (
 	if (urb->status != -EINPROGRESS) {
 		spin_unlock (&urb->lock);
 		urb->hcpriv = urb_priv;
-		finish_urb (ohci, urb, 0);
+		finish_urb (ohci, urb, NULL);
 		retval = 0;
 		goto fail;
 	}
@@ -339,14 +340,18 @@ rescan:
 		goto done;
 
 	if (!HCD_IS_RUNNING (ohci->hcd.state)) {
+sanitize:
 		ed->state = ED_IDLE;
-		finish_unlinks (ohci, 0, 0);
+		finish_unlinks (ohci, 0, NULL);
 	}
 
 	switch (ed->state) {
 	case ED_UNLINK:		/* wait for hw to finish? */
 		/* major IRQ delivery trouble loses INTR_SF too... */
-		WARN_ON (limit-- == 0);
+		if (limit-- == 0) {
+			ohci_warn (ohci, "IRQ INTR_SF lossage\n");
+			goto sanitize;
+		}
 		spin_unlock_irqrestore (&ohci->lock, flags);
 		set_current_state (TASK_UNINTERRUPTIBLE);
 		schedule_timeout (1);
@@ -368,7 +373,7 @@ rescan:
 		td_free (ohci, ed->dummy);
 		break;
 	}
-	dev->ep [epnum] = 0;
+	dev->ep [epnum] = NULL;
 done:
 	spin_unlock_irqrestore (&ohci->lock, flags);
 	return;
@@ -393,7 +398,7 @@ static int hc_reset (struct ohci_hcd *ohci)
 
 	/* boot firmware should have set this up (5.1.1.3.1) */
 	if (!ohci->fminterval) {
-		temp = readl (&ohci->regs->fminterval);
+		temp = ohci_readl (&ohci->regs->fminterval);
 		if (temp & 0x3fff0000)
 			ohci->fminterval = temp;
 		else
@@ -405,7 +410,7 @@ static int hc_reset (struct ohci_hcd *ohci)
 	 * On PA-RISC, PDC can leave IR set incorrectly; ignore it there.
 	 */
 #ifndef __hppa__
-	if (readl (&ohci->regs->control) & OHCI_CTRL_IR) {
+	if (ohci_readl (&ohci->regs->control) & OHCI_CTRL_IR) {
 		ohci_dbg (ohci, "USB HC TakeOver from BIOS/SMM\n");
 
 		/* this timeout is arbitrary.  we make it long, so systems
@@ -416,7 +421,7 @@ static int hc_reset (struct ohci_hcd *ohci)
 
 		writel (OHCI_INTR_OC, &ohci->regs->intrenable);
 		writel (OHCI_OCR, &ohci->regs->cmdstatus);
-		while (readl (&ohci->regs->control) & OHCI_CTRL_IR) {
+		while (ohci_readl (&ohci->regs->control) & OHCI_CTRL_IR) {
 			msleep (10);
 			if (--temp == 0) {
 				ohci_err (ohci, "USB HC TakeOver failed!\n");
@@ -430,13 +435,13 @@ static int hc_reset (struct ohci_hcd *ohci)
 	writel (OHCI_INTR_MIE, &ohci->regs->intrdisable);
 
 	ohci_dbg (ohci, "reset, control = 0x%x\n",
-		readl (&ohci->regs->control));
+		  ohci_readl (&ohci->regs->control));
 
   	/* Reset USB (needed by some controllers); RemoteWakeupConnected
 	 * saved if boot firmware (BIOS/SMM/...) told us it's connected
 	 * (for OHCI integrated on mainboard, it normally is)
 	 */
-	ohci->hc_control = readl (&ohci->regs->control);
+	ohci->hc_control = ohci_readl (&ohci->regs->control);
 	ohci->hc_control &= OHCI_CTRL_RWC;	/* hcfs 0 = RESET */
 	if (ohci->hc_control)
 		ohci->hcd.can_wakeup = 1;
@@ -450,13 +455,13 @@ static int hc_reset (struct ohci_hcd *ohci)
 				&ohci->regs->roothub.portstatus [temp]);
 	}
 	// flush those pci writes
-	(void) readl (&ohci->regs->control);
+	(void) ohci_readl (&ohci->regs->control);
 	msleep (50);
 
 	/* HC Reset requires max 10 us delay */
 	writel (OHCI_HCR,  &ohci->regs->cmdstatus);
 	temp = 30;	/* ... allow extra time */
-	while ((readl (&ohci->regs->cmdstatus) & OHCI_HCR) != 0) {
+	while ((ohci_readl (&ohci->regs->cmdstatus) & OHCI_HCR) != 0) {
 		if (--temp == 0) {
 			ohci_err (ohci, "USB HC reset timed out!\n");
 			return -1;
@@ -473,7 +478,7 @@ static int hc_reset (struct ohci_hcd *ohci)
 	 */
 	writel (ohci->hc_control, &ohci->regs->control);
 	// flush those pci writes
-	(void) readl (&ohci->regs->control);
+	(void) ohci_readl (&ohci->regs->control);
 
 	return 0;
 }
@@ -505,8 +510,8 @@ static int hc_start (struct ohci_hcd *ohci)
 	/* some OHCI implementations are finicky about how they init.
 	 * bogus values here mean not even enumeration could work.
 	 */
-	if ((readl (&ohci->regs->fminterval) & 0x3fff0000) == 0
-			|| !readl (&ohci->regs->periodicstart)) {
+	if ((ohci_readl (&ohci->regs->fminterval) & 0x3fff0000) == 0
+			|| !ohci_readl (&ohci->regs->periodicstart)) {
 		ohci_err (ohci, "init err\n");
 		return -EOVERFLOW;
 	}
@@ -548,7 +553,7 @@ static int hc_start (struct ohci_hcd *ohci)
 	writel (RH_HS_LPSC, &ohci->regs->roothub.status);
 	writel (power_switching ? RH_B_PPCM : 0, &ohci->regs->roothub.b);
 	// flush those pci writes
-	(void) readl (&ohci->regs->control);
+	(void) ohci_readl (&ohci->regs->control);
 
 	// POTPGT delay is bits 24-31, in 2 ms units.
 	mdelay ((roothub_a (ohci) >> 23) & 0x1fe);
@@ -560,7 +565,7 @@ static int hc_start (struct ohci_hcd *ohci)
 	}
  
 	/* connect the virtual root hub */
-	bus->root_hub = udev = usb_alloc_dev (NULL, bus, 0);
+	udev = usb_alloc_dev (NULL, bus, 0);
 	ohci->hcd.state = USB_STATE_RUNNING;
 	if (!udev) {
 		disable (ohci);
@@ -570,9 +575,8 @@ static int hc_start (struct ohci_hcd *ohci)
 	}
 
 	udev->speed = USB_SPEED_FULL;
-	if (hcd_register_root (&ohci->hcd) != 0) {
+	if (hcd_register_root (udev, &ohci->hcd) != 0) {
 		usb_put_dev (udev);
-		bus->root_hub = NULL;
 		disable (ohci);
 		ohci->hc_control &= ~OHCI_CTRL_HCFS;
 		writel (ohci->hc_control, &ohci->regs->control);
@@ -592,19 +596,20 @@ static irqreturn_t ohci_irq (struct usb_hcd *hcd, struct pt_regs *ptregs)
 	struct ohci_regs	*regs = ohci->regs;
  	int			ints; 
 
-	/* we can eliminate a (slow) readl() if _only_ WDH caused this irq */
+	/* we can eliminate a (slow) ohci_readl()
+	   if _only_ WDH caused this irq */
 	if ((ohci->hcca->done_head != 0)
 			&& ! (le32_to_cpup (&ohci->hcca->done_head) & 0x01)) {
 		ints =  OHCI_INTR_WDH;
 
 	/* cardbus/... hardware gone before remove() */
-	} else if ((ints = readl (&regs->intrstatus)) == ~(u32)0) {
+	} else if ((ints = ohci_readl (&regs->intrstatus)) == ~(u32)0) {
 		disable (ohci);
 		ohci_dbg (ohci, "device removed!\n");
 		return IRQ_HANDLED;
 
 	/* interrupt for some other device? */
-	} else if ((ints &= readl (&regs->intrenable)) == 0) {
+	} else if ((ints &= ohci_readl (&regs->intrenable)) == 0) {
 		return IRQ_NONE;
 	} 
 
@@ -650,7 +655,7 @@ static irqreturn_t ohci_irq (struct usb_hcd *hcd, struct pt_regs *ptregs)
 		writel (ints, &regs->intrstatus);
 		writel (OHCI_INTR_MIE, &regs->intrenable);	
 		// flush those pci writes
-		(void) readl (&ohci->regs->control);
+		(void) ohci_readl (&ohci->regs->control);
 	}
 
 	return IRQ_HANDLED;
@@ -670,6 +675,8 @@ static void ohci_stop (struct usb_hcd *hcd)
 	flush_scheduled_work();
 	if (HCD_IS_RUNNING(ohci->hcd.state))
 		hc_reset (ohci);
+	else
+		writel (OHCI_INTR_MIE, &ohci->regs->intrdisable);
 	
 	remove_debug_files (ohci);
 	ohci_mem_cleanup (ohci);
@@ -727,7 +734,7 @@ static int hc_restart (struct ohci_hcd *ohci)
 			ed_deschedule (ohci, ed);
 
 			ed->ed_next = ohci->ed_rm_list;
-			ed->ed_prev = 0;
+			ed->ed_prev = NULL;
 			ohci->ed_rm_list = ed;
 			/* FALLTHROUGH */
 		case ED_UNLINK:
@@ -741,7 +748,7 @@ static int hc_restart (struct ohci_hcd *ohci)
 		urb->status = -ESHUTDOWN;
 		spin_unlock (&urb->lock);
 	}
-	finish_unlinks (ohci, 0, 0);
+	finish_unlinks (ohci, 0, NULL);
 	spin_unlock_irq(&ohci->lock);
 
 	/* paranoia, in case that didn't work: */
@@ -798,6 +805,14 @@ MODULE_LICENSE ("GPL");
 #include "ohci-omap.c"
 #endif
 
-#if !(defined(CONFIG_PCI) || defined(CONFIG_SA1111) || defined(CONFIG_ARCH_OMAP))
+#ifdef CONFIG_ARCH_LH7A404
+#include "ohci-lh7a404.c"
+#endif
+
+#if !(defined(CONFIG_PCI) \
+      || defined(CONFIG_SA1111) \
+      || defined(CONFIG_ARCH_OMAP) \
+      || defined (CONFIG_ARCH_LH7A404) \
+	)
 #error "missing bus glue for ohci-hcd"
 #endif
diff --git a/drivers/usb/host/ohci-hub.c b/drivers/usb/host/ohci-hub.c
index 516d87d9c..f6263bf9b 100644
--- a/drivers/usb/host/ohci-hub.c
+++ b/drivers/usb/host/ohci-hub.c
@@ -20,20 +20,20 @@
  * till some bits (mostly reserved) are clear; ok for all revs.
  */
 #define read_roothub(hc, register, mask) ({ \
-	u32 temp = readl (&hc->regs->roothub.register); \
+	u32 temp = ohci_readl (&hc->regs->roothub.register); \
 	if (temp == -1) \
 		disable (hc); \
 	else if (hc->flags & OHCI_QUIRK_AMD756) \
 		while (temp & mask) \
-			temp = readl (&hc->regs->roothub.register); \
+			temp = ohci_readl (&hc->regs->roothub.register); \
 	temp; })
 
 static u32 roothub_a (struct ohci_hcd *hc)
 	{ return read_roothub (hc, a, 0xfc0fe000); }
 static inline u32 roothub_b (struct ohci_hcd *hc)
-	{ return readl (&hc->regs->roothub.b); }
+	{ return ohci_readl (&hc->regs->roothub.b); }
 static inline u32 roothub_status (struct ohci_hcd *hc)
-	{ return readl (&hc->regs->roothub.status); }
+	{ return ohci_readl (&hc->regs->roothub.status); }
 static u32 roothub_portstatus (struct ohci_hcd *hc, int i)
 	{ return read_roothub (hc, portstatus [i], 0xffe0fce0); }
 
@@ -83,14 +83,14 @@ static int ohci_hub_suspend (struct usb_hcd *hcd)
 
 	spin_lock_irq (&ohci->lock);
 
-	ohci->hc_control = readl (&ohci->regs->control);
+	ohci->hc_control = ohci_readl (&ohci->regs->control);
 	switch (ohci->hc_control & OHCI_CTRL_HCFS) {
 	case OHCI_USB_RESUME:
 		ohci_dbg (ohci, "resume/suspend?\n");
 		ohci->hc_control &= ~OHCI_CTRL_HCFS;
 		ohci->hc_control |= OHCI_USB_RESET;
 		writel (ohci->hc_control, &ohci->regs->control);
-		(void) readl (&ohci->regs->control);
+		(void) ohci_readl (&ohci->regs->control);
 		/* FALL THROUGH */
 	case OHCI_USB_RESET:
 		status = -EBUSY;
@@ -109,7 +109,7 @@ static int ohci_hub_suspend (struct usb_hcd *hcd)
 
 		ohci->hc_control &= ~OHCI_SCHED_ENABLES;
 		writel (ohci->hc_control, &ohci->regs->control);
-		ohci->hc_control = readl (&ohci->regs->control);
+		ohci->hc_control = ohci_readl (&ohci->regs->control);
 		writel (OHCI_INTR_SF, &ohci->regs->intrstatus);
 
 		/* sched disables take effect on the next frame,
@@ -120,15 +120,15 @@ static int ohci_hub_suspend (struct usb_hcd *hcd)
 		while (limit > 0) {
 			udelay (250);
 			limit =- 250;
-			if (readl (&ohci->regs->intrstatus) & OHCI_INTR_SF)
+			if (ohci_readl (&ohci->regs->intrstatus) & OHCI_INTR_SF)
 				break;
 		}
-		dl_done_list (ohci, 0);
+		dl_done_list (ohci, NULL);
 		mdelay (7);
 	}
-	dl_done_list (ohci, 0);
-	finish_unlinks (ohci, OHCI_FRAME_NO(ohci->hcca), 0);
-	writel (readl (&ohci->regs->intrstatus), &ohci->regs->intrstatus);
+	dl_done_list (ohci, NULL);
+	finish_unlinks (ohci, OHCI_FRAME_NO(ohci->hcca), NULL);
+	writel (ohci_readl (&ohci->regs->intrstatus), &ohci->regs->intrstatus);
 
 	/* maybe resume can wake root hub */
 	if (ohci->hcd.remote_wakeup)
@@ -140,7 +140,7 @@ static int ohci_hub_suspend (struct usb_hcd *hcd)
 	ohci->hc_control &= ~OHCI_CTRL_HCFS;
 	ohci->hc_control |= OHCI_USB_SUSPEND;
 	writel (ohci->hc_control, &ohci->regs->control);
-	(void) readl (&ohci->regs->control);
+	(void) ohci_readl (&ohci->regs->control);
 
 	/* no resumes until devices finish suspending */
 	ohci->next_statechange = jiffies + msecs_to_jiffies (5);
@@ -179,18 +179,18 @@ static int ohci_hub_resume (struct usb_hcd *hcd)
 		return -EAGAIN;
 
 	spin_lock_irq (&ohci->lock);
-	ohci->hc_control = readl (&ohci->regs->control);
+	ohci->hc_control = ohci_readl (&ohci->regs->control);
 	switch (ohci->hc_control & OHCI_CTRL_HCFS) {
 	case OHCI_USB_SUSPEND:
 		ohci->hc_control &= ~(OHCI_CTRL_HCFS|OHCI_SCHED_ENABLES);
 		ohci->hc_control |= OHCI_USB_RESUME;
 		writel (ohci->hc_control, &ohci->regs->control);
-		(void) readl (&ohci->regs->control);
+		(void) ohci_readl (&ohci->regs->control);
 		ohci_dbg (ohci, "resume root hub\n");
 		break;
 	case OHCI_USB_RESUME:
 		/* HCFS changes sometime after INTR_RD */
-		ohci_info (ohci, "remote wakeup\n");
+		ohci_info (ohci, "wakeup\n");
 		break;
 	case OHCI_USB_OPER:
 		ohci_dbg (ohci, "odd resume\n");
@@ -210,7 +210,7 @@ static int ohci_hub_resume (struct usb_hcd *hcd)
 	temp = roothub_a (ohci) & RH_A_NDP;
 	enables = 0;
 	while (temp--) {
-		u32 stat = readl (&ohci->regs->roothub.portstatus [temp]);
+		u32 stat = ohci_readl (&ohci->regs->roothub.portstatus [temp]);
 
 		/* force global, not selective, resume */
 		if (!(stat & RH_PS_PSS))
@@ -222,7 +222,7 @@ static int ohci_hub_resume (struct usb_hcd *hcd)
 	ohci->hcd.state = USB_STATE_RESUMING;
 	mdelay (20 /* usb 11.5.1.10 */ + 15);
 
-	temp = readl (&ohci->regs->control);
+	temp = ohci_readl (&ohci->regs->control);
 	temp &= OHCI_CTRL_HCFS;
 	if (temp != OHCI_USB_RESUME) {
 		ohci_err (ohci, "controller won't resume\n");
@@ -243,11 +243,11 @@ static int ohci_hub_resume (struct usb_hcd *hcd)
 	writel (OHCI_INTR_INIT, &ohci->regs->intrenable);
 	if (ohci->ed_rm_list)
 		writel (OHCI_INTR_SF, &ohci->regs->intrenable);
-	writel (readl (&ohci->regs->intrstatus), &ohci->regs->intrstatus);
+	writel (ohci_readl (&ohci->regs->intrstatus), &ohci->regs->intrstatus);
 
 	/* Then re-enable operations */
 	writel (OHCI_USB_OPER, &ohci->regs->control);
-	(void) readl (&ohci->regs->control);
+	(void) ohci_readl (&ohci->regs->control);
 	msleep (3);
 
 	temp = OHCI_CONTROL_INIT | OHCI_USB_OPER;
@@ -255,7 +255,7 @@ static int ohci_hub_resume (struct usb_hcd *hcd)
 		temp |= OHCI_CTRL_RWC;
 	ohci->hc_control = temp;
 	writel (temp, &ohci->regs->control);
-	(void) readl (&ohci->regs->control);
+	(void) ohci_readl (&ohci->regs->control);
 
 	/* TRSMRCY */
 	msleep (10);
@@ -290,7 +290,7 @@ static int ohci_hub_resume (struct usb_hcd *hcd)
 		writel (ohci->hc_control, &ohci->regs->control);
 		if (temp)
 			writel (status, &ohci->regs->cmdstatus);
-		(void) readl (&ohci->regs->control);
+		(void) ohci_readl (&ohci->regs->control);
 	}
 
 	ohci->hcd.state = USB_STATE_RUNNING;
@@ -332,7 +332,7 @@ ohci_hub_status_data (struct usb_hcd *hcd, char *buf)
 		if (!HCD_IS_RUNNING(ohci->hcd.state))
 			return -ESHUTDOWN;
 		ohci_err (ohci, "bogus NDP=%d, rereads as NDP=%d\n",
-			ports, readl (&ohci->regs->roothub.a) & RH_A_NDP);
+			ports, ohci_readl (&ohci->regs->roothub.a) & RH_A_NDP);
 		/* retry later; "should not happen" */
 		return 0;
 	}
@@ -496,7 +496,7 @@ static int ohci_hub_control (
 			goto error;
 		}
 		writel (temp, &ohci->regs->roothub.portstatus [wIndex]);
-		// readl (&ohci->regs->roothub.portstatus [wIndex]);
+		// ohci_readl (&ohci->regs->roothub.portstatus [wIndex]);
 		break;
 	case GetHubDescriptor:
 		ohci_hub_descriptor (ohci, (struct usb_hub_descriptor *) buf);
@@ -515,7 +515,7 @@ static int ohci_hub_control (
 #ifndef	OHCI_VERBOSE_DEBUG
 	if (*(u16*)(buf+2))	/* only if wPortChange is interesting */
 #endif
-		dbg_port (ohci, "GetStatus", wIndex + 1, temp);
+		dbg_port (ohci, "GetStatus", wIndex, temp);
 		break;
 	case SetHubFeature:
 		switch (wValue) {
@@ -541,7 +541,7 @@ static int ohci_hub_control (
 				&ohci->regs->roothub.portstatus [wIndex]);
 			break;
 		case USB_PORT_FEAT_RESET:
-			temp = readl (&ohci->regs->roothub.portstatus [wIndex]);
+			temp = ohci_readl (&ohci->regs->roothub.portstatus [wIndex]);
 			if (temp & RH_PS_CCS)
 				writel (RH_PS_PRS,
 				    &ohci->regs->roothub.portstatus [wIndex]);
diff --git a/drivers/usb/host/ohci-mem.c b/drivers/usb/host/ohci-mem.c
index bfc59d258..13419364f 100644
--- a/drivers/usb/host/ohci-mem.c
+++ b/drivers/usb/host/ohci-mem.c
@@ -31,12 +31,13 @@ static struct usb_hcd *ohci_hcd_alloc (void)
 	if (ohci != 0) {
 		memset (ohci, 0, sizeof (struct ohci_hcd));
 		ohci->hcd.product_desc = "OHCI Host Controller";
+		ohci->next_statechange = jiffies;
 		spin_lock_init (&ohci->lock);
 		INIT_LIST_HEAD (&ohci->pending);
 		INIT_WORK (&ohci->rh_resume, ohci_rh_resume, &ohci->hcd);
 		return &ohci->hcd;
 	}
-	return 0;
+	return NULL;
 }
 
 static void ohci_hcd_free (struct usb_hcd *hcd)
@@ -69,11 +70,11 @@ static void ohci_mem_cleanup (struct ohci_hcd *ohci)
 {
 	if (ohci->td_cache) {
 		dma_pool_destroy (ohci->td_cache);
-		ohci->td_cache = 0;
+		ohci->td_cache = NULL;
 	}
 	if (ohci->ed_cache) {
 		dma_pool_destroy (ohci->ed_cache);
-		ohci->ed_cache = 0;
+		ohci->ed_cache = NULL;
 	}
 }
 
diff --git a/drivers/usb/host/ohci-omap.c b/drivers/usb/host/ohci-omap.c
index eba974d5c..1e5fc5d93 100644
--- a/drivers/usb/host/ohci-omap.c
+++ b/drivers/usb/host/ohci-omap.c
@@ -17,7 +17,6 @@
  */
  
 #include <asm/hardware.h>
-#include <asm/mach-types.h>
 #include <asm/io.h>
 
 #include <asm/arch/bus.h>
@@ -454,7 +453,6 @@ int usb_hcd_omap_probe (const struct hc_driver *driver,
  */
 void usb_hcd_omap_remove (struct usb_hcd *hcd, struct omap_dev *dev)
 {
-	struct usb_device	*hub;
 	void *base;
 
 	info ("remove: %s, state %x", hcd->self.bus_name, hcd->state);
@@ -462,11 +460,10 @@ void usb_hcd_omap_remove (struct usb_hcd *hcd, struct omap_dev *dev)
 	if (in_interrupt ())
 		BUG ();
 
-	hub = hcd->self.root_hub;
 	hcd->state = USB_STATE_QUIESCING;
 
 	dbg ("%s: roothub graceful disconnect", hcd->self.bus_name);
-	usb_disconnect (&hub);
+	usb_disconnect (&hcd->self.root_hub);
 
 	hcd->driver->stop (hcd);
 	hcd_buffer_destroy (hcd);
@@ -565,6 +562,10 @@ static const struct hc_driver ohci_omap_hc_driver = {
 	 */
 	.hub_status_data =	ohci_hub_status_data,
 	.hub_control =		ohci_hub_control,
+#ifdef	CONFIG_USB_SUSPEND
+	.hub_suspend =		ohci_hub_suspend,
+	.hub_resume =		ohci_hub_resume,
+#endif
 };
 
 /*-------------------------------------------------------------------------*/
diff --git a/drivers/usb/host/ohci-pci.c b/drivers/usb/host/ohci-pci.c
index 0e7f9f804..dc8bc13bf 100644
--- a/drivers/usb/host/ohci-pci.c
+++ b/drivers/usb/host/ohci-pci.c
@@ -125,7 +125,7 @@ static int ohci_pci_suspend (struct usb_hcd *hcd, u32 state)
 		msleep (100);
 
 #ifdef	CONFIG_USB_SUSPEND
-	(void) usb_suspend_device (hcd->self.root_hub);
+	(void) usb_suspend_device (hcd->self.root_hub, state);
 #else
 	down (&hcd->self.root_hub->serialize);
 	(void) ohci_hub_suspend (hcd);
@@ -238,6 +238,10 @@ static const struct hc_driver ohci_pci_hc_driver = {
 	 */
 	.hub_status_data =	ohci_hub_status_data,
 	.hub_control =		ohci_hub_control,
+#ifdef	CONFIG_USB_SUSPEND
+	.hub_suspend =		ohci_hub_suspend,
+	.hub_resume =		ohci_hub_resume,
+#endif
 };
 
 /*-------------------------------------------------------------------------*/
diff --git a/drivers/usb/host/ohci-q.c b/drivers/usb/host/ohci-q.c
index f103b15b5..74c829f92 100644
--- a/drivers/usb/host/ohci-q.c
+++ b/drivers/usb/host/ohci-q.c
@@ -174,8 +174,8 @@ static int ed_schedule (struct ohci_hcd *ohci, struct ed *ed)
 		return -EAGAIN;
 
 	ed->state = ED_OPER;
-	ed->ed_prev = 0;
-	ed->ed_next = 0;
+	ed->ed_prev = NULL;
+	ed->ed_next = NULL;
 	ed->hwNextED = 0;
 	wmb ();
 
@@ -321,7 +321,7 @@ static void ed_deschedule (struct ohci_hcd *ohci, struct ed *ed)
 			if (!ed->hwNextED) {
 				ohci->hc_control &= ~OHCI_CTRL_CLE;
 				writel (ohci->hc_control, &ohci->regs->control);
-				// a readl() later syncs CLE with the HC
+				// a ohci_readl() later syncs CLE with the HC
 			} else
 				writel (le32_to_cpup (&ed->hwNextED),
 					&ohci->regs->ed_controlhead);
@@ -333,7 +333,7 @@ static void ed_deschedule (struct ohci_hcd *ohci, struct ed *ed)
 		if (ohci->ed_controltail == ed) {
 			ohci->ed_controltail = ed->ed_prev;
 			if (ohci->ed_controltail)
-				ohci->ed_controltail->ed_next = 0;
+				ohci->ed_controltail->ed_next = NULL;
 		} else if (ed->ed_next) {
 			ed->ed_next->ed_prev = ed->ed_prev;
 		}
@@ -345,7 +345,7 @@ static void ed_deschedule (struct ohci_hcd *ohci, struct ed *ed)
 			if (!ed->hwNextED) {
 				ohci->hc_control &= ~OHCI_CTRL_BLE;
 				writel (ohci->hc_control, &ohci->regs->control);
-				// a readl() later syncs BLE with the HC
+				// a ohci_readl() later syncs BLE with the HC
 			} else
 				writel (le32_to_cpup (&ed->hwNextED),
 					&ohci->regs->ed_bulkhead);
@@ -357,7 +357,7 @@ static void ed_deschedule (struct ohci_hcd *ohci, struct ed *ed)
 		if (ohci->ed_bulktail == ed) {
 			ohci->ed_bulktail = ed->ed_prev;
 			if (ohci->ed_bulktail)
-				ohci->ed_bulktail->ed_next = 0;
+				ohci->ed_bulktail->ed_next = NULL;
 		} else if (ed->ed_next) {
 			ed->ed_next->ed_prev = ed->ed_prev;
 		}
@@ -412,7 +412,7 @@ static struct ed *ed_get (
  		if (!td) {
 			/* out of memory */
 			ed_free (ohci, ed);
-			ed = 0;
+			ed = NULL;
 			goto done;
 		}
 		ed->dummy = td;
@@ -474,14 +474,14 @@ static void start_ed_unlink (struct ohci_hcd *ohci, struct ed *ed)
 
 	/* rm_list is just singly linked, for simplicity */
 	ed->ed_next = ohci->ed_rm_list;
-	ed->ed_prev = 0;
+	ed->ed_prev = NULL;
 	ohci->ed_rm_list = ed;
 
 	/* enable SOF interrupt */
 	writel (OHCI_INTR_SF, &ohci->regs->intrstatus);
 	writel (OHCI_INTR_SF, &ohci->regs->intrenable);
 	// flush those writes, and get latest HCCA contents
-	(void) readl (&ohci->regs->control);
+	(void) ohci_readl (&ohci->regs->control);
 
 	/* SF interrupt might get delayed; record the frame counter value that
 	 * indicates when the HC isn't looking at it, so concurrent unlinks
@@ -924,7 +924,7 @@ rescan_all:
 		/* only take off EDs that the HC isn't using, accounting for
 		 * frame counter wraps and EDs with partially retired TDs
 		 */
-		if (likely (HCD_IS_RUNNING(ohci->hcd.state))) {
+		if (likely (regs && HCD_IS_RUNNING(ohci->hcd.state))) {
 			if (tick_before (tick, ed->tick)) {
 skip_ed:
 				last = &ed->ed_next;
@@ -950,7 +950,7 @@ skip_ed:
 		 * entries (which we'd ignore), but paranoia won't hurt.
 		 */
 		*last = ed->ed_next;
-		ed->ed_next = 0;
+		ed->ed_next = NULL;
 		modified = 0;
 
 		/* unlink urbs as requested, but rescan the list after
diff --git a/drivers/usb/host/ohci-sa1111.c b/drivers/usb/host/ohci-sa1111.c
index 5b599cb64..c3cd76aba 100644
--- a/drivers/usb/host/ohci-sa1111.c
+++ b/drivers/usb/host/ohci-sa1111.c
@@ -237,7 +237,6 @@ int usb_hcd_sa1111_probe (const struct hc_driver *driver,
  */
 void usb_hcd_sa1111_remove (struct usb_hcd *hcd, struct sa1111_dev *dev)
 {
-	struct usb_device	*hub;
 	void *base;
 
 	info ("remove: %s, state %x", hcd->self.bus_name, hcd->state);
@@ -245,11 +244,10 @@ void usb_hcd_sa1111_remove (struct usb_hcd *hcd, struct sa1111_dev *dev)
 	if (in_interrupt ())
 		BUG ();
 
-	hub = hcd->self.root_hub;
 	hcd->state = USB_STATE_QUIESCING;
 
 	dbg ("%s: roothub graceful disconnect", hcd->self.bus_name);
-	usb_disconnect (&hub);
+	usb_disconnect (&hcd->self.root_hub);
 
 	hcd->driver->stop (hcd);
 	hcd->state = USB_STATE_HALT;
@@ -348,6 +346,10 @@ static const struct hc_driver ohci_sa1111_hc_driver = {
 	 */
 	.hub_status_data =	ohci_hub_status_data,
 	.hub_control =		ohci_hub_control,
+#ifdef	CONFIG_USB_SUSPEND
+	.hub_suspend =		ohci_hub_suspend,
+	.hub_resume =		ohci_hub_resume,
+#endif
 };
 
 /*-------------------------------------------------------------------------*/
diff --git a/drivers/usb/host/ohci.h b/drivers/usb/host/ohci.h
index 70f32ef72..5f0384417 100644
--- a/drivers/usb/host/ohci.h
+++ b/drivers/usb/host/ohci.h
@@ -429,3 +429,22 @@ static inline void periodic_reinit (struct ohci_hcd *ohci)
 #	define ohci_vdbg(ohci, fmt, args...) do { } while (0)
 #endif
 
+#ifdef CONFIG_ARCH_LH7A404
+	/* Marc Singer: at the time this code was written, the LH7A404
+	 * had a problem reading the USB host registers.  This
+	 * implementation of the ohci_readl function performs the read
+	 * twice as a work-around.
+	 */
+static inline unsigned int ohci_readl (void* regs)
+{
+	*(volatile unsigned int*) regs;
+	return *(volatile unsigned int*) regs;
+}
+#else
+	/* Standard version of ohci_readl uses standard, platform
+	 * specific implementation. */
+static inline unsigned int ohci_readl (void* regs)
+{
+	return readl (regs);
+}
+#endif
diff --git a/drivers/usb/host/uhci-debug.c b/drivers/usb/host/uhci-debug.c
index 86e4c3a11..a0721d060 100644
--- a/drivers/usb/host/uhci-debug.c
+++ b/drivers/usb/host/uhci-debug.c
@@ -248,7 +248,7 @@ static int uhci_show_sc(int port, unsigned short status, char *buf, int len)
 static int uhci_show_status(struct uhci_hcd *uhci, char *buf, int len)
 {
 	char *out = buf;
-	unsigned int io_addr = uhci->io_addr;
+	unsigned long io_addr = uhci->io_addr;
 	unsigned short usbcmd, usbstat, usbint, usbfrnum;
 	unsigned int flbaseadd;
 	unsigned char sof;
@@ -571,22 +571,7 @@ static ssize_t uhci_proc_read(struct file *file, char __user *buf,
 				size_t nbytes, loff_t *ppos)
 {
 	struct uhci_proc *up = file->private_data;
-	unsigned int pos;
-	unsigned int size;
-
-	pos = *ppos;
-	size = up->size;
-	if (pos >= size)
-		return 0;
-	if (nbytes > size - pos)
-		nbytes = size - pos;
-
-	if (copy_to_user(buf, up->data + pos, nbytes))
-		return -EFAULT;
-
-	*ppos += nbytes;
-
-	return nbytes;
+	return simple_read_from_buffer(buf, nbytes, ppos, up->data, up->size);
 }
 
 static int uhci_proc_release(struct inode *inode, struct file *file)
diff --git a/drivers/usb/host/uhci-hcd.c b/drivers/usb/host/uhci-hcd.c
index afe032003..bf8ab3cd7 100644
--- a/drivers/usb/host/uhci-hcd.c
+++ b/drivers/usb/host/uhci-hcd.c
@@ -103,8 +103,8 @@ static void uhci_free_pending_tds(struct uhci_hcd *uhci);
 static void hc_state_transitions(struct uhci_hcd *uhci);
 
 /* If a transfer is still active after this much time, turn off FSBR */
-#define IDLE_TIMEOUT	(HZ / 20)	/* 50 ms */
-#define FSBR_DELAY	(HZ / 20)	/* 50 ms */
+#define IDLE_TIMEOUT	msecs_to_jiffies(50)
+#define FSBR_DELAY	msecs_to_jiffies(50)
 
 /* When we timeout an idle transfer for FSBR, we'll switch it over to */
 /* depth first traversal. We'll do it in groups of this number of TD's */
@@ -862,7 +862,7 @@ static int usb_control_retrigger_status(struct uhci_hcd *uhci, struct urb *urb)
 	urbp->short_control_packet = 1;
 
 	td = list_entry(urbp->td_list.prev, struct uhci_td, list);
-	urbp->qh->element = td->dma_handle;
+	urbp->qh->element = cpu_to_le32(td->dma_handle);
 
 	return -EINPROGRESS;
 }
@@ -1611,6 +1611,7 @@ static void stall_callback(unsigned long ptr)
 	struct uhci_hcd *uhci = hcd_to_uhci(hcd);
 	struct list_head list, *tmp, *head;
 	unsigned long flags;
+	int called_uhci_finish_completion = 0;
 
 	INIT_LIST_HEAD(&list);
 
@@ -1619,6 +1620,7 @@ static void stall_callback(unsigned long ptr)
 	    uhci_get_current_frame_number(uhci) != uhci->urb_remove_age) {
 		uhci_remove_pending_urbps(uhci);
 		uhci_finish_completion(hcd, NULL);
+		called_uhci_finish_completion = 1;
 	}
 
 	head = &uhci->urb_list;
@@ -1646,6 +1648,10 @@ static void stall_callback(unsigned long ptr)
 	}
 	spin_unlock_irqrestore(&uhci->schedule_lock, flags);
 
+	/* Wake up anyone waiting for an URB to complete */
+	if (called_uhci_finish_completion)
+		wake_up_all(&uhci->waitqh);
+
 	head = &list;
 	tmp = head->next;
 	while (tmp != head) {
@@ -1676,7 +1682,7 @@ static int init_stall_timer(struct usb_hcd *hcd)
 	init_timer(&uhci->stall_timer);
 	uhci->stall_timer.function = stall_callback;
 	uhci->stall_timer.data = (unsigned long)hcd;
-	uhci->stall_timer.expires = jiffies + (HZ / 10);
+	uhci->stall_timer.expires = jiffies + msecs_to_jiffies(100);
 	add_timer(&uhci->stall_timer);
 
 	return 0;
@@ -1756,7 +1762,7 @@ static void uhci_remove_pending_urbps(struct uhci_hcd *uhci)
 static irqreturn_t uhci_irq(struct usb_hcd *hcd, struct pt_regs *regs)
 {
 	struct uhci_hcd *uhci = hcd_to_uhci(hcd);
-	unsigned int io_addr = uhci->io_addr;
+	unsigned long io_addr = uhci->io_addr;
 	unsigned short status;
 	struct list_head *tmp, *head;
 	unsigned int age;
@@ -1829,24 +1835,28 @@ static irqreturn_t uhci_irq(struct usb_hcd *hcd, struct pt_regs *regs)
 
 static void reset_hc(struct uhci_hcd *uhci)
 {
-	unsigned int io_addr = uhci->io_addr;
+	unsigned long io_addr = uhci->io_addr;
+
+	/* Turn off PIRQ, SMI, and all interrupts.  This also turns off
+	 * the BIOS's USB Legacy Support.
+	 */
+	pci_write_config_word(to_pci_dev(uhci_dev(uhci)), USBLEGSUP, 0);
+	outw(0, uhci->io_addr + USBINTR);
 
 	/* Global reset for 50ms */
 	uhci->state = UHCI_RESET;
 	outw(USBCMD_GRESET, io_addr + USBCMD);
-	set_current_state(TASK_UNINTERRUPTIBLE);
-	schedule_timeout((HZ*50+999) / 1000);
+	msleep(50);
 	outw(0, io_addr + USBCMD);
 
 	/* Another 10ms delay */
-	set_current_state(TASK_UNINTERRUPTIBLE);
-	schedule_timeout((HZ*10+999) / 1000);
+	msleep(10);
 	uhci->resume_detect = 0;
 }
 
 static void suspend_hc(struct uhci_hcd *uhci)
 {
-	unsigned int io_addr = uhci->io_addr;
+	unsigned long io_addr = uhci->io_addr;
 
 	dev_dbg(uhci_dev(uhci), "%s\n", __FUNCTION__);
 	uhci->state = UHCI_SUSPENDED;
@@ -1856,7 +1866,7 @@ static void suspend_hc(struct uhci_hcd *uhci)
 
 static void wakeup_hc(struct uhci_hcd *uhci)
 {
-	unsigned int io_addr = uhci->io_addr;
+	unsigned long io_addr = uhci->io_addr;
 
 	switch (uhci->state) {
 		case UHCI_SUSPENDED:		/* Start the resume */
@@ -1865,7 +1875,7 @@ static void wakeup_hc(struct uhci_hcd *uhci)
 			/* Global resume for >= 20ms */
 			outw(USBCMD_FGR | USBCMD_EGSM, io_addr + USBCMD);
 			uhci->state = UHCI_RESUMING_1;
-			uhci->state_end = jiffies + (20*HZ+999) / 1000;
+			uhci->state_end = jiffies + msecs_to_jiffies(20);
 			break;
 
 		case UHCI_RESUMING_1:		/* End global resume */
@@ -1896,7 +1906,7 @@ static void wakeup_hc(struct uhci_hcd *uhci)
 
 static int ports_active(struct uhci_hcd *uhci)
 {
-	unsigned int io_addr = uhci->io_addr;
+	unsigned long io_addr = uhci->io_addr;
 	int connection = 0;
 	int i;
 
@@ -1908,7 +1918,7 @@ static int ports_active(struct uhci_hcd *uhci)
 
 static int suspend_allowed(struct uhci_hcd *uhci)
 {
-	unsigned int io_addr = uhci->io_addr;
+	unsigned long io_addr = uhci->io_addr;
 	int i;
 
 	if (to_pci_dev(uhci_dev(uhci))->vendor != PCI_VENDOR_ID_INTEL)
@@ -1973,7 +1983,7 @@ static void hc_state_transitions(struct uhci_hcd *uhci)
 
 static void start_hc(struct uhci_hcd *uhci)
 {
-	unsigned int io_addr = uhci->io_addr;
+	unsigned long io_addr = uhci->io_addr;
 	int timeout = 1000;
 
 	/*
@@ -1990,7 +2000,9 @@ static void start_hc(struct uhci_hcd *uhci)
 		}
 	}
 
-	/* Turn on all interrupts */
+	/* Turn on PIRQ and all interrupts */
+	pci_write_config_word(to_pci_dev(uhci_dev(uhci)), USBLEGSUP,
+			USBLEGSUP_DEFAULT);
 	outw(USBINTR_TIMEOUT | USBINTR_RESUME | USBINTR_IOC | USBINTR_SP,
 		io_addr + USBINTR);
 
@@ -2054,15 +2066,10 @@ static int uhci_reset(struct usb_hcd *hcd)
 
 	uhci->io_addr = (unsigned long) hcd->regs;
 
-	/* Turn off all interrupts */
-	outw(0, uhci->io_addr + USBINTR);
-
-	/* Maybe kick BIOS off this hardware.  Then reset, so we won't get
+	/* Kick BIOS off this hardware and reset, so we won't get
 	 * interrupts from any previous setup.
 	 */
 	reset_hc(uhci);
-	pci_write_config_word(to_pci_dev(uhci_dev(uhci)), USBLEGSUP,
-			USBLEGSUP_DEFAULT);
 	return 0;
 }
 
@@ -2178,7 +2185,7 @@ static int uhci_start(struct usb_hcd *hcd)
 
 	uhci->rh_numports = port;
 
-	hcd->self.root_hub = udev = usb_alloc_dev(NULL, &hcd->self, 0);
+	udev = usb_alloc_dev(NULL, &hcd->self, 0);
 	if (!udev) {
 		dev_err(uhci_dev(uhci), "unable to allocate root hub\n");
 		goto err_alloc_root_hub;
@@ -2254,13 +2261,18 @@ static int uhci_start(struct usb_hcd *hcd)
 		uhci->fl->frame[i] = cpu_to_le32(uhci->skelqh[irq]->dma_handle);
 	}
 
+	/*
+	 * Some architectures require a full mb() to enforce completion of
+	 * the memory writes above before the I/O transfers in start_hc().
+	 */
+	mb();
 	start_hc(uhci);
 
 	init_stall_timer(hcd);
 
 	udev->speed = USB_SPEED_FULL;
 
-	if (usb_register_root_hub(udev, uhci_dev(uhci)) != 0) {
+	if (hcd_register_root(udev, &uhci->hcd) != 0) {
 		dev_err(uhci_dev(uhci), "unable to start root hub\n");
 		retval = -ENOMEM;
 		goto err_start_root_hub;
@@ -2288,7 +2300,6 @@ err_alloc_skelqh:
 
 err_alloc_term_td:
 	usb_put_dev(udev);
-	hcd->self.root_hub = NULL;
 
 err_alloc_root_hub:
 	dma_pool_destroy(uhci->qh_pool);
@@ -2369,14 +2380,18 @@ static int uhci_resume(struct usb_hcd *hcd)
 		/*
 		 * Some systems don't maintain the UHCI register values
 		 * during a PM suspend/resume cycle, so reinitialize
-		 * the Frame Number, the Framelist Base Address, and the
-		 * Interrupt Enable registers.
+		 * the Frame Number, Framelist Base Address, Interrupt
+		 * Enable, and Legacy Support registers.
 		 */
+		pci_write_config_word(to_pci_dev(uhci_dev(uhci)), USBLEGSUP,
+				0);
 		outw(uhci->saved_framenumber, uhci->io_addr + USBFRNUM);
 		outl(uhci->fl->dma_handle, uhci->io_addr + USBFLBASEADD);
 		outw(USBINTR_TIMEOUT | USBINTR_RESUME | USBINTR_IOC |
 				USBINTR_SP, uhci->io_addr + USBINTR);
 		uhci->resume_detect = 1;
+		pci_write_config_word(to_pci_dev(uhci_dev(uhci)), USBLEGSUP,
+				USBLEGSUP_DEFAULT);
 	} else {
 		reset_hc(uhci);
 		start_hc(uhci);
@@ -2518,7 +2533,7 @@ static int __init uhci_hcd_init(void)
 	}
 
 #ifdef CONFIG_PROC_FS
-	uhci_proc_root = create_proc_entry("driver/uhci", S_IFDIR, 0);
+	uhci_proc_root = create_proc_entry("driver/uhci", S_IFDIR, NULL);
 	if (!uhci_proc_root)
 		goto proc_failed;
 #endif
@@ -2541,7 +2556,7 @@ init_failed:
 up_failed:
 
 #ifdef CONFIG_PROC_FS
-	remove_proc_entry("driver/uhci", 0);
+	remove_proc_entry("driver/uhci", NULL);
 
 proc_failed:
 #endif
@@ -2561,7 +2576,7 @@ static void __exit uhci_hcd_cleanup(void)
 		warn("not all urb_priv's were freed!");
 
 #ifdef CONFIG_PROC_FS
-	remove_proc_entry("driver/uhci", 0);
+	remove_proc_entry("driver/uhci", NULL);
 #endif
 
 	if (errbuf)
diff --git a/drivers/usb/host/uhci-hub.c b/drivers/usb/host/uhci-hub.c
index 5ab18dbdd..2dde38163 100644
--- a/drivers/usb/host/uhci-hub.c
+++ b/drivers/usb/host/uhci-hub.c
@@ -36,7 +36,7 @@ static __u8 root_hub_hub_des[] =
 static int uhci_hub_status_data(struct usb_hcd *hcd, char *buf)
 {
 	struct uhci_hcd *uhci = hcd_to_uhci(hcd);
-	unsigned int io_addr = uhci->io_addr;
+	unsigned long io_addr = uhci->io_addr;
 	int i;
 
 	*buf = 0;
@@ -69,7 +69,7 @@ static int uhci_hub_control(struct usb_hcd *hcd, u16 typeReq, u16 wValue,
 {
 	struct uhci_hcd *uhci = hcd_to_uhci(hcd);
 	int status, retval = 0, len = 0;
-	unsigned int port_addr = uhci->io_addr + USBPORTSC1 + 2 * (wIndex-1);
+	unsigned long port_addr = uhci->io_addr + USBPORTSC1 + 2 * (wIndex-1);
 	__u16 wPortChange, wPortStatus;
 
 	switch (typeReq) {
diff --git a/drivers/usb/image/hpusbscsi.c b/drivers/usb/image/hpusbscsi.c
index bd69f10c6..dabc3666a 100644
--- a/drivers/usb/image/hpusbscsi.c
+++ b/drivers/usb/image/hpusbscsi.c
@@ -11,7 +11,7 @@
 #include <asm/atomic.h>
 #include <linux/blkdev.h>
 #include "../../scsi/scsi.h"
-#include "../../scsi/hosts.h"
+#include <scsi/scsi_host.h>
 
 #include "hpusbscsi.h"
 
diff --git a/drivers/usb/image/mdc800.c b/drivers/usb/image/mdc800.c
index b05c16866..f401557f0 100644
--- a/drivers/usb/image/mdc800.c
+++ b/drivers/usb/image/mdc800.c
@@ -190,7 +190,7 @@ static struct usb_endpoint_descriptor mdc800_ed [4] =
 
 
 /* The Variable used by the driver */
-static struct mdc800_data* mdc800=0;
+static struct mdc800_data* mdc800;
 
 
 /***************************************************************************
@@ -547,7 +547,7 @@ static void mdc800_usb_disconnect (struct usb_interface *intf)
 		usb_unlink_urb (mdc800->write_urb);
 		usb_unlink_urb (mdc800->download_urb);
 
-		mdc800->dev=0;
+		mdc800->dev = NULL;
 		usb_set_intfdata(intf, NULL);
 	}
 	info ("Mustek MDC800 disconnected from USB.");
@@ -667,10 +667,10 @@ static int mdc800_device_release (struct inode* inode, struct file *file)
 /*
  * The Device read callback Function
  */
-static ssize_t mdc800_device_read (struct file *file, char *buf, size_t len, loff_t *pos)
+static ssize_t mdc800_device_read (struct file *file, char __user *buf, size_t len, loff_t *pos)
 {
 	size_t left=len, sts=len; /* single transfer size */
-	char* ptr=buf;
+	char __user *ptr = buf;
 	long timeout;
 	DECLARE_WAITQUEUE(wait, current);
 
@@ -767,7 +767,7 @@ static ssize_t mdc800_device_read (struct file *file, char *buf, size_t len, lof
  * After this the driver initiates the request for the answer or
  * just waits until the camera becomes ready.
  */
-static ssize_t mdc800_device_write (struct file *file, const char *buf, size_t len, loff_t *pos)
+static ssize_t mdc800_device_write (struct file *file, const char __user *buf, size_t len, loff_t *pos)
 {
 	size_t i=0;
 	DECLARE_WAITQUEUE(wait, current);
@@ -971,9 +971,7 @@ static struct usb_driver mdc800_usb_driver =
 	Init and Cleanup this driver (Main Functions)
 *************************************************************************/
 
-#define try(A)           if ((A) == 0) goto cleanup_on_fail;
-#define try_free_mem(A)  if (A != 0) { kfree (A); A=0; }
-#define try_free_urb(A)  if (A != 0) { usb_free_urb (A); A=0; }
+#define try(A)           if (!(A)) goto cleanup_on_fail;
 
 static int __init usb_mdc800_init (void)
 {
@@ -982,7 +980,7 @@ static int __init usb_mdc800_init (void)
 	try (mdc800=kmalloc (sizeof (struct mdc800_data), GFP_KERNEL));
 
 	memset(mdc800, 0, sizeof(struct mdc800_data));
-	mdc800->dev=0;
+	mdc800->dev = NULL;
 	mdc800->open=0;
 	mdc800->state=NOT_CONNECTED;
 	init_MUTEX (&mdc800->io_lock);
@@ -1020,17 +1018,17 @@ cleanup_on_fail:
 	{
 		err ("can't alloc memory!");
 
-		try_free_mem (mdc800->download_urb_buffer);
-		try_free_mem (mdc800->write_urb_buffer);
-		try_free_mem (mdc800->irq_urb_buffer);
+		kfree(mdc800->download_urb_buffer);
+		kfree(mdc800->write_urb_buffer);
+		kfree(mdc800->irq_urb_buffer);
 
-		try_free_urb (mdc800->write_urb);
-		try_free_urb (mdc800->download_urb);
-		try_free_urb (mdc800->irq_urb);
+		usb_free_urb(mdc800->write_urb);
+		usb_free_urb(mdc800->download_urb);
+		usb_free_urb(mdc800->irq_urb);
 
 		kfree (mdc800);
 	}
-	mdc800=0;
+	mdc800 = NULL;
 	return retval;
 }
 
@@ -1048,7 +1046,7 @@ static void __exit usb_mdc800_cleanup (void)
 	kfree (mdc800->download_urb_buffer);
 
 	kfree (mdc800);
-	mdc800=0;
+	mdc800 = NULL;
 }
 
 module_init (usb_mdc800_init);
diff --git a/drivers/usb/image/microtek.c b/drivers/usb/image/microtek.c
index 19acf6221..230efaf7b 100644
--- a/drivers/usb/image/microtek.c
+++ b/drivers/usb/image/microtek.c
@@ -136,7 +136,7 @@
 #include <asm/atomic.h>
 #include <linux/blkdev.h>
 #include "../../scsi/scsi.h"
-#include "../../scsi/hosts.h"
+#include <scsi/scsi_host.h>
 
 #include "microtek.h"
 
@@ -534,7 +534,7 @@ mts_build_transfer_context( Scsi_Cmnd *srb, struct mts_desc* desc )
 
 	if (!srb->use_sg) {
 		if ( !srb->bufflen ){
-			desc->context.data = 0;
+			desc->context.data = NULL;
 			desc->context.data_length = 0;
 			return;
 		} else {
diff --git a/drivers/usb/input/Kconfig b/drivers/usb/input/Kconfig
index 0f0282289..dc2f8f06c 100644
--- a/drivers/usb/input/Kconfig
+++ b/drivers/usb/input/Kconfig
@@ -219,14 +219,16 @@ config USB_XPAD
 	  module will be called xpad.
 	  
 config USB_ATI_REMOTE
-	tristate "ATI USB RF remote control"
+	tristate "ATI / X10 USB RF remote control"
 	depends on USB && INPUT
 	---help---
-	  Say Y here if you want to use one of ATI's USB remote controls.
-	  These are RF remotes with USB receivers. They come with many of ATI's 
-	  All-In-Wonder video cards.  This driver provides mouse pointer, left
-          and right mouse buttons, and maps all the other remote buttons to
-	  keypress events.
+	  Say Y here if you want to use an ATI or X10 "Lola" USB remote control.
+	  These are RF remotes with USB receivers. 
+	  The ATI remote comes with many of ATI's All-In-Wonder video cards.
+	  The X10 "Lola" remote is available at:
+	     http://www.x10.com/products/lola_sg1.htm
+	  This driver provides mouse pointer, left and right mouse buttons, 
+	  and maps all the other remote buttons to keypress events.
 	  
 	  To compile this driver as a module, choose M here: the module will be
 	  called ati_remote.
diff --git a/drivers/usb/input/aiptek.c b/drivers/usb/input/aiptek.c
index 81caa0dfe..b0261f8a6 100644
--- a/drivers/usb/input/aiptek.c
+++ b/drivers/usb/input/aiptek.c
@@ -1324,7 +1324,7 @@ store_tabletXtilt(struct device *dev, const char *buf, size_t count)
 	if (strcmp(buf, "disable") == 0) {
 		aiptek->newSetting.xTilt = AIPTEK_TILT_DISABLE;
 	} else {
-		x = (int)simple_strtol(buf, 0, 10);
+		x = (int)simple_strtol(buf, NULL, 10);
 		if (x >= AIPTEK_TILT_MIN && x <= AIPTEK_TILT_MAX) {
 			aiptek->newSetting.xTilt = x;
 		}
@@ -1366,7 +1366,7 @@ store_tabletYtilt(struct device *dev, const char *buf, size_t count)
 	if (strcmp(buf, "disable") == 0) {
 		aiptek->newSetting.yTilt = AIPTEK_TILT_DISABLE;
 	} else {
-		y = (int)simple_strtol(buf, 0, 10);
+		y = (int)simple_strtol(buf, NULL, 10);
 		if (y >= AIPTEK_TILT_MIN && y <= AIPTEK_TILT_MAX) {
 			aiptek->newSetting.yTilt = y;
 		}
@@ -1399,7 +1399,7 @@ store_tabletJitterDelay(struct device *dev, const char *buf, size_t count)
 	if (aiptek == NULL)
 		return 0;
 
-	aiptek->newSetting.jitterDelay = (int)simple_strtol(buf, 0, 10);
+	aiptek->newSetting.jitterDelay = (int)simple_strtol(buf, NULL, 10);
 	return count;
 }
 
@@ -1430,7 +1430,7 @@ store_tabletProgrammableDelay(struct device *dev, const char *buf, size_t count)
 	if (aiptek == NULL)
 		return 0;
 
-	aiptek->newSetting.programmableDelay = (int)simple_strtol(buf, 0, 10);
+	aiptek->newSetting.programmableDelay = (int)simple_strtol(buf, NULL, 10);
 	return count;
 }
 
@@ -1805,7 +1805,7 @@ store_tabletWheel(struct device *dev, const char *buf, size_t count)
 	if (aiptek == NULL)
 		return 0;
 
-	aiptek->newSetting.wheel = (int)simple_strtol(buf, 0, 10);
+	aiptek->newSetting.wheel = (int)simple_strtol(buf, NULL, 10);
 	return count;
 }
 
diff --git a/drivers/usb/input/ati_remote.c b/drivers/usb/input/ati_remote.c
index 0ac83aa87..c1f1c1d20 100644
--- a/drivers/usb/input/ati_remote.c
+++ b/drivers/usb/input/ati_remote.c
@@ -16,6 +16,12 @@
  *
  *  Feb 2004: Torrey Hoffman <thoffman@arnor.net>
  *            Version 2.2.0
+ *  Jun 2004: Torrey Hoffman <thoffman@arnor.net>
+ *            Version 2.2.1
+ *            Added key repeat support contributed by:
+ *                Vincent Vanackere <vanackere@lif.univ-mrs.fr>
+ *            Added support for the "Lola" remote contributed by:
+ *                Seth Cohn <sethcohn@yahoo.com>
  *
  * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * 
  *
@@ -41,6 +47,11 @@
  * "All-In-Wonder" video card packages.  The receiver self-identifies as a 
  * "USB Receiver" with manufacturer "X10 Wireless Technology Inc".
  *
+ * The "Lola" remote is available from X10.  See: 
+ *    http://www.x10.com/products/lola_sg1.htm
+ * The Lola is similar to the ATI remote but has no mouse support, and slightly
+ * different keys.
+ *
  * It is possible to use multiple receivers and remotes on multiple computers 
  * simultaneously by configuring them to use specific channels.
  * 
@@ -90,8 +101,9 @@
  
 #define ATI_REMOTE_VENDOR_ID 	0x0bc7
 #define ATI_REMOTE_PRODUCT_ID 	0x004
+#define LOLA_REMOTE_PRODUCT_ID 	0x002
 
-#define DRIVER_VERSION 	        "2.2.0"
+#define DRIVER_VERSION 	        "2.2.1"
 #define DRIVER_AUTHOR           "Torrey Hoffman <thoffman@arnor.net>"
 #define DRIVER_DESC             "ATI/X10 RF USB Remote Control"
 
@@ -113,6 +125,7 @@ MODULE_PARM_DESC(debug, "Enable extra debug messages and information");
  
 static struct usb_device_id ati_remote_table[] = {
 	{ USB_DEVICE(ATI_REMOTE_VENDOR_ID, ATI_REMOTE_PRODUCT_ID) },
+	{ USB_DEVICE(ATI_REMOTE_VENDOR_ID, LOLA_REMOTE_PRODUCT_ID) },
 	{}	/* Terminating entry */
 };
 
@@ -134,10 +147,13 @@ static char accel[] = { 1, 2, 4, 6, 9, 13, 20 };
 
 /* Duplicate event filtering time. 
  * Sequential, identical KIND_FILTERED inputs with less than
- * FILTER_TIME jiffies between them are dropped.  
- * (HZ >> 4) == 1/16th of a second and works well for me.
+ * FILTER_TIME jiffies between them are considered as repeat
+ * events. The hardware generates 5 events for the first keypress
+ * and we have to take this into account for an accurate repeat
+ * behaviour.
+ * (HZ / 20) == 50 ms and works well for me.
  */
-#define FILTER_TIME (HZ >> 4)
+#define FILTER_TIME (HZ / 20)
 
 static DECLARE_MUTEX(disconnect_sem);
 
@@ -161,6 +177,7 @@ struct ati_remote {
 	unsigned char old_data[2];  /* Detect duplicate events */
 	unsigned long old_jiffies;
 	unsigned long acc_jiffies;  /* handle acceleration */
+	unsigned int repeat_count;
 	
 	char name[NAME_BUFSIZE];
 	char phys[NAME_BUFSIZE];
@@ -256,6 +273,12 @@ static struct
 	{KIND_FILTERED, 0xeb, 0x26, EV_KEY, KEY_FORWARD, 1},    /* (>>) */
 	{KIND_FILTERED, 0xed, 0x28, EV_KEY, KEY_STOP, 1},       /* ([]) */ 
 	{KIND_FILTERED, 0xee, 0x29, EV_KEY, KEY_PAUSE, 1},      /* ('') */
+	{KIND_FILTERED, 0xf0, 0x2b, EV_KEY, KEY_PREVIOUS, 1},   /* (<-) */
+	{KIND_FILTERED, 0xef, 0x2a, EV_KEY, KEY_NEXT, 1},       /* (>+) */
+	{KIND_FILTERED, 0xf2, 0x2D, EV_KEY, KEY_INFO, 1},       /* PLAYING */
+	{KIND_FILTERED, 0xf3, 0x2E, EV_KEY, KEY_HOME, 1},       /* TOP */
+	{KIND_FILTERED, 0xf4, 0x2F, EV_KEY, KEY_END, 1},        /* END */
+	{KIND_FILTERED, 0xf5, 0x30, EV_KEY, KEY_SELECT, 1},     /* SELECT */	
 	
 	{KIND_END, 0x00, 0x00, EV_MAX + 1, 0, 0}
 };
@@ -483,9 +506,20 @@ static void ati_remote_input_report(struct urb *urb, struct pt_regs *regs)
 		if ((ati_remote->old_data[0] == data[1]) && 
 	 		(ati_remote->old_data[1] == data[2]) && 
 	 		((ati_remote->old_jiffies + FILTER_TIME) > jiffies)) {
-			ati_remote->old_jiffies = jiffies;			
+			ati_remote->repeat_count++;
+		} 
+		else {
+			ati_remote->repeat_count = 0;
+		}
+		
+		ati_remote->old_data[0] = data[1];
+		ati_remote->old_data[1] = data[2];
+		ati_remote->old_jiffies = jiffies;
+
+		if ((ati_remote->repeat_count > 0)
+		    && (ati_remote->repeat_count < 5))
 			return;
-		}		
+		
 
 		input_regs(dev, regs);
 		input_event(dev, ati_remote_tbl[index].type,
@@ -494,9 +528,6 @@ static void ati_remote_input_report(struct urb *urb, struct pt_regs *regs)
 			ati_remote_tbl[index].code, 0);
 		input_sync(dev);
 
-		ati_remote->old_data[0] = data[1];
-		ati_remote->old_data[1] = data[2];
-		ati_remote->old_jiffies = jiffies;
 		return;
 	}			
 	
@@ -697,9 +728,9 @@ static int ati_remote_probe(struct usb_interface *interface, const struct usb_de
 
 	/* See if the offered device matches what we can accept */
 	if ((udev->descriptor.idVendor != ATI_REMOTE_VENDOR_ID) ||
-	    (udev->descriptor.idProduct != ATI_REMOTE_PRODUCT_ID)) {
+		( (udev->descriptor.idProduct != ATI_REMOTE_PRODUCT_ID) &&
+		  (udev->descriptor.idProduct != LOLA_REMOTE_PRODUCT_ID) ))
 		return -ENODEV;
-	}
 
 	/* Allocate and clear an ati_remote struct */
 	if (!(ati_remote = kmalloc(sizeof (struct ati_remote), GFP_KERNEL)))
@@ -856,4 +887,3 @@ module_exit(ati_remote_exit);
 MODULE_AUTHOR(DRIVER_AUTHOR);
 MODULE_DESCRIPTION(DRIVER_DESC);
 MODULE_LICENSE("GPL");
-
diff --git a/drivers/usb/input/hid-core.c b/drivers/usb/input/hid-core.c
index 663a6b764..79082d918 100644
--- a/drivers/usb/input/hid-core.c
+++ b/drivers/usb/input/hid-core.c
@@ -807,7 +807,11 @@ static void hid_input_field(struct hid_device *hid, struct hid_field *field, __u
 	unsigned size = field->report_size;
 	__s32 min = field->logical_minimum;
 	__s32 max = field->logical_maximum;
-	__s32 value[count]; /* WARNING: gcc specific */
+	__s32 *value;
+
+	value = kmalloc(sizeof(__s32)*count, GFP_ATOMIC);
+	if (!value)
+		return;
 
 	for (n = 0; n < count; n++) {
 
@@ -817,7 +821,7 @@ static void hid_input_field(struct hid_device *hid, struct hid_field *field, __u
 			if (!(field->flags & HID_MAIN_ITEM_VARIABLE) /* Ignore report if ErrorRollOver */
 			    && value[n] >= min && value[n] <= max
 			    && field->usage[value[n] - min].hid == HID_UP_KEYBOARD + 1)
-				return;
+				goto exit;
 	}
 
 	for (n = 0; n < count; n++) {
@@ -847,6 +851,8 @@ static void hid_input_field(struct hid_device *hid, struct hid_field *field, __u
 	}
 
 	memcpy(field->value, value, count * sizeof(__s32));
+exit:
+	kfree(value);
 }
 
 static int hid_input_report(int type, struct urb *urb, struct pt_regs *regs)
@@ -1324,12 +1330,14 @@ void hid_init_reports(struct hid_device *hid)
 	}
 
 	err = 0;
-	while ((ret = hid_wait_io(hid))) {
+	ret = hid_wait_io(hid);
+	while (ret) {
 		err |= ret;
 		if (test_bit(HID_CTRL_RUNNING, &hid->iofl))
 			usb_unlink_urb(hid->urbctrl);
 		if (test_bit(HID_OUT_RUNNING, &hid->iofl))
 			usb_unlink_urb(hid->urbout);
+		ret = hid_wait_io(hid);
 	}
 
 	if (err)
@@ -1423,6 +1431,9 @@ void hid_init_reports(struct hid_device *hid)
 #define USB_VENDOR_ID_GLAB		0x06c2
 #define USB_DEVICE_ID_4_PHIDGETSERVO_30	0x0038
 #define USB_DEVICE_ID_1_PHIDGETSERVO_30	0x0039
+#define USB_DEVICE_ID_8_8_8_IF_KIT	0x0045
+#define USB_DEVICE_ID_0_0_4_IF_KIT	0x0040
+#define USB_DEVICE_ID_0_8_8_IF_KIT	0x0053
 
 #define USB_VENDOR_ID_WISEGROUP		0x0925
 #define USB_DEVICE_ID_1_PHIDGETSERVO_20	0x8101
@@ -1481,8 +1492,13 @@ static struct hid_blacklist {
 	{ USB_VENDOR_ID_WACOM, USB_DEVICE_ID_WACOM_INTUOS2 + 7, HID_QUIRK_IGNORE },
 	{ USB_VENDOR_ID_WACOM, USB_DEVICE_ID_WACOM_VOLITO, HID_QUIRK_IGNORE },
 	{ USB_VENDOR_ID_WACOM, USB_DEVICE_ID_WACOM_PTU, HID_QUIRK_IGNORE },
+
 	{ USB_VENDOR_ID_GLAB, USB_DEVICE_ID_4_PHIDGETSERVO_30, HID_QUIRK_IGNORE },
 	{ USB_VENDOR_ID_GLAB, USB_DEVICE_ID_1_PHIDGETSERVO_30, HID_QUIRK_IGNORE },
+	{ USB_VENDOR_ID_GLAB, USB_DEVICE_ID_8_8_8_IF_KIT, HID_QUIRK_IGNORE },
+	{ USB_VENDOR_ID_GLAB, USB_DEVICE_ID_0_0_4_IF_KIT, HID_QUIRK_IGNORE },
+	{ USB_VENDOR_ID_GLAB, USB_DEVICE_ID_0_8_8_IF_KIT, HID_QUIRK_IGNORE },
+
 	{ USB_VENDOR_ID_WISEGROUP, USB_DEVICE_ID_4_PHIDGETSERVO_20, HID_QUIRK_IGNORE },
 	{ USB_VENDOR_ID_WISEGROUP, USB_DEVICE_ID_1_PHIDGETSERVO_20, HID_QUIRK_IGNORE },
 
diff --git a/drivers/usb/input/hid-tmff.c b/drivers/usb/input/hid-tmff.c
index 8fd0e489e..8f6a0a6f9 100644
--- a/drivers/usb/input/hid-tmff.c
+++ b/drivers/usb/input/hid-tmff.c
@@ -110,7 +110,7 @@ int hid_tmff_init(struct hid_device *hid)
 {
 	struct tmff_device *private;
 	struct list_head *pos;
-	struct hid_input *hidinput = list_entry(&hid->inputs, struct hid_input, list);
+	struct hid_input *hidinput = list_entry(hid->inputs.next, struct hid_input, list);
 
 	private = kmalloc(sizeof(struct tmff_device), GFP_KERNEL);
 	if (!private)
diff --git a/drivers/usb/input/hiddev.c b/drivers/usb/input/hiddev.c
index c995d93f6..ff319d9ad 100644
--- a/drivers/usb/input/hiddev.c
+++ b/drivers/usb/input/hiddev.c
@@ -66,9 +66,6 @@ struct hiddev_list {
 
 static struct hiddev *hiddev_table[HIDDEV_MINORS];
 
-/* forward reference to make our lives easier */
-extern struct usb_driver hiddev_driver;
-
 /*
  * Find a report, given the report's type and ID.  The ID can be specified
  * indirectly by REPORT_ID_FIRST (which returns the first report of the given
@@ -295,7 +292,7 @@ static int hiddev_open(struct inode * inode, struct file * file) {
 /*
  * "write" file op
  */
-static ssize_t hiddev_write(struct file * file, const char * buffer, size_t count, loff_t *ppos)
+static ssize_t hiddev_write(struct file * file, const char __user * buffer, size_t count, loff_t *ppos)
 {
 	return -EINVAL;
 }
@@ -303,7 +300,7 @@ static ssize_t hiddev_write(struct file * file, const char * buffer, size_t coun
 /*
  * "read" file op
  */
-static ssize_t hiddev_read(struct file * file, char * buffer, size_t count, loff_t *ppos)
+static ssize_t hiddev_read(struct file * file, char __user * buffer, size_t count, loff_t *ppos)
 {
 	DECLARE_WAITQUEUE(wait, current);
 	struct hiddev_list *list = file->private_data;
@@ -406,6 +403,7 @@ static int hiddev_ioctl(struct inode *inode, struct file *file, unsigned int cmd
 	struct hiddev_devinfo dinfo;
 	struct hid_report *report;
 	struct hid_field *field;
+	void __user *user_arg = (void __user *)arg;
 	int i;
 
 	if (!hiddev->exist)
@@ -414,7 +412,7 @@ static int hiddev_ioctl(struct inode *inode, struct file *file, unsigned int cmd
 	switch (cmd) {
 
 	case HIDIOCGVERSION:
-		return put_user(HID_VERSION, (int *) arg);
+		return put_user(HID_VERSION, (int __user *)arg);
 
 	case HIDIOCAPPLICATION:
 		if (arg < 0 || arg >= hid->maxapplication)
@@ -439,13 +437,13 @@ static int hiddev_ioctl(struct inode *inode, struct file *file, unsigned int cmd
 		dinfo.product = dev->descriptor.idProduct;
 		dinfo.version = dev->descriptor.bcdDevice;
 		dinfo.num_applications = hid->maxapplication;
-		if (copy_to_user((void *) arg, &dinfo, sizeof(dinfo)))
+		if (copy_to_user(user_arg, &dinfo, sizeof(dinfo)))
 			return -EFAULT;
 
 		return 0;
 
 	case HIDIOCGFLAG:
-		if (put_user(list->flags, (int *) arg))
+		if (put_user(list->flags, (int __user *)arg))
 			return -EFAULT;
 
 		return 0;
@@ -453,7 +451,7 @@ static int hiddev_ioctl(struct inode *inode, struct file *file, unsigned int cmd
 	case HIDIOCSFLAG:
 		{
 			int newflags;
-			if (get_user(newflags, (int *) arg))
+			if (get_user(newflags, (int __user *)arg))
 				return -EFAULT;
 
 			if ((newflags & ~HIDDEV_FLAGS) != 0 ||
@@ -471,7 +469,7 @@ static int hiddev_ioctl(struct inode *inode, struct file *file, unsigned int cmd
 			int idx, len;
 			char *buf;
 
-			if (get_user(idx, (int *) arg))
+			if (get_user(idx, (int __user *)arg))
 				return -EFAULT;
 
 			if ((buf = kmalloc(HID_STRING_SIZE, GFP_KERNEL)) == NULL)
@@ -482,7 +480,7 @@ static int hiddev_ioctl(struct inode *inode, struct file *file, unsigned int cmd
 				return -EINVAL;
 			}
 
-			if (copy_to_user((void *) (arg+sizeof(int)), buf, len+1)) {
+			if (copy_to_user(user_arg+sizeof(int), buf, len+1)) {
 				kfree(buf);
 				return -EFAULT;
 			}
@@ -498,7 +496,7 @@ static int hiddev_ioctl(struct inode *inode, struct file *file, unsigned int cmd
 		return 0;
 
 	case HIDIOCGREPORT:
-		if (copy_from_user(&rinfo, (void *) arg, sizeof(rinfo)))
+		if (copy_from_user(&rinfo, user_arg, sizeof(rinfo)))
 			return -EFAULT;
 
 		if (rinfo.report_type == HID_REPORT_TYPE_OUTPUT)
@@ -513,7 +511,7 @@ static int hiddev_ioctl(struct inode *inode, struct file *file, unsigned int cmd
 		return 0;
 
 	case HIDIOCSREPORT:
-		if (copy_from_user(&rinfo, (void *) arg, sizeof(rinfo)))
+		if (copy_from_user(&rinfo, user_arg, sizeof(rinfo)))
 			return -EFAULT;
 
 		if (rinfo.report_type == HID_REPORT_TYPE_INPUT)
@@ -527,7 +525,7 @@ static int hiddev_ioctl(struct inode *inode, struct file *file, unsigned int cmd
 		return 0;
 
 	case HIDIOCGREPORTINFO:
-		if (copy_from_user(&rinfo, (void *) arg, sizeof(rinfo)))
+		if (copy_from_user(&rinfo, user_arg, sizeof(rinfo)))
 			return -EFAULT;
 
 		if ((report = hiddev_lookup_report(hid, &rinfo)) == NULL)
@@ -535,13 +533,13 @@ static int hiddev_ioctl(struct inode *inode, struct file *file, unsigned int cmd
 
 		rinfo.num_fields = report->maxfield;
 
-		if (copy_to_user((void *) arg, &rinfo, sizeof(rinfo)))
+		if (copy_to_user(user_arg, &rinfo, sizeof(rinfo)))
 			return -EFAULT;
 
 		return 0;
 
 	case HIDIOCGFIELDINFO:
-		if (copy_from_user(&finfo, (void *) arg, sizeof(finfo)))
+		if (copy_from_user(&finfo, user_arg, sizeof(finfo)))
 			return -EFAULT;
 		rinfo.report_type = finfo.report_type;
 		rinfo.report_id = finfo.report_id;
@@ -568,7 +566,7 @@ static int hiddev_ioctl(struct inode *inode, struct file *file, unsigned int cmd
 		finfo.unit_exponent = field->unit_exponent;
 		finfo.unit = field->unit;
 
-		if (copy_to_user((void *) arg, &finfo, sizeof(finfo)))
+		if (copy_to_user(user_arg, &finfo, sizeof(finfo)))
 			return -EFAULT;
 
 		return 0;
@@ -578,7 +576,7 @@ static int hiddev_ioctl(struct inode *inode, struct file *file, unsigned int cmd
 		if (!uref_multi)
 			return -ENOMEM;
 		uref = &uref_multi->uref;
-		if (copy_from_user(uref, (void *) arg, sizeof(*uref))) 
+		if (copy_from_user(uref, user_arg, sizeof(*uref))) 
 			goto fault;
 
 		rinfo.report_type = uref->report_type;
@@ -595,7 +593,7 @@ static int hiddev_ioctl(struct inode *inode, struct file *file, unsigned int cmd
 
 		uref->usage_code = field->usage[uref->usage_index].hid;
 
-		if (copy_to_user((void *) arg, uref, sizeof(*uref)))
+		if (copy_to_user(user_arg, uref, sizeof(*uref)))
 			goto fault;
 
 		kfree(uref_multi);
@@ -611,11 +609,11 @@ static int hiddev_ioctl(struct inode *inode, struct file *file, unsigned int cmd
 			return -ENOMEM;
 		uref = &uref_multi->uref;
 		if (cmd == HIDIOCGUSAGES || cmd == HIDIOCSUSAGES) {
-			if (copy_from_user(uref_multi, (void *) arg, 
+			if (copy_from_user(uref_multi, user_arg, 
 					   sizeof(*uref_multi)))
 				goto fault;
 		} else {
-			if (copy_from_user(uref, (void *) arg, sizeof(*uref)))
+			if (copy_from_user(uref, user_arg, sizeof(*uref)))
 				goto fault;
 		}
 
@@ -652,7 +650,7 @@ static int hiddev_ioctl(struct inode *inode, struct file *file, unsigned int cmd
 		switch (cmd) {
 			case HIDIOCGUSAGE:
 				uref->value = field->value[uref->usage_index];
-				if (copy_to_user((void *) arg, uref, sizeof(*uref)))
+				if (copy_to_user(user_arg, uref, sizeof(*uref)))
 					goto fault;
 				goto goodreturn;
 
@@ -667,7 +665,7 @@ static int hiddev_ioctl(struct inode *inode, struct file *file, unsigned int cmd
 				for (i = 0; i < uref_multi->num_values; i++)
 					uref_multi->values[i] = 
 					    field->value[uref->usage_index + i];
-				if (copy_to_user((void *) arg, uref_multi, 
+				if (copy_to_user(user_arg, uref_multi, 
 						 sizeof(*uref_multi)))
 					goto fault;
 				goto goodreturn;
@@ -689,7 +687,7 @@ inval:
 		return -EINVAL;
 
 	case HIDIOCGCOLLECTIONINFO:
-		if (copy_from_user(&cinfo, (void *) arg, sizeof(cinfo)))
+		if (copy_from_user(&cinfo, user_arg, sizeof(cinfo)))
 			return -EFAULT;
 
 		if (cinfo.index >= hid->maxcollection)
@@ -699,7 +697,7 @@ inval:
 		cinfo.usage = hid->collection[cinfo.index].usage;
 		cinfo.level = hid->collection[cinfo.index].level;
 
-		if (copy_to_user((void *) arg, &cinfo, sizeof(cinfo)))
+		if (copy_to_user(user_arg, &cinfo, sizeof(cinfo)))
 			return -EFAULT;
 		return 0;
 
@@ -715,7 +713,7 @@ inval:
 			len = strlen(hid->name) + 1;
 			if (len > _IOC_SIZE(cmd))
 				 len = _IOC_SIZE(cmd);
-			return copy_to_user((char *) arg, hid->name, len) ?
+			return copy_to_user(user_arg, hid->name, len) ?
 				-EFAULT : len;
 		}
 
@@ -726,7 +724,7 @@ inval:
 			len = strlen(hid->phys) + 1;
 			if (len > _IOC_SIZE(cmd))
 				len = _IOC_SIZE(cmd);
-			return copy_to_user((char *) arg, hid->phys, len) ?
+			return copy_to_user(user_arg, hid->phys, len) ?
 				-EFAULT : len;
 		}
 	}
diff --git a/drivers/usb/input/powermate.c b/drivers/usb/input/powermate.c
index eb78b995e..0ba1bcbfb 100644
--- a/drivers/usb/input/powermate.c
+++ b/drivers/usb/input/powermate.c
@@ -182,7 +182,7 @@ static void powermate_sync_state(struct powermate_device *pm)
 	pm->configcr->wLength = 0;
 
 	usb_fill_control_urb(pm->config, pm->udev, usb_sndctrlpipe(pm->udev, 0),
-			     (void *) pm->configcr, 0, 0,
+			     (void *) pm->configcr, NULL, 0,
 			     powermate_config_complete, pm);
 	pm->config->setup_dma = pm->configcr_dma;
 	pm->config->transfer_flags |= URB_NO_SETUP_DMA_MAP;
diff --git a/drivers/usb/media/Kconfig b/drivers/usb/media/Kconfig
index 00bf32230..6dac4dc14 100644
--- a/drivers/usb/media/Kconfig
+++ b/drivers/usb/media/Kconfig
@@ -162,6 +162,21 @@ config USB_SE401
 	  To compile this driver as a module, choose M here: the
 	  module will be called se401.
 
+config USB_SN9C102
+	tristate "USB SN9C10[12] PC Camera Controller support (EXPERIMENTAL)"
+	depends on USB && VIDEO_DEV && EXPERIMENTAL
+	---help---
+	  Say Y here if you want support for cameras based on SN9C101 and
+	  SN9C102 PC Camera Controllers.
+
+	  See <file:Documentation/usb/sn9c102.txt> for more informations.
+
+	  This driver uses the Video For Linux API. You must say Y or M to
+	  "Video For Linux" to use this driver.
+
+	  To compile this driver as a module, choose M here: the
+	  module will be called sn9c102.
+
 config USB_STV680
 	tristate "USB STV680 (Pencam) Camera support"
 	depends on USB && VIDEO_DEV
@@ -181,7 +196,7 @@ config USB_STV680
 
 config USB_W9968CF
 	tristate "USB W996[87]CF JPEG Dual Mode Camera support"
-	depends on USB && VIDEO_DEV && I2C
+	depends on USB && VIDEO_DEV && I2C && VIDEO_OVCAMCHIP
 	---help---
 	  Say Y here if you want support for cameras based on OV681 or
 	  Winbond W9967CF/W9968CF JPEG USB Dual Mode Camera Chips.
@@ -190,16 +205,13 @@ config USB_W9968CF
 	  separate module only (released under GPL). It allows to use higher 
 	  resolutions and framerates, but cannot be included in the official 
 	  Linux kernel for performance purposes.
-	  At the moment the driver needs a third-party module for the CMOS 
-	  sensors, which is available on internet: it is recommended to read
-	  <file:Documentation/usb/w9968cf.txt> for more informations and for
-	  a list of supported cameras.
-	
-	  This driver uses the Video For Linux and the I2C APIs. You must say
-	  Y or M to both "Video For Linux" and "I2C Support" to use this 
-	  driver.
-	
-	  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 w9968cf.o. If you want to compile it as a
-	  module, say M here and read <file:Documentation/kbuild/modules.txt>.
+
+	  See <file:Documentation/usb/w9968cf.txt> for more informations.
+
+	  This driver uses the Video For Linux and the I2C APIs. It needs the
+	  OmniVision Camera Chip support as well. You must say Y or M to
+	  "Video For Linux", "I2C Support" and "OmniVision Camera Chip 
+	  support" to use this driver.
+
+	  To compile this driver as a module, choose M here: the
+	  module will be called w9968cf.
diff --git a/drivers/usb/media/Makefile b/drivers/usb/media/Makefile
index 550a31be2..059764cd4 100644
--- a/drivers/usb/media/Makefile
+++ b/drivers/usb/media/Makefile
@@ -3,6 +3,7 @@
 #
 
 pwc-objs	:= pwc-if.o pwc-misc.o pwc-ctrl.o pwc-uncompress.o
+sn9c102-objs	:= sn9c102_core.o sn9c102_pas106b.o sn9c102_tas5110c1b.o sn9c102_tas5130d1b.o
 
 obj-$(CONFIG_USB_DABUSB)	+= dabusb.o
 obj-$(CONFIG_USB_DSBR)		+= dsbr100.o
@@ -11,6 +12,7 @@ obj-$(CONFIG_USB_KONICAWC)	+= konicawc.o usbvideo.o
 obj-$(CONFIG_USB_OV511)		+= ov511.o
 obj-$(CONFIG_USB_PWC)		+= pwc.o
 obj-$(CONFIG_USB_SE401)		+= se401.o
+obj-$(CONFIG_USB_SN9C102)	+= sn9c102.o
 obj-$(CONFIG_USB_STV680)	+= stv680.o
 obj-$(CONFIG_USB_VICAM)		+= vicam.o usbvideo.o
 obj-$(CONFIG_USB_W9968CF)	+= w9968cf.o
diff --git a/drivers/usb/media/dabusb.c b/drivers/usb/media/dabusb.c
index 4510ace39..01f77cbc4 100644
--- a/drivers/usb/media/dabusb.c
+++ b/drivers/usb/media/dabusb.c
@@ -476,7 +476,7 @@ static int dabusb_startrek (pdabusb_t s)
 	return 0;
 }
 
-static ssize_t dabusb_read (struct file *file, char *buf, size_t count, loff_t * ppos)
+static ssize_t dabusb_read (struct file *file, char __user *buf, size_t count, loff_t * ppos)
 {
 	pdabusb_t s = (pdabusb_t) file->private_data;
 	unsigned long flags;
@@ -616,7 +616,7 @@ static int dabusb_open (struct inode *inode, struct file *file)
 	file->f_pos = 0;
 	file->private_data = s;
 
-	return 0;
+	return nonseekable_open(inode, file);
 }
 
 static int dabusb_release (struct inode *inode, struct file *file)
@@ -670,7 +670,7 @@ static int dabusb_ioctl (struct inode *inode, struct file *file, unsigned int cm
 			break;
 		}
 
-		if (copy_from_user (pbulk, (void *) arg, sizeof (bulk_transfer_t))) {
+		if (copy_from_user (pbulk, (void __user *) arg, sizeof (bulk_transfer_t))) {
 			ret = -EFAULT;
 			kfree (pbulk);
 			break;
@@ -678,18 +678,18 @@ static int dabusb_ioctl (struct inode *inode, struct file *file, unsigned int cm
 
 		ret=dabusb_bulk (s, pbulk);
 		if(ret==0)
-			if (copy_to_user((void *)arg, pbulk,
+			if (copy_to_user((void __user *)arg, pbulk,
 					 sizeof(bulk_transfer_t)))
 				ret = -EFAULT;
 		kfree (pbulk);
 		break;
 
 	case IOCTL_DAB_OVERRUNS:
-		ret = put_user (s->overruns, (unsigned int *) arg);
+		ret = put_user (s->overruns, (unsigned int __user *) arg);
 		break;
 
 	case IOCTL_DAB_VERSION:
-		ret = put_user (version, (unsigned int *) arg);
+		ret = put_user (version, (unsigned int __user *) arg);
 		break;
 
 	default:
diff --git a/drivers/usb/media/konicawc.c b/drivers/usb/media/konicawc.c
index 311138c62..5fc52c5d3 100644
--- a/drivers/usb/media/konicawc.c
+++ b/drivers/usb/media/konicawc.c
@@ -324,7 +324,7 @@ static void resubmit_urb(struct uvd *uvd, struct urb *urb)
         }
         urb->dev = uvd->dev;
         urb->status = 0;
-        ret = usb_submit_urb(urb, GFP_KERNEL);
+	ret = usb_submit_urb(urb, GFP_ATOMIC);
 	DEBUG(3, "submitting urb of length %d", urb->transfer_buffer_length);
         if(ret)
                 err("usb_submit_urb error (%d)", ret);
diff --git a/drivers/usb/media/ov511.c b/drivers/usb/media/ov511.c
index c9cef9900..529a2de54 100644
--- a/drivers/usb/media/ov511.c
+++ b/drivers/usb/media/ov511.c
@@ -16,7 +16,7 @@
  * Based on the Linux CPiA driver written by Peter Pregler,
  * Scott J. Bertin and Johannes Erdfelt.
  * 
- * Please see the file: linux/Documentation/usb/ov511.txt 
+ * Please see the file: Documentation/usb/ov511.txt
  * and the website at:  http://alpha.dyndns.org/ov511
  * for more info.
  *
@@ -1900,7 +1900,7 @@ sensor_get_exposure(struct usb_ov511 *ov, unsigned char *val)
 	case SEN_KS0127:
 	case SEN_KS0127B:
 	case SEN_SAA7111A:
-		val = 0;
+		val = NULL;
 		PDEBUG(3, "Unsupported with this sensor");
 		return -EPERM;
 	default:
@@ -4593,7 +4593,7 @@ ov51x_v4l1_ioctl(struct inode *inode, struct file *file,
 }
 
 static ssize_t
-ov51x_v4l1_read(struct file *file, char *buf, size_t cnt, loff_t *ppos)
+ov51x_v4l1_read(struct file *file, char __user *buf, size_t cnt, loff_t *ppos)
 {
 	struct video_device *vdev = file->private_data;
 	int noblock = file->f_flags&O_NONBLOCK;
diff --git a/drivers/usb/media/ov511.h b/drivers/usb/media/ov511.h
index fafd7ecf2..086509a13 100644
--- a/drivers/usb/media/ov511.h
+++ b/drivers/usb/media/ov511.h
@@ -11,7 +11,7 @@
 #ifdef OV511_DEBUG
 	#define PDEBUG(level, fmt, args...) \
 		if (debug >= (level)) info("[%s:%d] " fmt, \
-		__PRETTY_FUNCTION__, __LINE__ , ## args)
+		__FUNCTION__, __LINE__ , ## args)
 #else
 	#define PDEBUG(level, fmt, args...) do {} while(0)
 #endif
diff --git a/drivers/usb/media/pwc-ctrl.c b/drivers/usb/media/pwc-ctrl.c
index eb4e8f80a..d8a7b90d3 100644
--- a/drivers/usb/media/pwc-ctrl.c
+++ b/drivers/usb/media/pwc-ctrl.c
@@ -30,6 +30,7 @@
 #include <asm/uaccess.h> 
 #endif
 #include <asm/errno.h>
+#include <linux/version.h>
  
 #include "pwc.h"
 #include "pwc-ioctl.h"
@@ -127,19 +128,19 @@ static struct Nala_table_entry Nala_table[PSZ_MAX][8] =
 
 /* This tables contains entries for the 675/680/690 (Timon) camera, with
    4 different qualities (no compression, low, medium, high).
-   It lists the bandwidth requirements for said mode by its alternate interface 
+   It lists the bandwidth requirements for said mode by its alternate interface
    number. An alternate of 0 means that the mode is unavailable.
-   
-   There are 6 * 4 * 4 entries: 
+
+   There are 6 * 4 * 4 entries:
      6 different resolutions subqcif, qsif, qcif, sif, cif, vga
      6 framerates: 5, 10, 15, 20, 25, 30
      4 compression modi: none, low, medium, high
-     
-   When an uncompressed mode is not available, the next available compressed mode 
+
+   When an uncompressed mode is not available, the next available compressed mode
    will be chosen (unless the decompressor is absent). Sometimes there are only
    1 or 2 compressed modes available; in that case entries are duplicated.
 */
-struct Timon_table_entry 
+struct Timon_table_entry
 {
 	char alternate;			/* USB alternate interface */
 	unsigned short packetsize;	/* Normal packet size */
@@ -147,7 +148,7 @@ struct Timon_table_entry
 	unsigned char mode[13];		/* precomputed mode settings for cam */
 };
 
-static struct Timon_table_entry Timon_table[PSZ_MAX][6][4] = 
+static struct Timon_table_entry Timon_table[PSZ_MAX][6][4] =
 {
 #include "pwc_timon.h"
 };
@@ -194,7 +195,7 @@ void pwc_hexdump(void *p, int len)
 	int i;
 	unsigned char *s;
 	char buf[100], *d;
-	
+
 	s = (unsigned char *)p;
 	d = buf;
 	*d = '\0';
@@ -230,7 +231,7 @@ static inline int set_video_mode_Nala(struct pwc_device *pdev, int size, int fra
 	unsigned char buf[3];
 	int ret, fps;
 	struct Nala_table_entry *pEntry;
-	int frames2frames[31] = 
+	int frames2frames[31] =
 	{ /* closest match of framerate */
 	   0,  0,  0,  0,  4,  /*  0-4  */
 	   5,  5,  7,  7, 10,  /*  5-9  */
@@ -267,9 +268,12 @@ static inline int set_video_mode_Nala(struct pwc_device *pdev, int size, int fra
 		Debug("Failed to send video command... %d\n", ret);
 		return ret;
 	}
-	if (pEntry->compressed && pdev->decompressor != NULL)
-		pdev->decompressor->init(pdev->release, buf, pdev->decompress_data);
-		
+	if (pEntry->compressed && pdev->decompressor != 0 && pdev->vpalette != VIDEO_PALETTE_RAW)
+		pdev->decompressor->init(pdev->type, pdev->release, buf, pdev->decompress_data);
+
+	pdev->cmd_len = 3;
+	memcpy(pdev->cmd_buf, buf, 3);
+
 	/* Set various parameters */
 	pdev->vframes = frames;
 	pdev->vsize = size;
@@ -303,13 +307,13 @@ static inline int set_video_mode_Timon(struct pwc_device *pdev, int size, int fr
 	if (size == PSZ_VGA && frames > 15)
 		return -EINVAL;
 	fps = (frames / 5) - 1;
-	
+
 	/* Find a supported framerate with progressively higher compression ratios
 	   if the preferred ratio is not available.
 	*/
 	pChoose = NULL;
 	if (pdev->decompressor == NULL) {
-#if PWC_DEBUG	
+#if PWC_DEBUG
 		Debug("Trying to find uncompressed mode.\n");
 #endif
 		pChoose = &Timon_table[size][fps][0];
@@ -319,7 +323,7 @@ static inline int set_video_mode_Timon(struct pwc_device *pdev, int size, int fr
 			pChoose = &Timon_table[size][fps][compression];
 			if (pChoose->alternate != 0)
 				break;
-			compression++;	
+			compression++;
 		}
 	}
 	if (pChoose == NULL || pChoose->alternate == 0)
@@ -332,9 +336,12 @@ static inline int set_video_mode_Timon(struct pwc_device *pdev, int size, int fr
 	if (ret < 0)
 		return ret;
 
-	if (pChoose->bandlength > 0)
-		pdev->decompressor->init(pdev->release, buf, pdev->decompress_data);
-	
+	if (pChoose->bandlength > 0 && pdev->decompressor != 0 && pdev->vpalette != VIDEO_PALETTE_RAW)
+		pdev->decompressor->init(pdev->type, pdev->release, buf, pdev->decompress_data);
+
+	pdev->cmd_len = 13;
+	memcpy(pdev->cmd_buf, buf, 13);
+
 	/* Set various parameters */
 	pdev->vframes = frames;
 	pdev->vsize = size;
@@ -342,7 +349,7 @@ static inline int set_video_mode_Timon(struct pwc_device *pdev, int size, int fr
 	pdev->valternate = pChoose->alternate;
 	pdev->image = pwc_image_sizes[size];
 	pdev->vbandlength = pChoose->bandlength;
-	if (pChoose->bandlength > 0) 
+	if (pChoose->bandlength > 0)
 		pdev->frame_size = (pChoose->bandlength * pdev->image.y) / 4;
 	else
 		pdev->frame_size = (pdev->image.x * pdev->image.y * 12) / 8;
@@ -352,33 +359,54 @@ static inline int set_video_mode_Timon(struct pwc_device *pdev, int size, int fr
 
 static inline int set_video_mode_Kiara(struct pwc_device *pdev, int size, int frames, int compression, int snapshot)
 {
-	struct Kiara_table_entry *pChoose;
+	struct Kiara_table_entry *pChoose = NULL;
 	int fps, ret;
 	unsigned char buf[12];
-	
+	struct Kiara_table_entry RawEntry = {6, 773, 1272, {0xAD, 0xF4, 0x10, 0x27, 0xB6, 0x24, 0x96, 0x02, 0x30, 0x05, 0x03, 0x80}};
+
 	if (size >= PSZ_MAX || frames < 5 || frames > 30 || compression < 0 || compression > 3)
 		return -EINVAL;
 	if (size == PSZ_VGA && frames > 15)
 		return -EINVAL;
 	fps = (frames / 5) - 1;
-	
-	/* Find a supported framerate with progressively higher compression ratios
-	   if the preferred ratio is not available.
-	*/
-	pChoose = NULL;
-	if (pdev->decompressor == NULL) {
-#if PWC_DEBUG	
-		Debug("Trying to find uncompressed mode.\n");
-#endif		
-		pChoose = &Kiara_table[size][fps][0];
+
+	/* special case: VGA @ 5 fps and snapshot is raw bayer mode */
+	if (size == PSZ_VGA && frames == 5 && snapshot)
+	{
+		/* Only available in case the raw palette is selected or 
+		   we have the decompressor available. This mode is 
+		   only available in compressed form 
+		*/
+		if (pdev->vpalette == VIDEO_PALETTE_RAW || pdev->decompressor != NULL)
+		{
+	                Info("Choosing VGA/5 BAYER mode (%d).\n", pdev->vpalette);
+			pChoose = &RawEntry;
+		}
+		else
+		{
+			Info("VGA/5 BAYER mode _must_ have a decompressor available, or use RAW palette.\n");
+		}
 	}
-	else {
-		while (compression <= 3) {
-			pChoose = &Kiara_table[size][fps][compression];
-			if (pChoose->alternate != 0)
-				break;
-			compression++;	
+	else
+	{
+        	/* Find a supported framerate with progressively higher compression ratios
+		   if the preferred ratio is not available.
+                   Skip this step when using RAW modes.
+		*/
+		if (pdev->decompressor == NULL && pdev->vpalette != VIDEO_PALETTE_RAW) {
+#if PWC_DEBUG
+			Debug("Trying to find uncompressed mode.\n");
+#endif
+			pChoose = &Kiara_table[size][fps][0];
 		}
+		else {
+			while (compression <= 3) {
+				pChoose = &Kiara_table[size][fps][compression];
+				if (pChoose->alternate != 0)
+					break;
+				compression++;
+			}
+   		}
 	}
 	if (pChoose == NULL || pChoose->alternate == 0)
 		return -ENOENT; /* Not supported. */
@@ -393,9 +421,11 @@ static inline int set_video_mode_Kiara(struct pwc_device *pdev, int size, int fr
 	if (ret < 0)
 		return ret;
 
-	if (pChoose->bandlength > 0)
-		pdev->decompressor->init(pdev->release, buf, pdev->decompress_data);
-		
+	if (pChoose->bandlength > 0 && pdev->decompressor != 0 && pdev->vpalette != VIDEO_PALETTE_RAW)
+		pdev->decompressor->init(pdev->type, pdev->release, buf, pdev->decompress_data);
+
+	pdev->cmd_len = 12;
+	memcpy(pdev->cmd_buf, buf, 12);
 	/* All set and go */
 	pdev->vframes = frames;
 	pdev->vsize = size;
@@ -403,15 +433,15 @@ static inline int set_video_mode_Kiara(struct pwc_device *pdev, int size, int fr
 	pdev->valternate = pChoose->alternate;
 	pdev->image = pwc_image_sizes[size];
 	pdev->vbandlength = pChoose->bandlength;
-	if (pChoose->bandlength > 0)
-		pdev->frame_size = (pChoose->bandlength * pdev->image.y) / 4;
-	else 
+	if (pdev->vbandlength > 0)
+		pdev->frame_size = (pdev->vbandlength * pdev->image.y) / 4;
+	else
 		pdev->frame_size = (pdev->image.x * pdev->image.y * 12) / 8;
-	pdev->frame_size += (pdev->frame_header_size + pdev->frame_trailer_size);
 	return 0;
 }
 
 
+
 /**
    @pdev: device structure
    @width: viewport width
@@ -422,14 +452,17 @@ static inline int set_video_mode_Kiara(struct pwc_device *pdev, int size, int fr
  */
 int pwc_set_video_mode(struct pwc_device *pdev, int width, int height, int frames, int compression, int snapshot)
 {
-	int ret, size;
-	
+        int ret, size;
+
+        Trace(TRACE_FLOW, "set_video_mode(%dx%d @ %d, palette %d).\n", width, height, frames, pdev->vpalette);
 	size = pwc_decode_size(pdev, width, height);
 	if (size < 0) {
 		Debug("Could not find suitable size.\n");
 		return -ERANGE;
 	}
-	ret = -EINVAL;	
+	Debug("decode_size = %d.\n", size);
+
+        ret = -EINVAL;
 	switch(pdev->type) {
 	case 645:
 	case 646:
@@ -441,7 +474,7 @@ int pwc_set_video_mode(struct pwc_device *pdev, int width, int height, int frame
 	case 690:
 		ret = set_video_mode_Timon(pdev, size, frames, compression, snapshot);
 		break;
-		
+	
 	case 720:
 	case 730:
 	case 740:
@@ -459,6 +492,7 @@ int pwc_set_video_mode(struct pwc_device *pdev, int width, int height, int frame
 	}
 	pdev->view.x = width;
 	pdev->view.y = height;
+	pdev->frame_total_size = pdev->frame_size + pdev->frame_header_size + pdev->frame_trailer_size;
 	pwc_set_image_buffer_size(pdev);
 	Trace(TRACE_SIZE, "Set viewport to %dx%d, image size is %dx%d.\n", width, height, pwc_image_sizes[size].x, pwc_image_sizes[size].y);
 	return 0;
@@ -467,23 +501,33 @@ int pwc_set_video_mode(struct pwc_device *pdev, int width, int height, int frame
 
 void pwc_set_image_buffer_size(struct pwc_device *pdev)
 {
-	int factor, i, filler = 0;
+	int i, factor = 0, filler = 0;
 
-	factor = 6;
-	filler = 128;
+	/* for PALETTE_YUV420P */
+	switch(pdev->vpalette)
+	{
+	case VIDEO_PALETTE_YUV420P:
+		factor = 6;
+		filler = 128;
+		break;
+	case VIDEO_PALETTE_RAW:
+		factor = 6; /* can be uncompressed YUV420P */
+		filler = 0;
+		break;
+	}
 
 	/* Set sizes in bytes */
 	pdev->image.size = pdev->image.x * pdev->image.y * factor / 4;
 	pdev->view.size  = pdev->view.x  * pdev->view.y  * factor / 4;
 
 	/* Align offset, or you'll get some very weird results in
-	   YUV420 mode... x must be multiple of 4 (to get the Y's in 
+	   YUV420 mode... x must be multiple of 4 (to get the Y's in
 	   place), and y even (or you'll mixup U & V). This is less of a
 	   problem for YUV420P.
 	 */
 	pdev->offset.x = ((pdev->view.x - pdev->image.x) / 2) & 0xFFFC;
 	pdev->offset.y = ((pdev->view.y - pdev->image.y) / 2) & 0xFFFE;
-	
+
 	/* Fill buffers with gray or black */
 	for (i = 0; i < MAX_IMAGES; i++) {
 		if (pdev->image_ptr[i] != NULL)
@@ -499,13 +543,8 @@ int pwc_get_brightness(struct pwc_device *pdev)
 {
 	char buf;
 	int ret;
-	
-	ret = usb_control_msg(pdev->udev, usb_rcvctrlpipe(pdev->udev, 0),
-		GET_LUM_CTL,
-		USB_DIR_IN | USB_TYPE_VENDOR | USB_RECIP_DEVICE,
-		BRIGHTNESS_FORMATTER,
-		pdev->vcinterface,
-		&buf, 1, HZ / 2);
+
+	ret = RecvControlMsg(GET_LUM_CTL, BRIGHTNESS_FORMATTER, 1);	
 	if (ret < 0)
 		return ret;
 	return buf << 9;
@@ -520,12 +559,7 @@ int pwc_set_brightness(struct pwc_device *pdev, int value)
 	if (value > 0xffff)
 		value = 0xffff;
 	buf = (value >> 9) & 0x7f;
-	return usb_control_msg(pdev->udev, usb_sndctrlpipe(pdev->udev, 0),
-		SET_LUM_CTL,
-		USB_DIR_OUT | USB_TYPE_VENDOR | USB_RECIP_DEVICE,
-		BRIGHTNESS_FORMATTER,
-		pdev->vcinterface,
-		&buf, 1, HZ / 2);
+	return SendControlMsg(SET_LUM_CTL, BRIGHTNESS_FORMATTER, 1);
 }
 
 /* CONTRAST */
@@ -534,13 +568,8 @@ int pwc_get_contrast(struct pwc_device *pdev)
 {
 	char buf;
 	int ret;
-	
-	ret = usb_control_msg(pdev->udev, usb_rcvctrlpipe(pdev->udev, 0),
-		GET_LUM_CTL,
-		USB_DIR_IN | USB_TYPE_VENDOR | USB_RECIP_DEVICE,
-		CONTRAST_FORMATTER,
-		pdev->vcinterface,
-		&buf, 1, HZ / 2);
+
+	ret = RecvControlMsg(GET_LUM_CTL, CONTRAST_FORMATTER, 1);
 	if (ret < 0)
 		return ret;
 	return buf << 10;
@@ -555,12 +584,7 @@ int pwc_set_contrast(struct pwc_device *pdev, int value)
 	if (value > 0xffff)
 		value = 0xffff;
 	buf = (value >> 10) & 0x3f;
-	return usb_control_msg(pdev->udev, usb_sndctrlpipe(pdev->udev, 0),
-		SET_LUM_CTL,
-		USB_DIR_OUT | USB_TYPE_VENDOR | USB_RECIP_DEVICE,
-		CONTRAST_FORMATTER,
-		pdev->vcinterface,
-		&buf, 1, HZ / 2);
+	return SendControlMsg(SET_LUM_CTL, CONTRAST_FORMATTER, 1);
 }
 
 /* GAMMA */
@@ -570,12 +594,7 @@ int pwc_get_gamma(struct pwc_device *pdev)
 	char buf;
 	int ret;
 	
-	ret = usb_control_msg(pdev->udev, usb_rcvctrlpipe(pdev->udev, 0),
-		GET_LUM_CTL,
-		USB_DIR_IN | USB_TYPE_VENDOR | USB_RECIP_DEVICE,
-		GAMMA_FORMATTER,
-		pdev->vcinterface,
-		&buf, 1, HZ / 2);
+	ret = RecvControlMsg(GET_LUM_CTL, GAMMA_FORMATTER, 1);
 	if (ret < 0)
 		return ret;
 	return buf << 11;
@@ -590,12 +609,7 @@ int pwc_set_gamma(struct pwc_device *pdev, int value)
 	if (value > 0xffff)
 		value = 0xffff;
 	buf = (value >> 11) & 0x1f;
-	return usb_control_msg(pdev->udev, usb_sndctrlpipe(pdev->udev, 0),
-		SET_LUM_CTL,
-		USB_DIR_OUT | USB_TYPE_VENDOR | USB_RECIP_DEVICE,
-		GAMMA_FORMATTER,
-		pdev->vcinterface,
-		&buf, 1, HZ / 2);
+	return SendControlMsg(SET_LUM_CTL, GAMMA_FORMATTER, 1);
 }
 
 
@@ -608,12 +622,7 @@ int pwc_get_saturation(struct pwc_device *pdev)
 
 	if (pdev->type < 675)
 		return -1;
-	ret = usb_control_msg(pdev->udev, usb_rcvctrlpipe(pdev->udev, 0),
-		GET_CHROM_CTL,
-		USB_DIR_IN | USB_TYPE_VENDOR | USB_RECIP_DEVICE,
-		pdev->type < 730 ? SATURATION_MODE_FORMATTER2 : SATURATION_MODE_FORMATTER1,
-		pdev->vcinterface,
-		&buf, 1, HZ / 2);
+	ret = RecvControlMsg(GET_CHROM_CTL, pdev->type < 730 ? SATURATION_MODE_FORMATTER2 : SATURATION_MODE_FORMATTER1, 1);
 	if (ret < 0)
 		return ret;
 	return 32768 + buf * 327;
@@ -631,12 +640,7 @@ int pwc_set_saturation(struct pwc_device *pdev, int value)
 		value = 0xffff;
 	/* saturation ranges from -100 to +100 */
 	buf = (value - 32768) / 327;
-	return usb_control_msg(pdev->udev, usb_sndctrlpipe(pdev->udev, 0),
-		SET_CHROM_CTL,
-		USB_DIR_OUT | USB_TYPE_VENDOR | USB_RECIP_DEVICE,
-		pdev->type < 730 ? SATURATION_MODE_FORMATTER2 : SATURATION_MODE_FORMATTER1,
-		pdev->vcinterface,
-		&buf, 1, HZ / 2);
+	return SendControlMsg(SET_CHROM_CTL, pdev->type < 730 ? SATURATION_MODE_FORMATTER2 : SATURATION_MODE_FORMATTER1, 1);
 }
 
 /* AGC */
@@ -651,12 +655,7 @@ static inline int pwc_set_agc(struct pwc_device *pdev, int mode, int value)
 	else
 		buf = 0xff; /* fixed */
 
-	ret = usb_control_msg(pdev->udev, usb_sndctrlpipe(pdev->udev, 0),
-		SET_LUM_CTL,
-		USB_DIR_OUT | USB_TYPE_VENDOR | USB_RECIP_DEVICE,
-		AGC_MODE_FORMATTER,
-		pdev->vcinterface,
-		&buf, 1, HZ / 2);
+	ret = SendControlMsg(SET_LUM_CTL, AGC_MODE_FORMATTER, 1);
 	
 	if (!mode && ret >= 0) {
 		if (value < 0)
@@ -664,12 +663,7 @@ static inline int pwc_set_agc(struct pwc_device *pdev, int mode, int value)
 		if (value > 0xffff)
 			value = 0xffff;
 		buf = (value >> 10) & 0x3F;
-		ret = usb_control_msg(pdev->udev, usb_sndctrlpipe(pdev->udev, 0),
-			SET_LUM_CTL,
-			USB_DIR_OUT | USB_TYPE_VENDOR | USB_RECIP_DEVICE,
-			PRESET_AGC_FORMATTER,
-			pdev->vcinterface,
-			&buf, 1, HZ / 2);
+		ret = SendControlMsg(SET_LUM_CTL, PRESET_AGC_FORMATTER, 1);
 	}
 	if (ret < 0)
 		return ret;
@@ -681,22 +675,12 @@ static inline int pwc_get_agc(struct pwc_device *pdev, int *value)
 	unsigned char buf;
 	int ret;
 	
-	ret = usb_control_msg(pdev->udev, usb_rcvctrlpipe(pdev->udev, 0),
-		GET_LUM_CTL,
-		USB_DIR_IN | USB_TYPE_VENDOR | USB_RECIP_DEVICE,
-		AGC_MODE_FORMATTER,
-		pdev->vcinterface,
-		&buf, 1, HZ / 2);
+	ret = RecvControlMsg(GET_LUM_CTL, AGC_MODE_FORMATTER, 1);
 	if (ret < 0)
 		return ret;
 
 	if (buf != 0) { /* fixed */
-		ret = usb_control_msg(pdev->udev, usb_rcvctrlpipe(pdev->udev, 0),
-			GET_LUM_CTL,
-			USB_DIR_IN | USB_TYPE_VENDOR | USB_RECIP_DEVICE,
-			PRESET_AGC_FORMATTER,
-			pdev->vcinterface,
-			&buf, 1, HZ / 2);
+		ret = RecvControlMsg(GET_LUM_CTL, PRESET_AGC_FORMATTER, 1);
 		if (ret < 0)
 			return ret;
 		if (buf > 0x3F)
@@ -704,12 +688,7 @@ static inline int pwc_get_agc(struct pwc_device *pdev, int *value)
 		*value = (buf << 10);		
 	}
 	else { /* auto */
-		ret = usb_control_msg(pdev->udev, usb_rcvctrlpipe(pdev->udev, 0),
-			GET_STATUS_CTL,
-			USB_DIR_IN | USB_TYPE_VENDOR | USB_RECIP_DEVICE,
-			READ_AGC_FORMATTER,
-			pdev->vcinterface,
-			&buf, 1, HZ / 2);
+		ret = RecvControlMsg(GET_STATUS_CTL, READ_AGC_FORMATTER, 1);
 		if (ret < 0)
 			return ret;
 		/* Gah... this value ranges from 0x00 ... 0x9F */
@@ -732,12 +711,7 @@ static inline int pwc_set_shutter_speed(struct pwc_device *pdev, int mode, int v
 	else
 		buf[0] = 0xff; /* fixed */
 	
-	ret = usb_control_msg(pdev->udev, usb_sndctrlpipe(pdev->udev, 0),
-		SET_LUM_CTL,
-		USB_DIR_OUT | USB_TYPE_VENDOR | USB_RECIP_DEVICE,
-		SHUTTER_MODE_FORMATTER,
-		pdev->vcinterface,
-		buf, 1, HZ / 2);
+	ret = SendControlMsg(SET_LUM_CTL, SHUTTER_MODE_FORMATTER, 1);
 
 	if (!mode && ret >= 0) {
 		if (value < 0)
@@ -763,12 +737,7 @@ static inline int pwc_set_shutter_speed(struct pwc_device *pdev, int mode, int v
 			break;
 		}
 
-		ret = usb_control_msg(pdev->udev, usb_sndctrlpipe(pdev->udev, 0),
-			SET_LUM_CTL,
-			USB_DIR_OUT | USB_TYPE_VENDOR | USB_RECIP_DEVICE,
-			PRESET_SHUTTER_FORMATTER,
-			pdev->vcinterface,
-			&buf, 2, HZ / 2);
+		ret = SendControlMsg(SET_LUM_CTL, PRESET_SHUTTER_FORMATTER, 2);
 	}
 	return ret;
 }	
@@ -787,12 +756,7 @@ int pwc_camera_power(struct pwc_device *pdev, int power)
 		buf = 0x00; /* active */
 	else
 		buf = 0xFF; /* power save */
-	return usb_control_msg(pdev->udev, usb_sndctrlpipe(pdev->udev, 0),
-		SET_STATUS_CTL,
-		USB_DIR_OUT | USB_TYPE_VENDOR | USB_RECIP_DEVICE,
-		SET_POWER_SAVE_MODE_FORMATTER,
-		pdev->vcinterface,
-		&buf, 1, HZ / 2);
+	return SendControlMsg(SET_STATUS_CTL, SET_POWER_SAVE_MODE_FORMATTER, 1);
 }
 
 
@@ -801,32 +765,20 @@ int pwc_camera_power(struct pwc_device *pdev, int power)
 
 static inline int pwc_restore_user(struct pwc_device *pdev)
 {
-	return usb_control_msg(pdev->udev, usb_sndctrlpipe(pdev->udev, 0),
-		SET_STATUS_CTL,
-		USB_DIR_OUT | USB_TYPE_VENDOR | USB_RECIP_DEVICE,
-		RESTORE_USER_DEFAULTS_FORMATTER,
-		pdev->vcinterface,
-		NULL, 0, HZ / 2);
+	char buf; /* dummy */
+	return SendControlMsg(SET_STATUS_CTL, RESTORE_USER_DEFAULTS_FORMATTER, 0);
 }
 
 static inline int pwc_save_user(struct pwc_device *pdev)
 {
-	return usb_control_msg(pdev->udev, usb_sndctrlpipe(pdev->udev, 0),
-		SET_STATUS_CTL,
-		USB_DIR_OUT | USB_TYPE_VENDOR | USB_RECIP_DEVICE,
-		SAVE_USER_DEFAULTS_FORMATTER,
-		pdev->vcinterface,
-		NULL, 0, HZ / 2);
+	char buf; /* dummy */
+	return SendControlMsg(SET_STATUS_CTL, SAVE_USER_DEFAULTS_FORMATTER, 0);
 }
 
 static inline int pwc_restore_factory(struct pwc_device *pdev)
 {
-	return usb_control_msg(pdev->udev, usb_sndctrlpipe(pdev->udev, 0),
-		SET_STATUS_CTL,
-		USB_DIR_OUT | USB_TYPE_VENDOR | USB_RECIP_DEVICE,
-		RESTORE_FACTORY_DEFAULTS_FORMATTER,
-		pdev->vcinterface,
-		NULL, 0, HZ / 2);
+	char buf; /* dummy */
+	return SendControlMsg(SET_STATUS_CTL, RESTORE_FACTORY_DEFAULTS_FORMATTER, 0);
 }
 
  /* ************************************************* */
@@ -854,12 +806,7 @@ static inline int pwc_set_awb(struct pwc_device *pdev, int mode)
 	
 	buf = mode & 0x07; /* just the lowest three bits */
 	
-	ret = usb_control_msg(pdev->udev, usb_sndctrlpipe(pdev->udev, 0),
-		SET_CHROM_CTL,
-		USB_DIR_OUT | USB_TYPE_VENDOR | USB_RECIP_DEVICE,
-		WB_MODE_FORMATTER,
-		pdev->vcinterface,
-		&buf, 1, HZ / 2);
+	ret = SendControlMsg(SET_CHROM_CTL, WB_MODE_FORMATTER, 1);
 	
 	if (ret < 0)
 		return ret;
@@ -871,12 +818,7 @@ static inline int pwc_get_awb(struct pwc_device *pdev)
 	unsigned char buf;
 	int ret;
 	
-	ret = usb_control_msg(pdev->udev, usb_rcvctrlpipe(pdev->udev, 0),
-		GET_CHROM_CTL,
-		USB_DIR_IN | USB_TYPE_VENDOR | USB_RECIP_DEVICE,
-		WB_MODE_FORMATTER,
-		pdev->vcinterface,
-		&buf, 1, HZ / 2);
+	ret = RecvControlMsg(GET_CHROM_CTL, WB_MODE_FORMATTER, 1);
 
 	if (ret < 0) 
 		return ret;
@@ -891,34 +833,21 @@ static inline int pwc_set_red_gain(struct pwc_device *pdev, int value)
 		value = 0;
 	if (value > 0xffff)
 		value = 0xffff;
-
-	/* only the msb are considered */
+	/* only the msb is considered */
 	buf = value >> 8;
-
-	return usb_control_msg(pdev->udev, usb_sndctrlpipe(pdev->udev, 0),
-		SET_CHROM_CTL,
-		USB_DIR_OUT | USB_TYPE_VENDOR | USB_RECIP_DEVICE,
-		PRESET_MANUAL_RED_GAIN_FORMATTER,
-		pdev->vcinterface,
-		&buf, 1, HZ / 2);
+	return SendControlMsg(SET_CHROM_CTL, PRESET_MANUAL_RED_GAIN_FORMATTER, 1);
 }
 
-static inline int pwc_get_red_gain(struct pwc_device *pdev)
+static inline int pwc_get_red_gain(struct pwc_device *pdev, int *value)
 {
 	unsigned char buf;
 	int ret;
 	
-	ret = usb_control_msg(pdev->udev, usb_rcvctrlpipe(pdev->udev, 0),
- 	        GET_CHROM_CTL, 
-		USB_DIR_IN | USB_TYPE_VENDOR | USB_RECIP_DEVICE,
-	        PRESET_MANUAL_RED_GAIN_FORMATTER,
-		pdev->vcinterface,
-		&buf, 1, HZ / 2);
-
+	ret = RecvControlMsg(GET_CHROM_CTL, PRESET_MANUAL_RED_GAIN_FORMATTER, 1);
 	if (ret < 0)
 	    return ret;
-	
-	return (buf << 8);
+	*value = buf << 8;
+	return 0;
 }
 
 
@@ -930,34 +859,21 @@ static inline int pwc_set_blue_gain(struct pwc_device *pdev, int value)
 		value = 0;
 	if (value > 0xffff)
 		value = 0xffff;
-
-	/* linear mapping of 0..0xffff to -0x80..0x7f */
-	buf = (value >> 8);
-
-	return usb_control_msg(pdev->udev, usb_sndctrlpipe(pdev->udev, 0),
-		SET_CHROM_CTL,
-		USB_DIR_OUT | USB_TYPE_VENDOR | USB_RECIP_DEVICE,
-		PRESET_MANUAL_BLUE_GAIN_FORMATTER,
-		pdev->vcinterface,
-		&buf, 1, HZ / 2);
+	/* only the msb is considered */
+	buf = value >> 8;
+	return SendControlMsg(SET_CHROM_CTL, PRESET_MANUAL_BLUE_GAIN_FORMATTER, 1);
 }
 
-static inline int pwc_get_blue_gain(struct pwc_device *pdev)
+static inline int pwc_get_blue_gain(struct pwc_device *pdev, int *value)
 {
 	unsigned char buf;
 	int ret;
 	
-	ret = usb_control_msg(pdev->udev, usb_rcvctrlpipe(pdev->udev, 0),
-   	        GET_CHROM_CTL,
-		USB_DIR_IN | USB_TYPE_VENDOR | USB_RECIP_DEVICE,
-		PRESET_MANUAL_BLUE_GAIN_FORMATTER,
-		pdev->vcinterface,
-		&buf, 1, HZ / 2);
-
+	ret = RecvControlMsg(GET_CHROM_CTL, PRESET_MANUAL_BLUE_GAIN_FORMATTER, 1);
 	if (ret < 0)
 	    return ret;
-	
-	return (buf << 8);
+	*value = buf << 8;
+	return 0;
 }
 
 
@@ -965,40 +881,28 @@ static inline int pwc_get_blue_gain(struct pwc_device *pdev)
    internal red/blue gains, which may be different from the manual 
    gains set or read above.
  */   
-static inline int pwc_read_red_gain(struct pwc_device *pdev)
+static inline int pwc_read_red_gain(struct pwc_device *pdev, int *value)
 {
 	unsigned char buf;
 	int ret;
 	
-	ret = usb_control_msg(pdev->udev, usb_rcvctrlpipe(pdev->udev, 0),
- 	        GET_STATUS_CTL, 
-		USB_DIR_IN | USB_TYPE_VENDOR | USB_RECIP_DEVICE,
-	        READ_RED_GAIN_FORMATTER,
-		pdev->vcinterface,
-		&buf, 1, HZ / 2);
-
+	ret = RecvControlMsg(GET_STATUS_CTL, READ_RED_GAIN_FORMATTER, 1);
 	if (ret < 0)
 		return ret;
-	
-	return (buf << 8);
+	*value = buf << 8;
+	return 0;
 }
 
-static inline int pwc_read_blue_gain(struct pwc_device *pdev)
+static inline int pwc_read_blue_gain(struct pwc_device *pdev, int *value)
 {
 	unsigned char buf;
 	int ret;
 	
-	ret = usb_control_msg(pdev->udev, usb_rcvctrlpipe(pdev->udev, 0),
-   	        GET_STATUS_CTL,
-		USB_DIR_IN | USB_TYPE_VENDOR | USB_RECIP_DEVICE,
-		READ_BLUE_GAIN_FORMATTER,
-		pdev->vcinterface,
-		&buf, 1, HZ / 2);
-
+	ret = RecvControlMsg(GET_STATUS_CTL, READ_BLUE_GAIN_FORMATTER, 1);
 	if (ret < 0)
 		return ret;
-	
-	return (buf << 8);
+	*value = buf << 8;
+	return 0;
 }
 
 
@@ -1008,28 +912,19 @@ static inline int pwc_set_wb_speed(struct pwc_device *pdev, int speed)
 	
 	/* useful range is 0x01..0x20 */
 	buf = speed / 0x7f0;
-	return usb_control_msg(pdev->udev, usb_sndctrlpipe(pdev->udev, 0),
-		SET_CHROM_CTL,
-		USB_DIR_OUT | USB_TYPE_VENDOR | USB_RECIP_DEVICE,
-		AWB_CONTROL_SPEED_FORMATTER,
-		pdev->vcinterface,
-		&buf, 1, HZ / 2);
+	return SendControlMsg(SET_CHROM_CTL, AWB_CONTROL_SPEED_FORMATTER, 1);
 }
 
-static inline int pwc_get_wb_speed(struct pwc_device *pdev)
+static inline int pwc_get_wb_speed(struct pwc_device *pdev, int *value)
 {
 	unsigned char buf;
 	int ret;
 	
-	ret = usb_control_msg(pdev->udev, usb_rcvctrlpipe(pdev->udev, 0),
-		GET_CHROM_CTL,
-		USB_DIR_IN | USB_TYPE_VENDOR | USB_RECIP_DEVICE,
-		AWB_CONTROL_SPEED_FORMATTER,
-		pdev->vcinterface,
-		&buf, 1, HZ / 2);
+	ret = RecvControlMsg(GET_CHROM_CTL, AWB_CONTROL_SPEED_FORMATTER, 1);
 	if (ret < 0)
 		return ret;
-	return (buf * 0x7f0);
+	*value = buf * 0x7f0;
+	return 0;
 }
 
 
@@ -1039,28 +934,19 @@ static inline int pwc_set_wb_delay(struct pwc_device *pdev, int delay)
 	
 	/* useful range is 0x01..0x3F */
 	buf = (delay >> 10);
-	return usb_control_msg(pdev->udev, usb_sndctrlpipe(pdev->udev, 0),
-		SET_CHROM_CTL,
-		USB_DIR_OUT | USB_TYPE_VENDOR | USB_RECIP_DEVICE,
-		AWB_CONTROL_DELAY_FORMATTER,
-		pdev->vcinterface,
-		&buf, 1, HZ / 2);
+	return SendControlMsg(SET_CHROM_CTL, AWB_CONTROL_DELAY_FORMATTER, 1);
 }
 
-static inline int pwc_get_wb_delay(struct pwc_device *pdev)
+static inline int pwc_get_wb_delay(struct pwc_device *pdev, int *value)
 {
 	unsigned char buf;
 	int ret;
 	
-	ret = usb_control_msg(pdev->udev, usb_rcvctrlpipe(pdev->udev, 0),
-		GET_CHROM_CTL,
-		USB_DIR_IN | USB_TYPE_VENDOR | USB_RECIP_DEVICE,
-		AWB_CONTROL_DELAY_FORMATTER,
-		pdev->vcinterface,
-		&buf, 1, HZ / 2);
+	ret = RecvControlMsg(GET_CHROM_CTL, AWB_CONTROL_DELAY_FORMATTER, 1);
 	if (ret < 0)
 		return ret;
-	return (buf << 10);
+	*value = buf << 10;
+	return 0;
 }
 
 
@@ -1115,12 +1001,7 @@ static inline int pwc_set_contour(struct pwc_device *pdev, int contour)
 		buf = 0xff; /* auto contour on */
 	else
 		buf = 0x0; /* auto contour off */
-	ret = usb_control_msg(pdev->udev, usb_sndctrlpipe(pdev->udev, 0),
-		SET_LUM_CTL,
-		USB_DIR_OUT | USB_TYPE_VENDOR | USB_RECIP_DEVICE,
-		AUTO_CONTOUR_FORMATTER,
-		pdev->vcinterface,
-		&buf, 1, HZ / 2);
+	ret = SendControlMsg(SET_LUM_CTL, AUTO_CONTOUR_FORMATTER, 1);
 	if (ret < 0)
 		return ret;
 	
@@ -1130,12 +1011,7 @@ static inline int pwc_set_contour(struct pwc_device *pdev, int contour)
 		contour = 0xffff;
 	
 	buf = (contour >> 10); /* contour preset is [0..3f] */
-	ret = usb_control_msg(pdev->udev, usb_sndctrlpipe(pdev->udev, 0),
-		SET_LUM_CTL,
-		USB_DIR_OUT | USB_TYPE_VENDOR | USB_RECIP_DEVICE,
-		PRESET_CONTOUR_FORMATTER,
-		pdev->vcinterface,
-		&buf, 1, HZ / 2);
+	ret = SendControlMsg(SET_LUM_CTL, PRESET_CONTOUR_FORMATTER, 1);
 	if (ret < 0)	
 		return ret;	
 	return 0;
@@ -1146,26 +1022,16 @@ static inline int pwc_get_contour(struct pwc_device *pdev, int *contour)
 	unsigned char buf;
 	int ret;
 	
-	ret = usb_control_msg(pdev->udev, usb_rcvctrlpipe(pdev->udev, 0),
-		GET_LUM_CTL,
-		USB_DIR_IN | USB_TYPE_VENDOR | USB_RECIP_DEVICE,
-		AUTO_CONTOUR_FORMATTER,
-		pdev->vcinterface,
-		&buf, 1, HZ / 2);
+	ret = RecvControlMsg(GET_LUM_CTL, AUTO_CONTOUR_FORMATTER, 1);
 	if (ret < 0)
 		return ret;
 
 	if (buf == 0) {
 		/* auto mode off, query current preset value */
-		ret = usb_control_msg(pdev->udev, usb_rcvctrlpipe(pdev->udev, 0),
-			GET_LUM_CTL,
-			USB_DIR_IN | USB_TYPE_VENDOR | USB_RECIP_DEVICE,
-			PRESET_CONTOUR_FORMATTER,
-			pdev->vcinterface,
-			&buf, 1, HZ / 2);
+		ret = RecvControlMsg(GET_LUM_CTL, PRESET_CONTOUR_FORMATTER, 1);
 		if (ret < 0)	
 			return ret;
-		*contour =  (buf << 10);
+		*contour = buf << 10;
 	}
 	else
 		*contour = -1;
@@ -1181,28 +1047,19 @@ static inline int pwc_set_backlight(struct pwc_device *pdev, int backlight)
 		buf = 0xff;
 	else
 		buf = 0x0;
-	return usb_control_msg(pdev->udev, usb_sndctrlpipe(pdev->udev, 0),
-		SET_LUM_CTL,
-		USB_DIR_OUT | USB_TYPE_VENDOR | USB_RECIP_DEVICE,
-		BACK_LIGHT_COMPENSATION_FORMATTER,
-		pdev->vcinterface,
-		&buf, 1, HZ / 2);
+	return SendControlMsg(SET_LUM_CTL, BACK_LIGHT_COMPENSATION_FORMATTER, 1);
 }
 
-static inline int pwc_get_backlight(struct pwc_device *pdev)
+static inline int pwc_get_backlight(struct pwc_device *pdev, int *backlight)
 {
 	int ret;
 	unsigned char buf;
 	
-	ret = usb_control_msg(pdev->udev, usb_rcvctrlpipe(pdev->udev, 0),
-		GET_LUM_CTL,
-		USB_DIR_IN | USB_TYPE_VENDOR | USB_RECIP_DEVICE,
-		BACK_LIGHT_COMPENSATION_FORMATTER,
-		pdev->vcinterface,
-		&buf, 1, HZ / 2);
+	ret = RecvControlMsg(GET_LUM_CTL, BACK_LIGHT_COMPENSATION_FORMATTER, 1);
 	if (ret < 0)
 		return ret;
-	return buf;
+	*backlight = buf;
+	return 0;
 }
 
 
@@ -1217,7 +1074,7 @@ static inline int pwc_set_flicker(struct pwc_device *pdev, int flicker)
 	return SendControlMsg(SET_LUM_CTL, FLICKERLESS_MODE_FORMATTER, 1);
 }
 
-static inline int pwc_get_flicker(struct pwc_device *pdev)
+static inline int pwc_get_flicker(struct pwc_device *pdev, int *flicker)
 {
 	int ret;
 	unsigned char buf;
@@ -1225,7 +1082,8 @@ static inline int pwc_get_flicker(struct pwc_device *pdev)
 	ret = RecvControlMsg(GET_LUM_CTL, FLICKERLESS_MODE_FORMATTER, 1);
 	if (ret < 0)
 		return ret;
-	return buf;
+	*flicker = buf;
+	return 0;
 }
 
 
@@ -1241,7 +1099,7 @@ static inline int pwc_set_dynamic_noise(struct pwc_device *pdev, int noise)
 	return SendControlMsg(SET_LUM_CTL, DYNAMIC_NOISE_CONTROL_FORMATTER, 1);
 }
 
-static inline int pwc_get_dynamic_noise(struct pwc_device *pdev)
+static inline int pwc_get_dynamic_noise(struct pwc_device *pdev, int *noise)
 {
 	int ret;
 	unsigned char buf;
@@ -1249,14 +1107,15 @@ static inline int pwc_get_dynamic_noise(struct pwc_device *pdev)
 	ret = RecvControlMsg(GET_LUM_CTL, DYNAMIC_NOISE_CONTROL_FORMATTER, 1);
 	if (ret < 0)
 		return ret;
-	return buf;
+	*noise = buf;
+	return 0;
 }
 
 int pwc_mpt_reset(struct pwc_device *pdev, int flags)
 {
 	unsigned char buf;
 	
-	buf = flags & 0x03; // only lower two bits are currently used 
+	buf = flags & 0x03; // only lower two bits are currently used
 	return SendControlMsg(SET_MPT_CTL, PT_RESET_CONTROL_FORMATTER, 1);
 }
 
@@ -1293,7 +1152,7 @@ static inline int pwc_mpt_get_status(struct pwc_device *pdev, struct pwc_mpt_sta
 }
 
 
-int pwc_get_cmos_sensor(struct pwc_device *pdev)
+int pwc_get_cmos_sensor(struct pwc_device *pdev, int *sensor)
 {
 	unsigned char buf;
 	int ret = -1, request;
@@ -1305,24 +1164,60 @@ int pwc_get_cmos_sensor(struct pwc_device *pdev)
 	else
 		request = SENSOR_TYPE_FORMATTER2;
 	
-	ret = usb_control_msg(pdev->udev, usb_rcvctrlpipe(pdev->udev, 0),
-		GET_STATUS_CTL,
-		USB_DIR_IN | USB_TYPE_VENDOR | USB_RECIP_DEVICE,
-		request,
-		pdev->vcinterface,
-		&buf, 1, HZ / 2);
+	ret = RecvControlMsg(GET_STATUS_CTL, request, 1);
 	if (ret < 0)
 		return ret;
 	if (pdev->type < 675)
-		return buf | 0x100;
+		*sensor = buf | 0x100;
 	else
-		return buf;
+		*sensor = buf;
+	return 0;
 }
 
 
  /* End of Add-Ons                                    */
  /* ************************************************* */
 
+/* Linux 2.5.something and 2.6 pass direct pointers to arguments of
+   ioctl() calls. With 2.4, you have to do tedious copy_from_user()
+   and copy_to_user() calls. With these macros we circumvent this,
+   and let me maintain only one source file. The functionality is
+   exactly the same otherwise.
+ */   
+
+#if LINUX_VERSION_CODE >= KERNEL_VERSION(2, 6, 0)
+
+/* define local variable for arg */
+#define ARG_DEF(ARG_type, ARG_name)\
+	ARG_type *ARG_name = arg;
+/* copy arg to local variable */	
+#define ARG_IN(ARG_name) /* nothing */
+/* argument itself (referenced) */
+#define ARGR(ARG_name) (*ARG_name)
+/* argument address */
+#define ARGA(ARG_name) ARG_name
+/* copy local variable to arg */
+#define ARG_OUT(ARG_name) /* nothing */
+
+#else
+
+#define ARG_DEF(ARG_type, ARG_name)\
+	ARG_type ARG_name;
+#define ARG_IN(ARG_name)\
+	if (copy_from_user(&ARG_name, arg, sizeof(ARG_name))) {\
+		ret = -EFAULT;\
+		break;\
+	}
+#define ARGR(ARG_name) ARG_name
+#define ARGA(ARG_name) &ARG_name
+#define ARG_OUT(ARG_name)\
+	if (copy_to_user(arg, &ARG_name, sizeof(ARG_name))) {\
+		ret = -EFAULT;\
+		break;\
+	}
+
+#endif
+
 int pwc_ioctl(struct pwc_device *pdev, unsigned int cmd, void *arg)
 {
 	int ret = 0;
@@ -1351,225 +1246,254 @@ int pwc_ioctl(struct pwc_device *pdev, unsigned int cmd, void *arg)
 	
 	case VIDIOCPWCSCQUAL:
 	{	
-		int *qual = arg;
+		ARG_DEF(int, qual)
 
-		if (*qual < 0 || *qual > 3)
+		ARG_IN(qual)
+		if (ARGR(qual) < 0 || ARGR(qual) > 3)
 			ret = -EINVAL;
 		else
-			ret = pwc_try_video_mode(pdev, pdev->view.x, pdev->view.y, pdev->vframes, *qual, pdev->vsnapshot);
+			ret = pwc_try_video_mode(pdev, pdev->view.x, pdev->view.y, pdev->vframes, ARGR(qual), pdev->vsnapshot);
 		if (ret >= 0)
-			pdev->vcompression = *qual;
+			pdev->vcompression = ARGR(qual);
 		break;
 	}
 	
 	case VIDIOCPWCGCQUAL:
 	{
-		int *qual = arg;
+		ARG_DEF(int, qual)
 		
-		*qual = pdev->vcompression;
+		ARGR(qual) = pdev->vcompression;
+		ARG_OUT(qual)
 		break;
 	}
-
+	
 	case VIDIOCPWCPROBE:
 	{
-		struct pwc_probe *probe = arg;
+		ARG_DEF(struct pwc_probe, probe)
 		
-		strcpy(probe->name, pdev->vdev.name);
-		probe->type = pdev->type;
+		strcpy(ARGR(probe).name, pdev->vdev->name);
+		ARGR(probe).type = pdev->type;
+		ARG_OUT(probe)
+		break;
+	}
+
+	case VIDIOCPWCGSERIAL:
+	{
+		ARG_DEF(struct pwc_serial, serial)
+		
+		strcpy(ARGR(serial).serial, pdev->serial);
+		ARG_OUT(serial)
 		break;
 	}
 
 	case VIDIOCPWCSAGC:
 	{
-		int *agc = arg;
+		ARG_DEF(int, agc)
 
-		if (pwc_set_agc(pdev, *agc < 0 ? 1 : 0, *agc))
+		ARG_IN(agc)
+		if (pwc_set_agc(pdev, ARGR(agc) < 0 ? 1 : 0, ARGR(agc)))
 			ret = -EINVAL;
 		break;
 	}
 	
 	case VIDIOCPWCGAGC:
 	{
-		int *agc = arg;
+		ARG_DEF(int, agc)
 		
-		if (pwc_get_agc(pdev, agc))
+		if (pwc_get_agc(pdev, ARGA(agc)))
 			ret = -EINVAL;
+		ARG_OUT(agc)
 		break;
 	}
 	
 	case VIDIOCPWCSSHUTTER:
 	{
-		int *shutter_speed = arg;
+		ARG_DEF(int, shutter_speed)
 
-		ret = pwc_set_shutter_speed(pdev, *shutter_speed < 0 ? 1 : 0, *shutter_speed);
+		ARG_IN(shutter_speed)
+		ret = pwc_set_shutter_speed(pdev, ARGR(shutter_speed) < 0 ? 1 : 0, ARGR(shutter_speed));
 		break;
 	}
 	
         case VIDIOCPWCSAWB:
 	{
-		struct pwc_whitebalance *wb = arg;
+		ARG_DEF(struct pwc_whitebalance, wb)
 		
-		ret = pwc_set_awb(pdev, wb->mode);
-		if (ret >= 0 && wb->mode == PWC_WB_MANUAL) {
-			pwc_set_red_gain(pdev, wb->manual_red);
-			pwc_set_blue_gain(pdev, wb->manual_blue);
+		ARG_IN(wb)
+		ret = pwc_set_awb(pdev, ARGR(wb).mode);
+		if (ret >= 0 && ARGR(wb).mode == PWC_WB_MANUAL) {
+			pwc_set_red_gain(pdev, ARGR(wb).manual_red);
+			pwc_set_blue_gain(pdev, ARGR(wb).manual_blue);
 		}
 		break;
 	}
 
 	case VIDIOCPWCGAWB:
 	{
-		struct pwc_whitebalance *wb = arg;
+		ARG_DEF(struct pwc_whitebalance, wb)
 
-		memset(wb, 0, sizeof(*wb));
-		wb->mode = pwc_get_awb(pdev);
-		if (wb->mode < 0)
+		memset(ARGA(wb), 0, sizeof(struct pwc_whitebalance));
+		ARGR(wb).mode = pwc_get_awb(pdev);
+		if (ARGR(wb).mode < 0)
 			ret = -EINVAL;
 		else {
-			if (wb->mode == PWC_WB_MANUAL) {
-				wb->manual_red = pwc_get_red_gain(pdev);
-				wb->manual_blue = pwc_get_blue_gain(pdev);
+			if (ARGR(wb).mode == PWC_WB_MANUAL) {
+				ret = pwc_get_red_gain(pdev, &ARGR(wb).manual_red);
+				if (ret < 0)
+					break;
+				ret = pwc_get_blue_gain(pdev, &ARGR(wb).manual_blue);
+				if (ret < 0)
+					break;
 			}
-			if (wb->mode == PWC_WB_AUTO) {
-				wb->read_red = pwc_read_red_gain(pdev);
-				wb->read_blue = pwc_read_blue_gain(pdev);
+			if (ARGR(wb).mode == PWC_WB_AUTO) {
+				ret = pwc_read_red_gain(pdev, &ARGR(wb).read_red);
+				if (ret < 0)
+					break;
+ 				ret =pwc_read_blue_gain(pdev, &ARGR(wb).read_blue);
+ 				if (ret < 0)
+ 					break;
 			}
 		}
+		ARG_OUT(wb)
 		break;
 	}
 	
 	case VIDIOCPWCSAWBSPEED:
 	{
-		struct pwc_wb_speed *wbs = arg;
+		ARG_DEF(struct pwc_wb_speed, wbs)
 		
-		if (wbs->control_speed > 0) {
-			ret = pwc_set_wb_speed(pdev, wbs->control_speed);
+		if (ARGR(wbs).control_speed > 0) {
+			ret = pwc_set_wb_speed(pdev, ARGR(wbs).control_speed);
 		}
-		if (wbs->control_delay > 0) {
-			ret = pwc_set_wb_delay(pdev, wbs->control_delay);
+		if (ARGR(wbs).control_delay > 0) {
+			ret = pwc_set_wb_delay(pdev, ARGR(wbs).control_delay);
 		}
 		break;
 	}
 	
 	case VIDIOCPWCGAWBSPEED:
 	{
-		struct pwc_wb_speed *wbs = arg;
+		ARG_DEF(struct pwc_wb_speed, wbs)
 		
-		ret = pwc_get_wb_speed(pdev);
+		ret = pwc_get_wb_speed(pdev, &ARGR(wbs).control_speed);
 		if (ret < 0)
 			break;
-		wbs->control_speed = ret;
-		ret = pwc_get_wb_delay(pdev);
+		ret = pwc_get_wb_delay(pdev, &ARGR(wbs).control_delay);
 		if (ret < 0)
 			break;
-		wbs->control_delay = ret;
+		ARG_OUT(wbs)
 		break;
 	}
 
         case VIDIOCPWCSLED:
 	{
-		struct pwc_leds *leds = arg;
+		ARG_DEF(struct pwc_leds, leds)
 
-		ret = pwc_set_leds(pdev, leds->led_on, leds->led_off);
+		ARG_IN(leds)
+		ret = pwc_set_leds(pdev, ARGR(leds).led_on, ARGR(leds).led_off);
 	    	break;
 	}
 
 
 	case VIDIOCPWCGLED:
 	{
-		struct pwc_leds *leds = arg;
+		ARG_DEF(struct pwc_leds, leds)
 		
-		ret = pwc_get_leds(pdev, &leds->led_on, &leds->led_off); 
+		ret = pwc_get_leds(pdev, &ARGR(leds).led_on, &ARGR(leds).led_off);
+		ARG_OUT(leds)
 		break;
 	}
 
 	case VIDIOCPWCSCONTOUR:
 	{
-		int *contour = arg;
+		ARG_DEF(int, contour)
 
-		ret = pwc_set_contour(pdev, *contour);
+		ARG_IN(contour)
+		ret = pwc_set_contour(pdev, ARGR(contour));
 		break;
 	}
 			
 	case VIDIOCPWCGCONTOUR:
 	{
-		int *contour = arg;
+		ARG_DEF(int, contour)
 		
-		ret = pwc_get_contour(pdev, contour);
+		ret = pwc_get_contour(pdev, ARGA(contour));
+		ARG_OUT(contour)
 		break;
 	}
 	
 	case VIDIOCPWCSBACKLIGHT:
 	{
-		int *backlight = arg;
+		ARG_DEF(int, backlight)
 		
-		ret = pwc_set_backlight(pdev, *backlight);
+		ARG_IN(backlight)
+		ret = pwc_set_backlight(pdev, ARGR(backlight));
 		break;
 	}
 
 	case VIDIOCPWCGBACKLIGHT:
 	{
-		int *backlight = arg;
+		ARG_DEF(int, backlight)
 		
-		ret = pwc_get_backlight(pdev);
-		if (ret >= 0)
-			*backlight = ret;
+		ret = pwc_get_backlight(pdev, ARGA(backlight));
+		ARG_OUT(backlight)
 		break;
 	}
 	
 	case VIDIOCPWCSFLICKER:
 	{
-		int *flicker = arg;
+		ARG_DEF(int, flicker)
 		
-		ret = pwc_set_flicker(pdev, *flicker);
+		ARG_IN(flicker)
+		ret = pwc_set_flicker(pdev, ARGR(flicker));
 		break;
 	}
 
 	case VIDIOCPWCGFLICKER:
 	{
-		int *flicker = arg;
+		ARG_DEF(int, flicker)
 		
-		ret = pwc_get_flicker(pdev);
-		if (ret >= 0)
-			*flicker = ret;
+		ret = pwc_get_flicker(pdev, ARGA(flicker));
+		ARG_OUT(flicker)
 		break;
 	}
 	
 	case VIDIOCPWCSDYNNOISE:
 	{
-		int *dynnoise = arg;
+		ARG_DEF(int, dynnoise)
 		
-		ret = pwc_set_dynamic_noise(pdev, *dynnoise);
+		ARG_IN(dynnoise)
+		ret = pwc_set_dynamic_noise(pdev, ARGR(dynnoise));
 		break;
 	}
 	
 	case VIDIOCPWCGDYNNOISE:
 	{
-		int *dynnoise = arg;
+		ARG_DEF(int, dynnoise)
 
-		ret = pwc_get_dynamic_noise(pdev);
-		if (ret < 0)
-			break;
-		*dynnoise = ret;
+		ret = pwc_get_dynamic_noise(pdev, ARGA(dynnoise));
+		ARG_OUT(dynnoise);
 		break;
 	}
 
 	case VIDIOCPWCGREALSIZE:
 	{
-		struct pwc_imagesize *size = arg;
+		ARG_DEF(struct pwc_imagesize, size)
 		
-		size->width = pdev->image.x;
-		size->height = pdev->image.y;
+		ARGR(size).width = pdev->image.x;
+		ARGR(size).height = pdev->image.y;
+		ARG_OUT(size)
 		break;
  	}
  	
  	case VIDIOCPWCMPTRESET:
  	{
- 		int *flags = arg;
- 		
  		if (pdev->features & FEATURE_MOTOR_PANTILT)
  		{
-			ret = pwc_mpt_reset(pdev, *flags);
+	 		ARG_DEF(int, flags)
+
+ 			ARG_IN(flags)
+			ret = pwc_mpt_reset(pdev, ARGR(flags));
  			if (ret >= 0)
  			{
  				pdev->pan_angle = 0;
@@ -1582,11 +1506,15 @@ int pwc_ioctl(struct pwc_device *pdev, unsigned int cmd, void *arg)
  		}
  		break;		
  	}
+ 	
  	case VIDIOCPWCMPTGRANGE:
  	{
  		if (pdev->features & FEATURE_MOTOR_PANTILT)
  		{
- 			memcpy(arg, &pdev->angle_range, sizeof(struct pwc_mpt_range));
+ 			ARG_DEF(struct pwc_mpt_range, range)
+ 			
+ 			ARGR(range) = pdev->angle_range;
+ 			ARG_OUT(range)
  		}
  		else
  		{	
@@ -1597,23 +1525,25 @@ int pwc_ioctl(struct pwc_device *pdev, unsigned int cmd, void *arg)
  	
  	case VIDIOCPWCMPTSANGLE:
  	{
- 		struct pwc_mpt_angles *angles = arg;
  		int new_pan, new_tilt;
  		
  		if (pdev->features & FEATURE_MOTOR_PANTILT)
  		{
+	 		ARG_DEF(struct pwc_mpt_angles, angles)
+
+	 		ARG_IN(angles)
 			/* The camera can only set relative angles, so
 			   do some calculations when getting an absolute angle .
 			 */
-			if (angles->absolute)
+			if (ARGR(angles).absolute)
 			{
- 				new_pan  = angles->pan; 
- 				new_tilt = angles->tilt;
+ 				new_pan  = ARGR(angles).pan; 
+ 				new_tilt = ARGR(angles).tilt;
  			}
  			else
  			{
- 				new_pan  = pdev->pan_angle  + angles->pan;
- 				new_tilt = pdev->tilt_angle + angles->tilt;
+ 				new_pan  = pdev->pan_angle  + ARGR(angles).pan;
+ 				new_tilt = pdev->tilt_angle + ARGR(angles).tilt;
 			}
 			/* check absolute ranges */
 			if (new_pan  < pdev->angle_range.pan_min  ||
@@ -1649,17 +1579,19 @@ int pwc_ioctl(struct pwc_device *pdev, unsigned int cmd, void *arg)
  			ret = -ENXIO;
  		}
  		break;
- 	} 
- 	
+ 	}
+
  	case VIDIOCPWCMPTGANGLE:
  	{
- 		struct pwc_mpt_angles *angles = arg;
  		
  		if (pdev->features & FEATURE_MOTOR_PANTILT)
  		{
- 			angles->absolute = 1;
- 			angles->pan  = pdev->pan_angle;
- 			angles->tilt = pdev->tilt_angle;
+	 		ARG_DEF(struct pwc_mpt_angles, angles)
+
+ 			ARGR(angles).absolute = 1;
+ 			ARGR(angles).pan  = pdev->pan_angle;
+ 			ARGR(angles).tilt = pdev->tilt_angle;
+ 			ARG_OUT(angles)
  		}
  		else
  		{
@@ -1670,19 +1602,34 @@ int pwc_ioctl(struct pwc_device *pdev, unsigned int cmd, void *arg)
  
  	case VIDIOCPWCMPTSTATUS:
  	{
- 		struct pwc_mpt_status *status = arg;
- 	
  		if (pdev->features & FEATURE_MOTOR_PANTILT)
  		{
- 			ret = pwc_mpt_get_status(pdev, status);
+ 			ARG_DEF(struct pwc_mpt_status, status)
+ 			
+ 			ret = pwc_mpt_get_status(pdev, ARGA(status));
+ 			ARG_OUT(status)
  		}
  		else
  		{
  			ret = -ENXIO;
  		}
-  		break;
-  	}
-  	
+ 		break;
+	}
+
+	case VIDIOCPWCGVIDCMD:
+	{
+		ARG_DEF(struct pwc_video_command, cmd);
+		
+                ARGR(cmd).type = pdev->type;
+		ARGR(cmd).release = pdev->release;
+		ARGR(cmd).command_len = pdev->cmd_len;
+		memcpy(&ARGR(cmd).command_buf, pdev->cmd_buf, pdev->cmd_len);
+		ARGR(cmd).bandlength = pdev->vbandlength;
+		ARGR(cmd).frame_size = pdev->frame_size;
+		ARG_OUT(cmd)
+		break;
+	}
+
 	default:
 		ret = -ENOIOCTLCMD;
 		break;
diff --git a/drivers/usb/media/pwc-if.c b/drivers/usb/media/pwc-if.c
index aea703bed..f3a70b2d0 100644
--- a/drivers/usb/media/pwc-if.c
+++ b/drivers/usb/media/pwc-if.c
@@ -1,6 +1,6 @@
-/* Linux driver for Philips webcam 
+/* Linux driver for Philips webcam
    USB and Video4Linux interface part.
-   (C) 1999-2003 Nemosoft Unv.
+   (C) 1999-2004 Nemosoft Unv.
 
    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
@@ -42,7 +42,7 @@
    - Alistar Moire: QuickCam 3000 Pro device/product ID
    - Tony Hoyle: Creative Labs Webcam 5 device/product ID
    - Mark Burazin: solving hang in VIDIOCSYNC when camera gets unplugged
-   - Jk Fang: SOTEC Afina Eye ID
+   - Jk Fang: Sotec Afina Eye ID
    - Xavier Roche: QuickCam Pro 4000 ID
    - Jens Knudsen: QuickCam Zoom ID
    - J. Debert: QuickCam for Notebooks ID
@@ -90,6 +90,7 @@ static struct usb_device_id pwc_device_table [] = {
 	{ USB_DEVICE(0x041E, 0x400C) }, /* Creative Webcam 5 */
 	{ USB_DEVICE(0x041E, 0x4011) }, /* Creative Webcam Pro Ex */
 	{ USB_DEVICE(0x04CC, 0x8116) }, /* Afina Eye */
+	{ USB_DEVICE(0x06BE, 0x8116) }, /* new Afina Eye */
 	{ USB_DEVICE(0x0d81, 0x1910) }, /* Visionite */
 	{ USB_DEVICE(0x0d81, 0x1900) },
 	{ }
@@ -129,7 +130,7 @@ static struct {
 
 static int pwc_video_open(struct inode *inode, struct file *file);
 static int pwc_video_close(struct inode *inode, struct file *file);
-static ssize_t pwc_video_read(struct file *file, char *buf,
+static ssize_t pwc_video_read(struct file *file, char __user *buf,
 			  size_t count, loff_t *ppos);
 static unsigned int pwc_video_poll(struct file *file, poll_table *wait);
 static int  pwc_video_ioctl(struct inode *inode, struct file *file,
@@ -151,7 +152,9 @@ static struct video_device pwc_template = {
 	.name =		"Philips Webcam",	/* Filled in later */
 	.type =		VID_TYPE_CAPTURE,
 	.hardware =	VID_HARDWARE_PWC,
+	.release =	video_device_release,
 	.fops =         &pwc_fops,
+	.minor =        -1,
 };
 
 /***************************************************************************/
@@ -258,7 +261,7 @@ static int pwc_allocate_buffers(struct pwc_device *pdev)
 		return -ENXIO;
 	}
 #endif	
-	/* Allocate Isochronous pipe buffers */
+	/* Allocate Isochronuous pipe buffers */
 	for (i = 0; i < MAX_ISO_BUFS; i++) {
 		if (pdev->sbuf[i].data == NULL) {
 			kbuf = kmalloc(ISO_BUFFER_SIZE, GFP_KERNEL);
@@ -443,7 +446,7 @@ static inline int pwc_next_fill_frame(struct pwc_device *pdev)
 {
 	int ret;
 	unsigned long flags;
-	
+
 	ret = 0;
 	spin_lock_irqsave(&pdev->ptrlock, flags);
 	if (pdev->fill_frame != NULL) {
@@ -488,7 +491,7 @@ static inline int pwc_next_fill_frame(struct pwc_device *pdev)
 
 /**
   \brief Reset all buffers, pointers and lists, except for the image_used[] buffer.
-  
+
   If the image_used[] buffer is cleared too, mmap()/VIDIOCSYNC will run into trouble.
  */
 static void pwc_reset_buffers(struct pwc_device *pdev)
@@ -525,7 +528,7 @@ static int pwc_handle_frame(struct pwc_device *pdev)
 {
 	int ret = 0;
 	unsigned long flags;
-	
+
 	spin_lock_irqsave(&pdev->ptrlock, flags);
 	/* First grab our read_frame; this is removed from all lists, so
 	   we can release the lock after this without problems */
@@ -548,7 +551,7 @@ static int pwc_handle_frame(struct pwc_device *pdev)
 			Trace(TRACE_SEQUENCE, "Decompressing frame %d\n", pdev->read_frame->sequence);
 #endif
 			/* Decompression is a lenghty process, so it's outside of the lock.
-			   This gives the isoc_handler the opportunity to fill more frames 
+			   This gives the isoc_handler the opportunity to fill more frames
 			   in the mean time.
 			*/
 			spin_unlock_irqrestore(&pdev->ptrlock, flags);
@@ -590,7 +593,8 @@ static void pwc_isoc_handler(struct urb *urb, struct pt_regs *regs)
 	int i, fst, flen;
 	int awake;
 	struct pwc_frame_buf *fbuf;
-	unsigned char *fillptr = 0, *iso_buf = 0;
+	unsigned char *fillptr = NULL;
+	unsigned char *iso_buf = NULL;
 
 	awake = 0;
 	pdev = (struct pwc_device *)urb->context;
@@ -643,7 +647,7 @@ static void pwc_isoc_handler(struct urb *urb, struct pt_regs *regs)
 	else {
 		fillptr = fbuf->data + fbuf->filled;
 	}
-	
+
 	/* Reset ISOC error counter. We did get here, after all. */
 	pdev->visoc_errors = 0;
 
@@ -662,8 +666,8 @@ static void pwc_isoc_handler(struct urb *urb, struct pt_regs *regs)
 					pdev->vsync = 2;
 
 					/* ...copy data to frame buffer, if possible */
-					if (flen + fbuf->filled > pdev->frame_size) {
-						Trace(TRACE_FLOW, "Frame buffer overflow (flen = %d, frame_size = %d).\n", flen, pdev->frame_size);
+					if (flen + fbuf->filled > pdev->frame_total_size) {
+						Trace(TRACE_FLOW, "Frame buffer overflow (flen = %d, frame_total_size = %d).\n", flen, pdev->frame_total_size);
 						pdev->vsync = 0; /* Hmm, let's wait for an EOF (end-of-frame) */
 						pdev->vframes_error++;
 					}
@@ -728,7 +732,7 @@ static void pwc_isoc_handler(struct urb *urb, struct pt_regs *regs)
 						pdev->drop_frames--;
 					else {
 						/* Check for underflow first */
-						if (fbuf->filled < pdev->frame_size) {
+						if (fbuf->filled < pdev->frame_total_size) {
 							Trace(TRACE_FLOW, "Frame buffer underflow (%d bytes); discarded.\n", fbuf->filled);
 							pdev->vframes_error++;
 						}
@@ -817,7 +821,7 @@ static int pwc_isoc_init(struct pwc_device *pdev)
 	
 	if (pdev->vmax_packet_size < 0 || pdev->vmax_packet_size > ISO_MAX_FRAME_SIZE) {
 		Err("Failed to find packet size for video endpoint in current alternate setting.\n");
-		return -ENFILE; /* Odd error, that should be noticeable */
+		return -ENFILE; /* Odd error, that should be noticable */
 	}
 
 	/* Set alternate interface */
@@ -874,7 +878,7 @@ static int pwc_isoc_init(struct pwc_device *pdev)
 		if (ret)
 			Err("isoc_init() submit_urb %d failed with error %d\n", i, ret);
 		else
-			Trace(TRACE_OPEN, "URB 0x%p submitted.\n", pdev->sbuf[i].urb);
+			Trace(TRACE_MEMORY, "URB 0x%p submitted.\n", pdev->sbuf[i].urb);
 	}
 
 	/* All is done... */
@@ -886,7 +890,7 @@ static int pwc_isoc_init(struct pwc_device *pdev)
 static void pwc_isoc_cleanup(struct pwc_device *pdev)
 {
 	int i;
-	
+
 	Trace(TRACE_OPEN, ">> pwc_isoc_cleanup()\n");
 	if (pdev == NULL)
 		return;
@@ -937,9 +941,9 @@ int pwc_try_video_mode(struct pwc_device *pdev, int width, int height, int new_f
 		        Trace(TRACE_FLOW, "pwc_set_video_mode attempt 2 failed.\n");
 		}
 	}
-	if (start == 0) 
+	if (start == 0)
 	{
-		if (pwc_isoc_init(pdev) < 0) 
+		if (pwc_isoc_init(pdev) < 0)
 		{
 			Info("Failed to restart ISOC transfers in pwc_try_video_mode.\n");
 			ret = -EAGAIN; /* let's try again, who knows if it works a second time */
@@ -972,27 +976,31 @@ static int pwc_video_open(struct inode *inode, struct file *file)
 		Trace(TRACE_OPEN, "Doing first time initialization.\n");
 		pdev->usb_init = 1;
 		
-		if (pwc_trace & TRACE_OPEN) {
+		if (pwc_trace & TRACE_OPEN)
+		{
 			/* Query sensor type */
 			const char *sensor_type = NULL;
+			int ret;
 
-			i = pwc_get_cmos_sensor(pdev);
-			switch(i) {
-			case -1: /* Unknown, show nothing */; break;
-			case 0x00:  sensor_type = "Hyundai CMOS sensor"; break;
-			case 0x20:  sensor_type = "Sony CCD sensor + TDA8787"; break;
-			case 0x2E:  sensor_type = "Sony CCD sensor + Exas 98L59"; break;
-			case 0x2F:  sensor_type = "Sony CCD sensor + ADI 9804"; break;
-			case 0x30:  sensor_type = "Sharp CCD sensor + TDA8787"; break;
-			case 0x3E:  sensor_type = "Sharp CCD sensor + Exas 98L59"; break;
-			case 0x3F:  sensor_type = "Sharp CCD sensor + ADI 9804"; break;
-			case 0x40:  sensor_type = "UPA 1021 sensor"; break;
-			case 0x100: sensor_type = "VGA sensor"; break;
-			case 0x101: sensor_type = "PAL MR sensor"; break;
-			default:    sensor_type = "unknown type of sensor"; break;
+			ret = pwc_get_cmos_sensor(pdev, &i);
+			if (ret >= 0)
+			{
+				switch(i) {
+				case 0x00:  sensor_type = "Hyundai CMOS sensor"; break;
+				case 0x20:  sensor_type = "Sony CCD sensor + TDA8787"; break;
+				case 0x2E:  sensor_type = "Sony CCD sensor + Exas 98L59"; break;
+				case 0x2F:  sensor_type = "Sony CCD sensor + ADI 9804"; break;
+				case 0x30:  sensor_type = "Sharp CCD sensor + TDA8787"; break;
+				case 0x3E:  sensor_type = "Sharp CCD sensor + Exas 98L59"; break;
+				case 0x3F:  sensor_type = "Sharp CCD sensor + ADI 9804"; break;
+				case 0x40:  sensor_type = "UPA 1021 sensor"; break;
+				case 0x100: sensor_type = "VGA sensor"; break;
+				case 0x101: sensor_type = "PAL MR sensor"; break;
+				default:    sensor_type = "unknown type of sensor"; break;
+				}
 			}
 			if (sensor_type != NULL)
-				Info("This %s camera is equipped with a %s (%d).\n", pdev->vdev.name, sensor_type, i);
+				Info("This %s camera is equipped with a %s (%d).\n", pdev->vdev->name, sensor_type, i);
 		}
 	}
 
@@ -1037,6 +1045,7 @@ static int pwc_video_open(struct inode *inode, struct file *file)
 
 	/* Set some defaults */
 	pdev->vsnapshot = 0;
+
 	/* Start iso pipe for video; first try the last used video size
 	   (or the default one); if that fails try QCIF/10 or QSIF/10;
 	   it that fails too, give up.
@@ -1090,7 +1099,7 @@ static int pwc_video_close(struct inode *inode, struct file *file)
 
 	/* Dump statistics, but only if a reasonable amount of frames were
 	   processed (to prevent endless log-entries in case of snap-shot
-	   programs) 
+	   programs)
 	 */
 	if (pdev->vframe_count > 20)
 		Info("Closing video device: %d frames received, dumped %d frames, %d frames with errors.\n", pdev->vframe_count, pdev->vframes_dumped, pdev->vframes_error);
@@ -1111,7 +1120,7 @@ static int pwc_video_close(struct inode *inode, struct file *file)
 			Info("Failed to set LED on/off time.\n");
 		if (power_save) {
 			i = pwc_camera_power(pdev, 0);
-			if (i < 0) 
+			if (i < 0)
 				Err("Failed to power down camera (%d)\n", i);
 		}
 	}
@@ -1132,15 +1141,16 @@ static int pwc_video_close(struct inode *inode, struct file *file)
                 device is tricky anyhow.
  */
 
-static ssize_t pwc_video_read(struct file *file, char *buf,
+static ssize_t pwc_video_read(struct file *file, char __user *buf,
 			  size_t count, loff_t *ppos)
 {
 	struct video_device *vdev = file->private_data;
 	struct pwc_device *pdev;
 	int noblock = file->f_flags & O_NONBLOCK;
 	DECLARE_WAITQUEUE(wait, current);
+        int bytes_to_read;
 
-	Trace(TRACE_READ, "video_read(0x%p, %p, %d) called.\n", vdev, buf, count);
+	Trace(TRACE_READ, "video_read(0x%p, %p, %zd) called.\n", vdev, buf, count);
 	if (vdev == NULL)
 		return -EFAULT;
 	pdev = vdev->priv;
@@ -1175,20 +1185,25 @@ static ssize_t pwc_video_read(struct file *file, char *buf,
 		}
 		remove_wait_queue(&pdev->frameq, &wait);
 		set_current_state(TASK_RUNNING);
-	                                                                                                                                                                                
+                                                                                                                                                                                
 		/* Decompress and release frame */
 		if (pwc_handle_frame(pdev))
 			return -EFAULT;
 	}
 
 	Trace(TRACE_READ, "Copying data to user space.\n");
+	if (pdev->vpalette == VIDEO_PALETTE_RAW)
+		bytes_to_read = pdev->frame_size;
+	else
+ 		bytes_to_read = pdev->view.size;
+
 	/* copy bytes to user space; we allow for partial reads */
-	if (count + pdev->image_read_pos > pdev->view.size)
-		count = pdev->view.size - pdev->image_read_pos;
+	if (count + pdev->image_read_pos > bytes_to_read)
+		count = bytes_to_read - pdev->image_read_pos;
 	if (copy_to_user(buf, pdev->image_ptr[pdev->fill_image] + pdev->image_read_pos, count))
 		return -EFAULT;
 	pdev->image_read_pos += count;
-	if (pdev->image_read_pos >= pdev->view.size) { /* All data has been read */
+	if (pdev->image_read_pos >= bytes_to_read) { /* All data has been read */
 		pdev->image_read_pos = 0;
 		pwc_next_image(pdev);
 	}
@@ -1260,7 +1275,7 @@ static int pwc_video_do_ioctl(struct inode *inode, struct file *file,
 		}
 
 		case VIDIOCSCHAN:
-		{	
+		{
 			/* The spec says the argument is an integer, but
 			   the bttv driver uses a video_channel arg, which
 			   makes sense becasue it also has the norm flag.
@@ -1278,8 +1293,6 @@ static int pwc_video_do_ioctl(struct inode *inode, struct file *file,
 			struct video_picture *p = arg;
 			int val;
 
-			p->colour = 0x8000;
-			p->hue = 0x8000;
 			val = pwc_get_brightness(pdev);
 			if (val >= 0)
 				p->brightness = val;
@@ -1302,11 +1315,11 @@ static int pwc_video_do_ioctl(struct inode *inode, struct file *file,
 			else
 				p->colour = 0xffff;
 			p->depth = 24;
-			p->palette = VIDEO_PALETTE_YUV420P;
+			p->palette = pdev->vpalette;
 			p->hue = 0xFFFF; /* N/A */
 			break;
 		}
-		
+
 		case VIDIOCSPICT:
 		{
 			struct video_picture *p = arg;
@@ -1318,13 +1331,22 @@ static int pwc_video_do_ioctl(struct inode *inode, struct file *file,
 			                is used exactly once in the uncompress
 			                routine.
 			 */
-			if (p->palette && p->palette != VIDEO_PALETTE_YUV420P) {
-				return -EINVAL;
-			}
 			pwc_set_brightness(pdev, p->brightness);
 			pwc_set_contrast(pdev, p->contrast);
 			pwc_set_gamma(pdev, p->whiteness);
 			pwc_set_saturation(pdev, p->colour);
+			if (p->palette && p->palette != pdev->vpalette) {
+				switch (p->palette) {
+					case VIDEO_PALETTE_YUV420P:
+					case VIDEO_PALETTE_RAW:
+						pdev->vpalette = p->palette;
+						return pwc_try_video_mode(pdev, pdev->image.x, pdev->image.y, pdev->vframes, pdev->vcompression, pdev->vsnapshot);
+						break;
+					default:
+						return -EINVAL;
+						break;
+				}
+			}
 			break;
 		}
 
@@ -1398,13 +1420,23 @@ static int pwc_video_do_ioctl(struct inode *inode, struct file *file,
 			   various palettes... The driver doesn't support
 			   such small images, so I'm working around it.
 			 */
-			if (vm->format && vm->format != VIDEO_PALETTE_YUV420P)
-				return -EINVAL;
-			 
+			if (vm->format)
+			{
+				switch (vm->format)
+				{
+					case VIDEO_PALETTE_YUV420P:
+					case VIDEO_PALETTE_RAW:
+						break;
+					default:
+						return -EINVAL;
+						break;
+				}
+			}
+
 			if ((vm->width != pdev->view.x || vm->height != pdev->view.y) &&
 			    (vm->width >= pdev->view_min.x && vm->height >= pdev->view_min.y)) {
 				int ret;
-				
+
 				Trace(TRACE_OPEN, "VIDIOCMCAPTURE: changing size to please xawtv :-(.\n");
 				ret = pwc_try_video_mode(pdev, vm->width, vm->height, pdev->vframes, pdev->vcompression, pdev->vsnapshot);
 				if (ret)
@@ -1523,7 +1555,7 @@ static int pwc_video_do_ioctl(struct inode *inode, struct file *file,
 		{
 			struct video_unit *vu = arg;
 			
-			vu->video = pdev->vdev.minor & 0x3F;
+			vu->video = pdev->vdev->minor & 0x3F;
 			vu->audio = -1; /* not known yet */
 			vu->vbi = -1;
 			vu->radio = -1;
@@ -1636,12 +1668,12 @@ static int usb_pwc_probe(struct usb_interface *intf, const struct usb_device_id
 			type_id = 690;
 			break;
 		case 0x0310:
-			Info("Philips PCVC730K (ToUCam Fun) USB webcam detected.\n");
+			Info("Philips PCVC730K (ToUCam Fun)/PCVC830 (ToUCam II) USB webcam detected.\n");
 			name = "Philips 730 webcam";
 			type_id = 730;
 			break;
 		case 0x0311:
-			Info("Philips PCVC740K (ToUCam Pro) USB webcam detected.\n");
+			Info("Philips PCVC740K (ToUCam Pro)/PCVC840 (ToUCam II) USB webcam detected.\n");
 			name = "Philips 740 webcam";
 			type_id = 740;
 			break;
@@ -1755,17 +1787,44 @@ static int usb_pwc_probe(struct usb_interface *intf, const struct usb_device_id
 			break;
 		}
 	}
-	else if (vendor_id == 0x04cc) { 
+	else if (vendor_id == 0x04cc) {
 		switch(product_id) {
 		case 0x8116:
 			Info("Sotec Afina Eye USB webcam detected.\n");
 			name = "Sotec Afina Eye";
 			type_id = 730;
-			break;  
+			break;
+		default:
+			return -ENODEV;
+			break;
+		}
+	}
+	else if (vendor_id == 0x06be) {
+		switch(product_id) {
+		case 0x8116:
+			/* Basicly the same as the Sotec Afina Eye */                
+			Info("AME CU-001 USB webcam detected.\n");
+			name = "AME CU-001";
+			type_id = 730;
+			break;
+		default:
+			return -ENODEV;
+			break;
+		}
+	}
+	else if (vendor_id == 0x06be) {
+		switch(product_id) {
+		case 0x8116:
+			/* This is essentially the same cam as the Sotec Afina Eye */
+			Info("AME Co. Afina Eye USB webcam detected.\n");
+			name = "AME Co. Afina Eye";
+			type_id = 750;
+			break;
 		default:
 			return -ENODEV;
 			break;
 		}
+	
 	}
 	else if (vendor_id == 0x0d81) {
 		switch(product_id) {
@@ -1804,6 +1863,7 @@ static int usb_pwc_probe(struct usb_interface *intf, const struct usb_device_id
 	pdev->type = type_id;
 	pdev->vsize = default_size;
 	pdev->vframes = default_fps;
+	strcpy(pdev->serial, serial_number);
 	pdev->features = features;
 	if (vendor_id == 0x046D && product_id == 0x08B5)
 	{
@@ -1815,8 +1875,6 @@ static int usb_pwc_probe(struct usb_interface *intf, const struct usb_device_id
 		pdev->angle_range.pan_max  =  7000;
 		pdev->angle_range.tilt_min = -3000;
 		pdev->angle_range.tilt_max =  2500;
-		pdev->angle_range.zoom_min = -1;
-		pdev->angle_range.zoom_max = -1;
 	}
 
 	init_MUTEX(&pdev->modlock);
@@ -1826,11 +1884,19 @@ static int usb_pwc_probe(struct usb_interface *intf, const struct usb_device_id
 	init_waitqueue_head(&pdev->frameq);
 	pdev->vcompression = pwc_preferred_compression;
 
-	memcpy(&pdev->vdev, &pwc_template, sizeof(pwc_template));
-	strcpy(pdev->vdev.name, name);
-	pdev->vdev.owner = THIS_MODULE;
-	pdev->vdev.priv = pdev;
-	
+	/* Allocate video_device structure */
+	pdev->vdev = video_device_alloc();
+	if (pdev->vdev == 0)
+	{
+		Err("Err, cannot allocate video_device struture. Failing probe.");
+		kfree(pdev);
+		return -ENOMEM;
+	}
+	memcpy(pdev->vdev, &pwc_template, sizeof(pwc_template));
+	strcpy(pdev->vdev->name, name);
+	pdev->vdev->owner = THIS_MODULE;
+	video_set_drvdata(pdev->vdev, pdev);
+
 	pdev->release = udev->descriptor.bcdDevice;
 	Trace(TRACE_PROBE, "Release: %04x\n", pdev->release);
 
@@ -1848,15 +1914,16 @@ static int usb_pwc_probe(struct usb_interface *intf, const struct usb_device_id
 		}
 	}
 
-	pdev->vdev.release = video_device_release;
-	i = video_register_device(&pdev->vdev, VFL_TYPE_GRABBER, video_nr);
+	pdev->vdev->release = video_device_release;
+	i = video_register_device(pdev->vdev, VFL_TYPE_GRABBER, video_nr);
 	if (i < 0) {
 		Err("Failed to register as video device (%d).\n", i);
+		video_device_release(pdev->vdev); /* Drip... drip... drip... */
 		kfree(pdev); /* Oops, no memory leaks please */
 		return -EIO;
 	}
 	else {
-		Info("Registered as /dev/video%d.\n", pdev->vdev.minor & 0x3F);
+		Info("Registered as /dev/video%d.\n", pdev->vdev->minor & 0x3F);
 	}
 
 	/* occupy slot */
@@ -1894,14 +1961,14 @@ static void usb_pwc_disconnect(struct usb_interface *intf)
 		Err("pwc_disconnect() Magic number failed. Consult your scrolls and try again.\n");
 		goto disconnect_out;
 	}
-#endif	
+#endif
 	
 	/* We got unplugged; this is signalled by an EPIPE error code */
 	if (pdev->vopen) {
 		Info("Disconnected while webcam is in use!\n");
 		pdev->error_status = EPIPE;
 	}
-	
+
 	/* Alert waiting processes */
 	wake_up_interruptible(&pdev->frameq);
 	/* Wait until device is closed */
@@ -1909,7 +1976,7 @@ static void usb_pwc_disconnect(struct usb_interface *intf)
 		schedule();
 	/* Device is now closed, so we can safely unregister it */
 	Trace(TRACE_PROBE, "Unregistering video device in disconnect().\n");
-	video_unregister_device(&pdev->vdev); 
+	video_unregister_device(pdev->vdev);
 
 	/* Free memory (don't set pdev to 0 just yet) */
 	kfree(pdev);
@@ -1928,7 +1995,7 @@ disconnect_out:
 static int pwc_atoi(const char *s)
 {
 	int k = 0;
-	
+
 	k = 0;
 	while (*s != '\0' && *s >= '0' && *s <= '9') {
 		k = 10 * k + (*s - '0');
@@ -1971,7 +2038,7 @@ MODULE_PARM(dev_hint, "0-20s");
 MODULE_PARM_DESC(dev_hint, "Device node hints");
 
 MODULE_DESCRIPTION("Philips & OEM USB webcam driver");
-MODULE_AUTHOR("Nemosoft Unv. <nemosoft@smcc.demon.nl>");
+MODULE_AUTHOR("Nemosoft Unv. <webcam@smcc.demon.nl>");
 MODULE_LICENSE("GPL");
 
 static int __init usb_pwc_init(void)
@@ -1979,9 +2046,10 @@ static int __init usb_pwc_init(void)
 	int i, sz;
 	char *sizenames[PSZ_MAX] = { "sqcif", "qsif", "qcif", "sif", "cif", "vga" };
 
-	Info("Philips PCA645/646 + PCVC675/680/690 + PCVC730/740/750 webcam module version " PWC_VERSION " loaded.\n");
-	Info("Also supports the Askey VC010, various Logitech QuickCams, Samsung MPC-C10 and MPC-C30,\n");
-	Info("the Creative WebCam 5, SOTEC Afina Eye and Visionite VCS-UC300 and VCS-UM100.\n");
+	Info("Philips webcam module version " PWC_VERSION " loaded.\n");
+	Info("Supports Philips PCA645/646, PCVC675/680/690, PCVC720[40]/730/740/750 & PCVC830/840.\n");
+	Info("Also supports the Askey VC010, various Logitech Quickcams, Samsung MPC-C10 and MPC-C30,\n");
+	Info("the Creative WebCam 5 & Pro Ex, SOTEC Afina Eye and Visionite VCS-UC300 and VCS-UM100.\n");
 
 	if (fps) {
 		if (fps < 4 || fps > 30) {
@@ -1991,7 +2059,7 @@ static int __init usb_pwc_init(void)
 		default_fps = fps;
 		Info("Default framerate set to %d.\n", default_fps);
 	}
-	
+
 	if (size) {
 		/* string; try matching with array */
 		for (sz = 0; sz < PSZ_MAX; sz++) {
@@ -2041,12 +2109,12 @@ static int __init usb_pwc_init(void)
 	if (leds[1] >= 0)
 		led_off = leds[1];
 
-	/* Big device node whoopla. Basically, it allows you to assign a 
-	   device node (/dev/videoX) to a camera, based on its type 
+	/* Big device node whoopla. Basicly, it allows you to assign a
+	   device node (/dev/videoX) to a camera, based on its type
 	   & serial number. The format is [type[.serialnumber]:]node.
 
-           Any camera that isn't matched by these rules gets the next 
-           available free device node.
+	   Any camera that isn't matched by these rules gets the next
+	   available free device node.
 	 */
 	for (i = 0; i < MAX_DEV_HINTS; i++) {
 		char *s, *colon, *dot;
diff --git a/drivers/usb/media/pwc-ioctl.h b/drivers/usb/media/pwc-ioctl.h
index 01619869f..2535a3c38 100644
--- a/drivers/usb/media/pwc-ioctl.h
+++ b/drivers/usb/media/pwc-ioctl.h
@@ -1,8 +1,8 @@
 #ifndef PWC_IOCTL_H
 #define PWC_IOCTL_H
 
-/* (C) 2001-2003 Nemosoft Unv.    webcam@smcc.demon.nl
-   
+/* (C) 2001-2004 Nemosoft Unv.    webcam@smcc.demon.nl
+
    This program is free software; you can redistribute it and/or modify
    it under the terms of the GNU General Public License as published by
    the Free Software Foundation; either version 2 of the License, or
@@ -18,19 +18,24 @@
    Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA
 */
 
-/*         This is pwc-ioctl.h belonging to PWC 8.10                        */
+/* This is pwc-ioctl.h belonging to PWC 8.12.1
+   It contains structures and defines to communicate from user space
+   directly to the driver.
+ */
 
-/* 
+/*
    Changes
-   2001/08/03  Alvarado   Added ioctl constants to access methods for 
+   2001/08/03  Alvarado   Added ioctl constants to access methods for
                           changing white balance and red/blue gains
    2002/12/15  G. H. Fernandez-Toribio   VIDIOCGREALSIZE
+   2003/12/13  Nemosft Unv. Some modifications to make interfacing to
+               PWCX easier
  */
 
 /* These are private ioctl() commands, specific for the Philips webcams.
    They contain functions not found in other webcams, and settings not
-   specified in the Video4Linux API. 
-   
+   specified in the Video4Linux API.
+
    The #define names are built up like follows:
    VIDIOC		VIDeo IOCtl prefix
          PWC		Philps WebCam
@@ -40,13 +45,21 @@
  */
 
 
+ /* Enumeration of image sizes */
+#define PSZ_SQCIF	0x00
+#define PSZ_QSIF	0x01
+#define PSZ_QCIF	0x02
+#define PSZ_SIF		0x03
+#define PSZ_CIF		0x04
+#define PSZ_VGA		0x05
+#define PSZ_MAX		6
 
 
 /* The frame rate is encoded in the video_window.flags parameter using
    the upper 16 bits, since some flags are defined nowadays. The following
    defines provide a mask and shift to filter out this value.
-   
-   In 'Snapshot' mode the camera freezes its automatic exposure and colour 
+
+   In 'Snapshot' mode the camera freezes its automatic exposure and colour
    balance controls.
  */
 #define PWC_FPS_SHIFT		16
@@ -55,14 +68,26 @@
 #define PWC_FPS_SNAPSHOT	0x00400000
 
 
+/* structure for transfering x & y coordinates */
+struct pwc_coord
+{
+	int x, y;		/* guess what */
+	int size;		/* size, or offset */
+};
+
 
+/* Used with VIDIOCPWCPROBE */
 struct pwc_probe
 {
 	char name[32];
 	int type;
 };
 
-
+struct pwc_serial
+{
+	char serial[30];	/* String with serial number. Contains terminating 0 */
+};
+	
 /* pwc_whitebalance.mode values */
 #define PWC_WB_INDOOR		0
 #define PWC_WB_OUTDOOR		1
@@ -78,7 +103,6 @@ struct pwc_probe
    otherwise undefined.
    'read_red' and 'read_blue' are read-only.
 */   
-   
 struct pwc_whitebalance
 {
 	int mode;
@@ -117,7 +141,7 @@ struct pwc_imagesize
 #define PWC_MPT_TILT		0x02
 #define PWC_MPT_TIMEOUT		0x04 /* for status */
 
-/* Set angles; when absolute = 1, the angle is absolute and the 
+/* Set angles; when absolute != 0, the angle is absolute and the 
    driver calculates the relative offset for you. This can only
    be used with VIDIOCPWCSANGLE; VIDIOCPWCGANGLE always returns
    absolute angles.
@@ -127,18 +151,14 @@ struct pwc_mpt_angles
 	int absolute;		/* write-only */
 	int pan;		/* degrees * 100 */
 	int tilt;		/* degress * 100 */
-	int zoom;		/* N/A, set to -1 */
 };
 
 /* Range of angles of the camera, both horizontally and vertically.
-   The zoom is not used, maybe in the future...
-
  */
 struct pwc_mpt_range
 {
 	int pan_min, pan_max;		/* degrees * 100 */
 	int tilt_min, tilt_max;
-	int zoom_min, zoom_max;		/* -1, -1 */
 };
 
 struct pwc_mpt_status
@@ -149,6 +169,30 @@ struct pwc_mpt_status
 };
 
 
+/* This is used for out-of-kernel decompression. With it, you can get
+   all the necessary information to initialize and use the decompressor
+   routines in standalone applications.
+ */   
+struct pwc_video_command
+{
+	int type;		/* camera type (645, 675, 730, etc.) */
+	int release;		/* release number */
+
+        int size;		/* one of PSZ_* */
+        int alternate;
+	int command_len;	/* length of USB video command */
+	unsigned char command_buf[13];	/* Actual USB video command */
+	int bandlength;		/* >0 = compressed */
+	int frame_size;		/* Size of one (un)compressed frame */
+};
+
+/* Flags for PWCX subroutines. Not all modules honour all flags. */
+#define PWCX_FLAG_PLANAR	0x0001
+#define PWCX_FLAG_BAYER		0x0008
+
+
+/* IOCTL definitions */
+
  /* Restore user settings */
 #define VIDIOCPWCRUSER		_IO('v', 192)
  /* Save user settings */
@@ -169,16 +213,19 @@ struct pwc_mpt_status
 #define VIDIOCPWCGCQUAL		_IOR('v', 195, int)
 
 
+/* Retrieve serial number of camera */
+#define VIDIOCPWCGSERIAL	_IOR('v', 198, struct pwc_serial)
+
  /* This is a probe function; since so many devices are supported, it
     becomes difficult to include all the names in programs that want to
     check for the enhanced Philips stuff. So in stead, try this PROBE;
-    it returns a structure with the original name, and the corresponding 
+    it returns a structure with the original name, and the corresponding
     Philips type.
     To use, fill the structure with zeroes, call PROBE and if that succeeds,
     compare the name with that returned from VIDIOCGCAP; they should be the
     same. If so, you can be assured it is a Philips (OEM) cam and the type
     is valid.
- */    
+ */
 #define VIDIOCPWCPROBE		_IOR('v', 199, struct pwc_probe)
 
  /* Set AGC (Automatic Gain Control); int < 0 = auto, 0..65535 = fixed */
@@ -225,5 +272,8 @@ struct pwc_mpt_status
 #define VIDIOCPWCMPTSANGLE	_IOW('v', 212, struct pwc_mpt_angles)
 #define VIDIOCPWCMPTGANGLE	_IOR('v', 212, struct pwc_mpt_angles)
 #define VIDIOCPWCMPTSTATUS	_IOR('v', 213, struct pwc_mpt_status)
- 
+
+ /* Get the USB set-video command; needed for initializing libpwcx */
+#define VIDIOCPWCGVIDCMD	_IOR('v', 215, struct pwc_video_command)
+
 #endif
diff --git a/drivers/usb/media/pwc-misc.c b/drivers/usb/media/pwc-misc.c
index 500ddad7c..09f629da3 100644
--- a/drivers/usb/media/pwc-misc.c
+++ b/drivers/usb/media/pwc-misc.c
@@ -15,13 +15,13 @@
    You should have received a copy of the GNU General Public License
    along with this program; if not, write to the Free Software
    Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA
-*/  
+*/
 
 #include <linux/slab.h>
 
 #include "pwc.h"
 
-struct pwc_coord pwc_image_sizes[PSZ_MAX] = 
+struct pwc_coord pwc_image_sizes[PSZ_MAX] =
 {
 	{ 128,  96, 0 },
 	{ 160, 120, 0 },
@@ -36,11 +36,30 @@ int pwc_decode_size(struct pwc_device *pdev, int width, int height)
 {
 	int i, find;
 
-	/* Make sure we don't go beyond our max size */
-	if (width > pdev->view_max.x || height > pdev->view_max.y)
-		return -1;
+	/* Make sure we don't go beyond our max size.
+           NB: we have different limits for RAW and normal modes. In case
+           you don't have the decompressor loaded or use RAW mode, 
+           the maximum viewable size is smaller.
+        */
+	if (pdev->vpalette == VIDEO_PALETTE_RAW)
+	{
+		if (width > pdev->abs_max.x || height > pdev->abs_max.y)
+		{
+			Debug("VIDEO_PALETTE_RAW: going beyond abs_max.\n");
+                	return -1;
+                }
+	}
+	else
+	{
+		if (width > pdev->view_max.x || height > pdev->view_max.y)
+		{
+			Debug("VIDEO_PALETTE_ not RAW: going beyond view_max.\n");
+			return -1;
+		}
+	}
+
 	/* Find the largest size supported by the camera that fits into the
-	   requested size. 
+	   requested size.
 	 */
 	find = -1;
 	for (i = 0; i < PSZ_MAX; i++) {
@@ -62,6 +81,8 @@ void pwc_construct(struct pwc_device *pdev)
 		pdev->view_min.y =  96;
 		pdev->view_max.x = 352;
 		pdev->view_max.y = 288;
+                pdev->abs_max.x  = 352;
+                pdev->abs_max.y  = 288;
 		pdev->image_mask = 1 << PSZ_SQCIF | 1 << PSZ_QCIF | 1 << PSZ_CIF;
 		pdev->vcinterface = 2;
 		pdev->vendpoint = 4;
@@ -77,13 +98,14 @@ void pwc_construct(struct pwc_device *pdev)
 		if (pdev->decompressor != NULL) {
 			pdev->view_max.x = 640;
 			pdev->view_max.y = 480;
-			pdev->image_mask = 1 << PSZ_SQCIF | 1 << PSZ_QSIF | 1 << PSZ_QCIF | 1 << PSZ_SIF | 1 << PSZ_CIF | 1 << PSZ_VGA;
 		}
 		else {
 			pdev->view_max.x = 352;
 			pdev->view_max.y = 288;
-			pdev->image_mask = 1 << PSZ_SQCIF | 1 << PSZ_QSIF | 1 << PSZ_QCIF | 1 << PSZ_SIF | 1 << PSZ_CIF;
 		}
+		pdev->image_mask = 1 << PSZ_SQCIF | 1 << PSZ_QSIF | 1 << PSZ_QCIF | 1 << PSZ_SIF | 1 << PSZ_CIF | 1 << PSZ_VGA;
+                pdev->abs_max.x = 640;
+                pdev->abs_max.y = 480;
 		pdev->vcinterface = 3;
 		pdev->vendpoint = 4;
 		pdev->frame_header_size = 0;
@@ -99,24 +121,26 @@ void pwc_construct(struct pwc_device *pdev)
 		if (pdev->decompressor != NULL) {
 			pdev->view_max.x = 640;
 			pdev->view_max.y = 480;
-			pdev->image_mask = 1 << PSZ_QSIF | 1 << PSZ_SIF | 1 << PSZ_VGA;
 		}
 		else {
-			/* Tell CIF, even though SIF really is the maximum, but some tools really need CIF */
+			/* We use CIF, not SIF since some tools really need CIF. So we cheat a bit. */
 			pdev->view_max.x = 352;
 			pdev->view_max.y = 288;
-			pdev->image_mask = 1 << PSZ_QSIF | 1 << PSZ_SIF;
 		}
+		pdev->image_mask = 1 << PSZ_QSIF | 1 << PSZ_SIF | 1 << PSZ_VGA;
+                pdev->abs_max.x = 640;
+                pdev->abs_max.y = 480;
 		pdev->vcinterface = 3;
 		pdev->vendpoint = 5;
 		pdev->frame_header_size = TOUCAM_HEADER_SIZE;
 		pdev->frame_trailer_size = TOUCAM_TRAILER_SIZE;
 		break;
 	}
+	pdev->vpalette = VIDEO_PALETTE_YUV420P; /* default */
 	pdev->view_min.size = pdev->view_min.x * pdev->view_min.y;
 	pdev->view_max.size = pdev->view_max.x * pdev->view_max.y;
-	/* length of image, in YUV format */
-	pdev->len_per_image = (pdev->view_max.size * 3) / 2;
+	/* length of image, in YUV format; always allocate enough memory. */
+	pdev->len_per_image = (pdev->abs_max.x * pdev->abs_max.y * 3) / 2;
 }
 
 
diff --git a/drivers/usb/media/pwc-uncompress.c b/drivers/usb/media/pwc-uncompress.c
index 68b20ecc0..269cd227f 100644
--- a/drivers/usb/media/pwc-uncompress.c
+++ b/drivers/usb/media/pwc-uncompress.c
@@ -1,4 +1,4 @@
-/* Linux driver for Philips webcam 
+/* Linux driver for Philips webcam
    Decompression frontend.
    (C) 1999-2003 Nemosoft Unv. (webcam@smcc.demon.nl)
 
@@ -21,7 +21,9 @@
    themselves. It also has a decompressor wrapper function.
 */
 
+#include <asm/current.h>
 #include <asm/types.h>
+// #include <linux/sched.h>
 
 #include "pwc.h"
 #include "pwc-uncompress.h"
@@ -81,7 +83,6 @@ int pwc_decompress(struct pwc_device *pdev)
 	u16 *src;
 	u16 *dsty, *dstu, *dstv;
 
-	
 	if (pdev == NULL)
 		return -EFAULT;
 #if defined(__KERNEL__) && defined(PWC_MAGIC)
@@ -97,16 +98,24 @@ int pwc_decompress(struct pwc_device *pdev)
 	image = pdev->image_ptr[pdev->fill_image];
 	if (!image)
 		return -EFAULT;
-	
+
 	yuv = fbuf->data + pdev->frame_header_size;  /* Skip header */
-	if (pdev->vbandlength == 0) { 
+
+	/* Raw format; that's easy... */
+	if (pdev->vpalette == VIDEO_PALETTE_RAW)
+	{
+		memcpy(image, yuv, pdev->frame_size);
+		return 0;
+	}
+
+	if (pdev->vbandlength == 0) {
 		/* Uncompressed mode. We copy the data into the output buffer,
 		   using the viewport size (which may be larger than the image
 		   size). Unfortunately we have to do a bit of byte stuffing
 		   to get the desired output format/size.
 		 */
-			/* 
-			 * We do some byte shuffling here to go from the 
+			/*
+			 * We do some byte shuffling here to go from the
 			 * native format to YUV420P.
 			 */
 			src = (u16 *)yuv;
@@ -140,15 +149,21 @@ int pwc_decompress(struct pwc_device *pdev)
 					dstu += (stride >> 1);
 			}
 	}
-	else { 
-		/* Compressed; the decompressor routines will write the data 
+	else {
+		/* Compressed; the decompressor routines will write the data
 		   in planar format immediately.
 		 */
+		int flags;
+                
+                flags = PWCX_FLAG_PLANAR;
+                if (pdev->vsize == PSZ_VGA && pdev->vframes == 5 && pdev->vsnapshot)
+                	flags |= PWCX_FLAG_BAYER;
+
 		if (pdev->decompressor)
 			pdev->decompressor->decompress(
 				&pdev->image, &pdev->view, &pdev->offset,
 				yuv, image,
-				1,
+				flags,
 				pdev->decompress_data, pdev->vbandlength);
 		else
 			return -ENXIO; /* No such device or address: missing decompressor */
diff --git a/drivers/usb/media/pwc-uncompress.h b/drivers/usb/media/pwc-uncompress.h
index f9a437229..c3db3de8a 100644
--- a/drivers/usb/media/pwc-uncompress.h
+++ b/drivers/usb/media/pwc-uncompress.h
@@ -24,9 +24,15 @@
 #define PWC_UNCOMPRESS_H
 
 #include <linux/config.h>
+#include <linux/linkage.h>
 #include <linux/list.h>
 
-#include "pwc.h"
+#include "pwc-ioctl.h"
+
+/* from pwc-dec.h */
+#define PWCX_FLAG_PLANAR        0x0001
+/* */
+
 
 #ifdef __cplusplus
 extern "C" {
@@ -42,10 +48,11 @@ struct pwc_decompressor
 	int  type;		/* type of camera (645, 680, etc) */
 	int  table_size;	/* memory needed */
 
-	void (* init)(int release, void *buffer, void *table);	/* Initialization routine; should be called after each set_video_mode */
+	void (* init)(int type, int release, void *buffer, void *table);	/* Initialization routine; should be called after each set_video_mode */
 	void (* exit)(void);	/* Cleanup routine */
-	void (* decompress)(struct pwc_coord *image, struct pwc_coord *view, struct pwc_coord *offset,
-                            void *src, void *dst, int planar,
+	void (* decompress)(struct pwc_coord *image, struct pwc_coord *view,
+			    struct pwc_coord *offset,
+                            void *src, void *dst, int flags,
 	                    void *table, int bandlength);
 	void (* lock)(void);	/* make sure module cannot be unloaded */
 	void (* unlock)(void);	/* release lock on module */
diff --git a/drivers/usb/media/pwc.h b/drivers/usb/media/pwc.h
index 533053813..68143f435 100644
--- a/drivers/usb/media/pwc.h
+++ b/drivers/usb/media/pwc.h
@@ -22,15 +22,15 @@
 
 #include <linux/config.h>
 #include <linux/module.h>
-#include <linux/smp_lock.h>
-#include <linux/spinlock.h>
 #include <linux/usb.h>
+#include <linux/spinlock.h>
 #include <linux/videodev.h>
 #include <linux/wait.h>
-
+#include <linux/smp_lock.h>
 #include <asm/semaphore.h>
 #include <asm/errno.h>
 
+#include "pwc-uncompress.h"
 #include "pwc-ioctl.h"
 
 /* Defines and structures for the Philips webcam */
@@ -65,9 +65,9 @@
 #define FEATURE_MOTOR_PANTILT		0x0001
 
 /* Version block */
-#define PWC_MAJOR	8
-#define PWC_MINOR	12
-#define PWC_VERSION 	"8.12"
+#define PWC_MAJOR	9
+#define PWC_MINOR	0
+#define PWC_VERSION 	"9.0.1"
 #define PWC_NAME 	"pwc"
 
 /* Turn certain features on/off */
@@ -90,12 +90,6 @@
 /* Absolute maximum number of buffers available for mmap() */
 #define MAX_IMAGES 		10
 
-struct pwc_coord
-{
-	int x, y;		/* guess what */
-	int size;		/* size, or offset */
-};
-
 /* The following structures were based on cpia.h. Why reinvent the wheel? :-) */
 struct pwc_iso_buf
 {
@@ -118,7 +112,7 @@ struct pwc_frame_buf
 
 struct pwc_device
 {
-   struct video_device vdev;
+   struct video_device *vdev;
 #ifdef PWC_MAGIC
    int magic;
 #endif
@@ -128,6 +122,7 @@ struct pwc_device
    int type;                    /* type of cam (645, 646, 675, 680, 690, 720, 730, 740, 750) */
    int release;			/* release number */
    int features;		/* feature bits */
+   char serial[30];		/* serial number (string) */
    int error_status;		/* set when something goes wrong with the cam (unplugged, USB errors) */
    int usb_init;		/* set when the cam has been initialized over USB */
 
@@ -137,6 +132,7 @@ struct pwc_device
    int vcinterface;		/* video control interface */
    int valternate;		/* alternate interface needed */
    int vframes, vsize;		/* frames-per-second & size (see PSZ_*) */
+   int vpalette;		/* palette: 420P, RAW or RGBBAYER */
    int vframe_count;		/* received frames */
    int vframes_dumped; 		/* counter for dumped frames */
    int vframes_error;		/* frames received in error */
@@ -148,6 +144,9 @@ struct pwc_device
    char vsnapshot;		/* snapshot mode */
    char vsync;			/* used by isoc handler */
    char vmirror;		/* for ToUCaM series */
+   
+   int cmd_len;
+   unsigned char cmd_buf[13];
 
    /* The image acquisition requires 3 to 4 steps:
       1. data is gathered in short packets from the USB controller
@@ -169,8 +168,9 @@ struct pwc_device
    struct pwc_frame_buf *full_frames, *full_frames_tail;	/* all filled frames */
    struct pwc_frame_buf *fill_frame;	/* frame currently being filled */
    struct pwc_frame_buf *read_frame;	/* frame currently read by user process */
-   int frame_size;
    int frame_header_size, frame_trailer_size;
+   int frame_size;
+   int frame_total_size; /* including header & trailer */
    int drop_frames;
 #if PWC_DEBUG
    int sequence;			/* Debugging aid */
@@ -187,7 +187,8 @@ struct pwc_device
       a gray or black border. view_min <= image <= view <= view_max;
     */
    int image_mask;			/* bitmask of supported sizes */
-   struct pwc_coord view_min, view_max;	/* minimum and maximum sizes */
+   struct pwc_coord view_min, view_max;	/* minimum and maximum viewable sizes */
+   struct pwc_coord abs_max;            /* maximum supported size with compression */
    struct pwc_coord image, view;	/* image and viewport size */
    struct pwc_coord offset;		/* offset within the viewport */
 
@@ -213,16 +214,6 @@ struct pwc_device
 #endif
 };
 
-/* Enumeration of image sizes */
-#define PSZ_SQCIF	0x00
-#define PSZ_QSIF	0x01
-#define PSZ_QCIF	0x02
-#define PSZ_SIF		0x03
-#define PSZ_CIF		0x04
-#define PSZ_VGA		0x05
-#define PSZ_MAX		6
-
-
 
 #ifdef __cplusplus
 extern "C" {
@@ -259,7 +250,7 @@ extern int pwc_get_saturation(struct pwc_device *pdev);
 extern int pwc_set_saturation(struct pwc_device *pdev, int value);
 extern int pwc_set_leds(struct pwc_device *pdev, int on_value, int off_value);
 extern int pwc_get_leds(struct pwc_device *pdev, int *on_value, int *off_value);
-extern int pwc_get_cmos_sensor(struct pwc_device *pdev);
+extern int pwc_get_cmos_sensor(struct pwc_device *pdev, int *sensor);
 
 /* Power down or up the camera; not supported by all models */
 extern int pwc_camera_power(struct pwc_device *pdev, int power);
diff --git a/drivers/usb/media/se401.c b/drivers/usb/media/se401.c
index ac19cfb5d..260bbd98b 100644
--- a/drivers/usb/media/se401.c
+++ b/drivers/usb/media/se401.c
@@ -1121,7 +1121,7 @@ static int se401_ioctl(struct inode *inode, struct file *file,
 	return video_usercopy(inode, file, cmd, arg, se401_do_ioctl);
 }
 
-static ssize_t se401_read(struct file *file, char *buf,
+static ssize_t se401_read(struct file *file, char __user *buf,
 		     size_t count, loff_t *ppos)
 {
 	int realcount=count, ret=0;
@@ -1295,7 +1295,7 @@ static int se401_init(struct usb_se401 *se401, int button)
 		    &se401->button, sizeof(se401->button),
 		    se401_button_irq,
 		    se401,
-		    HZ/10
+		    8
 		);
 		if (usb_submit_urb(se401->inturb, GFP_KERNEL)) {
 			info("int urb burned down");
diff --git a/drivers/usb/media/stv680.c b/drivers/usb/media/stv680.c
index 10feeb7c1..af460298a 100644
--- a/drivers/usb/media/stv680.c
+++ b/drivers/usb/media/stv680.c
@@ -1309,7 +1309,7 @@ static int stv680_mmap (struct file *file, struct vm_area_struct *vma)
 	return 0;
 }
 
-static ssize_t stv680_read (struct file *file, char *buf,
+static ssize_t stv680_read (struct file *file, char __user *buf,
 			size_t count, loff_t *ppos)
 {
 	struct video_device *dev = file->private_data;
diff --git a/drivers/usb/media/usbvideo.c b/drivers/usb/media/usbvideo.c
index 178a7b839..d46b136c9 100644
--- a/drivers/usb/media/usbvideo.c
+++ b/drivers/usb/media/usbvideo.c
@@ -46,7 +46,7 @@ static int usbvideo_v4l_ioctl(struct inode *inode, struct file *file,
 			      unsigned int cmd, unsigned long arg);
 static int usbvideo_v4l_mmap(struct file *file, struct vm_area_struct *vma);
 static int usbvideo_v4l_open(struct inode *inode, struct file *file);
-static ssize_t usbvideo_v4l_read(struct file *file, char *buf,
+static ssize_t usbvideo_v4l_read(struct file *file, char __user *buf,
 			     size_t count, loff_t *ppos);
 static int usbvideo_v4l_close(struct inode *inode, struct file *file);
 
@@ -1587,7 +1587,7 @@ static int usbvideo_v4l_ioctl(struct inode *inode, struct file *file,
  * 20-Oct-2000 Created.
  * 01-Nov-2000 Added mutex (uvd->lock).
  */
-static ssize_t usbvideo_v4l_read(struct file *file, char *buf,
+static ssize_t usbvideo_v4l_read(struct file *file, char __user *buf,
 		      size_t count, loff_t *ppos)
 {
 	struct uvd *uvd = file->private_data;
diff --git a/drivers/usb/media/vicam.c b/drivers/usb/media/vicam.c
index 79629c370..1e416c1de 100644
--- a/drivers/usb/media/vicam.c
+++ b/drivers/usb/media/vicam.c
@@ -523,9 +523,9 @@ set_camera_power(struct vicam_camera *cam, int state)
 }
 
 static int
-vicam_ioctl(struct inode *inode, struct file *file, unsigned int ioctlnr, unsigned long ul_arg)
+vicam_ioctl(struct inode *inode, struct file *file, unsigned int ioctlnr, unsigned long arg)
 {
-	void *arg = (void *)ul_arg;
+	void __user *user_arg = (void __user *)arg;
 	struct vicam_camera *cam = file->private_data;
 	int retval = 0;
 
@@ -549,7 +549,7 @@ vicam_ioctl(struct inode *inode, struct file *file, unsigned int ioctlnr, unsign
 			b.minwidth = 320;	/* VIDEOSIZE_48_48 */
 			b.minheight = 240;
 
-			if (copy_to_user(arg, &b, sizeof (b)))
+			if (copy_to_user(user_arg, &b, sizeof(b)))
 				retval = -EFAULT;
 
 			break;
@@ -560,7 +560,7 @@ vicam_ioctl(struct inode *inode, struct file *file, unsigned int ioctlnr, unsign
 			struct video_channel v;
 
 			DBG("VIDIOCGCHAN\n");
-			if (copy_from_user(&v, arg, sizeof (v))) {
+			if (copy_from_user(&v, user_arg, sizeof(v))) {
 				retval = -EFAULT;
 				break;
 			}
@@ -576,7 +576,7 @@ vicam_ioctl(struct inode *inode, struct file *file, unsigned int ioctlnr, unsign
 			v.type = VIDEO_TYPE_CAMERA;
 			v.norm = 0;
 
-			if (copy_to_user(arg, &v, sizeof (v)))
+			if (copy_to_user(user_arg, &v, sizeof(v)))
 				retval = -EFAULT;
 			break;
 		}
@@ -585,7 +585,7 @@ vicam_ioctl(struct inode *inode, struct file *file, unsigned int ioctlnr, unsign
 		{
 			int v;
 
-			if (copy_from_user(&v, arg, sizeof (v)))
+			if (copy_from_user(&v, user_arg, sizeof(v)))
 				retval = -EFAULT;
 			DBG("VIDIOCSCHAN %d\n", v);
 
@@ -604,8 +604,7 @@ vicam_ioctl(struct inode *inode, struct file *file, unsigned int ioctlnr, unsign
 			vp.brightness = cam->gain << 8;
 			vp.depth = 24;
 			vp.palette = VIDEO_PALETTE_RGB24;
-			if (copy_to_user
-			    (arg, &vp, sizeof (struct video_picture)))
+			if (copy_to_user(user_arg, &vp, sizeof (struct video_picture)))
 				retval = -EFAULT;
 			break;
 		}
@@ -614,7 +613,7 @@ vicam_ioctl(struct inode *inode, struct file *file, unsigned int ioctlnr, unsign
 		{
 			struct video_picture vp;
 			
-			if (copy_from_user(&vp, arg, sizeof(vp))) {
+			if (copy_from_user(&vp, user_arg, sizeof(vp))) {
 				retval = -EFAULT;
 				break;
 			}
@@ -646,8 +645,7 @@ vicam_ioctl(struct inode *inode, struct file *file, unsigned int ioctlnr, unsign
 
 			DBG("VIDIOCGWIN\n");
 
-			if (copy_to_user
-			    ((void *) arg, (void *) &vw, sizeof (vw)))
+			if (copy_to_user(user_arg, (void *)&vw, sizeof(vw)))
 				retval = -EFAULT;
 
 			// I'm not sure what the deal with a capture window is, it is very poorly described
@@ -660,7 +658,7 @@ vicam_ioctl(struct inode *inode, struct file *file, unsigned int ioctlnr, unsign
 
 			struct video_window vw;
 
-			if (copy_from_user(&vw, arg, sizeof(vw))) {
+			if (copy_from_user(&vw, user_arg, sizeof(vw))) {
 				retval = -EFAULT;
 				break;
 			}
@@ -687,8 +685,7 @@ vicam_ioctl(struct inode *inode, struct file *file, unsigned int ioctlnr, unsign
 			for (i = 0; i < VICAM_FRAMES; i++)
 				vm.offsets[i] = VICAM_MAX_FRAME_SIZE * i;
 
-			if (copy_to_user
-			    ((void *) arg, (void *) &vm, sizeof (vm)))
+			if (copy_to_user(user_arg, (void *)&vm, sizeof(vm)))
 				retval = -EFAULT;
 
 			break;
@@ -699,8 +696,7 @@ vicam_ioctl(struct inode *inode, struct file *file, unsigned int ioctlnr, unsign
 			struct video_mmap vm;
 			// int video_size;
 
-			if (copy_from_user
-			    ((void *) &vm, (void *) arg, sizeof (vm))) {
+			if (copy_from_user((void *)&vm, user_arg, sizeof(vm))) {
 				retval = -EFAULT;
 				break;
 			}
@@ -723,7 +719,7 @@ vicam_ioctl(struct inode *inode, struct file *file, unsigned int ioctlnr, unsign
 		{
 			int frame;
 
-			if (copy_from_user((void *) &frame, arg, sizeof (int))) {
+			if (copy_from_user((void *)&frame, user_arg, sizeof(int))) {
 				retval = -EFAULT;
 				break;
 			}
@@ -1003,7 +999,7 @@ read_frame(struct vicam_camera *cam, int framenum)
 }
 
 static ssize_t
-vicam_read( struct file *file, char *buf, size_t count, loff_t *ppos )
+vicam_read( struct file *file, char __user *buf, size_t count, loff_t *ppos )
 {
 	struct vicam_camera *cam = file->private_data;
 
diff --git a/drivers/usb/media/w9968cf.c b/drivers/usb/media/w9968cf.c
index f81bf5987..36fbe800f 100644
--- a/drivers/usb/media/w9968cf.c
+++ b/drivers/usb/media/w9968cf.c
@@ -5,7 +5,7 @@
  *                                                                         *
  * - Memory management code from bttv driver by Ralph Metzler,             *
  *   Marcus Metzler and Gerd Knorr.                                        *
- * - I2C interface to kernel, high-level CMOS sensor control routines and  *
+ * - I2C interface to kernel, high-level image sensor control routines and *
  *   some symbolic names from OV511 driver by Mark W. McClelland.          *
  * - Low-level I2C fast write function by Piotr Czerczak.                  *
  * - Low-level I2C read function by Frederic Jouault.                      *
@@ -27,21 +27,23 @@
 
 #include <linux/version.h>
 #include <linux/module.h>
-#include <linux/moduleparam.h>
 #include <linux/kernel.h>
+#include <linux/kmod.h>
 #include <linux/init.h>
 #include <linux/fs.h>
 #include <linux/vmalloc.h>
 #include <linux/slab.h>
 #include <linux/mm.h>
 #include <linux/string.h>
-#include <linux/ctype.h>
 #include <linux/errno.h>
 #include <linux/sched.h>
 #include <linux/ioctl.h>
 #include <linux/delay.h>
+#include <linux/stddef.h>
 #include <asm/page.h>
 #include <asm/uaccess.h>
+#include <linux/page-flags.h>
+#include <linux/moduleparam.h>
 
 #include "w9968cf.h"
 #include "w9968cf_decoder.h"
@@ -49,14 +51,18 @@
 
 
 /****************************************************************************
- * Module macros and paramaters                                             *
+ * Module macros and parameters                                             *
  ****************************************************************************/
 
+MODULE_DEVICE_TABLE(usb, winbond_id_table);
+
 MODULE_AUTHOR(W9968CF_MODULE_AUTHOR" "W9968CF_AUTHOR_EMAIL);
-MODULE_DESCRIPTION(W9968CF_MODULE_NAME" "W9968CF_MODULE_VERSION);
+MODULE_DESCRIPTION(W9968CF_MODULE_NAME);
+MODULE_VERSION(W9968CF_MODULE_VERSION);
 MODULE_LICENSE(W9968CF_MODULE_LICENSE);
 MODULE_SUPPORTED_DEVICE("Video");
 
+static int ovmod_load = W9968CF_OVMOD_LOAD;
 static int vppmod_load = W9968CF_VPPMOD_LOAD;
 static unsigned short simcams = W9968CF_SIMCAMS;
 static short video_nr[]={[0 ... W9968CF_MAX_DEVICES-1] = -1}; /*-1=first free*/
@@ -100,8 +106,11 @@ static int specific_debug = W9968CF_SPECIFIC_DEBUG;
 
 static unsigned int param_nv[24]; /* number of values per parameter */
 
+#ifdef CONFIG_KMOD
+module_param(ovmod_load, bool, 0644);
 module_param(vppmod_load, bool, 0444);
-module_param(simcams, ushort, 0444);
+#endif
+module_param(simcams, ushort, 0644);
 module_param_array(video_nr, short, param_nv[0], 0444);
 module_param_array(packet_size, uint, param_nv[1], 0444);
 module_param_array(max_buffers, ushort, param_nv[2], 0444);
@@ -127,21 +136,34 @@ module_param_array(colour, uint, param_nv[21], 0444);
 module_param_array(contrast, uint, param_nv[22], 0444);
 module_param_array(whiteness, uint, param_nv[23], 0444);
 #ifdef W9968CF_DEBUG
-module_param(debug, ushort, 0444);
-module_param(specific_debug, bool, 0444);
+module_param(debug, ushort, 0644);
+module_param(specific_debug, bool, 0644);
 #endif
 
+#ifdef CONFIG_KMOD
+MODULE_PARM_DESC(ovmod_load, 
+                 "\n<0|1> Automatic 'ovcamchip' module loading."
+                 "\n0 disabled, 1 enabled."
+                 "\nIf enabled,'insmod' searches for the required 'ovcamchip'"
+                 "\nmodule in the system, according to its configuration, and"
+                 "\nattempts to load that module automatically. This action is"
+                 "\nperformed once as soon as the 'w9968cf' module is loaded"
+                 "\ninto memory."
+                 "\nDefault value is "__MODULE_STRING(W9968CF_OVMOD_LOAD)"."
+                 "\n");
 MODULE_PARM_DESC(vppmod_load, 
                  "\n<0|1> Automatic 'w9968cf-vpp' module loading."
-                 "\n0 disable, 1 enable."
+                 "\n0 disabled, 1 enabled."
                  "\nIf enabled, every time an application attempts to open a"
                  "\ncamera, 'insmod' searches for the video post-processing"
                  "\nmodule in the system and loads it automatically (if"
-                 "\npresent). The 'w9968cf-vpp' module adds extra image"
-                 "\nmanipulation functions to the 'w9968cf' module, like"
-                 "\nsoftware up-scaling,colour conversions and video decoding."
+                 "\npresent). The optional 'w9968cf-vpp' module adds extra"
+                 "\n image manipulation functions to the 'w9968cf' module,like"
+                 "\nsoftware up-scaling,colour conversions and video decoding"
+                 "\nfor very high frame rates."
                  "\nDefault value is "__MODULE_STRING(W9968CF_VPPMOD_LOAD)"."
                  "\n");
+#endif
 MODULE_PARM_DESC(simcams, 
                  "\n<n> Number of cameras allowed to stream simultaneously."
                  "\nn may vary from 0 to "
@@ -176,8 +198,8 @@ MODULE_PARM_DESC(double_buffer,
                  "\n<0|1[,...]> "
                  "Hardware double buffering: 0 disabled, 1 enabled."
                  "\nIt should be enabled if you want smooth video output: if"
-                 "\nyou obtain out of sync. video, disable it at all, or try"
-                 "\nto decrease the 'clockdiv' module paramater value."
+                 "\nyou obtain out of sync. video, disable it, or try to"
+                 "\ndecrease the 'clockdiv' module parameter value."
                  "\nDefault value is "__MODULE_STRING(W9968CF_DOUBLE_BUFFER)
                  " for every device."
                  "\n");
@@ -193,7 +215,7 @@ MODULE_PARM_DESC(filter_type,
                  "\nDefault value is "__MODULE_STRING(W9968CF_FILTER_TYPE)
                  " for every device."
                  "\nThe filter is used to reduce noise and aliasing artifacts"
-                 "\nproduced by the CCD or CMOS sensor, and the scaling"
+                 "\nproduced by the CCD or CMOS image sensor, and the scaling"
                  " process."
                  "\n");
 MODULE_PARM_DESC(largeview, 
@@ -208,7 +230,7 @@ MODULE_PARM_DESC(upscaling,
                  " enough memory."
                  "\nDefault value is "__MODULE_STRING(W9968CF_UPSCALING)
                  " for every device."
-                 "\nIf 'w9968cf-vpp' is not loaded, this paramater is"
+                 "\nIf 'w9968cf-vpp' is not present, this parameter is"
                  " set to 0."
                  "\n");
 MODULE_PARM_DESC(decompression,
@@ -224,8 +246,8 @@ MODULE_PARM_DESC(decompression,
                  "a multiple of 16."
                  "\nDefault value is "__MODULE_STRING(W9968CF_DECOMPRESSION)
                  " for every device."
-                 "\nIf 'w9968cf-vpp' is not loaded, forcing decompression is "
-                 "\nnot allowed; in this case this paramater is set to 2."
+                 "\nIf 'w9968cf-vpp' is not present, forcing decompression is "
+                 "\nnot allowed; in this case this parameter is set to 2."
                  "\n");
 MODULE_PARM_DESC(force_palette,
                  "\n<0"
@@ -255,11 +277,11 @@ MODULE_PARM_DESC(force_palette,
                  "\n- RGB565  16 bpp - Software conversion from UYVY"
                  "\n- RGB24   24 bpp - Software conversion from UYVY"
                  "\n- RGB32   32 bpp - Software conversion from UYVY"
-                 "\nWhen not 0, this paramater will override 'decompression'."
+                 "\nWhen not 0, this parameter will override 'decompression'."
                  "\nDefault value is 0 for every device."
                  "\nInitial palette is "
                  __MODULE_STRING(W9968CF_PALETTE_DECOMP_ON)"."
-                 "\nIf 'w9968cf-vpp' is not loaded, this paramater is"
+                 "\nIf 'w9968cf-vpp' is not present, this parameter is"
                  " set to 9 (UYVY)."
                  "\n");
 MODULE_PARM_DESC(force_rgb, 
@@ -271,13 +293,13 @@ MODULE_PARM_DESC(force_rgb,
                  " for every device."
                  "\n");
 MODULE_PARM_DESC(autobright,
-                 "\n<0|1[,...]> CMOS sensor automatically changes brightness:"
+                 "\n<0|1[,...]> Image sensor automatically changes brightness:"
                  "\n 0 = no, 1 = yes"
                  "\nDefault value is "__MODULE_STRING(W9968CF_AUTOBRIGHT)
                  " for every device."
                  "\n");
 MODULE_PARM_DESC(autoexp,
-                 "\n<0|1[,...]> CMOS sensor automatically changes exposure:"
+                 "\n<0|1[,...]> Image sensor automatically changes exposure:"
                  "\n 0 = no, 1 = yes"
                  "\nDefault value is "__MODULE_STRING(W9968CF_AUTOEXP)
                  " for every device."
@@ -304,7 +326,7 @@ MODULE_PARM_DESC(clockdiv,
                  "Force pixel clock divisor to a specific value (for experts):"
                  "\n  n may vary from 0 to 127."
                  "\n -1 for automatic value."
-                 "\nSee also the 'double_buffer' module paramater."
+                 "\nSee also the 'double_buffer' module parameter."
                  "\nDefault value is "__MODULE_STRING(W9968CF_CLOCKDIV)
                  " for every device."
                  "\n");
@@ -321,7 +343,7 @@ MODULE_PARM_DESC(mirror,
                  " for every device."
                  "\n");
 MODULE_PARM_DESC(monochrome,
-                 "\n<0|1[,...]> Use OV CMOS sensor as monochrome sensor:"
+                 "\n<0|1[,...]> Use image sensor as monochrome sensor:"
                  "\n 0 = no, 1 = yes"
                  "\nNot all the sensors support monochrome color."
                  "\nDefault value is "__MODULE_STRING(W9968CF_MONOCHROME)
@@ -363,7 +385,7 @@ MODULE_PARM_DESC(debug,
                  "\n4 = warnings"
                  "\n5 = called functions"
                  "\n6 = function internals"
-                 "\nLevel 5 and 6 are useful for testing only, when just "
+                 "\nLevel 5 and 6 are useful for testing only, when only "
                  "one device is used."
                  "\nDefault value is "__MODULE_STRING(W9968CF_DEBUG_LEVEL)"."
                  "\n");
@@ -388,14 +410,14 @@ MODULE_PARM_DESC(specific_debug,
 static struct file_operations w9968cf_fops;
 static int w9968cf_open(struct inode*, struct file*);
 static int w9968cf_release(struct inode*, struct file*);
-static ssize_t w9968cf_read(struct file*, char*, size_t, loff_t*);
 static int w9968cf_mmap(struct file*, struct vm_area_struct*);
 static int w9968cf_ioctl(struct inode*, struct file*, unsigned, unsigned long);
-static int w9968cf_v4l_ioctl(struct inode*, struct file*, unsigned int, void*);
+static ssize_t w9968cf_read(struct file*, char __user *, size_t, loff_t*);
+static int w9968cf_v4l_ioctl(struct inode*, struct file*, unsigned int,
+                             void __user *);
 
 /* USB-specific */
 static int w9968cf_start_transfer(struct w9968cf_device*);
-static void w9968cf_urb_complete(struct urb *urb, struct pt_regs *regs);
 static int w9968cf_stop_transfer(struct w9968cf_device*);
 static int w9968cf_write_reg(struct w9968cf_device*, u16 value, u16 index);
 static int w9968cf_read_reg(struct w9968cf_device*, u16 index);
@@ -403,6 +425,7 @@ static int w9968cf_write_fsb(struct w9968cf_device*, u16* data);
 static int w9968cf_write_sb(struct w9968cf_device*, u16 value);
 static int w9968cf_read_sb(struct w9968cf_device*);
 static int w9968cf_upload_quantizationtables(struct w9968cf_device*);
+static void w9968cf_urb_complete(struct urb *urb, struct pt_regs *regs);
 
 /* Low-level I2C (SMBus) I/O */
 static int w9968cf_smbus_start(struct w9968cf_device*);
@@ -439,13 +462,12 @@ static void* rvmalloc(unsigned long size);
 static void rvfree(void *mem, unsigned long size);
 static void w9968cf_deallocate_memory(struct w9968cf_device*);
 static int  w9968cf_allocate_memory(struct w9968cf_device*);
-static inline unsigned long w9968cf_get_max_bufsize(struct w9968cf_device*);
 
-/* High-level CMOS sensor control functions */
+/* High-level image sensor control functions */
 static int w9968cf_sensor_set_control(struct w9968cf_device*,int cid,int val);
 static int w9968cf_sensor_get_control(struct w9968cf_device*,int cid,int *val);
-static inline int w9968cf_sensor_cmd(struct w9968cf_device*, 
-                                     unsigned int cmd, void *arg);
+static int w9968cf_sensor_cmd(struct w9968cf_device*,
+                              unsigned int cmd, void *arg);
 static int w9968cf_sensor_init(struct w9968cf_device*);
 static int w9968cf_sensor_update_settings(struct w9968cf_device*);
 static int w9968cf_sensor_get_picture(struct w9968cf_device*);
@@ -456,13 +478,14 @@ static int w9968cf_sensor_update_picture(struct w9968cf_device*,
 static void w9968cf_configure_camera(struct w9968cf_device*,struct usb_device*,
                                      enum w9968cf_model_id, 
                                      const unsigned short dev_nr);
+static void w9968cf_adjust_configuration(struct w9968cf_device*);
 static int w9968cf_turn_on_led(struct w9968cf_device*);
 static int w9968cf_init_chip(struct w9968cf_device*);
-static int w9968cf_set_picture(struct w9968cf_device*, struct video_picture);
-static int w9968cf_set_window(struct w9968cf_device*, struct video_window);
 static inline u16 w9968cf_valid_palette(u16 palette);
 static inline u16 w9968cf_valid_depth(u16 palette);
 static inline u8 w9968cf_need_decompression(u16 palette);
+static int w9968cf_set_picture(struct w9968cf_device*, struct video_picture);
+static int w9968cf_set_window(struct w9968cf_device*, struct video_window);
 static int w9968cf_postprocess_frame(struct w9968cf_device*, 
                                      struct w9968cf_frame_t*);
 static int w9968cf_adjust_window_size(struct w9968cf_device*, u16* w, u16* h);
@@ -472,18 +495,8 @@ static void w9968cf_pop_frame(struct w9968cf_device*,struct w9968cf_frame_t**);
 static void w9968cf_release_resources(struct w9968cf_device*);
 
 /* Intermodule communication */
-static int w9968cf_vppmod_detect(void);
-static void w9968cf_vppmod_release(void);
-
-/* Pointers to registered video post-processing functions */
-static void (*w9968cf_vpp_init_decoder)(void);
-static int (*w9968cf_vpp_check_headers)(const unsigned char*,
-                                        const unsigned long);
-static int (*w9968cf_vpp_decode)(const char*, const unsigned, 
-                                 const unsigned, const unsigned, char*);
-static void (*w9968cf_vpp_swap_yuvbytes)(void*, unsigned long);
-static void (*w9968cf_vpp_uyvy_to_rgbx)(u8*, unsigned long, u8*, u16, u8);
-static void (*w9968cf_vpp_scale_up)(u8*, u8*, u16, u16, u16, u16, u16);
+static int w9968cf_vppmod_detect(struct w9968cf_device*);
+static void w9968cf_vppmod_release(struct w9968cf_device*);
 
 
 
@@ -518,12 +531,15 @@ static struct w9968cf_symbolic_list camlist[] = {
 	{ W9968CF_MOD_CLVBWGP, "Creative Labs Video Blaster WebCam Go Plus" },
 
 	/* Other cameras (having the same descriptors as Generic W996[87]CF) */
-	{ W9968CF_MOD_ADPA5R, "Aroma Digi Pen ADG-5000 Refurbished" },
-	{ W9986CF_MOD_AU, "AVerTV USB" },
+	{ W9968CF_MOD_ADPVDMA, "Aroma Digi Pen VGA Dual Mode ADG-5000" },
+	{ W9986CF_MOD_AAU, "AVerMedia AVerTV USB" },
 	{ W9968CF_MOD_CLVBWG, "Creative Labs Video Blaster WebCam Go" },
-	{ W9968CF_MOD_DLLDK, "Die Lebon LDC-D35A Digital Kamera" },
+	{ W9968CF_MOD_LL, "Lebon LDC-035A" },
 	{ W9968CF_MOD_EEEMC, "Ezonics EZ-802 EZMega Cam" },
+	{ W9968CF_MOD_OOE, "OmniVision OV8610-EDE" },
 	{ W9968CF_MOD_ODPVDMPC, "OPCOM Digi Pen VGA Dual Mode Pen Camera" },
+	{ W9968CF_MOD_PDPII, "Pretec Digi Pen-II" },
+	{ W9968CF_MOD_PDP480, "Pretec DigiPen-480" },
 
 	{  -1, NULL }
 };
@@ -648,17 +664,6 @@ static void rvfree(void* mem, unsigned long size)
 }
 
 
-/*--------------------------------------------------------------------------
-  Return the maximum size (in bytes) of a frame buffer.
-  --------------------------------------------------------------------------*/
-static inline unsigned long w9968cf_get_max_bufsize(struct w9968cf_device* cam)
-{
-	u8 bpp = (w9968cf_vppmod_present) ? 4 : 2;
-	return (cam->upscaling) ? W9968CF_MAX_WIDTH*W9968CF_MAX_HEIGHT*bpp :
-	                          cam->maxwidth*cam->maxheight*bpp;
-}
-
-
 /*--------------------------------------------------------------------------
   Deallocate previously allocated memory.
   --------------------------------------------------------------------------*/
@@ -674,26 +679,25 @@ static void w9968cf_deallocate_memory(struct w9968cf_device* cam)
 
 	/* Free temporary frame buffer */
 	if (cam->frame_tmp.buffer) {
-		rvfree(cam->frame_tmp.buffer, W9968CF_HW_BUF_SIZE);
+		rvfree(cam->frame_tmp.buffer, cam->frame_tmp.size);
 		cam->frame_tmp.buffer = NULL;
 	}
 
 	/* Free helper buffer */
-	if (cam->vpp_buffer) {
-		rvfree(cam->vpp_buffer, w9968cf_get_max_bufsize(cam));
-		cam->vpp_buffer = NULL;
+	if (cam->frame_vpp.buffer) {
+		rvfree(cam->frame_vpp.buffer, cam->frame_vpp.size);
+		cam->frame_vpp.buffer = NULL;
 	}
-	
+
 	/* Free video frame buffers */
 	if (cam->frame[0].buffer) {
-		rvfree(cam->frame[0].buffer, 
-		       cam->nbuffers * w9968cf_get_max_bufsize(cam));
+		rvfree(cam->frame[0].buffer, cam->nbuffers*cam->frame[0].size);
 		cam->frame[0].buffer = NULL;
 	}
 
 	cam->nbuffers = 0;
 
-	DBG(5, "Memory successfully deallocated.")
+	DBG(5, "Memory successfully deallocated")
 }
 
 
@@ -704,19 +708,30 @@ static void w9968cf_deallocate_memory(struct w9968cf_device* cam)
   --------------------------------------------------------------------------*/
 static int w9968cf_allocate_memory(struct w9968cf_device* cam)
 {
-	const unsigned long bufsize = w9968cf_get_max_bufsize(cam);
 	const u16 p_size = wMaxPacketSize[cam->altsetting-1];
 	void* buff = NULL;
-	u8 i;
+	unsigned long hw_bufsize, vpp_bufsize;
+	u8 i, bpp;
 
 	/* NOTE: Deallocation is done elsewhere in case of error */
 
+	/* Calculate the max amount of raw data per frame from the device */
+	hw_bufsize = cam->maxwidth*cam->maxheight*2;
+
+	/* Calculate the max buf. size needed for post-processing routines */
+	bpp = (w9968cf_vpp) ? 4 : 2;
+	if (cam->upscaling)
+		vpp_bufsize = max(W9968CF_MAX_WIDTH*W9968CF_MAX_HEIGHT*bpp,
+		                  cam->maxwidth*cam->maxheight*bpp);
+	else
+		vpp_bufsize = cam->maxwidth*cam->maxheight*bpp;
+
 	/* Allocate memory for the isochronous transfer buffers */
 	for (i = 0; i < W9968CF_URBS; i++) {
 		if (!(cam->transfer_buffer[i] =
 		      kmalloc(W9968CF_ISO_PACKETS*p_size, GFP_KERNEL))) {
 			DBG(1, "Couldn't allocate memory for the isochronous "
-			       "transfer buffers (%d bytes).", 
+			       "transfer buffers (%u bytes)", 
 			    p_size * W9968CF_ISO_PACKETS)
 			return -ENOMEM;
 		}
@@ -724,44 +739,49 @@ static int w9968cf_allocate_memory(struct w9968cf_device* cam)
 	}
 
 	/* Allocate memory for the temporary frame buffer */
-	if (!(cam->frame_tmp.buffer = rvmalloc(W9968CF_HW_BUF_SIZE))) {
+	if (!(cam->frame_tmp.buffer = rvmalloc(hw_bufsize))) {
 		DBG(1, "Couldn't allocate memory for the temporary "
-		       "video frame buffer (%i bytes).", W9968CF_HW_BUF_SIZE)
+		       "video frame buffer (%lu bytes)", hw_bufsize)
 		return -ENOMEM;
 	}
+	cam->frame_tmp.size = hw_bufsize;
+	cam->frame_tmp.number = -1;
 
 	/* Allocate memory for the helper buffer */
-	if (w9968cf_vppmod_present) {
-		if (!(cam->vpp_buffer = rvmalloc(bufsize))) {
+	if (w9968cf_vpp) {
+		if (!(cam->frame_vpp.buffer = rvmalloc(vpp_bufsize))) {
 			DBG(1, "Couldn't allocate memory for the helper buffer"
-			       " (%li bytes).", bufsize)
+			       " (%lu bytes)", vpp_bufsize)
 			return -ENOMEM;
 		}
+		cam->frame_vpp.size = vpp_bufsize;
 	} else
-		cam->vpp_buffer = NULL;
+		cam->frame_vpp.buffer = NULL;
 
-	/* Allocate memory for video frame buffers */	
+	/* Allocate memory for video frame buffers */
 	cam->nbuffers = cam->max_buffers;
 	while (cam->nbuffers >= 2) {
-		if ((buff = rvmalloc(cam->nbuffers * bufsize)))
+		if ((buff = rvmalloc(cam->nbuffers * vpp_bufsize)))
 			break;
 		else
 			cam->nbuffers--;
 	}
 
 	if (!buff) {
-		DBG(1, "Couldn't allocate memory for the video frame buffers.")
+		DBG(1, "Couldn't allocate memory for the video frame buffers")
 		cam->nbuffers = 0;
 		return -ENOMEM;
 	}
 
 	if (cam->nbuffers != cam->max_buffers)
-		DBG(2, "Couldn't allocate memory for %d video frame buffers. "
-		       "Only memory for %d buffers has been allocated.",
+		DBG(2, "Couldn't allocate memory for %u video frame buffers. "
+		       "Only memory for %u buffers has been allocated",
 		    cam->max_buffers, cam->nbuffers)
 
 	for (i = 0; i < cam->nbuffers; i++) {
-		cam->frame[i].buffer = buff + i*bufsize;
+		cam->frame[i].buffer = buff + i*vpp_bufsize;
+		cam->frame[i].size = vpp_bufsize;
+		cam->frame[i].number = i;
 		/* Circular list */
 		if (i != cam->nbuffers-1)
 			cam->frame[i].next = &cam->frame[i+1];
@@ -770,7 +790,7 @@ static int w9968cf_allocate_memory(struct w9968cf_device* cam)
 		cam->frame[i].status = F_UNUSED;
 	}
 
-	DBG(5, "Memory successfully allocated.")
+	DBG(5, "Memory successfully allocated")
 	return 0;
 }
 
@@ -794,20 +814,16 @@ static void w9968cf_urb_complete(struct urb *urb, struct pt_regs *regs)
 {
 	struct w9968cf_device* cam = (struct w9968cf_device*)urb->context;
 	struct w9968cf_frame_t** f;
-	unsigned long maxbufsize;
 	unsigned int len, status;
 	void* pos;
 	u8 i;
 	int err = 0;
 
 	if ((!cam->streaming) || cam->disconnected) {
-		DBG(4, "Got interrupt, but not streaming.")
+		DBG(4, "Got interrupt, but not streaming")
 		return;
 	}
 
-	maxbufsize = min( (unsigned long)W9968CF_HW_BUF_SIZE, 
-	                  w9968cf_get_max_bufsize(cam) );
-
 	/* "(*f)" will be used instead of "cam->frame_current" */
 	f = &cam->frame_current;
 
@@ -820,8 +836,8 @@ static void w9968cf_urb_complete(struct urb *urb, struct pt_regs *regs)
 			(*f)->length = cam->frame_tmp.length;
 			memcpy((*f)->buffer, cam->frame_tmp.buffer,
 			       (*f)->length);
-			DBG(6, "Switched from temp. frame to frame #%zd", 
-			    (*f) - &cam->frame[0])
+			DBG(6, "Switched from temp. frame to frame #%d", 
+			    (*f)->number)
 		}
 	}
 
@@ -832,7 +848,7 @@ static void w9968cf_urb_complete(struct urb *urb, struct pt_regs *regs)
 
 		if (status && len != 0) {
 			DBG(4, "URB failed, error in data packet "
-			       "(error #%d, %s).",
+			       "(error #%u, %s)",
 			    status, symbolic(urb_errlist, status))
 			(*f)->status = F_ERROR;
 			continue;
@@ -846,8 +862,8 @@ static void w9968cf_urb_complete(struct urb *urb, struct pt_regs *regs)
 			}
 
 			/* Buffer overflows shouldn't happen, however...*/
-			if ((*f)->length + len > maxbufsize) {
-				DBG(4, "Buffer overflow: bad data packets.")
+			if ((*f)->length + len > (*f)->size) {
+				DBG(4, "Buffer overflow: bad data packets")
 				(*f)->status = F_ERROR;
 			}
 
@@ -858,11 +874,10 @@ static void w9968cf_urb_complete(struct urb *urb, struct pt_regs *regs)
 
 		} else if ((*f)->status == F_GRABBING) { /* end of frame */
 
-			DBG(6, "Frame #%zd successfully grabbed.",
-			    ((*f)==&cam->frame_tmp ? -1 : (*f)-&cam->frame[0]))
+			DBG(6, "Frame #%d successfully grabbed", (*f)->number)
 
 			if (cam->vpp_flag & VPP_DECOMPRESSION) {
-				err=(*w9968cf_vpp_check_headers)((*f)->buffer,
+				err = w9968cf_vpp->check_headers((*f)->buffer,
 				                                 (*f)->length);
 				if (err) {
 					DBG(4, "Skip corrupted frame: %s",
@@ -887,7 +902,7 @@ static void w9968cf_urb_complete(struct urb *urb, struct pt_regs *regs)
 		} else if ((*f)->status == F_ERROR)
 			(*f)->status = F_UNUSED; /* grab it again */
 
-		PDBGG("Frame length %li | pack.#%d | pack.len. %d | state %d",
+		PDBGG("Frame length %lu | pack.#%u | pack.len. %u | state %d",
 		      (unsigned long)(*f)->length, i, len, (*f)->status)
 
 	} /* end for */
@@ -900,7 +915,7 @@ static void w9968cf_urb_complete(struct urb *urb, struct pt_regs *regs)
 		if ((err = usb_submit_urb(urb, GFP_ATOMIC))) {
 			cam->misconfigured = 1;
 			DBG(1, "Couldn't resubmit the URB: error %d, %s",
-			    err, symbolic(urb_errlist, err));
+			    err, symbolic(urb_errlist, err))
 		}
 	spin_unlock(&cam->urb_lock);
 
@@ -931,7 +946,7 @@ static int w9968cf_start_transfer(struct w9968cf_device* cam)
 		if (!urb) {
 			for (j = 0; j < i; j++)
 				usb_free_urb(cam->urb[j]);
-			DBG(1, "Couldn't allocate the URB structures.")
+			DBG(1, "Couldn't allocate the URB structures")
 			return -ENOMEM;
 		}
 
@@ -976,7 +991,7 @@ static int w9968cf_start_transfer(struct w9968cf_device* cam)
 	if (err || (vidcapt < 0)) {
 		for (i = 0; i < W9968CF_URBS; i++)
 			usb_free_urb(cam->urb[i]);
-		DBG(1, "Couldn't tell the camera to start the data transfer.")
+		DBG(1, "Couldn't tell the camera to start the data transfer")
 		return err;
 	}
 
@@ -988,26 +1003,29 @@ static int w9968cf_start_transfer(struct w9968cf_device* cam)
 	cam->frame_current = &cam->frame_tmp;
 
 	if (!(cam->vpp_flag & VPP_DECOMPRESSION))
-		DBG(5, "Isochronous transfer size: %li bytes/frame.",
+		DBG(5, "Isochronous transfer size: %lu bytes/frame", 
 		    (unsigned long)t_size*2)
 
 	DBG(5, "Starting the isochronous transfer...")
 
+	cam->streaming = 1;
+
 	/* Submit the URBs */
 	for (i = 0; i < W9968CF_URBS; i++) {
 		err = usb_submit_urb(cam->urb[i], GFP_KERNEL);
 		if (err) {
-			for (j = i-1; j >= 0; j--)
-				if (!usb_unlink_urb(cam->urb[j]))
-					usb_free_urb(cam->urb[j]);
+			cam->streaming = 0;
+			for (j = i-1; j >= 0; j--) {
+				usb_kill_urb(cam->urb[j]);
+				usb_free_urb(cam->urb[j]);
+			}
 			DBG(1, "Couldn't send a transfer request to the "
-			       "USB core (error #%d, %s).", err, 
+			       "USB core (error #%d, %s)", err, 
 			    symbolic(urb_errlist, err))
+			return err;
 		}
 	}
 
-	cam->streaming = 1;
-
 	return 0;
 }
 
@@ -1023,6 +1041,9 @@ static int w9968cf_stop_transfer(struct w9968cf_device* cam)
 	int err = 0;
 	s8 i;
 
+	if (!cam->streaming)
+		return 0;
+
 	/* This avoids race conditions with usb_submit_urb() 
 	   in the URB completition handler */
 	spin_lock_irqsave(&cam->urb_lock, lock_flags);
@@ -1031,10 +1052,9 @@ static int w9968cf_stop_transfer(struct w9968cf_device* cam)
 
 	for (i = W9968CF_URBS-1; i >= 0; i--)
 		if (cam->urb[i]) {
-			if (!usb_unlink_urb(cam->urb[i])) {
-				usb_free_urb(cam->urb[i]);
-				cam->urb[i] = NULL;
-			}
+			usb_kill_urb(cam->urb[i]);
+			usb_free_urb(cam->urb[i]);
+			cam->urb[i] = NULL;
 		}
 
 	if (cam->disconnected)
@@ -1052,7 +1072,7 @@ static int w9968cf_stop_transfer(struct w9968cf_device* cam)
 	}
 
 exit:
-	DBG(5, "Isochronous transfer stopped.")
+	DBG(5, "Isochronous transfer stopped")
 	return 0;
 }
 
@@ -1072,7 +1092,7 @@ static int w9968cf_write_reg(struct w9968cf_device* cam, u16 value, u16 index)
 
 	if (res < 0)
 		DBG(4, "Failed to write a register "
-		       "(value 0x%04X, index 0x%02X, error #%d, %s).",
+		       "(value 0x%04X, index 0x%02X, error #%d, %s)",
 		    value, index, res, symbolic(urb_errlist, res))
 
 	return (res >= 0) ? 0 : -1;
@@ -1095,7 +1115,7 @@ static int w9968cf_read_reg(struct w9968cf_device* cam, u16 index)
 
 	if (res < 0)
 		DBG(4, "Failed to read a register "
-		       "(index 0x%02X, error #%d, %s).",
+		       "(index 0x%02X, error #%d, %s)",
 		    index, res, symbolic(urb_errlist, res))
 
 	return (res >= 0) ? (int)(*buff) : -1;
@@ -1120,7 +1140,7 @@ static int w9968cf_write_fsb(struct w9968cf_device* cam, u16* data)
 
 	if (res < 0)
 		DBG(4, "Failed to write the FSB registers "
-		       "(error #%d, %s).", res, symbolic(urb_errlist, res))
+		       "(error #%d, %s)", res, symbolic(urb_errlist, res))
 
 	return (res >= 0) ? 0 : -1;
 }
@@ -1270,7 +1290,7 @@ static int w9968cf_smbus_read_ack(struct w9968cf_device* cam)
 	if (sda < 0)
 		err += sda;
 	if (sda == 1) {
-		DBG(6, "Couldn't receive the ACK.")
+		DBG(6, "Couldn't receive the ACK")
 		err += -1;
 	}
 
@@ -1353,11 +1373,11 @@ w9968cf_i2c_adap_fastwrite_byte_data(struct w9968cf_device* cam,
 
 	if (!err)
 		DBG(5, "I2C write byte data done, addr.0x%04X, subaddr.0x%02X "
-		       "value 0x%02X.", address, subaddress, value)
+		       "value 0x%02X", address, subaddress, value)
 	else
 		DBG(5, "I2C write byte data failed, addr.0x%04X, "
-		       "subaddr.0x%02X, value 0x%02X.", 
-	            address, subaddress, value)
+		       "subaddr.0x%02X, value 0x%02X", 
+		    address, subaddress, value)
 
 	return err;
 }
@@ -1392,11 +1412,11 @@ w9968cf_i2c_adap_read_byte_data(struct w9968cf_device* cam,
 
 	if (!err)
 		DBG(5, "I2C read byte data done, addr.0x%04X, "
-		       "subaddr.0x%02X, value 0x%02X.", 
+		       "subaddr.0x%02X, value 0x%02X", 
 		    address, subaddress, *value)
 	else
 		DBG(5, "I2C read byte data failed, addr.0x%04X, "
-		       "subaddr.0x%02X, wrong value 0x%02X.",
+		       "subaddr.0x%02X, wrong value 0x%02X",
 		    address, subaddress, *value)
 
 	return err;
@@ -1424,11 +1444,11 @@ w9968cf_i2c_adap_read_byte(struct w9968cf_device* cam,
 	err += w9968cf_write_sb(cam, 0x0000);
 
 	if (!err)
-		DBG(5, "I2C read byte done, addr.0x%04X."
-		       "value 0x%02X.", address, *value)
+		DBG(5, "I2C read byte done, addr.0x%04X, "
+		       "value 0x%02X", address, *value)
 	else
-		DBG(5, "I2C read byte failed, addr.0x%04X."
-		       "wrong value 0x%02X.", address, *value)
+		DBG(5, "I2C read byte failed, addr.0x%04X, "
+		       "wrong value 0x%02X", address, *value)
 
 	return err;
 }
@@ -1439,7 +1459,7 @@ static int
 w9968cf_i2c_adap_write_byte(struct w9968cf_device* cam,
                             u16 address, u8 value)
 {
-	DBG(4, "i2c_write_byte() is an unsupported transfer mode.")
+	DBG(4, "i2c_write_byte() is an unsupported transfer mode")
 	return -EINVAL;
 }
 
@@ -1546,9 +1566,8 @@ static int w9968cf_i2c_detach_inform(struct i2c_client* client)
 	struct w9968cf_device* cam = i2c_get_adapdata(client->adapter);
 	const char* clientname = i2c_clientname(client);
 
-	if (cam->sensor_client == client) {
+	if (cam->sensor_client == client)
 		cam->sensor_client = NULL;
-	}
 
 	DBG(5, "I2C detach client [%s]", clientname)
 
@@ -1593,9 +1612,9 @@ static int w9968cf_i2c_init(struct w9968cf_device* cam)
 
 	err = i2c_add_adapter(&cam->i2c_adapter);
 	if (err)
-		DBG(1, "Failed to register the I2C adapter.")
+		DBG(1, "Failed to register the I2C adapter")
 	else
-		DBG(5, "I2C adapter registered.")
+		DBG(5, "I2C adapter registered")
 
 	return err;
 }
@@ -1622,9 +1641,9 @@ static int w9968cf_turn_on_led(struct w9968cf_device* cam)
 	err += w9968cf_write_reg(cam, 0x0010, 0x01); /* ..high 'beep-beep' */
 
 	if (err)
-		DBG(2, "Couldn't turn on the LED.")
+		DBG(2, "Couldn't turn on the LED")
 
-	DBG(5, "LED turned on.")
+	DBG(5, "LED turned on")
 
 	return err;
 }
@@ -1637,6 +1656,13 @@ static int w9968cf_turn_on_led(struct w9968cf_device* cam)
   --------------------------------------------------------------------------*/
 static int w9968cf_init_chip(struct w9968cf_device* cam)
 {
+	unsigned long hw_bufsize = cam->maxwidth*cam->maxheight*2,
+	              y0 = 0x0000,
+	              u0 = y0 + hw_bufsize/2,
+	              v0 = u0 + hw_bufsize/4,
+	              y1 = v0 + hw_bufsize/4,
+	              u1 = y1 + hw_bufsize/2,
+	              v1 = u1 + hw_bufsize/4;
 	int err = 0;
 
 	err += w9968cf_write_reg(cam, 0xff00, 0x00); /* power off */
@@ -1645,23 +1671,25 @@ static int w9968cf_init_chip(struct w9968cf_device* cam)
 	err += w9968cf_write_reg(cam, 0x405d, 0x03); /* DRAM timings */
 	err += w9968cf_write_reg(cam, 0x0030, 0x04); /* SDRAM timings */
 
-	err += w9968cf_write_reg(cam, 0x0000, 0x20); /* Y frame buf.0, low */
-	err += w9968cf_write_reg(cam, 0x0000, 0x21); /* Y frame buf.0, high */
-	err += w9968cf_write_reg(cam, 0xb000, 0x22); /* Y frame buf.1, low */
-	err += w9968cf_write_reg(cam, 0x0004, 0x23); /* Y frame buf.1, high */
-	err += w9968cf_write_reg(cam, 0x5800, 0x24); /* U frame buf.0, low */
-	err += w9968cf_write_reg(cam, 0x0002, 0x25); /* U frame buf.0, high */
-	err += w9968cf_write_reg(cam, 0x0800, 0x26); /* U frame buf.1, low */
-	err += w9968cf_write_reg(cam, 0x0007, 0x27); /* U frame buf.1, high */
-	err += w9968cf_write_reg(cam, 0x8400, 0x28); /* V frame buf.0, low */
-	err += w9968cf_write_reg(cam, 0x0003, 0x29); /* V frame buf.0, high */
-	err += w9968cf_write_reg(cam, 0x3400, 0x2a); /* V frame buf.1, low */
-	err += w9968cf_write_reg(cam, 0x0008, 0x2b); /* V frame buf.1, high */
-
-	err += w9968cf_write_reg(cam, 0x6000, 0x32); /* JPEG bitstream buf 0 */
-	err += w9968cf_write_reg(cam, 0x0009, 0x33); /* JPEG bitstream buf 0 */
-	err += w9968cf_write_reg(cam, 0x2000, 0x34); /* JPEG bitstream buf 1 */
-	err += w9968cf_write_reg(cam, 0x000d, 0x35); /* JPEG bitstream buf 1 */
+	err += w9968cf_write_reg(cam, y0 & 0xffff, 0x20); /* Y buf.0, low */
+	err += w9968cf_write_reg(cam, y0 >> 16, 0x21);    /* Y buf.0, high */
+	err += w9968cf_write_reg(cam, u0 & 0xffff, 0x24); /* U buf.0, low */
+	err += w9968cf_write_reg(cam, u0 >> 16, 0x25);    /* U buf.0, high */
+	err += w9968cf_write_reg(cam, v0 & 0xffff, 0x28); /* V buf.0, low */
+	err += w9968cf_write_reg(cam, v0 >> 16, 0x29);    /* V buf.0, high */
+
+	err += w9968cf_write_reg(cam, y1 & 0xffff, 0x22); /* Y buf.1, low */
+	err += w9968cf_write_reg(cam, y1 >> 16, 0x23);    /* Y buf.1, high */
+	err += w9968cf_write_reg(cam, u1 & 0xffff, 0x26); /* U buf.1, low */
+	err += w9968cf_write_reg(cam, u1 >> 16, 0x27);    /* U buf.1, high */
+	err += w9968cf_write_reg(cam, v1 & 0xffff, 0x2a); /* V buf.1, low */
+	err += w9968cf_write_reg(cam, v1 >> 16, 0x2b);    /* V buf.1, high */
+
+	err += w9968cf_write_reg(cam, y1 & 0xffff, 0x32); /* JPEG buf 0 low */
+	err += w9968cf_write_reg(cam, y1 >> 16, 0x33);    /* JPEG buf 0 high */
+
+	err += w9968cf_write_reg(cam, y1 & 0xffff, 0x34); /* JPEG buf 1 low */
+	err += w9968cf_write_reg(cam, y1 >> 16, 0x35);    /* JPEG bug 1 high */
 
 	err += w9968cf_write_reg(cam, 0x0000, 0x36);/* JPEG restart interval */
 	err += w9968cf_write_reg(cam, 0x0804, 0x37);/*JPEG VLE FIFO threshold*/
@@ -1672,14 +1700,58 @@ static int w9968cf_init_chip(struct w9968cf_device* cam)
 	err += w9968cf_set_window(cam, cam->window);
 
 	if (err)
-		DBG(1, "Chip initialization failed.")
+		DBG(1, "Chip initialization failed")
 	else
-		DBG(5, "Chip successfully initialized.")
+		DBG(5, "Chip successfully initialized")
 
 	return err;
 }
 
 
+/*--------------------------------------------------------------------------
+  Return non-zero if the palette is supported, 0 otherwise.
+  --------------------------------------------------------------------------*/
+static inline u16 w9968cf_valid_palette(u16 palette)
+{
+	u8 i = 0;
+	while (w9968cf_formatlist[i].palette != 0) {
+		if (palette == w9968cf_formatlist[i].palette)
+			return palette;
+		i++;
+	}
+	return 0;
+}
+
+
+/*--------------------------------------------------------------------------
+  Return the depth corresponding to the given palette.
+  Palette _must_ be supported !
+  --------------------------------------------------------------------------*/
+static inline u16 w9968cf_valid_depth(u16 palette)
+{
+	u8 i=0;
+	while (w9968cf_formatlist[i].palette != palette)
+		i++;
+
+	return w9968cf_formatlist[i].depth;
+}
+
+
+/*--------------------------------------------------------------------------
+  Return non-zero if the format requires decompression, 0 otherwise.
+  --------------------------------------------------------------------------*/
+static inline u8 w9968cf_need_decompression(u16 palette)
+{
+	u8 i = 0;
+	while (w9968cf_formatlist[i].palette != 0) {
+		if (palette == w9968cf_formatlist[i].palette)
+			return w9968cf_formatlist[i].compression;
+		i++;
+	}
+	return 0;
+}
+
+
 /*--------------------------------------------------------------------------
   Change the picture settings of the camera.
   Return 0 on success, a negative number otherwise.
@@ -1736,8 +1808,8 @@ w9968cf_set_picture(struct w9968cf_device* cam, struct video_picture pict)
 			break;
 	}
 
-	/* FIXME: 'hardware double buffer' doesn't work when compressed video
-	          is enabled (corrupted frames). */
+	/* NOTE: due to memory issues, it is better to disable the hardware
+	         double buffering during compression */
 	if (cam->double_buffer && !(cam->vpp_flag & VPP_DECOMPRESSION))
 		reg_v |= 0x0080;
 
@@ -1761,16 +1833,15 @@ w9968cf_set_picture(struct w9968cf_device* cam, struct video_picture pict)
 	cam->hw_palette = hw_palette;
 
 	/* Settings changed, so we clear the frame buffers */
-	memset(cam->frame[0].buffer, 0, 
-	       cam->nbuffers*w9968cf_get_max_bufsize(cam));
+	memset(cam->frame[0].buffer, 0, cam->nbuffers*cam->frame[0].size);
 
-	DBG(4, "Palette is %s, depth is %d bpp.",
+	DBG(4, "Palette is %s, depth is %u bpp",
 	    symbolic(v4l1_plist, pict.palette), pict.depth)
 
 	return 0;
 
 error:
-	DBG(1, "Failed to change picture settings.")
+	DBG(1, "Failed to change picture settings")
 	return err;
 }
 
@@ -1921,69 +1992,24 @@ w9968cf_set_window(struct w9968cf_device* cam, struct video_window win)
 	cam->hw_height = h;
 
 	/* Settings changed, so we clear the frame buffers */
-	memset(cam->frame[0].buffer, 0, 
-	       cam->nbuffers*w9968cf_get_max_bufsize(cam));
+	memset(cam->frame[0].buffer, 0, cam->nbuffers*cam->frame[0].size);
 
-	DBG(4, "The capture area is %dx%d, Offset (x,y)=(%d,%d).", 
+	DBG(4, "The capture area is %dx%d, Offset (x,y)=(%u,%u)", 
 	    win.width, win.height, win.x, win.y)
 
-	PDBGG("x=%d ,y=%d, w=%d, h=%d, ax=%d, ay=%d, s_win.x=%d, s_win.y=%d, "
-	      "cw=%d, ch=%d, win.x=%d ,win.y=%d, win.width=%d, win.height=%d",
+	PDBGG("x=%u ,y=%u, w=%u, h=%u, ax=%u, ay=%u, s_win.x=%u, s_win.y=%u, "
+	      "cw=%u, ch=%u, win.x=%u, win.y=%u, win.width=%u, win.height=%u",
 	      x, y, w, h, ax, ay, s_win.x, s_win.y, cw, ch, win.x, win.y,
 	      win.width, win.height)
 
 	return 0;
 
 error:
-	DBG(1, "Failed to change the capture area size.")
+	DBG(1, "Failed to change the capture area size")
 	return err;
 }
 
 
-/*--------------------------------------------------------------------------
-  Return non-zero if the palette is supported, 0 otherwise.
-  --------------------------------------------------------------------------*/
-static inline u16 w9968cf_valid_palette(u16 palette)
-{
-	u8 i = 0;
-	while (w9968cf_formatlist[i].palette != 0) {
-		if (palette == w9968cf_formatlist[i].palette)
-			return palette;
-		i++;
-	}
-	return 0;
-}
-
-
-/*--------------------------------------------------------------------------
-  Return the depth corresponding to the given palette.
-  Palette _must_ be supported !
-  --------------------------------------------------------------------------*/
-static inline u16 w9968cf_valid_depth(u16 palette)
-{
-	u8 i=0;
-	while (w9968cf_formatlist[i].palette != palette)
-		i++;
-
-	return w9968cf_formatlist[i].depth;
-}
-
-
-/*--------------------------------------------------------------------------
-  Return non-zero if the format requires decompression, 0 otherwise.
-  --------------------------------------------------------------------------*/
-static inline u8 w9968cf_need_decompression(u16 palette)
-{
-	u8 i = 0;
-	while (w9968cf_formatlist[i].palette != 0) {
-		if (palette == w9968cf_formatlist[i].palette)
-			return w9968cf_formatlist[i].compression;
-		i++;
-	}
-	return 0;
-}
-
-
 /*-------------------------------------------------------------------------- 
   Adjust the asked values for window width and height.
   Return 0 on success, -1 otherwise.
@@ -1996,10 +2022,12 @@ w9968cf_adjust_window_size(struct w9968cf_device* cam, u16* width, u16* height)
 	if ((*width < cam->minwidth) || (*height < cam->minheight))
 		return -ERANGE;
 
-	maxw = cam->upscaling && !(cam->vpp_flag & VPP_DECOMPRESSION)
-	       && w9968cf_vppmod_present ? W9968CF_MAX_WIDTH : cam->maxwidth;
-	maxh = cam->upscaling && !(cam->vpp_flag & VPP_DECOMPRESSION)
-	       && w9968cf_vppmod_present ? W9968CF_MAX_HEIGHT : cam->maxheight;
+	maxw = cam->upscaling && !(cam->vpp_flag & VPP_DECOMPRESSION) &&
+	       w9968cf_vpp ? max((u16)W9968CF_MAX_WIDTH, cam->maxwidth)
+	                   : cam->maxwidth;
+	maxh = cam->upscaling && !(cam->vpp_flag & VPP_DECOMPRESSION) &&
+	       w9968cf_vpp ? max((u16)W9968CF_MAX_HEIGHT, cam->maxheight)
+	                   : cam->maxheight;
 
 	if (*width > maxw)
 		*width = maxw;
@@ -2011,7 +2039,7 @@ w9968cf_adjust_window_size(struct w9968cf_device* cam, u16* width, u16* height)
 		*height &= ~15L;
 	}
 
-	PDBGG("Window size adjusted w=%d, h=%d ", *width, *height)
+	PDBGG("Window size adjusted w=%u, h=%u ", *width, *height)
 
 	return 0;
 }
@@ -2050,7 +2078,7 @@ static void w9968cf_push_frame(struct w9968cf_device* cam, u8 f_num)
 
 	spin_unlock_irqrestore(&cam->flist_lock, lock_flags);
 
-	DBG(6, "Frame #%d pushed into the FIFO list. Position %d.", f_num, f)
+	DBG(6, "Frame #%u pushed into the FIFO list. Position %u", f_num, f)
 }
 
 
@@ -2074,7 +2102,7 @@ w9968cf_pop_frame(struct w9968cf_device* cam, struct w9968cf_frame_t** framep)
 
 	spin_unlock(&cam->flist_lock);
 
-	DBG(6,"Popped frame #%zd from the list.",*framep-&cam->frame[0])
+	DBG(6,"Popped frame #%d from the list", (*framep)->number)
 }
 
 
@@ -2086,7 +2114,7 @@ static int
 w9968cf_postprocess_frame(struct w9968cf_device* cam, 
                           struct w9968cf_frame_t* fr)
 {
-	void *pIn = fr->buffer, *pOut = cam->vpp_buffer, *tmp;
+	void *pIn = fr->buffer, *pOut = cam->frame_vpp.buffer, *tmp;
 	u16 w = cam->window.width,
 	    h = cam->window.height,
 	    d = cam->picture.depth,
@@ -2102,41 +2130,41 @@ w9968cf_postprocess_frame(struct w9968cf_device* cam,
 	if (cam->vpp_flag & VPP_DECOMPRESSION) {
 		memcpy(pOut, pIn, fr->length);
 		_PSWAP(pIn, pOut)
-		err = (*w9968cf_vpp_decode)(pIn, fr->length, hw_w, hw_h, pOut);
-		PDBGG("Compressed frame length: %li",(unsigned long)fr->length)
+		err = w9968cf_vpp->decode(pIn, fr->length, hw_w, hw_h, pOut);
+		PDBGG("Compressed frame length: %lu",(unsigned long)fr->length)
 		fr->length = (hw_w*hw_h*hw_d)/8;
 		_PSWAP(pIn, pOut)
 		if (err) {
 			DBG(4, "An error occurred while decoding the frame: "
-			       "%s.", symbolic(decoder_errlist, err))
+			       "%s", symbolic(decoder_errlist, err))
 			return err;
 		} else
 			DBG(6, "Frame decoded")
 	}
 
 	if (cam->vpp_flag & VPP_SWAP_YUV_BYTES) {
-		(*w9968cf_vpp_swap_yuvbytes)(pIn, fr->length);
-		DBG(6, "Original UYVY component ordering changed.")
+		w9968cf_vpp->swap_yuvbytes(pIn, fr->length);
+		DBG(6, "Original UYVY component ordering changed")
 	}
 
 	if (cam->vpp_flag & VPP_UPSCALE) {
-		(*w9968cf_vpp_scale_up)(pIn, pOut, hw_w, hw_h, hw_d, w, h);
+		w9968cf_vpp->scale_up(pIn, pOut, hw_w, hw_h, hw_d, w, h);
 		fr->length = (w*h*hw_d)/8;
 		_PSWAP(pIn, pOut)
-		DBG(6, "Vertical up-scaling done: %d,%d,%dbpp->%d,%d",
+		DBG(6, "Vertical up-scaling done: %u,%u,%ubpp->%u,%u",
 		    hw_w, hw_h, hw_d, w, h)
 	}
 
 	if (cam->vpp_flag & VPP_UYVY_TO_RGBX) {
-		(*w9968cf_vpp_uyvy_to_rgbx)(pIn, fr->length, pOut, fmt, rgb);
+		w9968cf_vpp->uyvy_to_rgbx(pIn, fr->length, pOut, fmt, rgb);
 		fr->length = (w*h*d)/8;
 		_PSWAP(pIn, pOut)
-		DBG(6, "UYVY-16bit to %s conversion done.", 
+		DBG(6, "UYVY-16bit to %s conversion done", 
 		    symbolic(v4l1_plist, fmt))
 	}
 
 	if (pOut == fr->buffer)
-		memcpy(fr->buffer, cam->vpp_buffer, fr->length);
+		memcpy(fr->buffer, cam->frame_vpp.buffer, fr->length);
 
 	return 0;
 }
@@ -2144,7 +2172,7 @@ w9968cf_postprocess_frame(struct w9968cf_device* cam,
 
 
 /****************************************************************************
- * CMOS sensor control routines                                             *
+ * Image sensor control routines                                            *
  ****************************************************************************/
 
 static int 
@@ -2178,23 +2206,23 @@ w9968cf_sensor_get_control(struct w9968cf_device* cam, int cid, int* val)
 }
 
 
-static inline int
+static int
 w9968cf_sensor_cmd(struct w9968cf_device* cam, unsigned int cmd, void* arg)
 {
 	struct i2c_client* c = cam->sensor_client;
 	int rc = 0;
 
-	if (c->driver->command) {
-		rc = c->driver->command(cam->sensor_client, cmd, arg);
-		/* The I2C driver returns -EPERM on non-supported controls */
-		return (rc < 0 && rc != -EPERM) ? rc : 0;
-	} else
-		return -ENODEV;
+	if (!c || !c->driver || !c->driver->command)
+		return -EINVAL;
+
+	rc = c->driver->command(c, cmd, arg);
+	/* The I2C driver returns -EPERM on non-supported controls */
+	return (rc < 0 && rc != -EPERM) ? rc : 0;
 }
 
 
 /*--------------------------------------------------------------------------
-  Update some settings of the CMOS sensor.
+  Update some settings of the image sensor.
   Returns: 0 on success, a negative number otherwise.
   --------------------------------------------------------------------------*/
 static int w9968cf_sensor_update_settings(struct w9968cf_device* cam)
@@ -2242,7 +2270,7 @@ static int w9968cf_sensor_update_settings(struct w9968cf_device* cam)
 
 
 /*--------------------------------------------------------------------------
-  Get some current picture settings from the CMOS sensor and update the
+  Get some current picture settings from the image sensor and update the
   internal 'picture' structure of the camera.
   Returns: 0 on success, a negative number otherwise.
   --------------------------------------------------------------------------*/
@@ -2270,10 +2298,10 @@ static int w9968cf_sensor_get_picture(struct w9968cf_device* cam)
 		return err;
 	cam->picture.hue = v;
 
-	DBG(5, "Got picture settings from the CMOS sensor.")
+	DBG(5, "Got picture settings from the image sensor")
 
 	PDBGG("Brightness, contrast, hue, colour, whiteness are "
-	      "%d,%d,%d,%d,%d.", cam->picture.brightness,cam->picture.contrast,
+	      "%u,%u,%u,%u,%u", cam->picture.brightness,cam->picture.contrast,
 	      cam->picture.hue, cam->picture.colour, cam->picture.whiteness)
 
 	return 0;
@@ -2281,7 +2309,7 @@ static int w9968cf_sensor_get_picture(struct w9968cf_device* cam)
 
 
 /*--------------------------------------------------------------------------
-  Update picture settings of the CMOS sensor.
+  Update picture settings of the image sensor.
   Returns: 0 on success, a negative number otherwise.
   --------------------------------------------------------------------------*/
 static int
@@ -2296,7 +2324,7 @@ w9968cf_sensor_update_picture(struct w9968cf_device* cam,
 		                                 pict.contrast);
 		if (err)
 			goto fail;
-		DBG(4, "Contrast changed from %d to %d.",
+		DBG(4, "Contrast changed from %u to %u",
 		    cam->picture.contrast, pict.contrast)
 		cam->picture.contrast = pict.contrast;
 	}
@@ -2307,7 +2335,7 @@ w9968cf_sensor_update_picture(struct w9968cf_device* cam,
 		                                 pict.brightness);
 		if (err)
 			goto fail;
-		DBG(4, "Brightness changed from %d to %d.",
+		DBG(4, "Brightness changed from %u to %u",
 		    cam->picture.brightness, pict.brightness)
 		cam->picture.brightness = pict.brightness;
 	}
@@ -2317,7 +2345,7 @@ w9968cf_sensor_update_picture(struct w9968cf_device* cam,
 		                                 pict.colour);
 		if (err)
 			goto fail;
-		DBG(4, "Colour changed from %d to %d.",
+		DBG(4, "Colour changed from %u to %u",
 		    cam->picture.colour, pict.colour)
 		cam->picture.colour = pict.colour;
 	}
@@ -2327,7 +2355,7 @@ w9968cf_sensor_update_picture(struct w9968cf_device* cam,
 		                                 pict.hue);
 		if (err)
 			goto fail;
-		DBG(4, "Hue changed from %d to %d.",
+		DBG(4, "Hue changed from %u to %u",
 		    cam->picture.hue, pict.hue)
 		cam->picture.hue = pict.hue;
 	}
@@ -2335,7 +2363,7 @@ w9968cf_sensor_update_picture(struct w9968cf_device* cam,
 	return 0;
 
 fail:
-	DBG(4, "Failed to change sensor picture setting.")
+	DBG(4, "Failed to change sensor picture setting")
 	return err;
 }
 
@@ -2346,7 +2374,7 @@ fail:
  ****************************************************************************/
 
 /*--------------------------------------------------------------------------
-  This function is called when a supported CMOS sensor is detected.
+  This function is called when a supported image sensor is detected.
   Return 0 if the initialization succeeds, a negative number otherwise.
   --------------------------------------------------------------------------*/
 static int w9968cf_sensor_init(struct w9968cf_device* cam)
@@ -2376,7 +2404,7 @@ static int w9968cf_sensor_init(struct w9968cf_device* cam)
 			cam->minheight = 48;
 			break;
 		default:
-			DBG(1, "Not supported CMOS sensor detected for %s.",
+			DBG(1, "Not supported image sensor detected for %s",
 			    symbolic(camlist, cam->id))
 			return -EINVAL;
 	}
@@ -2386,7 +2414,7 @@ static int w9968cf_sensor_init(struct w9968cf_device* cam)
 		case CC_OV7620:
 			cam->start_cropx = 287;
 			cam->start_cropy = 35;
-			/* Seems to work around a bug in the CMOS sensor */
+			/* Seems to work around a bug in the image sensor */
 			cam->vs_polarity = 1;
 			cam->hs_polarity = 1;
 			break;
@@ -2405,14 +2433,14 @@ static int w9968cf_sensor_init(struct w9968cf_device* cam)
 
 	cam->sensor_initialized = 1;
 
-	DBG(2, "%s CMOS sensor initialized.", symbolic(senlist, cam->sensor))
+	DBG(2, "%s image sensor initialized", symbolic(senlist, cam->sensor))
 	return 0;
 
 error:
 	cam->sensor_initialized = 0;
 	cam->sensor = CC_UNKNOWN;
-	DBG(1, "CMOS sensor initialization failed for %s (/dev/video%d). "
-	       "Try to detach and attach this device again.",
+	DBG(1, "Image sensor initialization failed for %s (/dev/video%d). "
+	       "Try to detach and attach this device again",
 	    symbolic(camlist, cam->id), cam->v4ldev->minor)
 	return err;
 }
@@ -2436,7 +2464,6 @@ w9968cf_configure_camera(struct w9968cf_device* cam,
 
 	cam->users = 0;
 	cam->disconnected = 0;
-	cam->usbdev = udev;
 	cam->id = mod_id;
 	cam->sensor = CC_UNKNOWN;
 	cam->sensor_initialized = 0;
@@ -2521,6 +2548,7 @@ w9968cf_configure_camera(struct w9968cf_device* cam,
 		else
 			cam->picture.palette = W9968CF_PALETTE_DECOMP_ON;
 	}
+	cam->picture.depth = w9968cf_valid_depth(cam->picture.palette);
 
 	cam->force_rgb = (force_rgb[dev_nr] == 0 || force_rgb[dev_nr] == 1)
 	                 ? (u8)force_rgb[dev_nr] : W9968CF_FORCE_RGB;
@@ -2533,105 +2561,120 @@ w9968cf_configure_camera(struct w9968cf_device* cam,
 	cam->window.clipcount = 0;
 	cam->window.flags = 0;
 
-	/* If the video post-processing module is not present, some paramaters
-	   must be overridden: */
-	if (!w9968cf_vppmod_present) {
-		if (cam->decompression == 1)
-			cam->decompression = 2;
-		cam->upscaling = 0;
-		if (cam->picture.palette != VIDEO_PALETTE_UYVY)
-			cam->force_palette = 0;
-		cam->picture.palette = VIDEO_PALETTE_UYVY;
-	}
-
-	cam->picture.depth = w9968cf_valid_depth(cam->picture.palette);
-
-	DBG(3, "%s configured with settings #%d:", 
+	DBG(3, "%s configured with settings #%u:",
 	    symbolic(camlist, cam->id), dev_nr)
 	
-	DBG(3, "- Data packet size for USB isochrnous transfer: %d bytes.",
+	DBG(3, "- Data packet size for USB isochrnous transfer: %u bytes",
 	    wMaxPacketSize[cam->altsetting-1])
 	
-	DBG(3, "- Number of requested video frame buffers: %d", 
+	DBG(3, "- Number of requested video frame buffers: %u",
 	    cam->max_buffers)
 
 	if (cam->double_buffer)
-		DBG(3, "- Hardware double buffering enabled.")
+		DBG(3, "- Hardware double buffering enabled")
 	else 
-		DBG(3, "- Hardware double buffering disabled.")
+		DBG(3, "- Hardware double buffering disabled")
 
 	if (cam->filter_type == 0)
-		DBG(3, "- Video filtering disabled.")
+		DBG(3, "- Video filtering disabled")
 	else if (cam->filter_type == 1)
-		DBG(3, "- Video filtering enabled: type 1-2-1.")
+		DBG(3, "- Video filtering enabled: type 1-2-1")
 	else if (cam->filter_type == 2)
-		DBG(3, "- Video filtering enabled: type 2-3-6-3-2.")
+		DBG(3, "- Video filtering enabled: type 2-3-6-3-2")
 
 	if (cam->clamping)
-		DBG(3, "- Video data clamping (CCIR-601 format) enabled.")
+		DBG(3, "- Video data clamping (CCIR-601 format) enabled")
 	else
-		DBG(3, "- Video data clamping (CCIR-601 format) disabled.")
+		DBG(3, "- Video data clamping (CCIR-601 format) disabled")
 
 	if (cam->largeview)
-		DBG(3, "- Large view enabled.")
+		DBG(3, "- Large view enabled")
 	else
-		DBG(3, "- Large view disabled.")
+		DBG(3, "- Large view disabled")
 
 	if ((cam->decompression) == 0 && (!cam->force_palette))
-		DBG(3, "- Decompression disabled.")
+		DBG(3, "- Decompression disabled")
 	else if ((cam->decompression) == 1 && (!cam->force_palette))
-		DBG(3, "- Decompression forced.")
+		DBG(3, "- Decompression forced")
 	else if ((cam->decompression) == 2 && (!cam->force_palette))
-		DBG(3, "- Decompression allowed.")
+		DBG(3, "- Decompression allowed")
 
 	if (cam->upscaling)
-		DBG(3, "- Software image scaling enabled.")
+		DBG(3, "- Software image scaling enabled")
 	else
-		DBG(3, "- Software image scaling disabled.")
+		DBG(3, "- Software image scaling disabled")
 
 	if (cam->force_palette)
-		DBG(3, "- Image palette forced to %s.",
+		DBG(3, "- Image palette forced to %s",
 		    symbolic(v4l1_plist, cam->picture.palette))
 
 	if (cam->force_rgb)
-		DBG(3, "- RGB component ordering will be used instead of BGR.")
+		DBG(3, "- RGB component ordering will be used instead of BGR")
 
 	if (cam->auto_brt)
-		DBG(3, "- Auto brightness enabled.")
+		DBG(3, "- Auto brightness enabled")
 	else
-		DBG(3, "- Auto brightness disabled.")
+		DBG(3, "- Auto brightness disabled")
 
 	if (cam->auto_exp)
-		DBG(3, "- Auto exposure enabled.")
+		DBG(3, "- Auto exposure enabled")
 	else
-		DBG(3, "- Auto exposure disabled.")
+		DBG(3, "- Auto exposure disabled")
 
 	if (cam->backlight)
-		DBG(3, "- Backlight exposure algorithm enabled.")
+		DBG(3, "- Backlight exposure algorithm enabled")
 	else
-		DBG(3, "- Backlight exposure algorithm disabled.")
+		DBG(3, "- Backlight exposure algorithm disabled")
 
 	if (cam->mirror)
-		DBG(3, "- Mirror enabled.")
+		DBG(3, "- Mirror enabled")
 	else
-		DBG(3, "- Mirror disabled.")
+		DBG(3, "- Mirror disabled")
 
 	if (cam->bandfilt)
-		DBG(3, "- Banding filter enabled.")
+		DBG(3, "- Banding filter enabled")
 	else
-		DBG(3, "- Banding filter disabled.")
+		DBG(3, "- Banding filter disabled")
 
-	DBG(3, "- Power lighting frequency: %d", cam->lightfreq)
+	DBG(3, "- Power lighting frequency: %u", cam->lightfreq)
 
 	if (cam->clockdiv == -1)
-		DBG(3, "- Automatic clock divisor enabled.")
+		DBG(3, "- Automatic clock divisor enabled")
 	else
 		DBG(3, "- Clock divisor: %d", cam->clockdiv)
 
 	if (cam->monochrome)
-		DBG(3, "- CMOS sensor used as monochrome.")
+		DBG(3, "- Image sensor used as monochrome")
 	else
-		DBG(3, "- CMOS sensor not used as monochrome.")
+		DBG(3, "- Image sensor not used as monochrome")
+}
+
+
+/*--------------------------------------------------------------------------
+  If the video post-processing module is not loaded, some parameters
+  must be overridden.
+  --------------------------------------------------------------------------*/
+static void w9968cf_adjust_configuration(struct w9968cf_device* cam)
+{
+	if (!w9968cf_vpp) {
+		if (cam->decompression == 1) {
+			cam->decompression = 2;
+			DBG(2, "Video post-processing module not found: "
+			       "'decompression' parameter forced to 2")
+		}
+		if (cam->upscaling) {
+			cam->upscaling = 0;
+			DBG(2, "Video post-processing module not found: "
+			       "'upscaling' parameter forced to 0")
+		}
+		if (cam->picture.palette != VIDEO_PALETTE_UYVY) {
+			cam->force_palette = 0;
+			DBG(2, "Video post-processing module not found: "
+			       "'force_palette' parameter forced to 0")
+		}
+		cam->picture.palette = VIDEO_PALETTE_UYVY;
+		cam->picture.depth = w9968cf_valid_depth(cam->picture.palette);
+	}
 }
 
 
@@ -2654,8 +2697,6 @@ static void w9968cf_release_resources(struct w9968cf_device* cam)
 	kfree(cam->data_buffer);
 
 	up(&w9968cf_devlist_sem);
-
-	DBG(5, "Resources released.")
 }
 
 
@@ -2669,38 +2710,45 @@ static int w9968cf_open(struct inode* inode, struct file* filp)
 	struct w9968cf_device* cam;
 	int err;
 
+	/* This the only safe way to prevent race conditions with disconnect */
+	if (!down_read_trylock(&w9968cf_disconnect))
+		return -ERESTARTSYS;
+
 	cam = (struct w9968cf_device*)video_get_drvdata(video_devdata(filp));
 
 	down(&cam->dev_sem);
 
 	if (cam->sensor == CC_UNKNOWN) {
-		DBG(2, "No supported CMOS sensor has been detected by the "
+		DBG(2, "No supported image sensor has been detected by the "
 		       "'ovcamchip' module for the %s (/dev/video%d). Make "
-		       "sure it is loaded *before* the 'w9968cf' module.", 
+		       "sure it is loaded *before* (re)connecting the camera.",
 		    symbolic(camlist, cam->id), cam->v4ldev->minor)
 		up(&cam->dev_sem);
+		up_read(&w9968cf_disconnect);
 		return -ENODEV;
 	}
 
 	if (cam->users) {
-		DBG(2, "%s (/dev/video%d) has been already occupied by '%s'.",
+		DBG(2, "%s (/dev/video%d) has been already occupied by '%s'",
 		    symbolic(camlist, cam->id),cam->v4ldev->minor,cam->command)
 		if ((filp->f_flags & O_NONBLOCK)||(filp->f_flags & O_NDELAY)) {
 			up(&cam->dev_sem);
+			up_read(&w9968cf_disconnect);
 			return -EWOULDBLOCK;
 		}
-retry:
 		up(&cam->dev_sem);
-		err = wait_event_interruptible(cam->open, cam->disconnected ||
-		                               (cam->users == 0));
-		if (err)
+		err = wait_event_interruptible_exclusive(cam->open,
+		                                         cam->disconnected ||
+		                                         !cam->users);
+		if (err) {
+			up_read(&w9968cf_disconnect);
 			return err;
-		if (cam->disconnected)
+		}
+		if (cam->disconnected) {
+			up_read(&w9968cf_disconnect);
 			return -ENODEV;
+		}
 		down(&cam->dev_sem);
-		/*recheck - there may be several waiters */
-		if (cam->users)
-			goto retry;
 	}
 
 	DBG(5, "Opening '%s', /dev/video%d ...",
@@ -2709,8 +2757,9 @@ retry:
 	cam->streaming = 0;
 	cam->misconfigured = 0;
 
-	if (!w9968cf_vppmod_present)
-		w9968cf_vppmod_detect();
+	if (!w9968cf_vpp)
+		if ((err = w9968cf_vppmod_detect(cam)))
+			goto out;
 
 	if ((err = w9968cf_allocate_memory(cam)))
 		goto deallocate_memory;
@@ -2728,15 +2777,19 @@ retry:
 
 	init_waitqueue_head(&cam->wait_queue);
 
+	DBG(5, "Video device is open")
+
 	up(&cam->dev_sem);
+	up_read(&w9968cf_disconnect);
 
-	DBG(5, "Video device is open.")
 	return 0;
 
 deallocate_memory:
 	w9968cf_deallocate_memory(cam);
-	DBG(2, "Failed to open the video device.")
+out:
+	DBG(2, "Failed to open the video device")
 	up(&cam->dev_sem);
+	up_read(&w9968cf_disconnect);
 	return err;
 }
 
@@ -2751,6 +2804,8 @@ static int w9968cf_release(struct inode* inode, struct file* filp)
 
 	w9968cf_stop_transfer(cam);
 
+	w9968cf_vppmod_release(cam);
+
 	if (cam->disconnected) {
 		w9968cf_release_resources(cam);
 		up(&cam->dev_sem);
@@ -2760,17 +2815,16 @@ static int w9968cf_release(struct inode* inode, struct file* filp)
 
 	cam->users--;
 	w9968cf_deallocate_memory(cam);
+	wake_up_interruptible_nr(&cam->open, 1);
 
-	wake_up_interruptible(&cam->open);
-
-	DBG(5, "Video device closed.")
+	DBG(5, "Video device closed")
 	up(&cam->dev_sem);
 	return 0;
 }
 
 
 static ssize_t
-w9968cf_read(struct file* filp, char* buf, size_t count, loff_t* f_pos)
+w9968cf_read(struct file* filp, char __user * buf, size_t count, loff_t* f_pos)
 {
 	struct w9968cf_device* cam;
 	struct w9968cf_frame_t* fr;
@@ -2785,7 +2839,7 @@ w9968cf_read(struct file* filp, char* buf, size_t count, loff_t* f_pos)
 		return -ERESTARTSYS;
 
 	if (cam->disconnected) {
-		DBG(2, "Device not present.")
+		DBG(2, "Device not present")
 		up(&cam->fileop_sem);
 		return -ENODEV;
 	}
@@ -2817,7 +2871,7 @@ w9968cf_read(struct file* filp, char* buf, size_t count, loff_t* f_pos)
 
 	fr = (cam->frame[0].status == F_READY) ? &cam->frame[0]:&cam->frame[1];
 
-	if (w9968cf_vppmod_present)
+	if (w9968cf_vpp)
 		w9968cf_postprocess_frame(cam, fr);
 
 	if (count > fr->length)
@@ -2832,7 +2886,7 @@ w9968cf_read(struct file* filp, char* buf, size_t count, loff_t* f_pos)
 
 	fr->status = F_UNUSED;
 
-	DBG(5, "%zd bytes read.", count)
+	DBG(5, "%zu bytes read", count)
 
 	up(&cam->fileop_sem);
 	return count;
@@ -2844,25 +2898,25 @@ static int w9968cf_mmap(struct file* filp, struct vm_area_struct *vma)
 	struct w9968cf_device* cam = (struct w9968cf_device*)
 	                             video_get_drvdata(video_devdata(filp));
 	unsigned long vsize = vma->vm_end - vma->vm_start,
-	              psize = cam->nbuffers * w9968cf_get_max_bufsize(cam),
+	              psize = cam->nbuffers * cam->frame[0].size,
 	              start = vma->vm_start,
 	              pos = (unsigned long)cam->frame[0].buffer,
 	              page;
 
 	if (cam->disconnected) {
-		DBG(2, "Device not present.")
+		DBG(2, "Device not present")
 		return -ENODEV;
 	}
 
 	if (cam->misconfigured) {
-		DBG(2, "The camera is misconfigured. Close and open it again.")
+		DBG(2, "The camera is misconfigured. Close and open it again")
 		return -EIO;
 	}
 
-	PDBGG("mmapping %li bytes...", vsize)
+	PDBGG("mmapping %lu bytes...", vsize)
 
-        if (vsize > psize - (vma->vm_pgoff << PAGE_SHIFT))
-		return -EAGAIN;
+	if (vsize > psize - (vma->vm_pgoff << PAGE_SHIFT))
+		return -EINVAL;
 
 	while (vsize > 0) {
 		page = kvirt_to_pa(pos) + vma->vm_pgoff;
@@ -2871,10 +2925,10 @@ static int w9968cf_mmap(struct file* filp, struct vm_area_struct *vma)
 			return -EAGAIN;
 		start += PAGE_SIZE;
 		pos += PAGE_SIZE;
-		vsize = (vsize > PAGE_SIZE) ? vsize-PAGE_SIZE : 0;
+		vsize -= PAGE_SIZE;
 	}
 
-	DBG(5, "mmap method successfully called.")
+	DBG(5, "mmap method successfully called")
 	return 0;
 }
 
@@ -2892,7 +2946,7 @@ w9968cf_ioctl(struct inode* inode, struct file* filp,
 		return -ERESTARTSYS;
 
 	if (cam->disconnected) {
-		DBG(2, "Device not present.")
+		DBG(2, "Device not present")
 		up(&cam->fileop_sem);
 		return -ENODEV;
 	}
@@ -2903,16 +2957,15 @@ w9968cf_ioctl(struct inode* inode, struct file* filp,
 		return -EIO;
 	}
 
-	err = w9968cf_v4l_ioctl(inode, filp, cmd, (void* )arg);
+	err = w9968cf_v4l_ioctl(inode, filp, cmd, (void __user *)arg);
 
 	up(&cam->fileop_sem);
 	return err;
 }
 
 
-static int 
-w9968cf_v4l_ioctl(struct inode* inode, struct file* filp,
-                  unsigned int cmd, void* arg)
+static int w9968cf_v4l_ioctl(struct inode* inode, struct file* filp,
+                             unsigned int cmd, void __user * arg)
 {
 	struct w9968cf_device* cam;
 	const char* v4l1_ioctls[] = {
@@ -2943,15 +2996,17 @@ w9968cf_v4l_ioctl(struct inode* inode, struct file* filp,
 		};
 		sprintf(cap.name, "W996[87]CF USB Camera #%d", 
 		        cam->v4ldev->minor);
-		cap.maxwidth = (cam->upscaling && w9968cf_vppmod_present)
-		               ? W9968CF_MAX_WIDTH : cam->maxwidth;
-		cap.maxheight = (cam->upscaling && w9968cf_vppmod_present)
-		                ? W9968CF_MAX_HEIGHT : cam->maxheight;
+		cap.maxwidth = (cam->upscaling && w9968cf_vpp)
+		               ? max((u16)W9968CF_MAX_WIDTH, cam->maxwidth) 
+		                 : cam->maxwidth;
+		cap.maxheight = (cam->upscaling && w9968cf_vpp)
+		                ? max((u16)W9968CF_MAX_HEIGHT, cam->maxheight)
+		                  : cam->maxheight;
 
 		if (copy_to_user(arg, &cap, sizeof(cap)))
 			return -EFAULT;
 
-		DBG(5, "VIDIOCGCAP successfully called.")
+		DBG(5, "VIDIOCGCAP successfully called")
 		return 0;
 	}
 
@@ -2973,7 +3028,7 @@ w9968cf_v4l_ioctl(struct inode* inode, struct file* filp,
 		if (copy_to_user(arg, &chan, sizeof(chan)))
 			return -EFAULT;
 
-		DBG(5, "VIDIOCGCHAN successfully called.")
+		DBG(5, "VIDIOCGCHAN successfully called")
 		return 0;
 	}
 
@@ -2987,7 +3042,7 @@ w9968cf_v4l_ioctl(struct inode* inode, struct file* filp,
 		if (chan.channel != 0)
 			return -EINVAL;
 
-		DBG(5, "VIDIOCSCHAN successfully called.")
+		DBG(5, "VIDIOCSCHAN successfully called")
 		return 0;
 	}
 
@@ -2999,7 +3054,7 @@ w9968cf_v4l_ioctl(struct inode* inode, struct file* filp,
 		if (copy_to_user(arg, &cam->picture, sizeof(cam->picture)))
 			return -EFAULT;
 
-		DBG(5, "VIDIOCGPICT successfully called.")
+		DBG(5, "VIDIOCGPICT successfully called")
 		return 0;
 	}
 
@@ -3011,16 +3066,16 @@ w9968cf_v4l_ioctl(struct inode* inode, struct file* filp,
 		if (copy_from_user(&pict, arg, sizeof(pict)))
 			return -EFAULT;
 
-		if ( (cam->force_palette || !w9968cf_vppmod_present) 
+		if ( (cam->force_palette || !w9968cf_vpp) 
 		     && pict.palette != cam->picture.palette ) {
-			DBG(4, "Palette %s rejected. Only %s is allowed.",
+			DBG(4, "Palette %s rejected: only %s is allowed",
 			    symbolic(v4l1_plist, pict.palette),
 			    symbolic(v4l1_plist, cam->picture.palette))
 			return -EINVAL;
 		}
 
 		if (!w9968cf_valid_palette(pict.palette)) {
-			DBG(4, "Palette %s not supported. VIDIOCSPICT failed.",
+			DBG(4, "Palette %s not supported. VIDIOCSPICT failed",
 			    symbolic(v4l1_plist, pict.palette))
 			return -EINVAL;
 		}
@@ -3029,14 +3084,14 @@ w9968cf_v4l_ioctl(struct inode* inode, struct file* filp,
 		   if (cam->decompression == 0) {
 		      if (w9968cf_need_decompression(pict.palette)) {
 		         DBG(4, "Decompression disabled: palette %s is not "
-		                "allowed. VIDIOCSPICT failed.",
+		                "allowed. VIDIOCSPICT failed",
 		             symbolic(v4l1_plist, pict.palette))
 		         return -EINVAL;
 		      }
 		   } else if (cam->decompression == 1) {
 		      if (!w9968cf_need_decompression(pict.palette)) {
 		         DBG(4, "Decompression forced: palette %s is not "
-		                "allowed. VIDIOCSPICT failed.",
+		                "allowed. VIDIOCSPICT failed",
 		             symbolic(v4l1_plist, pict.palette))
 		         return -EINVAL;
 		      }
@@ -3044,8 +3099,8 @@ w9968cf_v4l_ioctl(struct inode* inode, struct file* filp,
 		}
 
 		if (pict.depth != w9968cf_valid_depth(pict.palette)) {
-			DBG(4, "Requested depth %d bpp is not valid for %s "
-			       "palette: ignored and changed to %d bpp.", 
+			DBG(4, "Requested depth %u bpp is not valid for %s "
+			       "palette: ignored and changed to %u bpp", 
 			    pict.depth, symbolic(v4l1_plist, pict.palette),
 			    w9968cf_valid_depth(pict.palette))
 			pict.depth = w9968cf_valid_depth(pict.palette);
@@ -3078,7 +3133,7 @@ w9968cf_v4l_ioctl(struct inode* inode, struct file* filp,
 			return -EIO;
 
 
-		DBG(5, "VIDIOCSPICT successfully called.")
+		DBG(5, "VIDIOCSPICT successfully called")
 		return 0;
 	}
 
@@ -3090,8 +3145,8 @@ w9968cf_v4l_ioctl(struct inode* inode, struct file* filp,
 		if (copy_from_user(&win, arg, sizeof(win)))
 			return -EFAULT;
 
-		DBG(6, "VIDIOCSWIN called: clipcount=%d, flags=%d, "
-		       "x=%d, y=%d, %dx%d", win.clipcount, win.flags,
+		DBG(6, "VIDIOCSWIN called: clipcount=%d, flags=%u, "
+		       "x=%u, y=%u, %ux%u", win.clipcount, win.flags,
 		    win.x, win.y, win.width, win.height)
 
 		if (win.clipcount != 0 || win.flags != 0)
@@ -3099,8 +3154,8 @@ w9968cf_v4l_ioctl(struct inode* inode, struct file* filp,
 
 		if ((err = w9968cf_adjust_window_size(cam, (u16*)&win.width,
 		                                      (u16*)&win.height))) {
-			DBG(4, "Resolution not supported (%dx%d)."
-			       "VIDIOCSWIN failed.", win.width, win.height)
+			DBG(4, "Resolution not supported (%ux%u). "
+			       "VIDIOCSWIN failed", win.width, win.height)
 			return err;
 		}
 
@@ -3144,7 +3199,7 @@ w9968cf_v4l_ioctl(struct inode* inode, struct file* filp,
 		if (copy_to_user(arg,&cam->window,sizeof(struct video_window)))
 			return -EFAULT;
 
-		DBG(5, "VIDIOCGWIN successfully called.")
+		DBG(5, "VIDIOCGWIN successfully called")
 		return 0;
 	}
 
@@ -3153,7 +3208,7 @@ w9968cf_v4l_ioctl(struct inode* inode, struct file* filp,
 		struct video_mbuf mbuf;
 		u8 i;
 
-		mbuf.size = cam->nbuffers * w9968cf_get_max_bufsize(cam);
+		mbuf.size = cam->nbuffers * cam->frame[0].size;
 		mbuf.frames = cam->nbuffers;
 		for (i = 0; i < cam->nbuffers; i++)
 			mbuf.offsets[i] = (unsigned long)cam->frame[i].buffer -
@@ -3162,7 +3217,7 @@ w9968cf_v4l_ioctl(struct inode* inode, struct file* filp,
 		if (copy_to_user(arg, &mbuf, sizeof(mbuf)))
 			return -EFAULT;
 
-		DBG(5, "VIDIOCGMBUF successfully called.")
+		DBG(5, "VIDIOCGMBUF successfully called")
 		return 0;
 	}
 
@@ -3175,19 +3230,19 @@ w9968cf_v4l_ioctl(struct inode* inode, struct file* filp,
 		if (copy_from_user(&mmap, arg, sizeof(mmap)))
 			return -EFAULT;
 
-		DBG(6, "VIDIOCMCAPTURE called: frame #%d, format=%s, %dx%d",
+		DBG(6, "VIDIOCMCAPTURE called: frame #%u, format=%s, %dx%d",
 		    mmap.frame, symbolic(v4l1_plist, mmap.format), 
 		    mmap.width, mmap.height)
 
 		if (mmap.frame >= cam->nbuffers) {
-			DBG(4, "Invalid frame number (%d). "
-			       "VIDIOCMCAPTURE failed.", mmap.frame)
+			DBG(4, "Invalid frame number (%u). "
+			       "VIDIOCMCAPTURE failed", mmap.frame)
 			return -EINVAL;
 		}
 
 		if (mmap.format!=cam->picture.palette && 
-		    (cam->force_palette || !w9968cf_vppmod_present)) {
-			DBG(4, "Palette %s rejected. Only %s is allowed.",
+		    (cam->force_palette || !w9968cf_vpp)) {
+			DBG(4, "Palette %s rejected: only %s is allowed",
 			    symbolic(v4l1_plist, mmap.format),
 			    symbolic(v4l1_plist, cam->picture.palette))
 			return -EINVAL;
@@ -3195,7 +3250,7 @@ w9968cf_v4l_ioctl(struct inode* inode, struct file* filp,
 
 		if (!w9968cf_valid_palette(mmap.format)) {
 			DBG(4, "Palette %s not supported. "
-			       "VIDIOCMCAPTURE failed.", 
+			       "VIDIOCMCAPTURE failed", 
 			    symbolic(v4l1_plist, mmap.format))
 			return -EINVAL;
 		}
@@ -3204,14 +3259,14 @@ w9968cf_v4l_ioctl(struct inode* inode, struct file* filp,
 		   if (cam->decompression == 0) {
 		      if (w9968cf_need_decompression(mmap.format)) {
 		         DBG(4, "Decompression disabled: palette %s is not "
-		                "allowed. VIDIOCSPICT failed.",
+		                "allowed. VIDIOCSPICT failed",
 		             symbolic(v4l1_plist, mmap.format))
 		         return -EINVAL;
 		      }
 		   } else if (cam->decompression == 1) {
 		      if (!w9968cf_need_decompression(mmap.format)) {
 		         DBG(4, "Decompression forced: palette %s is not "
-		                "allowed. VIDIOCSPICT failed.",
+		                "allowed. VIDIOCSPICT failed",
 		             symbolic(v4l1_plist, mmap.format))
 		         return -EINVAL;
 		      }
@@ -3221,7 +3276,7 @@ w9968cf_v4l_ioctl(struct inode* inode, struct file* filp,
 		if ((err = w9968cf_adjust_window_size(cam, (u16*)&mmap.width, 
 		                                      (u16*)&mmap.height))) {
 			DBG(4, "Resolution not supported (%dx%d). "
-			       "VIDIOCMCAPTURE failed.",
+			       "VIDIOCMCAPTURE failed",
 			    mmap.width, mmap.height)
 			return err;
 		}
@@ -3238,7 +3293,7 @@ w9968cf_v4l_ioctl(struct inode* inode, struct file* filp,
 			if(*cam->requested_frame
 			   || cam->frame_current->queued) {
 				DBG(6, "VIDIOCMCAPTURE. Change settings for "
-				       "frame #%d: %dx%d, format %s. Wait...",
+				       "frame #%u: %dx%d, format %s. Wait...",
 				    mmap.frame, mmap.width, mmap.height,
 			            symbolic(v4l1_plist, mmap.format))
 				err = wait_event_interruptible
@@ -3273,7 +3328,7 @@ w9968cf_v4l_ioctl(struct inode* inode, struct file* filp,
 
 		} else 	if (fr->queued) {
 
-			DBG(6, "Wait until frame #%d is free.", mmap.frame)
+			DBG(6, "Wait until frame #%u is free", mmap.frame)
 			
 			err = wait_event_interruptible(cam->wait_queue, 
 			                               cam->disconnected ||
@@ -3285,7 +3340,7 @@ w9968cf_v4l_ioctl(struct inode* inode, struct file* filp,
 		}
 
 		w9968cf_push_frame(cam, mmap.frame);
-		DBG(5, "VIDIOCMCAPTURE(%d): successfully called.", mmap.frame)
+		DBG(5, "VIDIOCMCAPTURE(%u): successfully called", mmap.frame)
 		return 0;
 	}
 
@@ -3299,19 +3354,19 @@ w9968cf_v4l_ioctl(struct inode* inode, struct file* filp,
 			return -EFAULT;
 
 		if (f_num >= cam->nbuffers) {
-			DBG(4, "Invalid frame number (%d). "
-			       "VIDIOCMCAPTURE failed.", f_num)
+			DBG(4, "Invalid frame number (%u). "
+			       "VIDIOCMCAPTURE failed", f_num)
 			return -EINVAL;
 		}
 
-		DBG(6, "VIDIOCSYNC called for frame #%d", f_num)
+		DBG(6, "VIDIOCSYNC called for frame #%u", f_num)
 
 		fr = &cam->frame[f_num];
 
 		switch (fr->status) {
 		case F_UNUSED:
 			if (!fr->queued) {
-				DBG(4, "VIDIOSYNC: Frame #%d not requested!",
+				DBG(4, "VIDIOSYNC: Frame #%u not requested!",
 				    f_num)
 				return -EFAULT;
 			}
@@ -3329,12 +3384,12 @@ w9968cf_v4l_ioctl(struct inode* inode, struct file* filp,
 			break;
 		}
 
-		if (w9968cf_vppmod_present)
+		if (w9968cf_vpp)
 			w9968cf_postprocess_frame(cam, fr);
 
 		fr->status = F_UNUSED;
 
-		DBG(5, "VIDIOCSYNC(%d) successfully called.", f_num)
+		DBG(5, "VIDIOCSYNC(%u) successfully called", f_num)
 		return 0;
 	}
 
@@ -3351,7 +3406,7 @@ w9968cf_v4l_ioctl(struct inode* inode, struct file* filp,
 		if (copy_to_user(arg, &unit, sizeof(unit)))
 			return -EFAULT;
 
-		DBG(5, "VIDIOCGUNIT successfully called.")
+		DBG(5, "VIDIOCGUNIT successfully called")
 		return 0;
 	}
 
@@ -3363,7 +3418,7 @@ w9968cf_v4l_ioctl(struct inode* inode, struct file* filp,
 		if (clear_user(arg, sizeof(struct video_buffer)))
 			return -EFAULT;
 
-		DBG(5, "VIDIOCGFBUF successfully called.")
+		DBG(5, "VIDIOCGFBUF successfully called")
 		return 0;
 	}
 
@@ -3386,7 +3441,7 @@ w9968cf_v4l_ioctl(struct inode* inode, struct file* filp,
 		if (copy_to_user(arg, &tuner, sizeof(tuner)))
 			return -EFAULT;
 
-		DBG(5, "VIDIOCGTUNER successfully called.")
+		DBG(5, "VIDIOCGTUNER successfully called")
 		return 0;
 	}
 
@@ -3402,7 +3457,7 @@ w9968cf_v4l_ioctl(struct inode* inode, struct file* filp,
 		if (tuner.mode != VIDEO_MODE_AUTO)
 			return -EINVAL;
 
-		DBG(5, "VIDIOCSTUNER successfully called.")
+		DBG(5, "VIDIOCSTUNER successfully called")
 		return 0;
 	}
 
@@ -3422,7 +3477,7 @@ w9968cf_v4l_ioctl(struct inode* inode, struct file* filp,
 		       "(type 0x%01X, "
 		       "n. 0x%01X, "
 		       "dir. 0x%01X, " 
-		       "size 0x%02X).",
+		       "size 0x%02X)",
 		    V4L1_IOCTL(cmd),
 		    _IOC_TYPE(cmd),_IOC_NR(cmd),_IOC_DIR(cmd),_IOC_SIZE(cmd))
 
@@ -3433,7 +3488,7 @@ w9968cf_v4l_ioctl(struct inode* inode, struct file* filp,
 		       "type 0x%01X, "
 		       "n. 0x%01X, "
 		       "dir. 0x%01X, "
-		       "size 0x%02X.",
+		       "size 0x%02X",
 		    V4L1_IOCTL(cmd),
 		    _IOC_TYPE(cmd),_IOC_NR(cmd),_IOC_DIR(cmd),_IOC_SIZE(cmd))
 
@@ -3479,15 +3534,27 @@ w9968cf_usb_probe(struct usb_interface* intf, const struct usb_device_id* id)
 	if (udev->descriptor.idVendor  == winbond_id_table[0].idVendor &&
 	    udev->descriptor.idProduct == winbond_id_table[0].idProduct)
 		mod_id = W9968CF_MOD_CLVBWGP; /* see camlist[] table */
-
 	else if (udev->descriptor.idVendor  == winbond_id_table[1].idVendor &&
 	         udev->descriptor.idProduct == winbond_id_table[1].idProduct)
 		mod_id = W9968CF_MOD_GENERIC; /* see camlist[] table */
-
 	else
 		return -ENODEV;
 
-	DBG(2, "%s detected.", symbolic(camlist, mod_id))
+	cam = (struct w9968cf_device*)
+	          kmalloc(sizeof(struct w9968cf_device), GFP_KERNEL);
+	if (!cam)
+		return -ENOMEM;
+
+	memset(cam, 0, sizeof(*cam));
+
+	init_MUTEX(&cam->dev_sem);
+	down(&cam->dev_sem);
+
+	cam->usbdev = udev;
+	/* NOTE: a local copy is used to avoid possible race conditions */
+	memcpy(&cam->dev, &udev->dev, sizeof(struct device));
+
+	DBG(2, "%s detected", symbolic(camlist, mod_id))
 
 	if (simcams > W9968CF_MAX_DEVICES)
 		simcams = W9968CF_SIMCAMS;
@@ -3500,27 +3567,15 @@ w9968cf_usb_probe(struct usb_interface* intf, const struct usb_device_id* id)
 
 	if (sc >= simcams) {
 		DBG(2, "Device rejected: too many connected cameras "
-		       "(max. %d)", simcams)
-		return -EPERM;
-	}
-
-	cam = (struct w9968cf_device*)
-	          kmalloc(sizeof(struct w9968cf_device), GFP_KERNEL);
-
-	if (!cam) {
-		DBG(1, "Couldn't allocate %zd bytes of kernel memory.",
-		    sizeof(struct w9968cf_device))
-		err = -ENOMEM;
+		       "(max. %u)", simcams)
+		err = -EPERM;
 		goto fail;
 	}
-	memset(cam, 0, sizeof(*cam));
 
-	init_MUTEX(&cam->dev_sem);
-	down(&cam->dev_sem);
 
 	/* Allocate 2 bytes of memory for camera control USB transfers */
 	if (!(cam->control_buffer = (u16*)kmalloc(2, GFP_KERNEL))) {
-		DBG(1,"Couldn't allocate memory for camera control transfers.")
+		DBG(1,"Couldn't allocate memory for camera control transfers")
 		err = -ENOMEM;
 		goto fail;
 	}
@@ -3529,7 +3584,7 @@ w9968cf_usb_probe(struct usb_interface* intf, const struct usb_device_id* id)
 	/* Allocate 8 bytes of memory for USB data transfers to the FSB */
 	if (!(cam->data_buffer = (u16*)kmalloc(8, GFP_KERNEL))) {
 		DBG(1, "Couldn't allocate memory for data "
-		       "transfers to the FSB.")
+		       "transfers to the FSB")
 		err = -ENOMEM;
 		goto fail;
 	}
@@ -3538,7 +3593,7 @@ w9968cf_usb_probe(struct usb_interface* intf, const struct usb_device_id* id)
 	/* Register the V4L device */
 	cam->v4ldev = video_device_alloc();
 	if (!cam->v4ldev) {
-		DBG(1, "Could not allocate memory for a V4L structure.")
+		DBG(1, "Could not allocate memory for a V4L structure")
 		err = -ENOMEM;
 		goto fail;
 	}
@@ -3551,19 +3606,20 @@ w9968cf_usb_probe(struct usb_interface* intf, const struct usb_device_id* id)
 	cam->v4ldev->minor = video_nr[dev_nr];
 	cam->v4ldev->release = video_device_release;
 	video_set_drvdata(cam->v4ldev, cam);
+	cam->v4ldev->dev = &cam->dev;
 
 	err = video_register_device(cam->v4ldev, VFL_TYPE_GRABBER,
 	                            video_nr[dev_nr]);
 	if (err) {
-		DBG(1, "V4L device registration failed.")
+		DBG(1, "V4L device registration failed")
 		if (err == -ENFILE && video_nr[dev_nr] == -1)
-			DBG(2, "Couldn't find a free /dev/videoX node.")
+			DBG(2, "Couldn't find a free /dev/videoX node")
 		video_nr[dev_nr] = -1;
 		dev_nr = (dev_nr < W9968CF_MAX_DEVICES-1) ? dev_nr+1 : 0;
 		goto fail;
 	}
 
-	DBG(2, "V4L device registered as /dev/video%d.", cam->v4ldev->minor)
+	DBG(2, "V4L device registered as /dev/video%d", cam->v4ldev->minor)
 
 	/* Set some basic constants */
 	w9968cf_configure_camera(cam, udev, mod_id, dev_nr);
@@ -3578,22 +3634,19 @@ w9968cf_usb_probe(struct usb_interface* intf, const struct usb_device_id* id)
 
 	w9968cf_i2c_init(cam);
 
-	up(&cam->dev_sem);
-
 	usb_set_intfdata(intf, cam);
+	up(&cam->dev_sem);
 	return 0;
 
 fail: /* Free unused memory */
-	if (cam) {
-		if (cam->control_buffer)
-			kfree(cam->control_buffer);
-		if (cam->data_buffer)
-			kfree(cam->data_buffer);
-		if (cam->v4ldev)
-			video_device_release(cam->v4ldev);
-		up(&cam->dev_sem);
-		kfree(cam);
-	}
+	if (cam->control_buffer)
+		kfree(cam->control_buffer);
+	if (cam->data_buffer)
+		kfree(cam->data_buffer);
+	if (cam->v4ldev)
+		video_device_release(cam->v4ldev);
+	up(&cam->dev_sem);
+	kfree(cam);
 	return err;
 }
 
@@ -3603,28 +3656,26 @@ static void w9968cf_usb_disconnect(struct usb_interface* intf)
 	struct w9968cf_device* cam = 
 	   (struct w9968cf_device*)usb_get_intfdata(intf);
 
+	down_write(&w9968cf_disconnect);
+
 	if (cam) {
 		/* Prevent concurrent accesses to data */
 		down(&cam->dev_sem); 
 
-		cam->streaming = 0;
 		cam->disconnected = 1;
 
 		DBG(2, "Disconnecting %s...", symbolic(camlist, cam->id))
 
-		if (waitqueue_active(&cam->open))
-			wake_up_interruptible(&cam->open);
+		wake_up_interruptible_all(&cam->open);
 
 		if (cam->users) {
 			DBG(2, "The device is open (/dev/video%d)! "
 			       "Process name: %s. Deregistration and memory "
 			       "deallocation are deferred on close.",
 			    cam->v4ldev->minor, cam->command)
-
 			cam->misconfigured = 1;
-
-			if (waitqueue_active(&cam->wait_queue))
-				wake_up_interruptible(&cam->wait_queue);
+			w9968cf_stop_transfer(cam);
+			wake_up_interruptible(&cam->wait_queue);
 		} else
 			w9968cf_release_resources(cam);
 
@@ -3634,7 +3685,7 @@ static void w9968cf_usb_disconnect(struct usb_interface* intf)
 			kfree(cam);
 	}
 
-	usb_set_intfdata(intf, NULL);
+	up_write(&w9968cf_disconnect);
 }
 
 
@@ -3652,48 +3703,103 @@ static struct usb_driver w9968cf_usb_driver = {
  * Module init, exit and intermodule communication                          *
  ****************************************************************************/
 
-static int w9968cf_vppmod_detect(void)
+static int w9968cf_vppmod_detect(struct w9968cf_device* cam)
 {
-	w9968cf_vpp_init_decoder = inter_module_get("w9968cf_init_decoder");
-
-	if (!w9968cf_vpp_init_decoder) {
+	if (!w9968cf_vpp)
 		if (vppmod_load)
-			w9968cf_vpp_init_decoder = inter_module_get_request
-		                                  ( "w9968cf_init_decoder",
-			                            "w9968cf-vpp" );
-		if (!w9968cf_vpp_init_decoder) {
-			w9968cf_vppmod_present = 0;
-			DBG(4, "Video post-processing module not detected.")
-			return -ENODEV;
-		}
+			request_module("w9968cf-vpp");
+
+	down(&w9968cf_vppmod_lock);
+
+	if (!w9968cf_vpp) {
+		DBG(4, "Video post-processing module not detected")
+		w9968cf_adjust_configuration(cam);
+		goto out;
 	}
 
-	w9968cf_vpp_check_headers = inter_module_get("w9968cf_check_headers");
-	w9968cf_vpp_decode = inter_module_get("w9968cf_decode");
-	w9968cf_vpp_swap_yuvbytes = inter_module_get("w9968cf_swap_yuvbytes");
-	w9968cf_vpp_uyvy_to_rgbx = inter_module_get("w9968cf_uyvy_to_rgbx");
-	w9968cf_vpp_scale_up = inter_module_get("w9968cf_scale_up");
+	if (!try_module_get(w9968cf_vpp->owner)) {
+		DBG(1, "Couldn't increment the reference count of "
+		       "the video post-processing module")
+		up(&w9968cf_vppmod_lock);
+		return -ENOSYS;
+	}
 
-	w9968cf_vppmod_present = 1;
+	w9968cf_vpp->busy++;
 
-	/* Initialization */
-	(*w9968cf_vpp_init_decoder)();
+	DBG(5, "Video post-processing module detected")
 
-	DBG(2, "Video post-processing module detected.")
+out:
+	up(&w9968cf_vppmod_lock);
 	return 0;
 }
 
 
-static void w9968cf_vppmod_release(void)
+static void w9968cf_vppmod_release(struct w9968cf_device* cam)
 {
-	inter_module_put("w9968cf_init_decoder");
-	inter_module_put("w9968cf_check_headers");
-	inter_module_put("w9968cf_decode");
-	inter_module_put("w9968cf_swap_yuvbytes");
-	inter_module_put("w9968cf_uyvy_to_rgbx");
-	inter_module_put("w9968cf_scale_up");
+	down(&w9968cf_vppmod_lock);
 
-	DBG(2, "Video post-processing module released.")
+	if (w9968cf_vpp && w9968cf_vpp->busy) {
+		module_put(w9968cf_vpp->owner);
+		w9968cf_vpp->busy--;
+		wake_up(&w9968cf_vppmod_wait);
+		DBG(5, "Video post-processing module released")
+	}
+
+	up(&w9968cf_vppmod_lock);
+}
+
+
+int w9968cf_vppmod_register(struct w9968cf_vpp_t* vpp)
+{
+	down(&w9968cf_vppmod_lock);
+
+	if (w9968cf_vpp) {
+		KDBG(1, "Video post-processing module already registered")
+		up(&w9968cf_vppmod_lock);
+		return -EINVAL;
+	}
+
+	w9968cf_vpp = vpp;
+	w9968cf_vpp->busy = 0;
+
+	KDBG(2, "Video post-processing module registered")
+	up(&w9968cf_vppmod_lock);
+	return 0;
+}
+
+
+int w9968cf_vppmod_deregister(struct w9968cf_vpp_t* vpp)
+{
+	down(&w9968cf_vppmod_lock);
+
+	if (!w9968cf_vpp) {
+		up(&w9968cf_vppmod_lock);
+		return -EINVAL;
+	}
+
+	if (w9968cf_vpp != vpp) {
+		KDBG(1, "Only the owner can unregister the video "
+		        "post-processing module")
+		up(&w9968cf_vppmod_lock);
+		return -EINVAL;
+	}
+
+	if (w9968cf_vpp->busy) {
+		KDBG(2, "Video post-processing module busy. Wait for it to be "
+		        "released...")
+		up(&w9968cf_vppmod_lock);
+		wait_event(w9968cf_vppmod_wait, !w9968cf_vpp->busy);
+		w9968cf_vpp = NULL;
+		goto out;
+	}
+
+	w9968cf_vpp = NULL;
+
+	up(&w9968cf_vppmod_lock);
+
+out:
+	KDBG(2, "Video post-processing module unregistered")
+	return 0;
 }
 
 
@@ -3701,18 +3807,14 @@ static int __init w9968cf_module_init(void)
 {
 	int err;
 
-	DBG(2, W9968CF_MODULE_NAME" "W9968CF_MODULE_VERSION)
-	DBG(3, W9968CF_MODULE_AUTHOR)
+	KDBG(2, W9968CF_MODULE_NAME" "W9968CF_MODULE_VERSION)
+	KDBG(3, W9968CF_MODULE_AUTHOR)
 
-	init_MUTEX(&w9968cf_devlist_sem);
+	if (ovmod_load)
+		request_module("ovcamchip");
 
-	w9968cf_vppmod_detect();
-
-	if ((err = usb_register(&w9968cf_usb_driver))) {
-		if (w9968cf_vppmod_present)
-			w9968cf_vppmod_release();
+	if ((err = usb_register(&w9968cf_usb_driver)))
 		return err;
-	}
 
 	return 0;
 }
@@ -3723,12 +3825,13 @@ static void __exit w9968cf_module_exit(void)
 	/* w9968cf_usb_disconnect() will be called */
 	usb_deregister(&w9968cf_usb_driver);
 
-	if (w9968cf_vppmod_present)
-		w9968cf_vppmod_release();
-
-	DBG(2, W9968CF_MODULE_NAME" deregistered.")
+	KDBG(2, W9968CF_MODULE_NAME" deregistered")
 }
 
 
 module_init(w9968cf_module_init);
 module_exit(w9968cf_module_exit);
+
+
+EXPORT_SYMBOL(w9968cf_vppmod_register);
+EXPORT_SYMBOL(w9968cf_vppmod_deregister);
diff --git a/drivers/usb/media/w9968cf.h b/drivers/usb/media/w9968cf.h
index 3076d87da..e910f26de 100644
--- a/drivers/usb/media/w9968cf.h
+++ b/drivers/usb/media/w9968cf.h
@@ -24,21 +24,26 @@
 #include <linux/videodev.h>
 #include <linux/usb.h>
 #include <linux/i2c.h>
+#include <linux/device.h>
 #include <linux/spinlock.h>
 #include <linux/list.h>
 #include <linux/wait.h>
 #include <linux/config.h>
 #include <linux/param.h>
+#include <linux/types.h>
+#include <linux/rwsem.h>
 #include <asm/semaphore.h>
-#include <asm/types.h>
 
-#include "w9968cf_externaldef.h"
+#include <media/ovcamchip.h>
+
+#include "w9968cf_vpp.h"
 
 
 /****************************************************************************
  * Default values                                                           *
  ****************************************************************************/
 
+#define W9968CF_OVMOD_LOAD      1  /* automatic 'ovcamchip' module loading */
 #define W9968CF_VPPMOD_LOAD     1  /* automatic 'w9968cf-vpp' module loading */
 
 /* Comment/uncomment the following line to enable/disable debugging messages */
@@ -95,8 +100,8 @@ static const struct w9968cf_format w9968cf_formatlist[] = {
 
 #define W9968CF_FORCE_RGB        0  /* read RGB instead of BGR, yes=1/no=0 */
 
-#define W9968CF_MAX_WIDTH      800 /* should be >= 640 */
-#define W9968CF_MAX_HEIGHT     600 /* should be >= 480 */
+#define W9968CF_MAX_WIDTH      800 /* Has effect if up-scaling is on */
+#define W9968CF_MAX_HEIGHT     600 /* Has effect if up-scaling is on */
 #define W9968CF_WIDTH          320 /* from 128 to 352, multiple of 16 */
 #define W9968CF_HEIGHT         240 /* from  96 to 288, multiple of 16 */
 
@@ -130,13 +135,11 @@ static const struct w9968cf_format w9968cf_formatlist[] = {
 
 #define W9968CF_MODULE_NAME     "V4L driver for W996[87]CF JPEG USB " \
                                 "Dual Mode Camera Chip"
-#define W9968CF_MODULE_VERSION  "v1.25-basic"
+#define W9968CF_MODULE_VERSION  "1:1.32-basic"
 #define W9968CF_MODULE_AUTHOR   "(C) 2002-2004 Luca Risolia"
 #define W9968CF_AUTHOR_EMAIL    "<luca.risolia@studio.unibo.it>"
 #define W9968CF_MODULE_LICENSE  "GPL"
 
-static u8 w9968cf_vppmod_present; /* status flag: yes=1, no=0 */
-
 static const struct usb_device_id winbond_id_table[] = {
 	{
 		/* Creative Labs Video Blaster WebCam Go Plus */
@@ -151,18 +154,19 @@ static const struct usb_device_id winbond_id_table[] = {
 	{ } /* terminating entry */
 };
 
-MODULE_DEVICE_TABLE(usb, winbond_id_table);
-
 /* W996[87]CF camera models, internal ids: */
 enum w9968cf_model_id {
 	W9968CF_MOD_GENERIC = 1, /* Generic W996[87]CF based device */
 	W9968CF_MOD_CLVBWGP = 11,/*Creative Labs Video Blaster WebCam Go Plus*/
-	W9968CF_MOD_ADPA5R = 21, /* Aroma Digi Pen ADG-5000 Refurbished */
-	W9986CF_MOD_AU = 31,     /* AVerTV USB */
-	W9968CF_MOD_CLVBWG = 34, /* Creative Labs Video Blaster WebCam Go */
-	W9968CF_MOD_DLLDK = 37,  /* Die Lebon LDC-D35A Digital Kamera */
+	W9968CF_MOD_ADPVDMA = 21, /* Aroma Digi Pen VGA Dual Mode ADG-5000 */
+	W9986CF_MOD_AAU = 31,     /* AVerMedia AVerTV USB */
+	W9968CF_MOD_CLVBWG = 34,  /* Creative Labs Video Blaster WebCam Go */
+	W9968CF_MOD_LL = 37,      /* Lebon LDC-035A */
 	W9968CF_MOD_EEEMC = 40,   /* Ezonics EZ-802 EZMega Cam */
+	W9968CF_MOD_OOE = 42,     /* OmniVision OV8610-EDE */
 	W9968CF_MOD_ODPVDMPC = 43,/* OPCOM Digi Pen VGA Dual Mode Pen Camera */
+	W9968CF_MOD_PDPII = 46,   /* Pretec Digi Pen-II */
+	W9968CF_MOD_PDP480 = 49,  /* Pretec DigiPen-480 */
 };
 
 enum w9968cf_frame_status {
@@ -173,9 +177,10 @@ enum w9968cf_frame_status {
 };
 
 struct w9968cf_frame_t {
-	#define W9968CF_HW_BUF_SIZE 640*480*2 /* buf.size of original frames */
 	void* buffer;
+	unsigned long size;
 	u32 length;
+	int number;
 	enum w9968cf_frame_status status;
 	struct w9968cf_frame_t* next;
 	u8 queued;
@@ -189,12 +194,19 @@ enum w9968cf_vpp_flag {
 	VPP_UYVY_TO_RGBX = 0x08,
 };
 
-static struct list_head w9968cf_dev_list; /* head of V4L registered cameras list */
-static LIST_HEAD(w9968cf_dev_list);
-struct semaphore w9968cf_devlist_sem; /* semaphore for list traversal */
+static struct w9968cf_vpp_t* w9968cf_vpp;
+static DECLARE_MUTEX(w9968cf_vppmod_lock);
+static DECLARE_WAIT_QUEUE_HEAD(w9968cf_vppmod_wait);
+
+static LIST_HEAD(w9968cf_dev_list); /* head of V4L registered cameras list */
+static DECLARE_MUTEX(w9968cf_devlist_sem); /* semaphore for list traversal */
+
+static DECLARE_RWSEM(w9968cf_disconnect); /* prevent races with open() */
 
 /* Main device driver structure */
 struct w9968cf_device {
+	struct device dev; /* device structure */
+
 	enum w9968cf_model_id id;   /* private device identifier */
 
 	struct video_device* v4ldev; /* -> V4L structure */
@@ -207,10 +219,10 @@ struct w9968cf_device {
 	u16* data_buffer;                    /* -> data to send to the FSB */
 
 	struct w9968cf_frame_t frame[W9968CF_MAX_BUFFERS];
-	struct w9968cf_frame_t frame_tmp;  /* temporary frame */
+	struct w9968cf_frame_t frame_tmp; /* temporary frame */
+	struct w9968cf_frame_t frame_vpp; /* helper frame.*/
 	struct w9968cf_frame_t* frame_current; /* -> frame being grabbed */
 	struct w9968cf_frame_t* requested_frame[W9968CF_MAX_BUFFERS];
-	void* vpp_buffer; /*-> helper buf.for video post-processing routines */
 
 	u8 max_buffers,   /* number of requested buffers */
 	   force_palette, /* yes=1/no=0 */
@@ -233,7 +245,7 @@ struct w9968cf_device {
 	    hs_polarity, /* 0=negative sync pulse, 1=positive sync pulse */
 	    vs_polarity, /* 0=negative sync pulse, 1=positive sync pulse */
 	    start_cropx, /* pixels from HS inactive edge to 1st cropped pixel*/
-	    start_cropy; /* pixels from VS incative edge to 1st cropped pixel*/
+	    start_cropy; /* pixels from VS inactive edge to 1st cropped pixel*/
 
 	enum w9968cf_vpp_flag vpp_flag; /* post-processing routines in use */
 
@@ -246,13 +258,13 @@ struct w9968cf_device {
 
 	u8 sensor_initialized; /* flag: yes=1, no=0 */
 
-	/* Determined by CMOS sensor type: */
+	/* Determined by the image sensor type: */
 	int sensor,       /* type of image sensor chip (CC_*) */
-	    monochrome;   /* CMOS sensor is (probably) monochrome */
-	u16 maxwidth,     /* maximum width supported by the CMOS sensor */
-	    maxheight,    /* maximum height supported by the CMOS sensor */
-	    minwidth,     /* minimum width supported by the CMOS sensor */
-	    minheight;    /* minimum height supported by the CMOS sensor */
+	    monochrome;   /* image sensor is (probably) monochrome */
+	u16 maxwidth,     /* maximum width supported by the image sensor */
+	    maxheight,    /* maximum height supported by the image sensor */
+	    minwidth,     /* minimum width supported by the image sensor */
+	    minheight;    /* minimum height supported by the image sensor */
 	u8  auto_brt,     /* auto brightness enabled flag */
 	    auto_exp,     /* auto exposure enabled flag */
 	    backlight,    /* backlight exposure algorithm flag */
@@ -270,8 +282,9 @@ struct w9968cf_device {
 	                 fileop_sem; /* for read and ioctl */
 	spinlock_t urb_lock,   /* for submit_urb() and unlink_urb() */
 	           flist_lock; /* for requested frame list accesses */
-	char command[16]; /* name of the program holding the device */
 	wait_queue_head_t open, wait_queue;
+
+	char command[16]; /* name of the program holding the device */
 };
 
 
@@ -280,31 +293,47 @@ struct w9968cf_device {
  ****************************************************************************/
 
 #undef DBG
+#undef KDBG
 #ifdef W9968CF_DEBUG
-#	define DBG(level, fmt, args...) \
-{ \
-if ( ((specific_debug) && (debug == (level))) || \
-     ((!specific_debug) && (debug >= (level))) ) { \
-	if ((level) == 1) \
-		err(fmt, ## args); \
-	else if ((level) == 2 || (level) == 3) \
-		info(fmt, ## args); \
-	else if ((level) == 4) \
-		warn(fmt, ## args); \
-	else if ((level) >= 5) \
-		info("[%s:%d] " fmt, \
-		     __PRETTY_FUNCTION__, __LINE__ , ## args); \
-} \
+/* For device specific debugging messages */
+#	define DBG(level, fmt, args...)                                       \
+{                                                                             \
+	if ( ((specific_debug) && (debug == (level))) ||                      \
+	     ((!specific_debug) && (debug >= (level))) ) {                    \
+		if ((level) == 1)                                             \
+			dev_err(&cam->dev, fmt "\n", ## args);                \
+		else if ((level) == 2 || (level) == 3)                        \
+			dev_info(&cam->dev, fmt "\n", ## args);               \
+		else if ((level) == 4)                                        \
+			dev_warn(&cam->dev, fmt "\n", ## args);               \
+		else if ((level) >= 5)                                        \
+			dev_info(&cam->dev, "[%s:%d] " fmt "\n",              \
+			         __FUNCTION__, __LINE__ , ## args);           \
+	}                                                                     \
+}
+/* For generic kernel (not device specific) messages */
+#	define KDBG(level, fmt, args...)                                      \
+{                                                                             \
+	if ( ((specific_debug) && (debug == (level))) ||                      \
+	     ((!specific_debug) && (debug >= (level))) ) {                    \
+		if ((level) >= 1 && (level) <= 4)                             \
+			pr_info("w9968cf: " fmt "\n", ## args);               \
+		else if ((level) >= 5)                                        \
+			pr_debug("w9968cf: [%s:%d] " fmt "\n", __FUNCTION__,  \
+			         __LINE__ , ## args);                         \
+	}                                                                     \
 }
 #else
 	/* Not debugging: nothing */
 #	define DBG(level, fmt, args...) do {;} while(0);
+#	define KDBG(level, fmt, args...) do {;} while(0);
 #endif
 
 #undef PDBG
+#define PDBG(fmt, args...)                                                    \
+dev_info(&cam->dev, "[%s:%d] " fmt "\n", __FUNCTION__, __LINE__ , ## args);
+
 #undef PDBGG
-#define PDBG(fmt, args...) info("[%s:%d] "fmt, \
-	                        __PRETTY_FUNCTION__, __LINE__ , ## args);
 #define PDBGG(fmt, args...) do {;} while(0); /* nothing: it's a placeholder */
 
 #endif /* _W9968CF_H_ */
diff --git a/drivers/usb/misc/auerswald.c b/drivers/usb/misc/auerswald.c
index b137da951..310c5a96c 100644
--- a/drivers/usb/misc/auerswald.c
+++ b/drivers/usb/misc/auerswald.c
@@ -2,7 +2,7 @@
 /*
  *      auerswald.c  --  Auerswald PBX/System Telephone usb driver.
  *
- *      Copyright (C) 2001  Wolfgang Mües (wolfgang@iksw-muees.de)
+ *      Copyright (C) 2001  Wolfgang Mües (wolfgang@iksw-muees.de)
  *
  *      Very much code of this driver is borrowed from dabusb.c (Deti Fliegl)
  *      and from the USB Skeleton driver (Greg Kroah-Hartman). Thank you.
@@ -50,7 +50,7 @@ do {			\
 /*-------------------------------------------------------------------*/
 /* Version Information */
 #define DRIVER_VERSION "0.9.11"
-#define DRIVER_AUTHOR  "Wolfgang Mües <wolfgang@iksw-muees.de>"
+#define DRIVER_AUTHOR  "Wolfgang Mües <wolfgang@iksw-muees.de>"
 #define DRIVER_DESC    "Auerswald PBX/System Telephone usb driver"
 
 /*-------------------------------------------------------------------*/
@@ -699,7 +699,7 @@ static int auerchain_control_msg (pauerchain_t acp, struct usb_device *dev, unsi
 	dr->wLength = cpu_to_le16 (size);
 
 	usb_fill_control_urb (urb, dev, pipe, (unsigned char*)dr, data, size,    /* build urb */
-		          auerchain_blocking_completion,0);
+		          auerchain_blocking_completion, NULL);
 	ret = auerchain_start_wait_urb (acp, urb, timeout, &length);
 
 	usb_free_urb (urb);
@@ -1435,7 +1435,7 @@ static int auerchar_open (struct inode *inode, struct file *file)
 	/* file IO stuff */
 	file->f_pos = 0;
 	file->private_data = ccp;
-	return 0;
+	return nonseekable_open(inode, file);
 
 	/* Error exit */
 ofail:	up (&cp->mutex);
@@ -1452,6 +1452,8 @@ static int auerchar_ioctl (struct inode *inode, struct file *file, unsigned int
         audevinfo_t devinfo;
         pauerswald_t cp = NULL;
 	unsigned int u;
+	unsigned int __user *user_arg = (unsigned int __user *)arg;
+
         dbg ("ioctl");
 
 	/* get the mutexes */
@@ -1483,14 +1485,14 @@ static int auerchar_ioctl (struct inode *inode, struct file *file, unsigned int
 		u   = ccp->auerdev
 		   && (ccp->scontext.id != AUH_UNASSIGNED)
 		   && !list_empty (&cp->bufctl.free_buff_list);
-	        ret = put_user (u, (unsigned int *) arg);
+	        ret = put_user (u, user_arg);
 		break;
 
 	/* return != 0 if connected to a service channel */
 	case IOCTL_AU_CONNECT:
 		dbg ("IOCTL_AU_CONNECT");
 		u = (ccp->scontext.id != AUH_UNASSIGNED);
-	        ret = put_user (u, (unsigned int *) arg);
+	        ret = put_user (u, user_arg);
 		break;
 
 	/* return != 0 if Receive Data available */
@@ -1511,14 +1513,14 @@ static int auerchar_ioctl (struct inode *inode, struct file *file, unsigned int
 				u = 1;
 			}
 		}
-	        ret = put_user (u, (unsigned int *) arg);
+	        ret = put_user (u, user_arg);
 		break;
 
 	/* return the max. buffer length for the device */
 	case IOCTL_AU_BUFLEN:
 		dbg ("IOCTL_AU_BUFLEN");
 		u = cp->maxControlLength;
-	        ret = put_user (u, (unsigned int *) arg);
+	        ret = put_user (u, user_arg);
 		break;
 
 	/* requesting a service channel */
@@ -1527,7 +1529,7 @@ static int auerchar_ioctl (struct inode *inode, struct file *file, unsigned int
                 /* requesting a service means: release the previous one first */
 		auerswald_removeservice (cp, &ccp->scontext);
 		/* get the channel number */
-		ret = get_user (u, (unsigned int *) arg);
+		ret = get_user (u, user_arg);
 		if (ret) {
 			break;
 		}
@@ -1564,7 +1566,7 @@ static int auerchar_ioctl (struct inode *inode, struct file *file, unsigned int
         case IOCTL_AU_SLEN:
 		dbg ("IOCTL_AU_SLEN");
 		u = AUSI_DLEN;
-	        ret = put_user (u, (unsigned int *) arg);
+	        ret = put_user (u, user_arg);
 		break;
 
 	default:
diff --git a/drivers/usb/misc/emi26_fw.h b/drivers/usb/misc/emi26_fw.h
index 90bfdacd8..a47ff107a 100644
--- a/drivers/usb/misc/emi26_fw.h
+++ b/drivers/usb/misc/emi26_fw.h
@@ -12,6 +12,10 @@
  * and which may not be reproduced, used, sold or transferred to
  * any third party without Emagic's written consent. All Rights Reserved.
  *
+ * Permission is hereby granted for the distribution of this firmware 
+ * image as part of a Linux or other Open Source operating system kernel 
+ * in text or binary form as required. 
+ *
  * This firmware may not be modified and may only be used with the
  * Emagic EMI 2|6 Audio Interface. Distribution and/or Modification of
  * any driver which includes this firmware, in whole or in part,
diff --git a/drivers/usb/misc/legousbtower.c b/drivers/usb/misc/legousbtower.c
index c44f65a0b..cd7b548b9 100644
--- a/drivers/usb/misc/legousbtower.c
+++ b/drivers/usb/misc/legousbtower.c
@@ -236,8 +236,8 @@ struct lego_usb_tower {
 
 
 /* local function prototypes */
-static ssize_t tower_read	(struct file *file, char *buffer, size_t count, loff_t *ppos);
-static ssize_t tower_write	(struct file *file, const char *buffer, size_t count, loff_t *ppos);
+static ssize_t tower_read	(struct file *file, char __user *buffer, size_t count, loff_t *ppos);
+static ssize_t tower_write	(struct file *file, const char __user *buffer, size_t count, loff_t *ppos);
 static inline void tower_delete (struct lego_usb_tower *dev);
 static int tower_open		(struct inode *inode, struct file *file);
 static int tower_release	(struct inode *inode, struct file *file);
@@ -344,6 +344,7 @@ static int tower_open (struct inode *inode, struct file *file)
 
 	dbg(2, "%s: enter", __FUNCTION__);
 
+	nonseekable_open(inode, file);
 	subminor = iminor(inode);
 
 	down (&disconnect_sem);
@@ -560,7 +561,7 @@ static loff_t tower_llseek (struct file *file, loff_t off, int whence)
 /**
  *	tower_read
  */
-static ssize_t tower_read (struct file *file, char *buffer, size_t count, loff_t *ppos)
+static ssize_t tower_read (struct file *file, char __user *buffer, size_t count, loff_t *ppos)
 {
 	struct lego_usb_tower *dev;
 	size_t bytes_to_read;
@@ -651,7 +652,7 @@ exit:
 /**
  *	tower_write
  */
-static ssize_t tower_write (struct file *file, const char *buffer, size_t count, loff_t *ppos)
+static ssize_t tower_write (struct file *file, const char __user *buffer, size_t count, loff_t *ppos)
 {
 	struct lego_usb_tower *dev;
 	size_t bytes_to_write;
diff --git a/drivers/usb/misc/phidgetservo.c b/drivers/usb/misc/phidgetservo.c
index 9018774ae..b89b53401 100644
--- a/drivers/usb/misc/phidgetservo.c
+++ b/drivers/usb/misc/phidgetservo.c
@@ -17,6 +17,10 @@
  *
  * CAUTION: Generally you should use 0 < degrees < 180 as anything else
  * is probably beyond the range of your servo and may damage it.
+ *
+ * Jun 16, 2004: Sean Young <sean@mess.org>
+ *  - cleanups
+ *  - was using memory after kfree()
  */
 
 #include <linux/config.h>
@@ -33,19 +37,36 @@
 #define DRIVER_AUTHOR "Sean Young <sean@mess.org>"
 #define DRIVER_DESC "USB PhidgetServo Driver"
 
-#define VENDOR_ID_GLAB			0x06c2
-#define DEVICE_ID_4MOTOR_SERVO_30	0x0038
-#define DEVICE_ID_1MOTOR_SERVO_30	0x0039
+#define VENDOR_ID_GLAB				0x06c2
+#define DEVICE_ID_GLAB_PHIDGETSERVO_QUAD	0x0038
+#define DEVICE_ID_GLAB_PHIDGETSERVO_UNI		0x0039
+
+#define VENDOR_ID_WISEGROUP			0x0925
+#define VENDOR_ID_WISEGROUP_PHIDGETSERVO_QUAD	0x8101
+#define VENDOR_ID_WISEGROUP_PHIDGETSERVO_UNI	0x8104
 
-#define VENDOR_ID_WISEGROUP		0x0925
-#define DEVICE_ID_1MOTOR_SERVO_20	0x8101
-#define DEVICE_ID_4MOTOR_SERVO_20	0x8104
+#define SERVO_VERSION_30			0x01
+#define SERVO_COUNT_QUAD			0x02
 
 static struct usb_device_id id_table[] = {
-	{USB_DEVICE(VENDOR_ID_GLAB, DEVICE_ID_4MOTOR_SERVO_30)},
-	{USB_DEVICE(VENDOR_ID_GLAB, DEVICE_ID_1MOTOR_SERVO_30)},
-	{USB_DEVICE(VENDOR_ID_WISEGROUP, DEVICE_ID_4MOTOR_SERVO_20)},
-	{USB_DEVICE(VENDOR_ID_WISEGROUP, DEVICE_ID_1MOTOR_SERVO_20)},
+	{
+		USB_DEVICE(VENDOR_ID_GLAB, DEVICE_ID_GLAB_PHIDGETSERVO_QUAD), 
+		.driver_info = SERVO_VERSION_30 | SERVO_COUNT_QUAD 
+	},
+	{
+		USB_DEVICE(VENDOR_ID_GLAB, DEVICE_ID_GLAB_PHIDGETSERVO_UNI),
+		.driver_info = SERVO_VERSION_30 
+	},
+	{
+		USB_DEVICE(VENDOR_ID_WISEGROUP, 
+				VENDOR_ID_WISEGROUP_PHIDGETSERVO_QUAD),
+		.driver_info = SERVO_COUNT_QUAD 
+	},
+	{
+		USB_DEVICE(VENDOR_ID_WISEGROUP, 
+				VENDOR_ID_WISEGROUP_PHIDGETSERVO_UNI),
+		.driver_info = 0
+	},
 	{}
 };
 
@@ -53,14 +74,13 @@ MODULE_DEVICE_TABLE(usb, id_table);
 
 struct phidget_servo {
 	struct usb_device *udev;
-	int version;
-	int quad_servo;
+	ulong type;
 	int pulse[4];
 	int degrees[4];
 	int minutes[4];
 };
 
-static void
+static int
 change_position_v30(struct phidget_servo *servo, int servo_no, int degrees, 
 								int minutes)
 {
@@ -71,7 +91,7 @@ change_position_v30(struct phidget_servo *servo, int servo_no, int degrees,
 	if (!buffer) {
 		dev_err(&servo->udev->dev, "%s - out of memory\n",
 			__FUNCTION__);
-		return;
+		return -ENOMEM;
 	}
 
 	/*
@@ -124,12 +144,13 @@ change_position_v30(struct phidget_servo *servo, int servo_no, int degrees,
 	retval = usb_control_msg(servo->udev,
 				 usb_sndctrlpipe(servo->udev, 0),
 				 0x09, 0x21, 0x0200, 0x0000, buffer, 6, 2 * HZ);
-	if (retval != 6)
-		dev_err(&servo->udev->dev, "retval = %d\n", retval);
+
 	kfree(buffer);
+
+	return retval;
 }
 
-static void
+static int
 change_position_v20(struct phidget_servo *servo, int servo_no, int degrees,
 								int minutes)
 {
@@ -140,7 +161,7 @@ change_position_v20(struct phidget_servo *servo, int servo_no, int degrees,
 	if (!buffer) {
 		dev_err(&servo->udev->dev, "%s - out of memory\n",
 			__FUNCTION__);
-		return;
+		return -ENOMEM;
 	}
 
 	/*
@@ -171,16 +192,17 @@ change_position_v20(struct phidget_servo *servo, int servo_no, int degrees,
 	retval = usb_control_msg(servo->udev,
 				 usb_sndctrlpipe(servo->udev, 0),
 				 0x09, 0x21, 0x0200, 0x0000, buffer, 2, 2 * HZ);
-	if (retval != 2)
-		dev_err(&servo->udev->dev, "retval = %d\n", retval);
+
 	kfree(buffer);
+
+	return retval;
 }
 
 #define show_set(value)	\
 static ssize_t set_servo##value (struct device *dev,			\
 					const char *buf, size_t count)	\
 {									\
-	int degrees, minutes;						\
+	int degrees, minutes, retval;					\
 	struct usb_interface *intf = to_usb_interface (dev);		\
 	struct phidget_servo *servo = usb_get_intfdata (intf);		\
 									\
@@ -195,12 +217,14 @@ static ssize_t set_servo##value (struct device *dev,			\
 		return -EINVAL;						\
 	}								\
 									\
-	if (servo->version >= 3) 					\
-		change_position_v30 (servo, value, degrees, minutes);	\
+	if (servo->type & SERVO_VERSION_30)				\
+		retval = change_position_v30 (servo, value, degrees, 	\
+							minutes);	\
 	else 								\
-		change_position_v20 (servo, value, degrees, minutes);	\
+		retval = change_position_v20 (servo, value, degrees, 	\
+							minutes);	\
 									\
-	return count;							\
+	return retval < 0 ? retval : count;				\
 }									\
 									\
 static ssize_t show_servo##value (struct device *dev, char *buf) 	\
@@ -223,7 +247,7 @@ static int
 servo_probe(struct usb_interface *interface, const struct usb_device_id *id)
 {
 	struct usb_device *udev = interface_to_usbdev(interface);
-	struct phidget_servo *dev = NULL;
+	struct phidget_servo *dev;
 
 	dev = kmalloc(sizeof (struct phidget_servo), GFP_KERNEL);
 	if (dev == NULL) {
@@ -233,37 +257,21 @@ servo_probe(struct usb_interface *interface, const struct usb_device_id *id)
 	memset(dev, 0x00, sizeof (*dev));
 
 	dev->udev = usb_get_dev(udev);
-	switch (udev->descriptor.idVendor) {
-	case VENDOR_ID_WISEGROUP:
-		dev->version = 2;
-		break;
-	case VENDOR_ID_GLAB:
-		dev->version = 3;
-		break;
-	}
-	switch (udev->descriptor.idProduct) {
-	case DEVICE_ID_4MOTOR_SERVO_20:
-	case DEVICE_ID_4MOTOR_SERVO_30:
-		dev->quad_servo = 1;
-		break;
-	case DEVICE_ID_1MOTOR_SERVO_20:
-	case DEVICE_ID_1MOTOR_SERVO_30:
-		dev->quad_servo = 0;
-		break;
-	}
-
+	dev->type = id->driver_info;
 	usb_set_intfdata(interface, dev);
 
 	device_create_file(&interface->dev, &dev_attr_servo0);
-	if (dev->quad_servo) {
+	if (dev->type & SERVO_COUNT_QUAD) {
 		device_create_file(&interface->dev, &dev_attr_servo1);
 		device_create_file(&interface->dev, &dev_attr_servo2);
 		device_create_file(&interface->dev, &dev_attr_servo3);
 	}
 
 	dev_info(&interface->dev, "USB %d-Motor PhidgetServo v%d.0 attached\n",
-		 dev->quad_servo ? 4 : 1, dev->version);
-	if (dev->version == 2) 
+		dev->type & SERVO_COUNT_QUAD ? 4 : 1,
+		dev->type & SERVO_VERSION_30 ? 3 : 2);
+
+	if(!(dev->type & SERVO_VERSION_30))
 		dev_info(&interface->dev,
 			 "WARNING: v2.0 not tested! Please report if it works.\n");
 
@@ -279,7 +287,7 @@ servo_disconnect(struct usb_interface *interface)
 	usb_set_intfdata(interface, NULL);
 
 	device_remove_file(&interface->dev, &dev_attr_servo0);
-	if (dev->quad_servo) {
+	if (dev->type & SERVO_COUNT_QUAD) {
 		device_remove_file(&interface->dev, &dev_attr_servo1);
 		device_remove_file(&interface->dev, &dev_attr_servo2);
 		device_remove_file(&interface->dev, &dev_attr_servo3);
@@ -287,10 +295,11 @@ servo_disconnect(struct usb_interface *interface)
 
 	usb_put_dev(dev->udev);
 
-	kfree(dev);
-
 	dev_info(&interface->dev, "USB %d-Motor PhidgetServo v%d.0 detached\n",
-		 dev->quad_servo ? 4 : 1, dev->version);
+		dev->type & SERVO_COUNT_QUAD ? 4 : 1,
+		dev->type & SERVO_VERSION_30 ? 3 : 2);
+
+	kfree(dev);
 }
 
 static struct usb_driver servo_driver = {
@@ -304,7 +313,7 @@ static struct usb_driver servo_driver = {
 static int __init
 phidget_servo_init(void)
 {
-	int retval = 0;
+	int retval;
 
 	retval = usb_register(&servo_driver);
 	if (retval)
diff --git a/drivers/usb/misc/speedtch.c b/drivers/usb/misc/speedtch.c
index d6e195820..667e2d1b2 100644
--- a/drivers/usb/misc/speedtch.c
+++ b/drivers/usb/misc/speedtch.c
@@ -1149,7 +1149,7 @@ static int udsl_usb_probe (struct usb_interface *intf, const struct usb_device_i
 	}
 
 	/* ATM init */
-	if (!(instance->atm_dev = atm_dev_register (udsl_driver_name, &udsl_atm_devops, -1, 0))) {
+	if (!(instance->atm_dev = atm_dev_register (udsl_driver_name, &udsl_atm_devops, -1, NULL))) {
 		dbg ("udsl_usb_probe: failed to register ATM device!");
 		goto fail;
 	}
diff --git a/drivers/usb/misc/tiglusb.c b/drivers/usb/misc/tiglusb.c
index 471873b0c..cdf5919f8 100644
--- a/drivers/usb/misc/tiglusb.c
+++ b/drivers/usb/misc/tiglusb.c
@@ -10,7 +10,7 @@
  *
  * Based on dabusb.c, printer.c & scanner.c
  *
- * Please see the file: linux/Documentation/usb/SilverLink.txt
+ * Please see the file: Documentation/usb/silverlink.txt
  * and the website at:  http://lpg.ticalc.org/prj_usb/
  * for more info.
  *
@@ -132,7 +132,7 @@ tiglusb_open (struct inode *inode, struct file *filp)
 	filp->f_pos = 0;
 	filp->private_data = s;
 
-	return 0;
+	return nonseekable_open(inode, filp);
 }
 
 static int
diff --git a/drivers/usb/misc/usbtest.c b/drivers/usb/misc/usbtest.c
index 2fb1fae8c..8ee1b05ea 100644
--- a/drivers/usb/misc/usbtest.c
+++ b/drivers/usb/misc/usbtest.c
@@ -121,8 +121,8 @@ get_endpoints (struct usbtest_dev *dev, struct usb_interface *intf)
 	for (tmp = 0; tmp < intf->num_altsetting; tmp++) {
 		unsigned	ep;
 
-		in = out = 0;
-		iso_in = iso_out = 0;
+		in = out = NULL;
+		iso_in = iso_out = NULL;
 		alt = intf->altsetting + tmp;
 
 		/* take the first altsetting with in-bulk + out-bulk;
@@ -216,11 +216,11 @@ static struct urb *simple_alloc_urb (
 	struct urb		*urb;
 
 	if (bytes < 0)
-		return 0;
+		return NULL;
 	urb = usb_alloc_urb (0, SLAB_KERNEL);
 	if (!urb)
 		return urb;
-	usb_fill_bulk_urb (urb, udev, pipe, 0, bytes, simple_callback, 0);
+	usb_fill_bulk_urb (urb, udev, pipe, NULL, bytes, simple_callback, NULL);
 	urb->interval = (udev->speed == USB_SPEED_HIGH)
 			? (INTERRUPT_RATE << 3)
 			: INTERRUPT_RATE;
@@ -231,7 +231,7 @@ static struct urb *simple_alloc_urb (
 			&urb->transfer_dma);
 	if (!urb->transfer_buffer) {
 		usb_free_urb (urb);
-		urb = 0;
+		urb = NULL;
 	} else
 		memset (urb->transfer_buffer, 0, bytes);
 	return urb;
@@ -380,7 +380,7 @@ alloc_sglist (int nents, int max, int vary)
 
 	sg = kmalloc (nents * sizeof *sg, SLAB_KERNEL);
 	if (!sg)
-		return 0;
+		return NULL;
 	memset (sg, 0, nents * sizeof *sg);
 
 	for (i = 0; i < nents; i++) {
@@ -389,7 +389,7 @@ alloc_sglist (int nents, int max, int vary)
 		buf = kmalloc (size, SLAB_KERNEL);
 		if (!buf) {
 			free_sglist (sg, i);
-			return 0;
+			return NULL;
 		}
 		memset (buf, 0, size);
 
@@ -459,8 +459,8 @@ static int perform_sglist (
  * or remote wakeup (which needs human interaction).
  */
 
-static int realworld = 1;
-MODULE_PARM (realworld, "i");
+static unsigned realworld = 1;
+module_param (realworld, uint, 0);
 MODULE_PARM_DESC (realworld, "clear to demand stricter ch9 compliance");
 
 static int get_altsetting (struct usbtest_dev *dev)
@@ -637,7 +637,7 @@ static int ch9_postconfig (struct usbtest_dev *dev)
 
 	/* and sometimes [9.2.6.6] speed dependent descriptors */
 	if (udev->descriptor.bcdUSB == 0x0200) {	/* pre-swapped */
-		struct usb_qualifier_descriptor		*d = 0;
+		struct usb_qualifier_descriptor		*d = NULL;
 
 		/* device qualifier [9.6.2] */
 		retval = usb_get_descriptor (udev,
@@ -817,11 +817,11 @@ error:
 		if ((status = usb_submit_urb (urb, SLAB_ATOMIC)) != 0) {
 			dbg ("can't resubmit ctrl %02x.%02x, err %d",
 				reqp->bRequestType, reqp->bRequest, status);
-			urb->dev = 0;
+			urb->dev = NULL;
 		} else
 			ctx->pending++;
 	} else
-		urb->dev = 0;
+		urb->dev = NULL;
 	
 	/* signal completion when nothing's queued */
 	if (ctx->pending == 0)
@@ -1368,7 +1368,7 @@ static struct urb *iso_alloc_urb (
 	unsigned		i, maxp, packets;
 
 	if (bytes < 0 || !desc)
-		return 0;
+		return NULL;
 	maxp = 0x7ff & desc->wMaxPacketSize;
 	maxp *= 1 + (0x3 & (desc->wMaxPacketSize >> 11));
 	packets = (bytes + maxp - 1) / maxp;
@@ -1385,7 +1385,7 @@ static struct urb *iso_alloc_urb (
 			&urb->transfer_dma);
 	if (!urb->transfer_buffer) {
 		usb_free_urb (urb);
-		return 0;
+		return NULL;
 	}
 	memset (urb->transfer_buffer, 0, bytes);
 	for (i = 0; i < packets; i++) {
@@ -1808,17 +1808,17 @@ usbtest_ioctl (struct usb_interface *intf, unsigned int code, void *buf)
 
 /*-------------------------------------------------------------------------*/
 
-static int force_interrupt = 0;
-MODULE_PARM (force_interrupt, "i");
+static unsigned force_interrupt = 0;
+module_param (force_interrupt, uint, 0);
 MODULE_PARM_DESC (force_interrupt, "0 = test default; else interrupt");
 
 #ifdef	GENERIC
-static int vendor;
-MODULE_PARM (vendor, "h");
+static unsigned short vendor;
+module_param(vendor, ushort, 0);
 MODULE_PARM_DESC (vendor, "vendor code (from usb-if)");
 
-static int product;
-MODULE_PARM (product, "h");
+static unsigned short product;
+module_param(product, ushort, 0);
 MODULE_PARM_DESC (product, "product code (from vendor)");
 #endif
 
diff --git a/drivers/usb/net/kaweth.c b/drivers/usb/net/kaweth.c
index 42a248f8f..6eb637a80 100644
--- a/drivers/usb/net/kaweth.c
+++ b/drivers/usb/net/kaweth.c
@@ -62,7 +62,7 @@
 #include <asm/semaphore.h>
 #include <asm/byteorder.h>
 
-#define DEBUG
+#undef DEBUG
 
 #ifdef DEBUG
 #define kaweth_dbg(format, arg...) printk(KERN_DEBUG __FILE__ ": " format "\n" ,##arg)
@@ -592,7 +592,7 @@ static void kaweth_usb_receive(struct urb *urb, struct pt_regs *regs)
 
 	struct sk_buff *skb;
 
-	if(unlikely(urb->status == -ECONNRESET || urb->status == -ECONNABORTED))
+	if(unlikely(urb->status == -ECONNRESET || urb->status == -ECONNABORTED || urb->status == -ESHUTDOWN))
 	/* we are killed - set a flag and wake the disconnect handler */
 	{
 		kaweth->end = 1;
@@ -1293,7 +1293,7 @@ static int kaweth_internal_control_msg(struct usb_device *usb_dev,
                 return -ENOMEM;
 
         usb_fill_control_urb(urb, usb_dev, pipe, (unsigned char*)cmd, data,
-			 len, usb_api_blocking_completion,0);
+			 len, usb_api_blocking_completion, NULL);
 
         retv = usb_start_wait_urb(urb, timeout, &length);
         if (retv < 0) {
diff --git a/drivers/usb/net/pegasus.c b/drivers/usb/net/pegasus.c
index 5142d8a07..f4f1071a3 100644
--- a/drivers/usb/net/pegasus.c
+++ b/drivers/usb/net/pegasus.c
@@ -1137,8 +1137,6 @@ static void pegasus_set_multicast(struct net_device *net)
 {
 	pegasus_t *pegasus = net->priv;
 
-	netif_stop_queue(net);
-
 	if (net->flags & IFF_PROMISC) {
 		pegasus->eth_regs[EthCtrl2] |= RX_PROMISCUOUS;
 		info("%s: Promiscuous mode enabled", net->name);
@@ -1154,8 +1152,6 @@ static void pegasus_set_multicast(struct net_device *net)
 
 	pegasus->flags |= ETH_REGS_CHANGE;
 	ctrl_callback(pegasus->ctrl_urb, NULL);
-
-	netif_wake_queue(net);
 }
 
 static __u8 mii_phy_probe(pegasus_t * pegasus)
diff --git a/drivers/usb/net/pegasus.h b/drivers/usb/net/pegasus.h
index 411758b7d..7bc24d93f 100644
--- a/drivers/usb/net/pegasus.h
+++ b/drivers/usb/net/pegasus.h
@@ -121,6 +121,7 @@ struct usb_eth_dev {
 #define	VENDOR_ADMTEK		0x07a6
 #define	VENDOR_AEILAB		0x3334
 #define	VENDOR_ALLIEDTEL	0x07c9
+#define	VENDOR_ATEN		0x0557
 #define	VENDOR_BELKIN		0x050d
 #define	VENDOR_BILLIONTON	0x08dd
 #define	VENDOR_COMPAQ		0x049f
@@ -150,6 +151,8 @@ struct usb_eth_dev {
 
 PEGASUS_DEV( "3Com USB Ethernet 3C460B", VENDOR_3COM, 0x4601,
 		DEFAULT_GPIO_RESET | PEGASUS_II )
+PEGASUS_DEV( "ATEN USB Ethernet UC-110T", VENDOR_ATEN, 0x2007,
+		DEFAULT_GPIO_RESET | PEGASUS_II )
 PEGASUS_DEV( "USB HPNA/Ethernet", VENDOR_ABOCOM, 0x110c,
 		DEFAULT_GPIO_RESET | PEGASUS_II | HAS_HOME_PNA )
 PEGASUS_DEV( "USB HPNA/Ethernet", VENDOR_ABOCOM, 0x4104,
diff --git a/drivers/usb/net/rtl8150.c b/drivers/usb/net/rtl8150.c
index 2be3eba6b..d9d09e984 100644
--- a/drivers/usb/net/rtl8150.c
+++ b/drivers/usb/net/rtl8150.c
@@ -398,6 +398,21 @@ static void unlink_all_urbs(rtl8150_t * dev)
 	usb_unlink_urb(dev->ctrl_urb);
 }
 
+static inline struct sk_buff *pull_skb(rtl8150_t *dev)
+{
+	struct sk_buff *skb;
+	int i;
+
+	for (i = 0; i < RX_SKB_POOL_SIZE; i++) {
+		if (dev->rx_skb_pool[i]) {
+			skb = dev->rx_skb_pool[i];
+			dev->rx_skb_pool[i] = NULL;
+			return skb;
+		}
+	}
+	return NULL;
+}
+
 static void read_bulk_callback(struct urb *urb, struct pt_regs *regs)
 {
 	rtl8150_t *dev;
@@ -603,21 +618,6 @@ static void free_skb_pool(rtl8150_t *dev)
 			dev_kfree_skb(dev->rx_skb_pool[i]);
 }
 
-static inline struct sk_buff *pull_skb(rtl8150_t *dev)
-{
-	struct sk_buff *skb;
-	int i;
-
-	for (i = 0; i < RX_SKB_POOL_SIZE; i++) {
-		if (dev->rx_skb_pool[i]) {
-			skb = dev->rx_skb_pool[i];
-			dev->rx_skb_pool[i] = NULL;
-			return skb;
-		}
-	}
-	return NULL;
-}
-
 static int enable_net_traffic(rtl8150_t * dev)
 {
 	u8 cr, tcr, rcr, msr;
diff --git a/drivers/usb/net/usbnet.c b/drivers/usb/net/usbnet.c
index 557edde67..2d68cb01e 100644
--- a/drivers/usb/net/usbnet.c
+++ b/drivers/usb/net/usbnet.c
@@ -104,6 +104,8 @@
  * 		disconnect; other cleanups. (db)  Flush net1080 fifos
  * 		after several sequential framing errors. (Johannes Erdfelt)
  * 22-aug-2003	AX8817X support (Dave Hollis).
+ * 14-jun-2004  Trivial patch for AX8817X based Buffalo LUA-U2-KTX in Japan
+ *		(Neil Bortnak)
  *
  *-------------------------------------------------------------------------*/
 
@@ -314,7 +316,7 @@ get_endpoints (struct usbnet *dev, struct usb_interface *intf)
 	for (tmp = 0; tmp < intf->num_altsetting; tmp++) {
 		unsigned	ep;
 
-		in = out = 0;
+		in = out = NULL;
 		alt = intf->altsetting + tmp;
 
 		/* take the first altsetting with in-bulk + out-bulk;
@@ -452,6 +454,15 @@ static const struct driver_info	an2720_info = {
 #define AX_MCAST_FILTER_SIZE		8
 #define AX_MAX_MCAST			64
 
+#define AX_INTERRUPT_BUFSIZE		8
+
+/* This structure cannot exceed sizeof(unsigned long [5]) AKA 20 bytes */
+struct ax8817x_data {
+	u8 multi_filter[AX_MCAST_FILTER_SIZE];
+	struct urb *int_urb;
+	u8 *int_buf;
+};
+
 static int ax8817x_read_cmd(struct usbnet *dev, u8 cmd, u16 value, u16 index,
 			    u16 size, void *data)
 {
@@ -494,6 +505,30 @@ static void ax8817x_async_cmd_callback(struct urb *urb, struct pt_regs *regs)
 	usb_free_urb(urb);
 }
 
+static void ax8817x_interrupt_complete(struct urb *urb, struct pt_regs *regs)
+{
+	struct usbnet *dev = (struct usbnet *)urb->context;
+	struct ax8817x_data *data = (struct ax8817x_data *)&dev->data;
+	int link;
+
+	if (urb->status < 0) {
+		printk(KERN_DEBUG "ax8817x_interrupt_complete() failed with %d",
+			urb->status);
+	} else {
+		if (data->int_buf[5] == 0x90) {
+			link = data->int_buf[2] & 0x01;
+			if (netif_carrier_ok(dev->net) != link) {
+				if (link)
+					netif_carrier_on(dev->net);
+				else
+					netif_carrier_off(dev->net);
+				devdbg(dev, "ax8817x - Link Status is: %d", link);
+			}
+		}
+		usb_submit_urb(data->int_urb, GFP_KERNEL);
+	}
+}
+
 static void ax8817x_write_cmd_async(struct usbnet *dev, u8 cmd, u16 value, u16 index,
 				    u16 size, void *data)
 {
@@ -533,6 +568,7 @@ static void ax8817x_write_cmd_async(struct usbnet *dev, u8 cmd, u16 value, u16 i
 static void ax8817x_set_multicast(struct net_device *net)
 {
 	struct usbnet *dev = (struct usbnet *) net->priv;
+	struct ax8817x_data *data = (struct ax8817x_data *)&dev->data;
 	u8 rx_ctl = 0x8c;
 
 	if (net->flags & IFF_PROMISC) {
@@ -547,25 +583,24 @@ static void ax8817x_set_multicast(struct net_device *net)
 		 * for our 8 byte filter buffer
 		 * to avoid allocating memory that
 		 * is tricky to free later */
-		u8 *multi_filter = (u8 *)&dev->data;
 		struct dev_mc_list *mc_list = net->mc_list;
 		u32 crc_bits;
 		int i;
 
-		memset(multi_filter, 0, AX_MCAST_FILTER_SIZE);
+		memset(data->multi_filter, 0, AX_MCAST_FILTER_SIZE);
 
 		/* Build the multicast hash filter. */
 		for (i = 0; i < net->mc_count; i++) {
 			crc_bits =
 			    ether_crc(ETH_ALEN,
 				      mc_list->dmi_addr) >> 26;
-			multi_filter[crc_bits >> 3] |=
+			data->multi_filter[crc_bits >> 3] |=
 			    1 << (crc_bits & 7);
 			mc_list = mc_list->next;
 		}
 
 		ax8817x_write_cmd_async(dev, AX_CMD_WRITE_MULTI_FILTER, 0, 0,
-				   AX_MCAST_FILTER_SIZE, multi_filter);
+				   AX_MCAST_FILTER_SIZE, data->multi_filter);
 
 		rx_ctl |= 0x10;
 	}
@@ -667,13 +702,6 @@ static void ax8817x_get_drvinfo (struct net_device *net,
 	info->eedump_len = 0x3e;
 }
 
-static u32 ax8817x_get_link (struct net_device *net)
-{
-	struct usbnet *dev = (struct usbnet *)net->priv;
-
-	return (u32)mii_link_ok(&dev->mii);
-}
-
 static int ax8817x_get_settings(struct net_device *net, struct ethtool_cmd *cmd)
 {
 	struct usbnet *dev = (struct usbnet *)net->priv;
@@ -693,7 +721,7 @@ static int ax8817x_set_settings(struct net_device *net, struct ethtool_cmd *cmd)
    devices that may be connected at the same time. */
 static struct ethtool_ops ax8817x_ethtool_ops = {
 	.get_drvinfo		= ax8817x_get_drvinfo,
-	.get_link		= ax8817x_get_link,
+	.get_link		= ethtool_op_get_link,
 	.get_msglevel		= usbnet_get_msglevel,
 	.set_msglevel		= usbnet_set_msglevel,
 	.get_wol		= ax8817x_get_wol,
@@ -707,13 +735,34 @@ static int ax8817x_bind(struct usbnet *dev, struct usb_interface *intf)
 {
 	int ret;
 	u8 buf[6];
-	u16 *buf16 = (u16 *) buf;
 	int i;
 	unsigned long gpio_bits = dev->driver_info->data;
+	struct ax8817x_data *data = (struct ax8817x_data *)dev->data;
 
 	dev->in = usb_rcvbulkpipe(dev->udev, 3);
 	dev->out = usb_sndbulkpipe(dev->udev, 2);
 
+	// allocate irq urb
+	if ((data->int_urb = usb_alloc_urb (0, GFP_KERNEL)) == 0) {
+		dbg ("%s: cannot allocate interrupt URB",
+			dev->net->name);
+		return -ENOMEM;
+	}
+	
+	if ((data->int_buf = kmalloc(AX_INTERRUPT_BUFSIZE, GFP_KERNEL)) == NULL) {
+		dbg ("%s: cannot allocate memory for interrupt buffer",
+			dev->net->name);
+		usb_free_urb(data->int_urb);
+		return -ENOMEM;
+	}
+	memset(data->int_buf, 0, AX_INTERRUPT_BUFSIZE);
+
+	usb_fill_int_urb (data->int_urb, dev->udev,
+		usb_rcvintpipe (dev->udev, 1),
+		data->int_buf, AX_INTERRUPT_BUFSIZE,
+		ax8817x_interrupt_complete, dev,
+		dev->udev->speed == USB_SPEED_HIGH ? 8 : 100);
+
 	/* Toggle the GPIOs in a manufacturer/model specific way */
 	for (i = 2; i >= 0; i--) {
 		if ((ret = ax8817x_write_cmd(dev, AX_CMD_WRITE_GPIOS,
@@ -754,49 +803,37 @@ static int ax8817x_bind(struct usbnet *dev, struct usb_interface *intf)
 	dev->mii.reg_num_mask = 0x1f;
 	dev->mii.phy_id = buf[1];
 
-	if ((ret = ax8817x_write_cmd(dev, AX_CMD_SET_SW_MII, 0, 0, 0, &buf)) < 0) {
-		dbg("Failed to go to software MII mode: %02x", ret);
-		return ret;
-	}
-
-	*buf16 = cpu_to_le16(BMCR_RESET);
-	if ((ret = ax8817x_write_cmd(dev, AX_CMD_WRITE_MII_REG,
-				     dev->mii.phy_id, MII_BMCR, 2, buf16)) < 0) {
-		dbg("Failed to write MII reg - MII_BMCR: %02x", ret);
-		return ret;
-	}
+	dev->net->set_multicast_list = ax8817x_set_multicast;
+	dev->net->ethtool_ops = &ax8817x_ethtool_ops;
 
-	/* Advertise that we can do full-duplex pause */
-	*buf16 = cpu_to_le16(ADVERTISE_ALL | ADVERTISE_CSMA | 0x0400);
-	if ((ret = ax8817x_write_cmd(dev, AX_CMD_WRITE_MII_REG,
-			   	     dev->mii.phy_id, MII_ADVERTISE, 
-				     2, buf16)) < 0) {
-		dbg("Failed to write MII_REG advertisement: %02x", ret);
-		return ret;
-	}
+	ax8817x_mdio_write(dev->net, dev->mii.phy_id, MII_BMCR,
+			cpu_to_le16(BMCR_RESET));
+	ax8817x_mdio_write(dev->net, dev->mii.phy_id, MII_ADVERTISE,
+			cpu_to_le16(ADVERTISE_ALL | ADVERTISE_CSMA | 0x0400));
+	mii_nway_restart(&dev->mii);
 
-	*buf16 = cpu_to_le16(BMCR_ANENABLE | BMCR_ANRESTART);
-	if ((ret = ax8817x_write_cmd(dev, AX_CMD_WRITE_MII_REG,
-			  	     dev->mii.phy_id, MII_BMCR, 
-				     2, buf16)) < 0) {
-		dbg("Failed to write MII reg autonegotiate: %02x", ret);
+	if((ret = usb_submit_urb(data->int_urb, GFP_KERNEL)) < 0) {
+		dbg("Failed to submit interrupt URB: %02x", ret);
+		usb_free_urb(data->int_urb);
 		return ret;
 	}
 
-	if ((ret = ax8817x_write_cmd(dev, AX_CMD_SET_HW_MII, 0, 0, 0, &buf)) < 0) {
-		dbg("Failed to set hardware MII: %02x", ret);
-		return ret;
-	}
+	return 0;
+}
 
-	dev->net->set_multicast_list = ax8817x_set_multicast;
-	dev->net->ethtool_ops = &ax8817x_ethtool_ops;
+static void ax8817x_unbind(struct usbnet *dev, struct usb_interface *intf)
+{
+	struct ax8817x_data *data = (struct ax8817x_data *)dev->data;
 
-	return 0;
+	usb_unlink_urb(data->int_urb);
+	usb_free_urb(data->int_urb);
+	kfree(data->int_buf);
 }
 
 static const struct driver_info ax8817x_info = {
 	.description = "ASIX AX8817x USB 2.0 Ethernet",
 	.bind = ax8817x_bind,
+	.unbind = ax8817x_unbind,
 	.flags =  FLAG_ETHER,
 	.data = 0x00130103,
 };
@@ -804,6 +841,7 @@ static const struct driver_info ax8817x_info = {
 static const struct driver_info dlink_dub_e100_info = {
 	.description = "DLink DUB-E100 USB Ethernet",
 	.bind = ax8817x_bind,
+	.unbind = ax8817x_unbind,
 	.flags =  FLAG_ETHER,
 	.data = 0x009f9d9f,
 };
@@ -811,6 +849,7 @@ static const struct driver_info dlink_dub_e100_info = {
 static const struct driver_info netgear_fa120_info = {
 	.description = "Netgear FA-120 USB Ethernet",
 	.bind = ax8817x_bind,
+	.unbind = ax8817x_unbind,
 	.flags =  FLAG_ETHER,
 	.data = 0x00130103,
 };
@@ -818,6 +857,7 @@ static const struct driver_info netgear_fa120_info = {
 static const struct driver_info hawking_uf200_info = {
 	.description = "Hawking UF200 USB Ethernet",
 	.bind = ax8817x_bind,
+	.unbind = ax8817x_unbind,
 	.flags =  FLAG_ETHER,
 	.data = 0x001f1d1f,
 };
@@ -1084,7 +1124,7 @@ static void cdc_unbind (struct usbnet *dev, struct usb_interface *intf)
 		/* ensure immediate exit from usbnet_disconnect */
 		usb_set_intfdata(info->data, NULL);
 		usb_driver_release_interface (&usbnet_driver, info->data);
-		info->data = 0;
+		info->data = NULL;
 	}
 
 	/* and vice versa (just in case) */
@@ -1092,7 +1132,7 @@ static void cdc_unbind (struct usbnet *dev, struct usb_interface *intf)
 		/* ensure immediate exit from usbnet_disconnect */
 		usb_set_intfdata(info->control, NULL);
 		usb_driver_release_interface (&usbnet_driver, info->control);
-		info->control = 0;
+		info->control = NULL;
 	}
 }
 
@@ -1157,6 +1197,7 @@ static int cdc_bind (struct usbnet *dev, struct usb_interface *intf)
 
 	status = get_ethernet_addr (dev, info->ether);
 	if (status < 0) {
+		usb_set_intfdata(info->data, NULL);
 		usb_driver_release_interface (&usbnet_driver, info->data);
 		return status;
 	}
@@ -1638,7 +1679,7 @@ nc_vendor_write (struct usbnet *dev, u8 req, u8 regnum, u16 value)
 		req,
 		USB_DIR_OUT | USB_TYPE_VENDOR | USB_RECIP_DEVICE,
 		value, regnum,
-		0, 0,			// data is in setup packet
+		NULL, 0,			// data is in setup packet
 		CONTROL_TIMEOUT_JIFFIES);
 }
 
@@ -2081,7 +2122,7 @@ pl_vendor_req (struct usbnet *dev, u8 req, u8 val, u8 index)
 		req,
 		USB_DIR_IN | USB_TYPE_VENDOR | USB_RECIP_DEVICE,
 		val, index,
-		0, 0,
+		NULL, 0,
 		CONTROL_TIMEOUT_JIFFIES);
 }
 
@@ -2415,7 +2456,7 @@ static void rx_complete (struct urb *urb, struct pt_regs *regs)
 
 	skb_put (skb, urb->actual_length);
 	entry->state = rx_done;
-	entry->urb = 0;
+	entry->urb = NULL;
 
 	switch (urb_status) {
 	    // success
@@ -2459,7 +2500,7 @@ static void rx_complete (struct urb *urb, struct pt_regs *regs)
 block:
 		entry->state = rx_cleanup;
 		entry->urb = urb;
-		urb = 0;
+		urb = NULL;
 		break;
 
 	    // data overrun ... flush fifo?
@@ -2554,7 +2595,7 @@ static int usbnet_stop (struct net_device *net)
 		schedule_timeout (UNLINK_TIMEOUT_JIFFIES);
 		devdbg (dev, "waited for %d urb completions", temp);
 	}
-	dev->wait = 0;
+	dev->wait = NULL;
 	remove_wait_queue (&unlink_wakeup, &wait); 
 
 	/* deferred work (task, timer, softirq) must also stop.
@@ -2713,7 +2754,7 @@ kevent (void *data)
 
 	/* tasklet could resubmit itself forever if memory is tight */
 	if (test_bit (EVENT_RX_MEMORY, &dev->flags)) {
-		struct urb	*urb = 0;
+		struct urb	*urb = NULL;
 
 		if (netif_running (dev->net))
 			urb = usb_alloc_urb (0, GFP_KERNEL);
@@ -2768,7 +2809,7 @@ static void tx_complete (struct urb *urb, struct pt_regs *regs)
 		}
 	}
 
-	urb->dev = 0;
+	urb->dev = NULL;
 	entry->state = tx_done;
 	defer_bh (dev, skb);
 }
@@ -2792,13 +2833,13 @@ static int usbnet_start_xmit (struct sk_buff *skb, struct net_device *net)
 	struct usbnet		*dev = (struct usbnet *) net->priv;
 	int			length;
 	int			retval = NET_XMIT_SUCCESS;
-	struct urb		*urb = 0;
+	struct urb		*urb = NULL;
 	struct skb_data		*entry;
 	struct driver_info	*info = dev->driver_info;
 	unsigned long		flags;
 #ifdef	CONFIG_USB_NET1080
-	struct nc_header	*header = 0;
-	struct nc_trailer	*trailer = 0;
+	struct nc_header	*header = NULL;
+	struct nc_trailer	*trailer = NULL;
 #endif	/* CONFIG_USB_NET1080 */
 
 	// some devices want funky USB-level framing, for
@@ -3204,6 +3245,14 @@ static const struct usb_device_id	products [] = {
 	// ATEN UC210T
 	USB_DEVICE (0x0557, 0x2009),
 	.driver_info =  (unsigned long) &ax8817x_info,
+}, {
+	// Buffalo LUA-U2-KTX
+	USB_DEVICE (0x0411, 0x003d),
+	.driver_info =  (unsigned long) &ax8817x_info,
+}, {
+	// Sitecom LN-029 "USB 2.0 10/100 Ethernet adapter"
+	USB_DEVICE (0x6189, 0x182d),
+	.driver_info =  (unsigned long) &ax8817x_info,
 },
 #endif
 
diff --git a/drivers/usb/serial/Kconfig b/drivers/usb/serial/Kconfig
index 46c0ebfb5..88fede7b4 100644
--- a/drivers/usb/serial/Kconfig
+++ b/drivers/usb/serial/Kconfig
@@ -20,13 +20,6 @@ config USB_SERIAL
 	  To compile this driver as a module, choose M here: the
 	  module will be called usbserial.
 
-config USB_SERIAL_DEBUG
-	bool "USB Serial Converter verbose debug"
-	depends on USB_SERIAL=y
-	help
-	  Say Y here if you want verbose debug messages from the USB Serial
-	  Drivers sent to the kernel debug log.
-
 config USB_SERIAL_CONSOLE
 	bool "USB Serial Console device support (EXPERIMENTAL)"
 	depends on USB_SERIAL=y && EXPERIMENTAL
diff --git a/drivers/usb/serial/Makefile b/drivers/usb/serial/Makefile
index 73b899e52..6cfbe3108 100644
--- a/drivers/usb/serial/Makefile
+++ b/drivers/usb/serial/Makefile
@@ -9,25 +9,26 @@ obj-$(CONFIG_USB_SERIAL)			+= usbserial.o
 usbserial-obj-$(CONFIG_USB_SERIAL_CONSOLE)	+= console.o
 usbserial-obj-$(CONFIG_USB_EZUSB)		+= ezusb.o
 
-obj-$(CONFIG_USB_SERIAL_VISOR)			+= visor.o
-obj-$(CONFIG_USB_SERIAL_IPAQ)			+= ipaq.o
-obj-$(CONFIG_USB_SERIAL_WHITEHEAT)		+= whiteheat.o
-obj-$(CONFIG_USB_SERIAL_FTDI_SIO)		+= ftdi_sio.o
-obj-$(CONFIG_USB_SERIAL_KEYSPAN_PDA)		+= keyspan_pda.o
-obj-$(CONFIG_USB_SERIAL_XIRCOM)			+= keyspan_pda.o
-obj-$(CONFIG_USB_SERIAL_KEYSPAN)		+= keyspan.o
-obj-$(CONFIG_USB_SERIAL_OMNINET)		+= omninet.o
-obj-$(CONFIG_USB_SERIAL_DIGI_ACCELEPORT)	+= digi_acceleport.o
+usbserial-objs	:= usb-serial.o generic.o bus.o $(usbserial-obj-y)
+
 obj-$(CONFIG_USB_SERIAL_BELKIN)			+= belkin_sa.o
-obj-$(CONFIG_USB_SERIAL_EMPEG)			+= empeg.o
-obj-$(CONFIG_USB_SERIAL_MCT_U232)		+= mct_u232.o
+obj-$(CONFIG_USB_SERIAL_CYBERJACK)		+= cyberjack.o
+obj-$(CONFIG_USB_SERIAL_DIGI_ACCELEPORT)	+= digi_acceleport.o
 obj-$(CONFIG_USB_SERIAL_EDGEPORT)		+= io_edgeport.o
 obj-$(CONFIG_USB_SERIAL_EDGEPORT_TI)		+= io_ti.o
-obj-$(CONFIG_USB_SERIAL_PL2303)			+= pl2303.o
-obj-$(CONFIG_USB_SERIAL_KOBIL_SCT)		+= kobil_sct.o
-obj-$(CONFIG_USB_SERIAL_CYBERJACK)		+= cyberjack.o
+obj-$(CONFIG_USB_SERIAL_EMPEG)			+= empeg.o
+obj-$(CONFIG_USB_SERIAL_FTDI_SIO)		+= ftdi_sio.o
+obj-$(CONFIG_USB_SERIAL_IPAQ)			+= ipaq.o
 obj-$(CONFIG_USB_SERIAL_IR)			+= ir-usb.o
+obj-$(CONFIG_USB_SERIAL_KEYSPAN)		+= keyspan.o
+obj-$(CONFIG_USB_SERIAL_KEYSPAN_PDA)		+= keyspan_pda.o
 obj-$(CONFIG_USB_SERIAL_KLSI)			+= kl5kusb105.o
+obj-$(CONFIG_USB_SERIAL_KOBIL_SCT)		+= kobil_sct.o
+obj-$(CONFIG_USB_SERIAL_MCT_U232)		+= mct_u232.o
+obj-$(CONFIG_USB_SERIAL_OMNINET)		+= omninet.o
+obj-$(CONFIG_USB_SERIAL_PL2303)			+= pl2303.o
 obj-$(CONFIG_USB_SERIAL_SAFE)			+= safe_serial.o
+obj-$(CONFIG_USB_SERIAL_VISOR)			+= visor.o
+obj-$(CONFIG_USB_SERIAL_WHITEHEAT)		+= whiteheat.o
+obj-$(CONFIG_USB_SERIAL_XIRCOM)			+= keyspan_pda.o
 
-usbserial-objs	:= usb-serial.o generic.o bus.o $(usbserial-obj-y)
diff --git a/drivers/usb/serial/belkin_sa.c b/drivers/usb/serial/belkin_sa.c
index ad222ecc4..bcf56011e 100644
--- a/drivers/usb/serial/belkin_sa.c
+++ b/drivers/usb/serial/belkin_sa.c
@@ -75,16 +75,11 @@
 #include <linux/spinlock.h>
 #include <asm/uaccess.h>
 #include <linux/usb.h>
-
-#ifdef CONFIG_USB_SERIAL_DEBUG
- 	static int debug = 1;
-#else
- 	static int debug;
-#endif
-
 #include "usb-serial.h"
 #include "belkin_sa.h"
 
+static int debug;
+
 /*
  * Version Information
  */
@@ -276,7 +271,7 @@ static void belkin_sa_read_int_callback (struct urb *urb, struct pt_regs *regs)
 		goto exit;
 	}
 
-	usb_serial_debug_data (__FILE__, __FUNCTION__, urb->actual_length, data);
+	usb_serial_debug_data(debug, &port->dev, __FUNCTION__, urb->actual_length, data);
 
 	/* Handle known interrupt data */
 	/* ignore data[0] and data[1] */
@@ -614,6 +609,5 @@ MODULE_AUTHOR( DRIVER_AUTHOR );
 MODULE_DESCRIPTION( DRIVER_DESC );
 MODULE_LICENSE("GPL");
 
-MODULE_PARM(debug, "i");
+module_param(debug, bool, S_IRUGO | S_IWUSR);
 MODULE_PARM_DESC(debug, "Debug enabled or not");
-
diff --git a/drivers/usb/serial/bus.c b/drivers/usb/serial/bus.c
index 003e10158..3cabbbb10 100644
--- a/drivers/usb/serial/bus.c
+++ b/drivers/usb/serial/bus.c
@@ -14,13 +14,6 @@
 #include <linux/tty.h>
 #include <linux/module.h>
 #include <linux/usb.h>
-
-#ifdef CONFIG_USB_SERIAL_DEBUG
-	static int debug = 1;
-#else
-	static int debug;
-#endif
-
 #include "usb-serial.h"
 
 static int usb_serial_device_match (struct device *dev, struct device_driver *drv)
@@ -78,8 +71,8 @@ static int usb_serial_device_probe (struct device *dev)
 	minor = port->number;
 	tty_register_device (usb_serial_tty_driver, minor, dev);
 	dev_info(&port->serial->dev->dev, 
-		 "%s converter now attached to ttyUSB%d (or usb/tts/%d for devfs)\n",
-		 driver->name, minor, minor);
+		 "%s converter now attached to ttyUSB%d\n",
+		 driver->name, minor);
 
 exit:
 	return retval;
diff --git a/drivers/usb/serial/cyberjack.c b/drivers/usb/serial/cyberjack.c
index 9ca40acd3..3ee5f493a 100644
--- a/drivers/usb/serial/cyberjack.c
+++ b/drivers/usb/serial/cyberjack.c
@@ -35,16 +35,11 @@
 #include <linux/spinlock.h>
 #include <asm/uaccess.h>
 #include <linux/usb.h>
+#include "usb-serial.h"
 
 #define CYBERJACK_LOCAL_BUF_SIZE 32
 
-#ifdef CONFIG_USB_SERIAL_DEBUG
-	static int debug = 1;
-#else
-	static int debug;
-#endif
-
-#include "usb-serial.h"
+static int debug;
 
 /*
  * Version Information
@@ -243,7 +238,7 @@ static int cyberjack_write (struct usb_serial_port *port, int from_user, const u
 		memcpy (priv->wrbuf+priv->wrfilled, buf, count);
 	}  
 
-	usb_serial_debug_data (__FILE__, __FUNCTION__, count,
+	usb_serial_debug_data(debug, &port->dev, __FUNCTION__, count,
 		priv->wrbuf+priv->wrfilled);
 	priv->wrfilled += count;
 
@@ -318,7 +313,7 @@ static void cyberjack_read_int_callback( struct urb *urb, struct pt_regs *regs )
 	if (urb->status)
 		return;
 
-	usb_serial_debug_data (__FILE__, __FUNCTION__, urb->actual_length, data);
+	usb_serial_debug_data(debug, &port->dev, __FUNCTION__, urb->actual_length, data);
 
 	/* React only to interrupts signaling a bulk_in transfer */
 	if( (urb->actual_length==4) && (data[0]==0x01) ) {
@@ -374,14 +369,12 @@ static void cyberjack_read_bulk_callback (struct urb *urb, struct pt_regs *regs)
 
 	dbg("%s - port %d", __FUNCTION__, port->number);
 	
+	usb_serial_debug_data(debug, &port->dev, __FUNCTION__, urb->actual_length, data);
 	if (urb->status) {
-		usb_serial_debug_data (__FILE__, __FUNCTION__, urb->actual_length, urb->transfer_buffer);
 		dbg("%s - nonzero read bulk status received: %d", __FUNCTION__, urb->status);
 		return;
 	}
 
-	usb_serial_debug_data (__FILE__, __FUNCTION__, urb->actual_length, data);
-
 	tty = port->tty;
 	if (urb->actual_length) {
 		for (i = 0; i < urb->actual_length ; ++i) {
@@ -520,6 +513,5 @@ MODULE_AUTHOR( DRIVER_AUTHOR );
 MODULE_DESCRIPTION( DRIVER_DESC );
 MODULE_LICENSE("GPL");
 
-MODULE_PARM(debug, "i");
+module_param(debug, bool, S_IRUGO | S_IWUSR);
 MODULE_PARM_DESC(debug, "Debug enabled or not");
-
diff --git a/drivers/usb/serial/digi_acceleport.c b/drivers/usb/serial/digi_acceleport.c
index 3c123be55..f187b3165 100644
--- a/drivers/usb/serial/digi_acceleport.c
+++ b/drivers/usb/serial/digi_acceleport.c
@@ -246,16 +246,8 @@
 #include <linux/workqueue.h>
 #include <asm/uaccess.h>
 #include <linux/usb.h>
-
-#ifdef CONFIG_USB_SERIAL_DEBUG
-	static int debug = 1;
-#else
-	static int debug;
-#endif
-
 #include "usb-serial.h"
 
-
 /* Defines */
 
 /*
@@ -480,6 +472,8 @@ static int digi_read_oob_callback( struct urb *urb );
 
 /* Statics */
 
+static int debug;
+
 static struct usb_device_id id_table_combined [] = {
 	{ USB_DEVICE(DIGI_VENDOR_ID, DIGI_2_ID) },
 	{ USB_DEVICE(DIGI_VENDOR_ID, DIGI_4_ID) },
@@ -2068,6 +2062,5 @@ MODULE_AUTHOR( DRIVER_AUTHOR );
 MODULE_DESCRIPTION( DRIVER_DESC );
 MODULE_LICENSE("GPL");
 
-MODULE_PARM(debug, "i");
+module_param(debug, bool, S_IRUGO | S_IWUSR);
 MODULE_PARM_DESC(debug, "Debug enabled or not");
-
diff --git a/drivers/usb/serial/empeg.c b/drivers/usb/serial/empeg.c
index 677b31fc5..972f3b91d 100644
--- a/drivers/usb/serial/empeg.c
+++ b/drivers/usb/serial/empeg.c
@@ -63,15 +63,10 @@
 #include <linux/spinlock.h>
 #include <asm/uaccess.h>
 #include <linux/usb.h>
-
-#ifdef CONFIG_USB_SERIAL_DEBUG
-	static int debug = 1;
-#else
-	static int debug;
-#endif
-
 #include "usb-serial.h"
 
+static int debug;
+
 /*
  * Version Information
  */
@@ -249,7 +244,7 @@ static int empeg_write (struct usb_serial_port *port, int from_user, const unsig
 			memcpy (urb->transfer_buffer, current_position, transfer_size);
 		}
 
-		usb_serial_debug_data (__FILE__, __FUNCTION__, transfer_size, urb->transfer_buffer);
+		usb_serial_debug_data(debug, &port->dev, __FUNCTION__, transfer_size, urb->transfer_buffer);
 
 		/* build up our urb */
 		usb_fill_bulk_urb (
@@ -365,7 +360,7 @@ static void empeg_read_bulk_callback (struct urb *urb, struct pt_regs *regs)
 		return;
 	}
 
-	usb_serial_debug_data (__FILE__, __FUNCTION__, urb->actual_length, data);
+	usb_serial_debug_data(debug, &port->dev, __FUNCTION__, urb->actual_length, data);
 
 	tty = port->tty;
 
@@ -609,6 +604,5 @@ MODULE_AUTHOR( DRIVER_AUTHOR );
 MODULE_DESCRIPTION( DRIVER_DESC );
 MODULE_LICENSE("GPL");
 
-MODULE_PARM(debug, "i");
+module_param(debug, bool, S_IRUGO | S_IWUSR);
 MODULE_PARM_DESC(debug, "Debug enabled or not");
-
diff --git a/drivers/usb/serial/ezusb.c b/drivers/usb/serial/ezusb.c
index 676d9650f..93c803b00 100644
--- a/drivers/usb/serial/ezusb.c
+++ b/drivers/usb/serial/ezusb.c
@@ -16,13 +16,6 @@
 #include <linux/tty.h>
 #include <linux/module.h>
 #include <linux/usb.h>
-
-#ifdef CONFIG_USB_SERIAL_DEBUG
-	static int debug = 1;
-#else
-	static int debug;
-#endif
-
 #include "usb-serial.h"
 
 /* EZ-USB Control and Status Register.  Bit 0 controls 8051 reset */
@@ -35,7 +28,7 @@ int ezusb_writememory (struct usb_serial *serial, int address, unsigned char *da
 
 	/* dbg("ezusb_writememory %x, %d", address, length); */
 	if (!serial->dev) {
-		dbg("%s - no physical device present, failing.", __FUNCTION__);
+		err("%s - no physical device present, failing.", __FUNCTION__);
 		return -ENODEV;
 	}
 
@@ -52,12 +45,12 @@ int ezusb_writememory (struct usb_serial *serial, int address, unsigned char *da
 
 int ezusb_set_reset (struct usb_serial *serial, unsigned char reset_bit)
 {
-	int	response;
-	dbg("%s - %d", __FUNCTION__, reset_bit);
+	int response;
+
+	/* dbg("%s - %d", __FUNCTION__, reset_bit); */
 	response = ezusb_writememory (serial, CPUCS_REG, &reset_bit, 1, 0xa0);
-	if (response < 0) {
+	if (response < 0)
 		dev_err(&serial->dev->dev, "%s- %d failed\n", __FUNCTION__, reset_bit);
-	}
 	return response;
 }
 
diff --git a/drivers/usb/serial/ftdi_sio.c b/drivers/usb/serial/ftdi_sio.c
index c15f3e57c..b35ab607a 100644
--- a/drivers/usb/serial/ftdi_sio.c
+++ b/drivers/usb/serial/ftdi_sio.c
@@ -253,12 +253,6 @@
 #include <asm/uaccess.h>
 #include <linux/usb.h>
 #include <linux/serial.h>
-#ifdef CONFIG_USB_SERIAL_DEBUG
-	static int debug = 1;
-#else
-	static int debug;
-#endif
-
 #include "usb-serial.h"
 #include "ftdi_sio.h"
 
@@ -269,6 +263,8 @@
 #define DRIVER_AUTHOR "Greg Kroah-Hartman <greg@kroah.com>, Bill Ryder <bryder@sgi.com>, Kuba Ober <kuba@mareimbrium.org>"
 #define DRIVER_DESC "USB FTDI Serial Converters Driver"
 
+static int debug;
+
 static struct usb_device_id id_table_sio [] = {
 	{ USB_DEVICE(FTDI_VID, FTDI_SIO_PID) },
 	{ }						/* Terminating entry */
@@ -296,6 +292,8 @@ static struct usb_device_id id_table_8U232AM [] = {
 	{ USB_DEVICE_VER(FTDI_VID, FTDI_8U232AM_PID, 0, 0x3ff) },
 	{ USB_DEVICE_VER(FTDI_VID, FTDI_8U232AM_ALT_PID, 0, 0x3ff) },
 	{ USB_DEVICE_VER(FTDI_VID, FTDI_RELAIS_PID, 0, 0x3ff) },
+	{ USB_DEVICE(INTERBIOMETRICS_VID, INTERBIOMETRICS_IOBOARD_PID) },
+	{ USB_DEVICE(INTERBIOMETRICS_VID, INTERBIOMETRICS_MINI_IOBOARD_PID) },
 	{ USB_DEVICE_VER(FTDI_NF_RIC_VID, FTDI_NF_RIC_PID, 0, 0x3ff) },
 	{ USB_DEVICE_VER(FTDI_VID, FTDI_XF_632_PID, 0, 0x3ff) },
 	{ USB_DEVICE_VER(FTDI_VID, FTDI_XF_634_PID, 0, 0x3ff) },
@@ -361,6 +359,10 @@ static struct usb_device_id id_table_8U232AM [] = {
 	{ USB_DEVICE_VER(FTDI_VID, PROTEGO_SPECIAL_4, 0, 0x3ff) },
 	{ USB_DEVICE_VER(FTDI_VID, FTDI_ELV_UO100_PID, 0, 0x3ff) },
 	{ USB_DEVICE_VER(FTDI_VID, INSIDE_ACCESSO, 0, 0x3ff) },
+	{ USB_DEVICE_VER(INTREPID_VID, INTREPID_VALUECAN_PID, 0, 0x3ff) },
+	{ USB_DEVICE_VER(INTREPID_VID, INTREPID_NEOVI_PID, 0, 0x3ff) },
+	{ USB_DEVICE_VER(FALCOM_VID, FALCOM_TWIST_PID, 0, 0x3ff) },
+	{ USB_DEVICE_VER(FTDI_VID, FTDI_SUUNTO_SPORTS_PID, 0, 0x3ff) },
 	{ }						/* Terminating entry */
 };
 
@@ -466,6 +468,11 @@ static struct usb_device_id id_table_FT232BM [] = {
  	{ USB_DEVICE_VER(FTDI_VID, LINX_FUTURE_2_PID, 0x400, 0xffff) },
 	{ USB_DEVICE(FTDI_VID, FTDI_CCSICDU20_0_PID) },
 	{ USB_DEVICE(FTDI_VID, FTDI_CCSICDU40_1_PID) },
+	{ USB_DEVICE_VER(FTDI_VID, INSIDE_ACCESSO, 0x400, 0xffff) },
+	{ USB_DEVICE_VER(INTREPID_VID, INTREPID_VALUECAN_PID, 0x400, 0xffff) },
+	{ USB_DEVICE_VER(INTREPID_VID, INTREPID_NEOVI_PID, 0x400, 0xffff) },
+	{ USB_DEVICE_VER(FALCOM_VID, FALCOM_TWIST_PID, 0x400, 0xffff) },
+	{ USB_DEVICE_VER(FTDI_VID, FTDI_SUUNTO_SPORTS_PID, 0x400, 0xffff) },
 	{ }						/* Terminating entry */
 };
 
@@ -488,6 +495,8 @@ static struct usb_device_id id_table_combined [] = {
 	{ USB_DEVICE(FTDI_VID, FTDI_8U232AM_PID) },
 	{ USB_DEVICE(FTDI_VID, FTDI_8U232AM_ALT_PID) },
 	{ USB_DEVICE(FTDI_VID, FTDI_RELAIS_PID) },
+	{ USB_DEVICE(INTERBIOMETRICS_VID, INTERBIOMETRICS_IOBOARD_PID) },
+	{ USB_DEVICE(INTERBIOMETRICS_VID, INTERBIOMETRICS_MINI_IOBOARD_PID) },
 	{ USB_DEVICE(FTDI_VID, FTDI_XF_632_PID) },
 	{ USB_DEVICE(FTDI_VID, FTDI_XF_634_PID) },
 	{ USB_DEVICE(FTDI_VID, FTDI_XF_547_PID) },
@@ -570,6 +579,10 @@ static struct usb_device_id id_table_combined [] = {
  	{ USB_DEVICE(FTDI_VID, FTDI_CCSICDU20_0_PID) },
  	{ USB_DEVICE(FTDI_VID, FTDI_CCSICDU40_1_PID) },
 	{ USB_DEVICE(FTDI_VID, INSIDE_ACCESSO) },
+	{ USB_DEVICE(INTREPID_VID, INTREPID_VALUECAN_PID) },
+	{ USB_DEVICE(INTREPID_VID, INTREPID_NEOVI_PID) },
+	{ USB_DEVICE(FALCOM_VID, FALCOM_TWIST_PID) },
+	{ USB_DEVICE(FTDI_VID, FTDI_SUUNTO_SPORTS_PID) },
 	{ }						/* Terminating entry */
 };
 
@@ -1022,7 +1035,7 @@ static __u32 get_ftdi_divisor(struct usb_serial_port * port)
 }
 
 
-static int get_serial_info(struct usb_serial_port * port, struct serial_struct * retinfo)
+static int get_serial_info(struct usb_serial_port * port, struct serial_struct __user * retinfo)
 {
 	struct ftdi_private *priv = usb_get_serial_port_data(port);
 	struct serial_struct tmp;
@@ -1039,7 +1052,7 @@ static int get_serial_info(struct usb_serial_port * port, struct serial_struct *
 } /* get_serial_info */
 
 
-static int set_serial_info(struct usb_serial_port * port, struct serial_struct * newinfo)
+static int set_serial_info(struct usb_serial_port * port, struct serial_struct __user * newinfo)
 { /* set_serial_info */
 	struct ftdi_private *priv = usb_get_serial_port_data(port);
 	struct serial_struct new_serial;
@@ -1492,7 +1505,7 @@ static int ftdi_write (struct usb_serial_port *port, int from_user,
 		}
 	}
 
-	usb_serial_debug_data (__FILE__, __FUNCTION__, transfer_size, buffer);
+	usb_serial_debug_data(debug, &port->dev, __FUNCTION__, transfer_size, buffer);
 
 	/* fill the buffer and send it */
 	usb_fill_bulk_urb(urb, port->serial->dev, 
@@ -1504,6 +1517,7 @@ static int ftdi_write (struct usb_serial_port *port, int from_user,
 	if (status) {
 		err("%s - failed submitting write urb, error %d", __FUNCTION__, status);
 		count = status;
+		kfree (buffer);
 	}
 
 	/* we are done with this urb, so let the host driver
@@ -1657,7 +1671,7 @@ static void ftdi_process_read (struct usb_serial_port *port)
 
         /* The first two bytes of every read packet are status */
 	if (urb->actual_length > 2) {
-		usb_serial_debug_data (__FILE__, __FUNCTION__, urb->actual_length, data);
+		usb_serial_debug_data(debug, &port->dev, __FUNCTION__, urb->actual_length, data);
 	} else {
                 dbg("Status only: %03oo %03oo",data[0],data[1]);
         }
@@ -2000,6 +2014,7 @@ static int ftdi_tiocmset(struct usb_serial_port *port, struct file * file, unsig
 {
 	int ret;
 	
+	dbg("%s TIOCMSET", __FUNCTION__);
 	if (set & TIOCM_DTR){
 		if ((ret = set_dtr(port, HIGH)) < 0) {
 			err("Urb to set DTR failed");
@@ -2042,7 +2057,7 @@ static int ftdi_ioctl (struct usb_serial_port *port, struct file * file, unsigne
 
 	case TIOCMBIS: /* turns on (Sets) the lines as specified by the mask */
 		dbg("%s TIOCMBIS", __FUNCTION__);
- 	        if (get_user(mask, (unsigned long *) arg))
+ 	        if (get_user(mask, (unsigned long __user *) arg))
 			return -EFAULT;
   	        if (mask & TIOCM_DTR){
 			if ((ret = set_dtr(port, HIGH)) < 0) {
@@ -2061,7 +2076,7 @@ static int ftdi_ioctl (struct usb_serial_port *port, struct file * file, unsigne
 
 	case TIOCMBIC: /* turns off (Clears) the lines as specified by the mask */
 		dbg("%s TIOCMBIC", __FUNCTION__);
- 	        if (get_user(mask, (unsigned long *) arg))
+ 	        if (get_user(mask, (unsigned long __user *) arg))
 			return -EFAULT;
   	        if (mask & TIOCM_DTR){
 			if ((ret = set_dtr(port, LOW)) < 0){
@@ -2088,10 +2103,10 @@ static int ftdi_ioctl (struct usb_serial_port *port, struct file * file, unsigne
 		 */
 
 	case TIOCGSERIAL: /* gets serial port data */
-		return get_serial_info(port, (struct serial_struct *) arg);
+		return get_serial_info(port, (struct serial_struct __user *) arg);
 
 	case TIOCSSERIAL: /* sets serial port data */
-		return set_serial_info(port, (struct serial_struct *) arg);
+		return set_serial_info(port, (struct serial_struct __user *) arg);
 
 	/*
 	 * Wait for any of the 4 modem inputs (DCD,RI,DSR,CTS) to change
@@ -2240,6 +2255,6 @@ MODULE_AUTHOR( DRIVER_AUTHOR );
 MODULE_DESCRIPTION( DRIVER_DESC );
 MODULE_LICENSE("GPL");
 
-MODULE_PARM(debug, "i");
+module_param(debug, bool, S_IRUGO | S_IWUSR);
 MODULE_PARM_DESC(debug, "Debug enabled or not");
 
diff --git a/drivers/usb/serial/ftdi_sio.h b/drivers/usb/serial/ftdi_sio.h
index 6d50472bd..02554035e 100644
--- a/drivers/usb/serial/ftdi_sio.h
+++ b/drivers/usb/serial/ftdi_sio.h
@@ -61,6 +61,12 @@
 #define FTDI_MTXORB_5_PID      0xFA05  /* Matrix Orbital Product Id */
 #define FTDI_MTXORB_6_PID      0xFA06  /* Matrix Orbital Product Id */
 
+/* Interbiometrics USB I/O Board */
+/* Developed for Interbiometrics by Rudolf Gugler */
+#define INTERBIOMETRICS_VID              0x1209
+#define INTERBIOMETRICS_IOBOARD_PID      0x1002
+#define INTERBIOMETRICS_MINI_IOBOARD_PID 0x1006
+
 /*
  * The following are the values for the Perle Systems
  * UltraPort USB serial converters
@@ -149,6 +155,7 @@
  */
 #define OCT_VID			0x0B39	/* OCT vendor ID */
 /* Note: OCT US101 is also rebadged as Dick Smith Electronics (NZ) XH6381 */
+/* Also rebadged as SIIG Inc. model US2308 */
 #define OCT_US101_PID		0x0421	/* OCT US101 USB to RS-232 */
 
 /* an infrared receiver for user access control with IR tags */
@@ -190,7 +197,7 @@
 #define LINX_FUTURE_0_PID   0xF44A   /* Linx future device */
 #define LINX_FUTURE_1_PID   0xF44B   /* Linx future device */
 #define LINX_FUTURE_2_PID   0xF44C   /* Linx future device */
-#define FTDI_GUDEADS_889_PID    0xe889  /* USB RS323 OptoBridge */ 
+
 /* CCS Inc. ICDU/ICDU40 product ID - the FT232BM is used in an in-circuit-debugger */
 /* unit for PIC16's/PIC18's */
 #define FTDI_CCSICDU20_0_PID    0xF9D0     
@@ -199,6 +206,24 @@
 /* Inside Accesso contactless reader (http://www.insidefr.com) */
 #define INSIDE_ACCESSO		0xFAD0
 
+/*
+ * Intrepid Control Systems (http://www.intrepidcs.com/) ValueCAN and NeoVI
+ */
+#define INTREPID_VID		0x093C
+#define INTREPID_VALUECAN_PID	0x0601
+#define INTREPID_NEOVI_PID	0x0701
+
+/*
+ * Falcom Wireless Communications GmbH
+ */
+#define FALCOM_VID		0x0F94	/* Vendor Id */
+#define FALCOM_TWIST_PID	0x0001	/* Falcom Twist USB GPRS modem */
+
+/*
+ * SUUNTO product ids
+ */
+#define FTDI_SUUNTO_SPORTS_PID	0xF680	/* Suunto Sports instrument */
+
 /* Commands */
 #define FTDI_SIO_RESET 		0 /* Reset the port */
 #define FTDI_SIO_MODEM_CTRL 	1 /* Set the modem control register */
diff --git a/drivers/usb/serial/generic.c b/drivers/usb/serial/generic.c
index 37a53a16e..196fea084 100644
--- a/drivers/usb/serial/generic.c
+++ b/drivers/usb/serial/generic.c
@@ -19,16 +19,10 @@
 #include <linux/moduleparam.h>
 #include <linux/usb.h>
 #include <asm/uaccess.h>
-
-#ifdef CONFIG_USB_SERIAL_DEBUG
-	static int debug = 1;
-#else
-	static int debug;
-#endif
-
 #include "usb-serial.h"
 
-	
+static int debug;
+
 #ifdef CONFIG_USB_SERIAL_GENERIC
 static __u16 vendor  = 0x05f9;
 static __u16 product = 0xffff;
@@ -53,6 +47,32 @@ struct usb_serial_device_type usb_serial_generic_device = {
 	.num_ports =		1,
 	.shutdown =		usb_serial_generic_shutdown,
 };
+
+/* we want to look at all devices, as the vendor/product id can change
+ * depending on the command line argument */
+static struct usb_device_id generic_serial_ids[] = {
+	{.driver_info = 42},
+	{}
+};
+
+static int generic_probe(struct usb_interface *interface,
+			       const struct usb_device_id *id)
+{
+	const struct usb_device_id *id_pattern;
+
+	id_pattern = usb_match_id(interface, generic_device_ids);
+	if (id_pattern != NULL)
+		return usb_serial_probe(interface, id);
+	return -ENODEV;
+}
+
+static struct usb_driver generic_driver = {
+	.owner =	THIS_MODULE,
+	.name =		"usbserial_generic",
+	.probe =	generic_probe,
+	.disconnect =	usb_serial_disconnect,
+	.id_table =	generic_serial_ids,
+};
 #endif
 
 int usb_serial_generic_register (int _debug)
@@ -67,6 +87,12 @@ int usb_serial_generic_register (int _debug)
 
 	/* register our generic driver with ourselves */
 	retval = usb_serial_register (&usb_serial_generic_device);
+	if (retval)
+		goto exit;
+	retval = usb_register(&generic_driver);
+	if (retval)
+		usb_serial_deregister(&usb_serial_generic_device);
+exit:
 #endif
 	return retval;
 }
@@ -75,6 +101,7 @@ void usb_serial_generic_deregister (void)
 {
 #ifdef CONFIG_USB_SERIAL_GENERIC
 	/* remove our generic driver */
+	usb_deregister(&generic_driver);
 	usb_serial_deregister (&usb_serial_generic_device);
 #endif
 }
@@ -136,6 +163,7 @@ int usb_serial_generic_write (struct usb_serial_port *port, int from_user, const
 {
 	struct usb_serial *serial = port->serial;
 	int result;
+	unsigned char *data;
 
 	dbg("%s - port %d", __FUNCTION__, port->number);
 
@@ -160,8 +188,8 @@ int usb_serial_generic_write (struct usb_serial_port *port, int from_user, const
 		else {
 			memcpy (port->write_urb->transfer_buffer, buf, count);
 		}
-
-		usb_serial_debug_data (__FILE__, __FUNCTION__, count, port->write_urb->transfer_buffer);
+		data = port->write_urb->transfer_buffer;
+		usb_serial_debug_data(debug, &port->dev, __FUNCTION__, count, data);
 
 		/* set up our urb */
 		usb_fill_bulk_urb (port->write_urb, serial->dev,
@@ -234,7 +262,7 @@ void usb_serial_generic_read_bulk_callback (struct urb *urb, struct pt_regs *reg
 		return;
 	}
 
-	usb_serial_debug_data (__FILE__, __FUNCTION__, urb->actual_length, data);
+	usb_serial_debug_data(debug, &port->dev, __FUNCTION__, urb->actual_length, data);
 
 	tty = port->tty;
 	if (tty && urb->actual_length) {
diff --git a/drivers/usb/serial/io_edgeport.c b/drivers/usb/serial/io_edgeport.c
index 5b2249bc9..e727628bd 100644
--- a/drivers/usb/serial/io_edgeport.c
+++ b/drivers/usb/serial/io_edgeport.c
@@ -259,15 +259,7 @@
 #include <linux/ioctl.h>
 #include <asm/uaccess.h>
 #include <linux/usb.h>
-
-#ifdef CONFIG_USB_SERIAL_DEBUG
-	static int debug = 1;
-#else
-	static int debug;
-#endif
-
 #include "usb-serial.h"
-
 #include "io_edgeport.h"
 #include "io_ionsp.h"		/* info for the iosp messages */
 #include "io_16654.h"		/* 16654 UART defines */
@@ -299,19 +291,13 @@
 #define IMAGE_VERSION_NAME	OperationalCodeImageVersion_GEN2
 #include "io_fw_down2.h"	/* Define array OperationalCodeImage[] */
 
-
 #define MAX_NAME_LEN		64
 
-
 #define CHASE_TIMEOUT		(5*HZ)		/* 5 seconds */
 #define OPEN_TIMEOUT		(5*HZ)		/* 5 seconds */
 #define COMMAND_TIMEOUT		(5*HZ)		/* 5 seconds */
 
-#ifndef SERIAL_MAGIC
-	#define SERIAL_MAGIC	0x6702
-#endif
-#define PORT_MAGIC		0x7301
-
+static int debug;
 
 /* receive port state */
 enum RXSTATE {
@@ -793,7 +779,7 @@ static void edge_interrupt_callback (struct urb *urb, struct pt_regs *regs)
 
 	// process this interrupt-read even if there are no ports open
 	if (length) {
-		usb_serial_debug_data (__FILE__, __FUNCTION__, length, data);
+		usb_serial_debug_data(debug, &edge_serial->serial->dev->dev, __FUNCTION__, length, data);
 
 		if (length > 1) {
 			bytes_avail = data[0] | (data[1] << 8);
@@ -869,7 +855,7 @@ static void edge_bulk_in_callback (struct urb *urb, struct pt_regs *regs)
 	if (urb->actual_length) {
 		raw_data_length = urb->actual_length;
 
-		usb_serial_debug_data (__FILE__, __FUNCTION__, raw_data_length, data);
+		usb_serial_debug_data(debug, &edge_serial->serial->dev->dev, __FUNCTION__, raw_data_length, data);
 
 		/* decrement our rxBytes available by the number that we just got */
 		edge_serial->rxBytesAvail -= raw_data_length;
@@ -1327,7 +1313,7 @@ static int edge_write (struct usb_serial_port *port, int from_user, const unsign
 	} else {
 		memcpy(&fifo->fifo[fifo->head], data, firsthalf);
 	}  
-	usb_serial_debug_data (__FILE__, __FUNCTION__, firsthalf, &fifo->fifo[fifo->head]);
+	usb_serial_debug_data(debug, &port->dev, __FUNCTION__, firsthalf, &fifo->fifo[fifo->head]);
 
 	// update the index and size
 	fifo->head  += firsthalf;
@@ -1348,7 +1334,7 @@ static int edge_write (struct usb_serial_port *port, int from_user, const unsign
 		} else {
 			memcpy(&fifo->fifo[fifo->head], &data[firsthalf], secondhalf);
 		}
-		usb_serial_debug_data (__FILE__, __FUNCTION__, secondhalf, &fifo->fifo[fifo->head]);
+		usb_serial_debug_data(debug, &port->dev, __FUNCTION__, secondhalf, &fifo->fifo[fifo->head]);
 		// update the index and size
 		fifo->count += secondhalf;
 		fifo->head  += secondhalf;
@@ -1424,7 +1410,7 @@ static void send_more_port_data(struct edgeport_serial *edge_serial, struct edge
 	count = fifo->count;
 	buffer = kmalloc (count+2, GFP_ATOMIC);
 	if (buffer == NULL) {
-		dev_err(&edge_serial->serial->dev->dev, "%s - no more kernel memory...\n", __FUNCTION__);
+		dev_err(&edge_port->port->dev, "%s - no more kernel memory...\n", __FUNCTION__);
 		edge_port->write_in_progress = FALSE;
 		return;
 	}
@@ -1448,9 +1434,8 @@ static void send_more_port_data(struct edgeport_serial *edge_serial, struct edge
 		fifo->count -= secondhalf;
 	}
 
-	if (count) {
-		usb_serial_debug_data (__FILE__, __FUNCTION__, count, &buffer[2]);
-	}
+	if (count)
+		usb_serial_debug_data(debug, &edge_port->port->dev, __FUNCTION__, count, &buffer[2]);
 
 	/* fill up the urb with all of our data and submit it */
 	usb_fill_bulk_urb (urb, edge_serial->serial->dev, 
@@ -1705,7 +1690,7 @@ static void edge_set_termios (struct usb_serial_port *port, struct termios *old_
  * 	    transmit holding register is empty.  This functionality
  * 	    allows an RS485 driver to be written in user space. 
  *****************************************************************************/
-static int get_lsr_info(struct edgeport_port *edge_port, unsigned int *value)
+static int get_lsr_info(struct edgeport_port *edge_port, unsigned int __user *value)
 {
 	unsigned int result = 0;
 
@@ -1720,7 +1705,7 @@ static int get_lsr_info(struct edgeport_port *edge_port, unsigned int *value)
 	return 0;
 }
 
-static int get_number_bytes_avail(struct edgeport_port *edge_port, unsigned int *value)
+static int get_number_bytes_avail(struct edgeport_port *edge_port, unsigned int __user *value)
 {
 	unsigned int result = 0;
 	struct tty_struct *tty = edge_port->port->tty;
@@ -1790,7 +1775,7 @@ static int edge_tiocmget(struct usb_serial_port *port, struct file *file)
 	return result;
 }
 
-static int get_serial_info(struct edgeport_port *edge_port, struct serial_struct * retinfo)
+static int get_serial_info(struct edgeport_port *edge_port, struct serial_struct __user *retinfo)
 {
 	struct serial_struct tmp;
 
@@ -1812,7 +1797,6 @@ static int get_serial_info(struct edgeport_port *edge_port, struct serial_struct
 //	tmp.hub6		= state->hub6;
 //	tmp.io_type		= state->io_type;
 
-
 	if (copy_to_user(retinfo, &tmp, sizeof(*retinfo)))
 		return -EFAULT;
 	return 0;
@@ -1838,17 +1822,17 @@ static int edge_ioctl (struct usb_serial_port *port, struct file *file, unsigned
 		// return number of bytes available
 		case TIOCINQ:
 			dbg("%s (%d) TIOCINQ", __FUNCTION__,  port->number);
-			return get_number_bytes_avail(edge_port, (unsigned int *) arg);
+			return get_number_bytes_avail(edge_port, (unsigned int __user *) arg);
 			break;
 
 		case TIOCSERGETLSR:
 			dbg("%s (%d) TIOCSERGETLSR", __FUNCTION__,  port->number);
-			return get_lsr_info(edge_port, (unsigned int *) arg);
+			return get_lsr_info(edge_port, (unsigned int __user *) arg);
 			return 0;
 
 		case TIOCGSERIAL:
 			dbg("%s (%d) TIOCGSERIAL", __FUNCTION__,  port->number);
-			return get_serial_info(edge_port, (struct serial_struct *) arg);
+			return get_serial_info(edge_port, (struct serial_struct __user *) arg);
 
 		case TIOCSSERIAL:
 			dbg("%s (%d) TIOCSSERIAL", __FUNCTION__,  port->number);
@@ -1893,7 +1877,7 @@ static int edge_ioctl (struct usb_serial_port *port, struct file *file, unsigned
 			icount.buf_overrun = cnow.buf_overrun;
 
 			dbg("%s (%d) TIOCGICOUNT RX=%d, TX=%d", __FUNCTION__,  port->number, icount.rx, icount.tx );
-			if (copy_to_user((void *)arg, &icount, sizeof(icount)))
+			if (copy_to_user((void __user *)arg, &icount, sizeof(icount)))
 				return -EFAULT;
 			return 0;
 	}
@@ -2444,7 +2428,7 @@ static int write_cmd_usb (struct edgeport_port *edge_port, unsigned char *buffer
 	struct urb *urb;
 	int timeout;
 
-	usb_serial_debug_data (__FILE__, __FUNCTION__, length, buffer);
+	usb_serial_debug_data(debug, &edge_port->port->dev, __FUNCTION__, length, buffer);
 
 	/* Allocate our next urb */
 	urb = usb_alloc_urb (0, GFP_ATOMIC);
@@ -3075,6 +3059,5 @@ MODULE_AUTHOR( DRIVER_AUTHOR );
 MODULE_DESCRIPTION( DRIVER_DESC );
 MODULE_LICENSE("GPL");
 
-MODULE_PARM(debug, "i");
+module_param(debug, bool, S_IRUGO | S_IWUSR);
 MODULE_PARM_DESC(debug, "Debug enabled or not");
-
diff --git a/drivers/usb/serial/io_ti.c b/drivers/usb/serial/io_ti.c
index 853cf1700..6b821b6ed 100644
--- a/drivers/usb/serial/io_ti.c
+++ b/drivers/usb/serial/io_ti.c
@@ -35,19 +35,13 @@
 #include <linux/ioctl.h>
 #include <asm/uaccess.h>
 #include <linux/usb.h>
-
-#ifdef CONFIG_USB_SERIAL_DEBUG
-	static int debug = 1;
-#else
-	static int debug;
-#endif
-
 #include "usb-serial.h"
-
 #include "io_16654.h"
 #include "io_usbvend.h"
 #include "io_ti.h"
 
+static int debug;
+
 /*
  * Version Information
  */
@@ -315,8 +309,8 @@ static int TIReadDownloadMemory(struct usb_device *dev, int start_address,
 		}
 
 		if (read_length > 1) {
-			usb_serial_debug_data (__FILE__, __FUNCTION__,
-					       read_length, buffer);
+			usb_serial_debug_data(debug, &dev->dev, __FUNCTION__,
+					      read_length, buffer);
 		}
 
 		/* Update pointers/length */
@@ -357,7 +351,7 @@ static int TIReadBootMemory (struct edgeport_serial *serial, int start_address,
 	}
 
 	dbg ("%s - start_address = %x, length = %d", __FUNCTION__, start_address, length);
-	usb_serial_debug_data (__FILE__, __FUNCTION__, length, buffer);
+	usb_serial_debug_data(debug, &serial->serial->dev->dev, __FUNCTION__, length, buffer);
 
 	serial->TiReadI2C = 1;
 
@@ -390,7 +384,7 @@ static int TIWriteBootMemory (struct edgeport_serial *serial, int start_address,
 	}
 
   	dbg ("%s - start_sddr = %x, length = %d", __FUNCTION__, start_address, length);
-	usb_serial_debug_data (__FILE__, __FUNCTION__, length, buffer);
+	usb_serial_debug_data(debug, &serial->serial->dev->dev, __FUNCTION__, length, buffer);
 
 	return status;
 }
@@ -412,7 +406,7 @@ static int TIWriteDownloadI2C (struct edgeport_serial *serial, int start_address
 		write_length = length;
 
 	dbg ("%s - BytesInFirstPage Addr = %x, length = %d", __FUNCTION__, start_address, write_length);
-	usb_serial_debug_data (__FILE__, __FUNCTION__, write_length, buffer);
+	usb_serial_debug_data(debug, &serial->serial->dev->dev, __FUNCTION__, write_length, buffer);
 
 	/* Write first page */
 	be_start_address = cpu_to_be16 (start_address);
@@ -439,7 +433,7 @@ static int TIWriteDownloadI2C (struct edgeport_serial *serial, int start_address
 			write_length = length;
 
 		dbg ("%s - Page Write Addr = %x, length = %d", __FUNCTION__, start_address, write_length);
-		usb_serial_debug_data (__FILE__, __FUNCTION__, write_length, buffer);
+		usb_serial_debug_data(debug, &serial->serial->dev->dev, __FUNCTION__, write_length, buffer);
 
 		/* Write next page */
 		be_start_address = cpu_to_be16 (start_address);
@@ -1669,7 +1663,7 @@ static void edge_interrupt_callback (struct urb *urb, struct pt_regs *regs)
 		goto exit;
 	}
 		
-	usb_serial_debug_data (__FILE__, __FUNCTION__, length, data);
+	usb_serial_debug_data(debug, &edge_serial->serial->dev->dev, __FUNCTION__, length, data);
 		
 	if (length != 2) {
 		dbg ("%s - expecting packet of size 2, got %d", __FUNCTION__, length);
@@ -1761,7 +1755,7 @@ static void edge_bulk_in_callback (struct urb *urb, struct pt_regs *regs)
 
 	tty = edge_port->port->tty;
 	if (tty && urb->actual_length) {
-		usb_serial_debug_data (__FILE__, __FUNCTION__, urb->actual_length, data);
+		usb_serial_debug_data(debug, &edge_port->port->dev, __FUNCTION__, urb->actual_length, data);
 
 		if (edge_port->close_pending) {
 			dbg ("%s - close is pending, dropping data on the floor.", __FUNCTION__);
@@ -2045,7 +2039,7 @@ static int edge_write (struct usb_serial_port *port, int from_user, const unsign
 		memcpy (port->write_urb->transfer_buffer, data, count);
 	}
 
-	usb_serial_debug_data (__FILE__, __FUNCTION__, count, port->write_urb->transfer_buffer);
+	usb_serial_debug_data(debug, &port->dev, __FUNCTION__, count, port->write_urb->transfer_buffer);
 
 	/* set up our urb */
 	usb_fill_bulk_urb (port->write_urb, port->serial->dev,
@@ -2428,7 +2422,7 @@ static int edge_tiocmget(struct usb_serial_port *port, struct file *file)
 	return result;
 }
 
-static int get_serial_info (struct edgeport_port *edge_port, struct serial_struct * retinfo)
+static int get_serial_info (struct edgeport_port *edge_port, struct serial_struct __user *retinfo)
 {
 	struct serial_struct tmp;
 
@@ -2477,7 +2471,7 @@ static int edge_ioctl (struct usb_serial_port *port, struct file *file, unsigned
 
 		case TIOCGSERIAL:
 			dbg("%s - (%d) TIOCGSERIAL", __FUNCTION__, port->number);
-			return get_serial_info(edge_port, (struct serial_struct *) arg);
+			return get_serial_info(edge_port, (struct serial_struct __user *) arg);
 			break;
 
 		case TIOCSSERIAL:
@@ -2510,7 +2504,7 @@ static int edge_ioctl (struct usb_serial_port *port, struct file *file, unsigned
 		case TIOCGICOUNT:
 			dbg ("%s - (%d) TIOCGICOUNT RX=%d, TX=%d", __FUNCTION__,
 			     port->number, edge_port->icount.rx, edge_port->icount.tx);
-			if (copy_to_user((void *)arg, &edge_port->icount, sizeof(edge_port->icount)))
+			if (copy_to_user((void __user *)arg, &edge_port->icount, sizeof(edge_port->icount)))
 				return -EFAULT;
 			return 0;
 	}
@@ -2684,9 +2678,9 @@ MODULE_AUTHOR(DRIVER_AUTHOR);
 MODULE_DESCRIPTION(DRIVER_DESC);
 MODULE_LICENSE("GPL");
 
-MODULE_PARM(debug, "i");
+module_param(debug, bool, S_IRUGO | S_IWUSR);
 MODULE_PARM_DESC(debug, "Debug enabled or not");
 
-MODULE_PARM(ignore_cpu_rev, "i");
+module_param(ignore_cpu_rev, bool, S_IRUGO | S_IWUSR);
 MODULE_PARM_DESC(ignore_cpu_rev, "Ignore the cpu revision when connecting to a device");
 
diff --git a/drivers/usb/serial/ipaq.c b/drivers/usb/serial/ipaq.c
index 0b7677283..42119dd44 100644
--- a/drivers/usb/serial/ipaq.c
+++ b/drivers/usb/serial/ipaq.c
@@ -56,13 +56,6 @@
 #include <linux/spinlock.h>
 #include <asm/uaccess.h>
 #include <linux/usb.h>
-
-#ifdef CONFIG_USB_SERIAL_DEBUG
-	static int debug = 1;
-#else
-	static int debug = 0;
-#endif
-
 #include "usb-serial.h"
 #include "ipaq.h"
 
@@ -76,7 +69,8 @@
 #define DRIVER_AUTHOR "Ganesh Varadarajan <ganesh@veritas.com>"
 #define DRIVER_DESC "USB PocketPC PDA driver"
 
-static int	product, vendor;
+static __u16 product, vendor;
+static int debug;
 
 /* Function prototypes for an ipaq */
 static int  ipaq_open (struct usb_serial_port *port, struct file *filp);
@@ -135,6 +129,7 @@ static struct usb_device_id ipaq_id_table [] = {
 	{ USB_DEVICE(HTC_VENDOR_ID, HTC_PRODUCT_ID) },
 	{ USB_DEVICE(NEC_VENDOR_ID, NEC_PRODUCT_ID) },
 	{ USB_DEVICE(ASUS_VENDOR_ID, ASUS_A600_PRODUCT_ID) },
+	{ USB_DEVICE(ASUS_VENDOR_ID, ASUS_A620_PRODUCT_ID) },
 	{ }					/* Terminating entry */
 };
 
@@ -315,7 +310,7 @@ static void ipaq_read_bulk_callback(struct urb *urb, struct pt_regs *regs)
 		return;
 	}
 
-	usb_serial_debug_data (__FILE__, __FUNCTION__, urb->actual_length, data);
+	usb_serial_debug_data(debug, &port->dev, __FUNCTION__, urb->actual_length, data);
 
 	tty = port->tty;
 	if (tty && urb->actual_length) {
@@ -396,7 +391,7 @@ static int ipaq_write_bulk(struct usb_serial_port *port, int from_user, const un
 	} else {
 		memcpy(pkt->data, buf, count);
 	}
-	usb_serial_debug_data(__FILE__, __FUNCTION__, count, pkt->data);
+	usb_serial_debug_data(debug, &port->dev, __FUNCTION__, count, pkt->data);
 
 	pkt->len = count;
 	pkt->written = 0;
@@ -579,11 +574,11 @@ MODULE_AUTHOR( DRIVER_AUTHOR );
 MODULE_DESCRIPTION( DRIVER_DESC );
 MODULE_LICENSE("GPL");
 
-MODULE_PARM(debug, "i");
+module_param(debug, bool, S_IRUGO | S_IWUSR);
 MODULE_PARM_DESC(debug, "Debug enabled or not");
 
-MODULE_PARM(vendor, "h");
+module_param(vendor, ushort, 0);
 MODULE_PARM_DESC(vendor, "User specified USB idVendor");
 
-MODULE_PARM(product, "h");
+module_param(product, ushort, 0);
 MODULE_PARM_DESC(product, "User specified USB idProduct");
diff --git a/drivers/usb/serial/ipaq.h b/drivers/usb/serial/ipaq.h
index c1b33d47a..e9bedde0d 100644
--- a/drivers/usb/serial/ipaq.h
+++ b/drivers/usb/serial/ipaq.h
@@ -85,6 +85,9 @@
 #define ASUS_VENDOR_ID		0x0b05
 #define ASUS_A600_PRODUCT_ID	0x4201
 
+#define ASUS_VENDOR_ID		0x0b05
+#define ASUS_A620_PRODUCT_ID	0x4202
+
 /*
  * Since we can't queue our bulk write urbs (don't know why - it just
  * doesn't work), we can send down only one write urb at a time. The simplistic
diff --git a/drivers/usb/serial/ir-usb.c b/drivers/usb/serial/ir-usb.c
index 0adcbb1f8..cb42cc7c3 100644
--- a/drivers/usb/serial/ir-usb.c
+++ b/drivers/usb/serial/ir-usb.c
@@ -58,13 +58,6 @@
 #include <linux/spinlock.h>
 #include <asm/uaccess.h>
 #include <linux/usb.h>
-
-#ifdef CONFIG_USB_SERIAL_DEBUG
-	static int debug = 1;
-#else
-	static int debug;
-#endif
-
 #include "usb-serial.h"
 
 /*
@@ -101,9 +94,11 @@ struct irda_class_desc {
 	u8	bMaxUnicastList;
 } __attribute__ ((packed));
 
+static int debug;
+
 /* if overridden by the user, then use their value for the size of the read and
  * write urbs */
-static int buffer_size = 0;
+static int buffer_size;
 /* if overridden by the user, then use the specified number of XBOFs */
 static int xbof = -1;
 
@@ -404,7 +399,8 @@ static void ir_write_bulk_callback (struct urb *urb, struct pt_regs *regs)
 	}
 
 	usb_serial_debug_data (
-		__FILE__,
+		debug,
+		&port->dev,
 		__FUNCTION__,
 		urb->actual_length,
 		urb->transfer_buffer);
@@ -439,7 +435,8 @@ static void ir_read_bulk_callback (struct urb *urb, struct pt_regs *regs)
 				ir_baud = *data & 0x0f;
 
 			usb_serial_debug_data (
-				__FILE__,
+				debug,
+				&port->dev,
 				__FUNCTION__,
 				urb->actual_length,
 				data);
@@ -614,10 +611,10 @@ MODULE_AUTHOR(DRIVER_AUTHOR);
 MODULE_DESCRIPTION(DRIVER_DESC);
 MODULE_LICENSE("GPL");
 
-MODULE_PARM(debug, "i");
+module_param(debug, bool, S_IRUGO | S_IWUSR);
 MODULE_PARM_DESC(debug, "Debug enabled or not");
-MODULE_PARM(xbof, "i");
+module_param(xbof, int, 0);
 MODULE_PARM_DESC(xbof, "Force specific number of XBOFs");
-MODULE_PARM(buffer_size, "i");
+module_param(buffer_size, int, 0);
 MODULE_PARM_DESC(buffer_size, "Size of the transfer buffers");
 
diff --git a/drivers/usb/serial/keyspan.c b/drivers/usb/serial/keyspan.c
index 2f2abaeec..7b4f98407 100644
--- a/drivers/usb/serial/keyspan.c
+++ b/drivers/usb/serial/keyspan.c
@@ -107,20 +107,12 @@
 #include <linux/module.h>
 #include <linux/spinlock.h>
 #include <asm/uaccess.h>
-
-#ifdef CONFIG_USB_SERIAL_DEBUG
-	static int debug = 1;
-	#define DEBUG
-#else
-	static int debug;
-	#undef DEBUG
-#endif
-
 #include <linux/usb.h>
-
 #include "usb-serial.h"
 #include "keyspan.h"
 
+static int debug;
+
 /*
  * Version Information
  */
@@ -1175,7 +1167,7 @@ static void keyspan_close(struct usb_serial_port *port, struct file *filp)
 			stop_urb(p_priv->out_urbs[i]);
 		}
 	}
-	port->tty = 0;
+	port->tty = NULL;
 }
 
 
@@ -2362,6 +2354,6 @@ MODULE_AUTHOR( DRIVER_AUTHOR );
 MODULE_DESCRIPTION( DRIVER_DESC );
 MODULE_LICENSE("GPL");
 
-MODULE_PARM(debug, "i");
+module_param(debug, bool, S_IRUGO | S_IWUSR);
 MODULE_PARM_DESC(debug, "Debug enabled or not");
 
diff --git a/drivers/usb/serial/keyspan_pda.c b/drivers/usb/serial/keyspan_pda.c
index 5a349aee9..fd6c1b838 100644
--- a/drivers/usb/serial/keyspan_pda.c
+++ b/drivers/usb/serial/keyspan_pda.c
@@ -80,12 +80,7 @@
 #include <asm/uaccess.h>
 #include <linux/usb.h>
 
-#ifdef CONFIG_USB_SERIAL_DEBUG
-	static int debug = 1;
-#else
-	static int debug;
-#endif
-
+static int debug;
 
 struct ezusb_hex_record {
 	__u16 address;
@@ -781,7 +776,7 @@ static int keyspan_pda_startup (struct usb_serial *serial)
 	usb_set_serial_port_data(serial->port[0], priv);
 	init_waitqueue_head(&serial->port[0]->write_wait);
 	INIT_WORK(&priv->wakeup_work, (void *)keyspan_pda_wakeup_write,
-			(void *)(&serial->port[0]));
+			(void *)(serial->port[0]));
 	INIT_WORK(&priv->unthrottle_work,
 			(void *)keyspan_pda_request_unthrottle,
 			(void *)(serial));
@@ -909,6 +904,6 @@ MODULE_AUTHOR( DRIVER_AUTHOR );
 MODULE_DESCRIPTION( DRIVER_DESC );
 MODULE_LICENSE("GPL");
 
-MODULE_PARM(debug, "i");
+module_param(debug, bool, S_IRUGO | S_IWUSR);
 MODULE_PARM_DESC(debug, "Debug enabled or not");
 
diff --git a/drivers/usb/serial/kl5kusb105.c b/drivers/usb/serial/kl5kusb105.c
index c9b5af2b8..c5207d194 100644
--- a/drivers/usb/serial/kl5kusb105.c
+++ b/drivers/usb/serial/kl5kusb105.c
@@ -56,16 +56,10 @@
 #include <linux/module.h>
 #include <asm/uaccess.h>
 #include <linux/usb.h>
-
-#ifdef CONFIG_USB_SERIAL_DEBUG
- 	static int debug = 1;
-#else
- 	static int debug;
-#endif
-
 #include "usb-serial.h"
 #include "kl5kusb105.h"
 
+static int debug;
 
 /*
  * Version Information
@@ -659,7 +653,8 @@ static void klsi_105_read_bulk_callback (struct urb *urb, struct pt_regs *regs)
 	} else if (urb->actual_length <= 2) {
 		dbg("%s - size %d URB not understood", __FUNCTION__,
 		    urb->actual_length);
-		usb_serial_debug_data (__FILE__, __FUNCTION__, urb->actual_length, data);
+		usb_serial_debug_data(debug, &port->dev, __FUNCTION__,
+				      urb->actual_length, data);
 	} else {
 		int i;
 		int bytes_sent = ((__u8 *) data)[0] +
@@ -671,8 +666,8 @@ static void klsi_105_read_bulk_callback (struct urb *urb, struct pt_regs *regs)
 		 * intermixed tty_flip_buffer_push()s
 		 * FIXME
 		 */ 
-		usb_serial_debug_data (__FILE__, __FUNCTION__,
-				       urb->actual_length, data);
+		usb_serial_debug_data(debug, &port->dev, __FUNCTION__,
+				      urb->actual_length, data);
 
 		if (bytes_sent + 2 > urb->actual_length) {
 			dbg("%s - trying to read more data than available"
@@ -926,6 +921,7 @@ static int klsi_105_ioctl (struct usb_serial_port *port, struct file * file,
 			   unsigned int cmd, unsigned long arg)
 {
 	struct klsi_105_private *priv = usb_get_serial_port_data(port);
+	void __user *user_arg = (void __user *)arg;
 	
 	dbg("%scmd=0x%x", __FUNCTION__, cmd);
 
@@ -948,13 +944,12 @@ static int klsi_105_ioctl (struct usb_serial_port *port, struct file * file,
 
 	     dbg("%s - TCGETS data faked/incomplete", __FUNCTION__);
 
-	     retval = verify_area(VERIFY_WRITE, (void *)arg,
+	     retval = verify_area(VERIFY_WRITE, user_arg,
 				  sizeof(struct termios));
-
 	     if (retval)
-			 return(retval);
+			 return retval;
 
-	     if (kernel_termios_to_user_termios((struct termios *)arg,  
+	     if (kernel_termios_to_user_termios((struct termios __user *)arg,
 						&priv->termios))
 		     return -EFAULT;
 	     return(0);
@@ -965,14 +960,13 @@ static int klsi_105_ioctl (struct usb_serial_port *port, struct file * file,
 
 		dbg("%s - TCSETS not handled", __FUNCTION__);
 
-		retval = verify_area(VERIFY_READ, (void *)arg,
+		retval = verify_area(VERIFY_READ, user_arg,
 				     sizeof(struct termios));
-
 		if (retval)
-			    return(retval);
+			    return retval;
 
 		if (user_termios_to_kernel_termios(&priv->termios,
-						  (struct termios *)arg))
+						  (struct termios __user *)arg))
 			return -EFAULT;
 		klsi_105_set_termios(port, &priv->termios);
 		return(0);
@@ -1052,11 +1046,7 @@ MODULE_DESCRIPTION( DRIVER_DESC );
 MODULE_LICENSE("GPL"); 
 
 
-MODULE_PARM(debug, "i");
+module_param(debug, bool, S_IRUGO | S_IWUSR);
 MODULE_PARM_DESC(debug, "enable extensive debugging messages");
-/* FIXME: implement
-MODULE_PARM(num_urbs, "i");
-MODULE_PARM_DESC(num_urbs, "number of URBs to use in write pool");
-*/
 
 /* vim: set sts=8 ts=8 sw=8: */
diff --git a/drivers/usb/serial/kobil_sct.c b/drivers/usb/serial/kobil_sct.c
index 79cb22e31..b479916ce 100644
--- a/drivers/usb/serial/kobil_sct.c
+++ b/drivers/usb/serial/kobil_sct.c
@@ -48,18 +48,10 @@
 #include <asm/uaccess.h>
 #include <linux/usb.h>
 #include <linux/ioctl.h>
-
-
+#include "usb-serial.h"
 #include "kobil_sct.h"
-//#include "../core/usb-debug.c"
 
-#ifdef CONFIG_USB_SERIAL_DEBUG
-	static int debug = 1;
-#else
-	static int debug;
-#endif
-
-#include "usb-serial.h"
+static int debug;
 
 /* Version Information */
 #define DRIVER_VERSION "21/05/2004"
@@ -361,7 +353,7 @@ static void kobil_close (struct usb_serial_port *port, struct file *filp)
 	if (port->write_urb){
 		usb_unlink_urb( port->write_urb );
 		usb_free_urb( port->write_urb );
-		port->write_urb = 0;
+		port->write_urb = NULL;
 	}
 	if (port->interrupt_in_urb){
 		usb_unlink_urb (port->interrupt_in_urb);
@@ -456,7 +448,7 @@ static int kobil_write (struct usb_serial_port *port, int from_user,
 		memcpy (priv->buf + priv->filled, buf, count);
 	}
 
-	usb_serial_debug_data (__FILE__, __FUNCTION__, count, priv->buf + priv->filled);
+	usb_serial_debug_data(debug, &port->dev, __FUNCTION__, count, priv->buf + priv->filled);
 
 	priv->filled = priv->filled + count;
 
@@ -643,6 +635,7 @@ static int  kobil_ioctl(struct usb_serial_port *port, struct file *file,
 	unsigned char *transfer_buffer;
 	int transfer_buffer_length = 8;
 	char *settings;
+	void __user *user_arg = (void __user *)arg;
 
 	priv = usb_get_serial_port_data(port);
 	if ((priv->device_type == KOBIL_USBTWIN_PRODUCT_ID) || (priv->device_type == KOBIL_KAAN_SIM_PRODUCT_ID)) {
@@ -652,12 +645,12 @@ static int  kobil_ioctl(struct usb_serial_port *port, struct file *file,
 
 	switch (cmd) {
 	case TCGETS:   // 0x5401
-		result = verify_area(VERIFY_WRITE, (void *)arg, sizeof(struct termios));
+		result = verify_area(VERIFY_WRITE, user_arg, sizeof(struct termios));
 		if (result) {
 			dbg("%s - port %d Error in verify_area", __FUNCTION__, port->number);
 			return(result);
 		}
-		if (kernel_termios_to_user_termios((struct termios *)arg,
+		if (kernel_termios_to_user_termios((struct termios __user *)arg,
 						   &priv->internal_termios))
 			return -EFAULT;
 		return 0;
@@ -667,13 +660,13 @@ static int  kobil_ioctl(struct usb_serial_port *port, struct file *file,
 			dbg("%s - port %d Error: port->tty->termios is NULL", __FUNCTION__, port->number);
 			return -ENOTTY;
 		}
-		result = verify_area(VERIFY_READ, (void *)arg, sizeof(struct termios));
+		result = verify_area(VERIFY_READ, user_arg, sizeof(struct termios));
 		if (result) {
 			dbg("%s - port %d Error in verify_area", __FUNCTION__, port->number);
 			return result;
 		}
 		if (user_termios_to_kernel_termios(&priv->internal_termios,
-						   (struct termios *)arg))
+						   (struct termios __user *)arg))
 			return -EFAULT;
 		
 		settings = (unsigned char *) kmalloc(50, GFP_KERNEL);  
@@ -787,5 +780,5 @@ MODULE_AUTHOR( DRIVER_AUTHOR );
 MODULE_DESCRIPTION( DRIVER_DESC );
 MODULE_LICENSE( "GPL" );
 
-MODULE_PARM(debug, "i");
+module_param(debug, bool, S_IRUGO | S_IWUSR);
 MODULE_PARM_DESC(debug, "Debug enabled or not");
diff --git a/drivers/usb/serial/mct_u232.c b/drivers/usb/serial/mct_u232.c
index b6f205341..b4961f0d2 100644
--- a/drivers/usb/serial/mct_u232.c
+++ b/drivers/usb/serial/mct_u232.c
@@ -76,17 +76,9 @@
 #include <linux/spinlock.h>
 #include <asm/uaccess.h>
 #include <linux/usb.h>
-
-#ifdef CONFIG_USB_SERIAL_DEBUG
- 	static int debug = 1;
-#else
- 	static int debug;
-#endif
-
 #include "usb-serial.h"
 #include "mct_u232.h"
 
-
 /*
  * Version Information
  */
@@ -105,6 +97,8 @@
 static int write_blocking; /* disabled by default */
 #endif
 
+static int debug;
+
 /*
  * Function prototypes
  */
@@ -523,7 +517,7 @@ static int mct_u232_write (struct usb_serial_port *port, int from_user,
 	while (count > 0) {
 		size = (count > port->bulk_out_size) ? port->bulk_out_size : count;
 		
-		usb_serial_debug_data (__FILE__, __FUNCTION__, size, buf);
+		usb_serial_debug_data(debug, &port->dev, __FUNCTION__, size, buf);
 		
 		if (from_user) {
 			if (copy_from_user(port->write_urb->transfer_buffer, buf, size)) {
@@ -631,7 +625,7 @@ static void mct_u232_read_int_callback (struct urb *urb, struct pt_regs *regs)
 		return;
 	}
 	
-	usb_serial_debug_data (__FILE__, __FUNCTION__, urb->actual_length, data);
+	usb_serial_debug_data(debug, &port->dev, __FUNCTION__, urb->actual_length, data);
 
 	/*
 	 * Work-a-round: handle the 'usual' bulk-in pipe here
@@ -912,11 +906,11 @@ MODULE_DESCRIPTION( DRIVER_DESC );
 MODULE_LICENSE("GPL");
 
 #ifdef FIX_WRITE_RETURN_CODE_PROBLEM
-MODULE_PARM(write_blocking, "i");
+module_param(write_blocking, int, 0);
 MODULE_PARM_DESC(write_blocking, 
 		 "The write function will block to write out all data");
 #endif
 
-MODULE_PARM(debug, "i");
+module_param(debug, bool, S_IRUGO | S_IWUSR);
 MODULE_PARM_DESC(debug, "Debug enabled or not");
 
diff --git a/drivers/usb/serial/omninet.c b/drivers/usb/serial/omninet.c
index 5c4602be7..371aa2e8e 100644
--- a/drivers/usb/serial/omninet.c
+++ b/drivers/usb/serial/omninet.c
@@ -47,15 +47,9 @@
 #include <linux/spinlock.h>
 #include <asm/uaccess.h>
 #include <linux/usb.h>
-
-#ifdef CONFIG_USB_SERIAL_DEBUG
-	static int debug = 1;
-#else
-	static int debug;
-#endif
-
 #include "usb-serial.h"
 
+static int debug;
 
 /*
  * Version Information
@@ -280,7 +274,7 @@ static int omninet_write (struct usb_serial_port *port, int from_user, const uns
 		memcpy (wport->write_urb->transfer_buffer + OMNINET_DATAOFFSET, buf, count);
 	}
 
-	usb_serial_debug_data (__FILE__, __FUNCTION__, count, wport->write_urb->transfer_buffer);
+	usb_serial_debug_data(debug, &port->dev, __FUNCTION__, count, wport->write_urb->transfer_buffer);
 
 	header->oh_seq 	= od->od_outseq++;
 	header->oh_len 	= count;
@@ -373,6 +367,5 @@ MODULE_AUTHOR( DRIVER_AUTHOR );
 MODULE_DESCRIPTION( DRIVER_DESC );
 MODULE_LICENSE("GPL");
 
-MODULE_PARM(debug, "i");
+module_param(debug, bool, S_IRUGO | S_IWUSR);
 MODULE_PARM_DESC(debug, "Debug enabled or not");
-
diff --git a/drivers/usb/serial/pl2303.c b/drivers/usb/serial/pl2303.c
index e274cec85..af0d230c6 100644
--- a/drivers/usb/serial/pl2303.c
+++ b/drivers/usb/serial/pl2303.c
@@ -49,23 +49,16 @@
 #include <linux/spinlock.h>
 #include <asm/uaccess.h>
 #include <linux/usb.h>
-
-#ifdef CONFIG_USB_SERIAL_DEBUG
-	static int debug = 1;
-#else
-	static int debug;
-#endif
-
 #include "usb-serial.h"
 #include "pl2303.h"
 
 /*
  * Version Information
  */
-#define DRIVER_VERSION "v0.10"
+#define DRIVER_VERSION "v0.11"
 #define DRIVER_DESC "Prolific PL2303 USB to serial adaptor driver"
 
-
+static int debug;
 
 static struct usb_device_id id_table [] = {
 	{ USB_DEVICE(PL2303_VENDOR_ID, PL2303_PRODUCT_ID) },
@@ -82,6 +75,7 @@ static struct usb_device_id id_table [] = {
 	{ USB_DEVICE(DCU10_VENDOR_ID, DCU10_PRODUCT_ID) },
 	{ USB_DEVICE(SITECOM_VENDOR_ID, SITECOM_PRODUCT_ID) },
 	{ USB_DEVICE(ALCATEL_VENDOR_ID, ALCATEL_PRODUCT_ID) },
+	{ USB_DEVICE(SAMSUNG_VENDOR_ID, SAMSUNG_PRODUCT_ID) },
 	{ }					/* Terminating entry */
 };
 
@@ -172,20 +166,38 @@ static struct usb_serial_device_type pl2303_device = {
 	.shutdown =		pl2303_shutdown,
 };
 
+enum pl2303_type {
+	type_0,		/* don't know the difference between type 0 and */
+	type_1,		/* type 1, until someone from prolific tells us... */
+	HX,		/* HX version of the pl2303 chip */
+};
+
 struct pl2303_private {
 	spinlock_t lock;
 	wait_queue_head_t delta_msr_wait;
 	u8 line_control;
 	u8 line_status;
 	u8 termios_initialized;
+	enum pl2303_type type;
 };
 
 
 static int pl2303_startup (struct usb_serial *serial)
 {
 	struct pl2303_private *priv;
+	enum pl2303_type type = type_0;
 	int i;
 
+	if (serial->dev->descriptor.bDeviceClass == 0x02)
+		type = type_0;
+	else if (serial->dev->descriptor.bMaxPacketSize0 == 0x40)
+		type = HX;
+	else if (serial->dev->descriptor.bDeviceClass == 0x00)
+		type = type_1;
+	else if (serial->dev->descriptor.bDeviceClass == 0xFF)
+		type = type_1;
+	dbg("device type: %d", type);
+
 	for (i = 0; i < serial->num_ports; ++i) {
 		priv = kmalloc (sizeof (struct pl2303_private), GFP_KERNEL);
 		if (!priv)
@@ -193,6 +205,7 @@ static int pl2303_startup (struct usb_serial *serial)
 		memset (priv, 0x00, sizeof (struct pl2303_private));
 		spin_lock_init(&priv->lock);
 		init_waitqueue_head(&priv->delta_msr_wait);
+		priv->type = type;
 		usb_set_serial_port_data(serial->port[i], priv);
 	}
 	return 0;
@@ -231,7 +244,7 @@ static int pl2303_write (struct usb_serial_port *port, int from_user,  const uns
 		memcpy (port->write_urb->transfer_buffer, buf, count);
 	}
 	
-	usb_serial_debug_data (__FILE__, __FUNCTION__, count, port->write_urb->transfer_buffer);
+	usb_serial_debug_data(debug, &port->dev, __FUNCTION__, count, port->write_urb->transfer_buffer);
 
 	port->write_urb->transfer_buffer_length = count;
 	port->write_urb->dev = port->serial->dev;
@@ -395,20 +408,27 @@ static void pl2303_set_termios (struct usb_serial_port *port, struct termios *ol
 	     buf[0], buf[1], buf[2], buf[3], buf[4], buf[5], buf[6]);
 
 	if (cflag & CRTSCTS) {
-		i = usb_control_msg (serial->dev, usb_sndctrlpipe (serial->dev, 0),
-				     VENDOR_WRITE_REQUEST, VENDOR_WRITE_REQUEST_TYPE,
-				     0x0, 0x41, NULL, 0, 100);
-		dbg ("0x40:0x1:0x0:0x41  %d", i);
+		__u16 index;
+		if (priv->type == HX)
+			index = 0x61;
+		else
+			index = 0x41;
+		i = usb_control_msg(serial->dev, 
+				    usb_sndctrlpipe(serial->dev, 0),
+				    VENDOR_WRITE_REQUEST,
+				    VENDOR_WRITE_REQUEST_TYPE,
+				    0x0, index, NULL, 0, 100);
+		dbg ("0x40:0x1:0x0:0x%x  %d", index, i);
 	}
 
 	kfree (buf);
-}       
-
+} 
 
 static int pl2303_open (struct usb_serial_port *port, struct file *filp)
 {
 	struct termios tmp_termios;
 	struct usb_serial *serial = port->serial;
+	struct pl2303_private *priv = usb_get_serial_port_data(port);
 	unsigned char *buf;
 	int result;
 
@@ -439,6 +459,18 @@ static int pl2303_open (struct usb_serial_port *port, struct file *filp)
 	SOUP (VENDOR_WRITE_REQUEST_TYPE, VENDOR_WRITE_REQUEST, 0x0404, 1);
 	FISH (VENDOR_READ_REQUEST_TYPE, VENDOR_READ_REQUEST, 0x8484, 0);
 	FISH (VENDOR_READ_REQUEST_TYPE, VENDOR_READ_REQUEST, 0x8383, 0);
+	SOUP (VENDOR_WRITE_REQUEST_TYPE, VENDOR_WRITE_REQUEST, 0, 1);
+	SOUP (VENDOR_WRITE_REQUEST_TYPE, VENDOR_WRITE_REQUEST, 1, 0);
+ 
+	if (priv->type == HX) {
+		/* HX chip */
+		SOUP (VENDOR_WRITE_REQUEST_TYPE, VENDOR_WRITE_REQUEST, 2, 0x44);
+		/* reset upstream data pipes */
+          	SOUP (VENDOR_WRITE_REQUEST_TYPE, VENDOR_WRITE_REQUEST, 8, 0);
+        	SOUP (VENDOR_WRITE_REQUEST_TYPE, VENDOR_WRITE_REQUEST, 9, 0);
+	} else {
+		SOUP (VENDOR_WRITE_REQUEST_TYPE, VENDOR_WRITE_REQUEST, 2, 0x24);
+	}
 
 	kfree(buf);
 
@@ -677,7 +709,7 @@ static void pl2303_read_int_callback (struct urb *urb, struct pt_regs *regs)
 	}
 
 
-	usb_serial_debug_data (__FILE__, __FUNCTION__, urb->actual_length, urb->transfer_buffer);
+	usb_serial_debug_data(debug, &port->dev, __FUNCTION__, urb->actual_length, urb->transfer_buffer);
 
 	if (urb->actual_length < UART_STATE)
 		goto exit;
@@ -731,7 +763,7 @@ static void pl2303_read_bulk_callback (struct urb *urb, struct pt_regs *regs)
 		return;
 	}
 
-	usb_serial_debug_data (__FILE__, __FUNCTION__, urb->actual_length, data);
+	usb_serial_debug_data(debug, &port->dev, __FUNCTION__, urb->actual_length, data);
 
 	/* get tty_flag from status */
 	tty_flag = TTY_NORMAL;
diff --git a/drivers/usb/serial/pl2303.h b/drivers/usb/serial/pl2303.h
index a3130625a..7fd65b044 100644
--- a/drivers/usb/serial/pl2303.h
+++ b/drivers/usb/serial/pl2303.h
@@ -42,5 +42,11 @@
 #define SITECOM_VENDOR_ID	0x6189
 #define SITECOM_PRODUCT_ID	0x2068
 
+/* Alcatel OT535/735 USB cable */
 #define ALCATEL_VENDOR_ID	0x11f7
 #define ALCATEL_PRODUCT_ID	0x02df
+
+/* Samsung I330 phone cradle */
+#define SAMSUNG_VENDOR_ID       0x04e8
+#define SAMSUNG_PRODUCT_ID      0x8001
+
diff --git a/drivers/usb/serial/safe_serial.c b/drivers/usb/serial/safe_serial.c
index a04d01dcf..fa0abc4b6 100644
--- a/drivers/usb/serial/safe_serial.c
+++ b/drivers/usb/serial/safe_serial.c
@@ -72,18 +72,14 @@
 #include <linux/spinlock.h>
 #include <asm/uaccess.h>
 #include <linux/usb.h>
+#include "usb-serial.h"
 
 
-#ifndef CONFIG_USB_SERIAL_DEBUG
-#define CONFIG_USB_SERIAL_DEBUG 0
-#endif
 #ifndef CONFIG_USB_SAFE_PADDED
 #define CONFIG_USB_SAFE_PADDED 0
 #endif
 
-static int debug = CONFIG_USB_SERIAL_DEBUG;
-#include "usb-serial.h"		// must follow the declaration of debug
-
+static int debug;
 static int safe = 1;
 static int padded = CONFIG_USB_SAFE_PADDED;
 
@@ -102,19 +98,20 @@ MODULE_LICENSE("GPL");
 #if ! defined(CONFIG_USBD_SAFE_SERIAL_VENDOR)
 static __u16 vendor;		// no default
 static __u16 product;		// no default
-MODULE_PARM (vendor, "i");
-MODULE_PARM (product, "i");
-MODULE_PARM_DESC (vendor, "User specified USB idVendor (required)");
-MODULE_PARM_DESC (product, "User specified USB idProduct (required)");
+module_param(vendor, ushort, 0);
+MODULE_PARM_DESC(vendor, "User specified USB idVendor (required)");
+module_param(product, ushort, 0);
+MODULE_PARM_DESC(product, "User specified USB idProduct (required)");
 #endif
 
-MODULE_PARM (debug, "i");
-MODULE_PARM (safe, "i");
-MODULE_PARM (padded, "i");
+module_param(debug, bool, S_IRUGO | S_IWUSR);
+MODULE_PARM_DESC(debug, "Debug enabled or not");
+
+module_param(safe, bool, 0);
+MODULE_PARM_DESC(safe, "Turn Safe Encapsulation On/Off");
 
-MODULE_PARM_DESC (debug, "Debug enabled or not");
-MODULE_PARM_DESC (safe, "Turn Safe Encapsulation On/Off");
-MODULE_PARM_DESC (padded, "Pad to full wMaxPacketSize On/Off");
+module_param(padded, bool, 0);
+MODULE_PARM_DESC(padded, "Pad to full wMaxPacketSize On/Off");
 
 #define CDC_DEVICE_CLASS                        0x02
 
@@ -346,7 +343,7 @@ static int safe_write (struct usb_serial_port *port, int from_user, const unsign
 		port->write_urb->transfer_buffer_length = count;
 	}
 
-	usb_serial_debug_data (__FILE__, __FUNCTION__, count, port->write_urb->transfer_buffer);
+	usb_serial_debug_data(debug, &port->dev, __FUNCTION__, count, port->write_urb->transfer_buffer);
 #ifdef ECHO_TX
 	{
 		int i;
diff --git a/drivers/usb/serial/usb-serial.c b/drivers/usb/serial/usb-serial.c
index 19c92e818..2656807d7 100644
--- a/drivers/usb/serial/usb-serial.c
+++ b/drivers/usb/serial/usb-serial.c
@@ -336,14 +336,6 @@
 #include <linux/smp_lock.h>
 #include <asm/uaccess.h>
 #include <linux/usb.h>
-
-
-#ifdef CONFIG_USB_SERIAL_DEBUG
-	static int debug = 1;
-#else
-	static int debug;
-#endif
-
 #include "usb-serial.h"
 #include "pl2303.h"
 
@@ -354,26 +346,12 @@
 #define DRIVER_AUTHOR "Greg Kroah-Hartman, greg@kroah.com, http://www.kroah.com/linux/"
 #define DRIVER_DESC "USB Serial Driver core"
 
-
-#ifdef CONFIG_USB_SERIAL_GENERIC
-/* we want to look at all devices, as the vendor/product id can change
- * depending on the command line argument */
-static struct usb_device_id generic_serial_ids[] = {
-	{.driver_info = 42},
-	{}
-};
-
-#endif /* CONFIG_USB_SERIAL_GENERIC */
-
 /* Driver structure we register with the USB core */
 static struct usb_driver usb_serial_driver = {
 	.owner =	THIS_MODULE,
 	.name =		"usbserial",
 	.probe =	usb_serial_probe,
 	.disconnect =	usb_serial_disconnect,
-#ifdef CONFIG_USB_SERIAL_GENERIC
-	.id_table =	generic_serial_ids,
-#endif
 };
 
 /* There is no MODULE_DEVICE_TABLE for usbserial.c.  Instead
@@ -383,10 +361,10 @@ static struct usb_driver usb_serial_driver = {
    drivers depend on it.
 */
 
-static struct usb_serial	*serial_table[SERIAL_TTY_MINORS];	/* initially all NULL */
+static int debug;
+static struct usb_serial *serial_table[SERIAL_TTY_MINORS];	/* initially all NULL */
 static LIST_HEAD(usb_serial_driver_list);
 
-
 struct usb_serial *usb_serial_get_by_index(unsigned index)
 {
 	struct usb_serial *serial = serial_table[index];
@@ -1383,22 +1361,9 @@ error:
 
 void usb_serial_deregister(struct usb_serial_device_type *device)
 {
-	struct usb_serial *serial;
-	int i;
-
 	info("USB Serial deregistering driver %s", device->name);
-
-	/* clear out the serial_table if the device is attached to a port */
-	for(i = 0; i < SERIAL_TTY_MINORS; ++i) {
-		serial = serial_table[i];
-		if ((serial != NULL) && (serial->type == device)) {
-			usb_driver_release_interface (&usb_serial_driver, serial->interface);
-			usb_serial_disconnect (serial->interface);
-		}
-	}
-
 	list_del(&device->driver_list);
-	usb_serial_bus_deregister (device);
+	usb_serial_bus_deregister(device);
 }
 
 
diff --git a/drivers/usb/serial/usb-serial.h b/drivers/usb/serial/usb-serial.h
index 766546dc3..e2e59560d 100644
--- a/drivers/usb/serial/usb-serial.h
+++ b/drivers/usb/serial/usb-serial.h
@@ -294,21 +294,21 @@ extern struct usb_serial_device_type usb_serial_generic_device;
 extern struct bus_type usb_serial_bus_type;
 extern struct tty_driver *usb_serial_tty_driver;
 
-static inline void usb_serial_debug_data (const char *file, const char *function, int size, const unsigned char *data)
+static inline void usb_serial_debug_data(int debug,
+					 struct device *dev,
+					 const char *function, int size,
+					 const unsigned char *data)
 {
 	int i;
 
-	if (!debug)
-		return;
-	
-	printk (KERN_DEBUG "%s: %s - length = %d, data = ", file, function, size);
-	for (i = 0; i < size; ++i) {
-		printk ("%.2x ", data[i]);
+	if (debug) {
+		dev_printk(KERN_DEBUG, dev, "%s - length = %d, data = ", function, size);
+		for (i = 0; i < size; ++i)
+			printk ("%.2x ", data[i]);
+		printk ("\n");
 	}
-	printk ("\n");
 }
 
-
 /* Use our own dbg macro */
 #undef dbg
 #define dbg(format, arg...) do { if (debug) printk(KERN_DEBUG "%s: " format "\n" , __FILE__ , ## arg); } while (0)
diff --git a/drivers/usb/serial/visor.c b/drivers/usb/serial/visor.c
index 377a18479..8a0a75533 100644
--- a/drivers/usb/serial/visor.c
+++ b/drivers/usb/serial/visor.c
@@ -155,13 +155,6 @@
 #include <linux/spinlock.h>
 #include <asm/uaccess.h>
 #include <linux/usb.h>
-
-#ifdef CONFIG_USB_SERIAL_DEBUG
-	static int debug = 1;
-#else
-	static int debug;
-#endif
-
 #include "usb-serial.h"
 #include "visor.h"
 
@@ -195,6 +188,7 @@ static int palm_os_3_probe (struct usb_serial *serial, const struct usb_device_i
 static int palm_os_4_probe (struct usb_serial *serial, const struct usb_device_id *id);
 
 /* Parameters that may be passed into the module. */
+static int debug;
 static __u16 vendor;
 static __u16 product;
 
@@ -247,6 +241,8 @@ static struct usb_device_id id_table [] = {
 		.driver_info = (kernel_ulong_t)&palm_os_4_probe },
 	{ USB_DEVICE(ACEECA_VENDOR_ID, ACEECA_MEZ1000_ID),
 		.driver_info = (kernel_ulong_t)&palm_os_4_probe },
+	{ USB_DEVICE(KYOCERA_VENDOR_ID, KYOCERA_7135_ID),
+		.driver_info = (kernel_ulong_t)&palm_os_4_probe },
 	{ },					/* optional parameter entry */
 	{ }					/* Terminating entry */
 };
@@ -290,6 +286,7 @@ static struct usb_device_id id_table_combined [] = {
 	{ USB_DEVICE(SAMSUNG_VENDOR_ID, SAMSUNG_SPH_I500_ID) },
 	{ USB_DEVICE(GARMIN_VENDOR_ID, GARMIN_IQUE_3600_ID) },
 	{ USB_DEVICE(ACEECA_VENDOR_ID, ACEECA_MEZ1000_ID) },
+	{ USB_DEVICE(KYOCERA_VENDOR_ID, KYOCERA_7135_ID) },
 	{ },					/* optional parameter entry */
 	{ }					/* Terminating entry */
 };
@@ -501,7 +498,7 @@ static int visor_write (struct usb_serial_port *port, int from_user, const unsig
 		memcpy (buffer, buf, count);
 	}
 
-	usb_serial_debug_data (__FILE__, __FUNCTION__, count, buffer);
+	usb_serial_debug_data(debug, &port->dev, __FUNCTION__, count, buffer);
 
 	usb_fill_bulk_urb (urb, serial->dev,
 			   usb_sndbulkpipe (serial->dev,
@@ -515,6 +512,7 @@ static int visor_write (struct usb_serial_port *port, int from_user, const unsig
 		dev_err(&port->dev, "%s - usb_submit_urb(write bulk) failed with status = %d\n",
 			__FUNCTION__, status);
 		count = status;
+		kfree (buffer);
 	} else {
 		bytes_out += count;
 	}
@@ -586,7 +584,7 @@ static void visor_read_bulk_callback (struct urb *urb, struct pt_regs *regs)
 		return;
 	}
 
-	usb_serial_debug_data (__FILE__, __FUNCTION__, urb->actual_length, data);
+	usb_serial_debug_data(debug, &port->dev, __FUNCTION__, urb->actual_length, data);
 
 	tty = port->tty;
 	if (tty && urb->actual_length) {
@@ -617,6 +615,7 @@ static void visor_read_bulk_callback (struct urb *urb, struct pt_regs *regs)
 
 static void visor_read_int_callback (struct urb *urb, struct pt_regs *regs)
 {
+	struct usb_serial_port *port = (struct usb_serial_port *)urb->context;
 	int result;
 
 	switch (urb->status) {
@@ -643,8 +642,8 @@ static void visor_read_int_callback (struct urb *urb, struct pt_regs *regs)
 	 * Rumor has it this endpoint is used to notify when data
 	 * is ready to be read from the bulk ones.
 	 */
-	usb_serial_debug_data (__FILE__, __FUNCTION__, urb->actual_length,
-			       urb->transfer_buffer);
+	usb_serial_debug_data(debug, &port->dev, __FUNCTION__,
+			      urb->actual_length, urb->transfer_buffer);
 
 exit:
 	result = usb_submit_urb (urb, GFP_ATOMIC);
@@ -795,7 +794,8 @@ static int palm_os_4_probe (struct usb_serial *serial, const struct usb_device_i
 		dev_err(dev, "%s - error %d getting connection info\n",
 			__FUNCTION__, retval);
 	else
-		usb_serial_debug_data (__FILE__, __FUNCTION__, 0x14, transfer_buffer);
+		usb_serial_debug_data(debug, &serial->dev->dev, __FUNCTION__,
+				      retval, transfer_buffer);
 
 	kfree (transfer_buffer);
 	return 0;
@@ -881,18 +881,19 @@ static int treo_attach (struct usb_serial *serial)
 
 	/* Only do this endpoint hack for the Handspring devices with
 	 * interrupt in endpoints, which for now are the Treo devices. */
-	if ((serial->dev->descriptor.idVendor != HANDSPRING_VENDOR_ID) ||
+	if (!((serial->dev->descriptor.idVendor == HANDSPRING_VENDOR_ID) ||
+	      (serial->dev->descriptor.idVendor == KYOCERA_VENDOR_ID)) ||
 	    (serial->num_interrupt_in == 0))
 		return 0;
 
 	dbg("%s", __FUNCTION__);
 
 	/*
-	* It appears that Treos want to use the 1st interrupt endpoint to
-	* communicate with the 2nd bulk out endpoint, so let's swap the 1st
-	* and 2nd bulk in and interrupt endpoints.  Note that swapping the
-	* bulk out endpoints would break lots of apps that want to communicate
-	* on the second port.
+	* It appears that Treos and Kyoceras want to use the 
+	* 1st bulk in endpoint to communicate with the 2nd bulk out endpoint, 
+	* so let's swap the 1st and 2nd bulk in and interrupt endpoints.  
+	* Note that swapping the bulk out endpoints would break lots of 
+	* apps that want to communicate on the second port.
 	*/
 #define COPY_PORT(dest, src)						\
 	dest->read_urb = src->read_urb;					\
diff --git a/drivers/usb/serial/visor.h b/drivers/usb/serial/visor.h
index 6062273ab..55185b398 100644
--- a/drivers/usb/serial/visor.h
+++ b/drivers/usb/serial/visor.h
@@ -55,6 +55,9 @@
 #define ACEECA_VENDOR_ID		0x4766
 #define ACEECA_MEZ1000_ID		0x0001
 
+#define KYOCERA_VENDOR_ID		0x0C88
+#define KYOCERA_7135_ID			0x0021 
+
 /****************************************************************************
  * Handspring Visor Vendor specific request codes (bRequest values)
  * A big thank you to Handspring for providing the following information.
diff --git a/drivers/usb/serial/whiteheat.c b/drivers/usb/serial/whiteheat.c
index e79afadc3..b27741bf5 100644
--- a/drivers/usb/serial/whiteheat.c
+++ b/drivers/usb/serial/whiteheat.c
@@ -80,17 +80,12 @@
 #include <linux/usb.h>
 #include <linux/serial_reg.h>
 #include <linux/serial.h>
-
-#ifdef CONFIG_USB_SERIAL_DEBUG
-	static int debug = 1;
-#else
-	static int debug;
-#endif
-
 #include "usb-serial.h"
 #include "whiteheat_fw.h"		/* firmware for the ConnectTech WhiteHEAT device */
 #include "whiteheat.h"			/* WhiteHEAT specific commands */
 
+static int debug;
+
 #ifndef CMSPAR
 #define CMSPAR 0
 #endif
@@ -747,7 +742,7 @@ static int whiteheat_write(struct usb_serial_port *port, int from_user, const un
 			memcpy (urb->transfer_buffer, buf + sent, bytes);
 		}
 
-		usb_serial_debug_data (__FILE__, __FUNCTION__, bytes, urb->transfer_buffer);
+		usb_serial_debug_data(debug, &port->dev, __FUNCTION__, bytes, urb->transfer_buffer);
 
 		urb->dev = serial->dev;
 		urb->transfer_buffer_length = bytes;
@@ -835,6 +830,7 @@ static int whiteheat_tiocmset (struct usb_serial_port *port, struct file *file,
 static int whiteheat_ioctl (struct usb_serial_port *port, struct file * file, unsigned int cmd, unsigned long arg)
 {
 	struct serial_struct serstruct;
+	void __user *user_arg = (void __user *)arg;
 
 	dbg("%s - port %d, cmd 0x%.4x", __FUNCTION__, port->number, cmd);
 
@@ -851,13 +847,13 @@ static int whiteheat_ioctl (struct usb_serial_port *port, struct file * file, un
 			serstruct.close_delay = CLOSING_DELAY;
 			serstruct.closing_wait = CLOSING_DELAY;
 
-			if (copy_to_user((void *)arg, &serstruct, sizeof(serstruct)))
+			if (copy_to_user(user_arg, &serstruct, sizeof(serstruct)))
 				return -EFAULT;
 
 			break;
 
 		case TIOCSSERIAL:
-			if (copy_from_user(&serstruct, (void *)arg, sizeof(serstruct)))
+			if (copy_from_user(&serstruct, user_arg, sizeof(serstruct)))
 				return -EFAULT;
 
 			/*
@@ -974,10 +970,6 @@ static void command_port_write_callback (struct urb *urb, struct pt_regs *regs)
 		dbg ("nonzero urb status: %d", urb->status);
 		return;
 	}
-
-	usb_serial_debug_data (__FILE__, __FUNCTION__, urb->actual_length, urb->transfer_buffer);
-
-	return;
 }
 
 
@@ -996,7 +988,7 @@ static void command_port_read_callback (struct urb *urb, struct pt_regs *regs)
 		return;
 	}
 
-	usb_serial_debug_data (__FILE__, __FUNCTION__, urb->actual_length, data);
+	usb_serial_debug_data(debug, &command_port->dev, __FUNCTION__, urb->actual_length, data);
 
 	command_info = usb_get_serial_port_data(command_port);
 	if (!command_info) {
@@ -1058,7 +1050,7 @@ static void whiteheat_read_callback(struct urb *urb, struct pt_regs *regs)
 		return;
 	}
 
-	usb_serial_debug_data (__FILE__, __FUNCTION__, urb->actual_length, data);
+	usb_serial_debug_data(debug, &port->dev, __FUNCTION__, urb->actual_length, data);
 
 	spin_lock(&info->lock);
 	list_add_tail(&wrap->list, &info->rx_urb_q);
@@ -1518,8 +1510,8 @@ MODULE_AUTHOR( DRIVER_AUTHOR );
 MODULE_DESCRIPTION( DRIVER_DESC );
 MODULE_LICENSE("GPL");
 
-MODULE_PARM(urb_pool_size, "i");
+module_param(urb_pool_size, int, 0);
 MODULE_PARM_DESC(urb_pool_size, "Number of urbs to use for buffering");
 
-MODULE_PARM(debug, "i");
+module_param(debug, bool, S_IRUGO | S_IWUSR);
 MODULE_PARM_DESC(debug, "Debug enabled or not");
diff --git a/drivers/usb/storage/Kconfig b/drivers/usb/storage/Kconfig
index 9e49d5477..7e8d1212d 100644
--- a/drivers/usb/storage/Kconfig
+++ b/drivers/usb/storage/Kconfig
@@ -23,6 +23,28 @@ config USB_STORAGE_DEBUG
 	  Say Y here in order to have the USB Mass Storage code generate
 	  verbose debugging messages.
 
+config USB_STORAGE_RW_DETECT
+	bool "USB Mass Storage Write-Protected Media Detection (EXPERIMENTAL)"
+	depends on USB_STORAGE && EXPERIMENTAL
+	help
+	  Say Y here in order to have the USB Mass Storage code indicate to
+	  the SCSI layer that using MODE SENSE(6) and MODE SENSE(10) to
+	  determine if the media is write-protected is a good thing to do.
+
+	  Many devices have historically had trouble with these commands,
+	  hence the default 2.6.x behavior has been to suppress their use.
+	  2.4.x used these commands with (at best) mixed results, often
+	  crashing the firmware of the device.  However, the SCSI layer now
+	  issues these commands in a manner more consistent with other
+	  "popular" OSes, in an attempt to improve compatibility.
+
+	  Saying Y here allows these commands to be sent to a USB device.
+	  If you find a device this doesn't work for, switch to N and let
+	  us know at usb-storage@lists.one-eyed-alien.net
+
+	  If you say N here, the kernel will assume that all disk-like USB
+	  devices are write-enabled.
+
 config USB_STORAGE_DATAFAB
 	bool "Datafab Compact Flash Reader support (EXPERIMENTAL)"
 	depends on USB_STORAGE && EXPERIMENTAL
diff --git a/drivers/usb/storage/jumpshot.c b/drivers/usb/storage/jumpshot.c
index 39b24e59f..ac9c908c4 100644
--- a/drivers/usb/storage/jumpshot.c
+++ b/drivers/usb/storage/jumpshot.c
@@ -471,7 +471,7 @@ int jumpshot_transport(Scsi_Cmnd * srb, struct us_data *us)
 
 		// build the reply
 		//
-		((u32 *) ptr)[0] = cpu_to_be32(info->sectors);
+		((u32 *) ptr)[0] = cpu_to_be32(info->sectors - 1);
 		((u32 *) ptr)[1] = cpu_to_be32(info->ssize);
 		usb_stor_set_xfer_buf(ptr, 8, srb);
 
diff --git a/drivers/usb/storage/scsiglue.c b/drivers/usb/storage/scsiglue.c
index ca3be781e..d003abe67 100644
--- a/drivers/usb/storage/scsiglue.c
+++ b/drivers/usb/storage/scsiglue.c
@@ -48,13 +48,13 @@
 #include "usb.h"
 #include "debug.h"
 #include "transport.h"
+#include "protocol.h"
 
 #include <linux/slab.h>
 #include <linux/module.h>
 #include <scsi/scsi_devinfo.h>
 #include <scsi/scsi_host.h>
 
-
 /***********************************************************************
  * Host functions 
  ***********************************************************************/
@@ -68,10 +68,13 @@ static int slave_alloc (struct scsi_device *sdev)
 {
 	/*
 	 * Set default bflags. These can be overridden for individual
-	 * models and vendors via the scsi devinfo mechanism.
+	 * models and vendors via the scsi devinfo mechanism.  The only
+	 * flag we need is to force 36-byte INQUIRYs; we don't use any
+	 * of the extra data and many devices choke if asked for more or
+	 * less than 36 bytes.
 	 */
-	sdev->sdev_bflags = (BLIST_MS_SKIP_PAGE_08 | BLIST_MS_SKIP_PAGE_3F |
-			     BLIST_USE_10_BYTE_MS);
+	sdev->sdev_bflags = BLIST_INQUIRY_36;
+
 	return 0;
 }
 
@@ -95,11 +98,48 @@ static int slave_configure(struct scsi_device *sdev)
 	 * reduce the maximum transfer size to 64 KB = 128 sectors. */
 
 #define USB_VENDOR_ID_GENESYS	0x05e3		// Needs a standard location
+
 	if (us->pusb_dev->descriptor.idVendor == USB_VENDOR_ID_GENESYS &&
-			us->pusb_dev->speed == USB_SPEED_HIGH)
+			us->pusb_dev->speed == USB_SPEED_HIGH &&
+			sdev->request_queue->max_sectors > 128)
 		blk_queue_max_sectors(sdev->request_queue, 128);
 
-	/* this is to satisify the compiler, tho I don't think the 
+	/* We can't put these settings in slave_alloc() because that gets
+	 * called before the device type is known.  Consequently these
+	 * settings can't be overridden via the scsi devinfo mechanism. */
+	if (sdev->type == TYPE_DISK) {
+
+		/* Disk-type devices use MODE SENSE(6) if the protocol
+		 * (SubClass) is Transparent SCSI, otherwise they use
+		 * MODE SENSE(10). */
+		if (us->subclass != US_SC_SCSI)
+			sdev->use_10_for_ms = 1;
+
+		/* Many disks only accept MODE SENSE transfer lengths of
+		 * 192 bytes (that's what Windows uses). */
+		sdev->use_192_bytes_for_3f = 1;
+
+		/* A number of devices have problems with MODE SENSE for
+		 * page x08, so we will skip it. */
+		sdev->skip_ms_page_8 = 1;
+
+#ifndef CONFIG_USB_STORAGE_RW_DETECT
+		/* Some devices may not like MODE SENSE with page=0x3f.
+		 * Now that we're using 192-byte transfers this may no
+		 * longer be a problem.  So this will be a configuration
+		 * option. */
+		sdev->skip_ms_page_3f = 1;
+#endif
+
+	} else {
+
+		/* Non-disk-type devices don't need to blacklist any pages
+		 * or to force 192-byte transfer lengths for MODE SENSE.
+		 * But they do need to use MODE SENSE(10). */
+		sdev->use_10_for_ms = 1;
+	}
+
+	/* this is to satisfy the compiler, tho I don't think the 
 	 * return code is ever checked anywhere. */
 	return 0;
 }
@@ -409,6 +449,9 @@ struct scsi_host_template usb_stor_host_template = {
 	/* emulated HBA */
 	.emulated =			TRUE,
 
+	/* we do our own delay after a device or bus reset */
+	.skip_settle_delay =		1,
+
 	/* sysfs device attributes */
 	.sdev_attrs =			sysfs_device_attr_list,
 
diff --git a/drivers/usb/storage/sddr09.c b/drivers/usb/storage/sddr09.c
index 11e03b39c..f96bb7535 100644
--- a/drivers/usb/storage/sddr09.c
+++ b/drivers/usb/storage/sddr09.c
@@ -1089,7 +1089,7 @@ sddr09_get_cardinfo(struct us_data *us, unsigned char flags) {
 	if (result != USB_STOR_TRANSPORT_GOOD) {
 		US_DEBUGP("Result of read_deviceID is %d\n", result);
 		printk("sddr09: could not read card info\n");
-		return 0;
+		return NULL;
 	}
 
 	sprintf(blurbtxt, "sddr09: Found Flash card, ID = %02X %02X %02X %02X",
diff --git a/drivers/usb/storage/transport.c b/drivers/usb/storage/transport.c
index e42c59a1b..232155854 100644
--- a/drivers/usb/storage/transport.c
+++ b/drivers/usb/storage/transport.c
@@ -708,6 +708,12 @@ void usb_stor_invoke_transport(Scsi_Cmnd *srb, struct us_data *us)
 			srb->sense_buffer[0] = 0x0;
 		}
 	}
+
+	/* Did we transfer less than the minimum amount required? */
+	if (srb->result == SAM_STAT_GOOD &&
+			srb->request_bufflen - srb->resid < srb->underflow)
+		srb->result = (DID_ERROR << 16) | (SUGGEST_RETRY << 24);
+
 	return;
 
 	/* abort processing: the bulk-only transport requires a reset
@@ -908,26 +914,29 @@ int usb_stor_Bulk_max_lun(struct us_data *us)
 				 USB_RECIP_INTERFACE,
 				 0, us->ifnum, us->iobuf, 1, HZ);
 
+	US_DEBUGP("GetMaxLUN command result is %d, data is %d\n", 
+		  result, us->iobuf[0]);
+
+	/* if we have a successful request, return the result */
+	if (result == 1)
+		return us->iobuf[0];
+
 	/* 
 	 * Some devices (i.e. Iomega Zip100) need this -- apparently
 	 * the bulk pipes get STALLed when the GetMaxLUN request is
 	 * processed.   This is, in theory, harmless to all other devices
 	 * (regardless of if they stall or not).
 	 */
-	if (result < 0) {
+	if (result == -EPIPE) {
 		usb_stor_clear_halt(us, us->recv_bulk_pipe);
 		usb_stor_clear_halt(us, us->send_bulk_pipe);
+		/* return the default -- no LUNs */
+		return 0;
 	}
 
-	US_DEBUGP("GetMaxLUN command result is %d, data is %d\n", 
-		  result, us->iobuf[0]);
-
-	/* if we have a successful request, return the result */
-	if (result == 1)
-		return us->iobuf[0];
-
-	/* return the default -- no LUNs */
-	return 0;
+	/* An answer or a STALL are the only valid responses.  If we get
+	 * something else, return an indication of error */
+	return -1;
 }
 
 int usb_stor_Bulk_transport(Scsi_Cmnd *srb, struct us_data *us)
@@ -1110,10 +1119,11 @@ static int usb_stor_reset_common(struct us_data *us,
 		goto Done;
 	}
 
-	/* long wait for reset, so unlock to allow disconnects */
-	up(&us->dev_semaphore);
-	msleep(6000);
-	down(&us->dev_semaphore);
+ 	/* Give the device some time to recover from the reset,
+ 	 * but don't delay disconnect processing. */
+ 	wait_event_interruptible_timeout(us->dev_reset_wait,
+ 			test_bit(US_FLIDX_DISCONNECTING, &us->flags),
+ 			HZ*6);
 	if (test_bit(US_FLIDX_DISCONNECTING, &us->flags)) {
 		US_DEBUGP("Reset interrupted by disconnect\n");
 		goto Done;
diff --git a/drivers/usb/storage/unusual_devs.h b/drivers/usb/storage/unusual_devs.h
index 56de0bdf2..195e98f95 100644
--- a/drivers/usb/storage/unusual_devs.h
+++ b/drivers/usb/storage/unusual_devs.h
@@ -73,6 +73,16 @@ UNUSUAL_DEV(  0x03f0, 0x0307, 0x0001, 0x0001,
 		US_SC_8070, US_PR_SCM_ATAPI, init_8200e, 0), 
 #endif
 
+/* <torsten.scherer@uni-bielefeld.de>: I don't know the name of the bridge
+ * manufacturer, but I've got an external USB drive by the Revoltec company
+ * that needs this. otherwise the drive is recognized as /dev/sda, but any
+ * access to it blocks indefinitely.
+ */
+UNUSUAL_DEV(  0x0402, 0x5621, 0x0103, 0x0103,
+		"Revoltec",
+		"USB/IDE Bridge (ATA/ATAPI)",
+		US_SC_DEVICE, US_PR_DEVICE, NULL, US_FL_FIX_INQUIRY),
+
 /* Deduced by Jonathan Woithe <jwoithe@physics.adelaide.edu.au>
  * Entry needed for flags: US_FL_FIX_INQUIRY because initial inquiry message
  * always fails and confuses drive.
@@ -207,7 +217,7 @@ UNUSUAL_DEV(  0x04e6, 0x0005, 0x0100, 0x0208,
 UNUSUAL_DEV(  0x04e6, 0x0006, 0x0100, 0x0205, 
 		"Shuttle",
 		"eUSB MMC Adapter",
-		US_SC_SCSI, US_PR_CB, NULL, 
+		US_SC_SCSI, US_PR_DEVICE, NULL, 
 		US_FL_SINGLE_LUN), 
 
 UNUSUAL_DEV(  0x04e6, 0x0007, 0x0100, 0x0200, 
@@ -343,6 +353,14 @@ UNUSUAL_DEV(  0x054c, 0x016a, 0x0000, 0x9999,
 		US_SC_DEVICE, US_PR_DEVICE, NULL,
 		US_FL_FIX_INQUIRY ),
 		
+/* Submitted by Frank Engel <frankie@cse.unsw.edu.au> */
+UNUSUAL_DEV(  0x054c, 0x0099, 0x0000, 0x9999,
+                "Sony",
+                "PEG Mass Storage",
+                US_SC_DEVICE, US_PR_DEVICE, NULL,
+                US_FL_FIX_INQUIRY ),
+
+		
 UNUSUAL_DEV(  0x057b, 0x0000, 0x0000, 0x0299, 
 		"Y-E Data",
 		"Flashbuster-U",
@@ -359,13 +377,19 @@ UNUSUAL_DEV(  0x057b, 0x0000, 0x0300, 0x9999,
 UNUSUAL_DEV(  0x0595, 0x4343, 0x0000, 0x2210,
 		"Fujifilm",
 		"Digital Camera EX-20 DSC",
-		US_SC_8070, US_PR_CBI, NULL, 0 ),
+		US_SC_8070, US_PR_DEVICE, NULL, 0 ),
 
 UNUSUAL_DEV(  0x059f, 0xa601, 0x0200, 0x0200, 
 		"LaCie",
 		"USB Hard Disk",
 		US_SC_RBC, US_PR_CB, NULL, 0 ), 
 
+/* Submitted by Jol Bourquard <numlock@freesurf.ch> */
+UNUSUAL_DEV(  0x05ab, 0x0060, 0x1104, 0x1110,
+		"In-System",
+		"PyroGate External CD-ROM Enclosure (FCD-523)",
+		US_SC_SCSI, US_PR_BULK, NULL, 0 ),
+
 #ifdef CONFIG_USB_STORAGE_ISD200
 UNUSUAL_DEV(  0x05ab, 0x0031, 0x0100, 0x0110,
 		"In-System",
@@ -396,8 +420,8 @@ UNUSUAL_DEV(  0x05ab, 0x5701, 0x0100, 0x0110,
 UNUSUAL_DEV(  0x05dc, 0x0001, 0x0000, 0x0001,
 		"Lexar",
 		"Jumpshot USB CF Reader",
-		US_SC_DEVICE, US_PR_JUMPSHOT, NULL,
-		US_FL_MODE_XLATE ),
+		US_SC_SCSI, US_PR_JUMPSHOT, NULL,
+		US_FL_NEED_OVERRIDE | US_FL_MODE_XLATE ),
 #endif
 
 /* Reported by Blake Matheny <bmatheny@purdue.edu> */
@@ -628,20 +652,14 @@ UNUSUAL_DEV(  0x07c4, 0xa400, 0x0000, 0xffff,
  * - Some cameras with idProduct=0x1001 and bcdDevice=0x1000 have
  *   bInterfaceProtocol=0x00 (US_PR_CBI) while others have 0x01 (US_PR_CB).
  *   So don't remove the US_PR_CB override!
+ * - Cameras with bcdDevice=0x9009 require the US_SC_8070 override.
  */
-UNUSUAL_DEV( 0x07cf, 0x1001, 0x1000, 0x9009,
+UNUSUAL_DEV( 0x07cf, 0x1001, 0x1000, 0x9999,
 		"Casio",
 		"QV DigitalCamera",
-		US_SC_DEVICE, US_PR_CB, NULL,
+		US_SC_8070, US_PR_CB, NULL,
 		US_FL_NEED_OVERRIDE | US_FL_FIX_INQUIRY ),
 
-/* Later Casio cameras apparently tell the truth */
-UNUSUAL_DEV( 0x07cf, 0x1001, 0x9010, 0x9999,
-		"Casio",
-		"QV DigitalCamera",
-		US_SC_DEVICE, US_PR_DEVICE, NULL,
-		US_FL_FIX_INQUIRY ),
-
 /* Submitted by Hartmut Wahl <hwahl@hwahl.de>*/
 UNUSUAL_DEV( 0x0839, 0x000a, 0x0001, 0x0001,
 		"Samsung",
@@ -686,7 +704,7 @@ UNUSUAL_DEV( 0x090c, 0x1132, 0x0000, 0xffff,
 UNUSUAL_DEV(  0x097a, 0x0001, 0x0000, 0x0001,
 		"Minds@Work",
 		"Digital Wallet",
- 		US_SC_SCSI, US_PR_CB, NULL,
+ 		US_SC_DEVICE, US_PR_DEVICE, NULL,
 		US_FL_MODE_XLATE ),
 
 UNUSUAL_DEV(  0x0a16, 0x8888, 0x0100, 0x0100,
diff --git a/drivers/usb/storage/usb.c b/drivers/usb/storage/usb.c
index 634282265..ad22739be 100644
--- a/drivers/usb/storage/usb.c
+++ b/drivers/usb/storage/usb.c
@@ -211,7 +211,7 @@ static struct us_unusual_dev us_unusual_dev_list[] = {
 	  .useTransport = US_PR_BULK},
 
 	/* Terminating entry */
-	{ 0 }
+	{ NULL }
 };
 
 struct usb_driver usb_storage_driver = {
@@ -266,6 +266,7 @@ void fill_inquiry_response(struct us_data *us, unsigned char *data,
 static int usb_stor_control_thread(void * __us)
 {
 	struct us_data *us = (struct us_data *)__us;
+	struct Scsi_Host *host = us->host;
 
 	lock_kernel();
 
@@ -283,19 +284,21 @@ static int usb_stor_control_thread(void * __us)
 	complete(&(us->notify));
 
 	for(;;) {
-		struct Scsi_Host *host;
 		US_DEBUGP("*** thread sleeping.\n");
 		if(down_interruptible(&us->sema))
 			break;
 			
 		US_DEBUGP("*** thread awakened.\n");
 
+		/* lock the device pointers */
+		down(&(us->dev_semaphore));
+
 		/* if us->srb is NULL, we are being asked to exit */
 		if (us->srb == NULL) {
 			US_DEBUGP("-- exit command received\n");
+			up(&(us->dev_semaphore));
 			break;
 		}
-		host = us->srb->device->host;
 
 		/* lock access to the state */
 		scsi_lock(host);
@@ -306,23 +309,20 @@ static int usb_stor_control_thread(void * __us)
 			goto SkipForAbort;
 		}
 
-		/* set the state and release the lock */
-		us->sm_state = US_STATE_RUNNING;
-		scsi_unlock(host);
-
-		/* lock the device pointers */
-		down(&(us->dev_semaphore));
-
 		/* don't do anything if we are disconnecting */
 		if (test_bit(US_FLIDX_DISCONNECTING, &us->flags)) {
 			US_DEBUGP("No command during disconnect\n");
-			us->srb->result = DID_BAD_TARGET << 16;
+			goto SkipForDisconnect;
 		}
 
+		/* set the state and release the lock */
+		us->sm_state = US_STATE_RUNNING;
+		scsi_unlock(host);
+
 		/* reject the command if the direction indicator 
 		 * is UNKNOWN
 		 */
-		else if (us->srb->sc_data_direction == SCSI_DATA_UNKNOWN) {
+		if (us->srb->sc_data_direction == SCSI_DATA_UNKNOWN) {
 			US_DEBUGP("UNKNOWN data direction\n");
 			us->srb->result = DID_ERROR << 16;
 		}
@@ -362,9 +362,6 @@ static int usb_stor_control_thread(void * __us)
 			us->proto_handler(us->srb, us);
 		}
 
-		/* unlock the device pointers */
-		up(&(us->dev_semaphore));
-
 		/* lock access to the state */
 		scsi_lock(host);
 
@@ -374,7 +371,7 @@ static int usb_stor_control_thread(void * __us)
 				   us->srb->result);
 			us->srb->scsi_done(us->srb);
 		} else {
-			SkipForAbort:
+SkipForAbort:
 			US_DEBUGP("scsi command aborted\n");
 		}
 
@@ -387,9 +384,13 @@ static int usb_stor_control_thread(void * __us)
 			complete(&(us->notify));
 
 		/* empty the queue, reset the state, and release the lock */
+SkipForDisconnect:
 		us->srb = NULL;
 		us->sm_state = US_STATE_IDLE;
 		scsi_unlock(host);
+
+		/* unlock the device pointers */
+		up(&(us->dev_semaphore));
 	} /* for (;;) */
 
 	/* notify the exit routine that we're actually exiting now 
@@ -423,10 +424,8 @@ static int associate_dev(struct us_data *us, struct usb_interface *intf)
 	us->pusb_intf = intf;
 	us->ifnum = intf->cur_altsetting->desc.bInterfaceNumber;
 
-	/* Store our private data in the interface and increment the
-	 * device's reference count */
+	/* Store our private data in the interface */
 	usb_set_intfdata(intf, us);
-	usb_get_dev(us->pusb_dev);
 
 	/* Allocate the device-related DMA-mapped buffers */
 	us->cr = usb_buffer_alloc(us->pusb_dev, sizeof(*us->cr),
@@ -754,8 +753,14 @@ static int usb_stor_acquire_resources(struct us_data *us)
 	down(&us->dev_semaphore);
 
 	/* For bulk-only devices, determine the max LUN value */
-	if (us->protocol == US_PR_BULK)
-		us->max_lun = usb_stor_Bulk_max_lun(us);
+	if (us->protocol == US_PR_BULK) {
+		p = usb_stor_Bulk_max_lun(us);
+		if (p < 0) {
+			up(&us->dev_semaphore);
+			return p;
+		}
+		us->max_lun = p;
+	}
 
 	/* Just before we start our control thread, initialize
 	 * the device if it needs initialization */
@@ -764,19 +769,6 @@ static int usb_stor_acquire_resources(struct us_data *us)
 
 	up(&us->dev_semaphore);
 
-	/* Start up our control thread */
-	us->sm_state = US_STATE_IDLE;
-	p = kernel_thread(usb_stor_control_thread, us, CLONE_VM);
-	if (p < 0) {
-		printk(KERN_WARNING USB_STORAGE 
-		       "Unable to start control thread\n");
-		return p;
-	}
-	us->pid = p;
-
-	/* Wait for the thread to start */
-	wait_for_completion(&(us->notify));
-
 	/*
 	 * Since this is a new device, we need to register a SCSI
 	 * host definition with the higher SCSI layers.
@@ -784,69 +776,61 @@ static int usb_stor_acquire_resources(struct us_data *us)
 	us->host = scsi_host_alloc(&usb_stor_host_template, sizeof(us));
 	if (!us->host) {
 		printk(KERN_WARNING USB_STORAGE
-			"Unable to register the scsi host\n");
+			"Unable to allocate the scsi host\n");
 		return -EBUSY;
 	}
 
 	/* Set the hostdata to prepare for scanning */
 	us->host->hostdata[0] = (unsigned long) us;
 
-	return 0;
-}
-
-/* Dissociate from the USB device */
-static void dissociate_dev(struct us_data *us)
-{
-	US_DEBUGP("-- %s\n", __FUNCTION__);
-	down(&us->dev_semaphore);
-
-	/* Free the device-related DMA-mapped buffers */
-	if (us->cr) {
-		usb_buffer_free(us->pusb_dev, sizeof(*us->cr), us->cr,
-				us->cr_dma);
-		us->cr = NULL;
-	}
-	if (us->iobuf) {
-		usb_buffer_free(us->pusb_dev, US_IOBUF_SIZE, us->iobuf,
-				us->iobuf_dma);
-		us->iobuf = NULL;
+	/* Start up our control thread */
+	us->sm_state = US_STATE_IDLE;
+	p = kernel_thread(usb_stor_control_thread, us, CLONE_VM);
+	if (p < 0) {
+		printk(KERN_WARNING USB_STORAGE 
+		       "Unable to start control thread\n");
+		return p;
 	}
+	us->pid = p;
 
-	/* Remove our private data from the interface and decrement the
-	 * device's reference count */
-	usb_set_intfdata(us->pusb_intf, NULL);
-	usb_put_dev(us->pusb_dev);
+	/* Wait for the thread to start */
+	wait_for_completion(&(us->notify));
 
-	us->pusb_dev = NULL;
-	us->pusb_intf = NULL;
-	up(&us->dev_semaphore);
+	return 0;
 }
 
-/* Release all our static and dynamic resources */
+/* Release all our dynamic resources */
 void usb_stor_release_resources(struct us_data *us)
 {
-	/*
-	 * The host must already have been removed
-	 * and dissociate_dev() must have been called.
-	 */
-
-	/* Finish the SCSI host removal sequence */
-	if (us->host) {
-		us->host->hostdata[0] = 0;
-		scsi_host_put(us->host);
-	}
+	US_DEBUGP("-- %s\n", __FUNCTION__);
 
-	/* Kill the control thread
-	 *
-	 * Enqueue the command, wake up the thread, and wait for 
-	 * notification that it has exited.
+	/* Kill the control thread.  The SCSI host must already have been
+	 * removed so it won't try to queue any more commands.
 	 */
 	if (us->pid) {
+
+		/* Wait for the thread to be idle */
+		down(&us->dev_semaphore);
 		US_DEBUGP("-- sending exit command to thread\n");
 		BUG_ON(us->sm_state != US_STATE_IDLE);
+
+		/* If the SCSI midlayer queued a final command just before
+		 * scsi_remove_host() was called, us->srb might not be
+		 * NULL.  We can overwrite it safely, because the midlayer
+		 * will not wait for the command to finish.  Also the
+		 * control thread will already have been awakened.
+		 * That's okay, an extra up() on us->sema won't hurt.
+		 *
+		 * Enqueue the command, wake up the thread, and wait for 
+		 * notification that it has exited.
+		 */
+		scsi_lock(us->host);
 		us->srb = NULL;
-		up(&(us->sema));
-		wait_for_completion(&(us->notify));
+		scsi_unlock(us->host);
+		up(&us->dev_semaphore);
+
+		up(&us->sema);
+		wait_for_completion(&us->notify);
 	}
 
 	/* Call the destructor routine, if it exists */
@@ -855,15 +839,36 @@ void usb_stor_release_resources(struct us_data *us)
 		us->extra_destructor(us->extra);
 	}
 
+	/* Finish the host removal sequence */
+	if (us->host)
+		scsi_host_put(us->host);
+
 	/* Free the extra data and the URB */
 	if (us->extra)
 		kfree(us->extra);
 	if (us->current_urb)
 		usb_free_urb(us->current_urb);
 
+}
+
+/* Dissociate from the USB device */
+static void dissociate_dev(struct us_data *us)
+{
+	US_DEBUGP("-- %s\n", __FUNCTION__);
+
+	/* Free the device-related DMA-mapped buffers */
+	if (us->cr)
+		usb_buffer_free(us->pusb_dev, sizeof(*us->cr), us->cr,
+				us->cr_dma);
+	if (us->iobuf)
+		usb_buffer_free(us->pusb_dev, US_IOBUF_SIZE, us->iobuf,
+				us->iobuf_dma);
+
+	/* Remove our private data from the interface */
+	usb_set_intfdata(us->pusb_intf, NULL);
+
 	/* Free the structure itself */
 	kfree(us);
-	US_DEBUGP("-- %s finished\n", __FUNCTION__);
 }
 
 /* Probe to see if we can drive a newly-connected USB device */
@@ -889,6 +894,7 @@ static int storage_probe(struct usb_interface *intf,
 	init_MUTEX(&(us->dev_semaphore));
 	init_MUTEX_LOCKED(&(us->sema));
 	init_completion(&(us->notify));
+	init_waitqueue_head(&us->dev_reset_wait);
 
 	/* Associate the us_data structure with the USB device */
 	result = associate_dev(us, intf);
@@ -959,8 +965,8 @@ static int storage_probe(struct usb_interface *intf,
 	/* We come here if there are any problems */
 BadDevice:
 	US_DEBUGP("storage_probe() failed\n");
-	dissociate_dev(us);
 	usb_stor_release_resources(us);
+	dissociate_dev(us);
 	return result;
 }
 
@@ -971,20 +977,20 @@ static void storage_disconnect(struct usb_interface *intf)
 
 	US_DEBUGP("storage_disconnect() called\n");
 
-	/* Prevent new USB transfers and stop the current command */
+	/* Prevent new USB transfers, stop the current command, and
+	 * interrupt a device-reset delay */
 	set_bit(US_FLIDX_DISCONNECTING, &us->flags);
 	usb_stor_stop_transport(us);
+	wake_up(&us->dev_reset_wait);
 
-	/* Dissociate from the USB device */
-	dissociate_dev(us);
-
+	/* Wait for the current command to finish, then remove the host */
+	down(&us->dev_semaphore);
+	up(&us->dev_semaphore);
 	scsi_remove_host(us->host);
 
-	/* TODO: somehow, wait for the device to
-	 * be 'idle' (tasklet completion) */
-
-	/* Release all our other resources */
+	/* Wait for everything to become idle and release all our resources */
 	usb_stor_release_resources(us);
+	dissociate_dev(us);
 }
 
 /***********************************************************************
@@ -1017,47 +1023,6 @@ static void __exit usb_stor_exit(void)
 	 */
 	US_DEBUGP("-- calling usb_deregister()\n");
 	usb_deregister(&usb_storage_driver) ;
-
-#if 0
-	/* While there are still virtual hosts, unregister them
-	 * Note that it's important to do this completely before removing
-	 * the structures because of possible races with the /proc
-	 * interface
-	 */
-	for (next = us_list; next; next = next->next) {
-		US_DEBUGP("-- calling scsi_unregister_host()\n");
-		scsi_unregister_host(&usb_stor_host_template);
-	}
-
-	/* While there are still structures, free them.  Note that we are
-	 * now race-free, since these structures can no longer be accessed
-	 * from either the SCSI command layer or the /proc interface
-	 */
-	while (us_list) {
-		/* keep track of where the next one is */
-		next = us_list->next;
-
-		/* If there's extra data in the us_data structure then
-		 * free that first */
-		if (us_list->extra) {
-			/* call the destructor routine, if it exists */
-			if (us_list->extra_destructor) {
-				US_DEBUGP("-- calling extra_destructor()\n");
-				us_list->extra_destructor(us_list->extra);
-			}
-
-			/* destroy the extra data */
-			US_DEBUGP("-- freeing the data structure\n");
-			kfree(us_list->extra);
-		}
-
-		/* free the structure itself */
-		kfree (us_list);
-
-		/* advance the list pointer */
-		us_list = next;
-	}
-#endif
 }
 
 module_init(usb_stor_init);
diff --git a/drivers/usb/storage/usb.h b/drivers/usb/storage/usb.h
index 7ef571a17..35d01444a 100644
--- a/drivers/usb/storage/usb.h
+++ b/drivers/usb/storage/usb.h
@@ -158,9 +158,10 @@ struct us_data {
 	dma_addr_t		cr_dma;		 /* buffer DMA addresses */
 	dma_addr_t		iobuf_dma;
 
-	/* mutual exclusion structures */
+	/* mutual exclusion and synchronization structures */
 	struct semaphore	sema;		 /* to sleep thread on   */
-	struct completion	notify;		 /* thread begin/end	    */
+	struct completion	notify;		 /* thread begin/end	 */
+	wait_queue_head_t	dev_reset_wait;  /* wait during reset    */
 
 	/* subdriver information */
 	void			*extra;		 /* Any extra data          */
diff --git a/drivers/video/Kconfig b/drivers/video/Kconfig
index 4d58fc501..798ba0032 100644
--- a/drivers/video/Kconfig
+++ b/drivers/video/Kconfig
@@ -40,7 +40,7 @@ config FB
 
 config FB_CIRRUS
 	tristate "Cirrus Logic support"
-	depends on FB && (AMIGA || PCI) && BROKEN
+	depends on FB && (ZORRO || PCI)
 	---help---
 	  This enables support for Cirrus Logic GD542x/543x based boards on
 	  Amiga: SD64, Piccolo, Picasso II/II+, Picasso IV, or EGS Spectrum.
@@ -93,7 +93,7 @@ config FB_SA1100
 
 config FB_CYBER2000
 	tristate "CyberPro 2000/2010/5000 support"
-	depends on FB && PCI
+	depends on FB && PCI && (BROKEN || !SPARC64)
 	help
 	  This enables support for the Integraphics CyberPro 20x0 and 5000
 	  VGA chips used in the Rebel.com Netwinder and other machines.
@@ -238,7 +238,7 @@ config FB_IMSTT
 
 config FB_S3TRIO
 	bool "S3 Trio display support"
-	depends on FB && PPC
+	depends on FB && PPC && BROKEN
 	help
 	  If you have a S3 Trio say Y. Say N for S3 Virge.
 
@@ -424,6 +424,8 @@ config E1355_FB_BASE
 config FB_RIVA
 	tristate "nVidia Riva support"
 	depends on FB && PCI
+	select I2C_ALGOBIT if FB_RIVA_I2C
+	select I2C if FB_RIVA_I2C
 	help
 	  This driver supports graphics boards with the nVidia Riva/Geforce
 	  chips.
@@ -432,6 +434,27 @@ config FB_RIVA
 	  To compile this driver as a module, choose M here: the
 	  module will be called rivafb.
 
+config FB_RIVA_I2C
+       bool "Enable DDC Support"
+       depends on FB_RIVA
+       help
+	  This enables I2C support for nVidia Chipsets.  This is used
+	  only for getting EDID information from the attached display
+	  allowing for robust video mode handling and switching.
+
+	  Because fbdev-2.6 requires that drivers must be able to
+	  independently validate video mode parameters, you should say Y
+	  here.
+
+config FB_RIVA_DEBUG
+	bool "Lots of debug output from Riva(nVidia) driver"
+	depends on FB_RIVA
+	default n
+	help
+	  Say Y here if you want the Riva driver to output all sorts
+	  of debugging informations to provide to the maintainer when
+	  something goes wrong.
+
 config FB_I810
 	tristate "Intel 810/815 support (EXPERIMENTAL)"
 	depends on FB && AGP && AGP_INTEL && EXPERIMENTAL && PCI	
diff --git a/drivers/video/Makefile b/drivers/video/Makefile
index 22644fc8d..52e37a0fc 100644
--- a/drivers/video/Makefile
+++ b/drivers/video/Makefile
@@ -39,7 +39,7 @@ obj-$(CONFIG_FB_HP300)            += hpfb.o cfbfillrect.o cfbimgblt.o
 obj-$(CONFIG_FB_OF)               += offb.o cfbfillrect.o cfbimgblt.o cfbcopyarea.o
 obj-$(CONFIG_FB_IMSTT)            += imsttfb.o cfbimgblt.o
 obj-$(CONFIG_FB_RETINAZ3)         += retz3fb.o
-obj-$(CONFIG_FB_CIRRUS)		  += cirrusfb.o
+obj-$(CONFIG_FB_CIRRUS)		  += cirrusfb.o cfbfillrect.o cfbimgblt.o cfbcopyarea.o
 obj-$(CONFIG_FB_TRIDENT)	  += tridentfb.o cfbfillrect.o cfbimgblt.o cfbcopyarea.o
 obj-$(CONFIG_FB_S3TRIO)           += S3triofb.o
 obj-$(CONFIG_FB_TGA)              += tgafb.o cfbfillrect.o cfbcopyarea.o cfbimgblt.o 
diff --git a/drivers/video/acornfb.c b/drivers/video/acornfb.c
index d91a2f8dd..0c3aa4a7f 100644
--- a/drivers/video/acornfb.c
+++ b/drivers/video/acornfb.c
@@ -1246,6 +1246,8 @@ acornfb_detect_monitortype(void)
 
 /*
  * This enables the unused memory to be freed on older Acorn machines.
+ * We are freeing memory on behalf of the architecture initialisation
+ * code here.
  */
 static inline void
 free_unused_pages(unsigned int virtual_start, unsigned int virtual_end)
@@ -1268,7 +1270,7 @@ free_unused_pages(unsigned int virtual_start, unsigned int virtual_end)
 		 */
 		page = virt_to_page(virtual_start);
 		ClearPageReserved(page);
-		atomic_set(&page->count, 1);
+		set_page_count(page, 1);
 		free_page(virtual_start);
 
 		virtual_start += PAGE_SIZE;
diff --git a/drivers/video/amifb.c b/drivers/video/amifb.c
index f61cd6e43..95ea71c9b 100644
--- a/drivers/video/amifb.c
+++ b/drivers/video/amifb.c
@@ -1309,7 +1309,7 @@ static int amifb_set_par(struct fb_info *info)
 		info->fix.ypanstep = 0;
 	} else {
 		info->fix.ywrapstep = 0;
-		if (par->vmode &= FB_VMODE_SMOOTH_XPAN)
+		if (par->vmode & FB_VMODE_SMOOTH_XPAN)
 			info->fix.xpanstep = 1;
 		else
 			info->fix.xpanstep = 16<<maxfmode;
@@ -2351,7 +2351,7 @@ default_chipset:
 	 */
 
 	{
-	u_long tmp = DIVUL(200E9, amiga_eclock);
+	u_long tmp = DIVUL(200000000000ULL, amiga_eclock);
 
 	pixclock[TAG_SHRES] = (tmp + 4) / 8;	/* SHRES:  35 ns / 28 MHz */
 	pixclock[TAG_HIRES] = (tmp + 2) / 4;	/* HIRES:  70 ns / 14 MHz */
diff --git a/drivers/video/asiliantfb.c b/drivers/video/asiliantfb.c
index 034ec2996..1563b0d27 100644
--- a/drivers/video/asiliantfb.c
+++ b/drivers/video/asiliantfb.c
@@ -571,7 +571,7 @@ asiliantfb_pci_init(struct pci_dev *dp, const struct pci_device_id *ent)
 	}
 
 	pci_write_config_dword(dp, 4, 0x02800083);
-	writeb(3, addr + 0x400784);
+	writeb(3, p->screen_base + 0x400784);
 
 	init_asiliant(p, addr);
 
diff --git a/drivers/video/aty/aty128fb.c b/drivers/video/aty/aty128fb.c
index b19eded6c..1c7bcd80f 100644
--- a/drivers/video/aty/aty128fb.c
+++ b/drivers/video/aty/aty128fb.c
@@ -924,7 +924,7 @@ static void __init aty128_get_pllinfo(struct aty128fb_par *par, unsigned char *b
 
 }           
 
-#ifdef __i386__
+#ifdef CONFIG_X86
 static void *  __devinit aty128_find_mem_vbios(struct aty128fb_par *par)
 {
 	/* I simplified this code as we used to miss the signatures in
@@ -946,7 +946,7 @@ static void *  __devinit aty128_find_mem_vbios(struct aty128fb_par *par)
         }
 	return rom_base;
 }
-#endif /* __i386__ */
+#endif
 #endif /* ndef(__sparc__) */
 
 /* fill in known card constants if pll_block is not available */
@@ -1950,7 +1950,7 @@ static int __init aty128_probe(struct pci_dev *pdev, const struct pci_device_id
 
 #ifndef __sparc__
 	bios = aty128_map_ROM(par, pdev);
-#ifdef __i386__
+#ifdef CONFIG_X86
 	if (bios == NULL)
 		bios = aty128_find_mem_vbios(par);
 #endif
@@ -2149,7 +2149,7 @@ static int aty128fb_ioctl(struct inode *inode, struct file *file, u_int cmd,
 	case FBIO_ATY128_SET_MIRROR:
 		if (par->chip_gen != rage_M3)
 			return -EINVAL;
-		rc = get_user(value, (__u32*)arg);
+		rc = get_user(value, (__u32 __user *)arg);
 		if (rc)
 			return rc;
 		par->lcd_on = (value & 0x01) != 0;
@@ -2163,7 +2163,7 @@ static int aty128fb_ioctl(struct inode *inode, struct file *file, u_int cmd,
 		if (par->chip_gen != rage_M3)
 			return -EINVAL;
 		value = (par->crt_on << 1) | par->lcd_on;
-		return put_user(value, (__u32*)arg);
+		return put_user(value, (__u32 __user *)arg);
 	}
 #endif
 	return -EINVAL;
@@ -2419,7 +2419,7 @@ static int aty128_pci_resume(struct pci_dev *pdev)
 	wait_for_idle(par);
 	aty128fb_set_par(info);
 	fb_pan_display(info, &info->var);
-	fb_set_cmap(&info->cmap, 1, info);
+	fb_set_cmap(&info->cmap, info);
 
 	/* Refresh */
 	fb_set_suspend(info, 0);
diff --git a/drivers/video/aty/atyfb_base.c b/drivers/video/aty/atyfb_base.c
index 5e7c2d28a..37177bece 100644
--- a/drivers/video/aty/atyfb_base.c
+++ b/drivers/video/aty/atyfb_base.c
@@ -1037,7 +1037,7 @@ static int atyfb_ioctl(struct inode *inode, struct file *file, u_int cmd,
 		fbtyp.fb_cmsize = info->cmap.len;
 		fbtyp.fb_size = info->fix.smem_len;
 		if (copy_to_user
-		    ((struct fbtype *) arg, &fbtyp, sizeof(fbtyp)))
+		    ((struct fbtype __user *) arg, &fbtyp, sizeof(fbtyp)))
 			return -EFAULT;
 		break;
 #endif				/* __sparc__ */
@@ -1405,7 +1405,7 @@ static int aty_sleep_notify(struct pmu_sleep_notifier *self, int when)
 		case PBOOK_SLEEP_REJECT:
 			if (par->save_framebuffer) {
 				vfree(par->save_framebuffer);
-				par->save_framebuffer = 0;
+				par->save_framebuffer = NULL;
 			}
 			break;
 		case PBOOK_SLEEP_NOW:
@@ -1435,7 +1435,7 @@ static int aty_sleep_notify(struct pmu_sleep_notifier *self, int when)
 				memcpy_toio((void *) info->screen_base,
 					    par->save_framebuffer, nb);
 				vfree(par->save_framebuffer);
-				par->save_framebuffer = 0;
+				par->save_framebuffer = NULL;
 			}
 			/* Restore display */
 			atyfb_set_par(info);
diff --git a/drivers/video/aty/mach64_cursor.c b/drivers/video/aty/mach64_cursor.c
index 2b1bae9d5..d612fc4bc 100644
--- a/drivers/video/aty/mach64_cursor.c
+++ b/drivers/video/aty/mach64_cursor.c
@@ -182,7 +182,7 @@ struct aty_cursor *__init aty_init_cursor(struct fb_info *info)
 
 	cursor = kmalloc(sizeof(struct aty_cursor), GFP_ATOMIC);
 	if (!cursor)
-		return 0;
+		return NULL;
 	memset(cursor, 0, sizeof(*cursor));
 
 	info->fix.smem_len -= PAGE_SIZE;
diff --git a/drivers/video/aty/mach64_gx.c b/drivers/video/aty/mach64_gx.c
index f85f0a052..28540cf1e 100644
--- a/drivers/video/aty/mach64_gx.c
+++ b/drivers/video/aty/mach64_gx.c
@@ -653,7 +653,7 @@ static int aty_var_to_pll_8398(const struct fb_info *info,
 
 		for (m = MIN_M; m <= MAX_M; m++) {
 			for (n = MIN_N; n <= MAX_N; n++) {
-				tempA = (14.31818 * 65536);
+				tempA = 938356;		/* 14.31818 * 65536 */
 				tempA *= (n + 8);	/* 43..256 */
 				tempB = twoToKth * 256;
 				tempB *= (m + 2);	/* 4..32 */
diff --git a/drivers/video/aty/radeon_accel.c b/drivers/video/aty/radeon_accel.c
index 82614b4b4..e3883cff1 100644
--- a/drivers/video/aty/radeon_accel.c
+++ b/drivers/video/aty/radeon_accel.c
@@ -33,13 +33,13 @@ void radeonfb_fillrect(struct fb_info *info, const struct fb_fillrect *region)
   
 	if (info->state != FBINFO_STATE_RUNNING)
 		return;
-	if (radeon_accel_disabled()) {
+	if (info->flags & FBINFO_HWACCEL_DISABLED) {
 		cfb_fillrect(info, region);
 		return;
 	}
 
-	vxres = info->var.xres;
-	vyres = info->var.yres;
+	vxres = info->var.xres_virtual;
+	vyres = info->var.yres_virtual;
 
 	memcpy(&modded, region, sizeof(struct fb_fillrect));
 
@@ -71,9 +71,10 @@ static void radeonfb_prim_copyarea(struct radeonfb_info *rinfo,
 	radeon_fifo_wait(3);
 	OUTREG(DP_GUI_MASTER_CNTL,
 		rinfo->dp_gui_master_cntl /* i.e. GMC_DST_32BPP */
+		| GMC_BRUSH_NONE
 		| GMC_SRC_DSTCOLOR
 		| ROP3_S 
-		| DP_SRC_RECT );
+		| DP_SRC_SOURCE_MEMORY );
 	OUTREG(DP_WRITE_MSK, 0xffffffff);
 	OUTREG(DP_CNTL, (xdir>=0 ? DST_X_LEFT_TO_RIGHT : 0)
 			| (ydir>=0 ? DST_Y_TOP_TO_BOTTOM : 0));
@@ -99,13 +100,13 @@ void radeonfb_copyarea(struct fb_info *info, const struct fb_copyarea *area)
   
 	if (info->state != FBINFO_STATE_RUNNING)
 		return;
-	if (radeon_accel_disabled()) {
+	if (info->flags & FBINFO_HWACCEL_DISABLED) {
 		cfb_copyarea(info, area);
 		return;
 	}
 
-	vxres = info->var.xres;
-	vyres = info->var.yres;
+	vxres = info->var.xres_virtual;
+	vyres = info->var.yres_virtual;
 
 	if(!modded.width || !modded.height ||
 	   modded.sx >= vxres || modded.sy >= vyres ||
diff --git a/drivers/video/aty/radeon_base.c b/drivers/video/aty/radeon_base.c
index d88079eb9..bd3b24caa 100644
--- a/drivers/video/aty/radeon_base.c
+++ b/drivers/video/aty/radeon_base.c
@@ -242,8 +242,6 @@ static int force_measure_pll = 0;
 static int nomtrr = 0;
 #endif
 
-int radeonfb_noaccel = 0;
-
 /*
  * prototypes
  */
@@ -388,7 +386,7 @@ static int __devinit radeon_map_ROM(struct radeonfb_info *rinfo, struct pci_dev
 	return -ENXIO;
 }
 
-#ifdef __i386__
+#ifdef CONFIG_X86
 static int  __devinit radeon_find_mem_vbios(struct radeonfb_info *rinfo)
 {
 	/* I simplified this code as we used to miss the signatures in
@@ -417,7 +415,7 @@ static int  __devinit radeon_find_mem_vbios(struct radeonfb_info *rinfo)
 
 	return 0;
 }
-#endif /* __i386__ */
+#endif
 
 #ifdef CONFIG_PPC_OF
 /*
@@ -434,7 +432,7 @@ static int __devinit radeon_read_xtal_OF (struct radeonfb_info *rinfo)
 		printk(KERN_WARNING "radeonfb: Cannot match card to OF node !\n");
 		return -ENODEV;
 	}
-	val = (u32 *) get_property(dp, "ATY,RefCLK", 0);
+	val = (u32 *) get_property(dp, "ATY,RefCLK", NULL);
 	if (!val || !*val) {
 		printk(KERN_WARNING "radeonfb: No ATY,RefCLK property !\n");
 		return -EINVAL;
@@ -442,11 +440,11 @@ static int __devinit radeon_read_xtal_OF (struct radeonfb_info *rinfo)
 
 	rinfo->pll.ref_clk = (*val) / 10;
 
-	val = (u32 *) get_property(dp, "ATY,SCLK", 0);
+	val = (u32 *) get_property(dp, "ATY,SCLK", NULL);
 	if (val && *val)
 		rinfo->pll.sclk = (*val) / 10;
 
-	val = (u32 *) get_property(dp, "ATY,MCLK", 0);
+	val = (u32 *) get_property(dp, "ATY,MCLK", NULL);
 	if (val && *val)
 		rinfo->pll.mclk = (*val) / 10;
 
@@ -810,9 +808,8 @@ static int radeonfb_check_var (struct fb_var_screeninfo *var, struct fb_info *in
 	/* XXX I'm adjusting xres_virtual to the pitch, that may help XFree
 	 * with some panels, though I don't quite like this solution
 	 */
-  	if (radeon_accel_disabled()) {
+  	if (rinfo->info->flags & FBINFO_HWACCEL_DISABLED) {
 		v.xres_virtual = v.xres_virtual & ~7ul;
-		v.accel_flags = 0;
 	} else {
 		pitch = ((v.xres_virtual * ((v.bits_per_pixel + 1) / 8) + 0x3f)
  				& ~(0x3f)) >> 6;
@@ -858,6 +855,7 @@ static int radeonfb_pan_display (struct fb_var_screeninfo *var,
         if (rinfo->asleep)
         	return 0;
 
+	radeon_fifo_wait(2);
         OUTREG(CRTC_OFFSET, ((var->yoffset * var->xres_virtual + var->xoffset)
 			     * var->bits_per_pixel / 8) & ~7);
         return 0;
@@ -882,11 +880,12 @@ static int radeonfb_ioctl (struct inode *inode, struct file *file, unsigned int
 			if (!rinfo->is_mobility)
 				return -EINVAL;
 
-			rc = get_user(value, (__u32*)arg);
+			rc = get_user(value, (__u32 __user *)arg);
 
 			if (rc)
 				return rc;
 
+			radeon_fifo_wait(2);
 			if (value & 0x01) {
 				tmp = INREG(LVDS_GEN_CNTL);
 
@@ -926,7 +925,7 @@ static int radeonfb_ioctl (struct inode *inode, struct file *file, unsigned int
 			if (CRTC_CRT_ON & tmp)
 				value |= 0x02;
 
-			return put_user(value, (__u32*)arg);
+			return put_user(value, (__u32 __user *)arg);
 		default:
 			return -EINVAL;
 	}
@@ -963,6 +962,7 @@ static int radeon_screen_blank (struct radeonfb_info *rinfo, int blank)
                         break;
         }
 
+	radeon_fifo_wait(1);
 	switch (rinfo->mon1_type) {
 		case MT_LCD:
 			OUTREG(LVDS_GEN_CNTL, val2);
@@ -1021,6 +1021,7 @@ static int radeonfb_setcolreg (unsigned regno, unsigned red, unsigned green,
         if (!rinfo->asleep) {
         	u32 dac_cntl2, vclk_cntl = 0;
         	
+		radeon_fifo_wait(9);
 		if (rinfo->is_mobility) {
 			vclk_cntl = INPLL(VCLK_ECP_CNTL);
 			OUTPLL(VCLK_ECP_CNTL, vclk_cntl & ~PIXCLK_DAC_ALWAYS_ONb);
@@ -1112,6 +1113,8 @@ static void radeon_write_pll_regs(struct radeonfb_info *rinfo, struct radeon_reg
 {
 	int i;
 
+	radeon_fifo_wait(20);
+
 	/* Workaround from XFree */
 	if (rinfo->is_mobility) {
 	        /* A temporal workaround for the occational blanking on certain laptop panels. 
@@ -1198,6 +1201,8 @@ static void radeon_lvds_timer_func(unsigned long data)
 {
 	struct radeonfb_info *rinfo = (struct radeonfb_info *)data;
 
+	radeon_fifo_wait(3);
+
 	OUTREG(LVDS_GEN_CNTL, rinfo->pending_lvds_gen_cntl);
 	if (rinfo->pending_pixclks_cntl) {
 		OUTPLL(PIXCLKS_CNTL, rinfo->pending_pixclks_cntl);
@@ -1222,6 +1227,7 @@ static void radeon_write_mode (struct radeonfb_info *rinfo,
 
 	radeon_screen_blank(rinfo, VESA_POWERDOWN);
 
+	radeon_fifo_wait(31);
 	for (i=0; i<10; i++)
 		OUTREG(common_regs[i].reg, common_regs[i].val);
 
@@ -1249,6 +1255,7 @@ static void radeon_write_mode (struct radeonfb_info *rinfo,
 	radeon_write_pll_regs(rinfo, mode);
 
 	if ((primary_mon == MT_DFP) || (primary_mon == MT_LCD)) {
+		radeon_fifo_wait(10);
 		OUTREG(FP_CRTC_H_TOTAL_DISP, mode->fp_crtc_h_total_disp);
 		OUTREG(FP_CRTC_V_TOTAL_DISP, mode->fp_crtc_v_total_disp);
 		OUTREG(FP_H_SYNC_STRT_WID, mode->fp_h_sync_strt_wid);
@@ -1288,6 +1295,7 @@ static void radeon_write_mode (struct radeonfb_info *rinfo,
 
 	radeon_screen_blank(rinfo, VESA_NO_BLANKING);
 
+	radeon_fifo_wait(2);
 	OUTPLL(VCLK_ECP_CNTL, mode->vclk_ecp_cntl);
 	
 	return;
@@ -1524,7 +1532,7 @@ int radeonfb_set_par(struct fb_info *info)
 	newmode.crtc_v_sync_strt_wid = (((vSyncStart - 1) & 0xfff) |
 					 (vsync_wid << 16) | (v_sync_pol  << 23));
 
-	if (!radeon_accel_disabled()) {
+	if (!(info->flags & FBINFO_HWACCEL_DISABLED)) {
 		/* We first calculate the engine pitch */
 		rinfo->pitch = ((mode->xres_virtual * ((mode->bits_per_pixel + 1) / 8) + 0x3f)
  				& ~(0x3f)) >> 6;
@@ -1672,12 +1680,11 @@ int radeonfb_set_par(struct fb_info *info)
 	if (!rinfo->asleep) {
 		radeon_write_mode (rinfo, &newmode);
 		/* (re)initialize the engine */
-		if (!radeon_accel_disabled())
+		if (!(info->flags & FBINFO_HWACCEL_DISABLED))
 			radeonfb_engine_init (rinfo);
-	
 	}
 	/* Update fix */
-	if (!radeon_accel_disabled())
+	if (!(info->flags & FBINFO_HWACCEL_DISABLED))
         	info->fix.line_length = rinfo->pitch*64;
         else
 		info->fix.line_length = mode->xres_virtual
@@ -1696,7 +1703,7 @@ int radeonfb_set_par(struct fb_info *info)
 
 
 
-static ssize_t radeonfb_read(struct file *file, char *buf, size_t count, loff_t *ppos)
+static ssize_t radeonfb_read(struct file *file, char __user *buf, size_t count, loff_t *ppos)
 {
 	unsigned long p = *ppos;
 	struct inode *inode = file->f_dentry->d_inode;
@@ -1723,7 +1730,7 @@ static ssize_t radeonfb_read(struct file *file, char *buf, size_t count, loff_t
 	return count;
 }
 
-static ssize_t radeonfb_write(struct file *file, const char *buf, size_t count,
+static ssize_t radeonfb_write(struct file *file, const char __user *buf, size_t count,
 			      loff_t *ppos)
 {
 	unsigned long p = *ppos;
@@ -1782,9 +1789,13 @@ static int __devinit radeon_set_fbinfo (struct radeonfb_info *rinfo)
 	info->currcon = -1;
 	info->par = rinfo;
 	info->pseudo_palette = rinfo->pseudo_palette;
-        info->flags = FBINFO_FLAG_DEFAULT;
-        info->fbops = &radeonfb_ops;
-        info->screen_base = (char *)rinfo->fb_base;
+	info->flags = FBINFO_DEFAULT
+		    | FBINFO_HWACCEL_COPYAREA
+		    | FBINFO_HWACCEL_FILLRECT
+		    | FBINFO_HWACCEL_XPAN
+		    | FBINFO_HWACCEL_YPAN;
+	info->fbops = &radeonfb_ops;
+	info->screen_base = (char *)rinfo->fb_base;
 
 	/* Fill fix common fields */
 	strlcpy(info->fix.id, rinfo->name, sizeof(info->fix.id));
@@ -1798,17 +1809,11 @@ static int __devinit radeon_set_fbinfo (struct radeonfb_info *rinfo)
         info->fix.type_aux = 0;
         info->fix.mmio_start = rinfo->mmio_base_phys;
         info->fix.mmio_len = RADEON_REGSIZE;
-	if (radeon_accel_disabled())
-	        info->fix.accel = FB_ACCEL_NONE;
-	else
-		info->fix.accel = FB_ACCEL_ATI_RADEON;
 
 	fb_alloc_cmap(&info->cmap, 256, 0);
 
-	if (radeon_accel_disabled())
-		info->var.accel_flags &= ~FB_ACCELF_TEXT;
-	else
-		info->var.accel_flags |= FB_ACCELF_TEXT;
+	if (noaccel)
+		info->flags |= FBINFO_HWACCEL_DISABLED;
 
         return 0;
 }
@@ -1864,6 +1869,7 @@ static int radeon_set_backlight_enable(int on, int level, void *data)
 	del_timer_sync(&rinfo->lvds_timer);
 
 	lvds_gen_cntl |= (LVDS_BL_MOD_EN | LVDS_BLON);
+	radeon_fifo_wait(3);
 	if (on && (level > BACKLIGHT_OFF)) {
 		lvds_gen_cntl |= LVDS_DIGON;
 		if (!(lvds_gen_cntl & LVDS_ON)) {
@@ -2136,6 +2142,7 @@ static int radeonfb_pci_register (struct pci_dev *pdev,
           u32 tom = INREG(NB_TOM);
           tmp = ((((tom >> 16) - (tom & 0xffff) + 1) << 6) * 1024);
  
+ 		radeon_fifo_wait(6);
           OUTREG(MC_FB_LOCATION, tom);
           OUTREG(DISPLAY_BASE_ADDR, (tom & 0xffff) << 16);
           OUTREG(CRTC2_DISPLAY_BASE_ADDR, (tom & 0xffff) << 16);
@@ -2255,20 +2262,34 @@ static int radeonfb_pci_register (struct pci_dev *pdev,
 
 	/*
 	 * Map the BIOS ROM if any and retreive PLL parameters from
-	 * either BIOS or Open Firmware
+	 * the BIOS. We skip that on mobility chips as the real panel
+	 * values we need aren't in the ROM but in the BIOS image in
+	 * memory. This is definitely not the best meacnism though,
+	 * we really need the arch code to tell us which is the "primary"
+	 * video adapter to use the memory image (or better, the arch
+	 * should provide us a copy of the BIOS image to shield us from
+	 * archs who would store that elsewhere and/or could initialize
+	 * more than one adapter during boot).
 	 */
-	radeon_map_ROM(rinfo, pdev);
+	if (!rinfo->is_mobility)
+		radeon_map_ROM(rinfo, pdev);
 
 	/*
 	 * On x86, the primary display on laptop may have it's BIOS
 	 * ROM elsewhere, try to locate it at the legacy memory hole.
-	 * We probably need to make sure this is the primary dispay,
+	 * We probably need to make sure this is the primary display,
 	 * but that is difficult without some arch support.
 	 */
-#ifdef __i386__
+#ifdef CONFIG_X86
 	if (rinfo->bios_seg == NULL)
 		radeon_find_mem_vbios(rinfo);
-#endif /* __i386__ */
+#endif
+
+	/* If both above failed, try the BIOS ROM again for mobility
+	 * chips
+	 */
+	if (rinfo->bios_seg == NULL && rinfo->is_mobility)
+		radeon_map_ROM(rinfo, pdev);
 
 	/* Get informations about the board's PLL */
 	radeon_get_pllinfo(rinfo);
@@ -2424,7 +2445,6 @@ static struct pci_driver radeonfb_driver = {
 
 int __init radeonfb_init (void)
 {
-	radeonfb_noaccel = noaccel;
 	return pci_module_init (&radeonfb_driver);
 }
 
@@ -2446,7 +2466,7 @@ int __init radeonfb_setup (char *options)
 			continue;
 
 		if (!strncmp(this_opt, "noaccel", 7)) {
-			noaccel = radeonfb_noaccel = 1;
+			noaccel = 1;
 		} else if (!strncmp(this_opt, "mirror", 6)) {
 			mirror = 1;
 		} else if (!strncmp(this_opt, "force_dfp", 9)) {
diff --git a/drivers/video/aty/radeon_pm.c b/drivers/video/aty/radeon_pm.c
index c5e37bdbb..c26f43c04 100644
--- a/drivers/video/aty/radeon_pm.c
+++ b/drivers/video/aty/radeon_pm.c
@@ -319,24 +319,30 @@ static void radeon_pm_disable_iopad(struct radeonfb_info *rinfo)
 
 static void radeon_pm_program_v2clk(struct radeonfb_info *rinfo)
 {
+	/* we use __INPLL and _OUTPLL and do the locking ourselves... */
+	unsigned long flags;
+	spin_lock_irqsave(&rinfo->reg_lock, flags);
 	/* Set v2clk to 65MHz */
-  	OUTPLL(pllPIXCLKS_CNTL,
-  		INPLL(pllPIXCLKS_CNTL) & ~PIXCLKS_CNTL__PIX2CLK_SRC_SEL_MASK);
+  	__OUTPLL(pllPIXCLKS_CNTL,
+  		__INPLL(rinfo, pllPIXCLKS_CNTL) & ~PIXCLKS_CNTL__PIX2CLK_SRC_SEL_MASK);
 	 
-  	OUTPLL(pllP2PLL_REF_DIV, 0x0000000c);
-	OUTPLL(pllP2PLL_CNTL, 0x0000bf00);
-	OUTPLL(pllP2PLL_DIV_0, 0x00020074 | P2PLL_DIV_0__P2PLL_ATOMIC_UPDATE_W);
+  	__OUTPLL(pllP2PLL_REF_DIV, 0x0000000c);
+	__OUTPLL(pllP2PLL_CNTL, 0x0000bf00);
+	__OUTPLL(pllP2PLL_DIV_0, 0x00020074 | P2PLL_DIV_0__P2PLL_ATOMIC_UPDATE_W);
 	
-	OUTPLL(pllP2PLL_CNTL, INPLL(pllP2PLL_CNTL) & ~P2PLL_CNTL__P2PLL_SLEEP);
+	__OUTPLL(pllP2PLL_CNTL,
+		__INPLL(rinfo, pllP2PLL_CNTL) & ~P2PLL_CNTL__P2PLL_SLEEP);
 	mdelay(1);
 
-	OUTPLL(pllP2PLL_CNTL, INPLL(pllP2PLL_CNTL) & ~P2PLL_CNTL__P2PLL_RESET); 	
+	__OUTPLL(pllP2PLL_CNTL,
+		__INPLL(rinfo, pllP2PLL_CNTL) & ~P2PLL_CNTL__P2PLL_RESET);
 	mdelay( 1);
 
-  	OUTPLL(pllPIXCLKS_CNTL,
-  		(INPLL(pllPIXCLKS_CNTL) & ~PIXCLKS_CNTL__PIX2CLK_SRC_SEL_MASK)
+  	__OUTPLL(pllPIXCLKS_CNTL,
+  		(__INPLL(rinfo, pllPIXCLKS_CNTL) & ~PIXCLKS_CNTL__PIX2CLK_SRC_SEL_MASK)
   		| (0x03 << PIXCLKS_CNTL__PIX2CLK_SRC_SEL__SHIFT));
 	mdelay( 1);	
+	spin_unlock_irqrestore(&rinfo->reg_lock, flags);
 }
 
 static void radeon_pm_low_current(struct radeonfb_info *rinfo)
@@ -391,7 +397,7 @@ static void radeon_pm_setup_for_suspend(struct radeonfb_info *rinfo)
 	u32 pixclks_cntl;
 	u32 disp_mis_cntl;
 	u32 disp_pwr_man;
-
+	u32 tmp;
 	
 	/* Force Core Clocks */
 	sclk_cntl = INPLL( pllSCLK_CNTL_M6);
@@ -496,7 +502,10 @@ static void radeon_pm_setup_for_suspend(struct radeonfb_info *rinfo)
 	clk_pin_cntl = INPLL( pllCLK_PIN_CNTL);
 	
 	clk_pin_cntl &= ~CLK_PIN_CNTL__ACCESS_REGS_IN_SUSPEND;
-	OUTPLL( pllMCLK_MISC, INPLL( pllMCLK_MISC) | MCLK_MISC__EN_MCLK_TRISTATE_IN_SUSPEND);	
+
+	/* because both INPLL and OUTPLL take the same lock, that's why. */
+	tmp = INPLL( pllMCLK_MISC) | MCLK_MISC__EN_MCLK_TRISTATE_IN_SUSPEND;
+	OUTPLL( pllMCLK_MISC, tmp);
 	
 	/* AGP PLL control */
 	OUTREG(BUS_CNTL1, INREG(BUS_CNTL1) |  BUS_CNTL1__AGPCLK_VALID);
@@ -516,7 +525,9 @@ static void radeon_pm_setup_for_suspend(struct radeonfb_info *rinfo)
 		| (0x20<<AGP_CNTL__MAX_IDLE_CLK__SHIFT));
 
 	/* ACPI mode */
-	OUTPLL( pllPLL_PWRMGT_CNTL, INPLL( pllPLL_PWRMGT_CNTL) & ~PLL_PWRMGT_CNTL__PM_MODE_SEL);					
+	/* because both INPLL and OUTPLL take the same lock, that's why. */
+	tmp = INPLL( pllPLL_PWRMGT_CNTL) & ~PLL_PWRMGT_CNTL__PM_MODE_SEL;
+	OUTPLL( pllPLL_PWRMGT_CNTL, tmp);
 
 
 	disp_mis_cntl = INREG(DISP_MISC_CNTL);
@@ -767,6 +778,7 @@ static void radeon_pm_full_reset_sdram(struct radeonfb_info *rinfo)
 static void radeon_set_suspend(struct radeonfb_info *rinfo, int suspend)
 {
 	u16 pwr_cmd;
+	u32 tmp;
 
 	if (!rinfo->pm_reg)
 		return;
@@ -802,7 +814,9 @@ static void radeon_set_suspend(struct radeonfb_info *rinfo, int suspend)
 			radeon_pm_setup_for_suspend(rinfo);
 
 			/* Reset the MDLL */
-			OUTPLL( pllMDLL_CKO, INPLL( pllMDLL_CKO) | MDLL_CKO__MCKOA_RESET | MDLL_CKO__MCKOB_RESET);
+			/* because both INPLL and OUTPLL take the same lock, that's why. */
+			tmp = INPLL( pllMDLL_CKO) | MDLL_CKO__MCKOA_RESET | MDLL_CKO__MCKOB_RESET;
+			OUTPLL( pllMDLL_CKO, tmp );
 		}
 
 		/* Switch PCI power managment to D2. */
@@ -859,7 +873,7 @@ int radeonfb_pci_suspend(struct pci_dev *pdev, u32 state)
 
 	fb_set_suspend(info, 1);
 
-	if (!radeon_accel_disabled()) {
+	if (!(info->flags & FBINFO_HWACCEL_DISABLED)) {
 		/* Make sure engine is reset */
 		radeon_engine_idle();
 		radeonfb_engine_reset(rinfo);
@@ -908,7 +922,7 @@ int radeonfb_pci_resume(struct pci_dev *pdev)
 	/* Restore display & engine */
 	radeonfb_set_par(info);
 	fb_pan_display(info, &info->var);
-	fb_set_cmap(&info->cmap, 1, info);
+	fb_set_cmap(&info->cmap, info);
 
 	/* Refresh */
 	fb_set_suspend(info, 0);
diff --git a/drivers/video/aty/radeonfb.h b/drivers/video/aty/radeonfb.h
index dd26c0242..87223df80 100644
--- a/drivers/video/aty/radeonfb.h
+++ b/drivers/video/aty/radeonfb.h
@@ -516,12 +516,6 @@ static inline void _radeon_engine_idle (struct radeonfb_info *rinfo)
 	printk(KERN_ERR "radeonfb: Idle Timeout !\n");
 }
 
-static inline int radeon_accel_disabled(void)
-{
-	extern int radeonfb_noaccel;
-	return radeonfb_noaccel;
-}
-
 #define radeon_engine_idle()		_radeon_engine_idle(rinfo)
 #define radeon_fifo_wait(entries)	_radeon_fifo_wait(rinfo,entries)
 
diff --git a/drivers/video/cg14.c b/drivers/video/cg14.c
index 40d28baf4..e0fc4c02c 100644
--- a/drivers/video/cg14.c
+++ b/drivers/video/cg14.c
@@ -278,7 +278,7 @@ static int cg14_ioctl(struct inode *inode, struct file *file, unsigned int cmd,
 {
 	struct cg14_par *par = (struct cg14_par *) info->par;
 	struct cg14_regs *regs = par->regs;
-	struct mdi_cfginfo kmdi, *mdii;
+	struct mdi_cfginfo kmdi, __user *mdii;
 	unsigned long flags;
 	int cur_mode, mode, ret = 0;
 
@@ -301,13 +301,13 @@ static int cg14_ioctl(struct inode *inode, struct file *file, unsigned int cmd,
 		kmdi.mdi_size = par->ramsize;
 		spin_unlock_irqrestore(&par->lock, flags);
 
-		mdii = (struct mdi_cfginfo *) arg;
+		mdii = (struct mdi_cfginfo __user *) arg;
 		if (copy_to_user(mdii, &kmdi, sizeof(kmdi)))
 			ret = -EFAULT;
 		break;
 
 	case MDI_SET_PIXELMODE:
-		if (get_user(mode, (int *) arg)) {
+		if (get_user(mode, (int __user *) arg)) {
 			ret = -EFAULT;
 			break;
 		}
diff --git a/drivers/video/chipsfb.c b/drivers/video/chipsfb.c
index 114afca02..c804352c0 100644
--- a/drivers/video/chipsfb.c
+++ b/drivers/video/chipsfb.c
@@ -493,7 +493,7 @@ chips_sleep_notify(struct pmu_sleep_notifier *self, int when)
 	case PBOOK_SLEEP_REJECT:
 		if (save_framebuffer) {
 			vfree(save_framebuffer);
-			save_framebuffer = 0;
+			save_framebuffer = NULL;
 		}
 		break;
 	case PBOOK_SLEEP_NOW:
@@ -505,7 +505,7 @@ chips_sleep_notify(struct pmu_sleep_notifier *self, int when)
 		if (save_framebuffer) {
 			memcpy(p->screen_base, save_framebuffer, nb);
 			vfree(save_framebuffer);
-			save_framebuffer = 0;
+			save_framebuffer = NULL;
 		}
 		chipsfb_blank(0, p);
 		break;
diff --git a/drivers/video/cirrusfb.c b/drivers/video/cirrusfb.c
index 237ec2ee5..82c26b15c 100644
--- a/drivers/video/cirrusfb.c
+++ b/drivers/video/cirrusfb.c
@@ -1,10 +1,13 @@
 /*
- * drivers/video/clgenfb.c - driver for Cirrus Logic chipsets
+ * drivers/video/cirrusfb.c - driver for Cirrus Logic chipsets
  *
  * Copyright 1999-2001 Jeff Garzik <jgarzik@pobox.com>
  *
  * Contributors (thanks, all!)
  *
+ *	David Eger:
+ *	Overhaul for Linux 2.6
+ *
  *      Jeff Rugen:
  *      Major contributions;  Motorola PowerStack (PPC and PCI) support,
  *      GD54xx, 1280x1024 mode support, change MCLK based on VCLK.
@@ -15,9 +18,9 @@
  *	Lars Hecking:
  *	Amiga updates and testing.
  *
- * Original clgenfb author:  Frank Neumann
+ * Original cirrusfb author:  Frank Neumann
  *
- * Based on retz3fb.c and clgen.c:
+ * Based on retz3fb.c and cirrusfb.c:
  *      Copyright (C) 1997 Jes Sorensen
  *      Copyright (C) 1996 Frank Neumann
  *
@@ -31,7 +34,7 @@
  *
  */
 
-#define CLGEN_VERSION "1.9.9.1"
+#define CIRRUSFB_VERSION "2.0-pre2"
 
 #include <linux/config.h>
 #include <linux/module.h>
@@ -63,15 +66,8 @@
 #define isPReP 0
 #endif
 
-#include <video/fbcon.h>
-#include <video/fbcon-mfb.h>
-#include <video/fbcon-cfb8.h>
-#include <video/fbcon-cfb16.h>
-#include <video/fbcon-cfb24.h>
-#include <video/fbcon-cfb32.h>
-
-#include "clgenfb.h"
-#include "vga.h"
+#include "video/vga.h"
+#include "video/cirrus.h"
 
 
 /*****************************************************************
@@ -81,20 +77,20 @@
  */
 
 /* enable debug output? */
-/* #define CLGEN_DEBUG 1 */
+/* #define CIRRUSFB_DEBUG 1 */
 
 /* disable runtime assertions? */
-/* #define CLGEN_NDEBUG */
+/* #define CIRRUSFB_NDEBUG */
 
 /* debug output */
-#ifdef CLGEN_DEBUG
+#ifdef CIRRUSFB_DEBUG
 #define DPRINTK(fmt, args...) printk(KERN_DEBUG "%s: " fmt, __FUNCTION__ , ## args)
 #else
 #define DPRINTK(fmt, args...)
 #endif
 
 /* debugging assertions */
-#ifndef CLGEN_NDEBUG
+#ifndef CIRRUSFB_NDEBUG
 #define assert(expr) \
         if(!(expr)) { \
         printk( "Assertion failed! %s,%s,%s,line=%d\n",\
@@ -136,24 +132,22 @@ typedef enum {
 	BT_ALPINE,	/* GD543x/4x */
 	BT_GD5480,
 	BT_LAGUNA,	/* GD546x */
-} clgen_board_t;
+} cirrusfb_board_t;
 
 
 /*
  * per-board-type information, used for enumerating and abstracting
  * chip-specific information
- * NOTE: MUST be in the same order as clgen_board_t in order to
+ * NOTE: MUST be in the same order as cirrusfb_board_t in order to
  * use direct indexing on this array
  * NOTE: '__initdata' cannot be used as some of this info
  * is required at runtime.  Maybe separate into an init-only and
  * a run-time table?
  */
-static const struct clgen_board_info_rec {
-	clgen_board_t btype;	/* chipset enum, not strictly necessary, as
-				 * clgen_board_info[] is directly indexed
-				 * by this value */
+static const struct cirrusfb_board_info_rec {
 	char *name;		/* ASCII name of chipset */
-	long maxclock;		/* maximum video clock */
+	long maxclock[5];		/* maximum video clock */
+	/* for  1/4bpp, 8bpp 15/16bpp, 24bpp, 32bpp - numbers from xorg code */
 	unsigned init_sr07 : 1;	/* init SR07 during init_vgachip() */
 	unsigned init_sr1f : 1; /* write SR1F during init_vgachip() */
 	unsigned scrn_start_bit19 : 1; /* construct bit 19 of screen start address */
@@ -166,164 +160,192 @@ static const struct clgen_board_info_rec {
 	unsigned char sr07_8bpp_mux;
 
 	unsigned char sr1f;	/* SR1F VGA initial register value */
-} clgen_board_info[] = {
-	{ BT_NONE, }, /* dummy record */
-	{ BT_SD64,
-		"CL SD64",
-		140000,		/* the SD64/P4 have a higher max. videoclock */
-		TRUE,
-		TRUE,
-		TRUE,
-		0xF0,
-		0xF0,
-		0,		/* unused, does not multiplex */
-		0xF1,
-		0,		/* unused, does not multiplex */
-		0x20 },
-	{ BT_PICCOLO,
-		"CL Piccolo",
-		90000,
-		TRUE,
-		TRUE,
-		FALSE,
-		0x80,
-		0x80,
-		0,		/* unused, does not multiplex */
-		0x81,
-		0,		/* unused, does not multiplex */
-		0x22 },
-	{ BT_PICASSO,
-		"CL Picasso",
-		90000,
-		TRUE,
-		TRUE,
-		FALSE,
-		0x20,
-		0x20,
-		0,		/* unused, does not multiplex */
-		0x21,
-		0,		/* unused, does not multiplex */
-		0x22 },
-	{ BT_SPECTRUM,
-		"CL Spectrum",
-		90000,
-		TRUE,
-		TRUE,
-		FALSE,
-		0x80,
-		0x80,
-		0,		/* unused, does not multiplex */
-		0x81,
-		0,		/* unused, does not multiplex */
-		0x22 },
-	{ BT_PICASSO4,
-		"CL Picasso4",
-		140000,		/* the SD64/P4 have a higher max. videoclock */
-		TRUE,
-		FALSE,
-		TRUE,
-		0x20,
-		0x20,
-		0,		/* unused, does not multiplex */
-		0x21,
-		0,		/* unused, does not multiplex */
-		0 },
-	{ BT_ALPINE,
-		"CL Alpine",
-		110000,		/* 135100 for some, 85500 for others */
-		TRUE,
-		TRUE,
-		TRUE,
-		0xA0,
-		0xA1,
-		0xA7,
-		0xA1,
-		0xA7,
-		0x1C },
-	{ BT_GD5480,
-		"CL GD5480",
-		90000,
-		TRUE,
-		TRUE,
-		TRUE,
-		0x10,
-		0x11,
-		0,		/* unused, does not multiplex */
-		0x11,
-		0,		/* unused, does not multiplex */
-		0x1C },
-	{ BT_LAGUNA,
-		"CL Laguna",
-		135100,
-		FALSE,
-		FALSE,
-		TRUE,
-		0,		/* unused */
-		0,		/* unused */
-		0,		/* unused */
-		0,		/* unused */
-		0,		/* unused */
-		0 },		/* unused */
+} cirrusfb_board_info[] = {
+	[BT_SD64] = {
+		.name			= "CL SD64",
+		.maxclock		= {
+			/* guess */
+			/* the SD64/P4 have a higher max. videoclock */
+			140000, 140000, 140000, 140000, 140000,
+		},
+		.init_sr07		= TRUE,
+		.init_sr1f		= TRUE,
+		.scrn_start_bit19	= TRUE,
+		.sr07			= 0xF0,
+		.sr07_1bpp		= 0xF0,
+		.sr07_8bpp		= 0xF1,
+		.sr1f			= 0x20
+	},
+	[BT_PICCOLO] = {
+		.name			= "CL Piccolo",
+		.maxclock		= {
+			/* guess */
+			90000, 90000, 90000, 90000, 90000
+		},
+		.init_sr07		= TRUE,
+		.init_sr1f		= TRUE,
+		.scrn_start_bit19	= FALSE,
+		.sr07			= 0x80,
+		.sr07_1bpp		= 0x80,
+		.sr07_8bpp		= 0x81,
+		.sr1f			= 0x22
+	},
+	[BT_PICASSO] = {
+		.name			= "CL Picasso",
+		.maxclock		= {
+			/* guess */
+			90000, 90000, 90000, 90000, 90000
+		},
+		.init_sr07		= TRUE,
+		.init_sr1f		= TRUE,
+		.scrn_start_bit19	= FALSE,
+		.sr07			= 0x20,
+		.sr07_1bpp		= 0x20,
+		.sr07_8bpp		= 0x21,
+		.sr1f			= 0x22
+	},
+	[BT_SPECTRUM] = {
+		.name			= "CL Spectrum",
+		.maxclock		= {
+			/* guess */
+			90000, 90000, 90000, 90000, 90000
+		},
+		.init_sr07		= TRUE,
+		.init_sr1f		= TRUE,
+		.scrn_start_bit19	= FALSE,
+		.sr07			= 0x80,
+		.sr07_1bpp		= 0x80,
+		.sr07_8bpp		= 0x81,
+		.sr1f			= 0x22
+	},
+	[BT_PICASSO4] = {
+		.name			= "CL Picasso4",
+		.maxclock		= {
+			135100, 135100, 85500, 85500, 0
+		},
+		.init_sr07		= TRUE,
+		.init_sr1f		= FALSE,
+		.scrn_start_bit19	= TRUE,
+		.sr07			= 0x20,
+		.sr07_1bpp		= 0x20,
+		.sr07_8bpp		= 0x21,
+		.sr1f			= 0
+	},
+	[BT_ALPINE] = {
+		.name			= "CL Alpine",
+		.maxclock		= {
+			/* for the GD5430.  GD5446 can do more... */
+			85500, 85500, 50000, 28500, 0
+		},
+		.init_sr07		= TRUE,
+		.init_sr1f		= TRUE,
+		.scrn_start_bit19	= TRUE,
+		.sr07			= 0xA0,
+		.sr07_1bpp		= 0xA1,
+		.sr07_1bpp_mux		= 0xA7,
+		.sr07_8bpp		= 0xA1,
+		.sr07_8bpp_mux		= 0xA7,
+		.sr1f			= 0x1C
+	},
+	[BT_GD5480] = {
+		.name			= "CL GD5480",
+		.maxclock		= {
+			135100, 200000, 200000, 135100, 135100
+		},
+		.init_sr07		= TRUE,
+		.init_sr1f		= TRUE,
+		.scrn_start_bit19	= TRUE,
+		.sr07			= 0x10,
+		.sr07_1bpp		= 0x11,
+		.sr07_8bpp		= 0x11,
+		.sr1f			= 0x1C
+	},
+	[BT_LAGUNA] = {
+		.name			= "CL Laguna",
+		.maxclock		= {
+			/* guess */
+			135100, 135100, 135100, 135100, 135100,
+		},
+		.init_sr07		= FALSE,
+		.init_sr1f		= FALSE,
+		.scrn_start_bit19	= TRUE,
+	}
 };
 
 
 #ifdef CONFIG_PCI
-/* the list of PCI devices for which we probe, and the
- * order in which we do it */
-static const struct {
-	clgen_board_t btype;
-	const char *nameOverride; /* XXX unused... for now */
-	unsigned short device;
-} clgen_pci_probe_list[] __initdata = {
-	{ BT_ALPINE, NULL, PCI_DEVICE_ID_CIRRUS_5436 },
-	{ BT_ALPINE, NULL, PCI_DEVICE_ID_CIRRUS_5434_8 },
-	{ BT_ALPINE, NULL, PCI_DEVICE_ID_CIRRUS_5434_4 },
-	{ BT_ALPINE, NULL, PCI_DEVICE_ID_CIRRUS_5430 }, /* GD-5440 has identical id */
-	{ BT_ALPINE, NULL, PCI_DEVICE_ID_CIRRUS_7543 },
-	{ BT_ALPINE, NULL, PCI_DEVICE_ID_CIRRUS_7548 },
-	{ BT_GD5480, NULL, PCI_DEVICE_ID_CIRRUS_5480 }, /* MacPicasso probably */
-	{ BT_PICASSO4, NULL, PCI_DEVICE_ID_CIRRUS_5446 }, /* Picasso 4 is a GD5446 */
-	{ BT_LAGUNA, "CL Laguna", PCI_DEVICE_ID_CIRRUS_5462 },
-	{ BT_LAGUNA, "CL Laguna 3D", PCI_DEVICE_ID_CIRRUS_5464 },
-	{ BT_LAGUNA, "CL Laguna 3DA", PCI_DEVICE_ID_CIRRUS_5465 },
+#define CHIP(id, btype) \
+	{ PCI_VENDOR_ID_CIRRUS, PCI_DEVICE_ID_##id, PCI_ANY_ID, PCI_ANY_ID, 0, 0, (btype) }
+
+static struct pci_device_id cirrusfb_pci_table[] = {
+	CHIP( CIRRUS_5436,	BT_ALPINE ),
+	CHIP( CIRRUS_5434_8,	BT_ALPINE ),
+	CHIP( CIRRUS_5434_4,	BT_ALPINE ),
+	CHIP( CIRRUS_5430,	BT_ALPINE ), /* GD-5440 has identical id */
+	CHIP( CIRRUS_7543,	BT_ALPINE ),
+	CHIP( CIRRUS_7548,	BT_ALPINE ),
+	CHIP( CIRRUS_5480,	BT_GD5480 ), /* MacPicasso probably */
+	CHIP( CIRRUS_5446,	BT_PICASSO4 ), /* Picasso 4 is a GD5446 */
+	CHIP( CIRRUS_5462,	BT_LAGUNA ), /* CL Laguna */
+	CHIP( CIRRUS_5464,	BT_LAGUNA ), /* CL Laguna 3D */
+	CHIP( CIRRUS_5465,	BT_LAGUNA ), /* CL Laguna 3DA*/
+	{ 0, }
 };
+MODULE_DEVICE_TABLE(pci, cirrusfb_pci_table);
+#undef CHIP
 #endif /* CONFIG_PCI */
 
 
 #ifdef CONFIG_ZORRO
+static const struct zorro_device_id cirrusfb_zorro_table[] = {
+	{
+		.id		= ZORRO_PROD_HELFRICH_SD64_RAM,
+		.driver_data	= BT_SD64,
+	}, {
+		.id		= ZORRO_PROD_HELFRICH_PICCOLO_RAM,
+		.driver_data	= BT_PICCOLO,
+	}, {
+		.id		= ZORRO_PROD_VILLAGE_TRONIC_PICASSO_II_II_PLUS_RAM,
+		.driver_data	= BT_PICASSO,
+	}, {
+		.id		= ZORRO_PROD_GVP_EGS_28_24_SPECTRUM_RAM,
+		.driver_data	= BT_SPECTRUM,
+	}, {
+		.id		= ZORRO_PROD_VILLAGE_TRONIC_PICASSO_IV_Z3,
+		.driver_data	= BT_PICASSO4,
+	},
+	{ 0 }
+};
+
 static const struct {
-	clgen_board_t btype;
-	zorro_id id, id2;
+	zorro_id id2;
 	unsigned long size;
-} clgen_zorro_probe_list[] __initdata = {
-	{ BT_SD64,
-		ZORRO_PROD_HELFRICH_SD64_RAM,
-		ZORRO_PROD_HELFRICH_SD64_REG,
-		0x400000 },
-	{ BT_PICCOLO,
-		ZORRO_PROD_HELFRICH_PICCOLO_RAM,
-		ZORRO_PROD_HELFRICH_PICCOLO_REG,
-		0x200000 },
-	{ BT_PICASSO,
-		ZORRO_PROD_VILLAGE_TRONIC_PICASSO_II_II_PLUS_RAM,
-		ZORRO_PROD_VILLAGE_TRONIC_PICASSO_II_II_PLUS_REG,
-		0x200000 },
-	{ BT_SPECTRUM,
-		ZORRO_PROD_GVP_EGS_28_24_SPECTRUM_RAM,
-		ZORRO_PROD_GVP_EGS_28_24_SPECTRUM_REG,
-		0x200000 },
-	{ BT_PICASSO4,
-		ZORRO_PROD_VILLAGE_TRONIC_PICASSO_IV_Z3,
-		0,
-		0x400000 },
+} cirrusfb_zorro_table2[] = {
+	[BT_SD64] = {
+		.id2	= ZORRO_PROD_HELFRICH_SD64_REG,
+		.size	= 0x400000
+	},
+	[BT_PICCOLO] = {
+		.id2	= ZORRO_PROD_HELFRICH_PICCOLO_REG,
+		.size	= 0x200000
+	},
+	[BT_PICASSO] = {
+		.id2	= ZORRO_PROD_VILLAGE_TRONIC_PICASSO_II_II_PLUS_REG,
+		.size	= 0x200000
+	},
+	[BT_SPECTRUM] = {
+		.id2	= ZORRO_PROD_GVP_EGS_28_24_SPECTRUM_REG,
+		.size	= 0x200000
+	},
+	[BT_PICASSO4] = {
+		.id2	= 0,
+		.size	= 0x400000
+	}
 };
 #endif /* CONFIG_ZORRO */
 
 
-
-struct clgenfb_par {
-	struct fb_var_screeninfo var;
-
+struct cirrusfb_regs {
 	__u32 line_length;	/* in BYTES! */
 	__u32 visual;
 	__u32 type;
@@ -355,69 +377,49 @@ struct clgenfb_par {
 
 
 
-#ifdef CLGEN_DEBUG
+#ifdef CIRRUSFB_DEBUG
 typedef enum {
         CRT,
         SEQ
-} clgen_dbg_reg_class_t;
-#endif                          /* CLGEN_DEBUG */
+} cirrusfb_dbg_reg_class_t;
+#endif                          /* CIRRUSFB_DEBUG */
 
 
 
 
 /* info about board */
-struct clgenfb_info {
-	struct fb_info_gen gen;
+struct cirrusfb_info {
+	struct fb_info *info;
 
 	caddr_t fbmem;
-	caddr_t regs;
+	caddr_t regbase;
 	caddr_t mem;
 	unsigned long size;
-	clgen_board_t btype;
-	int smallboard;
+	cirrusfb_board_t btype;
 	unsigned char SFR;	/* Shadow of special function register */
 
 	unsigned long fbmem_phys;
 	unsigned long fbregs_phys;
 
-	struct clgenfb_par currentmode;
+	struct cirrusfb_regs currentmode;
+	int blank_mode;
 
+	u32	pseudo_palette[17];
 	struct { u8 red, green, blue, pad; } palette[256];
 
-	union {
-#ifdef FBCON_HAS_CFB16
-		u16 cfb16[16];
-#endif
-#ifdef FBCON_HAS_CFB24
-		u32 cfb24[16];
-#endif
-#ifdef FBCON_HAS_CFB32
-		u32 cfb32[16];
-#endif
-	} fbcon_cmap;
-
 #ifdef CONFIG_ZORRO
-	unsigned long board_addr,
-		      board_size;
+	struct zorro_dev *zdev;
 #endif
-
 #ifdef CONFIG_PCI
 	struct pci_dev *pdev;
 #endif
+	void (*unmap)(struct cirrusfb_info *cinfo);
 };
 
 
-
-
-static struct display disp;
-
-static struct clgenfb_info boards[MAX_NUM_BOARDS];	/* the boards */
-
-static unsigned clgen_def_mode = 1;
+static unsigned cirrusfb_def_mode = 1;
 static int noaccel = 0;
 
-
-
 /*
  *    Predefined Video Modes
  */
@@ -425,219 +427,171 @@ static int noaccel = 0;
 static const struct {
 	const char *name;
 	struct fb_var_screeninfo var;
-} clgenfb_predefined[] __initdata =
-
-{
-	{"Autodetect",		/* autodetect mode */
-	 {0}
-	},
-
-	{"640x480",		/* 640x480, 31.25 kHz, 60 Hz, 25 MHz PixClock */
-	 {
-		 640, 480, 640, 480, 0, 0, 8, 0,
-		 {0, 8, 0},
-		 {0, 8, 0},
-		 {0, 8, 0},
-		 {0, 0, 0},
-	       0, 0, -1, -1, FB_ACCEL_NONE, 40000, 48, 16, 32, 8, 96, 4,
-     FB_SYNC_HOR_HIGH_ACT | FB_SYNC_VERT_HIGH_ACT, FB_VMODE_NONINTERLACED
-	 }
-	},
-
-	{"800x600",		/* 800x600, 48 kHz, 76 Hz, 50 MHz PixClock */
-	 {
-		 800, 600, 800, 600, 0, 0, 8, 0,
-		 {0, 8, 0},
-		 {0, 8, 0},
-		 {0, 8, 0},
-		 {0, 0, 0},
-	       0, 0, -1, -1, FB_ACCEL_NONE, 20000, 128, 16, 24, 2, 96, 6,
-     0, FB_VMODE_NONINTERLACED
-	 }
-	},
-
-	/*
-	   Modeline from XF86Config:
-	   Mode "1024x768" 80  1024 1136 1340 1432  768 770 774 805
-	 */
-	{"1024x768",		/* 1024x768, 55.8 kHz, 70 Hz, 80 MHz PixClock */
-		{
-			1024, 768, 1024, 768, 0, 0, 8, 0,
-			{0, 8, 0},
-			{0, 8, 0},
-			{0, 8, 0},
-			{0, 0, 0},
-	      0, 0, -1, -1, FB_ACCEL_NONE, 12500, 144, 32, 30, 2, 192, 6,
-     0, FB_VMODE_NONINTERLACED
+} cirrusfb_predefined[] = {
+	{
+		/* autodetect mode */
+		.name	= "Autodetect",
+	}, {
+		/* 640x480, 31.25 kHz, 60 Hz, 25 MHz PixClock */
+		.name	= "640x480",
+		.var	= {
+			.xres		= 640,
+			.yres		= 480,
+			.xres_virtual	= 640,
+			.yres_virtual	= 480,
+			.bits_per_pixel	= 8,
+			.red		= { .length = 8 },
+			.green		= { .length = 8 },
+			.blue		= { .length = 8 },
+			.width		= -1,
+			.height		= -1,
+			.pixclock	= 40000,
+			.left_margin	= 48,
+			.right_margin	= 16,
+			.upper_margin	= 32,
+			.lower_margin	= 8,
+			.hsync_len	= 96,
+			.vsync_len	= 4,
+			.sync		= FB_SYNC_HOR_HIGH_ACT | FB_SYNC_VERT_HIGH_ACT,
+			.vmode		= FB_VMODE_NONINTERLACED
+		 }
+	}, {
+		/* 800x600, 48 kHz, 76 Hz, 50 MHz PixClock */
+		.name	= "800x600",
+		.var	= {
+			.xres		= 800,
+			.yres		= 600,
+			.xres_virtual	= 800,
+			.yres_virtual	= 600,
+			.bits_per_pixel	= 8,
+			.red		= { .length = 8 },
+			.green		= { .length = 8 },
+			.blue		= { .length = 8 },
+			.width		= -1,
+			.height		= -1,
+			.pixclock	= 20000,
+			.left_margin	= 128,
+			.right_margin	= 16,
+			.upper_margin	= 24,
+			.lower_margin	= 2,
+			.hsync_len	= 96,
+			.vsync_len	= 6,
+			.vmode		= FB_VMODE_NONINTERLACED
+		 }
+	}, {
+		/*
+		 * Modeline from XF86Config:
+		 * Mode "1024x768" 80  1024 1136 1340 1432  768 770 774 805
+		 */
+		/* 1024x768, 55.8 kHz, 70 Hz, 80 MHz PixClock */
+		.name	= "1024x768",
+		.var	= {
+			.xres		= 1024,
+			.yres		= 768,
+			.xres_virtual	= 1024,
+			.yres_virtual	= 768,
+			.bits_per_pixel	= 8,
+			.red		= { .length = 8 },
+			.green		= { .length = 8 },
+			.blue		= { .length = 8 },
+			.width		= -1,
+			.height		= -1,
+			.pixclock	= 12500,
+			.left_margin	= 144,
+			.right_margin	= 32,
+			.upper_margin	= 30,
+			.lower_margin	= 2,
+			.hsync_len	= 192,
+			.vsync_len	= 6,
+			.vmode		= FB_VMODE_NONINTERLACED
 		}
 	}
 };
 
-#define NUM_TOTAL_MODES    ARRAY_SIZE(clgenfb_predefined)
-static struct fb_var_screeninfo clgenfb_default;
-
-/*
- *    Frame Buffer Name
- */
-
-static const char *clgenfb_name = "CLgen";
+#define NUM_TOTAL_MODES    ARRAY_SIZE(cirrusfb_predefined)
 
 /****************************************************************************/
 /**** BEGIN PROTOTYPES ******************************************************/
 
 
 /*--- Interface used by the world ------------------------------------------*/
-int clgenfb_init (void);
-int clgenfb_setup (char *options);
-
-static int clgenfb_open (struct fb_info *info, int user);
-static int clgenfb_release (struct fb_info *info, int user);
-
-static int clgenfb_setcolreg (unsigned regno, unsigned red, unsigned green,
-			      unsigned blue, unsigned transp,
-			      struct fb_info *info);
+int cirrusfb_init (void);
+int cirrusfb_setup (char *options);
+
+int cirrusfb_open (struct fb_info *info, int user);
+int cirrusfb_release (struct fb_info *info, int user);
+int cirrusfb_setcolreg (unsigned regno, unsigned red, unsigned green,
+			unsigned blue, unsigned transp,
+			struct fb_info *info);
+int cirrusfb_check_var (struct fb_var_screeninfo *var,
+			struct fb_info *info);
+int cirrusfb_set_par (struct fb_info *info);
+int cirrusfb_pan_display (struct fb_var_screeninfo *var,
+			  struct fb_info *info);
+int cirrusfb_blank (int blank_mode, struct fb_info *info);
+void cirrusfb_fillrect (struct fb_info *info, const struct fb_fillrect *region);
+void cirrusfb_copyarea(struct fb_info *info, const struct fb_copyarea *area);
+void cirrusfb_imageblit(struct fb_info *info, const struct fb_image *image);
 
 /* function table of the above functions */
-static struct fb_ops clgenfb_ops = {
-	.owner =	THIS_MODULE,
-	.fb_open =	clgenfb_open,
-	.fb_release =	clgenfb_release,
-	.fb_get_fix =	fbgen_get_fix,
-	.fb_get_var =	fbgen_get_var,
-	.fb_set_var =	fbgen_set_var,
-	.fb_get_cmap =	fbgen_get_cmap,
-	.fb_set_cmap =	gen_set_cmap,
-	.fb_setcolreg =	clgenfb_setcolreg,
-	.fb_pan_display =fbgen_pan_display,
-	.fb_blank =	fbgen_blank,
+static struct fb_ops cirrusfb_ops = {
+	.owner		= THIS_MODULE,
+	.fb_open	= cirrusfb_open,
+	.fb_release	= cirrusfb_release,
+	.fb_setcolreg	= cirrusfb_setcolreg,
+	.fb_check_var	= cirrusfb_check_var,
+	.fb_set_par	= cirrusfb_set_par,
+	.fb_pan_display = cirrusfb_pan_display,
+	.fb_blank	= cirrusfb_blank,
+	.fb_fillrect	= cirrusfb_fillrect,
+	.fb_copyarea	= cirrusfb_copyarea,
+	.fb_imageblit	= cirrusfb_imageblit,
+	.fb_cursor	= soft_cursor,
 };
 
 /*--- Hardware Specific Routines -------------------------------------------*/
-static void clgen_detect (void);
-static int clgen_encode_fix (struct fb_fix_screeninfo *fix, const void *par,
-			     struct fb_info_gen *info);
-static int clgen_decode_var (const struct fb_var_screeninfo *var, void *par,
-			     struct fb_info_gen *info);
-static int clgen_encode_var (struct fb_var_screeninfo *var, const void *par,
-			     struct fb_info_gen *info);
-static void clgen_get_par (void *par, struct fb_info_gen *info);
-static void clgen_set_par (const void *par, struct fb_info_gen *info);
-static int clgen_getcolreg (unsigned regno, unsigned *red, unsigned *green,
-			    unsigned *blue, unsigned *transp,
-			    struct fb_info *info);
-static int clgen_pan_display (const struct fb_var_screeninfo *var,
-			      struct fb_info_gen *info);
-static int clgen_blank (int blank_mode, struct fb_info_gen *info);
-
-static void clgen_set_disp (const void *par, struct display *disp,
-			    struct fb_info_gen *info);
-
-/* function table of the above functions */
-static struct fbgen_hwswitch clgen_hwswitch =
-{
-	clgen_detect,
-	clgen_encode_fix,
-	clgen_decode_var,
-	clgen_encode_var,
-	clgen_get_par,
-	clgen_set_par,
-	clgen_getcolreg,
-	clgen_pan_display,
-	clgen_blank,
-	clgen_set_disp
-};
-
-/* Text console acceleration */
-
-#ifdef FBCON_HAS_CFB8
-static void fbcon_clgen8_bmove (struct display *p, int sy, int sx,
-				int dy, int dx, int height, int width);
-static void fbcon_clgen8_clear (struct vc_data *conp, struct display *p,
-				int sy, int sx, int height, int width);
-
-static struct display_switch fbcon_clgen_8 = {
-	.setup =	fbcon_cfb8_setup,
-	.bmove =	fbcon_clgen8_bmove,
-	.clear =	fbcon_clgen8_clear,
-	.putc =		fbcon_cfb8_putc,
-	.putcs =	fbcon_cfb8_putcs,
-	.revc =		fbcon_cfb8_revc,
-	.clear_margins =fbcon_cfb8_clear_margins,
-	.fontwidthmask =FONTWIDTH (4) | FONTWIDTH (8) | FONTWIDTH (12) | FONTWIDTH (16)
-};
-#endif
-#ifdef FBCON_HAS_CFB16
-static void fbcon_clgen16_bmove (struct display *p, int sy, int sx,
-				 int dy, int dx, int height, int width);
-static void fbcon_clgen16_clear (struct vc_data *conp, struct display *p,
-				 int sy, int sx, int height, int width);
-static struct display_switch fbcon_clgen_16 = {
-	.setup =	fbcon_cfb16_setup,
-	.bmove =	fbcon_clgen16_bmove,
-	.clear =	fbcon_clgen16_clear,
-	.putc =		fbcon_cfb16_putc,
-	.putcs =	fbcon_cfb16_putcs,
-	.revc =		fbcon_cfb16_revc,
-	.clear_margins =fbcon_cfb16_clear_margins,
-	.fontwidthmask =FONTWIDTH (4) | FONTWIDTH (8) | FONTWIDTH (12) | FONTWIDTH (16)
-};
-#endif
-#ifdef FBCON_HAS_CFB32
-static void fbcon_clgen32_bmove (struct display *p, int sy, int sx,
-				 int dy, int dx, int height, int width);
-static void fbcon_clgen32_clear (struct vc_data *conp, struct display *p,
-				 int sy, int sx, int height, int width);
-static struct display_switch fbcon_clgen_32 = {
-	.setup =	fbcon_cfb32_setup,
-	.bmove =	fbcon_clgen32_bmove,
-	.clear =	fbcon_clgen32_clear,
-	.putc =		fbcon_cfb32_putc,
-	.putcs =	fbcon_cfb32_putcs,
-	.revc =		fbcon_cfb32_revc,
-	.clear_margins =fbcon_cfb32_clear_margins,
-	.fontwidthmask =FONTWIDTH (4) | FONTWIDTH (8) | FONTWIDTH (12) | FONTWIDTH (16)
-};
-#endif
-
-
-
+static int cirrusfb_decode_var (const struct fb_var_screeninfo *var,
+				struct cirrusfb_regs *regs,
+				const struct fb_info *info);
 /*--- Internal routines ----------------------------------------------------*/
-static void init_vgachip (struct clgenfb_info *fb_info);
-static void switch_monitor (struct clgenfb_info *fb_info, int on);
-static void WGen (const struct clgenfb_info *fb_info,
+static void init_vgachip (struct cirrusfb_info *cinfo);
+static void switch_monitor (struct cirrusfb_info *cinfo, int on);
+static void WGen (const struct cirrusfb_info *cinfo,
 		  int regnum, unsigned char val);
-static unsigned char RGen (const struct clgenfb_info *fb_info, int regnum);
-static void AttrOn (const struct clgenfb_info *fb_info);
-static void WHDR (const struct clgenfb_info *fb_info, unsigned char val);
-static void WSFR (struct clgenfb_info *fb_info, unsigned char val);
-static void WSFR2 (struct clgenfb_info *fb_info, unsigned char val);
-static void WClut (struct clgenfb_info *fb_info, unsigned char regnum, unsigned char red,
+static unsigned char RGen (const struct cirrusfb_info *cinfo, int regnum);
+static void AttrOn (const struct cirrusfb_info *cinfo);
+static void WHDR (const struct cirrusfb_info *cinfo, unsigned char val);
+static void WSFR (struct cirrusfb_info *cinfo, unsigned char val);
+static void WSFR2 (struct cirrusfb_info *cinfo, unsigned char val);
+static void WClut (struct cirrusfb_info *cinfo, unsigned char regnum, unsigned char red,
 		   unsigned char green,
 		   unsigned char blue);
 #if 0
-static void RClut (struct clgenfb_info *fb_info, unsigned char regnum, unsigned char *red,
+static void RClut (struct cirrusfb_info *cinfo, unsigned char regnum, unsigned char *red,
 		   unsigned char *green,
 		   unsigned char *blue);
 #endif
-static void clgen_WaitBLT (caddr_t regbase);
-static void clgen_BitBLT (caddr_t regbase, u_short curx, u_short cury,
-			  u_short destx, u_short desty,
-			  u_short width, u_short height,
-			  u_short line_length);
-static void clgen_RectFill (struct clgenfb_info *fb_info, u_short x, u_short y,
-			    u_short width, u_short height,
-			    u_char color, u_short line_length);
+static void cirrusfb_WaitBLT (caddr_t regbase);
+static void cirrusfb_BitBLT (caddr_t regbase, int bits_per_pixel,
+			     u_short curx, u_short cury,
+			     u_short destx, u_short desty,
+			     u_short width, u_short height,
+			     u_short line_length);
+static void cirrusfb_RectFill (caddr_t regbase, int bits_per_pixel,
+			       u_short x, u_short y,
+			       u_short width, u_short height,
+			       u_char color, u_short line_length);
 
 static void bestclock (long freq, long *best,
 		       long *nom, long *den,
 		       long *div, long maxfreq);
 
-#ifdef CLGEN_DEBUG
-static void clgen_dump (void);
-static void clgen_dbg_reg_dump (caddr_t regbase);
-static void clgen_dbg_print_regs (caddr_t regbase, clgen_dbg_reg_class_t reg_class,...);
-static void clgen_dbg_print_byte (const char *name, unsigned char val);
-#endif /* CLGEN_DEBUG */
+#ifdef CIRRUSFB_DEBUG
+static void cirrusfb_dump (void);
+static void cirrusfb_dbg_reg_dump (caddr_t regbase);
+static void cirrusfb_dbg_print_regs (caddr_t regbase, cirrusfb_dbg_reg_class_t reg_class,...);
+static void cirrusfb_dbg_print_byte (const char *name, unsigned char val);
+#endif /* CIRRUSFB_DEBUG */
 
 /*** END   PROTOTYPES ********************************************************/
 /*****************************************************************************/
@@ -646,18 +600,18 @@ static void clgen_dbg_print_byte (const char *name, unsigned char val);
 static int opencount = 0;
 
 /*--- Open /dev/fbx ---------------------------------------------------------*/
-static int clgenfb_open (struct fb_info *info, int user)
+int cirrusfb_open (struct fb_info *info, int user)
 {
 	if (opencount++ == 0)
-		switch_monitor ((struct clgenfb_info *) info, 1);
+		switch_monitor (info->par, 1);
 	return 0;
 }
 
 /*--- Close /dev/fbx --------------------------------------------------------*/
-static int clgenfb_release (struct fb_info *info, int user)
+int cirrusfb_release (struct fb_info *info, int user)
 {
 	if (--opencount == 0)
-		switch_monitor ((struct clgenfb_info *) info, 0);
+		switch_monitor (info->par, 0);
 	return 0;
 }
 
@@ -665,67 +619,8 @@ static int clgenfb_release (struct fb_info *info, int user)
 /****************************************************************************/
 /**** BEGIN Hardware specific Routines **************************************/
 
-static void clgen_detect (void)
-{
-	DPRINTK ("ENTER\n");
-	DPRINTK ("EXIT\n");
-}
-
-static int clgen_encode_fix (struct fb_fix_screeninfo *fix, const void *par,
-			     struct fb_info_gen *info)
-{
-	struct clgenfb_par *_par = (struct clgenfb_par *) par;
-	struct clgenfb_info *_info = (struct clgenfb_info *) info;
-
-	DPRINTK ("ENTER\n");
-
-	memset (fix, 0, sizeof (struct fb_fix_screeninfo));
-	strcpy (fix->id, clgenfb_name);
-
-	if (_info->btype == BT_GD5480) {
-		/* Select proper byte-swapping aperture */
-		switch (_par->var.bits_per_pixel) {
-		case 1:
-		case 8:
-			fix->smem_start = _info->fbmem_phys;
-			break;
-		case 16:
-			fix->smem_start = _info->fbmem_phys + 1 * MB_;
-			break;
-		case 24:
-		case 32:
-			fix->smem_start = _info->fbmem_phys + 2 * MB_;
-			break;
-		}
-	} else {
-		fix->smem_start = _info->fbmem_phys;
-	}
-
-	/* monochrome: only 1 memory plane */
-	/* 8 bit and above: Use whole memory area */
-	fix->smem_len = _par->var.bits_per_pixel == 1 ? _info->size / 4
-	    : _info->size;
-	fix->type = _par->type;
-	fix->type_aux = 0;
-	fix->visual = _par->visual;
-	fix->xpanstep = 1;
-	fix->ypanstep = 1;
-	fix->ywrapstep = 0;
-	fix->line_length = _par->line_length;
-
-	/* FIXME: map region at 0xB8000 if available, fill in here */
-	fix->mmio_start = 0;
-	fix->mmio_len = 0;
-	fix->accel = FB_ACCEL_NONE;
-
-	DPRINTK ("EXIT\n");
-	return 0;
-}
-
-
-
 /* Get a good MCLK value */
-static long clgen_get_mclk (long freq, int bpp, long *div)
+static long cirrusfb_get_mclk (long freq, int bpp, long *div)
 {
 	long mclk;
 
@@ -765,227 +660,253 @@ static long clgen_get_mclk (long freq, int bpp, long *div)
 	return mclk;
 }
 
-static int clgen_decode_var (const struct fb_var_screeninfo *var, void *par,
-			     struct fb_info_gen *info)
+int cirrusfb_check_var(struct fb_var_screeninfo *var,
+		       struct fb_info *info)
 {
-	long freq;
-	long maxclock;
-	int xres, hfront, hsync, hback;
-	int yres, vfront, vsync, vback;
+	struct cirrusfb_info *cinfo = info->par;
 	int nom, den;		/* translyting from pixels->bytes */
-	int i;
-	static struct {
-		int xres, yres;
-	} modes[] = { {
-			1600, 1280
-	}, {
-		1280, 1024
-	}, {
-		1024, 768
-	},
-	{
-		800, 600
-	}, {
-		640, 480
-	}, {
-		-1, -1
-	}
-	};
-
-	struct clgenfb_par *_par = (struct clgenfb_par *) par;
-	struct clgenfb_info *fb_info = (struct clgenfb_info *) info;
-
-	assert (var != NULL);
-	assert (par != NULL);
-	assert (info != NULL);
-
-	DPRINTK ("ENTER\n");
-
-	DPRINTK ("Requested: %dx%dx%d\n", var->xres, var->yres, var->bits_per_pixel);
-	DPRINTK ("  virtual: %dx%d\n", var->xres_virtual, var->yres_virtual);
-	DPRINTK ("   offset: (%d,%d)\n", var->xoffset, var->yoffset);
-	DPRINTK ("grayscale: %d\n", var->grayscale);
-
-	memset (par, 0, sizeof (struct clgenfb_par));
-
-	_par->var = *var;
+	int yres, i;
+	static struct { int xres, yres; } modes[] =
+	{ { 1600, 1280 },
+	  { 1280, 1024 },
+	  { 1024, 768 },
+	  { 800, 600 },
+	  { 640, 480 },
+	  { -1, -1 } };
 
 	switch (var->bits_per_pixel) {
-	case 1:
+	case 0 ... 1:
+		var->bits_per_pixel = 1;
 		nom = 4;
 		den = 8;
 		break;		/* 8 pixel per byte, only 1/4th of mem usable */
 	case 2 ... 8:
-		_par->var.bits_per_pixel = 8;
+		var->bits_per_pixel = 8;
 		nom = 1;
 		den = 1;
 		break;		/* 1 pixel == 1 byte */
 	case 9 ... 16:
-		_par->var.bits_per_pixel = 16;
+		var->bits_per_pixel = 16;
 		nom = 2;
 		den = 1;
 		break;		/* 2 bytes per pixel */
 	case 17 ... 24:
-		_par->var.bits_per_pixel = 24;
+		var->bits_per_pixel = 24;
 		nom = 3;
 		den = 1;
 		break;		/* 3 bytes per pixel */
 	case 25 ... 32:
-		_par->var.bits_per_pixel = 32;
+		var->bits_per_pixel = 32;
 		nom = 4;
 		den = 1;
 		break;		/* 4 bytes per pixel */
 	default:
-		printk ("clgen: mode %dx%dx%d rejected...color depth not supported.\n",
+		printk ("cirrusfb: mode %dx%dx%d rejected...color depth not supported.\n",
 			var->xres, var->yres, var->bits_per_pixel);
 		DPRINTK ("EXIT - EINVAL error\n");
 		return -EINVAL;
 	}
 
-	if (_par->var.xres * nom / den * _par->var.yres > fb_info->size) {
-		printk ("clgen: mode %dx%dx%d rejected...resolution too high to fit into video memory!\n",
+	if (var->xres * nom / den * var->yres > cinfo->size) {
+		printk ("cirrusfb: mode %dx%dx%d rejected...resolution too high to fit into video memory!\n",
 			var->xres, var->yres, var->bits_per_pixel);
 		DPRINTK ("EXIT - EINVAL error\n");
 		return -EINVAL;
 	}
+
 	/* use highest possible virtual resolution */
-	if (_par->var.xres_virtual == -1 &&
-	    _par->var.yres_virtual == -1) {
-		printk ("clgen: using maximum available virtual resolution\n");
+	if (var->xres_virtual == -1 &&
+	    var->yres_virtual == -1) {
+		printk ("cirrusfb: using maximum available virtual resolution\n");
 		for (i = 0; modes[i].xres != -1; i++) {
-			if (modes[i].xres * nom / den * modes[i].yres < fb_info->size / 2)
+			if (modes[i].xres * nom / den * modes[i].yres < cinfo->size / 2)
 				break;
 		}
 		if (modes[i].xres == -1) {
-			printk ("clgen: could not find a virtual resolution that fits into video memory!!\n");
+			printk ("cirrusfb: could not find a virtual resolution that fits into video memory!!\n");
 			DPRINTK ("EXIT - EINVAL error\n");
 			return -EINVAL;
 		}
-		_par->var.xres_virtual = modes[i].xres;
-		_par->var.yres_virtual = modes[i].yres;
+		var->xres_virtual = modes[i].xres;
+		var->yres_virtual = modes[i].yres;
 
-		printk ("clgen: virtual resolution set to maximum of %dx%d\n",
-			_par->var.xres_virtual, _par->var.yres_virtual);
-	} else if (_par->var.xres_virtual == -1) {
-		/* FIXME: maximize X virtual resolution only */
-	} else if (_par->var.yres_virtual == -1) {
-		/* FIXME: maximize Y virtual resolution only */
+		printk ("cirrusfb: virtual resolution set to maximum of %dx%d\n",
+			var->xres_virtual, var->yres_virtual);
 	}
-	if (_par->var.xoffset < 0)
-		_par->var.xoffset = 0;
-	if (_par->var.yoffset < 0)
-		_par->var.yoffset = 0;
 
-	/* truncate xoffset and yoffset to maximum if too high */
-	if (_par->var.xoffset > _par->var.xres_virtual - _par->var.xres)
-		_par->var.xoffset = _par->var.xres_virtual - _par->var.xres - 1;
+	if (var->xres_virtual < var->xres)
+		var->xres_virtual = var->xres;
+	if (var->yres_virtual < var->yres)
+		var->yres_virtual = var->yres;
 
-	if (_par->var.yoffset > _par->var.yres_virtual - _par->var.yres)
-		_par->var.yoffset = _par->var.yres_virtual - _par->var.yres - 1;
+	if (var->xoffset < 0)
+		var->xoffset = 0;
+	if (var->yoffset < 0)
+		var->yoffset = 0;
+
+	/* truncate xoffset and yoffset to maximum if too high */
+	if (var->xoffset > var->xres_virtual - var->xres)
+		var->xoffset = var->xres_virtual - var->xres - 1;
+	if (var->yoffset > var->yres_virtual - var->yres)
+		var->yoffset = var->yres_virtual - var->yres - 1;
 
-	switch (_par->var.bits_per_pixel) {
+	switch (var->bits_per_pixel) {
 	case 1:
-		_par->line_length = _par->var.xres_virtual / 8;
-		_par->visual = FB_VISUAL_MONO10;
 		break;
 
 	case 8:
-		_par->line_length = _par->var.xres_virtual;
-		_par->visual = FB_VISUAL_PSEUDOCOLOR;
-		_par->var.red.offset = 0;
-		_par->var.red.length = 6;
-		_par->var.green.offset = 0;
-		_par->var.green.length = 6;
-		_par->var.blue.offset = 0;
-		_par->var.blue.length = 6;
+		var->red.offset = 0;
+		var->red.length = 6;
+		var->green.offset = 0;
+		var->green.length = 6;
+		var->blue.offset = 0;
+		var->blue.length = 6;
 		break;
 
 	case 16:
-		_par->line_length = _par->var.xres_virtual * 2;
-		_par->visual = FB_VISUAL_DIRECTCOLOR;
 		if(isPReP) {
-			_par->var.red.offset = 2;
-			_par->var.green.offset = -3;
-			_par->var.blue.offset = 8;
+			var->red.offset = 2;
+			var->green.offset = -3;
+			var->blue.offset = 8;
 		} else {
-			_par->var.red.offset = 10;
-			_par->var.green.offset = 5;
-			_par->var.blue.offset = 0;
+			var->red.offset = 10;
+			var->green.offset = 5;
+			var->blue.offset = 0;
 		}
-		_par->var.red.length = 5;
-		_par->var.green.length = 5;
-		_par->var.blue.length = 5;
+		var->red.length = 5;
+		var->green.length = 5;
+		var->blue.length = 5;
 		break;
 
 	case 24:
-		_par->line_length = _par->var.xres_virtual * 3;
-		_par->visual = FB_VISUAL_DIRECTCOLOR;
 		if(isPReP) {
-			_par->var.red.offset = 8;
-			_par->var.green.offset = 16;
-			_par->var.blue.offset = 24;
+			var->red.offset = 8;
+			var->green.offset = 16;
+			var->blue.offset = 24;
 		} else {
-			_par->var.red.offset = 16;
-			_par->var.green.offset = 8;
-			_par->var.blue.offset = 0;
+			var->red.offset = 16;
+			var->green.offset = 8;
+			var->blue.offset = 0;
 		}
-		_par->var.red.length = 8;
-		_par->var.green.length = 8;
-		_par->var.blue.length = 8;
+		var->red.length = 8;
+		var->green.length = 8;
+		var->blue.length = 8;
 		break;
 
 	case 32:
-		_par->line_length = _par->var.xres_virtual * 4;
-		_par->visual = FB_VISUAL_DIRECTCOLOR;
 		if(isPReP) {
-			_par->var.red.offset = 8;
-			_par->var.green.offset = 16;
-			_par->var.blue.offset = 24;
+			var->red.offset = 8;
+			var->green.offset = 16;
+			var->blue.offset = 24;
 		} else {
-			_par->var.red.offset = 16;
-			_par->var.green.offset = 8;
-			_par->var.blue.offset = 0;
+			var->red.offset = 16;
+			var->green.offset = 8;
+			var->blue.offset = 0;
 		}
-		_par->var.red.length = 8;
-		_par->var.green.length = 8;
-		_par->var.blue.length = 8;
+		var->red.length = 8;
+		var->green.length = 8;
+		var->blue.length = 8;
 		break;
 
 	default:
-		DPRINTK("Unsupported bpp size: %d\n", _par->var.bits_per_pixel);
+		DPRINTK("Unsupported bpp size: %d\n", var->bits_per_pixel);
 		assert (FALSE);
 		/* should never occur */
 		break;
 	}
 
-	_par->var.red.msb_right =
-	    _par->var.green.msb_right =
-	    _par->var.blue.msb_right =
-	    _par->var.transp.offset =
-	    _par->var.transp.length =
-	    _par->var.transp.msb_right = 0;
+	var->red.msb_right =
+	    var->green.msb_right =
+	    var->blue.msb_right =
+	    var->transp.offset =
+	    var->transp.length =
+	    var->transp.msb_right = 0;
+
+	yres = var->yres;
+	if (var->vmode & FB_VMODE_DOUBLE)
+		yres *= 2;
+	else if (var->vmode & FB_VMODE_INTERLACED)
+		yres = (yres + 1) / 2;
+
+	if (yres >= 1280) {
+		printk (KERN_WARNING "cirrusfb: ERROR: VerticalTotal >= 1280; special treatment required! (TODO)\n");
+		DPRINTK ("EXIT - EINVAL error\n");
+		return -EINVAL;
+	}
+
+	return 0;
+}
+
+static int cirrusfb_decode_var (const struct fb_var_screeninfo *var,
+				struct cirrusfb_regs *regs,
+				const struct fb_info *info)
+{
+	long freq;
+	long maxclock;
+	int maxclockidx = 0;
+	struct cirrusfb_info *cinfo = info->par;
+	int xres, hfront, hsync, hback;
+	int yres, vfront, vsync, vback;
+
+	switch(var->bits_per_pixel) {
+	case 1:
+		regs->line_length = var->xres_virtual / 8;
+		regs->visual = FB_VISUAL_MONO10;
+		maxclockidx = 0;
+		break;
+
+	case 8:
+		regs->line_length = var->xres_virtual;
+		regs->visual = FB_VISUAL_PSEUDOCOLOR;
+		maxclockidx = 1;
+		break;
+
+	case 16:
+		regs->line_length = var->xres_virtual * 2;
+		regs->visual = FB_VISUAL_DIRECTCOLOR;
+		maxclockidx = 2;
+		break;
+
+	case 24:
+		regs->line_length = var->xres_virtual * 3;
+		regs->visual = FB_VISUAL_DIRECTCOLOR;
+		maxclockidx = 3;
+		break;
+
+	case 32:
+		regs->line_length = var->xres_virtual * 4;
+		regs->visual = FB_VISUAL_DIRECTCOLOR;
+		maxclockidx = 4;
+		break;
+
+	default:
+		DPRINTK("Unsupported bpp size: %d\n", var->bits_per_pixel);
+		assert (FALSE);
+		/* should never occur */
+		break;
+	}
 
-	_par->type = FB_TYPE_PACKED_PIXELS;
+	regs->type = FB_TYPE_PACKED_PIXELS;
 
 	/* convert from ps to kHz */
 	freq = 1000000000 / var->pixclock;
 
 	DPRINTK ("desired pixclock: %ld kHz\n", freq);
 
-	maxclock = clgen_board_info[fb_info->btype].maxclock;
-	_par->multiplexing = 0;
+	maxclock = cirrusfb_board_info[cinfo->btype].maxclock[maxclockidx];
+	regs->multiplexing = 0;
 
 	/* If the frequency is greater than we can support, we might be able
 	 * to use multiplexing for the video mode */
 	if (freq > maxclock) {
-		switch (fb_info->btype) {
+		switch (cinfo->btype) {
 		case BT_ALPINE:
 		case BT_GD5480:
-			_par->multiplexing = 1;
+			regs->multiplexing = 1;
 			break;
 
 		default:
-			printk (KERN_WARNING "clgen: ERROR: Frequency greater than maxclock (%ld kHz)\n", maxclock);
+			printk (KERN_WARNING "cirrusfb: ERROR: Frequency greater than maxclock (%ld kHz)\n", maxclock);
 			DPRINTK ("EXIT - return -EINVAL\n");
 			return -EINVAL;
 		}
@@ -996,274 +917,256 @@ static int clgen_decode_var (const struct fb_var_screeninfo *var, void *par,
 	switch (var->bits_per_pixel) {
 	case 16:
 	case 32:
-		if (_par->HorizRes <= 800)
+		if (regs->HorizRes <= 800)
 			freq /= 2;	/* Xbh has this type of clock for 32-bit */
 		break;
 	}
 #endif
 
-	bestclock (freq, &_par->freq, &_par->nom, &_par->den, &_par->div,
+	bestclock (freq, &regs->freq, &regs->nom, &regs->den, &regs->div,
 		   maxclock);
-	_par->mclk = clgen_get_mclk (freq, _par->var.bits_per_pixel, &_par->divMCLK);
+	regs->mclk = cirrusfb_get_mclk (freq, var->bits_per_pixel, &regs->divMCLK);
 
-	xres = _par->var.xres;
-	hfront = _par->var.right_margin;
-	hsync = _par->var.hsync_len;
-	hback = _par->var.left_margin;
+	xres = var->xres;
+	hfront = var->right_margin;
+	hsync = var->hsync_len;
+	hback = var->left_margin;
 
-	yres = _par->var.yres;
-	vfront = _par->var.lower_margin;
-	vsync = _par->var.vsync_len;
-	vback = _par->var.upper_margin;
+	yres = var->yres;
+	vfront = var->lower_margin;
+	vsync = var->vsync_len;
+	vback = var->upper_margin;
 
-	if (_par->var.vmode & FB_VMODE_DOUBLE) {
+	if (var->vmode & FB_VMODE_DOUBLE) {
 		yres *= 2;
 		vfront *= 2;
 		vsync *= 2;
 		vback *= 2;
-	} else if (_par->var.vmode & FB_VMODE_INTERLACED) {
+	} else if (var->vmode & FB_VMODE_INTERLACED) {
 		yres = (yres + 1) / 2;
 		vfront = (vfront + 1) / 2;
 		vsync = (vsync + 1) / 2;
 		vback = (vback + 1) / 2;
 	}
-	_par->HorizRes = xres;
-	_par->HorizTotal = (xres + hfront + hsync + hback) / 8 - 5;
-	_par->HorizDispEnd = xres / 8 - 1;
-	_par->HorizBlankStart = xres / 8;
-	_par->HorizBlankEnd = _par->HorizTotal + 5;	/* does not count with "-5" */
-	_par->HorizSyncStart = (xres + hfront) / 8 + 1;
-	_par->HorizSyncEnd = (xres + hfront + hsync) / 8 + 1;
-
-	_par->VertRes = yres;
-	_par->VertTotal = yres + vfront + vsync + vback - 2;
-	_par->VertDispEnd = yres - 1;
-	_par->VertBlankStart = yres;
-	_par->VertBlankEnd = _par->VertTotal;
-	_par->VertSyncStart = yres + vfront - 1;
-	_par->VertSyncEnd = yres + vfront + vsync - 1;
-
-	if (_par->VertRes >= 1024) {
-		_par->VertTotal /= 2;
-		_par->VertSyncStart /= 2;
-		_par->VertSyncEnd /= 2;
-		_par->VertDispEnd /= 2;
-	}
-	if (_par->multiplexing) {
-		_par->HorizTotal /= 2;
-		_par->HorizSyncStart /= 2;
-		_par->HorizSyncEnd /= 2;
-		_par->HorizDispEnd /= 2;
-	}
-	if (_par->VertRes >= 1280) {
-		printk (KERN_WARNING "clgen: ERROR: VerticalTotal >= 1280; special treatment required! (TODO)\n");
-		DPRINTK ("EXIT - EINVAL error\n");
-		return -EINVAL;
+	regs->HorizRes = xres;
+	regs->HorizTotal = (xres + hfront + hsync + hback) / 8 - 5;
+	regs->HorizDispEnd = xres / 8 - 1;
+	regs->HorizBlankStart = xres / 8;
+	regs->HorizBlankEnd = regs->HorizTotal + 5;	/* does not count with "-5" */
+	regs->HorizSyncStart = (xres + hfront) / 8 + 1;
+	regs->HorizSyncEnd = (xres + hfront + hsync) / 8 + 1;
+
+	regs->VertRes = yres;
+	regs->VertTotal = yres + vfront + vsync + vback - 2;
+	regs->VertDispEnd = yres - 1;
+	regs->VertBlankStart = yres;
+	regs->VertBlankEnd = regs->VertTotal;
+	regs->VertSyncStart = yres + vfront - 1;
+	regs->VertSyncEnd = yres + vfront + vsync - 1;
+
+	if (regs->VertRes >= 1024) {
+		regs->VertTotal /= 2;
+		regs->VertSyncStart /= 2;
+		regs->VertSyncEnd /= 2;
+		regs->VertDispEnd /= 2;
+	}
+	if (regs->multiplexing) {
+		regs->HorizTotal /= 2;
+		regs->HorizSyncStart /= 2;
+		regs->HorizSyncEnd /= 2;
+		regs->HorizDispEnd /= 2;
 	}
-	DPRINTK ("EXIT\n");
-	return 0;
-}
-
 
-static int clgen_encode_var (struct fb_var_screeninfo *var, const void *par,
-			     struct fb_info_gen *info)
-{
-	DPRINTK ("ENTER\n");
-
-	*var = ((struct clgenfb_par *) par)->var;
-
-	DPRINTK ("EXIT\n");
 	return 0;
 }
 
-/* get current video mode */
-static void clgen_get_par (void *par, struct fb_info_gen *info)
-{
-	struct clgenfb_par *_par = (struct clgenfb_par *) par;
-	struct clgenfb_info *_info = (struct clgenfb_info *) info;
-
-	DPRINTK ("ENTER\n");
-
-	*_par = _info->currentmode;
-
-	DPRINTK ("EXIT\n");
-}
 
-static void clgen_set_mclk (const struct clgenfb_info *fb_info, int val, int div)
+static void cirrusfb_set_mclk (const struct cirrusfb_info *cinfo, int val, int div)
 {
-	assert (fb_info != NULL);
+	assert (cinfo != NULL);
 
 	if (div == 2) {
 		/* VCLK = MCLK/2 */
-		unsigned char old = vga_rseq (fb_info->regs, CL_SEQR1E);
-		vga_wseq (fb_info->regs, CL_SEQR1E, old | 0x1);
-		vga_wseq (fb_info->regs, CL_SEQR1F, 0x40 | (val & 0x3f));
+		unsigned char old = vga_rseq (cinfo->regbase, CL_SEQR1E);
+		vga_wseq (cinfo->regbase, CL_SEQR1E, old | 0x1);
+		vga_wseq (cinfo->regbase, CL_SEQR1F, 0x40 | (val & 0x3f));
 	} else if (div == 1) {
 		/* VCLK = MCLK */
-		unsigned char old = vga_rseq (fb_info->regs, CL_SEQR1E);
-		vga_wseq (fb_info->regs, CL_SEQR1E, old & ~0x1);
-		vga_wseq (fb_info->regs, CL_SEQR1F, 0x40 | (val & 0x3f));
+		unsigned char old = vga_rseq (cinfo->regbase, CL_SEQR1E);
+		vga_wseq (cinfo->regbase, CL_SEQR1E, old & ~0x1);
+		vga_wseq (cinfo->regbase, CL_SEQR1F, 0x40 | (val & 0x3f));
 	} else {
-		vga_wseq (fb_info->regs, CL_SEQR1F, val & 0x3f);
+		vga_wseq (cinfo->regbase, CL_SEQR1F, val & 0x3f);
 	}
 }
 
 /*************************************************************************
-	clgen_set_par()
+	cirrusfb_set_par_foo()
 
 	actually writes the values for a new video mode into the hardware,
 **************************************************************************/
-static void clgen_set_par (const void *par, struct fb_info_gen *info)
+static int cirrusfb_set_par_foo (struct fb_info *info)
 {
+	struct cirrusfb_info *cinfo = info->par;
+	struct fb_var_screeninfo *var = &info->var;
+	struct cirrusfb_regs regs;
+	caddr_t regbase = cinfo->regbase;
 	unsigned char tmp;
-	int offset = 0;
-	struct clgenfb_par *_par = (struct clgenfb_par *) par;
-	struct clgenfb_info *fb_info = (struct clgenfb_info *) info;
-	const struct clgen_board_info_rec *bi;
+	int offset = 0, err;
+	const struct cirrusfb_board_info_rec *bi;
 
 	DPRINTK ("ENTER\n");
 	DPRINTK ("Requested mode: %dx%dx%d\n",
-	       _par->var.xres, _par->var.yres, _par->var.bits_per_pixel);
-	DPRINTK ("pixclock: %d\n", _par->var.pixclock);
+	       var->xres, var->yres, var->bits_per_pixel);
+	DPRINTK ("pixclock: %d\n", var->pixclock);
+
+	init_vgachip (cinfo);
+
+	err = cirrusfb_decode_var(var, &regs, info);
+	if(err) {
+		/* should never happen */
+		DPRINTK("mode change aborted.  invalid var.\n");
+		return -EINVAL;
+	}
 
-	bi = &clgen_board_info[fb_info->btype];
+	bi = &cirrusfb_board_info[cinfo->btype];
 
 
 	/* unlock register VGA_CRTC_H_TOTAL..CRT7 */
-	vga_wcrt (fb_info->regs, VGA_CRTC_V_SYNC_END, 0x20);	/* previously: 0x00) */
+	vga_wcrt (regbase, VGA_CRTC_V_SYNC_END, 0x20);	/* previously: 0x00) */
 
 	/* if debugging is enabled, all parameters get output before writing */
-	DPRINTK ("CRT0: %ld\n", _par->HorizTotal);
-	vga_wcrt (fb_info->regs, VGA_CRTC_H_TOTAL, _par->HorizTotal);
+	DPRINTK ("CRT0: %ld\n", regs.HorizTotal);
+	vga_wcrt (regbase, VGA_CRTC_H_TOTAL, regs.HorizTotal);
 
-	DPRINTK ("CRT1: %ld\n", _par->HorizDispEnd);
-	vga_wcrt (fb_info->regs, VGA_CRTC_H_DISP, _par->HorizDispEnd);
+	DPRINTK ("CRT1: %ld\n", regs.HorizDispEnd);
+	vga_wcrt (regbase, VGA_CRTC_H_DISP, regs.HorizDispEnd);
 
-	DPRINTK ("CRT2: %ld\n", _par->HorizBlankStart);
-	vga_wcrt (fb_info->regs, VGA_CRTC_H_BLANK_START, _par->HorizBlankStart);
+	DPRINTK ("CRT2: %ld\n", regs.HorizBlankStart);
+	vga_wcrt (regbase, VGA_CRTC_H_BLANK_START, regs.HorizBlankStart);
 
-	DPRINTK ("CRT3: 128+%ld\n", _par->HorizBlankEnd % 32);	/*  + 128: Compatible read */
-	vga_wcrt (fb_info->regs, VGA_CRTC_H_BLANK_END, 128 + (_par->HorizBlankEnd % 32));
+	DPRINTK ("CRT3: 128+%ld\n", regs.HorizBlankEnd % 32);	/*  + 128: Compatible read */
+	vga_wcrt (regbase, VGA_CRTC_H_BLANK_END, 128 + (regs.HorizBlankEnd % 32));
 
-	DPRINTK ("CRT4: %ld\n", _par->HorizSyncStart);
-	vga_wcrt (fb_info->regs, VGA_CRTC_H_SYNC_START, _par->HorizSyncStart);
+	DPRINTK ("CRT4: %ld\n", regs.HorizSyncStart);
+	vga_wcrt (regbase, VGA_CRTC_H_SYNC_START, regs.HorizSyncStart);
 
-	tmp = _par->HorizSyncEnd % 32;
-	if (_par->HorizBlankEnd & 32)
+	tmp = regs.HorizSyncEnd % 32;
+	if (regs.HorizBlankEnd & 32)
 		tmp += 128;
 	DPRINTK ("CRT5: %d\n", tmp);
-	vga_wcrt (fb_info->regs, VGA_CRTC_H_SYNC_END, tmp);
+	vga_wcrt (regbase, VGA_CRTC_H_SYNC_END, tmp);
 
-	DPRINTK ("CRT6: %ld\n", _par->VertTotal & 0xff);
-	vga_wcrt (fb_info->regs, VGA_CRTC_V_TOTAL, (_par->VertTotal & 0xff));
+	DPRINTK ("CRT6: %ld\n", regs.VertTotal & 0xff);
+	vga_wcrt (regbase, VGA_CRTC_V_TOTAL, (regs.VertTotal & 0xff));
 
 	tmp = 16;		/* LineCompare bit #9 */
-	if (_par->VertTotal & 256)
+	if (regs.VertTotal & 256)
 		tmp |= 1;
-	if (_par->VertDispEnd & 256)
+	if (regs.VertDispEnd & 256)
 		tmp |= 2;
-	if (_par->VertSyncStart & 256)
+	if (regs.VertSyncStart & 256)
 		tmp |= 4;
-	if (_par->VertBlankStart & 256)
+	if (regs.VertBlankStart & 256)
 		tmp |= 8;
-	if (_par->VertTotal & 512)
+	if (regs.VertTotal & 512)
 		tmp |= 32;
-	if (_par->VertDispEnd & 512)
+	if (regs.VertDispEnd & 512)
 		tmp |= 64;
-	if (_par->VertSyncStart & 512)
+	if (regs.VertSyncStart & 512)
 		tmp |= 128;
 	DPRINTK ("CRT7: %d\n", tmp);
-	vga_wcrt (fb_info->regs, VGA_CRTC_OVERFLOW, tmp);
+	vga_wcrt (regbase, VGA_CRTC_OVERFLOW, tmp);
 
 	tmp = 0x40;		/* LineCompare bit #8 */
-	if (_par->VertBlankStart & 512)
+	if (regs.VertBlankStart & 512)
 		tmp |= 0x20;
-	if (_par->var.vmode & FB_VMODE_DOUBLE)
+	if (var->vmode & FB_VMODE_DOUBLE)
 		tmp |= 0x80;
 	DPRINTK ("CRT9: %d\n", tmp);
-	vga_wcrt (fb_info->regs, VGA_CRTC_MAX_SCAN, tmp);
+	vga_wcrt (regbase, VGA_CRTC_MAX_SCAN, tmp);
 
-	DPRINTK ("CRT10: %ld\n", _par->VertSyncStart & 0xff);
-	vga_wcrt (fb_info->regs, VGA_CRTC_V_SYNC_START, (_par->VertSyncStart & 0xff));
+	DPRINTK ("CRT10: %ld\n", regs.VertSyncStart & 0xff);
+	vga_wcrt (regbase, VGA_CRTC_V_SYNC_START, (regs.VertSyncStart & 0xff));
 
-	DPRINTK ("CRT11: 64+32+%ld\n", _par->VertSyncEnd % 16);
-	vga_wcrt (fb_info->regs, VGA_CRTC_V_SYNC_END, (_par->VertSyncEnd % 16 + 64 + 32));
+	DPRINTK ("CRT11: 64+32+%ld\n", regs.VertSyncEnd % 16);
+	vga_wcrt (regbase, VGA_CRTC_V_SYNC_END, (regs.VertSyncEnd % 16 + 64 + 32));
 
-	DPRINTK ("CRT12: %ld\n", _par->VertDispEnd & 0xff);
-	vga_wcrt (fb_info->regs, VGA_CRTC_V_DISP_END, (_par->VertDispEnd & 0xff));
+	DPRINTK ("CRT12: %ld\n", regs.VertDispEnd & 0xff);
+	vga_wcrt (regbase, VGA_CRTC_V_DISP_END, (regs.VertDispEnd & 0xff));
 
-	DPRINTK ("CRT15: %ld\n", _par->VertBlankStart & 0xff);
-	vga_wcrt (fb_info->regs, VGA_CRTC_V_BLANK_START, (_par->VertBlankStart & 0xff));
+	DPRINTK ("CRT15: %ld\n", regs.VertBlankStart & 0xff);
+	vga_wcrt (regbase, VGA_CRTC_V_BLANK_START, (regs.VertBlankStart & 0xff));
 
-	DPRINTK ("CRT16: %ld\n", _par->VertBlankEnd & 0xff);
-	vga_wcrt (fb_info->regs, VGA_CRTC_V_BLANK_END, (_par->VertBlankEnd & 0xff));
+	DPRINTK ("CRT16: %ld\n", regs.VertBlankEnd & 0xff);
+	vga_wcrt (regbase, VGA_CRTC_V_BLANK_END, (regs.VertBlankEnd & 0xff));
 
 	DPRINTK ("CRT18: 0xff\n");
-	vga_wcrt (fb_info->regs, VGA_CRTC_LINE_COMPARE, 0xff);
+	vga_wcrt (regbase, VGA_CRTC_LINE_COMPARE, 0xff);
 
 	tmp = 0;
-	if (_par->var.vmode & FB_VMODE_INTERLACED)
+	if (var->vmode & FB_VMODE_INTERLACED)
 		tmp |= 1;
-	if (_par->HorizBlankEnd & 64)
+	if (regs.HorizBlankEnd & 64)
 		tmp |= 16;
-	if (_par->HorizBlankEnd & 128)
+	if (regs.HorizBlankEnd & 128)
 		tmp |= 32;
-	if (_par->VertBlankEnd & 256)
+	if (regs.VertBlankEnd & 256)
 		tmp |= 64;
-	if (_par->VertBlankEnd & 512)
+	if (regs.VertBlankEnd & 512)
 		tmp |= 128;
 
 	DPRINTK ("CRT1a: %d\n", tmp);
-	vga_wcrt (fb_info->regs, CL_CRT1A, tmp);
+	vga_wcrt (regbase, CL_CRT1A, tmp);
 
 	/* set VCLK0 */
 	/* hardware RefClock: 14.31818 MHz */
 	/* formula: VClk = (OSC * N) / (D * (1+P)) */
 	/* Example: VClk = (14.31818 * 91) / (23 * (1+1)) = 28.325 MHz */
 
-	vga_wseq (fb_info->regs, CL_SEQRB, _par->nom);
-	tmp = _par->den << 1;
-	if (_par->div != 0)
+	vga_wseq (regbase, CL_SEQRB, regs.nom);
+	tmp = regs.den << 1;
+	if (regs.div != 0)
 		tmp |= 1;
 
-	if ((fb_info->btype == BT_SD64) ||
-	    (fb_info->btype == BT_ALPINE) ||
-	    (fb_info->btype == BT_GD5480))
+	if ((cinfo->btype == BT_SD64) ||
+	    (cinfo->btype == BT_ALPINE) ||
+	    (cinfo->btype == BT_GD5480))
 		tmp |= 0x80;	/* 6 bit denom; ONLY 5434!!! (bugged me 10 days) */
 
 	DPRINTK ("CL_SEQR1B: %ld\n", (long) tmp);
-	vga_wseq (fb_info->regs, CL_SEQR1B, tmp);
+	vga_wseq (regbase, CL_SEQR1B, tmp);
 
-	if (_par->VertRes >= 1024)
+	if (regs.VertRes >= 1024)
 		/* 1280x1024 */
-		vga_wcrt (fb_info->regs, VGA_CRTC_MODE, 0xc7);
+		vga_wcrt (regbase, VGA_CRTC_MODE, 0xc7);
 	else
 		/* mode control: VGA_CRTC_START_HI enable, ROTATE(?), 16bit
 		 * address wrap, no compat. */
-		vga_wcrt (fb_info->regs, VGA_CRTC_MODE, 0xc3);
+		vga_wcrt (regbase, VGA_CRTC_MODE, 0xc3);
 
-/* HAEH?        vga_wcrt (fb_info->regs, VGA_CRTC_V_SYNC_END, 0x20);  * previously: 0x00  unlock VGA_CRTC_H_TOTAL..CRT7 */
+/* HAEH?        vga_wcrt (regbase, VGA_CRTC_V_SYNC_END, 0x20);  * previously: 0x00  unlock VGA_CRTC_H_TOTAL..CRT7 */
 
 	/* don't know if it would hurt to also program this if no interlaced */
 	/* mode is used, but I feel better this way.. :-) */
-	if (_par->var.vmode & FB_VMODE_INTERLACED)
-		vga_wcrt (fb_info->regs, VGA_CRTC_REGS, _par->HorizTotal / 2);
+	if (var->vmode & FB_VMODE_INTERLACED)
+		vga_wcrt (regbase, VGA_CRTC_REGS, regs.HorizTotal / 2);
 	else
-		vga_wcrt (fb_info->regs, VGA_CRTC_REGS, 0x00);	/* interlace control */
+		vga_wcrt (regbase, VGA_CRTC_REGS, 0x00);	/* interlace control */
 
-	vga_wseq (fb_info->regs, VGA_SEQ_CHARACTER_MAP, 0);
+	vga_wseq (regbase, VGA_SEQ_CHARACTER_MAP, 0);
 
 	/* adjust horizontal/vertical sync type (low/high) */
 	tmp = 0x03;		/* enable display memory & CRTC I/O address for color mode */
-	if (_par->var.sync & FB_SYNC_HOR_HIGH_ACT)
+	if (var->sync & FB_SYNC_HOR_HIGH_ACT)
 		tmp |= 0x40;
-	if (_par->var.sync & FB_SYNC_VERT_HIGH_ACT)
+	if (var->sync & FB_SYNC_VERT_HIGH_ACT)
 		tmp |= 0x80;
-	WGen (fb_info, VGA_MIS_W, tmp);
+	WGen (cinfo, VGA_MIS_W, tmp);
 
-	vga_wcrt (fb_info->regs, VGA_CRTC_PRESET_ROW, 0);	/* Screen A Preset Row-Scan register */
-	vga_wcrt (fb_info->regs, VGA_CRTC_CURSOR_START, 0);	/* text cursor on and start line */
-	vga_wcrt (fb_info->regs, VGA_CRTC_CURSOR_END, 31);	/* text cursor end line */
+	vga_wcrt (regbase, VGA_CRTC_PRESET_ROW, 0);	/* Screen A Preset Row-Scan register */
+	vga_wcrt (regbase, VGA_CRTC_CURSOR_START, 0);	/* text cursor on and start line */
+	vga_wcrt (regbase, VGA_CRTC_CURSOR_END, 31);	/* text cursor end line */
 
 	/******************************************************
 	 *
@@ -1272,12 +1175,12 @@ static void clgen_set_par (const void *par, struct fb_info_gen *info)
 	 */
 
 	/* programming for different color depths */
-	if (_par->var.bits_per_pixel == 1) {
-		DPRINTK ("clgen: preparing for 1 bit deep display\n");
-		vga_wgfx (fb_info->regs, VGA_GFX_MODE, 0);	/* mode register */
+	if (var->bits_per_pixel == 1) {
+		DPRINTK ("cirrusfb: preparing for 1 bit deep display\n");
+		vga_wgfx (regbase, VGA_GFX_MODE, 0);	/* mode register */
 
 		/* SR07 */
-		switch (fb_info->btype) {
+		switch (cinfo->btype) {
 		case BT_SD64:
 		case BT_PICCOLO:
 		case BT_PICASSO:
@@ -1286,48 +1189,48 @@ static void clgen_set_par (const void *par, struct fb_info_gen *info)
 		case BT_ALPINE:
 		case BT_GD5480:
 			DPRINTK (" (for GD54xx)\n");
-			vga_wseq (fb_info->regs, CL_SEQR7,
-				  _par->multiplexing ?
-				  	bi->sr07_1bpp_mux : bi->sr07_1bpp);
+			vga_wseq (regbase, CL_SEQR7,
+				  regs.multiplexing ?
+					bi->sr07_1bpp_mux : bi->sr07_1bpp);
 			break;
 
 		case BT_LAGUNA:
 			DPRINTK (" (for GD546x)\n");
-			vga_wseq (fb_info->regs, CL_SEQR7,
-				vga_rseq (fb_info->regs, CL_SEQR7) & ~0x01);
+			vga_wseq (regbase, CL_SEQR7,
+				vga_rseq (regbase, CL_SEQR7) & ~0x01);
 			break;
 
 		default:
-			printk (KERN_WARNING "clgen: unknown Board\n");
+			printk (KERN_WARNING "cirrusfb: unknown Board\n");
 			break;
 		}
 
 		/* Extended Sequencer Mode */
-		switch (fb_info->btype) {
+		switch (cinfo->btype) {
 		case BT_SD64:
 			/* setting the SEQRF on SD64 is not necessary (only during init) */
 			DPRINTK ("(for SD64)\n");
-			vga_wseq (fb_info->regs, CL_SEQR1F, 0x1a);		/*  MCLK select */
+			vga_wseq (regbase, CL_SEQR1F, 0x1a);		/*  MCLK select */
 			break;
 
 		case BT_PICCOLO:
 			DPRINTK ("(for Piccolo)\n");
 /* ### ueberall 0x22? */
-			vga_wseq (fb_info->regs, CL_SEQR1F, 0x22);		/* ##vorher 1c MCLK select */
-			vga_wseq (fb_info->regs, CL_SEQRF, 0xb0);	/* evtl d0 bei 1 bit? avoid FIFO underruns..? */
+			vga_wseq (regbase, CL_SEQR1F, 0x22);		/* ##vorher 1c MCLK select */
+			vga_wseq (regbase, CL_SEQRF, 0xb0);	/* evtl d0 bei 1 bit? avoid FIFO underruns..? */
 			break;
 
 		case BT_PICASSO:
 			DPRINTK ("(for Picasso)\n");
-			vga_wseq (fb_info->regs, CL_SEQR1F, 0x22);		/* ##vorher 22 MCLK select */
-			vga_wseq (fb_info->regs, CL_SEQRF, 0xd0);	/* ## vorher d0 avoid FIFO underruns..? */
+			vga_wseq (regbase, CL_SEQR1F, 0x22);		/* ##vorher 22 MCLK select */
+			vga_wseq (regbase, CL_SEQRF, 0xd0);	/* ## vorher d0 avoid FIFO underruns..? */
 			break;
 
 		case BT_SPECTRUM:
 			DPRINTK ("(for Spectrum)\n");
 /* ### ueberall 0x22? */
-			vga_wseq (fb_info->regs, CL_SEQR1F, 0x22);		/* ##vorher 1c MCLK select */
-			vga_wseq (fb_info->regs, CL_SEQRF, 0xb0);	/* evtl d0? avoid FIFO underruns..? */
+			vga_wseq (regbase, CL_SEQR1F, 0x22);		/* ##vorher 1c MCLK select */
+			vga_wseq (regbase, CL_SEQRF, 0xb0);	/* evtl d0? avoid FIFO underruns..? */
 			break;
 
 		case BT_PICASSO4:
@@ -1339,18 +1242,18 @@ static void clgen_set_par (const void *par, struct fb_info_gen *info)
 			break;
 
 		default:
-			printk (KERN_WARNING "clgen: unknown Board\n");
+			printk (KERN_WARNING "cirrusfb: unknown Board\n");
 			break;
 		}
 
-		WGen (fb_info, VGA_PEL_MSK, 0x01);	/* pixel mask: pass-through for first plane */
-		if (_par->multiplexing)
-			WHDR (fb_info, 0x4a);	/* hidden dac reg: 1280x1024 */
+		WGen (cinfo, VGA_PEL_MSK, 0x01);	/* pixel mask: pass-through for first plane */
+		if (regs.multiplexing)
+			WHDR (cinfo, 0x4a);	/* hidden dac reg: 1280x1024 */
 		else
-			WHDR (fb_info, 0);	/* hidden dac: nothing */
-		vga_wseq (fb_info->regs, VGA_SEQ_MEMORY_MODE, 0x06);	/* memory mode: odd/even, ext. memory */
-		vga_wseq (fb_info->regs, VGA_SEQ_PLANE_WRITE, 0x01);	/* plane mask: only write to first plane */
-		offset = _par->var.xres_virtual / 16;
+			WHDR (cinfo, 0);	/* hidden dac: nothing */
+		vga_wseq (regbase, VGA_SEQ_MEMORY_MODE, 0x06);	/* memory mode: odd/even, ext. memory */
+		vga_wseq (regbase, VGA_SEQ_PLANE_WRITE, 0x01);	/* plane mask: only write to first plane */
+		offset = var->xres_virtual / 16;
 	}
 
 	/******************************************************
@@ -1359,9 +1262,9 @@ static void clgen_set_par (const void *par, struct fb_info_gen *info)
 	 *
 	 */
 
-	else if (_par->var.bits_per_pixel == 8) {
-		DPRINTK ("clgen: preparing for 8 bit deep display\n");
-		switch (fb_info->btype) {
+	else if (var->bits_per_pixel == 8) {
+		DPRINTK ("cirrusfb: preparing for 8 bit deep display\n");
+		switch (cinfo->btype) {
 		case BT_SD64:
 		case BT_PICCOLO:
 		case BT_PICASSO:
@@ -1370,52 +1273,52 @@ static void clgen_set_par (const void *par, struct fb_info_gen *info)
 		case BT_ALPINE:
 		case BT_GD5480:
 			DPRINTK (" (for GD54xx)\n");
-			vga_wseq (fb_info->regs, CL_SEQR7,
-				  _par->multiplexing ?
-				  	bi->sr07_8bpp_mux : bi->sr07_8bpp);
+			vga_wseq (regbase, CL_SEQR7,
+				  regs.multiplexing ?
+					bi->sr07_8bpp_mux : bi->sr07_8bpp);
 			break;
 
 		case BT_LAGUNA:
 			DPRINTK (" (for GD546x)\n");
-			vga_wseq (fb_info->regs, CL_SEQR7,
-				vga_rseq (fb_info->regs, CL_SEQR7) | 0x01);
+			vga_wseq (regbase, CL_SEQR7,
+				vga_rseq (regbase, CL_SEQR7) | 0x01);
 			break;
 
 		default:
-			printk (KERN_WARNING "clgen: unknown Board\n");
+			printk (KERN_WARNING "cirrusfb: unknown Board\n");
 			break;
 		}
 
-		switch (fb_info->btype) {
+		switch (cinfo->btype) {
 		case BT_SD64:
-			vga_wseq (fb_info->regs, CL_SEQR1F, 0x1d);		/* MCLK select */
+			vga_wseq (regbase, CL_SEQR1F, 0x1d);		/* MCLK select */
 			break;
 
 		case BT_PICCOLO:
-			vga_wseq (fb_info->regs, CL_SEQR1F, 0x22);		/* ### vorher 1c MCLK select */
-			vga_wseq (fb_info->regs, CL_SEQRF, 0xb0);	/* Fast Page-Mode writes */
+			vga_wseq (regbase, CL_SEQR1F, 0x22);		/* ### vorher 1c MCLK select */
+			vga_wseq (regbase, CL_SEQRF, 0xb0);	/* Fast Page-Mode writes */
 			break;
 
 		case BT_PICASSO:
-			vga_wseq (fb_info->regs, CL_SEQR1F, 0x22);		/* ### vorher 1c MCLK select */
-			vga_wseq (fb_info->regs, CL_SEQRF, 0xb0);	/* Fast Page-Mode writes */
+			vga_wseq (regbase, CL_SEQR1F, 0x22);		/* ### vorher 1c MCLK select */
+			vga_wseq (regbase, CL_SEQRF, 0xb0);	/* Fast Page-Mode writes */
 			break;
 
 		case BT_SPECTRUM:
-			vga_wseq (fb_info->regs, CL_SEQR1F, 0x22);		/* ### vorher 1c MCLK select */
-			vga_wseq (fb_info->regs, CL_SEQRF, 0xb0);	/* Fast Page-Mode writes */
+			vga_wseq (regbase, CL_SEQR1F, 0x22);		/* ### vorher 1c MCLK select */
+			vga_wseq (regbase, CL_SEQRF, 0xb0);	/* Fast Page-Mode writes */
 			break;
 
 		case BT_PICASSO4:
 #ifdef CONFIG_ZORRO
-			vga_wseq (fb_info->regs, CL_SEQRF, 0xb8);	/* ### INCOMPLETE!! */
+			vga_wseq (regbase, CL_SEQRF, 0xb8);	/* ### INCOMPLETE!! */
 #endif
-/*          vga_wseq (fb_info->regs, CL_SEQR1F, 0x1c); */
+/*          vga_wseq (regbase, CL_SEQR1F, 0x1c); */
 			break;
 
 		case BT_ALPINE:
 			DPRINTK (" (for GD543x)\n");
-			clgen_set_mclk (fb_info, _par->mclk, _par->divMCLK);
+			cirrusfb_set_mclk (cinfo, regs.mclk, regs.divMCLK);
 			/* We already set SRF and SR1F */
 			break;
 
@@ -1426,19 +1329,19 @@ static void clgen_set_par (const void *par, struct fb_info_gen *info)
 			break;
 
 		default:
-			printk (KERN_WARNING "clgen: unknown Board\n");
+			printk (KERN_WARNING "cirrusfb: unknown Board\n");
 			break;
 		}
 
-		vga_wgfx (fb_info->regs, VGA_GFX_MODE, 64);	/* mode register: 256 color mode */
-		WGen (fb_info, VGA_PEL_MSK, 0xff);	/* pixel mask: pass-through all planes */
-		if (_par->multiplexing)
-			WHDR (fb_info, 0x4a);	/* hidden dac reg: 1280x1024 */
+		vga_wgfx (regbase, VGA_GFX_MODE, 64);	/* mode register: 256 color mode */
+		WGen (cinfo, VGA_PEL_MSK, 0xff);	/* pixel mask: pass-through all planes */
+		if (regs.multiplexing)
+			WHDR (cinfo, 0x4a);	/* hidden dac reg: 1280x1024 */
 		else
-			WHDR (fb_info, 0);	/* hidden dac: nothing */
-		vga_wseq (fb_info->regs, VGA_SEQ_MEMORY_MODE, 0x0a);	/* memory mode: chain4, ext. memory */
-		vga_wseq (fb_info->regs, VGA_SEQ_PLANE_WRITE, 0xff);	/* plane mask: enable writing to all 4 planes */
-		offset = _par->var.xres_virtual / 8;
+			WHDR (cinfo, 0);	/* hidden dac: nothing */
+		vga_wseq (regbase, VGA_SEQ_MEMORY_MODE, 0x0a);	/* memory mode: chain4, ext. memory */
+		vga_wseq (regbase, VGA_SEQ_PLANE_WRITE, 0xff);	/* plane mask: enable writing to all 4 planes */
+		offset = var->xres_virtual / 8;
 	}
 
 	/******************************************************
@@ -1447,74 +1350,74 @@ static void clgen_set_par (const void *par, struct fb_info_gen *info)
 	 *
 	 */
 
-	else if (_par->var.bits_per_pixel == 16) {
-		DPRINTK ("clgen: preparing for 16 bit deep display\n");
-		switch (fb_info->btype) {
+	else if (var->bits_per_pixel == 16) {
+		DPRINTK ("cirrusfb: preparing for 16 bit deep display\n");
+		switch (cinfo->btype) {
 		case BT_SD64:
-			vga_wseq (fb_info->regs, CL_SEQR7, 0xf7);	/* Extended Sequencer Mode: 256c col. mode */
-			vga_wseq (fb_info->regs, CL_SEQR1F, 0x1e);		/* MCLK select */
+			vga_wseq (regbase, CL_SEQR7, 0xf7);	/* Extended Sequencer Mode: 256c col. mode */
+			vga_wseq (regbase, CL_SEQR1F, 0x1e);		/* MCLK select */
 			break;
 
 		case BT_PICCOLO:
-			vga_wseq (fb_info->regs, CL_SEQR7, 0x87);
-			vga_wseq (fb_info->regs, CL_SEQRF, 0xb0);	/* Fast Page-Mode writes */
-			vga_wseq (fb_info->regs, CL_SEQR1F, 0x22);		/* MCLK select */
+			vga_wseq (regbase, CL_SEQR7, 0x87);
+			vga_wseq (regbase, CL_SEQRF, 0xb0);	/* Fast Page-Mode writes */
+			vga_wseq (regbase, CL_SEQR1F, 0x22);		/* MCLK select */
 			break;
 
 		case BT_PICASSO:
-			vga_wseq (fb_info->regs, CL_SEQR7, 0x27);
-			vga_wseq (fb_info->regs, CL_SEQRF, 0xb0);	/* Fast Page-Mode writes */
-			vga_wseq (fb_info->regs, CL_SEQR1F, 0x22);		/* MCLK select */
+			vga_wseq (regbase, CL_SEQR7, 0x27);
+			vga_wseq (regbase, CL_SEQRF, 0xb0);	/* Fast Page-Mode writes */
+			vga_wseq (regbase, CL_SEQR1F, 0x22);		/* MCLK select */
 			break;
 
 		case BT_SPECTRUM:
-			vga_wseq (fb_info->regs, CL_SEQR7, 0x87);
-			vga_wseq (fb_info->regs, CL_SEQRF, 0xb0);	/* Fast Page-Mode writes */
-			vga_wseq (fb_info->regs, CL_SEQR1F, 0x22);		/* MCLK select */
+			vga_wseq (regbase, CL_SEQR7, 0x87);
+			vga_wseq (regbase, CL_SEQRF, 0xb0);	/* Fast Page-Mode writes */
+			vga_wseq (regbase, CL_SEQR1F, 0x22);		/* MCLK select */
 			break;
 
 		case BT_PICASSO4:
-			vga_wseq (fb_info->regs, CL_SEQR7, 0x27);
-/*          vga_wseq (fb_info->regs, CL_SEQR1F, 0x1c);  */
+			vga_wseq (regbase, CL_SEQR7, 0x27);
+/*          vga_wseq (regbase, CL_SEQR1F, 0x1c);  */
 			break;
 
 		case BT_ALPINE:
 			DPRINTK (" (for GD543x)\n");
-			if (_par->HorizRes >= 1024)
-				vga_wseq (fb_info->regs, CL_SEQR7, 0xa7);
+			if (regs.HorizRes >= 1024)
+				vga_wseq (regbase, CL_SEQR7, 0xa7);
 			else
-				vga_wseq (fb_info->regs, CL_SEQR7, 0xa3);
-			clgen_set_mclk (fb_info, _par->mclk, _par->divMCLK);
+				vga_wseq (regbase, CL_SEQR7, 0xa3);
+			cirrusfb_set_mclk (cinfo, regs.mclk, regs.divMCLK);
 			break;
 
 		case BT_GD5480:
 			DPRINTK (" (for GD5480)\n");
-			vga_wseq (fb_info->regs, CL_SEQR7, 0x17);
+			vga_wseq (regbase, CL_SEQR7, 0x17);
 			/* We already set SRF and SR1F */
 			break;
 
 		case BT_LAGUNA:
 			DPRINTK (" (for GD546x)\n");
-			vga_wseq (fb_info->regs, CL_SEQR7,
-				vga_rseq (fb_info->regs, CL_SEQR7) & ~0x01);
+			vga_wseq (regbase, CL_SEQR7,
+				vga_rseq (regbase, CL_SEQR7) & ~0x01);
 			break;
 
 		default:
-			printk (KERN_WARNING "CLGEN: unknown Board\n");
+			printk (KERN_WARNING "CIRRUSFB: unknown Board\n");
 			break;
 		}
 
-		vga_wgfx (fb_info->regs, VGA_GFX_MODE, 64);	/* mode register: 256 color mode */
-		WGen (fb_info, VGA_PEL_MSK, 0xff);	/* pixel mask: pass-through all planes */
+		vga_wgfx (regbase, VGA_GFX_MODE, 64);	/* mode register: 256 color mode */
+		WGen (cinfo, VGA_PEL_MSK, 0xff);	/* pixel mask: pass-through all planes */
 #ifdef CONFIG_PCI
-		WHDR (fb_info, 0xc0);	/* Copy Xbh */
+		WHDR (cinfo, 0xc0);	/* Copy Xbh */
 #elif defined(CONFIG_ZORRO)
 		/* FIXME: CONFIG_PCI and CONFIG_ZORRO may be defined both */
-		WHDR (fb_info, 0xa0);	/* hidden dac reg: nothing special */
+		WHDR (cinfo, 0xa0);	/* hidden dac reg: nothing special */
 #endif
-		vga_wseq (fb_info->regs, VGA_SEQ_MEMORY_MODE, 0x0a);	/* memory mode: chain4, ext. memory */
-		vga_wseq (fb_info->regs, VGA_SEQ_PLANE_WRITE, 0xff);	/* plane mask: enable writing to all 4 planes */
-		offset = _par->var.xres_virtual / 4;
+		vga_wseq (regbase, VGA_SEQ_MEMORY_MODE, 0x0a);	/* memory mode: chain4, ext. memory */
+		vga_wseq (regbase, VGA_SEQ_PLANE_WRITE, 0xff);	/* plane mask: enable writing to all 4 planes */
+		offset = var->xres_virtual / 4;
 	}
 
 	/******************************************************
@@ -1523,66 +1426,66 @@ static void clgen_set_par (const void *par, struct fb_info_gen *info)
 	 *
 	 */
 
-	else if (_par->var.bits_per_pixel == 32) {
-		DPRINTK ("clgen: preparing for 24/32 bit deep display\n");
-		switch (fb_info->btype) {
+	else if (var->bits_per_pixel == 32) {
+		DPRINTK ("cirrusfb: preparing for 24/32 bit deep display\n");
+		switch (cinfo->btype) {
 		case BT_SD64:
-			vga_wseq (fb_info->regs, CL_SEQR7, 0xf9);	/* Extended Sequencer Mode: 256c col. mode */
-			vga_wseq (fb_info->regs, CL_SEQR1F, 0x1e);		/* MCLK select */
+			vga_wseq (regbase, CL_SEQR7, 0xf9);	/* Extended Sequencer Mode: 256c col. mode */
+			vga_wseq (regbase, CL_SEQR1F, 0x1e);		/* MCLK select */
 			break;
 
 		case BT_PICCOLO:
-			vga_wseq (fb_info->regs, CL_SEQR7, 0x85);
-			vga_wseq (fb_info->regs, CL_SEQRF, 0xb0);	/* Fast Page-Mode writes */
-			vga_wseq (fb_info->regs, CL_SEQR1F, 0x22);		/* MCLK select */
+			vga_wseq (regbase, CL_SEQR7, 0x85);
+			vga_wseq (regbase, CL_SEQRF, 0xb0);	/* Fast Page-Mode writes */
+			vga_wseq (regbase, CL_SEQR1F, 0x22);		/* MCLK select */
 			break;
 
 		case BT_PICASSO:
-			vga_wseq (fb_info->regs, CL_SEQR7, 0x25);
-			vga_wseq (fb_info->regs, CL_SEQRF, 0xb0);	/* Fast Page-Mode writes */
-			vga_wseq (fb_info->regs, CL_SEQR1F, 0x22);		/* MCLK select */
+			vga_wseq (regbase, CL_SEQR7, 0x25);
+			vga_wseq (regbase, CL_SEQRF, 0xb0);	/* Fast Page-Mode writes */
+			vga_wseq (regbase, CL_SEQR1F, 0x22);		/* MCLK select */
 			break;
 
 		case BT_SPECTRUM:
-			vga_wseq (fb_info->regs, CL_SEQR7, 0x85);
-			vga_wseq (fb_info->regs, CL_SEQRF, 0xb0);	/* Fast Page-Mode writes */
-			vga_wseq (fb_info->regs, CL_SEQR1F, 0x22);		/* MCLK select */
+			vga_wseq (regbase, CL_SEQR7, 0x85);
+			vga_wseq (regbase, CL_SEQRF, 0xb0);	/* Fast Page-Mode writes */
+			vga_wseq (regbase, CL_SEQR1F, 0x22);		/* MCLK select */
 			break;
 
 		case BT_PICASSO4:
-			vga_wseq (fb_info->regs, CL_SEQR7, 0x25);
-/*          vga_wseq (fb_info->regs, CL_SEQR1F, 0x1c);  */
+			vga_wseq (regbase, CL_SEQR7, 0x25);
+/*          vga_wseq (regbase, CL_SEQR1F, 0x1c);  */
 			break;
 
 		case BT_ALPINE:
 			DPRINTK (" (for GD543x)\n");
-			vga_wseq (fb_info->regs, CL_SEQR7, 0xa9);
-			clgen_set_mclk (fb_info, _par->mclk, _par->divMCLK);
+			vga_wseq (regbase, CL_SEQR7, 0xa9);
+			cirrusfb_set_mclk (cinfo, regs.mclk, regs.divMCLK);
 			break;
 
 		case BT_GD5480:
 			DPRINTK (" (for GD5480)\n");
-			vga_wseq (fb_info->regs, CL_SEQR7, 0x19);
+			vga_wseq (regbase, CL_SEQR7, 0x19);
 			/* We already set SRF and SR1F */
 			break;
 
 		case BT_LAGUNA:
 			DPRINTK (" (for GD546x)\n");
-			vga_wseq (fb_info->regs, CL_SEQR7,
-				vga_rseq (fb_info->regs, CL_SEQR7) & ~0x01);
+			vga_wseq (regbase, CL_SEQR7,
+				vga_rseq (regbase, CL_SEQR7) & ~0x01);
 			break;
 
 		default:
-			printk (KERN_WARNING "clgen: unknown Board\n");
+			printk (KERN_WARNING "cirrusfb: unknown Board\n");
 			break;
 		}
 
-		vga_wgfx (fb_info->regs, VGA_GFX_MODE, 64);	/* mode register: 256 color mode */
-		WGen (fb_info, VGA_PEL_MSK, 0xff);	/* pixel mask: pass-through all planes */
-		WHDR (fb_info, 0xc5);	/* hidden dac reg: 8-8-8 mode (24 or 32) */
-		vga_wseq (fb_info->regs, VGA_SEQ_MEMORY_MODE, 0x0a);	/* memory mode: chain4, ext. memory */
-		vga_wseq (fb_info->regs, VGA_SEQ_PLANE_WRITE, 0xff);	/* plane mask: enable writing to all 4 planes */
-		offset = _par->var.xres_virtual / 4;
+		vga_wgfx (regbase, VGA_GFX_MODE, 64);	/* mode register: 256 color mode */
+		WGen (cinfo, VGA_PEL_MSK, 0xff);	/* pixel mask: pass-through all planes */
+		WHDR (cinfo, 0xc5);	/* hidden dac reg: 8-8-8 mode (24 or 32) */
+		vga_wseq (regbase, VGA_SEQ_MEMORY_MODE, 0x0a);	/* memory mode: chain4, ext. memory */
+		vga_wseq (regbase, VGA_SEQ_PLANE_WRITE, 0xff);	/* plane mask: enable writing to all 4 planes */
+		offset = var->xres_virtual / 4;
 	}
 
 	/******************************************************
@@ -1592,47 +1495,47 @@ static void clgen_set_par (const void *par, struct fb_info_gen *info)
 	 */
 
 	else {
-		printk (KERN_ERR "clgen: What's this?? requested color depth == %d.\n",
-			_par->var.bits_per_pixel);
+		printk (KERN_ERR "cirrusfb: What's this?? requested color depth == %d.\n",
+			var->bits_per_pixel);
 	}
 
-	vga_wcrt (fb_info->regs, VGA_CRTC_OFFSET, offset & 0xff);
+	vga_wcrt (regbase, VGA_CRTC_OFFSET, offset & 0xff);
 	tmp = 0x22;
 	if (offset & 0x100)
 		tmp |= 0x10;	/* offset overflow bit */
 
-	vga_wcrt (fb_info->regs, CL_CRT1B, tmp);	/* screen start addr #16-18, fastpagemode cycles */
+	vga_wcrt (regbase, CL_CRT1B, tmp);	/* screen start addr #16-18, fastpagemode cycles */
 
-	if (fb_info->btype == BT_SD64 ||
-	    fb_info->btype == BT_PICASSO4 ||
-	    fb_info->btype == BT_ALPINE ||
-	    fb_info->btype == BT_GD5480)
-		vga_wcrt (fb_info->regs, CL_CRT1D, 0x00);	/* screen start address bit 19 */
+	if (cinfo->btype == BT_SD64 ||
+	    cinfo->btype == BT_PICASSO4 ||
+	    cinfo->btype == BT_ALPINE ||
+	    cinfo->btype == BT_GD5480)
+		vga_wcrt (regbase, CL_CRT1D, 0x00);	/* screen start address bit 19 */
 
-	vga_wcrt (fb_info->regs, VGA_CRTC_CURSOR_HI, 0);	/* text cursor location high */
-	vga_wcrt (fb_info->regs, VGA_CRTC_CURSOR_LO, 0);	/* text cursor location low */
-	vga_wcrt (fb_info->regs, VGA_CRTC_UNDERLINE, 0);	/* underline row scanline = at very bottom */
+	vga_wcrt (regbase, VGA_CRTC_CURSOR_HI, 0);	/* text cursor location high */
+	vga_wcrt (regbase, VGA_CRTC_CURSOR_LO, 0);	/* text cursor location low */
+	vga_wcrt (regbase, VGA_CRTC_UNDERLINE, 0);	/* underline row scanline = at very bottom */
 
-	vga_wattr (fb_info->regs, VGA_ATC_MODE, 1);	/* controller mode */
-	vga_wattr (fb_info->regs, VGA_ATC_OVERSCAN, 0);		/* overscan (border) color */
-	vga_wattr (fb_info->regs, VGA_ATC_PLANE_ENABLE, 15);	/* color plane enable */
-	vga_wattr (fb_info->regs, CL_AR33, 0);	/* pixel panning */
-	vga_wattr (fb_info->regs, VGA_ATC_COLOR_PAGE, 0);	/* color select */
+	vga_wattr (regbase, VGA_ATC_MODE, 1);	/* controller mode */
+	vga_wattr (regbase, VGA_ATC_OVERSCAN, 0);		/* overscan (border) color */
+	vga_wattr (regbase, VGA_ATC_PLANE_ENABLE, 15);	/* color plane enable */
+	vga_wattr (regbase, CL_AR33, 0);	/* pixel panning */
+	vga_wattr (regbase, VGA_ATC_COLOR_PAGE, 0);	/* color select */
 
 	/* [ EGS: SetOffset(); ] */
 	/* From SetOffset(): Turn on VideoEnable bit in Attribute controller */
-	AttrOn (fb_info);
+	AttrOn (cinfo);
 
-	vga_wgfx (fb_info->regs, VGA_GFX_SR_VALUE, 0);	/* set/reset register */
-	vga_wgfx (fb_info->regs, VGA_GFX_SR_ENABLE, 0);		/* set/reset enable */
-	vga_wgfx (fb_info->regs, VGA_GFX_COMPARE_VALUE, 0);	/* color compare */
-	vga_wgfx (fb_info->regs, VGA_GFX_DATA_ROTATE, 0);	/* data rotate */
-	vga_wgfx (fb_info->regs, VGA_GFX_PLANE_READ, 0);	/* read map select */
-	vga_wgfx (fb_info->regs, VGA_GFX_MISC, 1);	/* miscellaneous register */
-	vga_wgfx (fb_info->regs, VGA_GFX_COMPARE_MASK, 15);	/* color don't care */
-	vga_wgfx (fb_info->regs, VGA_GFX_BIT_MASK, 255);	/* bit mask */
+	vga_wgfx (regbase, VGA_GFX_SR_VALUE, 0);	/* set/reset register */
+	vga_wgfx (regbase, VGA_GFX_SR_ENABLE, 0);		/* set/reset enable */
+	vga_wgfx (regbase, VGA_GFX_COMPARE_VALUE, 0);	/* color compare */
+	vga_wgfx (regbase, VGA_GFX_DATA_ROTATE, 0);	/* data rotate */
+	vga_wgfx (regbase, VGA_GFX_PLANE_READ, 0);	/* read map select */
+	vga_wgfx (regbase, VGA_GFX_MISC, 1);	/* miscellaneous register */
+	vga_wgfx (regbase, VGA_GFX_COMPARE_MASK, 15);	/* color don't care */
+	vga_wgfx (regbase, VGA_GFX_BIT_MASK, 255);	/* bit mask */
 
-	vga_wseq (fb_info->regs, CL_SEQR12, 0x0);	/* graphics cursor attributes: nothing special */
+	vga_wseq (regbase, CL_SEQR12, 0x0);	/* graphics cursor attributes: nothing special */
 
 	/* finally, turn on everything - turn off "FullBandwidth" bit */
 	/* also, set "DotClock%2" bit where requested */
@@ -1643,149 +1546,112 @@ static void clgen_set_par (const void *par, struct fb_info_gen *info)
 	tmp |= 0x08;
 */
 
-	vga_wseq (fb_info->regs, VGA_SEQ_CLOCK_MODE, tmp);
+	vga_wseq (regbase, VGA_SEQ_CLOCK_MODE, tmp);
 	DPRINTK ("CL_SEQR1: %d\n", tmp);
 
-	fb_info->currentmode = *_par;
+	cinfo->currentmode = regs;
+	info->fix.type = regs.type;
+	info->fix.visual = regs.visual;
+	info->fix.line_length = regs.line_length;
 
-	DPRINTK ("virtual offset: (%d,%d)\n", _par->var.xoffset, _par->var.yoffset);
 	/* pan to requested offset */
-	clgen_pan_display (&fb_info->currentmode.var, (struct fb_info_gen *) fb_info);
+	cirrusfb_pan_display (var, info);
 
-#ifdef CLGEN_DEBUG
-	clgen_dump ();
+#ifdef CIRRUSFB_DEBUG
+	cirrusfb_dump ();
 #endif
 
 	DPRINTK ("EXIT\n");
-	return;
+	return 0;
 }
 
-
-static int clgen_getcolreg (unsigned regno, unsigned *red, unsigned *green,
-			    unsigned *blue, unsigned *transp,
-			    struct fb_info *info)
+/* for some reason incomprehensible to me, cirrusfb requires that you write
+ * the registers twice for the settings to take..grr. -dte */
+int cirrusfb_set_par (struct fb_info *info)
 {
-    struct clgenfb_info *fb_info = (struct clgenfb_info *)info;
-
-    if (regno > 255)
-	return 1;
-    *red = fb_info->palette[regno].red;
-    *green = fb_info->palette[regno].green;
-    *blue = fb_info->palette[regno].blue;
-    *transp = 0;
-    return 0;
+	cirrusfb_set_par_foo (info);
+	return cirrusfb_set_par_foo (info);
 }
 
-
-static int clgenfb_setcolreg (unsigned regno, unsigned red, unsigned green,
-			      unsigned blue, unsigned transp,
-			      struct fb_info *info)
+int cirrusfb_setcolreg (unsigned regno, unsigned red, unsigned green,
+			unsigned blue, unsigned transp,
+			struct fb_info *info)
 {
-	struct clgenfb_info *fb_info = (struct clgenfb_info *) info;
+	struct cirrusfb_info *cinfo = info->par;
 
 	if (regno > 255)
 		return -EINVAL;
 
-#ifdef FBCON_HAS_CFB8
-	switch (fb_info->currentmode.var.bits_per_pixel) {
-	case 8:
-		/* "transparent" stuff is completely ignored. */
-		WClut (fb_info, regno, red >> 10, green >> 10, blue >> 10);
-		break;
-	default:
-		/* do nothing */
-		break;
-	}
-#endif	/* FBCON_HAS_CFB8 */
-
-	fb_info->palette[regno].red = red;
-	fb_info->palette[regno].green = green;
-	fb_info->palette[regno].blue = blue;
-
-	if (regno >= 16)
-		return 0;
-
-	switch (fb_info->currentmode.var.bits_per_pixel) {
-
-#ifdef FBCON_HAS_CFB16
-	case 16:
-		assert (regno < 16);
-		if(isPReP) {
-			fb_info->fbcon_cmap.cfb16[regno] =
-			    ((red & 0xf800) >> 9) |
-			    ((green & 0xf800) >> 14) |
-			    ((green & 0xf800) << 2) |
-			    ((blue & 0xf800) >> 3);
-		} else {
-			fb_info->fbcon_cmap.cfb16[regno] =
-			    ((red & 0xf800) >> 1) |
-			    ((green & 0xf800) >> 6) |
-			    ((blue & 0xf800) >> 11);
+	if (info->fix.visual == FB_VISUAL_TRUECOLOR) {
+		u32 v;
+		red >>= (16 - info->var.red.length);
+		green >>= (16 - info->var.green.length);
+		blue >>= (16 - info->var.blue.length);
+
+		if (regno>=16)
+			return 1;
+		v = (red << info->var.red.offset) |
+		    (green << info->var.green.offset) |
+		    (blue << info->var.blue.offset);
+
+		switch (info->var.bits_per_pixel) {
+			case 8:
+				((u8*)(info->pseudo_palette))[regno] = v;
+				break;
+			case 16:
+				((u16*)(info->pseudo_palette))[regno] = v;
+				break;
+			case 24:
+			case 32:
+				((u32*)(info->pseudo_palette))[regno] = v;
+				break;
 		}
-#endif /* FBCON_HAS_CFB16 */
+		return 0;
+	}
 
-#ifdef FBCON_HAS_CFB24
-	case 24:
-		assert (regno < 16);
-		fb_info->fbcon_cmap.cfb24[regno] =
-			(red   << fb_info->currentmode.var.red.offset)   |
-			(green << fb_info->currentmode.var.green.offset) |
-			(blue  << fb_info->currentmode.var.blue.offset);
-		break;
-#endif /* FBCON_HAS_CFB24 */
+	cinfo->palette[regno].red = red;
+	cinfo->palette[regno].green = green;
+	cinfo->palette[regno].blue = blue;
 
-#ifdef FBCON_HAS_CFB32
-	case 32:
-		assert (regno < 16);
-		if(isPReP) {
-			fb_info->fbcon_cmap.cfb32[regno] =
-			    ((red & 0xff00)) |
-			    ((green & 0xff00) << 8) |
-			    ((blue & 0xff00) << 16);
-		} else {
-			fb_info->fbcon_cmap.cfb32[regno] =
-			    ((red & 0xff00) << 8) |
-			    ((green & 0xff00)) |
-			    ((blue & 0xff00) >> 8);
-		}
-		break;
-#endif /* FBCON_HAS_CFB32 */
-	default:
-		/* do nothing */
-		break;
+	if (info->var.bits_per_pixel == 8) {
+			WClut (cinfo, regno, red >> 10, green >> 10, blue >> 10);
 	}
 
 	return 0;
+
 }
 
 /*************************************************************************
-	clgen_pan_display()
+	cirrusfb_pan_display()
 
 	performs display panning - provided hardware permits this
 **************************************************************************/
-static int clgen_pan_display (const struct fb_var_screeninfo *var,
-			      struct fb_info_gen *info)
+int cirrusfb_pan_display (struct fb_var_screeninfo *var,
+			  struct fb_info *info)
 {
 	int xoffset = 0;
 	int yoffset = 0;
 	unsigned long base;
 	unsigned char tmp = 0, tmp2 = 0, xpix;
-	struct clgenfb_info *fb_info = (struct clgenfb_info *) info;
+	struct cirrusfb_info *cinfo = info->par;
 
 	DPRINTK ("ENTER\n");
+	DPRINTK ("virtual offset: (%d,%d)\n", var->xoffset, var->yoffset);
 
 	/* no range checks for xoffset and yoffset,   */
-	/* as fbgen_pan_display has already done this */
+	/* as fb_pan_display has already done this */
+	if (var->vmode & FB_VMODE_YWRAP)
+		return -EINVAL;
 
-	fb_info->currentmode.var.xoffset = var->xoffset;
-	fb_info->currentmode.var.yoffset = var->yoffset;
+	info->var.xoffset = var->xoffset;
+	info->var.yoffset = var->yoffset;
 
-	xoffset = var->xoffset * fb_info->currentmode.var.bits_per_pixel / 8;
+	xoffset = var->xoffset * info->var.bits_per_pixel / 8;
 	yoffset = var->yoffset;
 
-	base = yoffset * fb_info->currentmode.line_length + xoffset;
+	base = yoffset * cinfo->currentmode.line_length + xoffset;
 
-	if (fb_info->currentmode.var.bits_per_pixel == 1) {
+	if (info->var.bits_per_pixel == 1) {
 		/* base is already correct */
 		xpix = (unsigned char) (var->xoffset % 8);
 	} else {
@@ -1793,9 +1659,11 @@ static int clgen_pan_display (const struct fb_var_screeninfo *var,
 		xpix = (unsigned char) ((xoffset % 4) * 2);
 	}
 
+        cirrusfb_WaitBLT(cinfo->regbase); /* make sure all the BLT's are done */
+
 	/* lower 8 + 8 bits of screen start address */
-	vga_wcrt (fb_info->regs, VGA_CRTC_START_LO, (unsigned char) (base & 0xff));
-	vga_wcrt (fb_info->regs, VGA_CRTC_START_HI, (unsigned char) (base >> 8));
+	vga_wcrt (cinfo->regbase, VGA_CRTC_START_LO, (unsigned char) (base & 0xff));
+	vga_wcrt (cinfo->regbase, VGA_CRTC_START_HI, (unsigned char) (base >> 8));
 
 	/* construct bits 16, 17 and 18 of screen start address */
 	if (base & 0x10000)
@@ -1805,29 +1673,30 @@ static int clgen_pan_display (const struct fb_var_screeninfo *var,
 	if (base & 0x40000)
 		tmp |= 0x08;
 
-	tmp2 = (vga_rcrt (fb_info->regs, CL_CRT1B) & 0xf2) | tmp;	/* 0xf2 is %11110010, exclude tmp bits */
-	vga_wcrt (fb_info->regs, CL_CRT1B, tmp2);
+	tmp2 = (vga_rcrt (cinfo->regbase, CL_CRT1B) & 0xf2) | tmp;	/* 0xf2 is %11110010, exclude tmp bits */
+	vga_wcrt (cinfo->regbase, CL_CRT1B, tmp2);
 
 	/* construct bit 19 of screen start address */
-	if (clgen_board_info[fb_info->btype].scrn_start_bit19) {
+	if (cirrusfb_board_info[cinfo->btype].scrn_start_bit19) {
 		tmp2 = 0;
 		if (base & 0x80000)
 			tmp2 = 0x80;
-		vga_wcrt (fb_info->regs, CL_CRT1D, tmp2);
+		vga_wcrt (cinfo->regbase, CL_CRT1D, tmp2);
 	}
 
 	/* write pixel panning value to AR33; this does not quite work in 8bpp */
 	/* ### Piccolo..? Will this work? */
-	if (fb_info->currentmode.var.bits_per_pixel == 1)
-		vga_wattr (fb_info->regs, CL_AR33, xpix);
+	if (info->var.bits_per_pixel == 1)
+		vga_wattr (cinfo->regbase, CL_AR33, xpix);
 
+	cirrusfb_WaitBLT (cinfo->regbase);
 
 	DPRINTK ("EXIT\n");
 	return (0);
 }
 
 
-static int clgen_blank (int blank_mode, struct fb_info_gen *info)
+int cirrusfb_blank (int blank_mode, struct fb_info *info)
 {
 	/*
 	 *  Blank the screen if blank_mode != 0, else unblank. If blank == NULL
@@ -1840,57 +1709,51 @@ static int clgen_blank (int blank_mode, struct fb_info_gen *info)
 	 *    blank_mode == 4: powerdown
 	 */
 	unsigned char val;
-	static int current_mode = 0;
-	struct clgenfb_info *fb_info = (struct clgenfb_info *) info;
+	struct cirrusfb_info *cinfo = info->par;
+	int current_mode = cinfo->blank_mode;
 
 	DPRINTK ("ENTER, blank mode = %d\n", blank_mode);
 
-	if (current_mode == blank_mode) {
+	if (info->state != FBINFO_STATE_RUNNING ||
+	    current_mode == blank_mode) {
 		DPRINTK ("EXIT, returning 0\n");
 		return 0;
 	}
 
 	/* Undo current */
-	switch (current_mode) {
-	case 0:		/* Screen is normal */
-		break;
-	case 1:		/* Screen is blanked */
-		val = vga_rseq (fb_info->regs, VGA_SEQ_CLOCK_MODE);
-		vga_wseq (fb_info->regs, VGA_SEQ_CLOCK_MODE, val & 0xdf);	/* clear "FullBandwidth" bit */
-		break;
-	case 2:		/* vsync suspended */
-	case 3:		/* hsync suspended */
-	case 4:		/* sceen is powered down */
-		vga_wgfx (fb_info->regs, CL_GRE, 0x00);
-		break;
-	default:
-		DPRINTK ("EXIT, returning 1\n");
-		return 1;
+	if (current_mode != VESA_NO_BLANKING) {
+		/* unblank the screen */
+		val = vga_rseq (cinfo->regbase, VGA_SEQ_CLOCK_MODE);
+		vga_wseq (cinfo->regbase, VGA_SEQ_CLOCK_MODE, val & 0xdf);	/* clear "FullBandwidth" bit */
+		/* and undo VESA suspend trickery */
+		vga_wgfx (cinfo->regbase, CL_GRE, 0x00);
 	}
 
 	/* set new */
+	if(blank_mode != VESA_NO_BLANKING) {
+		/* blank the screen */
+		val = vga_rseq (cinfo->regbase, VGA_SEQ_CLOCK_MODE);
+		vga_wseq (cinfo->regbase, VGA_SEQ_CLOCK_MODE, val | 0x20);	/* set "FullBandwidth" bit */
+	}
+
 	switch (blank_mode) {
-	case 0:		/* Unblank screen */
+	case VESA_NO_BLANKING:
 		break;
-	case 1:		/* Blank screen */
-		val = vga_rseq (fb_info->regs, VGA_SEQ_CLOCK_MODE);
-		vga_wseq (fb_info->regs, VGA_SEQ_CLOCK_MODE, val | 0x20);	/* set "FullBandwidth" bit */
+	case VESA_VSYNC_SUSPEND:
+		vga_wgfx (cinfo->regbase, CL_GRE, 0x04);
 		break;
-	case 2:		/* suspend vsync */
-		vga_wgfx (fb_info->regs, CL_GRE, 0x04);
+	case VESA_HSYNC_SUSPEND:
+		vga_wgfx (cinfo->regbase, CL_GRE, 0x02);
 		break;
-	case 3:		/* suspend hsync */
-		vga_wgfx (fb_info->regs, CL_GRE, 0x02);
-		break;
-	case 4:		/* powerdown */
-		vga_wgfx (fb_info->regs, CL_GRE, 0x06);
+	case VESA_POWERDOWN:
+		vga_wgfx (cinfo->regbase, CL_GRE, 0x06);
 		break;
 	default:
 		DPRINTK ("EXIT, returning 1\n");
 		return 1;
 	}
 
-	current_mode = blank_mode;
+	cinfo->blank_mode = blank_mode;
 	DPRINTK ("EXIT, returning 0\n");
 	return 0;
 }
@@ -1898,45 +1761,45 @@ static int clgen_blank (int blank_mode, struct fb_info_gen *info)
 /****************************************************************************/
 /**** BEGIN Internal Routines ***********************************************/
 
-static void __init init_vgachip (struct clgenfb_info *fb_info)
+static void init_vgachip (struct cirrusfb_info *cinfo)
 {
-	const struct clgen_board_info_rec *bi;
+	const struct cirrusfb_board_info_rec *bi;
 
 	DPRINTK ("ENTER\n");
 
-	assert (fb_info != NULL);
+	assert (cinfo != NULL);
 
-	bi = &clgen_board_info[fb_info->btype];
+	bi = &cirrusfb_board_info[cinfo->btype];
 
 	/* reset board globally */
-	switch (fb_info->btype) {
+	switch (cinfo->btype) {
 	case BT_PICCOLO:
-		WSFR (fb_info, 0x01);
+		WSFR (cinfo, 0x01);
 		udelay (500);
-		WSFR (fb_info, 0x51);
+		WSFR (cinfo, 0x51);
 		udelay (500);
 		break;
 	case BT_PICASSO:
-		WSFR2 (fb_info, 0xff);
+		WSFR2 (cinfo, 0xff);
 		udelay (500);
 		break;
 	case BT_SD64:
 	case BT_SPECTRUM:
-		WSFR (fb_info, 0x1f);
+		WSFR (cinfo, 0x1f);
 		udelay (500);
-		WSFR (fb_info, 0x4f);
+		WSFR (cinfo, 0x4f);
 		udelay (500);
 		break;
 	case BT_PICASSO4:
-		vga_wcrt (fb_info->regs, CL_CRT51, 0x00);	/* disable flickerfixer */
+		vga_wcrt (cinfo->regbase, CL_CRT51, 0x00);	/* disable flickerfixer */
 		mdelay (100);
-		vga_wgfx (fb_info->regs, CL_GR2F, 0x00);	/* from Klaus' NetBSD driver: */
-		vga_wgfx (fb_info->regs, CL_GR33, 0x00);	/* put blitter into 542x compat */
-		vga_wgfx (fb_info->regs, CL_GR31, 0x00);	/* mode */
+		vga_wgfx (cinfo->regbase, CL_GR2F, 0x00);	/* from Klaus' NetBSD driver: */
+		vga_wgfx (cinfo->regbase, CL_GR33, 0x00);	/* put blitter into 542x compat */
+		vga_wgfx (cinfo->regbase, CL_GR31, 0x00);	/* mode */
 		break;
 
 	case BT_GD5480:
-		vga_wgfx (fb_info->regs, CL_GR2F, 0x00);	/* from Klaus' NetBSD driver: */
+		vga_wgfx (cinfo->regbase, CL_GR2F, 0x00);	/* from Klaus' NetBSD driver: */
 		break;
 
 	case BT_ALPINE:
@@ -1944,220 +1807,190 @@ static void __init init_vgachip (struct clgenfb_info *fb_info)
 		break;
 
 	default:
-		printk (KERN_ERR "clgen: Warning: Unknown board type\n");
+		printk (KERN_ERR "cirrusfb: Warning: Unknown board type\n");
 		break;
 	}
 
-	assert (fb_info->size > 0); /* make sure RAM size set by this point */
-
-	/* assume it's a "large memory" board (2/4 MB) */
-	fb_info->smallboard = FALSE;
+	assert (cinfo->size > 0); /* make sure RAM size set by this point */
 
 	/* the P4 is not fully initialized here; I rely on it having been */
 	/* inited under AmigaOS already, which seems to work just fine    */
 	/* (Klaus advised to do it this way)                              */
 
-	if (fb_info->btype != BT_PICASSO4) {
-		WGen (fb_info, CL_VSSM, 0x10);	/* EGS: 0x16 */
-		WGen (fb_info, CL_POS102, 0x01);
-		WGen (fb_info, CL_VSSM, 0x08);	/* EGS: 0x0e */
+	if (cinfo->btype != BT_PICASSO4) {
+		WGen (cinfo, CL_VSSM, 0x10);	/* EGS: 0x16 */
+		WGen (cinfo, CL_POS102, 0x01);
+		WGen (cinfo, CL_VSSM, 0x08);	/* EGS: 0x0e */
 
-		if (fb_info->btype != BT_SD64)
-			WGen (fb_info, CL_VSSM2, 0x01);
+		if (cinfo->btype != BT_SD64)
+			WGen (cinfo, CL_VSSM2, 0x01);
 
-		vga_wseq (fb_info->regs, CL_SEQR0, 0x03);	/* reset sequencer logic */
+		vga_wseq (cinfo->regbase, CL_SEQR0, 0x03);	/* reset sequencer logic */
 
-		vga_wseq (fb_info->regs, VGA_SEQ_CLOCK_MODE, 0x21);	/* FullBandwidth (video off) and 8/9 dot clock */
-		WGen (fb_info, VGA_MIS_W, 0xc1);	/* polarity (-/-), disable access to display memory, VGA_CRTC_START_HI base address: color */
+		vga_wseq (cinfo->regbase, VGA_SEQ_CLOCK_MODE, 0x21);	/* FullBandwidth (video off) and 8/9 dot clock */
+		WGen (cinfo, VGA_MIS_W, 0xc1);	/* polarity (-/-), disable access to display memory, VGA_CRTC_START_HI base address: color */
 
-/*      vga_wgfx (fb_info->regs, CL_GRA, 0xce);    "magic cookie" - doesn't make any sense to me.. */
-		vga_wseq (fb_info->regs, CL_SEQR6, 0x12);	/* unlock all extension registers */
+/*      vga_wgfx (cinfo->regbase, CL_GRA, 0xce);    "magic cookie" - doesn't make any sense to me.. */
+		vga_wseq (cinfo->regbase, CL_SEQR6, 0x12);	/* unlock all extension registers */
 
-		vga_wgfx (fb_info->regs, CL_GR31, 0x04);	/* reset blitter */
+		vga_wgfx (cinfo->regbase, CL_GR31, 0x04);	/* reset blitter */
 
-		switch (fb_info->btype) {
+		switch (cinfo->btype) {
 		case BT_GD5480:
-			vga_wseq (fb_info->regs, CL_SEQRF, 0x98);
+			vga_wseq (cinfo->regbase, CL_SEQRF, 0x98);
 			break;
 		case BT_ALPINE:
 			break;
 		case BT_SD64:
-			vga_wseq (fb_info->regs, CL_SEQRF, 0xb8);
+			vga_wseq (cinfo->regbase, CL_SEQRF, 0xb8);
 			break;
 		default:
-			vga_wseq (fb_info->regs, CL_SEQR16, 0x0f);
-			vga_wseq (fb_info->regs, CL_SEQRF, 0xb0);
+			vga_wseq (cinfo->regbase, CL_SEQR16, 0x0f);
+			vga_wseq (cinfo->regbase, CL_SEQRF, 0xb0);
 			break;
 		}
 	}
-	vga_wseq (fb_info->regs, VGA_SEQ_PLANE_WRITE, 0xff);	/* plane mask: nothing */
-	vga_wseq (fb_info->regs, VGA_SEQ_CHARACTER_MAP, 0x00);	/* character map select: doesn't even matter in gx mode */
-	vga_wseq (fb_info->regs, VGA_SEQ_MEMORY_MODE, 0x0e);	/* memory mode: chain-4, no odd/even, ext. memory */
+	vga_wseq (cinfo->regbase, VGA_SEQ_PLANE_WRITE, 0xff);	/* plane mask: nothing */
+	vga_wseq (cinfo->regbase, VGA_SEQ_CHARACTER_MAP, 0x00);	/* character map select: doesn't even matter in gx mode */
+	vga_wseq (cinfo->regbase, VGA_SEQ_MEMORY_MODE, 0x0e);	/* memory mode: chain-4, no odd/even, ext. memory */
 
 	/* controller-internal base address of video memory */
 	if (bi->init_sr07)
-		vga_wseq (fb_info->regs, CL_SEQR7, bi->sr07);
+		vga_wseq (cinfo->regbase, CL_SEQR7, bi->sr07);
 
-	/*  vga_wseq (fb_info->regs, CL_SEQR8, 0x00); *//* EEPROM control: shouldn't be necessary to write to this at all.. */
+	/*  vga_wseq (cinfo->regbase, CL_SEQR8, 0x00); *//* EEPROM control: shouldn't be necessary to write to this at all.. */
 
-	vga_wseq (fb_info->regs, CL_SEQR10, 0x00);		/* graphics cursor X position (incomplete; position gives rem. 3 bits */
-	vga_wseq (fb_info->regs, CL_SEQR11, 0x00);		/* graphics cursor Y position (..."... ) */
-	vga_wseq (fb_info->regs, CL_SEQR12, 0x00);		/* graphics cursor attributes */
-	vga_wseq (fb_info->regs, CL_SEQR13, 0x00);		/* graphics cursor pattern address */
+	vga_wseq (cinfo->regbase, CL_SEQR10, 0x00);		/* graphics cursor X position (incomplete; position gives rem. 3 bits */
+	vga_wseq (cinfo->regbase, CL_SEQR11, 0x00);		/* graphics cursor Y position (..."... ) */
+	vga_wseq (cinfo->regbase, CL_SEQR12, 0x00);		/* graphics cursor attributes */
+	vga_wseq (cinfo->regbase, CL_SEQR13, 0x00);		/* graphics cursor pattern address */
 
 	/* writing these on a P4 might give problems..  */
-	if (fb_info->btype != BT_PICASSO4) {
-		vga_wseq (fb_info->regs, CL_SEQR17, 0x00);		/* configuration readback and ext. color */
-		vga_wseq (fb_info->regs, CL_SEQR18, 0x02);		/* signature generator */
+	if (cinfo->btype != BT_PICASSO4) {
+		vga_wseq (cinfo->regbase, CL_SEQR17, 0x00);		/* configuration readback and ext. color */
+		vga_wseq (cinfo->regbase, CL_SEQR18, 0x02);		/* signature generator */
 	}
 
 	/* MCLK select etc. */
 	if (bi->init_sr1f)
-		vga_wseq (fb_info->regs, CL_SEQR1F, bi->sr1f);
-
-	vga_wcrt (fb_info->regs, VGA_CRTC_PRESET_ROW, 0x00);	/* Screen A preset row scan: none */
-	vga_wcrt (fb_info->regs, VGA_CRTC_CURSOR_START, 0x20);	/* Text cursor start: disable text cursor */
-	vga_wcrt (fb_info->regs, VGA_CRTC_CURSOR_END, 0x00);	/* Text cursor end: - */
-	vga_wcrt (fb_info->regs, VGA_CRTC_START_HI, 0x00);	/* Screen start address high: 0 */
-	vga_wcrt (fb_info->regs, VGA_CRTC_START_LO, 0x00);	/* Screen start address low: 0 */
-	vga_wcrt (fb_info->regs, VGA_CRTC_CURSOR_HI, 0x00);	/* text cursor location high: 0 */
-	vga_wcrt (fb_info->regs, VGA_CRTC_CURSOR_LO, 0x00);	/* text cursor location low: 0 */
-
-	vga_wcrt (fb_info->regs, VGA_CRTC_UNDERLINE, 0x00);	/* Underline Row scanline: - */
-	vga_wcrt (fb_info->regs, VGA_CRTC_MODE, 0xc3);	/* mode control: timing enable, byte mode, no compat modes */
-	vga_wcrt (fb_info->regs, VGA_CRTC_LINE_COMPARE, 0x00);	/* Line Compare: not needed */
+		vga_wseq (cinfo->regbase, CL_SEQR1F, bi->sr1f);
+
+	vga_wcrt (cinfo->regbase, VGA_CRTC_PRESET_ROW, 0x00);	/* Screen A preset row scan: none */
+	vga_wcrt (cinfo->regbase, VGA_CRTC_CURSOR_START, 0x20);	/* Text cursor start: disable text cursor */
+	vga_wcrt (cinfo->regbase, VGA_CRTC_CURSOR_END, 0x00);	/* Text cursor end: - */
+	vga_wcrt (cinfo->regbase, VGA_CRTC_START_HI, 0x00);	/* Screen start address high: 0 */
+	vga_wcrt (cinfo->regbase, VGA_CRTC_START_LO, 0x00);	/* Screen start address low: 0 */
+	vga_wcrt (cinfo->regbase, VGA_CRTC_CURSOR_HI, 0x00);	/* text cursor location high: 0 */
+	vga_wcrt (cinfo->regbase, VGA_CRTC_CURSOR_LO, 0x00);	/* text cursor location low: 0 */
+
+	vga_wcrt (cinfo->regbase, VGA_CRTC_UNDERLINE, 0x00);	/* Underline Row scanline: - */
+	vga_wcrt (cinfo->regbase, VGA_CRTC_MODE, 0xc3);	/* mode control: timing enable, byte mode, no compat modes */
+	vga_wcrt (cinfo->regbase, VGA_CRTC_LINE_COMPARE, 0x00);	/* Line Compare: not needed */
 	/* ### add 0x40 for text modes with > 30 MHz pixclock */
-	vga_wcrt (fb_info->regs, CL_CRT1B, 0x02);	/* ext. display controls: ext.adr. wrap */
-
-	vga_wgfx (fb_info->regs, VGA_GFX_SR_VALUE, 0x00);	/* Set/Reset registes: - */
-	vga_wgfx (fb_info->regs, VGA_GFX_SR_ENABLE, 0x00);	/* Set/Reset enable: - */
-	vga_wgfx (fb_info->regs, VGA_GFX_COMPARE_VALUE, 0x00);	/* Color Compare: - */
-	vga_wgfx (fb_info->regs, VGA_GFX_DATA_ROTATE, 0x00);	/* Data Rotate: - */
-	vga_wgfx (fb_info->regs, VGA_GFX_PLANE_READ, 0x00);	/* Read Map Select: - */
-	vga_wgfx (fb_info->regs, VGA_GFX_MODE, 0x00);	/* Mode: conf. for 16/4/2 color mode, no odd/even, read/write mode 0 */
-	vga_wgfx (fb_info->regs, VGA_GFX_MISC, 0x01);	/* Miscellaneous: memory map base address, graphics mode */
-	vga_wgfx (fb_info->regs, VGA_GFX_COMPARE_MASK, 0x0f);	/* Color Don't care: involve all planes */
-	vga_wgfx (fb_info->regs, VGA_GFX_BIT_MASK, 0xff);	/* Bit Mask: no mask at all */
-	if (fb_info->btype == BT_ALPINE)
-		vga_wgfx (fb_info->regs, CL_GRB, 0x20);	/* (5434 can't have bit 3 set for bitblt) */
+	vga_wcrt (cinfo->regbase, CL_CRT1B, 0x02);	/* ext. display controls: ext.adr. wrap */
+
+	vga_wgfx (cinfo->regbase, VGA_GFX_SR_VALUE, 0x00);	/* Set/Reset registes: - */
+	vga_wgfx (cinfo->regbase, VGA_GFX_SR_ENABLE, 0x00);	/* Set/Reset enable: - */
+	vga_wgfx (cinfo->regbase, VGA_GFX_COMPARE_VALUE, 0x00);	/* Color Compare: - */
+	vga_wgfx (cinfo->regbase, VGA_GFX_DATA_ROTATE, 0x00);	/* Data Rotate: - */
+	vga_wgfx (cinfo->regbase, VGA_GFX_PLANE_READ, 0x00);	/* Read Map Select: - */
+	vga_wgfx (cinfo->regbase, VGA_GFX_MODE, 0x00);	/* Mode: conf. for 16/4/2 color mode, no odd/even, read/write mode 0 */
+	vga_wgfx (cinfo->regbase, VGA_GFX_MISC, 0x01);	/* Miscellaneous: memory map base address, graphics mode */
+	vga_wgfx (cinfo->regbase, VGA_GFX_COMPARE_MASK, 0x0f);	/* Color Don't care: involve all planes */
+	vga_wgfx (cinfo->regbase, VGA_GFX_BIT_MASK, 0xff);	/* Bit Mask: no mask at all */
+	if (cinfo->btype == BT_ALPINE)
+		vga_wgfx (cinfo->regbase, CL_GRB, 0x20);	/* (5434 can't have bit 3 set for bitblt) */
 	else
-		vga_wgfx (fb_info->regs, CL_GRB, 0x28);	/* Graphics controller mode extensions: finer granularity, 8byte data latches */
-
-	vga_wgfx (fb_info->regs, CL_GRC, 0xff);	/* Color Key compare: - */
-	vga_wgfx (fb_info->regs, CL_GRD, 0x00);	/* Color Key compare mask: - */
-	vga_wgfx (fb_info->regs, CL_GRE, 0x00);	/* Miscellaneous control: - */
-	/*  vga_wgfx (fb_info->regs, CL_GR10, 0x00); *//* Background color byte 1: - */
-/*  vga_wgfx (fb_info->regs, CL_GR11, 0x00); */
-
-	vga_wattr (fb_info->regs, VGA_ATC_PALETTE0, 0x00);	/* Attribute Controller palette registers: "identity mapping" */
-	vga_wattr (fb_info->regs, VGA_ATC_PALETTE1, 0x01);
-	vga_wattr (fb_info->regs, VGA_ATC_PALETTE2, 0x02);
-	vga_wattr (fb_info->regs, VGA_ATC_PALETTE3, 0x03);
-	vga_wattr (fb_info->regs, VGA_ATC_PALETTE4, 0x04);
-	vga_wattr (fb_info->regs, VGA_ATC_PALETTE5, 0x05);
-	vga_wattr (fb_info->regs, VGA_ATC_PALETTE6, 0x06);
-	vga_wattr (fb_info->regs, VGA_ATC_PALETTE7, 0x07);
-	vga_wattr (fb_info->regs, VGA_ATC_PALETTE8, 0x08);
-	vga_wattr (fb_info->regs, VGA_ATC_PALETTE9, 0x09);
-	vga_wattr (fb_info->regs, VGA_ATC_PALETTEA, 0x0a);
-	vga_wattr (fb_info->regs, VGA_ATC_PALETTEB, 0x0b);
-	vga_wattr (fb_info->regs, VGA_ATC_PALETTEC, 0x0c);
-	vga_wattr (fb_info->regs, VGA_ATC_PALETTED, 0x0d);
-	vga_wattr (fb_info->regs, VGA_ATC_PALETTEE, 0x0e);
-	vga_wattr (fb_info->regs, VGA_ATC_PALETTEF, 0x0f);
-
-	vga_wattr (fb_info->regs, VGA_ATC_MODE, 0x01);	/* Attribute Controller mode: graphics mode */
-	vga_wattr (fb_info->regs, VGA_ATC_OVERSCAN, 0x00);	/* Overscan color reg.: reg. 0 */
-	vga_wattr (fb_info->regs, VGA_ATC_PLANE_ENABLE, 0x0f);	/* Color Plane enable: Enable all 4 planes */
-/* ###  vga_wattr (fb_info->regs, CL_AR33, 0x00); * Pixel Panning: - */
-	vga_wattr (fb_info->regs, VGA_ATC_COLOR_PAGE, 0x00);	/* Color Select: - */
-
-	WGen (fb_info, VGA_PEL_MSK, 0xff);	/* Pixel mask: no mask */
-
-	if (fb_info->btype != BT_ALPINE && fb_info->btype != BT_GD5480)
-		WGen (fb_info, VGA_MIS_W, 0xc3);	/* polarity (-/-), enable display mem, VGA_CRTC_START_HI i/o base = color */
-
-	vga_wgfx (fb_info->regs, CL_GR31, 0x04);	/* BLT Start/status: Blitter reset */
-	vga_wgfx (fb_info->regs, CL_GR31, 0x00);	/* - " -           : "end-of-reset" */
-
-	/* CLUT setup */
-	WClut (fb_info, 0, 0x00, 0x00, 0x00);	/* background: black */
-	WClut (fb_info, 1, 0x3f, 0x3f, 0x3f);	/* foreground: white */
-	WClut (fb_info, 2, 0x00, 0x20, 0x00);
-	WClut (fb_info, 3, 0x00, 0x20, 0x20);
-	WClut (fb_info, 4, 0x20, 0x00, 0x00);
-	WClut (fb_info, 5, 0x20, 0x00, 0x20);
-	WClut (fb_info, 6, 0x20, 0x10, 0x00);
-	WClut (fb_info, 7, 0x20, 0x20, 0x20);
-	WClut (fb_info, 8, 0x10, 0x10, 0x10);
-	WClut (fb_info, 9, 0x10, 0x10, 0x30);
-	WClut (fb_info, 10, 0x10, 0x30, 0x10);
-	WClut (fb_info, 11, 0x10, 0x30, 0x30);
-	WClut (fb_info, 12, 0x30, 0x10, 0x10);
-	WClut (fb_info, 13, 0x30, 0x10, 0x30);
-	WClut (fb_info, 14, 0x30, 0x30, 0x10);
-	WClut (fb_info, 15, 0x30, 0x30, 0x30);
-
-	/* the rest a grey ramp */
-	{
-		int i;
-
-		for (i = 16; i < 256; i++)
-			WClut (fb_info, i, i >> 2, i >> 2, i >> 2);
-	}
-
+		vga_wgfx (cinfo->regbase, CL_GRB, 0x28);	/* Graphics controller mode extensions: finer granularity, 8byte data latches */
+
+	vga_wgfx (cinfo->regbase, CL_GRC, 0xff);	/* Color Key compare: - */
+	vga_wgfx (cinfo->regbase, CL_GRD, 0x00);	/* Color Key compare mask: - */
+	vga_wgfx (cinfo->regbase, CL_GRE, 0x00);	/* Miscellaneous control: - */
+	/*  vga_wgfx (cinfo->regbase, CL_GR10, 0x00); *//* Background color byte 1: - */
+/*  vga_wgfx (cinfo->regbase, CL_GR11, 0x00); */
+
+	vga_wattr (cinfo->regbase, VGA_ATC_PALETTE0, 0x00);	/* Attribute Controller palette registers: "identity mapping" */
+	vga_wattr (cinfo->regbase, VGA_ATC_PALETTE1, 0x01);
+	vga_wattr (cinfo->regbase, VGA_ATC_PALETTE2, 0x02);
+	vga_wattr (cinfo->regbase, VGA_ATC_PALETTE3, 0x03);
+	vga_wattr (cinfo->regbase, VGA_ATC_PALETTE4, 0x04);
+	vga_wattr (cinfo->regbase, VGA_ATC_PALETTE5, 0x05);
+	vga_wattr (cinfo->regbase, VGA_ATC_PALETTE6, 0x06);
+	vga_wattr (cinfo->regbase, VGA_ATC_PALETTE7, 0x07);
+	vga_wattr (cinfo->regbase, VGA_ATC_PALETTE8, 0x08);
+	vga_wattr (cinfo->regbase, VGA_ATC_PALETTE9, 0x09);
+	vga_wattr (cinfo->regbase, VGA_ATC_PALETTEA, 0x0a);
+	vga_wattr (cinfo->regbase, VGA_ATC_PALETTEB, 0x0b);
+	vga_wattr (cinfo->regbase, VGA_ATC_PALETTEC, 0x0c);
+	vga_wattr (cinfo->regbase, VGA_ATC_PALETTED, 0x0d);
+	vga_wattr (cinfo->regbase, VGA_ATC_PALETTEE, 0x0e);
+	vga_wattr (cinfo->regbase, VGA_ATC_PALETTEF, 0x0f);
+
+	vga_wattr (cinfo->regbase, VGA_ATC_MODE, 0x01);	/* Attribute Controller mode: graphics mode */
+	vga_wattr (cinfo->regbase, VGA_ATC_OVERSCAN, 0x00);	/* Overscan color reg.: reg. 0 */
+	vga_wattr (cinfo->regbase, VGA_ATC_PLANE_ENABLE, 0x0f);	/* Color Plane enable: Enable all 4 planes */
+/* ###  vga_wattr (cinfo->regbase, CL_AR33, 0x00); * Pixel Panning: - */
+	vga_wattr (cinfo->regbase, VGA_ATC_COLOR_PAGE, 0x00);	/* Color Select: - */
+
+	WGen (cinfo, VGA_PEL_MSK, 0xff);	/* Pixel mask: no mask */
+
+	if (cinfo->btype != BT_ALPINE && cinfo->btype != BT_GD5480)
+		WGen (cinfo, VGA_MIS_W, 0xc3);	/* polarity (-/-), enable display mem, VGA_CRTC_START_HI i/o base = color */
+
+	vga_wgfx (cinfo->regbase, CL_GR31, 0x04);	/* BLT Start/status: Blitter reset */
+	vga_wgfx (cinfo->regbase, CL_GR31, 0x00);	/* - " -           : "end-of-reset" */
 
 	/* misc... */
-	WHDR (fb_info, 0);	/* Hidden DAC register: - */
+	WHDR (cinfo, 0);	/* Hidden DAC register: - */
 
-	printk (KERN_INFO "clgen: This board has %ld bytes of DRAM memory\n", fb_info->size);
+	printk (KERN_DEBUG "cirrusfb: This board has %ld bytes of DRAM memory\n", cinfo->size);
 	DPRINTK ("EXIT\n");
 	return;
 }
 
-static void switch_monitor (struct clgenfb_info *fb_info, int on)
+static void switch_monitor (struct cirrusfb_info *cinfo, int on)
 {
 #ifdef CONFIG_ZORRO /* only works on Zorro boards */
 	static int IsOn = 0;	/* XXX not ok for multiple boards */
 
 	DPRINTK ("ENTER\n");
 
-	if (fb_info->btype == BT_PICASSO4)
+	if (cinfo->btype == BT_PICASSO4)
 		return;		/* nothing to switch */
-	if (fb_info->btype == BT_ALPINE)
+	if (cinfo->btype == BT_ALPINE)
 		return;		/* nothing to switch */
-	if (fb_info->btype == BT_GD5480)
+	if (cinfo->btype == BT_GD5480)
 		return;		/* nothing to switch */
-	if (fb_info->btype == BT_PICASSO) {
+	if (cinfo->btype == BT_PICASSO) {
 		if ((on && !IsOn) || (!on && IsOn))
-			WSFR (fb_info, 0xff);
+			WSFR (cinfo, 0xff);
 
 		DPRINTK ("EXIT\n");
 		return;
 	}
 	if (on) {
-		switch (fb_info->btype) {
+		switch (cinfo->btype) {
 		case BT_SD64:
-			WSFR (fb_info, fb_info->SFR | 0x21);
+			WSFR (cinfo, cinfo->SFR | 0x21);
 			break;
 		case BT_PICCOLO:
-			WSFR (fb_info, fb_info->SFR | 0x28);
+			WSFR (cinfo, cinfo->SFR | 0x28);
 			break;
 		case BT_SPECTRUM:
-			WSFR (fb_info, 0x6f);
+			WSFR (cinfo, 0x6f);
 			break;
 		default: /* do nothing */ break;
 		}
 	} else {
-		switch (fb_info->btype) {
+		switch (cinfo->btype) {
 		case BT_SD64:
-			WSFR (fb_info, fb_info->SFR & 0xde);
+			WSFR (cinfo, cinfo->SFR & 0xde);
 			break;
 		case BT_PICCOLO:
-			WSFR (fb_info, fb_info->SFR & 0xd7);
+			WSFR (cinfo, cinfo->SFR & 0xd7);
 			break;
 		case BT_SPECTRUM:
-			WSFR (fb_info, 0x4f);
+			WSFR (cinfo, 0x4f);
 			break;
 		default: /* do nothing */ break;
 		}
@@ -2167,238 +2000,130 @@ static void switch_monitor (struct clgenfb_info *fb_info, int on)
 #endif /* CONFIG_ZORRO */
 }
 
-static void clgen_set_disp (const void *par, struct display *disp,
-			    struct fb_info_gen *info)
+
+/******************************************/
+/* Linux 2.6-style  accelerated functions */
+/******************************************/
+
+static void cirrusfb_prim_fillrect(struct cirrusfb_info *cinfo,
+				   const struct fb_fillrect *region)
 {
-	struct clgenfb_par *_par = (struct clgenfb_par *) par;
-	struct clgenfb_info *fb_info = (struct clgenfb_info *) info;
-	int accel_text;
+	int m; /* bytes per pixel */
+	if(cinfo->info->var.bits_per_pixel == 1) {
+		cirrusfb_RectFill(cinfo->regbase, cinfo->info->var.bits_per_pixel,
+				  region->dx / 8, region->dy,
+				  region->width / 8, region->height,
+				  region->color,
+				  cinfo->currentmode.line_length);
+	} else {
+		m = ( cinfo->info->var.bits_per_pixel + 7 ) / 8;
+		cirrusfb_RectFill(cinfo->regbase, cinfo->info->var.bits_per_pixel,
+				  region->dx * m, region->dy,
+				  region->width * m, region->height,
+				  region->color,
+				  cinfo->currentmode.line_length);
+	}
+	return;
+}
 
-	DPRINTK ("ENTER\n");
+void cirrusfb_fillrect (struct fb_info *info, const struct fb_fillrect *region)
+{
+	struct cirrusfb_info *cinfo = info->par;
+	struct fb_fillrect modded;
+	int vxres, vyres;
 
-	assert (_par != NULL);
-	assert (fb_info != NULL);
+	if (info->state != FBINFO_STATE_RUNNING)
+		return;
+	if (info->flags & FBINFO_HWACCEL_DISABLED) {
+		cfb_fillrect(info, region);
+		return;
+	}
 
-	accel_text = _par->var.accel_flags & FB_ACCELF_TEXT;
+	vxres = info->var.xres_virtual;
+	vyres = info->var.yres_virtual;
 
-	printk ("Cirrus Logic video mode: ");
-	info->info.screen_base = (char *) fb_info->fbmem;
-	switch (_par->var.bits_per_pixel) {
-#ifdef FBCON_HAS_MFB
-	case 1:
-		printk ("monochrome\n");
-		if (fb_info->btype == BT_GD5480)
-			info->info.screen_base = (char *) fb_info->fbmem;
-		disp->dispsw = &fbcon_mfb;
-		break;
-#endif
-#ifdef FBCON_HAS_CFB8
-	case 8:
-		printk ("8 bit color depth\n");
-		if (fb_info->btype == BT_GD5480)
-			info->info.screen_base = (char *) fb_info->fbmem;
-		if (accel_text)
-			disp->dispsw = &fbcon_clgen_8;
-		else
-			disp->dispsw = &fbcon_cfb8;
-		break;
-#endif
-#ifdef FBCON_HAS_CFB16
-	case 16:
-		printk ("16 bit color depth\n");
-		if (accel_text)
-			disp->dispsw = &fbcon_clgen_16;
-		else
-			disp->dispsw = &fbcon_cfb16;
-		if (fb_info->btype == BT_GD5480)
-			info->info.screen_base = (char *) fb_info->fbmem + 1 * MB_;
-		disp->dispsw_data = fb_info->fbcon_cmap.cfb16;
-		break;
-#endif
-#ifdef FBCON_HAS_CFB24
-	case 24:
-		printk ("24 bit color depth\n");
-		disp->dispsw = &fbcon_cfb24;
-		if (fb_info->btype == BT_GD5480)
-			info->info.screen_base = (char *) fb_info->fbmem + 2 * MB_;
-		disp->dispsw_data = fb_info->fbcon_cmap.cfb24;
-		break;
-#endif
-#ifdef FBCON_HAS_CFB32
-	case 32:
-		printk ("32 bit color depth\n");
-		if (accel_text)
-			disp->dispsw = &fbcon_clgen_32;
-		else
-			disp->dispsw = &fbcon_cfb32;
-		if (fb_info->btype == BT_GD5480)
-			info->info.screen_base = (char *) fb_info->fbmem + 2 * MB_;
-		disp->dispsw_data = fb_info->fbcon_cmap.cfb32;
-		break;
-#endif
-
-	default:
-		printk ("unsupported color depth\n");
-		disp->dispsw = &fbcon_dummy;
-		disp->dispsw_data = NULL;
-		break;
-	}
-
-	DPRINTK ("EXIT\n");
-}
-
-#ifdef FBCON_HAS_CFB8
-static void fbcon_clgen8_bmove (struct display *p, int sy, int sx,
-				int dy, int dx, int height, int width)
-{
-	struct clgenfb_info *fb_info = (struct clgenfb_info *) p->fb_info;
-
-	DPRINTK ("ENTER\n");
-
-	sx *= fontwidth (p);
-	sy *= fontheight (p);
-	dx *= fontwidth (p);
-	dy *= fontheight (p);
-	width *= fontwidth (p);
-	height *= fontheight (p);
-
-	clgen_BitBLT (fb_info->regs, (unsigned short) sx, (unsigned short) sy,
-		      (unsigned short) dx, (unsigned short) dy,
-		      (unsigned short) width, (unsigned short) height,
-		      fb_info->currentmode.line_length);
-
-	DPRINTK ("EXIT\n");
-}
-
-static void fbcon_clgen8_clear (struct vc_data *conp, struct display *p,
-				int sy, int sx, int height, int width)
-{
-	struct clgenfb_info *fb_info = (struct clgenfb_info *) p->fb_info;
-	unsigned short col;
-
-	DPRINTK ("ENTER\n");
-
-	sx *= fontwidth (p);
-	sy *= fontheight (p);
-	width *= fontwidth (p);
-	height *= fontheight (p);
-
-	col = attr_bgcol_ec (p, conp);
-	col &= 0xff;
-
-	clgen_RectFill (fb_info, (unsigned short) sx, (unsigned short) sy,
-			(unsigned short) width, (unsigned short) height,
-			col, fb_info->currentmode.line_length);
-
-	DPRINTK ("EXIT\n");
-}
-
-#endif
-
-#ifdef FBCON_HAS_CFB16
-static void fbcon_clgen16_bmove (struct display *p, int sy, int sx,
-				 int dy, int dx, int height, int width)
-{
-	struct clgenfb_info *fb_info = (struct clgenfb_info *) p->fb_info;
+	memcpy(&modded, region, sizeof(struct fb_fillrect));
 
-	DPRINTK ("ENTER\n");
-
-	sx *= fontwidth (p) * 2;	/* 2 bytes/pixel */
-	sy *= fontheight (p);
-	dx *= fontwidth (p) * 2;	/* 2 bytes/pixel */
-	dy *= fontheight (p);
-	width *= fontwidth (p) * 2;	/* 2 bytes/pixel */
-	height *= fontheight (p);
+	if(!modded.width || !modded.height ||
+	   modded.dx >= vxres || modded.dy >= vyres)
+		return;
 
-	clgen_BitBLT (fb_info->regs, (unsigned short) sx, (unsigned short) sy,
-		      (unsigned short) dx, (unsigned short) dy,
-		      (unsigned short) width, (unsigned short) height,
-		      fb_info->currentmode.line_length);
+	if(modded.dx + modded.width  > vxres) modded.width  = vxres - modded.dx;
+	if(modded.dy + modded.height > vyres) modded.height = vyres - modded.dy;
 
-	DPRINTK ("EXIT\n");
+	cirrusfb_prim_fillrect(cinfo, &modded);
 }
 
-static void fbcon_clgen16_clear (struct vc_data *conp, struct display *p,
-				 int sy, int sx, int height, int width)
+static void cirrusfb_prim_copyarea(struct cirrusfb_info *cinfo,
+				   const struct fb_copyarea *area)
 {
-	struct clgenfb_info *fb_info = (struct clgenfb_info *) p->fb_info;
-	unsigned short col;
-
-	DPRINTK ("ENTER\n");
-
-	sx *= fontwidth (p) * 2;	/* 2 bytes/pixel */
-	sy *= fontheight (p);
-	width *= fontwidth (p) * 2;	/* 2 bytes/pixel? */
-	height *= fontheight (p);
-
-	col = attr_bgcol_ec (p, conp);
-	col &= 0xff;
-
-	clgen_RectFill (fb_info, (unsigned short) sx, (unsigned short) sy,
-			(unsigned short) width, (unsigned short) height,
-			col, fb_info->currentmode.line_length);
-
-	DPRINTK ("EXIT\n");
+	int m; /* bytes per pixel */
+	if(cinfo->info->var.bits_per_pixel == 1) {
+		cirrusfb_BitBLT(cinfo->regbase, cinfo->info->var.bits_per_pixel,
+				area->sx / 8, area->sy,
+				area->dx / 8, area->dy,
+				area->width / 8, area->height,
+				cinfo->currentmode.line_length);
+	} else {
+		m = ( cinfo->info->var.bits_per_pixel + 7 ) / 8;
+		cirrusfb_BitBLT(cinfo->regbase, cinfo->info->var.bits_per_pixel,
+				area->sx * m, area->sy,
+				area->dx * m, area->dy,
+				area->width * m, area->height,
+				cinfo->currentmode.line_length);
+	}
+	return;
 }
 
-#endif
 
-#ifdef FBCON_HAS_CFB32
-static void fbcon_clgen32_bmove (struct display *p, int sy, int sx,
-				 int dy, int dx, int height, int width)
+void cirrusfb_copyarea(struct fb_info *info, const struct fb_copyarea *area)
 {
-	struct clgenfb_info *fb_info = (struct clgenfb_info *) p->fb_info;
+	struct cirrusfb_info *cinfo = info->par;
+	struct fb_copyarea modded;
+	u32 vxres, vyres;
+	modded.sx = area->sx;
+	modded.sy = area->sy;
+	modded.dx = area->dx;
+	modded.dy = area->dy;
+	modded.width  = area->width;
+	modded.height = area->height;
+
+	if (info->state != FBINFO_STATE_RUNNING)
+		return;
+	if (info->flags & FBINFO_HWACCEL_DISABLED) {
+		cfb_copyarea(info, area);
+		return;
+	}
 
-	DPRINTK ("ENTER\n");
+	vxres = info->var.xres_virtual;
+	vyres = info->var.yres_virtual;
 
-	sx *= fontwidth (p) * 4;	/* 4 bytes/pixel */
-	sy *= fontheight (p);
-	dx *= fontwidth (p) * 4;	/* 4 bytes/pixel */
-	dy *= fontheight (p);
-	width *= fontwidth (p) * 4;	/* 4 bytes/pixel */
-	height *= fontheight (p);
+	if(!modded.width || !modded.height ||
+	   modded.sx >= vxres || modded.sy >= vyres ||
+	   modded.dx >= vxres || modded.dy >= vyres)
+		return;
 
-	clgen_BitBLT (fb_info->regs, (unsigned short) sx, (unsigned short) sy,
-		      (unsigned short) dx, (unsigned short) dy,
-		      (unsigned short) width, (unsigned short) height,
-		      fb_info->currentmode.line_length);
+	if(modded.sx + modded.width > vxres)  modded.width = vxres - modded.sx;
+	if(modded.dx + modded.width > vxres)  modded.width = vxres - modded.dx;
+	if(modded.sy + modded.height > vyres) modded.height = vyres - modded.sy;
+	if(modded.dy + modded.height > vyres) modded.height = vyres - modded.dy;
 
-	DPRINTK ("EXIT\n");
+	cirrusfb_prim_copyarea(cinfo, &modded);
 }
 
-static void fbcon_clgen32_clear (struct vc_data *conp, struct display *p,
-				 int sy, int sx, int height, int width)
+void cirrusfb_imageblit(struct fb_info *info, const struct fb_image *image)
 {
-	struct clgenfb_info *fb_info = (struct clgenfb_info *) p->fb_info;
-
-	unsigned short col;
-
-	DPRINTK ("ENTER\n");
-
-	sx *= fontwidth (p) * 4;	/* 4 bytes/pixel */
-	sy *= fontheight (p);
-	width *= fontwidth (p) * 4;	/* 4 bytes/pixel? */
-	height *= fontheight (p);
-
-	col = attr_bgcol_ec (p, conp);
-	col &= 0xff;
-
-	clgen_RectFill (fb_info, (unsigned short) sx, (unsigned short) sy,
-			(unsigned short) width, (unsigned short) height,
-			col, fb_info->currentmode.line_length);
+	struct cirrusfb_info *cinfo = info->par;
 
-	DPRINTK ("EXIT\n");
+        cirrusfb_WaitBLT(cinfo->regbase);
+	cfb_imageblit(info, image);
 }
 
-#endif				/* FBCON_HAS_CFB32 */
-
-
-
 
 #ifdef CONFIG_PPC_PREP
 #define PREP_VIDEO_BASE ((volatile unsigned long) 0xC0000000)
 #define PREP_IO_BASE    ((volatile unsigned char *) 0x80000000)
-static void __init get_prep_addrs (unsigned long *display, unsigned long *registers)
+static void get_prep_addrs (unsigned long *display, unsigned long *registers)
 {
 	DPRINTK ("ENTER\n");
 
@@ -2411,8 +2136,6 @@ static void __init get_prep_addrs (unsigned long *display, unsigned long *regist
 #endif				/* CONFIG_PPC_PREP */
 
 
-
-
 #ifdef CONFIG_PCI
 static int release_io_ports = 0;
 
@@ -2420,7 +2143,7 @@ static int release_io_ports = 0;
  * based on the DRAM bandwidth bit and DRAM bank switching bit.  This
  * works with 1MB, 2MB and 4MB configurations (which the Motorola boards
  * seem to have. */
-static unsigned int __init clgen_get_memsize (caddr_t regbase)
+static unsigned int cirrusfb_get_memsize (caddr_t regbase)
 {
 	unsigned long mem;
 	unsigned char SRF;
@@ -2443,40 +2166,14 @@ static unsigned int __init clgen_get_memsize (caddr_t regbase)
 		mem *= 2;
 	}
 	/* TODO: Handling of GD5446/5480 (see XF86 sources ...) */
-	return mem;
 
 	DPRINTK ("EXIT\n");
+	return mem;
 }
 
 
 
-static struct pci_dev * __init clgen_pci_dev_get (clgen_board_t *btype)
-{
-	struct pci_dev *pdev;
-	int i;
-
-	DPRINTK ("ENTER\n");
-
-	for (i = 0; i < ARRAY_SIZE(clgen_pci_probe_list); i++) {
-		pdev = NULL;
-		while ((pdev = pci_find_device (PCI_VENDOR_ID_CIRRUS,
-				clgen_pci_probe_list[i].device, pdev)) != NULL) {
-			if (pci_enable_device(pdev) == 0) {
-				*btype = clgen_pci_probe_list[i].btype;
-				DPRINTK ("EXIT, returning pdev=%p\n", pdev);
-				return pdev;
-			}
-		}
-	}
-
-	DPRINTK ("EXIT, returning NULL\n");
-	return NULL;
-}
-
-
-
-
-static void __init get_pci_addrs (const struct pci_dev *pdev,
+static void get_pci_addrs (const struct pci_dev *pdev,
 			   unsigned long *display, unsigned long *registers)
 {
 	assert (pdev != NULL);
@@ -2504,355 +2201,418 @@ static void __init get_pci_addrs (const struct pci_dev *pdev,
 }
 
 
-static void __exit clgen_pci_unmap (struct clgenfb_info *info)
+static void cirrusfb_pci_unmap (struct cirrusfb_info *cinfo)
 {
-	iounmap (info->fbmem);
-	release_mem_region(info->fbmem_phys, info->size);
+	struct pci_dev *pdev = cinfo->pdev;
 
+	iounmap(cinfo->fbmem);
 #if 0 /* if system didn't claim this region, we would... */
 	release_mem_region(0xA0000, 65535);
 #endif
-
 	if (release_io_ports)
 		release_region(0x3C0, 32);
+	pci_release_regions(pdev);
+	framebuffer_release(cinfo->info);
+	pci_disable_device(pdev);
 }
+#endif /* CONFIG_PCI */
 
 
-static int __init clgen_pci_setup (struct clgenfb_info *info,
-				   clgen_board_t *btype)
+#ifdef CONFIG_ZORRO
+static void __devexit cirrusfb_zorro_unmap (struct cirrusfb_info *cinfo)
 {
-	struct pci_dev *pdev;
-	unsigned long board_addr, board_size;
+	zorro_release_device(cinfo->zdev);
 
-	DPRINTK ("ENTER\n");
+	if (cinfo->btype == BT_PICASSO4) {
+		cinfo->regbase -= 0x600000;
+		iounmap ((void *)cinfo->regbase);
+		iounmap ((void *)cinfo->fbmem);
+	} else {
+		if (zorro_resource_start(cinfo->zdev) > 0x01000000)
+			iounmap ((void *)cinfo->fbmem);
+	}
+	framebuffer_release(cinfo->info);
+}
+#endif /* CONFIG_ZORRO */
 
-	pdev = clgen_pci_dev_get (btype);
-	if (!pdev) {
-		printk (KERN_INFO "cirrusfb: couldn't find Cirrus Logic PCI device\n");
-		DPRINTK ("EXIT, returning 1\n");
-		return 1;
+static int cirrusfb_set_fbinfo(struct cirrusfb_info *cinfo)
+{
+	struct fb_info *info = cinfo->info;
+	struct fb_var_screeninfo *var = &info->var;
+
+	info->currcon = -1;
+	info->par = cinfo;
+	info->pseudo_palette = cinfo->pseudo_palette;
+	info->flags = FBINFO_DEFAULT
+		    | FBINFO_HWACCEL_XPAN
+		    | FBINFO_HWACCEL_YPAN
+		    | FBINFO_HWACCEL_FILLRECT
+		    | FBINFO_HWACCEL_COPYAREA;
+	if (noaccel)
+		info->flags |= FBINFO_HWACCEL_DISABLED;
+	info->fbops = &cirrusfb_ops;
+	info->screen_base = cinfo->fbmem;
+	if (cinfo->btype == BT_GD5480) {
+		if (var->bits_per_pixel == 16)
+			info->screen_base += 1 * MB_;
+		if (var->bits_per_pixel == 24 || var->bits_per_pixel == 32)
+			info->screen_base += 2 * MB_;
 	}
-	DPRINTK (" Found PCI device, base address 0 is 0x%lx, btype set to %d\n",
-		 pdev->resource[0].start, *btype);
-	DPRINTK (" base address 1 is 0x%lx\n", pdev->resource[1].start);
 
-	info->pdev = pdev;
+	/* Fill fix common fields */
+	strlcpy(info->fix.id, cirrusfb_board_info[cinfo->btype].name,
+		sizeof(info->fix.id));
 
-	if(isPReP) {
-		/* Xbh does this, though 0 seems to be the init value */
-		pcibios_write_config_dword (0, pdev->devfn, PCI_BASE_ADDRESS_0,
-			0x00000000);
+	/* monochrome: only 1 memory plane */
+	/* 8 bit and above: Use whole memory area */
+	info->fix.smem_start = cinfo->fbmem_phys;
+	info->fix.smem_len   = (var->bits_per_pixel == 1) ? cinfo->size / 4 : cinfo->size;
+	info->fix.type       = cinfo->currentmode.type;
+	info->fix.type_aux   = 0;
+	info->fix.visual     = cinfo->currentmode.visual;
+	info->fix.xpanstep   = 1;
+	info->fix.ypanstep   = 1;
+	info->fix.ywrapstep  = 0;
+	info->fix.line_length = cinfo->currentmode.line_length;
 
-#ifdef CONFIG_PPC_PREP
-		get_prep_addrs (&board_addr, &info->fbregs_phys);
-#endif
-	} else {
-		DPRINTK ("Attempt to get PCI info for Cirrus Graphics Card\n");
-		get_pci_addrs (pdev, &board_addr, &info->fbregs_phys);
-	}
+	/* FIXME: map region at 0xB8000 if available, fill in here */
+	info->fix.mmio_start = cinfo->fbregs_phys;
+	info->fix.mmio_len   = 0;
+	info->fix.accel = FB_ACCEL_NONE;
 
-	DPRINTK ("Board address: 0x%lx, register address: 0x%lx\n", board_addr, info->fbregs_phys);
+	fb_alloc_cmap(&info->cmap, 256, 0);
 
-	if(isPReP) {
-		/* PReP dies if we ioremap the IO registers, but it works w/out... */
-		info->regs = (char *) info->fbregs_phys;
-	} else
-		info->regs = 0;		/* FIXME: this forces VGA.  alternatives? */
+	return 0;
+}
 
-	if (*btype == BT_GD5480) {
-		board_size = 32 * MB_;
-	} else {
-		board_size = clgen_get_memsize (info->regs);
-	}
+static int cirrusfb_register(struct cirrusfb_info *cinfo)
+{
+	struct fb_info *info;
+	int err;
+	cirrusfb_board_t btype;
 
-	if (!request_mem_region(board_addr, board_size, "clgenfb")) {
-		printk(KERN_ERR "clgen: cannot reserve region 0x%lx, abort\n",
-		       board_addr);
-		return -1;
-	}
-#if 0 /* if the system didn't claim this region, we would... */
-	if (!request_mem_region(0xA0000, 65535, "clgenfb")) {
-		printk(KERN_ERR "clgen: cannot reserve region 0x%lx, abort\n",
-		       0xA0000L);
-		release_mem_region(board_addr, board_size);
-		return -1;
-	}
-#endif
-	if (request_region(0x3C0, 32, "clgenfb"))
-		release_io_ports = 1;
+	DPRINTK ("ENTER\n");
 
-	info->fbmem = ioremap (board_addr, board_size);
-	info->fbmem_phys = board_addr;
-	info->size = board_size;
+	printk (KERN_INFO "cirrusfb: Driver for Cirrus Logic based graphic boards, v" CIRRUSFB_VERSION "\n");
 
-	printk (" RAM (%lu kB) at 0x%lx, ", info->size / KB_, board_addr);
+	info = cinfo->info;
+	btype = cinfo->btype;
 
-	printk ("Cirrus Logic chipset on PCI bus\n");
+	/* sanity checks */
+	assert (btype != BT_NONE);
+
+	DPRINTK ("cirrusfb: (RAM start set to: 0x%p)\n", cinfo->fbmem);
+
+	/* Make pretend we've set the var so our structures are in a "good" */
+	/* state, even though we haven't written the mode to the hw yet...  */
+	info->var = cirrusfb_predefined[cirrusfb_def_mode].var;
+	info->var.activate = FB_ACTIVATE_NOW;
+
+	err = cirrusfb_decode_var(&info->var, &cinfo->currentmode, info);
+	if (err < 0) {
+		/* should never happen */
+		DPRINTK("choking on default var... umm, no good.\n");
+		goto err_unmap_cirrusfb;
+	}
+
+	/* set all the vital stuff */
+	cirrusfb_set_fbinfo(cinfo);
+
+	err = register_framebuffer(info);
+	if (err < 0) {
+		printk (KERN_ERR "cirrusfb: could not register fb device; err = %d!\n", err);
+		goto err_dealloc_cmap;
+	}
 
 	DPRINTK ("EXIT, returning 0\n");
 	return 0;
+
+err_dealloc_cmap:
+	fb_dealloc_cmap(&info->cmap);
+err_unmap_cirrusfb:
+	cinfo->unmap(cinfo);
+	return err;
 }
-#endif				/* CONFIG_PCI */
 
+static void __devexit cirrusfb_cleanup (struct fb_info *info)
+{
+	struct cirrusfb_info *cinfo = info->par;
+	DPRINTK ("ENTER\n");
+
+	switch_monitor (cinfo, 0);
 
+	unregister_framebuffer (info);
+	fb_dealloc_cmap (&info->cmap);
+	printk ("Framebuffer unregistered\n");
+	cinfo->unmap(cinfo);
 
+	DPRINTK ("EXIT\n");
+}
 
-#ifdef CONFIG_ZORRO
-static int __init clgen_zorro_find (struct zorro_dev **z_o,
-				    struct zorro_dev **z2_o,
-				    clgen_board_t *btype, unsigned long *size)
+
+#ifdef CONFIG_PCI
+static int cirrusfb_pci_register (struct pci_dev *pdev,
+				  const struct pci_device_id *ent)
 {
-	struct zorro_dev *z = NULL;
-	int i;
+	struct cirrusfb_info *cinfo;
+	struct fb_info *info;
+	cirrusfb_board_t btype;
+	unsigned long board_addr, board_size;
+	int ret;
 
-	assert (z_o != NULL);
-	assert (btype != NULL);
+	ret = pci_enable_device(pdev);
+	if (ret < 0) {
+		printk(KERN_ERR "cirrusfb: Cannot enable PCI device\n");
+		goto err_out;
+	}
 
-	for (i = 0; i < ARRAY_SIZE(clgen_zorro_probe_list); i++)
-		if ((z = zorro_find_device(clgen_zorro_probe_list[i].id, NULL)))
-			break;
+	info = framebuffer_alloc(sizeof(struct cirrusfb_info), &pdev->dev);
+	if (!info) {
+		printk(KERN_ERR "cirrusfb: could not allocate memory\n");
+		ret = -ENOMEM;
+		goto err_disable;
+	}
 
-	if (z) {
-		*z_o = z;
-		if (clgen_zorro_probe_list[i].id2)
-			*z2_o = zorro_find_device(clgen_zorro_probe_list[i].id2, NULL);
-		else
-			*z2_o = NULL;
+	cinfo = info->par;
+	cinfo->info = info;
+	cinfo->pdev = pdev;
+	cinfo->btype = btype = (cirrusfb_board_t) ent->driver_data;
 
-		*btype = clgen_zorro_probe_list[i].btype;
-		*size = clgen_zorro_probe_list[i].size;
+	DPRINTK (" Found PCI device, base address 0 is 0x%lx, btype set to %d\n",
+		pdev->resource[0].start, btype);
+	DPRINTK (" base address 1 is 0x%lx\n", pdev->resource[1].start);
 
-		printk (KERN_INFO "clgen: %s board detected; ",
-			clgen_board_info[*btype].name);
+	if(isPReP) {
+		pci_write_config_dword (pdev, PCI_BASE_ADDRESS_0, 0x00000000);
+#ifdef CONFIG_PPC_PREP
+		get_prep_addrs (&board_addr, &cinfo->fbregs_phys);
+#endif
+		/* PReP dies if we ioremap the IO registers, but it works w/out... */
+		cinfo->regbase = (char *) cinfo->fbregs_phys;
+	} else {
+		DPRINTK ("Attempt to get PCI info for Cirrus Graphics Card\n");
+		get_pci_addrs (pdev, &board_addr, &cinfo->fbregs_phys);
+		cinfo->regbase = NULL;		/* FIXME: this forces VGA.  alternatives? */
+	}
 
-		return 0;
+	DPRINTK ("Board address: 0x%lx, register address: 0x%lx\n", board_addr, cinfo->fbregs_phys);
+
+	board_size = (btype == BT_GD5480) ?
+		32 * MB_ : cirrusfb_get_memsize (cinfo->regbase);
+
+	ret = pci_request_regions(pdev, "cirrusfb");
+	if (ret <0) {
+		printk(KERN_ERR "cirrusfb: cannot reserve region 0x%lx, abort\n",
+		       board_addr);
+		goto err_release_fb;
 	}
+#if 0 /* if the system didn't claim this region, we would... */
+	if (!request_mem_region(0xA0000, 65535, "cirrusfb")) {
+		printk(KERN_ERR "cirrusfb: cannot reserve region 0x%lx, abort\n"
+,
+		       0xA0000L);
+		ret = -EBUSY;
+		goto err_release_regions;
+	}
+#endif
+	if (request_region(0x3C0, 32, "cirrusfb"))
+		release_io_ports = 1;
 
-	printk (KERN_NOTICE "clgen: no supported board found.\n");
-	return -1;
-}
+	cinfo->fbmem = ioremap(board_addr, board_size);
+	if (!cinfo->fbmem) {
+		ret = -EIO;
+		goto err_release_legacy;
+	}
+
+	cinfo->fbmem_phys = board_addr;
+	cinfo->size = board_size;
+	cinfo->unmap = cirrusfb_pci_unmap;
+
+	printk (" RAM (%lu kB) at 0xx%lx, ", cinfo->size / KB_, board_addr);
+	printk ("Cirrus Logic chipset on PCI bus\n");
+	pci_set_drvdata(pdev, info);
 
+	return cirrusfb_register(cinfo);
 
-static void __exit clgen_zorro_unmap (struct clgenfb_info *info)
+err_release_legacy:
+	if (release_io_ports)
+		release_region(0x3C0, 32);
+#if 0
+	release_mem_region(0xA0000, 65535);
+err_release_regions:
+#endif
+	pci_release_regions(pdev);
+err_release_fb:
+	framebuffer_release(info);
+err_disable:
+	pci_disable_device(pdev);
+err_out:
+	return ret;
+}
+
+void __devexit cirrusfb_pci_unregister (struct pci_dev *pdev)
 {
-	release_mem_region(info->board_addr, info->board_size);
+	struct fb_info *info = pci_get_drvdata(pdev);
+	DPRINTK ("ENTER\n");
 
-	if (info->btype == BT_PICASSO4) {
-		iounmap ((void *)info->board_addr);
-		iounmap ((void *)info->fbmem_phys);
-	} else {
-		if (info->board_addr > 0x01000000)
-			iounmap ((void *)info->board_addr);
-	}
+	cirrusfb_cleanup (info);
+
+	DPRINTK ("EXIT\n");
 }
 
+static struct pci_driver cirrusfb_pci_driver = {
+	.name		= "cirrusfb",
+	.id_table	= cirrusfb_pci_table,
+	.probe		= cirrusfb_pci_register,
+	.remove		= __devexit_p(cirrusfb_pci_unregister),
+#ifdef CONFIG_PM
+#if 0
+	.suspend	= cirrusfb_pci_suspend,
+	.resume		= cirrusfb_pci_resume,
+#endif
+#endif
+};
+#endif /* CONFIG_PCI */
+
 
-static int __init clgen_zorro_setup (struct clgenfb_info *info,
-				     clgen_board_t *btype)
+#ifdef CONFIG_ZORRO
+static int cirrusfb_zorro_register(struct zorro_dev *z,
+				   const struct zorro_device_id *ent)
 {
-	struct zorro_dev *z = NULL, *z2 = NULL;
+	struct cirrusfb_info *cinfo;
+	struct fb_info *info;
+	cirrusfb_board_t btype;
+	struct zorro_dev *z2 = NULL;
 	unsigned long board_addr, board_size, size;
+	int ret;
+
+	btype = ent->driver_data;
+	if (cirrusfb_zorro_table2[btype].id2)
+		z2 = zorro_find_device(cirrusfb_zorro_table2[btype].id2, NULL);
+	size = cirrusfb_zorro_table2[btype].size;
+	printk(KERN_INFO "cirrusfb: %s board detected; ",
+	       cirrusfb_board_info[btype].name);
 
-	assert (info != NULL);
-	assert (btype != NULL);
+	info = framebuffer_alloc(sizeof(struct cirrusfb_info), &z->dev);
+	if (!info) {
+		printk (KERN_ERR "cirrusfb: could not allocate memory\n");
+		ret = -ENOMEM;
+		goto err_out;
+	}
 
-	if (clgen_zorro_find (&z, &z2, btype, &size))
-		return -1;
+	cinfo = info->par;
+	cinfo->info = info;
+	cinfo->btype = btype;
 
 	assert (z > 0);
 	assert (z2 >= 0);
-	assert (*btype != BT_NONE);
+	assert (btype != BT_NONE);
 
-	info->board_addr = board_addr = z->resource.start;
-	info->board_size = board_size = z->resource.end-z->resource.start+1;
-	info->size = size;
+	cinfo->zdev = z;
+	board_addr = zorro_resource_start(z);
+	board_size = zorro_resource_len(z);
+	cinfo->size = size;
 
-	if (!request_mem_region(board_addr, board_size, "clgenfb")) {
-		printk(KERN_ERR "clgen: cannot reserve region 0x%lx, abort\n",
+	if (!zorro_request_device(z, "cirrusfb")) {
+		printk(KERN_ERR "cirrusfb: cannot reserve region 0x%lx, abort\n",
 		       board_addr);
-		return -1;
+		ret = -EBUSY;
+		goto err_release_fb;
 	}
 
 	printk (" RAM (%lu MB) at $%lx, ", board_size / MB_, board_addr);
 
-	if (*btype == BT_PICASSO4) {
+	ret = -EIO;
+
+	if (btype == BT_PICASSO4) {
 		printk (" REG at $%lx\n", board_addr + 0x600000);
 
 		/* To be precise, for the P4 this is not the */
 		/* begin of the board, but the begin of RAM. */
 		/* for P4, map in its address space in 2 chunks (### TEST! ) */
 		/* (note the ugly hardcoded 16M number) */
-		info->regs = ioremap (board_addr, 16777216);
-		DPRINTK ("clgen: Virtual address for board set to: $%p\n", info->regs);
-		info->regs += 0x600000;
-		info->fbregs_phys = board_addr + 0x600000;
-
-		info->fbmem_phys = board_addr + 16777216;
-		info->fbmem = ioremap (info->fbmem_phys, 16777216);
+		cinfo->regbase = ioremap (board_addr, 16777216);
+		if (!cinfo->regbase)
+			goto err_release_region;
+
+		DPRINTK ("cirrusfb: Virtual address for board set to: $%p\n", cinfo->regbase);
+		cinfo->regbase += 0x600000;
+		cinfo->fbregs_phys = board_addr + 0x600000;
+
+		cinfo->fbmem_phys = board_addr + 16777216;
+		cinfo->fbmem = ioremap (cinfo->fbmem_phys, 16777216);
+		if (!cinfo->fbmem)
+			goto err_unmap_regbase;
 	} else {
 		printk (" REG at $%lx\n", (unsigned long) z2->resource.start);
 
-		info->fbmem_phys = board_addr;
+		cinfo->fbmem_phys = board_addr;
 		if (board_addr > 0x01000000)
-			info->fbmem = ioremap (board_addr, board_size);
+			cinfo->fbmem = ioremap (board_addr, board_size);
 		else
-			info->fbmem = (caddr_t) ZTWO_VADDR (board_addr);
+			cinfo->fbmem = (caddr_t) ZTWO_VADDR (board_addr);
+		if (!cinfo->fbmem)
+			goto err_release_region;
 
 		/* set address for REG area of board */
-		info->regs = (caddr_t) ZTWO_VADDR (z2->resource.start);
-		info->fbregs_phys = z2->resource.start;
+		cinfo->regbase = (caddr_t) ZTWO_VADDR (z2->resource.start);
+		cinfo->fbregs_phys = z2->resource.start;
 
-		DPRINTK ("clgen: Virtual address for board set to: $%p\n", info->regs);
+		DPRINTK ("cirrusfb: Virtual address for board set to: $%p\n", cinfo->regbase);
 	}
+	cinfo->unmap = cirrusfb_zorro_unmap;
 
 	printk (KERN_INFO "Cirrus Logic chipset on Zorro bus\n");
-
-	return 0;
+	zorro_set_drvdata(z, info);
+
+	return cirrusfb_register(cinfo);
+
+err_unmap_regbase:
+	/* Parental advisory: explicit hack */
+	iounmap(cinfo->regbase - 0x600000);
+err_release_region:
+	release_region(board_addr, board_size);
+err_release_fb:
+	framebuffer_release(info);
+err_out:
+	return ret;
 }
-#endif /* CONFIG_ZORRO */
 
-
-
-/********************************************************************/
-/* clgenfb_init() - master initialization function                  */
-/********************************************************************/
-int __init clgenfb_init(void)
+void __devexit cirrusfb_zorro_unregister(struct zorro_dev *z)
 {
-	int err, j, k;
-
-	clgen_board_t btype = BT_NONE;
-	struct clgenfb_info *fb_info = NULL;
-
+	struct fb_info *info = zorro_get_drvdata(z);
 	DPRINTK ("ENTER\n");
 
-	printk (KERN_INFO "clgen: Driver for Cirrus Logic based graphic boards, v" CLGEN_VERSION "\n");
-
-	fb_info = &boards[0];	/* FIXME support multiple boards ... */
-
-#ifdef CONFIG_PCI
-	if (clgen_pci_setup (fb_info, &btype)) { /* Also does OF setup */
-		DPRINTK ("EXIT, returning -ENXIO\n");
-		return -ENXIO;
-	}
+	cirrusfb_cleanup (info);
 
-#elif defined(CONFIG_ZORRO)
-	/* FIXME: CONFIG_PCI and CONFIG_ZORRO may both be defined */
-	if (clgen_zorro_setup (fb_info, &btype)) {
-		DPRINTK ("EXIT, returning -ENXIO\n");
-		return -ENXIO;
-	}
-
-#else
-#error This driver requires Zorro or PCI bus.
-#endif				/* !CONFIG_PCI, !CONFIG_ZORRO */
-
-	/* sanity checks */
-	assert (btype != BT_NONE);
-	assert (btype == clgen_board_info[btype].btype);
-
-	fb_info->btype = btype;
-
-	DPRINTK ("clgen: (RAM start set to: 0x%p)\n", fb_info->fbmem);
-
-	if (noaccel)
-	{
-		printk("clgen: disabling text acceleration support\n");
-#ifdef FBCON_HAS_CFB8
-		fbcon_clgen_8.bmove = fbcon_cfb8_bmove;
-		fbcon_clgen_8.clear = fbcon_cfb8_clear;
-#endif
-#ifdef FBCON_HAS_CFB16
-		fbcon_clgen_16.bmove = fbcon_cfb16_bmove;
-		fbcon_clgen_16.clear = fbcon_cfb16_clear;
-#endif
-#ifdef FBCON_HAS_CFB32
-		fbcon_clgen_32.bmove = fbcon_cfb32_bmove;
-		fbcon_clgen_32.clear = fbcon_cfb32_clear;
-#endif
-	}
-
-	init_vgachip (fb_info);
-
-	/* set up a few more things, register framebuffer driver etc */
-	fb_info->gen.parsize = sizeof (struct clgenfb_par);
-	fb_info->gen.fbhw = &clgen_hwswitch;
-
-	strlcpy (fb_info->gen.info.modename, clgen_board_info[btype].name,
-		 sizeof (fb_info->gen.info.modename));
-
-	fb_info->gen.info.fbops = &clgenfb_ops;
-	fb_info->gen.info.disp = &disp;
-	fb_info->gen.info.currcon = -1;
-	fb_info->gen.info.changevar = NULL;
-	fb_info->gen.info.switch_con = &fbgen_switch;
-	fb_info->gen.info.updatevar = &fbgen_update_var;
-	fb_info->gen.info.flags = FBINFO_FLAG_DEFAULT;
-
-	for (j = 0; j < 256; j++) {
-		if (j < 16) {
-			k = color_table[j];
-			fb_info->palette[j].red = default_red[k];
-			fb_info->palette[j].green = default_grn[k];
-			fb_info->palette[j].blue = default_blu[k];
-		} else {
-			fb_info->palette[j].red =
-			fb_info->palette[j].green =
-			fb_info->palette[j].blue = j;
-		}
-	}
-
-	/* now that we know the board has been registered n' stuff, we */
-	/* can finally initialize it to a default mode */
-	clgenfb_default = clgenfb_predefined[clgen_def_mode].var;
-	clgenfb_default.activate = FB_ACTIVATE_NOW;
-	clgenfb_default.yres_virtual = 480 * 3;		/* for fast scrolling (YPAN-Mode) */
-	err = fbgen_do_set_var (&clgenfb_default, 1, &fb_info->gen);
-
-	if (err) {
-		DPRINTK ("EXIT, returning -EINVAL\n");
-		return -EINVAL;
-	}
-
-	disp.var = clgenfb_default;
-	fbgen_set_disp (-1, &fb_info->gen);
-	do_install_cmap (0, &fb_info->gen.info);
-
-	err = register_framebuffer (&fb_info->gen.info);
-	if (err) {
-		printk (KERN_ERR "clgen: ERROR - could not register fb device; err = %d!\n", err);
-		DPRINTK ("EXIT, returning -EINVAL\n");
-		return -EINVAL;
-	}
-	DPRINTK ("EXIT, returning 0\n");
-	return 0;
+	DPRINTK ("EXIT\n");
 }
 
+static struct zorro_driver cirrusfb_zorro_driver = {
+	.name		= "cirrusfb",
+	.id_table	= cirrusfb_zorro_table,
+	.probe		= cirrusfb_zorro_register,
+	.remove		= __devexit_p(cirrusfb_zorro_unregister),
+};
+#endif /* CONFIG_ZORRO */
 
-
-    /*
-     *  Cleanup (only needed for module)
-     */
-static void __exit clgenfb_cleanup (struct clgenfb_info *info)
+int __init cirrusfb_init(void)
 {
-	DPRINTK ("ENTER\n");
+	int error = 0;
 
 #ifdef CONFIG_ZORRO
-	switch_monitor (info, 0);
-
-	clgen_zorro_unmap (info);
-#else
-	clgen_pci_unmap (info);
-#endif				/* CONFIG_ZORRO */
-
-	unregister_framebuffer ((struct fb_info *) info);
-	printk ("Framebuffer unregistered\n");
-
-	DPRINTK ("EXIT\n");
+	error |= zorro_module_init(&cirrusfb_zorro_driver);
+#endif
+#ifdef CONFIG_PCI
+	error |= pci_module_init(&cirrusfb_pci_driver);
+#endif
+	return error;
 }
 
 
+
 #ifndef MODULE
-int __init clgenfb_setup(char *options) {
+int __init cirrusfb_setup(char *options) {
 	char *this_opt, s[32];
 	int i;
 
@@ -2864,12 +2624,12 @@ int __init clgenfb_setup(char *options) {
 	while ((this_opt = strsep (&options, ",")) != NULL) {	
 		if (!*this_opt) continue;
 
-		DPRINTK("clgenfb_setup: option '%s'\n", this_opt);
+		DPRINTK("cirrusfb_setup: option '%s'\n", this_opt);
 
 		for (i = 0; i < NUM_TOTAL_MODES; i++) {
-			sprintf (s, "mode:%s", clgenfb_predefined[i].name);
+			sprintf (s, "mode:%s", cirrusfb_predefined[i].name);
 			if (strcmp (this_opt, s) == 0)
-				clgen_def_mode = i;
+				cirrusfb_def_mode = i;
 		}
 		if (!strcmp(this_opt, "noaccel"))
 			noaccel = 1;
@@ -2887,19 +2647,20 @@ MODULE_AUTHOR("Copyright 1999,2000 Jeff Garzik <jgarzik@pobox.com>");
 MODULE_DESCRIPTION("Accelerated FBDev driver for Cirrus Logic chips");
 MODULE_LICENSE("GPL");
 
-static void __exit clgenfb_exit (void)
+void __exit cirrusfb_exit (void)
 {
-	DPRINTK ("ENTER\n");
-
-	clgenfb_cleanup (&boards[0]);	/* FIXME: support multiple boards */
-
-	DPRINTK ("EXIT\n");
+#ifdef CONFIG_PCI
+	pci_unregister_driver(&cirrusfb_pci_driver);
+#endif
+#ifdef CONFIG_ZORRO
+	zorro_unregister_driver(&cirrusfb_zorro_driver);
+#endif
 }
 
 #ifdef MODULE
-module_init(clgenfb_init);
+module_init(cirrusfb_init);
+module_exit(cirrusfb_exit);
 #endif
-module_exit(clgenfb_exit);
 
 
 /**********************************************************************/
@@ -2910,55 +2671,55 @@ module_exit(clgenfb_exit);
 /**********************************************************************/
 
 /*** WGen() - write into one of the external/general registers ***/
-static void WGen (const struct clgenfb_info *fb_info,
+static void WGen (const struct cirrusfb_info *cinfo,
 		  int regnum, unsigned char val)
 {
 	unsigned long regofs = 0;
 
-	if (fb_info->btype == BT_PICASSO) {
+	if (cinfo->btype == BT_PICASSO) {
 		/* Picasso II specific hack */
 /*              if (regnum == VGA_PEL_IR || regnum == VGA_PEL_D || regnum == CL_VSSM2) */
 		if (regnum == VGA_PEL_IR || regnum == VGA_PEL_D)
 			regofs = 0xfff;
 	}
 
-	vga_w (fb_info->regs, regofs + regnum, val);
+	vga_w (cinfo->regbase, regofs + regnum, val);
 }
 
 /*** RGen() - read out one of the external/general registers ***/
-static unsigned char RGen (const struct clgenfb_info *fb_info, int regnum)
+static unsigned char RGen (const struct cirrusfb_info *cinfo, int regnum)
 {
 	unsigned long regofs = 0;
 
-	if (fb_info->btype == BT_PICASSO) {
+	if (cinfo->btype == BT_PICASSO) {
 		/* Picasso II specific hack */
 /*              if (regnum == VGA_PEL_IR || regnum == VGA_PEL_D || regnum == CL_VSSM2) */
 		if (regnum == VGA_PEL_IR || regnum == VGA_PEL_D)
 			regofs = 0xfff;
 	}
 
-	return vga_r (fb_info->regs, regofs + regnum);
+	return vga_r (cinfo->regbase, regofs + regnum);
 }
 
 /*** AttrOn() - turn on VideoEnable for Attribute controller ***/
-static void AttrOn (const struct clgenfb_info *fb_info)
+static void AttrOn (const struct cirrusfb_info *cinfo)
 {
-	assert (fb_info != NULL);
+	assert (cinfo != NULL);
 
 	DPRINTK ("ENTER\n");
 
-	if (vga_rcrt (fb_info->regs, CL_CRT24) & 0x80) {
+	if (vga_rcrt (cinfo->regbase, CL_CRT24) & 0x80) {
 		/* if we're just in "write value" mode, write back the */
 		/* same value as before to not modify anything */
-		vga_w (fb_info->regs, VGA_ATT_IW,
-		       vga_r (fb_info->regs, VGA_ATT_R));
+		vga_w (cinfo->regbase, VGA_ATT_IW,
+		       vga_r (cinfo->regbase, VGA_ATT_R));
 	}
 	/* turn on video bit */
-/*      vga_w (fb_info->regs, VGA_ATT_IW, 0x20); */
-	vga_w (fb_info->regs, VGA_ATT_IW, 0x33);
+/*      vga_w (cinfo->regbase, VGA_ATT_IW, 0x20); */
+	vga_w (cinfo->regbase, VGA_ATT_IW, 0x33);
 
 	/* dummy write on Reg0 to be on "write index" mode next time */
-	vga_w (fb_info->regs, VGA_ATT_IW, 0x00);
+	vga_w (cinfo->regbase, VGA_ATT_IW, 0x00);
 
 	DPRINTK ("EXIT\n");
 }
@@ -2969,127 +2730,127 @@ static void AttrOn (const struct clgenfb_info *fb_info)
  * registers of their functional group) here is a specialized routine for
  * accessing the HDR
  */
-static void WHDR (const struct clgenfb_info *fb_info, unsigned char val)
+static void WHDR (const struct cirrusfb_info *cinfo, unsigned char val)
 {
 	unsigned char dummy;
 
-	if (fb_info->btype == BT_PICASSO) {
+	if (cinfo->btype == BT_PICASSO) {
 		/* Klaus' hint for correct access to HDR on some boards */
 		/* first write 0 to pixel mask (3c6) */
-		WGen (fb_info, VGA_PEL_MSK, 0x00);
+		WGen (cinfo, VGA_PEL_MSK, 0x00);
 		udelay (200);
 		/* next read dummy from pixel address (3c8) */
-		dummy = RGen (fb_info, VGA_PEL_IW);
+		dummy = RGen (cinfo, VGA_PEL_IW);
 		udelay (200);
 	}
 	/* now do the usual stuff to access the HDR */
 
-	dummy = RGen (fb_info, VGA_PEL_MSK);
+	dummy = RGen (cinfo, VGA_PEL_MSK);
 	udelay (200);
-	dummy = RGen (fb_info, VGA_PEL_MSK);
+	dummy = RGen (cinfo, VGA_PEL_MSK);
 	udelay (200);
-	dummy = RGen (fb_info, VGA_PEL_MSK);
+	dummy = RGen (cinfo, VGA_PEL_MSK);
 	udelay (200);
-	dummy = RGen (fb_info, VGA_PEL_MSK);
+	dummy = RGen (cinfo, VGA_PEL_MSK);
 	udelay (200);
 
-	WGen (fb_info, VGA_PEL_MSK, val);
+	WGen (cinfo, VGA_PEL_MSK, val);
 	udelay (200);
 
-	if (fb_info->btype == BT_PICASSO) {
+	if (cinfo->btype == BT_PICASSO) {
 		/* now first reset HDR access counter */
-		dummy = RGen (fb_info, VGA_PEL_IW);
+		dummy = RGen (cinfo, VGA_PEL_IW);
 		udelay (200);
 
 		/* and at the end, restore the mask value */
 		/* ## is this mask always 0xff? */
-		WGen (fb_info, VGA_PEL_MSK, 0xff);
+		WGen (cinfo, VGA_PEL_MSK, 0xff);
 		udelay (200);
 	}
 }
 
 
 /*** WSFR() - write to the "special function register" (SFR) ***/
-static void WSFR (struct clgenfb_info *fb_info, unsigned char val)
+static void WSFR (struct cirrusfb_info *cinfo, unsigned char val)
 {
 #ifdef CONFIG_ZORRO
-	assert (fb_info->regs != NULL);
-	fb_info->SFR = val;
-	z_writeb (val, fb_info->regs + 0x8000);
+	assert (cinfo->regbase != NULL);
+	cinfo->SFR = val;
+	z_writeb (val, cinfo->regbase + 0x8000);
 #endif
 }
 
 /* The Picasso has a second register for switching the monitor bit */
-static void WSFR2 (struct clgenfb_info *fb_info, unsigned char val)
+static void WSFR2 (struct cirrusfb_info *cinfo, unsigned char val)
 {
 #ifdef CONFIG_ZORRO
 	/* writing an arbitrary value to this one causes the monitor switcher */
 	/* to flip to Amiga display */
-	assert (fb_info->regs != NULL);
-	fb_info->SFR = val;
-	z_writeb (val, fb_info->regs + 0x9000);
+	assert (cinfo->regbase != NULL);
+	cinfo->SFR = val;
+	z_writeb (val, cinfo->regbase + 0x9000);
 #endif
 }
 
 
 /*** WClut - set CLUT entry (range: 0..63) ***/
-static void WClut (struct clgenfb_info *fb_info, unsigned char regnum, unsigned char red,
+static void WClut (struct cirrusfb_info *cinfo, unsigned char regnum, unsigned char red,
 	    unsigned char green, unsigned char blue)
 {
 	unsigned int data = VGA_PEL_D;
 
 	/* address write mode register is not translated.. */
-	vga_w (fb_info->regs, VGA_PEL_IW, regnum);
+	vga_w (cinfo->regbase, VGA_PEL_IW, regnum);
 
-	if (fb_info->btype == BT_PICASSO || fb_info->btype == BT_PICASSO4 ||
-	    fb_info->btype == BT_ALPINE || fb_info->btype == BT_GD5480) {
+	if (cinfo->btype == BT_PICASSO || cinfo->btype == BT_PICASSO4 ||
+	    cinfo->btype == BT_ALPINE || cinfo->btype == BT_GD5480) {
 		/* but DAC data register IS, at least for Picasso II */
-		if (fb_info->btype == BT_PICASSO)
+		if (cinfo->btype == BT_PICASSO)
 			data += 0xfff;
-		vga_w (fb_info->regs, data, red);
-		vga_w (fb_info->regs, data, green);
-		vga_w (fb_info->regs, data, blue);
+		vga_w (cinfo->regbase, data, red);
+		vga_w (cinfo->regbase, data, green);
+		vga_w (cinfo->regbase, data, blue);
 	} else {
-		vga_w (fb_info->regs, data, blue);
-		vga_w (fb_info->regs, data, green);
-		vga_w (fb_info->regs, data, red);
+		vga_w (cinfo->regbase, data, blue);
+		vga_w (cinfo->regbase, data, green);
+		vga_w (cinfo->regbase, data, red);
 	}
 }
 
 
 #if 0
 /*** RClut - read CLUT entry (range 0..63) ***/
-static void RClut (struct clgenfb_info *fb_info, unsigned char regnum, unsigned char *red,
+static void RClut (struct cirrusfb_info *cinfo, unsigned char regnum, unsigned char *red,
 	    unsigned char *green, unsigned char *blue)
 {
 	unsigned int data = VGA_PEL_D;
 
-	vga_w (fb_info->regs, VGA_PEL_IR, regnum);
+	vga_w (cinfo->regbase, VGA_PEL_IR, regnum);
 
-	if (fb_info->btype == BT_PICASSO || fb_info->btype == BT_PICASSO4 ||
-	    fb_info->btype == BT_ALPINE || fb_info->btype == BT_GD5480) {
-		if (fb_info->btype == BT_PICASSO)
+	if (cinfo->btype == BT_PICASSO || cinfo->btype == BT_PICASSO4 ||
+	    cinfo->btype == BT_ALPINE || cinfo->btype == BT_GD5480) {
+		if (cinfo->btype == BT_PICASSO)
 			data += 0xfff;
-		*red = vga_r (fb_info->regs, data);
-		*green = vga_r (fb_info->regs, data);
-		*blue = vga_r (fb_info->regs, data);
+		*red = vga_r (cinfo->regbase, data);
+		*green = vga_r (cinfo->regbase, data);
+		*blue = vga_r (cinfo->regbase, data);
 	} else {
-		*blue = vga_r (fb_info->regs, data);
-		*green = vga_r (fb_info->regs, data);
-		*red = vga_r (fb_info->regs, data);
+		*blue = vga_r (cinfo->regbase, data);
+		*green = vga_r (cinfo->regbase, data);
+		*red = vga_r (cinfo->regbase, data);
 	}
 }
 #endif
 
 
 /*******************************************************************
-	clgen_WaitBLT()
+	cirrusfb_WaitBLT()
 
 	Wait for the BitBLT engine to complete a possible earlier job
 *********************************************************************/
 
 /* FIXME: use interrupts instead */
-static inline void clgen_WaitBLT (caddr_t regbase)
+static void cirrusfb_WaitBLT (caddr_t regbase)
 {
 	/* now busy-wait until we're done */
 	while (vga_rgfx (regbase, CL_GR31) & 0x08)
@@ -3097,13 +2858,14 @@ static inline void clgen_WaitBLT (caddr_t regbase)
 }
 
 /*******************************************************************
-	clgen_BitBLT()
+	cirrusfb_BitBLT()
 
 	perform accelerated "scrolling"
 ********************************************************************/
 
-static void clgen_BitBLT (caddr_t regbase, u_short curx, u_short cury, u_short destx, u_short desty,
-		   u_short width, u_short height, u_short line_length)
+static void cirrusfb_BitBLT (caddr_t regbase, int bits_per_pixel,
+			     u_short curx, u_short cury, u_short destx, u_short desty,
+			     u_short width, u_short height, u_short line_length)
 {
 	u_short nwidth, nheight;
 	u_long nsrc, ndest;
@@ -3134,8 +2896,6 @@ static void clgen_BitBLT (caddr_t regbase, u_short curx, u_short cury, u_short d
 		ndest = desty * line_length + destx + nheight * line_length + nwidth;
 	}
 
-        clgen_WaitBLT(regbase);
-
 	/*
 	   run-down of registers to be programmed:
 	   destination pitch
@@ -3149,6 +2909,8 @@ static void clgen_BitBLT (caddr_t regbase, u_short curx, u_short cury, u_short d
 	   start/stop
 	 */
 
+        cirrusfb_WaitBLT(regbase);
+
 	/* pitch: set to line_length */
 	vga_wgfx (regbase, CL_GR24, line_length & 0xff);	/* dest pitch low */
 	vga_wgfx (regbase, CL_GR25, (line_length >> 8));	/* dest pitch hi */
@@ -3187,12 +2949,12 @@ static void clgen_BitBLT (caddr_t regbase, u_short curx, u_short cury, u_short d
 
 
 /*******************************************************************
-	clgen_RectFill()
+	cirrusfb_RectFill()
 
 	perform accelerated rectangle fill
 ********************************************************************/
 
-static void clgen_RectFill (struct clgenfb_info *fb_info,
+static void cirrusfb_RectFill (caddr_t regbase, int bits_per_pixel,
 		     u_short x, u_short y, u_short width, u_short height,
 		     u_char color, u_short line_length)
 {
@@ -3207,61 +2969,61 @@ static void clgen_RectFill (struct clgenfb_info *fb_info,
 
 	ndest = (y * line_length) + x;
 
-        clgen_WaitBLT(fb_info->regs);
+        cirrusfb_WaitBLT(regbase);
 
 	/* pitch: set to line_length */
-	vga_wgfx (fb_info->regs, CL_GR24, line_length & 0xff);	/* dest pitch low */
-	vga_wgfx (fb_info->regs, CL_GR25, (line_length >> 8));	/* dest pitch hi */
-	vga_wgfx (fb_info->regs, CL_GR26, line_length & 0xff);	/* source pitch low */
-	vga_wgfx (fb_info->regs, CL_GR27, (line_length >> 8));	/* source pitch hi */
+	vga_wgfx (regbase, CL_GR24, line_length & 0xff);	/* dest pitch low */
+	vga_wgfx (regbase, CL_GR25, (line_length >> 8));	/* dest pitch hi */
+	vga_wgfx (regbase, CL_GR26, line_length & 0xff);	/* source pitch low */
+	vga_wgfx (regbase, CL_GR27, (line_length >> 8));	/* source pitch hi */
 
 	/* BLT width: actual number of pixels - 1 */
-	vga_wgfx (fb_info->regs, CL_GR20, nwidth & 0xff);	/* BLT width low */
-	vga_wgfx (fb_info->regs, CL_GR21, (nwidth >> 8));	/* BLT width hi */
+	vga_wgfx (regbase, CL_GR20, nwidth & 0xff);	/* BLT width low */
+	vga_wgfx (regbase, CL_GR21, (nwidth >> 8));	/* BLT width hi */
 
 	/* BLT height: actual number of lines -1 */
-	vga_wgfx (fb_info->regs, CL_GR22, nheight & 0xff);		/* BLT height low */
-	vga_wgfx (fb_info->regs, CL_GR23, (nheight >> 8));		/* BLT width hi */
+	vga_wgfx (regbase, CL_GR22, nheight & 0xff);		/* BLT height low */
+	vga_wgfx (regbase, CL_GR23, (nheight >> 8));		/* BLT width hi */
 
 	/* BLT destination */
-	vga_wgfx (fb_info->regs, CL_GR28, (u_char) (ndest & 0xff));	/* BLT dest low */
-	vga_wgfx (fb_info->regs, CL_GR29, (u_char) (ndest >> 8));	/* BLT dest mid */
-	vga_wgfx (fb_info->regs, CL_GR2A, (u_char) (ndest >> 16));		/* BLT dest hi */
+	vga_wgfx (regbase, CL_GR28, (u_char) (ndest & 0xff));	/* BLT dest low */
+	vga_wgfx (regbase, CL_GR29, (u_char) (ndest >> 8));	/* BLT dest mid */
+	vga_wgfx (regbase, CL_GR2A, (u_char) (ndest >> 16));		/* BLT dest hi */
 
 	/* BLT source: set to 0 (is a dummy here anyway) */
-	vga_wgfx (fb_info->regs, CL_GR2C, 0x00);	/* BLT src low */
-	vga_wgfx (fb_info->regs, CL_GR2D, 0x00);	/* BLT src mid */
-	vga_wgfx (fb_info->regs, CL_GR2E, 0x00);	/* BLT src hi */
+	vga_wgfx (regbase, CL_GR2C, 0x00);	/* BLT src low */
+	vga_wgfx (regbase, CL_GR2D, 0x00);	/* BLT src mid */
+	vga_wgfx (regbase, CL_GR2E, 0x00);	/* BLT src hi */
 
 	/* This is a ColorExpand Blt, using the */
 	/* same color for foreground and background */
-	vga_wgfx (fb_info->regs, VGA_GFX_SR_VALUE, color);	/* foreground color */
-	vga_wgfx (fb_info->regs, VGA_GFX_SR_ENABLE, color);	/* background color */
+	vga_wgfx (regbase, VGA_GFX_SR_VALUE, color);	/* foreground color */
+	vga_wgfx (regbase, VGA_GFX_SR_ENABLE, color);	/* background color */
 
 	op = 0xc0;
-	if (fb_info->currentmode.var.bits_per_pixel == 16) {
-		vga_wgfx (fb_info->regs, CL_GR10, color);	/* foreground color */
-		vga_wgfx (fb_info->regs, CL_GR11, color);	/* background color */
+	if (bits_per_pixel == 16) {
+		vga_wgfx (regbase, CL_GR10, color);	/* foreground color */
+		vga_wgfx (regbase, CL_GR11, color);	/* background color */
 		op = 0x50;
 		op = 0xd0;
-	} else if (fb_info->currentmode.var.bits_per_pixel == 32) {
-		vga_wgfx (fb_info->regs, CL_GR10, color);	/* foreground color */
-		vga_wgfx (fb_info->regs, CL_GR11, color);	/* background color */
-		vga_wgfx (fb_info->regs, CL_GR12, color);	/* foreground color */
-		vga_wgfx (fb_info->regs, CL_GR13, color);	/* background color */
-		vga_wgfx (fb_info->regs, CL_GR14, 0);	/* foreground color */
-		vga_wgfx (fb_info->regs, CL_GR15, 0);	/* background color */
+	} else if (bits_per_pixel == 32) {
+		vga_wgfx (regbase, CL_GR10, color);	/* foreground color */
+		vga_wgfx (regbase, CL_GR11, color);	/* background color */
+		vga_wgfx (regbase, CL_GR12, color);	/* foreground color */
+		vga_wgfx (regbase, CL_GR13, color);	/* background color */
+		vga_wgfx (regbase, CL_GR14, 0);	/* foreground color */
+		vga_wgfx (regbase, CL_GR15, 0);	/* background color */
 		op = 0x50;
 		op = 0xf0;
 	}
 	/* BLT mode: color expand, Enable 8x8 copy (faster?) */
-	vga_wgfx (fb_info->regs, CL_GR30, op);	/* BLT mode */
+	vga_wgfx (regbase, CL_GR30, op);	/* BLT mode */
 
 	/* BLT ROP: SrcCopy */
-	vga_wgfx (fb_info->regs, CL_GR32, 0x0d);	/* BLT ROP */
+	vga_wgfx (regbase, CL_GR32, 0x0d);	/* BLT ROP */
 
 	/* and finally: GO! */
-	vga_wgfx (fb_info->regs, CL_GR31, 0x02);	/* BLT Start/status */
+	vga_wgfx (regbase, CL_GR31, 0x02);	/* BLT Start/status */
 
 	DPRINTK ("EXIT\n");
 }
@@ -3349,10 +3111,10 @@ static void bestclock (long freq, long *best, long *nom,
  * -------------------------------------------------------------------------
  */
 
-#ifdef CLGEN_DEBUG
+#ifdef CIRRUSFB_DEBUG
 
 /**
- * clgen_dbg_print_byte
+ * cirrusfb_dbg_print_byte
  * @name: name associated with byte value to be displayed
  * @val: byte value to be displayed
  *
@@ -3363,7 +3125,7 @@ static void bestclock (long freq, long *best, long *nom,
  */
 
 static
-void clgen_dbg_print_byte (const char *name, unsigned char val)
+void cirrusfb_dbg_print_byte (const char *name, unsigned char val)
 {
 	DPRINTK ("%8s = 0x%02X (bits 7-0: %c%c%c%c%c%c%c%c)\n",
 		 name, val,
@@ -3379,7 +3141,7 @@ void clgen_dbg_print_byte (const char *name, unsigned char val)
 
 
 /**
- * clgen_dbg_print_regs
+ * cirrusfb_dbg_print_regs
  * @base: If using newmmio, the newmmio base address, otherwise %NULL
  * @reg_class: type of registers to read: %CRT, or %SEQ
  *
@@ -3390,7 +3152,7 @@ void clgen_dbg_print_byte (const char *name, unsigned char val)
  */
 
 static
-void clgen_dbg_print_regs (caddr_t regbase, clgen_dbg_reg_class_t reg_class,...)
+void cirrusfb_dbg_print_regs (caddr_t regbase, cirrusfb_dbg_reg_class_t reg_class,...)
 {
 	va_list list;
 	unsigned char val = 0;
@@ -3416,7 +3178,7 @@ void clgen_dbg_print_regs (caddr_t regbase, clgen_dbg_reg_class_t reg_class,...)
 			break;
 		}
 
-		clgen_dbg_print_byte (name, val);
+		cirrusfb_dbg_print_byte (name, val);
 
 		name = va_arg (list, char *);
 	}
@@ -3426,35 +3188,35 @@ void clgen_dbg_print_regs (caddr_t regbase, clgen_dbg_reg_class_t reg_class,...)
 
 
 /**
- * clgen_dump
- * @clgeninfo:
+ * cirrusfb_dump
+ * @cirrusfbinfo:
  *
  * DESCRIPTION:
  */
 
 static
-void clgen_dump (void)
+void cirrusfb_dump (void)
 {
-	clgen_dbg_reg_dump (NULL);
+	cirrusfb_dbg_reg_dump (NULL);
 }
 
 
 /**
- * clgen_dbg_reg_dump
+ * cirrusfb_dbg_reg_dump
  * @base: If using newmmio, the newmmio base address, otherwise %NULL
  *
  * DESCRIPTION:
- * Dumps a list of interesting VGA and CLGEN registers.  If @base is %NULL,
+ * Dumps a list of interesting VGA and CIRRUSFB registers.  If @base is %NULL,
  * old-style I/O ports are queried for information, otherwise MMIO is
  * used at the given @base address to query the information.
  */
 
 static
-void clgen_dbg_reg_dump (caddr_t regbase)
+void cirrusfb_dbg_reg_dump (caddr_t regbase)
 {
-	DPRINTK ("CLGEN VGA CRTC register dump:\n");
+	DPRINTK ("CIRRUSFB VGA CRTC register dump:\n");
 
-	clgen_dbg_print_regs (regbase, CRT,
+	cirrusfb_dbg_print_regs (regbase, CRT,
 			   "CR00", 0x00,
 			   "CR01", 0x01,
 			   "CR02", 0x02,
@@ -3506,9 +3268,9 @@ void clgen_dbg_reg_dump (caddr_t regbase)
 
 	DPRINTK ("\n");
 
-	DPRINTK ("CLGEN VGA SEQ register dump:\n");
+	DPRINTK ("CIRRUSFB VGA SEQ register dump:\n");
 
-	clgen_dbg_print_regs (regbase, SEQ,
+	cirrusfb_dbg_print_regs (regbase, SEQ,
 			   "SR00", 0x00,
 			   "SR01", 0x01,
 			   "SR02", 0x02,
@@ -3540,5 +3302,5 @@ void clgen_dbg_reg_dump (caddr_t regbase)
 	DPRINTK ("\n");
 }
 
-#endif				/* CLGEN_DEBUG */
+#endif				/* CIRRUSFB_DEBUG */
 
diff --git a/drivers/video/console/Kconfig b/drivers/video/console/Kconfig
index 77ffb9a85..5bc0ef0ab 100644
--- a/drivers/video/console/Kconfig
+++ b/drivers/video/console/Kconfig
@@ -106,11 +106,6 @@ config FRAMEBUFFER_CONSOLE
 	tristate "Framebuffer Console support"
 	depends on FB
 
-config PCI_CONSOLE
-	bool
-	depends on FRAMEBUFFER_CONSOLE
-	default y
-
 config FONTS
 	bool "Select compiled-in fonts"
 	depends on FRAMEBUFFER_CONSOLE
diff --git a/drivers/video/console/dummycon.c b/drivers/video/console/dummycon.c
index cbe338681..3ac5d5842 100644
--- a/drivers/video/console/dummycon.c
+++ b/drivers/video/console/dummycon.c
@@ -71,7 +71,10 @@ const struct consw dummy_con = {
     .con_bmove =	DUMMY,
     .con_switch =	DUMMY,
     .con_blank =	DUMMY,
-    .con_font_op =	DUMMY,
+    .con_font_set =	DUMMY,
+    .con_font_get =	DUMMY,
+    .con_font_default =	DUMMY,
+    .con_font_copy =	DUMMY,
     .con_set_palette =	DUMMY,
     .con_scrolldelta =	DUMMY,
 };
diff --git a/drivers/video/console/fbcon.c b/drivers/video/console/fbcon.c
index d0f9920c2..2fcb51a57 100644
--- a/drivers/video/console/fbcon.c
+++ b/drivers/video/console/fbcon.c
@@ -101,7 +101,7 @@
 #endif
 
 struct display fb_display[MAX_NR_CONSOLES];
-char con2fb_map[MAX_NR_CONSOLES];
+signed char con2fb_map[MAX_NR_CONSOLES];
 static int logo_height;
 static int logo_lines;
 static int logo_shown = -1;
@@ -118,6 +118,9 @@ static int fbcon_is_default = 1;
 /* font data */
 static char fontname[40];
 
+/* current fb_info */
+static int info_idx =  -1;
+
 #define REFCOUNT(fd)	(((int *)(fd))[-1])
 #define FNTSIZE(fd)	(((int *)(fd))[-2])
 #define FNTCHARCNT(fd)	(((int *)(fd))[-3])
@@ -162,9 +165,10 @@ static void fbcon_bmove(struct vc_data *vc, int sy, int sx, int dy, int dx,
 			int height, int width);
 static int fbcon_switch(struct vc_data *vc);
 static int fbcon_blank(struct vc_data *vc, int blank, int mode_switch);
-static int fbcon_font_op(struct vc_data *vc, struct console_font_op *op);
 static int fbcon_set_palette(struct vc_data *vc, unsigned char *table);
 static int fbcon_scrolldelta(struct vc_data *vc, int lines);
+void accel_clear_margins(struct vc_data *vc, struct fb_info *info,
+			 int bottom_only);
 
 
 /*
@@ -177,6 +181,9 @@ static __inline__ void ypan_up(struct vc_data *vc, int count);
 static __inline__ void ypan_down(struct vc_data *vc, int count);
 static void fbcon_bmove_rec(struct vc_data *vc, struct display *p, int sy, int sx,
 			    int dy, int dx, int height, int width, u_int y_break);
+static void fbcon_set_disp(struct fb_info *info, struct vc_data *vc);
+static void fbcon_redraw_move(struct vc_data *vc, struct display *p,
+			      int line, int count, int dy);
 
 #ifdef CONFIG_MAC
 /*
@@ -194,9 +201,14 @@ static irqreturn_t fb_vbl_detect(int irq, void *dummy, struct pt_regs *fp)
 static void fb_flashcursor(void *private)
 {
 	struct fb_info *info = (struct fb_info *) private;
+	struct vc_data *vc = NULL;
+
+	if (info->currcon != -1)
+		vc = vc_cons[info->currcon].d;
 
-	if (!info || info->state != FBINFO_STATE_RUNNING ||
-	    info->cursor.rop == ROP_COPY)
+	if (info->state != FBINFO_STATE_RUNNING ||
+	    info->cursor.rop == ROP_COPY || !vc || !CON_IS_VISIBLE(vc)
+	    || registered_fb[(int) con2fb_map[vc->vc_num]] != info)
 		return;
 	acquire_console_sem();
 	info->cursor.enable ^= 1;
@@ -218,17 +230,12 @@ static irqreturn_t fb_vbl_handler(int irq, void *dev_id, struct pt_regs *fp)
 }
 #endif
 	
-static void cursor_timer_handler(unsigned long dev_addr);
-
-static struct timer_list cursor_timer =
-		TIMER_INITIALIZER(cursor_timer_handler, 0, 0);
-
 static void cursor_timer_handler(unsigned long dev_addr)
 {
 	struct fb_info *info = (struct fb_info *) dev_addr;
 	
-	schedule_work(&info->queue);	
-	mod_timer(&cursor_timer, jiffies + HZ/5);
+	schedule_work(&info->queue);
+	mod_timer(&info->cursor_timer, jiffies + HZ/5);
 }
 
 int __init fb_console_setup(char *this_opt)
@@ -285,6 +292,28 @@ int __init fb_console_setup(char *this_opt)
 
 __setup("fbcon=", fb_console_setup);
 
+static int search_fb_in_map(int idx)
+{
+	int i;
+
+	for (i = 0; i < MAX_NR_CONSOLES; i++) {
+		if (con2fb_map[i] == idx)
+			return 1;
+	}
+	return 0;
+}
+
+static int search_for_mapped_con(void)
+{
+	int i;
+
+	for (i = 0; i < MAX_NR_CONSOLES; i++) {
+		if (con2fb_map[i] != -1)
+			return 1;
+	}
+	return 0;
+}
+
 /**
  *	set_con2fb_map - map console to frame buffer device
  *	@unit: virtual console number to map
@@ -296,12 +325,81 @@ __setup("fbcon=", fb_console_setup);
 int set_con2fb_map(int unit, int newidx)
 {
 	struct vc_data *vc = vc_cons[unit].d;
+	int oldidx = con2fb_map[unit];
+	struct fb_info *info = registered_fb[newidx];
+	struct fb_info *oldinfo = NULL;
+	int found;
+
+	if (oldidx == newidx)
+		return 0;
 
 	if (!vc)
-		return -ENODEV;
+	    return -ENODEV;
+
+	if (!search_for_mapped_con()) {
+		info_idx = newidx;
+		fb_console_init();
+		return 0;
+	}
+
+	if (oldidx != -1)
+		oldinfo = registered_fb[oldidx];
+
+	found = search_fb_in_map(newidx);
+
+	acquire_console_sem();
 	con2fb_map[unit] = newidx;
-	fbcon_is_default = (vc->vc_sw == &fb_con) ? 1 : 0;
-	return take_over_console(&fb_con, unit, unit, fbcon_is_default);
+	if (!found) {
+		if (!try_module_get(info->fbops->owner)) {
+			con2fb_map[unit] = oldidx;
+			release_console_sem();
+			return -ENODEV;
+		}
+		if (info->fbops->fb_open && info->fbops->fb_open(info, 0)) {
+			module_put(info->fbops->owner);
+			con2fb_map[unit] = oldidx;
+			release_console_sem();
+			return -ENODEV;
+		}
+	}
+
+	/*
+	 * If old fb is not mapped to any of the consoles,
+	 * fbcon should release it.
+	 */
+	if (oldinfo && !search_fb_in_map(oldidx)) {
+		if (oldinfo->fbops->fb_release &&
+		    oldinfo->fbops->fb_release(oldinfo, 0)) {
+			con2fb_map[unit] = oldidx;
+			if (!found && info->fbops->fb_release)
+				info->fbops->fb_release(info, 0);
+			if (!found)
+				module_put(info->fbops->owner);
+			release_console_sem();
+			return -ENODEV;
+		}
+		if (oldinfo->queue.func == fb_flashcursor)
+			del_timer_sync(&oldinfo->cursor_timer);
+		module_put(oldinfo->fbops->owner);
+	}
+	info->currcon = -1;
+	if (!found) {
+		if (!info->queue.func || info->queue.func == fb_flashcursor) {
+			if (!info->queue.func)
+				INIT_WORK(&info->queue, fb_flashcursor, info);
+
+			init_timer(&info->cursor_timer);
+			info->cursor_timer.function = cursor_timer_handler;
+			info->cursor_timer.expires = jiffies + HZ / 5;
+			info->cursor_timer.data = (unsigned long ) info;
+			add_timer(&info->cursor_timer);
+		}
+	}
+	if (info->fbops->fb_set_par)
+		info->fbops->fb_set_par(info);
+	fbcon_set_disp(info, vc);
+	release_console_sem();
+	return 0;
 }
 
 /*
@@ -339,8 +437,15 @@ void accel_clear(struct vc_data *vc, struct fb_info *info, int sy,
 }	
 
 void accel_putcs(struct vc_data *vc, struct fb_info *info,
-			const unsigned short *s, int count, int yy, int xx)
+		 const unsigned short *s, int count, int yy, int xx)
 {
+	void (*move_unaligned)(struct fb_info *info, struct fb_pixmap *buf,
+			       u8 *dst, u32 d_pitch, u8 *src, u32 idx,
+			       u32 height, u32 shift_high, u32 shift_low,
+			       u32 mod);
+	void (*move_aligned)(struct fb_info *info, struct fb_pixmap *buf,
+			     u8 *dst, u32 d_pitch, u8 *src, u32 s_pitch,
+			     u32 height);
 	unsigned short charmask = vc->vc_hi_font_mask ? 0x1ff : 0xff;
 	unsigned int width = (vc->vc_font.width + 7) >> 3;
 	unsigned int cellsize = vc->vc_font.height * width;
@@ -349,20 +454,26 @@ void accel_putcs(struct vc_data *vc, struct fb_info *info,
 	unsigned int buf_align = info->pixmap.buf_align - 1;
 	unsigned int shift_low = 0, mod = vc->vc_font.width % 8;
 	unsigned int shift_high = 8, pitch, cnt, size, k;
-	int bgshift = (vc->vc_hi_font_mask) ? 13 : 12;
-	int fgshift = (vc->vc_hi_font_mask) ? 9 : 8;
 	unsigned int idx = vc->vc_font.width >> 3;
 	struct fb_image image;
-	u16 c = scr_readw(s);
-	u8 *src, *dst, *dst0;
+	u8 *src, *dst;
 
-	image.fg_color = attr_fgcol(fgshift, c);
-	image.bg_color = attr_bgcol(bgshift, c);
+	image.fg_color = attr_fgcol((vc->vc_hi_font_mask) ? 9 : 8,
+				    scr_readw(s));
+	image.bg_color = attr_bgcol((vc->vc_hi_font_mask) ? 13 : 12,
+				    scr_readw(s));
 	image.dx = xx * vc->vc_font.width;
 	image.dy = yy * vc->vc_font.height;
 	image.height = vc->vc_font.height;
 	image.depth = 1;
 
+	if (info->pixmap.outbuf && info->pixmap.inbuf) {
+		move_aligned = fb_iomove_buf_aligned;
+		move_unaligned = fb_iomove_buf_unaligned;
+	} else {
+		move_aligned = fb_sysmove_buf_aligned;
+		move_unaligned = fb_sysmove_buf_unaligned;
+	}
 	while (count) {
 		if (count > maxcnt)
 			cnt = k = maxcnt;
@@ -374,24 +485,27 @@ void accel_putcs(struct vc_data *vc, struct fb_info *info,
 		pitch &= ~scan_align;
 		size = pitch * image.height + buf_align;
 		size &= ~buf_align;
-		dst0 = fb_get_buffer_offset(info, &info->pixmap, size);
-		image.data = dst0;
-		while (k--) {
-			src = vc->vc_font.data + (scr_readw(s++) & charmask)*cellsize;
-			dst = dst0;
-
-			if (mod) {
-				fb_move_buf_unaligned(info, &info->pixmap, dst, pitch,
-						   src, idx, image.height, shift_high,
-						   shift_low, mod);
+		dst = fb_get_buffer_offset(info, &info->pixmap, size);
+		image.data = dst;
+		if (mod) {
+			while (k--) {
+				src = vc->vc_font.data + (scr_readw(s++)&
+							  charmask)*cellsize;
+				move_unaligned(info, &info->pixmap, dst, pitch,
+					       src, idx, image.height,
+					       shift_high, shift_low, mod);
 				shift_low += mod;
-				dst0 += (shift_low >= 8) ? width : width - 1;
+				dst += (shift_low >= 8) ? width : width - 1;
 				shift_low &= 7;
 				shift_high = 8 - shift_low;
-			} else {
-				fb_move_buf_aligned(info, &info->pixmap, dst, pitch,
-						 src, idx, image.height);
-				dst0 += width;
+			}
+		} else {
+			while (k--) {
+				src = vc->vc_font.data + (scr_readw(s++)&
+							  charmask)*cellsize;
+				move_aligned(info, &info->pixmap, dst, pitch,
+					     src, idx, image.height);
+				dst += width;
 			}
 		}
 		info->fbops->fb_imageblit(info, &image);
@@ -443,9 +557,8 @@ static const char *fbcon_startup(void)
 	struct vc_data *vc = vc_cons[fg_console].d;
 	struct font_desc *font = NULL;
 	struct module *owner;
-	struct fb_info *info;
-	static int done = 0;
-	int cols, rows;
+	struct fb_info *info = NULL;
+	int rows, cols;
 	int irqres;
 
 	irqres = 1;
@@ -453,20 +566,24 @@ static const char *fbcon_startup(void)
 	 *  If num_registered_fb is zero, this is a call for the dummy part.
 	 *  The frame buffer devices weren't initialized yet.
 	 */
-	if (!num_registered_fb || done)
+	if (!num_registered_fb || info_idx == -1)
 		return display_desc;
-	done = 1;
-
-	info = registered_fb[0];	
-	if (!info)	return NULL;
+	/*
+	 * Instead of blindly using registered_fb[0], we use info_idx, set by
+	 * fb_console_init();
+	 */
+	info = registered_fb[info_idx];
+	if (!info)
+		return NULL;
 	info->currcon = -1;
 	
 	owner = info->fbops->owner;
 	if (!try_module_get(owner))
 		return NULL;
-	if (info->fbops->fb_open && info->fbops->fb_open(info, 0))
+	if (info->fbops->fb_open && info->fbops->fb_open(info, 0)) {
 		module_put(owner);
-	
+		return NULL;
+	}
 	if (info->fix.type != FB_TYPE_TEXT) {
 		if (fbcon_softback_size) {
 			if (!softback_buf) {
@@ -503,15 +620,8 @@ static const char *fbcon_startup(void)
 		vc->vc_font.charcount = 256; /* FIXME  Need to support more fonts */
 	}
 
-	/*
-	 * We must always set the mode. The mode of the previous console
-	 * driver could be in the same resolution but we are using different
-	 * hardware so we have to initialize the hardware.
-	 */
-	if (info->fbops->fb_set_par)
-		info->fbops->fb_set_par(info);
-	cols = info->var.xres/vc->vc_font.width;
-	rows = info->var.yres/vc->vc_font.height;
+	cols = info->var.xres / vc->vc_font.width;
+	rows = info->var.yres / vc->vc_font.height;
 	vc_resize(vc->vc_num, cols, rows);
 
 	DPRINTK("mode:   %s\n", info->fix.id);
@@ -585,10 +695,12 @@ static const char *fbcon_startup(void)
 	 * default timer to flash the cursor. */
 	if (!info->queue.func) {
 		INIT_WORK(&info->queue, fb_flashcursor, info);
-		
-		cursor_timer.expires = jiffies + HZ / 5;
-		cursor_timer.data = (unsigned long ) info;
-		add_timer(&cursor_timer);
+
+		init_timer(&info->cursor_timer);
+		info->cursor_timer.function = cursor_timer_handler;
+		info->cursor_timer.expires = jiffies + HZ / 5;
+		info->cursor_timer.data = (unsigned long ) info;
+		add_timer(&info->cursor_timer);
 	}
 	return display_desc;
 }
@@ -599,10 +711,13 @@ static void fbcon_init(struct vc_data *vc, int init)
 	struct vc_data **default_mode = vc->vc_display_fg;
 	struct display *t, *p = &fb_display[vc->vc_num];
 	int display_fg = (*default_mode)->vc_num;
-	int logo = 1, rows, cols, charcnt = 256;
+	int logo = 1, new_rows, new_cols, rows, cols, charcnt = 256;
 	unsigned short *save = NULL, *r, *q;
+	int cap = info->flags;
 
-	if (vc->vc_num != display_fg || (info->flags & FBINFO_FLAG_MODULE) ||
+	if (info_idx == -1 || info == NULL)
+	    return;
+	if (vc->vc_num != display_fg || (info->flags & FBINFO_MODULE) ||
 	    (info->fix.type == FB_TYPE_TEXT))
 		logo = 0;
 
@@ -611,16 +726,17 @@ static void fbcon_init(struct vc_data *vc, int init)
 	/* If we are not the first console on this
 	   fb, copy the font from that console */
 	t = &fb_display[display_fg];
-	vc->vc_font.width = (*default_mode)->vc_font.width;
-	vc->vc_font.height = (*default_mode)->vc_font.height;
-	vc->vc_font.data = p->fontdata = t->fontdata;
-	p->userfont = t->userfont;
-	if (p->userfont) {
-		REFCOUNT(p->fontdata)++;
-		charcnt = FNTCHARCNT(p->fontdata);
+	if (!vc->vc_font.data) {
+		vc->vc_font.data = p->fontdata = t->fontdata;
+		vc->vc_font.width = (*default_mode)->vc_font.width;
+		vc->vc_font.height = (*default_mode)->vc_font.height;
+		p->userfont = t->userfont;
+		if (p->userfont)
+			REFCOUNT(p->fontdata)++;
+		con_copy_unimap(vc->vc_num, display_fg);
 	}
-	con_copy_unimap(vc->vc_num, display_fg);
-
+	if (p->userfont)
+		charcnt = FNTCHARCNT(p->fontdata);
 	vc->vc_can_do_color = info->var.bits_per_pixel != 1;
 	vc->vc_complement_mask = vc->vc_can_do_color ? 0x7700 : 0x0800;
 	if (charcnt == 256) {
@@ -630,24 +746,36 @@ static void fbcon_init(struct vc_data *vc, int init)
 		if (vc->vc_can_do_color)
 			vc->vc_complement_mask <<= 1;
 	}
+	cols = vc->vc_cols;
+	rows = vc->vc_rows;
+	new_cols = info->var.xres / vc->vc_font.width;
+	new_rows = info->var.yres / vc->vc_font.height;
+	vc_resize(vc->vc_num, new_cols, new_rows);
+	/*
+	 * We must always set the mode. The mode of the previous console
+	 * driver could be in the same resolution but we are using different
+	 * hardware so we have to initialize the hardware.
+	 *
+	 * We need to do it in fbcon_init() to prevent screen corruption.
+	 */
+	if (CON_IS_VISIBLE(vc) && info->fbops->fb_set_par)
+		info->fbops->fb_set_par(info);
 
-	cols = info->var.xres / vc->vc_font.width;
-	rows = info->var.yres / vc->vc_font.height;
-	vc_resize(vc->vc_num, cols, rows);
 
-	if (info->var.accel_flags)
-		p->scrollmode = SCROLL_YNOMOVE;
-	else
-		p->scrollmode = SCROLL_YREDRAW;
+	if ((cap & FBINFO_HWACCEL_COPYAREA) &&
+	    !(cap & FBINFO_HWACCEL_DISABLED))
+		p->scrollmode = SCROLL_MOVE;
+	else /* default to something safe */
+		p->scrollmode = SCROLL_REDRAW;
 
 	/*
 	 *  ++guenther: console.c:vc_allocate() relies on initializing
 	 *  vc_{cols,rows}, but we must not set those if we are only
 	 *  resizing the console.
 	 */
-	if (init) {
-		vc->vc_cols = cols;
-		vc->vc_rows = rows;
+	if (!init) {
+		vc->vc_cols = new_cols;
+		vc->vc_rows = new_rows;
 	}
 
 	if (logo) {
@@ -664,14 +792,15 @@ static void fbcon_init(struct vc_data *vc, int init)
 		for (r = q - logo_lines * cols; r < q; r++)
 			if (scr_readw(r) != vc->vc_video_erase_char)
 				break;
-		if (r != q && rows >= rows + logo_lines) {
-			save = kmalloc(logo_lines * cols * 2, GFP_KERNEL);
+		if (r != q && new_rows >= rows + logo_lines) {
+			save = kmalloc(logo_lines * new_cols * 2, GFP_KERNEL);
 			if (save) {
+				int i = cols < new_cols ? cols : new_cols;
 				scr_memsetw(save, vc->vc_video_erase_char,
-					    logo_lines * cols * 2);
+					    logo_lines * new_cols * 2);
 				r = q - step;
-				for (cnt = 0; cnt < logo_lines; cnt++, r += cols)
-					scr_memcpyw(save + cnt * cols, r, 2 * cols);
+				for (cnt = 0; cnt < logo_lines; cnt++, r += i)
+					scr_memcpyw(save + cnt * new_cols, r, 2 * i);
 				r = q;
 			}
 		}
@@ -699,7 +828,7 @@ static void fbcon_init(struct vc_data *vc, int init)
 			q = (unsigned short *) (vc->vc_origin +
 						vc->vc_size_row *
 						rows);
-			scr_memcpyw(q, save, logo_lines * cols * 2);
+			scr_memcpyw(q, save, logo_lines * new_cols * 2);
 			vc->vc_y += logo_lines;
 			vc->vc_pos += logo_lines * vc->vc_size_row;
 			kfree(save);
@@ -730,6 +859,8 @@ static void fbcon_deinit(struct vc_data *vc)
 {
 	struct display *p = &fb_display[vc->vc_num];
 
+	if (info_idx != -1)
+	    return;
 	fbcon_free_font(p);
 }
 
@@ -836,7 +967,10 @@ static void fbcon_putc(struct vc_data *vc, int c, int ypos, int xpos)
 	dst = fb_get_buffer_offset(info, &info->pixmap, size);
 	image.data = dst;
 
-	fb_move_buf_aligned(info, &info->pixmap, dst, pitch, src, width, image.height);
+	if (info->pixmap.outbuf)
+		fb_iomove_buf_aligned(info, &info->pixmap, dst, pitch, src, width, image.height);
+	else
+		fb_sysmove_buf_aligned(info, &info->pixmap, dst, pitch, src, width, image.height);
 
 	info->fbops->fb_imageblit(info, &image);
 }
@@ -924,7 +1058,8 @@ static void fbcon_cursor(struct vc_data *vc, int mode)
 			cursor.set |= FB_CUR_SETHOT;
 		}
 
-		if ((cursor.set & FB_CUR_SETSIZE) || ((vc->vc_cursor_type & 0x0f) != p->cursor_shape)) {
+		if ((cursor.set & FB_CUR_SETSIZE) || ((vc->vc_cursor_type & 0x0f) != p->cursor_shape)
+		    || info->cursor.mask == NULL) {
 			char *mask = kmalloc(w*vc->vc_font.height, GFP_ATOMIC);
 			int cur_height, size, i = 0;
 
@@ -983,6 +1118,57 @@ int update_var(int con, struct fb_info *info)
 	return 0;
 }
 
+static void fbcon_set_disp(struct fb_info *info, struct vc_data *vc)
+{
+	struct display *p = &fb_display[vc->vc_num], *t;
+	struct vc_data **default_mode = vc->vc_display_fg;
+	int display_fg = (*default_mode)->vc_num;
+	int rows, cols, charcnt = 256;
+
+	info->var.xoffset = info->var.yoffset = p->yscroll = 0;
+	t = &fb_display[display_fg];
+	if (!vc->vc_font.data) {
+		vc->vc_font.data = p->fontdata = t->fontdata;
+		vc->vc_font.width = (*default_mode)->vc_font.width;
+		vc->vc_font.height = (*default_mode)->vc_font.height;
+		p->userfont = t->userfont;
+		if (p->userfont)
+			REFCOUNT(p->fontdata)++;
+		con_copy_unimap(vc->vc_num, display_fg);
+	}
+	if (p->userfont)
+		charcnt = FNTCHARCNT(p->fontdata);
+
+	vc->vc_can_do_color = info->var.bits_per_pixel != 1;
+	vc->vc_complement_mask = vc->vc_can_do_color ? 0x7700 : 0x0800;
+	if (charcnt == 256) {
+		vc->vc_hi_font_mask = 0;
+	} else {
+		vc->vc_hi_font_mask = 0x100;
+		if (vc->vc_can_do_color)
+			vc->vc_complement_mask <<= 1;
+	}
+	cols = info->var.xres / vc->vc_font.width;
+	rows = info->var.yres / vc->vc_font.height;
+	vc_resize(vc->vc_num, cols, rows);
+	if (CON_IS_VISIBLE(vc)) {
+		update_screen(vc->vc_num);
+		if (softback_buf) {
+			int l = fbcon_softback_size / vc->vc_size_row;
+
+			if (l > 5)
+				softback_end = softback_buf + l *
+					vc->vc_size_row;
+			else {
+				/* Smaller scrollback makes no sense, and 0
+				   would screw the operation totally */
+				softback_top = 0;
+			}
+		}
+	}
+	switch_screen(fg_console);
+}
+
 static __inline__ void ywrap_up(struct vc_data *vc, int count)
 {
 	struct fb_info *info = registered_fb[(int) con2fb_map[vc->vc_num]];
@@ -1041,6 +1227,31 @@ static __inline__ void ypan_up(struct vc_data *vc, int count)
 	scrollback_current = 0;
 }
 
+static __inline__ void ypan_up_redraw(struct vc_data *vc, int t, int count)
+{
+	struct fb_info *info = registered_fb[(int) con2fb_map[vc->vc_num]];
+	struct display *p = &fb_display[vc->vc_num];
+	int redraw = 0;
+
+	p->yscroll += count;
+	if (p->yscroll > p->vrows - vc->vc_rows) {
+		p->yscroll -= p->vrows - vc->vc_rows;
+		redraw = 1;
+	}
+
+	info->var.xoffset = 0;
+	info->var.yoffset = p->yscroll * vc->vc_font.height;
+	info->var.vmode &= ~FB_VMODE_YWRAP;
+	if (redraw)
+		fbcon_redraw_move(vc, p, t + count, vc->vc_rows - count, t);
+	update_var(vc->vc_num, info);
+	accel_clear_margins(vc, info, 1);
+	scrollback_max += count;
+	if (scrollback_max > scrollback_phys_max)
+		scrollback_max = scrollback_phys_max;
+	scrollback_current = 0;
+}
+
 static __inline__ void ypan_down(struct vc_data *vc, int count)
 {
 	struct fb_info *info = registered_fb[(int) con2fb_map[vc->vc_num]];
@@ -1063,6 +1274,30 @@ static __inline__ void ypan_down(struct vc_data *vc, int count)
 	scrollback_current = 0;
 }
 
+static __inline__ void ypan_down_redraw(struct vc_data *vc, int t, int count)
+{
+	struct fb_info *info = registered_fb[(int) con2fb_map[vc->vc_num]];
+	struct display *p = &fb_display[vc->vc_num];
+	int redraw = 0;
+
+	p->yscroll -= count;
+	if (p->yscroll < 0) {
+		p->yscroll += p->vrows - vc->vc_rows;
+		redraw = 1;
+	}
+	info->var.xoffset = 0;
+	info->var.yoffset = p->yscroll * vc->vc_font.height;
+	info->var.vmode &= ~FB_VMODE_YWRAP;
+	if (redraw)
+		fbcon_redraw_move(vc, p, t, vc->vc_rows - count, t + count);
+	update_var(vc->vc_num, info);
+	accel_clear_margins(vc, info, 1);
+	scrollback_max -= count;
+	if (scrollback_max < 0)
+		scrollback_max = 0;
+	scrollback_current = 0;
+}
+
 static void fbcon_redraw_softback(struct vc_data *vc, struct display *p,
 				  long delta)
 {
@@ -1158,6 +1393,42 @@ static void fbcon_redraw_softback(struct vc_data *vc, struct display *p,
 	}
 }
 
+static void fbcon_redraw_move(struct vc_data *vc, struct display *p,
+			      int line, int count, int dy)
+{
+	struct fb_info *info = registered_fb[(int) con2fb_map[vc->vc_num]];
+	unsigned short *s = (unsigned short *)
+		(vc->vc_origin + vc->vc_size_row * line);
+
+	while (count--) {
+		unsigned short *start = s;
+		unsigned short *le = advance_row(s, 1);
+		unsigned short c;
+		int x = 0;
+		unsigned short attr = 1;
+
+		do {
+			c = scr_readw(s);
+			if (attr != (c & 0xff00)) {
+				attr = c & 0xff00;
+				if (s > start) {
+					accel_putcs(vc, info, start, s - start,
+						    real_y(p, dy), x);
+					x += s - start;
+					start = s;
+				}
+			}
+			console_conditional_schedule();
+			s++;
+		} while (s < le);
+		if (s > start)
+			accel_putcs(vc, info, start, s - start,
+				    real_y(p, dy), x);
+		console_conditional_schedule();
+		dy++;
+	}
+}
+
 static void fbcon_redraw(struct vc_data *vc, struct display *p,
 			 int line, int count, int offset)
 {
@@ -1245,7 +1516,7 @@ static int fbcon_scroll(struct vc_data *vc, int t, int b, int dir,
 {
 	struct fb_info *info = registered_fb[(int) con2fb_map[vc->vc_num]];
 	struct display *p = &fb_display[vc->vc_num];
-	int scroll_partial = !(p->scrollmode & __SCROLL_YNOPARTIAL);
+	int scroll_partial = info->flags & FBINFO_PARTIAL_PAN_OK;
 
 	if (!info->fbops->fb_blank && console_blanked)
 		return 0;
@@ -1269,15 +1540,15 @@ static int fbcon_scroll(struct vc_data *vc, int t, int b, int dir,
 			fbcon_softback_note(vc, t, count);
 		if (logo_shown >= 0)
 			goto redraw_up;
-		switch (p->scrollmode & __SCROLL_YMASK) {
-		case __SCROLL_YMOVE:
+		switch (p->scrollmode) {
+		case SCROLL_MOVE:
 			accel_bmove(vc, info, t + count, 0, t, 0,
 					 b - t - count, vc->vc_cols);
 			accel_clear(vc, info, b - count, 0, count,
 					 vc->vc_cols);
 			break;
 
-		case __SCROLL_YWRAP:
+		case SCROLL_WRAP_MOVE:
 			if (b - t - count > 3 * vc->vc_rows >> 2) {
 				if (t > 0)
 					fbcon_bmove(vc, 0, 0, count, 0, t,
@@ -1287,15 +1558,33 @@ static int fbcon_scroll(struct vc_data *vc, int t, int b, int dir,
 					fbcon_bmove(vc, b - count, 0, b, 0,
 						    vc->vc_rows - b,
 						    vc->vc_cols);
-			} else if (p->scrollmode & __SCROLL_YPANREDRAW)
-				goto redraw_up;
-			else
+			} else if (info->flags & FBINFO_READS_FAST)
 				fbcon_bmove(vc, t + count, 0, t, 0,
 					    b - t - count, vc->vc_cols);
+			else
+				goto redraw_up;
 			fbcon_clear(vc, b - count, 0, count, vc->vc_cols);
 			break;
 
-		case __SCROLL_YPAN:
+		case SCROLL_PAN_REDRAW:
+			if ((p->yscroll + count <=
+			     2 * (p->vrows - vc->vc_rows))
+			    && ((!scroll_partial && (b - t == vc->vc_rows))
+				|| (scroll_partial
+				    && (b - t - count >
+					3 * vc->vc_rows >> 2)))) {
+				if (t > 0)
+					fbcon_redraw_move(vc, p, 0, t, count);
+				ypan_up_redraw(vc, t, count);
+				if (vc->vc_rows - b > 0)
+					fbcon_redraw_move(vc, p, b - count,
+							  vc->vc_rows - b, b);
+			} else
+				fbcon_redraw_move(vc, p, t + count, b - t - count, t);
+			fbcon_clear(vc, b - count, 0, count, vc->vc_cols);
+			break;
+
+		case SCROLL_PAN_MOVE:
 			if ((p->yscroll + count <=
 			     2 * (p->vrows - vc->vc_rows))
 			    && ((!scroll_partial && (b - t == vc->vc_rows))
@@ -1310,15 +1599,15 @@ static int fbcon_scroll(struct vc_data *vc, int t, int b, int dir,
 					fbcon_bmove(vc, b - count, 0, b, 0,
 						    vc->vc_rows - b,
 						    vc->vc_cols);
-			} else if (p->scrollmode & __SCROLL_YPANREDRAW)
-				goto redraw_up;
-			else
+			} else if (info->flags & FBINFO_READS_FAST)
 				fbcon_bmove(vc, t + count, 0, t, 0,
 					    b - t - count, vc->vc_cols);
+			else
+				goto redraw_up;
 			fbcon_clear(vc, b - count, 0, count, vc->vc_cols);
 			break;
 
-		case __SCROLL_YREDRAW:
+		case SCROLL_REDRAW:
 		      redraw_up:
 			fbcon_redraw(vc, p, t, b - t - count,
 				     count * vc->vc_cols);
@@ -1336,14 +1625,14 @@ static int fbcon_scroll(struct vc_data *vc, int t, int b, int dir,
 	case SM_DOWN:
 		if (count > vc->vc_rows)	/* Maximum realistic size */
 			count = vc->vc_rows;
-		switch (p->scrollmode & __SCROLL_YMASK) {
-		case __SCROLL_YMOVE:
+		switch (p->scrollmode) {
+		case SCROLL_MOVE:
 			accel_bmove(vc, info, t, 0, t + count, 0,
 					 b - t - count, vc->vc_cols);
 			accel_clear(vc, info, t, 0, count, vc->vc_cols);
 			break;
 
-		case __SCROLL_YWRAP:
+		case SCROLL_WRAP_MOVE:
 			if (b - t - count > 3 * vc->vc_rows >> 2) {
 				if (vc->vc_rows - b > 0)
 					fbcon_bmove(vc, b, 0, b - count, 0,
@@ -1353,15 +1642,15 @@ static int fbcon_scroll(struct vc_data *vc, int t, int b, int dir,
 				if (t > 0)
 					fbcon_bmove(vc, count, 0, 0, 0, t,
 						    vc->vc_cols);
-			} else if (p->scrollmode & __SCROLL_YPANREDRAW)
-				goto redraw_down;
-			else
+			} else if (info->flags & FBINFO_READS_FAST)
 				fbcon_bmove(vc, t, 0, t + count, 0,
 					    b - t - count, vc->vc_cols);
+			else
+				goto redraw_down;
 			fbcon_clear(vc, t, 0, count, vc->vc_cols);
 			break;
 
-		case __SCROLL_YPAN:
+		case SCROLL_PAN_MOVE:
 			if ((count - p->yscroll <= p->vrows - vc->vc_rows)
 			    && ((!scroll_partial && (b - t == vc->vc_rows))
 				|| (scroll_partial
@@ -1375,15 +1664,32 @@ static int fbcon_scroll(struct vc_data *vc, int t, int b, int dir,
 				if (t > 0)
 					fbcon_bmove(vc, count, 0, 0, 0, t,
 						    vc->vc_cols);
-			} else if (p->scrollmode & __SCROLL_YPANREDRAW)
-				goto redraw_down;
-			else
+			} else if (info->flags & FBINFO_READS_FAST)
 				fbcon_bmove(vc, t, 0, t + count, 0,
 					    b - t - count, vc->vc_cols);
+			else
+				goto redraw_down;
 			fbcon_clear(vc, t, 0, count, vc->vc_cols);
 			break;
 
-		case __SCROLL_YREDRAW:
+		case SCROLL_PAN_REDRAW:
+			if ((count - p->yscroll <= p->vrows - vc->vc_rows)
+			    && ((!scroll_partial && (b - t == vc->vc_rows))
+				|| (scroll_partial
+				    && (b - t - count >
+					3 * vc->vc_rows >> 2)))) {
+				if (vc->vc_rows - b > 0)
+					fbcon_redraw_move(vc, p, b, vc->vc_rows - b,
+							  b - count);
+				ypan_down_redraw(vc, t, count);
+				if (t > 0)
+					fbcon_redraw_move(vc, p, count, t, 0);
+			} else
+				fbcon_redraw_move(vc, p, t, b - t - count, t + count);
+			fbcon_clear(vc, t, 0, count, vc->vc_cols);
+			break;
+
+		case SCROLL_REDRAW:
 		      redraw_down:
 			fbcon_redraw(vc, p, b - 1, b - t - count,
 				     -count * vc->vc_cols);
@@ -1465,23 +1771,40 @@ static void fbcon_bmove_rec(struct vc_data *vc, struct display *p, int sy, int s
 			height, width);
 }
 
-static __inline__ void updatescrollmode(struct display *p, struct fb_info *info, struct vc_data *vc)
+static __inline__ void updatescrollmode(struct display *p, struct fb_info *info,
+					struct vc_data *vc)
 {
-	int m;
+	int fh = vc->vc_font.height;
+	int cap = info->flags;
+	int good_pan = (cap & FBINFO_HWACCEL_YPAN)
+		 && divides(info->fix.ypanstep, vc->vc_font.height)
+		 && info->var.yres_virtual > info->var.yres;
+	int good_wrap = (cap & FBINFO_HWACCEL_YWRAP)
+		 && divides(info->fix.ywrapstep, vc->vc_font.height)
+		 && divides(vc->vc_font.height, info->var.yres_virtual);
+	int reading_fast = cap & FBINFO_READS_FAST;
+	int fast_copyarea = (cap & FBINFO_HWACCEL_COPYAREA) && !(cap & FBINFO_HWACCEL_DISABLED);
+	int fast_imageblit = (cap & FBINFO_HWACCEL_IMAGEBLIT) && !(cap & FBINFO_HWACCEL_DISABLED);
+
+	p->vrows = info->var.yres_virtual/fh;
+	if (info->var.yres > (fh * (vc->vc_rows + 1)))
+		p->vrows -= (info->var.yres - (fh * vc->vc_rows)) / fh;
+	if ((info->var.yres % fh) && (info->var.yres_virtual % fh <
+				      info->var.yres % fh))
+		p->vrows--;
 
-	if (p->scrollmode & __SCROLL_YFIXED)
-		return;
-	if (divides(info->fix.ywrapstep, vc->vc_font.height) &&
-	    divides(vc->vc_font.height, info->var.yres_virtual))
-		m = __SCROLL_YWRAP;
-	else if (divides(info->fix.ypanstep, vc->vc_font.height) &&
-		 info->var.yres_virtual >= info->var.yres + vc->vc_font.height)
-		m = __SCROLL_YPAN;
-	else if (p->scrollmode & __SCROLL_YNOMOVE)
-		m = __SCROLL_YREDRAW;
-	else
-		m = __SCROLL_YMOVE;
-	p->scrollmode = (p->scrollmode & ~__SCROLL_YMASK) | m;
+	if (good_wrap || good_pan) {
+		if (reading_fast || fast_copyarea)
+			p->scrollmode = good_wrap ? SCROLL_WRAP_MOVE : SCROLL_PAN_MOVE;
+		else
+			p->scrollmode = good_wrap ? SCROLL_REDRAW :
+				SCROLL_PAN_REDRAW;
+	} else {
+		if (reading_fast || (fast_copyarea && !fast_imageblit))
+			p->scrollmode = SCROLL_MOVE;
+		else
+			p->scrollmode = SCROLL_REDRAW;
+	}
 }
 
 static int fbcon_resize(struct vc_data *vc, unsigned int width, 
@@ -1502,25 +1825,20 @@ static int fbcon_resize(struct vc_data *vc, unsigned int width,
 		char mode[40];
 
 		DPRINTK("attempting resize %ix%i\n", var.xres, var.yres);
-		if (!info->fbops->fb_set_par)
-			return -EINVAL;
-
-		sprintf(mode, "%dx%d", var.xres, var.yres);
-		err = fb_find_mode(&var, info, mode, NULL, 0, NULL,
-					info->var.bits_per_pixel);
+		snprintf(mode, 40, "%ix%i", var.xres, var.yres);
+		err = fb_find_mode(&var, info, mode, info->monspecs.modedb,
+				   info->monspecs.modedb_len, NULL,
+				   info->var.bits_per_pixel);
 		if (!err || width > var.xres/fw || height > var.yres/fh)
 			return -EINVAL;
 		DPRINTK("resize now %ix%i\n", var.xres, var.yres);
 		if (CON_IS_VISIBLE(vc)) {
-			var.activate = FB_ACTIVATE_NOW;
+			var.activate = FB_ACTIVATE_NOW |
+				FB_ACTIVATE_FORCE;
 			fb_set_var(info, &var);
+			info->flags &= ~FBINFO_MISC_MODESWITCH;
 		}
 	}
-	p->vrows = var.yres_virtual/fh;
-	if (var.yres > (fh * (height + 1)))
-		p->vrows -= (var.yres - (fh * height)) / fh;
-	if ((var.yres % fh) && (var.yres_virtual % fh < var.yres % fh))
-		p->vrows--;
 	updatescrollmode(p, info, vc);
 	return 0;
 }
@@ -1529,6 +1847,7 @@ static int fbcon_switch(struct vc_data *vc)
 {
 	struct fb_info *info = registered_fb[(int) con2fb_map[vc->vc_num]];
 	struct display *p = &fb_display[vc->vc_num];
+	int i;
 
 	if (softback_top) {
 		int l = fbcon_softback_size / vc->vc_size_row;
@@ -1555,12 +1874,34 @@ static int fbcon_switch(struct vc_data *vc)
 	}
 	if (info)
 		info->var.yoffset = p->yscroll = 0;
-        fbcon_resize(vc, vc->vc_cols, vc->vc_rows);
-	switch (p->scrollmode & __SCROLL_YMASK) {
-	case __SCROLL_YWRAP:
+
+	/*
+	 * FIXME: If we have multiple fbdev's loaded, we need to
+	 * update all info->currcon.  Perhaps, we can place this
+	 * in a centralized structure, but this might break some
+	 * drivers.
+	 *
+	 * info->currcon = vc->vc_num;
+	 */
+	for (i = 0; i < FB_MAX; i++) {
+		if (registered_fb[i] != NULL)
+			registered_fb[i]->currcon = vc->vc_num;
+	}
+
+ 	fbcon_resize(vc, vc->vc_cols, vc->vc_rows);
+
+	if (info->flags & FBINFO_MISC_MODESWITCH) {
+		if (info->fbops->fb_set_par)
+			info->fbops->fb_set_par(info);
+		info->flags &= ~FBINFO_MISC_MODESWITCH;
+	}
+
+	switch (p->scrollmode) {
+	case SCROLL_WRAP_MOVE:
 		scrollback_phys_max = p->vrows - vc->vc_rows;
 		break;
-	case __SCROLL_YPAN:
+	case SCROLL_PAN_MOVE:
+	case SCROLL_PAN_REDRAW:
 		scrollback_phys_max = p->vrows - 2 * vc->vc_rows;
 		if (scrollback_phys_max < 0)
 			scrollback_phys_max = 0;
@@ -1572,8 +1913,6 @@ static int fbcon_switch(struct vc_data *vc)
 	scrollback_max = 0;
 	scrollback_current = 0;
 
-	info->currcon = vc->vc_num;
-	
 	update_var(vc->vc_num, info);
 	fbcon_set_palette(vc, color_table); 	
 
@@ -1599,15 +1938,29 @@ static int fbcon_blank(struct vc_data *vc, int blank, int mode_switch)
 	struct display *p = &fb_display[vc->vc_num];
 
 	if (mode_switch) {
-		struct fb_info *info = registered_fb[(int) con2fb_map[vc->vc_num]];
 		struct fb_var_screeninfo var = info->var;
 
+/*
+ * HACK ALERT: Some hardware will require reinitializion at this stage,
+ *             others will require it to be done as late as possible.
+ *             For now, we differentiate this with the
+ *             FBINFO_MISC_MODESWITCHLATE bitflag.  Worst case will be
+ *             hardware that requires it here and another one later.
+ *             A definitive solution may require fixing X or the VT
+ *             system.
+ */
+		if (info->flags & FBINFO_MISC_MODESWITCHLATE)
+			info->flags |= FBINFO_MISC_MODESWITCH;
+
 		if (blank) {
 			fbcon_cursor(vc, CM_ERASE);
 			return 0;
 		}
-		var.activate = FB_ACTIVATE_NOW | FB_ACTIVATE_FORCE;
-		fb_set_var(info, &var);
+
+		if (!(info->flags & FBINFO_MISC_MODESWITCHLATE)) {
+			var.activate = FB_ACTIVATE_NOW | FB_ACTIVATE_FORCE;
+			fb_set_var(info, &var);
+		}
 	}
 
 	fbcon_cursor(vc, blank ? CM_ERASE : CM_DRAW);
@@ -1647,36 +2000,36 @@ static void fbcon_free_font(struct display *p)
 	p->userfont = 0;
 }
 
-static inline int fbcon_get_font(struct vc_data *vc, struct console_font_op *op)
+static int fbcon_get_font(struct vc_data *vc, struct console_font *font)
 {
 	u8 *fontdata = vc->vc_font.data;
-	u8 *data = op->data;
+	u8 *data = font->data;
 	int i, j;
 
-	op->width = vc->vc_font.width;
-	op->height = vc->vc_font.height;
-	op->charcount = vc->vc_hi_font_mask ? 512 : 256;
-	if (!op->data)
+	font->width = vc->vc_font.width;
+	font->height = vc->vc_font.height;
+	font->charcount = vc->vc_hi_font_mask ? 512 : 256;
+	if (!font->data)
 		return 0;
 
-	if (op->width <= 8) {
+	if (font->width <= 8) {
 		j = vc->vc_font.height;
-		for (i = 0; i < op->charcount; i++) {
+		for (i = 0; i < font->charcount; i++) {
 			memcpy(data, fontdata, j);
 			memset(data + j, 0, 32 - j);
 			data += 32;
 			fontdata += j;
 		}
-	} else if (op->width <= 16) {
+	} else if (font->width <= 16) {
 		j = vc->vc_font.height * 2;
-		for (i = 0; i < op->charcount; i++) {
+		for (i = 0; i < font->charcount; i++) {
 			memcpy(data, fontdata, j);
 			memset(data + j, 0, 64 - j);
 			data += 64;
 			fontdata += j;
 		}
-	} else if (op->width <= 24) {
-		for (i = 0; i < op->charcount; i++) {
+	} else if (font->width <= 24) {
+		for (i = 0; i < font->charcount; i++) {
 			for (j = 0; j < vc->vc_font.height; j++) {
 				*data++ = fontdata[0];
 				*data++ = fontdata[1];
@@ -1688,7 +2041,7 @@ static inline int fbcon_get_font(struct vc_data *vc, struct console_font_op *op)
 		}
 	} else {
 		j = vc->vc_font.height * 4;
-		for (i = 0; i < op->charcount; i++) {
+		for (i = 0; i < font->charcount; i++) {
 			memcpy(data, fontdata, j);
 			memset(data + j, 0, 128 - j);
 			data += 128;
@@ -1698,23 +2051,15 @@ static inline int fbcon_get_font(struct vc_data *vc, struct console_font_op *op)
 	return 0;
 }
 
-static int fbcon_do_set_font(struct vc_data *vc, struct console_font_op *op,
+static int fbcon_do_set_font(struct vc_data *vc, int w, int h,
 			     u8 * data, int userfont)
 {
 	struct fb_info *info = registered_fb[(int) con2fb_map[vc->vc_num]];
 	struct display *p = &fb_display[vc->vc_num];
 	int resize;
-	int w = op->width;
-	int h = op->height;
 	int cnt;
 	char *old_data = NULL;
 
-	if (!w > 32) {
-		if (userfont && op->op != KD_FONT_OP_COPY)
-			kfree(data - FONT_EXTRA_WORDS * sizeof(int));
-		return -ENXIO;
-	}
-
 	if (CON_IS_VISIBLE(vc) && softback_lines)
 		fbcon_set_origin(vc);
 
@@ -1814,33 +2159,32 @@ static int fbcon_do_set_font(struct vc_data *vc, struct console_font_op *op,
 	return 0;
 }
 
-static inline int fbcon_copy_font(struct vc_data *vc, struct console_font_op *op)
+static int fbcon_copy_font(struct vc_data *vc, int con)
 {
-	struct display *od;
-	int h = op->height;
-
-	if (h < 0 || !vc_cons_allocated(h))
-		return -ENOTTY;
-	if (h == vc->vc_num)
-		return 0;	/* nothing to do */
-	od = &fb_display[h];
-	if (od->fontdata == vc->vc_font.data)
+	struct display *od = &fb_display[con];
+	struct console_font *f = &vc->vc_font;
+
+	if (od->fontdata == f->data)
 		return 0;	/* already the same font... */
-	op->width = vc->vc_font.width;
-	op->height = vc->vc_font.height;
-	return fbcon_do_set_font(vc, op, od->fontdata, od->userfont);
+	return fbcon_do_set_font(vc, f->width, f->height, od->fontdata, od->userfont);
 }
 
-static inline int fbcon_set_font(struct vc_data *vc, struct console_font_op *op)
+/*
+ *  User asked to set font; we are guaranteed that
+ *	a) width and height are in range 1..32
+ *	b) charcount does not exceed 512
+ */
+
+static int fbcon_set_font(struct vc_data *vc, struct console_font *font, unsigned flags)
 {
-	int w = op->width;
-	int h = op->height;
+	unsigned charcount = font->charcount;
+	int w = font->width;
+	int h = font->height;
 	int size = h;
 	int i, k;
-	u8 *new_data, *data = op->data, *p;
+	u8 *new_data, *data = font->data, *p;
 
-	if ((w <= 0) || (w > 32)
-	    || (op->charcount != 256 && op->charcount != 512))
+	if (charcount != 256 && charcount != 512)
 		return -EINVAL;
 
 	if (w > 8) {
@@ -1849,32 +2193,33 @@ static inline int fbcon_set_font(struct vc_data *vc, struct console_font_op *op)
 		else
 			size *= 4;
 	}
-	size *= op->charcount;
+	size *= charcount;
+
+	new_data = kmalloc(FONT_EXTRA_WORDS * sizeof(int) + size, GFP_USER);
 
-	if (!
-	    (new_data =
-	     kmalloc(FONT_EXTRA_WORDS * sizeof(int) + size, GFP_USER)))
+	if (!new_data)
 		return -ENOMEM;
+
 	new_data += FONT_EXTRA_WORDS * sizeof(int);
 	FNTSIZE(new_data) = size;
-	FNTCHARCNT(new_data) = op->charcount;
+	FNTCHARCNT(new_data) = charcount;
 	REFCOUNT(new_data) = 0;	/* usage counter */
 	p = new_data;
 	if (w <= 8) {
-		for (i = 0; i < op->charcount; i++) {
+		for (i = 0; i < charcount; i++) {
 			memcpy(p, data, h);
 			data += 32;
 			p += h;
 		}
 	} else if (w <= 16) {
 		h *= 2;
-		for (i = 0; i < op->charcount; i++) {
+		for (i = 0; i < charcount; i++) {
 			memcpy(p, data, h);
 			data += 64;
 			p += h;
 		}
 	} else if (w <= 24) {
-		for (i = 0; i < op->charcount; i++) {
+		for (i = 0; i < charcount; i++) {
 			int j;
 			for (j = 0; j < h; j++) {
 				memcpy(p, data, 3);
@@ -1886,7 +2231,7 @@ static inline int fbcon_set_font(struct vc_data *vc, struct console_font_op *op)
 		}
 	} else {
 		h *= 4;
-		for (i = 0; i < op->charcount; i++) {
+		for (i = 0; i < charcount; i++) {
 			memcpy(p, data, h);
 			data += 128;
 			p += h;
@@ -1916,43 +2261,22 @@ static inline int fbcon_set_font(struct vc_data *vc, struct console_font_op *op)
 			break;
 		}
 	}
-	return fbcon_do_set_font(vc, op, new_data, 1);
+	return fbcon_do_set_font(vc, font->width, font->height, new_data, 1);
 }
 
-static inline int fbcon_set_def_font(struct vc_data *vc, struct console_font_op *op)
+static int fbcon_set_def_font(struct vc_data *vc, struct console_font *font, char *name)
 {
 	struct fb_info *info = registered_fb[(int) con2fb_map[vc->vc_num]];
-	char name[MAX_FONT_NAME];
 	struct font_desc *f;
 
-	if (!op->data)
+	if (!name)
 		f = get_default_font(info->var.xres, info->var.yres);
-	else if (strncpy_from_user(name, op->data, MAX_FONT_NAME - 1) < 0)
-		return -EFAULT;
-	else {
-		name[MAX_FONT_NAME - 1] = 0;
-		if (!(f = find_font(name)))
-			return -ENOENT;
-	}
-	op->width = f->width;
-	op->height = f->height;
-	return fbcon_do_set_font(vc, op, f->data, 0);
-}
+	else if (!(f = find_font(name)))
+		return -ENOENT;
 
-static int fbcon_font_op(struct vc_data *vc, struct console_font_op *op)
-{
-	switch (op->op) {
-	case KD_FONT_OP_SET:
-		return fbcon_set_font(vc, op);
-	case KD_FONT_OP_GET:
-		return fbcon_get_font(vc, op);
-	case KD_FONT_OP_SET_DEFAULT:
-		return fbcon_set_def_font(vc, op);
-	case KD_FONT_OP_COPY:
-		return fbcon_copy_font(vc, op);
-	default:
-		return -ENOSYS;
-	}
+	font->width = f->width;
+	font->height = f->height;
+	return fbcon_do_set_font(vc, f->width, f->height, f->data, 0);
 }
 
 static u16 palette_red[16];
@@ -1986,7 +2310,7 @@ static int fbcon_set_palette(struct vc_data *vc, unsigned char *table)
 	else
 		palette_cmap.len = 16;
 	palette_cmap.start = 0;
-	return fb_set_cmap(&palette_cmap, 1, info);
+	return fb_set_cmap(&palette_cmap, info);
 }
 
 static u16 *fbcon_screen_pos(struct vc_data *vc, int offset)
@@ -2133,11 +2457,12 @@ static int fbcon_scrolldelta(struct vc_data *vc, int lines)
 
 	offset = p->yscroll - scrollback_current;
 	limit = p->vrows;
-	switch (p->scrollmode && __SCROLL_YMASK) {
-	case __SCROLL_YWRAP:
+	switch (p->scrollmode) {
+	case SCROLL_WRAP_MOVE:
 		info->var.vmode |= FB_VMODE_YWRAP;
 		break;
-	case __SCROLL_YPAN:
+	case SCROLL_PAN_MOVE:
+	case SCROLL_PAN_REDRAW:
 		limit -= vc->vc_rows;
 		info->var.vmode &= ~FB_VMODE_YWRAP;
 		break;
@@ -2178,6 +2503,45 @@ static void fbcon_resumed(struct fb_info *info)
 
 	update_screen(vc->vc_num);
 }
+
+static void fbcon_modechanged(struct fb_info *info)
+{
+	struct vc_data *vc = vc_cons[info->currcon].d;
+	struct display *p;
+	int rows, cols;
+
+	if (info->currcon < 0 || vt_cons[info->currcon]->vc_mode !=
+	    KD_TEXT)
+		return;
+	p = &fb_display[vc->vc_num];
+
+	info->var.xoffset = info->var.yoffset = p->yscroll = 0;
+	vc->vc_can_do_color = info->var.bits_per_pixel != 1;
+	vc->vc_complement_mask = vc->vc_can_do_color ? 0x7700 : 0x0800;
+
+	if (CON_IS_VISIBLE(vc)) {
+		cols = info->var.xres / vc->vc_font.width;
+		rows = info->var.yres / vc->vc_font.height;
+		vc_resize(vc->vc_num, cols, rows);
+		updatescrollmode(p, info, vc);
+		scrollback_max = 0;
+		scrollback_current = 0;
+		update_var(vc->vc_num, info);
+		fbcon_set_palette(vc, color_table);
+		update_screen(vc->vc_num);
+		if (softback_buf) {
+			int l = fbcon_softback_size / vc->vc_size_row;
+			if (l > 5)
+				softback_end = softback_buf + l * vc->vc_size_row;
+			else {
+				/* Smaller scrollback makes no sense, and 0
+				   would screw the operation totally */
+				softback_top = 0;
+			}
+		}
+	}
+}
+
 static int fbcon_event_notify(struct notifier_block *self, 
 			      unsigned long action, void *data)
 {
@@ -2190,7 +2554,11 @@ static int fbcon_event_notify(struct notifier_block *self,
 	case FB_EVENT_RESUME:
 		fbcon_resumed(info);
 		break;
+	case FB_EVENT_MODE_CHANGE:
+		fbcon_modechanged(info);
+		break;
 	}
+
 	return 0;
 }
 
@@ -2211,7 +2579,10 @@ const struct consw fb_con = {
 	.con_bmove 		= fbcon_bmove,
 	.con_switch 		= fbcon_switch,
 	.con_blank 		= fbcon_blank,
-	.con_font_op 		= fbcon_font_op,
+	.con_font_set 		= fbcon_set_font,
+	.con_font_get 		= fbcon_get_font,
+	.con_font_default	= fbcon_set_def_font,
+	.con_font_copy 		= fbcon_copy_font,
 	.con_set_palette 	= fbcon_set_palette,
 	.con_scrolldelta 	= fbcon_scrolldelta,
 	.con_set_origin 	= fbcon_set_origin,
@@ -2221,27 +2592,43 @@ const struct consw fb_con = {
 	.con_resize             = fbcon_resize,
 };
 
-static struct notifier_block fbcon_event_notifer = {
+static struct notifier_block fbcon_event_notifier = {
 	.notifier_call	= fbcon_event_notify,
 };
-
 static int fbcon_event_notifier_registered;
 
-int __init fb_console_init(void)
+/* can't be __init as it can be called by set_con2fb_map() later */
+int fb_console_init(void)
 {
-	int err;
+	int err, i;
+
+	for (i = 0; i < MAX_NR_CONSOLES; i++)
+		con2fb_map[i] = -1;
 
 	if (!num_registered_fb)
 		return -ENODEV;
 
+	if (info_idx == -1) {
+		for (i = 0; i < FB_MAX; i++) {
+			if (registered_fb[i] != NULL) {
+				info_idx = i;
+				break;
+			}
+		}
+	}
+	for (i = first_fb_vc; i <= last_fb_vc; i++)
+		con2fb_map[i] = info_idx;
 	err = take_over_console(&fb_con, first_fb_vc, last_fb_vc,
 				fbcon_is_default);
-	if (err)
+	if (err) {
+		for (i = first_fb_vc; i <= last_fb_vc; i++) {
+			con2fb_map[i] = -1;
+		}
 		return err;
-
+	}
 	acquire_console_sem();
 	if (!fbcon_event_notifier_registered) {
-		fb_register_client(&fbcon_event_notifer);
+		fb_register_client(&fbcon_event_notifier);
 		fbcon_event_notifier_registered = 1;
 	} 
 	release_console_sem();
@@ -2254,7 +2641,7 @@ void __exit fb_console_exit(void)
 {
 	acquire_console_sem();
 	if (fbcon_event_notifier_registered) {
-		fb_unregister_client(&fbcon_event_notifer);
+		fb_unregister_client(&fbcon_event_notifier);
 		fbcon_event_notifier_registered = 0;
 	}
 	release_console_sem();
diff --git a/drivers/video/console/fbcon.h b/drivers/video/console/fbcon.h
index a9d036b0a..71643f5ad 100644
--- a/drivers/video/console/fbcon.h
+++ b/drivers/video/console/fbcon.h
@@ -36,7 +36,7 @@ struct display {
 };
 
 /* drivers/video/console/fbcon.c */
-extern char con2fb_map[MAX_NR_CONSOLES];
+extern signed char con2fb_map[MAX_NR_CONSOLES];
 extern int set_con2fb_map(int unit, int newidx);
 
     /*
@@ -67,40 +67,57 @@ extern int set_con2fb_map(int unit, int newidx);
      *  Scroll Method
      */
      
-/* Internal flags */
-#define __SCROLL_YPAN		0x001
-#define __SCROLL_YWRAP		0x002
-#define __SCROLL_YMOVE		0x003
-#define __SCROLL_YREDRAW	0x004
-#define __SCROLL_YMASK		0x00f
-#define __SCROLL_YFIXED		0x010
-#define __SCROLL_YNOMOVE	0x020
-#define __SCROLL_YPANREDRAW	0x040
-#define __SCROLL_YNOPARTIAL	0x080
-
-/* Only these should be used by the drivers */
-/* Which one should you use? If you have a fast card and slow bus,
-   then probably just 0 to indicate fbcon should choose between
-   YWRAP/YPAN+MOVE/YMOVE. On the other side, if you have a fast bus
-   and even better if your card can do fonting (1->8/32bit painting),
-   you should consider either SCROLL_YREDRAW (if your card is
-   able to do neither YPAN/YWRAP), or SCROLL_YNOMOVE.
-   The best is to test it with some real life scrolling (usually, not
-   all lines on the screen are filled completely with non-space characters,
-   and REDRAW performs much better on such lines, so don't cat a file
-   with every line covering all screen columns, it would not be the right
-   benchmark).
+/* There are several methods fbcon can use to move text around the screen:
+ *
+ *                     Operation   Pan    Wrap
+ *---------------------------------------------
+ * SCROLL_MOVE         copyarea    No     No
+ * SCROLL_PAN_MOVE     copyarea    Yes    No
+ * SCROLL_WRAP_MOVE    copyarea    No     Yes
+ * SCROLL_REDRAW       imageblit   No     No
+ * SCROLL_PAN_REDRAW   imageblit   Yes    No
+ * SCROLL_WRAP_REDRAW  imageblit   No     Yes
+ *
+ * (SCROLL_WRAP_REDRAW is not implemented yet)
+ *
+ * In general, fbcon will choose the best scrolling
+ * method based on the rule below:
+ *
+ * Pan/Wrap > accel imageblit > accel copyarea >
+ * soft imageblit > (soft copyarea)
+ *
+ * Exception to the rule: Pan + accel copyarea is
+ * preferred over Pan + accel imageblit.
+ *
+ * The above is typical for PCI/AGP cards. Unless
+ * overridden, fbcon will never use soft copyarea.
+ *
+ * If you need to override the above rule, set the
+ * appropriate flags in fb_info->flags.  For example,
+ * to prefer copyarea over imageblit, set
+ * FBINFO_READS_FAST.
+ *
+ * Other notes:
+ * + use the hardware engine to move the text
+ *    (hw-accelerated copyarea() and fillrect())
+ * + use hardware-supported panning on a large virtual screen
+ * + amifb can not only pan, but also wrap the display by N lines
+ *    (i.e. visible line i = physical line (i+N) % yres).
+ * + read what's already rendered on the screen and
+ *     write it in a different place (this is cfb_copyarea())
+ * + re-render the text to the screen
+ *
+ * Whether to use wrapping or panning can only be figured out at
+ * runtime (when we know whether our font height is a multiple
+ * of the pan/wrap step)
+ *
  */
-#define SCROLL_YREDRAW		(__SCROLL_YFIXED|__SCROLL_YREDRAW)
-#define SCROLL_YNOMOVE		(__SCROLL_YNOMOVE|__SCROLL_YPANREDRAW)
 
-/* SCROLL_YNOPARTIAL, used in combination with the above, is for video
-   cards which can not handle using panning to scroll a portion of the
-   screen without excessive flicker.  Panning will only be used for
-   whole screens.
- */
-/* Namespace consistency */
-#define SCROLL_YNOPARTIAL	__SCROLL_YNOPARTIAL
+#define SCROLL_MOVE	   0x001
+#define SCROLL_PAN_MOVE	   0x002
+#define SCROLL_WRAP_MOVE   0x003
+#define SCROLL_REDRAW	   0x004
+#define SCROLL_PAN_REDRAW  0x005
 
 extern int fb_console_init(void);
 
diff --git a/drivers/video/console/mdacon.c b/drivers/video/console/mdacon.c
index 8f7f3a7d4..6dbeb1894 100644
--- a/drivers/video/console/mdacon.c
+++ b/drivers/video/console/mdacon.c
@@ -517,11 +517,6 @@ static int mdacon_blank(struct vc_data *c, int blank, int mode_switch)
 	}
 }
 
-static int mdacon_font_op(struct vc_data *c, struct console_font_op *op)
-{
-	return -ENOSYS;
-}
-
 static int mdacon_scrolldelta(struct vc_data *c, int lines)
 {
 	return 0;
@@ -594,7 +589,6 @@ const struct consw mda_con = {
 	.con_bmove =		mdacon_bmove,
 	.con_switch =		mdacon_switch,
 	.con_blank =		mdacon_blank,
-	.con_font_op =		mdacon_font_op,
 	.con_set_palette =	mdacon_set_palette,
 	.con_scrolldelta =	mdacon_scrolldelta,
 	.con_build_attr =	mdacon_build_attr,
diff --git a/drivers/video/console/newport_con.c b/drivers/video/console/newport_con.c
index 5e4fdc08e..b30ae70cb 100644
--- a/drivers/video/console/newport_con.c
+++ b/drivers/video/console/newport_con.c
@@ -52,7 +52,7 @@ static int xcurs_correction = 29;
 static int newport_xsize;
 static int newport_ysize;
 
-static int newport_set_def_font(int unit, struct console_font_op *op);
+static int newport_set_def_font(int unit, struct console_font *op);
 
 #define BMASK(c) (c << 24)
 
@@ -477,7 +477,7 @@ static int newport_blank(struct vc_data *c, int blank)
 	return 1;
 }
 
-static int newport_set_font(int unit, struct console_font_op *op)
+static int newport_set_font(int unit, struct console_font *op)
 {
 	int w = op->width;
 	int h = op->height;
@@ -531,7 +531,7 @@ static int newport_set_font(int unit, struct console_font_op *op)
 	return 0;
 }
 
-static int newport_set_def_font(int unit, struct console_font_op *op)
+static int newport_set_def_font(int unit, struct console_font *op)
 {
 	if (font_data[unit] != FONT_DATA) {
 		if (--REFCOUNT(font_data[unit]) == 0)
@@ -543,18 +543,14 @@ static int newport_set_def_font(int unit, struct console_font_op *op)
 	return 0;
 }
 
-static int newport_font_op(struct vc_data *vc, struct console_font_op *op)
+static int newport_font_default(struct vc_data *vc, struct console_font *op, char *name)
 {
-	int unit = vc->vc_num;
-
-	switch (op->op) {
-	case KD_FONT_OP_SET:
-		return newport_set_font(unit, op);
-	case KD_FONT_OP_SET_DEFAULT:
-		return newport_set_def_font(unit, op);
-	default:
-		return -ENOSYS;
-	}
+	return newport_set_def_font(vc->vc_num, op);
+}
+
+static int newport_font_set(struct vc_data *vc, struct console_font *font, unsigned flags)
+{
+	return newport_set_font(vc->vc_num, font);
 }
 
 static int newport_set_palette(struct vc_data *vc, unsigned char *table)
@@ -717,7 +713,8 @@ const struct consw newport_con = {
     .con_bmove =	newport_bmove,
     .con_switch =	newport_switch,
     .con_blank =	newport_blank,
-    .con_font_op =	newport_font_op,
+    .con_font_set =	newport_font_set,
+    .con_font_default =	newport_font_default,
     .con_set_palette =	newport_set_palette,
     .con_scrolldelta =	newport_scrolldelta,
     .con_set_origin =	DUMMY,
diff --git a/drivers/video/console/promcon.c b/drivers/video/console/promcon.c
index 1458b1613..fec664e61 100644
--- a/drivers/video/console/promcon.c
+++ b/drivers/video/console/promcon.c
@@ -456,12 +456,6 @@ promcon_cursor(struct vc_data *conp, int mode)
 	}
 }
 
-static int
-promcon_font_op(struct vc_data *conp, struct console_font_op *op)
-{
-	return -ENOSYS;
-}
-        
 static int
 promcon_blank(struct vc_data *conp, int blank, int mode_switch)
 {
@@ -586,7 +580,6 @@ const struct consw prom_con = {
 	.con_bmove =		promcon_bmove,
 	.con_switch =		promcon_switch,
 	.con_blank =		promcon_blank,
-	.con_font_op =		promcon_font_op,
 	.con_set_palette =	DUMMY,
 	.con_scrolldelta =	DUMMY,
 #if !(PROMCON_COLOR)
diff --git a/drivers/video/console/sticon.c b/drivers/video/console/sticon.c
index 92dffc676..99262680f 100644
--- a/drivers/video/console/sticon.c
+++ b/drivers/video/console/sticon.c
@@ -85,11 +85,6 @@ static int sticon_set_palette(struct vc_data *c, unsigned char *table)
     return -EINVAL;
 }
 
-static int sticon_font_op(struct vc_data *c, struct console_font_op *op)
-{
-    return -ENOSYS;
-}
-
 static void sticon_putc(struct vc_data *conp, int c, int ypos, int xpos)
 {
     int unit = conp->vc_num;
@@ -366,7 +361,6 @@ static struct consw sti_con = {
 	.con_bmove		= sticon_bmove,
 	.con_switch		= sticon_switch,
 	.con_blank		= sticon_blank,
-	.con_font_op		= sticon_font_op,
 	.con_set_palette	= sticon_set_palette,
 	.con_scrolldelta	= sticon_scrolldelta,
 	.con_set_origin		= sticon_set_origin,
diff --git a/drivers/video/console/sticore.c b/drivers/video/console/sticore.c
index 5d9a6e84c..7cf956e4a 100644
--- a/drivers/video/console/sticore.c
+++ b/drivers/video/console/sticore.c
@@ -22,7 +22,6 @@
 #include <linux/pci.h>
 #include <linux/font.h>
 
-#include <asm/pgalloc.h>
 #include <asm/hardware.h>
 #include <asm/parisc-device.h>
 #include <asm/cacheflush.h>
diff --git a/drivers/video/console/vgacon.c b/drivers/video/console/vgacon.c
index b75ab0df6..0e91d6b57 100644
--- a/drivers/video/console/vgacon.c
+++ b/drivers/video/console/vgacon.c
@@ -77,7 +77,6 @@ static void vgacon_deinit(struct vc_data *c);
 static void vgacon_cursor(struct vc_data *c, int mode);
 static int vgacon_switch(struct vc_data *c);
 static int vgacon_blank(struct vc_data *c, int blank, int mode_switch);
-static int vgacon_font_op(struct vc_data *c, struct console_font_op *op);
 static int vgacon_set_palette(struct vc_data *vc, unsigned char *table);
 static int vgacon_scrolldelta(struct vc_data *c, int lines);
 static int vgacon_set_origin(struct vc_data *c);
@@ -908,39 +907,44 @@ static int vgacon_adjust_height(struct vc_data *vc, unsigned fontheight)
 	return 0;
 }
 
-static int vgacon_font_op(struct vc_data *c, struct console_font_op *op)
+static int vgacon_font_set(struct vc_data *c, struct console_font *font, unsigned flags)
 {
+	unsigned charcount = font->charcount;
 	int rc;
 
 	if (vga_video_type < VIDEO_TYPE_EGAM)
 		return -EINVAL;
 
-	if (op->op == KD_FONT_OP_SET) {
-		if (op->width != 8
-		    || (op->charcount != 256 && op->charcount != 512))
-			return -EINVAL;
-		rc = vgacon_do_font_op(&state, op->data, 1, op->charcount == 512);
-		if (!rc && !(op->flags & KD_FONT_FLAG_DONT_RECALC))
-			rc = vgacon_adjust_height(c, op->height);
-	} else if (op->op == KD_FONT_OP_GET) {
-		op->width = 8;
-		op->height = c->vc_font.height;
-		op->charcount = vga_512_chars ? 512 : 256;
-		if (!op->data)
-			return 0;
-		rc = vgacon_do_font_op(&state, op->data, 0, 0);
-	} else
-		rc = -ENOSYS;
+	if (font->width != 8 || (charcount != 256 && charcount != 512))
+		return -EINVAL;
+
+	rc = vgacon_do_font_op(&state, font->data, 1, charcount == 512);
+	if (rc)
+		return rc;
+
+	if (!(flags & KD_FONT_FLAG_DONT_RECALC))
+		rc = vgacon_adjust_height(c, font->height);
 	return rc;
 }
 
-#else
-
-static int vgacon_font_op(struct vc_data *c, struct console_font_op *op)
+static int vgacon_font_get(struct vc_data *c, struct console_font *font)
 {
-	return -ENOSYS;
+	if (vga_video_type < VIDEO_TYPE_EGAM)
+		return -EINVAL;
+
+	font->width = 8;
+	font->height = c->vc_font.height;
+	font->charcount = vga_512_chars ? 512 : 256;
+	if (!font->data)
+		return 0;
+	return vgacon_do_font_op(&state, font->data, 0, 0);
 }
 
+#else
+
+#define vgacon_font_set NULL
+#define vgacon_font_get NULL
+
 #endif
 
 static int vgacon_scrolldelta(struct vc_data *c, int lines)
@@ -963,6 +967,8 @@ static int vgacon_scrolldelta(struct vc_data *c, int lines)
 		p = (c->vc_visible_origin - vga_vram_base - ul + we) % we +
 		    lines * c->vc_size_row;
 		st = (c->vc_origin - vga_vram_base - ul + we) % we;
+		if (st < 2 * margin)
+			margin = 0;
 		if (p < margin)
 			p = 0;
 		if (p > st - margin)
@@ -1077,7 +1083,8 @@ const struct consw vga_con = {
 	.con_bmove = DUMMY,
 	.con_switch = vgacon_switch,
 	.con_blank = vgacon_blank,
-	.con_font_op = vgacon_font_op,
+	.con_font_set = vgacon_font_set,
+	.con_font_get = vgacon_font_get,
 	.con_set_palette = vgacon_set_palette,
 	.con_scrolldelta = vgacon_scrolldelta,
 	.con_set_origin = vgacon_set_origin,
diff --git a/drivers/video/dnfb.c b/drivers/video/dnfb.c
index 7e75f7426..11ba053b5 100644
--- a/drivers/video/dnfb.c
+++ b/drivers/video/dnfb.c
@@ -118,23 +118,23 @@ static struct fb_ops dn_fb_ops = {
 };
 
 struct fb_var_screeninfo dnfb_var __devinitdata = {
-	.xres		1280,
-	.yres		1024,
-	.xres_virtual	2048,
-	.yres_virtual	1024,
-	.bits_per_pixel	1,
-	.height		-1,
-	.width		-1,
-	.vmode		FB_VMODE_NONINTERLACED,
+	.xres		= 1280,
+	.yres		= 1024,
+	.xres_virtual	= 2048,
+	.yres_virtual	= 1024,
+	.bits_per_pixel	= 1,
+	.height		= -1,
+	.width		= -1,
+	.vmode		= FB_VMODE_NONINTERLACED,
 };
 
 static struct fb_fix_screeninfo dnfb_fix __devinitdata = {
-	.id		"Apollo Mono",
-	.smem_start	(FRAME_BUFFER_START + IO_BASE),
-	.smem_len	FRAME_BUFFER_LEN,
-	.type		FB_TYPE_PACKED_PIXELS,
-	.visual		FB_VISUAL_MONO10,
-	.line_length	256,
+	.id		= "Apollo Mono",
+	.smem_start	= (FRAME_BUFFER_START + IO_BASE),
+	.smem_len	= FRAME_BUFFER_LEN,
+	.type		= FB_TYPE_PACKED_PIXELS,
+	.visual		= FB_VISUAL_MONO10,
+	.line_length	= 256,
 };
 
 static int dnfb_blank(int blank, struct fb_info *info)
diff --git a/drivers/video/fbcmap.c b/drivers/video/fbcmap.c
index 482693db1..c51f8fb5c 100644
--- a/drivers/video/fbcmap.c
+++ b/drivers/video/fbcmap.c
@@ -111,7 +111,7 @@ int fb_alloc_cmap(struct fb_cmap *cmap, int len, int transp)
     }
     cmap->start = 0;
     cmap->len = len;
-    fb_copy_cmap(fb_default_cmap(len), cmap, 0);
+    fb_copy_cmap(fb_default_cmap(len), cmap);
     return 0;
 
 fail:
@@ -143,53 +143,50 @@ void fb_dealloc_cmap(struct fb_cmap *cmap)
  *	fb_copy_cmap - copy a colormap
  *	@from: frame buffer colormap structure
  *	@to: frame buffer colormap structure
- *	@fsfromto: determine copy method
  *
  *	Copy contents of colormap from @from to @to.
- *
- *	@fsfromto accepts the following integer parameters:
- *	0: memcpy function
- *	1: copy_from_user() function to copy from userspace
- *	2: copy_to_user() function to copy to userspace
- *
  */
 
-int fb_copy_cmap(struct fb_cmap *from, struct fb_cmap *to, int fsfromto)
+int fb_copy_cmap(struct fb_cmap *from, struct fb_cmap *to)
 {
-    int tooff = 0, fromoff = 0;
-    int size;
-    
-    if (to->start > from->start)
-	fromoff = to->start-from->start;
-    else
-	tooff = from->start-to->start;
-    size = to->len-tooff;
-    if (size > (int) (from->len - fromoff))
-	size = from->len-fromoff;
-    if (size <= 0)
-	return -EINVAL;
-    size *= sizeof(u16);
-    
-    switch (fsfromto) {
-    case 0:
+	int tooff = 0, fromoff = 0;
+	int size;
+
+	if (to->start > from->start)
+		fromoff = to->start - from->start;
+	else
+		tooff = from->start - to->start;
+	size = to->len - tooff;
+	if (size > (int) (from->len - fromoff))
+		size = from->len - fromoff;
+	if (size <= 0)
+		return -EINVAL;
+	size *= sizeof(u16);
+
 	memcpy(to->red+tooff, from->red+fromoff, size);
 	memcpy(to->green+tooff, from->green+fromoff, size);
 	memcpy(to->blue+tooff, from->blue+fromoff, size);
 	if (from->transp && to->transp)
-	    memcpy(to->transp+tooff, from->transp+fromoff, size);
-        break;
-    case 1:
-	if (copy_from_user(to->red+tooff, from->red+fromoff, size))
-		return -EFAULT;
-	if (copy_from_user(to->green+tooff, from->green+fromoff, size))
-		return -EFAULT;	
-	if (copy_from_user(to->blue+tooff, from->blue+fromoff, size))
-		return -EFAULT;
-	if (from->transp && to->transp)
-            if (copy_from_user(to->transp+tooff, from->transp+fromoff, size))
-		    return -EFAULT;	
-	break;
-    case 2:
+		memcpy(to->transp+tooff, from->transp+fromoff, size);
+	return 0;
+}
+
+int fb_cmap_to_user(struct fb_cmap *from, struct fb_cmap_user *to)
+{
+	int tooff = 0, fromoff = 0;
+	int size;
+
+	if (to->start > from->start)
+		fromoff = to->start - from->start;
+	else
+		tooff = from->start - to->start;
+	size = to->len - tooff;
+	if (size > (int) (from->len - fromoff))
+		size = from->len - fromoff;
+	if (size <= 0)
+		return -EINVAL;
+	size *= sizeof(u16);
+
 	if (copy_to_user(to->red+tooff, from->red+fromoff, size))
 		return -EFAULT;
 	if (copy_to_user(to->green+tooff, from->green+fromoff, size))
@@ -199,15 +196,12 @@ int fb_copy_cmap(struct fb_cmap *from, struct fb_cmap *to, int fsfromto)
 	if (from->transp && to->transp)
 		if (copy_to_user(to->transp+tooff, from->transp+fromoff, size))
 			return -EFAULT;
-	break;
-    }
-    return 0;
+	return 0;
 }
 
 /**
  *	fb_set_cmap - set the colormap
  *	@cmap: frame buffer colormap structure
- *	@kspc: boolean, 1 copy local, 0 get_user() function
  *	@info: frame buffer info structure
  *
  *	Sets the colormap @cmap for a screen of device @info.
@@ -216,46 +210,63 @@ int fb_copy_cmap(struct fb_cmap *from, struct fb_cmap *to, int fsfromto)
  *
  */
 
-int fb_set_cmap(struct fb_cmap *cmap, int kspc, struct fb_info *info)
+int fb_set_cmap(struct fb_cmap *cmap, struct fb_info *info)
 {
-    int i, start;
-    u16 *red, *green, *blue, *transp;
-    u_int hred, hgreen, hblue, htransp;
-
-    red = cmap->red;
-    green = cmap->green;
-    blue = cmap->blue;
-    transp = cmap->transp;
-    start = cmap->start;
-
-    if (start < 0 || !info->fbops->fb_setcolreg)
-	return -EINVAL;
-    for (i = 0; i < cmap->len; i++) {
-	if (kspc) {
-	    hred = *red;
-	    hgreen = *green;
-	    hblue = *blue;
-	    htransp = transp ? *transp : 0xffff;
-	} else {
-	    get_user(hred, red);
-	    get_user(hgreen, green);
-	    get_user(hblue, blue);
-	    if (transp)
-		get_user(htransp, transp);
-	    else
-		htransp = 0xffff;
+	int i, start;
+	u16 *red, *green, *blue, *transp;
+	u_int hred, hgreen, hblue, htransp = 0xffff;
+
+	red = cmap->red;
+	green = cmap->green;
+	blue = cmap->blue;
+	transp = cmap->transp;
+	start = cmap->start;
+
+	if (start < 0 || !info->fbops->fb_setcolreg)
+		return -EINVAL;
+	for (i = 0; i < cmap->len; i++) {
+		hred = *red++;
+		hgreen = *green++;
+		hblue = *blue++;
+		if (transp)
+			htransp = *transp++;
+		if (info->fbops->fb_setcolreg(start++,
+					      hred, hgreen, hblue, htransp,
+					      info))
+			break;
 	}
-	red++;
-	green++;
-	blue++;
-	if (transp)
-	    transp++;
-	if (info->fbops->fb_setcolreg(start++, hred, hgreen, hblue, htransp, info))
-	    return 0;
-    }
-    return 0;
+	return 0;
 }
 
+int fb_set_user_cmap(struct fb_cmap_user *cmap, struct fb_info *info)
+{
+	int i, start;
+	u16 __user *red, *green, *blue, *transp;
+	u_int hred, hgreen, hblue, htransp = 0xffff;
+
+	red = cmap->red;
+	green = cmap->green;
+	blue = cmap->blue;
+	transp = cmap->transp;
+	start = cmap->start;
+
+	if (start < 0 || !info->fbops->fb_setcolreg)
+		return -EINVAL;
+	for (i = 0; i < cmap->len; i++, red++, blue++, green++) {
+		if (get_user(hred, red) ||
+		    get_user(hgreen, green) ||
+		    get_user(hblue, blue) ||
+		    (transp && get_user(htransp, transp)))
+			return -EFAULT;
+		if (info->fbops->fb_setcolreg(start++,
+					      hred, hgreen, hblue, htransp,
+					      info))
+			return 0;
+		if (transp)
+			transp++;
+	}
+	return 0;
+}
 
 /**
  *	fb_default_cmap - get default colormap
diff --git a/drivers/video/fbmem.c b/drivers/video/fbmem.c
index 80d81e398..2a55e5dbf 100644
--- a/drivers/video/fbmem.c
+++ b/drivers/video/fbmem.c
@@ -73,8 +73,8 @@ extern int cyber2000fb_init(void);
 extern int cyber2000fb_setup(char*);
 extern int retz3fb_init(void);
 extern int retz3fb_setup(char*);
-extern int clgenfb_init(void);
-extern int clgenfb_setup(char*);
+extern int cirrusfb_init(void);
+extern int cirrusfb_setup(char*);
 extern int hitfb_init(void);
 extern int vfb_init(void);
 extern int vfb_setup(char*);
@@ -172,6 +172,7 @@ extern int kyrofb_init(void);
 extern int kyrofb_setup(char*);
 extern int mc68x328fb_init(void);
 extern int mc68x328fb_setup(char *);
+extern int asiliantfb_init(void);
 
 static struct {
 	const char *name;
@@ -203,8 +204,8 @@ static struct {
 #ifdef CONFIG_FB_PM3
 	{ "pm3fb", pm3fb_init, pm3fb_setup },
 #endif           
-#ifdef CONFIG_FB_CLGEN
-	{ "clgenfb", clgenfb_init, clgenfb_setup },
+#ifdef CONFIG_FB_CIRRUS
+	{ "cirrusfb", cirrusfb_init, cirrusfb_setup },
 #endif
 #ifdef CONFIG_FB_ATY
 	{ "atyfb", atyfb_init, atyfb_setup },
@@ -385,6 +386,9 @@ static struct {
 #ifdef CONFIG_FB_68328
 	{ "68328fb", mc68x328fb_init, mc68x328fb_setup },
 #endif
+#ifdef CONFIG_FB_ASILIANT
+	{ "asiliantfb", asiliantfb_init, NULL },
+#endif
 
 	/*
 	 * Generic drivers that don't use resource management (yet)
@@ -426,34 +430,37 @@ static int ofonly __initdata = 0;
 /*
  * Drawing helpers.
  */
-static u8 fb_sys_inbuf(struct fb_info *info, u8 *src)
+void fb_iomove_buf_aligned(struct fb_info *info, struct fb_pixmap *buf,
+			   u8 *dst, u32 d_pitch, u8 *src, u32 s_pitch,
+			   u32 height)
 {
-	return *src;
-}
+	int i;
 
-static void fb_sys_outbuf(struct fb_info *info, u8 *dst,
-				u8 *src, unsigned int size)
-{
-	memcpy(dst, src, size);
-}	
+	for (i = height; i--; ) {
+		buf->outbuf(info, dst, src, s_pitch);
+		src += s_pitch;
+		dst += d_pitch;
+	}
+}
 
-void fb_move_buf_aligned(struct fb_info *info, struct fb_pixmap *buf,
-			u8 *dst, u32 d_pitch, u8 *src, u32 s_pitch,
-			u32 height)
+void fb_sysmove_buf_aligned(struct fb_info *info, struct fb_pixmap *buf,
+			    u8 *dst, u32 d_pitch, u8 *src, u32 s_pitch,
+			    u32 height)
 {
-	int i;
+	int i, j;
 
 	for (i = height; i--; ) {
-		buf->outbuf(info, dst, src, s_pitch);
+		for (j = 0; j < s_pitch; j++)
+			dst[j] = src[j];
 		src += s_pitch;
 		dst += d_pitch;
 	}
 }
 
-void fb_move_buf_unaligned(struct fb_info *info, struct fb_pixmap *buf,
-			u8 *dst, u32 d_pitch, u8 *src, u32 idx,
-			u32 height, u32 shift_high, u32 shift_low,
-			u32 mod)
+void fb_iomove_buf_unaligned(struct fb_info *info, struct fb_pixmap *buf,
+			     u8 *dst, u32 d_pitch, u8 *src, u32 idx,
+			     u32 height, u32 shift_high, u32 shift_low,
+			     u32 mod)
 {
 	u8 mask = (u8) (0xfff << shift_high), tmp;
 	int i, j;
@@ -481,6 +488,37 @@ void fb_move_buf_unaligned(struct fb_info *info, struct fb_pixmap *buf,
 	}
 }
 
+void fb_sysmove_buf_unaligned(struct fb_info *info, struct fb_pixmap *buf,
+			      u8 *dst, u32 d_pitch, u8 *src, u32 idx,
+			      u32 height, u32 shift_high, u32 shift_low,
+			      u32 mod)
+{
+	u8 mask = (u8) (0xfff << shift_high), tmp;
+	int i, j;
+
+	for (i = height; i--; ) {
+		for (j = 0; j < idx; j++) {
+			tmp = dst[j];
+			tmp &= mask;
+			tmp |= *src >> shift_low;
+			dst[j] = tmp;
+			tmp = *src << shift_high;
+			dst[j+1] = tmp;
+			src++;
+		}
+		tmp = dst[idx];
+		tmp &= mask;
+		tmp |= *src >> shift_low;
+		dst[idx] = tmp;
+		if (shift_high < mod) {
+			tmp = *src << shift_high;
+			dst[idx+1] = tmp;
+		}
+		src++;
+		dst += d_pitch;
+	}
+}
+
 /*
  * we need to lock this section since fb_cursor
  * may use fb_imageblit()
@@ -525,7 +563,7 @@ static inline unsigned safe_shift(unsigned d, int n)
 	return n < 0 ? d >> -n : d << n;
 }
 
-static void __init fb_set_logocmap(struct fb_info *info,
+static void fb_set_logocmap(struct fb_info *info,
 				   const struct linux_logo *logo)
 {
 	struct fb_cmap palette_cmap;
@@ -555,11 +593,11 @@ static void __init fb_set_logocmap(struct fb_info *info,
 			palette_cmap.blue[j] = clut[2] << 8 | clut[2];
 			clut += 3;
 		}
-		fb_set_cmap(&palette_cmap, 1, info);
+		fb_set_cmap(&palette_cmap, info);
 	}
 }
 
-static void  __init fb_set_logo_truepalette(struct fb_info *info,
+static void  fb_set_logo_truepalette(struct fb_info *info,
 					    const struct linux_logo *logo,
 					    u32 *palette)
 {
@@ -589,7 +627,7 @@ static void  __init fb_set_logo_truepalette(struct fb_info *info,
 	}
 }
 
-static void __init fb_set_logo_directpalette(struct fb_info *info,
+static void fb_set_logo_directpalette(struct fb_info *info,
 					     const struct linux_logo *logo,
 					     u32 *palette)
 {
@@ -604,7 +642,7 @@ static void __init fb_set_logo_directpalette(struct fb_info *info,
 		palette[i] = i << redshift | i << greenshift | i << blueshift;
 }
 
-static void __init fb_set_logo(struct fb_info *info,
+static void fb_set_logo(struct fb_info *info,
 			       const struct linux_logo *logo, u8 *dst,
 			       int depth)
 {
@@ -802,7 +840,7 @@ static int fbmem_read_proc(char *buf, char **start, off_t offset,
 }
 
 static ssize_t
-fb_read(struct file *file, char *buf, size_t count, loff_t *ppos)
+fb_read(struct file *file, char __user *buf, size_t count, loff_t *ppos)
 {
 	unsigned long p = *ppos;
 	struct inode *inode = file->f_dentry->d_inode;
@@ -839,7 +877,7 @@ fb_read(struct file *file, char *buf, size_t count, loff_t *ppos)
 }
 
 static ssize_t
-fb_write(struct file *file, const char *buf, size_t count, loff_t *ppos)
+fb_write(struct file *file, const char __user *buf, size_t count, loff_t *ppos)
 {
 	unsigned long p = *ppos;
 	struct inode *inode = file->f_dentry->d_inode;
@@ -893,53 +931,100 @@ fb_load_cursor_image(struct fb_info *info)
 	unsigned int width = (info->cursor.image.width + 7) >> 3;
 	u8 *data = (u8 *) info->cursor.image.data;
 
-	info->sprite.outbuf(info, info->sprite.addr, data, width);
+	if (info->sprite.outbuf)
+	    info->sprite.outbuf(info, info->sprite.addr, data, width);
+	else
+	    memcpy(info->sprite.addr, data, width);
 }
 
 int
-fb_cursor(struct fb_info *info, struct fb_cursor *sprite)
+fb_cursor(struct fb_info *info, struct fb_cursor_user __user *sprite)
 {
+	struct fb_cursor_user cursor_user;
 	struct fb_cursor cursor;
-	int err;
+	char *data = NULL, *mask = NULL;
+	u16 *red = NULL, *green = NULL, *blue = NULL, *transp = NULL;
+	int err = -EINVAL;
 	
-	if (copy_from_user(&cursor, sprite, sizeof(struct fb_cursor)))
+	if (copy_from_user(&cursor_user, sprite, sizeof(struct fb_cursor_user)))
 		return -EFAULT;
 
+	memcpy(&cursor, &cursor_user, sizeof(cursor));
+	cursor.mask = NULL;
+	cursor.image.data = NULL;
+	cursor.image.cmap.red = NULL;
+	cursor.image.cmap.green = NULL;
+	cursor.image.cmap.blue = NULL;
+	cursor.image.cmap.transp = NULL;
+
 	if (cursor.set & FB_CUR_SETCUR)
 		info->cursor.enable = 1;
 	
 	if (cursor.set & FB_CUR_SETCMAP) {
-		err = fb_copy_cmap(&cursor.image.cmap, &sprite->image.cmap, 1);
-		if (err)
-			return err;
+		unsigned len = cursor.image.cmap.len;
+		if ((int)len <= 0)
+			goto out;
+		len *= 2;
+		err = -ENOMEM;
+		red = kmalloc(len, GFP_USER);
+		green = kmalloc(len, GFP_USER);
+		blue = kmalloc(len, GFP_USER);
+		if (!red || !green || !blue)
+			goto out;
+		if (cursor_user.image.cmap.transp) {
+			transp = kmalloc(len, GFP_USER);
+			if (!transp)
+				goto out;
+		}
+		err = -EFAULT;
+		if (copy_from_user(red, cursor_user.image.cmap.red, len))
+			goto out;
+		if (copy_from_user(green, cursor_user.image.cmap.green, len))
+			goto out;
+		if (copy_from_user(blue, cursor_user.image.cmap.blue, len))
+			goto out;
+		if (transp) {
+			if (copy_from_user(transp,
+					   cursor_user.image.cmap.transp, len))
+				goto out;
+		}
+		cursor.image.cmap.red = red;
+		cursor.image.cmap.green = green;
+		cursor.image.cmap.blue = blue;
+		cursor.image.cmap.transp = transp;
 	}
 	
 	if (cursor.set & FB_CUR_SETSHAPE) {
 		int size = ((cursor.image.width + 7) >> 3) * cursor.image.height;		
+
 		if ((cursor.image.height != info->cursor.image.height) ||
 		    (cursor.image.width != info->cursor.image.width))
 			cursor.set |= FB_CUR_SETSIZE;
 		
-		cursor.image.data = kmalloc(size, GFP_KERNEL);
-		if (!cursor.image.data)
-			return -ENOMEM;
+		err = -ENOMEM;
+		data = kmalloc(size, GFP_USER);
+		mask = kmalloc(size, GFP_USER);
+		if (!mask || !data)
+			goto out;
 		
-		cursor.mask = kmalloc(size, GFP_KERNEL);
-		if (!cursor.mask) {
-			kfree(cursor.image.data);
-			return -ENOMEM;
-		}
+		err = -EFAULT;
+		if (copy_from_user(data, cursor_user.image.data, size) ||
+		    copy_from_user(mask, cursor_user.mask, size))
+			goto out;
 		
-		if (copy_from_user(cursor.image.data, sprite->image.data, size) ||
-		    copy_from_user(cursor.mask, sprite->mask, size)) { 
-			kfree(cursor.image.data);
-			kfree(cursor.mask);
-			return -EFAULT;
-		}
+		cursor.image.data = data;
+		cursor.mask = mask;
 	}
 	info->cursor.set = cursor.set;
 	info->cursor.rop = cursor.rop;
 	err = info->fbops->fb_cursor(info, &cursor);
+out:
+	kfree(data);
+	kfree(mask);
+	kfree(red);
+	kfree(green);
+	kfree(blue);
+	kfree(transp);
 	return err;
 }
 
@@ -988,9 +1073,13 @@ fb_set_var(struct fb_info *info, struct fb_var_screeninfo *var)
 
 			fb_pan_display(info, &info->var);
 
-			fb_set_cmap(&info->cmap, 1, info);
+			fb_set_cmap(&info->cmap, info);
 
-			notifier_call_chain(&fb_notifier_list, FB_EVENT_MODE_CHANGE, info);
+			if (info->flags & FBINFO_MISC_MODECHANGEUSER) {
+				info->flags &= ~FBINFO_MISC_MODECHANGEUSER;
+				notifier_call_chain(&fb_notifier_list,
+						    FB_EVENT_MODE_CHANGE, info);
+			}
 		}
 	}
 	return 0;
@@ -1013,7 +1102,7 @@ fb_blank(struct fb_info *info, int blank)
 		cmap.len = info->cmap.len;
 	} else
 		cmap = info->cmap;
-	return fb_set_cmap(&cmap, 1, info);
+	return fb_set_cmap(&cmap, info);
 }
 
 static int 
@@ -1028,63 +1117,66 @@ fb_ioctl(struct inode *inode, struct file *file, unsigned int cmd,
 #ifdef CONFIG_FRAMEBUFFER_CONSOLE
 	struct fb_con2fbmap con2fb;
 #endif
-	struct fb_cmap cmap;
+	struct fb_cmap_user cmap;
+	void __user *argp = (void __user *)arg;
 	int i;
 	
 	if (!fb)
 		return -ENODEV;
 	switch (cmd) {
 	case FBIOGET_VSCREENINFO:
-		return copy_to_user((void *) arg, &info->var,
+		return copy_to_user(argp, &info->var,
 				    sizeof(var)) ? -EFAULT : 0;
 	case FBIOPUT_VSCREENINFO:
-		if (copy_from_user(&var, (void *) arg, sizeof(var)))
+		if (copy_from_user(&var, argp, sizeof(var)))
 			return -EFAULT;
 		acquire_console_sem();
+		info->flags |= FBINFO_MISC_MODECHANGEUSER;
 		i = fb_set_var(info, &var);
+		info->flags &= ~FBINFO_MISC_MODECHANGEUSER;
 		release_console_sem();
 		if (i) return i;
-		if (copy_to_user((void *) arg, &var, sizeof(var)))
+		if (copy_to_user(argp, &var, sizeof(var)))
 			return -EFAULT;
 		return 0;
 	case FBIOGET_FSCREENINFO:
-		return copy_to_user((void *) arg, &info->fix,
+		return copy_to_user(argp, &info->fix,
 				    sizeof(fix)) ? -EFAULT : 0;
 	case FBIOPUTCMAP:
-		if (copy_from_user(&cmap, (void *) arg, sizeof(cmap)))
+		if (copy_from_user(&cmap, argp, sizeof(cmap)))
 			return -EFAULT;
-		return (fb_set_cmap(&cmap, 0, info));
+		return (fb_set_user_cmap(&cmap, info));
 	case FBIOGETCMAP:
-		if (copy_from_user(&cmap, (void *) arg, sizeof(cmap)))
+		if (copy_from_user(&cmap, argp, sizeof(cmap)))
 			return -EFAULT;
-		return (fb_copy_cmap(&info->cmap, &cmap, 2));
+		return fb_cmap_to_user(&info->cmap, &cmap);
 	case FBIOPAN_DISPLAY:
-		if (copy_from_user(&var, (void *) arg, sizeof(var)))
+		if (copy_from_user(&var, argp, sizeof(var)))
 			return -EFAULT;
 		acquire_console_sem();
 		i = fb_pan_display(info, &var);
 		release_console_sem();
 		if (i)
 			return i;
-		if (copy_to_user((void *) arg, &var, sizeof(var)))
+		if (copy_to_user(argp, &var, sizeof(var)))
 			return -EFAULT;
 		return 0;
 	case FBIO_CURSOR:
 		acquire_console_sem();
-		i = fb_cursor(info, (struct fb_cursor *) arg);
+		i = fb_cursor(info, argp);
 		release_console_sem();
 		return i;
 #ifdef CONFIG_FRAMEBUFFER_CONSOLE
 	case FBIOGET_CON2FBMAP:
-		if (copy_from_user(&con2fb, (void *)arg, sizeof(con2fb)))
+		if (copy_from_user(&con2fb, argp, sizeof(con2fb)))
 			return -EFAULT;
 		if (con2fb.console < 1 || con2fb.console > MAX_NR_CONSOLES)
 		    return -EINVAL;
 		con2fb.framebuffer = con2fb_map[con2fb.console-1];
-		return copy_to_user((void *)arg, &con2fb,
+		return copy_to_user(argp, &con2fb,
 				    sizeof(con2fb)) ? -EFAULT : 0;
 	case FBIOPUT_CON2FBMAP:
-		if (copy_from_user(&con2fb, (void *)arg, sizeof(con2fb)))
+		if (copy_from_user(&con2fb, argp, sizeof(con2fb)))
 			return - EFAULT;
 		if (con2fb.console < 0 || con2fb.console > MAX_NR_CONSOLES)
 		    return -EINVAL;
@@ -1096,11 +1188,10 @@ fb_ioctl(struct inode *inode, struct file *file, unsigned int cmd,
 #endif /* CONFIG_KMOD */
 		if (!registered_fb[con2fb.framebuffer])
 		    return -EINVAL;
-		if (con2fb.console != 0)
-			set_con2fb_map(con2fb.console-1, con2fb.framebuffer);
-		else
-			fb_console_init();		
-		return 0;
+		if (con2fb.console > 0 && con2fb.console < MAX_NR_CONSOLES)
+			return set_con2fb_map(con2fb.console-1,
+					      con2fb.framebuffer);
+		return -EINVAL;
 #endif	/* CONFIG_FRAMEBUFFER_CONSOLE */
 	case FBIOBLANK:
 		acquire_console_sem();
@@ -1306,10 +1397,6 @@ register_framebuffer(struct fb_info *fb_info)
 		}
 	}	
 	fb_info->pixmap.offset = 0;
-	if (fb_info->pixmap.outbuf == NULL)
-		fb_info->pixmap.outbuf = fb_sys_outbuf;
-	if (fb_info->pixmap.inbuf == NULL)
-		fb_info->pixmap.inbuf = fb_sys_inbuf;
 
 	if (fb_info->sprite.addr == NULL) {
 		fb_info->sprite.addr = kmalloc(FBPIXMAPSIZE, GFP_KERNEL);
@@ -1322,10 +1409,6 @@ register_framebuffer(struct fb_info *fb_info)
 		}
 	}
 	fb_info->sprite.offset = 0;
-	if (fb_info->sprite.outbuf == NULL)
-		fb_info->sprite.outbuf = fb_sys_outbuf;
-	if (fb_info->sprite.inbuf == NULL)
-		fb_info->sprite.inbuf = fb_sys_inbuf;
 
 	registered_fb[i] = fb_info;
 
@@ -1417,7 +1500,7 @@ fbmem_init(void)
 {
 	int i;
 
-	create_proc_read_entry("fb", 0, 0, fbmem_read_proc, NULL);
+	create_proc_read_entry("fb", 0, NULL, fbmem_read_proc, NULL);
 
 	devfs_mk_dir("fb");
 	if (register_chrdev(FB_MAJOR,"fb",&fb_fops))
@@ -1520,8 +1603,10 @@ EXPORT_SYMBOL(fb_set_var);
 EXPORT_SYMBOL(fb_blank);
 EXPORT_SYMBOL(fb_pan_display);
 EXPORT_SYMBOL(fb_get_buffer_offset);
-EXPORT_SYMBOL(fb_move_buf_unaligned);
-EXPORT_SYMBOL(fb_move_buf_aligned);
+EXPORT_SYMBOL(fb_iomove_buf_unaligned);
+EXPORT_SYMBOL(fb_iomove_buf_aligned);
+EXPORT_SYMBOL(fb_sysmove_buf_unaligned);
+EXPORT_SYMBOL(fb_sysmove_buf_aligned);
 EXPORT_SYMBOL(fb_load_cursor_image);
 EXPORT_SYMBOL(fb_set_suspend);
 EXPORT_SYMBOL(fb_register_client);
diff --git a/drivers/video/i810/i810_gtf.c b/drivers/video/i810/i810_gtf.c
index b18689bcc..7d0c02ca0 100644
--- a/drivers/video/i810/i810_gtf.c
+++ b/drivers/video/i810/i810_gtf.c
@@ -222,7 +222,7 @@ void i810fb_fill_var_timings(struct fb_var_screeninfo *var) { }
 u32 i810_get_watermark(const struct fb_var_screeninfo *var,
 		       struct i810fb_par *par)
 {
-	struct wm_info *wmark = 0;
+	struct wm_info *wmark = NULL;
 	u32 i, size = 0, pixclock, wm_best = 0, min, diff;
 
 	if (par->mem_freq == 100) {
diff --git a/drivers/video/imsttfb.c b/drivers/video/imsttfb.c
index 6b1635c4c..7bef8b772 100644
--- a/drivers/video/imsttfb.c
+++ b/drivers/video/imsttfb.c
@@ -500,7 +500,7 @@ compute_imstt_regvals_ibm(struct imstt_par *par, int xres, int yres)
 			MHz = 200;
 			break;
 		default:
-			return 0;
+			return NULL;
 	}
 
 	setclkMHz(par, MHz);
@@ -547,7 +547,7 @@ compute_imstt_regvals_tvp(struct imstt_par *par, int xres, int yres)
 			init = yres == 960 ? &tvp_reg_init_19 : &tvp_reg_init_20;
 			break;
 		default:
-			return 0;
+			return NULL;
 	}
 	par->init = *init;
 	return init;
@@ -1267,48 +1267,49 @@ imsttfb_ioctl(struct inode *inode, struct file *file, u_int cmd,
 	      u_long arg, struct fb_info *info)
 {
 	struct imstt_par *par = (struct imstt_par *) info->par;
+	void __user *argp = (void __user *)arg;
 	__u32 reg[2];
 	__u8 idx[2];
 
 	switch (cmd) {
 		case FBIMSTT_SETREG:
-			if (copy_from_user(reg, (void *)arg, 8) || reg[0] > (0x1000 - sizeof(reg[0])) / sizeof(reg[0]))
+			if (copy_from_user(reg, argp, 8) || reg[0] > (0x1000 - sizeof(reg[0])) / sizeof(reg[0]))
 				return -EFAULT;
 			write_reg_le32(par->dc_regs, reg[0], reg[1]);
 			return 0;
 		case FBIMSTT_GETREG:
-			if (copy_from_user(reg, (void *)arg, 4) || reg[0] > (0x1000 - sizeof(reg[0])) / sizeof(reg[0]))
+			if (copy_from_user(reg, argp, 4) || reg[0] > (0x1000 - sizeof(reg[0])) / sizeof(reg[0]))
 				return -EFAULT;
 			reg[1] = read_reg_le32(par->dc_regs, reg[0]);
-			if (copy_to_user((void *)(arg + 4), &reg[1], 4))
+			if (copy_to_user((void __user *)(arg + 4), &reg[1], 4))
 				return -EFAULT;
 			return 0;
 		case FBIMSTT_SETCMAPREG:
-			if (copy_from_user(reg, (void *)arg, 8) || reg[0] > (0x1000 - sizeof(reg[0])) / sizeof(reg[0]))
+			if (copy_from_user(reg, argp, 8) || reg[0] > (0x1000 - sizeof(reg[0])) / sizeof(reg[0]))
 				return -EFAULT;
 			write_reg_le32(((u_int *)par->cmap_regs), reg[0], reg[1]);
 			return 0;
 		case FBIMSTT_GETCMAPREG:
-			if (copy_from_user(reg, (void *)arg, 4) || reg[0] > (0x1000 - sizeof(reg[0])) / sizeof(reg[0]))
+			if (copy_from_user(reg, argp, 4) || reg[0] > (0x1000 - sizeof(reg[0])) / sizeof(reg[0]))
 				return -EFAULT;
 			reg[1] = read_reg_le32(((u_int *)par->cmap_regs), reg[0]);
-			if (copy_to_user((void *)(arg + 4), &reg[1], 4))
+			if (copy_to_user((void __user *)(arg + 4), &reg[1], 4))
 				return -EFAULT;
 			return 0;
 		case FBIMSTT_SETIDXREG:
-			if (copy_from_user(idx, (void *)arg, 2))
+			if (copy_from_user(idx, argp, 2))
 				return -EFAULT;
 			par->cmap_regs[PIDXHI] = 0;		eieio();
 			par->cmap_regs[PIDXLO] = idx[0];	eieio();
 			par->cmap_regs[PIDXDATA] = idx[1];	eieio();
 			return 0;
 		case FBIMSTT_GETIDXREG:
-			if (copy_from_user(idx, (void *)arg, 1))
+			if (copy_from_user(idx, argp, 1))
 				return -EFAULT;
 			par->cmap_regs[PIDXHI] = 0;		eieio();
 			par->cmap_regs[PIDXLO] = idx[0];	eieio();
 			idx[1] = par->cmap_regs[PIDXDATA];
-			if (copy_to_user((void *)(arg + 1), &idx[1], 1))
+			if (copy_to_user((void __user *)(arg + 1), &idx[1], 1))
 				return -EFAULT;
 			return 0;
 		default:
diff --git a/drivers/video/kyro/fbdev.c b/drivers/video/kyro/fbdev.c
index aad0ab3ff..ad74caab2 100644
--- a/drivers/video/kyro/fbdev.c
+++ b/drivers/video/kyro/fbdev.c
@@ -84,7 +84,7 @@ typedef struct {
 } device_info_t;
 
 /* global graphics card info structure (one per card) */
-static device_info_t deviceInfo = { 0 };
+static device_info_t deviceInfo;
 
 static char *mode_option __initdata = NULL;
 static int nopan __initdata = 0;
@@ -97,7 +97,6 @@ static int nomtrr __initdata = 0;
 static int kyrofb_probe(struct pci_dev *pdev, const struct pci_device_id *ent);
 static void kyrofb_remove(struct pci_dev *pdev);
 
-#ifndef MODULE
 static struct fb_videomode kyro_modedb[] __initdata = {
 	{
 		/* 640x350 @ 85Hz */
@@ -306,7 +305,6 @@ enum {
 	VMODE_1920_1440_60,
 	VMODE_1920_1440_75,
 };
-#endif
 
 /* Accessors */
 int kyro_dev_video_mode_set(struct fb_info *info)
@@ -592,11 +590,11 @@ static int kyrofb_ioctl(struct inode *inode, struct file *file,
 {
 	overlay_create ol_create;
 	overlay_viewport_set ol_viewport_set;
+	void __user *argp = (void __user *)arg;
 
 	switch (cmd) {
 	case KYRO_IOCTL_OVERLAY_CREATE:
-		copy_from_user((void *) &ol_create, (void *) arg,
-			       sizeof(overlay_create));
+		copy_from_user(&ol_create, argp, sizeof(overlay_create));
 
 		if (kyro_dev_overlay_create(ol_create.ulWidth,
 					    ol_create.ulHeight, 0) < 0) {
@@ -606,7 +604,7 @@ static int kyrofb_ioctl(struct inode *inode, struct file *file,
 		}
 		break;
 	case KYRO_IOCTL_OVERLAY_VIEWPORT_SET:
-		copy_from_user((void *) &ol_viewport_set, (void *) arg,
+		copy_from_user(&ol_viewport_set, argp,
 			       sizeof(overlay_viewport_set));
 
 		if (kyro_dev_overlay_viewport_set(ol_viewport_set.xOrgin,
@@ -627,13 +625,13 @@ static int kyrofb_ioctl(struct inode *inode, struct file *file,
 		}
 		break;
 	case KYRO_IOCTL_UVSTRIDE:
-		copy_to_user((void *)arg, (void *)&deviceInfo.ulOverlayUVStride, sizeof(unsigned long));
+		copy_to_user(argp, &deviceInfo.ulOverlayUVStride, sizeof(unsigned long));
 		break;
 	case KYRO_IOCTL_STRIDE:
-		copy_to_user((void *)arg, (void *)&deviceInfo.ulOverlayStride, sizeof(unsigned long));
+		copy_to_user(argp, &deviceInfo.ulOverlayStride, sizeof(unsigned long));
 		break;
 	case KYRO_IOCTL_OVERLAY_OFFSET:
-		copy_to_user((void *)arg, (void *)&deviceInfo.ulOverlayOffset, sizeof(unsigned long));
+		copy_to_user(argp, &deviceInfo.ulOverlayOffset, sizeof(unsigned long));
 		break;
 	}
 
@@ -722,10 +720,8 @@ static int __devinit kyrofb_probe(struct pci_dev *pdev,
 	deviceInfo.ulOverlayOffset = 0;
 
 	/* This should give a reasonable default video mode */
-#ifndef MODULE
 	if (!fb_find_mode(&info->var, info, mode_option, kyro_modedb,
 			  NUM_TOTAL_MODES, &kyro_modedb[VMODE_1024_768_75], 32))
-#endif
 		info->var = kyro_var;
 
 	fb_alloc_cmap(&info->cmap, 256, 0);
@@ -737,7 +733,7 @@ static int __devinit kyrofb_probe(struct pci_dev *pdev,
 			       info->var.bits_per_pixel);
 	size *= info->var.yres_virtual;
 
-	memset_io((unsigned long)info->screen_base, 0, size);
+	fb_memset(info->screen_base, 0, size);
 
 	if (register_framebuffer(info) < 0)
 		goto out_unmap;
diff --git a/drivers/video/logo/logo.c b/drivers/video/logo/logo.c
index 2dc5b4e92..0ba8d342f 100644
--- a/drivers/video/logo/logo.c
+++ b/drivers/video/logo/logo.c
@@ -11,6 +11,7 @@
 
 #include <linux/config.h>
 #include <linux/linux_logo.h>
+#include <linux/stddef.h>
 
 #ifdef CONFIG_M68K
 #include <asm/setup.h>
@@ -35,7 +36,7 @@ extern const struct linux_logo logo_superh_clut224;
 
 const struct linux_logo *fb_find_logo(int depth)
 {
-	const struct linux_logo *logo = 0;
+	const struct linux_logo *logo = NULL;
 
 	if (depth >= 1) {
 #ifdef CONFIG_LOGO_LINUX_MONO
diff --git a/drivers/video/matrox/matroxfb_base.c b/drivers/video/matrox/matroxfb_base.c
index 88c0aea0a..8074e858c 100644
--- a/drivers/video/matrox/matroxfb_base.c
+++ b/drivers/video/matrox/matroxfb_base.c
@@ -874,6 +874,7 @@ static int matroxfb_ioctl(struct inode *inode, struct file *file,
 			  unsigned int cmd, unsigned long arg,
 			  struct fb_info *info)
 {
+	void __user *argp = (void __user *)arg;
 	MINFO_FROM_INFO(info);
 	
 	DBG(__FUNCTION__)
@@ -891,7 +892,7 @@ static int matroxfb_ioctl(struct inode *inode, struct file *file,
 				err = matroxfb_get_vblank(PMINFO &vblank);
 				if (err)
 					return err;
-				if (copy_to_user((struct fb_vblank*)arg, &vblank, sizeof(vblank)))
+				if (copy_to_user(argp, &vblank, sizeof(vblank)))
 					return -EFAULT;
 				return 0;
 			}
@@ -899,7 +900,7 @@ static int matroxfb_ioctl(struct inode *inode, struct file *file,
 			{
 				u_int32_t crt;
 
-				if (get_user(crt, (u_int32_t *)arg))
+				if (get_user(crt, (u_int32_t __user *)arg))
 					return -EFAULT;
 
 				return matroxfb_wait_for_sync(PMINFO crt);
@@ -910,7 +911,7 @@ static int matroxfb_ioctl(struct inode *inode, struct file *file,
 				struct matrox_altout *oproc;
 				int val;
 
-				if (copy_from_user(&mom, (struct matroxioc_output_mode*)arg, sizeof(mom)))
+				if (copy_from_user(&mom, argp, sizeof(mom)))
 					return -EFAULT;
 				if (mom.output >= MATROXFB_MAX_OUTPUTS)
 					return -ENXIO;
@@ -960,7 +961,7 @@ static int matroxfb_ioctl(struct inode *inode, struct file *file,
 				struct matrox_altout *oproc;
 				int val;
 
-				if (copy_from_user(&mom, (struct matroxioc_output_mode*)arg, sizeof(mom)))
+				if (copy_from_user(&mom, argp, sizeof(mom)))
 					return -EFAULT;
 				if (mom.output >= MATROXFB_MAX_OUTPUTS)
 					return -ENXIO;
@@ -975,7 +976,7 @@ static int matroxfb_ioctl(struct inode *inode, struct file *file,
 				up_read(&ACCESS_FBINFO(altout.lock));
 				if (val)
 					return val;
-				if (copy_to_user((struct matroxioc_output_mode*)arg, &mom, sizeof(mom)))
+				if (copy_to_user(argp, &mom, sizeof(mom)))
 					return -EFAULT;
 				return 0;
 			}
@@ -985,7 +986,7 @@ static int matroxfb_ioctl(struct inode *inode, struct file *file,
 				int i;
 				int changes;
 
-				if (copy_from_user(&tmp, (u_int32_t*)arg, sizeof(tmp)))
+				if (copy_from_user(&tmp, argp, sizeof(tmp)))
 					return -EFAULT;
 				for (i = 0; i < 32; i++) {
 					if (tmp & (1 << i)) {
@@ -1040,7 +1041,7 @@ static int matroxfb_ioctl(struct inode *inode, struct file *file,
 						conn |= 1 << i;
 					}
 				}
-				if (put_user(conn, (u_int32_t*)arg))
+				if (put_user(conn, (u_int32_t __user *)arg))
 					return -EFAULT;
 				return 0;
 			}
@@ -1065,7 +1066,7 @@ static int matroxfb_ioctl(struct inode *inode, struct file *file,
 					if (conn & MATROXFB_OUTPUT_CONN_SECONDARY)
 						conn &= ~MATROXFB_OUTPUT_CONN_DFP;
 				}
-				if (put_user(conn, (u_int32_t*)arg))
+				if (put_user(conn, (u_int32_t __user *)arg))
 					return -EFAULT;
 				return 0;
 			}
@@ -1079,7 +1080,7 @@ static int matroxfb_ioctl(struct inode *inode, struct file *file,
 						conn |= 1 << i;
 					}
 				}
-				if (put_user(conn, (u_int32_t*)arg))
+				if (put_user(conn, (u_int32_t __user *)arg))
 					return -EFAULT;
 				return 0;
 			}
@@ -1093,7 +1094,7 @@ static int matroxfb_ioctl(struct inode *inode, struct file *file,
 				sprintf(r.bus_info, "PCI:%s", pci_name(ACCESS_FBINFO(pcidev)));
 				r.version = KERNEL_VERSION(1,0,0);
 				r.capabilities = V4L2_CAP_VIDEO_OUTPUT;
-				if (copy_to_user((void*)arg, &r, sizeof(r)))
+				if (copy_to_user(argp, &r, sizeof(r)))
 					return -EFAULT;
 				return 0;
 				
@@ -1103,7 +1104,7 @@ static int matroxfb_ioctl(struct inode *inode, struct file *file,
 				struct v4l2_queryctrl qctrl;
 				int err;
 
-				if (copy_from_user(&qctrl, (struct v4l2_queryctrl*)arg, sizeof(qctrl)))
+				if (copy_from_user(&qctrl, argp, sizeof(qctrl)))
 					return -EFAULT;
 
 				down_read(&ACCESS_FBINFO(altout).lock);
@@ -1116,7 +1117,7 @@ static int matroxfb_ioctl(struct inode *inode, struct file *file,
 				}
 				up_read(&ACCESS_FBINFO(altout).lock);
 				if (err >= 0 &&
-				    copy_to_user((struct v4l2_queryctrl*)arg, &qctrl, sizeof(qctrl)))
+				    copy_to_user(argp, &qctrl, sizeof(qctrl)))
 					return -EFAULT;
 				return err;
 			}
@@ -1125,7 +1126,7 @@ static int matroxfb_ioctl(struct inode *inode, struct file *file,
 				struct v4l2_control ctrl;
 				int err;
 
-				if (copy_from_user(&ctrl, (struct v4l2_control*)arg, sizeof(ctrl)))
+				if (copy_from_user(&ctrl, argp, sizeof(ctrl)))
 					return -EFAULT;
 
 				down_read(&ACCESS_FBINFO(altout).lock);
@@ -1138,7 +1139,7 @@ static int matroxfb_ioctl(struct inode *inode, struct file *file,
 				}
 				up_read(&ACCESS_FBINFO(altout).lock);
 				if (err >= 0 &&
-				    copy_to_user((struct v4l2_control*)arg, &ctrl, sizeof(ctrl)))
+				    copy_to_user(argp, &ctrl, sizeof(ctrl)))
 					return -EFAULT;
 				return err;
 			}
@@ -1147,7 +1148,7 @@ static int matroxfb_ioctl(struct inode *inode, struct file *file,
 				struct v4l2_control ctrl;
 				int err;
 
-				if (copy_from_user(&ctrl, (struct v4l2_control*)arg, sizeof(ctrl)))
+				if (copy_from_user(&ctrl, argp, sizeof(ctrl)))
 					return -EFAULT;
 
 				down_read(&ACCESS_FBINFO(altout).lock);
diff --git a/drivers/video/matrox/matroxfb_base.h b/drivers/video/matrox/matroxfb_base.h
index 152dde87c..18938f119 100644
--- a/drivers/video/matrox/matroxfb_base.h
+++ b/drivers/video/matrox/matroxfb_base.h
@@ -217,21 +217,21 @@ static inline void mga_memcpy_toio(vaddr_t va, unsigned int offs, const void* sr
 #ifdef MEMCPYTOIO_WORKS
 	memcpy_toio(va.vaddr + offs, src, len);
 #elif defined(MEMCPYTOIO_WRITEL)
-#define srcd ((const u_int32_t*)src)
 	if (offs & 3) {
 		while (len >= 4) {
-			mga_writel(va, offs, get_unaligned(srcd++));
+			mga_writel(va, offs, get_unaligned((u32 *)src));
 			offs += 4;
 			len -= 4;
+			src += 4;
 		}
 	} else {
 		while (len >= 4) {
-			mga_writel(va, offs, *srcd++);
+			mga_writel(va, offs, *(u32 *)src);
 			offs += 4;
 			len -= 4;
+			src += 4;
 		}
 	}
-#undef srcd
 	if (len) {
 		u_int32_t tmp;
 
diff --git a/drivers/video/matrox/matroxfb_crtc2.c b/drivers/video/matrox/matroxfb_crtc2.c
index d6f393593..0d7e067fe 100644
--- a/drivers/video/matrox/matroxfb_crtc2.c
+++ b/drivers/video/matrox/matroxfb_crtc2.c
@@ -437,7 +437,7 @@ static int matroxfb_dh_ioctl(struct inode* inode,
 				err = matroxfb_dh_get_vblank(m2info, &vblank);
 				if (err)
 					return err;
-				if (copy_to_user((struct fb_vblank*)arg, &vblank, sizeof(vblank)))
+				if (copy_to_user((void __user *)arg, &vblank, sizeof(vblank)))
 					return -EFAULT;
 				return 0;
 			}
@@ -445,7 +445,7 @@ static int matroxfb_dh_ioctl(struct inode* inode,
 			{
 				u_int32_t crt;
 
-				if (get_user(crt, (u_int32_t *)arg))
+				if (get_user(crt, (u_int32_t __user *)arg))
 					return -EFAULT;
 
 				if (crt != 0)
@@ -464,7 +464,7 @@ static int matroxfb_dh_ioctl(struct inode* inode,
 				int out;
 				int changes;
 
-				if (get_user(tmp, (u_int32_t*)arg))
+				if (get_user(tmp, (u_int32_t __user *)arg))
 					return -EFAULT;
 				for (out = 0; out < 32; out++) {
 					if (tmp & (1 << out)) {
@@ -514,7 +514,7 @@ static int matroxfb_dh_ioctl(struct inode* inode,
 						conn |= 1 << out;
 					}
 				}
-				if (put_user(conn, (u_int32_t*)arg))
+				if (put_user(conn, (u_int32_t __user *)arg))
 					return -EFAULT;
 				return 0;
 			}
@@ -539,7 +539,7 @@ static int matroxfb_dh_ioctl(struct inode* inode,
 						tmp = 0;
 					}
 				}
-				if (put_user(tmp, (u_int32_t*)arg))
+				if (put_user(tmp, (u_int32_t __user *)arg))
 					return -EFAULT;
 				return 0;
 			}
diff --git a/drivers/video/modedb.c b/drivers/video/modedb.c
index cd157349c..d046edf1e 100644
--- a/drivers/video/modedb.c
+++ b/drivers/video/modedb.c
@@ -490,6 +490,7 @@ int fb_find_mode(struct fb_var_screeninfo *var,
 	int res_specified = 0, bpp_specified = 0, refresh_specified = 0;
 	unsigned int xres = 0, yres = 0, bpp = default_bpp, refresh = 0;
 	int yres_specified = 0;
+	u32 best = -1, diff = -1;
 
 	for (i = namelen-1; i >= 0; i--) {
 	    switch (name[i]) {
@@ -529,8 +530,8 @@ int fb_find_mode(struct fb_var_screeninfo *var,
 	}
 done:
 	for (i = refresh_specified; i >= 0; i--) {
-	    DPRINTK("Trying specified video mode%s\n",
-		    i ? "" : " (ignoring refresh rate)");
+	    DPRINTK("Trying specified video mode%s %ix%i\n",
+		    i ? "" : " (ignoring refresh rate)", xres, yres);
 	    for (j = 0; j < dbsize; j++)
 		if ((name_matches(db[j], name, namelen) ||
 		     (res_specified && res_matches(db[j], xres, yres))) &&
@@ -538,6 +539,22 @@ done:
 		    !fb_try_mode(var, info, &db[j], bpp))
 		    return 2-i;
 	}
+	DPRINTK("Trying best-fit modes\n");
+	for (i = 0; i < dbsize; i++) {
+	    if (xres <= db[i].xres && yres <= db[i].yres) {
+		DPRINTK("Trying %ix%i\n", db[i].xres, db[i].yres);
+		if (!fb_try_mode(var, info, &db[i], bpp)) {
+		    if (diff > (db[i].xres - xres) + (db[i].yres - yres)) {
+			diff = (db[i].xres - xres) + (db[i].yres - yres);
+			best = i;
+		    }
+		}
+	    }
+	}
+	if (best != -1) {
+	    fb_try_mode(var, info, &db[best], bpp);
+	    return 5;
+	}
     }
 
     DPRINTK("Trying default video mode\n");
diff --git a/drivers/video/offb.c b/drivers/video/offb.c
index e1715ef97..99c2e6322 100644
--- a/drivers/video/offb.c
+++ b/drivers/video/offb.c
@@ -235,7 +235,7 @@ static int offb_blank(int blank, struct fb_info *info)
 				break;
 			}
 	} else
-		fb_set_cmap(&info->cmap, 1, info);
+		fb_set_cmap(&info->cmap, info);
 	return 0;
 }
 
diff --git a/drivers/video/pxafb.c b/drivers/video/pxafb.c
index bfa3f8b58..0a860dd88 100644
--- a/drivers/video/pxafb.c
+++ b/drivers/video/pxafb.c
@@ -42,7 +42,6 @@
 #include <asm/hardware.h>
 #include <asm/io.h>
 #include <asm/irq.h>
-#include <asm/mach-types.h>
 #include <asm/uaccess.h>
 #include <asm/arch/bitfield.h>
 #include <asm/arch/pxafb.h>
@@ -109,10 +108,13 @@ pxafb_setpalettereg(u_int regno, u_int red, u_int green, u_int blue,
 	u_int val, ret = 1;
 
 	if (regno < fbi->palette_size) {
-		val  = ((red   >>  0) & 0xf800);
-		val |= ((green >>  5) & 0x07e0);
-		val |= ((blue  >> 11) & 0x001f);
-
+		if (fbi->fb.var.grayscale) {
+			val = ((blue >> 8) & 0x00ff);
+		} else {
+			val  = ((red   >>  0) & 0xf800);
+			val |= ((green >>  5) & 0x07e0);
+			val |= ((blue  >> 11) & 0x001f);
+		}
 		fbi->palette_cpu[regno] = val;
 		ret = 0;
 	}
@@ -150,7 +152,7 @@ pxafb_setcolreg(u_int regno, u_int red, u_int green, u_int blue,
 	switch (fbi->fb.fix.visual) {
 	case FB_VISUAL_TRUECOLOR:
 		/*
-		 * 12 or 16-bit True Colour.  We encode the RGB value
+		 * 16-bit True Colour.  We encode the RGB value
 		 * according to the RGB bitfield information.
 		 */
 		if (regno < 16) {
@@ -242,7 +244,7 @@ static int pxafb_check_var(struct fb_var_screeninfo *var, struct fb_info *info)
 	 * The pixel packing format is described on page 7-11 of the
 	 * PXA2XX Developer's Manual.
          */
-	if ( var->bits_per_pixel == 16 ) {
+	if (var->bits_per_pixel == 16) {
 		var->red.offset   = 11; var->red.length   = 5;
 		var->green.offset = 5;  var->green.length = 6;
 		var->blue.offset  = 0;  var->blue.length  = 5;
@@ -297,7 +299,10 @@ static int pxafb_set_par(struct fb_info *info)
 
 	fbi->fb.fix.line_length = var->xres_virtual *
 				  var->bits_per_pixel / 8;
-	fbi->palette_size = var->bits_per_pixel == 8 ? 256 : 16;
+	if (var->bits_per_pixel == 16)
+		fbi->palette_size = 0;
+	else
+		fbi->palette_size = var->bits_per_pixel == 1 ? 4 : 1 << var->bits_per_pixel;
 
 	palette_mem_size = fbi->palette_size * sizeof(u16);
 
@@ -311,6 +316,11 @@ static int pxafb_set_par(struct fb_info *info)
 	 */
 	pxafb_set_truecolor(fbi->fb.fix.visual == FB_VISUAL_TRUECOLOR);
 
+	if (fbi->fb.var.bits_per_pixel == 16)
+		fb_dealloc_cmap(&fbi->fb.cmap);
+	else
+		fb_alloc_cmap(&fbi->fb.cmap, 1<<fbi->fb.var.bits_per_pixel, 0);
+
 	pxafb_activate_var(var, fbi);
 
 	return 0;
@@ -349,7 +359,7 @@ static int pxafb_set_par(struct fb_info *info)
 /*
  * pxafb_blank():
  *	Blank the display by setting all palette values to zero.  Note, the
- * 	12 and 16 bpp modes don't really use the palette, so this will not
+ * 	16 bpp mode does not really use the palette, so this will not
  *      blank the display in all modes.
  */
 static int pxafb_blank(int blank, struct fb_info *info)
@@ -376,7 +386,7 @@ static int pxafb_blank(int blank, struct fb_info *info)
 		//TODO if (pxafb_blank_helper) pxafb_blank_helper(blank);
 		if (fbi->fb.fix.visual == FB_VISUAL_PSEUDOCOLOR ||
 		    fbi->fb.fix.visual == FB_VISUAL_STATIC_PSEUDOCOLOR)
-			fb_set_cmap(&fbi->fb.cmap, 1, info);
+			fb_set_cmap(&fbi->fb.cmap, info);
 		pxafb_schedule_work(fbi, C_ENABLE);
 	}
 	return 0;
@@ -514,7 +524,7 @@ static int pxafb_activate_var(struct fb_var_screeninfo *var, struct pxafb_info *
 	 * the YRES parameter.
 	 */
 	lines_per_panel = var->yres;
-	if (fbi->lccr0 & LCCR0_SDS)
+	if ((fbi->lccr0 & LCCR0_SDS) == LCCR0_Dual)
 		lines_per_panel /= 2;
 
 	new_regs.lccr2 =
@@ -566,20 +576,16 @@ static int pxafb_activate_var(struct fb_var_screeninfo *var, struct pxafb_info *
 	fbi->dmadesc_palette_cpu->fidr  = 0;
 	fbi->dmadesc_palette_cpu->ldcmd = (fbi->palette_size * 2) | LDCMD_PAL;
 
-	if( var->bits_per_pixel < 12)
-	{
-		/* assume any mode with <12 bpp is palette driven */
-		fbi->dmadesc_palette_cpu->fdadr = fbi->dmadesc_fbhigh_dma;
-		fbi->dmadesc_fbhigh_cpu->fdadr = fbi->dmadesc_palette_dma;
-		fbi->fdadr0 = fbi->dmadesc_palette_dma; /* flips back and forth between pal and fbhigh */
-	}
-	else
-	{
+	if (var->bits_per_pixel == 16) {
 		/* palette shouldn't be loaded in true-color mode */
 		fbi->dmadesc_fbhigh_cpu->fdadr = fbi->dmadesc_fbhigh_dma;
 		fbi->fdadr0 = fbi->dmadesc_fbhigh_dma; /* no pal just fbhigh */
 		/* init it to something, even though we won't be using it */
 		fbi->dmadesc_palette_cpu->fdadr = fbi->dmadesc_palette_dma;
+	} else {
+		fbi->dmadesc_palette_cpu->fdadr = fbi->dmadesc_fbhigh_dma;
+		fbi->dmadesc_fbhigh_cpu->fdadr = fbi->dmadesc_palette_dma;
+		fbi->fdadr0 = fbi->dmadesc_palette_dma; /* flips back and forth between pal and fbhigh */
 	}
 
 #if 0
@@ -696,7 +702,7 @@ static void pxafb_setup_gpio(struct pxafb_info *fbi)
 	}
 
 	else {
-	        printk( KERN_ERR "pxafb_setup_gpio: unable to determine bits per pixel\n");
+	        printk(KERN_ERR "pxafb_setup_gpio: unable to determine bits per pixel\n");
         }
 }
 
@@ -1010,7 +1016,7 @@ static struct pxafb_info * __init pxafb_init_fbinfo(struct device *dev)
 	struct pxafb_mach_info *inf = dev->platform_data;
 
 	/* Alloc the pxafb_info and pseudo_palette in one step */
-	fbi = kmalloc(sizeof(struct pxafb_info) + sizeof(u32) * 17, GFP_KERNEL);
+	fbi = kmalloc(sizeof(struct pxafb_info) + sizeof(u32) * 16, GFP_KERNEL);
 	if (!fbi)
 		return NULL;
 
@@ -1123,11 +1129,11 @@ static int __init pxafb_parse_options(struct device *dev, char *options)
 				res_specified = 1;
 			}
 		done:
-			if ( res_specified ) {
-				dev_info(dev, "overriding resolution: %dx%x\n", xres, yres);
+			if (res_specified) {
+				dev_info(dev, "overriding resolution: %dx%d\n", xres, yres);
 				inf->xres = xres; inf->yres = yres;
 			}
-			if ( bpp_specified )
+			if (bpp_specified)
 				switch (bpp) {
 				case 1:
 				case 2:
@@ -1142,7 +1148,7 @@ static int __init pxafb_parse_options(struct device *dev, char *options)
 				}
                 } else if (!strncmp(this_opt, "pixclock:", 9)) {
                         inf->pixclock = simple_strtoul(this_opt+9, NULL, 0);
-			dev_info(dev, "override pixclock: %u\n", inf->pixclock);
+			dev_info(dev, "override pixclock: %ld\n", inf->pixclock);
                 } else if (!strncmp(this_opt, "left:", 5)) {
                         inf->left_margin = simple_strtoul(this_opt+5, NULL, 0);
 			dev_info(dev, "override left: %u\n", inf->left_margin);
@@ -1162,7 +1168,7 @@ static int __init pxafb_parse_options(struct device *dev, char *options)
                         inf->vsync_len = simple_strtoul(this_opt+9, NULL, 0);
 			dev_info(dev, "override vsynclen: %u\n", inf->vsync_len);
                 } else if (!strncmp(this_opt, "hsync:", 6)) {
-                        if ( simple_strtoul(this_opt+6, NULL, 0) == 0 ) {
+                        if (simple_strtoul(this_opt+6, NULL, 0) == 0) {
 				dev_info(dev, "override hsync: Active Low\n");
 				inf->sync &= ~FB_SYNC_HOR_HIGH_ACT;
 			} else {
@@ -1170,7 +1176,7 @@ static int __init pxafb_parse_options(struct device *dev, char *options)
 				inf->sync |= FB_SYNC_HOR_HIGH_ACT;
 			}
                 } else if (!strncmp(this_opt, "vsync:", 6)) {
-                        if ( simple_strtoul(this_opt+6, NULL, 0) == 0 ) {
+                        if (simple_strtoul(this_opt+6, NULL, 0) == 0) {
 				dev_info(dev, "override vsync: Active Low\n");
 				inf->sync &= ~FB_SYNC_VERT_HIGH_ACT;
 			} else {
@@ -1178,7 +1184,7 @@ static int __init pxafb_parse_options(struct device *dev, char *options)
 				inf->sync |= FB_SYNC_VERT_HIGH_ACT;
 			}
                 } else if (!strncmp(this_opt, "dpc:", 4)) {
-                        if ( simple_strtoul(this_opt+4, NULL, 0) == 0 ) {
+                        if (simple_strtoul(this_opt+4, NULL, 0) == 0) {
 				dev_info(dev, "override double pixel clock: false\n");
 				inf->lccr3 &= ~LCCR3_DPC;
 			} else {
@@ -1186,20 +1192,20 @@ static int __init pxafb_parse_options(struct device *dev, char *options)
 				inf->lccr3 |= LCCR3_DPC;
 			}
                 } else if (!strncmp(this_opt, "outputen:", 9)) {
-                        if ( simple_strtoul(this_opt+9, NULL, 0) == 0 ) {
+                        if (simple_strtoul(this_opt+9, NULL, 0) == 0) {
 				dev_info(dev, "override output enable: active low\n");
-				inf->lccr3 = ( inf->lccr3 & ~LCCR3_OEP ) | LCCR3_OutEnL;
+				inf->lccr3 = (inf->lccr3 & ~LCCR3_OEP) | LCCR3_OutEnL;
 			} else {
 				dev_info(dev, "override output enable: active high\n");
-				inf->lccr3 = ( inf->lccr3 & ~LCCR3_OEP ) | LCCR3_OutEnH;
+				inf->lccr3 = (inf->lccr3 & ~LCCR3_OEP) | LCCR3_OutEnH;
 			}
                 } else if (!strncmp(this_opt, "pixclockpol:", 12)) {
-                        if ( simple_strtoul(this_opt+12, NULL, 0) == 0 ) {
+                        if (simple_strtoul(this_opt+12, NULL, 0) == 0) {
 				dev_info(dev, "override pixel clock polarity: falling edge\n");
-				inf->lccr3 = ( inf->lccr3 & ~LCCR3_PCP ) | LCCR3_PixFlEdg;
+				inf->lccr3 = (inf->lccr3 & ~LCCR3_PCP) | LCCR3_PixFlEdg;
 			} else {
 				dev_info(dev, "override pixel clock polarity: rising edge\n");
-				inf->lccr3 = ( inf->lccr3 & ~LCCR3_PCP ) | LCCR3_PixRsEdg;
+				inf->lccr3 = (inf->lccr3 & ~LCCR3_PCP) | LCCR3_PixRsEdg;
 			}
                 } else if (!strncmp(this_opt, "color", 5)) {
 			inf->lccr0 = (inf->lccr0 & ~LCCR0_CMS) | LCCR0_Color;
@@ -1231,7 +1237,6 @@ int __init pxafb_probe(struct device *dev)
 {
 	struct pxafb_info *fbi;
 	struct pxafb_mach_info *inf;
-	unsigned long flags;
 	int ret;
 
 	dev_dbg(dev, "pxafb_probe\n");
@@ -1244,7 +1249,7 @@ int __init pxafb_probe(struct device *dev)
 
 #ifdef CONFIG_FB_PXA_PARAMETERS
 	ret = pxafb_parse_options(dev, g_options);
-	if ( ret < 0 )
+	if (ret < 0)
 		goto failed;
 #endif
 
@@ -1252,23 +1257,23 @@ int __init pxafb_probe(struct device *dev)
         /* Check for various illegal bit-combinations. Currently only
 	 * a warning is given. */
 
-        if ( inf->lccr0 & LCCR0_INVALID_CONFIG_MASK )
+        if (inf->lccr0 & LCCR0_INVALID_CONFIG_MASK)
                 dev_warn(dev, "machine LCCR0 setting contains illegal bits: %08x\n",
                         inf->lccr0 & LCCR0_INVALID_CONFIG_MASK);
-        if ( inf->lccr3 & LCCR3_INVALID_CONFIG_MASK )
+        if (inf->lccr3 & LCCR3_INVALID_CONFIG_MASK)
                 dev_warn(dev, "machine LCCR3 setting contains illegal bits: %08x\n",
                         inf->lccr3 & LCCR3_INVALID_CONFIG_MASK);
-        if ( inf->lccr0 & LCCR0_DPD &&
-             ( ( inf->lccr0 & LCCR0_PAS ) != LCCR0_Pas ||
-               ( inf->lccr0 & LCCR0_SDS ) != LCCR0_Sngl ||
-               ( inf->lccr0 & LCCR0_CMS ) != LCCR0_Mono ) )
+        if (inf->lccr0 & LCCR0_DPD &&
+	    ((inf->lccr0 & LCCR0_PAS) != LCCR0_Pas ||
+	     (inf->lccr0 & LCCR0_SDS) != LCCR0_Sngl ||
+	     (inf->lccr0 & LCCR0_CMS) != LCCR0_Mono))
                 dev_warn(dev, "Double Pixel Data (DPD) mode is only valid in passive mono"
 			 " single panel mode\n");
-        if ( (inf->lccr0 & LCCR0_PAS) == LCCR0_Act &&
-             ( inf->lccr0 & LCCR0_SDS ) == LCCR0_Dual )
+        if ((inf->lccr0 & LCCR0_PAS) == LCCR0_Act &&
+	    (inf->lccr0 & LCCR0_SDS) == LCCR0_Dual)
                 dev_warn(dev, "Dual panel only valid in passive mode\n");
-        if ( (inf->lccr0 & LCCR0_PAS ) == LCCR0_Pas &&
-             (inf->upper_margin || inf->lower_margin) )
+        if ((inf->lccr0 & LCCR0_PAS) == LCCR0_Pas &&
+             (inf->upper_margin || inf->lower_margin))
                 dev_warn(dev, "Upper and lower margins must be 0 in passive mode\n");
 #endif
 
@@ -1295,9 +1300,7 @@ int __init pxafb_probe(struct device *dev)
 		goto failed;
 	}
 	/* enable LCD controller clock */
-	local_irq_save(flags);
-	CKEN |= CKEN16_LCD;
-	local_irq_restore(flags);
+	pxa_set_cken(CKEN16_LCD, 1);
 
 	ret = request_irq(IRQ_LCD, pxafb_handle_irq, SA_INTERRUPT, "LCD", fbi);
 	if (ret) {
@@ -1347,7 +1350,7 @@ failed:
 }
 
 static struct device_driver pxafb_driver = {
-	.name		= "pxafb",
+	.name		= "pxa2xx-fb",
 	.bus		= &platform_bus_type,
 	.probe		= pxafb_probe,
 #ifdef CONFIG_PM
diff --git a/drivers/video/radeonfb.c b/drivers/video/radeonfb.c
index 9f258b07d..1f3f23f3c 100644
--- a/drivers/video/radeonfb.c
+++ b/drivers/video/radeonfb.c
@@ -1221,7 +1221,7 @@ static int radeon_read_OF (struct radeonfb_info *rinfo)
 
 	dp = pci_device_to_OF_node(rinfo->pdev);
 
-	xtal = (unsigned int *) get_property(dp, "ATY,RefCLK", 0);
+	xtal = (unsigned int *) get_property(dp, "ATY,RefCLK", NULL);
 
 	rinfo->pll.ref_clk = *xtal / 10;
 
@@ -1544,7 +1544,7 @@ static int radeonfb_ioctl (struct inode *inode, struct file *file, unsigned int
 					break;
 			}
 
-			rc = get_user(value, (__u32*)arg);
+			rc = get_user(value, (__u32 __user *)arg);
 
 			if (rc)
 				return rc;
@@ -1598,7 +1598,7 @@ static int radeonfb_ioctl (struct inode *inode, struct file *file, unsigned int
 			if (CRTC_CRT_ON & tmp)
 				value |= 0x02;
 
-			return put_user(value, (__u32*)arg);
+			return put_user(value, (__u32 __user *)arg);
 		default:
 			return -EINVAL;
 	}
diff --git a/drivers/video/riva/Makefile b/drivers/video/riva/Makefile
index f5a4db78f..8898c9915 100644
--- a/drivers/video/riva/Makefile
+++ b/drivers/video/riva/Makefile
@@ -2,6 +2,10 @@
 # Makefile for the Riva framebuffer driver
 #
 
-obj-$(CONFIG_FB_RIVA) += rivafb.o
+obj-$(CONFIG_FB_RIVA)     += rivafb.o
 
-rivafb-objs := fbdev.o riva_hw.o nv_driver.o
+rivafb-objs               := fbdev.o riva_hw.o nv_driver.o
+
+ifdef CONFIG_FB_RIVA_I2C
+	rivafb-objs       += rivafb-i2c.o
+endif
diff --git a/drivers/video/riva/fbdev.c b/drivers/video/riva/fbdev.c
index 1df67bcbc..fec702460 100644
--- a/drivers/video/riva/fbdev.c
+++ b/drivers/video/riva/fbdev.c
@@ -48,6 +48,9 @@
 #include <asm/prom.h>
 #include <asm/pci-bridge.h>
 #endif
+#ifdef CONFIG_PMAC_BACKLIGHT
+#include <asm/backlight.h>
+#endif
 
 #include "rivafb.h"
 #include "nvreg.h"
@@ -64,15 +67,16 @@
  * various helpful macros and constants
  *
  * ------------------------------------------------------------------------- */
-
-#undef RIVAFBDEBUG
-#ifdef RIVAFBDEBUG
-#define DPRINTK(fmt, args...) printk(KERN_DEBUG "%s: " fmt, __FUNCTION__ , ## args)
+#ifdef CONFIG_FB_RIVA_DEBUG
+#define NVTRACE          printk
 #else
-#define DPRINTK(fmt, args...)
+#define NVTRACE          if(0) printk
 #endif
 
-#ifndef RIVA_NDEBUG
+#define NVTRACE_ENTER(...)  NVTRACE("%s START\n", __FUNCTION__)
+#define NVTRACE_LEAVE(...)  NVTRACE("%s END\n", __FUNCTION__)
+
+#ifdef CONFIG_FB_RIVA_DEBUG
 #define assert(expr) \
 	if(!(expr)) { \
 	printk( "Assertion failed! %s,%s,%s,line=%d\n",\
@@ -173,18 +177,18 @@ static struct riva_chip_info {
 	{ "GeForce2-GTS", NV_ARCH_10 },
 	{ "GeForce2-ULTRA", NV_ARCH_10 },
 	{ "Quadro2-PRO", NV_ARCH_10 },
-	{ "GeForce4-MX-460", NV_ARCH_20 },
-	{ "GeForce4-MX-440", NV_ARCH_20 },
-	{ "GeForce4-MX-420", NV_ARCH_20 },
-	{ "GeForce4-440-GO", NV_ARCH_20 },
-	{ "GeForce4-420-GO", NV_ARCH_20 },
-	{ "GeForce4-420-GO-M32", NV_ARCH_20 },
-	{ "Quadro4-500-XGL", NV_ARCH_20 },
-	{ "GeForce4-440-GO-M64", NV_ARCH_20 },
-	{ "Quadro4-200", NV_ARCH_20 },
-	{ "Quadro4-550-XGL", NV_ARCH_20 },
-	{ "Quadro4-500-GOGL", NV_ARCH_20 },
-	{ "GeForce2", NV_ARCH_20 },
+	{ "GeForce4-MX-460", NV_ARCH_10 },
+	{ "GeForce4-MX-440", NV_ARCH_10 },
+	{ "GeForce4-MX-420", NV_ARCH_10 },
+	{ "GeForce4-440-GO", NV_ARCH_10 },
+	{ "GeForce4-420-GO", NV_ARCH_10 },
+	{ "GeForce4-420-GO-M32", NV_ARCH_10 },
+	{ "Quadro4-500-XGL", NV_ARCH_10 },
+	{ "GeForce4-440-GO-M64", NV_ARCH_10 },
+	{ "Quadro4-200", NV_ARCH_10 },
+	{ "Quadro4-550-XGL", NV_ARCH_10 },
+	{ "Quadro4-500-GOGL", NV_ARCH_10 },
+	{ "GeForce2", NV_ARCH_10 },
 	{ "GeForce3", NV_ARCH_20 }, 
 	{ "GeForce3 Ti 200", NV_ARCH_20 },
 	{ "GeForce3 Ti 500", NV_ARCH_20 },
@@ -296,9 +300,8 @@ static int forceCRTC __initdata = -1;
 static int nomtrr __initdata = 0;
 #endif
 
-#ifndef MODULE
 static char *mode_option __initdata = NULL;
-#endif
+static int  strictmode       = 0;
 
 static struct fb_fix_screeninfo rivafb_fix = {
 	.id		= "nVidia",
@@ -352,6 +355,38 @@ static const struct riva_regs reg_template = {
 	0xEB							/* MISC */
 };
 
+/*
+ * Backlight control
+ */
+#ifdef CONFIG_PMAC_BACKLIGHT
+
+static int riva_backlight_levels[] = {
+    0x158,
+    0x192,
+    0x1c6,
+    0x200,
+    0x234,
+    0x268,
+    0x2a2,
+    0x2d6,
+    0x310,
+    0x344,
+    0x378,
+    0x3b2,
+    0x3e6,
+    0x41a,
+    0x454,
+    0x534,
+};
+
+static int riva_set_backlight_enable(int on, int level, void *data);
+static int riva_set_backlight_level(int level, void *data);
+static struct backlight_controller riva_backlight_controller = {
+	riva_set_backlight_enable,
+	riva_set_backlight_level
+};
+#endif /* CONFIG_PMAC_BACKLIGHT */
+
 /* ------------------------------------------------------------------------- *
  *
  * MMIO access macros
@@ -493,54 +528,30 @@ static inline void reverse_order(u32 *l)
  * rivafb_cursor()
  */
 static void rivafb_load_cursor_image(struct riva_par *par, u8 *data8,
-				     u8 *mask8, u16 bg, u16 fg, u32 w, u32 h)
+				     u16 bg, u16 fg, u32 w, u32 h)
 {
 	int i, j, k = 0;
-	u32 b, m, tmp;
+	u32 b, tmp;
 	u32 *data = (u32 *)data8;
-	u32 *mask = (u32 *)mask8;
 
 	for (i = 0; i < h; i++) {
 		b = *data++;
-		m = *mask++;
 		reverse_order(&b);
 		
 		for (j = 0; j < w/2; j++) {
 			tmp = 0;
 #if defined (__BIG_ENDIAN)
-			if (m & (1 << 31)) {
-				fg |= 1 << 15;
-				bg |= 1 << 15;
-			}
 			tmp = (b & (1 << 31)) ? fg << 16 : bg << 16;
 			b <<= 1;
-			m <<= 1;
-
-			if (m & (1 << 31)) {
-				fg |= 1 << 15;
-				bg |= 1 << 15;
-			}
 			tmp |= (b & (1 << 31)) ? fg : bg;
 			b <<= 1;
-			m <<= 1;
 #else
-			if (m & 1) {
-				fg |= 1 << 15;
-				bg |= 1 << 15;
-			}
 			tmp = (b & 1) ? fg : bg;
 			b >>= 1;
-			m >>= 1;
-			
-			if (m & 1) {
-				fg |= 1 << 15;
-				bg |= 1 << 15;
-			}
 			tmp |= (b & 1) ? fg << 16 : bg << 16;
 			b >>= 1;
-			m >>= 1;
 #endif
-			writel(tmp, par->riva.CURSOR + k++);
+			writel(tmp, &par->riva.CURSOR[k++]);
 		}
 		k += (MAX_CURS - w)/2;
 	}
@@ -617,6 +628,7 @@ static void riva_save_state(struct riva_par *par, struct riva_regs *regs)
 {
 	int i;
 
+	NVTRACE_ENTER();
 	par->riva.LockUnlock(&par->riva, 0);
 
 	par->riva.UnloadStateExt(&par->riva, &regs->ext);
@@ -634,6 +646,7 @@ static void riva_save_state(struct riva_par *par, struct riva_regs *regs)
 
 	for (i = 0; i < NUM_SEQ_REGS; i++)
 		regs->seq[i] = SEQin(par, i);
+	NVTRACE_LEAVE();
 }
 
 /**
@@ -655,6 +668,7 @@ static void riva_load_state(struct riva_par *par, struct riva_regs *regs)
 	RIVA_HW_STATE *state = &regs->ext;
 	int i;
 
+	NVTRACE_ENTER();
 	CRTCout(par, 0x11, 0x00);
 
 	par->riva.LockUnlock(&par->riva, 0);
@@ -681,6 +695,7 @@ static void riva_load_state(struct riva_par *par, struct riva_regs *regs)
 
 	for (i = 0; i < NUM_SEQ_REGS; i++)
 		SEQout(par, i, regs->seq[i]);
+	NVTRACE_LEAVE();
 }
 
 /**
@@ -701,6 +716,7 @@ static void riva_load_video_mode(struct fb_info *info)
 	struct riva_par *par = (struct riva_par *) info->par;
 	struct riva_regs newmode;
 	
+	NVTRACE_ENTER();
 	/* time to calculate */
 	rivafb_blank(1, info);
 
@@ -831,6 +847,27 @@ static void riva_load_video_mode(struct fb_info *info)
 	riva_load_state(par, &par->current_state);
 	par->riva.LockUnlock(&par->riva, 0); /* important for HW cursor */
 	rivafb_blank(0, info);
+	NVTRACE_LEAVE();
+}
+
+static void riva_update_var(struct fb_var_screeninfo *var, struct fb_videomode *modedb)
+{
+	NVTRACE_ENTER();
+	var->xres = var->xres_virtual = modedb->xres;
+	var->yres = modedb->yres;
+        if (var->yres_virtual < var->yres)
+	    var->yres_virtual = var->yres;
+        var->xoffset = var->yoffset = 0;
+        var->pixclock = modedb->pixclock;
+        var->left_margin = modedb->left_margin;
+        var->right_margin = modedb->right_margin;
+        var->upper_margin = modedb->upper_margin;
+        var->lower_margin = modedb->lower_margin;
+        var->hsync_len = modedb->hsync_len;
+        var->vsync_len = modedb->vsync_len;
+        var->sync = modedb->sync;
+        var->vmode = modedb->vmode;
+	NVTRACE_LEAVE();
 }
 
 /**
@@ -866,19 +903,20 @@ static int rivafb_do_maximize(struct fb_info *info,
 	};
 	int i;
 
+	NVTRACE_ENTER();
 	/* use highest possible virtual resolution */
 	if (var->xres_virtual == -1 && var->yres_virtual == -1) {
 		printk(KERN_WARNING PFX
 		       "using maximum available virtual resolution\n");
 		for (i = 0; modes[i].xres != -1; i++) {
 			if (modes[i].xres * nom / den * modes[i].yres <
-			    info->fix.smem_len / 2)
+			    info->fix.smem_len)
 				break;
 		}
 		if (modes[i].xres == -1) {
 			printk(KERN_ERR PFX
 			       "could not find a virtual resolution that fits into video memory!!\n");
-			DPRINTK("EXIT - EINVAL error\n");
+			NVTRACE("EXIT - EINVAL error\n");
 			return -EINVAL;
 		}
 		var->xres_virtual = modes[i].xres;
@@ -889,13 +927,13 @@ static int rivafb_do_maximize(struct fb_info *info,
 		       var->xres_virtual, var->yres_virtual);
 	} else if (var->xres_virtual == -1) {
 		var->xres_virtual = (info->fix.smem_len * den /
-			(nom * var->yres_virtual * 2)) & ~15;
+			(nom * var->yres_virtual)) & ~15;
 		printk(KERN_WARNING PFX
 		       "setting virtual X resolution to %d\n", var->xres_virtual);
 	} else if (var->yres_virtual == -1) {
 		var->xres_virtual = (var->xres_virtual + 15) & ~15;
 		var->yres_virtual = info->fix.smem_len * den /
-			(nom * var->xres_virtual * 2);
+			(nom * var->xres_virtual);
 		printk(KERN_WARNING PFX
 		       "setting virtual Y resolution to %d\n", var->yres_virtual);
 	} else {
@@ -904,7 +942,7 @@ static int rivafb_do_maximize(struct fb_info *info,
 			printk(KERN_ERR PFX
 			       "mode %dx%dx%d rejected...resolution too high to fit into video memory!\n",
 			       var->xres, var->yres, var->bits_per_pixel);
-			DPRINTK("EXIT - EINVAL error\n");
+			NVTRACE("EXIT - EINVAL error\n");
 			return -EINVAL;
 		}
 	}
@@ -927,35 +965,51 @@ static int rivafb_do_maximize(struct fb_info *info,
 		       "virtual Y resolution (%d) is smaller than real\n", var->yres_virtual);
 		return -EINVAL;
 	}
+	if (var->yres_virtual > 0x7fff/nom)
+		var->yres_virtual = 0x7fff/nom;
+	if (var->xres_virtual > 0x7fff/nom)
+		var->xres_virtual = 0x7fff/nom;
+	NVTRACE_LEAVE();
 	return 0;
 }
 
+static void
+riva_set_pattern(struct riva_par *par, int clr0, int clr1, int pat0, int pat1)
+{
+	RIVA_FIFO_FREE(par->riva, Patt, 4);
+	par->riva.Patt->Color0        = clr0;
+	par->riva.Patt->Color1        = clr1;
+	par->riva.Patt->Monochrome[0] = pat0;
+	par->riva.Patt->Monochrome[1] = pat1;
+}
+
 /* acceleration routines */
 inline void wait_for_idle(struct riva_par *par)
 {
 	while (par->riva.Busy(&par->riva));
 }
 
-/* set copy ROP, no mask */
-static void riva_setup_ROP(struct riva_par *par)
+/*
+ * Set ROP.  Translate X rop into ROP3.  Internal routine.
+ */
+static void
+riva_set_rop_solid(struct riva_par *par, int rop)
 {
-	RIVA_FIFO_FREE(par->riva, Patt, 5);
-	par->riva.Patt->Shape = 0;
-	par->riva.Patt->Color0 = 0xffffffff;
-	par->riva.Patt->Color1 = 0xffffffff;
-	par->riva.Patt->Monochrome[0] = 0xffffffff;
-	par->riva.Patt->Monochrome[1] = 0xffffffff;
-
-	RIVA_FIFO_FREE(par->riva, Rop, 1);
-	par->riva.Rop->Rop3 = 0xCC;
+	riva_set_pattern(par, 0xFFFFFFFF, 0xFFFFFFFF, 0xFFFFFFFF, 0xFFFFFFFF);
+        RIVA_FIFO_FREE(par->riva, Rop, 1);
+        par->riva.Rop->Rop3 = rop;
+
 }
 
-void riva_setup_accel(struct riva_par *par)
+void riva_setup_accel(struct fb_info *info)
 {
+	struct riva_par *par = (struct riva_par *) info->par;
+
 	RIVA_FIFO_FREE(par->riva, Clip, 2);
 	par->riva.Clip->TopLeft     = 0x0;
-	par->riva.Clip->WidthHeight = 0x80008000;
-	riva_setup_ROP(par);
+	par->riva.Clip->WidthHeight = (info->var.xres_virtual & 0xffff) |
+		(info->var.yres_virtual << 16);
+	riva_set_rop_solid(par, 0xcc);
 	wait_for_idle(par);
 }
 
@@ -993,6 +1047,36 @@ static int riva_get_cmap_len(const struct fb_var_screeninfo *var)
 	return rc;
 }
 
+/* ------------------------------------------------------------------------- *
+ *
+ * Backlight operations
+ *
+ * ------------------------------------------------------------------------- */
+
+#ifdef CONFIG_PMAC_BACKLIGHT
+static int riva_set_backlight_enable(int on, int level, void *data)
+{
+	struct riva_par *par = (struct riva_par *)data;
+	U032 tmp_pcrt, tmp_pmc;
+
+	tmp_pmc = par->riva.PMC[0x10F0/4] & 0x0000FFFF;
+	tmp_pcrt = par->riva.PCRTC0[0x081C/4] & 0xFFFFFFFC;
+	if(on && (level > BACKLIGHT_OFF)) {
+		tmp_pcrt |= 0x1;
+		tmp_pmc |= (1 << 31); // backlight bit
+		tmp_pmc |= riva_backlight_levels[level-1] << 16; // level
+	}
+	par->riva.PCRTC0[0x081C/4] = tmp_pcrt;
+	par->riva.PMC[0x10F0/4] = tmp_pmc;
+	return 0;
+}
+
+static int riva_set_backlight_level(int level, void *data)
+{
+	return riva_set_backlight_enable(1, level, data);
+}
+#endif /* CONFIG_PMAC_BACKLIGHT */
+
 /* ------------------------------------------------------------------------- *
  *
  * framebuffer operations
@@ -1004,6 +1088,7 @@ static int rivafb_open(struct fb_info *info, int user)
 	struct riva_par *par = (struct riva_par *) info->par;
 	int cnt = atomic_read(&par->ref_count);
 
+	NVTRACE_ENTER();
 	if (!cnt) {
 		memset(&par->state, 0, sizeof(struct vgastate));
 		par->state.flags = VGA_SAVE_MODE  | VGA_SAVE_FONTS;
@@ -1020,6 +1105,7 @@ static int rivafb_open(struct fb_info *info, int user)
 		riva_save_state(par, &par->initial_state);
 	}
 	atomic_inc(&par->ref_count);
+	NVTRACE_LEAVE();
 	return 0;
 }
 
@@ -1028,6 +1114,7 @@ static int rivafb_release(struct fb_info *info, int user)
 	struct riva_par *par = (struct riva_par *) info->par;
 	int cnt = atomic_read(&par->ref_count);
 
+	NVTRACE_ENTER();
 	if (!cnt)
 		return -EINVAL;
 	if (cnt == 1) {
@@ -1038,13 +1125,17 @@ static int rivafb_release(struct fb_info *info, int user)
 		par->riva.LockUnlock(&par->riva, 1);
 	}
 	atomic_dec(&par->ref_count);
+	NVTRACE_LEAVE();
 	return 0;
 }
 
 static int rivafb_check_var(struct fb_var_screeninfo *var, struct fb_info *info)
 {
+	struct fb_monspecs *specs = &info->monspecs;
 	int nom, den;		/* translating from pixels->bytes */
+	int mode_valid = 0;
 	
+	NVTRACE_ENTER();
 	switch (var->bits_per_pixel) {
 	case 1 ... 8:
 		var->red.offset = var->green.offset = var->blue.offset = 0;
@@ -1090,10 +1181,77 @@ static int rivafb_check_var(struct fb_var_screeninfo *var, struct fb_info *info)
 		printk(KERN_ERR PFX
 		       "mode %dx%dx%d rejected...color depth not supported.\n",
 		       var->xres, var->yres, var->bits_per_pixel);
-		DPRINTK("EXIT, returning -EINVAL\n");
+		NVTRACE("EXIT, returning -EINVAL\n");
 		return -EINVAL;
 	}
 
+	if (!strictmode) {
+		if (!fb_validate_mode(var, info))
+			mode_valid = 1;
+	}
+
+	/* find best mode from modedb */
+	if (!mode_valid && specs->modedb_len) {
+		int i, best, best_refresh, best_x, best_y, diff_x, diff_y;
+
+		best_refresh = best = best_x = best_y = 0;
+		diff_x = diff_y = -1;
+
+		for (i = 0; i < specs->modedb_len; i++) {
+			if (var->xres <= specs->modedb[i].xres &&
+			    !(specs->modedb[i].flag & FB_MODE_IS_CALCULATED) &&
+			    specs->modedb[i].xres - var->xres < diff_x) {
+				best_x = specs->modedb[i].xres;
+				diff_x = best_x - var->xres;
+			}
+			if (!diff_x) break;
+		}
+
+		if (diff_x != -1) {
+			for (i = 0; i < specs->modedb_len; i++) {
+				if (best_x == specs->modedb[i].xres &&
+				    var->yres <= specs->modedb[i].yres &&
+				    !(specs->modedb[i].flag &
+				      FB_MODE_IS_CALCULATED) &&
+				    specs->modedb[i].yres-var->yres < diff_y) {
+					best_y = specs->modedb[i].yres;
+					diff_y = best_y - var->yres;
+				}
+				if (!diff_y) break;
+			}
+		}
+
+		if (diff_y != -1) {
+			for (i = 0; i < specs->modedb_len; i++) {
+				if (best_x == specs->modedb[i].xres &&
+				    best_y == specs->modedb[i].yres &&
+				    !(specs->modedb[i].flag &
+				      FB_MODE_IS_CALCULATED) &&
+				    specs->modedb[i].refresh > best_refresh) {
+					best_refresh=specs->modedb[i].refresh;
+					best = i;
+				}
+			}
+		}
+
+		if (best_refresh) {
+			riva_update_var(var, &specs->modedb[best]);
+			mode_valid = 1;
+		}
+	}
+
+	/* calculate modeline if supported by monitor */
+	if (!mode_valid && info->monspecs.gtf) {
+		if (!fb_get_mode(FB_MAXTIMINGS, 0, var, info))
+			mode_valid = 1;
+	}
+	if (!mode_valid && info->monspecs.modedb_len)
+		return -EINVAL;
+
+	if (var->xres_virtual < var->xres)
+		var->xres_virtual = var->xres;
+	if (var->yres_virtual <= var->yres)
+		var->yres_virtual = -1;
 	if (rivafb_do_maximize(info, var, nom, den) < 0)
 		return -EINVAL;
 
@@ -1113,6 +1271,7 @@ static int rivafb_check_var(struct fb_var_screeninfo *var, struct fb_info *info)
 	    var->green.msb_right =
 	    var->blue.msb_right =
 	    var->transp.offset = var->transp.length = var->transp.msb_right = 0;
+	NVTRACE_LEAVE();
 	return 0;
 }
 
@@ -1120,12 +1279,21 @@ static int rivafb_set_par(struct fb_info *info)
 {
 	struct riva_par *par = (struct riva_par *) info->par;
 
+	NVTRACE_ENTER();
+	riva_common_setup(par);
+	RivaGetConfig(&par->riva, par->Chipset);
+	/* vgaHWunlock() + riva unlock (0x7F) */
+	CRTCout(par, 0x11, 0xFF);
+	par->riva.LockUnlock(&par->riva, 0);
+
 	riva_load_video_mode(info);
-	riva_setup_accel(par);
+	riva_setup_accel(info);
 	
+	memset_io(par->riva.CURSOR, 0, MAX_CURS * MAX_CURS * 2);
 	info->fix.line_length = (info->var.xres_virtual * (info->var.bits_per_pixel >> 3));
 	info->fix.visual = (info->var.bits_per_pixel == 8) ?
 				FB_VISUAL_PSEUDOCOLOR : FB_VISUAL_DIRECTCOLOR;
+	NVTRACE_LEAVE();
 	return 0;
 }
 
@@ -1148,6 +1316,7 @@ static int rivafb_pan_display(struct fb_var_screeninfo *var,
 	struct riva_par *par = (struct riva_par *)info->par;
 	unsigned int base;
 
+	NVTRACE_ENTER();
 	if (var->xoffset > (var->xres_virtual - var->xres))
 		return -EINVAL;
 	if (var->yoffset > (var->yres_virtual - var->yres))
@@ -1174,6 +1343,7 @@ static int rivafb_pan_display(struct fb_var_screeninfo *var,
 		info->var.vmode |= FB_VMODE_YWRAP;
 	else
 		info->var.vmode &= ~FB_VMODE_YWRAP;
+	NVTRACE_LEAVE();
 	return 0;
 }
 
@@ -1185,6 +1355,7 @@ static int rivafb_blank(int blank, struct fb_info *info)
 	tmp = SEQin(par, 0x01) & ~0x20;	/* screen on/off */
 	vesa = CRTCin(par, 0x1a) & ~0xc0;	/* sync on/off */
 
+	NVTRACE_ENTER();
 	if (blank) {
 		tmp |= 0x20;
 		switch (blank - 1) {
@@ -1203,6 +1374,14 @@ static int rivafb_blank(int blank, struct fb_info *info)
 	}
 	SEQout(par, 0x01, tmp);
 	CRTCout(par, 0x1a, vesa);
+
+#ifdef CONFIG_PMAC_BACKLIGHT
+	if ( par->FlatPanel && _machine == _MACH_Pmac) {
+		set_backlight_enable(!blank);
+	}
+#endif
+
+	NVTRACE_LEAVE();
 	return 0;
 }
 
@@ -1329,8 +1508,7 @@ static void rivafb_fillrect(struct fb_info *info, const struct fb_fillrect *rect
 		break;
 	}
 
-	RIVA_FIFO_FREE(par->riva, Rop, 1);
-	par->riva.Rop->Rop3 = rop;
+	riva_set_rop_solid(par, rop);
 
 	RIVA_FIFO_FREE(par->riva, Bitmap, 1);
 	par->riva.Bitmap->Color1A = color;
@@ -1338,10 +1516,12 @@ static void rivafb_fillrect(struct fb_info *info, const struct fb_fillrect *rect
 	RIVA_FIFO_FREE(par->riva, Bitmap, 2);
 	par->riva.Bitmap->UnclippedRectangle[0].TopLeft =
 			(rect->dx << 16) | rect->dy;
+	mb();
 	par->riva.Bitmap->UnclippedRectangle[0].WidthHeight =
 			(rect->width << 16) | rect->height;
-	RIVA_FIFO_FREE(par->riva, Rop, 1);
-	par->riva.Rop->Rop3 = 0xCC;	// back to COPY
+	mb();
+	riva_set_rop_solid(par, 0xcc);
+
 }
 
 /**
@@ -1362,16 +1542,18 @@ static void rivafb_copyarea(struct fb_info *info, const struct fb_copyarea *regi
 	RIVA_FIFO_FREE(par->riva, Blt, 3);
 	par->riva.Blt->TopLeftSrc  = (region->sy << 16) | region->sx;
 	par->riva.Blt->TopLeftDst  = (region->dy << 16) | region->dx;
+	mb();
 	par->riva.Blt->WidthHeight = (region->height << 16) | region->width;
-	wait_for_idle(par);
+	mb();
 }
 
 static inline void convert_bgcolor_16(u32 *col)
 {
-	*col = ((*col & 0x00007C00) << 9)
-		| ((*col & 0x000003E0) << 6)
+	*col = ((*col & 0x0000F800) << 8)
+		| ((*col & 0x00007E0) << 5)
 		| ((*col & 0x0000001F) << 3)
 		|	   0xFF000000;
+	mb();
 }
 
 /**
@@ -1478,7 +1660,6 @@ static int rivafb_cursor(struct fb_info *info, struct fb_cursor *cursor)
 {
 	struct riva_par *par = (struct riva_par *) info->par;
 	u8 data[MAX_CURS * MAX_CURS/8];
-	u8 mask[MAX_CURS * MAX_CURS/8];
 	u16 fg, bg;
 	int i;
 
@@ -1508,7 +1689,7 @@ static int rivafb_cursor(struct fb_info *info, struct fb_cursor *cursor)
 		info->cursor.image.fg_color = cursor->image.fg_color;
 	}
 
-	if (cursor->set & (FB_CUR_SETSHAPE | FB_CUR_SETCMAP)) {
+	if (cursor->set & (FB_CUR_SETSHAPE | FB_CUR_SETCMAP | FB_CUR_SETCUR)) {
 		u32 bg_idx = info->cursor.image.bg_color;
 		u32 fg_idx = info->cursor.image.fg_color;
 		u32 s_pitch = (info->cursor.image.width+7) >> 3;
@@ -1517,34 +1698,35 @@ static int rivafb_cursor(struct fb_info *info, struct fb_cursor *cursor)
 		u8 *msk = (u8 *) info->cursor.mask;
 		u8 src[64];	
 		
+		info->cursor.image.data = cursor->image.data;
 		switch (info->cursor.rop) {
 		case ROP_XOR:
-			for (i = 0; i < s_pitch * info->cursor.image.height; i++)
-					src[i] = dat[i] ^ msk[i];
+			for (i = 0; i < s_pitch * info->cursor.image.height;
+			     i++)
+				src[i] = dat[i] ^ msk[i];
 			break;
 		case ROP_COPY:
 		default:
-			for (i = 0; i < s_pitch * info->cursor.image.height; i++)
-				
-					src[i] = dat[i] & msk[i];
+			for (i = 0; i < s_pitch * info->cursor.image.height;
+			     i++)
+				src[i] = dat[i] & msk[i];
 			break;
 		}
 		
-		fb_move_buf_aligned(info, &info->sprite, data, d_pitch, src, s_pitch, info->cursor.image.height);
-
-		fb_move_buf_aligned(info, &info->sprite, mask, d_pitch, msk, s_pitch, info->cursor.image.height);
+		fb_sysmove_buf_aligned(info, &info->sprite, data, d_pitch, src,
+				       s_pitch, info->cursor.image.height);
 
 		bg = ((info->cmap.red[bg_idx] & 0xf8) << 7) |
 		     ((info->cmap.green[bg_idx] & 0xf8) << 2) |
-		     ((info->cmap.blue[bg_idx] & 0xf8) >> 3);
+		     ((info->cmap.blue[bg_idx] & 0xf8) >> 3) | 1 << 15;
 
 		fg = ((info->cmap.red[fg_idx] & 0xf8) << 7) |
 		     ((info->cmap.green[fg_idx] & 0xf8) << 2) |
-		     ((info->cmap.blue[fg_idx] & 0xf8) >> 3);
+		     ((info->cmap.blue[fg_idx] & 0xf8) >> 3) | 1 << 15;
 
 		par->riva.LockUnlock(&par->riva, 0);
 
-		rivafb_load_cursor_image(par, data, mask, bg, fg,
+		rivafb_load_cursor_image(par, data, bg, fg,
 					 info->cursor.image.width, 
 					 info->cursor.image.height);
 	}
@@ -1586,24 +1768,21 @@ static struct fb_ops riva_fb_ops = {
 
 static int __devinit riva_set_fbinfo(struct fb_info *info)
 {
-	struct riva_par *par = (struct riva_par *) info->par;
 	unsigned int cmap_len;
 
-	info->flags = FBINFO_FLAG_DEFAULT;
+	NVTRACE_ENTER();
+	info->flags = FBINFO_DEFAULT
+		    | FBINFO_HWACCEL_XPAN
+		    | FBINFO_HWACCEL_YPAN
+		    | FBINFO_HWACCEL_COPYAREA
+		    | FBINFO_HWACCEL_FILLRECT
+		    | FBINFO_HWACCEL_IMAGEBLIT
+	            | FBINFO_MISC_MODESWITCHLATE;
 	info->var = rivafb_default_var;
-	info->fix = rivafb_fix;
-	info->fbops = &riva_fb_ops;
+	info->fix.visual = (info->var.bits_per_pixel == 8) ?
+				FB_VISUAL_PSEUDOCOLOR : FB_VISUAL_DIRECTCOLOR;
 	info->pseudo_palette = pseudo_palette;
 
-#ifndef MODULE
-	if (mode_option)
-		fb_find_mode(&info->var, info, mode_option,
-			     NULL, 0, NULL, 8);
-#endif
-	if (par->use_default_var)
-		/* We will use the modified default var */
-		info->var = rivafb_default_var;
-
 	cmap_len = riva_get_cmap_len(&info->var);
 	fb_alloc_cmap(&info->cmap, cmap_len, 0);	
 
@@ -1611,7 +1790,9 @@ static int __devinit riva_set_fbinfo(struct fb_info *info)
 	info->pixmap.buf_align = 4;
 	info->pixmap.scan_align = 4;
 	info->pixmap.flags = FB_PIXMAP_SYSTEM;
-	return 0;
+	info->var.yres_virtual = -1;
+	NVTRACE_LEAVE();
+	return (rivafb_check_var(&info->var, info));
 }
 
 #ifdef CONFIG_PPC_OF
@@ -1625,6 +1806,7 @@ static int riva_get_EDID_OF(struct fb_info *info, struct pci_dev *pd)
 		"DFP,EDID", "LCD,EDID", "EDID", "EDID1", "EDID,B", "EDID,A", NULL };
 	int i;
 
+	NVTRACE_ENTER();
 	dp = pci_device_to_OF_node(pd);
 	for (; dp != NULL; dp = dp->child) {
 		disptype = (unsigned char *)get_property(dp, "display-type", NULL);
@@ -1641,104 +1823,84 @@ static int riva_get_EDID_OF(struct fb_info *info, struct pci_dev *pd)
 			}
 		}
 	}
+	NVTRACE_LEAVE();
 		return 0;
 }
 #endif /* CONFIG_PPC_OF */
 
-static int riva_dfp_parse_EDID(struct riva_par *par)
+static void riva_update_default_var(struct fb_var_screeninfo *var, struct fb_info *info)
 {
-	unsigned char *block = par->EDID;
-
-	if (!block)
-		return 0;
-
-	/* jump to detailed timing block section */
-	block += 54;
-
-	par->clock = (block[0] + (block[1] << 8));
-	par->panel_xres = (block[2] + ((block[4] & 0xf0) << 4));
-	par->hblank = (block[3] + ((block[4] & 0x0f) << 8));
-	par->panel_yres = (block[5] + ((block[7] & 0xf0) << 4));
-	par->vblank = (block[6] + ((block[7] & 0x0f) << 8));
-	par->hOver_plus = (block[8] + ((block[11] & 0xc0) << 2));
-	par->hSync_width = (block[9] + ((block[11] & 0x30) << 4));
-	par->vOver_plus = ((block[10] >> 4) + ((block[11] & 0x0c) << 2));
-	par->vSync_width = ((block[10] & 0x0f) + ((block[11] & 0x03) << 4));
-	par->interlaced = ((block[17] & 0x80) >> 7);
-	par->synct = ((block[17] & 0x18) >> 3);
-	par->misc = ((block[17] & 0x06) >> 1);
-	par->hAct_high = par->vAct_high = 0;
-	if (par->synct == 3) {
-		if (par->misc & 2)
-			par->hAct_high = 1;
-		if (par->misc & 1)
-			par->vAct_high = 1;
+	struct fb_monspecs *specs = &info->monspecs;
+	struct fb_videomode modedb;
+
+	NVTRACE_ENTER();
+	/* respect mode options */
+	if (mode_option) {
+		fb_find_mode(var, info, mode_option,
+			     specs->modedb, specs->modedb_len,
+			     NULL, 8);
+	} else if (specs->modedb != NULL) {
+		/* get preferred timing */
+		if (info->monspecs.misc & FB_MISC_1ST_DETAIL) {
+			int i;
+
+			for (i = 0; i < specs->modedb_len; i++) {
+				if (specs->modedb[i].flag & FB_MODE_IS_FIRST) {
+					modedb = specs->modedb[i];
+					break;
+				}
+			}
+		} else {
+			/* otherwise, get first mode in database */
+			modedb = specs->modedb[0];
+		}
+		var->bits_per_pixel = 8;
+		riva_update_var(var, &modedb);
 	}
-
-	printk(KERN_INFO PFX
-			"detected DFP panel size from EDID: %dx%d\n", 
-			par->panel_xres, par->panel_yres);
-	par->got_dfpinfo = 1;
-	return 1;
-}
-
-static void riva_update_default_var(struct fb_info *info)
-{
-	struct fb_var_screeninfo *var = &rivafb_default_var;
-	struct riva_par *par = (struct riva_par *) info->par;
-
-        var->xres = par->panel_xres;
-        var->yres = par->panel_yres;
-        var->xres_virtual = par->panel_xres;
-        var->yres_virtual = par->panel_yres;
-        var->xoffset = var->yoffset = 0;
-        var->bits_per_pixel = 8;
-        var->pixclock = 100000000 / par->clock;
-        var->left_margin = (par->hblank - par->hOver_plus - par->hSync_width);
-        var->right_margin = par->hOver_plus;
-        var->upper_margin = (par->vblank - par->vOver_plus - par->vSync_width);
-        var->lower_margin = par->vOver_plus;
-        var->hsync_len = par->hSync_width;
-        var->vsync_len = par->vSync_width;
-        var->sync = 0;
-
-        if (par->synct == 3) {
-                if (par->hAct_high)
-                        var->sync |= FB_SYNC_HOR_HIGH_ACT;
-                if (par->vAct_high)
-                        var->sync |= FB_SYNC_VERT_HIGH_ACT;
-        }
- 
-        var->vmode = 0;
-        if (par->interlaced)
-                var->vmode |= FB_VMODE_INTERLACED;
-
 	var->accel_flags |= FB_ACCELF_TEXT;
-        
-        par->use_default_var = 1;
+	NVTRACE_LEAVE();
 }
 
 
 static void riva_get_EDID(struct fb_info *info, struct pci_dev *pdev)
 {
+	struct riva_par *par;
+	int i;
+
+	NVTRACE_ENTER();
 #ifdef CONFIG_PPC_OF
 	if (!riva_get_EDID_OF(info, pdev))
 		printk("rivafb: could not retrieve EDID from OF\n");
 #else
 	/* XXX use other methods later */
+#ifdef CONFIG_FB_RIVA_I2C
+
+	par = (struct riva_par *) info->par;
+	riva_create_i2c_busses(par);
+	for (i = par->bus; i >= 1; i--) {
+		riva_probe_i2c_connector(par, i, &par->EDID);
+		if (par->EDID) {
+			printk("rivafb: Found EDID Block from BUS %i\n", i);
+			break;
+		}
+	}
+	riva_delete_i2c_busses(par);
+#endif
 #endif
+	NVTRACE_LEAVE();
 }
 
 
-static void riva_get_dfpinfo(struct fb_info *info)
+static void riva_get_edidinfo(struct fb_info *info)
 {
+	struct fb_var_screeninfo *var = &rivafb_default_var;
 	struct riva_par *par = (struct riva_par *) info->par;
 
-	if (riva_dfp_parse_EDID(par))
-		riva_update_default_var(info);
+	fb_edid_to_monspecs(par->EDID, &info->monspecs);
+	riva_update_default_var(var, info);
 
 	/* if user specified flatpanel, we respect that */
-	if (par->got_dfpinfo == 1)
+	if (info->monspecs.input & FB_DISP_DDI)
 		par->FlatPanel = 1;
 }
 
@@ -1755,6 +1917,7 @@ static int __devinit rivafb_probe(struct pci_dev *pd,
 	struct riva_par *default_par;
 	struct fb_info *info;
 
+	NVTRACE_ENTER();
 	assert(pd != NULL);
 	assert(rci != NULL);
 
@@ -1768,12 +1931,23 @@ static int __devinit rivafb_probe(struct pci_dev *pd,
 
 	memset(info, 0, sizeof(struct fb_info));
 	memset(default_par, 0, sizeof(struct riva_par));
+	default_par->pdev = pd;
 
 	info->pixmap.addr = kmalloc(64 * 1024, GFP_KERNEL);
 	if (info->pixmap.addr == NULL)
 		goto err_out_kfree1;
 	memset(info->pixmap.addr, 0, 64 * 1024);
 
+	if (pci_enable_device(pd)) {
+		printk(KERN_ERR PFX "cannot enable PCI device\n");
+		goto err_out_enable;
+	}
+
+	if (pci_request_regions(pd, "rivafb")) {
+		printk(KERN_ERR PFX "cannot request PCI regions\n");
+		goto err_out_request;
+	}
+
 	strcat(rivafb_fix.id, rci->name);
 	default_par->riva.Architecture = rci->arch_rev;
 
@@ -1800,12 +1974,6 @@ static int __devinit rivafb_probe(struct pci_dev *pd,
 	rivafb_fix.mmio_start = pci_resource_start(pd, 0);
 	rivafb_fix.smem_start = pci_resource_start(pd, 1);
 
-	if (!request_mem_region(rivafb_fix.mmio_start,
-				rivafb_fix.mmio_len, "rivafb")) {
-		printk(KERN_ERR PFX "cannot reserve MMIO region\n");
-		goto err_out_kfree2;
-	}
-
 	default_par->ctrl_base = ioremap(rivafb_fix.mmio_start,
 					 rivafb_fix.mmio_len);
 	if (!default_par->ctrl_base) {
@@ -1815,27 +1983,19 @@ static int __devinit rivafb_probe(struct pci_dev *pd,
 
 	info->par = default_par;
 
-	riva_get_EDID(info, pd);
-
-	riva_get_dfpinfo(info);
-
 	switch (default_par->riva.Architecture) {
 	case NV_ARCH_03:
 		/* Riva128's PRAMIN is in the "framebuffer" space
 		 * Since these cards were never made with more than 8 megabytes
 		 * we can safely allocate this separately.
 		 */
-		if (!request_mem_region(rivafb_fix.smem_start + 0x00C00000,
-					 0x00008000, "rivafb")) {
-			printk(KERN_ERR PFX "cannot reserve PRAMIN region\n");
-			goto err_out_iounmap_ctrl;
-		}
 		default_par->riva.PRAMIN = ioremap(rivafb_fix.smem_start + 0x00C00000, 0x00008000);
 		if (!default_par->riva.PRAMIN) {
 			printk(KERN_ERR PFX "cannot ioremap PRAMIN region\n");
 			goto err_out_free_nv3_pramin;
 		}
 		rivafb_fix.accel = FB_ACCEL_NV3;
+		default_par->bus = 1;
 		break;
 	case NV_ARCH_04:
 	case NV_ARCH_10:
@@ -1843,6 +2003,7 @@ static int __devinit rivafb_probe(struct pci_dev *pd,
 		default_par->riva.PCRTC0 = (unsigned *)(default_par->ctrl_base + 0x00600000);
 		default_par->riva.PRAMIN = (unsigned *)(default_par->ctrl_base + 0x00710000);
 		rivafb_fix.accel = FB_ACCEL_NV4;
+		default_par->bus = 2;
 		break;
 	}
 
@@ -1855,12 +2016,6 @@ static int __devinit rivafb_probe(struct pci_dev *pd,
 	rivafb_fix.smem_len = riva_get_memlen(default_par) * 1024;
 	default_par->dclk_max = riva_get_maxdclk(default_par) * 1000;
 
-	if (!request_mem_region(rivafb_fix.smem_start,
-				rivafb_fix.smem_len, "rivafb")) {
-		printk(KERN_ERR PFX "cannot reserve FB region\n");
-		goto err_out_iounmap_nv3_pramin;
-	}
-	
 	info->screen_base = ioremap(rivafb_fix.smem_start,
 				    rivafb_fix.smem_len);
 	if (!info->screen_base) {
@@ -1883,6 +2038,11 @@ static int __devinit rivafb_probe(struct pci_dev *pd,
 	}
 #endif /* CONFIG_MTRR */
 
+	info->fbops = &riva_fb_ops;
+	info->fix = rivafb_fix;
+	riva_get_EDID(info, pd);
+	riva_get_edidinfo(info);
+
 	if (riva_set_fbinfo(info) < 0) {
 		printk(KERN_ERR PFX "error setting initial video mode\n");
 		goto err_out_iounmap_fb;
@@ -1903,23 +2063,26 @@ static int __devinit rivafb_probe(struct pci_dev *pd,
 		info->fix.id,
 		info->fix.smem_len / (1024 * 1024),
 		info->fix.smem_start);
+#ifdef CONFIG_PMAC_BACKLIGHT
+	if (default_par->FlatPanel && _machine == _MACH_Pmac)
+	register_backlight_controller(&riva_backlight_controller,
+						default_par, "mnca");
+#endif
+	NVTRACE_LEAVE();
 	return 0;
 
 err_out_iounmap_fb:
 	iounmap(info->screen_base);
 err_out_free_base1:
-	release_mem_region(rivafb_fix.smem_start, rivafb_fix.smem_len);
-err_out_iounmap_nv3_pramin:
 	if (default_par->riva.Architecture == NV_ARCH_03) 
 		iounmap((caddr_t)default_par->riva.PRAMIN);
 err_out_free_nv3_pramin:
-	if (default_par->riva.Architecture == NV_ARCH_03)
-		release_mem_region(rivafb_fix.smem_start + 0x00C00000, 0x00008000);
-err_out_iounmap_ctrl:
 	iounmap(default_par->ctrl_base);
 err_out_free_base0:
-	release_mem_region(rivafb_fix.mmio_start, rivafb_fix.mmio_len);
-err_out_kfree2:
+	pci_release_regions(pd);
+err_out_request:
+	pci_disable_device(pd);
+err_out_enable:
 	kfree(info->pixmap.addr);
 err_out_kfree1:
 	kfree(default_par);
@@ -1934,6 +2097,7 @@ static void __exit rivafb_remove(struct pci_dev *pd)
 	struct fb_info *info = pci_get_drvdata(pd);
 	struct riva_par *par = (struct riva_par *) info->par;
 	
+	NVTRACE_ENTER();
 	if (!info)
 		return;
 
@@ -1946,20 +2110,16 @@ static void __exit rivafb_remove(struct pci_dev *pd)
 
 	iounmap(par->ctrl_base);
 	iounmap(info->screen_base);
-
-	release_mem_region(info->fix.mmio_start,
-			   info->fix.mmio_len);
-	release_mem_region(info->fix.smem_start,
-			   info->fix.smem_len);
-
-	if (par->riva.Architecture == NV_ARCH_03) {
+	if (par->riva.Architecture == NV_ARCH_03)
 		iounmap((caddr_t)par->riva.PRAMIN);
-		release_mem_region(info->fix.smem_start + 0x00C00000, 0x00008000);
-	}
+	pci_release_regions(pd);
+	pci_disable_device(pd);
+	fb_destroy_modedb(info->monspecs.modedb);
 	kfree(info->pixmap.addr);
 	kfree(par);
 	kfree(info);
 	pci_set_drvdata(pd, NULL);
+	NVTRACE_LEAVE();
 }
 
 /* ------------------------------------------------------------------------- *
@@ -1973,6 +2133,7 @@ int __init rivafb_setup(char *options)
 {
 	char *this_opt;
 
+	NVTRACE_ENTER();
 	if (!options || !*options)
 		return 0;
 
@@ -1991,9 +2152,12 @@ int __init rivafb_setup(char *options)
 		} else if (!strncmp(this_opt, "nomtrr", 6)) {
 			nomtrr = 1;
 #endif
+		} else if (!strncmp(this_opt, "strictmode", 10)) {
+			strictmode = 1;
 		} else
 			mode_option = this_opt;
 	}
+	NVTRACE_LEAVE();
 	return 0;
 }
 #endif /* !MODULE */
@@ -2039,6 +2203,8 @@ MODULE_PARM_DESC(forceCRTC, "Forces usage of a particular CRTC in case autodetec
 #ifdef CONFIG_MTRR
 MODULE_PARM(nomtrr, "i");
 MODULE_PARM_DESC(nomtrr, "Disables MTRR support (0 or 1=disabled) (default=0)");
+MODULE_PARM(strictmode, "i");
+MODULE_PARM_DESC(strictmode, "Only use video modes from EDID");
 #endif
 #endif /* MODULE */
 
diff --git a/drivers/video/riva/riva_hw.c b/drivers/video/riva/riva_hw.c
index 03365f503..ac79134bd 100644
--- a/drivers/video/riva/riva_hw.c
+++ b/drivers/video/riva/riva_hw.c
@@ -46,6 +46,7 @@
 
 /* $XFree86: xc/programs/Xserver/hw/xfree86/drivers/nv/riva_hw.c,v 1.33 2002/08/05 20:47:06 mvojkovi Exp $ */
 
+#include <linux/kernel.h>
 #include <linux/pci.h>
 #include <linux/pci_ids.h>
 #include "riva_hw.h"
@@ -147,7 +148,7 @@ static int ShowHideCursor
 #define GFIFO_SIZE_128	256
 #define MFIFO_SIZE	120
 #define VFIFO_SIZE	256
-#define	ABS(a)	(a>0?a:-a)
+
 typedef struct {
   int gdrain_rate;
   int vdrain_rate;
@@ -376,44 +377,44 @@ static int nv3_iterate(nv3_fifo_info *res_info, nv3_sim_state * state, nv3_arb_i
         }
         ns = 1000000*ainfo->gburst_size/(state->memory_width/8)/state->mclk_khz;
         tmp = ns * ainfo->gdrain_rate/1000000;
-        if (ABS(ainfo->gburst_size) + ((ABS(ainfo->wcglwm) + 16 ) & ~0x7) - tmp > max_gfsize)
+        if (abs(ainfo->gburst_size) + ((abs(ainfo->wcglwm) + 16 ) & ~0x7) - tmp > max_gfsize)
         {
             ainfo->converged = 0;
             return (1);
         }
         ns = 1000000*ainfo->vburst_size/(state->memory_width/8)/state->mclk_khz;
         tmp = ns * ainfo->vdrain_rate/1000000;
-        if (ABS(ainfo->vburst_size) + (ABS(ainfo->wcvlwm + 32) & ~0xf)  - tmp> VFIFO_SIZE)
+        if (abs(ainfo->vburst_size) + (abs(ainfo->wcvlwm + 32) & ~0xf)  - tmp> VFIFO_SIZE)
         {
             ainfo->converged = 0;
             return (1);
         }
-        if (ABS(ainfo->gocc) > max_gfsize)
+        if (abs(ainfo->gocc) > max_gfsize)
         {
             ainfo->converged = 0;
             return (1);
         }
-        if (ABS(ainfo->vocc) > VFIFO_SIZE)
+        if (abs(ainfo->vocc) > VFIFO_SIZE)
         {
             ainfo->converged = 0;
             return (1);
         }
-        if (ABS(ainfo->mocc) > MFIFO_SIZE)
+        if (abs(ainfo->mocc) > MFIFO_SIZE)
         {
             ainfo->converged = 0;
             return (1);
         }
-        if (ABS(vfsize) > VFIFO_SIZE)
+        if (abs(vfsize) > VFIFO_SIZE)
         {
             ainfo->converged = 0;
             return (1);
         }
-        if (ABS(gfsize) > max_gfsize)
+        if (abs(gfsize) > max_gfsize)
         {
             ainfo->converged = 0;
             return (1);
         }
-        if (ABS(mfsize) > MFIFO_SIZE)
+        if (abs(mfsize) > MFIFO_SIZE)
         {
             ainfo->converged = 0;
             return (1);
@@ -493,8 +494,8 @@ static char nv3_arb(nv3_fifo_info * res_info, nv3_sim_state * state,  nv3_arb_in
     }
     if (ainfo->converged)
     {
-        res_info->graphics_lwm = (int)ABS(ainfo->wcglwm) + 16;
-        res_info->video_lwm = (int)ABS(ainfo->wcvlwm) + 32;
+        res_info->graphics_lwm = (int)abs(ainfo->wcglwm) + 16;
+        res_info->video_lwm = (int)abs(ainfo->wcvlwm) + 32;
         res_info->graphics_burst_size = ainfo->gburst_size;
         res_info->video_burst_size = ainfo->vburst_size;
         res_info->graphics_hi_priority = (ainfo->priority == GRAPHICS);
@@ -1343,7 +1344,7 @@ static void UpdateFifoState
     {
         case NV_ARCH_04:
             LOAD_FIXED_STATE(nv4,FIFO);
-            chip->Tri03 = 0L;
+            chip->Tri03 = NULL;
             chip->Tri05 = (RivaTexturedTriangle05 *)&(chip->FIFO[0x0000E000/4]);
             break;
         case NV_ARCH_10:
@@ -1353,7 +1354,7 @@ static void UpdateFifoState
              */
             LOAD_FIXED_STATE(nv10tri05,PGRAPH);
             LOAD_FIXED_STATE(nv10,FIFO);
-            chip->Tri03 = 0L;
+            chip->Tri03 = NULL;
             chip->Tri05 = (RivaTexturedTriangle05 *)&(chip->FIFO[0x0000E000/4]);
             break;
     }
@@ -1393,13 +1394,13 @@ static void LoadStateExt
                 case 32:
                     LOAD_FIXED_STATE_32BPP(nv3,PRAMIN);
                     LOAD_FIXED_STATE_32BPP(nv3,PGRAPH);
-                    chip->Tri03 = 0L;
+                    chip->Tri03 = NULL;
                     break;
                 case 8:
                 default:
                     LOAD_FIXED_STATE_8BPP(nv3,PRAMIN);
                     LOAD_FIXED_STATE_8BPP(nv3,PGRAPH);
-                    chip->Tri03 = 0L;
+                    chip->Tri03 = NULL;
                     break;
             }
             for (i = 0x00000; i < 0x00800; i++)
@@ -1437,13 +1438,13 @@ static void LoadStateExt
                 case 32:
                     LOAD_FIXED_STATE_32BPP(nv4,PRAMIN);
                     LOAD_FIXED_STATE_32BPP(nv4,PGRAPH);
-                    chip->Tri03 = 0L;
+                    chip->Tri03 = NULL;
                     break;
                 case 8:
                 default:
                     LOAD_FIXED_STATE_8BPP(nv4,PRAMIN);
                     LOAD_FIXED_STATE_8BPP(nv4,PGRAPH);
-                    chip->Tri03 = 0L;
+                    chip->Tri03 = NULL;
                     break;
             }
             chip->PGRAPH[0x00000640/4] = state->offset0;
@@ -1482,13 +1483,13 @@ static void LoadStateExt
                 case 32:
                     LOAD_FIXED_STATE_32BPP(nv10,PRAMIN);
                     LOAD_FIXED_STATE_32BPP(nv10,PGRAPH);
-                    chip->Tri03 = 0L;
+                    chip->Tri03 = NULL;
                     break;
                 case 8:
                 default:
                     LOAD_FIXED_STATE_8BPP(nv10,PRAMIN);
                     LOAD_FIXED_STATE_8BPP(nv10,PGRAPH);
-                    chip->Tri03 = 0L;
+                    chip->Tri03 = NULL;
                     break;
             }
 
diff --git a/drivers/video/riva/rivafb.h b/drivers/video/riva/rivafb.h
index 863142e6c..198a29c3c 100644
--- a/drivers/video/riva/rivafb.h
+++ b/drivers/video/riva/rivafb.h
@@ -4,6 +4,10 @@
 #include <linux/config.h>
 #include <linux/fb.h>
 #include <video/vga.h>
+#include <linux/i2c.h>
+#include <linux/i2c-id.h>
+#include <linux/i2c-algo-bit.h>
+
 #include "riva_hw.h"
 
 /* GGI compatibility macros */
@@ -12,6 +16,12 @@
 #define NUM_GRC_REGS		0x09
 #define NUM_ATC_REGS		0x15
 
+/* I2C */
+#define DDC_SCL_READ_MASK       (1 << 2)
+#define DDC_SCL_WRITE_MASK      (1 << 5)
+#define DDC_SDA_READ_MASK       (1 << 3)
+#define DDC_SDA_WRITE_MASK      (1 << 4)
+
 /* holds the state of the VGA core and extended Riva hw state from riva_hw.c.
  * From KGI originally. */
 struct riva_regs {
@@ -23,6 +33,15 @@ struct riva_regs {
 	RIVA_HW_STATE ext;
 };
 
+struct riva_par;
+
+struct riva_i2c_chan {
+	struct riva_par *par;
+	unsigned long   ddc_base;
+	struct i2c_adapter adapter;
+	struct i2c_algo_bit_data algo;
+};
+
 struct riva_par {
 	RIVA_HW_INST riva;	/* interface to riva_hw.c */
 
@@ -36,26 +55,23 @@ struct riva_par {
 	u32 cursor_data[32 * 32/4];
 	int cursor_reset;
 	unsigned char *EDID;
-
-	int panel_xres, panel_yres;
-	int hOver_plus, hSync_width, hblank;
-	int vOver_plus, vSync_width, vblank;
-	int hAct_high, vAct_high, interlaced;
-	int synct, misc, clock;
-
-	int use_default_var;
-	int got_dfpinfo;
 	unsigned int Chipset;
 	int forceCRTC;
 	Bool SecondCRTC;
 	int FlatPanel;
+	struct pci_dev *pdev;
+	int bus;
 #ifdef CONFIG_MTRR
 	struct { int vram; int vram_valid; } mtrr;
 #endif
+	struct riva_i2c_chan chan[3];
 };
 
 void riva_common_setup(struct riva_par *);
 unsigned long riva_get_memlen(struct riva_par *);
 unsigned long riva_get_maxdclk(struct riva_par *);
+void riva_delete_i2c_busses(struct riva_par *par);
+void riva_create_i2c_busses(struct riva_par *par);
+int riva_probe_i2c_connector(struct riva_par *par, int conn, u8 **out_edid);
 
 #endif /* __RIVAFB_H */
diff --git a/drivers/video/sa1100fb.c b/drivers/video/sa1100fb.c
index b14a667db..ae8fb7aef 100644
--- a/drivers/video/sa1100fb.c
+++ b/drivers/video/sa1100fb.c
@@ -328,17 +328,17 @@ static struct sa1100fb_mach_info brutus_info __initdata = {
 
 #ifdef CONFIG_SA1100_COLLIE
 static struct sa1100fb_mach_info collie_info __initdata = {
-	pixclock:	171521,		bpp:		16,
-	xres:		320,		yres:		240,
+	.pixclock	= 171521,	.bpp		= 16,
+	.xres		= 320,		.yres		= 240,
 
-	hsync_len:	5,		vsync_len:	1,
-	left_margin:	11,		upper_margin:	2,
-	right_margin:	30,		lower_margin:	0,
+	.hsync_len	= 5,		.vsync_len	= 1,
+	.left_margin	= 11,		.upper_margin	= 2,
+	.right_margin	= 30,		.lower_margin	= 0,
 
-	sync:		FB_SYNC_HOR_HIGH_ACT | FB_SYNC_VERT_HIGH_ACT,
+	.sync		= FB_SYNC_HOR_HIGH_ACT | FB_SYNC_VERT_HIGH_ACT,
 
-	lccr0:		LCCR0_Color | LCCR0_Sngl | LCCR0_Act,
-	lccr3:		LCCR3_OutEnH | LCCR3_PixRsEdg | LCCR3_ACBsDiv(2),
+	.lccr0		= LCCR0_Color | LCCR0_Sngl | LCCR0_Act,
+	.lccr3		= LCCR3_OutEnH | LCCR3_PixRsEdg | LCCR3_ACBsDiv(2),
 };
 #endif
 
@@ -1074,7 +1074,7 @@ static int sa1100fb_blank(int blank, struct fb_info *info)
 	case VESA_NO_BLANKING:
 		if (fbi->fb.fix.visual == FB_VISUAL_PSEUDOCOLOR ||
 		    fbi->fb.fix.visual == FB_VISUAL_STATIC_PSEUDOCOLOR)
-			fb_set_cmap(&fbi->fb.cmap, 1, info);
+			fb_set_cmap(&fbi->fb.cmap, info);
 		sa1100fb_schedule_work(fbi, C_ENABLE);
 	}
 	return 0;
@@ -1291,8 +1291,7 @@ static void sa1100fb_enable_controller(struct sa1100fb_info *fbi)
 #error Where is GPIO24 set as an output?  Can we fit this in somewhere else?
 	if (machine_is_graphicsclient()) {
 		// From ADS doc again...same as disable
-		set_current_state(TASK_UNINTERRUPTIBLE);
-		schedule_timeout(20 * HZ / 1000);
+		msleep(20);
 		GPSR |= GPIO_GPIO24;
 	}
 #endif
@@ -1327,8 +1326,7 @@ static void sa1100fb_disable_controller(struct sa1100fb_info *fbi)
 		 * We'll wait 20msec.
 		 */
 		GPCR |= GPIO_GPIO24;
-		set_current_state(TASK_UNINTERRUPTIBLE);
-		schedule_timeout(20 * HZ / 1000);
+		msleep(20);
 	}
 #endif
 #ifdef CONFIG_SA1100_HUW_WEBPANEL
diff --git a/drivers/video/sbuslib.c b/drivers/video/sbuslib.c
index c1ab754d3..3820d7e62 100644
--- a/drivers/video/sbuslib.c
+++ b/drivers/video/sbuslib.c
@@ -93,7 +93,7 @@ int sbusfb_ioctl_helper(unsigned long cmd, unsigned long arg,
 {
 	switch(cmd) {
 	case FBIOGTYPE: {
-		struct fbtype *f = (struct fbtype *) arg;
+		struct fbtype __user *f = (struct fbtype __user *) arg;
 
 		if (put_user(type, &f->fb_type) ||
 		    __put_user(info->var.yres, &f->fb_height) ||
@@ -105,10 +105,12 @@ int sbusfb_ioctl_helper(unsigned long cmd, unsigned long arg,
 		return 0;
 	}
 	case FBIOPUTCMAP_SPARC: {
-		struct fbcmap *c = (struct fbcmap *) arg;
+		struct fbcmap __user *c = (struct fbcmap __user *) arg;
 		struct fb_cmap cmap;
 		u16 red, green, blue;
-		unsigned char *ured, *ugreen, *ublue;
+		unsigned char __user *ured;
+		unsigned char __user *ugreen;
+		unsigned char __user *ublue;
 		int index, count, i;
 
 		if (get_user(index, &c->index) ||
@@ -132,15 +134,17 @@ int sbusfb_ioctl_helper(unsigned long cmd, unsigned long arg,
 				return -EFAULT;
 
 			cmap.start = index + i;
-			err = fb_set_cmap(&cmap, 0, info);
+			err = fb_set_cmap(&cmap, info);
 			if (err)
 				return err;
 		}
 		return 0;
 	}
 	case FBIOGETCMAP_SPARC: {
-		struct fbcmap *c = (struct fbcmap *) arg;
-		unsigned char *ured, *ugreen, *ublue;
+		struct fbcmap __user *c = (struct fbcmap __user *) arg;
+		unsigned char __user *ured;
+		unsigned char __user *ugreen;
+		unsigned char __user *ublue;
 		struct fb_cmap *cmap = &info->cmap;
 		int index, count, i;
 
diff --git a/drivers/video/sis/300vtbl.h b/drivers/video/sis/300vtbl.h
index a7d798b07..426d02b9e 100644
--- a/drivers/video/sis/300vtbl.h
+++ b/drivers/video/sis/300vtbl.h
@@ -1,4 +1,5 @@
 /* $XFree86$ */
+/* $XdotOrg$ */
 /*
  * Register settings for SiS 300 series
  *
@@ -31,13 +32,10 @@
  * * 2) Redistributions in binary form must reproduce the above copyright
  * *    notice, this list of conditions and the following disclaimer in the
  * *    documentation and/or other materials provided with the distribution.
- * * 3) All advertising materials mentioning features or use of this software
- * *    must display the following acknowledgement: "This product includes
- * *    software developed by Thomas Winischhofer, Vienna, Austria."
- * * 4) The name of the author may not be used to endorse or promote products
+ * * 3) The name of the author may not be used to endorse or promote products
  * *    derived from this software without specific prior written permission.
  * *
- * * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR
+ * * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESSED 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,
@@ -52,20 +50,7 @@
  *
  */
 
-typedef struct _SiS300_StStruct
-{
-	UCHAR St_ModeID;
-	USHORT St_ModeFlag;
-	UCHAR St_StTableIndex;
-	UCHAR St_CRT2CRTC;
-	UCHAR St_ResInfo;
-	UCHAR VB_StTVFlickerIndex;
-	UCHAR VB_StTVEdgeIndex;
-	UCHAR VB_StTVYFilterIndex;
-	UCHAR St_PDC;
-} SiS300_StStruct;
-
-static const SiS300_StStruct  SiS300_SModeIDTable[] =
+static const SiS_StStruct  SiS300_SModeIDTable[] =
 {
 	{0x01,0x9208,0x01,0x00,0x00,0x00,0x00,0x00, 0},
 	{0x01,0x1210,0x14,0x01,0x01,0x00,0x00,0x00, 0},
@@ -89,206 +74,168 @@ static const SiS300_StStruct  SiS300_SModeIDTable[] =
 	{0xff,     0,   0,   0,   0,   0,   0,   0, 0}
 };
 
-typedef struct _SiS300_ExtStruct
-{
-	UCHAR  Ext_ModeID;
-	USHORT Ext_ModeFlag;
-	UCHAR  Ext_ModeOffset;
-	USHORT Ext_VESAID;
-	UCHAR  Ext_RESINFO;
-	UCHAR  VB_ExtTVFlickerIndex;
-	UCHAR  VB_ExtTVEdgeIndex;
-	UCHAR  VB_ExtTVYFilterIndex;
-	UCHAR  VB_ExtTVYFilterIndexROM661;
-	UCHAR  REFindex;
-} SiS300_ExtStruct;
-
-static const SiS300_ExtStruct  SiS300_EModeIDTable[] =
-{
-	{0x6a,0x2212,0x04,0x0102,SIS_RI_800x600,  0x00,0x00,0x00,0x00,0x00},  /* 800x600x? */
-	{0x2e,0x0a1b,0x03,0x0101,SIS_RI_640x480,  0x00,0x00,0x00,0x00,0x08},
-	{0x2f,0x021b,0x03,0x0100,SIS_RI_640x400,  0x00,0x00,0x00,0x00,0x10},  /* 640x400x8 */
-	{0x30,0x2a1b,0x04,0x0103,SIS_RI_800x600,  0x00,0x00,0x00,0x00,0x00},
-	{0x31,0x0a1b,0x0a,0x0000,SIS_RI_720x480,  0x00,0x00,0x00,0x00,0x11},  /* 720x480x8 */
-	{0x32,0x2a1b,0x0a,0x0000,SIS_RI_720x576,  0x00,0x00,0x00,0x00,0x12},  /* 720x576x8 */
-	{0x33,0x0a1d,0x0a,0x0000,SIS_RI_720x480,  0x00,0x00,0x00,0x00,0x11},  /* 720x480x16 */
-	{0x34,0x2a1d,0x0a,0x0000,SIS_RI_720x576,  0x00,0x00,0x00,0x00,0x12},  /* 720x576x16 */
-	{0x35,0x0a1f,0x0a,0x0000,SIS_RI_720x480,  0x00,0x00,0x00,0x00,0x11},  /* 720x480x32 */
-	{0x36,0x2a1f,0x0a,0x0000,SIS_RI_720x576,  0x00,0x00,0x00,0x00,0x12},  /* 720x576x32 */
-	{0x37,0x0212,0x05,0x0104,SIS_RI_1024x768, 0x00,0x00,0x00,0x00,0x13},  /* 1024x768x? */
-	{0x38,0x0a1b,0x05,0x0105,SIS_RI_1024x768, 0x00,0x00,0x00,0x00,0x13},  /* 1024x768x8 */
-	{0x3a,0x0e3b,0x06,0x0107,SIS_RI_1280x1024,0x00,0x00,0x00,0x00,0x1a},  /* 1280x1024x8 */
-	{0x3c,0x063b,0x07,0x0130,SIS_RI_1600x1200,0x00,0x00,0x00,0x00,0x1e},
-	{0x3d,0x067d,0x07,0x0131,SIS_RI_1600x1200,0x00,0x00,0x00,0x00,0x1e},
-	{0x40,0x921c,0x00,0x010d,SIS_RI_320x200,  0x00,0x00,0x00,0x00,0x23},  /* 320x200x15 */
-	{0x41,0x921d,0x00,0x010e,SIS_RI_320x200,  0x00,0x00,0x00,0x00,0x23},  /* 320x200x16 */
-	{0x43,0x0a1c,0x03,0x0110,SIS_RI_640x480,  0x00,0x00,0x00,0x00,0x08},
-	{0x44,0x0a1d,0x03,0x0111,SIS_RI_640x480,  0x00,0x00,0x00,0x00,0x08},
-	{0x46,0x2a1c,0x04,0x0113,SIS_RI_800x600,  0x00,0x00,0x00,0x00,0x00},  /* 800x600x15 */
-	{0x47,0x2a1d,0x04,0x0114,SIS_RI_800x600,  0x00,0x00,0x00,0x00,0x00},  /* 800x600x16 */
-	{0x49,0x0a3c,0x05,0x0116,SIS_RI_1024x768, 0x00,0x00,0x00,0x00,0x13},
-	{0x4a,0x0a3d,0x05,0x0117,SIS_RI_1024x768, 0x00,0x00,0x00,0x00,0x13},
-	{0x4c,0x0e7c,0x06,0x0119,SIS_RI_1280x1024,0x00,0x00,0x00,0x00,0x1a},
-	{0x4d,0x0e7d,0x06,0x011a,SIS_RI_1280x1024,0x00,0x00,0x00,0x00,0x1a},
-	{0x50,0x921b,0x00,0x0132,SIS_RI_320x240,  0x00,0x00,0x00,0x00,0x24},  /* 320x240x8  */
-	{0x51,0xb21b,0x01,0x0133,SIS_RI_400x300,  0x00,0x00,0x00,0x00,0x25},  /* 400x300x8  */
-	{0x52,0x921b,0x02,0x0134,SIS_RI_512x384,  0x00,0x00,0x00,0x00,0x26},  /* 512x384x8  */
-	{0x56,0x921d,0x00,0x0135,SIS_RI_320x240,  0x00,0x00,0x00,0x00,0x24},  /* 320x240x16 */
-	{0x57,0xb21d,0x01,0x0136,SIS_RI_400x300,  0x00,0x00,0x00,0x00,0x25},  /* 400x300x16 */
-	{0x58,0x921d,0x02,0x0137,SIS_RI_512x384,  0x00,0x00,0x00,0x00,0x26},  /* 512x384x16 */
-	{0x59,0x921b,0x00,0x0138,SIS_RI_320x200,  0x00,0x00,0x00,0x00,0x23},  /* 320x200x8  */
-	{0x5c,0x921f,0x02,0x0000,SIS_RI_512x384,  0x00,0x00,0x00,0x00,0x26},  /* 512x384x32 */
-	{0x5d,0x021d,0x03,0x0139,SIS_RI_640x400,  0x00,0x00,0x00,0x00,0x10},  /* 640x400x16 */
- 	{0x5e,0x021f,0x03,0x0000,SIS_RI_640x400,  0x00,0x00,0x00,0x00,0x10},  /* 640x400x32 */
-	{0x62,0x0a3f,0x03,0x013a,SIS_RI_640x480,  0x00,0x00,0x00,0x00,0x08},
-	{0x63,0x2a3f,0x04,0x013b,SIS_RI_800x600,  0x00,0x00,0x00,0x00,0x00},  /* 800x600x32 */
-	{0x64,0x0a7f,0x05,0x013c,SIS_RI_1024x768, 0x00,0x00,0x00,0x00,0x13},
-	{0x65,0x0eff,0x06,0x013d,SIS_RI_1280x1024,0x00,0x00,0x00,0x00,0x1a},
-	{0x66,0x06ff,0x07,0x013e,SIS_RI_1600x1200,0x00,0x00,0x00,0x00,0x1e},
-	{0x68,0x067b,0x08,0x013f,SIS_RI_1920x1440,0x00,0x00,0x00,0x00,0x27},
-	{0x69,0x06fd,0x08,0x0140,SIS_RI_1920x1440,0x00,0x00,0x00,0x00,0x27},
-	{0x6b,0x07ff,0x08,0x0000,SIS_RI_1920x1440,0x00,0x00,0x00,0x00,0x27},
-	{0x6c,0x067b,0x09,0x0000,SIS_RI_2048x1536,0x00,0x00,0x00,0x00,0x28},  /* 2048x1536x8 - not in BIOS! */
-	{0x6d,0x06fd,0x09,0x0000,SIS_RI_2048x1536,0x00,0x00,0x00,0x00,0x28},  /* 2048x1536x16 - not in BIOS! */
-	{0x70,0x2a1b,0x04,0x0000,SIS_RI_800x480,  0x00,0x00,0x07,0x00,0x2d},  /* 800x480x8 */
-	{0x71,0x0a1b,0x05,0x0000,SIS_RI_1024x576, 0x00,0x00,0x00,0x00,0x30},  /* 1024x576x8 */
-	{0x74,0x0a1d,0x05,0x0000,SIS_RI_1024x576, 0x00,0x00,0x00,0x00,0x30},  /* 1024x576x16 */
-	{0x75,0x0e3d,0x06,0x0000,SIS_RI_1280x720, 0x00,0x00,0x00,0x00,0x33},  /* 1280x720x16 */
-	{0x76,0x2a1f,0x04,0x0000,SIS_RI_800x480,  0x00,0x00,0x07,0x00,0x2d},  /* 800x480x32 */
-	{0x77,0x0a3f,0x05,0x0000,SIS_RI_1024x576, 0x00,0x00,0x00,0x00,0x30},  /* 1024x576x32 */
-	{0x78,0x0eff,0x06,0x0000,SIS_RI_1280x720, 0x00,0x00,0x00,0x00,0x33},  /* 1280x720x32 */
-	{0x79,0x0e3b,0x06,0x0000,SIS_RI_1280x720, 0x00,0x00,0x00,0x00,0x33},  /* 1280x720x8 */
-	{0x7a,0x2a1d,0x04,0x0000,SIS_RI_800x480,  0x00,0x00,0x07,0x00,0x2d},  /* 800x480x16 */
-	{0x7c,0x0a3b,0x06,0x0000,SIS_RI_1280x960, 0x00,0x00,0x00,0x00,0x29},  /* 1280x960x8 */
-	{0x7d,0x0a7d,0x06,0x0000,SIS_RI_1280x960, 0x00,0x00,0x00,0x00,0x29},  /* 1280x960x16 */
-	{0x7e,0x0aff,0x06,0x0000,SIS_RI_1280x960, 0x00,0x00,0x00,0x00,0x29},  /* 1280x960x32 */
-	{0x20,0x0a1b,0x05,0x0000,SIS_RI_1024x600, 0x00,0x00,0x00,0x00,0x2b},  /* 1024x600 */
-	{0x21,0x0a3d,0x05,0x0000,SIS_RI_1024x600, 0x00,0x00,0x00,0x00,0x2b},
-	{0x22,0x0a7f,0x05,0x0000,SIS_RI_1024x600, 0x00,0x00,0x00,0x00,0x2b},
-	{0x23,0x0a1b,0x0c,0x0000,SIS_RI_1152x768, 0x00,0x00,0x00,0x00,0x2c},  /* 1152x768 */
-	{0x24,0x0a3d,0x0c,0x0000,SIS_RI_1152x768, 0x00,0x00,0x00,0x00,0x2c},
-	{0x25,0x0a7f,0x0c,0x0000,SIS_RI_1152x768, 0x00,0x00,0x00,0x00,0x2c},
-	{0x29,0x0e1b,0x0c,0x0000,SIS_RI_1152x864, 0x00,0x00,0x00,0x00,0x36},  /* 1152x864 */
-	{0x2a,0x0e3d,0x0c,0x0000,SIS_RI_1152x864, 0x00,0x00,0x00,0x00,0x36},
-	{0x2b,0x0e7f,0x0c,0x0000,SIS_RI_1152x864, 0x00,0x00,0x00,0x00,0x36},
-	{0x39,0x2a1b,0x0d,0x0000,SIS_RI_848x480,  0x00,0x00,0x00,0x00,0x38},  /* 848x480 */
-	{0x3b,0x2a3d,0x0d,0x0000,SIS_RI_848x480,  0x00,0x00,0x00,0x00,0x38},
-	{0x3e,0x2a7f,0x0d,0x0000,SIS_RI_848x480,  0x00,0x00,0x00,0x00,0x38},
-	{0x3f,0x2a1b,0x0d,0x0000,SIS_RI_856x480,  0x00,0x00,0x00,0x00,0x3a},  /* 856x480 */
-	{0x42,0x2a3d,0x0d,0x0000,SIS_RI_856x480,  0x00,0x00,0x00,0x00,0x3a},
-	{0x45,0x2a7f,0x0d,0x0000,SIS_RI_856x480,  0x00,0x00,0x00,0x00,0x3a},
-	{0x48,0x223b,0x0e,0x0000,SIS_RI_1360x768, 0x00,0x00,0x00,0x00,0x3c},  /* 1360x768 */
-	{0x4b,0x227d,0x0e,0x0000,SIS_RI_1360x768, 0x00,0x00,0x00,0x00,0x3c},
-	{0x4e,0x22ff,0x0e,0x0000,SIS_RI_1360x768, 0x00,0x00,0x00,0x00,0x3c},
-	{0x4f,0x921f,0x00,0x0000,SIS_RI_320x200,  0x00,0x00,0x00,0x00,0x23},  /* 320x200x32 */
-	{0x53,0x921f,0x00,0x0000,SIS_RI_320x240,  0x00,0x00,0x00,0x00,0x24},  /* 320x240x32 */
-	{0x54,0xb21f,0x01,0x0000,SIS_RI_400x300,  0x00,0x00,0x00,0x00,0x25},  /* 400x300x32 */
-	{0x55,0x2e3b,0x06,0x0000,SIS_RI_1280x768, 0x00,0x00,0x00,0x00,0x3d},  /* 1280x768   */
-	{0x5a,0x2e7d,0x06,0x0000,SIS_RI_1280x768, 0x00,0x00,0x00,0x00,0x3d},
-	{0x5b,0x2eff,0x06,0x0000,SIS_RI_1280x768, 0x00,0x00,0x00,0x00,0x3d},
-	{0x5f,0x2a1b,0x0f,0x0000,SIS_RI_768x576,  0x00,0x00,0x00,0x00,0x3e},  /* 768x576x8 */
-	{0x60,0x2a1d,0x0f,0x0000,SIS_RI_768x576,  0x00,0x00,0x00,0x00,0x3e},  /* 768x576x16 */
-	{0x61,0x2a1f,0x0f,0x0000,SIS_RI_768x576,  0x00,0x00,0x00,0x00,0x3e},  /* 768x576x32 */
-	{0x67,0x2e3b,0x0e,0x0000,SIS_RI_1360x1024,0x00,0x00,0x00,0x00,0x3f},  /* 1360x1024x8 (BARCO) */
-	{0x6f,0x2e7d,0x0e,0x0000,SIS_RI_1360x1024,0x00,0x00,0x00,0x00,0x3f},  /* 1360x1024x16 (BARCO) */
-	{0x72,0x2eff,0x0e,0x0000,SIS_RI_1360x1024,0x00,0x00,0x00,0x00,0x3f},  /* 1360x1024x32 (BARCO) */
-	{0xff,0x0000,0x00,0xffff,0,               0x00,0x00,0x00,0x00,0x00}
-};
-
-typedef struct _SiS300_Ext2Struct
-{
-	USHORT Ext_InfoFlag;
-	UCHAR  Ext_CRT1CRTC;  /* Index in SiS300_CRT1Table */
-	UCHAR  Ext_CRTVCLK;   /* Index in VCLK array */
-	UCHAR  Ext_CRT2CRTC;  /* Index in LCD Paneltype arrays (&3f) */
-	UCHAR  ModeID;
-	USHORT XRes;
-	USHORT YRes;
-	UCHAR  Ext_PDC;
-} SiS300_Ext2Struct;
-
-static const SiS300_Ext2Struct  SiS300_RefIndex[] =
-{
-	{0x085f,0x0d,0x03,0x05,0x6a, 800, 600, 0}, /* 00 */
-	{0x0467,0x0e,0x44,0x05,0x6a, 800, 600, 0}, /* 01 */
-	{0x0067,0x0f,0x07,0x48,0x6a, 800, 600, 0}, /* 02 - CRT1CRTC was 0x4f */
-	{0x0067,0x10,0x06,0x8b,0x6a, 800, 600, 0}, /* 03 */
-	{0x0147,0x11,0x08,0x00,0x6a, 800, 600, 0}, /* 04 */
-	{0x0147,0x12,0x0c,0x00,0x6a, 800, 600, 0}, /* 05 */
-	{0x0047,0x11,0x4e,0x00,0x6a, 800, 600, 0}, /* 06 - CRT1CRTC was 0x51 */
-	{0x0047,0x11,0x13,0x00,0x6a, 800, 600, 0}, /* 07 */
-	{0xc85f,0x05,0x00,0x04,0x2e, 640, 480, 0}, /* 08 */
-	{0xc067,0x06,0x02,0x04,0x2e, 640, 480, 0}, /* 09 */
-	{0xc067,0x07,0x02,0x47,0x2e, 640, 480, 0}, /* 0a */
-	{0xc067,0x08,0x03,0x8a,0x2e, 640, 480, 0}, /* 0b */
-	{0xc047,0x09,0x05,0x00,0x2e, 640, 480, 0}, /* 0c */
-	{0xc047,0x0a,0x08,0x00,0x2e, 640, 480, 0}, /* 0d */
-	{0xc047,0x0b,0x0a,0x00,0x2e, 640, 480, 0}, /* 0e */
-	{0xc047,0x0c,0x10,0x00,0x2e, 640, 480, 0}, /* 0f */
-	{0x487f,0x04,0x00,0x00,0x2f, 640, 400, 0}, /* 10 */
-	{0xc04f,0x31,0x01,0x06,0x31, 720, 480, 0}, /* 11 */
-	{0x004f,0x32,0x03,0x06,0x32, 720, 576, 0}, /* 12 */
-	{0x0187,0x15,0x05,0x00,0x37,1024, 768, 0}, /* 13 */
-        {0xc877,0x16,0x09,0x06,0x37,1024, 768, 0}, /* 14 */
-	{0xc067,0x17,0x0b,0x49,0x37,1024, 768, 0}, /* 15 - CRT1CRTC was 0x97 */
-	{0x0267,0x18,0x0d,0x00,0x37,1024, 768, 0}, /* 16 */
-	{0x0047,0x19,0x11,0x8c,0x37,1024, 768, 0}, /* 17 - CRT1CRTC was 0x59 */
-	{0x0047,0x1a,0x52,0x00,0x37,1024, 768, 0}, /* 18 */
-	{0x0007,0x1b,0x16,0x00,0x37,1024, 768, 0}, /* 19 - CRT1CRTC was 0x5b */
-	{0x0387,0x1c,0x4d,0x00,0x3a,1280,1024, 0}, /* 1a - CRT1CRTC was 0x5c */
-	{0x0077,0x1d,0x14,0x07,0x3a,1280,1024, 0}, /* 1b */
-	{0x0047,0x1e,0x17,0x00,0x3a,1280,1024, 0}, /* 1c */
-	{0x0007,0x1f,0x98,0x00,0x3a,1280,1024, 0}, /* 1d */
-	{0x0007,0x20,0x59,0x00,0x3c,1600,1200, 0}, /* 1e - CRT1CRTC was 0x60 */
-	{0x0007,0x21,0x5a,0x00,0x3c,1600,1200, 0}, /* 1f */
-	{0x0007,0x22,0x1b,0x00,0x3c,1600,1200, 0}, /* 20 */
-	{0x0007,0x23,0x1d,0x00,0x3c,1600,1200, 0}, /* 21 - CRT1CRTC was 0x63 */
-	{0x0007,0x24,0x1e,0x00,0x3c,1600,1200, 0}, /* 22 */
-	{0x407f,0x00,0x00,0x00,0x40, 320, 200, 0}, /* 23 */
-	{0xc07f,0x01,0x00,0x04,0x50, 320, 240, 0}, /* 24 */
-	{0x0077,0x02,0x04,0x05,0x51, 400, 300, 0}, /* 25 */
-	{0xc877,0x03,0x09,0x06,0x52, 512, 384, 0}, /* 26 */  /* was c077 */
-	{0x8207,0x25,0x1f,0x00,0x68,1920,1440, 0}, /* 27 */
-	{0x0007,0x26,0x20,0x00,0x6c,2048,1536, 0}, /* 28 */
-	{0x0067,0x27,0x14,0x08,0x6e,1280, 960, 0}, /* 29 - TW: 1280x960-60 */
-	{0x0027,0x45,0x3c,0x08,0x6e,1280, 960, 0}, /* 2a - TW: 1280x960-85 */
-	{0xc077,0x33,0x09,0x06,0x20,1024, 600, 0}, /* 2b */
-	{0xc077,0x34,0x0b,0x06,0x23,1152, 768, 0}, /* 2c */	/* VCLK 0x09 */
-	{0x0057,0x35,0x27,0x08,0x70, 800, 480, 0}, /* 2d */
-	{0x0047,0x36,0x37,0x08,0x70, 800, 480, 0}, /* 2e */
-	{0x0047,0x37,0x08,0x08,0x70, 800, 480, 0}, /* 2f */
-	{0x0057,0x38,0x09,0x09,0x71,1024, 576, 0}, /* 30 */
-	{0x0047,0x39,0x38,0x09,0x71,1024, 576, 0}, /* 31 */
-	{0x0047,0x3a,0x11,0x09,0x71,1024, 576, 0}, /* 32 */
-	{0x0057,0x3b,0x39,0x0a,0x75,1280, 720, 0}, /* 33 */
-	{0x0047,0x3c,0x3a,0x0a,0x75,1280, 720, 0}, /* 34 */
-	{0x0007,0x3d,0x3b,0x0a,0x75,1280, 720, 0}, /* 35 */
-	{0x0047,0x3e,0x34,0x06,0x29,1152, 864, 0}, /* 36 1152x864-75Hz */
-	{0x0047,0x44,0x3a,0x06,0x29,1152, 864, 0}, /* 37 1152x864-85Hz */
-	{0x00c7,0x3f,0x28,0x00,0x39, 848, 480, 0}, /* 38 848x480-38Hzi */
-	{0xc067,0x40,0x3d,0x0b,0x39, 848, 480, 0}, /* 39 848x480-60Hz  */
-	{0x00c7,0x41,0x28,0x00,0x3f, 856, 480, 0}, /* 3a 856x480-38Hzi */
-	{0xc047,0x42,0x28,0x00,0x3f, 856, 480, 0}, /* 3b 856x480-60Hz  */
-	{0x0067,0x43,0x3e,0x0c,0x48,1360, 768, 0}, /* 3c 1360x768-60Hz */
-	{0x0077,0x46,0x3f,0x08,0x55,1280, 768, 0}, /* 3d 1280x768-60Hz */
-	{0x004f,0x47,0x03,0x06,0x5f, 768, 576, 0}, /* 3e 768x576 */
-	{0x0027,0x48,0x13,0x08,0x67,1360,1024, 0}, /* 3f 1360x1024-59Hz (BARCO1366 only) */
-	{0xffff,   0,   0,   0,   0,   0,   0, 0}
-};
-
-typedef struct _SiS_VBModeIDTableStruct
-{
-	UCHAR  ModeID;
-	UCHAR  VB_TVDelayIndex;
-	UCHAR  VB_TVFlickerIndex;
-	UCHAR  VB_TVPhaseIndex;
-	UCHAR  VB_TVYFilterIndex;
-	UCHAR  VB_LCDDelayIndex;
-	UCHAR  _VB_LCDHIndex;
-	UCHAR  _VB_LCDVIndex;
-}SiS_VBModeIDTableStruct;
-
-static const SiS_VBModeIDTableStruct  SiS300_VBModeIDTable[] =
+static const SiS_ExtStruct  SiS300_EModeIDTable[] =
+{
+	{0x6a,0x2212,0x0102,SIS_RI_800x600,  0x00,0x00,0x00,0x00,0x00,-1},  /* 800x600x? */
+	{0x2e,0x0a1b,0x0101,SIS_RI_640x480,  0x00,0x00,0x00,0x00,0x08,-1},
+	{0x2f,0x021b,0x0100,SIS_RI_640x400,  0x00,0x00,0x00,0x00,0x10,-1},  /* 640x400x8 */
+	{0x30,0x2a1b,0x0103,SIS_RI_800x600,  0x00,0x00,0x00,0x00,0x00,-1},
+	{0x31,0x0a1b,0x0000,SIS_RI_720x480,  0x00,0x00,0x00,0x00,0x11,-1},  /* 720x480x8 */
+	{0x32,0x2a1b,0x0000,SIS_RI_720x576,  0x00,0x00,0x00,0x00,0x12,-1},  /* 720x576x8 */
+	{0x33,0x0a1d,0x0000,SIS_RI_720x480,  0x00,0x00,0x00,0x00,0x11,-1},  /* 720x480x16 */
+	{0x34,0x2a1d,0x0000,SIS_RI_720x576,  0x00,0x00,0x00,0x00,0x12,-1},  /* 720x576x16 */
+	{0x35,0x0a1f,0x0000,SIS_RI_720x480,  0x00,0x00,0x00,0x00,0x11,-1},  /* 720x480x32 */
+	{0x36,0x2a1f,0x0000,SIS_RI_720x576,  0x00,0x00,0x00,0x00,0x12,-1},  /* 720x576x32 */
+	{0x37,0x0212,0x0104,SIS_RI_1024x768, 0x00,0x00,0x00,0x00,0x13,-1},  /* 1024x768x? */
+	{0x38,0x0a1b,0x0105,SIS_RI_1024x768, 0x00,0x00,0x00,0x00,0x13,-1},  /* 1024x768x8 */
+	{0x3a,0x0e3b,0x0107,SIS_RI_1280x1024,0x00,0x00,0x00,0x00,0x1a,-1},  /* 1280x1024x8 */
+	{0x3c,0x063b,0x0130,SIS_RI_1600x1200,0x00,0x00,0x00,0x00,0x1e,-1},
+	{0x3d,0x067d,0x0131,SIS_RI_1600x1200,0x00,0x00,0x00,0x00,0x1e,-1},
+	{0x40,0x921c,0x010d,SIS_RI_320x200,  0x00,0x00,0x00,0x00,0x23,-1},  /* 320x200x15 */
+	{0x41,0x921d,0x010e,SIS_RI_320x200,  0x00,0x00,0x00,0x00,0x23,-1},  /* 320x200x16 */
+	{0x43,0x0a1c,0x0110,SIS_RI_640x480,  0x00,0x00,0x00,0x00,0x08,-1},
+	{0x44,0x0a1d,0x0111,SIS_RI_640x480,  0x00,0x00,0x00,0x00,0x08,-1},
+	{0x46,0x2a1c,0x0113,SIS_RI_800x600,  0x00,0x00,0x00,0x00,0x00,-1},  /* 800x600x15 */
+	{0x47,0x2a1d,0x0114,SIS_RI_800x600,  0x00,0x00,0x00,0x00,0x00,-1},  /* 800x600x16 */
+	{0x49,0x0a3c,0x0116,SIS_RI_1024x768, 0x00,0x00,0x00,0x00,0x13,-1},
+	{0x4a,0x0a3d,0x0117,SIS_RI_1024x768, 0x00,0x00,0x00,0x00,0x13,-1},
+	{0x4c,0x0e7c,0x0119,SIS_RI_1280x1024,0x00,0x00,0x00,0x00,0x1a,-1},
+	{0x4d,0x0e7d,0x011a,SIS_RI_1280x1024,0x00,0x00,0x00,0x00,0x1a,-1},
+	{0x50,0x921b,0x0132,SIS_RI_320x240,  0x00,0x00,0x00,0x00,0x24,-1},  /* 320x240x8  */
+	{0x51,0xb21b,0x0133,SIS_RI_400x300,  0x00,0x00,0x00,0x00,0x25,-1},  /* 400x300x8  */
+	{0x52,0x921b,0x0134,SIS_RI_512x384,  0x00,0x00,0x00,0x00,0x26,-1},  /* 512x384x8  */
+	{0x56,0x921d,0x0135,SIS_RI_320x240,  0x00,0x00,0x00,0x00,0x24,-1},  /* 320x240x16 */
+	{0x57,0xb21d,0x0136,SIS_RI_400x300,  0x00,0x00,0x00,0x00,0x25,-1},  /* 400x300x16 */
+	{0x58,0x921d,0x0137,SIS_RI_512x384,  0x00,0x00,0x00,0x00,0x26,-1},  /* 512x384x16 */
+	{0x59,0x921b,0x0138,SIS_RI_320x200,  0x00,0x00,0x00,0x00,0x23,-1},  /* 320x200x8  */
+	{0x5c,0x921f,0x0000,SIS_RI_512x384,  0x00,0x00,0x00,0x00,0x26,-1},  /* 512x384x32 */
+	{0x5d,0x021d,0x0139,SIS_RI_640x400,  0x00,0x00,0x00,0x00,0x10,-1},  /* 640x400x16 */
+ 	{0x5e,0x021f,0x0000,SIS_RI_640x400,  0x00,0x00,0x00,0x00,0x10,-1},  /* 640x400x32 */
+	{0x62,0x0a3f,0x013a,SIS_RI_640x480,  0x00,0x00,0x00,0x00,0x08,-1},
+	{0x63,0x2a3f,0x013b,SIS_RI_800x600,  0x00,0x00,0x00,0x00,0x00,-1},  /* 800x600x32 */
+	{0x64,0x0a7f,0x013c,SIS_RI_1024x768, 0x00,0x00,0x00,0x00,0x13,-1},
+	{0x65,0x0eff,0x013d,SIS_RI_1280x1024,0x00,0x00,0x00,0x00,0x1a,-1},
+	{0x66,0x06ff,0x013e,SIS_RI_1600x1200,0x00,0x00,0x00,0x00,0x1e,-1},
+	{0x68,0x067b,0x013f,SIS_RI_1920x1440,0x00,0x00,0x00,0x00,0x27,-1},
+	{0x69,0x06fd,0x0140,SIS_RI_1920x1440,0x00,0x00,0x00,0x00,0x27,-1},
+	{0x6b,0x07ff,0x0000,SIS_RI_1920x1440,0x00,0x00,0x00,0x00,0x27,-1},
+	{0x6c,0x067b,0x0000,SIS_RI_2048x1536,0x00,0x00,0x00,0x00,0x28,-1},  /* 2048x1536x8 - not in BIOS! */
+	{0x6d,0x06fd,0x0000,SIS_RI_2048x1536,0x00,0x00,0x00,0x00,0x28,-1},  /* 2048x1536x16 - not in BIOS! */
+	{0x70,0x2a1b,0x0000,SIS_RI_800x480,  0x00,0x00,0x07,0x00,0x2d,-1},  /* 800x480x8 */
+	{0x71,0x0a1b,0x0000,SIS_RI_1024x576, 0x00,0x00,0x00,0x00,0x30,-1},  /* 1024x576x8 */
+	{0x74,0x0a1d,0x0000,SIS_RI_1024x576, 0x00,0x00,0x00,0x00,0x30,-1},  /* 1024x576x16 */
+	{0x75,0x0e3d,0x0000,SIS_RI_1280x720, 0x00,0x00,0x00,0x00,0x33,-1},  /* 1280x720x16 */
+	{0x76,0x2a1f,0x0000,SIS_RI_800x480,  0x00,0x00,0x07,0x00,0x2d,-1},  /* 800x480x32 */
+	{0x77,0x0a3f,0x0000,SIS_RI_1024x576, 0x00,0x00,0x00,0x00,0x30,-1},  /* 1024x576x32 */
+	{0x78,0x0eff,0x0000,SIS_RI_1280x720, 0x00,0x00,0x00,0x00,0x33,-1},  /* 1280x720x32 */
+	{0x79,0x0e3b,0x0000,SIS_RI_1280x720, 0x00,0x00,0x00,0x00,0x33,-1},  /* 1280x720x8 */
+	{0x7a,0x2a1d,0x0000,SIS_RI_800x480,  0x00,0x00,0x07,0x00,0x2d,-1},  /* 800x480x16 */
+	{0x7c,0x0a3b,0x0000,SIS_RI_1280x960, 0x00,0x00,0x00,0x00,0x29,-1},  /* 1280x960x8 */
+	{0x7d,0x0a7d,0x0000,SIS_RI_1280x960, 0x00,0x00,0x00,0x00,0x29,-1},  /* 1280x960x16 */
+	{0x7e,0x0aff,0x0000,SIS_RI_1280x960, 0x00,0x00,0x00,0x00,0x29,-1},  /* 1280x960x32 */
+	{0x20,0x0a1b,0x0000,SIS_RI_1024x600, 0x00,0x00,0x00,0x00,0x2b,-1},  /* 1024x600 */
+	{0x21,0x0a3d,0x0000,SIS_RI_1024x600, 0x00,0x00,0x00,0x00,0x2b,-1},
+	{0x22,0x0a7f,0x0000,SIS_RI_1024x600, 0x00,0x00,0x00,0x00,0x2b,-1},
+	{0x23,0x0a1b,0x0000,SIS_RI_1152x768, 0x00,0x00,0x00,0x00,0x2c,-1},  /* 1152x768 */
+	{0x24,0x0a3d,0x0000,SIS_RI_1152x768, 0x00,0x00,0x00,0x00,0x2c,-1},
+	{0x25,0x0a7f,0x0000,SIS_RI_1152x768, 0x00,0x00,0x00,0x00,0x2c,-1},
+	{0x29,0x0e1b,0x0000,SIS_RI_1152x864, 0x00,0x00,0x00,0x00,0x36,-1},  /* 1152x864 */
+	{0x2a,0x0e3d,0x0000,SIS_RI_1152x864, 0x00,0x00,0x00,0x00,0x36,-1},
+	{0x2b,0x0e7f,0x0000,SIS_RI_1152x864, 0x00,0x00,0x00,0x00,0x36,-1},
+	{0x39,0x2a1b,0x0000,SIS_RI_848x480,  0x00,0x00,0x00,0x00,0x38,-1},  /* 848x480 */
+	{0x3b,0x2a3d,0x0000,SIS_RI_848x480,  0x00,0x00,0x00,0x00,0x38,-1},
+	{0x3e,0x2a7f,0x0000,SIS_RI_848x480,  0x00,0x00,0x00,0x00,0x38,-1},
+	{0x3f,0x2a1b,0x0000,SIS_RI_856x480,  0x00,0x00,0x00,0x00,0x3a,-1},  /* 856x480 */
+	{0x42,0x2a3d,0x0000,SIS_RI_856x480,  0x00,0x00,0x00,0x00,0x3a,-1},
+	{0x45,0x2a7f,0x0000,SIS_RI_856x480,  0x00,0x00,0x00,0x00,0x3a,-1},
+	{0x48,0x223b,0x0000,SIS_RI_1360x768, 0x00,0x00,0x00,0x00,0x3c,-1},  /* 1360x768 */
+	{0x4b,0x227d,0x0000,SIS_RI_1360x768, 0x00,0x00,0x00,0x00,0x3c,-1},
+	{0x4e,0x22ff,0x0000,SIS_RI_1360x768, 0x00,0x00,0x00,0x00,0x3c,-1},
+	{0x4f,0x921f,0x0000,SIS_RI_320x200,  0x00,0x00,0x00,0x00,0x23,-1},  /* 320x200x32 */
+	{0x53,0x921f,0x0000,SIS_RI_320x240,  0x00,0x00,0x00,0x00,0x24,-1},  /* 320x240x32 */
+	{0x54,0xb21f,0x0000,SIS_RI_400x300,  0x00,0x00,0x00,0x00,0x25,-1},  /* 400x300x32 */
+	{0x55,0x2e3b,0x0000,SIS_RI_1280x768, 0x00,0x00,0x00,0x00,0x3d,-1},  /* 1280x768   */
+	{0x5a,0x2e7d,0x0000,SIS_RI_1280x768, 0x00,0x00,0x00,0x00,0x3d,-1},
+	{0x5b,0x2eff,0x0000,SIS_RI_1280x768, 0x00,0x00,0x00,0x00,0x3d,-1},
+	{0x5f,0x2a1b,0x0000,SIS_RI_768x576,  0x00,0x00,0x00,0x00,0x3e,-1},  /* 768x576x8 */
+	{0x60,0x2a1d,0x0000,SIS_RI_768x576,  0x00,0x00,0x00,0x00,0x3e,-1},  /* 768x576x16 */
+	{0x61,0x2a1f,0x0000,SIS_RI_768x576,  0x00,0x00,0x00,0x00,0x3e,-1},  /* 768x576x32 */
+	{0x67,0x2e3b,0x0000,SIS_RI_1360x1024,0x00,0x00,0x00,0x00,0x3f,-1},  /* 1360x1024x8 (BARCO) */
+	{0x6f,0x2e7d,0x0000,SIS_RI_1360x1024,0x00,0x00,0x00,0x00,0x3f,-1},  /* 1360x1024x16 (BARCO) */
+	{0x72,0x2eff,0x0000,SIS_RI_1360x1024,0x00,0x00,0x00,0x00,0x3f,-1},  /* 1360x1024x32 (BARCO) */
+	{0xff,0x0000,0xffff,0,               0x00,0x00,0x00,0x00,0x00}
+};
+
+static const SiS_Ext2Struct  SiS300_RefIndex[] =
+{
+	{0x085f,0x0d,0x03,0x05,0x05,0x6a, 800, 600, 0}, /* 00 */
+	{0x0467,0x0e,0x44,0x05,0x05,0x6a, 800, 600, 0}, /* 01 */
+	{0x0067,0x0f,0x07,0x48,0x00,0x6a, 800, 600, 0}, /* 02 - CRT1CRTC was 0x4f */
+	{0x0067,0x10,0x06,0x8b,0x00,0x6a, 800, 600, 0}, /* 03 */
+	{0x0147,0x11,0x08,0x00,0x00,0x6a, 800, 600, 0}, /* 04 */
+	{0x0147,0x12,0x0c,0x00,0x00,0x6a, 800, 600, 0}, /* 05 */
+	{0x0047,0x11,0x4e,0x00,0x00,0x6a, 800, 600, 0}, /* 06 - CRT1CRTC was 0x51 */
+	{0x0047,0x11,0x13,0x00,0x00,0x6a, 800, 600, 0}, /* 07 */
+	{0xc85f,0x05,0x00,0x04,0x04,0x2e, 640, 480, 0}, /* 08 */
+	{0xc067,0x06,0x02,0x04,0x04,0x2e, 640, 480, 0}, /* 09 */
+	{0xc067,0x07,0x02,0x47,0x04,0x2e, 640, 480, 0}, /* 0a */
+	{0xc067,0x08,0x03,0x8a,0x04,0x2e, 640, 480, 0}, /* 0b */
+	{0xc047,0x09,0x05,0x00,0x00,0x2e, 640, 480, 0}, /* 0c */
+	{0xc047,0x0a,0x08,0x00,0x00,0x2e, 640, 480, 0}, /* 0d */
+	{0xc047,0x0b,0x0a,0x00,0x00,0x2e, 640, 480, 0}, /* 0e */
+	{0xc047,0x0c,0x10,0x00,0x00,0x2e, 640, 480, 0}, /* 0f */
+	{0x487f,0x04,0x00,0x00,0x00,0x2f, 640, 400, 0}, /* 10 */
+	{0xc04f,0x31,0x01,0x06,0x00,0x31, 720, 480, 0}, /* 11 */
+	{0x004f,0x32,0x03,0x06,0x00,0x32, 720, 576, 0}, /* 12 */
+	{0x0187,0x15,0x05,0x00,0x00,0x37,1024, 768, 0}, /* 13 */
+        {0xc877,0x16,0x09,0x06,0x06,0x37,1024, 768, 0}, /* 14 */
+	{0xc067,0x17,0x0b,0x49,0x06,0x37,1024, 768, 0}, /* 15 - CRT1CRTC was 0x97 */
+	{0x0267,0x18,0x0d,0x00,0x06,0x37,1024, 768, 0}, /* 16 */
+	{0x0047,0x19,0x11,0x8c,0x00,0x37,1024, 768, 0}, /* 17 - CRT1CRTC was 0x59 */
+	{0x0047,0x1a,0x52,0x00,0x00,0x37,1024, 768, 0}, /* 18 */
+	{0x0007,0x1b,0x16,0x00,0x00,0x37,1024, 768, 0}, /* 19 - CRT1CRTC was 0x5b */
+	{0x0387,0x1c,0x4d,0x00,0x00,0x3a,1280,1024, 0}, /* 1a - CRT1CRTC was 0x5c */
+	{0x0077,0x1d,0x14,0x07,0x00,0x3a,1280,1024, 0}, /* 1b */
+	{0x0047,0x1e,0x17,0x00,0x00,0x3a,1280,1024, 0}, /* 1c */
+	{0x0007,0x1f,0x98,0x00,0x00,0x3a,1280,1024, 0}, /* 1d */
+	{0x0007,0x20,0x59,0x00,0x00,0x3c,1600,1200, 0}, /* 1e - CRT1CRTC was 0x60 */
+	{0x0007,0x21,0x5a,0x00,0x00,0x3c,1600,1200, 0}, /* 1f */
+	{0x0007,0x22,0x1b,0x00,0x00,0x3c,1600,1200, 0}, /* 20 */
+	{0x0007,0x23,0x1d,0x00,0x00,0x3c,1600,1200, 0}, /* 21 - CRT1CRTC was 0x63 */
+	{0x0007,0x24,0x1e,0x00,0x00,0x3c,1600,1200, 0}, /* 22 */
+	{0x407f,0x00,0x00,0x00,0x00,0x40, 320, 200, 0}, /* 23 */
+	{0xc07f,0x01,0x00,0x04,0x04,0x50, 320, 240, 0}, /* 24 */
+	{0x0077,0x02,0x04,0x05,0x05,0x51, 400, 300, 0}, /* 25 */
+	{0xc877,0x03,0x09,0x06,0x06,0x52, 512, 384, 0}, /* 26 */  /* was c077 */
+	{0x8207,0x25,0x1f,0x00,0x00,0x68,1920,1440, 0}, /* 27 */
+	{0x0007,0x26,0x20,0x00,0x00,0x6c,2048,1536, 0}, /* 28 */
+	{0x0067,0x27,0x14,0x08,0x0a,0x6e,1280, 960, 0}, /* 29 - 1280x960-60 */
+	{0x0027,0x45,0x3c,0x08,0x0a,0x6e,1280, 960, 0}, /* 2a - 1280x960-85 */
+	{0xc077,0x33,0x09,0x06,0x00,0x20,1024, 600, 0}, /* 2b */
+	{0xc077,0x34,0x0b,0x06,0x00,0x23,1152, 768, 0}, /* 2c */	/* VCLK 0x09 */
+	{0x0057,0x35,0x27,0x08,0x00,0x70, 800, 480, 0}, /* 2d */
+	{0x0047,0x36,0x37,0x08,0x00,0x70, 800, 480, 0}, /* 2e */
+	{0x0047,0x37,0x08,0x08,0x00,0x70, 800, 480, 0}, /* 2f */
+	{0x0057,0x38,0x09,0x09,0x00,0x71,1024, 576, 0}, /* 30 */
+	{0x0047,0x39,0x38,0x09,0x00,0x71,1024, 576, 0}, /* 31 */
+	{0x0047,0x3a,0x11,0x09,0x00,0x71,1024, 576, 0}, /* 32 */
+	{0x0057,0x3b,0x39,0x0a,0x00,0x75,1280, 720, 0}, /* 33 */
+	{0x0047,0x3c,0x3a,0x0a,0x00,0x75,1280, 720, 0}, /* 34 */
+	{0x0007,0x3d,0x3b,0x0a,0x00,0x75,1280, 720, 0}, /* 35 */
+	{0x0047,0x3e,0x34,0x06,0x00,0x29,1152, 864, 0}, /* 36 1152x864-75Hz */
+	{0x0047,0x44,0x3a,0x06,0x00,0x29,1152, 864, 0}, /* 37 1152x864-85Hz */
+	{0x00c7,0x3f,0x28,0x00,0x00,0x39, 848, 480, 0}, /* 38 848x480-38Hzi */
+	{0xc067,0x40,0x3d,0x0b,0x0b,0x39, 848, 480, 0}, /* 39 848x480-60Hz  */
+	{0x00c7,0x41,0x28,0x00,0x00,0x3f, 856, 480, 0}, /* 3a 856x480-38Hzi */
+	{0xc047,0x42,0x28,0x00,0x00,0x3f, 856, 480, 0}, /* 3b 856x480-60Hz  */
+	{0x0067,0x43,0x3e,0x0c,0x0b,0x48,1360, 768, 0}, /* 3c 1360x768-60Hz */
+	{0x0077,0x46,0x3f,0x08,0x00,0x55,1280, 768, 0}, /* 3d 1280x768-60Hz */
+	{0x004f,0x47,0x03,0x06,0x00,0x5f, 768, 576, 0}, /* 3e 768x576 */
+	{0x0027,0x48,0x13,0x08,0x08,0x67,1360,1024, 0}, /* 3f 1360x1024-59Hz (BARCO1366 only) */
+	{0xffff,   0,   0,   0,   0,   0,   0,   0, 0}
+};
+
+static const SiS_VBModeStruct SiS300_VBModeIDTable[] =
 {
 	{0x01,0x00,0x00,0x00,0x00,0x00,0x00,0x00},
 	{0x01,0x00,0x00,0x00,0x00,0x00,0x00,0x01},
@@ -355,12 +302,7 @@ static const SiS_VBModeIDTableStruct  SiS300_VBModeIDTable[] =
 	{0xff,0x00,0x00,0x00,0x00,0x00,0x00,0x00}
 };
 
-typedef struct _SiS300_CRT1TableStruct
-{
-	UCHAR CR[17];
-} SiS300_CRT1TableStruct;
-
-static const SiS300_CRT1TableStruct  SiS300_CRT1Table[] =
+static const SiS_CRT1TableStruct  SiS300_CRT1Table[] =
 {
 #if 1
  {{0x2d,0x27,0x28,0x90,0x2c,0x80,0xbf,0x1f,    /* 0x00 - 320x200 */
@@ -625,13 +567,7 @@ static const SiS300_CRT1TableStruct  SiS300_CRT1Table[] =
    0x00}}   /* 0x48 */
 };
 
-typedef struct _SiS300_MCLKDataStruct
-{
-	UCHAR SR28,SR29,SR2A;
-	USHORT CLOCK;
-} SiS300_MCLKDataStruct;
-
-static const SiS300_MCLKDataStruct  SiS300_MCLKData_630[] =
+static const SiS_MCLKDataStruct  SiS300_MCLKData_630[] =
 {
 	{ 0x5a,0x64,0x80, 66},
 	{ 0xb3,0x45,0x80, 83},
@@ -643,7 +579,7 @@ static const SiS300_MCLKDataStruct  SiS300_MCLKData_630[] =
 	{ 0x37,0x61,0x80,100}
 };
 
-static const SiS300_MCLKDataStruct  SiS300_MCLKData_300[] =
+static const SiS_MCLKDataStruct  SiS300_MCLKData_300[] =
 {
 	{ 0x68,0x43,0x80,125},
 	{ 0x68,0x43,0x80,125},
@@ -655,13 +591,7 @@ static const SiS300_MCLKDataStruct  SiS300_MCLKData_300[] =
 	{ 0x37,0x61,0x80,100}
 };
 
-typedef struct _SiS300_VCLKDataStruct
-{
-	UCHAR SR2B,SR2C;
-	USHORT CLOCK;
-} SiS300_VCLKDataStruct;
-
-static const SiS300_VCLKDataStruct  SiS300_VCLKData[] =
+static SiS_VCLKDataStruct SiS300_VCLKData[] =
 {
 	{ 0x1b,0xe1, 25}, /* 0x00 */
 	{ 0x4e,0xe4, 28}, /* 0x01 */
@@ -736,14 +666,7 @@ static const SiS300_VCLKDataStruct  SiS300_VCLKData[] =
 	{ 0x37,0x61,100}, /* 0x43 */  /* 1280x960 LCD */
 	{ 0xe3,0x9a,106}, /* 0x44 */  /* 1360x1024 - special for Barco iQ R300 */
 	{ 0xe2,0x46,135}, /* 0x45 */  /* 1280x1024-75, better clock for VGA2 */
-	{ 0xff,0x00,  0}
-};
-
-static const UCHAR  SiS300_ScreenOffset[] =
-{
-	0x14,0x19,0x20,0x28,0x32,0x40,0x50,
-        0x64,0x78,0x80,0x2d,0x35,0x48,0x35,
-	0x55,0x30,0xff
+	{    0,   0,  0}  /* 0x46 custom (will be filled out) */
 };
 
 #ifndef LINUX_XF86
@@ -789,12 +712,7 @@ static const DRAM4Type SiS300_CR40[5];
 static UCHAR SiS300_CR49[2];
 #endif
 
-typedef struct _SiS300_PanelDelayTblStruct
-{
-	UCHAR timer[2];
-} SiS300_PanelDelayTblStruct;
-
-static const SiS300_PanelDelayTblStruct  SiS300_PanelDelayTbl[] =
+static const SiS_PanelDelayTblStruct  SiS300_PanelDelayTbl[] =
 {
 	{{0x05,0xaa}},
 	{{0x05,0x14}},
@@ -815,7 +733,7 @@ static const SiS300_PanelDelayTblStruct  SiS300_PanelDelayTbl[] =
 };
 
 #if 0
-static const SiS300_PanelDelayTblStruct  SiS300_PanelDelayTblLVDS[] =
+static const SiS_PanelDelayTblStruct  SiS300_PanelDelayTblLVDS[] =
 {
 	{{0x05,0xaa}},
 	{{0x05,0x14}},
@@ -840,28 +758,18 @@ static const SiS300_PanelDelayTblStruct  SiS300_PanelDelayTblLVDS[] =
 /* SIS VIDEO BRIDGE ----------------------------------------- */
 /**************************************************************/
 
-typedef struct _SiS300_LCDDataStruct
-{
-	USHORT RVBHCMAX;
-	USHORT RVBHCFACT;
-	USHORT VGAHT;
-	USHORT VGAVT;
-	USHORT LCDHT;
-	USHORT LCDVT;
-} SiS300_LCDDataStruct;
-
-static const SiS300_LCDDataStruct  SiS300_StLCD1024x768Data[] =
+static const SiS_LCDDataStruct  SiS300_St2LCD1024x768Data[] =
 {
-	{   66,  31, 992, 510,1320, 816},
-	{   66,  31, 992, 510,1320, 816},
-	{  176,  75, 900, 510,1320, 816},
-	{  176,  75, 900, 510,1320, 816},
-	{   66,  31, 992, 510,1320, 816},
-	{   27,  16,1024, 650,1350, 832},
+	{   62,  25, 800, 546,1344, 806},
+	{   32,  15, 930, 546,1344, 806},
+	{   32,  15, 930, 546,1344, 806},
+	{  104,  45, 945, 496,1344, 806},
+	{   62,  25, 800, 546,1344, 806},
+	{   31,  18,1008, 624,1344, 806},
 	{    1,   1,1344, 806,1344, 806}
 };
 
-static const SiS300_LCDDataStruct  SiS300_ExtLCD1024x768Data[] =
+static const SiS_LCDDataStruct  SiS300_ExtLCD1024x768Data[] =
 {
 	{   12,   5, 896, 512,1344, 806},
 	{   12,   5, 896, 510,1344, 806},
@@ -878,30 +786,19 @@ static const SiS300_LCDDataStruct  SiS300_ExtLCD1024x768Data[] =
 	{    1,   1,1344, 806,1344, 806}
 };
 
-static const SiS300_LCDDataStruct  SiS300_St2LCD1024x768Data[] =
-{
-	{   62,  25, 800, 546,1344, 806},
-	{   32,  15, 930, 546,1344, 806},
-	{   32,  15, 930, 546,1344, 806},
-	{  104,  45, 945, 496,1344, 806},
-	{   62,  25, 800, 546,1344, 806},
-	{   31,  18,1008, 624,1344, 806},
-	{    1,   1,1344, 806,1344, 806}
-};
-
-static const SiS300_LCDDataStruct  SiS300_StLCD1280x1024Data[] =
+static const SiS_LCDDataStruct  SiS300_St2LCD1280x1024Data[] =
 {
-	{    4,   1, 880, 510,1650,1088},
-	{    4,   1, 880, 510,1650,1088},
+	{   22,   5, 800, 510,1650,1088},
+	{   22,   5, 800, 510,1650,1088},
 	{  176,  45, 900, 510,1650,1088},
 	{  176,  45, 900, 510,1650,1088},
-	{    4,   1, 880, 510,1650,1088},
+	{   22,   5, 800, 510,1650,1088},
 	{   13,   5,1024, 675,1560,1152},
 	{   16,   9,1266, 804,1688,1072},
 	{    1,   1,1688,1066,1688,1066}
 };
 
-static const SiS300_LCDDataStruct  SiS300_ExtLCD1280x1024Data[] =
+static const SiS_LCDDataStruct  SiS300_ExtLCD1280x1024Data[] =
 {
 	{  211,  60,1024, 501,1688,1066},
 	{  211,  60,1024, 508,1688,1066},
@@ -913,74 +810,18 @@ static const SiS300_LCDDataStruct  SiS300_ExtLCD1280x1024Data[] =
 	{    1,   1,1688,1066,1688,1066}
 };
 
-static const SiS300_LCDDataStruct  SiS300_St2LCD1280x1024Data[] =
-{
-	{   22,   5, 800, 510,1650,1088},
-	{   22,   5, 800, 510,1650,1088},
-	{  176,  45, 900, 510,1650,1088},
-	{  176,  45, 900, 510,1650,1088},
-	{   22,   5, 800, 510,1650,1088},
-	{   13,   5,1024, 675,1560,1152},
-	{   16,   9,1266, 804,1688,1072},
-	{    1,   1,1688,1066,1688,1066}
-};
-
-static const SiS300_LCDDataStruct  SiS300_NoScaleData1024x768[] =
-{
-	{    1,   1, 800, 449, 800, 449},
-	{    1,   1, 800, 449, 800, 449},
-	{    1,   1, 900, 449, 900, 449},
-	{    1,   1, 900, 449, 900, 449},
-	{    1,   1, 800, 525, 800, 525},
-	{    1,   1,1056, 628,1056, 628},
-	{    1,   1,1344, 806,1344, 806},
-	{    1,   1,1688,1066,1688,1066}
-};
-
-static const SiS300_LCDDataStruct  SiS300_NoScaleData1280x1024[] =  /* TW: Fake */
-{
-	{    1,   1, 800, 449, 800, 449},
-	{    1,   1, 800, 449, 800, 449},
-	{    1,   1, 900, 449, 900, 449},
-	{    1,   1, 900, 449, 900, 449},
-	{    1,   1, 800, 525, 800, 525},
-	{    1,   1,1056, 628,1056, 628},
-	{    1,   1,1344, 806,1344, 806},
-	{    1,   1,1688,1066,1688,1066}
-};
-
-typedef struct _SiS300_Part2PortTblStruct
-{
- 	UCHAR CR[12];
-} SiS300_Part2PortTblStruct;
-
-static const SiS300_Part2PortTblStruct SiS300_CRT2Part2_1024x768_1[] =
+static const SiS_Part2PortTblStruct SiS300_CRT2Part2_1024x768_1[] =
 { /* VESA Timing */
- {{0x21,0x12,0xbf,0xe4,0xc0,0x21,0x45,0x09,0x00,0xa9,0x09,0x04}},
- {{0x2c,0x12,0x9a,0xae,0x88,0x21,0x45,0x09,0x00,0xa9,0x09,0x04}},
- {{0x21,0x12,0xbf,0xe4,0xc0,0x21,0x45,0x09,0x00,0xa9,0x09,0x04}},
- {{0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00}},
- {{0x22,0x13,0xfe,0x25,0xff,0x21,0x45,0x0a,0x00,0xa9,0x0d,0x04}},
- {{0x22,0x13,0xfe,0x25,0xff,0x21,0x45,0x0a,0x00,0xa9,0x0d,0x04}},
- {{0x22,0x13,0xfe,0x25,0xff,0x21,0x45,0x0a,0x00,0xa9,0x0d,0x04}}
+  {{0x21,0x12,0xbf,0xe4,0xc0,0x21,0x45,0x09,0x00,0xa9,0x09,0x04}},
+  {{0x2c,0x12,0x9a,0xae,0x88,0x21,0x45,0x09,0x00,0xa9,0x09,0x04}},
+  {{0x21,0x12,0xbf,0xe4,0xc0,0x21,0x45,0x09,0x00,0xa9,0x09,0x04}},
+  {{0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00}},
+  {{0x22,0x13,0xfe,0x25,0xff,0x21,0x45,0x0a,0x00,0xa9,0x0d,0x04}},
+  {{0x22,0x13,0xfe,0x25,0xff,0x21,0x45,0x0a,0x00,0xa9,0x0d,0x04}},
+  {{0x22,0x13,0xfe,0x25,0xff,0x21,0x45,0x0a,0x00,0xa9,0x0d,0x04}}
 };
 
-static const SiS300_Part2PortTblStruct SiS300_CRT2Part2_1280x1024_1[] =
-{	/* TW: Temporary data, invalid */
- {{0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00}}
-};
-
-static const SiS300_Part2PortTblStruct SiS300_CRT2Part2_1400x1050_1[] =
-{	/* TW: Temporary data, invalid */
- {{0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00}}
-};
-
-static const SiS300_Part2PortTblStruct SiS300_CRT2Part2_1600x1200_1[] =
-{	/* TW: Temporary data, invalid */
- {{0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00}}
-};
-
-static const SiS300_Part2PortTblStruct SiS300_CRT2Part2_1024x768_2[] =
+static const SiS_Part2PortTblStruct SiS300_CRT2Part2_1024x768_2[] =
 {  /* Non-VESA */
  {{0x28,0x12,0xa3,0xd0,0xaa,0x5a,0x45,0x0a,0x07,0xfa,0x0a,0x24}},
  {{0x2c,0x12,0x9a,0xae,0x88,0x5a,0x45,0x0a,0x07,0xfa,0x0a,0x24}},
@@ -991,38 +832,23 @@ static const SiS300_Part2PortTblStruct SiS300_CRT2Part2_1024x768_2[] =
  {{0x36,0x13,0x13,0x25,0xff,0x5a,0x45,0x0a,0x07,0xfa,0x0a,0x24}}
 };
 
-static const SiS300_Part2PortTblStruct SiS300_CRT2Part2_1280x1024_2[] =
+static const SiS_Part2PortTblStruct SiS300_CRT2Part2_1024x768_3[] =
 {
  {{0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00}}
 };
 
-static const SiS300_Part2PortTblStruct SiS300_CRT2Part2_1400x1050_2[] =
+static const SiS_Part2PortTblStruct SiS300_CRT2Part2_1280x1024_1[] =
 {
- {{0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00}}
-};
-
-static const SiS300_Part2PortTblStruct SiS300_CRT2Part2_1600x1200_2[] =
-{	/* TW: Temporary data, invalid */
- {{0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00}}
-};
-
-static const SiS300_Part2PortTblStruct SiS300_CRT2Part2_1024x768_3[] =
-{	/* TW: Temporary data, invalid */
- {{0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00}}
-};
-
-static const SiS300_Part2PortTblStruct SiS300_CRT2Part2_1280x1024_3[] =
-{	/* TW: Temporary data, invalid */
   {{0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00}}
 };
 
-static const SiS300_Part2PortTblStruct SiS300_CRT2Part2_1400x1050_3[] =
-{	/* TW: Temporary data, invalid */
-  {{0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00}}
+static const SiS_Part2PortTblStruct SiS300_CRT2Part2_1280x1024_2[] =
+{
+ {{0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00}}
 };
 
-static const SiS300_Part2PortTblStruct SiS300_CRT2Part2_1600x1200_3[] =
-{	/* TW: Temporary data, invalid */
+static const SiS_Part2PortTblStruct SiS300_CRT2Part2_1280x1024_3[] =
+{
   {{0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00}}
 };
 
@@ -1030,15 +856,7 @@ static const SiS300_Part2PortTblStruct SiS300_CRT2Part2_1600x1200_3[] =
 /* LVDS/Chrontel -------------------------------------------- */
 /**************************************************************/
 
-typedef struct _SiS300_LVDSDataStruct
-{
-	USHORT VGAHT;
-	USHORT VGAVT;
-	USHORT LCDHT;
-	USHORT LCDVT;
-} SiS300_LVDSDataStruct;
-
-static const SiS300_LVDSDataStruct  SiS300_CHTVUPALData[] =
+static const SiS_LVDSDataStruct  SiS300_CHTVUPALData[] =
 {
 	{1008, 625,1008, 625},
 	{1008, 625,1008, 625},
@@ -1048,7 +866,7 @@ static const SiS300_LVDSDataStruct  SiS300_CHTVUPALData[] =
 	{ 936, 836, 936, 836}
 };
 
-static const SiS300_LVDSDataStruct  SiS300_CHTVOPALData[] =
+static const SiS_LVDSDataStruct  SiS300_CHTVOPALData[] =
 {
 	{1008, 625,1008, 625},
 	{1008, 625,1008, 625},
@@ -1058,7 +876,7 @@ static const SiS300_LVDSDataStruct  SiS300_CHTVOPALData[] =
 	{ 960, 750, 960, 750}
 };
 
-static const SiS300_LVDSDataStruct  SiS300_CHTVSOPALData[] =
+static const SiS_LVDSDataStruct  SiS300_CHTVSOPALData[] =
 {
 	{1008, 625,1008, 625},
 	{1008, 625,1008, 625},
@@ -1068,13 +886,8 @@ static const SiS300_LVDSDataStruct  SiS300_CHTVSOPALData[] =
 	{ 944, 625, 944, 625}
 };
 
-typedef struct _SiS300_LVDSDesStruct
-{
-	USHORT LCDHDES;
-	USHORT LCDVDES;
-} SiS300_LVDSDesStruct;
 
-static const SiS300_LVDSDesStruct  SiS300_PanelType00_1[] =
+static const SiS_LVDSDesStruct  SiS300_PanelType00_1[] =
 {
 	{ 1059, 626 },   /* 2.08 */
 	{ 1059, 624 },
@@ -1098,7 +911,7 @@ static const SiS300_LVDSDesStruct  SiS300_PanelType00_1[] =
 #endif
 };
 
-static const SiS300_LVDSDesStruct  SiS300_PanelType01_1[] =
+static const SiS_LVDSDesStruct  SiS300_PanelType01_1[] =
 {
 	{   0,   0 },  /* 2.08 */
 	{   0,   0 },
@@ -1122,7 +935,7 @@ static const SiS300_LVDSDesStruct  SiS300_PanelType01_1[] =
 #endif
 };
 
-static const SiS300_LVDSDesStruct  SiS300_PanelType02_1[] =
+static const SiS_LVDSDesStruct  SiS300_PanelType02_1[] =
 {
 	{ 1059, 626 },  /* 2.08 */
 	{ 1059, 624 },
@@ -1146,7 +959,7 @@ static const SiS300_LVDSDesStruct  SiS300_PanelType02_1[] =
 #endif
 };
 
-static const SiS300_LVDSDesStruct  SiS300_PanelType03_1[] =
+static const SiS_LVDSDesStruct  SiS300_PanelType03_1[] =
 {
 	{   8, 436},
 	{   8, 440},
@@ -1159,7 +972,7 @@ static const SiS300_LVDSDesStruct  SiS300_PanelType03_1[] =
 	{1343, 794}
 };
 
-static const SiS300_LVDSDesStruct  SiS300_PanelType04_1[] =	/* 1280x1024 */
+static const SiS_LVDSDesStruct  SiS300_PanelType04_1[] =	/* 1280x1024 */
 {
 	{1343, 798},
 	{1343, 794},
@@ -1172,7 +985,7 @@ static const SiS300_LVDSDesStruct  SiS300_PanelType04_1[] =	/* 1280x1024 */
 	{   0,   0}
 };
 
-static const SiS300_LVDSDesStruct  SiS300_PanelType05_1[] =
+static const SiS_LVDSDesStruct  SiS300_PanelType05_1[] =
 {
 	{1343, 798},
 	{1343, 794},
@@ -1185,7 +998,7 @@ static const SiS300_LVDSDesStruct  SiS300_PanelType05_1[] =
 	{   0,   0}
 };
 
-static const SiS300_LVDSDesStruct  SiS300_PanelType06_1[] =
+static const SiS_LVDSDesStruct  SiS300_PanelType06_1[] =	/* Clevo Trumpion 1024x768 */
 {
 	{1343, 798},
 	{1343, 794},
@@ -1198,7 +1011,7 @@ static const SiS300_LVDSDesStruct  SiS300_PanelType06_1[] =
 	{   0,   0}
 };
 
-static const SiS300_LVDSDesStruct  SiS300_PanelType07_1[] =
+static const SiS_LVDSDesStruct  SiS300_PanelType07_1[] =
 {
 	{1343, 798},
 	{1343, 794},
@@ -1211,7 +1024,7 @@ static const SiS300_LVDSDesStruct  SiS300_PanelType07_1[] =
 	{   0,   0}
 };
 
-static const SiS300_LVDSDesStruct  SiS300_PanelType08_1[] =
+static const SiS_LVDSDesStruct  SiS300_PanelType08_1[] =
 {
 	{1059, 626},
 	{1059, 624},
@@ -1224,7 +1037,7 @@ static const SiS300_LVDSDesStruct  SiS300_PanelType08_1[] =
 	{   0,   0}
 };
 
-static const SiS300_LVDSDesStruct  SiS300_PanelType09_1[] =
+static const SiS_LVDSDesStruct  SiS300_PanelType09_1[] =
 {
 	{1343, 798},
 	{1343, 794},
@@ -1237,7 +1050,7 @@ static const SiS300_LVDSDesStruct  SiS300_PanelType09_1[] =
 	{   0,   0}
 };
 
-static const SiS300_LVDSDesStruct  SiS300_PanelType0a_1[] =
+static const SiS_LVDSDesStruct  SiS300_PanelType0a_1[] =
 {
 	{1059, 626},
 	{1059, 624},
@@ -1250,7 +1063,7 @@ static const SiS300_LVDSDesStruct  SiS300_PanelType0a_1[] =
 	{   0,   0}
 };
 
-static const SiS300_LVDSDesStruct  SiS300_PanelType0b_1[] =
+static const SiS_LVDSDesStruct  SiS300_PanelType0b_1[] =
 {
 	{1343,   0},
 	{1343,   0},
@@ -1263,7 +1076,7 @@ static const SiS300_LVDSDesStruct  SiS300_PanelType0b_1[] =
 	{   0,   0}
 };
 
-static const SiS300_LVDSDesStruct  SiS300_PanelType0c_1[] =
+static const SiS_LVDSDesStruct  SiS300_PanelType0c_1[] =
 {
 	{1343, 798},
 	{1343, 794},
@@ -1276,7 +1089,7 @@ static const SiS300_LVDSDesStruct  SiS300_PanelType0c_1[] =
 	{   0,   0}
 };
 
-static const SiS300_LVDSDesStruct  SiS300_PanelType0d_1[] =
+static const SiS_LVDSDesStruct  SiS300_PanelType0d_1[] =
 {
 	{1343, 798},
 	{1343, 794},
@@ -1289,7 +1102,7 @@ static const SiS300_LVDSDesStruct  SiS300_PanelType0d_1[] =
 	{   0,   0}
 };
 
-static const SiS300_LVDSDesStruct  SiS300_PanelType0e_1[] =
+static const SiS_LVDSDesStruct  SiS300_PanelType0e_1[] =
 {
 	{1343, 798},
 	{1343, 794},
@@ -1302,7 +1115,7 @@ static const SiS300_LVDSDesStruct  SiS300_PanelType0e_1[] =
 	{   0,   0}     /* 1280x960 - not applicable */
 };
 
-static const SiS300_LVDSDesStruct  SiS300_PanelType0f_1[] =
+static const SiS_LVDSDesStruct  SiS300_PanelType0f_1[] =
 {
 	{1343, 798},
 	{1343, 794},
@@ -1315,7 +1128,7 @@ static const SiS300_LVDSDesStruct  SiS300_PanelType0f_1[] =
 	{   0,   0}
 };
 
-static const SiS300_LVDSDesStruct  SiS300_PanelType00_2[] =
+static const SiS_LVDSDesStruct  SiS300_PanelType00_2[] =
 {
 	{976, 527},
 	{976, 502},
@@ -1328,7 +1141,7 @@ static const SiS300_LVDSDesStruct  SiS300_PanelType00_2[] =
 	{  0,   0}
 };
 
-static const SiS300_LVDSDesStruct  SiS300_PanelType01_2[] =
+static const SiS_LVDSDesStruct  SiS300_PanelType01_2[] =
 {
 	{1152, 622},
 	{1152, 597},
@@ -1341,7 +1154,7 @@ static const SiS300_LVDSDesStruct  SiS300_PanelType01_2[] =
 	{   0,   0}
 };
 
-static const SiS300_LVDSDesStruct  SiS300_PanelType02_2[] =
+static const SiS_LVDSDesStruct  SiS300_PanelType02_2[] =
 {
 	{976, 527},
 	{976, 502},
@@ -1354,7 +1167,7 @@ static const SiS300_LVDSDesStruct  SiS300_PanelType02_2[] =
 	{  0,   0}
 };
 
-static const SiS300_LVDSDesStruct  SiS300_PanelType03_2[] =
+static const SiS_LVDSDesStruct  SiS300_PanelType03_2[] =
 {
 	{1152, 622},
 	{1152, 597},
@@ -1367,7 +1180,7 @@ static const SiS300_LVDSDesStruct  SiS300_PanelType03_2[] =
 	{1152, 597}
 };
 
-static const SiS300_LVDSDesStruct  SiS300_PanelType04_2[] =
+static const SiS_LVDSDesStruct  SiS300_PanelType04_2[] =
 {
 	{1152, 622},
 	{1152, 597},
@@ -1380,7 +1193,7 @@ static const SiS300_LVDSDesStruct  SiS300_PanelType04_2[] =
 	{   0,   0}
 };
 
-static const SiS300_LVDSDesStruct  SiS300_PanelType05_2[] =
+static const SiS_LVDSDesStruct  SiS300_PanelType05_2[] =
 {
 	{1152, 622},
 	{1152, 597},
@@ -1393,7 +1206,7 @@ static const SiS300_LVDSDesStruct  SiS300_PanelType05_2[] =
 	{   0,   0}
 };
 
-static const SiS300_LVDSDesStruct  SiS300_PanelType06_2[] =
+static const SiS_LVDSDesStruct  SiS300_PanelType06_2[] =
 {
 	{1152, 622},
 	{1152, 597},
@@ -1406,7 +1219,7 @@ static const SiS300_LVDSDesStruct  SiS300_PanelType06_2[] =
 	{   0,   0}
 };
 
-static const SiS300_LVDSDesStruct  SiS300_PanelType07_2[] =
+static const SiS_LVDSDesStruct  SiS300_PanelType07_2[] =
 {
  	{1152, 622},
  	{1152, 597},
@@ -1419,7 +1232,7 @@ static const SiS300_LVDSDesStruct  SiS300_PanelType07_2[] =
 	{   0,   0}
 };
 
-static const SiS300_LVDSDesStruct  SiS300_PanelType08_2[] =
+static const SiS_LVDSDesStruct  SiS300_PanelType08_2[] =
 {
  	{976, 527},
  	{976, 502},
@@ -1432,7 +1245,7 @@ static const SiS300_LVDSDesStruct  SiS300_PanelType08_2[] =
  	{  0,   0}
 };
 
-static const SiS300_LVDSDesStruct  SiS300_PanelType09_2[] =
+static const SiS_LVDSDesStruct  SiS300_PanelType09_2[] =
 {
  	{1152, 622},
  	{1152, 597},
@@ -1445,7 +1258,7 @@ static const SiS300_LVDSDesStruct  SiS300_PanelType09_2[] =
  	{   0,   0}
 };
 
-static const SiS300_LVDSDesStruct  SiS300_PanelType0a_2[] =
+static const SiS_LVDSDesStruct  SiS300_PanelType0a_2[] =
 {
  	{976, 527},
  	{976, 502},
@@ -1458,7 +1271,7 @@ static const SiS300_LVDSDesStruct  SiS300_PanelType0a_2[] =
  	{  0,   0}
 };
 
-static const SiS300_LVDSDesStruct  SiS300_PanelType0b_2[] =
+static const SiS_LVDSDesStruct  SiS300_PanelType0b_2[] =
 {
  	{ 1152, 700},
  	{ 1152, 675},
@@ -1471,7 +1284,7 @@ static const SiS300_LVDSDesStruct  SiS300_PanelType0b_2[] =
  	{    0,   0}
 };
 
-static const SiS300_LVDSDesStruct  SiS300_PanelType0c_2[] =
+static const SiS_LVDSDesStruct  SiS300_PanelType0c_2[] =
 {
  	{1152, 622},
  	{1152, 597},
@@ -1484,7 +1297,7 @@ static const SiS300_LVDSDesStruct  SiS300_PanelType0c_2[] =
  	{   0,   0}
 };
 
-static const SiS300_LVDSDesStruct  SiS300_PanelType0d_2[] =
+static const SiS_LVDSDesStruct  SiS300_PanelType0d_2[] =
 {
  	{1152, 622},
  	{1152, 597},
@@ -1497,7 +1310,7 @@ static const SiS300_LVDSDesStruct  SiS300_PanelType0d_2[] =
  	{   0,   0}
 };
 
-static const SiS300_LVDSDesStruct  SiS300_PanelType0e_2[] =
+static const SiS_LVDSDesStruct  SiS300_PanelType0e_2[] =
 {
  	{1152, 622},
  	{1152, 597},
@@ -1510,7 +1323,7 @@ static const SiS300_LVDSDesStruct  SiS300_PanelType0e_2[] =
  	{   0,   0}
 };
 
-static const SiS300_LVDSDesStruct  SiS300_PanelType0f_2[] =
+static const SiS_LVDSDesStruct  SiS300_PanelType0f_2[] =
 {
  	{1152, 622},
  	{1152, 597},
@@ -1523,8 +1336,36 @@ static const SiS300_LVDSDesStruct  SiS300_PanelType0f_2[] =
  	{   0,   0}
 };
 
+static const SiS_LVDSDesStruct  SiS300_PanelTypeNS_1[]=
+{
+	{ 0,   0},
+	{ 0,   0},
+	{ 0,   0},
+	{ 0,   0},
+	{ 0,   0},
+	{ 0,   0},
+	{ 0, 805},
+	{ 0,   0},
+	{ 0,   0},
+	{ 0,   0}
+};
+
+static const SiS_LVDSDesStruct  SiS300_PanelTypeNS_2[] =
+{
+	{ 0 , 0},
+	{ 0 , 0},
+	{ 0 , 0},
+	{ 0 , 0},
+	{ 0 , 0},
+	{ 0 , 0},
+	{ 0 , 0},
+	{ 0 , 0},
+	{ 0 , 0},
+	{ 0 , 0}
+};
+
 /* Custom data for Barco iQ R200/300/400 (BIOS 2.00.07) */
-static const SiS300_LVDSDesStruct  SiS300_PanelType04_1a[] =	/* 1280x1024 (1366x1024) */
+static const SiS_LVDSDesStruct  SiS300_PanelType04_1a[] =	/* 1280x1024 (1366x1024) */
 {
 	{1330, 798},  /* 320x200 */
 	{1330, 794},
@@ -1537,7 +1378,7 @@ static const SiS300_LVDSDesStruct  SiS300_PanelType04_1a[] =	/* 1280x1024 (1366x
 	{   0,   0}   /* 1360x1024          */
 };
 
-static const SiS300_LVDSDesStruct  SiS300_PanelType04_2a[] =
+static const SiS_LVDSDesStruct  SiS300_PanelType04_2a[] =
 {
 	{1152, 622},
 	{1152, 597},
@@ -1551,7 +1392,7 @@ static const SiS300_LVDSDesStruct  SiS300_PanelType04_2a[] =
 };
 
 /* Custom data for Barco iQ G200/300/400 (BIOS 2.00.07) */
-static const SiS300_LVDSDesStruct  SiS300_PanelType04_1b[] =	/* 1024x768 */
+static const SiS_LVDSDesStruct  SiS300_PanelType04_1b[] =	/* 1024x768 */
 {
 	{1330, 798},  /* 320x200 */
 	{1330, 794},
@@ -1562,7 +1403,7 @@ static const SiS300_LVDSDesStruct  SiS300_PanelType04_1b[] =	/* 1024x768 */
 	{   0, 805}   /* 1024x768 / 512x384 */
 };
 
-static const SiS300_LVDSDesStruct  SiS300_PanelType04_2b[] =
+static const SiS_LVDSDesStruct  SiS300_PanelType04_2b[] =
 {
 	{1152, 622},
 	{1152, 597},
@@ -1575,12 +1416,7 @@ static const SiS300_LVDSDesStruct  SiS300_PanelType04_2b[] =
 
 /* CRT1 CRTC for slave modes */
 
-typedef struct _SiS300_LVDSCRT1DataStruct
-{
-UCHAR CR[15];
-} SiS300_LVDSCRT1DataStruct;
-
-static const SiS300_LVDSCRT1DataStruct  SiS300_LVDSCRT1800x600_1[] =
+static const SiS_LVDSCRT1DataStruct  SiS300_LVDSCRT1800x600_1[] =
 {
 	{{0x65,0x4f,0x89,0x56,0x83,0xaf,0x1f,
 	  0x90,0x85,0x8f,0xab,0x30,0x00,0x05,
@@ -1602,7 +1438,7 @@ static const SiS300_LVDSCRT1DataStruct  SiS300_LVDSCRT1800x600_1[] =
 	  0x01 }}
 };
 
-static const SiS300_LVDSCRT1DataStruct  SiS300_LVDSCRT1800x600_1_H[] =
+static const SiS_LVDSCRT1DataStruct  SiS300_LVDSCRT1800x600_1_H[] =
 {
 	{{0x30,0x27,0x94,0x2c,0x92,0xaf,0x1f,
 	  0x90,0x85,0x8f,0xab,0x30,0x00,0x04,
@@ -1624,7 +1460,7 @@ static const SiS300_LVDSCRT1DataStruct  SiS300_LVDSCRT1800x600_1_H[] =
 	  0x01 }}
 };
 
-static const SiS300_LVDSCRT1DataStruct  SiS300_LVDSCRT11024x768_1[] =
+static const SiS_LVDSCRT1DataStruct  SiS300_LVDSCRT11024x768_1[] =
 {
 	{{0x64,0x4f,0x88,0x54,0x9f,0xc4,0x1f,
 	  0x92,0x89,0x8f,0xb5,0x30,0x00,0x01,
@@ -1649,7 +1485,7 @@ static const SiS300_LVDSCRT1DataStruct  SiS300_LVDSCRT11024x768_1[] =
 	  0x01}}
 };
 
-static const SiS300_LVDSCRT1DataStruct  SiS300_LVDSCRT11024x768_1_H[] =
+static const SiS_LVDSCRT1DataStruct  SiS300_LVDSCRT11024x768_1_H[] =
 {
 	{{0x2f,0x27,0x93,0x2b,0x90,0xc4,0x1f,
 	  0x92,0x89,0x8f,0xb5,0x30,0x00,0x44,
@@ -1698,7 +1534,7 @@ static const SiS300_LVDSCRT1DataStruct  SiS300_LVDSCRT11024x768_1_H[] =
 #endif
 };
 
-static const SiS300_LVDSCRT1DataStruct  SiS300_LVDSCRT11280x1024_1[] =
+static const SiS_LVDSCRT1DataStruct  SiS300_LVDSCRT11280x1024_1[] =
 {
 	{{0x63,0x4f,0x87,0x54,0x9f,0xb4,0x1f,
 	  0x92,0x89,0x8f,0xb5,0x30,0x00,0x01,
@@ -1723,7 +1559,7 @@ static const SiS300_LVDSCRT1DataStruct  SiS300_LVDSCRT11280x1024_1[] =
 	  0x01 }}
 };
 
-static const SiS300_LVDSCRT1DataStruct  SiS300_LVDSCRT11280x1024_1_H[] =
+static const SiS_LVDSCRT1DataStruct  SiS300_LVDSCRT11280x1024_1_H[] =
 {
 	{{0x2f,0x27,0x93,0x2b,0x90,0xb4,0x1f,
 	  0x92,0x89,0x8f,0xb5,0x30,0x00,0x04,
@@ -1748,7 +1584,7 @@ static const SiS300_LVDSCRT1DataStruct  SiS300_LVDSCRT11280x1024_1_H[] =
 	  0x01 }}
 };
 
-static const SiS300_LVDSCRT1DataStruct  SiS300_LVDSCRT1800x600_2[] =
+static const SiS_LVDSCRT1DataStruct  SiS300_LVDSCRT1800x600_2[] =
 {
 	{{0x7f,0x4f,0x83,0x62,0x12,0x72,0x3e,
 	  0xf4,0x88,0x8f,0x73,0x20,0x00,0x06,
@@ -1770,7 +1606,7 @@ static const SiS300_LVDSCRT1DataStruct  SiS300_LVDSCRT1800x600_2[] =
 	  0x01 }}
 };
 
-static const SiS300_LVDSCRT1DataStruct  SiS300_LVDSCRT1800x600_2_H[] =
+static const SiS_LVDSCRT1DataStruct  SiS300_LVDSCRT1800x600_2_H[] =
 {
 	{{0x3d,0x27,0x81,0x32,0x1a,0x72,0x3e,
 	  0xf4,0x88,0x8f,0x73,0x20,0x00,0x05,
@@ -1792,7 +1628,7 @@ static const SiS300_LVDSCRT1DataStruct  SiS300_LVDSCRT1800x600_2_H[] =
 	  0x01 }}
 };
 
-static const SiS300_LVDSCRT1DataStruct  SiS300_LVDSCRT11024x768_2[] =
+static const SiS_LVDSCRT1DataStruct  SiS300_LVDSCRT11024x768_2[] =
 {
 	{{0xa3,0x4f,0x87,0x6e,0x9f,0x24,0xbb,
 	  0x4a,0x80,0x8f,0x25,0x30,0x00,0x06,
@@ -1817,7 +1653,7 @@ static const SiS300_LVDSCRT1DataStruct  SiS300_LVDSCRT11024x768_2[] =
 	  0x01 }}
 };
 
-static const SiS300_LVDSCRT1DataStruct  SiS300_LVDSCRT11024x768_2_H[] =
+static const SiS_LVDSCRT1DataStruct  SiS300_LVDSCRT11024x768_2_H[] =
 {
 	{{0x4f,0x27,0x93,0x39,0x01,0x24,0xbb,
 	  0x4a,0x80,0x8f,0x25,0x30,0x00,0x01,
@@ -1842,7 +1678,7 @@ static const SiS300_LVDSCRT1DataStruct  SiS300_LVDSCRT11024x768_2_H[] =
 	  0x01 }}
 };
 
-static const SiS300_LVDSCRT1DataStruct  SiS300_LVDSCRT11280x1024_2[] =
+static const SiS_LVDSCRT1DataStruct  SiS300_LVDSCRT11280x1024_2[] =
 {
 	{{0xa3,0x4f,0x87,0x6e,0x9f,0x24,0xbb,
 	  0x4a,0x80,0x8f,0x25,0x30,0x00,0x06,
@@ -1867,7 +1703,7 @@ static const SiS300_LVDSCRT1DataStruct  SiS300_LVDSCRT11280x1024_2[] =
 	  0x01 }}
 };
 
-static const SiS300_LVDSCRT1DataStruct  SiS300_LVDSCRT11280x1024_2_H[] =
+static const SiS_LVDSCRT1DataStruct  SiS300_LVDSCRT11280x1024_2_H[] =
 {
 	{{0x4f,0x27,0x93,0x39,0x81,0x24,0xbb,
 	  0x4a,0x80,0x8f,0x25,0x30,0x00,0x01,
@@ -1892,7 +1728,64 @@ static const SiS300_LVDSCRT1DataStruct  SiS300_LVDSCRT11280x1024_2_H[] =
 	  0x01}}
 };
 
-static const SiS300_LVDSCRT1DataStruct  SiS300_CHTVCRT1UNTSC[] =
+static const SiS_LVDSCRT1DataStruct  SiS300_LVDSCRT1XXXxXXX_1[] =
+{
+ {{0x5f,0x4f,0x82,0x55,0x81,0xbf,0x1f,
+   0x9c,0x8e,0x96,0xb9,0x30,0x00,0x05,
+   0x00}},
+ {{0x5f,0x4f,0x82,0x55,0x81,0xbf,0x1f,
+   0x9c,0x8e,0x96,0xb9,0x30,0x00,0x05,
+   0x00}},
+ {{0x5f,0x4f,0x82,0x55,0x81,0xbf,0x1f,
+   0x9c,0x8e,0x96,0xb9,0x30,0x00,0x05,
+   0x00}},
+ {{0x5f,0x4f,0x82,0x55,0x81,0xbf,0x1f,
+   0x9c,0x8e,0x96,0xb9,0x30,0x00,0x05,
+   0x00}},
+ {{0x5f,0x4f,0x82,0x55,0x81,0x0b,0x3e,
+   0xe9,0x8b,0xe7,0x04,0x00,0x00,0x05,
+   0x00}},
+ {{0x7f,0x63,0x83,0x6c,0x1c,0x72,0xf0,
+   0x58,0x8c,0x57,0x73,0x20,0x00,0x06,
+   0x01}},
+ {{0xa3,0x7f,0x87,0x86,0x97,0x24,0xf5,
+   0x02,0x88,0xff,0x25,0x10,0x00,0x02,
+   0x01}},
+ {{0xce,0x9f,0x92,0xa8,0x14,0x28,0x5a,
+   0x00,0x84,0xff,0x29,0x09,0x00,0x07,
+   0x01}},
+ {{0xce,0x9f,0x92,0xa9,0x17,0x24,0xf5,
+   0x02,0x88,0xff,0x25,0x10,0x00,0x07,
+   0x01}}
+};
+
+static const SiS_LVDSCRT1DataStruct  SiS300_LVDSCRT1XXXxXXX_1_H[] =
+{
+ {{0x38,0x27,0x9c,0x2c,0x80,0xbf,0x1f,
+   0x9c,0x8e,0x96,0xb9,0x30,0x00,0x00,
+   0x00}},
+ {{0x38,0x27,0x9c,0x2c,0x80,0xbf,0x1f,
+   0x9c,0x8e,0x96,0xb9,0x30,0x00,0x00,
+   0x00}},
+ {{0x38,0x27,0x9c,0x2c,0x80,0xbf,0x1f,
+   0x9c,0x8e,0x96,0xb9,0x30,0x00,0x00,
+   0x00}},
+ {{0x38,0x27,0x9c,0x2c,0x80,0xbf,0x1f,
+   0x9c,0x8e,0x96,0xb9,0x30,0x00,0x00,
+   0x00}},
+ {{0x38,0x27,0x9c,0x2c,0x80,0x0b,0x3e,
+   0xe9,0x8b,0xe7,0x04,0x00,0x00,0x00,
+   0x00}},
+ {{0x4d,0x31,0x91,0x3b,0x03,0x72,0xf0,
+   0x58,0x8c,0x57,0x73,0x20,0x00,0x01,
+   0x01}},
+ {{0x63,0x3f,0x87,0x4a,0x92,0x24,0xf5,
+   0x02,0x88,0xff,0x25,0x10,0x00,0x01,
+   0x01}}
+};
+
+
+static const SiS_LVDSCRT1DataStruct  SiS300_CHTVCRT1UNTSC[] =
 {
 	{{0x64,0x4f,0x88,0x56,0x9f,0x56,0x3e,
 	  0xe8,0x84,0x8f,0x57,0x20,0x00,0x01,
@@ -1914,7 +1807,7 @@ static const SiS300_LVDSCRT1DataStruct  SiS300_CHTVCRT1UNTSC[] =
 	  0x01 }}
 };
 
-static const SiS300_LVDSCRT1DataStruct  SiS300_CHTVCRT1ONTSC[] =
+static const SiS_LVDSCRT1DataStruct  SiS300_CHTVCRT1ONTSC[] =
 {
 	{{0x64,0x4f,0x88,0x5a,0x9f,0x0b,0x3e,
 	  0xc0,0x84,0x8f,0x0c,0x20,0x00,0x01,
@@ -1936,7 +1829,7 @@ static const SiS300_LVDSCRT1DataStruct  SiS300_CHTVCRT1ONTSC[] =
 	  0x01 }}
 };
 
-static const SiS300_LVDSCRT1DataStruct  SiS300_CHTVCRT1UPAL[] =
+static const SiS_LVDSCRT1DataStruct  SiS300_CHTVCRT1UPAL[] =
 {
 	{{0x79,0x4f,0x9d,0x5a,0x90,0x6f,0x3e,
 	  0xf8,0x83,0x8f,0x70,0x20,0x00,0x05,
@@ -1958,7 +1851,7 @@ static const SiS300_LVDSCRT1DataStruct  SiS300_CHTVCRT1UPAL[] =
 	  0x01 }}
 };
 
-static const SiS300_LVDSCRT1DataStruct  SiS300_CHTVCRT1OPAL[] =
+static const SiS_LVDSCRT1DataStruct  SiS300_CHTVCRT1OPAL[] =
 {
 	{{0x79,0x4f,0x9d,0x5a,0x90,0x6f,0x3e,
 	  0xf0,0x83,0x8f,0x70,0x20,0x00,0x05,
@@ -1980,7 +1873,7 @@ static const SiS300_LVDSCRT1DataStruct  SiS300_CHTVCRT1OPAL[] =
 	  0x01 }}
 };
 
-static const SiS300_LVDSCRT1DataStruct  SiS300_CHTVCRT1SOPAL[] =
+static const SiS_LVDSCRT1DataStruct  SiS300_CHTVCRT1SOPAL[] =
 {
 	{{0x79,0x4f,0x9d,0x5a,0x90,0x6f,0x3e,
 	  0xf0,0x83,0x8f,0x70,0x20,0x00,0x05,
@@ -2002,12 +1895,7 @@ static const SiS300_LVDSCRT1DataStruct  SiS300_CHTVCRT1SOPAL[] =
 	  0x01 }}
 };
 
-typedef struct _SiS300_CHTVRegDataStruct
-{
-	UCHAR Reg[16];
-} SiS300_CHTVRegDataStruct;
-
-static const SiS300_CHTVRegDataStruct SiS300_CHTVReg_UNTSC[] =
+static const SiS_CHTVRegDataStruct SiS300_CHTVReg_UNTSC[] =
 {
 	{{0x4a,0x94,0x00,0x48,0xfe,0,0,0,0,0,0,0,0,0,0,0}},
 	{{0x4a,0x94,0x00,0x48,0xfe,0,0,0,0,0,0,0,0,0,0,0}},
@@ -2017,7 +1905,7 @@ static const SiS300_CHTVRegDataStruct SiS300_CHTVReg_UNTSC[] =
 	{{0x8d,0xc4,0x00,0x3b,0xfb,0,0,0,0,0,0,0,0,0,0,0}}  /* Mode 24: 800x600 NTSC 7/10 */
 };
 
-static const SiS300_CHTVRegDataStruct SiS300_CHTVReg_ONTSC[] =
+static const SiS_CHTVRegDataStruct SiS300_CHTVReg_ONTSC[] =
 {
 	{{0x49,0x94,0x00,0x34,0xfe,0,0,0,0,0,0,0,0,0,0,0}},
 	{{0x49,0x94,0x00,0x34,0xfe,0,0,0,0,0,0,0,0,0,0,0}},
@@ -2027,7 +1915,7 @@ static const SiS300_CHTVRegDataStruct SiS300_CHTVReg_ONTSC[] =
 	{{0x8c,0xb4,0x00,0x32,0xf9,0,0,0,0,0,0,0,0,0,0,0}}  /* Mode 23: 800x600 NTSC 3/4 */
 };
 
-static const SiS300_CHTVRegDataStruct SiS300_CHTVReg_UPAL[] =
+static const SiS_CHTVRegDataStruct SiS300_CHTVReg_UPAL[] =
 {
 	{{0x41,0x12,0x01,0x50,0x34,0,0,0,0,0,0,0,0,0,0,0}},
 	{{0x41,0x12,0x00,0x50,0x00,0,0,0,0,0,0,0,0,0,0,0}},
@@ -2038,7 +1926,7 @@ static const SiS300_CHTVRegDataStruct SiS300_CHTVReg_UPAL[] =
 
 };
 
-static const SiS300_CHTVRegDataStruct SiS300_CHTVReg_OPAL[] =
+static const SiS_CHTVRegDataStruct SiS300_CHTVReg_OPAL[] =
 {
 	{{0x41,0x12,0x01,0x50,0x34,0,0,0,0,0,0,0,0,0,0,0}}, /* Mode 9: 640x400 PAL 1/1 */
 	{{0x41,0x12,0x00,0x50,0x00,0,0,0,0,0,0,0,0,0,0,0}},
@@ -2049,7 +1937,7 @@ static const SiS300_CHTVRegDataStruct SiS300_CHTVReg_OPAL[] =
 
 };
 
-static const SiS300_CHTVRegDataStruct SiS300_CHTVReg_SOPAL[] =
+static const SiS_CHTVRegDataStruct SiS300_CHTVReg_SOPAL[] =
 {
 	{{0x41,0x12,0x01,0x50,0x34,0,0,0,0,0,0,0,0,0,0,0}}, /* Mode 9: 640x400 PAL 1/1 */
 	{{0x41,0x12,0x00,0x50,0x00,0,0,0,0,0,0,0,0,0,0,0}},
diff --git a/drivers/video/sis/310vtbl.h b/drivers/video/sis/310vtbl.h
index 47dfed7f7..ffa394506 100644
--- a/drivers/video/sis/310vtbl.h
+++ b/drivers/video/sis/310vtbl.h
@@ -1,4 +1,5 @@
 /* $XFree86$ */
+/* $XdotOrg$ */
 /*
  * Register settings for SiS 315/330 series
  *
@@ -31,13 +32,10 @@
  * * 2) Redistributions in binary form must reproduce the above copyright
  * *    notice, this list of conditions and the following disclaimer in the
  * *    documentation and/or other materials provided with the distribution.
- * * 3) All advertising materials mentioning features or use of this software
- * *    must display the following acknowledgement: "This product includes
- * *    software developed by Thomas Winischhofer, Vienna, Austria."
- * * 4) The name of the author may not be used to endorse or promote products
+ * * 3) The name of the author may not be used to endorse or promote products
  * *    derived from this software without specific prior written permission.
  * *
- * * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR
+ * * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESSED 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,
@@ -52,20 +50,7 @@
  *
  */
 
-typedef struct _SiS310_StStruct
-{
-	UCHAR St_ModeID;
-	USHORT St_ModeFlag;
-	UCHAR St_StTableIndex;
-	UCHAR St_CRT2CRTC;
-	UCHAR St_ResInfo;
-	UCHAR VB_StTVFlickerIndex;
-	UCHAR VB_StTVEdgeIndex;
-	UCHAR VB_StTVYFilterIndex;
-	UCHAR St_PDC;
-} SiS310_StStruct;
-
-static const SiS310_StStruct SiS310_SModeIDTable[]=
+static const SiS_StStruct SiS310_SModeIDTable[]=
 {
 	{0x01,0x9208,0x01,0x00,0x00,0x00,0x01,0x00, 0x40},
 	{0x01,0x1210,0x14,0x01,0x01,0x00,0x01,0x00, 0x40},
@@ -89,207 +74,192 @@ static const SiS310_StStruct SiS310_SModeIDTable[]=
 	{0xff,0x0000,0x00,0x00,0x00,0x00,0x00,0x00, 0x40}
 };
 
-typedef struct _SiS310_ExtStruct
-{
-	UCHAR  Ext_ModeID;
-	USHORT Ext_ModeFlag;
-	UCHAR  Ext_ModeOffset;
-	USHORT Ext_VESAID;
-	UCHAR  Ext_RESINFO;
-	UCHAR  VB_ExtTVFlickerIndex;
-	UCHAR  VB_ExtTVEdgeIndex;
-	UCHAR  VB_ExtTVYFilterIndex;
-	UCHAR  VB_ExtTVYFilterIndexROM661;
-	UCHAR  REFindex;
-} SiS310_ExtStruct;
-
-static const SiS310_ExtStruct  SiS310_EModeIDTable[]=
-{
-	{0x6a,0x2212,0x04,0x0102,SIS_RI_800x600,  0x00,0x00,0x07,0x06,0x00}, /* 800x600x? */
-	{0x2e,0x0a1b,0x03,0x0101,SIS_RI_640x480,  0x00,0x00,0x05,0x05,0x08}, /* 640x480x8 */
-        {0x2f,0x0a1b,0x03,0x0100,SIS_RI_640x400,  0x00,0x00,0x05,0x05,0x10}, /* 640x400x8 */
-	{0x30,0x2a1b,0x04,0x0103,SIS_RI_800x600,  0x00,0x00,0x07,0x06,0x00}, /* 800x600x8 */
-        {0x31,0x0a1b,0x0a,0x0000,SIS_RI_720x480,  0x00,0x00,0x06,0x06,0x11}, /* 720x480x8 */
-	{0x32,0x0a1b,0x0a,0x0000,SIS_RI_720x576,  0x00,0x00,0x06,0x06,0x12}, /* 720x576x8 */
-	{0x33,0x0a1d,0x0a,0x0000,SIS_RI_720x480,  0x00,0x00,0x06,0x06,0x11}, /* 720x480x16 */
-	{0x34,0x2a1d,0x0a,0x0000,SIS_RI_720x576,  0x00,0x00,0x06,0x06,0x12}, /* 720x576x16 */
-	{0x35,0x0a1f,0x0a,0x0000,SIS_RI_720x480,  0x00,0x00,0x06,0x06,0x11}, /* 720x480x32 */
-	{0x36,0x2a1f,0x0a,0x0000,SIS_RI_720x576,  0x00,0x00,0x06,0x06,0x12}, /* 720x576x32 */
-	{0x37,0x0212,0x05,0x0104,SIS_RI_1024x768, 0x00,0x00,0x08,0x07,0x13}, /* 1024x768x? */
-	{0x38,0x0a1b,0x05,0x0105,SIS_RI_1024x768, 0x00,0x00,0x08,0x07,0x13}, /* 1024x768x8 */
-	{0x3a,0x0e3b,0x06,0x0107,SIS_RI_1280x1024,0x00,0x00,0x00,0x00,0x1a}, /* 1280x1024x8 */
-	{0x3c,0x0e3b,0x07,0x0130,SIS_RI_1600x1200,0x00,0x00,0x00,0x00,0x1e}, /* 1600x1200x8 */
-	{0x3d,0x0e7d,0x07,0x0131,SIS_RI_1600x1200,0x00,0x00,0x00,0x00,0x1e}, /* 1600x1200x16 */
-	{0x40,0x9a1c,0x00,0x010d,SIS_RI_320x200,  0x00,0x00,0x04,0x04,0x25}, /* 320x200x15 */
-	{0x41,0x9a1d,0x00,0x010e,SIS_RI_320x200,  0x00,0x00,0x04,0x04,0x25}, /* 320x200x16 */
-	{0x43,0x0a1c,0x03,0x0110,SIS_RI_640x480,  0x00,0x00,0x05,0x05,0x08},
-	{0x44,0x0a1d,0x03,0x0111,SIS_RI_640x480,  0x00,0x00,0x05,0x05,0x08}, /* 640x480x16 */
-	{0x46,0x2a1c,0x04,0x0113,SIS_RI_800x600,  0x00,0x00,0x07,0x06,0x00},
-	{0x47,0x2a1d,0x04,0x0114,SIS_RI_800x600,  0x00,0x00,0x07,0x06,0x00}, /* 800x600x16 */
-	{0x49,0x0a3c,0x05,0x0116,SIS_RI_1024x768, 0x00,0x00,0x00,0x07,0x13},
-	{0x4a,0x0a3d,0x05,0x0117,SIS_RI_1024x768, 0x00,0x00,0x08,0x07,0x13}, /* 1024x768x16 */
-	{0x4c,0x0e7c,0x06,0x0119,SIS_RI_1280x1024,0x00,0x00,0x00,0x00,0x1a},
-	{0x4d,0x0e7d,0x06,0x011a,SIS_RI_1280x1024,0x00,0x00,0x00,0x00,0x1a}, /* 1280x1024x16 */
-	{0x50,0x9a1b,0x00,0x0132,SIS_RI_320x240,  0x00,0x00,0x04,0x04,0x26}, /* 320x240x8  */
-	{0x51,0xba1b,0x01,0x0133,SIS_RI_400x300,  0x00,0x00,0x07,0x07,0x27}, /* 400x300x8  */
-  	{0x52,0xba1b,0x02,0x0134,SIS_RI_512x384,  0x00,0x00,0x00,0x00,0x28}, /* 512x384x8  */
-	{0x56,0x9a1d,0x00,0x0135,SIS_RI_320x240,  0x00,0x00,0x04,0x04,0x26}, /* 320x240x16 */
-	{0x57,0xba1d,0x01,0x0136,SIS_RI_400x300,  0x00,0x00,0x07,0x07,0x27}, /* 400x300x16 */
- 	{0x58,0xba1d,0x02,0x0137,SIS_RI_512x384,  0x00,0x00,0x00,0x00,0x28}, /* 512x384x16 */
-	{0x59,0x9a1b,0x00,0x0138,SIS_RI_320x200,  0x00,0x00,0x04,0x04,0x25}, /* 320x200x8  */
-	{0x5a,0x021b,0x00,0x0138,SIS_RI_320x240,  0x00,0x00,0x00,0x00,0x3f}, /* 320x240x8  fstn */
-	{0x5b,0x0a1d,0x00,0x0135,SIS_RI_320x240,  0x00,0x00,0x00,0x00,0x3f}, /* 320x240x16 fstn */
-	{0x5c,0xba1f,0x02,0x0000,SIS_RI_512x384,  0x00,0x00,0x00,0x00,0x28}, /* 512x384x32 */
-	{0x5d,0x0a1d,0x03,0x0139,SIS_RI_640x400,  0x00,0x00,0x05,0x07,0x10},
-	{0x5e,0x0a1f,0x03,0x0000,SIS_RI_640x400,  0x00,0x00,0x05,0x07,0x10}, /* 640x400x32 */
-	{0x62,0x0a3f,0x03,0x013a,SIS_RI_640x480,  0x00,0x00,0x05,0x05,0x08}, /* 640x480x32 */
-	{0x63,0x2a3f,0x04,0x013b,SIS_RI_800x600,  0x00,0x00,0x07,0x06,0x00}, /* 800x600x32 */
-	{0x64,0x0a7f,0x05,0x013c,SIS_RI_1024x768, 0x00,0x00,0x08,0x07,0x13}, /* 1024x768x32 */
-	{0x65,0x0eff,0x06,0x013d,SIS_RI_1280x1024,0x00,0x00,0x00,0x00,0x1a}, /* 1280x1024x32 */
-	{0x66,0x0eff,0x07,0x013e,SIS_RI_1600x1200,0x00,0x00,0x00,0x00,0x1e}, /* 1600x1200x32 */
-	{0x68,0x067b,0x08,0x013f,SIS_RI_1920x1440,0x00,0x00,0x00,0x00,0x29}, /* 1920x1440x8 */
-	{0x69,0x06fd,0x08,0x0140,SIS_RI_1920x1440,0x00,0x00,0x00,0x00,0x29}, /* 1920x1440x16 */
-	{0x6b,0x07ff,0x08,0x0141,SIS_RI_1920x1440,0x00,0x00,0x00,0x00,0x29}, /* 1920x1440x32 */
-	{0x6c,0x067b,0x09,0x0000,SIS_RI_2048x1536,0x00,0x00,0x00,0x00,0x2f}, /* 2048x1536x8 */
-	{0x6d,0x06fd,0x09,0x0000,SIS_RI_2048x1536,0x00,0x00,0x00,0x00,0x2f}, /* 2048x1536x16 */
-	{0x6e,0x07ff,0x09,0x0000,SIS_RI_2048x1536,0x00,0x00,0x00,0x00,0x2f}, /* 2048x1536x32 */
-	{0x70,0x2a1b,0x04,0x0000,SIS_RI_800x480,  0x00,0x00,0x07,0x07,0x34}, /* 800x480x8 */
-	{0x71,0x0a1b,0x05,0x0000,SIS_RI_1024x576, 0x00,0x00,0x00,0x00,0x37}, /* 1024x576x8 */
-	{0x74,0x0a1d,0x05,0x0000,SIS_RI_1024x576, 0x00,0x00,0x00,0x00,0x37}, /* 1024x576x16 */
-	{0x75,0x0a3d,0x06,0x0000,SIS_RI_1280x720, 0x00,0x00,0x00,0x00,0x3a}, /* 1280x720x16 */
-	{0x76,0x2a1f,0x04,0x0000,SIS_RI_800x480,  0x00,0x00,0x07,0x07,0x34}, /* 800x480x32 */
-	{0x77,0x0a1f,0x05,0x0000,SIS_RI_1024x576, 0x00,0x00,0x00,0x00,0x37}, /* 1024x576x32 */
-	{0x78,0x0a3f,0x06,0x0000,SIS_RI_1280x720, 0x00,0x00,0x00,0x00,0x3a}, /* 1280x720x32 */
-	{0x79,0x0a3b,0x06,0x0000,SIS_RI_1280x720, 0x00,0x00,0x00,0x00,0x3a}, /* 1280x720x8 */
-	{0x7a,0x2a1d,0x04,0x0000,SIS_RI_800x480,  0x00,0x00,0x07,0x07,0x34}, /* 800x480x16 */
-	{0x7c,0x0e3b,0x06,0x0000,SIS_RI_1280x960, 0x00,0x00,0x00,0x00,0x3d}, /* 1280x960x8 */
-	{0x7d,0x0e7d,0x06,0x0000,SIS_RI_1280x960, 0x00,0x00,0x00,0x00,0x3d}, /* 1280x960x16 */
-	{0x7e,0x0eff,0x06,0x0000,SIS_RI_1280x960, 0x00,0x00,0x00,0x00,0x3d}, /* 1280x960x32 */
-	{0x23,0x0e3b,0x06,0x0000,SIS_RI_1280x768, 0x00,0x00,0x00,0x00,0x40}, /* 1280x768x8 */
-	{0x24,0x0e7d,0x06,0x0000,SIS_RI_1280x768, 0x00,0x00,0x00,0x00,0x40}, /* 1280x768x16 */
-	{0x25,0x0eff,0x06,0x0000,SIS_RI_1280x768, 0x00,0x00,0x00,0x00,0x40}, /* 1280x768x32 */
-	{0x26,0x0e3b,0x0c,0x0000,SIS_RI_1400x1050,0x00,0x00,0x00,0x00,0x41}, /* 1400x1050x8 */
-	{0x27,0x0e7d,0x0c,0x0000,SIS_RI_1400x1050,0x00,0x00,0x00,0x00,0x41}, /* 1400x1050x16 */
-	{0x28,0x0eff,0x0c,0x0000,SIS_RI_1400x1050,0x00,0x00,0x00,0x00,0x41}, /* 1400x1050x32*/
-	{0x29,0x0e1b,0x0d,0x0000,SIS_RI_1152x864, 0x00,0x00,0x00,0x00,0x43}, /* 1152x864 */
-	{0x2a,0x0e3d,0x0d,0x0000,SIS_RI_1152x864, 0x00,0x00,0x00,0x00,0x43},
-	{0x2b,0x0e7f,0x0d,0x0000,SIS_RI_1152x864, 0x00,0x00,0x00,0x00,0x43},
-	{0x39,0x2a1b,0x0b,0x0000,SIS_RI_848x480,  0x00,0x00,0x00,0x00,0x45}, /* 848x480 */
-	{0x3b,0x2a3d,0x0b,0x0000,SIS_RI_848x480,  0x00,0x00,0x00,0x00,0x45},
-	{0x3e,0x2a7f,0x0b,0x0000,SIS_RI_848x480,  0x00,0x00,0x00,0x00,0x45},
-	{0x3f,0x2a1b,0x0b,0x0000,SIS_RI_856x480,  0x00,0x00,0x00,0x00,0x47}, /* 856x480 */
-	{0x42,0x2a3d,0x0b,0x0000,SIS_RI_856x480,  0x00,0x00,0x00,0x00,0x47},
-	{0x45,0x2a7f,0x0b,0x0000,SIS_RI_856x480,  0x00,0x00,0x00,0x00,0x47},
-	{0x48,0x2a1b,0x0e,0x0000,SIS_RI_1360x768, 0x00,0x00,0x00,0x00,0x49}, /* 1360x768 */
-	{0x4b,0x2a3d,0x0e,0x0000,SIS_RI_1360x768, 0x00,0x00,0x00,0x00,0x49},
-	{0x4e,0x2a7f,0x0e,0x0000,SIS_RI_1360x768, 0x00,0x00,0x00,0x00,0x49},
-	{0x4f,0x9a1f,0x00,0x0000,SIS_RI_320x200,  0x00,0x00,0x04,0x04,0x25}, /* 320x200x32 */
-	{0x53,0x9a1f,0x00,0x0000,SIS_RI_320x240,  0x00,0x00,0x04,0x04,0x26}, /* 320x240x32 */
-	{0x54,0xba1f,0x01,0x0000,SIS_RI_400x300,  0x00,0x00,0x07,0x07,0x27}, /* 400x300x32 */
-	{0x5f,0x2a1b,0x0f,0x0000,SIS_RI_768x576,  0x00,0x00,0x06,0x06,0x4a}, /* 768x576x8 */
-	{0x60,0x2a1d,0x0f,0x0000,SIS_RI_768x576,  0x00,0x00,0x06,0x06,0x4a}, /* 768x576x16 */
-	{0x61,0x2a1f,0x0f,0x0000,SIS_RI_768x576,  0x00,0x00,0x06,0x06,0x4a}, /* 768x576x32 */
-	{0xff,0x0000,0x00,0x0000,0,               0x00,0x00,0x00,0x00,0x00}
-};
-
-typedef struct _SiS310_Ext2Struct
-{
-	USHORT Ext_InfoFlag;
-	UCHAR  Ext_CRT1CRTC;
-	UCHAR  Ext_CRTVCLK;
-	UCHAR  Ext_CRT2CRTC;
-	UCHAR  ModeID;
-	USHORT XRes;
-	USHORT YRes;
-	UCHAR  Ext_PDC;
-} SiS310_Ext2Struct;
-
-static const SiS310_Ext2Struct SiS310_RefIndex[]=
-{
-	{0x085f,0x0d,0x03,0x05,0x6a, 800, 600, 0x40}, /* 0x0 */
-	{0x0067,0x0e,0x04,0x05,0x6a, 800, 600, 0x40}, /* 0x1 */
-	{0x0067,0x0f,0x08,0x48,0x6a, 800, 600, 0x40}, /* 0x2 */
-	{0x0067,0x10,0x07,0x8b,0x6a, 800, 600, 0x40}, /* 0x3 */
-	{0x0047,0x11,0x0a,0x00,0x6a, 800, 600, 0x40}, /* 0x4 */
-	{0x0047,0x12,0x0d,0x00,0x6a, 800, 600, 0x40}, /* 0x5 */
-	{0x0047,0x13,0x13,0x00,0x6a, 800, 600, 0x20}, /* 0x6 */
-	{0x0107,0x14,0x1c,0x00,0x6a, 800, 600, 0x20}, /* 0x7 */
-	{0xc85f,0x05,0x00,0x04,0x2e, 640, 480, 0x40}, /* 0x8 */
-	{0xc067,0x06,0x02,0x04,0x2e, 640, 480, 0x40}, /* 0x9 */
-	{0xc067,0x07,0x02,0x47,0x2e, 640, 480, 0x40}, /* 0xa */
-	{0xc067,0x08,0x03,0x8a,0x2e, 640, 480, 0x40}, /* 0xb */
-	{0xc047,0x09,0x05,0x00,0x2e, 640, 480, 0x40}, /* 0xc */
-	{0xc047,0x0a,0x09,0x00,0x2e, 640, 480, 0x40}, /* 0xd */
-	{0xc047,0x0b,0x0e,0x00,0x2e, 640, 480, 0x40}, /* 0xe */
-	{0xc047,0x0c,0x15,0x00,0x2e, 640, 480, 0x40}, /* 0xf */
-	{0x487f,0x04,0x00,0x00,0x2f, 640, 400, 0x30}, /* 0x10 */
-	{0xc04f,0x3c,0x01,0x06,0x31, 720, 480, 0x30}, /* 0x11 */
-	{0x004f,0x3d,0x03,0x06,0x32, 720, 576, 0x30}, /* 0x12 */
-	{0x0087,0x15,0x06,0x00,0x37,1024, 768, 0x30}, /* 0x13 */
-	{0xc877,0x16,0x0b,0x06,0x37,1024, 768, 0x20}, /* 0x14 */
-	{0xc067,0x17,0x0f,0x49,0x37,1024, 768, 0x20}, /* 0x15 */
-	{0x0067,0x18,0x11,0x00,0x37,1024, 768, 0x20}, /* 0x16 */
-	{0x0047,0x19,0x16,0x8c,0x37,1024, 768, 0x20}, /* 0x17 */
-	{0x0107,0x1a,0x1b,0x00,0x37,1024, 768, 0x10}, /* 0x18 */
-	{0x0107,0x1b,0x1f,0x00,0x37,1024, 768, 0x10}, /* 0x19 */
-	{0x0087,0x1c,0x11,0x00,0x3a,1280,1024, 0x30}, /* 0x1a */
-	{0x0137,0x1d,0x19,0x07,0x3a,1280,1024, 0x00}, /* 0x1b */
-	{0x0107,0x1e,0x1e,0x00,0x3a,1280,1024, 0x00}, /* 0x1c */
-	{0x0207,0x1f,0x20,0x00,0x3a,1280,1024, 0x00}, /* 0x1d */
-	{0x0227,0x20,0x21,0x09,0x3c,1600,1200, 0x00}, /* 0x1e */
-	{0x0407,0x21,0x22,0x00,0x3c,1600,1200, 0x00}, /* 0x1f */
-	{0x0407,0x22,0x23,0x00,0x3c,1600,1200, 0x00}, /* 0x20 */
-	{0x0407,0x23,0x25,0x00,0x3c,1600,1200, 0x00}, /* 0x21 */
-	{0x0007,0x24,0x26,0x00,0x3c,1600,1200, 0x00}, /* 0x22 */
-	{0x0007,0x25,0x2c,0x00,0x3c,1600,1200, 0x00}, /* 0x23 */
-	{0x0007,0x26,0x34,0x00,0x3c,1600,1200, 0x00}, /* 0x24 */
-	{0x407f,0x00,0x00,0x00,0x40, 320, 200, 0x30}, /* 0x25 */
-	{0xc07f,0x01,0x00,0x04,0x50, 320, 240, 0x30}, /* 0x26 */
-	{0x007f,0x02,0x04,0x05,0x51, 400, 300, 0x30}, /* 0x27 */
-	{0xc077,0x03,0x0b,0x06,0x52, 512, 384, 0x30}, /* 0x28 */
-	{0x8007,0x27,0x27,0x00,0x68,1920,1440, 0x00}, /* 0x29 */
-	{0x4007,0x28,0x29,0x00,0x68,1920,1440, 0x00}, /* 0x2a */
-	{0x4007,0x29,0x2e,0x00,0x68,1920,1440, 0x00}, /* 0x2b */
-	{0x4007,0x2a,0x30,0x00,0x68,1920,1440, 0x00}, /* 0x2c */
-	{0x4007,0x2b,0x35,0x00,0x68,1920,1440, 0x00}, /* 0x2d */
-	{0x4005,0x2c,0x39,0x00,0x68,1920,1440, 0x00}, /* 0x2e */
-	{0x4007,0x2d,0x2b,0x00,0x6c,2048,1536, 0x00}, /* 0x2f */
-	{0x4007,0x2e,0x31,0x00,0x6c,2048,1536, 0x00}, /* 0x30 */
-	{0x4007,0x2f,0x33,0x00,0x6c,2048,1536, 0x00}, /* 0x31 */
-	{0x4007,0x30,0x37,0x00,0x6c,2048,1536, 0x00}, /* 0x32 */
-	{0x4005,0x31,0x38,0x00,0x6c,2048,1536, 0x00}, /* 0x33 */
-	{0x0057,0x32,0x40,0x08,0x70, 800, 480, 0x30}, /* 0x34 */
-	{0x0047,0x33,0x07,0x08,0x70, 800, 480, 0x30}, /* 0x35 */
-	{0x0047,0x34,0x0a,0x08,0x70, 800, 480, 0x30}, /* 0x36 */
-	{0x0057,0x35,0x0b,0x09,0x71,1024, 576, 0x30}, /* 0x37 */
-	{0x0047,0x36,0x11,0x09,0x71,1024, 576, 0x30}, /* 0x38 */
-	{0x0047,0x37,0x16,0x09,0x71,1024, 576, 0x30}, /* 0x39 */
-	{0x0117,0x38,0x19,0x0a,0x75,1280, 720, 0x30}, /* 0x3a */
-	{0x0107,0x39,0x1e,0x0a,0x75,1280, 720, 0x30}, /* 0x3b */
-	{0x0207,0x3a,0x20,0x0a,0x75,1280, 720, 0x30}, /* 0x3c */
-	{0x0127,0x3b,0x19,0x08,0x7c,1280, 960, 0x30}, /* 0x3d */
-	{0x0227,0x4c,0x59,0x08,0x7c,1280, 960, 0x20}, /* 0x3e */
-	{0xc07f,0x4e,0x00,0x06,0x5a, 320, 240, 0x30}, /* 0x3f */    /* FSTN 320x240 */
-        {0x0077,0x42,0x5b,0x08,0x23,1280, 768, 0x30}, /* 0x40 */    /* TW: 0x5b was 0x12 */
-	{0x0127,0x43,0x4d,0x08,0x26,1400,1050, 0x30}, /* 0x41 */
-	{0x0207,0x4b,0x5a,0x08,0x26,1400,1050, 0x30}, /* 0x42 Non-BIOS, new */
-	{0x0107,0x44,0x19,0x00,0x29,1152, 864, 0x30}, /* 0x43 Non-BIOS, new */
-	{0x0107,0x4a,0x1e,0x00,0x29,1152, 864, 0x30}, /* 0x44 Non-BIOS, new */
-	{0x0087,0x45,0x57,0x00,0x39, 848, 480, 0x30}, /* 0x45 848x480-38Hzi - Non-BIOS, new */
-	{0xc067,0x46,0x55,0x0b,0x39, 848, 480, 0x30}, /* 0x46 848x480-60Hz  - Non-BIOS, new */
-	{0x0087,0x47,0x57,0x00,0x3f, 856, 480, 0x30}, /* 0x47 856x480-38Hzi - Non-BIOS, new */
-	{0xc047,0x48,0x57,0x00,0x3f, 856, 480, 0x30}, /* 0x48 856x480-60Hz  - Non-BIOS, new */
-	{0x0067,0x49,0x58,0x0c,0x48,1360, 768, 0x30}, /* 0x49 1360x768-60Hz - Non-BIOS, new */
-	{0x004f,0x4d,0x03,0x06,0x5f, 768, 576, 0x30}, /* 0x4a 768x576 */
-	{0xffff,0x00,0x00,0x00,0x00,   0,   0, 0}
-};
-
-typedef struct _SiS310_CRT1TableStruct
-{
- 	UCHAR CR[17];
-} SiS310_CRT1TableStruct;
-
-static const SiS310_CRT1TableStruct SiS310_CRT1Table[]=
+static const SiS_ExtStruct  SiS310_EModeIDTable[]=
+{
+	{0x6a,0x2212,0x0102,SIS_RI_800x600,  0x00,0x00,0x07,0x06,0x00, 3}, /* 800x600x? */
+	{0x2e,0x0a1b,0x0101,SIS_RI_640x480,  0x00,0x00,0x05,0x05,0x08, 2}, /* 640x480x8 */
+        {0x2f,0x0a1b,0x0100,SIS_RI_640x400,  0x00,0x00,0x05,0x05,0x10, 0}, /* 640x400x8 */
+	{0x30,0x2a1b,0x0103,SIS_RI_800x600,  0x00,0x00,0x07,0x06,0x00, 3}, /* 800x600x8 */
+        {0x31,0x4a1b,0x0000,SIS_RI_720x480,  0x00,0x00,0x06,0x06,0x11,-1}, /* 720x480x8 */
+	{0x32,0x4a1b,0x0000,SIS_RI_720x576,  0x00,0x00,0x06,0x06,0x12,-1}, /* 720x576x8 */
+	{0x33,0x4a1d,0x0000,SIS_RI_720x480,  0x00,0x00,0x06,0x06,0x11,-1}, /* 720x480x16 */
+	{0x34,0x6a1d,0x0000,SIS_RI_720x576,  0x00,0x00,0x06,0x06,0x12,-1}, /* 720x576x16 */
+	{0x35,0x4a1f,0x0000,SIS_RI_720x480,  0x00,0x00,0x06,0x06,0x11,-1}, /* 720x480x32 */
+	{0x36,0x6a1f,0x0000,SIS_RI_720x576,  0x00,0x00,0x06,0x06,0x12,-1}, /* 720x576x32 */
+	{0x37,0x0212,0x0104,SIS_RI_1024x768, 0x00,0x00,0x08,0x07,0x13, 4}, /* 1024x768x? */
+	{0x38,0x0a1b,0x0105,SIS_RI_1024x768, 0x00,0x00,0x08,0x07,0x13, 4}, /* 1024x768x8 */
+	{0x3a,0x0e3b,0x0107,SIS_RI_1280x1024,0x00,0x00,0x00,0x00,0x1a, 8}, /* 1280x1024x8 */
+	{0x3c,0x0e3b,0x0130,SIS_RI_1600x1200,0x00,0x00,0x00,0x00,0x1e,10}, /* 1600x1200x8 */
+	{0x3d,0x0e7d,0x0131,SIS_RI_1600x1200,0x00,0x00,0x00,0x00,0x1e,10}, /* 1600x1200x16 */
+	{0x40,0x9a1c,0x010d,SIS_RI_320x200,  0x00,0x00,0x04,0x04,0x25, 0}, /* 320x200x15 */
+	{0x41,0x9a1d,0x010e,SIS_RI_320x200,  0x00,0x00,0x04,0x04,0x25, 0}, /* 320x200x16 */
+	{0x43,0x0a1c,0x0110,SIS_RI_640x480,  0x00,0x00,0x05,0x05,0x08, 2},
+	{0x44,0x0a1d,0x0111,SIS_RI_640x480,  0x00,0x00,0x05,0x05,0x08, 2}, /* 640x480x16 */
+	{0x46,0x2a1c,0x0113,SIS_RI_800x600,  0x00,0x00,0x07,0x06,0x00, 3},
+	{0x47,0x2a1d,0x0114,SIS_RI_800x600,  0x00,0x00,0x07,0x06,0x00, 3}, /* 800x600x16 */
+	{0x49,0x0a3c,0x0116,SIS_RI_1024x768, 0x00,0x00,0x00,0x07,0x13, 4},
+	{0x4a,0x0a3d,0x0117,SIS_RI_1024x768, 0x00,0x00,0x08,0x07,0x13, 4}, /* 1024x768x16 */
+	{0x4c,0x0e7c,0x0119,SIS_RI_1280x1024,0x00,0x00,0x00,0x00,0x1a, 8},
+	{0x4d,0x0e7d,0x011a,SIS_RI_1280x1024,0x00,0x00,0x00,0x00,0x1a, 8}, /* 1280x1024x16 */
+	{0x50,0x9a1b,0x0132,SIS_RI_320x240,  0x00,0x00,0x04,0x04,0x26, 2}, /* 320x240x8  */
+	{0x51,0xba1b,0x0133,SIS_RI_400x300,  0x00,0x00,0x07,0x07,0x27, 3}, /* 400x300x8  */
+  	{0x52,0xba1b,0x0134,SIS_RI_512x384,  0x00,0x00,0x00,0x00,0x28, 4}, /* 512x384x8  */
+	{0x56,0x9a1d,0x0135,SIS_RI_320x240,  0x00,0x00,0x04,0x04,0x26, 2}, /* 320x240x16 */
+	{0x57,0xba1d,0x0136,SIS_RI_400x300,  0x00,0x00,0x07,0x07,0x27, 3}, /* 400x300x16 */
+ 	{0x58,0xba1d,0x0137,SIS_RI_512x384,  0x00,0x00,0x00,0x00,0x28, 4}, /* 512x384x16 */
+	{0x59,0x9a1b,0x0138,SIS_RI_320x200,  0x00,0x00,0x04,0x04,0x25, 0}, /* 320x200x8  */
+	{0x5a,0x021b,0x0138,SIS_RI_320x240,  0x00,0x00,0x00,0x00,0x3f, 2}, /* 320x240x8  fstn */
+	{0x5b,0x0a1d,0x0135,SIS_RI_320x240,  0x00,0x00,0x00,0x00,0x3f, 2}, /* 320x240x16 fstn */
+	{0x5c,0xba1f,0x0000,SIS_RI_512x384,  0x00,0x00,0x00,0x00,0x28, 4}, /* 512x384x32 */
+	{0x5d,0x0a1d,0x0139,SIS_RI_640x400,  0x00,0x00,0x05,0x07,0x10, 0},
+	{0x5e,0x0a1f,0x0000,SIS_RI_640x400,  0x00,0x00,0x05,0x07,0x10, 0}, /* 640x400x32 */
+	{0x62,0x0a3f,0x013a,SIS_RI_640x480,  0x00,0x00,0x05,0x05,0x08, 2}, /* 640x480x32 */
+	{0x63,0x2a3f,0x013b,SIS_RI_800x600,  0x00,0x00,0x07,0x06,0x00, 3}, /* 800x600x32 */
+	{0x64,0x0a7f,0x013c,SIS_RI_1024x768, 0x00,0x00,0x08,0x07,0x13, 4}, /* 1024x768x32 */
+	{0x65,0x0eff,0x013d,SIS_RI_1280x1024,0x00,0x00,0x00,0x00,0x1a, 8}, /* 1280x1024x32 */
+	{0x66,0x0eff,0x013e,SIS_RI_1600x1200,0x00,0x00,0x00,0x00,0x1e,10}, /* 1600x1200x32 */
+	{0x68,0x067b,0x013f,SIS_RI_1920x1440,0x00,0x00,0x00,0x00,0x29,-1}, /* 1920x1440x8 */
+	{0x69,0x06fd,0x0140,SIS_RI_1920x1440,0x00,0x00,0x00,0x00,0x29,-1}, /* 1920x1440x16 */
+	{0x6b,0x07ff,0x0141,SIS_RI_1920x1440,0x00,0x00,0x00,0x00,0x29,-1}, /* 1920x1440x32 */
+	{0x6c,0x067b,0x0000,SIS_RI_2048x1536,0x00,0x00,0x00,0x00,0x2f,-1}, /* 2048x1536x8 */
+	{0x6d,0x06fd,0x0000,SIS_RI_2048x1536,0x00,0x00,0x00,0x00,0x2f,-1}, /* 2048x1536x16 */
+	{0x6e,0x07ff,0x0000,SIS_RI_2048x1536,0x00,0x00,0x00,0x00,0x2f,-1}, /* 2048x1536x32 */
+	{0x70,0x6a1b,0x0000,SIS_RI_800x480,  0x00,0x00,0x07,0x07,0x34,-1}, /* 800x480x8 */
+	{0x71,0x4a1b,0x0000,SIS_RI_1024x576, 0x00,0x00,0x00,0x00,0x37,-1}, /* 1024x576x8 */
+	{0x74,0x4a1d,0x0000,SIS_RI_1024x576, 0x00,0x00,0x00,0x00,0x37,-1}, /* 1024x576x16 */
+	{0x75,0x0a3d,0x0000,SIS_RI_1280x720, 0x00,0x00,0x00,0x00,0x3a, 5}, /* 1280x720x16 */
+	{0x76,0x6a1f,0x0000,SIS_RI_800x480,  0x00,0x00,0x07,0x07,0x34,-1}, /* 800x480x32 */
+	{0x77,0x4a1f,0x0000,SIS_RI_1024x576, 0x00,0x00,0x00,0x00,0x37,-1}, /* 1024x576x32 */
+	{0x78,0x0a3f,0x0000,SIS_RI_1280x720, 0x00,0x00,0x00,0x00,0x3a, 5}, /* 1280x720x32 */
+	{0x79,0x0a3b,0x0000,SIS_RI_1280x720, 0x00,0x00,0x00,0x00,0x3a, 5}, /* 1280x720x8 */
+	{0x7a,0x6a1d,0x0000,SIS_RI_800x480,  0x00,0x00,0x07,0x07,0x34,-1}, /* 800x480x16 */
+	{0x7c,0x0e3b,0x0000,SIS_RI_1280x960, 0x00,0x00,0x00,0x00,0x3d,-1}, /* 1280x960x8 */
+	{0x7d,0x0e7d,0x0000,SIS_RI_1280x960, 0x00,0x00,0x00,0x00,0x3d,-1}, /* 1280x960x16 */
+	{0x7e,0x0eff,0x0000,SIS_RI_1280x960, 0x00,0x00,0x00,0x00,0x3d,-1}, /* 1280x960x32 */
+	{0x23,0x0e3b,0x0000,SIS_RI_1280x768, 0x00,0x00,0x00,0x00,0x40, 6}, /* 1280x768x8 */
+	{0x24,0x0e7d,0x0000,SIS_RI_1280x768, 0x00,0x00,0x00,0x00,0x40, 6}, /* 1280x768x16 */
+	{0x25,0x0eff,0x0000,SIS_RI_1280x768, 0x00,0x00,0x00,0x00,0x40, 6}, /* 1280x768x32 */
+	{0x26,0x0e3b,0x0000,SIS_RI_1400x1050,0x00,0x00,0x00,0x00,0x41, 9}, /* 1400x1050x8 */
+	{0x27,0x0e7d,0x0000,SIS_RI_1400x1050,0x00,0x00,0x00,0x00,0x41, 9}, /* 1400x1050x16 */
+	{0x28,0x0eff,0x0000,SIS_RI_1400x1050,0x00,0x00,0x00,0x00,0x41, 9}, /* 1400x1050x32*/
+	{0x29,0x4e1b,0x0000,SIS_RI_1152x864, 0x00,0x00,0x00,0x00,0x43,-1}, /* 1152x864 */
+	{0x2a,0x4e3d,0x0000,SIS_RI_1152x864, 0x00,0x00,0x00,0x00,0x43,-1},
+	{0x2b,0x4e7f,0x0000,SIS_RI_1152x864, 0x00,0x00,0x00,0x00,0x43,-1},
+	{0x39,0x6a1b,0x0000,SIS_RI_848x480,  0x00,0x00,0x00,0x00,0x45,-1}, /* 848x480 */
+	{0x3b,0x6a3d,0x0000,SIS_RI_848x480,  0x00,0x00,0x00,0x00,0x45,-1},
+	{0x3e,0x6a7f,0x0000,SIS_RI_848x480,  0x00,0x00,0x00,0x00,0x45,-1},
+	{0x3f,0x6a1b,0x0000,SIS_RI_856x480,  0x00,0x00,0x00,0x00,0x47,-1}, /* 856x480 */
+	{0x42,0x6a3d,0x0000,SIS_RI_856x480,  0x00,0x00,0x00,0x00,0x47,-1},
+	{0x45,0x6a7f,0x0000,SIS_RI_856x480,  0x00,0x00,0x00,0x00,0x47,-1},
+	{0x48,0x6a3b,0x0000,SIS_RI_1360x768, 0x00,0x00,0x00,0x00,0x49,-1}, /* 1360x768 */
+	{0x4b,0x6a7d,0x0000,SIS_RI_1360x768, 0x00,0x00,0x00,0x00,0x49,-1},
+	{0x4e,0x6aff,0x0000,SIS_RI_1360x768, 0x00,0x00,0x00,0x00,0x49,-1},
+	{0x4f,0x9a1f,0x0000,SIS_RI_320x200,  0x00,0x00,0x04,0x04,0x25, 0}, /* 320x200x32 */
+	{0x53,0x9a1f,0x0000,SIS_RI_320x240,  0x00,0x00,0x04,0x04,0x26, 2}, /* 320x240x32 */
+	{0x54,0xba1f,0x0000,SIS_RI_400x300,  0x00,0x00,0x07,0x07,0x27, 3}, /* 400x300x32 */
+	{0x5f,0x6a1b,0x0000,SIS_RI_768x576,  0x00,0x00,0x06,0x06,0x4a,-1}, /* 768x576 */
+	{0x60,0x6a1d,0x0000,SIS_RI_768x576,  0x00,0x00,0x06,0x06,0x4a,-1},
+	{0x61,0x6a3f,0x0000,SIS_RI_768x576,  0x00,0x00,0x06,0x06,0x4a,-1},
+	{0x14,0x0e3b,0x0000,SIS_RI_1280x800, 0x00,0x00,0x00,0x00,0x4b, 7}, /* 1280x800 */
+	{0x15,0x0e7d,0x0000,SIS_RI_1280x800, 0x00,0x00,0x00,0x00,0x4b, 7},
+	{0x16,0x0eff,0x0000,SIS_RI_1280x800, 0x00,0x00,0x00,0x00,0x4b, 7},
+	{0x17,0x0e3b,0x0000,SIS_RI_1680x1050,0x00,0x00,0x00,0x00,0x4c, 9}, /* 1680x1050 */
+	{0x18,0x0e7d,0x0000,SIS_RI_1680x1050,0x00,0x00,0x00,0x00,0x4c, 9},
+	{0x19,0x0eff,0x0000,SIS_RI_1680x1050,0x00,0x00,0x00,0x00,0x4c, 9},
+	{0x2c,0x267b,0x0000,SIS_RI_1920x1080,0x00,0x00,0x00,0x00,0x4d,-1}, /* 1920x1080(i) */
+	{0x2d,0x26fd,0x0000,SIS_RI_1920x1080,0x00,0x00,0x00,0x00,0x4d,-1},
+	{0x73,0x27ff,0x0000,SIS_RI_1920x1080,0x00,0x00,0x00,0x00,0x4d,-1},
+	{0x1d,0x6a1b,0x0000,SIS_RI_960x540,  0x00,0x00,0x00,0x00,0x4e,-1}, /* 960x540 */
+	{0x1e,0x6a3d,0x0000,SIS_RI_960x540,  0x00,0x00,0x00,0x00,0x4e,-1},
+	{0x1f,0x6a7f,0x0000,SIS_RI_960x540,  0x00,0x00,0x00,0x00,0x4e,-1},
+	{0xff,0x0000,0x0000,0,               0x00,0x00,0x00,0x00,0x00,-1}
+};
+
+static const SiS_Ext2Struct SiS310_RefIndex[]=
+{
+	{0x085f,0x0d,0x03,0x05,0x05,0x6a, 800, 600, 0x40}, /* 0x0 */
+	{0x0067,0x0e,0x04,0x05,0x05,0x6a, 800, 600, 0x40}, /* 0x1 */
+	{0x0067,0x0f,0x08,0x48,0x05,0x6a, 800, 600, 0x40}, /* 0x2 */
+	{0x0067,0x10,0x07,0x8b,0x05,0x6a, 800, 600, 0x40}, /* 0x3 */
+	{0x0047,0x11,0x0a,0x00,0x05,0x6a, 800, 600, 0x40}, /* 0x4 */
+	{0x0047,0x12,0x0d,0x00,0x05,0x6a, 800, 600, 0x40}, /* 0x5 */
+	{0x0047,0x13,0x13,0x00,0x05,0x6a, 800, 600, 0x20}, /* 0x6 */
+	{0x0107,0x14,0x1c,0x00,0x05,0x6a, 800, 600, 0x20}, /* 0x7 */
+	{0xc85f,0x05,0x00,0x04,0x04,0x2e, 640, 480, 0x40}, /* 0x8 */
+	{0xc067,0x06,0x02,0x04,0x04,0x2e, 640, 480, 0x40}, /* 0x9 */
+	{0xc067,0x07,0x02,0x47,0x04,0x2e, 640, 480, 0x40}, /* 0xa */
+	{0xc067,0x08,0x03,0x8a,0x04,0x2e, 640, 480, 0x40}, /* 0xb */
+	{0xc047,0x09,0x05,0x00,0x04,0x2e, 640, 480, 0x40}, /* 0xc */
+	{0xc047,0x0a,0x09,0x00,0x04,0x2e, 640, 480, 0x40}, /* 0xd */
+	{0xc047,0x0b,0x0e,0x00,0x04,0x2e, 640, 480, 0x40}, /* 0xe */
+	{0xc047,0x0c,0x15,0x00,0x04,0x2e, 640, 480, 0x40}, /* 0xf */
+	{0x487f,0x04,0x00,0x00,0x00,0x2f, 640, 400, 0x30}, /* 0x10 */
+	{0xc06f,0x3c,0x01,0x06,0x13,0x31, 720, 480, 0x30}, /* 0x11 */
+	{0x006f,0x3d,0x03,0x06,0x14,0x32, 720, 576, 0x30}, /* 0x12 */
+	{0x0087,0x15,0x06,0x00,0x06,0x37,1024, 768, 0x30}, /* 0x13 */
+	{0xc877,0x16,0x0b,0x06,0x06,0x37,1024, 768, 0x20}, /* 0x14 */
+	{0xc067,0x17,0x0f,0x49,0x06,0x37,1024, 768, 0x20}, /* 0x15 */
+	{0x0067,0x18,0x11,0x00,0x06,0x37,1024, 768, 0x20}, /* 0x16 */
+	{0x0047,0x19,0x16,0x8c,0x06,0x37,1024, 768, 0x20}, /* 0x17 */
+	{0x0107,0x1a,0x1b,0x00,0x06,0x37,1024, 768, 0x10}, /* 0x18 */
+	{0x0107,0x1b,0x1f,0x00,0x06,0x37,1024, 768, 0x10}, /* 0x19 */
+	{0x0087,0x1c,0x11,0x00,0x07,0x3a,1280,1024, 0x30}, /* 0x1a */
+	{0x0137,0x1d,0x19,0x07,0x07,0x3a,1280,1024, 0x00}, /* 0x1b */
+	{0x0107,0x1e,0x1e,0x00,0x07,0x3a,1280,1024, 0x00}, /* 0x1c */
+	{0x0207,0x1f,0x20,0x00,0x07,0x3a,1280,1024, 0x00}, /* 0x1d */
+	{0x0227,0x20,0x21,0x09,0x09,0x3c,1600,1200, 0x00}, /* 0x1e */
+	{0x0407,0x21,0x22,0x00,0x09,0x3c,1600,1200, 0x00}, /* 0x1f */
+	{0x0407,0x22,0x23,0x00,0x09,0x3c,1600,1200, 0x00}, /* 0x20 */
+	{0x0407,0x23,0x25,0x00,0x09,0x3c,1600,1200, 0x00}, /* 0x21 */
+	{0x0007,0x24,0x26,0x00,0x09,0x3c,1600,1200, 0x00}, /* 0x22 */
+	{0x0007,0x25,0x2c,0x00,0x09,0x3c,1600,1200, 0x00}, /* 0x23 */
+	{0x0007,0x26,0x34,0x00,0x09,0x3c,1600,1200, 0x00}, /* 0x24 */
+	{0x407f,0x00,0x00,0x00,0x00,0x40, 320, 200, 0x30}, /* 0x25 */
+	{0xc07f,0x01,0x00,0x04,0x04,0x50, 320, 240, 0x30}, /* 0x26 */
+	{0x007f,0x02,0x04,0x05,0x05,0x51, 400, 300, 0x30}, /* 0x27 */
+	{0xc077,0x03,0x0b,0x06,0x06,0x52, 512, 384, 0x30}, /* 0x28 */
+	{0x8007,0x27,0x27,0x00,0x00,0x68,1920,1440, 0x00}, /* 0x29 */
+	{0x4007,0x28,0x29,0x00,0x00,0x68,1920,1440, 0x00}, /* 0x2a */
+	{0x4007,0x29,0x2e,0x00,0x00,0x68,1920,1440, 0x00}, /* 0x2b */
+	{0x4007,0x2a,0x30,0x00,0x00,0x68,1920,1440, 0x00}, /* 0x2c */
+	{0x4007,0x2b,0x35,0x00,0x00,0x68,1920,1440, 0x00}, /* 0x2d */
+	{0x4005,0x2c,0x39,0x00,0x00,0x68,1920,1440, 0x00}, /* 0x2e */
+	{0x4007,0x2d,0x2b,0x00,0x00,0x6c,2048,1536, 0x00}, /* 0x2f */
+	{0x4007,0x2e,0x31,0x00,0x00,0x6c,2048,1536, 0x00}, /* 0x30 */
+	{0x4007,0x2f,0x33,0x00,0x00,0x6c,2048,1536, 0x00}, /* 0x31 */
+	{0x4007,0x30,0x37,0x00,0x00,0x6c,2048,1536, 0x00}, /* 0x32 */
+	{0x4005,0x31,0x38,0x00,0x00,0x6c,2048,1536, 0x00}, /* 0x33 */
+	{0x0077,0x32,0x40,0x08,0x18,0x70, 800, 480, 0x30}, /* 0x34 */
+	{0x0047,0x33,0x07,0x08,0x18,0x70, 800, 480, 0x30}, /* 0x35 */
+	{0x0047,0x34,0x0a,0x08,0x18,0x70, 800, 480, 0x30}, /* 0x36 */
+	{0x0077,0x35,0x0b,0x09,0x19,0x71,1024, 576, 0x30}, /* 0x37 */
+	{0x0047,0x36,0x11,0x09,0x19,0x71,1024, 576, 0x30}, /* 0x38 */
+	{0x0047,0x37,0x16,0x09,0x19,0x71,1024, 576, 0x30}, /* 0x39 */
+	{0x1137,0x38,0x19,0x0a,0x0c,0x75,1280, 720, 0x30}, /* 0x3a */
+	{0x1107,0x39,0x1e,0x0a,0x0c,0x75,1280, 720, 0x30}, /* 0x3b */
+	{0x1307,0x3a,0x20,0x0a,0x0c,0x75,1280, 720, 0x30}, /* 0x3c */
+	{0x0127,0x3b,0x19,0x08,0x0a,0x7c,1280, 960, 0x30}, /* 0x3d */
+	{0x0227,0x4c,0x59,0x08,0x0a,0x7c,1280, 960, 0x20}, /* 0x3e */
+	{0xc07f,0x4e,0x00,0x06,0x04,0x5a, 320, 240, 0x30}, /* 0x3f */    /* FSTN 320x240 */
+        {0x0077,0x42,0x5b,0x08,0x11,0x23,1280, 768, 0x30}, /* 0x40 */    /* 0x5b was 0x12 */
+	{0x0127,0x43,0x4d,0x08,0x0b,0x26,1400,1050, 0x30}, /* 0x41 */
+	{0x0207,0x4b,0x5a,0x08,0x0b,0x26,1400,1050, 0x30}, /* 0x42 1400x1050-75Hz */
+	{0x0127,0x44,0x19,0x00,0x1a,0x29,1152, 864, 0x30}, /* 0x43 1152x864-75Hz  */
+	{0x0127,0x4a,0x1e,0x00,0x1a,0x29,1152, 864, 0x30}, /* 0x44 1152x864-85Hz  */
+	{0x0087,0x45,0x57,0x00,0x16,0x39, 848, 480, 0x30}, /* 0x45 848x480-38Hzi  */
+	{0xc067,0x46,0x55,0x0b,0x16,0x39, 848, 480, 0x30}, /* 0x46 848x480-60Hz   */
+	{0x0087,0x47,0x57,0x00,0x17,0x3f, 856, 480, 0x30}, /* 0x47 856x480-38Hzi  */
+	{0xc067,0x48,0x57,0x00,0x17,0x3f, 856, 480, 0x30}, /* 0x48 856x480-60Hz   */
+	{0x0067,0x49,0x58,0x0c,0x1b,0x48,1360, 768, 0x30}, /* 0x49 1360x768-60Hz  */
+	{0x006f,0x4d,0x03,0x06,0x15,0x5f, 768, 576, 0x30}, /* 0x4a 768x576-56Hz   */
+	{0x0067,0x4f,0x5c,0x08,0x0d,0x14,1280, 800, 0x30}, /* 0x4b 1280x800-60Hz  */
+	{0x0067,0x50,0x5d,0x0c,0x0e,0x17,1680,1050, 0x30}, /* 0x4c 1680x1050-60Hz */
+	{0x0087,0x51,0x69,0x00,0x00,0x2c,1920,1080, 0x30}, /* 0x4d 1920x1080 60Hzi */
+	{0x0067,0x52,0x6a,0x00,0x1c,0x1d, 960, 540, 0x30}, /* 0x4e 960x540 60Hz */
+	{0xffff,0x00,0x00,0x00,0x00,0x00,   0,   0,    0}
+};
+
+static const SiS_CRT1TableStruct SiS310_CRT1Table[]=
 {
  {{0x2d,0x27,0x28,0x90,0x2c,0x80,0xbf,0x1f,
    0x9c,0x8e,0x8f,0x96,0xb9,0x30,0x00,0x00,
@@ -310,7 +280,7 @@ static const SiS310_CRT1TableStruct SiS310_CRT1Table[]=
  {{0x5f,0x4f,0x50,0x82,0x55,0x81,0x0b,0x3e,
    0xe9,0x8b,0xdf,0xe7,0x04,0x00,0x00,0x05,
    0x00}}, /* 0x5 */
-#endif   
+#endif
  {{0x5f,0x4f,0x4f,0x83,0x55,0x81,0x0b,0x3e,    /* 0x05 - corrected 640x480-60 */
    0xe9,0x8b,0xdf,0xe8,0x0c,0x00,0x00,0x05,
    0x00}},
@@ -329,16 +299,16 @@ static const SiS310_CRT1TableStruct SiS310_CRT1Table[]=
    0xe0,0x83,0xdf,0xdf,0xfc,0x10,0x00,0x05,
    0x00}}, /* 0x8 */
  {{0x65,0x4f,0x4f,0x89,0x58,0x80,0xfb,0x1f,
-   0xe0,0x83,0xdf,0xdf,0xfc,0x10,0x00,0x05,  /* TW: Corrected VBE */
+   0xe0,0x83,0xdf,0xdf,0xfc,0x10,0x00,0x05,  /* Corrected VBE */
    0x61}}, /* 0x9 */
  {{0x65,0x4f,0x4f,0x89,0x58,0x80,0x01,0x3e,
    0xe0,0x83,0xdf,0xdf,0x02,0x00,0x00,0x05,
    0x61}}, /* 0xa */
  {{0x67,0x4f,0x4f,0x8b,0x58,0x81,0x0d,0x3e,
-   0xe0,0x83,0xdf,0xdf,0x0e,0x00,0x00,0x05,  /* TW: Corrected VBE */
+   0xe0,0x83,0xdf,0xdf,0x0e,0x00,0x00,0x05,  /* Corrected VBE */
    0x61}}, /* 0xb */
  {{0x65,0x4f,0x4f,0x89,0x57,0x9f,0xfb,0x1f,
-   0xe6,0x8a,0xdf,0xdf,0xfc,0x10,0x00,0x01,  /* TW: Corrected VDE, VBE */
+   0xe6,0x8a,0xdf,0xdf,0xfc,0x10,0x00,0x01,  /* Corrected VDE, VBE */
    0x00}}, /* 0xc */
  {{0x7b,0x63,0x63,0x9f,0x6a,0x93,0x6f,0xf0,
    0x58,0x8a,0x57,0x57,0x70,0x20,0x00,0x05,
@@ -466,7 +436,7 @@ static const SiS310_CRT1TableStruct SiS310_CRT1Table[]=
  {{0x9f,0x7f,0x7f,0x83,0x85,0x91,0x1e,0xf1,
    0xad,0x81,0x3f,0x3f,0x1f,0x30,0x00,0x02,
    0x01}}, /* 0x36 */
- {{0xa7,0x7f,0x7f,0x88,0x89,0x95,0x26,0xf1,   /* TW: 95 was 15 - illegal HBE! */
+ {{0xa7,0x7f,0x7f,0x88,0x89,0x95,0x26,0xf1,   /* 95 was 15 - illegal HBE! */
    0xb1,0x85,0x3f,0x3f,0x27,0x30,0x00,0x02,
    0x01}}, /* 0x37 */
  {{0xce,0x9f,0x9f,0x92,0xa9,0x17,0x28,0xc4,
@@ -498,7 +468,7 @@ static const SiS310_CRT1TableStruct SiS310_CRT1Table[]=
  {{0x81,0x6a,0x6a,0x85,0x70,0x00,0x0f,0x3e,
    0xeb,0x8e,0xdf,0xdf,0x10,0x00,0x00,0x02,
    0x00}}, /* 0x3f */
- {{0xa3,0x7f,0x7f,0x87,0x86,0x97,0x1e,0xf1,   /* TW: The following from 650/LVDS BIOS */
+ {{0xa3,0x7f,0x7f,0x87,0x86,0x97,0x1e,0xf1,
    0xae,0x85,0x57,0x57,0x1f,0x30,0x00,0x02,
    0x01}},  /* 0x40 */
  {{0xa3,0x7f,0x7f,0x87,0x86,0x97,0x24,0xf5,
@@ -510,31 +480,31 @@ static const SiS310_CRT1TableStruct SiS310_CRT1Table[]=
  {{0xe6,0xae,0xae,0x8a,0xbd,0x90,0x3d,0x10,
    0x1a,0x8d,0x19,0x19,0x3e,0x2f,0x00,0x03,
    0x00}},  /* 0x43 */
- {{0xc3,0x8f,0x8f,0x87,0x9b,0x0b,0x82,0xef, /* New, 1152x864-75, not in BIOS */
+ {{0xc3,0x8f,0x8f,0x87,0x9b,0x0b,0x82,0xef, /* 1152x864-75 */
    0x60,0x83,0x5f,0x5f,0x83,0x10,0x00,0x07,
    0x01}},  /* 0x44 */
- {{0x86,0x69,0x69,0x8A,0x74,0x06,0x8C,0x15, /* New, 848x480-38i, not in BIOS */
+ {{0x86,0x69,0x69,0x8A,0x74,0x06,0x8C,0x15, /* 848x480-38i */
    0x4F,0x83,0xEF,0xEF,0x8D,0x30,0x00,0x02,
    0x00}},  /* 0x45 */
- {{0x83,0x69,0x69,0x87,0x6f,0x1d,0x03,0x3E, /* New, 848x480-60, not in BIOS */
+ {{0x83,0x69,0x69,0x87,0x6f,0x1d,0x03,0x3E, /* 848x480-60 */
    0xE5,0x8d,0xDF,0xe4,0x04,0x00,0x00,0x06,
    0x00}},  /* 0x46 */
- {{0x86,0x6A,0x6A,0x8A,0x74,0x06,0x8C,0x15, /* New, 856x480-38i, not in BIOS */
+ {{0x86,0x6A,0x6A,0x8A,0x74,0x06,0x8C,0x15, /* 856x480-38i */
    0x4F,0x83,0xEF,0xEF,0x8D,0x30,0x00,0x02,
    0x00}},  /* 0x47 */
- {{0x81,0x6A,0x6A,0x85,0x70,0x00,0x0F,0x3E, /* New, 856x480-60, not in BIOS */
+ {{0x81,0x6A,0x6A,0x85,0x70,0x00,0x0F,0x3E, /* 856x480-60 */
    0xEB,0x8E,0xDF,0xDF,0x10,0x00,0x00,0x02,
    0x00}},  /* 0x48 */
- {{0xdd,0xa9,0xa9,0x81,0xb4,0x97,0x26,0xfd, /* New, 1360x768-60, not in BIOS */
+ {{0xdd,0xa9,0xa9,0x81,0xb4,0x97,0x26,0xfd, /* 1360x768-60 */
    0x01,0x8d,0xff,0x00,0x27,0x10,0x00,0x03,
    0x01}},  /* 0x49 */
- {{0xd9,0x8f,0x8f,0x9d,0xba,0x0a,0x8a,0xff, /* New, 1152x864-84, not in any BIOS   */
+ {{0xd9,0x8f,0x8f,0x9d,0xba,0x0a,0x8a,0xff, /* 1152x864-84  */
    0x60,0x8b,0x5f,0x5f,0x8b,0x10,0x00,0x03,
    0x01}},  /* 0x4a */
- {{0xea,0xae,0xae,0x8e,0xba,0x82,0x40,0x10, /* New, 1400x1050-75, not in any BIOS  */
+ {{0xea,0xae,0xae,0x8e,0xba,0x82,0x40,0x10, /* 1400x1050-75  */
    0x1b,0x87,0x19,0x1a,0x41,0x0f,0x00,0x03,
    0x00}},  /* 0x4b */
- {{0xd3,0x9f,0x9f,0x97,0xab,0x1f,0xf1,0xff, /* New, 1280x960-85, not in any BIOS */
+ {{0xd3,0x9f,0x9f,0x97,0xab,0x1f,0xf1,0xff, /* 1280x960-85 */
    0xc0,0x83,0xbf,0xbf,0xf2,0x10,0x00,0x07,
    0x01}},  /* 0x4c */
  {{0x7b,0x5f,0x63,0x9f,0x6a,0x93,0x6f,0xf0, /* 768x576 */
@@ -542,16 +512,22 @@ static const SiS310_CRT1TableStruct SiS310_CRT1Table[]=
    0x01}},  /* 0x4d */
  {{0x2d,0x27,0x28,0x90,0x2c,0x80,0x0b,0x3e, /* FSTN 320x480, TEMP - possibly invalid */
    0xe9,0x8b,0xdf,0xe7,0x04,0x00,0x00,0x00,
-   0x00}}   /* 0x4e */
-};
-
-typedef struct _SiS310_MCLKDataStruct
-{
-	UCHAR SR28,SR29,SR2A;
-	USHORT CLOCK;
-} SiS310_MCLKDataStruct;
-
-static const SiS310_MCLKDataStruct SiS310_MCLKData_0_315[] =
+   0x00}},  /* 0x4e */
+ {{0xcd,0x9f,0x9f,0x91,0xab,0x1c,0x3a,0xff, /* 1280x800-60 */
+   0x20,0x83,0x1f,0x1f,0x3b,0x10,0x00,0x07,
+   0x21}},  /* 0x4f */
+ {{0x15,0xd1,0xd1,0x99,0xe2,0x19,0x3d,0x10, /* 1680x1050-60 */
+   0x1a,0x8d,0x19,0x19,0x3e,0x2f,0x01,0x0c,
+   0x20}},  /* 0x50 */
+ {{0x0e,0xef,0xef,0x92,0xfe,0x03,0x30,0xf0, /* 1920x1080-60i */
+   0x1e,0x83,0x1b,0x1c,0x31,0x00,0x01,0x00,
+   0x61}},  /* 0x51 */
+ {{0x85,0x77,0x77,0x89,0x7d,0x01,0x31,0xf0, /* 960x540-60 */
+   0x1e,0x84,0x1b,0x1c,0x32,0x00,0x00,0x02,
+   0x41}}   /* 0x52 */
+};
+
+static const SiS_MCLKDataStruct SiS310_MCLKData_0_315[] =
 {
 	{ 0x3b,0x22,0x01,143},
 	{ 0x5c,0x23,0x01,166},
@@ -563,7 +539,7 @@ static const SiS310_MCLKDataStruct SiS310_MCLKData_0_315[] =
 	{ 0x5c,0x23,0x01,166}
 };
 
-static const SiS310_MCLKDataStruct SiS310_MCLKData_0_650[] =
+static const SiS_MCLKDataStruct SiS310_MCLKData_0_650[] =
 {
 	{ 0x5a,0x64,0x82, 66},
 	{ 0xb3,0x45,0x82, 83},
@@ -575,7 +551,7 @@ static const SiS310_MCLKDataStruct SiS310_MCLKData_0_650[] =
 	{ 0x37,0x22,0x82,133}
 };
 
-static const SiS310_MCLKDataStruct SiS310_MCLKData_0_330[] =
+static const SiS_MCLKDataStruct SiS310_MCLKData_0_330[] =
 {
 	{ 0x5c,0x23,0x01,166},
 	{ 0x5c,0x23,0x01,166},
@@ -587,7 +563,7 @@ static const SiS310_MCLKDataStruct SiS310_MCLKData_0_330[] =
 	{ 0x79,0x06,0x01,250}
 };
 
-static const SiS310_MCLKDataStruct SiS310_MCLKData_0_660[] =  /* TODO */
+static const SiS_MCLKDataStruct SiS310_MCLKData_0_660[] =
 {
 	{ 0x5c,0x23,0x82,166},
 	{ 0x5c,0x23,0x82,166},
@@ -599,7 +575,19 @@ static const SiS310_MCLKDataStruct SiS310_MCLKData_0_660[] =  /* TODO */
 	{ 0x37,0x21,0x82,200}
 };
 
-static const SiS310_MCLKDataStruct SiS310_MCLKData_1[] =
+static const SiS_MCLKDataStruct SiS310_MCLKData_0_760[] =
+{
+	{ 0x37,0x22,0x82,133},
+	{ 0x5c,0x23,0x82,166},
+	{ 0x65,0x23,0x82,183},
+	{ 0x7c,0x08,0x82,200},
+	{ 0x29,0x21,0x82,150},
+	{ 0x5c,0x23,0x82,166},
+	{ 0x65,0x23,0x82,183},
+	{ 0x37,0x21,0x82,200}
+};
+
+static const SiS_MCLKDataStruct SiS310_MCLKData_1[] = /* ECLK */
 {
         { 0x29,0x21,0x82,150},
 	{ 0x5c,0x23,0x82,166},
@@ -611,13 +599,7 @@ static const SiS310_MCLKDataStruct SiS310_MCLKData_1[] =
 	{ 0x37,0x22,0x82,133}
 };
 
-typedef struct _SiS310_VCLKDataStruct
-{
-	UCHAR SR2B,SR2C;
-	USHORT CLOCK;
-} SiS310_VCLKDataStruct;
-
-static const SiS310_VCLKDataStruct SiS310_VCLKData[]=
+static SiS_VCLKDataStruct SiS310_VCLKData[]=
 {
 	{ 0x1b,0xe1, 25}, /* 0x00 */
 	{ 0x4e,0xe4, 28}, /* 0x01 */
@@ -630,7 +612,7 @@ static const SiS310_VCLKDataStruct SiS310_VCLKData[]=
 	{ 0x53,0xe2, 50}, /* 0x08 */
 	{ 0x74,0x67, 52}, /* 0x09 */
 	{ 0x6d,0x66, 56}, /* 0x0a */
-	{ 0x5a,0x64, 65}, /* 0x0b */  /* TW: was 6c c3 - WRONG */
+	{ 0x5a,0x64, 65}, /* 0x0b */  /* was 6c c3 - WRONG */
 	{ 0x46,0x44, 67}, /* 0x0c */
 	{ 0xb1,0x46, 68}, /* 0x0d */
 	{ 0xd3,0x4a, 72}, /* 0x0e */
@@ -677,49 +659,58 @@ static const SiS310_VCLKDataStruct SiS310_VCLKData[]=
 	{ 0xea,0x08,340}, /* 0x37 */
 	{ 0xe8,0x07,376}, /* 0x38 */
 	{ 0xde,0x06,389}, /* 0x39 */
-	{ 0x52,0x2a, 54}, /* 0x3a */  /* 301 TV */
-	{ 0x52,0x6a, 27}, /* 0x3b */  /* 301 TV */
-	{ 0x62,0x24, 70}, /* 0x3c */  /* 301 TV */
-	{ 0x62,0x64, 70}, /* 0x3d */  /* 301 TV */
-	{ 0xa8,0x4c, 30}, /* 0x3e */  /* 301 TV */
-	{ 0x20,0x26, 33}, /* 0x3f */  /* 301 TV */
+	{ 0x52,0x2a, 54}, /* 0x3a 301 TV */
+	{ 0x52,0x6a, 27}, /* 0x3b 301 TV */
+	{ 0x62,0x24, 70}, /* 0x3c 301 TV */
+	{ 0x62,0x64, 70}, /* 0x3d 301 TV */
+	{ 0xa8,0x4c, 30}, /* 0x3e 301 TV */
+	{ 0x20,0x26, 33}, /* 0x3f 301 TV */
 	{ 0x31,0xc2, 39}, /* 0x40 */
-	{ 0x60,0x36, 30}, /* 0x41 */  /* Chrontel */
-	{ 0x40,0x4a, 28}, /* 0x42 */  /* Chrontel */
-	{ 0x9f,0x46, 44}, /* 0x43 */  /* Chrontel */
+	{ 0x60,0x36, 30}, /* 0x41 Chrontel */
+	{ 0x40,0x4a, 28}, /* 0x42 Chrontel */
+	{ 0x9f,0x46, 44}, /* 0x43 Chrontel */
 	{ 0x97,0x2c, 26}, /* 0x44 */
-	{ 0x44,0xe4, 25}, /* 0x45 */  /* Chrontel */
-	{ 0x7e,0x32, 47}, /* 0x46 */  /* Chrontel */
-	{ 0x8a,0x24, 31}, /* 0x47 */  /* Chrontel */
-	{ 0x97,0x2c, 26}, /* 0x48 */  /* Chrontel */
+	{ 0x44,0xe4, 25}, /* 0x45 Chrontel */
+	{ 0x7e,0x32, 47}, /* 0x46 Chrontel */
+	{ 0x8a,0x24, 31}, /* 0x47 Chrontel */
+	{ 0x97,0x2c, 26}, /* 0x48 Chrontel */
 	{ 0xce,0x3c, 39}, /* 0x49 */
-	{ 0x52,0x4a, 36}, /* 0x4a */  /* Chrontel */
+	{ 0x52,0x4a, 36}, /* 0x4a Chrontel */
 	{ 0x34,0x61, 95}, /* 0x4b */
 	{ 0x78,0x27,108}, /* 0x4c - was 102 */
-	{ 0x66,0x43,123}, /* 0x4d */  /* Modes 0x26-0x28 (1400x1050) */
+	{ 0x66,0x43,123}, /* 0x4d Modes 0x26-0x28 (1400x1050) */
 	{ 0x41,0x4e, 21}, /* 0x4e */
-	{ 0xa1,0x4a, 29}, /* 0x4f */  /* Chrontel */
+	{ 0xa1,0x4a, 29}, /* 0x4f Chrontel */
 	{ 0x19,0x42, 42}, /* 0x50 */
-	{ 0x54,0x46, 58}, /* 0x51 */  /* Chrontel */
+	{ 0x54,0x46, 58}, /* 0x51 Chrontel */
 	{ 0x25,0x42, 61}, /* 0x52 */
-	{ 0x44,0x44, 66}, /* 0x53 */  /* Chrontel */
-	{ 0x3a,0x62, 70}, /* 0x54 */  /* Chrontel */
-	{ 0x62,0xc6, 34}, /* 0x55 - added for 848x480-60 (not in any BIOS) */
-	{ 0x6a,0xc6, 37}, /* 0x56 - added for 848x480-75 (not in any BIOS)    - TEMP */
-	{ 0xbf,0xc8, 35}, /* 0x57 - added for 856x480-38i,60 (not in any BIOS) */
-	{ 0x30,0x23, 88}, /* 0x58 - added for 1360x768-62 (is 60Hz!) (not in any BIOS) */
-	{ 0x52,0x07,149}, /* 0x59 - added for 1280x960-85 (Not in any BIOS) */
-	{ 0x56,0x07,156}, /* 0x5a - added for 1400x1050-75 */
-   	{ 0x70,0x29, 81}  /* 0x5b - added for 1280x768 LCD */
-};
-
-typedef struct _SiS310_VBVCLKDataStruct
-{
-	UCHAR Part4_A,Part4_B;
-	USHORT CLOCK;
-} SiS310_VBVCLKDataStruct;
-
-static const SiS310_VBVCLKDataStruct SiS310_VBVCLKData[]=
+	{ 0x44,0x44, 66}, /* 0x53 Chrontel */
+	{ 0x3a,0x62, 70}, /* 0x54 Chrontel */
+	{ 0x62,0xc6, 34}, /* 0x55 848x480-60 */
+	{ 0x6a,0xc6, 37}, /* 0x56 848x480-75 - TEMP */
+	{ 0xbf,0xc8, 35}, /* 0x57 856x480-38i,60 */
+	{ 0x30,0x23, 88}, /* 0x58 1360x768-62 (is 60Hz!) */
+	{ 0x52,0x07,149}, /* 0x59 1280x960-85 */
+	{ 0x56,0x07,156}, /* 0x5a 1400x1050-75 */
+   	{ 0x70,0x29, 81}, /* 0x5b 1280x768 LCD */
+	{ 0x45,0x25, 83}, /* 0x5c 1280x800  */
+	{ 0x70,0x0a,147}, /* 0x5d 1680x1050 */
+	{ 0x70,0x24,162}, /* 0x5e 1600x1200 */
+	{ 0x5a,0x64, 65}, /* 0x5f 1280x720 - temp */
+	{ 0x63,0x46, 68}, /* 0x60 1280x768_2 */
+	{ 0x31,0x42, 79}, /* 0x61 1280x768_3 - temp */
+	{    0,   0,  0}, /* 0x62 - custom (will be filled out at run-time) */
+	{ 0x5a,0x64, 65}, /* 0x63 1280x720 (LCD LVDS) */
+	{ 0x70,0x28, 90}, /* 0x64 1152x864@60 */
+	{ 0x41,0xc4, 32}, /* 0x65 848x480@60 */
+	{ 0x5c,0xc6, 32}, /* 0x66 856x480@60 */
+	{ 0x76,0xe7, 27}, /* 0x67 720x480@60 */
+	{ 0x5f,0xc6, 33}, /* 0x68 720/768x576@60 */
+	{ 0x52,0x27, 75}, /* 0x69 1920x1080i 60Hz interlaced */
+	{ 0x7c,0x6b, 38}  /* 0x6a 960x540@60 */
+};
+
+static SiS_VBVCLKDataStruct SiS310_VBVCLKData[]=
 {
 	{ 0x1b,0xe1, 25}, /* 0x00 */
 	{ 0x4e,0xe4, 28}, /* 0x01 */
@@ -732,7 +723,7 @@ static const SiS310_VBVCLKDataStruct SiS310_VBVCLKData[]=
 	{ 0x53,0x47, 50}, /* 0x08 */
 	{ 0x74,0x67, 52}, /* 0x09 */
 	{ 0x6d,0x66, 56}, /* 0x0a */
-	{ 0x35,0x62, 65}, /* 0x0b */  /* Was 0x5a,0x64 - 650/LVDS+301 bios: 35,62  */
+	{ 0x35,0x62, 65}, /* 0x0b */  /* Was 0x5a,0x64 - 650/LVDS+301: 35,62  */
 	{ 0x46,0x44, 67}, /* 0x0c */
 	{ 0xb1,0x46, 68}, /* 0x0d */
 	{ 0xd3,0x4a, 72}, /* 0x0e */
@@ -785,47 +776,55 @@ static const SiS310_VBVCLKDataStruct SiS310_VBVCLKData[]=
 	{ 0xea,0x08,340}, /* 0x37 */
 	{ 0xe8,0x07,376}, /* 0x38 */
 	{ 0xde,0x06,389}, /* 0x39 */
-	{ 0x52,0x2a, 54}, /* 0x3a */  /* 301 TV */
-	{ 0x52,0x6a, 27}, /* 0x3b */  /* 301 TV */
-	{ 0x62,0x24, 70}, /* 0x3c */  /* 301 TV */
-	{ 0x62,0x64, 70}, /* 0x3d */  /* 301 TV */
-	{ 0xa8,0x4c, 30}, /* 0x3e */  /* 301 TV */
-	{ 0x20,0x26, 33}, /* 0x3f */  /* 301 TV */
+	{ 0x52,0x2a, 54}, /* 0x3a 301 TV - start */
+	{ 0x52,0x6a, 27}, /* 0x3b 301 TV */
+	{ 0x62,0x24, 70}, /* 0x3c 301 TV */
+	{ 0x62,0x64, 70}, /* 0x3d 301 TV */
+	{ 0xa8,0x4c, 30}, /* 0x3e 301 TV */
+	{ 0x20,0x26, 33}, /* 0x3f 301 TV */
 	{ 0x31,0xc2, 39}, /* 0x40 */
-	{ 0x2e,0x48, 25}, /* 0x41 */  /* Replacement for LCD on 315 for index 0 */
-	{ 0x24,0x46, 25}, /* 0x42 */  /* Replacement for LCD on 315 for modes 0x01, 0x03, 0x0f, 0x10, 0x12 */
-	{ 0x26,0x64, 28}, /* 0x43 */  /* Replacement for LCD on 315 for index 1 */
-	{ 0x37,0x64, 40}, /* 0x44 */  /* Replacement for LCD on 315 for index 4 */
-	{ 0xa1,0x42,108}, /* 0x45 */  /* 1280x960 LCD */
-	{ 0x37,0x61,100}, /* 0x46 */  /* 1280x960 LCD */
+	{ 0x2e,0x48, 25}, /* 0x41 Replacement for LCD on 315 for index 0 */
+	{ 0x24,0x46, 25}, /* 0x42 Replacement for LCD on 315 for modes 0x01, 0x03, 0x0f, 0x10, 0x12 */
+	{ 0x26,0x64, 28}, /* 0x43 Replacement for LCD on 315 for index 1 */
+	{ 0x37,0x64, 40}, /* 0x44 Replacement for LCD on 315 for index 4 */
+	{ 0xa1,0x42,108}, /* 0x45 1280x960 LCD */
+	{ 0x37,0x61,100}, /* 0x46 1280x960 LCD */
 	{ 0x78,0x27,108}, /* 0x47 */
-	{ 0x97,0x2c, 26}, /* 0x48 */  /* UNUSED - Entries from here new, not in any BIOS */
-	{ 0xce,0x3c, 39}, /* 0x49 */  /* UNUSED */
-	{ 0x52,0x4a, 36}, /* 0x4a */  /* UNUSED */
-	{ 0x34,0x61, 95}, /* 0x4b */  /* UNUSED */
-	{ 0x78,0x27,108}, /* 0x4c */  /* UNUSED */
-	{ 0x66,0x43,123}, /* 0x4d */  /* 1400x1050-60 */
-	{ 0x41,0x4e, 21}, /* 0x4e */  /* UNUSED */
-	{ 0xa1,0x4a, 29}, /* 0x4f */  /* UNUSED */
-	{ 0x19,0x42, 42}, /* 0x50 */  /* UNUSED */
-	{ 0x54,0x46, 58}, /* 0x51 */  /* UNUSED */
-	{ 0x25,0x42, 61}, /* 0x52 */  /* UNUSED */
-	{ 0x44,0x44, 66}, /* 0x53 */  /* UNUSED */
-	{ 0x3a,0x62, 70}, /* 0x54 */  /* UNUSED */
-	{ 0x62,0xc6, 34}, /* 0x55 */  /* 848x480-60 */
-	{ 0x6a,0xc6, 37}, /* 0x56 */  /* 848x480-75 - TEMP, UNUSED */
-	{ 0xbf,0xc8, 35}, /* 0x57 */  /* 856x480-38i,60  */
-	{ 0x30,0x23, 88}, /* 0x58 */  /* 1360x768-62 (is 60Hz!) TEMP, UNUSED */
-	{ 0x52,0x07,149}, /* 0x59 */  /* 1280x960-85  */
-	{ 0x56,0x07,156}, /* 0x5a */  /* 1400x1050-75 */
-   	{ 0x70,0x29, 81}  /* 0x5b */  /* 1280x768 LCD */
-};
-
-static const UCHAR SiS310_ScreenOffset[] =
-{
-        0x14,0x19,0x20,0x28,0x32,0x40,0x50,0x64,
-	0x78,0x80,0x2d,0x35,0x57,0x48,0x55,0x30,
-	0xff
+	{ 0x97,0x2c, 26}, /* 0x48 UNUSED */
+	{ 0xce,0x3c, 39}, /* 0x49 UNUSED */
+	{ 0x52,0x4a, 36}, /* 0x4a UNUSED */
+	{ 0x34,0x61, 95}, /* 0x4b UNUSED */
+	{ 0x78,0x27,108}, /* 0x4c UNUSED */
+	{ 0x66,0x43,123}, /* 0x4d 1400x1050-60 */
+	{ 0x41,0x4e, 21}, /* 0x4e UNUSED */
+	{ 0xa1,0x4a, 29}, /* 0x4f UNUSED */
+	{ 0x19,0x42, 42}, /* 0x50 UNUSED */
+	{ 0x54,0x46, 58}, /* 0x51 UNUSED */
+	{ 0x25,0x42, 61}, /* 0x52 UNUSED */
+	{ 0x44,0x44, 66}, /* 0x53 UNUSED */
+	{ 0x3a,0x62, 70}, /* 0x54 UNUSED */
+	{ 0x62,0xc6, 34}, /* 0x55 848x480-60 */
+	{ 0x6a,0xc6, 37}, /* 0x56 848x480-75 - TEMP, UNUSED */
+	{ 0xbf,0xc8, 35}, /* 0x57 856x480-38i,60  */
+	{ 0x30,0x23, 88}, /* 0x58 1360x768-62 (is 60Hz!) TEMP, UNUSED */
+	{ 0x52,0x07,149}, /* 0x59 1280x960-85  */
+	{ 0x56,0x07,156}, /* 0x5a 1400x1050-75 */
+   	{ 0x70,0x29, 81}, /* 0x5b 1280x768 LCD */
+	{ 0x45,0x25, 83}, /* 0x5c 1280x800 LCD - (was 0x9c,0x62, 69 - wrong?) */
+	{ 0xbe,0x44,121}, /* 0x5d 1680x1050 LCD */
+	{ 0x70,0x24,162}, /* 0x5e 1600x1200 LCD */
+	{ 0x52,0x27, 75}, /* 0x5f 1280x720 LCD TMDS + HDTV (correct) */
+	{ 0x63,0x46, 68}, /* 0x60 1280x768_2 */
+	{ 0x31,0x42, 79}, /* 0x61 1280x768_3 - temp */
+	{    0,   0,  0}, /* 0x62 - custom (will be filled out at run-time) */
+	{ 0x5a,0x64, 65}, /* 0x63 1280x720 (LCD LVDS) */
+	{ 0x70,0x28, 90}, /* 0x64 1152x864@60 */
+	{ 0x41,0xc4, 32}, /* 0x65 848x480@60 */
+	{ 0x5c,0xc6, 32}, /* 0x66 856x480@60 */
+	{ 0x76,0xe7, 27}, /* 0x67 720x480@60 */
+	{ 0x5f,0xc6, 33}, /* 0x68 720/768x576@60 */
+	{ 0x52,0x27, 75}, /* 0x69 1920x1080i 60Hz interlaced (UNUSED) */
+	{ 0x7c,0x6b, 38}  /* 0x6a 960x540@60 */
 };
 
 static const DRAM4Type SiS310_SR15[8] = {
@@ -873,12 +872,7 @@ static const USHORT SiS310_VideoSenseData2 = 0x0174;
 static const USHORT SiS310_YCSenseData2    = 0x016b;
 #endif
 
-typedef struct _SiS310_PanelDelayTblStruct
-{
- 	UCHAR timer[2];
-} SiS310_PanelDelayTblStruct;
-
-static const SiS310_PanelDelayTblStruct SiS310_PanelDelayTbl[]=
+static const SiS_PanelDelayTblStruct SiS310_PanelDelayTbl[]=
 {
         {{0x10,0x40}},
 	{{0x10,0x40}},
@@ -898,7 +892,7 @@ static const SiS310_PanelDelayTblStruct SiS310_PanelDelayTbl[]=
 	{{0x10,0x40}}
 };
 
-static const SiS310_PanelDelayTblStruct SiS310_PanelDelayTblLVDS[]=
+static const SiS_PanelDelayTblStruct SiS310_PanelDelayTblLVDS[]=
 {
 	{{0x28,0xc8}},
 	{{0x28,0xc8}},
@@ -922,28 +916,18 @@ static const SiS310_PanelDelayTblStruct SiS310_PanelDelayTblLVDS[]=
 /* SIS VIDEO BRIDGE ----------------------------------------- */
 /**************************************************************/
 
-typedef struct _SiS310_LCDDataStruct
-{
-	USHORT RVBHCMAX;
-	USHORT RVBHCFACT;
-	USHORT VGAHT;
-	USHORT VGAVT;
-	USHORT LCDHT;
-	USHORT LCDVT;
-} SiS310_LCDDataStruct;
-
-static const SiS310_LCDDataStruct  SiS310_StLCD1024x768Data[]=
+static const SiS_LCDDataStruct  SiS310_St2LCD1024x768Data[] =
 {
 	{   62,  25, 800, 546,1344, 806},
 	{   32,  15, 930, 546,1344, 806},
-	{   32,  15, 930, 546,1344, 806},
+        {   62,  25, 800, 546,1344, 806},
 	{  104,  45, 945, 496,1344, 806},
 	{   62,  25, 800, 546,1344, 806},
 	{   31,  18,1008, 624,1344, 806},
 	{    1,   1,1344, 806,1344, 806}
 };
 
-static const SiS310_LCDDataStruct  SiS310_ExtLCD1024x768Data[] =   
+static const SiS_LCDDataStruct  SiS310_ExtLCD1024x768Data[] =
 {
 	{   42,  25,1536, 419,1344, 806},
 	{   48,  25,1536, 369,1344, 806},
@@ -951,28 +935,10 @@ static const SiS310_LCDDataStruct  SiS310_ExtLCD1024x768Data[] =
 	{   48,  25,1536, 369,1344, 806},
 	{   12,   5, 896, 500,1344, 806},
 	{   42,  25,1024, 625,1344, 806},
-	{    1,   1,1344, 806,1344, 806},
-	{   12,   5, 896, 500,1344, 806},
-	{   42,  25,1024, 625,1344, 806},
-	{    1,   1,1344, 806,1344, 806},
-	{   12,   5, 896, 500,1344, 806},
-	{   42,  25,1024, 625,1344, 806},
-	{    1,   1,1344, 806,1344, 806}
-	 
-};
-
-static const SiS310_LCDDataStruct  SiS310_St2LCD1024x768Data[] =  
-{
-	{   62,  25, 800, 546,1344, 806},
-	{   32,  15, 930, 546,1344, 806},
-        {   62,  25, 800, 546,1344, 806},    
-	{  104,  45, 945, 496,1344, 806},
-	{   62,  25, 800, 546,1344, 806},
-	{   31,  18,1008, 624,1344, 806},
 	{    1,   1,1344, 806,1344, 806}
 };
 
-static const SiS310_LCDDataStruct  SiS310_StLCD1280x1024Data[] =
+static const SiS_LCDDataStruct  SiS310_St2LCD1280x1024Data[] =
 {
 	{   22,   5, 800, 510,1650,1088},
 	{   22,   5, 800, 510,1650,1088},
@@ -984,7 +950,7 @@ static const SiS310_LCDDataStruct  SiS310_StLCD1280x1024Data[] =
 	{    1,   1,1688,1066,1688,1066}
 };
 
-static const SiS310_LCDDataStruct  SiS310_ExtLCD1280x1024Data[] =
+static const SiS_LCDDataStruct  SiS310_ExtLCD1280x1024Data[] =
 {
 	{  211,  60,1024, 501,1688,1066},
 	{  211,  60,1024, 508,1688,1066},
@@ -993,53 +959,10 @@ static const SiS310_LCDDataStruct  SiS310_ExtLCD1280x1024Data[] =
 	{  211,  60,1024, 500,1688,1066},
 	{  211,  75,1024, 625,1688,1066},
 	{  211, 120,1280, 798,1688,1066},
-	{    1,   1,1688,1066,1688,1066},
-	{    1,   1,1800,1000,1688,1066}  /* 1280x960 - does not work, use panel scaler instead */
-};
-
-static const SiS310_LCDDataStruct  SiS310_St2LCD1280x1024Data[] =
-{
-	{   22,   5, 800, 510,1650,1088},
-	{   22,   5, 800, 510,1650,1088},
-	{  176,  45, 900, 510,1650,1088},
-	{  176,  45, 900, 510,1650,1088},
-	{   22,   5, 800, 510,1650,1088},
-	{   13,   5,1024, 675,1560,1152},
-	{   16,   9,1266, 804,1688,1072},
 	{    1,   1,1688,1066,1688,1066}
 };
 
-static const SiS310_LCDDataStruct  SiS310_NoScaleData1024x768[] =  
-{
-        {    1,   1,1344, 806,1344, 806},
-	{    1,   1,1344, 806,1344, 806},
-	{    1,   1,1344, 806,1344, 806},
-	{    1,   1,1344, 806,1344, 806},  /* 640x400 - does not work */
-	{    1,   1,1344, 806,1344, 806},  /* 640x480 - does not work */
-	{    1,   1,1344, 806,1344, 806},
-	{    1,   1,1344, 806,1344, 806},
-	{    1,   1,1344, 806,1344, 806}
-};
-
-static const SiS310_LCDDataStruct  SiS310_NoScaleData1280x1024[] =
-{
-        {    1,   1,1688,1066,1688,1066},
-	{    1,   1,1688,1066,1688,1066},
-	{    1,   1,1688,1066,1688,1066},
-	{    1,   1,1688,1066,1688,1066},
-	{    1,   1,1688,1066,1688,1066},
-	{    1,   1,1688,1066,1688,1066},
-	{    1,   1,1688,1066,1688,1066},
-	{    1,   1,1688,1066,1688,1066},
-	{    1,   1,1688,1066,1688,1066}
-};
-
-typedef struct _SiS310_Part2PortTblStruct
-{
- 	UCHAR CR[12];
-} SiS310_Part2PortTblStruct;
-
-static const SiS310_Part2PortTblStruct SiS310_CRT2Part2_1024x768_1[] =
+static const SiS_Part2PortTblStruct SiS310_CRT2Part2_1024x768_1[] =
 {
  {{0x25,0x12,0xc9,0xdc,0xb6,0x59,0x45,0x09,0x07,0xf9,0x09,0x24}},
  {{0x2c,0x12,0x9a,0xae,0x88,0x59,0x45,0x09,0x07,0xf9,0x09,0x24}},
@@ -1047,646 +970,37 @@ static const SiS310_Part2PortTblStruct SiS310_CRT2Part2_1024x768_1[] =
  {{0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00}},
  {{0x38,0x13,0x16,0x0c,0xe6,0x59,0x45,0x09,0x07,0xf9,0x09,0x24}},
  {{0x38,0x18,0x16,0x00,0x00,0x59,0x45,0x09,0x07,0xf9,0x09,0x24}},
- {{0x36,0x13,0x13,0x25,0xff,0x59,0x45,0x09,0x07,0xf9,0x09,0x24}},
- {{0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00}},
- {{0x25,0x12,0xc9,0xdc,0xb6,0x59,0x45,0x09,0x07,0xf9,0x09,0x24}}
+ {{0x36,0x13,0x13,0x25,0xff,0x59,0x45,0x09,0x07,0xf9,0x09,0x24}}
 };
 
-static const SiS310_Part2PortTblStruct SiS310_CRT2Part2_1024x768_2[] =
-{
- {{0x25,0x12,0x51,0x6e,0x48,0x99,0x35,0x89,0x47,0xc1,0x49,0x33}},
- {{0x2c,0x12,0x38,0x55,0x2f,0x99,0x35,0x89,0x47,0xc1,0x49,0x33}},
- {{0x25,0x12,0x51,0x6e,0x48,0x99,0x35,0x89,0x47,0xc1,0x49,0x33}},
- {{0x2c,0x12,0x38,0x55,0x2f,0xc1,0x35,0xb1,0x47,0xe9,0x71,0x33}},
- {{0x2d,0x12,0x79,0x96,0x70,0x99,0x35,0x89,0x47,0xc1,0x49,0x33}},
- {{0x29,0x12,0xb5,0xd2,0xac,0xe9,0x35,0xd9,0x47,0x11,0x99,0x33}},
- {{0x36,0x13,0x13,0x25,0xff,0x59,0x45,0x09,0x07,0xf9,0x09,0x24}},  /* others  */
-/* 0x36,0x13,0x02,0x25,0xff,0x03,0x45,0x09,0x07,0xf9,0x00,0x24        my      */
- {{0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00}},
- {{0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00}}
-};
+/* *** LCDA *** */
 
-static const SiS310_Part2PortTblStruct SiS310_CRT2Part2_1024x768_3[] =
-{
-#if 1   /* Data from 650/301LVx 1.10.6s and others */
- {{0x25,0x13,0xc9,0x25,0xff,0x59,0x45,0x09,0x07,0xf9,0x09,0x24}},
- {{0x2c,0x13,0x9a,0x25,0xff,0x59,0x45,0x09,0x07,0xf9,0x09,0x24}},
- {{0x25,0x13,0xc9,0x24,0xff,0x59,0x45,0x09,0x07,0xf9,0x09,0x24}},
- {{0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00}},
- {{0x38,0x13,0x13,0x25,0xff,0x59,0x45,0x09,0x07,0xf9,0x09,0x24}},
- {{0x38,0x18,0x16,0x00,0x00,0x59,0x45,0x09,0x07,0xf9,0x09,0x24}},
- {{0x36,0x13,0x13,0x25,0xff,0x59,0x45,0x09,0x07,0xf9,0x09,0x24}},
- {{0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00}},
- {{0x25,0x13,0xc9,0x25,0xff,0xf9,0x45,0x09,0x07,0xf9,0x09,0x24}}
+#if 0
+static const SiS_LVDSDataStruct  SiS_LCDA1600x1200Data_1[]=
+{ /* Clevo, 651+301C */
+	{1200, 450, 2048,1250},
+	{1200, 400, 2048,1250},
+	{1280, 450, 2048,1250},
+	{1280, 400, 2048,1250},
+	{1200, 530, 2048,1250},
+	{1360, 650, 2048,1250},
+	{1584, 818, 2048,1250},
+	{1688,1066, 2048,1250},
+	{1688,1066, 2048,1250},
+#if 0
+	{2048,1250, 2048,1250}   /* this should be correct */
 #endif
-#if 0    /* Data from my 301LV */
- {{0x36,0x13,0x02,0x25,0xff,0x21,0x45,0x09,0x07,0x88,0x09,0x24}},   /* TEST */
- {{0x36,0x13,0x02,0x25,0xff,0x21,0x45,0x09,0x07,0x88,0x09,0x24}},
- {{0x36,0x13,0x02,0x25,0xff,0x21,0x45,0x09,0x07,0x88,0x09,0x24}},
- {{0x36,0x13,0x02,0x25,0xff,0x21,0x45,0x09,0x07,0x88,0x09,0x24}},
- {{0x36,0x13,0x02,0x25,0xff,0x21,0x45,0x09,0x07,0x88,0x09,0x24}},
- {{0x36,0x13,0x02,0x25,0xff,0x21,0x45,0x09,0x07,0x88,0x09,0x24}},
- {{0x36,0x13,0x02,0x25,0xff,0x21,0x45,0x09,0x07,0x88,0x09,0x24}},
- {{0x36,0x13,0x02,0x25,0xff,0x21,0x45,0x09,0x07,0x88,0x09,0x24}},
- {{0x36,0x13,0x02,0x25,0xff,0x21,0x45,0x09,0x07,0x88,0x09,0x24}}
+#if 1
+	{2160,1250, 2048,1250}   /* ? */
 #endif
 };
-
-static const SiS310_Part2PortTblStruct SiS310_CRT2Part2_1280x1024_1[] =
-{ /* Acer; BIOS data invalid, last row taken from _3 */
- {{0x25,0x12,0x51,0x6E,0x48,0x99,0x35,0x89,0x47,0xC1,0x49,0x33}},
- {{0x2C,0x12,0x38,0x55,0x2F,0x99,0x35,0x89,0x47,0xC1,0x49,0x33}},
- {{0x25,0x12,0x51,0x6E,0x48,0x99,0x35,0x89,0x47,0xC1,0x49,0x33}},
- {{0x2C,0x12,0x38,0x55,0x2F,0xC1,0x35,0xB1,0x47,0xE9,0x71,0x33}},
- {{0x2D,0x12,0x79,0x96,0x70,0x99,0x35,0x89,0x47,0xC1,0x49,0x33}},
- {{0x29,0x12,0xB5,0xD2,0xAC,0xE9,0x35,0xD9,0x47,0x11,0x99,0x33}},
- {{0x36,0x13,0x02,0x25,0xFF,0x03,0x45,0x09,0x07,0xF9,0x00,0x24}},
- {{0x47,0x1C,0x14,0x29,0xFF,0xBD,0x23,0x0A,0x07,0x23,0x8A,0x12}}
-};
-
-static const SiS310_Part2PortTblStruct SiS310_CRT2Part2_1280x1024_2[] =
-{ /* Acer */
- {{0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00}}
-};
-
-/*   1     2    4    5    6   1c   1d   1f   20   21   23   25   */
-static const SiS310_Part2PortTblStruct SiS310_CRT2Part2_1280x1024_3[] =
-{ /* Acer */
- {{0x31,0x1B,0xC4,0xDA,0xB0,0xBD,0x23,0x0A,0x07,0x23,0x8A,0x12}},
- {{0x34,0x1B,0x9F,0xC0,0x80,0xB8,0x23,0x0A,0x07,0x14,0x8A,0x12}},
- {{0x3E,0x1B,0xCF,0xF0,0xB0,0xB8,0x23,0x0A,0x07,0x14,0x8A,0x12}},
- {{0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00}},
- {{0x48,0x1C,0x15,0x29,0xFF,0xBD,0x23,0x0A,0x07,0x23,0x8A,0x12}},
- {{0x48,0x1C,0x15,0x29,0xFF,0xBD,0x23,0x0A,0x07,0x23,0x8A,0x12}},
- {{0x48,0x1C,0x15,0x29,0xFF,0xBD,0x23,0x0A,0x07,0x23,0x8A,0x12}},
- {{0x47,0x1C,0x14,0x29,0xFF,0xBD,0x23,0x0A,0x07,0x23,0x8A,0x12}}
-};
-
-static const SiS310_Part2PortTblStruct SiS310_CRT2Part2_1400x1050_1[] =
-{
- {{0x43,0x24,0x21,0x29,0x19,0xea,0x23,0x0a,0x07,0x32,0xc6,0x42}},
- {{0x43,0x24,0x21,0x29,0x19,0xea,0x23,0x0a,0x07,0x32,0xc6,0x42}},
- {{0x43,0x24,0x21,0x29,0x19,0xea,0x23,0x0a,0x07,0x32,0xc6,0x42}},
- {{0x43,0x24,0x21,0x29,0x19,0xea,0x23,0x0a,0x07,0x32,0xc6,0x42}},
- {{0x43,0x24,0x21,0x29,0x19,0xea,0x23,0x0a,0x07,0x32,0xc6,0x32}},
- {{0x43,0x24,0x21,0x29,0x19,0xea,0x23,0x0a,0x07,0x32,0xc6,0x32}},
- {{0x43,0x24,0x21,0x29,0x19,0xea,0x23,0x0a,0x07,0x32,0xc6,0x32}},
- {{0x43,0x24,0x21,0x29,0x19,0xea,0x23,0x0a,0x07,0x32,0xc6,0x32}},
- {{0x43,0x24,0x21,0x29,0x19,0xea,0x23,0x0a,0x07,0x32,0xc6,0x42}}
-};
-
-static const SiS310_Part2PortTblStruct SiS310_CRT2Part2_1400x1050_2[] =
-{
- {{0x2b,0x12,0xd9,0xe5,0xd5,0x2c,0x23,0x98,0x27,0x3e,0x08,0x42}},
- {{0x22,0x12,0xc0,0xcc,0xbc,0x2c,0x23,0x98,0x27,0x3e,0x08,0x42}},
- {{0x2b,0x12,0xd9,0xe5,0xd5,0x2c,0x23,0x98,0x27,0x3e,0x08,0x42}},
- {{0x22,0x12,0xc0,0xcc,0xbc,0x2c,0x23,0x98,0x27,0x3e,0x08,0x42}},
- {{0x33,0x13,0x01,0x0d,0xfd,0x2c,0x23,0x98,0x27,0x3e,0x08,0x42}},
- {{0x3f,0x1b,0x3d,0x49,0x39,0x54,0x23,0xc0,0x27,0x66,0x30,0x42}},
- {{0x33,0x1b,0x91,0x9d,0x8d,0x8c,0x23,0xf8,0x27,0x9e,0x68,0x42}},
- {{0x43,0x24,0x11,0x1d,0x0d,0xcc,0x23,0x38,0x37,0xde,0xa8,0x42}},
- {{0x43,0x24,0x21,0x29,0x19,0xea,0x23,0x0a,0x07,0x32,0xc6,0x42}}
-};
-
-static const SiS310_Part2PortTblStruct SiS310_CRT2Part2_1400x1050_3[] =
-{
- {{0x43,0x24,0x21,0x29,0x19,0xea,0x23,0x0a,0x07,0x32,0xc6,0x42}},
- {{0x43,0x24,0x21,0x29,0x19,0xea,0x23,0x0a,0x07,0x32,0xc6,0x42}},
- {{0x43,0x24,0x21,0x29,0x19,0xea,0x23,0x0a,0x07,0x32,0xc6,0x42}},
- {{0x43,0x24,0x21,0x29,0x19,0xea,0x23,0x0a,0x07,0x32,0xc6,0x42}},
- {{0x43,0x24,0x21,0x29,0x19,0xea,0x23,0x0a,0x07,0x32,0xc6,0x32}},
- {{0x43,0x24,0x21,0x29,0x19,0xea,0x23,0x0a,0x07,0x32,0xc6,0x32}},
- {{0x43,0x24,0x21,0x29,0x19,0xea,0x23,0x0a,0x07,0x32,0xc6,0x32}},
- {{0x43,0x24,0x21,0x29,0x19,0xea,0x23,0x0a,0x07,0x32,0xc6,0x32}},
- {{0x43,0x24,0x21,0x29,0x19,0xea,0x23,0x0a,0x07,0x32,0xc6,0x32}}
-};
-
-static const SiS310_Part2PortTblStruct SiS310_CRT2Part2_1600x1200_1[] =
-{
- {{0x4C,0x24,0xC8,0xE1,0xAF,0x70,0x34,0x0A,0x07,0xFC,0x2A,0x53}},
- {{0x4C,0x24,0xC8,0xE1,0xAF,0x70,0x34,0x0A,0x07,0xFC,0x2A,0x53}},
- {{0x4C,0x24,0xC8,0xE1,0xAF,0x70,0x34,0x0A,0x07,0xFC,0x2A,0x53}},
- {{0x4C,0x24,0xC8,0xE1,0xAF,0x70,0x34,0x0A,0x07,0xFC,0x2A,0x53}},
- {{0x4C,0x24,0xC8,0xE1,0xAF,0x70,0x34,0x0A,0x07,0xFC,0x2A,0x53}},
- {{0x4C,0x24,0xC8,0xE1,0xAF,0x70,0x34,0x0A,0x07,0xFC,0x2A,0x53}},
- {{0x4C,0x24,0xC8,0xE1,0xAF,0x70,0x34,0x0A,0x07,0xFC,0x2A,0x53}},
- {{0x4C,0x24,0xC8,0xE1,0xAF,0x70,0x34,0x0A,0x07,0xFC,0x2A,0x53}},
- {{0x4C,0x24,0xC8,0xE1,0xAF,0x70,0x34,0x0A,0x07,0xFC,0x2A,0x53}},
- {{0x4C,0x24,0xC8,0xE1,0xAF,0x70,0x34,0x0A,0x07,0xFC,0x2A,0x53}}
-};
-
-static const SiS310_Part2PortTblStruct SiS310_CRT2Part2_1600x1200_2[] =
-{
- {{0x32,0x1B,0x2C,0x52,0x20,0x80,0x20,0x52,0x30,0xA3,0x3A,0x02}},
- {{0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00}},
- {{0x32,0x1B,0x2C,0x52,0x20,0x80,0x20,0x52,0x30,0xA3,0x3A,0x02}},
- {{0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00}},
- {{0x3A,0x1B,0x54,0x7A,0x48,0x80,0x24,0x52,0x30,0xA3,0x3A,0x02}},
- {{0x36,0x1B,0x90,0xB6,0x84,0xA8,0x24,0x7A,0x30,0xCB,0x62,0x02}},
- {{0x3A,0x1C,0xE4,0x0A,0xD8,0xE0,0x24,0xB2,0x30,0x03,0x9A,0x02}},
- {{0x4A,0x24,0x64,0x8A,0x58,0x20,0x34,0xF2,0x30,0x43,0xDA,0x52}},
- {{0x47,0x24,0x71,0x97,0x65,0x3E,0x34,0x10,0x40,0x61,0xF8,0x02}},
- {{0x4C,0x24,0xC8,0xE1,0xAF,0x70,0x34,0x0A,0x07,0xFC,0x2A,0x53}}
-};
-
-static const SiS310_Part2PortTblStruct SiS310_CRT2Part2_1600x1200_3[] =
-{
- {{0x4C,0x24,0xC8,0xE1,0xAF,0x70,0x34,0x0A,0x07,0xFC,0x2A,0x53}},
- {{0x4C,0x24,0xC8,0xE1,0xAF,0x70,0x34,0x0A,0x07,0xFC,0x2A,0x53}},
- {{0x4C,0x24,0xC8,0xE1,0xAF,0x70,0x34,0x0A,0x07,0xFC,0x2A,0x53}},
- {{0x4C,0x24,0xC8,0xE1,0xAF,0x70,0x34,0x0A,0x07,0xFC,0x2A,0x53}},
- {{0x4C,0x24,0xC8,0xE1,0xAF,0x70,0x34,0x0A,0x07,0xFC,0x2A,0x53}},
- {{0x4C,0x24,0xC8,0xE1,0xAF,0x70,0x34,0x0A,0x07,0xFC,0x2A,0x53}},
- {{0x4C,0x24,0xC8,0xE1,0xAF,0x70,0x34,0x0A,0x07,0xFC,0x2A,0x53}},
- {{0x4C,0x24,0xC8,0xE1,0xAF,0x70,0x34,0x0A,0x07,0xFC,0x2A,0x53}},
- {{0x4C,0x24,0xC8,0xE1,0xAF,0x70,0x34,0x0A,0x07,0xFC,0x2A,0x53}},
- {{0x4C,0x24,0xC8,0xE1,0xAF,0x70,0x34,0x0A,0x07,0xFC,0x2A,0x53}}
-};
-
-/* CRT1 CRTC for LCDA */
-
-typedef struct _SiS310_LCDACRT1DataStruct
-{
- 	UCHAR CR[17];
-}SiS310_LCDACRT1DataStruct;
-
-static const SiS310_LCDACRT1DataStruct  SiS310_LCDACRT11024x768_1[]=
-{
- {{0x73,0x4f,0x4f,0x97,0x59,0x84,0xb4,0x1f,
-   0x92,0x89,0x8f,0x8f,0xb5,0x30,0x00,0x05,
-   0x00}},
- {{0x73,0x4f,0x4f,0x97,0x59,0x84,0x82,0x1f,
-   0x60,0x87,0x5d,0x5d,0x83,0x10,0x00,0x05,
-   0x00}},
- {{0x73,0x4f,0x4f,0x97,0x59,0x84,0xb4,0x1f,
-   0x92,0x89,0x8f,0x8f,0xb5,0x30,0x00,0x05,
-   0x00}},
- {{0x73,0x4f,0x4f,0x97,0x59,0x84,0x82,0x1f,
-   0x60,0x87,0x5d,0x5d,0x83,0x10,0x00,0x05,
-   0x00}},
- {{0x73,0x4f,0x4f,0x97,0x59,0x84,0x04,0x3e,
-   0xE2,0x89,0xdf,0xdf,0x05,0x00,0x00,0x05,
-   0x00}},
- {{0x87,0x63,0x63,0x8B,0x6D,0x18,0x7c,0xf0,
-   0x5A,0x81,0x57,0x57,0x7D,0x00,0x00,0x06,
-   0x01}},
- {{0xA3,0x7f,0x7f,0x87,0x89,0x94,0x24,0xf5,
-   0x02,0x89,0xff,0xff,0x25,0x10,0x00,0x02,
-   0x01}}
-};
-
-static const SiS310_LCDACRT1DataStruct  SiS310_LCDACRT11024x768_1_H[]=
-{
- {{0x4b,0x27,0x27,0x8f,0x31,0x1c,0xb4,0x1f,
-   0x92,0x89,0x8f,0x8f,0xb5,0x30,0x00,0x05,
-   0x00}},
- {{0x4b,0x27,0x27,0x8f,0x31,0x1c,0x82,0x1f,
-   0x60,0x87,0x5D,0x5D,0x83,0x10,0x00,0x05,
-   0x00}},
- {{0x4b,0x27,0x27,0x8f,0x31,0x1c,0xb4,0x1f,
-   0x92,0x89,0x8f,0x8f,0xb5,0x30,0x00,0x05,
-   0x00}},
- {{0x4b,0x27,0x27,0x8f,0x31,0x1c,0x82,0x1f,
-   0x60,0x87,0x5D,0x5D,0x83,0x10,0x00,0x05,
-   0x00}},
- {{0x4b,0x27,0x27,0x8f,0x31,0x1c,0x04,0x3e,
-   0xE2,0x89,0xDf,0xDf,0x05,0x00,0x00,0x05,
-   0x00}},
- {{0x55,0x31,0x31,0x99,0x3b,0x06,0x7c,0xf0,
-   0x5A,0x81,0x57,0x57,0x7D,0x00,0x00,0x01,
-   0x01}},
- {{0x63,0x3F,0x3F,0x87,0x49,0x94,0x24,0xF5,
-   0x02,0x89,0xFF,0xFF,0x25,0x10,0x00,0x01,
-   0x01}}
-};
-
-static const SiS310_LCDACRT1DataStruct  SiS310_LCDACRT11024x768_2[]=
-{
- {{0xa3,0x4f,0x4f,0x0f,0x6e,0x1f,0x24,0xbb,
-   0x4a,0x81,0x8f,0xdb,0xda,0x20,0x00,0x06,
-   0x00}},
- {{0xa3,0x4f,0x4f,0x0f,0x6e,0x1f,0x24,0xbb,
-   0x31,0x88,0x5d,0xc2,0xc1,0x20,0x00,0x06,
-   0x00}},
- {{0xa3,0x4f,0x4f,0x0f,0x6e,0x1f,0x24,0xbb,
-   0x4a,0x81,0x8f,0xdb,0xda,0x20,0x00,0x06,
-   0x00}},
- {{0xa3,0x4f,0x4f,0x0f,0x6e,0x1f,0x24,0xbb,
-   0x31,0x88,0x5d,0xc2,0xc1,0x20,0x00,0x06,
-   0x01}},
- {{0xa3,0x4f,0x4f,0x0f,0x6e,0x1f,0x24,0xb3,
-   0x72,0x89,0xdf,0x03,0x02,0x30,0x00,0x06,
-   0x01}},
- {{0xa3,0x63,0x63,0x98,0x78,0x19,0x24,0xf1,
-   0xbb,0x82,0x57,0x57,0x25,0x10,0x00,0x02,
-   0x01}},
- {{0xa3,0x7f,0x7f,0x87,0x89,0x94,0x24,0xf5,
-   0x02,0x89,0xff,0xff,0x25,0x10,0x00,0x02,
-   0x01}}
-};
-
-static const SiS310_LCDACRT1DataStruct  SiS310_LCDACRT11024x768_2_H[]=
-{
- {{0x7b,0x27,0x27,0x0f,0x46,0x97,0x24,0xbb,
-   0x4a,0x81,0x8f,0xdb,0xda,0x20,0x00,0x01,
-   0x00 }},
- {{0x7b,0x27,0x27,0x0f,0x46,0x97,0x24,0xbb,
-   0x31,0x88,0x5d,0xc2,0xc1,0x20,0x00,0x01,
-   0x00 }},
- {{0x7b,0x27,0x27,0x0f,0x46,0x97,0x24,0xbb,
-   0x4a,0x81,0x8f,0xdb,0xda,0x20,0x00,0x01,
-   0x00 }},
- {{0x7b,0x27,0x27,0x0f,0x46,0x97,0x24,0xbb,
-   0x31,0x88,0x5d,0xc2,0xc1,0x20,0x00,0x01,
-   0x00 }},
- {{0x7b,0x27,0x27,0x0f,0x46,0x97,0x24,0xb3,
-   0x72,0x89,0xdf,0x03,0x02,0x30,0x00,0x01,
-   0x01 }},
- {{0x71,0x31,0x31,0x98,0x46,0x17,0x24,0xf1,
-   0xbb,0x82,0x57,0x57,0x25,0x10,0x00,0x02,
-   0x01 }},
- {{0x63,0x3f,0x3f,0x87,0x4c,0x97,0x24,0xf5,
-   0x0f,0x86,0xff,0xff,0x25,0x30,0x00,0x01,
-   0x01 }}
-};
-
-static const SiS310_LCDACRT1DataStruct  SiS310_LCDACRT11280x1024_1[]=
-{ /* Acer */
- {{0x7e,0x4f,0x4f,0x82,0x58,0x04,0xb8,0x1f,
-   0x90,0x84,0x8f,0x8f,0xb9,0x30,0x00,0x06,
-   0x00}},
- {{0x7e,0x4f,0x4f,0x82,0x58,0x04,0x86,0x1f,
-   0x5e,0x82,0x5d,0x5d,0x87,0x10,0x00,0x06,
-   0x00}},
- {{0x7e,0x4f,0x4f,0x82,0x58,0x04,0xb8,0x1f,
-   0x90,0x84,0x8f,0x8f,0xb9,0x30,0x00,0x06,
-   0x00}},
- {{0x7e,0x4f,0x4f,0x82,0x58,0x04,0x86,0x1f,
-   0x5e,0x82,0x5d,0x5d,0x87,0x10,0x00,0x06,
-   0x00}},
- {{0x7e,0x4f,0x4f,0x82,0x58,0x04,0x08,0x3e,
-   0xe0,0x84,0xdf,0xdf,0x09,0x00,0x00,0x06,
-   0x00}},
- {{0x92,0x63,0x63,0x96,0x6c,0x18,0x80,0xf0,
-   0x58,0x8c,0x57,0x57,0x81,0x20,0x00,0x06,
-   0x01}},
- {{0xae,0x7f,0x7f,0x92,0x88,0x94,0x28,0xf5,
-   0x00,0x84,0xff,0xff,0x29,0x10,0x00,0x02,
-   0x01}},
- {{0xce,0x9f,0x9f,0x92,0xa8,0x14,0x28,0x5a,
-   0x00,0x84,0xff,0xff,0x29,0x01,0x00,0x07,
-   0x01}}
-};
-
-static const SiS310_LCDACRT1DataStruct  SiS310_LCDACRT11280x1024_1_H[]=
-{  /* Acer */
- {{0x56,0x27,0x27,0x9a,0x31,0x1c,0xb8,0x1f,
-   0x90,0x84,0x8f,0x8f,0xb9,0x30,0x00,0x05,
-   0x00}},
- {{0x56,0x27,0x27,0x9a,0x31,0x1c,0x86,0x1f,
-   0x5e,0x82,0x5d,0x5d,0x87,0x10,0x00,0x05,
-   0x00}},
- {{0x56,0x27,0x27,0x9a,0x31,0x1c,0xb8,0x1f,
-   0x90,0x84,0x8f,0x8f,0xb9,0x30,0x00,0x05,
-   0x00}},
- {{0x56,0x27,0x27,0x9a,0x31,0x1c,0x86,0x1f,
-   0x5e,0x82,0x5d,0x5d,0x87,0x10,0x00,0x05,
-   0x01}},
- {{0x56,0x27,0x27,0x9a,0x31,0x1c,0x08,0x3e,
-   0xe0,0x84,0xdf,0xdf,0x09,0x00,0x00,0x05,
-   0x00}},
- {{0x60,0x31,0x31,0x84,0x3a,0x86,0x80,0xf0,
-   0x58,0x8c,0x57,0x57,0x81,0x20,0x00,0x01,
-   0x01}},
- {{0x6e,0x3f,0x3f,0x92,0x48,0x94,0x28,0xf5,
-   0x00,0x84,0xff,0xff,0x29,0x10,0x00,0x01,
-   0x01}}
-};
-
-static const SiS310_LCDACRT1DataStruct  SiS310_LCDACRT11280x1024_2[]=
-{  /* Illegal data in BIOS (Acer, Compaq) */
- {{0xa3,0x4f,0x4f,0x87,0x6e,0x9f,0x24,0xbb,
-   0x4a,0x80,0x8f,0x8f,0x25,0x30,0x00,0x06,
-   0x00}},
- {{0xa3,0x4f,0x4f,0x87,0x6e,0x9f,0x24,0xbb,
-   0x31,0x87,0x5d,0x5d,0x25,0x30,0x00,0x06,
-   0x00}},
- {{0xa3,0x4f,0x4f,0x87,0x6e,0x9f,0x24,0xbb,
-   0x4a,0x80,0x8f,0x8f,0x25,0x30,0x00,0x06,
-   0x00}},
- {{0xa3,0x4f,0x4f,0x87,0x6e,0x9f,0x24,0xbb,
-   0x31,0x87,0x5d,0x5d,0x25,0x30,0x00,0x06,
-   0x00}},
- {{0xa3,0x4f,0x4f,0x87,0x6e,0x9f,0x24,0xbb,
-   0x72,0x88,0xdf,0xdf,0x25,0x30,0x00,0x06,
-   0x00}},
- {{0xa3,0x63,0x63,0x87,0x78,0x89,0x24,0xf1,
-   0xae,0x84,0x57,0x57,0x25,0x30,0x00,0x02,
-   0x01}},
- {{0xa3,0x7f,0x7f,0x87,0x86,0x97,0x24,0xf5,
-   0x02,0x88,0xff,0xff,0x25,0x10,0x00,0x02,
-   0x01}}
-};
-
-static const SiS310_LCDACRT1DataStruct  SiS310_LCDACRT11280x1024_2_H[]=
-{  /* Illegal data in BIOS (Acer, Compaq) */
- {{0x4f,0x27,0x27,0x93,0x39,0x81,0x24,0xbb,
-   0x4a,0x80,0x8f,0x8f,0x25,0x30,0x00,0x01,
-   0x00 }},
- {{0x4f,0x27,0x27,0x93,0x39,0x81,0x24,0xbb,
-   0x31,0x87,0x5d,0x5d,0x25,0x30,0x00,0x01,
-   0x00 }},
- {{0x4f,0x27,0x27,0x93,0x39,0x81,0x24,0xbb,
-   0x4a,0x80,0x8f,0x8f,0x25,0x30,0x00,0x01,
-   0x00 }},
- {{0x4f,0x27,0x27,0x93,0x39,0x81,0x24,0xbb,
-   0x31,0x87,0x5d,0x5d,0x25,0x30,0x00,0x01,
-   0x00 }},
- {{0x4f,0x27,0x27,0x93,0x39,0x81,0x24,0xbb,
-   0x72,0x88,0xdf,0xdf,0x25,0x30,0x00,0x01,
-   0x00 }},
- {{0x4f,0x31,0x31,0x93,0x3e,0x86,0x24,0xf1,
-   0xae,0x84,0x57,0x57,0x25,0x30,0x00,0x01,
-   0x01 }},
- {{0x4f,0x3f,0x3f,0x93,0x45,0x0d,0x24,0xf5,
-   0x02,0x88,0xff,0xff,0x25,0x10,0x00,0x01,
-   0x01 }}
-};
-
-static const SiS310_LCDACRT1DataStruct  SiS310_LCDACRT11400x1050_1[]=
-{
- {{0x6f,0x4f,0x4f,0x93,0x54,0x82,0x9e,0x1f,
-   0x93,0x86,0x8f,0x8f,0x9f,0x30,0x00,0x05,
-   0x00}},
- {{0x6f,0x4f,0x4f,0x93,0x54,0x82,0x6c,0x1f,
-   0x60,0x84,0x5d,0x5d,0x6d,0x10,0x00,0x05,
-   0x00}},
- {{0x6f,0x4f,0x4f,0x93,0x54,0x82,0x9e,0x1f,
-   0x93,0x86,0x8f,0x8f,0x9f,0x30,0x00,0x05,
-   0x00}},
- {{0x6f,0x4f,0x4f,0x93,0x54,0x82,0x6c,0x1f,
-   0x60,0x84,0x5d,0x5d,0x6d,0x10,0x00,0x05,
-   0x00}},
- {{0x6f,0x4f,0x4f,0x93,0x54,0x82,0xee,0x1f,
-   0xe2,0x86,0xdf,0xdf,0xef,0x10,0x00,0x05,
-   0x00}},
- {{0x83,0x63,0x63,0x87,0x68,0x16,0x66,0xf0,
-   0x5a,0x8e,0x57,0x57,0x67,0x20,0x00,0x06,
-   0x01}},
- {{0x9f,0x7f,0x7f,0x83,0x84,0x92,0x0e,0xf5,
-   0x02,0x86,0xff,0xff,0x0f,0x10,0x00,0x02,
-   0x01}},
- {{0xbf,0x9f,0x9f,0x83,0xa4,0x12,0x0e,0x5a,
-   0x02,0x86,0xff,0xff,0x0f,0x09,0x00,0x07,
-   0x01}},
- {{0xce,0xae,0xae,0x92,0xb3,0x01,0x28,0x10,
-   0x1a,0x80,0x19,0x19,0x29,0x0f,0x00,0x03,
-   0x00}}
-};
-
-static const SiS310_LCDACRT1DataStruct  SiS310_LCDACRT11400x1050_1_H[]=
-{
-  {{0x47,0x27,0x27,0x8b,0x2c,0x1a,0x9e,0x1f,
-    0x93,0x86,0x8f,0x8f,0x9f,0x30,0x00,0x05,
-    0x00}},
-  {{0x47,0x27,0x27,0x8b,0x2c,0x1a,0x6c,0x1f,
-    0x60,0x84,0x5d,0x5d,0x6d,0x10,0x00,0x05,
-    0x00}},
-  {{0x47,0x27,0x27,0x8b,0x30,0x1e,0x9e,0x1f,
-    0x92,0x86,0x8f,0x8f,0x9f,0x30,0x00,0x05,
-    0x00}},
-  {{0x47,0x27,0x27,0x8b,0x2c,0x1a,0x6c,0x1f,
-    0x60,0x84,0x5d,0x5d,0x6d,0x10,0x00,0x05,
-    0x00}},
-  {{0x47,0x27,0x27,0x8b,0x2c,0x1a,0xee,0x1f,
-    0xe2,0x86,0xdf,0xdf,0xef,0x10,0x00,0x05,
-    0x00}},
-  {{0x51,0x31,0x31,0x95,0x36,0x04,0x66,0xf0,
-    0x5a,0x8e,0x57,0x57,0x67,0x20,0x00,0x01,
-    0x01}},
-  {{0x5f,0x3f,0x3f,0x83,0x44,0x92,0x0e,0xf5,
-    0x02,0x86,0xff,0xff,0x0f,0x10,0x00,0x01,
-    0x01}},
-  {{0x6f,0x4f,0x4f,0x93,0x54,0x82,0x0e,0x5a,
-    0x02,0x86,0xff,0xff,0x0f,0x09,0x00,0x05,
-    0x01}},
-  {{0x76,0x56,0x56,0x9a,0x5b,0x89,0x28,0x10,
-    0x1c,0x80,0x19,0x19,0x29,0x0b,0x00,0x05,
-    0x00}}
-};
-
-static const SiS310_LCDACRT1DataStruct  SiS310_LCDACRT11400x1050_2[]=
-{
- {{0xce,0x4f,0x4f,0x92,0x8c,0x1a,0x28,0x9a,
-   0xdb,0x8f,0x8f,0x8f,0x29,0x21,0x00,0x03,
-   0x00}},
- {{0xce,0x4f,0x4f,0x92,0x8c,0x1a,0x28,0x9a,
-   0xc2,0x86,0x5d,0x5d,0x29,0x01,0x00,0x03,
-   0x01}},
- {{0xce,0x4f,0x4f,0x92,0x8c,0x1a,0x28,0x9a,
-   0xdb,0x8f,0x8f,0x8f,0x29,0x21,0x00,0x03,
-   0x00}},
- {{0xce,0x4f,0x4f,0x92,0x8c,0x1a,0x28,0x9a,
-   0xc2,0x86,0x5d,0x5d,0x29,0x01,0x00,0x03,
-   0x00}},
- {{0xce,0x4f,0x4f,0x92,0x8c,0x1a,0x28,0x9e,
-   0x03,0x87,0xdf,0xdf,0x29,0x01,0x00,0x03,
-   0x00}},
- {{0xce,0x63,0x63,0x92,0x96,0x04,0x28,0xd4,
-   0x3f,0x83,0x57,0x57,0x29,0x01,0x00,0x07,
-   0x01}},
- {{0xce,0x7f,0x7f,0x92,0xa4,0x12,0x28,0xd4,
-   0x93,0x87,0xff,0xff,0x29,0x21,0x00,0x07,
-   0x01}},
- {{0xce,0x9f,0x9f,0x92,0xb4,0x02,0x28,0x5a,
-   0x13,0x87,0xff,0xff,0x29,0x29,0x00,0x03,
-   0x01}},
- {{0xce,0xae,0xae,0x92,0xbc,0x0a,0x28,0x10,
-   0x20,0x84,0x19,0x19,0x29,0x0f,0x00,0x03,
-   0x00}}
-};
-
-static const SiS310_LCDACRT1DataStruct  SiS310_LCDACRT11400x1050_2_H[]=
-{
- {{0xa6,0x27,0x27,0x8a,0x64,0x92,0x28,0x9a,
-   0xdb,0x8f,0x8f,0x8f,0x29,0x21,0x00,0x06,
-   0x00}},
- {{0xa6,0x27,0x27,0x8a,0x64,0x92,0x28,0x9a,
-   0xc2,0x86,0x5d,0x5d,0x29,0x01,0x00,0x06,
-   0x00}},
- {{0xa6,0x27,0x27,0x8a,0x64,0x92,0x28,0x9a,
-   0xdb,0x8f,0x8f,0x8f,0x29,0x21,0x00,0x06,
-   0x00}},
- {{0xa6,0x27,0x27,0x8a,0x64,0x92,0x28,0x9a,
-   0xc2,0x86,0x5d,0x5d,0x29,0x01,0x00,0x06,
-   0x00}},
- {{0xa6,0x27,0x27,0x8a,0x64,0x92,0x28,0x9e,
-   0x03,0x87,0xdf,0xdf,0x29,0x01,0x00,0x06,
-   0x00}},
- {{0x9c,0x31,0x31,0x80,0x64,0x92,0x28,0xd4,
-   0x3f,0x83,0x57,0x57,0x29,0x01,0x00,0x06,
-   0x01}},
- {{0x8e,0x3f,0x3f,0x92,0x64,0x12,0x28,0xd4,
-   0x93,0x87,0xff,0xff,0x29,0x21,0x00,0x06,
-   0x01}},
- {{0x7e,0x4f,0x4f,0x82,0x64,0x12,0x28,0x5a,
-   0x13,0x87,0xff,0xff,0x29,0x29,0x00,0x06,
-   0x01}},
- {{0x76,0x56,0x56,0x9a,0x64,0x92,0x28,0x10,
-   0x20,0x84,0x19,0x19,0x29,0x0f,0x00,0x05,
-   0x00}}
-};
-
-static const SiS310_LCDACRT1DataStruct  SiS310_LCDACRT11600x1200_1[]=
-{
- {{0x83,0x4F,0x4F,0x87,0x51,0x09,0xC0,0x1F,
-   0x90,0x84,0x8F,0x8F,0xC1,0x30,0x00,0x06,
-   0x00}},
- {{0x83,0x4F,0x4F,0x87,0x51,0x09,0x8E,0x1F,
-   0x5E,0x82,0x5D,0x5D,0x8F,0x10,0x00,0x06,
-   0x00}},
- {{0x83,0x4F,0x4F,0x87,0x51,0x09,0xC0,0x1F,
-   0x90,0x84,0x8F,0x8F,0xC1,0x30,0x00,0x06,
-   0x00}},
- {{0x83,0x4F,0x4F,0x87,0x51,0x09,0x8E,0x1F,
-   0x5E,0x82,0x5D,0x5D,0x8F,0x10,0x00,0x06,
-   0x00}},
- {{0x83,0x4F,0x4F,0x87,0x51,0x09,0x10,0x3E,
-   0xE0,0x84,0xDF,0xDF,0x11,0x00,0x00,0x06,
-   0x00}},
- {{0x97,0x63,0x63,0x9B,0x65,0x1D,0x88,0xF0,
-   0x58,0x8C,0x57,0x57,0x89,0x20,0x00,0x06,
-   0x01}},
- {{0xB3,0x7F,0x7F,0x97,0x81,0x99,0x30,0xF5,
-   0x00,0x84,0xFF,0xFF,0x31,0x10,0x00,0x02,
-   0x01}},
- {{0xD3,0x9F,0x9F,0x97,0xA1,0x19,0x30,0x5A,
-   0x00,0x84,0xFF,0xFF,0x31,0x09,0x00,0x07,
-   0x01}},
- {{0xE2,0xAE,0xAE,0x86,0xB0,0x88,0x4A,0x10,
-   0x1A,0x8E,0x19,0x19,0x4B,0x2F,0x00,0x03,
-   0x00}},
- {{0xFB,0xC7,0xC7,0x9F,0xC9,0x81,0xE0,0x10,
-   0xB0,0x84,0xAF,0xAF,0xE1,0x2F,0x00,0x07,
-   0x00}}
-};
-
-static const SiS310_LCDACRT1DataStruct  SiS310_LCDACRT11600x1200_1_H[]=
-{
- {{0x69,0x27,0x27,0x8D,0x30,0x88,0xC0,0x1F,
-   0x90,0x84,0x8F,0x8F,0xC1,0x30,0x00,0x01,
-   0x00}},
- {{0x69,0x27,0x27,0x8D,0x30,0x88,0x8E,0x1F,
-   0x5E,0x82,0x5D,0x5D,0x87,0x10,0x00,0x01,
-   0x00}},
- {{0x69,0x27,0x27,0x8D,0x30,0x88,0xC0,0x1F,
-   0x90,0x84,0x8F,0x8F,0xC1,0x30,0x00,0x01,
-   0x00}},
- {{0x69,0x27,0x27,0x8D,0x30,0x88,0x8E,0x1F,
-   0x5E,0x82,0x5D,0x5D,0x87,0x10,0x00,0x01,
-   0x00}},
- {{0x69,0x27,0x27,0x8D,0x30,0x88,0x10,0x3E,
-   0xE0,0x84,0xDF,0xDF,0x11,0x00,0x00,0x01,
-   0x00}},
- {{0x73,0x31,0x31,0x97,0x3A,0x92,0x88,0xF0,
-   0x58,0x8C,0x57,0x57,0x89,0x20,0x00,0x01,
-   0x01}},
- {{0x81,0x3F,0x3F,0x85,0x48,0x00,0x30,0xF5,
-   0x00,0x84,0xFF,0xFF,0x31,0x10,0x00,0x06,
-   0x01}},
- {{0x91,0x4F,0x4F,0x95,0x58,0x10,0x30,0x5A,
-   0x00,0x84,0xFF,0xFF,0x31,0x09,0x00,0x06,
-   0x01}},
- {{0xD4,0x9F,0x9F,0x98,0xA8,0x00,0x30,0x5A,
-   0x00,0x84,0xFF,0xFF,0x31,0x09,0x00,0x03,
-   0x01}},
- {{0xA5,0x63,0x63,0x89,0x6C,0x84,0xE0,0x10,
-   0xB0,0x84,0xAF,0xAF,0xE1,0x2F,0x00,0x02,
-   0x00}}
-};
-
-static const SiS310_LCDACRT1DataStruct  SiS310_LCDACRT11600x1200_2[]=
-{
- {{0x09,0x4F,0x4F,0x8D,0xA3,0x1B,0xE0,0x9E,
-   0x37,0x8B,0x8F,0x8F,0xE1,0x21,0x01,0x04,
-   0x00}},
- {{0x09,0x4F,0x4F,0x8D,0xA3,0x1B,0xE0,0x9E,
-   0x1E,0x82,0x5D,0x5D,0xE1,0x01,0x01,0x04,
-   0x00}},
- {{0x09,0x4F,0x4F,0x8D,0xA3,0x1B,0xE0,0x9E,
-   0x37,0x8B,0x8F,0x8F,0xE1,0x21,0x01,0x04,
-   0x00}},
- {{0x09,0x4F,0x4F,0x8D,0xA3,0x1B,0xE0,0x9E,
-   0x1E,0x82,0x5D,0x5D,0xE1,0x01,0x01,0x04,
-   0x00}},
- {{0x09,0x4F,0x4F,0x8D,0xA3,0x1B,0xE0,0x9E,
-   0x5F,0x83,0xDF,0xDF,0xE1,0x01,0x01,0x04,
-   0x00}},
- {{0x09,0x63,0x63,0x8D,0xAD,0x05,0xE0,0xD4,
-   0x9B,0x8F,0x57,0x57,0xE1,0x21,0x01,0x00,
-   0x01}},
- {{0x09,0x7F,0x7F,0x8D,0xBB,0x13,0xE0,0xD4,
-   0xEF,0x83,0xFF,0xFF,0xE1,0x21,0x01,0x00,
-   0x01}},
- {{0x09,0x9F,0x9F,0x8D,0xCB,0x03,0xE0,0x5A,
-   0x6F,0x83,0xFF,0xFF,0xE1,0x29,0x01,0x04,
-   0x01}},
- {{0xD4,0x9F,0x9F,0x98,0xA8,0x00,0x30,0x5A,
-   0x00,0x84,0xFF,0xFF,0x31,0x09,0x00,0x03,
-   0x01}},
- {{0x09,0xC7,0xC7,0x8D,0xDF,0x17,0xE0,0x10,
-   0xC7,0x8B,0xAF,0xAF,0xE1,0x0F,0x01,0x04,
-   0x00}}
-};
-
-static const SiS310_LCDACRT1DataStruct  SiS310_LCDACRT11600x1200_2_H[]=
-{
- {{0xE1,0x27,0x27,0x85,0x7B,0x93,0xE0,0x9E,
-   0x37,0x8B,0x8F,0x8F,0xE1,0x21,0x00,0x03,
-   0x00}},
- {{0xE1,0x27,0x27,0x85,0x7B,0x93,0xE0,0x9E,
-   0x1E,0x82,0x5D,0x5D,0xE1,0x01,0x00,0x03,
-   0x00}},
- {{0xE1,0x27,0x27,0x85,0x7B,0x93,0xE0,0x9E,
-   0x37,0x8B,0x8F,0x8F,0xE1,0x21,0x00,0x03,
-   0x00}},
- {{0xE1,0x27,0x27,0x85,0x7B,0x93,0xE0,0x9E,
-   0x1E,0x82,0x5D,0x5D,0xE1,0x01,0x00,0x03,
-   0x00}},
- {{0xE1,0x27,0x27,0x85,0x7B,0x93,0xE0,0x9E,
-   0x5F,0x83,0xDF,0xDF,0xE1,0x01,0x00,0x03,
-   0x00}},
- {{0xD7,0x31,0x31,0x9B,0x7B,0x13,0xE0,0xD4,
-   0x9B,0x8F,0x57,0x57,0xE1,0x21,0x00,0x03,
-   0x01}},
- {{0xC9,0x3F,0x3F,0x8D,0x7B,0x13,0xE0,0xD4,
-   0xEF,0x83,0xFF,0xFF,0xE1,0x21,0x00,0x03,
-   0x01}},
- {{0xB9,0x4F,0x4F,0x9D,0x7B,0x93,0xE0,0x5A,
-   0x6F,0x83,0xFF,0xFF,0xE1,0x29,0x00,0x02,
-   0x01}},
- {{0xD4,0x9F,0x9F,0x98,0xA8,0x00,0x30,0x5A,
-   0x00,0x84,0xFF,0xFF,0x31,0x09,0x00,0x03,
-   0x01}},
- {{0xA5,0x63,0x63,0x89,0x7B,0x93,0xE0,0x10,
-   0xC7,0x8B,0xAF,0xAF,0xE1,0x0F,0x00,0x02,
-   0x00}}
-};
-
+#endif
 
 /**************************************************************/
 /* LVDS, CHRONTEL ------------------------------------------- */
 /**************************************************************/
 
-typedef struct _SiS310_LVDSDataStruct
-{
-	USHORT VGAHT;
-	USHORT VGAVT;
-	USHORT LCDHT;
-	USHORT LCDVT;
-} SiS310_LVDSDataStruct;
-
-static const SiS310_LVDSDataStruct  SiS310_CHTVUPALData[]=
+static const SiS_LVDSDataStruct  SiS310_CHTVUPALData[]=
 {
 	{1008, 625,1008, 625},
 	{1008, 625,1008, 625},
@@ -1697,7 +1011,7 @@ static const SiS310_LVDSDataStruct  SiS310_CHTVUPALData[]=
 	{1400,1000,1400,1000}
 };
 
-static const SiS310_LVDSDataStruct  SiS310_CHTVOPALData[]=
+static const SiS_LVDSDataStruct  SiS310_CHTVOPALData[]=
 {
 	{1008, 625,1008, 625},
 	{1008, 625,1008, 625},
@@ -1708,7 +1022,7 @@ static const SiS310_LVDSDataStruct  SiS310_CHTVOPALData[]=
         {1400, 875,1400, 875}
 };
 
-static const SiS310_LVDSDataStruct  SiS310_CHTVUPALMData[]=
+static const SiS_LVDSDataStruct  SiS310_CHTVUPALMData[]=
 {
 	{ 840, 600, 840, 600},
 	{ 840, 600, 840, 600},
@@ -1719,7 +1033,7 @@ static const SiS310_LVDSDataStruct  SiS310_CHTVUPALMData[]=
         {1160, 945,1160, 945}
 };
 
-static const SiS310_LVDSDataStruct  SiS310_CHTVOPALMData[]=
+static const SiS_LVDSDataStruct  SiS310_CHTVOPALMData[]=
 {
 	{ 840, 525, 840, 525},
 	{ 840, 525, 840, 525},
@@ -1730,7 +1044,7 @@ static const SiS310_LVDSDataStruct  SiS310_CHTVOPALMData[]=
         {1160, 840,1160, 840}
 };
 
-static const SiS310_LVDSDataStruct  SiS310_CHTVUPALNData[]=
+static const SiS_LVDSDataStruct  SiS310_CHTVUPALNData[]=
 {
 	{1008, 625,1008, 625},
 	{1008, 625,1008, 625},
@@ -1741,7 +1055,7 @@ static const SiS310_LVDSDataStruct  SiS310_CHTVUPALNData[]=
 	{1400,1000,1400,1000}
 };
 
-static const SiS310_LVDSDataStruct  SiS310_CHTVOPALNData[]=
+static const SiS_LVDSDataStruct  SiS310_CHTVOPALNData[]=
 {
 	{1008, 625,1008, 625},
 	{1008, 625,1008, 625},
@@ -1752,7 +1066,7 @@ static const SiS310_LVDSDataStruct  SiS310_CHTVOPALNData[]=
         {1400, 875,1400, 875}
 };
 
-static const SiS310_LVDSDataStruct  SiS310_CHTVSOPALData[]=   /* TW: (super overscan - no effect on 7019) */
+static const SiS_LVDSDataStruct  SiS310_CHTVSOPALData[]=   /* (super overscan - no effect on 7019) */
 {
 	{1008, 625,1008, 625},
 	{1008, 625,1008, 625},
@@ -1763,13 +1077,8 @@ static const SiS310_LVDSDataStruct  SiS310_CHTVSOPALData[]=   /* TW: (super over
         {1400, 875,1400, 875}
 };
 
-typedef struct _SiS310_LVDSDesStruct
-{
-	USHORT LCDHDES;
-	USHORT LCDVDES;
-} SiS310_LVDSDesStruct;
 
-static const SiS310_LVDSDesStruct  SiS310_PanelType00_1[]=  /* 800x600 */
+static const SiS_LVDSDesStruct  SiS310_PanelType00_1[]=  /* 800x600 */
 {
 	{ 0, 0},
 	{ 0, 0},
@@ -1782,7 +1091,7 @@ static const SiS310_LVDSDesStruct  SiS310_PanelType00_1[]=  /* 800x600 */
 	{ 0, 0}
 };
 
-static const SiS310_LVDSDesStruct  SiS310_PanelType01_1[]=  /* 1024x768 */
+static const SiS_LVDSDesStruct  SiS310_PanelType01_1[]=  /* 1024x768 */
 {
 	{ 0, 0},
 	{ 0, 0},
@@ -1795,7 +1104,7 @@ static const SiS310_LVDSDesStruct  SiS310_PanelType01_1[]=  /* 1024x768 */
 	{ 0, 0}
 };
 
-static const SiS310_LVDSDesStruct  SiS310_PanelType02_1[]=  /* 1280x1024 */
+static const SiS_LVDSDesStruct  SiS310_PanelType02_1[]=  /* 1280x1024 */
 {
 	{ 0, 0},
 	{ 0, 0},
@@ -1810,7 +1119,7 @@ static const SiS310_LVDSDesStruct  SiS310_PanelType02_1[]=  /* 1280x1024 */
 };
 
 
-static const SiS310_LVDSDesStruct  SiS310_PanelType03_1[]=
+static const SiS_LVDSDesStruct  SiS310_PanelType03_1[]=
 {
 	{ 0, 0},
 	{ 0, 0},
@@ -1823,7 +1132,7 @@ static const SiS310_LVDSDesStruct  SiS310_PanelType03_1[]=
 	{ 0, 0}
 };
 
-static const SiS310_LVDSDesStruct  SiS310_PanelType04_1[]=
+static const SiS_LVDSDesStruct  SiS310_PanelType04_1[]=
 {
 	{1343, 798},
 	{1343, 794},
@@ -1836,7 +1145,7 @@ static const SiS310_LVDSDesStruct  SiS310_PanelType04_1[]=
 	{ 0,   0}
 };
 
-static const SiS310_LVDSDesStruct  SiS310_PanelType05_1[]=
+static const SiS_LVDSDesStruct  SiS310_PanelType05_1[]=
 {
 	{1343, 798},
 	{1343, 794},
@@ -1849,7 +1158,7 @@ static const SiS310_LVDSDesStruct  SiS310_PanelType05_1[]=
 	{ 0,   0}
 };
 
-static const SiS310_LVDSDesStruct  SiS310_PanelType06_1[]=
+static const SiS_LVDSDesStruct  SiS310_PanelType06_1[]=
 {
 	{1343, 798},
 	{1343, 794},
@@ -1862,7 +1171,7 @@ static const SiS310_LVDSDesStruct  SiS310_PanelType06_1[]=
 	{ 0,   0}
 };
 
-static const SiS310_LVDSDesStruct  SiS310_PanelType07_1[]=
+static const SiS_LVDSDesStruct  SiS310_PanelType07_1[]=
 {
 	{1343, 798},
 	{1343, 794},
@@ -1875,7 +1184,7 @@ static const SiS310_LVDSDesStruct  SiS310_PanelType07_1[]=
 	{ 0,   0}
 };
 
-static const SiS310_LVDSDesStruct  SiS310_PanelType08_1[]=   /* 1400x1050 */
+static const SiS_LVDSDesStruct  SiS310_PanelType08_1[]=   /* 1400x1050 */
 {
 	{ 0, 0},
 	{ 0, 0},
@@ -1890,7 +1199,7 @@ static const SiS310_LVDSDesStruct  SiS310_PanelType08_1[]=   /* 1400x1050 */
 	{ 0, 0}
 };
 
-static const SiS310_LVDSDesStruct  SiS310_PanelType09_1[]=   /* 1280x768 */
+static const SiS_LVDSDesStruct  SiS310_PanelType09_1[]=   /* 1280x768 */
 {
 	{ 0, 0},
 	{ 0, 0},
@@ -1905,7 +1214,7 @@ static const SiS310_LVDSDesStruct  SiS310_PanelType09_1[]=   /* 1280x768 */
 	{ 0, 0}
 };
 
-static const SiS310_LVDSDesStruct  SiS310_PanelType0a_1[]=  /* 1600x1200 */
+static const SiS_LVDSDesStruct  SiS310_PanelType0a_1[]=  /* 1600x1200 */
 {
 	{ 0, 0},
 	{ 0, 0},
@@ -1920,7 +1229,7 @@ static const SiS310_LVDSDesStruct  SiS310_PanelType0a_1[]=  /* 1600x1200 */
 	{ 0, 0}
 };
 
-static const SiS310_LVDSDesStruct  SiS310_PanelType0b_1[]=  /* 640x480_2 */
+static const SiS_LVDSDesStruct  SiS310_PanelType0b_1[]=  /* 640x480_2 */
 {
 	{ 0, 524},
 	{ 0, 524},
@@ -1932,7 +1241,7 @@ static const SiS310_LVDSDesStruct  SiS310_PanelType0b_1[]=  /* 640x480_2 */
 	{ 0, 524}
 };
 
-static const SiS310_LVDSDesStruct  SiS310_PanelType0c_1[]=  /* 640x480_3 */
+static const SiS_LVDSDesStruct  SiS310_PanelType0c_1[]=  /* 640x480_3 */
 {
 	{ 0, 524},
 	{ 0, 524},
@@ -1944,7 +1253,7 @@ static const SiS310_LVDSDesStruct  SiS310_PanelType0c_1[]=  /* 640x480_3 */
 	{ 0, 524}
 };
 
-static const SiS310_LVDSDesStruct  SiS310_PanelType0d_1[]=
+static const SiS_LVDSDesStruct  SiS310_PanelType0d_1[]=
 {
 	{1343, 798},
 	{1343, 794},
@@ -1957,7 +1266,7 @@ static const SiS310_LVDSDesStruct  SiS310_PanelType0d_1[]=
 	{ 0,   0}
 };
 
-static const SiS310_LVDSDesStruct  SiS310_PanelType0e_1[]=
+static const SiS_LVDSDesStruct  SiS310_PanelType0e_1[]=
 {
 	{1343, 798},
 	{1343, 794},
@@ -1970,7 +1279,7 @@ static const SiS310_LVDSDesStruct  SiS310_PanelType0e_1[]=
 	{ 0,   0}
 };
 
-static const SiS310_LVDSDesStruct  SiS310_PanelType0f_1[]=
+static const SiS_LVDSDesStruct  SiS310_PanelType0f_1[]=
 {
 	{1343, 798},
 	{1343, 794},
@@ -1983,7 +1292,7 @@ static const SiS310_LVDSDesStruct  SiS310_PanelType0f_1[]=
 	{ 0,   0}
 };
 
-static const SiS310_LVDSDesStruct  SiS310_PanelType00_2[]=
+static const SiS_LVDSDesStruct  SiS310_PanelType00_2[]=
 {
 	{980, 528},
 	{980, 503},
@@ -1996,7 +1305,7 @@ static const SiS310_LVDSDesStruct  SiS310_PanelType00_2[]=
 	{ 0,   0}
 };
 
-static const SiS310_LVDSDesStruct  SiS310_PanelType01_2[]= 
+static const SiS_LVDSDesStruct  SiS310_PanelType01_2[]=
 {
 	{1152, 622},
 	{1152, 597},
@@ -2009,7 +1318,7 @@ static const SiS310_LVDSDesStruct  SiS310_PanelType01_2[]=
 	{ 0,   0}
 };
 
-static const SiS310_LVDSDesStruct  SiS310_PanelType02_2[]= 
+static const SiS_LVDSDesStruct  SiS310_PanelType02_2[]=
 {
 	{1368, 754},
 	{1368, 729},
@@ -2024,7 +1333,7 @@ static const SiS310_LVDSDesStruct  SiS310_PanelType02_2[]=
 	{ 0,   0}
 };
 
-static const SiS310_LVDSDesStruct  SiS310_PanelType03_2[]=  
+static const SiS_LVDSDesStruct  SiS310_PanelType03_2[]=
 {
 	{ 0,   0},
 	{ 0,   0},
@@ -2035,7 +1344,7 @@ static const SiS310_LVDSDesStruct  SiS310_PanelType03_2[]=
 	{ 0,   0}
 };
 
-static const SiS310_LVDSDesStruct  SiS310_PanelType04_2[]=  
+static const SiS_LVDSDesStruct  SiS310_PanelType04_2[]=
 {
 	{ 0,   0},
 	{ 0,   0},
@@ -2048,7 +1357,7 @@ static const SiS310_LVDSDesStruct  SiS310_PanelType04_2[]=
 	{ 0,   0}
 };
 
-static const SiS310_LVDSDesStruct  SiS310_PanelType05_2[]=  
+static const SiS_LVDSDesStruct  SiS310_PanelType05_2[]=
 {
 	{1152, 622},
 	{1152, 597},
@@ -2061,7 +1370,7 @@ static const SiS310_LVDSDesStruct  SiS310_PanelType05_2[]=
 	{ 0,   0}
 };
 
-static const SiS310_LVDSDesStruct  SiS310_PanelType06_2[]=  
+static const SiS_LVDSDesStruct  SiS310_PanelType06_2[]=
 {
 	{1152, 622},
 	{1152, 597},
@@ -2074,7 +1383,7 @@ static const SiS310_LVDSDesStruct  SiS310_PanelType06_2[]=
 	{ 0,   0}
 };
 
-static const SiS310_LVDSDesStruct  SiS310_PanelType07_2[]=  
+static const SiS_LVDSDesStruct  SiS310_PanelType07_2[]=
 {
 	{1152, 622},
 	{1152, 597},
@@ -2087,7 +1396,7 @@ static const SiS310_LVDSDesStruct  SiS310_PanelType07_2[]=
 	{ 0,   0}
 };
 
-static const SiS310_LVDSDesStruct  SiS310_PanelType08_2[]=  /* 1400x1050 */
+static const SiS_LVDSDesStruct  SiS310_PanelType08_2[]=  /* 1400x1050 */
 {
 	{1308, 741},
 	{1308, 716},
@@ -2102,7 +1411,7 @@ static const SiS310_LVDSDesStruct  SiS310_PanelType08_2[]=  /* 1400x1050 */
 	{   0,   0}
 };
 
-static const SiS310_LVDSDesStruct  SiS310_PanelType09_2[]= /* 1280x768 */
+static const SiS_LVDSDesStruct  SiS310_PanelType09_2[]= /* 1280x768 */
 {
 	{1083, 622},
 	{1083, 597},
@@ -2115,7 +1424,7 @@ static const SiS310_LVDSDesStruct  SiS310_PanelType09_2[]= /* 1280x768 */
 	{   0,   0}
 };
 
-static const SiS310_LVDSDesStruct  SiS310_PanelType0a_2[]=  /* 1600x1200 */
+static const SiS_LVDSDesStruct  SiS310_PanelType0a_2[]=  /* 1600x1200 */
 {
 	{1568, 920},
 	{1568, 895},
@@ -2141,7 +1450,7 @@ static const SiS310_LVDSDesStruct  SiS310_PanelType0a_2[]=  /* 1600x1200 */
 #endif
 };
 
-static const SiS310_LVDSDesStruct  SiS310_PanelType0b_2[]=  /* 640x480_2 */
+static const SiS_LVDSDesStruct  SiS310_PanelType0b_2[]=  /* 640x480_2 */
 {
 	{1152, 622},
 	{1152, 597},
@@ -2154,7 +1463,7 @@ static const SiS310_LVDSDesStruct  SiS310_PanelType0b_2[]=  /* 640x480_2 */
 	{ 0,   0}
 };
 
-static const SiS310_LVDSDesStruct  SiS310_PanelType0c_2[]=  /* 640x480_3 */
+static const SiS_LVDSDesStruct  SiS310_PanelType0c_2[]=  /* 640x480_3 */
 {
 	{1152, 622},
 	{1152, 597},
@@ -2167,7 +1476,7 @@ static const SiS310_LVDSDesStruct  SiS310_PanelType0c_2[]=  /* 640x480_3 */
 	{ 0,   0}
 };
 
-static const SiS310_LVDSDesStruct  SiS310_PanelType0d_2[]=  
+static const SiS_LVDSDesStruct  SiS310_PanelType0d_2[]=
 {
 	{1152, 622},
 	{1152, 597},
@@ -2180,7 +1489,7 @@ static const SiS310_LVDSDesStruct  SiS310_PanelType0d_2[]=
 	{ 0,   0}
 };
 
-static const SiS310_LVDSDesStruct  SiS310_PanelType0e_2[]=
+static const SiS_LVDSDesStruct  SiS310_PanelType0e_2[]=
 {
 	{1152, 622},
 	{1152, 597},
@@ -2193,7 +1502,7 @@ static const SiS310_LVDSDesStruct  SiS310_PanelType0e_2[]=
 	{ 0,   0}
 };
 
-static const SiS310_LVDSDesStruct  SiS310_PanelType0f_2[] =
+static const SiS_LVDSDesStruct  SiS310_PanelType0f_2[] =
 {
 	{1152, 622},
 	{1152, 597},
@@ -2206,14 +1515,37 @@ static const SiS310_LVDSDesStruct  SiS310_PanelType0f_2[] =
 	{ 0,   0}
 };
 
-/* CRT1 CRTC for SlaveModes and LCDA */
+static const SiS_LVDSDesStruct  SiS310_PanelTypeNS_1[]=
+{
+	{ 8,   0},
+	{ 8,   0},
+	{ 8,   0},
+	{ 8,   0},
+	{ 8,   0},
+	{ 0,   0},
+	{ 0,   0},
+	{ 0,   0},
+	{ 0, 806},
+	{ 0,   0}
+};
 
-typedef struct _SiS310_LVDSCRT1DataStruct
+static const SiS_LVDSDesStruct  SiS310_PanelTypeNS_2[] =
 {
- 	UCHAR CR[15];
-} SiS310_LVDSCRT1DataStruct;
+	{ 0 , 0},
+	{ 0 , 0},
+	{ 0 , 0},
+	{ 0 , 0},
+	{ 0 , 0},
+	{ 0 , 0},
+	{ 0 , 0},
+	{ 0 , 0},
+	{ 0 , 0},
+	{ 0 , 0}
+};
+
+/* CRT1 CRTC for SlaveModes and LCDA */
 
-static const SiS310_LVDSCRT1DataStruct  SiS310_LVDSCRT1800x600_1[] =
+static const SiS_LVDSCRT1DataStruct  SiS310_LVDSCRT1800x600_1[] =
 {
  {{0x6b,0x4f,0x8f,0x55,0x85,0xaa,0x1f,
    0x90,0x85,0x8f,0xab,0x30,0x00,0x05,
@@ -2235,7 +1567,7 @@ static const SiS310_LVDSCRT1DataStruct  SiS310_LVDSCRT1800x600_1[] =
    0x01 }}
 };
 
-static const SiS310_LVDSCRT1DataStruct  SiS310_LVDSCRT1800x600_1_H[] =
+static const SiS_LVDSCRT1DataStruct  SiS310_LVDSCRT1800x600_1_H[] =
 {
  {{0x43,0x27,0x87,0x2d,0x1d,0xaa,0x1f,
    0x90,0x85,0x8f,0xab,0x30,0x00,0x05,
@@ -2257,7 +1589,7 @@ static const SiS310_LVDSCRT1DataStruct  SiS310_LVDSCRT1800x600_1_H[] =
    0x01 }}
 };
 
-static const SiS310_LVDSCRT1DataStruct  SiS310_LVDSCRT1800x600_2[]=
+static const SiS_LVDSCRT1DataStruct  SiS310_LVDSCRT1800x600_2[]=
 {
  {{0x7f,0x4f,0x83,0x62,0x12,0x72,0x3e,
    0xff,0x84,0x8f,0x73,0x00,0x00,0x06,
@@ -2279,7 +1611,7 @@ static const SiS310_LVDSCRT1DataStruct  SiS310_LVDSCRT1800x600_2[]=
    0x01 }}
 };
 
-static const SiS310_LVDSCRT1DataStruct  SiS310_LVDSCRT1800x600_2_H[] =
+static const SiS_LVDSCRT1DataStruct  SiS310_LVDSCRT1800x600_2_H[] =
 {
  {{0x57,0x27,0x9b,0x3a,0x0a,0x72,0x3e,
    0xff,0x84,0x8f,0x73,0x00,0x00,0x01,
@@ -2301,7 +1633,7 @@ static const SiS310_LVDSCRT1DataStruct  SiS310_LVDSCRT1800x600_2_H[] =
    0x01 }}
 };
 
-static const SiS310_LVDSCRT1DataStruct  SiS310_LVDSCRT11024x768_1[] =
+static const SiS_LVDSCRT1DataStruct  SiS310_LVDSCRT11024x768_1[] =
 {
  {{0x73,0x4f,0x97,0x53,0x84,0xb4,0x1f,
    0x92,0x89,0x8f,0xb5,0x30,0x00,0x05,
@@ -2326,7 +1658,7 @@ static const SiS310_LVDSCRT1DataStruct  SiS310_LVDSCRT11024x768_1[] =
    0x01}}
 };
 
-static const SiS310_LVDSCRT1DataStruct  SiS310_LVDSCRT11024x768_1_H[] =
+static const SiS_LVDSCRT1DataStruct  SiS310_LVDSCRT11024x768_1_H[] =
 {
  {{0x4b,0x27,0x8f,0x2b,0x1c,0xb4,0x1f,
    0x92,0x89,0x8f,0xb5,0x30,0x00,0x05,
@@ -2351,7 +1683,7 @@ static const SiS310_LVDSCRT1DataStruct  SiS310_LVDSCRT11024x768_1_H[] =
    0x01 }}
 };
 
-static const SiS310_LVDSCRT1DataStruct  SiS310_LVDSCRT11024x768_2[] =
+static const SiS_LVDSCRT1DataStruct  SiS310_LVDSCRT11024x768_2[] =
 {
  {{0xa3,0x4f,0x87,0x6e,0x9f,0x24,0xbb,
    0x57,0x8e,0x8f,0x25,0x30,0x00,0x06,
@@ -2376,7 +1708,7 @@ static const SiS310_LVDSCRT1DataStruct  SiS310_LVDSCRT11024x768_2[] =
    0x01 }}
 };
 
-static const SiS310_LVDSCRT1DataStruct  SiS310_LVDSCRT11024x768_2_H[] =
+static const SiS_LVDSCRT1DataStruct  SiS310_LVDSCRT11024x768_2_H[] =
 {
  {{0x7b,0x27,0x9f,0x46,0x97,0x24,0xbb,
    0x57,0x8e,0x8f,0x25,0x30,0x00,0x01,
@@ -2401,7 +1733,7 @@ static const SiS310_LVDSCRT1DataStruct  SiS310_LVDSCRT11024x768_2_H[] =
    0x01 }}
 };
 
-static const SiS310_LVDSCRT1DataStruct  SiS310_LVDSCRT11280x1024_1[] =
+static const SiS_LVDSCRT1DataStruct  SiS310_LVDSCRT11280x1024_1[] =
 {
  {{0x7e,0x4f,0x82,0x58,0x04,0xb8,0x1f,
    0x90,0x84,0x8f,0xb9,0x30,0x00,0x06,
@@ -2429,7 +1761,7 @@ static const SiS310_LVDSCRT1DataStruct  SiS310_LVDSCRT11280x1024_1[] =
    0x01}}
 };
 
-static const SiS310_LVDSCRT1DataStruct  SiS310_LVDSCRT11280x1024_1_H[] =
+static const SiS_LVDSCRT1DataStruct  SiS310_LVDSCRT11280x1024_1_H[] =
 {
  {{0x56,0x27,0x9a,0x31,0x1c,0xb8,0x1f,
    0x90,0x84,0x8f,0xb9,0x30,0x00,0x05,
@@ -2454,7 +1786,7 @@ static const SiS310_LVDSCRT1DataStruct  SiS310_LVDSCRT11280x1024_1_H[] =
    0x01}}
 };
 
-static const SiS310_LVDSCRT1DataStruct  SiS310_LVDSCRT11280x1024_2[] =  
+static const SiS_LVDSCRT1DataStruct  SiS310_LVDSCRT11280x1024_2[] =
 {
  {{0xce,0x72,0x91,0x81,0x8f,0x28,0x92,
    0xc8,0x8c,0x5d,0x5c,0x01,0x00,0x02,
@@ -2482,7 +1814,7 @@ static const SiS310_LVDSCRT1DataStruct  SiS310_LVDSCRT11280x1024_2[] =
    0x01}}
 };
 
-static const SiS310_LVDSCRT1DataStruct  SiS310_LVDSCRT11280x1024_2_H[] = 
+static const SiS_LVDSCRT1DataStruct  SiS310_LVDSCRT11280x1024_2_H[] =
 {
  {{0xa6,0x4a,0x89,0x59,0x07,0x28,0x92,
    0xc8,0x8c,0x5d,0x5c,0x01,0x00,0x06,
@@ -2507,7 +1839,7 @@ static const SiS310_LVDSCRT1DataStruct  SiS310_LVDSCRT11280x1024_2_H[] =
    0x01}}
 };
 
-static const SiS310_LVDSCRT1DataStruct  SiS310_LVDSCRT11400x1050_1[] =
+static const SiS_LVDSCRT1DataStruct  SiS310_LVDSCRT11400x1050_1[] =
 {
   {{0x6f,0x4f,0x93,0x54,0x82,0x9e,0x1f,
     0x8f,0x81,0x8f,0x9f,0x30,0x00,0x05,
@@ -2567,7 +1899,7 @@ static const SiS310_LVDSCRT1DataStruct  SiS310_LVDSCRT11400x1050_1[] =
 #endif   
 };
 
-static const SiS310_LVDSCRT1DataStruct  SiS310_LVDSCRT11400x1050_1_H[] = 
+static const SiS_LVDSCRT1DataStruct  SiS310_LVDSCRT11400x1050_1_H[] =
 {
  {{0x47,0x27,0x8b,0x2c,0x1a,0x9e,0x1f,
    0x8f,0x81,0x8f,0x9f,0x30,0x00,0x05,
@@ -2627,7 +1959,7 @@ static const SiS310_LVDSCRT1DataStruct  SiS310_LVDSCRT11400x1050_1_H[] =
 #endif   
 };
 
-static const SiS310_LVDSCRT1DataStruct  SiS310_LVDSCRT11400x1050_2[] =  
+static const SiS_LVDSCRT1DataStruct  SiS310_LVDSCRT11400x1050_2[] =
 {
  {{0xce,0x72,0x91,0x84,0x92,0x28,0x92,
    0xd7,0x8b,0x5d,0x5c,0x21,0x00,0x02,
@@ -2687,7 +2019,7 @@ static const SiS310_LVDSCRT1DataStruct  SiS310_LVDSCRT11400x1050_2[] =
 #endif   
 };
 
-static const SiS310_LVDSCRT1DataStruct  SiS310_LVDSCRT11400x1050_2_H[] =  
+static const SiS_LVDSCRT1DataStruct  SiS310_LVDSCRT11400x1050_2_H[] =
 {
  {{0xa6,0x4a,0x89,0x5c,0x0a,0x28,0x92,
    0xd7,0x8b,0x5d,0x5c,0x21,0x00,0x06,
@@ -2747,7 +2079,7 @@ static const SiS310_LVDSCRT1DataStruct  SiS310_LVDSCRT11400x1050_2_H[] =
 #endif   
 };
 
-static const SiS310_LVDSCRT1DataStruct  SiS310_LVDSCRT11600x1200_1[] =
+static const SiS_LVDSCRT1DataStruct  SiS310_LVDSCRT11600x1200_1[] =
 {
  {{0x83,0x4F,0x87,0x5B,0x13,0x06,0x3E,
    0xB3,0x86,0x8F,0x07,0x20,0x00,0x06,
@@ -2813,7 +2145,7 @@ static const SiS310_LVDSCRT1DataStruct  SiS310_LVDSCRT11600x1200_1[] =
 #endif
 };
 
-static const SiS310_LVDSCRT1DataStruct  SiS310_LVDSCRT11600x1200_1_H[] =
+static const SiS_LVDSCRT1DataStruct  SiS310_LVDSCRT11600x1200_1_H[] =
 {
  {{0x5B,0x27,0x9F,0x33,0x0B,0x06,0x2E,
    0xB3,0x86,0x8F,0x07,0x20,0x00,0x01,
@@ -2879,7 +2211,7 @@ static const SiS310_LVDSCRT1DataStruct  SiS310_LVDSCRT11600x1200_1_H[] =
 #endif
 };
 
-static const SiS310_LVDSCRT1DataStruct  SiS310_LVDSCRT11600x1200_2[] =
+static const SiS_LVDSCRT1DataStruct  SiS310_LVDSCRT11600x1200_2[] =
 {
  {{0xFB,0x87,0x86,0x97,0x0F,0x26,0x97,
    0x43,0x86,0xDB,0xDA,0x11,0x00,0x07,
@@ -2945,7 +2277,7 @@ static const SiS310_LVDSCRT1DataStruct  SiS310_LVDSCRT11600x1200_2[] =
 #endif
 };
 
-static const SiS310_LVDSCRT1DataStruct  SiS310_LVDSCRT11600x1200_2_H[] = 
+static const SiS_LVDSCRT1DataStruct  SiS310_LVDSCRT11600x1200_2_H[] =
 {
  {{0xD3,0x5F,0x9E,0x6F,0x07,0x26,0x97,
    0x43,0x86,0xDB,0xDA,0x11,0x00,0x02,
@@ -3011,9 +2343,66 @@ static const SiS310_LVDSCRT1DataStruct  SiS310_LVDSCRT11600x1200_2_H[] =
 #endif
 };
 
+static const SiS_LVDSCRT1DataStruct  SiS310_LVDSCRT1XXXxXXX_1[] =
+{
+ {{0x5f,0x4f,0x82,0x55,0x81,0xbf,0x1f,
+   0x9c,0x8e,0x96,0xb9,0x30,0x00,0x05,
+   0x00}},
+ {{0x5f,0x4f,0x82,0x55,0x81,0xbf,0x1f,
+   0x9c,0x8e,0x96,0xb9,0x30,0x00,0x05,
+   0x00}},
+ {{0x5f,0x4f,0x82,0x55,0x81,0xbf,0x1f,
+   0x9c,0x8e,0x96,0xb9,0x30,0x00,0x05,
+   0x00}},
+ {{0x5f,0x4f,0x82,0x55,0x81,0xbf,0x1f,
+   0x9c,0x8e,0x96,0xb9,0x30,0x00,0x05,
+   0x00}},
+ {{0x5f,0x4f,0x82,0x55,0x81,0x0b,0x3e,
+   0xe9,0x8b,0xe7,0x04,0x00,0x00,0x05,
+   0x00}},
+ {{0x7f,0x63,0x83,0x6c,0x1c,0x72,0xf0,
+   0x58,0x8c,0x57,0x73,0x20,0x00,0x06,
+   0x01}},
+ {{0xa3,0x7f,0x87,0x86,0x97,0x24,0xf5,
+   0x02,0x88,0xff,0x25,0x10,0x00,0x02,
+   0x01}},
+ {{0xce,0x9f,0x92,0xa8,0x14,0x28,0x5a,
+   0x00,0x84,0xff,0x29,0x09,0x00,0x07,
+   0x01}},
+ {{0xce,0x9f,0x92,0xa9,0x17,0x24,0xf5,
+   0x02,0x88,0xff,0x25,0x10,0x00,0x07,
+   0x01}}
+};
+
+static const SiS_LVDSCRT1DataStruct  SiS310_LVDSCRT1XXXxXXX_1_H[] =
+{
+ {{0x38,0x27,0x9c,0x2c,0x80,0xbf,0x1f,
+   0x9c,0x8e,0x96,0xb9,0x30,0x00,0x00,
+   0x00}},
+ {{0x38,0x27,0x9c,0x2c,0x80,0xbf,0x1f,
+   0x9c,0x8e,0x96,0xb9,0x30,0x00,0x00,
+   0x00}},
+ {{0x38,0x27,0x9c,0x2c,0x80,0xbf,0x1f,
+   0x9c,0x8e,0x96,0xb9,0x30,0x00,0x00,
+   0x00}},
+ {{0x38,0x27,0x9c,0x2c,0x80,0xbf,0x1f,
+   0x9c,0x8e,0x96,0xb9,0x30,0x00,0x00,
+   0x00}},
+ {{0x38,0x27,0x9c,0x2c,0x80,0x0b,0x3e,
+   0xe9,0x8b,0xe7,0x04,0x00,0x00,0x00,
+   0x00}},
+ {{0x4d,0x31,0x91,0x3b,0x03,0x72,0xf0,
+   0x58,0x8c,0x57,0x73,0x20,0x00,0x01,
+   0x01}},
+ {{0x63,0x3f,0x87,0x4a,0x92,0x24,0xf5,
+   0x02,0x88,0xff,0x25,0x10,0x00,0x01,
+   0x01}}
+};
+
+
 /* CRT1 CRTC for Chrontel TV slave modes */
 
-static const SiS310_LVDSCRT1DataStruct  SiS310_CHTVCRT1UNTSC[] =  
+static const SiS_LVDSCRT1DataStruct  SiS310_CHTVCRT1UNTSC[] =
 { 
  {{0x64,0x4f,0x88,0x56,0x9f,0x56,0x3e,
    0xe8,0x84,0x8f,0x57,0x20,0x00,0x01,
@@ -3038,7 +2427,7 @@ static const SiS310_LVDSCRT1DataStruct  SiS310_CHTVCRT1UNTSC[] =
    0x01}}
 };
 
-static const SiS310_LVDSCRT1DataStruct  SiS310_CHTVCRT1ONTSC[] =
+static const SiS_LVDSCRT1DataStruct  SiS310_CHTVCRT1ONTSC[] =
 {
  {{0x63,0x4f,0x87,0x5a,0x9f,0x0b,0x3e,
    0xc0,0x84,0x8f,0x0c,0x20,0x00,0x01,
@@ -3063,7 +2452,7 @@ static const SiS310_LVDSCRT1DataStruct  SiS310_CHTVCRT1ONTSC[] =
    0x01 }}
 };
 
-static const SiS310_LVDSCRT1DataStruct  SiS310_CHTVCRT1UPAL[] =    
+static const SiS_LVDSCRT1DataStruct  SiS310_CHTVCRT1UPAL[] =
 { 
  {{0x79,0x4f,0x9d,0x5a,0x90,0x6f,0x3e,
    0xf8,0x83,0x8f,0x70,0x20,0x00,0x05,
@@ -3088,7 +2477,7 @@ static const SiS310_LVDSCRT1DataStruct  SiS310_CHTVCRT1UPAL[] =
    0x01}}
 };
 
-static const SiS310_LVDSCRT1DataStruct  SiS310_CHTVCRT1OPAL[] =
+static const SiS_LVDSCRT1DataStruct  SiS310_CHTVCRT1OPAL[] =
 {
  {{0x79,0x4f,0x9d,0x5a,0x90,0x6f,0x3e,
    0xf0,0x83,0x8f,0x70,0x20,0x00,0x05,
@@ -3113,12 +2502,8 @@ static const SiS310_LVDSCRT1DataStruct  SiS310_CHTVCRT1OPAL[] =
    0x01 }}
 };
 
-typedef struct _SiS310_CHTVRegDataStruct
-{
- 	UCHAR Reg[16];
-} SiS310_CHTVRegDataStruct;
 
-static const SiS310_CHTVRegDataStruct SiS310_CHTVReg_UNTSC[] =
+static const SiS_CHTVRegDataStruct SiS310_CHTVReg_UNTSC[] =
 {
  {{0x4a,0x77,0xbb,0x94,0x84,0x48,0xfe,0x50,0x04,0x00,0x80,0x00,0x00,0x00,0x00,0x01}},
  {{0x4a,0x77,0xbb,0x94,0x84,0x48,0xfe,0x50,0x04,0x00,0x80,0x00,0x00,0x00,0x00,0x01}},
@@ -3138,7 +2523,7 @@ static const SiS310_CHTVRegDataStruct SiS310_CHTVReg_UNTSC[] =
       for PAL-M and PAL-N all above is corrected.
     */
 
-static const SiS310_CHTVRegDataStruct SiS310_CHTVReg_ONTSC[] =
+static const SiS_CHTVRegDataStruct SiS310_CHTVReg_ONTSC[] =
 {
  {{0x49,0x77,0xbb,0x7b,0x84,0x34,0x00,0x50,0x04,0x00,0x80,0x00,0x00,0x00,0x00,0x01}},
  {{0x49,0x77,0xbb,0x7b,0x84,0x34,0x00,0x50,0x04,0x00,0x80,0x00,0x00,0x00,0x00,0x01}},
@@ -3149,7 +2534,7 @@ static const SiS310_CHTVRegDataStruct SiS310_CHTVReg_ONTSC[] =
  {{0xed,0x77,0xbb,0x66,0x8c,0x21,0x02,0x5a,0x04,0x00,0x80,0x1f,0x9f,0xc1,0x0c,0x00}}
 };
 
-static const SiS310_CHTVRegDataStruct SiS310_CHTVReg_UPAL[] =
+static const SiS_CHTVRegDataStruct SiS310_CHTVReg_UPAL[] =
 {
  {{0x41,0x7f,0xb7,0x34,0xad,0x50,0x34,0x83,0x05,0x00,0x80,0x00,0x00,0x00,0x00,0x01}},
  {{0x41,0x7f,0xb7,0x80,0x85,0x50,0x00,0x83,0x05,0x00,0x80,0x00,0x00,0x00,0x00,0x01}},
@@ -3160,7 +2545,7 @@ static const SiS310_CHTVRegDataStruct SiS310_CHTVReg_UPAL[] =
  {{0xe5,0x7f,0xb7,0x1d,0xa7,0x3e,0x04,0x5a,0x05,0x00,0x80,0x20,0x3e,0xe4,0x22,0x00}}
 };
 
-static const SiS310_CHTVRegDataStruct SiS310_CHTVReg_OPAL[] =
+static const SiS_CHTVRegDataStruct SiS310_CHTVReg_OPAL[] =
 {
  {{0x41,0x7f,0xb7,0x36,0xad,0x50,0x34,0x83,0x05,0x00,0x80,0x00,0x00,0x00,0x00,0x01}},
  {{0x41,0x7f,0xb7,0x86,0x85,0x50,0x00,0x83,0x05,0x00,0x80,0x00,0x00,0x00,0x00,0x01}},
@@ -3171,7 +2556,7 @@ static const SiS310_CHTVRegDataStruct SiS310_CHTVReg_OPAL[] =
  {{0xe4,0x7f,0xb7,0x1e,0xaf,0x29,0x37,0x5a,0x05,0x00,0x80,0x25,0x8c,0xb2,0x2a,0x00}}
 };
 
-static const SiS310_CHTVRegDataStruct SiS310_CHTVReg_UPALM[] =
+static const SiS_CHTVRegDataStruct SiS310_CHTVReg_UPALM[] =
 {
  {{0x52,0x77,0xbb,0x94,0x84,0x48,0xfe,0x83,0x04,0x00,0x80,0x00,0x00,0x00,0x00,0x01}},
  {{0x52,0x77,0xbb,0x94,0x84,0x48,0xfe,0x83,0x04,0x00,0x80,0x00,0x00,0x00,0x00,0x01}},
@@ -3187,7 +2572,7 @@ static const SiS310_CHTVRegDataStruct SiS310_CHTVReg_UPALM[] =
 #endif
 };
 
-static const SiS310_CHTVRegDataStruct SiS310_CHTVReg_OPALM[] =
+static const SiS_CHTVRegDataStruct SiS310_CHTVReg_OPALM[] =
 {
  {{0x51,0x77,0xbb,0x7b,0x84,0x34,0x00,0x83,0x04,0x00,0x80,0x00,0x00,0x00,0x00,0x01}},
  {{0x51,0x77,0xbb,0x7b,0x84,0x34,0x00,0x83,0x04,0x00,0x80,0x00,0x00,0x00,0x00,0x01}},
@@ -3203,7 +2588,7 @@ static const SiS310_CHTVRegDataStruct SiS310_CHTVReg_OPALM[] =
 #endif
 };
 
-static const SiS310_CHTVRegDataStruct SiS310_CHTVReg_UPALN[] =
+static const SiS_CHTVRegDataStruct SiS310_CHTVReg_UPALN[] =
 {
  {{0x41,0x7f,0xb7,0x34,0xad,0x50,0x34,0x6e,0x05,0x00,0x80,0x00,0x00,0x00,0x00,0x03}},
  {{0x41,0x7f,0xb7,0x80,0x85,0x50,0x00,0x6e,0x05,0x00,0x80,0x00,0x00,0x00,0x00,0x03}},
@@ -3219,7 +2604,7 @@ static const SiS310_CHTVRegDataStruct SiS310_CHTVReg_UPALN[] =
 #endif
 };
 
-static const SiS310_CHTVRegDataStruct SiS310_CHTVReg_OPALN[] =
+static const SiS_CHTVRegDataStruct SiS310_CHTVReg_OPALN[] =
 {
  {{0x41,0x7f,0xb7,0x36,0xad,0x50,0x34,0x6e,0x05,0x00,0x80,0x00,0x00,0x00,0x00,0x03}},
  {{0x41,0x7f,0xb7,0x86,0x85,0x50,0x00,0x6e,0x05,0x00,0x80,0x00,0x00,0x00,0x00,0x03}},
diff --git a/drivers/video/sis/init.c b/drivers/video/sis/init.c
index 032baf709..b8da052e4 100644
--- a/drivers/video/sis/init.c
+++ b/drivers/video/sis/init.c
@@ -1,8 +1,9 @@
 /* $XFree86$ */
+/* $XdotOrg$ */
 /*
  * Mode initializing code (CRT1 section) for
  * for SiS 300/305/540/630/730 and
- *     SiS 315/550/650/M650/651/661FX/M661FX/740/741/M741/330/660/M660/760/M760
+ *     SiS 315/550/650/M650/651/661FX/M661FX/740/741(GX)/M741/330/660/M660/760/M760
  * (Universal module for Linux kernel framebuffer and XFree86 4.x)
  *
  * Copyright (C) 2001-2004 by Thomas Winischhofer, Vienna, Austria
@@ -34,13 +35,10 @@
  * * 2) Redistributions in binary form must reproduce the above copyright
  * *    notice, this list of conditions and the following disclaimer in the
  * *    documentation and/or other materials provided with the distribution.
- * * 3) All advertising materials mentioning features or use of this software
- * *    must display the following acknowledgement: "This product includes
- * *    software developed by Thomas Winischhofer, Vienna, Austria."
- * * 4) The name of the author may not be used to endorse or promote products
+ * * 3) The name of the author may not be used to endorse or promote products
  * *    derived from this software without specific prior written permission.
  * *
- * * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR
+ * * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESSED 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,
@@ -78,13 +76,13 @@
 
 #if defined(ALLOC_PRAGMA)
 #pragma alloc_text(PAGE,SiSSetMode)
-#pragma alloc_text(PAGE,SiSInit)
 #endif
 
 /*********************************************/
 /*         POINTER INITIALIZATION            */
 /*********************************************/
 
+#if defined(SIS300) || defined(SIS315H)
 static void
 InitCommonPointer(SiS_Private *SiS_Pr, PSIS_HW_INFO HwInfo)
 {
@@ -134,16 +132,17 @@ InitCommonPointer(SiS_Private *SiS_Pr, PSIS_HW_INFO HwInfo)
    SiS_Pr->pSiS_OutputSelect = &SiS_OutputSelect;
    SiS_Pr->pSiS_SoftSetting  = &SiS_SoftSetting;
 
+   SiS_Pr->SiS_LCD1280x720Data      = SiS_LCD1280x720Data;
+   SiS_Pr->SiS_StLCD1280x768_2Data  = SiS_StLCD1280x768_2Data;
+   SiS_Pr->SiS_ExtLCD1280x768_2Data = SiS_ExtLCD1280x768_2Data;
+   SiS_Pr->SiS_LCD1280x768_3Data    = SiS_LCD1280x768_3Data;
+   SiS_Pr->SiS_LCD1280x800Data      = SiS_LCD1280x800Data;
    SiS_Pr->SiS_LCD1280x960Data      = SiS_LCD1280x960Data;
-   SiS_Pr->SiS_ExtLCD1400x1050Data  = SiS_ExtLCD1400x1050Data;
-   SiS_Pr->SiS_ExtLCD1600x1200Data  = SiS_ExtLCD1600x1200Data;
    SiS_Pr->SiS_StLCD1400x1050Data   = SiS_StLCD1400x1050Data;
+   SiS_Pr->SiS_ExtLCD1400x1050Data  = SiS_ExtLCD1400x1050Data;
+   SiS_Pr->SiS_LCD1680x1050Data     = SiS_LCD1680x1050Data;
    SiS_Pr->SiS_StLCD1600x1200Data   = SiS_StLCD1600x1200Data;
-   SiS_Pr->SiS_NoScaleData1400x1050 = SiS_NoScaleData1400x1050;
-   SiS_Pr->SiS_NoScaleData1600x1200 = SiS_NoScaleData1600x1200;
-   SiS_Pr->SiS_ExtLCD1280x768Data   = SiS_ExtLCD1280x768Data;
-   SiS_Pr->SiS_StLCD1280x768Data    = SiS_StLCD1280x768Data;
-   SiS_Pr->SiS_NoScaleData1280x768  = SiS_NoScaleData1280x768;
+   SiS_Pr->SiS_ExtLCD1600x1200Data  = SiS_ExtLCD1600x1200Data;
    SiS_Pr->SiS_NoScaleData          = SiS_NoScaleData;
 
    SiS_Pr->SiS_LVDS320x480Data_1   = SiS_LVDS320x480Data_1;
@@ -172,41 +171,12 @@ InitCommonPointer(SiS_Private *SiS_Pr, PSIS_HW_INFO HwInfo)
    SiS_Pr->SiS_LVDS640x480Data_1   = SiS_LVDS640x480Data_1;
    SiS_Pr->SiS_LVDS640x480Data_2   = SiS_LVDS640x480Data_2;
 
-   SiS_Pr->SiS_LVDSBARCO1366Data_1 = SiS_LVDSBARCO1366Data_1;
-   SiS_Pr->SiS_LVDSBARCO1366Data_2 = SiS_LVDSBARCO1366Data_2;
-   SiS_Pr->SiS_LVDSBARCO1024Data_1 = SiS_LVDSBARCO1024Data_1;
-   SiS_Pr->SiS_LVDSBARCO1024Data_2 = SiS_LVDSBARCO1024Data_2;
    SiS_Pr->SiS_LVDS848x480Data_1   = SiS_LVDS848x480Data_1;
    SiS_Pr->SiS_LVDS848x480Data_2   = SiS_LVDS848x480Data_2;
-
-   SiS_Pr->SiS_CHTVUNTSCData = SiS_CHTVUNTSCData;
-   SiS_Pr->SiS_CHTVONTSCData = SiS_CHTVONTSCData;
-
-   SiS_Pr->SiS_LCDA1024x768Data_1  = SiS_LCDA1024x768Data_1;
-   SiS_Pr->SiS_LCDA1024x768Data_2  = SiS_LCDA1024x768Data_2;
-   SiS_Pr->SiS_LCDA1280x1024Data_1 = SiS_LCDA1280x1024Data_1;
-   SiS_Pr->SiS_LCDA1280x1024Data_2 = SiS_LCDA1280x1024Data_2;
-   SiS_Pr->SiS_LCDA1400x1050Data_1 = SiS_LCDA1400x1050Data_1;
-   SiS_Pr->SiS_LCDA1400x1050Data_2 = SiS_LCDA1400x1050Data_2;
-   SiS_Pr->SiS_LCDA1600x1200Data_1 = SiS_LCDA1600x1200Data_1;
-   SiS_Pr->SiS_LCDA1600x1200Data_2 = SiS_LCDA1600x1200Data_2;
-
-   SiS_Pr->LVDS1024x768Des_1  = SiS_PanelType1076_1;
-   SiS_Pr->LVDS1280x1024Des_1 = SiS_PanelType1210_1;
-   SiS_Pr->LVDS1400x1050Des_1 = SiS_PanelType1296_1;
-   SiS_Pr->LVDS1600x1200Des_1 = SiS_PanelType1600_1;
-   SiS_Pr->LVDS1024x768Des_2  = SiS_PanelType1076_2;
-   SiS_Pr->LVDS1280x1024Des_2 = SiS_PanelType1210_2;
-   SiS_Pr->LVDS1400x1050Des_2 = SiS_PanelType1296_2;
-   SiS_Pr->LVDS1600x1200Des_2 = SiS_PanelType1600_2;
-
-   SiS_Pr->SiS_PanelTypeNS_1 = SiS_PanelTypeNS_1;
-   SiS_Pr->SiS_PanelTypeNS_2 = SiS_PanelTypeNS_2;
-
-   SiS_Pr->SiS_CHTVUNTSCDesData = SiS_CHTVUNTSCDesData;
-   SiS_Pr->SiS_CHTVONTSCDesData = SiS_CHTVONTSCDesData;
-   SiS_Pr->SiS_CHTVUPALDesData  = SiS_CHTVUPALDesData;
-   SiS_Pr->SiS_CHTVOPALDesData  = SiS_CHTVOPALDesData;
+   SiS_Pr->SiS_LVDSBARCO1024Data_1 = SiS_LVDSBARCO1024Data_1;
+   SiS_Pr->SiS_LVDSBARCO1024Data_2 = SiS_LVDSBARCO1024Data_2;
+   SiS_Pr->SiS_LVDSBARCO1366Data_1 = SiS_LVDSBARCO1366Data_1;
+   SiS_Pr->SiS_LVDSBARCO1366Data_2 = SiS_LVDSBARCO1366Data_2;
 
    SiS_Pr->SiS_LVDSCRT11280x768_1    = SiS_LVDSCRT11280x768_1;
    SiS_Pr->SiS_LVDSCRT11024x600_1    = SiS_LVDSCRT11024x600_1;
@@ -221,15 +191,25 @@ InitCommonPointer(SiS_Private *SiS_Pr, PSIS_HW_INFO HwInfo)
    SiS_Pr->SiS_LVDSCRT11024x600_2_H  = SiS_LVDSCRT11024x600_2_H;
    SiS_Pr->SiS_LVDSCRT11152x768_2_H  = SiS_LVDSCRT11152x768_2_H;
    SiS_Pr->SiS_LVDSCRT1320x480_1     = SiS_LVDSCRT1320x480_1;
-   SiS_Pr->SiS_LVDSCRT1XXXxXXX_1     = SiS_LVDSCRT1XXXxXXX_1;
-   SiS_Pr->SiS_LVDSCRT1XXXxXXX_1_H   = SiS_LVDSCRT1XXXxXXX_1_H;
    SiS_Pr->SiS_LVDSCRT1640x480_1     = SiS_LVDSCRT1640x480_1;
    SiS_Pr->SiS_LVDSCRT1640x480_1_H   = SiS_LVDSCRT1640x480_1_H;
    SiS_Pr->SiS_LVDSCRT1640x480_2     = SiS_LVDSCRT1640x480_2;
    SiS_Pr->SiS_LVDSCRT1640x480_2_H   = SiS_LVDSCRT1640x480_2_H;
    SiS_Pr->SiS_LVDSCRT1640x480_3     = SiS_LVDSCRT1640x480_3;
    SiS_Pr->SiS_LVDSCRT1640x480_3_H   = SiS_LVDSCRT1640x480_3_H;
+
+   SiS_Pr->SiS_CHTVUNTSCData = SiS_CHTVUNTSCData;
+   SiS_Pr->SiS_CHTVONTSCData = SiS_CHTVONTSCData;
+
+   SiS_Pr->SiS_CHTVUNTSCDesData = SiS_CHTVUNTSCDesData;
+   SiS_Pr->SiS_CHTVONTSCDesData = SiS_CHTVONTSCDesData;
+   SiS_Pr->SiS_CHTVUPALDesData  = SiS_CHTVUPALDesData;
+   SiS_Pr->SiS_CHTVOPALDesData  = SiS_CHTVOPALDesData;
+
+   SiS_Pr->SiS_PanelMinLVDS   = Panel_800x600;    /* lowest value LVDS/LCDA */
+   SiS_Pr->SiS_PanelMin301    = Panel_1024x768;   /* lowest value 301 */
 }
+#endif
 
 #ifdef SIS300
 static void
@@ -265,19 +245,18 @@ InitTo300Pointer(SiS_Private *SiS_Pr, PSIS_HW_INFO HwInfo)
    SiS_StandTable[0x1c].CRTC[4] = 0x54;
    SiS_StandTable[0x1c].CRTC[5] = 0x80;
 
-   SiS_Pr->SiS_SModeIDTable  = (SiS_StStruct *)SiS300_SModeIDTable;
-   SiS_Pr->SiS_VBModeIDTable = (SiS_VBModeStruct *)SiS300_VBModeIDTable;
-   SiS_Pr->SiS_EModeIDTable  = (SiS_ExtStruct *)SiS300_EModeIDTable;
-   SiS_Pr->SiS_RefIndex      = (SiS_Ext2Struct *)SiS300_RefIndex;
-   SiS_Pr->SiS_CRT1Table     = (SiS_CRT1TableStruct *)SiS300_CRT1Table;
+   SiS_Pr->SiS_SModeIDTable  = SiS300_SModeIDTable;
+   SiS_Pr->SiS_VBModeIDTable = SiS300_VBModeIDTable;
+   SiS_Pr->SiS_EModeIDTable  = SiS300_EModeIDTable;
+   SiS_Pr->SiS_RefIndex      = SiS300_RefIndex;
+   SiS_Pr->SiS_CRT1Table     = SiS300_CRT1Table;
    if(HwInfo->jChipType == SIS_300) {
-      SiS_Pr->SiS_MCLKData_0    = (SiS_MCLKDataStruct *)SiS300_MCLKData_300; /* 300 */
+      SiS_Pr->SiS_MCLKData_0    = SiS300_MCLKData_300; /* 300 */
    } else {
-      SiS_Pr->SiS_MCLKData_0    = (SiS_MCLKDataStruct *)SiS300_MCLKData_630; /* 630, 730 */
+      SiS_Pr->SiS_MCLKData_0    = SiS300_MCLKData_630; /* 630, 730 */
    }
-   SiS_Pr->SiS_VCLKData      = (SiS_VCLKDataStruct *)SiS300_VCLKData;
+   SiS_Pr->SiS_VCLKData      = SiS300_VCLKData;
    SiS_Pr->SiS_VBVCLKData    = (SiS_VBVCLKDataStruct *)SiS300_VCLKData;
-   SiS_Pr->SiS_ScreenOffset  = SiS300_ScreenOffset;
 
    SiS_Pr->SiS_SR15  = SiS300_SR15;
 
@@ -306,97 +285,102 @@ InitTo300Pointer(SiS_Private *SiS_Pr, PSIS_HW_INFO HwInfo)
    SiS_Pr->pSiS_YCSenseData2    = &SiS300_YCSenseData2;
 #endif
 
-   SiS_Pr->SiS_StLCD1024x768Data    = (SiS_LCDDataStruct *)SiS300_StLCD1024x768Data;
-   SiS_Pr->SiS_ExtLCD1024x768Data   = (SiS_LCDDataStruct *)SiS300_ExtLCD1024x768Data;
-   SiS_Pr->SiS_St2LCD1024x768Data   = (SiS_LCDDataStruct *)SiS300_St2LCD1024x768Data;
-   SiS_Pr->SiS_StLCD1280x1024Data   = (SiS_LCDDataStruct *)SiS300_StLCD1280x1024Data;
-   SiS_Pr->SiS_ExtLCD1280x1024Data  = (SiS_LCDDataStruct *)SiS300_ExtLCD1280x1024Data;
-   SiS_Pr->SiS_St2LCD1280x1024Data  = (SiS_LCDDataStruct *)SiS300_St2LCD1280x1024Data;
-   SiS_Pr->SiS_NoScaleData1024x768  = (SiS_LCDDataStruct *)SiS300_NoScaleData1024x768;
-   SiS_Pr->SiS_NoScaleData1280x1024 = (SiS_LCDDataStruct *)SiS300_NoScaleData1280x1024;
-
-   SiS_Pr->SiS_PanelDelayTbl     = (SiS_PanelDelayTblStruct *)SiS300_PanelDelayTbl;
-   SiS_Pr->SiS_PanelDelayTblLVDS = (SiS_PanelDelayTblStruct *)SiS300_PanelDelayTbl;
-#if 0
-   SiS_Pr->SiS_PanelDelayTblLVDS = (SiS_PanelDelayTblStruct *)SiS300_PanelDelayTblLVDS;
-#endif
-
-   SiS_Pr->SiS_CHTVUPALData  = (SiS_LVDSDataStruct *)SiS300_CHTVUPALData;
-   SiS_Pr->SiS_CHTVOPALData  = (SiS_LVDSDataStruct *)SiS300_CHTVOPALData;
-   SiS_Pr->SiS_CHTVUPALMData = SiS_CHTVUNTSCData; 			   /* not supported on 300 series */
-   SiS_Pr->SiS_CHTVOPALMData = SiS_CHTVONTSCData; 			   /* not supported on 300 series */
-   SiS_Pr->SiS_CHTVUPALNData = (SiS_LVDSDataStruct *)SiS300_CHTVUPALData;  /* not supported on 300 series */
-   SiS_Pr->SiS_CHTVOPALNData = (SiS_LVDSDataStruct *)SiS300_CHTVOPALData;  /* not supported on 300 series */
-   SiS_Pr->SiS_CHTVSOPALData = (SiS_LVDSDataStruct *)SiS300_CHTVSOPALData;
-
-   SiS_Pr->SiS_PanelType00_1 = (SiS_LVDSDesStruct *)SiS300_PanelType00_1;
-   SiS_Pr->SiS_PanelType01_1 = (SiS_LVDSDesStruct *)SiS300_PanelType01_1;
-   SiS_Pr->SiS_PanelType02_1 = (SiS_LVDSDesStruct *)SiS300_PanelType02_1;
-   SiS_Pr->SiS_PanelType03_1 = (SiS_LVDSDesStruct *)SiS300_PanelType03_1;
-   SiS_Pr->SiS_PanelType04_1 = (SiS_LVDSDesStruct *)SiS300_PanelType04_1;
-   SiS_Pr->SiS_PanelType05_1 = (SiS_LVDSDesStruct *)SiS300_PanelType05_1;
-   SiS_Pr->SiS_PanelType06_1 = (SiS_LVDSDesStruct *)SiS300_PanelType06_1;
-   SiS_Pr->SiS_PanelType07_1 = (SiS_LVDSDesStruct *)SiS300_PanelType07_1;
-   SiS_Pr->SiS_PanelType08_1 = (SiS_LVDSDesStruct *)SiS300_PanelType08_1;
-   SiS_Pr->SiS_PanelType09_1 = (SiS_LVDSDesStruct *)SiS300_PanelType09_1;
-   SiS_Pr->SiS_PanelType0a_1 = (SiS_LVDSDesStruct *)SiS300_PanelType0a_1;
-   SiS_Pr->SiS_PanelType0b_1 = (SiS_LVDSDesStruct *)SiS300_PanelType0b_1;
-   SiS_Pr->SiS_PanelType0c_1 = (SiS_LVDSDesStruct *)SiS300_PanelType0c_1;
-   SiS_Pr->SiS_PanelType0d_1 = (SiS_LVDSDesStruct *)SiS300_PanelType0d_1;
-   SiS_Pr->SiS_PanelType0e_1 = (SiS_LVDSDesStruct *)SiS300_PanelType0e_1;
-   SiS_Pr->SiS_PanelType0f_1 = (SiS_LVDSDesStruct *)SiS300_PanelType0f_1;
-   SiS_Pr->SiS_PanelType00_2 = (SiS_LVDSDesStruct *)SiS300_PanelType00_2;
-   SiS_Pr->SiS_PanelType01_2 = (SiS_LVDSDesStruct *)SiS300_PanelType01_2;
-   SiS_Pr->SiS_PanelType02_2 = (SiS_LVDSDesStruct *)SiS300_PanelType02_2;
-   SiS_Pr->SiS_PanelType03_2 = (SiS_LVDSDesStruct *)SiS300_PanelType03_2;
-   SiS_Pr->SiS_PanelType04_2 = (SiS_LVDSDesStruct *)SiS300_PanelType04_2;
-   SiS_Pr->SiS_PanelType05_2 = (SiS_LVDSDesStruct *)SiS300_PanelType05_2;
-   SiS_Pr->SiS_PanelType06_2 = (SiS_LVDSDesStruct *)SiS300_PanelType06_2;
-   SiS_Pr->SiS_PanelType07_2 = (SiS_LVDSDesStruct *)SiS300_PanelType07_2;
-   SiS_Pr->SiS_PanelType08_2 = (SiS_LVDSDesStruct *)SiS300_PanelType08_2;
-   SiS_Pr->SiS_PanelType09_2 = (SiS_LVDSDesStruct *)SiS300_PanelType09_2;
-   SiS_Pr->SiS_PanelType0a_2 = (SiS_LVDSDesStruct *)SiS300_PanelType0a_2;
-   SiS_Pr->SiS_PanelType0b_2 = (SiS_LVDSDesStruct *)SiS300_PanelType0b_2;
-   SiS_Pr->SiS_PanelType0c_2 = (SiS_LVDSDesStruct *)SiS300_PanelType0c_2;
-   SiS_Pr->SiS_PanelType0d_2 = (SiS_LVDSDesStruct *)SiS300_PanelType0d_2;
-   SiS_Pr->SiS_PanelType0e_2 = (SiS_LVDSDesStruct *)SiS300_PanelType0e_2;
-   SiS_Pr->SiS_PanelType0f_2 = (SiS_LVDSDesStruct *)SiS300_PanelType0f_2;
+   SiS_Pr->SiS_PanelDelayTbl     = SiS300_PanelDelayTbl;
+   SiS_Pr->SiS_PanelDelayTblLVDS = SiS300_PanelDelayTbl;
+
+   SiS_Pr->SiS_ExtLCD1024x768Data   = SiS300_ExtLCD1024x768Data;
+   SiS_Pr->SiS_St2LCD1024x768Data   = SiS300_St2LCD1024x768Data;
+   SiS_Pr->SiS_ExtLCD1280x1024Data  = SiS300_ExtLCD1280x1024Data;
+   SiS_Pr->SiS_St2LCD1280x1024Data  = SiS300_St2LCD1280x1024Data;
+
+   SiS_Pr->SiS_CRT2Part2_1024x768_1  = SiS300_CRT2Part2_1024x768_1;
+   SiS_Pr->SiS_CRT2Part2_1280x1024_1 = SiS300_CRT2Part2_1280x1024_1;
+   SiS_Pr->SiS_CRT2Part2_1024x768_2  = SiS300_CRT2Part2_1024x768_2;
+   SiS_Pr->SiS_CRT2Part2_1280x1024_2 = SiS300_CRT2Part2_1280x1024_2;
+   SiS_Pr->SiS_CRT2Part2_1024x768_3  = SiS300_CRT2Part2_1024x768_3;
+   SiS_Pr->SiS_CRT2Part2_1280x1024_3 = SiS300_CRT2Part2_1280x1024_3;
+
+   SiS_Pr->SiS_CHTVUPALData  = SiS300_CHTVUPALData;
+   SiS_Pr->SiS_CHTVOPALData  = SiS300_CHTVOPALData;
+   SiS_Pr->SiS_CHTVUPALMData = SiS_CHTVUNTSCData;    /* not supported on 300 series */
+   SiS_Pr->SiS_CHTVOPALMData = SiS_CHTVONTSCData;    /* not supported on 300 series */
+   SiS_Pr->SiS_CHTVUPALNData = SiS300_CHTVUPALData;  /* not supported on 300 series */
+   SiS_Pr->SiS_CHTVOPALNData = SiS300_CHTVOPALData;  /* not supported on 300 series */
+   SiS_Pr->SiS_CHTVSOPALData = SiS300_CHTVSOPALData;
+
+   SiS_Pr->SiS_PanelType00_1 = SiS300_PanelType00_1;
+   SiS_Pr->SiS_PanelType01_1 = SiS300_PanelType01_1;
+   SiS_Pr->SiS_PanelType02_1 = SiS300_PanelType02_1;
+   SiS_Pr->SiS_PanelType03_1 = SiS300_PanelType03_1;
+   SiS_Pr->SiS_PanelType04_1 = SiS300_PanelType04_1;
+   SiS_Pr->SiS_PanelType05_1 = SiS300_PanelType05_1;
+   SiS_Pr->SiS_PanelType06_1 = SiS300_PanelType06_1;
+   SiS_Pr->SiS_PanelType07_1 = SiS300_PanelType07_1;
+   SiS_Pr->SiS_PanelType08_1 = SiS300_PanelType08_1;
+   SiS_Pr->SiS_PanelType09_1 = SiS300_PanelType09_1;
+   SiS_Pr->SiS_PanelType0a_1 = SiS300_PanelType0a_1;
+   SiS_Pr->SiS_PanelType0b_1 = SiS300_PanelType0b_1;
+   SiS_Pr->SiS_PanelType0c_1 = SiS300_PanelType0c_1;
+   SiS_Pr->SiS_PanelType0d_1 = SiS300_PanelType0d_1;
+   SiS_Pr->SiS_PanelType0e_1 = SiS300_PanelType0e_1;
+   SiS_Pr->SiS_PanelType0f_1 = SiS300_PanelType0f_1;
+   SiS_Pr->SiS_PanelType00_2 = SiS300_PanelType00_2;
+   SiS_Pr->SiS_PanelType01_2 = SiS300_PanelType01_2;
+   SiS_Pr->SiS_PanelType02_2 = SiS300_PanelType02_2;
+   SiS_Pr->SiS_PanelType03_2 = SiS300_PanelType03_2;
+   SiS_Pr->SiS_PanelType04_2 = SiS300_PanelType04_2;
+   SiS_Pr->SiS_PanelType05_2 = SiS300_PanelType05_2;
+   SiS_Pr->SiS_PanelType06_2 = SiS300_PanelType06_2;
+   SiS_Pr->SiS_PanelType07_2 = SiS300_PanelType07_2;
+   SiS_Pr->SiS_PanelType08_2 = SiS300_PanelType08_2;
+   SiS_Pr->SiS_PanelType09_2 = SiS300_PanelType09_2;
+   SiS_Pr->SiS_PanelType0a_2 = SiS300_PanelType0a_2;
+   SiS_Pr->SiS_PanelType0b_2 = SiS300_PanelType0b_2;
+   SiS_Pr->SiS_PanelType0c_2 = SiS300_PanelType0c_2;
+   SiS_Pr->SiS_PanelType0d_2 = SiS300_PanelType0d_2;
+   SiS_Pr->SiS_PanelType0e_2 = SiS300_PanelType0e_2;
+   SiS_Pr->SiS_PanelType0f_2 = SiS300_PanelType0f_2;
+   SiS_Pr->SiS_PanelTypeNS_1 = SiS300_PanelTypeNS_1;
+   SiS_Pr->SiS_PanelTypeNS_2 = SiS300_PanelTypeNS_2;
 
    if(SiS_Pr->SiS_CustomT == CUT_BARCO1366) {
-      SiS_Pr->SiS_PanelType04_1 = (SiS_LVDSDesStruct *)SiS300_PanelType04_1a;
-      SiS_Pr->SiS_PanelType04_2 = (SiS_LVDSDesStruct *)SiS300_PanelType04_2a;
+      SiS_Pr->SiS_PanelType04_1 = SiS300_PanelType04_1a;
+      SiS_Pr->SiS_PanelType04_2 = SiS300_PanelType04_2a;
    }
    if(SiS_Pr->SiS_CustomT == CUT_BARCO1024) {
-      SiS_Pr->SiS_PanelType04_1 = (SiS_LVDSDesStruct *)SiS300_PanelType04_1b;
-      SiS_Pr->SiS_PanelType04_2 = (SiS_LVDSDesStruct *)SiS300_PanelType04_2b;
+      SiS_Pr->SiS_PanelType04_1 = SiS300_PanelType04_1b;
+      SiS_Pr->SiS_PanelType04_2 = SiS300_PanelType04_2b;
    }
 
-   SiS_Pr->SiS_LVDSCRT1800x600_1     = (SiS_LVDSCRT1DataStruct *)SiS300_LVDSCRT1800x600_1;
-   SiS_Pr->SiS_LVDSCRT11024x768_1    = (SiS_LVDSCRT1DataStruct *)SiS300_LVDSCRT11024x768_1;
-   SiS_Pr->SiS_LVDSCRT11280x1024_1   = (SiS_LVDSCRT1DataStruct *)SiS300_LVDSCRT11280x1024_1;
-   SiS_Pr->SiS_LVDSCRT1800x600_1_H   = (SiS_LVDSCRT1DataStruct *)SiS300_LVDSCRT1800x600_1_H;
-   SiS_Pr->SiS_LVDSCRT11024x768_1_H  = (SiS_LVDSCRT1DataStruct *)SiS300_LVDSCRT11024x768_1_H;
-   SiS_Pr->SiS_LVDSCRT11280x1024_1_H = (SiS_LVDSCRT1DataStruct *)SiS300_LVDSCRT11280x1024_1_H;
-   SiS_Pr->SiS_LVDSCRT1800x600_2     = (SiS_LVDSCRT1DataStruct *)SiS300_LVDSCRT1800x600_2;
-   SiS_Pr->SiS_LVDSCRT11024x768_2    = (SiS_LVDSCRT1DataStruct *)SiS300_LVDSCRT11024x768_2;
-   SiS_Pr->SiS_LVDSCRT11280x1024_2   = (SiS_LVDSCRT1DataStruct *)SiS300_LVDSCRT11280x1024_2;
-   SiS_Pr->SiS_LVDSCRT1800x600_2_H   = (SiS_LVDSCRT1DataStruct *)SiS300_LVDSCRT1800x600_2_H;
-   SiS_Pr->SiS_LVDSCRT11024x768_2_H  = (SiS_LVDSCRT1DataStruct *)SiS300_LVDSCRT11024x768_2_H;
-   SiS_Pr->SiS_LVDSCRT11280x1024_2_H = (SiS_LVDSCRT1DataStruct *)SiS300_LVDSCRT11280x1024_2_H;
-   SiS_Pr->SiS_CHTVCRT1UNTSC = (SiS_LVDSCRT1DataStruct *)SiS300_CHTVCRT1UNTSC;
-   SiS_Pr->SiS_CHTVCRT1ONTSC = (SiS_LVDSCRT1DataStruct *)SiS300_CHTVCRT1ONTSC;
-   SiS_Pr->SiS_CHTVCRT1UPAL  = (SiS_LVDSCRT1DataStruct *)SiS300_CHTVCRT1UPAL;
-   SiS_Pr->SiS_CHTVCRT1OPAL  = (SiS_LVDSCRT1DataStruct *)SiS300_CHTVCRT1OPAL;
-   SiS_Pr->SiS_CHTVCRT1SOPAL = (SiS_LVDSCRT1DataStruct *)SiS300_CHTVCRT1SOPAL;
-   SiS_Pr->SiS_CHTVReg_UNTSC = (SiS_CHTVRegDataStruct *)SiS300_CHTVReg_UNTSC;
-   SiS_Pr->SiS_CHTVReg_ONTSC = (SiS_CHTVRegDataStruct *)SiS300_CHTVReg_ONTSC;
-   SiS_Pr->SiS_CHTVReg_UPAL  = (SiS_CHTVRegDataStruct *)SiS300_CHTVReg_UPAL;
-   SiS_Pr->SiS_CHTVReg_OPAL  = (SiS_CHTVRegDataStruct *)SiS300_CHTVReg_OPAL;
-   SiS_Pr->SiS_CHTVReg_UPALM = (SiS_CHTVRegDataStruct *)SiS300_CHTVReg_UNTSC;  /* not supported on 300 series */
-   SiS_Pr->SiS_CHTVReg_OPALM = (SiS_CHTVRegDataStruct *)SiS300_CHTVReg_ONTSC;  /* not supported on 300 series */
-   SiS_Pr->SiS_CHTVReg_UPALN = (SiS_CHTVRegDataStruct *)SiS300_CHTVReg_UPAL;   /* not supported on 300 series */
-   SiS_Pr->SiS_CHTVReg_OPALN = (SiS_CHTVRegDataStruct *)SiS300_CHTVReg_OPAL;   /* not supported on 300 series */
-   SiS_Pr->SiS_CHTVReg_SOPAL = (SiS_CHTVRegDataStruct *)SiS300_CHTVReg_SOPAL;
+   SiS_Pr->SiS_LVDSCRT1800x600_1     = SiS300_LVDSCRT1800x600_1;
+   SiS_Pr->SiS_LVDSCRT1800x600_1_H   = SiS300_LVDSCRT1800x600_1_H;
+   SiS_Pr->SiS_LVDSCRT1800x600_2     = SiS300_LVDSCRT1800x600_2;
+   SiS_Pr->SiS_LVDSCRT1800x600_2_H   = SiS300_LVDSCRT1800x600_2_H;
+   SiS_Pr->SiS_LVDSCRT11024x768_1    = SiS300_LVDSCRT11024x768_1;
+   SiS_Pr->SiS_LVDSCRT11024x768_1_H  = SiS300_LVDSCRT11024x768_1_H;
+   SiS_Pr->SiS_LVDSCRT11024x768_2    = SiS300_LVDSCRT11024x768_2;
+   SiS_Pr->SiS_LVDSCRT11024x768_2_H  = SiS300_LVDSCRT11024x768_2_H;
+   SiS_Pr->SiS_LVDSCRT11280x1024_1   = SiS300_LVDSCRT11280x1024_1;
+   SiS_Pr->SiS_LVDSCRT11280x1024_1_H = SiS300_LVDSCRT11280x1024_1_H;
+   SiS_Pr->SiS_LVDSCRT11280x1024_2   = SiS300_LVDSCRT11280x1024_2;
+   SiS_Pr->SiS_LVDSCRT11280x1024_2_H = SiS300_LVDSCRT11280x1024_2_H;
+   SiS_Pr->SiS_LVDSCRT1XXXxXXX_1     = SiS300_LVDSCRT1XXXxXXX_1;
+   SiS_Pr->SiS_LVDSCRT1XXXxXXX_1_H   = SiS300_LVDSCRT1XXXxXXX_1_H;
+
+   SiS_Pr->SiS_CHTVCRT1UNTSC = SiS300_CHTVCRT1UNTSC;
+   SiS_Pr->SiS_CHTVCRT1ONTSC = SiS300_CHTVCRT1ONTSC;
+   SiS_Pr->SiS_CHTVCRT1UPAL  = SiS300_CHTVCRT1UPAL;
+   SiS_Pr->SiS_CHTVCRT1OPAL  = SiS300_CHTVCRT1OPAL;
+   SiS_Pr->SiS_CHTVCRT1SOPAL = SiS300_CHTVCRT1SOPAL;
+   SiS_Pr->SiS_CHTVReg_UNTSC = SiS300_CHTVReg_UNTSC;
+   SiS_Pr->SiS_CHTVReg_ONTSC = SiS300_CHTVReg_ONTSC;
+   SiS_Pr->SiS_CHTVReg_UPAL  = SiS300_CHTVReg_UPAL;
+   SiS_Pr->SiS_CHTVReg_OPAL  = SiS300_CHTVReg_OPAL;
+   SiS_Pr->SiS_CHTVReg_UPALM = SiS300_CHTVReg_UNTSC;  /* not supported on 300 series */
+   SiS_Pr->SiS_CHTVReg_OPALM = SiS300_CHTVReg_ONTSC;  /* not supported on 300 series */
+   SiS_Pr->SiS_CHTVReg_UPALN = SiS300_CHTVReg_UPAL;   /* not supported on 300 series */
+   SiS_Pr->SiS_CHTVReg_OPALN = SiS300_CHTVReg_OPAL;   /* not supported on 300 series */
+   SiS_Pr->SiS_CHTVReg_SOPAL = SiS300_CHTVReg_SOPAL;
    SiS_Pr->SiS_CHTVVCLKUNTSC = SiS300_CHTVVCLKUNTSC;
    SiS_Pr->SiS_CHTVVCLKONTSC = SiS300_CHTVVCLKONTSC;
    SiS_Pr->SiS_CHTVVCLKUPAL  = SiS300_CHTVVCLKUPAL;
@@ -406,40 +390,6 @@ InitTo300Pointer(SiS_Private *SiS_Pr, PSIS_HW_INFO HwInfo)
    SiS_Pr->SiS_CHTVVCLKUPALN = SiS300_CHTVVCLKUPAL;   /* not supported on 300 series */
    SiS_Pr->SiS_CHTVVCLKOPALN = SiS300_CHTVVCLKOPAL;   /* not supported on 300 series */
    SiS_Pr->SiS_CHTVVCLKSOPAL = SiS300_CHTVVCLKSOPAL;
-
-   SiS_Pr->SiS_CRT2Part2_1024x768_1  = (SiS_Part2PortTblStruct *)SiS300_CRT2Part2_1024x768_1;
-   SiS_Pr->SiS_CRT2Part2_1280x1024_1 = (SiS_Part2PortTblStruct *)SiS300_CRT2Part2_1280x1024_1;
-   SiS_Pr->SiS_CRT2Part2_1400x1050_1 = (SiS_Part2PortTblStruct *)SiS300_CRT2Part2_1400x1050_1;
-   SiS_Pr->SiS_CRT2Part2_1600x1200_1 = (SiS_Part2PortTblStruct *)SiS300_CRT2Part2_1600x1200_1;
-   SiS_Pr->SiS_CRT2Part2_1024x768_2  = (SiS_Part2PortTblStruct *)SiS300_CRT2Part2_1024x768_2;
-   SiS_Pr->SiS_CRT2Part2_1280x1024_2 = (SiS_Part2PortTblStruct *)SiS300_CRT2Part2_1280x1024_2;
-   SiS_Pr->SiS_CRT2Part2_1400x1050_2 = (SiS_Part2PortTblStruct *)SiS300_CRT2Part2_1400x1050_2;
-   SiS_Pr->SiS_CRT2Part2_1600x1200_2 = (SiS_Part2PortTblStruct *)SiS300_CRT2Part2_1600x1200_2;
-   SiS_Pr->SiS_CRT2Part2_1024x768_3  = (SiS_Part2PortTblStruct *)SiS300_CRT2Part2_1024x768_3;
-   SiS_Pr->SiS_CRT2Part2_1280x1024_3 = (SiS_Part2PortTblStruct *)SiS300_CRT2Part2_1280x1024_3;
-   SiS_Pr->SiS_CRT2Part2_1400x1050_3 = (SiS_Part2PortTblStruct *)SiS300_CRT2Part2_1400x1050_3;
-   SiS_Pr->SiS_CRT2Part2_1600x1200_3 = (SiS_Part2PortTblStruct *)SiS300_CRT2Part2_1600x1200_3;
-
-   /* LCDResInfo will on 300 series be translated to 315 series definitions */
-   SiS_Pr->SiS_Panel320x480   = Panel_320x480;
-   SiS_Pr->SiS_Panel640x480   = Panel_640x480;
-   SiS_Pr->SiS_Panel800x600   = Panel_800x600;
-   SiS_Pr->SiS_Panel1024x768  = Panel_1024x768;
-   SiS_Pr->SiS_Panel1280x1024 = Panel_1280x1024;
-   SiS_Pr->SiS_Panel1280x960  = Panel_1280x960;
-   SiS_Pr->SiS_Panel1024x600  = Panel_1024x600;
-   SiS_Pr->SiS_Panel1152x768  = Panel_1152x768;
-   SiS_Pr->SiS_Panel1280x768  = Panel_1280x768;
-   SiS_Pr->SiS_Panel1600x1200 = 255;  		   /* Something illegal */
-   SiS_Pr->SiS_Panel1400x1050 = 255;
-   SiS_Pr->SiS_Panel640x480_2 = 255;
-   SiS_Pr->SiS_Panel640x480_3 = 255;
-   SiS_Pr->SiS_Panel1152x864  = 255;
-   SiS_Pr->SiS_PanelMax       = Panel_320x480;     /* highest value */
-   SiS_Pr->SiS_PanelMinLVDS   = Panel_800x600;     /* Lowest value LVDS */
-   SiS_Pr->SiS_PanelMin301    = Panel_1024x768;    /* lowest value 301 */
-   SiS_Pr->SiS_PanelCustom    = Panel_Custom;
-   SiS_Pr->SiS_PanelBarco1366 = Panel_Barco1366;
 }
 #endif
 
@@ -477,23 +427,24 @@ InitTo310Pointer(SiS_Private *SiS_Pr, PSIS_HW_INFO HwInfo)
    SiS_StandTable[0x1c].CRTC[4] = 0x55;
    SiS_StandTable[0x1c].CRTC[5] = 0x81;
 
-   SiS_Pr->SiS_SModeIDTable  = (SiS_StStruct *)SiS310_SModeIDTable;
-   SiS_Pr->SiS_EModeIDTable  = (SiS_ExtStruct *)SiS310_EModeIDTable;
+   SiS_Pr->SiS_SModeIDTable  = SiS310_SModeIDTable;
+   SiS_Pr->SiS_EModeIDTable  = SiS310_EModeIDTable;
    SiS_Pr->SiS_RefIndex      = (SiS_Ext2Struct *)SiS310_RefIndex;
-   SiS_Pr->SiS_CRT1Table     = (SiS_CRT1TableStruct *)SiS310_CRT1Table;
-   if(HwInfo->jChipType >= SIS_661) {
-      SiS_Pr->SiS_MCLKData_0 = (SiS_MCLKDataStruct *)SiS310_MCLKData_0_660;  /* 661/741/760 */
+   SiS_Pr->SiS_CRT1Table     = SiS310_CRT1Table;
+   if(HwInfo->jChipType >= SIS_760) {
+      SiS_Pr->SiS_MCLKData_0 = SiS310_MCLKData_0_760;  /* 760 */
+   } else if(HwInfo->jChipType >= SIS_661) {
+      SiS_Pr->SiS_MCLKData_0 = SiS310_MCLKData_0_660;  /* 661/741 */
    } else if(HwInfo->jChipType == SIS_330) {
-      SiS_Pr->SiS_MCLKData_0 = (SiS_MCLKDataStruct *)SiS310_MCLKData_0_330;  /* 330 */
+      SiS_Pr->SiS_MCLKData_0 = SiS310_MCLKData_0_330;  /* 330 */
    } else if(HwInfo->jChipType > SIS_315PRO) {
-      SiS_Pr->SiS_MCLKData_0 = (SiS_MCLKDataStruct *)SiS310_MCLKData_0_650;  /* 550, 650, 740 */
+      SiS_Pr->SiS_MCLKData_0 = SiS310_MCLKData_0_650;  /* 550, 650, 740 */
    } else {
-      SiS_Pr->SiS_MCLKData_0 = (SiS_MCLKDataStruct *)SiS310_MCLKData_0_315;  /* 315 */
+      SiS_Pr->SiS_MCLKData_0 = SiS310_MCLKData_0_315;  /* 315 */
    }
-   SiS_Pr->SiS_MCLKData_1    = (SiS_MCLKDataStruct *)SiS310_MCLKData_1;
-   SiS_Pr->SiS_VCLKData      = (SiS_VCLKDataStruct *)SiS310_VCLKData;
-   SiS_Pr->SiS_VBVCLKData    = (SiS_VBVCLKDataStruct *)SiS310_VBVCLKData;
-   SiS_Pr->SiS_ScreenOffset  = SiS310_ScreenOffset;
+   SiS_Pr->SiS_MCLKData_1    = SiS310_MCLKData_1;
+   SiS_Pr->SiS_VCLKData      = SiS310_VCLKData;
+   SiS_Pr->SiS_VBVCLKData    = SiS310_VBVCLKData;
 
    SiS_Pr->SiS_SR15  = SiS310_SR15;
 
@@ -522,124 +473,96 @@ InitTo310Pointer(SiS_Private *SiS_Pr, PSIS_HW_INFO HwInfo)
    SiS_Pr->pSiS_YCSenseData2    = &SiS310_YCSenseData2;
 #endif
 
-   SiS_Pr->SiS_StLCD1024x768Data    = (SiS_LCDDataStruct *)SiS310_StLCD1024x768Data;
-   SiS_Pr->SiS_ExtLCD1024x768Data   = (SiS_LCDDataStruct *)SiS310_ExtLCD1024x768Data;
-   SiS_Pr->SiS_St2LCD1024x768Data   = (SiS_LCDDataStruct *)SiS310_St2LCD1024x768Data;
-   SiS_Pr->SiS_StLCD1280x1024Data   = (SiS_LCDDataStruct *)SiS310_StLCD1280x1024Data;
-   SiS_Pr->SiS_ExtLCD1280x1024Data  = (SiS_LCDDataStruct *)SiS310_ExtLCD1280x1024Data;
-   SiS_Pr->SiS_St2LCD1280x1024Data  = (SiS_LCDDataStruct *)SiS310_St2LCD1280x1024Data;
-   SiS_Pr->SiS_NoScaleData1024x768  = (SiS_LCDDataStruct *)SiS310_NoScaleData1024x768;
-   SiS_Pr->SiS_NoScaleData1280x1024 = (SiS_LCDDataStruct *)SiS310_NoScaleData1280x1024;
-
-   SiS_Pr->SiS_PanelDelayTbl     = (SiS_PanelDelayTblStruct *)SiS310_PanelDelayTbl;
-   SiS_Pr->SiS_PanelDelayTblLVDS = (SiS_PanelDelayTblStruct *)SiS310_PanelDelayTblLVDS;
-
-   SiS_Pr->SiS_CHTVUPALData  = (SiS_LVDSDataStruct *)SiS310_CHTVUPALData;
-   SiS_Pr->SiS_CHTVOPALData  = (SiS_LVDSDataStruct *)SiS310_CHTVOPALData;
-   SiS_Pr->SiS_CHTVUPALMData = (SiS_LVDSDataStruct *)SiS310_CHTVUPALMData;
-   SiS_Pr->SiS_CHTVOPALMData = (SiS_LVDSDataStruct *)SiS310_CHTVOPALMData;
-   SiS_Pr->SiS_CHTVUPALNData = (SiS_LVDSDataStruct *)SiS310_CHTVUPALNData;
-   SiS_Pr->SiS_CHTVOPALNData = (SiS_LVDSDataStruct *)SiS310_CHTVOPALNData;
-   SiS_Pr->SiS_CHTVSOPALData = (SiS_LVDSDataStruct *)SiS310_CHTVSOPALData;
-
-   SiS_Pr->SiS_PanelType00_1 = (SiS_LVDSDesStruct *)SiS310_PanelType00_1;
-   SiS_Pr->SiS_PanelType01_1 = (SiS_LVDSDesStruct *)SiS310_PanelType01_1;
-   SiS_Pr->SiS_PanelType02_1 = (SiS_LVDSDesStruct *)SiS310_PanelType02_1;
-   SiS_Pr->SiS_PanelType03_1 = (SiS_LVDSDesStruct *)SiS310_PanelType03_1;
-   SiS_Pr->SiS_PanelType04_1 = (SiS_LVDSDesStruct *)SiS310_PanelType04_1;
-   SiS_Pr->SiS_PanelType05_1 = (SiS_LVDSDesStruct *)SiS310_PanelType05_1;
-   SiS_Pr->SiS_PanelType06_1 = (SiS_LVDSDesStruct *)SiS310_PanelType06_1;
-   SiS_Pr->SiS_PanelType07_1 = (SiS_LVDSDesStruct *)SiS310_PanelType07_1;
-   SiS_Pr->SiS_PanelType08_1 = (SiS_LVDSDesStruct *)SiS310_PanelType08_1;
-   SiS_Pr->SiS_PanelType09_1 = (SiS_LVDSDesStruct *)SiS310_PanelType09_1;
-   SiS_Pr->SiS_PanelType0a_1 = (SiS_LVDSDesStruct *)SiS310_PanelType0a_1;
-   SiS_Pr->SiS_PanelType0b_1 = (SiS_LVDSDesStruct *)SiS310_PanelType0b_1;
-   SiS_Pr->SiS_PanelType0c_1 = (SiS_LVDSDesStruct *)SiS310_PanelType0c_1;
-   SiS_Pr->SiS_PanelType0d_1 = (SiS_LVDSDesStruct *)SiS310_PanelType0d_1;
-   SiS_Pr->SiS_PanelType0e_1 = (SiS_LVDSDesStruct *)SiS310_PanelType0e_1;
-   SiS_Pr->SiS_PanelType0f_1 = (SiS_LVDSDesStruct *)SiS310_PanelType0f_1;
-   SiS_Pr->SiS_PanelType00_2 = (SiS_LVDSDesStruct *)SiS310_PanelType00_2;
-   SiS_Pr->SiS_PanelType01_2 = (SiS_LVDSDesStruct *)SiS310_PanelType01_2;
-   SiS_Pr->SiS_PanelType02_2 = (SiS_LVDSDesStruct *)SiS310_PanelType02_2;
-   SiS_Pr->SiS_PanelType03_2 = (SiS_LVDSDesStruct *)SiS310_PanelType03_2;
-   SiS_Pr->SiS_PanelType04_2 = (SiS_LVDSDesStruct *)SiS310_PanelType04_2;
-   SiS_Pr->SiS_PanelType05_2 = (SiS_LVDSDesStruct *)SiS310_PanelType05_2;
-   SiS_Pr->SiS_PanelType06_2 = (SiS_LVDSDesStruct *)SiS310_PanelType06_2;
-   SiS_Pr->SiS_PanelType07_2 = (SiS_LVDSDesStruct *)SiS310_PanelType07_2;
-   SiS_Pr->SiS_PanelType08_2 = (SiS_LVDSDesStruct *)SiS310_PanelType08_2;
-   SiS_Pr->SiS_PanelType09_2 = (SiS_LVDSDesStruct *)SiS310_PanelType09_2;
-   SiS_Pr->SiS_PanelType0a_2 = (SiS_LVDSDesStruct *)SiS310_PanelType0a_2;
-   SiS_Pr->SiS_PanelType0b_2 = (SiS_LVDSDesStruct *)SiS310_PanelType0b_2;
-   SiS_Pr->SiS_PanelType0c_2 = (SiS_LVDSDesStruct *)SiS310_PanelType0c_2;
-   SiS_Pr->SiS_PanelType0d_2 = (SiS_LVDSDesStruct *)SiS310_PanelType0d_2;
-   SiS_Pr->SiS_PanelType0e_2 = (SiS_LVDSDesStruct *)SiS310_PanelType0e_2;
-   SiS_Pr->SiS_PanelType0f_2 = (SiS_LVDSDesStruct *)SiS310_PanelType0f_2;
-
-   SiS_Pr->SiS_CRT2Part2_1024x768_1  = (SiS_Part2PortTblStruct *)SiS310_CRT2Part2_1024x768_1;
-   SiS_Pr->SiS_CRT2Part2_1280x1024_1 = (SiS_Part2PortTblStruct *)SiS310_CRT2Part2_1280x1024_1;
-   SiS_Pr->SiS_CRT2Part2_1400x1050_1 = (SiS_Part2PortTblStruct *)SiS310_CRT2Part2_1400x1050_1;
-   SiS_Pr->SiS_CRT2Part2_1600x1200_1 = (SiS_Part2PortTblStruct *)SiS310_CRT2Part2_1600x1200_1;
-   SiS_Pr->SiS_CRT2Part2_1024x768_2  = (SiS_Part2PortTblStruct *)SiS310_CRT2Part2_1024x768_2;
-   SiS_Pr->SiS_CRT2Part2_1280x1024_2 = (SiS_Part2PortTblStruct *)SiS310_CRT2Part2_1280x1024_2;
-   SiS_Pr->SiS_CRT2Part2_1400x1050_2 = (SiS_Part2PortTblStruct *)SiS310_CRT2Part2_1400x1050_2;
-   SiS_Pr->SiS_CRT2Part2_1600x1200_2 = (SiS_Part2PortTblStruct *)SiS310_CRT2Part2_1600x1200_2;
-   SiS_Pr->SiS_CRT2Part2_1024x768_3  = (SiS_Part2PortTblStruct *)SiS310_CRT2Part2_1024x768_3;
-   SiS_Pr->SiS_CRT2Part2_1280x1024_3 = (SiS_Part2PortTblStruct *)SiS310_CRT2Part2_1280x1024_3;
-   SiS_Pr->SiS_CRT2Part2_1400x1050_3 = (SiS_Part2PortTblStruct *)SiS310_CRT2Part2_1400x1050_3;
-   SiS_Pr->SiS_CRT2Part2_1600x1200_3 = (SiS_Part2PortTblStruct *)SiS310_CRT2Part2_1600x1200_3;
-
-   SiS_Pr->SiS_LVDSCRT1800x600_1     = (SiS_LVDSCRT1DataStruct *)SiS310_LVDSCRT1800x600_1;
-   SiS_Pr->SiS_LVDSCRT11024x768_1    = (SiS_LVDSCRT1DataStruct *)SiS310_LVDSCRT11024x768_1;
-   SiS_Pr->SiS_LVDSCRT11280x1024_1   = (SiS_LVDSCRT1DataStruct *)SiS310_LVDSCRT11280x1024_1;
-   SiS_Pr->SiS_LVDSCRT11400x1050_1   = (SiS_LVDSCRT1DataStruct *)SiS310_LVDSCRT11400x1050_1;
-   SiS_Pr->SiS_LVDSCRT11600x1200_1   = (SiS_LVDSCRT1DataStruct *)SiS310_LVDSCRT11600x1200_1;
-   SiS_Pr->SiS_LVDSCRT1800x600_1_H   = (SiS_LVDSCRT1DataStruct *)SiS310_LVDSCRT1800x600_1_H;
-   SiS_Pr->SiS_LVDSCRT11024x768_1_H  = (SiS_LVDSCRT1DataStruct *)SiS310_LVDSCRT11024x768_1_H;
-   SiS_Pr->SiS_LVDSCRT11280x1024_1_H = (SiS_LVDSCRT1DataStruct *)SiS310_LVDSCRT11280x1024_1_H;
-   SiS_Pr->SiS_LVDSCRT11400x1050_1_H = (SiS_LVDSCRT1DataStruct *)SiS310_LVDSCRT11400x1050_1_H;
-   SiS_Pr->SiS_LVDSCRT11600x1200_1_H = (SiS_LVDSCRT1DataStruct *)SiS310_LVDSCRT11600x1200_1_H;
-   SiS_Pr->SiS_LVDSCRT1800x600_2     = (SiS_LVDSCRT1DataStruct *)SiS310_LVDSCRT1800x600_2;
-   SiS_Pr->SiS_LVDSCRT11024x768_2    = (SiS_LVDSCRT1DataStruct *)SiS310_LVDSCRT11024x768_2;
-   SiS_Pr->SiS_LVDSCRT11280x1024_2   = (SiS_LVDSCRT1DataStruct *)SiS310_LVDSCRT11280x1024_2;
-   SiS_Pr->SiS_LVDSCRT11400x1050_2   = (SiS_LVDSCRT1DataStruct *)SiS310_LVDSCRT11400x1050_2;
-   SiS_Pr->SiS_LVDSCRT11600x1200_2   = (SiS_LVDSCRT1DataStruct *)SiS310_LVDSCRT11600x1200_2;
-   SiS_Pr->SiS_LVDSCRT1800x600_2_H   = (SiS_LVDSCRT1DataStruct *)SiS310_LVDSCRT1800x600_2_H;
-   SiS_Pr->SiS_LVDSCRT11024x768_2_H  = (SiS_LVDSCRT1DataStruct *)SiS310_LVDSCRT11024x768_2_H;
-   SiS_Pr->SiS_LVDSCRT11280x1024_2_H = (SiS_LVDSCRT1DataStruct *)SiS310_LVDSCRT11280x1024_2_H;
-   SiS_Pr->SiS_LVDSCRT11400x1050_2_H = (SiS_LVDSCRT1DataStruct *)SiS310_LVDSCRT11400x1050_2_H;
-   SiS_Pr->SiS_LVDSCRT11600x1200_2_H = (SiS_LVDSCRT1DataStruct *)SiS310_LVDSCRT11600x1200_2_H;
-   SiS_Pr->SiS_CHTVCRT1UNTSC         = (SiS_LVDSCRT1DataStruct *)SiS310_CHTVCRT1UNTSC;
-   SiS_Pr->SiS_CHTVCRT1ONTSC         = (SiS_LVDSCRT1DataStruct *)SiS310_CHTVCRT1ONTSC;
-   SiS_Pr->SiS_CHTVCRT1UPAL          = (SiS_LVDSCRT1DataStruct *)SiS310_CHTVCRT1UPAL;
-   SiS_Pr->SiS_CHTVCRT1OPAL          = (SiS_LVDSCRT1DataStruct *)SiS310_CHTVCRT1OPAL;
-   SiS_Pr->SiS_CHTVCRT1SOPAL         = (SiS_LVDSCRT1DataStruct *)SiS310_CHTVCRT1OPAL;
-
-   SiS_Pr->SiS_CHTVReg_UNTSC = (SiS_CHTVRegDataStruct *)SiS310_CHTVReg_UNTSC;
-   SiS_Pr->SiS_CHTVReg_ONTSC = (SiS_CHTVRegDataStruct *)SiS310_CHTVReg_ONTSC;
-   SiS_Pr->SiS_CHTVReg_UPAL  = (SiS_CHTVRegDataStruct *)SiS310_CHTVReg_UPAL;
-   SiS_Pr->SiS_CHTVReg_OPAL  = (SiS_CHTVRegDataStruct *)SiS310_CHTVReg_OPAL;
-   SiS_Pr->SiS_CHTVReg_UPALM = (SiS_CHTVRegDataStruct *)SiS310_CHTVReg_UPALM;
-   SiS_Pr->SiS_CHTVReg_OPALM = (SiS_CHTVRegDataStruct *)SiS310_CHTVReg_OPALM;
-   SiS_Pr->SiS_CHTVReg_UPALN = (SiS_CHTVRegDataStruct *)SiS310_CHTVReg_UPALN;
-   SiS_Pr->SiS_CHTVReg_OPALN = (SiS_CHTVRegDataStruct *)SiS310_CHTVReg_OPALN;
-   SiS_Pr->SiS_CHTVReg_SOPAL = (SiS_CHTVRegDataStruct *)SiS310_CHTVReg_OPAL;
-
-   SiS_Pr->SiS_LCDACRT11024x768_1    = (SiS_LCDACRT1DataStruct *)SiS310_LCDACRT11024x768_1;
-   SiS_Pr->SiS_LCDACRT11280x1024_1   = (SiS_LCDACRT1DataStruct *)SiS310_LCDACRT11280x1024_1;
-   SiS_Pr->SiS_LCDACRT11400x1050_1   = (SiS_LCDACRT1DataStruct *)SiS310_LCDACRT11400x1050_1;
-   SiS_Pr->SiS_LCDACRT11600x1200_1   = (SiS_LCDACRT1DataStruct *)SiS310_LCDACRT11600x1200_1;
-   SiS_Pr->SiS_LCDACRT11024x768_1_H  = (SiS_LCDACRT1DataStruct *)SiS310_LCDACRT11024x768_1_H;
-   SiS_Pr->SiS_LCDACRT11280x1024_1_H = (SiS_LCDACRT1DataStruct *)SiS310_LCDACRT11280x1024_1_H;
-   SiS_Pr->SiS_LCDACRT11400x1050_1_H = (SiS_LCDACRT1DataStruct *)SiS310_LCDACRT11400x1050_1_H;
-   SiS_Pr->SiS_LCDACRT11600x1200_1_H = (SiS_LCDACRT1DataStruct *)SiS310_LCDACRT11600x1200_1_H;
-   SiS_Pr->SiS_LCDACRT11024x768_2    = (SiS_LCDACRT1DataStruct *)SiS310_LCDACRT11024x768_2;
-   SiS_Pr->SiS_LCDACRT11280x1024_2   = (SiS_LCDACRT1DataStruct *)SiS310_LCDACRT11280x1024_2;
-   SiS_Pr->SiS_LCDACRT11400x1050_2   = (SiS_LCDACRT1DataStruct *)SiS310_LCDACRT11400x1050_2;
-   SiS_Pr->SiS_LCDACRT11600x1200_2   = (SiS_LCDACRT1DataStruct *)SiS310_LCDACRT11600x1200_2;
-   SiS_Pr->SiS_LCDACRT11024x768_2_H  = (SiS_LCDACRT1DataStruct *)SiS310_LCDACRT11024x768_2_H;
-   SiS_Pr->SiS_LCDACRT11280x1024_2_H = (SiS_LCDACRT1DataStruct *)SiS310_LCDACRT11280x1024_2_H;
-   SiS_Pr->SiS_LCDACRT11400x1050_2_H = (SiS_LCDACRT1DataStruct *)SiS310_LCDACRT11400x1050_2_H;
-   SiS_Pr->SiS_LCDACRT11600x1200_2_H = (SiS_LCDACRT1DataStruct *)SiS310_LCDACRT11600x1200_2_H;
+   SiS_Pr->SiS_PanelDelayTbl     = SiS310_PanelDelayTbl;
+   SiS_Pr->SiS_PanelDelayTblLVDS = SiS310_PanelDelayTblLVDS;
+
+   SiS_Pr->SiS_St2LCD1024x768Data   = SiS310_St2LCD1024x768Data;
+   SiS_Pr->SiS_ExtLCD1024x768Data   = SiS310_ExtLCD1024x768Data;
+   SiS_Pr->SiS_St2LCD1280x1024Data  = SiS310_St2LCD1280x1024Data;
+   SiS_Pr->SiS_ExtLCD1280x1024Data  = SiS310_ExtLCD1280x1024Data;
+
+   SiS_Pr->SiS_CRT2Part2_1024x768_1  = SiS310_CRT2Part2_1024x768_1;
+
+   SiS_Pr->SiS_PanelType00_1 = SiS310_PanelType00_1;
+   SiS_Pr->SiS_PanelType01_1 = SiS310_PanelType01_1;
+   SiS_Pr->SiS_PanelType02_1 = SiS310_PanelType02_1;
+   SiS_Pr->SiS_PanelType03_1 = SiS310_PanelType03_1;
+   SiS_Pr->SiS_PanelType04_1 = SiS310_PanelType04_1;
+   SiS_Pr->SiS_PanelType05_1 = SiS310_PanelType05_1;
+   SiS_Pr->SiS_PanelType06_1 = SiS310_PanelType06_1;
+   SiS_Pr->SiS_PanelType07_1 = SiS310_PanelType07_1;
+   SiS_Pr->SiS_PanelType08_1 = SiS310_PanelType08_1;
+   SiS_Pr->SiS_PanelType09_1 = SiS310_PanelType09_1;
+   SiS_Pr->SiS_PanelType0a_1 = SiS310_PanelType0a_1;
+   SiS_Pr->SiS_PanelType0b_1 = SiS310_PanelType0b_1;
+   SiS_Pr->SiS_PanelType0c_1 = SiS310_PanelType0c_1;
+   SiS_Pr->SiS_PanelType0d_1 = SiS310_PanelType0d_1;
+   SiS_Pr->SiS_PanelType0e_1 = SiS310_PanelType0e_1;
+   SiS_Pr->SiS_PanelType0f_1 = SiS310_PanelType0f_1;
+   SiS_Pr->SiS_PanelType00_2 = SiS310_PanelType00_2;
+   SiS_Pr->SiS_PanelType01_2 = SiS310_PanelType01_2;
+   SiS_Pr->SiS_PanelType02_2 = SiS310_PanelType02_2;
+   SiS_Pr->SiS_PanelType03_2 = SiS310_PanelType03_2;
+   SiS_Pr->SiS_PanelType04_2 = SiS310_PanelType04_2;
+   SiS_Pr->SiS_PanelType05_2 = SiS310_PanelType05_2;
+   SiS_Pr->SiS_PanelType06_2 = SiS310_PanelType06_2;
+   SiS_Pr->SiS_PanelType07_2 = SiS310_PanelType07_2;
+   SiS_Pr->SiS_PanelType08_2 = SiS310_PanelType08_2;
+   SiS_Pr->SiS_PanelType09_2 = SiS310_PanelType09_2;
+   SiS_Pr->SiS_PanelType0a_2 = SiS310_PanelType0a_2;
+   SiS_Pr->SiS_PanelType0b_2 = SiS310_PanelType0b_2;
+   SiS_Pr->SiS_PanelType0c_2 = SiS310_PanelType0c_2;
+   SiS_Pr->SiS_PanelType0d_2 = SiS310_PanelType0d_2;
+   SiS_Pr->SiS_PanelType0e_2 = SiS310_PanelType0e_2;
+   SiS_Pr->SiS_PanelType0f_2 = SiS310_PanelType0f_2;
+   SiS_Pr->SiS_PanelTypeNS_1 = SiS310_PanelTypeNS_1;
+   SiS_Pr->SiS_PanelTypeNS_2 = SiS310_PanelTypeNS_2;
+
+   SiS_Pr->SiS_CHTVUPALData  = SiS310_CHTVUPALData;
+   SiS_Pr->SiS_CHTVOPALData  = SiS310_CHTVOPALData;
+   SiS_Pr->SiS_CHTVUPALMData = SiS310_CHTVUPALMData;
+   SiS_Pr->SiS_CHTVOPALMData = SiS310_CHTVOPALMData;
+   SiS_Pr->SiS_CHTVUPALNData = SiS310_CHTVUPALNData;
+   SiS_Pr->SiS_CHTVOPALNData = SiS310_CHTVOPALNData;
+   SiS_Pr->SiS_CHTVSOPALData = SiS310_CHTVSOPALData;
+
+   SiS_Pr->SiS_LVDSCRT1800x600_1     = SiS310_LVDSCRT1800x600_1;
+   SiS_Pr->SiS_LVDSCRT11024x768_1    = SiS310_LVDSCRT11024x768_1;
+   SiS_Pr->SiS_LVDSCRT11280x1024_1   = SiS310_LVDSCRT11280x1024_1;
+   SiS_Pr->SiS_LVDSCRT11400x1050_1   = SiS310_LVDSCRT11400x1050_1;
+   SiS_Pr->SiS_LVDSCRT11600x1200_1   = SiS310_LVDSCRT11600x1200_1;
+   SiS_Pr->SiS_LVDSCRT1800x600_1_H   = SiS310_LVDSCRT1800x600_1_H;
+   SiS_Pr->SiS_LVDSCRT11024x768_1_H  = SiS310_LVDSCRT11024x768_1_H;
+   SiS_Pr->SiS_LVDSCRT11280x1024_1_H = SiS310_LVDSCRT11280x1024_1_H;
+   SiS_Pr->SiS_LVDSCRT11400x1050_1_H = SiS310_LVDSCRT11400x1050_1_H;
+   SiS_Pr->SiS_LVDSCRT11600x1200_1_H = SiS310_LVDSCRT11600x1200_1_H;
+   SiS_Pr->SiS_LVDSCRT1800x600_2     = SiS310_LVDSCRT1800x600_2;
+   SiS_Pr->SiS_LVDSCRT11024x768_2    = SiS310_LVDSCRT11024x768_2;
+   SiS_Pr->SiS_LVDSCRT11280x1024_2   = SiS310_LVDSCRT11280x1024_2;
+   SiS_Pr->SiS_LVDSCRT11400x1050_2   = SiS310_LVDSCRT11400x1050_2;
+   SiS_Pr->SiS_LVDSCRT11600x1200_2   = SiS310_LVDSCRT11600x1200_2;
+   SiS_Pr->SiS_LVDSCRT1800x600_2_H   = SiS310_LVDSCRT1800x600_2_H;
+   SiS_Pr->SiS_LVDSCRT11024x768_2_H  = SiS310_LVDSCRT11024x768_2_H;
+   SiS_Pr->SiS_LVDSCRT11280x1024_2_H = SiS310_LVDSCRT11280x1024_2_H;
+   SiS_Pr->SiS_LVDSCRT11400x1050_2_H = SiS310_LVDSCRT11400x1050_2_H;
+   SiS_Pr->SiS_LVDSCRT11600x1200_2_H = SiS310_LVDSCRT11600x1200_2_H;
+   SiS_Pr->SiS_LVDSCRT1XXXxXXX_1     = SiS310_LVDSCRT1XXXxXXX_1;
+   SiS_Pr->SiS_LVDSCRT1XXXxXXX_1_H   = SiS310_LVDSCRT1XXXxXXX_1_H;
+   SiS_Pr->SiS_CHTVCRT1UNTSC         = SiS310_CHTVCRT1UNTSC;
+   SiS_Pr->SiS_CHTVCRT1ONTSC         = SiS310_CHTVCRT1ONTSC;
+   SiS_Pr->SiS_CHTVCRT1UPAL          = SiS310_CHTVCRT1UPAL;
+   SiS_Pr->SiS_CHTVCRT1OPAL          = SiS310_CHTVCRT1OPAL;
+   SiS_Pr->SiS_CHTVCRT1SOPAL         = SiS310_CHTVCRT1OPAL;
+
+   SiS_Pr->SiS_CHTVReg_UNTSC = SiS310_CHTVReg_UNTSC;
+   SiS_Pr->SiS_CHTVReg_ONTSC = SiS310_CHTVReg_ONTSC;
+   SiS_Pr->SiS_CHTVReg_UPAL  = SiS310_CHTVReg_UPAL;
+   SiS_Pr->SiS_CHTVReg_OPAL  = SiS310_CHTVReg_OPAL;
+   SiS_Pr->SiS_CHTVReg_UPALM = SiS310_CHTVReg_UPALM;
+   SiS_Pr->SiS_CHTVReg_OPALM = SiS310_CHTVReg_OPALM;
+   SiS_Pr->SiS_CHTVReg_UPALN = SiS310_CHTVReg_UPALN;
+   SiS_Pr->SiS_CHTVReg_OPALN = SiS310_CHTVReg_OPALN;
+   SiS_Pr->SiS_CHTVReg_SOPAL = SiS310_CHTVReg_OPAL;
 
    SiS_Pr->SiS_CHTVVCLKUNTSC = SiS310_CHTVVCLKUNTSC;
    SiS_Pr->SiS_CHTVVCLKONTSC = SiS310_CHTVVCLKONTSC;
@@ -648,28 +571,8 @@ InitTo310Pointer(SiS_Private *SiS_Pr, PSIS_HW_INFO HwInfo)
    SiS_Pr->SiS_CHTVVCLKUPALM = SiS310_CHTVVCLKUPALM;
    SiS_Pr->SiS_CHTVVCLKOPALM = SiS310_CHTVVCLKOPALM;
    SiS_Pr->SiS_CHTVVCLKUPALN = SiS310_CHTVVCLKUPALN;
-   SiS_Pr->SiS_CHTVVCLKOPALN = SiS310_CHTVVCLKOPALN;   
+   SiS_Pr->SiS_CHTVVCLKOPALN = SiS310_CHTVVCLKOPALN;
    SiS_Pr->SiS_CHTVVCLKSOPAL = SiS310_CHTVVCLKOPAL;
-
-   SiS_Pr->SiS_Panel320x480   = Panel_320x480;
-   SiS_Pr->SiS_Panel640x480   = Panel_640x480;
-   SiS_Pr->SiS_Panel800x600   = Panel_800x600;
-   SiS_Pr->SiS_Panel1024x768  = Panel_1024x768;
-   SiS_Pr->SiS_Panel1280x1024 = Panel_1280x1024;
-   SiS_Pr->SiS_Panel1280x960  = Panel_1280x960;
-   SiS_Pr->SiS_Panel1600x1200 = Panel_1600x1200;
-   SiS_Pr->SiS_Panel1400x1050 = Panel_1400x1050;
-   SiS_Pr->SiS_Panel1152x768  = Panel_1152x768;
-   SiS_Pr->SiS_Panel1152x864  = Panel_1152x864;
-   SiS_Pr->SiS_Panel1280x768  = Panel_1280x768;
-   SiS_Pr->SiS_Panel1024x600  = Panel_1024x600;
-   SiS_Pr->SiS_Panel640x480_2 = Panel_640x480_2;
-   SiS_Pr->SiS_Panel640x480_3 = Panel_640x480_3;
-   SiS_Pr->SiS_PanelMax       = Panel_320x480;    /* highest value */
-   SiS_Pr->SiS_PanelMinLVDS   = Panel_800x600;    /* lowest value LVDS/LCDA */
-   SiS_Pr->SiS_PanelMin301    = Panel_1024x768;   /* lowest value 301 */
-   SiS_Pr->SiS_PanelCustom    = Panel_Custom;
-   SiS_Pr->SiS_PanelBarco1366 = 255;
 }
 #endif
 
@@ -710,7 +613,8 @@ SiSInitPtr(SiS_Private *SiS_Pr, PSIS_HW_INFO HwInfo)
 /*********************************************/
 
 USHORT
-SiS_GetModeID(int VGAEngine, ULONG VBFlags, int HDisplay, int VDisplay, int Depth, BOOLEAN FSTN)
+SiS_GetModeID(int VGAEngine, ULONG VBFlags, int HDisplay, int VDisplay,
+              int Depth, BOOLEAN FSTN, int LCDwidth, int LCDheight)
 {
    USHORT ModeIndex = 0;
 
@@ -734,54 +638,58 @@ SiS_GetModeID(int VGAEngine, ULONG VBFlags, int HDisplay, int VDisplay, int Dept
 	  else if(VDisplay == 400) ModeIndex = ModeIndex_640x400[Depth];
           break;
      case 720:
-          if(!(VBFlags & CRT1_LCDA)) {
-             if(VDisplay == 480)      ModeIndex = ModeIndex_720x480[Depth];
-             else if(VDisplay == 576) ModeIndex = ModeIndex_720x576[Depth];
-          }
+          if(VDisplay == 480)      ModeIndex = ModeIndex_720x480[Depth];
+          else if(VDisplay == 576) ModeIndex = ModeIndex_720x576[Depth];
           break;
      case 768:
-          if(!(VBFlags & CRT1_LCDA)) {
-             if(VDisplay == 576) ModeIndex = ModeIndex_768x576[Depth];
-          }
+          if(VDisplay == 576) ModeIndex = ModeIndex_768x576[Depth];
 	  break;
      case 800:
-	  if(VDisplay == 600)    ModeIndex = ModeIndex_800x600[Depth];
-	  else if(!(VBFlags & CRT1_LCDA)) {
-	     if(VDisplay == 480) ModeIndex = ModeIndex_800x480[Depth];
-	  }
+	  if(VDisplay == 600)      ModeIndex = ModeIndex_800x600[Depth];
+	  else if(VDisplay == 480) ModeIndex = ModeIndex_800x480[Depth];
           break;
      case 848:
-          if(!(VBFlags & CRT1_LCDA)) {
-	     if(VDisplay == 480) ModeIndex = ModeIndex_848x480[Depth];
-	  }
+	  if(VDisplay == 480) ModeIndex = ModeIndex_848x480[Depth];
 	  break;
      case 856:
-          if(!(VBFlags & CRT1_LCDA)) {
-	     if(VDisplay == 480) ModeIndex = ModeIndex_856x480[Depth];
+	  if(VDisplay == 480) ModeIndex = ModeIndex_856x480[Depth];
+	  break;
+     case 960:
+	  if(VGAEngine == SIS_315_VGA) {
+	     if(VDisplay == 540) ModeIndex = ModeIndex_960x540[Depth];
 	  }
 	  break;
      case 1024:
-          if(VDisplay == 768) ModeIndex = ModeIndex_1024x768[Depth];
-	  else if(!(VBFlags & CRT1_LCDA)) {
-	     if(VDisplay == 576)    ModeIndex = ModeIndex_1024x576[Depth];
-	     else if(VGAEngine == SIS_300_VGA) {
-	        if(VDisplay == 600) ModeIndex = ModeIndex_1024x600[Depth];
-             }
+          if(VDisplay == 768)      ModeIndex = ModeIndex_1024x768[Depth];
+	  else if(VDisplay == 576) ModeIndex = ModeIndex_1024x576[Depth];
+	  else if((!(VBFlags & CRT1_LCDA)) && (VGAEngine == SIS_300_VGA)) {
+	     if(VDisplay == 600) ModeIndex = ModeIndex_1024x600[Depth];
 	  }
           break;
      case 1152:
-          if(!(VBFlags & CRT1_LCDA)) {
-             if(VDisplay == 864)    ModeIndex = ModeIndex_1152x864[Depth];
-             else if(VGAEngine == SIS_300_VGA) {
-	        if(VDisplay == 768) ModeIndex = ModeIndex_1152x768[Depth];
-             }
+          if(VDisplay == 864) ModeIndex = ModeIndex_1152x864[Depth];
+          if((!(VBFlags & CRT1_LCDA)) && (VGAEngine == SIS_300_VGA)) {
+	     if(VDisplay == 768) ModeIndex = ModeIndex_1152x768[Depth];
 	  }
 	  break;
      case 1280:
-          if(VDisplay == 1024)        ModeIndex = ModeIndex_1280x1024[Depth];
-	  else if(!(VBFlags & CRT1_LCDA)) {
-             if(VDisplay == 960)      ModeIndex = ModeIndex_1280x960[Depth];
-	     else if(VDisplay == 720) ModeIndex = ModeIndex_1280x720[Depth];
+          if(VDisplay == 1024) ModeIndex = ModeIndex_1280x1024[Depth];
+	  else if(VDisplay == 800) {
+	     if(VGAEngine == SIS_315_VGA) {
+	        if((VBFlags & CRT1_LCDA) && (LCDwidth == 1280) && (LCDheight == 800)) {
+	           ModeIndex = ModeIndex_1280x800[Depth];
+	        } else if(!(VBFlags & CRT1_LCDA)) {
+	           ModeIndex = ModeIndex_1280x800[Depth];
+	        }
+	     }
+	  } else if(VDisplay == 720) {
+	     if((VBFlags & CRT1_LCDA) && (LCDwidth == 1280) && (LCDheight == 720)) {
+	        ModeIndex = ModeIndex_1280x720[Depth];
+	     } else if(!(VBFlags & CRT1_LCDA)) {
+	        ModeIndex = ModeIndex_1280x720[Depth];
+	     }
+	  } else if(!(VBFlags & CRT1_LCDA)) {
+             if(VDisplay == 960) ModeIndex = ModeIndex_1280x960[Depth];
 	     else if(VDisplay == 768) {
 	        if(VGAEngine == SIS_300_VGA) {
 	           ModeIndex = ModeIndex_300_1280x768[Depth];
@@ -792,23 +700,39 @@ SiS_GetModeID(int VGAEngine, ULONG VBFlags, int HDisplay, int VDisplay, int Dept
 	  }
           break;
      case 1360:
+          if(VDisplay == 768) ModeIndex = ModeIndex_1360x768[Depth];
           if(!(VBFlags & CRT1_LCDA)) {
-	     if(VDisplay == 768)     ModeIndex = ModeIndex_1360x768[Depth];
-	     else if(VGAEngine == SIS_300_VGA) {
+	     if(VGAEngine == SIS_300_VGA) {
 	        if(VDisplay == 1024) ModeIndex = ModeIndex_300_1360x1024[Depth];
              }
 	  }
           break;
      case 1400:
           if(VGAEngine == SIS_315_VGA) {
-	     if(VDisplay == 1050) ModeIndex = ModeIndex_1400x1050[Depth];
+	     if(VDisplay == 1050) {
+	        if((VBFlags & CRT1_LCDA) &&
+	           (((LCDwidth == 1400) && (LCDheight == 1050)) ||
+		    ((LCDwidth == 1600) && (LCDheight == 1200)))) {
+	           ModeIndex = ModeIndex_1400x1050[Depth];
+	        } else if(!(VBFlags & CRT1_LCDA)) {
+	           ModeIndex = ModeIndex_1400x1050[Depth];
+	        }
+	     }
 	  }
           break;
      case 1600:
           if(VDisplay == 1200) ModeIndex = ModeIndex_1600x1200[Depth];
           break;
+     case 1680:
+          if(VGAEngine == SIS_315_VGA) {
+             if(VDisplay == 1050) ModeIndex = ModeIndex_1680x1050[Depth];
+	  }
+          break;
      case 1920:
           if(!(VBFlags & CRT1_LCDA)) {
+	     if(VGAEngine == SIS_315_VGA) {
+	        if(VDisplay == 1080) ModeIndex = ModeIndex_1920x1080[Depth];
+	     }
              if(VDisplay == 1440) ModeIndex = ModeIndex_1920x1440[Depth];
 	  }
           break;
@@ -851,14 +775,18 @@ SiS_GetModeID_LCD(int VGAEngine, ULONG VBFlags, int HDisplay, int VDisplay,
              break;
      	case 400:
 	     if(CustomT != CUT_PANEL848) {
-          	if(VDisplay == 300) ModeIndex = ModeIndex_400x300[Depth];
+	        if(!((VGAEngine == SIS_300_VGA) && (VBFlags & VB_TRUMPION))) {
+          	   if(VDisplay == 300) ModeIndex = ModeIndex_400x300[Depth];
+		}
 	     }
              break;
 	case 512:
 	     if(CustomT != CUT_PANEL848) {
-		if(VDisplay == 384) {
+	        if(!((VGAEngine == SIS_300_VGA) && (VBFlags & VB_TRUMPION))) {
 		   if(LCDwidth != 1024 || LCDheight != 600) {
-		      ModeIndex = ModeIndex_512x384[Depth];
+		      if(VDisplay == 384) {
+		         ModeIndex = ModeIndex_512x384[Depth];
+		      }
 		   }
 		}
 	     }
@@ -898,6 +826,9 @@ SiS_GetModeID_LCD(int VGAEngine, ULONG VBFlags, int HDisplay, int VDisplay,
 	        if((VDisplay == 768) && (LCDheight == 768)) {
 		   ModeIndex = ModeIndex_310_1280x768[Depth];
 		}
+		if((VDisplay == 800) && (LCDheight == 800)) {
+		   ModeIndex = ModeIndex_310_1280x768[Depth];
+		}
 	     }
 	     break;
 	case 1360:
@@ -940,17 +871,54 @@ SiS_GetModeID_LCD(int VGAEngine, ULONG VBFlags, int HDisplay, int VDisplay,
 	     if(VDisplay == 480)      ModeIndex = ModeIndex_640x480[Depth];
 	     else if(VDisplay == 400) ModeIndex = ModeIndex_640x400[Depth];
 	     break;
+	case 720:
+	     if(VGAEngine == SIS_315_VGA) {
+	        if(VDisplay == 480)      ModeIndex = ModeIndex_720x480[Depth];
+		else if(VDisplay == 576) ModeIndex = ModeIndex_720x576[Depth];
+	     }
+	     break;
+	case 768:
+	     if(VGAEngine == SIS_315_VGA) {
+	        if(VDisplay == 576) ModeIndex = ModeIndex_768x576[Depth];
+	     }
+	     break;
 	case 800:
 	     if(VDisplay == 600) ModeIndex = ModeIndex_800x600[Depth];
+	     if(VGAEngine == SIS_315_VGA) {
+	        if(VDisplay == 480) ModeIndex = ModeIndex_800x480[Depth];
+	     }
+	     break;
+	case 848:
+	     if(VGAEngine == SIS_315_VGA) {
+	        if(VDisplay == 480) ModeIndex = ModeIndex_848x480[Depth];
+	     }
+	     break;
+	case 856:
+	     if(VGAEngine == SIS_315_VGA) {
+	        if(VDisplay == 480) ModeIndex = ModeIndex_856x480[Depth];
+	     }
+	     break;
+	case 960:
+	     if(VGAEngine == SIS_315_VGA) {
+	        if(VDisplay == 540) ModeIndex = ModeIndex_960x540[Depth];
+	     }
 	     break;
 	case 1024:
 	     if(VDisplay == 768) ModeIndex = ModeIndex_1024x768[Depth];
+	     if(VGAEngine == SIS_315_VGA) {
+	        if(VDisplay == 576) ModeIndex = ModeIndex_1024x576[Depth];
+	     }
+	     break;
+	case 1152:
+	     if(VGAEngine == SIS_315_VGA) {
+	        if(VDisplay == 864) ModeIndex = ModeIndex_1152x864[Depth];
+	     }
 	     break;
 	case 1280:
 	     if(VDisplay == 1024) ModeIndex = ModeIndex_1280x1024[Depth];
 	     else if(VDisplay == 768) {
-		if((LCDheight == 768) ||
-		   ((LCDheight == 1024) && (VBFlags & (VB_301|VB_301B|VB_301C|VB_302B)))) {
+		if((LCDheight == 768) ||  (LCDwidth == 1680) ||
+		   (VBFlags & VB_SISTMDS)) {
 		   if(VGAEngine == SIS_300_VGA) {
 		      ModeIndex = ModeIndex_300_1280x768[Depth];
 		   } else {
@@ -958,24 +926,49 @@ SiS_GetModeID_LCD(int VGAEngine, ULONG VBFlags, int HDisplay, int VDisplay,
 		   }
 		}
 	     } else if(VDisplay == 960) {
-	        if((LCDheight == 960) ||
-		   ((LCDheight == 1024) && (VBFlags & (VB_301|VB_301B|VB_301C|VB_302B)))) {
+	        if((LCDheight == 960) || (VBFlags & VB_SISTMDS)) {
 		   ModeIndex = ModeIndex_1280x960[Depth];
 		}
+	     } else if(VGAEngine == SIS_315_VGA) {
+	        if(VDisplay == 800) {
+		   if((LCDheight == 800) || (LCDwidth == 1680) ||
+		      (VBFlags & VB_SISTMDS)) {
+		      ModeIndex = ModeIndex_1280x800[Depth];
+		   }
+		} else if(VDisplay == 720) {
+		   if((LCDheight == 720) || (LCDwidth == 1680) || (LCDwidth == 1400) ||
+		      (VBFlags & VB_SISTMDS)) {
+		      ModeIndex = ModeIndex_1280x720[Depth];
+		   }
+		}
+	     }
+	     break;
+	case 1360:
+	     if(VGAEngine == SIS_315_VGA) {
+	        if(VDisplay == 768) ModeIndex = ModeIndex_1360x768[Depth];
 	     }
 	     break;
 	case 1400:
 	     if(VGAEngine == SIS_315_VGA) {
 	        if(VBFlags & (VB_301B | VB_301C | VB_302B | VB_302LV | VB_302ELV)) {
-		   if(LCDheight != 1200) {
-	              if(VDisplay == 1050) ModeIndex = ModeIndex_1400x1050[Depth];
+		   if((LCDwidth == 1400) || (LCDwidth == 1600) || (LCDwidth == 1680)) {
+		      ModeIndex = ModeIndex_1400x1050[Depth];
 		   }
 		}
 	     }
 	     break;
 	case 1600:
-	     if(VBFlags & (VB_301C | VB_302B | VB_302LV | VB_302ELV)) {
-	        if(VDisplay == 1200) ModeIndex = ModeIndex_1600x1200[Depth];
+	     if(VGAEngine == SIS_315_VGA) {
+	        if(VBFlags & (VB_301C | VB_302B | VB_302LV | VB_302ELV)) {
+	           if(VDisplay == 1200) ModeIndex = ModeIndex_1600x1200[Depth];
+		}
+	     }
+	     break;
+	case 1680:
+	     if(VGAEngine == SIS_315_VGA) {
+	        if(VBFlags & (VB_301C | VB_302B | VB_302LV | VB_302ELV)) {
+	           if(VDisplay == 1050) ModeIndex = ModeIndex_1680x1050[Depth];
+		}
 	     }
 	     break;
       }
@@ -1024,8 +1017,8 @@ SiS_GetModeID_TV(int VGAEngine, ULONG VBFlags, int HDisplay, int VDisplay, int D
              if(VDisplay == 300) ModeIndex = ModeIndex_400x300[Depth];
              break;
       	case 512:
-	     if( ((VBFlags & TV_YPBPR) && (VBFlags & (TV_YPBPR525P | TV_YPBPR750P | TV_YPBPR1080I))) ||
-	         (VBFlags & TV_HIVISION) 					    		     ||
+	     if( ((VBFlags & TV_YPBPR) && (VBFlags & (TV_YPBPR750P | TV_YPBPR1080I))) ||
+	         (VBFlags & TV_HIVISION) 					      ||
 	         ((!(VBFlags & (TV_YPBPR | TV_PALM))) && (VBFlags & TV_PAL)) ) {
 	        if(VDisplay == 384) ModeIndex = ModeIndex_512x384[Depth];
 	     }
@@ -1037,17 +1030,19 @@ SiS_GetModeID_TV(int VGAEngine, ULONG VBFlags, int HDisplay, int VDisplay, int D
 	case 720:
 	     if((!(VBFlags & TV_HIVISION)) && (!((VBFlags & TV_YPBPR) && (VBFlags & TV_YPBPR1080I)))) {
                 if(VDisplay == 480) {
-		   if((VBFlags & TV_YPBPR) || (VBFlags & (TV_NTSC | TV_PALM)))
+		   /* if((VBFlags & TV_YPBPR) || (VBFlags & (TV_NTSC | TV_PALM))) */
                       ModeIndex = ModeIndex_720x480[Depth];
                 } else if(VDisplay == 576) {
-		   if((!(VBFlags & (TV_YPBPR | TV_PALM))) && (VBFlags & TV_PAL))
+		   if( ((VBFlags & TV_YPBPR) && (VBFlags & TV_YPBPR750P)) ||
+		       ((!(VBFlags & (TV_YPBPR | TV_PALM))) && (VBFlags & TV_PAL)) )
                       ModeIndex = ModeIndex_720x576[Depth];
                 }
 	     }
              break;
 	case 768:
 	     if((!(VBFlags & TV_HIVISION)) && (!((VBFlags & TV_YPBPR) && (VBFlags & TV_YPBPR1080I)))) {
-	        if((!(VBFlags & (TV_YPBPR | TV_PALM))) && (VBFlags & TV_PAL)) {
+	        if( ((VBFlags & TV_YPBPR) && (VBFlags & TV_YPBPR750P)) ||
+		    ((!(VBFlags & (TV_YPBPR | TV_PALM))) && (VBFlags & TV_PAL)) ) {
           	   if(VDisplay == 576) ModeIndex = ModeIndex_768x576[Depth];
 		}
              }
@@ -1072,9 +1067,16 @@ SiS_GetModeID_TV(int VGAEngine, ULONG VBFlags, int HDisplay, int VDisplay, int D
 	     }
 	     break;
 	case 1280:
-	     if((VBFlags & TV_HIVISION) || ((VBFlags & TV_YPBPR) && (VBFlags & TV_YPBPR1080I))) {
-	        if(VDisplay == 720)       ModeIndex = ModeIndex_1280x720[Depth];
-		else if(VDisplay == 1024) ModeIndex = ModeIndex_1280x1024[Depth];
+	     if(VDisplay == 720) {
+	        if((VBFlags & TV_HIVISION) ||
+		   ((VBFlags & TV_YPBPR) && (VBFlags & (TV_YPBPR1080I | TV_YPBPR750P)))) {
+	           ModeIndex = ModeIndex_1280x720[Depth];
+		}
+	     } else if(VDisplay == 1024) {
+	        if((VBFlags & TV_HIVISION) ||
+		   ((VBFlags & TV_YPBPR) && (VBFlags & TV_YPBPR1080I))) {
+	           ModeIndex = ModeIndex_1280x1024[Depth];
+		}
 	     }
 	     break;
       }
@@ -1122,6 +1124,11 @@ SiS_GetModeID_VGA2(int VGAEngine, ULONG VBFlags, int HDisplay, int VDisplay, int
 	case 856:
 		if(VDisplay == 480) ModeIndex = ModeIndex_856x480[Depth];
 		break;
+	case 960:
+		if(VGAEngine == SIS_315_VGA) {
+		   if(VDisplay == 540) ModeIndex = ModeIndex_960x540[Depth];
+		}
+		break;
 	case 1024:
 		if(VDisplay == 768)      ModeIndex = ModeIndex_1024x768[Depth];
 		else if(VDisplay == 576) ModeIndex = ModeIndex_1024x576[Depth];
@@ -1141,6 +1148,7 @@ SiS_GetModeID_VGA2(int VGAEngine, ULONG VBFlags, int HDisplay, int VDisplay, int
 		   }
 		} else if(VDisplay == 1024) ModeIndex = ModeIndex_1280x1024[Depth];
 		else if(VDisplay == 720)    ModeIndex = ModeIndex_1280x720[Depth];
+		else if(VDisplay == 800)    ModeIndex = ModeIndex_1280x800[Depth];
 		else if(VDisplay == 960)    ModeIndex = ModeIndex_1280x960[Depth];
 		break;
         case 1360:
@@ -1158,6 +1166,13 @@ SiS_GetModeID_VGA2(int VGAEngine, ULONG VBFlags, int HDisplay, int VDisplay, int
 		   }
 		}
 		break;
+	case 1680:
+		if(VGAEngine == SIS_315_VGA) {
+		   if(VBFlags & (VB_301B|VB_301C|VB_302B)) {
+	              if(VDisplay == 1050) ModeIndex = ModeIndex_1680x1050[Depth];
+		   }
+		}
+		break;
    }
 
    return ModeIndex;
@@ -1255,13 +1270,13 @@ SiS_SetRegOR(SISIOADDRESS Port,USHORT Index,USHORT DataOR)
 void
 SiS_DisplayOn(SiS_Private *SiS_Pr)
 {
-   SiS_SetRegANDOR(SiS_Pr->SiS_P3c4,0x01,0xDF,0x00);
+   SiS_SetRegAND(SiS_Pr->SiS_P3c4,0x01,0xDF);
 }
 
 void
 SiS_DisplayOff(SiS_Private *SiS_Pr)
 {
-   SiS_SetRegANDOR(SiS_Pr->SiS_P3c4,0x01,0xDF,0x20);
+   SiS_SetRegOR(SiS_Pr->SiS_P3c4,0x01,0x20);
 }
 
 
@@ -1308,9 +1323,11 @@ SiS_GetSysFlags(SiS_Private *SiS_Pr, PSIS_HW_INFO HwInfo)
    /* (SR11 is used for DDC and in enable/disablebridge) */
    SiS_Pr->SiS_SensibleSR11 = FALSE;
    SiS_Pr->SiS_MyCR63 = 0x63;
-   if(HwInfo->jChipType >= SIS_661) {
-      SiS_Pr->SiS_SensibleSR11 = TRUE;
+   if(HwInfo->jChipType >= SIS_330) {
       SiS_Pr->SiS_MyCR63 = 0x53;
+      if(HwInfo->jChipType >= SIS_661) {
+         SiS_Pr->SiS_SensibleSR11 = TRUE;
+      }
    }
 
    /* You should use the macros, not these flags directly */
@@ -1350,6 +1367,10 @@ SiS_GetSysFlags(SiS_Private *SiS_Pr, PSIS_HW_INFO HwInfo)
 	 }
       }
    }
+   if(HwInfo->jChipType == SIS_760) {
+      temp1 = SiS_GetReg(SiS_Pr->SiS_P3d4,0x78);
+      if(temp1 & 0x30) SiS_Pr->SiS_SysFlags |= SF_760LFB;
+   }
 }
 
 /*********************************************/
@@ -1411,7 +1432,7 @@ SiSInitPCIetc(SiS_Private *SiS_Pr, PSIS_HW_INFO HwInfo)
 void
 SiSSetLVDSetc(SiS_Private *SiS_Pr, PSIS_HW_INFO HwInfo)
 {
-   ULONG   temp;
+   USHORT temp;
 
    SiS_Pr->SiS_IF_DEF_LVDS = 0;
    SiS_Pr->SiS_IF_DEF_TRUMPION = 0;
@@ -1422,18 +1443,19 @@ SiSSetLVDSetc(SiS_Private *SiS_Pr, PSIS_HW_INFO HwInfo)
 
    SiS_Pr->SiS_ChrontelInit = 0;
 
+   /* Check for SiS30x first */
+   temp = SiS_GetReg(SiS_Pr->SiS_Part4Port,0x00);
+   if((temp == 1) || (temp == 2)) return;
+
    switch(HwInfo->jChipType) {
 #ifdef SIS300
    case SIS_540:
    case SIS_630:
    case SIS_730:
-        /* Check for SiS30x first */
-        temp = SiS_GetReg(SiS_Pr->SiS_Part4Port,0x00);
-	if((temp == 1) || (temp == 2)) return;
       	temp = SiS_GetReg(SiS_Pr->SiS_P3d4,0x37);
       	temp = (temp & 0x0E) >> 1;
-      	if((temp >= 2) && (temp <= 5)) SiS_Pr->SiS_IF_DEF_LVDS = 1;
-      	if(temp == 3)   SiS_Pr->SiS_IF_DEF_TRUMPION = 1;
+      	if((temp >= 2) && (temp <= 5)) 	SiS_Pr->SiS_IF_DEF_LVDS = 1;
+      	if(temp == 3)   		SiS_Pr->SiS_IF_DEF_TRUMPION = 1;
       	if((temp == 4) || (temp == 5)) {
 		/* Save power status (and error check) - UNUSED */
 		SiS_Pr->SiS_Backup70xx = SiS_GetCH700x(SiS_Pr, 0x0e);
@@ -1448,8 +1470,8 @@ SiSSetLVDSetc(SiS_Private *SiS_Pr, PSIS_HW_INFO HwInfo)
    case SIS_330:
         temp = SiS_GetReg(SiS_Pr->SiS_P3d4,0x37);
       	temp = (temp & 0x0E) >> 1;
-      	if((temp >= 2) && (temp <= 3)) SiS_Pr->SiS_IF_DEF_LVDS = 1;
-      	if(temp == 3)  SiS_Pr->SiS_IF_DEF_CH70xx = 2;
+      	if((temp >= 2) && (temp <= 3)) 	SiS_Pr->SiS_IF_DEF_LVDS = 1;
+      	if(temp == 3)  			SiS_Pr->SiS_IF_DEF_CH70xx = 2;
         break;
    case SIS_661:
    case SIS_741:
@@ -1457,9 +1479,9 @@ SiSSetLVDSetc(SiS_Private *SiS_Pr, PSIS_HW_INFO HwInfo)
    case SIS_760:
         temp = SiS_GetReg(SiS_Pr->SiS_P3d4,0x38);
       	temp = (temp & 0xe0) >> 5;
-      	if((temp >= 2) && (temp <= 3)) SiS_Pr->SiS_IF_DEF_LVDS = 1;
-      	if(temp == 3)  SiS_Pr->SiS_IF_DEF_CH70xx = 2;
-	if(temp == 4)  SiS_Pr->SiS_IF_DEF_CONEX = 1;  /* Not yet supported */
+      	if((temp >= 2) && (temp <= 3)) 	SiS_Pr->SiS_IF_DEF_LVDS = 1;
+      	if(temp == 3)  			SiS_Pr->SiS_IF_DEF_CH70xx = 2;
+	if(temp == 4)  			SiS_Pr->SiS_IF_DEF_CONEX = 1;  /* Not yet supported */
         break;
 #endif
    default:
@@ -1487,44 +1509,78 @@ SiS_SetEnableFstn(SiS_Private *SiS_Pr, int enable)
 /*        HELPER: Determine ROM usage        */
 /*********************************************/
 
+BOOLEAN
+SiSDetermineROMLayout661(SiS_Private *SiS_Pr, PSIS_HW_INFO HwInfo)
+{
+   UCHAR  *ROMAddr  = HwInfo->pjVirtualRomBase;
+   USHORT romversoffs, romvmaj = 1, romvmin = 0;
+
+   if(HwInfo->jChipType >= SIS_661) {
+      if((ROMAddr[0x1a] == 'N') &&
+         (ROMAddr[0x1b] == 'e') &&
+         (ROMAddr[0x1c] == 'w') &&
+         (ROMAddr[0x1d] == 'V')) {
+	 return TRUE;
+      }
+      romversoffs = ROMAddr[0x16] | (ROMAddr[0x17] << 8);
+      if(romversoffs) {
+	 if((ROMAddr[romversoffs+1] == '.') || (ROMAddr[romversoffs+4] == '.')) {
+	    romvmaj = ROMAddr[romversoffs] - '0';
+	    romvmin = ((ROMAddr[romversoffs+2] -'0') * 10) + (ROMAddr[romversoffs+3] - '0');
+	 }
+      }
+      if((romvmaj != 0) || (romvmin >= 92)) {
+	 return TRUE;
+      }
+   } else if(IS_SIS650740) {
+      if((ROMAddr[0x1a] == 'N') &&
+         (ROMAddr[0x1b] == 'e') &&
+         (ROMAddr[0x1c] == 'w') &&
+         (ROMAddr[0x1d] == 'V')) {
+	 return TRUE;
+      }
+   }
+   return FALSE;
+}
+
 static void
 SiSDetermineROMUsage(SiS_Private *SiS_Pr, PSIS_HW_INFO HwInfo)
 {
    UCHAR  *ROMAddr  = HwInfo->pjVirtualRomBase;
+   USHORT romptr = 0;
+
+   SiS_Pr->SiS_UseROM = FALSE;
+   SiS_Pr->SiS_ROMNew = FALSE;
 
    if((ROMAddr) && (HwInfo->UseROM)) {
-      if((ROMAddr[0x00] != 0x55) || (ROMAddr[0x01] != 0xAA)) {
-         SiS_Pr->SiS_UseROM = FALSE;
-      } else if(HwInfo->jChipType == SIS_300) {
-        /* 300: We check if the code starts below 0x220 by
-	 * checking the jmp instruction at the beginning
-	 * of the BIOS image.
-	 */
-	 if((ROMAddr[3] == 0xe9) &&
-	    ((ROMAddr[5] << 8) | ROMAddr[4]) > 0x21a)
+      if(HwInfo->jChipType == SIS_300) {
+         /* 300: We check if the code starts below 0x220 by
+	  * checking the jmp instruction at the beginning
+	  * of the BIOS image.
+	  */
+	 if((ROMAddr[3] == 0xe9) && ((ROMAddr[5] << 8) | ROMAddr[4]) > 0x21a)
 	    SiS_Pr->SiS_UseROM = TRUE;
-	 else
-	    SiS_Pr->SiS_UseROM = FALSE;
       } else if(HwInfo->jChipType < SIS_315H) {
-#if 0
-        /* Rest of 300 series: We don't use the ROM image if
-	 * the BIOS version < 2.0.0 as such old BIOSes don't
-	 * have the needed data at the expected locations.
-	 */
-         if(ROMAddr[0x06] < '2')  SiS_Pr->SiS_UseROM = FALSE;
-	 else                     SiS_Pr->SiS_UseROM = TRUE;
-#else
-	/* Sony's VAIO BIOS 1.09 follows the standard, so perhaps
-	 * the others do as well
-	 */
+	 /* Sony's VAIO BIOS 1.09 follows the standard, so perhaps
+	  * the others do as well
+	  */
 	 SiS_Pr->SiS_UseROM = TRUE;
-#endif
       } else {
-         /* 315/330 series stick to the standard */
+         /* 315/330 series stick to the standard(s) */
 	 SiS_Pr->SiS_UseROM = TRUE;
+	 if((SiS_Pr->SiS_ROMNew = SiSDetermineROMLayout661(SiS_Pr, HwInfo))) {
+	    /* Find out about LCD data table entry size */
+	    if((romptr = SISGETROMW(0x0102))) {
+	       if(ROMAddr[romptr + (32 * 16)] == 0xff)
+	          SiS_Pr->SiS661LCD2TableSize = 32;
+	       else if(ROMAddr[romptr + (34 * 16)] == 0xff)
+	          SiS_Pr->SiS661LCD2TableSize = 34;
+	       else if(ROMAddr[romptr + (36 * 16)] == 0xff)
+	          SiS_Pr->SiS661LCD2TableSize = 36;  /* 0.94 final */
+	    }
+	 }
       }
-   } else SiS_Pr->SiS_UseROM = FALSE;
-
+   }
 }
 
 /*********************************************/
@@ -1609,7 +1665,8 @@ SiS_GetVBType(SiS_Private *SiS_Pr, PSIS_HW_INFO HwInfo)
 
   SiS_Pr->SiS_VBType = 0;
 
-  if(SiS_Pr->SiS_IF_DEF_LVDS == 1) return;
+  if((SiS_Pr->SiS_IF_DEF_LVDS) || (SiS_Pr->SiS_IF_DEF_CONEX))
+     return;
 
   flag = SiS_GetReg(SiS_Pr->SiS_Part4Port,0x00);
 
@@ -1620,7 +1677,6 @@ SiS_GetVBType(SiS_Private *SiS_Pr, PSIS_HW_INFO HwInfo)
   if(flag >= 2) {
      SiS_Pr->SiS_VBType = VB_SIS302B;
   } else if(flag == 1) {
-     SiS_Pr->SiS_VBType = VB_SIS301;
      if(rev >= 0xC0) {
        	SiS_Pr->SiS_VBType = VB_SIS301C;
      } else if(rev >= 0xB0) {
@@ -1628,101 +1684,21 @@ SiS_GetVBType(SiS_Private *SiS_Pr, PSIS_HW_INFO HwInfo)
 	/* Check if 30xB DH version (no LCD support, use Panel Link instead) */
     	nolcd = SiS_GetReg(SiS_Pr->SiS_Part4Port,0x23);
         if(!(nolcd & 0x02)) SiS_Pr->SiS_VBType |= VB_NoLCD;
+     } else {
+        SiS_Pr->SiS_VBType = VB_SIS301;
      }
   }
   if(SiS_Pr->SiS_VBType & (VB_SIS301B | VB_SIS301C | VB_SIS302B)) {
-     if(rev >= 0xD0) {
-	SiS_Pr->SiS_VBType &= ~(VB_SIS301B | VB_SIS301C | VB_SIS302B | VB_NoLCD);
-	if(rev >= 0xE0) {
-	   flag = SiS_GetReg(SiS_Pr->SiS_Part4Port,0x39);
-	   if(flag == 0xff)
-	      SiS_Pr->SiS_VBType |= VB_SIS302LV;
-	   else
-	      SiS_Pr->SiS_VBType |= VB_SIS302ELV;
-	} else {
-	   SiS_Pr->SiS_VBType |= VB_SIS301LV;
-	}
+     if(rev >= 0xE0) {
+	flag = SiS_GetReg(SiS_Pr->SiS_Part4Port,0x39);
+	if(flag == 0xff) SiS_Pr->SiS_VBType = VB_SIS302LV;
+	else 	 	 SiS_Pr->SiS_VBType = VB_SIS301C;  /* VB_SIS302ELV; */
+     } else if(rev >= 0xD0) {
+	SiS_Pr->SiS_VBType = VB_SIS301LV;
      }
   }
 }
 
-/*********************************************/
-/*            HELPER: GetDRAMSize            */
-/*********************************************/
-
-#ifndef LINUX_XF86
-static ULONG
-GetDRAMSize(SiS_Private *SiS_Pr, PSIS_HW_INFO HwInfo)
-{
-  ULONG   AdapterMemorySize = 0;
-#ifdef SIS315H
-  USHORT  counter;
-#endif
-
-  switch(HwInfo->jChipType) {
-#ifdef SIS315H
-  case SIS_315H:
-  case SIS_315:
-  case SIS_315PRO:
-    	counter = SiS_GetReg(SiS_Pr->SiS_P3c4,0x14);
-	AdapterMemorySize = 1 << ((counter & 0xF0) >> 4);
-	counter >>= 2;
-	counter &= 0x03;
-	if(counter == 0x02) {
-		AdapterMemorySize += (AdapterMemorySize / 2);      /* DDR asymetric */
-	} else if(counter != 0) {
-		AdapterMemorySize <<= 1;                           /* SINGLE_CHANNEL_2_RANK or DUAL_CHANNEL_1_RANK */
-	}
-	AdapterMemorySize *= (1024*1024);
-        break;
-
-  case SIS_330:
-    	counter = SiS_GetReg(SiS_Pr->SiS_P3c4,0x14);
-	AdapterMemorySize = 1 << ((counter & 0xF0) >> 4);
-	counter &= 0x0c;
-	if(counter != 0) {
-		AdapterMemorySize <<= 1;
-	}
-	AdapterMemorySize *= (1024*1024);
-	break;
-
-  case SIS_550:
-  case SIS_650:
-  case SIS_740:
-  	counter = SiS_GetReg(SiS_Pr->SiS_P3c4,0x14) & 0x3F;
-      	counter++;
-      	AdapterMemorySize = counter * 4;
-      	AdapterMemorySize *= (1024*1024);
-	break;
-
-  case SIS_661:
-  case SIS_741:
-  case SIS_660:
-  case SIS_760:
-        counter = (SiS_GetReg(SiS_Pr->SiS_P3c4,0x79) & 0xf0) >> 4;
-	AdapterMemorySize = 1 << counter;
-      	AdapterMemorySize *= (1024*1024);
-        break;
-#endif
-
-#ifdef SIS300
-  case SIS_300:
-  case SIS_540:
-  case SIS_630:
-  case SIS_730:
-      	AdapterMemorySize = SiS_GetReg(SiS_Pr->SiS_P3c4,0x14) & 0x3F;
-      	AdapterMemorySize++;
-      	AdapterMemorySize *= (1024*1024);
-	break;
-#endif
-  default:
-        break;
-  }
-
-  return AdapterMemorySize;
-}
-#endif
-
 /*********************************************/
 /*           HELPER: Check RAM size          */
 /*********************************************/
@@ -1732,8 +1708,8 @@ static BOOLEAN
 SiS_CheckMemorySize(SiS_Private *SiS_Pr, PSIS_HW_INFO HwInfo,
                     USHORT ModeNo, USHORT ModeIdIndex)
 {
+  USHORT AdapterMemSize = HwInfo->ulVideoMemorySize / (1024*1024);
   USHORT memorysize,modeflag;
-  ULONG  temp;
 
   if(SiS_Pr->UseCustomMode) {
      modeflag = SiS_Pr->CModeFlag;
@@ -1749,11 +1725,8 @@ SiS_CheckMemorySize(SiS_Private *SiS_Pr, PSIS_HW_INFO HwInfo,
   memorysize >>= MemorySizeShift;		/* Get required memory size */
   memorysize++;
 
-  temp = GetDRAMSize(SiS_Pr, HwInfo);       	/* Get adapter memory size (in MB) */
-  temp /= (1024*1024);
-
-  if(temp < memorysize) return(FALSE);
-  else return(TRUE);
+  if(AdapterMemSize < memorysize) return FALSE;
+  return TRUE;
 }
 #endif
 
@@ -1767,11 +1740,14 @@ SiS_Get310DRAMType(SiS_Private *SiS_Pr, PSIS_HW_INFO HwInfo)
 {
    UCHAR data, temp;
 
-   if(*SiS_Pr->pSiS_SoftSetting & SoftDRAMType) {
-     data = *SiS_Pr->pSiS_SoftSetting & 0x03;
+   if((*SiS_Pr->pSiS_SoftSetting) & SoftDRAMType) {
+     data = (*SiS_Pr->pSiS_SoftSetting) & 0x03;
    } else {
      if(HwInfo->jChipType >= SIS_661) {
         data = SiS_GetReg(SiS_Pr->SiS_P3d4,0x78) & 0x07;
+	if(SiS_Pr->SiS_ROMNew) {
+	   data = ((SiS_GetReg(SiS_Pr->SiS_P3d4,0x78) & 0xc0) >> 6);
+	}
      } else if(IS_SIS550650740) {
         data = SiS_GetReg(SiS_Pr->SiS_P3c4,0x13) & 0x07;
      } else {	/* 315, 330 */
@@ -1798,10 +1774,14 @@ SiS_Get310DRAMType(SiS_Private *SiS_Pr, PSIS_HW_INFO HwInfo)
 USHORT
 SiS_GetMCLK(SiS_Private *SiS_Pr, PSIS_HW_INFO HwInfo)
 {
+  UCHAR  *ROMAddr  = HwInfo->pjVirtualRomBase;
   USHORT index;
 
   index = SiS_Get310DRAMType(SiS_Pr, HwInfo);
   if(HwInfo->jChipType >= SIS_661) {
+     if(SiS_Pr->SiS_ROMNew) {
+        return((USHORT)(SISGETROMW((0x90 + (index * 5) + 3))));
+     }
      return(SiS_Pr->SiS_MCLKData_0[index].CLOCK);
   } else if(index >= 4) {
      index -= 4;
@@ -1827,20 +1807,17 @@ SiS_ClearBuffer(SiS_Private *SiS_Pr, PSIS_HW_INFO HwInfo, USHORT ModeNo)
 
   if(SiS_Pr->SiS_ModeType >= ModeEGA) {
      if(ModeNo > 0x13) {
-        AdapterMemorySize = GetDRAMSize(SiS_Pr, HwInfo);
-        SiS_SetMemory(VideoMemoryAddress,AdapterMemorySize,0);
+        SiS_SetMemory(VideoMemoryAddress, AdapterMemorySize, 0);
      } else {
         pBuffer = (USHORT *)VideoMemoryAddress;
-        for(i=0; i<0x4000; i++)
-           pBuffer[i] = 0x0000;
+        for(i=0; i<0x4000; i++) pBuffer[i] = 0x0000;
      }
   } else {
-     pBuffer = (USHORT *)VideoMemoryAddress;
      if(SiS_Pr->SiS_ModeType < ModeCGA) {
-        for(i=0; i<0x4000; i++)
-           pBuffer[i] = 0x0720;
+        pBuffer = (USHORT *)VideoMemoryAddress;
+        for(i=0; i<0x4000; i++) pBuffer[i] = 0x0720;
      } else {
-        SiS_SetMemory(VideoMemoryAddress,0x8000,0);
+        SiS_SetMemory(VideoMemoryAddress, 0x8000, 0);
      }
   }
 }
@@ -1896,10 +1873,10 @@ SiS_GetModePtr(SiS_Private *SiS_Pr, USHORT ModeNo, USHORT ModeIdIndex)
    UCHAR index;
 
    if(ModeNo <= 0x13) {
-     	index = SiS_Pr->SiS_SModeIDTable[ModeIdIndex].St_StTableIndex;
+      index = SiS_Pr->SiS_SModeIDTable[ModeIdIndex].St_StTableIndex;
    } else {
-     	if(SiS_Pr->SiS_ModeType <= 0x02) index = 0x1B;    /* 02 -> ModeEGA  */
-     	else index = 0x0F;
+      if(SiS_Pr->SiS_ModeType <= ModeEGA) index = 0x1B;
+      else index = 0x0F;
    }
    return index;
 }
@@ -1914,7 +1891,7 @@ SiS_DoLowModeTest(SiS_Private *SiS_Pr, USHORT ModeNo, PSIS_HW_INFO HwInfo)
     USHORT temp,temp1,temp2;
 
     if((ModeNo != 0x03) && (ModeNo != 0x10) && (ModeNo != 0x12))
-       return(1);
+       return(TRUE);
     temp = SiS_GetReg(SiS_Pr->SiS_P3d4,0x11);
     SiS_SetRegOR(SiS_Pr->SiS_P3d4,0x11,0x80);
     temp1 = SiS_GetReg(SiS_Pr->SiS_P3d4,0x00);
@@ -1924,13 +1901,13 @@ SiS_DoLowModeTest(SiS_Private *SiS_Pr, USHORT ModeNo, PSIS_HW_INFO HwInfo)
     SiS_SetReg(SiS_Pr->SiS_P3d4,0x11,temp);
     if((HwInfo->jChipType >= SIS_315H) ||
        (HwInfo->jChipType == SIS_300)) {
-       if(temp2 == 0x55) return(0);
-       else return(1);
+       if(temp2 == 0x55) return(FALSE);
+       else return(TRUE);
     } else {
-       if(temp2 != 0x55) return(1);
+       if(temp2 != 0x55) return(TRUE);
        else {
           SiS_SetRegOR(SiS_Pr->SiS_P3d4,0x35,0x01);
-          return(0);
+          return(FALSE);
        }
     }
 }
@@ -1943,6 +1920,43 @@ SiS_SetLowModeTest(SiS_Private *SiS_Pr, USHORT ModeNo, PSIS_HW_INFO HwInfo)
     }
 }
 
+/*********************************************/
+/*            HELPER: ENABLE CRT1            */
+/*********************************************/
+
+static void
+SiS_SetupCR5x(SiS_Private *SiS_Pr, PSIS_HW_INFO HwInfo)
+{
+   if(SiS_Pr->SiS_VBType & VB_SIS301BLV302BLV) {
+      if(IS_SIS650) {
+	 SiS_SetRegAND(SiS_Pr->SiS_P3d4,0x51,0x1f);
+	 if(IS_SIS651) SiS_SetRegOR(SiS_Pr->SiS_P3d4,0x51,0x20);
+	 SiS_SetRegAND(SiS_Pr->SiS_P3d4,0x56,0xe7);
+      } else if(IS_SIS661741660760) {
+         SiS_SetRegAND(SiS_Pr->SiS_P3d4,0x61,0xf7);
+	 SiS_SetRegAND(SiS_Pr->SiS_P3d4,0x51,0x1f);
+	 SiS_SetRegAND(SiS_Pr->SiS_P3d4,0x56,0xe7);
+	 if(!SiS_Pr->SiS_ROMNew) {
+	    SiS_SetRegAND(SiS_Pr->SiS_P3d4,0x3a,0xef);
+	 }
+      }
+   }
+}
+
+static void
+SiS_HandleCRT1(SiS_Private *SiS_Pr)
+{
+  SiS_SetRegAND(SiS_Pr->SiS_P3d4,SiS_Pr->SiS_MyCR63,0xbf);
+#if 0
+  if(!(SiS_GetReg(SiS_Pr->SiS_P3c4,0x15) & 0x01)) {
+     if((SiS_GetReg(SiS_Pr->SiS_P3c4,0x15) & 0x0a) ||
+        (SiS_GetReg(SiS_Pr->SiS_P3c4,0x16) & 0x01)) {
+        SiS_SetRegOR(SiS_Pr->SiS_P3d4,SiS_Pr->SiS_MyCR63,0x40);
+     }
+  }
+#endif
+}
+
 /*********************************************/
 /*           HELPER: GetColorDepth           */
 /*********************************************/
@@ -1977,28 +1991,22 @@ USHORT
 SiS_GetOffset(SiS_Private *SiS_Pr,USHORT ModeNo,USHORT ModeIdIndex,
               USHORT RefreshRateTableIndex,PSIS_HW_INFO HwInfo)
 {
-  USHORT temp,colordepth,infoflag;
+  USHORT xres, temp, colordepth, infoflag;
 
   if(SiS_Pr->UseCustomMode) {
      infoflag = SiS_Pr->CInfoFlag;
-     temp = SiS_Pr->CHDisplay / 16;
+     xres = SiS_Pr->CHDisplay;
   } else {
      infoflag = SiS_Pr->SiS_RefIndex[RefreshRateTableIndex].Ext_InfoFlag;
-     temp = SiS_Pr->SiS_EModeIDTable[ModeIdIndex].Ext_ModeOffset;
-     temp = SiS_Pr->SiS_ScreenOffset[temp];
+     xres = SiS_Pr->SiS_RefIndex[RefreshRateTableIndex].XRes;
   }
 
   colordepth = SiS_GetColorDepth(SiS_Pr,ModeNo,ModeIdIndex);
 
+  temp = xres / 16;
   if(infoflag & InterlaceMode) temp <<= 1;
-
   temp *= colordepth;
-
-  if( ( ((ModeNo >= 0x26) && (ModeNo <= 0x28)) ||
-        ModeNo == 0x3f ||
-	ModeNo == 0x42 ||
-	ModeNo == 0x45 ) ||
-      (SiS_Pr->UseCustomMode && (SiS_Pr->CHDisplay % 16)) ) {
+  if(xres % 16) {
      colordepth >>= 1;
      temp += colordepth;
   }
@@ -2103,9 +2111,15 @@ SiS_SetCRTCRegs(SiS_Private *SiS_Pr, PSIS_HW_INFO HwInfo,
      CRTCdata = SiS_Pr->SiS_StandTable[StandTableIndex].CRTC[i];
      SiS_SetReg(SiS_Pr->SiS_P3d4,i,CRTCdata);                     /* Set CRTC(3d4) */
   }
-  if( ( (HwInfo->jChipType == SIS_630) ||
-        (HwInfo->jChipType == SIS_730) )  &&
-      (HwInfo->jChipRevision >= 0x30) ) {       	   /* for 630S0 */
+  if(HwInfo->jChipType >= SIS_661) {
+     SiS_SetupCR5x(SiS_Pr, HwInfo);
+     for(i = 0x13; i <= 0x14; i++) {
+        CRTCdata = SiS_Pr->SiS_StandTable[StandTableIndex].CRTC[i];
+        SiS_SetReg(SiS_Pr->SiS_P3d4,i,CRTCdata);
+     }
+  } else if( ( (HwInfo->jChipType == SIS_630) ||
+               (HwInfo->jChipType == SIS_730) )  &&
+             (HwInfo->jChipRevision >= 0x30) ) {       	   /* for 630S0 */
      if(SiS_Pr->SiS_VBInfo & SetInSlaveMode) {
         if(SiS_Pr->SiS_VBInfo & (SetCRT2ToLCD | SetCRT2ToTV)) {
            SiS_SetReg(SiS_Pr->SiS_P3d4,0x18,0xFE);
@@ -2206,7 +2220,7 @@ SiS_SetGRCRegs(SiS_Private *SiS_Pr, USHORT StandTableIndex)
 /*********************************************/
 
 static void
-SiS_ClearExt1Regs(SiS_Private *SiS_Pr, PSIS_HW_INFO HwInfo)
+SiS_ClearExt1Regs(SiS_Private *SiS_Pr, PSIS_HW_INFO HwInfo, USHORT ModeNo)
 {
   USHORT i;
 
@@ -2216,6 +2230,11 @@ SiS_ClearExt1Regs(SiS_Private *SiS_Pr, PSIS_HW_INFO HwInfo)
 
   if(HwInfo->jChipType >= SIS_315H) {
      SiS_SetRegAND(SiS_Pr->SiS_P3c4,0x37,0xFE);
+     if(ModeNo <= 0x13) {
+        if(ModeNo == 0x06 || ModeNo >= 0x0e) {
+	   SiS_SetReg(SiS_Pr->SiS_P3c4,0x0e,0x20);
+	}
+     }
   }
 }
 
@@ -2279,45 +2298,6 @@ SiS_SetCRT1Sync(SiS_Private *SiS_Pr, USHORT RefreshRateTableIndex)
 /*                  CRTC/2                   */
 /*********************************************/
 
-#ifdef SIS315H
-static void
-SiS_GetLCDACRT1Ptr(SiS_Private *SiS_Pr, USHORT ModeNo, USHORT ModeIdIndex,
-		   USHORT RefreshRateTableIndex, USHORT *ResIndex,
-		   USHORT *DisplayType)
- {
-  USHORT modeflag = 0;
-
-  if(ModeNo <= 0x13) {
-     modeflag = SiS_Pr->SiS_SModeIDTable[ModeIdIndex].St_ModeFlag;
-     *ResIndex = SiS_Pr->SiS_SModeIDTable[ModeIdIndex].St_CRT2CRTC;
-  } else {
-     modeflag = SiS_Pr->SiS_EModeIDTable[ModeIdIndex].Ext_ModeFlag;
-     *ResIndex = SiS_Pr->SiS_RefIndex[RefreshRateTableIndex].Ext_CRT2CRTC;
-  }
-
-  *ResIndex &= 0x3F;
-
-  *DisplayType = SiS_Pr->SiS_LCDResInfo;
-  if(SiS_Pr->SiS_LCDInfo & DontExpandLCD) *DisplayType += 32;
-  if(modeflag & HalfDCLK)                 *DisplayType += 16;
-
-  if(SiS_Pr->SiS_CustomT == CUT_COMPAQ1280) {
-     if(SiS_Pr->SiS_LCDResInfo == SiS_Pr->SiS_Panel1280x1024) {
-        *DisplayType = 100;
-	if(SiS_Pr->SiS_LCDInfo & DontExpandLCD) *DisplayType += 2;
-        if(modeflag & HalfDCLK)                 *DisplayType += 1;
-     }
-  } else if(SiS_Pr->SiS_CustomT == CUT_CLEVO1024) {
-     if(SiS_Pr->SiS_LCDResInfo == SiS_Pr->SiS_Panel1024x768) {
-        *DisplayType = 104;
-	if(SiS_Pr->SiS_LCDInfo & DontExpandLCD) *DisplayType += 2;
-        if(modeflag & HalfDCLK)                 *DisplayType += 1;
-     }
-  }
-
-}
-#endif
-
 static void
 SiS_SetCRT1CRTC(SiS_Private *SiS_Pr, USHORT ModeNo, USHORT ModeIdIndex,
                 USHORT RefreshRateTableIndex,
@@ -2325,10 +2305,6 @@ SiS_SetCRT1CRTC(SiS_Private *SiS_Pr, USHORT ModeNo, USHORT ModeIdIndex,
 {
   UCHAR  index;
   USHORT temp,i,j,modeflag;
-#ifdef SIS315H
-  USHORT ResIndex,DisplayType;
-  const SiS_LCDACRT1DataStruct *LCDACRT1Ptr = NULL;
-#endif
 
   SiS_SetRegAND(SiS_Pr->SiS_P3d4,0x11,0x7f);		/* unlock cr0-7 */
 
@@ -2336,7 +2312,7 @@ SiS_SetCRT1CRTC(SiS_Private *SiS_Pr, USHORT ModeNo, USHORT ModeIdIndex,
 
      modeflag = SiS_Pr->CModeFlag;
 
-     for(i=0,j=0;i<=07;i++,j++) {
+     for(i=0,j=0;i<=7;i++,j++) {
         SiS_SetReg(SiS_Pr->SiS_P3d4,j,SiS_Pr->CCRT1CRTC[i]);
      }
      for(j=0x10;i<=10;i++,j++) {
@@ -2354,7 +2330,7 @@ SiS_SetCRT1CRTC(SiS_Private *SiS_Pr, USHORT ModeNo, USHORT ModeIdIndex,
 
      temp = (SiS_Pr->CCRT1CRTC[16] & 0x01) << 5;
      if(modeflag & DoubleScanMode) temp |= 0x80;
-     SiS_SetRegANDOR(SiS_Pr->SiS_P3d4,0x09,0xDF,temp);
+     SiS_SetRegANDOR(SiS_Pr->SiS_P3d4,0x09,0x5F,temp);
 
   } else {
 
@@ -2364,87 +2340,28 @@ SiS_SetCRT1CRTC(SiS_Private *SiS_Pr, USHORT ModeNo, USHORT ModeIdIndex,
         modeflag = SiS_Pr->SiS_EModeIDTable[ModeIdIndex].Ext_ModeFlag;
      }
 
-     if((SiS_Pr->SiS_VBType & VB_SISVB) && (SiS_Pr->SiS_VBInfo & SetCRT2ToLCDA)) {
-
-#ifdef SIS315H
-
-        SiS_GetLCDACRT1Ptr(SiS_Pr, ModeNo, ModeIdIndex, RefreshRateTableIndex, &ResIndex, &DisplayType);
-
-        switch(DisplayType) {
-        case Panel_1024x768      : LCDACRT1Ptr = SiS_Pr->SiS_LCDACRT11024x768_1;     break;
-        case Panel_1280x1024     : LCDACRT1Ptr = SiS_Pr->SiS_LCDACRT11280x1024_1;    break;
-        case Panel_1400x1050     : LCDACRT1Ptr = SiS_Pr->SiS_LCDACRT11400x1050_1;    break;
-        case Panel_1600x1200     : LCDACRT1Ptr = SiS_Pr->SiS_LCDACRT11600x1200_1;    break;
-        case Panel_1024x768  + 16: LCDACRT1Ptr = SiS_Pr->SiS_LCDACRT11024x768_1_H;   break;
-        case Panel_1280x1024 + 16: LCDACRT1Ptr = SiS_Pr->SiS_LCDACRT11280x1024_1_H;  break;
-        case Panel_1400x1050 + 16: LCDACRT1Ptr = SiS_Pr->SiS_LCDACRT11400x1050_1_H;  break;
-        case Panel_1600x1200 + 16: LCDACRT1Ptr = SiS_Pr->SiS_LCDACRT11600x1200_1_H;  break;
-        case Panel_1024x768  + 32: LCDACRT1Ptr = SiS_Pr->SiS_LCDACRT11024x768_2;     break;
-        case Panel_1280x1024 + 32: LCDACRT1Ptr = SiS_Pr->SiS_LCDACRT11280x1024_2;    break;
-        case Panel_1400x1050 + 32: LCDACRT1Ptr = SiS_Pr->SiS_LCDACRT11400x1050_2;    break;
-        case Panel_1600x1200 + 32: LCDACRT1Ptr = SiS_Pr->SiS_LCDACRT11600x1200_2;    break;
-        case Panel_1024x768  + 48: LCDACRT1Ptr = SiS_Pr->SiS_LCDACRT11024x768_2_H;   break;
-        case Panel_1280x1024 + 48: LCDACRT1Ptr = SiS_Pr->SiS_LCDACRT11280x1024_2_H;  break;
-        case Panel_1400x1050 + 48: LCDACRT1Ptr = SiS_Pr->SiS_LCDACRT11400x1050_2_H;  break;
-        case Panel_1600x1200 + 48: LCDACRT1Ptr = SiS_Pr->SiS_LCDACRT11600x1200_2_H;  break;
-        case 100:	  	   LCDACRT1Ptr = Compaq1280x1024_LCDACRT1_1;         break;
-        case 101:		   LCDACRT1Ptr = Compaq1280x1024_LCDACRT1_1_H;       break;
-        case 102:		   LCDACRT1Ptr = SiS_Pr->SiS_LCDACRT11280x1024_2;    break;
-        case 103:		   LCDACRT1Ptr = SiS_Pr->SiS_LCDACRT11280x1024_2_H;  break;
-        case 104:		   LCDACRT1Ptr = Clevo1024x768_LCDACRT1_1;           break;
-        case 105:		   LCDACRT1Ptr = Clevo1024x768_LCDACRT1_1_H;         break;
-        case 106:		   LCDACRT1Ptr = Clevo1024x768_LCDACRT1_2;           break;
-        case 107:		   LCDACRT1Ptr = Clevo1024x768_LCDACRT1_2_H;         break;
-        default:                   LCDACRT1Ptr = SiS_Pr->SiS_LCDACRT11024x768_1;     break;
-        }
+     index = SiS_Pr->SiS_RefIndex[RefreshRateTableIndex].Ext_CRT1CRTC;
 
-        for(i=0, j=0; i<=0x07; i++, j++) {
-           SiS_SetReg(SiS_Pr->SiS_P3d4,i,(LCDACRT1Ptr+ResIndex)->CR[j]);
-        }
-        for(i=0x10, j=8; i<=0x12; i++, j++) {
-           SiS_SetReg(SiS_Pr->SiS_P3d4,i,(LCDACRT1Ptr+ResIndex)->CR[j]);
-        }
-        for(i=0x15, j=11; i<=0x16; i++, j++) {
-           SiS_SetReg(SiS_Pr->SiS_P3d4,i,(LCDACRT1Ptr+ResIndex)->CR[j]);
-        }
-        for(i=0x0A, j=13; i<=0x0C; i++, j++) {
-           SiS_SetReg(SiS_Pr->SiS_P3c4,i,(LCDACRT1Ptr+ResIndex)->CR[j]);
-        }
-
-        temp = (LCDACRT1Ptr+ResIndex)->CR[16] & 0xE0;
-        SiS_SetReg(SiS_Pr->SiS_P3c4,0x0E,temp);
-
-        temp = ((LCDACRT1Ptr+ResIndex)->CR[16] & 0x01) << 5;
-        if(modeflag & DoubleScanMode) temp |= 0x80;
-        SiS_SetRegANDOR(SiS_Pr->SiS_P3d4,0x09,0xDF,temp);
-
-#endif
-
-     } else {
-
-        index = SiS_Pr->SiS_RefIndex[RefreshRateTableIndex].Ext_CRT1CRTC;
-
-        for(i=0,j=0;i<=07;i++,j++) {
-          SiS_SetReg(SiS_Pr->SiS_P3d4,j,SiS_Pr->SiS_CRT1Table[index].CR[i]);
-        }
-        for(j=0x10;i<=10;i++,j++) {
-          SiS_SetReg(SiS_Pr->SiS_P3d4,j,SiS_Pr->SiS_CRT1Table[index].CR[i]);
-        }
-        for(j=0x15;i<=12;i++,j++) {
-          SiS_SetReg(SiS_Pr->SiS_P3d4,j,SiS_Pr->SiS_CRT1Table[index].CR[i]);
-        }
-        for(j=0x0A;i<=15;i++,j++) {
-          SiS_SetReg(SiS_Pr->SiS_P3c4,j,SiS_Pr->SiS_CRT1Table[index].CR[i]);
-        }
+     for(i=0,j=0;i<=7;i++,j++) {
+        SiS_SetReg(SiS_Pr->SiS_P3d4,j,SiS_Pr->SiS_CRT1Table[index].CR[i]);
+     }
+     for(j=0x10;i<=10;i++,j++) {
+        SiS_SetReg(SiS_Pr->SiS_P3d4,j,SiS_Pr->SiS_CRT1Table[index].CR[i]);
+     }
+     for(j=0x15;i<=12;i++,j++) {
+        SiS_SetReg(SiS_Pr->SiS_P3d4,j,SiS_Pr->SiS_CRT1Table[index].CR[i]);
+     }
+     for(j=0x0A;i<=15;i++,j++) {
+        SiS_SetReg(SiS_Pr->SiS_P3c4,j,SiS_Pr->SiS_CRT1Table[index].CR[i]);
+     }
 
-        temp = SiS_Pr->SiS_CRT1Table[index].CR[16] & 0xE0;
-        SiS_SetReg(SiS_Pr->SiS_P3c4,0x0E,temp);
+     temp = SiS_Pr->SiS_CRT1Table[index].CR[16] & 0xE0;
+     SiS_SetReg(SiS_Pr->SiS_P3c4,0x0E,temp);
 
-        temp = ((SiS_Pr->SiS_CRT1Table[index].CR[16]) & 0x01) << 5;
-        if(modeflag & DoubleScanMode)  temp |= 0x80;
-        SiS_SetRegANDOR(SiS_Pr->SiS_P3d4,0x09,0xDF,temp);
+     temp = ((SiS_Pr->SiS_CRT1Table[index].CR[16]) & 0x01) << 5;
+     if(modeflag & DoubleScanMode)  temp |= 0x80;
+     SiS_SetRegANDOR(SiS_Pr->SiS_P3d4,0x09,0x5F,temp);
 
-     }
   }
 
   if(SiS_Pr->SiS_ModeType > ModeVGA) SiS_SetReg(SiS_Pr->SiS_P3d4,0x14,0x4F);
@@ -2482,7 +2399,7 @@ SiS_SetCRT1Offset(SiS_Private *SiS_Pr, USHORT ModeNo, USHORT ModeIdIndex,
 
    DisplayUnit <<= 5;
    temp = (DisplayUnit & 0xff00) >> 8;
-   if (DisplayUnit & 0xff) temp++;
+   if(DisplayUnit & 0xff) temp++;
    temp++;
    SiS_SetReg(SiS_Pr->SiS_P3c4,0x10,temp);
 }
@@ -2917,7 +2834,8 @@ SiS_SetCRT1FIFO_310(SiS_Private *SiS_Pr, USHORT ModeNo, USHORT ModeIdIndex,
 {
   USHORT modeflag;
 
-  SiS_SetRegAND(SiS_Pr->SiS_P3c4,0x3D,0xFE);  /* disable auto-threshold */
+  /* disable auto-threshold */
+  SiS_SetRegAND(SiS_Pr->SiS_P3c4,0x3D,0xFE);
 
   if(SiS_Pr->UseCustomMode) {
      modeflag = SiS_Pr->CModeFlag;
@@ -2925,30 +2843,19 @@ SiS_SetCRT1FIFO_310(SiS_Private *SiS_Pr, USHORT ModeNo, USHORT ModeIdIndex,
      modeflag = SiS_Pr->SiS_EModeIDTable[ModeIdIndex].Ext_ModeFlag;
   }
 
-  if(HwInfo->jChipType >= SIS_661) {
-     SiS_SetReg(SiS_Pr->SiS_P3c4,0x08,0xAE);
-     SiS_SetRegAND(SiS_Pr->SiS_P3c4,0x09,0xF0);
-     if(ModeNo > 0x13) {
+  SiS_SetReg(SiS_Pr->SiS_P3c4,0x08,0xAE);
+  SiS_SetRegAND(SiS_Pr->SiS_P3c4,0x09,0xF0);
+  if(ModeNo > 0x13) {
+     if(HwInfo->jChipType >= SIS_661) {
         if(!(modeflag & HalfDCLK)) {
 	   SiS_SetReg(SiS_Pr->SiS_P3c4,0x08,0x34);
-	   if(ModeNo != 0x38) {
-	      SiS_SetRegOR(SiS_Pr->SiS_P3c4,0x3D,0x01);
-	   }
+	   SiS_SetRegOR(SiS_Pr->SiS_P3c4,0x3D,0x01);
 	}
-     }
-  } else {
-     if(ModeNo > 0x13) {
-        if( (!(modeflag & DoubleScanMode)) || (!(modeflag & HalfDCLK))) {
+     } else {
+        if((!(modeflag & DoubleScanMode)) || (!(modeflag & HalfDCLK))) {
            SiS_SetReg(SiS_Pr->SiS_P3c4,0x08,0x34);
-           SiS_SetRegAND(SiS_Pr->SiS_P3c4,0x09,0xF0);
            SiS_SetRegOR(SiS_Pr->SiS_P3c4,0x3D,0x01);
-        } else {
-           SiS_SetReg(SiS_Pr->SiS_P3c4,0x08,0xAE);
-           SiS_SetRegAND(SiS_Pr->SiS_P3c4,0x09,0xF0);
-        }
-     } else {
-        SiS_SetReg(SiS_Pr->SiS_P3c4,0x08,0xAE);
-        SiS_SetRegAND(SiS_Pr->SiS_P3c4,0x09,0xF0);
+	}
      }
   }
 }
@@ -2963,33 +2870,29 @@ SiS_SetVCLKState(SiS_Private *SiS_Pr, PSIS_HW_INFO HwInfo,
                  USHORT ModeNo, USHORT RefreshRateTableIndex,
                  USHORT ModeIdIndex)
 {
-  USHORT data, data2=0;
-  USHORT VCLK, index=0;
+  USHORT data=0, VCLK=0, index=0;
 
-  if(ModeNo <= 0x13) VCLK = 0;
-  else {
+  if(ModeNo > 0x13) {
      if(SiS_Pr->UseCustomMode) {
         VCLK = SiS_Pr->CSRClock;
      } else {
         index = SiS_GetVCLK2Ptr(SiS_Pr,ModeNo,ModeIdIndex,
-	               RefreshRateTableIndex,HwInfo);
+	                      RefreshRateTableIndex,HwInfo);
         VCLK = SiS_Pr->SiS_VCLKData[index].CLOCK;
      }
   }
 
-  if(HwInfo->jChipType < SIS_315H) {		/* 300 series */
+  if(HwInfo->jChipType < SIS_315H) {
 
-     data2 = 0x00;
-     if(VCLK > 150) data2 |= 0x80;
-     SiS_SetRegANDOR(SiS_Pr->SiS_P3c4,0x07,0x7B,data2);
+     if(VCLK > 150) data |= 0x80;
+     SiS_SetRegANDOR(SiS_Pr->SiS_P3c4,0x07,0x7B,data);
 
-     data2 = 0x00;
-     if(VCLK >= 150) data2 |= 0x08;
-     SiS_SetRegANDOR(SiS_Pr->SiS_P3c4,0x32,0xF7,data2);
+     data = 0x00;
+     if(VCLK >= 150) data |= 0x08;
+     SiS_SetRegANDOR(SiS_Pr->SiS_P3c4,0x32,0xF7,data);
 
-  } else { 					/* 315 series */
+  } else {
 
-     data = 0;
      if(VCLK >= 166) data |= 0x0c;
      SiS_SetRegANDOR(SiS_Pr->SiS_P3c4,0x32,0xf3,data);
 
@@ -2998,23 +2901,31 @@ SiS_SetVCLKState(SiS_Private *SiS_Pr, PSIS_HW_INFO HwInfo,
      }
   }
 
-  data2 = 0x03;
-  if((VCLK >= 135) && (VCLK < 160))      data2 = 0x02;
-  else if((VCLK >= 160) && (VCLK < 260)) data2 = 0x01;
-  else if(VCLK >= 260)                   data2 = 0x00;
+  /* DAC speed */
+  if(HwInfo->jChipType >= SIS_661) {
 
-  if(HwInfo->jChipType == SIS_540) {
-     if((VCLK == 203) || (VCLK < 234)) data2 = 0x02;
-  }
+     SiS_SetRegANDOR(SiS_Pr->SiS_P3c4,0x07,0xE8,0x10);
 
-  if(HwInfo->jChipType < SIS_315H) {
-     SiS_SetRegANDOR(SiS_Pr->SiS_P3c4,0x07,0xFC,data2);  	/* DAC speed */
   } else {
-     if(HwInfo->jChipType > SIS_315PRO) {
-        /* This "if" is done in 330 and 650/LVDS/301LV BIOSes; Not in 315 BIOS */
-        if(ModeNo > 0x13) data2 &= 0xfc;
+
+     data = 0x03;
+     if((VCLK >= 135) && (VCLK < 160))      data = 0x02;
+     else if((VCLK >= 160) && (VCLK < 260)) data = 0x01;
+     else if(VCLK >= 260)                   data = 0x00;
+
+     if(HwInfo->jChipType == SIS_540) {
+        if((VCLK == 203) || (VCLK < 234))   data = 0x02;
+     }
+
+     if(HwInfo->jChipType < SIS_315H) {
+        SiS_SetRegANDOR(SiS_Pr->SiS_P3c4,0x07,0xFC,data);
+     } else {
+        if(HwInfo->jChipType > SIS_315PRO) {
+           if(ModeNo > 0x13) data &= 0xfc;
+        }
+        SiS_SetRegANDOR(SiS_Pr->SiS_P3c4,0x07,0xF8,data);
      }
-     SiS_SetRegANDOR(SiS_Pr->SiS_P3c4,0x07,0xF8,data2);  	/* DAC speed */
+
   }
 }
 
@@ -3022,75 +2933,51 @@ static void
 SiS_SetCRT1ModeRegs(SiS_Private *SiS_Pr, PSIS_HW_INFO HwInfo,
                     USHORT ModeNo,USHORT ModeIdIndex,USHORT RefreshRateTableIndex)
 {
-  USHORT data,data2;
-  USHORT infoflag=0,modeflag;
+  USHORT data,infoflag=0,modeflag;
   USHORT resindex,xres;
 #ifdef SIS315H
-  USHORT data3;
+  USHORT data2,data3;
   ULONG  longdata;
-#if 0
-  resinfo = 0;
-#endif
+  UCHAR  *ROMAddr  = HwInfo->pjVirtualRomBase;
 #endif
 
   if(SiS_Pr->UseCustomMode) {
      modeflag = SiS_Pr->CModeFlag;
      infoflag = SiS_Pr->CInfoFlag;
+     xres = SiS_Pr->CHDisplay;
   } else {
+     resindex = SiS_GetResInfo(SiS_Pr,ModeNo,ModeIdIndex);
      if(ModeNo > 0x13) {
     	modeflag = SiS_Pr->SiS_EModeIDTable[ModeIdIndex].Ext_ModeFlag;
     	infoflag = SiS_Pr->SiS_RefIndex[RefreshRateTableIndex].Ext_InfoFlag;
-#ifdef SIS315H
-#if 0
-	resinfo = SiS_Pr->SiS_EModeIDTable[ModeIdIndex].Ext_RESINFO;
-#endif
-#endif
+	xres = SiS_Pr->SiS_ModeResInfo[resindex].HTotal;
      } else {
     	modeflag = SiS_Pr->SiS_SModeIDTable[ModeIdIndex].St_ModeFlag;
+	xres = SiS_Pr->SiS_StResInfo[resindex].HTotal;
      }
   }
 
   /* Disable DPMS */
   SiS_SetRegAND(SiS_Pr->SiS_P3c4,0x1F,0x3F);
 
-  if(ModeNo > 0x13) data = infoflag;
-  else data = 0;
-
-  data2 = 0;
+  data = 0;
   if(ModeNo > 0x13) {
-     if(SiS_Pr->SiS_ModeType > 0x02) {
-        data2 |= 0x02;
-        data2 |= ((SiS_Pr->SiS_ModeType - ModeVGA) << 2);
-     }
-  }
-
-#ifdef TWDEBUG
-  xf86DrvMsg(0, X_INFO, "Debug: Mode infoflag = %x, Chiptype %d\n",
-  	data, HwInfo->jChipType);
-#endif
-
-  if(data & InterlaceMode) data2 |= 0x20;
-  SiS_SetRegANDOR(SiS_Pr->SiS_P3c4,0x06,0xC0,data2);
-
-  if(SiS_Pr->UseCustomMode) {
-     xres = SiS_Pr->CHDisplay;
-  } else {
-     resindex = SiS_GetResInfo(SiS_Pr,ModeNo,ModeIdIndex);
-     if(ModeNo <= 0x13) {
-      	xres = SiS_Pr->SiS_StResInfo[resindex].HTotal;
-     } else {
-      	xres = SiS_Pr->SiS_ModeResInfo[resindex].HTotal;
+     if(SiS_Pr->SiS_ModeType > ModeEGA) {
+        data |= 0x02;
+        data |= ((SiS_Pr->SiS_ModeType - ModeVGA) << 2);
      }
+     if(infoflag & InterlaceMode) data |= 0x20;
   }
+  SiS_SetRegANDOR(SiS_Pr->SiS_P3c4,0x06,0xC0,data);
 
   if(HwInfo->jChipType != SIS_300) {
-     data = 0x0000;
+     data = 0;
      if(infoflag & InterlaceMode) {
-        if(xres <= 800) data = 0x0020;
+        if(xres <= 800)       data = 0x0020;
         else if(xres <= 1024) data = 0x0035;
-        else data = 0x0048;
+        else                  data = 0x0048;
      }
-     SiS_SetReg(SiS_Pr->SiS_P3d4,0x19,(data & 0x00FF));
+     SiS_SetReg(SiS_Pr->SiS_P3d4,0x19,(data & 0xFF));
      SiS_SetRegANDOR(SiS_Pr->SiS_P3d4,0x1a,0xFC,(data >> 8));
   }
 
@@ -3098,18 +2985,12 @@ SiS_SetCRT1ModeRegs(SiS_Private *SiS_Pr, PSIS_HW_INFO HwInfo,
      SiS_SetRegOR(SiS_Pr->SiS_P3c4,0x01,0x08);
   }
 
+  data = 0;
+  if(modeflag & LineCompareOff) data = 0x08;
   if(HwInfo->jChipType == SIS_300) {
-     if(modeflag & LineCompareOff) {
-        SiS_SetRegOR(SiS_Pr->SiS_P3c4,0x0F,0x08);
-     } else {
-        SiS_SetRegAND(SiS_Pr->SiS_P3c4,0x0F,0xF7);
-     }
+     SiS_SetRegANDOR(SiS_Pr->SiS_P3c4,0x0F,0xF7,data);
   } else {
-     if(modeflag & LineCompareOff) {
-        SiS_SetRegANDOR(SiS_Pr->SiS_P3c4,0x0F,0xB7,0x08);
-     } else {
-        SiS_SetRegAND(SiS_Pr->SiS_P3c4,0x0F,0xB7);
-     }
+     SiS_SetRegANDOR(SiS_Pr->SiS_P3c4,0x0F,0xB7,data);
      if(SiS_Pr->SiS_ModeType == ModeEGA) {
         if(ModeNo > 0x13) {
   	   SiS_SetRegOR(SiS_Pr->SiS_P3c4,0x0F,0x40);
@@ -3117,9 +2998,13 @@ SiS_SetCRT1ModeRegs(SiS_Private *SiS_Pr, PSIS_HW_INFO HwInfo,
      }
   }
 
+  if(HwInfo->jChipType >= SIS_661) {
+     SiS_SetRegAND(SiS_Pr->SiS_P3c4,0x31,0xfb);
+  }
+
 #ifdef SIS315H
-  /* 315 BIOS sets SR17 at this point */
   if(HwInfo->jChipType == SIS_315PRO) {
+
      data = SiS_Get310DRAMType(SiS_Pr, HwInfo);
      data = SiS_Pr->SiS_SR15[2][data];
      if(SiS_Pr->SiS_ModeType == ModeText) {
@@ -3138,12 +3023,18 @@ SiS_SetCRT1ModeRegs(SiS_Private *SiS_Pr, PSIS_HW_INFO HwInfo,
 	}
      }
      SiS_SetReg(SiS_Pr->SiS_P3c4,0x17,data);
-  }
 
-  /* 330 BIOS sets SR17 at this point */
-  if(HwInfo->jChipType == SIS_330) {
+  } else if( (HwInfo->jChipType == SIS_330) ||
+             ((HwInfo->jChipType == SIS_760) && (SiS_Pr->SiS_SysFlags & SF_760LFB))) {
+
      data = SiS_Get310DRAMType(SiS_Pr, HwInfo);
-     data = SiS_Pr->SiS_SR15[2][data];
+     if(HwInfo->jChipType == SIS_330) {
+        data = SiS_Pr->SiS_SR15[2][data];
+     } else {
+        if(SiS_Pr->SiS_ROMNew) 	    data = ROMAddr[0xf6];
+        else if(SiS_Pr->SiS_UseROM) data = ROMAddr[0x100 + data];
+	else                        data = 0xba;
+     }
      if(SiS_Pr->SiS_ModeType <= ModeEGA) {
         data &= 0xc7;
      } else {
@@ -3156,31 +3047,38 @@ SiS_SetCRT1ModeRegs(SiS_Private *SiS_Pr, PSIS_HW_INFO HwInfo,
 	}
 
 	data3 = SiS_GetColorDepth(SiS_Pr,ModeNo,ModeIdIndex) >> 1;
-	if(!data3) data3++;
-
-	data2 *= data3;
+	if(data3) data2 *= data3;
 
 	longdata = SiS_GetMCLK(SiS_Pr, HwInfo) * 1024;
 
 	data2 = longdata / data2;
 
-	if(SiS_Pr->SiS_ModeType != Mode16Bpp) {
-           if(data2 >= 0x19c)      data = 0xba;
-	   else if(data2 >= 0x140) data = 0x7a;
-	   else if(data2 >= 0x101) data = 0x3a;
-	   else if(data2 >= 0xf5)  data = 0x32;
-	   else if(data2 >= 0xe2)  data = 0x2a;
-	   else if(data2 >= 0xc4)  data = 0x22;
-	   else if(data2 >= 0xac)  data = 0x1a;
-	   else if(data2 >= 0x9e)  data = 0x12;
-	   else if(data2 >= 0x8e)  data = 0x0a;
+	if(HwInfo->jChipType == SIS_330) {
+	   if(SiS_Pr->SiS_ModeType != Mode16Bpp) {
+              if     (data2 >= 0x19c) data = 0xba;
+	      else if(data2 >= 0x140) data = 0x7a;
+	      else if(data2 >= 0x101) data = 0x3a;
+	      else if(data2 >= 0xf5)  data = 0x32;
+	      else if(data2 >= 0xe2)  data = 0x2a;
+	      else if(data2 >= 0xc4)  data = 0x22;
+	      else if(data2 >= 0xac)  data = 0x1a;
+	      else if(data2 >= 0x9e)  data = 0x12;
+	      else if(data2 >= 0x8e)  data = 0x0a;
+	      else                    data = 0x02;
+	   } else {
+	      if(data2 >= 0x127)      data = 0xba;
+	      else                    data = 0x7a;
+	   }
+	} else {  /* 760+LFB */
+	   if     (data2 >= 0x190) data = 0xba;
+	   else if(data2 >= 0xff)  data = 0x7a;
+	   else if(data2 >= 0xd3)  data = 0x3a;
+	   else if(data2 >= 0xa9)  data = 0x1a;
+	   else if(data2 >= 0x93)  data = 0x0a;
 	   else                    data = 0x02;
-	 } else {
-	   if(data2 >= 0x127)      data = 0xba;
-	   else                    data = 0x7a;
-	 }
-      }
-      SiS_SetReg(SiS_Pr->SiS_P3c4,0x17,data);
+	}
+     }
+     SiS_SetReg(SiS_Pr->SiS_P3c4,0x17,data);
   }
 #endif
 
@@ -3202,46 +3100,6 @@ SiS_SetCRT1ModeRegs(SiS_Private *SiS_Pr, PSIS_HW_INFO HwInfo,
      } else {
         SiS_SetReg(SiS_Pr->SiS_P3d4,0x52,0x6c);
      }
-#if 0   /* What is SR0E[D5:6]? */
-     if(HwInfo->jChipType >= SIS_661) {
-        data = 0;
-        if((ModeNo == 6) || ((ModeNo >= 0x0e) && (ModeNo <= 0x13))) {
-	   data |= 0x20;
-	}
-	if(SiS_Pr->SiS_ModeType != ModeVGA) {
-	   if(SiS_Pr->UseCustomMode) {
-              if((xres >= 640) && (SiS_Pr->CVDisplay >= 480)) {
-	         data |= 0x40;
-	      }
-	      if((xres > 1280) && (SiS_Pr->CVDisplay > 1024)) {
-	         data |= 0x60;
-	      }
-	   }
-	} else if(ModeNo > 0x13) {   /* These are in the CRT1 table, and set by CRT1CRTC */
-	   if(resinfo >= SIS_RI_640x480) {
-	      if(resinfo <= SIS_RI_2048x1536) {
-	         data |= 0x40;
-		 if(resinfo > SIS_RI_1280x1024) {
-		    data |= 0x60;
-		    if(resinfo != SIS_RI_1600x1200) {
-		       data = SiS_GetReg(SiS_Pr->SiS_P3c4,0x0e);
-		       data += 0x60;
-		       SiS_SetReg(SiS_Pr->SiS_P3c4,0x0e);
-		       data = 0;
-		    }
-		 }
-	      }
-	      if(resinfo == SIS_RI_1152x864) {
-		 data = 0x40;
-	      }
-	      if(resinfo == SIS_RI_1400x1050) { /* TW */
-		 data = 0x60;
-	      }
-	   }
-	}
-	SiS_SetRegOR(SiS_Pr->SiS_P3c4,0x0e,data);
-     }
-#endif
   }
 #endif
 }
@@ -3416,7 +3274,7 @@ SiS_SetCRT1Group(SiS_Private *SiS_Pr, PSIS_HW_INFO HwInfo,
   SiS_SetCRTCRegs(SiS_Pr, HwInfo, StandTableIndex);
   SiS_SetATTRegs(SiS_Pr, StandTableIndex, HwInfo);
   SiS_SetGRCRegs(SiS_Pr, StandTableIndex);
-  SiS_ClearExt1Regs(SiS_Pr,HwInfo);
+  SiS_ClearExt1Regs(SiS_Pr, HwInfo, ModeNo);
   SiS_ResetCRT1VCLK(SiS_Pr, HwInfo);
 
   SiS_Pr->SiS_SelectCRT2Rate = 0;
@@ -3482,21 +3340,28 @@ SiS_SetCRT1Group(SiS_Private *SiS_Pr, PSIS_HW_INFO HwInfo,
 }
 
 /*********************************************/
-/*            HELPER: ENABLE CRT1            */
+/*         HELPER: RESET VIDEO BRIDGE        */
 /*********************************************/
 
 static void
-SiS_HandleCRT1(SiS_Private *SiS_Pr)
+SiS_ResetVB(SiS_Private *SiS_Pr, PSIS_HW_INFO HwInfo)
 {
-  SiS_SetRegAND(SiS_Pr->SiS_P3d4,SiS_Pr->SiS_MyCR63,0xbf);
-#if 0
-  if(!(SiS_GetReg(SiS_Pr->SiS_P3c4,0x15) & 0x01)) {
-     if((SiS_GetReg(SiS_Pr->SiS_P3c4,0x15) & 0x0a) ||
-        (SiS_GetReg(SiS_Pr->SiS_P3c4,0x16) & 0x01)) {
-        SiS_SetRegOR(SiS_Pr->SiS_P3d4,SiS_Pr->SiS_MyCR63,0x40);
-     }
-  }
-#endif
+   UCHAR  *ROMAddr  = HwInfo->pjVirtualRomBase;
+   USHORT temp;
+
+   if(SiS_Pr->SiS_UseROM) {
+      if(HwInfo->jChipType < SIS_330) {
+         temp = ROMAddr[VB310Data_1_2_Offset] | 0x40;
+	 if(SiS_Pr->SiS_ROMNew) temp = ROMAddr[0x80] | 0x40;
+         SiS_SetReg(SiS_Pr->SiS_Part1Port,0x02,temp);
+      } else if(HwInfo->jChipType >= SIS_661) {
+         temp = ROMAddr[0x7e];
+         if(SiS_Pr->SiS_ROMNew) temp = ROMAddr[0x80];
+         if(HwInfo->jChipType >= SIS_660)                  temp |= 0x40;
+         else if(SiS_GetReg(SiS_Pr->SiS_P3d4,0x7b) >= 100) temp |= 0x40;
+         SiS_SetReg(SiS_Pr->SiS_Part1Port,0x02,temp);
+      }
+   }
 }
 
 /*********************************************/
@@ -3585,13 +3450,12 @@ BOOLEAN
 SiSSetMode(SiS_Private *SiS_Pr, PSIS_HW_INFO HwInfo,USHORT ModeNo)
 #endif
 {
-   ULONG   temp;
    USHORT  ModeIdIndex;
-   UCHAR  *ROMAddr  = HwInfo->pjVirtualRomBase;
    SISIOADDRESS BaseAddr = HwInfo->ulIOAddress;
    unsigned char backupreg=0;
 #ifndef LINUX_XF86
    USHORT  KeepLockReg;
+   ULONG   temp;
 
    SiS_Pr->UseCustomMode = FALSE;
    SiS_Pr->CRT1UsesCustomMode = FALSE;
@@ -3605,7 +3469,7 @@ SiSSetMode(SiS_Private *SiS_Pr, PSIS_HW_INFO HwInfo,USHORT ModeNo)
    SiSRegInit(SiS_Pr, BaseAddr);
    SiS_GetSysFlags(SiS_Pr, HwInfo);
 
-#ifdef LINUX_XF86
+#if defined(LINUX_XF86) && (defined(i386) || defined(__i386) || defined(__i386__) || defined(__AMD64__))
    if(pScrn) SiS_Pr->SiS_VGAINFO = SiS_GetSetBIOSScratch(pScrn, 0x489, 0xff);
    else
 #endif
@@ -3615,20 +3479,13 @@ SiSSetMode(SiS_Private *SiS_Pr, PSIS_HW_INFO HwInfo,USHORT ModeNo)
    SiSSetLVDSetc(SiS_Pr, HwInfo);
    SiSDetermineROMUsage(SiS_Pr, HwInfo);
 
-   if(!SiS_Pr->UseCustomMode) {
-      ModeNo = ((ModeNo & 0x80) << 8) | (ModeNo & 0x7f);
-   }
+   SiS_Pr->SiS_flag_clearbuffer = 0;
 
-#ifdef LINUX_XF86
-   /* We never clear the buffer in X */
-   ModeNo |= 0x8000;
+   if(!SiS_Pr->UseCustomMode) {
+#ifndef LINUX_XF86
+      if(!(ModeNo & 0x80)) SiS_Pr->SiS_flag_clearbuffer = 1;
 #endif
-
-   if(ModeNo & 0x8000) {
-     	ModeNo &= 0x7fff;
-     	SiS_Pr->SiS_flag_clearbuffer = 0;
-   } else {
-     	SiS_Pr->SiS_flag_clearbuffer = 1;
+      ModeNo &= 0x7f;
    }
 
 #ifndef LINUX_XF86
@@ -3650,23 +3507,9 @@ SiSSetMode(SiS_Private *SiS_Pr, PSIS_HW_INFO HwInfo,USHORT ModeNo)
 
    if(SiS_Pr->SiS_VBType & VB_SIS301BLV302BLV) {
       if(HwInfo->jChipType >= SIS_315H) {
-         SiS_UnLockCRT2(SiS_Pr,HwInfo);
-	 if(ROMAddr && SiS_Pr->SiS_UseROM) {
-	    if(HwInfo->jChipType < SIS_330) {
-               temp = ROMAddr[VB310Data_1_2_Offset];
-	       temp |= 0x40;
-	       SiS_SetReg(SiS_Pr->SiS_Part1Port,0x02,temp);
-            }
-	    if(HwInfo->jChipType > SIS_330) {
-	       temp = ROMAddr[0x7e];
-	       if(SiS_GetReg(SiS_Pr->SiS_P3d4,0x7b) >= 100) temp |= 0x40;
-	       SiS_SetReg(SiS_Pr->SiS_Part1Port,0x02,temp);
-	    }
-	 }
+         SiS_ResetVB(SiS_Pr, HwInfo);
 	 SiS_SetRegOR(SiS_Pr->SiS_P3c4,0x32,0x10);
-
 	 SiS_SetRegOR(SiS_Pr->SiS_Part2Port,0x00,0x0c);
-
          backupreg = SiS_GetReg(SiS_Pr->SiS_P3d4,0x38);
       } else {
          backupreg = SiS_GetReg(SiS_Pr->SiS_P3d4,0x35);
@@ -3687,27 +3530,7 @@ SiSSetMode(SiS_Private *SiS_Pr, PSIS_HW_INFO HwInfo,USHORT ModeNo)
 #endif
 
    if(HwInfo->jChipType >= SIS_315H) {
-#if 0
-      if(SiS_GetReg(SiS_Pr->SiS_P3c4,0x17) & 0x08)  {
-         if(SiS_Pr->SiS_IF_DEF_LVDS == 1) {
-            if(ModeNo != 0x10)  SiS_Pr->SiS_SetFlag |= SetDOSMode;
-         } else if((IS_SIS651) && (SiS_Pr->SiS_VBType & VB_NoLCD)) {
-            SiS_Pr->SiS_SetFlag |= SetDOSMode;
-         }
-      }
-#endif
-
-      if(SiS_Pr->SiS_VBType & VB_SIS301BLV302BLV) {
-         if(IS_SIS650) {
-	    SiS_SetRegAND(SiS_Pr->SiS_P3d4,0x51,0x1f);
-	    if(IS_SIS651) SiS_SetRegOR(SiS_Pr->SiS_P3d4,0x51,0x20);
-	    SiS_SetRegAND(SiS_Pr->SiS_P3d4,0x56,0xe7);
-	 } else if(IS_SIS661741660760) {
-	    SiS_SetRegAND(SiS_Pr->SiS_P3d4,0x51,0x1f);
-	    SiS_SetRegAND(SiS_Pr->SiS_P3d4,0x56,0xe7);
-	    SiS_SetRegAND(SiS_Pr->SiS_P3d4,0x3a,0xef);
-	 }
-      }
+      SiS_SetupCR5x(SiS_Pr, HwInfo);
    }
 
    if(SiS_Pr->UseCustomMode) {
@@ -3751,7 +3574,7 @@ SiSSetMode(SiS_Private *SiS_Pr, PSIS_HW_INFO HwInfo,USHORT ModeNo)
 
    if(SiS_Pr->SiS_VBType & VB_SIS301BLV302BLV) {
       if(HwInfo->jChipType >= SIS_315H) {
-         if(HwInfo->jChipType < SIS_661) {
+         if(!SiS_Pr->SiS_ROMNew) {
 	    if(SiS_IsVAMode(SiS_Pr,HwInfo)) {
 	       SiS_SetRegOR(SiS_Pr->SiS_P3d4,0x35,0x01);
 	    } else {
@@ -3840,9 +3663,7 @@ BOOLEAN
 SiSBIOSSetModeCRT2(SiS_Private *SiS_Pr, PSIS_HW_INFO HwInfo, ScrnInfoPtr pScrn,
                DisplayModePtr mode, BOOLEAN IsCustom)
 {
-   ULONG   temp;
    USHORT  ModeIdIndex;
-   UCHAR  *ROMAddr  = HwInfo->pjVirtualRomBase;
    SISIOADDRESS BaseAddr = HwInfo->ulIOAddress;
    UShort  ModeNo   = 0;
    unsigned char backupreg=0;
@@ -3879,7 +3700,11 @@ SiSBIOSSetModeCRT2(SiS_Private *SiS_Pr, PSIS_HW_INFO HwInfo, ScrnInfoPtr pScrn,
    SiSRegInit(SiS_Pr, BaseAddr);
    SiSInitPtr(SiS_Pr, HwInfo);
    SiS_GetSysFlags(SiS_Pr, HwInfo);
+#if (defined(i386) || defined(__i386) || defined(__i386__) || defined(__AMD64__))
    SiS_Pr->SiS_VGAINFO = SiS_GetSetBIOSScratch(pScrn, 0x489, 0xff);
+#else
+   SiS_Pr->SiS_VGAINFO = 0x11;
+#endif
    SiSInitPCIetc(SiS_Pr, HwInfo);
    SiSSetLVDSetc(SiS_Pr, HwInfo);
    SiSDetermineROMUsage(SiS_Pr, HwInfo);
@@ -3941,23 +3766,9 @@ SiSBIOSSetModeCRT2(SiS_Private *SiS_Pr, PSIS_HW_INFO HwInfo, ScrnInfoPtr pScrn,
 
    if(SiS_Pr->SiS_VBType & VB_SIS301BLV302BLV) {
       if(HwInfo->jChipType >= SIS_315H) {
-         SiS_UnLockCRT2(SiS_Pr,HwInfo);
-         if(ROMAddr && SiS_Pr->SiS_UseROM) {
-	    if(HwInfo->jChipType < SIS_330) {
-               temp = ROMAddr[VB310Data_1_2_Offset];
-	       temp |= 0x40;
-               SiS_SetReg(SiS_Pr->SiS_Part1Port,0x02,temp);
-            }
-	    if(HwInfo->jChipType > SIS_330) {
-	       temp = ROMAddr[0x7e];
-	       if(SiS_GetReg(SiS_Pr->SiS_P3d4,0x7b) >= 100) temp |= 0x40;
-	       SiS_SetReg(SiS_Pr->SiS_Part1Port,0x02,temp);
-	    }
-	 }
+	 SiS_ResetVB(SiS_Pr, HwInfo);
 	 SiS_SetRegOR(SiS_Pr->SiS_P3c4,0x32,0x10);
-
 	 SiS_SetRegOR(SiS_Pr->SiS_Part2Port,0x00,0x0c);
-
          backupreg = SiS_GetReg(SiS_Pr->SiS_P3d4,0x38);
       } else {
          backupreg = SiS_GetReg(SiS_Pr->SiS_P3d4,0x35);
@@ -3999,7 +3810,7 @@ SiSBIOSSetModeCRT2(SiS_Private *SiS_Pr, PSIS_HW_INFO HwInfo, ScrnInfoPtr pScrn,
 
    if(SiS_Pr->SiS_VBType & VB_SIS301BLV302BLV) {
       if(HwInfo->jChipType >= SIS_315H) {
-         if(HwInfo->jChipType < SIS_661) {
+         if(!SiS_Pr->SiS_ROMNew) {
 	    if(SiS_IsVAMode(SiS_Pr,HwInfo)) {
 	       SiS_SetRegOR(SiS_Pr->SiS_P3d4,0x35,0x01);
 	    } else {
@@ -4069,7 +3880,11 @@ SiSBIOSSetModeCRT1(SiS_Private *SiS_Pr, PSIS_HW_INFO HwInfo, ScrnInfoPtr pScrn,
    SiSInitPtr(SiS_Pr, HwInfo);
    SiSRegInit(SiS_Pr, BaseAddr);
    SiS_GetSysFlags(SiS_Pr, HwInfo);
+#if (defined(i386) || defined(__i386) || defined(__i386__) || defined(__AMD64__))
    SiS_Pr->SiS_VGAINFO = SiS_GetSetBIOSScratch(pScrn, 0x489, 0xff);
+#else
+   SiS_Pr->SiS_VGAINFO = 0x11;
+#endif
    SiSInitPCIetc(SiS_Pr, HwInfo);
    SiSSetLVDSetc(SiS_Pr, HwInfo);
    SiSDetermineROMUsage(SiS_Pr, HwInfo);
@@ -4107,27 +3922,7 @@ SiSBIOSSetModeCRT1(SiS_Private *SiS_Pr, PSIS_HW_INFO HwInfo, ScrnInfoPtr pScrn,
    SiS_SetLowModeTest(SiS_Pr, ModeNo, HwInfo);
 
    if(HwInfo->jChipType >= SIS_315H) {
-#if 0
-      if(SiS_GetReg(SiS_Pr->SiS_P3c4,0x17) & 0x08)  {
-         if(SiS_Pr->SiS_IF_DEF_LVDS == 1) {
-            if(ModeNo != 0x10)  SiS_Pr->SiS_SetFlag |= SetDOSMode;
-         } else if((IS_SIS651) && (SiS_Pr->SiS_VBType & VB_NoLCD)) {
-            SiS_Pr->SiS_SetFlag |= SetDOSMode;
-         }
-      }
-#endif
-
-      if(SiS_Pr->SiS_VBType & VB_SIS301BLV302BLV) {
-         if(IS_SIS650) {
-	    SiS_SetRegAND(SiS_Pr->SiS_P3d4,0x51,0x1f);
-	    if(IS_SIS651) SiS_SetRegOR(SiS_Pr->SiS_P3d4,0x51,0x20);
-	    SiS_SetRegAND(SiS_Pr->SiS_P3d4,0x56,0xe7);
-	 } else if(IS_SIS661741660760) {
-	    SiS_SetRegAND(SiS_Pr->SiS_P3d4,0x51,0x1f);
-	    SiS_SetRegAND(SiS_Pr->SiS_P3d4,0x56,0xe7);
-	    SiS_SetRegAND(SiS_Pr->SiS_P3d4,0x3a,0xef);
-	 }
-      }
+      SiS_SetupCR5x(SiS_Pr, HwInfo);
    }
 
    /* Set mode on CRT1 */
@@ -4296,12 +4091,188 @@ SiS_GetPanelID(SiS_Private *SiS_Pr, PSIS_HW_INFO HwInfo)
 }
 #endif
 
+#ifndef GETBITSTR
+#define BITMASK(h,l)    	(((unsigned)(1U << ((h)-(l)+1))-1)<<(l))
+#define GENMASK(mask)   	BITMASK(1?mask,0?mask)
+#define GETBITS(var,mask)   	(((var) & GENMASK(mask)) >> (0?mask))
+#define GETBITSTR(val,from,to)  ((GETBITS(val,from)) << (0?to))
+#endif
+
+static void
+SiS_CalcCRRegisters(SiS_Private *SiS_Pr, int depth)
+{
+   SiS_Pr->CCRT1CRTC[0]  =  ((SiS_Pr->CHTotal >> 3) - 5) & 0xff;		/* CR0 */
+   SiS_Pr->CCRT1CRTC[1]  =  (SiS_Pr->CHDisplay >> 3) - 1;			/* CR1 */
+   SiS_Pr->CCRT1CRTC[2]  =  (SiS_Pr->CHBlankStart >> 3) - 1;			/* CR2 */
+   SiS_Pr->CCRT1CRTC[3]  =  (((SiS_Pr->CHBlankEnd >> 3) - 1) & 0x1F) | 0x80;	/* CR3 */
+   SiS_Pr->CCRT1CRTC[4]  =  (SiS_Pr->CHSyncStart >> 3) + 3;			/* CR4 */
+   SiS_Pr->CCRT1CRTC[5]  =  ((((SiS_Pr->CHBlankEnd >> 3) - 1) & 0x20) << 2) |	/* CR5 */
+       			    (((SiS_Pr->CHSyncEnd >> 3) + 3) & 0x1F);
+
+   SiS_Pr->CCRT1CRTC[6]  =  (SiS_Pr->CVTotal - 2) & 0xFF;			/* CR6 */
+   SiS_Pr->CCRT1CRTC[7]  =  (((SiS_Pr->CVTotal - 2) & 0x100) >> 8)		/* CR7 */
+ 	 		  | (((SiS_Pr->CVDisplay - 1) & 0x100) >> 7)
+	 		  | ((SiS_Pr->CVSyncStart & 0x100) >> 6)
+	 	  	  | (((SiS_Pr->CVBlankStart - 1) & 0x100) >> 5)
+			  | 0x10
+	 		  | (((SiS_Pr->CVTotal - 2) & 0x200)   >> 4)
+	 		  | (((SiS_Pr->CVDisplay - 1) & 0x200) >> 3)
+	 		  | ((SiS_Pr->CVSyncStart & 0x200) >> 2);
+
+   SiS_Pr->CCRT1CRTC[16] = ((((SiS_Pr->CVBlankStart - 1) & 0x200) >> 4) >> 5); 	/* CR9 */
+
+   if(depth != 8) {
+      if(SiS_Pr->CHDisplay >= 1600)      SiS_Pr->CCRT1CRTC[16] |= 0x60;		/* SRE */
+      else if(SiS_Pr->CHDisplay >= 640)  SiS_Pr->CCRT1CRTC[16] |= 0x40;
+   }
+
+#if 0
+   if (mode->VScan >= 32)
+	regp->CRTC[9] |= 0x1F;
+   else if (mode->VScan > 1)
+	regp->CRTC[9] |= mode->VScan - 1;
+#endif
+
+   SiS_Pr->CCRT1CRTC[8] =  (SiS_Pr->CVSyncStart     ) & 0xFF;			/* CR10 */
+   SiS_Pr->CCRT1CRTC[9] =  ((SiS_Pr->CVSyncEnd      ) & 0x0F) | 0x80;		/* CR11 */
+   SiS_Pr->CCRT1CRTC[10] = (SiS_Pr->CVDisplay    - 1) & 0xFF;			/* CR12 */
+   SiS_Pr->CCRT1CRTC[11] = (SiS_Pr->CVBlankStart - 1) & 0xFF;			/* CR15 */
+   SiS_Pr->CCRT1CRTC[12] = (SiS_Pr->CVBlankEnd   - 1) & 0xFF;			/* CR16 */
+
+   SiS_Pr->CCRT1CRTC[13] =							/* SRA */
+                        GETBITSTR((SiS_Pr->CVTotal     -2), 10:10, 0:0) |
+                        GETBITSTR((SiS_Pr->CVDisplay   -1), 10:10, 1:1) |
+                        GETBITSTR((SiS_Pr->CVBlankStart-1), 10:10, 2:2) |
+                        GETBITSTR((SiS_Pr->CVSyncStart   ), 10:10, 3:3) |
+                        GETBITSTR((SiS_Pr->CVBlankEnd  -1),   8:8, 4:4) |
+                        GETBITSTR((SiS_Pr->CVSyncEnd     ),   4:4, 5:5) ;
+
+   SiS_Pr->CCRT1CRTC[14] =							/* SRB */
+                        GETBITSTR((SiS_Pr->CHTotal      >> 3) - 5, 9:8, 1:0) |
+                        GETBITSTR((SiS_Pr->CHDisplay    >> 3) - 1, 9:8, 3:2) |
+                        GETBITSTR((SiS_Pr->CHBlankStart >> 3) - 1, 9:8, 5:4) |
+                        GETBITSTR((SiS_Pr->CHSyncStart  >> 3) + 3, 9:8, 7:6) ;
+
+
+   SiS_Pr->CCRT1CRTC[15] =							/* SRC */
+                        GETBITSTR((SiS_Pr->CHBlankEnd >> 3) - 1, 7:6, 1:0) |
+                        GETBITSTR((SiS_Pr->CHSyncEnd  >> 3) + 3, 5:5, 2:2) ;
+}
+
+void
+SiS_CalcLCDACRT1Timing(SiS_Private *SiS_Pr,USHORT ModeNo,USHORT ModeIdIndex)
+{
+   USHORT modeflag, tempax, tempbx, VGAHDE = SiS_Pr->SiS_VGAHDE;
+   int i,j;
+
+   /* 1:1 data: use data set by setcrt1crtc() */
+   if(SiS_Pr->SiS_LCDInfo & LCDPass11) return;
+
+   if(ModeNo <= 0x13) {
+     modeflag = SiS_Pr->SiS_SModeIDTable[ModeIdIndex].St_ModeFlag;
+   } else if(SiS_Pr->UseCustomMode) {
+     modeflag = SiS_Pr->CModeFlag;
+   } else {
+     modeflag = SiS_Pr->SiS_EModeIDTable[ModeIdIndex].Ext_ModeFlag;
+   }
+
+   if(modeflag & HalfDCLK) VGAHDE >>= 1;
+
+   SiS_Pr->CHDisplay = VGAHDE;
+   SiS_Pr->CHBlankStart = VGAHDE;
+
+   SiS_Pr->CVDisplay = SiS_Pr->SiS_VGAVDE;
+   SiS_Pr->CVBlankStart = SiS_Pr->SiS_VGAVDE;
+
+   tempbx = SiS_Pr->PanelHT - SiS_Pr->PanelXRes;
+   tempax = SiS_Pr->SiS_VGAHDE;  /* not /2 ! */
+   if(SiS_Pr->SiS_LCDInfo & DontExpandLCD) {
+      tempax = SiS_Pr->PanelXRes;
+   }
+   tempbx += tempax;
+   if(modeflag & HalfDCLK) tempbx -= VGAHDE;
+   SiS_Pr->CHTotal = SiS_Pr->CHBlankEnd = tempbx;
+
+   tempax = VGAHDE;
+   tempbx = SiS_Pr->CHTotal;
+   if(SiS_Pr->SiS_LCDInfo & DontExpandLCD) {
+      tempbx = SiS_Pr->PanelXRes;
+      if(modeflag & HalfDCLK) tempbx >>= 1;
+      tempax += ((tempbx - tempax) >> 1);
+   }
+
+   tempax += SiS_Pr->PanelHRS;
+   SiS_Pr->CHSyncStart = tempax;
+   tempax += SiS_Pr->PanelHRE;
+   SiS_Pr->CHSyncEnd = tempax;
+
+   tempbx = SiS_Pr->PanelVT - SiS_Pr->PanelYRes;
+   tempax = SiS_Pr->SiS_VGAVDE;
+   if(SiS_Pr->SiS_LCDInfo & DontExpandLCD) {
+      tempax = SiS_Pr->PanelYRes;
+   }
+   SiS_Pr->CVTotal = SiS_Pr->CVBlankEnd = tempbx + tempax;
+
+   tempax = SiS_Pr->SiS_VGAVDE;
+   if(SiS_Pr->SiS_LCDInfo & DontExpandLCD) {
+      tempax += (SiS_Pr->PanelYRes - tempax) >> 1;
+   }
+   tempax += SiS_Pr->PanelVRS;
+   SiS_Pr->CVSyncStart = tempax;
+   tempax += SiS_Pr->PanelVRE;
+   SiS_Pr->CVSyncEnd = tempax;
+
+   SiS_CalcCRRegisters(SiS_Pr, 8);
+   SiS_Pr->CCRT1CRTC[16] &= ~0xE0;
+
+   SiS_SetRegAND(SiS_Pr->SiS_P3d4,0x11,0x7f);
+
+   for(i=0,j=0;i<=7;i++,j++) {
+      SiS_SetReg(SiS_Pr->SiS_P3d4,j,SiS_Pr->CCRT1CRTC[i]);
+   }
+   for(j=0x10;i<=10;i++,j++) {
+      SiS_SetReg(SiS_Pr->SiS_P3d4,j,SiS_Pr->CCRT1CRTC[i]);
+   }
+   for(j=0x15;i<=12;i++,j++) {
+      SiS_SetReg(SiS_Pr->SiS_P3d4,j,SiS_Pr->CCRT1CRTC[i]);
+   }
+   for(j=0x0A;i<=15;i++,j++) {
+      SiS_SetReg(SiS_Pr->SiS_P3c4,j,SiS_Pr->CCRT1CRTC[i]);
+   }
+
+   tempax = SiS_Pr->CCRT1CRTC[16] & 0xE0;
+   SiS_SetRegANDOR(SiS_Pr->SiS_P3c4,0x0E,0x1F,tempax);
+
+   tempax = (SiS_Pr->CCRT1CRTC[16] & 0x01) << 5;
+   if(modeflag & DoubleScanMode) tempax |= 0x80;
+   SiS_SetRegANDOR(SiS_Pr->SiS_P3d4,0x09,0x5F,tempax);
+
+#ifdef TWDEBUG
+   xf86DrvMsg(0, X_INFO, "%d %d %d %d  %d %d %d %d  (%d %d %d %d)\n",
+       	SiS_Pr->CHDisplay, SiS_Pr->CHSyncStart, SiS_Pr->CHSyncEnd, SiS_Pr->CHTotal,
+	SiS_Pr->CVDisplay, SiS_Pr->CVSyncStart, SiS_Pr->CVSyncEnd, SiS_Pr->CVTotal,
+	SiS_Pr->CHBlankStart, SiS_Pr->CHBlankEnd, SiS_Pr->CVBlankStart, SiS_Pr->CVBlankEnd);
+
+   xf86DrvMsg(0, X_INFO, " {{0x%02x,0x%02x,0x%02x,0x%02x,0x%02x,0x%02x,0x%02x,0x%02x,\n",
+   	SiS_Pr->CCRT1CRTC[0], SiS_Pr->CCRT1CRTC[1],
+	SiS_Pr->CCRT1CRTC[2], SiS_Pr->CCRT1CRTC[3],
+	SiS_Pr->CCRT1CRTC[4], SiS_Pr->CCRT1CRTC[5],
+	SiS_Pr->CCRT1CRTC[6], SiS_Pr->CCRT1CRTC[7]);
+   xf86DrvMsg(0, X_INFO, "   0x%02x,0x%02x,0x%02x,0x%02x,0x%02x,0x%02x,0x%02x,0x%02x,\n",
+   	SiS_Pr->CCRT1CRTC[8], SiS_Pr->CCRT1CRTC[9],
+	SiS_Pr->CCRT1CRTC[10], SiS_Pr->CCRT1CRTC[11],
+	SiS_Pr->CCRT1CRTC[12], SiS_Pr->CCRT1CRTC[13],
+	SiS_Pr->CCRT1CRTC[14], SiS_Pr->CCRT1CRTC[15]);
+   xf86DrvMsg(0, X_INFO, "   0x%02x}},\n", SiS_Pr->CCRT1CRTC[16]);
+#endif
+}
 
 /* ================ XFREE86 ================= */
 
 /* Helper functions */
 
 #ifdef LINUX_XF86
+
 USHORT
 SiS_CheckBuildCustomMode(ScrnInfoPtr pScrn, DisplayModePtr mode, int VBFlags)
 {
@@ -4382,73 +4353,16 @@ SiS_CheckBuildCustomMode(ScrnInfoPtr pScrn, DisplayModePtr mode, int VBFlags)
 
    pSiS->SiS_Pr->CSRClock = (pSiS->SiS_Pr->CDClock / 1000) + 1;
 
-   pSiS->SiS_Pr->CCRT1CRTC[0]  =  ((pSiS->SiS_Pr->CHTotal >> 3) - 5) & 0xff;
-   pSiS->SiS_Pr->CCRT1CRTC[1]  =  (pSiS->SiS_Pr->CHDisplay >> 3) - 1;
-   pSiS->SiS_Pr->CCRT1CRTC[2]  =  (pSiS->SiS_Pr->CHBlankStart >> 3) - 1;
-   pSiS->SiS_Pr->CCRT1CRTC[3]  =  (((pSiS->SiS_Pr->CHBlankEnd >> 3) - 1) & 0x1F) | 0x80;
-   pSiS->SiS_Pr->CCRT1CRTC[4]  =  (pSiS->SiS_Pr->CHSyncStart >> 3) + 3;
-   pSiS->SiS_Pr->CCRT1CRTC[5]  =  ((((pSiS->SiS_Pr->CHBlankEnd >> 3) - 1) & 0x20) << 2) |
-       				  (((pSiS->SiS_Pr->CHSyncEnd >> 3) + 3) & 0x1F);
-
-   pSiS->SiS_Pr->CCRT1CRTC[6]  =  (pSiS->SiS_Pr->CVTotal - 2) & 0xFF;
-   pSiS->SiS_Pr->CCRT1CRTC[7]  =  (((pSiS->SiS_Pr->CVTotal - 2) & 0x100) >> 8)
- 	 			| (((pSiS->SiS_Pr->CVDisplay - 1) & 0x100) >> 7)
-	 			| ((pSiS->SiS_Pr->CVSyncStart & 0x100) >> 6)
-	 			| (((pSiS->SiS_Pr->CVBlankStart - 1) & 0x100) >> 5)
-	 			| 0x10
-	 			| (((pSiS->SiS_Pr->CVTotal - 2) & 0x200)   >> 4)
-	 			| (((pSiS->SiS_Pr->CVDisplay - 1) & 0x200) >> 3)
-	 			| ((pSiS->SiS_Pr->CVSyncStart & 0x200) >> 2);
-
-   pSiS->SiS_Pr->CCRT1CRTC[16] = ((((pSiS->SiS_Pr->CVBlankStart - 1) & 0x200) >> 4) >> 5); 	/* cr9 */
-
-#if 0
-   if (mode->VScan >= 32)
-	regp->CRTC[9] |= 0x1F;
-   else if (mode->VScan > 1)
-	regp->CRTC[9] |= mode->VScan - 1;
-#endif
-
-   pSiS->SiS_Pr->CCRT1CRTC[8] =  (pSiS->SiS_Pr->CVSyncStart     ) & 0xFF;		/* cr10 */
-   pSiS->SiS_Pr->CCRT1CRTC[9] =  ((pSiS->SiS_Pr->CVSyncEnd      ) & 0x0F) | 0x80;	/* cr11 */
-   pSiS->SiS_Pr->CCRT1CRTC[10] = (pSiS->SiS_Pr->CVDisplay    - 1) & 0xFF;		/* cr12 */
-   pSiS->SiS_Pr->CCRT1CRTC[11] = (pSiS->SiS_Pr->CVBlankStart - 1) & 0xFF;		/* cr15 */
-   pSiS->SiS_Pr->CCRT1CRTC[12] = (pSiS->SiS_Pr->CVBlankEnd   - 1) & 0xFF;		/* cr16 */
-
-   pSiS->SiS_Pr->CCRT1CRTC[13] =
-                        GETBITSTR((pSiS->SiS_Pr->CVTotal     -2), 10:10, 0:0) |
-                        GETBITSTR((pSiS->SiS_Pr->CVDisplay   -1), 10:10, 1:1) |
-                        GETBITSTR((pSiS->SiS_Pr->CVBlankStart-1), 10:10, 2:2) |
-                        GETBITSTR((pSiS->SiS_Pr->CVSyncStart   ), 10:10, 3:3) |
-                        GETBITSTR((pSiS->SiS_Pr->CVBlankEnd  -1),   8:8, 4:4) |
-                        GETBITSTR((pSiS->SiS_Pr->CVSyncEnd     ),   4:4, 5:5) ;
-
-   pSiS->SiS_Pr->CCRT1CRTC[14] =
-                        GETBITSTR((pSiS->SiS_Pr->CHTotal      >> 3) - 5, 9:8, 1:0) |
-                        GETBITSTR((pSiS->SiS_Pr->CHDisplay    >> 3) - 1, 9:8, 3:2) |
-                        GETBITSTR((pSiS->SiS_Pr->CHBlankStart >> 3) - 1, 9:8, 5:4) |
-                        GETBITSTR((pSiS->SiS_Pr->CHSyncStart  >> 3) + 3, 9:8, 7:6) ;
-
-
-   pSiS->SiS_Pr->CCRT1CRTC[15] =
-                        GETBITSTR((pSiS->SiS_Pr->CHBlankEnd >> 3) - 1, 7:6, 1:0) |
-                        GETBITSTR((pSiS->SiS_Pr->CHSyncEnd  >> 3) + 3, 5:5, 2:2) ;
+   SiS_CalcCRRegisters(pSiS->SiS_Pr, depth);
 
    switch(depth) {
-   case 8:
-      	pSiS->SiS_Pr->CModeFlag |= 0x223b;
-	break;
-   case 16:
-      	pSiS->SiS_Pr->CModeFlag |= 0x227d;
-	break;
-   case 32:
-      	pSiS->SiS_Pr->CModeFlag |= 0x22ff;
-	break;		
-   default: 
-   	return 0;	
-   }	
-   
-   if(pSiS->SiS_Pr->CFlags & V_DBLSCAN) 
+   case 8:  pSiS->SiS_Pr->CModeFlag |= 0x223b; break;
+   case 16: pSiS->SiS_Pr->CModeFlag |= 0x227d; break;
+   case 32: pSiS->SiS_Pr->CModeFlag |= 0x22ff; break;
+   default: return 0;
+   }
+
+   if(pSiS->SiS_Pr->CFlags & V_DBLSCAN)
       pSiS->SiS_Pr->CModeFlag |= DoubleScanMode;
 
    if((pSiS->SiS_Pr->CVDisplay >= 1024)	||
@@ -4472,33 +4386,23 @@ SiS_CheckBuildCustomMode(ScrnInfoPtr pScrn, DisplayModePtr mode, int VBFlags)
 
    pSiS->SiS_Pr->UseCustomMode = TRUE;
 #ifdef TWDEBUG
-   xf86DrvMsg(0, X_INFO, "Custom mode %dx%d:\n", 
+   xf86DrvMsg(0, X_INFO, "Custom mode %dx%d:\n",
    	pSiS->SiS_Pr->CHDisplay,pSiS->SiS_Pr->CVDisplay);
    xf86DrvMsg(0, X_INFO, "Modeflag %04x, Infoflag %04x\n",
    	pSiS->SiS_Pr->CModeFlag, pSiS->SiS_Pr->CInfoFlag);
    xf86DrvMsg(0, X_INFO, " {{0x%02x,0x%02x,0x%02x,0x%02x,0x%02x,0x%02x,0x%02x,0x%02x,\n",
-   	pSiS->SiS_Pr->CCRT1CRTC[0],
-	pSiS->SiS_Pr->CCRT1CRTC[1],
-	pSiS->SiS_Pr->CCRT1CRTC[2],
-	pSiS->SiS_Pr->CCRT1CRTC[3],
-	pSiS->SiS_Pr->CCRT1CRTC[4],
-	pSiS->SiS_Pr->CCRT1CRTC[5],
-	pSiS->SiS_Pr->CCRT1CRTC[6],
-	pSiS->SiS_Pr->CCRT1CRTC[7]);
+   	pSiS->SiS_Pr->CCRT1CRTC[0], pSiS->SiS_Pr->CCRT1CRTC[1],
+	pSiS->SiS_Pr->CCRT1CRTC[2], pSiS->SiS_Pr->CCRT1CRTC[3],
+	pSiS->SiS_Pr->CCRT1CRTC[4], pSiS->SiS_Pr->CCRT1CRTC[5],
+	pSiS->SiS_Pr->CCRT1CRTC[6], pSiS->SiS_Pr->CCRT1CRTC[7]);
    xf86DrvMsg(0, X_INFO, "  0x%02x,0x%02x,0x%02x,0x%02x,0x%02x,0x%02x,0x%02x,0x%02x,\n",
-   	pSiS->SiS_Pr->CCRT1CRTC[8],
-	pSiS->SiS_Pr->CCRT1CRTC[9],
-	pSiS->SiS_Pr->CCRT1CRTC[10],
-	pSiS->SiS_Pr->CCRT1CRTC[11],
-	pSiS->SiS_Pr->CCRT1CRTC[12],
-	pSiS->SiS_Pr->CCRT1CRTC[13],
-	pSiS->SiS_Pr->CCRT1CRTC[14],
-	pSiS->SiS_Pr->CCRT1CRTC[15]);
+   	pSiS->SiS_Pr->CCRT1CRTC[8], pSiS->SiS_Pr->CCRT1CRTC[9],
+	pSiS->SiS_Pr->CCRT1CRTC[10], pSiS->SiS_Pr->CCRT1CRTC[11],
+	pSiS->SiS_Pr->CCRT1CRTC[12], pSiS->SiS_Pr->CCRT1CRTC[13],
+	pSiS->SiS_Pr->CCRT1CRTC[14], pSiS->SiS_Pr->CCRT1CRTC[15]);
    xf86DrvMsg(0, X_INFO, "  0x%02x}},\n", pSiS->SiS_Pr->CCRT1CRTC[16]);
    xf86DrvMsg(0, X_INFO, "Clock: 0x%02x, 0x%02x, %d\n",
-   	pSiS->SiS_Pr->CSR2B,
-	pSiS->SiS_Pr->CSR2C,
-	pSiS->SiS_Pr->CSRClock);
+   	pSiS->SiS_Pr->CSR2B, pSiS->SiS_Pr->CSR2C, pSiS->SiS_Pr->CSRClock);
 #endif
    return 1;
 }
@@ -4615,7 +4519,7 @@ SiSBuildBuiltInModeList(ScrnInfoPtr pScrn, BOOLEAN includelcdmodes, BOOLEAN isfo
       /* Horizontal display enable end */
       HDE = (cr_data & 0xff) |
             ((unsigned short) (sr_data & 0x0C) << 6);
-      E = HDE + 1;
+      E = HDE + 1;  /* 0x80 0x64 */
 
       cr_data = pSiS->SiS_Pr->SiS_CRT1Table[index].CR[4];
 	/* inSISIDXREG(SISCR, 0x04, cr_data); */
@@ -4623,7 +4527,7 @@ SiSBuildBuiltInModeList(ScrnInfoPtr pScrn, BOOLEAN includelcdmodes, BOOLEAN isfo
       /* Horizontal retrace (=sync) start */
       HRS = (cr_data & 0xff) |
             ((unsigned short) (sr_data & 0xC0) << 2);
-      F = HRS - E - 3;
+      F = HRS - E - 3;  /* 0x06 0x06 */
 
       cr_data = pSiS->SiS_Pr->SiS_CRT1Table[index].CR[2];
 	/* inSISIDXREG(SISCR, 0x02, cr_data); */
@@ -4653,7 +4557,7 @@ SiSBuildBuiltInModeList(ScrnInfoPtr pScrn, BOOLEAN includelcdmodes, BOOLEAN isfo
       B = (temp > 0) ? temp : (temp + 256);
 
       temp = HRE - ((E + F + 3) & 63);
-      C = (temp > 0) ? temp : (temp + 64);
+      C = (temp > 0) ? temp : (temp + 64); /* 0x0b 0x0b */
 
       D = B - F - C;
 
@@ -5159,10 +5063,7 @@ sisfb_gettotalfrommode(SiS_Private *SiS_Pr, PSIS_HW_INFO HwInfo,
 int
 sisfb_mode_rate_to_ddata(SiS_Private *SiS_Pr, PSIS_HW_INFO HwInfo,
 			 unsigned char modeno, unsigned char rateindex,
-			 ULONG *left_margin, ULONG *right_margin, 
-			 ULONG *upper_margin, ULONG *lower_margin,
-			 ULONG *hsync_len, ULONG *vsync_len,
-			 ULONG *sync, ULONG *vmode)
+			 struct fb_var_screeninfo *var)
 {
     USHORT ModeNo = modeno;
     USHORT ModeIdIndex = 0, index = 0;
@@ -5185,7 +5086,7 @@ sisfb_mode_rate_to_ddata(SiS_Private *SiS_Pr, PSIS_HW_INFO HwInfo,
        return 0;
 #endif
     }
-    
+
     if(!(SiS_SearchModeID(SiS_Pr, &ModeNo, &ModeIdIndex))) return 0;
 
     RefreshRateTableIndex = SiS_Pr->SiS_EModeIDTable[ModeIdIndex].REFindex;
@@ -5250,15 +5151,15 @@ sisfb_mode_rate_to_ddata(SiS_Private *SiS_Pr, PSIS_HW_INFO HwInfo,
 	 /* Terrible hack, but the correct CRTC data for
 	  * these modes only produces a black screen...
 	  */
-       *left_margin = (400 - 376);
-       *right_margin = (328 - 320);
-       *hsync_len = (376 - 328);
+       var->left_margin = (400 - 376);
+       var->right_margin = (328 - 320);
+       var->hsync_len = (376 - 328);
 
     } else {
 
-       *left_margin = D * 8;
-       *right_margin = F * 8;
-       *hsync_len = C * 8;
+       var->left_margin = D * 8;
+       var->right_margin = F * 8;
+       var->hsync_len = C * 8;
 
     }
 
@@ -5320,47 +5221,47 @@ sisfb_mode_rate_to_ddata(SiS_Private *SiS_Pr, PSIS_HW_INFO HwInfo,
 
     D = B - F - C;
       
-    *upper_margin = D;
-    *lower_margin = F;
-    *vsync_len = C;
+    var->upper_margin = D;
+    var->lower_margin = F;
+    var->vsync_len = C;
 
     if(SiS_Pr->SiS_RefIndex[RefreshRateTableIndex].Ext_InfoFlag & 0x8000)
-       *sync &= ~FB_SYNC_VERT_HIGH_ACT;
+       var->sync &= ~FB_SYNC_VERT_HIGH_ACT;
     else
-       *sync |= FB_SYNC_VERT_HIGH_ACT;
+       var->sync |= FB_SYNC_VERT_HIGH_ACT;
 
     if(SiS_Pr->SiS_RefIndex[RefreshRateTableIndex].Ext_InfoFlag & 0x4000)       
-       *sync &= ~FB_SYNC_HOR_HIGH_ACT;
+       var->sync &= ~FB_SYNC_HOR_HIGH_ACT;
     else
-       *sync |= FB_SYNC_HOR_HIGH_ACT;
+       var->sync |= FB_SYNC_HOR_HIGH_ACT;
 		
-    *vmode = FB_VMODE_NONINTERLACED;
+    var->vmode = FB_VMODE_NONINTERLACED;
     if(SiS_Pr->SiS_RefIndex[RefreshRateTableIndex].Ext_InfoFlag & 0x0080)
-       *vmode = FB_VMODE_INTERLACED;
+       var->vmode = FB_VMODE_INTERLACED;
     else {
-      j = 0;
-      while(SiS_Pr->SiS_EModeIDTable[j].Ext_ModeID != 0xff) {
+       j = 0;
+       while(SiS_Pr->SiS_EModeIDTable[j].Ext_ModeID != 0xff) {
           if(SiS_Pr->SiS_EModeIDTable[j].Ext_ModeID ==
 	                  SiS_Pr->SiS_RefIndex[RefreshRateTableIndex].ModeID) {
               if(SiS_Pr->SiS_EModeIDTable[j].Ext_ModeFlag & DoubleScanMode) {
-	      	  *vmode = FB_VMODE_DOUBLE;
+	      	  var->vmode = FB_VMODE_DOUBLE;
               }
 	      break;
           }
 	  j++;
-      }
+       }
     }       
 
-    if((*vmode & FB_VMODE_MASK) == FB_VMODE_INTERLACED) {
+    if((var->vmode & FB_VMODE_MASK) == FB_VMODE_INTERLACED) {
 #if 0  /* Do this? */
-       *upper_margin <<= 1;
-       *lower_margin <<= 1;
-       *vsync_len <<= 1;
+       var->upper_margin <<= 1;
+       var->lower_margin <<= 1;
+       var->vsync_len <<= 1;
 #endif
-    } else if((*vmode & FB_VMODE_MASK) == FB_VMODE_DOUBLE) {
-       *upper_margin >>= 1;
-       *lower_margin >>= 1;
-       *vsync_len >>= 1;
+    } else if((var->vmode & FB_VMODE_MASK) == FB_VMODE_DOUBLE) {
+       var->upper_margin >>= 1;
+       var->lower_margin >>= 1;
+       var->vsync_len >>= 1;
     }
 
     return 1;       
diff --git a/drivers/video/sis/init.h b/drivers/video/sis/init.h
index bcee3154d..05d1881a6 100644
--- a/drivers/video/sis/init.h
+++ b/drivers/video/sis/init.h
@@ -1,4 +1,5 @@
 /* $XFree86$ */
+/* $XdotOrg$ */
 /*
  * Data and prototypes for init.c
  *
@@ -31,13 +32,10 @@
  * * 2) Redistributions in binary form must reproduce the above copyright
  * *    notice, this list of conditions and the following disclaimer in the
  * *    documentation and/or other materials provided with the distribution.
- * * 3) All advertising materials mentioning features or use of this software
- * *    must display the following acknowledgement: "This product includes
- * *    software developed by Thomas Winischhofer, Vienna, Austria."
- * * 4) The name of the author may not be used to endorse or promote products
+ * * 3) The name of the author may not be used to endorse or promote products
  * *    derived from this software without specific prior written permission.
  * *
- * * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR
+ * * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESSED 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,
@@ -101,6 +99,7 @@ const USHORT  ModeIndex_800x480[]      = {0x70, 0x7a, 0x00, 0x76};
 const USHORT  ModeIndex_800x600[]      = {0x30, 0x47, 0x00, 0x63};
 const USHORT  ModeIndex_848x480[]      = {0x39, 0x3b, 0x00, 0x3e};
 const USHORT  ModeIndex_856x480[]      = {0x3f, 0x42, 0x00, 0x45};
+const USHORT  ModeIndex_960x540[]      = {0x1d, 0x1e, 0x00, 0x1f};  /* 315 series only */
 const USHORT  ModeIndex_1024x768[]     = {0x38, 0x4a, 0x00, 0x64};
 const USHORT  ModeIndex_1024x576[]     = {0x71, 0x74, 0x00, 0x77};
 const USHORT  ModeIndex_1024x600[]     = {0x20, 0x21, 0x00, 0x22};  /* 300 series only */
@@ -111,10 +110,13 @@ const USHORT  ModeIndex_1152x864[]     = {0x29, 0x2a, 0x00, 0x2b};
 const USHORT  ModeIndex_300_1280x768[] = {0x55, 0x5a, 0x00, 0x5b};
 const USHORT  ModeIndex_310_1280x768[] = {0x23, 0x24, 0x00, 0x25};
 const USHORT  ModeIndex_1280x720[]     = {0x79, 0x75, 0x00, 0x78};
+const USHORT  ModeIndex_1280x800[]     = {0x14, 0x15, 0x00, 0x16};
 const USHORT  ModeIndex_1360x768[]     = {0x48, 0x4b, 0x00, 0x4e};
 const USHORT  ModeIndex_300_1360x1024[]= {0x67, 0x6f, 0x00, 0x72};  /* 300 series, BARCO only */
 const USHORT  ModeIndex_1400x1050[]    = {0x26, 0x27, 0x00, 0x28};  /* 315 series only */
+const USHORT  ModeIndex_1680x1050[]    = {0x17, 0x18, 0x00, 0x19};  /* 315 series only */
 const USHORT  ModeIndex_1600x1200[]    = {0x3c, 0x3d, 0x00, 0x66};
+const USHORT  ModeIndex_1920x1080[]    = {0x2c, 0x2d, 0x00, 0x73};  /* 315 series only */
 const USHORT  ModeIndex_1920x1440[]    = {0x68, 0x69, 0x00, 0x6b};
 const USHORT  ModeIndex_300_2048x1536[]= {0x6c, 0x6d, 0x00, 0x00};
 const USHORT  ModeIndex_310_2048x1536[]= {0x6c, 0x6d, 0x00, 0x6e};
@@ -253,9 +255,14 @@ static const SiS_ModeResInfoStruct SiS_ModeResInfo[] =
 	{ 1024, 600, 8,16},   /* 0x19 */
 	{ 1152, 768, 8,16},   /* 0x1a */
 	{  768, 576, 8,16},   /* 0x1b */
-	{ 1360,1024, 8,16}    /* 0x1c */
+	{ 1360,1024, 8,16},   /* 0x1c */
+	{ 1680,1050, 8,16},   /* 0x1d */
+	{ 1280, 800, 8,16},   /* 0x1e */
+	{ 1920,1080, 8,16},   /* 0x1f */
+	{  960, 540, 8,16}    /* 0x20 */
 };
 
+#if defined(SIS300) || defined(SIS315H)
 static SiS_StandTableStruct SiS_StandTable[]=
 {
 /* 0x00: MD_0_200 */
@@ -694,6 +701,7 @@ static SiS_StandTableStruct SiS_StandTable[]=
    0xff}
  }
 };
+#endif
 
 /**************************************************************/
 /* SIS VIDEO BRIDGE ----------------------------------------- */
@@ -839,7 +847,8 @@ static const SiS_TVDataStruct  SiS_ExtPALData[] =
  {   36,  25,1060, 648,1270, 530, 438,   0, 438,0xeb,0x05,0x25,0x16},  /* 800x600, 400x300 - better */
  {    3,   2,1080, 619,1270, 540, 438,   0, 438,0xf3,0x00,0x1d,0x20},  /* 720x576 */
  {    1,   1,1170, 821,1270, 520, 686,   0, 686,0xF3,0x00,0x1D,0x20},  /* 1024x768 */
- {    1,   1,1170, 821,1270, 520, 686,   0, 686,0xF3,0x00,0x1D,0x20}   /* 1024x768 (for NTSC equ) */
+ {    1,   1,1170, 821,1270, 520, 686,   0, 686,0xF3,0x00,0x1D,0x20},  /* 1024x768 (for NTSC equ) */
+ {    9,   4, 848, 528,1270, 530,   0,   0,  50,0xf5,0xfb,0x1b,0x2a}   /* 720x480 test */
 };
 
 static const SiS_TVDataStruct  SiS_StNTSCData[] =
@@ -921,6 +930,22 @@ static const SiS_TVDataStruct  SiS_St750pData[] =
 
 static const SiS_TVDataStruct  SiS_Ext750pData[] =
 {
+#if 1
+ {  143,  65, 0x35a,0x1bb,0x4f6,0x1b8,0x0ab,  0, 0x0ab, 0x00,0x00,0x00,0x00},
+ {   88,  35, 0x35a,0x189,0x4f6,0x1b8,0x0ab,  0, 0x0ab, 0x00,0x00,0x00,0x00},
+ {   18,   5, 0x339,0x1ae,0x500,0x2d0,0x05c,  0, 0x05c, 0x00,0x00,0x00,0x00},
+ {  143,  70, 0x39c,0x189,0x4f6,0x1b8,0x05c,  0, 0x05c, 0x00,0x00,0x00,0x00},
+ {   99,  32, 0x320,0x1fe,0x500,0x2d0,   50,  0,     0, 0x00,0x00,0x00,0x00},  /* 640x480  */
+ {    5,   4, 0x5d8,0x29e,0x500,0x2a8,   50,  0,     0, 0x00,0x00,0x00,0x00},  /* 800x600  */
+#if 0
+ {    2,   1, 0x35a,0x1f7,0x4f6,0x1e0,    0,128,     0, 0x00,0x00,0x00,0x00},  /* 720x480  */
+#endif
+ {   99,  32, 0x320,0x1fe,0x500,0x2d0,   50,  0,     0, 0x00,0x00,0x00,0x00},  /* 720x480 test WORKS */
+ {   68,  64, 0x55f,0x346,0x500,0x2a8,0x27e,  0,     0, 0x00,0x00,0x00,0x00},  /* 1024x768 */
+ {    5,   2, 0x3a7,0x226,0x500,0x2a8,    0,128,     0, 0x00,0x00,0x00,0x00},  /* 720x576  */
+ {   25,  24, 0x5d8,0x2f3,0x460,0x2a8,   50,  0,     0, 0x00,0x00,0x00,0x00}   /* 1280x720 WORKS */
+#endif
+#if 0
  {    3,   1, 0x3a7,0x1d6,0x500,0x2a8,   50,  0,     0, 0x00,0x00,0x00,0x00},
  {   24,   7, 0x3a7,0x1a4,0x500,0x2a8,   50,  0,     0, 0x00,0x00,0x00,0x00},
  {    3,   1, 0x3a7,0x1d6,0x500,0x2a8,   50,  0,     0, 0x00,0x00,0x00,0x00},
@@ -929,63 +954,105 @@ static const SiS_TVDataStruct  SiS_Ext750pData[] =
  {    5,   4, 0x5d8,0x29e,0x500,0x2a8,   50,  0,     0, 0x00,0x00,0x00,0x00},  /* 800x600   */
  {    2,   1, 0x35a,0x1f7,0x4f6,0x1e0,    0,128,     0, 0x00,0x00,0x00,0x00},  /* 720x480   */
  {   68,  64, 0x55f,0x346,0x500,0x2a8,0x27e,  0,     0, 0x00,0x00,0x00,0x00},  /* 1024x768  */
+ {   25,  24, 0x5d8,0x2f3,0x460,0x2a8,   50,  0,     0, 0x00,0x00,0x00,0x00}   /* 1280x720  */
+#endif
+#if 0
+ {  136,  35, 0x339,0x181,0x460,0x2a8,   50,  0,     0, 0x00,0x00,0x00,0x00},  /* TEST (0.93) BAD */
+ {   17,   6, 0x339,0x203,0x460,0x2a8,   50,  0,    50, 0x00,0x00,0x00,0x00},
+ {  136,  35, 0x339,0x181,0x460,0x2a8,   50,  0,    50, 0x00,0x00,0x00,0x00},
+ {   17,   6, 0x339,0x203,0x460,0x2a8,   50,  0,    50, 0x00,0x00,0x00,0x00},
+ {   85,  46, 0x3f4,0x27b,0x460,0x2a8,   50,  0,     0, 0x00,0x00,0x00,0x00},  /* 640x480   */
+ {   17,  16, 0x55f,0x323,0x460,0x2a8,0x2b6,  0,     0, 0x00,0x00,0x00,0x00},  /* 800x600   */
+ {  136,  35, 0x339,0x181,0x460,0x2a8,   50,  0,     0, 0x00,0x00,0x00,0x00},  /* 720x480   */
+ {  187,  74, 0x39d,0x203,0x460,0x2a8,   50,  0,     0, 0x00,0x00,0x00,0x00},  /* 1024x768  */
+ {   25,  24, 0x5d8,0x2f3,0x460,0x2a8,   50,  0,    50, 0x00,0x00,0x00,0x00}   /* 1280x720  */
+#endif
 };
 
-static const SiS_LCDDataStruct  SiS_LCD1280x960Data[] =
+static const SiS_LCDDataStruct  SiS_LCD1280x720Data[] =
 {
-	{    9,   2, 800, 500,1800,1000},
-	{    9,   2, 800, 500,1800,1000},
-	{    4,   1, 900, 500,1800,1000},
-	{    4,   1, 900, 500,1800,1000},
-	{    9,   2, 800, 500,1800,1000},
-	{   30,  11,1056, 625,1800,1000},
-	{    5,   3,1350, 800,1800,1000},
-	{    1,   1,1576,1050,1576,1050},
-	{    1,   1,1800,1000,1800,1000}
+	{  14,    5,  864,  432, 1344,  806 }, /* 640x400 */
+	{  16,    5,  864,  378, 1344,  806 },
+	{  14,    5,  864,  432, 1344,  806 },
+	{  16,    5,  864,  378, 1344,  806 },
+	{  24,   11,  924,  523, 1344,  806 }, /* 640x480 */
+	{   7,    5, 1152,  664, 1344,  806 }, /* 800x600 */
+	{   0,    0,    0,    0,    0,    0 },
+	{   0,    0,    0,    0,    0,    0 },
+	{   0,    0,    0,    0,    0,    0 },
+	{   0,    0,    0,    0,    0,    0 },
+	{   1,    1, 1344,  806, 1344,  806 }  /* 1280x720 */
 };
 
-/* 1280x768 panel data from Fujitsu 7911 (VL-17WDX8).
- * Other 1280x768 panels (with clock != 81000, HTxVT != 1688x802)
- * will be treated as custom panels.
+/* About 1280x768: For TMDS, Panel_1280x768 will only be set if
+ * the panel is a Fujitsu 7911 (VL-17WDX8) (with clock 81, 1688x802)
+ * Other TMDS panels of this resolution will be treated as custom.
+ * For LVDS, we know two types. Data follows:
  */
 
-static const SiS_LCDDataStruct  SiS_StLCD1280x768Data[] =
+static const SiS_LCDDataStruct  SiS_StLCD1280x768_2Data[] =
+{
+	{  64,   21,  858,  434, 1408,  806 }, /* 640x400 */
+	{  32,    9,  858,  372, 1408,  806 },
+	{  64,   21,  858,  434, 1408,  806 },
+	{  32,    9,  858,  372, 1408,  806 },
+	{ 143,   68, 1024,  527, 1408,  806 }, /* 640x480 */
+	{  64,   51, 1364,  663, 1408,  806 }, /* 800x600 */
+	{  88,   81, 1296,  806, 1408,  806 }, /* 1024x768 */
+	{   0,    0,    0,    0,    0,    0 },
+	{   1,    1, 1408,  806, 1408,  806 }  /* 1280x768 */
+};
+
+static const SiS_LCDDataStruct  SiS_ExtLCD1280x768_2Data[] =
+{
+	{  64,   25, 1056,  422, 1408,  806 }, /*, 664 */
+	{ 128,   39,  884,  396, 1408,  806 }, /*, 640 */
+	{  64,   25, 1056,  422, 1408,  806 }, /*, 664 */
+	{ 128,   39,  884,  396, 1408,  806 }, /*, 640 */
+	{  32,   15, 1056,  513, 1408,  806 }, /*, 664 */
+	{ 176,  125, 1280,  640, 1408,  806 }, /*, 768 */
+	{  88,   81, 1296,  806, 1408,  806 },
+	{   0,    0,    0,    0,    0,    0 },
+	{   1,    1, 1408,  806, 1408,  806 }
+};
+
+static const SiS_LCDDataStruct  SiS_LCD1280x768_3Data[] =
 {
-	{ 211,  100, 2100,  408, 1688,  802 }, /* These values are *wrong* */
-	{ 211,   64, 1536,  358, 1688,  802 }, /* (which is why they aren't used yet) */
-	{ 211,  100, 2100,  408, 1688,  802 },
-	{ 211,   64, 1536,  358, 1688,  802 },
-	{ 211,   48,  840,  488, 1688,  802 },
-	{ 211,   72, 1008,  609, 1688,  802 },
-	{ 211,  128, 1400,  776, 1688,  802 },
-	{ 211,  205, 1680, 1041, 1688,  802 },
-	{ 1,      1, 1688,  802, 1688,  802 }  /* That's the only one that is correct */
+	{  64,   25, 1056,  422, 1664,  798 },			/* 640x400 */
+	{ 128,   39,  884,  396, 1408,  806 }, /* ,640 */
+	{  64,   25, 1056,  422, 1664,  798 },			/* 640x400 */
+	{ 128,   39,  884,  396, 1408,  806 }, /* ,640 */
+	{  32,   15, 1056,  513, 1408,  806 }, /* ,664 */	/* 640x480 */
+	{ 176,  125, 1280,  640, 1408,  806 }, /* ,768 */	/* 800x600 */
+	{  64,   61, 1342,  806, 1408,  806 },			/* 1024x768 */
+	{   0,    0,    0,    0,    0,    0 },
+	{   1,    1, 1408,  806, 1408,  806 }			/* 1280x768 */
 };
 
-static const SiS_LCDDataStruct  SiS_ExtLCD1280x768Data[] =
+static const SiS_LCDDataStruct  SiS_LCD1280x800Data[] =
 {
-	{ 211,  100, 2100,  408, 1688,  802 }, /* These values are *wrong* */
-	{ 211,   64, 1536,  358, 1688,  802 }, /* (which is why they aren't used yet) */
-	{ 211,  100, 2100,  408, 1688,  802 },
-	{ 211,   64, 1536,  358, 1688,  802 },
-	{ 211,   48,  840,  488, 1688,  802 },
-	{ 211,   72, 1008,  609, 1688,  802 },
-	{ 211,  128, 1400,  776, 1688,  802 },
-	{ 211,  205, 1680, 1041, 1688,  802 },
-	{ 1,      1, 1688,  802, 1688,  802 }  /* That's the only one that is correct */
+	{ 128,   51, 1122,  412, 1408,  816 }, /* 640x400 */
+	{ 128,   49, 1232,  361, 1408,  816 },
+	{ 128,   51, 1122,  412, 1408,  816 },
+	{ 128,   49, 1232,  361, 1408,  816 },
+	{   8,    3,  880,  491, 1408,  816 }, /* 640x480 */
+	{  11,    6, 1024,  612, 1408,  816 }, /* 800x600 */
+	{  22,   21, 1400,  784, 1408,  816 }, /* 1024x768 */
+	{   0,    0,    0,    0,    0,    0 },
+	{   1,    1, 1408,  816, 1408,  816 }  /* 1280x800 */
 };
 
-static const SiS_LCDDataStruct  SiS_NoScaleData1280x768[] =
+static const SiS_LCDDataStruct  SiS_LCD1280x960Data[] =
 {
-        { 1, 1, 1688,  802, 1688,  802},
-	{ 1, 1, 1688,  802, 1688,  802},
-	{ 1, 1, 1688,  802, 1688,  802},
-	{ 1, 1, 1688,  802, 1688,  802},
-	{ 1, 1, 1688,  802, 1688,  802},
-	{ 1, 1, 1688,  802, 1688,  802},
-	{ 1, 1, 1688,  802, 1688,  802},
-	{ 1, 1, 1688,  802, 1688,  802},
-	{ 1, 1, 1688,  802, 1688,  802}
+	{    9,   2,  800,  500, 1800, 1000 },
+	{    9,   2,  800,  500, 1800, 1000 },
+	{    4,   1,  900,  500, 1800, 1000 },
+	{    4,   1,  900,  500, 1800, 1000 },
+	{    9,   2,  800,  500, 1800, 1000 },
+	{   30,  11, 1056,  625, 1800, 1000 },
+	{    5,   3, 1350,  800, 1800, 1000 },
+	{    1,   1, 1576, 1050, 1576, 1050 },
+	{    1,   1, 1800, 1000, 1800, 1000 }
 };
 
 static const SiS_LCDDataStruct  SiS_StLCD1400x1050Data[] =
@@ -1003,28 +1070,37 @@ static const SiS_LCDDataStruct  SiS_StLCD1400x1050Data[] =
 
 static const SiS_LCDDataStruct  SiS_ExtLCD1400x1050Data[] =
 {
-	{ 211,  100, 2100,  408, 1688, 1066 },
+/*	{ 211,   60, 1260,  410, 1688, 1066 },    640x400 (6330) */
+	{ 211,  100, 2100,  408, 1688, 1066 }, /* 640x400 (6325) WORKS */
 	{ 211,   64, 1536,  358, 1688, 1066 },
 	{ 211,  100, 2100,  408, 1688, 1066 },
 	{ 211,   64, 1536,  358, 1688, 1066 },
-	{ 211,   48,  840,  488, 1688, 1066 },
-	{ 211,   72, 1008,  609, 1688, 1066 },
-	{ 211,  128, 1400,  776, 1688, 1066 },
-	{ 211,  205, 1680, 1041, 1688, 1066 },
-	{   1,    1, 1688, 1066, 1688, 1066 }
-};
-
-static const SiS_LCDDataStruct  SiS_NoScaleData1400x1050[] =
-{
-	{ 1, 1, 1688, 1066, 1688, 1066 },
-	{ 1, 1, 1688, 1066, 1688, 1066 },
-	{ 1, 1, 1688, 1066, 1688, 1066 },
-	{ 1, 1, 1688, 1066, 1688, 1066 },
-	{ 1, 1, 1688, 1066, 1688, 1066 },
-	{ 1, 1, 1688, 1066, 1688, 1066 },
-	{ 1, 1, 1688, 1066, 1688, 1066 },
-	{ 1, 1, 1688, 1066, 1688, 1066 },
-	{ 1, 1, 1688, 1066, 1688, 1066 }
+/*	{ 211,   80, 1400,  490, 1688, 1066 },    640x480 (6330) */
+	{ 211,   48,  840,  488, 1688, 1066 }, /* 640x480 (6325) WORKS */
+/*	{ 211,  117, 1638,  613, 1688, 1066 },    800x600 (6330) */
+	{ 211,   72, 1008,  609, 1688, 1066 }, /* 800x600 (6325) WORKS */
+	{ 211,  128, 1400,  776, 1688, 1066 }, /* 1024x768 */
+	{ 211,  205, 1680, 1041, 1688, 1066 }, /* 1280x1024 - not used (always unscaled) */
+	{   1,    1, 1688, 1066, 1688, 1066 }, /* 1400x1050 */
+	{   0,    0,    0,    0,    0,    0 }, /* kludge */
+	{ 211,  120, 1400,  730, 1688, 1066 }  /* 1280x720 */
+};
+
+static const SiS_LCDDataStruct  SiS_LCD1680x1050Data[] =
+{
+	{  95,   24, 1260,  410, 1900, 1066 }, /*  0 640x400 */
+	{  10,    3, 1710,  362, 1900, 1066 },
+	{  95,   24, 1260,  410, 1900, 1066 },
+	{  10,    3, 1710,  362, 1900, 1066 },
+	{  95,   32, 1400,  490, 1900, 1066 }, /*  4 640x480 */
+	{  95,   42, 1470,  610, 1900, 1066 }, /*  5 800x600 */
+	{  95,   64, 1750,  784, 1900, 1066 }, /*  6 1024x768 */
+	{  95,   94, 1900, 1055, 1900, 1066 }, /*  7 1280x1024 */
+	{  41,   31, 1900,  806, 1900, 1066 }, /*  8 1280x768 */
+	{  95,   69, 1800,  817, 1900, 1066 }, /*  9 1280x800 patch */
+	{  13,    9, 1900,  739, 1900, 1066 }, /* 10 1280x720 */
+	{  95,   94, 1880, 1066, 1900, 1066 }, /* 11 1400x1050 patch */
+	{   1,    1, 1900, 1066, 1900, 1066 }  /* 12 1680x1050 */
 };
 
 static const SiS_LCDDataStruct  SiS_StLCD1600x1200Data[] =
@@ -1037,440 +1113,59 @@ static const SiS_LCDDataStruct  SiS_StLCD1600x1200Data[] =
 	{ 4,  1,1080, 625, 2160, 1250 },
 	{ 5,  2,1350, 800, 2160, 1250 },
 	{135,88,1600,1100, 2160, 1250 },
-	{135,88,1600,1100, 2160, 1250 },
+	{72, 49,1680,1092, 2160, 1250 },
 	{ 1,  1,2160,1250, 2160, 1250 }
 };
 
 static const SiS_LCDDataStruct  SiS_ExtLCD1600x1200Data[] =
 {
-	{27, 4, 800, 500, 2160, 1250 },
+	{72,11, 990, 422, 2160, 1250 }, /* 640x400 (6330) WORKS */
+/*	{27, 4, 800, 500, 2160, 1250 },    640x400 (6235) */
 	{27, 4, 800, 500, 2160, 1250 },
 	{ 6, 1, 900, 500, 2160, 1250 },
 	{ 6, 1, 900, 500, 2160, 1250 },
-	{27, 1, 800, 500, 2160, 1250 },
+	{45, 8, 960, 505, 2160, 1250 }, /* 640x480 (6330) WORKS */
+/*	{27, 1, 800, 500, 2160, 1250 },    640x480 (6325) */
 	{ 4, 1,1080, 625, 2160, 1250 },
 	{ 5, 2,1350, 800, 2160, 1250 },
-	{27,16,1500,1064, 2160, 1250 },
-	{27,16,1500,1064, 2160, 1250 },
+	{27,16,1500,1064, 2160, 1250 }, /* 1280x1024 */
+	{72,49,1680,1092, 2160, 1250 }, /* 1400x1050 (6330, was not supported on 6325) */
 	{ 1, 1,2160,1250, 2160, 1250 }
 };
 
-static const SiS_LCDDataStruct  SiS_NoScaleData1600x1200[] =
-{
-        {1,  1, 2160, 1250, 2048, 1250},
-	{1,  1, 2160, 1250, 2048, 1250},
-	{1,  1, 2160, 1250, 2048, 1250},
-	{1,  1, 2160, 1250, 2048, 1250},
-	{1,  1, 2160, 1250, 2048, 1250},
-	{1,  1, 2160, 1250, 2048, 1250},
-	{1,  1, 2160, 1250, 2048, 1250},
-	{1,  1, 2160, 1250, 2048, 1250},
-	{1,  1, 2160, 1250, 2048, 1250},
-	{1,  1, 2160, 1250, 2048, 1250},
-};
-
 static const SiS_LCDDataStruct  SiS_NoScaleData[] =
 {
-	{ 1, 1, 800, 449, 800, 449 },
+	{ 1, 1, 800, 449, 800, 449 },  /* 0x00: 320x200, 640x400 */
 	{ 1, 1, 800, 449, 800, 449 },
 	{ 1, 1, 900, 449, 900, 449 },
 	{ 1, 1, 900, 449, 900, 449 },
-	{ 1, 1, 800, 525, 800, 525 },
-	{ 1, 1,1056, 628,1056, 628 },
-	{ 1, 1,1344, 806,1344, 806 },
-	{ 1, 1,1688,1066,1688,1066 },
-        { 1, 1,1688, 802,1688, 802 },  /* 1280x768: 802 was 806 in both cases */
-        { 1, 1,2160,1250,2160,1250 },  /* 1600x1200 */
-	{ 1, 1,1800,1000,1800,1000 }   /* 1280x960 */
-};
-
-/* *** LCDA *** */
-
-static const SiS_LVDSDataStruct  SiS_LCDA1024x768Data_1[]=
-{
-	{  960, 438,1344, 806},
-	{  960, 388,1344, 806},
-	{ 1040, 438,1344, 806},
-	{ 1040, 388,1344, 806},
-	{  960, 518,1344, 806},   /* 640x480 */
-	{ 1120, 638,1344, 806},   /* 800x600 */
-	{ 1344, 806,1344, 806},   /* 1024x768 */
-#if 0
-	{ 840, 438,1344, 806},
-	{ 840, 409,1344, 806},
-	{ 840, 438,1344, 806},
-	{ 840, 409,1344, 806},
-	{ 840, 518,1344, 806},   /* 640x480 */
-	{1050, 638,1344, 806},   /* 800x600 */
-	{1344, 806,1344, 806},   /* 1024x768 */
-#endif
-};
-
-static const SiS_LVDSDataStruct  SiS_LCDA1024x768Data_2[]=
-{
-	{1344, 806,1344, 806},
-	{1344, 806,1344, 806},
-	{1344, 806,1344, 806},
-	{1344, 806,1344, 806},
-	{1344, 806,1344, 806},
-	{1344, 806,1344, 806},
-	{1344, 806,1344, 806},
-};
-
-static const SiS_LVDSDataStruct  SiS_LCDA1280x1024Data_1[]=
-{ /* Acer, Compaq */
-	{1048, 442,1688,1066},
-	{1048, 392,1688,1066},
-	{1128, 442,1688,1066},
-	{1128, 392,1688,1066},
-	{1048, 522,1688,1066},
-	{1208, 642,1688,1066},
-	{1432, 810,1688,1066},
-	{1688,1066,1688,1066}
-};
-
-static const SiS_LVDSDataStruct  SiS_LCDA1280x1024Data_2[]=
-{ /* Corrected (illegal in Acer, correct in Compaq) */
-	{1688,1066,1688,1066},
-	{1688,1066,1688,1066},
-	{1688,1066,1688,1066},
-	{1688,1066,1688,1066},
-	{1688,1066,1688,1066},
-	{1688,1066,1688,1066},
-	{1688,1066,1688,1066},
-	{1688,1066,1688,1066}
-};
-
-static const SiS_LVDSDataStruct  SiS_LCDA1400x1050Data_1[]=
-{ /* Clevo */
-        { 928, 416, 1688,1066},
-	{ 928, 366, 1688,1066},
-	{1008, 416, 1688,1066},
-	{1008, 366, 1688,1066},
-	{1200, 530, 1688,1066},
-	{1088, 616, 1688,1066},
-	{1312, 784, 1688,1066},
-	{1568,1040, 1688,1066},
-	{1688,1066, 1688,1066}
-};
-
-static const SiS_LVDSDataStruct  SiS_LCDA1400x1050Data_2[]=
-{ /* Clevo */
-    	{1688,1066, 1688,1066},
-	{1688,1066, 1688,1066},
-	{1688,1066, 1688,1066},
-	{1688,1066, 1688,1066},
-	{1688,1066, 1688,1066},
-	{1688,1066, 1688,1066},
-	{1688,1066, 1688,1066},
-	{1688,1066, 1688,1066},
-	{1688,1066, 1688,1066}
-};
-
-static const SiS_LVDSDataStruct  SiS_LCDA1600x1200Data_1[]=
-{ /* Clevo (Temporary data)  */
-	{1200, 450, 2048,1250},
-	{1200, 400, 2048,1250},
-	{1280, 450, 2048,1250},
-	{1280, 400, 2048,1250},
-	{1200, 530, 2048,1250},
-	{1360, 650, 2048,1250},
-	{1584, 818, 2048,1250},
-	{1688,1066, 2048,1250},
-	{1688,1066, 2048,1250},
-	{2048,1250, 2048,1250}   /* this should be correct */
-#if 0
-	{2160,1250, 2048,1250}   /* ? */
-#endif
-};
-
-static const SiS_LVDSDataStruct  SiS_LCDA1600x1200Data_2[]=
-{ /* Clevo (Temporary data. Seems invalid.) */
-	{2160,1250, 2160,1250},
-	{2160,1250, 2160,1250},
-	{2160,1250, 2160,1250},
-	{2160,1250, 2160,1250},
-	{2160,1250, 2160,1250},
-	{2160,1250, 2160,1250},
-	{2160,1250, 2160,1250},
-	{2160,1250, 2160,1250},
-	{2160,1250, 2160,1250},
-	{2160,1250, 2160,1250}
-};
-
-/* LVDS SKEW for LCDA */
-
-static const SiS_LVDSDesStruct SiS_PanelType1076_1[]=
-{  /* 1024x768 */
-	{ 0 , 0},
-	{ 0 , 0},
-	{ 0 , 0},
-	{ 0 , 0},
-	{ 0 , 0},
-	{ 0 , 0},
-	{ 0 , 0},   /* 805; was 0, 0 -> top line cut away (26/09/03) */
-};
-
-static const SiS_LVDSDesStruct SiS_PanelType1076_2[]=
-{  /* 1024x768; not expanded */
-	{ 1184, 622 },
-	{ 1184, 597 },
-	{ 1184, 622 },
-	{ 1184, 597 },
-	{ 1152, 650 },  /* 622 */
-	{ 1232, 722 },
-	{    0, 0   },  /* 805; was 0, 0 -> top line cut away (26/09/03) */
-};
-
-static const SiS_LVDSDesStruct SiS_PanelType1210_1[]=
-{  /* 1280x1024 */
-	{ 0 ,    0},
-	{ 0 ,    0},
-	{ 0 ,    0},
-	{ 0 ,    0},
-	{ 0 ,    0},
-	{ 0 ,    0},
-	{ 0 ,    0},
-	{ 0 , 1065},  /* Acer */
-	{ 0 ,    0}
-};
-
-static const SiS_LVDSDesStruct SiS_PanelType1210_2[]=
-{  /* 1280x1024; not expanded */
-	{ 0 , 0},
-	{ 0 , 0},
-	{ 0 , 0},
-	{ 0 , 0},
-	{ 0 , 0},
-	{ 0 , 0},
-	{ 0 , 0},
-	{ 0 , 0},
-	{ 0 , 0}
-};
-
-static const SiS_LVDSDesStruct SiS_PanelType1296_1[]=
-{  /* 1400x1050 */
-	{ 0 , 0},
-	{ 0 , 0},
-	{ 0 , 0},
-	{ 0 , 0},
-	{ 0 , 0},
-	{ 0 , 0},
-	{ 0 , 0},
-	{ 0 , 0},
-	{ 0 , 1065}   /* Was 0,0 */
-};
-
-static const SiS_LVDSDesStruct SiS_PanelType1296_2[]=
-{  /* 1400x1050; not expanded */
-	{ 1308, 741 },
-	{ 1308, 716 },
-	{ 1308, 741 },
-	{ 1308, 716 },
-	{ 1308, 781 },
-	{ 1388, 841 },
-	{ 1500, 925 },
-	{ 1628,1053 },
-	{    0,1065 }
-#if 0
-	{ 808 , 740},
-	{ 0   , 715},
-	{ 632 , 740},
-	{ 632 , 715},
-	{ 1307, 780},
-	{ 1387,1157},
-	{ 1499, 924},
-	{ 1627,1052},
-	{ 0 , 0}
-#endif
-};
-
-static const SiS_LVDSDesStruct SiS_PanelType1600_1[]=
-{  /* 1600x1200 */
-	{ 0 , 0},
-	{ 0 , 0},
-	{ 0 , 0},
-	{ 0 , 0},
-	{ 0 , 0},
-	{ 0 , 0},
-	{ 0 , 0},
-	{ 0 , 0},
-	{ 0 , 0},
-	{ 0 , 0}
-};
-
-static const SiS_LVDSDesStruct SiS_PanelType1600_2[]=
-{  /* 1600x1200; not expanded */
-	{ 0 , 0},
-	{ 0 , 0},
-	{ 0 , 0},
-	{ 0 , 0},
-	{ 0 , 0},
-	{ 0 , 0},
-	{ 0 , 0},
-	{ 0 , 0},
-	{ 0 , 0},
-	{ 0 , 0}
-};
-
-#ifdef SIS315H
-
-/* LCDA CRT1 custom data */
-
-static const SiS_LCDACRT1DataStruct  Compaq1280x1024_LCDACRT1_1[]=
-{
- {{0x7e,0x4f,0x4f,0x82,0x58,0x06,0xb8,0x1f,
-   0x90,0x84,0x8f,0x8f,0xb9,0x30,0x00,0x06,
-   0x00}},
- {{0x7e,0x4f,0x4f,0x82,0x58,0x06,0x86,0x1f,
-   0x5e,0x82,0x5d,0x5d,0x87,0x10,0x00,0x06,
-   0x00}},
- {{0x7e,0x4f,0x4f,0x82,0x58,0x06,0xb8,0x1f,
-   0x90,0x84,0x8f,0x8f,0xb9,0x30,0x00,0x06,
-   0x00}},
- {{0x7e,0x4f,0x4f,0x82,0x58,0x06,0x86,0x1f,
-   0x5e,0x82,0x5d,0x5d,0x87,0x10,0x00,0x06,
-   0x00}},
- {{0x7e,0x4f,0x4f,0x82,0x58,0x06,0x08,0x3e,
-   0xe0,0x84,0xdf,0xdf,0x09,0x00,0x00,0x06,
-   0x00}},
- {{0x92,0x63,0x63,0x96,0x6c,0x1a,0x80,0xf0,
-   0x58,0x8c,0x57,0x57,0x81,0x20,0x00,0x06,
-   0x01}},
- {{0xae,0x7f,0x7f,0x92,0x88,0x96,0x28,0xf5,
-   0x00,0x84,0xff,0xff,0x29,0x10,0x00,0x02,
-   0x01}},
- {{0xce,0x9f,0x9f,0x92,0xa8,0x16,0x28,0x5a,
-   0x00,0x84,0xff,0xff,0x29,0x01,0x00,0x07,
-   0x01}}
+	{ 1, 1, 800, 525, 800, 525 },  /* 0x04: 320x240, 640x480  */
+	{ 1, 1,1056, 628,1056, 628 },  /* 0x05: 400x300, 800x600  */
+	{ 1, 1,1344, 806,1344, 806 },  /* 0x06: 512x384, 1024x768 */
+	{ 1, 1,1688,1066,1688,1066 },  /* 0x07: 1280x1024 */
+        { 1, 1,1688, 802,1688, 802 },  /* 0x08: 1280x768: Fujitsu, TMDS only */
+        { 1, 1,2160,1250,2160,1250 },  /* 0x09: 1600x1200 */
+	{ 1, 1,1800,1000,1800,1000 },  /* 0x0a: 1280x960  */
+	{ 1, 1,1688,1066,1688,1066 },  /* 0x0b: 1400x1050 */
+	{ 1, 1,1650, 750,1650, 750 },  /* 0x0c: 1280x720 (TMDS, projector)  */
+	{ 1, 1,1656, 841,1656, 841 },  /* 0x0d: 1280x800 (was: 1408, 816) */
+	{ 1, 1,1900,1066,1900,1066 },  /* 0x0e: 1680x1050 (LVDS) */
+	{ 1, 1,1408, 806,1408, 806 },  /* 0x0f: 1280x768_2 */
+	{ 1, 1,1664, 798,1664, 798 },  /* 0x10: 1280x768_3 */
+	{ 1, 1,1688, 802,1688, 802 },  /* 0x11: 1280x768: Std, TMDS only */
+	{ 1, 1,1344, 806,1344, 806 },  /* 0x12: 1280x720 (LVDS)  */
+	{ 1, 1, 896, 497, 896, 497 },  /* 0x13: 720x480 */
+	{ 1, 1, 912, 597, 912, 597 },  /* 0x14: 720x576 */
+	{ 1, 1, 912, 597, 912, 597 },  /* 0x15: 768x576 */
+	{ 1, 1,1056, 497,1056, 497 },  /* 0x16: 848x480 */
+	{ 1, 1,1064, 497,1064, 497 },  /* 0x17: 856x480 */
+	{ 1, 1,1056, 497,1056, 497 },  /* 0x18: 800x480 */
+	{ 1, 1,1328, 739,1328, 739 },  /* 0x19: 1024x576 */
+	{ 1, 1,1680, 892,1680, 892 },  /* 0x1a: 1152x864 */
+	{ 1, 1,1808, 808,1808, 808 },  /* 0x1b: 1360x768 */
+	{ 1, 1,1104, 563,1104, 563 }   /* 0x1c: 960x540 */
 };
 
-static const SiS_LCDACRT1DataStruct  Compaq1280x1024_LCDACRT1_1_H[]=
-{
- {{0x56,0x27,0x27,0x9a,0x30,0x1e,0xb8,0x1f,
-   0x90,0x84,0x8f,0x8f,0xb9,0x30,0x00,0x05,
-   0x00}},
- {{0x3c,0x4f,0x4f,0x82,0x58,0x06,0x86,0xd1,
-   0xbc,0x80,0xbb,0xbb,0xe5,0x00,0x00,0x06,
-   0x01}},
- {{0x56,0x27,0x27,0x9a,0x30,0x1e,0xb8,0x1f,
-   0x90,0x84,0x8f,0x8f,0xb9,0x30,0x00,0x05,
-   0x00}},
- {{0x3c,0x4f,0x4f,0x82,0x58,0x06,0x86,0xd1,
-   0xbc,0x80,0xbb,0xbb,0xe5,0x00,0x00,0x06,
-   0x01}},
- {{0x56,0x27,0x27,0x9a,0x30,0x1e,0x08,0x3e,
-   0xe0,0x84,0xdf,0xdf,0x09,0x00,0x00,0x05,
-   0x00}},
- {{0x60,0x31,0x31,0x84,0x3a,0x88,0x80,0xf0,
-   0x58,0x8c,0x57,0x57,0x81,0x20,0x00,0x01,
-   0x01}},
- {{0x6e,0x3f,0x3f,0x92,0x48,0x96,0x28,0xf5,
-   0x00,0x84,0xff,0xff,0x29,0x10,0x00,0x01,
-   0x01}}
-};
-
-static const SiS_LCDACRT1DataStruct  Clevo1024x768_LCDACRT1_1[]=
-{
- {{0x73,0x4f,0x4f,0x97,0x55,0x86,0xc4,0x1f,
-   0x92,0x89,0x8f,0x8f,0xb5,0x30,0x00,0x05,
-   0x00}},
- {{0x73,0x4f,0x4f,0x97,0x55,0x86,0x97,0x1f,
-   0x60,0x87,0x5d,0x5d,0x83,0x10,0x00,0x05,
-   0x00}},
- {{0x73,0x4f,0x4f,0x97,0x55,0x86,0xc4,0x1f,
-   0x92,0x89,0x8f,0x8f,0xb5,0x30,0x00,0x05,
-   0x00}},
- {{0x73,0x4f,0x4f,0x97,0x55,0x86,0x97,0x1f,
-   0x60,0x87,0x5d,0x5d,0x83,0x10,0x00,0x05,
-   0x00}},
- {{0x73,0x4f,0x4f,0x97,0x55,0x86,0x04,0x3e,
-   0xE2,0x89,0xDf,0xDf,0x05,0x00,0x00,0x05,
-   0x00}},
- {{0x87,0x63,0x63,0x8B,0x69,0x1A,0x7c,0xf0,
-   0x5A,0x8F,0x57,0x57,0x7D,0x20,0x00,0x26,
-   0x01}},
- {{0xA3,0x7f,0x7f,0x87,0x86,0x97,0x24,0xf5,
-   0x02,0x88,0xFf,0xFf,0x25,0x10,0x00,0x02,
-   0x01}}
-};
-
-static const SiS_LCDACRT1DataStruct  Clevo1024x768_LCDACRT1_1_H[]=
-{
- {{0x4b,0x27,0x27,0x8f,0x2b,0x03,0xc4,0x1f,
-   0x92,0x89,0x8f,0x8f,0xb5,0x30,0x00,0x44,
-   0x00}},
- {{0x4b,0x27,0x27,0x8f,0x2b,0x03,0x97,0x1f,
-   0x60,0x87,0x5D,0x5D,0x83,0x01,0x00,0x44,
-   0x00}},
- {{0x4b,0x27,0x27,0x8f,0x2b,0x03,0xc4,0x1f,
-   0x92,0x89,0x8f,0x8f,0xb5,0x30,0x00,0x44,
-   0x00}},
- {{0x4b,0x27,0x27,0x8f,0x2b,0x03,0x97,0x1f,
-   0x60,0x87,0x5D,0x5D,0x83,0x01,0x00,0x44,
-   0x00}},
- {{0x4b,0x27,0x27,0x8f,0x32,0x1b,0x04,0x3e,
-   0xE2,0x89,0xDf,0xDf,0x05,0x00,0x00,0x45,
-   0x00}},
- {{0x55,0x31,0x31,0x99,0x46,0x1d,0x7c,0xf0,
-   0x5A,0x8F,0x57,0x57,0x7D,0x20,0x00,0x55,
-   0x01}},
- {{0x63,0x3F,0x3F,0x87,0x4A,0x93,0x24,0xF5,
-   0x02,0x88,0xFF,0xFF,0x25,0x10,0x00,0x01,
-   0x01}}
-};
-
-static const SiS_LCDACRT1DataStruct  Clevo1024x768_LCDACRT1_2[]=
-{
- {{0xa3,0x4f,0x4f,0x87,0x6e,0x9f,0x24,0xbb,
-   0x4a,0x80,0x8f,0x8f,0x25,0x30,0x00,0x06,
-   0x00}},
- {{0xa3,0x4f,0x4f,0x87,0x6e,0x9f,0x24,0xbb,
-   0x31,0x87,0x5d,0x5d,0x25,0x30,0x00,0x06,
-   0x00}},
- {{0xa3,0x4f,0x4f,0x87,0x6e,0x9f,0x24,0xbb,
-   0x4a,0x80,0x8f,0x8f,0x25,0x30,0x00,0x06,
-   0x00}},
- {{0xa3,0x4f,0x4f,0x87,0x6e,0x9f,0x24,0xbb,
-   0x31,0x87,0x5d,0x5d,0x25,0x30,0x00,0x06,
-   0x00}},
- {{0xa3,0x4f,0x4f,0x87,0x6e,0x9f,0x24,0xbb,
-   0x72,0x88,0xdf,0xdf,0x25,0x30,0x00,0x06,
-   0x00}},
- {{0xa3,0x63,0x63,0x87,0x78,0x89,0x24,0xf1,
-   0xae,0x84,0x57,0x57,0x25,0x30,0x00,0x02,
-   0x01}},
- {{0xa3,0x7f,0x7f,0x87,0x86,0x97,0x24,0xf5,
-   0x02,0x88,0xff,0xff,0x25,0x10,0x00,0x02,
-   0x01}}
-};
-
-static const SiS_LCDACRT1DataStruct  Clevo1024x768_LCDACRT1_2_H[]=
-{
- {{0x7b,0x27,0x27,0x9f,0x46,0x97,0x24,0xbb,
-   0x57,0x8e,0x8f,0x8f,0x25,0x30,0x00,0x01,
-   0x00 }},
- {{0x7b,0x27,0x27,0x9f,0x46,0x97,0x24,0xbb,
-   0x3e,0x85,0x5d,0x5d,0x25,0x10,0x00,0x01,
-   0x00 }},
- {{0x7b,0x27,0x27,0x9f,0x46,0x97,0x24,0xbb,
-   0x57,0x8e,0x8f,0x8f,0x25,0x30,0x00,0x01,
-   0x00 }},
- {{0x7b,0x27,0x27,0x9f,0x46,0x97,0x24,0xbb,
-   0x3e,0x85,0x5d,0x5d,0x25,0x10,0x00,0x01,
-   0x00 }},
- {{0x7b,0x27,0x27,0x9f,0x46,0x97,0x24,0xbb,
-   0x7f,0x86,0xdf,0xdf,0x25,0x10,0x00,0x01,
-   0x00 }},
- {{0x71,0x31,0x31,0x95,0x46,0x97,0x24,0xf1,
-   0xbb,0x82,0x57,0x57,0x25,0x10,0x00,0x01,
-   0x01 }},
- {{0x63,0x3f,0x3f,0x87,0x46,0x97,0x24,0xf5,
-   0x0f,0x86,0xff,0xff,0x25,0x30,0x00,0x01,
-   0x01 }}
-};
-
-#endif  /* 315 */
 
 /**************************************************************/
 /* LVDS ----------------------------------------------------- */
@@ -1521,9 +1216,7 @@ static const SiS_LVDSDataStruct  SiS_LVDS800x600Data_1[]=
 	{ 848, 389,1060, 629},
 	{ 848, 518,1060, 629},
 	{1056, 628,1056, 628},
-	{1056, 628,1056, 628},
-	{ 800, 449,1000, 644},
-	{ 800, 525,1000, 635}
+	{1056, 628,1056, 628}
 };
 
 static const SiS_LVDSDataStruct  SiS_LVDS800x600Data_2[]=
@@ -1534,9 +1227,7 @@ static const SiS_LVDSDataStruct  SiS_LVDS800x600Data_2[]=
 	{1056, 628,1056, 628},
 	{1056, 628,1056, 628},
 	{1056, 628,1056, 628},
-	{1056, 628,1056, 628},
-	{ 800, 449,1000, 644},
-	{ 800, 525,1000, 635}
+	{1056, 628,1056, 628}
 };
 
 static const SiS_LVDSDataStruct  SiS_LVDS1024x768Data_1[]=
@@ -1548,8 +1239,6 @@ static const SiS_LVDSDataStruct  SiS_LVDS1024x768Data_1[]=
 	{ 840, 518,1344, 806},   /* 640x480 */
 	{1050, 638,1344, 806},   /* 800x600 */
 	{1344, 806,1344, 806},   /* 1024x768 */
-	{ 800, 449,1280, 801},
-	{ 800, 525,1280, 813}
 };
 
 static const SiS_LVDSDataStruct  SiS_LVDS1024x768Data_2[]=
@@ -1561,11 +1250,8 @@ static const SiS_LVDSDataStruct  SiS_LVDS1024x768Data_2[]=
 	{1344, 806,1344, 806},
 	{1344, 806,1344, 806},
 	{1344, 806,1344, 806},
-	{ 800, 449,1280, 801},
-	{ 800, 525,1280, 813}
 };
 
-
 static const SiS_LVDSDataStruct  SiS_LVDS1280x1024Data_1[]=
 {
 	{1048, 442,1688,1066},
@@ -1716,9 +1402,7 @@ static const SiS_LVDSDataStruct  SiS_LVDS1024x600Data_1[] =
 	{ 840, 560,1344, 800},
 	{ 840, 689,1344, 800},
 	{1050, 800,1344, 800},
-	{1344, 800,1344, 800},
-	{ 800, 449,1280, 789},
-	{ 800, 525,1280, 785}
+	{1344, 800,1344, 800}
 };
 
 static const SiS_LVDSDataStruct  SiS_LVDS1024x600Data_2[] =
@@ -1729,9 +1413,7 @@ static const SiS_LVDSDataStruct  SiS_LVDS1024x600Data_2[] =
 	{1344, 800,1344, 800},
 	{1344, 800,1344, 800},
 	{1344, 800,1344, 800},
-	{1344, 800,1344, 800},
-	{ 800, 449,1280, 801},
-	{ 800, 525,1280, 813}
+	{1344, 800,1344, 800}
 };
 
 static const SiS_LVDSDataStruct  SiS_LVDS1152x768Data_1[] =
@@ -1742,9 +1424,7 @@ static const SiS_LVDSDataStruct  SiS_LVDS1152x768Data_1[] =
 	{ 840, 409,1344, 806},
 	{ 840, 518,1344, 806},
 	{1050, 638,1344, 806},
-	{1344, 806,1344, 806},
-	{ 800, 449,1280, 801},
-	{ 800, 525,1280, 813}
+	{1344, 806,1344, 806}
 };
 
 static const SiS_LVDSDataStruct  SiS_LVDS1152x768Data_2[] =
@@ -1755,9 +1435,7 @@ static const SiS_LVDSDataStruct  SiS_LVDS1152x768Data_2[] =
 	{1344, 806,1344, 806},
 	{1344, 806,1344, 806},
 	{1344, 806,1344, 806},
-	{1344, 806,1344, 806},
-	{ 800, 449,1280, 801},
-	{ 800, 525,1280, 813}
+	{1344, 806,1344, 806}
 };
 
 /* Pass 1:1 data */
@@ -1770,7 +1448,7 @@ static const SiS_LVDSDataStruct  SiS_LVDSXXXxXXXData_1[]=
 	{ 800, 525,  800, 525},  /*  640x480   */
 	{1056, 628, 1056, 628},  /*  800x600   */
 	{1344, 806, 1344, 806},  /* 1024x768   */
-	{1344,1066, 1344,1066},  /* 1280x1024  */  /* INSERTED ! */
+	{1688,1066, 1688,1066},  /* 1280x1024  */  /* INSERTED ! */
  	{1688, 806, 1688, 806},  /* 1280x768   */
 	/* No other panels ! */
 };
@@ -1885,36 +1563,6 @@ static const SiS_LVDSDataStruct  SiS_CHTVONTSCData[]=
         {1160, 840,1160, 840}
 };
 
-/* LVDS Skew */
-
-static const SiS_LVDSDesStruct  SiS_PanelTypeNS_1[]=
-{
-	{ 8,   0},
-	{ 8,   0},
-	{ 8,   0},
-	{ 8,   0},
-	{ 8,   0},
-	{ 0,   0},
-	{ 0,   0},
-	{ 0,   0},
-	{ 0, 806},
-	{ 0,   0}
-};
-
-static const SiS_LVDSDesStruct  SiS_PanelTypeNS_2[] =
-{
-	{ 0 , 0},
-	{ 0 , 0},
-	{ 0 , 0},
-	{ 0 , 0},
-	{ 0 , 0},
-	{ 0 , 0},
-	{ 0 , 0},
-	{ 0 , 0},
-	{ 0 , 0},
-	{ 0 , 0}
-};
-
 /* Chrontel TV Skew */
 
 static const SiS_LVDSDesStruct  SiS_CHTVUNTSCDesData[]=
@@ -2453,63 +2101,6 @@ static const SiS_LVDSCRT1DataStruct  SiS_LVDSCRT11280x768_2_H[] =
    0x01}}
 };
 
-static const SiS_LVDSCRT1DataStruct  SiS_LVDSCRT1XXXxXXX_1[] =
-{
- {{0x5f,0x4f,0x82,0x55,0x81,0xbf,0x1f,
-   0x9c,0x8e,0x96,0xb9,0x30,0x00,0x05,
-   0x00}},
- {{0x5f,0x4f,0x82,0x55,0x81,0xbf,0x1f,
-   0x9c,0x8e,0x96,0xb9,0x30,0x00,0x05,
-   0x00}},
- {{0x5f,0x4f,0x82,0x55,0x81,0xbf,0x1f,
-   0x9c,0x8e,0x96,0xb9,0x30,0x00,0x05,
-   0x00}},
- {{0x5f,0x4f,0x82,0x55,0x81,0xbf,0x1f,
-   0x9c,0x8e,0x96,0xb9,0x30,0x00,0x05,
-   0x00}},
- {{0x5f,0x4f,0x82,0x55,0x81,0x0b,0x3e,
-   0xe9,0x8b,0xe7,0x04,0x00,0x00,0x05,
-   0x00}},
- {{0x7f,0x63,0x83,0x6c,0x1c,0x72,0xf0,
-   0x58,0x8c,0x57,0x73,0x20,0x00,0x06,
-   0x01}},
- {{0xa3,0x7f,0x87,0x86,0x97,0x24,0xf5,
-   0x02,0x88,0xff,0x25,0x10,0x00,0x02,
-   0x01}},
- {{0xce,0x9f,0x92,0xa8,0x14,0x28,0x5a,
-   0x00,0x84,0xff,0x29,0x09,0x00,0x07,
-   0x01}},
- {{0xce,0x9f,0x92,0xa9,0x17,0x24,0xf5,
-   0x02,0x88,0xff,0x25,0x10,0x00,0x07,
-   0x01}}
-};
-
-static const SiS_LVDSCRT1DataStruct  SiS_LVDSCRT1XXXxXXX_1_H[] =
-{
- {{0x38,0x27,0x9c,0x2c,0x80,0xbf,0x1f,
-   0x9c,0x8e,0x96,0xb9,0x30,0x00,0x00,
-   0x00}},
- {{0x38,0x27,0x9c,0x2c,0x80,0xbf,0x1f,
-   0x9c,0x8e,0x96,0xb9,0x30,0x00,0x00,
-   0x00}},
- {{0x38,0x27,0x9c,0x2c,0x80,0xbf,0x1f,
-   0x9c,0x8e,0x96,0xb9,0x30,0x00,0x00,
-   0x00}},
- {{0x38,0x27,0x9c,0x2c,0x80,0xbf,0x1f,
-   0x9c,0x8e,0x96,0xb9,0x30,0x00,0x00,
-   0x00}},
- {{0x38,0x27,0x9c,0x2c,0x80,0x0b,0x3e,
-   0xe9,0x8b,0xe7,0x04,0x00,0x00,0x00,
-   0x00}},
- {{0x4d,0x31,0x91,0x3b,0x03,0x72,0xf0,
-   0x58,0x8c,0x57,0x73,0x20,0x00,0x01,
-   0x01}},
- {{0x63,0x3f,0x87,0x4a,0x92,0x24,0xf5,
-   0x02,0x88,0xff,0x25,0x10,0x00,0x01,
-   0x01}}
-};
-
-
 /**************************************************************/
 /* COMMON --------------------------------------------------- */
 /**************************************************************/
@@ -2770,7 +2361,8 @@ static const SiS_PlasmaTables SiS_PlasmaTable[] = {
    { 0x0000 }
 };
 
-USHORT  SiS_GetModeID(int VGAEngine, ULONG VBFlags, int HDisplay, int VDisplay, int Depth, BOOLEAN FSTN);
+USHORT  SiS_GetModeID(int VGAEngine, ULONG VBFlags, int HDisplay, int VDisplay,
+			  int Depth, BOOLEAN FSTN, int LCDwith, int LCDheight);
 USHORT  SiS_GetModeID_LCD(int VGAEngine, ULONG VBFlags, int HDisplay, int VDisplay, int Depth, BOOLEAN FSTN,
                           USHORT CustomT, int LCDwith, int LCDheight);
 USHORT  SiS_GetModeID_TV(int VGAEngine, ULONG VBFlags, int HDisplay, int VDisplay, int Depth);
@@ -2791,6 +2383,7 @@ void	SiS_DisplayOn(SiS_Private *SiS_Pr);
 void	SiS_DisplayOff(SiS_Private *SiS_Pr);
 void	SiSRegInit(SiS_Private *SiS_Pr, SISIOADDRESS BaseAddr);
 void	SiSSetLVDSetc(SiS_Private *SiS_Pr, PSIS_HW_INFO HwInfo);
+BOOLEAN SiSDetermineROMLayout661(SiS_Private *SiS_Pr, PSIS_HW_INFO HwInfo);
 void	SiS_SetEnableDstn(SiS_Private *SiS_Pr, int enable);
 void	SiS_SetEnableFstn(SiS_Private *SiS_Pr, int enable);
 void	SiS_GetVBType(SiS_Private *SiS_Pr, PSIS_HW_INFO HwInfo);
@@ -2801,6 +2394,7 @@ USHORT	SiS_GetColorDepth(SiS_Private *SiS_Pr, USHORT ModeNo, USHORT ModeIdIndex)
 USHORT	SiS_GetOffset(SiS_Private *SiS_Pr,USHORT ModeNo,USHORT ModeIdIndex,
               USHORT RefreshRateTableIndex,PSIS_HW_INFO HwInfo);
 void	SiS_LoadDAC(SiS_Private *SiS_Pr, PSIS_HW_INFO HwInfo, USHORT ModeNo, USHORT ModeIdIndex);
+void	SiS_CalcLCDACRT1Timing(SiS_Private *SiS_Pr,USHORT ModeNo,USHORT ModeIdIndex);
 #ifdef LINUX_XF86
 BOOLEAN	SiSSetMode(SiS_Private *SiS_Pr, PSIS_HW_INFO HwInfo,ScrnInfoPtr pScrn,USHORT ModeNo, BOOLEAN dosetpitch);
 BOOLEAN	SiSBIOSSetMode(SiS_Private *SiS_Pr, PSIS_HW_INFO HwInfo, ScrnInfoPtr pScrn,
@@ -2821,10 +2415,7 @@ int    sisfb_mode_rate_to_dclock(SiS_Private *SiS_Pr, PSIS_HW_INFO HwInfo,
 			      unsigned char modeno, unsigned char rateindex);
 int    sisfb_mode_rate_to_ddata(SiS_Private *SiS_Pr, PSIS_HW_INFO HwInfo,
 			 unsigned char modeno, unsigned char rateindex,
-			 ULONG *left_margin, ULONG *right_margin,
-			 ULONG *upper_margin, ULONG *lower_margin,
-			 ULONG *hsync_len, ULONG *vsync_len,
-			 ULONG *sync, ULONG *vmode);
+			 struct fb_var_screeninfo *var);
 BOOLEAN sisfb_gettotalfrommode(SiS_Private *SiS_Pr, PSIS_HW_INFO HwInfo,
 		       unsigned char modeno, int *htotal, int *vtotal, unsigned char rateindex);
 #endif
diff --git a/drivers/video/sis/init301.c b/drivers/video/sis/init301.c
index 82a73bf2b..e4b1aa297 100644
--- a/drivers/video/sis/init301.c
+++ b/drivers/video/sis/init301.c
@@ -1,9 +1,10 @@
 /* $XFree86$ */
+/* $XdotOrg$ */
 /*
  * Mode initializing code (CRT2 section)
  * for SiS 300/305/540/630/730 and
- *     SiS 315/550/650/M650/651/661FX/M661xX/740/741/M741/330/660/M660/760/M760
- * (Universal module for Linux kernel framebuffer and XFree86 4.x)
+ *     SiS 315/550/650/M650/651/661FX/M661xX/740/741(GX)/M741/330/660/M660/760/M760
+ * (Universal module for Linux kernel framebuffer and XFree86/X.org 4.x)
  *
  * Copyright (C) 2001-2004 by Thomas Winischhofer, Vienna, Austria
  *
@@ -34,13 +35,10 @@
  * * 2) Redistributions in binary form must reproduce the above copyright
  * *    notice, this list of conditions and the following disclaimer in the
  * *    documentation and/or other materials provided with the distribution.
- * * 3) All advertising materials mentioning features or use of this software
- * *    must display the following acknowledgement: "This product includes
- * *    software developed by Thomas Winischhofer, Vienna, Austria."
- * * 4) The name of the author may not be used to endorse or promote products
+ * * 3) The name of the author may not be used to endorse or promote products
  * *    derived from this software without specific prior written permission.
  * *
- * * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR
+ * * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESSED 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,
@@ -76,10 +74,6 @@
 
 #include "init301.h"
 
-#if 0
-#define TWNEWPANEL
-#endif
-
 #ifdef SIS300
 #include "oem300.h"
 #endif
@@ -91,6 +85,8 @@
 #define SiS_I2CDELAY      1000
 #define SiS_I2CDELAYSHORT  150
 
+static USHORT SiS_GetBIOSLCDResInfo(SiS_Private *SiS_Pr);
+
 /*********************************************/
 /*         HELPER: Lock/Unlock CRT2          */
 /*********************************************/
@@ -98,29 +94,19 @@
 void
 SiS_UnLockCRT2(SiS_Private *SiS_Pr, PSIS_HW_INFO HwInfo)
 {
-  if(HwInfo->jChipType >= SIS_315H)
-     SiS_SetRegOR(SiS_Pr->SiS_Part1Port,0x2f,0x01);
-  else
-     SiS_SetRegOR(SiS_Pr->SiS_Part1Port,0x24,0x01);
+   if(HwInfo->jChipType >= SIS_315H)
+      SiS_SetRegOR(SiS_Pr->SiS_Part1Port,0x2f,0x01);
+   else
+      SiS_SetRegOR(SiS_Pr->SiS_Part1Port,0x24,0x01);
 }
 
 void
 SiS_LockCRT2(SiS_Private *SiS_Pr, PSIS_HW_INFO HwInfo)
 {
-  if(HwInfo->jChipType >= SIS_315H)
-     SiS_SetRegAND(SiS_Pr->SiS_Part1Port,0x2F,0xFE);
-  else
-     SiS_SetRegAND(SiS_Pr->SiS_Part1Port,0x24,0xFE);
-}
-
-/*********************************************/
-/*            HELPER: Enable CRT2            */
-/*********************************************/
-
-void
-SiS_EnableCRT2(SiS_Private *SiS_Pr)
-{
-  SiS_SetRegOR(SiS_Pr->SiS_P3c4,0x1E,0x20);
+   if(HwInfo->jChipType >= SIS_315H)
+      SiS_SetRegAND(SiS_Pr->SiS_Part1Port,0x2F,0xFE);
+   else
+      SiS_SetRegAND(SiS_Pr->SiS_Part1Port,0x24,0xFE);
 }
 
 /*********************************************/
@@ -130,7 +116,10 @@ SiS_EnableCRT2(SiS_Private *SiS_Pr)
 static void
 SiS_SetRegSR11ANDOR(SiS_Private *SiS_Pr, PSIS_HW_INFO HwInfo, USHORT DataAND, USHORT DataOR)
 {
-   if(HwInfo->jChipType >= SIS_661) DataAND &= 0x0f;
+   if(HwInfo->jChipType >= SIS_661) {
+      DataAND &= 0x0f;
+      DataOR  &= 0x0f;
+   }
    SiS_SetRegANDOR(SiS_Pr->SiS_P3c4,0x11,DataAND,DataOR);
 }
 
@@ -138,117 +127,45 @@ SiS_SetRegSR11ANDOR(SiS_Private *SiS_Pr, PSIS_HW_INFO HwInfo, USHORT DataAND, US
 /*    HELPER: Get Pointer to LCD structure   */
 /*********************************************/
 
-/* For 661 series only */
 #ifdef SIS315H
-#if 0   /* Need to wait until hardware using this really exists */
 static UCHAR *
-GetLCDPtr661(SiS_Private *SiS_Pr, PSIS_HW_INFO HwInfo, int tabletype,
-             USHORT ModeNo, USHORT ModeIdIndex, USHORT RRTI)
+GetLCDStructPtr661(SiS_Private *SiS_Pr, PSIS_HW_INFO HwInfo)
 {
-  UCHAR *ROMAddr =  HwInfo->pjVirtualRomBase;
-  UCHAR *tableptr = NULL;
-  UCHAR tablelengths[] = { 8, 7, 6, 6, 8, 6, 0, 0, 0 };
-  USHORT modeflag, CRT2Index, tablelength, lcdid, myid, tableptri;
-
-  if(ModeNo <= 0x13) {
-     modeflag = SiS_Pr->SiS_SModeIDTable[ModeIdIndex].St_ModeFlag;
-     CRT2Index = SiS_Pr->SiS_SModeIDTable[ModeIdIndex].St_CRT2CRTC;
-  } else {
-     modeflag = SiS_Pr->SiS_EModeIDTable[ModeIdIndex].Ext_ModeFlag;
-     CRT2Index = SiS_Pr->SiS_RefIndex[RRTI].Ext_CRT2CRTC;
-     /* This is total bullshit: */
-     if(SiS_Pr->SiS_EModeIDTable[ModeIdIndex].Ext_RESINFO == SIS_RI_720x576) CRT2Index = 10;
-  }
-
-  if(tabletype <= 1) {
-#if 0	/* Not yet implemented */
-     if(ModeNo <= 0x13) {
-        CRT2Index = SiS_Pr->SiS_SModeIDTable[ModeIdIndex]. + 5;
-     } else {
-        CRT2Index = SiS_Pr->SiS_RefIndex[RRTI]. + 5;
-     }
-     if(tabletype & 1) CRT2Index >>= 4;
-#endif
-  }
-
-  CRT2Index &= 0x0f;
-
-  tablelength = tablelengths[tabletype];
-  if(SiS_Pr->SiS_LCDInfo & LCDPass11) {
-     if((tabletype == 5) || (tabletype == 7)) tablelength = 8;
-     if((tabletype == 3) || (tabletype == 8)) tablelength = 8;
-  }
-
-  if(!tablelength) return NULL;
-
-  tableptri = ROMAddr[0x222] | (ROMAddr[0x223] << 8);
-  tableptri += (tabletype << 1);
-  if(!tableptri) return NULL;
-  tableptr = &ROMAddr[tableptri];
-
-  do {
-     lcdid = tableptr[0];
-     if(lcdid == 0xff) break;
-     myid = SiS_Pr->SiS_LCDResInfo;
-     if((lcdid & 0x80) && (lcdid != 0x80)) {
-        lcdid &= 0x7f;
-	myid = SiS_Pr->SiS_LCDTypeInfo;
-     }
-     if(SiS_Pr->SiS_LCDInfo & LCDPass11) myid &= ~0x1f;
-
-     if(myid == lcdid) {
-	lcdid = tableptr[1] | (tableptr[2] << 8);
-	myid = SiS_Pr->SiS_LCDInfo661;
-	if(modeflag & HalfDCLK) myid |= 0x200;
-	if(ModeNo <= 0x13)      myid |= 0x400;
-	lcdid &= myid;
-	myid = tableptr[3] | (tableptr[4] << 8);
-	if(lcdid == myid) break;
-     }
-     tableptr += 7;
-  } while (1);
+   UCHAR  *ROMAddr = HwInfo->pjVirtualRomBase;
+   UCHAR  *myptr = NULL;
+   USHORT romindex = 0;
 
-  if(lcdid == myid) {
-     lcdid = tableptr[5] | (tableptr[6] << 8);
-     lcdid += (tablelength * CRT2Index);
-     return((UCHAR *)&ROMAddr[lcdid]);
-  }
+   /* Use the BIOS tables only for LVDS panels; DVI is unreliable
+    * due to the variaty of panels the BIOS doesn't know about.
+    */
 
-  return NULL;
+   if((SiS_Pr->SiS_ROMNew) && (SiS_Pr->SiS_VBType & VB_SIS301LV302LV)) {
+      myptr = (UCHAR *)SiS_LCDStruct661;
+      romindex = SISGETROMW(0x100);
+      if(romindex) {
+         romindex += ((SiS_GetReg(SiS_Pr->SiS_P3d4,0x7d) & 0x1f) * 26);
+         myptr = &ROMAddr[romindex];
+      }
+   }
+   return myptr;
 }
-#endif
 
-static UCHAR *
-GetLCDStructPtr661(SiS_Private *SiS_Pr, PSIS_HW_INFO HwInfo)
+static USHORT
+GetLCDStructPtr661_2(SiS_Private *SiS_Pr, PSIS_HW_INFO HwInfo)
 {
    UCHAR  *ROMAddr = HwInfo->pjVirtualRomBase;
-   USHORT lcdres = SiS_Pr->SiS_LCDResInfo;
-   USHORT lcdtype = SiS_Pr->SiS_LCDTypeInfo;
-   USHORT romindex=0;
-   UCHAR  *myptr = NULL;
-   UCHAR  lcdid;
+   USHORT romptr = 0;
 
-   if((ROMAddr) && SiS_Pr->SiS_UseROM) {
-      romindex = ROMAddr[0x256] | (ROMAddr[0x257] << 8);
-   }
-   if(romindex) {
-      myptr = &ROMAddr[romindex];
-   } else {
-      myptr = (UCHAR *)SiS_LCDStruct661;
-   }
+   /* Use the BIOS tables only for LVDS panels; DVI is unreliable
+    * due to the variaty of panels the BIOS doesn't know about.
+    */
 
-   while(myptr[0] != 0xff) {
-      lcdid = myptr[0];
-      if((lcdid & 0x80) && (lcdid != 0x80)) {
-         lcdres = lcdtype;
-	 lcdid &= 0x7f;
-      }
-      if(lcdid == lcdres) break;
-      myptr += 26;
+   if((SiS_Pr->SiS_ROMNew) && (SiS_Pr->SiS_VBType & VB_SIS301LV302LV)) {
+      romptr = SISGETROMW(0x102);
+      romptr += ((SiS_GetReg(SiS_Pr->SiS_P3d4,0x36) >> 4) * SiS_Pr->SiS661LCD2TableSize);
    }
-   if(myptr[0] == 0xff) return NULL;
 
-   return myptr;
+   return(romptr);
 }
 #endif
 
@@ -261,71 +178,72 @@ SiS_AdjustCRT2Rate(SiS_Private *SiS_Pr, USHORT ModeNo, USHORT ModeIdIndex,
                    USHORT RefreshRateTableIndex, USHORT *i,
 		   PSIS_HW_INFO HwInfo)
 {
-  USHORT tempax,tempbx,infoflag;
-
-  tempbx = SiS_Pr->SiS_RefIndex[RefreshRateTableIndex + (*i)].ModeID;
+  USHORT checkmask=0,modeid,infoflag;
 
-  tempax = 0;
+  modeid = SiS_Pr->SiS_RefIndex[RefreshRateTableIndex + (*i)].ModeID;
 
   if(SiS_Pr->SiS_VBType & VB_SISVB) {
 
      if(SiS_Pr->SiS_VBInfo & SetCRT2ToRAMDAC) {
 
-      	tempax |= SupportRAMDAC2;
+      	checkmask |= SupportRAMDAC2;
 	if(HwInfo->jChipType >= SIS_315H) {
-	   tempax |= SupportRAMDAC2_135;
+	   checkmask |= SupportRAMDAC2_135;
 	   if(SiS_Pr->SiS_VBType & VB_SIS301BLV302BLV) {
-	      tempax |= SupportRAMDAC2_162;
+	      checkmask |= SupportRAMDAC2_162;
 	      if(SiS_Pr->SiS_VBType & VB_SIS301C) {
-		 tempax |= SupportRAMDAC2_202;
+		 checkmask |= SupportRAMDAC2_202;
 	      }
 	   }
 	}
 
      } else if(SiS_Pr->SiS_VBInfo & (SetCRT2ToLCD | SetCRT2ToLCDA)) {
 
-     	tempax |= SupportLCD;
+     	checkmask |= SupportLCD;
 	if(HwInfo->jChipType >= SIS_315H) {
-	   if(SiS_Pr->SiS_VBType & VB_SIS301B302B) {
-	      if(SiS_Pr->SiS_LCDInfo & DontExpandLCD) {
-	         if(tempbx == 0x2e) {  /* 640x480 */
-		    tempax |= Support64048060Hz;
-		 }
+	   if(SiS_Pr->SiS_VBType & VB_SISVB) {
+	      if((SiS_Pr->SiS_LCDInfo & DontExpandLCD) && (SiS_Pr->SiS_LCDInfo & LCDPass11)) {
+	         if(modeid == 0x2e) checkmask |= Support64048060Hz;
 	      }
 	   }
 	}
 
      } else if(SiS_Pr->SiS_VBInfo & SetCRT2ToHiVision) {
 
-      	tempax |= SupportHiVision;
+      	checkmask |= SupportHiVision;
 
      } else if(SiS_Pr->SiS_VBInfo & (SetCRT2ToYPbPr525750|SetCRT2ToAVIDEO|SetCRT2ToSVIDEO|SetCRT2ToSCART)) {
 
-        tempax |= SupportTV;
+        checkmask |= SupportTV;
 	if(SiS_Pr->SiS_VBType & VB_SIS301BLV302BLV) {
-	   tempax |= SupportTV1024;
+	   checkmask |= SupportTV1024;
+	   if(SiS_Pr->SiS_VBInfo & SetCRT2ToYPbPr525750) {
+	      if(SiS_Pr->SiS_TVMode & TVSetYPbPr750p) {
+	         checkmask |= SupportYPbPr750p;
+	      }
+	   }
 	}
 
      }
 
-  } else {	/* for LVDS  */
+  } else {	/* LVDS */
 
      if(SiS_Pr->SiS_IF_DEF_CH70xx != 0) {
      	if(SiS_Pr->SiS_VBInfo & SetCRT2ToTV) {
-           tempax |= SupportCHTV;
+           checkmask |= SupportCHTV;
       	}
      }
 
      if(SiS_Pr->SiS_VBInfo & SetCRT2ToLCD) {
-     	tempax |= SupportLCD;
+     	checkmask |= SupportLCD;
      }
 
   }
 
   /* Look backwards in table for matching CRT2 mode */
-  for(; SiS_Pr->SiS_RefIndex[RefreshRateTableIndex+(*i)].ModeID == tempbx; (*i)--) {
+  for(; SiS_Pr->SiS_RefIndex[RefreshRateTableIndex+(*i)].ModeID == modeid; (*i)--) {
      infoflag = SiS_Pr->SiS_RefIndex[RefreshRateTableIndex + (*i)].Ext_InfoFlag;
-     if(infoflag & tempax) return(1);
+     if(infoflag & checkmask) return TRUE;
      if((*i) == 0) break;
   }
 
@@ -333,17 +251,17 @@ SiS_AdjustCRT2Rate(SiS_Private *SiS_Pr, USHORT ModeNo, USHORT ModeIdIndex,
    * for a matching CRT2 mode if no mode was found yet.
    */
   for((*i) = 0; ; (*i)++) {
-     if(SiS_Pr->SiS_RefIndex[RefreshRateTableIndex + (*i)].ModeID != tempbx) {
-     	return(0);
+     if(SiS_Pr->SiS_RefIndex[RefreshRateTableIndex + (*i)].ModeID != modeid) {
+     	return FALSE;
      }
      infoflag = SiS_Pr->SiS_RefIndex[RefreshRateTableIndex + (*i)].Ext_InfoFlag;
-     if(infoflag & tempax) return(1);
+     if(infoflag & checkmask) return TRUE;
   }
-  return(1);
+  return TRUE;
 }
 
 /*********************************************/
-/*              Get rate pointer             */
+/*              Get rate index               */
 /*********************************************/
 
 USHORT
@@ -361,20 +279,19 @@ SiS_GetRatePtr(SiS_Private *SiS_Pr, USHORT ModeNo, USHORT ModeIdIndex,
   /* Do NOT check for UseCustomMode here, will skrew up FIFO */
   if(ModeNo == 0xfe) return 0;
 
-  if(ModeNo <= 0x13)
+  if(ModeNo <= 0x13) {
      modeflag = SiS_Pr->SiS_SModeIDTable[ModeIdIndex].St_ModeFlag;
-  else
+  } else {
      modeflag = SiS_Pr->SiS_EModeIDTable[ModeIdIndex].Ext_ModeFlag;
+  }
 
   if(SiS_Pr->SiS_IF_DEF_CH70xx != 0) {
      if(SiS_Pr->SiS_VBInfo & SetCRT2ToTV) {
-     	if(modeflag & HalfDCLK) return(0);
+     	if(modeflag & HalfDCLK) return 0;
      }
   }
 
-  if(ModeNo < 0x14) return(0xFFFF);
-
-  /* CR33 holds refresh rate index for CRT1 [3:0] and CRT2 [7:4]. */
+  if(ModeNo < 0x14) return 0xFFFF;
 
   index = (SiS_GetReg(SiS_Pr->SiS_P3d4,0x33) >> SiS_Pr->SiS_SelectCRT2Rate) & 0x0F;
   backupindex = index;
@@ -389,7 +306,7 @@ SiS_GetRatePtr(SiS_Private *SiS_Pr, USHORT ModeNo, USHORT ModeIdIndex,
 	}
 	if(SiS_Pr->SiS_VBInfo & (SetCRT2ToLCD | SetCRT2ToLCDA)) {
 	   if(!(SiS_Pr->SiS_VBType & VB_NoLCD)) {
-              temp = LCDRefreshIndex[SiS_Pr->SiS_LCDResInfo];
+              temp = LCDRefreshIndex[SiS_GetBIOSLCDResInfo(SiS_Pr)];
               if(index > temp) index = temp;
 	   }
 	}
@@ -462,37 +379,39 @@ SiS_SaveCRT2Info(SiS_Private *SiS_Pr, USHORT ModeNo)
 /*    HELPER: GET SOME DATA FROM BIOS ROM    */
 /*********************************************/
 
+#ifdef SIS300
 static BOOLEAN
 SiS_CR36BIOSWord23b(SiS_Private *SiS_Pr, PSIS_HW_INFO HwInfo)
 {
+  UCHAR *ROMAddr = (UCHAR *)HwInfo->pjVirtualRomBase;
   USHORT temp,temp1;
-  UCHAR *ROMAddr;
 
-  if((ROMAddr = (UCHAR *)HwInfo->pjVirtualRomBase) && SiS_Pr->SiS_UseROM) {
+  if(SiS_Pr->SiS_UseROM) {
      if((ROMAddr[0x233] == 0x12) && (ROMAddr[0x234] == 0x34)) {
         temp = 1 << ((SiS_GetReg(SiS_Pr->SiS_P3d4,0x36) & 0xff) >> 4);
-        temp1 = (ROMAddr[0x23c] << 8) | ROMAddr[0x23b];
-        if(temp1 & temp) return(1);
+        temp1 = SISGETROMW(0x23b);
+        if(temp1 & temp) return TRUE;
      }
   }
-  return(0);
+  return FALSE;
 }
 
 static BOOLEAN
 SiS_CR36BIOSWord23d(SiS_Private *SiS_Pr, PSIS_HW_INFO HwInfo)
 {
+  UCHAR *ROMAddr = (UCHAR *)HwInfo->pjVirtualRomBase;
   USHORT temp,temp1;
-  UCHAR *ROMAddr;
 
-  if((ROMAddr = (UCHAR *)HwInfo->pjVirtualRomBase) && SiS_Pr->SiS_UseROM) {
+  if(SiS_Pr->SiS_UseROM) {
      if((ROMAddr[0x233] == 0x12) && (ROMAddr[0x234] == 0x34)) {
         temp = 1 << ((SiS_GetReg(SiS_Pr->SiS_P3d4,0x36) & 0xff) >> 4);
-        temp1 = (ROMAddr[0x23e] << 8) | ROMAddr[0x23d];
-        if(temp1 & temp) return(1);
+        temp1 = SISGETROMW(0x23d);
+        if(temp1 & temp) return TRUE;
      }
   }
-  return(0);
+  return FALSE;
 }
+#endif
 
 /*********************************************/
 /*          HELPER: DELAY FUNCTIONS          */
@@ -508,6 +427,7 @@ SiS_DDC2Delay(SiS_Private *SiS_Pr, USHORT delaytime)
   }
 }
 
+#if defined(SIS300) || defined(SIS315H)
 static void
 SiS_GenericDelay(SiS_Private *SiS_Pr, USHORT delay)
 {
@@ -522,6 +442,7 @@ SiS_GenericDelay(SiS_Private *SiS_Pr, USHORT delay)
      delay--;
   }
 }
+#endif
 
 #ifdef SIS315H
 static void
@@ -533,6 +454,7 @@ SiS_LongDelay(SiS_Private *SiS_Pr, USHORT delay)
 }
 #endif
 
+#if defined(SIS300) || defined(SIS315H)
 static void
 SiS_ShortDelay(SiS_Private *SiS_Pr, USHORT delay)
 {
@@ -540,12 +462,15 @@ SiS_ShortDelay(SiS_Private *SiS_Pr, USHORT delay)
      SiS_GenericDelay(SiS_Pr,0x42);
   }
 }
+#endif
 
 static void
 SiS_PanelDelay(SiS_Private *SiS_Pr, PSIS_HW_INFO HwInfo, USHORT DelayTime)
 {
+#if defined(SIS300) || defined(SIS315H)
   UCHAR  *ROMAddr = HwInfo->pjVirtualRomBase;
   USHORT PanelID, DelayIndex, Delay=0;
+#endif
 
   if(HwInfo->jChipType < SIS_315H) {
 
@@ -560,23 +485,19 @@ SiS_PanelDelay(SiS_Private *SiS_Pr, PSIS_HW_INFO HwInfo, USHORT DelayTime)
          Delay = 3;
       } else {
          if(DelayTime >= 2) DelayTime -= 2;
-
          if(!(DelayTime & 0x01)) {
        	    Delay = SiS_Pr->SiS_PanelDelayTbl[DelayIndex].timer[0];
          } else {
        	    Delay = SiS_Pr->SiS_PanelDelayTbl[DelayIndex].timer[1];
          }
-	 if((ROMAddr) && (SiS_Pr->SiS_UseROM)) {
+	 if(SiS_Pr->SiS_UseROM) {
             if(ROMAddr[0x220] & 0x40) {
-               if(!(DelayTime & 0x01)) {
-	          Delay = (USHORT)ROMAddr[0x225];
-               } else {
-	    	  Delay = (USHORT)ROMAddr[0x226];
-               }
+               if(!(DelayTime & 0x01)) Delay = (USHORT)ROMAddr[0x225];
+               else 	    	       Delay = (USHORT)ROMAddr[0x226];
             }
          }
       }
-      SiS_ShortDelay(SiS_Pr,Delay);
+      SiS_ShortDelay(SiS_Pr, Delay);
 
 #endif  /* SIS300 */
 
@@ -584,11 +505,19 @@ SiS_PanelDelay(SiS_Private *SiS_Pr, PSIS_HW_INFO HwInfo, USHORT DelayTime)
 
 #ifdef SIS315H
 
-      if(HwInfo->jChipType >= SIS_330) return;
+      if((HwInfo->jChipType >= SIS_661)    ||
+         (HwInfo->jChipType <= SIS_315PRO) ||
+	 (HwInfo->jChipType == SIS_330)) {
+
+         if(!(DelayTime & 0x01)) {
+	    SiS_DDC2Delay(SiS_Pr, 0x1000);
+         } else {
+	    SiS_DDC2Delay(SiS_Pr, 0x4000);
+         }
 
-      if((SiS_Pr->SiS_IF_DEF_LVDS == 1) ||
+      } else if((SiS_Pr->SiS_IF_DEF_LVDS == 1) /* ||
          (SiS_Pr->SiS_CustomT == CUT_COMPAQ1280) ||
-	 (SiS_Pr->SiS_CustomT == CUT_CLEVO1400)) {			/* 315 series, LVDS; Special */
+	 (SiS_Pr->SiS_CustomT == CUT_CLEVO1400) */ ) {			/* 315 series, LVDS; Special */
 
          if(SiS_Pr->SiS_IF_DEF_CH70xx == 0) {
             PanelID = SiS_GetReg(SiS_Pr->SiS_P3d4,0x36);
@@ -609,7 +538,7 @@ SiS_PanelDelay(SiS_Private *SiS_Pr, PSIS_HW_INFO HwInfo, USHORT DelayTime)
                } else {
        		  Delay = SiS_Pr->SiS_PanelDelayTblLVDS[DelayIndex].timer[1];
                }
-	       if((ROMAddr) && (SiS_Pr->SiS_UseROM)) {
+	       if((SiS_Pr->SiS_UseROM) && (!(SiS_Pr->SiS_ROMNew))) {
                   if(ROMAddr[0x13c] & 0x40) {
                      if(!(DelayTime & 0x01)) {
 	    	        Delay = (USHORT)ROMAddr[0x17e];
@@ -619,7 +548,7 @@ SiS_PanelDelay(SiS_Private *SiS_Pr, PSIS_HW_INFO HwInfo, USHORT DelayTime)
                   }
                }
             }
-	    SiS_ShortDelay(SiS_Pr,Delay);
+	    SiS_ShortDelay(SiS_Pr, Delay);
 	 }
 
       } else if(SiS_Pr->SiS_VBType & VB_SISVB) {			/* 315 series, all bridges */
@@ -662,7 +591,6 @@ SiS_WaitRetrace1(SiS_Private *SiS_Pr)
   USHORT watchdog;
 
   if(SiS_GetReg(SiS_Pr->SiS_P3c4,0x1f) & 0xc0) return;
-
   if(!(SiS_GetReg(SiS_Pr->SiS_P3d4,0x17) & 0x80)) return;
 
   watchdog = 65535;
@@ -671,6 +599,7 @@ SiS_WaitRetrace1(SiS_Private *SiS_Pr)
   while((!(SiS_GetRegByte(SiS_Pr->SiS_P3da) & 0x08)) && --watchdog);
 }
 
+#if defined(SIS300) || defined(SIS315H)
 static void
 SiS_WaitRetrace2(SiS_Private *SiS_Pr, USHORT reg)
 {
@@ -681,6 +610,7 @@ SiS_WaitRetrace2(SiS_Private *SiS_Pr, USHORT reg)
   watchdog = 65535;
   while((!(SiS_GetReg(SiS_Pr->SiS_Part1Port,reg) & 0x02)) && --watchdog);
 }
+#endif
 
 static void
 SiS_WaitVBRetrace(SiS_Private *SiS_Pr, PSIS_HW_INFO HwInfo)
@@ -718,10 +648,10 @@ SiS_VBWait(SiS_Private *SiS_Pr)
        tempal = SiS_GetRegByte(SiS_Pr->SiS_P3da);
        if(temp & 0x01) {
           if((tempal & 0x08))  continue;
-          if(!(tempal & 0x08)) break;
+          else break;
        } else {
           if(!(tempal & 0x08)) continue;
-          if((tempal & 0x08))  break;
+          else break;
        }
     }
     temp ^= 0x01;
@@ -742,15 +672,14 @@ SiS_VBLongWait(SiS_Private *SiS_Pr)
 /*               HELPER: MISC                */
 /*********************************************/
 
+#ifdef SIS300
 static BOOLEAN
 SiS_Is301B(SiS_Private *SiS_Pr)
 {
-  USHORT flag;
-
-  flag = SiS_GetReg(SiS_Pr->SiS_Part4Port,0x01);
-  if(flag >= 0xb0) return TRUE;
+  if(SiS_GetReg(SiS_Pr->SiS_Part4Port,0x01) >= 0xb0) return TRUE;
   return FALSE;
 }
+#endif
 
 static BOOLEAN
 SiS_CRT2IsLCD(SiS_Private *SiS_Pr, PSIS_HW_INFO HwInfo)
@@ -796,6 +725,16 @@ SiS_IsVAMode(SiS_Private *SiS_Pr, PSIS_HW_INFO HwInfo)
   return FALSE;
 }
 
+#ifdef SIS315H
+static BOOLEAN
+SiS_IsVAorLCD(SiS_Private *SiS_Pr, PSIS_HW_INFO HwInfo)
+{
+  if(SiS_IsVAMode(SiS_Pr,HwInfo))   return TRUE;
+  if(SiS_CRT2IsLCD(SiS_Pr, HwInfo)) return TRUE;
+  return FALSE;
+}
+#endif
+
 static BOOLEAN
 SiS_IsDualLink(SiS_Private *SiS_Pr, PSIS_HW_INFO HwInfo)
 {
@@ -815,7 +754,7 @@ static BOOLEAN
 SiS_TVEnabled(SiS_Private *SiS_Pr, PSIS_HW_INFO HwInfo)
 {
   if((SiS_GetReg(SiS_Pr->SiS_Part2Port,0x00) & 0x0f) != 0x0c) return TRUE;
-  if(SiS_Pr->SiS_VBType & (VB_301C | VB_SIS301LV302LV)) {
+  if(SiS_Pr->SiS_VBType & (VB_SIS301C | VB_SIS301LV302LV)) {
      if(SiS_GetReg(SiS_Pr->SiS_Part2Port,0x4d) & 0x10) return TRUE;
   }
   return FALSE;
@@ -835,11 +774,8 @@ SiS_LCDAEnabled(SiS_Private *SiS_Pr, PSIS_HW_INFO HwInfo)
 static BOOLEAN
 SiS_WeHaveBacklightCtrl(SiS_Private *SiS_Pr, PSIS_HW_INFO HwInfo)
 {
-  USHORT flag;
-
   if((HwInfo->jChipType >= SIS_315H) && (HwInfo->jChipType < SIS_661)) {
-     flag = SiS_GetReg(SiS_Pr->SiS_P3d4,0x79);
-     if(flag & 0x10) return TRUE;
+     if(SiS_GetReg(SiS_Pr->SiS_P3d4,0x79) & 0x10) return TRUE;
   }
   return FALSE;
 }
@@ -935,12 +871,12 @@ SiS_BridgeIsOn(SiS_Private *SiS_Pr)
   USHORT flag;
 
   if(SiS_Pr->SiS_IF_DEF_LVDS == 1) {
-     return FALSE;
+     return TRUE;
   } else if(SiS_Pr->SiS_VBType & VB_SISVB) {
      flag = SiS_GetReg(SiS_Pr->SiS_Part4Port,0x00);
-     if((flag == 1) || (flag == 2)) return FALSE;
+     if((flag == 1) || (flag == 2)) return TRUE;
   }
-  return TRUE;
+  return FALSE;
 }
 
 static BOOLEAN
@@ -948,21 +884,21 @@ SiS_BridgeIsEnabled(SiS_Private *SiS_Pr, PSIS_HW_INFO HwInfo)
 {
   USHORT flag;
 
-  if(!(SiS_BridgeIsOn(SiS_Pr))) {
+  if(SiS_BridgeIsOn(SiS_Pr)) {
      flag = SiS_GetReg(SiS_Pr->SiS_Part1Port,0x00);
      if(HwInfo->jChipType < SIS_315H) {
        flag &= 0xa0;
-       if((flag == 0x80) || (flag == 0x20)) return FALSE;
+       if((flag == 0x80) || (flag == 0x20)) return TRUE;
      } else {
        flag &= 0x50;
-       if((flag == 0x40) || (flag == 0x10)) return FALSE;
+       if((flag == 0x40) || (flag == 0x10)) return TRUE;
      }
   }
-  return TRUE;
+  return FALSE;
 }
 
 static BOOLEAN
-SiS_BridgeInSlave(SiS_Private *SiS_Pr)
+SiS_BridgeInSlavemode(SiS_Private *SiS_Pr)
 {
   USHORT flag1;
 
@@ -985,7 +921,7 @@ SiS_SetChrontelGPIO(SiS_Private *SiS_Pr, USHORT myvbinfo)
    if(!(SiS_Pr->SiS_ChSW)) return;
 
 #ifndef LINUX_XF86
-   SiS_SetRegLong(0xcf8,0x80000874);		   /* get ACPI base */
+   SiS_SetRegLong(0xcf8,0x80000874);		       /* get ACPI base */
    acpibase = SiS_GetRegLong(0xcfc);
 #else
    acpibase = pciReadLong(0x00000800, 0x74);
@@ -1003,22 +939,19 @@ SiS_SetChrontelGPIO(SiS_Private *SiS_Pr, USHORT myvbinfo)
 }
 
 void
-SiS_GetVBInfo(SiS_Private *SiS_Pr, USHORT ModeNo,
-              USHORT ModeIdIndex,PSIS_HW_INFO HwInfo,
-	      int checkcrt2mode)
+SiS_GetVBInfo(SiS_Private *SiS_Pr, USHORT ModeNo, USHORT ModeIdIndex,
+              PSIS_HW_INFO HwInfo, int checkcrt2mode)
 {
   USHORT tempax,tempbx,temp;
   USHORT modeflag, resinfo=0;
 
   if(ModeNo <= 0x13) {
      modeflag = SiS_Pr->SiS_SModeIDTable[ModeIdIndex].St_ModeFlag;
+  } else if(SiS_Pr->UseCustomMode) {
+     modeflag = SiS_Pr->CModeFlag;
   } else {
-     if(SiS_Pr->UseCustomMode) {
-        modeflag = SiS_Pr->CModeFlag;
-     } else {
-   	modeflag = SiS_Pr->SiS_EModeIDTable[ModeIdIndex].Ext_ModeFlag;
-	resinfo = SiS_Pr->SiS_EModeIDTable[ModeIdIndex].Ext_RESINFO;
-     }
+     modeflag = SiS_Pr->SiS_EModeIDTable[ModeIdIndex].Ext_ModeFlag;
+     resinfo = SiS_Pr->SiS_EModeIDTable[ModeIdIndex].Ext_RESINFO;
   }
 
   SiS_Pr->SiS_SetFlag = 0;
@@ -1026,7 +959,7 @@ SiS_GetVBInfo(SiS_Private *SiS_Pr, USHORT ModeNo,
   SiS_Pr->SiS_ModeType = modeflag & ModeInfoFlag;
 
   tempbx = 0;
-  if(SiS_BridgeIsOn(SiS_Pr) == 0) {
+  if(SiS_BridgeIsOn(SiS_Pr)) {
     	temp = SiS_GetReg(SiS_Pr->SiS_P3d4,0x30);
 #if 0
    	if(HwInfo->jChipType < SIS_661) {
@@ -1054,7 +987,7 @@ SiS_GetVBInfo(SiS_Private *SiS_Pr, USHORT ModeNo,
 		 SiS_SetRegAND(SiS_Pr->SiS_P3d4,0x31,0xbf);
 	      }
 	      if(!(SiS_GetReg(SiS_Pr->SiS_P3d4,0x31) & (DriverMode >> 8))) {
-	         /* Reset LCDA setting */
+	         /* Reset LCDA setting if not driver mode */
 		 SiS_SetRegAND(SiS_Pr->SiS_P3d4,0x38,0xfc);
 	      }
 	      if(IS_SIS650) {
@@ -1071,6 +1004,11 @@ SiS_GetVBInfo(SiS_Private *SiS_Pr, USHORT ModeNo,
           	 tempbx |= SetCRT2ToLCDA;
 	      }
 	   }
+
+	   if(SiS_Pr->SiS_VBType & (VB_SIS301LV|VB_SIS302LV|VB_SIS302ELV)) {
+	      tempbx &= ~(SetCRT2ToRAMDAC);
+	   }
+
 	   if(HwInfo->jChipType >= SIS_661) {
 	      tempbx &= ~(SetCRT2ToYPbPr525750 | SetCRT2ToHiVision);
 	      temp = SiS_GetReg(SiS_Pr->SiS_P3d4,0x38);
@@ -1148,24 +1086,12 @@ SiS_GetVBInfo(SiS_Private *SiS_Pr, USHORT ModeNo,
 				SetPALTV 	   |
 				SwitchCRT2	   |
 				SetSimuScanMode );
-      	   if(tempbx & SetCRT2ToLCDA) {
-              tempbx &= (clearmask | SetCRT2ToLCDA);
-      	   }
-	   if(tempbx & SetCRT2ToRAMDAC) {
-              tempbx &= (clearmask | SetCRT2ToRAMDAC);
-      	   }
-	   if(tempbx & SetCRT2ToLCD) {
-              tempbx &= (clearmask | SetCRT2ToLCD);
-      	   }
-	   if(tempbx & SetCRT2ToSCART) {
-              tempbx &= (clearmask | SetCRT2ToSCART);
-      	   }
-	   if(tempbx & SetCRT2ToHiVision) {
-              tempbx &= (clearmask | SetCRT2ToHiVision);
-      	   }
-	   if(tempbx & SetCRT2ToYPbPr525750) {
-	      tempbx &= (clearmask | SetCRT2ToYPbPr525750);
-	   }
+      	   if(tempbx & SetCRT2ToLCDA)        tempbx &= (clearmask | SetCRT2ToLCDA);
+	   if(tempbx & SetCRT2ToRAMDAC)      tempbx &= (clearmask | SetCRT2ToRAMDAC);
+	   if(tempbx & SetCRT2ToLCD)         tempbx &= (clearmask | SetCRT2ToLCD);
+	   if(tempbx & SetCRT2ToSCART)       tempbx &= (clearmask | SetCRT2ToSCART);
+	   if(tempbx & SetCRT2ToHiVision)    tempbx &= (clearmask | SetCRT2ToHiVision);
+	   if(tempbx & SetCRT2ToYPbPr525750) tempbx &= (clearmask | SetCRT2ToYPbPr525750);
    	} else {
 	   if(HwInfo->jChipType >= SIS_315H) {
 	      if(tempbx & SetCRT2ToLCDA) {
@@ -1193,14 +1119,12 @@ SiS_GetVBInfo(SiS_Private *SiS_Pr, USHORT ModeNo,
       	   }
     	}
 
-    	if(!(tempbx & DriverMode)){
-      	   tempbx |= SetSimuScanMode;
-    	}
+    	if(!(tempbx & DriverMode)) tempbx |= SetSimuScanMode;
 
 	/* LVDS/CHRONTEL (LCD/TV) and 301BDH (LCD) can only be slave in 8bpp modes */
 	if(SiS_Pr->SiS_ModeType <= ModeVGA) {
 	   if( (SiS_Pr->SiS_IF_DEF_LVDS == 1) ||
-	       ((tempbx & SetCRT2ToLCD) && (SiS_Pr->SiS_VBType & VB_NoLCD)) ) {
+	       ((SiS_Pr->SiS_VBType & VB_NoLCD) && (tempbx & SetCRT2ToLCD)) ) {
 	       modeflag &= (~CRT2Mode);
 	   }
 	}
@@ -1218,9 +1142,9 @@ SiS_GetVBInfo(SiS_Private *SiS_Pr, USHORT ModeNo,
 	         }
               }
       	   } else {
-              if(!(SiS_BridgeIsEnabled(SiS_Pr,HwInfo))) {
+              if(SiS_BridgeIsEnabled(SiS_Pr,HwInfo)) {
           	 if(!(tempbx & DriverMode)) {
-            	    if(SiS_BridgeInSlave(SiS_Pr)) {
+            	    if(SiS_BridgeInSlavemode(SiS_Pr)) {
 		       tempbx |= SetSimuScanMode;
             	    }
                  }
@@ -1346,7 +1270,7 @@ SiS_SetTVMode(SiS_Private *SiS_Pr, USHORT ModeNo, USHORT ModeIdIndex, PSIS_HW_IN
 	   if(HwInfo->jChipType >= SIS_330) romindex = 0x11b;
         }
         if(temp) {
-           if(romindex && ROMAddr && SiS_Pr->SiS_UseROM) {
+           if(romindex && SiS_Pr->SiS_UseROM && (!(SiS_Pr->SiS_ROMNew))) {
 	      OutputSelect = ROMAddr[romindex];
 	      if(!(OutputSelect & EnablePALMN)) {
                  SiS_SetRegAND(SiS_Pr->SiS_P3d4,temp,0x3F);
@@ -1443,6 +1367,22 @@ SiS_SetTVMode(SiS_Private *SiS_Pr, USHORT ModeNo, USHORT ModeIdIndex, PSIS_HW_IN
 	} else if(SiS_Pr->SiS_VBInfo & SetCRT2ToHiVision) {
 	   SiS_Pr->SiS_TVMode |= (TVSetHiVision | TVSetPAL);
 	}
+	if(SiS_Pr->SiS_VBInfo & (SetCRT2ToYPbPr525750 | SetCRT2ToHiVision)) {
+	   if(resinfo == SIS_RI_800x480 || resinfo == SIS_RI_1024x576 || resinfo == SIS_RI_1280x720) {
+	      SiS_Pr->SiS_TVMode |= TVAspect169;
+	   } else {
+	      temp1 = SiS_GetReg(SiS_Pr->SiS_P3d4,0x39);
+	      if(temp1 & 0x02) {
+		 if(SiS_Pr->SiS_TVMode & (TVSetYPbPr750p | TVSetHiVision)) {
+		    SiS_Pr->SiS_TVMode |= TVAspect169;
+		 } else {
+		    SiS_Pr->SiS_TVMode |= TVAspect43LB;
+		 }
+	      } else {
+		 SiS_Pr->SiS_TVMode |= TVAspect43;
+	      }
+	   }
+	}
      }
   }
 
@@ -1493,13 +1433,74 @@ SiS_SetTVMode(SiS_Private *SiS_Pr, USHORT ModeNo, USHORT ModeIdIndex, PSIS_HW_IN
 #ifdef TWDEBUG
   xf86DrvMsg(0, X_INFO, "(init301: TVMode %x, VBInfo %x)\n", SiS_Pr->SiS_TVMode, SiS_Pr->SiS_VBInfo);
 #endif
-
 }
 
 /*********************************************/
 /*               GET LCD INFO                */
 /*********************************************/
 
+static USHORT
+SiS_GetBIOSLCDResInfo(SiS_Private *SiS_Pr)
+{
+   USHORT temp = SiS_Pr->SiS_LCDResInfo;
+   /* Translate my LCDResInfo to BIOS value */
+   if(temp == Panel_1280x768_2)  temp = Panel_1280x768;
+   if(temp == Panel_1280x768_3)  temp = Panel_1280x768;
+   return temp;
+}
+
+static void
+SiS_GetLCDInfoBIOS(SiS_Private *SiS_Pr, PSIS_HW_INFO HwInfo)
+{
+#ifdef SIS315H
+   UCHAR  *ROMAddr;
+   USHORT temp;
+
+#ifdef TWDEBUG
+   xf86DrvMsg(0, X_INFO, "Paneldata driver: [%d %d] [H %d %d] [V %d %d] [C %d 0x%02x 0x%02x]\n",
+      	SiS_Pr->PanelHT, SiS_Pr->PanelVT,
+	SiS_Pr->PanelHRS, SiS_Pr->PanelHRE,
+	SiS_Pr->PanelVRS, SiS_Pr->PanelVRE,
+	SiS_Pr->SiS_VBVCLKData[SiS_Pr->PanelVCLKIdx315].CLOCK,
+	SiS_Pr->SiS_VBVCLKData[SiS_Pr->PanelVCLKIdx315].Part4_A,
+	SiS_Pr->SiS_VBVCLKData[SiS_Pr->PanelVCLKIdx315].Part4_B);
+#endif
+
+   if((ROMAddr = GetLCDStructPtr661(SiS_Pr, HwInfo))) {
+      if((temp = SISGETROMW(6)) != SiS_Pr->PanelHT) {
+         SiS_Pr->SiS_NeedRomModeData = TRUE;
+	 SiS_Pr->PanelHT  = temp;
+      }
+      if((temp = SISGETROMW(8)) != SiS_Pr->PanelVT) {
+         SiS_Pr->SiS_NeedRomModeData = TRUE;
+         SiS_Pr->PanelVT  = temp;
+      }
+      SiS_Pr->PanelHRS = SISGETROMW(10);
+      SiS_Pr->PanelHRE = SISGETROMW(12);
+      SiS_Pr->PanelVRS = SISGETROMW(14);
+      SiS_Pr->PanelVRE = SISGETROMW(16);
+      SiS_Pr->PanelVCLKIdx315 = VCLK_CUSTOM_315;
+      SiS_Pr->SiS_VCLKData[VCLK_CUSTOM_315].CLOCK =
+	 SiS_Pr->SiS_VBVCLKData[VCLK_CUSTOM_315].CLOCK = (USHORT)((UCHAR)ROMAddr[18]);
+      SiS_Pr->SiS_VCLKData[VCLK_CUSTOM_315].SR2B =
+	 SiS_Pr->SiS_VBVCLKData[VCLK_CUSTOM_315].Part4_A = ROMAddr[19];
+      SiS_Pr->SiS_VCLKData[VCLK_CUSTOM_315].SR2C =
+	 SiS_Pr->SiS_VBVCLKData[VCLK_CUSTOM_315].Part4_B = ROMAddr[20];
+
+#ifdef TWDEBUG
+      xf86DrvMsg(0, X_INFO, "Paneldata BIOS:  [%d %d] [H %d %d] [V %d %d] [C %d 0x%02x 0x%02x]\n",
+      	SiS_Pr->PanelHT, SiS_Pr->PanelVT,
+	SiS_Pr->PanelHRS, SiS_Pr->PanelHRE,
+	SiS_Pr->PanelVRS, SiS_Pr->PanelVRE,
+	SiS_Pr->SiS_VBVCLKData[SiS_Pr->PanelVCLKIdx315].CLOCK,
+	SiS_Pr->SiS_VBVCLKData[SiS_Pr->PanelVCLKIdx315].Part4_A,
+	SiS_Pr->SiS_VBVCLKData[SiS_Pr->PanelVCLKIdx315].Part4_B);
+#endif
+
+   }
+#endif
+}
+
 void
 SiS_GetLCDResInfo(SiS_Private *SiS_Pr, USHORT ModeNo, USHORT ModeIdIndex,
 		  PSIS_HW_INFO HwInfo)
@@ -1515,50 +1516,60 @@ SiS_GetLCDResInfo(SiS_Private *SiS_Pr, USHORT ModeNo, USHORT ModeIdIndex,
          { 0,  1,  2,  3,  7,  4,  5,  8,
 	   0,  0, 10,  0,  0,  0,  0, 15 };
 
-  SiS_Pr->SiS_LCDResInfo = 0;
+  SiS_Pr->SiS_LCDResInfo  = 0;
   SiS_Pr->SiS_LCDTypeInfo = 0;
-  SiS_Pr->SiS_LCDInfo = 0;
+  SiS_Pr->SiS_LCDInfo     = 0;
+  SiS_Pr->PanelHRS        = 999; /* HSync start */
+  SiS_Pr->PanelHRE        = 999; /* HSync end */
+  SiS_Pr->PanelVRS        = 999; /* VSync start */
+  SiS_Pr->PanelVRE        = 999; /* VSync end */
+  SiS_Pr->SiS_NeedRomModeData = FALSE;
 
-  if(SiS_Pr->UseCustomMode) {
+  if(!(SiS_Pr->SiS_VBInfo & (SetCRT2ToLCD | SetCRT2ToLCDA))) return;
+
+  if(ModeNo <= 0x13) {
+     modeflag = SiS_Pr->SiS_SModeIDTable[ModeIdIndex].St_ModeFlag;
+  } else if(SiS_Pr->UseCustomMode) {
      modeflag = SiS_Pr->CModeFlag;
   } else {
-     if(ModeNo <= 0x13) {
-    	modeflag = SiS_Pr->SiS_SModeIDTable[ModeIdIndex].St_ModeFlag;
-     } else {
-    	modeflag = SiS_Pr->SiS_EModeIDTable[ModeIdIndex].Ext_ModeFlag;
-    	resinfo = SiS_Pr->SiS_EModeIDTable[ModeIdIndex].Ext_RESINFO;
-     }
+     modeflag = SiS_Pr->SiS_EModeIDTable[ModeIdIndex].Ext_ModeFlag;
+     resinfo = SiS_Pr->SiS_EModeIDTable[ModeIdIndex].Ext_RESINFO;
   }
 
-  if(!(SiS_Pr->SiS_VBInfo & (SetCRT2ToLCD | SetCRT2ToLCDA))) return;
-
   temp = SiS_GetReg(SiS_Pr->SiS_P3d4,0x36);
+  if(!temp) return;
 
-  if((HwInfo->jChipType < SIS_315H) || (HwInfo->jChipType >= SIS_661)) {
+  if((HwInfo->jChipType >= SIS_661) || (SiS_Pr->SiS_ROMNew)) {
+     SiS_Pr->SiS_LCDTypeInfo = (SiS_GetReg(SiS_Pr->SiS_P3d4,0x39) & 0x7c) >> 2;
+  } else if((HwInfo->jChipType < SIS_315H) || (HwInfo->jChipType >= SIS_661)) {
      SiS_Pr->SiS_LCDTypeInfo = temp >> 4;
   } else {
      SiS_Pr->SiS_LCDTypeInfo = (temp & 0x0F) - 1;
   }
   temp &= 0x0f;
   if(HwInfo->jChipType < SIS_315H) {
-      /* Translate 300 series LCDRes to 315 series for unified usage */
-      temp = SiS300SeriesLCDRes[temp];
+     /* Translate 300 series LCDRes to 315 series for unified usage */
+     temp = SiS300SeriesLCDRes[temp];
   }
-  SiS_Pr->SiS_LCDResInfo = temp;
 
-  if(SiS_Pr->SiS_VBType & VB_SISVB) {
-     if(SiS_Pr->SiS_LCDResInfo < SiS_Pr->SiS_PanelMin301)
-	SiS_Pr->SiS_LCDResInfo = SiS_Pr->SiS_PanelMin301;
-  } else {
-     if(SiS_Pr->SiS_LCDResInfo < SiS_Pr->SiS_PanelMinLVDS)
-	SiS_Pr->SiS_LCDResInfo = SiS_Pr->SiS_PanelMinLVDS;
+  if(HwInfo->jChipType == SIS_550) {
+     if(temp == Panel310_640x480_2) temp = Panel_640x480_2;
+     if(temp == Panel310_640x480_3) temp = Panel_640x480_3;
   }
 
-  if((!SiS_Pr->CP_HaveCustomData) || (SiS_Pr->SiS_LCDResInfo != SiS_Pr->SiS_PanelCustom)) {
-     if(SiS_Pr->SiS_LCDResInfo > SiS_Pr->SiS_PanelMax)
-  	SiS_Pr->SiS_LCDResInfo = SiS_Pr->SiS_Panel1024x768;
+  if(SiS_Pr->SiS_VBType & VB_SIS301LV302LV) {	/* SiS LVDS */
+     if(temp == Panel310_1280x768) {
+        temp = Panel_1280x768_2;
+#ifdef SIS315H
+	if((myptr = GetLCDStructPtr661(SiS_Pr, HwInfo))) {
+	   if((myptr[8] | (myptr[9] << 8)) == 798) temp = Panel_1280x768_3;
+	}
+#endif
+     }
   }
 
+  SiS_Pr->SiS_LCDResInfo = temp;
+
   if(SiS_Pr->SiS_IF_DEF_LVDS == 1) {
      if(SiS_Pr->SiS_CustomT == CUT_BARCO1366) {
         SiS_Pr->SiS_LCDResInfo = Panel_Barco1366;
@@ -1567,113 +1578,306 @@ SiS_GetLCDResInfo(SiS_Private *SiS_Pr, USHORT ModeNo, USHORT ModeIdIndex,
      }
   }
 
+  if(SiS_Pr->SiS_VBType & VB_SISVB) {
+     if(SiS_Pr->SiS_LCDResInfo < SiS_Pr->SiS_PanelMin301)
+	SiS_Pr->SiS_LCDResInfo = SiS_Pr->SiS_PanelMin301;
+  } else {
+     if(SiS_Pr->SiS_LCDResInfo < SiS_Pr->SiS_PanelMinLVDS)
+	SiS_Pr->SiS_LCDResInfo = SiS_Pr->SiS_PanelMinLVDS;
+  }
+
+  SiS_Pr->PanelVCLKIdx300 = VCLK65_300;
+  SiS_Pr->PanelVCLKIdx315 = VCLK108_2_315;
+
   switch(SiS_Pr->SiS_LCDResInfo) {
-     case Panel_800x600:   SiS_Pr->PanelXRes =  800; SiS_Pr->PanelYRes =  600; break;
-     case Panel_1024x768:  SiS_Pr->PanelXRes = 1024; SiS_Pr->PanelYRes =  768; break;
-     case Panel_1280x1024: SiS_Pr->PanelXRes = 1280; SiS_Pr->PanelYRes = 1024; break;
-     case Panel_640x480_3:
+     case Panel_320x480:    SiS_Pr->PanelXRes =  320; SiS_Pr->PanelYRes =  480;
+     			    SiS_Pr->PanelHT   =  400; SiS_Pr->PanelVT   =  525;
+			    SiS_Pr->PanelVCLKIdx300 = VCLK28;
+			    SiS_Pr->PanelVCLKIdx315 = VCLK28;
+			    break;
      case Panel_640x480_2:
-     case Panel_640x480:   SiS_Pr->PanelXRes =  640; SiS_Pr->PanelYRes =  480; break;
-     case Panel_1024x600:  SiS_Pr->PanelXRes = 1024; SiS_Pr->PanelYRes =  600; break;
-     case Panel_1152x864:  SiS_Pr->PanelXRes = 1152; SiS_Pr->PanelYRes =  864; break;
-     case Panel_1280x960:  SiS_Pr->PanelXRes = 1280; SiS_Pr->PanelYRes =  960; break;
-     case Panel_1152x768:  SiS_Pr->PanelXRes = 1152; SiS_Pr->PanelYRes =  768; break;
-     case Panel_1400x1050: SiS_Pr->PanelXRes = 1400; SiS_Pr->PanelYRes = 1050; break;
-     case Panel_1280x768:  SiS_Pr->PanelXRes = 1280; SiS_Pr->PanelYRes =  768; break;
-     case Panel_1600x1200: SiS_Pr->PanelXRes = 1600; SiS_Pr->PanelYRes = 1200; break;
-     case Panel_320x480:   SiS_Pr->PanelXRes =  320; SiS_Pr->PanelYRes =  480; break;
-     case Panel_Custom:    SiS_Pr->PanelXRes = SiS_Pr->CP_MaxX;
-    			   SiS_Pr->PanelYRes = SiS_Pr->CP_MaxY;
-			   break;
-     case Panel_Barco1366: SiS_Pr->PanelXRes = 1360; SiS_Pr->PanelYRes = 1024; break;
-     case Panel_848x480:   SiS_Pr->PanelXRes =  848; SiS_Pr->PanelYRes =  480; break;
-     default:		   SiS_Pr->PanelXRes = 1024; SiS_Pr->PanelYRes =  768; break;
+     case Panel_640x480_3:  SiS_Pr->PanelXRes =  640; SiS_Pr->PanelYRes =  480;
+     			    SiS_Pr->PanelVRS  =   24; SiS_Pr->PanelVRE  =    3;
+			    SiS_Pr->PanelVCLKIdx300 = VCLK28;
+			    SiS_Pr->PanelVCLKIdx315 = VCLK28;
+			    break;
+     case Panel_640x480:    SiS_Pr->PanelXRes =  640; SiS_Pr->PanelYRes =  480;
+     			    			      SiS_Pr->PanelVRE  =    3;
+			    SiS_Pr->PanelVCLKIdx300 = VCLK28;
+			    SiS_Pr->PanelVCLKIdx315 = VCLK28;
+			    break;
+     case Panel_800x600:    SiS_Pr->PanelXRes =  800; SiS_Pr->PanelYRes =  600;
+     			    SiS_Pr->PanelHT   = 1056; SiS_Pr->PanelVT   =  628;
+			    SiS_Pr->PanelHRS  =   40; SiS_Pr->PanelHRE  =  128;
+			    SiS_Pr->PanelVRS  =    1; SiS_Pr->PanelVRE  =    4;
+			    SiS_Pr->PanelVCLKIdx300 = VCLK40;
+			    SiS_Pr->PanelVCLKIdx315 = VCLK40;
+			    break;
+     case Panel_1024x600:   SiS_Pr->PanelXRes = 1024; SiS_Pr->PanelYRes =  600;
+     			    SiS_Pr->PanelHT   = 1344; SiS_Pr->PanelVT   =  800;
+			    SiS_Pr->PanelHRS  =   24; SiS_Pr->PanelHRE  =  136;
+			    SiS_Pr->PanelVRS  =    2 /* 88 */ ; SiS_Pr->PanelVRE  =    6;
+     			    SiS_Pr->PanelVCLKIdx300 = VCLK65_300;
+			    SiS_Pr->PanelVCLKIdx315 = VCLK65_315;
+     			    break;
+     case Panel_1024x768:   SiS_Pr->PanelXRes = 1024; SiS_Pr->PanelYRes =  768;
+     			    SiS_Pr->PanelHT   = 1344; SiS_Pr->PanelVT   =  806;
+			    SiS_Pr->PanelHRS  =   24; SiS_Pr->PanelHRE  =  136;
+			    SiS_Pr->PanelVRS  =    3; SiS_Pr->PanelVRE  =    6;
+			    if(HwInfo->jChipType < SIS_315H) {
+			       SiS_Pr->PanelHRS = 23;
+			       			      SiS_Pr->PanelVRE  =    5;
+			    }
+			    SiS_Pr->PanelVCLKIdx300 = VCLK65_300;
+			    SiS_Pr->PanelVCLKIdx315 = VCLK65_315;
+			    SiS_GetLCDInfoBIOS(SiS_Pr, HwInfo);
+			    break;
+     case Panel_1152x768:   SiS_Pr->PanelXRes = 1152; SiS_Pr->PanelYRes =  768;
+     			    SiS_Pr->PanelHT   = 1344; SiS_Pr->PanelVT   =  806;
+			    SiS_Pr->PanelHRS  =   24;
+			    SiS_Pr->PanelVRS  =    3; SiS_Pr->PanelVRE  =    6;
+			    if(HwInfo->jChipType < SIS_315H) {
+			       SiS_Pr->PanelHRS = 23;
+			       			      SiS_Pr->PanelVRE  =    5;
+			    }
+     			    SiS_Pr->PanelVCLKIdx300 = VCLK65_300;
+			    SiS_Pr->PanelVCLKIdx315 = VCLK65_315;
+     			    break;
+     case Panel_1152x864:   SiS_Pr->PanelXRes = 1152; SiS_Pr->PanelYRes =  864;
+     			    break;
+     case Panel_1280x720:   SiS_Pr->PanelXRes = 1280; SiS_Pr->PanelYRes =  720;
+     			    SiS_Pr->PanelHT   = 1650; SiS_Pr->PanelVT   =  750;
+			    SiS_Pr->PanelHRS  =  110; SiS_Pr->PanelHRE  =   40;
+			    SiS_Pr->PanelVRS  =    5; SiS_Pr->PanelVRE  =    5;
+			    SiS_Pr->PanelVCLKIdx315 = VCLK_1280x720;
+			    /* Data above for TMDS (projector); get from BIOS for LVDS */
+			    SiS_GetLCDInfoBIOS(SiS_Pr, HwInfo);
+			    break;
+     case Panel_1280x768:   SiS_Pr->PanelXRes = 1280; SiS_Pr->PanelYRes =  768;
+     			    SiS_Pr->PanelHT   = 1688; SiS_Pr->PanelVT   =  802;
+			    SiS_Pr->PanelHRS  =   48; SiS_Pr->PanelHRS  =  112;
+			    SiS_Pr->PanelVRS  =    3; SiS_Pr->PanelVRE  =    6;
+			    SiS_Pr->PanelVCLKIdx300 = VCLK81_300;
+			    SiS_Pr->PanelVCLKIdx315 = VCLK81_315;
+			    break;
+     case Panel_1280x768_2: SiS_Pr->PanelXRes = 1280; SiS_Pr->PanelYRes =  768;
+     			    SiS_Pr->PanelHT   = 1408; SiS_Pr->PanelVT   =  806;
+			    SiS_Pr->PanelHRS  =   16; SiS_Pr->PanelHRE  =   64;
+			    SiS_Pr->PanelVRS  =    3; SiS_Pr->PanelVRE  =    6;
+			    SiS_Pr->PanelVCLKIdx315 = VCLK_1280x768_2;
+			    SiS_GetLCDInfoBIOS(SiS_Pr, HwInfo);
+			    break;
+     case Panel_1280x768_3: SiS_Pr->PanelXRes = 1280; SiS_Pr->PanelYRes =  768;
+     			    SiS_Pr->PanelHT   = 1664; SiS_Pr->PanelVT   =  798;
+			    SiS_Pr->PanelHRS   =  64; SiS_Pr->PanelHRE  =  128;
+			    SiS_Pr->PanelVRS   =   3; SiS_Pr->PanelVRE  =    7;
+			    SiS_Pr->PanelVCLKIdx315 = VCLK_1280x768_3;
+			    SiS_GetLCDInfoBIOS(SiS_Pr, HwInfo);
+			    break;
+     case Panel_1280x800:   SiS_Pr->PanelXRes = 1280; SiS_Pr->PanelYRes =  800;
+     			    SiS_Pr->PanelHT   = 1656; SiS_Pr->PanelVT   =  841;  /* 1408, 816 */
+			    SiS_Pr->PanelHRS   =  32; SiS_Pr->PanelHRE  =  312;  /*   16,  64 */
+			    SiS_Pr->PanelVRS   =  16; SiS_Pr->PanelVRE  =    8;  /*    4,   3 */
+			    SiS_Pr->PanelVCLKIdx315 = VCLK83_315;
+			    SiS_GetLCDInfoBIOS(SiS_Pr, HwInfo);
+			    break;
+     case Panel_1280x960:   SiS_Pr->PanelXRes = 1280; SiS_Pr->PanelYRes =  960;
+     			    SiS_Pr->PanelHT   = 1800; SiS_Pr->PanelVT   = 1000;
+			    SiS_Pr->PanelVCLKIdx300 = VCLK108_3_300;
+			    SiS_Pr->PanelVCLKIdx315 = VCLK108_3_315;
+		 	    if(resinfo == SIS_RI_1280x1024) {
+			       SiS_Pr->PanelVCLKIdx300 = VCLK100_300;
+			       SiS_Pr->PanelVCLKIdx315 = VCLK100_315;
+			    }
+			    break;
+     case Panel_1280x1024:  SiS_Pr->PanelXRes = 1280; SiS_Pr->PanelYRes = 1024;
+     			    SiS_Pr->PanelHT   = 1688; SiS_Pr->PanelVT   = 1066;
+			    SiS_Pr->PanelHRS  =   48; SiS_Pr->PanelHRE  =  112;
+			    SiS_Pr->PanelVRS  =    1; SiS_Pr->PanelVRE  =    3;
+			    SiS_Pr->PanelVCLKIdx300 = VCLK108_3_300;
+			    SiS_Pr->PanelVCLKIdx315 = VCLK108_2_315;
+			    SiS_GetLCDInfoBIOS(SiS_Pr, HwInfo);
+			    break;
+     case Panel_1400x1050:  SiS_Pr->PanelXRes = 1400; SiS_Pr->PanelYRes = 1050;
+     			    SiS_Pr->PanelHT   = 1688; SiS_Pr->PanelVT   = 1066;
+			    SiS_Pr->PanelHRS  =   48; SiS_Pr->PanelHRE  =  112; /* HRE OK for LVDS, not for LCDA */
+			    SiS_Pr->PanelVRS  =    1; SiS_Pr->PanelVRE  =    3;
+			    SiS_Pr->PanelVCLKIdx315 = VCLK108_2_315;
+			    SiS_GetLCDInfoBIOS(SiS_Pr, HwInfo);
+			    break;
+     case Panel_1600x1200:  SiS_Pr->PanelXRes = 1600; SiS_Pr->PanelYRes = 1200;
+     			    SiS_Pr->PanelHT   = 2160; SiS_Pr->PanelVT   = 1250;
+			    SiS_Pr->PanelHRS  =   64; SiS_Pr->PanelHRE  =  192;
+			    SiS_Pr->PanelVRS  =    1; SiS_Pr->PanelVRE  =    3;
+			    SiS_Pr->PanelVCLKIdx315 = VCLK162_315;
+			    SiS_GetLCDInfoBIOS(SiS_Pr, HwInfo);
+			    break;
+     case Panel_1680x1050:  SiS_Pr->PanelXRes = 1680; SiS_Pr->PanelYRes = 1050;
+     			    SiS_Pr->PanelHT   = 1900; SiS_Pr->PanelVT   = 1066;
+			    SiS_Pr->PanelHRS  =   26; SiS_Pr->PanelHRE  =   76;
+			    SiS_Pr->PanelVRS  =    3; SiS_Pr->PanelVRE  =    6;
+			    SiS_Pr->PanelVCLKIdx315 = VCLK121_315;
+			    SiS_GetLCDInfoBIOS(SiS_Pr, HwInfo);
+			    break;
+     case Panel_Custom:     SiS_Pr->PanelXRes = SiS_Pr->CP_MaxX;
+    			    SiS_Pr->PanelYRes = SiS_Pr->CP_MaxY;
+			    SiS_Pr->PanelHT   = SiS_Pr->CHTotal;
+			    SiS_Pr->PanelVT   = SiS_Pr->CVTotal;
+			    if(SiS_Pr->CP_PreferredIndex != -1) {
+			       SiS_Pr->PanelXRes = SiS_Pr->CP_HDisplay[SiS_Pr->CP_PreferredIndex];
+    			       SiS_Pr->PanelYRes = SiS_Pr->CP_VDisplay[SiS_Pr->CP_PreferredIndex];
+			       SiS_Pr->PanelHT   = SiS_Pr->CP_HTotal[SiS_Pr->CP_PreferredIndex];
+			       SiS_Pr->PanelVT   = SiS_Pr->CP_VTotal[SiS_Pr->CP_PreferredIndex];
+			       SiS_Pr->PanelHRS  = SiS_Pr->CP_HSyncStart[SiS_Pr->CP_PreferredIndex];
+			       SiS_Pr->PanelHRE  = SiS_Pr->CP_HSyncEnd[SiS_Pr->CP_PreferredIndex];
+			       SiS_Pr->PanelVRS  = SiS_Pr->CP_VSyncStart[SiS_Pr->CP_PreferredIndex];
+			       SiS_Pr->PanelVRE  = SiS_Pr->CP_VSyncEnd[SiS_Pr->CP_PreferredIndex];
+			       SiS_Pr->PanelHRS -= SiS_Pr->PanelXRes;
+			       SiS_Pr->PanelHRE -= SiS_Pr->PanelHRS;
+			       SiS_Pr->PanelVRS -= SiS_Pr->PanelYRes;
+			       SiS_Pr->PanelVRE -= SiS_Pr->PanelVRS;
+			    }
+			    break;
+     case Panel_Barco1366:  SiS_Pr->PanelXRes = 1360; SiS_Pr->PanelYRes = 1024;
+     			    SiS_Pr->PanelHT   = 1688; SiS_Pr->PanelVT   = 1066;
+     			    break;
+     case Panel_848x480:    SiS_Pr->PanelXRes =  848; SiS_Pr->PanelYRes =  480;
+     			    SiS_Pr->PanelHT   = 1088; SiS_Pr->PanelVT   =  525;
+     			    break;
+     default:		    SiS_Pr->PanelXRes = 1024; SiS_Pr->PanelYRes =  768;
+     			    SiS_Pr->PanelHT   = 1344; SiS_Pr->PanelVT   =  806;
+			    break;
   }
 
   temp = SiS_GetReg(SiS_Pr->SiS_P3d4,0x37);
-  if(HwInfo->jChipType < SIS_661) {
-     temp &= ~0xe;
-  } else {
+  SiS_Pr->SiS_LCDInfo = temp & ~0x000e;
+
+  if(!(SiS_Pr->UsePanelScaler))        SiS_Pr->SiS_LCDInfo &= ~DontExpandLCD;
+  else if(SiS_Pr->UsePanelScaler == 1) SiS_Pr->SiS_LCDInfo |= DontExpandLCD;
+
 #ifdef SIS315H
-     if(!(temp & 0x10)) {
-        if(temp & 0x08) temp |= LCDPass11;
+  if(HwInfo->jChipType >= SIS_661) {
+     if(SiS_Pr->SiS_LCDInfo & DontExpandLCD) {
+        if(temp & 0x08) SiS_Pr->SiS_LCDInfo |= LCDPass11;
      }
-     temp &= ~0xe;
      if(SiS_Pr->SiS_VBType & (VB_SIS302LV | VB_SIS302ELV)) {
-        myptr = GetLCDStructPtr661(SiS_Pr, HwInfo);
-        if(myptr) {
-           if(myptr[2] & 0x01) temp |= LCDDualLink;
-        }
+        if(SiS_Pr->SiS_ROMNew) {
+	   if(temp & 0x02) SiS_Pr->SiS_LCDInfo |= LCDDualLink;
+	} else if((myptr = GetLCDStructPtr661(SiS_Pr, HwInfo))) {
+           if(myptr[2] & 0x01) SiS_Pr->SiS_LCDInfo |= LCDDualLink;
+	}
+     }
+  } else if(HwInfo->jChipType >= SIS_315H) {
+     if(SiS_Pr->SiS_LCDInfo & DontExpandLCD) {
+        if(SiS_GetReg(SiS_Pr->SiS_P3d4,0x39) & 0x01) SiS_Pr->SiS_LCDInfo |= LCDPass11;
+     }
+     if((SiS_Pr->SiS_ROMNew) && (!(SiS_Pr->PanelSelfDetected))) {
+        SiS_Pr->SiS_LCDInfo &= ~(LCDRGB18Bit);
+	temp = SiS_GetReg(SiS_Pr->SiS_P3d4,0x35);
+        if(temp & 0x01) SiS_Pr->SiS_LCDInfo |= LCDRGB18Bit;
+	if(SiS_Pr->SiS_VBType & (VB_SIS302LV | VB_SIS302ELV)) {
+	   if(temp & 0x02) SiS_Pr->SiS_LCDInfo |= LCDDualLink;
+	}
      }
+  }
 #endif
+
+  if(SiS_Pr->SiS_IF_DEF_LVDS == 1) {
+     /* Always center screen on LVDS (if scaling is disabled) */
+     SiS_Pr->SiS_LCDInfo &= ~LCDPass11;
+  } else if(SiS_Pr->SiS_VBType & VB_SISVB) {
+     if(SiS_Pr->SiS_VBType & VB_SIS301LV302LV) {
+        /* Always center screen on SiS LVDS (if scaling is disabled) */
+        SiS_Pr->SiS_LCDInfo &= ~LCDPass11;
+     } else {
+        /* By default, pass 1:1 on SiS TMDS (if scaling is disabled) */
+        SiS_Pr->SiS_LCDInfo |= LCDPass11;
+        if(SiS_Pr->CenterScreen == 1) SiS_Pr->SiS_LCDInfo &= ~LCDPass11;
+     }
   }
-  SiS_Pr->SiS_LCDInfo = temp;
 
   if(SiS_Pr->SiS_IF_DEF_LVDS == 1) {
      if(SiS_Pr->SiS_CustomT == CUT_PANEL848) {
-        SiS_Pr->SiS_LCDInfo = 0x80 | 0x40 | 0x20;   /* neg h/v sync, RGB24 */
+        SiS_Pr->SiS_LCDInfo = 0x80 | 0x40 | 0x20;   /* neg h/v sync, RGB24(D0 = 0) */
      }
   }
 
-  if(!(SiS_Pr->UsePanelScaler))        SiS_Pr->SiS_LCDInfo &= ~DontExpandLCD;
-  else if(SiS_Pr->UsePanelScaler == 1) SiS_Pr->SiS_LCDInfo |= DontExpandLCD;
-
   if(SiS_Pr->SiS_VBType & VB_SISVB) {
      if(SiS_Pr->SiS_VBInfo & (SetCRT2ToLCD | SetCRT2ToLCDA)) {
-        if(SiS_Pr->SiS_LCDResInfo == SiS_Pr->SiS_PanelCustom) {
-	   /* For non-standard LCD resolution, we let the panel scale */
-           SiS_Pr->SiS_LCDInfo |= DontExpandLCD;
-        } else if(SiS_Pr->SiS_LCDResInfo == SiS_Pr->SiS_Panel1280x1024) {
-	   if(ModeNo == 0x7c || ModeNo == 0x7d || ModeNo == 0x7e) {
-	      /* We do not scale to 1280x960 (B/C bridges only) */
-              SiS_Pr->SiS_LCDInfo |= DontExpandLCD;
-	   }
-	   if(((HwInfo->jChipType >= SIS_315H) && (ModeNo == 0x23 || ModeNo == 0x24 || ModeNo == 0x25)) ||
-	      ((HwInfo->jChipType < SIS_315H)  && (ModeNo == 0x55 || ModeNo == 0x5a || ModeNo == 0x5b))) {
-	      /* We do not scale to 1280x768 (B/C bridges only) */
-              SiS_Pr->SiS_LCDInfo |= DontExpandLCD;
-	   }
-	   if(SiS_Pr->SiS_VBType & VB_SIS301LV302LV) {
-	      /* No non-scaling data available for LV bridges */
-	      SiS_Pr->SiS_LCDInfo &= ~DontExpandLCD;
-	   }
-        } else if(SiS_Pr->SiS_LCDResInfo == SiS_Pr->SiS_Panel1280x768) {
-           /* No idea about the timing and zoom factors */
-           SiS_Pr->SiS_LCDInfo |= DontExpandLCD;
-        } else if(SiS_Pr->SiS_LCDResInfo == SiS_Pr->SiS_Panel1400x1050) {
-	   if(ModeNo == 0x3a || ModeNo == 0x4d || ModeNo == 0x65) {
-	      /* We do not scale to 1280x1024 (all bridges) */
-	      SiS_Pr->SiS_LCDInfo |= DontExpandLCD;
-	   }
-	} else if(SiS_Pr->SiS_LCDResInfo == SiS_Pr->SiS_Panel1600x1200) {
-	   if(SiS_Pr->SiS_VBType & VB_SIS301B302B) {
-	      /* No idea about the timing and zoom factors (C bridge only) */
-	      SiS_Pr->SiS_LCDInfo |= DontExpandLCD;
-	   }
+        if(modeflag & NoSupportLCDScale) {
+	   /* No scaling for this mode on any panel */
+	   SiS_Pr->SiS_LCDInfo |= DontExpandLCD;
 	}
-	if(SiS_Pr->SiS_VBInfo & SetCRT2ToLCD) {
-	   if(SiS_Pr->SiS_CustomT == CUT_CLEVO1024) {
-              if(SiS_Pr->SiS_LCDResInfo == SiS_Pr->SiS_Panel1024x768) {
-	         SiS_Pr->SiS_LCDInfo &= ~DontExpandLCD;
-	      }
-	   }
+        switch(SiS_Pr->SiS_LCDResInfo) {
+        case Panel_Custom:
+		/* For non-standard LCD resolution, we let the panel scale */
+           	SiS_Pr->SiS_LCDInfo |= DontExpandLCD;
+		break;
+	case Panel_1280x720:
+	      	if(SiS_Pr->PanelHT == 1650) {
+		   SiS_Pr->SiS_LCDInfo |= DontExpandLCD;
+		}
+	case Panel_1280x768:	/* TMDS only */
+		/* No idea about the timing and zoom factors */
+           	SiS_Pr->SiS_LCDInfo |= DontExpandLCD;
+		break;
+	case Panel_1280x960:
+	 	SiS_Pr->SiS_LCDInfo &= ~DontExpandLCD;
+		break;
+	case Panel_1280x1024:
+	        if(SiS_Pr->SiS_VBType & VB_SISTMDS) {
+		   if(ModeNo == 0x7c || ModeNo == 0x7d || ModeNo == 0x7e ||
+		      ModeNo == 0x79 || ModeNo == 0x75 || ModeNo == 0x78 ||
+		      ModeNo == 0x14 || ModeNo == 0x15 || ModeNo == 0x16) {
+	      	      /* We do not scale to 1280x720/800/960 (B/C bridges only) */
+                      SiS_Pr->SiS_LCDInfo |= DontExpandLCD;
+	           }
+	           if(((HwInfo->jChipType >= SIS_315H) &&
+		       (ModeNo == 0x23 || ModeNo == 0x24 || ModeNo == 0x25)) ||
+	              ((HwInfo->jChipType < SIS_315H)  &&
+		       (ModeNo == 0x55 || ModeNo == 0x5a || ModeNo == 0x5b))) {
+	              /* We do not scale to 1280x768 (B/C bridges only) */
+                      SiS_Pr->SiS_LCDInfo |= DontExpandLCD;
+	           }
+		}
+		break;
+	case Panel_1400x1050:
+	 	if(SiS_Pr->SiS_VBType & VB_SISTMDS) {
+	  	   if(ModeNo == 0x7c || ModeNo == 0x7d || ModeNo == 0x7e ||
+		      ModeNo == 0x79 || ModeNo == 0x75 || ModeNo == 0x78 ||
+		      ModeNo == 0x14 || ModeNo == 0x15 || ModeNo == 0x16 ||
+		      ModeNo == 0x23 || ModeNo == 0x24 || ModeNo == 0x25) {
+	      	      /* Do not scale to 1280x720/768/800/960 (B/C bridges only) */
+                      SiS_Pr->SiS_LCDInfo |= DontExpandLCD;
+	           }
+		}
+		if(SiS_Pr->SiS_VBType & VB_SIS301LV302LV) {
+		   if(ModeNo == 0x79 || ModeNo == 0x75 || ModeNo == 0x78) {
+		      if(SiS_Pr->UsePanelScaler == -1) {
+		         /* Do not scale to 1280x720 by default (LVDS bridges) */
+	      	         SiS_Pr->SiS_LCDInfo |= DontExpandLCD;
+		      }
+		   }
+		}
+		if(ModeNo == 0x3a || ModeNo == 0x4d || ModeNo == 0x65) {
+	      	   /* Do not scale to 1280x1024 (all bridges) */
+	      	   SiS_Pr->SiS_LCDInfo |= DontExpandLCD;
+	   	}
+		break;
+	case Panel_1600x1200:
+		if(SiS_Pr->SiS_VBType & VB_SISTMDS) {
+	      	   /* No idea about the timing and zoom factors (C bridge only) */
+	      	   SiS_Pr->SiS_LCDInfo |= DontExpandLCD;
+	   	}
+		break;
 	}
      }
   }
 
-  if(HwInfo->jChipType >= SIS_315H) {
-#ifdef SIS315H
-     if(HwInfo->jChipType < SIS_661) {
-        if(SiS_GetReg(SiS_Pr->SiS_P3d4,0x39) & 0x01) {
-           SiS_Pr->SiS_LCDInfo &= (~DontExpandLCD);
-	   SiS_Pr->SiS_LCDInfo |= LCDPass11;
-	}
-     }
-#endif
-  } else {
 #ifdef SIS300
+  if(HwInfo->jChipType < SIS_315H) {
      if(SiS_Pr->SiS_IF_DEF_LVDS == 1) {
-        if((ROMAddr) && SiS_Pr->SiS_UseROM) {
+        if(SiS_Pr->SiS_UseROM) {
 	   if((ROMAddr[0x233] == 0x12) && (ROMAddr[0x234] == 0x34)) {
               if(!(ROMAddr[0x235] & 0x02)) {
 	         SiS_Pr->SiS_LCDInfo &= (~DontExpandLCD);
@@ -1685,72 +1889,101 @@ SiS_GetLCDResInfo(SiS_Private *SiS_Pr, USHORT ModeNo, USHORT ModeIdIndex,
            SiS_Pr->SiS_LCDInfo &= (~DontExpandLCD);
 	}
      }
+  }
 #endif
+
+  /* Special cases */
+  if(SiS_Pr->SiS_IF_DEF_TRUMPION) {
+     SiS_Pr->SiS_LCDInfo |= (DontExpandLCD | LCDPass11);
   }
 
-  /* Trumpion: Assume non-expanding */
-  if(SiS_Pr->SiS_IF_DEF_TRUMPION != 0) {
-     SiS_Pr->SiS_LCDInfo &= (~DontExpandLCD);
+  if(SiS_Pr->SiS_LCDResInfo == Panel_640x480) {
+     SiS_Pr->SiS_LCDInfo |= LCDPass11;
   }
 
-  if(SiS_Pr->SiS_LCDInfo & DontExpandLCD) {
-     SiS_Pr->SiS_LCDInfo &= (~LCDPass11);
+  if(SiS_Pr->UseCustomMode) {
+     SiS_Pr->SiS_LCDInfo |= (DontExpandLCD | LCDPass11);
   }
 
-#ifdef SIS315H
-  if((HwInfo->jChipType >= SIS_315H) && (HwInfo->jChipType < SIS_661)) {
-     if(SiS_Pr->SiS_VBType & (VB_SIS302LV | VB_SIS302ELV)) {
-	/* Enable 302LV/302ELV dual link mode.
-	 * For 661, this is done above.
-	 */
-        if((SiS_Pr->SiS_CustomT == CUT_CLEVO1024) &&
-	   (SiS_Pr->SiS_LCDResInfo == SiS_Pr->SiS_Panel1024x768)) {
-	   /* (Sets this in SenseLCD; new paneltypes) */
-	   SiS_Pr->SiS_LCDInfo |= LCDDualLink;
-	}
-        if((SiS_Pr->SiS_LCDResInfo == SiS_Pr->SiS_Panel1280x1024) ||
-	   (SiS_Pr->SiS_LCDResInfo == SiS_Pr->SiS_Panel1400x1050) ||
-           (SiS_Pr->SiS_LCDResInfo == SiS_Pr->SiS_Panel1600x1200)) {
-	   SiS_Pr->SiS_LCDInfo |= LCDDualLink;
-	}
-     }
+  /* (In)validate LCDPass11 flag */
+  if(!(SiS_Pr->SiS_LCDInfo & DontExpandLCD)) {
+     SiS_Pr->SiS_LCDInfo &= ~LCDPass11;
   }
-#endif
 
-  if(!((HwInfo->jChipType < SIS_315H) && (SiS_Pr->SiS_SetFlag & SetDOSMode))) {
+  /* Special cases */
+  if( (SiS_Pr->SiS_IF_DEF_FSTN)              ||
+      (SiS_Pr->SiS_IF_DEF_DSTN)              ||
+      (SiS_Pr->SiS_CustomT == CUT_BARCO1366) ||
+      (SiS_Pr->SiS_CustomT == CUT_BARCO1024) ||
+      (SiS_Pr->SiS_CustomT == CUT_PANEL848) ) {
+     SiS_Pr->PanelHRS = 999;
+     SiS_Pr->PanelHRE = 999;
+  }
 
-     if(SiS_Pr->SiS_IF_DEF_LVDS == 1) {
-        if(SiS_Pr->SiS_LCDResInfo == SiS_Pr->SiS_Panel1024x600) {
-	   if(ModeNo > 0x13) {
-	      if(!(SiS_Pr->SiS_LCDInfo & DontExpandLCD)) {
-                 if((resinfo == SIS_RI_800x600) || (resinfo == SIS_RI_400x300)) {
-                    SiS_Pr->SiS_SetFlag |= EnableLVDSDDA;
-		 }
-              }
-           }
+  if( (SiS_Pr->SiS_CustomT == CUT_BARCO1366) ||
+      (SiS_Pr->SiS_CustomT == CUT_BARCO1024) ||
+      (SiS_Pr->SiS_CustomT == CUT_PANEL848) ) {
+     SiS_Pr->PanelVRS = 999;
+     SiS_Pr->PanelVRE = 999;
+  }
+
+#ifdef SIS315H
+  if((HwInfo->jChipType >= SIS_315H) && (HwInfo->jChipType < SIS_661)) {
+     if(!(SiS_Pr->SiS_ROMNew)) {
+        if(SiS_Pr->SiS_VBType & (VB_SIS302LV | VB_SIS302ELV)) {
+	   /* Enable 302LV/302ELV dual link mode.
+	    * For 661, this is done above.
+	    */
+           if((SiS_Pr->SiS_CustomT == CUT_CLEVO1024) &&
+	      (SiS_Pr->SiS_LCDResInfo == Panel_1024x768)) {
+	      /* (Sets this in SenseLCD; new paneltypes) */
+	      SiS_Pr->SiS_LCDInfo |= LCDDualLink;
+	   }
+           if((SiS_Pr->SiS_LCDResInfo == Panel_1280x1024) ||
+	      (SiS_Pr->SiS_LCDResInfo == Panel_1400x1050) ||
+              (SiS_Pr->SiS_LCDResInfo == Panel_1600x1200) ||
+	      (SiS_Pr->SiS_LCDResInfo == Panel_1680x1050)) {
+	      SiS_Pr->SiS_LCDInfo |= LCDDualLink;
+	   }
         }
-	if(ModeNo == 0x12) {
-	   if(SiS_Pr->SiS_LCDInfo & LCDPass11) {
-	      SiS_Pr->SiS_SetFlag |= EnableLVDSDDA;
+     }
+  }
+#endif
+
+  if(!((HwInfo->jChipType < SIS_315H) && (SiS_Pr->SiS_SetFlag & SetDOSMode))) {
+
+     if(SiS_Pr->SiS_IF_DEF_LVDS == 1) {
+	if(SiS_Pr->SiS_IF_DEF_TRUMPION == 0) {
+	   if(ModeNo == 0x12) {
+	      if(SiS_Pr->SiS_LCDInfo & LCDPass11) {
+	         SiS_Pr->SiS_SetFlag |= EnableLVDSDDA;
+	      }
+	   } else if(ModeNo > 0x13) {
+	      if(SiS_Pr->SiS_LCDResInfo == Panel_1024x600) {
+	         if(!(SiS_Pr->SiS_LCDInfo & DontExpandLCD)) {
+	            if((resinfo == SIS_RI_800x600) || (resinfo == SIS_RI_400x300)) {
+                       SiS_Pr->SiS_SetFlag |= EnableLVDSDDA;
+		    }
+		 }
+	      }
 	   }
 	}
      }
 
      if(modeflag & HalfDCLK) {
-        if(SiS_Pr->SiS_IF_DEF_TRUMPION == 0) {
-           if(!(SiS_Pr->SiS_LCDInfo & DontExpandLCD)) {
-	      if(!(((SiS_Pr->SiS_IF_DEF_LVDS == 1) || (HwInfo->jChipType < SIS_315H)) &&
-	                                      (SiS_Pr->SiS_LCDResInfo == SiS_Pr->SiS_Panel640x480))) {
-                 if(ModeNo > 0x13) {
-                    if(SiS_Pr->SiS_LCDResInfo == SiS_Pr->SiS_Panel1024x768) {
-                       if(resinfo == SIS_RI_512x384) SiS_Pr->SiS_SetFlag |= EnableLVDSDDA;
-                    } else if(SiS_Pr->SiS_LCDResInfo == SiS_Pr->SiS_Panel800x600) {
-                       if(resinfo == SIS_RI_400x300) SiS_Pr->SiS_SetFlag |= EnableLVDSDDA;
-                    }
-                 }
-	      } else SiS_Pr->SiS_SetFlag |= EnableLVDSDDA;
-           } else SiS_Pr->SiS_SetFlag |= EnableLVDSDDA;
-        } else SiS_Pr->SiS_SetFlag |= EnableLVDSDDA;
+        if(SiS_Pr->SiS_IF_DEF_TRUMPION == 1) {
+	   SiS_Pr->SiS_SetFlag |= EnableLVDSDDA;
+        } else if(SiS_Pr->SiS_LCDInfo & DontExpandLCD) {
+	   SiS_Pr->SiS_SetFlag |= EnableLVDSDDA;
+	} else if(SiS_Pr->SiS_LCDResInfo == Panel_640x480) {
+	   SiS_Pr->SiS_SetFlag |= EnableLVDSDDA;
+	} else if(ModeNo > 0x13) {
+           if(SiS_Pr->SiS_LCDResInfo == Panel_1024x768) {
+              if(resinfo == SIS_RI_512x384) SiS_Pr->SiS_SetFlag |= EnableLVDSDDA;
+           } else if(SiS_Pr->SiS_LCDResInfo == Panel_800x600) {
+              if(resinfo == SIS_RI_400x300) SiS_Pr->SiS_SetFlag |= EnableLVDSDDA;
+           }
+	}
      }
 
   }
@@ -1763,14 +1996,6 @@ SiS_GetLCDResInfo(SiS_Private *SiS_Pr, USHORT ModeNo, USHORT ModeIdIndex,
      SiS_Pr->SiS_SetFlag |= LCDVESATiming;
   }
 
-  SiS_Pr->SiS_LCDInfo661 = 0;
-  if(SiS_Pr->SiS_SetFlag & LCDVESATiming) SiS_Pr->SiS_LCDInfo661 |= 0x0001;
-  if(SiS_Pr->SiS_SetFlag & EnableLVDSDDA) SiS_Pr->SiS_LCDInfo661 |= 0x0002;
-  if(SiS_Pr->SiS_LCDInfo & LCDPass11)     SiS_Pr->SiS_LCDInfo661 |= 0x0008;
-  if(SiS_Pr->SiS_LCDInfo & DontExpandLCD) SiS_Pr->SiS_LCDInfo661 |= 0x0010;
-  SiS_Pr->SiS_LCDInfo661 |= (SiS_Pr->SiS_LCDInfo & 0xe0);
-  if(SiS_Pr->SiS_LCDInfo & LCDDualLink)   SiS_Pr->SiS_LCDInfo661 |= 0x0100;
-
 #ifdef LINUX_KERNEL
 #ifdef TWDEBUG
   printk(KERN_DEBUG "sisfb: (LCDInfo=0x%04x LCDResInfo=0x%02x LCDTypeInfo=0x%02x)\n",
@@ -1792,54 +2017,21 @@ USHORT
 SiS_GetVCLK2Ptr(SiS_Private *SiS_Pr, USHORT ModeNo, USHORT ModeIdIndex,
                 USHORT RefreshRateTableIndex, PSIS_HW_INFO HwInfo)
 {
-  USHORT tempbx;
-  const USHORT LCDXlat0VCLK[4]    = {VCLK40,       VCLK40,       VCLK40,       VCLK40};
-  const USHORT LVDSXlat1VCLK[4]   = {VCLK40,       VCLK40,       VCLK40,       VCLK40};
-  const USHORT LVDSXlat4VCLK[4]   = {VCLK28,       VCLK28,       VCLK28,       VCLK28};
-#ifdef SIS300
-  const USHORT LCDXlat1VCLK300[4] = {VCLK65_300,   VCLK65_300,   VCLK65_300,   VCLK65_300};
-  const USHORT LCDXlat2VCLK300[4] = {VCLK108_2_300,VCLK108_2_300,VCLK108_2_300,VCLK108_2_300};
-  const USHORT LVDSXlat2VCLK300[4]= {VCLK65_300,   VCLK65_300,   VCLK65_300,   VCLK65_300};
-  const USHORT LVDSXlat3VCLK300[4]= {VCLK65_300,   VCLK65_300,   VCLK65_300,   VCLK65_300};
-#endif
-#ifdef SIS315H
-  const USHORT LCDXlat1VCLK310[4] = {VCLK65_315,   VCLK65_315,   VCLK65_315,   VCLK65_315};
-  const USHORT LCDXlat2VCLK310[4] = {VCLK108_2_315,VCLK108_2_315,VCLK108_2_315,VCLK108_2_315};
-  const USHORT LVDSXlat2VCLK310[4]= {VCLK65_315,   VCLK65_315,   VCLK65_315,   VCLK65_315};
-  const USHORT LVDSXlat3VCLK310[4]= {VCLK108_2_315,VCLK108_2_315,VCLK108_2_315,VCLK108_2_315};
-#endif
-  USHORT CRT2Index,VCLKIndex=0;
-  USHORT modeflag,resinfo;
-  const UCHAR  *CHTVVCLKPtr = NULL;
-  const USHORT *LCDXlatVCLK1 = NULL;
-  const USHORT *LCDXlatVCLK2 = NULL;
-  const USHORT *LVDSXlatVCLK2 = NULL;
-  const USHORT *LVDSXlatVCLK3 = NULL;
-
-  if(HwInfo->jChipType >= SIS_315H) {
-#ifdef SIS315H
-     LCDXlatVCLK1 = LCDXlat1VCLK310;
-     LCDXlatVCLK2 = LCDXlat2VCLK310;
-     LVDSXlatVCLK2 = LVDSXlat2VCLK310;
-     LVDSXlatVCLK3 = LVDSXlat3VCLK310;
-#endif
-  } else {
-#ifdef SIS300
-     LCDXlatVCLK1 = LCDXlat1VCLK300;
-     LCDXlatVCLK2 = LCDXlat2VCLK300;
-     LVDSXlatVCLK2 = LVDSXlat2VCLK300;
-     LVDSXlatVCLK3 = LVDSXlat3VCLK300;
-#endif
-  }
+  USHORT CRT2Index,VCLKIndex=0,VCLKIndexGEN=0;
+  USHORT modeflag,resinfo,tempbx;
+  const UCHAR *CHTVVCLKPtr = NULL;
 
   if(ModeNo <= 0x13) {
      modeflag = SiS_Pr->SiS_SModeIDTable[ModeIdIndex].St_ModeFlag;
      resinfo = SiS_Pr->SiS_SModeIDTable[ModeIdIndex].St_ResInfo;
      CRT2Index = SiS_Pr->SiS_SModeIDTable[ModeIdIndex].St_CRT2CRTC;
+     VCLKIndexGEN = (SiS_GetRegByte((SiS_Pr->SiS_P3ca+0x02)) >> 2) & 0x03;
   } else {
      modeflag = SiS_Pr->SiS_EModeIDTable[ModeIdIndex].Ext_ModeFlag;
      resinfo = SiS_Pr->SiS_EModeIDTable[ModeIdIndex].Ext_RESINFO;
      CRT2Index = SiS_Pr->SiS_RefIndex[RefreshRateTableIndex].Ext_CRT2CRTC;
+     VCLKIndexGEN = SiS_Pr->SiS_RefIndex[RefreshRateTableIndex].Ext_CRTVCLK;
+     if(HwInfo->jChipType < SIS_315H) VCLKIndexGEN &= 0x3f;
   }
 
   if(SiS_Pr->SiS_VBType & VB_SISVB) {    /* 30x/B/LV */
@@ -1847,50 +2039,34 @@ SiS_GetVCLK2Ptr(SiS_Private *SiS_Pr, USHORT ModeNo, USHORT ModeIdIndex,
      if(SiS_Pr->SiS_SetFlag & ProgrammingCRT2) {
 
         CRT2Index >>= 6;
-        if(SiS_Pr->SiS_VBInfo & (SetCRT2ToLCD | SetCRT2ToLCDA)) {      /*  LCD */
+        if(SiS_Pr->SiS_VBInfo & (SetCRT2ToLCD | SetCRT2ToLCDA)) {      	/*  LCD */
 
            if(HwInfo->jChipType < SIS_315H) {
-	      if(SiS_Pr->SiS_LCDResInfo == SiS_Pr->SiS_Panel800x600) {
-	         VCLKIndex = LCDXlat0VCLK[CRT2Index];
-	      } else if(SiS_Pr->SiS_LCDResInfo == SiS_Pr->SiS_Panel1024x768) {
-	    	 VCLKIndex = LCDXlatVCLK1[CRT2Index];
-	      } else if(SiS_Pr->SiS_LCDResInfo == SiS_Pr->SiS_Panel1024x600) {
-	    	 VCLKIndex = LCDXlatVCLK1[CRT2Index];
-	      } else if(SiS_Pr->SiS_LCDResInfo == SiS_Pr->SiS_Panel1152x768) {
-	    	 VCLKIndex = LCDXlatVCLK1[CRT2Index];
-	      } else if(SiS_Pr->SiS_LCDResInfo == SiS_Pr->SiS_Panel1280x768) {
-	         VCLKIndex = VCLK81_300;	/* guessed */
-	      } else if(SiS_Pr->SiS_LCDResInfo == SiS_Pr->SiS_Panel1280x960) {
-		 VCLKIndex = VCLK108_3_300;
-		 if(resinfo == SIS_RI_1280x1024) VCLKIndex = VCLK100_300;
-	      } else {
-	    	 VCLKIndex = LCDXlatVCLK2[CRT2Index];
-	      }
+	      VCLKIndex = SiS_Pr->PanelVCLKIdx300;
 	   } else {
-	      if( (SiS_Pr->SiS_VBType & VB_SIS301LV302LV) ||
-	          (!(SiS_Pr->SiS_LCDInfo & DontExpandLCD)) ) {
-      	         if(SiS_Pr->SiS_LCDResInfo == SiS_Pr->SiS_Panel1280x1024) {
-		    VCLKIndex = VCLK108_2_315;
-		 } else if(SiS_Pr->SiS_LCDResInfo == SiS_Pr->SiS_Panel1280x768) {
-		    VCLKIndex = VCLK81_315;  	/* guessed */
-		 } else if(SiS_Pr->SiS_LCDResInfo == SiS_Pr->SiS_Panel1400x1050) {
-		    VCLKIndex = VCLK108_2_315;
-		 } else if(SiS_Pr->SiS_LCDResInfo == SiS_Pr->SiS_Panel1600x1200) {
-		    VCLKIndex = VCLK162_315;
-		 } else if(SiS_Pr->SiS_LCDResInfo == SiS_Pr->SiS_Panel1280x960) {
-		    VCLKIndex = VCLK108_3_315;
-		    if(resinfo == SIS_RI_1280x1024) VCLKIndex = VCLK100_315;
-		 } else if(SiS_Pr->SiS_LCDResInfo == SiS_Pr->SiS_Panel1024x768) {
-		    VCLKIndex = LCDXlatVCLK1[CRT2Index];
-	         } else {
-		    VCLKIndex = LCDXlatVCLK2[CRT2Index];
-      	         }
-	      } else {
-                 VCLKIndex = (UCHAR)SiS_GetRegByte((USHORT)(SiS_Pr->SiS_P3ca+0x02));  /*  Port 3cch */
-         	 VCLKIndex = ((VCLKIndex >> 2) & 0x03);
-        	 if(ModeNo > 0x13) {
-          	    VCLKIndex = SiS_Pr->SiS_RefIndex[RefreshRateTableIndex].Ext_CRTVCLK;
-        	 }
+	      VCLKIndex = SiS_Pr->PanelVCLKIdx315;
+	      if((SiS_Pr->SiS_LCDInfo & DontExpandLCD) && (SiS_Pr->SiS_LCDInfo & LCDPass11)) {
+	         VCLKIndex = VCLKIndexGEN;
+		 switch(resinfo) {
+		 /* Only those whose IndexGEN doesn't match VBVCLK array: */
+		 case SIS_RI_1280x720: VCLKIndex = VCLK_1280x720;
+		 		       if(SiS_Pr->SiS_LCDResInfo == Panel_1280x720) {
+		                          if(SiS_Pr->PanelHT == 1344) {
+					     VCLKIndex = VCLK_1280x720_2;
+					  }
+				       }
+		 		       break;
+		 case SIS_RI_720x480:  VCLKIndex = VCLK_720x480;  break;
+		 case SIS_RI_720x576:  VCLKIndex = VCLK_720x576;  break;
+		 case SIS_RI_768x576:  VCLKIndex = VCLK_768x576;  break;
+		 case SIS_RI_848x480:  VCLKIndex = VCLK_848x480;  break;
+		 case SIS_RI_856x480:  VCLKIndex = VCLK_856x480;  break;
+		 case SIS_RI_800x480:  VCLKIndex = VCLK_800x480;  break;
+		 case SIS_RI_1024x576: VCLKIndex = VCLK_1024x576; break;
+		 case SIS_RI_1152x864: VCLKIndex = VCLK_1152x864; break;
+		 case SIS_RI_1360x768: VCLKIndex = VCLK_1360x768; break;
+		 }
+
 		 if(ModeNo <= 0x13) {
 		    if(HwInfo->jChipType <= SIS_315PRO) {
 		       if(SiS_Pr->SiS_SModeIDTable[ModeIdIndex].St_CRT2CRTC == 1) VCLKIndex = 0x42;
@@ -1906,34 +2082,28 @@ SiS_GetVCLK2Ptr(SiS_Private *SiS_Pr, USHORT ModeNo, USHORT ModeIdIndex,
 	      }
 	   }
 
-        } else if(SiS_Pr->SiS_VBInfo & SetCRT2ToTV) {                 /*  TV */
+        } else if(SiS_Pr->SiS_VBInfo & SetCRT2ToTV) {                 	/*  TV */
 
 	   if(SiS_Pr->SiS_VBInfo & SetCRT2ToHiVision) {
-              if(SiS_Pr->SiS_TVMode & TVRPLLDIV2XO) VCLKIndex = HiTVVCLKDIV2;
-     	      else                                  VCLKIndex = HiTVVCLK;
+              if(SiS_Pr->SiS_TVMode & TVRPLLDIV2XO) 		VCLKIndex = HiTVVCLKDIV2;
+     	      else                                  		VCLKIndex = HiTVVCLK;
               if(SiS_Pr->SiS_TVMode & TVSetTVSimuMode) {
-            	 if(modeflag & Charx8Dot) 	    VCLKIndex = HiTVSimuVCLK;
-            	 else 			  	    VCLKIndex = HiTVTextVCLK;
+            	 if(modeflag & Charx8Dot) 	    		VCLKIndex = HiTVSimuVCLK;
+            	 else 			  	    		VCLKIndex = HiTVTextVCLK;
               }
-           } else if(SiS_Pr->SiS_TVMode & TVSetYPbPr750p) VCLKIndex = YPbPr750pVCLK - TVCLKBASE_315;
-	   else if(SiS_Pr->SiS_TVMode & TVSetYPbPr525p)   VCLKIndex = TVVCLKDIV2;
-	   else if(SiS_Pr->SiS_TVMode & TVRPLLDIV2XO)     VCLKIndex = TVVCLKDIV2;
-           else         		            	  VCLKIndex = TVVCLK;
+           } else if(SiS_Pr->SiS_TVMode & TVSetYPbPr750p) 	VCLKIndex = YPbPr750pVCLK;
+	   else if(SiS_Pr->SiS_TVMode & TVSetYPbPr525p)   	VCLKIndex = TVVCLKDIV2;
+	   else if(SiS_Pr->SiS_TVMode & TVRPLLDIV2XO)     	VCLKIndex = TVVCLKDIV2;
+           else         		            	  	VCLKIndex = TVVCLK;
 
-	   if(HwInfo->jChipType < SIS_315H) {
-              VCLKIndex += TVCLKBASE_300;
-  	   } else {
-	      VCLKIndex += TVCLKBASE_315;
-	   }
+	   if(HwInfo->jChipType < SIS_315H) VCLKIndex += TVCLKBASE_300;
+  	   else 	                    VCLKIndex += TVCLKBASE_315;
 
-        } else {         					/* VGA2 */
+        } else {         						/* VGA2 */
 
-           VCLKIndex = (UCHAR)SiS_GetRegByte((USHORT)(SiS_Pr->SiS_P3ca+0x02));
-           VCLKIndex = ((VCLKIndex >> 2) & 0x03);
-           if(ModeNo > 0x13) {
-              VCLKIndex = SiS_Pr->SiS_RefIndex[RefreshRateTableIndex].Ext_CRTVCLK;
-	      if(HwInfo->jChipType < SIS_315H) {
-          	 VCLKIndex &= 0x3f;
+	   VCLKIndex = VCLKIndexGEN;
+	   if(HwInfo->jChipType < SIS_315H) {
+              if(ModeNo > 0x13) {
 		 if( (HwInfo->jChipType == SIS_630) &&
 		     (HwInfo->jChipRevision >= 0x30)) {
 		    if(VCLKIndex == 0x14) VCLKIndex = 0x34;
@@ -1946,12 +2116,9 @@ SiS_GetVCLK2Ptr(SiS_Private *SiS_Pr, USHORT ModeNo, USHORT ModeIdIndex,
 
      } else {   /* If not programming CRT2 */
 
-        VCLKIndex = (UCHAR)SiS_GetRegByte((USHORT)(SiS_Pr->SiS_P3ca+0x02));
-        VCLKIndex = ((VCLKIndex >> 2) & 0x03);
-        if(ModeNo > 0x13) {
-           VCLKIndex = SiS_Pr->SiS_RefIndex[RefreshRateTableIndex].Ext_CRTVCLK;
-	   if(HwInfo->jChipType < SIS_315H) {
-              VCLKIndex &= 0x3f;
+        VCLKIndex = VCLKIndexGEN;
+	if(HwInfo->jChipType < SIS_315H) {
+           if(ModeNo > 0x13) {
 	      if( (HwInfo->jChipType != SIS_630) &&
 		  (HwInfo->jChipType != SIS_300) ) {
 		 if(VCLKIndex == 0x1b) VCLKIndex = 0x35;
@@ -1964,7 +2131,7 @@ SiS_GetVCLK2Ptr(SiS_Private *SiS_Pr, USHORT ModeNo, USHORT ModeIdIndex,
 
      VCLKIndex = CRT2Index;
 
-     if(SiS_Pr->SiS_SetFlag & ProgrammingCRT2) {  /* programming CRT2 */
+     if(SiS_Pr->SiS_SetFlag & ProgrammingCRT2) {
 
         if( (SiS_Pr->SiS_IF_DEF_CH70xx != 0) && (SiS_Pr->SiS_VBInfo & SetCRT2ToTV) ) {
 
@@ -2000,32 +2167,16 @@ SiS_GetVCLK2Ptr(SiS_Private *SiS_Pr, USHORT ModeNo, USHORT ModeIdIndex,
 
         } else if(SiS_Pr->SiS_VBInfo & SetCRT2ToLCD) {
 
-	   VCLKIndex >>= 6;
-     	   if((SiS_Pr->SiS_LCDResInfo == SiS_Pr->SiS_Panel800x600) ||
-	      (SiS_Pr->SiS_LCDResInfo == SiS_Pr->SiS_Panel320x480))
-     	      VCLKIndex = LVDSXlat1VCLK[VCLKIndex];
-	   else if(SiS_Pr->SiS_LCDResInfo == SiS_Pr->SiS_Panel640x480   ||
-	           SiS_Pr->SiS_LCDResInfo == SiS_Pr->SiS_Panel640x480_2 ||
-		   SiS_Pr->SiS_LCDResInfo == SiS_Pr->SiS_Panel640x480_3)
-	      VCLKIndex = LVDSXlat4VCLK[VCLKIndex];
-     	   else if(SiS_Pr->SiS_LCDResInfo == SiS_Pr->SiS_Panel1024x768)
-     	      VCLKIndex = LVDSXlatVCLK2[VCLKIndex];
-	   else if(SiS_Pr->SiS_LCDResInfo == SiS_Pr->SiS_Panel1024x600)
-              VCLKIndex = LVDSXlatVCLK2[VCLKIndex];
-	   else if(SiS_Pr->SiS_LCDResInfo == SiS_Pr->SiS_Panel1152x768)
-              VCLKIndex = LVDSXlatVCLK2[VCLKIndex];
-	   else if(SiS_Pr->SiS_LCDResInfo == SiS_Pr->SiS_Panel1280x768)
-	      VCLKIndex = VCLK68_315;
-	   else if(SiS_Pr->SiS_LCDResInfo == SiS_Pr->SiS_Panel1600x1200)
-	      VCLKIndex = VCLK162_315;
-     	   else
-	      VCLKIndex = LVDSXlatVCLK3[VCLKIndex];
-
-	   if(SiS_Pr->SiS_CustomT == CUT_BARCO1366) {
-	      /* Special Timing: Barco iQ Pro R series */
-	      VCLKIndex = 0x44;
+	   if(HwInfo->jChipType < SIS_315H) {
+	      VCLKIndex = SiS_Pr->PanelVCLKIdx300;
+	   } else {
+	      VCLKIndex = SiS_Pr->PanelVCLKIdx315;
 	   }
 
+	   /* Special Timing: Barco iQ Pro R series */
+	   if(SiS_Pr->SiS_CustomT == CUT_BARCO1366) VCLKIndex = 0x44;
+
+	   /* Special Timing: 848x480 parallel lvds */
 	   if(SiS_Pr->SiS_CustomT == CUT_PANEL848) {
 	      if(HwInfo->jChipType < SIS_315H) {
 		 VCLKIndex = VCLK34_300;
@@ -2038,28 +2189,22 @@ SiS_GetVCLK2Ptr(SiS_Private *SiS_Pr, USHORT ModeNo, USHORT ModeIdIndex,
 
         } else {
 
-	   VCLKIndex = (UCHAR)SiS_GetRegByte((USHORT)(SiS_Pr->SiS_P3ca+0x02));
-           VCLKIndex = ((VCLKIndex >> 2) & 0x03);
-           if(ModeNo > 0x13) {
-              VCLKIndex = SiS_Pr->SiS_RefIndex[RefreshRateTableIndex].Ext_CRTVCLK;
-	      if(HwInfo->jChipType < SIS_315H) {
-    	 	 VCLKIndex &= 0x3F;
+	   VCLKIndex = VCLKIndexGEN;
+	   if(HwInfo->jChipType < SIS_315H) {
+              if(ModeNo > 0x13) {
+		 if( (HwInfo->jChipType == SIS_630) &&
+                     (HwInfo->jChipRevision >= 0x30) ) {
+		    if(VCLKIndex == 0x14) VCLKIndex = 0x2e;
+	         }
               }
-	      if( (HwInfo->jChipType == SIS_630) &&
-                  (HwInfo->jChipRevision >= 0x30) ) {
-		 if(VCLKIndex == 0x14) VCLKIndex = 0x2e;
-	      }
 	   }
         }
 
      } else {  /* if not programming CRT2 */
 
-        VCLKIndex = (UCHAR)SiS_GetRegByte((USHORT)(SiS_Pr->SiS_P3ca+0x02));
-        VCLKIndex = ((VCLKIndex >> 2) & 0x03);
-        if(ModeNo > 0x13) {
-           VCLKIndex = SiS_Pr->SiS_RefIndex[RefreshRateTableIndex].Ext_CRTVCLK;
-           if(HwInfo->jChipType < SIS_315H) {
-	      VCLKIndex &= 0x3F;
+        VCLKIndex = VCLKIndexGEN;
+	if(HwInfo->jChipType < SIS_315H) {
+           if(ModeNo > 0x13) {
 	      if( (HwInfo->jChipType != SIS_630) &&
 	          (HwInfo->jChipType != SIS_300) ) {
 		 if(VCLKIndex == 0x1b) VCLKIndex = 0x35;
@@ -2094,21 +2239,20 @@ SiS_SetCRT2ModeRegs(SiS_Private *SiS_Pr, USHORT ModeNo, USHORT ModeIdIndex,
 {
   USHORT i,j,modeflag;
   USHORT tempcl,tempah=0;
-#ifdef SIS300
-  USHORT temp;
+#if defined(SIS300) || defined(SIS315H)
+  USHORT tempbl;
 #endif
 #ifdef SIS315H
-  USHORT tempbl, tempah2, tempbl2;
+  UCHAR  *ROMAddr = HwInfo->pjVirtualRomBase;
+  USHORT tempah2, tempbl2;
 #endif
 
   if(ModeNo <= 0x13) {
      modeflag = SiS_Pr->SiS_SModeIDTable[ModeIdIndex].St_ModeFlag;
+  } else if(SiS_Pr->UseCustomMode) {
+     modeflag = SiS_Pr->CModeFlag;
   } else {
-     if(SiS_Pr->UseCustomMode) {
-        modeflag = SiS_Pr->CModeFlag;
-     } else {
-    	modeflag = SiS_Pr->SiS_EModeIDTable[ModeIdIndex].Ext_ModeFlag;
-     }
+     modeflag = SiS_Pr->SiS_EModeIDTable[ModeIdIndex].Ext_ModeFlag;
   }
 
   /* BIOS does not do this (neither 301 nor LVDS) */
@@ -2123,6 +2267,9 @@ SiS_SetCRT2ModeRegs(SiS_Private *SiS_Pr, USHORT ModeNo, USHORT ModeIdIndex,
   } else {
 
      for(i=0,j=4; i<3; i++,j++) SiS_SetReg(SiS_Pr->SiS_Part1Port,j,0);
+     if(HwInfo->jChipType >= SIS_315H) {
+        SiS_SetRegAND(SiS_Pr->SiS_Part1Port,0x02,0x7F);
+     }
 
      tempcl = SiS_Pr->SiS_ModeType;
 
@@ -2132,14 +2279,14 @@ SiS_SetCRT2ModeRegs(SiS_Private *SiS_Pr, USHORT ModeNo, USHORT ModeIdIndex,
 
         /* For 301BDH: (with LCD via LVDS) */
         if(SiS_Pr->SiS_VBType & VB_NoLCD) {
-	   temp = SiS_GetReg(SiS_Pr->SiS_P3c4,0x32);
-	   temp &= 0xef;
-	   temp |= 0x02;
+	   tempbl = SiS_GetReg(SiS_Pr->SiS_P3c4,0x32);
+	   tempbl &= 0xef;
+	   tempbl |= 0x02;
 	   if((SiS_Pr->SiS_VBInfo & SetCRT2ToTV) || (SiS_Pr->SiS_VBInfo & SetCRT2ToRAMDAC)) {
-	      temp |= 0x10;
-	      temp &= 0xfd;
+	      tempbl |= 0x10;
+	      tempbl &= 0xfd;
 	   }
-	   SiS_SetReg(SiS_Pr->SiS_P3c4,0x32,temp);
+	   SiS_SetReg(SiS_Pr->SiS_P3c4,0x32,tempbl);
         }
 
         if(ModeNo > 0x13) {
@@ -2226,8 +2373,8 @@ SiS_SetCRT2ModeRegs(SiS_Private *SiS_Pr, USHORT ModeNo, USHORT ModeIdIndex,
         }
 
         if((HwInfo->jChipType < SIS_315H) && (SiS_Pr->SiS_VBType & VB_SIS301)) {
-	   if((SiS_Pr->SiS_LCDResInfo == SiS_Pr->SiS_Panel1280x1024) ||
-	      (SiS_Pr->SiS_LCDResInfo == SiS_Pr->SiS_Panel1280x960)) {
+	   if((SiS_Pr->SiS_LCDResInfo == Panel_1280x1024) ||
+	      (SiS_Pr->SiS_LCDResInfo == Panel_1280x960)) {
 	      tempah |= 0x80;
 	   }
         } else {
@@ -2254,9 +2401,9 @@ SiS_SetCRT2ModeRegs(SiS_Private *SiS_Pr, USHORT ModeNo, USHORT ModeIdIndex,
        	   }
         }
 
-	if((SiS_Pr->SiS_LCDResInfo == SiS_Pr->SiS_Panel1280x1024) ||
-	   (SiS_Pr->SiS_LCDResInfo == SiS_Pr->SiS_Panel1280x960)  ||
-	   ((SiS_Pr->SiS_LCDResInfo == SiS_Pr->SiS_PanelCustom) &&
+	if((SiS_Pr->SiS_LCDResInfo == Panel_1280x1024) ||
+	   (SiS_Pr->SiS_LCDResInfo == Panel_1280x960)  ||
+	   ((SiS_Pr->SiS_LCDResInfo == Panel_Custom) &&
 	    (SiS_Pr->CP_MaxX >= 1280) && (SiS_Pr->CP_MaxY >= 960))) {
 	   tempah |= 0x80;
         }
@@ -2344,10 +2491,11 @@ SiS_SetCRT2ModeRegs(SiS_Private *SiS_Pr, USHORT ModeNo, USHORT ModeIdIndex,
 	 * in a 650 box (Jake). What is the criteria?
 	 */
 
-	if((IS_SIS740) || (HwInfo->jChipType >= SIS_661)) {
+	if((IS_SIS740) || (HwInfo->jChipType >= SIS_661) || (SiS_Pr->SiS_ROMNew)) {
 	   tempah = 0x30;
 	   tempbl = 0xc0;
-	   if(SiS_Pr->SiS_VBInfo & DisableCRT2Display) {
+	   if((SiS_Pr->SiS_VBInfo & DisableCRT2Display) ||
+	      ((SiS_Pr->SiS_ROMNew) && (!(ROMAddr[0x5b] & 0x04)))) {
 	      tempah = 0x00;
 	      tempbl = 0x00;
 	   }
@@ -2378,23 +2526,23 @@ SiS_SetCRT2ModeRegs(SiS_Private *SiS_Pr, USHORT ModeNo, USHORT ModeIdIndex,
 
 	if(IS_SIS740) {
 	   tempah = 0x80;
-	   if(SiS_Pr->SiS_VBInfo & DisableCRT2Display) {
-	      tempah = 0x00;
-	   }
+	   if(SiS_Pr->SiS_VBInfo & DisableCRT2Display) tempah = 0x00;
 	   SiS_SetRegANDOR(SiS_Pr->SiS_Part4Port,0x23,0x7f,tempah);
 	} else {
 	   tempah = 0x00;
            tempbl = 0x7f;
            if(!(SiS_Pr->SiS_VBInfo & SetCRT2ToLCDA)) {
               tempbl = 0xff;
-	      if(!(SiS_IsDualEdge(SiS_Pr, HwInfo))) {
-	         tempah = 0x80;
-	      }
+	      if(!(SiS_IsDualEdge(SiS_Pr, HwInfo))) tempah = 0x80;
            }
            SiS_SetRegANDOR(SiS_Pr->SiS_Part4Port,0x23,tempbl,tempah);
 	}
 
-	/* 661: Sets p4 27 and 34 here, done in SetGroup4 here */
+#if 0
+	if(SiS_Pr->SiS_VBType & VB_SIS301C) {
+	   SiS_SetRegOR(SiS_Pr->SiS_Part4Port,0x3a,0xc0);
+	}
+#endif
 
 #endif /* SIS315H */
 
@@ -2423,9 +2571,7 @@ SiS_SetCRT2ModeRegs(SiS_Private *SiS_Pr, USHORT ModeNo, USHORT ModeIdIndex,
 	   tempbl = 0xfb;
            if(!(SiS_Pr->SiS_VBInfo & SetCRT2ToLCDA)) {
               tempah = 0x00;
-	      if(SiS_IsDualEdge(SiS_Pr, HwInfo)) {
-	         tempbl = 0xff;
-	      }
+	      if(SiS_IsDualEdge(SiS_Pr, HwInfo)) tempbl = 0xff;
            }
 	   SiS_SetRegANDOR(SiS_Pr->SiS_Part1Port,0x13,tempbl,tempah);
 
@@ -2456,14 +2602,8 @@ SiS_SetCRT2ModeRegs(SiS_Private *SiS_Pr, USHORT ModeNo, USHORT ModeIdIndex,
 USHORT
 SiS_GetResInfo(SiS_Private *SiS_Pr,USHORT ModeNo,USHORT ModeIdIndex)
 {
-  USHORT resindex;
-
-  if(ModeNo <= 0x13)
-     resindex = SiS_Pr->SiS_SModeIDTable[ModeIdIndex].St_ResInfo;
-  else
-     resindex = SiS_Pr->SiS_EModeIDTable[ModeIdIndex].Ext_RESINFO;
-
-  return(resindex);
+  if(ModeNo <= 0x13) return((USHORT)SiS_Pr->SiS_SModeIDTable[ModeIdIndex].St_ResInfo);
+  else               return((USHORT)SiS_Pr->SiS_EModeIDTable[ModeIdIndex].Ext_RESINFO);
 }
 
 static void
@@ -2473,8 +2613,12 @@ SiS_GetCRT2ResInfo(SiS_Private *SiS_Pr,USHORT ModeNo,USHORT ModeIdIndex,
   USHORT xres,yres,modeflag=0,resindex;
 
   if(SiS_Pr->UseCustomMode) {
-     SiS_Pr->SiS_VGAHDE = SiS_Pr->SiS_HDE = SiS_Pr->CHDisplay;
-     SiS_Pr->SiS_VGAVDE = SiS_Pr->SiS_VDE = SiS_Pr->CVDisplay;
+     xres = SiS_Pr->CHDisplay;
+     if(SiS_Pr->CModeFlag & HalfDCLK) xres *= 2;
+     SiS_Pr->SiS_VGAHDE = SiS_Pr->SiS_HDE = xres;
+     yres = SiS_Pr->CVDisplay;
+     if(SiS_Pr->CModeFlag & DoubleScanMode) yres *= 2;
+     SiS_Pr->SiS_VGAVDE = SiS_Pr->SiS_VDE = yres;
      return;
   }
 
@@ -2489,7 +2633,7 @@ SiS_GetCRT2ResInfo(SiS_Private *SiS_Pr,USHORT ModeNo,USHORT ModeIdIndex,
      modeflag = SiS_Pr->SiS_EModeIDTable[ModeIdIndex].Ext_ModeFlag;
   }
 
-  if((!SiS_Pr->SiS_IF_DEF_DSTN) && (!SiS_Pr->SiS_IF_DEF_FSTN)) {
+  if(!SiS_Pr->SiS_IF_DEF_DSTN && !SiS_Pr->SiS_IF_DEF_FSTN) {
 
      if((HwInfo->jChipType >= SIS_315H) && (SiS_Pr->SiS_IF_DEF_LVDS == 1)) {
         if((ModeNo != 0x03) && (SiS_Pr->SiS_SetFlag & SetDOSMode)) {
@@ -2500,72 +2644,66 @@ SiS_GetCRT2ResInfo(SiS_Private *SiS_Pr,USHORT ModeNo,USHORT ModeIdIndex,
         }
      }
 
-     if(ModeNo > 0x13) {
-  	if(modeflag & HalfDCLK)       xres *= 2;
-  	if(modeflag & DoubleScanMode) yres *= 2;
-     }
+     if(modeflag & HalfDCLK)       xres *= 2;
+     if(modeflag & DoubleScanMode) yres *= 2;
 
   }
 
-  if(SiS_Pr->SiS_VBType & VB_SISVB) {
-        if(SiS_Pr->SiS_VBInfo & SetCRT2ToLCDA) {
+  if((SiS_Pr->SiS_VBType & VB_SISVB) && (!(SiS_Pr->SiS_VBType & VB_NoLCD))) {
+
+#if 0
+        if(SiS_Pr->SiS_VBInfo & (SetCRT2ToLCDA | SetCRT2ToLCD | SetCRT2ToHiVision)) {
            if(xres == 720) xres = 640;
-	} else {
-	   if(SiS_Pr->SiS_VBType & VB_NoLCD) {           /* 301BDH */
-	        if(SiS_Pr->SiS_VBInfo & (SetCRT2ToLCD | SetCRT2ToHiVision)) {
-                   if(xres == 720) xres = 640;
-		}
-		if(SiS_Pr->SiS_SetFlag & SetDOSMode) {
-	           yres = 400;
-	           if(HwInfo->jChipType >= SIS_315H) {
-	              if(SiS_GetReg(SiS_Pr->SiS_P3c4,0x17) & 0x80) yres = 480;
-	           } else {
-	              if(SiS_GetReg(SiS_Pr->SiS_P3c4,0x13) & 0x80) yres = 480;
-	           }
-	        }
-	   } else {
-	      if(SiS_Pr->SiS_VBInfo & (SetCRT2ToLCD | SetCRT2ToHiVision)) {
-	         if(xres == 720) xres = 640;
-	      }
-	      if(SiS_Pr->SiS_VBInfo & SetCRT2ToLCD) {
-		 if(SiS_Pr->SiS_LCDResInfo == SiS_Pr->SiS_Panel1600x1200) {
-		    if(!(SiS_Pr->SiS_SetFlag & LCDVESATiming)) {
-        	       if(yres == 1024) yres = 1056;
-      		    }
-		 } else if(SiS_Pr->SiS_LCDResInfo == SiS_Pr->SiS_Panel1280x1024) {
-		    if(!(SiS_Pr->SiS_LCDInfo & DontExpandLCD)) {
-		       /* BIOS bug - does this regardless of scaling */
-      		       if(yres == 400) yres = 405;
-		    }
-      		    if(yres == 350) yres = 360;
-      		    if(SiS_Pr->SiS_SetFlag & LCDVESATiming) {
-        	       if(yres == 360) yres = 375;
-      		    }
-   	         } else if(SiS_Pr->SiS_LCDResInfo == SiS_Pr->SiS_Panel1024x768) {
-      		    if(!(SiS_Pr->SiS_SetFlag & LCDVESATiming)) {
-        	       if(!(SiS_Pr->SiS_LCDInfo & DontExpandLCD)) {
-          	          if(yres == 350) yres = 357;
-          	          if(yres == 400) yres = 420;
-            	          if(yres == 480) yres = 525;
-        	       }
-      		    }
-    	         }
+	}
+#endif
+
+	if(SiS_Pr->SiS_VBInfo & SetCRT2ToLCD) {
+	   switch(SiS_Pr->SiS_LCDResInfo) {
+	   case Panel_1024x768:
+	      if(!(SiS_Pr->SiS_SetFlag & LCDVESATiming)) {
+                 if(!(SiS_Pr->SiS_LCDInfo & DontExpandLCD)) {
+          	    if(yres == 350) yres = 357;
+          	    if(yres == 400) yres = 420;
+            	    if(yres == 480) yres = 525;
+        	 }
+      	      }
+	      break;
+	   case Panel_1280x1024:
+	      if(!(SiS_Pr->SiS_LCDInfo & DontExpandLCD)) {
+		 /* BIOS bug - does this regardless of scaling */
+      		 if(yres == 400) yres = 405;
 	      }
+      	      if(yres == 350) yres = 360;
+      	      if(SiS_Pr->SiS_SetFlag & LCDVESATiming) {
+                 if(yres == 360) yres = 375;
+      	      }
+	      break;
+	   case Panel_1600x1200:
+	      if(!(SiS_Pr->SiS_SetFlag & LCDVESATiming)) {
+        	 if(yres == 1024) yres = 1056;
+      	      }
+	      break;
 	   }
 	}
+
   } else {
-    	if(xres == 720) xres = 640;
-	if(SiS_Pr->SiS_SetFlag & SetDOSMode) {
-	   yres = 400;
-	   if(HwInfo->jChipType >= SIS_315H) {
-	      if(SiS_GetReg(SiS_Pr->SiS_P3c4,0x17) & 0x80) yres = 480;
-	   } else {
-	      if(SiS_GetReg(SiS_Pr->SiS_P3c4,0x13) & 0x80) yres = 480;
-	   }
-	   if(SiS_Pr->SiS_IF_DEF_DSTN || SiS_Pr->SiS_IF_DEF_FSTN) {
-	      yres = 480;
-	   }
+
+     if(SiS_Pr->SiS_VBType & VB_SISVB) {
+        if(SiS_Pr->SiS_VBInfo & (SetCRT2ToLCD | SetCRT2ToHiVision)) {
+           if(xres == 720) xres = 640;
 	}
+     } else if(xres == 720) xres = 640;
+
+     if(SiS_Pr->SiS_SetFlag & SetDOSMode) {
+	yres = 400;
+        if(HwInfo->jChipType >= SIS_315H) {
+           if(SiS_GetReg(SiS_Pr->SiS_P3c4,0x17) & 0x80) yres = 480;
+        } else {
+           if(SiS_GetReg(SiS_Pr->SiS_P3c4,0x13) & 0x80) yres = 480;
+        }
+        if(SiS_Pr->SiS_IF_DEF_DSTN || SiS_Pr->SiS_IF_DEF_FSTN)  yres = 480;
+     }
+
   }
   SiS_Pr->SiS_VGAHDE = SiS_Pr->SiS_HDE = xres;
   SiS_Pr->SiS_VGAVDE = SiS_Pr->SiS_VDE = yres;
@@ -2580,103 +2718,84 @@ SiS_GetLVDSCRT1Ptr(SiS_Private *SiS_Pr, USHORT ModeNo, USHORT ModeIdIndex,
 		   USHORT RefreshRateTableIndex, USHORT *ResIndex,
 		   USHORT *DisplayType)
  {
-  USHORT tempbx,modeflag=0;
-  USHORT Flag,CRT2CRTC;
+  USHORT modeflag=0;
 
   if(SiS_Pr->SiS_IF_DEF_LVDS == 1) {
      if(!(SiS_Pr->SiS_VBInfo & SetCRT2ToLCDA)) {
         if(!(SiS_Pr->SiS_VBInfo & SetInSlaveMode)) return FALSE;
      }
   } else if(SiS_Pr->SiS_VBType & VB_SISVB) {
-     if(!(SiS_Pr->SiS_VBInfo & SetInSlaveMode)) return FALSE;
+     if(!(SiS_Pr->SiS_VBInfo & SetInSlaveMode))    return FALSE;
   } else
      return FALSE;
 
   if(ModeNo <= 0x13) {
      modeflag = SiS_Pr->SiS_SModeIDTable[ModeIdIndex].St_ModeFlag;
-     CRT2CRTC = SiS_Pr->SiS_SModeIDTable[ModeIdIndex].St_CRT2CRTC;
+     (*ResIndex) = SiS_Pr->SiS_SModeIDTable[ModeIdIndex].St_CRT2CRTC;
   } else {
      modeflag = SiS_Pr->SiS_EModeIDTable[ModeIdIndex].Ext_ModeFlag;
-     CRT2CRTC = SiS_Pr->SiS_RefIndex[RefreshRateTableIndex].Ext_CRT2CRTC;
+     (*ResIndex) = SiS_Pr->SiS_RefIndex[RefreshRateTableIndex].Ext_CRT2CRTC;
   }
 
-  Flag = 1;
-  tempbx = 0;
-  if(SiS_Pr->SiS_IF_DEF_CH70xx != 0) {
-     if(!(SiS_Pr->SiS_VBInfo & SetCRT2ToLCD)) {
-        Flag = 0;
-        tempbx = 18;
-        if(SiS_Pr->SiS_TVMode & TVSetCHOverScan) tempbx++;
-        if(SiS_Pr->SiS_TVMode & TVSetPAL) {
-      	   tempbx += 2;
-	   if(SiS_Pr->SiS_ModeType > ModeVGA) {
-	      if(SiS_Pr->SiS_CHSOverScan) tempbx = 99;
-	   }
-	   if(SiS_Pr->SiS_TVMode & TVSetPALM) {
-	      tempbx = 18;  /* PALM uses NTSC data */
-	      if(SiS_Pr->SiS_TVMode & TVSetCHOverScan) tempbx++;
-	   } else if(SiS_Pr->SiS_TVMode & TVSetPALN) {
-	      tempbx = 20;  /* PALN uses PAL data  */
-	      if(SiS_Pr->SiS_TVMode & TVSetCHOverScan) tempbx++;
-	   }
-        }
-     }
-  }
-  if(Flag) {
-     tempbx = SiS_Pr->SiS_LCDResInfo;
-     tempbx -= SiS_Pr->SiS_PanelMinLVDS;
-     if(SiS_Pr->SiS_LCDResInfo <= SiS_Pr->SiS_Panel1280x1024) {
-        if(SiS_Pr->SiS_LCDInfo & DontExpandLCD) tempbx += 6;
-        if(modeflag & HalfDCLK) tempbx += 3;
-     } else {
-        if(SiS_Pr->SiS_LCDResInfo == SiS_Pr->SiS_Panel1400x1050) {
-           tempbx = 14;
-	   if(SiS_Pr->SiS_LCDInfo & DontExpandLCD) tempbx += 2;
-	   if(modeflag & HalfDCLK) tempbx++;
-        } else if(SiS_Pr->SiS_LCDResInfo == SiS_Pr->SiS_Panel1024x600) {
-           tempbx = 23;
-	   if(SiS_Pr->SiS_LCDInfo & DontExpandLCD) tempbx += 2;
-	   if(modeflag & HalfDCLK) tempbx++;
-        } else if(SiS_Pr->SiS_LCDResInfo == SiS_Pr->SiS_Panel1152x768) {
-           tempbx = 27;
-	   if(SiS_Pr->SiS_LCDInfo & DontExpandLCD) tempbx += 2;
-	   if(modeflag & HalfDCLK) tempbx++;
-        } else if(SiS_Pr->SiS_LCDResInfo == SiS_Pr->SiS_Panel1600x1200) {
-           tempbx = 36;
-	   if(SiS_Pr->SiS_LCDInfo & DontExpandLCD) tempbx += 2;
-	   if(modeflag & HalfDCLK) tempbx++;
-        } else if(SiS_Pr->SiS_LCDResInfo == SiS_Pr->SiS_Panel1280x768) {
-           tempbx = 40;
-	   if(SiS_Pr->SiS_LCDInfo & DontExpandLCD) tempbx += 2;
-	   if(modeflag & HalfDCLK) tempbx++;
-        } else if(SiS_Pr->SiS_LCDResInfo == SiS_Pr->SiS_Panel640x480_3) {
-           tempbx = 54;
-	   if(modeflag & HalfDCLK) tempbx++;
-	} else if(SiS_Pr->SiS_LCDResInfo == SiS_Pr->SiS_Panel640x480_2) {
-           tempbx = 52;
-	   if(modeflag & HalfDCLK) tempbx++;
-	} else if(SiS_Pr->SiS_LCDResInfo == SiS_Pr->SiS_Panel640x480) {
-           tempbx = 50;
-	   if(modeflag & HalfDCLK) tempbx++;
-        }
+  (*ResIndex) &= 0x3F;
 
+  if((SiS_Pr->SiS_IF_DEF_CH70xx) && (SiS_Pr->SiS_VBInfo & SetCRT2ToTV)) {
+     (*DisplayType) = 18;
+     if(SiS_Pr->SiS_TVMode & TVSetCHOverScan) (*DisplayType)++;
+     if(SiS_Pr->SiS_TVMode & TVSetPAL) {
+      	(*DisplayType) += 2;
+	if(SiS_Pr->SiS_ModeType > ModeVGA) {
+	   if(SiS_Pr->SiS_CHSOverScan) (*DisplayType) = 99;
+	}
+	if(SiS_Pr->SiS_TVMode & TVSetPALM) {
+	   (*DisplayType) = 18;  /* PALM uses NTSC data */
+	   if(SiS_Pr->SiS_TVMode & TVSetCHOverScan) (*DisplayType)++;
+	} else if(SiS_Pr->SiS_TVMode & TVSetPALN) {
+	   (*DisplayType) = 20;  /* PALN uses PAL data  */
+	   if(SiS_Pr->SiS_TVMode & TVSetCHOverScan) (*DisplayType)++;
+	}
+     }
+  } else {
+     switch(SiS_Pr->SiS_LCDResInfo) {
+     case Panel_640x480:   (*DisplayType) = 50; break;
+     case Panel_640x480_2: (*DisplayType) = 52; break;
+     case Panel_640x480_3: (*DisplayType) = 54; break;
+     case Panel_800x600:   (*DisplayType) =  0; break;
+     case Panel_1024x600:  (*DisplayType) = 23; break;
+     case Panel_1024x768:  (*DisplayType) =  4; break;
+     case Panel_1152x768:  (*DisplayType) = 27; break;
+     case Panel_1280x768:  (*DisplayType) = 40; break;
+     case Panel_1280x1024: (*DisplayType) =  8; break;
+     case Panel_1400x1050: (*DisplayType) = 14; break;
+     case Panel_1600x1200: (*DisplayType) = 36; break;
+     default: return FALSE;
+     }
+
+     if(modeflag & HalfDCLK) (*DisplayType)++;
+
+     switch(SiS_Pr->SiS_LCDResInfo) {
+     case Panel_640x480:
+     case Panel_640x480_2:
+     case Panel_640x480_3:
+        break;
+     default:
+        if(SiS_Pr->SiS_LCDInfo & DontExpandLCD) (*DisplayType) += 2;
      }
+
      if(SiS_Pr->SiS_LCDInfo & LCDPass11) {
-        tempbx = 12;
-	if(modeflag & HalfDCLK) tempbx++;
+        (*DisplayType) = 12;
+	if(modeflag & HalfDCLK) (*DisplayType)++;
      }
   }
 
 #if 0
   if(SiS_Pr->SiS_IF_DEF_FSTN) {
      if(SiS_Pr->SiS_LCDResInfo == SiS_Pr->SiS_Panel320x480){
-        tempbx = 22;
+        (*DisplayType) = 22;
      }
   }
 #endif
 
-  *ResIndex = CRT2CRTC & 0x3F;
-  *DisplayType = tempbx;
   return TRUE;
 }
 
@@ -2685,8 +2804,7 @@ SiS_GetCRT2Ptr(SiS_Private *SiS_Pr,USHORT ModeNo,USHORT ModeIdIndex,
 	       USHORT RefreshRateTableIndex,USHORT *CRT2Index,USHORT *ResIndex,
 	       PSIS_HW_INFO HwInfo)
 {
-  USHORT tempbx=0,tempal=0;
-  USHORT Flag,resinfo=0;
+  USHORT tempbx=0,tempal=0,resinfo=0;
 
   if(ModeNo <= 0x13) {
      tempal = SiS_Pr->SiS_SModeIDTable[ModeIdIndex].St_CRT2CRTC;
@@ -2699,55 +2817,35 @@ SiS_GetCRT2Ptr(SiS_Private *SiS_Pr,USHORT ModeNo,USHORT ModeIdIndex,
 
      if(SiS_Pr->SiS_VBInfo & SetCRT2ToLCD) {                            /* LCD */
 
-	if(SiS_Pr->SiS_LCDResInfo == SiS_Pr->SiS_Panel1280x960) {
-	   tempbx = 15;
-  	} else if(SiS_Pr->SiS_LCDResInfo == SiS_Pr->SiS_Panel1400x1050) {
-	   tempbx = 20;
-	   if(SiS_Pr->SiS_LCDInfo & DontExpandLCD)         tempbx = 21;
-	   else if(!(SiS_Pr->SiS_SetFlag & LCDVESATiming)) tempbx = 22;
- 	} else if(SiS_Pr->SiS_LCDResInfo == SiS_Pr->SiS_Panel1600x1200) {
-	   tempbx = 23;
-	   if(SiS_Pr->SiS_LCDInfo & DontExpandLCD)         tempbx = 24;
-	   else if(!(SiS_Pr->SiS_SetFlag & LCDVESATiming)) tempbx = 25;
-#if 0
-	} else if(SiS_Pr->SiS_LCDResInfo == SiS_Pr->SiS_Panel1280x768) {
-	   tempbx = 26;
-	   if(SiS_Pr->SiS_LCDInfo & DontExpandLCD)         tempbx = 27;
-	   else if(!(SiS_Pr->SiS_SetFlag & LCDVESATiming)) tempbx = 28;
-#endif
- 	} else if(SiS_Pr->SiS_LCDInfo & DontExpandLCD) {
-	   if(SiS_Pr->SiS_VBType & VB_SIS301LV302LV) {
-	      if(SiS_Pr->SiS_LCDResInfo == SiS_Pr->SiS_Panel1024x768)       tempbx = 13;
-	      else if(SiS_Pr->SiS_LCDResInfo == SiS_Pr->SiS_Panel1280x1024) tempbx = 14;
-	      else {
-	         tempbx = 29;
-		 if(ModeNo >= 0x13) {
-	            /* see below */
-	            if(resinfo == SIS_RI_1280x960) tempal = 10;
-	         }
-              }
-	   } else {
-	      tempbx = 29;
-	      if(ModeNo >= 0x13) {
-	         /* 1280x768 and 1280x960 have same CRT2CRTC,
-	          * so we change it here if 1280x960 is chosen
-	          */
-	         if(resinfo == SIS_RI_1280x960) tempal = 10;
+        tempbx = SiS_Pr->SiS_LCDResInfo;
+	if(!(SiS_Pr->SiS_SetFlag & LCDVESATiming)) tempbx += 32;
+
+	if(SiS_Pr->SiS_LCDResInfo == Panel_1680x1050) {
+	   if     (resinfo == SIS_RI_1280x800)  tempal =  9;
+	   else if(resinfo == SIS_RI_1400x1050) tempal = 11;
+	}
+
+  	if(SiS_Pr->SiS_LCDInfo & DontExpandLCD) {  /* Pass 1:1 only (center-screen handled outside) */
+	   tempbx = 100;
+	   if(ModeNo >= 0x13) {
+	      tempal = SiS_Pr->SiS_RefIndex[RefreshRateTableIndex].Ext_CRT2CRTC_NS;
+	      if((SiS_Pr->SiS_RefIndex[RefreshRateTableIndex].XRes == 1280) &&
+	         (SiS_Pr->SiS_RefIndex[RefreshRateTableIndex].YRes ==  768)) {
+	         /* Special for Fujitsu 7911 (VL-17WDX8), others custom */
+	         if(SiS_Pr->SiS_LCDResInfo == Panel_1280x768)        tempal = 0x08;
+		 else if(SiS_Pr->SiS_LCDResInfo == Panel_1280x768_2) tempal = 0x0f;
+		 else if(SiS_Pr->SiS_LCDResInfo == Panel_1280x768_3) tempal = 0x10;
 	      }
-   	   }
-	} else {
-      	   tempbx = SiS_Pr->SiS_LCDResInfo - SiS_Pr->SiS_Panel1024x768;
-      	   if(!(SiS_Pr->SiS_SetFlag & LCDVESATiming)) {
-              tempbx += 10;
-       	   }
+	   }
 	}
 
 #ifdef SIS315H
 	if(SiS_Pr->SiS_CustomT == CUT_COMPAQ1280) {
-	   if(SiS_Pr->SiS_LCDResInfo == SiS_Pr->SiS_Panel1280x1024) {
-	      tempbx = 50;
-	      if(SiS_Pr->SiS_LCDInfo & DontExpandLCD)         tempbx = 51;
-	      else if(!(SiS_Pr->SiS_SetFlag & LCDVESATiming)) tempbx = 52;
+	   if(SiS_Pr->SiS_LCDResInfo == Panel_1280x1024) {
+	      if(!(SiS_Pr->SiS_LCDInfo & DontExpandLCD)) {
+	         tempbx = 200;
+	         if(!(SiS_Pr->SiS_SetFlag & LCDVESATiming)) tempbx++;
+	      }
 	   }
 	}
 #endif
@@ -2783,12 +2881,20 @@ SiS_GetCRT2Ptr(SiS_Private *SiS_Pr,USHORT ModeNo,USHORT ModeIdIndex,
 	      (resinfo == SIS_RI_720x576) ||
 	      (resinfo == SIS_RI_768x576)) {
 	      tempal = 6;
+	      if(SiS_Pr->SiS_TVMode & (TVSetPAL | TVSetPALN)) {
+	         if(resinfo == SIS_RI_720x480) tempal = 9;
+	      }
 	   }
 	   if(SiS_Pr->SiS_VBInfo & SetCRT2ToYPbPr525750) {
               if(SiS_Pr->SiS_TVMode & TVSetYPbPr525p) {
-	         if(resinfo == SIS_RI_1024x768) {
+	         if(resinfo == SIS_RI_1024x768) tempal = 8;
+	      }
+	      if(SiS_Pr->SiS_TVMode & TVSetYPbPr750p) {
+		 if((resinfo == SIS_RI_720x576) ||
+	            (resinfo == SIS_RI_768x576)) {
 	            tempal = 8;
 	         }
+		 if(resinfo == SIS_RI_1280x720) tempal = 9;
 	      }
 	   }
 	}
@@ -2799,70 +2905,54 @@ SiS_GetCRT2Ptr(SiS_Private *SiS_Pr,USHORT ModeNo,USHORT ModeIdIndex,
 
   } else {   /* LVDS, 301B-DH (if running on LCD) */
 
-     Flag = 1;
      tempbx = 0;
-     if(SiS_Pr->SiS_IF_DEF_CH70xx != 0) {
-        if(!(SiS_Pr->SiS_VBInfo & SetCRT2ToLCD)) {
-           Flag = 0;
-           tempbx = 10;
-	   if(SiS_Pr->SiS_TVMode & TVSetCHOverScan) tempbx += 1;
-           if(SiS_Pr->SiS_TVMode & TVSetPAL) {
-	      tempbx += 2;
-	      if(SiS_Pr->SiS_ModeType > ModeVGA) {
-		 if(SiS_Pr->SiS_CHSOverScan) tempbx = 99;
-	      }
-	      if(SiS_Pr->SiS_TVMode & TVSetPALM) {
-		 tempbx = 90;
-		 if(SiS_Pr->SiS_TVMode & TVSetCHOverScan) tempbx += 1;
-	      } else if(SiS_Pr->SiS_TVMode & TVSetPALN) {
-		 tempbx = 92;
-		 if(SiS_Pr->SiS_TVMode & TVSetCHOverScan) tempbx += 1;
-	      }
-           }
+     if((SiS_Pr->SiS_IF_DEF_CH70xx) && (SiS_Pr->SiS_VBInfo & SetCRT2ToTV)) {
+        tempbx = 10;
+	if(SiS_Pr->SiS_TVMode & TVSetCHOverScan) tempbx += 1;
+        if(SiS_Pr->SiS_TVMode & TVSetPAL) {
+	   tempbx += 2;
+	   if(SiS_Pr->SiS_ModeType > ModeVGA) {
+	      if(SiS_Pr->SiS_CHSOverScan) tempbx = 99;
+	   }
+	   if(SiS_Pr->SiS_TVMode & TVSetPALM) {
+	      tempbx = 90;
+	      if(SiS_Pr->SiS_TVMode & TVSetCHOverScan) tempbx += 1;
+	   } else if(SiS_Pr->SiS_TVMode & TVSetPALN) {
+	      tempbx = 92;
+	      if(SiS_Pr->SiS_TVMode & TVSetCHOverScan) tempbx += 1;
+	   }
         }
-     }
-
-     if(Flag) {
-
-	if(SiS_Pr->SiS_LCDResInfo <= SiS_Pr->SiS_Panel1280x1024) {
-	   tempbx = SiS_Pr->SiS_LCDResInfo - SiS_Pr->SiS_PanelMinLVDS;
-   	   if(SiS_Pr->SiS_LCDInfo & DontExpandLCD)  tempbx += 3;
+     } else {
+        switch(SiS_Pr->SiS_LCDResInfo) {
+	case Panel_640x480:   tempbx = 6;  break;
+	case Panel_640x480_2: tempbx = 30; break;
+	case Panel_640x480_3: tempbx = 30; break;
+	case Panel_800x600:   tempbx = 0;  break;
+	case Panel_1024x600:  tempbx = 15; break;
+	case Panel_1024x768:  tempbx = 2;  break;
+	case Panel_1152x768:  tempbx = 17; break;
+	case Panel_1280x768:  tempbx = 18; break;
+	case Panel_1280x1024: tempbx = 4;  break;
+	case Panel_1400x1050: tempbx = 8;  break;
+	case Panel_1600x1200: tempbx = 21; break;
+	case Panel_Barco1366: tempbx = 80; break;
+	}
 
-	   if(SiS_Pr->SiS_CustomT == CUT_BARCO1024) {
-	      tempbx = 82;
-	      if(SiS_Pr->SiS_LCDInfo & DontExpandLCD)  tempbx++;
-	   }
-	} else if(SiS_Pr->SiS_LCDResInfo == SiS_Pr->SiS_Panel1280x768) {
-	   tempbx = 18;
-	   if(SiS_Pr->SiS_LCDInfo & DontExpandLCD)  tempbx++;
-	} else if(SiS_Pr->SiS_LCDResInfo == SiS_Pr->SiS_Panel640x480) {
-	   tempbx = 6;
-	} else if(SiS_Pr->SiS_LCDResInfo == SiS_Pr->SiS_Panel640x480_2) {
-	   tempbx = 30;
-	} else if(SiS_Pr->SiS_LCDResInfo == SiS_Pr->SiS_Panel640x480_3) {
-	   tempbx = 30;
-	} else if(SiS_Pr->SiS_LCDResInfo == SiS_Pr->SiS_Panel1024x600) {
-	   tempbx = 15;
-  	   if(SiS_Pr->SiS_LCDInfo & DontExpandLCD)  tempbx += 2;
-	} else if(SiS_Pr->SiS_LCDResInfo == SiS_Pr->SiS_Panel1152x768) {
-	   tempbx = 16;
-	   if(SiS_Pr->SiS_LCDInfo & DontExpandLCD)  tempbx += 2;
-	} else if(SiS_Pr->SiS_LCDResInfo == SiS_Pr->SiS_Panel1400x1050) {
-	   tempbx = 8;
-	   if(SiS_Pr->SiS_LCDInfo & DontExpandLCD)  tempbx++;
-	} else if(SiS_Pr->SiS_LCDResInfo == SiS_Pr->SiS_Panel1600x1200) {
-	   tempbx = 21;
-	   if(SiS_Pr->SiS_LCDInfo & DontExpandLCD)  tempbx++;
-	} else if(SiS_Pr->SiS_LCDResInfo == SiS_Pr->SiS_PanelBarco1366) {
-	   tempbx = 80;
-   	   if(SiS_Pr->SiS_LCDInfo & DontExpandLCD)  tempbx++;
+	switch(SiS_Pr->SiS_LCDResInfo) {
+	case Panel_640x480:
+	case Panel_640x480_2:
+	case Panel_640x480_3:
+	   break;
+	default:
+	   if(SiS_Pr->SiS_LCDInfo & DontExpandLCD) tempbx++;
 	}
 
-	if(SiS_Pr->SiS_LCDInfo & LCDPass11) {
-	   tempbx = 7;
-        }
+	if(SiS_Pr->SiS_LCDInfo & LCDPass11) tempbx = 7;
 
-	if(SiS_Pr->SiS_CustomT == CUT_PANEL848) {
+	if(SiS_Pr->SiS_CustomT == CUT_BARCO1024) {
+	   tempbx = 82;
+	   if(SiS_Pr->SiS_LCDInfo & DontExpandLCD)  tempbx++;
+	} else if(SiS_Pr->SiS_CustomT == CUT_PANEL848) {
 	   tempbx = 84;
 	   if(SiS_Pr->SiS_LCDInfo & DontExpandLCD)  tempbx++;
 	}
@@ -2870,45 +2960,17 @@ SiS_GetCRT2Ptr(SiS_Private *SiS_Pr,USHORT ModeNo,USHORT ModeIdIndex,
      }
 
      if(SiS_Pr->SiS_SetFlag & SetDOSMode) {
-        if(SiS_Pr->SiS_LCDResInfo != SiS_Pr->SiS_Panel640x480) tempal = 7;
+        if(SiS_Pr->SiS_LCDResInfo != Panel_640x480) tempal = 7;
   	if(HwInfo->jChipType < SIS_315H) {
 	   if(SiS_GetReg(SiS_Pr->SiS_P3c4,0x13) & 0x80) tempal++;
 	}
      }
 
-     *CRT2Index = tempbx;
-     *ResIndex = tempal & 0x1F;
+     (*CRT2Index) = tempbx;
+     (*ResIndex) = tempal & 0x1F;
   }
 }
 
-#ifdef SIS315H
-static void
-SiS_GetCRT2PtrA(SiS_Private *SiS_Pr,USHORT ModeNo,USHORT ModeIdIndex,
-		USHORT RefreshRateTableIndex,USHORT *CRT2Index,
-		USHORT *ResIndex)
-{
-  USHORT tempbx,tempal;
-
-  tempbx = SiS_Pr->SiS_LCDResInfo;
-
-  if(SiS_Pr->SiS_LCDResInfo == SiS_Pr->SiS_Panel1600x1200)      tempbx = 4;
-  else if(SiS_Pr->SiS_LCDResInfo == SiS_Pr->SiS_Panel1400x1050) tempbx = 3;
-  else tempbx -= SiS_Pr->SiS_Panel1024x768;
-
-  if(SiS_Pr->SiS_LCDInfo & DontExpandLCD)  tempbx += 5;
-
-  if(ModeNo <= 0x13)
-     tempal = SiS_Pr->SiS_SModeIDTable[ModeIdIndex].St_CRT2CRTC;
-  else
-     tempal = SiS_Pr->SiS_RefIndex[RefreshRateTableIndex].Ext_CRT2CRTC;
-
-  /* No customs required yet (Clevo, Compaq, etc) */
-
-  *CRT2Index = tempbx;
-  *ResIndex = tempal & 0x1F;
-}
-#endif
-
 static void
 SiS_GetRAMDAC2DATA(SiS_Private *SiS_Pr,USHORT ModeNo,USHORT ModeIdIndex,
                    USHORT RefreshRateTableIndex,PSIS_HW_INFO HwInfo)
@@ -2969,8 +3031,7 @@ SiS_GetRAMDAC2DATA(SiS_Private *SiS_Pr,USHORT ModeNo,USHORT ModeIdIndex,
 
 static void
 SiS_GetCRT2DataLVDS(SiS_Private *SiS_Pr,USHORT ModeNo,USHORT ModeIdIndex,
-                    USHORT RefreshRateTableIndex,
-		    PSIS_HW_INFO HwInfo)
+                    USHORT RefreshRateTableIndex, PSIS_HW_INFO HwInfo)
 {
    USHORT CRT2Index, ResIndex;
    const SiS_LVDSDataStruct *LVDSData = NULL;
@@ -2988,23 +3049,55 @@ SiS_GetCRT2DataLVDS(SiS_Private *SiS_Pr,USHORT ModeNo,USHORT ModeIdIndex,
       SiS_Pr->SiS_RY4COE = 0;
    }
 
-   if((SiS_Pr->SiS_VBType & VB_SIS301BLV302BLV) && (SiS_Pr->SiS_VBInfo & SetCRT2ToLCDA)) {
+   if((SiS_Pr->SiS_VBType & VB_SISVB) && (SiS_Pr->SiS_VBInfo & SetCRT2ToLCDA)) {
 
 #ifdef SIS315H
-      SiS_GetCRT2PtrA(SiS_Pr,ModeNo,ModeIdIndex,RefreshRateTableIndex,
-                      &CRT2Index,&ResIndex);
-
-      switch (CRT2Index) {
-      	case  0:  LVDSData = SiS_Pr->SiS_LCDA1024x768Data_1;    break;
-      	case  1:  LVDSData = SiS_Pr->SiS_LCDA1280x1024Data_1;   break;
-	case  3:  LVDSData = SiS_Pr->SiS_LCDA1400x1050Data_1;   break;
-	case  4:  LVDSData = SiS_Pr->SiS_LCDA1600x1200Data_1;   break;
-      	case  5:  LVDSData = SiS_Pr->SiS_LCDA1024x768Data_2;    break;
-      	case  6:  LVDSData = SiS_Pr->SiS_LCDA1280x1024Data_2;   break;
-	case  8:  LVDSData = SiS_Pr->SiS_LCDA1400x1050Data_2;   break;
-	case  9:  LVDSData = SiS_Pr->SiS_LCDA1600x1200Data_2;   break;
-	default:  LVDSData = SiS_Pr->SiS_LCDA1024x768Data_1;    break;
+      if(SiS_Pr->SiS_LCDInfo & DontExpandLCD) {
+         if(SiS_Pr->SiS_LCDInfo & LCDPass11) {
+	    if(SiS_Pr->UseCustomMode) {
+	       SiS_Pr->SiS_VGAHT = SiS_Pr->SiS_HT = SiS_Pr->CHTotal;
+	       SiS_Pr->SiS_VGAVT = SiS_Pr->SiS_VT = SiS_Pr->CVTotal;
+	    } else {
+	       if(ModeNo < 0x13) {
+	          ResIndex = SiS_Pr->SiS_SModeIDTable[ModeIdIndex].St_CRT2CRTC;
+	       } else {
+	          ResIndex = SiS_Pr->SiS_RefIndex[RefreshRateTableIndex].Ext_CRT2CRTC_NS;
+		  /* Special for our 3 types, others custom (works with default) */
+		  if((SiS_Pr->SiS_RefIndex[RefreshRateTableIndex].XRes == 1280) &&
+	             (SiS_Pr->SiS_RefIndex[RefreshRateTableIndex].YRes ==  768)) {
+	             if(SiS_Pr->SiS_LCDResInfo == Panel_1280x768)        ResIndex = 0x08;
+		     else if(SiS_Pr->SiS_LCDResInfo == Panel_1280x768_2) ResIndex = 0x0f;
+		     else if(SiS_Pr->SiS_LCDResInfo == Panel_1280x768_3) ResIndex = 0x10;
+	          }
+		  /* Special for 1280x720 TMDS <> LVDS */
+		  if((SiS_Pr->SiS_RefIndex[RefreshRateTableIndex].XRes == 1280) &&
+	             (SiS_Pr->SiS_RefIndex[RefreshRateTableIndex].YRes ==  720)) {
+		     if(SiS_Pr->SiS_LCDResInfo == Panel_1280x720) {
+		        if(SiS_Pr->PanelHT == 1344) ResIndex = 0x12;
+		     }
+	          }
+	       }
+	       SiS_Pr->SiS_VGAHT = SiS_Pr->SiS_NoScaleData[ResIndex].VGAHT;
+               SiS_Pr->SiS_VGAVT = SiS_Pr->SiS_NoScaleData[ResIndex].VGAVT;
+               SiS_Pr->SiS_HT    = SiS_Pr->SiS_NoScaleData[ResIndex].LCDHT;
+               SiS_Pr->SiS_VT    = SiS_Pr->SiS_NoScaleData[ResIndex].LCDVT;
+	    }
+	 } else {
+     	    SiS_Pr->SiS_VGAHT = SiS_Pr->SiS_HT = SiS_Pr->PanelHT;
+            SiS_Pr->SiS_VGAVT = SiS_Pr->SiS_VT = SiS_Pr->PanelVT;
+	 }
+      } else {
+	 /* This handles custom modes and custom panels */
+	 SiS_Pr->SiS_HDE = SiS_Pr->PanelXRes;
+         SiS_Pr->SiS_VDE = SiS_Pr->PanelYRes;
+         SiS_Pr->SiS_HT  = SiS_Pr->PanelHT;
+         SiS_Pr->SiS_VT  = SiS_Pr->PanelVT;
+	 SiS_Pr->SiS_VGAHT = SiS_Pr->PanelHT - (SiS_Pr->PanelXRes - SiS_Pr->SiS_VGAHDE);
+	 SiS_Pr->SiS_VGAVT = SiS_Pr->PanelVT - (SiS_Pr->PanelYRes - SiS_Pr->SiS_VGAVDE);
       }
+
+      SiS_CalcLCDACRT1Timing(SiS_Pr,ModeNo,ModeIdIndex);
+
 #endif
 
    } else {
@@ -3015,7 +3108,7 @@ SiS_GetCRT2DataLVDS(SiS_Private *SiS_Pr,USHORT ModeNo,USHORT ModeIdIndex,
       }
 
       SiS_GetCRT2Ptr(SiS_Pr, ModeNo, ModeIdIndex, RefreshRateTableIndex,
-                     &CRT2Index, &ResIndex, HwInfo);
+                     		&CRT2Index, &ResIndex, HwInfo);
 
       /* 301BDH needs LVDS Data */
       if((SiS_Pr->SiS_VBType & VB_NoLCD) && (SiS_Pr->SiS_VBInfo & SetCRT2ToLCD)) {
@@ -3023,72 +3116,59 @@ SiS_GetCRT2DataLVDS(SiS_Private *SiS_Pr,USHORT ModeNo,USHORT ModeIdIndex,
       }
 
       switch (CRT2Index) {
-      	case  0:  LVDSData = SiS_Pr->SiS_LVDS800x600Data_1;    break;
-      	case  1:  LVDSData = SiS_Pr->SiS_LVDS1024x768Data_1;   break;
-      	case  2:  LVDSData = SiS_Pr->SiS_LVDS1280x1024Data_1;  break;
-      	case  3:  LVDSData = SiS_Pr->SiS_LVDS800x600Data_2;    break;
-      	case  4:  LVDSData = SiS_Pr->SiS_LVDS1024x768Data_2;   break;
-      	case  5:  LVDSData = SiS_Pr->SiS_LVDS1280x1024Data_2;  break;
-	case  6:  LVDSData = SiS_Pr->SiS_LVDS640x480Data_1;    break;
-        case  7:  LVDSData = SiS_Pr->SiS_LVDSXXXxXXXData_1;    break;
-	case  8:  LVDSData = SiS_Pr->SiS_LVDS1400x1050Data_1;  break;
-	case  9:  LVDSData = SiS_Pr->SiS_LVDS1400x1050Data_2;  break;
-      	case 10:  LVDSData = SiS_Pr->SiS_CHTVUNTSCData;        break;
-      	case 11:  LVDSData = SiS_Pr->SiS_CHTVONTSCData;        break;
-      	case 12:  LVDSData = SiS_Pr->SiS_CHTVUPALData;         break;
-      	case 13:  LVDSData = SiS_Pr->SiS_CHTVOPALData;         break;
-      	case 14:  LVDSData = SiS_Pr->SiS_LVDS320x480Data_1;    break;
-	case 15:  LVDSData = SiS_Pr->SiS_LVDS1024x600Data_1;   break;
-	case 16:  LVDSData = SiS_Pr->SiS_LVDS1152x768Data_1;   break;
-	case 17:  LVDSData = SiS_Pr->SiS_LVDS1024x600Data_2;   break;
-	case 18:  LVDSData = SiS_Pr->SiS_LVDS1152x768Data_2;   break;
-	case 19:  LVDSData = SiS_Pr->SiS_LVDS1280x768Data_1;   break;
-	case 20:  LVDSData = SiS_Pr->SiS_LVDS1280x768Data_2;   break;
-	case 21:  LVDSData = SiS_Pr->SiS_LVDS1600x1200Data_1;  break;
-	case 22:  LVDSData = SiS_Pr->SiS_LVDS1600x1200Data_2;  break;
-	case 30:  LVDSData = SiS_Pr->SiS_LVDS640x480Data_2;    break;
-	case 80:  LVDSData = SiS_Pr->SiS_LVDSBARCO1366Data_1;  break;
-	case 81:  LVDSData = SiS_Pr->SiS_LVDSBARCO1366Data_2;  break;
-	case 82:  LVDSData = SiS_Pr->SiS_LVDSBARCO1024Data_1;  break;
-	case 83:  LVDSData = SiS_Pr->SiS_LVDSBARCO1024Data_2;  break;
-	case 84:  LVDSData = SiS_Pr->SiS_LVDS848x480Data_1;    break;
-	case 85:  LVDSData = SiS_Pr->SiS_LVDS848x480Data_2;    break;
-	case 90:  LVDSData = SiS_Pr->SiS_CHTVUPALMData;        break;
-      	case 91:  LVDSData = SiS_Pr->SiS_CHTVOPALMData;        break;
-      	case 92:  LVDSData = SiS_Pr->SiS_CHTVUPALNData;        break;
-      	case 93:  LVDSData = SiS_Pr->SiS_CHTVOPALNData;        break;
-	case 99:  LVDSData = SiS_Pr->SiS_CHTVSOPALData;	       break;  /* Super Overscan */
-	default:  LVDSData = SiS_Pr->SiS_LVDS1024x768Data_1;   break;
-      }
-   }
-
-   SiS_Pr->SiS_VGAHT = (LVDSData+ResIndex)->VGAHT;
-   SiS_Pr->SiS_VGAVT = (LVDSData+ResIndex)->VGAVT;
-   SiS_Pr->SiS_HT    = (LVDSData+ResIndex)->LCDHT;
-   SiS_Pr->SiS_VT    = (LVDSData+ResIndex)->LCDVT;
-
-   if(SiS_Pr->SiS_VBType & VB_SISVB) {
-
-      if(!(SiS_Pr->SiS_LCDInfo & DontExpandLCD)) {
-         SiS_Pr->SiS_HDE = SiS_Pr->PanelXRes;
-         SiS_Pr->SiS_VDE = SiS_Pr->PanelYRes;
+      	 case  0: LVDSData = SiS_Pr->SiS_LVDS800x600Data_1;    break;
+	 case  1: LVDSData = SiS_Pr->SiS_LVDS800x600Data_2;    break;
+      	 case  2: LVDSData = SiS_Pr->SiS_LVDS1024x768Data_1;   break;
+	 case  3: LVDSData = SiS_Pr->SiS_LVDS1024x768Data_2;   break;
+      	 case  4: LVDSData = SiS_Pr->SiS_LVDS1280x1024Data_1;  break;
+      	 case  5: LVDSData = SiS_Pr->SiS_LVDS1280x1024Data_2;  break;
+	 case  6: LVDSData = SiS_Pr->SiS_LVDS640x480Data_1;    break;
+         case  7: LVDSData = SiS_Pr->SiS_LVDSXXXxXXXData_1;    break;
+	 case  8: LVDSData = SiS_Pr->SiS_LVDS1400x1050Data_1;  break;
+	 case  9: LVDSData = SiS_Pr->SiS_LVDS1400x1050Data_2;  break;
+      	 case 10: LVDSData = SiS_Pr->SiS_CHTVUNTSCData;        break;
+      	 case 11: LVDSData = SiS_Pr->SiS_CHTVONTSCData;        break;
+      	 case 12: LVDSData = SiS_Pr->SiS_CHTVUPALData;         break;
+      	 case 13: LVDSData = SiS_Pr->SiS_CHTVOPALData;         break;
+      	 case 14: LVDSData = SiS_Pr->SiS_LVDS320x480Data_1;    break;
+	 case 15: LVDSData = SiS_Pr->SiS_LVDS1024x600Data_1;   break;
+	 case 16: LVDSData = SiS_Pr->SiS_LVDS1024x600Data_2;   break;
+	 case 17: LVDSData = SiS_Pr->SiS_LVDS1152x768Data_1;   break;
+	 case 18: LVDSData = SiS_Pr->SiS_LVDS1152x768Data_2;   break;
+	 case 19: LVDSData = SiS_Pr->SiS_LVDS1280x768Data_1;   break;
+	 case 20: LVDSData = SiS_Pr->SiS_LVDS1280x768Data_2;   break;
+	 case 21: LVDSData = SiS_Pr->SiS_LVDS1600x1200Data_1;  break;
+	 case 22: LVDSData = SiS_Pr->SiS_LVDS1600x1200Data_2;  break;
+	 case 30: LVDSData = SiS_Pr->SiS_LVDS640x480Data_2;    break;
+	 case 80: LVDSData = SiS_Pr->SiS_LVDSBARCO1366Data_1;  break;
+	 case 81: LVDSData = SiS_Pr->SiS_LVDSBARCO1366Data_2;  break;
+	 case 82: LVDSData = SiS_Pr->SiS_LVDSBARCO1024Data_1;  break;
+	 case 83: LVDSData = SiS_Pr->SiS_LVDSBARCO1024Data_2;  break;
+	 case 84: LVDSData = SiS_Pr->SiS_LVDS848x480Data_1;    break;
+	 case 85: LVDSData = SiS_Pr->SiS_LVDS848x480Data_2;    break;
+	 case 90: LVDSData = SiS_Pr->SiS_CHTVUPALMData;        break;
+      	 case 91: LVDSData = SiS_Pr->SiS_CHTVOPALMData;        break;
+      	 case 92: LVDSData = SiS_Pr->SiS_CHTVUPALNData;        break;
+      	 case 93: LVDSData = SiS_Pr->SiS_CHTVOPALNData;        break;
+	 case 99: LVDSData = SiS_Pr->SiS_CHTVSOPALData;	       break;  /* Super Overscan */
+	 default: LVDSData = SiS_Pr->SiS_LVDS1024x768Data_1;   break;
       }
 
-   } else {
+      SiS_Pr->SiS_VGAHT = (LVDSData+ResIndex)->VGAHT;
+      SiS_Pr->SiS_VGAVT = (LVDSData+ResIndex)->VGAVT;
+      SiS_Pr->SiS_HT    = (LVDSData+ResIndex)->LCDHT;
+      SiS_Pr->SiS_VT    = (LVDSData+ResIndex)->LCDVT;
 
-      if(SiS_Pr->SiS_IF_DEF_TRUMPION == 0) {
+      if(!(SiS_Pr->SiS_VBType & VB_SISVB)) {
          if((SiS_Pr->SiS_VBInfo & SetCRT2ToLCD) && (!(SiS_Pr->SiS_LCDInfo & LCDPass11))) {
-            if(SiS_Pr->SiS_LCDResInfo != SiS_Pr->SiS_Panel640x480) {
-               if((!(SiS_Pr->SiS_LCDInfo & DontExpandLCD)) || (SiS_Pr->SiS_SetFlag & SetDOSMode)) {
-	          SiS_Pr->SiS_HDE = SiS_Pr->PanelXRes;
-                  SiS_Pr->SiS_VDE = SiS_Pr->PanelYRes;
-
-	 	  if(SiS_Pr->SiS_CustomT == CUT_BARCO1366) {
-		     if(ResIndex < 0x08) {
-		        SiS_Pr->SiS_HDE = 1280;
-                        SiS_Pr->SiS_VDE = 1024;
-		     }
-		  }
+            if((!(SiS_Pr->SiS_LCDInfo & DontExpandLCD)) || (SiS_Pr->SiS_SetFlag & SetDOSMode)) {
+	       SiS_Pr->SiS_HDE = SiS_Pr->PanelXRes;
+               SiS_Pr->SiS_VDE = SiS_Pr->PanelYRes;
+	       if(SiS_Pr->SiS_CustomT == CUT_BARCO1366) {
+		  if(ResIndex < 0x08) {
+		     SiS_Pr->SiS_HDE = 1280;
+                     SiS_Pr->SiS_VDE = 1024;
+                  }
                }
             }
          }
@@ -3101,25 +3181,40 @@ SiS_GetCRT2Data301(SiS_Private *SiS_Pr,USHORT ModeNo,USHORT ModeIdIndex,
                    USHORT RefreshRateTableIndex,
 		   PSIS_HW_INFO HwInfo)
 {
-  USHORT tempax,tempbx,modeflag;
-  USHORT resinfo;
-  USHORT CRT2Index,ResIndex;
+  UCHAR  *ROMAddr = NULL;
+  USHORT tempax,tempbx,modeflag,romptr=0;
+  USHORT resinfo,CRT2Index,ResIndex;
   const SiS_LCDDataStruct *LCDPtr = NULL;
   const SiS_TVDataStruct  *TVPtr  = NULL;
+#ifdef SIS315H
+  SHORT  resinfo661;
+#endif
 
   if(ModeNo <= 0x13) {
      modeflag = SiS_Pr->SiS_SModeIDTable[ModeIdIndex].St_ModeFlag;
      resinfo = SiS_Pr->SiS_SModeIDTable[ModeIdIndex].St_ResInfo;
+  } else if(SiS_Pr->UseCustomMode) {
+     modeflag = SiS_Pr->CModeFlag;
+     resinfo = 0;
   } else {
-     if(SiS_Pr->UseCustomMode) {
-        modeflag = SiS_Pr->CModeFlag;
-	resinfo = 0;
-     } else {
-    	modeflag = SiS_Pr->SiS_EModeIDTable[ModeIdIndex].Ext_ModeFlag;
-    	resinfo = SiS_Pr->SiS_EModeIDTable[ModeIdIndex].Ext_RESINFO;
-     }
-  }
-  
+     modeflag = SiS_Pr->SiS_EModeIDTable[ModeIdIndex].Ext_ModeFlag;
+     resinfo = SiS_Pr->SiS_EModeIDTable[ModeIdIndex].Ext_RESINFO;
+#ifdef SIS315H
+     resinfo661 = SiS_Pr->SiS_EModeIDTable[ModeIdIndex].ROMMODEIDX661;
+     if( (SiS_Pr->SiS_VBInfo & SetCRT2ToLCD)   &&
+         (SiS_Pr->SiS_SetFlag & LCDVESATiming) &&
+         (resinfo661 >= 0)                     &&
+	 (SiS_Pr->SiS_NeedRomModeData) ) {
+        if((ROMAddr = GetLCDStructPtr661(SiS_Pr, HwInfo))) {
+	   if((romptr = (SISGETROMW(21)))) {
+              romptr += (resinfo661 * 10);
+	      ROMAddr = HwInfo->pjVirtualRomBase;
+	   }
+	}
+     }
+#endif
+  }
+  
   SiS_Pr->SiS_NewFlickerMode = 0;
   SiS_Pr->SiS_RVBHRS = 50;
   SiS_Pr->SiS_RY1COE = 0;
@@ -3145,6 +3240,7 @@ SiS_GetCRT2Data301(SiS_Private *SiS_Pr,USHORT ModeNo,USHORT ModeIdIndex,
      } else {
 
         SiS_GetRAMDAC2DATA(SiS_Pr, ModeNo, ModeIdIndex, RefreshRateTableIndex, HwInfo);
+
      }
 
   } else if(SiS_Pr->SiS_VBInfo & SetCRT2ToTV) {
@@ -3153,20 +3249,20 @@ SiS_GetCRT2Data301(SiS_Private *SiS_Pr,USHORT ModeNo,USHORT ModeIdIndex,
                     &CRT2Index,&ResIndex,HwInfo);
 
      switch(CRT2Index) {
-       case  2:  TVPtr = SiS_Pr->SiS_ExtHiTVData;   break;
-       case  3:  TVPtr = SiS_Pr->SiS_ExtPALData;    break;
-       case  4:  TVPtr = SiS_Pr->SiS_ExtNTSCData;   break;
-       case  5:  TVPtr = SiS_Pr->SiS_Ext525iData;   break;
-       case  6:  TVPtr = SiS_Pr->SiS_Ext525pData;   break;
-       case  7:  TVPtr = SiS_Pr->SiS_Ext750pData;   break;
-       case  8:  TVPtr = SiS_Pr->SiS_StPALData;     break;
-       case  9:  TVPtr = SiS_Pr->SiS_StNTSCData;    break;
-       case 10:  TVPtr = SiS_Pr->SiS_St525iData;    break;
-       case 11:  TVPtr = SiS_Pr->SiS_St525pData;    break;
-       case 12:  TVPtr = SiS_Pr->SiS_St750pData;    break;
-       case 13:  TVPtr = SiS_Pr->SiS_St1HiTVData;   break;
-       case 14:  TVPtr = SiS_Pr->SiS_St2HiTVData;   break;
-       default:  TVPtr = SiS_Pr->SiS_StPALData;     break;
+        case  2: TVPtr = SiS_Pr->SiS_ExtHiTVData;   break;
+        case  3: TVPtr = SiS_Pr->SiS_ExtPALData;    break;
+        case  4: TVPtr = SiS_Pr->SiS_ExtNTSCData;   break;
+        case  5: TVPtr = SiS_Pr->SiS_Ext525iData;   break;
+        case  6: TVPtr = SiS_Pr->SiS_Ext525pData;   break;
+        case  7: TVPtr = SiS_Pr->SiS_Ext750pData;   break;
+        case  8: TVPtr = SiS_Pr->SiS_StPALData;     break;
+        case  9: TVPtr = SiS_Pr->SiS_StNTSCData;    break;
+        case 10: TVPtr = SiS_Pr->SiS_St525iData;    break;
+        case 11: TVPtr = SiS_Pr->SiS_St525pData;    break;
+        case 12: TVPtr = SiS_Pr->SiS_St750pData;    break;
+        case 13: TVPtr = SiS_Pr->SiS_St1HiTVData;   break;
+        case 14: TVPtr = SiS_Pr->SiS_St2HiTVData;   break;
+        default: TVPtr = SiS_Pr->SiS_StPALData;     break;
      }
 
      SiS_Pr->SiS_RVBHCMAX  = (TVPtr+ResIndex)->RVBHCMAX;
@@ -3247,10 +3343,11 @@ SiS_GetCRT2Data301(SiS_Private *SiS_Pr,USHORT ModeNo,USHORT ModeIdIndex,
 
   } else if(SiS_Pr->SiS_VBInfo & SetCRT2ToLCD) {
 
+     SiS_Pr->SiS_RVBHCMAX  = 1;
+     SiS_Pr->SiS_RVBHCFACT = 1;
+
      if(SiS_Pr->UseCustomMode) {
 
-        SiS_Pr->SiS_RVBHCMAX  = 1;
-        SiS_Pr->SiS_RVBHCFACT = 1;
         SiS_Pr->SiS_VGAHT     = SiS_Pr->CHTotal;
         SiS_Pr->SiS_VGAVT     = SiS_Pr->CVTotal;
         SiS_Pr->SiS_HT        = SiS_Pr->CHTotal;
@@ -3260,58 +3357,85 @@ SiS_GetCRT2Data301(SiS_Private *SiS_Pr,USHORT ModeNo,USHORT ModeIdIndex,
 
      } else {
 
-        SiS_GetCRT2Ptr(SiS_Pr,ModeNo,ModeIdIndex,RefreshRateTableIndex,
-                      &CRT2Index,&ResIndex,HwInfo);
-
-        switch(CRT2Index) {
-         case  0: LCDPtr = SiS_Pr->SiS_ExtLCD1024x768Data;        break; /* VESA Timing */
-         case  1: LCDPtr = SiS_Pr->SiS_ExtLCD1280x1024Data;       break; /* VESA Timing */
-         case  5: LCDPtr = SiS_Pr->SiS_StLCD1024x768Data;         break; /* Obviously unused */
-         case  6: LCDPtr = SiS_Pr->SiS_StLCD1280x1024Data;        break; /* Obviously unused */
-         case 10: LCDPtr = SiS_Pr->SiS_St2LCD1024x768Data;        break; /* Non-VESA Timing */
-         case 11: LCDPtr = SiS_Pr->SiS_St2LCD1280x1024Data;       break; /* Non-VESA Timing */
-         case 13: LCDPtr = SiS_Pr->SiS_NoScaleData1024x768;       break; /* Non-expanding */
-         case 14: LCDPtr = SiS_Pr->SiS_NoScaleData1280x1024;      break; /* Non-expanding */
-         case 15: LCDPtr = SiS_Pr->SiS_LCD1280x960Data;           break; /* 1280x960 */
-         case 20: LCDPtr = SiS_Pr->SiS_ExtLCD1400x1050Data;       break; /* VESA Timing */
-         case 21: LCDPtr = SiS_Pr->SiS_NoScaleData1400x1050;      break; /* Non-expanding (let panel scale) */
-         case 22: LCDPtr = SiS_Pr->SiS_StLCD1400x1050Data;        break; /* Non-VESA Timing (let panel scale) */
-         case 23: LCDPtr = SiS_Pr->SiS_ExtLCD1600x1200Data;       break; /* VESA Timing */
-         case 24: LCDPtr = SiS_Pr->SiS_NoScaleData1600x1200;      break; /* Non-expanding */
-         case 25: LCDPtr = SiS_Pr->SiS_StLCD1600x1200Data;        break; /* Non-VESA Timing */
-         case 26: LCDPtr = SiS_Pr->SiS_ExtLCD1280x768Data;        break; /* VESA Timing */
-         case 27: LCDPtr = SiS_Pr->SiS_NoScaleData1280x768;       break; /* Non-expanding */
-         case 28: LCDPtr = SiS_Pr->SiS_StLCD1280x768Data;         break; /* Non-VESA Timing */
-         case 29: LCDPtr = SiS_Pr->SiS_NoScaleData;	          break; /* Generic no-scale data */
+        BOOLEAN gotit = FALSE;
+
+        if((SiS_Pr->SiS_LCDInfo & DontExpandLCD) && (!(SiS_Pr->SiS_LCDInfo & LCDPass11))) {
+
+           SiS_Pr->SiS_VGAHT     = SiS_Pr->PanelHT;
+           SiS_Pr->SiS_VGAVT     = SiS_Pr->PanelVT;
+           SiS_Pr->SiS_HT        = SiS_Pr->PanelHT;
+           SiS_Pr->SiS_VT        = SiS_Pr->PanelVT;
+	   gotit = TRUE;
+
+	} else if( (!(SiS_Pr->SiS_LCDInfo & DontExpandLCD)) && (romptr) && (ROMAddr) ) {
+
 #ifdef SIS315H
-	 case 50: LCDPtr = (SiS_LCDDataStruct *)SiS310_ExtCompaq1280x1024Data;	break;
-	 case 51: LCDPtr = SiS_Pr->SiS_NoScaleData1280x1024;			break;
-	 case 52: LCDPtr = SiS_Pr->SiS_St2LCD1280x1024Data;	  		break;
+	   SiS_Pr->SiS_RVBHCMAX  = ROMAddr[romptr];
+           SiS_Pr->SiS_RVBHCFACT = ROMAddr[romptr+1];
+           SiS_Pr->SiS_VGAHT     = ROMAddr[romptr+2] | ((ROMAddr[romptr+3] & 0x0f) << 8);
+           SiS_Pr->SiS_VGAVT     = ROMAddr[romptr+4] | ((ROMAddr[romptr+3] & 0xf0) << 4);
+           SiS_Pr->SiS_HT        = ROMAddr[romptr+5] | ((ROMAddr[romptr+6] & 0x0f) << 8);
+           SiS_Pr->SiS_VT        = ROMAddr[romptr+7] | ((ROMAddr[romptr+6] & 0xf0) << 4);
+	   if(SiS_Pr->SiS_VGAHT) gotit = TRUE;
 #endif
-         default: LCDPtr = SiS_Pr->SiS_ExtLCD1024x768Data;	  break;
-        }
 
-        SiS_Pr->SiS_RVBHCMAX  = (LCDPtr+ResIndex)->RVBHCMAX;
-        SiS_Pr->SiS_RVBHCFACT = (LCDPtr+ResIndex)->RVBHCFACT;
-        SiS_Pr->SiS_VGAHT     = (LCDPtr+ResIndex)->VGAHT;
-        SiS_Pr->SiS_VGAVT     = (LCDPtr+ResIndex)->VGAVT;
-        SiS_Pr->SiS_HT        = (LCDPtr+ResIndex)->LCDHT;
-        SiS_Pr->SiS_VT        = (LCDPtr+ResIndex)->LCDVT;
+	}
+
+	if(!gotit) {
+
+           SiS_GetCRT2Ptr(SiS_Pr,ModeNo,ModeIdIndex,RefreshRateTableIndex,
+                          &CRT2Index,&ResIndex,HwInfo);
+
+           switch(CRT2Index) {
+	      case Panel_1024x768      : LCDPtr = SiS_Pr->SiS_ExtLCD1024x768Data;   break;
+	      case Panel_1024x768  + 32: LCDPtr = SiS_Pr->SiS_St2LCD1024x768Data;   break;
+	      case Panel_1280x720      :
+	      case Panel_1280x720  + 32: LCDPtr = SiS_Pr->SiS_LCD1280x720Data;      break;
+	      case Panel_1280x768_2    : LCDPtr = SiS_Pr->SiS_ExtLCD1280x768_2Data; break;
+              case Panel_1280x768_2+ 32: LCDPtr = SiS_Pr->SiS_StLCD1280x768_2Data;  break;
+	      case Panel_1280x768_3    :
+	      case Panel_1280x768_3+ 32: LCDPtr = SiS_Pr->SiS_LCD1280x768_3Data;    break;
+	      case Panel_1280x800      :
+	      case Panel_1280x800  + 32: LCDPtr = SiS_Pr->SiS_LCD1280x800Data;      break;
+	      case Panel_1280x960      :
+	      case Panel_1280x960  + 32: LCDPtr = SiS_Pr->SiS_LCD1280x960Data;      break;
+              case Panel_1280x1024     : LCDPtr = SiS_Pr->SiS_ExtLCD1280x1024Data;  break;
+              case Panel_1280x1024 + 32: LCDPtr = SiS_Pr->SiS_St2LCD1280x1024Data;  break;
+              case Panel_1400x1050     : LCDPtr = SiS_Pr->SiS_ExtLCD1400x1050Data;  break;
+              case Panel_1400x1050 + 32: LCDPtr = SiS_Pr->SiS_StLCD1400x1050Data;   break;
+              case Panel_1600x1200     : LCDPtr = SiS_Pr->SiS_ExtLCD1600x1200Data;  break;
+              case Panel_1600x1200 + 32: LCDPtr = SiS_Pr->SiS_StLCD1600x1200Data;   break;
+	      case Panel_1680x1050     :
+	      case Panel_1680x1050 + 32: LCDPtr = SiS_Pr->SiS_LCD1680x1050Data;     break;
+	      case 100		       : LCDPtr = SiS_Pr->SiS_NoScaleData;	    break;
+#ifdef SIS315H
+	      case 200                 : LCDPtr = SiS310_ExtCompaq1280x1024Data;    break;
+	      case 201                 : LCDPtr = SiS_Pr->SiS_St2LCD1280x1024Data;  break;
+#endif
+              default                  : LCDPtr = SiS_Pr->SiS_ExtLCD1024x768Data;   break;
+           }
 
 #ifdef TWDEBUG
-        xf86DrvMsg(0, X_INFO,
-    	    "GetCRT2Data: Index %d ResIndex %d\n", CRT2Index, ResIndex);
+           xf86DrvMsg(0, X_INFO, "GetCRT2Data: Index %d ResIndex %d\n", CRT2Index, ResIndex);
 #endif
 
-	if(SiS_Pr->SiS_LCDResInfo == SiS_Pr->SiS_Panel1024x768) {
-           tempax = 1024;
+           SiS_Pr->SiS_RVBHCMAX  = (LCDPtr+ResIndex)->RVBHCMAX;
+           SiS_Pr->SiS_RVBHCFACT = (LCDPtr+ResIndex)->RVBHCFACT;
+           SiS_Pr->SiS_VGAHT     = (LCDPtr+ResIndex)->VGAHT;
+           SiS_Pr->SiS_VGAVT     = (LCDPtr+ResIndex)->VGAVT;
+           SiS_Pr->SiS_HT        = (LCDPtr+ResIndex)->LCDHT;
+           SiS_Pr->SiS_VT        = (LCDPtr+ResIndex)->LCDVT;
+
+        }
+
+	tempax = SiS_Pr->PanelXRes;
+        tempbx = SiS_Pr->PanelYRes;
+
+	if(SiS_Pr->SiS_LCDResInfo == Panel_1024x768) {
            if(SiS_Pr->SiS_SetFlag & LCDVESATiming) {
               if(HwInfo->jChipType < SIS_315H) {
                  if     (SiS_Pr->SiS_VGAVDE == 350) tempbx = 560;
                  else if(SiS_Pr->SiS_VGAVDE == 400) tempbx = 640;
-                 else                               tempbx = 768;
-              } else {
-                 tempbx = 768;
               }
            } else {
               if     (SiS_Pr->SiS_VGAVDE == 357) tempbx = 527;
@@ -3320,43 +3444,27 @@ SiS_GetCRT2Data301(SiS_Private *SiS_Pr,USHORT ModeNo,USHORT ModeIdIndex,
               else if(SiS_Pr->SiS_VGAVDE == 600) tempbx = 775;
               else if(SiS_Pr->SiS_VGAVDE == 350) tempbx = 560;
               else if(SiS_Pr->SiS_VGAVDE == 400) tempbx = 640;
-              else                               tempbx = 768;
            }
-	} else if(SiS_Pr->SiS_LCDResInfo == SiS_Pr->SiS_Panel1280x1024) {
-           tempax = 1280;
-           if     (SiS_Pr->SiS_VGAVDE == 360) tempbx = 768;
-           else if(SiS_Pr->SiS_VGAVDE == 375) tempbx = 800;
-           else if(SiS_Pr->SiS_VGAVDE == 405) tempbx = 864;
-           else                               tempbx = 1024;
-        } else if(SiS_Pr->SiS_LCDResInfo == SiS_Pr->SiS_Panel1280x960) {
-           tempax = 1280;
+	} else if(SiS_Pr->SiS_LCDResInfo == Panel_1280x960) {
            if     (SiS_Pr->SiS_VGAVDE == 350)  tempbx = 700;
            else if(SiS_Pr->SiS_VGAVDE == 400)  tempbx = 800;
            else if(SiS_Pr->SiS_VGAVDE == 1024) tempbx = 960;
-           else                                tempbx = 960;
-	} else if((SiS_Pr->SiS_LCDResInfo == SiS_Pr->SiS_Panel1400x1050) &&
-	          (HwInfo->jChipType >= SIS_661)) {
-	   tempax = 1400;
-	   tempbx = 1050;
-	   if(SiS_Pr->SiS_VGAVDE == 1024) {
-	      tempax = 1280;
-	      tempbx = 1024;
-	   }
-        } else if(SiS_Pr->SiS_LCDResInfo == SiS_Pr->SiS_Panel1600x1200) {
-           tempax = 1600;
-	   tempbx = 1200;
-	   if((HwInfo->jChipType < SIS_661) || (!(SiS_Pr->SiS_SetFlag & LCDVESATiming))) {
+	} else if(SiS_Pr->SiS_LCDResInfo == Panel_1280x1024) {
+           if     (SiS_Pr->SiS_VGAVDE == 360) tempbx = 768;
+           else if(SiS_Pr->SiS_VGAVDE == 375) tempbx = 800;
+           else if(SiS_Pr->SiS_VGAVDE == 405) tempbx = 864;
+        } else if(SiS_Pr->SiS_LCDResInfo == Panel_1600x1200) {
+	   if(!(SiS_Pr->SiS_SetFlag & LCDVESATiming)) {
               if     (SiS_Pr->SiS_VGAVDE == 350)  tempbx = 875;
               else if(SiS_Pr->SiS_VGAVDE == 400)  tempbx = 1000;
            }
-        } else {
-	   tempax = SiS_Pr->PanelXRes;
-           tempbx = SiS_Pr->PanelYRes;
-	}
+        }
+
         if(SiS_Pr->SiS_LCDInfo & DontExpandLCD) {
            tempax = SiS_Pr->SiS_VGAHDE;
            tempbx = SiS_Pr->SiS_VGAVDE;
         }
+
         SiS_Pr->SiS_HDE = tempax;
         SiS_Pr->SiS_VDE = tempbx;
      }
@@ -3370,31 +3478,15 @@ SiS_GetCRT2Data(SiS_Private *SiS_Pr, USHORT ModeNo, USHORT ModeIdIndex,
 
   if(SiS_Pr->SiS_VBType & VB_SISVB) {
 
-     if(SiS_Pr->SiS_VBType & VB_SIS301BLV302BLV) {
-
-        if(SiS_Pr->SiS_VBInfo & SetCRT2ToLCDA) {
-
-           SiS_GetCRT2DataLVDS(SiS_Pr, ModeNo, ModeIdIndex, RefreshRateTableIndex, HwInfo);
-
-        } else {
-
-	   if((SiS_Pr->SiS_VBType & VB_NoLCD) && (SiS_Pr->SiS_VBInfo & SetCRT2ToLCD)) {
-
-	      /* Need LVDS Data for LCD on 301B-DH */
-	      SiS_GetCRT2DataLVDS(SiS_Pr, ModeNo, ModeIdIndex, RefreshRateTableIndex, HwInfo);
-
-	   } else {
-
-	      SiS_GetCRT2Data301(SiS_Pr, ModeNo, ModeIdIndex, RefreshRateTableIndex, HwInfo);
-
-           }
-
-        }
-
+     if(SiS_Pr->SiS_VBInfo & SetCRT2ToLCDA) {
+        SiS_GetCRT2DataLVDS(SiS_Pr, ModeNo, ModeIdIndex, RefreshRateTableIndex, HwInfo);
      } else {
-
-     	SiS_GetCRT2Data301(SiS_Pr, ModeNo, ModeIdIndex, RefreshRateTableIndex, HwInfo);
-
+	if((SiS_Pr->SiS_VBType & VB_NoLCD) && (SiS_Pr->SiS_VBInfo & SetCRT2ToLCD)) {
+	   /* Need LVDS Data for LCD on 301B-DH */
+	   SiS_GetCRT2DataLVDS(SiS_Pr, ModeNo, ModeIdIndex, RefreshRateTableIndex, HwInfo);
+	} else {
+	   SiS_GetCRT2Data301(SiS_Pr, ModeNo, ModeIdIndex, RefreshRateTableIndex, HwInfo);
+        }
      }
 
   } else {
@@ -3405,7 +3497,7 @@ SiS_GetCRT2Data(SiS_Private *SiS_Pr, USHORT ModeNo, USHORT ModeIdIndex,
 }
 
 /*********************************************/
-/*            GET LVDS DES DATA              */
+/*         GET LVDS DES (SKEW) DATA          */
 /*********************************************/
 
 static void
@@ -3413,106 +3505,55 @@ SiS_GetLVDSDesPtr(SiS_Private *SiS_Pr, USHORT ModeNo, USHORT ModeIdIndex,
                   USHORT RefreshRateTableIndex, USHORT *PanelIndex,
 		  USHORT *ResIndex, PSIS_HW_INFO HwInfo)
 {
-  USHORT tempbx,tempal,modeflag;
+  USHORT modeflag;
 
   if(ModeNo <= 0x13) {
      modeflag = SiS_Pr->SiS_SModeIDTable[ModeIdIndex].St_ModeFlag;
-     tempal = SiS_Pr->SiS_SModeIDTable[ModeIdIndex].St_CRT2CRTC;
+     (*ResIndex) = SiS_Pr->SiS_SModeIDTable[ModeIdIndex].St_CRT2CRTC;
   } else {
      modeflag = SiS_Pr->SiS_EModeIDTable[ModeIdIndex].Ext_ModeFlag;
-     tempal = SiS_Pr->SiS_RefIndex[RefreshRateTableIndex].Ext_CRT2CRTC;
+     (*ResIndex) = SiS_Pr->SiS_RefIndex[RefreshRateTableIndex].Ext_CRT2CRTC;
   }
 
-  tempbx = 0;
+  (*ResIndex) &= 0x1F;
+  (*PanelIndex) = 0;
+
   if(SiS_Pr->SiS_IF_DEF_CH70xx != 0) {
      if(SiS_Pr->SiS_VBInfo & SetCRT2ToTV) {
-        tempbx = 50;
-        if((SiS_Pr->SiS_TVMode & TVSetPAL) && (!(SiS_Pr->SiS_TVMode & TVSetPALM))) tempbx += 2;
-        if(SiS_Pr->SiS_TVMode & TVSetCHOverScan) tempbx += 1;
+        (*PanelIndex) = 50;
+        if((SiS_Pr->SiS_TVMode & TVSetPAL) && (!(SiS_Pr->SiS_TVMode & TVSetPALM))) (*PanelIndex) += 2;
+        if(SiS_Pr->SiS_TVMode & TVSetCHOverScan) (*PanelIndex) += 1;
         /* Nothing special needed for SOverscan    */
-        /*     PALM uses NTSC data, PALN uses PAL data */
+        /* PALM uses NTSC data, PALN uses PAL data */
      }
   }
 
   if(SiS_Pr->SiS_VBInfo & SetCRT2ToLCD) {
-     tempbx = SiS_Pr->SiS_LCDTypeInfo;
+     *PanelIndex = SiS_Pr->SiS_LCDTypeInfo;
      if(HwInfo->jChipType >= SIS_661) {
         /* As long as we don's use the BIOS tables, we
 	 * need to convert the TypeInfo as for 315 series
 	 */
-        tempbx = SiS_Pr->SiS_LCDResInfo - 1;
+        (*PanelIndex) = SiS_Pr->SiS_LCDResInfo - 1;
      }
-     if(SiS_Pr->SiS_LCDInfo & DontExpandLCD) tempbx += 16;
-     if(SiS_Pr->SiS_LCDInfo & LCDPass11) {
-        tempbx = 32;
-        if(modeflag & HalfDCLK) tempbx++;
+     if(SiS_Pr->SiS_LCDInfo & DontExpandLCD) {
+        (*PanelIndex) += 16;
+        if(SiS_Pr->SiS_LCDInfo & LCDPass11) {
+           (*PanelIndex) = 32;
+           if(modeflag & HalfDCLK) (*PanelIndex)++;
+	}
      }
   }
 
   if(SiS_Pr->SiS_SetFlag & SetDOSMode) {
-     if(SiS_Pr->SiS_LCDResInfo != SiS_Pr->SiS_Panel640x480)  {
-        tempal = 0x07;
+     if(SiS_Pr->SiS_LCDResInfo != Panel_640x480) {
+        (*ResIndex) = 7;
         if(HwInfo->jChipType < SIS_315H) {
-           if(SiS_GetReg(SiS_Pr->SiS_P3c4,0x13) & 0x80) tempal++;
+           if(SiS_GetReg(SiS_Pr->SiS_P3c4,0x13) & 0x80) (*ResIndex)++;
         }
      }
   }
-
-  *PanelIndex = tempbx;
-  *ResIndex = tempal & 0x1F;
-}
-
-#ifdef SIS315H
-static void
-SiS_GetLVDSDesPtrA(SiS_Private *SiS_Pr, USHORT ModeNo, USHORT ModeIdIndex,
-                   USHORT RefreshRateTableIndex, USHORT *PanelIndex, USHORT *ResIndex,
-		   PSIS_HW_INFO HwInfo)
-{
-  USHORT tempbx=0,tempal;
-
-  if(SiS_Pr->SiS_LCDResInfo == SiS_Pr->SiS_Panel1400x1050)      tempbx = 2;
-  else if(SiS_Pr->SiS_LCDResInfo == SiS_Pr->SiS_Panel1600x1200) tempbx = 3;
-  else tempbx = SiS_Pr->SiS_LCDResInfo - 2;
-
-  if(SiS_Pr->SiS_LCDInfo & DontExpandLCD)  tempbx += 4;
-
-  if(SiS_Pr->SiS_CustomT == CUT_CLEVO1024) {
-     if(SiS_Pr->SiS_LCDResInfo == SiS_Pr->SiS_Panel1024x768) {
-        if(SiS_IsDualLink(SiS_Pr, HwInfo)) {
-	   tempbx = 80;
-	   if(SiS_Pr->SiS_LCDInfo & DontExpandLCD) tempbx++;
-	}
-     }
-  }
-  if((SiS_Pr->SiS_CustomT == CUT_UNIWILL1024) ||
-     (SiS_Pr->SiS_CustomT == CUT_UNIWILL10242)) {
-     if(SiS_Pr->SiS_LCDResInfo == SiS_Pr->SiS_Panel1024x768) {
-	tempbx = 82;
-	if(SiS_Pr->SiS_LCDInfo & DontExpandLCD) tempbx++;
-     }
-  }
-  if(SiS_Pr->SiS_CustomT == CUT_COMPAQ1280) {
-     if(SiS_Pr->SiS_LCDResInfo == SiS_Pr->SiS_Panel1280x1024) {
-	tempbx = 84;
-	if(SiS_Pr->SiS_LCDInfo & DontExpandLCD) tempbx++;
-     }
-  }
-  if(SiS_Pr->SiS_CustomT == CUT_ASUSA2H_2) {
-     if(SiS_Pr->SiS_LCDResInfo == SiS_Pr->SiS_Panel1024x768) {
-	tempbx = 86;
-	if(SiS_Pr->SiS_LCDInfo & DontExpandLCD) tempbx++;
-     }
-  }
-
-  if(ModeNo <= 0x13)
-     tempal = SiS_Pr->SiS_SModeIDTable[ModeIdIndex].St_CRT2CRTC;
-  else
-     tempal = SiS_Pr->SiS_RefIndex[RefreshRateTableIndex].Ext_CRT2CRTC;
-
-  *PanelIndex = tempbx;
-  *ResIndex = tempal & 0x1F;
 }
-#endif
 
 static void
 SiS_GetLVDSDesData(SiS_Private *SiS_Pr, USHORT ModeNo,USHORT ModeIdIndex,
@@ -3522,39 +3563,45 @@ SiS_GetLVDSDesData(SiS_Private *SiS_Pr, USHORT ModeNo,USHORT ModeIdIndex,
   USHORT PanelIndex,ResIndex;
   const  SiS_LVDSDesStruct *PanelDesPtr = NULL;
 
-  if((SiS_Pr->UseCustomMode) ||
-     (SiS_Pr->SiS_LCDResInfo == SiS_Pr->SiS_PanelCustom) ||
-     (SiS_Pr->SiS_CustomT == CUT_PANEL848)) {
-     SiS_Pr->SiS_LCDHDES = 0;
-     SiS_Pr->SiS_LCDVDES = 0;
+  SiS_Pr->SiS_LCDHDES = 0;
+  SiS_Pr->SiS_LCDVDES = 0;
+
+  if( (SiS_Pr->UseCustomMode) 		         ||
+      (SiS_Pr->SiS_LCDResInfo == Panel_Custom)   ||
+      (SiS_Pr->SiS_CustomT == CUT_PANEL848)      ||
+      ((SiS_Pr->SiS_VBType & VB_SISVB) &&
+       (SiS_Pr->SiS_LCDInfo & DontExpandLCD) &&
+       (SiS_Pr->SiS_LCDInfo & LCDPass11)) ) {
      return;
   }
 
   if((SiS_Pr->SiS_VBType & VB_SIS301BLV302BLV) && (SiS_Pr->SiS_VBInfo & SetCRT2ToLCDA)) {
 
 #ifdef SIS315H
-     SiS_GetLVDSDesPtrA(SiS_Pr, ModeNo, ModeIdIndex, RefreshRateTableIndex,
-                        &PanelIndex, &ResIndex, HwInfo);
-
-     switch (PanelIndex)
-     {
-     	case  0: PanelDesPtr = SiS_Pr->LVDS1024x768Des_1;   break;  /* --- expanding --- */
-     	case  1: PanelDesPtr = SiS_Pr->LVDS1280x1024Des_1;  break;
-	case  2: PanelDesPtr = SiS_Pr->LVDS1400x1050Des_1;  break;
-	case  3: PanelDesPtr = SiS_Pr->LVDS1600x1200Des_1;  break;
-     	case  4: PanelDesPtr = SiS_Pr->LVDS1024x768Des_2;   break;  /* --- non expanding --- */
-     	case  5: PanelDesPtr = SiS_Pr->LVDS1280x1024Des_2;  break;
-	case  6: PanelDesPtr = SiS_Pr->LVDS1400x1050Des_2;  break;
-	case  7: PanelDesPtr = SiS_Pr->LVDS1600x1200Des_2;  break;
-	case 80: PanelDesPtr = (SiS_LVDSDesStruct *)Clevo1024x768Des_1;   break;  /*  custom  */
-	case 81: PanelDesPtr = (SiS_LVDSDesStruct *)Clevo1024x768Des_2;   break;
-	case 82: PanelDesPtr = (SiS_LVDSDesStruct *)Uniwill1024x768Des_1; break;
-	case 83: PanelDesPtr = (SiS_LVDSDesStruct *)Uniwill1024x768Des_2; break;
-	case 84: PanelDesPtr = (SiS_LVDSDesStruct *)Compaq1280x1024Des_1; break;
-	case 85: PanelDesPtr = (SiS_LVDSDesStruct *)Compaq1280x1024Des_2; break;
-	case 86: PanelDesPtr = (SiS_LVDSDesStruct *)Asus1024x768Des_1;    break;  /*  custom  */
-	case 87: PanelDesPtr = (SiS_LVDSDesStruct *)Asus1024x768Des_2;    break;
-	default: PanelDesPtr = SiS_Pr->LVDS1024x768Des_1;   break;
+     if(SiS_Pr->SiS_LCDInfo & DontExpandLCD) {
+        /* non-pass 1:1 only, see above */
+        if(SiS_Pr->SiS_VGAHDE != SiS_Pr->PanelXRes) {
+           SiS_Pr->SiS_LCDHDES = SiS_Pr->SiS_HT - ((SiS_Pr->PanelXRes - SiS_Pr->SiS_VGAHDE) / 2);
+	}
+	if(SiS_Pr->SiS_VGAVDE != SiS_Pr->PanelYRes) {
+	   SiS_Pr->SiS_LCDVDES = SiS_Pr->SiS_VT - ((SiS_Pr->PanelYRes - SiS_Pr->SiS_VGAVDE) / 2);
+	}
+     }
+     if(SiS_Pr->SiS_VGAVDE == SiS_Pr->PanelYRes) {
+        switch(SiS_Pr->SiS_CustomT) {
+        case CUT_UNIWILL1024:
+        case CUT_UNIWILL10242:
+        case CUT_CLEVO1400:
+	   if(SiS_Pr->SiS_LCDResInfo == Panel_1024x768) {
+	      SiS_Pr->SiS_LCDVDES = SiS_Pr->PanelVT - 1;
+	   }
+	   break;
+	}
+	if(SiS_Pr->SiS_LCDResInfo == Panel_1280x1024) {
+	   if(SiS_Pr->SiS_CustomT != CUT_COMPAQ1280) {
+	      SiS_Pr->SiS_LCDVDES = SiS_Pr->PanelVT - 1;
+	   }
+	}
      }
 #endif
 
@@ -3563,87 +3610,68 @@ SiS_GetLVDSDesData(SiS_Private *SiS_Pr, USHORT ModeNo,USHORT ModeIdIndex,
      SiS_GetLVDSDesPtr(SiS_Pr, ModeNo, ModeIdIndex, RefreshRateTableIndex,
                        &PanelIndex, &ResIndex, HwInfo);
 
-     switch (PanelIndex)
-     {
-     	case  0: PanelDesPtr = SiS_Pr->SiS_PanelType00_1;   break;   /* ---  */
-     	case  1: PanelDesPtr = SiS_Pr->SiS_PanelType01_1;   break;
-     	case  2: PanelDesPtr = SiS_Pr->SiS_PanelType02_1;   break;
-     	case  3: PanelDesPtr = SiS_Pr->SiS_PanelType03_1;   break;
-     	case  4: PanelDesPtr = SiS_Pr->SiS_PanelType04_1;   break;
-     	case  5: PanelDesPtr = SiS_Pr->SiS_PanelType05_1;   break;
-     	case  6: PanelDesPtr = SiS_Pr->SiS_PanelType06_1;   break;
-     	case  7: PanelDesPtr = SiS_Pr->SiS_PanelType07_1;   break;
-     	case  8: PanelDesPtr = SiS_Pr->SiS_PanelType08_1;   break;
-     	case  9: PanelDesPtr = SiS_Pr->SiS_PanelType09_1;   break;
-     	case 10: PanelDesPtr = SiS_Pr->SiS_PanelType0a_1;   break;
-     	case 11: PanelDesPtr = SiS_Pr->SiS_PanelType0b_1;   break;
-     	case 12: PanelDesPtr = SiS_Pr->SiS_PanelType0c_1;   break;
-     	case 13: PanelDesPtr = SiS_Pr->SiS_PanelType0d_1;   break;
-     	case 14: PanelDesPtr = SiS_Pr->SiS_PanelType0e_1;   break;
-     	case 15: PanelDesPtr = SiS_Pr->SiS_PanelType0f_1;   break;
-     	case 16: PanelDesPtr = SiS_Pr->SiS_PanelType00_2;   break;    /* --- */
-     	case 17: PanelDesPtr = SiS_Pr->SiS_PanelType01_2;   break;
-     	case 18: PanelDesPtr = SiS_Pr->SiS_PanelType02_2;   break;
-     	case 19: PanelDesPtr = SiS_Pr->SiS_PanelType03_2;   break;
-     	case 20: PanelDesPtr = SiS_Pr->SiS_PanelType04_2;   break;
-     	case 21: PanelDesPtr = SiS_Pr->SiS_PanelType05_2;   break;
-     	case 22: PanelDesPtr = SiS_Pr->SiS_PanelType06_2;   break;
-     	case 23: PanelDesPtr = SiS_Pr->SiS_PanelType07_2;   break;
-     	case 24: PanelDesPtr = SiS_Pr->SiS_PanelType08_2;   break;
-     	case 25: PanelDesPtr = SiS_Pr->SiS_PanelType09_2;   break;
-     	case 26: PanelDesPtr = SiS_Pr->SiS_PanelType0a_2;   break;
-     	case 27: PanelDesPtr = SiS_Pr->SiS_PanelType0b_2;   break;
-     	case 28: PanelDesPtr = SiS_Pr->SiS_PanelType0c_2;   break;
-     	case 29: PanelDesPtr = SiS_Pr->SiS_PanelType0d_2;   break;
-     	case 30: PanelDesPtr = SiS_Pr->SiS_PanelType0e_2;   break;
-     	case 31: PanelDesPtr = SiS_Pr->SiS_PanelType0f_2;   break;
-	case 32: PanelDesPtr = SiS_Pr->SiS_PanelTypeNS_1;   break;    /* pass 1:1 */
-	case 33: PanelDesPtr = SiS_Pr->SiS_PanelTypeNS_2;   break;
-     	case 50: PanelDesPtr = SiS_Pr->SiS_CHTVUNTSCDesData;   break; /* TV */
-     	case 51: PanelDesPtr = SiS_Pr->SiS_CHTVONTSCDesData;   break;
-     	case 52: PanelDesPtr = SiS_Pr->SiS_CHTVUPALDesData;    break;
-     	case 53: PanelDesPtr = SiS_Pr->SiS_CHTVOPALDesData;    break;
-	default:
-		 if(HwInfo->jChipType < SIS_315H)
-		    PanelDesPtr = SiS_Pr->SiS_PanelType0e_1;
-		 else
-		    PanelDesPtr = SiS_Pr->SiS_PanelType01_1;
-		 break;
-     }
-  }
-  SiS_Pr->SiS_LCDHDES = (PanelDesPtr+ResIndex)->LCDHDES;
-  SiS_Pr->SiS_LCDVDES = (PanelDesPtr+ResIndex)->LCDVDES;
-
-  if(SiS_Pr->SiS_LCDInfo & DontExpandLCD){
-     if((SiS_Pr->SiS_VBType & VB_SIS301BLV302BLV) && (SiS_Pr->SiS_VBInfo & SetCRT2ToLCDA)) {
-        if(ModeNo <= 0x13) {
-           modeflag = SiS_Pr->SiS_SModeIDTable[ModeIdIndex].St_ModeFlag;
-	   if(!(modeflag & HalfDCLK)) {
-	      SiS_Pr->SiS_LCDHDES = 632;
-	   }
-        }
-     } else {
-        if(!(SiS_Pr->SiS_SetFlag & SetDOSMode)) {
-           if(SiS_Pr->SiS_LCDResInfo != SiS_Pr->SiS_Panel1280x1024) {
-              if(SiS_Pr->SiS_LCDResInfo >= SiS_Pr->SiS_Panel1024x768) {
-                 if(ModeNo <= 0x13) {
-	            modeflag = SiS_Pr->SiS_SModeIDTable[ModeIdIndex].St_ModeFlag;
-	            if(HwInfo->jChipType < SIS_315H) {
-	               if(!(modeflag & HalfDCLK)) SiS_Pr->SiS_LCDHDES = 320;
-	            } else {
-	               if(SiS_Pr->SiS_LCDResInfo == SiS_Pr->SiS_Panel1024x768)
-	                  SiS_Pr->SiS_LCDHDES = 480;
-                       if(SiS_Pr->SiS_LCDResInfo == SiS_Pr->SiS_Panel1400x1050)
-	                  SiS_Pr->SiS_LCDHDES = 804;
-		       if(SiS_Pr->SiS_LCDResInfo == SiS_Pr->SiS_Panel1600x1200)
-	                  SiS_Pr->SiS_LCDHDES = 704;
-                       if(!(modeflag & HalfDCLK)) {
-                          SiS_Pr->SiS_LCDHDES = 320;
-	                  if(SiS_Pr->SiS_LCDResInfo == SiS_Pr->SiS_Panel1400x1050)
-	                     SiS_Pr->SiS_LCDHDES = 632;
-		          else if(SiS_Pr->SiS_LCDResInfo == SiS_Pr->SiS_Panel1600x1200)
-	                     SiS_Pr->SiS_LCDHDES = 542;
-                       }
+     switch(PanelIndex) {
+     	case  0: PanelDesPtr = SiS_Pr->SiS_PanelType00_1;    break;   /* ---  */
+     	case  1: PanelDesPtr = SiS_Pr->SiS_PanelType01_1;    break;
+     	case  2: PanelDesPtr = SiS_Pr->SiS_PanelType02_1;    break;
+     	case  3: PanelDesPtr = SiS_Pr->SiS_PanelType03_1;    break;
+     	case  4: PanelDesPtr = SiS_Pr->SiS_PanelType04_1;    break;
+     	case  5: PanelDesPtr = SiS_Pr->SiS_PanelType05_1;    break;
+     	case  6: PanelDesPtr = SiS_Pr->SiS_PanelType06_1;    break;
+     	case  7: PanelDesPtr = SiS_Pr->SiS_PanelType07_1;    break;
+     	case  8: PanelDesPtr = SiS_Pr->SiS_PanelType08_1;    break;
+     	case  9: PanelDesPtr = SiS_Pr->SiS_PanelType09_1;    break;
+     	case 10: PanelDesPtr = SiS_Pr->SiS_PanelType0a_1;    break;
+     	case 11: PanelDesPtr = SiS_Pr->SiS_PanelType0b_1;    break;
+     	case 12: PanelDesPtr = SiS_Pr->SiS_PanelType0c_1;    break;
+     	case 13: PanelDesPtr = SiS_Pr->SiS_PanelType0d_1;    break;
+     	case 14: PanelDesPtr = SiS_Pr->SiS_PanelType0e_1;    break;
+     	case 15: PanelDesPtr = SiS_Pr->SiS_PanelType0f_1;    break;
+     	case 16: PanelDesPtr = SiS_Pr->SiS_PanelType00_2;    break;    /* --- */
+     	case 17: PanelDesPtr = SiS_Pr->SiS_PanelType01_2;    break;
+     	case 18: PanelDesPtr = SiS_Pr->SiS_PanelType02_2;    break;
+     	case 19: PanelDesPtr = SiS_Pr->SiS_PanelType03_2;    break;
+     	case 20: PanelDesPtr = SiS_Pr->SiS_PanelType04_2;    break;
+     	case 21: PanelDesPtr = SiS_Pr->SiS_PanelType05_2;    break;
+     	case 22: PanelDesPtr = SiS_Pr->SiS_PanelType06_2;    break;
+     	case 23: PanelDesPtr = SiS_Pr->SiS_PanelType07_2;    break;
+     	case 24: PanelDesPtr = SiS_Pr->SiS_PanelType08_2;    break;
+     	case 25: PanelDesPtr = SiS_Pr->SiS_PanelType09_2;    break;
+     	case 26: PanelDesPtr = SiS_Pr->SiS_PanelType0a_2;    break;
+     	case 27: PanelDesPtr = SiS_Pr->SiS_PanelType0b_2;    break;
+     	case 28: PanelDesPtr = SiS_Pr->SiS_PanelType0c_2;    break;
+     	case 29: PanelDesPtr = SiS_Pr->SiS_PanelType0d_2;    break;
+     	case 30: PanelDesPtr = SiS_Pr->SiS_PanelType0e_2;    break;
+     	case 31: PanelDesPtr = SiS_Pr->SiS_PanelType0f_2;    break;
+	case 32: PanelDesPtr = SiS_Pr->SiS_PanelTypeNS_1;    break;    /* pass 1:1 */
+	case 33: PanelDesPtr = SiS_Pr->SiS_PanelTypeNS_2;    break;
+     	case 50: PanelDesPtr = SiS_Pr->SiS_CHTVUNTSCDesData; break;    /* TV */
+     	case 51: PanelDesPtr = SiS_Pr->SiS_CHTVONTSCDesData; break;
+     	case 52: PanelDesPtr = SiS_Pr->SiS_CHTVUPALDesData;  break;
+     	case 53: PanelDesPtr = SiS_Pr->SiS_CHTVOPALDesData;  break;
+	default: return;
+     }
+
+     SiS_Pr->SiS_LCDHDES = (PanelDesPtr+ResIndex)->LCDHDES;
+     SiS_Pr->SiS_LCDVDES = (PanelDesPtr+ResIndex)->LCDVDES;
+
+     if((ModeNo <= 0x13) && (SiS_Pr->SiS_LCDInfo & DontExpandLCD)) {
+        modeflag = SiS_Pr->SiS_SModeIDTable[ModeIdIndex].St_ModeFlag;
+        if((SiS_Pr->SiS_VBType & VB_SIS301BLV302BLV) && (SiS_Pr->SiS_VBInfo & SetCRT2ToLCDA)) {
+	   if(!(modeflag & HalfDCLK)) SiS_Pr->SiS_LCDHDES = 632;
+        } else if(!(SiS_Pr->SiS_SetFlag & SetDOSMode)) {
+           if(SiS_Pr->SiS_LCDResInfo != Panel_1280x1024) {
+              if(SiS_Pr->SiS_LCDResInfo >= Panel_1024x768) {
+	         if(HwInfo->jChipType < SIS_315H) {
+	            if(!(modeflag & HalfDCLK)) SiS_Pr->SiS_LCDHDES = 320;
+	         } else {
+	            if(SiS_Pr->SiS_LCDResInfo == Panel_1024x768)  SiS_Pr->SiS_LCDHDES = 480;
+                    if(SiS_Pr->SiS_LCDResInfo == Panel_1400x1050) SiS_Pr->SiS_LCDHDES = 804;
+		    if(SiS_Pr->SiS_LCDResInfo == Panel_1600x1200) SiS_Pr->SiS_LCDHDES = 704;
+                    if(!(modeflag & HalfDCLK)) {
+                       SiS_Pr->SiS_LCDHDES = 320;
+	               if(SiS_Pr->SiS_LCDResInfo == Panel_1400x1050) SiS_Pr->SiS_LCDHDES = 632;
+		       if(SiS_Pr->SiS_LCDResInfo == Panel_1600x1200) SiS_Pr->SiS_LCDHDES = 542;
                     }
                  }
               }
@@ -3653,18 +3681,6 @@ SiS_GetLVDSDesData(SiS_Private *SiS_Pr, USHORT ModeNo,USHORT ModeIdIndex,
   }
 }
 
-/*********************************************/
-/*          SET CRT2 AUTO-THRESHOLD          */
-/*********************************************/
-
-#ifdef SIS315H
-static void
-SiS_CRT2AutoThreshold(SiS_Private *SiS_Pr)
-{
-  SiS_SetRegOR(SiS_Pr->SiS_Part1Port,0x01,0x40);
-}
-#endif
-
 /*********************************************/
 /*           DISABLE VIDEO BRIDGE            */
 /*********************************************/
@@ -3683,55 +3699,40 @@ SiS_DisableBridge(SiS_Private *SiS_Pr, PSIS_HW_INFO HwInfo)
 
   if(SiS_Pr->SiS_VBType & VB_SISVB) {
 
-      if(SiS_Pr->SiS_VBType & VB_SIS301BLV302BLV) {   /* ===== For 30xB/LV ===== */
+     if(SiS_Pr->SiS_VBType & VB_SIS301BLV302BLV) {   /* ===== For 30xB/LV ===== */
 
         if(HwInfo->jChipType < SIS_315H) {
 
 #ifdef SIS300	   /* 300 series */
 
-           if(HwInfo->jChipType == SIS_300) {  /* For 300+301LV (A907) */
-
-	      if(!(SiS_CR36BIOSWord23b(SiS_Pr,HwInfo))) {
-	         if(SiS_Pr->SiS_VBType & VB_SIS301LV302LV) {
-	            SiS_SetRegAND(SiS_Pr->SiS_Part4Port,0x26,0xFE);
-		    SiS_PanelDelay(SiS_Pr, HwInfo, 3);
-		 }
+	   if(!(SiS_CR36BIOSWord23b(SiS_Pr,HwInfo))) {
+	      if(SiS_Pr->SiS_VBType & VB_SIS301LV302LV) {
+	         SiS_SetRegAND(SiS_Pr->SiS_Part4Port,0x26,0xFE);
+	      } else {
+		 SiS_SetRegSR11ANDOR(SiS_Pr,HwInfo,0xF7,0x08);
 	      }
+	      SiS_PanelDelay(SiS_Pr, HwInfo, 3);
+	   }
+	   if(SiS_Is301B(SiS_Pr)) {
 	      SiS_SetRegAND(SiS_Pr->SiS_Part4Port,0x1f,0x3f);
 	      SiS_ShortDelay(SiS_Pr,1);
-	      SiS_SetRegAND(SiS_Pr->SiS_Part2Port,0x00,0xDF);
-	      SiS_DisplayOff(SiS_Pr);
-	      SiS_SetRegAND(SiS_Pr->SiS_P3c4,0x32,0xDF);
-	      SiS_SetRegAND(SiS_Pr->SiS_P3c4,0x1E,0xDF);
-	      if(SiS_Pr->SiS_VBType & VB_SIS301LV302LV) {
-	         if( (!(SiS_CRT2IsLCD(SiS_Pr, HwInfo))) ||
-	             (!(SiS_CR36BIOSWord23d(SiS_Pr, HwInfo))) ) {
-	            SiS_PanelDelay(SiS_Pr, HwInfo, 2);
-                    SiS_SetRegAND(SiS_Pr->SiS_Part4Port,0x26,0xFD);
-		 }
-	      }
-
-	   } else {
-
-	      if(!(SiS_CR36BIOSWord23b(SiS_Pr,HwInfo))) {
-	         SiS_SetRegSR11ANDOR(SiS_Pr,HwInfo,0xF7,0x08);
-	         SiS_PanelDelay(SiS_Pr, HwInfo, 3);
-	      }
-	      if(SiS_Is301B(SiS_Pr)) {
-	         SiS_SetRegAND(SiS_Pr->SiS_Part4Port,0x1f,0x3f);
-	         SiS_ShortDelay(SiS_Pr,1);
-	      }
-	      SiS_SetRegAND(SiS_Pr->SiS_Part2Port,0x00,0xDF);
-	      SiS_DisplayOff(SiS_Pr);
-	      SiS_SetRegAND(SiS_Pr->SiS_P3c4,0x32,0xDF);
-	      SiS_SetRegAND(SiS_Pr->SiS_P3c4,0x1E,0xDF);
-	      SiS_UnLockCRT2(SiS_Pr,HwInfo);
+           }
+	   SiS_SetRegAND(SiS_Pr->SiS_Part2Port,0x00,0xDF);
+	   SiS_DisplayOff(SiS_Pr);
+	   SiS_SetRegAND(SiS_Pr->SiS_P3c4,0x32,0xDF);
+	   SiS_SetRegAND(SiS_Pr->SiS_P3c4,0x1E,0xDF);
+	   SiS_UnLockCRT2(SiS_Pr,HwInfo);
+	   if(!(SiS_Pr->SiS_VBType & VB_SIS301LV302LV)) {
 	      SiS_SetRegOR(SiS_Pr->SiS_Part1Port,0x01,0x80);
 	      SiS_SetRegOR(SiS_Pr->SiS_Part1Port,0x02,0x40);
-	      if( (!(SiS_CRT2IsLCD(SiS_Pr, HwInfo))) ||
-	          (!(SiS_CR36BIOSWord23d(SiS_Pr, HwInfo))) ) {
-	         SiS_PanelDelay(SiS_Pr, HwInfo, 2);
-                 SiS_SetRegSR11ANDOR(SiS_Pr,HwInfo,0xFB,0x04);
+	   }
+	   if( (!(SiS_CRT2IsLCD(SiS_Pr, HwInfo))) ||
+	       (!(SiS_CR36BIOSWord23d(SiS_Pr, HwInfo))) ) {
+	      SiS_PanelDelay(SiS_Pr, HwInfo, 2);
+	      if(SiS_Pr->SiS_VBType & VB_SIS301LV302LV) {
+                 SiS_SetRegAND(SiS_Pr->SiS_Part4Port,0x26,0xFD);
+	      } else {
+		 SiS_SetRegSR11ANDOR(SiS_Pr,HwInfo,0xFB,0x04);
 	      }
 	   }
 
@@ -3741,149 +3742,99 @@ SiS_DisableBridge(SiS_Private *SiS_Pr, PSIS_HW_INFO HwInfo)
 
 #ifdef SIS315H	   /* 315 series */
 
-           if(IS_SIS550650740660) {		/* 550, 650, 740, 660 */
+	   BOOLEAN custom1 = ((SiS_Pr->SiS_CustomT == CUT_COMPAQ1280) ||
+	                      (SiS_Pr->SiS_CustomT == CUT_CLEVO1400)) ? TRUE : FALSE;
+
+	   modenum = SiS_GetReg(SiS_Pr->SiS_P3d4,0x34) & 0x7f;
 
-	      modenum = SiS_GetReg(SiS_Pr->SiS_P3d4,0x34) & 0x7f;
+           if(SiS_Pr->SiS_VBType & VB_SIS301LV302LV) {
 
-              if(SiS_Pr->SiS_VBType & VB_SIS301LV302LV) {			/* LV */
 #ifdef SET_EMI
-	         if(SiS_Pr->SiS_VBType & (VB_SIS302LV | VB_SIS302ELV)) {
-		    if(SiS_Pr->SiS_CustomT != CUT_CLEVO1400) {
-	               SiS_SetRegAND(SiS_Pr->SiS_Part4Port,0x30,0x0c);
-		    }
+	      if(SiS_Pr->SiS_VBType & (VB_SIS302LV | VB_SIS302ELV)) {
+		 if(SiS_Pr->SiS_CustomT != CUT_CLEVO1400) {
+	            SiS_SetRegAND(SiS_Pr->SiS_Part4Port,0x30,0x0c);
 		 }
+	      }
 #endif
-		 if( (modenum <= 0x13) ||
-		     (!(SiS_IsDualEdge(SiS_Pr,HwInfo))) ||
-		     (SiS_IsVAMode(SiS_Pr,HwInfo)) ) {
-	     	    SiS_SetRegAND(SiS_Pr->SiS_Part4Port,0x26,0xFE);
-		    if((SiS_Pr->SiS_CustomT == CUT_COMPAQ1280) ||
-		       (SiS_Pr->SiS_CustomT == CUT_CLEVO1400)) {
-		       SiS_PanelDelay(SiS_Pr, HwInfo, 3);
-		    }
-	         }
+	      if( (modenum <= 0x13)                  ||
+		  (SiS_IsVAMode(SiS_Pr,HwInfo))      ||
+		  (!(SiS_IsDualEdge(SiS_Pr,HwInfo))) ) {
+	     	 SiS_SetRegAND(SiS_Pr->SiS_Part4Port,0x26,0xFE);
+		 if(custom1) SiS_PanelDelay(SiS_Pr, HwInfo, 3);
+	      }
 
-		 if((SiS_Pr->SiS_CustomT != CUT_COMPAQ1280) &&
-		    (SiS_Pr->SiS_CustomT != CUT_CLEVO1400)) {
-		    SiS_DDC2Delay(SiS_Pr,0xff00);
-		    SiS_DDC2Delay(SiS_Pr,0xe000);
+	      if(!custom1) {
+		 SiS_DDC2Delay(SiS_Pr,0xff00);
+		 SiS_DDC2Delay(SiS_Pr,0xe000);
+	         SiS_SetRegByte(SiS_Pr->SiS_P3c6,0x00);
+                 pushax = SiS_GetReg(SiS_Pr->SiS_P3c4,0x06);
+		 if(IS_SIS740) {
+		    SiS_SetRegAND(SiS_Pr->SiS_P3c4,0x06,0xE3);
+		 }
+	         SiS_PanelDelay(SiS_Pr, HwInfo, 3);
+	      }
 
-	            SiS_SetRegByte(SiS_Pr->SiS_P3c6,0x00);
+           }
 
-                    pushax = SiS_GetReg(SiS_Pr->SiS_P3c4,0x06);
+	   if(!(SiS_IsNotM650orLater(SiS_Pr, HwInfo))) {
+	      tempah = 0xef;
+	      if(SiS_IsVAMode(SiS_Pr,HwInfo)) tempah = 0xf7;
+	      SiS_SetRegAND(SiS_Pr->SiS_Part1Port,0x4c,tempah);
+	   }
 
-		    if(IS_SIS740) {
-		       SiS_SetRegAND(SiS_Pr->SiS_P3c4,0x06,0xE3);
-		    }
+	   if(SiS_Pr->SiS_VBType & VB_SIS301LV302LV) {
+	      SiS_SetRegAND(SiS_Pr->SiS_Part4Port,0x1F,~0x10);
+	   }
 
-	            SiS_PanelDelay(SiS_Pr, HwInfo, 3);
+	   tempah = 0x3f;
+	   if(SiS_IsDualEdge(SiS_Pr,HwInfo)) {
+	      tempah = 0x7f;
+	      if(!(SiS_IsVAMode(SiS_Pr,HwInfo))) tempah = 0xbf;
+	   }
+	   SiS_SetRegAND(SiS_Pr->SiS_Part4Port,0x1F,tempah);
 
-		    if(!(SiS_IsNotM650orLater(SiS_Pr, HwInfo))) {
-	               tempah = 0xef;
-	               if(SiS_IsVAMode(SiS_Pr,HwInfo)) {
-	                  tempah = 0xf7;
-                       }
-	               SiS_SetRegAND(SiS_Pr->SiS_Part1Port,0x4c,tempah);
-	            }
-		 }
+           if((SiS_IsVAMode(SiS_Pr,HwInfo)) ||
+	      ((SiS_Pr->SiS_VBType & VB_SIS301LV302LV) && (modenum <= 0x13))) {
 
-              } else if(SiS_Pr->SiS_VBType & VB_NoLCD) {			/* B-DH */
+	      SiS_DisplayOff(SiS_Pr);
+	      if(SiS_Pr->SiS_VBType & VB_SIS301LV302LV) {
+		 SiS_PanelDelay(SiS_Pr, HwInfo, 2);
+	      }
+	      SiS_SetRegAND(SiS_Pr->SiS_P3c4,0x32,0xDF);
+	      SiS_SetRegAND(SiS_Pr->SiS_Part1Port,0x1E,0xDF);
 
-	         if(!(SiS_IsNotM650orLater(SiS_Pr,HwInfo))) {
-	            SiS_SetRegAND(SiS_Pr->SiS_Part1Port,0x4c,0xef);
-	         }
+	   }
 
-	      }
+	   if((!(SiS_IsVAMode(SiS_Pr,HwInfo))) ||
+	      ((SiS_Pr->SiS_VBType & VB_SIS301LV302LV) && (modenum <= 0x13))) {
 
-	      if((SiS_Pr->SiS_CustomT == CUT_COMPAQ1280) ||
-	         (SiS_Pr->SiS_CustomT == CUT_CLEVO1400)) {
-	         SiS_SetRegAND(SiS_Pr->SiS_Part4Port,0x1F,0xef);
+	      if(!(SiS_IsDualEdge(SiS_Pr,HwInfo))) {
+		 SiS_SetRegAND(SiS_Pr->SiS_Part2Port,0x00,0xdf);
+		 SiS_DisplayOff(SiS_Pr);
 	      }
+	      SiS_SetRegOR(SiS_Pr->SiS_Part1Port,0x00,0x80);
 
-              if((SiS_Pr->SiS_VBType & VB_SIS301B302B) ||
-	         (SiS_Pr->SiS_CustomT == CUT_COMPAQ1280) ||
-		 (SiS_Pr->SiS_CustomT == CUT_CLEVO1400)) {
-	         tempah = 0x3f;
-	         if(SiS_IsDualEdge(SiS_Pr,HwInfo)) {
-	            tempah = 0x7f;
-	            if(!(SiS_IsVAMode(SiS_Pr,HwInfo))) {
-		       tempah = 0xbf;
-                    }
-	         }
-	         SiS_SetRegAND(SiS_Pr->SiS_Part4Port,0x1F,tempah);
+	      if(SiS_Pr->SiS_VBType & VB_SIS301LV302LV) {
+		 SiS_PanelDelay(SiS_Pr, HwInfo, 2);
 	      }
 
-              if((SiS_IsVAMode(SiS_Pr,HwInfo)) ||
-	         ((SiS_Pr->SiS_VBType & VB_SIS301LV302LV) && (modenum <= 0x13))) {
-
-	         if((SiS_Pr->SiS_VBType & VB_SIS301B302B) ||
-		    (SiS_Pr->SiS_CustomT == CUT_COMPAQ1280) ||
-		    (SiS_Pr->SiS_CustomT == CUT_CLEVO1400)) {
-		    SiS_SetRegAND(SiS_Pr->SiS_Part1Port,0x1E,0xDF);
-		    SiS_DisplayOff(SiS_Pr);
-		    SiS_SetRegAND(SiS_Pr->SiS_P3c4,0x32,0xDF);
-		 } else {
-	            SiS_DisplayOff(SiS_Pr);
-	            SiS_PanelDelay(SiS_Pr, HwInfo, 2);
-	            SiS_SetRegAND(SiS_Pr->SiS_P3c4,0x32,0xDF);
-	            SiS_SetRegAND(SiS_Pr->SiS_Part1Port,0x1E,0xDF);
-		    if((SiS_Pr->SiS_VBType & VB_SIS301LV302LV) && (modenum <= 0x13)) {
-		       SiS_DisplayOff(SiS_Pr);
-	               SiS_SetRegOR(SiS_Pr->SiS_Part1Port,0x00,0x80);
-	               SiS_PanelDelay(SiS_Pr, HwInfo, 2);
-	               SiS_SetRegAND(SiS_Pr->SiS_P3c4,0x32,0xDF);
-	               temp = SiS_GetReg(SiS_Pr->SiS_Part1Port,0x00);
-                       SiS_SetRegOR(SiS_Pr->SiS_Part1Port,0x00,0x10);
-	               SiS_SetRegAND(SiS_Pr->SiS_P3c4,0x1E,0xDF);
-	               SiS_SetReg(SiS_Pr->SiS_Part1Port,0x00,temp);
-		    }
-		 }
-
-	      } else {
-
-	         if((SiS_Pr->SiS_VBType & VB_SIS301B302B) ||
-		    (SiS_Pr->SiS_CustomT == CUT_COMPAQ1280) ||
-		    (SiS_Pr->SiS_CustomT == CUT_CLEVO1400)) {
-		    if(!(SiS_IsDualEdge(SiS_Pr,HwInfo))) {
-		       SiS_SetRegAND(SiS_Pr->SiS_Part2Port,0x00,0xdf);
-		       SiS_DisplayOff(SiS_Pr);
-		    }
-		    SiS_SetRegOR(SiS_Pr->SiS_Part1Port,0x00,0x80);
-		 } else {
-                    SiS_DisplayOff(SiS_Pr);
-	            SiS_SetRegOR(SiS_Pr->SiS_Part1Port,0x00,0x80);
-	            SiS_PanelDelay(SiS_Pr, HwInfo, 2);
-		 }
-
-		 SiS_SetRegAND(SiS_Pr->SiS_P3c4,0x32,0xDF);
-	         temp = SiS_GetReg(SiS_Pr->SiS_Part1Port,0x00);
-                 SiS_SetRegOR(SiS_Pr->SiS_Part1Port,0x00,0x10);
-	         SiS_SetRegAND(SiS_Pr->SiS_P3c4,0x1E,0xDF);
-	         SiS_SetReg(SiS_Pr->SiS_Part1Port,0x00,temp);
-
-	      }
+	      SiS_SetRegAND(SiS_Pr->SiS_P3c4,0x32,0xDF);
+	      temp = SiS_GetReg(SiS_Pr->SiS_Part1Port,0x00);
+              SiS_SetRegOR(SiS_Pr->SiS_Part1Port,0x00,0x10);
+	      SiS_SetRegAND(SiS_Pr->SiS_P3c4,0x1E,0xDF);
+	      SiS_SetReg(SiS_Pr->SiS_Part1Port,0x00,temp);
 
-	      if((SiS_Pr->SiS_VBType & VB_SIS301LV302LV) &&
-	         (SiS_Pr->SiS_CustomT != CUT_COMPAQ1280) &&
-		 (SiS_Pr->SiS_CustomT != CUT_CLEVO1400)) {
+	   }
 
-		 SiS_SetRegAND(SiS_Pr->SiS_Part4Port,0x1f,~0x10);
+	   if(SiS_IsNotM650orLater(SiS_Pr,HwInfo)) {
+	      SiS_SetRegAND(SiS_Pr->SiS_Part1Port,0x2e,0x7f);
+	   }
 
-	         tempah = 0x3f;
-	         if(SiS_IsDualEdge(SiS_Pr,HwInfo)) {
-	            tempah = 0x7f;
-	            if(!(SiS_IsVAMode(SiS_Pr,HwInfo))) {
-		       tempah = 0xbf;
-                    }
-	         }
-	         SiS_SetRegAND(SiS_Pr->SiS_Part4Port,0x1F,tempah);
+	   if(SiS_Pr->SiS_VBType & VB_SIS301LV302LV) {
 
-		 if(SiS_IsNotM650orLater(SiS_Pr,HwInfo)) {
-	            SiS_SetRegAND(SiS_Pr->SiS_Part1Port,0x2e,0x7f);
-		 }
+	      if(!custom1) {
 
 	         if(!(SiS_IsVAMode(SiS_Pr,HwInfo))) {
-	            SiS_SetRegAND(SiS_Pr->SiS_Part2Port,0x00,0xdf);
 	            if(!(SiS_CRT2IsLCD(SiS_Pr,HwInfo))) {
 	               if(!(SiS_IsDualEdge(SiS_Pr,HwInfo))) {
 		          SiS_SetRegAND(SiS_Pr->SiS_Part4Port,0x26,0xFD);
@@ -3894,95 +3845,39 @@ SiS_DisableBridge(SiS_Private *SiS_Pr, PSIS_HW_INFO HwInfo)
 	         SiS_SetReg(SiS_Pr->SiS_P3c4,0x06,pushax);
 
 		 if(SiS_Pr->SiS_VBType & (VB_SIS302LV | VB_SIS302ELV)) {
-	            if( (SiS_IsVAMode(SiS_Pr, HwInfo)) ||
-	                (SiS_CRT2IsLCD(SiS_Pr, HwInfo)) ) {
+	            if(SiS_IsVAorLCD(SiS_Pr, HwInfo)) {
 		       SiS_PanelDelayLoop(SiS_Pr, HwInfo, 3, 20);
 		    }
 	         }
 
-  	      } else if(SiS_Pr->SiS_VBType & VB_NoLCD) {
-
-	         /* NIL */
-
-	      } else if((SiS_Pr->SiS_VBType & VB_SIS301B302B) ||
-	                (SiS_Pr->SiS_CustomT == CUT_COMPAQ1280) ||
-			(SiS_Pr->SiS_CustomT == CUT_CLEVO1400)) {
+	      } else {
 
-		 if(!(SiS_IsNotM650orLater(SiS_Pr,HwInfo))) {
-	            tempah = 0xef;
-	            if(SiS_IsDualEdge(SiS_Pr,HwInfo)) {
-		       if(modenum > 0x13) {
-	                  tempah = 0xf7;
-		       }
-                    }
-	            SiS_SetRegAND(SiS_Pr->SiS_Part1Port,0x4c,tempah);
-		 }
-		 if((SiS_Pr->SiS_CustomT == CUT_COMPAQ1280) ||
-		    (SiS_Pr->SiS_CustomT == CUT_CLEVO1400)) {
-		    if((SiS_IsVAMode(SiS_Pr,HwInfo)) ||
-		       (!(SiS_IsDualEdge(SiS_Pr,HwInfo)))) {
-		       if((!(SiS_WeHaveBacklightCtrl(SiS_Pr, HwInfo))) ||
-		          (!(SiS_CRT2IsLCD(SiS_Pr, HwInfo)))) {
-			  SiS_PanelDelay(SiS_Pr, HwInfo, 2);
-	     	          SiS_SetRegAND(SiS_Pr->SiS_Part4Port,0x26,0xFD);
-			  SiS_PanelDelay(SiS_Pr, HwInfo, 4);
-	               }
+		 if((SiS_IsVAMode(SiS_Pr,HwInfo)) ||
+		    (!(SiS_IsDualEdge(SiS_Pr,HwInfo)))) {
+		    if((!(SiS_WeHaveBacklightCtrl(SiS_Pr, HwInfo))) ||
+		       (!(SiS_CRT2IsLCD(SiS_Pr, HwInfo)))) {
+		       SiS_PanelDelay(SiS_Pr, HwInfo, 2);
+	     	       SiS_SetRegAND(SiS_Pr->SiS_Part4Port,0x26,0xFD);
+		       SiS_PanelDelay(SiS_Pr, HwInfo, 4);
 		    }
 		 }
 
 	      }
-
-	  } else {			/* 315, 330 - all bridge types */
-
-	     if(SiS_Is301B(SiS_Pr)) {
-	        tempah = 0x3f;
-	        if(SiS_IsDualEdge(SiS_Pr,HwInfo)) {
-	           tempah = 0x7f;
-	           if(!(SiS_IsVAMode(SiS_Pr,HwInfo))) {
-		      tempah = 0xbf;
-                   }
-	        }
-	        SiS_SetRegAND(SiS_Pr->SiS_Part4Port,0x1F,tempah);
-	        if(SiS_IsVAMode(SiS_Pr,HwInfo)) {
-	           SiS_DisplayOff(SiS_Pr);
-		   SiS_SetRegAND(SiS_Pr->SiS_P3c4,0x32,0xDF);
-	        }
-	     }
-	     if( (!(SiS_Is301B(SiS_Pr))) ||
-	         (!(SiS_IsVAMode(SiS_Pr,HwInfo))) ) {
-
- 	 	if( (!(SiS_Is301B(SiS_Pr))) ||
-		    (!(SiS_IsDualEdge(SiS_Pr,HwInfo))) ) {
-
-	           SiS_SetRegAND(SiS_Pr->SiS_Part2Port,0x00,0xDF);
-	           SiS_DisplayOff(SiS_Pr);
-
-		}
-
-                SiS_SetRegOR(SiS_Pr->SiS_Part1Port,0x00,0x80);
-
-                SiS_SetRegAND(SiS_Pr->SiS_P3c4,0x32,0xDF);
-
-	        temp = SiS_GetReg(SiS_Pr->SiS_Part1Port,0x00);
-                SiS_SetRegOR(SiS_Pr->SiS_Part1Port,0x00,0x10);
-	        SiS_SetRegAND(SiS_Pr->SiS_P3c4,0x1E,0xDF);
-	        SiS_SetReg(SiS_Pr->SiS_Part1Port,0x00,temp);
-
-	     }
-
-	  }    /* 315/330 */
+           }
 
 #endif /* SIS315H */
 
 	}
 
-      } else {     /* ============ For 301 ================ */
+     } else {     /* ============ For 301 ================ */
 
         if(HwInfo->jChipType < SIS_315H) {
+#ifdef SIS300
            if(!(SiS_CR36BIOSWord23b(SiS_Pr,HwInfo))) {
 	      SiS_SetRegSR11ANDOR(SiS_Pr,HwInfo,0xF7,0x08);
 	      SiS_PanelDelay(SiS_Pr, HwInfo, 3);
 	   }
+#endif
 	}
 
         SiS_SetRegAND(SiS_Pr->SiS_Part2Port,0x00,0xDF);           /* disable VB */
@@ -4000,12 +3895,14 @@ SiS_DisableBridge(SiS_Private *SiS_Pr, PSIS_HW_INFO HwInfo)
 	    SiS_SetRegOR(SiS_Pr->SiS_P3c4,0x1E,0x20);
 	    SiS_SetReg(SiS_Pr->SiS_Part1Port,0x00,temp);
 	} else {
+#ifdef SIS300
             SiS_SetRegAND(SiS_Pr->SiS_P3c4,0x1E,0xDF);            /* disable CRT2 */
 	    if( (!(SiS_CRT2IsLCD(SiS_Pr, HwInfo))) ||
 	        (!(SiS_CR36BIOSWord23d(SiS_Pr,HwInfo))) ) {
 		SiS_PanelDelay(SiS_Pr, HwInfo, 2);
 		SiS_SetRegSR11ANDOR(SiS_Pr,HwInfo,0xFB,0x04);
 	    }
+#endif
 	}
 
       }
@@ -4064,6 +3961,10 @@ SiS_DisableBridge(SiS_Private *SiS_Pr, PSIS_HW_INFO HwInfo)
 
 #ifdef SIS315H	/* 315 series */
 
+        if(!(SiS_IsNotM650orLater(SiS_Pr,HwInfo))) {
+          SiS_SetRegAND(SiS_Pr->SiS_Part1Port,0x4c,~0x18);
+        }
+
 	if(SiS_Pr->SiS_IF_DEF_CH70xx != 0) {
 
 	   if(HwInfo->jChipType == SIS_740) {
@@ -4194,7 +4095,6 @@ SiS_EnableBridge(SiS_Private *SiS_Pr, PSIS_HW_INFO HwInfo)
   BOOLEAN delaylong = FALSE;
 #endif
 
-
   if(SiS_Pr->SiS_VBType & VB_SISVB) {
 
     if(SiS_Pr->SiS_VBType & VB_SIS301BLV302BLV) {   /* ====== For 301B et al  ====== */
@@ -4203,28 +4103,55 @@ SiS_EnableBridge(SiS_Private *SiS_Pr, PSIS_HW_INFO HwInfo)
 
 #ifdef SIS300     /* 300 series */
 
-         if(HwInfo->jChipType == SIS_300) {
-
-	    if(SiS_CRT2IsLCD(SiS_Pr, HwInfo)) {
-	       if(SiS_Pr->SiS_VBType & VB_SIS301LV302LV) {
-	          SiS_SetRegOR(SiS_Pr->SiS_Part4Port,0x26,0x02);
-	          if(!(SiS_CR36BIOSWord23d(SiS_Pr, HwInfo))) {
-	             SiS_PanelDelay(SiS_Pr, HwInfo, 0);
-	          }
+	 if(SiS_CRT2IsLCD(SiS_Pr, HwInfo)) {
+	    if(SiS_Pr->SiS_VBType & VB_SIS301LV302LV) {
+	       SiS_SetRegOR(SiS_Pr->SiS_Part4Port,0x26,0x02);
+	    } else if(SiS_Pr->SiS_VBType & VB_NoLCD) {
+	       SiS_SetRegSR11ANDOR(SiS_Pr,HwInfo,0xFB,0x00);
+	    }
+	    if(SiS_Pr->SiS_VBType & (VB_SIS301LV302LV | VB_NoLCD)) {
+	       if(!(SiS_CR36BIOSWord23d(SiS_Pr, HwInfo))) {
+	          SiS_PanelDelay(SiS_Pr, HwInfo, 0);
 	       }
 	    }
+	 }
+
+	 if((SiS_Pr->SiS_VBType & VB_NoLCD) &&
+	    (SiS_CRT2IsLCD(SiS_Pr, HwInfo))) {
+
+	    SiS_SetRegOR(SiS_Pr->SiS_P3c4,0x1E,0x20);   		/* Enable CRT2 */
+            SiS_DisplayOn(SiS_Pr);
+	    SiS_UnLockCRT2(SiS_Pr,HwInfo);
+	    SiS_SetRegAND(SiS_Pr->SiS_Part1Port,0x02,0xBF);
+	    if(SiS_BridgeInSlavemode(SiS_Pr)) {
+      	       SiS_SetRegAND(SiS_Pr->SiS_Part1Port,0x01,0x1F);
+      	    } else {
+      	       SiS_SetRegANDOR(SiS_Pr->SiS_Part1Port,0x01,0x1F,0x40);
+            }
+	    if(!(SiS_GetReg(SiS_Pr->SiS_P3c4,0x13) & 0x40)) {
+	       if(!(SiS_GetReg(SiS_Pr->SiS_P3c4,0x16) & 0x10)) {
+		  if(!(SiS_CR36BIOSWord23b(SiS_Pr,HwInfo))) {
+		     SiS_PanelDelay(SiS_Pr, HwInfo, 1);
+                  }
+		  SiS_WaitVBRetrace(SiS_Pr,HwInfo);
+                  SiS_SetRegSR11ANDOR(SiS_Pr,HwInfo,0xF7,0x00);
+               }
+	    }
+
+	 } else {
+
 	    temp = SiS_GetReg(SiS_Pr->SiS_P3c4,0x32) & 0xDF;             /* lock mode */
-            if(SiS_BridgeInSlave(SiS_Pr)) {
+            if(SiS_BridgeInSlavemode(SiS_Pr)) {
                tempah = SiS_GetReg(SiS_Pr->SiS_P3d4,0x30);
-               if(!(tempah & SetCRT2ToRAMDAC))  temp |= 0x20;
+               if(!(tempah & SetCRT2ToRAMDAC)) temp |= 0x20;
             }
             SiS_SetReg(SiS_Pr->SiS_P3c4,0x32,temp);
 	    SiS_SetRegOR(SiS_Pr->SiS_P3c4,0x1E,0x20);
 	    SiS_SetRegANDOR(SiS_Pr->SiS_Part2Port,0x00,0x1F,0x20);        /* enable VB processor */
 	    SiS_SetRegOR(SiS_Pr->SiS_Part4Port,0x1F,0xC0);
 	    SiS_DisplayOn(SiS_Pr);
-	    if(SiS_CRT2IsLCD(SiS_Pr, HwInfo)) {
-	       if(SiS_Pr->SiS_VBType & VB_SIS301LV302LV) {
+	    if(SiS_Pr->SiS_VBType & VB_SIS301LV302LV) {
+	       if(SiS_CRT2IsLCD(SiS_Pr, HwInfo)) {
 	          if(!(SiS_GetReg(SiS_Pr->SiS_P3c4,0x16) & 0x10)) {
 		     if(!(SiS_CR36BIOSWord23b(SiS_Pr,HwInfo))) {
 		        SiS_PanelDelay(SiS_Pr, HwInfo, 1);
@@ -4234,440 +4161,279 @@ SiS_EnableBridge(SiS_Private *SiS_Pr, PSIS_HW_INFO HwInfo)
 	       }
 	    }
 
-	 } else {
+	 }
 
-	    if((SiS_Pr->SiS_VBType & VB_NoLCD) &&
-	       (SiS_CRT2IsLCD(SiS_Pr, HwInfo))) {
-	       /* This is only for LCD output on 301B-DH via LVDS */
-	       SiS_SetRegSR11ANDOR(SiS_Pr,HwInfo,0xFB,0x00);
-	       if(!(SiS_CR36BIOSWord23d(SiS_Pr,HwInfo))) {
-	          SiS_PanelDelay(SiS_Pr, HwInfo, 0);
-	       }
-	       SiS_SetRegOR(SiS_Pr->SiS_P3c4,0x1E,0x20);   /* Enable CRT2 */
-               SiS_DisplayOn(SiS_Pr);
-	       SiS_UnLockCRT2(SiS_Pr,HwInfo);
-	       SiS_SetRegAND(SiS_Pr->SiS_Part1Port,0x02,0xBF);
-	       if(SiS_BridgeInSlave(SiS_Pr)) {
-      		  SiS_SetRegAND(SiS_Pr->SiS_Part1Port,0x01,0x1F);
-      	       } else {
-      		  SiS_SetRegANDOR(SiS_Pr->SiS_Part1Port,0x01,0x1F,0x40);
-               }
-	       if(!(SiS_GetReg(SiS_Pr->SiS_P3c4,0x13) & 0x40)) {
-	           if(!(SiS_GetReg(SiS_Pr->SiS_P3c4,0x16) & 0x10)) {
-		       if(!(SiS_CR36BIOSWord23b(SiS_Pr,HwInfo))) {
-		           SiS_PanelDelay(SiS_Pr, HwInfo, 1);
-                       }
-		       SiS_WaitVBRetrace(SiS_Pr,HwInfo);
-                       SiS_SetRegSR11ANDOR(SiS_Pr,HwInfo,0xF7,0x00);
-                   }
-	       }
-            } else {
-	       temp = SiS_GetReg(SiS_Pr->SiS_P3c4,0x32) & 0xDF;             /* lock mode */
-               if(SiS_BridgeInSlave(SiS_Pr)) {
-                  tempah = SiS_GetReg(SiS_Pr->SiS_P3d4,0x30);
-                  if(!(tempah & SetCRT2ToRAMDAC))  temp |= 0x20;
-               }
-               SiS_SetReg(SiS_Pr->SiS_P3c4,0x32,temp);
-	       SiS_SetRegOR(SiS_Pr->SiS_P3c4,0x1E,0x20);
-	       SiS_SetRegANDOR(SiS_Pr->SiS_Part2Port,0x00,0x1F,0x20);        /* enable VB processor */
-	       SiS_SetRegOR(SiS_Pr->SiS_Part4Port,0x1F,0xC0);
-	       SiS_DisplayOn(SiS_Pr);
-	    }
 
-         }
 #endif /* SIS300 */
 
       } else {
 
 #ifdef SIS315H    /* 315 series */
 
-	 if(IS_SIS550650740660) {		/* 550, 650, 740, 660 */
-
-	    UCHAR r30=0, r31=0, r32=0, r33=0, cr36=0;
-
-	    if(SiS_Pr->SiS_VBType & VB_SIS301LV302LV) {
+#ifdef SET_EMI
+	 UCHAR   r30=0, r31=0, r32=0, r33=0, cr36=0;
+	 /* USHORT  emidelay=0; */
+#endif
 
-	       if((SiS_Pr->SiS_CustomT != CUT_COMPAQ1280) &&
-	          (SiS_Pr->SiS_CustomT != CUT_CLEVO1400)) {
-	          SiS_SetRegAND(SiS_Pr->SiS_Part4Port,0x1f,0xef);
+	 if(SiS_Pr->SiS_VBType & VB_SIS301LV302LV) {
+	    SiS_SetRegAND(SiS_Pr->SiS_Part4Port,0x1f,0xef);
 #ifdef SET_EMI
-		  if(SiS_Pr->SiS_VBType & (VB_SIS302LV | VB_SIS302ELV)) {
-	             SiS_SetRegAND(SiS_Pr->SiS_Part4Port,0x30,0x0c);
-		  }
+	    if(SiS_Pr->SiS_VBType & (VB_SIS302LV | VB_SIS302ELV)) {
+	       SiS_SetRegAND(SiS_Pr->SiS_Part4Port,0x30,0x0c);
+	    }
 #endif
-	       }
+	 }
 
-               if(!(SiS_IsNotM650orLater(SiS_Pr,HwInfo))) {
-	          tempah = 0x10;
-		  if(SiS_LCDAEnabled(SiS_Pr, HwInfo)) {
-		     if(SiS_TVEnabled(SiS_Pr, HwInfo)) tempah = 0x18;
-		     else 			       tempah = 0x08;
-		  }
-		  SiS_SetReg(SiS_Pr->SiS_Part1Port,0x4c,tempah);
-	       }
+         if(!(SiS_IsNotM650orLater(SiS_Pr, HwInfo))) {
+	    tempah = 0x10;
+	    if(SiS_LCDAEnabled(SiS_Pr, HwInfo)) {
+	       if(SiS_TVEnabled(SiS_Pr, HwInfo)) tempah = 0x18;
+	       else 			         tempah = 0x08;
+	    }
+	    SiS_SetReg(SiS_Pr->SiS_Part1Port,0x4c,tempah);
+	 }
 
-	       if((SiS_Pr->SiS_CustomT != CUT_COMPAQ1280) &&
-	          (SiS_Pr->SiS_CustomT != CUT_CLEVO1400)) {
-	          SiS_SetRegByte(SiS_Pr->SiS_P3c6,0x00);
-	          SiS_DisplayOff(SiS_Pr);
-	          pushax = SiS_GetReg(SiS_Pr->SiS_P3c4,0x06);
-	          if(IS_SIS740) {
-	             SiS_SetRegAND(SiS_Pr->SiS_P3c4,0x06,0xE3);
-	          }
-	       }
+	 if(SiS_Pr->SiS_VBType & VB_SIS301LV302LV) {
 
-	       if( (SiS_IsVAMode(SiS_Pr,HwInfo)) ||
-	           (SiS_CRT2IsLCD(SiS_Pr, HwInfo)) ) {
-                  if(!(SiS_GetReg(SiS_Pr->SiS_Part4Port,0x26) & 0x02)) {
-		     if((SiS_Pr->SiS_CustomT != CUT_COMPAQ1280) &&
-		        (SiS_Pr->SiS_CustomT != CUT_CLEVO1400)) {
-		        SiS_PanelDelayLoop(SiS_Pr, HwInfo, 3, 2);
-			SiS_SetRegOR(SiS_Pr->SiS_Part4Port,0x26,0x02);
-			if(SiS_Pr->SiS_VBType & (VB_SIS302LV | VB_SIS302ELV)) {
-			   SiS_GenericDelay(SiS_Pr, 0x4500);
-			}
-	                SiS_PanelDelayLoop(SiS_Pr, HwInfo, 3, 2);
-		     } else {
-		        SiS_SetRegOR(SiS_Pr->SiS_Part4Port,0x26,0x02);
-			SiS_PanelDelay(SiS_Pr, HwInfo, 0);
-		     }
-	          }
-	       }
+	    SiS_SetRegByte(SiS_Pr->SiS_P3c6,0x00);
+	    SiS_DisplayOff(SiS_Pr);
+	    pushax = SiS_GetReg(SiS_Pr->SiS_P3c4,0x06);
+	    if(IS_SIS740) {
+	       SiS_SetRegAND(SiS_Pr->SiS_P3c4,0x06,0xE3);
+	    }
 
-               if((SiS_Pr->SiS_CustomT != CUT_COMPAQ1280) &&
-	          (SiS_Pr->SiS_CustomT != CUT_CLEVO1400)) {
-	          if(!(SiS_GetReg(SiS_Pr->SiS_P3d4,0x31) & 0x40)) {
-                     SiS_PanelDelayLoop(SiS_Pr, HwInfo, 3, 10);
-		     delaylong = TRUE;
+	    if(SiS_IsVAorLCD(SiS_Pr, HwInfo)) {
+               if(!(SiS_GetReg(SiS_Pr->SiS_Part4Port,0x26) & 0x02)) {
+		  SiS_PanelDelayLoop(SiS_Pr, HwInfo, 3, 2);
+		  SiS_SetRegOR(SiS_Pr->SiS_Part4Port,0x26,0x02);
+		  SiS_PanelDelayLoop(SiS_Pr, HwInfo, 3, 2);
+		  if(SiS_Pr->SiS_VBType & (VB_SIS302LV | VB_SIS302ELV)) {
+		     SiS_GenericDelay(SiS_Pr, 0x4500);
 		  }
 	       }
+	    }
 
-	    } else if(SiS_Pr->SiS_VBType & VB_NoLCD) {
+	    if(!(SiS_GetReg(SiS_Pr->SiS_P3d4,0x31) & 0x40)) {
+               SiS_PanelDelayLoop(SiS_Pr, HwInfo, 3, 10);
+	       delaylong = TRUE;
+	    }
 
-	       if(!(SiS_IsNotM650orLater(SiS_Pr,HwInfo))) {
-	          SiS_SetRegOR(SiS_Pr->SiS_Part1Port,0x4c,0x10);
-	       }
+	 }
 
-  	    } else if(SiS_Pr->SiS_VBType & VB_SIS301B302B) {
+	 if(!(SiS_IsVAMode(SiS_Pr,HwInfo))) {
 
-	       if(!(SiS_IsNotM650orLater(SiS_Pr,HwInfo))) {
-	          tempah = 0x10;
-		  if(SiS_LCDAEnabled(SiS_Pr, HwInfo)) {
-		     if(SiS_TVEnabled(SiS_Pr, HwInfo)) tempah = 0x18;
-		     else 			       tempah = 0x08;
-		  }
-		  SiS_SetReg(SiS_Pr->SiS_Part1Port,0x4c,tempah);
+            temp = SiS_GetReg(SiS_Pr->SiS_P3c4,0x32) & 0xDF;
+	    if(SiS_BridgeInSlavemode(SiS_Pr)) {
+               tempah = SiS_GetReg(SiS_Pr->SiS_P3d4,0x30);
+               if(!(tempah & SetCRT2ToRAMDAC)) {
+		  if(!(SiS_LCDAEnabled(SiS_Pr, HwInfo))) temp |= 0x20;
 	       }
+            }
+            SiS_SetReg(SiS_Pr->SiS_P3c4,0x32,temp);
 
-	    }
-
-	    if(!(SiS_IsVAMode(SiS_Pr,HwInfo))) {
-               temp = SiS_GetReg(SiS_Pr->SiS_P3c4,0x32) & 0xDF;
-	       if(SiS_BridgeInSlave(SiS_Pr)) {
-                  tempah = SiS_GetReg(SiS_Pr->SiS_P3d4,0x30);
-                  if(!(tempah & SetCRT2ToRAMDAC)) {
-		     if(!(SiS_LCDAEnabled(SiS_Pr, HwInfo))) temp |= 0x20;
-		  }
-               }
-               SiS_SetReg(SiS_Pr->SiS_P3c4,0x32,temp);
+	    SiS_SetRegOR(SiS_Pr->SiS_P3c4,0x1E,0x20);                   /* enable CRT2 */
 
-	       SiS_SetRegOR(SiS_Pr->SiS_P3c4,0x1E,0x20);                   /* enable CRT2 */
+	    SiS_SetRegAND(SiS_Pr->SiS_Part1Port,0x2e,0x7f);
+	    SiS_SetRegOR(SiS_Pr->SiS_Part1Port,0x2e,0x80);
 
-	       if((SiS_Pr->SiS_VBType & VB_SIS301B302B) ||
-	          (SiS_Pr->SiS_CustomT == CUT_COMPAQ1280) ||
-		  (SiS_Pr->SiS_CustomT == CUT_CLEVO1400)) {
-	          SiS_SetRegAND(SiS_Pr->SiS_Part1Port,0x2e,0x7f);
-		  temp = SiS_GetReg(SiS_Pr->SiS_Part1Port,0x2e);
-		  if(!(temp & 0x80)) {
-		     SiS_SetRegOR(SiS_Pr->SiS_Part1Port,0x2e,0x80);
-		  }
-	       } else {
-	          SiS_PanelDelay(SiS_Pr, HwInfo, 2);
-	       }
-	    } else {
-	       SiS_SetRegOR(SiS_Pr->SiS_Part1Port,0x1e,0x20);
+	    if(SiS_Pr->SiS_VBType & VB_SIS301LV302LV) {
+	       SiS_PanelDelay(SiS_Pr, HwInfo, 2);
 	    }
 
-	    SiS_SetRegANDOR(SiS_Pr->SiS_Part2Port,0x00,0x1f,0x20);
+	 } else {
 
-	    if((SiS_Pr->SiS_VBType & VB_SIS301B302B) ||
-	       (SiS_Pr->SiS_CustomT == CUT_COMPAQ1280) ||
-	       (SiS_Pr->SiS_CustomT == CUT_CLEVO1400)) {
-	       temp = SiS_GetReg(SiS_Pr->SiS_Part1Port,0x2e);
-	       if(!(temp & 0x80)) {
-		  SiS_SetRegOR(SiS_Pr->SiS_Part1Port,0x2e,0x80);
-	       }
-	    }
+	    SiS_SetRegOR(SiS_Pr->SiS_Part1Port,0x1e,0x20);
 
-	    tempah = 0xc0;
-	    if(SiS_IsDualEdge(SiS_Pr, HwInfo)) {
-	       tempah = 0x80;
-	       if(!(SiS_IsVAMode(SiS_Pr, HwInfo))) {
-	          tempah = 0x40;
-               }
-	    }
-            SiS_SetRegOR(SiS_Pr->SiS_Part4Port,0x1F,tempah);
+	 }
 
-	    if((SiS_Pr->SiS_VBType & VB_SIS301B302B) ||
-	       (((SiS_Pr->SiS_CustomT == CUT_COMPAQ1280) ||
-	         (SiS_Pr->SiS_CustomT == CUT_CLEVO1400))     &&
-	        (!(SiS_WeHaveBacklightCtrl(SiS_Pr,HwInfo))))) {
-               SiS_SetRegAND(SiS_Pr->SiS_Part1Port,0x00,0x7f);
-	    }
+	 SiS_SetRegANDOR(SiS_Pr->SiS_Part2Port,0x00,0x1f,0x20);
+	 SiS_SetRegOR(SiS_Pr->SiS_Part1Port,0x2e,0x80);
 
-	    if(SiS_Pr->SiS_VBType & VB_SIS301LV302LV) {
+	 tempah = 0xc0;
+	 if(SiS_IsDualEdge(SiS_Pr, HwInfo)) {
+	    tempah = 0x80;
+	    if(!(SiS_IsVAMode(SiS_Pr, HwInfo))) tempah = 0x40;
+	 }
+         SiS_SetRegOR(SiS_Pr->SiS_Part4Port,0x1F,tempah);
 
-	       if((SiS_Pr->SiS_CustomT != CUT_COMPAQ1280) &&
-	          (SiS_Pr->SiS_CustomT != CUT_CLEVO1400)) {
-	          SiS_PanelDelay(SiS_Pr, HwInfo, 2);
-	       }
-#ifdef COMPAQ_HACK
-	       if(SiS_Pr->SiS_CustomT == CUT_COMPAQ1280) {
-	          SiS_PanelDelay(SiS_Pr, HwInfo, 2);
-	       }
-#endif
+	 if(SiS_Pr->SiS_VBType & VB_SIS301LV302LV) {
+
+	    SiS_PanelDelay(SiS_Pr, HwInfo, 2);
 
-	       SiS_SetRegOR(SiS_Pr->SiS_Part4Port,0x1f,0x10);
+	    SiS_SetRegOR(SiS_Pr->SiS_Part4Port,0x1f,0x10);
+	    SiS_SetRegOR(SiS_Pr->SiS_Part1Port,0x2e,0x80);
 
-	       if(SiS_Pr->SiS_CustomT != CUT_CLEVO1400) {
+	    if(SiS_Pr->SiS_CustomT != CUT_CLEVO1400) {
 #ifdef SET_EMI
-	          if(SiS_Pr->SiS_VBType & (VB_SIS302LV | VB_SIS302ELV)) {
-	             SiS_SetRegAND(SiS_Pr->SiS_Part4Port,0x30,0x0c);
-		  }
+	       if(SiS_Pr->SiS_VBType & (VB_SIS302LV | VB_SIS302ELV)) {
+	          SiS_SetRegAND(SiS_Pr->SiS_Part4Port,0x30,0x0c);
+	       }
 #endif
-	          SiS_SetRegOR(SiS_Pr->SiS_Part4Port,0x27,0x0c);
+	       SiS_SetRegOR(SiS_Pr->SiS_Part4Port,0x27,0x0c);
+
+	       if(SiS_Pr->SiS_VBType & (VB_SIS302LV | VB_SIS302ELV)) {
 #ifdef SET_EMI
-	          if(SiS_Pr->SiS_VBType & (VB_SIS302LV | VB_SIS302ELV)) {
-
-		     cr36 = SiS_GetReg(SiS_Pr->SiS_P3d4,0x36);
-
-		     /*                                              (P4_30|0x40)  */
-		     /* Compal 1400x1050: 0x05, 0x60, 0x00                YES  (1.10.7w;  CR36=69)      */
-		     /* Compal 1400x1050: 0x0d, 0x70, 0x40                YES  (1.10.7x;  CR36=69)      */
-		     /* Acer   1280x1024: 0x12, 0xd0, 0x6b                NO   (1.10.9k;  CR36=73)      */
-		     /* Compaq 1280x1024: 0x0d, 0x70, 0x6b                YES  (1.12.04b; CR36=03)      */
-		     /* Clevo   1024x768: 0x05, 0x60, 0x33                NO   (1.10.8e;  CR36=12, DL!) */
-		     /* Clevo   1024x768: 0x0d, 0x70, 0x40 (if type == 3) YES  (1.10.8y;  CR36=?2)      */
-		     /* Clevo   1024x768: 0x05, 0x60, 0x33 (if type != 3) YES  (1.10.8y;  CR36=?2)      */
-		     /* Asus    1024x768: ?                                ?   (1.10.8o;  CR36=?2)      */
-		     /* Asus    1024x768: 0x08, 0x10, 0x3c (problematic)  YES  (1.10.8q;  CR36=22)      */
-
-		     if(SiS_Pr->HaveEMI) {
-		        r30 = SiS_Pr->EMI_30;
-			r31 = SiS_Pr->EMI_31;
-			r32 = SiS_Pr->EMI_32;
-			r33 = SiS_Pr->EMI_33;
-		     } else {
-		        r30 = 0;
+		  cr36 = SiS_GetReg(SiS_Pr->SiS_P3d4,0x36);
+
+		  if(SiS_Pr->SiS_ROMNew) {
+		     UCHAR  *ROMAddr = HwInfo->pjVirtualRomBase;
+		     USHORT romptr   = GetLCDStructPtr661_2(SiS_Pr, HwInfo);
+		     if(romptr) {
+		        SiS_SetRegOR(SiS_Pr->SiS_Part4Port,0x30,0x20);
+			SiS_Pr->EMI_30 = 0;
+			SiS_Pr->EMI_31 = ROMAddr[romptr + 14];
+			SiS_Pr->EMI_32 = ROMAddr[romptr + 15];
+			SiS_Pr->EMI_33 = ROMAddr[romptr + 16];
+			if(ROMAddr[romptr + 1] & 0x10) SiS_Pr->EMI_30 = 0x40;
+			/* emidelay = SISGETROMW((romptr + 0x22)); */
+			SiS_Pr->HaveEMI = SiS_Pr->HaveEMILCD = SiS_Pr->OverruleEMI = TRUE;
 		     }
+		  }
 
-		     /* EMI_30 is read at driver start; however, the BIOS sets this
-		      * (if it is used) only if the LCD is in use. In case we caught
-		      * the machine while on TV output, this bit is not set and we
-		      * don't know if it should be set - hence our detection is wrong.
-		      * Work-around this here:
-		      */
-
-		     if((!SiS_Pr->HaveEMI) || (!SiS_Pr->HaveEMILCD)) {
-		        if((cr36 & 0x0f) == 0x02) {			/* 1024x768 */
-		           r30 |= 0x40;
-			   if(SiS_Pr->SiS_CustomT == CUT_CLEVO1024) {
-			      r30 &= ~0x40;
-			   }
-		        } else if((cr36 & 0x0f) == 0x03) {		/* 1280x1024 */
-		           r30 |= 0x40;
-			   if(SiS_Pr->SiS_CustomT != CUT_COMPAQ1280) {
-			      r30 &= ~0x40;
-			   }
-		        } else if((cr36 & 0x0f) == 0x09) {		/* 1400x1050 */
-		           r30 |= 0x40;
-		        } else if((cr36 & 0x0f) == 0x0b) {		/* 1600x1200 - unknown */
-		           r30 |= 0x40;
-		        }
-                     }
+		  /*                                              (P4_30|0x40)  */
+		  /* Compal 1400x1050: 0x05, 0x60, 0x00                YES  (1.10.7w;  CR36=69)      */
+		  /* Compal 1400x1050: 0x0d, 0x70, 0x40                YES  (1.10.7x;  CR36=69)      */
+		  /* Acer   1280x1024: 0x12, 0xd0, 0x6b                NO   (1.10.9k;  CR36=73)      */
+		  /* Compaq 1280x1024: 0x0d, 0x70, 0x6b                YES  (1.12.04b; CR36=03)      */
+		  /* Clevo   1024x768: 0x05, 0x60, 0x33                NO   (1.10.8e;  CR36=12, DL!) */
+		  /* Clevo   1024x768: 0x0d, 0x70, 0x40 (if type == 3) YES  (1.10.8y;  CR36=?2)      */
+		  /* Clevo   1024x768: 0x05, 0x60, 0x33 (if type != 3) YES  (1.10.8y;  CR36=?2)      */
+		  /* Asus    1024x768: ?                                ?   (1.10.8o;  CR36=?2)      */
+		  /* Asus    1024x768: 0x08, 0x10, 0x3c (problematic)  YES  (1.10.8q;  CR36=22)      */
+
+		  if(SiS_Pr->HaveEMI) {
+		     r30 = SiS_Pr->EMI_30; r31 = SiS_Pr->EMI_31;
+		     r32 = SiS_Pr->EMI_32; r33 = SiS_Pr->EMI_33;
+		  } else {
+		     r30 = 0;
+		  }
 
-		     if(!SiS_Pr->HaveEMI) {
-		        if((cr36 & 0x0f) == 0x02) {
+		  /* EMI_30 is read at driver start; however, the BIOS sets this
+		   * (if it is used) only if the LCD is in use. In case we caught
+		   * the machine while on TV output, this bit is not set and we
+		   * don't know if it should be set - hence our detection is wrong.
+		   * Work-around this here:
+		   */
+
+		  if((!SiS_Pr->HaveEMI) || (!SiS_Pr->HaveEMILCD)) {
+		     switch((cr36 & 0x0f)) {
+		     case 2:
+			r30 |= 0x40;
+			if(SiS_Pr->SiS_CustomT == CUT_CLEVO1024) r30 &= ~0x40;
+			if(!SiS_Pr->HaveEMI) {
+			   r31 = 0x05; r32 = 0x60; r33 = 0x33;
 			   if((cr36 & 0xf0) == 0x30) {
 			      r31 = 0x0d; r32 = 0x70; r33 = 0x40;
-			   } else {
-			      r31 = 0x05; r32 = 0x60; r33 = 0x33;
 			   }
-		        } else if((cr36 & 0x0f) == 0x03) {
+			}
+			break;
+		     case 3:  /* 1280x1024 */
+			if(SiS_Pr->SiS_CustomT == CUT_COMPAQ1280) r30 |= 0x40;
+			if(!SiS_Pr->HaveEMI) {
+			   r31 = 0x12; r32 = 0xd0; r33 = 0x6b;
 			   if(SiS_Pr->SiS_CustomT == CUT_COMPAQ1280) {
 			      r31 = 0x0d; r32 = 0x70; r33 = 0x6b;
-			   } else {
-			      r31 = 0x12; r32 = 0xd0; r33 = 0x6b;
 			   }
-			} else if((cr36 & 0x0f) == 0x09) {
+			}
+			break;
+		     case 9:  /* 1400x1050 */
+			r30 |= 0x40;
+			if(!SiS_Pr->HaveEMI) {
+			   r31 = 0x05; r32 = 0x60; r33 = 0x00;
 			   if(SiS_Pr->SiS_CustomT == CUT_COMPAL1400_2) {
 			      r31 = 0x0d; r32 = 0x70; r33 = 0x40;  /* BIOS values */
-			   } else {
-			      r31 = 0x05; r32 = 0x60; r33 = 0x00;
 			   }
-			} else {
+			}
+			break;
+		     case 11: /* 1600x1200 - unknown */
+			r30 |= 0x40;
+			if(!SiS_Pr->HaveEMI) {
 			   r31 = 0x05; r32 = 0x60; r33 = 0x00;
 			}
 		     }
+                  }
 
-		     /* BIOS values don't work so well sometimes */
-		     if(!SiS_Pr->OverruleEMI) {
+		  /* BIOS values don't work so well sometimes */
+		  if(!SiS_Pr->OverruleEMI) {
 #ifdef COMPAL_HACK
-		        if(SiS_Pr->SiS_CustomT == CUT_COMPAL1400_2) {
-		           if((cr36 & 0x0f) == 0x09) {
-			      r30 = 0x60; r31 = 0x05; r32 = 0x60; r33 = 0x00;
-			   }
- 		        }
+		     if(SiS_Pr->SiS_CustomT == CUT_COMPAL1400_2) {
+		        if((cr36 & 0x0f) == 0x09) {
+			   r30 = 0x60; r31 = 0x05; r32 = 0x60; r33 = 0x00;
+			}
+ 		     }
 #endif
 #ifdef COMPAQ_HACK
-		        if(SiS_Pr->SiS_CustomT == CUT_COMPAQ1280) {
-		           if((cr36 & 0x0f) == 0x03) {
-			      r30 = 0x20; r31 = 0x12; r32 = 0xd0; r33 = 0x6b;     /* rev 1 */
-			   }
+		     if(SiS_Pr->SiS_CustomT == CUT_COMPAQ1280) {
+		        if((cr36 & 0x0f) == 0x03) {
+			   r30 = 0x20; r31 = 0x12; r32 = 0xd0; r33 = 0x6b;
 			}
+		     }
 #endif
 #ifdef ASUS_HACK
-		        if(SiS_Pr->SiS_CustomT == CUT_ASUSA2H_2) {
-		           if((cr36 & 0x0f) == 0x02) {
-			      /* r30 = 0x60; r31 = 0x05; r32 = 0x60; r33 = 0x33;  */   /* rev 2 */
-			      /* r30 = 0x20; r31 = 0x05; r32 = 0x60; r33 = 0x33;  */   /* rev 3 */
-			      /* r30 = 0x60; r31 = 0x0d; r32 = 0x70; r33 = 0x40;  */   /* rev 4 */
-			      /* r30 = 0x20; r31 = 0x0d; r32 = 0x70; r33 = 0x40;  */   /* rev 5 */
-			   }
+		     if(SiS_Pr->SiS_CustomT == CUT_ASUSA2H_2) {
+		        if((cr36 & 0x0f) == 0x02) {
+			   /* r30 = 0x60; r31 = 0x05; r32 = 0x60; r33 = 0x33;  */   /* rev 2 */
+			   /* r30 = 0x20; r31 = 0x05; r32 = 0x60; r33 = 0x33;  */   /* rev 3 */
+			   /* r30 = 0x60; r31 = 0x0d; r32 = 0x70; r33 = 0x40;  */   /* rev 4 */
+			   /* r30 = 0x20; r31 = 0x0d; r32 = 0x70; r33 = 0x40;  */   /* rev 5 */
 			}
-#endif
- 		     }
-		     if(!(SiS_Pr->OverruleEMI && (!r30) && (!r31) && (!r32) && (!r33))) {
-		        SiS_SetRegOR(SiS_Pr->SiS_Part4Port,0x30,0x20);
 		     }
-		     SiS_SetReg(SiS_Pr->SiS_Part4Port,0x31,r31);
-		     SiS_SetReg(SiS_Pr->SiS_Part4Port,0x32,r32);
-		     SiS_SetReg(SiS_Pr->SiS_Part4Port,0x33,r33);
-		     if(!(SiS_Pr->OverruleEMI && (!r30) && (!r31) && (!r32) && (!r33))) {
-		        SiS_SetReg(SiS_Pr->SiS_Part4Port,0x34,0x10);
-		     } else {
-		        SiS_SetReg(SiS_Pr->SiS_Part4Port,0x34,0x00);
-		     }
-		     if( (SiS_IsVAMode(SiS_Pr,HwInfo)) ||
-	                 (SiS_CRT2IsLCD(SiS_Pr, HwInfo)) ) {
-	                if(r30 & 0x40) {
-		           SiS_PanelDelayLoop(SiS_Pr, HwInfo, 3, 5);
-			   if(delaylong) {
-			      SiS_PanelDelayLoop(SiS_Pr, HwInfo, 3, 5);
-			      delaylong = FALSE;
-			   }
-			   SiS_WaitVBRetrace(SiS_Pr,HwInfo);
-			   if(SiS_Pr->SiS_CustomT == CUT_ASUSA2H_2) {
-			      SiS_GenericDelay(SiS_Pr, 0x500);
-			   }
-	                   SiS_SetRegOR(SiS_Pr->SiS_Part4Port,0x30,0x40);
-	                }
-		     }
-		  }
 #endif
-	       }
-
-	       if(SiS_Pr->SiS_CustomT == CUT_COMPAQ1280) {
-
-	          if( (SiS_IsVAMode(SiS_Pr,HwInfo)) ||
-	              (SiS_CRT2IsLCD(SiS_Pr, HwInfo)) ) {
-		     SiS_DisplayOn(SiS_Pr);
-		     SiS_PanelDelay(SiS_Pr, HwInfo, 1);
-		     SiS_WaitVBRetrace(SiS_Pr, HwInfo);
-		     SiS_PanelDelay(SiS_Pr, HwInfo, 3);
-		     if(!(SiS_WeHaveBacklightCtrl(SiS_Pr,HwInfo))) {
-		        SiS_SetRegOR(SiS_Pr->SiS_Part4Port,0x26,0x01);
-	  	     }
-		  }
-
-	       } else if(SiS_Pr->SiS_CustomT == CUT_CLEVO1400) {
+ 		  }
 
-	          if(!(SiS_WeHaveBacklightCtrl(SiS_Pr,HwInfo))) {
-	             if( (SiS_IsVAMode(SiS_Pr, HwInfo)) ||
-	                 (SiS_CRT2IsLCD(SiS_Pr, HwInfo)) ) {
-		        SiS_DisplayOn(SiS_Pr);
-		        SiS_PanelDelay(SiS_Pr, HwInfo, 1);
-		        SiS_WaitVBRetrace(SiS_Pr,HwInfo);
-		        SiS_SetRegOR(SiS_Pr->SiS_Part4Port,0x26,0x01);
-		     }
+		  if(!(SiS_Pr->OverruleEMI && (!r30) && (!r31) && (!r32) && (!r33))) {
+		     SiS_SetRegOR(SiS_Pr->SiS_Part4Port,0x30,0x20);
 		  }
+		  SiS_SetReg(SiS_Pr->SiS_Part4Port,0x31,r31);
+		  SiS_SetReg(SiS_Pr->SiS_Part4Port,0x32,r32);
+		  SiS_SetReg(SiS_Pr->SiS_Part4Port,0x33,r33);
+#endif	/* SET_EMI */
 
-	       } else {
+		  SiS_SetReg(SiS_Pr->SiS_Part4Port,0x34,0x10);
 
-	          SiS_SetRegOR(SiS_Pr->SiS_Part1Port,0x2e,0x80);
-	          if(!(SiS_WeHaveBacklightCtrl(SiS_Pr,HwInfo))) {
-	             if( (SiS_IsVAMode(SiS_Pr,HwInfo)) ||
-	                 ((SiS_CRT2IsLCD(SiS_Pr, HwInfo))) ) {
-		        SiS_PanelDelayLoop(SiS_Pr, HwInfo, 3, 10);
-		        if(delaylong) {
-			   SiS_PanelDelayLoop(SiS_Pr, HwInfo, 3, 10);
-		        }
-                        SiS_WaitVBRetrace(SiS_Pr,HwInfo);
-			if(SiS_Pr->SiS_VBType & (VB_SIS302LV | VB_SIS302ELV)) {
+#ifdef SET_EMI
+		  if( (SiS_LCDAEnabled(SiS_Pr, HwInfo)) ||
+	              (SiS_CRT2IsLCD(SiS_Pr, HwInfo)) ) {
+	             if(r30 & 0x40) {
+		        SiS_PanelDelayLoop(SiS_Pr, HwInfo, 3, 5);
+			if(delaylong) {
+			   SiS_PanelDelayLoop(SiS_Pr, HwInfo, 3, 5);
+			   delaylong = FALSE;
+			}
+			SiS_WaitVBRetrace(SiS_Pr,HwInfo);
+			if(SiS_Pr->SiS_CustomT == CUT_ASUSA2H_2) {
 			   SiS_GenericDelay(SiS_Pr, 0x500);
 			}
-		        SiS_SetRegOR(SiS_Pr->SiS_Part4Port,0x26,0x01);
+	                SiS_SetRegOR(SiS_Pr->SiS_Part4Port,0x30,0x40);
 	             }
-	          }
-
-	          SiS_SetReg(SiS_Pr->SiS_P3c4,0x06,pushax);
-	          SiS_DisplayOn(SiS_Pr);
-	          SiS_SetRegByte(SiS_Pr->SiS_P3c6,0xff);
-
-	          if(!(SiS_WeHaveBacklightCtrl(SiS_Pr,HwInfo))) {
-	             SiS_SetRegAND(SiS_Pr->SiS_Part1Port,0x00,0x7f);
-	          }
-
+		  }
+#endif
 	       }
-
 	    }
 
-	 } else {			/* 315, 330 */
-
-	    if(!(SiS_IsVAMode(SiS_Pr,HwInfo))) {
-	       temp = SiS_GetReg(SiS_Pr->SiS_P3c4,0x32) & 0xDF;
-	       if(SiS_BridgeInSlave(SiS_Pr)) {
-                  tempah = SiS_GetReg(SiS_Pr->SiS_P3d4,0x30);
-                  if(!(tempah & SetCRT2ToRAMDAC))  temp |= 0x20;
-               }
-               SiS_SetReg(SiS_Pr->SiS_P3c4,0x32,temp);
-
-	       SiS_SetRegOR(SiS_Pr->SiS_P3c4,0x1E,0x20);                   /* enable CRT2 */
-
-	       temp = SiS_GetReg(SiS_Pr->SiS_Part1Port,0x2E);
-               if(!(temp & 0x80))
-                  SiS_SetRegOR(SiS_Pr->SiS_Part1Port,0x2E,0x80);
-            }
-
-	    SiS_SetRegANDOR(SiS_Pr->SiS_Part2Port,0x00,0x1f,0x20);
-
-	    if(SiS_Is301B(SiS_Pr)) {
-
-	       temp=SiS_GetReg(SiS_Pr->SiS_Part1Port,0x2E);
-               if(!(temp & 0x80))
-                  SiS_SetRegOR(SiS_Pr->SiS_Part1Port,0x2E,0x80);
-
-	       tempah = 0xc0;
-	       if(SiS_IsDualEdge(SiS_Pr,HwInfo)) {
-	          tempah = 0x80;
-	          if(!(SiS_IsVAMode(SiS_Pr,HwInfo))) {
-	             tempah = 0x40;
-                  }
+	    if(!(SiS_WeHaveBacklightCtrl(SiS_Pr,HwInfo))) {
+	       if(SiS_IsVAorLCD(SiS_Pr, HwInfo)) {
+		  SiS_PanelDelayLoop(SiS_Pr, HwInfo, 3, 10);
+		  if(delaylong) {
+		     SiS_PanelDelayLoop(SiS_Pr, HwInfo, 3, 10);
+		  }
+                  SiS_WaitVBRetrace(SiS_Pr,HwInfo);
+		  if(SiS_Pr->SiS_VBType & (VB_SIS302LV | VB_SIS302ELV)) {
+	 	     SiS_GenericDelay(SiS_Pr, 0x500);
+		  }
+		  SiS_SetRegOR(SiS_Pr->SiS_Part4Port,0x26,0x01);
 	       }
-               SiS_SetRegOR(SiS_Pr->SiS_Part4Port,0x1F,tempah);
-
-	       SiS_SetRegAND(SiS_Pr->SiS_Part1Port,0x00,0x7f);
-
-	    } else {
+	    }
 
-	       SiS_VBLongWait(SiS_Pr);
-               SiS_DisplayOn(SiS_Pr);
-	       SiS_SetRegAND(SiS_Pr->SiS_Part1Port,0x00,0x7F);
-               SiS_VBLongWait(SiS_Pr);
+	    SiS_SetReg(SiS_Pr->SiS_P3c4,0x06,pushax);
+	    SiS_DisplayOn(SiS_Pr);
+	    SiS_SetRegByte(SiS_Pr->SiS_P3c6,0xff);
 
-	    }
+	 }
 
-	 }   /* 315, 330 */
+	 if(!(SiS_WeHaveBacklightCtrl(SiS_Pr,HwInfo))) {
+	    SiS_SetRegAND(SiS_Pr->SiS_Part1Port,0x00,0x7f);
+	 }
 
 #endif /* SIS315H */
 
@@ -4683,9 +4449,9 @@ SiS_EnableBridge(SiS_Private *SiS_Pr, PSIS_HW_INFO HwInfo)
        }
 
        temp = SiS_GetReg(SiS_Pr->SiS_P3c4,0x32) & 0xDF;          /* lock mode */
-       if(SiS_BridgeInSlave(SiS_Pr)) {
+       if(SiS_BridgeInSlavemode(SiS_Pr)) {
           tempah = SiS_GetReg(SiS_Pr->SiS_P3d4,0x30);
-          if(!(tempah & SetCRT2ToRAMDAC))  temp |= 0x20;
+          if(!(tempah & SetCRT2ToRAMDAC)) temp |= 0x20;
        }
        SiS_SetReg(SiS_Pr->SiS_P3c4,0x32,temp);
 
@@ -4734,11 +4500,11 @@ SiS_EnableBridge(SiS_Private *SiS_Pr, PSIS_HW_INFO HwInfo)
 	  }
        }
 
-       SiS_EnableCRT2(SiS_Pr);
+       SiS_SetRegOR(SiS_Pr->SiS_P3c4,0x1E,0x20);
        SiS_DisplayOn(SiS_Pr);
        SiS_UnLockCRT2(SiS_Pr,HwInfo);
        SiS_SetRegAND(SiS_Pr->SiS_Part1Port,0x02,0xBF);
-       if(SiS_BridgeInSlave(SiS_Pr)) {
+       if(SiS_BridgeInSlavemode(SiS_Pr)) {
       	  SiS_SetRegAND(SiS_Pr->SiS_Part1Port,0x01,0x1F);
        } else {
       	  SiS_SetRegANDOR(SiS_Pr->SiS_Part1Port,0x01,0x1F,0x40);
@@ -4770,6 +4536,10 @@ SiS_EnableBridge(SiS_Private *SiS_Pr, PSIS_HW_INFO HwInfo)
 
 #ifdef SIS315H    /* 315 series */
 
+       if(!(SiS_IsNotM650orLater(SiS_Pr,HwInfo))) {
+          SiS_SetRegOR(SiS_Pr->SiS_Part1Port,0x4c,0x18);
+       }
+
        if(SiS_Pr->SiS_IF_DEF_CH70xx == 0) {
 	  if(SiS_CRT2IsLCD(SiS_Pr, HwInfo)) {
 	     SiS_SetRegSR11ANDOR(SiS_Pr,HwInfo,0xFB,0x00);
@@ -4777,7 +4547,7 @@ SiS_EnableBridge(SiS_Private *SiS_Pr, PSIS_HW_INFO HwInfo)
           }
        }
 
-       SiS_EnableCRT2(SiS_Pr);
+       SiS_SetRegOR(SiS_Pr->SiS_P3c4,0x1E,0x20);
        SiS_UnLockCRT2(SiS_Pr,HwInfo);
 
        SiS_SetRegAND(SiS_Pr->SiS_Part1Port,0x2e,0xf7);
@@ -4868,33 +4638,31 @@ SiS_EnableBridge(SiS_Private *SiS_Pr, PSIS_HW_INFO HwInfo)
 /*         SET PART 1 REGISTER GROUP         */
 /*********************************************/
 
-/********** Set CRT2 OFFSET / PITCH **********/
+/* Set CRT2 OFFSET / PITCH */
 static void
-SiS_SetCRT2Offset(SiS_Private *SiS_Pr,USHORT ModeNo,
-                  USHORT ModeIdIndex ,USHORT RefreshRateTableIndex,
-	          PSIS_HW_INFO HwInfo)
+SiS_SetCRT2Offset(SiS_Private *SiS_Pr, USHORT ModeNo, USHORT ModeIdIndex,
+	          USHORT RRTI, PSIS_HW_INFO HwInfo)
 {
   USHORT offset;
   UCHAR temp;
 
   if(SiS_Pr->SiS_VBInfo & SetInSlaveMode) return;
 
-  offset = SiS_GetOffset(SiS_Pr, ModeNo, ModeIdIndex, RefreshRateTableIndex,
-                         HwInfo);
+  offset = SiS_GetOffset(SiS_Pr,ModeNo,ModeIdIndex,RRTI,HwInfo);
 
-  if(SiS_Pr->SiS_LCDResInfo == SiS_Pr->SiS_Panel640x480_2 ||
-     SiS_Pr->SiS_LCDResInfo == SiS_Pr->SiS_Panel640x480_3) offset >>= 1;
+  if((SiS_Pr->SiS_LCDResInfo == Panel_640x480_2) ||
+     (SiS_Pr->SiS_LCDResInfo == Panel_640x480_3)) {
+     offset >>= 1;
+  }
 
-  temp = (UCHAR)(offset & 0xFF);
-  SiS_SetReg(SiS_Pr->SiS_Part1Port,0x07,temp);
-  temp = (UCHAR)(offset >> 8);
-  SiS_SetReg(SiS_Pr->SiS_Part1Port,0x09,temp);
+  SiS_SetReg(SiS_Pr->SiS_Part1Port,0x07,(offset & 0xFF));
+  SiS_SetReg(SiS_Pr->SiS_Part1Port,0x09,(offset >> 8));
   temp = (UCHAR)(((offset >> 3) & 0xFF) + 1);
   if(offset % 8) temp++;
   SiS_SetReg(SiS_Pr->SiS_Part1Port,0x03,temp);
 }
 
-/************* Set CRT2 Sync *************/
+/* Set CRT2 sync and PanelLink mode */
 static void
 SiS_SetCRT2Sync(SiS_Private *SiS_Pr, USHORT ModeNo, USHORT RefreshRateTableIndex,
                 PSIS_HW_INFO HwInfo)
@@ -4916,23 +4684,27 @@ SiS_SetCRT2Sync(SiS_Private *SiS_Pr, USHORT ModeNo, USHORT RefreshRateTableIndex
      } else if((SiS_Pr->SiS_VBInfo & SetCRT2ToLCD) && (SiS_Pr->SiS_LCDInfo & LCDSync)) {
         tempah = SiS_Pr->SiS_LCDInfo;
      } else tempah = infoflag >> 8;
-
      tempah &= 0xC0;
-
      tempah |= 0x20;
      if(!(SiS_Pr->SiS_LCDInfo & LCDRGB18Bit)) tempah |= 0x10;
-
      if(SiS_Pr->SiS_VBInfo & SetCRT2ToLCD) {
         if((SiS_Pr->SiS_CustomT == CUT_BARCO1366) ||
            (SiS_Pr->SiS_CustomT == CUT_BARCO1024)) {
-	   tempah |= 0xc0;
+	   tempah |= 0xf0;
+        }
+	if( (SiS_Pr->SiS_IF_DEF_FSTN) ||
+            (SiS_Pr->SiS_IF_DEF_DSTN) ||
+            (SiS_Pr->SiS_IF_DEF_TRUMPION) ||
+            (SiS_Pr->SiS_CustomT == CUT_PANEL848) ) {
+           tempah |= 0x30;
         }
      }
-
      if(SiS_Pr->SiS_VBInfo & SetCRT2ToTV) {
         if(HwInfo->jChipType >= SIS_315H) {
            tempah >>= 3;
+	   tempah &= 0x18;
            SiS_SetRegANDOR(SiS_Pr->SiS_Part1Port,0x13,0xE7,tempah);
+	   /* Don't care about 12/18/24 bit mode - TV is via VGA, not PL */
         } else {
            SiS_SetRegANDOR(SiS_Pr->SiS_Part1Port,0x19,0x0F,0xe0);
         }
@@ -4949,19 +4721,21 @@ SiS_SetCRT2Sync(SiS_Private *SiS_Pr, USHORT ModeNo, USHORT RefreshRateTableIndex
         if(SiS_Pr->SiS_VBType & VB_SIS301BLV302BLV) {			/* 630 - 301B(-DH) */
 
 	   tempah = infoflag >> 8;
+	   tempbl = 0;
            if(SiS_Pr->SiS_VBInfo & SetCRT2ToLCD) {
 	      if(SiS_Pr->SiS_LCDInfo & LCDSync) {
 	         tempah = SiS_Pr->SiS_LCDInfo;
+		 tempbl = (tempah >> 6) & 0x03;
               }
            }
            tempah &= 0xC0;
-
            tempah |= 0x20;
            if(!(SiS_Pr->SiS_LCDInfo & LCDRGB18Bit)) tempah |= 0x10;
-
- 	   tempah &= 0x3f;
-  	   tempah |= tempbl;
+  	   tempah |= 0xc0;
            SiS_SetRegANDOR(SiS_Pr->SiS_Part1Port,0x19,0x0F,tempah);
+	   if((SiS_Pr->SiS_VBInfo & SetCRT2ToLCD) && (!(SiS_Pr->SiS_VBType & VB_NoLCD))) {
+	      SiS_SetRegANDOR(SiS_Pr->SiS_Part2Port,0x1a,0xf0,tempbl);
+	   }
 
         } else {							/* 630 - 301 */
 
@@ -4979,43 +4753,72 @@ SiS_SetCRT2Sync(SiS_Private *SiS_Pr, USHORT ModeNo, USHORT RefreshRateTableIndex
 
 #ifdef SIS315H  /* ------- 315 series ------ */
 
-        if(SiS_Pr->SiS_VBType & VB_SIS301LV302LV) {	  		/* 315 - 30xLV */
+        if(SiS_Pr->SiS_VBType & VB_SIS301LV302LV) {	  		/* 315 - LVDS */
 
-	   if(((SiS_Pr->SiS_CustomT == CUT_COMPAQ1280) &&
-	       (SiS_Pr->SiS_LCDResInfo == SiS_Pr->SiS_Panel1280x1024)) ||
-	      ((SiS_Pr->SiS_CustomT == CUT_CLEVO1400)  &&
-	       (SiS_Pr->SiS_LCDResInfo == SiS_Pr->SiS_Panel1400x1050))) {
+	   tempbl = 0;
+	   if((SiS_Pr->SiS_CustomT == CUT_COMPAQ1280) &&
+	      (SiS_Pr->SiS_LCDResInfo == Panel_1280x1024)) {
 	      tempah = infoflag >> 8;
+	      if(SiS_Pr->SiS_LCDInfo & LCDSync) {
+	        tempbl = ((SiS_Pr->SiS_LCDInfo & 0xc0) >> 6);
+	      }
+	   } else if((SiS_Pr->SiS_CustomT == CUT_CLEVO1400)  &&
+	             (SiS_Pr->SiS_LCDResInfo == Panel_1400x1050)) {
+       	      tempah = infoflag >> 8;
+	      tempbl = 0x03;
 	   } else {
               tempah = SiS_GetReg(SiS_Pr->SiS_P3d4,0x37);
+	      tempbl = (tempah >> 6) & 0x03;
+	      tempbl |= 0x08;
+	      if(!(SiS_Pr->SiS_LCDInfo & LCDRGB18Bit)) tempbl |= 0x04;
 	   }
 	   tempah &= 0xC0;
-
            tempah |= 0x20;
            if(!(SiS_Pr->SiS_LCDInfo & LCDRGB18Bit)) tempah |= 0x10;
+	   if(SiS_Pr->SiS_VBInfo & SetCRT2ToLCDA)   tempah |= 0xc0;
            SiS_SetRegANDOR(SiS_Pr->SiS_Part1Port,0x19,0x0F,tempah);
+	   if(SiS_Pr->SiS_VBType & VB_SIS301BLV302BLV) {
+	      if(SiS_Pr->SiS_VBInfo & SetCRT2ToLCD) {
+	         SiS_SetRegANDOR(SiS_Pr->SiS_Part2Port,0x1a,0xf0,tempbl);
+	      }
+	   }
 
-        } else {							/* 315 - 301, 301B */
+        } else {							/* 315 - TMDS */
 
-           tempah = infoflag >> 8;
+           tempah = tempbl = infoflag >> 8;
 	   if(!SiS_Pr->UseCustomMode) {
-	      if(SiS_Pr->SiS_VBInfo & SetCRT2ToLCD) {
+	      tempbl = 0;
+	      if((SiS_Pr->SiS_VBType & VB_SIS301C) && (SiS_Pr->SiS_VBInfo & SetCRT2ToRAMDAC)) {
+	         if(ModeNo <= 0x13) {
+	            tempah = SiS_GetRegByte((SiS_Pr->SiS_P3ca+0x02));
+  	         }
+	      }
+	      if(SiS_Pr->SiS_VBInfo & (SetCRT2ToLCD | SetCRT2ToLCDA)) {
 	         if(SiS_Pr->SiS_LCDInfo & LCDSync) {
 	            tempah = SiS_Pr->SiS_LCDInfo;
+		    tempbl = (tempah >> 6) & 0x03;
 	         }
 	      }
 	   }
 	   tempah &= 0xC0;
-
            tempah |= 0x20;
            if(!(SiS_Pr->SiS_LCDInfo & LCDRGB18Bit)) tempah |= 0x10;
-
-	   if(SiS_Pr->SiS_VBType & VB_NoLCD) {			/* TEST, imitate BIOS bug */
-	      if(SiS_Pr->SiS_VBInfo & SetCRT2ToTV) {
-	         tempah |= 0xc0;
+	   if(SiS_Pr->SiS_VBType & VB_NoLCD) {
+	      /* Imitate BIOS bug */
+	      if(SiS_Pr->SiS_VBInfo & SetCRT2ToTV)  tempah |= 0xc0;
+	   }
+	   if((SiS_Pr->SiS_VBType & VB_SIS301C) && (SiS_Pr->SiS_VBInfo & SetCRT2ToRAMDAC)) {
+	      tempah >>= 3;
+	      tempah &= 0x18;
+	      SiS_SetRegANDOR(SiS_Pr->SiS_Part1Port,0x13,0xe7,tempah);
+	   } else {
+              SiS_SetRegANDOR(SiS_Pr->SiS_Part1Port,0x19,0x0F,tempah);
+	      if(SiS_Pr->SiS_VBType & VB_SIS301BLV302BLV) {
+	         if(SiS_Pr->SiS_VBInfo & SetCRT2ToLCD) {
+	            SiS_SetRegANDOR(SiS_Pr->SiS_Part2Port,0x1a,0xf0,tempbl);
+		 }
 	      }
 	   }
-           SiS_SetRegANDOR(SiS_Pr->SiS_Part1Port,0x19,0x0F,tempah);
 
         }
 #endif  /* SIS315H */
@@ -5023,7 +4826,7 @@ SiS_SetCRT2Sync(SiS_Private *SiS_Pr, USHORT ModeNo, USHORT RefreshRateTableIndex
    }
 }
 
-/******** Set CRT2 FIFO on 300/630/730 *******/
+/* Set CRT2 FIFO on 300/630/730 */
 #ifdef SIS300
 static void
 SiS_SetCRT2FIFO_300(SiS_Private *SiS_Pr,USHORT ModeNo,
@@ -5078,7 +4881,7 @@ SiS_SetCRT2FIFO_300(SiS_Private *SiS_Pr,USHORT ModeNo,
 
   if(!SiS_Pr->CRT1UsesCustomMode) {
 
-     CRT1ModeNo = SiS_Pr->SiS_CRT1Mode;                                 	/* get CRT1 ModeNo */
+     CRT1ModeNo = SiS_Pr->SiS_CRT1Mode;                                 /* get CRT1 ModeNo */
      SiS_SearchModeID(SiS_Pr, &CRT1ModeNo, &modeidindex);
      SiS_Pr->SiS_SetFlag &= (~ProgrammingCRT2);
      SiS_Pr->SiS_SelectCRT2Rate = 0;
@@ -5087,7 +4890,7 @@ SiS_SetCRT2FIFO_300(SiS_Private *SiS_Pr,USHORT ModeNo,
      if(CRT1ModeNo >= 0x13) {
         index = SiS_Pr->SiS_RefIndex[refreshratetableindex].Ext_CRTVCLK;
         index &= 0x3F;
-        VCLK = SiS_Pr->SiS_VCLKData[index].CLOCK;				/* Get VCLK */
+        VCLK = SiS_Pr->SiS_VCLKData[index].CLOCK;			/* Get VCLK */
 
 	colorth = SiS_GetColorDepth(SiS_Pr,CRT1ModeNo,modeidindex); 	/* Get colordepth */
         colorth >>= 1;
@@ -5097,9 +4900,9 @@ SiS_SetCRT2FIFO_300(SiS_Private *SiS_Pr,USHORT ModeNo,
   } else {
 
      CRT1ModeNo = 0xfe;
-     VCLK = SiS_Pr->CSRClock_CRT1;						/* Get VCLK */
+     VCLK = SiS_Pr->CSRClock_CRT1;					/* Get VCLK */
      data2 = (SiS_Pr->CModeFlag_CRT1 & ModeInfoFlag) - 2;
-     switch(data2) {								/* Get color depth */
+     switch(data2) {							/* Get color depth */
         case 0 : colorth = 1; break;
         case 1 : colorth = 1; break;
         case 2 : colorth = 2; break;
@@ -5246,10 +5049,10 @@ SiS_SetCRT2FIFO_300(SiS_Private *SiS_Pr,USHORT ModeNo,
 
        index = SiS_GetVCLK2Ptr(SiS_Pr,CRT2ModeNo,modeidindex,
                                refreshratetableindex,HwInfo);
-       VCLK = SiS_Pr->SiS_VCLKData[index].CLOCK;                         	/* Get VCLK  */
+       VCLK = SiS_Pr->SiS_VCLKData[index].CLOCK;                /* Get VCLK  */
 
        if((SiS_Pr->SiS_CustomT == CUT_BARCO1366) || (SiS_Pr->SiS_CustomT == CUT_BARCO1024)) {
-          if((ROMAddr) && SiS_Pr->SiS_UseROM) {
+          if(SiS_Pr->SiS_UseROM) {
 	     if(ROMAddr[0x220] & 0x01) {
                 VCLK = ROMAddr[0x229] | (ROMAddr[0x22a] << 8);
 	     }
@@ -5259,11 +5062,11 @@ SiS_SetCRT2FIFO_300(SiS_Private *SiS_Pr,USHORT ModeNo,
     } else {
 
        CRT2ModeNo = 0xfe;
-       VCLK = SiS_Pr->CSRClock;							/* Get VCLK */
+       VCLK = SiS_Pr->CSRClock;					/* Get VCLK */
 
     }
 
-    colorth = SiS_GetColorDepth(SiS_Pr,CRT2ModeNo,modeidindex);   	/* Get colordepth */
+    colorth = SiS_GetColorDepth(SiS_Pr,CRT2ModeNo,modeidindex); /* Get colordepth */
     colorth >>= 1;
     if(!colorth) colorth++;
 
@@ -5282,8 +5085,8 @@ SiS_SetCRT2FIFO_300(SiS_Private *SiS_Pr,USHORT ModeNo,
     if(HwInfo->jChipType == SIS_300) {
        if(data <= 0x0f) temp = (temp & (~0x1F)) | 0x13;
        else             temp = (temp & (~0x1F)) | 0x16;
-       if(SiS_Pr->SiS_LCDResInfo == SiS_Pr->SiS_Panel1280x1024) {
-       		temp = (temp & (~0x1F)) | 0x13;
+       if(SiS_Pr->SiS_LCDResInfo == Panel_1280x1024) {
+       	  temp = (temp & (~0x1F)) | 0x13;
        }
     } else {
        if( ( (HwInfo->jChipType == SIS_630) ||
@@ -5313,350 +5116,105 @@ SiS_SetCRT2FIFO_300(SiS_Private *SiS_Pr,USHORT ModeNo,
 }
 #endif
 
-/**** Set CRT2 FIFO on 315/330 series ****/
+/* Set CRT2 FIFO on 315/330 series */
 #ifdef SIS315H
 static void
-SiS_SetCRT2FIFO_310(SiS_Private *SiS_Pr)
+SiS_SetCRT2FIFO_310(SiS_Private *SiS_Pr, PSIS_HW_INFO HwInfo)
 {
   SiS_SetReg(SiS_Pr->SiS_Part1Port,0x01,0x3B);
-  SiS_SetRegANDOR(SiS_Pr->SiS_Part1Port,0x02,~0x3F,0x04);
+  if( (HwInfo->jChipType == SIS_760)      &&
+      (SiS_Pr->SiS_SysFlags & SF_760LFB)  &&
+      (SiS_Pr->SiS_ModeType == Mode32Bpp) &&
+      (SiS_Pr->SiS_VGAHDE >= 1280)	  &&
+      (SiS_Pr->SiS_VGAVDE >= 1024) ) {
+     SiS_SetReg(SiS_Pr->SiS_Part1Port,0x2f,0x03);
+     SiS_SetReg(SiS_Pr->SiS_Part1Port,0x01,0x3b);
+     SiS_SetReg(SiS_Pr->SiS_Part1Port,0x4d,0xc0);
+     SiS_SetReg(SiS_Pr->SiS_Part1Port,0x2f,0x01);
+     SiS_SetReg(SiS_Pr->SiS_Part1Port,0x4d,0xc0);
+     SiS_SetReg(SiS_Pr->SiS_Part1Port,0x02,0x6e);
+  } else {
+     SiS_SetRegANDOR(SiS_Pr->SiS_Part1Port,0x02,~0x3f,0x04);
+  }
+
 }
 #endif
 
-/*************** Set LCD-A ***************/
-#ifdef SIS315H
-static void
-SiS_SetGroup1_LCDA(SiS_Private *SiS_Pr, USHORT ModeNo, USHORT ModeIdIndex,
-                   PSIS_HW_INFO HwInfo, USHORT RefreshRateTableIndex)
+static USHORT
+SiS_GetVGAHT2(SiS_Private *SiS_Pr)
 {
-  USHORT modeflag,resinfo;
-  USHORT push2,tempax,tempbx,tempcx,temp;
-  ULONG tempeax=0,tempebx,tempecx,tempvcfact;
+  ULONG tempax,tempbx;
 
-  /* This is not supported with LCDA */
-  if(SiS_Pr->SiS_LCDResInfo == SiS_Pr->SiS_PanelCustom) return;
-  if(SiS_Pr->UseCustomMode) return;
+  tempbx = (SiS_Pr->SiS_VGAVT - SiS_Pr->SiS_VGAVDE) * SiS_Pr->SiS_RVBHCMAX;
+  tempax = (SiS_Pr->SiS_VT - SiS_Pr->SiS_VDE) * SiS_Pr->SiS_RVBHCFACT;
+  tempax = (tempax * SiS_Pr->SiS_HT) / tempbx;
+  return((USHORT)tempax);
+}
 
-  if(IS_SIS330) {
-     SiS_SetRegOR(SiS_Pr->SiS_Part1Port,0x2D,0x10);			/* Xabre 1.01.03 */
-  } else if(IS_SIS740) {
-     if(SiS_Pr->SiS_IF_DEF_LVDS == 1) {					/* 740/LVDS */
-        SiS_SetRegANDOR(SiS_Pr->SiS_Part1Port,0x13,0xfb,0x04);      	/* 740/LVDS */
-	SiS_SetRegOR(SiS_Pr->SiS_Part1Port,0x2D,0x03);
-     } else if(SiS_Pr->SiS_VBType & VB_SISVB) {
-        SiS_SetRegOR(SiS_Pr->SiS_Part1Port,0x2D,0x10);			/* 740/301LV, 301BDH */
-     }
-  } else {
-     if(SiS_Pr->SiS_IF_DEF_LVDS == 1) {					/* 650/LVDS */
-        SiS_SetRegANDOR(SiS_Pr->SiS_Part1Port,0x13,0xfb,0x04);      	/* 650/LVDS */
-	SiS_SetRegOR(SiS_Pr->SiS_Part1Port,0x2D,0x00);			/* 650/LVDS 1.10.07 */
-     } else if(SiS_Pr->SiS_VBType & VB_SISVB) {
-        SiS_SetRegAND(SiS_Pr->SiS_Part1Port,0x2D,0x0f);			/* 650/30xLv 1.10.6s */
-     }
-  }
+/* Set Part 1 / SiS bridge slave mode */
+static void
+SiS_SetGroup1_301(SiS_Private *SiS_Pr, USHORT ModeNo,USHORT ModeIdIndex,
+                  PSIS_HW_INFO HwInfo,USHORT RefreshRateTableIndex)
+{
+  USHORT  push1,push2;
+  USHORT  tempax,tempbx,tempcx,temp;
+  USHORT  resinfo,modeflag,xres=0;
+  unsigned char p1_7, p1_8;
 
   if(ModeNo <= 0x13) {
      modeflag = SiS_Pr->SiS_SModeIDTable[ModeIdIndex].St_ModeFlag;
      resinfo = SiS_Pr->SiS_SModeIDTable[ModeIdIndex].St_ResInfo;
+  } else if(SiS_Pr->UseCustomMode) {
+     modeflag = SiS_Pr->CModeFlag;
+     resinfo = 0;
+     xres = SiS_Pr->CHDisplay;
   } else {
      modeflag = SiS_Pr->SiS_EModeIDTable[ModeIdIndex].Ext_ModeFlag;
      resinfo = SiS_Pr->SiS_EModeIDTable[ModeIdIndex].Ext_RESINFO;
+     xres = SiS_Pr->SiS_RefIndex[RefreshRateTableIndex].XRes;
   }
 
-  tempax = SiS_Pr->SiS_LCDHDES;
-
-  temp = (tempax & 0x0007);                        		/* BPLHDESKEW[2:0]   */
-  SiS_SetReg(SiS_Pr->SiS_Part1Port,0x1A,temp);                         /* Part1_1Ah  */
-  temp = (tempax >> 3) & 0x00FF;                               	/* BPLHDESKEW[10:3]  */
-  SiS_SetReg(SiS_Pr->SiS_Part1Port,0x16,temp);                         /* Part1_16h  */
+  /* The following is only done if bridge is in slave mode: */
 
-  tempbx = SiS_Pr->SiS_HDE;
-  if(SiS_Pr->SiS_LCDInfo & DontExpandLCD) {
-     tempbx = SiS_Pr->PanelXRes;
+  if((HwInfo->jChipType >= SIS_661) && (ModeNo > 0x13)) {
+     if(xres >= 1600) {
+        SiS_SetRegOR(SiS_Pr->SiS_P3c4,0x31,0x04);
+     }
   }
 
-  tempax += tempbx;	                                    	/* HDE + HSKEW = lcdhdee  */
-  if(tempax >= SiS_Pr->SiS_HT) tempax -= SiS_Pr->SiS_HT;
-
-  temp = tempax;
-  if(SiS_Pr->SiS_VBType & VB_SISVB) {
-     if(temp & 0x07) temp += 8;
-  }
-  temp >>= 3;                                        		/* BPLHDEE  */
-  SiS_SetReg(SiS_Pr->SiS_Part1Port,0x17,temp);                        	/* Part1_17h  */
+  SiS_SetReg(SiS_Pr->SiS_Part1Port,0x03,0xff);                  /* set MAX HT */
 
-  tempcx = (SiS_Pr->SiS_HT - tempbx) >> 2;     	            	/* (HT-HDE) / 4  */
+  if(SiS_Pr->SiS_VBType & VB_SIS301BLV302BLV)  modeflag |= Charx8Dot;
 
-  /* 650/30xLV 1.10.6s, 740/LVDS */
-  if( ((SiS_Pr->SiS_VBType & VB_SISVB) && (SiS_Pr->SiS_VBInfo & SetCRT2ToLCDA)) ||
-      ((SiS_Pr->SiS_IF_DEF_LVDS == 1) && (SiS_Pr->SiS_VBInfo & SetCRT2ToLCD)) ) {
-     if(SiS_Pr->SiS_LCDResInfo != SiS_Pr->SiS_Panel640x480) {
-        if(SiS_Pr->SiS_LCDResInfo == SiS_Pr->SiS_Panel800x600)        tempcx = 0x28;
- 	else if(SiS_Pr->SiS_LCDResInfo == SiS_Pr->SiS_Panel1024x768)  tempcx = 0x18;
-	else if(SiS_Pr->SiS_LCDResInfo == SiS_Pr->SiS_Panel1400x1050) tempcx = 0x30;
-	else if(SiS_Pr->SiS_LCDResInfo == SiS_Pr->SiS_Panel1600x1200) tempcx = 0x40;
-	else                                                          tempcx = 0x30;
-     }
-  }
+  if(modeflag & Charx8Dot) tempcx = 0x08;
+  else                     tempcx = 0x09;
 
-  tempcx += tempax;  	                                  	/* lcdhrs  */
-  if(tempcx >= SiS_Pr->SiS_HT) tempcx -= SiS_Pr->SiS_HT;
+  tempax = SiS_Pr->SiS_VGAHDE;                                 	/* 0x04 Horizontal Display End */
+  if(modeflag & HalfDCLK) tempax >>= 1;
+  tempax = ((tempax / tempcx) - 1) & 0xff;
+  tempbx = tempax;
 
-  temp = (tempcx >> 3) & 0x00FF;				/* BPLHRS */
-  SiS_SetReg(SiS_Pr->SiS_Part1Port,0x14,temp);                 		/* Part1_14h  */
+  temp = tempax;
+  SiS_SetReg(SiS_Pr->SiS_Part1Port,0x04,temp);
 
-  temp += 10;
-  if(SiS_Pr->SiS_IF_DEF_LVDS == 1) {
-     if(SiS_Pr->SiS_VBInfo & SetCRT2ToLCD) {
-        if(SiS_Pr->SiS_LCDResInfo != SiS_Pr->SiS_Panel640x480) {
-	   temp += 6;
-	   if(SiS_Pr->SiS_LCDResInfo != SiS_Pr->SiS_Panel800x600) {
-	      temp++;
-	      if(SiS_Pr->SiS_LCDResInfo != SiS_Pr->SiS_Panel1024x768) {
-	         temp += 7;
-		 if(SiS_Pr->SiS_LCDResInfo != SiS_Pr->SiS_Panel1600x1200) {
-		    temp -= 10;
-		 }
-	      }
-	   }
-	}
+  if(SiS_Pr->SiS_VBInfo & SetCRT2ToTV) {
+     if(!(SiS_Pr->SiS_VBType & VB_SIS301BLV302BLV)) {
+        temp += 2;
      }
   }
-  temp &= 0x1F;
-  temp |= ((tempcx & 0x07) << 5);
-  SiS_SetReg(SiS_Pr->SiS_Part1Port,0x15,temp);                         /* Part1_15h  */
-
-  if(SiS_Pr->SiS_IF_DEF_TRUMPION == 0) {
-     tempax = SiS_Pr->PanelYRes;
-  } else {
-     tempax = SiS_Pr->SiS_VGAVDE;
+  if(SiS_Pr->SiS_VBInfo & SetCRT2ToHiVision) {
+     if(resinfo == SIS_RI_800x600) temp -= 2;
   }
+  SiS_SetReg(SiS_Pr->SiS_Part1Port,0x05,temp);                 /* 0x05 Horizontal Display Start */
 
-  tempbx = SiS_Pr->SiS_LCDVDES + tempax;
-  if(tempbx >= SiS_Pr->SiS_VT) tempbx -= SiS_Pr->SiS_VT;
-  push2 = tempbx;
-
-  tempcx = (SiS_Pr->SiS_VGAVT - SiS_Pr->SiS_VGAVDE) >> 2;
+  SiS_SetReg(SiS_Pr->SiS_Part1Port,0x06,0x03);                 /* 0x06 Horizontal Blank end     */
 
-  if( ((SiS_Pr->SiS_VBType & VB_SISVB) && (SiS_Pr->SiS_VBInfo & SetCRT2ToLCDA)) ||
-      ((SiS_Pr->SiS_IF_DEF_LVDS == 1) && (SiS_Pr->SiS_VBInfo & SetCRT2ToLCD)) ) {
-     if(SiS_Pr->SiS_LCDResInfo != SiS_Pr->SiS_Panel640x480) {
-        if(SiS_Pr->SiS_LCDResInfo == SiS_Pr->SiS_Panel800x600)         tempcx = 1;
-   	else if(SiS_Pr->SiS_LCDResInfo == SiS_Pr->SiS_Panel1024x768)   tempcx = 3;
-	else if(SiS_Pr->SiS_LCDResInfo == SiS_Pr->SiS_Panel1280x768)   tempcx = 3;
-	else if(SiS_Pr->SiS_LCDResInfo == SiS_Pr->SiS_Panel1280x1024)  tempcx = 1;
-	else if(SiS_Pr->SiS_LCDResInfo == SiS_Pr->SiS_Panel1400x1050)  tempcx = 1;
-	else if(SiS_Pr->SiS_LCDResInfo == SiS_Pr->SiS_Panel1600x1200)  tempcx = 1;
-	else                                                           tempcx = 0x0057;
-     }
-  }
-
-  tempbx += tempcx;
-  if(SiS_Pr->SiS_VBType & VB_SISVB) {
-     tempbx++;                                                	/* BPLVRS  */
-  }
-  if(tempbx >= SiS_Pr->SiS_VT) tempbx -= SiS_Pr->SiS_VT;
-  temp = tempbx & 0x00FF;
-  SiS_SetReg(SiS_Pr->SiS_Part1Port,0x18,temp);                             /* Part1_18h  */
-
-  tempcx >>= 3;
-  if(SiS_Pr->SiS_IF_DEF_LVDS == 1) {
-     if(SiS_Pr->SiS_VBInfo & SetCRT2ToLCD) {
-        if(SiS_Pr->SiS_LCDResInfo != SiS_Pr->SiS_Panel640x480) {
-	   if(SiS_Pr->SiS_LCDResInfo == SiS_Pr->SiS_Panel800x600)         tempcx = 3;
-   	   else if(SiS_Pr->SiS_LCDResInfo == SiS_Pr->SiS_Panel1024x768)   tempcx = 5;
-	   else if(SiS_Pr->SiS_LCDResInfo == SiS_Pr->SiS_Panel1280x768)   tempcx = 5;
-	   else if(SiS_Pr->SiS_LCDResInfo == SiS_Pr->SiS_Panel1280x1024)  tempcx = 5;
-	   else if(SiS_Pr->SiS_LCDResInfo == SiS_Pr->SiS_Panel1400x1050)  tempcx = 2;
-	   else if(SiS_Pr->SiS_LCDResInfo == SiS_Pr->SiS_Panel1600x1200)  tempcx = 2;
-	}
-     }
-  }
-  tempcx += tempbx;
-  tempcx++;                                                	/* BPLVRE  */
-  temp = tempcx & 0x000F;
-  if(SiS_Pr->SiS_VBType & VB_SISVB) {
-     temp |= 0xC0;
-     SiS_SetRegANDOR(SiS_Pr->SiS_Part1Port,0x19,0xF0,temp); 		/* Part1_19h  */
-  } else {
-     SiS_SetRegANDOR(SiS_Pr->SiS_Part1Port,0x19,0xF0,temp);
-  }
-
-  temp = ((tempbx >> 8) & 0x07) << 3;
-  if(SiS_Pr->SiS_VGAVDE != SiS_Pr->SiS_VDE) temp |= 0x40;
-  if(SiS_Pr->SiS_SetFlag & EnableLVDSDDA)   temp |= 0x40;
-  if(SiS_Pr->SiS_VBType & VB_SISVB) {
-     /* Don't check Part1Port,0x00 -> is not being set if LCDA! */
-     /* We check SR06 instead here: */
-     if(SiS_Pr->SiS_LCDInfo & LCDRGB18Bit) {
-        if(SiS_GetReg(SiS_Pr->SiS_P3c4,0x06) & 0x10) temp |= 0x80;
-     }
-  } else {
-     if(SiS_Pr->SiS_LCDInfo & LCDRGB18Bit) {
-        if(SiS_GetReg(SiS_Pr->SiS_Part1Port,0x00) & 0x01) temp |= 0x80;
-     }
-  }
-  SiS_SetRegANDOR(SiS_Pr->SiS_Part1Port,0x1A,0x07,temp);            /* Part1_1Ah */
-
-  tempbx = push2;                                      		/* BPLVDEE */
-
-  tempcx = SiS_Pr->SiS_LCDVDES;                        		/* NPLVDES */
-  if(!(SiS_Pr->SiS_VBInfo & SetInSlaveMode)) {
-     if(SiS_Pr->SiS_LCDResInfo == SiS_Pr->SiS_Panel800x600) {
-        if(resinfo == SIS_RI_800x600) tempcx++;
-     }
-  }
-  if(SiS_Pr->SiS_LCDResInfo == SiS_Pr->SiS_Panel640x480) {
-     tempbx = tempcx = SiS_Pr->SiS_VGAVDE;
-     tempbx--;
-  }
-
-  temp = ((tempbx >> 8) & 0x07) << 3;
-  temp = temp | ((tempcx >> 8) & 0x07);
-  SiS_SetReg(SiS_Pr->SiS_Part1Port,0x1D,temp);                          /* Part1_1Dh */
-  temp = tempbx & 0x00FF;
-  SiS_SetReg(SiS_Pr->SiS_Part1Port,0x1C,temp);                          /* Part1_1Ch  */
-  temp = tempcx & 0x00FF;
-  SiS_SetReg(SiS_Pr->SiS_Part1Port,0x1B,temp);                          /* Part1_1Bh  */
-
-  tempeax = SiS_Pr->SiS_VGAVDE << 18;
-  tempebx = SiS_Pr->SiS_VDE;
-  temp = (USHORT)(tempeax % tempebx);
-  tempeax = tempeax / tempebx;
-  if(temp) tempeax++;
-  tempvcfact = tempeax;
-
-  temp = (USHORT)(tempeax & 0x00FF);
-  SiS_SetReg(SiS_Pr->SiS_Part1Port,0x37,temp);
-
-  temp = (USHORT)((tempeax & 0x00FF00) >> 8);
-  SiS_SetReg(SiS_Pr->SiS_Part1Port,0x36,temp);
-
-  temp = (USHORT)((tempeax & 0x00030000) >> 16);
-  if(SiS_Pr->SiS_VDE == SiS_Pr->SiS_VGAVDE) temp |= 0x04;
-  SiS_SetReg(SiS_Pr->SiS_Part1Port,0x35,temp);
-
-  if(SiS_Pr->SiS_VBType & (VB_SIS301C | VB_SIS302ELV)) {
-     temp = (USHORT)(tempeax & 0x00FF);
-     SiS_SetReg(SiS_Pr->SiS_Part4Port,0x3c,temp);
-     temp = (USHORT)((tempeax & 0x00FF00) >> 8);
-     SiS_SetReg(SiS_Pr->SiS_Part4Port,0x3b,temp);
-     temp = (USHORT)(((tempeax & 0x00030000) >> 16) << 6);
-     SiS_SetRegANDOR(SiS_Pr->SiS_Part4Port,0x3a,0x3f,temp);
-     temp = 0;
-     if(SiS_Pr->SiS_VDE != SiS_Pr->SiS_VGAVDE) temp |= 0x08;
-     SiS_SetRegANDOR(SiS_Pr->SiS_Part4Port,0x30,0xf3,temp);
-  }
-
-  tempeax = SiS_Pr->SiS_VGAHDE << 16;
-  tempebx = SiS_Pr->SiS_HDE;
-  temp = tempeax % tempebx;
-  tempeax /= tempebx;
-  if(temp) tempeax++;
-  if(tempebx == SiS_Pr->SiS_VGAHDE) tempeax = 0xFFFF;
-  tempecx = tempeax;
-  tempeax = ((SiS_Pr->SiS_VGAHDE << 16) / tempecx) - 1;
-  tempecx = (tempecx << 16) | (tempeax & 0xFFFF);
-  temp = (USHORT)(tempecx & 0x00FF);
-  SiS_SetReg(SiS_Pr->SiS_Part1Port,0x1F,temp);                          /* Part1_1Fh  */
-
-  tempeax = (SiS_Pr->SiS_VGAVDE << 18) / tempvcfact;
-  tempbx = (USHORT)(tempeax & 0x0FFFF);
-
-  if(SiS_Pr->SiS_LCDResInfo == SiS_Pr->SiS_Panel1024x768) tempbx--;
-
-  if(SiS_Pr->SiS_SetFlag & EnableLVDSDDA)  tempbx = 1;
-
-  temp = ((tempbx >> 8) & 0x07) << 3;
-  temp = temp | ((tempecx >> 8) & 0x07);
-  SiS_SetReg(SiS_Pr->SiS_Part1Port,0x20,temp);                         /* Part1_20h */
-
-  temp = tempbx & 0x00FF;
-  SiS_SetReg(SiS_Pr->SiS_Part1Port,0x21,temp);                         /* Part1_21h */
-
-  tempecx >>= 16;   	                                  	/* BPLHCFACT  */
-  if(modeflag & HalfDCLK) tempecx >>= 1;
-  temp = (USHORT)((tempecx & 0x0000FF00) >> 8);
-  SiS_SetReg(SiS_Pr->SiS_Part1Port,0x22,temp);                         /* Part1_22h */
-
-  temp = (USHORT)(tempecx & 0x000000FF);
-  SiS_SetReg(SiS_Pr->SiS_Part1Port,0x23,temp);
-
-  if((SiS_Pr->SiS_IF_DEF_LVDS == 1) || (SiS_Pr->SiS_VBInfo & VB_SIS301LV302LV)) {
-     SiS_SetReg(SiS_Pr->SiS_Part1Port,0x1e,0x20);
-  }
-}
-#endif  /* SIS 315 */
-
-static USHORT
-SiS_GetVGAHT2(SiS_Private *SiS_Pr)
-{
-  ULONG tempax,tempbx;
-
-  tempbx = ((SiS_Pr->SiS_VGAVT - SiS_Pr->SiS_VGAVDE) * SiS_Pr->SiS_RVBHCMAX) & 0xFFFF;
-  tempax = (SiS_Pr->SiS_VT - SiS_Pr->SiS_VDE) * SiS_Pr->SiS_RVBHCFACT;
-  tempax = (tempax * SiS_Pr->SiS_HT) / tempbx;
-  return((USHORT) tempax);
-}
-
-/******* Set Part 1 / SiS bridge *********/
-static void
-SiS_SetGroup1_301(SiS_Private *SiS_Pr, USHORT ModeNo,USHORT ModeIdIndex,
-                  PSIS_HW_INFO HwInfo,USHORT RefreshRateTableIndex)
-{
-  USHORT  push1,push2;
-  USHORT  tempax,tempbx,tempcx,temp;
-  USHORT  resinfo,modeflag;
-  unsigned char p1_7, p1_8;
-
-  if(ModeNo <= 0x13) {
-     modeflag = SiS_Pr->SiS_SModeIDTable[ModeIdIndex].St_ModeFlag;
-     resinfo = SiS_Pr->SiS_SModeIDTable[ModeIdIndex].St_ResInfo;
-  } else {
-     if(SiS_Pr->UseCustomMode) {
-        modeflag = SiS_Pr->CModeFlag;
-	resinfo = 0;
-     } else {
-    	modeflag = SiS_Pr->SiS_EModeIDTable[ModeIdIndex].Ext_ModeFlag;
-    	resinfo = SiS_Pr->SiS_EModeIDTable[ModeIdIndex].Ext_RESINFO;
-     }
-  }
-
-  /* The following is only done if bridge is in slave mode: */
-
-  SiS_SetReg(SiS_Pr->SiS_Part1Port,0x03,0xff);                  /* set MAX HT */
-
-  if(SiS_Pr->SiS_VBType & VB_SIS301BLV302BLV)  modeflag |= Charx8Dot;
-
-  if(modeflag & Charx8Dot) tempcx = 0x08;
-  else                     tempcx = 0x09;
-
-  tempax = SiS_Pr->SiS_VGAHDE;                                 	/* 0x04 Horizontal Display End */
-  if(modeflag & HalfDCLK) tempax >>= 1;
-  tempax = ((tempax / tempcx) - 1) & 0xff;
-  tempbx = tempax;
-
-  temp = tempax;
-  SiS_SetReg(SiS_Pr->SiS_Part1Port,0x04,temp);
-
-  if(SiS_Pr->SiS_VBInfo & SetCRT2ToTV) {
-     if(!(SiS_Pr->SiS_VBType & VB_SIS301BLV302BLV)) {
-        temp += 2;
-     }
-  }
-  if(SiS_Pr->SiS_VBInfo & SetCRT2ToHiVision) {
-     if(resinfo == SIS_RI_800x600) temp -= 2;
-  }
-  SiS_SetReg(SiS_Pr->SiS_Part1Port,0x05,temp);                 /* 0x05 Horizontal Display Start */
-
-  SiS_SetReg(SiS_Pr->SiS_Part1Port,0x06,0x03);                 /* 0x06 Horizontal Blank end     */
-
-  tempax = 0xFFFF;
-  if(!(SiS_Pr->SiS_VBInfo & SetCRT2ToTV)) tempax = SiS_GetVGAHT2(SiS_Pr);
-  if(tempax >= SiS_Pr->SiS_VGAHT) tempax = SiS_Pr->SiS_VGAHT;
-  if(modeflag & HalfDCLK)         tempax >>= 1;
-  tempax = (tempax / tempcx) - 5;
-  tempcx = tempax;
+  tempax = 0xFFFF;
+  if(!(SiS_Pr->SiS_VBInfo & SetCRT2ToTV)) tempax = SiS_GetVGAHT2(SiS_Pr);
+  if(tempax >= SiS_Pr->SiS_VGAHT) tempax = SiS_Pr->SiS_VGAHT;
+  if(modeflag & HalfDCLK)         tempax >>= 1;
+  tempax = (tempax / tempcx) - 5;
+  tempcx = tempax;
 
   if(SiS_Pr->SiS_VBInfo & SetCRT2ToHiVision) {
      temp = tempcx - 1;
@@ -5684,21 +5242,20 @@ SiS_SetGroup1_301(SiS_Private *SiS_Pr, USHORT ModeNo,USHORT ModeIdIndex,
      } else {
         if(!(modeflag & HalfDCLK)) {
            temp -= 4;
-           if((SiS_Pr->SiS_LCDResInfo != SiS_Pr->SiS_Panel1280x960) &&
-	      (SiS_Pr->SiS_LCDResInfo != SiS_Pr->SiS_Panel1600x1200)) {
+           if((SiS_Pr->SiS_LCDResInfo != Panel_1280x960) &&
+	      (SiS_Pr->SiS_LCDResInfo != Panel_1600x1200)) {
               if(SiS_Pr->SiS_VGAHDE >= 800) {
                  temp -= 7;
 	         if(HwInfo->jChipType < SIS_315H) {
-	            /* 650/301LV(x) does not do this, 630/301B, 300/301LV do */
                     if(SiS_Pr->SiS_ModeType == ModeEGA) {
                        if(SiS_Pr->SiS_VGAVDE == 1024) {
                           temp += 15;
-                          if(SiS_Pr->SiS_LCDResInfo != SiS_Pr->SiS_Panel1280x1024)
+                          if(SiS_Pr->SiS_LCDResInfo != Panel_1280x1024)
 		  	     temp += 7;
                        }
                     }
 	         }
-		 if(SiS_Pr->SiS_LCDResInfo != SiS_Pr->SiS_Panel1400x1050) {
+		 if(SiS_Pr->SiS_LCDResInfo != Panel_1400x1050) {
                     if(SiS_Pr->SiS_VGAHDE >= 1280) {
                        if(SiS_Pr->SiS_LCDInfo & DontExpandLCD) temp += 28;
 		    }
@@ -5762,6 +5319,10 @@ SiS_SetGroup1_301(SiS_Private *SiS_Pr, USHORT ModeNo,USHORT ModeIdIndex,
 	      p1_7 = 0xab;
 	   }
 	}
+     } else {
+        if(SiS_Pr->SiS_TVMode & TVSetYPbPr525p) {
+	   if(modeflag & HalfDCLK) p1_7 = 0x30;
+	}
      }
   }
 
@@ -5784,7 +5345,7 @@ SiS_SetGroup1_301(SiS_Private *SiS_Pr, USHORT ModeNo,USHORT ModeIdIndex,
   else if(tempbx == 525) tempbx = 480;
   push2 = tempbx;
   if(SiS_Pr->SiS_VBInfo & SetCRT2ToLCD) {
-     if(SiS_Pr->SiS_LCDResInfo == SiS_Pr->SiS_Panel1024x768) {
+     if(SiS_Pr->SiS_LCDResInfo == Panel_1024x768) {
       	if(!(SiS_Pr->SiS_SetFlag & LCDVESATiming)) {
            if     (tempbx == 350) tempbx += 5;
            else if(tempbx == 480) tempbx += 5;
@@ -5830,7 +5391,7 @@ SiS_SetGroup1_301(SiS_Private *SiS_Pr, USHORT ModeNo,USHORT ModeIdIndex,
 	tempbx += (tempax << 1);
      }
   } else if(HwInfo->jChipType >= SIS_315H) {
-     if(SiS_Pr->SiS_LCDResInfo != SiS_Pr->SiS_Panel1400x1050) {
+     if(SiS_Pr->SiS_LCDResInfo != Panel_1400x1050) {
 	tempbx += (tempax << 1);
      }
   }
@@ -5907,521 +5468,465 @@ SiS_SetGroup1_301(SiS_Private *SiS_Pr, USHORT ModeNo,USHORT ModeIdIndex,
      }
   }
   SiS_SetReg(SiS_Pr->SiS_Part1Port,0x1A,temp);                	/* 0x1A SR0E */
+
+  temp = SiS_GetRegByte((SiS_Pr->SiS_P3ca+0x02));
+  SiS_SetReg(SiS_Pr->SiS_Part1Port,0x1b,temp);
 }
 
-/*********** Set Part 1 / LVDS ***********/
+/* Setup panel link
+ * This is used for LVDS, LCDA and Chrontel TV output
+ * 300/LVDS+TV, 300/301B-DH, 315/LVDS+TV, 315/LCDA
+ */
 static void
 SiS_SetGroup1_LVDS(SiS_Private *SiS_Pr, USHORT ModeNo, USHORT ModeIdIndex,
- 		   PSIS_HW_INFO HwInfo, USHORT RefreshRateTableIndex)
+                   PSIS_HW_INFO HwInfo, USHORT RefreshRateTableIndex)
 {
-  USHORT modeflag, resinfo;
-  USHORT push1, push2, tempax, tempbx, tempcx, temp;
+  USHORT modeflag,resinfo;
+  USHORT push2,tempax,tempbx,tempcx,temp;
+  ULONG tempeax=0,tempebx,tempecx,tempvcfact=0;
+  BOOLEAN islvds = FALSE, issis  = FALSE, chkdclkfirst = FALSE;
+#ifdef SIS300
+  USHORT crt2crtc;
+#endif
 #ifdef SIS315H
   USHORT pushcx;
 #endif
-  ULONG  tempeax=0, tempebx, tempecx, tempvcfact=0;
-
-  /* This is not supported on LVDS */
-  if(SiS_Pr->SiS_LCDResInfo == SiS_Pr->SiS_PanelCustom) return;
-  if(SiS_Pr->UseCustomMode) return;
 
   if(ModeNo <= 0x13) {
      modeflag = SiS_Pr->SiS_SModeIDTable[ModeIdIndex].St_ModeFlag;
      resinfo = SiS_Pr->SiS_SModeIDTable[ModeIdIndex].St_ResInfo;
+#ifdef SIS300
+     crt2crtc = SiS_Pr->SiS_SModeIDTable[ModeIdIndex].St_CRT2CRTC;
+#endif
+  } else if(SiS_Pr->UseCustomMode) {
+     modeflag = SiS_Pr->CModeFlag;
+     resinfo = 0;
+#ifdef SIS300
+     crt2crtc = 0;
+#endif
   } else {
      modeflag = SiS_Pr->SiS_EModeIDTable[ModeIdIndex].Ext_ModeFlag;
      resinfo = SiS_Pr->SiS_EModeIDTable[ModeIdIndex].Ext_RESINFO;
+#ifdef SIS300
+     crt2crtc = SiS_Pr->SiS_SModeIDTable[ModeIdIndex].St_CRT2CRTC;
+#endif
   }
 
-  /* Set up Panel Link */
-
-  /* 1. Horizontal setup */
-
-  tempax = SiS_Pr->SiS_LCDHDES;
-
-  if((!SiS_Pr->SiS_IF_DEF_FSTN) && (!SiS_Pr->SiS_IF_DEF_DSTN)) {
-     if( (SiS_Pr->SiS_LCDResInfo == SiS_Pr->SiS_Panel640x480) &&
-         (!(SiS_Pr->SiS_VBInfo & SetInSlaveMode)) ) {
-  	   tempax -= 8;
-     }
+  /* is lvds if really LVDS, or SiS 301B-DH with external LVDS transmitter */
+  if((SiS_Pr->SiS_IF_DEF_LVDS == 1) ||
+     ((SiS_Pr->SiS_VBType & VB_SISVB) && (SiS_Pr->SiS_VBType & VB_NoLCD))) {
+     islvds = TRUE;
   }
 
-  tempcx = SiS_Pr->SiS_HT;    				  /* Horiz. Total */
-
-  tempbx = SiS_Pr->SiS_HDE;                               /* Horiz. Display End */
+  /* is really sis if sis bridge, but not 301B-DH */
+  if((SiS_Pr->SiS_VBType & VB_SISVB) && (!(SiS_Pr->SiS_VBType & VB_NoLCD))) {
+     issis = TRUE;
+  }
 
-  if(SiS_Pr->SiS_LCDResInfo == SiS_Pr->SiS_Panel640x480_2 ||
-     SiS_Pr->SiS_LCDResInfo == SiS_Pr->SiS_Panel640x480_3) {
-     tempbx >>= 1;
+  if((HwInfo->jChipType >= SIS_315H) && (islvds) && (!(SiS_Pr->SiS_VBInfo & SetCRT2ToLCDA))) {
+     if((!SiS_Pr->SiS_IF_DEF_FSTN) && (!SiS_Pr->SiS_IF_DEF_DSTN)) {
+        chkdclkfirst = TRUE;
+     }
   }
 
-  if(!(SiS_Pr->SiS_LCDInfo & LCDPass11)) {
-     if(SiS_Pr->SiS_LCDInfo & DontExpandLCD) {
-        if(SiS_Pr->SiS_IF_DEF_FSTN || SiS_Pr->SiS_IF_DEF_DSTN) {
-	   tempbx = SiS_Pr->PanelXRes;
-	} else if(SiS_Pr->SiS_LCDResInfo != SiS_Pr->SiS_Panel640x480) {
-	   tempbx = SiS_Pr->PanelXRes;
-	   if(SiS_Pr->SiS_CustomT == CUT_BARCO1024) {
-	      tempbx = 800;
-	      if(SiS_Pr->SiS_LCDResInfo != SiS_Pr->SiS_Panel800x600) {
-	         tempbx = 1024;
+#ifdef SIS315H
+  if((HwInfo->jChipType >= SIS_315H) && (SiS_Pr->SiS_VBInfo & SetCRT2ToLCDA)) {
+     if(IS_SIS330) {
+        SiS_SetRegOR(SiS_Pr->SiS_Part1Port,0x2D,0x10);
+     } else if(IS_SIS740) {
+        if(islvds) {
+           SiS_SetRegANDOR(SiS_Pr->SiS_Part1Port,0x13,0xfb,0x04);
+	   SiS_SetRegOR(SiS_Pr->SiS_Part1Port,0x2D,0x03);
+        } else if(SiS_Pr->SiS_VBType & VB_SISVB) {
+           SiS_SetRegOR(SiS_Pr->SiS_Part1Port,0x2D,0x10);
+        }
+     } else {
+        if(islvds) {
+           SiS_SetRegANDOR(SiS_Pr->SiS_Part1Port,0x13,0xfb,0x04);
+	   SiS_SetRegOR(SiS_Pr->SiS_Part1Port,0x2D,0x00);
+        } else if(SiS_Pr->SiS_VBType & VB_SISVB) {
+           SiS_SetRegAND(SiS_Pr->SiS_Part1Port,0x2D,0x0f);
+	   if(SiS_Pr->SiS_VBType & VB_SIS301C) {
+	      if((SiS_Pr->SiS_LCDResInfo == Panel_1024x768) ||
+	         (SiS_Pr->SiS_LCDResInfo == Panel_1280x1024)) {
+	         SiS_SetRegOR(SiS_Pr->SiS_Part1Port,0x2D,0x20);
 	      }
 	   }
         }
      }
   }
-  tempcx = (tempcx - tempbx) >> 2;		 /* HT-HDE / 4 */
-
-  push1 = tempax;
-
-  tempax += tempbx;
-
-  if(tempax >= SiS_Pr->SiS_HT) tempax -= SiS_Pr->SiS_HT;
+#endif
 
-  push2 = tempax;
+  /* Horizontal */
 
-  if((!SiS_Pr->SiS_IF_DEF_FSTN) &&
-     (!SiS_Pr->SiS_IF_DEF_DSTN) &&
-     (SiS_Pr->SiS_CustomT != CUT_BARCO1366) &&
-     (SiS_Pr->SiS_CustomT != CUT_BARCO1024) &&
-     (SiS_Pr->SiS_CustomT != CUT_PANEL848)) {
-     if(!(SiS_Pr->SiS_LCDInfo & LCDPass11)) {
-        if(SiS_Pr->SiS_VBInfo & SetCRT2ToLCD) {
-           if(SiS_Pr->SiS_LCDResInfo != SiS_Pr->SiS_Panel640x480) {
-     	      if(SiS_Pr->SiS_LCDResInfo == SiS_Pr->SiS_Panel800x600)        tempcx = 0x0028;
-	      else if(SiS_Pr->SiS_LCDResInfo == SiS_Pr->SiS_Panel1024x600)  tempcx = 0x0018;
-     	      else if( (SiS_Pr->SiS_LCDResInfo == SiS_Pr->SiS_Panel1024x768) ||
-	            (SiS_Pr->SiS_LCDResInfo == SiS_Pr->SiS_Panel1152x768) ) {
-	  	   if(HwInfo->jChipType < SIS_315H) {
-		      if(SiS_Pr->SiS_VBType & VB_SISVB) {
-		         tempcx = 0x0017;  /* A901; sometimes 0x0018; */
-		      } else {
-		         tempcx = 0x0017;
-#ifdef TWNEWPANEL
-			 tempcx = 0x0018;
-#endif
-		      }
-		   } else {
-		      tempcx = 0x0018;
-		   }
-	      }
-	      else if(SiS_Pr->SiS_LCDResInfo == SiS_Pr->SiS_Panel1280x768)  tempcx = 0x0028;
-	      else if(SiS_Pr->SiS_LCDResInfo == SiS_Pr->SiS_Panel1280x1024) tempcx = 0x0030;
-	      else if(SiS_Pr->SiS_LCDResInfo == SiS_Pr->SiS_Panel1400x1050) tempcx = 0x0030;
-	      else if(SiS_Pr->SiS_LCDResInfo == SiS_Pr->SiS_Panel1600x1200) tempcx = 0x0040;
+  tempax = SiS_Pr->SiS_LCDHDES;
+  if(islvds) {
+     if(SiS_Pr->SiS_VBInfo & (SetCRT2ToLCD | SetCRT2ToLCDA)) {
+        if((!SiS_Pr->SiS_IF_DEF_FSTN) && (!SiS_Pr->SiS_IF_DEF_DSTN)) {
+           if((SiS_Pr->SiS_LCDResInfo == Panel_640x480) &&
+              (!(SiS_Pr->SiS_VBInfo & SetInSlaveMode))) {
+  	      tempax -= 8;
 	   }
-        }
+	}
      }
   }
 
-  tempcx += tempax;                              /* lcdhrs  */
-  if(tempcx >= SiS_Pr->SiS_HT) tempcx -= SiS_Pr->SiS_HT;
-
-  tempax = tempcx >> 3;                          /* BPLHRS */
-  temp = tempax & 0x00FF;
-  SiS_SetReg(SiS_Pr->SiS_Part1Port,0x14,temp);		 /* Part1_14h; Panel Link Horizontal Retrace Start  */
+  temp = (tempax & 0x0007);
+  SiS_SetReg(SiS_Pr->SiS_Part1Port,0x1A,temp);			/* BPLHDESKEW[2:0]   */
+  temp = (tempax >> 3) & 0x00FF;
+  SiS_SetReg(SiS_Pr->SiS_Part1Port,0x16,temp);			/* BPLHDESKEW[10:3]  */
 
-  if(SiS_Pr->SiS_LCDInfo & LCDPass11) {
-     temp = (tempax & 0x00FF) + 2;
-  } else {
-     temp = (tempax & 0x00FF) + 10;
-     if(SiS_Pr->SiS_VBInfo & SetCRT2ToLCD) {
-        if((!SiS_Pr->SiS_IF_DEF_DSTN) &&
-	   (!SiS_Pr->SiS_IF_DEF_FSTN) &&
-	   (SiS_Pr->SiS_CustomT != CUT_BARCO1366) &&
-	   (SiS_Pr->SiS_CustomT != CUT_BARCO1024) &&
-	   (SiS_Pr->SiS_CustomT != CUT_PANEL848)) {
-           if(SiS_Pr->SiS_LCDResInfo != SiS_Pr->SiS_Panel640x480) {
-	      temp += 6;
-              if(SiS_Pr->SiS_LCDResInfo != SiS_Pr->SiS_Panel800x600) {
-	         temp++;
-	         if(HwInfo->jChipType >= SIS_315H) {
-	            if(SiS_Pr->SiS_LCDResInfo != SiS_Pr->SiS_Panel1024x768) {
-	               temp += 7;
-		       if(SiS_Pr->SiS_LCDResInfo != SiS_Pr->SiS_Panel1600x1200) {
-		          temp -= 0x14;
-			  if(SiS_Pr->SiS_LCDResInfo != SiS_Pr->SiS_Panel1280x768) {
-			     temp -= 10;
-			  }
-		       }
-	            }
-	         }
-	      }
-           }
-        }
+  tempbx = SiS_Pr->SiS_HDE;
+  if(SiS_Pr->SiS_VBInfo & (SetCRT2ToLCD | SetCRT2ToLCDA)) {
+     if((SiS_Pr->SiS_LCDResInfo == Panel_640x480_2) ||
+        (SiS_Pr->SiS_LCDResInfo == Panel_640x480_3)) {
+        tempbx >>= 1;
+     }
+     if(!(SiS_Pr->SiS_LCDInfo & LCDPass11)) {
+        tempbx = SiS_Pr->PanelXRes;
      }
   }
 
-  temp &= 0x1F;
-  temp |= ((tempcx & 0x0007) << 5);
-#if 0
-  if(SiS_Pr->SiS_IF_DEF_FSTN) temp = 0x20;       /* WRONG? BIOS loads cl, not ah */
-#endif
-  SiS_SetReg(SiS_Pr->SiS_Part1Port,0x15,temp);    	 /* Part1_15h; Panel Link Horizontal Retrace End/Skew */
-
-  tempbx = push2;
-  tempcx = push1;                                /* lcdhdes  */
+  tempax += tempbx;
+  if(tempax >= SiS_Pr->SiS_HT) tempax -= SiS_Pr->SiS_HT;
 
-  temp = (tempcx & 0x0007);                      /* BPLHDESKEW  */
-  SiS_SetReg(SiS_Pr->SiS_Part1Port,0x1A,temp);   	 /* Part1_1Ah; Panel Link Vertical Retrace Start (2:0) */
+  temp = tempax;
+  if(temp & 0x07) temp += 8;
+  temp >>= 3;
+  SiS_SetReg(SiS_Pr->SiS_Part1Port,0x17,temp);			/* BPLHDEE  */
 
-  tempcx >>= 3;                                  /* BPLHDES */
-  temp = (tempcx & 0x00FF);
-#if 0 /* Not 550 FSTN */
-  if(HwInfo->jChipType >= SIS_315H) {
-     if(ModeNo == 0x5b) temp--; */
-  }
-#endif
-  SiS_SetReg(SiS_Pr->SiS_Part1Port,0x16,temp);    	 /* Part1_16h; Panel Link Horizontal Display Enable Start  */
+  tempcx = (SiS_Pr->SiS_HT - tempbx) >> 2;
 
-  if((HwInfo->jChipType < SIS_315H) ||
-     (SiS_Pr->SiS_IF_DEF_FSTN) ||
-     (SiS_Pr->SiS_IF_DEF_DSTN)) {
-     if(tempbx & 0x07) tempbx += 8;
-  }
-  tempbx >>= 3;                                  /* BPLHDEE  */
-  temp = tempbx & 0x00FF;
-#if 0 /* Not 550 FSTN */
-  if(HwInfo->jChipType >= SIS_315H) {
-     if(ModeNo == 0x5b) temp--;
+  if(SiS_Pr->SiS_VBInfo & (SetCRT2ToLCD | SetCRT2ToLCDA)) {
+     if(!(SiS_Pr->SiS_LCDInfo & LCDPass11)) {
+        if(SiS_Pr->PanelHRS != 999) tempcx = SiS_Pr->PanelHRS;
+     }
   }
-#endif
-  SiS_SetReg(SiS_Pr->SiS_Part1Port,0x17,temp);   	 /* Part1_17h; Panel Link Horizontal Display Enable End  */
 
-  /* 2. Vertical setup */
+  tempcx += tempax;
+  if(tempcx >= SiS_Pr->SiS_HT) tempcx -= SiS_Pr->SiS_HT;
 
-  if(HwInfo->jChipType < SIS_315H) {
-     tempcx = SiS_Pr->SiS_VGAVT;
-     tempbx = SiS_Pr->SiS_VGAVDE;
-     if((SiS_Pr->SiS_CustomT != CUT_BARCO1366) && (SiS_Pr->SiS_CustomT != CUT_BARCO1024)) {
-        if(SiS_Pr->SiS_LCDInfo & DontExpandLCD) {
-           if(SiS_Pr->SiS_LCDResInfo != SiS_Pr->SiS_Panel640x480) {
-	      tempbx = SiS_Pr->PanelYRes;
+  temp = (tempcx >> 3) & 0x00FF;
+  if(SiS_Pr->SiS_VBInfo & (SetCRT2ToLCD | SetCRT2ToLCDA)) {
+     if(SiS_Pr->SiS_IF_DEF_TRUMPION) {
+        if(SiS_Pr->SiS_LCDResInfo == Panel_1024x768) {
+           switch(ModeNo) {
+           case 0x04:
+           case 0x05:
+           case 0x0d: temp = 0x56; break;
+           case 0x10: temp = 0x60; break;
+           case 0x13: temp = 0x5f; break;
+           case 0x40:
+           case 0x41:
+           case 0x4f:
+           case 0x43:
+           case 0x44:
+           case 0x62:
+           case 0x56:
+           case 0x53:
+           case 0x5d:
+           case 0x5e: temp = 0x54; break;
            }
-	}
+        }
      }
-     tempcx -= tempbx;
+  }
+  SiS_SetReg(SiS_Pr->SiS_Part1Port,0x14,temp);			/* BPLHRS */
 
+  if(SiS_Pr->SiS_VBInfo & (SetCRT2ToLCD | SetCRT2ToLCDA)) {
+     temp += 2;
+     if(!(SiS_Pr->SiS_LCDInfo & LCDPass11)) {
+        temp += 8;
+        if(SiS_Pr->PanelHRE != 999) {
+           temp = tempcx + SiS_Pr->PanelHRE;
+	   if(temp >= SiS_Pr->SiS_HT) temp -= SiS_Pr->SiS_HT;
+	   temp >>= 3;
+        }
+     }
   } else {
-
-     tempcx = SiS_Pr->SiS_VGAVT - SiS_Pr->SiS_VGAVDE;           /* VGAVT-VGAVDE  */
-
+     temp += 10;
   }
 
-  tempbx = SiS_Pr->SiS_LCDVDES;	   		 	 	/* VGAVDES  */
-  push1 = tempbx;
+  temp &= 0x1F;
+  temp |= ((tempcx & 0x07) << 5);
+#if 0
+  if(SiS_Pr->SiS_IF_DEF_FSTN) temp = 0x20;       		/* WRONG? BIOS loads cl, not ah */
+#endif
+  SiS_SetReg(SiS_Pr->SiS_Part1Port,0x15,temp);			/* BPLHRE */
 
-  tempax = SiS_Pr->SiS_VGAVDE;
+  /* Vertical */
 
-  if(SiS_Pr->SiS_VBInfo & SetCRT2ToLCD) {
-     if((SiS_Pr->SiS_CustomT == CUT_BARCO1366) || (SiS_Pr->SiS_CustomT == CUT_BARCO1024)) {
-        if(SiS_Pr->SiS_LCDResInfo != SiS_Pr->SiS_Panel640x480) {
-           tempax = 600;
-	   if(SiS_Pr->SiS_LCDResInfo != SiS_Pr->SiS_Panel800x600) {
-	      tempax = 768;
-	   }
-	}
-     } else if( (SiS_Pr->SiS_IF_DEF_TRUMPION == 0)   &&
-                (!(SiS_Pr->SiS_LCDInfo & LCDPass11)) &&
-                ((SiS_Pr->SiS_LCDResInfo != SiS_Pr->SiS_Panel640x480) ||
-	         (SiS_Pr->SiS_IF_DEF_FSTN) ||
-	         (SiS_Pr->SiS_IF_DEF_DSTN)) ) {
+  tempax = SiS_Pr->SiS_VGAVDE;
+  if(SiS_Pr->SiS_VBInfo & (SetCRT2ToLCD | SetCRT2ToLCDA)) {
+     if(!(SiS_Pr->SiS_LCDInfo & LCDPass11)) {
 	tempax = SiS_Pr->PanelYRes;
      }
   }
 
-  tempbx += tempax;
+  tempbx = SiS_Pr->SiS_LCDVDES + tempax;
   if(tempbx >= SiS_Pr->SiS_VT) tempbx -= SiS_Pr->SiS_VT;
 
   push2 = tempbx;
 
-  tempcx >>= 1;
-
-  if((SiS_Pr->SiS_VBInfo & SetCRT2ToLCD) &&
-     (SiS_Pr->SiS_LCDResInfo != SiS_Pr->SiS_Panel640x480) &&
-     (SiS_Pr->SiS_CustomT != CUT_BARCO1366) &&
-     (SiS_Pr->SiS_CustomT != CUT_BARCO1024) &&
-     (SiS_Pr->SiS_CustomT != CUT_PANEL848)) {
-     if(SiS_Pr->SiS_LCDResInfo == SiS_Pr->SiS_Panel640x480_2 ||
-        SiS_Pr->SiS_LCDResInfo == SiS_Pr->SiS_Panel640x480_3) {
-	tempcx = 0x0017;
-     } else if(!(SiS_Pr->SiS_LCDInfo & LCDPass11)) {
-        if(SiS_Pr->SiS_IF_DEF_FSTN || SiS_Pr->SiS_IF_DEF_DSTN) {
-	   if(SiS_Pr->SiS_LCDResInfo == SiS_Pr->SiS_Panel800x600)         tempcx = 0x0003;
-  	   else if((SiS_Pr->SiS_LCDResInfo == SiS_Pr->SiS_Panel1024x768) ||
-	           (SiS_Pr->SiS_LCDResInfo == SiS_Pr->SiS_Panel1280x768)) tempcx = 0x0003;
-           else if(SiS_Pr->SiS_LCDResInfo == SiS_Pr->SiS_Panel1280x1024)  tempcx = 0x0001;
-           else if(SiS_Pr->SiS_LCDResInfo == SiS_Pr->SiS_Panel1400x1050)  tempcx = 0x0001;
-	   else 							  tempcx = 0x0057;
-        } else  {
-     	   if(SiS_Pr->SiS_LCDResInfo == SiS_Pr->SiS_Panel800x600)         tempcx = 0x0001;
-	   else if(SiS_Pr->SiS_LCDResInfo == SiS_Pr->SiS_Panel1024x600)   tempcx = 0x0001;
-     	   else if((SiS_Pr->SiS_LCDResInfo == SiS_Pr->SiS_Panel1024x768) ||
-	           (SiS_Pr->SiS_LCDResInfo == SiS_Pr->SiS_Panel1152x768)) {
-		   if(HwInfo->jChipType < SIS_315H) {
-		      if(SiS_Pr->SiS_VBType & VB_SISVB) {
-		         tempcx = 0x0002;   /* A901; sometimes 0x0003; */
-		      } else {
-			 tempcx = 0x0002;
-#ifdef TWNEWPANEL
-			 tempcx = 0x0003;
-#endif
-		      }
-		   } else tempcx = 0x0003;
-           }
-     	   else if(SiS_Pr->SiS_LCDResInfo == SiS_Pr->SiS_Panel1280x768)  tempcx = 0x0003;
-     	   else if(SiS_Pr->SiS_LCDResInfo == SiS_Pr->SiS_Panel1280x1024) tempcx = 0x0001;
-     	   else if(SiS_Pr->SiS_LCDResInfo == SiS_Pr->SiS_Panel1400x1050) tempcx = 0x0001;
-	   else if(SiS_Pr->SiS_LCDResInfo == SiS_Pr->SiS_Panel1600x1200) tempcx = 0x0001;
-     	   else 							 tempcx = 0x0057;
+  tempcx = SiS_Pr->SiS_VGAVT - SiS_Pr->SiS_VGAVDE;
+  if(HwInfo->jChipType < SIS_315H) {
+     if(SiS_Pr->SiS_VBInfo & (SetCRT2ToLCD | SetCRT2ToLCDA)) {
+        if(!(SiS_Pr->SiS_LCDInfo & LCDPass11)) {
+	   tempcx = SiS_Pr->SiS_VGAVT - SiS_Pr->PanelYRes;
 	}
      }
   }
+  if(islvds) tempcx >>= 1;
+  else       tempcx >>= 2;
 
-  tempbx += tempcx;			 	/* BPLVRS  */
-
-  if((HwInfo->jChipType < SIS_315H) ||
-     (SiS_Pr->SiS_IF_DEF_FSTN) ||
-     (SiS_Pr->SiS_IF_DEF_DSTN)) {
-     tempbx++;
+  if( (SiS_Pr->SiS_VBInfo & (SetCRT2ToLCD | SetCRT2ToLCDA)) &&
+      (!(SiS_Pr->SiS_LCDInfo & LCDPass11)) 		    &&
+      (SiS_Pr->PanelVRS != 999) ) {
+     tempcx = SiS_Pr->PanelVRS;
+     tempbx += tempcx;
+     if(issis) tempbx++;
+  } else {
+     tempbx += tempcx;
+     if(HwInfo->jChipType < SIS_315H) tempbx++;
+     else if(issis)                   tempbx++;
   }
 
-  if(tempbx >= SiS_Pr->SiS_VT) tempbx -= SiS_Pr->SiS_VT;
+  if(tempbx >= SiS_Pr->SiS_VT) tempbx -= SiS_Pr->SiS_VT;	/* BPLVRS  */
 
   temp = tempbx & 0x00FF;
-  SiS_SetReg(SiS_Pr->SiS_Part1Port,0x18,temp);       	 /* Part1_18h; Panel Link Vertical Retrace Start  */
+  if(SiS_Pr->SiS_IF_DEF_TRUMPION) {
+     if(SiS_Pr->SiS_LCDResInfo == Panel_1024x768) {
+        if(ModeNo == 0x10) temp = 0xa9;
+     }
+  }
+  SiS_SetReg(SiS_Pr->SiS_Part1Port,0x18,temp);
 
   tempcx >>= 3;
+  tempcx++;
 
-  if((!(SiS_Pr->SiS_LCDInfo & LCDPass11)) &&
-     (SiS_Pr->SiS_CustomT != CUT_BARCO1366) &&
-     (SiS_Pr->SiS_CustomT != CUT_BARCO1024) &&
-     (SiS_Pr->SiS_CustomT != CUT_PANEL848)) {
-     if(SiS_Pr->SiS_VBInfo & SetCRT2ToLCD) {
-        if( (HwInfo->jChipType < SIS_315H) &&
-            (SiS_Pr->SiS_LCDResInfo == SiS_Pr->SiS_Panel640x480) )     tempcx = 0x0001;
-	else if(SiS_Pr->SiS_LCDResInfo == SiS_Pr->SiS_Panel640x480_2)  tempcx = 0x0002;
-	else if(SiS_Pr->SiS_LCDResInfo == SiS_Pr->SiS_Panel640x480_3)  tempcx = 0x0002;
-        else if(SiS_Pr->SiS_LCDResInfo == SiS_Pr->SiS_Panel800x600)    tempcx = 0x0003;
-        else if(SiS_Pr->SiS_LCDResInfo == SiS_Pr->SiS_Panel1024x600)   tempcx = 0x0005;
-        else if(SiS_Pr->SiS_LCDResInfo == SiS_Pr->SiS_Panel1152x768)   tempcx = 0x0005;
-	else if(SiS_Pr->SiS_LCDResInfo == SiS_Pr->SiS_Panel1280x768)   tempcx = 0x0011;
-        else if(SiS_Pr->SiS_LCDResInfo == SiS_Pr->SiS_Panel1280x1024)  tempcx = 0x0005;
-        else if(SiS_Pr->SiS_LCDResInfo == SiS_Pr->SiS_Panel1400x1050)  tempcx = 0x0002;
-        else if(SiS_Pr->SiS_LCDResInfo == SiS_Pr->SiS_Panel1600x1200)  tempcx = 0x0011;
-        else if(SiS_Pr->SiS_LCDResInfo != SiS_Pr->SiS_Panel640x480)  {
-     		if(HwInfo->jChipType < SIS_315H) {
-		   if(SiS_Pr->SiS_VBType & VB_SISVB) {
-		      tempcx = 0x0004;   /* A901; Other BIOS sets 0x0005; */
-		   } else {
-		      tempcx = 0x0004;
-#ifdef TWNEWPANEL
-		      tempcx = 0x0005;
-#endif
-		   }
-		} else {
-		   tempcx = 0x0005;
-		}
-        }
+  if(SiS_Pr->SiS_VBInfo & (SetCRT2ToLCD | SetCRT2ToLCDA)) {
+     if(!(SiS_Pr->SiS_LCDInfo & LCDPass11)) {
+        if(SiS_Pr->PanelVRE != 999) tempcx = SiS_Pr->PanelVRE;
      }
   }
 
-  tempcx = tempcx + tempbx + 1;                  /* BPLVRE  */
+  tempcx += tempbx;
   temp = tempcx & 0x000F;
-  if(SiS_Pr->SiS_IF_DEF_FSTN ||
-     SiS_Pr->SiS_IF_DEF_DSTN ||
-     (SiS_Pr->SiS_CustomT == CUT_BARCO1366) ||
-     (SiS_Pr->SiS_CustomT == CUT_BARCO1024) ||
-     (SiS_Pr->SiS_CustomT == CUT_PANEL848)) {
-     temp |= 0x30;
-  }
-  SiS_SetRegANDOR(SiS_Pr->SiS_Part1Port,0x19,0xf0,temp); /* Part1_19h; Panel Link Vertical Retrace End (3:0); Misc.  */
+  SiS_SetRegANDOR(SiS_Pr->SiS_Part1Port,0x19,0xF0,temp);	/* BPLVRE  */
 
-  temp = ((tempbx & 0x0700) >> 8) << 3;          /* BPLDESKEW =0 */
+  temp = ((tempbx >> 8) & 0x07) << 3;
   if(SiS_Pr->SiS_IF_DEF_FSTN || SiS_Pr->SiS_IF_DEF_DSTN) {
      if(SiS_Pr->SiS_HDE != 640) {
-        if(SiS_Pr->SiS_VGAVDE != SiS_Pr->SiS_VDE)   temp |= 0x40;
+        if(SiS_Pr->SiS_VGAVDE != SiS_Pr->SiS_VDE)  temp |= 0x40;
+     }
+  } else if(SiS_Pr->SiS_VGAVDE != SiS_Pr->SiS_VDE) temp |= 0x40;
+  if(SiS_Pr->SiS_SetFlag & EnableLVDSDDA)          temp |= 0x40;
+  tempbx = 0x87;
+  if((HwInfo->jChipType >= SIS_315H) ||
+     (HwInfo->jChipRevision >= 0x30)) {
+     tempbx = 0x07;
+     if((SiS_Pr->SiS_IF_DEF_CH70xx == 1) && (SiS_Pr->SiS_VBInfo & SetCRT2ToTV)) {
+	if(SiS_GetReg(SiS_Pr->SiS_Part1Port,0x00) & 0x03)    temp |= 0x80;
+     }
+     /* Chrontel 701x operates in 24bit mode (8-8-8, 2x12bit mutliplexed) via VGA2 */
+     if(SiS_Pr->SiS_LCDInfo & LCDRGB18Bit) {
+	if(SiS_Pr->SiS_VBInfo & SetCRT2ToLCDA) {
+	   if(SiS_GetReg(SiS_Pr->SiS_P3c4,0x06) & 0x10)      temp |= 0x80;
+	} else {
+	   if(SiS_GetReg(SiS_Pr->SiS_Part1Port,0x00) & 0x01) temp |= 0x80;
+	}
      }
-  } else if(SiS_Pr->SiS_VGAVDE != SiS_Pr->SiS_VDE)  temp |= 0x40;
-  if(SiS_Pr->SiS_SetFlag & EnableLVDSDDA)           temp |= 0x40;
-  if(SiS_Pr->SiS_LCDInfo & LCDRGB18Bit) {
-     if(HwInfo->jChipType >= SIS_315H) {
-        if(SiS_GetReg(SiS_Pr->SiS_Part1Port,0x00) & 0x01) {
-           temp |= 0x80;
+  }
+  SiS_SetRegANDOR(SiS_Pr->SiS_Part1Port,0x1A,tempbx,temp);
+
+  tempbx = push2;                                      		/* BPLVDEE */
+
+  tempcx = SiS_Pr->SiS_LCDVDES;                        		/* BPLVDES */
+
+  if(SiS_Pr->SiS_VBInfo & (SetCRT2ToLCD | SetCRT2ToLCDA)) {
+     switch(SiS_Pr->SiS_LCDResInfo) {
+     case Panel_640x480:
+        tempbx = SiS_Pr->SiS_VGAVDE - 1;
+        tempcx = SiS_Pr->SiS_VGAVDE;
+	break;
+     case Panel_800x600:
+        if(!(SiS_Pr->SiS_VBInfo & SetInSlaveMode)) {
+           if(resinfo == SIS_RI_800x600) tempcx++;
         }
-     } else {
-	if( (HwInfo->jChipType == SIS_630) ||
-	    (HwInfo->jChipType == SIS_730) ) {
-	   if(HwInfo->jChipRevision >= 0x30) {
-	      temp |= 0x80;
+	break;
+     case Panel_1024x600:
+        if(!(SiS_Pr->SiS_VBInfo & SetInSlaveMode)) {
+           if(resinfo == SIS_RI_1024x600) tempcx++;
+           if(SiS_Pr->SiS_LCDInfo & DontExpandLCD) {
+	      if(resinfo == SIS_RI_800x600) tempcx++;
 	   }
-	}
+        }
+	break;
+     case Panel_1024x768:
+        if(HwInfo->jChipType < SIS_315H) {
+           if(!(SiS_Pr->SiS_VBInfo & SetInSlaveMode)) {
+              if(resinfo == SIS_RI_1024x768) tempcx++;
+	   }
+        }
+	break;
      }
   }
-  SiS_SetRegANDOR(SiS_Pr->SiS_Part1Port,0x1A,0x87,temp);  /* Part1_1Ah; Panel Link Control Signal (7:3); Vertical Retrace Start (2:0) */
 
-  if (HwInfo->jChipType < SIS_315H) {
+  temp = ((tempbx >> 8) & 0x07) << 3;
+  temp = temp | ((tempcx >> 8) & 0x07);
+  SiS_SetReg(SiS_Pr->SiS_Part1Port,0x1D,temp);
+  /* if(SiS_Pr->SiS_IF_DEF_FSTN) tempbx++;  */
+  SiS_SetReg(SiS_Pr->SiS_Part1Port,0x1C,tempbx);
+  SiS_SetReg(SiS_Pr->SiS_Part1Port,0x1B,tempcx);
 
-#ifdef SIS300      /* 300 series */
+  /* Vertical scaling */
 
-        tempeax = SiS_Pr->SiS_VGAVDE << 6;
-        temp = (USHORT)(tempeax % (ULONG)SiS_Pr->SiS_VDE);
-        tempeax = tempeax / (ULONG)SiS_Pr->SiS_VDE;
-        if(temp != 0) tempeax++;
-        tempebx = tempeax;                         /* BPLVCFACT  */
+  if(HwInfo->jChipType < SIS_315H) {
 
-  	if(SiS_Pr->SiS_SetFlag & EnableLVDSDDA) {
-	   tempebx = 0x003F;
-	}
+#ifdef SIS300      /* 300 series */
+     tempeax = SiS_Pr->SiS_VGAVDE << 6;
+     temp = (tempeax % (ULONG)SiS_Pr->SiS_VDE);
+     tempeax = tempeax / (ULONG)SiS_Pr->SiS_VDE;
+     if(temp) tempeax++;
 
-  	temp = (USHORT)(tempebx & 0x00FF);
-  	SiS_SetReg(SiS_Pr->SiS_Part1Port,0x1E,temp);      /* Part1_1Eh; Panel Link Vertical Scaling Factor */
+     if(SiS_Pr->SiS_SetFlag & EnableLVDSDDA) tempeax = 0x3F;
 
+     temp = (USHORT)(tempeax & 0x00FF);
+     SiS_SetReg(SiS_Pr->SiS_Part1Port,0x1E,temp);      	/* BPLVCFACT */
+     tempvcfact = temp;
 #endif /* SIS300 */
 
   } else {
 
 #ifdef SIS315H  /* 315 series */
+     tempeax = SiS_Pr->SiS_VGAVDE << 18;
+     tempebx = SiS_Pr->SiS_VDE;
+     temp = (tempeax % tempebx);
+     tempeax = tempeax / tempebx;
+     if(temp) tempeax++;
+     tempvcfact = tempeax;
 
-        if(HwInfo->jChipType == SIS_740) {
-           SiS_SetRegOR(SiS_Pr->SiS_Part1Port,0x1E,0x03);
-        } else {
-	   SiS_SetReg(SiS_Pr->SiS_Part1Port,0x1E,0x23);
-	}
-
-	tempeax = SiS_Pr->SiS_VGAVDE << 18;
-    	temp = (USHORT)(tempeax % (ULONG)SiS_Pr->SiS_VDE);
-    	tempeax = tempeax / SiS_Pr->SiS_VDE;
-    	if(temp != 0) tempeax++;
-    	tempebx = tempeax;                         /* BPLVCFACT  */
-        tempvcfact = tempeax;
-    	temp = (USHORT)(tempebx & 0x00FF);
-    	SiS_SetReg(SiS_Pr->SiS_Part1Port,0x37,temp);      /* Part1_37h; Panel Link Vertical Scaling Factor */
-    	temp = (USHORT)((tempebx & 0x00FF00) >> 8);
-    	SiS_SetReg(SiS_Pr->SiS_Part1Port,0x36,temp);      /* Part1_36h; Panel Link Vertical Scaling Factor */
-    	temp = (USHORT)((tempebx & 0x00030000) >> 16);
-	temp &= 0x03;
-    	if(SiS_Pr->SiS_VDE == SiS_Pr->SiS_VGAVDE) temp |= 0x04;
-    	SiS_SetReg(SiS_Pr->SiS_Part1Port,0x35,temp);      /* Part1_35h; Panel Link Vertical Scaling Factor */
-
-#endif /* SIS315H */
-
-  }
-
-  tempbx = push2;                                  /* BPLVDEE  */
-  tempcx = push1;
-
-  push1 = temp;
-
-  if(!(SiS_Pr->SiS_VBInfo & SetInSlaveMode)) {
-   	if(!SiS_Pr->SiS_IF_DEF_FSTN && !SiS_Pr->SiS_IF_DEF_DSTN) {
-		if(HwInfo->jChipType < SIS_315H) {
-			if(SiS_Pr->SiS_LCDResInfo == SiS_Pr->SiS_Panel1024x600) {
-      				if(resinfo == SIS_RI_1024x600) tempcx++;
-				if(SiS_Pr->SiS_LCDInfo & DontExpandLCD) {
-					if(resinfo == SIS_RI_800x600) tempcx++;
-		    		}
-			} else if(SiS_Pr->SiS_LCDResInfo == SiS_Pr->SiS_Panel800x600) {
-      				if(resinfo == SIS_RI_800x600)  tempcx++;
-				if(resinfo == SIS_RI_1024x768) tempcx++; /* Doesnt make sense anyway... */
-			} else  if(resinfo == SIS_RI_1024x768) tempcx++;
-		} else {
-			if(SiS_Pr->SiS_LCDResInfo == SiS_Pr->SiS_Panel800x600) {
-      				if(resinfo == SIS_RI_800x600)  tempcx++;
-			}
-		}
-	}
-  }
+     temp = (USHORT)(tempeax & 0x00FF);
+     SiS_SetReg(SiS_Pr->SiS_Part1Port,0x37,temp);
+     temp = (USHORT)((tempeax & 0x00FF00) >> 8);
+     SiS_SetReg(SiS_Pr->SiS_Part1Port,0x36,temp);
+     temp = (USHORT)((tempeax & 0x00030000) >> 16);
+     if(SiS_Pr->SiS_VDE == SiS_Pr->SiS_VGAVDE) temp |= 0x04;
+     SiS_SetReg(SiS_Pr->SiS_Part1Port,0x35,temp);
 
-  if(SiS_Pr->SiS_LCDResInfo == SiS_Pr->SiS_Panel640x480) {
-     if((!SiS_Pr->SiS_IF_DEF_FSTN) && (!SiS_Pr->SiS_IF_DEF_DSTN)) {
-        tempcx = SiS_Pr->SiS_VGAVDE;
-        tempbx = SiS_Pr->SiS_VGAVDE - 1;
+     if(SiS_Pr->SiS_VBType & (VB_SIS301C | VB_SIS302ELV)) {
+        temp = (USHORT)(tempeax & 0x00FF);
+        SiS_SetReg(SiS_Pr->SiS_Part4Port,0x3c,temp);
+        temp = (USHORT)((tempeax & 0x00FF00) >> 8);
+        SiS_SetReg(SiS_Pr->SiS_Part4Port,0x3b,temp);
+        temp = (USHORT)(((tempeax & 0x00030000) >> 16) << 6);
+        SiS_SetRegANDOR(SiS_Pr->SiS_Part4Port,0x3a,0x3f,temp);
+        temp = 0;
+        if(SiS_Pr->SiS_VDE != SiS_Pr->SiS_VGAVDE) temp |= 0x08;
+        SiS_SetRegANDOR(SiS_Pr->SiS_Part4Port,0x30,0xf3,temp);
      }
-  }
-
-  temp = ((tempbx & 0x0700) >> 8) << 3;
-  temp |= ((tempcx & 0x0700) >> 8);
-  SiS_SetReg(SiS_Pr->SiS_Part1Port,0x1D,temp);     	/* Part1_1Dh; Vertical Display Overflow; Control Signal */
-
-  temp = tempbx & 0x00FF;
-  /* if(SiS_Pr->SiS_IF_DEF_FSTN) temp++;  */
-  SiS_SetReg(SiS_Pr->SiS_Part1Port,0x1C,temp);      	/* Part1_1Ch; Panel Link Vertical Display Enable End  */
+#endif
 
-  temp = tempcx & 0x00FF;
-  SiS_SetReg(SiS_Pr->SiS_Part1Port,0x1B,temp);      	/* Part1_1Bh; Panel Link Vertical Display Enable Start  */
+  }
 
-  /* 3. Additional horizontal setup (scaling, etc) */
+  /* Horizontal scaling */
 
-  tempecx = SiS_Pr->SiS_VGAHDE;
-  if(HwInfo->jChipType >= SIS_315H) {
-     if((!SiS_Pr->SiS_IF_DEF_FSTN) && (!SiS_Pr->SiS_IF_DEF_DSTN)) {
-        if(modeflag & HalfDCLK) tempecx >>= 1;
-     }
+  tempeax = SiS_Pr->SiS_VGAHDE;		/* 1f = ( (VGAHDE * 65536) / ( (VGAHDE * 65536) / HDE ) ) - 1*/
+  if(chkdclkfirst) {
+     if(modeflag & HalfDCLK) tempeax >>= 1;
   }
-  tempebx = SiS_Pr->SiS_HDE;
-  if(tempecx == tempebx) tempeax = 0xFFFF;
-  else {
-     tempeax = tempecx;
-     tempeax <<= 16;
-     temp = (USHORT)(tempeax % tempebx);
-     tempeax = tempeax / tempebx;
+  tempebx = tempeax << 16;
+  if(SiS_Pr->SiS_HDE == tempeax) {
+     tempecx = 0xFFFF;
+  } else {
+     tempecx = tempebx / SiS_Pr->SiS_HDE;
      if(HwInfo->jChipType >= SIS_315H) {
-        if(temp) tempeax++;
+        if(tempebx % SiS_Pr->SiS_HDE) tempecx++;
      }
   }
-  tempecx = tempeax;
 
   if(HwInfo->jChipType >= SIS_315H) {
-     tempeax = SiS_Pr->SiS_VGAHDE;
-     if((!SiS_Pr->SiS_IF_DEF_FSTN) && (!SiS_Pr->SiS_IF_DEF_DSTN)) {
-        if(modeflag & HalfDCLK) tempeax >>= 1;
-     }
-     tempeax <<= 16;
-     tempeax = (tempeax / tempecx) - 1;
+     tempeax = (tempebx / tempecx) - 1;
   } else {
      tempeax = ((SiS_Pr->SiS_VGAHT << 16) / tempecx) - 1;
   }
-  tempecx <<= 16;
-  tempecx |= (tempeax & 0xFFFF);
+  tempecx = (tempecx << 16) | (tempeax & 0xFFFF);
   temp = (USHORT)(tempecx & 0x00FF);
-  SiS_SetReg(SiS_Pr->SiS_Part1Port,0x1F,temp);  	 /* Part1_1Fh; Panel Link DDA Operational Number in each horiz. line */
+  SiS_SetReg(SiS_Pr->SiS_Part1Port,0x1F,temp);
 
-  tempbx = SiS_Pr->SiS_VDE;
   if(HwInfo->jChipType >= SIS_315H) {
      tempeax = (SiS_Pr->SiS_VGAVDE << 18) / tempvcfact;
-     tempbx = (USHORT)(tempeax & 0x0FFFF);
+     tempbx = (USHORT)(tempeax & 0xFFFF);
   } else {
      tempeax = SiS_Pr->SiS_VGAVDE << 6;
-     tempbx = push1 & 0x3f;
+     tempbx = tempvcfact & 0x3f;
      if(tempbx == 0) tempbx = 64;
      tempeax /= tempbx;
-     tempbx = (USHORT)(tempeax & 0x0FFFF);
+     tempbx = (USHORT)(tempeax & 0xFFFF);
   }
-  if(SiS_Pr->SiS_LCDResInfo == SiS_Pr->SiS_Panel1024x768) tempbx--;
+  if(SiS_Pr->SiS_LCDResInfo == Panel_1024x768) tempbx--;
   if(SiS_Pr->SiS_SetFlag & EnableLVDSDDA) {
      if((!SiS_Pr->SiS_IF_DEF_FSTN) && (!SiS_Pr->SiS_IF_DEF_DSTN)) tempbx = 1;
-     else if(SiS_Pr->SiS_LCDResInfo != SiS_Pr->SiS_Panel640x480)  tempbx = 1;
+     else if(SiS_Pr->SiS_LCDResInfo != Panel_640x480)             tempbx = 1;
   }
 
-  temp = ((tempbx & 0xFF00) >> 8) << 3;
-  temp |= (USHORT)((tempecx & 0x0700) >> 8);
-  SiS_SetReg(SiS_Pr->SiS_Part1Port,0x20,temp);  	/* Part1_20h; Overflow register */
-
-  temp = tempbx & 0x00FF;
-  SiS_SetReg(SiS_Pr->SiS_Part1Port,0x21,temp);  	/* Part1_21h; Panel Link Vertical Accumulator Register */
+  temp = ((tempbx >> 8) & 0x07) << 3;
+  temp = temp | ((tempecx >> 8) & 0x07);
+  SiS_SetReg(SiS_Pr->SiS_Part1Port,0x20,temp);
+  SiS_SetReg(SiS_Pr->SiS_Part1Port,0x21,tempbx);
 
-  tempecx >>= 16;                               /* BPLHCFACT  */
-  if((HwInfo->jChipType < SIS_315H) || (SiS_Pr->SiS_IF_DEF_FSTN) || (SiS_Pr->SiS_IF_DEF_DSTN)) {
+  tempecx >>= 16;   	                                  	/* BPLHCFACT  */
+  if(!chkdclkfirst) {
      if(modeflag & HalfDCLK) tempecx >>= 1;
   }
   temp = (USHORT)((tempecx & 0xFF00) >> 8);
-  SiS_SetReg(SiS_Pr->SiS_Part1Port,0x22,temp);     	/* Part1_22h; Panel Link Horizontal Scaling Factor High */
-
+  SiS_SetReg(SiS_Pr->SiS_Part1Port,0x22,temp);
   temp = (USHORT)(tempecx & 0x00FF);
-  SiS_SetReg(SiS_Pr->SiS_Part1Port,0x23,temp);         /* Part1_22h; Panel Link Horizontal Scaling Factor Low */
+  SiS_SetReg(SiS_Pr->SiS_Part1Port,0x23,temp);
+
+#ifdef SIS315H
+  if(HwInfo->jChipType >= SIS_315H) {
+     if(SiS_Pr->SiS_VBInfo & SetCRT2ToLCDA) {
+        if((islvds) || (SiS_Pr->SiS_VBInfo & VB_SIS301LV302LV)) {
+           SiS_SetReg(SiS_Pr->SiS_Part1Port,0x1e,0x20);
+	}
+     } else {
+        if(islvds) {
+           if(HwInfo->jChipType == SIS_740) {
+              SiS_SetRegOR(SiS_Pr->SiS_Part1Port,0x1e,0x03);
+           } else {
+	      SiS_SetReg(SiS_Pr->SiS_Part1Port,0x1e,0x23);
+           }
+        }
+     }
+  }
+#endif
 
-  /* 630/301B and 630/LVDS do something for 640x480 panels here */
+#ifdef SIS300
+  if(SiS_Pr->SiS_IF_DEF_TRUMPION) {
+     int i;
+     UCHAR TrumpMode13[4]   = { 0x01, 0x10, 0x2c, 0x00 };
+     UCHAR TrumpMode10_1[4] = { 0x01, 0x10, 0x27, 0x00 };
+     UCHAR TrumpMode10_2[4] = { 0x01, 0x16, 0x10, 0x00 };
+
+     SiS_SetRegAND(SiS_Pr->SiS_Part1Port,0x02,0xbf);
+     for(i=0; i<5; i++) {
+        SiS_SetTrumpionBlock(SiS_Pr, &SiS300_TrumpionData[crt2crtc][0]);
+     }
+     if(SiS_Pr->SiS_LCDResInfo == Panel_1024x768) {
+        if(ModeNo == 0x13) {
+	   for(i=0; i<4; i++) {
+	      SiS_SetTrumpionBlock(SiS_Pr, &TrumpMode13[0]);
+	   }
+	} else if(ModeNo == 0x10) {
+	   for(i=0; i<4; i++) {
+	      SiS_SetTrumpionBlock(SiS_Pr, &TrumpMode10_1[0]);
+	      SiS_SetTrumpionBlock(SiS_Pr, &TrumpMode10_2[0]);
+	   }
+	}
+     }
+     SiS_SetRegOR(SiS_Pr->SiS_Part1Port,0x02,0x40);
+  }
+#endif
 
 #ifdef SIS315H
   if(SiS_Pr->SiS_IF_DEF_FSTN || SiS_Pr->SiS_IF_DEF_DSTN) {
@@ -6431,10 +5936,10 @@ SiS_SetGroup1_LVDS(SiS_Private *SiS_Pr, USHORT ModeNo, USHORT ModeIdIndex,
      SiS_SetReg(SiS_Pr->SiS_Part1Port,0x28,0x87);
      SiS_SetReg(SiS_Pr->SiS_Part1Port,0x29,0x5A);
      SiS_SetReg(SiS_Pr->SiS_Part1Port,0x2A,0x4B);
-     SiS_SetRegANDOR(SiS_Pr->SiS_Part1Port,0x44,~0x007,0x03);
+     SiS_SetRegANDOR(SiS_Pr->SiS_Part1Port,0x44,~0x07,0x03);
      tempax = SiS_Pr->SiS_HDE;                       		/* Blps = lcdhdee(lcdhdes+HDE) + 64 */
-     if(SiS_Pr->SiS_LCDResInfo == SiS_Pr->SiS_Panel640x480_2 ||
-        SiS_Pr->SiS_LCDResInfo == SiS_Pr->SiS_Panel640x480_3) tempax >>= 1;
+     if(SiS_Pr->SiS_LCDResInfo == Panel_640x480_2 ||
+        SiS_Pr->SiS_LCDResInfo == Panel_640x480_3) tempax >>= 1;
      tempax += 64;
      temp = tempax & 0x00FF;
      SiS_SetReg(SiS_Pr->SiS_Part1Port,0x38,temp);
@@ -6448,8 +5953,8 @@ SiS_SetGroup1_LVDS(SiS_Private *SiS_Pr, USHORT ModeNo, USHORT ModeIdIndex,
      SiS_SetRegANDOR(SiS_Pr->SiS_Part1Port,0x3C,~0x007,0x00);
 
      tempax = SiS_Pr->SiS_VDE;
-     if(SiS_Pr->SiS_LCDResInfo == SiS_Pr->SiS_Panel640x480_2 ||
-        SiS_Pr->SiS_LCDResInfo == SiS_Pr->SiS_Panel640x480_3) tempax >>= 1;
+     if(SiS_Pr->SiS_LCDResInfo == Panel_640x480_2 ||
+        SiS_Pr->SiS_LCDResInfo == Panel_640x480_3) tempax >>= 1;
      tempax >>= 1;
      temp = tempax & 0x00FF;
      SiS_SetReg(SiS_Pr->SiS_Part1Port,0x3B,temp);
@@ -6457,8 +5962,8 @@ SiS_SetGroup1_LVDS(SiS_Private *SiS_Pr, USHORT ModeNo, USHORT ModeIdIndex,
      SiS_SetRegANDOR(SiS_Pr->SiS_Part1Port,0x3C,~0x038,temp);
 
      tempeax = SiS_Pr->SiS_HDE;
-     if(SiS_Pr->SiS_LCDResInfo == SiS_Pr->SiS_Panel640x480_2 ||
-        SiS_Pr->SiS_LCDResInfo == SiS_Pr->SiS_Panel640x480_3) tempeax >>= 1;
+     if(SiS_Pr->SiS_LCDResInfo == Panel_640x480_2 ||
+        SiS_Pr->SiS_LCDResInfo == Panel_640x480_3) tempeax >>= 1;
      tempeax <<= 2;                       			/* BDxFIFOSTOP = (HDE*4)/128 */
      tempebx = 128;
      temp = (USHORT)(tempeax % tempebx);
@@ -6472,8 +5977,8 @@ SiS_SetGroup1_LVDS(SiS_Private *SiS_Pr, USHORT ModeNo, USHORT ModeIdIndex,
      SiS_SetRegANDOR(SiS_Pr->SiS_Part1Port,0x3C,~0x040,0x00);
 
      tempax = SiS_Pr->SiS_HDE;
-     if(SiS_Pr->SiS_LCDResInfo == SiS_Pr->SiS_Panel640x480_2 ||
-        SiS_Pr->SiS_LCDResInfo == SiS_Pr->SiS_Panel640x480_3) tempax >>= 1;
+     if(SiS_Pr->SiS_LCDResInfo == Panel_640x480_2 ||
+        SiS_Pr->SiS_LCDResInfo == Panel_640x480_3) tempax >>= 1;
      tempax >>= 4;                        			/* BDxWadroff = HDE*4/8/8 */
      pushcx = tempax;
      temp = tempax & 0x00FF;
@@ -6482,8 +5987,8 @@ SiS_SetGroup1_LVDS(SiS_Private *SiS_Pr, USHORT ModeNo, USHORT ModeIdIndex,
      SiS_SetRegANDOR(SiS_Pr->SiS_Part1Port,0x44,~0x0F8,temp);
 
      tempax = SiS_Pr->SiS_VDE;                             	/* BDxWadrst1 = BDxWadrst0 + BDxWadroff * VDE */
-     if(SiS_Pr->SiS_LCDResInfo == SiS_Pr->SiS_Panel640x480_2 ||
-        SiS_Pr->SiS_LCDResInfo == SiS_Pr->SiS_Panel640x480_3) tempax >>= 1;
+     if(SiS_Pr->SiS_LCDResInfo == Panel_640x480_2 ||
+        SiS_Pr->SiS_LCDResInfo == Panel_640x480_3) tempax >>= 1;
      tempeax = (tempax * pushcx);
      tempebx = 0x00100000 + tempeax;
      temp = (USHORT)tempebx & 0x000000FF;
@@ -6525,496 +6030,380 @@ SiS_SetGroup1_LVDS(SiS_Private *SiS_Pr, USHORT ModeNo, USHORT ModeIdIndex,
      }
   }
 #endif  /* SIS315H */
-
 }
 
-/************** Set Part 1 ***************/
+/* Set Part 1 */
 static void
 SiS_SetGroup1(SiS_Private *SiS_Pr, USHORT ModeNo, USHORT ModeIdIndex,
               PSIS_HW_INFO HwInfo, USHORT RefreshRateTableIndex)
 {
-  UCHAR  *ROMAddr  = HwInfo->pjVirtualRomBase;
-  USHORT  temp=0, tempax=0, tempbx=0, tempcx=0;
-  USHORT  pushbx=0, CRT1Index=0;
+#if defined(SIS300) || defined(SIS315H)
+  UCHAR   *ROMAddr = HwInfo->pjVirtualRomBase;
+#endif
+  USHORT  temp=0, tempax=0, tempbx=0, tempcx=0, bridgeadd=0;
+  USHORT  pushbx=0, CRT1Index=0, modeflag, resinfo=0;
 #ifdef SIS315H
   USHORT  tempbl=0;
 #endif
-  USHORT  modeflag, resinfo=0;
+
+  if(SiS_Pr->SiS_VBInfo & SetCRT2ToLCDA) {
+     SiS_SetGroup1_LVDS(SiS_Pr, ModeNo, ModeIdIndex, HwInfo, RefreshRateTableIndex);
+     return;
+  }
 
   if(ModeNo <= 0x13) {
      modeflag = SiS_Pr->SiS_SModeIDTable[ModeIdIndex].St_ModeFlag;
+  } else if(SiS_Pr->UseCustomMode) {
+     modeflag = SiS_Pr->CModeFlag;
   } else {
-     if(SiS_Pr->UseCustomMode) {
-	modeflag = SiS_Pr->CModeFlag;
-     } else {
-    	CRT1Index = SiS_Pr->SiS_RefIndex[RefreshRateTableIndex].Ext_CRT1CRTC;
-    	resinfo = SiS_Pr->SiS_EModeIDTable[ModeIdIndex].Ext_RESINFO;
-	modeflag = SiS_Pr->SiS_EModeIDTable[ModeIdIndex].Ext_ModeFlag;
-     }
+     CRT1Index = SiS_Pr->SiS_RefIndex[RefreshRateTableIndex].Ext_CRT1CRTC;
+     resinfo = SiS_Pr->SiS_EModeIDTable[ModeIdIndex].Ext_RESINFO;
+     modeflag = SiS_Pr->SiS_EModeIDTable[ModeIdIndex].Ext_ModeFlag;
   }
 
-  if(SiS_Pr->SiS_VBInfo & SetCRT2ToLCDA) {
-
-#ifdef SIS315H
-     SiS_SetCRT2Sync(SiS_Pr, ModeNo, RefreshRateTableIndex, HwInfo);
-     SiS_SetGroup1_LCDA(SiS_Pr, ModeNo, ModeIdIndex, HwInfo, RefreshRateTableIndex);
-#endif
-
-  } else {
+  SiS_SetCRT2Offset(SiS_Pr, ModeNo, ModeIdIndex, RefreshRateTableIndex, HwInfo);
 
-     if( (HwInfo->jChipType >= SIS_315H) &&
+  if( ! ((HwInfo->jChipType >= SIS_315H) &&
          (SiS_Pr->SiS_IF_DEF_LVDS == 1) &&
-	 (SiS_Pr->SiS_VBInfo & SetInSlaveMode) ) {
-
-        SiS_SetCRT2Sync(SiS_Pr, ModeNo, RefreshRateTableIndex, HwInfo);
+         (SiS_Pr->SiS_VBInfo & SetInSlaveMode)) ) {
 
-     } else {
-
-        SiS_SetCRT2Offset(SiS_Pr, ModeNo, ModeIdIndex,
-      		          RefreshRateTableIndex, HwInfo);
-
-        if (HwInfo->jChipType < SIS_315H ) {
+     if(HwInfo->jChipType < SIS_315H ) {
 #ifdef SIS300
-    	      SiS_SetCRT2FIFO_300(SiS_Pr, ModeNo, HwInfo);
+  	SiS_SetCRT2FIFO_300(SiS_Pr, ModeNo, HwInfo);
 #endif
-        } else {
+     } else {
 #ifdef SIS315H
-              SiS_SetCRT2FIFO_310(SiS_Pr);
+        SiS_SetCRT2FIFO_310(SiS_Pr, HwInfo);
 #endif
-	}
-
-        SiS_SetCRT2Sync(SiS_Pr, ModeNo, RefreshRateTableIndex, HwInfo);
+     }
 
-	/* 1. Horizontal setup */
+     /* 1. Horizontal setup */
 
-        if(HwInfo->jChipType < SIS_315H ) {
+     if(HwInfo->jChipType < SIS_315H ) {
 
 #ifdef SIS300   /* ------------- 300 series --------------*/
 
-    		temp = (SiS_Pr->SiS_VGAHT - 1) & 0x0FF;   			/* BTVGA2HT 0x08,0x09 */
-    		SiS_SetReg(SiS_Pr->SiS_Part1Port,0x08,temp);                   /* CRT2 Horizontal Total */
-
-    		temp = (((SiS_Pr->SiS_VGAHT - 1) & 0xFF00) >> 8) << 4;
-    		SiS_SetRegANDOR(SiS_Pr->SiS_Part1Port,0x09,0x0f,temp);          /* CRT2 Horizontal Total Overflow [7:4] */
+    	temp = (SiS_Pr->SiS_VGAHT - 1) & 0x0FF;   		  /* BTVGA2HT 0x08,0x09 */
+    	SiS_SetReg(SiS_Pr->SiS_Part1Port,0x08,temp);              /* CRT2 Horizontal Total */
 
-    		temp = (SiS_Pr->SiS_VGAHDE + 12) & 0x0FF;                       /* BTVGA2HDEE 0x0A,0x0C */
-    		SiS_SetReg(SiS_Pr->SiS_Part1Port,0x0A,temp);                   /* CRT2 Horizontal Display Enable End */
+    	temp = (((SiS_Pr->SiS_VGAHT - 1) & 0xFF00) >> 8) << 4;
+    	SiS_SetRegANDOR(SiS_Pr->SiS_Part1Port,0x09,0x0f,temp);    /* CRT2 Horizontal Total Overflow [7:4] */
 
-    		pushbx = SiS_Pr->SiS_VGAHDE + 12;                               /* bx  BTVGA@HRS 0x0B,0x0C */
-    		tempcx = (SiS_Pr->SiS_VGAHT - SiS_Pr->SiS_VGAHDE) >> 2;
-    		tempbx = pushbx + tempcx;
-    		tempcx <<= 1;
-    		tempcx += tempbx;
+    	temp = (SiS_Pr->SiS_VGAHDE + 12) & 0x0FF;                 /* BTVGA2HDEE 0x0A,0x0C */
+    	SiS_SetReg(SiS_Pr->SiS_Part1Port,0x0A,temp);              /* CRT2 Horizontal Display Enable End */
 
-    		if(SiS_Pr->SiS_VBType & VB_SISVB) {
-
-		   if(SiS_Pr->UseCustomMode) {
-		      tempbx = SiS_Pr->CHSyncStart + 12;
-		      tempcx = SiS_Pr->CHSyncEnd + 12;
-		   }
+	pushbx = SiS_Pr->SiS_VGAHDE + 12;                         /* bx  BTVGA2HRS 0x0B,0x0C */
+    	tempcx = (SiS_Pr->SiS_VGAHT - SiS_Pr->SiS_VGAHDE) >> 2;
+    	tempbx = pushbx + tempcx;
+    	tempcx <<= 1;
+    	tempcx += tempbx;
 
-      		   if(SiS_Pr->SiS_VBInfo & SetCRT2ToRAMDAC) {
-		      unsigned char cr4, cr14, cr5, cr15;
-		      if(SiS_Pr->UseCustomMode) {
-		         cr4  = SiS_Pr->CCRT1CRTC[4];
-			 cr14 = SiS_Pr->CCRT1CRTC[14];
-			 cr5  = SiS_Pr->CCRT1CRTC[5];
-			 cr15 = SiS_Pr->CCRT1CRTC[15];
-		      } else {
-		         cr4  = SiS_Pr->SiS_CRT1Table[CRT1Index].CR[4];
-			 cr14 = SiS_Pr->SiS_CRT1Table[CRT1Index].CR[14];
-			 cr5  = SiS_Pr->SiS_CRT1Table[CRT1Index].CR[5];
-			 cr15 = SiS_Pr->SiS_CRT1Table[CRT1Index].CR[15];
-		      }
-        	      tempbx = ((cr4 | ((cr14 & 0xC0) << 2)) - 1) << 3;
-        	      tempcx = (((cr5 & 0x1F) | ((cr15 & 0x04) << (6-2))) - 1) << 3;
-      		   }
-
-    		   if((SiS_Pr->SiS_VBInfo & SetCRT2ToTV) && (resinfo == SIS_RI_1024x768)){
-        	      if(!(SiS_Pr->SiS_TVMode & TVSetPAL)){
-      			 tempbx = 1040;
-      			 tempcx = 1042;
-      		      }
-    		   }
-	        }
+	bridgeadd = 12;
 
-    		temp = tempbx & 0x00FF;
-    		SiS_SetReg(SiS_Pr->SiS_Part1Port,0x0B,temp);                   /* CRT2 Horizontal Retrace Start */
 #endif /* SIS300 */
 
- 	} else {
+     } else {
 
 #ifdef SIS315H  /* ------------------- 315/330 series --------------- */
 
-	        tempcx = SiS_Pr->SiS_VGAHT;				       /* BTVGA2HT 0x08,0x09 */
-		if(modeflag & HalfDCLK) {
-		    if(SiS_Pr->SiS_VBType & VB_SISVB) {
-		       tempcx >>= 1;
-		    } else {
-		       tempax = SiS_Pr->SiS_VGAHDE >> 1;
-		       tempcx = SiS_Pr->SiS_HT - SiS_Pr->SiS_HDE + tempax;
-		       if(SiS_Pr->SiS_LCDInfo & DontExpandLCD) {
-			  tempcx = SiS_Pr->SiS_HT - tempax;
-		       }
-		    }
-		}
-		tempcx--;
+	tempcx = SiS_Pr->SiS_VGAHT;				  /* BTVGA2HT 0x08,0x09 */
+	if(modeflag & HalfDCLK) {
+	   if(SiS_Pr->SiS_VBType & VB_SISVB) {
+	      tempcx >>= 1;
+	   } else {
+	      tempax = SiS_Pr->SiS_VGAHDE >> 1;
+	      tempcx = SiS_Pr->SiS_HT - SiS_Pr->SiS_HDE + tempax;
+	      if(SiS_Pr->SiS_LCDInfo & DontExpandLCD) {
+	         tempcx = SiS_Pr->SiS_HT - tempax;
+	      }
+	   }
+	}
+	tempcx--;
+	SiS_SetReg(SiS_Pr->SiS_Part1Port,0x08,tempcx);            /* CRT2 Horizontal Total */
+	temp = (tempcx >> 4) & 0xF0;
+	SiS_SetRegANDOR(SiS_Pr->SiS_Part1Port,0x09,0x0F,temp);    /* CRT2 Horizontal Total Overflow [7:4] */
+
+	tempcx = SiS_Pr->SiS_VGAHT;				  /* BTVGA2HDEE 0x0A,0x0C */
+	tempbx = SiS_Pr->SiS_VGAHDE;
+	tempcx -= tempbx;
+	tempcx >>= 2;
+	if(modeflag & HalfDCLK) {
+	   tempbx >>= 1;
+	   tempcx >>= 1;
+	}
+	tempbx += 16;
 
-		temp = tempcx & 0xff;
-		SiS_SetReg(SiS_Pr->SiS_Part1Port,0x08,temp);                  /* CRT2 Horizontal Total */
+	SiS_SetReg(SiS_Pr->SiS_Part1Port,0x0A,tempbx);            /* CRT2 Horizontal Display Enable End */
 
-		temp = ((tempcx & 0xff00) >> 8) << 4;
-		SiS_SetRegANDOR(SiS_Pr->SiS_Part1Port,0x09,0x0F,temp);         /* CRT2 Horizontal Total Overflow [7:4] */
+	pushbx = tempbx;
+	tempcx >>= 1;
+	tempbx += tempcx;
+	tempcx += tempbx;
 
-		tempcx = SiS_Pr->SiS_VGAHT;				       /* BTVGA2HDEE 0x0A,0x0C */
-		tempbx = SiS_Pr->SiS_VGAHDE;
-		tempcx -= tempbx;
-		tempcx >>= 2;
-		if(modeflag & HalfDCLK) {
-		   tempbx >>= 1;
-		   tempcx >>= 1;
-		}
-		tempbx += 16;
-
-		temp = tempbx & 0xff;
-		SiS_SetReg(SiS_Pr->SiS_Part1Port,0x0A,temp);                  /* CRT2 Horizontal Display Enable End */
-
-		pushbx = tempbx;
-		tempcx >>= 1;
-		tempbx += tempcx;
-		tempcx += tempbx;
-
-		if(SiS_Pr->SiS_VBType & VB_SISVB) {
-
-		   if(HwInfo->jChipType >= SIS_661) {
-		      if((SiS_Pr->SiS_LCDResInfo == SiS_Pr->SiS_Panel1600x1200) ||
-		         (SiS_Pr->SiS_LCDResInfo == SiS_Pr->SiS_Panel1280x1024)) {
-			 if(resinfo == SIS_RI_1280x1024) {
-		            tempcx = 0x30;
-			 } else if(resinfo == SIS_RI_1600x1200) {
-			    tempcx = 0xff;
-			 }
-		      }
-		   }
+	bridgeadd = 16;
 
-		   if(SiS_Pr->UseCustomMode) {
-		      tempbx = SiS_Pr->CHSyncStart + 16;
-		      tempcx = SiS_Pr->CHSyncEnd + 16;
-		      tempax = SiS_Pr->SiS_VGAHT;
-		      if(modeflag & HalfDCLK) tempax >>= 1;
-		      tempax--;
-		      if(tempcx > tempax)  tempcx = tempax;
-		   }
+	if(SiS_Pr->SiS_VBType & VB_SISVB) {
+	   if(HwInfo->jChipType >= SIS_661) {
+	      if((SiS_Pr->SiS_LCDResInfo == Panel_1600x1200) ||
+		 (SiS_Pr->SiS_LCDResInfo == Panel_1280x1024)) {
+		 if(resinfo == SIS_RI_1280x1024) {
+		    tempcx = (tempcx & 0xff00) | 0x30;
+		 } else if(resinfo == SIS_RI_1600x1200) {
+		    tempcx = (tempcx & 0xff00) | 0xff;
+		 }
+	      }
+	   }
+        }
 
-             	   if(SiS_Pr->SiS_VBInfo & SetCRT2ToRAMDAC) {
-		      unsigned char cr4, cr14, cr5, cr15;
-		      if(SiS_Pr->UseCustomMode) {
-		         cr4  = SiS_Pr->CCRT1CRTC[4];
-			 cr14 = SiS_Pr->CCRT1CRTC[14];
-			 cr5  = SiS_Pr->CCRT1CRTC[5];
-			 cr15 = SiS_Pr->CCRT1CRTC[15];
-		      } else {
-		         cr4  = SiS_Pr->SiS_CRT1Table[CRT1Index].CR[4];
-			 cr14 = SiS_Pr->SiS_CRT1Table[CRT1Index].CR[14];
-			 cr5  = SiS_Pr->SiS_CRT1Table[CRT1Index].CR[5];
-			 cr15 = SiS_Pr->SiS_CRT1Table[CRT1Index].CR[15];
-		      }
-                      tempbx = ((cr4 | ((cr14 & 0xC0) << 2)) - 3) << 3; 		/* (VGAHRS-3)*8 */
-                      tempcx = (((cr5 & 0x1f) | ((cr15 & 0x04) << (5-2))) - 3) << 3; 	/* (VGAHRE-3)*8 */
-		      tempcx &= 0x00FF;
-		      tempcx |= (tempbx & 0xFF00);
-                      tempbx += 16;
-                      tempcx += 16;
-		      tempax = SiS_Pr->SiS_VGAHT;
-		      if(modeflag & HalfDCLK) tempax >>= 1;
-		      tempax--;
-		      if(tempcx > tempax)  tempcx = tempax;
-             	   }
-
-		   if(SiS_Pr->SiS_TVMode & TVSetNTSC1024) {
-      		      tempbx = 1040;
-      		      tempcx = 1042;
-      	     	   }
-
-                }
-
-		temp = tempbx & 0xff;
-	 	SiS_SetReg(SiS_Pr->SiS_Part1Port,0x0B,temp);                 /* CRT2 Horizontal Retrace Start */
 #endif  /* SIS315H */
 
-     	}  /* 315/330 series */
+     }  /* 315/330 series */
+
+     if(SiS_Pr->SiS_VBType & VB_SISVB) {
 
-  	/* The following is done for all bridge/chip types/series */
+        if(SiS_Pr->UseCustomMode) {
+	   tempbx = SiS_Pr->CHSyncStart + bridgeadd;
+	   tempcx = SiS_Pr->CHSyncEnd + bridgeadd;
+	   tempax = SiS_Pr->SiS_VGAHT;
+	   if(modeflag & HalfDCLK) tempax >>= 1;
+	   tempax--;
+	   if(tempcx > tempax) tempcx = tempax;
+	}
 
-  	tempax = tempbx & 0xFF00;
-  	tempbx = pushbx;
-  	tempbx = (tempbx & 0x00FF) | ((tempbx & 0xFF00) << 4);
-  	tempax |= (tempbx & 0xFF00);
-  	temp = (tempax & 0xFF00) >> 8;
-  	SiS_SetReg(SiS_Pr->SiS_Part1Port,0x0C,temp);                        /* Overflow */
+	if(SiS_Pr->SiS_VBInfo & SetCRT2ToRAMDAC) {
+	   unsigned char cr4, cr14, cr5, cr15;
+	   if(SiS_Pr->UseCustomMode) {
+	      cr4  = SiS_Pr->CCRT1CRTC[4];
+	      cr14 = SiS_Pr->CCRT1CRTC[14];
+	      cr5  = SiS_Pr->CCRT1CRTC[5];
+	      cr15 = SiS_Pr->CCRT1CRTC[15];
+	   } else {
+	      cr4  = SiS_Pr->SiS_CRT1Table[CRT1Index].CR[4];
+	      cr14 = SiS_Pr->SiS_CRT1Table[CRT1Index].CR[14];
+	      cr5  = SiS_Pr->SiS_CRT1Table[CRT1Index].CR[5];
+	      cr15 = SiS_Pr->SiS_CRT1Table[CRT1Index].CR[15];
+	   }
+           tempbx = ((cr4 | ((cr14 & 0xC0) << 2)) - 3) << 3; 		    /* (VGAHRS-3)*8 */
+           tempcx = (((cr5 & 0x1f) | ((cr15 & 0x04) << (5-2))) - 3) << 3;   /* (VGAHRE-3)*8 */
+	   tempcx &= 0x00FF;
+	   tempcx |= (tempbx & 0xFF00);
+           tempbx += bridgeadd;
+           tempcx += bridgeadd;
+	   tempax = SiS_Pr->SiS_VGAHT;
+	   if(modeflag & HalfDCLK) tempax >>= 1;
+	   tempax--;
+	   if(tempcx > tempax) tempcx = tempax;
+        }
 
-  	temp = tempcx & 0x00FF;
-  	SiS_SetReg(SiS_Pr->SiS_Part1Port,0x0D,temp);                        /* CRT2 Horizontal Retrace End */
+        if(SiS_Pr->SiS_TVMode & TVSetNTSC1024) {
+      	   tempbx = 1040;
+      	   tempcx = 1044;   /* HWCursor bug! */
+        }
 
-  	/* 2. Vertical setup */
+     }
 
-  	tempcx = SiS_Pr->SiS_VGAVT - 1;
-  	temp = tempcx & 0x00FF;
+     SiS_SetReg(SiS_Pr->SiS_Part1Port,0x0B,tempbx);            	  /* CRT2 Horizontal Retrace Start */
 
-	if(HwInfo->jChipType < SIS_661) {
-           if(SiS_Pr->SiS_IF_DEF_LVDS == 1) {
-	      if(HwInfo->jChipType < SIS_315H) {
-	         if(SiS_Pr->SiS_IF_DEF_CH70xx != 0) {
-	            if(SiS_Pr->SiS_VBInfo & (SetCRT2ToSVIDEO | SetCRT2ToAVIDEO)) {
-	               temp--;
-	            }
-                 }
-	      } else {
- 	         temp--;
+     SiS_SetReg(SiS_Pr->SiS_Part1Port,0x0D,tempcx);               /* CRT2 Horizontal Retrace End */
+
+     temp = ((tempbx >> 8) & 0x0F) | ((pushbx >> 4) & 0xF0);
+     SiS_SetReg(SiS_Pr->SiS_Part1Port,0x0C,temp);		  /* Overflow */
+
+     /* 2. Vertical setup */
+
+     tempcx = SiS_Pr->SiS_VGAVT - 1;
+     temp = tempcx & 0x00FF;
+
+     if(HwInfo->jChipType < SIS_661) {
+        if(SiS_Pr->SiS_IF_DEF_LVDS == 1) {
+	   if(HwInfo->jChipType < SIS_315H) {
+	      if(SiS_Pr->SiS_IF_DEF_CH70xx != 0) {
+	         if(SiS_Pr->SiS_VBInfo & (SetCRT2ToSVIDEO | SetCRT2ToAVIDEO)) {
+	            temp--;
+	         }
               }
-           } else if(HwInfo->jChipType >= SIS_315H) {
-	      temp--;
-	   }
-	}
-  	SiS_SetReg(SiS_Pr->SiS_Part1Port,0x0E,temp);                        /* CRT2 Vertical Total */
-
-  	tempbx = SiS_Pr->SiS_VGAVDE - 1;
-  	temp = tempbx & 0x00FF;
-  	SiS_SetReg(SiS_Pr->SiS_Part1Port,0x0F,temp);                        /* CRT2 Vertical Display Enable End */
-
-  	temp = ((tempbx & 0xFF00) << 3) >> 8;
-  	temp |= ((tempcx & 0xFF00) >> 8);
-  	SiS_SetReg(SiS_Pr->SiS_Part1Port,0x12,temp);                        /* Overflow (and HWCursor Test Mode) */
-
-	if((HwInfo->jChipType >= SIS_315H) && (HwInfo->jChipType < SIS_661)) {
-           tempbx++;
-   	   tempax = tempbx;
-	   tempcx++;
-	   tempcx -= tempax;
-	   tempcx >>= 2;
-	   tempbx += tempcx;
-	   if(tempcx < 4) tempcx = 4;
-	   tempcx >>= 2;
-	   tempcx += tempbx;
-	   tempcx++;
-	} else {
-  	   tempbx = (SiS_Pr->SiS_VGAVT + SiS_Pr->SiS_VGAVDE) >> 1;                 /*  BTVGA2VRS     0x10,0x11   */
-  	   tempcx = ((SiS_Pr->SiS_VGAVT - SiS_Pr->SiS_VGAVDE) >> 4) + tempbx + 1;  /*  BTVGA2VRE     0x11        */
+	   } else {
+ 	      temp--;
+           }
+        } else if(HwInfo->jChipType >= SIS_315H) {
+	   temp--;
 	}
+     }
+     SiS_SetReg(SiS_Pr->SiS_Part1Port,0x0E,temp);                 /* CRT2 Vertical Total */
+
+     tempbx = SiS_Pr->SiS_VGAVDE - 1;
+     SiS_SetReg(SiS_Pr->SiS_Part1Port,0x0F,tempbx);               /* CRT2 Vertical Display Enable End */
+
+     temp = ((tempbx >> 5) & 0x38) | ((tempcx >> 8) & 0x07);
+     SiS_SetReg(SiS_Pr->SiS_Part1Port,0x12,temp);                 /* Overflow */
+
+     if((HwInfo->jChipType >= SIS_315H) && (HwInfo->jChipType < SIS_661)) {
+        tempbx++;
+   	tempax = tempbx;
+	tempcx++;
+	tempcx -= tempax;
+	tempcx >>= 2;
+	tempbx += tempcx;
+	if(tempcx < 4) tempcx = 4;
+	tempcx >>= 2;
+	tempcx += tempbx;
+	tempcx++;
+     } else {
+  	tempbx = (SiS_Pr->SiS_VGAVT + SiS_Pr->SiS_VGAVDE) >> 1;                 /*  BTVGA2VRS     0x10,0x11   */
+  	tempcx = ((SiS_Pr->SiS_VGAVT - SiS_Pr->SiS_VGAVDE) >> 4) + tempbx + 1;  /*  BTVGA2VRE     0x11        */
+     }
 
-  	if(SiS_Pr->SiS_VBType & VB_SISVB) {
-
+     if(SiS_Pr->SiS_VBType & VB_SISVB) {
+	if(SiS_Pr->UseCustomMode) {
+	   tempbx = SiS_Pr->CVSyncStart;
+	   tempcx = SiS_Pr->CVSyncEnd;
+	}
+        if(SiS_Pr->SiS_VBInfo & SetCRT2ToRAMDAC) {
+	   unsigned char cr8, cr7, cr13;
 	   if(SiS_Pr->UseCustomMode) {
-	      tempbx = SiS_Pr->CVSyncStart;
-	      tempcx = (tempcx & 0xFF00) | (SiS_Pr->CVSyncEnd & 0x00FF);
+	      cr8    = SiS_Pr->CCRT1CRTC[8];
+	      cr7    = SiS_Pr->CCRT1CRTC[7];
+	      cr13   = SiS_Pr->CCRT1CRTC[13];
+	      tempcx = SiS_Pr->CCRT1CRTC[9];
+	   } else {
+	      cr8    = SiS_Pr->SiS_CRT1Table[CRT1Index].CR[8];
+	      cr7    = SiS_Pr->SiS_CRT1Table[CRT1Index].CR[7];
+	      cr13   = SiS_Pr->SiS_CRT1Table[CRT1Index].CR[13];
+	      tempcx = SiS_Pr->SiS_CRT1Table[CRT1Index].CR[9];
 	   }
+      	   tempbx = cr8;
+      	   if(cr7  & 0x04) tempbx |= 0x0100;
+      	   if(cr7  & 0x80) tempbx |= 0x0200;
+      	   if(cr13 & 0x08) tempbx |= 0x0400;
+       	}
+     }
+     SiS_SetReg(SiS_Pr->SiS_Part1Port,0x10,tempbx);               /* CRT2 Vertical Retrace Start */
 
-    	   if(SiS_Pr->SiS_VBInfo & SetCRT2ToRAMDAC) {
-	      unsigned char cr8, cr7, cr13, cr9;
-	      if(SiS_Pr->UseCustomMode) {
-	         cr8  = SiS_Pr->CCRT1CRTC[8];
-		 cr7  = SiS_Pr->CCRT1CRTC[7];
-		 cr13 = SiS_Pr->CCRT1CRTC[13];
-		 cr9  = SiS_Pr->CCRT1CRTC[9];
-	      } else {
-	         cr8  = SiS_Pr->SiS_CRT1Table[CRT1Index].CR[8];
-		 cr7  = SiS_Pr->SiS_CRT1Table[CRT1Index].CR[7];
-		 cr13 = SiS_Pr->SiS_CRT1Table[CRT1Index].CR[13];
-		 cr9  = SiS_Pr->SiS_CRT1Table[CRT1Index].CR[9];
-	      }
-      	      tempbx = cr8;
-      	      if(cr7 & 0x04)  tempbx |= 0x0100;
-      	      if(cr7 & 0x80)  tempbx |= 0x0200;
-      	      if(cr13 & 0x08) tempbx |= 0x0400;
-      	      tempcx = (tempcx & 0xFF00) | (cr9 & 0x00FF);
-    	   }
-  	}
-  	temp = tempbx & 0x00FF;
-  	SiS_SetReg(SiS_Pr->SiS_Part1Port,0x10,temp);           /* CRT2 Vertical Retrace Start */
-
-  	temp = ((tempbx & 0xFF00) >> 8) << 4;
-  	temp |= (tempcx & 0x000F);
-  	SiS_SetReg(SiS_Pr->SiS_Part1Port,0x11,temp);           /* CRT2 Vert. Retrace End; Overflow; "Enable CRTC Check" */
+     temp = ((tempbx >> 4) & 0x70) | (tempcx & 0x0F);
+     SiS_SetReg(SiS_Pr->SiS_Part1Port,0x11,temp);                 /* CRT2 Vert. Retrace End; Overflow */
 
-  	/* 3. Panel compensation delay */
+     /* 3. Panel delay compensation */
 
-  	if(HwInfo->jChipType < SIS_315H) {
+     if(HwInfo->jChipType < SIS_315H) {
 
 #ifdef SIS300  /* ---------- 300 series -------------- */
 
-	   if(SiS_Pr->SiS_VBType & VB_SISVB) {
-	        temp = 0x20;
+	if(SiS_Pr->SiS_VBType & VB_SISVB) {
+	   temp = 0x20;
+	   if(HwInfo->jChipType == SIS_300) {
+	      temp = 0x10;
+	      if(SiS_Pr->SiS_LCDResInfo == Panel_1024x768)  temp = 0x2c;
+	      if(SiS_Pr->SiS_LCDResInfo == Panel_1280x1024) temp = 0x20;
+	   }
+	   if(SiS_Pr->SiS_VBType & VB_SIS301) {
+	      if(SiS_Pr->SiS_LCDResInfo == Panel_1280x1024) temp = 0x20;
+	   }
+	   if(SiS_Pr->SiS_LCDResInfo == Panel_1280x960)     temp = 0x24;
+	   if(SiS_Pr->SiS_LCDResInfo == Panel_Custom)       temp = 0x2c;
+	   if(SiS_Pr->SiS_VBInfo & SetCRT2ToTV) 	    temp = 0x08;
+	   if(SiS_Pr->SiS_VBInfo & SetCRT2ToHiVision) {
+      	      if(SiS_Pr->SiS_VBInfo & SetInSlaveMode) 	    temp = 0x2c;
+      	      else 					    temp = 0x20;
+    	   }
+	   if(SiS_Pr->SiS_UseROM) {
+	      if(ROMAddr[0x220] & 0x80) {
+	         if(SiS_Pr->SiS_VBInfo & SetCRT2ToTVNoYPbPrHiVision)
+	   	    temp = ROMAddr[0x221];
+		 else if(SiS_Pr->SiS_VBInfo & SetCRT2ToHiVision)
+		    temp = ROMAddr[0x222];
+		 else if(SiS_Pr->SiS_LCDResInfo == Panel_1280x1024)
+		    temp = ROMAddr[0x223];
+		 else
+		    temp = ROMAddr[0x224];
+		 temp &= 0x3c;
+	      }
+	   }
+	   if(SiS_Pr->SiS_VBInfo & SetCRT2ToLCD) {
+	      if(SiS_Pr->PDC != -1)  temp = SiS_Pr->PDC & 0x3c;
+	   }
 
-		if(HwInfo->jChipType == SIS_300) {
-		   temp = 0x10;
-		   if(SiS_Pr->SiS_LCDResInfo == SiS_Pr->SiS_Panel1024x768)  temp = 0x2c;
-		   if(SiS_Pr->SiS_LCDResInfo == SiS_Pr->SiS_Panel1280x1024) temp = 0x20;
-		}
-		if(SiS_Pr->SiS_VBType & VB_SIS301) {
-		   if(SiS_Pr->SiS_LCDResInfo == SiS_Pr->SiS_Panel1280x1024) temp = 0x20;
-		}
-		if(SiS_Pr->SiS_LCDResInfo == SiS_Pr->SiS_Panel1280x960)     temp = 0x24;
-		if(SiS_Pr->SiS_LCDResInfo == SiS_Pr->SiS_PanelCustom)       temp = 0x2c;
-		if(SiS_Pr->SiS_VBInfo & SetCRT2ToTV) 		temp = 0x08;
-		if(SiS_Pr->SiS_VBInfo & SetCRT2ToHiVision) {
-      		   if(SiS_Pr->SiS_VBInfo & SetInSlaveMode) 	temp = 0x2c;
-      		   else 					temp = 0x20;
-    	        }
-		if((ROMAddr) && (SiS_Pr->SiS_UseROM)) {
-		    if(ROMAddr[0x220] & 0x80) {
-		        if(SiS_Pr->SiS_VBInfo & SetCRT2ToTVNoYPbPrHiVision)
-				temp = ROMAddr[0x221];
-			else if(SiS_Pr->SiS_VBInfo & SetCRT2ToHiVision)
-				temp = ROMAddr[0x222];
-		        else if(SiS_Pr->SiS_LCDResInfo == SiS_Pr->SiS_Panel1280x1024)
-				temp = ROMAddr[0x223];
-			else
-				temp = ROMAddr[0x224];
-			temp &= 0x3c;
-		    }
-		}
-		if(SiS_Pr->SiS_VBInfo & SetCRT2ToLCD) {
-		   if(SiS_Pr->PDC) {
-			temp = SiS_Pr->PDC & 0x3c;
-		   }
-		}
-	   } else {
-	        temp = 0x20;
-		if(!(SiS_Pr->SiS_VBInfo & SetCRT2ToTV)) {
-		   if(SiS_Pr->SiS_LCDResInfo == SiS_Pr->SiS_Panel640x480) temp = 0x04;
-		}
-		if((ROMAddr) && SiS_Pr->SiS_UseROM) {
-		    if(ROMAddr[0x220] & 0x80) {
-		        temp = ROMAddr[0x220] & 0x3c;
-		    }
-		}
-		if(SiS_Pr->SiS_VBInfo & SetCRT2ToLCD) {
-		   if(SiS_Pr->PDC) {
-		      temp = SiS_Pr->PDC & 0x3c;
-		   }
-		}
+	} else {
+	   temp = 0x20;
+	   if(!(SiS_Pr->SiS_VBInfo & SetCRT2ToTV)) {
+	      if(SiS_Pr->SiS_LCDResInfo == Panel_640x480) temp = 0x04;
+	   }
+	   if(SiS_Pr->SiS_UseROM) {
+	      if(ROMAddr[0x220] & 0x80) {
+	         temp = ROMAddr[0x220] & 0x3c;
+	      }
+	   }
+	   if(SiS_Pr->SiS_VBInfo & SetCRT2ToLCD) {
+	      if(SiS_Pr->PDC != -1) temp = SiS_Pr->PDC & 0x3c;
 	   }
+        }
 
-    	   SiS_SetRegANDOR(SiS_Pr->SiS_Part1Port,0x13,~0x03C,temp);         /* Panel Link Delay Compensation; (Software Command Reset; Power Saving) */
+    	SiS_SetRegANDOR(SiS_Pr->SiS_Part1Port,0x13,~0x3C,temp);   /* Panel Link Delay Compensation; (Software Command Reset; Power Saving) */
 
 #endif  /* SIS300 */
 
-  	} else {
+     } else {
 
 #ifdef SIS315H   /* --------------- 315/330 series ---------------*/
 
-   	   if(HwInfo->jChipType < SIS_661) {
+        if(HwInfo->jChipType < SIS_661) {
 
-	      if(SiS_Pr->SiS_VBType & VB_SISVB) {
-
-                 temp = 0x10;
-                 if(SiS_Pr->SiS_LCDResInfo == SiS_Pr->SiS_Panel1024x768)  temp = 0x2c;
-    	         if(SiS_Pr->SiS_LCDResInfo == SiS_Pr->SiS_Panel1280x1024) temp = 0x20;
-    	         if(SiS_Pr->SiS_LCDResInfo == SiS_Pr->SiS_Panel1280x960)  temp = 0x24;
-		 if(SiS_Pr->SiS_LCDResInfo == SiS_Pr->SiS_PanelCustom)    temp = 0x2c;
-		 if(SiS_Pr->SiS_VBInfo & SetCRT2ToTV) {
-		    temp = 0x08;
-		    if(SiS_Pr->SiS_VBInfo & SetCRT2ToHiVision) {
-		       if(SiS_Pr->SiS_VBInfo & SetInSlaveMode)  temp = 0x2c;
-      		       else 					temp = 0x20;
-		    }
-		 }
-		 if((SiS_Pr->SiS_VBType & VB_SIS301B302B) && (!(SiS_Pr->SiS_VBType & VB_NoLCD))) {
-		    tempbl = 0x00;
-		    if((ROMAddr) && (SiS_Pr->SiS_UseROM)) {
-		       if(HwInfo->jChipType < SIS_330) {
-		          if(ROMAddr[0x13c] & 0x80) tempbl = 0xf0;
-		       } else {
-		          if(ROMAddr[0x1bc] & 0x80) tempbl = 0xf0;
-		       }
-		    }
-		 } else {  /* LV (550/301LV checks ROM byte, other LV BIOSes do not) */
-		    tempbl = 0xF0;
-		 }
-		 if(SiS_Pr->SiS_VBInfo & (SetCRT2ToLCD|SetCRT2ToLCDA)) {
-		    if(SiS_Pr->SiS_VBType & VB_SIS301LV302LV) {
-		       if(SiS_Pr->PDC) {
-		          temp = SiS_Pr->PDC;
-		          tempbl = 0;
-		       }
-		    }
-		 }
+	   if(SiS_Pr->SiS_IF_DEF_LVDS == 1) {
 
-	      } else {  /* LVDS */
+	      if(HwInfo->jChipType == SIS_740) temp = 0x03;
+	      else 		               temp = 0x00;
 
-	         if(HwInfo->jChipType == SIS_740) {
-		    temp = 0x03;
-	         } else {
-		    temp = 0x00;
-		 }
-	 	 if(SiS_Pr->SiS_VBInfo & SetCRT2ToTV) temp = 0x0a;
-		 tempbl = 0xF0;
-		 if(HwInfo->jChipType == SIS_650) {
-		    if(SiS_Pr->SiS_IF_DEF_CH70xx != 0) {
-		       if(!(SiS_Pr->SiS_VBInfo & SetCRT2ToTV)) tempbl = 0x0F;
-		    }
+	      if(SiS_Pr->SiS_VBInfo & SetCRT2ToTV) temp = 0x0a;
+	      tempbl = 0xF0;
+	      if(HwInfo->jChipType == SIS_650) {
+		 if(SiS_Pr->SiS_IF_DEF_CH70xx != 0) {
+		    if(!(SiS_Pr->SiS_VBInfo & SetCRT2ToTV)) tempbl = 0x0F;
 		 }
+	      }
 
-		 if(SiS_Pr->SiS_IF_DEF_DSTN || SiS_Pr->SiS_IF_DEF_FSTN) {
-		    temp = 0x08;
-		    tempbl = 0;
-		    if((ROMAddr) && (SiS_Pr->SiS_UseROM)) {
-		       if(ROMAddr[0x13c] & 0x80) tempbl = 0xf0;
-		    }
+	      if(SiS_Pr->SiS_IF_DEF_DSTN || SiS_Pr->SiS_IF_DEF_FSTN) {
+		 temp = 0x08;
+		 tempbl = 0;
+		 if((SiS_Pr->SiS_UseROM) && (!(SiS_Pr->SiS_ROMNew))) {
+		    if(ROMAddr[0x13c] & 0x80) tempbl = 0xf0;
 		 }
 	      }
 
 	      SiS_SetRegANDOR(SiS_Pr->SiS_Part1Port,0x2D,tempbl,temp);	    /* Panel Link Delay Compensation */
+	   }
 
-	   } /* < 661 */
+	} /* < 661 */
 
-    	   tempax = 0;
-    	   if (modeflag & DoubleScanMode) tempax |= 0x80;
-    	   if (modeflag & HalfDCLK)       tempax |= 0x40;
-    	   SiS_SetRegANDOR(SiS_Pr->SiS_Part1Port,0x2C,0x3f,tempax);
+    	tempax = 0;
+    	if(modeflag & DoubleScanMode) tempax |= 0x80;
+    	if(modeflag & HalfDCLK)       tempax |= 0x40;
+    	SiS_SetRegANDOR(SiS_Pr->SiS_Part1Port,0x2C,0x3f,tempax);
 
 #endif  /* SIS315H */
 
-  	}
-
-     }  /* Slavemode */
+     }
 
-     if(SiS_Pr->SiS_VBType & VB_SISVB) {
+  }  /* Slavemode */
 
+  if(SiS_Pr->SiS_VBType & VB_SISVB) {
+     if((SiS_Pr->SiS_VBType & VB_NoLCD) && (SiS_Pr->SiS_VBInfo & SetCRT2ToLCD)) {
         /* For 301BDH with LCD, we set up the Panel Link */
-        if( (SiS_Pr->SiS_VBType & VB_NoLCD) && (SiS_Pr->SiS_VBInfo & SetCRT2ToLCD) ) {
-
-	    SiS_SetGroup1_LVDS(SiS_Pr, ModeNo, ModeIdIndex,
-	                       HwInfo, RefreshRateTableIndex);
-
-        } else if(SiS_Pr->SiS_VBInfo & SetInSlaveMode) {
-
-    	    SiS_SetGroup1_301(SiS_Pr, ModeNo, ModeIdIndex,
-	                      HwInfo, RefreshRateTableIndex);
-        }
-
+	SiS_SetGroup1_LVDS(SiS_Pr, ModeNo, ModeIdIndex, HwInfo, RefreshRateTableIndex);
+     } else if(SiS_Pr->SiS_VBInfo & SetInSlaveMode) {
+    	SiS_SetGroup1_301(SiS_Pr, ModeNo, ModeIdIndex, HwInfo, RefreshRateTableIndex);
+     }
+  } else {
+     if(HwInfo->jChipType < SIS_315H) {
+	SiS_SetGroup1_LVDS(SiS_Pr, ModeNo, ModeIdIndex, HwInfo, RefreshRateTableIndex);
      } else {
-
-        if(HwInfo->jChipType < SIS_315H) {
-
-	   SiS_SetGroup1_LVDS(SiS_Pr, ModeNo, ModeIdIndex,
-	                        HwInfo, RefreshRateTableIndex);
+	if(SiS_Pr->SiS_IF_DEF_CH70xx != 0) {
+           if((!(SiS_Pr->SiS_VBInfo & SetCRT2ToTV)) || (SiS_Pr->SiS_VBInfo & SetInSlaveMode)) {
+    	      SiS_SetGroup1_LVDS(SiS_Pr, ModeNo,ModeIdIndex, HwInfo,RefreshRateTableIndex);
+           }
 	} else {
-
-	   if(SiS_Pr->SiS_IF_DEF_CH70xx != 0) {
-              if((!(SiS_Pr->SiS_VBInfo & SetCRT2ToTV)) || (SiS_Pr->SiS_VBInfo & SetInSlaveMode)) {
-    	          SiS_SetGroup1_LVDS(SiS_Pr, ModeNo,ModeIdIndex,
-	                              HwInfo,RefreshRateTableIndex);
-              }
-	   } else {
-	      SiS_SetGroup1_LVDS(SiS_Pr, ModeNo,ModeIdIndex,
-	                         HwInfo,RefreshRateTableIndex);
-	   }
-
+	   SiS_SetGroup1_LVDS(SiS_Pr, ModeNo,ModeIdIndex, HwInfo,RefreshRateTableIndex);
 	}
-
      }
-  } /* LCDA */
+  }
 }
 
 /*********************************************/
@@ -7025,9 +6414,8 @@ SiS_SetGroup1(SiS_Private *SiS_Pr, USHORT ModeNo, USHORT ModeIdIndex,
 static UCHAR *
 SiS_GetGroup2CLVXPtr(SiS_Private *SiS_Pr, int tabletype, PSIS_HW_INFO HwInfo)
 {
-   UCHAR  *ROMAddr = HwInfo->pjVirtualRomBase;
    const UCHAR  *tableptr = NULL;
-   USHORT a, b, p = 0;
+   USHORT       a, b, p = 0;
 
    a = SiS_Pr->SiS_VGAHDE;
    b = SiS_Pr->SiS_HDE;
@@ -7036,66 +6424,33 @@ SiS_GetGroup2CLVXPtr(SiS_Private *SiS_Pr, int tabletype, PSIS_HW_INFO HwInfo)
       b = SiS_Pr->SiS_VDE;
    }
 
-   if((HwInfo->jChipType >= SIS_661) && (ROMAddr = (UCHAR *)HwInfo->pjVirtualRomBase) && SiS_Pr->SiS_UseROM) {
-
-      if(a < b) {
-         p = ROMAddr[0x278] | (ROMAddr[0x279] << 8);
-      } else if(a == b) {
-         p = ROMAddr[0x27a] | (ROMAddr[0x27b] << 8);
-      } else {
-         if(SiS_Pr->SiS_TVMode & TVSetPAL) {
-	    p = ROMAddr[0x27e] | (ROMAddr[0x27f] << 8);
-	 } else {
-	    p = ROMAddr[0x27c] | (ROMAddr[0x27d] << 8);
-	 }
-	 if(SiS_Pr->SiS_VBInfo & SetCRT2ToYPbPr525750) {
-	    if(SiS_Pr->SiS_TVMode & TVSetYPbPr525i) 	 p = ROMAddr[0x280] | (ROMAddr[0x281] << 8);
-	    else if(SiS_Pr->SiS_TVMode & TVSetYPbPr525p) p = ROMAddr[0x282] | (ROMAddr[0x283] << 8);
-	    else 				 	 p = ROMAddr[0x284] | (ROMAddr[0x285] << 8);
-	 } else if(SiS_Pr->SiS_VBInfo & SetCRT2ToHiVision) {
-	    p = ROMAddr[0x286] | (ROMAddr[0x287] << 8);
-	 }
-	 do {
-	    if((ROMAddr[p] | ROMAddr[p+1] << 8) == a) break;
-	    p += 0x42;
-	 } while((ROMAddr[p] | ROMAddr[p+1] << 8) != 0xffff);
-	 if((ROMAddr[p] | ROMAddr[p+1] << 8) == 0xffff) p -= 0x42;
-      }
-      p += 2;
-      return(&ROMAddr[p]);
-
+   if(a < b) {
+      tableptr = SiS_Part2CLVX_1;
+   } else if(a == b) {
+      tableptr = SiS_Part2CLVX_2;
    } else {
-
-      if(a < b) {
-         tableptr = SiS_Part2CLVX_1;
-      } else if(a == b) {
-         tableptr = SiS_Part2CLVX_2;
+      if(SiS_Pr->SiS_TVMode & TVSetPAL) {
+	 tableptr = SiS_Part2CLVX_4;
       } else {
-         if(SiS_Pr->SiS_TVMode & TVSetPAL) {
-	    tableptr = SiS_Part2CLVX_4;
-	 } else {
-	    tableptr = SiS_Part2CLVX_3;
-	 }
-	 if(SiS_Pr->SiS_VBInfo & SetCRT2ToYPbPr525750) {
-	    if(SiS_Pr->SiS_TVMode & TVSetYPbPr525i) 	 tableptr = SiS_Part2CLVX_3;
-	    else if(SiS_Pr->SiS_TVMode & TVSetYPbPr525p) tableptr = SiS_Part2CLVX_3;
-	    else 				         tableptr = SiS_Part2CLVX_5;
-
-	 } else if(SiS_Pr->SiS_VBInfo & SetCRT2ToHiVision) {
-	    tableptr = SiS_Part2CLVX_6;
-	 }
-	 do {
-	    if((tableptr[p] | tableptr[p+1] << 8) == a) break;
-	    p += 0x42;
-	 } while((tableptr[p] | tableptr[p+1] << 8) != 0xffff);
-	 if((tableptr[p] | tableptr[p+1] << 8) == 0xffff) p -= 0x42;
+	 tableptr = SiS_Part2CLVX_3;
+      }
+      if(SiS_Pr->SiS_VBInfo & SetCRT2ToYPbPr525750) {
+	 if(SiS_Pr->SiS_TVMode & TVSetYPbPr525i) 	tableptr = SiS_Part2CLVX_3;
+	 else if(SiS_Pr->SiS_TVMode & TVSetYPbPr525p) 	tableptr = SiS_Part2CLVX_3;
+	 else 				         	tableptr = SiS_Part2CLVX_5;
+      } else if(SiS_Pr->SiS_VBInfo & SetCRT2ToHiVision) {
+	 tableptr = SiS_Part2CLVX_6;
       }
-      p += 2;
-      return((UCHAR *)&tableptr[p]);
+      do {
+	 if((tableptr[p] | tableptr[p+1] << 8) == a) break;
+	 p += 0x42;
+      } while((tableptr[p] | tableptr[p+1] << 8) != 0xffff);
+      if((tableptr[p] | tableptr[p+1] << 8) == 0xffff) p -= 0x42;
    }
+   p += 2;
+   return((UCHAR *)&tableptr[p]);
 }
 
-
 static void
 SiS_SetGroup2_C_ELV(SiS_Private *SiS_Pr, USHORT ModeNo, USHORT ModeIdIndex,
 	      	    USHORT RefreshRateTableIndex, PSIS_HW_INFO HwInfo)
@@ -7121,49 +6476,97 @@ SiS_SetGroup2_C_ELV(SiS_Private *SiS_Pr, USHORT ModeNo, USHORT ModeIdIndex,
    SiS_SetRegANDOR(SiS_Pr->SiS_Part2Port,0x4e,0xeb,temp);
 }
 
-static void
+static BOOLEAN
 SiS_GetCRT2Part2Ptr(SiS_Private *SiS_Pr,USHORT ModeNo,USHORT ModeIdIndex,
 		    USHORT RefreshRateTableIndex,USHORT *CRT2Index,
 		    USHORT *ResIndex,PSIS_HW_INFO HwInfo)
 {
-  USHORT tempbx,tempal;
+
+  if(HwInfo->jChipType < SIS_315H) return FALSE;
 
   if(ModeNo <= 0x13)
-      	tempal = SiS_Pr->SiS_SModeIDTable[ModeIdIndex].St_CRT2CRTC;
+     (*ResIndex) = SiS_Pr->SiS_SModeIDTable[ModeIdIndex].St_CRT2CRTC;
   else
-      	tempal = SiS_Pr->SiS_RefIndex[RefreshRateTableIndex].Ext_CRT2CRTC;
+     (*ResIndex) = SiS_Pr->SiS_RefIndex[RefreshRateTableIndex].Ext_CRT2CRTC;
 
-  tempbx = SiS_Pr->SiS_LCDResInfo;
+  (*ResIndex) &= 0x3f;
+  (*CRT2Index) = 0;
 
-  if(SiS_Pr->SiS_LCDInfo & DontExpandLCD)      tempbx += 16;
-  else if(SiS_Pr->SiS_SetFlag & LCDVESATiming) tempbx += 32;
-
-  if(SiS_Pr->SiS_CustomT == CUT_COMPAQ1280) {
-     if(SiS_Pr->SiS_LCDResInfo == SiS_Pr->SiS_Panel1280x1024) {
-        tempbx = 100;
-        if(SiS_Pr->SiS_LCDInfo & DontExpandLCD)      tempbx = 101;
-  	else if(SiS_Pr->SiS_SetFlag & LCDVESATiming) tempbx = 102;
-     }
-  } else if(SiS_Pr->SiS_CustomT == CUT_CLEVO1024) {
-     if(SiS_Pr->SiS_LCDResInfo == SiS_Pr->SiS_Panel1024x768) {
-        if(SiS_IsDualLink(SiS_Pr, HwInfo)) {
-           tempbx = 103;
-           if(SiS_Pr->SiS_LCDInfo & DontExpandLCD)      tempbx = 104;
-  	   else if(SiS_Pr->SiS_SetFlag & LCDVESATiming) tempbx = 105;
-	}
-     }
-  } else if(SiS_Pr->SiS_CustomT == CUT_ASUSA2H_2) {
-     if(SiS_Pr->SiS_LCDResInfo == SiS_Pr->SiS_Panel1024x768) {
-        if(SiS_Pr->SiS_SetFlag & LCDVESATiming) tempbx = 106;
+  if(SiS_Pr->SiS_LCDResInfo == Panel_1024x768) {
+     if(!(SiS_Pr->SiS_SetFlag & LCDVESATiming)) {
+        (*CRT2Index) = 200;
      }
   }
 
-  *CRT2Index = tempbx;
-  *ResIndex = tempal & 0x3F;
+  if(SiS_Pr->SiS_CustomT == CUT_ASUSA2H_2) {
+     if(SiS_Pr->SiS_LCDResInfo == Panel_1024x768) {
+        if(SiS_Pr->SiS_SetFlag & LCDVESATiming) (*CRT2Index) = 206;
+     }
+  }
+  return(((*CRT2Index) != 0));
 }
 #endif
 
 #ifdef SIS300
+static void
+SiS_Group2LCDSpecial(SiS_Private *SiS_Pr, PSIS_HW_INFO HwInfo, USHORT ModeNo, USHORT crt2crtc)
+{
+   USHORT tempcx;
+   const UCHAR atable[] = {
+       0xc3,0x9e,0xc3,0x9e,0x02,0x02,0x02,
+       0xab,0x87,0xab,0x9e,0xe7,0x02,0x02
+   };
+
+   if(!SiS_Pr->UseCustomMode) {
+      if( ( ( (HwInfo->jChipType == SIS_630) ||
+              (HwInfo->jChipType == SIS_730) ) &&
+            (HwInfo->jChipRevision > 2) )  &&
+          (SiS_Pr->SiS_LCDResInfo == Panel_1024x768) &&
+          (!(SiS_Pr->SiS_SetFlag & LCDVESATiming))  &&
+          (!(SiS_Pr->SiS_LCDInfo & DontExpandLCD)) ) {
+         if(ModeNo == 0x13) {
+            SiS_SetReg(SiS_Pr->SiS_Part2Port,0x04,0xB9);
+            SiS_SetReg(SiS_Pr->SiS_Part2Port,0x05,0xCC);
+            SiS_SetReg(SiS_Pr->SiS_Part2Port,0x06,0xA6);
+         } else {
+            if((crt2crtc & 0x3F) == 4) {
+               SiS_SetReg(SiS_Pr->SiS_Part2Port,0x01,0x2B);
+               SiS_SetReg(SiS_Pr->SiS_Part2Port,0x02,0x13);
+               SiS_SetReg(SiS_Pr->SiS_Part2Port,0x04,0xE5);
+               SiS_SetReg(SiS_Pr->SiS_Part2Port,0x05,0x08);
+               SiS_SetReg(SiS_Pr->SiS_Part2Port,0x06,0xE2);
+            }
+         }
+      }
+
+      if(HwInfo->jChipType < SIS_315H) {
+         if(SiS_Pr->SiS_LCDTypeInfo == 0x0c) {
+            crt2crtc &= 0x1f;
+            tempcx = 0;
+            if(!(SiS_Pr->SiS_VBInfo & SetNotSimuMode)) {
+               if(SiS_Pr->SiS_VBInfo & SetInSlaveMode) {
+                  tempcx += 7;
+               }
+            }
+            tempcx += crt2crtc;
+            if(crt2crtc >= 4) {
+               SiS_SetReg(SiS_Pr->SiS_Part2Port,0x06,0xff);
+            }
+
+            if(!(SiS_Pr->SiS_VBInfo & SetNotSimuMode)) {
+               if(SiS_Pr->SiS_VBInfo & SetInSlaveMode) {
+                  if(crt2crtc == 4) {
+                     SiS_SetReg(SiS_Pr->SiS_Part2Port,0x01,0x28);
+                  }
+               }
+            }
+            SiS_SetReg(SiS_Pr->SiS_Part2Port,0x02,0x18);
+            SiS_SetReg(SiS_Pr->SiS_Part2Port,0x04,atable[tempcx]);
+         }
+      }
+   }
+}
+
 /* For ECS A907. Highly preliminary. */
 static void
 SiS_Set300Part2Regs(SiS_Private *SiS_Pr, PSIS_HW_INFO HwInfo,
@@ -7232,15 +6635,81 @@ SiS_SetTVSpecial(SiS_Private *SiS_Pr, USHORT ModeNo)
 	if(!(SiS_Pr->SiS_VBInfo & SetCRT2ToYPbPr525750)) {
 	   if(SiS_Pr->SiS_TVMode & TVSetPALM) {
 	      SiS_SetReg(SiS_Pr->SiS_Part2Port,0x01,0x14);
+	      SiS_SetReg(SiS_Pr->SiS_Part2Port,0x02,0x1b);
 	   } else {
-	      SiS_SetReg(SiS_Pr->SiS_Part2Port,0x01,0x15);
+	      SiS_SetReg(SiS_Pr->SiS_Part2Port,0x01,0x14);  /* 15 */
+	      SiS_SetReg(SiS_Pr->SiS_Part2Port,0x02,0x1a);  /* 1b */
 	   }
-	   SiS_SetReg(SiS_Pr->SiS_Part2Port,0x02,0x1b);
 	}
      }
   } else {
-     SiS_SetReg(SiS_Pr->SiS_Part2Port,0x01,0x21);
-     SiS_SetReg(SiS_Pr->SiS_Part2Port,0x02,0x5a);
+     if((ModeNo == 0x38) || (ModeNo == 0x4a) || (ModeNo == 0x64) ||
+        (ModeNo == 0x52) || (ModeNo == 0x58) || (ModeNo == 0x5c)) {
+        SiS_SetReg(SiS_Pr->SiS_Part2Port,0x01,0x1b);  /* 21 */
+        SiS_SetReg(SiS_Pr->SiS_Part2Port,0x02,0x54);  /* 5a */
+     } else {
+        SiS_SetReg(SiS_Pr->SiS_Part2Port,0x01,0x1a);  /* 21 */
+        SiS_SetReg(SiS_Pr->SiS_Part2Port,0x02,0x53);  /* 5a */
+     }
+  }
+}
+
+static void
+SiS_SetGroup2_Tail(SiS_Private *SiS_Pr, USHORT ModeNo)
+{
+  USHORT temp;
+
+  if(!(SiS_Pr->SiS_SetFlag & LCDVESATiming)) {
+     if(SiS_Pr->SiS_VGAVDE == 525) {
+	temp = 0xc3;
+	if(SiS_Pr->SiS_ModeType <= ModeVGA) {
+	   temp++;
+	   if(SiS_Pr->SiS_VBType & VB_SIS301BLV302BLV) temp += 2;
+	}
+	SiS_SetReg(SiS_Pr->SiS_Part2Port,0x2f,temp);
+	SiS_SetReg(SiS_Pr->SiS_Part2Port,0x30,0xb3);
+     } else if(SiS_Pr->SiS_VGAVDE == 420) {
+	temp = 0x4d;
+	if(SiS_Pr->SiS_ModeType <= ModeVGA) {
+	   temp++;
+	   if(SiS_Pr->SiS_VBType & VB_SIS301BLV302BLV) temp++;
+	}
+	SiS_SetReg(SiS_Pr->SiS_Part2Port,0x2f,temp);
+     }
+  }
+
+  if(SiS_Pr->SiS_VBInfo & SetCRT2ToLCD) {
+     if(SiS_Pr->SiS_LCDResInfo == Panel_1400x1050) {
+	if(SiS_Pr->SiS_VBType & VB_SIS301B302B) {
+	   SiS_SetRegOR(SiS_Pr->SiS_Part2Port,0x1a,0x03);
+	   /* Not always for LV, see SetGrp2 */
+	}
+	temp = 1;
+	if(ModeNo <= 0x13) temp = 3;
+	SiS_SetReg(SiS_Pr->SiS_Part2Port,0x0b,temp);
+     }
+#if 0
+     /* 651+301C, for 1280x768 - do I really need that? */
+     if((SiS_Pr->SiS_PanelXRes == 1280) && (SiS_Pr->SiS_PanelYRes == 768)) {
+        if(SiS_Pr->SiS_VBInfo & SetSimuScanMode) {
+	   if(((SiS_Pr->SiS_HDE == 640) && (SiS_Pr->SiS_VDE == 480)) ||
+	      ((SiS_Pr->SiS_HDE == 320) && (SiS_Pr->SiS_VDE == 240))) {
+	      SiS_SetReg(SiS_Part2Port,0x01,0x2b);
+	      SiS_SetReg(SiS_Part2Port,0x02,0x13);
+	      SiS_SetReg(SiS_Part2Port,0x04,0xe5);
+	      SiS_SetReg(SiS_Part2Port,0x05,0x08);
+	      SiS_SetReg(SiS_Part2Port,0x06,0xe2);
+	      SiS_SetReg(SiS_Part2Port,0x1c,0x21);
+	      SiS_SetReg(SiS_Part2Port,0x1d,0x45);
+	      SiS_SetReg(SiS_Part2Port,0x1f,0x0b);
+	      SiS_SetReg(SiS_Part2Port,0x20,0x00);
+	      SiS_SetReg(SiS_Part2Port,0x21,0xa9);
+	      SiS_SetReg(SiS_Part2Port,0x23,0x0b);
+	      SiS_SetReg(SiS_Part2Port,0x25,0x04);
+	   }
+	}
+     }
+#endif
   }
 }
 
@@ -7248,37 +6717,27 @@ static void
 SiS_SetGroup2(SiS_Private *SiS_Pr, USHORT ModeNo, USHORT ModeIdIndex,USHORT RefreshRateTableIndex,
 	      PSIS_HW_INFO HwInfo)
 {
-  USHORT      i, j, tempax, tempbx, tempcx, temp;
-  USHORT      push1, push2, modeflag, crt2crtc;
-  ULONG       longtemp, tempeax;
+  USHORT      i, j, tempax, tempbx, tempcx, tempch, tempcl, temp;
+  USHORT      push2, modeflag, crt2crtc, bridgeoffset;
+  ULONG       longtemp;
   const       UCHAR *PhasePoint;
   const       UCHAR *TimingPoint;
 #ifdef SIS315H
   USHORT      resindex, CRT2Index;
   const       SiS_Part2PortTblStruct *CRT2Part2Ptr = NULL;
-#endif
-#ifdef SIS300
-  const UCHAR atable[] = {
-       0xc3,0x9e,0xc3,0x9e,0x02,0x02,0x02,
-       0xab,0x87,0xab,0x9e,0xe7,0x02,0x02
-  };
-#endif
 
-#ifdef SIS315H   
   if(SiS_Pr->SiS_VBInfo & SetCRT2ToLCDA) return;
 #endif
 
   if(ModeNo <= 0x13) {
      modeflag = SiS_Pr->SiS_SModeIDTable[ModeIdIndex].St_ModeFlag;
      crt2crtc = SiS_Pr->SiS_SModeIDTable[ModeIdIndex].St_CRT2CRTC;
+  } else if(SiS_Pr->UseCustomMode) {
+     modeflag = SiS_Pr->CModeFlag;
+     crt2crtc = 0;
   } else {
-     if(SiS_Pr->UseCustomMode) {
-        modeflag = SiS_Pr->CModeFlag;
-	crt2crtc = 0;
-     } else {
-        modeflag = SiS_Pr->SiS_EModeIDTable[ModeIdIndex].Ext_ModeFlag;
-    	crt2crtc = SiS_Pr->SiS_RefIndex[RefreshRateTableIndex].Ext_CRT2CRTC;
-     }
+     modeflag = SiS_Pr->SiS_EModeIDTable[ModeIdIndex].Ext_ModeFlag;
+     crt2crtc = SiS_Pr->SiS_RefIndex[RefreshRateTableIndex].Ext_CRT2CRTC;
   }
 
   temp = 0;
@@ -7395,7 +6854,7 @@ SiS_SetGroup2(SiS_Private *SiS_Pr, USHORT ModeNo, USHORT ModeIdIndex,USHORT Refr
 
   if(SiS_Pr->SiS_VBInfo & SetCRT2ToHiVision) 	tempax = 950;
   else if(SiS_Pr->SiS_TVMode & TVSetPAL)      	tempax = 520;
-  else 			            		tempax = 440;
+  else 			            		tempax = 440; /* NTSC, YPbPr 525, 750 */
 
   if( ( (!(SiS_Pr->SiS_VBInfo & SetCRT2ToTVNoHiVision)) && (SiS_Pr->SiS_VDE <= tempax) ) ||
       ( (SiS_Pr->SiS_VBInfo & SetCRT2ToTVNoHiVision) &&
@@ -7411,10 +6870,10 @@ SiS_SetGroup2(SiS_Private *SiS_Pr, USHORT ModeNo, USHORT ModeIdIndex,USHORT Refr
      temp = tempax + (USHORT)TimingPoint[1];
      SiS_SetReg(SiS_Pr->SiS_Part2Port,0x02,temp);
 
-     if((SiS_Pr->SiS_VBInfo & SetCRT2ToTVNoHiVision) && (SiS_Pr->SiS_VGAHDE >= 1024)) {
+     if((SiS_Pr->SiS_VBInfo & SetCRT2ToTVNoYPbPrHiVision) && (SiS_Pr->SiS_VGAHDE >= 1024)) {
         if(SiS_Pr->SiS_TVMode & TVSetPAL) {
-           SiS_SetReg(SiS_Pr->SiS_Part2Port,0x01,0x19);
-           SiS_SetReg(SiS_Pr->SiS_Part2Port,0x02,0x52);
+           SiS_SetReg(SiS_Pr->SiS_Part2Port,0x01,0x1b);  /* 19 */
+           SiS_SetReg(SiS_Pr->SiS_Part2Port,0x02,0x54);  /* 52 */
         } else {
            SiS_SetReg(SiS_Pr->SiS_Part2Port,0x01,0x17);
            SiS_SetReg(SiS_Pr->SiS_Part2Port,0x02,0x1d);
@@ -7427,199 +6886,157 @@ SiS_SetGroup2(SiS_Private *SiS_Pr, USHORT ModeNo, USHORT ModeIdIndex,USHORT Refr
   if(SiS_IsDualLink(SiS_Pr, HwInfo)) tempcx >>= 1;
   tempcx--;
   if(SiS_Pr->SiS_VBType & VB_SIS301BLV302BLV) tempcx--;
-  temp = tempcx & 0x00FF;
-  SiS_SetReg(SiS_Pr->SiS_Part2Port,0x1B,temp);
-  temp = (tempcx & 0xFF00) >> 8;
-  SiS_SetRegANDOR(SiS_Pr->SiS_Part2Port,0x1D,0xF0,temp);
-
-  tempcx++;
-  if(SiS_Pr->SiS_VBType & VB_SIS301BLV302BLV) tempcx++;
-  tempcx >>= 1;
-
-  push1 = tempcx;
+  SiS_SetReg(SiS_Pr->SiS_Part2Port,0x1B,tempcx);
+  SiS_SetRegANDOR(SiS_Pr->SiS_Part2Port,0x1D,0xF0,((tempcx >> 8) & 0x0f));
 
+  tempcx = SiS_Pr->SiS_HT >> 1;
+  if(SiS_IsDualLink(SiS_Pr, HwInfo)) tempcx >>= 1;
   tempcx += 7;
   if(SiS_Pr->SiS_VBInfo & SetCRT2ToHiVision) tempcx -= 4;
-  temp = (tempcx & 0x00FF) << 4;
-  SiS_SetRegANDOR(SiS_Pr->SiS_Part2Port,0x22,0x0F,temp);
+  SiS_SetRegANDOR(SiS_Pr->SiS_Part2Port,0x22,0x0F,((tempcx << 4) & 0xf0));
 
-  tempbx = TimingPoint[j] | ((TimingPoint[j+1]) << 8);
+  tempbx = TimingPoint[j] | (TimingPoint[j+1] << 8);
   tempbx += tempcx;
-
-  temp = tempbx & 0x00FF;
-  SiS_SetReg(SiS_Pr->SiS_Part2Port,0x24,temp);
-  temp = ((tempbx & 0xFF00) >> 8) << 4;
-  SiS_SetRegANDOR(SiS_Pr->SiS_Part2Port,0x25,0x0F,temp);
+  SiS_SetReg(SiS_Pr->SiS_Part2Port,0x24,tempbx);
+  SiS_SetRegANDOR(SiS_Pr->SiS_Part2Port,0x25,0x0F,((tempbx >> 4) & 0xf0));
 
   tempbx += 8;
   if(SiS_Pr->SiS_VBInfo & SetCRT2ToHiVision) {
      tempbx -= 4;
      tempcx = tempbx;
   }
-  temp = (tempbx & 0x00FF) << 4;
-  SiS_SetRegANDOR(SiS_Pr->SiS_Part2Port,0x29,0x0F,temp);
+  SiS_SetRegANDOR(SiS_Pr->SiS_Part2Port,0x29,0x0F,((tempbx << 4) & 0xf0));
 
   j += 2;
-  tempcx += ((TimingPoint[j] | ((TimingPoint[j+1]) << 8)));
-  temp = tempcx & 0x00FF;
-  SiS_SetReg(SiS_Pr->SiS_Part2Port,0x27,temp);
-  temp = ((tempcx & 0xFF00) >> 8) << 4;
-  SiS_SetRegANDOR(SiS_Pr->SiS_Part2Port,0x28,0x0F,temp);
+  tempcx += (TimingPoint[j] | (TimingPoint[j+1] << 8));
+  SiS_SetReg(SiS_Pr->SiS_Part2Port,0x27,tempcx);
+  SiS_SetRegANDOR(SiS_Pr->SiS_Part2Port,0x28,0x0F,((tempcx >> 4) & 0xf0));
 
   tempcx += 8;
   if(SiS_Pr->SiS_VBInfo & SetCRT2ToHiVision) tempcx -= 4;
-  temp = (tempcx & 0x00FF) << 4;
-  SiS_SetRegANDOR(SiS_Pr->SiS_Part2Port,0x2A,0x0F,temp);
-
-  tempcx = push1;
+  SiS_SetRegANDOR(SiS_Pr->SiS_Part2Port,0x2A,0x0F,((tempcx << 4) & 0xf0));
 
+  tempcx = SiS_Pr->SiS_HT >> 1;
+  if(SiS_IsDualLink(SiS_Pr, HwInfo)) tempcx >>= 1;
   j += 2;
   tempcx -= (TimingPoint[j] | ((TimingPoint[j+1]) << 8));
-  temp = (tempcx & 0x00FF) << 4;
-  SiS_SetRegANDOR(SiS_Pr->SiS_Part2Port,0x2D,0x0F,temp);
+  SiS_SetRegANDOR(SiS_Pr->SiS_Part2Port,0x2D,0x0F,((tempcx << 4) & 0xf0));
 
   tempcx -= 11;
   if(!(SiS_Pr->SiS_VBInfo & SetCRT2ToTV)) {
      tempcx = SiS_GetVGAHT2(SiS_Pr) - 1;
   }
-  temp = tempcx & 0x00FF;
-  SiS_SetReg(SiS_Pr->SiS_Part2Port,0x2E,temp);
+  SiS_SetReg(SiS_Pr->SiS_Part2Port,0x2E,tempcx);
 
   tempbx = SiS_Pr->SiS_VDE;
-  if(SiS_Pr->SiS_VGAVDE == 360) tempbx = 746;
-  if(SiS_Pr->SiS_VGAVDE == 375) tempbx = 746;
-  if(SiS_Pr->SiS_VGAVDE == 405) tempbx = 853;
-  if(HwInfo->jChipType < SIS_315H) {
-     if(SiS_Pr->SiS_VBInfo & SetCRT2ToTV) tempbx >>= 1;
-  } else {
-     if( (SiS_Pr->SiS_VBInfo & SetCRT2ToTV) &&
-         (!(SiS_Pr->SiS_TVMode & (TVSetYPbPr525p|TVSetYPbPr750p))) ) {
-	tempbx >>= 1;
-	if(SiS_Pr->SiS_TVMode & TVSetTVSimuMode) {
-	   if(ModeNo <= 0x13) {
-	      if(crt2crtc == 1) tempbx++;
-	   }
+  if(SiS_Pr->SiS_VBInfo & SetCRT2ToLCD) {
+     if(SiS_Pr->SiS_VGAVDE == 360) tempbx = 746;
+     if(SiS_Pr->SiS_VGAVDE == 375) tempbx = 746;
+     if(SiS_Pr->SiS_VGAVDE == 405) tempbx = 853;
+  } else if( (SiS_Pr->SiS_VBInfo & SetCRT2ToTV) &&
+             (!(SiS_Pr->SiS_TVMode & (TVSetYPbPr525p|TVSetYPbPr750p))) ) {
+     tempbx >>= 1;
+     if(HwInfo->jChipType >= SIS_315H) {
+        if(SiS_Pr->SiS_TVMode & TVSetTVSimuMode) {
+	   if((ModeNo <= 0x13) && (crt2crtc == 1)) tempbx++;
 	} else if(SiS_Pr->SiS_VBInfo & SetInSlaveMode) {
-	   if(crt2crtc == 4) {
-              if(SiS_Pr->SiS_ModeType <= 3) tempbx++;
+	   if(SiS_Pr->SiS_ModeType <= ModeVGA) {
+	      if(crt2crtc == 4) tempbx++;
 	   }
 	}
      }
-  }
-  tempbx -= 2;
-  temp = tempbx & 0x00FF;
-  if(SiS_Pr->SiS_VBInfo & SetCRT2ToHiVision) {
      if(SiS_Pr->SiS_VBInfo & SetInSlaveMode) {
-        if((ModeNo == 0x2f) || (ModeNo == 0x5d) || (ModeNo == 0x5e)) temp++;
-     }
-  }
-
-  if(HwInfo->jChipType < SIS_661) {
-     /* From 1.10.7w - doesn't make sense */
-     if(SiS_Pr->SiS_VBInfo & SetCRT2ToTV) {
-        if(SiS_Pr->SiS_VBInfo & SetInSlaveMode) {
-           if(!(SiS_Pr->SiS_TVMode & TVSetPAL)) {
-	      if(!(SiS_Pr->SiS_SetFlag & LCDVESATiming)) {   /* SetFlag?? */
-	         if(ModeNo == 0x03) temp++;
-	      }
-	   }
+        if(SiS_Pr->SiS_VBInfo & SetCRT2ToHiVision) {
+	   if((ModeNo == 0x2f) || (ModeNo == 0x5d) || (ModeNo == 0x5e)) tempbx++;
+	}
+	if(!(SiS_Pr->SiS_TVMode & TVSetPAL)) {
+	   if(ModeNo == 0x03) tempbx++; /* From 1.10.7w - doesn't make sense */
         }
      }
   }
-  SiS_SetReg(SiS_Pr->SiS_Part2Port,0x2F,temp);
+  tempbx -= 2;
+  SiS_SetReg(SiS_Pr->SiS_Part2Port,0x2F,tempbx);
 
   temp = (tempcx >> 8) & 0x0F;
-  temp |= (((tempbx >> 8) << 6) & 0xC0);
-  if(!(SiS_Pr->SiS_VBInfo & (SetCRT2ToHiVision | SetCRT2ToYPbPr525750 | SetCRT2ToSCART))) {
+  temp |= ((tempbx >> 2) & 0xC0);
+  if(SiS_Pr->SiS_VBInfo & (SetCRT2ToSVIDEO | SetCRT2ToAVIDEO)) {
      temp |= 0x10;
-     if(!(SiS_Pr->SiS_VBInfo & SetCRT2ToSVIDEO)) temp |= 0x20;
+     if(SiS_Pr->SiS_VBInfo & SetCRT2ToAVIDEO) temp |= 0x20;
   }
   SiS_SetReg(SiS_Pr->SiS_Part2Port,0x30,temp);
 
-  if((HwInfo->jChipType > SIS_315H) && (HwInfo->jChipType < SIS_661)) {
-     if(SiS_Pr->SiS_VBInfo & SetCRT2ToLCD) {
-        if(SiS_Pr->SiS_VBType & (VB_SIS301C | VB_SIS302LV | VB_SIS302ELV)) {
-           if( (SiS_Pr->SiS_LCDResInfo == SiS_Pr->SiS_Panel1400x1050) ||
-               (SiS_Pr->SiS_LCDResInfo == SiS_Pr->SiS_Panel1600x1200) ) {
-              SiS_SetRegOR(SiS_Pr->SiS_Part4Port,0x10,0x60);
-	   }
-        }
+  if(SiS_Pr->SiS_VBType & (VB_SIS301C | VB_SIS302LV | VB_SIS302ELV)) {
+     SiS_SetRegANDOR(SiS_Pr->SiS_Part4Port,0x10,0xdf,((tempbx & 0x0400) >> 5));
+  }
+
+#if 0
+  /* TEST qqqq */
+  if(SiS_Pr->SiS_VBInfo & SetCRT2ToYPbPr525750) {
+     for(i=0x01, j=0; i<=0x2D; i++, j++) {
+        SiS_SetReg(SiS_Pr->SiS_Part2Port,i,TimingPoint[j]);
+     }
+     for(i=0x39; i<=0x45; i++, j++) {
+        SiS_SetReg(SiS_Pr->SiS_Part2Port,i,TimingPoint[j]);
      }
   }
+#endif
 
   if(SiS_Pr->SiS_VBType & VB_SIS301BLV302BLV) {
      tempbx = SiS_Pr->SiS_VDE;
-     if(SiS_Pr->SiS_VBInfo & SetCRT2ToTV) {
-        if(!(SiS_Pr->SiS_TVMode & (TVSetYPbPr525p | TVSetYPbPr750p))) {
-           tempbx >>= 1;
-	}
+     if( (SiS_Pr->SiS_VBInfo & SetCRT2ToTV) &&
+         (!(SiS_Pr->SiS_TVMode & (TVSetYPbPr525p | TVSetYPbPr750p))) ) {
+        tempbx >>= 1;
      }
      tempbx -= 3;
-     if(HwInfo->jChipType >= SIS_661) {
-        if(SiS_Pr->SiS_VBType & (VB_SIS301C | VB_SIS302LV | VB_SIS302ELV)) {  /* Why not 301B/LV? */
-           temp = 0;
-	   if(tempcx & 0x0400) temp |= 0x20;
-	   if(tempbx & 0x0400) temp |= 0x40;
-	   SiS_SetReg(SiS_Pr->SiS_Part4Port,0x10,temp);
-	}
-     }
-     tempbx &= 0x03ff;
-     temp = ((tempbx & 0xFF00) >> 8) << 5;
-     temp |= 0x18;
+     temp = ((tempbx >> 3) & 0x60) | 0x18;
      SiS_SetReg(SiS_Pr->SiS_Part2Port,0x46,temp);
-     temp = tempbx & 0x00FF;
-     SiS_SetReg(SiS_Pr->SiS_Part2Port,0x47,temp);
+     SiS_SetReg(SiS_Pr->SiS_Part2Port,0x47,tempbx);
 
+     if(SiS_Pr->SiS_VBType & (VB_SIS301C | VB_SIS302LV | VB_SIS302ELV)) {
+	SiS_SetRegANDOR(SiS_Pr->SiS_Part4Port,0x10,0xbf,((tempbx & 0x0400) >> 4));
+     }
   }
 
   tempbx = 0;
   if(!(modeflag & HalfDCLK)) {
      if(SiS_Pr->SiS_VGAHDE >= SiS_Pr->SiS_HDE) {
         tempax = 0;
-        tempbx |= 0x2000;
+        tempbx |= 0x20;
      }
   }
 
-  tempcx = 0x0101;
+  tempch = tempcl = 0x01;
   if(SiS_Pr->SiS_VBInfo & SetCRT2ToTV) {
      if(SiS_Pr->SiS_VGAHDE >= 1024) {
         if((!(modeflag & HalfDCLK)) || (HwInfo->jChipType < SIS_315H)) {
-           tempcx = 0x1920;
+           tempch = 0x19;
+	   tempcl = 0x20;
            if(SiS_Pr->SiS_VGAHDE >= 1280) {
-              tempcx = 0x1420;
-              tempbx &= ~0x2000;
+              tempch = 0x14;
+              tempbx &= ~0x20;
            }
         }
      }
   }
 
-  if(!(tempbx & 0x2000)) {
-     if(modeflag & HalfDCLK) {
-        tempcx = (tempcx & 0xFF00) | ((tempcx << 1) & 0x00FF);
-     }
-     longtemp = (SiS_Pr->SiS_VGAHDE * ((tempcx & 0xFF00) >> 8)) / (tempcx & 0x00FF);
-     longtemp <<= 13;
-     if(SiS_Pr->SiS_VBType & VB_SIS301BLV302BLV) {
-     	longtemp <<= 3;
-     }
-     tempeax = longtemp / SiS_Pr->SiS_HDE;
-     if(longtemp % SiS_Pr->SiS_HDE) tempeax++;
-     tempax = (USHORT)tempeax;
-     tempbx |= (tempax & 0x1F00);
-     tempcx = (tempax & 0xFF00) >> (8 + 5);
+  if(!(tempbx & 0x20)) {
+     if(modeflag & HalfDCLK) tempcl <<= 1;
+     longtemp = ((SiS_Pr->SiS_VGAHDE * tempch) / tempcl) << 13;
+     if(SiS_Pr->SiS_VBType & VB_SIS301BLV302BLV) longtemp <<= 3;
+     tempax = longtemp / SiS_Pr->SiS_HDE;
+     if(longtemp % SiS_Pr->SiS_HDE) tempax++;
+     tempbx |= ((tempax >> 8) & 0x1F);
+     tempcx = tempax >> 13;
   }
 
   SiS_SetReg(SiS_Pr->SiS_Part2Port,0x44,tempax);
-  SiS_SetRegANDOR(SiS_Pr->SiS_Part2Port,0x45,0xC0,(tempbx >> 8));
+  SiS_SetRegANDOR(SiS_Pr->SiS_Part2Port,0x45,0xC0,tempbx);
 
   if(SiS_Pr->SiS_VBType & VB_SIS301BLV302BLV) {
 
-     temp = tempcx & 0x0007;
-     if(tempbx & 0x2000) temp = 0;
-     if((HwInfo->jChipType < SIS_661) || (!(SiS_Pr->SiS_VBInfo & SetCRT2ToLCD))) {
-        temp |= 0x18;
-     }
-     SiS_SetRegANDOR(SiS_Pr->SiS_Part2Port,0x46,0xE0,temp);
+     tempcx &= 0x07;
+     if(tempbx & 0x20) tempcx = 0;
+     SiS_SetRegANDOR(SiS_Pr->SiS_Part2Port,0x46,0xF8,tempcx);
 
      if(SiS_Pr->SiS_TVMode & TVSetPAL) {
         tempbx = 0x0382;
@@ -7628,11 +7045,9 @@ SiS_SetGroup2(SiS_Private *SiS_Pr, USHORT ModeNo, USHORT ModeIdIndex,USHORT Refr
         tempbx = 0x0369;
         tempcx = 0x0061;
      }
-     temp = (tempbx & 0x00FF) ;
-     SiS_SetReg(SiS_Pr->SiS_Part2Port,0x4B,temp);
-     temp = (tempcx & 0x00FF) ;
-     SiS_SetReg(SiS_Pr->SiS_Part2Port,0x4C,temp);
-     temp = (tempcx & 0x0300) >> (8 - 2);
+     SiS_SetReg(SiS_Pr->SiS_Part2Port,0x4B,tempbx);
+     SiS_SetReg(SiS_Pr->SiS_Part2Port,0x4C,tempcx);
+     temp = (tempcx & 0x0300) >> 6;
      temp |= ((tempbx >> 8) & 0x03);
      if(SiS_Pr->SiS_VBInfo & SetCRT2ToYPbPr525750) {
         temp |= 0x10;
@@ -7642,7 +7057,7 @@ SiS_SetGroup2(SiS_Private *SiS_Pr, USHORT ModeNo, USHORT ModeIdIndex,USHORT Refr
      SiS_SetReg(SiS_Pr->SiS_Part2Port,0x4D,temp);
 
      temp = SiS_GetReg(SiS_Pr->SiS_Part2Port,0x43);
-     SiS_SetReg(SiS_Pr->SiS_Part2Port,0x43,(USHORT)(temp - 3));
+     SiS_SetReg(SiS_Pr->SiS_Part2Port,0x43,(temp - 3));
 
      SiS_SetTVSpecial(SiS_Pr, ModeNo);
 
@@ -7657,7 +7072,7 @@ SiS_SetGroup2(SiS_Private *SiS_Pr, USHORT ModeNo, USHORT ModeIdIndex,USHORT Refr
   if(SiS_Pr->SiS_TVMode & TVSetPALM) {
      if(!(SiS_Pr->SiS_TVMode & TVSetNTSC1024)) {
         temp = SiS_GetReg(SiS_Pr->SiS_Part2Port,0x01);
-        SiS_SetReg(SiS_Pr->SiS_Part2Port,0x01,temp - 1);
+        SiS_SetReg(SiS_Pr->SiS_Part2Port,0x01,(temp - 1));
      }
      SiS_SetRegAND(SiS_Pr->SiS_Part2Port,0x00,0xEF);
   }
@@ -7675,13 +7090,11 @@ SiS_SetGroup2(SiS_Private *SiS_Pr, USHORT ModeNo, USHORT ModeIdIndex,USHORT Refr
   tempbx = SiS_Pr->SiS_HDE;
   if(SiS_IsDualLink(SiS_Pr, HwInfo)) tempbx >>= 1;
   tempbx--;			         	/* RHACTE = HDE - 1 */
-  temp = tempbx & 0x00FF;
-  SiS_SetReg(SiS_Pr->SiS_Part2Port,0x2C,temp);
-  temp = (tempbx & 0xFF00) >> 4;
-  SiS_SetRegANDOR(SiS_Pr->SiS_Part2Port,0x2B,0x0F,temp);
+  SiS_SetReg(SiS_Pr->SiS_Part2Port,0x2C,tempbx);
+  SiS_SetRegANDOR(SiS_Pr->SiS_Part2Port,0x2B,0x0F,((tempbx >> 4) & 0xf0));
 
   temp = 0x01;
-  if(SiS_Pr->SiS_LCDResInfo == SiS_Pr->SiS_Panel1280x1024) {
+  if(SiS_Pr->SiS_LCDResInfo == Panel_1280x1024) {
      if(SiS_Pr->SiS_ModeType == ModeEGA) {
         if(SiS_Pr->SiS_VGAHDE >= 1024) {
            temp = 0x02;
@@ -7696,49 +7109,19 @@ SiS_SetGroup2(SiS_Private *SiS_Pr, USHORT ModeNo, USHORT ModeIdIndex,USHORT Refr
   SiS_SetReg(SiS_Pr->SiS_Part2Port,0x0B,temp);
 
   tempbx = SiS_Pr->SiS_VDE - 1;
-  temp = tempbx & 0x00FF;
-  SiS_SetReg(SiS_Pr->SiS_Part2Port,0x03,temp);
-  temp = ((tempbx & 0xFF00) >> 8) & 0x07;
-  SiS_SetRegANDOR(SiS_Pr->SiS_Part2Port,0x0C,0xF8,temp);
+  SiS_SetReg(SiS_Pr->SiS_Part2Port,0x03,tempbx);
+  SiS_SetRegANDOR(SiS_Pr->SiS_Part2Port,0x0C,0xF8,((tempbx >> 8) & 0x07));
 
   tempcx = SiS_Pr->SiS_VT - 1;
-  temp = tempcx & 0x00FF;
-  SiS_SetReg(SiS_Pr->SiS_Part2Port,0x19,temp);
-
-  temp = ((tempcx & 0xFF00) >> 8) << 5;
-
-  /* Enable dithering; only do this for 32bpp mode */
+  SiS_SetReg(SiS_Pr->SiS_Part2Port,0x19,tempcx);
+  temp = (tempcx >> 3) & 0xE0;
   if(SiS_Pr->SiS_LCDInfo & LCDRGB18Bit) {
+     /* Enable dithering; only do this for 32bpp mode */
      if(SiS_GetReg(SiS_Pr->SiS_Part1Port,0x00) & 0x01) {
         temp |= 0x10;
      }
   }
-
-  /* Must do special for Compaq1280; Acer1280 OK, Clevo1400 OK, COMPAL1400 OK */
-  /* Compaq1280 panel loses sync if using CR37 sync info. */
-  if((SiS_Pr->SiS_VBType & VB_SIS301BLV302BLV) && (SiS_Pr->SiS_VBInfo & SetCRT2ToLCD)) {
-     if((HwInfo->jChipType >= SIS_315H) && (SiS_Pr->SiS_VBType & VB_SIS301LV302LV)) {
-	if((SiS_Pr->SiS_CustomT == CUT_COMPAQ1280) &&
-	   (SiS_Pr->SiS_LCDResInfo == SiS_Pr->SiS_Panel1280x1024)) {
-	   if(SiS_Pr->SiS_LCDInfo & LCDSync) {
-	      temp |= ((SiS_Pr->SiS_LCDInfo & 0xc0) >> 6);
-	   }
-	} else if((SiS_Pr->SiS_CustomT == CUT_CLEVO1400) &&
-	          (SiS_Pr->SiS_LCDResInfo == SiS_Pr->SiS_Panel1400x1050)) {
-	   temp |= 0x03;
-	} else {
-           temp |= (SiS_GetReg(SiS_Pr->SiS_P3d4,0x37) >> 6);
-	   temp |= 0x08;
-	   if(!(SiS_Pr->SiS_LCDInfo & LCDRGB18Bit)) temp |= 0x04;
-	}
-     } else {
-        if(SiS_Pr->SiS_LCDInfo & LCDSync) {
-	   temp |= ((SiS_Pr->SiS_LCDInfo & 0xc0) >> 6);
-	}
-     }
-  }
-
-  SiS_SetReg(SiS_Pr->SiS_Part2Port,0x1A,temp);
+  SiS_SetRegANDOR(SiS_Pr->SiS_Part2Port,0x1A,0x0f,temp);
 
   SiS_SetRegAND(SiS_Pr->SiS_Part2Port,0x09,0xF0);
   SiS_SetRegAND(SiS_Pr->SiS_Part2Port,0x0A,0xF0);
@@ -7746,154 +7129,13 @@ SiS_SetGroup2(SiS_Private *SiS_Pr, USHORT ModeNo, USHORT ModeIdIndex,USHORT Refr
   SiS_SetRegAND(SiS_Pr->SiS_Part2Port,0x17,0xFB);
   SiS_SetRegAND(SiS_Pr->SiS_Part2Port,0x18,0xDF);
 
-#if 0  /* Use the 315/330 series code for now */
-  if((HwInfo->jChipType >= SIS_661)          &&
-     (SiS_Pr->SiS_VBType & VB_SIS301LV302LV) &&
-     (ROMAddr && SiS_Pr->SiS_UseROM)) {
-
-      /* This is done for the LVDS bridges only, since
-       * the TMDS panels already work correctly with
-       * the old code. Besides, we only do that if
-       * we can get the data from the ROM, I am tired
-       * of carrying a lot of tables around.
-       */
-
-#ifdef SIS315H 							/* ------------ 661/741/760 series --------- */
-      UCHAR *myptr = NULL, myptr1 = NULL;
-
-      myptr = (UCHAR *)GetLCDPtr661(SiS_Pr, HwInfo, 6, ModeNo, ModeIdIndex, RefreshRateTableIndex);
-      myptr1 = (UCHAR *)GetLCDStructPtr661(SiS_Pr, HwInfo);
-
-      tempbx = (myptr[3] | (myptr[4] << 8)) & 0x0fff;
-      tempcx = SiS_Pr->PanelYRes;
-      if(SiS_Pr->SiS_LCDInfo & LCDPass11) {
-         tempcx = SiS_Pr->SiS_VDE;
-      }
-
-      tempcx += tempbx;
-      if(tempcx >= SiS_Pr->SiS_VT) tempcx -= SiS_Pr->SiS_VT;
-
-      SiS_SetReg(SiS_Pr->SiS_Part2Port,0x05,tempbx);
-      SiS_SetReg(SiS_Pr->SiS_Part2Port,0x06,tempcx);
-
-      tempcx &= 0x07ff;
-      tempbx &= 0x07ff;
-      temp = (tempcx >> 8) << 3;
-      temp |= (tempbx >> 8);
-      SiS_SetReg(SiS_Pr->SiS_Part2Port,0x02,temp);
-
-      tempbx = (myptr[4] | (myptr[5] << 8)) >> 4;
-      tempcx = myptr1[6];
-      if(SiS_Pr->SiS_LCDInfo & LCDPass11) tempcx = myptr[7];
-
-      tempcx += tempbx;
-      if(tempcx >= SiS_Pr->SiS_VT) tempcx -= SiS_Pr->SiS_VT;
-
-      SiS_SetReg(SiS_Pr->SiS_Part2Port,0x04,tempbx);
-      temp = tempcx & 0x000f;
-      temp |= ((tempbx & 0x0f00) >> 4);
-      SiS_SetReg(SiS_Pr->SiS_Part2Port,0x01,temp);
-
-      tempax = SiS_Pr->SiS_HT;
-      tempbx = (myptr[0] | (myptr[1] << 8)) & 0x0fff;
-      tempcx = SiS_Pr->PanelXRes;
-      if(SiS_Pr->SiS_LCDInfo & LCDPass11) tempcx = SiS_Pr->SiS_HDE;
-
-      if(SiS_IsDualLink(SiS_Pr, HwInfo)) {
-         tempax >>= 1;
-	 tempbx >>= 1;
-	 tempcx >>= 1;
-      }
-      if(SiS_Pr->SiS_VBType & VB_SIS302LV)                 tempbx++;
-      if(SiS_Pr->SiS_VBType & (VB_SIS301C | VB_SIS302ELV)) tempbx++;
-
-      tempcx += tempbx;
-      if(tempcx >= tempax) tempcx -= tempax;
-
-      SiS_SetReg(SiS_Pr->SiS_Part2Port,0x1f,tempbx);
-      temp = ((tempbx & 0xff00) >> 8) << 4;
-      SiS_SetReg(SiS_Pr->SiS_Part2Port,0x20,temp);
-      SiS_SetReg(SiS_Pr->SiS_Part2Port,0x23,tempcx);
-      temp = tempcx >> 8;
-      SiS_SetReg(SiS_Pr->SiS_Part2Port,0x25,temp);
-
-      tempax = SiS_Pr->SiS_HT;
-      tempbx = (myptr[1] | (myptr[2] << 8)) >> 4;
-      tempcx = myptr1[5];
-      if(SiS_Pr->SiS_LCDInfo & LCDPass11) {
-         tempcx = myptr[6];
-      }
-      if(SiS_IsDualLink(SiS_Pr, HwInfo)) {
-         tempax >>= 1;
-	 tempbx >>= 1;
-	 tempcx >>= 1;
-      }
-      if(SiS_Pr->SiS_VBType & VB_SIS302LV) tempbx++;
-
-      tempcx += tempbx;
-      if(tempcx >= tempax) tempcx -= tempax;
-
-      SiS_SetReg(SiS_Pr->SiS_Part2Port,0x1c,tempbx);
-      temp = (tempbx & 0x0f00) >> 4;
-      SiS_SetRegANDOR(SiS_Pr->SiS_Part2Port,0x1d,0x0f,temp);
-      SiS_SetReg(SiS_Pr->SiS_Part2Port,0x21,tempcx);
-
-      if(!(SiS_Pr->SiS_SetFlag & LCDVESATiming)) {
-         if(SiS_Pr->SiS_VGAVDE == 525) {
-	    temp = 0xc3;
-	    if(SiS_Pr->SiS_ModeType <= ModeVGA) {
-	       temp++;
-	       if(SiS_Pr->SiS_VBType & VB_SIS301BLV302BLV) temp += 2;
-	    }
-	    SiS_SetReg(SiS_Pr->SiS_Part2Port,0x2f,temp);
-	    SiS_SetReg(SiS_Pr->SiS_Part2Port,0x30,0xb3);
-	 } else if(SiS_Pr->SiS_VGAVDE == 420) {
-	    temp = 0x4d;
-	    if(SiS_Pr->SiS_ModeType <= ModeVGA) {
-	       temp++;
-	       if(SiS_Pr->SiS_VBType & VB_SIS301BLV302BLV) temp++;
-	    }
-	    SiS_SetReg(SiS_Pr->SiS_Part2Port,0x2f,temp);
-	 }
-      }
-
-#endif
-
-  } else
-#endif
-         if((HwInfo->jChipType >= SIS_315H)                    &&
-            (SiS_Pr->SiS_VBType & VB_SIS301LV302LV)            &&
-            ((SiS_Pr->SiS_LCDResInfo == SiS_Pr->SiS_Panel1024x768)  ||
-             (SiS_Pr->SiS_LCDResInfo == SiS_Pr->SiS_Panel1280x1024) ||
-             (SiS_Pr->SiS_LCDResInfo == SiS_Pr->SiS_Panel1400x1050) ||
-             (SiS_Pr->SiS_LCDResInfo == SiS_Pr->SiS_Panel1600x1200)) ) {
-
-#ifdef SIS315H 							/* ------------- 315/330 series ------------ */
-
-      SiS_GetCRT2Part2Ptr(SiS_Pr, ModeNo, ModeIdIndex, RefreshRateTableIndex,
-                          &CRT2Index, &resindex, HwInfo);
-
+#ifdef SIS315H
+  if(SiS_GetCRT2Part2Ptr(SiS_Pr, ModeNo, ModeIdIndex, RefreshRateTableIndex,
+                          			&CRT2Index, &resindex, HwInfo)) {
       switch(CRT2Index) {
-        case Panel_1024x768      : CRT2Part2Ptr = SiS_Pr->SiS_CRT2Part2_1024x768_1;  break;  /* "Normal" */
-        case Panel_1280x1024     : CRT2Part2Ptr = SiS_Pr->SiS_CRT2Part2_1280x1024_1; break;
-	case Panel_1400x1050     : CRT2Part2Ptr = SiS_Pr->SiS_CRT2Part2_1400x1050_1; break;
-	case Panel_1600x1200     : CRT2Part2Ptr = SiS_Pr->SiS_CRT2Part2_1600x1200_1; break;
-        case Panel_1024x768  + 16: CRT2Part2Ptr = SiS_Pr->SiS_CRT2Part2_1024x768_2;  break;  /* Non-Expanding */
-        case Panel_1280x1024 + 16: CRT2Part2Ptr = SiS_Pr->SiS_CRT2Part2_1280x1024_2; break;
-	case Panel_1400x1050 + 16: CRT2Part2Ptr = SiS_Pr->SiS_CRT2Part2_1400x1050_2; break;
-	case Panel_1600x1200 + 16: CRT2Part2Ptr = SiS_Pr->SiS_CRT2Part2_1600x1200_2; break;
-        case Panel_1024x768  + 32: CRT2Part2Ptr = SiS_Pr->SiS_CRT2Part2_1024x768_3;  break;  /* VESA Timing */
-        case Panel_1280x1024 + 32: CRT2Part2Ptr = SiS_Pr->SiS_CRT2Part2_1280x1024_3; break;
-	case Panel_1400x1050 + 32: CRT2Part2Ptr = SiS_Pr->SiS_CRT2Part2_1400x1050_3; break;
-	case Panel_1600x1200 + 32: CRT2Part2Ptr = SiS_Pr->SiS_CRT2Part2_1600x1200_3; break;
-	case 100:		   CRT2Part2Ptr = (SiS_Part2PortTblStruct *)SiS310_CRT2Part2_Compaq1280x1024_1; break;  /* Custom */
-	case 101:		   CRT2Part2Ptr = (SiS_Part2PortTblStruct *)SiS310_CRT2Part2_Compaq1280x1024_2; break;
-	case 102:		   CRT2Part2Ptr = (SiS_Part2PortTblStruct *)SiS310_CRT2Part2_Compaq1280x1024_3; break;
-	case 103:		   CRT2Part2Ptr = (SiS_Part2PortTblStruct *)SiS310_CRT2Part2_Clevo1024x768_1; break;    /* Custom */
-	case 104:		   CRT2Part2Ptr = (SiS_Part2PortTblStruct *)SiS310_CRT2Part2_Clevo1024x768_2; break;
-	case 105:		   CRT2Part2Ptr = (SiS_Part2PortTblStruct *)SiS310_CRT2Part2_Clevo1024x768_3; break;
-	case 106:		   CRT2Part2Ptr = (SiS_Part2PortTblStruct *)SiS310_CRT2Part2_Asus1024x768_3; break;
-	default:                   CRT2Part2Ptr = SiS_Pr->SiS_CRT2Part2_1024x768_3;  break;
+        case 200: CRT2Part2Ptr = SiS_Pr->SiS_CRT2Part2_1024x768_1;   break;
+	case 206: CRT2Part2Ptr = SiS310_CRT2Part2_Asus1024x768_3;    break;
+	default:  CRT2Part2Ptr = SiS_Pr->SiS_CRT2Part2_1024x768_3;   break;
       }
 
       SiS_SetRegANDOR(SiS_Pr->SiS_Part2Port,0x01,0x80,(CRT2Part2Ptr+resindex)->CR[0]);
@@ -7910,58 +7152,34 @@ SiS_SetGroup2(SiS_Private *SiS_Pr, USHORT ModeNo, USHORT ModeIdIndex,USHORT Refr
       SiS_SetReg(SiS_Pr->SiS_Part2Port,0x23,(CRT2Part2Ptr+resindex)->CR[10]);
       SiS_SetRegANDOR(SiS_Pr->SiS_Part2Port,0x25,0x0f,(CRT2Part2Ptr+resindex)->CR[11]);
 
-      if(!(SiS_Pr->SiS_SetFlag & LCDVESATiming)) {
-        if(SiS_Pr->SiS_VGAVDE == 525) {
-	  temp = 0xc3;
-	  if(SiS_Pr->SiS_ModeType <= ModeVGA) {
-	     temp++;
-	     if(SiS_Pr->SiS_VBType & VB_SIS301BLV302BLV) temp += 2;
-	  }
-	  SiS_SetReg(SiS_Pr->SiS_Part2Port,0x2f,temp);
-	  SiS_SetReg(SiS_Pr->SiS_Part2Port,0x30,0xb3);
-	} else if(SiS_Pr->SiS_VGAVDE == 420) {
-	  temp = 0x4d;
-	  if(SiS_Pr->SiS_ModeType <= ModeVGA) {
-	     temp++;
-	     if(SiS_Pr->SiS_VBType & VB_SIS301BLV302BLV) temp++;
-	  }
-	  SiS_SetReg(SiS_Pr->SiS_Part2Port,0x2f,temp);
-	}
-     }
-
-     if(SiS_Pr->SiS_VBInfo & SetCRT2ToLCD) {
-        if(SiS_Pr->SiS_LCDResInfo == SiS_Pr->SiS_Panel1400x1050) {
-	   /* See Sync above, 0x1a */
-	   temp = 1;
-	   if(ModeNo <= 0x13) temp = 3;
-	   SiS_SetReg(SiS_Pr->SiS_Part2Port,0x0b,temp);
-	}
-     }
-#endif
+      SiS_SetGroup2_Tail(SiS_Pr, ModeNo);
 
-  } else {   /* ------ 300 series and other bridges, other LCD resolutions ------ */
 
-      /* Using this on the 301B with an auto-expanding 1024 panel (CR37=1) makes
-       * the panel scale at modes < 1024 (no black bars); if the panel is non-expanding,
-       * the bridge scales all modes to 1024.
-       * !!! Malfunction at 640x480 and 640x400 when panel is auto-expanding - black screen !!!
-       */
+  } else {
+#endif
 
-    tempcx = SiS_Pr->SiS_VT;
-    tempbx = SiS_Pr->PanelYRes;
+    /* Checked for 1024x768, 1280x1024, 1400x1050, 1600x1200 */
+    /*             Clevo dual-link 1024x768 */
+    /* 		   Compaq 1280x1024 has HT 1696 sometimes (calculation OK, if given HT is correct)  */
+    /*		   Acer: OK, but uses different setting for VESA timing at 640/800/1024 and 640x400 */
 
     if(SiS_Pr->SiS_LCDInfo & DontExpandLCD) {
-       tempbx = SiS_Pr->SiS_VDE - 1;
-       tempcx--;
-    }
-
-    tempax = 1;
-    if(!(SiS_Pr->SiS_LCDInfo & DontExpandLCD)) {
-       if(tempbx != SiS_Pr->SiS_VDE) {
-          tempax = tempbx;
-          if(tempax < SiS_Pr->SiS_VDE) {
-             tempax = 0;
-             tempcx = 0;
+       if((SiS_Pr->SiS_LCDInfo & LCDPass11) || (SiS_Pr->PanelYRes == SiS_Pr->SiS_VDE)) {
+          tempbx = SiS_Pr->SiS_VDE - 1;
+          tempcx = SiS_Pr->SiS_VT - 1;
+       } else {
+          tempbx = SiS_Pr->SiS_VDE + ((SiS_Pr->PanelYRes - SiS_Pr->SiS_VDE) / 2);
+	  tempcx = SiS_Pr->SiS_VT - ((SiS_Pr->PanelYRes - SiS_Pr->SiS_VDE) / 2);
+       }
+    } else {
+       tempbx = SiS_Pr->PanelYRes;
+       tempcx = SiS_Pr->SiS_VT;
+       tempax = 1;
+       if(SiS_Pr->PanelYRes != SiS_Pr->SiS_VDE) {
+          tempax = SiS_Pr->PanelYRes;
+	  /* if(SiS_Pr->SiS_VGAVDE == 525) tempax += 0x3c;   */  /* 651+301C */
+          if(SiS_Pr->PanelYRes < SiS_Pr->SiS_VDE) {
+             tempax = tempcx = 0;
           } else {
              tempax -= SiS_Pr->SiS_VDE;
           }
@@ -7971,29 +7189,55 @@ SiS_SetGroup2(SiS_Private *SiS_Pr, USHORT ModeNo, USHORT ModeIdIndex,USHORT Refr
        tempbx -= tempax; /* lcdvdee */
     }
 
-    /* Non-expanding: lcdvdees = tempcx = VT-1; lcdvdee = tempbx = VDE-1 */
+    /* Non-expanding: lcdvdes = tempcx = VT-1; lcdvdee = tempbx = VDE-1 */
 
 #ifdef TWDEBUG
     xf86DrvMsg(0, X_INFO, "lcdvdes 0x%x lcdvdee 0x%x\n", tempcx, tempbx);
 #endif
 
-    temp = tempcx & 0x00FF;   				/* RVEQ1EQ=lcdvdes */
-    SiS_SetReg(SiS_Pr->SiS_Part2Port,0x05,temp);
-    temp = tempbx & 0x00FF;   				/* RVEQ2EQ=lcdvdee */
-    SiS_SetReg(SiS_Pr->SiS_Part2Port,0x06,temp);
+    SiS_SetReg(SiS_Pr->SiS_Part2Port,0x05,tempcx);	/* lcdvdes  */
+    SiS_SetReg(SiS_Pr->SiS_Part2Port,0x06,tempbx);	/* lcdvdee  */
 
-    temp = ((tempbx & 0xFF00) >> 8) << 3;
-    temp |= ((tempcx & 0xFF00) >> 8);
+    temp = (tempbx >> 5) & 0x38;
+    temp |= ((tempcx >> 8) & 0x07);
     SiS_SetReg(SiS_Pr->SiS_Part2Port,0x02,temp);
 
-    tempbx = SiS_Pr->SiS_VT;    /* push2; */
-    tempax = SiS_Pr->SiS_VDE;   /* push1; */
-    tempcx = (tempbx - tempax) >> 4;
-    tempbx += tempax;
-    tempbx >>= 1;
-    if(SiS_Pr->SiS_LCDInfo & DontExpandLCD) tempbx -= 10;
+    tempax = SiS_Pr->SiS_VDE;
+    if((SiS_Pr->SiS_LCDInfo & DontExpandLCD) && (!(SiS_Pr->SiS_LCDInfo & LCDPass11))) {
+       tempax = SiS_Pr->PanelYRes;
+    }
+    tempcx = (SiS_Pr->SiS_VT - tempax) >> 4;
+    if((SiS_Pr->SiS_LCDInfo & DontExpandLCD) && (!(SiS_Pr->SiS_LCDInfo & LCDPass11))) {
+       if(SiS_Pr->PanelYRes != SiS_Pr->SiS_VDE) {
+	  tempcx = (SiS_Pr->SiS_VT - tempax) / 10;
+       }
+    }
+
+    tempbx = ((SiS_Pr->SiS_VT + SiS_Pr->SiS_VDE) >> 1) - 1;
+    if(SiS_Pr->SiS_LCDInfo & DontExpandLCD) {
+       if(SiS_Pr->PanelYRes != SiS_Pr->SiS_VDE) {
+          if(!(SiS_Pr->SiS_LCDInfo & LCDPass11)) { /* ? */
+             tempax = SiS_Pr->SiS_VT - SiS_Pr->PanelYRes;
+	     if(tempax % 4) { tempax >>= 2; tempax++; }
+	     else           { tempax >>= 2;           }
+             tempbx -= (tempax - 1);
+	  } else {
+	     tempbx -= 10;
+	     if(tempbx <= SiS_Pr->SiS_VDE) tempbx = SiS_Pr->SiS_VDE + 1;
+	  }
+       }
+    }
+    if(SiS_Pr->SiS_LCDResInfo == Panel_1024x768) {
+       tempbx++;
+       if((!(SiS_Pr->SiS_LCDInfo & DontExpandLCD)) || (crt2crtc == 6)) {
+          if(SiS_Pr->SiS_SetFlag & LCDVESATiming) {
+	     tempbx = 770;
+	     tempcx = 3;
+	  }
+       }
+    }
 
-    /* non-expanding: lcdvrs = tempbx = ((VT + VDE) / 2) - 10 */
+    /* non-expanding: lcdvrs = ((VT + VDE) / 2) - 10 */
 
     if(SiS_Pr->UseCustomMode) {
        tempbx = SiS_Pr->CVSyncStart;
@@ -8003,12 +7247,11 @@ SiS_SetGroup2(SiS_Private *SiS_Pr, USHORT ModeNo, USHORT ModeIdIndex,USHORT Refr
     xf86DrvMsg(0, X_INFO, "lcdvrs 0x%x\n", tempbx);
 #endif
 
-    temp = tempbx & 0x00FF;   				/* RTVACTEE = lcdvrs */
-    SiS_SetReg(SiS_Pr->SiS_Part2Port,0x04,temp);
+    SiS_SetReg(SiS_Pr->SiS_Part2Port,0x04,tempbx);	    /* lcdvrs */
 
-    temp = ((tempbx & 0xFF00) >> 8) << 4;
+    temp = (tempbx >> 4) & 0xF0;
     tempbx += (tempcx + 1);
-    temp |= (tempbx & 0x000F);
+    temp |= (tempbx & 0x0F);
 
     if(SiS_Pr->UseCustomMode) {
        temp &= 0xf0;
@@ -8021,149 +7264,103 @@ SiS_SetGroup2(SiS_Private *SiS_Pr, USHORT ModeNo, USHORT ModeIdIndex,USHORT Refr
 
     SiS_SetReg(SiS_Pr->SiS_Part2Port,0x01,temp);
 
-    /* Code from 630/301B (I+II) BIOS */
-
 #ifdef SIS300
-    if(!SiS_Pr->UseCustomMode) {
-       if( ( ( (HwInfo->jChipType == SIS_630) ||
-               (HwInfo->jChipType == SIS_730) ) &&
-             (HwInfo->jChipRevision > 2) )  &&
-           (SiS_Pr->SiS_LCDResInfo == SiS_Pr->SiS_Panel1024x768) &&
-           (!(SiS_Pr->SiS_SetFlag & LCDVESATiming))  &&
-           (!(SiS_Pr->SiS_LCDInfo & DontExpandLCD)) ) {
-          if(ModeNo == 0x13) {
-             SiS_SetReg(SiS_Pr->SiS_Part2Port,0x04,0xB9);
-             SiS_SetReg(SiS_Pr->SiS_Part2Port,0x05,0xCC);
-             SiS_SetReg(SiS_Pr->SiS_Part2Port,0x06,0xA6);
-          } else {
-             if((crt2crtc & 0x3F) == 4) {
-                SiS_SetReg(SiS_Pr->SiS_Part2Port,0x01,0x2B);
-                SiS_SetReg(SiS_Pr->SiS_Part2Port,0x02,0x13);
-                SiS_SetReg(SiS_Pr->SiS_Part2Port,0x04,0xE5);
-                SiS_SetReg(SiS_Pr->SiS_Part2Port,0x05,0x08);
-                SiS_SetReg(SiS_Pr->SiS_Part2Port,0x06,0xE2);
-             }
-          }
-       }
+    SiS_Group2LCDSpecial(SiS_Pr, HwInfo, ModeNo, crt2crtc);
+#endif
 
-       if(HwInfo->jChipType < SIS_315H) {
-          if(SiS_Pr->SiS_LCDTypeInfo == 0x0c) {
-             crt2crtc &= 0x1f;
-             tempcx = 0;
-             if(!(SiS_Pr->SiS_VBInfo & SetNotSimuMode)) {
-                if(SiS_Pr->SiS_VBInfo & SetInSlaveMode) {
-                   tempcx += 7;
-                }
-             }
-             tempcx += crt2crtc;
-             if(crt2crtc >= 4) {
-                SiS_SetReg(SiS_Pr->SiS_Part2Port,0x06,0xff);
-             }
+    bridgeoffset = 7;
+    if(SiS_Pr->SiS_VBType & VB_SIS301BLV302BLV)          bridgeoffset += 2;
+    if(SiS_Pr->SiS_VBType & (VB_SIS301C | VB_SIS302ELV)) bridgeoffset++;
+    if(SiS_IsDualLink(SiS_Pr, HwInfo))        		 bridgeoffset++;
 
-             if(!(SiS_Pr->SiS_VBInfo & SetNotSimuMode)) {
-                if(SiS_Pr->SiS_VBInfo & SetInSlaveMode) {
-                   if(crt2crtc == 4) {
-                      SiS_SetReg(SiS_Pr->SiS_Part2Port,0x01,0x28);
-                   }
-                }
-             }
-             SiS_SetReg(SiS_Pr->SiS_Part2Port,0x02,0x18);
-             SiS_SetReg(SiS_Pr->SiS_Part2Port,0x04,atable[tempcx]);
-          }
+    temp = 0;
+    if((SiS_Pr->SiS_LCDInfo & DontExpandLCD) && (!(SiS_Pr->SiS_LCDInfo & LCDPass11))) {
+       if(SiS_Pr->PanelXRes != SiS_Pr->SiS_HDE) {
+          temp = SiS_Pr->SiS_HT - ((SiS_Pr->PanelXRes - SiS_Pr->SiS_HDE) / 2);
+	  if(SiS_IsDualLink(SiS_Pr, HwInfo)) temp >>= 1;
        }
     }
-#endif
-
-    tempcx = (SiS_Pr->SiS_HT - SiS_Pr->SiS_HDE) >> 2;     /* (HT - HDE) >> 2 */
-    tempbx = SiS_Pr->SiS_HDE + 7;            		  /* lcdhdee         */
-    if(SiS_Pr->SiS_VBType & VB_SIS301BLV302BLV) {
-       tempbx += 2;
+    temp += bridgeoffset;
+    SiS_SetReg(SiS_Pr->SiS_Part2Port,0x1F,temp);  	     /* lcdhdes */
+    SiS_SetRegANDOR(SiS_Pr->SiS_Part2Port,0x20,0x0F,((temp >> 4) & 0xf0));
+
+    tempcx = SiS_Pr->SiS_HT;
+    tempax = tempbx = SiS_Pr->SiS_HDE;
+    if((SiS_Pr->SiS_LCDInfo & DontExpandLCD) && (!(SiS_Pr->SiS_LCDInfo & LCDPass11))) {
+       if(SiS_Pr->PanelXRes != SiS_Pr->SiS_HDE) {
+          tempax = SiS_Pr->PanelXRes;
+          tempbx = SiS_Pr->PanelXRes - ((SiS_Pr->PanelXRes - SiS_Pr->SiS_HDE) / 2);
+       }
+    }
+    if(SiS_IsDualLink(SiS_Pr, HwInfo)) {
+       tempcx >>= 1;
+       tempbx >>= 1;
+       tempax >>= 1;
     }
-    push1 = tempbx;
 
 #ifdef TWDEBUG
     xf86DrvMsg(0, X_INFO, "lcdhdee 0x%x\n", tempbx);
 #endif
 
-    temp = tempbx & 0x00FF;    			          /* RHEQPLE = lcdhdee */
-    SiS_SetReg(SiS_Pr->SiS_Part2Port,0x23,temp);
-    temp = (tempbx & 0xFF00) >> 8;
-    SiS_SetRegANDOR(SiS_Pr->SiS_Part2Port,0x25,0xF0,temp);
+    tempbx += bridgeoffset;
 
-    temp = 7;
-    if(SiS_Pr->SiS_VBType & VB_SIS301BLV302BLV) {
-       temp += 2;
-    }
-    SiS_SetReg(SiS_Pr->SiS_Part2Port,0x1F,temp);  	  /* RHBLKE = lcdhdes[7:0] */
-    SiS_SetRegAND(SiS_Pr->SiS_Part2Port,0x20,0x0F);	  /* lcdhdes [11:8] */
+    SiS_SetReg(SiS_Pr->SiS_Part2Port,0x23,tempbx);	    /* lcdhdee */
+    SiS_SetRegANDOR(SiS_Pr->SiS_Part2Port,0x25,0xF0,((tempbx >> 8) & 0x0f));
+
+    tempcx = (tempcx - tempax) >> 2;
 
     tempbx += tempcx;
     push2 = tempbx;
 
-    if(SiS_Pr->UseCustomMode) {
-       tempbx = SiS_Pr->CHSyncStart + 7;
-       if(SiS_Pr->SiS_VBType & VB_SIS301BLV302BLV) {
-          tempbx += 2;
+    if(SiS_Pr->SiS_LCDResInfo == Panel_1280x1024) {
+       if(SiS_Pr->SiS_LCDInfo & DontExpandLCD) {
+          if(SiS_Pr->SiS_LCDInfo & LCDPass11) {
+             if(SiS_Pr->SiS_HDE == 1280) tempbx = (tempbx & 0xff00) | 0x47;
+	  }
        }
     }
 
+    if(SiS_Pr->UseCustomMode) {
+       tempbx = SiS_Pr->CHSyncStart;
+       if(SiS_IsDualLink(SiS_Pr, HwInfo)) tempbx >>= 1;
+       tempbx += bridgeoffset;
+    }
+
 #ifdef TWDEBUG
     xf86DrvMsg(0, X_INFO, "lcdhrs 0x%x\n", tempbx);
 #endif
 
-    temp = tempbx & 0x00FF;            		          /* RHBURSTS = lcdhrs */
-    if(!SiS_Pr->UseCustomMode) {
-       if(SiS_Pr->SiS_LCDResInfo == SiS_Pr->SiS_Panel1280x1024) {
-          if(SiS_Pr->SiS_LCDInfo & DontExpandLCD) {
-             if(SiS_Pr->SiS_HDE == 1280) temp = 0x47;
-          }
-       }
-    }
-    SiS_SetReg(SiS_Pr->SiS_Part2Port,0x1C,temp);
-    temp = (tempbx & 0x0F00) >> 4;
-    SiS_SetRegANDOR(SiS_Pr->SiS_Part2Port,0x1D,0x0F,temp);
+    SiS_SetReg(SiS_Pr->SiS_Part2Port,0x1C,tempbx);	    /* lcdhrs */
+    SiS_SetRegANDOR(SiS_Pr->SiS_Part2Port,0x1D,0x0F,((tempbx >> 4) & 0xf0));
 
     tempbx = push2;
+
     tempcx <<= 1;
+    if((SiS_Pr->SiS_LCDInfo & DontExpandLCD) && (!(SiS_Pr->SiS_LCDInfo & LCDPass11))) {
+       if(SiS_Pr->PanelXRes != SiS_Pr->SiS_HDE) tempcx >>= 2;
+    }
     tempbx += tempcx;
 
     if(SiS_Pr->UseCustomMode) {
-       tempbx = SiS_Pr->CHSyncEnd + 7;
-       if(SiS_Pr->SiS_VBType & VB_SIS301BLV302BLV) {
-          tempbx += 2;
-       }
+       tempbx = SiS_Pr->CHSyncEnd;
+       if(SiS_IsDualLink(SiS_Pr, HwInfo)) tempbx >>= 1;
+       tempbx += bridgeoffset;
     }
 
 #ifdef TWDEBUG
     xf86DrvMsg(0, X_INFO, "lcdhre 0x%x\n", tempbx);
 #endif
 
-    temp = tempbx & 0x00FF;            		          /* RHSYEXP2S = lcdhre */
-    SiS_SetReg(SiS_Pr->SiS_Part2Port,0x21,temp);
-
-    if(!(SiS_Pr->SiS_SetFlag & LCDVESATiming)) {
-       if(SiS_Pr->SiS_VGAVDE == 525) {
-          if(SiS_Pr->SiS_ModeType <= ModeVGA)
-    	     temp=0xC6;
-          else
-       	     temp=0xC3;
-          SiS_SetReg(SiS_Pr->SiS_Part2Port,0x2f,temp);
-          SiS_SetReg(SiS_Pr->SiS_Part2Port,0x30,0xB3);
-       } else if(SiS_Pr->SiS_VGAVDE == 420) {
-          if(SiS_Pr->SiS_ModeType <= ModeVGA)
-	     temp=0x4F;
-          else
-       	     temp=0x4D;
-          SiS_SetReg(SiS_Pr->SiS_Part2Port,0x2f,temp);
-       }
-    }
+    SiS_SetReg(SiS_Pr->SiS_Part2Port,0x21,tempbx);	    /* lcdhre */
+
+    SiS_SetGroup2_Tail(SiS_Pr, ModeNo);
 
 #ifdef SIS300
-    SiS_Set300Part2Regs(SiS_Pr, HwInfo, ModeIdIndex,
-                        RefreshRateTableIndex, ModeNo);
+    SiS_Set300Part2Regs(SiS_Pr, HwInfo, ModeIdIndex, RefreshRateTableIndex, ModeNo);
+#endif
+#ifdef SIS315H
+  } /* CRT2-LCD from table */
 #endif
-
-  } /* HwInfo */
 }
 
 /*********************************************/
@@ -8174,26 +7371,14 @@ static void
 SiS_SetGroup3(SiS_Private *SiS_Pr, USHORT ModeNo, USHORT ModeIdIndex,
               PSIS_HW_INFO HwInfo)
 {
-  USHORT modeflag, i;
-  const UCHAR  *tempdi;
+  USHORT 	i;
+  const UCHAR  	*tempdi;
 
   if(SiS_Pr->SiS_VBInfo & SetCRT2ToLCDA) return;
 
-  if(ModeNo<=0x13) {
-     modeflag = SiS_Pr->SiS_SModeIDTable[ModeIdIndex].St_ModeFlag;
-  } else {
-     if(SiS_Pr->UseCustomMode) {
-        modeflag = SiS_Pr->CModeFlag;
-     } else {
-    	modeflag = SiS_Pr->SiS_EModeIDTable[ModeIdIndex].Ext_ModeFlag;
-     }
-  }
-
 #ifndef SIS_CP
   SiS_SetReg(SiS_Pr->SiS_Part3Port,0x00,0x00);
-#endif
-
-#ifdef SIS_CP
+#else
   SIS_CP_INIT301_CP
 #endif
 
@@ -8216,11 +7401,6 @@ SiS_SetGroup3(SiS_Private *SiS_Pr, USHORT ModeNo, USHORT ModeIdIndex,
      tempdi = SiS_Pr->SiS_HiTVGroup3Data;
      if(SiS_Pr->SiS_TVMode & TVSetTVSimuMode) {
         tempdi = SiS_Pr->SiS_HiTVGroup3Simu;
-#if 0
-        if(!(modeflag & Charx8Dot)) {
-           tempdi = SiS_Pr->SiS_HiTVGroup3Text;
-        }
-#endif
      }
   } else if(SiS_Pr->SiS_VBInfo & SetCRT2ToYPbPr525750) {
      if(!(SiS_Pr->SiS_TVMode & TVSetYPbPr525i)) {
@@ -8229,7 +7409,7 @@ SiS_SetGroup3(SiS_Private *SiS_Pr, USHORT ModeNo, USHORT ModeIdIndex,
      }
   }
   if(tempdi) {
-     for(i=0; i<=0x3E; i++){
+     for(i=0; i<=0x3E; i++) {
         SiS_SetReg(SiS_Pr->SiS_Part3Port,i,tempdi[i]);
      }
      if(SiS_Pr->SiS_VBType & (VB_SIS301C | VB_SIS302ELV)) {
@@ -8239,11 +7419,9 @@ SiS_SetGroup3(SiS_Private *SiS_Pr, USHORT ModeNo, USHORT ModeIdIndex,
      }
   }
 
-  if(!(SiS_Pr->SiS_VBInfo & (SetCRT2ToHiVision | SetCRT2ToYPbPr525750))) {
 #ifdef SIS_CP
-     SIS_CP_INIT301_CP2
+  SIS_CP_INIT301_CP2
 #endif
-  }
 }
 
 /*********************************************/
@@ -8252,11 +7430,37 @@ SiS_SetGroup3(SiS_Private *SiS_Pr, USHORT ModeNo, USHORT ModeIdIndex,
 
 #ifdef SIS315H
 static void
-SiS_SetGroup4_C_ELV(SiS_Private *SiS_Pr, PSIS_HW_INFO HwInfo)
+SiS_ShiftXPos(SiS_Private *SiS_Pr, int shift)
 {
-   USHORT temp, temp1;
+   USHORT temp, temp1, temp2;
 
-   if(!(SiS_Pr->SiS_VBType & (VB_SIS301C | VB_SIS302ELV))) return;
+   temp1 = SiS_GetReg(SiS_Pr->SiS_Part2Port,0x1f);
+   temp2 = SiS_GetReg(SiS_Pr->SiS_Part2Port,0x20);
+   temp = (USHORT)((int)((temp1 | ((temp2 & 0xf0) << 4))) + shift);
+   SiS_SetReg(SiS_Pr->SiS_Part2Port,0x1f,temp);
+   SiS_SetRegANDOR(SiS_Pr->SiS_Part2Port,0x20,0x0f,((temp >> 4) & 0xf0));
+   temp = SiS_GetReg(SiS_Pr->SiS_Part2Port,0x2b) & 0x0f;
+   temp = (USHORT)((int)(temp) + shift);
+   SiS_SetRegANDOR(SiS_Pr->SiS_Part2Port,0x2b,0xf0,(temp & 0x0f));
+   temp1 = SiS_GetReg(SiS_Pr->SiS_Part2Port,0x43);
+   temp2 = SiS_GetReg(SiS_Pr->SiS_Part2Port,0x42);
+   temp = (USHORT)((int)((temp1 | ((temp2 & 0xf0) << 4))) + shift);
+   SiS_SetReg(SiS_Pr->SiS_Part2Port,0x43,temp);
+   SiS_SetRegANDOR(SiS_Pr->SiS_Part2Port,0x42,0x0f,((temp >> 4) & 0xf0));
+}
+
+static void
+SiS_SetGroup4_C_ELV(SiS_Private *SiS_Pr, PSIS_HW_INFO HwInfo,
+                    USHORT ModeNo, USHORT ModeIdIndex)
+{
+   USHORT temp, temp1, resinfo = 0;
+
+   if(!(SiS_Pr->SiS_VBType & VB_SIS301C)) return;
+   if(!(SiS_Pr->SiS_VBInfo & (SetCRT2ToHiVision | SetCRT2ToYPbPr525750))) return;
+
+   if(ModeNo > 0x13) {
+      resinfo = SiS_Pr->SiS_EModeIDTable[ModeIdIndex].Ext_RESINFO;
+   }
 
    SiS_SetRegOR(SiS_Pr->SiS_Part4Port,0x3a,0x08);
    temp = SiS_GetReg(SiS_Pr->SiS_Part4Port,0x3a);
@@ -8267,28 +7471,37 @@ SiS_SetGroup4_C_ELV(SiS_Private *SiS_Pr, PSIS_HW_INFO HwInfo)
          SiS_SetRegAND(SiS_Pr->SiS_Part4Port,0x25,0xf8);
       }
       SiS_SetRegAND(SiS_Pr->SiS_Part4Port,0x0f,0xfb);
-      temp = 0;
-      if(!(SiS_Pr->SiS_TVMode & TVSetYPbPr750p)) {
-         temp |= 0x0002;
-         if(!(SiS_Pr->SiS_TVMode & TVSetYPbPr525p)) {
-	    temp ^= 0x0402;
-	    if(!(SiS_Pr->SiS_TVMode & TVSetHiVision)) {
-	       temp ^= 0x0002;
-	    }
-	 }
-      }
+      if(SiS_Pr->SiS_TVMode & TVSetYPbPr750p)      temp = 0x0000;
+      else if(SiS_Pr->SiS_TVMode & TVSetYPbPr525p) temp = 0x0002;
+      else if(SiS_Pr->SiS_TVMode & TVSetHiVision)  temp = 0x0400;
+      else					   temp = 0x0402;
       if(HwInfo->jChipType >= SIS_661) {
-         temp1 = SiS_GetReg(SiS_Pr->SiS_P3d4,0x39);
-         if(temp1 & 0x01) temp |= 0x10;
-         if(temp1 & 0x02) temp |= 0x01;
-	 SiS_SetRegANDOR(SiS_Pr->SiS_Part4Port,0x26,0xec,(temp & 0xff));
+         temp1 = 0;
+	 if(SiS_Pr->SiS_TVMode & TVAspect43) temp1 = 4;
+	 SiS_SetRegANDOR(SiS_Pr->SiS_Part4Port,0x0f,0xfb,temp1);
+	 if(SiS_Pr->SiS_TVMode & TVAspect43LB) temp |= 0x01;
+	 SiS_SetRegANDOR(SiS_Pr->SiS_Part4Port,0x26,0x7c,(temp & 0xff));
       } else {
          temp1 = SiS_GetReg(SiS_Pr->SiS_P3d4,0x3b) & 0x03;
 	 if(temp1 == 0x01) temp |= 0x01;
 	 if(temp1 == 0x03) temp |= 0x04;  /* ? why not 0x10? */
-	 SiS_SetRegANDOR(SiS_Pr->SiS_Part4Port,0x26,0xea,(temp & 0xff));
+	 SiS_SetRegANDOR(SiS_Pr->SiS_Part4Port,0x26,0xf8,(temp & 0xff));
       }
       SiS_SetRegANDOR(SiS_Pr->SiS_Part4Port,0x3a,0xfb,(temp >> 8));
+
+      if(HwInfo->jChipType >= SIS_661) { 		/* ? */
+         if(SiS_Pr->SiS_TVMode & TVAspect43) {
+            if(SiS_Pr->SiS_TVMode & TVSetYPbPr750p) {
+	       if(resinfo == SIS_RI_1024x768) {
+	          SiS_ShiftXPos(SiS_Pr, 97);
+	       } else {
+	          SiS_ShiftXPos(SiS_Pr, 111);
+	       }
+	    } else if(SiS_Pr->SiS_TVMode & TVSetHiVision) {
+	       SiS_ShiftXPos(SiS_Pr, 136);
+	    }
+         }
+      }
    }
 }
 #endif
@@ -8330,25 +7543,22 @@ SiS_SetCRT2VCLK(SiS_Private *SiS_Pr, USHORT ModeNo, USHORT ModeIdIndex,
   SiS_SetRegOR(SiS_Pr->SiS_Part4Port,0x12,temp);
 }
 
-/* Set 301 VGA2 registers */
 static void
 SiS_SetGroup4(SiS_Private *SiS_Pr, USHORT ModeNo, USHORT ModeIdIndex,
   	      USHORT RefreshRateTableIndex, PSIS_HW_INFO HwInfo)
 {
-  USHORT tempax,tempcx,tempbx,modeflag,temp,temp2,resinfo;
+  USHORT tempax,tempcx,tempbx,modeflag,temp,resinfo;
   ULONG tempebx,tempeax,templong;
 
   if(ModeNo <= 0x13) {
      modeflag = SiS_Pr->SiS_SModeIDTable[ModeIdIndex].St_ModeFlag;
      resinfo = SiS_Pr->SiS_SModeIDTable[ModeIdIndex].St_ResInfo;
+  } else if(SiS_Pr->UseCustomMode) {
+     modeflag = SiS_Pr->CModeFlag;
+     resinfo = 0;
   } else {
-     if(SiS_Pr->UseCustomMode) {
-        modeflag = SiS_Pr->CModeFlag;
-	resinfo = 0;
-     } else {
-    	modeflag = SiS_Pr->SiS_EModeIDTable[ModeIdIndex].Ext_ModeFlag;
-	resinfo = SiS_Pr->SiS_EModeIDTable[ModeIdIndex].Ext_RESINFO;
-     }
+     modeflag = SiS_Pr->SiS_EModeIDTable[ModeIdIndex].Ext_ModeFlag;
+     resinfo = SiS_Pr->SiS_EModeIDTable[ModeIdIndex].Ext_RESINFO;
   }
 
   if(HwInfo->jChipType >= SIS_315H) {
@@ -8371,186 +7581,151 @@ SiS_SetGroup4(SiS_Private *SiS_Pr, USHORT ModeNo, USHORT ModeIdIndex,
 	   if(SiS_IsDualLink(SiS_Pr, HwInfo)) {
 	      SiS_SetRegOR(SiS_Pr->SiS_Part4Port,0x27,0x2c);
 	   }
-#ifdef SET_EMI
+
 	   if(SiS_Pr->SiS_VBType & (VB_SIS302LV | VB_SIS302ELV)) {
 	      SiS_SetReg(SiS_Pr->SiS_Part4Port,0x2a,0x00);
+#ifdef SET_EMI
 	      SiS_SetRegAND(SiS_Pr->SiS_Part4Port,0x30,0x0c);
+#endif
 	      SiS_SetReg(SiS_Pr->SiS_Part4Port,0x34,0x10);
 	   }
-#endif
 	}
    	return;
      }
   }
 
-  temp = SiS_Pr->SiS_RVBHCFACT;
-  SiS_SetReg(SiS_Pr->SiS_Part4Port,0x13,temp);
+  SiS_SetReg(SiS_Pr->SiS_Part4Port,0x13,SiS_Pr->SiS_RVBHCFACT);
 
   tempbx = SiS_Pr->SiS_RVBHCMAX;
-  temp = tempbx & 0x00FF;
-  SiS_SetReg(SiS_Pr->SiS_Part4Port,0x14,temp);
+  SiS_SetReg(SiS_Pr->SiS_Part4Port,0x14,tempbx);
 
-  temp2 = (((tempbx & 0xFF00) >> 8) << 7) & 0x00ff;
+  temp = (tempbx >> 1) & 0x80;
 
   tempcx = SiS_Pr->SiS_VGAHT - 1;
-  temp = tempcx & 0x00FF;
-  SiS_SetReg(SiS_Pr->SiS_Part4Port,0x16,temp);
+  SiS_SetReg(SiS_Pr->SiS_Part4Port,0x16,tempcx);
 
-  temp = (((tempcx & 0xFF00) >> 8) << 3) & 0x00ff;
-  temp2 |= temp;
+  temp |= ((tempcx >> 5) & 0x78);
 
   tempcx = SiS_Pr->SiS_VGAVT - 1;
-  if(!(SiS_Pr->SiS_VBInfo & SetCRT2ToTV))  tempcx -= 5;
-
-  temp = tempcx & 0x00FF;
-  SiS_SetReg(SiS_Pr->SiS_Part4Port,0x17,temp);
+  if(!(SiS_Pr->SiS_VBInfo & SetCRT2ToTV)) tempcx -= 5;
+  SiS_SetReg(SiS_Pr->SiS_Part4Port,0x17,tempcx);
 
-  temp = temp2 | ((tempcx & 0xFF00) >> 8);
+  temp |= ((tempcx >> 8) & 0x07);
   SiS_SetReg(SiS_Pr->SiS_Part4Port,0x15,temp);
 
   tempbx = SiS_Pr->SiS_VGAHDE;
-  if(modeflag & HalfDCLK)  tempbx >>= 1;
-  if(HwInfo->jChipType >= SIS_661) {
-     if(SiS_IsDualLink(SiS_Pr, HwInfo)) tempbx >>= 1;
-  }
+  if(modeflag & HalfDCLK)            tempbx >>= 1;
+  if(SiS_IsDualLink(SiS_Pr, HwInfo)) tempbx >>= 1;
 
-  temp = 0xA0;
-  if(SiS_Pr->SiS_VBInfo & SetCRT2ToHiVision) {
+  if(SiS_Pr->SiS_VBInfo & SetCRT2ToLCD) {
      temp = 0;
-     if(tempbx > 800) {
-        temp = 0xA0;
-        if(tempbx != 1024) {
-           temp = 0xC0;
-           if(tempbx != 1280) temp = 0;
-	}
-     }
-  } else if(SiS_Pr->SiS_VBInfo & SetCRT2ToTV) {
-     if(tempbx <= 800) {
-        temp = 0x80;
-     }
+     if(tempbx > 800)        temp = 0x60;
+  } else if(SiS_Pr->SiS_VBInfo & SetCRT2ToHiVision) {
+     temp = 0;
+     if(tempbx == 1024)      temp = 0xA0;
+     else if(tempbx > 1024)  temp = 0xC0;
+  } else if(SiS_Pr->SiS_TVMode & (TVSetYPbPr525p | TVSetYPbPr750p)) {
+     temp = 0;
+     if(tempbx >= 1280)      temp = 0x40;
+     else if(tempbx >= 1024) temp = 0x20;
   } else {
      temp = 0x80;
-     if(SiS_Pr->SiS_VBInfo & SetCRT2ToLCD) {
-        temp = 0;
-        if(tempbx > 800) temp = 0x60;
-     }
-  }
-
-  if(SiS_Pr->SiS_TVMode & (TVSetYPbPr525p | TVSetYPbPr750p)) {
-     temp = 0;
-     if(SiS_Pr->SiS_VGAHDE == 1024) temp = 0x20;
-  }
-
-  if(HwInfo->jChipType < SIS_661) {
-     if(SiS_IsDualLink(SiS_Pr, HwInfo)) temp = 0;
+     if(tempbx >= 1024)      temp = 0xA0;
   }
 
   if(SiS_Pr->SiS_VBType & VB_SIS301) {
-     if(SiS_Pr->SiS_LCDResInfo != SiS_Pr->SiS_Panel1280x1024)
-        temp |= 0x0A;
+     if(SiS_Pr->SiS_LCDResInfo != Panel_1280x1024) temp |= 0x0A;
   }
 
   SiS_SetRegANDOR(SiS_Pr->SiS_Part4Port,0x0E,0x10,temp);
 
+  tempeax = SiS_Pr->SiS_VGAVDE;
   tempebx = SiS_Pr->SiS_VDE;
-
   if(SiS_Pr->SiS_VBInfo & SetCRT2ToHiVision) {
      if(!(temp & 0xE0)) tempebx >>=1;
   }
 
   tempcx = SiS_Pr->SiS_RVBHRS;
-  temp = tempcx & 0x00FF;
-  SiS_SetReg(SiS_Pr->SiS_Part4Port,0x18,temp);
+  SiS_SetReg(SiS_Pr->SiS_Part4Port,0x18,tempcx);
+  tempcx >>= 8;
+  tempcx |= 0x40;
 
-  tempeax = SiS_Pr->SiS_VGAVDE;
-  tempcx |= 0x4000;
   if(tempeax <= tempebx) {
-     tempcx ^= 0x4000;
+     tempcx ^= 0x40;
   } else {
      tempeax -= tempebx;
   }
 
-  templong = (tempeax * 256 * 1024) % tempebx;
-  tempeax = (tempeax * 256 * 1024) / tempebx;
-  tempebx = tempeax;
-  if(templong != 0) tempebx++;
+  tempeax *= (256 * 1024);
+  templong = tempeax % tempebx;
+  tempeax /= tempebx;
+  if(templong) tempeax++;
 
-  temp = (USHORT)(tempebx & 0x000000FF);
+  temp = (USHORT)(tempeax & 0x000000FF);
   SiS_SetReg(SiS_Pr->SiS_Part4Port,0x1B,temp);
-  temp = (USHORT)((tempebx & 0x0000FF00) >> 8);
+  temp = (USHORT)((tempeax & 0x0000FF00) >> 8);
   SiS_SetReg(SiS_Pr->SiS_Part4Port,0x1A,temp);
-
-  tempbx = (USHORT)(tempebx >> 16);
-  temp = tempbx & 0x00FF;
-  temp <<= 4;
-  temp |= ((tempcx & 0xFF00) >> 8);
+  temp = (USHORT)((tempeax >> 12) & 0x70); /* sic! */
+  temp |= (tempcx & 0x4F);
   SiS_SetReg(SiS_Pr->SiS_Part4Port,0x19,temp);
 
   if(SiS_Pr->SiS_VBType & VB_SIS301BLV302BLV) {
 
      SiS_SetReg(SiS_Pr->SiS_Part4Port,0x1C,0x28);
 
+     /* Calc Linebuffer max address and set/clear decimode */
      tempbx = 0;
+     if(SiS_Pr->SiS_TVMode & (TVSetHiVision | TVSetYPbPr750p)) tempbx = 0x08;
      tempax = SiS_Pr->SiS_VGAHDE;
-     if(modeflag & HalfDCLK) 		tempax >>= 1;
+     if(modeflag & HalfDCLK)            tempax >>= 1;
      if(SiS_IsDualLink(SiS_Pr, HwInfo)) tempax >>= 1;
-     if(SiS_Pr->SiS_VBInfo & SetCRT2ToLCD) {
-	if(tempax > 800) tempax -= 800;
-     } else {
-        if(tempax > 800) {
-	   tempbx = 8;
-           if(tempax == 1024)
-	      tempax *= 25;
-           else
-	      tempax *= 20;
-
+     if(tempax > 800) {
+        if(SiS_Pr->SiS_VBInfo & SetCRT2ToLCD) {
+	   tempax -= 800;
+	} else {  /* 651+301C: Only if TVNoHiviNoYPbPr */
+	   tempbx = 0x08;
+           if(tempax == 1024) tempax *= 25;
+           else	              tempax *= 20;
 	   temp = tempax % 32;
-	   tempax /= 32;
-	   tempax--;
-	   if (temp!=0) tempax++;
-        }
+	   tempax /= 32;
+	   if(temp) tempax++;
+	   tempax++;
+	   if((SiS_Pr->SiS_VBInfo & SetCRT2ToTVNoYPbPrHiVision) ||
+	      (SiS_Pr->SiS_TVMode & TVSetYPbPr525i)) {
+	      if(resinfo == SIS_RI_1024x768) {
+	         /* Otherwise white line at right edge */
+	         tempax = (tempax & 0xff00) | 0x20;
+	      }
+	   }
+	}
      }
      tempax--;
-     temp = ((tempax & 0xFF00) >> 8) & 0x03;
-     if(SiS_Pr->SiS_VBInfo & SetCRT2ToTV) {			/* From 1.10.7w */
-	if(ModeNo > 0x13) {					/* From 1.10.7w */
-	   if(resinfo == SIS_RI_1024x768) tempax = 0x1f;	/* From 1.10.7w */
-	}							/* From 1.10.7w */
-     }								/* From 1.10.7w */
-     SiS_SetReg(SiS_Pr->SiS_Part4Port,0x1D,tempax & 0x00FF);
-     temp <<= 4;
-     temp |= tempbx;
+     temp = ((tempax >> 4) & 0x30) | tempbx;
+     SiS_SetReg(SiS_Pr->SiS_Part4Port,0x1D,tempax);
      SiS_SetReg(SiS_Pr->SiS_Part4Port,0x1E,temp);
 
-     if(SiS_Pr->SiS_VBType & VB_SIS301LV302LV) {
-	if(IS_SIS550650740660) {
-	   temp = 0x0026;  /* 1.10.7w; 1.10.8r; needs corresponding code in Dis/EnableBridge! */
-	} else {
-	   temp = 0x0036;
-	}
-     } else {
-	temp = 0x0036;
+     temp = 0x0036; tempbx = 0xD0;
+     if((IS_SIS550650740660) && (SiS_Pr->SiS_VBType & VB_SIS301LV302LV)) {
+	temp = 0x0026; tempbx = 0xC0; /* See En/DisableBridge() */
      }
      if(SiS_Pr->SiS_VBInfo & SetCRT2ToTV) {
         if(!(SiS_Pr->SiS_TVMode & (TVSetNTSC1024 | TVSetHiVision | TVSetYPbPr750p | TVSetYPbPr525p))) {
 	   temp |= 0x01;
 	   if(SiS_Pr->SiS_VBInfo & SetInSlaveMode) {
 	      if(!(SiS_Pr->SiS_TVMode & TVSetTVSimuMode)) {
-  	         temp &= 0xFE;
+  	         temp &= ~0x01;
 	      }
 	   }
 	}
      }
-     SiS_SetRegANDOR(SiS_Pr->SiS_Part4Port,0x1F,0xC0,temp);
+     SiS_SetRegANDOR(SiS_Pr->SiS_Part4Port,0x1F,tempbx,temp);
 
-     tempbx = SiS_Pr->SiS_HT;
+     tempbx = SiS_Pr->SiS_HT >> 1;
      if(SiS_IsDualLink(SiS_Pr, HwInfo)) tempbx >>= 1;
-     tempbx >>= 1;
      tempbx -= 2;
-     temp = ((tempbx & 0x0700) >> 8) << 3;
+     SiS_SetReg(SiS_Pr->SiS_Part4Port,0x22,tempbx);
+     temp = (tempbx >> 5) & 0x38;
      SiS_SetRegANDOR(SiS_Pr->SiS_Part4Port,0x21,0xC0,temp);
-     temp = tempbx & 0x00FF;
-     SiS_SetReg(SiS_Pr->SiS_Part4Port,0x22,temp);
 
      if(SiS_Pr->SiS_VBType & VB_SIS301LV302LV) {
 	if(SiS_Pr->SiS_VBInfo & SetCRT2ToLCD) {
@@ -8562,13 +7737,13 @@ SiS_SetGroup4(SiS_Private *SiS_Pr, USHORT ModeNo, USHORT ModeIdIndex,
 	      SiS_SetRegOR(SiS_Pr->SiS_Part4Port,0x27,0x2c);
 	   }
 	}
-#ifdef SET_EMI
 	if(SiS_Pr->SiS_VBType & (VB_SIS302LV | VB_SIS302ELV)) {
 	   SiS_SetReg(SiS_Pr->SiS_Part4Port,0x2a,0x00);
+#ifdef SET_EMI
 	   SiS_SetRegAND(SiS_Pr->SiS_Part4Port,0x30,0x0c);
+#endif
 	   SiS_SetReg(SiS_Pr->SiS_Part4Port,0x34,0x10);
 	}
-#endif
      }
 
   }  /* 301B */
@@ -8580,7 +7755,6 @@ SiS_SetGroup4(SiS_Private *SiS_Pr, USHORT ModeNo, USHORT ModeIdIndex,
 /*         SET PART 5 REGISTER GROUP         */
 /*********************************************/
 
-/* Set 301 Palette address port registers */
 static void
 SiS_SetGroup5(SiS_Private *SiS_Pr, USHORT ModeNo, USHORT ModeIdIndex,
               PSIS_HW_INFO HwInfo)
@@ -8590,7 +7764,7 @@ SiS_SetGroup5(SiS_Private *SiS_Pr, USHORT ModeNo, USHORT ModeIdIndex,
 
   if(SiS_Pr->SiS_ModeType == ModeVGA) {
      if(!(SiS_Pr->SiS_VBInfo & (SetInSlaveMode | LoadDACFlag))) {
-        SiS_EnableCRT2(SiS_Pr);
+        SiS_SetRegOR(SiS_Pr->SiS_P3c4,0x1E,0x20);
         SiS_LoadDAC(SiS_Pr, HwInfo, ModeNo, ModeIdIndex);
      }
   }
@@ -8608,11 +7782,8 @@ SiS_ModCRT1CRTC(SiS_Private *SiS_Pr, USHORT ModeNo, USHORT ModeIdIndex,
   USHORT ResIndex,DisplayType;
   const SiS_LVDSCRT1DataStruct *LVDSCRT1Ptr=NULL;
 
-  if(ModeNo <= 0x13) {
-     modeflag = SiS_Pr->SiS_SModeIDTable[ModeIdIndex].St_ModeFlag;
-  } else {
-     modeflag = SiS_Pr->SiS_EModeIDTable[ModeIdIndex].Ext_ModeFlag;
-  }
+  if(ModeNo <= 0x13) modeflag = SiS_Pr->SiS_SModeIDTable[ModeIdIndex].St_ModeFlag;
+  else               modeflag = SiS_Pr->SiS_EModeIDTable[ModeIdIndex].Ext_ModeFlag;
 
   if((SiS_Pr->SiS_CustomT == CUT_BARCO1366) ||
      (SiS_Pr->SiS_CustomT == CUT_BARCO1024) ||
@@ -8620,7 +7791,9 @@ SiS_ModCRT1CRTC(SiS_Private *SiS_Pr, USHORT ModeNo, USHORT ModeIdIndex,
      return;
 
   if(!(SiS_GetLVDSCRT1Ptr(SiS_Pr, ModeNo, ModeIdIndex, RefreshRateTableIndex,
-                          &ResIndex, &DisplayType))) return;
+                          &ResIndex, &DisplayType))) {
+     return;
+  }
 
   if(HwInfo->jChipType < SIS_315H) {
      if(SiS_Pr->SiS_SetFlag & SetDOSMode) return;
@@ -8628,16 +7801,16 @@ SiS_ModCRT1CRTC(SiS_Private *SiS_Pr, USHORT ModeNo, USHORT ModeIdIndex,
 
   switch(DisplayType) {
     case 0 : LVDSCRT1Ptr = SiS_Pr->SiS_LVDSCRT1800x600_1;           break;
-    case 1 : LVDSCRT1Ptr = SiS_Pr->SiS_LVDSCRT11024x768_1;          break;
-    case 2 : LVDSCRT1Ptr = SiS_Pr->SiS_LVDSCRT11280x1024_1;         break;
-    case 3 : LVDSCRT1Ptr = SiS_Pr->SiS_LVDSCRT1800x600_1_H;         break;
-    case 4 : LVDSCRT1Ptr = SiS_Pr->SiS_LVDSCRT11024x768_1_H;        break;
-    case 5 : LVDSCRT1Ptr = SiS_Pr->SiS_LVDSCRT11280x1024_1_H;       break;
-    case 6 : LVDSCRT1Ptr = SiS_Pr->SiS_LVDSCRT1800x600_2;           break;
-    case 7 : LVDSCRT1Ptr = SiS_Pr->SiS_LVDSCRT11024x768_2;          break;
-    case 8 : LVDSCRT1Ptr = SiS_Pr->SiS_LVDSCRT11280x1024_2;         break;
-    case 9 : LVDSCRT1Ptr = SiS_Pr->SiS_LVDSCRT1800x600_2_H;         break;
-    case 10: LVDSCRT1Ptr = SiS_Pr->SiS_LVDSCRT11024x768_2_H;        break;
+    case 1 : LVDSCRT1Ptr = SiS_Pr->SiS_LVDSCRT1800x600_1_H;         break;
+    case 2 : LVDSCRT1Ptr = SiS_Pr->SiS_LVDSCRT1800x600_2;           break;
+    case 3 : LVDSCRT1Ptr = SiS_Pr->SiS_LVDSCRT1800x600_2_H;         break;
+    case 4 : LVDSCRT1Ptr = SiS_Pr->SiS_LVDSCRT11024x768_1;          break;
+    case 5 : LVDSCRT1Ptr = SiS_Pr->SiS_LVDSCRT11024x768_1_H;        break;
+    case 6 : LVDSCRT1Ptr = SiS_Pr->SiS_LVDSCRT11024x768_2;          break;
+    case 7 : LVDSCRT1Ptr = SiS_Pr->SiS_LVDSCRT11024x768_2_H;        break;
+    case 8 : LVDSCRT1Ptr = SiS_Pr->SiS_LVDSCRT11280x1024_1;         break;
+    case 9 : LVDSCRT1Ptr = SiS_Pr->SiS_LVDSCRT11280x1024_1_H;       break;
+    case 10: LVDSCRT1Ptr = SiS_Pr->SiS_LVDSCRT11280x1024_2;         break;
     case 11: LVDSCRT1Ptr = SiS_Pr->SiS_LVDSCRT11280x1024_2_H;       break;
     case 12: LVDSCRT1Ptr = SiS_Pr->SiS_LVDSCRT1XXXxXXX_1;           break;
     case 13: LVDSCRT1Ptr = SiS_Pr->SiS_LVDSCRT1XXXxXXX_1_H;         break;
@@ -8676,7 +7849,7 @@ SiS_ModCRT1CRTC(SiS_Private *SiS_Pr, USHORT ModeNo, USHORT ModeIdIndex,
     default: LVDSCRT1Ptr = SiS_Pr->SiS_LVDSCRT11024x768_1;          break;
   }
 
-  SiS_SetRegAND(SiS_Pr->SiS_P3d4,0x11,0x7f);                        /*unlock cr0-7  */
+  SiS_SetRegAND(SiS_Pr->SiS_P3d4,0x11,0x7f);
 
   tempah = (LVDSCRT1Ptr + ResIndex)->CR[0];
   SiS_SetReg(SiS_Pr->SiS_P3d4,0x00,tempah);
@@ -8711,12 +7884,6 @@ SiS_ModCRT1CRTC(SiS_Private *SiS_Pr, USHORT ModeNo, USHORT ModeIdIndex,
   tempah <<= 5;
   if(modeflag & DoubleScanMode)  tempah |= 0x080;
   SiS_SetRegANDOR(SiS_Pr->SiS_P3d4,0x09,~0x020,tempah);
-
-  /* 650/LVDS BIOS - doesn't make sense */
-  if(SiS_Pr->SiS_VBInfo & SetCRT2ToTV) {
-     if(modeflag & HalfDCLK)
-        SiS_SetRegAND(SiS_Pr->SiS_P3d4,0x11,0x7f);
-  }
 }
 
 /*********************************************/
@@ -8731,7 +7898,7 @@ SiS_SetCRT2ECLK(SiS_Private *SiS_Pr, USHORT ModeNo, USHORT ModeIdIndex,
   USHORT clkbase, vclkindex=0;
   UCHAR  sr2b, sr2c;
 
-  if((SiS_Pr->SiS_LCDResInfo == SiS_Pr->SiS_Panel640x480) || (SiS_Pr->SiS_IF_DEF_TRUMPION == 1)) {
+  if((SiS_Pr->SiS_LCDResInfo == Panel_640x480) || (SiS_Pr->SiS_LCDInfo & LCDPass11)) {
 	SiS_Pr->SiS_SetFlag &= (~ProgrammingCRT2);
         if((SiS_Pr->SiS_RefIndex[RefreshRateTableIndex].Ext_CRTVCLK & 0x3f) == 2) {
 	   RefreshRateTableIndex--;
@@ -8748,7 +7915,7 @@ SiS_SetCRT2ECLK(SiS_Private *SiS_Pr, USHORT ModeNo, USHORT ModeIdIndex,
   sr2c = SiS_Pr->SiS_VCLKData[vclkindex].SR2C;
 
   if((SiS_Pr->SiS_CustomT == CUT_BARCO1366) || (SiS_Pr->SiS_CustomT == CUT_BARCO1024)) {
-     if((ROMAddr) && SiS_Pr->SiS_UseROM) {
+     if(SiS_Pr->SiS_UseROM) {
 	if(ROMAddr[0x220] & 0x01) {
            sr2b = ROMAddr[0x227];
 	   sr2c = ROMAddr[0x228];
@@ -8763,7 +7930,6 @@ SiS_SetCRT2ECLK(SiS_Private *SiS_Pr, USHORT ModeNo, USHORT ModeIdIndex,
      }
   }
 
-  SiS_SetReg(SiS_Pr->SiS_P3c4,0x05,0x86);
   SiS_SetReg(SiS_Pr->SiS_P3c4,0x31,0x20);
   SiS_SetReg(SiS_Pr->SiS_P3c4,clkbase,sr2b);
   SiS_SetReg(SiS_Pr->SiS_P3c4,clkbase+1,sr2c);
@@ -8783,14 +7949,17 @@ static void
 SiS_SetCHTVReg(SiS_Private *SiS_Pr, USHORT ModeNo, USHORT ModeIdIndex,
                USHORT RefreshRateTableIndex)
 {
-  USHORT temp, tempbx, tempcl;
+#if defined(SIS300) || defined(SIS315H)
+  USHORT temp, tempbx;
+#endif
+  USHORT tempcl;
   USHORT TVType, resindex;
   const SiS_CHTVRegDataStruct *CHTVRegData = NULL;
 
   if(ModeNo <= 0x13)
-    	tempcl = SiS_Pr->SiS_SModeIDTable[ModeIdIndex].St_CRT2CRTC;
+     tempcl = SiS_Pr->SiS_SModeIDTable[ModeIdIndex].St_CRT2CRTC;
   else
-    	tempcl = SiS_Pr->SiS_RefIndex[RefreshRateTableIndex].Ext_CRT2CRTC;
+     tempcl = SiS_Pr->SiS_RefIndex[RefreshRateTableIndex].Ext_CRT2CRTC;
 
   TVType = 0;
   if(SiS_Pr->SiS_TVMode & TVSetCHOverScan) TVType += 1;
@@ -8808,16 +7977,16 @@ SiS_SetCHTVReg(SiS_Private *SiS_Pr, USHORT ModeNo, USHORT ModeIdIndex,
 	}
   }
   switch(TVType) {
-    	case  0: CHTVRegData = SiS_Pr->SiS_CHTVReg_UNTSC; break;
-    	case  1: CHTVRegData = SiS_Pr->SiS_CHTVReg_ONTSC; break;
-    	case  2: CHTVRegData = SiS_Pr->SiS_CHTVReg_UPAL;  break;
-    	case  3: CHTVRegData = SiS_Pr->SiS_CHTVReg_OPAL;  break;
-	case  4: CHTVRegData = SiS_Pr->SiS_CHTVReg_UPALM; break;
-    	case  5: CHTVRegData = SiS_Pr->SiS_CHTVReg_OPALM; break;
-    	case  6: CHTVRegData = SiS_Pr->SiS_CHTVReg_UPALN; break;
-    	case  7: CHTVRegData = SiS_Pr->SiS_CHTVReg_OPALN; break;
-	case  8: CHTVRegData = SiS_Pr->SiS_CHTVReg_SOPAL; break;
-	default: CHTVRegData = SiS_Pr->SiS_CHTVReg_OPAL;  break;
+     case  0: CHTVRegData = SiS_Pr->SiS_CHTVReg_UNTSC; break;
+     case  1: CHTVRegData = SiS_Pr->SiS_CHTVReg_ONTSC; break;
+     case  2: CHTVRegData = SiS_Pr->SiS_CHTVReg_UPAL;  break;
+     case  3: CHTVRegData = SiS_Pr->SiS_CHTVReg_OPAL;  break;
+     case  4: CHTVRegData = SiS_Pr->SiS_CHTVReg_UPALM; break;
+     case  5: CHTVRegData = SiS_Pr->SiS_CHTVReg_OPALM; break;
+     case  6: CHTVRegData = SiS_Pr->SiS_CHTVReg_UPALN; break;
+     case  7: CHTVRegData = SiS_Pr->SiS_CHTVReg_OPALN; break;
+     case  8: CHTVRegData = SiS_Pr->SiS_CHTVReg_SOPAL; break;
+     default: CHTVRegData = SiS_Pr->SiS_CHTVReg_OPAL;  break;
   }
   resindex = tempcl & 0x3F;
 
@@ -9089,21 +8258,21 @@ SiS_ChrontelPowerSequencing(SiS_Private *SiS_Pr, PSIS_HW_INFO HwInfo)
   /* Set up Power up/down timing */
 
   if(HwInfo->jChipType == SIS_740) {
-     if(SiS_Pr->SiS_LCDResInfo == SiS_Pr->SiS_Panel1024x768) {
+     if(SiS_Pr->SiS_LCDResInfo == Panel_1024x768) {
         if(SiS_Pr->SiS_CustomT == CUT_ASUSL3000D) tableptr = asus1024_740;
         else    			          tableptr = table1024_740;
-     } else if((SiS_Pr->SiS_LCDResInfo == SiS_Pr->SiS_Panel1280x1024) ||
-               (SiS_Pr->SiS_LCDResInfo == SiS_Pr->SiS_Panel1400x1050) ||
-	       (SiS_Pr->SiS_LCDResInfo == SiS_Pr->SiS_Panel1600x1200)) {
+     } else if((SiS_Pr->SiS_LCDResInfo == Panel_1280x1024) ||
+               (SiS_Pr->SiS_LCDResInfo == Panel_1400x1050) ||
+	       (SiS_Pr->SiS_LCDResInfo == Panel_1600x1200)) {
 	if(SiS_Pr->SiS_CustomT == CUT_ASUSL3000D) tableptr = asus1400_740;
         else					  tableptr = table1400_740;
      } else return;
   } else {
-     if(SiS_Pr->SiS_LCDResInfo == SiS_Pr->SiS_Panel1024x768) {
+     if(SiS_Pr->SiS_LCDResInfo == Panel_1024x768) {
         tableptr = table1024_650;
-     } else if((SiS_Pr->SiS_LCDResInfo == SiS_Pr->SiS_Panel1280x1024) ||
-               (SiS_Pr->SiS_LCDResInfo == SiS_Pr->SiS_Panel1400x1050) ||
-	       (SiS_Pr->SiS_LCDResInfo == SiS_Pr->SiS_Panel1600x1200)) {
+     } else if((SiS_Pr->SiS_LCDResInfo == Panel_1280x1024) ||
+               (SiS_Pr->SiS_LCDResInfo == Panel_1400x1050) ||
+	       (SiS_Pr->SiS_LCDResInfo == Panel_1600x1200)) {
         tableptr = table1400_650;
      } else return;
   }
@@ -9139,45 +8308,35 @@ SiS_SetCH701xForLCD(SiS_Private *SiS_Pr, PSIS_HW_INFO HwInfo)
   int i;
 
   if(HwInfo->jChipType == SIS_740) {
-     if(SiS_Pr->SiS_LCDResInfo == SiS_Pr->SiS_Panel1024x768) {
-        tableptr = table1024_740;
-     } else if(SiS_Pr->SiS_LCDResInfo == SiS_Pr->SiS_Panel1280x1024) {
-        tableptr = table1280_740;
-     } else if(SiS_Pr->SiS_LCDResInfo == SiS_Pr->SiS_Panel1400x1050) {
-        tableptr = table1400_740;
-     } else if(SiS_Pr->SiS_LCDResInfo == SiS_Pr->SiS_Panel1600x1200) {
-        tableptr = table1600_740;
-     } else return;
+     if(SiS_Pr->SiS_LCDResInfo == Panel_1024x768)       tableptr = table1024_740;
+     else if(SiS_Pr->SiS_LCDResInfo == Panel_1280x1024) tableptr = table1280_740;
+     else if(SiS_Pr->SiS_LCDResInfo == Panel_1400x1050) tableptr = table1400_740;
+     else if(SiS_Pr->SiS_LCDResInfo == Panel_1600x1200) tableptr = table1600_740;
+     else return;
   } else {
-     if(SiS_Pr->SiS_LCDResInfo == SiS_Pr->SiS_Panel1024x768) {
-        tableptr = table1024_650;
-     } else if(SiS_Pr->SiS_LCDResInfo == SiS_Pr->SiS_Panel1280x1024) {
-        tableptr = table1280_650;
-     } else if(SiS_Pr->SiS_LCDResInfo == SiS_Pr->SiS_Panel1400x1050) {
-        tableptr = table1400_650;
-     } else if(SiS_Pr->SiS_LCDResInfo == SiS_Pr->SiS_Panel1600x1200) {
-        tableptr = table1600_650;
-     } else return;
+     if(SiS_Pr->SiS_LCDResInfo == Panel_1024x768)       tableptr = table1024_650;
+     else if(SiS_Pr->SiS_LCDResInfo == Panel_1280x1024) tableptr = table1280_650;
+     else if(SiS_Pr->SiS_LCDResInfo == Panel_1400x1050) tableptr = table1400_650;
+     else if(SiS_Pr->SiS_LCDResInfo == Panel_1600x1200) tableptr = table1600_650;
+     else return;
   }
 
   tempbh = SiS_GetCH701x(SiS_Pr,0x74);
   if((tempbh == 0xf6) || (tempbh == 0xc7)) {
      tempbh = SiS_GetCH701x(SiS_Pr,0x73);
      if(tempbh == 0xc8) {
-        if(SiS_Pr->SiS_LCDResInfo == SiS_Pr->SiS_Panel1024x768) return;
+        if(SiS_Pr->SiS_LCDResInfo == Panel_1024x768) return;
      } else if(tempbh == 0xdb) {
-        if(SiS_Pr->SiS_LCDResInfo == SiS_Pr->SiS_Panel1280x1024) return;
-	if(SiS_Pr->SiS_LCDResInfo == SiS_Pr->SiS_Panel1400x1050) return;
+        if(SiS_Pr->SiS_LCDResInfo == Panel_1280x1024) return;
+	if(SiS_Pr->SiS_LCDResInfo == Panel_1400x1050) return;
      } else if(tempbh == 0xde) {
-        if(SiS_Pr->SiS_LCDResInfo == SiS_Pr->SiS_Panel1600x1200) return;
+        if(SiS_Pr->SiS_LCDResInfo == Panel_1600x1200) return;
      }
   }
 
-  if(HwInfo->jChipType == SIS_740) {
-     tempbh = 0x0d;
-  } else {
-     tempbh = 0x0c;
-  }
+  if(HwInfo->jChipType == SIS_740) tempbh = 0x0d;
+  else     			   tempbh = 0x0c;
+
   for(i = 0; i < tempbh; i++) {
      SiS_SetCH701x(SiS_Pr,(tableptr[i] << 8) | regtable[i]);
   }
@@ -9564,13 +8723,12 @@ SiS_SetCRT2Group(SiS_Private *SiS_Pr, PSIS_HW_INFO HwInfo, USHORT ModeNo)
 
    SiS_GetCRT2Data(SiS_Pr, ModeNo, ModeIdIndex, RefreshRateTableIndex, HwInfo);
 
-   /* Set up Panel Link for LVDS, 301BDH and 30xLV(for LCDA) */
+   /* Set up Panel Link for LVDS and LCDA */
+   SiS_Pr->SiS_LCDHDES = SiS_Pr->SiS_LCDVDES = 0;
    if( (SiS_Pr->SiS_IF_DEF_LVDS == 1) ||
        ((SiS_Pr->SiS_VBType & VB_NoLCD) && (SiS_Pr->SiS_VBInfo & SetCRT2ToLCD)) ||
        ((HwInfo->jChipType >= SIS_315H) && (SiS_Pr->SiS_VBType & VB_SIS301BLV302BLV)) ) {
       SiS_GetLVDSDesData(SiS_Pr, ModeNo, ModeIdIndex, RefreshRateTableIndex, HwInfo);
-   } else {
-      SiS_Pr->SiS_LCDHDES = SiS_Pr->SiS_LCDVDES = 0;
    }
 
 #ifdef LINUX_XF86
@@ -9598,13 +8756,15 @@ SiS_SetCRT2Group(SiS_Private *SiS_Pr, PSIS_HW_INFO HwInfo, USHORT ModeNo)
       	   SiS_SetGroup3(SiS_Pr, ModeNo, ModeIdIndex, HwInfo);
       	   SiS_SetGroup4(SiS_Pr, ModeNo, ModeIdIndex, RefreshRateTableIndex, HwInfo);
 #ifdef SIS315H
-	   SiS_SetGroup4_C_ELV(SiS_Pr, HwInfo);
+	   SiS_SetGroup4_C_ELV(SiS_Pr, HwInfo, ModeNo, ModeIdIndex);
 #endif
       	   SiS_SetGroup5(SiS_Pr, ModeNo, ModeIdIndex, HwInfo);
 
+	   SiS_SetCRT2Sync(SiS_Pr, ModeNo, RefreshRateTableIndex, HwInfo);
+
 	   /* For 301BDH (Panel link initialization): */
 	   if((SiS_Pr->SiS_VBType & VB_NoLCD) && (SiS_Pr->SiS_VBInfo & SetCRT2ToLCD)) {
-	      if(SiS_Pr->SiS_LCDResInfo != SiS_Pr->SiS_Panel640x480) {
+	      if(SiS_Pr->SiS_LCDResInfo != Panel_640x480) {
 		 if(!((SiS_Pr->SiS_SetFlag & SetDOSMode) && ((ModeNo == 0x03) || (ModeNo == 0x10)))) {
 		    if(SiS_Pr->SiS_VBInfo & SetInSlaveMode) {
 		       SiS_ModCRT1CRTC(SiS_Pr,ModeNo,ModeIdIndex,
@@ -9619,15 +8779,13 @@ SiS_SetCRT2Group(SiS_Private *SiS_Pr, PSIS_HW_INFO HwInfo, USHORT ModeNo)
 
    } else {
 
-        if(SiS_Pr->SiS_LCDResInfo != SiS_Pr->SiS_Panel640x480) {
-	   if(SiS_Pr->SiS_IF_DEF_TRUMPION == 0) {
-    	      SiS_ModCRT1CRTC(SiS_Pr,ModeNo,ModeIdIndex,
-	                      RefreshRateTableIndex,HwInfo);
-	   }
+        SiS_SetCRT2Sync(SiS_Pr, ModeNo, RefreshRateTableIndex, HwInfo);
+
+        if(!(SiS_Pr->SiS_LCDInfo & LCDPass11)) {
+    	   SiS_ModCRT1CRTC(SiS_Pr,ModeNo,ModeIdIndex,RefreshRateTableIndex,HwInfo);
 	}
 
-        SiS_SetCRT2ECLK(SiS_Pr,ModeNo,ModeIdIndex,
-	                RefreshRateTableIndex,HwInfo);
+        SiS_SetCRT2ECLK(SiS_Pr,ModeNo,ModeIdIndex,RefreshRateTableIndex,HwInfo);
 
 	if(SiS_Pr->SiS_SetFlag & LowModeTests) {
      	   if(SiS_Pr->SiS_IF_DEF_CH70xx != 0) {
@@ -9639,8 +8797,7 @@ SiS_SetCRT2Group(SiS_Private *SiS_Pr, PSIS_HW_INFO HwInfo, USHORT ModeNo)
 		 }
 	      }
 	      if(SiS_Pr->SiS_VBInfo & SetCRT2ToTV) {
-       		 SiS_SetCHTVReg(SiS_Pr,ModeNo,ModeIdIndex,
-		               RefreshRateTableIndex);
+       		 SiS_SetCHTVReg(SiS_Pr,ModeNo,ModeIdIndex,RefreshRateTableIndex);
 	      }
      	   }
 	}
@@ -9651,7 +8808,7 @@ SiS_SetCRT2Group(SiS_Private *SiS_Pr, PSIS_HW_INFO HwInfo, USHORT ModeNo)
    if(HwInfo->jChipType < SIS_315H) {
       if(SiS_Pr->SiS_SetFlag & LowModeTests) {
 	 if(SiS_Pr->SiS_UseOEM) {
-	    if((SiS_Pr->SiS_UseROM) && ROMAddr && (SiS_Pr->SiS_UseOEM == -1)) {
+	    if((SiS_Pr->SiS_UseROM) && (SiS_Pr->SiS_UseOEM == -1)) {
 	       if((ROMAddr[0x233] == 0x12) && (ROMAddr[0x234] == 0x34)) {
 	          SiS_OEM300Setting(SiS_Pr,HwInfo,ModeNo,ModeIdIndex,
 	       			    RefreshRateTableIndex);
@@ -9684,13 +8841,11 @@ SiS_SetCRT2Group(SiS_Private *SiS_Pr, PSIS_HW_INFO HwInfo, USHORT ModeNo)
       if(SiS_Pr->SiS_SetFlag & LowModeTests) {
 	 if(HwInfo->jChipType < SIS_661) {
 	    SiS_FinalizeLCD(SiS_Pr, ModeNo, ModeIdIndex, HwInfo);
-            if(SiS_Pr->SiS_UseOEM) {
-               SiS_OEM310Setting(SiS_Pr, HwInfo, ModeNo, ModeIdIndex);
-            }
+            SiS_OEM310Setting(SiS_Pr, HwInfo, ModeNo, ModeIdIndex);
 	 } else {
 	    SiS_OEM661Setting(SiS_Pr, HwInfo, ModeNo, ModeIdIndex, RefreshRateTableIndex);
 	 }
-         SiS_CRT2AutoThreshold(SiS_Pr);
+         SiS_SetRegOR(SiS_Pr->SiS_Part1Port,0x01,0x40);
       }
    }
 #endif
@@ -9761,6 +8916,63 @@ SiS_SetupDDCN(SiS_Private *SiS_Pr)
   }
 }
 
+#ifdef SIS300
+static UCHAR *
+SiS_SetTrumpBlockLoop(SiS_Private *SiS_Pr, UCHAR *dataptr)
+{
+  int i, j, num;
+  USHORT tempah,temp;
+  UCHAR *mydataptr;
+
+  for(i=0; i<20; i++) {				/* Do 20 attempts to write */
+     mydataptr = dataptr;
+     num = *mydataptr++;
+     if(!num) return mydataptr;
+     if(i) {
+        SiS_SetStop(SiS_Pr);
+	SiS_DDC2Delay(SiS_Pr,SiS_I2CDELAYSHORT*2);
+     }
+     if(SiS_SetStart(SiS_Pr)) continue;		/* Set start condition */
+     tempah = SiS_Pr->SiS_DDC_DeviceAddr;
+     temp = SiS_WriteDDC2Data(SiS_Pr,tempah);	/* Write DAB (S0=0=write) */
+     if(temp) continue;				/*    (ERROR: no ack) */
+     tempah = *mydataptr++;
+     temp = SiS_WriteDDC2Data(SiS_Pr,tempah);	/* Write register number */
+     if(temp) continue;				/*    (ERROR: no ack) */
+     for(j=0; j<num; j++) {
+        tempah = *mydataptr++;
+        temp = SiS_WriteDDC2Data(SiS_Pr,tempah);/* Write DAB (S0=0=write) */
+	if(temp) break;
+     }
+     if(temp) continue;
+     if(SiS_SetStop(SiS_Pr)) continue;
+     return mydataptr;
+  }
+  return NULL;
+}
+
+static BOOLEAN
+SiS_SetTrumpionBlock(SiS_Private *SiS_Pr, UCHAR *dataptr)
+{
+  SiS_Pr->SiS_DDC_DeviceAddr = 0xF0;  		/* DAB (Device Address Byte) */
+  SiS_Pr->SiS_DDC_Index = 0x11;			/* Bit 0 = SC;  Bit 1 = SD */
+  SiS_Pr->SiS_DDC_Data  = 0x02;              	/* Bitmask in IndexReg for Data */
+  SiS_Pr->SiS_DDC_Clk   = 0x01;              	/* Bitmask in IndexReg for Clk */
+  SiS_SetupDDCN(SiS_Pr);
+
+  SiS_SetSwitchDDC2(SiS_Pr);
+
+  while(*dataptr) {
+     dataptr = SiS_SetTrumpBlockLoop(SiS_Pr, dataptr);
+     if(!dataptr) return FALSE;
+  }
+#ifdef TWDEBUG
+  xf86DrvMsg(0, X_INFO, "Trumpion block success\n");
+#endif
+  return TRUE;
+}
+#endif
+
 /* The Chrontel 700x is connected to the 630/730 via
  * the 630/730's DDC/I2C port.
  *
@@ -9796,6 +9008,20 @@ SiS_SetChReg(SiS_Private *SiS_Pr, USHORT tempbx, USHORT myor)
   return FALSE;
 }
 
+#ifdef SIS300
+/* Write Trumpion register */
+void
+SiS_SetTrumpReg(SiS_Private *SiS_Pr, USHORT tempbx)
+{
+  SiS_Pr->SiS_DDC_DeviceAddr = 0xF0;  		/* DAB (Device Address Byte) */
+  SiS_Pr->SiS_DDC_Index = 0x11;			/* Bit 0 = SC;  Bit 1 = SD */
+  SiS_Pr->SiS_DDC_Data  = 0x02;              	/* Bitmask in IndexReg for Data */
+  SiS_Pr->SiS_DDC_Clk   = 0x01;              	/* Bitmask in IndexReg for Clk */
+  SiS_SetupDDCN(SiS_Pr);
+  SiS_SetChReg(SiS_Pr, tempbx, 0);
+}
+#endif
+
 /* Write to Chrontel 700x */
 /* Parameter is [Data (S15-S8) | Register no (S7-S0)] */
 void
@@ -9831,17 +9057,16 @@ SiS_SetCH701x(SiS_Private *SiS_Pr, USHORT tempbx)
   SiS_Pr->SiS_DDC_Clk   = 0x04;                 /* Bitmask in IndexReg for Clk */
   SiS_SetupDDCN(SiS_Pr);
   SiS_Pr->SiS_DDC_DeviceAddr = 0xEA;  		/* DAB (Device Address Byte) */
-
   SiS_SetChReg(SiS_Pr, tempbx, 0);
 }
 
 void
 SiS_SetCH70xx(SiS_Private *SiS_Pr, USHORT tempbx)
 {
-   if(SiS_Pr->SiS_IF_DEF_CH70xx == 1)
-      SiS_SetCH700x(SiS_Pr,tempbx);
-   else
-      SiS_SetCH701x(SiS_Pr,tempbx);
+  if(SiS_Pr->SiS_IF_DEF_CH70xx == 1)
+     SiS_SetCH700x(SiS_Pr,tempbx);
+  else
+     SiS_SetCH701x(SiS_Pr,tempbx);
 }
 
 static USHORT
@@ -9873,6 +9098,21 @@ SiS_GetChReg(SiS_Private *SiS_Pr, USHORT myor)
   return 0xFFFF;
 }
 
+#ifdef SIS300
+/* Read from Trumpion */
+USHORT
+SiS_GetTrumpReg(SiS_Private *SiS_Pr, USHORT tempbx)
+{
+  SiS_Pr->SiS_DDC_DeviceAddr = 0xF0;	/* DAB */
+  SiS_Pr->SiS_DDC_Index = 0x11;		/* Bit 0 = SC;  Bit 1 = SD */
+  SiS_Pr->SiS_DDC_Data  = 0x02;         /* Bitmask in IndexReg for Data */
+  SiS_Pr->SiS_DDC_Clk   = 0x01;         /* Bitmask in IndexReg for Clk */
+  SiS_SetupDDCN(SiS_Pr);
+  SiS_Pr->SiS_DDC_ReadAddr = tempbx;
+  return(SiS_GetChReg(SiS_Pr,0));
+}
+#endif
+
 /* Read from Chrontel 700x */
 /* Parameter is [Register no (S7-S0)] */
 USHORT
@@ -9925,10 +9165,10 @@ SiS_GetCH701x(SiS_Private *SiS_Pr, USHORT tempbx)
 USHORT
 SiS_GetCH70xx(SiS_Private *SiS_Pr, USHORT tempbx)
 {
-   if(SiS_Pr->SiS_IF_DEF_CH70xx == 1)
-      return(SiS_GetCH700x(SiS_Pr, tempbx));
-   else
-      return(SiS_GetCH701x(SiS_Pr, tempbx));
+  if(SiS_Pr->SiS_IF_DEF_CH70xx == 1)
+     return(SiS_GetCH700x(SiS_Pr, tempbx));
+  else
+     return(SiS_GetCH701x(SiS_Pr, tempbx));
 }
 
 /* Our own DDC functions */
@@ -10315,6 +9555,8 @@ SiS_SenseLCDDDC(SiS_Private *SiS_Pr, SISPtr pSiS)
    for(i=0; i<7; i++) SiS_Pr->CP_DataValid[i] = FALSE;
    SiS_Pr->CP_HaveCustomData = FALSE;
    SiS_Pr->CP_MaxX = SiS_Pr->CP_MaxY = SiS_Pr->CP_MaxClock = 0;
+   SiS_Pr->CP_PreferredX = SiS_Pr->CP_PreferredY = 0;
+   SiS_Pr->CP_PreferredIndex = -1;
 
    if(!(pSiS->VBFlags & (VB_301|VB_301B|VB_301C|VB_302B))) return 0;
    if(pSiS->VBFlags & VB_30xBDH) return 0;
@@ -10409,12 +9651,14 @@ SiS_SenseLCDDDC(SiS_Private *SiS_Pr, SISPtr pSiS)
 	 SiS_Pr->CP_PreferredY = yres;
 
          switch(xres) {
+#if 0	    /* Treat as custom */
             case 800:
 	        if(yres == 600) {
 	     	   paneltype = Panel_800x600;
 	     	   checkexpand = TRUE;
 	        }
 	        break;
+#endif
             case 1024:
 	        if(yres == 768) {
 	     	   paneltype = Panel_1024x768;
@@ -10452,9 +9696,11 @@ SiS_SenseLCDDDC(SiS_Private *SiS_Pr, SISPtr pSiS)
 #if 0	    /* Treat this as custom, as we have no valid timing data yet */
 	    case 1600:
 	        if(pSiS->VGAEngine == SIS_315_VGA) {
-	           if(yres == 1200) {
-	              paneltype = Panel310_1600x1200;
-		      checkexpand = TRUE;
+		   if(pSiS->VBFlags & VB_301C) {
+	              if(yres == 1200) {
+	                 paneltype = Panel310_1600x1200;
+		         checkexpand = TRUE;
+		      }
 	           }
 	        }
       	        break;
@@ -10580,6 +9826,10 @@ SiS_SenseLCDDDC(SiS_Private *SiS_Pr, SISPtr pSiS)
 	          if(yres > SiS_Pr->CP_MaxY) SiS_Pr->CP_MaxY = yres;
 		  if(SiS_Pr->CP_Clock[i] > SiS_Pr->CP_MaxClock) SiS_Pr->CP_MaxClock = SiS_Pr->CP_Clock[i];
 
+		  if((SiS_Pr->CP_PreferredX == xres) && (SiS_Pr->CP_PreferredY == yres)) {
+	             SiS_Pr->CP_PreferredIndex = i;
+	          }
+
 		  SiS_Pr->CP_Vendor = buffer[9] | (buffer[8] << 8);
 		  SiS_Pr->CP_Product = buffer[10] | (buffer[11] << 8);
 
@@ -10660,28 +9910,20 @@ SiS_SenseLCDDDC(SiS_Private *SiS_Pr, SISPtr pSiS)
       SiS_Pr->CP_MaxX = xres = buffer[0x76] | (buffer[0x77] << 8);
       SiS_Pr->CP_MaxY = yres = buffer[0x78] | (buffer[0x79] << 8);
       switch(xres) {
+#if 0
          case 800:
 	     if(yres == 600) {
 	     	paneltype = Panel_800x600;
 	     	checkexpand = TRUE;
 	     }
 	     break;
+#endif
          case 1024:
 	     if(yres == 768) {
 	     	paneltype = Panel_1024x768;
 	     	checkexpand = TRUE;
 	     }
 	     break;
-	 case 1152:
-	     if(yres == 768) {
-	        if(pSiS->VGAEngine == SIS_300_VGA) {
-		   paneltype = Panel300_1152x768;
-		} else {
-		   paneltype = Panel310_1152x768;
-		}
-	     	checkexpand = TRUE;
-	     }
-	     break;
 	 case 1280:
 	     if(yres == 960) {
 	        if(pSiS->VGAEngine == SIS_315_VGA) {
@@ -10706,9 +9948,11 @@ SiS_SenseLCDDDC(SiS_Private *SiS_Pr, SISPtr pSiS)
 #if 0    /* Treat this one as custom since we have no timing data yet */
 	 case 1600:
 	     if(pSiS->VGAEngine == SIS_315_VGA) {
-	        if(yres == 1200) {
-	           paneltype = Panel310_1600x1200;
-		   checkexpand = TRUE;
+	        if(pSiS->VBFlags & VB_301C) {
+	           if(yres == 1200) {
+	              paneltype = Panel310_1600x1200;
+		      checkexpand = TRUE;
+		   }
 	        }
 	     }
       	     break;
@@ -10810,6 +10054,10 @@ SiS_SenseLCDDDC(SiS_Private *SiS_Pr, SISPtr pSiS)
 
 	       if(SiS_Pr->CP_Clock[i] > SiS_Pr->CP_MaxClock) SiS_Pr->CP_MaxClock = SiS_Pr->CP_Clock[i];
 
+	       if((SiS_Pr->CP_MaxX == xres) && (SiS_Pr->CP_MaxY == yres)) {
+	          SiS_Pr->CP_PreferredIndex = i;
+	       }
+
 	       SiS_Pr->CP_HSync_P[i] = (buffer[index + 17] & 0x02) ? TRUE : FALSE;
 	       SiS_Pr->CP_VSync_P[i] = (buffer[index + 17] & 0x04) ? TRUE : FALSE;
 	       SiS_Pr->CP_SyncValid[i] = TRUE;
@@ -10864,14 +10112,18 @@ SiS_SenseLCDDDC(SiS_Private *SiS_Pr, SISPtr pSiS)
    if(paneltype) {
        if(!SiS_Pr->CP_PreferredX) SiS_Pr->CP_PreferredX = SiS_Pr->CP_MaxX;
        if(!SiS_Pr->CP_PreferredY) SiS_Pr->CP_PreferredY = SiS_Pr->CP_MaxY;
-       cr37 &= 0xf1;
-       SiS_SetRegANDOR(SiS_Pr->SiS_P3d4,0x36,0xf0,paneltype);
-       SiS_SetRegANDOR(SiS_Pr->SiS_P3d4,0x37,0xf1,cr37);
        SiS_SetRegOR(SiS_Pr->SiS_P3d4,0x32,0x08);
+       SiS_SetReg(SiS_Pr->SiS_P3d4,0x36,paneltype);
+       cr37 &= 0xf1;
+       SiS_SetRegANDOR(SiS_Pr->SiS_P3d4,0x37,0x0c,cr37);
+       SiS_Pr->PanelSelfDetected = TRUE;
 #ifdef TWDEBUG
        xf86DrvMsgVerb(pSiS->pScrn->scrnIndex, X_PROBED, 3, 
-       	"CRT2: [DDC LCD results: 0x%02x, 0x%02x]\n", paneltype, cr37);
+       	   "CRT2: [DDC LCD results: 0x%02x, 0x%02x]\n", paneltype, cr37);
 #endif	
+   } else {
+       SiS_SetRegAND(SiS_Pr->SiS_P3d4,0x32,~0x08);
+       SiS_SetReg(SiS_Pr->SiS_P3d4,0x36,0x00);
    }
    return 0;
 }
@@ -11148,13 +10400,13 @@ GetRAMDACromptr(SiS_Private *SiS_Pr, PSIS_HW_INFO HwInfo)
   USHORT romptr;
 
   if(HwInfo->jChipType < SIS_330) {
-     romptr = ROMAddr[0x128] | (ROMAddr[0x129] << 8);
+     romptr = SISGETROMW(0x128);
      if(SiS_Pr->SiS_VBType & VB_SIS301B302B)
-        romptr = ROMAddr[0x12a] | (ROMAddr[0x12b] << 8);
+        romptr = SISGETROMW(0x12a);
   } else {
-     romptr = ROMAddr[0x1a8] | (ROMAddr[0x1a9] << 8);
+     romptr = SISGETROMW(0x1a8);
      if(SiS_Pr->SiS_VBType & VB_SIS301B302B)
-        romptr = ROMAddr[0x1aa] | (ROMAddr[0x1ab] << 8);
+        romptr = SISGETROMW(0x1aa);
   }
   return(romptr);
 }
@@ -11166,13 +10418,13 @@ GetLCDromptr(SiS_Private *SiS_Pr, PSIS_HW_INFO HwInfo)
   USHORT romptr;
 
   if(HwInfo->jChipType < SIS_330) {
-     romptr = ROMAddr[0x120] | (ROMAddr[0x121] << 8);
+     romptr = SISGETROMW(0x120);
      if(SiS_Pr->SiS_VBType & VB_SIS301BLV302BLV)
-        romptr = ROMAddr[0x122] | (ROMAddr[0x123] << 8);
+        romptr = SISGETROMW(0x122);
   } else {
-     romptr = ROMAddr[0x1a0] | (ROMAddr[0x1a1] << 8);
+     romptr = SISGETROMW(0x1a0);
      if(SiS_Pr->SiS_VBType & VB_SIS301BLV302BLV)
-        romptr = ROMAddr[0x1a2] | (ROMAddr[0x1a3] << 8);
+        romptr = SISGETROMW(0x1a2);
   }
   return(romptr);
 }
@@ -11184,13 +10436,13 @@ GetTVromptr(SiS_Private *SiS_Pr, PSIS_HW_INFO HwInfo)
   USHORT romptr;
 
   if(HwInfo->jChipType < SIS_330) {
-     romptr = ROMAddr[0x114] | (ROMAddr[0x115] << 8);
+     romptr = SISGETROMW(0x114);
      if(SiS_Pr->SiS_VBType & VB_SIS301BLV302BLV)
-        romptr = ROMAddr[0x11a] | (ROMAddr[0x11b] << 8);
+        romptr = SISGETROMW(0x11a);
   } else {
-     romptr = ROMAddr[0x194] | (ROMAddr[0x195] << 8);
+     romptr = SISGETROMW(0x194);
      if(SiS_Pr->SiS_VBType & VB_SIS301BLV302BLV)
-        romptr = ROMAddr[0x19a] | (ROMAddr[0x19b] << 8);
+        romptr = SISGETROMW(0x19a);
   }
   return(romptr);
 }
@@ -11212,9 +10464,9 @@ GetLCDPtrIndexBIOS(SiS_Private *SiS_Pr, PSIS_HW_INFO HwInfo)
      }
   }
 
-  index = SiS_Pr->SiS_LCDResInfo & 0x0F;
-  if(SiS_Pr->SiS_LCDResInfo == SiS_Pr->SiS_Panel1400x1050)      index -= 5;
-  else if(SiS_Pr->SiS_LCDResInfo == SiS_Pr->SiS_Panel1600x1200) index -= 6;
+  index = SiS_GetBIOSLCDResInfo(SiS_Pr) & 0x0F;
+  if(SiS_Pr->SiS_LCDResInfo == Panel_1400x1050)      index -= 5;
+  else if(SiS_Pr->SiS_LCDResInfo == Panel_1600x1200) index -= 6;
   index--;
   index *= 3;
   if(SiS_Pr->SiS_LCDInfo & DontExpandLCD) index += 2;
@@ -11227,12 +10479,9 @@ GetLCDPtrIndex(SiS_Private *SiS_Pr)
 {
   USHORT index;
 
-  index = SiS_Pr->SiS_LCDResInfo & 0x0F;
-  index--;
-  index *= 3;
-  if(SiS_Pr->SiS_LCDInfo & DontExpandLCD) index += 2;
+  index = ((SiS_GetBIOSLCDResInfo(SiS_Pr) & 0x0F) - 1) * 3;
+  if(SiS_Pr->SiS_LCDInfo & DontExpandLCD)         index += 2;
   else if(!(SiS_Pr->SiS_SetFlag & LCDVESATiming)) index++;
-
   return index;
 }
 
@@ -11258,7 +10507,7 @@ GetTVPtrIndex(SiS_Private *SiS_Pr)
 }
 
 static ULONG
-GetOEMTVPtr661_2(SiS_Private *SiS_Pr)
+GetOEMTVPtr661_2_GEN(SiS_Private *SiS_Pr, int addme)
 {
    USHORT index = 0, temp = 0;
 
@@ -11275,7 +10524,7 @@ GetOEMTVPtr661_2(SiS_Private *SiS_Pr)
    if(SiS_Pr->SiS_VBType & VB_SIS301BLV302BLV) {
       if((!(SiS_Pr->SiS_VBInfo & SetInSlaveMode)) ||
          (SiS_Pr->SiS_TVMode & TVSetTVSimuMode)) {
-	 index += 8;
+	 index += addme;
 	 temp++;
       }
       temp += 0x0100;
@@ -11283,16 +10532,37 @@ GetOEMTVPtr661_2(SiS_Private *SiS_Pr)
    return(ULONG)(index | (temp << 16));
 }
 
+static ULONG
+GetOEMTVPtr661_2_OLD(SiS_Private *SiS_Pr)
+{
+   return(GetOEMTVPtr661_2_GEN(SiS_Pr, 8));
+}
+
+#if 0
+static ULONG
+GetOEMTVPtr661_2_NEW(SiS_Private *SiS_Pr)
+{
+   return(GetOEMTVPtr661_2_GEN(SiS_Pr, 6));
+}
+#endif
+
 static int
 GetOEMTVPtr661(SiS_Private *SiS_Pr)
 {
    int index = 0;
 
-   if(SiS_Pr->SiS_TVMode & TVSetPAL)       index = 2;
-   if(SiS_Pr->SiS_TVMode & TVSetHiVision)  index = 4;
-   if(SiS_Pr->SiS_TVMode & TVSetYPbPr525i) index = 6;
-   if(SiS_Pr->SiS_TVMode & TVSetYPbPr525p) index = 8;
-   if(SiS_Pr->SiS_TVMode & TVSetYPbPr750p) index = 10;
+   if(SiS_Pr->SiS_TVMode & TVSetPAL)          index = 2;
+   if(SiS_Pr->SiS_ROMNew) {
+      if(SiS_Pr->SiS_TVMode & TVSetYPbPr525i) index = 4;
+      if(SiS_Pr->SiS_TVMode & TVSetYPbPr525p) index = 6;
+      if(SiS_Pr->SiS_TVMode & TVSetYPbPr750p) index = 8;
+      if(SiS_Pr->SiS_TVMode & TVSetHiVision)  index = 10;
+   } else {
+      if(SiS_Pr->SiS_TVMode & TVSetHiVision)  index = 4;
+      if(SiS_Pr->SiS_TVMode & TVSetYPbPr525i) index = 6;
+      if(SiS_Pr->SiS_TVMode & TVSetYPbPr525p) index = 8;
+      if(SiS_Pr->SiS_TVMode & TVSetYPbPr750p) index = 10;
+   }
 
    if(SiS_Pr->SiS_TVMode & TVSetTVSimuMode) index++;
 
@@ -11306,15 +10576,21 @@ SetDelayComp(SiS_Private *SiS_Pr, PSIS_HW_INFO HwInfo, USHORT ModeNo)
   USHORT delay=0,index,myindex,temp,romptr=0;
   BOOLEAN dochiptest = TRUE;
 
+  if(SiS_Pr->SiS_VBInfo & SetCRT2ToLCDA) {
+     SiS_SetRegAND(SiS_Pr->SiS_Part1Port,0x20,0xbf);
+  } else {
+     SiS_SetRegAND(SiS_Pr->SiS_Part1Port,0x35,0x7f);
+  }
+
   /* Find delay (from ROM, internal tables, PCI subsystem) */
 
   if(SiS_Pr->SiS_VBInfo & SetCRT2ToRAMDAC) {			/* ------------ VGA */
      
-     if((ROMAddr) && SiS_Pr->SiS_UseROM) {
+     if((SiS_Pr->SiS_UseROM) && (!(SiS_Pr->SiS_ROMNew))) {
         romptr = GetRAMDACromptr(SiS_Pr, HwInfo);
-	if(!romptr) return;
-	delay = ROMAddr[romptr];
-     } else {
+     }
+     if(romptr) delay = ROMAddr[romptr];
+     else {
         delay = 0x04;
         if(SiS_Pr->SiS_VBType & VB_SIS301B302B) {
 	   if(IS_SIS650) {
@@ -11326,8 +10602,7 @@ SetDelayComp(SiS_Private *SiS_Pr, PSIS_HW_INFO HwInfo, USHORT ModeNo)
 	   } else {
 	      delay = 0x0c;
 	   }
-	}
-        if(SiS_Pr->SiS_IF_DEF_LVDS == 1) {
+	} else if(SiS_Pr->SiS_IF_DEF_LVDS == 1) {
            delay = 0x00;
 	}
      }
@@ -11336,13 +10611,39 @@ SetDelayComp(SiS_Private *SiS_Pr, PSIS_HW_INFO HwInfo, USHORT ModeNo)
 
      BOOLEAN gotitfrompci = FALSE;
 
-     if(SiS_Pr->SiS_LCDResInfo == SiS_Pr->SiS_PanelCustom) return;
+     /* Could we detect a PDC for LCD or did we get a user-defined? If yes, use it */
 
-     /* Could we detect a PDC for LCD? If yes, use it */
+     if(SiS_Pr->SiS_VBInfo & SetCRT2ToLCD) {
+	if(SiS_Pr->PDC != -1) {
+           SiS_SetRegANDOR(SiS_Pr->SiS_Part1Port,0x2d,0xf0,((SiS_Pr->PDC >> 1) & 0x0f));
+	   SiS_SetRegANDOR(SiS_Pr->SiS_Part1Port,0x35,0x7f,((SiS_Pr->PDC & 0x01) << 7));
+	   return;
+	}
+     } else {
+	if(SiS_Pr->PDCA != -1) {
+	   SiS_SetRegANDOR(SiS_Pr->SiS_Part1Port,0x2d,0x0f,((SiS_Pr->PDCA << 3) & 0xf0));
+	   SiS_SetRegANDOR(SiS_Pr->SiS_Part1Port,0x20,0xbf,((SiS_Pr->PDCA & 0x01) << 6));
+	   return;
+	}
+     }
+
+     /* Custom Panel? */
 
-     if(SiS_Pr->PDC) {
+     if(SiS_Pr->SiS_LCDResInfo == Panel_Custom) {
         if(SiS_Pr->SiS_VBInfo & SetCRT2ToLCDA) {
-	   SiS_SetRegANDOR(SiS_Pr->SiS_Part1Port,0x2d,0x0f,((SiS_Pr->PDC & 0x0f) << 4));
+	   delay = 0x00;
+	   if((SiS_Pr->PanelXRes <= 1280) && (SiS_Pr->PanelYRes <= 1024)) {
+	      delay = 0x20;
+	   }
+	   SiS_SetRegANDOR(SiS_Pr->SiS_Part1Port,0x2d,0x0f,delay);
+	} else {
+	   delay = 0x0c;
+	   if(SiS_Pr->SiS_VBType & VB_SIS301C) delay = 0x03;
+	   else if(SiS_Pr->SiS_VBType & VB_SIS301LV302LV) {
+	      if(IS_SIS740) delay = 0x01;
+	      else          delay = 0x03;
+	   }
+	   SiS_SetRegANDOR(SiS_Pr->SiS_Part1Port,0x2d,0xf0,delay);
 	}
         return;
      }
@@ -11355,7 +10656,7 @@ SetDelayComp(SiS_Private *SiS_Pr, PSIS_HW_INFO HwInfo, USHORT ModeNo)
      switch(SiS_Pr->SiS_CustomT) {
      case CUT_COMPAQ1280:
      case CUT_COMPAQ12802:
-	if(SiS_Pr->SiS_LCDResInfo == SiS_Pr->SiS_Panel1280x1024) {
+	if(SiS_Pr->SiS_LCDResInfo == Panel_1280x1024) {
 	   gotitfrompci = TRUE;
 	   dochiptest = FALSE;
 	   delay = 0x03;
@@ -11363,15 +10664,13 @@ SetDelayComp(SiS_Private *SiS_Pr, PSIS_HW_INFO HwInfo, USHORT ModeNo)
 	break;
      case CUT_CLEVO1400:
      case CUT_CLEVO14002:
-	/* if(SiS_Pr->SiS_LCDResInfo == SiS_Pr->SiS_Panel1400x1050) { */
-	   gotitfrompci = TRUE;
-	   dochiptest = FALSE;
-	   delay = 0x02;
-	/* } */
+	gotitfrompci = TRUE;
+	dochiptest = FALSE;
+	delay = 0x02;
 	break;
      case CUT_CLEVO1024:
      case CUT_CLEVO10242:
-        if(SiS_Pr->SiS_LCDResInfo == SiS_Pr->SiS_Panel1024x768) {
+        if(SiS_Pr->SiS_LCDResInfo == Panel_1024x768) {
 	   gotitfrompci = TRUE;
 	   dochiptest = FALSE;
 	   delay = 0x33;
@@ -11392,12 +10691,12 @@ SetDelayComp(SiS_Private *SiS_Pr, PSIS_HW_INFO HwInfo, USHORT ModeNo)
 
            if(SiS_IsNotM650orLater(SiS_Pr, HwInfo)) {
 
-              if((ROMAddr) && SiS_Pr->SiS_UseROM) {
+              if((SiS_Pr->SiS_UseROM) && (!(SiS_Pr->SiS_ROMNew))) {
 	         /* Always use the second pointer on 650; some BIOSes */
                  /* still carry old 301 data at the first location    */
-	         /* romptr = ROMAddr[0x120] | (ROMAddr[0x121] << 8);  */
+	         /* romptr = SISGETROMW(0x120);                       */
 	         /* if(SiS_Pr->SiS_VBType & VB_SIS302LV)              */
-	         romptr = ROMAddr[0x122] | (ROMAddr[0x123] << 8);
+	         romptr = SISGETROMW(0x122);
 	         if(!romptr) return;
 	         delay = ROMAddr[(romptr + index)];
 	      } else {
@@ -11412,10 +10711,13 @@ SetDelayComp(SiS_Private *SiS_Pr, PSIS_HW_INFO HwInfo, USHORT ModeNo)
 
           }
 
-        } else if((ROMAddr) && SiS_Pr->SiS_UseROM &&
-	          (SiS_Pr->SiS_LCDResInfo != SiS_Pr->SiS_Panel1280x1024)) {
+        } else if(SiS_Pr->SiS_UseROM 			      &&
+		  (!(SiS_Pr->SiS_ROMNew))		      &&
+	          (SiS_Pr->SiS_LCDResInfo != Panel_1280x1024) &&
+		  (SiS_Pr->SiS_LCDResInfo != Panel_1280x768)  &&
+		  (SiS_Pr->SiS_LCDResInfo != Panel_1280x960)) {
 
-	   /* Data for 1280x1024 wrong in BIOS */
+	   /* Data for 1280x1024 wrong in 301B BIOS */
            romptr = GetLCDromptr(SiS_Pr, HwInfo);
 	   if(!romptr) return;
 	   delay = ROMAddr[(romptr + index)];
@@ -11430,7 +10732,11 @@ SetDelayComp(SiS_Private *SiS_Pr, PSIS_HW_INFO HwInfo, USHORT ModeNo)
            delay = SiS310_LCDDelayCompensation_301[myindex];
 	   if(SiS_Pr->SiS_VBType & VB_SIS301LV302LV) {
 	      if(IS_SIS740) delay = 0x01;
+	      else if(HwInfo->jChipType <= SIS_315PRO) delay = SiS310_LCDDelayCompensation_3xx301LV[myindex];
 	      else          delay = SiS310_LCDDelayCompensation_650301LV[myindex];
+	   } else if(SiS_Pr->SiS_VBType & VB_SIS301C) {
+	      if(IS_SIS740) delay = 0x01;  /* ? */
+	      else          delay = 0x03;
 	   } else if(SiS_Pr->SiS_VBType & VB_SIS301B302B) {
 	      if(IS_SIS740) delay = 0x01;
 	      else          delay = SiS310_LCDDelayCompensation_3xx301B[myindex];
@@ -11453,12 +10759,12 @@ SetDelayComp(SiS_Private *SiS_Pr, PSIS_HW_INFO HwInfo, USHORT ModeNo)
 
         if(SiS_IsNotM650orLater(SiS_Pr,HwInfo)) {
 
-           if((ROMAddr) && SiS_Pr->SiS_UseROM) {
+           if((SiS_Pr->SiS_UseROM) && (!(SiS_Pr->SiS_ROMNew))) {
 	      /* Always use the second pointer on 650; some BIOSes */
               /* still carry old 301 data at the first location    */
-              /* romptr = ROMAddr[0x114] | (ROMAddr[0x115] << 8);  */
-	      /* if(SiS_Pr->SiS_VBType & VB_SIS302LV) */
-	      romptr = ROMAddr[0x11a] | (ROMAddr[0x11b] << 8);
+              /* romptr = SISGETROMW(0x114);			   */
+	      /* if(SiS_Pr->SiS_VBType & VB_SIS302LV)              */
+	      romptr = SISGETROMW(0x11a);
 	      if(!romptr) return;
 	      delay = ROMAddr[romptr + index];
 
@@ -11491,7 +10797,7 @@ SetDelayComp(SiS_Private *SiS_Pr, PSIS_HW_INFO HwInfo, USHORT ModeNo)
 	   }
         }
 
-     } else if((ROMAddr) && SiS_Pr->SiS_UseROM) {
+     } else if((SiS_Pr->SiS_UseROM) && (!(SiS_Pr->SiS_ROMNew))) {
 
         romptr = GetTVromptr(SiS_Pr, HwInfo);
 	if(!romptr) return;
@@ -11507,14 +10813,16 @@ SetDelayComp(SiS_Private *SiS_Pr, PSIS_HW_INFO HwInfo, USHORT ModeNo)
         if(SiS_Pr->SiS_VBType & VB_SIS301BLV302BLV) {
 	   if(IS_SIS740) {
 	      delay = SiS310_TVDelayCompensation_740301B[index];
+	      /* LV: use 301 data? BIOS bug? */
 	   } else {
               delay = SiS310_TVDelayCompensation_301B[index];
+	      if(SiS_Pr->SiS_VBType & VB_SIS301C) delay = 0x02;
 	   }
 	}
 
      }
 
-     if(SiS_GetReg(SiS_Pr->SiS_Part1Port,0x13) & 0x04) {  /* LCDA */
+     if(SiS_LCDAEnabled(SiS_Pr, HwInfo)) {
 	delay &= 0x0f;
 	dochiptest = FALSE;
      }
@@ -11580,15 +10888,18 @@ SetAntiFlicker(SiS_Private *SiS_Pr, PSIS_HW_INFO HwInfo,
   temp >>= 1;  	  /* 0: NTSC/YPbPr, 1: PAL, 2: HiTV */
   temp1 = temp;
 
-  if(ROMAddr && SiS_Pr->SiS_UseROM) {
+  if(SiS_Pr->SiS_UseROM && (!(SiS_Pr->SiS_ROMNew))) {
      if(HwInfo->jChipType >= SIS_661) {
-	romptr = ROMAddr[0x260] | (ROMAddr[0x261] << 8);
-	temp1 = GetOEMTVPtr661(SiS_Pr);
+        temp1 = GetOEMTVPtr661(SiS_Pr);
         temp1 >>= 1;
+        romptr = SISGETROMW(0x260);
+        if(HwInfo->jChipType >= SIS_760) {
+	   romptr = SISGETROMW(0x360);
+	}
      } else if(HwInfo->jChipType >= SIS_330) {
-        romptr = ROMAddr[0x192] | (ROMAddr[0x193] << 8);
+        romptr = SISGETROMW(0x192);
      } else {
-        romptr = ROMAddr[0x112] | (ROMAddr[0x113] << 8);
+        romptr = SISGETROMW(0x112);
      }
   }
 
@@ -11610,24 +10921,25 @@ SetEdgeEnhance(SiS_Private *SiS_Pr, PSIS_HW_INFO HwInfo,
   UCHAR  *ROMAddr = HwInfo->pjVirtualRomBase;
   USHORT index,temp,temp1,romptr=0;
 
-  temp = GetTVPtrIndex(SiS_Pr);
-  temp >>= 1;              	/* 0: NTSC/YPbPr, 1: PAL, 2: HiTV */
-  temp1 = temp;
+  temp = temp1 = GetTVPtrIndex(SiS_Pr) >> 1; 	/* 0: NTSC/YPbPr, 1: PAL, 2: HiTV */
 
-  if(ModeNo<=0x13)
+  if(ModeNo <= 0x13)
      index = SiS_Pr->SiS_SModeIDTable[ModeIdIndex].VB_StTVEdgeIndex;
   else
      index = SiS_Pr->SiS_EModeIDTable[ModeIdIndex].VB_ExtTVEdgeIndex;
 
-  if(ROMAddr && SiS_Pr->SiS_UseROM) {
+  if(SiS_Pr->SiS_UseROM && (!(SiS_Pr->SiS_ROMNew))) {
      if(HwInfo->jChipType >= SIS_661) {
-	romptr = ROMAddr[0x26c] | (ROMAddr[0x26d] << 8);
+        romptr = SISGETROMW(0x26c);
+        if(HwInfo->jChipType >= SIS_760) {
+	   romptr = SISGETROMW(0x36c);
+	}
 	temp1 = GetOEMTVPtr661(SiS_Pr);
         temp1 >>= 1;
      } else if(HwInfo->jChipType >= SIS_330) {
-        romptr = ROMAddr[0x1a4] | (ROMAddr[0x1a5] << 8);
+        romptr = SISGETROMW(0x1a4);
      } else {
-        romptr = ROMAddr[0x124] | (ROMAddr[0x125] << 8);
+        romptr = SISGETROMW(0x124);
      }
   }
 
@@ -11645,62 +10957,15 @@ static void
 SetYFilter(SiS_Private *SiS_Pr, PSIS_HW_INFO HwInfo,
            USHORT ModeNo,USHORT ModeIdIndex)
 {
-  UCHAR  *ROMAddr = HwInfo->pjVirtualRomBase;
-  USHORT index, myindex, oldindex,temp, i, j, flag1 = 0, flag2 = 0, romptr = 0;
-  ULONG  lindex;
+  USHORT index, temp, i, j;
 
-  if(ModeNo<=0x13) {
-    index =  SiS_Pr->SiS_SModeIDTable[ModeIdIndex].VB_StTVYFilterIndex;
+  if(ModeNo <= 0x13) {
+     index = SiS_Pr->SiS_SModeIDTable[ModeIdIndex].VB_StTVYFilterIndex;
   } else {
-    index =  SiS_Pr->SiS_EModeIDTable[ModeIdIndex].VB_ExtTVYFilterIndex;
-  }
-
-  oldindex = index;
-
-  if((HwInfo->jChipType >= SIS_661) && ROMAddr && SiS_Pr->SiS_UseROM) {
-     if(ModeNo > 0x13) {
-        index =  SiS_Pr->SiS_EModeIDTable[ModeIdIndex].VB_ExtTVYFilterIndexROM661;
-     }
-     lindex = GetOEMTVPtr661_2(SiS_Pr);
-     if(lindex & 0x00ff0000) flag1 = 1;
-     if(lindex & 0xff000000) flag2 = 1;
-     lindex &= 0xffff;
-
-     /* NTSC-J: Use PAL filters */
-     if(SiS_Pr->SiS_TVMode & TVSetNTSCJ) lindex = 1;
-
-     romptr = ROMAddr[0x268] | (ROMAddr[0x269] << 8);
-     if(flag1) myindex = index * 7;
-     else      myindex = index << 2;
-
-     if(romptr) {
-        romptr += (lindex << 1);
-        romptr = (ROMAddr[romptr] | (ROMAddr[romptr+1] << 8)) + myindex;
-	if(romptr) {
-           if((!flag1) && (flag2)) {
-	      SiS_SetReg(SiS_Pr->SiS_Part2Port,0x35,0x00);
-	      SiS_SetReg(SiS_Pr->SiS_Part2Port,0x36,0x00);
-	      SiS_SetReg(SiS_Pr->SiS_Part2Port,0x37,0x00);
-	      SiS_SetReg(SiS_Pr->SiS_Part2Port,0x38,ROMAddr[romptr++]);
-           } else {
-	      for(i=0x35; i<=0x38; i++) {
-                 SiS_SetReg(SiS_Pr->SiS_Part2Port,i,ROMAddr[romptr++]);
-              }
-           }
-           if(SiS_Pr->SiS_VBType & VB_SIS301BLV302BLV) {
-	      for(j=0, i=0x48; i<=0x4a; i++, j++) {
-                 SiS_SetReg(SiS_Pr->SiS_Part2Port,i,ROMAddr[romptr++]);
-              }
-           }
-           return;
-	}
-     }
+     index = SiS_Pr->SiS_EModeIDTable[ModeIdIndex].VB_ExtTVYFilterIndex;
   }
 
-  index = oldindex;
-
-  temp = GetTVPtrIndex(SiS_Pr);
-  temp >>= 1;  			/* 0: NTSC/YPbPr, 1: PAL, 2: HiTV */
+  temp = GetTVPtrIndex(SiS_Pr) >> 1;  /* 0: NTSC/YPbPr, 1: PAL, 2: HiTV */
 
   if(SiS_Pr->SiS_TVMode & TVSetNTSCJ)	     temp = 1;  /* NTSC-J uses PAL */
   else if(SiS_Pr->SiS_TVMode & TVSetPALM)    temp = 3;  /* PAL-M */
@@ -11734,21 +10999,11 @@ SetPhaseIncr(SiS_Private *SiS_Pr, PSIS_HW_INFO HwInfo,
   /* NTSC-J data not in BIOS, and already set in SetGroup2 */
   if(SiS_Pr->SiS_TVMode & TVSetNTSCJ) return;
 
-  if(HwInfo->jChipType >= SIS_661) {
-     lindex = GetOEMTVPtr661_2(SiS_Pr) & 0xffff;
+  if((HwInfo->jChipType >= SIS_661) || SiS_Pr->SiS_ROMNew) {
+     lindex = GetOEMTVPtr661_2_OLD(SiS_Pr) & 0xffff;
      lindex <<= 2;
-     if((ROMAddr) && SiS_Pr->SiS_UseROM) {
-        romptr = ROMAddr[0x264] | (ROMAddr[0x265] << 8);
-     }
-     if(romptr) {
-	romptr += lindex;
-	for(j=0, i=0x31; i<=0x34; i++, j++) {
-           SiS_SetReg(SiS_Pr->SiS_Part2Port,i,ROMAddr[romptr + j]);
-        }
-     } else {
-        for(j=0, i=0x31; i<=0x34; i++, j++) {
-           SiS_SetReg(SiS_Pr->SiS_Part2Port,i,SiS661_TVPhase[lindex + j]);
-        }
+     for(j=0, i=0x31; i<=0x34; i++, j++) {
+        SiS_SetReg(SiS_Pr->SiS_Part2Port,i,SiS661_TVPhase[lindex + j]);
      }
      return;
   }
@@ -11766,20 +11021,20 @@ SetPhaseIncr(SiS_Private *SiS_Pr, PSIS_HW_INFO HwInfo,
   /* 0: NTSC Graphics, 1: NTSC Text,    2: PAL Graphics,
    * 3: PAL Text,      4: HiTV Graphics 5: HiTV Text
    */
-  if((ROMAddr) && SiS_Pr->SiS_UseROM) {
-     romptr = ROMAddr[0x116] | (ROMAddr[0x117] << 8);
+  if(SiS_Pr->SiS_UseROM) {
+     romptr = SISGETROMW(0x116);
      if(HwInfo->jChipType >= SIS_330) {
-        romptr = ROMAddr[0x196] | (ROMAddr[0x197] << 8);
+        romptr = SISGETROMW(0x196);
      }
      if(SiS_Pr->SiS_VBType & VB_SIS301BLV302BLV) {
-        romptr = ROMAddr[0x11c] | (ROMAddr[0x11d] << 8);
+        romptr = SISGETROMW(0x11c);
 	if(HwInfo->jChipType >= SIS_330) {
-	   romptr = ROMAddr[0x19c] | (ROMAddr[0x19d] << 8);
+	   romptr = SISGETROMW(0x19c);
 	}
 	if((SiS_Pr->SiS_VBInfo & SetInSlaveMode) && (!(SiS_Pr->SiS_TVMode & TVSetTVSimuMode))) {
-	   romptr = ROMAddr[0x116] | (ROMAddr[0x117] << 8);
+	   romptr = SISGETROMW(0x116);
 	   if(HwInfo->jChipType >= SIS_330) {
-              romptr = ROMAddr[0x196] | (ROMAddr[0x197] << 8);
+              romptr = SISGETROMW(0x196);
            }
 	}
      }
@@ -11832,7 +11087,7 @@ SiS_OEM310Setting(SiS_Private *SiS_Pr, PSIS_HW_INFO HwInfo,
       SetAntiFlicker(SiS_Pr,HwInfo,ModeNo,ModeIdIndex);
       SetPhaseIncr(SiS_Pr,HwInfo,ModeNo,ModeIdIndex);
       SetYFilter(SiS_Pr,HwInfo,ModeNo,ModeIdIndex);
-      if(!(SiS_Pr->SiS_VBType & VB_SIS301BLV302BLV)) {
+      if(SiS_Pr->SiS_VBType & VB_SIS301) {
          SetEdgeEnhance(SiS_Pr,HwInfo,ModeNo,ModeIdIndex);
       }
    }
@@ -11842,65 +11097,108 @@ static void
 SetDelayComp661(SiS_Private *SiS_Pr, PSIS_HW_INFO HwInfo, USHORT ModeNo,
                 USHORT ModeIdIndex, USHORT RTI)
 {
-   UCHAR  *ROMAddr = HwInfo->pjVirtualRomBase;
    USHORT delay = 0, romptr = 0, index;
-   UCHAR  *myptr = NULL;
-   UCHAR  temp;
+   UCHAR  *ROMAddr = HwInfo->pjVirtualRomBase;
 
    if(!(SiS_Pr->SiS_VBInfo & (SetCRT2ToTV | SetCRT2ToLCD | SetCRT2ToLCDA | SetCRT2ToRAMDAC)))
       return;
 
-   delay = SiS_Pr->SiS_RefIndex[RTI].Ext_PDC;
+   /* 1. New ROM: VGA2 and LCD/LCDA-Pass1:1 */
+
+   if(SiS_Pr->SiS_ROMNew) {
+      if((SiS_Pr->SiS_VBInfo & SetCRT2ToRAMDAC) 			||
+         ((SiS_Pr->SiS_VBInfo & (SetCRT2ToLCD | SetCRT2ToLCDA)) &&
+	  (SiS_Pr->SiS_LCDInfo & LCDPass11))) {
+         index = 25;
+         if(SiS_Pr->UseCustomMode) {
+	    index = SiS_Pr->CSRClock;
+         } else if(ModeNo > 0x13) {
+            index = SiS_GetVCLK2Ptr(SiS_Pr,ModeNo,ModeIdIndex,RTI,HwInfo);
+            index = SiS_Pr->SiS_VCLKData[index].CLOCK;
+         }
+	 if(index < 25) index = 25;
+         index = ((index / 25) - 1) << 1;
+         if((ROMAddr[0x5b] & 0x80) || (SiS_Pr->SiS_VBInfo & (SetCRT2ToRAMDAC | SetCRT2ToLCD))) {
+	    index++;
+	 }
+	 romptr = SISGETROMW(0x104);  /* 0x4ae */
+         delay = ROMAddr[romptr + index];
+         if(SiS_Pr->SiS_VBInfo & (SetCRT2ToRAMDAC | SetCRT2ToLCD)) {
+            SiS_SetRegANDOR(SiS_Pr->SiS_Part1Port,0x2d,0xf0,((delay >> 1) & 0x0f));
+            SiS_SetRegANDOR(SiS_Pr->SiS_Part1Port,0x35,0x7f,((delay & 0x01) << 7));
+         } else {
+            SiS_SetRegANDOR(SiS_Pr->SiS_Part1Port,0x2d,0x0f,((delay << 3) & 0xf0));
+	    SiS_SetRegANDOR(SiS_Pr->SiS_Part1Port,0x20,0xbf,((delay & 0x01) << 6));
+         }
+         return;
+      }
+   }
+
+   /* 2. Old ROM: VGA2 and LCD/LCDA-Pass 1:1 */
 
-   delay &= 0xf0;
-   delay >>= 4;
-   if(SiS_Pr->SiS_VBInfo & SetCRT2ToLCDA) delay <<= 12;  /* BIOS: 8, wrong */
+   if(SiS_Pr->UseCustomMode) delay = 0x04;
+   else if(ModeNo <= 0x13)   delay = 0x04;
+   else                      delay = (SiS_Pr->SiS_RefIndex[RTI].Ext_PDC >> 4);
+   delay |= (delay << 8);
 
    if(SiS_Pr->SiS_VBInfo & SetCRT2ToTV) {
+
+      /* 3. TV */
+
       index = GetOEMTVPtr661(SiS_Pr);
-      if((ROMAddr) && SiS_Pr->SiS_UseROM) {
-         romptr = ROMAddr[0x25c] | (ROMAddr[0x25d] << 8);
-         if(SiS_Pr->SiS_VBType & VB_SIS301BLV302BLV) {
-            romptr = ROMAddr[0x25e] | (ROMAddr[0x25f] << 8);
-         }
-      }
-      if(romptr) myptr = &ROMAddr[romptr];
-      if(!myptr) {
-         myptr = (UCHAR *)SiS_TVDelay661_301;
-	 if(SiS_Pr->SiS_VBType & VB_SIS301BLV302BLV) {
-	    myptr = (UCHAR *)SiS_TVDelay661_301B;
-	 }
+      if(SiS_Pr->SiS_ROMNew) {
+         romptr = SISGETROMW(0x106);  /* 0x4ba */
+         delay = ROMAddr[romptr + index];
+      } else {
+         delay = 0x04;
       }
-      delay = myptr[index];
-      if(SiS_GetReg(SiS_Pr->SiS_Part1Port,0x13) & 0x04) delay >>= 4;  /* Should test dual edge */
+
    } else if(SiS_Pr->SiS_VBInfo & (SetCRT2ToLCD | SetCRT2ToLCDA)) {
-      if(SiS_Pr->PDC) {
-         delay = SiS_Pr->PDC & 0x0f;
-	 if(SiS_Pr->SiS_VBInfo & SetCRT2ToLCDA) {
-            delay |= (delay << 12);
+
+      /* 4. LCD, LCDA (for new ROM only LV and non-Pass 1:1) */
+
+      if( (SiS_Pr->SiS_LCDResInfo != Panel_Custom) &&
+          ((romptr = GetLCDStructPtr661_2(SiS_Pr, HwInfo))) ) {
+
+	 /* For LV, the BIOS must know about the correct value */
+	 delay = ROMAddr[romptr + 0x0d];		/* LCD  */
+	 delay |= (ROMAddr[romptr + 0x0c] << 8);	/* LCDA */
+
+      } else {
+
+         /* TMDS: Set our own, since BIOS has no idea - TODO: Find out about values */
+         if(!(SiS_Pr->SiS_LCDInfo & LCDPass11)) {
+            if((SiS_Pr->PanelXRes <= 1024) && (SiS_Pr->PanelYRes <= 768)) {
+	       delay = 0x0404;
+            } else if((SiS_Pr->PanelXRes <= 1280) && (SiS_Pr->PanelYRes <= 1024)) {
+	       delay = 0x0404;
+            } else if((SiS_Pr->PanelXRes <= 1400) && (SiS_Pr->PanelYRes <= 1050)) {
+	       delay = 0x1004;
+            } else
+	       delay = 0x0000;
+         }
+
+	 /* Override by detected or user-set values */
+	 /* (but only if, for some reason, we can't read value from BIOS) */
+         if((SiS_Pr->SiS_VBInfo & SetCRT2ToLCD) && (SiS_Pr->PDC != -1)) {
+            delay = SiS_Pr->PDC & 0x1f;
          }
-      } else if(SiS_Pr->SiS_LCDResInfo == SiS_Pr->SiS_PanelCustom) {
-         delay = 0x4444;  /* TEST THIS */
-      } else if(!(SiS_Pr->SiS_LCDInfo & LCDPass11)) {
-         myptr = GetLCDStructPtr661(SiS_Pr, HwInfo);
-         if(myptr) delay = myptr[4];
-         else delay = 0x44;
-         if(SiS_Pr->SiS_VBInfo & SetCRT2ToLCDA) {
-            delay |= (delay << 8);
+         if((SiS_Pr->SiS_VBInfo & SetCRT2ToLCDA) && (SiS_Pr->PDCA != -1)) {
+            delay = (SiS_Pr->PDCA & 0x1f) << 8;
          }
+
       }
-   }
 
-   temp = SiS_GetReg(SiS_Pr->SiS_Part1Port,0x2d);
-   if(SiS_Pr->SiS_VBInfo & (SetCRT2ToTV | SetCRT2ToLCD | SetCRT2ToRAMDAC)) {
-      temp &= 0xf0;
-      temp |= (delay & 0x000f);
    }
+
    if(SiS_Pr->SiS_VBInfo & SetCRT2ToLCDA) {
-      temp &= 0x0f;
-      temp |= ((delay & 0xf000) >> 8);
+      delay >>= 8;
+      SiS_SetRegANDOR(SiS_Pr->SiS_Part1Port,0x2d,0x0f,((delay << 3) & 0xf0));
+      SiS_SetRegANDOR(SiS_Pr->SiS_Part1Port,0x20,0xbf,((delay & 0x01) << 6));
+   } else {
+      SiS_SetRegANDOR(SiS_Pr->SiS_Part1Port,0x2d,0xf0,((delay >> 1) & 0x0f));
+      SiS_SetRegANDOR(SiS_Pr->SiS_Part1Port,0x35,0x7f,((delay & 0x01) << 7));
    }
-   SiS_SetReg(SiS_Pr->SiS_Part1Port,0x2d,temp);
 }
 
 static void
@@ -11909,38 +11207,50 @@ SetCRT2SyncDither661(SiS_Private *SiS_Pr, PSIS_HW_INFO HwInfo, USHORT ModeNo, US
    USHORT infoflag;
    UCHAR temp;
 
-   infoflag = SiS_Pr->SiS_RefIndex[RTI].Ext_InfoFlag;
-   if(ModeNo <= 0x13) {
-      infoflag = SiS_GetRegByte(SiS_Pr->SiS_P3ca+2);
-   }
-   infoflag &= 0xc0;
    if(SiS_Pr->SiS_VBInfo & (SetCRT2ToLCD | SetCRT2ToLCDA)) {
+
+      if(ModeNo <= 0x13) {
+         infoflag = SiS_GetRegByte(SiS_Pr->SiS_P3ca+2);
+      } else if(SiS_Pr->UseCustomMode) {
+         infoflag = SiS_Pr->CInfoFlag;
+      } else {
+         infoflag = SiS_Pr->SiS_RefIndex[RTI].Ext_InfoFlag;
+      }
+      infoflag &= 0xc0;
+
       temp = SiS_GetReg(SiS_Pr->SiS_P3d4,0x37);
-      if(temp & 0x20) infoflag = temp;
+      if(SiS_Pr->SiS_LCDInfo & LCDPass11) {
+         temp &= 0x3f;
+	 temp |= infoflag;
+      } else {
+         if(temp & 0x20) infoflag = temp;
+      }
       if(temp & 0x01) infoflag |= 0x01;
-   }
-   if(SiS_Pr->SiS_VBInfo & SetCRT2ToLCD) {
-      temp = 0x0c;
-      if(infoflag & 0x01) temp ^= 0x14;  /* BIOS: 18, wrong */
-      temp |= (infoflag >> 6);
-      SiS_SetRegANDOR(SiS_Pr->SiS_Part2Port,0x1a,0xe0,temp);
-   }
-   if(SiS_Pr->SiS_VBInfo & SetCRT2ToLCDA) {
-      temp = 0;
-      if(infoflag & 0x01) temp |= 0x80;
-      SiS_SetRegANDOR(SiS_Pr->SiS_Part1Port,0x1a,0x7f,temp);
-      temp = 0x30;
-      if(infoflag & 0x01) temp = 0x20;
-      infoflag &= 0xc0;
-      temp |= infoflag;
-      SiS_SetRegANDOR(SiS_Pr->SiS_Part1Port,0x19,0x0f,temp);
+
+      if(SiS_Pr->SiS_VBInfo & SetCRT2ToLCD) {
+         temp = 0x0c;
+         if(infoflag & 0x01) temp ^= 0x14;  /* BIOS: 18, wrong */
+         temp |= (infoflag >> 6);
+         SiS_SetRegANDOR(SiS_Pr->SiS_Part2Port,0x1a,0xe0,temp);
+      } else {
+         temp = 0;
+         if(infoflag & 0x01) temp |= 0x80;
+         SiS_SetRegANDOR(SiS_Pr->SiS_Part1Port,0x1a,0x7f,temp);
+         temp = 0x30;
+         if(infoflag & 0x01) temp = 0x20;
+         infoflag &= 0xc0;
+         temp |= infoflag;
+         SiS_SetRegANDOR(SiS_Pr->SiS_Part1Port,0x19,0x0f,temp);
+      }
+
    }
 }
 
 static void
 SetPanelParms661(SiS_Private *SiS_Pr, PSIS_HW_INFO HwInfo)
 {
-   UCHAR *myptr;
+   UCHAR  *ROMAddr = HwInfo->pjVirtualRomBase;
+   USHORT romptr, temp1, temp2;
 
    if(SiS_Pr->SiS_VBType & (VB_SIS301LV | VB_SIS302LV | VB_SIS302ELV)) {
       if(SiS_Pr->LVDSHL != -1) {
@@ -11948,16 +11258,24 @@ SetPanelParms661(SiS_Private *SiS_Pr, PSIS_HW_INFO HwInfo)
       }
    }
 
-   myptr = GetLCDStructPtr661(SiS_Pr, HwInfo);
-   if(myptr) {
-      if(SiS_Pr->SiS_VBType & (VB_SIS301LV | VB_SIS302LV | VB_SIS302ELV)) {
-         if(SiS_Pr->LVDSHL == -1) {
-            SiS_SetRegANDOR(SiS_Pr->SiS_Part4Port,0x24,0xE0,myptr[1] & 0x1f);
-	 } else {
-	    SiS_SetRegANDOR(SiS_Pr->SiS_Part4Port,0x24,0xE3,myptr[1] & 0x1c);
+   if(SiS_Pr->SiS_ROMNew) {
+
+      if((romptr = GetLCDStructPtr661_2(SiS_Pr, HwInfo))) {
+         if(SiS_Pr->SiS_VBType & (VB_SIS301LV | VB_SIS302LV | VB_SIS302ELV)) {
+            temp1 = (ROMAddr[romptr] & 0x03) | 0x0c;
+	    temp2 = 0xfc;
+	    if(SiS_Pr->LVDSHL != -1) {
+	      temp1 &= 0xfc;
+	      temp2 = 0xf3;
+	    }
+	    SiS_SetRegANDOR(SiS_Pr->SiS_Part4Port,0x24,temp2,temp1);
+         }
+	 if(SiS_Pr->SiS_VBInfo & SetCRT2ToLCD) {
+            temp1 = (ROMAddr[romptr + 1] & 0x80) >> 1;
+            SiS_SetRegANDOR(SiS_Pr->SiS_Part4Port,0x0d,0xbf,temp1);
 	 }
       }
-      SiS_SetRegANDOR(SiS_Pr->SiS_Part4Port,0x0d,0x3f,myptr[2] & 0xc0);
+
    }
 }
 
@@ -11978,7 +11296,7 @@ SiS_OEM661Setting(SiS_Private *SiS_Pr, PSIS_HW_INFO HwInfo,
          SetPhaseIncr(SiS_Pr,HwInfo,ModeNo,ModeIdIndex);
          SetYFilter(SiS_Pr,HwInfo,ModeNo,ModeIdIndex);
          SetAntiFlicker(SiS_Pr,HwInfo,ModeNo,ModeIdIndex);
-         if(!(SiS_Pr->SiS_VBType & VB_SIS301BLV302BLV)) {
+         if(SiS_Pr->SiS_VBType & VB_SIS301) {
             SetEdgeEnhance(SiS_Pr,HwInfo,ModeNo,ModeIdIndex);
          }
       }
@@ -12007,7 +11325,7 @@ SiS_FinalizeLCD(SiS_Private *SiS_Pr, USHORT ModeNo, USHORT ModeIdIndex,
      }
   }
 
-  if(SiS_Pr->SiS_LCDResInfo == SiS_Pr->SiS_PanelCustom) return;
+  if(SiS_Pr->SiS_LCDResInfo == Panel_Custom) return;
   if(SiS_Pr->UseCustomMode) return;
 
   switch(SiS_Pr->SiS_CustomT) {
@@ -12037,7 +11355,7 @@ SiS_FinalizeLCD(SiS_Private *SiS_Pr, USHORT ModeNo, USHORT ModeIdIndex,
   }
 
   if(SiS_Pr->SiS_CustomT == CUT_CLEVO1024) {
-     if(SiS_Pr->SiS_LCDResInfo == SiS_Pr->SiS_Panel1024x768) {
+     if(SiS_Pr->SiS_LCDResInfo == Panel_1024x768) {
         /* Maybe all panels? */
         if(SiS_Pr->LVDSHL == -1) {
            SiS_SetRegANDOR(SiS_Pr->SiS_Part4Port,0x24,0xfc,0x01);
@@ -12048,7 +11366,7 @@ SiS_FinalizeLCD(SiS_Private *SiS_Pr, USHORT ModeNo, USHORT ModeIdIndex,
 
   if(SiS_Pr->SiS_CustomT == CUT_CLEVO10242) {
      if(SiS_Pr->SiS_VBInfo & (SetCRT2ToLCD | SetCRT2ToLCDA)) {
-        if(SiS_Pr->SiS_LCDResInfo == SiS_Pr->SiS_Panel1024x768) {
+        if(SiS_Pr->SiS_LCDResInfo == Panel_1024x768) {
 	   if(SiS_Pr->LVDSHL == -1) {
 	      /* Maybe all panels? */
               SiS_SetRegANDOR(SiS_Pr->SiS_Part4Port,0x24,0xfc,0x01);
@@ -12068,15 +11386,15 @@ SiS_FinalizeLCD(SiS_Private *SiS_Pr, USHORT ModeNo, USHORT ModeIdIndex,
   }
 
   if(SiS_Pr->SiS_VBInfo & (SetCRT2ToLCD | SetCRT2ToLCDA)) {
-     if(SiS_Pr->SiS_LCDResInfo == SiS_Pr->SiS_Panel1024x768) {
-#ifdef SET_EMI
+     if(SiS_Pr->SiS_LCDResInfo == Panel_1024x768) {
 	if(SiS_Pr->SiS_VBType & (VB_SIS302LV | VB_SIS302ELV)) {
 	   SiS_SetReg(SiS_Pr->SiS_Part4Port,0x2a,0x00);
+#ifdef SET_EMI
 	   SiS_SetRegAND(SiS_Pr->SiS_Part4Port,0x30,0x0c);
+#endif
 	   SiS_SetReg(SiS_Pr->SiS_Part4Port,0x34,0x10);
 	}
-#endif
-     } else if(SiS_Pr->SiS_LCDResInfo == SiS_Pr->SiS_Panel1280x1024) {
+     } else if(SiS_Pr->SiS_LCDResInfo == Panel_1280x1024) {
         if(SiS_Pr->LVDSHL == -1) {
            /* Maybe ACER only? */
            SiS_SetRegANDOR(SiS_Pr->SiS_Part4Port,0x24,0xfc,0x01);
@@ -12084,9 +11402,9 @@ SiS_FinalizeLCD(SiS_Private *SiS_Pr, USHORT ModeNo, USHORT ModeIdIndex,
      }
      tempch = SiS_GetReg(SiS_Pr->SiS_P3d4,0x36) >> 4;
      if(SiS_Pr->SiS_VBInfo & SetCRT2ToLCDA) {
-	if(SiS_Pr->SiS_LCDResInfo == SiS_Pr->SiS_Panel1400x1050) {
+	if(SiS_Pr->SiS_LCDResInfo == Panel_1400x1050) {
 	   SiS_SetReg(SiS_Pr->SiS_Part1Port,0x1f,0x76);
-	} else if(SiS_Pr->SiS_LCDResInfo == SiS_Pr->SiS_Panel1024x768) {
+	} else if(SiS_Pr->SiS_LCDResInfo == Panel_1024x768) {
 	   if(tempch == 0x03) {
 	      SiS_SetReg(SiS_Pr->SiS_Part1Port,0x18,0x02);
 	      SiS_SetReg(SiS_Pr->SiS_Part1Port,0x1b,0x25);
@@ -12167,7 +11485,7 @@ SiS_FinalizeLCD(SiS_Private *SiS_Pr, USHORT ModeNo, USHORT ModeIdIndex,
 	tempbh >>= 4;
 	tempbl = SiS_GetReg(SiS_Pr->SiS_Part2Port,0x04);
 	tempbx = (tempbh << 8) | tempbl;
-	if(SiS_Pr->SiS_LCDResInfo == SiS_Pr->SiS_Panel1024x768) {
+	if(SiS_Pr->SiS_LCDResInfo == Panel_1024x768) {
 	   if((resinfo == SIS_RI_1024x768) || (!(SiS_Pr->SiS_LCDInfo & DontExpandLCD))) {
 	      if(SiS_Pr->SiS_SetFlag & LCDVESATiming) {
 	      	 tempbx = 770;
@@ -12258,19 +11576,16 @@ GetOEMLCDPtr(SiS_Private *SiS_Pr, PSIS_HW_INFO HwInfo, int Flag)
 
     tempbx = (SiS_GetReg(SiS_Pr->SiS_P3d4,0x36) & 0x0f) - 2;
     if(!(SiS_Pr->SiS_SetFlag & LCDVESATiming)) tempbx += 4;
-    if(SiS_Pr->SiS_LCDResInfo == SiS_Pr->SiS_Panel1024x768) {
+    if(SiS_Pr->SiS_LCDResInfo == Panel_1024x768) {
        if(SiS_Pr->SiS_LCDInfo & DontExpandLCD) tempbx += 3;
     }
-    if((ROMAddr) && SiS_Pr->SiS_UseROM) {
+    if(SiS_Pr->SiS_UseROM) {
        if(ROMAddr[0x235] & 0x80) {
           tempbx = SiS_Pr->SiS_LCDTypeInfo;
           if(Flag) {
-	     romptr = ROMAddr[0x255] | (ROMAddr[0x256] << 8);
-	     if(romptr) {
-	        tempbx = ROMAddr[romptr + SiS_Pr->SiS_LCDTypeInfo];
-	     } else {
-	        tempbx = customtable300[SiS_Pr->SiS_LCDTypeInfo];
-	     }
+	     romptr = SISGETROMW(0x255);
+	     if(romptr) tempbx = ROMAddr[romptr + SiS_Pr->SiS_LCDTypeInfo];
+	     else       tempbx = customtable300[SiS_Pr->SiS_LCDTypeInfo];
              if(tempbx == 0xFF) return 0xFFFF;
           }
 	  tempbx <<= 1;
@@ -12281,13 +11596,10 @@ GetOEMLCDPtr(SiS_Private *SiS_Pr, PSIS_HW_INFO HwInfo, int Flag)
   } else {
 
     if(Flag) {
-       if((ROMAddr) && SiS_Pr->SiS_UseROM) {
-          romptr = ROMAddr[0x255] | (ROMAddr[0x256] << 8);
-	  if(romptr) {
-	     tempbx = ROMAddr[romptr + SiS_Pr->SiS_LCDTypeInfo];
-	  } else {
-	     tempbx = 0xff;
-	  }
+       if(SiS_Pr->SiS_UseROM) {
+          romptr = SISGETROMW(0x255);
+	  if(romptr) tempbx = ROMAddr[romptr + SiS_Pr->SiS_LCDTypeInfo];
+	  else 	     tempbx = 0xff;
        } else {
           tempbx = customtable630[SiS_Pr->SiS_LCDTypeInfo];
        }
@@ -12311,12 +11623,12 @@ SetOEMLCDDelay(SiS_Private *SiS_Pr, PSIS_HW_INFO HwInfo,
   UCHAR  *ROMAddr = HwInfo->pjVirtualRomBase;
   USHORT index,temp,romptr=0;
 
-  if(SiS_Pr->SiS_LCDResInfo == SiS_Pr->SiS_PanelCustom) return;
+  if(SiS_Pr->SiS_LCDResInfo == Panel_Custom) return;
 
-  if((ROMAddr) && SiS_Pr->SiS_UseROM) {
+  if(SiS_Pr->SiS_UseROM) {
      if(!(ROMAddr[0x237] & 0x01)) return;
      if(!(ROMAddr[0x237] & 0x02)) return;
-     romptr = ROMAddr[0x24b] | (ROMAddr[0x24c] << 8);
+     romptr = SISGETROMW(0x24b);
   }
 
   /* The Panel Compensation Delay should be set according to tables
@@ -12326,7 +11638,7 @@ SetOEMLCDDelay(SiS_Private *SiS_Pr, PSIS_HW_INFO HwInfo,
    * Thus we don't set this if the user select a custom pdc or if
    * we otherwise detected a valid pdc.
    */
-  if(SiS_Pr->PDC) return;
+  if(SiS_Pr->PDC != -1) return;
 
   temp = GetOEMLCDPtr(SiS_Pr,HwInfo, 0);
 
@@ -12338,7 +11650,7 @@ SetOEMLCDDelay(SiS_Private *SiS_Pr, PSIS_HW_INFO HwInfo,
   if(HwInfo->jChipType != SIS_300) {
      if(romptr) {
 	romptr += (temp * 2);
-	romptr = ROMAddr[romptr] | (ROMAddr[romptr + 1] << 8);
+	romptr = SISGETROMW(romptr);
 	romptr += index;
 	temp = ROMAddr[romptr];
      } else {
@@ -12349,21 +11661,21 @@ SetOEMLCDDelay(SiS_Private *SiS_Pr, PSIS_HW_INFO HwInfo,
         }
      }
   } else {
-     if((ROMAddr) && SiS_Pr->SiS_UseROM && (ROMAddr[0x235] & 0x80)) {
+     if(SiS_Pr->SiS_UseROM && (ROMAddr[0x235] & 0x80)) {
 	if(romptr) {
 	   romptr += (temp * 2);
-	   romptr = ROMAddr[romptr] | (ROMAddr[romptr + 1] << 8);
+	   romptr = SISGETROMW(romptr);
 	   romptr += index;
 	   temp = ROMAddr[romptr];
 	} else {
 	   temp = SiS300_OEMLCDDelay5[temp][index];
 	}
      } else {
-        if((ROMAddr) && SiS_Pr->SiS_UseROM) {
+        if(SiS_Pr->SiS_UseROM) {
 	   romptr = ROMAddr[0x249] | (ROMAddr[0x24a] << 8);
 	   if(romptr) {
 	      romptr += (temp * 2);
-	      romptr = ROMAddr[romptr] | (ROMAddr[romptr + 1] << 8);
+	      romptr = SISGETROMW(romptr);
 	      romptr += index;
 	      temp = ROMAddr[romptr];
 	   } else {
@@ -12386,7 +11698,7 @@ SetOEMLCDData(SiS_Private *SiS_Pr, PSIS_HW_INFO HwInfo,
   UCHAR  *ROMAddr = HwInfo->pjVirtualRomBase;
   USHORT index,temp;
 
-  if((ROMAddr) && SiS_Pr->SiS_UseROM) {
+  if((SiS_Pr->SiS_UseROM) {
      if(!(ROMAddr[0x237] & 0x01)) return;
      if(!(ROMAddr[0x237] & 0x04)) return;
      /* No rom pointer in BIOS header! */
@@ -12436,10 +11748,10 @@ SetOEMTVDelay(SiS_Private *SiS_Pr, PSIS_HW_INFO HwInfo,
   UCHAR  *ROMAddr = HwInfo->pjVirtualRomBase;
   USHORT index,temp,romptr=0;
 
-  if((ROMAddr) && SiS_Pr->SiS_UseROM) {
+  if(SiS_Pr->SiS_UseROM) {
      if(!(ROMAddr[0x238] & 0x01)) return;
      if(!(ROMAddr[0x238] & 0x02)) return;
-     romptr = ROMAddr[0x241] | (ROMAddr[0x242] << 8);
+     romptr = SISGETROMW(0x241);
   }
 
   temp = GetOEMTVPtr(SiS_Pr);
@@ -12448,7 +11760,7 @@ SetOEMTVDelay(SiS_Private *SiS_Pr, PSIS_HW_INFO HwInfo,
 
   if(romptr) {
      romptr += (temp * 2);
-     romptr = ROMAddr[romptr] | (ROMAddr[romptr + 1] << 8);
+     romptr = SISGETROMW(romptr);
      romptr += index;
      temp = ROMAddr[romptr];
   } else {
@@ -12459,7 +11771,7 @@ SetOEMTVDelay(SiS_Private *SiS_Pr, PSIS_HW_INFO HwInfo,
      }
   }
   temp &= 0x3c;
-  SiS_SetRegANDOR(SiS_Pr->SiS_Part1Port,0x13,~0x3C,temp);  /* index 0A D[6:4] */
+  SiS_SetRegANDOR(SiS_Pr->SiS_Part1Port,0x13,~0x3C,temp);
 }
 
 static void
@@ -12469,10 +11781,10 @@ SetOEMAntiFlicker(SiS_Private *SiS_Pr, PSIS_HW_INFO HwInfo,
   UCHAR  *ROMAddr = HwInfo->pjVirtualRomBase;
   USHORT index,temp,romptr=0;
 
-  if((ROMAddr) && SiS_Pr->SiS_UseROM) {
+  if(SiS_Pr->SiS_UseROM) {
      if(!(ROMAddr[0x238] & 0x01)) return;
      if(!(ROMAddr[0x238] & 0x04)) return;
-     romptr = ROMAddr[0x243] | (ROMAddr[0x244] << 8);
+     romptr = SISGETROMW(0x243);
   }
 
   temp = GetOEMTVPtr(SiS_Pr);
@@ -12481,14 +11793,14 @@ SetOEMAntiFlicker(SiS_Private *SiS_Pr, PSIS_HW_INFO HwInfo,
 
   if(romptr) {
      romptr += (temp * 2);
-     romptr = ROMAddr[romptr] | (ROMAddr[romptr + 1] << 8);
+     romptr = SISGETROMW(romptr);
      romptr += index;
      temp = ROMAddr[romptr];
   } else {
      temp = SiS300_OEMTVFlicker[temp][index];
   }
   temp &= 0x70;
-  SiS_SetRegANDOR(SiS_Pr->SiS_Part2Port,0x0A,0x8F,temp);  /* index 0A D[6:4] */
+  SiS_SetRegANDOR(SiS_Pr->SiS_Part2Port,0x0A,0x8F,temp);
 }
 
 static void
@@ -12502,10 +11814,10 @@ SetOEMPhaseIncr(SiS_Private *SiS_Pr, PSIS_HW_INFO HwInfo,
 
   if(SiS_Pr->SiS_TVMode & (TVSetNTSC1024 | TVSetNTSCJ | TVSetPALM | TVSetPALN)) return;
 
-  if((ROMAddr) && SiS_Pr->SiS_UseROM) {
+  if(SiS_Pr->SiS_UseROM) {
      if(!(ROMAddr[0x238] & 0x01)) return;
      if(!(ROMAddr[0x238] & 0x08)) return;
-     romptr = ROMAddr[0x245] | (ROMAddr[0x246] << 8);
+     romptr = SISGETROMW(0x245);
   }
 
   temp = GetOEMTVPtr(SiS_Pr);
@@ -12519,7 +11831,7 @@ SetOEMPhaseIncr(SiS_Private *SiS_Pr, PSIS_HW_INFO HwInfo,
   } else {
      if(romptr) {
         romptr += (temp * 2);
-	romptr = ROMAddr[romptr] | (ROMAddr[romptr + 1] << 8);
+	romptr = SISGETROMW(romptr);
 	romptr += (index * 4);
         for(i=0x31, j=0; i<=0x34; i++, j++) {
 	   SiS_SetReg(SiS_Pr->SiS_Part2Port,i,ROMAddr[romptr + j]);
@@ -12541,10 +11853,10 @@ SetOEMYFilter(SiS_Private *SiS_Pr, PSIS_HW_INFO HwInfo,
 
   if(SiS_Pr->SiS_VBInfo & (SetCRT2ToSCART | SetCRT2ToHiVision | SetCRT2ToYPbPr525750)) return;
 
-  if((ROMAddr) && SiS_Pr->SiS_UseROM) {
+  if(SiS_Pr->SiS_UseROM) {
      if(!(ROMAddr[0x238] & 0x01)) return;
      if(!(ROMAddr[0x238] & 0x10)) return;
-     romptr = ROMAddr[0x247] | (ROMAddr[0x248] << 8);
+     romptr = SISGETROMW(0x247);
   }
 
   temp = GetOEMTVPtr(SiS_Pr);
@@ -12565,7 +11877,7 @@ SetOEMYFilter(SiS_Private *SiS_Pr, PSIS_HW_INFO HwInfo,
   } else {
       if((romptr) && (!(SiS_Pr->SiS_TVMode & (TVSetPALM|TVSetPALN)))) {
          romptr += (temp * 2);
-	 romptr = ROMAddr[romptr] | (ROMAddr[romptr + 1] << 8);
+	 romptr = SISGETROMW(romptr);
 	 romptr += (index * 4);
 	 for(i=0x35, j=0; i<=0x38; i++, j++) {
        	    SiS_SetReg(SiS_Pr->SiS_Part2Port,i,ROMAddr[romptr + j]);
diff --git a/drivers/video/sis/init301.h b/drivers/video/sis/init301.h
index 62bf8df6d..72a337987 100644
--- a/drivers/video/sis/init301.h
+++ b/drivers/video/sis/init301.h
@@ -1,4 +1,5 @@
 /* $XFree86$ */
+/* $XdotOrg$ */
 /*
  * Data and prototypes for init301.c
  *
@@ -31,13 +32,10 @@
  * * 2) Redistributions in binary form must reproduce the above copyright
  * *    notice, this list of conditions and the following disclaimer in the
  * *    documentation and/or other materials provided with the distribution.
- * * 3) All advertising materials mentioning features or use of this software
- * *    must display the following acknowledgement: "This product includes
- * *    software developed by Thomas Winischhofer, Vienna, Austria."
- * * 4) The name of the author may not be used to endorse or promote products
+ * * 3) The name of the author may not be used to endorse or promote products
  * *    derived from this software without specific prior written permission.
  * *
- * * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR
+ * * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESSED 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,
@@ -91,29 +89,41 @@ const UCHAR SiS_YPbPrTable[3][64] = {
     0x06,0x14,0x0d,0x04,0x0a,0x00,0x85,0x1b,
     0x0c,0x50,0x00,0x97,0x00,0xda,0x4a,0x17,
     0x7d,0x05,0x4b,0x00,0x00,0xe2,0x00,0x02,
-    0x03,0x0a,0x65,0x9d,0x08,0x92,0x8f,0x40,
-    0x60,0x80,0x14,0x90,0x8c,0x60,0x14,0x53,
+    0x03,0x0a,0x65,0x9d /*0x8d*/,0x08,0x92,0x8f,0x40,
+    0x60,0x80,0x14,0x90,0x8c,0x60,0x14,0x53 /*0x50*/,
     0x00,0x40,0x44,0x00,0xdb,0x02,0x3b,0x00
   },
   {
     0x1d,0x11,0x06,0x09,0x0b,0x0c,0x0c,0x0c,
     0x98,0x0a,0x01,0x0d,0x06,0x0d,0x04,0x0a,
     0x06,0x14,0x0d,0x04,0x0a,0x00,0x85,0x3f,
-    0x0c,0x50,0xb2,0x9f,0x16,0x59,0x4f,0x13,
+    0x0c,0x50,0xb2,0x9f,0x16,0x59,0x4c /*0x4f*/,0x13,
     0xad,0x11,0xad,0x1d,0x40,0x8a,0x3d,0xb8,
-    0x51,0x5e,0x60,0x49,0x7d,0x92,0x0f,0x40,
+    0x51,0x5e,0x60,0x57 /*0x49*/,0x7b /*0x7d*/,0x92,0x0f,0x40,
     0x60,0x80,0x14,0x90,0x8c,0x60,0x14,0x4b,
     0x43,0x41,0x11,0x00,0xfc,0xff,0x32,0x00
   },
   {
+#if 1
     0x13,0x1d,0xe8,0x09,0x09,0xed,0x0c,0x0c,
     0x98,0x0a,0x01,0x0c,0x06,0x0d,0x04,0x0a,
     0x06,0x14,0x0d,0x04,0x0a,0x00,0x85,0x3f,
-    0xed,0x50,0x70,0x9f,0x16,0x59,0x2b,0x13,
+    0xed,0x50,0x70,0x9f,0x16,0x59,0x21 /*0x2b*/,0x13,
     0x27,0x0b,0x27,0xfc,0x30,0x27,0x1c,0xb0,
-    0x4b,0x4b,0x6f,0x2f,0x63,0x92,0x0f,0x40,
+    0x4b,0x4b,0x65 /*0x6f*/,0x2f,0x63,0x92,0x0f,0x40,
     0x60,0x80,0x14,0x90,0x8c,0x60,0x14,0x27,
     0x00,0x40,0x11,0x00,0xfc,0xff,0x32,0x00
+#endif
+#if 0
+    0x2a,0x14,0xe8,0x09,0x09,0xed,0x0c,0x0c,  /* TEST (0.93) - BAD */
+    0x98,0x0a,0x01,0x0c,0x06,0x0d,0x04,0x0a,
+    0x06,0x14,0x0d,0x04,0x0a,0x00,0x85,0x3f,
+    0xed,0x50,0x70,0x9e,0x16,0x57,0x6c,0x13,
+    0x27,0x0b,0x27,0xfb,0x30,0x27,0x15,0xb0,
+    0x3b,0xdb,0x61,0x24,0x78,0x92,0x0f,0xff,
+    0xff,0xff,0xff,0xff,0xff,0xff,0x14,0x6f,
+    0x00,0x52,0xbb,0x00,0xd5,0xf7,0xa2,0x00
+#endif
   }
 };
 
@@ -139,7 +149,7 @@ const UCHAR SiS_HiTVGroup3_2[] = {
     0x18, 0x1d, 0x23, 0x28, 0x4c, 0xaa, 0x01
 };
 
-/* 301C / 302ELV (?) extended Part2 TV registers */
+/* 301C / 302ELV extended Part2 TV registers */
 
 static const UCHAR SiS_Part2CLVX_1[] = {
     0x00,0x00,
@@ -208,28 +218,84 @@ static const UCHAR SiS_Part2CLVX_6[] = {   /* 1080i */
     0x00,0x04,
     0x04,0x1A,0x04,0x7E,0x02,0x1B,0x05,0x7E,0x01,0x1A,0x07,0x7E,0x00,0x1A,0x09,0x7D,
     0x7F,0x19,0x0B,0x7D,0x7E,0x18,0x0D,0x7D,0x7D,0x17,0x10,0x7C,0x7D,0x15,0x12,0x7C,
-    0x7C,0x14,0x14,0x7C,0x7C,0x12,0x15,0x7D,0x7C,0x10,0x17,0x1D /* 0x7D? */ ,0x7C,0x0D,0x18,0x7F,
+    0x7C,0x14,0x14,0x7C,0x7C,0x12,0x15,0x7D,0x7C,0x10,0x17,0x7D,0x7C,0x0D,0x18,0x7F,
     0x7D,0x0B,0x19,0x7F,0x7D,0x09,0x1A,0x00,0x7D,0x07,0x1A,0x02,0x7E,0x05,0x1B,0x02,
     0xFF,0xFF,
 };
 
-
 #ifdef SIS315H
-/* 661 et al LCD data structure */
+/* 661 et al LCD data structure (0.94.0) */
 static const UCHAR SiS_LCDStruct661[] = {
-    /* 1600x1200 */
-    0x0B,0xEA,0x81,0x10,0x00,0xC0,0x03,0x21,0x5A,0x23,0x5A,0x23,0x02,
-    0x14,0x0A,0x02,0x00,0x30,0x10,0x5A,0x10,0x10,0x0A,0xC0,0x30,0x10,
-    /* 1400x1050 */
-    0x09,0xEA,0x81,0x80,0xA3,0x70,0x03,0x19,0xD2,0x2A,0xF8,0x2F,0x02,
-    0x14,0x0A,0x02,0x00,0x30,0x10,0x5A,0x10,0x10,0x0A,0xC0,0x30,0x10,
-    /* 1280x1024 */
-    0x03,0xEA,0x81,0x40,0xA1,0x70,0x03,0x19,0xD2,0x2A,0xF8,0x2F,0x02,
-    0x14,0x0A,0x02,0x00,0x30,0x10,0x5A,0x10,0x10,0x0A,0xC0,0x30,0x10,
     /* 1024x768 */
-    0x02,0xEA,0x80,0x00,0x11,0x88,0x06,0x0B,0xF5,0x6C,0x35,0x62,0x02,
-    0x14,0x0A,0x02,0x00,0x30,0x10,0x5A,0x10,0x10,0x0A,0xC0,0x28,0x10,
-    0xFF,
+/*  type|CR37|   HDE   |   VDE   |    HT   |    VT   |   hss    | hse   */
+    0x02,0xC0,0x00,0x04,0x00,0x03,0x40,0x05,0x26,0x03,0x10,0x00,0x88,
+    0x00,0x02,0x00,0x06,0x00,0x41,0x5A,0x64,0x00,0x00,0x00,0x00,0x04,
+    /*  | vss      |   vse  |clck|  clock  |CRT2DataP|CRT2DataP|idx     */
+    /*					      VESA    non-VESA  noscale */
+    /* 1280x1024 */
+    0x03,0xC0,0x00,0x05,0x00,0x04,0x98,0x06,0x2A,0x04,0x30,0x00,0x70,
+    0x00,0x01,0x00,0x03,0x00,0x6C,0xF8,0x2F,0x00,0x00,0x00,0x00,0x08,
+    /* 1400x1050 */
+    0x09,0x20,0x78,0x05,0x1A,0x04,0x98,0x06,0x2A,0x04,0x18,0x00,0x38,
+    0x00,0x01,0x00,0x03,0x00,0x6C,0xF8,0x2F,0x00,0x00,0x00,0x00,0x09,
+    /* 1600x1200 */
+    0x0B,0xC0,0x40,0x06,0xB0,0x04,0x70,0x08,0xE2,0x04,0x40,0x00,0xC0,
+    0x00,0x01,0x00,0x03,0x00,0xA2,0x70,0x24,0x00,0x00,0x00,0x00,0x0B,
+    /* 1280x768 */
+    0x0A,0xC0,0x00,0x05,0x00,0x03,0x80,0x05,0x26,0x03,0x10,0x00,0x40,
+    0x00,0x03,0x00,0x06,0x00,0x44,0x63,0x46,0x00,0x00,0x00,0x00,0x06,
+    /* 1280x720 */
+    0x0E,0xE0,0x00,0x05,0xD0,0x02,0x80,0x05,0x26,0x03,0x10,0x00,0x02,
+    0x00,0x01,0x00,0x06,0x00,0x45,0x9C,0x62,0x00,0x00,0x00,0x00,0x05,
+    /* 1280x800 */
+    0x0C,0xE0,0x00,0x05,0x20,0x03,0x80,0x05,0x30,0x03,0x10,0x00,0x40,
+    0x00,0x04,0x00,0x03,0x00,0x45,0x9C,0x62,0x00,0x00,0x00,0x00,0x07,
+    /* 1680x1050 */
+    0x0D,0xE0,0x90,0x06,0x1A,0x04,0x6C,0x07,0x2A,0x04,0x1A,0x00,0x4C,
+    0x00,0x03,0x00,0x06,0x00,0x79,0xBE,0x44,0x00,0x00,0x00,0x00,0x06,
+    /* 1280x768 (not in 0.93) */
+    0x0A,0xC0,0x00,0x05,0x00,0x03,0x80,0x06,0x1E,0x03,0x40,0x00,0x80,
+    0x00,0x03,0x00,0x07,0x00,0x4F,0x00,0x00,0x00,0x00,0x00,0x00,0x06
+};
+#endif
+
+#ifdef SIS300
+static UCHAR SiS300_TrumpionData[7][80] = {
+  { 0x02,0x0A,0x0A,0x01,0x04,0x01,0x00,0x03,0x0D,0x00,0x0D,0x10,0x7F,0x00,0x80,0x02,
+    0x20,0x03,0x0B,0x00,0x90,0x01,0xC1,0x01,0x60,0x0C,0x30,0x10,0x00,0x00,0x04,0x23,
+    0x00,0x00,0x03,0x28,0x03,0x10,0x05,0x08,0x40,0x10,0x00,0x10,0x04,0x23,0x00,0x23,
+    0x03,0x11,0x60,0xBC,0x01,0xFF,0x03,0xFF,0x19,0x01,0x00,0x05,0x09,0x04,0x04,0x05,
+    0x04,0x0C,0x09,0x05,0x02,0xB0,0x00,0x00,0x02,0xBA,0xF0,0x5A,0x01,0xBE,0x01,0x00 },
+  { 0x02,0x0A,0x0A,0x01,0x04,0x01,0x00,0x03,0x0D,0x00,0x0D,0x10,0x27,0x00,0x80,0x02,
+    0x20,0x03,0x07,0x00,0x5E,0x01,0x0D,0x02,0x60,0x0C,0x30,0x11,0x00,0x00,0x04,0x23,
+    0x00,0x00,0x03,0x80,0x03,0x28,0x06,0x08,0x40,0x11,0x00,0x11,0x04,0x23,0x00,0x23,
+    0x03,0x11,0x60,0x90,0x01,0xFF,0x0F,0xF4,0x19,0x01,0x00,0x05,0x01,0x00,0x04,0x05,
+    0x04,0x0C,0x02,0x01,0x02,0xB0,0x00,0x00,0x02,0xBA,0xEC,0x57,0x01,0xBE,0x01,0x00 },
+  { 0x02,0x0A,0x0A,0x01,0x04,0x01,0x00,0x03,0x0D,0x00,0x0D,0x10,0x8A,0x00,0xD8,0x02,
+    0x84,0x03,0x16,0x00,0x90,0x01,0xC1,0x01,0x60,0x0C,0x30,0x1C,0x00,0x20,0x04,0x23,
+    0x00,0x01,0x03,0x53,0x03,0x28,0x06,0x08,0x40,0x1C,0x00,0x16,0x04,0x23,0x00,0x23,
+    0x03,0x11,0x60,0xD9,0x01,0xFF,0x0F,0xF4,0x18,0x07,0x05,0x05,0x13,0x04,0x04,0x05,
+    0x01,0x0B,0x13,0x0A,0x02,0xB0,0x00,0x00,0x02,0xBA,0xF0,0x59,0x01,0xBE,0x01,0x00 },
+  { 0x02,0x0A,0x0A,0x01,0x04,0x01,0x00,0x03,0x0D,0x00,0x0D,0x10,0x72,0x00,0xD8,0x02,
+    0x84,0x03,0x16,0x00,0x90,0x01,0xC1,0x01,0x60,0x0C,0x30,0x1C,0x00,0x20,0x04,0x23,
+    0x00,0x01,0x03,0x53,0x03,0x28,0x06,0x08,0x40,0x1C,0x00,0x16,0x04,0x23,0x00,0x23,
+    0x03,0x11,0x60,0xDA,0x01,0xFF,0x0F,0xF4,0x18,0x07,0x05,0x05,0x13,0x04,0x04,0x05,
+    0x01,0x0B,0x13,0x0A,0x02,0xB0,0x00,0x00,0x02,0xBA,0xF0,0x55,0x01,0xBE,0x01,0x00 },
+  { 0x02,0x0A,0x02,0x00,0x04,0x01,0x00,0x03,0x0D,0x00,0x0D,0x10,0x7F,0x00,0x80,0x02,
+    0x20,0x03,0x16,0x00,0xE0,0x01,0x0D,0x02,0x60,0x0C,0x30,0x98,0x00,0x00,0x04,0x23,
+    0x00,0x01,0x03,0x45,0x03,0x48,0x06,0x08,0x40,0x98,0x00,0x98,0x04,0x23,0x00,0x23,
+    0x03,0x11,0x60,0xF4,0x01,0xFF,0x0F,0xF4,0x18,0x01,0x00,0x05,0x01,0x00,0x05,0x05,
+    0x04,0x0C,0x08,0x05,0x02,0xB0,0x00,0x00,0x02,0xBA,0xF0,0x5B,0x01,0xBE,0x01,0x00 },
+  { 0x02,0x0A,0x02,0x01,0x04,0x01,0x00,0x03,0x0D,0x00,0x0D,0x10,0xBF,0x00,0x20,0x03,
+    0x20,0x04,0x0D,0x00,0x58,0x02,0x71,0x02,0x80,0x0C,0x30,0x9A,0x00,0xFA,0x03,0x1D,
+    0x00,0x01,0x03,0x22,0x03,0x28,0x06,0x08,0x40,0x98,0x00,0x98,0x04,0x1D,0x00,0x1D,
+    0x03,0x11,0x60,0x39,0x03,0x40,0x05,0xF4,0x18,0x07,0x02,0x06,0x04,0x01,0x06,0x0B,
+    0x02,0x0A,0x20,0x19,0x02,0xB0,0x00,0x00,0x02,0xBA,0xF0,0x5B,0x01,0xBE,0x01,0x00 },
+  { 0x02,0x0A,0x0A,0x01,0x04,0x01,0x00,0x03,0x0D,0x00,0x0D,0x10,0xEF,0x00,0x00,0x04,
+    0x40,0x05,0x13,0x00,0x00,0x03,0x26,0x03,0x88,0x0C,0x30,0x90,0x00,0x00,0x04,0x23,
+    0x00,0x01,0x03,0x24,0x03,0x28,0x06,0x08,0x40,0x90,0x00,0x90,0x04,0x23,0x00,0x23,
+    0x03,0x11,0x60,0x40,0x05,0xFF,0x0F,0xF4,0x18,0x01,0x00,0x08,0x01,0x00,0x08,0x01,
+    0x00,0x08,0x01,0x01,0x02,0xB0,0x00,0x00,0x02,0xBA,0xF0,0x5B,0x01,0xBE,0x01,0x00 }
 };
 #endif
 
@@ -271,46 +337,51 @@ void   	SiS_ChrontelDoSomething1(SiS_Private *SiS_Pr, PSIS_HW_INFO HwInfo);
 void   	SiS_Chrontel701xBLOn(SiS_Private *SiS_Pr, PSIS_HW_INFO HwInfo);
 void   	SiS_Chrontel701xBLOff(SiS_Private *SiS_Pr);
 #endif /* 315 */
+#ifdef SIS300
+void    SiS_SetTrumpReg(SiS_Private *SiS_Pr, USHORT tempbx);
+USHORT  SiS_GetTrumpReg(SiS_Private *SiS_Pr, USHORT tempbx);
+static  BOOLEAN SiS_SetTrumpionBlock(SiS_Private *SiS_Pr, UCHAR *dataptr);
+#endif
 
-USHORT   SiS_ReadDDC1Bit(SiS_Private *SiS_Pr);
-void     SiS_SetSwitchDDC2(SiS_Private *SiS_Pr);
-USHORT   SiS_SetStart(SiS_Private *SiS_Pr);
-USHORT   SiS_SetStop(SiS_Private *SiS_Pr);
-void     SiS_DDC2Delay(SiS_Private *SiS_Pr, USHORT delaytime);
-USHORT   SiS_SetSCLKLow(SiS_Private *SiS_Pr);
-USHORT   SiS_SetSCLKHigh(SiS_Private *SiS_Pr);
-USHORT   SiS_ReadDDC2Data(SiS_Private *SiS_Pr, USHORT tempax);
-USHORT   SiS_WriteDDC2Data(SiS_Private *SiS_Pr, USHORT tempax);
-USHORT   SiS_CheckACK(SiS_Private *SiS_Pr);
+USHORT  SiS_ReadDDC1Bit(SiS_Private *SiS_Pr);
+void    SiS_SetSwitchDDC2(SiS_Private *SiS_Pr);
+USHORT  SiS_SetStart(SiS_Private *SiS_Pr);
+USHORT  SiS_SetStop(SiS_Private *SiS_Pr);
+void    SiS_DDC2Delay(SiS_Private *SiS_Pr, USHORT delaytime);
+USHORT  SiS_SetSCLKLow(SiS_Private *SiS_Pr);
+USHORT  SiS_SetSCLKHigh(SiS_Private *SiS_Pr);
+USHORT  SiS_ReadDDC2Data(SiS_Private *SiS_Pr, USHORT tempax);
+USHORT  SiS_WriteDDC2Data(SiS_Private *SiS_Pr, USHORT tempax);
+USHORT  SiS_CheckACK(SiS_Private *SiS_Pr);
 
-USHORT   SiS_InitDDCRegs(SiS_Private *SiS_Pr, unsigned long VBFlags, int VGAEngine,
-                         USHORT adaptnum, USHORT DDCdatatype, BOOLEAN checkcr32);
-USHORT   SiS_WriteDABDDC(SiS_Private *SiS_Pr);
-USHORT   SiS_PrepareReadDDC(SiS_Private *SiS_Pr);
-USHORT   SiS_PrepareDDC(SiS_Private *SiS_Pr);
-void     SiS_SendACK(SiS_Private *SiS_Pr, USHORT yesno);
-USHORT   SiS_DoProbeDDC(SiS_Private *SiS_Pr);
-USHORT   SiS_ProbeDDC(SiS_Private *SiS_Pr);
-USHORT   SiS_ReadDDC(SiS_Private *SiS_Pr, USHORT DDCdatatype, unsigned char *buffer);
-USHORT   SiS_HandleDDC(SiS_Private *SiS_Pr, unsigned long VBFlags, int VGAEngine,
-		       USHORT adaptnum, USHORT DDCdatatype, unsigned char *buffer);
+USHORT  SiS_InitDDCRegs(SiS_Private *SiS_Pr, unsigned long VBFlags, int VGAEngine,
+                        USHORT adaptnum, USHORT DDCdatatype, BOOLEAN checkcr32);
+USHORT  SiS_WriteDABDDC(SiS_Private *SiS_Pr);
+USHORT  SiS_PrepareReadDDC(SiS_Private *SiS_Pr);
+USHORT  SiS_PrepareDDC(SiS_Private *SiS_Pr);
+void    SiS_SendACK(SiS_Private *SiS_Pr, USHORT yesno);
+USHORT  SiS_DoProbeDDC(SiS_Private *SiS_Pr);
+USHORT  SiS_ProbeDDC(SiS_Private *SiS_Pr);
+USHORT  SiS_ReadDDC(SiS_Private *SiS_Pr, USHORT DDCdatatype, unsigned char *buffer);
+USHORT  SiS_HandleDDC(SiS_Private *SiS_Pr, unsigned long VBFlags, int VGAEngine,
+		      USHORT adaptnum, USHORT DDCdatatype, unsigned char *buffer);
 #ifdef LINUX_XF86
-USHORT   SiS_SenseLCDDDC(SiS_Private *SiS_Pr, SISPtr pSiS);
-USHORT   SiS_SenseVGA2DDC(SiS_Private *SiS_Pr, SISPtr pSiS);
+USHORT  SiS_SenseLCDDDC(SiS_Private *SiS_Pr, SISPtr pSiS);
+USHORT  SiS_SenseVGA2DDC(SiS_Private *SiS_Pr, SISPtr pSiS);
 #endif
 
 #ifdef SIS315H
-void     SiS_OEM310Setting(SiS_Private *SiS_Pr, PSIS_HW_INFO HwInfo,
-                           USHORT ModeNo,USHORT ModeIdIndex);
-void     SiS_OEM661Setting(SiS_Private *SiS_Pr, PSIS_HW_INFO HwInfo,
-                           USHORT ModeNo,USHORT ModeIdIndex, USHORT RRTI);
-void     SiS_FinalizeLCD(SiS_Private *, USHORT, USHORT, PSIS_HW_INFO);
+void    SiS_OEM310Setting(SiS_Private *SiS_Pr, PSIS_HW_INFO HwInfo,
+                          USHORT ModeNo,USHORT ModeIdIndex);
+void    SiS_OEM661Setting(SiS_Private *SiS_Pr, PSIS_HW_INFO HwInfo,
+                          USHORT ModeNo,USHORT ModeIdIndex, USHORT RRTI);
+void    SiS_FinalizeLCD(SiS_Private *, USHORT, USHORT, PSIS_HW_INFO);
 #endif
 #ifdef SIS300
-void     SiS_OEM300Setting(SiS_Private *SiS_Pr, PSIS_HW_INFO HwInfo,
-                           USHORT ModeNo, USHORT ModeIdIndex, USHORT RefTabindex);
-void     SetOEMLCDData2(SiS_Private *SiS_Pr, PSIS_HW_INFO HwInfo,
-			USHORT ModeNo, USHORT ModeIdIndex,USHORT RefTableIndex);
+void    SiS_OEM300Setting(SiS_Private *SiS_Pr, PSIS_HW_INFO HwInfo,
+                          USHORT ModeNo, USHORT ModeIdIndex, USHORT RefTabindex);
+void    SetOEMLCDData2(SiS_Private *SiS_Pr, PSIS_HW_INFO HwInfo,
+		       USHORT ModeNo, USHORT ModeIdIndex,USHORT RefTableIndex);
 #endif
 
 extern void     SiS_SetReg(SISIOADDRESS, USHORT, USHORT);
@@ -338,5 +409,6 @@ extern USHORT   SiS_GetOffset(SiS_Private *SiS_Pr,USHORT ModeNo,USHORT ModeIdInd
 extern void     SiS_LoadDAC(SiS_Private *SiS_Pr, PSIS_HW_INFO,USHORT ModeNo,
                             USHORT ModeIdIndex);
 
+extern void	SiS_CalcLCDACRT1Timing(SiS_Private *SiS_Pr,USHORT ModeNo,USHORT ModeIdIndex);
 
 #endif
diff --git a/drivers/video/sis/initdef.h b/drivers/video/sis/initdef.h
index 5ed65482b..e030d3e57 100644
--- a/drivers/video/sis/initdef.h
+++ b/drivers/video/sis/initdef.h
@@ -1,4 +1,5 @@
 /* $XFree86$ */
+/* $XdotOrg$ */
 /*
  * Global definitions for init.c and init301.c
  *
@@ -31,13 +32,10 @@
  * * 2) Redistributions in binary form must reproduce the above copyright
  * *    notice, this list of conditions and the following disclaimer in the
  * *    documentation and/or other materials provided with the distribution.
- * * 3) All advertising materials mentioning features or use of this software
- * *    must display the following acknowledgement: "This product includes
- * *    software developed by Thomas Winischhofer, Vienna, Austria."
- * * 4) The name of the author may not be used to endorse or promote products
+ * * 3) The name of the author may not be used to endorse or promote products
  * *    derived from this software without specific prior written permission.
  * *
- * * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR
+ * * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESSED 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,
@@ -72,6 +70,8 @@
 #define IS_SIS650740660         (IS_SIS650 || IS_SIS740 || IS_SIS661741660760)
 #define IS_SIS550650740660      (IS_SIS550 || IS_SIS650740660)
 
+#define SISGETROMW(x)		(ROMAddr[(x)] | (ROMAddr[(x)+1] << 8))
+
 /* SiS_VBType */
 #define VB_SIS301	      	0x0001
 #define VB_SIS301B        	0x0002
@@ -85,6 +85,8 @@
 #define VB_SIS301B302B          (VB_SIS301B|VB_SIS301C|VB_SIS302B)
 #define VB_SIS301LV302LV        (VB_SIS301LV|VB_SIS302LV|VB_SIS302ELV)
 #define VB_SISVB		(VB_SIS301 | VB_SIS301BLV302BLV)
+#define VB_SISTMDS		(VB_SIS301 | VB_SIS301B302B)
+#define VB_SISLVDS		VB_SIS301LV302LV
 
 /* VBInfo */
 #define SetSimuScanMode         0x0001   /* CR 30 */
@@ -137,6 +139,7 @@
 #define CRT2Mode                0x0800
 #define HalfDCLK                0x1000
 #define NoSupportSimuTV         0x2000
+#define NoSupportLCDScale	0x4000 /* TMDS: No scaling possible (no matter what panel) */
 #define DoubleScanMode          0x8000
 
 /* Infoflag */
@@ -145,7 +148,7 @@
 #define SupportCHTV 		0x0800
 #define Support64048060Hz       0x0800  /* Special for 640x480 LCD */
 #define SupportHiVision         0x0010
-#define SupportYPbPr            0x1000  /* TODO */
+#define SupportYPbPr750p        0x1000
 #define SupportLCD              0x0020
 #define SupportRAMDAC2          0x0040	/* All           (<= 100Mhz) */
 #define SupportRAMDAC2_135      0x0100  /* All except DH (<= 135Mhz) */
@@ -174,19 +177,22 @@
 #define TVSetPALM		0x0004
 #define TVSetPALN		0x0008
 #define TVSetCHOverScan		0x0010
-#define TVSetYPbPr525i		0x0020
-#define TVSetYPbPr525p		0x0040
-#define TVSetYPbPr750p		0x0080
-#define TVSetHiVision		0x0100  /* = 1080i, software-wise identical */
-#define TVSetTVSimuMode		0x0800
-#define TVRPLLDIV2XO		0x1000
-#define TVSetNTSC1024		0x2000
-
-/* YPbPr flag (>=315, <661) */
-#define YPbPr525p               0x0001	/* 525p */
-#define YPbPr750p               0x0002	/* 750p */
-#define YPbPr525i               0x0004	/* 525p */
-#define YPbPrHiVision           0x0008	/* HiVision or 1080i (bridge type dependent) */
+#define TVSetYPbPr525i		0x0020 /* new 0x10 */
+#define TVSetYPbPr525p		0x0040 /* new 0x20 */
+#define TVSetYPbPr750p		0x0080 /* new 0x40 */
+#define TVSetHiVision		0x0100 /* new 0x80; = 1080i, software-wise identical */
+#define TVSetTVSimuMode		0x0200 /* new 0x200, prev. 0x800 */
+#define TVRPLLDIV2XO		0x0400 /* prev 0x1000 */
+#define TVSetNTSC1024		0x0800 /* new 0x100, prev. 0x2000 */
+#define TVAspect43		0x2000
+#define TVAspect169		0x4000
+#define TVAspect43LB		0x8000
+
+/* YPbPr flag (>=315, <661; converted to TVMode) */
+#define YPbPr525p               0x0001
+#define YPbPr750p               0x0002
+#define YPbPr525i               0x0004
+#define YPbPrHiVision           0x0008
 #define YPbPrModeMask           (YPbPr750p | YPbPr525p | YPbPr525i | YPbPrHiVision)
 
 /* SysFlags (to identify special versions) */
@@ -198,6 +204,7 @@
 #define SF_IsM661		0x0020
 #define SF_IsM741		0x0040
 #define SF_IsM760		0x0080
+#define SF_760LFB		0x8000  /* 760: We have LFB */
 
 /* CR32 (Newer 630, and 315 series)
 
@@ -269,7 +276,7 @@
 #define LCDRGB18Bit           0x0001
 #define LCDNonExpanding       0x0010
 #define LCDSync               0x0020
-#define LCDPass11             0x0100
+#define LCDPass11             0x0100   /* 0: center screen, 1: Pass 1:1 data */
 #define LCDDualLink	      0x0200
 
 #define DontExpandLCD	      LCDNonExpanding
@@ -305,7 +312,7 @@
 #define EnablePALMN             0x40   /* Romflag: 1 = Allow PALM/PALN */
 
 /* CR39 (650 only) */
-#define LCDPass1_1		0x01   /* LVDS only; set by driver to pass 1:1 data to LVDS output  */
+#define LCDPass1_1		0x01   /* 0: center screen, 1: pass 1:1 data output  */
 #define Enable302LV_DualLink    0x04   /* 302LV only; enable dual link */
 
 /* CR39 (661 and later)
@@ -348,7 +355,7 @@
 #define Panel300_1024x600       0x06
 #define Panel300_1152x768       0x07
 #define Panel300_1280x768       0x0a
-#define Panel300_320x480        0x0e 	/* fstn - TW: This is fake, can be any */
+#define Panel300_320x480        0x0e 	/* fstn - This is fake, can be any */
 #define Panel300_Custom		0x0f
 #define Panel300_Barco1366      0x10
 
@@ -368,8 +375,24 @@
 #define Panel310_320x480        0x0e    /* fstn - TW: This is fake, can be any */
 #define Panel310_Custom		0x0f
 
+#define Panel661_800x600        0x01
+#define Panel661_1024x768       0x02
+#define Panel661_1280x1024      0x03
+#define Panel661_640x480        0x04
+#define Panel661_1024x600       0x05
+#define Panel661_1152x864       0x06
+#define Panel661_1280x960       0x07
+#define Panel661_1152x768       0x08
+#define Panel661_1400x1050      0x09
+#define Panel661_1280x768       0x0a
+#define Panel661_1600x1200      0x0b
+#define Panel661_1280x800       0x0c
+#define Panel661_1680x1050      0x0d
+#define Panel661_1280x720       0x0e
+#define Panel661_Custom		0x0f
+
 #define Panel_800x600           0x01	/* Unified values */
-#define Panel_1024x768          0x02
+#define Panel_1024x768          0x02    /* MUST match BIOS values from 0-e */
 #define Panel_1280x1024         0x03
 #define Panel_640x480           0x04
 #define Panel_1024x600          0x05
@@ -377,16 +400,19 @@
 #define Panel_1280x960          0x07
 #define Panel_1152x768          0x08	/* LVDS only */
 #define Panel_1400x1050         0x09
-#define Panel_1280x768          0x0a    /* LVDS only */
+#define Panel_1280x768          0x0a    /* 30xB/C and LVDS only (BIOS: all) */
 #define Panel_1600x1200         0x0b
-#define Panel_640x480_2		0x0c
-#define Panel_640x480_3		0x0d
-#define Panel_320x480           0x0e    /* fstn - TW: This is fake, can be any */
-#define Panel_Custom		0x0f
-#define Panel_Barco1366         0x10
-#define Panel_848x480		0x11
-#define Panel_1280x800		0x12    /* 661etc: 0x0c */
-#define Panel_1680x1050         0x13    /* 661etc: 0x0d */
+#define Panel_1280x800		0x0c    /* 661etc  */
+#define Panel_1680x1050         0x0d    /* 661etc  */
+#define Panel_1280x720		0x0e    /* 661etc  */
+#define Panel_Custom		0x0f	/* MUST BE 0x0f (for DVI DDC detection */
+#define Panel_320x480           0x10    /* SiS 550 fstn - TW: This is fake, can be any */
+#define Panel_Barco1366         0x11
+#define Panel_848x480		0x12
+#define Panel_640x480_2		0x13    /* SiS 550 */
+#define Panel_640x480_3		0x14    /* SiS 550 */
+#define Panel_1280x768_2        0x15	/* 30xLV */
+#define Panel_1280x768_3        0x16    /* 30xLV */
 
 /* Index in ModeResInfo table */
 #define SIS_RI_320x200    0
@@ -411,13 +437,17 @@
 #define SIS_RI_856x480   19
 #define SIS_RI_1280x768  20
 #define SIS_RI_1400x1050 21
-#define SIS_RI_1152x864  22  /* Up to this SiS conforming */
+#define SIS_RI_1152x864  22  /* Up to here SiS conforming */
 #define SIS_RI_848x480   23
 #define SIS_RI_1360x768  24
 #define SIS_RI_1024x600  25
 #define SIS_RI_1152x768  26
 #define SIS_RI_768x576   27
 #define SIS_RI_1360x1024 28
+#define SIS_RI_1680x1050 29
+#define SIS_RI_1280x800  30
+#define SIS_RI_1920x1080 31
+#define SIS_RI_960x540   32
 
 /* CR5F */
 #define IsM650                  0x80
@@ -445,14 +475,32 @@
 #define VCLK108_3_300           0x42   /* Index in VCLKData table (300) */
 #define VCLK100_300             0x43   /* Index in VCLKData table (300) */
 #define VCLK34_300              0x3d   /* Index in VCLKData table (300) */
+#define VCLK_CUSTOM_300		0x46
 #define VCLK65_315              0x0b   /* Index in (VB)VCLKData table (315) */
 #define VCLK108_2_315           0x19   /* Index in (VB)VCLKData table (315) */
 #define VCLK81_315		0x5b   /* Index in (VB)VCLKData table (315) */
-#define VCLK162_315             0x21   /* Index in (VB)VCLKData table (315) */
+#define VCLK162_315             0x5e   /* Index in (VB)VCLKData table (315) */
 #define VCLK108_3_315           0x45   /* Index in VBVCLKData table (315) */
 #define VCLK100_315             0x46   /* Index in VBVCLKData table (315) */
-#define VCLK34_315              0x55   /* Index in VBVCLKData table (315) */
+#define VCLK34_315              0x55
 #define VCLK68_315		0x0d
+#define VCLK69_315		0x5c   /* deprecated ! Index in VBVCLKData table (315) */
+#define VCLK83_315		0x5c   /* Index in VBVCLKData table (315) */
+#define VCLK121_315		0x5d   /* Index in VBVCLKData table (315) */
+#define VCLK_1280x720		0x5f
+#define VCLK_1280x768_2		0x60
+#define VCLK_1280x768_3		0x61
+#define VCLK_CUSTOM_315		0x62
+#define VCLK_1280x720_2		0x63
+#define VCLK_720x480		0x67
+#define VCLK_720x576		0x68
+#define VCLK_768x576		0x68
+#define VCLK_848x480		0x65
+#define VCLK_856x480		0x66
+#define VCLK_800x480		0x65
+#define VCLK_1024x576		0x51
+#define VCLK_1152x864		0x64
+#define VCLK_1360x768		0x58
 
 #define TVCLKBASE_300		0x21   /* Indices on TV clocks in VCLKData table (300) */
 #define TVCLKBASE_315	        0x3a   /* Indices on TV clocks in (VB)VCLKData table (315) */
@@ -462,7 +510,7 @@
 #define HiTVVCLK                0x03   /* Index relative to TVCLKBASE */
 #define HiTVSimuVCLK            0x04   /* Index relative to TVCLKBASE */
 #define HiTVTextVCLK            0x05   /* Index relative to TVCLKBASE */
-#define YPbPr750pVCLK		0x0f   /* NOT relative to TVCLKBASE ! */
+#define YPbPr750pVCLK		0x25   /* Index relative to TVCLKBASE; was 0x0f NOT relative */
 
 /* ------------------------------ */
 
@@ -563,7 +611,7 @@
 
 /*
   =============================================================
-   			  for 315 series
+   		  for 315 series (old data layout)
   =============================================================
 */
 #define SoftDRAMType        0x80
diff --git a/drivers/video/sis/oem300.h b/drivers/video/sis/oem300.h
index e4928e23a..d64446407 100644
--- a/drivers/video/sis/oem300.h
+++ b/drivers/video/sis/oem300.h
@@ -1,4 +1,5 @@
 /* $XFree86$ */
+/* $XdotOrg$ */
 /*
  * OEM Data for 300 series
  *
@@ -31,13 +32,10 @@
  * * 2) Redistributions in binary form must reproduce the above copyright
  * *    notice, this list of conditions and the following disclaimer in the
  * *    documentation and/or other materials provided with the distribution.
- * * 3) All advertising materials mentioning features or use of this software
- * *    must display the following acknowledgement: "This product includes
- * *    software developed by Thomas Winischhofer, Vienna, Austria."
- * * 4) The name of the author may not be used to endorse or promote products
+ * * 3) The name of the author may not be used to endorse or promote products
  * *    derived from this software without specific prior written permission.
  * *
- * * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR
+ * * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESSED 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,
diff --git a/drivers/video/sis/oem310.h b/drivers/video/sis/oem310.h
index fad2fa013..4b6cbb7e6 100644
--- a/drivers/video/sis/oem310.h
+++ b/drivers/video/sis/oem310.h
@@ -1,4 +1,5 @@
 /* $XFree86$ */
+/* $XdotOrg$ */
 /*
  * OEM Data for 315/330 series
  *
@@ -31,13 +32,10 @@
  * * 2) Redistributions in binary form must reproduce the above copyright
  * *    notice, this list of conditions and the following disclaimer in the
  * *    documentation and/or other materials provided with the distribution.
- * * 3) All advertising materials mentioning features or use of this software
- * *    must display the following acknowledgement: "This product includes
- * *    software developed by Thomas Winischhofer, Vienna, Austria."
- * * 4) The name of the author may not be used to endorse or promote products
+ * * 3) The name of the author may not be used to endorse or promote products
  * *    derived from this software without specific prior written permission.
  * *
- * * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR
+ * * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESSED 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,
@@ -91,7 +89,7 @@ static const UCHAR SiS310_LCDDelayCompensation_650301LV[] =	   	/* 650 + 30xLV *
 		 0x02,0x02,0x02
 };
 
-static const UCHAR SiS310_LCDDelayCompensation_651301LV[] =	  /* M650/651 301LV */
+static const UCHAR SiS310_LCDDelayCompensation_651301LV[] =	  	/* M650/651 301LV */
 {
                  0x33,0x33,0x33,    /*   800x600 (guessed) - new: PanelType, not PanelRes ! */
 		 0x33,0x33,0x33,    /*  1024x768 */
@@ -110,7 +108,7 @@ static const UCHAR SiS310_LCDDelayCompensation_651301LV[] =	  /* M650/651 301LV
 		 0x33,0x33,0x33
 };
 
-static const UCHAR SiS310_LCDDelayCompensation_651302LV[] =	   /* M650/651 302LV */
+static const UCHAR SiS310_LCDDelayCompensation_651302LV[] =	   	/* M650/651 302LV */
 {
                  0x33,0x33,0x33,    /*   800x600 (guessed) */
 		 0x33,0x33,0x33,    /*  1024x768 */
@@ -129,7 +127,7 @@ static const UCHAR SiS310_LCDDelayCompensation_651302LV[] =	   /* M650/651 302LV
 		 0x33,0x33,0x33
 };
 
-static const UCHAR SiS310_LCDDelayCompensation_3xx301B[] =	   	/* 30xB,LV */
+static const UCHAR SiS310_LCDDelayCompensation_3xx301B[] =	   	/* 30xB */
 {
 		 0x01,0x01,0x01,    /*   800x600 */
 		 0x0C,0x0C,0x0C,    /*  1024x768 */
@@ -148,6 +146,25 @@ static const UCHAR SiS310_LCDDelayCompensation_3xx301B[] =	   	/* 30xB,LV */
 		 0x02,0x02,0x02
 };
 
+static const UCHAR SiS310_LCDDelayCompensation_3xx301LV[] =	   	/* 315+30xLV */
+{
+		 0x01,0x01,0x01,    /*   800x600 */
+		 0x04,0x04,0x04,    /*  1024x768 (A531/BIOS 1.14.05f: 4 - works with 6 */
+		 0x0C,0x0C,0x0C,    /* 1280x1024 */
+                 0x08,0x08,0x08,    /*   640x480 */
+		 0x0C,0x0C,0x0C,    /*  1024x600 (guessed) */
+		 0x0C,0x0C,0x0C,    /*  1152x864 (guessed) */
+		 0x0C,0x0C,0x0C,    /*  1280x960 (guessed) */
+		 0x0C,0x0C,0x0C,    /*  1152x768 (guessed) */
+		 0x0C,0x0C,0x0C,    /* 1400x1050 (guessed) */
+		 0x0C,0x0C,0x0C,    /*  1280x768 (guessed) */
+		 0x0C,0x0C,0x0C,    /* 1600x1200 (guessed) */
+		 0x02,0x02,0x02,
+		 0x02,0x02,0x02,
+		 0x02,0x02,0x02,
+		 0x02,0x02,0x02
+};
+
 static const UCHAR SiS310_TVDelayCompensation_301[] = 		/* 301 */
 {
 		 0x02,0x02,    /* NTSC Enhanced, Standard */
@@ -169,13 +186,6 @@ static const UCHAR SiS310_TVDelayCompensation_740301B[] =	/* 740 + 30xB (30xLV?)
 		 0x05,0x05
 };
 
-static const UCHAR SiS310_TVDelayCompensation_LVDS[] =		/* LVDS */
-{
-		 0x0a,0x0a,
-		 0x0a,0x0a,
-		 0x0a,0x0a
-};
-
 static const UCHAR SiS310_TVDelayCompensation_651301LV[] =	/* M650, 651, 301LV */
 {
 		 0x33,0x33,
@@ -210,6 +220,13 @@ static const UCHAR SiS_TVDelay661_301B[] =			/* 661, 301B et al */
 		 0x44,0x44
 };
 
+static const UCHAR SiS310_TVDelayCompensation_LVDS[] =		/* LVDS */
+{
+		 0x0a,0x0a,
+		 0x0a,0x0a,
+		 0x0a,0x0a
+};
+
 static const UCHAR SiS310_TVAntiFlick1[6][2] =
 {
             {0x4,0x0},
@@ -412,141 +429,6 @@ static const SiS_LCDDataStruct  SiS310_ExtCompaq1280x1024Data[] =
 	{    1,   1,1696,1066,1696,1066}
 };
 
-static const SiS_Part2PortTblStruct SiS310_CRT2Part2_Compaq1280x1024_1[] =
-{
- {{0x3F,0x1B,0xD0,0xF0,0xB0,0xB8,0x23,0x0A,0x07,0x14,0x8A,0x12}},
- {{0x35,0x1B,0xA0,0xC0,0x80,0xB8,0x23,0x0A,0x07,0x14,0x8A,0x12}},
- {{0x3F,0x1B,0xD0,0xF0,0xB0,0xB8,0x23,0x0A,0x07,0x14,0x8A,0x12}},
- {{0x3F,0x1B,0xD0,0xF0,0xB0,0xB8,0x23,0x0A,0x07,0x14,0x8A,0x12}},
- {{0x45,0x1C,0x20,0x3F,0xFF,0xB8,0x23,0x0A,0x07,0x14,0x8A,0x12}},
- {{0x49,0x1C,0x40,0x7F,0xFF,0xAD,0x23,0x0A,0x07,0xF3,0x8A,0x12}},
- {{0x4C,0x1C,0x18,0x2F,0xFF,0xBD,0x23,0x0A,0x07,0x23,0x8A,0x12}},
- {{0x48,0x1C,0x15,0x29,0xFF,0xBD,0x23,0x0A,0x07,0x23,0x8A,0x12}}
-};
-
-static const SiS_Part2PortTblStruct SiS310_CRT2Part2_Compaq1280x1024_2[] =
-{
- {{0x2B,0x12,0xD9,0xE5,0xD5,0x2C,0x23,0x98,0x27,0x3E,0x08,0x42}},
- {{0x22,0x12,0xC0,0xCC,0xBC,0x2C,0x23,0x98,0x27,0x3E,0x08,0x42}},
- {{0x2B,0x12,0xD9,0xE5,0xD5,0x2C,0x23,0x98,0x27,0x3E,0x08,0x42}},
- {{0x22,0x12,0xC0,0xCC,0xBC,0x2C,0x23,0x98,0x27,0x3E,0x08,0x42}},
- {{0x33,0x13,0x01,0x0D,0xFD,0x2C,0x23,0x98,0x27,0x3E,0x08,0x42}},
- {{0x3F,0x1B,0x3D,0x49,0x39,0x54,0x23,0xC0,0x27,0x66,0x30,0x42}},
- {{0x33,0x1B,0x91,0x9D,0x8D,0x8C,0x23,0xF8,0x27,0x9E,0x68,0x42}},
- {{0x43,0x24,0x11,0x1D,0x0D,0xCC,0x23,0x38,0x37,0xDE,0xA8,0x42}},
- {{0x43,0x24,0x21,0x29,0x19,0xEA,0x23,0x0A,0x07,0x32,0xC6,0x42}}
-};
-
-static const SiS_Part2PortTblStruct SiS310_CRT2Part2_Compaq1280x1024_3[] =
-{
- {{0x47,0x1C,0x14,0x29,0xFF,0xBD,0x23,0x0A,0x07,0x23,0x8A,0x12}},
- {{0x47,0x1C,0x14,0x29,0xFF,0xBD,0x23,0x0A,0x07,0x23,0x8A,0x12}},
- {{0x47,0x1C,0x14,0x29,0xFF,0xBD,0x23,0x0A,0x07,0x23,0x8A,0x12}},
- {{0x47,0x1C,0x14,0x29,0xFF,0xBD,0x23,0x0A,0x07,0x23,0x8A,0x12}},
- {{0x47,0x1C,0x14,0x29,0xFF,0xBE,0x23,0x0A,0x07,0x26,0x8A,0x42}},
- {{0x47,0x1C,0x14,0x29,0xFF,0xBE,0x23,0x0A,0x07,0x26,0x8A,0x42}},
- {{0x47,0x1C,0x14,0x29,0xFF,0xBE,0x23,0x0A,0x07,0x26,0x8A,0x42}},
- {{0x47,0x1C,0x14,0x29,0xFF,0xBE,0x23,0x0A,0x07,0x26,0x8A,0x42}}
-};
-
-/* LCDA CRT2 data is std */
-
-static const SiS_LVDSDesStruct Compaq1280x1024Des_1[] =
-{
-  { 0, 0 },
-  { 0, 0 },
-  { 0, 0 },
-  { 0, 0 },
-  { 0, 0 },
-  { 0, 0 },
-  { 0, 0 },
-  { 0, 0 }
-};
-
-static const SiS_LVDSDesStruct Compaq1280x1024Des_2[] =
-{
-  { 0, 0 },
-  { 0, 0 },
-  { 0, 0 },
-  { 0, 0 },
-  { 0, 0 },
-  { 0, 0 },
-  { 0, 0 },
-  { 0, 0 }
-};
-
-/* Clevo L285/287 (dual-link 1024x768) */
-
-static const SiS_Part2PortTblStruct SiS310_CRT2Part2_Clevo1024x768_1[] =
-{
- {{0x25,0x12,0xC9,0xDC,0xB6,0x59,0x45,0x09,0x07,0xF9,0x09,0x24}},
- {{0x2C,0x12,0x9A,0xAE,0x88,0x59,0x45,0x09,0x07,0xF9,0x09,0x24}},
- {{0x25,0x12,0xC9,0xDC,0xB6,0x59,0x45,0x09,0x07,0xF9,0x09,0x24}},
- {{0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00}},
- {{0x38,0x13,0x16,0x0C,0xE6,0x59,0x45,0x09,0x07,0xF9,0x09,0x24}},
- {{0x38,0x18,0x16,0x00,0x00,0x59,0x45,0x09,0x07,0xF9,0x09,0x24}},
- {{0x36,0x13,0x13,0x25,0xFF,0x59,0x45,0x09,0x07,0xF9,0x09,0x24}},
- {{0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00}},
- {{0x25,0x12,0xC9,0xDC,0xB6,0x59,0x45,0x09,0x07,0xF9,0x09,0x24}}
-};
-
-static const SiS_Part2PortTblStruct SiS310_CRT2Part2_Clevo1024x768_2[] =
-{
- {{0x25,0x12,0x51,0x6E,0x48,0xCC,0x12,0x89,0x47,0x1C,0x49,0x33}},
- {{0x2C,0x12,0x38,0x55,0x2F,0xCC,0x12,0x89,0x47,0x1C,0x49,0x33}},
- {{0x25,0x12,0x51,0x6E,0x48,0xCC,0x12,0x89,0x47,0x1C,0x49,0x33}},
- {{0x2C,0x12,0x38,0x55,0x2F,0xE0,0x12,0xB1,0x47,0x30,0x71,0x33}},
- {{0x2D,0x12,0x79,0x96,0x70,0xCC,0x12,0x89,0x47,0x1C,0x49,0x33}},
- {{0x29,0x12,0xB5,0xD2,0xAC,0xF4,0x12,0xD9,0x47,0x44,0x99,0x33}},
- {{0x36,0x13,0x13,0x25,0xFF,0x32,0x22,0x0A,0x07,0x82,0x0A,0x12}},
-#if 0
- {{0x25,0x12,0x51,0x6E,0x48,0x99,0x35,0x89,0x47,0xC1,0x49,0x33}},
- {{0x2C,0x12,0x38,0x55,0x2F,0x99,0x35,0x89,0x47,0xC1,0x49,0x33}},
- {{0x25,0x12,0x51,0x6E,0x48,0x99,0x35,0x89,0x47,0xC1,0x49,0x33}},
- {{0x2C,0x12,0x38,0x55,0x2F,0xC1,0x35,0xB1,0x47,0xE9,0x71,0x33}},
- {{0x2D,0x12,0x79,0x96,0x70,0x99,0x35,0x89,0x47,0xC1,0x49,0x33}},
- {{0x29,0x12,0xB5,0xD2,0xAC,0xE9,0x35,0xD9,0x47,0x11,0x99,0x33}},
- {{0x36,0x13,0x13,0x25,0xFF,0x59,0x45,0x09,0x07,0xF9,0x09,0x24}}
-#endif
-};
-
-static const SiS_Part2PortTblStruct SiS310_CRT2Part2_Clevo1024x768_3[] =
-{
- {{0x36,0x13,0x13,0x25,0xFF,0x32,0x22,0x0A,0x07,0x82,0x0A,0x12}}, /* Corrected */
- {{0x36,0x13,0x13,0x25,0xFF,0x32,0x22,0x0A,0x07,0x82,0x0A,0x12}},
- {{0x36,0x13,0x13,0x25,0xFF,0x32,0x22,0x0A,0x07,0x82,0x0A,0x12}},
- {{0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00}},
- {{0x36,0x13,0x13,0x25,0xFF,0x32,0x22,0x0A,0x07,0x82,0x0A,0x12}},
- {{0x36,0x13,0x13,0x25,0xFF,0x32,0x22,0x0A,0x07,0x82,0x0A,0x12}},
- {{0x36,0x13,0x13,0x25,0xFF,0x32,0x22,0x0A,0x07,0x82,0x0A,0x12}},
- {{0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00}},
- {{0x25,0x13,0xC9,0x25,0xFF,0x59,0x45,0x09,0x07,0xF9,0x09,0x24}}
-};
-
-/* CRT2 data is std */
-
-static const SiS_LVDSDesStruct Clevo1024x768Des_1[] =
-{
-  { 0, 0 },
-  { 0, 0 },
-  { 0, 0 },
-  { 0, 0 },
-  { 0, 0 },
-  { 0, 0 },
-  { 0, 0 }
-};
-
-static const SiS_LVDSDesStruct Clevo1024x768Des_2[] =
-{
-  { 1184, 622 },
-  { 1184, 597 },
-  { 1184, 622 },
-  { 1184, 597 },
-  { 1152, 622 },
-  { 1232, 722 },
-  {    0,   0 }
-};
-
 /* Asus A2xxxH _2 */
 
 static const SiS_Part2PortTblStruct SiS310_CRT2Part2_Asus1024x768_3[] =
@@ -562,52 +444,6 @@ static const SiS_Part2PortTblStruct SiS310_CRT2Part2_Asus1024x768_3[] =
  {{0x25,0x13,0xc9,0x25,0xff,0x59,0x45,0x09,0x07,0xf9,0x09,0x24}}
 };
 
-static const SiS_LVDSDesStruct Asus1024x768Des_1[] =
-{
-  { 0, 0 },
-  { 0, 0 },
-  { 0, 0 },
-  { 0, 0 },
-  { 0, 0 },
-  { 0, 0 },
-  { 0, 0 }
-};
-
-static const SiS_LVDSDesStruct Asus1024x768Des_2[] =
-{
-  { 1184, 622 },
-  { 1184, 597 },
-  { 1184, 622 },
-  { 1184, 597 },
-  { 1152, 622 },
-  { 1232, 722 },
-  {    0,   0 }
-};
-
-/* CRT2 data is std */
-
-/* Uniwill N243S9, ECS A928 */
 
-static const SiS_LVDSDesStruct Uniwill1024x768Des_1[] =
-{
-  { 0, 0 },
-  { 0, 0 },
-  { 0, 0 },
-  { 0, 0 },
-  { 0, 0 },
-  { 0, 0 },
-  { 0, 805 }
-};
-
-static const SiS_LVDSDesStruct Uniwill1024x768Des_2[] =
-{
-  { 1184, 622 },
-  { 1184, 597 },
-  { 1184, 622 },
-  { 1184, 597 },
-  { 1152, 650 },
-  { 1232, 722 },
-  {    0, 805 },
-};
 
 
diff --git a/drivers/video/sis/osdef.h b/drivers/video/sis/osdef.h
index 1bef56e30..443ee39f8 100644
--- a/drivers/video/sis/osdef.h
+++ b/drivers/video/sis/osdef.h
@@ -1,4 +1,5 @@
 /* $XFree86$ */
+/* $XdotOrg$ */
 /*
  * OS depending defines
  *
@@ -31,13 +32,10 @@
  * * 2) Redistributions in binary form must reproduce the above copyright
  * *    notice, this list of conditions and the following disclaimer in the
  * *    documentation and/or other materials provided with the distribution.
- * * 3) All advertising materials mentioning features or use of this software
- * *    must display the following acknowledgement: "This product includes
- * *    software developed by Thomas Winischhofer, Vienna, Austria."
- * * 4) The name of the author may not be used to endorse or promote products
+ * * 3) The name of the author may not be used to endorse or promote products
  * *    derived from this software without specific prior written permission.
  * *
- * * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR
+ * * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESSED 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,
@@ -54,95 +52,77 @@
  */
 
 /* The choices are: */
-
 #define LINUX_KERNEL	   /* Kernel framebuffer */
 /* #define LINUX_XF86 */   /* XFree86 */
 
-/**********************************************************************/
-#ifdef LINUX_KERNEL  /* -------------------------- */
-#include <linux/config.h>
-#include <linux/version.h>
-
-#ifdef CONFIG_FB_SIS_300
-#define SIS300
-#endif
-
-#ifdef CONFIG_FB_SIS_315
-#define SIS315H
-#endif
-
-#if 1
-#define SISFBACCEL	/* Include 2D acceleration */
-#endif
-
-#endif
-
-#ifdef LINUX_XF86 /* ----------------------------- */
-#define SIS300
-#define SIS315H
-#endif
-
-/**********************************************************************/
-#ifdef LINUX_XF86
-#define SiS_SetMemory(MemoryAddress,MemorySize,value) memset(MemoryAddress, value, MemorySize)
-#define SiS_MemoryCopy(Destination,Soruce,Length) memcpy(Destination,Soruce,Length)
-#endif
-
-#ifdef LINUX_KERNEL
-#define SiS_SetMemory(MemoryAddress,MemorySize,value) memset(MemoryAddress, value, MemorySize)
-#define SiS_MemoryCopy(Destination,Soruce,Length) memcpy(Destination,Soruce,Length)
-#endif
-
-/**********************************************************************/
-
 #ifdef OutPortByte
 #undef OutPortByte
-#endif /* OutPortByte */
+#endif
 
 #ifdef OutPortWord
 #undef OutPortWord
-#endif /* OutPortWord */
+#endif
 
 #ifdef OutPortLong
 #undef OutPortLong
-#endif /* OutPortLong */
+#endif
 
 #ifdef InPortByte
 #undef InPortByte
-#endif /* InPortByte */
+#endif
 
 #ifdef InPortWord
 #undef InPortWord
-#endif /* InPortWord */
+#endif
 
 #ifdef InPortLong
 #undef InPortLong
-#endif /* InPortLong */
+#endif
 
 /**********************************************************************/
-/*  LINUX XF86                                                        */
+/*  LINUX KERNEL                                                      */
 /**********************************************************************/
 
-#ifdef LINUX_XF86
-#define OutPortByte(p,v) outb((CARD16)(p),(CARD8)(v))
-#define OutPortWord(p,v) outw((CARD16)(p),(CARD16)(v))
-#define OutPortLong(p,v) outl((CARD16)(p),(CARD32)(v))
-#define InPortByte(p)    inb((CARD16)(p))
-#define InPortWord(p)    inw((CARD16)(p))
-#define InPortLong(p)    inl((CARD16)(p))
+#ifdef LINUX_KERNEL
+#include <linux/config.h>
+
+#ifdef CONFIG_FB_SIS_300
+#define SIS300
+#endif
+
+#ifdef CONFIG_FB_SIS_315
+#define SIS315H
+#endif
+
+#if !defined(SIS300) && !defined(SIS315H)
+#warning Neither CONFIG_FB_SIS_300 nor CONFIG_FB_SIS_315 is set
+#warning sisfb will not work!
+#endif
+
+#define OutPortByte(p,v) outb((u8)(v),(SISIOADDRESS)(p))
+#define OutPortWord(p,v) outw((u16)(v),(SISIOADDRESS)(p))
+#define OutPortLong(p,v) outl((u32)(v),(SISIOADDRESS)(p))
+#define InPortByte(p)    inb((SISIOADDRESS)(p))
+#define InPortWord(p)    inw((SISIOADDRESS)(p))
+#define InPortLong(p)    inl((SISIOADDRESS)(p))
+#define SiS_SetMemory(MemoryAddress,MemorySize,value) memset_io(MemoryAddress, value, MemorySize)
 #endif
 
 /**********************************************************************/
-/*  LINUX KERNEL                                                      */
+/*  XFree86, X.org                                                    */
 /**********************************************************************/
 
-#ifdef LINUX_KERNEL
-#define OutPortByte(p,v) outb((u8)(v),(u16)(p))
-#define OutPortWord(p,v) outw((u16)(v),(u16)(p))
-#define OutPortLong(p,v) outl((u32)(v),(u16)(p))
-#define InPortByte(p)    inb((u16)(p))
-#define InPortWord(p)    inw((u16)(p))
-#define InPortLong(p)    inl((u16)(p))
+#ifdef LINUX_XF86
+#define SIS300
+#define SIS315H
+
+#define OutPortByte(p,v) outb((IOADDRESS)(p),(CARD8)(v))
+#define OutPortWord(p,v) outw((IOADDRESS)(p),(CARD16)(v))
+#define OutPortLong(p,v) outl((IOADDRESS)(p),(CARD32)(v))
+#define InPortByte(p)    inb((IOADDRESS)(p))
+#define InPortWord(p)    inw((IOADDRESS)(p))
+#define InPortLong(p)    inl((IOADDRESS)(p))
+#define SiS_SetMemory(MemoryAddress,MemorySize,value) memset(MemoryAddress, value, MemorySize)
 #endif
 
 
diff --git a/drivers/video/sis/sis.h b/drivers/video/sis/sis.h
index 5fa107db7..97599dfd5 100644
--- a/drivers/video/sis/sis.h
+++ b/drivers/video/sis/sis.h
@@ -1,10 +1,505 @@
+/*
+ * SiS 300/630/730/540/315/550/650/651/M650/661FX/M661FX/740/741/330/760
+ * frame buffer driver for Linux kernels >=2.4.14 and >=2.6.3
+ *
+ * Copyright (C) 2001-2004 Thomas Winischhofer, Vienna, Austria.
+ *
+ * This program is free software; you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+ * the Free Software Foundation; either version 2 of the named License,
+ * or any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program; if not, write to the Free Software
+ * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307, USA
+ */
+
 #ifndef _SIS_H
 #define _SIS_H
 
-#if 1
-#define TWDEBUG(x)
+#include <linux/config.h>
+#include <linux/version.h>
+
+#include "osdef.h"
+#if LINUX_VERSION_CODE >= KERNEL_VERSION(2,5,0)
+#include <video/sisfb.h>
 #else
+#include <linux/sisfb.h>
+#endif
+
+#include "vgatypes.h"
+#include "vstruct.h"
+
+#define VER_MAJOR                 1
+#define VER_MINOR                 7
+#define VER_LEVEL                 12
+
+#undef SIS_CONFIG_COMPAT
+
+#if LINUX_VERSION_CODE >= KERNEL_VERSION(2,5,0)
+#include <linux/spinlock.h>
+#ifdef CONFIG_COMPAT
+#include <linux/ioctl32.h>
+#define SIS_CONFIG_COMPAT
+#endif
+#elif LINUX_VERSION_CODE >= KERNEL_VERSION(2,4,19)
+#ifdef __x86_64__
+/* Shouldn't we check for CONFIG_IA32_EMULATION here? */
+#include <asm/ioctl32.h>
+#define SIS_CONFIG_COMPAT
+#endif
+#endif
+
+#undef SISFBDEBUG
+
+#ifdef SISFBDEBUG
+#define DPRINTK(fmt, args...) printk(KERN_DEBUG "%s: " fmt, __FUNCTION__ , ## args)
 #define TWDEBUG(x) printk(KERN_INFO x "\n");
+#else
+#define DPRINTK(fmt, args...)
+#define TWDEBUG(x)
+#endif
+
+#define SISFAIL(x) do { printk(x "\n"); return -EINVAL; } while(0)
+
+/* To be included in pci_ids.h */
+#ifndef PCI_DEVICE_ID_SI_650_VGA
+#define PCI_DEVICE_ID_SI_650_VGA  0x6325
+#endif
+#ifndef PCI_DEVICE_ID_SI_650
+#define PCI_DEVICE_ID_SI_650      0x0650
+#endif
+#ifndef PCI_DEVICE_ID_SI_651
+#define PCI_DEVICE_ID_SI_651      0x0651
+#endif
+#ifndef PCI_DEVICE_ID_SI_740
+#define PCI_DEVICE_ID_SI_740      0x0740
+#endif
+#ifndef PCI_DEVICE_ID_SI_330
+#define PCI_DEVICE_ID_SI_330      0x0330
+#endif
+#ifndef PCI_DEVICE_ID_SI_660_VGA
+#define PCI_DEVICE_ID_SI_660_VGA  0x6330
+#endif
+#ifndef PCI_DEVICE_ID_SI_661
+#define PCI_DEVICE_ID_SI_661      0x0661
+#endif
+#ifndef PCI_DEVICE_ID_SI_741
+#define PCI_DEVICE_ID_SI_741      0x0741
+#endif
+#ifndef PCI_DEVICE_ID_SI_660
+#define PCI_DEVICE_ID_SI_660      0x0660
+#endif
+#ifndef PCI_DEVICE_ID_SI_760
+#define PCI_DEVICE_ID_SI_760      0x0760
+#endif
+
+/* To be included in fb.h */
+#ifndef FB_ACCEL_SIS_GLAMOUR_2
+#define FB_ACCEL_SIS_GLAMOUR_2	  40	/* SiS 315, 65x, 740, 661, 741  */
+#endif
+#ifndef FB_ACCEL_SIS_XABRE
+#define FB_ACCEL_SIS_XABRE        41	/* SiS 330 ("Xabre"), 760 	*/
+#endif
+
+#define MAX_ROM_SCAN              0x10000
+
+/* ivideo->caps */
+#define HW_CURSOR_CAP             0x80
+#define TURBO_QUEUE_CAP           0x40
+#define AGP_CMD_QUEUE_CAP         0x20
+#define VM_CMD_QUEUE_CAP          0x10
+#define MMIO_CMD_QUEUE_CAP        0x08
+
+/* For 300 series */
+#define TURBO_QUEUE_AREA_SIZE     0x80000 /* 512K */
+#define HW_CURSOR_AREA_SIZE_300   0x1000  /* 4K */
+
+/* For 315/Xabre series */
+#define COMMAND_QUEUE_AREA_SIZE   0x80000 /* 512K */
+#define COMMAND_QUEUE_THRESHOLD   0x1F
+#define HW_CURSOR_AREA_SIZE_315   0x4000  /* 16K */
+
+#define SIS_OH_ALLOC_SIZE         4000
+#define SENTINEL                  0x7fffffff
+
+#define SEQ_ADR                   0x14
+#define SEQ_DATA                  0x15
+#define DAC_ADR                   0x18
+#define DAC_DATA                  0x19
+#define CRTC_ADR                  0x24
+#define CRTC_DATA                 0x25
+#define DAC2_ADR                  (0x16-0x30)
+#define DAC2_DATA                 (0x17-0x30)
+#define VB_PART1_ADR              (0x04-0x30)
+#define VB_PART1_DATA             (0x05-0x30)
+#define VB_PART2_ADR              (0x10-0x30)
+#define VB_PART2_DATA             (0x11-0x30)
+#define VB_PART3_ADR              (0x12-0x30)
+#define VB_PART3_DATA             (0x13-0x30)
+#define VB_PART4_ADR              (0x14-0x30)
+#define VB_PART4_DATA             (0x15-0x30)
+
+#define SISSR			  ivideo->SiS_Pr.SiS_P3c4
+#define SISCR                     ivideo->SiS_Pr.SiS_P3d4
+#define SISDACA                   ivideo->SiS_Pr.SiS_P3c8
+#define SISDACD                   ivideo->SiS_Pr.SiS_P3c9
+#define SISPART1                  ivideo->SiS_Pr.SiS_Part1Port
+#define SISPART2                  ivideo->SiS_Pr.SiS_Part2Port
+#define SISPART3                  ivideo->SiS_Pr.SiS_Part3Port
+#define SISPART4                  ivideo->SiS_Pr.SiS_Part4Port
+#define SISPART5                  ivideo->SiS_Pr.SiS_Part5Port
+#define SISDAC2A                  SISPART5
+#define SISDAC2D                  (SISPART5 + 1)
+#define SISMISCR                  (ivideo->SiS_Pr.RelIO + 0x1c)
+#define SISMISCW                  ivideo->SiS_Pr.SiS_P3c2
+#define SISINPSTAT		  (ivideo->SiS_Pr.RelIO + 0x2a)
+#define SISPEL			  ivideo->SiS_Pr.SiS_P3c6
+
+#define IND_SIS_PASSWORD          0x05  /* SRs */
+#define IND_SIS_COLOR_MODE        0x06
+#define IND_SIS_RAMDAC_CONTROL    0x07
+#define IND_SIS_DRAM_SIZE         0x14
+#define IND_SIS_MODULE_ENABLE     0x1E
+#define IND_SIS_PCI_ADDRESS_SET   0x20
+#define IND_SIS_TURBOQUEUE_ADR    0x26
+#define IND_SIS_TURBOQUEUE_SET    0x27
+#define IND_SIS_POWER_ON_TRAP     0x38
+#define IND_SIS_POWER_ON_TRAP2    0x39
+#define IND_SIS_CMDQUEUE_SET      0x26
+#define IND_SIS_CMDQUEUE_THRESHOLD  0x27
+
+#define IND_SIS_AGP_IO_PAD        0x48
+
+#define SIS_CRT2_WENABLE_300 	  0x24  /* Part1 */
+#define SIS_CRT2_WENABLE_315 	  0x2F
+
+#define SIS_PASSWORD              0x86  /* SR05 */
+#define SIS_INTERLACED_MODE       0x20  /* SR06 */
+#define SIS_8BPP_COLOR_MODE       0x0
+#define SIS_15BPP_COLOR_MODE      0x1
+#define SIS_16BPP_COLOR_MODE      0x2
+#define SIS_32BPP_COLOR_MODE      0x4
+
+#define SIS_ENABLE_2D             0x40  /* SR1E */
+
+#define SIS_MEM_MAP_IO_ENABLE     0x01  /* SR20 */
+#define SIS_PCI_ADDR_ENABLE       0x80
+
+#define SIS_AGP_CMDQUEUE_ENABLE   0x80  /* 315/330 series SR26 */
+#define SIS_VRAM_CMDQUEUE_ENABLE  0x40
+#define SIS_MMIO_CMD_ENABLE       0x20
+#define SIS_CMD_QUEUE_SIZE_512k   0x00
+#define SIS_CMD_QUEUE_SIZE_1M     0x04
+#define SIS_CMD_QUEUE_SIZE_2M     0x08
+#define SIS_CMD_QUEUE_SIZE_4M     0x0C
+#define SIS_CMD_QUEUE_RESET       0x01
+#define SIS_CMD_AUTO_CORR	  0x02
+
+#define SIS_SIMULTANEOUS_VIEW_ENABLE  0x01  /* CR30 */
+#define SIS_MODE_SELECT_CRT2      0x02
+#define SIS_VB_OUTPUT_COMPOSITE   0x04
+#define SIS_VB_OUTPUT_SVIDEO      0x08
+#define SIS_VB_OUTPUT_SCART       0x10
+#define SIS_VB_OUTPUT_LCD         0x20
+#define SIS_VB_OUTPUT_CRT2        0x40
+#define SIS_VB_OUTPUT_HIVISION    0x80
+
+#define SIS_VB_OUTPUT_DISABLE     0x20  /* CR31 */
+#define SIS_DRIVER_MODE           0x40
+
+#define SIS_VB_COMPOSITE          0x01  /* CR32 */
+#define SIS_VB_SVIDEO             0x02
+#define SIS_VB_SCART              0x04
+#define SIS_VB_LCD                0x08
+#define SIS_VB_CRT2               0x10
+#define SIS_CRT1                  0x20
+#define SIS_VB_HIVISION           0x40
+#define SIS_VB_YPBPR              0x80
+#define SIS_VB_TV                 (SIS_VB_COMPOSITE | SIS_VB_SVIDEO | \
+                                   SIS_VB_SCART | SIS_VB_HIVISION | SIS_VB_YPBPR)
+
+#define SIS_EXTERNAL_CHIP_MASK    	   0x0E  /* CR37 (< SiS 660) */
+#define SIS_EXTERNAL_CHIP_SIS301           0x01  /* in CR37 << 1 ! */
+#define SIS_EXTERNAL_CHIP_LVDS             0x02
+#define SIS_EXTERNAL_CHIP_TRUMPION         0x03
+#define SIS_EXTERNAL_CHIP_LVDS_CHRONTEL    0x04
+#define SIS_EXTERNAL_CHIP_CHRONTEL         0x05
+#define SIS310_EXTERNAL_CHIP_LVDS          0x02
+#define SIS310_EXTERNAL_CHIP_LVDS_CHRONTEL 0x03
+
+#define SIS_AGP_2X                0x20  /* CR48 */
+
+#define HW_DEVICE_EXTENSION	  SIS_HW_INFO
+#define PHW_DEVICE_EXTENSION      PSIS_HW_INFO
+
+/* Useful macros */
+#define inSISREG(base)          inb(base)
+#define outSISREG(base,val)     outb(val,base)
+#define orSISREG(base,val)      do { \
+                                  u8 __Temp = inb(base); \
+                                  outSISREG(base, __Temp | (val)); \
+                                } while (0)
+#define andSISREG(base,val)     do { \
+                                  u8 __Temp = inb(base); \
+                                  outSISREG(base, __Temp & (val)); \
+                                } while (0)
+#define inSISIDXREG(base,idx,var)   do { \
+                                      outb(idx,base); var=inb((base)+1); \
+                                    } while (0)
+#define outSISIDXREG(base,idx,val)  do { \
+                                      outb(idx,base); outb((val),(base)+1); \
+                                    } while (0)
+#define orSISIDXREG(base,idx,val)   do { \
+                                      u8 __Temp; \
+                                      outb(idx,base);   \
+                                      __Temp = inb((base)+1)|(val); \
+                                      outSISIDXREG(base,idx,__Temp); \
+                                    } while (0)
+#define andSISIDXREG(base,idx,and)  do { \
+                                      u8 __Temp; \
+                                      outb(idx,base);   \
+                                      __Temp = inb((base)+1)&(and); \
+                                      outSISIDXREG(base,idx,__Temp); \
+                                    } while (0)
+#define setSISIDXREG(base,idx,and,or)   do { \
+                                          u8 __Temp; \
+                                          outb(idx,base);   \
+                                          __Temp = (inb((base)+1)&(and))|(or); \
+                                          outSISIDXREG(base,idx,__Temp); \
+                                        } while (0)
+
+/* MMIO access macros */
+#define MMIO_IN8(base, offset)  readb((base+offset))
+#define MMIO_IN16(base, offset) readw((base+offset))
+#define MMIO_IN32(base, offset) readl((base+offset))
+
+#define MMIO_OUT8(base, offset, val)  writeb(((u8)(val)), (base+offset))
+#define MMIO_OUT16(base, offset, val) writew(((u16)(val)), (base+offset))
+#define MMIO_OUT32(base, offset, val) writel(((u32)(val)), (base+offset))
+
+/* Queue control MMIO registers */
+#define Q_BASE_ADDR		0x85C0  /* Base address of software queue */
+#define Q_WRITE_PTR		0x85C4  /* Current write pointer */
+#define Q_READ_PTR		0x85C8  /* Current read pointer */
+#define Q_STATUS		0x85CC  /* queue status */
+
+#define MMIO_QUEUE_PHYBASE      Q_BASE_ADDR
+#define MMIO_QUEUE_WRITEPORT    Q_WRITE_PTR
+#define MMIO_QUEUE_READPORT     Q_READ_PTR
+
+enum _SIS_CMDTYPE {
+	MMIO_CMD = 0,
+	AGP_CMD_QUEUE,
+	VM_CMD_QUEUE,
+};
+typedef unsigned int SIS_CMDTYPE;
+
+/* Our "par" */
+struct sis_video_info {
+	int		cardnumber;
+	struct fb_info  *memyselfandi;
+
+	SIS_HW_INFO 	sishw_ext;
+	SiS_Private  	SiS_Pr;
+
+	sisfb_info 	sisfbinfo;	/* For ioctl SISFB_GET_INFO */
+
+	struct fb_var_screeninfo default_var;
+
+#if LINUX_VERSION_CODE >= KERNEL_VERSION(2,5,0)
+	struct fb_fix_screeninfo sisfb_fix;
+	u32 		pseudo_palette[17];
+#endif
+
+#if LINUX_VERSION_CODE < KERNEL_VERSION(2,5,0)
+	struct display 		 sis_disp;
+	struct display_switch 	 sisfb_sw;
+	struct {
+		u16 red, green, blue, pad;
+	} 		sis_palette[256];
+	union {
+#ifdef FBCON_HAS_CFB16
+		u16 cfb16[16];
+#endif
+#ifdef FBCON_HAS_CFB32
+		u32 cfb32[16];
+#endif
+	} 		sis_fbcon_cmap;
+#endif
+
+        struct sisfb_monitor {
+		u16 hmin;
+		u16 hmax;
+		u16 vmin;
+		u16 vmax;
+		u32 dclockmax;
+		u8  feature;
+		BOOLEAN datavalid;
+	} 		sisfb_thismonitor;
+
+	int           	chip_id;
+	char		myid[40];
+
+	struct pci_dev  *nbridge;
+
+	int		mni;	/* Mode number index */
+
+#if LINUX_VERSION_CODE < KERNEL_VERSION(2,5,0)
+	int  		currcon;
+#endif
+
+	unsigned long	video_size;
+	unsigned long 	video_base;
+	unsigned long	mmio_size;
+	unsigned long 	mmio_base;
+	unsigned long 	vga_base;
+
+	unsigned long  	video_vbase;
+	unsigned long 	mmio_vbase;
+	char  *	      	bios_vbase;
+	char  *	      	bios_abase;
+
+	int 		mtrr;
+
+	u32		sisfb_mem;
+
+	u32 		sisfb_parm_mem;
+	int 	   	sisfb_accel;
+	int 		sisfb_ypan;
+	int 		sisfb_max;
+	int 		sisfb_userom;
+	int 		sisfb_useoem;
+	int		sisfb_mode_idx;
+	int		sisfb_parm_rate;
+	int		sisfb_crt1off;
+	int		sisfb_forcecrt1;
+	int		sisfb_crt2type;
+	int		sisfb_crt2flags;
+	int 		sisfb_dstn;
+	int 		sisfb_fstn;
+	int		sisfb_tvplug;
+	int		sisfb_tvstd;
+	int		sisfb_filter;
+	int		sisfb_nocrt2rate;
+#if LINUX_VERSION_CODE < KERNEL_VERSION(2,5,0)
+	int		sisfb_inverse;
+#endif
+
+	u32 		heapstart;        /* offset  */
+	unsigned long  	sisfb_heap_start; /* address */
+	unsigned long  	sisfb_heap_end;   /* address */
+	u32 	      	sisfb_heap_size;
+	int		havenoheap;
+#if 0
+	SIS_HEAP       	sisfb_heap;
 #endif
 
+
+	int    		video_bpp;
+	int    		video_cmap_len;
+	int    		video_width;
+	int    		video_height;
+	unsigned int 	refresh_rate;
+
+	unsigned int 	chip;
+	u8   		revision_id;
+
+	int    		video_linelength;	/* real pitch */
+	int		scrnpitchCRT1;		/* pitch regarding interlace */
+
+        u16 		DstColor;		/* For 2d acceleration */
+	u32  		SiS310_AccelDepth;
+	u32  		CommandReg;
+	int		cmdqueuelength;
+
+	spinlock_t     	lockaccel;		/* Do not use outside of kernel! */
+
+        unsigned int   	pcibus;
+	unsigned int   	pcislot;
+	unsigned int   	pcifunc;
+
+	int 	       	accel;
+
+	u16 		subsysvendor;
+	u16 		subsysdevice;
+
+	u32  		vbflags;		/* Replacing deprecated stuff from above */
+	u32  		currentvbflags;
+
+	int		lcdxres, lcdyres;
+	int		lcddefmodeidx, tvdefmodeidx, defmodeidx;
+
+	int    		current_bpp;
+	int    		current_width;
+	int    		current_height;
+	int    		current_htotal;
+	int    		current_vtotal;
+	int		current_linelength;
+	__u32  		current_pixclock;
+	int    		current_refresh_rate;
+
+	u8  		mode_no;
+	u8  		rate_idx;
+	int    		modechanged;
+	unsigned char 	modeprechange;
+
+#if LINUX_VERSION_CODE >= KERNEL_VERSION(2,5,0)
+	u8 		sisfb_lastrates[128];
+#endif
+
+	int  		newrom;
+	int  		registered;
+#ifdef SIS_CONFIG_COMPAT
+	int		ioctl32registered;
+	int		ioctl32vblankregistered;
+#endif
+
+	int 		sisvga_engine;
+	int 		hwcursor_size;
+	int 		CRT2_write_enable;
+	u8            	caps;
+
+	u8 		detectedpdc;
+	u8 		detectedpdca;
+	u8 		detectedlcda;
+
+	unsigned long 	hwcursor_vbase;
+
+	int 		chronteltype;
+	int    		tvxpos, tvypos;
+	u8              p2_1f,p2_20,p2_2b,p2_42,p2_43,p2_01,p2_02;
+	int		tvx, tvy;
+
+	u8 		sisfblocked;
+
+	struct sis_video_info *next;
+};
+
+typedef struct _SIS_OH {
+	struct _SIS_OH *poh_next;
+	struct _SIS_OH *poh_prev;
+	u32            offset;
+	u32            size;
+} SIS_OH;
+
+typedef struct _SIS_OHALLOC {
+	struct _SIS_OHALLOC *poha_next;
+	SIS_OH aoh[1];
+} SIS_OHALLOC;
+
+typedef struct _SIS_HEAP {
+	SIS_OH      oh_free;
+	SIS_OH      oh_used;
+	SIS_OH      *poh_freelist;
+	SIS_OHALLOC *poha_chain;
+	u32         max_freesize;
+	struct sis_video_info *vinfo;
+} SIS_HEAP;
+
 #endif
diff --git a/drivers/video/sis/sis_accel.c b/drivers/video/sis/sis_accel.c
index 07e29d71f..30e90a553 100644
--- a/drivers/video/sis/sis_accel.c
+++ b/drivers/video/sis/sis_accel.c
@@ -18,9 +18,7 @@
  * along with this program; if not, write to the Free Software
  * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307, USA
  *
- * Based on the XFree86 driver's sis300_accel.c which is
- *     Copyright (C) 2001-2004 by Thomas Winischhofer, Vienna, Austria
- * and sis310_accel.c which is
+ * Based on the XFree86/X.org driver which is
  *     Copyright (C) 2001-2004 by Thomas Winischhofer, Vienna, Austria
  *
  * Author: Thomas Winischhofer <thomas@winischhofer.net>
@@ -33,36 +31,16 @@
 #include <linux/module.h>
 #include <linux/kernel.h>
 #include <linux/errno.h>
-#include <linux/string.h>
-#include <linux/mm.h>
-#include <linux/tty.h>
-#include <linux/slab.h>
-#include <linux/delay.h>
 #include <linux/fb.h>
 #include <linux/console.h>
 #include <linux/selection.h>
 #include <linux/ioport.h>
-#include <linux/init.h>
-#include <linux/pci.h>
-#include <linux/vt_kern.h>
 #include <linux/capability.h>
 #include <linux/fs.h>
-#include <linux/agp_backend.h>
-
 #include <linux/types.h>
 
-#if LINUX_VERSION_CODE < KERNEL_VERSION(2,5,0)
-#include <linux/sisfb.h>
-#else
-#include <video/sisfb.h>
-#endif
-
 #include <asm/io.h>
 
-#ifdef CONFIG_MTRR
-#include <asm/mtrr.h>
-#endif
-
 #if LINUX_VERSION_CODE < KERNEL_VERSION(2,5,0)
 #include <video/fbcon.h>
 #include <video/fbcon-cfb8.h>
@@ -71,17 +49,10 @@
 #include <video/fbcon-cfb32.h>
 #endif
 
-#include "osdef.h"
-#include "vgatypes.h"
-#include "vstruct.h"
-#include "sis_accel.h"
 #include "sis.h"
+#include "sis_accel.h"
 
-extern struct     video_info ivideo;
-extern VGA_ENGINE sisvga_engine;
-extern int sisfb_accel;
-
-static const int sisALUConv[] =
+static const u8 sisALUConv[] =
 {
     0x00,       /* dest = 0;            0,      GXclear,        0 */
     0x88,       /* dest &= src;         DSa,    GXand,          0x1 */
@@ -101,7 +72,7 @@ static const int sisALUConv[] =
     0xFF,       /* dest = 0xFF;         1,      GXset,          0xF */
 };
 /* same ROP but with Pattern as Source */
-static const int sisPatALUConv[] =
+static const u8 sisPatALUConv[] =
 {
     0x00,       /* dest = 0;            0,      GXclear,        0 */
     0xA0,       /* dest &= src;         DPa,    GXand,          0x1 */
@@ -122,26 +93,26 @@ static const int sisPatALUConv[] =
 };
 
 #if LINUX_VERSION_CODE >= KERNEL_VERSION(2,5,34)
-static const unsigned char myrops[] = {
+static const int myrops[] = {
    	3, 10, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3
-   };
+};
 #endif
 
 /* 300 series ----------------------------------------------------- */
 #ifdef CONFIG_FB_SIS_300
 static void
-SiS300Sync(void)
+SiS300Sync(struct sis_video_info *ivideo)
 {
 	SiS300Idle
 }
 
 static void
-SiS300SetupForScreenToScreenCopy(int xdir, int ydir, int rop,
-                                unsigned int planemask, int trans_color)
+SiS300SetupForScreenToScreenCopy(struct sis_video_info *ivideo, int xdir, int ydir,
+                                 int rop, int trans_color)
 {
-	SiS300SetupDSTColorDepth(ivideo.DstColor);
-	SiS300SetupSRCPitch(ivideo.video_linelength)
-	SiS300SetupDSTRect(ivideo.video_linelength, -1)
+	SiS300SetupDSTColorDepth(ivideo->DstColor);
+	SiS300SetupSRCPitch(ivideo->video_linelength)
+	SiS300SetupDSTRect(ivideo->video_linelength, 0xffff)
 
 	if(trans_color != -1) {
 		SiS300SetupROP(0x0A)
@@ -159,29 +130,28 @@ SiS300SetupForScreenToScreenCopy(int xdir, int ydir, int rop,
 }
 
 static void
-SiS300SubsequentScreenToScreenCopy(int src_x, int src_y, int dst_x, int dst_y,
-                                int width, int height)
+SiS300SubsequentScreenToScreenCopy(struct sis_video_info *ivideo, int src_x,
+				   int src_y, int dst_x, int dst_y, int width, int height)
 {
-	long srcbase, dstbase;
+	u32 srcbase = 0, dstbase = 0;
 
-	srcbase = dstbase = 0;
-	if (src_y >= 2048) {
-		srcbase = ivideo.video_linelength * src_y;
+	if(src_y >= 2048) {
+		srcbase = ivideo->video_linelength * src_y;
 		src_y = 0;
 	}
-	if (dst_y >= 2048) {
-		dstbase = ivideo.video_linelength * dst_y;
+	if(dst_y >= 2048) {
+		dstbase = ivideo->video_linelength * dst_y;
 		dst_y = 0;
 	}
 
 	SiS300SetupSRCBase(srcbase);
 	SiS300SetupDSTBase(dstbase);
 
-	if(!(ivideo.CommandReg & X_INC))  {
+	if(!(ivideo->CommandReg & X_INC))  {
 		src_x += width-1;
 		dst_x += width-1;
 	}
-	if(!(ivideo.CommandReg & Y_INC))  {
+	if(!(ivideo->CommandReg & Y_INC))  {
 		src_y += height-1;
 		dst_y += height-1;
 	}
@@ -192,23 +162,22 @@ SiS300SubsequentScreenToScreenCopy(int src_x, int src_y, int dst_x, int dst_y,
 }
 
 static void
-SiS300SetupForSolidFill(int color, int rop, unsigned int planemask)
+SiS300SetupForSolidFill(struct sis_video_info *ivideo, u32 color, int rop)
 {
 	SiS300SetupPATFG(color)
-	SiS300SetupDSTRect(ivideo.video_linelength, -1)
-	SiS300SetupDSTColorDepth(ivideo.DstColor);
+	SiS300SetupDSTRect(ivideo->video_linelength, 0xffff)
+	SiS300SetupDSTColorDepth(ivideo->DstColor);
 	SiS300SetupROP(sisPatALUConv[rop])
 	SiS300SetupCMDFlag(PATFG)
 }
 
 static void
-SiS300SubsequentSolidFillRect(int x, int y, int w, int h)
+SiS300SubsequentSolidFillRect(struct sis_video_info *ivideo, int x, int y, int w, int h)
 {
-	long dstbase;
+	u32 dstbase = 0;
 
-	dstbase = 0;
 	if(y >= 2048) {
-		dstbase = ivideo.video_linelength * y;
+		dstbase = ivideo->video_linelength * y;
 		y = 0;
 	}
 	SiS300SetupDSTBase(dstbase)
@@ -223,19 +192,18 @@ SiS300SubsequentSolidFillRect(int x, int y, int w, int h)
 
 #ifdef CONFIG_FB_SIS_315
 static void
-SiS310Sync(void)
+SiS310Sync(struct sis_video_info *ivideo)
 {
 	SiS310Idle
 }
 
 static void
-SiS310SetupForScreenToScreenCopy(int xdir, int ydir, int rop,
-                                unsigned int planemask, int trans_color)
+SiS310SetupForScreenToScreenCopy(struct sis_video_info *ivideo, int rop, int trans_color)
 {
-	SiS310SetupDSTColorDepth(ivideo.DstColor);
-	SiS310SetupSRCPitch(ivideo.video_linelength)
-	SiS310SetupDSTRect(ivideo.video_linelength, -1)
-	if (trans_color != -1) {
+	SiS310SetupDSTColorDepth(ivideo->DstColor);
+	SiS310SetupSRCPitch(ivideo->video_linelength)
+	SiS310SetupDSTRect(ivideo->video_linelength, 0xffff)
+	if(trans_color != -1) {
 		SiS310SetupROP(0x0A)
 		SiS310SetupSRCTrans(trans_color)
 		SiS310SetupCMDFlag(TRANSPARENT_BITBLT)
@@ -244,20 +212,17 @@ SiS310SetupForScreenToScreenCopy(int xdir, int ydir, int rop,
 		/* Set command - not needed, both 0 */
 		/* SiSSetupCMDFlag(BITBLT | SRCVIDEO) */
 	}
-	SiS310SetupCMDFlag(ivideo.SiS310_AccelDepth)
+	SiS310SetupCMDFlag(ivideo->SiS310_AccelDepth)
 	/* The 315 series is smart enough to know the direction */
 }
 
 static void
-SiS310SubsequentScreenToScreenCopy(int src_x, int src_y, int dst_x, int dst_y,
-                                int width, int height)
+SiS310SubsequentScreenToScreenCopy(struct sis_video_info *ivideo, int src_x, int src_y,
+			 int dst_x, int dst_y, int width, int height)
 {
-	long srcbase, dstbase;
-	int mymin, mymax;
-
-	srcbase = dstbase = 0;
-	mymin = min(src_y, dst_y);
-	mymax = max(src_y, dst_y);
+	u32 srcbase = 0, dstbase = 0;
+	int mymin = min(src_y, dst_y);
+	int mymax = max(src_y, dst_y);
 	
 	/* Although the chip knows the direction to use
 	 * if the source and destination areas overlap, 
@@ -271,18 +236,18 @@ SiS310SubsequentScreenToScreenCopy(int src_x, int src_y, int dst_x, int dst_y,
 	 */
 	if((mymax - mymin) < height) { 
 	   if((src_y >= 2048) || (dst_y >= 2048)) {	      
-	      srcbase = ivideo.video_linelength * mymin;
-	      dstbase = ivideo.video_linelength * mymin;
+	      srcbase = ivideo->video_linelength * mymin;
+	      dstbase = ivideo->video_linelength * mymin;
 	      src_y -= mymin;
 	      dst_y -= mymin;
 	   }
 	} else {
 	   if(src_y >= 2048) {
-	      srcbase = ivideo.video_linelength * src_y;
+	      srcbase = ivideo->video_linelength * src_y;
 	      src_y = 0;
 	   }
 	   if(dst_y >= 2048) {
-	      dstbase = ivideo.video_linelength * dst_y;
+	      dstbase = ivideo->video_linelength * dst_y;
 	      dst_y = 0;
 	   }
 	}
@@ -296,23 +261,22 @@ SiS310SubsequentScreenToScreenCopy(int src_x, int src_y, int dst_x, int dst_y,
 }
 
 static void
-SiS310SetupForSolidFill(int color, int rop, unsigned int planemask)
+SiS310SetupForSolidFill(struct sis_video_info *ivideo, u32 color, int rop)
 {
 	SiS310SetupPATFG(color)
-	SiS310SetupDSTRect(ivideo.video_linelength, -1)
-	SiS310SetupDSTColorDepth(ivideo.DstColor);
+	SiS310SetupDSTRect(ivideo->video_linelength, 0xffff)
+	SiS310SetupDSTColorDepth(ivideo->DstColor);
 	SiS310SetupROP(sisPatALUConv[rop])
-	SiS310SetupCMDFlag(PATFG | ivideo.SiS310_AccelDepth)
+	SiS310SetupCMDFlag(PATFG | ivideo->SiS310_AccelDepth)
 }
 
 static void
-SiS310SubsequentSolidFillRect(int x, int y, int w, int h)
+SiS310SubsequentSolidFillRect(struct sis_video_info *ivideo, int x, int y, int w, int h)
 {
-	long dstbase;
+	u32 dstbase = 0;
 
-	dstbase = 0;
 	if(y >= 2048) {
-		dstbase = ivideo.video_linelength * y;
+		dstbase = ivideo->video_linelength * y;
 		y = 0;
 	}
 	SiS310SetupDSTBase(dstbase)
@@ -327,23 +291,23 @@ SiS310SubsequentSolidFillRect(int x, int y, int w, int h)
 
 /* The exported routines */
 
-int sisfb_initaccel(void)
+int sisfb_initaccel(struct sis_video_info *ivideo)
 {
 #ifdef SISFB_USE_SPINLOCKS
-    spin_lock_init(&ivideo.lockaccel);
+    spin_lock_init(&ivideo->lockaccel);
 #endif
     return(0);
 }
 
-void sisfb_syncaccel(void)
+void sisfb_syncaccel(struct sis_video_info *ivideo)
 {
-    if(sisvga_engine == SIS_300_VGA) {
+    if(ivideo->sisvga_engine == SIS_300_VGA) {
 #ifdef CONFIG_FB_SIS_300
-    	SiS300Sync();
+    	SiS300Sync(ivideo);
 #endif
     } else {
 #ifdef CONFIG_FB_SIS_315
-    	SiS310Sync();
+    	SiS310Sync(ivideo);
 #endif
     }
 }
@@ -352,18 +316,19 @@ void sisfb_syncaccel(void)
 
 int fbcon_sis_sync(struct fb_info *info)
 {
+   struct sis_video_info *ivideo = (struct sis_video_info *)info->par;
    CRITFLAGS
 
-   if(!ivideo.accel)
+   if(!ivideo->accel)
    	return 0;
 
-   if(sisvga_engine == SIS_300_VGA) {
+   if(ivideo->sisvga_engine == SIS_300_VGA) {
 #ifdef CONFIG_FB_SIS_300
-      SiS300Sync();
+      SiS300Sync(ivideo);
 #endif
    } else {
 #ifdef CONFIG_FB_SIS_315
-      SiS310Sync();
+      SiS310Sync(ivideo);
 #endif
    }
    CRITEND
@@ -372,42 +337,53 @@ int fbcon_sis_sync(struct fb_info *info)
 
 void fbcon_sis_fillrect(struct fb_info *info, const struct fb_fillrect *rect)
 {
-   int col=0;
+   struct sis_video_info *ivideo = (struct sis_video_info *)info->par;
+   u32 col = 0;
+   u32 vxres = info->var.xres_virtual;
+   u32 vyres = info->var.yres_virtual;
+   int width, height;
    CRITFLAGS
 
-   TWDEBUG("Inside sis_fillrect");
-   if(!rect->width || !rect->height)
-   	return;
+   if(info->state != FBINFO_STATE_RUNNING) {
+	return;
+   }
 
-   if(!ivideo.accel) {
+   if(!ivideo->accel) {
 	cfb_fillrect(info, rect);
 	return;
    }
    
+   if(!rect->width || !rect->height || rect->dx >= vxres || rect->dy >= vyres) {
+	return;
+   }
+
+   /* Clipping */
+   width = ((rect->dx + rect->width) > vxres) ? (vxres - rect->dx) : rect->width;
+   height = ((rect->dy + rect->height) > vyres) ? (vyres - rect->dy) : rect->height;
+
    switch(info->var.bits_per_pixel) {
 	case 8:  col = rect->color;
 		 break;
-	case 16: col = ((u32 *)(info->pseudo_palette))[rect->color];
-		 break;
+	case 16:
 	case 32: col = ((u32 *)(info->pseudo_palette))[rect->color];
 		 break;
    }
 
-   if(sisvga_engine == SIS_300_VGA) {
+   if(ivideo->sisvga_engine == SIS_300_VGA) {
 #ifdef CONFIG_FB_SIS_300
       CRITBEGIN
-      SiS300SetupForSolidFill(col, myrops[rect->rop], 0);
-      SiS300SubsequentSolidFillRect(rect->dx, rect->dy, rect->width, rect->height);
+      SiS300SetupForSolidFill(ivideo, col, myrops[rect->rop]);
+      SiS300SubsequentSolidFillRect(ivideo, rect->dx, rect->dy, width, height);
       CRITEND
-      SiS300Sync();
+      SiS300Sync(ivideo);
 #endif
    } else {
 #ifdef CONFIG_FB_SIS_315
       CRITBEGIN
-      SiS310SetupForSolidFill(col, myrops[rect->rop], 0);
-      SiS310SubsequentSolidFillRect(rect->dx, rect->dy, rect->width, rect->height);
+      SiS310SetupForSolidFill(ivideo, col, myrops[rect->rop]);
+      SiS310SubsequentSolidFillRect(ivideo, rect->dx, rect->dy, width, height);
       CRITEND
-      SiS310Sync();
+      SiS310Sync(ivideo);
 #endif
    }
 
@@ -415,38 +391,58 @@ void fbcon_sis_fillrect(struct fb_info *info, const struct fb_fillrect *rect)
 
 void fbcon_sis_copyarea(struct fb_info *info, const struct fb_copyarea *area)
 {
-   int xdir, ydir;
+   struct sis_video_info *ivideo = (struct sis_video_info *)info->par;
+   u32 vxres = info->var.xres_virtual;
+   u32 vyres = info->var.yres_virtual;
+   int width = area->width;
+   int height = area->height;
    CRITFLAGS
 
-   TWDEBUG("Inside sis_copyarea");
-   if(!ivideo.accel) {
+   if(info->state != FBINFO_STATE_RUNNING) {
+	return;
+   }
+
+   if(!ivideo->accel) {
    	cfb_copyarea(info, area);
 	return;
    }
 
-   if(!area->width || !area->height)
+   if(!width || !height ||
+      area->sx >= vxres || area->sy >= vyres ||
+      area->dx >= vxres || area->dy >= vyres) {
    	return;
+   }
 
-   if(area->sx < area->dx) xdir = 0;
-   else                    xdir = 1;
-   if(area->sy < area->dy) ydir = 0;
-   else                    ydir = 1;
+   /* Clipping */
+   if((area->sx + width) > vxres) width = vxres - area->sx;
+   if((area->dx + width) > vxres) width = vxres - area->dx;
+   if((area->sy + height) > vyres) height = vyres - area->sy;
+   if((area->dy + height) > vyres) height = vyres - area->dy;
 
-   if(sisvga_engine == SIS_300_VGA) {
+   if(ivideo->sisvga_engine == SIS_300_VGA) {
 #ifdef CONFIG_FB_SIS_300
+      int xdir, ydir;
+
+      if(area->sx < area->dx) xdir = 0;
+      else                    xdir = 1;
+      if(area->sy < area->dy) ydir = 0;
+      else                    ydir = 1;
+
       CRITBEGIN
-      SiS300SetupForScreenToScreenCopy(xdir, ydir, 3, 0, -1);
-      SiS300SubsequentScreenToScreenCopy(area->sx, area->sy, area->dx, area->dy, area->width, area->height);
+      SiS300SetupForScreenToScreenCopy(ivideo, xdir, ydir, 3, -1);
+      SiS300SubsequentScreenToScreenCopy(ivideo, area->sx, area->sy, area->dx, area->dy,
+      					 width, height);
       CRITEND
-      SiS300Sync();
+      SiS300Sync(ivideo);
 #endif
    } else {
 #ifdef CONFIG_FB_SIS_315
       CRITBEGIN
-      SiS310SetupForScreenToScreenCopy(xdir, ydir, 3, 0, -1);
-      SiS310SubsequentScreenToScreenCopy(area->sx, area->sy, area->dx, area->dy, area->width, area->height);
+      SiS310SetupForScreenToScreenCopy(ivideo, 3, -1);
+      SiS310SubsequentScreenToScreenCopy(ivideo, area->sx, area->sy, area->dx, area->dy,
+      					 width, height);
       CRITEND
-      SiS310Sync();
+      SiS310Sync(ivideo);
 #endif
    }
 }
@@ -458,11 +454,12 @@ void fbcon_sis_copyarea(struct fb_info *info, const struct fb_copyarea *area)
 void fbcon_sis_bmove(struct display *p, int srcy, int srcx,
 			    int dsty, int dstx, int height, int width)
 {
-        int xdir, ydir;
+	struct sis_video_info *ivideo = (struct sis_video_info *)p->fb_info->par;
+
 	CRITFLAGS
 
-	if(!ivideo.accel) {
-	    switch(ivideo.video_bpp) {
+	if(!ivideo->accel) {
+	    switch(ivideo->video_bpp) {
 	    case 8:
 #ifdef FBCON_HAS_CFB8
 	       fbcon_cfb8_bmove(p, srcy, srcx, dsty, dstx, height, width);
@@ -489,30 +486,28 @@ void fbcon_sis_bmove(struct display *p, int srcy, int srcx,
 	width *= fontwidth(p);
 	height *= fontheight(p);
 
-	if(srcx < dstx) xdir = 0;
-	else            xdir = 1;
-	if(srcy < dsty) ydir = 0;
-	else            ydir = 1;
-
-	if(sisvga_engine == SIS_300_VGA) {
+	if(ivideo->sisvga_engine == SIS_300_VGA) {
 #ifdef CONFIG_FB_SIS_300
+	   int xdir, ydir;
+
+	   if(srcx < dstx) xdir = 0;
+	   else            xdir = 1;
+	   if(srcy < dsty) ydir = 0;
+	   else            ydir = 1;
+
 	   CRITBEGIN
-	   SiS300SetupForScreenToScreenCopy(xdir, ydir, 3, 0, -1);
-	   SiS300SubsequentScreenToScreenCopy(srcx, srcy, dstx, dsty, width, height);
+	   SiS300SetupForScreenToScreenCopy(ivideo, xdir, ydir, 3, -1);
+	   SiS300SubsequentScreenToScreenCopy(ivideo, srcx, srcy, dstx, dsty, width, height);
 	   CRITEND
-	   SiS300Sync();
+	   SiS300Sync(ivideo);
 #endif
 	} else {
 #ifdef CONFIG_FB_SIS_315
 	   CRITBEGIN
-	   SiS310SetupForScreenToScreenCopy(xdir, ydir, 3, 0, -1);
-	   SiS310SubsequentScreenToScreenCopy(srcx, srcy, dstx, dsty, width, height);
+	   SiS310SetupForScreenToScreenCopy(ivideo, 3, -1);
+	   SiS310SubsequentScreenToScreenCopy(ivideo, srcx, srcy, dstx, dsty, width, height);
 	   CRITEND
-	   SiS310Sync();
-#if 0
-	   printk(KERN_INFO "sis_bmove sx %d sy %d dx %d dy %d w %d h %d\n",
-		srcx, srcy, dstx, dsty, width, height);
-#endif
+	   SiS310Sync(ivideo);
 #endif
 	}
 }
@@ -520,6 +515,7 @@ void fbcon_sis_bmove(struct display *p, int srcy, int srcx,
 static void fbcon_sis_clear(struct vc_data *conp, struct display *p,
 			int srcy, int srcx, int height, int width, int color)
 {
+        struct sis_video_info *ivideo = (struct sis_video_info *)p->fb_info->par;
 	CRITFLAGS
 
 	srcx *= fontwidth(p);
@@ -527,21 +523,21 @@ static void fbcon_sis_clear(struct vc_data *conp, struct display *p,
 	width *= fontwidth(p);
 	height *= fontheight(p);
 
-	if(sisvga_engine == SIS_300_VGA) {
+	if(ivideo->sisvga_engine == SIS_300_VGA) {
 #ifdef CONFIG_FB_SIS_300
 	   CRITBEGIN
-	   SiS300SetupForSolidFill(color, 3, 0);
-	   SiS300SubsequentSolidFillRect(srcx, srcy, width, height);
+	   SiS300SetupForSolidFill(ivideo, color, 3);
+	   SiS300SubsequentSolidFillRect(ivideo, srcx, srcy, width, height);
 	   CRITEND
-	   SiS300Sync();
+	   SiS300Sync(ivideo);
 #endif
 	} else {
 #ifdef CONFIG_FB_SIS_315
 	   CRITBEGIN
-	   SiS310SetupForSolidFill(color, 3, 0);
-	   SiS310SubsequentSolidFillRect(srcx, srcy, width, height);
+	   SiS310SetupForSolidFill(ivideo, color, 3);
+	   SiS310SubsequentSolidFillRect(ivideo, srcx, srcy, width, height);
 	   CRITEND
-	   SiS310Sync();
+	   SiS310Sync(ivideo);
 #endif
 	}
 }
@@ -549,9 +545,10 @@ static void fbcon_sis_clear(struct vc_data *conp, struct display *p,
 void fbcon_sis_clear8(struct vc_data *conp, struct display *p,
 			int srcy, int srcx, int height, int width)
 {
+	struct sis_video_info *ivideo = (struct sis_video_info *)p->fb_info->par;
 	u32 bgx;
 
-	if(!ivideo.accel) {
+	if(!ivideo->accel) {
 #ifdef FBCON_HAS_CFB8
 	    fbcon_cfb8_clear(conp, p, srcy, srcx, height, width);
 #endif
@@ -565,8 +562,10 @@ void fbcon_sis_clear8(struct vc_data *conp, struct display *p,
 void fbcon_sis_clear16(struct vc_data *conp, struct display *p,
 			int srcy, int srcx, int height, int width)
 {
+        struct sis_video_info *ivideo = (struct sis_video_info *)p->fb_info->par;
 	u32 bgx;
-	if(!ivideo.accel) {
+
+	if(!ivideo->accel) {
 #ifdef FBCON_HAS_CFB16
 	    fbcon_cfb16_clear(conp, p, srcy, srcx, height, width);
 #endif
@@ -580,9 +579,10 @@ void fbcon_sis_clear16(struct vc_data *conp, struct display *p,
 void fbcon_sis_clear32(struct vc_data *conp, struct display *p,
 			int srcy, int srcx, int height, int width)
 {
+	struct sis_video_info *ivideo = (struct sis_video_info *)p->fb_info->par;
 	u32 bgx;
 
-	if(!ivideo.accel) {
+	if(!ivideo->accel) {
 #ifdef FBCON_HAS_CFB32
 	    fbcon_cfb32_clear(conp, p, srcy, srcx, height, width);
 #endif
@@ -595,10 +595,11 @@ void fbcon_sis_clear32(struct vc_data *conp, struct display *p,
 
 void fbcon_sis_revc(struct display *p, int srcx, int srcy)
 {
+	struct sis_video_info *ivideo = (struct sis_video_info *)p->fb_info->par;
 	CRITFLAGS
 
-	if(!ivideo.accel) {
-	    switch(ivideo.video_bpp) {
+	if(!ivideo->accel) {
+	    switch(ivideo->video_bpp) {
 	    case 16:
 #ifdef FBCON_HAS_CFB16
 	       fbcon_cfb16_revc(p, srcx, srcy);
@@ -616,59 +617,59 @@ void fbcon_sis_revc(struct display *p, int srcx, int srcy)
 	srcx *= fontwidth(p);
 	srcy *= fontheight(p);
 
-	if(sisvga_engine == SIS_300_VGA) {
+	if(ivideo->sisvga_engine == SIS_300_VGA) {
 #ifdef CONFIG_FB_SIS_300
 	   CRITBEGIN
-	   SiS300SetupForSolidFill(0, 0x0a, 0);
-	   SiS300SubsequentSolidFillRect(srcx, srcy, fontwidth(p), fontheight(p));
+	   SiS300SetupForSolidFill(ivideo, 0, 0x0a);
+	   SiS300SubsequentSolidFillRect(ivideo, srcx, srcy, fontwidth(p), fontheight(p));
 	   CRITEND
-	   SiS300Sync();
+	   SiS300Sync(ivideo);
 #endif
 	} else {
 #ifdef CONFIG_FB_SIS_315
 	   CRITBEGIN
-	   SiS310SetupForSolidFill(0, 0x0a, 0);
-	   SiS310SubsequentSolidFillRect(srcx, srcy, fontwidth(p), fontheight(p));
+	   SiS310SetupForSolidFill(ivideo, 0, 0x0a);
+	   SiS310SubsequentSolidFillRect(ivideo, srcx, srcy, fontwidth(p), fontheight(p));
 	   CRITEND
-	   SiS310Sync();
+	   SiS310Sync(ivideo);
 #endif
 	}
 }
 
 #ifdef FBCON_HAS_CFB8
 struct display_switch fbcon_sis8 = {
-	.setup			= fbcon_cfb8_setup,
-	.bmove			= fbcon_sis_bmove,
-	.clear			= fbcon_sis_clear8,
-	.putc			= fbcon_cfb8_putc,
-	.putcs			= fbcon_cfb8_putcs,
-	.revc			= fbcon_cfb8_revc,
-	.clear_margins		= fbcon_cfb8_clear_margins,
-	.fontwidthmask		= FONTWIDTH(4)|FONTWIDTH(8)|FONTWIDTH(12)|FONTWIDTH(16)
+	.setup		= fbcon_cfb8_setup,
+	.bmove		= fbcon_sis_bmove,
+	.clear		= fbcon_sis_clear8,
+	.putc		= fbcon_cfb8_putc,
+	.putcs		= fbcon_cfb8_putcs,
+	.revc		= fbcon_cfb8_revc,
+	.clear_margins	= fbcon_cfb8_clear_margins,
+	.fontwidthmask	= FONTWIDTH(4)|FONTWIDTH(8)|FONTWIDTH(12)|FONTWIDTH(16)
 };
 #endif
 #ifdef FBCON_HAS_CFB16
 struct display_switch fbcon_sis16 = {
-	.setup			= fbcon_cfb16_setup,
-	.bmove			= fbcon_sis_bmove,
-	.clear			= fbcon_sis_clear16,
-	.putc			= fbcon_cfb16_putc,
-	.putcs			= fbcon_cfb16_putcs,
-	.revc			= fbcon_sis_revc,
-	.clear_margins		= fbcon_cfb16_clear_margins,
-	.fontwidthmask		= FONTWIDTH(4)|FONTWIDTH(8)|FONTWIDTH(12)|FONTWIDTH(16)
+	.setup		= fbcon_cfb16_setup,
+	.bmove		= fbcon_sis_bmove,
+	.clear		= fbcon_sis_clear16,
+	.putc		= fbcon_cfb16_putc,
+	.putcs		= fbcon_cfb16_putcs,
+	.revc		= fbcon_sis_revc,
+	.clear_margins	= fbcon_cfb16_clear_margins,
+	.fontwidthmask	= FONTWIDTH(4)|FONTWIDTH(8)|FONTWIDTH(12)|FONTWIDTH(16)
 };
 #endif
 #ifdef FBCON_HAS_CFB32
 struct display_switch fbcon_sis32 = {
-	.setup			= fbcon_cfb32_setup,
-	.bmove			= fbcon_sis_bmove,
-	.clear			= fbcon_sis_clear32,
-	.putc			= fbcon_cfb32_putc,
-	.putcs			= fbcon_cfb32_putcs,
-	.revc			= fbcon_sis_revc,
-	.clear_margins		= fbcon_cfb32_clear_margins,
-	.fontwidthmask		= FONTWIDTH(4)|FONTWIDTH(8)|FONTWIDTH(12)|FONTWIDTH(16)
+	.setup		= fbcon_cfb32_setup,
+	.bmove		= fbcon_sis_bmove,
+	.clear		= fbcon_sis_clear32,
+	.putc		= fbcon_cfb32_putc,
+	.putcs		= fbcon_cfb32_putcs,
+	.revc		= fbcon_sis_revc,
+	.clear_margins	= fbcon_cfb32_clear_margins,
+	.fontwidthmask	= FONTWIDTH(4)|FONTWIDTH(8)|FONTWIDTH(12)|FONTWIDTH(16)
 };
 #endif
 
diff --git a/drivers/video/sis/sis_accel.h b/drivers/video/sis/sis_accel.h
index f9229689c..bb28f331d 100644
--- a/drivers/video/sis/sis_accel.h
+++ b/drivers/video/sis/sis_accel.h
@@ -36,8 +36,8 @@
 
 #ifdef SISFB_USE_SPINLOCKS
 #include <linux/spinlock.h>
-#define CRITBEGIN  spin_lock_irqsave(&ivideo.lockaccel), critflags);
-#define CRITEND	   spin_unlock_irqrestore(&ivideo.lockaccel), critflags);
+#define CRITBEGIN  spin_lock_irqsave(&ivideo->lockaccel, critflags);
+#define CRITEND	   spin_unlock_irqrestore(&ivideo->lockaccel, critflags);
 #define CRITFLAGS  unsigned long critflags;
 #else
 #define CRITBEGIN
@@ -65,7 +65,6 @@
 #define A3D_FUNCTION		0x00000008  /* 3D command ? */
 #define	CLEAR_Z_BUFFER		0x00000009  /* ? */
 #define GRADIENT_FILL		0x0000000A  /* Gradient fill */
-#define STRETCH_BITBLT		0x0000000B  /* Stretched Blit */
 
 /* source select */
 #define SRCVIDEO                0x00000000  /* source is video RAM */
@@ -98,11 +97,6 @@
 #define DSTAGP                  0x02000000
 #define DSTVIDEO                0x02000000
 
-/* Line */
-#define LINE_STYLE              0x00800000
-#define NO_RESET_COUNTER        0x00400000
-#define NO_LAST_PIXEL           0x00200000
-
 /* Subfunctions for Color/Enhanced Color Expansion (315 only) */
 #define COLOR_TO_MONO		0x00100000
 #define AA_TEXT			0x00200000
@@ -134,212 +128,142 @@
 
 #define PATTERN_REG		0x8300  /* 384 bytes pattern buffer */
 
-/* Line registers */
-#define LINE_X0			SRC_Y
-#define LINE_X1			DST_Y
-#define LINE_Y0			SRC_X
-#define LINE_Y1			DST_X
-#define LINE_COUNT		RECT_WIDTH
-#define LINE_STYLE_PERIOD	RECT_HEIGHT
-#define LINE_STYLE_0		MONO_MASK
-#define LINE_STYLE_1		0x8230
-#define LINE_XN			PATTERN_REG
-#define LINE_YN			PATTERN_REG+2
-
 /* Transparent bitblit registers */
 #define TRANS_DST_KEY_HIGH	PAT_FGCOLOR
 #define TRANS_DST_KEY_LOW	PAT_BGCOLOR
 #define TRANS_SRC_KEY_HIGH	SRC_FGCOLOR
 #define TRANS_SRC_KEY_LOW	SRC_BGCOLOR
 
-/* Queue */
-#define Q_BASE_ADDR		0x85C0  /* Base address of software queue (?) */
-#define Q_WRITE_PTR		0x85C4  /* Current write pointer (?) */
-#define Q_READ_PTR		0x85C8  /* Current read pointer (?) */
-#define Q_STATUS		0x85CC  /* queue status */
-
-
-#define MMIO_IN8(base, offset) \
-	*(volatile u8 *)(((u8*)(base)) + (offset))
-#define MMIO_IN16(base, offset) \
-	*(volatile u16 *)(void *)(((u8*)(base)) + (offset))
-#define MMIO_IN32(base, offset) \
-	*(volatile u32 *)(void *)(((u8*)(base)) + (offset))
-#define MMIO_OUT8(base, offset, val) \
-	*(volatile u8 *)(((u8*)(base)) + (offset)) = (val)
-#define MMIO_OUT16(base, offset, val) \
-	*(volatile u16 *)(void *)(((u8*)(base)) + (offset)) = (val)
-#define MMIO_OUT32(base, offset, val) \
-	*(volatile u32 *)(void *)(((u8*)(base)) + (offset)) = (val)
+/* Store queue length in par */
+#define CmdQueLen ivideo->cmdqueuelength
 
 /* ------------- SiS 300 series -------------- */
 
-/* Macros to do useful things with the SIS BitBLT engine */
-
-/* BR(16) (0x8420):
+/* BR(16) (0x8240):
 
    bit 31 2D engine: 1 is idle,
    bit 30 3D engine: 1 is idle,
    bit 29 Command queue: 1 is empty
-
    bits 28:24: Current CPU driven BitBlt buffer stage bit[4:0]
-
    bits 15:0:  Current command queue length
 
 */
 
-/* TW: BR(16)+2 = 0x8242 */
-
-int     CmdQueLen;
-
 #define SiS300Idle \
   { \
-  while( (MMIO_IN16(ivideo.mmio_vbase, BR(16)+2) & 0xE000) != 0xE000){}; \
-  while( (MMIO_IN16(ivideo.mmio_vbase, BR(16)+2) & 0xE000) != 0xE000){}; \
-  while( (MMIO_IN16(ivideo.mmio_vbase, BR(16)+2) & 0xE000) != 0xE000){}; \
-  CmdQueLen=MMIO_IN16(ivideo.mmio_vbase, 0x8240); \
+  	while((MMIO_IN16(ivideo->mmio_vbase, BR(16)+2) & 0xE000) != 0xE000){}; \
+  	while((MMIO_IN16(ivideo->mmio_vbase, BR(16)+2) & 0xE000) != 0xE000){}; \
+  	while((MMIO_IN16(ivideo->mmio_vbase, BR(16)+2) & 0xE000) != 0xE000){}; \
+  	CmdQueLen = MMIO_IN16(ivideo->mmio_vbase, 0x8240); \
   }
-/* TW: (do three times, because 2D engine seems quite unsure about whether or not it's idle) */
+/* (do three times, because 2D engine seems quite unsure about whether or not it's idle) */
 
 #define SiS300SetupSRCBase(base) \
-                if (CmdQueLen <= 0)  SiS300Idle;\
-                MMIO_OUT32(ivideo.mmio_vbase, BR(0), base);\
-                CmdQueLen --;
+	if(CmdQueLen <= 0) SiS300Idle;\
+	MMIO_OUT32(ivideo->mmio_vbase, BR(0), base);\
+	CmdQueLen--;
 
 #define SiS300SetupSRCPitch(pitch) \
-                if (CmdQueLen <= 0)  SiS300Idle;\
-                MMIO_OUT16(ivideo.mmio_vbase, BR(1), pitch);\
-                CmdQueLen --;
+	if(CmdQueLen <= 0) SiS300Idle;\
+	MMIO_OUT16(ivideo->mmio_vbase, BR(1), pitch);\
+	CmdQueLen--;
 
 #define SiS300SetupSRCXY(x,y) \
-                if (CmdQueLen <= 0)  SiS300Idle;\
-                MMIO_OUT32(ivideo.mmio_vbase, BR(2), (x)<<16 | (y) );\
-                CmdQueLen --;
+	if(CmdQueLen <= 0) SiS300Idle;\
+	MMIO_OUT32(ivideo->mmio_vbase, BR(2), (x)<<16 | (y) );\
+	CmdQueLen--;
 
 #define SiS300SetupDSTBase(base) \
-                if (CmdQueLen <= 0)  SiS300Idle;\
-                MMIO_OUT32(ivideo.mmio_vbase, BR(4), base);\
-                CmdQueLen --;
+	if(CmdQueLen <= 0) SiS300Idle;\
+	MMIO_OUT32(ivideo->mmio_vbase, BR(4), base);\
+	CmdQueLen--;
 
 #define SiS300SetupDSTXY(x,y) \
-                if (CmdQueLen <= 0)  SiS300Idle;\
-                MMIO_OUT32(ivideo.mmio_vbase, BR(3), (x)<<16 | (y) );\
-                CmdQueLen --;
+	if(CmdQueLen <= 0) SiS300Idle;\
+	MMIO_OUT32(ivideo->mmio_vbase, BR(3), (x)<<16 | (y) );\
+	CmdQueLen--;
 
 #define SiS300SetupDSTRect(x,y) \
-                if (CmdQueLen <= 0)  SiS300Idle;\
-                MMIO_OUT32(ivideo.mmio_vbase, BR(5), (y)<<16 | (x) );\
-                CmdQueLen --;
+	if(CmdQueLen <= 0) SiS300Idle;\
+	MMIO_OUT32(ivideo->mmio_vbase, BR(5), (y)<<16 | (x) );\
+	CmdQueLen--;
 
 #define SiS300SetupDSTColorDepth(bpp) \
-                if (CmdQueLen <= 0)  SiS300Idle;\
-                MMIO_OUT16(ivideo.mmio_vbase, BR(1)+2, bpp);\
-                CmdQueLen --;
+	if(CmdQueLen <= 0) SiS300Idle;\
+	MMIO_OUT16(ivideo->mmio_vbase, BR(1)+2, bpp);\
+	CmdQueLen--;
 
 #define SiS300SetupRect(w,h) \
-                if (CmdQueLen <= 0)  SiS300Idle;\
-                MMIO_OUT32(ivideo.mmio_vbase, BR(6), (h)<<16 | (w) );\
-                CmdQueLen --;
+	if(CmdQueLen <= 0) SiS300Idle;\
+	MMIO_OUT32(ivideo->mmio_vbase, BR(6), (h)<<16 | (w) );\
+	CmdQueLen--;
 
 #define SiS300SetupPATFG(color) \
-                if (CmdQueLen <= 0)  SiS300Idle;\
-                MMIO_OUT32(ivideo.mmio_vbase, BR(7), color);\
-                CmdQueLen --;
+	if(CmdQueLen <= 0) SiS300Idle;\
+	MMIO_OUT32(ivideo->mmio_vbase, BR(7), color);\
+	CmdQueLen--;
 
 #define SiS300SetupPATBG(color) \
-                if (CmdQueLen <= 0)  SiS300Idle;\
-                MMIO_OUT32(ivideo.mmio_vbase, BR(8), color);\
-                CmdQueLen --;
+	if(CmdQueLen <= 0) SiS300Idle;\
+	MMIO_OUT32(ivideo->mmio_vbase, BR(8), color);\
+	CmdQueLen--;
 
 #define SiS300SetupSRCFG(color) \
-                if (CmdQueLen <= 0)  SiS300Idle;\
-                MMIO_OUT32(ivideo.mmio_vbase, BR(9), color);\
-                CmdQueLen --;
+	if(CmdQueLen <= 0) SiS300Idle;\
+	MMIO_OUT32(ivideo->mmio_vbase, BR(9), color);\
+	CmdQueLen--;
 
 #define SiS300SetupSRCBG(color) \
-                if (CmdQueLen <= 0)  SiS300Idle;\
-                MMIO_OUT32(ivideo.mmio_vbase, BR(10), color);\
-                CmdQueLen --;
+	if(CmdQueLen <= 0) SiS300Idle;\
+	MMIO_OUT32(ivideo->mmio_vbase, BR(10), color);\
+	CmdQueLen--;
 
 /* 0x8224 src colorkey high */
 /* 0x8228 src colorkey low */
 /* 0x821c dest colorkey high */
 /* 0x8220 dest colorkey low */
 #define SiS300SetupSRCTrans(color) \
-                if (CmdQueLen <= 1)  SiS300Idle;\
-                MMIO_OUT32(ivideo.mmio_vbase, 0x8224, color);\
-		MMIO_OUT32(ivideo.mmio_vbase, 0x8228, color);\
-		CmdQueLen -= 2;
+	if(CmdQueLen <= 1) SiS300Idle;\
+	MMIO_OUT32(ivideo->mmio_vbase, 0x8224, color);\
+	MMIO_OUT32(ivideo->mmio_vbase, 0x8228, color);\
+	CmdQueLen -= 2;
 
 #define SiS300SetupDSTTrans(color) \
-		if (CmdQueLen <= 1)  SiS300Idle;\
-		MMIO_OUT32(ivideo.mmio_vbase, 0x821C, color); \
-		MMIO_OUT32(ivideo.mmio_vbase, 0x8220, color); \
-                CmdQueLen -= 2;
+	if(CmdQueLen <= 1) SiS300Idle;\
+	MMIO_OUT32(ivideo->mmio_vbase, 0x821C, color); \
+	MMIO_OUT32(ivideo->mmio_vbase, 0x8220, color); \
+	CmdQueLen -= 2;
 
 #define SiS300SetupMONOPAT(p0,p1) \
-                if (CmdQueLen <= 1)  SiS300Idle;\
-                MMIO_OUT32(ivideo.mmio_vbase, BR(11), p0);\
-                MMIO_OUT32(ivideo.mmio_vbase, BR(12), p1);\
-                CmdQueLen -= 2;
+	if(CmdQueLen <= 1) SiS300Idle;\
+	MMIO_OUT32(ivideo->mmio_vbase, BR(11), p0);\
+	MMIO_OUT32(ivideo->mmio_vbase, BR(12), p1);\
+	CmdQueLen -= 2;
 
 #define SiS300SetupClipLT(left,top) \
-                if (CmdQueLen <= 0)  SiS300Idle;\
-                MMIO_OUT32(ivideo.mmio_vbase, BR(13), ((left) & 0xFFFF) | (top)<<16 );\
-                CmdQueLen--;
+	if(CmdQueLen <= 0) SiS300Idle;\
+	MMIO_OUT32(ivideo->mmio_vbase, BR(13), ((left) & 0xFFFF) | (top)<<16 );\
+	CmdQueLen--;
 
 #define SiS300SetupClipRB(right,bottom) \
-                if (CmdQueLen <= 0)  SiS300Idle;\
-                MMIO_OUT32(ivideo.mmio_vbase, BR(14), ((right) & 0xFFFF) | (bottom)<<16 );\
-                CmdQueLen--;
+	if(CmdQueLen <= 0) SiS300Idle;\
+	MMIO_OUT32(ivideo->mmio_vbase, BR(14), ((right) & 0xFFFF) | (bottom)<<16 );\
+	CmdQueLen--;
 
 /* General */
 #define SiS300SetupROP(rop) \
-                ivideo.CommandReg = (rop) << 8;
+	ivideo->CommandReg = (rop) << 8;
 
 #define SiS300SetupCMDFlag(flags) \
-                ivideo.CommandReg |= (flags);
+	ivideo->CommandReg |= (flags);
 
 #define SiS300DoCMD \
-                if (CmdQueLen <= 1)  SiS300Idle;\
-                MMIO_OUT32(ivideo.mmio_vbase, BR(15), ivideo.CommandReg); \
-                MMIO_OUT32(ivideo.mmio_vbase, BR(16), 0);\
-                CmdQueLen -= 2;
-
-/* Line */
-#define SiS300SetupX0Y0(x,y) \
-                if (CmdQueLen <= 0)  SiS300Idle;\
-                MMIO_OUT32(ivideo.mmio_vbase, BR(2), (y)<<16 | (x) );\
-                CmdQueLen--;
-
-#define SiS300SetupX1Y1(x,y) \
-                if (CmdQueLen <= 0)  SiS300Idle;\
-                MMIO_OUT32(ivideo.mmio_vbase, BR(3), (y)<<16 | (x) );\
-                CmdQueLen--;
-
-#define SiS300SetupLineCount(c) \
-                if (CmdQueLen <= 0)  SiS300Idle;\
-                MMIO_OUT16(ivideo.mmio_vbase, BR(6), c);\
-                CmdQueLen--;
+	if(CmdQueLen <= 1) SiS300Idle;\
+	MMIO_OUT32(ivideo->mmio_vbase, BR(15), ivideo->CommandReg); \
+	MMIO_OUT32(ivideo->mmio_vbase, BR(16), 0);\
+	CmdQueLen -= 2;
 
-#define SiS300SetupStylePeriod(p) \
-                if (CmdQueLen <= 0)  SiS300Idle;\
-                MMIO_OUT16(ivideo.mmio_vbase, BR(6)+2, p);\
-                CmdQueLen--;
-
-#define SiS300SetupStyleLow(ls) \
-                if (CmdQueLen <= 0)  SiS300Idle;\
-                MMIO_OUT32(ivideo.mmio_vbase, BR(11), ls);\
-                CmdQueLen--;
-
-#define SiS300SetupStyleHigh(ls) \
-                if (CmdQueLen <= 0)  SiS300Idle;\
-                MMIO_OUT32(ivideo.mmio_vbase, BR(12), ls);\
-                CmdQueLen--;
-
-
-
-/* -------------- SiS 315 series --------------- */
+/* -------------- SiS 315/330 series --------------- */
 
 /* Q_STATUS:
    bit 31 = 1: All engines idle and all queues empty
@@ -353,179 +277,131 @@ int     CmdQueLen;
    bits 23:16: 2D counter 3
    bits 15:8:  2D counter 2
    bits 7:0:   2D counter 1
-
-   Where is the command queue length (current amount of commands the queue
-   can accept) on the 315 series?
 */
 
-/* TW: FIXME: CmdQueLen is... where....? */
-/* We assume a length of 4 bytes per command; since 512K of
- * of RAM are allocated, the number of commands is easily
- * calculated (assuming that there is no 3D support yet)
- * We calculate it very cautiously (128K only) and let the
- * rest to the (never?)-to-come (?) 3D engine. (The 3D engine
- * can use a similar technique, using the remaining 384K,
- * hence a queue overflow is avoided)
- * UPDATE: This technique causes a terrible system latency
- * on integrated chipsets. Disable the queue handling for
- * now.
- */
 #define SiS310Idle \
   { \
-  while( (MMIO_IN16(ivideo.mmio_vbase, Q_STATUS+2) & 0x8000) != 0x8000){}; \
-  while( (MMIO_IN16(ivideo.mmio_vbase, Q_STATUS+2) & 0x8000) != 0x8000){}; \
-  CmdQueLen = 0; \
-  /*CmdQueLen = ((128 * 1024) / 4) - 64; */ \
+  	while( (MMIO_IN16(ivideo->mmio_vbase, Q_STATUS+2) & 0x8000) != 0x8000){}; \
+  	while( (MMIO_IN16(ivideo->mmio_vbase, Q_STATUS+2) & 0x8000) != 0x8000){}; \
+  	CmdQueLen = 0; \
   }
 
 #define SiS310SetupSRCBase(base) \
-      if (CmdQueLen <= 0)  SiS310Idle;\
-      MMIO_OUT32(ivideo.mmio_vbase, SRC_ADDR, base);\
-      CmdQueLen--;
+	if(CmdQueLen <= 0) SiS310Idle;\
+	MMIO_OUT32(ivideo->mmio_vbase, SRC_ADDR, base);\
+	CmdQueLen--;
 
 #define SiS310SetupSRCPitch(pitch) \
-      if (CmdQueLen <= 0)  SiS310Idle;\
-      MMIO_OUT16(ivideo.mmio_vbase, SRC_PITCH, pitch);\
-      CmdQueLen--;
+	if(CmdQueLen <= 0) SiS310Idle;\
+	MMIO_OUT16(ivideo->mmio_vbase, SRC_PITCH, pitch);\
+	CmdQueLen--;
 
 #define SiS310SetupSRCXY(x,y) \
-      if (CmdQueLen <= 0)  SiS310Idle;\
-      MMIO_OUT32(ivideo.mmio_vbase, SRC_Y, (x)<<16 | (y) );\
-      CmdQueLen--;
+	if(CmdQueLen <= 0) SiS310Idle;\
+	MMIO_OUT32(ivideo->mmio_vbase, SRC_Y, (x)<<16 | (y) );\
+	CmdQueLen--;
 
 #define SiS310SetupDSTBase(base) \
-      if (CmdQueLen <= 0)  SiS310Idle;\
-      MMIO_OUT32(ivideo.mmio_vbase, DST_ADDR, base);\
-      CmdQueLen--;
+	if(CmdQueLen <= 0) SiS310Idle;\
+	MMIO_OUT32(ivideo->mmio_vbase, DST_ADDR, base);\
+	CmdQueLen--;
 
 #define SiS310SetupDSTXY(x,y) \
-      if (CmdQueLen <= 0)  SiS310Idle;\
-      MMIO_OUT32(ivideo.mmio_vbase, DST_Y, (x)<<16 | (y) );\
-      CmdQueLen--;
+	if(CmdQueLen <= 0) SiS310Idle;\
+	MMIO_OUT32(ivideo->mmio_vbase, DST_Y, (x)<<16 | (y) );\
+	CmdQueLen--;
 
 #define SiS310SetupDSTRect(x,y) \
-      if (CmdQueLen <= 0)  SiS310Idle;\
-      MMIO_OUT32(ivideo.mmio_vbase, DST_PITCH, (y)<<16 | (x) );\
-      CmdQueLen--;
+	if(CmdQueLen <= 0) SiS310Idle;\
+	MMIO_OUT32(ivideo->mmio_vbase, DST_PITCH, (y)<<16 | (x) );\
+	CmdQueLen--;
 
 #define SiS310SetupDSTColorDepth(bpp) \
-      if (CmdQueLen <= 0)  SiS310Idle;\
-      MMIO_OUT16(ivideo.mmio_vbase, AGP_BASE, bpp);\
-      CmdQueLen--;
+	if(CmdQueLen <= 0) SiS310Idle;\
+	MMIO_OUT16(ivideo->mmio_vbase, AGP_BASE, bpp);\
+	CmdQueLen--;
 
 #define SiS310SetupRect(w,h) \
-      if (CmdQueLen <= 0)  SiS310Idle;\
-      MMIO_OUT32(ivideo.mmio_vbase, RECT_WIDTH, (h)<<16 | (w) );\
-      CmdQueLen--;
+	if(CmdQueLen <= 0) SiS310Idle;\
+	MMIO_OUT32(ivideo->mmio_vbase, RECT_WIDTH, (h)<<16 | (w) );\
+	CmdQueLen--;
 
 #define SiS310SetupPATFG(color) \
-      if (CmdQueLen <= 0)  SiS310Idle;\
-      MMIO_OUT32(ivideo.mmio_vbase, PAT_FGCOLOR, color);\
-      CmdQueLen--;
+	if(CmdQueLen <= 0) SiS310Idle;\
+	MMIO_OUT32(ivideo->mmio_vbase, PAT_FGCOLOR, color);\
+	CmdQueLen--;
 
 #define SiS310SetupPATBG(color) \
-      if (CmdQueLen <= 0)  SiS310Idle;\
-      MMIO_OUT32(ivideo.mmio_vbase, PAT_BGCOLOR, color);\
-      CmdQueLen--;
+	if(CmdQueLen <= 0) SiS310Idle;\
+	MMIO_OUT32(ivideo->mmio_vbase, PAT_BGCOLOR, color);\
+	CmdQueLen--;
 
 #define SiS310SetupSRCFG(color) \
-      if (CmdQueLen <= 0)  SiS310Idle;\
-      MMIO_OUT32(ivideo.mmio_vbase, SRC_FGCOLOR, color);\
-      CmdQueLen--;
+	if(CmdQueLen <= 0) SiS310Idle;\
+	MMIO_OUT32(ivideo->mmio_vbase, SRC_FGCOLOR, color);\
+	CmdQueLen--;
 
 #define SiS310SetupSRCBG(color) \
-      if (CmdQueLen <= 0)  SiS310Idle;\
-      MMIO_OUT32(ivideo.mmio_vbase, SRC_BGCOLOR, color);\
-      CmdQueLen--;
+	if(CmdQueLen <= 0) SiS310Idle;\
+	MMIO_OUT32(ivideo->mmio_vbase, SRC_BGCOLOR, color);\
+	CmdQueLen--;
 
 #define SiS310SetupSRCTrans(color) \
-      if (CmdQueLen <= 1)  SiS310Idle;\
-      MMIO_OUT32(ivideo.mmio_vbase, TRANS_SRC_KEY_HIGH, color);\
-      MMIO_OUT32(ivideo.mmio_vbase, TRANS_SRC_KEY_LOW, color);\
-      CmdQueLen -= 2;
+	if(CmdQueLen <= 1) SiS310Idle;\
+	MMIO_OUT32(ivideo->mmio_vbase, TRANS_SRC_KEY_HIGH, color);\
+	MMIO_OUT32(ivideo->mmio_vbase, TRANS_SRC_KEY_LOW, color);\
+	CmdQueLen -= 2;
 
 #define SiS310SetupDSTTrans(color) \
-      if (CmdQueLen <= 1)  SiS310Idle;\
-      MMIO_OUT32(ivideo.mmio_vbase, TRANS_DST_KEY_HIGH, color); \
-      MMIO_OUT32(ivideo.mmio_vbase, TRANS_DST_KEY_LOW, color); \
-      CmdQueLen -= 2;
+	if(CmdQueLen <= 1) SiS310Idle;\
+	MMIO_OUT32(ivideo->mmio_vbase, TRANS_DST_KEY_HIGH, color); \
+	MMIO_OUT32(ivideo->mmio_vbase, TRANS_DST_KEY_LOW, color); \
+	CmdQueLen -= 2;
 
 #define SiS310SetupMONOPAT(p0,p1) \
-      if (CmdQueLen <= 1)  SiS310Idle;\
-      MMIO_OUT32(ivideo.mmio_vbase, MONO_MASK, p0);\
-      MMIO_OUT32(ivideo.mmio_vbase, MONO_MASK+4, p1);\
-      CmdQueLen -= 2;
+	if(CmdQueLen <= 1) SiS310Idle;\
+	MMIO_OUT32(ivideo->mmio_vbase, MONO_MASK, p0);\
+	MMIO_OUT32(ivideo->mmio_vbase, MONO_MASK+4, p1);\
+	CmdQueLen -= 2;
 
 #define SiS310SetupClipLT(left,top) \
-      if (CmdQueLen <= 0)  SiS310Idle;\
-      MMIO_OUT32(ivideo.mmio_vbase, LEFT_CLIP, ((left) & 0xFFFF) | (top)<<16 );\
-      CmdQueLen--;
+	if(CmdQueLen <= 0) SiS310Idle;\
+	MMIO_OUT32(ivideo->mmio_vbase, LEFT_CLIP, ((left) & 0xFFFF) | (top)<<16 );\
+	CmdQueLen--;
 
 #define SiS310SetupClipRB(right,bottom) \
-      if (CmdQueLen <= 0)  SiS310Idle;\
-      MMIO_OUT32(ivideo.mmio_vbase, RIGHT_CLIP, ((right) & 0xFFFF) | (bottom)<<16 );\
-      CmdQueLen--;
+	if(CmdQueLen <= 0) SiS310Idle;\
+	MMIO_OUT32(ivideo->mmio_vbase, RIGHT_CLIP, ((right) & 0xFFFF) | (bottom)<<16 );\
+	CmdQueLen--;
 
 #define SiS310SetupROP(rop) \
-      ivideo.CommandReg = (rop) << 8;
+	ivideo->CommandReg = (rop) << 8;
 
 #define SiS310SetupCMDFlag(flags) \
-      ivideo.CommandReg |= (flags);
+	ivideo->CommandReg |= (flags);
 
 #define SiS310DoCMD \
-      if (CmdQueLen <= 1)  SiS310Idle;\
-      MMIO_OUT32(ivideo.mmio_vbase, COMMAND_READY, ivideo.CommandReg); \
-      MMIO_OUT32(ivideo.mmio_vbase, FIRE_TRIGGER, 0); \
-      CmdQueLen -= 2;
-
-#define SiS310SetupX0Y0(x,y) \
-      if (CmdQueLen <= 0)  SiS310Idle;\
-      MMIO_OUT32(ivideo.mmio_vbase, LINE_X0, (y)<<16 | (x) );\
-      CmdQueLen--;
-
-#define SiS310SetupX1Y1(x,y) \
-      if (CmdQueLen <= 0)  SiS310Idle;\
-      MMIO_OUT32(ivideo.mmio_vbase, LINE_X1, (y)<<16 | (x) );\
-      CmdQueLen--;
-
-#define SiS310SetupLineCount(c) \
-      if (CmdQueLen <= 0)  SiS310Idle;\
-      MMIO_OUT16(ivideo.mmio_vbase, LINE_COUNT, c);\
-      CmdQueLen--;
-
-#define SiS310SetupStylePeriod(p) \
-      if (CmdQueLen <= 0)  SiS310Idle;\
-      MMIO_OUT16(ivideo.mmio_vbase, LINE_STYLE_PERIOD, p);\
-      CmdQueLen--;
-
-#define SiS310SetupStyleLow(ls) \
-      if (CmdQueLen <= 0)  SiS310Idle;\
-      MMIO_OUT32(ivideo.mmio_vbase, LINE_STYLE_0, ls);\
-      CmdQueLen--;
-
-#define SiS310SetupStyleHigh(ls) \
-      if (CmdQueLen <= 0)  SiS310Idle;\
-      MMIO_OUT32(ivideo.mmio_vbase, LINE_STYLE_1, ls);\
-      CmdQueLen--;
-
-int  sisfb_initaccel(void);
-void sisfb_syncaccel(void);
-
-extern struct video_info ivideo;
+	if(CmdQueLen <= 1) SiS310Idle;\
+	MMIO_OUT32(ivideo->mmio_vbase, COMMAND_READY, ivideo->CommandReg); \
+	MMIO_OUT32(ivideo->mmio_vbase, FIRE_TRIGGER, 0); \
+	CmdQueLen -= 2;
+
+
+int  sisfb_initaccel(struct sis_video_info *ivideo);
+void sisfb_syncaccel(struct sis_video_info *ivideo);
 
 #if LINUX_VERSION_CODE <= KERNEL_VERSION(2,5,33)
 void fbcon_sis_bmove(struct display *p, int srcy, int srcx, int dsty,
-                     int dstx, int height, int width);
+			int dstx, int height, int width);
 void fbcon_sis_revc(struct display *p, int srcy, int srcx);
 void fbcon_sis_clear8(struct vc_data *conp, struct display *p, int srcy,
-                      int srcx, int height, int width);
+			int srcx, int height, int width);
 void fbcon_sis_clear16(struct vc_data *conp, struct display *p, int srcy,
-                       int srcx, int height, int width);
+			int srcx, int height, int width);
 void fbcon_sis_clear32(struct vc_data *conp, struct display *p, int srcy,
-                       int srcx, int height, int width);
+			int srcx, int height, int width);
 #endif
 #if LINUX_VERSION_CODE >= KERNEL_VERSION(2,5,34)
-extern int sisfb_accel;
 void fbcon_sis_fillrect(struct fb_info *info, const struct fb_fillrect *rect);
 void fbcon_sis_copyarea(struct fb_info *info, const struct fb_copyarea *area);
 #endif
diff --git a/drivers/video/sis/sis_main.c b/drivers/video/sis/sis_main.c
index 960cdbb55..9ad218d6a 100644
--- a/drivers/video/sis/sis_main.c
+++ b/drivers/video/sis/sis_main.c
@@ -1,6 +1,7 @@
 /*
- * SiS 300/630/730/540/315/550/650/651/M650/661FX/M661FX/740/741/M741/330/760
- * frame buffer driver for Linux kernels 2.4.x and 2.5.x
+ * SiS 300/305/540/630(S)/730(S)
+ * SiS 315(H/PRO)/55x/(M)65x/(M)661(F/M)X/740/741(GX)/330/(M)760
+ * frame buffer driver for Linux kernels >= 2.4.14 and >=2.6.3
  *
  * Copyright (C) 2001-2004 Thomas Winischhofer, Vienna, Austria.
  *
@@ -20,8 +21,8 @@
  *
  * Author:   	Thomas Winischhofer <thomas@winischhofer.net>
  *
- * Author of code base:
- *		SiS (www.sis.com.tw)
+ * Author of (practically wiped) code base:
+ *		SiS (www.sis.com)
  *	 	Copyright (C) 1999 Silicon Integrated Systems, Inc.
  *
  * See http://www.winischhofer.net/ for more information and updates
@@ -34,7 +35,11 @@
 #include <linux/config.h>
 #include <linux/version.h>
 #include <linux/module.h>
+#if LINUX_VERSION_CODE >= KERNEL_VERSION(2,5,0)
+#include <linux/moduleparam.h>
+#endif
 #include <linux/kernel.h>
+#include <linux/spinlock.h>
 #include <linux/errno.h>
 #include <linux/string.h>
 #include <linux/mm.h>
@@ -47,28 +52,12 @@
 #include <linux/ioport.h>
 #include <linux/init.h>
 #include <linux/pci.h>
-#if LINUX_VERSION_CODE >= KERNEL_VERSION(2,6,0)
 #include <linux/vmalloc.h>
-#endif
 #include <linux/vt_kern.h>
 #include <linux/capability.h>
 #include <linux/fs.h>
-#include <linux/agp_backend.h>
 #include <linux/types.h>
 #include <asm/uaccess.h>
-
-#if LINUX_VERSION_CODE >= KERNEL_VERSION(2,5,0)
-#include <linux/spinlock.h>
-#endif
-
-#include "osdef.h"
-
-#if LINUX_VERSION_CODE >= KERNEL_VERSION(2,5,0)
-#include <video/sisfb.h>
-#else
-#include <linux/sisfb.h>
-#endif
-
 #include <asm/io.h>
 #ifdef CONFIG_MTRR
 #include <asm/mtrr.h>
@@ -82,32 +71,16 @@
 #include <video/fbcon-cfb32.h>
 #endif
 
-#include "vgatypes.h"
-#include "sis_main.h"
 #include "sis.h"
+#include "sis_main.h"
 
 #if LINUX_VERSION_CODE >= KERNEL_VERSION(2,5,0)
-#if LINUX_VERSION_CODE < KERNEL_VERSION(2,6,0)
-#error "This version of sisfb requires at least 2.6.0"
-#else
-#if 0
-#define NEWFBDEV		/* Define this as soon as new fvdev code has been merged */
-#endif
-#endif
+#if LINUX_VERSION_CODE < KERNEL_VERSION(2,6,3)
+#error "This version of sisfb requires at least 2.6.3"
 #endif
-
-/* -------------------- Macro definitions ---------------------------- */
-
-#undef SISFBDEBUG 	/* TW: no debugging */
-
-#ifdef SISFBDEBUG
-#define DPRINTK(fmt, args...) printk(KERN_DEBUG "%s: " fmt, __FUNCTION__ , ## args)
-#else
-#define DPRINTK(fmt, args...)
 #endif
 
 #if LINUX_VERSION_CODE < KERNEL_VERSION(2,5,0)
-#ifdef SISFBACCEL
 #ifdef FBCON_HAS_CFB8
 extern struct display_switch fbcon_sis8;
 #endif
@@ -118,174 +91,289 @@ extern struct display_switch fbcon_sis16;
 extern struct display_switch fbcon_sis32;
 #endif
 #endif
-#endif
 
-/* --------------- Hardware Access Routines -------------------------- */
+/* ------------------ Internal helper routines ----------------- */
 
-void sisfb_set_reg4(u16 port, unsigned long data)
+static void __init
+sisfb_setdefaultparms(void)
 {
-	outl((u32) (data & 0xffffffff), port);
+	sisfb_off 		= 0;
+	sisfb_parm_mem 		= 0;
+	sisfb_accel 		= -1;
+	sisfb_ypan      	= -1;
+	sisfb_max 		= -1;
+	sisfb_userom    	= -1;
+        sisfb_useoem    	= -1;
+#ifdef MODULE
+	/* Module: "None" for 2.4, default mode for 2.5+ */
+#if LINUX_VERSION_CODE >= KERNEL_VERSION(2,5,0)
+	sisfb_mode_idx 		= -1;
+#else
+	sisfb_mode_idx  	= MODE_INDEX_NONE;
+#endif
+#else
+	/* Static: Default mode */
+	sisfb_mode_idx  	= -1;
+#endif
+	sisfb_parm_rate 	= -1;
+	sisfb_crt1off 		= 0;
+	sisfb_forcecrt1 	= -1;
+	sisfb_crt2type  	= -1;
+	sisfb_crt2flags 	= 0;
+	sisfb_pdc 		= 0xff;
+	sisfb_pdca 		= 0xff;
+	sisfb_scalelcd  	= -1;
+	sisfb_specialtiming 	= CUT_NONE;
+	sisfb_lvdshl 		= -1;
+	sisfb_dstn     		= 0;
+	sisfb_fstn 		= 0;
+	sisfb_tvplug    	= -1;
+	sisfb_tvstd     	= -1;
+	sisfb_tvxposoffset 	= 0;
+	sisfb_tvyposoffset 	= 0;
+	sisfb_filter 		= -1;
+	sisfb_nocrt2rate 	= 0;
+#if LINUX_VERSION_CODE < KERNEL_VERSION(2,5,0)
+	sisfb_inverse   	= 0;
+	sisfb_fontname[0] 	= 0;
+#endif
+#if !defined(__i386__) && !defined(__x86_64__)
+	sisfb_resetcard 	= 0;
+	sisfb_videoram  	= 0;
+#endif
 }
 
-u32 sisfb_get_reg3(u16 port)
+static void __init
+sisfb_search_vesamode(unsigned int vesamode, BOOLEAN quiet)
 {
-	u32 data;
+	int i = 0, j = 0;
 
-	data = inl(port);
-	return (data);
-}
+	/* BEWARE: We don't know the hardware specs yet and there is no ivideo */
+
+	if(vesamode == 0) {
+#if LINUX_VERSION_CODE < KERNEL_VERSION(2,5,0)
+		sisfb_mode_idx = MODE_INDEX_NONE;
+#else
+		if(!quiet) {
+		   printk(KERN_ERR "sisfb: Invalid mode. Using default.\n");
+		}
+		sisfb_mode_idx = DEFAULT_MODE;
+#endif
+		return;
+	}
+
+	vesamode &= 0x1dff;  /* Clean VESA mode number from other flags */
 
-/* ------------ Interface for init & mode switching code ------------- */
+	while(sisbios_mode[i++].mode_no[0] != 0) {
+		if( (sisbios_mode[i-1].vesa_mode_no_1 == vesamode) ||
+		    (sisbios_mode[i-1].vesa_mode_no_2 == vesamode) ) {
+		    if(sisfb_fstn) {
+		       if(sisbios_mode[i-1].mode_no[1] == 0x50 ||
+		          sisbios_mode[i-1].mode_no[1] == 0x56 ||
+		          sisbios_mode[i-1].mode_no[1] == 0x53) continue;
+	            } else {
+		       if(sisbios_mode[i-1].mode_no[1] == 0x5a ||
+		          sisbios_mode[i-1].mode_no[1] == 0x5b) continue;
+		    }
+		    sisfb_mode_idx = i - 1;
+		    j = 1;
+		    break;
+		}
+	}
+	if((!j) && !quiet) printk(KERN_ERR "sisfb: Invalid VESA mode 0x%x'\n", vesamode);
+}
 
-BOOLEAN
-sisfb_query_VGA_config_space(PSIS_HW_INFO psishw_ext,
-	unsigned long offset, unsigned long set, unsigned long *value)
+static void
+sisfb_search_mode(char *name, BOOLEAN quiet)
 {
-	static struct pci_dev *pdev = NULL;
-	static unsigned char init = 0, valid_pdev = 0;
+	int i = 0;
+	unsigned int j = 0, xres = 0, yres = 0, depth = 0, rate = 0;
+	char strbuf[16], strbuf1[20];
+	char *nameptr = name;
 
-	if (!set)
-		DPRINTK("sisfb: Get VGA offset 0x%lx\n", offset);
-	else
-		DPRINTK("sisfb: Set offset 0x%lx to 0x%lx\n", offset, *value);
+	/* BEWARE: We don't know the hardware specs yet and there is no ivideo */
 
-	if (!init) {
-		init = TRUE;
-#if LINUX_VERSION_CODE < KERNEL_VERSION(2,5,74)
-		pci_for_each_dev(pdev) {
-#else
-		while((pdev = pci_find_device(PCI_VENDOR_ID_SI, PCI_ANY_ID, pdev))) {
-#endif
-			DPRINTK("sisfb: Current: 0x%x, target: 0x%x\n",
-			         pdev->device, ivideo.chip_id);
-			if ((pdev->vendor == PCI_VENDOR_ID_SI)
-			           && (pdev->device == ivideo.chip_id)) {
-				valid_pdev = TRUE;
-				break;
-			}
-		}
+	if(name == NULL) {
+	   if(!quiet) {
+	      printk(KERN_ERR "sisfb: Internal error, using default mode.\n");
+	   }
+	   sisfb_mode_idx = DEFAULT_MODE;
+	   return;
 	}
 
-	if (!valid_pdev) {
-		printk(KERN_DEBUG "sisfb: Can't find SiS %d VGA device.\n",
-				ivideo.chip_id);
-		return FALSE;
+#if LINUX_VERSION_CODE >= KERNEL_VERSION(2,5,0)
+        if(!strnicmp(name, sisbios_mode[MODE_INDEX_NONE].name, strlen(name))) {
+	   if(!quiet) {
+	      printk(KERN_ERR "sisfb: Mode 'none' not supported anymore. Using default.\n");
+	   }
+	   sisfb_mode_idx = DEFAULT_MODE;
+	   return;
 	}
+#endif
+	if(strlen(name) <= 19) {
+	   strcpy(strbuf1, name);
+	   for(i=0; i<strlen(strbuf1); i++) {
+	      if(strbuf1[i] < '0' || strbuf1[i] > '9') strbuf1[i] = ' ';
+	   }
 
-	if (set == 0)
-		pci_read_config_dword(pdev, offset, (u32 *)value);
-	else
-		pci_write_config_dword(pdev, offset, (u32)(*value));
+	   /* This does some fuzzy mode naming detection */
+	   if(sscanf(strbuf1, "%u %u %u %u", &xres, &yres, &depth, &rate) == 4) {
+	      if((rate <= 32) || (depth > 32)) {
+	         j = rate; rate = depth; depth = j;
+	      }
+	      sprintf(strbuf, "%ux%ux%u", xres, yres, depth);
+	      nameptr = strbuf;
+	      sisfb_parm_rate = rate;
+	   } else if(sscanf(strbuf1, "%u %u %u", &xres, &yres, &depth) == 3) {
+	      sprintf(strbuf, "%ux%ux%u", xres, yres, depth);
+	      nameptr = strbuf;
+	   } else {
+	      xres = 0;
+	      if((sscanf(strbuf1, "%u %u", &xres, &yres) == 2) && (xres != 0)) {
+	         sprintf(strbuf, "%ux%ux8", xres, yres);
+	         nameptr = strbuf;
+	      } else {
+	         sisfb_search_vesamode(simple_strtoul(name, NULL, 0), quiet);
+	         return;
+	      }
+	   }
+	}
 
-	return TRUE;
+	i = 0; j = 0;
+	while(sisbios_mode[i].mode_no[0] != 0) {
+		if(!strnicmp(nameptr, sisbios_mode[i++].name, strlen(nameptr))) {
+		   	if(sisfb_fstn) {
+		      		if(sisbios_mode[i-1].mode_no[1] == 0x50 ||
+		         	   sisbios_mode[i-1].mode_no[1] == 0x56 ||
+		         	   sisbios_mode[i-1].mode_no[1] == 0x53) continue;
+	           	} else {
+		      		if(sisbios_mode[i-1].mode_no[1] == 0x5a ||
+		         	   sisbios_mode[i-1].mode_no[1] == 0x5b) continue;
+		   	}
+		   	sisfb_mode_idx = i - 1;
+		   	j = 1;
+		   	break;
+		}
+	}
+	if((!j) && !quiet) printk(KERN_ERR "sisfb: Invalid mode '%s'\n", nameptr);
 }
 
-BOOLEAN sisfb_query_north_bridge_space(PSIS_HW_INFO psishw_ext,
-	unsigned long offset, unsigned long set, unsigned long *value)
+#ifndef MODULE
+static void __devinit
+sisfb_get_vga_mode_from_kernel(void)
 {
-	static struct pci_dev *pdev = NULL;
-	static unsigned char init = 0, valid_pdev = 0;
-	u16 nbridge_id = 0;
+#if (defined(__i386__) || defined(__x86_64__)) && defined(CONFIG_VIDEO_SELECT)
+   	char mymode[32];
+	int  mydepth = screen_info.lfb_depth;
 
-	if (!init) {
-		init = TRUE;
-		switch (ivideo.chip) {
-#ifdef CONFIG_FB_SIS_300
-		case SIS_540:
-			nbridge_id = PCI_DEVICE_ID_SI_540;
-			break;
-		case SIS_630:
-			nbridge_id = PCI_DEVICE_ID_SI_630;
-			break;
-		case SIS_730:
-			nbridge_id = PCI_DEVICE_ID_SI_730;
-			break;
+	if(screen_info.orig_video_isVGA != VIDEO_TYPE_VLFB) return;
+
+	if( (screen_info.lfb_width >= 320) && (screen_info.lfb_width <= 2048) &&
+	    (screen_info.lfb_height >= 200) && (screen_info.lfb_height <= 1536) &&
+	    (mydepth >= 8) && (mydepth <= 32) ) {
+
+	    if(mydepth == 24) mydepth = 32;
+
+	    sprintf(mymode, "%ux%ux%u", screen_info.lfb_width,
+	    				screen_info.lfb_height,
+					mydepth);
+
+	    printk(KERN_DEBUG "sisfb: Using vga mode %s pre-set by kernel as default\n", mymode);
+
+	    sisfb_search_mode(mymode, TRUE);
+	}
 #endif
-#ifdef CONFIG_FB_SIS_315
-		case SIS_550:
-			nbridge_id = PCI_DEVICE_ID_SI_550;
-			break;
-		case SIS_650:
-			nbridge_id = PCI_DEVICE_ID_SI_650;
-			break;
-		case SIS_740:
-			nbridge_id = PCI_DEVICE_ID_SI_740;
-			break;
-		case SIS_661:
-			nbridge_id = PCI_DEVICE_ID_SI_660;
-			break;
-		case SIS_741:
-			nbridge_id = PCI_DEVICE_ID_SI_741;
-			break;
-		case SIS_660:
-			nbridge_id = PCI_DEVICE_ID_SI_660;
-			break;
-		case SIS_760:
-			nbridge_id = PCI_DEVICE_ID_SI_760;
-			break;
+	return;
+}
 #endif
-		default:
-			nbridge_id = 0;
-			break;
-		}
 
-#if LINUX_VERSION_CODE < KERNEL_VERSION(2,5,74)
-		pci_for_each_dev(pdev) {
-#else
-		while((pdev = pci_find_device(PCI_VENDOR_ID_SI, PCI_ANY_ID, pdev))) {
-#endif
-			DPRINTK("Current: 0x%x, target: 0x%x\n",
-					pdev->device, ivideo.chip_id);
-			if ((pdev->vendor == PCI_VENDOR_ID_SI)
-					&& (pdev->device == nbridge_id)) {
-				valid_pdev = TRUE;
-				break;
-			}
-		}
-	}
+static void __init
+sisfb_search_crt2type(const char *name)
+{
+	int i = 0;
+
+	/* BEWARE: We don't know the hardware specs yet and there is no ivideo */
 
-	if (!valid_pdev) {
-		printk(KERN_DEBUG "sisfb: Can't find SiS %d North Bridge device.\n",
-				nbridge_id);
-		return FALSE;
+	if(name == NULL) return;
+
+	while(sis_crt2type[i].type_no != -1) {
+	   	if(!strnicmp(name, sis_crt2type[i].name, strlen(sis_crt2type[i].name))) {
+	      		sisfb_crt2type = sis_crt2type[i].type_no;
+	      		sisfb_tvplug = sis_crt2type[i].tvplug_no;
+	      		sisfb_crt2flags = sis_crt2type[i].flags;
+	      		break;
+	   	}
+	   	i++;
 	}
 
-	if (set == 0)
-		pci_read_config_dword(pdev, offset, (u32 *)value);
-	else
-		pci_write_config_dword(pdev, offset, (u32)(*value));
+	sisfb_dstn = (sisfb_crt2flags & FL_550_DSTN) ? 1 : 0;
+	sisfb_fstn = (sisfb_crt2flags & FL_550_FSTN) ? 1 : 0;
 
-	return TRUE;
+	if(sisfb_crt2type < 0) {
+		printk(KERN_ERR "sisfb: Invalid CRT2 type: %s\n", name);
+	}
 }
 
-/* ------------------ Internal helper routines ----------------- */
-
-static BOOLEAN sisfb_verify_rate(struct sisfb_monitor *monitor, int mode_idx, int rate_idx, int rate)
+static void __init
+sisfb_search_tvstd(const char *name)
 {
-	int htotal, vtotal;
-	unsigned int dclock, hsync;
-
-	if(!monitor->datavalid) return TRUE;
+	int i = 0;
 
-	if(mode_idx < 0) return FALSE;
+	/* BEWARE: We don't know the hardware specs yet and there is no ivideo */
 
-	if(rate < (monitor->vmin - 1)) return FALSE;
-	if(rate > (monitor->vmax + 1)) return FALSE;
+	if(name == NULL) return;
 
-	if(sisfb_gettotalfrommode(&SiS_Pr, &sishw_ext, sisbios_mode[mode_idx].mode_no,
-	                          &htotal, &vtotal, rate_idx)) {
-		dclock = (htotal * vtotal * rate) / 1000;
-		if(dclock > (monitor->dclockmax + 1000)) return FALSE;
-		hsync = dclock / htotal;
-		if(hsync < (monitor->hmin - 1)) return FALSE;
-		if(hsync > (monitor->hmax + 1)) return FALSE;
-        } else {
-	  	return FALSE;
+	while(sis_tvtype[i].type_no != -1) {
+	   	if(!strnicmp(name, sis_tvtype[i].name, strlen(sis_tvtype[i].name))) {
+	      		sisfb_tvstd = sis_tvtype[i].type_no;
+	      		break;
+	   	}
+	   	i++;
 	}
-	return TRUE;
-};
+}
+
+static void __init
+sisfb_search_specialtiming(const char *name)
+{
+	int i = 0;
+	BOOLEAN found = FALSE;
+
+	/* BEWARE: We don't know the hardware specs yet and there is no ivideo */
+
+	if(name == NULL) return;
+
+	if(!strnicmp(name, "none", 4)) {
+	        sisfb_specialtiming = CUT_FORCENONE;
+		printk(KERN_DEBUG "sisfb: Special timing disabled\n");
+	} else {
+	   while(mycustomttable[i].chipID != 0) {
+	      if(!strnicmp(name,mycustomttable[i].optionName, strlen(mycustomttable[i].optionName))) {
+		 sisfb_specialtiming = mycustomttable[i].SpecialID;
+		 found = TRUE;
+		 printk(KERN_INFO "sisfb: Special timing for %s %s forced (\"%s\")\n",
+		 	mycustomttable[i].vendorName, mycustomttable[i].cardName,
+		 	mycustomttable[i].optionName);
+		 break;
+	      }
+	      i++;
+	   }
+	   if(!found) {
+	      printk(KERN_WARNING "sisfb: Invalid SpecialTiming parameter, valid are:");
+	      printk(KERN_WARNING "\t\"none\" (to disable special timings)\n");
+	      i = 0;
+	      while(mycustomttable[i].chipID != 0) {
+		 printk(KERN_WARNING "\t\"%s\" (for %s %s)\n",
+		     mycustomttable[i].optionName,
+		     mycustomttable[i].vendorName,
+		     mycustomttable[i].cardName);
+		 i++;
+	      }
+           }
+ 	}
+}
 
-static BOOLEAN sisfb_interpret_edid(struct sisfb_monitor *monitor, u8 *buffer)
+static BOOLEAN __devinit
+sisfb_interpret_edid(struct sisfb_monitor *monitor, u8 *buffer)
 {
 	int i, j, xres, yres, refresh, index;
 	u32 emodes;
@@ -385,7 +473,8 @@ static BOOLEAN sisfb_interpret_edid(struct sisfb_monitor *monitor, u8 *buffer)
  	return(monitor->datavalid);
 }
 
-static void sisfb_handle_ddc(struct sisfb_monitor *monitor, int crtno)
+static void __devinit
+sisfb_handle_ddc(struct sis_video_info *ivideo, struct sisfb_monitor *monitor, int crtno)
 {
 	USHORT  temp, i, realcrtno = crtno;
    	u8      buffer[256];
@@ -393,14 +482,15 @@ static void sisfb_handle_ddc(struct sisfb_monitor *monitor, int crtno)
 	monitor->datavalid = FALSE;
 
 	if(crtno) {
-       	   if(ivideo.vbflags & CRT2_LCD)      realcrtno = 1;
-      	   else if(ivideo.vbflags & CRT2_VGA) realcrtno = 2;
+       	   if(ivideo->vbflags & CRT2_LCD)      realcrtno = 1;
+      	   else if(ivideo->vbflags & CRT2_VGA) realcrtno = 2;
       	   else return;
    	}
 
-	if((sisfb_crt1off) && (!crtno)) return;
+	if((ivideo->sisfb_crt1off) && (!crtno)) return;
 
-    	temp = SiS_HandleDDC(&SiS_Pr, ivideo.vbflags, sisvga_engine, realcrtno, 0, &buffer[0]);
+    	temp = SiS_HandleDDC(&ivideo->SiS_Pr, ivideo->vbflags, ivideo->sisvga_engine,
+				realcrtno, 0, &buffer[0]);
    	if((!temp) || (temp == 0xffff)) {
       	   printk(KERN_INFO "sisfb: CRT%d DDC probing failed\n", crtno + 1);
 	   return;
@@ -415,7 +505,7 @@ static void sisfb_handle_ddc(struct sisfb_monitor *monitor, int crtno)
       	   if(temp & 0x02) {
 	      i = 3;  /* Number of retrys */
 	      do {
-	    	 temp = SiS_HandleDDC(&SiS_Pr, ivideo.vbflags, sisvga_engine,
+	    	 temp = SiS_HandleDDC(&ivideo->SiS_Pr, ivideo->vbflags, ivideo->sisvga_engine,
 				     realcrtno, 1, &buffer[0]);
 	      } while((temp) && i--);
               if(!temp) {
@@ -435,194 +525,117 @@ static void sisfb_handle_ddc(struct sisfb_monitor *monitor, int crtno)
 	}
 }
 
-static void sisfb_search_vesamode(unsigned int vesamode, BOOLEAN quiet)
+static BOOLEAN
+sisfb_verify_rate(struct sis_video_info *ivideo, struct sisfb_monitor *monitor,
+		int mode_idx, int rate_idx, int rate)
 {
-	int i = 0, j = 0;
+	int htotal, vtotal;
+	unsigned int dclock, hsync;
 
-	if(vesamode == 0) {
-#if LINUX_VERSION_CODE < KERNEL_VERSION(2,5,0)
-		sisfb_mode_idx = MODE_INDEX_NONE;
-#else
-		if(!quiet)
-		   printk(KERN_ERR "sisfb: Mode 'none' not supported anymore. Using default.\n");
-		sisfb_mode_idx = DEFAULT_MODE;
+	if(!monitor->datavalid) return TRUE;
+
+	if(mode_idx < 0) return FALSE;
+
+	/* Skip for 320x200, 320x240, 640x400 */
+    	switch(sisbios_mode[mode_idx].mode_no[ivideo->mni]) {
+    	case 0x59:
+    	case 0x41:
+    	case 0x4f:
+    	case 0x50:
+    	case 0x56:
+    	case 0x53:
+    	case 0x2f:
+    	case 0x5d:
+    	case 0x5e:
+    		return TRUE;
+#ifdef CONFIG_FB_SIS_315
+	case 0x5a:
+	case 0x5b:
+		if(ivideo->sisvga_engine == SIS_315_VGA) return TRUE;
 #endif
-		return;
-	}
+    	}
 
-	vesamode &= 0x1dff;  /* Clean VESA mode number from other flags */
+	if(rate < (monitor->vmin - 1)) return FALSE;
+	if(rate > (monitor->vmax + 1)) return FALSE;
 
-	while(sisbios_mode[i++].mode_no != 0) {
-		if( (sisbios_mode[i-1].vesa_mode_no_1 == vesamode) ||
-		    (sisbios_mode[i-1].vesa_mode_no_2 == vesamode) ) {
-		    if(sisfb_fstn) {
-		       if(sisbios_mode[i-1].mode_no == 0x50 ||
-		          sisbios_mode[i-1].mode_no == 0x56 ||
-		          sisbios_mode[i-1].mode_no == 0x53) continue;
-	            } else {
-		       if(sisbios_mode[i-1].mode_no == 0x5a ||
-		          sisbios_mode[i-1].mode_no == 0x5b) continue;
-		    }
-		    sisfb_mode_idx = i - 1;
-		    j = 1;
-		    break;
-		}
+	if(sisfb_gettotalfrommode(&ivideo->SiS_Pr, &ivideo->sishw_ext,
+				  sisbios_mode[mode_idx].mode_no[ivideo->mni],
+	                          &htotal, &vtotal, rate_idx)) {
+		dclock = (htotal * vtotal * rate) / 1000;
+		if(dclock > (monitor->dclockmax + 1000)) return FALSE;
+		hsync = dclock / htotal;
+		if(hsync < (monitor->hmin - 1)) return FALSE;
+		if(hsync > (monitor->hmax + 1)) return FALSE;
+        } else {
+	  	return FALSE;
 	}
-	if((!j) && !quiet) printk(KERN_ERR "sisfb: Invalid VESA mode 0x%x'\n", vesamode);
+	return TRUE;
 }
 
-static void sisfb_search_mode(char *name, BOOLEAN quiet)
+static int
+sisfb_validate_mode(struct sis_video_info *ivideo, int myindex, u32 vbflags)
 {
-	int i = 0;
-	unsigned int j = 0, xres = 0, yres = 0, depth = 0, rate = 0;
-	char strbuf[16], strbuf1[20];
-	char *nameptr = name;
-
-	if(name == NULL) {
-	   if(!quiet)
-	      printk(KERN_ERR "sisfb: Internal error, using default mode.\n");
-	   sisfb_mode_idx = DEFAULT_MODE;
-	   return;
-	}
-
-#if LINUX_VERSION_CODE >= KERNEL_VERSION(2,5,0)
-        if (!strnicmp(name, sisbios_mode[MODE_INDEX_NONE].name, strlen(name))) {
-	   if(!quiet)
-	      printk(KERN_ERR "sisfb: Mode 'none' not supported anymore. Using default.\n");
-	   sisfb_mode_idx = DEFAULT_MODE;
-	   return;
-	}
-#endif
-	if(strlen(name) <= 19) {
-	   strcpy(strbuf1, name);
-	   for(i=0; i<strlen(strbuf1); i++) {
-	      if(strbuf1[i] < '0' || strbuf1[i] > '9') strbuf1[i] = ' ';
-	   }
-
-	   /* This does some fuzzy mode naming detection */
-	   if(sscanf(strbuf1, "%u %u %u %u", &xres, &yres, &depth, &rate) == 4) {
-	      if((rate <= 32) || (depth > 32)) {
-	         j = rate; rate = depth; depth = j;
-	      }
-	      sprintf(strbuf, "%ux%ux%u", xres, yres, depth);
-	      nameptr = strbuf;
-	      ivideo.refresh_rate = sisfb_parm_rate = rate;
-	   } else if(sscanf(strbuf1, "%u %u %u", &xres, &yres, &depth) == 3) {
-	      sprintf(strbuf, "%ux%ux%u", xres, yres, depth);
-	      nameptr = strbuf;
-	   } else {
-	      xres = 0;
-	      if((sscanf(strbuf1, "%u %u", &xres, &yres) == 2) && (xres != 0)) {
-	         sprintf(strbuf, "%ux%ux8", xres, yres);
-	         nameptr = strbuf;
-	      } else {
-	         sisfb_search_vesamode(simple_strtoul(name, NULL, 0), quiet);
-	         return;
-	      }
-	   }
-	}
-
-	i = 0; j = 0;
-	while(sisbios_mode[i].mode_no != 0) {
-		if(!strnicmp(nameptr, sisbios_mode[i++].name, strlen(nameptr))) {
-		   if(sisfb_fstn) {
-		      if(sisbios_mode[i-1].mode_no == 0x50 ||
-		         sisbios_mode[i-1].mode_no == 0x56 ||
-		         sisbios_mode[i-1].mode_no == 0x53) continue;
-	           } else {
-		      if(sisbios_mode[i-1].mode_no == 0x5a ||
-		         sisbios_mode[i-1].mode_no == 0x5b) continue;
-		   }
-		   sisfb_mode_idx = i - 1;
-		   j = 1;
-		   break;
-		}
-	}
-	if((!j) && !quiet) printk(KERN_ERR "sisfb: Invalid mode '%s'\n", nameptr);
-
-}
-
-static int sisfb_validate_mode(int myindex, unsigned long vbflags)
-{
-   u16 xres, yres, myres;
+   u16 xres=0, yres, myres;
 
 #ifdef CONFIG_FB_SIS_300
-   if(sisvga_engine == SIS_300_VGA) {
+   if(ivideo->sisvga_engine == SIS_300_VGA) {
       if(!(sisbios_mode[myindex].chipset & MD_SIS300)) return(-1);
    }
 #endif
 #ifdef CONFIG_FB_SIS_315
-   if(sisvga_engine == SIS_315_VGA) {
+   if(ivideo->sisvga_engine == SIS_315_VGA) {
       if(!(sisbios_mode[myindex].chipset & MD_SIS315)) return(-1);
    }
 #endif
 
    myres = sisbios_mode[myindex].yres;
 
-   switch (vbflags & VB_DISPTYPE_DISP2) {
+   switch(vbflags & VB_DISPTYPE_DISP2) {
+
      case CRT2_LCD:
-	switch (sishw_ext.ulCRT2LCDType) {
-	case LCD_640x480:  xres =  640; yres =  480;  break;
-	case LCD_800x600:  xres =  800; yres =  600;  break;
-        case LCD_1024x600: xres = 1024; yres =  600;  break;
-	case LCD_1024x768: xres = 1024; yres =  768;  break;
-	case LCD_1152x768: xres = 1152; yres =  768;  break;
-	case LCD_1280x960: xres = 1280; yres =  960;  break;
-	case LCD_1280x768: xres = 1280; yres =  768;  break;
-	case LCD_1280x1024:xres = 1280; yres = 1024;  break;
-	case LCD_1400x1050:xres = 1400; yres = 1050;  break;
-	case LCD_1600x1200:xres = 1600; yres = 1200;  break;
-	case LCD_320x480:  xres =  320; yres =  480;  break; /* FSTN (old) */
-	case LCD_640x480_2:
-	case LCD_640x480_3:xres =  640; yres =  480;  break; /* FSTN (new) */
-	default:           xres =    0; yres =    0;  break;
-	}
-
-	if(SiS_Pr.SiS_CustomT == CUT_BARCO1366) {
-	   xres = 1360; yres = 1024;
-	}
-
-	if(SiS_Pr.SiS_CustomT == CUT_PANEL848) {
-	   xres = 848;  yres =  480;
-	} else {
-	   if(sisbios_mode[myindex].xres > xres) return(-1);
-           if(myres > yres) return(-1);
+
+        xres = ivideo->lcdxres; yres = ivideo->lcdyres;
+
+	if(ivideo->SiS_Pr.SiS_CustomT != CUT_PANEL848) {
+	   	if(sisbios_mode[myindex].xres > xres) return(-1);
+           	if(myres > yres) return(-1);
 	}
 
 	if(vbflags & (VB_LVDS | VB_30xBDH)) {
 	   if(sisbios_mode[myindex].xres == 320) {
 	      if((myres == 240) || (myres == 480)) {
-		 if(!sisfb_fstn) {
-		    if(sisbios_mode[myindex].mode_no == 0x5a ||
-		       sisbios_mode[myindex].mode_no == 0x5b)
+		 if(!ivideo->sisfb_fstn) {
+		    if(sisbios_mode[myindex].mode_no[1] == 0x5a ||
+		       sisbios_mode[myindex].mode_no[1] == 0x5b)
 		       return(-1);
 		 } else {
-		    if(sisbios_mode[myindex].mode_no == 0x50 ||
-		       sisbios_mode[myindex].mode_no == 0x56 ||
-		       sisbios_mode[myindex].mode_no == 0x53)
+		    if(sisbios_mode[myindex].mode_no[1] == 0x50 ||
+		       sisbios_mode[myindex].mode_no[1] == 0x56 ||
+		       sisbios_mode[myindex].mode_no[1] == 0x53)
 		       return(-1);
 		 }
 	      }
 	   }
 	}
 
-	if(SiS_GetModeID_LCD(sisvga_engine, vbflags, sisbios_mode[myindex].xres, sisbios_mode[myindex].yres,
-	                     0, sisfb_fstn, SiS_Pr.SiS_CustomT, xres, yres) < 0x14) {
-	   return(-1);
+	if(SiS_GetModeID_LCD(ivideo->sisvga_engine, vbflags, sisbios_mode[myindex].xres,
+			     sisbios_mode[myindex].yres, 0, ivideo->sisfb_fstn,
+			     ivideo->SiS_Pr.SiS_CustomT, xres, yres) < 0x14) {
+	   	return(-1);
 	}
 	break;
 
      case CRT2_TV:
-	if(SiS_GetModeID_TV(sisvga_engine, vbflags, sisbios_mode[myindex].xres,
+	if(SiS_GetModeID_TV(ivideo->sisvga_engine, vbflags, sisbios_mode[myindex].xres,
 	                    sisbios_mode[myindex].yres, 0) < 0x14) {
-	   return(-1);
+	   	return(-1);
 	}
 	break;
 
      case CRT2_VGA:
-        if(SiS_GetModeID_VGA2(sisvga_engine, vbflags, sisbios_mode[myindex].xres,
-	                    sisbios_mode[myindex].yres, 0) < 0x14) {
-	   return(-1);
+        if(SiS_GetModeID_VGA2(ivideo->sisvga_engine, vbflags, sisbios_mode[myindex].xres,
+	                      sisbios_mode[myindex].yres, 0) < 0x14) {
+	   	return(-1);
 	}
 	break;
      }
@@ -630,49 +643,8 @@ static int sisfb_validate_mode(int myindex, unsigned long vbflags)
      return(myindex);
 }
 
-static void sisfb_search_crt2type(const char *name)
-{
-	int i = 0;
-
-	if(name == NULL)
-		return;
-
-	while(sis_crt2type[i].type_no != -1) {
-		if (!strnicmp(name, sis_crt2type[i].name, strlen(sis_crt2type[i].name))) {
-			sisfb_crt2type = sis_crt2type[i].type_no;
-			sisfb_tvplug = sis_crt2type[i].tvplug_no;
-			sisfb_dstn = (sis_crt2type[i].flags & FL_550_DSTN) ? 1 : 0;
-			sisfb_fstn = (sis_crt2type[i].flags & FL_550_FSTN) ? 1 : 0;
-			break;
-		}
-		i++;
-	}
-	if(sisfb_crt2type < 0)
-		printk(KERN_ERR "sisfb: Invalid CRT2 type: %s\n", name);
-        if(ivideo.chip != SIS_550) {
-	   sisfb_dstn = sisfb_fstn = 0;
-	}
-}
-
-static void sisfb_search_queuemode(const char *name)
-{
-	int i = 0;
-
-	if(name == NULL)
-		return;
-
-	while (sis_queuemode[i].type_no != -1) {
-		if (!strnicmp(name, sis_queuemode[i].name, strlen(sis_queuemode[i].name))) {
-			sisfb_queuemode = sis_queuemode[i].type_no;
-			break;
-		}
-		i++;
-	}
-	if (sisfb_queuemode < 0)
-		printk(KERN_ERR "sisfb: Invalid queuemode type: %s\n", name);
-}
-
-static u8 sisfb_search_refresh_rate(unsigned int rate, int mode_idx)
+static u8
+sisfb_search_refresh_rate(struct sis_video_info *ivideo, unsigned int rate, int mode_idx)
 {
 	u16 xres, yres;
 	int i = 0;
@@ -680,116 +652,64 @@ static u8 sisfb_search_refresh_rate(unsigned int rate, int mode_idx)
 	xres = sisbios_mode[mode_idx].xres;
 	yres = sisbios_mode[mode_idx].yres;
 
-	sisfb_rate_idx = 0;
-	while ((sisfb_vrate[i].idx != 0) && (sisfb_vrate[i].xres <= xres)) {
-		if ((sisfb_vrate[i].xres == xres) && (sisfb_vrate[i].yres == yres)) {
-			if (sisfb_vrate[i].refresh == rate) {
-				sisfb_rate_idx = sisfb_vrate[i].idx;
+	ivideo->rate_idx = 0;
+	while((sisfb_vrate[i].idx != 0) && (sisfb_vrate[i].xres <= xres)) {
+		if((sisfb_vrate[i].xres == xres) && (sisfb_vrate[i].yres == yres)) {
+			if(sisfb_vrate[i].refresh == rate) {
+				ivideo->rate_idx = sisfb_vrate[i].idx;
 				break;
-			} else if (sisfb_vrate[i].refresh > rate) {
-				if ((sisfb_vrate[i].refresh - rate) <= 3) {
+			} else if(sisfb_vrate[i].refresh > rate) {
+				if((sisfb_vrate[i].refresh - rate) <= 3) {
 					DPRINTK("sisfb: Adjusting rate from %d up to %d\n",
 						rate, sisfb_vrate[i].refresh);
-					sisfb_rate_idx = sisfb_vrate[i].idx;
-					ivideo.refresh_rate = sisfb_vrate[i].refresh;
-				} else if (((rate - sisfb_vrate[i-1].refresh) <= 2)
+					ivideo->rate_idx = sisfb_vrate[i].idx;
+					ivideo->refresh_rate = sisfb_vrate[i].refresh;
+				} else if(((rate - sisfb_vrate[i-1].refresh) <= 2)
 						&& (sisfb_vrate[i].idx != 1)) {
 					DPRINTK("sisfb: Adjusting rate from %d down to %d\n",
 						rate, sisfb_vrate[i-1].refresh);
-					sisfb_rate_idx = sisfb_vrate[i-1].idx;
-					ivideo.refresh_rate = sisfb_vrate[i-1].refresh;
+					ivideo->rate_idx = sisfb_vrate[i-1].idx;
+					ivideo->refresh_rate = sisfb_vrate[i-1].refresh;
 				} 
 				break;
 			} else if((rate - sisfb_vrate[i].refresh) <= 2) {
 				DPRINTK("sisfb: Adjusting rate from %d down to %d\n",
 						rate, sisfb_vrate[i].refresh);
-	           		sisfb_rate_idx = sisfb_vrate[i].idx;
+	           		ivideo->rate_idx = sisfb_vrate[i].idx;
 		   		break;
 	       		}
 		}
 		i++;
 	}
-	if (sisfb_rate_idx > 0) {
-		return sisfb_rate_idx;
+	if(ivideo->rate_idx > 0) {
+		return ivideo->rate_idx;
 	} else {
-		printk(KERN_INFO
-			"sisfb: Unsupported rate %d for %dx%d\n", rate, xres, yres);
+		printk(KERN_INFO "sisfb: Unsupported rate %d for %dx%d\n",
+				rate, xres, yres);
 		return 0;
 	}
 }
 
-static void sisfb_search_tvstd(const char *name)
-{
-	int i = 0;
-
-	if(name == NULL)
-		return;
-
-	while (sis_tvtype[i].type_no != -1) {
-		if (!strnicmp(name, sis_tvtype[i].name, strlen(sis_tvtype[i].name))) {
-			ivideo.vbflags |= sis_tvtype[i].type_no;
-			break;
-		}
-		i++;
-	}
-}
-
-static void sisfb_search_specialtiming(const char *name)
-{
-	int i = 0;
-	BOOLEAN found = FALSE;
-
-	if(name == NULL)
-		return;
-
-	if(!strnicmp(name, "none", 4)) {
-	        SiS_Pr.SiS_CustomT = CUT_FORCENONE;
-		printk(KERN_DEBUG "sisfb: Special timing disabled\n");
-	} else {
-	   while(mycustomttable[i].chipID != 0) {
-	      if(!strnicmp(name,mycustomttable[i].optionName, strlen(mycustomttable[i].optionName))) {
-		 SiS_Pr.SiS_CustomT = mycustomttable[i].SpecialID;
-		 found = TRUE;
-		 printk(KERN_INFO "sisfb: Special timing for %s %s forced (\"%s\")\n",
-		 	mycustomttable[i].vendorName, mycustomttable[i].cardName,
-		 	mycustomttable[i].optionName);
-		 break;
-	      }
-	      i++;
-	   }
-	   if(!found) {
-	      printk(KERN_WARNING "sisfb: Invalid SpecialTiming parameter, valid are:");
-	      printk(KERN_WARNING "\t\"none\" (to disable special timings)\n");
-	      i = 0;
-	      while(mycustomttable[i].chipID != 0) {
-		 printk(KERN_WARNING "\t\"%s\" (for %s %s)\n",
-		     mycustomttable[i].optionName,
-		     mycustomttable[i].vendorName,
-		     mycustomttable[i].cardName);
-		 i++;
-	      }
-           }
- 	}
-}
-
-static BOOLEAN sisfb_bridgeisslave(void)
+static BOOLEAN
+sisfb_bridgeisslave(struct sis_video_info *ivideo)
 {
    unsigned char P1_00;
 
-   if(!(ivideo.vbflags & VB_VIDEOBRIDGE)) return FALSE;
+   if(!(ivideo->vbflags & VB_VIDEOBRIDGE)) return FALSE;
 
    inSISIDXREG(SISPART1,0x00,P1_00);
-   if( ((sisvga_engine == SIS_300_VGA) && (P1_00 & 0xa0) == 0x20) ||
-       ((sisvga_engine == SIS_315_VGA) && (P1_00 & 0x50) == 0x10) ) {
+   if( ((ivideo->sisvga_engine == SIS_300_VGA) && (P1_00 & 0xa0) == 0x20) ||
+       ((ivideo->sisvga_engine == SIS_315_VGA) && (P1_00 & 0x50) == 0x10) ) {
 	   return TRUE;
    } else {
            return FALSE;
    }
 }
 
-static BOOLEAN sisfballowretracecrt1(void)
+static BOOLEAN
+sisfballowretracecrt1(struct sis_video_info *ivideo)
 {
-   unsigned char temp;
+   u8 temp;
 
    inSISIDXREG(SISCR,0x17,temp);
    if(!(temp & 0x80)) return FALSE;
@@ -800,20 +720,21 @@ static BOOLEAN sisfballowretracecrt1(void)
    return TRUE;
 }
 
-static BOOLEAN sisfbcheckvretracecrt1(void)
+static BOOLEAN
+sisfbcheckvretracecrt1(struct sis_video_info *ivideo)
 {
-
-   if(!sisfballowretracecrt1()) return FALSE;
+   if(!sisfballowretracecrt1(ivideo)) return FALSE;
 
    if(inSISREG(SISINPSTAT) & 0x08) return TRUE;
    else 			   return FALSE;
 }
 
-static void sisfbwaitretracecrt1(void)
+static void
+sisfbwaitretracecrt1(struct sis_video_info *ivideo)
 {
    int watchdog;
 
-   if(!sisfballowretracecrt1()) return;
+   if(!sisfballowretracecrt1(ivideo)) return;
 
    watchdog = 65536;
    while((!(inSISREG(SISINPSTAT) & 0x08)) && --watchdog);
@@ -821,19 +742,15 @@ static void sisfbwaitretracecrt1(void)
    while((inSISREG(SISINPSTAT) & 0x08) && --watchdog);
 }
 
-static BOOLEAN sisfbcheckvretracecrt2(void)
+static BOOLEAN
+sisfbcheckvretracecrt2(struct sis_video_info *ivideo)
 {
    unsigned char temp, reg;
 
-   switch(sisvga_engine) {
-   case SIS_300_VGA:
-   	reg = 0x25;
-	break;
-   case SIS_315_VGA:
-   	reg = 0x30;
-	break;
-   default:
-        return FALSE;
+   switch(ivideo->sisvga_engine) {
+   case SIS_300_VGA: reg = 0x25; break;
+   case SIS_315_VGA: reg = 0x30; break;
+   default:          return FALSE;
    }
 
    inSISIDXREG(SISPART1, reg, temp);
@@ -841,19 +758,67 @@ static BOOLEAN sisfbcheckvretracecrt2(void)
    else 	   return TRUE;
 }
 
-static BOOLEAN sisfb_CheckVBRetrace(void)
+static BOOLEAN
+sisfb_CheckVBRetrace(struct sis_video_info *ivideo)
 {
-   if(ivideo.currentvbflags & VB_DISPTYPE_DISP2) {
-      if(sisfb_bridgeisslave()) {
-         return(sisfbcheckvretracecrt1());
+   if(ivideo->currentvbflags & VB_DISPTYPE_DISP2) {
+      if(sisfb_bridgeisslave(ivideo)) {
+         return(sisfbcheckvretracecrt1(ivideo));
       } else {
-         return(sisfbcheckvretracecrt2());
+         return(sisfbcheckvretracecrt2(ivideo));
       }
    } 
-   return(sisfbcheckvretracecrt1());
+   return(sisfbcheckvretracecrt1(ivideo));
+}
+
+static u32
+sisfb_setupvbblankflags(struct sis_video_info *ivideo, u32 *vcount, u32 *hcount)
+{
+   u8 idx, reg1, reg2, reg3, reg4;
+   u32 ret = 0;
+
+   (*vcount) = (*hcount) = 0;
+
+   if((ivideo->currentvbflags & VB_DISPTYPE_DISP2) && (!(sisfb_bridgeisslave(ivideo)))) {
+      ret |= (FB_VBLANK_HAVE_VSYNC  |
+      	      FB_VBLANK_HAVE_HBLANK |
+              FB_VBLANK_HAVE_VBLANK |
+	      FB_VBLANK_HAVE_VCOUNT |
+	      FB_VBLANK_HAVE_HCOUNT);
+      switch(ivideo->sisvga_engine) {
+         case SIS_300_VGA: idx = 0x25; break;
+	 default:
+         case SIS_315_VGA: idx = 0x30; break;
+      }
+      inSISIDXREG(SISPART1,(idx+0),reg1); /* 30 */
+      inSISIDXREG(SISPART1,(idx+1),reg2); /* 31 */
+      inSISIDXREG(SISPART1,(idx+2),reg3); /* 32 */
+      inSISIDXREG(SISPART1,(idx+3),reg4); /* 33 */
+      if(!(reg1 & 0x01)) ret |= FB_VBLANK_VBLANKING;
+      if(!(reg1 & 0x02)) ret |= FB_VBLANK_VSYNCING;
+      if(!(reg4 & 0x80)) ret |= FB_VBLANK_HBLANKING;
+      (*vcount) = reg3 | ((reg4 & 0x70) << 4);
+      (*hcount) = reg2 | ((reg4 & 0x0f) << 8);
+   } else if(sisfballowretracecrt1(ivideo)) {
+      ret |= (FB_VBLANK_HAVE_VSYNC  |
+              FB_VBLANK_HAVE_VBLANK |
+	      FB_VBLANK_HAVE_VCOUNT |
+	      FB_VBLANK_HAVE_HCOUNT);
+      reg1 = inSISREG(SISINPSTAT);
+      if(reg1 & 0x08) ret |= FB_VBLANK_VSYNCING;
+      if(reg1 & 0x01) ret |= FB_VBLANK_VBLANKING;
+      inSISIDXREG(SISCR,0x20,reg1);
+      inSISIDXREG(SISCR,0x1b,reg1);
+      inSISIDXREG(SISCR,0x1c,reg2);
+      inSISIDXREG(SISCR,0x1d,reg3);
+      (*vcount) = reg2 | ((reg3 & 0x07) << 8);
+      (*hcount) = (reg1 | ((reg3 & 0x10) << 4)) << 3;
+   }
+   return ret;
 }
 
-static int sisfb_myblank(int blank)
+static int
+sisfb_myblank(struct sis_video_info *ivideo, int blank)
 {
    u8 sr01, sr11, sr1f, cr63=0, p2_0, p1_13;
    BOOLEAN backlight = TRUE;
@@ -908,63 +873,64 @@ static int sisfb_myblank(int blank)
       return 1;
    }
 
-   if(ivideo.currentvbflags & VB_DISPTYPE_CRT1) {
+   if(ivideo->currentvbflags & VB_DISPTYPE_CRT1) {
 
-      setSISIDXREG(SISSR, 0x01, ~0x20, sr01);
+      if( (!ivideo->sisfb_thismonitor.datavalid) ||
+          ((ivideo->sisfb_thismonitor.datavalid) &&
+           (ivideo->sisfb_thismonitor.feature & 0xe0))) {
 
-      if( (!sisfb_thismonitor.datavalid) ||
-          ((sisfb_thismonitor.datavalid) &&
-           (sisfb_thismonitor.feature & 0xe0))) {
-
-	 if(sisvga_engine == SIS_315_VGA) {
-	    setSISIDXREG(SISCR, SiS_Pr.SiS_MyCR63, 0xbf, cr63);
+	 if(ivideo->sisvga_engine == SIS_315_VGA) {
+	    setSISIDXREG(SISCR, ivideo->SiS_Pr.SiS_MyCR63, 0xbf, cr63);
 	 }
 
-	 setSISIDXREG(SISSR, 0x1f, 0x3f, sr1f);
+	 if(!(sisfb_bridgeisslave(ivideo))) {
+	    setSISIDXREG(SISSR, 0x01, ~0x20, sr01);
+	    setSISIDXREG(SISSR, 0x1f, 0x3f, sr1f);
+	 }
       }
 
    }
 
-   if(ivideo.currentvbflags & CRT2_LCD) {
+   if(ivideo->currentvbflags & CRT2_LCD) {
 
-      if(ivideo.vbflags & (VB_301LV|VB_302LV|VB_302ELV)) {
+      if(ivideo->vbflags & (VB_301LV|VB_302LV|VB_302ELV)) {
 	 if(backlight) {
-	    SiS_SiS30xBLOn(&SiS_Pr, &sishw_ext);
+	    SiS_SiS30xBLOn(&ivideo->SiS_Pr, &ivideo->sishw_ext);
 	 } else {
-	    SiS_SiS30xBLOff(&SiS_Pr, &sishw_ext);
+	    SiS_SiS30xBLOff(&ivideo->SiS_Pr, &ivideo->sishw_ext);
 	 }
-      } else if(sisvga_engine == SIS_315_VGA) {
-	 if(ivideo.vbflags & VB_CHRONTEL) {
+      } else if(ivideo->sisvga_engine == SIS_315_VGA) {
+	 if(ivideo->vbflags & VB_CHRONTEL) {
 	    if(backlight) {
-	       SiS_Chrontel701xBLOn(&SiS_Pr,&sishw_ext);
+	       SiS_Chrontel701xBLOn(&ivideo->SiS_Pr,&ivideo->sishw_ext);
 	    } else {
-	       SiS_Chrontel701xBLOff(&SiS_Pr);
+	       SiS_Chrontel701xBLOff(&ivideo->SiS_Pr);
 	    }
 	 }
       }
 
-      if(((sisvga_engine == SIS_300_VGA) &&
-          (ivideo.vbflags & (VB_301|VB_30xBDH|VB_LVDS))) ||
-         ((sisvga_engine == SIS_315_VGA) &&
-          ((ivideo.vbflags & (VB_LVDS | VB_CHRONTEL)) == VB_LVDS))) {
+      if(((ivideo->sisvga_engine == SIS_300_VGA) &&
+          (ivideo->vbflags & (VB_301|VB_30xBDH|VB_LVDS))) ||
+         ((ivideo->sisvga_engine == SIS_315_VGA) &&
+          ((ivideo->vbflags & (VB_LVDS | VB_CHRONTEL)) == VB_LVDS))) {
           setSISIDXREG(SISSR, 0x11, ~0x0c, sr11);
       }
 
-      if(sisvga_engine == SIS_300_VGA) {
-         if((ivideo.vbflags & (VB_301B|VB_301C|VB_302B)) &&
-            (!(ivideo.vbflags & VB_30xBDH))) {
+      if(ivideo->sisvga_engine == SIS_300_VGA) {
+         if((ivideo->vbflags & (VB_301B|VB_301C|VB_302B)) &&
+            (!(ivideo->vbflags & VB_30xBDH))) {
 	    setSISIDXREG(SISPART1, 0x13, 0x3f, p1_13);
 	 }
-      } else if(sisvga_engine == SIS_315_VGA) {
-         if((ivideo.vbflags & (VB_301B|VB_301C|VB_302B)) &&
-            (!(ivideo.vbflags & VB_30xBDH))) {
+      } else if(ivideo->sisvga_engine == SIS_315_VGA) {
+         if((ivideo->vbflags & (VB_301B|VB_301C|VB_302B)) &&
+            (!(ivideo->vbflags & VB_30xBDH))) {
 	    setSISIDXREG(SISPART2, 0x00, 0x1f, p2_0);
 	 }
       }
 
-   } else if(ivideo.currentvbflags & CRT2_VGA) {
+   } else if(ivideo->currentvbflags & CRT2_VGA) {
 
-      if(ivideo.vbflags & (VB_301B|VB_301C|VB_302B)) {
+      if(ivideo->vbflags & (VB_301B|VB_301C|VB_302B)) {
          setSISIDXREG(SISPART2, 0x00, 0x1f, p2_0);
       }
 
@@ -975,35 +941,122 @@ static int sisfb_myblank(int blank)
 
 /* ----------- FBDev related routines for all series ----------- */
 
-static void sisfb_set_vparms(void)
+static int
+sisfb_get_cmap_len(const struct fb_var_screeninfo *var)
 {
-   switch(ivideo.video_bpp) {
-   case 8:
-       	ivideo.DstColor = 0x0000;
-	ivideo.SiS310_AccelDepth = 0x00000000;
-	ivideo.video_cmap_len = 256;
-       	break;
-   case 16:
-       	ivideo.DstColor = 0x8000;
-       	ivideo.SiS310_AccelDepth = 0x00010000;
-	ivideo.video_cmap_len = 16;
-       	break;
-   case 32:
-       	ivideo.DstColor = 0xC000;
-	ivideo.SiS310_AccelDepth = 0x00020000;
-	ivideo.video_cmap_len = 16;
-       	break;
-   default:
- 	ivideo.video_cmap_len = 16;
-	printk(KERN_ERR "sisfb: Unsupported depth %d", ivideo.video_bpp);
-	ivideo.accel = 0;
-	break;
-   }
+	return (var->bits_per_pixel == 8) ? 256 : 16;
+}
+
+static void
+sisfb_set_vparms(struct sis_video_info *ivideo)
+{
+   	switch(ivideo->video_bpp) {
+	case 8:
+		ivideo->DstColor = 0x0000;
+		ivideo->SiS310_AccelDepth = 0x00000000;
+		ivideo->video_cmap_len = 256;
+		break;
+	case 16:
+		ivideo->DstColor = 0x8000;
+		ivideo->SiS310_AccelDepth = 0x00010000;
+		ivideo->video_cmap_len = 16;
+		break;
+	case 32:
+		ivideo->DstColor = 0xC000;
+		ivideo->SiS310_AccelDepth = 0x00020000;
+		ivideo->video_cmap_len = 16;
+		break;
+	default:
+		ivideo->video_cmap_len = 16;
+		printk(KERN_ERR "sisfb: Unsupported depth %d", ivideo->video_bpp);
+		ivideo->accel = 0;
+		break;
+   	}
+}
+
+static int
+sisfb_calc_maxyres(struct sis_video_info *ivideo, struct fb_var_screeninfo *var)
+{
+	int maxyres = ivideo->heapstart / (var->xres_virtual * (var->bits_per_pixel >> 3));
+
+	if(maxyres > 32767) maxyres = 32767;
+
+	return maxyres;
+}
+
+static void
+sisfb_calc_pitch(struct sis_video_info *ivideo, struct fb_var_screeninfo *var)
+{
+	ivideo->video_linelength = var->xres_virtual * (var->bits_per_pixel >> 3);
+	ivideo->scrnpitchCRT1 = ivideo->video_linelength;
+	if(!(ivideo->currentvbflags & CRT1_LCDA)) {
+		if((var->vmode & FB_VMODE_MASK) == FB_VMODE_INTERLACED) {
+			ivideo->scrnpitchCRT1 <<= 1;
+		}
+	}
+
+}
+
+static void
+sisfb_set_pitch(struct sis_video_info *ivideo)
+{
+   	BOOLEAN isslavemode = FALSE;
+	unsigned short HDisplay1 = ivideo->scrnpitchCRT1 >> 3;
+	unsigned short HDisplay2 = ivideo->video_linelength >> 3;
+
+   	if(sisfb_bridgeisslave(ivideo)) isslavemode = TRUE;
+
+   	/* We need to set pitch for CRT1 if bridge is in slave mode, too */
+   	if((ivideo->currentvbflags & VB_DISPTYPE_DISP1) || (isslavemode)) {
+   		outSISIDXREG(SISCR,0x13,(HDisplay1 & 0xFF));
+   		setSISIDXREG(SISSR,0x0E,0xF0,(HDisplay1 >> 8));
+	}
+
+   	/* We must not set the pitch for CRT2 if bridge is in slave mode */
+   	if((ivideo->currentvbflags & VB_DISPTYPE_DISP2) && (!isslavemode)) {
+		orSISIDXREG(SISPART1,ivideo->CRT2_write_enable,0x01);
+   		outSISIDXREG(SISPART1,0x07,(HDisplay2 & 0xFF));
+   		setSISIDXREG(SISPART1,0x09,0xF0,(HDisplay2 >> 8));
+   	}
+}
+
+static void
+sisfb_bpp_to_var(struct sis_video_info *ivideo, struct fb_var_screeninfo *var)
+{
+	ivideo->video_cmap_len = sisfb_get_cmap_len(var);
+
+	switch(var->bits_per_pixel) {
+	case 8:
+		var->red.offset = var->green.offset = var->blue.offset = 0;
+		var->red.length = var->green.length = var->blue.length = 6;
+		break;
+	case 16:
+		var->red.offset = 11;
+		var->red.length = 5;
+		var->green.offset = 5;
+		var->green.length = 6;
+		var->blue.offset = 0;
+		var->blue.length = 5;
+		var->transp.offset = 0;
+		var->transp.length = 0;
+		break;
+	case 32:
+		var->red.offset = 16;
+		var->red.length = 8;
+		var->green.offset = 8;
+		var->green.length = 8;
+		var->blue.offset = 0;
+		var->blue.length = 8;
+		var->transp.offset = 24;
+		var->transp.length = 8;
+		break;
+	}
 }
 
-static int sisfb_do_set_var(struct fb_var_screeninfo *var, int isactive,
-		      struct fb_info *info)
+static int
+sisfb_do_set_var(struct fb_var_screeninfo *var, int isactive, struct fb_info *info)
 {
+	struct sis_video_info *ivideo = (struct sis_video_info *)info->par;
 	unsigned int htotal = 0, vtotal = 0;
 	unsigned int drate = 0, hrate = 0;
 	int found_mode = 0;
@@ -1033,52 +1086,51 @@ static int sisfb_do_set_var(struct fb_var_screeninfo *var, int isactive,
 	}
 
 	if(pixclock && htotal && vtotal) {
-	   drate = 1000000000 / pixclock;
-	   hrate = (drate * 1000) / htotal;
-	   ivideo.refresh_rate = (unsigned int) (hrate * 2 / vtotal);
-	} else ivideo.refresh_rate = 60;
-
-#if 0
-	printk(KERN_DEBUG "sisfb: Change mode to %dx%dx%d-%dHz\n",
-		var->xres,var->yres,var->bits_per_pixel,ivideo.refresh_rate);
-#endif
+	   	drate = 1000000000 / pixclock;
+	   	hrate = (drate * 1000) / htotal;
+	   	ivideo->refresh_rate = (unsigned int) (hrate * 2 / vtotal);
+	} else {
+	   	ivideo->refresh_rate = 60;
+	}
 
-	old_mode = sisfb_mode_idx;
-	sisfb_mode_idx = 0;
+	old_mode = ivideo->sisfb_mode_idx;
+	ivideo->sisfb_mode_idx = 0;
 
-	while( (sisbios_mode[sisfb_mode_idx].mode_no != 0) &&
-	       (sisbios_mode[sisfb_mode_idx].xres <= var->xres) ) {
-		if( (sisbios_mode[sisfb_mode_idx].xres == var->xres) &&
-		    (sisbios_mode[sisfb_mode_idx].yres == var->yres) &&
-		    (sisbios_mode[sisfb_mode_idx].bpp == var->bits_per_pixel)) {
-			sisfb_mode_no = sisbios_mode[sisfb_mode_idx].mode_no;
+	while( (sisbios_mode[ivideo->sisfb_mode_idx].mode_no[0] != 0) &&
+	       (sisbios_mode[ivideo->sisfb_mode_idx].xres <= var->xres) ) {
+		if( (sisbios_mode[ivideo->sisfb_mode_idx].xres == var->xres) &&
+		    (sisbios_mode[ivideo->sisfb_mode_idx].yres == var->yres) &&
+		    (sisbios_mode[ivideo->sisfb_mode_idx].bpp == var->bits_per_pixel)) {
+			ivideo->mode_no = sisbios_mode[ivideo->sisfb_mode_idx].mode_no[ivideo->mni];
 			found_mode = 1;
 			break;
 		}
-		sisfb_mode_idx++;
+		ivideo->sisfb_mode_idx++;
 	}
 
-	if(found_mode)
-		sisfb_mode_idx = sisfb_validate_mode(sisfb_mode_idx, ivideo.currentvbflags);
-	else
-		sisfb_mode_idx = -1;
+	if(found_mode) {
+		ivideo->sisfb_mode_idx = sisfb_validate_mode(ivideo,
+				ivideo->sisfb_mode_idx, ivideo->currentvbflags);
+	} else {
+		ivideo->sisfb_mode_idx = -1;
+	}
 
-       	if(sisfb_mode_idx < 0) {
+       	if(ivideo->sisfb_mode_idx < 0) {
 		printk(KERN_ERR "sisfb: Mode %dx%dx%d not supported\n", var->xres,
 		       var->yres, var->bits_per_pixel);
-		sisfb_mode_idx = old_mode;
+		ivideo->sisfb_mode_idx = old_mode;
 		return -EINVAL;
 	}
 
-	if(sisfb_search_refresh_rate(ivideo.refresh_rate, sisfb_mode_idx) == 0) {
-		sisfb_rate_idx = sisbios_mode[sisfb_mode_idx].rate_idx;
-		ivideo.refresh_rate = 60;
+	if(sisfb_search_refresh_rate(ivideo, ivideo->refresh_rate, ivideo->sisfb_mode_idx) == 0) {
+		ivideo->rate_idx = sisbios_mode[ivideo->sisfb_mode_idx].rate_idx;
+		ivideo->refresh_rate = 60;
 	}
 
 #if LINUX_VERSION_CODE < KERNEL_VERSION(2,5,0)
-	if(sisfb_thismonitor.datavalid) {
-	   if(!sisfb_verify_rate(&sisfb_thismonitor, sisfb_mode_idx,
-	                         sisfb_rate_idx, ivideo.refresh_rate)) {
+	if(ivideo->sisfb_thismonitor.datavalid) {
+	   if(!sisfb_verify_rate(ivideo, &ivideo->sisfb_thismonitor, ivideo->sisfb_mode_idx,
+	                         ivideo->rate_idx, ivideo->refresh_rate)) {
 	      printk(KERN_INFO "sisfb: WARNING: Refresh rate exceeds monitor specs!\n");
 	   }
 	}
@@ -1089,64 +1141,77 @@ static int sisfb_do_set_var(struct fb_var_screeninfo *var, int isactive,
 #else
 	if(isactive) {
 #endif
-		sisfb_pre_setmode();
+		sisfb_pre_setmode(ivideo);
 
-		if(SiSSetMode(&SiS_Pr, &sishw_ext, sisfb_mode_no) == 0) {
-			printk(KERN_ERR "sisfb: Setting mode[0x%x] failed\n", sisfb_mode_no);
+		if(SiSSetMode(&ivideo->SiS_Pr, &ivideo->sishw_ext, ivideo->mode_no) == 0) {
+			printk(KERN_ERR "sisfb: Setting mode[0x%x] failed\n", ivideo->mode_no);
 			return -EINVAL;
 		}
 
 		outSISIDXREG(SISSR, IND_SIS_PASSWORD, SIS_PASSWORD);
 
-		ivideo.video_bpp = sisbios_mode[sisfb_mode_idx].bpp;
-		ivideo.video_vwidth = ivideo.video_width = sisbios_mode[sisfb_mode_idx].xres;
-		ivideo.video_vheight = ivideo.video_height = sisbios_mode[sisfb_mode_idx].yres;
-		ivideo.org_x = ivideo.org_y = 0;
-		ivideo.video_linelength = ivideo.video_width * (ivideo.video_bpp >> 3);
-		ivideo.accel = 0;
-		if(sisfb_accel) {
-		   ivideo.accel = (var->accel_flags & FB_ACCELF_TEXT) ? -1 : 0;
-		}
+		sisfb_post_setmode(ivideo);
 
-		sisfb_set_vparms();
+		ivideo->video_bpp    = sisbios_mode[ivideo->sisfb_mode_idx].bpp;
+		ivideo->video_width  = sisbios_mode[ivideo->sisfb_mode_idx].xres;
+		ivideo->video_height = sisbios_mode[ivideo->sisfb_mode_idx].yres;
 
-		ivideo.current_width = ivideo.video_width;
-		ivideo.current_height = ivideo.video_height;
-		ivideo.current_bpp = ivideo.video_bpp;
-		ivideo.current_htotal = htotal;
-		ivideo.current_vtotal = vtotal;
-		ivideo.current_pixclock = var->pixclock;
-		ivideo.current_refresh_rate = ivideo.refresh_rate;
-#if LINUX_VERSION_CODE >= KERNEL_VERSION(2,5,0)
-                sisfb_lastrates[sisfb_mode_no] = ivideo.refresh_rate;
+		sisfb_calc_pitch(ivideo, var);
+		sisfb_set_pitch(ivideo);
+
+		ivideo->accel = 0;
+#if defined(FBINFO_HWACCEL_DISABLED) && defined(FBINFO_HWACCEL_XPAN)
+#ifdef STUPID_ACCELF_TEXT_SHIT
+		if(var->accel_flags & FB_ACCELF_TEXT) {
+			info->flags &= ~FBINFO_HWACCEL_DISABLED;
+		} else {
+			info->flags |= FBINFO_HWACCEL_DISABLED;
+		}
+#endif
+		if(!(info->flags & FBINFO_HWACCEL_DISABLED)) ivideo->accel = -1;
+#else
+		if(var->accel_flags & FB_ACCELF_TEXT) ivideo->accel = -1;
 #endif
 
-		sisfb_post_setmode();
+		sisfb_set_vparms(ivideo);
 
+		ivideo->current_width = ivideo->video_width;
+		ivideo->current_height = ivideo->video_height;
+		ivideo->current_bpp = ivideo->video_bpp;
+		ivideo->current_htotal = htotal;
+		ivideo->current_vtotal = vtotal;
+		ivideo->current_linelength = ivideo->video_linelength;
+		ivideo->current_pixclock = var->pixclock;
+		ivideo->current_refresh_rate = ivideo->refresh_rate;
+#if LINUX_VERSION_CODE >= KERNEL_VERSION(2,5,0)
+                ivideo->sisfb_lastrates[ivideo->mode_no] = ivideo->refresh_rate;
+#endif
 	}
+
 	return 0;
 }
 
-static int sisfb_pan_var(struct fb_var_screeninfo *var)
+static int
+sisfb_pan_var(struct sis_video_info *ivideo, struct fb_var_screeninfo *var)
 {
 	unsigned int base;
 
-	if (var->xoffset > (var->xres_virtual - var->xres)) {
+	if(var->xoffset > (var->xres_virtual - var->xres)) {
 		return -EINVAL;
 	}
 	if(var->yoffset > (var->yres_virtual - var->yres)) {
 		return -EINVAL;
 	}
 
-	base = var->yoffset * var->xres_virtual + var->xoffset;
+	base = (var->yoffset * var->xres_virtual) + var->xoffset;
 
         /* calculate base bpp dep. */
         switch(var->bits_per_pixel) {
+	case 32:
+            	break;
         case 16:
         	base >>= 1;
         	break;
-	case 32:
-            	break;
 	case 8:
         default:
         	base >>= 2;
@@ -1158,81 +1223,27 @@ static int sisfb_pan_var(struct fb_var_screeninfo *var)
         outSISIDXREG(SISCR, 0x0D, base & 0xFF);
 	outSISIDXREG(SISCR, 0x0C, (base >> 8) & 0xFF);
 	outSISIDXREG(SISSR, 0x0D, (base >> 16) & 0xFF);
-	if(sisvga_engine == SIS_315_VGA) {
+	if(ivideo->sisvga_engine == SIS_315_VGA) {
 		setSISIDXREG(SISSR, 0x37, 0xFE, (base >> 24) & 0x01);
 	}
-        if(ivideo.currentvbflags & VB_DISPTYPE_DISP2) {
-		orSISIDXREG(SISPART1, sisfb_CRT2_write_enable, 0x01);
+        if(ivideo->currentvbflags & VB_DISPTYPE_DISP2) {
+		orSISIDXREG(SISPART1, ivideo->CRT2_write_enable, 0x01);
         	outSISIDXREG(SISPART1, 0x06, (base & 0xFF));
         	outSISIDXREG(SISPART1, 0x05, ((base >> 8) & 0xFF));
         	outSISIDXREG(SISPART1, 0x04, ((base >> 16) & 0xFF));
-		if(sisvga_engine == SIS_315_VGA) {
+		if(ivideo->sisvga_engine == SIS_315_VGA) {
 			setSISIDXREG(SISPART1, 0x02, 0x7F, ((base >> 24) & 0x01) << 7);
 		}
         }
 	return 0;
 }
 
-static void sisfb_bpp_to_var(struct fb_var_screeninfo *var)
-{
-	switch(var->bits_per_pixel) {
-	   case 8:
-	   	var->red.offset = var->green.offset = var->blue.offset = 0;
-		var->red.length = var->green.length = var->blue.length = 6;
-		ivideo.video_cmap_len = 256;
-		break;
-	   case 16:
-		var->red.offset = 11;
-		var->red.length = 5;
-		var->green.offset = 5;
-		var->green.length = 6;
-		var->blue.offset = 0;
-		var->blue.length = 5;
-		var->transp.offset = 0;
-		var->transp.length = 0;
-		ivideo.video_cmap_len = 16;
-		break;
-	   case 32:
-		var->red.offset = 16;
-		var->red.length = 8;
-		var->green.offset = 8;
-		var->green.length = 8;
-		var->blue.offset = 0;
-		var->blue.length = 8;
-		var->transp.offset = 24;
-		var->transp.length = 8;
-		ivideo.video_cmap_len = 16;
-		break;
-	}
-}
-
-void sis_dispinfo(struct ap_data *rec)
-{
-	rec->minfo.bpp      = ivideo.video_bpp;
-	rec->minfo.xres     = ivideo.video_width;
-	rec->minfo.yres     = ivideo.video_height;
-	rec->minfo.v_xres   = ivideo.video_vwidth;
-	rec->minfo.v_yres   = ivideo.video_vheight;
-	rec->minfo.org_x    = ivideo.org_x;
-	rec->minfo.org_y    = ivideo.org_y;
-	rec->minfo.vrate    = ivideo.refresh_rate;
-	rec->iobase         = ivideo.vga_base - 0x30;
-	rec->mem_size       = ivideo.video_size;
-	rec->disp_state     = ivideo.disp_state;
-	rec->version        = (VER_MAJOR << 24) | (VER_MINOR << 16) | VER_LEVEL;
-	rec->hasVB          = ivideo.hasVB;
-	rec->TV_type        = ivideo.TV_type;
-	rec->TV_plug        = ivideo.TV_plug;
-	rec->chip           = ivideo.chip;
-	rec->vbflags	    = ivideo.vbflags;
-	rec->currentvbflags = ivideo.currentvbflags;
-}
-
-/* ------------ FBDev related routines for 2.4 series ----------- */
-
-#if LINUX_VERSION_CODE <= KERNEL_VERSION(2,5,0)
-
-static void sisfb_crtc_to_var(struct fb_var_screeninfo *var)
+/* ------------ FBDev related routines for 2.4 series ----------- */
+
+#if LINUX_VERSION_CODE < KERNEL_VERSION(2,5,0)
+
+static void
+sisfb_crtc_to_var(struct sis_video_info *ivideo, struct fb_var_screeninfo *var)
 {
 	u16 VRE, VBE, VRS, VBS, VDE, VT;
 	u16 HRE, HBE, HRS, HBS, HDE, HT;
@@ -1247,50 +1258,55 @@ static void sisfb_crtc_to_var(struct fb_var_screeninfo *var)
 	else
 	   var->vmode = FB_VMODE_NONINTERLACED;
 
-	switch ((sr_data & 0x1C) >> 2) {
-	   case SIS_8BPP_COLOR_MODE:
+	switch((sr_data & 0x1C) >> 2) {
+	case SIS_8BPP_COLOR_MODE:
 		var->bits_per_pixel = 8;
 		break;
-	   case SIS_16BPP_COLOR_MODE:
+	case SIS_16BPP_COLOR_MODE:
 		var->bits_per_pixel = 16;
 		break;
-	   case SIS_32BPP_COLOR_MODE:
+	case SIS_32BPP_COLOR_MODE:
 		var->bits_per_pixel = 32;
 		break;
 	}
 
-	sisfb_bpp_to_var(var);
+	sisfb_bpp_to_var(ivideo, var);
 	
 	inSISIDXREG(SISSR, 0x0A, sr_data);
-
         inSISIDXREG(SISCR, 0x06, cr_data);
-
         inSISIDXREG(SISCR, 0x07, cr_data2);
 
-	VT = (cr_data & 0xFF) | ((u16) (cr_data2 & 0x01) << 8) |
-	     ((u16) (cr_data2 & 0x20) << 4) | ((u16) (sr_data & 0x01) << 10);
+	VT = (cr_data & 0xFF) |
+	     ((u16) (cr_data2 & 0x01) << 8) |
+	     ((u16) (cr_data2 & 0x20) << 4) |
+	     ((u16) (sr_data  & 0x01) << 10);
 	A = VT + 2;
 
 	inSISIDXREG(SISCR, 0x12, cr_data);
 
-	VDE = (cr_data & 0xff) | ((u16) (cr_data2 & 0x02) << 7) |
-	      ((u16) (cr_data2 & 0x40) << 3) | ((u16) (sr_data & 0x02) << 9);
+	VDE = (cr_data & 0xff) |
+	      ((u16) (cr_data2 & 0x02) << 7) |
+	      ((u16) (cr_data2 & 0x40) << 3) |
+	      ((u16) (sr_data  & 0x02) << 9);
 	E = VDE + 1;
 
 	inSISIDXREG(SISCR, 0x10, cr_data);
 
-	VRS = (cr_data & 0xff) | ((u16) (cr_data2 & 0x04) << 6) |
-	      ((u16) (cr_data2 & 0x80) << 2) | ((u16) (sr_data & 0x08) << 7);
+	VRS = (cr_data & 0xff) |
+	      ((u16) (cr_data2 & 0x04) << 6) |
+	      ((u16) (cr_data2 & 0x80) << 2) |
+	      ((u16) (sr_data  & 0x08) << 7);
 	F = VRS + 1 - E;
 
 	inSISIDXREG(SISCR, 0x15, cr_data);
-
 	inSISIDXREG(SISCR, 0x09, cr_data3);
 
 	if(cr_data3 & 0x80) var->vmode = FB_VMODE_DOUBLE;
 
-	VBS = (cr_data & 0xff) | ((u16) (cr_data2 & 0x08) << 5) |
-	      ((u16) (cr_data3 & 0x20) << 4) | ((u16) (sr_data & 0x04) << 8);
+	VBS = (cr_data & 0xff) |
+	      ((u16) (cr_data2 & 0x08) << 5) |
+	      ((u16) (cr_data3 & 0x20) << 4) |
+	      ((u16) (sr_data & 0x04) << 8);
 
 	inSISIDXREG(SISCR, 0x16, cr_data);
 
@@ -1324,7 +1340,6 @@ static void sisfb_crtc_to_var(struct fb_var_screeninfo *var)
 	}
 
 	inSISIDXREG(SISSR, 0x0b, sr_data);
-
 	inSISIDXREG(SISCR, 0x00, cr_data);
 
 	HT = (cr_data & 0xff) | ((u16) (sr_data & 0x03) << 8);
@@ -1345,13 +1360,12 @@ static void sisfb_crtc_to_var(struct fb_var_screeninfo *var)
 	HBS = (cr_data & 0xff) | ((u16) (sr_data & 0x30) << 4);
 
 	inSISIDXREG(SISSR, 0x0c, sr_data);
-
 	inSISIDXREG(SISCR, 0x03, cr_data);
-
 	inSISIDXREG(SISCR, 0x05, cr_data2);
 
-	HBE = (cr_data & 0x1f) | ((u16) (cr_data2 & 0x80) >> 2) |
-	      ((u16) (sr_data & 0x03) << 6);
+	HBE = (cr_data & 0x1f) |
+	      ((u16) (cr_data2 & 0x80) >> 2) |
+	      ((u16) (sr_data  & 0x03) << 6);
 	HRE = (cr_data2 & 0x1f) | ((sr_data & 0x04) << 3);
 
 	temp = HBE - ((E - 1) & 255);
@@ -1362,7 +1376,10 @@ static void sisfb_crtc_to_var(struct fb_var_screeninfo *var)
 
 	D = B - F - C;
 
-	var->xres = var->xres_virtual = E * 8;
+	var->xres = E * 8;
+	if(var->xres_virtual < var->xres) {
+		var->xres_virtual = var->xres;
+	}
 
 	if((var->xres == 320) &&
 	   (var->yres == 200 || var->yres == 240)) {
@@ -1399,14 +1416,13 @@ static void sisfb_crtc_to_var(struct fb_var_screeninfo *var)
 	if((var->vmode & FB_VMODE_MASK) == FB_VMODE_INTERLACED) {
 	   VT <<= 1;
 	}
-	hrate = ivideo.refresh_rate * VT / 2;
+	hrate = ivideo->refresh_rate * VT / 2;
 	drate = (hrate * HT) / 1000;
 	var->pixclock = (u32) (1000000000 / drate);
 
-	if(sisfb_ypan) {
-	   maxyres = ivideo.heapstart / (var->xres * (var->bits_per_pixel >> 3));
-	   if(maxyres > 32767) maxyres = 32767;
-	   if(sisfb_max) {
+	if(ivideo->sisfb_ypan) {
+	   maxyres = sisfb_calc_maxyres(ivideo, var);
+	   if(ivideo->sisfb_max) {
 	      var->yres_virtual = maxyres;
 	   } else {
 	      if(var->yres_virtual > maxyres) {
@@ -1416,42 +1432,48 @@ static void sisfb_crtc_to_var(struct fb_var_screeninfo *var)
 	   if(var->yres_virtual <= var->yres) {
 	      var->yres_virtual = var->yres;
 	   }
-	} else
+	} else {
 	   var->yres_virtual = var->yres;
+	}
 
 }
 
-static int sis_getcolreg(unsigned regno, unsigned *red, unsigned *green, unsigned *blue,
-			 unsigned *transp, struct fb_info *fb_info)
+static int
+sis_getcolreg(unsigned regno, unsigned *red, unsigned *green, unsigned *blue,
+			 unsigned *transp, struct fb_info *info)
 {
-	if (regno >= ivideo.video_cmap_len)
-		return 1;
+	struct sis_video_info *ivideo = (struct sis_video_info *)info->par;
+
+	if(regno >= ivideo->video_cmap_len) return 1;
 
-	*red = sis_palette[regno].red;
-	*green = sis_palette[regno].green;
-	*blue = sis_palette[regno].blue;
+	*red   = ivideo->sis_palette[regno].red;
+	*green = ivideo->sis_palette[regno].green;
+	*blue  = ivideo->sis_palette[regno].blue;
 	*transp = 0;
+
 	return 0;
 }
 
-static int sisfb_setcolreg(unsigned regno, unsigned red, unsigned green, unsigned blue,
-                           unsigned transp, struct fb_info *fb_info)
+static int
+sisfb_setcolreg(unsigned regno, unsigned red, unsigned green, unsigned blue,
+                           unsigned transp, struct fb_info *info)
 {
-	if (regno >= ivideo.video_cmap_len)
-		return 1;
+	struct sis_video_info *ivideo = (struct sis_video_info *)info->par;
 
-	sis_palette[regno].red = red;
-	sis_palette[regno].green = green;
-	sis_palette[regno].blue = blue;
+	if(regno >= ivideo->video_cmap_len) return 1;
 
-	switch (ivideo.video_bpp) {
+	ivideo->sis_palette[regno].red   = red;
+	ivideo->sis_palette[regno].green = green;
+	ivideo->sis_palette[regno].blue  = blue;
+
+	switch(ivideo->video_bpp) {
 #ifdef FBCON_HAS_CFB8
 	case 8:
 	        outSISREG(SISDACA, regno);
 		outSISREG(SISDACD, (red >> 10));
 		outSISREG(SISDACD, (green >> 10));
 		outSISREG(SISDACD, (blue >> 10));
-		if (ivideo.currentvbflags & VB_DISPTYPE_DISP2) {
+		if(ivideo->currentvbflags & VB_DISPTYPE_DISP2) {
 		        outSISREG(SISDAC2A, regno);
 			outSISREG(SISDAC2D, (red >> 8));
 			outSISREG(SISDAC2D, (green >> 8));
@@ -1461,317 +1483,250 @@ static int sisfb_setcolreg(unsigned regno, unsigned red, unsigned green, unsigne
 #endif
 #ifdef FBCON_HAS_CFB16
 	case 16:
-		sis_fbcon_cmap.cfb16[regno] =
+		ivideo->sis_fbcon_cmap.cfb16[regno] =
 		    ((red & 0xf800)) | ((green & 0xfc00) >> 5) | ((blue & 0xf800) >> 11);
 		break;
 #endif
 #ifdef FBCON_HAS_CFB32
 	case 32:
-		red >>= 8;
+		red   >>= 8;
 		green >>= 8;
-		blue >>= 8;
-		sis_fbcon_cmap.cfb32[regno] = (red << 16) | (green << 8) | (blue);
+		blue  >>= 8;
+		ivideo->sis_fbcon_cmap.cfb32[regno] = (red << 16) | (green << 8) | (blue);
 		break;
 #endif
 	}
+
 	return 0;
 }
 
-static void sisfb_set_disp(int con, struct fb_var_screeninfo *var,
-                           struct fb_info *info)
+static void
+sisfb_set_disp(int con, struct fb_var_screeninfo *var, struct fb_info *info)
 {
+	struct sis_video_info    *ivideo = (struct sis_video_info *)info->par;
+	struct display           *display;
+	struct display_switch    *sw;
 	struct fb_fix_screeninfo fix;
 	long   flags;
-	struct display *display;
-	struct display_switch *sw;
 
-	if(con >= 0)
-		display = &fb_display[con];
-	else
-		display = &sis_disp;
+	display = (con >= 0) ? &fb_display[con] : &ivideo->sis_disp;
 
-	sisfb_get_fix(&fix, con, 0);
+	sisfb_get_fix(&fix, con, info);
 
-	display->screen_base = ivideo.video_vbase;
+	display->var = *var;
+	display->screen_base = (char *)ivideo->video_vbase;
 	display->visual = fix.visual;
 	display->type = fix.type;
 	display->type_aux = fix.type_aux;
 	display->ypanstep = fix.ypanstep;
 	display->ywrapstep = fix.ywrapstep;
 	display->line_length = fix.line_length;
-	display->next_line = fix.line_length;
 	display->can_soft_blank = 1;
-	display->inverse = sisfb_inverse;
-	display->var = *var;
+	display->inverse = ivideo->sisfb_inverse;
+	display->next_line = fix.line_length;
 
 	save_flags(flags);
 
-	switch (ivideo.video_bpp) {
+	switch(ivideo->video_bpp) {
 #ifdef FBCON_HAS_CFB8
-	   case 8:
-#ifdef SISFBACCEL
-		sw = ivideo.accel ? &fbcon_sis8 : &fbcon_cfb8;
-#else
-		sw = &fbcon_cfb8;
-#endif
+	case 8:	sw = ivideo->accel ? &fbcon_sis8 : &fbcon_cfb8;
 		break;
 #endif
 #ifdef FBCON_HAS_CFB16
-	   case 16:
-#ifdef SISFBACCEL
-		sw = ivideo.accel ? &fbcon_sis16 : &fbcon_cfb16;
-#else
-		sw = &fbcon_cfb16;
-#endif
-		display->dispsw_data = sis_fbcon_cmap.cfb16;
+	case 16:sw = ivideo->accel ? &fbcon_sis16 : &fbcon_cfb16;
+		display->dispsw_data = &ivideo->sis_fbcon_cmap.cfb16;
 		break;
 #endif
 #ifdef FBCON_HAS_CFB32
-	   case 32:
-#ifdef SISFBACCEL
-		sw = ivideo.accel ? &fbcon_sis32 : &fbcon_cfb32;
-#else
-		sw = &fbcon_cfb32;
-#endif
-		display->dispsw_data = sis_fbcon_cmap.cfb32;
+	case 32:sw = ivideo->accel ? &fbcon_sis32 : &fbcon_cfb32;
+		display->dispsw_data = &ivideo->sis_fbcon_cmap.cfb32;
 		break;
 #endif
-	   default:
-		sw = &fbcon_dummy;
-		return;
+	default:sw = &fbcon_dummy;
+		break;
 	}
-	memcpy(&sisfb_sw, sw, sizeof(*sw));
-	display->dispsw = &sisfb_sw;
+	memcpy(&ivideo->sisfb_sw, sw, sizeof(*sw));
+	display->dispsw = &ivideo->sisfb_sw;
+
 	restore_flags(flags);
 
-        if(sisfb_ypan) {
+        if(ivideo->sisfb_ypan) {
   	    /* display->scrollmode = 0;  */
 	} else {
 	    display->scrollmode = SCROLL_YREDRAW;
-	    sisfb_sw.bmove = fbcon_redraw_bmove;
+	    ivideo->sisfb_sw.bmove = fbcon_redraw_bmove;
 	}
 }
 
-static void sisfb_do_install_cmap(int con, struct fb_info *info)
+static void
+sisfb_do_install_cmap(int con, struct fb_info *info)
 {
-        if (con != currcon)
-		return;
+	struct sis_video_info *ivideo = (struct sis_video_info *)info->par;
 
-        if (fb_display[con].cmap.len)
-		fb_set_cmap(&fb_display[con].cmap, 1, sisfb_setcolreg, info);
-        else
-		fb_set_cmap(fb_default_cmap(ivideo.video_cmap_len), 1,
-			    sisfb_setcolreg, info);
-}
+        if(con != ivideo->currcon) return;
 
+        if(fb_display[con].cmap.len) {
+		fb_set_cmap(&fb_display[con].cmap, sisfb_setcolreg, info);
+        } else {
+		int size = sisfb_get_cmap_len(&fb_display[con].var);
+		fb_set_cmap(fb_default_cmap(size), sisfb_setcolreg, info);
+	}
+}
 
-static int sisfb_get_var(struct fb_var_screeninfo *var, int con,
-			 struct fb_info *info)
+static int
+sisfb_get_var(struct fb_var_screeninfo *var, int con, struct fb_info *info)
 {
-	if(con == -1)
-		memcpy(var, &default_var, sizeof(struct fb_var_screeninfo));
-	else
+	struct sis_video_info *ivideo = (struct sis_video_info *)info->par;
+
+	if(con == -1) {
+		memcpy(var, &ivideo->default_var, sizeof(struct fb_var_screeninfo));
+	} else {
 		*var = fb_display[con].var;
+	}
 
-	if(sisfb_fstn) {
-	   if (var->xres == 320 && var->yres == 480)
-		var->yres = 240;
+	if(ivideo->sisfb_fstn) {
+	   	if(var->xres == 320 && var->yres == 480) var->yres = 240;
         }
 
 	return 0;
 }
 
-static int sisfb_set_var(struct fb_var_screeninfo *var, int con,
-			 struct fb_info *info)
+static int
+sisfb_set_var(struct fb_var_screeninfo *var, int con, struct fb_info *info)
 {
+	struct sis_video_info *ivideo = (struct sis_video_info *)info->par;
 	int err;
-	unsigned int cols, rows;
 
 	fb_display[con].var.activate = FB_ACTIVATE_NOW;
-        if(sisfb_do_set_var(var, con == currcon, info)) {
-		sisfb_crtc_to_var(var);
+
+        if(sisfb_do_set_var(var, con == ivideo->currcon, info)) {
+		sisfb_crtc_to_var(ivideo, var);
 		return -EINVAL;
 	}
 
-	sisfb_crtc_to_var(var);
+	sisfb_crtc_to_var(ivideo, var);
 
 	sisfb_set_disp(con, var, info);
 
-	if(info->changevar)
-		(*info->changevar) (con);
+	if(info->changevar) {
+		(*info->changevar)(con);
+	}
 
-	if((err = fb_alloc_cmap(&fb_display[con].cmap, 0, 0)))
+	if((err = fb_alloc_cmap(&fb_display[con].cmap, 0, 0))) {
 		return err;
+	}
 
 	sisfb_do_install_cmap(con, info);
 
-	cols = sisbios_mode[sisfb_mode_idx].cols;
-	rows = sisbios_mode[sisfb_mode_idx].rows;
-#if 0
-	/* Why was this called here? */
+#if 0	/* Why was this called here? */
+	unsigned int cols, rows;
+	cols = sisbios_mode[ivideo->sisfb_mode_idx].cols;
+	rows = sisbios_mode[ivideo->sisfb_mode_idx].rows;
  	vc_resize_con(rows, cols, fb_display[con].conp->vc_num);
 #endif
-
 	return 0;
 }
 
-static int sisfb_get_cmap(struct fb_cmap *cmap, int kspc, int con,
-			  struct fb_info *info)
+static int
+sisfb_get_cmap(struct fb_cmap *cmap, int kspc, int con, struct fb_info *info)
 {
-        if (con == currcon)
+	struct sis_video_info *ivideo = (struct sis_video_info *)info->par;
+	struct display *display;
+
+	display = (con >= 0) ? &fb_display[con] : &ivideo->sis_disp;
+
+        if(con == ivideo->currcon) {
+
 		return fb_get_cmap(cmap, kspc, sis_getcolreg, info);
 
-	else if (fb_display[con].cmap.len)
-		fb_copy_cmap(&fb_display[con].cmap, cmap, kspc ? 0 : 2);
-	else
-		fb_copy_cmap(fb_default_cmap(ivideo.video_cmap_len), cmap, kspc ? 0 : 2);
+	} else if(display->cmap.len) {
 
-	return 0;
-}
+		fb_copy_cmap(&display->cmap, cmap, kspc ? 0 : 2);
 
-static int sisfb_set_cmap(struct fb_cmap *cmap, int kspc, int con,
-			  struct fb_info *info)
-{
-	int err;
+	} else {
 
-	if (!fb_display[con].cmap.len) {
-		err = fb_alloc_cmap(&fb_display[con].cmap, ivideo.video_cmap_len, 0);
-		if (err)
-			return err;
-	}
-        
-	if (con == currcon)
-		return fb_set_cmap(cmap, kspc, sisfb_setcolreg, info);
+		int size = sisfb_get_cmap_len(&display->var);
+		fb_copy_cmap(fb_default_cmap(size), cmap, kspc ? 0 : 2);
 
-	else
-		fb_copy_cmap(cmap, &fb_display[con].cmap, kspc ? 0 : 1);
+	}
 
 	return 0;
 }
 
-static int sisfb_pan_display(struct fb_var_screeninfo *var, int con,
-			     struct fb_info* info)
+static int
+sisfb_set_cmap(struct fb_cmap *cmap, int kspc, int con, struct fb_info *info)
 {
-	int err;
+	struct sis_video_info *ivideo = (struct sis_video_info *)info->par;
+	struct display *display;
+	int err, size;
 
-	if (var->vmode & FB_VMODE_YWRAP) {
-		if (var->yoffset < 0 || var->yoffset >= fb_display[con].var.yres_virtual || var->xoffset)
-			return -EINVAL;
-	} else {
-		if (var->xoffset+fb_display[con].var.xres > fb_display[con].var.xres_virtual ||
-		    var->yoffset+fb_display[con].var.yres > fb_display[con].var.yres_virtual)
-			return -EINVAL;
-	}
+	display = (con >= 0) ? &fb_display[con] : &ivideo->sis_disp;
 
-        if(con == currcon) {
-	   if((err = sisfb_pan_var(var)) < 0) return err;
+	size = sisfb_get_cmap_len(&display->var);
+	if(display->cmap.len != size) {
+		err = fb_alloc_cmap(&display->cmap, size, 0);
+		if(err)	return err;
+	}
+        
+	if(con == ivideo->currcon) {
+		return fb_set_cmap(cmap, kspc, sisfb_setcolreg, info);
+	} else {
+		fb_copy_cmap(cmap, &display->cmap, kspc ? 0 : 1);
 	}
-
-	fb_display[con].var.xoffset = var->xoffset;
-	fb_display[con].var.yoffset = var->yoffset;
-	if (var->vmode & FB_VMODE_YWRAP)
-		fb_display[con].var.vmode |= FB_VMODE_YWRAP;
-	else
-		fb_display[con].var.vmode &= ~FB_VMODE_YWRAP;
 
 	return 0;
 }
 
-static int sisfb_mmap(struct fb_info *info, struct file *file,
-		      struct vm_area_struct *vma)
+static int
+sisfb_pan_display(struct fb_var_screeninfo *var, int con, struct fb_info* info)
 {
-	struct fb_var_screeninfo var;
-	unsigned long start;
-	unsigned long off;
-	u32 len, mmio_off;
-
-	if(vma->vm_pgoff > (~0UL >> PAGE_SHIFT))  return -EINVAL;
-
-	off = vma->vm_pgoff << PAGE_SHIFT;
+	struct sis_video_info *ivideo = (struct sis_video_info *)info->par;
+	int err;
 
-	start = (unsigned long) ivideo.video_base;
-	len = PAGE_ALIGN((start & ~PAGE_MASK) + ivideo.video_size);
-#if 0
-	if (off >= len) {
-		off -= len;
-#endif
-	/* By Jake Page: Treat mmap request with offset beyond heapstart
-	 *               as request for mapping the mmio area 
-	 */
-	mmio_off = PAGE_ALIGN((start & ~PAGE_MASK) + ivideo.heapstart);
-	if(off >= mmio_off) {
-		off -= mmio_off;		
-		sisfb_get_var(&var, currcon, info);
-		if(var.accel_flags) return -EINVAL;
+	if(var->vmode & FB_VMODE_YWRAP) return -EINVAL;
 
-		start = (unsigned long) ivideo.mmio_base;
-		len = PAGE_ALIGN((start & ~PAGE_MASK) + sisfb_mmio_size);
+	if((var->xoffset+fb_display[con].var.xres > fb_display[con].var.xres_virtual) ||
+	   (var->yoffset+fb_display[con].var.yres > fb_display[con].var.yres_virtual)) {
+		return -EINVAL;
 	}
 
-	start &= PAGE_MASK;
-	if((vma->vm_end - vma->vm_start + off) > len)	return -EINVAL;
-
-	off += start;
-	vma->vm_pgoff = off >> PAGE_SHIFT;
-	vma->vm_flags |= VM_IO;   /* by Jake Page; is that really needed? */
+        if(con == ivideo->currcon) {
+	   	if((err = sisfb_pan_var(ivideo, var)) < 0) return err;
+	}
 
-#if defined(__i386__) || defined(__x86_64__)
-	if (boot_cpu_data.x86 > 3)
-		pgprot_val(vma->vm_page_prot) |= _PAGE_PCD;
-#endif
-        /* RedHat requires vma as the first paramater to the following call */
-	if (io_remap_page_range(vma->vm_start, off, vma->vm_end - vma->vm_start,
-				vma->vm_page_prot))
-		return -EAGAIN;
+	fb_display[con].var.xoffset = var->xoffset;
+	fb_display[con].var.yoffset = var->yoffset;
 
 	return 0;
 }
 
-static void sis_get_glyph(struct fb_info *info, SIS_GLYINFO *gly)
+static int
+sisfb_update_var(int con, struct fb_info *info)
 {
-	struct display *p = &fb_display[currcon];
-	u16 c;
-	u8 *cdat;
-	int widthb;
-	u8 *gbuf = gly->gmask;
-	int size;
-
-	gly->fontheight = fontheight(p);
-	gly->fontwidth = fontwidth(p);
-	widthb = (fontwidth(p) + 7) / 8;
-
-	c = gly->ch & p->charmask;
-	if (fontwidth(p) <= 8)
-		cdat = p->fontdata + c * fontheight(p);
-	else
-		cdat = p->fontdata + (c * fontheight(p) << 1);
-
-	size = fontheight(p) * widthb;
-	memcpy(gbuf, cdat, size);
-	gly->ngmask = size;
-}
+	struct sis_video_info *ivideo = (struct sis_video_info *)info->par;
 
-static int sisfb_update_var(int con, struct fb_info *info)
-{
-        return(sisfb_pan_var(&fb_display[con].var));
+        return(sisfb_pan_var(ivideo, &fb_display[con].var));
 }
 
-static int sisfb_switch(int con, struct fb_info *info)
+static int
+sisfb_switch(int con, struct fb_info *info)
 {
+	struct sis_video_info *ivideo = (struct sis_video_info *)info->par;
 	int cols, rows;
 
-        if(fb_display[currcon].cmap.len)
-		fb_get_cmap(&fb_display[currcon].cmap, 1, sis_getcolreg, info);
+        if(fb_display[ivideo->currcon].cmap.len) {
+		fb_get_cmap(&fb_display[ivideo->currcon].cmap, 1, sis_getcolreg, info);
+	}
 
 	fb_display[con].var.activate = FB_ACTIVATE_NOW;
 
-	if(!memcmp(&fb_display[con].var, &fb_display[currcon].var,
-	                           sizeof(struct fb_var_screeninfo))) {
-		currcon = con;
+	if(!memcmp(&fb_display[con].var, &fb_display[ivideo->currcon].var,
+	                           	sizeof(struct fb_var_screeninfo))) {
+		ivideo->currcon = con;
 		return 1;
 	}
 
-	currcon = con;
+	ivideo->currcon = con;
 
 	sisfb_do_set_var(&fb_display[con].var, 1, info);
 
@@ -1779,8 +1734,8 @@ static int sisfb_switch(int con, struct fb_info *info)
 
 	sisfb_do_install_cmap(con, info);
 
-	cols = sisbios_mode[sisfb_mode_idx].cols;
-	rows = sisbios_mode[sisfb_mode_idx].rows;
+	cols = sisbios_mode[ivideo->sisfb_mode_idx].cols;
+	rows = sisbios_mode[ivideo->sisfb_mode_idx].rows;
 	vc_resize_con(rows, cols, fb_display[con].conp->vc_num);
 
 	sisfb_update_var(con, info);
@@ -1788,55 +1743,46 @@ static int sisfb_switch(int con, struct fb_info *info)
 	return 1;
 }
 
-static void sisfb_blank(int blank, struct fb_info *info)
+static void
+sisfb_blank(int blank, struct fb_info *info)
 {
-	sisfb_myblank(blank);
+	struct sis_video_info *ivideo = (struct sis_video_info *)info->par;
+
+	sisfb_myblank(ivideo, blank);
 }
 #endif
 
-/* ------------ FBDev related routines for 2.5 series ----------- */
+/* ------------ FBDev related routines for 2.6 series ----------- */
 
 #if LINUX_VERSION_CODE >= KERNEL_VERSION(2,5,0)
 
-static int sisfb_open(struct fb_info *info, int user)
+static int
+sisfb_open(struct fb_info *info, int user)
 {
-    return 0;
+    	return 0;
 }
 
-static int sisfb_release(struct fb_info *info, int user)
+static int
+sisfb_release(struct fb_info *info, int user)
 {
-    return 0;
+    	return 0;
 }
 
-static int sisfb_get_cmap_len(const struct fb_var_screeninfo *var)
+static int
+sisfb_setcolreg(unsigned regno, unsigned red, unsigned green, unsigned blue,
+		unsigned transp, struct fb_info *info)
 {
-	int rc = 16;		
-
-	switch(var->bits_per_pixel) {
-	case 8:
-		rc = 256;	
-		break;
-	case 16:
-	case 32:
-		rc = 16;
-		break;
-	}
-	return rc;
-}
+	struct sis_video_info *ivideo = (struct sis_video_info *)info->par;
 
-static int sisfb_setcolreg(unsigned regno, unsigned red, unsigned green, unsigned blue,
-                           unsigned transp, struct fb_info *info)
-{
-	if (regno >= sisfb_get_cmap_len(&info->var))
-		return 1;
+	if(regno >= sisfb_get_cmap_len(&info->var)) return 1;
 
-	switch (info->var.bits_per_pixel) {
+	switch(info->var.bits_per_pixel) {
 	case 8:
 	        outSISREG(SISDACA, regno);
 		outSISREG(SISDACD, (red >> 10));
 		outSISREG(SISDACD, (green >> 10));
 		outSISREG(SISDACD, (blue >> 10));
-		if (ivideo.currentvbflags & VB_DISPTYPE_DISP2) {
+		if(ivideo->currentvbflags & VB_DISPTYPE_DISP2) {
 		        outSISREG(SISDAC2A, regno);
 			outSISREG(SISDAC2D, (red >> 8));
 			outSISREG(SISDAC2D, (green >> 8));
@@ -1851,28 +1797,31 @@ static int sisfb_setcolreg(unsigned regno, unsigned red, unsigned green, unsigne
 		red >>= 8;
 		green >>= 8;
 		blue >>= 8;
-		((u32 *) (info->pseudo_palette))[regno] =
-			(red << 16) | (green << 8) | (blue);
+		((u32 *)(info->pseudo_palette))[regno] =
+				(red << 16) | (green << 8) | (blue);
 		break;
 	}
 	return 0;
 }
 
-static int sisfb_set_par(struct fb_info *info)
+static int
+sisfb_set_par(struct fb_info *info)
 {
 	int err;
 
-        if((err = sisfb_do_set_var(&info->var, 1, info)))
+        if((err = sisfb_do_set_var(&info->var, 1, info))) {
 		return err;
+	}
 
 	sisfb_get_fix(&info->fix, info->currcon, info);
 
 	return 0;
 }
 
-static int sisfb_check_var(struct fb_var_screeninfo *var,
-                           struct fb_info *info)
+static int
+sisfb_check_var(struct fb_var_screeninfo *var, struct fb_info *info)
 {
+	struct sis_video_info *ivideo = (struct sis_video_info *)info->par;
 	unsigned int htotal = 0, vtotal = 0, myrateindex = 0;
 	unsigned int drate = 0, hrate = 0, maxyres;
 	int found_mode = 0;
@@ -1902,12 +1851,12 @@ static int sisfb_check_var(struct fb_var_screeninfo *var,
 	}
 
 	search_idx = 0;
-	while( (sisbios_mode[search_idx].mode_no != 0) &&
+	while( (sisbios_mode[search_idx].mode_no[0] != 0) &&
 	       (sisbios_mode[search_idx].xres <= var->xres) ) {
 		if( (sisbios_mode[search_idx].xres == var->xres) &&
 		    (sisbios_mode[search_idx].yres == var->yres) &&
 		    (sisbios_mode[search_idx].bpp == var->bits_per_pixel)) {
-		        if(sisfb_validate_mode(search_idx, ivideo.currentvbflags) > 0) {
+		        if(sisfb_validate_mode(ivideo, search_idx, ivideo->currentvbflags) > 0) {
 			   found_mode = 1;
 			   break;
 			}
@@ -1916,13 +1865,12 @@ static int sisfb_check_var(struct fb_var_screeninfo *var,
 	}
 
 	if(!found_mode) {
-
                 search_idx = 0;
-		while(sisbios_mode[search_idx].mode_no != 0) {
+		while(sisbios_mode[search_idx].mode_no[0] != 0) {
 		   if( (var->xres <= sisbios_mode[search_idx].xres) &&
 		       (var->yres <= sisbios_mode[search_idx].yres) &&
 		       (var->bits_per_pixel == sisbios_mode[search_idx].bpp) ) {
-		          if(sisfb_validate_mode(search_idx, ivideo.currentvbflags) > 0) {
+		          if(sisfb_validate_mode(ivideo,search_idx, ivideo->currentvbflags) > 0) {
 			     found_mode = 1;
 			     break;
 			  }
@@ -1946,24 +1894,25 @@ static int sisfb_check_var(struct fb_var_screeninfo *var,
 		}
 	}
 
-	if( ((ivideo.vbflags & VB_LVDS) ||			/* Slave modes on LVDS and 301B-DH */
-	     ((ivideo.vbflags & VB_30xBDH) && (ivideo.currentvbflags & CRT2_LCD))) &&
+	if( ((ivideo->vbflags & VB_LVDS) ||			/* Slave modes on LVDS and 301B-DH */
+	     ((ivideo->vbflags & VB_30xBDH) && (ivideo->currentvbflags & CRT2_LCD))) &&
 	    (var->bits_per_pixel == 8) ) {
 	    	refresh_rate = 60;
 		recalc_clock = TRUE;
-	} else if( (ivideo.current_htotal == htotal) &&		/* x=x & y=y & c=c -> assume depth change */
-	    	   (ivideo.current_vtotal == vtotal) &&
-	    	   (ivideo.current_pixclock == pixclock) ) {
+	} else if( (ivideo->current_htotal == htotal) &&	/* x=x & y=y & c=c -> assume depth change */
+	    	   (ivideo->current_vtotal == vtotal) &&
+	    	   (ivideo->current_pixclock == pixclock) ) {
 		drate = 1000000000 / pixclock;
 	        hrate = (drate * 1000) / htotal;
 	        refresh_rate = (unsigned int) (hrate * 2 / vtotal);
-	} else if( ( (ivideo.current_htotal != htotal) ||	/* x!=x | y!=y & c=c -> invalid pixclock */
-	    	     (ivideo.current_vtotal != vtotal) ) &&
-	    	   (ivideo.current_pixclock == var->pixclock) ) {
-		if(sisfb_lastrates[sisbios_mode[search_idx].mode_no]) {
-			refresh_rate = sisfb_lastrates[sisbios_mode[search_idx].mode_no];
-		} else if(sisfb_parm_rate != -1) {
-			refresh_rate = sisfb_parm_rate;
+	} else if( ( (ivideo->current_htotal != htotal) ||	/* x!=x | y!=y & c=c -> invalid pixclock */
+	    	     (ivideo->current_vtotal != vtotal) ) &&
+	    	   (ivideo->current_pixclock == var->pixclock) ) {
+		if(ivideo->sisfb_lastrates[sisbios_mode[search_idx].mode_no[ivideo->mni]]) {
+			refresh_rate = ivideo->sisfb_lastrates[sisbios_mode[search_idx].mode_no[ivideo->mni]];
+		} else if(ivideo->sisfb_parm_rate != -1) {
+			/* Sic, sisfb_parm_rate - want to know originally desired rate here */
+			refresh_rate = ivideo->sisfb_parm_rate;
 		} else {
 			refresh_rate = 60;
 		}
@@ -1972,56 +1921,51 @@ static int sisfb_check_var(struct fb_var_screeninfo *var,
 		drate = 1000000000 / pixclock;
 	   	hrate = (drate * 1000) / htotal;
 	   	refresh_rate = (unsigned int) (hrate * 2 / vtotal);
-	} else if(ivideo.current_refresh_rate) {
-		refresh_rate = ivideo.current_refresh_rate;
+	} else if(ivideo->current_refresh_rate) {
+		refresh_rate = ivideo->current_refresh_rate;
 		recalc_clock = TRUE;
 	} else {
 		refresh_rate = 60;
 		recalc_clock = TRUE;
 	}
 
-	myrateindex = sisfb_search_refresh_rate(refresh_rate, search_idx);
+	myrateindex = sisfb_search_refresh_rate(ivideo, refresh_rate, search_idx);
 
 	/* Eventually recalculate timing and clock */
 	if(recalc_clock) {
 	   if(!myrateindex) myrateindex = sisbios_mode[search_idx].rate_idx;
-	   var->pixclock = (u32) (1000000000 / sisfb_mode_rate_to_dclock(&SiS_Pr, &sishw_ext,
-						sisbios_mode[search_idx].mode_no, myrateindex));
-	   sisfb_mode_rate_to_ddata(&SiS_Pr, &sishw_ext,
-		 			sisbios_mode[search_idx].mode_no, myrateindex,
-		 			&var->left_margin, &var->right_margin,
-		 			&var->upper_margin, &var->lower_margin,
-		 			&var->hsync_len, &var->vsync_len,
-		 			&var->sync, &var->vmode);
+	   var->pixclock = (u32) (1000000000 / sisfb_mode_rate_to_dclock(&ivideo->SiS_Pr,
+	   					&ivideo->sishw_ext,
+						sisbios_mode[search_idx].mode_no[ivideo->mni],
+						myrateindex));
+	   sisfb_mode_rate_to_ddata(&ivideo->SiS_Pr, &ivideo->sishw_ext,
+		 		    sisbios_mode[search_idx].mode_no[ivideo->mni], myrateindex,	var);
 	   if((var->vmode & FB_VMODE_MASK) == FB_VMODE_DOUBLE) {
-		var->pixclock <<= 1;
+	      var->pixclock <<= 1;
 	   }
 	}
 
-	if(sisfb_thismonitor.datavalid) {
-	   if(!sisfb_verify_rate(&sisfb_thismonitor, search_idx,
+	if(ivideo->sisfb_thismonitor.datavalid) {
+	   if(!sisfb_verify_rate(ivideo, &ivideo->sisfb_thismonitor, search_idx,
 	                         myrateindex, refresh_rate)) {
 	      printk(KERN_INFO "sisfb: WARNING: Refresh rate exceeds monitor specs!\n");
 	   }
 	}
 
 	/* Adapt RGB settings */
-	sisfb_bpp_to_var(var);	
+	sisfb_bpp_to_var(ivideo, var);
 	
 	/* Sanity check for offsets */
-	if (var->xoffset < 0)
-		var->xoffset = 0;
-	if (var->yoffset < 0)
-		var->yoffset = 0;
+	if(var->xoffset < 0) var->xoffset = 0;
+	if(var->yoffset < 0) var->yoffset = 0;
 
-	/* Horiz-panning not supported */
-	if(var->xres != var->xres_virtual)
-		var->xres_virtual = var->xres;
+	if(var->xres > var->xres_virtual) {
+	   var->xres_virtual = var->xres;
+	}
 
-	if(sisfb_ypan) {
-	   maxyres = ivideo.heapstart / (var->xres * (var->bits_per_pixel >> 3));
-	   if(maxyres > 32767) maxyres = 32767;
-	   if(sisfb_max) {
+	if(ivideo->sisfb_ypan) {
+	   maxyres = sisfb_calc_maxyres(ivideo, var);
+	   if(ivideo->sisfb_max) {
 	      var->yres_virtual = maxyres;
 	   } else {
 	      if(var->yres_virtual > maxyres) {
@@ -2040,310 +1984,241 @@ static int sisfb_check_var(struct fb_var_screeninfo *var,
 	}
 	
 	/* Truncate offsets to maximum if too high */
-	if(var->xoffset > var->xres_virtual - var->xres)
-		var->xoffset = var->xres_virtual - var->xres - 1;
+	if(var->xoffset > var->xres_virtual - var->xres) {
+	   var->xoffset = var->xres_virtual - var->xres - 1;
+	}
 
-	if(var->yoffset > var->yres_virtual - var->yres)
-		var->yoffset = var->yres_virtual - var->yres - 1;
+	if(var->yoffset > var->yres_virtual - var->yres) {
+	   var->yoffset = var->yres_virtual - var->yres - 1;
+	}
 	
 	/* Set everything else to 0 */
 	var->red.msb_right = 
-	    var->green.msb_right =
-	    var->blue.msb_right =
-	    var->transp.offset = var->transp.length = var->transp.msb_right = 0;		
+	var->green.msb_right =
+	var->blue.msb_right =
+	var->transp.offset =
+	var->transp.length =
+	var->transp.msb_right = 0;
 
 	return 0;
 }
 
-static int sisfb_pan_display(struct fb_var_screeninfo *var,
-			     struct fb_info* info)
+static int
+sisfb_pan_display(struct fb_var_screeninfo *var, struct fb_info* info)
 {
+	struct sis_video_info *ivideo = (struct sis_video_info *)info->par;
 	int err;
 
-	if (var->xoffset > (var->xres_virtual - var->xres))
+	if(var->xoffset > (var->xres_virtual - var->xres)) {
 		return -EINVAL;
-	if (var->yoffset > (var->yres_virtual - var->yres))
+	}
+	if(var->yoffset > (var->yres_virtual - var->yres)) {
 		return -EINVAL;
-
-	if (var->vmode & FB_VMODE_YWRAP) {
-		if (var->yoffset < 0 ||
-		    var->yoffset >= info->var.yres_virtual ||
-		    var->xoffset)
-		    	return -EINVAL;
-	} else {
-		if (var->xoffset + info->var.xres > info->var.xres_virtual ||
-		    var->yoffset + info->var.yres > info->var.yres_virtual)
-			return -EINVAL;
 	}
-    
-	if((err = sisfb_pan_var(var)) < 0) return err;
-
-	info->var.xoffset = var->xoffset;
-	info->var.yoffset = var->yoffset;
-	if (var->vmode & FB_VMODE_YWRAP)
-		info->var.vmode |= FB_VMODE_YWRAP;
-	else
-		info->var.vmode &= ~FB_VMODE_YWRAP;
-
-	return 0;
-}
-
-static int sisfb_mmap(struct fb_info *info, struct file *file,
-		      struct vm_area_struct *vma)
-{
-	unsigned long start;
-	unsigned long off;
-	u32 len, mmio_off;
-
-	if(vma->vm_pgoff > (~0UL >> PAGE_SHIFT))  return -EINVAL;
 
-	off = vma->vm_pgoff << PAGE_SHIFT;
+	if(var->vmode & FB_VMODE_YWRAP) return -EINVAL;
 
-	start = (unsigned long) ivideo.video_base;
-	len = PAGE_ALIGN((start & ~PAGE_MASK) + ivideo.video_size);
-#if 0
-	if (off >= len) {
-		off -= len;
-#endif
-	/* By Jake Page: Treat mmap request with offset beyond heapstart
-	 *               as request for mapping the mmio area 
-	 */
-	mmio_off = PAGE_ALIGN((start & ~PAGE_MASK) + ivideo.heapstart);
-	if(off >= mmio_off) {
-		off -= mmio_off;		
-		if(info->var.accel_flags) return -EINVAL;
-
-		start = (unsigned long) ivideo.mmio_base;
-		len = PAGE_ALIGN((start & ~PAGE_MASK) + sisfb_mmio_size);
+	if(var->xoffset + info->var.xres > info->var.xres_virtual ||
+	   var->yoffset + info->var.yres > info->var.yres_virtual) {
+		return -EINVAL;
 	}
 
-	start &= PAGE_MASK;
-	if((vma->vm_end - vma->vm_start + off) > len)	return -EINVAL;
-
-	off += start;
-	vma->vm_pgoff = off >> PAGE_SHIFT;
-	vma->vm_flags |= VM_IO;   /* by Jake Page; is that really needed? */
+	if((err = sisfb_pan_var(ivideo, var)) < 0) return err;
 
-#if defined(__i386__) || defined(__x86_64__)
-	if (boot_cpu_data.x86 > 3)
-		pgprot_val(vma->vm_page_prot) |= _PAGE_PCD;
-#endif
-	if (io_remap_page_range(vma, vma->vm_start, off, vma->vm_end - vma->vm_start,
-				vma->vm_page_prot))
-		return -EAGAIN;
+	info->var.xoffset = var->xoffset;
+	info->var.yoffset = var->yoffset;
 
 	return 0;
 }
 
-static int sisfb_blank(int blank, struct fb_info *info)
+static int
+sisfb_blank(int blank, struct fb_info *info)
 {
-	return(sisfb_myblank(blank));
+	struct sis_video_info *ivideo = (struct sis_video_info *)info->par;
+
+	return(sisfb_myblank(ivideo, blank));
 }
 
 #endif
 
 /* ----------- FBDev related routines for all series ---------- */
 
-
-#if LINUX_VERSION_CODE >= KERNEL_VERSION(2,5,0)
-static int sisfb_ioctl(struct inode *inode, struct file *file,
-		       unsigned int cmd, unsigned long arg,
-		       struct fb_info *info)
-#else
-static int sisfb_ioctl(struct inode *inode, struct file *file,
-		       unsigned int cmd, unsigned long arg, int con,
-		       struct fb_info *info)
-#endif
-{
-	struct sis_memreq sismemreq;
-	struct ap_data sisapdata;
-	unsigned long sismembase = 0;
+static int
+sisfb_ioctl(struct inode *inode, struct file *file,
+            unsigned int cmd, unsigned long arg,
 #if LINUX_VERSION_CODE < KERNEL_VERSION(2,5,0)
-	SIS_GLYINFO sisglyinfo;
+	    int con,
 #endif
+	    struct fb_info *info)
+{
+	struct sis_video_info 	*ivideo = (struct sis_video_info *)info->par;
+	struct sis_memreq 	sismemreq;
+	struct fb_vblank  	sisvbblank;
+	sisfb_info        	x;
+	u32			gpu32 = 0;
+	static int 		count = 0;
+	u32 __user		*argp = (u32 __user *) arg;
 
 	switch (cmd) {
 	   case FBIO_ALLOC:
-		if(!capable(CAP_SYS_RAWIO))
+		if(!capable(CAP_SYS_RAWIO)) {
 			return -EPERM;
-		if(copy_from_user(&sismemreq, (void *)arg, sizeof(sismemreq)))
+		}
+		if(copy_from_user(&sismemreq, argp, sizeof(sismemreq))) {
 		   	return -EFAULT;
+		}
         	sis_malloc(&sismemreq);
-		if(copy_to_user((void *)arg, &sismemreq, sizeof(sismemreq))) {
-			sis_free(sismemreq.offset);
+		if(copy_to_user(argp, &sismemreq, sizeof(sismemreq))) {
+			sis_free((u32)sismemreq.offset);
 		    	return -EFAULT;
 		}
 		break;
+
 	   case FBIO_FREE:
-		if(!capable(CAP_SYS_RAWIO))
+		if(!capable(CAP_SYS_RAWIO)) {
 			return -EPERM;
-		if(get_user(sismembase, (unsigned long *) arg))
+		}
+		if(get_user(gpu32, argp)) {
 			return -EFAULT;
-		sis_free(sismembase);
+		}
+		sis_free(gpu32);
 		break;
-#if LINUX_VERSION_CODE < KERNEL_VERSION(2,5,0)
-	   case FBIOGET_GLYPH:
-	        if(copy_from_user(&sisglyinfo, (void *)arg, sizeof(sisglyinfo)))
+
+	   case FBIOGET_VBLANK:
+		sisvbblank.count = 0;
+		sisvbblank.flags = sisfb_setupvbblankflags(ivideo, &sisvbblank.vcount, &sisvbblank.hcount);
+		if(copy_to_user(argp, &sisvbblank, sizeof(sisvbblank))) {
 			return -EFAULT;
-                sis_get_glyph(info, &sisglyinfo);
-		break;
-	   case FBIOPUT_MODEINFO:
-		{
-			struct mode_info x;
-
-			if(copy_from_user(&x, (void *)arg, sizeof(x)))
-				return -EFAULT;
-
-			ivideo.video_bpp        = x.bpp;
-			ivideo.video_width      = x.xres;
-			ivideo.video_height     = x.yres;
-			ivideo.video_vwidth     = x.v_xres;
-			ivideo.video_vheight    = x.v_yres;
-			ivideo.org_x            = x.org_x;
-			ivideo.org_y            = x.org_y;
-			ivideo.refresh_rate     = x.vrate;
-			ivideo.video_linelength = ivideo.video_vwidth * (ivideo.video_bpp >> 3);
-			sisfb_set_vparms();
-			break;
 		}
-#endif
-	   case FBIOGET_HWCINFO:
-		{
-			unsigned long myhwcoffset = 0;
-
-			if(sisfb_caps & HW_CURSOR_CAP)
-				myhwcoffset = sisfb_hwcursor_vbase -
-				    (unsigned long) ivideo.video_vbase;
+		break;
 
-			return put_user(myhwcoffset, (unsigned long *)arg);
+	   case SISFB_GET_INFO_SIZE:
+	        return put_user(sizeof(sisfb_info), argp);
 
-			break;
+	   case SISFB_GET_INFO_OLD:
+	        if(++count < 50) {
+	           printk(KERN_INFO "sisfb: Deprecated ioctl call received - update your application!\n");
 		}
-	   case FBIOGET_DISPINFO:
-	   	sis_dispinfo(&sisapdata);
-		if(copy_to_user((void *)arg, &sisapdata, sizeof(sisapdata)))
-			return -EFAULT;
-		break;
 	   case SISFB_GET_INFO:  /* For communication with X driver */
-	        {
-			sisfb_info x;
-
-			x.sisfb_id = SISFB_ID;
-			x.sisfb_version = VER_MAJOR;
-			x.sisfb_revision = VER_MINOR;
-			x.sisfb_patchlevel = VER_LEVEL;
-			x.chip_id = ivideo.chip_id;
-			x.memory = ivideo.video_size / 1024;
-			x.heapstart = ivideo.heapstart / 1024;
-			x.fbvidmode = sisfb_mode_no;
-			x.sisfb_caps = sisfb_caps;
-			x.sisfb_tqlen = 512; /* yet fixed */
-			x.sisfb_pcibus = ivideo.pcibus;
-			x.sisfb_pcislot = ivideo.pcislot;
-			x.sisfb_pcifunc = ivideo.pcifunc;
-			x.sisfb_lcdpdc = sisfb_detectedpdc;
-			x.sisfb_lcda = sisfb_detectedlcda;
-			x.sisfb_vbflags = ivideo.vbflags;
-			x.sisfb_currentvbflags = ivideo.currentvbflags;
-			x.sisfb_scalelcd = SiS_Pr.UsePanelScaler;
-			x.sisfb_specialtiming = SiS_Pr.SiS_CustomT;
-			x.sisfb_haveemi = SiS_Pr.HaveEMI ? 1 : 0;
-			x.sisfb_haveemilcd = SiS_Pr.HaveEMILCD ? 1 : 0;
-			x.sisfb_emi30 = SiS_Pr.EMI_30;
-			x.sisfb_emi31 = SiS_Pr.EMI_31;
-			x.sisfb_emi32 = SiS_Pr.EMI_32;
-			x.sisfb_emi33 = SiS_Pr.EMI_33;
-			if(copy_to_user((void *)arg, &x, sizeof(x)))
-				return -EFAULT;
-	                break;
+		x.sisfb_id         = SISFB_ID;
+		x.sisfb_version    = VER_MAJOR;
+		x.sisfb_revision   = VER_MINOR;
+		x.sisfb_patchlevel = VER_LEVEL;
+		x.chip_id = ivideo->chip_id;
+		x.memory = ivideo->video_size / 1024;
+		x.heapstart = ivideo->heapstart / 1024;
+		if(ivideo->modechanged) {
+		   x.fbvidmode = ivideo->mode_no;
+		} else {
+		   x.fbvidmode = ivideo->modeprechange;
+		}
+		x.sisfb_caps = ivideo->caps;
+		x.sisfb_tqlen = 512; /* yet fixed */
+		x.sisfb_pcibus = ivideo->pcibus;
+		x.sisfb_pcislot = ivideo->pcislot;
+		x.sisfb_pcifunc = ivideo->pcifunc;
+		x.sisfb_lcdpdc = ivideo->detectedpdc;
+		x.sisfb_lcdpdca = ivideo->detectedpdca;
+		x.sisfb_lcda = ivideo->detectedlcda;
+		x.sisfb_vbflags = ivideo->vbflags;
+		x.sisfb_currentvbflags = ivideo->currentvbflags;
+		x.sisfb_scalelcd = ivideo->SiS_Pr.UsePanelScaler;
+		x.sisfb_specialtiming = ivideo->SiS_Pr.SiS_CustomT;
+		x.sisfb_haveemi = ivideo->SiS_Pr.HaveEMI ? 1 : 0;
+		x.sisfb_haveemilcd = ivideo->SiS_Pr.HaveEMILCD ? 1 : 0;
+		x.sisfb_emi30 = ivideo->SiS_Pr.EMI_30;
+		x.sisfb_emi31 = ivideo->SiS_Pr.EMI_31;
+		x.sisfb_emi32 = ivideo->SiS_Pr.EMI_32;
+		x.sisfb_emi33 = ivideo->SiS_Pr.EMI_33;
+		x.sisfb_tvxpos = (u16)(ivideo->tvxpos + 32);
+		x.sisfb_tvypos = (u16)(ivideo->tvypos + 32);
+
+		if(copy_to_user(argp, &x, sizeof(x))) {
+			return -EFAULT;
+		}
+	        break;
+
+	   case SISFB_GET_VBRSTATUS_OLD:
+	   	if(++count < 50) {
+	           printk(KERN_INFO "sisfb: Deprecated ioctl call received - update your application!\n");
 		}
 	   case SISFB_GET_VBRSTATUS:
-	        {
-			if(sisfb_CheckVBRetrace())
-				return put_user(1UL, (unsigned long *) arg);
-			else
-				return put_user(0UL, (unsigned long *) arg);
-			break;
+	        if(sisfb_CheckVBRetrace(ivideo)) {
+			return put_user((u32)1, argp);
+		} else {
+			return put_user((u32)0, argp);
+		}
+
+	   case SISFB_GET_AUTOMAXIMIZE_OLD:
+	   	if(++count < 50) {
+	           printk(KERN_INFO "sisfb: Deprecated ioctl call received - update your application!\n");
 		}
 	   case SISFB_GET_AUTOMAXIMIZE:
-	        {
-			if(sisfb_max)
-				return put_user(1UL, (unsigned long *) arg);
-			else
-				return put_user(0UL, (unsigned long *) arg);
-			break;
+	        if(ivideo->sisfb_max) return put_user((u32)1, argp);
+		else 	              return put_user((u32)0, argp);
+
+	   case SISFB_SET_AUTOMAXIMIZE_OLD:
+	   	if(++count < 50) {
+		   printk(KERN_INFO "sisfb: Deprecated ioctl call received - update your application!\n");
 		}
 	   case SISFB_SET_AUTOMAXIMIZE:
-	        {
-			unsigned long newmax;
+		if(copy_from_user(&gpu32, argp, sizeof(gpu32))) {
+			return -EFAULT;
+		}
+		ivideo->sisfb_max = (gpu32) ? 1 : 0;
+		break;
+
+	   case SISFB_SET_TVPOSOFFSET:
+		if(copy_from_user(&gpu32, argp, sizeof(gpu32))) {
+			return -EFAULT;
+		}
+		sisfb_set_TVxposoffset(ivideo, ((int)(gpu32 >> 16)) - 32);
+		sisfb_set_TVyposoffset(ivideo, ((int)(gpu32 & 0xffff)) - 32);
+		break;
 
-			if(copy_from_user(&newmax, (unsigned long *)arg, sizeof(newmax)))
-				return -EFAULT;
+	   case SISFB_GET_TVPOSOFFSET:
+	        return put_user((u32)(((ivideo->tvxpos+32)<<16)|((ivideo->tvypos+32)&0xffff)), argp);
 
-			if(newmax) sisfb_max = 1;
-			else	   sisfb_max = 0;
-			break;
+	   case SISFB_SET_LOCK:
+		if(copy_from_user(&gpu32, argp, sizeof(gpu32))) {
+			return -EFAULT;
 		}
+		ivideo->sisfblocked = (gpu32) ? 1 : 0;
+		break;
+
 	   default:
 		return -EINVAL;
 	}
 	return 0;
 }
 
-
-static int sisfb_get_fix(struct fb_fix_screeninfo *fix, int con,
-			 struct fb_info *info)
+static int
+sisfb_get_fix(struct fb_fix_screeninfo *fix, int con, struct fb_info *info)
 {
-	memset(fix, 0, sizeof(struct fb_fix_screeninfo));
+	struct sis_video_info *ivideo = (struct sis_video_info *)info->par;
 
-#if LINUX_VERSION_CODE < KERNEL_VERSION(2,5,0)	
-	strcpy(fix->id, sis_fb_info->modename);
-#else
-	strcpy(fix->id, myid);
-#endif	
+	memset(fix, 0, sizeof(struct fb_fix_screeninfo));
 
-	fix->smem_start = ivideo.video_base;
-
-        if((!sisfb_mem) || (sisfb_mem > (ivideo.video_size/1024))) {
-	    if(sisvga_engine == SIS_300_VGA) {
-	       if(ivideo.video_size > 0x1000000) {
-	          	fix->smem_len = 0xc00000;
-	       } else if(ivideo.video_size > 0x800000)
-		  	fix->smem_len = 0x800000;
-	       else
-		  	fix->smem_len = 0x400000;
-            } else {
-	       	fix->smem_len = ivideo.video_size - 0x100000;
-	    }
-        } else
-		fix->smem_len = sisfb_mem * 1024;
+	strcpy(fix->id, ivideo->myid);
 
+	fix->smem_start  = ivideo->video_base;
+	fix->smem_len    = ivideo->sisfb_mem;
 	fix->type        = FB_TYPE_PACKED_PIXELS;
 	fix->type_aux    = 0;
-	if(ivideo.video_bpp == 8)
-	   fix->visual = FB_VISUAL_PSEUDOCOLOR;
-	else
-	   fix->visual = FB_VISUAL_TRUECOLOR;
-	fix->xpanstep    = 0;
-
-        if(sisfb_ypan) 	 fix->ypanstep = 1;
-
+	fix->visual      = (ivideo->video_bpp == 8) ? FB_VISUAL_PSEUDOCOLOR : FB_VISUAL_TRUECOLOR;
+	fix->xpanstep    = 1;
+	fix->ypanstep 	 = (ivideo->sisfb_ypan) ? 1 : 0;
 	fix->ywrapstep   = 0;
-	fix->line_length = ivideo.video_linelength;
-	fix->mmio_start  = ivideo.mmio_base;
-	fix->mmio_len    = sisfb_mmio_size;
-	if(sisvga_engine == SIS_300_VGA) 
+	fix->line_length = ivideo->video_linelength;
+	fix->mmio_start  = ivideo->mmio_base;
+	fix->mmio_len    = ivideo->mmio_size;
+	if(ivideo->sisvga_engine == SIS_300_VGA) {
 	   fix->accel    = FB_ACCEL_SIS_GLAMOUR;
-	else if((ivideo.chip == SIS_330) || (ivideo.chip == SIS_760))
+	} else if((ivideo->chip == SIS_330) || (ivideo->chip == SIS_760)) {
 	   fix->accel    = FB_ACCEL_SIS_XABRE;
-	else
+	} else {
 	   fix->accel    = FB_ACCEL_SIS_GLAMOUR_2;
-
-#if LINUX_VERSION_CODE < KERNEL_VERSION(2,5,0)
-	fix->reserved[0] = ivideo.video_size & 0xFFFF;
-	fix->reserved[1] = (ivideo.video_size >> 16) & 0xFFFF;
-	fix->reserved[2] = sisfb_caps;
-#endif
+	}
 
 	return 0;
 }
@@ -2359,458 +2234,416 @@ static struct fb_ops sisfb_ops = {
 	.fb_get_cmap	= sisfb_get_cmap,
 	.fb_set_cmap	= sisfb_set_cmap,
         .fb_pan_display = sisfb_pan_display,
-	.fb_ioctl	= sisfb_ioctl,
-	.fb_mmap	= sisfb_mmap,
+	.fb_ioctl	= sisfb_ioctl
 };
 #endif
 
-
 #if LINUX_VERSION_CODE >= KERNEL_VERSION(2,5,0)
 static struct fb_ops sisfb_ops = {
-	.owner        =	THIS_MODULE,
-	.fb_open      = sisfb_open,
-	.fb_release   = sisfb_release,
-	.fb_check_var = sisfb_check_var,
-	.fb_set_par   = sisfb_set_par,
-	.fb_setcolreg = sisfb_setcolreg,
+	.owner          = THIS_MODULE,
+	.fb_open        = sisfb_open,
+	.fb_release     = sisfb_release,
+	.fb_check_var   = sisfb_check_var,
+	.fb_set_par     = sisfb_set_par,
+	.fb_setcolreg   = sisfb_setcolreg,
         .fb_pan_display = sisfb_pan_display,
-        .fb_blank     = sisfb_blank,
-	.fb_fillrect  = fbcon_sis_fillrect,
-	.fb_copyarea  = fbcon_sis_copyarea,
-	.fb_imageblit = cfb_imageblit,
-	.fb_cursor    = soft_cursor,	
-	.fb_sync      = fbcon_sis_sync,
-	.fb_ioctl     =	sisfb_ioctl,
-	.fb_mmap      =	sisfb_mmap,
+        .fb_blank       = sisfb_blank,
+	.fb_fillrect    = fbcon_sis_fillrect,
+	.fb_copyarea    = fbcon_sis_copyarea,
+	.fb_imageblit   = cfb_imageblit,
+	.fb_cursor      = soft_cursor,
+	.fb_sync        = fbcon_sis_sync,
+	.fb_ioctl       = sisfb_ioctl
 };
 #endif
 
-
 /* ---------------- Chip generation dependent routines ---------------- */
 
-#ifdef CONFIG_FB_SIS_300 /* for SiS 300/630/540/730 */
-
-static int sisfb_get_dram_size_300(void)
+static struct pci_dev * sisfb_get_northbridge(int basechipid)
 {
 	struct pci_dev *pdev = NULL;
-	int pdev_valid = 0;
-	u8  pci_data, reg;
-	u16 nbridge_id;
-
-	switch (ivideo.chip) {
-	   case SIS_540:
-		nbridge_id = PCI_DEVICE_ID_SI_540;
-		break;
-	   case SIS_630:
-		nbridge_id = PCI_DEVICE_ID_SI_630;
-		break;
-	   case SIS_730:
-		nbridge_id = PCI_DEVICE_ID_SI_730;
-		break;
-	   default:
-		nbridge_id = 0;
-		break;
+	int nbridgenum, nbridgeidx, i;
+	const unsigned short nbridgeids[] = {
+		PCI_DEVICE_ID_SI_540,	/* for SiS 540 VGA */
+		PCI_DEVICE_ID_SI_630,	/* for SiS 630/730 VGA */
+		PCI_DEVICE_ID_SI_730,
+		PCI_DEVICE_ID_SI_550,   /* for SiS 550 VGA */
+		PCI_DEVICE_ID_SI_650,   /* for SiS 650/651/740 VGA */
+		PCI_DEVICE_ID_SI_651,
+		PCI_DEVICE_ID_SI_740,
+		PCI_DEVICE_ID_SI_661,	/* for SiS 661/741/660/760 VGA */
+		PCI_DEVICE_ID_SI_741,
+		PCI_DEVICE_ID_SI_660,
+		PCI_DEVICE_ID_SI_760
+	};
+
+    	switch(basechipid) {
+#ifdef CONFIG_FB_SIS_300
+	case SIS_540:	nbridgeidx = 0; nbridgenum = 1; break;
+	case SIS_630:	nbridgeidx = 1; nbridgenum = 2; break;
+#endif
+#ifdef CONFIG_FB_SIS_315
+	case SIS_550:   nbridgeidx = 3; nbridgenum = 1; break;
+	case SIS_650:	nbridgeidx = 4; nbridgenum = 3; break;
+	case SIS_660:	nbridgeidx = 7; nbridgenum = 4; break;
+#endif
+	default:	return NULL;
 	}
-
-	if (nbridge_id == 0) {  /* 300 */
-
-	        inSISIDXREG(SISSR, IND_SIS_DRAM_SIZE,reg);
-		ivideo.video_size =
-		        ((unsigned int) ((reg & SIS_DRAM_SIZE_MASK) + 1) << 20);
-
-	} else {		/* 540, 630, 730 */
-
-#if LINUX_VERSION_CODE < KERNEL_VERSION(2,5,74)
-		pci_for_each_dev(pdev) {
-#else
-		while((pdev = pci_find_device(PCI_VENDOR_ID_SI, PCI_ANY_ID, pdev))) {
-#endif
-			if ((pdev->vendor == PCI_VENDOR_ID_SI)
-				       && (pdev->device == nbridge_id)) {
-				pci_read_config_byte(pdev, IND_BRI_DRAM_STATUS, &pci_data);
-				pci_data = (pci_data & BRI_DRAM_SIZE_MASK) >> 4;
-				ivideo.video_size = (unsigned int)(1 << (pci_data+21));
-				pdev_valid = 1;
-
-				reg = SIS_DATA_BUS_64 << 6;
-				switch (pci_data) {
-				   case BRI_DRAM_SIZE_2MB:
-					reg |= SIS_DRAM_SIZE_2MB;
-					break;
-				   case BRI_DRAM_SIZE_4MB:
-					reg |= SIS_DRAM_SIZE_4MB;
-					break;
-				   case BRI_DRAM_SIZE_8MB:
-					reg |= SIS_DRAM_SIZE_8MB;
-					break;
-				   case BRI_DRAM_SIZE_16MB:
-					reg |= SIS_DRAM_SIZE_16MB;
-					break;
-				   case BRI_DRAM_SIZE_32MB:
-					reg |= SIS_DRAM_SIZE_32MB;
-					break;
-				   case BRI_DRAM_SIZE_64MB:
-					reg |= SIS_DRAM_SIZE_64MB;
-					break;
-				}
-				outSISIDXREG(SISSR, IND_SIS_DRAM_SIZE, reg);
-				break;
-			}  
-		}
-	
-		if (!pdev_valid)  return -1;
+	for(i = 0; i < nbridgenum; i++) {
+		if((pdev = pci_find_device(PCI_VENDOR_ID_SI, nbridgeids[nbridgeidx+i], NULL))) break;
 	}
-	return 0;
+	return pdev;
 }
 
-#endif  /* CONFIG_FB_SIS_300 */
-
-
-#ifdef CONFIG_FB_SIS_315    /* for SiS 315/550/650/740/330/661/741/760 */
-
-static int sisfb_get_dram_size_315(void)
+static int __devinit sisfb_get_dram_size(struct sis_video_info *ivideo)
 {
-	u8  reg = 0;
-
-	if(ivideo.chip == SIS_550 ||
-	   ivideo.chip == SIS_650 ||
-	   ivideo.chip == SIS_740) {
-
-                inSISIDXREG(SISSR, IND_SIS_DRAM_SIZE, reg);
-		reg &= 0x3f;
-		reg++;
-		reg <<= 2;
-		ivideo.video_size = reg << 20;
-		return 0;
+#if defined(CONFIG_FB_SIS_300) || defined(CONFIG_FB_SIS_315)
+	u8 reg;
+#endif
 
-	} else if(ivideo.chip == SIS_661 ||
-	          ivideo.chip == SIS_741 ||
-		  ivideo.chip == SIS_660 ||
-		  ivideo.chip == SIS_760) {
+	ivideo->video_size = 0;
 
+	switch(ivideo->chip) {
+#ifdef CONFIG_FB_SIS_300
+	case SIS_300:
+	        inSISIDXREG(SISSR, 0x14, reg);
+		ivideo->video_size = ((reg & 0x3F) + 1) << 20;
+		break;
+	case SIS_540:
+	case SIS_630:
+	case SIS_730:
+	   	if(!ivideo->nbridge) return -1;
+	   	pci_read_config_byte(ivideo->nbridge, 0x63, &reg);
+		ivideo->video_size = 1 << (((reg & 0x70) >> 4) + 21);
+		break;
+#endif
+#ifdef CONFIG_FB_SIS_315
+	case SIS_315H:
+	case SIS_315PRO:
+	case SIS_315:
+	   	inSISIDXREG(SISSR, 0x14, reg);
+		ivideo->video_size = (1 << ((reg & 0xf0) >> 4)) << 20;
+		switch((reg >> 2) & 0x03) {
+		case 0x01:
+		case 0x03:
+		   ivideo->video_size <<= 1;
+		   break;
+		case 0x02:
+		   ivideo->video_size += (ivideo->video_size/2);
+		}
+	   	break;
+	case SIS_330:
+	   	inSISIDXREG(SISSR, 0x14, reg);
+		ivideo->video_size = (1 << ((reg & 0xf0) >> 4)) << 20;
+		if(reg & 0x0c) ivideo->video_size <<= 1;
+	   	break;
+	case SIS_550:
+	case SIS_650:
+	case SIS_740:
+	    	inSISIDXREG(SISSR, 0x14, reg);
+		ivideo->video_size = (((reg & 0x3f) + 1) << 2) << 20;
+		break;
+	case SIS_661:
+	case SIS_741:
+	     	inSISIDXREG(SISCR, 0x79, reg);
+		ivideo->video_size = (1 << ((reg & 0xf0) >> 4)) << 20;
+	   	break;
+	case SIS_660:
+	case SIS_760:
 		inSISIDXREG(SISCR, 0x79, reg);
-		reg &= 0xf0;
-		reg >>= 4;
-		ivideo.video_size = (1 << reg) << 20;
-		return 0;
-
-	} else {	/* 315, 330 */
-
-	        inSISIDXREG(SISSR, IND_SIS_DRAM_SIZE, reg);
-		ivideo.video_size = (1 << ((reg & 0xf0) >> 4)) << 20;
-
-		reg &= SIS315_DUAL_CHANNEL_MASK;
-		reg >>= 2;
-
-		if(ivideo.chip == SIS_330) {
-
-		   if(reg) ivideo.video_size <<= 1;
-		
-		} else {
-		   
-		   switch (reg) {
-		      case SIS315_SINGLE_CHANNEL_2_RANK:
-			   ivideo.video_size <<= 1;
-			   break;
-		      case SIS315_DUAL_CHANNEL_1_RANK:
-			   ivideo.video_size <<= 1;
-			   break;
-		      case SIS315_ASYM_DDR:		/* TW: DDR asymetric */
-			   ivideo.video_size += (ivideo.video_size/2);
-			   break;
-		   }
+		reg = (reg & 0xf0) >> 4;
+		if(reg)	ivideo->video_size = (1 << reg) << 20;
+		inSISIDXREG(SISCR, 0x78, reg);
+		reg &= 0x30;
+		if(reg) {
+		   if(reg == 0x10) ivideo->video_size += (32 << 20);
+		   else		   ivideo->video_size += (64 << 20);
 		}
-
-		return 0;
+	   	break;
+#endif
+	default:
+		return -1;
 	}
-	
-	return -1;
-	
+	return 0;
 }
 
-#endif   /* CONFIG_FB_SIS_315 */
+/* -------------- video bridge device detection --------------- */
 
-
-/* -------------- video bridge detection --------------- */
-
-static void sisfb_detect_VB_connect()
+static void __devinit sisfb_detect_VB_connect(struct sis_video_info *ivideo)
 {
-	u8 sr16, sr17, cr32, temp;
-
-	if(sisvga_engine == SIS_300_VGA) {
-
-		inSISIDXREG(SISSR, IND_SIS_SCRATCH_REG_17, sr17);
-
-		if ((sr17 & 0x0F) && (ivideo.chip != SIS_300)) {
-
-			/* Old BIOSes store the detected CRT2 type in SR17
-		 	 * instead of CR32. However, since our detection
-			 * routines store their results to CR32, we now copy
-			 * the remaining bits (for LCD and VGA) to CR32 for
-			 * unified usage.
-			 * SR17[0] CRT1    [1] LCD     [2] TV    [3] VGA2
-			 *     [4] AVIDEO  [5] SVIDEO
-			 */
-
-#if 0
-			if (sr17 & 0x01) orSISIDXREG(SISCR, 0x32, SIS_CRT1);
-			else		 andSISIDXREG(SISCR, 0x32, ~SIS_CRT1);
-
-			if (sr17 & 0x02) orSISIDXREG(SISCR, 0x32, SIS_VB_LCD);
-			else		 andSISIDXREG(SISCR, 0x32, ~SIS_VB_LCD);
-
-			/* no HiVision and no DVI connector here */
-			andSISIDXREG(SISCR, 0x32, ~0xc0);
-#endif
+	u8 cr32, temp;
 
+#ifdef CONFIG_FB_SIS_300
+	if(ivideo->sisvga_engine == SIS_300_VGA) {
+		inSISIDXREG(SISSR, 0x17, temp);
+		if((temp & 0x0F) && (ivideo->chip != SIS_300)) {
 			/* PAL/NTSC is stored on SR16 on such machines */
-			if (!(ivideo.vbflags & (TV_PAL | TV_NTSC))) {
-		   		inSISIDXREG(SISSR, IND_SIS_SCRATCH_REG_16, sr16);
-				if (sr16 & 0x20)
-					ivideo.vbflags |= TV_PAL;
+			if(!(ivideo->vbflags & (TV_PAL | TV_NTSC | TV_PALM | TV_PALN))) {
+		   		inSISIDXREG(SISSR, 0x16, temp);
+				if(temp & 0x20)
+					ivideo->vbflags |= TV_PAL;
 				else
-					ivideo.vbflags |= TV_NTSC;
+					ivideo->vbflags |= TV_NTSC;
 			}
-
 		}
-
 	}
+#endif
 
-	inSISIDXREG(SISCR, IND_SIS_SCRATCH_REG_CR32, cr32);
+	inSISIDXREG(SISCR, 0x32, cr32);
 
-	if (cr32 & SIS_CRT1)
-		sisfb_crt1off = 0;
-	else {
-		if (cr32 & 0x5F)
-			sisfb_crt1off = 1;
-		else
-			sisfb_crt1off = 0;
+	if(cr32 & SIS_CRT1) {
+		ivideo->sisfb_crt1off = 0;
+	} else {
+		ivideo->sisfb_crt1off = (cr32 & 0xDF) ? 1 : 0;
 	}
 
-	ivideo.vbflags &= ~(CRT2_TV | CRT2_LCD | CRT2_VGA);
+	ivideo->vbflags &= ~(CRT2_TV | CRT2_LCD | CRT2_VGA);
 
-	if (cr32 & SIS_VB_TV)
-		ivideo.vbflags |= CRT2_TV;
-	if (cr32 & SIS_VB_LCD)
-		ivideo.vbflags |= CRT2_LCD;
-	if (cr32 & SIS_VB_CRT2)
-		ivideo.vbflags |= CRT2_VGA;
+	if(cr32 & SIS_VB_TV)   ivideo->vbflags |= CRT2_TV;
+	if(cr32 & SIS_VB_LCD)  ivideo->vbflags |= CRT2_LCD;
+	if(cr32 & SIS_VB_CRT2) ivideo->vbflags |= CRT2_VGA;
 
-	/* TW: Detect/set TV plug & type */
-	if(sisfb_tvplug != -1)
-	        ivideo.vbflags |= sisfb_tvplug;
+	/* Check given parms for hardware compatibility.
+	 * (Cannot do this in the search_xx routines since we don't
+	 * know what hardware we are running on then)
+	 */
 
-	if (cr32 & SIS_VB_SVIDEO)
-		ivideo.vbflags |= TV_SVIDEO;
-	else if (cr32 & SIS_VB_COMPOSITE)
-		ivideo.vbflags |= TV_AVIDEO;
-	else if (cr32 & SIS_VB_SCART)
-		ivideo.vbflags |= TV_SCART;
+	if(ivideo->chip != SIS_550) {
+	   ivideo->sisfb_dstn = ivideo->sisfb_fstn = 0;
+	}
 
-	if (!(ivideo.vbflags & (TV_PAL | TV_NTSC))) {
-		if(sisvga_engine == SIS_300_VGA) {
-	        	inSISIDXREG(SISSR, IND_SIS_POWER_ON_TRAP, temp);
-			if (temp & 0x01)
-				ivideo.vbflags |= TV_PAL;
-			else
-				ivideo.vbflags |= TV_NTSC;
-		} else if((ivideo.chip <= SIS_315PRO) || (ivideo.chip >= SIS_330)) {
+	if(ivideo->sisfb_tvplug != -1) {
+	   if( (ivideo->sisvga_engine != SIS_315_VGA) ||
+	       (!(ivideo->vbflags & (VB_301C|VB_301LV|VB_302LV))) ) {
+	      if(ivideo->sisfb_tvplug & TV_YPBPR) {
+	         ivideo->sisfb_tvplug = -1;
+		 printk(KERN_ERR "sisfb: YPbPr not supported\n");
+	      }
+	   }
+	}
+	if(ivideo->sisfb_tvplug != -1) {
+	   if( (ivideo->sisvga_engine != SIS_315_VGA) ||
+	       (!(ivideo->vbflags & (VB_301|VB_301B|VB_302B))) ) {
+	      if(ivideo->sisfb_tvplug & TV_HIVISION) {
+	         ivideo->sisfb_tvplug = -1;
+		 printk(KERN_ERR "sisfb: HiVision not supported\n");
+	      }
+	   }
+	}
+	if(ivideo->sisfb_tvstd != -1) {
+	   if( (!(ivideo->vbflags & VB_SISBRIDGE)) &&
+	       (!((ivideo->sisvga_engine == SIS_315_VGA) && (ivideo->vbflags & VB_CHRONTEL))) ) {
+	      if(ivideo->sisfb_tvstd & (TV_PALN | TV_PALN | TV_NTSCJ)) {
+	         ivideo->sisfb_tvstd = -1;
+	         printk(KERN_ERR "sisfb: PALM/PALN/NTSCJ not supported\n");
+	      }
+	   }
+	}
 
-                	inSISIDXREG(SISSR, 0x38, temp);
-			if(temp & 0x01)
-				ivideo.vbflags |= TV_PAL;
-			else
-				ivideo.vbflags |= TV_NTSC;
+	/* Detect/set TV plug & type */
+	if(ivideo->sisfb_tvplug != -1) {
+		ivideo->vbflags |= ivideo->sisfb_tvplug;
+	} else {
+		if(cr32 & SIS_VB_YPBPR)     	 ivideo->vbflags |= (TV_YPBPR|TV_YPBPR525I); /* default: 480i */
+		else if(cr32 & SIS_VB_HIVISION)  ivideo->vbflags |= TV_HIVISION;
+		else if(cr32 & SIS_VB_SCART)     ivideo->vbflags |= TV_SCART;
+	 	else {
+			if(cr32 & SIS_VB_SVIDEO)    ivideo->vbflags |= TV_SVIDEO;
+			if(cr32 & SIS_VB_COMPOSITE) ivideo->vbflags |= TV_AVIDEO;
+		}
+	}
 
+	if(!(ivideo->vbflags & (TV_YPBPR | TV_HIVISION))) {
+	    if(ivideo->sisfb_tvstd != -1) {
+	       ivideo->vbflags &= ~(TV_NTSC | TV_PAL | TV_PALM | TV_PALN | TV_NTSCJ);
+	       ivideo->vbflags |= ivideo->sisfb_tvstd;
+	    }
+	    if(ivideo->vbflags & TV_SCART) {
+	       ivideo->vbflags &= ~(TV_NTSC | TV_PALM | TV_PALN | TV_NTSCJ);
+	       ivideo->vbflags |= TV_PAL;
+	    }
+	    if(!(ivideo->vbflags & (TV_PAL | TV_NTSC | TV_PALM | TV_PALN | TV_NTSCJ))) {
+		if(ivideo->sisvga_engine == SIS_300_VGA) {
+	        	inSISIDXREG(SISSR, 0x38, temp);
+			if(temp & 0x01) ivideo->vbflags |= TV_PAL;
+			else		ivideo->vbflags |= TV_NTSC;
+		} else if((ivideo->chip <= SIS_315PRO) || (ivideo->chip >= SIS_330)) {
+                	inSISIDXREG(SISSR, 0x38, temp);
+			if(temp & 0x01) ivideo->vbflags |= TV_PAL;
+			else		ivideo->vbflags |= TV_NTSC;
 	    	} else {
-
 	        	inSISIDXREG(SISCR, 0x79, temp);
-			if(temp & 0x20)
-				ivideo.vbflags |= TV_PAL;
-			else
-				ivideo.vbflags |= TV_NTSC;
+			if(temp & 0x20)	ivideo->vbflags |= TV_PAL;
+			else		ivideo->vbflags |= TV_NTSC;
 	    	}
+	    }
 	}
 
-	/* TW: Copy forceCRT1 option to CRT1off if option is given */
-    	if (sisfb_forcecrt1 != -1) {
-    		if(sisfb_forcecrt1) sisfb_crt1off = 0;
-		else                sisfb_crt1off = 1;
+	/* Copy forceCRT1 option to CRT1off if option is given */
+    	if(ivideo->sisfb_forcecrt1 != -1) {
+    	   ivideo->sisfb_crt1off = (ivideo->sisfb_forcecrt1) ? 0 : 1;
     	}
-
 }
 
-static void sisfb_get_VB_type(void)
+static void __devinit sisfb_get_VB_type(struct sis_video_info *ivideo)
 {
-	u8 vb_chipid;
-	u8 reg;
 	char stdstr[]    = "sisfb: Detected";
 	char bridgestr[] = "video bridge";
-	char lvdsstr[]   = "LVDS transmitter";
-  	char chrstr[]    = "Chrontel TV encoder";
-
-	ivideo.hasVB = HASVB_NONE;
-	sishw_ext.ujVBChipID = VB_CHIP_UNKNOWN;
-	sishw_ext.Is301BDH = FALSE;
-	sishw_ext.usExternalChip = 0;
+	u8 vb_chipid;
+	u8 reg;
 
 	inSISIDXREG(SISPART4, 0x00, vb_chipid);
-	switch (vb_chipid) {
-	   case 0x01:
-		ivideo.hasVB = HASVB_301;
+	switch(vb_chipid) {
+	case 0x01:
 		inSISIDXREG(SISPART4, 0x01, reg);
 		if(reg < 0xb0) {
-			ivideo.vbflags |= VB_301;
-			sishw_ext.ujVBChipID = VB_CHIP_301;
+			ivideo->vbflags |= VB_301;
 			printk(KERN_INFO "%s SiS301 %s\n", stdstr, bridgestr);
 		} else if(reg < 0xc0) {
-		 	ivideo.vbflags |= VB_301B;
-			sishw_ext.ujVBChipID = VB_CHIP_301B;
+		 	ivideo->vbflags |= VB_301B;
 			inSISIDXREG(SISPART4,0x23,reg);
 			if(!(reg & 0x02)) {
-			   sishw_ext.Is301BDH = TRUE;
-			   ivideo.vbflags |= VB_30xBDH;
+			   ivideo->vbflags |= VB_30xBDH;
 			   printk(KERN_INFO "%s SiS301B-DH %s\n", stdstr, bridgestr);
 			} else {
 			   printk(KERN_INFO "%s SiS301B %s\n", stdstr, bridgestr);
 			}
 		} else if(reg < 0xd0) {
-		 	ivideo.vbflags |= VB_301C;
-			sishw_ext.ujVBChipID = VB_CHIP_301C;
+		 	ivideo->vbflags |= VB_301C;
 			printk(KERN_INFO "%s SiS301C %s\n", stdstr, bridgestr);
 		} else if(reg < 0xe0) {
-			ivideo.vbflags |= VB_301LV;
-			sishw_ext.ujVBChipID = VB_CHIP_301LV;
+			ivideo->vbflags |= VB_301LV;
 			printk(KERN_INFO "%s SiS301LV %s\n", stdstr, bridgestr);
 		} else if(reg <= 0xe1) {
 		        inSISIDXREG(SISPART4,0x39,reg);
 			if(reg == 0xff) {
-			   ivideo.vbflags |= VB_302LV;
-			   sishw_ext.ujVBChipID = VB_CHIP_302LV;
+			   ivideo->vbflags |= VB_302LV;
 			   printk(KERN_INFO "%s SiS302LV %s\n", stdstr, bridgestr);
 			} else {
-			   ivideo.vbflags |= VB_302ELV;
-			   sishw_ext.ujVBChipID = VB_CHIP_302ELV;
+			   ivideo->vbflags |= VB_301C;
+			   printk(KERN_INFO "%s SiS301C(P4) %s\n", stdstr, bridgestr);
+#if 0
+			   ivideo->vbflags |= VB_302ELV;
 			   printk(KERN_INFO "%s SiS302ELV %s\n", stdstr, bridgestr);
+#endif
 			}
 		}
 		break;
-	   case 0x02:
-		ivideo.hasVB = HASVB_302;
-		inSISIDXREG(SISPART4, 0x01, reg);
-		if(reg < 0xd0) {
-			ivideo.vbflags |= VB_302B;
-			sishw_ext.ujVBChipID = VB_CHIP_302B;
-			inSISIDXREG(SISPART4,0x23,reg);
-		  	if(!(reg & 0x02)) {
-			   sishw_ext.Is301BDH = TRUE;
-			   ivideo.vbflags |= VB_30xBDH;
-			   printk(KERN_INFO "%s SiS302B-DH %s\n", stdstr, bridgestr);
-			} else {
-			   printk(KERN_INFO "%s SiS302B %s\n", stdstr, bridgestr);
-			}
-		} else if(reg < 0xe0) {
-		 	ivideo.vbflags |= VB_301LV;
-			sishw_ext.ujVBChipID = VB_CHIP_301LV;
-			printk(KERN_INFO "%s SiS301LV %s\n", stdstr, bridgestr);
-		} else if(reg <= 0xe1) {
-			ivideo.vbflags |= VB_302LV;
-			sishw_ext.ujVBChipID = VB_CHIP_302LV;
-			printk(KERN_INFO "%s SiS302LV %s\n", stdstr, bridgestr);
-		}
+	case 0x02:
+		ivideo->vbflags |= VB_302B;
+		printk(KERN_INFO "%s SiS302B %s\n", stdstr, bridgestr);
 		break;
 	}
 
-	if((!(ivideo.vbflags & VB_VIDEOBRIDGE)) && (ivideo.chip != SIS_300)) {
-		inSISIDXREG(SISCR, IND_SIS_SCRATCH_REG_CR37, reg);
+	if((!(ivideo->vbflags & VB_VIDEOBRIDGE)) && (ivideo->chip != SIS_300)) {
+		inSISIDXREG(SISCR, 0x37, reg);
 		reg &= SIS_EXTERNAL_CHIP_MASK;
 		reg >>= 1;
-		if(sisvga_engine == SIS_300_VGA) {
-			switch (reg) {
+		if(ivideo->sisvga_engine == SIS_300_VGA) {
+#ifdef CONFIG_FB_SIS_300
+			switch(reg) {
 			   case SIS_EXTERNAL_CHIP_LVDS:
-				ivideo.hasVB = HASVB_LVDS;
-				ivideo.vbflags |= VB_LVDS;
-				sishw_ext.usExternalChip = 0x01;
-				printk(KERN_INFO "%s %s\n", stdstr, lvdsstr);
+				ivideo->vbflags |= VB_LVDS;
 				break;
 			   case SIS_EXTERNAL_CHIP_TRUMPION:
-				ivideo.hasVB = HASVB_TRUMPION;
-				sishw_ext.usExternalChip = 0x02;
-				printk(KERN_INFO "%s Trumpion LCD scaler\n", stdstr);
+				ivideo->vbflags |= VB_TRUMPION;
 				break;
 			   case SIS_EXTERNAL_CHIP_CHRONTEL:
-				ivideo.hasVB = HASVB_CHRONTEL;
-				ivideo.vbflags |= VB_CHRONTEL;
-				sishw_ext.usExternalChip = 0x04;
-				printk(KERN_INFO "%s %s\n", stdstr, chrstr);
+				ivideo->vbflags |= VB_CHRONTEL;
 				break;
 			   case SIS_EXTERNAL_CHIP_LVDS_CHRONTEL:
-				ivideo.hasVB = HASVB_LVDS_CHRONTEL;
-				ivideo.vbflags |= (VB_LVDS | VB_CHRONTEL);
-				sishw_ext.usExternalChip = 0x05;
-				printk(KERN_INFO "%s %s and %s\n", stdstr, lvdsstr, chrstr);
+				ivideo->vbflags |= (VB_LVDS | VB_CHRONTEL);
 				break;
 			}
-		} else if(ivideo.chip < SIS_661) {
+			if(ivideo->vbflags & VB_CHRONTEL) ivideo->chronteltype = 1;
+#endif
+		} else if(ivideo->chip < SIS_661) {
+#ifdef CONFIG_FB_SIS_315
 			switch (reg) {
 	 	   	   case SIS310_EXTERNAL_CHIP_LVDS:
-				ivideo.hasVB = HASVB_LVDS;
-				ivideo.vbflags |= VB_LVDS;
-				sishw_ext.usExternalChip = 0x01;
-				printk(KERN_INFO "%s %s\n", stdstr, lvdsstr);
+				ivideo->vbflags |= VB_LVDS;
 				break;
 		   	   case SIS310_EXTERNAL_CHIP_LVDS_CHRONTEL:
-				ivideo.hasVB = HASVB_LVDS_CHRONTEL;
-				ivideo.vbflags |= (VB_LVDS | VB_CHRONTEL);
-				sishw_ext.usExternalChip = 0x05;
-				printk(KERN_INFO "%s %s and %s\n", stdstr, lvdsstr, chrstr);
+				ivideo->vbflags |= (VB_LVDS | VB_CHRONTEL);
+				break;
+			}
+			if(ivideo->vbflags & VB_CHRONTEL) ivideo->chronteltype = 2;
+#endif
+		} else if(ivideo->chip >= SIS_661) {
+#ifdef CONFIG_FB_SIS_315
+			inSISIDXREG(SISCR, 0x38, reg);
+			reg >>= 5;
+			switch(reg) {
+			   case 0x02:
+				ivideo->vbflags |= VB_LVDS;
+				break;
+			   case 0x03:
+				ivideo->vbflags |= (VB_LVDS | VB_CHRONTEL);
+				break;
+			   case 0x04:
+				ivideo->vbflags |= (VB_LVDS | VB_CONEXANT);
 				break;
 			}
+			if(ivideo->vbflags & VB_CHRONTEL) ivideo->chronteltype = 2;
+#endif
+		}
+		if(ivideo->vbflags & VB_LVDS) {
+		   printk(KERN_INFO "%s LVDS transmitter\n", stdstr);
+		}
+		if(ivideo->vbflags & VB_TRUMPION) {
+		   printk(KERN_INFO "%s Trumpion Zurac LCD scaler\n", stdstr);
+		}
+		if(ivideo->vbflags & VB_CHRONTEL) {
+		   printk(KERN_INFO "%s Chrontel TV encoder\n", stdstr);
+		}
+		if(ivideo->vbflags & VB_CONEXANT) {
+		   printk(KERN_INFO "%s Conexant external device\n", stdstr);
 		}
-
 	}
 
-	if(ivideo.vbflags & VB_SISBRIDGE) {
-		SiS_Sense30x();
-	} else if(ivideo.vbflags & VB_CHRONTEL) {
-		SiS_SenseCh();
+	if(ivideo->vbflags & VB_SISBRIDGE) {
+		SiS_Sense30x(ivideo);
+	} else if(ivideo->vbflags & VB_CHRONTEL) {
+		SiS_SenseCh(ivideo);
 	}
-
 }
 
 /* ------------------ Sensing routines ------------------ */
 
-static BOOLEAN
-sisfb_test_DDC1(void)
+static BOOLEAN __devinit sisfb_test_DDC1(struct sis_video_info *ivideo)
 {
     unsigned short old;
     int count = 48;
 
-    old = SiS_ReadDDC1Bit(&SiS_Pr);
+    old = SiS_ReadDDC1Bit(&ivideo->SiS_Pr);
     do {
-       if(old != SiS_ReadDDC1Bit(&SiS_Pr)) break;
+       	if(old != SiS_ReadDDC1Bit(&ivideo->SiS_Pr)) break;
     } while(count--);
     return (count == -1) ? FALSE : TRUE;
 }
 
-static void
-sisfb_sense_crt1(void)
+static void __devinit sisfb_sense_crt1(struct sis_video_info *ivideo)
 {
-    unsigned char SR1F, CR63=0, CR17;
-    unsigned short temp = 0xffff;
-    int i;
     BOOLEAN mustwait = FALSE;
+    u8  SR1F, CR17;
+#ifdef CONFIG_FB_SIS_315
+    u8  CR63=0;
+#endif
+    u16 temp = 0xffff;
+    int i;
 
     inSISIDXREG(SISSR,0x1F,SR1F);
     orSISIDXREG(SISSR,0x1F,0x04);
     andSISIDXREG(SISSR,0x1F,0x3F);
     if(SR1F & 0xc0) mustwait = TRUE;
 
-    if(sisvga_engine == SIS_315_VGA) {
-       inSISIDXREG(SISCR,SiS_Pr.SiS_MyCR63,CR63);
+#ifdef CONFIG_FB_SIS_315
+    if(ivideo->sisvga_engine == SIS_315_VGA) {
+       inSISIDXREG(SISCR,ivideo->SiS_Pr.SiS_MyCR63,CR63);
        CR63 &= 0x40;
-       andSISIDXREG(SISCR,SiS_Pr.SiS_MyCR63,0xBF);
+       andSISIDXREG(SISCR,ivideo->SiS_Pr.SiS_MyCR63,0xBF);
     }
+#endif
 
     inSISIDXREG(SISCR,0x17,CR17);
     CR17 &= 0x80;
@@ -2822,25 +2655,46 @@ sisfb_sense_crt1(void)
     }
 
     if(mustwait) {
-       for(i=0; i < 10; i++) sisfbwaitretracecrt1();
+       for(i=0; i < 10; i++) sisfbwaitretracecrt1(ivideo);
     }
 
-    i = 3;
-    do {
-       temp = SiS_HandleDDC(&SiS_Pr, ivideo.vbflags, sisvga_engine, 0, 0, NULL);
-    } while(((temp == 0) || (temp == 0xffff)) && i--);
+#ifdef CONFIG_FB_SIS_315
+    if(ivideo->chip >= SIS_330) {
+       andSISIDXREG(SISCR,0x32,~0x20);
+       if(ivideo->chip >= SIS_340) {
+          outSISIDXREG(SISCR, 0x57, 0x4a);
+       } else {
+          outSISIDXREG(SISCR, 0x57, 0x5f);
+       }
+       orSISIDXREG(SISCR, 0x53, 0x02);
+       while((inSISREG(SISINPSTAT)) & 0x01)    break;
+       while(!((inSISREG(SISINPSTAT)) & 0x01)) break;
+       if((inSISREG(SISMISCW)) & 0x10) temp = 1;
+       andSISIDXREG(SISCR, 0x53, 0xfd);
+       andSISIDXREG(SISCR, 0x57, 0x00);
+    }
+#endif
+
+    if(temp == 0xffff) {
+       i = 3;
+       do {
+          temp = SiS_HandleDDC(&ivideo->SiS_Pr, ivideo->vbflags, ivideo->sisvga_engine, 0, 0, NULL);
+       } while(((temp == 0) || (temp == 0xffff)) && i--);
 
-    if((temp == 0) || (temp == 0xffff)) {
-       if(sisfb_test_DDC1()) temp = 1;
+       if((temp == 0) || (temp == 0xffff)) {
+          if(sisfb_test_DDC1(ivideo)) temp = 1;
+       }
     }
 
     if((temp) && (temp != 0xffff)) {
        orSISIDXREG(SISCR,0x32,0x20);
     }
 
-    if(sisvga_engine == SIS_315_VGA) {
-       setSISIDXREG(SISCR,SiS_Pr.SiS_MyCR63,0xBF,CR63);
+#ifdef CONFIG_FB_SIS_315
+    if(ivideo->sisvga_engine == SIS_315_VGA) {
+       setSISIDXREG(SISCR,ivideo->SiS_Pr.SiS_MyCR63,0xBF,CR63);
     }
+#endif
 
     setSISIDXREG(SISCR,0x17,0x7F,CR17);
 
@@ -2848,225 +2702,207 @@ sisfb_sense_crt1(void)
 }
 
 /* Determine and detect attached devices on SiS30x */
-static int
-SISDoSense(int tempbl, int tempbh, int tempcl, int tempch)
+static int __devinit SISDoSense(struct sis_video_info *ivideo, u16 type, u16 test)
 {
-    int temp;
-
-    outSISIDXREG(SISPART4,0x11,tempbl);
-    temp = tempbh | tempcl;
-    setSISIDXREG(SISPART4,0x10,0xe0,temp);
-    SiS_DDC2Delay(&SiS_Pr, 0x1000);
-    tempch &= 0x7f;
-    inSISIDXREG(SISPART4,0x03,temp);
-    temp ^= 0x0e;
-    temp &= tempch;
-    return((temp == tempch));
+    int temp, mytest, result, i, j;
+
+    for(j = 0; j < 10; j++) {
+       result = 0;
+       for(i = 0; i < 3; i++) {
+          mytest = test;
+          outSISIDXREG(SISPART4,0x11,(type & 0x00ff));
+          temp = (type >> 8) | (mytest & 0x00ff);
+          setSISIDXREG(SISPART4,0x10,0xe0,temp);
+          SiS_DDC2Delay(&ivideo->SiS_Pr, 0x1500);
+          mytest >>= 8;
+          mytest &= 0x7f;
+          inSISIDXREG(SISPART4,0x03,temp);
+          temp ^= 0x0e;
+          temp &= mytest;
+          if(temp == mytest) result++;
+#if 1
+	  outSISIDXREG(SISPART4,0x11,0x00);
+	  andSISIDXREG(SISPART4,0x10,0xe0);
+	  SiS_DDC2Delay(&ivideo->SiS_Pr, 0x1000);
+#endif
+       }
+       if((result == 0) || (result >= 2)) break;
+    }
+    return(result);
 }
 
-static void
-SiS_Sense30x(void)
+static void __devinit SiS_Sense30x(struct sis_video_info *ivideo)
 {
-  u8 backupP4_0d,backupP2_00;
-  u8 svhs_bl, svhs_bh;
-  u8 svhs_cl, svhs_ch;
-  u8 cvbs_bl, cvbs_bh;
-  u8 cvbs_cl, cvbs_ch;
-  u8 vga2_bl, vga2_bh;
-  u8 vga2_cl, vga2_ch;
-  int myflag, result, haveresult, i, j;
-  char stdstr[] = "sisfb: Detected";
-  char tvstr[]  = "TV connected to";
-
-  inSISIDXREG(SISPART4,0x0d,backupP4_0d);
-  if(!(ivideo.vbflags & (VB_301C|VB_302ELV))) {
-     outSISIDXREG(SISPART4,0x0d,(backupP4_0d | 0x04));
-  }
-
-  inSISIDXREG(SISPART2,0x00,backupP2_00);
-  outSISIDXREG(SISPART2,0x00,(backupP2_00 | 0x1c));
-
-  if(sisvga_engine == SIS_300_VGA) {
-
-	if(ivideo.vbflags & (VB_301B|VB_301C|VB_302B|VB_301LV|VB_302LV)) {
-	   	vga2_bh = 0x01; vga2_bl = 0x90;
-	   	svhs_bh = 0x01; svhs_bl = 0x6b;
-	   	cvbs_bh = 0x01; cvbs_bl = 0x74;
-	} else {
-		vga2_bh = 0x00; vga2_bl = 0xd1;
-        	svhs_bh = 0x00; svhs_bl = 0xb9;
-		cvbs_bh = 0x00; cvbs_bl = 0xb3;
-	}
-	inSISIDXREG(SISPART4,0x01,myflag);
-	if(myflag & 0x04) {
-	   vga2_bh = 0x00; vga2_bl = 0xfd;
-	   svhs_bh = 0x00; svhs_bl = 0xdd;
-	   cvbs_bh = 0x00; cvbs_bl = 0xee;
-	}
-	vga2_ch = 0x0e;	vga2_cl = 0x08;
-	svhs_ch = 0x04;	svhs_cl = 0x04;
-	cvbs_ch = 0x08; cvbs_cl = 0x04;
-	if(ivideo.vbflags & (VB_301LV|VB_302LV)) {
-	   	vga2_bh = 0x00; vga2_bl = 0x00;
-	   	vga2_ch = 0x00; vga2_cl = 0x00;
-	 }
-	if(ivideo.chip == SIS_300) {
-	   inSISIDXREG(SISSR,0x3b,myflag);
-	   if(!(myflag & 0x01)) {
-	      	vga2_bh = 0x00; vga2_bl = 0x00;
-	      	vga2_ch = 0x00; vga2_cl = 0x00;
-	   }
-	}
+    u8  backupP4_0d,backupP2_00,backupP2_4d,backupSR_1e,biosflag=0;
+    u16 svhs=0, svhs_c=0;
+    u16 cvbs=0, cvbs_c=0;
+    u16 vga2=0, vga2_c=0;
+    int myflag, result;
+    char stdstr[] = "sisfb: Detected";
+    char tvstr[]  = "TV connected to";
+
+    if(ivideo->vbflags & VB_301) {
+       svhs = 0x00b9; cvbs = 0x00b3; vga2 = 0x00d1;
+       inSISIDXREG(SISPART4,0x01,myflag);
+       if(myflag & 0x04) {
+	  svhs = 0x00dd; cvbs = 0x00ee; vga2 = 0x00fd;
+       }
+    } else if(ivideo->vbflags & (VB_301B | VB_302B)) {
+       svhs = 0x016b; cvbs = 0x0174; vga2 = 0x0190;
+    } else if(ivideo->vbflags & (VB_301LV | VB_302LV)) {
+       svhs = 0x0200; cvbs = 0x0100;
+    } else if(ivideo->vbflags & (VB_301C | VB_302ELV)) {
+       svhs = 0x016b; cvbs = 0x0110; vga2 = 0x0190;
+    } else return;
+
+    vga2_c = 0x0e08; svhs_c = 0x0404; cvbs_c = 0x0804;
+    if(ivideo->vbflags & (VB_301LV|VB_302LV|VB_302ELV)) {
+       svhs_c = 0x0408; cvbs_c = 0x0808;
+    }
+    biosflag = 2;
 
-  } else {
-
-	if(ivideo.vbflags & (VB_301B|VB_302B)) {
-		vga2_bh = 0x01; vga2_bl = 0x90;
-		svhs_bh = 0x01; svhs_bl = 0x6b;
-		cvbs_bh = 0x01; cvbs_bl = 0x74;
-	} else if(ivideo.vbflags & (VB_301C|VB_302ELV)) {
-	      	vga2_bh = 0x01; vga2_bl = 0x90;
-	      	svhs_bh = 0x01; svhs_bl = 0x6b;
-	      	cvbs_bh = 0x01; cvbs_bl = 0x10;
-	} else if(ivideo.vbflags & (VB_301LV|VB_302LV)) {
-	      	vga2_bh = 0x00; vga2_bl = 0x00;
-	      	svhs_bh = 0x02; svhs_bl = 0x00;
-	      	cvbs_bh = 0x01; cvbs_bl = 0x00;
-	} else {
-		vga2_bh = 0x00; vga2_bl = 0xd1;
-        	svhs_bh = 0x00; svhs_bl = 0xb9;
-		cvbs_bh = 0x00; cvbs_bl = 0xb3;
-		inSISIDXREG(SISPART4,0x01,myflag);
-	        if(myflag & 0x04) {
-	           vga2_bh = 0x00; vga2_bl = 0xfd;
-	           svhs_bh = 0x00; svhs_bl = 0xdd;
-	           cvbs_bh = 0x00; cvbs_bl = 0xee;
-	        }
-	}
+    if(ivideo->chip == SIS_300) {
+       inSISIDXREG(SISSR,0x3b,myflag);
+       if(!(myflag & 0x01)) vga2 = vga2_c = 0;
+    }
 
-	if(ivideo.vbflags & (VB_301LV|VB_302LV|VB_302ELV)) {
-	   vga2_bh = 0x00; vga2_bl = 0x00;
-	   vga2_ch = 0x00; vga2_cl = 0x00;
-	   svhs_ch = 0x04; svhs_cl = 0x08;
-	   cvbs_ch = 0x08; cvbs_cl = 0x08;
-	} else {
-	   vga2_ch = 0x0e; vga2_cl = 0x08;
-	   svhs_ch = 0x04; svhs_cl = 0x04;
-	   cvbs_ch = 0x08; cvbs_cl = 0x04;
-	}
-    } 
-
-    if(vga2_ch || vga2_cl || vga2_bh || vga2_bl) {
-       haveresult = 0;
-       for(j = 0; j < 10; j++) {
-          result = 0;
-          for(i = 0; i < 3; i++) {
-             if(SISDoSense(vga2_bl, vga2_bh, vga2_cl, vga2_ch))
-	        result++;
-          }
-	  if((result == 0) || (result >= 2)) break;
-       }
-       if(result) {
-          printk(KERN_INFO "%s secondary VGA connection\n", stdstr);
-	  orSISIDXREG(SISCR, 0x32, 0x10);
-       } else {
-	  andSISIDXREG(SISCR, 0x32, ~0x10);
+    inSISIDXREG(SISSR,0x1e,backupSR_1e);
+    orSISIDXREG(SISSR,0x1e,0x20);
+
+    inSISIDXREG(SISPART4,0x0d,backupP4_0d);
+    if(ivideo->vbflags & VB_301C) {
+       setSISIDXREG(SISPART4,0x0d,~0x07,0x01);
+    } else {
+       orSISIDXREG(SISPART4,0x0d,0x04);
+    }
+    SiS_DDC2Delay(&ivideo->SiS_Pr, 0x2000);
+
+    inSISIDXREG(SISPART2,0x00,backupP2_00);
+    outSISIDXREG(SISPART2,0x00,((backupP2_00 | 0x1c) & 0xfc));
+
+    inSISIDXREG(SISPART2,0x4d,backupP2_4d);
+    if(ivideo->vbflags & (VB_301C|VB_301LV|VB_302LV|VB_302ELV)) {
+       outSISIDXREG(SISPART2,0x4d,(backupP2_4d & ~0x10));
+    }
+
+    if(!(ivideo->vbflags & VB_301C)) {
+       SISDoSense(ivideo, 0, 0);
+    }
+
+    andSISIDXREG(SISCR, 0x32, ~0x14);
+
+    if(vga2_c || vga2) {
+       if(SISDoSense(ivideo, vga2, vga2_c)) {
+          if(biosflag & 0x01) {
+	     printk(KERN_INFO "%s %s SCART output\n", stdstr, tvstr);
+	     orSISIDXREG(SISCR, 0x32, 0x04);
+	  } else {
+	     printk(KERN_INFO "%s secondary VGA connection\n", stdstr);
+	     orSISIDXREG(SISCR, 0x32, 0x10);
+	  }
        }
     }
 
-    if(ivideo.vbflags & (VB_301C|VB_302ELV)) {
+    andSISIDXREG(SISCR, 0x32, 0x3f);
+
+    if(ivideo->vbflags & VB_301C) {
        orSISIDXREG(SISPART4,0x0d,0x04);
     }
 
-    haveresult = 0;
-    for(j = 0; j < 10; j++) {
-       result = 0;
-       for(i = 0; i < 3; i++) {
-          if(SISDoSense(svhs_bl, svhs_bh, svhs_cl, svhs_ch))
-	        result++;
+    if((ivideo->sisvga_engine == SIS_315_VGA) &&
+       (ivideo->vbflags & (VB_301C|VB_301LV|VB_302LV|VB_302ELV))) {
+       outSISIDXREG(SISPART2,0x4d,(backupP2_4d | 0x10));
+       SiS_DDC2Delay(&ivideo->SiS_Pr, 0x2000);
+       if((result = SISDoSense(ivideo, svhs, 0x0604))) {
+          if((result = SISDoSense(ivideo, cvbs, 0x0804))) {
+	     printk(KERN_INFO "%s %s YPbPr component output\n", stdstr, tvstr);
+	     orSISIDXREG(SISCR,0x32,0x80);
+	  }
        }
-       if((result == 0) || (result >= 2)) break;
-    }
-    if(result) {
-        printk(KERN_INFO "%s %s SVIDEO output\n", stdstr, tvstr);
-	ivideo.vbflags |= TV_SVIDEO;
-	orSISIDXREG(SISCR, 0x32, 0x02);
-	andSISIDXREG(SISCR, 0x32, ~0x05);
+       outSISIDXREG(SISPART2,0x4d,backupP2_4d);
     }
 
-    if(!result) {
+    andSISIDXREG(SISCR, 0x32, ~0x03);
 
-	haveresult = 0;
-       	for(j = 0; j < 10; j++) {
-           result = 0;
-           for(i = 0; i < 3; i++) {
-              if(SISDoSense(cvbs_bl, cvbs_bh, cvbs_cl, cvbs_ch))
-	        result++;
-           }
-           if((result == 0) || (result >= 2)) break;
-        }
-	if(result) {
-	    printk(KERN_INFO "%s %s COMPOSITE output\n", stdstr, tvstr);
-	    ivideo.vbflags |= TV_AVIDEO;
-	    orSISIDXREG(SISCR, 0x32, 0x01);
-	    andSISIDXREG(SISCR, 0x32, ~0x06);
-	} else {
-	    andSISIDXREG(SISCR, 0x32, ~0x07);
-	}
+    if(!(ivideo->vbflags & TV_YPBPR)) {
+       if((result = SISDoSense(ivideo, svhs, svhs_c))) {
+          printk(KERN_INFO "%s %s SVIDEO output\n", stdstr, tvstr);
+          orSISIDXREG(SISCR, 0x32, 0x02);
+       }
+       if((biosflag & 0x02) || (!result)) {
+          if(SISDoSense(ivideo, cvbs, cvbs_c)) {
+	     printk(KERN_INFO "%s %s COMPOSITE output\n", stdstr, tvstr);
+	     orSISIDXREG(SISCR, 0x32, 0x01);
+          }
+       }
     }
-    SISDoSense(0, 0, 0, 0);
+
+    SISDoSense(ivideo, 0, 0);
 
     outSISIDXREG(SISPART2,0x00,backupP2_00);
     outSISIDXREG(SISPART4,0x0d,backupP4_0d);
+    outSISIDXREG(SISSR,0x1e,backupSR_1e);
+
+    if(ivideo->vbflags & VB_301C) {
+       inSISIDXREG(SISPART2,0x00,biosflag);
+       if(biosflag & 0x20) {
+          for(myflag = 2; myflag > 0; myflag--) {
+	     biosflag ^= 0x20;
+	     outSISIDXREG(SISPART2,0x00,biosflag);
+	  }
+       }
+    }
+
+    outSISIDXREG(SISPART2,0x00,backupP2_00);
 }
 
 /* Determine and detect attached TV's on Chrontel */
-static void
-SiS_SenseCh(void)
+static void __devinit SiS_SenseCh(struct sis_video_info *ivideo)
 {
-
-   u8 temp1, temp2;
+#if defined(CONFIG_FB_SIS_300) || defined(CONFIG_FB_SIS_315)
+    u8 temp1, temp2;
+    char stdstr[] = "sisfb: Chrontel: Detected TV connected to";
+#endif
 #ifdef CONFIG_FB_SIS_300
-   unsigned char test[3];
-   int i;
+    unsigned char test[3];
+    int i;
 #endif
-   char stdstr[] = "sisfb: Chrontel: Detected TV connected to";
 
-   if(ivideo.chip < SIS_315H) {
+    if(ivideo->chip < SIS_315H) {
 
 #ifdef CONFIG_FB_SIS_300
-       SiS_Pr.SiS_IF_DEF_CH70xx = 1;		/* Chrontel 700x */
-       SiS_SetChrontelGPIO(&SiS_Pr, 0x9c);	/* Set general purpose IO for Chrontel communication */
-       SiS_DDC2Delay(&SiS_Pr, 1000);
-       temp1 = SiS_GetCH700x(&SiS_Pr, 0x25);
+       ivideo->SiS_Pr.SiS_IF_DEF_CH70xx = 1;		/* Chrontel 700x */
+       SiS_SetChrontelGPIO(&ivideo->SiS_Pr, 0x9c);	/* Set general purpose IO for Chrontel communication */
+       SiS_DDC2Delay(&ivideo->SiS_Pr, 1000);
+       temp1 = SiS_GetCH700x(&ivideo->SiS_Pr, 0x25);
        /* See Chrontel TB31 for explanation */
-       temp2 = SiS_GetCH700x(&SiS_Pr, 0x0e);
+       temp2 = SiS_GetCH700x(&ivideo->SiS_Pr, 0x0e);
        if(((temp2 & 0x07) == 0x01) || (temp2 & 0x04)) {
-	  SiS_SetCH700x(&SiS_Pr, 0x0b0e);
-	  SiS_DDC2Delay(&SiS_Pr, 300);
+	  SiS_SetCH700x(&ivideo->SiS_Pr, 0x0b0e);
+	  SiS_DDC2Delay(&ivideo->SiS_Pr, 300);
        }
-       temp2 = SiS_GetCH700x(&SiS_Pr, 0x25);
+       temp2 = SiS_GetCH700x(&ivideo->SiS_Pr, 0x25);
        if(temp2 != temp1) temp1 = temp2;
 
        if((temp1 >= 0x22) && (temp1 <= 0x50)) {
 	   /* Read power status */
-	   temp1 = SiS_GetCH700x(&SiS_Pr, 0x0e);
+	   temp1 = SiS_GetCH700x(&ivideo->SiS_Pr, 0x0e);
 	   if((temp1 & 0x03) != 0x03) {
      	        /* Power all outputs */
-		SiS_SetCH700x(&SiS_Pr, 0x0B0E);
-		SiS_DDC2Delay(&SiS_Pr, 300);
+		SiS_SetCH700x(&ivideo->SiS_Pr, 0x0B0E);
+		SiS_DDC2Delay(&ivideo->SiS_Pr, 300);
 	   }
 	   /* Sense connected TV devices */
 	   for(i = 0; i < 3; i++) {
-	       SiS_SetCH700x(&SiS_Pr, 0x0110);
-	       SiS_DDC2Delay(&SiS_Pr, 0x96);
-	       SiS_SetCH700x(&SiS_Pr, 0x0010);
-	       SiS_DDC2Delay(&SiS_Pr, 0x96);
-	       temp1 = SiS_GetCH700x(&SiS_Pr, 0x10);
+	       SiS_SetCH700x(&ivideo->SiS_Pr, 0x0110);
+	       SiS_DDC2Delay(&ivideo->SiS_Pr, 0x96);
+	       SiS_SetCH700x(&ivideo->SiS_Pr, 0x0010);
+	       SiS_DDC2Delay(&ivideo->SiS_Pr, 0x96);
+	       temp1 = SiS_GetCH700x(&ivideo->SiS_Pr, 0x10);
 	       if(!(temp1 & 0x08))       test[i] = 0x02;
 	       else if(!(temp1 & 0x02))  test[i] = 0x01;
 	       else                      test[i] = 0;
-	       SiS_DDC2Delay(&SiS_Pr, 0x96);
+	       SiS_DDC2Delay(&ivideo->SiS_Pr, 0x96);
 	   }
 
 	   if(test[0] == test[1])      temp1 = test[0];
@@ -3079,42 +2915,42 @@ SiS_SenseCh(void)
 	   }
 	   if(temp1 == 0x02) {
 		printk(KERN_INFO "%s SVIDEO output\n", stdstr);
-		ivideo.vbflags |= TV_SVIDEO;
+		ivideo->vbflags |= TV_SVIDEO;
 		orSISIDXREG(SISCR, 0x32, 0x02);
 		andSISIDXREG(SISCR, 0x32, ~0x05);
 	   } else if (temp1 == 0x01) {
 		printk(KERN_INFO "%s CVBS output\n", stdstr);
-		ivideo.vbflags |= TV_AVIDEO;
+		ivideo->vbflags |= TV_AVIDEO;
 		orSISIDXREG(SISCR, 0x32, 0x01);
 		andSISIDXREG(SISCR, 0x32, ~0x06);
 	   } else {
- 		SiS_SetCH70xxANDOR(&SiS_Pr, 0x010E,0xF8);
+ 		SiS_SetCH70xxANDOR(&ivideo->SiS_Pr, 0x010E,0xF8);
 		andSISIDXREG(SISCR, 0x32, ~0x07);
 	   }
        } else if(temp1 == 0) {
-	  SiS_SetCH70xxANDOR(&SiS_Pr, 0x010E,0xF8);
+	  SiS_SetCH70xxANDOR(&ivideo->SiS_Pr, 0x010E,0xF8);
 	  andSISIDXREG(SISCR, 0x32, ~0x07);
        }
        /* Set general purpose IO for Chrontel communication */
-       SiS_SetChrontelGPIO(&SiS_Pr, 0x00);
+       SiS_SetChrontelGPIO(&ivideo->SiS_Pr, 0x00);
 #endif
 
-   } else {
+    } else {
 
 #ifdef CONFIG_FB_SIS_315
-	SiS_Pr.SiS_IF_DEF_CH70xx = 2;		/* Chrontel 7019 */
-        temp1 = SiS_GetCH701x(&SiS_Pr, 0x49);
-	SiS_SetCH701x(&SiS_Pr, 0x2049);
-	SiS_DDC2Delay(&SiS_Pr, 0x96);
-	temp2 = SiS_GetCH701x(&SiS_Pr, 0x20);
+	ivideo->SiS_Pr.SiS_IF_DEF_CH70xx = 2;		/* Chrontel 7019 */
+        temp1 = SiS_GetCH701x(&ivideo->SiS_Pr, 0x49);
+	SiS_SetCH701x(&ivideo->SiS_Pr, 0x2049);
+	SiS_DDC2Delay(&ivideo->SiS_Pr, 0x96);
+	temp2 = SiS_GetCH701x(&ivideo->SiS_Pr, 0x20);
 	temp2 |= 0x01;
-	SiS_SetCH701x(&SiS_Pr, (temp2 << 8) | 0x20);
-	SiS_DDC2Delay(&SiS_Pr, 0x96);
+	SiS_SetCH701x(&ivideo->SiS_Pr, (temp2 << 8) | 0x20);
+	SiS_DDC2Delay(&ivideo->SiS_Pr, 0x96);
 	temp2 ^= 0x01;
-	SiS_SetCH701x(&SiS_Pr, (temp2 << 8) | 0x20);
-	SiS_DDC2Delay(&SiS_Pr, 0x96);
-	temp2 = SiS_GetCH701x(&SiS_Pr, 0x20);
-	SiS_SetCH701x(&SiS_Pr, (temp1 << 8) | 0x49);
+	SiS_SetCH701x(&ivideo->SiS_Pr, (temp2 << 8) | 0x20);
+	SiS_DDC2Delay(&ivideo->SiS_Pr, 0x96);
+	temp2 = SiS_GetCH701x(&ivideo->SiS_Pr, 0x20);
+	SiS_SetCH701x(&ivideo->SiS_Pr, (temp1 << 8) | 0x49);
         temp1 = 0;
 	if(temp2 & 0x02) temp1 |= 0x01;
 	if(temp2 & 0x10) temp1 |= 0x01;
@@ -3123,13 +2959,13 @@ SiS_SenseCh(void)
 	switch(temp1) {
 	case 0x01:
 	     printk(KERN_INFO "%s CVBS output\n", stdstr);
-	     ivideo.vbflags |= TV_AVIDEO;
+	     ivideo->vbflags |= TV_AVIDEO;
 	     orSISIDXREG(SISCR, 0x32, 0x01);
 	     andSISIDXREG(SISCR, 0x32, ~0x06);
              break;
 	case 0x02:
 	     printk(KERN_INFO "%s SVIDEO output\n", stdstr);
-	     ivideo.vbflags |= TV_SVIDEO;
+	     ivideo->vbflags |= TV_SVIDEO;
 	     orSISIDXREG(SISCR, 0x32, 0x02);
 	     andSISIDXREG(SISCR, 0x32, ~0x05);
              break;
@@ -3142,336 +2978,171 @@ SiS_SenseCh(void)
 	     andSISIDXREG(SISCR, 0x32, ~0x07);
 	}
 #endif
-
-   }
+    }
 }
 
-
 /* ------------------------ Heap routines -------------------------- */
 
-static int sisfb_heap_init(void)
+static u32 __devinit
+sisfb_getheapstart(struct sis_video_info *ivideo)
 {
-	SIS_OH *poh;
-	u8 temp=0;
-#ifdef CONFIG_FB_SIS_315
-	int            agp_enabled = 1;
-	u32            agp_size;
-	unsigned long *cmdq_baseport = 0;
-	unsigned long *read_port = 0;
-	unsigned long *write_port = 0;
-	SIS_CMDTYPE    cmd_type;
-#ifndef AGPOFF
-#if LINUX_VERSION_CODE >= KERNEL_VERSION(2,6,0)
-	struct agp_kern_info  *agp_info;
-	struct agp_memory     *agp;
-#else
-	agp_kern_info  *agp_info;
-	agp_memory     *agp;
-#endif
-	u32            agp_phys;
-#endif
-#endif
-/*     The heap start is either set manually using the "mem" parameter, or
- *     defaults as follows:
- *     -) If more than 16MB videoRAM available, let our heap start at 12MB.
- *     -) If more than  8MB videoRAM available, let our heap start at  8MB.
- *     -) If 4MB or less is available, let it start at 4MB.
- *     This is for avoiding a clash with X driver which uses the beginning
- *     of the videoRAM. To limit size of X framebuffer, use Option MaxXFBMem
- *     in XF86Config-4.
- *     The heap start can also be specified by parameter "mem" when starting the sisfb
- *     driver. sisfb mem=1024 lets heap starts at 1MB, etc.
- *
- *     On the 315 and Xabre series, the default is a 1MB heap since DRI is not
- *     supported there.
- */
-     if ((!sisfb_mem) || (sisfb_mem > (ivideo.video_size/1024))) {
-        if(sisvga_engine == SIS_300_VGA) {
-           if (ivideo.video_size > 0x1000000) {
-	        ivideo.heapstart = 0xc00000;
-	   } else if (ivideo.video_size > 0x800000) {
-	        ivideo.heapstart = 0x800000;
+	u32 ret = ivideo->sisfb_parm_mem * 1024;
+	u32 max = ivideo->video_size - ivideo->hwcursor_size;
+	u32 def;
+
+	/* Calculate heap start = end of memory for console
+	 *
+	 * CCCCCCCCDDDDDDDDDDDDDDDDDDDDDDDDDDDDHHHHQQQQQQQQQQ
+	 * C = console, D = heap, H = HWCursor, Q = cmd-queue
+	 *
+	 * Basically given by "mem" parameter
+	 *
+	 * maximum = videosize - cmd_queue - hwcursor
+	 *           (results in a heap of size 0)
+	 * default = SiS 300: depends on videosize
+	 *           SiS 315/330: 32k below max
+	 */
+
+	if(ivideo->sisvga_engine == SIS_300_VGA) {
+	   max -= TURBO_QUEUE_AREA_SIZE;
+	   if(ivideo->video_size > 0x1000000) {
+	      def = 0xc00000;
+	   } else if(ivideo->video_size > 0x800000) {
+	      def = 0x800000;
 	   } else {
-		ivideo.heapstart = 0x400000;
+	      def = 0x400000;
 	   }
 	} else {
-	   ivideo.heapstart = ivideo.video_size - 0x100000;
+	   max -= COMMAND_QUEUE_AREA_SIZE;
+	   def = max - 0x8000;
 	}
-     } else {
-           ivideo.heapstart = sisfb_mem * 1024;
-     }
-     sisfb_heap_start = (unsigned long) (ivideo.video_vbase + ivideo.heapstart);
-     printk(KERN_INFO "sisfb: Memory heap starting at %dK\n",
-     					(int)(ivideo.heapstart / 1024));
 
-     sisfb_heap_end = (unsigned long) ivideo.video_vbase + ivideo.video_size;
-     sisfb_heap_size = sisfb_heap_end - sisfb_heap_start;
+        if((!ret) || (ret > max) || (ivideo->cardnumber != 0)) {
+	   ret = def;
+        }
 
-#ifdef CONFIG_FB_SIS_315
-     if (sisvga_engine == SIS_315_VGA) {
-        /* Now initialize the 315/330 series' command queue mode.
-	 * On 315, there are three queue modes available which
-	 * are chosen by setting bits 7:5 in SR26:
-	 * 1. MMIO queue mode (bit 5, 0x20). The hardware will keep
-	 *    track of the queue, the FIFO, command parsing and so
-	 *    on. This is the one comparable to the 300 series.
-	 * 2. VRAM queue mode (bit 6, 0x40). In this case, one will
-	 *    have to do queue management himself. Register 0x85c4 will
-	 *    hold the location of the next free queue slot, 0x85c8
-	 *    is the "queue read pointer" whose way of working is
-	 *    unknown to me. Anyway, this mode would require a
-	 *    translation of the MMIO commands to some kind of
-	 *    accelerator assembly and writing these commands
-	 *    to the memory location pointed to by 0x85c4.
-	 *    We will not use this, as nobody knows how this
-	 *    "assembly" works, and as it would require a complete
-	 *    re-write of the accelerator code.
-	 * 3. AGP queue mode (bit 7, 0x80). Works as 2., but keeps the
-	 *    queue in AGP memory space.
-	 *
-	 * SR26 bit 4 is called "Bypass H/W queue".
-	 * SR26 bit 1 is called "Enable Command Queue Auto Correction"
-	 * SR26 bit 0 resets the queue
-	 * Size of queue memory is encoded in bits 3:2 like this:
-	 *    00  (0x00)  512K
-	 *    01  (0x04)  1M
-	 *    10  (0x08)  2M
-	 *    11  (0x0C)  4M
-	 * The queue location is to be written to 0x85C0.
-	 *
-         */
-	cmdq_baseport = (unsigned long *)(ivideo.mmio_vbase + MMIO_QUEUE_PHYBASE);
-	write_port    = (unsigned long *)(ivideo.mmio_vbase + MMIO_QUEUE_WRITEPORT);
-	read_port     = (unsigned long *)(ivideo.mmio_vbase + MMIO_QUEUE_READPORT);
+	return ret;
+}
 
-	DPRINTK("AGP base: 0x%p, read: 0x%p, write: 0x%p\n", cmdq_baseport, read_port, write_port);
+static int __devinit
+sisfb_heap_init(struct sis_video_info *ivideo)
+{
+     SIS_OH *poh;
 
-	agp_size  = COMMAND_QUEUE_AREA_SIZE;
+     ivideo->heapstart = ivideo->sisfb_mem = sisfb_getheapstart(ivideo);
 
-#ifndef AGPOFF
-	if (sisfb_queuemode == AGP_CMD_QUEUE) {
-#if LINUX_VERSION_CODE >= KERNEL_VERSION(2,6,0)
-		agp_info = vmalloc(sizeof(*agp_info));
-		memset((void*)agp_info, 0x00, sizeof(*agp_info));
-#else
-		agp_info = vmalloc(sizeof(agp_kern_info));
-		memset((void*)agp_info, 0x00, sizeof(agp_kern_info));
-#endif
-		agp_copy_info(agp_info);
+     ivideo->sisfb_heap_start = ivideo->video_vbase + ivideo->heapstart;
+     ivideo->sisfb_heap_end   = ivideo->video_vbase + ivideo->video_size;
 
-		agp_backend_acquire();
+     /* Initialize command queue (We use MMIO only) */
 
-		agp = agp_allocate_memory(COMMAND_QUEUE_AREA_SIZE/PAGE_SIZE,
-					  AGP_NORMAL_MEMORY);
-		if (agp == NULL) {
-			DPRINTK("sisfb: Allocating AGP buffer failed.\n");
-			agp_enabled = 0;
-		} else {
-			if (agp_bind_memory(agp, agp->pg_start) != 0) {
-				DPRINTK("sisfb: AGP: Failed to bind memory\n");
-				/* TODO: Free AGP memory here */
-				agp_enabled = 0;
-			} else {
-				agp_enable(0);
-			}
-		}
-	}
-#else
-	agp_enabled = 0;
-#endif
+#ifdef CONFIG_FB_SIS_315
+     if(ivideo->sisvga_engine == SIS_315_VGA) {
+        u32 tempq = 0;
+	u8  temp = 0;
 
-	/* Now select the queue mode */
+        ivideo->sisfb_heap_end -= COMMAND_QUEUE_AREA_SIZE;
 
-	if ((agp_enabled) && (sisfb_queuemode == AGP_CMD_QUEUE)) {
-		cmd_type = AGP_CMD_QUEUE;
-		printk(KERN_INFO "sisfb: Using AGP queue mode\n");
-/*	} else if (sisfb_heap_size >= COMMAND_QUEUE_AREA_SIZE)  */
-        } else if (sisfb_queuemode == VM_CMD_QUEUE) {
-		cmd_type = VM_CMD_QUEUE;
-		printk(KERN_INFO "sisfb: Using VRAM queue mode\n");
-	} else {
-		printk(KERN_INFO "sisfb: Using MMIO queue mode\n");
-		cmd_type = MMIO_CMD;
-	}
+	outSISIDXREG(SISSR, IND_SIS_CMDQUEUE_THRESHOLD, COMMAND_QUEUE_THRESHOLD);
+	outSISIDXREG(SISSR, IND_SIS_CMDQUEUE_SET, SIS_CMD_QUEUE_RESET);
 
-	switch (agp_size) {
-	   case 0x80000:
-		temp = SIS_CMD_QUEUE_SIZE_512k;
-		break;
-	   case 0x100000:
-		temp = SIS_CMD_QUEUE_SIZE_1M;
-		break;
-	   case 0x200000:
-		temp = SIS_CMD_QUEUE_SIZE_2M;
-		break;
-	   case 0x400000:
-		temp = SIS_CMD_QUEUE_SIZE_4M;
-		break;
-	}
+	tempq = MMIO_IN32(ivideo->mmio_vbase, MMIO_QUEUE_READPORT);
+	MMIO_OUT32(ivideo->mmio_vbase, MMIO_QUEUE_WRITEPORT, tempq);
 
-	switch (cmd_type) {
-	   case AGP_CMD_QUEUE:
-#ifndef AGPOFF
-		DPRINTK("sisfb: AGP buffer base = 0x%lx, offset = 0x%x, size = %dK\n",
-			agp_info->aper_base, agp->physical, agp_size/1024);
+	temp = SIS_CMD_QUEUE_SIZE_512k;
+	temp |= (SIS_MMIO_CMD_ENABLE | SIS_CMD_AUTO_CORR);
+	outSISIDXREG(SISSR, IND_SIS_CMDQUEUE_SET, temp);
 
-		agp_phys = agp_info->aper_base + agp->physical;
+	tempq = (u32)(ivideo->video_size - COMMAND_QUEUE_AREA_SIZE);
+	MMIO_OUT32(ivideo->mmio_vbase, MMIO_QUEUE_PHYBASE, tempq);
 
-		outSISIDXREG(SISCR,  IND_SIS_AGP_IO_PAD, 0);
-		outSISIDXREG(SISCR,  IND_SIS_AGP_IO_PAD, SIS_AGP_2X);
+	ivideo->caps |= MMIO_CMD_QUEUE_CAP;
+     }
+#endif
 
-                outSISIDXREG(SISSR, IND_SIS_CMDQUEUE_THRESHOLD, COMMAND_QUEUE_THRESHOLD);
+#ifdef CONFIG_FB_SIS_300
+     if(ivideo->sisvga_engine == SIS_300_VGA) {
+     	unsigned long tqueue_pos;
+	u8 tq_state;
 
-		outSISIDXREG(SISSR, IND_SIS_CMDQUEUE_SET, SIS_CMD_QUEUE_RESET);
+	ivideo->sisfb_heap_end -= TURBO_QUEUE_AREA_SIZE;
 
-		*write_port = *read_port;
+	tqueue_pos = (ivideo->video_size - TURBO_QUEUE_AREA_SIZE) / (64 * 1024);
 
-		temp |= SIS_AGP_CMDQUEUE_ENABLE;
-		outSISIDXREG(SISSR, IND_SIS_CMDQUEUE_SET, temp);
+	inSISIDXREG(SISSR, IND_SIS_TURBOQUEUE_SET, tq_state);
+	tq_state |= 0xf0;
+	tq_state &= 0xfc;
+	tq_state |= (u8)(tqueue_pos >> 8);
+	outSISIDXREG(SISSR, IND_SIS_TURBOQUEUE_SET, tq_state);
 
-		*cmdq_baseport = agp_phys;
+	outSISIDXREG(SISSR, IND_SIS_TURBOQUEUE_ADR, (u8)(tqueue_pos & 0xff));
 
-		sisfb_caps |= AGP_CMD_QUEUE_CAP;
+	ivideo->caps |= TURBO_QUEUE_CAP;
+     }
 #endif
-		break;
 
-	   case VM_CMD_QUEUE:
-		sisfb_heap_end -= COMMAND_QUEUE_AREA_SIZE;
-		sisfb_heap_size -= COMMAND_QUEUE_AREA_SIZE;
+     /* Reserve memory for the HWCursor */
+     ivideo->sisfb_heap_end -= ivideo->hwcursor_size;
+     ivideo->hwcursor_vbase = ivideo->sisfb_heap_end;
+     ivideo->caps |= HW_CURSOR_CAP;
 
-		outSISIDXREG(SISSR, IND_SIS_CMDQUEUE_THRESHOLD, COMMAND_QUEUE_THRESHOLD);
+     ivideo->sisfb_heap_size = ivideo->sisfb_heap_end - ivideo->sisfb_heap_start;
 
-		outSISIDXREG(SISSR, IND_SIS_CMDQUEUE_SET, SIS_CMD_QUEUE_RESET);
+     if(ivideo->cardnumber == 0) {
 
-		*write_port = *read_port;
+     	printk(KERN_INFO "sisfb: Memory heap starting at %dK, size %dK\n",
+     		(int)(ivideo->heapstart / 1024), (int)(ivideo->sisfb_heap_size / 1024));
 
-		temp |= SIS_VRAM_CMDQUEUE_ENABLE;
-		outSISIDXREG(SISSR, IND_SIS_CMDQUEUE_SET, temp);
+	sisfb_heap.vinfo = ivideo;
 
-		*cmdq_baseport = ivideo.video_size - COMMAND_QUEUE_AREA_SIZE;
+     	sisfb_heap.poha_chain = NULL;
+     	sisfb_heap.poh_freelist = NULL;
 
-		sisfb_caps |= VM_CMD_QUEUE_CAP;
+     	poh = sisfb_poh_new_node();
+     	if(poh == NULL) return 1;
 
-		DPRINTK("sisfb: VM Cmd Queue offset = 0x%lx, size is %dK\n",
-			*cmdq_baseport, COMMAND_QUEUE_AREA_SIZE/1024);
-		break;
+     	poh->poh_next = &sisfb_heap.oh_free;
+     	poh->poh_prev = &sisfb_heap.oh_free;
+     	poh->size = ivideo->sisfb_heap_size;
+     	poh->offset = ivideo->heapstart;
 
-	   default:  /* MMIO */
-	   	sisfb_heap_end -= COMMAND_QUEUE_AREA_SIZE;
-		sisfb_heap_size -= COMMAND_QUEUE_AREA_SIZE;
+     	sisfb_heap.oh_free.poh_next = poh;
+     	sisfb_heap.oh_free.poh_prev = poh;
+     	sisfb_heap.oh_free.size = 0;
+     	sisfb_heap.max_freesize = poh->size;
 
-		outSISIDXREG(SISSR, IND_SIS_CMDQUEUE_THRESHOLD, COMMAND_QUEUE_THRESHOLD);
-		outSISIDXREG(SISSR, IND_SIS_CMDQUEUE_SET, SIS_CMD_QUEUE_RESET);
+     	sisfb_heap.oh_used.poh_next = &sisfb_heap.oh_used;
+     	sisfb_heap.oh_used.poh_prev = &sisfb_heap.oh_used;
+     	sisfb_heap.oh_used.size = SENTINEL;
 
-		*write_port = *read_port;
+     } else {
 
-		/* Set Auto_Correction bit */
-		temp |= (SIS_MMIO_CMD_ENABLE | SIS_CMD_AUTO_CORR);
-		outSISIDXREG(SISSR, IND_SIS_CMDQUEUE_SET, temp);
+        printk(KERN_INFO "Skipped heap initialization for secondary cards\n");
 
-		*cmdq_baseport = ivideo.video_size - COMMAND_QUEUE_AREA_SIZE;
+     }
 
-		sisfb_caps |= MMIO_CMD_QUEUE_CAP;
+     return 0;
+}
 
-		DPRINTK("sisfb: MMIO Cmd Queue offset = 0x%lx, size is %dK\n",
-			*cmdq_baseport, COMMAND_QUEUE_AREA_SIZE/1024);
-		break;
-	}
-     } /* sisvga_engine = 315 */
-#endif
-
-#ifdef CONFIG_FB_SIS_300
-     if (sisvga_engine == SIS_300_VGA) {
-  	    /* Now initialize TurboQueue. TB is always located at the very
-	     * top of the video RAM. */
-	    if (sisfb_heap_size >= TURBO_QUEUE_AREA_SIZE) {
-		unsigned int  tqueue_pos;
-		u8 tq_state;
-
-		tqueue_pos = (ivideo.video_size -
-		       TURBO_QUEUE_AREA_SIZE) / (64 * 1024);
-
-		temp = (u8) (tqueue_pos & 0xff);
-
-		inSISIDXREG(SISSR, IND_SIS_TURBOQUEUE_SET, tq_state);
-		tq_state |= 0xf0;
-		tq_state &= 0xfc;
-		tq_state |= (u8) (tqueue_pos >> 8);
-		outSISIDXREG(SISSR, IND_SIS_TURBOQUEUE_SET, tq_state);
-
-		outSISIDXREG(SISSR, IND_SIS_TURBOQUEUE_ADR, temp);
-
-		sisfb_caps |= TURBO_QUEUE_CAP;
-
-		sisfb_heap_end -= TURBO_QUEUE_AREA_SIZE;
-		sisfb_heap_size -= TURBO_QUEUE_AREA_SIZE;
-		DPRINTK("sisfb: TurboQueue start at 0x%lx, size is %dK\n",
-			sisfb_heap_end, TURBO_QUEUE_AREA_SIZE/1024);
-	    }
-     }
-#endif
-     /* Now reserve memory for the HWCursor. It is always located at the very
-        top of the videoRAM, right below the TB memory area (if used). */
-     if (sisfb_heap_size >= sisfb_hwcursor_size) {
-		sisfb_heap_end -= sisfb_hwcursor_size;
-		sisfb_heap_size -= sisfb_hwcursor_size;
-		sisfb_hwcursor_vbase = sisfb_heap_end;
-
-		sisfb_caps |= HW_CURSOR_CAP;
-
-		DPRINTK("sisfb: Hardware Cursor start at 0x%lx, size is %dK\n",
-			sisfb_heap_end, sisfb_hwcursor_size/1024);
-     }
-
-     sisfb_heap.poha_chain = NULL;
-     sisfb_heap.poh_freelist = NULL;
-
-     poh = sisfb_poh_new_node();
-
-     if(poh == NULL)  return 1;
-	
-     poh->poh_next = &sisfb_heap.oh_free;
-     poh->poh_prev = &sisfb_heap.oh_free;
-     poh->size = sisfb_heap_end - sisfb_heap_start + 1;
-     poh->offset = sisfb_heap_start - (unsigned long) ivideo.video_vbase;
-
-     DPRINTK("sisfb: Heap start:0x%p, end:0x%p, len=%dk\n",
-		(char *) sisfb_heap_start, (char *) sisfb_heap_end,
-		(unsigned int) poh->size / 1024);
-
-     DPRINTK("sisfb: First Node offset:0x%x, size:%dk\n",
-		(unsigned int) poh->offset, (unsigned int) poh->size / 1024);
-
-     sisfb_heap.oh_free.poh_next = poh;
-     sisfb_heap.oh_free.poh_prev = poh;
-     sisfb_heap.oh_free.size = 0;
-     sisfb_heap.max_freesize = poh->size;
-
-     sisfb_heap.oh_used.poh_next = &sisfb_heap.oh_used;
-     sisfb_heap.oh_used.poh_prev = &sisfb_heap.oh_used;
-     sisfb_heap.oh_used.size = SENTINEL;
-
-     return 0;
-}
-
-static SIS_OH *sisfb_poh_new_node(void)
+static SIS_OH *
+sisfb_poh_new_node(void)
 {
 	int           i;
 	unsigned long cOhs;
 	SIS_OHALLOC   *poha;
 	SIS_OH        *poh;
 
-	if (sisfb_heap.poh_freelist == NULL) {
-		poha = kmalloc(OH_ALLOC_SIZE, GFP_KERNEL);
+	if(sisfb_heap.poh_freelist == NULL) {
+		poha = kmalloc(SIS_OH_ALLOC_SIZE, GFP_KERNEL);
 		if(!poha) return NULL;
 
 		poha->poha_next = sisfb_heap.poha_chain;
 		sisfb_heap.poha_chain = poha;
 
-		cOhs = (OH_ALLOC_SIZE - sizeof(SIS_OHALLOC)) / sizeof(SIS_OH) + 1;
+		cOhs = (SIS_OH_ALLOC_SIZE - sizeof(SIS_OHALLOC)) / sizeof(SIS_OH) + 1;
 
 		poh = &poha->aoh[0];
-		for (i = cOhs - 1; i != 0; i--) {
+		for(i = cOhs - 1; i != 0; i--) {
 			poh->poh_next = poh + 1;
 			poh = poh + 1;
 		}
@@ -3486,21 +3157,22 @@ static SIS_OH *sisfb_poh_new_node(void)
 	return (poh);
 }
 
-static SIS_OH *sisfb_poh_allocate(unsigned long size)
+static SIS_OH *
+sisfb_poh_allocate(u32 size)
 {
 	SIS_OH *pohThis;
 	SIS_OH *pohRoot;
 	int     bAllocated = 0;
 
-	if (size > sisfb_heap.max_freesize) {
-		DPRINTK("sisfb: Can't allocate %dk size on offscreen\n",
+	if(size > sisfb_heap.max_freesize) {
+		DPRINTK("sisfb: Can't allocate %dk video memory\n",
 			(unsigned int) size / 1024);
 		return (NULL);
 	}
 
 	pohThis = sisfb_heap.oh_free.poh_next;
 
-	while (pohThis != &sisfb_heap.oh_free) {
+	while(pohThis != &sisfb_heap.oh_free) {
 		if (size <= pohThis->size) {
 			bAllocated = 1;
 			break;
@@ -3508,19 +3180,19 @@ static SIS_OH *sisfb_poh_allocate(unsigned long size)
 		pohThis = pohThis->poh_next;
 	}
 
-	if (!bAllocated) {
-		DPRINTK("sisfb: Can't allocate %dk size on offscreen\n",
+	if(!bAllocated) {
+		DPRINTK("sisfb: Can't allocate %dk video memory\n",
 			(unsigned int) size / 1024);
 		return (NULL);
 	}
 
-	if (size == pohThis->size) {
+	if(size == pohThis->size) {
 		pohRoot = pohThis;
 		sisfb_delete_node(pohThis);
 	} else {
 		pohRoot = sisfb_poh_new_node();
 
-		if (pohRoot == NULL) {
+		if(pohRoot == NULL) {
 			return (NULL);
 		}
 
@@ -3539,7 +3211,8 @@ static SIS_OH *sisfb_poh_allocate(unsigned long size)
 	return (pohRoot);
 }
 
-static void sisfb_delete_node(SIS_OH *poh)
+static void
+sisfb_delete_node(SIS_OH *poh)
 {
 	SIS_OH *poh_prev;
 	SIS_OH *poh_next;
@@ -3549,10 +3222,10 @@ static void sisfb_delete_node(SIS_OH *poh)
 
 	poh_prev->poh_next = poh_next;
 	poh_next->poh_prev = poh_prev;
-
 }
 
-static void sisfb_insert_node(SIS_OH *pohList, SIS_OH *poh)
+static void
+sisfb_insert_node(SIS_OH *pohList, SIS_OH *poh)
 {
 	SIS_OH *pohTemp;
 
@@ -3565,15 +3238,16 @@ static void sisfb_insert_node(SIS_OH *pohList, SIS_OH *poh)
 	poh->poh_next = pohTemp;
 }
 
-static SIS_OH *sisfb_poh_free(unsigned long base)
+static SIS_OH *
+sisfb_poh_free(u32 base)
 {
 	SIS_OH *pohThis;
 	SIS_OH *poh_freed;
 	SIS_OH *poh_prev;
 	SIS_OH *poh_next;
-	unsigned long ulUpper;
-	unsigned long ulLower;
-	int foundNode = 0;
+	u32     ulUpper;
+	u32     ulLower;
+	int     foundNode = 0;
 
 	poh_freed = sisfb_heap.oh_used.poh_next;
 
@@ -3586,7 +3260,7 @@ static SIS_OH *sisfb_poh_free(unsigned long base)
 		poh_freed = poh_freed->poh_next;
 	}
 
-	if (!foundNode)  return (NULL);
+	if(!foundNode) return(NULL);
 
 	sisfb_heap.max_freesize += poh_freed->size;
 
@@ -3596,12 +3270,10 @@ static SIS_OH *sisfb_poh_free(unsigned long base)
 
 	pohThis = sisfb_heap.oh_free.poh_next;
 
-	while (pohThis != &sisfb_heap.oh_free) {
-		if (pohThis->offset == ulUpper) {
+	while(pohThis != &sisfb_heap.oh_free) {
+		if(pohThis->offset == ulUpper) {
 			poh_next = pohThis;
-		}
-			else if ((pohThis->offset + pohThis->size) ==
-				 ulLower) {
+		} else if((pohThis->offset + pohThis->size) == ulLower) {
 			poh_prev = pohThis;
 		}
 		pohThis = pohThis->poh_next;
@@ -3609,65 +3281,73 @@ static SIS_OH *sisfb_poh_free(unsigned long base)
 
 	sisfb_delete_node(poh_freed);
 
-	if (poh_prev && poh_next) {
+	if(poh_prev && poh_next) {
 		poh_prev->size += (poh_freed->size + poh_next->size);
 		sisfb_delete_node(poh_next);
 		sisfb_free_node(poh_freed);
 		sisfb_free_node(poh_next);
-		return (poh_prev);
+		return(poh_prev);
 	}
 
-	if (poh_prev) {
+	if(poh_prev) {
 		poh_prev->size += poh_freed->size;
 		sisfb_free_node(poh_freed);
-		return (poh_prev);
+		return(poh_prev);
 	}
 
-	if (poh_next) {
+	if(poh_next) {
 		poh_next->size += poh_freed->size;
 		poh_next->offset = poh_freed->offset;
 		sisfb_free_node(poh_freed);
-		return (poh_next);
+		return(poh_next);
 	}
 
 	sisfb_insert_node(&sisfb_heap.oh_free, poh_freed);
 
-	return (poh_freed);
+	return(poh_freed);
 }
 
-static void sisfb_free_node(SIS_OH *poh)
+static void
+sisfb_free_node(SIS_OH *poh)
 {
 	if(poh == NULL) return;
 
 	poh->poh_next = sisfb_heap.poh_freelist;
 	sisfb_heap.poh_freelist = poh;
-
 }
 
-void sis_malloc(struct sis_memreq *req)
+void
+sis_malloc(struct sis_memreq *req)
 {
-	SIS_OH *poh;
+	struct sis_video_info *ivideo = sisfb_heap.vinfo;
+	SIS_OH *poh = NULL;
 
-	poh = sisfb_poh_allocate(req->size);
+	if((ivideo) && (!ivideo->havenoheap)) {
+	   poh = sisfb_poh_allocate((u32)req->size);
+	}
 
 	if(poh == NULL) {
-		req->offset = 0;
-		req->size = 0;
-		DPRINTK("sisfb: Video RAM allocation failed\n");
+	   req->offset = req->size = 0;
+	   DPRINTK("sisfb: Video RAM allocation failed\n");
 	} else {
-		DPRINTK("sisfb: Video RAM allocation succeeded: 0x%p\n",
-			(char *) (poh->offset + (unsigned long) ivideo.video_vbase));
-
-		req->offset = poh->offset;
-		req->size = poh->size;
+	   req->offset = poh->offset;
+	   req->size = poh->size;
+	   DPRINTK("sisfb: Video RAM allocation succeeded: 0x%lx\n",
+	   	    (poh->offset + ivideo->video_vbase));
 	}
 }
 
-void sis_free(unsigned long base)
+/* sis_free: u32 because "base" is offset inside video ram, can never be >4GB */
+
+void
+sis_free(u32 base)
 {
+	struct sis_video_info *ivideo = sisfb_heap.vinfo;
 	SIS_OH *poh;
 
-	poh = sisfb_poh_free(base);
+	if((!ivideo) || (ivideo->havenoheap)) return;
+
+	poh = sisfb_poh_free((u32)base);
 
 	if(poh == NULL) {
 		DPRINTK("sisfb: sisfb_poh_free() failed at base 0x%x\n",
@@ -3677,125 +3357,313 @@ void sis_free(unsigned long base)
 
 /* --------------------- SetMode routines ------------------------- */
 
-static void sisfb_pre_setmode(void)
+static void
+sisfb_pre_setmode(struct sis_video_info *ivideo)
 {
-	u8 cr30 = 0, cr31 = 0, cr33 = 0, cr35 = 0;
+	u8 cr30 = 0, cr31 = 0, cr33 = 0, cr35 = 0, cr38 = 0;
+	int tvregnum = 0;
 
-	ivideo.currentvbflags &= (VB_VIDEOBRIDGE | VB_DISPTYPE_DISP2);
+	ivideo->currentvbflags &= (VB_VIDEOBRIDGE | VB_DISPTYPE_DISP2);
 
 	inSISIDXREG(SISCR, 0x31, cr31);
 	cr31 &= ~0x60;
 	cr31 |= 0x04;
 
-	cr33 = sisfb_rate_idx & 0x0F;
+	cr33 = ivideo->rate_idx & 0x0F;
+
+#ifdef CONFIG_FB_SIS_315
+	if(ivideo->sisvga_engine == SIS_315_VGA) {
+	   if(ivideo->chip >= SIS_661) {
+	      inSISIDXREG(SISCR, 0x38, cr38);
+	      cr38 &= ~0x07;  /* Clear LCDA/DualEdge and YPbPr bits */
+	   } else {
+	      tvregnum = 0x38;
+	      inSISIDXREG(SISCR, tvregnum, cr38);
+	      cr38 &= ~0x3b;  /* Clear LCDA/DualEdge and YPbPr bits */
+	   }
+	}
+#endif
+#ifdef CONFIG_FB_SIS_300
+	if(ivideo->sisvga_engine == SIS_300_VGA) {
+	   tvregnum = 0x35;
+	   inSISIDXREG(SISCR, tvregnum, cr38);
+	}
+#endif
+
+	SiS_SetEnableDstn(&ivideo->SiS_Pr, FALSE);
+	SiS_SetEnableFstn(&ivideo->SiS_Pr, FALSE);
 
-	SiS_SetEnableDstn(&SiS_Pr, FALSE);
-	SiS_SetEnableFstn(&SiS_Pr, FALSE);
+	switch(ivideo->currentvbflags & VB_DISPTYPE_DISP2) {
 
-	switch (ivideo.currentvbflags & VB_DISPTYPE_DISP2) {
 	   case CRT2_TV:
-		ivideo.disp_state = DISPTYPE_TV;
-		if (ivideo.vbflags & TV_SVIDEO) {
-			cr30 = (SIS_VB_OUTPUT_SVIDEO | SIS_SIMULTANEOUS_VIEW_ENABLE);
-			ivideo.currentvbflags |= TV_SVIDEO;
-			ivideo.TV_plug = TVPLUG_SVIDEO;
-		} else if (ivideo.vbflags & TV_AVIDEO) {
-			cr30 = (SIS_VB_OUTPUT_COMPOSITE | SIS_SIMULTANEOUS_VIEW_ENABLE);
-			ivideo.currentvbflags |= TV_AVIDEO;
-			ivideo.TV_plug = TVPLUG_COMPOSITE;
-		} else if (ivideo.vbflags & TV_SCART) {
-			cr30 = (SIS_VB_OUTPUT_SCART | SIS_SIMULTANEOUS_VIEW_ENABLE);
-			ivideo.currentvbflags |= TV_SCART;
-			ivideo.TV_plug = TVPLUG_SCART;
-		}
-		cr31 |= SIS_DRIVER_MODE;
-
-		if(!(ivideo.vbflags & TV_HIVISION)) {
-	        	if (ivideo.vbflags & TV_PAL) {
-		 		cr31 |= 0x01;
-				cr35 |= 0x01;
-				ivideo.currentvbflags |= TV_PAL;
-				ivideo.TV_type = TVMODE_PAL;
-                	} else {
-		       		cr31 &= ~0x01;
-				cr35 &= ~0x01;
-				ivideo.currentvbflags |= TV_NTSC;
-				ivideo.TV_type = TVMODE_NTSC;
-			}
-		}
-		break;
+	      cr38 &= ~0xc0;   /* Clear PAL-M / PAL-N bits */
+	      if((ivideo->vbflags & TV_YPBPR) && (ivideo->vbflags & (VB_301C|VB_301LV|VB_302LV))) {
+#ifdef CONFIG_FB_SIS_315
+	         if(ivideo->chip >= SIS_661) {
+	            cr38 |= 0x04;
+	            if(ivideo->vbflags & TV_YPBPR525P)       cr35 |= 0x20;
+		    else if(ivideo->vbflags & TV_YPBPR750P)  cr35 |= 0x40;
+		    else if(ivideo->vbflags & TV_YPBPR1080I) cr35 |= 0x60;
+		    cr30 |= SIS_SIMULTANEOUS_VIEW_ENABLE;
+		    cr35 &= ~0x01;
+		    ivideo->currentvbflags |= (TV_YPBPR | (ivideo->vbflags & TV_YPBPRALL));
+	         } else if(ivideo->sisvga_engine == SIS_315_VGA) {
+	            cr30 |= (0x80 | SIS_SIMULTANEOUS_VIEW_ENABLE);
+		    cr38 |= 0x08;
+	            if(ivideo->vbflags & TV_YPBPR525P)       cr38 |= 0x10;
+		    else if(ivideo->vbflags & TV_YPBPR750P)  cr38 |= 0x20;
+		    else if(ivideo->vbflags & TV_YPBPR1080I) cr38 |= 0x30;
+		    cr31 &= ~0x01;
+		    ivideo->currentvbflags |= (TV_YPBPR | (ivideo->vbflags & TV_YPBPRALL));
+	         }
+#endif
+	      } else if((ivideo->vbflags & TV_HIVISION) && (ivideo->vbflags & (VB_301|VB_301B|VB_302B))) {
+	         if(ivideo->chip >= SIS_661) {
+	            cr38 |= 0x04;
+	            cr35 |= 0x60;
+	         } else {
+	            cr30 |= 0x80;
+	         }
+		 cr30 |= SIS_SIMULTANEOUS_VIEW_ENABLE;
+	         cr31 |= 0x01;
+	         cr35 |= 0x01;
+		 ivideo->currentvbflags |= TV_HIVISION;
+	      } else if(ivideo->vbflags & TV_SCART) {
+		 cr30 = (SIS_VB_OUTPUT_SCART | SIS_SIMULTANEOUS_VIEW_ENABLE);
+		 cr31 |= 0x01;
+		 cr35 |= 0x01;
+		 ivideo->currentvbflags |= TV_SCART;
+	      } else {
+		 if(ivideo->vbflags & TV_SVIDEO) {
+		    cr30 = (SIS_VB_OUTPUT_SVIDEO | SIS_SIMULTANEOUS_VIEW_ENABLE);
+		    ivideo->currentvbflags |= TV_SVIDEO;
+		 }
+		 if(ivideo->vbflags & TV_AVIDEO) {
+		    cr30 = (SIS_VB_OUTPUT_COMPOSITE | SIS_SIMULTANEOUS_VIEW_ENABLE);
+		    ivideo->currentvbflags |= TV_AVIDEO;
+		 }
+	      }
+	      cr31 |= SIS_DRIVER_MODE;
+
+	      if(ivideo->vbflags & (TV_AVIDEO|TV_SVIDEO)) {
+	         if(ivideo->vbflags & TV_PAL) {
+		    cr31 |= 0x01; cr35 |= 0x01;
+		    ivideo->currentvbflags |= TV_PAL;
+		    if(ivideo->vbflags & TV_PALM) {
+		       cr38 |= 0x40; cr35 |= 0x04;
+		       ivideo->currentvbflags |= TV_PALM;
+		    } else if(ivideo->vbflags & TV_PALN) {
+		       cr38 |= 0x80; cr35 |= 0x08;
+		       ivideo->currentvbflags |= TV_PALN;
+	  	    }
+                 } else {
+		    cr31 &= ~0x01; cr35 &= ~0x01;
+		    ivideo->currentvbflags |= TV_NTSC;
+		    if(ivideo->vbflags & TV_NTSCJ) {
+		       cr38 |= 0x40; cr35 |= 0x02;
+		       ivideo->currentvbflags |= TV_NTSCJ;
+	 	    }
+		 }
+	      }
+	      break;
+
 	   case CRT2_LCD:
-		ivideo.disp_state = DISPTYPE_LCD;
-		cr30  = (SIS_VB_OUTPUT_LCD | SIS_SIMULTANEOUS_VIEW_ENABLE);
-		cr31 |= SIS_DRIVER_MODE;
-		SiS_SetEnableDstn(&SiS_Pr, sisfb_dstn);
-	        SiS_SetEnableFstn(&SiS_Pr, sisfb_fstn);
-		break;
+	      cr30  = (SIS_VB_OUTPUT_LCD | SIS_SIMULTANEOUS_VIEW_ENABLE);
+	      cr31 |= SIS_DRIVER_MODE;
+	      SiS_SetEnableDstn(&ivideo->SiS_Pr, ivideo->sisfb_dstn);
+	      SiS_SetEnableFstn(&ivideo->SiS_Pr, ivideo->sisfb_fstn);
+	      break;
+
 	   case CRT2_VGA:
-		ivideo.disp_state = DISPTYPE_CRT2;
-		cr30 = (SIS_VB_OUTPUT_CRT2 | SIS_SIMULTANEOUS_VIEW_ENABLE);
-		cr31 |= SIS_DRIVER_MODE;
-		if(sisfb_nocrt2rate) {
-			cr33 |= (sisbios_mode[sisfb_mode_idx].rate_idx << 4);
-		} else {
-			cr33 |= ((sisfb_rate_idx & 0x0F) << 4);
-		}
-		break;
+	      cr30 = (SIS_VB_OUTPUT_CRT2 | SIS_SIMULTANEOUS_VIEW_ENABLE);
+	      cr31 |= SIS_DRIVER_MODE;
+	      if(ivideo->sisfb_nocrt2rate) {
+		 cr33 |= (sisbios_mode[ivideo->sisfb_mode_idx].rate_idx << 4);
+	      } else {
+		 cr33 |= ((ivideo->rate_idx & 0x0F) << 4);
+	      }
+	      break;
+
 	   default:	/* disable CRT2 */
-		cr30 = 0x00;
-		cr31 |= (SIS_DRIVER_MODE | SIS_VB_OUTPUT_DISABLE);
+	      cr30 = 0x00;
+	      cr31 |= (SIS_DRIVER_MODE | SIS_VB_OUTPUT_DISABLE);
 	}
 
-	if(ivideo.chip >= SIS_661) {
-	   cr31 &= ~0x01;
-	   /* Leave overscan bit alone */
-	   setSISIDXREG(SISCR, 0x35, ~0x10, cr35);
-	}
-	outSISIDXREG(SISCR, IND_SIS_SCRATCH_REG_CR30, cr30);
-	outSISIDXREG(SISCR, IND_SIS_SCRATCH_REG_CR31, cr31);
-	outSISIDXREG(SISCR, IND_SIS_SCRATCH_REG_CR33, cr33);
+	outSISIDXREG(SISCR, 0x30, cr30);
+	outSISIDXREG(SISCR, 0x33, cr33);
 
+	if(ivideo->chip >= SIS_661) {
 #ifdef CONFIG_FB_SIS_315
-        if(sisvga_engine == SIS_315_VGA) {
-	   /* Clear LCDA and PAL-N/M bits */
-	   andSISIDXREG(SISCR,0x38,~0x03);
-	   if(ivideo.chip < SIS_661) {
-	      andSISIDXREG(SISCR,0x38,~0xc0);
-	   }
+	   cr31 &= ~0x01;                          /* Clear PAL flag (now in CR35) */
+	   setSISIDXREG(SISCR, 0x35, ~0x10, cr35); /* Leave overscan bit alone */
+	   cr38 &= 0x07;                           /* Use only LCDA and HiVision/YPbPr bits */
+	   setSISIDXREG(SISCR, 0x38, 0xf8, cr38);
+#endif
+	} else if(ivideo->chip != SIS_300) {
+	   outSISIDXREG(SISCR, tvregnum, cr38);
 	}
+	outSISIDXREG(SISCR, 0x31, cr31);
+
+	if(ivideo->accel) sisfb_syncaccel(ivideo);
+
+	ivideo->SiS_Pr.SiS_UseOEM = ivideo->sisfb_useoem;
+}
+
+/* Fix SR11 for 661 and later */
+#ifdef CONFIG_FB_SIS_315
+static void
+sisfb_fixup_SR11(struct sis_video_info *ivideo)
+{
+    u8  tmpreg;
+
+    if(ivideo->chip >= SIS_661) {
+       inSISIDXREG(SISSR,0x11,tmpreg);
+       if(tmpreg & 0x20) {
+          inSISIDXREG(SISSR,0x3e,tmpreg);
+	  tmpreg = (tmpreg + 1) & 0xff;
+	  outSISIDXREG(SISSR,0x3e,tmpreg);
+	  inSISIDXREG(SISSR,0x11,tmpreg);
+       }
+       if(tmpreg & 0xf0) {
+          andSISIDXREG(SISSR,0x11,0x0f);
+       }
+    }
+}
 #endif
 
-	if(ivideo.accel) sisfb_syncaccel();
+static void sisfb_set_TVxposoffset(struct sis_video_info *ivideo, int val)
+{
+   if(val > 32) val = 32;
+   if(val < -32) val = -32;
+   ivideo->tvxpos = val;
+
+   if(ivideo->sisfblocked) return;
+   if(!ivideo->modechanged) return;
+
+   if(ivideo->currentvbflags & CRT2_TV) {
+
+      if(ivideo->vbflags & VB_CHRONTEL) {
+
+	 int x = ivideo->tvx;
+
+	 switch(ivideo->chronteltype) {
+	 case 1:
+	     x += val;
+	     if(x < 0) x = 0;
+	     outSISIDXREG(SISSR,0x05,0x86);
+	     SiS_SetCH700x(&ivideo->SiS_Pr, (((x & 0xff) << 8) | 0x0a));
+	     SiS_SetCH70xxANDOR(&ivideo->SiS_Pr, (((x & 0x0100) << 1) | 0x08),0xFD);
+	     break;
+	 case 2:
+	     /* Not supported by hardware */
+	     break;
+	 }
 
-	SiS_Pr.SiS_UseOEM = sisfb_useoem;
+      } else if(ivideo->vbflags & VB_SISBRIDGE) {
+
+	 u8 p2_1f,p2_20,p2_2b,p2_42,p2_43;
+	 unsigned short temp;
+
+	 p2_1f = ivideo->p2_1f;
+	 p2_20 = ivideo->p2_20;
+	 p2_2b = ivideo->p2_2b;
+	 p2_42 = ivideo->p2_42;
+	 p2_43 = ivideo->p2_43;
+
+	 temp = p2_1f | ((p2_20 & 0xf0) << 4);
+	 temp += (val * 2);
+	 p2_1f = temp & 0xff;
+	 p2_20 = (temp & 0xf00) >> 4;
+	 p2_2b = ((p2_2b & 0x0f) + (val * 2)) & 0x0f;
+	 temp = p2_43 | ((p2_42 & 0xf0) << 4);
+	 temp += (val * 2);
+	 p2_43 = temp & 0xff;
+	 p2_42 = (temp & 0xf00) >> 4;
+	 outSISIDXREG(SISPART2,0x1f,p2_1f);
+	 setSISIDXREG(SISPART2,0x20,0x0F,p2_20);
+	 setSISIDXREG(SISPART2,0x2b,0xF0,p2_2b);
+	 setSISIDXREG(SISPART2,0x42,0x0F,p2_42);
+	 outSISIDXREG(SISPART2,0x43,p2_43);
+      }
+   }
 }
 
-static void sisfb_post_setmode(void)
+static void sisfb_set_TVyposoffset(struct sis_video_info *ivideo, int val)
+{
+   if(val > 32) val = 32;
+   if(val < -32) val = -32;
+   ivideo->tvypos = val;
+
+   if(ivideo->sisfblocked) return;
+   if(!ivideo->modechanged) return;
+
+   if(ivideo->currentvbflags & CRT2_TV) {
+
+      if(ivideo->vbflags & VB_CHRONTEL) {
+
+	 int y = ivideo->tvy;
+
+	 switch(ivideo->chronteltype) {
+	 case 1:
+	    y -= val;
+	    if(y < 0) y = 0;
+	    outSISIDXREG(SISSR,0x05,0x86);
+	    SiS_SetCH700x(&ivideo->SiS_Pr, (((y & 0xff) << 8) | 0x0b));
+	    SiS_SetCH70xxANDOR(&ivideo->SiS_Pr, ((y & 0x0100) | 0x08),0xFE);
+	    break;
+	 case 2:
+	    /* Not supported by hardware */
+	    break;
+	 }
+
+      } else if(ivideo->vbflags & VB_SISBRIDGE) {
+
+	 char p2_01, p2_02;
+	 val /= 2;
+	 p2_01 = ivideo->p2_01;
+	 p2_02 = ivideo->p2_02;
+
+	 p2_01 += val;
+	 p2_02 += val;
+	 while((p2_01 <= 0) || (p2_02 <= 0)) {
+	    p2_01 += 2;
+	    p2_02 += 2;
+	 }
+	 outSISIDXREG(SISPART2,0x01,p2_01);
+	 outSISIDXREG(SISPART2,0x02,p2_02);
+      }
+   }
+}
+
+static void
+sisfb_post_setmode(struct sis_video_info *ivideo)
 {
-	u8 reg;
 	BOOLEAN crt1isoff = FALSE;
+	BOOLEAN doit = TRUE;
+#if defined(CONFIG_FB_SIS_300) || defined(CONFIG_FB_SIS_315)
+	u8 reg;
+#endif
 #ifdef CONFIG_FB_SIS_315
 	u8 reg1;
 #endif
-#ifdef CONFIG_FB_SIS_300
-	BOOLEAN doit = TRUE;
-#endif
-	/* We can't switch off CRT1 if bridge is in slave mode */
-	if(ivideo.vbflags & VB_VIDEOBRIDGE) {
-#ifdef CONFIG_FB_SIS_300
-		if(sisvga_engine == SIS_300_VGA) {
-			inSISIDXREG(SISPART1, 0x00, reg);
-			if((reg & 0xa0) == 0x20) {
-				doit = FALSE;
-			}
-		}
+
+	outSISIDXREG(SISSR,0x05,0x86);
+
+#ifdef CONFIG_FB_SIS_315
+	sisfb_fixup_SR11(ivideo);
 #endif
-	} else sisfb_crt1off = 0;
 
-	if(sisvga_engine == SIS_300_VGA) {
+	/* Now we actually HAVE changed the display mode */
+        ivideo->modechanged = 1;
+
+	/* We can't switch off CRT1 if bridge is in slave mode */
+	if(ivideo->vbflags & VB_VIDEOBRIDGE) {
+		if(sisfb_bridgeisslave(ivideo)) doit = FALSE;
+	} else ivideo->sisfb_crt1off = 0;
 
 #ifdef CONFIG_FB_SIS_300
-	   if((sisfb_crt1off) && (doit)) {
+	if(ivideo->sisvga_engine == SIS_300_VGA) {
+	   if((ivideo->sisfb_crt1off) && (doit)) {
 	        crt1isoff = TRUE;
 		reg = 0x00;
 	   } else {
@@ -3803,12 +3671,11 @@ static void sisfb_post_setmode(void)
 		reg = 0x80;
 	   }
 	   setSISIDXREG(SISCR, 0x17, 0x7f, reg);
+	}
 #endif
-
-	} else {
-
 #ifdef CONFIG_FB_SIS_315
-	   if(sisfb_crt1off) {
+	if(ivideo->sisvga_engine == SIS_315_VGA) {
+	   if((ivideo->sisfb_crt1off) && (doit)) {
 	        crt1isoff = TRUE;
 		reg  = 0x40;
 		reg1 = 0xc0;
@@ -3818,66 +3685,89 @@ static void sisfb_post_setmode(void)
 		reg1 = 0x00;
 
 	   }
-	   setSISIDXREG(SISCR, SiS_Pr.SiS_MyCR63, ~0x40, reg);
+	   setSISIDXREG(SISCR, ivideo->SiS_Pr.SiS_MyCR63, ~0x40, reg);
 	   setSISIDXREG(SISSR, 0x1f, ~0xc0, reg1);
-#endif
-
 	}
+#endif
 
 	if(crt1isoff) {
-	   ivideo.currentvbflags &= ~VB_DISPTYPE_CRT1;
-	   ivideo.currentvbflags |= VB_SINGLE_MODE;
-	   ivideo.disp_state |= DISPMODE_SINGLE;
+	   ivideo->currentvbflags &= ~VB_DISPTYPE_CRT1;
+	   ivideo->currentvbflags |= VB_SINGLE_MODE;
 	} else {
-	   ivideo.currentvbflags |= VB_DISPTYPE_CRT1;
-	   ivideo.disp_state |= DISPTYPE_CRT1;
-	   if(ivideo.currentvbflags & VB_DISPTYPE_CRT2) {
-	  	ivideo.currentvbflags |= VB_MIRROR_MODE;
-		ivideo.disp_state |= DISPMODE_MIRROR;
+	   ivideo->currentvbflags |= VB_DISPTYPE_CRT1;
+	   if(ivideo->currentvbflags & VB_DISPTYPE_CRT2) {
+	  	ivideo->currentvbflags |= VB_MIRROR_MODE;
 	   } else {
-	 	ivideo.currentvbflags |= VB_SINGLE_MODE;
-		ivideo.disp_state |= DISPMODE_SINGLE;
+	 	ivideo->currentvbflags |= VB_SINGLE_MODE;
 	   }
 	}
 
         andSISIDXREG(SISSR, IND_SIS_RAMDAC_CONTROL, ~0x04);
 
-	if((ivideo.currentvbflags & CRT2_TV) && (ivideo.vbflags & VB_301)) {  /* Set filter for SiS301 */
+	if(ivideo->currentvbflags & CRT2_TV) {
+	   if(ivideo->vbflags & VB_SISBRIDGE) {
+	      inSISIDXREG(SISPART2,0x1f,ivideo->p2_1f);
+	      inSISIDXREG(SISPART2,0x20,ivideo->p2_20);
+	      inSISIDXREG(SISPART2,0x2b,ivideo->p2_2b);
+	      inSISIDXREG(SISPART2,0x42,ivideo->p2_42);
+	      inSISIDXREG(SISPART2,0x43,ivideo->p2_43);
+	      inSISIDXREG(SISPART2,0x01,ivideo->p2_01);
+	      inSISIDXREG(SISPART2,0x02,ivideo->p2_02);
+	   } else if(ivideo->vbflags & VB_CHRONTEL) {
+	      if(ivideo->chronteltype == 1) {
+	         ivideo->tvx = SiS_GetCH700x(&ivideo->SiS_Pr, 0x0a);
+	         ivideo->tvx |= (((SiS_GetCH700x(&ivideo->SiS_Pr, 0x08) & 0x02) >> 1) << 8);
+	         ivideo->tvy = SiS_GetCH700x(&ivideo->SiS_Pr, 0x0b);
+	         ivideo->tvy |= ((SiS_GetCH700x(&ivideo->SiS_Pr, 0x08) & 0x01) << 8);
+ 	      }
+	   }
+	}
+
+	if(ivideo->tvxpos) {
+   	   sisfb_set_TVxposoffset(ivideo, ivideo->tvxpos);
+	}
+	if(ivideo->tvypos) {
+   	   sisfb_set_TVyposoffset(ivideo, ivideo->tvypos);
+	}
+
+	if((ivideo->currentvbflags & CRT2_TV) && (ivideo->vbflags & VB_301)) {  /* Set filter for SiS301 */
+
+	   	unsigned char filter_tb = 0;
 
-		switch (ivideo.video_width) {
+		switch (ivideo->video_width) {
 		   case 320:
-			filter_tb = (ivideo.vbflags & TV_NTSC) ? 4 : 12;
+			filter_tb = (ivideo->vbflags & TV_NTSC) ? 4 : 12;
 			break;
 		   case 640:
-			filter_tb = (ivideo.vbflags & TV_NTSC) ? 5 : 13;
+			filter_tb = (ivideo->vbflags & TV_NTSC) ? 5 : 13;
 			break;
 		   case 720:
-			filter_tb = (ivideo.vbflags & TV_NTSC) ? 6 : 14;
+			filter_tb = (ivideo->vbflags & TV_NTSC) ? 6 : 14;
 			break;
 		   case 400:
 		   case 800:
-			filter_tb = (ivideo.vbflags & TV_NTSC) ? 7 : 15;
+			filter_tb = (ivideo->vbflags & TV_NTSC) ? 7 : 15;
 			break;
 		   default:
-			filter = -1;
+			ivideo->sisfb_filter = -1;
 			break;
 		}
 
-		orSISIDXREG(SISPART1, sisfb_CRT2_write_enable, 0x01);
+		orSISIDXREG(SISPART1, ivideo->CRT2_write_enable, 0x01);
 
-		if(ivideo.vbflags & TV_NTSC) {
+		if(ivideo->vbflags & TV_NTSC) {
 
 		        andSISIDXREG(SISPART2, 0x3a, 0x1f);
 
-			if (ivideo.vbflags & TV_SVIDEO) {
+			if (ivideo->vbflags & TV_SVIDEO) {
 
 			        andSISIDXREG(SISPART2, 0x30, 0xdf);
 
-			} else if (ivideo.vbflags & TV_AVIDEO) {
+			} else if (ivideo->vbflags & TV_AVIDEO) {
 
 			        orSISIDXREG(SISPART2, 0x30, 0x20);
 
-				switch (ivideo.video_width) {
+				switch (ivideo->video_width) {
 				case 640:
 				        outSISIDXREG(SISPART2, 0x35, 0xEB);
 					outSISIDXREG(SISPART2, 0x36, 0x04);
@@ -3900,19 +3790,19 @@ static void sisfb_post_setmode(void)
 				}
 			}
 
-		} else if(ivideo.vbflags & TV_PAL) {
+		} else if(ivideo->vbflags & TV_PAL) {
 
 			andSISIDXREG(SISPART2, 0x3A, 0x1F);
 
-			if (ivideo.vbflags & TV_SVIDEO) {
+			if (ivideo->vbflags & TV_SVIDEO) {
 
 			        andSISIDXREG(SISPART2, 0x30, 0xDF);
 
-			} else if (ivideo.vbflags & TV_AVIDEO) {
+			} else if (ivideo->vbflags & TV_AVIDEO) {
 
 			        orSISIDXREG(SISPART2, 0x30, 0x20);
 
-				switch (ivideo.video_width) {
+				switch (ivideo->video_width) {
 				case 640:
 					outSISIDXREG(SISPART2, 0x35, 0xF1);
 					outSISIDXREG(SISPART2, 0x36, 0xF7);
@@ -3936,129 +3826,137 @@ static void sisfb_post_setmode(void)
 			}
 		}
 
-		if ((filter >= 0) && (filter <= 7)) {
-			DPRINTK("FilterTable[%d]-%d: %02x %02x %02x %02x\n", filter_tb, filter,
-				sis_TV_filter[filter_tb].filter[filter][0],
-				sis_TV_filter[filter_tb].filter[filter][1],
-				sis_TV_filter[filter_tb].filter[filter][2],
-				sis_TV_filter[filter_tb].filter[filter][3]
-			);
-			outSISIDXREG(SISPART2, 0x35, (sis_TV_filter[filter_tb].filter[filter][0]));
-			outSISIDXREG(SISPART2, 0x36, (sis_TV_filter[filter_tb].filter[filter][1]));
-			outSISIDXREG(SISPART2, 0x37, (sis_TV_filter[filter_tb].filter[filter][2]));
-			outSISIDXREG(SISPART2, 0x38, (sis_TV_filter[filter_tb].filter[filter][3]));
+		if((ivideo->sisfb_filter >= 0) && (ivideo->sisfb_filter <= 7)) {
+		   outSISIDXREG(SISPART2,0x35,(sis_TV_filter[filter_tb].filter[ivideo->sisfb_filter][0]));
+		   outSISIDXREG(SISPART2,0x36,(sis_TV_filter[filter_tb].filter[ivideo->sisfb_filter][1]));
+		   outSISIDXREG(SISPART2,0x37,(sis_TV_filter[filter_tb].filter[ivideo->sisfb_filter][2]));
+		   outSISIDXREG(SISPART2,0x38,(sis_TV_filter[filter_tb].filter[ivideo->sisfb_filter][3]));
 		}
 	  
 	}
-
 }
 
 #ifndef MODULE
-int sisfb_setup(char *options)
+int __init sisfb_setup(char *options)
 {
 	char *this_opt;
 	
-#if LINUX_VERSION_CODE < KERNEL_VERSION(2,5,0)
-	sisfb_fontname[0] = '\0';
-#endif
-
-	ivideo.refresh_rate = 0;
-	SiS_Pr.SiS_CustomT = CUT_NONE;
-	SiS_Pr.UsePanelScaler = -1;
-	SiS_Pr.LVDSHL = -1;
+	sisfb_setdefaultparms();
 
         printk(KERN_DEBUG "sisfb: Options %s\n", options);
 
-	if (!options || !*options)
+	if(!options || !(*options)) {
 		return 0;
+	}
 
 	while((this_opt = strsep(&options, ",")) != NULL) {
 
-		if (!*this_opt)	continue;
+		if(!(*this_opt)) continue;
 
-		if (!strnicmp(this_opt, "mode:", 5)) {
+		if(!strnicmp(this_opt, "off", 3)) {
+			sisfb_off = 1;
+		} else if(!strnicmp(this_opt, "forcecrt2type:", 14)) {
+			/* Need to check crt2 type first for fstn/dstn */
+			sisfb_search_crt2type(this_opt + 14);
+		} else if(!strnicmp(this_opt, "tvmode:",7)) {
+		        sisfb_search_tvstd(this_opt + 7);
+                } else if(!strnicmp(this_opt, "tvstandard:",11)) {
+			sisfb_search_tvstd(this_opt + 7);
+		} else if(!strnicmp(this_opt, "mode:", 5)) {
 			sisfb_search_mode(this_opt + 5, FALSE);
-		} else if (!strnicmp(this_opt, "vesa:", 5)) {
+		} else if(!strnicmp(this_opt, "vesa:", 5)) {
 			sisfb_search_vesamode(simple_strtoul(this_opt + 5, NULL, 0), FALSE);
 #if LINUX_VERSION_CODE < KERNEL_VERSION(2,5,0)
-		} else if (!strnicmp(this_opt, "inverse", 7)) {
+		} else if(!strnicmp(this_opt, "inverse", 7)) {
 			sisfb_inverse = 1;
 			/* fb_invert_cmaps(); */
-		} else if (!strnicmp(this_opt, "font:", 5)) {
-			strncpy(sisfb_fontname, this_opt + 5, sizeof(sisfb_fontname) - 1);
-			sisfb_fontname[sizeof(sisfb_fontname) - 1] = '\0';
+		} else if(!strnicmp(this_opt, "font:", 5)) {
+		        if(strlen(this_opt + 5) < 40) {
+			   strncpy(sisfb_fontname, this_opt + 5, sizeof(sisfb_fontname) - 1);
+			   sisfb_fontname[sizeof(sisfb_fontname) - 1] = '\0';
+			}
 #endif
-		} else if (!strnicmp(this_opt, "vrate:", 6)) {
-			ivideo.refresh_rate = simple_strtoul(this_opt + 6, NULL, 0);
-			sisfb_parm_rate = ivideo.refresh_rate;
-		} else if (!strnicmp(this_opt, "rate:", 5)) {
-			ivideo.refresh_rate = simple_strtoul(this_opt + 5, NULL, 0);
-			sisfb_parm_rate = ivideo.refresh_rate;
-		} else if (!strnicmp(this_opt, "off", 3)) {
-			sisfb_off = 1;
-		} else if (!strnicmp(this_opt, "crt1off", 7)) {
-			sisfb_crt1off = 1;
-		} else if (!strnicmp(this_opt, "filter:", 7)) {
-			filter = (int)simple_strtoul(this_opt + 7, NULL, 0);
-		} else if (!strnicmp(this_opt, "forcecrt2type:", 14)) {
-			sisfb_search_crt2type(this_opt + 14);
-		} else if (!strnicmp(this_opt, "forcecrt1:", 10)) {
+		} else if(!strnicmp(this_opt, "rate:", 5)) {
+			sisfb_parm_rate = simple_strtoul(this_opt + 5, NULL, 0);
+		} else if(!strnicmp(this_opt, "filter:", 7)) {
+			sisfb_filter = (int)simple_strtoul(this_opt + 7, NULL, 0);
+		} else if(!strnicmp(this_opt, "forcecrt1:", 10)) {
 			sisfb_forcecrt1 = (int)simple_strtoul(this_opt + 10, NULL, 0);
-                } else if (!strnicmp(this_opt, "tvmode:",7)) {
-		        sisfb_search_tvstd(this_opt + 7);
-                } else if (!strnicmp(this_opt, "tvstandard:",11)) {
-			sisfb_search_tvstd(this_opt + 7);
-                } else if (!strnicmp(this_opt, "mem:",4)) {
-		        sisfb_mem = simple_strtoul(this_opt + 4, NULL, 0);
-		} else if (!strnicmp(this_opt, "queuemode:", 10)) {
-			sisfb_search_queuemode(this_opt + 10);
-		} else if (!strnicmp(this_opt, "pdc:", 4)) {
+                } else if(!strnicmp(this_opt, "mem:",4)) {
+		        sisfb_parm_mem = simple_strtoul(this_opt + 4, NULL, 0);
+		} else if(!strnicmp(this_opt, "pdc:", 4)) {
 		        sisfb_pdc = simple_strtoul(this_opt + 4, NULL, 0);
-		} else if (!strnicmp(this_opt, "noaccel", 7)) {
+		} else if(!strnicmp(this_opt, "pdc1:", 5)) {
+		        sisfb_pdca = simple_strtoul(this_opt + 5, NULL, 0);
+		} else if(!strnicmp(this_opt, "noaccel", 7)) {
 			sisfb_accel = 0;
-		} else if (!strnicmp(this_opt, "noypan", 6)) {
+		} else if(!strnicmp(this_opt, "accel", 5)) {
+			sisfb_accel = -1;
+		} else if(!strnicmp(this_opt, "noypan", 6)) {
 		        sisfb_ypan = 0;
-		} else if (!strnicmp(this_opt, "nomax", 5)) {
+		} else if(!strnicmp(this_opt, "ypan", 4)) {
+		        sisfb_ypan = -1;
+		} else if(!strnicmp(this_opt, "nomax", 5)) {
 		        sisfb_max = 0;
-		} else if (!strnicmp(this_opt, "userom:", 7)) {
+		} else if(!strnicmp(this_opt, "max", 3)) {
+		        sisfb_max = -1;
+		} else if(!strnicmp(this_opt, "userom:", 7)) {
 			sisfb_userom = (int)simple_strtoul(this_opt + 7, NULL, 0);
-		} else if (!strnicmp(this_opt, "useoem:", 7)) {
+		} else if(!strnicmp(this_opt, "useoem:", 7)) {
 			sisfb_useoem = (int)simple_strtoul(this_opt + 7, NULL, 0);
-		} else if (!strnicmp(this_opt, "nocrt2rate", 10)) {
+		} else if(!strnicmp(this_opt, "nocrt2rate", 10)) {
 			sisfb_nocrt2rate = 1;
-	 	} else if (!strnicmp(this_opt, "scalelcd:", 9)) {
+	 	} else if(!strnicmp(this_opt, "scalelcd:", 9)) {
 		        unsigned long temp = 2;
 		        temp = simple_strtoul(this_opt + 9, NULL, 0);
 		        if((temp == 0) || (temp == 1)) {
-			   SiS_Pr.UsePanelScaler = temp ^ 1;
+			   sisfb_scalelcd = temp ^ 1;
 		        }
-		} else if (!strnicmp(this_opt, "specialtiming:", 14)) {
+		} else if(!strnicmp(this_opt, "tvxposoffset:", 13)) {
+		        int temp = 0;
+		        temp = (int)simple_strtol(this_opt + 13, NULL, 0);
+		        if((temp >= -32) && (temp <= 32)) {
+			   sisfb_tvxposoffset = temp;
+		        }
+		} else if(!strnicmp(this_opt, "tvyposoffset:", 13)) {
+		        int temp = 0;
+		        temp = (int)simple_strtol(this_opt + 13, NULL, 0);
+		        if((temp >= -32) && (temp <= 32)) {
+			   sisfb_tvyposoffset = temp;
+		        }
+		} else if(!strnicmp(this_opt, "specialtiming:", 14)) {
 			sisfb_search_specialtiming(this_opt + 14);
-		} else if (!strnicmp(this_opt, "lvdshl:", 7)) {
-		        unsigned long temp = 4;
+		} else if(!strnicmp(this_opt, "lvdshl:", 7)) {
+		        int temp = 4;
 		        temp = simple_strtoul(this_opt + 7, NULL, 0);
 		        if((temp >= 0) && (temp <= 3)) {
-			   SiS_Pr.LVDSHL = temp;
+			   sisfb_lvdshl = temp;
 		        }
 		} else if(this_opt[0] >= '0' && this_opt[0] <= '9') {
 			sisfb_search_mode(this_opt, TRUE);
+#if !defined(__i386__) && !defined(__x86_64__)
+	        } else if(!strnicmp(this_opt, "resetcard", 9)) {
+		  	sisfb_resetcard = 1;
+	        } else if(!strnicmp(this_opt, "videoram:", 9)) {
+		  	sisfb_videoram = simple_strtoul(this_opt + 9, NULL, 0);
+#endif
 		} else {
 			printk(KERN_INFO "sisfb: Invalid option %s\n", this_opt);
 		}
 
-		/* TW: Acceleration only with MMIO mode */
-		if((sisfb_queuemode != -1) && (sisfb_queuemode != MMIO_CMD)) {
-			sisfb_accel = 0;
-		}
-
 	}
+
+
+
 	return 0;
 }
 #endif
 
-static char *sis_find_rom(void)
+static char * __devinit sis_find_rom(struct pci_dev *pdev)
 {
-#if defined(__i386__)
+	struct sis_video_info *ivideo = pci_get_drvdata(pdev);
+
+#if defined(__i386__) || defined(__x86_64__)
         u32  segstart;
         unsigned char *rom_base, *rom;
         int  romptr;
@@ -4066,292 +3964,972 @@ static char *sis_find_rom(void)
 
         for(segstart=0x000c0000; segstart<0x000f0000; segstart+=0x00001000) {
 
-                rom_base = (char *)ioremap(segstart, 0x10000);
-		if(!rom_base) continue;
+            rom_base = (unsigned char *)ioremap(segstart, 0x10000);
+	    if(!rom_base) continue;
 
-                if((*rom_base != 0x55) || (*(rom_base + 1) != 0xaa)) {
-                   iounmap(rom_base);
-                   continue;
-                }
+	    if((readb(rom_base) != 0x55) || (readb(rom_base + 1) != 0xaa)) {
+	       iounmap(rom_base);
+               continue;
+	    }
 
-		romptr = (unsigned short)(*(rom_base + 0x18) | (*(rom_base + 0x19) << 8));
-		if(romptr > (0x10000 - 8)) {
-		   iounmap(rom_base);
-		   continue;
-		}
+	    romptr = (unsigned short)(readb(rom_base + 0x18) | (readb(rom_base + 0x19) << 8));
+	    if(romptr > (0x10000 - 8)) {
+	       iounmap(rom_base);
+	       continue;
+	    }
 
-		rom = rom_base + romptr;
+	    rom = rom_base + romptr;
 
-		if((*rom != 'P') || (*(rom + 1) != 'C') || (*(rom + 2) != 'I') || (*(rom + 3) != 'R')) {
-		   iounmap(rom_base);
-		   continue;
-		}
+	    if((readb(rom)     != 'P') || (readb(rom + 1) != 'C') ||
+	       (readb(rom + 2) != 'I') || (readb(rom + 3) != 'R')) {
+	       iounmap(rom_base);
+	       continue;
+	    }
 
-		pciid = (*(rom + 4)) | ((*(rom + 5)) << 8);
-		if(pciid != 0x1039) {
-		   iounmap(rom_base);
-		   continue;
-		}
+	    pciid = readb(rom + 4) | (readb(rom + 5) << 8);
+	    if(pciid != 0x1039) {
+	       iounmap(rom_base);
+	       continue;
+	    }
 
-		pciid = (*(rom + 6)) | ((*(rom + 7)) << 8);
-		if(pciid == ivideo.chip_id) return rom_base;
+	    pciid = readb(rom + 6) | (readb(rom + 7) << 8);
+	    if(pciid == ivideo->chip_id) return rom_base;
 
-		iounmap(rom_base);
+	    iounmap(rom_base);
         }
+#else
+	unsigned char *rom_base, *rom, *myrombase = NULL;
+        int  romptr;
+	unsigned short pciid;
+	u32 backup;
+
+	pci_read_config_dword(pdev, PCI_ROM_ADDRESS, &backup);
+	pci_write_config_dword(pdev, PCI_ROM_ADDRESS,
+			(ivideo->video_base & PCI_ROM_ADDRESS_MASK) | PCI_ROM_ADDRESS_ENABLE);
+
+	rom_base = ioremap(ivideo->video_base, 65536);
+	if(rom_base) {
+	   if((readb(rom_base) == 0x55) && (readb(rom_base + 1) == 0xaa)) {
+	      romptr = (u16)(readb(rom_base + 0x18) | (readb(rom_base + 0x19) << 8));
+	      if(romptr <= (0x10000 - 8)) {
+	         rom = rom_base + romptr;
+		 if((readb(rom)     == 'P') && (readb(rom + 1) == 'C') &&
+		    (readb(rom + 2) == 'I') && (readb(rom + 3) == 'R')) {
+		    pciid = readb(rom + 4) | (readb(rom + 5) << 8);
+		    if(pciid == 0x1039) {
+		       pciid = readb(rom + 6) | (readb(rom + 7) << 8);
+		       if(pciid == ivideo->chip_id) {
+		          if((myrombase = vmalloc(65536))) {
+			     memcpy_fromio(myrombase, rom_base, 65536);
+			  }
+		       }
+		    }
+		 }
+	      }
+	   }
+	   iounmap(rom_base);
+	}
+        pci_write_config_dword(pdev, PCI_ROM_ADDRESS, backup);
+	if(myrombase) return myrombase;
 #endif
         return NULL;
 }
 
-
-
-int __init sisfb_init(void)
+#ifdef CONFIG_FB_SIS_300
+static int __devinit
+sisfb_chkbuswidth300(struct pci_dev *pdev, ULONG FBAddress)
 {
-	struct pci_dev *pdev = NULL;
-	struct board *b;
-	int pdev_valid = 0;
-	u32 reg32;
-	u16 reg16;
-	u8  reg;
+	struct sis_video_info *ivideo = pci_get_drvdata(pdev);
+	int i, j;
+	USHORT temp;
+	UCHAR reg;
+
+	andSISIDXREG(SISSR,0x15,0xFB);
+	orSISIDXREG(SISSR,0x15,0x04);
+   	outSISIDXREG(SISSR,0x13,0x00);
+   	outSISIDXREG(SISSR,0x14,0xBF);
+
+	for(i=0; i<2; i++) {
+	   temp = 0x1234;
+	   for(j=0; j<4; j++) {
+	      writew(temp, FBAddress);
+	      if(readw(FBAddress) == temp) break;
+	      orSISIDXREG(SISSR,0x3c,0x01);
+	      inSISIDXREG(SISSR,0x05,reg);
+	      inSISIDXREG(SISSR,0x05,reg);
+	      andSISIDXREG(SISSR,0x3c,0xfe);
+	      inSISIDXREG(SISSR,0x05,reg);
+	      inSISIDXREG(SISSR,0x05,reg);
+	      temp++;
+	   }
+	}
 
-#if 0
-	/* for DOC VB */
-	sisfb_set_reg4(0xcf8,0x800000e0);
-	reg32 = sisfb_get_reg3(0xcfc);
-	reg32 = reg32 | 0x00001000;
-	sisfb_set_reg4(0xcfc,reg32);
+	writel(0x01234567L, FBAddress);
+	writel(0x456789ABL, (FBAddress+4));
+	writel(0x89ABCDEFL, (FBAddress+8));
+	writel(0xCDEF0123L, (FBAddress+12));
+	inSISIDXREG(SISSR,0x3b,reg);
+	if(reg & 0x01) {
+	   if(readl((FBAddress+12)) == 0xCDEF0123L) return(4);  /* Channel A 128bit */
 	}
-#endif
+	if(readl((FBAddress+4)) == 0x456789ABL)     return(2);  /* Channel B 64bit */
+	return(1);						/* 32bit */
+}
 
-	if (sisfb_off)
-		return -ENXIO;
+static void __devinit
+sisfb_setramsize300(struct pci_dev *pdev)
+{
+	struct  sis_video_info *ivideo = pci_get_drvdata(pdev);
+  	ULONG 	FBAddr = (ULONG)ivideo->sishw_ext.pjVideoMemoryAddress, Addr;
+	USHORT 	SR13, SR14=0, buswidth, Done, data, TotalCapacity, PhysicalAdrOtherPage=0;
+	int     PseudoRankCapacity, PseudoTotalCapacity, PseudoAdrPinCount;
+   	int     RankCapacity, AdrPinCount, BankNumHigh, BankNumMid, MB2Bank;
+   	int     PageCapacity, PhysicalAdrHigh, PhysicalAdrHalfPage, i, j, k;
+	const 	USHORT SiS_DRAMType[17][5] = {
+			{0x0C,0x0A,0x02,0x40,0x39},
+			{0x0D,0x0A,0x01,0x40,0x48},
+			{0x0C,0x09,0x02,0x20,0x35},
+			{0x0D,0x09,0x01,0x20,0x44},
+			{0x0C,0x08,0x02,0x10,0x31},
+			{0x0D,0x08,0x01,0x10,0x40},
+			{0x0C,0x0A,0x01,0x20,0x34},
+			{0x0C,0x09,0x01,0x08,0x32},
+			{0x0B,0x08,0x02,0x08,0x21},
+			{0x0C,0x08,0x01,0x08,0x30},
+			{0x0A,0x08,0x02,0x04,0x11},
+			{0x0B,0x0A,0x01,0x10,0x28},
+			{0x09,0x08,0x02,0x02,0x01},
+			{0x0B,0x09,0x01,0x08,0x24},
+			{0x0B,0x08,0x01,0x04,0x20},
+			{0x0A,0x08,0x01,0x02,0x10},
+			{0x09,0x08,0x01,0x01,0x00}
+		};
+
+        buswidth = sisfb_chkbuswidth300(pdev, FBAddr);
+
+   	MB2Bank = 16;
+   	Done = 0;
+   	for(i = 6; i >= 0; i--) {
+      	   if(Done) break;
+      	   PseudoRankCapacity = 1 << i;
+      	   for(j = 4; j >= 1; j--) {
+              if(Done) break;
+              PseudoTotalCapacity = PseudoRankCapacity * j;
+              PseudoAdrPinCount = 15 - j;
+              if(PseudoTotalCapacity <= 64) {
+                 for(k = 0; k <= 16; k++) {
+                    if(Done) break;
+                    RankCapacity = buswidth * SiS_DRAMType[k][3];
+                    AdrPinCount = SiS_DRAMType[k][2] + SiS_DRAMType[k][0];
+                    if(RankCapacity == PseudoRankCapacity)
+                       if(AdrPinCount <= PseudoAdrPinCount) {
+                          if(j == 3) {             /* Rank No */
+                             BankNumHigh = RankCapacity * MB2Bank * 3 - 1;
+                             BankNumMid  = RankCapacity * MB2Bank * 1 - 1;
+                          } else {
+                             BankNumHigh = RankCapacity * MB2Bank * j - 1;
+                             BankNumMid  = RankCapacity * MB2Bank * j / 2 - 1;
+                          }
+                          PageCapacity = (1 << SiS_DRAMType[k][1]) * buswidth * 4;
+                          PhysicalAdrHigh = BankNumHigh;
+                          PhysicalAdrHalfPage = (PageCapacity / 2 + PhysicalAdrHigh) % PageCapacity;
+                          PhysicalAdrOtherPage = PageCapacity * SiS_DRAMType[k][2] + PhysicalAdrHigh;
+                          /* Write data */
+                          andSISIDXREG(SISSR,0x15,0xFB); /* Test */
+                          orSISIDXREG(SISSR,0x15,0x04);  /* Test */
+                          TotalCapacity = SiS_DRAMType[k][3] * buswidth;
+                          SR13 = SiS_DRAMType[k][4];
+                          if(buswidth == 4) SR14 = (TotalCapacity - 1) | 0x80;
+                          if(buswidth == 2) SR14 = (TotalCapacity - 1) | 0x40;
+                          if(buswidth == 1) SR14 = (TotalCapacity - 1) | 0x00;
+                          outSISIDXREG(SISSR,0x13,SR13);
+                          outSISIDXREG(SISSR,0x14,SR14);
+                          Addr = FBAddr + BankNumHigh * 64 * 1024 + PhysicalAdrHigh;
+                          /* *((USHORT *)(Addr)) = (USHORT)PhysicalAdrHigh; */
+			  writew(((USHORT)PhysicalAdrHigh), Addr);
+                          Addr = FBAddr + BankNumMid * 64 * 1024 + PhysicalAdrHigh;
+                          /* *((USHORT *)(Addr)) = (USHORT)BankNumMid; */
+			  writew(((USHORT)BankNumMid), Addr);
+                          Addr = FBAddr + BankNumHigh * 64 * 1024 + PhysicalAdrHalfPage;
+                          /* *((USHORT *)(Addr)) = (USHORT)PhysicalAdrHalfPage; */
+			  writew(((USHORT)PhysicalAdrHalfPage), Addr);
+                          Addr = FBAddr + BankNumHigh * 64 * 1024 + PhysicalAdrOtherPage;
+                          /* *((USHORT *)(Addr)) = PhysicalAdrOtherPage; */
+			  writew(((USHORT)PhysicalAdrOtherPage), Addr);
+                          /* Read data */
+                          Addr = FBAddr + BankNumHigh * 64 * 1024 + PhysicalAdrHigh;
+                          data = readw(Addr); /* *((USHORT *)(Addr)); */
+                          if(data == PhysicalAdrHigh) Done = 1;
+                       }  /* if */
+                 }  /* for k */
+              }  /* if */
+      	   }  /* for j */
+   	}  /* for i */
+}
 
-	sisfb_registered = 0;
-	sisfb_thismonitor.datavalid = FALSE;
+static void __devinit sisfb_post_sis300(struct pci_dev *pdev)
+{
+	struct sis_video_info *ivideo = pci_get_drvdata(pdev);
+	u8  reg, v1, v2, v3, v4, v5, v6, v7, v8;
+	u16 index, rindex, memtype = 0;
 
-	memset(&sishw_ext, 0, sizeof(sishw_ext));
+	outSISIDXREG(SISSR,0x05,0x86);
 
-#if LINUX_VERSION_CODE >= KERNEL_VERSION(2,5,0)
-        memset(&sisfb_lastrates[0], 0, 128);
-#endif
-	
-#if LINUX_VERSION_CODE < KERNEL_VERSION(2,5,0)	
-	memset(&sis_disp, 0, sizeof(sis_disp));
-#endif
+	if(ivideo->sishw_ext.UseROM) {
+	   if(ivideo->sishw_ext.pjVirtualRomBase[0x52] & 0x80) {
+	      memtype = ivideo->sishw_ext.pjVirtualRomBase[0x52];
+ 	   } else {
+	      inSISIDXREG(SISSR,0x3a,memtype);
+	   }
+	   memtype &= 0x07;
+	}
 
-#if LINUX_VERSION_CODE < KERNEL_VERSION(2,5,74)
-	pci_for_each_dev(pdev) {
-#else
-	while((pdev = pci_find_device(PCI_VENDOR_ID_SI, PCI_ANY_ID, pdev))) {
+	if(ivideo->revision_id <= 0x13) {
+	   v1 = 0x44; v2 = 0x42; v3 = 0x80;
+	   v4 = 0x44; v5 = 0x42; v6 = 0x80;
+	} else {
+	   v1 = 0x68; v2 = 0x43; v3 = 0x80;  /* Assume 125Mhz MCLK */
+	   v4 = 0x68; v5 = 0x43; v6 = 0x80;  /* Assume 125Mhz ECLK */
+	   if(ivideo->sishw_ext.UseROM) {
+	      index = memtype * 5;
+	      rindex = index + 0x54;
+	      v1 = ivideo->sishw_ext.pjVirtualRomBase[rindex++];
+	      v2 = ivideo->sishw_ext.pjVirtualRomBase[rindex++];
+	      v3 = ivideo->sishw_ext.pjVirtualRomBase[rindex++];
+	      rindex = index + 0x7c;
+	      v4 = ivideo->sishw_ext.pjVirtualRomBase[rindex++];
+	      v5 = ivideo->sishw_ext.pjVirtualRomBase[rindex++];
+	      v6 = ivideo->sishw_ext.pjVirtualRomBase[rindex++];
+	   }
+	}
+	outSISIDXREG(SISSR,0x28,v1);
+	outSISIDXREG(SISSR,0x29,v2);
+	outSISIDXREG(SISSR,0x2a,v3);
+	outSISIDXREG(SISSR,0x2e,v4);
+	outSISIDXREG(SISSR,0x2f,v5);
+	outSISIDXREG(SISSR,0x30,v6);
+	v1 = 0x10;
+	if(ivideo->sishw_ext.UseROM) v1 = ivideo->sishw_ext.pjVirtualRomBase[0xa4];
+	outSISIDXREG(SISSR,0x07,v1);       /* DAC speed */
+	outSISIDXREG(SISSR,0x11,0x0f);     /* DDC, power save */
+	v1 = 0x01; v2 = 0x43; v3 = 0x1e; v4 = 0x2a;
+	v5 = 0x06; v6 = 0x00; v7 = 0x00; v8 = 0x00;
+	if(ivideo->sishw_ext.UseROM) {
+	   memtype += 0xa5;
+	   v1 = ivideo->sishw_ext.pjVirtualRomBase[memtype];
+	   v2 = ivideo->sishw_ext.pjVirtualRomBase[memtype + 8];
+	   v3 = ivideo->sishw_ext.pjVirtualRomBase[memtype + 16];
+	   v4 = ivideo->sishw_ext.pjVirtualRomBase[memtype + 24];
+	   v5 = ivideo->sishw_ext.pjVirtualRomBase[memtype + 32];
+	   v6 = ivideo->sishw_ext.pjVirtualRomBase[memtype + 40];
+	   v7 = ivideo->sishw_ext.pjVirtualRomBase[memtype + 48];
+	   v8 = ivideo->sishw_ext.pjVirtualRomBase[memtype + 56];
+	}
+	if(ivideo->revision_id >= 0x80) v3 &= 0xfd;
+	outSISIDXREG(SISSR,0x15,v1);       /* Ram type (assuming 0, BIOS 0xa5 step 8) */
+	outSISIDXREG(SISSR,0x16,v2);
+	outSISIDXREG(SISSR,0x17,v3);
+	outSISIDXREG(SISSR,0x18,v4);
+	outSISIDXREG(SISSR,0x19,v5);
+	outSISIDXREG(SISSR,0x1a,v6);
+	outSISIDXREG(SISSR,0x1b,v7);
+	outSISIDXREG(SISSR,0x1c,v8);	   /* ---- */
+	andSISIDXREG(SISSR,0x15,0xfb);
+	orSISIDXREG(SISSR,0x15,0x04);
+	if(ivideo->sishw_ext.UseROM) {
+	   if(ivideo->sishw_ext.pjVirtualRomBase[0x53] & 0x02) {
+	      orSISIDXREG(SISSR,0x19,0x20);
+	   }
+	}
+	v1 = 0x04;			   /* DAC pedestal (BIOS 0xe5) */
+	if(ivideo->revision_id >= 0x80) v1 |= 0x01;
+	outSISIDXREG(SISSR,0x1f,v1);
+	outSISIDXREG(SISSR,0x20,0xa0);     /* linear & relocated io */
+	v1 = 0xf6; v2 = 0x0d; v3 = 0x00;
+	if(ivideo->sishw_ext.UseROM) {
+	   v1 = ivideo->sishw_ext.pjVirtualRomBase[0xe8];
+	   v2 = ivideo->sishw_ext.pjVirtualRomBase[0xe9];
+	   v3 = ivideo->sishw_ext.pjVirtualRomBase[0xea];
+	}
+	outSISIDXREG(SISSR,0x23,v1);
+	outSISIDXREG(SISSR,0x24,v2);
+	outSISIDXREG(SISSR,0x25,v3);
+	outSISIDXREG(SISSR,0x21,0x84);
+	outSISIDXREG(SISSR,0x22,0x00);
+	outSISIDXREG(SISCR,0x37,0x00);
+	orSISIDXREG(SISPART1,0x24,0x01);   /* unlock crt2 */
+	outSISIDXREG(SISPART1,0x00,0x00);
+	v1 = 0x40; v2 = 0x11;
+	if(ivideo->sishw_ext.UseROM) {
+	   v1 = ivideo->sishw_ext.pjVirtualRomBase[0xec];
+	   v2 = ivideo->sishw_ext.pjVirtualRomBase[0xeb];
+	}
+	outSISIDXREG(SISPART1,0x02,v1);
+	if(ivideo->revision_id >= 0x80) v2 &= ~0x01;
+	inSISIDXREG(SISPART4,0x00,reg);
+	if((reg == 1) || (reg == 2)) {
+	   outSISIDXREG(SISCR,0x37,0x02);
+	   outSISIDXREG(SISPART2,0x00,0x1c);
+	   v4 = 0x00; v5 = 0x00; v6 = 0x10;
+	   if(ivideo->sishw_ext.UseROM) {
+	      v4 = ivideo->sishw_ext.pjVirtualRomBase[0xf5];
+	      v5 = ivideo->sishw_ext.pjVirtualRomBase[0xf6];
+	      v6 = ivideo->sishw_ext.pjVirtualRomBase[0xf7];
+	   }
+	   outSISIDXREG(SISPART4,0x0d,v4);
+	   outSISIDXREG(SISPART4,0x0e,v5);
+	   outSISIDXREG(SISPART4,0x10,v6);
+	   outSISIDXREG(SISPART4,0x0f,0x3f);
+	   inSISIDXREG(SISPART4,0x01,reg);
+	   if(reg >= 0xb0) {
+	      inSISIDXREG(SISPART4,0x23,reg);
+	      reg &= 0x20;
+	      reg <<= 1;
+	      outSISIDXREG(SISPART4,0x23,reg);
+	   }
+	} else {
+	   v2 &= ~0x10;
+	}
+	outSISIDXREG(SISSR,0x32,v2);
+	andSISIDXREG(SISPART1,0x24,0xfe);  /* Lock CRT2 */
+	inSISIDXREG(SISSR,0x16,reg);
+	reg &= 0xc3;
+	outSISIDXREG(SISCR,0x35,reg);
+	outSISIDXREG(SISCR,0x83,0x00);
+#if !defined(__i386__) && !defined(__x86_64__)
+	if(sisfb_videoram) {
+	   outSISIDXREG(SISSR,0x13,0x28);  /* ? */
+	   reg = ((sisfb_videoram >> 10) - 1) | 0x40;
+	   outSISIDXREG(SISSR,0x14,reg);
+	} else {
 #endif
-		for (b = sisdev_list; b->vendor; b++) {
-			if ((b->vendor == pdev->vendor)
-			    && (b->device == pdev->device)) {
-				pdev_valid = 1;
-#if (LINUX_VERSION_CODE >= KERNEL_VERSION(2,6,0)) && defined(NEWFBDEV)
-				sis_fb_info = framebuffer_alloc(0, &pdev->dev);
-#else
-				sis_fb_info = kmalloc(sizeof(*sis_fb_info), GFP_KERNEL);
+	   /* Need to map max FB size for finding out about RAM size */
+	   ivideo->sishw_ext.pjVideoMemoryAddress = ioremap(ivideo->video_base, 0x4000000);
+	   if(ivideo->sishw_ext.pjVideoMemoryAddress) {
+	      sisfb_setramsize300(pdev);
+	      iounmap(ivideo->sishw_ext.pjVideoMemoryAddress);
+	   } else {
+	      printk(KERN_DEBUG "sisfb: Failed to map memory for size detection, assuming 8MB\n");
+	      outSISIDXREG(SISSR,0x13,0x28);  /* ? */
+	      outSISIDXREG(SISSR,0x14,0x47);  /* 8MB, 64bit default */
+	   }
+#if !defined(__i386__) && !defined(__x86_64__)
+	}
 #endif
-				if(!sis_fb_info) return -ENOMEM;
-#if (LINUX_VERSION_CODE < KERNEL_VERSION(2,6,0)) || (!(defined(NEWFBDEV)))
-				memset(sis_fb_info, 0, sizeof(*sis_fb_info));
+	if(ivideo->sishw_ext.UseROM) {
+	   v1 = ivideo->sishw_ext.pjVirtualRomBase[0xe6];
+	   v2 = ivideo->sishw_ext.pjVirtualRomBase[0xe7];
+	} else {
+	   inSISIDXREG(SISSR,0x3a,reg);
+	   if((reg & 0x30) == 0x30) {
+	      v1 = 0x04; /* PCI */
+	      v2 = 0x92;
+	   } else {
+	      v1 = 0x14; /* AGP */
+	      v2 = 0xb2;
+	   }
+	}
+	outSISIDXREG(SISSR,0x21,v1);
+	outSISIDXREG(SISSR,0x22,v2);
+}
 #endif
-#if LINUX_VERSION_CODE <= KERNEL_VERSION(2,5,0)
-				strcpy(sis_fb_info->modename, b->name);
-#else				
-				strcpy(myid, b->name);
-#endif				
-				ivideo.chip_id = pdev->device;
-				pci_read_config_byte(pdev, PCI_REVISION_ID,
-				                     &ivideo.revision_id);
-				pci_read_config_word(pdev, PCI_COMMAND, &reg16);
-				sishw_ext.jChipRevision = ivideo.revision_id;
-				sisvga_enabled = reg16 & 0x01;
-				ivideo.pcibus = pdev->bus->number;
-				ivideo.pcislot = PCI_SLOT(pdev->devfn);
-				ivideo.pcifunc = PCI_FUNC(pdev->devfn);
-				ivideo.subsysvendor = pdev->subsystem_vendor;
-				ivideo.subsysdevice = pdev->subsystem_device;
-				break;
-			}
-		}
 
-		if (pdev_valid)
-			break;
+#ifdef CONFIG_FB_SIS_315
+static void __devinit sisfb_post_sis315330(struct pci_dev *pdev)
+{
+#ifdef YET_TO_BE_DONE
+	struct sis_video_info *ivideo = pci_get_drvdata(pdev);
+	u8  reg, v1, v2, v3, v4, v5, v6, v7, v8;
+	u16 index, rindex, memtype = 0;
+	u32 reg1_32, reg2_32, reg3_32;
+	int i;
+
+	/* Unlock */
+	/* outSISIDXREG(0x3c4,0x05,0x86); */
+	outSISIDXREG(SISSR,0x05,0x86);
+
+	/* Enable relocated i/o ports */
+	/* setSISIDXREG(0x3c4,0x20,~0x10,0x20); */
+	setSISIDXREG(SISSR,0x20,~0x10,0x20);
+
+	/* Clear regs */
+	for(i = 0; i < 0x22; i++) {
+	   outSISIDXREG(SISSR,(0x06 + i),0x00);
+	}
+	v1 = 0x0d;
+	if( is 330) v1 = 0x0b;
+	for(i = 0; i < v1; i++) {
+	   outSISIDXREG(SISSR,(0x31 + i),0x00);
+	}
+	for(i = 0; i < 0x10; i++) {
+	   outSISIDXREG(SISCR,(0x30 + i),0x00);
+	}
+
+	/* Reset clocks */
+	reg = inSISREG(SISMISCR);
+	outSISIDXREG(SISSR,0x28,0x81);
+	outSISIDXREG(SISSR,0x2A,0x00);
+	outSISIDXREG(SISSR,0x29,0xE1);
+	outSISREG(SISMISCW,(reg | 0x0c));
+	outSISIDXREG(SISSR,0x2B,0x81);
+	outSISIDXREG(SISSR,0x2D,0x00);
+	outSISIDXREG(SISSR,0x2C,0xE1);
+	outSISIDXREG(SISSR,0x2E,0x81);
+	outSISIDXREG(SISSR,0x30,0x00);
+	outSISIDXREG(SISSR,0x2F,0xE1);
+	SiS_DDC2Delay(....);
+	outSISREG(SISMISCW,reg);
+
+	/* Get memory type */
+	if(ivideo->sishw_ext.UseROM) {
+	   if(ivideo->sishw_ext.pjVirtualRomBase[0x52] & 0x80)) {
+	      memtype = ivideo->sishw_ext.pjVirtualRomBase[0x52];
+ 	   } else {
+	      inSISIDXREG(SISSR,0x3a,memtype);
+	   }
+	   memtype &= 0x03;
+	   if( is 330 ) {
+	      if(memtype <= 1) memtype = 0;
+	      else {
+	         inSISIDXREG(SISCR,0x5F,reg);
+		 reg &= 0x30;
+		 switch(reg) {
+		 case 0x00: memtype = 1; break;
+		 case 0x10: memtype = 3; break;
+		 case 0x20: memtype = 3; break;
+		 default:   memtype = 2;
+		 }
+	      }
+	   }
 	}
 
-	if (!pdev_valid)
-		return -ENODEV;
+	/* Set clocks */
+	v1 = 0x3b; v2 = 0x22; v3 = 0x01;  /* Assume 143Mhz MCLK */
+	v4 = 0x5c; v5 = 0x23; v6 = 0x01;  /* Assume 166Mhz ECLK */
+	if(ivideo->sishw_ext.UseROM) {
+	   index = memtype * 5;
+	   rindex = index + 0x54;
+	   v1 = ivideo->sishw_ext.pjVirtualRomBase[rindex++];
+	   v2 = ivideo->sishw_ext.pjVirtualRomBase[rindex++];
+	   v3 = ivideo->sishw_ext.pjVirtualRomBase[rindex++];
+	   rindex = index + 0x68;
+	   v4 = ivideo->sishw_ext.pjVirtualRomBase[rindex++];
+	   v5 = ivideo->sishw_ext.pjVirtualRomBase[rindex++];
+	   v6 = ivideo->sishw_ext.pjVirtualRomBase[rindex++];
+	}
+	outSISIDXREG(SISSR,0x28,v1);
+	outSISIDXREG(SISSR,0x29,v2);
+	outSISIDXREG(SISSR,0x2a,v3);
+	if( is 330 ) {
+	   inSISIDXREG(SISSR,0x3a,reg);
+	   reg &= 0x03;
+	   if(reg >= 2) {
+	      ...
+	   }
+	}
+	outSISIDXREG(SISSR,0x2e,v4);
+	outSISIDXREG(SISSR,0x2f,v5);
+	outSISIDXREG(SISSR,0x30,v6);
+
+	/* End of comp with 330 */
+
+	v1 = 0x18;
+	if(ivideo->sishw_ext.UseROM) v1 = ivideo->sishw_ext.pjVirtualRomBase[0x7c];
+	outSISIDXREG(SISSR,0x07,v1);
+	outSISIDXREG(SISSR,0x11,0x0f);
+
+	v1 = 0x00; v2 = 0x0f; v3 = 0xba; v4 = 0xa9;
+	v5 = 0xa0; v6 = 0x00; v7 = 0x30;
+	if(ivideo->sishw_ext.UseROM) {
+	   index = memtype + 0x7d;
+	   v1 = ivideo->sishw_ext.pjVirtualRomBase[index];
+	   v2 = ivideo->sishw_ext.pjVirtualRomBase[index + 4];
+	   v3 = ivideo->sishw_ext.pjVirtualRomBase[index + 8];
+	   v4 = ivideo->sishw_ext.pjVirtualRomBase[index + 12];
+	   v5 = ivideo->sishw_ext.pjVirtualRomBase[index + 16];
+	   v6 = ivideo->sishw_ext.pjVirtualRomBase[index + 20];
+	   v7 = ivideo->sishw_ext.pjVirtualRomBase[index + 24];
+	}
+	outSISIDXREG(SISSR,0x15,v1);       /* Ram type (assuming 0, BIOS 0x7d step 4) */
+	outSISIDXREG(SISSR,0x16,v2);
+	outSISIDXREG(SISSR,0x17,v3);
+	outSISIDXREG(SISSR,0x18,v4);
+	outSISIDXREG(SISSR,0x19,v5);
+	outSISIDXREG(SISSR,0x1a,v6);
+	outSISIDXREG(SISSR,0x1b,v7);
+	outSISIDXREG(SISSR,0x1c,v8);	   /* ---- */
+
+	v1 = 0x77; v2 = 0x77; v3 = 0x00; v4 = 0x5b; v5 = 0x00;
+	if(ivideo->sishw_ext.UseROM) {
+	   index = memtype + 0xa2;
+	   v1 = ivideo->sishw_ext.pjVirtualRomBase[index];
+	   v2 = ivideo->sishw_ext.pjVirtualRomBase[index + 4];
+	   v3 = ivideo->sishw_ext.pjVirtualRomBase[index + 8];
+	   v4 = ivideo->sishw_ext.pjVirtualRomBase[index + 12];
+	   v5 = ivideo->sishw_ext.pjVirtualRomBase[index + 16];
+	}
+	outSISIDXREG(SISCR,0x40,v1);
+	outSISIDXREG(SISCR,0x41,v2);
+	outSISIDXREG(SISCR,0x42,v3);
+	outSISIDXREG(SISCR,0x43,v4);
+	outSISIDXREG(SISCR,0x44,v5);
+
+	if( is 330 ) {
+
+	   v1 = 0x;
+	   if(ivideo->sishw_ext.UseROM) {
+	      v1 = ivideo->sishw_ext.pjVirtualRomBase[0xBA];
+	   }
+	   outSISIDXREG(SISCR,0x59,v1);
+
+	   v1 = 0x; v2 = 0x; v3 = 0x; v4 = 0x;
+	   v5 = 0x; v6 = 0x; v7 = 0x; v8 = 0x;
+	   if(ivideo->sishw_ext.UseROM) {
+	      index = memtype + 0xbe;
+	      v1 = ivideo->sishw_ext.pjVirtualRomBase[index];
+	      v2 = ivideo->sishw_ext.pjVirtualRomBase[index + 4];
+	      v3 = ivideo->sishw_ext.pjVirtualRomBase[index + 8];
+	      v4 = ivideo->sishw_ext.pjVirtualRomBase[index + 12];
+	      v5 = ivideo->sishw_ext.pjVirtualRomBase[index + 16];
+	      v6 = ivideo->sishw_ext.pjVirtualRomBase[index + 20];
+	      v7 = ivideo->sishw_ext.pjVirtualRomBase[index + 24];
+	      v8 = ivideo->sishw_ext.pjVirtualRomBase[index + 28];
+	   }
+	   outSISIDXREG(SISCR,0x68,v1);
+	   outSISIDXREG(SISCR,0x69,v2);
+	   outSISIDXREG(SISCR,0x6a,v3);
+	   outSISIDXREG(SISCR,0x6b,v4);
+	   outSISIDXREG(SISCR,0x6c,v5);
+	   outSISIDXREG(SISCR,0x6d,v6);
+	   outSISIDXREG(SISCR,0x6e,v7);
+	   outSISIDXREG(SISCR,0x6f,v8);
+
+	   v1 = 0x20;
+	   inSISIDXREG(SISSR,0x3b,reg);
+
+	   if(!(reg & 0x04)) {
+	      inSISIDXREG(SISCR,0x5F,reg);
+	      reg &= 0x30;
+	      if(reg) v1 = 0x23;
+	   }
+	   outSISIDXREG(SISCR,0x48,v1);
+	   outSISIDXREG(SISCR,0x4c,0x20);
+
+	   xx= xxx();
+	   if(xx >= 1) {
+	      v1 = 0x;
+	      if(ivideo->sishw_ext.UseROM) {
+	         v1 = ivideo->sishw_ext.pjVirtualRomBase[0xBA];
+	      }
+	      outSISIDXREG(SISCR,0x59,v1);
+	   }
+
+
+
+	} else {
+
+	   outSISIDXREG(SISCR,0x48,0x23);
+
+	   andSISIDXREG(SISSR,0x16,0x0f);
+	   if(memtype <= 1) {
+	      orSISIDXREG(SISSR,0x16,0x80);
+	   } else {
+	      v1 = 0x0f;
+	      if(ivideo->sishw_ext.UseROM) {
+	         v1 = ivideo->sishw_ext.pjVirtualRomBase[0x81 + memtype];
+	      }
+	      if(!(v1 & 0x10)) v2 = 0xc0;
+	      else             v2 = 0xd0;
+	      orSISIDXREG(SISSR,0x16,v2);
+	      andSISIDXREG(SISSR,0x16,0x0f);
+	      if(!(v1 & 0x10)) v2 = 0x80;
+	      else             v2 = 0xA0;
+	      orSISIDXREG(SISSR,0x16,v2);
+ 	   }
+
+	   if(memtype >= 2) {
+	      const u8 sr3cseq1[] = { 0xc0,0xe0,0xf0,0xe0,0xf0,0xa0,0xb0,0xa0,0xb0,0x90,0xd0 };
+	      const u8 sr3cseq2[] = { 0xc0,0xa0,0xb0,0xa0,0xb0,0xe0,0xf0,0xa0,0xb0,0x90,0xd0 };
+	      for(i = 0; i < 11; i++) {
+	         outSISIDXREG(SISSR,0x3c,sr3cseq1[i]);
+	      }
+	      outSISIDXREG(SISSR,0x3d,0x00);
+	      outSISIDXREG(SISSR,0x3d,0x04);
+	      SiS_DDC2Delay(0x200);
+	      v1 = inSISIDXREG(SISCR,0xEC);
+	      v2 = inSISIDXREG(SISCR,0xED);
+	      reg1_32 = (v2 << 8) | v1;
+	      outSISIDXREG(SISSR,0x3D,0x00);
+	      for(i = 0; i < 11; i++) {
+	         outSISIDXREG(SISSR,0x3c,sr3cseq2[i]);
+	      }
+	      outSISIDXREG(SISSR,0x3d,0x00);
+	      outSISIDXREG(SISSR,0x3d,0x04);
+	      SiS_DDC2Delay(0x200);
+	      v1 = inSISIDXREG(SISCR,0xEC);
+	      v2 = inSISIDXREG(SISCR,0xED);
+	      reg2_32 = (v2 << 8) | v1;
+	      outSISIDXREG(SISSR,0x3D,0x00);
+	      reg3_32 = reg2_32 << 1;
+	      reg2_32 >>= 1;
+	      reg3_32 += reg2_32;
+	      v1 = 0x40;
+	      if(reg3_32 > reg1_32) v1 = 0x10;
+	         outSISIDXREG(SISCR,0x59,v1);
+	   }
+
+	}
+
+	v1 = 0x00;
+	if(ivideo->sishw_ext.UseROM) {
+	   v1 = ivideo->sishw_ext.pjVirtualRomBase[0x99];
+	}
+	outSISIDXREG(SISSR,0x1f,v1);
+
+	outSISIDXREG(SISSR,0x20,0x20);
+
+	v1 = 0xf6; v2 = 0x0d; v3 = 0x33;
+	if(ivideo->sishw_ext.UseROM) {
+	   v1 = ivideo->sishw_ext.pjVirtualRomBase[0x9c];
+	   v2 = ivideo->sishw_ext.pjVirtualRomBase[0x9d];
+	   v3 = ivideo->sishw_ext.pjVirtualRomBase[0x9e];
+	}
+	outSISIDXREG(SISSR,0x23,v1);
+	outSISIDXREG(SISSR,0x24,v2);
+	outSISIDXREG(SISSR,0x25,v3);
+
+	outSISIDXREG(SISSR,0x21,0x84);
+	outSISIDXREG(SISSR,0x22,0x00);
+	outSISIDXREG(SISSR,0x27,0x1f);
+
+	v1 = 0x00; v2 = 0x00;
+	if(ivideo->sishw_ext.UseROM) {
+	   v1 = ivideo->sishw_ext.pjVirtualRomBase[0x9F];
+	   v2 = ivideo->sishw_ext.pjVirtualRomBase[0xA1];
+	}
+	outSISIDXREG(SISSR,0x31,v1);
+	outSISIDXREG(SISSR,0x33,v2);
+
+	v1 = 0x11;
+	if(ivideo->sishw_ext.UseROM) {
+	   v1 = ivideo->sishw_ext.pjVirtualRomBase[0xA0];
+	}
+	v2 = inSISIDXREG(SISPART4,0x00);
+	if((v2 != 1) && (v2 != 2)) v1 &= 0xef;
+	outSISIDXREG(SISSR,0x32,v1);
+
+	/* AGP */
+	pci_read_config_long(pdev, 0x50, &reg1_32);
+	reg1_32 >>= 20;
+	reg1_32 &= 0x0f;
+	if(reg1_32 == 1) {
+	   v1 = 0xAA; v2 = 0x33;
+	   if(ivideo->sishw_ext.UseROM) {
+	      v1 = ivideo->sishw_ext.pjVirtualRomBase[0xF7];
+	      v2 = ivideo->sishw_ext.pjVirtualRomBase[0x9E];
+	   }
+	} else {
+	   v1 = 0x88; v2 = 0x03;
+	   if(ivideo->sishw_ext.UseROM) {
+	      v1 = ivideo->sishw_ext.pjVirtualRomBase[0xF8];
+	      v2 = ivideo->sishw_ext.pjVirtualRomBase[0xF6];
+	   }
+	}
+	outSISIDXREG(SISCR,0x49,v1);
+	outSISIDXREG(SISSR,0x25,v2);
+
+	v1 = inSISIDXREG(SISPART4,0x00);
+	if((v1 == 1) || (v1 == 2)) {
+	   orSISIDXREG(SISPART1,0x2F,0x01);  /* Unlock CRT2 */
+	   outSISIDXREG(SISPART1,0x00,0x00);
+	   v1 = 0x00;
+	   if(ivideo->sishw_ext.UseROM) {
+	      v1 = ivideo->sishw_ext.pjVirtualRomBase[0xb6];
+	   }
+	   outSISIDXREG(SISPART1,0x02,v1);
+	   outSISIDXREG(SISPART1,0x2E,0x08);
+	   outSISIDXREG(SISPART2,0x00,0x1c);
+	   v1 = 0x40; v2 = 0x00; v3 = 0x80;
+	   if(ivideo->sishw_ext.UseROM) {
+	      v1 = ivideo->sishw_ext.pjVirtualRomBase[0xb7];
+	      v2 = ivideo->sishw_ext.pjVirtualRomBase[0xb8];
+	      v3 = ivideo->sishw_ext.pjVirtualRomBase[0xbb];
+	   }
+	   outSISIDXREG(SISPART4,0x0d,v1);
+	   outSISIDXREG(SISPART4,0x0e,v2);
+	   outSISIDXREG(SISPART4,0x10,v3);
+	   outSISIDXREG(SISPART4,0x0F,0x3F);
+
+	   inSISIDXREG(SISPART4,0x01,reg);
+	   if(reg >= 0xb0) {
+	      inSISIDXREG(SISPART4,0x23,reg);
+	      reg &= 0x20;
+	      reg <<= 1;
+	      outSISIDXREG(SISPART4,0x23,reg);
+	   }
+	}
+	outSISIDXREG(SISCR,0x37,0x02); /* Why? */
+
+	outSISIDXREG(SISCR,0x83,0x00);
+	outSISIDXREG(SISCR,0x90,0x00);
+	andSISIDXREG(SISSR,0x5B,0xDF);
+	outSISIDXREG(SISVID,0x00,0x86);
+	outSISIDXREG(SISVID,0x32,0x00);
+	outSISIDXREG(SISVID,0x30,0x00);
+	outSISIDXREG(SISVID,0x32,0x01);
+	outSISIDXREG(SISVID,0x30,0x00);
+	orSISIDXREG(SISCR,0x63,0x80);
+	/* End of Init1 */
+
+	/* Set Mode 0x2e */
+
+	/* Ramsize */
+	orSISIDXREG(SISSR,0x16,0x0f);
+	orSISIDXREG(SISSR,0x18,0xA9);
+	orSISIDXREG(SISSR,0x19,0xA0);
+	orSISIDXREG(SISSR,0x1B,0x30);
+	andSISIDXREG(SISSR,0x17,0xF8);
+	orSISIDXREG(SISSR,0x19,0x03);
+	andSIDIDXREG(SISSR,0x13,0x00);
+
+	/* Need to map max FB size for finding out about RAM size */
+	ivideo->sishw_ext.pjVideoMemoryAddress = ioremap(ivideo->video_base, 0x4000000);
+	if(ivideo->sishw_ext.pjVideoMemoryAddress) {
+	   /* Find out about bus width */
+	   if(memtype <= 1) {
+	      outSISIDXREG(SISSR,0x14,0x02);
+	      andSISIDXREG(SISSR,0x16,0x0F);
+	      orSISIDXREG(SISSR,0x16,0x80);
+
+	      ...
+
+	   } else {
+
+	      ...
+
+	   }
+
+	   /* Find out about size */
+
+
+	   iounmap(ivideo->sishw_ext.pjVideoMemoryAddress);
+	} else {
+	   printk(KERN_DEBUG "sisfb: Failed to map memory for size detection, assuming 8MB\n");
+	   outSISIDXREG(SISSR,0x14,0x??);  /* 8MB, 64bit default */
+	}
+
+	/* AGP (Missing: Checks for VIA and AMD hosts) */
+	v1 = 0xA5; v2 = 0xFB;
+	if(ivideo->sishw_ext.UseROM) {
+	   v1 = ivideo->sishw_ext.pjVirtualRomBase[0x9A];
+	   v2 = ivideo->sishw_ext.pjVirtualRomBase[0x9B];
+	}
+	outSISIDXREG(SISSR,0x21,v1);
+	outSISIDXREG(SISSR,0x22,v2);
 
-	switch (ivideo.chip_id) {
-#ifdef CONFIG_FB_SIS_300
-	   case PCI_DEVICE_ID_SI_300:
-		ivideo.chip = SIS_300;
-		sisvga_engine = SIS_300_VGA;
-		sisfb_hwcursor_size = HW_CURSOR_AREA_SIZE_300 * 2;  /* New X driver uses 2 buffers */
-		sisfb_CRT2_write_enable = IND_SIS_CRT2_WRITE_ENABLE_300;
-		break;
-	   case PCI_DEVICE_ID_SI_630_VGA:
-		{
-			ivideo.chip = SIS_630;
-			sisfb_set_reg4(0xCF8, 0x80000000);
-			reg32 = sisfb_get_reg3(0xCFC);
-			if(reg32 == 0x07301039) {
-				ivideo.chip = SIS_730;
-#if LINUX_VERSION_CODE <= KERNEL_VERSION(2,5,0)
-				strcpy(sis_fb_info->modename, "SIS 730");
-#else
-				strcpy(myid, "SIS 730");
-#endif
-			}
-			sisvga_engine = SIS_300_VGA;
-			sisfb_hwcursor_size = HW_CURSOR_AREA_SIZE_300 * 2;
-			sisfb_CRT2_write_enable = IND_SIS_CRT2_WRITE_ENABLE_300;
-			break;
-		}
-	   case PCI_DEVICE_ID_SI_540_VGA:
-		ivideo.chip = SIS_540;
-		sisvga_engine = SIS_300_VGA;
-		sisfb_hwcursor_size = HW_CURSOR_AREA_SIZE_300 * 2;
-		sisfb_CRT2_write_enable = IND_SIS_CRT2_WRITE_ENABLE_300;
-		break;
-#endif
-#ifdef CONFIG_FB_SIS_315
-	   case PCI_DEVICE_ID_SI_315H:
-		ivideo.chip = SIS_315H;
-		sisvga_engine = SIS_315_VGA;
-		sisfb_hwcursor_size = HW_CURSOR_AREA_SIZE_315 * 2;
-		sisfb_CRT2_write_enable = IND_SIS_CRT2_WRITE_ENABLE_315;
-		break;
-	   case PCI_DEVICE_ID_SI_315:
-		ivideo.chip = SIS_315;
-		sisvga_engine = SIS_315_VGA;
-		sisfb_hwcursor_size = HW_CURSOR_AREA_SIZE_315 * 2;
-		sisfb_CRT2_write_enable = IND_SIS_CRT2_WRITE_ENABLE_315;
-		break;
-	   case PCI_DEVICE_ID_SI_315PRO:
-		ivideo.chip = SIS_315PRO;
-		sisvga_engine = SIS_315_VGA;
-		sisfb_hwcursor_size = HW_CURSOR_AREA_SIZE_315 * 2;
-		sisfb_CRT2_write_enable = IND_SIS_CRT2_WRITE_ENABLE_315;
-		break;
-	   case PCI_DEVICE_ID_SI_550_VGA:
-		ivideo.chip = SIS_550;
-		sisvga_engine = SIS_315_VGA;
-		sisfb_hwcursor_size = HW_CURSOR_AREA_SIZE_315 * 2;
-		sisfb_CRT2_write_enable = IND_SIS_CRT2_WRITE_ENABLE_315;
-		break;
-	   case PCI_DEVICE_ID_SI_650_VGA:
-	   	{
-			ivideo.chip = SIS_650;  
-			sisfb_set_reg4(0xCF8, 0x80000000);
-			reg32 = sisfb_get_reg3(0xCFC);
-			if(reg32 == 0x07401039) {
-				ivideo.chip = SIS_740;
-#if LINUX_VERSION_CODE <= KERNEL_VERSION(2,5,0)
-				strcpy(sis_fb_info->modename, "SIS 740");
-#else
-				strcpy(myid, "SIS 740");
-#endif
-			}
-			sisvga_engine = SIS_315_VGA;
-			sisfb_hwcursor_size = HW_CURSOR_AREA_SIZE_315 * 2;
-			sisfb_CRT2_write_enable = IND_SIS_CRT2_WRITE_ENABLE_315;
-			break;
-		}
-	   case PCI_DEVICE_ID_SI_330:
-		ivideo.chip = SIS_330;
-		sisvga_engine = SIS_315_VGA;
-		sisfb_hwcursor_size = HW_CURSOR_AREA_SIZE_315 * 2;
-		sisfb_CRT2_write_enable = IND_SIS_CRT2_WRITE_ENABLE_315;
-		break;
-	   case PCI_DEVICE_ID_SI_660_VGA:
-	   	{
-			sisfb_set_reg4(0xCF8, 0x80000000);
-			reg32 = sisfb_get_reg3(0xCFC);
-			if(reg32 == 0x07601039) {
-				ivideo.chip = SIS_760;
-#if LINUX_VERSION_CODE <= KERNEL_VERSION(2,5,0)
-				strcpy(sis_fb_info->modename, "SIS 760");
-#else
-				strcpy(myid, "SIS 760");
 #endif
-			} else if(reg32 == 0x06601039) {
-				ivideo.chip = SIS_660;
-#if LINUX_VERSION_CODE <= KERNEL_VERSION(2,5,0)
-				strcpy(sis_fb_info->modename, "SIS 660");
-#else
-				strcpy(myid, "SIS 660");
+	return;
+}
 #endif
-			} else if(reg32 == 0x07411039) {
-				ivideo.chip = SIS_741;
-#if LINUX_VERSION_CODE <= KERNEL_VERSION(2,5,0)
-				strcpy(sis_fb_info->modename, "SIS 741");
+
+
+int __devinit sisfb_probe(struct pci_dev *pdev, const struct pci_device_id *ent)
+{
+	struct sisfb_chip_info 	*chipinfo = &sisfb_chip_info[ent->driver_data];
+	struct sis_video_info 	*ivideo = NULL;
+	struct fb_info 		*sis_fb_info = NULL;
+	u16 reg16;
+	u8  reg;
+	int sisvga_enabled = 0, i;
+
+	if(sisfb_off) return -ENXIO;
+
+#if (LINUX_VERSION_CODE >= KERNEL_VERSION(2,6,3))
+	sis_fb_info = framebuffer_alloc(sizeof(*ivideo), &pdev->dev);
+	if(!sis_fb_info) return -ENOMEM;
 #else
-				strcpy(myid, "SIS 741");
+	sis_fb_info = kmalloc(sizeof(*sis_fb_info) + sizeof(*ivideo), GFP_KERNEL);
+	if(!sis_fb_info) return -ENOMEM;
+	memset(sis_fb_info, 0, sizeof(*sis_fb_info) + sizeof(*ivideo));
+	sis_fb_info->par = ((char *)sis_fb_info + sizeof(*sis_fb_info));
 #endif
-			} else {
-				ivideo.chip = SIS_661;
+
+	ivideo = (struct sis_video_info *)sis_fb_info->par;
+	ivideo->memyselfandi = sis_fb_info;
+
+	if(card_list == NULL) {
+	   ivideo->cardnumber = 0;
+	} else {
+	   struct sis_video_info *countvideo = card_list;
+	   ivideo->cardnumber = 1;
+	   while ((countvideo = countvideo->next) != NULL) ivideo->cardnumber++;
+	}
+
+	strncpy(ivideo->myid, chipinfo->chip_name, 30);
+
+	ivideo->chip_id = pdev->device;
+	pci_read_config_byte(pdev, PCI_REVISION_ID, &ivideo->revision_id);
+	ivideo->sishw_ext.jChipRevision = ivideo->revision_id;
+	pci_read_config_word(pdev, PCI_COMMAND, &reg16);
+	sisvga_enabled = reg16 & 0x01;
+	ivideo->pcibus = pdev->bus->number;
+	ivideo->pcislot = PCI_SLOT(pdev->devfn);
+	ivideo->pcifunc = PCI_FUNC(pdev->devfn);
+	ivideo->subsysvendor = pdev->subsystem_vendor;
+	ivideo->subsysdevice = pdev->subsystem_device;
+#ifdef SIS_CONFIG_COMPAT
+	ivideo->ioctl32registered = 0;
+	ivideo->ioctl32vblankregistered = 0;
+#endif
+
+#ifndef MODULE
+	if(sisfb_mode_idx == -1) {
+		sisfb_get_vga_mode_from_kernel();
+	}
+#endif
+
+	ivideo->chip = chipinfo->chip;
+	ivideo->sisvga_engine = chipinfo->vgaengine;
+	ivideo->hwcursor_size = chipinfo->hwcursor_size;
+	ivideo->CRT2_write_enable = chipinfo->CRT2_write_enable;
+	ivideo->mni = chipinfo->mni;
+
+	ivideo->detectedpdc  = 0xff;
+	ivideo->detectedpdca = 0xff;
+	ivideo->detectedlcda = 0xff;
+
+	ivideo->sisfb_thismonitor.datavalid = FALSE;
+
+	ivideo->sisfb_parm_mem = sisfb_parm_mem;
+	ivideo->sisfb_accel = sisfb_accel;
+	ivideo->sisfb_ypan = sisfb_ypan;
+	ivideo->sisfb_max = sisfb_max;
+	ivideo->sisfb_userom = sisfb_userom;
+	ivideo->sisfb_useoem = sisfb_useoem;
+	ivideo->sisfb_mode_idx = sisfb_mode_idx;
+	ivideo->sisfb_parm_rate = sisfb_parm_rate;
+	ivideo->sisfb_crt1off = sisfb_crt1off;
+	ivideo->sisfb_forcecrt1 = sisfb_forcecrt1;
+	ivideo->sisfb_crt2type = sisfb_crt2type;
+	ivideo->sisfb_crt2flags = sisfb_crt2flags;
+	/* pdc(a), scalelcd, special timing, lvdshl handled below */
+	ivideo->sisfb_dstn = sisfb_dstn;
+	ivideo->sisfb_fstn = sisfb_fstn;
+	ivideo->sisfb_tvplug = sisfb_tvplug;
+	ivideo->sisfb_tvstd = sisfb_tvstd;
+	ivideo->tvxpos = sisfb_tvxposoffset;
+	ivideo->tvypos = sisfb_tvyposoffset;
+	ivideo->sisfb_filter = sisfb_filter;
+	ivideo->sisfb_nocrt2rate = sisfb_nocrt2rate;
 #if LINUX_VERSION_CODE <= KERNEL_VERSION(2,5,0)
-				strcpy(sis_fb_info->modename, "SIS 661");
-#else
-				strcpy(myid, "SIS 661");
+	ivideo->sisfb_inverse = sisfb_inverse;
 #endif
-			}
-			sisvga_engine = SIS_315_VGA;
-			sisfb_hwcursor_size = HW_CURSOR_AREA_SIZE_315 * 2;
-			sisfb_CRT2_write_enable = IND_SIS_CRT2_WRITE_ENABLE_315;
+
+	ivideo->refresh_rate = 0;
+	if(ivideo->sisfb_parm_rate != -1) {
+	   ivideo->refresh_rate = ivideo->sisfb_parm_rate;
+	}
+
+	ivideo->SiS_Pr.UsePanelScaler = sisfb_scalelcd;
+	ivideo->SiS_Pr.CenterScreen = -1;
+	ivideo->SiS_Pr.SiS_CustomT = sisfb_specialtiming;
+	ivideo->SiS_Pr.LVDSHL = sisfb_lvdshl;
+
+	ivideo->SiS_Pr.SiS_Backup70xx = 0xff;
+        ivideo->SiS_Pr.SiS_CHOverScan = -1;
+        ivideo->SiS_Pr.SiS_ChSW = FALSE;
+	ivideo->SiS_Pr.SiS_UseLCDA = FALSE;
+	ivideo->SiS_Pr.HaveEMI = FALSE;
+	ivideo->SiS_Pr.HaveEMILCD = FALSE;
+	ivideo->SiS_Pr.OverruleEMI = FALSE;
+	ivideo->SiS_Pr.SiS_SensibleSR11 = FALSE;
+	ivideo->SiS_Pr.SiS_MyCR63 = 0x63;
+	ivideo->SiS_Pr.PDC  = -1;
+	ivideo->SiS_Pr.PDCA = -1;
+#ifdef CONFIG_FB_SIS_315
+	if(ivideo->chip >= SIS_330) {
+	   ivideo->SiS_Pr.SiS_MyCR63 = 0x53;
+	   if(ivideo->chip >= SIS_661) {
+	      ivideo->SiS_Pr.SiS_SensibleSR11 = TRUE;
+	   }
+	}
+#endif
+
+	memcpy(&ivideo->default_var, &my_default_var, sizeof(my_default_var));
+
+	pci_set_drvdata(pdev, ivideo);
+
+	/* Patch special cases */
+	if((ivideo->nbridge = sisfb_get_northbridge(ivideo->chip))) {
+		switch(ivideo->nbridge->device) {
+#ifdef CONFIG_FB_SIS_300
+		case PCI_DEVICE_ID_SI_730:
+		   	ivideo->chip = SIS_730;
+			strcpy(ivideo->myid, "SiS 730");
+		   	break;
+#endif
+#ifdef CONFIG_FB_SIS_315
+		case PCI_DEVICE_ID_SI_651:
+			/* ivideo->chip is ok */
+			strcpy(ivideo->myid, "SiS 651");
+			break;
+		case PCI_DEVICE_ID_SI_740:
+		   	ivideo->chip = SIS_740;
+			strcpy(ivideo->myid, "SiS 740");
+			break;
+		case PCI_DEVICE_ID_SI_661:
+		   	ivideo->chip = SIS_661;
+			strcpy(ivideo->myid, "SiS 661");
+			break;
+		case PCI_DEVICE_ID_SI_741:
+		   	ivideo->chip = SIS_741;
+			strcpy(ivideo->myid, "SiS 741");
+			break;
+		case PCI_DEVICE_ID_SI_760:
+		   	ivideo->chip = SIS_760;
+			strcpy(ivideo->myid, "SiS 760");
 			break;
-		}
 #endif
-           default:
-	   	kfree(sis_fb_info);
-	        return -ENODEV;
+		}
 	}
-	sishw_ext.jChipType = ivideo.chip;
 
-	/* for Debug */
-	if( (sishw_ext.jChipType == SIS_315PRO) ||
-	    (sishw_ext.jChipType == SIS_315) )
-		sishw_ext.jChipType = SIS_315H;
+#if LINUX_VERSION_CODE < KERNEL_VERSION(2,5,0)
+	strcpy(sis_fb_info->modename, ivideo->myid);
+#endif
+
+	ivideo->sishw_ext.jChipType = ivideo->chip;
 
-	ivideo.video_base = pci_resource_start(pdev, 0);
-	ivideo.mmio_base = pci_resource_start(pdev, 1);
-	sishw_ext.ulIOAddress = SiS_Pr.RelIO = pci_resource_start(pdev, 2) + 0x30;
-	ivideo.vga_base = (unsigned short) sishw_ext.ulIOAddress;
+#ifdef CONFIG_FB_SIS_315
+	if((ivideo->sishw_ext.jChipType == SIS_315PRO) ||
+	   (ivideo->sishw_ext.jChipType == SIS_315)) {
+		ivideo->sishw_ext.jChipType = SIS_315H;
+	}
+#endif
 
-	sisfb_mmio_size =  pci_resource_len(pdev, 1);
+	ivideo->video_base = pci_resource_start(pdev, 0);
+	ivideo->mmio_base  = pci_resource_start(pdev, 1);
+	ivideo->mmio_size  = pci_resource_len(pdev, 1);
+	ivideo->SiS_Pr.RelIO = pci_resource_start(pdev, 2) + 0x30;
+	ivideo->sishw_ext.ulIOAddress = ivideo->vga_base = ivideo->SiS_Pr.RelIO;
 
 	if(!sisvga_enabled) {
-	   if(pci_enable_device(pdev)) {
-	      kfree(sis_fb_info);
-	      return -EIO;
-	   }
+	   	if(pci_enable_device(pdev)) {
+	      		pci_set_drvdata(pdev, NULL);
+	      		kfree(sis_fb_info);
+	      		return -EIO;
+	   	}
 	}
 
-	SiS_Pr.SiS_Backup70xx = 0xff;
-        SiS_Pr.SiS_CHOverScan = -1;
-        SiS_Pr.SiS_ChSW = FALSE;
-	SiS_Pr.SiS_UseLCDA = FALSE;
-	SiS_Pr.HaveEMI = FALSE;
-	SiS_Pr.HaveEMILCD = FALSE;
-	SiS_Pr.OverruleEMI = FALSE;
-	SiS_Pr.SiS_SensibleSR11 = FALSE;
-	SiS_Pr.SiS_MyCR63 = 0x63;
-	if(ivideo.chip >= SIS_661) {
-	   SiS_Pr.SiS_SensibleSR11 = TRUE;
-	   SiS_Pr.SiS_MyCR63 = 0x53;
-	}
-	SiSRegInit(&SiS_Pr, sishw_ext.ulIOAddress);
+	SiSRegInit(&ivideo->SiS_Pr, ivideo->sishw_ext.ulIOAddress);
 
 #ifdef CONFIG_FB_SIS_300
-	/* TW: Find PCI systems for Chrontel/GPIO communication setup */
-	if(ivideo.chip == SIS_630) {
-	   int i=0;
+	/* Find PCI systems for Chrontel/GPIO communication setup */
+	if(ivideo->chip == SIS_630) {
+	   i=0;
            do {
-	      if(mychswtable[i].subsysVendor == ivideo.subsysvendor &&
-	         mychswtable[i].subsysCard   == ivideo.subsysdevice) {
-		 SiS_Pr.SiS_ChSW = TRUE;
+	      if(mychswtable[i].subsysVendor == ivideo->subsysvendor &&
+	         mychswtable[i].subsysCard   == ivideo->subsysdevice) {
+		 ivideo->SiS_Pr.SiS_ChSW = TRUE;
 		 printk(KERN_DEBUG "sisfb: Identified [%s %s] requiring Chrontel/GPIO setup\n",
 		        mychswtable[i].vendorName, mychswtable[i].cardName);
 		 break;
@@ -4361,14 +4939,41 @@ int __init sisfb_init(void)
 	}
 #endif
 
-        outSISIDXREG(SISSR, IND_SIS_PASSWORD, SIS_PASSWORD);
+        outSISIDXREG(SISSR, 0x05, 0x86);
 
-#if LINUX_VERSION_CODE < KERNEL_VERSION(2,5,0)		
-#ifdef MODULE
+	if( (!sisvga_enabled)
+#if !defined(__i386__) && !defined(__x86_64__)
+		  	      || (sisfb_resetcard)
+#endif
+			      			   ) {
+	   	for(i = 0x30; i <= 0x3f; i++) {
+	      		outSISIDXREG(SISCR,i,0x00);
+	   	}
+	}
+
+	/* Find out about current video mode */
 	inSISIDXREG(SISCR,0x34,reg);
+	if(reg & 0x7f) {
+		ivideo->modeprechange = reg & 0x7f;
+	} else {
+		ivideo->modeprechange = 0x03;
+#if defined(__i386__) || defined(__x86_64__)
+		{
+			unsigned char *tt = ioremap(0, 0x1000);
+			if(tt) {
+			   	ivideo->modeprechange = tt[0x449];
+			   	iounmap(tt);
+			}
+		}
+#endif
+	}
+
+#if LINUX_VERSION_CODE < KERNEL_VERSION(2,5,0)
+#ifdef MODULE
 	if((reg & 0x80) && (reg != 0xff)) {
-	   if((sisbios_mode[sisfb_mode_idx].mode_no) != 0xFF) {
+	   if((sisbios_mode[ivideo->sisfb_mode_idx].mode_no[ivideo->mni]) != 0xFF) {
 	      printk(KERN_INFO "sisfb: Cannot initialize display mode, X server is active\n");
+	      pci_set_drvdata(pdev, NULL);
 	      kfree(sis_fb_info);
 	      return -EBUSY;
 	   }
@@ -4376,96 +4981,82 @@ int __init sisfb_init(void)
 #endif	
 #endif
 
-	if (sisvga_engine == SIS_315_VGA) {
-		switch (ivideo.chip) {
-		   case SIS_315H:
-		   case SIS_315:
-		   case SIS_330:
-			sishw_ext.bIntegratedMMEnabled = TRUE;
-			break;
-		   case SIS_550:
-		   case SIS_650:
-		   case SIS_740:
-		   case SIS_661:
-		   case SIS_741:
-		   case SIS_660:
-		   case SIS_760:
-			sishw_ext.bIntegratedMMEnabled = TRUE;
-			break;
-		   default:
-			break;
-		}
-	} else if (sisvga_engine == SIS_300_VGA) {
-		if (ivideo.chip == SIS_300) {
-			sishw_ext.bIntegratedMMEnabled = TRUE;
-		} else {
-		        inSISIDXREG(SISSR, IND_SIS_SCRATCH_REG_1A, reg);
-			if (reg & SIS_SCRATCH_REG_1A_MASK)
-				sishw_ext.bIntegratedMMEnabled = TRUE;
-			else
-				sishw_ext.bIntegratedMMEnabled = FALSE;
-		}
+	ivideo->sishw_ext.bIntegratedMMEnabled = TRUE;
+#ifdef CONFIG_FB_SIS_300
+	if(ivideo->sisvga_engine == SIS_300_VGA) {
+	   if(ivideo->chip != SIS_300) {
+	      inSISIDXREG(SISSR, 0x1a, reg);
+	      if(!(reg & 0x10)) {
+		 ivideo->sishw_ext.bIntegratedMMEnabled = FALSE;
+	      }
+	   }
 	}
+#endif
 
-	if(sisfb_userom) {
-	    sishw_ext.pjVirtualRomBase = sis_find_rom();
-	    if(sishw_ext.pjVirtualRomBase) {
-		printk(KERN_INFO "sisfb: Video ROM found and mapped to %p\n",
-		        sishw_ext.pjVirtualRomBase);
-		sishw_ext.UseROM = TRUE;
+	ivideo->bios_vbase = ivideo->bios_abase = NULL;
+	if(ivideo->sisfb_userom) {
+	    ivideo->sishw_ext.pjVirtualRomBase = sis_find_rom(pdev);
+#if defined(__i386__) || defined(__x86_64__)
+	    ivideo->bios_vbase = ivideo->sishw_ext.pjVirtualRomBase;	/* mapped */
+#else
+	    ivideo->bios_abase = ivideo->sishw_ext.pjVirtualRomBase;	/* allocated */
+#endif
+	    if(ivideo->sishw_ext.pjVirtualRomBase) {
+		printk(KERN_INFO "sisfb: Video ROM found and %s to 0x%p\n",
+			ivideo->bios_vbase ? "mapped" : "copied",
+		        ivideo->sishw_ext.pjVirtualRomBase);
+		ivideo->sishw_ext.UseROM = TRUE;
 	    } else {
-	        sishw_ext.UseROM = FALSE;
+	        ivideo->sishw_ext.UseROM = FALSE;
 	        printk(KERN_INFO "sisfb: Video ROM not found\n");
 	    }
 	} else {
-	    sishw_ext.pjVirtualRomBase = NULL;
-	    sishw_ext.UseROM = FALSE;
+	    ivideo->sishw_ext.pjVirtualRomBase = NULL;
+	    ivideo->sishw_ext.UseROM = FALSE;
 	    printk(KERN_INFO "sisfb: Video ROM usage disabled\n");
 	}
-	sishw_ext.bSkipDramSizing = 0;
-	sishw_ext.pQueryVGAConfigSpace = &sisfb_query_VGA_config_space;
-	sishw_ext.pQueryNorthBridgeSpace = &sisfb_query_north_bridge_space;
 
         /* Find systems for special custom timing */
-	if(SiS_Pr.SiS_CustomT == CUT_NONE) {
-	   int i=0, j;
+	if(ivideo->SiS_Pr.SiS_CustomT == CUT_NONE) {
+	   int j;
 	   unsigned char *biosver = NULL;
            unsigned char *biosdate = NULL;
 	   BOOLEAN footprint;
-	   unsigned long chksum = 0;
+	   u32 chksum = 0;
 
-	   if(sishw_ext.UseROM) {
-	      biosver = sishw_ext.pjVirtualRomBase + 0x06;
-	      biosdate = sishw_ext.pjVirtualRomBase + 0x2c;
-              for(i=0; i<32768; i++) chksum += sishw_ext.pjVirtualRomBase[i];
+	   if(ivideo->sishw_ext.UseROM) {
+	      biosver = ivideo->sishw_ext.pjVirtualRomBase + 0x06;
+	      biosdate = ivideo->sishw_ext.pjVirtualRomBase + 0x2c;
+              for(i=0; i<32768; i++) chksum += ivideo->sishw_ext.pjVirtualRomBase[i];
 	   }
 
 	   i=0;
            do {
-	      if( (mycustomttable[i].chipID == ivideo.chip) &&
+	      if( (mycustomttable[i].chipID == ivideo->chip) &&
 	          ((!strlen(mycustomttable[i].biosversion)) ||
-		   (sishw_ext.UseROM &&
+		   (ivideo->sishw_ext.UseROM &&
 		   (!strncmp(mycustomttable[i].biosversion, biosver, strlen(mycustomttable[i].biosversion))))) &&
 	          ((!strlen(mycustomttable[i].biosdate)) ||
-		   (sishw_ext.UseROM &&
+		   (ivideo->sishw_ext.UseROM &&
 		   (!strncmp(mycustomttable[i].biosdate, biosdate, strlen(mycustomttable[i].biosdate))))) &&
 		  ((!mycustomttable[i].bioschksum) ||
-		   (sishw_ext.UseROM &&
+		   (ivideo->sishw_ext.UseROM &&
 	           (mycustomttable[i].bioschksum == chksum)))	&&
-		  (mycustomttable[i].pcisubsysvendor == ivideo.subsysvendor) &&
-		  (mycustomttable[i].pcisubsyscard == ivideo.subsysdevice) ) {
+		  (mycustomttable[i].pcisubsysvendor == ivideo->subsysvendor) &&
+		  (mycustomttable[i].pcisubsyscard == ivideo->subsysdevice) ) {
 		 footprint = TRUE;
-	         for(j=0; j<5; j++) {
+	         for(j = 0; j < 5; j++) {
 	            if(mycustomttable[i].biosFootprintAddr[j]) {
-		       if(sishw_ext.UseROM) {
-	                  if(sishw_ext.pjVirtualRomBase[mycustomttable[i].biosFootprintAddr[j]] !=
-		      		mycustomttable[i].biosFootprintData[j])
-		          footprint = FALSE;
+		       if(ivideo->sishw_ext.UseROM) {
+	                  if(ivideo->sishw_ext.pjVirtualRomBase[mycustomttable[i].biosFootprintAddr[j]] !=
+		      		mycustomttable[i].biosFootprintData[j]) {
+		             footprint = FALSE;
+			  }
 		       } else footprint = FALSE;
 		    }
 	         }
 	         if(footprint) {
-	 	    SiS_Pr.SiS_CustomT = mycustomttable[i].SpecialID;
+	 	    ivideo->SiS_Pr.SiS_CustomT = mycustomttable[i].SpecialID;
 		    printk(KERN_DEBUG "sisfb: Identified [%s %s], special timing applies\n",
 		        mycustomttable[i].vendorName,
 			mycustomttable[i].cardName);
@@ -4479,466 +5070,502 @@ int __init sisfb_init(void)
 	}
 
 #ifdef CONFIG_FB_SIS_300
-	/* Mode numbers for 1280x768 are different for 300 and 315 series */
-	if(sisvga_engine == SIS_300_VGA) {
-		sisbios_mode[MODEINDEX_1280x768].mode_no = 0x55;
-		sisbios_mode[MODEINDEX_1280x768+1].mode_no = 0x5a;
-		sisbios_mode[MODEINDEX_1280x768+2].mode_no = 0x5b;
-		sisbios_mode[MODEINDEX_1280x768+3].mode_no = 0x5b;
-	}
+	if(ivideo->sisvga_engine == SIS_300_VGA) {
+		if( (!sisvga_enabled)
+#if !defined(__i386__) && !defined(__x86_64__)
+		    		      || (sisfb_resetcard)
 #endif
-
-	sishw_ext.pSR = vmalloc(sizeof(SIS_DSReg) * SR_BUFFER_SIZE);
-	if (sishw_ext.pSR == NULL) {
-		printk(KERN_ERR "sisfb: Fatal error: Allocating SRReg space failed.\n");
-		kfree(sis_fb_info);
-		return -ENODEV;
-	}
-	sishw_ext.pSR[0].jIdx = sishw_ext.pSR[0].jVal = 0xFF;
-
-	sishw_ext.pCR = vmalloc(sizeof(SIS_DSReg) * CR_BUFFER_SIZE);
-	if (sishw_ext.pCR == NULL) {
-	        vfree(sishw_ext.pSR);
-		printk(KERN_ERR "sisfb: Fatal error: Allocating CRReg space failed.\n");
-		kfree(sis_fb_info);
-		return -ENODEV;
-	}
-	sishw_ext.pCR[0].jIdx = sishw_ext.pCR[0].jVal = 0xFF;
-
-#ifdef CONFIG_FB_SIS_300
-	if(sisvga_engine == SIS_300_VGA) {
-		if(!sisvga_enabled) {
-		        /* Mapping Max FB Size for 300 Init */
-			sishw_ext.pjVideoMemoryAddress = ioremap(ivideo.video_base, 0x4000000);
-			if((sisfb_mode_idx < 0) || ((sisbios_mode[sisfb_mode_idx].mode_no) != 0xFF)) {
-				outSISIDXREG(SISSR, IND_SIS_PASSWORD, SIS_PASSWORD);
+		  					   ) {
+			if(ivideo->chip == SIS_300) {
+				sisfb_post_sis300(pdev);
 			}
 		}
-		if(sisfb_get_dram_size_300()) {
-		        vfree(sishw_ext.pSR);
-			vfree(sishw_ext.pCR);
-			printk(KERN_ERR "sisfb: Fatal error: Unable to determine RAM size\n");
-			kfree(sis_fb_info);
-			return -ENODEV;
-		}
 	}
 #endif
 
 #ifdef CONFIG_FB_SIS_315
-	if (sisvga_engine == SIS_315_VGA) {
-		if (!sisvga_enabled) {
-			/* Mapping Max FB Size for 315 Init */
-			sishw_ext.pjVideoMemoryAddress = ioremap(ivideo.video_base, 0x8000000);
-			if((sisfb_mode_idx < 0) || ((sisbios_mode[sisfb_mode_idx].mode_no) != 0xFF)) {
-				outSISIDXREG(SISSR, IND_SIS_PASSWORD, SIS_PASSWORD);
-				sishw_ext.bSkipDramSizing = TRUE;
-				sishw_ext.pSR[0].jIdx = 0x13;
-				sishw_ext.pSR[1].jIdx = 0x14;
-				sishw_ext.pSR[2].jIdx = 0xFF;
-				inSISIDXREG(SISSR, 0x13, sishw_ext.pSR[0].jVal);
-				inSISIDXREG(SISSR, 0x14, sishw_ext.pSR[1].jVal);
-				sishw_ext.pSR[2].jVal = 0xFF;
+	if(ivideo->sisvga_engine == SIS_315_VGA) {
+		if( (!sisvga_enabled)
+#if !defined(__i386__) && !defined(__x86_64__)
+		    		     || (sisfb_resetcard)
+#endif
+		  					  ) {
+			if((ivideo->chip == SIS_315H)   ||
+			   (ivideo->chip == SIS_315)    ||
+			   (ivideo->chip == SIS_315PRO) ||
+			   (ivideo->chip == SIS_330)) {
+				sisfb_post_sis315330(pdev);
 			}
 		}
-		if(sisfb_get_dram_size_315()) {
-			vfree(sishw_ext.pSR);
-			vfree(sishw_ext.pCR);
-			printk(KERN_INFO "sisfb: Fatal error: Unable to determine RAM size.\n");
-			kfree(sis_fb_info);
-			return -ENODEV;
-		}
 	}
 #endif
 
-	if((sisfb_mode_idx < 0) || ((sisbios_mode[sisfb_mode_idx].mode_no) != 0xFF)) { 
+	if(sisfb_get_dram_size(ivideo)) {
+		printk(KERN_INFO "sisfb: Fatal error: Unable to determine RAM size.\n");
+		if(ivideo->bios_abase) vfree(ivideo->bios_abase);
+		pci_set_drvdata(pdev, NULL);
+		kfree(sis_fb_info);
+		return -ENODEV;
+	}
 
+	if((ivideo->sisfb_mode_idx < 0) ||
+	   ((sisbios_mode[ivideo->sisfb_mode_idx].mode_no[ivideo->mni]) != 0xFF)) {
 	        /* Enable PCI_LINEAR_ADDRESSING and MMIO_ENABLE  */
 	        orSISIDXREG(SISSR, IND_SIS_PCI_ADDRESS_SET, (SIS_PCI_ADDR_ENABLE | SIS_MEM_MAP_IO_ENABLE));
-
                 /* Enable 2D accelerator engine */
 	        orSISIDXREG(SISSR, IND_SIS_MODULE_ENABLE, SIS_ENABLE_2D);
-
 	}
 
-	sishw_ext.ulVideoMemorySize = ivideo.video_size;
-
-	if(sisvga_engine == SIS_300_VGA) sisfb_pdc &= 0x3c;
-	if(sisfb_pdc) {
-	    SiS_Pr.PDC = sisfb_pdc;
-	} else {
-	    SiS_Pr.PDC = 0;
+	if(sisfb_pdc != 0xff) {
+	   if(ivideo->sisvga_engine == SIS_300_VGA) sisfb_pdc &= 0x3c;
+	   else				            sisfb_pdc &= 0x1f;
+	   ivideo->SiS_Pr.PDC = sisfb_pdc;
 	}
+#ifdef CONFIG_FB_SIS_315
+	if(ivideo->sisvga_engine == SIS_315_VGA) {
+	   if(sisfb_pdca != 0xff) ivideo->SiS_Pr.PDCA = sisfb_pdca & 0x1f;
+	}
+#endif
 
-	if(!request_mem_region(ivideo.video_base, ivideo.video_size, "sisfb FB")) {
+	if(!request_mem_region(ivideo->video_base, ivideo->video_size, "sisfb FB")) {
 		printk(KERN_ERR "sisfb: Fatal error: Unable to reserve frame buffer memory\n");
 		printk(KERN_ERR "sisfb: Is there another framebuffer driver active?\n");
-		vfree(sishw_ext.pSR);
-		vfree(sishw_ext.pCR);
+		if(ivideo->bios_abase) vfree(ivideo->bios_abase);
+		if(ivideo->bios_vbase) iounmap(ivideo->bios_vbase);
+		pci_set_drvdata(pdev, NULL);
 		kfree(sis_fb_info);
 		return -ENODEV;
 	}
 
-	if(!request_mem_region(ivideo.mmio_base, sisfb_mmio_size, "sisfb MMIO")) {
+	if(!request_mem_region(ivideo->mmio_base, ivideo->mmio_size, "sisfb MMIO")) {
 		printk(KERN_ERR "sisfb: Fatal error: Unable to reserve MMIO region\n");
-		release_mem_region(ivideo.video_base, ivideo.video_size);
-		vfree(sishw_ext.pSR);
-		vfree(sishw_ext.pCR);
+		release_mem_region(ivideo->video_base, ivideo->video_size);
+		if(ivideo->bios_abase) vfree(ivideo->bios_abase);
+		if(ivideo->bios_vbase) iounmap(ivideo->bios_vbase);
+		pci_set_drvdata(pdev, NULL);
 		kfree(sis_fb_info);
 		return -ENODEV;
 	}
 
-	ivideo.video_vbase = sishw_ext.pjVideoMemoryAddress = ioremap(ivideo.video_base, ivideo.video_size);
-	if(!ivideo.video_vbase) {
+	ivideo->video_vbase = (unsigned long)ioremap(ivideo->video_base, ivideo->video_size);
+	ivideo->sishw_ext.pjVideoMemoryAddress = (unsigned char *)ivideo->video_vbase;
+	if(!ivideo->video_vbase) {
 	   	printk(KERN_ERR "sisfb: Fatal error: Unable to map frame buffer memory\n");
-	   	release_mem_region(ivideo.video_base, ivideo.video_size);
-	   	release_mem_region(ivideo.mmio_base, sisfb_mmio_size);
-	   	vfree(sishw_ext.pSR);
-	   	vfree(sishw_ext.pCR);
+	   	release_mem_region(ivideo->video_base, ivideo->video_size);
+	   	release_mem_region(ivideo->mmio_base, ivideo->mmio_size);
+		if(ivideo->bios_abase) vfree(ivideo->bios_abase);
+		if(ivideo->bios_vbase) iounmap(ivideo->bios_vbase);
+		pci_set_drvdata(pdev, NULL);
 	   	kfree(sis_fb_info);
 	   	return -ENODEV;
 	}
 
-	ivideo.mmio_vbase = ioremap(ivideo.mmio_base, sisfb_mmio_size);
-	if(!ivideo.mmio_vbase) {
+	ivideo->mmio_vbase = (unsigned long)ioremap(ivideo->mmio_base, ivideo->mmio_size);
+	if(!ivideo->mmio_vbase) {
 	   	printk(KERN_ERR "sisfb: Fatal error: Unable to map MMIO region\n");
-	   	iounmap(ivideo.video_vbase);
-	   	release_mem_region(ivideo.video_base, ivideo.video_size);
-	   	release_mem_region(ivideo.mmio_base, sisfb_mmio_size);
-	   	vfree(sishw_ext.pSR);
-	   	vfree(sishw_ext.pCR);
+	   	iounmap((void *)ivideo->video_vbase);
+	   	release_mem_region(ivideo->video_base, ivideo->video_size);
+	   	release_mem_region(ivideo->mmio_base, ivideo->mmio_size);
+		if(ivideo->bios_abase) vfree(ivideo->bios_abase);
+		if(ivideo->bios_vbase) iounmap(ivideo->bios_vbase);
+		pci_set_drvdata(pdev, NULL);
 	   	kfree(sis_fb_info);
 	   	return -ENODEV;
 	}
 
-	printk(KERN_INFO "sisfb: Framebuffer at 0x%lx, mapped to 0x%p, size %dk\n",
-	       	ivideo.video_base, ivideo.video_vbase, ivideo.video_size / 1024);
+	printk(KERN_INFO "sisfb: Framebuffer at 0x%lx, mapped to 0x%lx, size %ldk\n",
+	       	ivideo->video_base, ivideo->video_vbase, ivideo->video_size / 1024);
 
-	printk(KERN_INFO "sisfb: MMIO at 0x%lx, mapped to 0x%p, size %ldk\n",
-	       	ivideo.mmio_base, ivideo.mmio_vbase, sisfb_mmio_size / 1024);
+	printk(KERN_INFO "sisfb: MMIO at 0x%lx, mapped to 0x%lx, size %ldk\n",
+	       	ivideo->mmio_base, ivideo->mmio_vbase, ivideo->mmio_size / 1024);
 
-	if(sisfb_heap_init()) {
+	if((ivideo->havenoheap = sisfb_heap_init(ivideo))) {
 		printk(KERN_WARNING "sisfb: Failed to initialize offscreen memory heap\n");
 	}
 
-	ivideo.mtrr = (unsigned int) 0;
+	/* Used for clearing the screen only, therefore respect our mem limit */
+	ivideo->sishw_ext.ulVideoMemorySize = ivideo->sisfb_mem;
+
+	ivideo->mtrr = 0;
 
-	ivideo.vbflags = 0;
+	ivideo->vbflags = 0;
+	ivideo->lcddefmodeidx = DEFAULT_LCDMODE;
+	ivideo->tvdefmodeidx  = DEFAULT_TVMODE;
+	ivideo->defmodeidx    = DEFAULT_MODE;
 
-	if((sisfb_mode_idx < 0) || ((sisbios_mode[sisfb_mode_idx].mode_no) != 0xFF)) {
+	ivideo->newrom = SiSDetermineROMLayout661(&ivideo->SiS_Pr, &ivideo->sishw_ext);
 
-		sishw_ext.ujVBChipID = VB_CHIP_UNKNOWN;
-		sishw_ext.Is301BDH = FALSE;
-		sishw_ext.usExternalChip = 0;
+	if((ivideo->sisfb_mode_idx < 0) ||
+	   ((sisbios_mode[ivideo->sisfb_mode_idx].mode_no[ivideo->mni]) != 0xFF)) {
 
-		sisfb_sense_crt1();
+		sisfb_sense_crt1(ivideo);
 
-		sisfb_get_VB_type();
+		sisfb_get_VB_type(ivideo);
 
-		if(ivideo.vbflags & VB_VIDEOBRIDGE) {
-			sisfb_detect_VB_connect();
+		if(ivideo->vbflags & VB_VIDEOBRIDGE) {
+			sisfb_detect_VB_connect(ivideo);
 		}
 
-		ivideo.currentvbflags = ivideo.vbflags & VB_VIDEOBRIDGE;
+		ivideo->currentvbflags = ivideo->vbflags & (VB_VIDEOBRIDGE | TV_STANDARD);
 
-		if(ivideo.vbflags & VB_VIDEOBRIDGE) {
-		   if(sisfb_crt2type != -1) {
-		      if((sisfb_crt2type == CRT2_LCD) && (ivideo.vbflags & CRT2_LCD)) {
-		         ivideo.currentvbflags |= CRT2_LCD;
-		      } else if(sisfb_crt2type != CRT2_LCD) {
-		         ivideo.currentvbflags |= sisfb_crt2type;
+		if(ivideo->vbflags & VB_VIDEOBRIDGE) {
+		   if(ivideo->sisfb_crt2type != -1) {
+		      if((ivideo->sisfb_crt2type == CRT2_LCD) && (ivideo->vbflags & CRT2_LCD)) {
+		         ivideo->currentvbflags |= CRT2_LCD;
+		      } else if(ivideo->sisfb_crt2type != CRT2_LCD) {
+		         ivideo->currentvbflags |= ivideo->sisfb_crt2type;
 		      }
 		   } else {
 		      /* Chrontel 700x TV detection often unreliable, therefore use a
 		       * different default order on such machines
 		       */
-		      if((sisvga_engine == SIS_300_VGA) && (ivideo.vbflags & VB_CHRONTEL)) {
-		         if(ivideo.vbflags & CRT2_LCD)      ivideo.currentvbflags |= CRT2_LCD;
-		         else if(ivideo.vbflags & CRT2_TV)  ivideo.currentvbflags |= CRT2_TV;
-		         else if(ivideo.vbflags & CRT2_VGA) ivideo.currentvbflags |= CRT2_VGA;
+		      if((ivideo->sisvga_engine == SIS_300_VGA) && (ivideo->vbflags & VB_CHRONTEL)) {
+		         if(ivideo->vbflags & CRT2_LCD)      ivideo->currentvbflags |= CRT2_LCD;
+		         else if(ivideo->vbflags & CRT2_TV)  ivideo->currentvbflags |= CRT2_TV;
+		         else if(ivideo->vbflags & CRT2_VGA) ivideo->currentvbflags |= CRT2_VGA;
 		      } else {
-		         if(ivideo.vbflags & CRT2_TV)       ivideo.currentvbflags |= CRT2_TV;
-		         else if(ivideo.vbflags & CRT2_LCD) ivideo.currentvbflags |= CRT2_LCD;
-		         else if(ivideo.vbflags & CRT2_VGA) ivideo.currentvbflags |= CRT2_VGA;
+		         if(ivideo->vbflags & CRT2_TV)       ivideo->currentvbflags |= CRT2_TV;
+		         else if(ivideo->vbflags & CRT2_LCD) ivideo->currentvbflags |= CRT2_LCD;
+		         else if(ivideo->vbflags & CRT2_VGA) ivideo->currentvbflags |= CRT2_VGA;
 		      }
 		   }
 		}
 
-		if(ivideo.vbflags & CRT2_LCD) {
-		   inSISIDXREG(SISCR, IND_SIS_LCD_PANEL, reg);
+		if(ivideo->vbflags & CRT2_LCD) {
+		   inSISIDXREG(SISCR, 0x36, reg);
 		   reg &= 0x0f;
-		   if(sisvga_engine == SIS_300_VGA) {
-		      sishw_ext.ulCRT2LCDType = sis300paneltype[reg];
+		   if(ivideo->sisvga_engine == SIS_300_VGA) {
+		      ivideo->sishw_ext.ulCRT2LCDType = sis300paneltype[reg];
+		   } else if(ivideo->chip >= SIS_661) {
+		      ivideo->sishw_ext.ulCRT2LCDType = sis661paneltype[reg];
 		   } else {
-		      sishw_ext.ulCRT2LCDType = sis310paneltype[reg];
+		      ivideo->sishw_ext.ulCRT2LCDType = sis310paneltype[reg];
+		      if((ivideo->chip == SIS_550) && (sisfb_fstn)) {
+		         if((ivideo->sishw_ext.ulCRT2LCDType != LCD_640x480_2) &&
+			    (ivideo->sishw_ext.ulCRT2LCDType != LCD_640x480_3)) {
+		      	    ivideo->sishw_ext.ulCRT2LCDType = LCD_320x480;
+			 }
+		      }
+		   }
+		   if(ivideo->sishw_ext.ulCRT2LCDType == LCD_UNKNOWN) {
+		      ivideo->sishw_ext.ulCRT2LCDType = LCD_1024x768;
+		      printk(KERN_DEBUG "sisfb: Illegal panel ID (%02x), assuming 1024x768\n", reg);
+		   }
+		   for(i = 0; i < SIS_LCD_NUMBER; i++) {
+		      if(ivideo->sishw_ext.ulCRT2LCDType == sis_lcd_data[i].lcdtype) {
+		         ivideo->lcdxres = sis_lcd_data[i].xres;
+			 ivideo->lcdyres = sis_lcd_data[i].yres;
+			 ivideo->lcddefmodeidx = sis_lcd_data[i].default_mode_idx;
+			 break;
+		      }
+		   }
+		   if(ivideo->SiS_Pr.SiS_CustomT == CUT_BARCO1366) {
+	   		ivideo->lcdxres = 1360; ivideo->lcdyres = 1024; ivideo->lcddefmodeidx = 99;
+		   } else if(ivideo->SiS_Pr.SiS_CustomT == CUT_PANEL848) {
+	   		ivideo->lcdxres =  848; ivideo->lcdyres =  480; ivideo->lcddefmodeidx = 47;
 		   }
+		   printk(KERN_DEBUG "sisfb: Detected %dx%d flat panel\n",
+		   		ivideo->lcdxres, ivideo->lcdyres);
 		}
-		
-		sisfb_detectedpdc = 0;
 
 #ifdef CONFIG_FB_SIS_300
                 /* Save the current PanelDelayCompensation if the LCD is currently used */
-		if(sisvga_engine == SIS_300_VGA) {
-	           if(ivideo.vbflags & (VB_LVDS | VB_30xBDH)) {
+		if(ivideo->sisvga_engine == SIS_300_VGA) {
+	           if(ivideo->vbflags & (VB_LVDS | VB_30xBDH)) {
 		       int tmp;
 		       inSISIDXREG(SISCR,0x30,tmp);
 		       if(tmp & 0x20) {
 		          /* Currently on LCD? If yes, read current pdc */
-		          inSISIDXREG(SISPART1,0x13,sisfb_detectedpdc);
-			  sisfb_detectedpdc &= 0x3c;
-			  if(SiS_Pr.PDC == 0) {
+		          inSISIDXREG(SISPART1,0x13,ivideo->detectedpdc);
+			  ivideo->detectedpdc &= 0x3c;
+			  if(ivideo->SiS_Pr.PDC == -1) {
 			     /* Let option override detection */
-			     SiS_Pr.PDC = sisfb_detectedpdc;
+			     ivideo->SiS_Pr.PDC = ivideo->detectedpdc;
 			  }
-			  printk(KERN_INFO
-			         "sisfb: Detected LCD PanelDelayCompensation %d\n",
-  			         sisfb_detectedpdc);
+			  printk(KERN_INFO "sisfb: Detected LCD PDC 0x%02x\n",
+  			         ivideo->detectedpdc);
 		       }
-		       if((SiS_Pr.PDC) && (SiS_Pr.PDC != sisfb_detectedpdc)) {
-		          printk(KERN_INFO
-			         "sisfb: Using LCD PanelDelayCompensation %d\n",
-				 SiS_Pr.PDC);
+		       if((ivideo->SiS_Pr.PDC != -1) && (ivideo->SiS_Pr.PDC != ivideo->detectedpdc)) {
+		          printk(KERN_INFO "sisfb: Using LCD PDC 0x%02x\n",
+				 ivideo->SiS_Pr.PDC);
 		       }
 	           }
 		}
 #endif
 
-	        sisfb_detectedlcda = 0xff;
-
 #ifdef CONFIG_FB_SIS_315
+		if(ivideo->sisvga_engine == SIS_315_VGA) {
+
+		   /* Try to find about LCDA */
+		   if(ivideo->vbflags & (VB_301C | VB_302B | VB_301LV | VB_302LV | VB_302ELV)) {
+		      int tmp;
+		      inSISIDXREG(SISPART1,0x13,tmp);
+		      if(tmp & 0x04) {
+		         ivideo->SiS_Pr.SiS_UseLCDA = TRUE;
+		         ivideo->detectedlcda = 0x03;
+		      }
+	           }
 
-		if(sisvga_engine == SIS_315_VGA) {
 		   /* Save PDC */
-		   if(ivideo.vbflags & (VB_301LV | VB_302LV | VB_302ELV)) {
+		   if(ivideo->vbflags & (VB_301LV | VB_302LV | VB_302ELV)) {
 		      int tmp;
 		      inSISIDXREG(SISCR,0x30,tmp);
-		      if(tmp & 0x20) {
+		      if((tmp & 0x20) || (ivideo->detectedlcda != 0xff)) {
 		         /* Currently on LCD? If yes, read current pdc */
-		         inSISIDXREG(SISPART1,0x2D,sisfb_detectedpdc);
-			 if(SiS_Pr.PDC == 0) {
-			    /* Let option override detection */
-			    SiS_Pr.PDC = sisfb_detectedpdc;
+			 u8 pdc;
+		         inSISIDXREG(SISPART1,0x2D,pdc);
+			 ivideo->detectedpdc  = (pdc & 0x0f) << 1;
+			 ivideo->detectedpdca = (pdc & 0xf0) >> 3;
+			 inSISIDXREG(SISPART1,0x35,pdc);
+			 ivideo->detectedpdc |= ((pdc >> 7) & 0x01);
+			 inSISIDXREG(SISPART1,0x20,pdc);
+			 ivideo->detectedpdca |= ((pdc >> 6) & 0x01);
+			 if(ivideo->newrom) {
+			    /* New ROM invalidates other PDC resp. */
+			    if(ivideo->detectedlcda != 0xff) {
+			       ivideo->detectedpdc = 0xff;
+			    } else {
+			       ivideo->detectedpdca = 0xff;
+			    }
+			 }
+			 if(ivideo->SiS_Pr.PDC == -1) {
+			    if(ivideo->detectedpdc != 0xff) {
+			       ivideo->SiS_Pr.PDC = ivideo->detectedpdc;
+			    }
+			 }
+			 if(ivideo->SiS_Pr.PDCA == -1) {
+			    if(ivideo->detectedpdca != 0xff) {
+			       ivideo->SiS_Pr.PDCA = ivideo->detectedpdca;
+			    }
+			 }
+			 if(ivideo->detectedpdc != 0xff) {
+			    printk(KERN_INFO
+			         "sisfb: Detected LCD PDC 0x%02x (for LCD=CRT2)\n",
+  			          ivideo->detectedpdc);
+			 }
+			 if(ivideo->detectedpdca != 0xff) {
+			    printk(KERN_INFO
+			         "sisfb: Detected LCD PDC1 0x%02x (for LCD=CRT1)\n",
+  			          ivideo->detectedpdca);
 			 }
-			 printk(KERN_INFO
-			        "sisfb: Detected LCD PanelDelayCompensation %d\n",
-  			         sisfb_detectedpdc);
-		      }
-		      if((SiS_Pr.PDC) && (SiS_Pr.PDC != sisfb_detectedpdc)) {
-		         printk(KERN_INFO
-			         "sisfb: Using LCD PanelDelayCompensation %d\n",
-				 SiS_Pr.PDC);
 		      }
+
 		      /* Save EMI */
-		      if(ivideo.vbflags & (VB_302LV | VB_302ELV)) {
-		         inSISIDXREG(SISPART4,0x30,SiS_Pr.EMI_30);
-			 inSISIDXREG(SISPART4,0x31,SiS_Pr.EMI_31);
-			 inSISIDXREG(SISPART4,0x32,SiS_Pr.EMI_32);
-			 inSISIDXREG(SISPART4,0x33,SiS_Pr.EMI_33);
-			 SiS_Pr.HaveEMI = TRUE;
-			 if(tmp & 0x20) SiS_Pr.HaveEMILCD = TRUE;
+		      if(ivideo->vbflags & (VB_302LV | VB_302ELV)) {
+		         inSISIDXREG(SISPART4,0x30,ivideo->SiS_Pr.EMI_30);
+			 inSISIDXREG(SISPART4,0x31,ivideo->SiS_Pr.EMI_31);
+			 inSISIDXREG(SISPART4,0x32,ivideo->SiS_Pr.EMI_32);
+			 inSISIDXREG(SISPART4,0x33,ivideo->SiS_Pr.EMI_33);
+			 ivideo->SiS_Pr.HaveEMI = TRUE;
+			 if((tmp & 0x20) || (ivideo->detectedlcda != 0xff)) {
+			  	ivideo->SiS_Pr.HaveEMILCD = TRUE;
+			 }
 		      }
 		   }
 
-		   /* Try to find about LCDA */
-		   if(ivideo.vbflags & (VB_301C | VB_302B | VB_301LV | VB_302LV | VB_302ELV)) {
-		      int tmp;
-		      inSISIDXREG(SISCR,0x34,tmp);
-		      if((tmp <= 0x13) || (tmp == 0xff)) {
-		         /* Currently on LCDA? (Some BIOSes leave CR38) */
-		         inSISIDXREG(SISCR,0x38,tmp);
-			 if((tmp & 0x03) == 0x03)  SiS_Pr.SiS_UseLCDA = TRUE;
-			 else {
-			    /* Currently on LCDA? (Some newer BIOSes set D0 in CR35) */
-			    inSISIDXREG(SISCR,0x35,tmp);
-			    if(tmp & 0x01) SiS_Pr.SiS_UseLCDA = TRUE;
-			    else {
-			       /* Currently on LCD? If so, we can find out
-			        * by peeking the mode register
-				*/
-			       inSISIDXREG(SISCR,0x30,tmp);
-			       if(tmp & 0x20) {
-			          inSISIDXREG(SISPART1,0x13,tmp);
-				  if(tmp & 0x04) SiS_Pr.SiS_UseLCDA = TRUE;
-			       }
-			    }
-			 }
+		   /* Let user override detected PDCs (all bridges) */
+		   if(ivideo->vbflags & (VB_301B | VB_301C | VB_301LV | VB_302LV | VB_302ELV)) {
+		      if((ivideo->SiS_Pr.PDC != -1) && (ivideo->SiS_Pr.PDC != ivideo->detectedpdc)) {
+		         printk(KERN_INFO "sisfb: Using LCD PDC 0x%02x (for LCD=CRT2)\n",
+				 ivideo->SiS_Pr.PDC);
 		      }
-		      if(SiS_Pr.SiS_UseLCDA) {
-		         sisfb_detectedlcda = 0x03;
-		         printk(KERN_DEBUG
-			        "sisfb: Bridge uses LCDA for low resolution and text modes\n");
+		      if((ivideo->SiS_Pr.PDCA != -1) && (ivideo->SiS_Pr.PDCA != ivideo->detectedpdca)) {
+		         printk(KERN_INFO "sisfb: Using LCD PDC1 0x%02x (for LCD=CRT1)\n",
+				 ivideo->SiS_Pr.PDCA);
 		      }
-	          }
+		   }
+
 		}
 #endif
 
-		if (!sisfb_crt1off) {
-		   	sisfb_handle_ddc(&sisfb_thismonitor, 0);
+		if(!ivideo->sisfb_crt1off) {
+		   	sisfb_handle_ddc(ivideo, &ivideo->sisfb_thismonitor, 0);
 		} else {
-		   	if ((ivideo.vbflags & (VB_301|VB_301B|VB_301C|VB_302B)) &&
-		      	    (ivideo.vbflags & (CRT2_VGA | CRT2_LCD))) {
-		      		sisfb_handle_ddc(&sisfb_thismonitor, 1);
+		   	if((ivideo->vbflags & (VB_301|VB_301B|VB_301C|VB_302B)) &&
+		      	   (ivideo->vbflags & (CRT2_VGA | CRT2_LCD))) {
+		      		sisfb_handle_ddc(ivideo, &ivideo->sisfb_thismonitor, 1);
 		   	}
 		}
 
-		if (sisfb_mode_idx >= 0)
-			sisfb_mode_idx = sisfb_validate_mode(sisfb_mode_idx, ivideo.currentvbflags);
+		if(ivideo->sisfb_mode_idx >= 0) {
+			int bu = ivideo->sisfb_mode_idx;
+			ivideo->sisfb_mode_idx = sisfb_validate_mode(ivideo,
+					ivideo->sisfb_mode_idx, ivideo->currentvbflags);
+			if(bu != ivideo->sisfb_mode_idx) {
+				printk(KERN_ERR "Mode %dx%dx%d failed validation\n",
+					sisbios_mode[bu].xres,
+					sisbios_mode[bu].yres,
+					sisbios_mode[bu].bpp);
+			}
+		}
 
-		if (sisfb_mode_idx < 0) {
-			switch (ivideo.currentvbflags & VB_DISPTYPE_DISP2) {
+		if(ivideo->sisfb_mode_idx < 0) {
+			switch(ivideo->currentvbflags & VB_DISPTYPE_DISP2) {
 			   case CRT2_LCD:
-				sisfb_mode_idx = DEFAULT_LCDMODE;
+				ivideo->sisfb_mode_idx = ivideo->lcddefmodeidx;
 				break;
 			   case CRT2_TV:
-				sisfb_mode_idx = DEFAULT_TVMODE;
+				ivideo->sisfb_mode_idx = ivideo->tvdefmodeidx;
 				break;
 			   default:
-				sisfb_mode_idx = DEFAULT_MODE;
+				ivideo->sisfb_mode_idx = ivideo->defmodeidx;
 				break;
 			}
 		}
 
-		sisfb_mode_no = sisbios_mode[sisfb_mode_idx].mode_no;
+		ivideo->mode_no = sisbios_mode[ivideo->sisfb_mode_idx].mode_no[ivideo->mni];
 
-		if (ivideo.refresh_rate != 0)
-			sisfb_search_refresh_rate(ivideo.refresh_rate, sisfb_mode_idx);
+		if(ivideo->refresh_rate != 0) {
+			sisfb_search_refresh_rate(ivideo, ivideo->refresh_rate, ivideo->sisfb_mode_idx);
+		}
 
-		if (sisfb_rate_idx == 0) {
-			sisfb_rate_idx = sisbios_mode[sisfb_mode_idx].rate_idx;
-			ivideo.refresh_rate = 60;
+		if(ivideo->rate_idx == 0) {
+			ivideo->rate_idx = sisbios_mode[ivideo->sisfb_mode_idx].rate_idx;
+			ivideo->refresh_rate = 60;
 		}
 
-		if (sisfb_thismonitor.datavalid) {
-			if(!sisfb_verify_rate(&sisfb_thismonitor, sisfb_mode_idx,
-			                      sisfb_rate_idx, ivideo.refresh_rate)) {
+		if(ivideo->sisfb_thismonitor.datavalid) {
+			if(!sisfb_verify_rate(ivideo, &ivideo->sisfb_thismonitor, ivideo->sisfb_mode_idx,
+			                      ivideo->rate_idx, ivideo->refresh_rate)) {
 				printk(KERN_INFO "sisfb: WARNING: Refresh rate exceeds monitor specs!\n");
 			}
 		}
 
-		ivideo.video_bpp = sisbios_mode[sisfb_mode_idx].bpp;
-		ivideo.video_vwidth = ivideo.video_width = sisbios_mode[sisfb_mode_idx].xres;
-		ivideo.video_vheight = ivideo.video_height = sisbios_mode[sisfb_mode_idx].yres;
-		ivideo.org_x = ivideo.org_y = 0;
-		ivideo.video_linelength = ivideo.video_width * (ivideo.video_bpp >> 3);
+		ivideo->video_bpp = sisbios_mode[ivideo->sisfb_mode_idx].bpp;
+		ivideo->video_width = sisbios_mode[ivideo->sisfb_mode_idx].xres;
+		ivideo->video_height = sisbios_mode[ivideo->sisfb_mode_idx].yres;
 
-		sisfb_set_vparms();
+		sisfb_set_vparms(ivideo);
 		
 #if LINUX_VERSION_CODE < KERNEL_VERSION(2,5,0)	
 
 		/* ---------------- For 2.4: Now switch the mode ------------------ */		
 		
 		printk(KERN_INFO "sisfb: Mode is %dx%dx%d (%dHz)\n",
-	       		ivideo.video_width, ivideo.video_height, ivideo.video_bpp,
-			ivideo.refresh_rate);
+	       		ivideo->video_width, ivideo->video_height, ivideo->video_bpp,
+			ivideo->refresh_rate);
 
-		sisfb_pre_setmode();
+		sisfb_pre_setmode(ivideo);
 
-		if (SiSSetMode(&SiS_Pr, &sishw_ext, sisfb_mode_no) == 0) {
+		if(SiSSetMode(&ivideo->SiS_Pr, &ivideo->sishw_ext, ivideo->mode_no) == 0) {
 			printk(KERN_ERR "sisfb: Fatal error: Setting mode[0x%x] failed\n",
-				sisfb_mode_no);
-			vfree(sishw_ext.pSR);
-			vfree(sishw_ext.pCR);
-			release_mem_region(ivideo.video_base, ivideo.video_size);
-			release_mem_region(ivideo.mmio_base, sisfb_mmio_size);
+									ivideo->mode_no);
+			iounmap((void *)ivideo->video_vbase);
+			iounmap((void *)ivideo->mmio_vbase);
+			release_mem_region(ivideo->video_base, ivideo->video_size);
+			release_mem_region(ivideo->mmio_base, ivideo->mmio_size);
+			if(ivideo->bios_abase) vfree(ivideo->bios_abase);
+			if(ivideo->bios_vbase) iounmap(ivideo->bios_vbase);
+			pci_set_drvdata(pdev, NULL);
 			kfree(sis_fb_info);
 			return -EINVAL;
 		}
 
 		outSISIDXREG(SISSR, IND_SIS_PASSWORD, SIS_PASSWORD);
 
-		sisfb_post_setmode();
-
-		ivideo.accel = 0;
-		if(sisfb_accel) {
-		   ivideo.accel = -1;
-		   default_var.accel_flags |= FB_ACCELF_TEXT;
-		   sisfb_initaccel();
-		}
+		sisfb_post_setmode(ivideo);
 
 		/* Maximize regardless of sisfb_max at startup */
-		default_var.yres_virtual = 32767;
-		sisfb_crtc_to_var(&default_var);
+		ivideo->default_var.yres_virtual = 32767;
+
+		/* Force reset of x virtual in crtc_to_var */
+		ivideo->default_var.xres_virtual = 0;
+
+		sisfb_crtc_to_var(ivideo, &ivideo->default_var);
+
+		sisfb_calc_pitch(ivideo, &ivideo->default_var);
+		sisfb_set_pitch(ivideo);
+
+		ivideo->accel = 0;
+		if(ivideo->sisfb_accel) {
+		   ivideo->accel = -1;
+		   ivideo->default_var.accel_flags |= FB_ACCELF_TEXT;
+		}
+		sisfb_initaccel(ivideo);
 		
-		sis_fb_info->node = -1;
+		sis_fb_info->node  = -1;
 		sis_fb_info->flags = FBINFO_FLAG_DEFAULT;
-		sis_fb_info->blank = &sisfb_blank;
 		sis_fb_info->fbops = &sisfb_ops;
+		sis_fb_info->disp  = &ivideo->sis_disp;
+		sis_fb_info->blank = &sisfb_blank;
 		sis_fb_info->switch_con = &sisfb_switch;
-		sis_fb_info->updatevar = &sisfb_update_var;
-		sis_fb_info->changevar = NULL;
-		sis_fb_info->disp = &sis_disp;
+		sis_fb_info->updatevar  = &sisfb_update_var;
+		sis_fb_info->changevar  = NULL;
 		strcpy(sis_fb_info->fontname, sisfb_fontname);
 
-		sisfb_set_disp(-1, &default_var, sis_fb_info);
+		sisfb_set_disp(-1, &ivideo->default_var, sis_fb_info);
 
-#else		/* --------- For 2.5: Setup a somewhat sane default var ------------ */
+#else		/* --------- For 2.6: Setup a somewhat sane default var ------------ */
 
 		printk(KERN_INFO "sisfb: Default mode is %dx%dx%d (%dHz)\n",
-	       		ivideo.video_width, ivideo.video_height, ivideo.video_bpp,
-			ivideo.refresh_rate);
+	       		ivideo->video_width, ivideo->video_height, ivideo->video_bpp,
+			ivideo->refresh_rate);
 
-		default_var.xres = default_var.xres_virtual = ivideo.video_width;
-		default_var.yres = default_var.yres_virtual = ivideo.video_height;
-		default_var.bits_per_pixel = ivideo.video_bpp;
+		ivideo->default_var.xres = ivideo->default_var.xres_virtual = ivideo->video_width;
+		ivideo->default_var.yres = ivideo->default_var.yres_virtual = ivideo->video_height;
+		ivideo->default_var.bits_per_pixel = ivideo->video_bpp;
 
-		sisfb_bpp_to_var(&default_var);
+		sisfb_bpp_to_var(ivideo, &ivideo->default_var);
 		
-		default_var.pixclock = (u32) (1000000000 /
-				sisfb_mode_rate_to_dclock(&SiS_Pr, &sishw_ext,
-						sisfb_mode_no, sisfb_rate_idx));
+		ivideo->default_var.pixclock = (u32) (1000000000 /
+				sisfb_mode_rate_to_dclock(&ivideo->SiS_Pr, &ivideo->sishw_ext,
+						ivideo->mode_no, ivideo->rate_idx));
 						
-		if(sisfb_mode_rate_to_ddata(&SiS_Pr, &sishw_ext,
-			 sisfb_mode_no, sisfb_rate_idx,
-			 &default_var.left_margin, &default_var.right_margin, 
-			 &default_var.upper_margin, &default_var.lower_margin,
-			 &default_var.hsync_len, &default_var.vsync_len,
-			 &default_var.sync, &default_var.vmode)) {
-		   if((default_var.vmode & FB_VMODE_MASK) == FB_VMODE_DOUBLE) {
-		      default_var.pixclock <<= 1;
+		if(sisfb_mode_rate_to_ddata(&ivideo->SiS_Pr, &ivideo->sishw_ext,
+			 	ivideo->mode_no, ivideo->rate_idx, &ivideo->default_var)) {
+		   if((ivideo->default_var.vmode & FB_VMODE_MASK) == FB_VMODE_DOUBLE) {
+		      ivideo->default_var.pixclock <<= 1;
 	   	   }
 	        }
 
-		ivideo.accel = 0;
-		if(sisfb_accel) {
-		   ivideo.accel = -1;
-		   default_var.accel_flags |= FB_ACCELF_TEXT;
-		   sisfb_initaccel();
-		}
-
-		if(sisfb_ypan) {
+		if(ivideo->sisfb_ypan) {
 		   /* Maximize regardless of sisfb_max at startup */
-	    	   default_var.yres_virtual =
-				ivideo.heapstart / (default_var.xres * (default_var.bits_per_pixel >> 3));
-		   if(default_var.yres_virtual > 32767) default_var.yres_virtual = 32767;
-	    	   if(default_var.yres_virtual <= default_var.yres) {
-	              default_var.yres_virtual = default_var.yres;
+	    	   ivideo->default_var.yres_virtual = sisfb_calc_maxyres(ivideo, &ivideo->default_var);
+	    	   if(ivideo->default_var.yres_virtual < ivideo->default_var.yres) {
+	              ivideo->default_var.yres_virtual = ivideo->default_var.yres;
 	    	   }
 		}
 
+		sisfb_calc_pitch(ivideo, &ivideo->default_var);
+
+		ivideo->accel = 0;
+		if(ivideo->sisfb_accel) {
+		   ivideo->accel = -1;
+#ifdef STUPID_ACCELF_TEXT_SHIT
+		   ivideo->default_var.accel_flags |= FB_ACCELF_TEXT;
+#endif
+		}
+		sisfb_initaccel(ivideo);
+
+#if defined(FBINFO_HWACCEL_DISABLED) && defined(FBINFO_HWACCEL_XPAN)
+		sis_fb_info->flags = FBINFO_DEFAULT 		|
+				     FBINFO_HWACCEL_YPAN 	|
+				     FBINFO_HWACCEL_XPAN 	|
+				     FBINFO_HWACCEL_COPYAREA 	|
+				     FBINFO_HWACCEL_FILLRECT 	|
+				     ((ivideo->accel) ? 0 : FBINFO_HWACCEL_DISABLED);
+#else
 		sis_fb_info->flags = FBINFO_FLAG_DEFAULT;
-		sis_fb_info->var = default_var;
-		sis_fb_info->fix = sisfb_fix;
-		sis_fb_info->par = &ivideo;
-		sis_fb_info->screen_base = ivideo.video_vbase;
-		sis_fb_info->fbops = &sisfb_ops;
-#ifdef NEWFBDEV
-		sis_fb_info->class_dev.dev = &pdev->dev;
 #endif
+		sis_fb_info->var = ivideo->default_var;
+		sis_fb_info->fix = ivideo->sisfb_fix;
+		sis_fb_info->screen_base = (char *)ivideo->video_vbase;
+		sis_fb_info->fbops = &sisfb_ops;
+
 		sisfb_get_fix(&sis_fb_info->fix, -1, sis_fb_info);
-		sis_fb_info->pseudo_palette = pseudo_palette;
+		sis_fb_info->pseudo_palette = ivideo->pseudo_palette;
 		
 		fb_alloc_cmap(&sis_fb_info->cmap, 256 , 0);
-#endif
+#endif		/* 2.6 */
 
-		printk(KERN_INFO "sisfb: Initial vbflags 0x%lx\n", ivideo.vbflags);
+		printk(KERN_DEBUG "sisfb: Initial vbflags 0x%lx\n", (unsigned long)ivideo->vbflags);
 
 #ifdef CONFIG_MTRR
-		ivideo.mtrr = mtrr_add((unsigned int) ivideo.video_base,
-				(unsigned int) ivideo.video_size,
-				MTRR_TYPE_WRCOMB, 1);
-		if(ivideo.mtrr) {
-			printk(KERN_INFO "sisfb: Added MTRRs\n");
+		ivideo->mtrr = mtrr_add(ivideo->video_base, ivideo->video_size,
+					MTRR_TYPE_WRCOMB, 1);
+		if(!ivideo->mtrr) {
+			printk(KERN_DEBUG "sisfb: Failed to add MTRRs\n");
 		}
-
 #endif
 
 #if LINUX_VERSION_CODE < KERNEL_VERSION(2,5,0)
@@ -4946,39 +5573,157 @@ int __init sisfb_init(void)
 #endif
 
 		if(register_framebuffer(sis_fb_info) < 0) {
-			vfree(sishw_ext.pSR);
-			vfree(sishw_ext.pCR);
-			release_mem_region(ivideo.video_base, ivideo.video_size);
-			release_mem_region(ivideo.mmio_base, sisfb_mmio_size);
 			printk(KERN_ERR "sisfb: Fatal error: Failed to register framebuffer\n");
+			iounmap((void *)ivideo->video_vbase);
+			iounmap((void *)ivideo->mmio_vbase);
+			release_mem_region(ivideo->video_base, ivideo->video_size);
+			release_mem_region(ivideo->mmio_base, ivideo->mmio_size);
+			if(ivideo->bios_abase) vfree(ivideo->bios_abase);
+			if(ivideo->bios_vbase) iounmap(ivideo->bios_vbase);
+			pci_set_drvdata(pdev, NULL);
 			kfree(sis_fb_info);
 			return -EINVAL;
 		}
 
-		sisfb_registered = 1;			
+		ivideo->registered = 1;
 
-		printk(KERN_DEBUG "sisfb: Installed SISFB_GET_INFO ioctl (%x)\n", SISFB_GET_INFO);
-		printk(KERN_DEBUG "sisfb: Installed SISFB_GET_VBRSTATUS ioctl (%x)\n", SISFB_GET_VBRSTATUS);
-		
-		printk(KERN_INFO "sisfb: 2D acceleration is %s, scrolling mode %s\n",
-		     sisfb_accel ? "enabled" : "disabled",
-		     sisfb_ypan  ? (sisfb_max ? "ypan (auto-max)" : "ypan (no auto-max)") : "redraw");
+		/* Enlist us */
+		ivideo->next = card_list;
+		card_list = ivideo;
+
+#ifdef SIS_CONFIG_COMPAT
+		{
+		int ret;
+		/* Our ioctls are all "32/64bit compatible" */
+		if(register_ioctl32_conversion(FBIOGET_VBLANK, NULL)) {
+		   printk(KERN_ERR "sisfb: Error registering FBIOGET_VBLANK ioctl32 translation\n");
+		} else {
+		   ivideo->ioctl32vblankregistered = 1;
+		}
+		ret =  register_ioctl32_conversion(FBIO_ALLOC,             NULL);
+		ret |= register_ioctl32_conversion(FBIO_FREE,              NULL);
+		ret |= register_ioctl32_conversion(SISFB_GET_INFO_SIZE,    NULL);
+		ret |= register_ioctl32_conversion(SISFB_GET_INFO,         NULL);
+		ret |= register_ioctl32_conversion(SISFB_GET_TVPOSOFFSET,  NULL);
+		ret |= register_ioctl32_conversion(SISFB_SET_TVPOSOFFSET,  NULL);
+		ret |= register_ioctl32_conversion(SISFB_SET_LOCK,         NULL);
+		ret |= register_ioctl32_conversion(SISFB_GET_VBRSTATUS,    NULL);
+		ret |= register_ioctl32_conversion(SISFB_GET_AUTOMAXIMIZE, NULL);
+		ret |= register_ioctl32_conversion(SISFB_SET_AUTOMAXIMIZE, NULL);
+		if(ret)	printk(KERN_ERR "sisfb: Error registering ioctl32 translations\n");
+		else    ivideo->ioctl32registered = 1;
+		}
+#endif
 
+		printk(KERN_INFO "sisfb: 2D acceleration is %s, y-panning %s\n",
+		     ivideo->sisfb_accel ? "enabled" : "disabled",
+		     ivideo->sisfb_ypan  ?
+		     	(ivideo->sisfb_max ? "enabled (auto-max)" : "enabled (no auto-max)") : "disabled");
+
+
+		printk(KERN_INFO "fb%d: %s frame buffer device, Version %d.%d.%d\n",
 #if LINUX_VERSION_CODE < KERNEL_VERSION(2,5,0)
-		printk(KERN_INFO "fb%d: %s frame buffer device, Version %d.%d.%02d\n",
-	       		GET_FB_IDX(sis_fb_info->node), sis_fb_info->modename, VER_MAJOR, VER_MINOR,
-	       		VER_LEVEL);		     
+	       		GET_FB_IDX(sis_fb_info->node),
 #else
-		printk(KERN_INFO "fb%d: %s frame buffer device, Version %d.%d.%02d\n",
-	       		sis_fb_info->node, myid, VER_MAJOR, VER_MINOR, VER_LEVEL);
+	       		sis_fb_info->node,
 #endif
+			ivideo->myid, VER_MAJOR, VER_MINOR, VER_LEVEL);
 
 		printk(KERN_INFO "sisfb: (C) 2001-2004 Thomas Winischhofer.\n");
 
 	}	/* if mode = "none" */
+
 	return 0;
 }
 
+/*****************************************************/
+/*                PCI DEVICE HANDLING                */
+/*****************************************************/
+
+static void __devexit sisfb_remove(struct pci_dev *pdev)
+{
+	struct sis_video_info *ivideo = pci_get_drvdata(pdev);
+	struct fb_info        *sis_fb_info = ivideo->memyselfandi;
+	int                   registered = ivideo->registered;
+
+#ifdef SIS_CONFIG_COMPAT
+	if(ivideo->ioctl32vblankregistered) {
+		if(unregister_ioctl32_conversion(FBIOGET_VBLANK)) {
+			printk(KERN_ERR "sisfb: Error unregistering FBIOGET_VBLANK ioctl32 translation\n");
+		}
+	}
+	if(ivideo->ioctl32registered) {
+		int ret;
+		ret =  unregister_ioctl32_conversion(FBIO_ALLOC);
+		ret |= unregister_ioctl32_conversion(FBIO_FREE);
+		ret |= unregister_ioctl32_conversion(SISFB_GET_INFO_SIZE);
+		ret |= unregister_ioctl32_conversion(SISFB_GET_INFO);
+		ret |= unregister_ioctl32_conversion(SISFB_GET_TVPOSOFFSET);
+		ret |= unregister_ioctl32_conversion(SISFB_SET_TVPOSOFFSET);
+		ret |= unregister_ioctl32_conversion(SISFB_SET_LOCK);
+		ret |= unregister_ioctl32_conversion(SISFB_GET_VBRSTATUS);
+		ret |= unregister_ioctl32_conversion(SISFB_GET_AUTOMAXIMIZE);
+		ret |= unregister_ioctl32_conversion(SISFB_SET_AUTOMAXIMIZE);
+		if(ret)	printk(KERN_ERR "sisfb: Error unregistering ioctl32 translations\n");
+	}
+#endif
+
+	/* Unmap */
+	iounmap((void *)ivideo->video_vbase);
+	iounmap((void *)ivideo->mmio_vbase);
+	if(ivideo->bios_vbase) iounmap(ivideo->bios_vbase);
+	if(ivideo->bios_abase)    vfree(ivideo->bios_abase);
+
+	/* Release mem regions */
+	release_mem_region(ivideo->video_base, ivideo->video_size);
+	release_mem_region(ivideo->mmio_base, ivideo->mmio_size);
+
+#ifdef CONFIG_MTRR
+	/* Release MTRR region */
+	if(ivideo->mtrr) {
+		mtrr_del(ivideo->mtrr, ivideo->video_base, ivideo->video_size);
+	}
+#endif
+
+	/* Unregister the framebuffer */
+	if(ivideo->registered) {
+		unregister_framebuffer(sis_fb_info);
+#if (LINUX_VERSION_CODE >= KERNEL_VERSION(2,6,3))
+		framebuffer_release(sis_fb_info);
+#else
+		kfree(sis_fb_info);
+#endif
+	}
+
+	pci_set_drvdata(pdev, NULL);
+
+	/* TODO: Restore the initial mode
+	 * This sounds easy but is as good as impossible
+	 * on many machines with SiS chip and video bridge
+	 * since text modes are always set up differently
+	 * from machine to machine. Depends on the type
+	 * of integration between chipset and bridge.
+	 */
+	if(registered) {
+	   printk(KERN_INFO "sisfb: Restoring of text mode not supported yet\n");
+	}
+};
+
+static struct pci_driver sisfb_driver = {
+	.name		= "sisfb",
+	.id_table 	= sisfb_pci_table,
+	.probe 		= sisfb_probe,
+	.remove 	= __devexit_p(sisfb_remove)
+};
+
+int __init sisfb_init(void)
+{
+	return(pci_module_init(&sisfb_driver));
+}
+
+/*****************************************************/
+/*                      MODULE                       */
+/*****************************************************/
 
 #ifdef MODULE
 
@@ -4989,202 +5734,240 @@ static unsigned int crt1off = 1;
 static unsigned int mem = 0;
 static char         *forcecrt2type = NULL;
 static int          forcecrt1 = -1;
-static char         *queuemode = NULL;
-static int          pdc = 0;
+static int          pdc = -1;
+static int          pdc1 = -1;
 static int          noaccel = -1;
 static int          noypan  = -1;
 static int	    nomax = -1;
 #if LINUX_VERSION_CODE < KERNEL_VERSION(2,5,0)
 static int          inverse = 0;
 #endif
-static int          userom = 1;
+static int          userom = -1;
 static int          useoem = -1;
 static char         *tvstandard = NULL;
 static int	    nocrt2rate = 0;
 static int          scalelcd = -1;
 static char	    *specialtiming = NULL;
 static int	    lvdshl = -1;
+static int	    tvxposoffset = 0, tvyposoffset = 0;
+static int	    filter = -1;
+#if !defined(__i386__) && !defined(__x86_64__)
+static int	    resetcard = 0;
+static int	    videoram = 0;
+#endif
 
-MODULE_DESCRIPTION("SiS 300/540/630/730/315/550/650/651/661/740/741/330/760 framebuffer driver");
+MODULE_DESCRIPTION("SiS 300/540/630/730/315/550/65x/661/74x/330/760 framebuffer device driver");
 MODULE_LICENSE("GPL");
-MODULE_AUTHOR("Thomas Winischhofer <thomas@winischhofer.net>; SiS; Various others");
+MODULE_AUTHOR("Thomas Winischhofer <thomas@winischhofer.net>, Others");
 
 #if LINUX_VERSION_CODE < KERNEL_VERSION(2,5,0)
+MODULE_PARM(mem, "i");
+MODULE_PARM(noaccel, "i");
+MODULE_PARM(noypan, "i");
+MODULE_PARM(nomax, "i");
+MODULE_PARM(userom, "i");
+MODULE_PARM(useoem, "i");
 MODULE_PARM(mode, "s");
-MODULE_PARM_DESC(mode,
-       "\nSelects the desired display mode in the format [X]x[Y]x[Depth], eg.\n"
-         "1024x768x16. Other formats supported include XxY-Depth and\n"
-	 "XxY-Depth@Rate. If the parameter is only one (decimal or hexadecimal)\n"
-	 "number, it will be interpreted as a VESA mode number. (default: none if\n"
-	 "sisfb is a module; this leaves the console untouched and the driver will\n"
-	 "only do the video memory management for eg. DRM/DRI; 800x600x8 if sisfb\n"
-	 "is in the kernel)");
+MODULE_PARM(vesa, "i");
+MODULE_PARM(rate, "i");
+MODULE_PARM(forcecrt1, "i");
+MODULE_PARM(forcecrt2type, "s");
+MODULE_PARM(scalelcd, "i");
+MODULE_PARM(pdc, "i");
+MODULE_PARM(pdc1, "i");
+MODULE_PARM(specialtiming, "s");
+MODULE_PARM(lvdshl, "i");
+MODULE_PARM(tvstandard, "s");
+MODULE_PARM(tvxposoffset, "i");
+MODULE_PARM(tvyposoffset, "i");
+MODULE_PARM(filter, "i");
+MODULE_PARM(nocrt2rate, "i");
+MODULE_PARM(inverse, "i");
+#if !defined(__i386__) && !defined(__x86_64__)
+MODULE_PARM(resetcard, "i");
+MODULE_PARM(videoram, "i");
 #endif
-#if LINUX_VERSION_CODE >= KERNEL_VERSION(2,5,0)	 
-MODULE_PARM(mode, "s");
-MODULE_PARM_DESC(mode,
-       "\nSelects the desired default display mode in the format XxYxDepth,\n"
-         "eg. 1024x768x16. Other formats supported include XxY-Depth and\n"
-	 "XxY-Depth@Rate. If the parameter is only one (decimal or hexadecimal)\n"
-	 "number, it will be interpreted as a VESA mode number. (default: 800x600x8)");
 #endif
 
+#if LINUX_VERSION_CODE >= KERNEL_VERSION(2,5,0)
+module_param(mem, int, 0);
+module_param(noaccel, int, 0);
+module_param(noypan, int, 0);
+module_param(nomax, int, 0);
+module_param(userom, int, 0);
+module_param(useoem, int, 0);
+module_param(mode, charp, 0);
+module_param(vesa, int, 0);
+module_param(rate, int, 0);
+module_param(forcecrt1, int, 0);
+module_param(forcecrt2type, charp, 0);
+module_param(scalelcd, int, 0);
+module_param(pdc, int, 0);
+module_param(pdc1, int, 0);
+module_param(specialtiming, charp, 0);
+module_param(lvdshl, int, 0);
+module_param(tvstandard, charp, 0);
+module_param(tvxposoffset, int, 0);
+module_param(tvyposoffset, int, 0);
+module_param(filter, int, 0);
+module_param(nocrt2rate, int, 0);
+#if !defined(__i386__) && !defined(__x86_64__)
+module_param(resetcard, int, 0);
+module_param(videoram, int, 0);
+#endif
+#endif
+
+MODULE_PARM_DESC(mem,
+	"\nDetermines the beginning of the video memory heap in KB. This heap is used\n"
+	  "for video RAM management for eg. DRM/DRI. On 300 series, the default depends\n"
+	  "on the amount of video RAM available. If 8MB of video RAM or less is available,\n"
+	  "the heap starts at 4096KB, if between 8 and 16MB are available at 8192KB,\n"
+	  "otherwise at 12288KB. On 315 and Xabre series, the heap size is 32KB by default.\n"
+	  "The value is to be specified without 'KB' and must match the MaxXFBMem setting\n"
+	  "for XFree86 4.x/X.org 6.7 and later.\n");
+
+MODULE_PARM_DESC(noaccel,
+        "\nIf set to anything other than 0, 2D acceleration will be disabled.\n"
+	  "(default: 0)\n");
+
+MODULE_PARM_DESC(noypan,
+        "\nIf set to anything other than 0, y-panning will be disabled and scrolling\n"
+ 	  "will be performed by redrawing the screen. (default: 0)\n");
+
+MODULE_PARM_DESC(nomax,
+        "\nIf y-panning is enabled, sisfb will by default use the entire available video\n"
+	  "memory for the virtual screen in order to optimize scrolling performance. If\n"
+	  "this is set to anything other than 0, sisfb will not do this and thereby \n"
+	  "enable the user to positively specify a virtual Y size of the screen using\n"
+	  "fbset. (default: 0)\n");
+
 #if LINUX_VERSION_CODE < KERNEL_VERSION(2,5,0)
-MODULE_PARM(vesa, "i");
+MODULE_PARM_DESC(mode,
+        "\nSelects the desired display mode in the format [X]x[Y]x[Depth], eg.\n"
+          "1024x768x16. Other formats supported include XxY-Depth and\n"
+ 	  "XxY-Depth@Rate. If the parameter is only one (decimal or hexadecimal)\n"
+	  "number, it will be interpreted as a VESA mode number. (default: none if\n"
+	  "sisfb is a module; this leaves the console untouched and the driver will\n"
+	  "only do the video memory management for eg. DRM/DRI; 800x600x8 if sisfb\n"
+	  "is in the kernel)\n");
 MODULE_PARM_DESC(vesa,
-       "\nSelects the desired display mode by VESA defined mode number, eg. 0x117\n"
-         "(default: 0x0000 if sisfb is a module; this leaves the console untouched\n"
-	 "and the driver will only do the video memory management for eg. DRM/DRI;\n"
-	 "0x0103 if sisfb is in the kernel)");
+        "\nSelects the desired display mode by VESA defined mode number, eg. 0x117\n"
+          "(default: 0x0000 if sisfb is a module; this leaves the console untouched\n"
+	  "and the driver will only do the video memory management for eg. DRM/DRI;\n"
+	  "0x0103 if sisfb is in the kernel)\n");
 #endif
+
 #if LINUX_VERSION_CODE >= KERNEL_VERSION(2,5,0)
-MODULE_PARM(vesa, "i");
+MODULE_PARM_DESC(mode,
+       "\nSelects the desired default display mode in the format XxYxDepth,\n"
+         "eg. 1024x768x16. Other formats supported include XxY-Depth and\n"
+	 "XxY-Depth@Rate. If the parameter is only one (decimal or hexadecimal)\n"
+	 "number, it will be interpreted as a VESA mode number. (default: 800x600x8)\n");
+
 MODULE_PARM_DESC(vesa,
        "\nSelects the desired default display mode by VESA defined mode number, eg.\n"
-         "0x117 (default: 0x0103)");
+         "0x117 (default: 0x0103)\n");
 #endif
 
-MODULE_PARM(rate, "i");
 MODULE_PARM_DESC(rate,
 	"\nSelects the desired vertical refresh rate for CRT1 (external VGA) in Hz.\n"
 	  "If the mode is specified in the format XxY-Depth@Rate, this parameter\n"
-	  "will be ignored (default: 60)");
-
-MODULE_PARM(crt1off,   "i");
-MODULE_PARM_DESC(crt1off,
-	"(Deprecated, please use forcecrt1)");
+	  "will be ignored (default: 60)\n");
 
-MODULE_PARM(filter, "i");
-MODULE_PARM_DESC(filter,
-	"\nSelects TV flicker filter type (only for systems with a SiS301 video bridge).\n"
-	  "(Possible values 0-7, default: [no filter])");
-
-MODULE_PARM(queuemode,   "s");
-MODULE_PARM_DESC(queuemode,
-	"\nSelects the queue mode on 315/550/65x/74x/330/760. Possible choices are AGP, VRAM,\n"
-  	  "MMIO. AGP is only available if the kernel has AGP support. The queue mode is\n"
-	  "important to programs using the 2D/3D accelerator of the SiS chip. The modes\n"
-	  "require a totally different way of programming the engines. If any mode than\n"
-	  "MMIO is selected, sisfb will disable its own 2D acceleration. On\n"
-	  "300/540/630/730, this option is ignored. (default: MMIO)");
-
-/* TW: "Import" the options from the X driver */
-MODULE_PARM(mem,    "i");
-MODULE_PARM_DESC(mem,
-	"\nDetermines the beginning of the video memory heap in KB. This heap is used\n"
-	  "for video RAM management for eg. DRM/DRI. On 300 series, the default depends\n"
-	  "on the amount of video RAM available. If 8MB of video RAM or less is available,\n"
-	  "the heap starts at 4096KB, if between 8 and 16MB are available at 8192KB,\n"
-	  "otherwise at 12288KB. On 315 and Xabre series, the heap is 1MB by default. The\n"
-	  "value is to be specified without 'KB' and should match the MaxXFBMem setting for\n"
-	  "XFree 4.x (x>=2).");
+MODULE_PARM_DESC(forcecrt1,
+	"\nNormally, the driver autodetects whether or not CRT1 (external VGA) is \n"
+	  "connected. With this option, the detection can be overridden (1=CRT1 ON,\n"
+	  "0=CRT1 OFF) (default: [autodetected])\n");
 
-MODULE_PARM(forcecrt2type, "s");
 MODULE_PARM_DESC(forcecrt2type,
 	"\nIf this option is omitted, the driver autodetects CRT2 output devices, such as\n"
 	  "LCD, TV or secondary VGA. With this option, this autodetection can be\n"
 	  "overridden. Possible parameters are LCD, TV, VGA or NONE. NONE disables CRT2.\n"
-	  "On systems with a 301(B/LV) bridge, parameters SVIDEO, COMPOSITE or SCART can be\n"
-	  "used instead of TV to override the TV detection. (default: [autodetected])");
+	  "On systems with a SiS video bridge, parameters SVIDEO, COMPOSITE or SCART can\n"
+	  "be used instead of TV to override the TV detection. Furthermore, on systems\n"
+	  "with a SiS video bridge, SVIDEO+COMPOSITE, HIVISION, YPBPR480I, YPBPR480P,\n"
+	  "YPBPR720P and YPBPR1080I are understood. However, whether or not these work\n"
+	  "depends on the very hardware in use. (default: [autodetected])\n");
 
-MODULE_PARM(forcecrt1, "i");
-MODULE_PARM_DESC(forcecrt1,
-	"\nNormally, the driver autodetects whether or not CRT1 (external VGA) is \n"
-	  "connected. With this option, the detection can be overridden (1=CRT1 ON,\n"
-	  " 0=CRT1 off) (default: [autodetected])");
+MODULE_PARM_DESC(scalelcd,
+	"\nSetting this to 1 will force the driver to scale the LCD image to the panel's\n"
+	  "native resolution. Setting it to 0 will disable scaling; LVDS panels will\n"
+	  "show black bars around the image, TMDS panels will probably do the scaling\n"
+	  "themselves. Default: 1 on LVDS panels, 0 on TMDS panels\n");
 
-MODULE_PARM(pdc, "i");
 MODULE_PARM_DESC(pdc,
         "\nThis is for manually selecting the LCD panel delay compensation. The driver\n"
 	  "should detect this correctly in most cases; however, sometimes this is not\n"
 	  "possible. If you see 'small waves' on the LCD, try setting this to 4, 32 or 24\n"
-	  "on a 300 series chipset; 3 or 51 on a 315 series chipset. If the problem persists,\n"
+	  "on a 300 series chipset; 6 on a 315 series chipset. If the problem persists,\n"
 	  "try other values (on 300 series: between 4 and 60 in steps of 4; on 315 series:\n"
-	  "and value from 0 to 255). (default: [autodetected])");
+	  "any value from 0 to 31). (default: autodetected, if LCD is active during start)\n");
 
-MODULE_PARM(noaccel, "i");
-MODULE_PARM_DESC(noaccel,
-        "\nIf set to anything other than 0, 2D acceleration will be disabled.\n"
-	  "(default: 0)");
+#ifdef CONFIG_FB_SIS_315
+MODULE_PARM_DESC(pdc1,
+        "\nThis is same as pdc, but for LCD-via CRT1. Hence, this is for the 315/330\n"
+	  "series only. (default: autodetected if LCD is in LCD-via-CRT1 mode during\n"
+	  "startup) - Note: currently, this has no effect because LCD-via-CRT1 is not\n"
+	  "implemented yet.\n");
+#endif
 
-MODULE_PARM(noypan, "i");
-MODULE_PARM_DESC(noypan,
-        "\nIf set to anything other than 0, y-panning will be disabled and scrolling\n"
- 	  "will be performed by redrawing the screen. (default: 0)");
+MODULE_PARM_DESC(specialtiming,
+	"\nPlease refer to documentation for more information on this option.\n");
 
-MODULE_PARM(nomax, "i");
-MODULE_PARM_DESC(nomax,
-        "\nIf y-panning is enabled, sisfb will by default use the entire available video\n"
-	  "memory for the virtual screen in order to optimize scrolling performance. If this\n"
-	  "is set to anything other than 0, sisfb will not do this and thereby enable the user\n"
-	  "to positively specify a virtual Y size of the screen using fbset. (default: 0)\n");
+MODULE_PARM_DESC(lvdshl,
+	"\nPlease refer to documentation for more information on this option.\n");
 
-#if LINUX_VERSION_CODE < KERNEL_VERSION(2,5,0)	
-MODULE_PARM(inverse, "i");
-MODULE_PARM_DESC(inverse,
-        "\nSetting this to anything but 0 should invert the display colors, but this\n"
-	  "does not seem to work. (default: 0)");
-#endif	
+MODULE_PARM_DESC(tvstandard,
+	"\nThis allows overriding the BIOS default for the TV standard. Valid choices are\n"
+	  "pal, ntsc, palm and paln. (default: [auto; pal or ntsc only])\n");
 
-MODULE_PARM(userom, "i");
-MODULE_PARM_DESC(userom,
-        "\nSetting this to 0 keeps sisfb from using the video BIOS data which is needed\n"
-	  "for some LCD and TV setup. (default: 1)");
+MODULE_PARM_DESC(tvxposoffset,
+	"\nRelocate TV output horizontally. Possible parameters: -32 through 32.\n"
+	  "Default: 0\n");
 
-MODULE_PARM(useoem, "i");
-MODULE_PARM_DESC(useoem,
-        "\nSetting this to 0 keeps sisfb from using its internel OEM data for some LCD\n"
-	  "panels and TV connector types. (default: [auto])");
+MODULE_PARM_DESC(tvyposoffset,
+	"\nRelocate TV output vertically. Possible parameters: -32 through 32.\n"
+	  "Default: 0\n");
 
-MODULE_PARM(tvstandard, "s");
-MODULE_PARM_DESC(tvstandard,
-	"\nThis allows overriding the BIOS default for the TV standard. Valid choices are\n"
-	  "pal and ntsc. (default: [auto])");
+MODULE_PARM_DESC(filter,
+	"\nSelects TV flicker filter type (only for systems with a SiS301 video bridge).\n"
+	  "(Possible values 0-7, default: [no filter])\n");
 
-MODULE_PARM(nocrt2rate, "i");
 MODULE_PARM_DESC(nocrt2rate,
 	"\nSetting this to 1 will force the driver to use the default refresh rate for\n"
-	  "CRT2 if CRT2 type is VGA. (default: 0, use same rate as CRT1)");
-
-MODULE_PARM(scalelcd, "i");
-MODULE_PARM_DESC(scalelcd,
-	"\nSetting this to 1 will force the driver to scale the LCD image to the panel's\n"
-	  "native resolution. Setting it to 0 will disable scaling; if the panel can scale\n"
-	  "by itself, it will probably do this, otherwise you will see a black bar around\n"
-	  "the screen image. Default: [autodetect if panel can scale]");
-
-MODULE_PARM(specialtiming, "s");
+	  "CRT2 if CRT2 type is VGA. (default: 0, use same rate as CRT1)\n");
 
-MODULE_PARM(lvdshl, "i");
+#if LINUX_VERSION_CODE < KERNEL_VERSION(2,5,0)
+MODULE_PARM_DESC(inverse,
+        "\nSetting this to anything but 0 should invert the display colors, but this\n"
+	  "does not seem to work. (default: 0)\n");
+#endif
 
+#if !defined(__i386__) && !defined(__x86_64__)
+#ifdef CONFIG_FB_SIS_300
+MODULE_PARM_DESC(resetcard,
+	"\nSet this to 1 in order to reset (POST) the card on non-x86 machines where\n"
+	  "the BIOS did not POST the card (only supported for SiS 300/305 currently).\n"
+	  "Default: 0\n");
+
+MODULE_PARM_DESC(videoram,
+	"\nSet this to the amount of video RAM (in kilobyte) the card has. Required on\n"
+	  "some non-x86 architectures where the memory auto detection fails. Only\n"
+	  "relevant if resetcard is set, too. Default: [auto-detect]\n");
+#endif
+#endif
 
-int init_module(void)
+int __init sisfb_init_module(void)
 {
-	int err;
+	sisfb_setdefaultparms();
 
-	SiS_Pr.UsePanelScaler = -1;
-	SiS_Pr.SiS_CustomT = CUT_NONE;
-	SiS_Pr.LVDSHL = -1;
-
-	ivideo.refresh_rate = sisfb_parm_rate = rate;
+	if(rate) sisfb_parm_rate = rate;
 
 	if((scalelcd == 0) || (scalelcd == 1)) {
-	   SiS_Pr.UsePanelScaler = scalelcd ^ 1;
+	   sisfb_scalelcd = scalelcd ^ 1;
 	}
 
-	if(mode)
-		sisfb_search_mode(mode, FALSE);
-	else if(vesa != -1)
-		sisfb_search_vesamode(vesa, FALSE);
-	else
-#if LINUX_VERSION_CODE < KERNEL_VERSION(2,5,0)
-		/* For 2.4, set mode=none if no mode is given  */
-		sisfb_mode_idx = MODE_INDEX_NONE;
-#endif
-#if LINUX_VERSION_CODE >= KERNEL_VERSION(2,5,0)
-		/* For 2.5, we don't need this "mode=none" stuff anymore */
-		sisfb_mode_idx = DEFAULT_MODE;
-#endif
+	/* Need to check crt2 type first for fstn/dstn */
 
 	if(forcecrt2type)
 		sisfb_search_crt2type(forcecrt2type);
@@ -5192,16 +5975,16 @@ int init_module(void)
 	if(tvstandard)
 		sisfb_search_tvstd(tvstandard);
 
-	if(crt1off == 0)
-		sisfb_crt1off = 1;
-	else
-		sisfb_crt1off = 0;
+	if(mode)
+		sisfb_search_mode(mode, FALSE);
+	else if(vesa != -1)
+		sisfb_search_vesamode(vesa, FALSE);
+
+	sisfb_crt1off = (crt1off == 0) ? 1 : 0;
 
 	sisfb_forcecrt1 = forcecrt1;
-	if(forcecrt1 == 1)
-		sisfb_crt1off = 0;
-	else if(forcecrt1 == 0)
-		sisfb_crt1off = 1;
+	if(forcecrt1 == 1)      sisfb_crt1off = 0;
+	else if(forcecrt1 == 0) sisfb_crt1off = 1;
 
 	if(noaccel == 1)      sisfb_accel = 0;
 	else if(noaccel == 0) sisfb_accel = 1;
@@ -5214,84 +5997,48 @@ int init_module(void)
 	
 #if LINUX_VERSION_CODE < KERNEL_VERSION(2,5,0)
 	if(inverse)           sisfb_inverse = 1;
-	sisfb_fontname[0] = '\0';
 #endif
 
-	if(mem)		      sisfb_mem = mem;
+	if(mem)		      sisfb_parm_mem = mem;
 
-	sisfb_userom = userom;
+	if(userom != -1)      sisfb_userom = userom;
+	if(useoem != -1)      sisfb_useoem = useoem;
 
-	sisfb_useoem = useoem;
-
-	if (queuemode)        sisfb_search_queuemode(queuemode);
-	
-	/* If other queuemode than MMIO, disable 2D accel and ypan */
-	if((sisfb_queuemode != -1) && (sisfb_queuemode != MMIO_CMD)) {
-	        sisfb_accel = 0;
-	}
-
-        if(pdc) sisfb_pdc = pdc & 0x3c;
+        if(pdc != -1)  sisfb_pdc  = (pdc  & 0x7f);
+	if(pdc1 != -1) sisfb_pdca = (pdc1 & 0x1f);
 
 	sisfb_nocrt2rate = nocrt2rate;
 
 	if(specialtiming)
 		sisfb_search_specialtiming(specialtiming);
 
-	if((lvdshl >= 0) && (lvdshl <= 3)) SiS_Pr.LVDSHL = lvdshl;
-
-	if((err = sisfb_init()) < 0) return err;
+	if((lvdshl >= 0) && (lvdshl <= 3))  sisfb_lvdshl = lvdshl;
 
-	return 0;
-}
+	if(filter != -1) sisfb_filter = filter;
 
-void cleanup_module(void)
-{
-	/* Unmap */
-	iounmap(ivideo.video_vbase);
-	iounmap(ivideo.mmio_vbase);
+	sisfb_tvxposoffset = tvxposoffset;
+	sisfb_tvyposoffset = tvyposoffset;
 
-	/* Release mem regions */
-	release_mem_region(ivideo.video_base, ivideo.video_size);
-	release_mem_region(ivideo.mmio_base, sisfb_mmio_size);
-
-#ifdef CONFIG_MTRR
-	/* Release MTRR region */
-	if(ivideo.mtrr) {
-		mtrr_del(ivideo.mtrr,
-		      (unsigned int)ivideo.video_base,
-	              (unsigned int)ivideo.video_size);
-	}
+#if !defined(__i386__) && !defined(__x86_64__)
+ 	sisfb_resetcard = (resetcard) ? 1 : 0;
+	if(videoram)    sisfb_videoram = videoram;
 #endif
 
-	/* Unregister the framebuffer */
-	if(sisfb_registered) {
-		unregister_framebuffer(sis_fb_info);
-#if (LINUX_VERSION_CODE >= KERNEL_VERSION(2,6,0)) && (defined(NEWFBDEV))
-		framebuffer_release(sis_fb_info);
-#else
-		kfree(sis_fb_info);
-#endif
-	}
+        return(sisfb_init());
+}
 
-	if(sishw_ext.pSR) vfree(sishw_ext.pSR);
-	if(sishw_ext.pCR) vfree(sishw_ext.pCR);
-	
-	/* TODO: Restore the initial mode
-	 * This sounds easy but is as good as impossible
-	 * on many machines with SiS chip and video bridge
-	 * since text modes are always set up differently
-	 * from machine to machine. Depends on the type
-	 * of integration between chipset and bridge.
-	 */
-	
-	printk(KERN_INFO "sisfb: Module unloaded\n");
+static void __exit sisfb_remove_module(void)
+{
+	pci_unregister_driver(&sisfb_driver);
+	printk(KERN_DEBUG "sisfb: Module unloaded\n");
 }
 
-#endif
+module_init(sisfb_init_module);
+module_exit(sisfb_remove_module);
+
+#endif 	   /*  /MODULE  */
 
 EXPORT_SYMBOL(sis_malloc);
 EXPORT_SYMBOL(sis_free);
-EXPORT_SYMBOL(sis_dispinfo);
 
-EXPORT_SYMBOL(ivideo);
-                                                                                           
+
diff --git a/drivers/video/sis/sis_main.h b/drivers/video/sis/sis_main.h
index 0402ae7b2..3f9298d52 100644
--- a/drivers/video/sis/sis_main.h
+++ b/drivers/video/sis/sis_main.h
@@ -1,6 +1,7 @@
 /*
- * SiS 300/630/730/540/315/550/650/651/M650/661FX/M661FX/740/741/330/760
- * frame buffer driver for Linux kernels 2.4.x and 2.5.x
+ * SiS 300/305/540/630(S)/730(S)
+ * SiS 315(H/PRO)/55x/(M)65x/(M)661(F/M)X/740/741(GX)/330/(M)760
+ * frame buffer driver for Linux kernels >=2.4.14 and >=2.6.3
  *
  * Copyright (C) 2001-2004 Thomas Winischhofer, Vienna, Austria.
  *
@@ -22,304 +23,15 @@
 #ifndef _SISFB_MAIN
 #define _SISFB_MAIN
 
-#include "vstruct.h"
-
-/* ------------------- Constant Definitions ------------------------- */
-
-#define AGPOFF     /* default is turn off AGP */
-
-#define SISFAIL(x) do { printk(x "\n"); return -EINVAL; } while(0)
-
-#define VER_MAJOR                 1
-#define VER_MINOR                 6
-#define VER_LEVEL                 25
+#include <linux/spinlock.h>
 
+#include "vstruct.h"
 #include "sis.h"
 
-/* To be included in pci_ids.h */
-#ifndef PCI_DEVICE_ID_SI_650_VGA
-#define PCI_DEVICE_ID_SI_650_VGA  0x6325
-#endif
-#ifndef PCI_DEVICE_ID_SI_650
-#define PCI_DEVICE_ID_SI_650      0x0650
-#endif
-#ifndef PCI_DEVICE_ID_SI_740
-#define PCI_DEVICE_ID_SI_740      0x0740
-#endif
-#ifndef PCI_DEVICE_ID_SI_330
-#define PCI_DEVICE_ID_SI_330      0x0330
-#endif
-#ifndef PCI_DEVICE_ID_SI_660_VGA
-#define PCI_DEVICE_ID_SI_660_VGA  0x6330
-#endif
-#ifndef PCI_DEVICE_ID_SI_660
-#define PCI_DEVICE_ID_SI_660      0x0661
-#endif
-#ifndef PCI_DEVICE_ID_SI_741
-#define PCI_DEVICE_ID_SI_741      0x0741
-#endif
-#ifndef PCI_DEVICE_ID_SI_660
-#define PCI_DEVICE_ID_SI_660      0x0660
-#endif
-#ifndef PCI_DEVICE_ID_SI_760
-#define PCI_DEVICE_ID_SI_760      0x0760
-#endif
-
-/* To be included in fb.h */
-#ifndef FB_ACCEL_SIS_GLAMOUR_2
-#define FB_ACCEL_SIS_GLAMOUR_2  40	/* SiS 315, 65x, 740, 661, 741  */
-#endif
-#ifndef FB_ACCEL_SIS_XABRE
-#define FB_ACCEL_SIS_XABRE      41	/* SiS 330 ("Xabre"), 760 	*/
-#endif
-
-#define MAX_ROM_SCAN              0x10000
-
-#define HW_CURSOR_CAP             0x80
-#define TURBO_QUEUE_CAP           0x40
-#define AGP_CMD_QUEUE_CAP         0x20
-#define VM_CMD_QUEUE_CAP          0x10
-#define MMIO_CMD_QUEUE_CAP        0x08
-
-/* For 300 series */
-#ifdef CONFIG_FB_SIS_300
-#define TURBO_QUEUE_AREA_SIZE     0x80000 /* 512K */
-#endif
-
-/* For 315/Xabre series */
-#ifdef CONFIG_FB_SIS_315
-#define COMMAND_QUEUE_AREA_SIZE   0x80000 /* 512K */
-#define COMMAND_QUEUE_THRESHOLD   0x1F
-#endif
-
-#define HW_CURSOR_AREA_SIZE_315   0x4000  /* 16K */
-#define HW_CURSOR_AREA_SIZE_300   0x1000  /* 4K */
-
-#define OH_ALLOC_SIZE             4000
-#define SENTINEL                  0x7fffffff
-
-#define SEQ_ADR                   0x14
-#define SEQ_DATA                  0x15
-#define DAC_ADR                   0x18
-#define DAC_DATA                  0x19
-#define CRTC_ADR                  0x24
-#define CRTC_DATA                 0x25
-#define DAC2_ADR                  (0x16-0x30)
-#define DAC2_DATA                 (0x17-0x30)
-#define VB_PART1_ADR              (0x04-0x30)
-#define VB_PART1_DATA             (0x05-0x30)
-#define VB_PART2_ADR              (0x10-0x30)
-#define VB_PART2_DATA             (0x11-0x30)
-#define VB_PART3_ADR              (0x12-0x30)
-#define VB_PART3_DATA             (0x13-0x30)
-#define VB_PART4_ADR              (0x14-0x30)
-#define VB_PART4_DATA             (0x15-0x30)
-
-#define SISSR			  SiS_Pr.SiS_P3c4
-#define SISCR                     SiS_Pr.SiS_P3d4
-#define SISDACA                   SiS_Pr.SiS_P3c8
-#define SISDACD                   SiS_Pr.SiS_P3c9
-#define SISPART1                  SiS_Pr.SiS_Part1Port
-#define SISPART2                  SiS_Pr.SiS_Part2Port
-#define SISPART3                  SiS_Pr.SiS_Part3Port
-#define SISPART4                  SiS_Pr.SiS_Part4Port
-#define SISPART5                  SiS_Pr.SiS_Part5Port
-#define SISDAC2A                  SISPART5
-#define SISDAC2D                  (SISPART5 + 1)
-#define SISMISCR                  (SiS_Pr.RelIO + 0x1c)
-#define SISMISCW                  SiS_Pr.SiS_P3c2
-#define SISINPSTAT		  (SiS_Pr.RelIO + 0x2a)
-#define SISPEL			  SiS_Pr.SiS_P3c6
-
-#define IND_SIS_PASSWORD          0x05  /* SRs */
-#define IND_SIS_COLOR_MODE        0x06
-#define IND_SIS_RAMDAC_CONTROL    0x07
-#define IND_SIS_DRAM_SIZE         0x14
-#define IND_SIS_SCRATCH_REG_16    0x16
-#define IND_SIS_SCRATCH_REG_17    0x17
-#define IND_SIS_SCRATCH_REG_1A    0x1A
-#define IND_SIS_MODULE_ENABLE     0x1E
-#define IND_SIS_PCI_ADDRESS_SET   0x20
-#define IND_SIS_TURBOQUEUE_ADR    0x26
-#define IND_SIS_TURBOQUEUE_SET    0x27
-#define IND_SIS_POWER_ON_TRAP     0x38
-#define IND_SIS_POWER_ON_TRAP2    0x39
-#define IND_SIS_CMDQUEUE_SET      0x26
-#define IND_SIS_CMDQUEUE_THRESHOLD  0x27
-
-#define IND_SIS_SCRATCH_REG_CR30  0x30  /* CRs */
-#define IND_SIS_SCRATCH_REG_CR31  0x31
-#define IND_SIS_SCRATCH_REG_CR32  0x32
-#define IND_SIS_SCRATCH_REG_CR33  0x33
-#define IND_SIS_LCD_PANEL         0x36
-#define IND_SIS_SCRATCH_REG_CR37  0x37
-#define IND_SIS_AGP_IO_PAD        0x48
-
-#define IND_BRI_DRAM_STATUS       0x63 /* PCI config memory size offset */
-
-#define MMIO_QUEUE_PHYBASE        0x85C0
-#define MMIO_QUEUE_WRITEPORT      0x85C4
-#define MMIO_QUEUE_READPORT       0x85C8
-
-#define IND_SIS_CRT2_WRITE_ENABLE_300 0x24
-#define IND_SIS_CRT2_WRITE_ENABLE_315 0x2F
-
-#define SIS_PASSWORD              0x86  /* SR05 */
-#define SIS_INTERLACED_MODE       0x20  /* SR06 */
-#define SIS_8BPP_COLOR_MODE       0x0 
-#define SIS_15BPP_COLOR_MODE      0x1 
-#define SIS_16BPP_COLOR_MODE      0x2 
-#define SIS_32BPP_COLOR_MODE      0x4 
-#define SIS_DRAM_SIZE_MASK        0x3F  /* 300/630/730 SR14 */
-#define SIS_DRAM_SIZE_1MB         0x00
-#define SIS_DRAM_SIZE_2MB         0x01
-#define SIS_DRAM_SIZE_4MB         0x03
-#define SIS_DRAM_SIZE_8MB         0x07
-#define SIS_DRAM_SIZE_16MB        0x0F
-#define SIS_DRAM_SIZE_32MB        0x1F
-#define SIS_DRAM_SIZE_64MB        0x3F
-#define SIS_DATA_BUS_MASK         0xC0
-#define SIS_DATA_BUS_32           0x00
-#define SIS_DATA_BUS_64           0x01
-#define SIS_DATA_BUS_128          0x02
-
-#define SIS315_DATA_BUS_MASK      0x02
-#define SIS315_DATA_BUS_64        0x00
-#define SIS315_DATA_BUS_128       0x01
-#define SIS315_DUAL_CHANNEL_MASK  0x0C
-#define SIS315_SINGLE_CHANNEL_1_RANK  	0x0
-#define SIS315_SINGLE_CHANNEL_2_RANK  	0x1
-#define SIS315_ASYM_DDR		  	0x02
-#define SIS315_DUAL_CHANNEL_1_RANK    	0x3
-
-#define SIS_SCRATCH_REG_1A_MASK   0x10
-
-#define SIS_ENABLE_2D             0x40  /* SR1E */
-
-#define SIS_MEM_MAP_IO_ENABLE     0x01  /* SR20 */
-#define SIS_PCI_ADDR_ENABLE       0x80
-
-#define SIS_AGP_CMDQUEUE_ENABLE   0x80  /* 315/650/740 SR26 */
-#define SIS_VRAM_CMDQUEUE_ENABLE  0x40
-#define SIS_MMIO_CMD_ENABLE       0x20
-#define SIS_CMD_QUEUE_SIZE_512k   0x00
-#define SIS_CMD_QUEUE_SIZE_1M     0x04
-#define SIS_CMD_QUEUE_SIZE_2M     0x08
-#define SIS_CMD_QUEUE_SIZE_4M     0x0C
-#define SIS_CMD_QUEUE_RESET       0x01
-#define SIS_CMD_AUTO_CORR	  0x02
-
-#define SIS_SIMULTANEOUS_VIEW_ENABLE  0x01  /* CR30 */
-#define SIS_MODE_SELECT_CRT2      0x02
-#define SIS_VB_OUTPUT_COMPOSITE   0x04
-#define SIS_VB_OUTPUT_SVIDEO      0x08
-#define SIS_VB_OUTPUT_SCART       0x10
-#define SIS_VB_OUTPUT_LCD         0x20
-#define SIS_VB_OUTPUT_CRT2        0x40
-#define SIS_VB_OUTPUT_HIVISION    0x80
-
-#define SIS_VB_OUTPUT_DISABLE     0x20  /* CR31 */
-#define SIS_DRIVER_MODE           0x40
-
-#define SIS_VB_COMPOSITE          0x01  /* CR32 */
-#define SIS_VB_SVIDEO             0x02
-#define SIS_VB_SCART              0x04
-#define SIS_VB_LCD                0x08
-#define SIS_VB_CRT2               0x10
-#define SIS_CRT1                  0x20
-#define SIS_VB_HIVISION           0x40
-#define SIS_VB_DVI                0x80
-#define SIS_VB_TV                 (SIS_VB_COMPOSITE | SIS_VB_SVIDEO | \
-                                   SIS_VB_SCART | SIS_VB_HIVISION)
-
-#define SIS_EXTERNAL_CHIP_MASK    	   0x0E  /* CR37 (< SiS 660) */
-#define SIS_EXTERNAL_CHIP_SIS301           0x01  /* in CR37 << 1 ! */
-#define SIS_EXTERNAL_CHIP_LVDS             0x02  /* in CR37 << 1 ! */
-#define SIS_EXTERNAL_CHIP_TRUMPION         0x03  /* in CR37 << 1 ! */
-#define SIS_EXTERNAL_CHIP_LVDS_CHRONTEL    0x04  /* in CR37 << 1 ! */
-#define SIS_EXTERNAL_CHIP_CHRONTEL         0x05  /* in CR37 << 1 ! */
-#define SIS310_EXTERNAL_CHIP_LVDS          0x02  /* in CR37 << 1 ! */
-#define SIS310_EXTERNAL_CHIP_LVDS_CHRONTEL 0x03  /* in CR37 << 1 ! */
-
-#define SIS_AGP_2X                0x20  /* CR48 */
-
-#define BRI_DRAM_SIZE_MASK        0x70  /* PCI bridge config data */
-#define BRI_DRAM_SIZE_2MB         0x00
-#define BRI_DRAM_SIZE_4MB         0x01
-#define BRI_DRAM_SIZE_8MB         0x02
-#define BRI_DRAM_SIZE_16MB        0x03
-#define BRI_DRAM_SIZE_32MB        0x04
-#define BRI_DRAM_SIZE_64MB        0x05
-
-#define HW_DEVICE_EXTENSION	  SIS_HW_INFO
-#define PHW_DEVICE_EXTENSION      PSIS_HW_INFO
-
-#define SR_BUFFER_SIZE            5
-#define CR_BUFFER_SIZE            5
-
-/* entries for disp_state - deprecated as of 1.6.02 */
-#define DISPTYPE_CRT1       0x00000008L
-#define DISPTYPE_CRT2       0x00000004L
-#define DISPTYPE_LCD        0x00000002L
-#define DISPTYPE_TV         0x00000001L
-#define DISPTYPE_DISP1      DISPTYPE_CRT1
-#define DISPTYPE_DISP2      (DISPTYPE_CRT2 | DISPTYPE_LCD | DISPTYPE_TV)
-#define DISPMODE_SINGLE	    0x00000020L
-#define DISPMODE_MIRROR	    0x00000010L
-#define DISPMODE_DUALVIEW   0x00000040L
-
-/* Deprecated as of 1.6.02 - use vbflags instead */
-#define HASVB_NONE      	0x00
-#define HASVB_301       	0x01
-#define HASVB_LVDS      	0x02
-#define HASVB_TRUMPION  	0x04
-#define HASVB_LVDS_CHRONTEL	0x10
-#define HASVB_302       	0x20
-#define HASVB_303       	0x40
-#define HASVB_CHRONTEL  	0x80
-
-/* Useful macros */
-#define inSISREG(base)          inb(base)
-#define outSISREG(base,val)     outb(val,base)
-#define orSISREG(base,val)      do { \
-                                  unsigned char __Temp = inb(base); \
-                                  outSISREG(base, __Temp | (val)); \
-                                } while (0)
-#define andSISREG(base,val)     do { \
-                                  unsigned char __Temp = inb(base); \
-                                  outSISREG(base, __Temp & (val)); \
-                                } while (0)
-#define inSISIDXREG(base,idx,var)   do { \
-                                      outb(idx,base); var=inb((base)+1); \
-                                    } while (0)
-#define outSISIDXREG(base,idx,val)  do { \
-                                      outb(idx,base); outb((val),(base)+1); \
-                                    } while (0)
-#define orSISIDXREG(base,idx,val)   do { \
-                                      unsigned char __Temp; \
-                                      outb(idx,base);   \
-                                      __Temp = inb((base)+1)|(val); \
-                                      outSISIDXREG(base,idx,__Temp); \
-                                    } while (0)
-#define andSISIDXREG(base,idx,and)  do { \
-                                      unsigned char __Temp; \
-                                      outb(idx,base);   \
-                                      __Temp = inb((base)+1)&(and); \
-                                      outSISIDXREG(base,idx,__Temp); \
-                                    } while (0)
-#define setSISIDXREG(base,idx,and,or)   do { \
-                                          unsigned char __Temp; \
-                                          outb(idx,base);   \
-                                          __Temp = (inb((base)+1)&(and))|(or); \
-                                          outSISIDXREG(base,idx,__Temp); \
-                                        } while (0)
-
-/* ------------------- Global Variables ----------------------------- */
-
-/* Fbcon variables */
-static struct fb_info *sis_fb_info;
+#define MODE_INDEX_NONE           0  /* index for mode=none */
 
-static struct fb_var_screeninfo default_var = {
+/* Fbcon stuff */
+static struct fb_var_screeninfo my_default_var = {
 	.xres            = 0,
 	.yres            = 0,
 	.xres_virtual    = 0,
@@ -346,125 +58,110 @@ static struct fb_var_screeninfo default_var = {
 	.vsync_len       = 0,
 	.sync            = 0,
 	.vmode           = FB_VMODE_NONINTERLACED,
-#if LINUX_VERSION_CODE < KERNEL_VERSION(2,5,0)
-	.reserved        = {0, 0, 0, 0, 0, 0}
-#endif
 };
 
+/* Boot-time parameters */
+static int sisfb_off = 0;
+static int sisfb_parm_mem = 0;
+static int sisfb_accel = -1;
+static int sisfb_ypan = -1;
+static int sisfb_max = -1;
+static int sisfb_userom = 1;
+static int sisfb_useoem = -1;
+#ifdef MODULE
 #if LINUX_VERSION_CODE >= KERNEL_VERSION(2,5,0)
-static struct fb_fix_screeninfo sisfb_fix = {
-	.id		= "SiS",
-	.type		= FB_TYPE_PACKED_PIXELS,
-	.xpanstep	= 0,
-	.ypanstep	= 1,
-};
-static char myid[40];
-static u32 pseudo_palette[17];
-#endif
-
-#if LINUX_VERSION_CODE < KERNEL_VERSION(2,5,0)
-static struct display sis_disp;
-
-static struct display_switch sisfb_sw;	
-
-static struct {
-	u16 blue, green, red, pad;
-} sis_palette[256];
-
-static union {
-#ifdef FBCON_HAS_CFB16
-	u16 cfb16[16];
-#endif
-#ifdef FBCON_HAS_CFB32
-	u32 cfb32[16];
+static int sisfb_mode_idx = -1;
+#else
+static int sisfb_mode_idx = MODE_INDEX_NONE;  /* Don't use a mode by default if we are a module */
 #endif
-} sis_fbcon_cmap;
-
-static int sisfb_inverse = 0;
-static int currcon = 0;
+#else
+static int sisfb_mode_idx = -1;               /* Use a default mode if we are inside the kernel */
 #endif
-
-/* global flags */
-static int sisfb_off = 0;
+static int sisfb_parm_rate = -1;
 static int sisfb_crt1off = 0;
 static int sisfb_forcecrt1 = -1;
-static int sisvga_enabled = 0;
-static int sisfb_userom = 1;
-static int sisfb_useoem = -1;
-static int sisfb_parm_rate = -1;
-static int sisfb_registered = 0;
-static int sisfb_mem = 0;
-static int sisfb_pdc = 0;
-static int sisfb_ypan = -1;
-static int sisfb_max = -1;
-static int sisfb_nocrt2rate = 0;
+static int sisfb_crt2type  = -1;	/* CRT2 type (for overriding autodetection) */
+static int sisfb_crt2flags = 0;
+static int sisfb_pdc = 0xff;
+static int sisfb_pdca = 0xff;
+static int sisfb_scalelcd = -1;
+static int sisfb_specialtiming = CUT_NONE;
+static int sisfb_lvdshl = -1;
 static int sisfb_dstn = 0;
 static int sisfb_fstn = 0;
+static int sisfb_tvplug = -1;		/* Tv plug type (for overriding autodetection) */
+static int sisfb_tvstd  = -1;
+static int sisfb_tvxposoffset = 0;
+static int sisfb_tvyposoffset = 0;
+static int sisfb_filter = -1;
+static int sisfb_nocrt2rate = 0;
+#if LINUX_VERSION_CODE < KERNEL_VERSION(2,5,0)
+static int  sisfb_inverse = 0;
+static char sisfb_fontname[40];
+#endif
+#if !defined(__i386__) && !defined(__x86_64__)
+static int sisfb_resetcard = 0;
+static int sisfb_videoram = 0;
+#endif
 
-VGA_ENGINE sisvga_engine = UNKNOWN_VGA;
-int 	   sisfb_accel = -1;
-
-/* These are to adapted according to VGA_ENGINE type */
-static int sisfb_hwcursor_size = 0;
-static int sisfb_CRT2_write_enable = 0;
-
-int sisfb_crt2type  = -1;	/* CRT2 type (for overriding autodetection) */
-int sisfb_tvplug    = -1;	/* Tv plug type (for overriding autodetection) */
-
-int sisfb_queuemode = -1; 	/* Use MMIO queue mode by default (315 series only) */
-
-unsigned char sisfb_detectedpdc = 0;
-
-unsigned char sisfb_detectedlcda = 0xff;
-
-/* data for sis hardware ("par") */
-struct video_info ivideo;
-
-/* For ioctl SISFB_GET_INFO */
-sisfb_info sisfbinfo;
-
-/* Hardware info; contains data on hardware */
-SIS_HW_INFO sishw_ext;
+/* List of supported chips */
+static struct sisfb_chip_info {
+        int 		chip;
+	int 		vgaengine;
+	int		mni;
+	int 		hwcursor_size;
+	int		CRT2_write_enable;
+	const char 	*chip_name;
+} sisfb_chip_info[] __devinitdata = {
+	{ SIS_300,    SIS_300_VGA, 0, HW_CURSOR_AREA_SIZE_300 * 2, SIS_CRT2_WENABLE_300, "SiS 300/305" },
+	{ SIS_540,    SIS_300_VGA, 0, HW_CURSOR_AREA_SIZE_300 * 2, SIS_CRT2_WENABLE_300, "SiS 540" },
+	{ SIS_630,    SIS_300_VGA, 0, HW_CURSOR_AREA_SIZE_300 * 2, SIS_CRT2_WENABLE_300, "SiS 630" },
+	{ SIS_315H,   SIS_315_VGA, 1, HW_CURSOR_AREA_SIZE_315 * 4, SIS_CRT2_WENABLE_315, "SiS 315H" },
+	{ SIS_315,    SIS_315_VGA, 1, HW_CURSOR_AREA_SIZE_315 * 4, SIS_CRT2_WENABLE_315, "SiS 315" },
+	{ SIS_315PRO, SIS_315_VGA, 1, HW_CURSOR_AREA_SIZE_315 * 4, SIS_CRT2_WENABLE_315, "SiS 315PRO" },
+	{ SIS_550,    SIS_315_VGA, 1, HW_CURSOR_AREA_SIZE_315 * 4, SIS_CRT2_WENABLE_315, "SiS 55x" },
+	{ SIS_650,    SIS_315_VGA, 1, HW_CURSOR_AREA_SIZE_315 * 4, SIS_CRT2_WENABLE_315, "SiS 650" },
+	{ SIS_330,    SIS_315_VGA, 1, HW_CURSOR_AREA_SIZE_315 * 4, SIS_CRT2_WENABLE_315, "SiS 330" },
+	{ SIS_660,    SIS_315_VGA, 1, HW_CURSOR_AREA_SIZE_315 * 4, SIS_CRT2_WENABLE_315, "SiS 660" },
+};
 
-/* SiS private structure */
-SiS_Private  SiS_Pr;
+static struct pci_device_id __devinitdata sisfb_pci_table[] = {
+#ifdef CONFIG_FB_SIS_300
+	{ PCI_VENDOR_ID_SI, PCI_DEVICE_ID_SI_300,     PCI_ANY_ID, PCI_ANY_ID, 0, 0, 0},
+	{ PCI_VENDOR_ID_SI, PCI_DEVICE_ID_SI_540_VGA, PCI_ANY_ID, PCI_ANY_ID, 0, 0, 1},
+	{ PCI_VENDOR_ID_SI, PCI_DEVICE_ID_SI_630_VGA, PCI_ANY_ID, PCI_ANY_ID, 0, 0, 2},
+#endif
+#ifdef CONFIG_FB_SIS_315
+	{ PCI_VENDOR_ID_SI, PCI_DEVICE_ID_SI_315H,    PCI_ANY_ID, PCI_ANY_ID, 0, 0, 3},
+	{ PCI_VENDOR_ID_SI, PCI_DEVICE_ID_SI_315,     PCI_ANY_ID, PCI_ANY_ID, 0, 0, 4},
+	{ PCI_VENDOR_ID_SI, PCI_DEVICE_ID_SI_315PRO,  PCI_ANY_ID, PCI_ANY_ID, 0, 0, 5},
+	{ PCI_VENDOR_ID_SI, PCI_DEVICE_ID_SI_550_VGA, PCI_ANY_ID, PCI_ANY_ID, 0, 0, 6},
+	{ PCI_VENDOR_ID_SI, PCI_DEVICE_ID_SI_650_VGA, PCI_ANY_ID, PCI_ANY_ID, 0, 0, 7},
+	{ PCI_VENDOR_ID_SI, PCI_DEVICE_ID_SI_330,     PCI_ANY_ID, PCI_ANY_ID, 0, 0, 8},
+	{ PCI_VENDOR_ID_SI, PCI_DEVICE_ID_SI_660_VGA, PCI_ANY_ID, PCI_ANY_ID, 0, 0, 9},
+#endif
+	{ 0 }
+};
 
-/* Card parameters */
-static unsigned long sisfb_mmio_size = 0;
-static u8            sisfb_caps = 0;
+MODULE_DEVICE_TABLE(pci, sisfb_pci_table);
 
-typedef enum _SIS_CMDTYPE {
-	MMIO_CMD = 0,
-	AGP_CMD_QUEUE,
-	VM_CMD_QUEUE,
-} SIS_CMDTYPE;
+static struct sis_video_info *card_list = NULL;
 
-/* List of supported chips */
-static struct board {
-	u16 vendor, device;
-	const char *name;
-} sisdev_list[] = {
-	{PCI_VENDOR_ID_SI, PCI_DEVICE_ID_SI_300,     "SIS 300"},
-	{PCI_VENDOR_ID_SI, PCI_DEVICE_ID_SI_540_VGA, "SIS 540 VGA"},
-	{PCI_VENDOR_ID_SI, PCI_DEVICE_ID_SI_630_VGA, "SIS 630/730 VGA"},
-	{PCI_VENDOR_ID_SI, PCI_DEVICE_ID_SI_315H,    "SIS 315H"},
-	{PCI_VENDOR_ID_SI, PCI_DEVICE_ID_SI_315,     "SIS 315"},
-	{PCI_VENDOR_ID_SI, PCI_DEVICE_ID_SI_315PRO,  "SIS 315PRO"},
-	{PCI_VENDOR_ID_SI, PCI_DEVICE_ID_SI_550_VGA, "SIS 550 VGA"},
-	{PCI_VENDOR_ID_SI, PCI_DEVICE_ID_SI_650_VGA, "SIS 65x/M65x/740 VGA"},
-	{PCI_VENDOR_ID_SI, PCI_DEVICE_ID_SI_330,     "SIS 330"},
-	{PCI_VENDOR_ID_SI, PCI_DEVICE_ID_SI_660_VGA, "SIS 661FX/M661FX/741/760 VGA"},
-	{0, 0, NULL}
-};
+/* TODO: This is not handled card-wise because the DRM
+   does not refer to a unique fb when calling sis_alloc
+   or sis_free. Therefore, this is handled globally for
+   now (hoping that nobody is crazy enough to run two
+   SiS cards at the same time).
+ */
+SIS_HEAP       	sisfb_heap;
 
 #define MD_SIS300 1
 #define MD_SIS315 2
 
 /* Mode table */
-/* NOT const - will be patched for 1280x768 mode number chaos reasons */
-struct _sisbios_mode {
+static const struct _sisbios_mode {
 	char name[15];
-	u8 mode_no;
+	u8  mode_no[2];
 	u16 vesa_mode_no_1;  /* "SiS defined" VESA mode number */
 	u16 vesa_mode_no_2;  /* Real VESA mode numbers */
 	u16 xres;
@@ -475,190 +172,231 @@ struct _sisbios_mode {
 	u16 rows;
 	u8  chipset;
 } sisbios_mode[] = {
-#define MODE_INDEX_NONE           0  /* index for mode=none */
-	{"none",         0xff, 0x0000, 0x0000,    0,    0,  0, 0,   0,  0, MD_SIS300|MD_SIS315},
-	{"320x200x8",    0x59, 0x0138, 0x0000,  320,  200,  8, 1,  40, 12, MD_SIS300|MD_SIS315},
-	{"320x200x16",   0x41, 0x010e, 0x0000,  320,  200, 16, 1,  40, 12, MD_SIS300|MD_SIS315},
-	{"320x200x24",   0x4f, 0x0000, 0x0000,  320,  200, 32, 1,  40, 12, MD_SIS300|MD_SIS315},  /* TW: That's for people who mix up color- and fb depth */
-	{"320x200x32",   0x4f, 0x0000, 0x0000,  320,  200, 32, 1,  40, 12, MD_SIS300|MD_SIS315},
-	{"320x240x8",    0x50, 0x0132, 0x0000,  320,  240,  8, 1,  40, 15, MD_SIS300|MD_SIS315},
-	{"320x240x16",   0x56, 0x0135, 0x0000,  320,  240, 16, 1,  40, 15, MD_SIS300|MD_SIS315},
-	{"320x240x24",   0x53, 0x0000, 0x0000,  320,  240, 32, 1,  40, 15, MD_SIS300|MD_SIS315},
-	{"320x240x32",   0x53, 0x0000, 0x0000,  320,  240, 32, 1,  40, 15, MD_SIS300|MD_SIS315},
-	{"320x240x8",    0x5a, 0x0132, 0x0000,  320,  480,  8, 1,  40, 30,           MD_SIS315},  /* TW: FSTN */
-	{"320x240x16",   0x5b, 0x0135, 0x0000,  320,  480, 16, 1,  40, 30,           MD_SIS315},  /* TW: FSTN */
-	{"400x300x8",    0x51, 0x0133, 0x0000,  400,  300,  8, 1,  50, 18, MD_SIS300|MD_SIS315},
-	{"400x300x16",   0x57, 0x0136, 0x0000,  400,  300, 16, 1,  50, 18, MD_SIS300|MD_SIS315},
-	{"400x300x24",   0x54, 0x0000, 0x0000,  400,  300, 32, 1,  50, 18, MD_SIS300|MD_SIS315},
-	{"400x300x32",   0x54, 0x0000, 0x0000,  400,  300, 32, 1,  50, 18, MD_SIS300|MD_SIS315},
-	{"512x384x8",    0x52, 0x0000, 0x0000,  512,  384,  8, 1,  64, 24, MD_SIS300|MD_SIS315},
-	{"512x384x16",   0x58, 0x0000, 0x0000,  512,  384, 16, 1,  64, 24, MD_SIS300|MD_SIS315},
-	{"512x384x24",   0x5c, 0x0000, 0x0000,  512,  384, 32, 1,  64, 24, MD_SIS300|MD_SIS315},
-	{"512x384x32",   0x5c, 0x0000, 0x0000,  512,  384, 32, 1,  64, 24, MD_SIS300|MD_SIS315},
-	{"640x400x8",    0x2f, 0x0000, 0x0000,  640,  400,  8, 1,  80, 25, MD_SIS300|MD_SIS315},
-	{"640x400x16",   0x5d, 0x0000, 0x0000,  640,  400, 16, 1,  80, 25, MD_SIS300|MD_SIS315},
-	{"640x400x24",   0x5e, 0x0000, 0x0000,  640,  400, 32, 1,  80, 25, MD_SIS300|MD_SIS315},
-	{"640x400x32",   0x5e, 0x0000, 0x0000,  640,  400, 32, 1,  80, 25, MD_SIS300|MD_SIS315},
-	{"640x480x8",    0x2e, 0x0101, 0x0101,  640,  480,  8, 1,  80, 30, MD_SIS300|MD_SIS315},
-	{"640x480x16",   0x44, 0x0111, 0x0111,  640,  480, 16, 1,  80, 30, MD_SIS300|MD_SIS315},
-	{"640x480x24",   0x62, 0x013a, 0x0112,  640,  480, 32, 1,  80, 30, MD_SIS300|MD_SIS315},
-	{"640x480x32",   0x62, 0x013a, 0x0112,  640,  480, 32, 1,  80, 30, MD_SIS300|MD_SIS315},
-	{"720x480x8",    0x31, 0x0000, 0x0000,  720,  480,  8, 1,  90, 30, MD_SIS300|MD_SIS315},
-	{"720x480x16",   0x33, 0x0000, 0x0000,  720,  480, 16, 1,  90, 30, MD_SIS300|MD_SIS315},
-	{"720x480x24",   0x35, 0x0000, 0x0000,  720,  480, 32, 1,  90, 30, MD_SIS300|MD_SIS315},
-	{"720x480x32",   0x35, 0x0000, 0x0000,  720,  480, 32, 1,  90, 30, MD_SIS300|MD_SIS315},
-	{"720x576x8",    0x32, 0x0000, 0x0000,  720,  576,  8, 1,  90, 36, MD_SIS300|MD_SIS315},
-	{"720x576x16",   0x34, 0x0000, 0x0000,  720,  576, 16, 1,  90, 36, MD_SIS300|MD_SIS315},
-	{"720x576x24",   0x36, 0x0000, 0x0000,  720,  576, 32, 1,  90, 36, MD_SIS300|MD_SIS315},
-	{"720x576x32",   0x36, 0x0000, 0x0000,  720,  576, 32, 1,  90, 36, MD_SIS300|MD_SIS315},
-	{"768x576x8",    0x5f, 0x0000, 0x0000,  768,  576,  8, 1,  96, 36, MD_SIS300|MD_SIS315},
-	{"768x576x16",   0x60, 0x0000, 0x0000,  768,  576, 16, 1,  96, 36, MD_SIS300|MD_SIS315},
-	{"768x576x24",   0x61, 0x0000, 0x0000,  768,  576, 32, 1,  96, 36, MD_SIS300|MD_SIS315},
-	{"768x576x32",   0x61, 0x0000, 0x0000,  768,  576, 32, 1,  96, 36, MD_SIS300|MD_SIS315},
-	{"800x480x8",    0x70, 0x0000, 0x0000,  800,  480,  8, 1, 100, 30, MD_SIS300|MD_SIS315},
-	{"800x480x16",   0x7a, 0x0000, 0x0000,  800,  480, 16, 1, 100, 30, MD_SIS300|MD_SIS315},
-	{"800x480x24",   0x76, 0x0000, 0x0000,  800,  480, 32, 1, 100, 30, MD_SIS300|MD_SIS315},
-	{"800x480x32",   0x76, 0x0000, 0x0000,  800,  480, 32, 1, 100, 30, MD_SIS300|MD_SIS315},
+/*0*/	{"none",         {0xff,0xff}, 0x0000, 0x0000,    0,    0,  0, 0,   0,  0, MD_SIS300|MD_SIS315},
+	{"320x200x8",    {0x59,0x59}, 0x0138, 0x0000,  320,  200,  8, 1,  40, 12, MD_SIS300|MD_SIS315},
+	{"320x200x16",   {0x41,0x41}, 0x010e, 0x0000,  320,  200, 16, 1,  40, 12, MD_SIS300|MD_SIS315},
+	{"320x200x24",   {0x4f,0x4f}, 0x0000, 0x0000,  320,  200, 32, 1,  40, 12, MD_SIS300|MD_SIS315},  /* That's for people who mix up color- and fb depth */
+	{"320x200x32",   {0x4f,0x4f}, 0x0000, 0x0000,  320,  200, 32, 1,  40, 12, MD_SIS300|MD_SIS315},
+	{"320x240x8",    {0x50,0x50}, 0x0132, 0x0000,  320,  240,  8, 1,  40, 15, MD_SIS300|MD_SIS315},
+	{"320x240x16",   {0x56,0x56}, 0x0135, 0x0000,  320,  240, 16, 1,  40, 15, MD_SIS300|MD_SIS315},
+	{"320x240x24",   {0x53,0x53}, 0x0000, 0x0000,  320,  240, 32, 1,  40, 15, MD_SIS300|MD_SIS315},
+	{"320x240x32",   {0x53,0x53}, 0x0000, 0x0000,  320,  240, 32, 1,  40, 15, MD_SIS300|MD_SIS315},
+	{"320x240x8",    {0x5a,0x5a}, 0x0132, 0x0000,  320,  480,  8, 1,  40, 30,           MD_SIS315},  /* FSTN */
+/*10*/	{"320x240x16",   {0x5b,0x5b}, 0x0135, 0x0000,  320,  480, 16, 1,  40, 30,           MD_SIS315},  /* FSTN */
+	{"400x300x8",    {0x51,0x51}, 0x0133, 0x0000,  400,  300,  8, 1,  50, 18, MD_SIS300|MD_SIS315},
+	{"400x300x16",   {0x57,0x57}, 0x0136, 0x0000,  400,  300, 16, 1,  50, 18, MD_SIS300|MD_SIS315},
+	{"400x300x24",   {0x54,0x54}, 0x0000, 0x0000,  400,  300, 32, 1,  50, 18, MD_SIS300|MD_SIS315},
+	{"400x300x32",   {0x54,0x54}, 0x0000, 0x0000,  400,  300, 32, 1,  50, 18, MD_SIS300|MD_SIS315},
+	{"512x384x8",    {0x52,0x52}, 0x0000, 0x0000,  512,  384,  8, 1,  64, 24, MD_SIS300|MD_SIS315},
+	{"512x384x16",   {0x58,0x58}, 0x0000, 0x0000,  512,  384, 16, 1,  64, 24, MD_SIS300|MD_SIS315},
+	{"512x384x24",   {0x5c,0x5c}, 0x0000, 0x0000,  512,  384, 32, 1,  64, 24, MD_SIS300|MD_SIS315},
+	{"512x384x32",   {0x5c,0x5c}, 0x0000, 0x0000,  512,  384, 32, 1,  64, 24, MD_SIS300|MD_SIS315},
+	{"640x400x8",    {0x2f,0x2f}, 0x0000, 0x0000,  640,  400,  8, 1,  80, 25, MD_SIS300|MD_SIS315},
+/*20*/	{"640x400x16",   {0x5d,0x5d}, 0x0000, 0x0000,  640,  400, 16, 1,  80, 25, MD_SIS300|MD_SIS315},
+	{"640x400x24",   {0x5e,0x5e}, 0x0000, 0x0000,  640,  400, 32, 1,  80, 25, MD_SIS300|MD_SIS315},
+	{"640x400x32",   {0x5e,0x5e}, 0x0000, 0x0000,  640,  400, 32, 1,  80, 25, MD_SIS300|MD_SIS315},
+	{"640x480x8",    {0x2e,0x2e}, 0x0101, 0x0101,  640,  480,  8, 1,  80, 30, MD_SIS300|MD_SIS315},
+	{"640x480x16",   {0x44,0x44}, 0x0111, 0x0111,  640,  480, 16, 1,  80, 30, MD_SIS300|MD_SIS315},
+	{"640x480x24",   {0x62,0x62}, 0x013a, 0x0112,  640,  480, 32, 1,  80, 30, MD_SIS300|MD_SIS315},
+	{"640x480x32",   {0x62,0x62}, 0x013a, 0x0112,  640,  480, 32, 1,  80, 30, MD_SIS300|MD_SIS315},
+	{"720x480x8",    {0x31,0x31}, 0x0000, 0x0000,  720,  480,  8, 1,  90, 30, MD_SIS300|MD_SIS315},
+	{"720x480x16",   {0x33,0x33}, 0x0000, 0x0000,  720,  480, 16, 1,  90, 30, MD_SIS300|MD_SIS315},
+	{"720x480x24",   {0x35,0x35}, 0x0000, 0x0000,  720,  480, 32, 1,  90, 30, MD_SIS300|MD_SIS315},
+/*30*/	{"720x480x32",   {0x35,0x35}, 0x0000, 0x0000,  720,  480, 32, 1,  90, 30, MD_SIS300|MD_SIS315},
+	{"720x576x8",    {0x32,0x32}, 0x0000, 0x0000,  720,  576,  8, 1,  90, 36, MD_SIS300|MD_SIS315},
+	{"720x576x16",   {0x34,0x34}, 0x0000, 0x0000,  720,  576, 16, 1,  90, 36, MD_SIS300|MD_SIS315},
+	{"720x576x24",   {0x36,0x36}, 0x0000, 0x0000,  720,  576, 32, 1,  90, 36, MD_SIS300|MD_SIS315},
+	{"720x576x32",   {0x36,0x36}, 0x0000, 0x0000,  720,  576, 32, 1,  90, 36, MD_SIS300|MD_SIS315},
+	{"768x576x8",    {0x5f,0x5f}, 0x0000, 0x0000,  768,  576,  8, 1,  96, 36, MD_SIS300|MD_SIS315},
+	{"768x576x16",   {0x60,0x60}, 0x0000, 0x0000,  768,  576, 16, 1,  96, 36, MD_SIS300|MD_SIS315},
+	{"768x576x24",   {0x61,0x61}, 0x0000, 0x0000,  768,  576, 32, 1,  96, 36, MD_SIS300|MD_SIS315},
+	{"768x576x32",   {0x61,0x61}, 0x0000, 0x0000,  768,  576, 32, 1,  96, 36, MD_SIS300|MD_SIS315},
+	{"800x480x8",    {0x70,0x70}, 0x0000, 0x0000,  800,  480,  8, 1, 100, 30, MD_SIS300|MD_SIS315},
+/*40*/	{"800x480x16",   {0x7a,0x7a}, 0x0000, 0x0000,  800,  480, 16, 1, 100, 30, MD_SIS300|MD_SIS315},
+	{"800x480x24",   {0x76,0x76}, 0x0000, 0x0000,  800,  480, 32, 1, 100, 30, MD_SIS300|MD_SIS315},
+	{"800x480x32",   {0x76,0x76}, 0x0000, 0x0000,  800,  480, 32, 1, 100, 30, MD_SIS300|MD_SIS315},
 #define DEFAULT_MODE              43 /* index for 800x600x8 */
 #define DEFAULT_LCDMODE           43 /* index for 800x600x8 */
 #define DEFAULT_TVMODE            43 /* index for 800x600x8 */
-	{"800x600x8",    0x30, 0x0103, 0x0103,  800,  600,  8, 2, 100, 37, MD_SIS300|MD_SIS315},
-	{"800x600x16",   0x47, 0x0114, 0x0114,  800,  600, 16, 2, 100, 37, MD_SIS300|MD_SIS315},
-	{"800x600x24",   0x63, 0x013b, 0x0115,  800,  600, 32, 2, 100, 37, MD_SIS300|MD_SIS315},
-	{"800x600x32",   0x63, 0x013b, 0x0115,  800,  600, 32, 2, 100, 37, MD_SIS300|MD_SIS315},
-	{"848x480x8",    0x39, 0x0000, 0x0000,  848,  480,  8, 2, 106, 30, MD_SIS300|MD_SIS315},
-	{"848x480x16",   0x3b, 0x0000, 0x0000,  848,  480, 16, 2, 106, 30, MD_SIS300|MD_SIS315},
-	{"848x480x24",   0x3e, 0x0000, 0x0000,  848,  480, 32, 2, 106, 30, MD_SIS300|MD_SIS315},
-	{"848x480x32",   0x3e, 0x0000, 0x0000,  848,  480, 32, 2, 106, 30, MD_SIS300|MD_SIS315},
-	{"856x480x8",    0x3f, 0x0000, 0x0000,  856,  480,  8, 2, 107, 30, MD_SIS300|MD_SIS315},
-	{"856x480x16",   0x42, 0x0000, 0x0000,  856,  480, 16, 2, 107, 30, MD_SIS300|MD_SIS315},
-	{"856x480x24",   0x45, 0x0000, 0x0000,  856,  480, 32, 2, 107, 30, MD_SIS300|MD_SIS315},
-	{"856x480x32",   0x45, 0x0000, 0x0000,  856,  480, 32, 2, 107, 30, MD_SIS300|MD_SIS315},
-	{"1024x576x8",   0x71, 0x0000, 0x0000, 1024,  576,  8, 1, 128, 36, MD_SIS300|MD_SIS315},
-	{"1024x576x16",  0x74, 0x0000, 0x0000, 1024,  576, 16, 1, 128, 36, MD_SIS300|MD_SIS315},
-	{"1024x576x24",  0x77, 0x0000, 0x0000, 1024,  576, 32, 1, 128, 36, MD_SIS300|MD_SIS315},
-	{"1024x576x32",  0x77, 0x0000, 0x0000, 1024,  576, 32, 1, 128, 36, MD_SIS300|MD_SIS315},
-	{"1024x600x8",   0x20, 0x0000, 0x0000, 1024,  600,  8, 1, 128, 37, MD_SIS300          },
-	{"1024x600x16",  0x21, 0x0000, 0x0000, 1024,  600, 16, 1, 128, 37, MD_SIS300          },
-	{"1024x600x24",  0x22, 0x0000, 0x0000, 1024,  600, 32, 1, 128, 37, MD_SIS300          },
-	{"1024x600x32",  0x22, 0x0000, 0x0000, 1024,  600, 32, 1, 128, 37, MD_SIS300          },
-	{"1024x768x8",   0x38, 0x0105, 0x0105, 1024,  768,  8, 2, 128, 48, MD_SIS300|MD_SIS315},
-	{"1024x768x16",  0x4a, 0x0117, 0x0117, 1024,  768, 16, 2, 128, 48, MD_SIS300|MD_SIS315},
-	{"1024x768x24",  0x64, 0x013c, 0x0118, 1024,  768, 32, 2, 128, 48, MD_SIS300|MD_SIS315},
-	{"1024x768x32",  0x64, 0x013c, 0x0118, 1024,  768, 32, 2, 128, 48, MD_SIS300|MD_SIS315},
-	{"1152x768x8",   0x23, 0x0000, 0x0000, 1152,  768,  8, 1, 144, 48, MD_SIS300          },
-	{"1152x768x16",  0x24, 0x0000, 0x0000, 1152,  768, 16, 1, 144, 48, MD_SIS300          },
-	{"1152x768x24",  0x25, 0x0000, 0x0000, 1152,  768, 32, 1, 144, 48, MD_SIS300          },
-	{"1152x768x32",  0x25, 0x0000, 0x0000, 1152,  768, 32, 1, 144, 48, MD_SIS300          },
-	{"1152x864x8",   0x29, 0x0000, 0x0000, 1152,  864,  8, 1, 144, 54, MD_SIS300|MD_SIS315},
-	{"1152x864x16",  0x2a, 0x0000, 0x0000, 1152,  864, 16, 1, 144, 54, MD_SIS300|MD_SIS315},
-	{"1152x864x24",  0x2b, 0x0000, 0x0000, 1152,  864, 32, 1, 144, 54, MD_SIS300|MD_SIS315},
-	{"1152x864x32",  0x2b, 0x0000, 0x0000, 1152,  864, 32, 1, 144, 54, MD_SIS300|MD_SIS315},
-	{"1280x720x8",   0x79, 0x0000, 0x0000, 1280,  720,  8, 1, 160, 45, MD_SIS300|MD_SIS315},
-	{"1280x720x16",  0x75, 0x0000, 0x0000, 1280,  720, 16, 1, 160, 45, MD_SIS300|MD_SIS315},
-	{"1280x720x24",  0x78, 0x0000, 0x0000, 1280,  720, 32, 1, 160, 45, MD_SIS300|MD_SIS315},
-	{"1280x720x32",  0x78, 0x0000, 0x0000, 1280,  720, 32, 1, 160, 45, MD_SIS300|MD_SIS315},
-#define MODEINDEX_1280x768 79
-	{"1280x768x8",   0x23, 0x0000, 0x0000, 1280,  768,  8, 1, 160, 48, MD_SIS300|MD_SIS315},
-	{"1280x768x16",  0x24, 0x0000, 0x0000, 1280,  768, 16, 1, 160, 48, MD_SIS300|MD_SIS315},
-	{"1280x768x24",  0x25, 0x0000, 0x0000, 1280,  768, 32, 1, 160, 48, MD_SIS300|MD_SIS315},
-	{"1280x768x32",  0x25, 0x0000, 0x0000, 1280,  768, 32, 1, 160, 48, MD_SIS300|MD_SIS315},
-	{"1280x960x8",   0x7c, 0x0000, 0x0000, 1280,  960,  8, 1, 160, 60, MD_SIS300|MD_SIS315},
-	{"1280x960x16",  0x7d, 0x0000, 0x0000, 1280,  960, 16, 1, 160, 60, MD_SIS300|MD_SIS315},
-	{"1280x960x24",  0x7e, 0x0000, 0x0000, 1280,  960, 32, 1, 160, 60, MD_SIS300|MD_SIS315},
-	{"1280x960x32",  0x7e, 0x0000, 0x0000, 1280,  960, 32, 1, 160, 60, MD_SIS300|MD_SIS315},
-	{"1280x1024x8",  0x3a, 0x0107, 0x0107, 1280, 1024,  8, 2, 160, 64, MD_SIS300|MD_SIS315},
-	{"1280x1024x16", 0x4d, 0x011a, 0x011a, 1280, 1024, 16, 2, 160, 64, MD_SIS300|MD_SIS315},
-	{"1280x1024x24", 0x65, 0x013d, 0x011b, 1280, 1024, 32, 2, 160, 64, MD_SIS300|MD_SIS315},
-	{"1280x1024x32", 0x65, 0x013d, 0x011b, 1280, 1024, 32, 2, 160, 64, MD_SIS300|MD_SIS315},
-	{"1360x768x8",   0x48, 0x0000, 0x0000, 1360,  768,  8, 1, 170, 48, MD_SIS300|MD_SIS315},
-	{"1360x768x16",  0x4b, 0x0000, 0x0000, 1360,  768, 16, 1, 170, 48, MD_SIS300|MD_SIS315},
-	{"1360x768x24",  0x4e, 0x0000, 0x0000, 1360,  768, 32, 1, 170, 48, MD_SIS300|MD_SIS315},
-	{"1360x768x32",  0x4e, 0x0000, 0x0000, 1360,  768, 32, 1, 170, 48, MD_SIS300|MD_SIS315},
-	{"1360x1024x8",  0x67, 0x0000, 0x0000, 1360, 1024,  8, 1, 170, 64, MD_SIS300          },
-	{"1360x1024x16", 0x6f, 0x0000, 0x0000, 1360, 1024, 16, 1, 170, 64, MD_SIS300          },
-	{"1360x1024x24", 0x72, 0x0000, 0x0000, 1360, 1024, 32, 1, 170, 64, MD_SIS300          },
-	{"1360x1024x32", 0x72, 0x0000, 0x0000, 1360, 1024, 32, 1, 170, 64, MD_SIS300          },
-	{"1400x1050x8",  0x26, 0x0000, 0x0000, 1400, 1050,  8, 1, 175, 65,           MD_SIS315},
-	{"1400x1050x16", 0x27, 0x0000, 0x0000, 1400, 1050, 16, 1, 175, 65,           MD_SIS315},
-	{"1400x1050x24", 0x28, 0x0000, 0x0000, 1400, 1050, 32, 1, 175, 65,           MD_SIS315},
-	{"1400x1050x32", 0x28, 0x0000, 0x0000, 1400, 1050, 32, 1, 175, 65,           MD_SIS315},
-	{"1600x1200x8",  0x3c, 0x0130, 0x011c, 1600, 1200,  8, 1, 200, 75, MD_SIS300|MD_SIS315},
-	{"1600x1200x16", 0x3d, 0x0131, 0x011e, 1600, 1200, 16, 1, 200, 75, MD_SIS300|MD_SIS315},
-	{"1600x1200x24", 0x66, 0x013e, 0x011f, 1600, 1200, 32, 1, 200, 75, MD_SIS300|MD_SIS315},
-	{"1600x1200x32", 0x66, 0x013e, 0x011f, 1600, 1200, 32, 1, 200, 75, MD_SIS300|MD_SIS315},
-	{"1920x1440x8",  0x68, 0x013f, 0x0000, 1920, 1440,  8, 1, 240, 75, MD_SIS300|MD_SIS315},
-	{"1920x1440x16", 0x69, 0x0140, 0x0000, 1920, 1440, 16, 1, 240, 75, MD_SIS300|MD_SIS315},
-	{"1920x1440x24", 0x6b, 0x0141, 0x0000, 1920, 1440, 32, 1, 240, 75, MD_SIS300|MD_SIS315},
-	{"1920x1440x32", 0x6b, 0x0141, 0x0000, 1920, 1440, 32, 1, 240, 75, MD_SIS300|MD_SIS315},
-	{"2048x1536x8",  0x6c, 0x0000, 0x0000, 2048, 1536,  8, 1, 256, 96,           MD_SIS315},
-	{"2048x1536x16", 0x6d, 0x0000, 0x0000, 2048, 1536, 16, 1, 256, 96,           MD_SIS315},
-	{"2048x1536x24", 0x6e, 0x0000, 0x0000, 2048, 1536, 32, 1, 256, 96,           MD_SIS315},
-	{"2048x1536x32", 0x6e, 0x0000, 0x0000, 2048, 1536, 32, 1, 256, 96,           MD_SIS315},
-	{"\0", 0x00, 0, 0, 0, 0, 0, 0, 0}
+	{"800x600x8",    {0x30,0x30}, 0x0103, 0x0103,  800,  600,  8, 2, 100, 37, MD_SIS300|MD_SIS315},
+	{"800x600x16",   {0x47,0x47}, 0x0114, 0x0114,  800,  600, 16, 2, 100, 37, MD_SIS300|MD_SIS315},
+	{"800x600x24",   {0x63,0x63}, 0x013b, 0x0115,  800,  600, 32, 2, 100, 37, MD_SIS300|MD_SIS315},
+	{"800x600x32",   {0x63,0x63}, 0x013b, 0x0115,  800,  600, 32, 2, 100, 37, MD_SIS300|MD_SIS315},
+	{"848x480x8",    {0x39,0x39}, 0x0000, 0x0000,  848,  480,  8, 2, 106, 30, MD_SIS300|MD_SIS315},
+	{"848x480x16",   {0x3b,0x3b}, 0x0000, 0x0000,  848,  480, 16, 2, 106, 30, MD_SIS300|MD_SIS315},
+	{"848x480x24",   {0x3e,0x3e}, 0x0000, 0x0000,  848,  480, 32, 2, 106, 30, MD_SIS300|MD_SIS315},
+/*50*/	{"848x480x32",   {0x3e,0x3e}, 0x0000, 0x0000,  848,  480, 32, 2, 106, 30, MD_SIS300|MD_SIS315},
+	{"856x480x8",    {0x3f,0x3f}, 0x0000, 0x0000,  856,  480,  8, 2, 107, 30, MD_SIS300|MD_SIS315},
+	{"856x480x16",   {0x42,0x42}, 0x0000, 0x0000,  856,  480, 16, 2, 107, 30, MD_SIS300|MD_SIS315},
+	{"856x480x24",   {0x45,0x45}, 0x0000, 0x0000,  856,  480, 32, 2, 107, 30, MD_SIS300|MD_SIS315},
+	{"856x480x32",   {0x45,0x45}, 0x0000, 0x0000,  856,  480, 32, 2, 107, 30, MD_SIS300|MD_SIS315},
+	{"960x540x8",    {0x1d,0x1d}, 0x0000, 0x0000,  960,  540,  8, 1, 120, 33,           MD_SIS315},
+	{"960x540x16",   {0x1e,0x1e}, 0x0000, 0x0000,  960,  540, 16, 1, 120, 33,           MD_SIS315},
+	{"960x540x24",   {0x1f,0x1f}, 0x0000, 0x0000,  960,  540, 32, 1, 120, 33,           MD_SIS315},
+	{"960x540x32",   {0x1f,0x1f}, 0x0000, 0x0000,  960,  540, 32, 1, 120, 33,           MD_SIS315},
+	{"1024x576x8",   {0x71,0x71}, 0x0000, 0x0000, 1024,  576,  8, 1, 128, 36, MD_SIS300|MD_SIS315},
+/*60*/	{"1024x576x16",  {0x74,0x74}, 0x0000, 0x0000, 1024,  576, 16, 1, 128, 36, MD_SIS300|MD_SIS315},
+	{"1024x576x24",  {0x77,0x77}, 0x0000, 0x0000, 1024,  576, 32, 1, 128, 36, MD_SIS300|MD_SIS315},
+	{"1024x576x32",  {0x77,0x77}, 0x0000, 0x0000, 1024,  576, 32, 1, 128, 36, MD_SIS300|MD_SIS315},
+	{"1024x600x8",   {0x20,0x20}, 0x0000, 0x0000, 1024,  600,  8, 1, 128, 37, MD_SIS300          },
+	{"1024x600x16",  {0x21,0x21}, 0x0000, 0x0000, 1024,  600, 16, 1, 128, 37, MD_SIS300          },
+	{"1024x600x24",  {0x22,0x22}, 0x0000, 0x0000, 1024,  600, 32, 1, 128, 37, MD_SIS300          },
+	{"1024x600x32",  {0x22,0x22}, 0x0000, 0x0000, 1024,  600, 32, 1, 128, 37, MD_SIS300          },
+	{"1024x768x8",   {0x38,0x38}, 0x0105, 0x0105, 1024,  768,  8, 2, 128, 48, MD_SIS300|MD_SIS315},
+	{"1024x768x16",  {0x4a,0x4a}, 0x0117, 0x0117, 1024,  768, 16, 2, 128, 48, MD_SIS300|MD_SIS315},
+	{"1024x768x24",  {0x64,0x64}, 0x013c, 0x0118, 1024,  768, 32, 2, 128, 48, MD_SIS300|MD_SIS315},
+/*70*/	{"1024x768x32",  {0x64,0x64}, 0x013c, 0x0118, 1024,  768, 32, 2, 128, 48, MD_SIS300|MD_SIS315},
+	{"1152x768x8",   {0x23,0x23}, 0x0000, 0x0000, 1152,  768,  8, 1, 144, 48, MD_SIS300          },
+	{"1152x768x16",  {0x24,0x24}, 0x0000, 0x0000, 1152,  768, 16, 1, 144, 48, MD_SIS300          },
+	{"1152x768x24",  {0x25,0x25}, 0x0000, 0x0000, 1152,  768, 32, 1, 144, 48, MD_SIS300          },
+	{"1152x768x32",  {0x25,0x25}, 0x0000, 0x0000, 1152,  768, 32, 1, 144, 48, MD_SIS300          },
+	{"1152x864x8",   {0x29,0x29}, 0x0000, 0x0000, 1152,  864,  8, 1, 144, 54, MD_SIS300|MD_SIS315},
+	{"1152x864x16",  {0x2a,0x2a}, 0x0000, 0x0000, 1152,  864, 16, 1, 144, 54, MD_SIS300|MD_SIS315},
+	{"1152x864x24",  {0x2b,0x2b}, 0x0000, 0x0000, 1152,  864, 32, 1, 144, 54, MD_SIS300|MD_SIS315},
+	{"1152x864x32",  {0x2b,0x2b}, 0x0000, 0x0000, 1152,  864, 32, 1, 144, 54, MD_SIS300|MD_SIS315},
+	{"1280x720x8",   {0x79,0x79}, 0x0000, 0x0000, 1280,  720,  8, 1, 160, 45, MD_SIS300|MD_SIS315},
+/*80*/	{"1280x720x16",  {0x75,0x75}, 0x0000, 0x0000, 1280,  720, 16, 1, 160, 45, MD_SIS300|MD_SIS315},
+	{"1280x720x24",  {0x78,0x78}, 0x0000, 0x0000, 1280,  720, 32, 1, 160, 45, MD_SIS300|MD_SIS315},
+	{"1280x720x32",  {0x78,0x78}, 0x0000, 0x0000, 1280,  720, 32, 1, 160, 45, MD_SIS300|MD_SIS315},
+	{"1280x768x8",   {0x55,0x23}, 0x0000, 0x0000, 1280,  768,  8, 1, 160, 48, MD_SIS300|MD_SIS315},
+	{"1280x768x16",  {0x5a,0x24}, 0x0000, 0x0000, 1280,  768, 16, 1, 160, 48, MD_SIS300|MD_SIS315},
+	{"1280x768x24",  {0x5b,0x25}, 0x0000, 0x0000, 1280,  768, 32, 1, 160, 48, MD_SIS300|MD_SIS315},
+	{"1280x768x32",  {0x5b,0x25}, 0x0000, 0x0000, 1280,  768, 32, 1, 160, 48, MD_SIS300|MD_SIS315},
+	{"1280x800x8",   {0x14,0x14}, 0x0000, 0x0000, 1280,  800,  8, 1, 160, 50,           MD_SIS315},
+	{"1280x800x16",  {0x15,0x15}, 0x0000, 0x0000, 1280,  800, 16, 1, 160, 50,           MD_SIS315},
+	{"1280x800x24",  {0x16,0x16}, 0x0000, 0x0000, 1280,  800, 32, 1, 160, 50,           MD_SIS315},
+/*90*/	{"1280x800x32",  {0x16,0x16}, 0x0000, 0x0000, 1280,  800, 32, 1, 160, 50,           MD_SIS315},
+	{"1280x960x8",   {0x7c,0x7c}, 0x0000, 0x0000, 1280,  960,  8, 1, 160, 60, MD_SIS300|MD_SIS315},
+	{"1280x960x16",  {0x7d,0x7d}, 0x0000, 0x0000, 1280,  960, 16, 1, 160, 60, MD_SIS300|MD_SIS315},
+	{"1280x960x24",  {0x7e,0x7e}, 0x0000, 0x0000, 1280,  960, 32, 1, 160, 60, MD_SIS300|MD_SIS315},
+	{"1280x960x32",  {0x7e,0x7e}, 0x0000, 0x0000, 1280,  960, 32, 1, 160, 60, MD_SIS300|MD_SIS315},
+	{"1280x1024x8",  {0x3a,0x3a}, 0x0107, 0x0107, 1280, 1024,  8, 2, 160, 64, MD_SIS300|MD_SIS315},
+	{"1280x1024x16", {0x4d,0x4d}, 0x011a, 0x011a, 1280, 1024, 16, 2, 160, 64, MD_SIS300|MD_SIS315},
+	{"1280x1024x24", {0x65,0x65}, 0x013d, 0x011b, 1280, 1024, 32, 2, 160, 64, MD_SIS300|MD_SIS315},
+	{"1280x1024x32", {0x65,0x65}, 0x013d, 0x011b, 1280, 1024, 32, 2, 160, 64, MD_SIS300|MD_SIS315},
+	{"1360x768x8",   {0x48,0x48}, 0x0000, 0x0000, 1360,  768,  8, 1, 170, 48, MD_SIS300|MD_SIS315},
+/*100*/	{"1360x768x16",  {0x4b,0x4b}, 0x0000, 0x0000, 1360,  768, 16, 1, 170, 48, MD_SIS300|MD_SIS315},
+	{"1360x768x24",  {0x4e,0x4e}, 0x0000, 0x0000, 1360,  768, 32, 1, 170, 48, MD_SIS300|MD_SIS315},
+	{"1360x768x32",  {0x4e,0x4e}, 0x0000, 0x0000, 1360,  768, 32, 1, 170, 48, MD_SIS300|MD_SIS315},
+	{"1360x1024x8",  {0x67,0x67}, 0x0000, 0x0000, 1360, 1024,  8, 1, 170, 64, MD_SIS300          },
+	{"1360x1024x16", {0x6f,0x6f}, 0x0000, 0x0000, 1360, 1024, 16, 1, 170, 64, MD_SIS300          },
+	{"1360x1024x24", {0x72,0x72}, 0x0000, 0x0000, 1360, 1024, 32, 1, 170, 64, MD_SIS300          },
+	{"1360x1024x32", {0x72,0x72}, 0x0000, 0x0000, 1360, 1024, 32, 1, 170, 64, MD_SIS300          },
+	{"1400x1050x8",  {0x26,0x26}, 0x0000, 0x0000, 1400, 1050,  8, 1, 175, 65,           MD_SIS315},
+	{"1400x1050x16", {0x27,0x27}, 0x0000, 0x0000, 1400, 1050, 16, 1, 175, 65,           MD_SIS315},
+	{"1400x1050x24", {0x28,0x28}, 0x0000, 0x0000, 1400, 1050, 32, 1, 175, 65,           MD_SIS315},
+/*110*/	{"1400x1050x32", {0x28,0x28}, 0x0000, 0x0000, 1400, 1050, 32, 1, 175, 65,           MD_SIS315},
+	{"1600x1200x8",  {0x3c,0x3c}, 0x0130, 0x011c, 1600, 1200,  8, 1, 200, 75, MD_SIS300|MD_SIS315},
+	{"1600x1200x16", {0x3d,0x3d}, 0x0131, 0x011e, 1600, 1200, 16, 1, 200, 75, MD_SIS300|MD_SIS315},
+	{"1600x1200x24", {0x66,0x66}, 0x013e, 0x011f, 1600, 1200, 32, 1, 200, 75, MD_SIS300|MD_SIS315},
+	{"1600x1200x32", {0x66,0x66}, 0x013e, 0x011f, 1600, 1200, 32, 1, 200, 75, MD_SIS300|MD_SIS315},
+	{"1680x1050x8",  {0x17,0x17}, 0x0000, 0x0000, 1680, 1050,  8, 1, 210, 65,           MD_SIS315},
+	{"1680x1050x16", {0x18,0x18}, 0x0000, 0x0000, 1680, 1050, 16, 1, 210, 65,           MD_SIS315},
+	{"1680x1050x24", {0x19,0x19}, 0x0000, 0x0000, 1680, 1050, 32, 1, 210, 65,           MD_SIS315},
+	{"1680x1050x32", {0x19,0x19}, 0x0000, 0x0000, 1680, 1050, 32, 1, 210, 65,           MD_SIS315},
+	{"1920x1080x8",  {0x2c,0x2c}, 0x0000, 0x0000, 1920, 1080,  8, 1, 240, 67,           MD_SIS315},
+/*120*/	{"1920x1080x16", {0x2d,0x2d}, 0x0000, 0x0000, 1920, 1080, 16, 1, 240, 67,           MD_SIS315},
+	{"1920x1080x24", {0x73,0x73}, 0x0000, 0x0000, 1920, 1080, 32, 1, 240, 67,           MD_SIS315},
+	{"1920x1080x32", {0x73,0x73}, 0x0000, 0x0000, 1920, 1080, 32, 1, 240, 67,           MD_SIS315},
+	{"1920x1440x8",  {0x68,0x68}, 0x013f, 0x0000, 1920, 1440,  8, 1, 240, 75, MD_SIS300|MD_SIS315},
+	{"1920x1440x16", {0x69,0x69}, 0x0140, 0x0000, 1920, 1440, 16, 1, 240, 75, MD_SIS300|MD_SIS315},
+	{"1920x1440x24", {0x6b,0x6b}, 0x0141, 0x0000, 1920, 1440, 32, 1, 240, 75, MD_SIS300|MD_SIS315},
+	{"1920x1440x32", {0x6b,0x6b}, 0x0141, 0x0000, 1920, 1440, 32, 1, 240, 75, MD_SIS300|MD_SIS315},
+	{"2048x1536x8",  {0x6c,0x6c}, 0x0000, 0x0000, 2048, 1536,  8, 1, 256, 96,           MD_SIS315},
+	{"2048x1536x16", {0x6d,0x6d}, 0x0000, 0x0000, 2048, 1536, 16, 1, 256, 96,           MD_SIS315},
+	{"2048x1536x24", {0x6e,0x6e}, 0x0000, 0x0000, 2048, 1536, 32, 1, 256, 96,           MD_SIS315},
+/*130*/	{"2048x1536x32", {0x6e,0x6e}, 0x0000, 0x0000, 2048, 1536, 32, 1, 256, 96,           MD_SIS315},
+	{"\0", {0x00,0x00}, 0, 0, 0, 0, 0, 0, 0}
 };
 
-/* mode-related variables */
-#ifdef MODULE
-int sisfb_mode_idx = MODE_INDEX_NONE;  /* Don't use a mode by default if we are a module */
-#else
-int sisfb_mode_idx = -1;               /* Use a default mode if we are inside the kernel */
-#endif
-u8  sisfb_mode_no  = 0;
-u8  sisfb_rate_idx = 0;
+#define SIS_LCD_NUMBER 17
+static const struct _sis_lcd_data {
+	u32 lcdtype;
+	u16 xres;
+	u16 yres;
+	u8  default_mode_idx;
+} sis_lcd_data[] = {
+	{ LCD_640x480,    640,  480,  23 },
+	{ LCD_800x600,    800,  600,  43 },
+	{ LCD_1024x600,  1024,  600,  63 },
+	{ LCD_1024x768,  1024,  768,  67 },
+	{ LCD_1152x768,  1152,  768,  71 },
+	{ LCD_1152x864,  1152,  864,  75 },
+	{ LCD_1280x720,  1280,  720,  79 },
+	{ LCD_1280x768,  1280,  768,  83 },
+	{ LCD_1280x800,  1280,  800,  87 },
+	{ LCD_1280x960,  1280,  960,  91 },
+	{ LCD_1280x1024, 1280, 1024,  95 },
+	{ LCD_1400x1050, 1400, 1050, 107 },
+	{ LCD_1680x1050, 1680, 1050, 115 },
+	{ LCD_1600x1200, 1600, 1200, 111 },
+	{ LCD_640x480_2,  640,  480,  23 },
+	{ LCD_640x480_3,  640,  480,  23 },
+	{ LCD_320x480,    320,  480,   9 },
+};
 
 /* CR36 evaluation */
 const USHORT sis300paneltype[] =
     { LCD_UNKNOWN,   LCD_800x600,   LCD_1024x768,  LCD_1280x1024,
       LCD_1280x960,  LCD_640x480,   LCD_1024x600,  LCD_1152x768,
-      LCD_1024x768,  LCD_1024x768,  LCD_1024x768,  LCD_1024x768,
-      LCD_1024x768,  LCD_1024x768,  LCD_320x480,   LCD_1024x768 };
+      LCD_UNKNOWN,   LCD_UNKNOWN,   LCD_UNKNOWN,   LCD_UNKNOWN,
+      LCD_UNKNOWN,   LCD_UNKNOWN,   LCD_UNKNOWN,   LCD_UNKNOWN };
 
 const USHORT sis310paneltype[] =
     { LCD_UNKNOWN,   LCD_800x600,   LCD_1024x768,  LCD_1280x1024,
       LCD_640x480,   LCD_1024x600,  LCD_1152x864,  LCD_1280x960,
       LCD_1152x768,  LCD_1400x1050, LCD_1280x768,  LCD_1600x1200,
-      LCD_640x480_2, LCD_640x480_3, LCD_320x480,   LCD_1024x768 };
+      LCD_640x480_2, LCD_640x480_3, LCD_UNKNOWN,   LCD_UNKNOWN };
+
+const USHORT sis661paneltype[] =
+    { LCD_UNKNOWN,   LCD_800x600,   LCD_1024x768,  LCD_1280x1024,
+      LCD_640x480,   LCD_1024x600,  LCD_1152x864,  LCD_1280x960,
+      LCD_1152x768,  LCD_1400x1050, LCD_1280x768,  LCD_1600x1200,
+      LCD_1280x800,  LCD_1680x1050, LCD_1280x720,  LCD_UNKNOWN };
 
 #define FL_550_DSTN 0x01
 #define FL_550_FSTN 0x02
-
-static const struct _sis_crt2type {
-	char name[10];
-	int type_no;
-	int tvplug_no;
-	unsigned short flags;
-} sis_crt2type[] = {
-	{"NONE", 	0, 		-1,        0},
-	{"LCD",  	CRT2_LCD, 	-1,        0},
-	{"TV",   	CRT2_TV, 	-1,        0},
-	{"VGA",  	CRT2_VGA, 	-1,        0},
-	{"SVIDEO", 	CRT2_TV, 	TV_SVIDEO, 0},
-	{"COMPOSITE", 	CRT2_TV, 	TV_AVIDEO, 0},
-	{"SCART", 	CRT2_TV, 	TV_SCART,  0},
-	{"DSTN",        CRT2_LCD,       -1,        FL_550_DSTN},
-	{"FSTN",        CRT2_LCD,       -1,        FL_550_FSTN},
-	{"\0",  	-1, 		-1,        0}
-};
-
-/* Queue mode selection for 310 series */
-static const struct _sis_queuemode {
-	char name[6];
-	int type_no;
-} sis_queuemode[] = {
-	{"AGP",  	AGP_CMD_QUEUE},
-	{"VRAM", 	VM_CMD_QUEUE},
-	{"MMIO", 	MMIO_CMD},
-	{"\0",   	-1}
+#define FL_300      0x04
+#define FL_315      0x08
+
+static struct _sis_crt2type {
+	char name[32];
+	u32 type_no;
+	u32 tvplug_no;
+	u16 flags;
+} sis_crt2type[] __initdata = {
+	{"NONE", 	     0, 	-1,                     FL_300|FL_315},
+	{"LCD",  	     CRT2_LCD, 	-1,                     FL_300|FL_315},
+	{"TV",   	     CRT2_TV, 	-1,                     FL_300|FL_315},
+	{"VGA",  	     CRT2_VGA, 	-1,                     FL_300|FL_315},
+	{"SVIDEO", 	     CRT2_TV, 	TV_SVIDEO,              FL_300|FL_315},
+	{"COMPOSITE", 	     CRT2_TV, 	TV_AVIDEO,              FL_300|FL_315},
+	{"CVBS", 	     CRT2_TV, 	TV_AVIDEO,              FL_300|FL_315},
+	{"SVIDEO+COMPOSITE", CRT2_TV,   TV_AVIDEO|TV_SVIDEO,    FL_300|FL_315},
+	{"COMPOSITE+SVIDEO", CRT2_TV,   TV_AVIDEO|TV_SVIDEO,    FL_300|FL_315},
+	{"SVIDEO+CVBS",      CRT2_TV,   TV_AVIDEO|TV_SVIDEO,    FL_300|FL_315},
+	{"CVBS+SVIDEO",      CRT2_TV,   TV_AVIDEO|TV_SVIDEO,    FL_300|FL_315},
+	{"SCART", 	     CRT2_TV, 	TV_SCART,               FL_300|FL_315},
+	{"HIVISION",	     CRT2_TV,   TV_HIVISION,            FL_315},
+	{"YPBPR480I",	     CRT2_TV,   TV_YPBPR|TV_YPBPR525I,  FL_315},
+	{"YPBPR480P",	     CRT2_TV,   TV_YPBPR|TV_YPBPR525P,  FL_315},
+	{"YPBPR720P",	     CRT2_TV,   TV_YPBPR|TV_YPBPR750P,  FL_315},
+	{"YPBPR1080I",	     CRT2_TV,   TV_YPBPR|TV_YPBPR1080I, FL_315},
+	{"DSTN",             CRT2_LCD,  -1,                     FL_315|FL_550_DSTN},
+	{"FSTN",             CRT2_LCD,  -1,                     FL_315|FL_550_FSTN},
+	{"\0",  	     -1, 	-1,                     0}
 };
 
 /* TV standard */
-static const struct _sis_tvtype {
+static struct _sis_tvtype {
 	char name[6];
-	int type_no;
-} sis_tvtype[] = {
+	u32 type_no;
+} sis_tvtype[] __initdata = {
 	{"PAL",  	TV_PAL},
 	{"NTSC", 	TV_NTSC},
+	{"PALM",  	TV_PAL|TV_PALM},
+	{"PALN",  	TV_PAL|TV_PALN},
+	{"NTSCJ",  	TV_NTSC|TV_NTSCJ},
 	{"\0",   	-1}
 };
 
@@ -687,6 +425,7 @@ static const struct _sis_vrate {
 	{7,  800,  600, 120,  TRUE}, {8,  800,  600, 160,  TRUE},
 	{1,  848,  480,  39,  TRUE}, {2,  848,  480,  60,  TRUE},
 	{1,  856,  480,  39,  TRUE}, {2,  856,  480,  60,  TRUE},
+	{1,  960,  540,  60,  TRUE},
 	{1, 1024,  576,  60,  TRUE}, {2, 1024,  576,  75,  TRUE}, {3, 1024,  576,  85,  TRUE},
 	{1, 1024,  600,  60,  TRUE},
 	{1, 1024,  768,  43,  TRUE}, {2, 1024,  768,  60,  TRUE}, {3, 1024,  768,  70, FALSE},
@@ -696,6 +435,7 @@ static const struct _sis_vrate {
 	{1, 1152,  864,  75,  TRUE}, {2, 1152,  864,  84,  TRUE},
 	{1, 1280,  720,  60,  TRUE}, {2, 1280,  720,  75,  TRUE}, {3, 1280,  720,  85,  TRUE},
 	{1, 1280,  768,  60,  TRUE},
+	{1, 1280,  800,  60,  TRUE},
 	{1, 1280,  960,  60,  TRUE}, {2, 1280,  960,  85,  TRUE},
 	{1, 1280, 1024,  43,  TRUE}, {2, 1280, 1024,  60,  TRUE}, {3, 1280, 1024,  75,  TRUE},
 	{4, 1280, 1024,  85,  TRUE},
@@ -705,6 +445,8 @@ static const struct _sis_vrate {
 	{1, 1600, 1200,  60,  TRUE}, {2, 1600, 1200,  65,  TRUE}, {3, 1600, 1200,  70,  TRUE},
 	{4, 1600, 1200,  75,  TRUE}, {5, 1600, 1200,  85,  TRUE}, {6, 1600, 1200, 100,  TRUE},
 	{7, 1600, 1200, 120,  TRUE},
+	{1, 1680, 1050,  60,  TRUE},
+	{1, 1920, 1080,  30,  TRUE},
 	{1, 1920, 1440,  60,  TRUE}, {2, 1920, 1440,  65,  TRUE}, {3, 1920, 1440,  70,  TRUE},
 	{4, 1920, 1440,  75,  TRUE}, {5, 1920, 1440,  85,  TRUE}, {6, 1920, 1440, 100,  TRUE},
 	{1, 2048, 1536,  60,  TRUE}, {2, 2048, 1536,  65,  TRUE}, {3, 2048, 1536,  70,  TRUE},
@@ -712,16 +454,6 @@ static const struct _sis_vrate {
 	{0,    0,    0,   0, FALSE}
 };
 
-static struct sisfb_monitor {
-	u16 hmin;
-	u16 hmax;
-	u16 vmin;
-	u16 vmax;
-	u32 dclockmax;
-	u8  feature;
-	BOOLEAN datavalid;
-} sisfb_thismonitor;
-
 static const struct _sisfbddcsmodes {
 	u32 mask;
 	u16 h;
@@ -760,35 +492,33 @@ static const struct _sisfbddcfmodes {
        { 1920, 1440, 75, 113,297000}
 };
 
-#if LINUX_VERSION_CODE >= KERNEL_VERSION(2,5,0)
-static u8 sisfb_lastrates[128];
-#endif
-
-static const struct _chswtable {
-    int subsysVendor;
-    int subsysCard;
+#ifdef CONFIG_FB_SIS_300
+static struct _chswtable {
+    u16  subsysVendor;
+    u16  subsysCard;
     char *vendorName;
     char *cardName;
-} mychswtable[] = {
+} mychswtable[] __devinitdata = {
         { 0x1631, 0x1002, "Mitachi", "0x1002" },
 	{ 0x1071, 0x7521, "Mitac"  , "7521P"  },
 	{ 0,      0,      ""       , ""       }
 };
+#endif
 
-static const struct _customttable {
-    unsigned short chipID;
-    char *biosversion;
-    char *biosdate;
-    unsigned long bioschksum;
-    unsigned short biosFootprintAddr[5];
-    unsigned char biosFootprintData[5];
-    unsigned short pcisubsysvendor;
-    unsigned short pcisubsyscard;
-    char *vendorName;
-    char *cardName;
-    unsigned long SpecialID;
-    char *optionName;
-} mycustomttable[] = {
+static struct _customttable {
+    u16   chipID;
+    char  *biosversion;
+    char  *biosdate;
+    u32   bioschksum;
+    u16   biosFootprintAddr[5];
+    u8    biosFootprintData[5];
+    u16   pcisubsysvendor;
+    u16   pcisubsyscard;
+    char  *vendorName;
+    char  *cardName;
+    u32   SpecialID;
+    char  *optionName;
+} mycustomttable[] __devinitdata = {
 	{ SIS_630, "2.00.07", "09/27/2002-13:38:25",
 	  0x3240A8,
 	  { 0x220, 0x227, 0x228, 0x229, 0x0ee },
@@ -917,46 +647,6 @@ static const struct _customttable {
 	}
 };
 
-#if LINUX_VERSION_CODE < KERNEL_VERSION(2,5,0)
-/* Offscreen layout */
-typedef struct _SIS_GLYINFO {
-	unsigned char ch;
-	int fontwidth;
-	int fontheight;
-	u8 gmask[72];
-	int ngmask;
-} SIS_GLYINFO;
-
-static char sisfb_fontname[40];
-#endif
-
-typedef struct _SIS_OH {
-	struct _SIS_OH *poh_next;
-	struct _SIS_OH *poh_prev;
-	unsigned long offset;
-	unsigned long size;
-} SIS_OH;
-
-typedef struct _SIS_OHALLOC {
-	struct _SIS_OHALLOC *poha_next;
-	SIS_OH aoh[1];
-} SIS_OHALLOC;
-
-typedef struct _SIS_HEAP {
-	SIS_OH oh_free;
-	SIS_OH oh_used;
-	SIS_OH *poh_freelist;
-	SIS_OHALLOC *poha_chain;
-	unsigned long max_freesize;
-} SIS_HEAP;
-
-static unsigned long sisfb_hwcursor_vbase;
-
-static unsigned long sisfb_heap_start;
-static unsigned long sisfb_heap_end;
-static unsigned long sisfb_heap_size;
-static SIS_HEAP      sisfb_heap;
-
 static const struct _sis_TV_filter {
 	u8 filter[9][4];
 } sis_TV_filter[] = {
@@ -1106,9 +796,6 @@ static const struct _sis_TV_filter {
 	   {0xFF,0xFF,0xFF,0xFF} }}
 };
 
-static int           filter = -1;
-static unsigned char filter_tb;
-
 /* ---------------------- Prototypes ------------------------- */
 
 /* Interface used by the world */
@@ -1119,7 +806,11 @@ int             sisfb_setup(char *options);
 /* Interface to the low level console driver */
 int             sisfb_init(void);
 
+
 /* fbdev routines */
+static int      sisfb_get_fix(struct fb_fix_screeninfo *fix, int con,
+			      struct fb_info *info);
+
 #if LINUX_VERSION_CODE < KERNEL_VERSION(2,5,0)
 static int      sisfb_get_fix(struct fb_fix_screeninfo *fix, 
 			      int con,
@@ -1130,7 +821,8 @@ static int      sisfb_get_var(struct fb_var_screeninfo *var,
 static int      sisfb_set_var(struct fb_var_screeninfo *var, 
 			      int con,
 			      struct fb_info *info);
-static void     sisfb_crtc_to_var(struct fb_var_screeninfo *var);			      
+static void     sisfb_crtc_to_var(struct sis_video_info *ivideo,
+			          struct fb_var_screeninfo *var);
 static int      sisfb_get_cmap(struct fb_cmap *cmap, 
 			       int kspc, 
 			       int con,
@@ -1153,108 +845,67 @@ static int      sis_getcolreg(unsigned regno, unsigned *red, unsigned *green,
 			      struct fb_info *fb_info);
 static void     sisfb_do_install_cmap(int con, 
                                       struct fb_info *info);
-static void     sis_get_glyph(struct fb_info *info, 
-                              SIS_GLYINFO *gly);
-static int 	sisfb_mmap(struct fb_info *info, struct file *file,
-		           struct vm_area_struct *vma);	
 static int      sisfb_ioctl(struct inode *inode, struct file *file,
 		       	    unsigned int cmd, unsigned long arg, int con,
 		       	    struct fb_info *info);		      
 #endif			
 
 #if LINUX_VERSION_CODE >= KERNEL_VERSION(2,5,0)
+static int      sisfb_ioctl(struct inode *inode, struct file *file,
+		       	    unsigned int cmd, unsigned long arg,
+		       	    struct fb_info *info);
 static int      sisfb_set_par(struct fb_info *info);
 static int      sisfb_blank(int blank, 
                             struct fb_info *info);			
-static int 	sisfb_mmap(struct fb_info *info, struct file *file,
-		           struct vm_area_struct *vma);			    
 extern void     fbcon_sis_fillrect(struct fb_info *info, 
                                    const struct fb_fillrect *rect);
 extern void     fbcon_sis_copyarea(struct fb_info *info, 
                                    const struct fb_copyarea *area);
 extern int      fbcon_sis_sync(struct fb_info *info);
-static int      sisfb_ioctl(struct inode *inode, 
-	 		    struct file *file,
-		       	    unsigned int cmd, 
-			    unsigned long arg, 
-		       	    struct fb_info *info);
-extern int	sisfb_mode_rate_to_dclock(SiS_Private *SiS_Pr, 
-			      PSIS_HW_INFO HwDeviceExtension,
-			      unsigned char modeno, unsigned char rateindex);	
-extern int      sisfb_mode_rate_to_ddata(SiS_Private *SiS_Pr, PSIS_HW_INFO HwDeviceExtension,
-			 unsigned char modeno, unsigned char rateindex,
-			 unsigned int *left_margin, unsigned int *right_margin, 
-			 unsigned int *upper_margin, unsigned int *lower_margin,
-			 unsigned int *hsync_len, unsigned int *vsync_len,
-			 unsigned int *sync, unsigned int *vmode);
 #endif
 			
-static int      sisfb_get_fix(struct fb_fix_screeninfo *fix, int con,
-			      struct fb_info *info);
-
 /* Internal 2D accelerator functions */
-extern int      sisfb_initaccel(void);
-extern void     sisfb_syncaccel(void);
+extern int      sisfb_initaccel(struct sis_video_info *ivideo);
+extern void     sisfb_syncaccel(struct sis_video_info *ivideo);
 
 /* Internal general routines */
 static void     sisfb_search_mode(char *name, BOOLEAN quiet);
-static int      sisfb_validate_mode(int modeindex, unsigned long vbflags);
-static u8       sisfb_search_refresh_rate(unsigned int rate, int index);
+static int      sisfb_validate_mode(struct sis_video_info *ivideo, int modeindex, u32 vbflags);
+static u8       sisfb_search_refresh_rate(struct sis_video_info *ivideo, unsigned int rate,
+			int index);
 static int      sisfb_setcolreg(unsigned regno, unsigned red, unsigned green,
 			unsigned blue, unsigned transp,
 			struct fb_info *fb_info);
 static int      sisfb_do_set_var(struct fb_var_screeninfo *var, int isactive,
 		      	struct fb_info *info);
-static void     sisfb_pre_setmode(void);
-static void     sisfb_post_setmode(void);
-
-static char *   sis_find_rom(void);
-static BOOLEAN  sisfb_CheckVBRetrace(void);
-static BOOLEAN  sisfbcheckvretracecrt2(void);
-static BOOLEAN  sisfbcheckvretracecrt1(void);
-static BOOLEAN  sisfb_bridgeisslave(void);
-static void     sisfb_detect_VB_connect(void);
-static void     sisfb_get_VB_type(void);
-
-static void     sisfb_handle_ddc(struct sisfb_monitor *monitor, int crtno);
-static BOOLEAN  sisfb_interpret_edid(struct sisfb_monitor *monitor, unsigned char *buffer);
-
-/* SiS-specific Export functions */
-void            sis_dispinfo(struct ap_data *rec);
+static void     sisfb_pre_setmode(struct sis_video_info *ivideo);
+static void     sisfb_post_setmode(struct sis_video_info *ivideo);
+static char *   sis_find_rom(struct pci_dev *pdev);
+static BOOLEAN  sisfb_CheckVBRetrace(struct sis_video_info *ivideo);
+static BOOLEAN  sisfbcheckvretracecrt2(struct sis_video_info *ivideo);
+static BOOLEAN  sisfbcheckvretracecrt1(struct sis_video_info *ivideo);
+static BOOLEAN  sisfb_bridgeisslave(struct sis_video_info *ivideo);
+static void     sisfb_detect_VB_connect(struct sis_video_info *ivideo);
+static void     sisfb_get_VB_type(struct sis_video_info *ivideo);
+static void     sisfb_set_TVxposoffset(struct sis_video_info *ivideo, int val);
+static void     sisfb_set_TVyposoffset(struct sis_video_info *ivideo, int val);
+
+/* SiS-specific exported functions */
 void            sis_malloc(struct sis_memreq *req);
-void            sis_free(unsigned long base);
-
-/* Internal hardware access routines */
-void            sisfb_set_reg4(u16 port, unsigned long data);
-u32             sisfb_get_reg3(u16 port);
-
-/* Chipset-dependent internal routines */
-#ifdef CONFIG_FB_SIS_300
-static int      sisfb_get_dram_size_300(void);
-#endif
-#ifdef CONFIG_FB_SIS_315
-static int      sisfb_get_dram_size_315(void);
-#endif
+void            sis_free(u32 base);
 
 /* Internal heap routines */
-static int      sisfb_heap_init(void);
+static int      sisfb_heap_init(struct sis_video_info *ivideo);
 static SIS_OH   *sisfb_poh_new_node(void);
-static SIS_OH   *sisfb_poh_allocate(unsigned long size);
+static SIS_OH   *sisfb_poh_allocate(u32 size);
 static void     sisfb_delete_node(SIS_OH *poh);
 static void     sisfb_insert_node(SIS_OH *pohList, SIS_OH *poh);
-static SIS_OH   *sisfb_poh_free(unsigned long base);
+static SIS_OH   *sisfb_poh_free(u32 base);
 static void     sisfb_free_node(SIS_OH *poh);
 
-/* Internal routines to access PCI configuration space */
-BOOLEAN         sisfb_query_VGA_config_space(PSIS_HW_INFO psishw_ext,
-	          	unsigned long offset, unsigned long set, unsigned long *value);
-BOOLEAN         sisfb_query_north_bridge_space(PSIS_HW_INFO psishw_ext,
-	         	unsigned long offset, unsigned long set, unsigned long *value);
-
 /* Sensing routines */
-static void     SiS_Sense30x(void);
-static int      SISDoSense(int tempbl, int tempbh, int tempcl, int tempch);
-static void     SiS_SenseCh(void);
+static void     SiS_Sense30x(struct sis_video_info *ivideo);
+static void     SiS_SenseCh(struct sis_video_info *ivideo);
 
 /* Routines from init.c/init301.c */
 extern USHORT   SiS_GetModeID(int VGAEngine, ULONG VBFlags, int HDisplay, int VDisplay, int Depth, BOOLEAN FSTN);
@@ -1268,10 +919,20 @@ extern BOOLEAN  SiSSetMode(SiS_Private *SiS_Pr, PSIS_HW_INFO HwDeviceInfo, USHOR
 extern void     SiS_SetEnableDstn(SiS_Private *SiS_Pr, int enable);
 extern void     SiS_SetEnableFstn(SiS_Private *SiS_Pr, int enable);
 
+extern BOOLEAN  SiSDetermineROMLayout661(SiS_Private *SiS_Pr, PSIS_HW_INFO HwInfo);
+
 extern BOOLEAN  sisfb_gettotalfrommode(SiS_Private *SiS_Pr, PSIS_HW_INFO HwDeviceExtension,
 		       unsigned char modeno, int *htotal, int *vtotal, unsigned char rateindex);
+#if LINUX_VERSION_CODE >= KERNEL_VERSION(2,5,0)
+extern int	sisfb_mode_rate_to_dclock(SiS_Private *SiS_Pr,
+		    	PSIS_HW_INFO HwDeviceExtension,
+			unsigned char modeno, unsigned char rateindex);
+extern int      sisfb_mode_rate_to_ddata(SiS_Private *SiS_Pr, PSIS_HW_INFO HwDeviceExtension,
+			unsigned char modeno, unsigned char rateindex,
+			struct fb_var_screeninfo *var);
+#endif
 
-/* Chrontel TV functions */
+/* Chrontel TV, DDC and DPMS functions */
 extern USHORT 	SiS_GetCH700x(SiS_Private *SiS_Pr, USHORT tempbx);
 extern void 	SiS_SetCH700x(SiS_Private *SiS_Pr, USHORT tempbx);
 extern USHORT 	SiS_GetCH701x(SiS_Private *SiS_Pr, USHORT tempbx);
@@ -1279,13 +940,13 @@ extern void 	SiS_SetCH701x(SiS_Private *SiS_Pr, USHORT tempbx);
 extern void     SiS_SetCH70xxANDOR(SiS_Private *SiS_Pr, USHORT tempax,USHORT tempbh);
 extern void     SiS_DDC2Delay(SiS_Private *SiS_Pr, USHORT delaytime);
 extern void     SiS_SetChrontelGPIO(SiS_Private *SiS_Pr, USHORT myvbinfo);
-extern USHORT   SiS_HandleDDC(SiS_Private *SiS_Pr, unsigned long VBFlags, int VGAEngine,
+extern USHORT   SiS_HandleDDC(SiS_Private *SiS_Pr, ULONG VBFlags, int VGAEngine,
 		              USHORT adaptnum, USHORT DDCdatatype, unsigned char *buffer);
 extern USHORT   SiS_ReadDDC1Bit(SiS_Private *SiS_Pr);
 extern void 	SiS_Chrontel701xBLOn(SiS_Private *SiS_Pr, PSIS_HW_INFO HwDeviceInfo);
 extern void 	SiS_Chrontel701xBLOff(SiS_Private *SiS_Pr);
 extern void 	SiS_SiS30xBLOn(SiS_Private *SiS_Pr, PSIS_HW_INFO HwDeviceInfo);
 extern void 	SiS_SiS30xBLOff(SiS_Private *SiS_Pr, PSIS_HW_INFO HwDeviceInfo);
-
-			
 #endif
+
+
diff --git a/drivers/video/sis/vgatypes.h b/drivers/video/sis/vgatypes.h
index 9e96c3b1b..ca7caf0e6 100644
--- a/drivers/video/sis/vgatypes.h
+++ b/drivers/video/sis/vgatypes.h
@@ -1,4 +1,5 @@
 /* $XFree86$ */
+/* $XdotOrg$ */
 /*
  * General type definitions for universal mode switching modules
  *
@@ -31,13 +32,10 @@
  * * 2) Redistributions in binary form must reproduce the above copyright
  * *    notice, this list of conditions and the following disclaimer in the
  * *    documentation and/or other materials provided with the distribution.
- * * 3) All advertising materials mentioning features or use of this software
- * *    must display the following acknowledgement: "This product includes
- * *    software developed by Thomas Winischhofer, Vienna, Austria."
- * * 4) The name of the author may not be used to endorse or promote products
+ * * 3) The name of the author may not be used to endorse or promote products
  * *    derived from this software without specific prior written permission.
  * *
- * * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR
+ * * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESSED 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,
@@ -121,21 +119,17 @@ typedef IOADDRESS SISIOADDRESS;
 #endif
 #endif
 
-#ifndef LINUX_KERNEL   /* For the linux kernel, this is defined in sisfb.h */
-#ifndef SIS_CHIP_TYPE
-typedef enum _SIS_CHIP_TYPE {
+enum _SIS_CHIP_TYPE {
     SIS_VGALegacy = 0,
-#ifdef LINUX_XF86
     SIS_530,
     SIS_OLD,
-#endif
     SIS_300,
     SIS_630,
     SIS_730,
     SIS_540,
     SIS_315H,   /* SiS 310 */
     SIS_315,
-    SIS_315PRO, /* SiS 325 */
+    SIS_315PRO,
     SIS_550,
     SIS_650,
     SIS_740,
@@ -144,29 +138,13 @@ typedef enum _SIS_CHIP_TYPE {
     SIS_741,
     SIS_660,
     SIS_760,
+    SIS_761,
+    SIS_340,
     MAX_SIS_CHIP
-} SIS_CHIP_TYPE;
-#endif
-#endif
-
-#ifndef SIS_VB_CHIP_TYPE
-typedef enum _SIS_VB_CHIP_TYPE {
-    VB_CHIP_Legacy = 0,
-    VB_CHIP_301,
-    VB_CHIP_301B,
-    VB_CHIP_301LV,
-    VB_CHIP_302,
-    VB_CHIP_302B,
-    VB_CHIP_302LV,
-    VB_CHIP_301C,
-    VB_CHIP_302ELV,
-    VB_CHIP_UNKNOWN, /* other video bridge or no video bridge */
-    MAX_VB_CHIP
-} SIS_VB_CHIP_TYPE;
-#endif
+};
 
-#ifndef SIS_LCD_TYPE
-typedef enum _SIS_LCD_TYPE {
+#ifdef LINUX_KERNEL
+enum _SIS_LCD_TYPE {
     LCD_INVALID = 0,
     LCD_800x600,
     LCD_1024x768,
@@ -176,28 +154,22 @@ typedef enum _SIS_LCD_TYPE {
     LCD_1600x1200,
     LCD_1920x1440,
     LCD_2048x1536,
-    LCD_320x480,       /* FSTN, DSTN */
+    LCD_320x480,       /* FSTN */
     LCD_1400x1050,
     LCD_1152x864,
     LCD_1152x768,
     LCD_1280x768,
     LCD_1024x600,
-    LCD_640x480_2,     /* FSTN, DSTN */
-    LCD_640x480_3,     /* FSTN, DSTN */
+    LCD_640x480_2,     /* DSTN */
+    LCD_640x480_3,     /* DSTN */
     LCD_848x480,
     LCD_1280x800,
     LCD_1680x1050,
+    LCD_1280x720,
     LCD_CUSTOM,
     LCD_UNKNOWN
-} SIS_LCD_TYPE;
-#endif
-
-#ifndef PSIS_DSReg
-typedef struct _SIS_DSReg
-{
-  UCHAR  jIdx;
-  UCHAR  jVal;
-} SIS_DSReg, *PSIS_DSReg;
+};
+typedef unsigned int SIS_LCD_TYPE;
 #endif
 
 #ifndef SIS_HW_INFO
@@ -220,97 +192,84 @@ struct _SIS_HW_INFO
                                  /* of Linear VGA memory */
 
     ULONG  ulVideoMemorySize;    /* size, in bytes, of the memory on the board */
-    SISIOADDRESS ulIOAddress;    /* base I/O address of VGA ports (0x3B0) */
+
+    SISIOADDRESS ulIOAddress;    /* base I/O address of VGA ports (0x3B0; relocated) */
+
     UCHAR  jChipType;            /* Used to Identify SiS Graphics Chip */
-                                 /* defined in the data structure type  */
-                                 /* "SIS_CHIP_TYPE" */
+                                 /* defined in the enum "SIS_CHIP_TYPE" (above or sisfb.h) */
 
     UCHAR  jChipRevision;        /* Used to Identify SiS Graphics Chip Revision */
-    UCHAR  ujVBChipID;           /* the ID of video bridge */
-                                 /* defined in the data structure type */
-                                 /* "SIS_VB_CHIP_TYPE" */
-#ifdef LINUX_KERNEL
-    BOOLEAN Is301BDH;
-#endif
 
-    USHORT usExternalChip;       /* NO VB or other video bridge (other than  */
-                                 /* SiS video bridge) */
-
-    ULONG  ulCRT2LCDType;        /* defined in the data structure type */
-                                 /* "SIS_LCD_TYPE" */
-                                     
     BOOLEAN bIntegratedMMEnabled;/* supporting integration MM enable */
-                                      
-    BOOLEAN bSkipDramSizing;     /* True: Skip video memory sizing. */
 
 #ifdef LINUX_KERNEL
-    PSIS_DSReg  pSR;             /* restore SR registers in initial function. */
-                                 /* end data :(idx, val) =  (FF, FF). */
-                                 /* Note : restore SR registers if  */
-                                 /* bSkipDramSizing = TRUE */
-
-    PSIS_DSReg  pCR;             /* restore CR registers in initial function. */
-                                 /* end data :(idx, val) =  (FF, FF) */
-                                 /* Note : restore cR registers if  */
-                                 /* bSkipDramSizing = TRUE */
+    ULONG  ulCRT2LCDType;        /* defined in the data structure type */
+                                 /* "SIS_LCD_TYPE" */
 #endif
-
-    PSIS_QUERYSPACE  pQueryVGAConfigSpace; /* Get/Set VGA Configuration  */
-                                           /* space */
- 
-    PSIS_QUERYSPACE  pQueryNorthBridgeSpace;/* Get/Set North Bridge  */
-                                            /* space  */
 };
 #endif
 
-/* Addtional IOCTL for communication sisfb <> X driver        */
+/* Addtional IOCTLs for communication sisfb <> X driver        */
 /* If changing this, sisfb.h must also be changed (for sisfb) */
 
 #ifdef LINUX_XF86  /* We don't want the X driver to depend on the kernel source */
 
 /* ioctl for identifying and giving some info (esp. memory heap start) */
-#define SISFB_GET_INFO    0x80046ef8  /* Wow, what a terrible hack... */
+#define SISFB_GET_INFO_SIZE	0x8004f300
+#define SISFB_GET_INFO		0x8000f301  /* Must be patched with result from ..._SIZE at D[29:16] */
+/* deprecated ioctl number (for older versions of sisfb) */
+#define SISFB_GET_INFO_OLD    	0x80046ef8
+
+/* ioctls for tv parameters (position) */
+#define SISFB_SET_TVPOSOFFSET   0x4004f304
+
+/* lock sisfb from register access */
+#define SISFB_SET_LOCK		0x4004f306
 
 /* Structure argument for SISFB_GET_INFO ioctl  */
 typedef struct _SISFB_INFO sisfb_info, *psisfb_info;
 
 struct _SISFB_INFO {
-	unsigned long sisfb_id;         /* for identifying sisfb */
+	CARD32 	sisfb_id;         	/* for identifying sisfb */
 #ifndef SISFB_ID
 #define SISFB_ID	  0x53495346    /* Identify myself with 'SISF' */
 #endif
- 	int    chip_id;			/* PCI ID of detected chip */
-	int    memory;			/* video memory in KB which sisfb manages */
-	int    heapstart;               /* heap start (= sisfb "mem" argument) in KB */
-	unsigned char fbvidmode;	/* current sisfb mode */
+ 	CARD32 	chip_id;		/* PCI ID of detected chip */
+	CARD32	memory;			/* video memory in KB which sisfb manages */
+	CARD32	heapstart;             	/* heap start (= sisfb "mem" argument) in KB */
+	CARD8 	fbvidmode;		/* current sisfb mode */
+
+	CARD8 	sisfb_version;
+	CARD8	sisfb_revision;
+	CARD8 	sisfb_patchlevel;
+
+	CARD8 	sisfb_caps;		/* sisfb's capabilities */
+
+	CARD32 	sisfb_tqlen;		/* turbo queue length (in KB) */
 
-	unsigned char sisfb_version;
-	unsigned char sisfb_revision;
-	unsigned char sisfb_patchlevel;
+	CARD32 	sisfb_pcibus;      	/* The card's PCI ID */
+	CARD32 	sisfb_pcislot;
+	CARD32 	sisfb_pcifunc;
 
-	unsigned char sisfb_caps;	/* sisfb's capabilities */
+	CARD8 	sisfb_lcdpdc;
 
-	int    sisfb_tqlen;		/* turbo queue length (in KB) */
+	CARD8	sisfb_lcda;
 
-	unsigned int sisfb_pcibus;      /* The card's PCI ID */
-	unsigned int sisfb_pcislot;
-	unsigned int sisfb_pcifunc;
+	CARD32	sisfb_vbflags;
+	CARD32	sisfb_currentvbflags;
 
-	unsigned char sisfb_lcdpdc;
-	
-	unsigned char sisfb_lcda;
+	CARD32 	sisfb_scalelcd;
+	CARD32 	sisfb_specialtiming;
 
-	unsigned long sisfb_vbflags;
-	unsigned long sisfb_currentvbflags;
+	CARD8 	sisfb_haveemi;
+	CARD8 	sisfb_emi30,sisfb_emi31,sisfb_emi32,sisfb_emi33;
+	CARD8 	sisfb_haveemilcd;
 
-	int sisfb_scalelcd;
-	unsigned long sisfb_specialtiming;
+	CARD8 	sisfb_lcdpdca;
 
-	unsigned char sisfb_haveemi;
-	unsigned char sisfb_emi30,sisfb_emi31,sisfb_emi32,sisfb_emi33;
-	unsigned char sisfb_haveemilcd;
+	CARD16  sisfb_tvxpos, sisfb_tvypos;  	/* Warning: Values + 32 ! */
 
-	char reserved[213]; 		/* for future use */
+	CARD8 reserved[208]; 			/* for future use */
 };
 #endif
 
diff --git a/drivers/video/sis/vstruct.h b/drivers/video/sis/vstruct.h
index d7431ab70..e3da799e6 100644
--- a/drivers/video/sis/vstruct.h
+++ b/drivers/video/sis/vstruct.h
@@ -1,4 +1,5 @@
 /* $XFree86$ */
+/* $XdotOrg$ */
 /*
  * General structure definitions for universal mode switching modules
  *
@@ -31,13 +32,10 @@
  * * 2) Redistributions in binary form must reproduce the above copyright
  * *    notice, this list of conditions and the following disclaimer in the
  * *    documentation and/or other materials provided with the distribution.
- * * 3) All advertising materials mentioning features or use of this software
- * *    must display the following acknowledgement: "This product includes
- * *    software developed by Thomas Winischhofer, Vienna, Austria."
- * * 4) The name of the author may not be used to endorse or promote products
+ * * 3) The name of the author may not be used to endorse or promote products
  * *    derived from this software without specific prior written permission.
  * *
- * * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR
+ * * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESSED 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,
@@ -164,7 +162,6 @@ typedef struct _SiS_ExtStruct
 {
 	UCHAR  Ext_ModeID;
 	USHORT Ext_ModeFlag;
-	UCHAR  Ext_ModeOffset;
 	USHORT Ext_VESAID;
 	UCHAR  Ext_RESINFO;
 	UCHAR  VB_ExtTVFlickerIndex;
@@ -172,6 +169,7 @@ typedef struct _SiS_ExtStruct
 	UCHAR  VB_ExtTVYFilterIndex;
 	UCHAR  VB_ExtTVYFilterIndexROM661;
 	UCHAR  REFindex;
+	CHAR   ROMMODEIDX661;
 } SiS_ExtStruct;
 
 typedef struct _SiS_Ext2Struct
@@ -180,6 +178,7 @@ typedef struct _SiS_Ext2Struct
 	UCHAR  Ext_CRT1CRTC;
 	UCHAR  Ext_CRTVCLK;
 	UCHAR  Ext_CRT2CRTC;
+	UCHAR  Ext_CRT2CRTC_NS;
 	UCHAR  ModeID;
 	USHORT XRes;
 	USHORT YRes;
@@ -228,6 +227,8 @@ typedef struct _SiS_ModeResInfoStruct
 	UCHAR  YChar;
 } SiS_ModeResInfoStruct;
 
+
+
 typedef UCHAR DRAM4Type[4];
 
 /* Defines for SiS_CustomT */
@@ -289,18 +290,21 @@ typedef struct _SiS_Private
         USHORT SiS_CP1, SiS_CP2, SiS_CP3, SiS_CP4;
 #endif
 	BOOLEAN SiS_UseROM;
-	int    SiS_CHOverScan;
+	BOOLEAN SiS_ROMNew;
+	BOOLEAN SiS_NeedRomModeData;
+	BOOLEAN PanelSelfDetected;
+	int     SiS_CHOverScan;
 	BOOLEAN SiS_CHSOverScan;
 	BOOLEAN SiS_ChSW;
 	BOOLEAN SiS_UseLCDA;
-	int    SiS_UseOEM;
-	ULONG  SiS_CustomT;
-	USHORT SiS_Backup70xx;
+	int     SiS_UseOEM;
+	ULONG   SiS_CustomT;
+	USHORT  SiS_Backup70xx;
 	BOOLEAN HaveEMI;
 	BOOLEAN HaveEMILCD;
 	BOOLEAN OverruleEMI;
 	UCHAR  EMI_30,EMI_31,EMI_32,EMI_33;
-	UCHAR  PDC;
+	SHORT  PDC, PDCA;
 	UCHAR  SiS_MyCR63;
 	USHORT SiS_CRT1Mode;
 	USHORT SiS_flag_clearbuffer;
@@ -346,28 +350,13 @@ typedef struct _SiS_Private
 	USHORT SiS_DDC_DeviceAddr;
 	USHORT SiS_DDC_ReadAddr;
 	USHORT SiS_DDC_SecAddr;
+	USHORT SiS_ChrontelInit;
 	BOOLEAN SiS_SensibleSR11;
-	USHORT SiS_Panel800x600;
-	USHORT SiS_Panel1024x768;
-	USHORT SiS_Panel1280x1024;
-	USHORT SiS_Panel1600x1200;
-	USHORT SiS_Panel1280x960;
-	USHORT SiS_Panel1400x1050;
-	USHORT SiS_Panel320x480;
-	USHORT SiS_Panel1152x768;
-	USHORT SiS_Panel1280x768;
-	USHORT SiS_Panel1024x600;
-	USHORT SiS_Panel640x480;
-	USHORT SiS_Panel640x480_2;
-	USHORT SiS_Panel640x480_3;
-	USHORT SiS_Panel1152x864;
-	USHORT SiS_PanelCustom;
-	USHORT SiS_PanelBarco1366;
-	USHORT SiS_PanelMax;
+	USHORT SiS661LCD2TableSize;
+
 	USHORT SiS_PanelMinLVDS;
 	USHORT SiS_PanelMin301;
-	USHORT SiS_ChrontelInit;
-	
+
 	const SiS_StStruct          *SiS_SModeIDTable;
 	SiS_StandTableStruct        *SiS_StandTable;
 	const SiS_ExtStruct         *SiS_EModeIDTable;
@@ -376,11 +365,10 @@ typedef struct _SiS_Private
 	const SiS_CRT1TableStruct   *SiS_CRT1Table;
 	const SiS_MCLKDataStruct    *SiS_MCLKData_0;
 	const SiS_MCLKDataStruct    *SiS_MCLKData_1;
-	const SiS_VCLKDataStruct    *SiS_VCLKData;
-	const SiS_VBVCLKDataStruct  *SiS_VBVCLKData;
+	SiS_VCLKDataStruct    	    *SiS_VCLKData;
+	SiS_VBVCLKDataStruct        *SiS_VBVCLKData;
 	const SiS_StResInfoStruct   *SiS_StResInfo;
 	const SiS_ModeResInfoStruct *SiS_ModeResInfo;
-	const UCHAR                 *SiS_ScreenOffset;
 
 	const UCHAR                 *pSiS_OutputSelect;
 	const UCHAR                 *pSiS_SoftSetting;
@@ -410,6 +398,12 @@ typedef struct _SiS_Private
 	const USHORT *pSiS_VideoSenseData2;
 	const USHORT *pSiS_YCSenseData2;
 #endif
+
+	const SiS_PanelDelayTblStruct *SiS_PanelDelayTbl;
+	const SiS_PanelDelayTblStruct *SiS_PanelDelayTblLVDS;
+
+	/* SiS bridge */
+
 	const UCHAR *SiS_NTSCPhase;
 	const UCHAR *SiS_PALPhase;
 	const UCHAR *SiS_NTSCPhase2;
@@ -421,24 +415,21 @@ typedef struct _SiS_Private
 	const UCHAR *SiS_SpecialPhase;
 	const UCHAR *SiS_SpecialPhaseM;
 	const UCHAR *SiS_SpecialPhaseJ;
-	const SiS_LCDDataStruct  *SiS_StLCD1024x768Data;
 	const SiS_LCDDataStruct  *SiS_ExtLCD1024x768Data;
 	const SiS_LCDDataStruct  *SiS_St2LCD1024x768Data;
-	const SiS_LCDDataStruct  *SiS_StLCD1280x1024Data;
+	const SiS_LCDDataStruct  *SiS_LCD1280x720Data;
+	const SiS_LCDDataStruct  *SiS_StLCD1280x768_2Data;
+	const SiS_LCDDataStruct  *SiS_ExtLCD1280x768_2Data;
+	const SiS_LCDDataStruct  *SiS_LCD1280x768_3Data;
+	const SiS_LCDDataStruct  *SiS_LCD1280x800Data;
+	const SiS_LCDDataStruct  *SiS_LCD1280x960Data;
 	const SiS_LCDDataStruct  *SiS_ExtLCD1280x1024Data;
 	const SiS_LCDDataStruct  *SiS_St2LCD1280x1024Data;
-	const SiS_LCDDataStruct  *SiS_NoScaleData1024x768;
-	const SiS_LCDDataStruct  *SiS_NoScaleData1280x1024;
-	const SiS_LCDDataStruct  *SiS_LCD1280x960Data;
-	const SiS_LCDDataStruct  *SiS_NoScaleData1400x1050;
-	const SiS_LCDDataStruct  *SiS_NoScaleData1600x1200;
-	const SiS_LCDDataStruct  *SiS_NoScaleData1280x768;
 	const SiS_LCDDataStruct  *SiS_StLCD1400x1050Data;
-	const SiS_LCDDataStruct  *SiS_StLCD1600x1200Data;
-	const SiS_LCDDataStruct  *SiS_StLCD1280x768Data;
 	const SiS_LCDDataStruct  *SiS_ExtLCD1400x1050Data;
+	const SiS_LCDDataStruct  *SiS_StLCD1600x1200Data;
 	const SiS_LCDDataStruct  *SiS_ExtLCD1600x1200Data;
-	const SiS_LCDDataStruct  *SiS_ExtLCD1280x768Data;
+	const SiS_LCDDataStruct  *SiS_LCD1680x1050Data;
 	const SiS_LCDDataStruct  *SiS_NoScaleData;
 	const SiS_TVDataStruct   *SiS_StPALData;
 	const SiS_TVDataStruct   *SiS_ExtPALData;
@@ -464,8 +455,16 @@ typedef struct _SiS_Private
 	const UCHAR *SiS_HiTVTextTiming;
 	const UCHAR *SiS_HiTVGroup3Text;
 #endif
-	const SiS_PanelDelayTblStruct *SiS_PanelDelayTbl;
-	const SiS_PanelDelayTblStruct *SiS_PanelDelayTblLVDS;
+
+	const SiS_Part2PortTblStruct *SiS_CRT2Part2_1024x768_1;
+	const SiS_Part2PortTblStruct *SiS_CRT2Part2_1280x1024_1;
+	const SiS_Part2PortTblStruct *SiS_CRT2Part2_1024x768_2;
+	const SiS_Part2PortTblStruct *SiS_CRT2Part2_1280x1024_2;
+	const SiS_Part2PortTblStruct *SiS_CRT2Part2_1024x768_3;
+	const SiS_Part2PortTblStruct *SiS_CRT2Part2_1280x1024_3;
+
+	/* LVDS, Chrontel */
+
 	const SiS_LVDSDataStruct  *SiS_LVDS800x600Data_1;
 	const SiS_LVDSDataStruct  *SiS_LVDS800x600Data_2;
 	const SiS_LVDSDataStruct  *SiS_LVDS1024x768Data_1;
@@ -487,14 +486,6 @@ typedef struct _SiS_Private
 	const SiS_LVDSDataStruct  *SiS_LVDS640x480Data_1;
 	const SiS_LVDSDataStruct  *SiS_LVDS640x480Data_2;
 	const SiS_LVDSDataStruct  *SiS_LVDS320x480Data_1;
-	const SiS_LVDSDataStruct  *SiS_LCDA1024x768Data_1;
-	const SiS_LVDSDataStruct  *SiS_LCDA1024x768Data_2;
-	const SiS_LVDSDataStruct  *SiS_LCDA1280x1024Data_1;
-	const SiS_LVDSDataStruct  *SiS_LCDA1280x1024Data_2;
-	const SiS_LVDSDataStruct  *SiS_LCDA1400x1050Data_1;
-	const SiS_LVDSDataStruct  *SiS_LCDA1400x1050Data_2;
-	const SiS_LVDSDataStruct  *SiS_LCDA1600x1200Data_1;
-	const SiS_LVDSDataStruct  *SiS_LCDA1600x1200Data_2;
 	const SiS_LVDSDataStruct  *SiS_LVDSXXXxXXXData_1;
 	const SiS_LVDSDataStruct  *SiS_LVDSBARCO1366Data_1;
 	const SiS_LVDSDataStruct  *SiS_LVDSBARCO1366Data_2;
@@ -511,6 +502,7 @@ typedef struct _SiS_Private
 	const SiS_LVDSDataStruct  *SiS_CHTVUPALNData;
 	const SiS_LVDSDataStruct  *SiS_CHTVOPALNData;
 	const SiS_LVDSDataStruct  *SiS_CHTVSOPALData;
+
 	const SiS_LVDSDesStruct  *SiS_PanelType00_1;
 	const SiS_LVDSDesStruct  *SiS_PanelType01_1;
 	const SiS_LVDSDesStruct  *SiS_PanelType02_1;
@@ -545,20 +537,11 @@ typedef struct _SiS_Private
 	const SiS_LVDSDesStruct  *SiS_PanelType0e_2;
 	const SiS_LVDSDesStruct  *SiS_PanelType0f_2;
 	const SiS_LVDSDesStruct  *SiS_PanelTypeNS_2;
-
-	const SiS_LVDSDesStruct  *LVDS1024x768Des_1;
-	const SiS_LVDSDesStruct  *LVDS1280x1024Des_1;
-	const SiS_LVDSDesStruct  *LVDS1400x1050Des_1;
-	const SiS_LVDSDesStruct  *LVDS1600x1200Des_1;
-	const SiS_LVDSDesStruct  *LVDS1024x768Des_2;
-	const SiS_LVDSDesStruct  *LVDS1280x1024Des_2;
-	const SiS_LVDSDesStruct  *LVDS1400x1050Des_2;
-	const SiS_LVDSDesStruct  *LVDS1600x1200Des_2;
-
 	const SiS_LVDSDesStruct  *SiS_CHTVUNTSCDesData;
 	const SiS_LVDSDesStruct  *SiS_CHTVONTSCDesData;
 	const SiS_LVDSDesStruct  *SiS_CHTVUPALDesData;
 	const SiS_LVDSDesStruct  *SiS_CHTVOPALDesData;
+
 	const SiS_LVDSCRT1DataStruct  *SiS_LVDSCRT1800x600_1;
 	const SiS_LVDSCRT1DataStruct  *SiS_LVDSCRT11024x768_1;
 	const SiS_LVDSCRT1DataStruct  *SiS_LVDSCRT11280x1024_1;
@@ -599,44 +582,13 @@ typedef struct _SiS_Private
 	const SiS_LVDSCRT1DataStruct  *SiS_LVDSCRT1640x480_2_H;
 	const SiS_LVDSCRT1DataStruct  *SiS_LVDSCRT1640x480_3;
 	const SiS_LVDSCRT1DataStruct  *SiS_LVDSCRT1640x480_3_H;
+	const SiS_LVDSCRT1DataStruct  *SiS_LVDSCRT1320x480_1;
 	const SiS_LVDSCRT1DataStruct  *SiS_CHTVCRT1UNTSC;
 	const SiS_LVDSCRT1DataStruct  *SiS_CHTVCRT1ONTSC;
 	const SiS_LVDSCRT1DataStruct  *SiS_CHTVCRT1UPAL;
 	const SiS_LVDSCRT1DataStruct  *SiS_CHTVCRT1OPAL;
 	const SiS_LVDSCRT1DataStruct  *SiS_CHTVCRT1SOPAL;
 
-	const SiS_LVDSCRT1DataStruct  *SiS_LVDSCRT1320x480_1;
-
-	const SiS_LCDACRT1DataStruct  *SiS_LCDACRT11024x768_1;
-	const SiS_LCDACRT1DataStruct  *SiS_LCDACRT11280x1024_1;
-	const SiS_LCDACRT1DataStruct  *SiS_LCDACRT11400x1050_1;
-	const SiS_LCDACRT1DataStruct  *SiS_LCDACRT11600x1200_1;
-	const SiS_LCDACRT1DataStruct  *SiS_LCDACRT11024x768_1_H;
-	const SiS_LCDACRT1DataStruct  *SiS_LCDACRT11280x1024_1_H;
-	const SiS_LCDACRT1DataStruct  *SiS_LCDACRT11400x1050_1_H;
-	const SiS_LCDACRT1DataStruct  *SiS_LCDACRT11600x1200_1_H;
-	const SiS_LCDACRT1DataStruct  *SiS_LCDACRT11024x768_2;
-	const SiS_LCDACRT1DataStruct  *SiS_LCDACRT11280x1024_2;
-	const SiS_LCDACRT1DataStruct  *SiS_LCDACRT11400x1050_2;
-	const SiS_LCDACRT1DataStruct  *SiS_LCDACRT11600x1200_2;
-	const SiS_LCDACRT1DataStruct  *SiS_LCDACRT11024x768_2_H;
-	const SiS_LCDACRT1DataStruct  *SiS_LCDACRT11280x1024_2_H;
-	const SiS_LCDACRT1DataStruct  *SiS_LCDACRT11400x1050_2_H;
-	const SiS_LCDACRT1DataStruct  *SiS_LCDACRT11600x1200_2_H;
-
-	const SiS_Part2PortTblStruct *SiS_CRT2Part2_1024x768_1;
-	const SiS_Part2PortTblStruct *SiS_CRT2Part2_1280x1024_1;
-	const SiS_Part2PortTblStruct *SiS_CRT2Part2_1400x1050_1;
-	const SiS_Part2PortTblStruct *SiS_CRT2Part2_1600x1200_1;
-	const SiS_Part2PortTblStruct *SiS_CRT2Part2_1024x768_2;
-	const SiS_Part2PortTblStruct *SiS_CRT2Part2_1280x1024_2;
-	const SiS_Part2PortTblStruct *SiS_CRT2Part2_1400x1050_2;
-	const SiS_Part2PortTblStruct *SiS_CRT2Part2_1600x1200_2;
-	const SiS_Part2PortTblStruct *SiS_CRT2Part2_1024x768_3;
-	const SiS_Part2PortTblStruct *SiS_CRT2Part2_1280x1024_3;
-	const SiS_Part2PortTblStruct *SiS_CRT2Part2_1400x1050_3;
-	const SiS_Part2PortTblStruct *SiS_CRT2Part2_1600x1200_3;
-
 	const SiS_CHTVRegDataStruct *SiS_CHTVReg_UNTSC;
 	const SiS_CHTVRegDataStruct *SiS_CHTVReg_ONTSC;
 	const SiS_CHTVRegDataStruct *SiS_CHTVReg_UPAL;
@@ -646,6 +598,7 @@ typedef struct _SiS_Private
 	const SiS_CHTVRegDataStruct *SiS_CHTVReg_UPALN;
 	const SiS_CHTVRegDataStruct *SiS_CHTVReg_OPALN;
 	const SiS_CHTVRegDataStruct *SiS_CHTVReg_SOPAL;
+
 	const UCHAR *SiS_CHTVVCLKUNTSC;
 	const UCHAR *SiS_CHTVVCLKONTSC;
 	const UCHAR *SiS_CHTVVCLKUPAL;
@@ -656,9 +609,13 @@ typedef struct _SiS_Private
 	const UCHAR *SiS_CHTVVCLKOPALN;
 	const UCHAR *SiS_CHTVVCLKSOPAL;
 
-	USHORT  PanelXRes;
-	USHORT  PanelYRes;
-	
+	USHORT  PanelXRes, PanelHT;
+	USHORT  PanelYRes, PanelVT;
+	USHORT  PanelHRS,  PanelHRE;
+  	USHORT 	PanelVRS,  PanelVRE;
+	USHORT  PanelVCLKIdx300;
+	USHORT  PanelVCLKIdx315;
+
 	BOOLEAN UseCustomMode;
 	BOOLEAN CRT1UsesCustomMode;
 	USHORT  CHDisplay;
@@ -700,10 +657,11 @@ typedef struct _SiS_Private
 	UCHAR Backup_1d;
 	
 	int     UsePanelScaler;
+	int	CenterScreen;
 
 	USHORT  CP_Vendor, CP_Product;
 	BOOLEAN CP_HaveCustomData;
-	int     CP_PreferredX, CP_PreferredY;
+	int     CP_PreferredX, CP_PreferredY, CP_PreferredIndex;
 	int	CP_MaxX, CP_MaxY, CP_MaxClock;
 	BOOLEAN CP_Supports64048075;
 	int     CP_HDisplay[7], CP_VDisplay[7];	/* For Custom LCD panel dimensions */
diff --git a/drivers/video/skeletonfb.c b/drivers/video/skeletonfb.c
index 947ddfb84..75ab62945 100644
--- a/drivers/video/skeletonfb.c
+++ b/drivers/video/skeletonfb.c
@@ -539,7 +539,13 @@ int __init xxxfb_init(void)
     info.fbops = &xxxfb_ops;
     info.fix = xxxfb_fix;
     info.pseudo_palette = pseudo_palette;
-    info.flags = FBINFO_FLAG_DEFAULT;
+
+    /*
+     * Set up flags to indicate what sort of acceleration your
+     * driver can provide (pan/wrap/copyarea/etc.) and whether it
+     * is a module -- see FBINFO_* in include/linux/fb.h
+     */
+    info.flags = FBINFO_DEFAULT;
     info.par = current_par;
 
     /*
diff --git a/drivers/video/softcursor.c b/drivers/video/softcursor.c
index 53036f890..a953b467b 100644
--- a/drivers/video/softcursor.c
+++ b/drivers/video/softcursor.c
@@ -43,7 +43,7 @@ int soft_cursor(struct fb_info *info, struct fb_cursor *cursor)
 			info->cursor.image.fg_color = cursor->image.fg_color;
 		} else {
 			if (cursor->image.cmap.len)
-				fb_copy_cmap(&cursor->image.cmap, &info->cursor.image.cmap, 0);
+				fb_copy_cmap(&cursor->image.cmap, &info->cursor.image.cmap);
 		}
 		info->cursor.image.depth = cursor->image.depth;
 	}	
@@ -73,7 +73,12 @@ int soft_cursor(struct fb_info *info, struct fb_cursor *cursor)
 	} else 
 		memcpy(src, cursor->image.data, dsize);
 	
-	fb_move_buf_aligned(info, &info->sprite, dst, d_pitch, src, s_pitch, info->cursor.image.height);
+	if (info->sprite.outbuf)
+		fb_iomove_buf_aligned(info, &info->sprite, dst, d_pitch, src,
+				  s_pitch, info->cursor.image.height);
+	else
+		fb_sysmove_buf_aligned(info, &info->sprite, dst, d_pitch, src,
+				   s_pitch, info->cursor.image.height);
 	info->cursor.image.data = dst;
 	
 	info->fbops->fb_imageblit(info, &info->cursor.image);
diff --git a/drivers/video/sstfb.c b/drivers/video/sstfb.c
index d08d45958..f732dbbf8 100644
--- a/drivers/video/sstfb.c
+++ b/drivers/video/sstfb.c
@@ -349,10 +349,10 @@ static int sst_calc_pll(const int freq, int *freq_out, struct pll_timing *t)
 		if (m >= 128)
 			break;
 		fout = (DAC_FREF * (m + 2)) / ((1 << p) * (n + 2));
-		if ((ABS(fout - freq) < best_err) && (m > 0)) {
+		if ((abs(fout - freq) < best_err) && (m > 0)) {
 			best_n = n;
 			best_m = m;
-			best_err = ABS(fout - freq);
+			best_err = abs(fout - freq);
 			/* we get the lowest m , allowing 0.5% error in freq*/
 			if (200*best_err < freq) break;
 		}
@@ -790,7 +790,7 @@ static int sstfb_ioctl(struct inode *inode, struct file *file,
 		
 	/* fills lfb with #arg pixels */
 	case _IOW('F', 0xdc, u32):	/* 0x46dc */
-		if (copy_from_user(&val, (void *)arg, sizeof(val)))
+		if (copy_from_user(&val, (void __user *)arg, sizeof(val)))
 			return -EFAULT;
 		if (val > info->fix.smem_len)
 			val = info->fix.smem_len;
@@ -801,7 +801,7 @@ static int sstfb_ioctl(struct inode *inode, struct file *file,
 		
 	/* change VGA pass_through mode */
 	case _IOW('F', 0xdd, u32):	/* 0x46dd */
-		if (copy_from_user(&val, (void *)arg, sizeof(val)))
+		if (copy_from_user(&val, (void __user *)arg, sizeof(val)))
 			return -EFAULT;
 		pci_read_config_dword(sst_dev, PCI_INIT_ENABLE, &tmp);
 		pci_write_config_dword(sst_dev, PCI_INIT_ENABLE,
diff --git a/drivers/video/tdfxfb.c b/drivers/video/tdfxfb.c
index 4006cf72e..287387762 100644
--- a/drivers/video/tdfxfb.c
+++ b/drivers/video/tdfxfb.c
@@ -1050,7 +1050,7 @@ static int tdfxfb_cursor(struct fb_info *info, struct fb_cursor *cursor)
 		bg_color = ((cmap.red[cmap.start+1] << 16) |
 			    (cmap.green[cmap.start+1] << 8) |
 			    (cmap.blue[cmap.start+1]));
-		fb_copy_cmap(&cmap, &info->cursor.image.cmap, 0);
+		fb_copy_cmap(&cmap, &info->cursor.image.cmap);
 		spin_lock_irqsave(&par->DAClock, flags);
 		banshee_make_room(par, 2);
 		tdfx_outl(par, HWCURC0, bg_color);
@@ -1101,7 +1101,7 @@ static int tdfxfb_cursor(struct fb_info *info, struct fb_cursor *cursor)
 		 */
 		u8 *cursorbase = (u8 *) info->cursor.image.data;
 		char *bitmap = (char *)cursor->image.data;
-		char *mask = cursor->mask;
+		const char *mask = cursor->mask;
 		int i, j, k, h = 0;
 
 		for (i = 0; i < 64; i++) {
diff --git a/drivers/video/valkyriefb.c b/drivers/video/valkyriefb.c
index e6c486281..fd8eb47a4 100644
--- a/drivers/video/valkyriefb.c
+++ b/drivers/video/valkyriefb.c
@@ -118,9 +118,7 @@ static int valkyriefb_setcolreg(u_int regno, u_int red, u_int green, u_int blue,
 static int valkyriefb_blank(int blank_mode, struct fb_info *info);
 
 static int read_valkyrie_sense(struct fb_info_valkyrie *p);
-static inline int valkyrie_vram_reqd(int video_mode, int color_mode);
 static void set_valkyrie_clock(unsigned char *params);
-static inline int valkyrie_par_to_var(struct fb_par_valkyrie *par, struct fb_var_screeninfo *var);
 static int valkyrie_var_to_par(struct fb_var_screeninfo *var,
 	struct fb_par_valkyrie *par, const struct fb_info *fb_info);
 
@@ -171,6 +169,12 @@ static int valkyriefb_set_par(struct fb_info *info)
 	return 0;
 }
 
+static inline int valkyrie_par_to_var(struct fb_par_valkyrie *par,
+				      struct fb_var_screeninfo *var)
+{
+	return mac_vmode_to_var(par->vmode, par->cmode, var);
+}
+
 static int
 valkyriefb_check_var(struct fb_var_screeninfo *var, struct fb_info *info)
 {
@@ -252,7 +256,7 @@ static int valkyriefb_setcolreg(u_int regno, u_int red, u_int green, u_int blue,
 	return 0;
 }
 
-static int valkyrie_vram_reqd(int video_mode, int color_mode)
+static inline int valkyrie_vram_reqd(int video_mode, int color_mode)
 {
 	int pitch;
 	struct valkyrie_regvals *init = valkyrie_reg_init[video_mode-1];
@@ -504,11 +508,6 @@ static int valkyrie_var_to_par(struct fb_var_screeninfo *var,
 	return 0;
 }
 
-static int valkyrie_par_to_var(struct fb_par_valkyrie *par, struct fb_var_screeninfo *var)
-{
-	return mac_vmode_to_var(par->vmode, par->cmode, var);
-}
-
 static void valkyrie_init_fix(struct fb_fix_screeninfo *fix, struct fb_info_valkyrie *p)
 {
 	memset(fix, 0, sizeof(*fix));
diff --git a/drivers/video/vesafb.c b/drivers/video/vesafb.c
index b8cb97508..15f7f8e47 100644
--- a/drivers/video/vesafb.c
+++ b/drivers/video/vesafb.c
@@ -52,7 +52,7 @@ static int             mtrr      = 1;
 static int	       vram __initdata = 0; /* Set amount of memory to be used */
 static int             pmi_setpal = 0;	/* pmi for palette changes ??? */
 static int             ypan       = 0;  /* 0..nothing, 1..ypan, 2..ywrap */
-static unsigned short  *pmi_base  = 0;
+static unsigned short  *pmi_base  = NULL;
 static void            (*pmi_start)(void);
 static void            (*pmi_pal)(void);
 
@@ -378,7 +378,8 @@ static int __init vesafb_probe(struct device *device)
 	info->fbops = &vesafb_ops;
 	info->var = vesafb_defined;
 	info->fix = vesafb_fix;
-	info->flags = FBINFO_FLAG_DEFAULT;
+	info->flags = FBINFO_FLAG_DEFAULT |
+		(ypan) ? FBINFO_HWACCEL_YPAN : 0;
 
 	if (fb_alloc_cmap(&info->cmap, 256, 0) < 0) {
 		err = -ENXIO;
diff --git a/drivers/video/vga16fb.c b/drivers/video/vga16fb.c
index bdcc8ecef..770681ca6 100644
--- a/drivers/video/vga16fb.c
+++ b/drivers/video/vga16fb.c
@@ -1370,7 +1370,8 @@ int __init vga16fb_init(void)
 	vga16fb.var = vga16fb_defined;
 	vga16fb.fix = vga16fb_fix;
 	vga16fb.par = &vga16_par;
-	vga16fb.flags = FBINFO_FLAG_DEFAULT;
+	vga16fb.flags = FBINFO_FLAG_DEFAULT |
+		FBINFO_HWACCEL_YPAN;
 
 	i = (vga16fb_defined.bits_per_pixel == 8) ? 256 : 16;
 	ret = fb_alloc_cmap(&vga16fb.cmap, i, 0);
diff --git a/drivers/w1/Kconfig b/drivers/w1/Kconfig
index f416b64b6..bdeb028aa 100644
--- a/drivers/w1/Kconfig
+++ b/drivers/w1/Kconfig
@@ -13,7 +13,7 @@ config W1
 
 config W1_MATROX
 	tristate "Matrox G400 transport layer for 1-wire"
-	depends on W1
+	depends on W1 && PCI
 	help
 	  Say Y here if you want to communicate with your 1-wire devices
 	  using Matrox's G400 GPIO pins.
diff --git a/drivers/w1/matrox_w1.c b/drivers/w1/matrox_w1.c
index 55b1faf01..bde17782e 100644
--- a/drivers/w1/matrox_w1.c
+++ b/drivers/w1/matrox_w1.c
@@ -22,8 +22,8 @@
 #include <asm/atomic.h>
 #include <asm/types.h>
 #include <asm/io.h>
-#include <asm/delay.h>
 
+#include <linux/delay.h>
 #include <linux/kernel.h>
 #include <linux/module.h>
 #include <linux/list.h>
diff --git a/drivers/w1/w1.c b/drivers/w1/w1.c
index d956f5e64..4f52422ae 100644
--- a/drivers/w1/w1.c
+++ b/drivers/w1/w1.c
@@ -20,8 +20,8 @@
  */
 
 #include <asm/atomic.h>
-#include <asm/delay.h>
 
+#include <linux/delay.h>
 #include <linux/kernel.h>
 #include <linux/module.h>
 #include <linux/moduleparam.h>
diff --git a/drivers/w1/w1_int.c b/drivers/w1/w1_int.c
index 291a6d1a8..c75e9f717 100644
--- a/drivers/w1/w1_int.c
+++ b/drivers/w1/w1_int.c
@@ -49,7 +49,7 @@ struct w1_master * w1_alloc_dev(u32 id, int slave_count,
 	dev = kmalloc(sizeof(struct w1_master) + sizeof(struct w1_bus_master), GFP_KERNEL);
 	if (!dev) {
 		printk(KERN_ERR
-			"Failed to allocate %d bytes for new w1 device.\n",
+			"Failed to allocate %zd bytes for new w1 device.\n",
 			sizeof(struct w1_master));
 		return NULL;
 	}
diff --git a/drivers/w1/w1_io.c b/drivers/w1/w1_io.c
index 75d538b74..9baacee68 100644
--- a/drivers/w1/w1_io.c
+++ b/drivers/w1/w1_io.c
@@ -20,8 +20,8 @@
  */
 
 #include <asm/io.h>
-#include <asm/delay.h>
 
+#include <linux/delay.h>
 #include <linux/moduleparam.h>
 
 #include "w1.h"
diff --git a/fs/Kconfig b/fs/Kconfig
index 27c901867..a4035fba9 100644
--- a/fs/Kconfig
+++ b/fs/Kconfig
@@ -7,47 +7,14 @@ menu "File systems"
 config EXT2_FS
 	tristate "Second extended fs support"
 	help
-	  This is the de facto standard Linux file system (method to organize
-	  files on a storage device) for hard disks.
-
-	  You want to say Y here, unless you intend to use Linux exclusively
-	  from inside a DOS partition using the UMSDOS file system. The
-	  advantage of the latter is that you can get away without
-	  repartitioning your hard drive (which often implies backing
-	  everything up and restoring afterwards); the disadvantage is that
-	  Linux becomes susceptible to DOS viruses and that UMSDOS is somewhat
-	  slower than ext2fs. Even if you want to run Linux in this fashion,
-	  it might be a good idea to have ext2fs around: it enables you to
-	  read more floppy disks and facilitates the transition to a *real*
-	  Linux partition later. Another (rare) case which doesn't require
-	  ext2fs is a diskless Linux box which mounts all files over the
-	  network using NFS (in this case it's sufficient to say Y to "NFS
-	  file system support" below). Saying Y here will enlarge your kernel
-	  by about 44 KB.
-
-	  The Ext2fs-Undeletion mini-HOWTO, available from
-	  <http://www.tldp.org/docs.html#howto>, gives information about
-	  how to retrieve deleted files on ext2fs file systems.
-
-	  To change the behavior of ext2 file systems, you can use the tune2fs
-	  utility ("man tune2fs"). To modify attributes of files and
-	  directories on ext2 file systems, use chattr ("man chattr").
-
-	  Ext2fs partitions can be read from within DOS using the ext2tool
-	  command line tool package (available from
-	  <ftp://ibiblio.org/pub/Linux/system/filesystems/ext2/>) and from
-	  within Windows NT using the ext2nt command line tool package from
-	  <ftp://ibiblio.org/pub/Linux/utils/dos/>.  Explore2fs is a
-	  graphical explorer for ext2fs partitions which runs on Windows 95
-	  and Windows NT and includes experimental write support; it is
-	  available from
-	  <http://jnewbigin-pc.it.swin.edu.au/Linux/Explore2fs.htm>.
+	  Ext2 is a standard Linux file system for hard disks.
 
 	  To compile this file system support as a module, choose M here: the
 	  module will be called ext2.  Be aware however that the file system
 	  of your root partition (the one containing the directory /) cannot
-	  be compiled as a module, and so this could be dangerous.  Most
-	  everyone wants to say Y here.
+	  be compiled as a module, and so this could be dangerous.
+
+	  If unsure, say Y.
 
 config EXT2_FS_XATTR
 	bool "Ext2 extended attributes"
@@ -575,12 +542,17 @@ config UDF_FS
 
 	  If unsure, say N.
 
+config UDF_NLS
+	bool
+	default y
+	depends on (UDF_FS=m && NLS) || (UDF_FS=y && NLS=y)
+
 endmenu
 
 menu "DOS/FAT/NT Filesystems"
 
 config FAT_FS
-	tristate "DOS FAT fs support"
+	tristate
 	select NLS
 	help
 	  If you want to use one of the FAT-based file systems (the MS-DOS,
@@ -623,7 +595,7 @@ config FAT_FS
 
 config MSDOS_FS
 	tristate "MSDOS fs support"
-	depends on FAT_FS
+	select FAT_FS
 	help
 	  This allows you to mount MSDOS partitions of your hard drive (unless
 	  they are compressed; to access compressed MSDOS partitions under
@@ -652,7 +624,7 @@ config MSDOS_FS
 
 config VFAT_FS
 	tristate "VFAT (Windows-95) fs support"
-	depends on FAT_FS
+	select FAT_FS
 	help
 	  This option provides support for normal Windows file systems with
 	  long filenames.  That includes non-compressed FAT-based file systems
@@ -672,6 +644,25 @@ config VFAT_FS
 	  To compile this as a module, choose M here: the module will be called
 	  vfat.
 
+config FAT_DEFAULT_CODEPAGE
+	int "Default codepage for FAT"
+	depends on MSDOS_FS || VFAT_FS
+	default 437
+	help
+	  This option should be set to the codepage of your FAT filesystems.
+	  It can be overridden with the 'codepage' mount option.
+
+config FAT_DEFAULT_IOCHARSET
+	string "Default iocharset for FAT"
+	depends on VFAT_FS
+	default "iso8859-1"
+	help
+	  Set this to the default I/O character set you'd like FAT to use.
+	  It should probably match the character set that most of your
+	  FAT filesystems use, and can be overridded with the 'iocharset'
+	  mount option for FAT filesystems.  Note that UTF8 is *not* a
+	  supported charset for FAT filesystems.
+
 config UMSDOS_FS
 #dep_tristate '    UMSDOS: Unix-like file system on top of standard MSDOS fs' CONFIG_UMSDOS_FS $CONFIG_MSDOS_FS
 # UMSDOS is temprory broken
@@ -1106,17 +1097,15 @@ config JFFS_FS_VERBOSE
 
 config JFFS_PROC_FS
 	bool "JFFS stats available in /proc filesystem"
-	depends on JFFS_FS && PROC
+	depends on JFFS_FS && PROC_FS
 	help
 	  Enabling this option will cause statistics from mounted JFFS file systems
 	  to be made available to the user in the /proc/fs/jffs/ directory.
 
 config JFFS2_FS
 	tristate "Journalling Flash File System v2 (JFFS2) support"
-	depends on MTD
 	select CRC32
-	select ZLIB_INFLATE
-	select ZLIB_DEFLATE
+	depends on MTD
 	help
 	  JFFS2 is the second generation of the Journalling Flash File System
 	  for use on diskless embedded devices. It provides improved wear
@@ -1144,21 +1133,84 @@ config JFFS2_FS_DEBUG
 	  messages at debug level 1 while the misbehaviour was occurring.
 
 config JFFS2_FS_NAND
-	bool "JFFS2 support for NAND flash (EXPERIMENTAL)"
-	depends on JFFS2_FS && EXPERIMENTAL
+	bool "JFFS2 support for NAND flash"
+	depends on JFFS2_FS
+	default n
+	help
+	  This enables the support for NAND flash in JFFS2. NAND is a newer
+	  type of flash chip design than the traditional NOR flash, with
+	  higher density but a handful of characteristics which make it more
+	  interesting for the file system to use.
+
+	  Say 'N' unless you have NAND flash.
+
+config JFFS2_COMPRESSION_OPTIONS
+	bool "Advanced compression options for JFFS2"
+	depends on JFFS2_FS
 	default n
 	help
-	  This enables the experimental support for NAND flash in JFFS2. NAND
-	  is a newer type of flash chip design than the traditional NOR flash,
-	  with higher density but a handful of characteristics which make it
-	  more interesting for the file system to use. Support for NAND flash
-	  is not yet complete and may corrupt data. For further information,
-	  including a link to the mailing list where details of the remaining
-	  work to be completed for NAND flash support can be found, see the 
-	  JFFS2 web site at <http://sources.redhat.com/jffs2>.
+	  Enabling this option allows you to explicitly choose which
+	  compression modules, if any, are enabled in JFFS2. Removing
+	  compressors and mean you cannot read existing file systems,
+	  and enabling experimental compressors can mean that you
+	  write a file system which cannot be read by a standard kernel.
 
-	  Say 'N' unless you have NAND flash and you are willing to test and
-	  develop JFFS2 support for it.
+	  If unsure, you should _definitely_ say 'N'.
+
+config JFFS2_ZLIB
+	bool "JFFS2 ZLIB compression support" if JFFS2_COMPRESSION_OPTIONS
+	select ZLIB_INFLATE
+	select ZLIB_DEFLATE
+	depends on JFFS2_FS
+	default y
+        help
+          Zlib is designed to be a free, general-purpose, legally unencumbered,
+          lossless data-compression library for use on virtually any computer 
+          hardware and operating system. See http://www.gzip.org/zlib/ for
+          further information.
+          
+          Say 'Y' if unsure.
+
+config JFFS2_RTIME
+	bool "JFFS2 RTIME compression support" if JFFS2_COMPRESSION_OPTIONS
+	depends on JFFS2_FS
+	default y
+        help
+          Rtime does manage to recompress already-compressed data. Say 'Y' if unsure.
+
+config JFFS2_RUBIN
+	bool "JFFS2 RUBIN compression support" if JFFS2_COMPRESSION_OPTIONS
+	depends on JFFS2_FS
+	default n
+        help
+          RUBINMIPS and DYNRUBIN compressors. Say 'N' if unsure.
+
+choice
+        prompt "JFFS2 default compression mode" if JFFS2_COMPRESSION_OPTIONS
+        default JFFS2_CMODE_PRIORITY
+        depends on JFFS2_FS
+        help
+          You can set here the default compression mode of JFFS2 from 
+          the avaiable compression modes. Don't touch if unsure.
+
+config JFFS2_CMODE_NONE
+        bool "no compression"
+        help
+          Uses no compression.
+
+config JFFS2_CMODE_PRIORITY
+        bool "priority"
+        help
+          Tries the compressors in a predefinied order and chooses the first 
+          successful one.
+
+config JFFS2_CMODE_SIZE
+        bool "size (EXPERIMENTAL)"
+        help
+          Tries all compressors and chooses the one which has the smallest 
+          result.
+
+endchoice
 
 config CRAMFS
 	tristate "Compressed ROM file system support"
@@ -1450,11 +1502,13 @@ config NFSD_V4
 	  If unsure, say N.
 
 config NFSD_TCP
-	bool "Provide NFS server over TCP support (EXPERIMENTAL)"
-	depends on NFSD && EXPERIMENTAL
+	bool "Provide NFS server over TCP support"
+	depends on NFSD
+	default y
 	help
-	  Enable NFS service over TCP connections.  This the officially
-	  still experimental, but seems to work well.
+	  If you want your NFS server to support TCP connections, say Y here.
+	  TCP connections usually perform better than the default UDP when
+	  the network is lossy or congested.  If unsure, say Y.
 
 config ROOT_NFS
 	bool "Root file system on NFS"
@@ -1562,7 +1616,7 @@ config SMB_NLS_REMOTE
 	  smbmount from samba 2.2.0 or later supports this.
 
 config CIFS
-	tristate "CIFS support (advanced network filesystem for Samba, Window and other CIFS compliant servers)(EXPERIMENTAL)"
+	tristate "CIFS support (advanced network filesystem for Samba, Window and other CIFS compliant servers)"
 	depends on INET
 	select NLS
 	help
@@ -1592,7 +1646,32 @@ config CIFS_STATS
         depends on CIFS
         help
           Enabling this option will cause statistics for each server share
-	  mounted by the cifs client to be displayed in /proc/fs/cifs/DebugData
+	  mounted by the cifs client to be displayed in /proc/fs/cifs/Stats
+
+config CIFS_XATTR
+        bool "CIFS extended attributes (EXPERIMENTAL)"
+        depends on CIFS
+        help
+          Extended attributes are name:value pairs associated with inodes by
+          the kernel or by users (see the attr(5) manual page, or visit
+          <http://acl.bestbits.at/> for details).  CIFS maps the name of
+          extended attributes beginning with the user namespace prefix
+          to SMB/CIFS EAs. EAs are stored on Windows servers without the
+          user namespace prefix, but their names are seen by Linux cifs clients
+          prefaced by the user namespace prefix. The system namespace
+          (used by some filesystems to store ACLs) is not supported at
+          this time.
+                                                                                                    
+          If unsure, say N.
+
+config CIFS_POSIX
+        bool "CIFS POSIX Extensions (EXPERIMENTAL)"
+        depends on CIFS
+        help
+          Enabling this option will cause the cifs client to attempt to
+	  negotiate a newer dialect with servers, such as Samba 3.0.5
+	  or later, that optionally can handle more POSIX like (rather
+	  than Windows like) file behavior.  If unsure, say N.
 
 config NCP_FS
 	tristate "NCP file system support (to mount NetWare volumes)"
diff --git a/fs/affs/amigaffs.c b/fs/affs/amigaffs.c
index b5d1aabf1..17a4bfbb1 100644
--- a/fs/affs/amigaffs.c
+++ b/fs/affs/amigaffs.c
@@ -201,7 +201,7 @@ affs_remove_link(struct dentry *dentry)
 			goto done;
 	}
 
-	while ((ino = be32_to_cpu(AFFS_TAIL(sb, bh)->link_chain))) {
+	while ((ino = be32_to_cpu(AFFS_TAIL(sb, bh)->link_chain)) != 0) {
 		if (ino == link_ino) {
 			ino = AFFS_TAIL(sb, link_bh)->link_chain;
 			AFFS_TAIL(sb, bh)->link_chain = ino;
@@ -458,7 +458,6 @@ affs_error(struct super_block *sb, const char *function, const char *fmt, ...)
 	if (!(sb->s_flags & MS_RDONLY))
 		printk(KERN_WARNING "AFFS: Remounting filesystem read-only\n");
 	sb->s_flags |= MS_RDONLY;
-	AFFS_SB(sb)->s_flags |= SF_READONLY;	/* Don't allow to remount rw */
 }
 
 void
diff --git a/fs/affs/bitmap.c b/fs/affs/bitmap.c
index 095ef77a4..93d32d18e 100644
--- a/fs/affs/bitmap.c
+++ b/fs/affs/bitmap.c
@@ -272,8 +272,7 @@ err_full:
 	return 0;
 }
 
-int
-affs_init_bitmap(struct super_block *sb)
+int affs_init_bitmap(struct super_block *sb, int *flags)
 {
 	struct affs_bm_info *bm;
 	struct buffer_head *bmap_bh = NULL, *bh = NULL;
@@ -282,13 +281,13 @@ affs_init_bitmap(struct super_block *sb)
 	int i, res = 0;
 	struct affs_sb_info *sbi = AFFS_SB(sb);
 
-	if (sb->s_flags & MS_RDONLY)
+	if (*flags & MS_RDONLY)
 		return 0;
 
 	if (!AFFS_ROOT_TAIL(sb, sbi->s_root_bh)->bm_flag) {
 		printk(KERN_NOTICE "AFFS: Bitmap invalid - mounting %s read only\n",
 			sb->s_id);
-		sb->s_flags |= MS_RDONLY;
+		*flags |= MS_RDONLY;
 		return 0;
 	}
 
@@ -301,7 +300,7 @@ affs_init_bitmap(struct super_block *sb)
 	bm = sbi->s_bitmap = kmalloc(size, GFP_KERNEL);
 	if (!sbi->s_bitmap) {
 		printk(KERN_ERR "AFFS: Bitmap allocation failed\n");
-		return 1;
+		return -ENOMEM;
 	}
 	memset(sbi->s_bitmap, 0, size);
 
@@ -316,13 +315,13 @@ affs_init_bitmap(struct super_block *sb)
 		bh = affs_bread(sb, bm->bm_key);
 		if (!bh) {
 			printk(KERN_ERR "AFFS: Cannot read bitmap\n");
-			res = 1;
+			res = -EIO;
 			goto out;
 		}
 		if (affs_checksum_block(sb, bh)) {
 			printk(KERN_WARNING "AFFS: Bitmap %u invalid - mounting %s read only.\n",
 			       bm->bm_key, sb->s_id);
-			sb->s_flags |= MS_RDONLY;
+			*flags |= MS_RDONLY;
 			goto out;
 		}
 		pr_debug("AFFS: read bitmap block %d: %d\n", blk, bm->bm_key);
@@ -338,7 +337,7 @@ affs_init_bitmap(struct super_block *sb)
 		bmap_bh = affs_bread(sb, be32_to_cpu(bmap_blk[blk]));
 		if (!bmap_bh) {
 			printk(KERN_ERR "AFFS: Cannot read bitmap extension\n");
-			res = 1;
+			res = -EIO;
 			goto out;
 		}
 		bmap_blk = (u32 *)bmap_bh->b_data;
@@ -383,3 +382,17 @@ out:
 	affs_brelse(bmap_bh);
 	return res;
 }
+
+void affs_free_bitmap(struct super_block *sb)
+{
+	struct affs_sb_info *sbi = AFFS_SB(sb);
+
+	if (!sbi->s_bitmap)
+		return;
+
+	affs_brelse(sbi->s_bmap_bh);
+	sbi->s_bmap_bh = NULL;
+	sbi->s_last_bmap = ~0;
+	kfree(sbi->s_bitmap);
+	sbi->s_bitmap = NULL;
+}
diff --git a/fs/affs/inode.c b/fs/affs/inode.c
index 37aca8f80..f94afc028 100644
--- a/fs/affs/inode.c
+++ b/fs/affs/inode.c
@@ -249,7 +249,7 @@ affs_notify_change(struct dentry *dentry, struct iattr *attr)
 		goto out;
 	}
 
-	inode_setattr(inode, attr);
+	error = inode_setattr(inode, attr);
 	if (!error && (attr->ia_valid & ATTR_MODE))
 		mode_to_prot(inode);
 out:
diff --git a/fs/affs/super.c b/fs/affs/super.c
index ad83ec3a9..f4ebbd27e 100644
--- a/fs/affs/super.c
+++ b/fs/affs/super.c
@@ -51,10 +51,9 @@ affs_put_super(struct super_block *sb)
 		mark_buffer_dirty(sbi->s_root_bh);
 	}
 
-	affs_brelse(sbi->s_bmap_bh);
 	if (sbi->s_prefix)
 		kfree(sbi->s_prefix);
-	kfree(sbi->s_bitmap);
+	affs_free_bitmap(sb);
 	affs_brelse(sbi->s_root_bh);
 	kfree(sbi);
 	sb->s_fs_info = NULL;
@@ -288,6 +287,7 @@ static int affs_fill_super(struct super_block *sb, void *data, int silent)
 	gid_t			 gid;
 	int			 reserved;
 	unsigned long		 mount_flags;
+	int			 tmp_flags;	/* fix remount prototype... */
 
 	pr_debug("AFFS: read_super(%s)\n",data ? (const char *)data : "no options");
 
@@ -399,7 +399,6 @@ got_root:
 		printk(KERN_NOTICE "AFFS: Dircache FS - mounting %s read only\n",
 			sb->s_id);
 		sb->s_flags |= MS_RDONLY;
-		sbi->s_flags |= SF_READONLY;
 	}
 	switch (chksum) {
 		case MUFS_FS:
@@ -455,8 +454,10 @@ got_root:
 	sbi->s_root_bh = root_bh;
 	/* N.B. after this point s_root_bh must be released */
 
-	if (affs_init_bitmap(sb))
+	tmp_flags = sb->s_flags;
+	if (affs_init_bitmap(sb, &tmp_flags))
 		goto out_error;
+	sb->s_flags = tmp_flags;
 
 	/* set up enough so that it can read an inode */
 
@@ -498,7 +499,7 @@ affs_remount(struct super_block *sb, int *flags, char *data)
 	int			 reserved;
 	int			 root_block;
 	unsigned long		 mount_flags;
-	unsigned long		 read_only = sbi->s_flags & SF_READONLY;
+	int			 res = 0;
 
 	pr_debug("AFFS: remount(flags=0x%x,opts=\"%s\")\n",*flags,data);
 
@@ -507,7 +508,7 @@ affs_remount(struct super_block *sb, int *flags, char *data)
 	if (!parse_options(data,&uid,&gid,&mode,&reserved,&root_block,
 	    &blocksize,&sbi->s_prefix,sbi->s_volume,&mount_flags))
 		return -EINVAL;
-	sbi->s_flags = mount_flags | read_only;
+	sbi->s_flags = mount_flags;
 	sbi->s_mode  = mode;
 	sbi->s_uid   = uid;
 	sbi->s_gid   = gid;
@@ -518,14 +519,11 @@ affs_remount(struct super_block *sb, int *flags, char *data)
 		sb->s_dirt = 1;
 		while (sb->s_dirt)
 			affs_write_super(sb);
-		sb->s_flags |= MS_RDONLY;
-	} else if (!(sbi->s_flags & SF_READONLY)) {
-		sb->s_flags &= ~MS_RDONLY;
-	} else {
-		affs_warning(sb,"remount","Cannot remount fs read/write because of errors");
-		return -EINVAL;
-	}
-	return 0;
+		affs_free_bitmap(sb);
+	} else
+		res = affs_init_bitmap(sb, flags);
+
+	return res;
 }
 
 static int
diff --git a/fs/affs/symlink.c b/fs/affs/symlink.c
index c01cd4c64..4ef626e49 100644
--- a/fs/affs/symlink.c
+++ b/fs/affs/symlink.c
@@ -78,7 +78,8 @@ struct address_space_operations affs_symlink_aops = {
 };
 
 struct inode_operations affs_symlink_inode_operations = {
-	.readlink	= page_readlink,
-	.follow_link	= page_follow_link,
+	.readlink	= generic_readlink,
+	.follow_link	= page_follow_link_light,
+	.put_link	= page_put_link,
 	.setattr	= affs_notify_change,
 };
diff --git a/fs/afs/cmservice.c b/fs/afs/cmservice.c
index 289489da3..1f968366e 100644
--- a/fs/afs/cmservice.c
+++ b/fs/afs/cmservice.c
@@ -307,10 +307,8 @@ int afscm_start(void)
 		if (ret < 0)
 			goto kill;
 
-#ifdef AFS_AUTOMOUNT_SUPPORT
 		afs_kafstimod_add_timer(&afs_mntpt_expiry_timer,
 					afs_mntpt_expiry_timeout * HZ);
-#endif
 	}
 
 	afscm_usage++;
@@ -392,9 +390,7 @@ void afscm_stop(void)
 		}
 		spin_unlock(&kafscmd_attention_lock);
 
-#ifdef AFS_AUTOMOUNT_SUPPORT
 		afs_kafstimod_del_timer(&afs_mntpt_expiry_timer);
-#endif
 	}
 
 	up_write(&afscm_sem);
diff --git a/fs/afs/fsclient.c b/fs/afs/fsclient.c
index 911496eb4..e6377cea6 100644
--- a/fs/afs/fsclient.c
+++ b/fs/afs/fsclient.c
@@ -59,7 +59,7 @@ int afs_rxfs_get_root_volume(struct afs_server *server,
 {
 	struct rxrpc_connection *conn;
 	struct rxrpc_call *call;
-	struct iovec piov[2];
+	struct kvec piov[2];
 	size_t sent;
 	int ret;
 	u32 param[1];
@@ -189,7 +189,7 @@ int afs_rxfs_get_volume_info(struct afs_server *server,
 {
 	struct rxrpc_connection *conn;
 	struct rxrpc_call *call;
-	struct iovec piov[3];
+	struct kvec piov[3];
 	size_t sent;
 	int ret;
 	u32 param[2], *bp, zero;
@@ -304,7 +304,7 @@ int afs_rxfs_fetch_file_status(struct afs_server *server,
 {
 	struct afs_server_callslot callslot;
 	struct rxrpc_call *call;
-	struct iovec piov[1];
+	struct kvec piov[1];
 	size_t sent;
 	int ret;
 	u32 *bp;
@@ -429,7 +429,7 @@ int afs_rxfs_fetch_file_data(struct afs_server *server,
 {
 	struct afs_server_callslot callslot;
 	struct rxrpc_call *call;
-	struct iovec piov[1];
+	struct kvec piov[1];
 	size_t sent;
 	int ret;
 	u32 *bp;
@@ -580,7 +580,7 @@ int afs_rxfs_give_up_callback(struct afs_server *server,
 {
 	struct afs_server_callslot callslot;
 	struct rxrpc_call *call;
-	struct iovec piov[1];
+	struct kvec piov[1];
 	size_t sent;
 	int ret;
 	u32 *bp;
@@ -686,7 +686,7 @@ int afs_rxfs_lookup(struct afs_server *server,
 {
 	struct rxrpc_connection *conn;
 	struct rxrpc_call *call;
-	struct iovec piov[3];
+	struct kvec piov[3];
 	size_t sent;
 	int ret;
 	u32 *bp, zero;
diff --git a/fs/afs/internal.h b/fs/afs/internal.h
index 11ef8c556..f09860b45 100644
--- a/fs/afs/internal.h
+++ b/fs/afs/internal.h
@@ -107,11 +107,9 @@ extern struct cachefs_netfs afs_cache_netfs;
  */
 extern struct inode_operations afs_mntpt_inode_operations;
 extern struct file_operations afs_mntpt_file_operations;
-#ifdef AFS_AUTOMOUNT_SUPPORT
 extern struct afs_timer afs_mntpt_expiry_timer;
 extern struct afs_timer_ops afs_mntpt_expiry_timer_ops;
 extern unsigned long afs_mntpt_expiry_timeout;
-#endif
 
 extern int afs_mntpt_check_symlink(struct afs_vnode *vnode);
 
diff --git a/fs/afs/mntpt.c b/fs/afs/mntpt.c
index 3a36a3ca5..8b5c1e2e5 100644
--- a/fs/afs/mntpt.c
+++ b/fs/afs/mntpt.c
@@ -30,10 +30,7 @@ static struct dentry *afs_mntpt_lookup(struct inode *dir,
 				       struct dentry *dentry,
 				       struct nameidata *nd);
 static int afs_mntpt_open(struct inode *inode, struct file *file);
-
-#ifdef AFS_AUTOMOUNT_SUPPORT
 static int afs_mntpt_follow_link(struct dentry *dentry, struct nameidata *nd);
-#endif
 
 struct file_operations afs_mntpt_file_operations = {
 	.open		= afs_mntpt_open,
@@ -41,14 +38,11 @@ struct file_operations afs_mntpt_file_operations = {
 
 struct inode_operations afs_mntpt_inode_operations = {
 	.lookup		= afs_mntpt_lookup,
-#ifdef AFS_AUTOMOUNT_SUPPORT
 	.follow_link	= afs_mntpt_follow_link,
-#endif
 	.readlink	= page_readlink,
 	.getattr	= afs_inode_getattr,
 };
 
-#ifdef AFS_AUTOMOUNT_SUPPORT
 static LIST_HEAD(afs_vfsmounts);
 
 static void afs_mntpt_expiry_timed_out(struct afs_timer *timer);
@@ -60,7 +54,6 @@ struct afs_timer_ops afs_mntpt_expiry_timer_ops = {
 struct afs_timer afs_mntpt_expiry_timer;
 
 unsigned long afs_mntpt_expiry_timeout = 20;
-#endif
 
 /*****************************************************************************/
 /*
@@ -156,7 +149,6 @@ static int afs_mntpt_open(struct inode *inode, struct file *file)
 	return -EREMOTE;
 } /* end afs_mntpt_open() */
 
-#ifdef AFS_AUTOMOUNT_SUPPORT
 /*****************************************************************************/
 /*
  * create a vfsmount to be automounted
@@ -168,6 +160,7 @@ static struct vfsmount *afs_mntpt_do_automount(struct dentry *mntpt)
 	struct page *page = NULL;
 	size_t size;
 	char *buf, *devname = NULL, *options = NULL;
+	filler_t *filler;
 	int ret;
 
 	kenter("{%s}", mntpt->d_name.name);
@@ -189,7 +182,7 @@ static struct vfsmount *afs_mntpt_do_automount(struct dentry *mntpt)
 		goto error;
 
 	/* read the contents of the AFS special symlink */
-	filler_t *filler = mntpt->d_inode->i_mapping->a_ops->readpage;
+	filler = (filler_t *)mntpt->d_inode->i_mapping->a_ops->readpage;
 
 	page = read_cache_page(mntpt->d_inode->i_mapping, 0, filler, NULL);
 	if (IS_ERR(page)) {
@@ -257,7 +250,7 @@ static int afs_mntpt_follow_link(struct dentry *dentry, struct nameidata *nd)
 	if (IS_ERR(newmnt))
 		return PTR_ERR(newmnt);
 
-	struct_cpy(&newnd, nd);
+	newnd = *nd;
 	newnd.dentry = dentry;
 	err = do_add_mount(newmnt, &newnd, 0, &afs_vfsmounts);
 
@@ -288,4 +281,3 @@ static void afs_mntpt_expiry_timed_out(struct afs_timer *timer)
 
 	kleave("");
 } /* end afs_mntpt_expiry_timed_out() */
-#endif
diff --git a/fs/afs/super.c b/fs/afs/super.c
index bcf81d358..d6fa8e599 100644
--- a/fs/afs/super.c
+++ b/fs/afs/super.c
@@ -78,9 +78,7 @@ int __init afs_fs_init(void)
 
 	_enter("");
 
-#ifdef AFS_AUTOMOUNT_SUPPORT
 	afs_timer_init(&afs_mntpt_expiry_timer, &afs_mntpt_expiry_timer_ops);
-#endif
 
 	/* create ourselves an inode cache */
 	atomic_set(&afs_count_active_inodes, 0);
@@ -172,7 +170,7 @@ static int afs_super_parse_options(struct afs_mount_params *params,
 	options[PAGE_SIZE - 1] = 0;
 
 	ret = 0;
-	while ((key = strsep(&options, ",")))
+	while ((key = strsep(&options, ",")) != 0)
 	{
 		value = strchr(key, '=');
 		if (value)
diff --git a/fs/afs/vlclient.c b/fs/afs/vlclient.c
index 1a76f15cb..6a663cedd 100644
--- a/fs/afs/vlclient.c
+++ b/fs/afs/vlclient.c
@@ -97,7 +97,7 @@ int afs_rxvl_probe(struct afs_server *server, int alloc_flags)
 {
 	struct rxrpc_connection *conn;
 	struct rxrpc_call *call;
-	struct iovec piov[1];
+	struct kvec piov[1];
 	size_t sent;
 	int ret;
 	u32 param[1];
@@ -187,7 +187,7 @@ int afs_rxvl_get_entry_by_name(struct afs_server *server,
 
 	struct rxrpc_connection *conn;
 	struct rxrpc_call *call;
-	struct iovec piov[3];
+	struct kvec piov[3];
 	unsigned tmp;
 	size_t sent;
 	int ret, loop;
@@ -322,7 +322,7 @@ int afs_rxvl_get_entry_by_id(struct afs_server *server,
 
 	struct rxrpc_connection *conn;
 	struct rxrpc_call *call;
-	struct iovec piov[1];
+	struct kvec piov[1];
 	unsigned tmp;
 	size_t sent;
 	int ret, loop;
@@ -459,7 +459,7 @@ int afs_rxvl_get_entry_by_id_async(struct afs_async_op *op,
 {
 	struct rxrpc_connection *conn;
 	struct rxrpc_call *call;
-	struct iovec piov[1];
+	struct kvec piov[1];
 	size_t sent;
 	int ret;
 	u32 param[3];
diff --git a/fs/afs/vlocation.c b/fs/afs/vlocation.c
index 9cff6b687..c7396ca08 100644
--- a/fs/afs/vlocation.c
+++ b/fs/afs/vlocation.c
@@ -906,7 +906,7 @@ static cachefs_match_val_t afs_vlocation_cache_match(void *target,
 		if (!vlocation->valid ||
 		    vlocation->vldb.rtime == vldb->rtime
 		    ) {
-			struct_cpy(&vlocation->vldb, vldb);
+			vlocation->vldb = *vldb;
 			vlocation->valid = 1;
 			_leave(" = SUCCESS [c->m]");
 			return CACHEFS_MATCH_SUCCESS;
@@ -947,7 +947,7 @@ static void afs_vlocation_cache_update(void *source, void *entry)
 
 	_enter("");
 
-	struct_cpy(vldb,&vlocation->vldb);
+	*vldb = vlocation->vldb;
 
 } /* end afs_vlocation_cache_update() */
 #endif
diff --git a/fs/aio.c b/fs/aio.c
index 6249313ce..9e7b5928e 100644
--- a/fs/aio.c
+++ b/fs/aio.c
@@ -27,6 +27,7 @@
 #include <linux/aio.h>
 #include <linux/highmem.h>
 #include <linux/workqueue.h>
+#include <linux/security.h>
 
 #include <asm/kmap_types.h>
 #include <asm/uaccess.h>
@@ -395,6 +396,8 @@ static struct kiocb fastcall *__aio_get_req(struct kioctx *ctx)
 	req->ki_cancel = NULL;
 	req->ki_retry = NULL;
 	req->ki_obj.user = NULL;
+	req->ki_dtor = NULL;
+	req->private = NULL;
 
 	/* Check if the completion queue has enough free space to
 	 * accept an event from this io.
@@ -435,9 +438,13 @@ static inline struct kiocb *aio_get_req(struct kioctx *ctx)
 
 static inline void really_put_req(struct kioctx *ctx, struct kiocb *req)
 {
+	if (req->ki_dtor)
+		req->ki_dtor(req);
 	req->ki_ctx = NULL;
 	req->ki_filp = NULL;
 	req->ki_obj.user = NULL;
+	req->ki_dtor = NULL;
+	req->private = NULL;
 	kmem_cache_free(kiocb_cachep, req);
 	ctx->reqs_active--;
 
@@ -617,6 +624,7 @@ void fastcall kick_iocb(struct kiocb *iocb)
 		queue_work(aio_wq, &ctx->wq);
 	}
 }
+EXPORT_SYMBOL(kick_iocb);
 
 /* aio_complete
  *	Called when the io request on the given iocb is complete.
@@ -1036,6 +1044,9 @@ int fastcall io_submit_one(struct kioctx *ctx, struct iocb __user *user_iocb,
 		ret = -EFAULT;
 		if (unlikely(!access_ok(VERIFY_WRITE, buf, iocb->aio_nbytes)))
 			goto out_put_req;
+		ret = security_file_permission (file, MAY_READ);
+		if (ret)
+			goto out_put_req;
 		ret = -EINVAL;
 		if (file->f_op->aio_read)
 			ret = file->f_op->aio_read(req, buf,
@@ -1048,6 +1059,9 @@ int fastcall io_submit_one(struct kioctx *ctx, struct iocb __user *user_iocb,
 		ret = -EFAULT;
 		if (unlikely(!access_ok(VERIFY_READ, buf, iocb->aio_nbytes)))
 			goto out_put_req;
+		ret = security_file_permission (file, MAY_WRITE);
+		if (ret)
+			goto out_put_req;
 		ret = -EINVAL;
 		if (file->f_op->aio_write)
 			ret = file->f_op->aio_write(req, buf,
diff --git a/fs/attr.c b/fs/attr.c
index 34dcb1a87..89e03f7bb 100644
--- a/fs/attr.c
+++ b/fs/attr.c
@@ -14,6 +14,9 @@
 #include <linux/fcntl.h>
 #include <linux/quotaops.h>
 #include <linux/security.h>
+#include <linux/vs_base.h>
+#include <linux/proc_fs.h>
+#include <linux/devpts_fs.h>
 
 /* Taken over from the old code... */
 
@@ -35,7 +38,8 @@ int inode_change_ok(struct inode *inode, struct iattr *attr)
 
 	/* Make sure caller can chgrp. */
 	if ((ia_valid & ATTR_GID) &&
-	    (!in_group_p(attr->ia_gid) && attr->ia_gid != inode->i_gid) &&
+	    (current->fsuid != inode->i_uid ||
+	    (!in_group_p(attr->ia_gid) && attr->ia_gid != inode->i_gid)) &&
 	    !capable(CAP_CHOWN))
 		goto error;
 
@@ -54,6 +58,31 @@ int inode_change_ok(struct inode *inode, struct iattr *attr)
 		if (current->fsuid != inode->i_uid && !capable(CAP_FOWNER))
 			goto error;
 	}
+
+	/* Check for evil vserver activity */
+	if (vx_check(0, VX_ADMIN))
+		goto fine;
+
+	if (IS_BARRIER(inode)) {
+		printk(KERN_WARNING
+			"VSW: xid=%d messing with the barrier.\n",
+			vx_current_xid());
+		goto error;
+	}
+	switch (inode->i_sb->s_magic) {
+		case PROC_SUPER_MAGIC:
+			printk(KERN_WARNING
+				"VSW: xid=%d messing with the procfs.\n",
+				vx_current_xid());
+			goto error;
+		case DEVPTS_SUPER_MAGIC:
+			if (vx_check(inode->i_xid, VX_IDENT))
+				goto fine;
+			printk(KERN_WARNING
+				"VSW: xid=%d messing with the devpts.\n",
+				vx_current_xid());
+			goto error;	
+	}
 fine:
 	retval = 0;
 error:
diff --git a/fs/autofs/root.c b/fs/autofs/root.c
index 74ad37a84..563706176 100644
--- a/fs/autofs/root.c
+++ b/fs/autofs/root.c
@@ -468,7 +468,7 @@ static int autofs_root_mkdir(struct inode *dir, struct dentry *dentry, int mode)
 
 /* Get/set timeout ioctl() operation */
 static inline int autofs_get_set_timeout(struct autofs_sb_info *sbi,
-					 unsigned long *p)
+					 unsigned long __user *p)
 {
 	unsigned long ntimeout;
 
@@ -485,7 +485,7 @@ static inline int autofs_get_set_timeout(struct autofs_sb_info *sbi,
 }
 
 /* Return protocol version */
-static inline int autofs_get_protover(int *p)
+static inline int autofs_get_protover(int __user *p)
 {
 	return put_user(AUTOFS_PROTO_VERSION, p);
 }
@@ -494,7 +494,7 @@ static inline int autofs_get_protover(int *p)
 static inline int autofs_expire_run(struct super_block *sb,
 				    struct autofs_sb_info *sbi,
 				    struct vfsmount *mnt,
-				    struct autofs_packet_expire *pkt_p)
+				    struct autofs_packet_expire __user *pkt_p)
 {
 	struct autofs_dir_ent *ent;
 	struct autofs_packet_expire pkt;
@@ -526,6 +526,7 @@ static int autofs_root_ioctl(struct inode *inode, struct file *filp,
 			     unsigned int cmd, unsigned long arg)
 {
 	struct autofs_sb_info *sbi = autofs_sbi(inode->i_sb);
+	void __user *argp = (void __user *)arg;
 
 	DPRINTK(("autofs_ioctl: cmd = 0x%08x, arg = 0x%08lx, sbi = %p, pgrp = %u\n",cmd,arg,sbi,process_group(current)));
 
@@ -545,12 +546,12 @@ static int autofs_root_ioctl(struct inode *inode, struct file *filp,
 		autofs_catatonic_mode(sbi);
 		return 0;
 	case AUTOFS_IOC_PROTOVER: /* Get protocol version */
-		return autofs_get_protover((int *)arg);
+		return autofs_get_protover(argp);
 	case AUTOFS_IOC_SETTIMEOUT:
-		return autofs_get_set_timeout(sbi,(unsigned long *)arg);
+		return autofs_get_set_timeout(sbi, argp);
 	case AUTOFS_IOC_EXPIRE:
 		return autofs_expire_run(inode->i_sb, sbi, filp->f_vfsmnt,
-					 (struct autofs_packet_expire *)arg);
+					 argp);
 	default:
 		return -ENOSYS;
 	}
diff --git a/fs/autofs/symlink.c b/fs/autofs/symlink.c
index 237a6305a..f028396f1 100644
--- a/fs/autofs/symlink.c
+++ b/fs/autofs/symlink.c
@@ -12,19 +12,14 @@
 
 #include "autofs_i.h"
 
-static int autofs_readlink(struct dentry *dentry, char *buffer, int buflen)
-{
-	char *s=((struct autofs_symlink *)dentry->d_inode->u.generic_ip)->data;
-	return vfs_readlink(dentry, buffer, buflen, s);
-}
-
 static int autofs_follow_link(struct dentry *dentry, struct nameidata *nd)
 {
 	char *s=((struct autofs_symlink *)dentry->d_inode->u.generic_ip)->data;
-	return vfs_follow_link(nd, s);
+	nd_set_link(nd, s);
+	return 0;
 }
 
 struct inode_operations autofs_symlink_inode_operations = {
-	.readlink	= autofs_readlink,
+	.readlink	= generic_readlink,
 	.follow_link	= autofs_follow_link
 };
diff --git a/fs/autofs/waitq.c b/fs/autofs/waitq.c
index d08b648cc..1fcaa1568 100644
--- a/fs/autofs/waitq.c
+++ b/fs/autofs/waitq.c
@@ -183,7 +183,7 @@ int autofs_wait_release(struct autofs_sb_info *sbi, autofs_wqt_t wait_queue_toke
 {
 	struct autofs_wait_queue *wq, **wql;
 
-	for ( wql = &sbi->queues ; (wq = *wql) ; wql = &wq->next ) {
+	for ( wql = &sbi->queues ; (wq = *wql) != 0 ; wql = &wq->next ) {
 		if ( wq->wait_queue_token == wait_queue_token )
 			break;
 	}
diff --git a/fs/autofs4/symlink.c b/fs/autofs4/symlink.c
index 9cc355a08..c265a66ed 100644
--- a/fs/autofs4/symlink.c
+++ b/fs/autofs4/symlink.c
@@ -12,21 +12,14 @@
 
 #include "autofs_i.h"
 
-static int autofs4_readlink(struct dentry *dentry, char *buffer, int buflen)
-{
-	struct autofs_info *ino = autofs4_dentry_ino(dentry);
-
-	return vfs_readlink(dentry, buffer, buflen, ino->u.symlink);
-}
-
 static int autofs4_follow_link(struct dentry *dentry, struct nameidata *nd)
 {
 	struct autofs_info *ino = autofs4_dentry_ino(dentry);
-
-	return vfs_follow_link(nd, ino->u.symlink);
+	nd_set_link(nd, (char *)ino->u.symlink);
+	return 0;
 }
 
 struct inode_operations autofs4_symlink_inode_operations = {
-	.readlink	= autofs4_readlink,
+	.readlink	= generic_readlink,
 	.follow_link	= autofs4_follow_link
 };
diff --git a/fs/autofs4/waitq.c b/fs/autofs4/waitq.c
index caae47fd7..b2f2e885d 100644
--- a/fs/autofs4/waitq.c
+++ b/fs/autofs4/waitq.c
@@ -275,7 +275,7 @@ int autofs4_wait_release(struct autofs_sb_info *sbi, autofs_wqt_t wait_queue_tok
 	struct autofs_wait_queue *wq, **wql;
 
 	down(&sbi->wq_sem);
-	for ( wql = &sbi->queues ; (wq = *wql) ; wql = &wq->next ) {
+	for ( wql = &sbi->queues ; (wq = *wql) != 0 ; wql = &wq->next ) {
 		if ( wq->wait_queue_token == wait_queue_token )
 			break;
 	}
diff --git a/fs/bad_inode.c b/fs/bad_inode.c
index c0619d21a..3957ad190 100644
--- a/fs/bad_inode.c
+++ b/fs/bad_inode.c
@@ -13,6 +13,7 @@
 #include <linux/stat.h>
 #include <linux/time.h>
 #include <linux/smp_lock.h>
+#include <linux/namei.h>
 
 /*
  * The follow_link operation is special: it must behave as a no-op
@@ -21,7 +22,8 @@
  */
 static int bad_follow_link(struct dentry *dent, struct nameidata *nd)
 {
-	return vfs_follow_link(nd, ERR_PTR(-EIO));
+	nd_set_link(nd, ERR_PTR(-EIO));
+	return 0;
 }
 
 static int return_EIO(void)
diff --git a/fs/befs/linuxvfs.c b/fs/befs/linuxvfs.c
index 649d02b03..49cf3428d 100644
--- a/fs/befs/linuxvfs.c
+++ b/fs/befs/linuxvfs.c
@@ -14,6 +14,7 @@
 #include <linux/buffer_head.h>
 #include <linux/vfs.h>
 #include <linux/parser.h>
+#include <linux/namei.h>
 
 #include "befs.h"
 #include "btree.h"
@@ -40,8 +41,8 @@ static struct inode *befs_alloc_inode(struct super_block *sb);
 static void befs_destroy_inode(struct inode *inode);
 static int befs_init_inodecache(void);
 static void befs_destroy_inodecache(void);
-static int befs_readlink(struct dentry *, char __user *, int);
-static int befs_follow_link(struct dentry *, struct nameidata *nd);
+static int befs_follow_link(struct dentry *, struct nameidata *);
+static void befs_put_link(struct dentry *, struct nameidata *);
 static int befs_utf2nls(struct super_block *sb, const char *in, int in_len,
 			char **out, int *out_len);
 static int befs_nls2utf(struct super_block *sb, const char *in, int in_len,
@@ -85,8 +86,9 @@ struct address_space_operations befs_aops = {
 };
 
 static struct inode_operations befs_symlink_inode_operations = {
-	.readlink	= befs_readlink,
+	.readlink	= generic_readlink,
 	.follow_link	= befs_follow_link,
+	.put_link	= befs_put_link,
 };
 
 /* 
@@ -462,71 +464,40 @@ befs_destroy_inodecache(void)
 static int
 befs_follow_link(struct dentry *dentry, struct nameidata *nd)
 {
-	struct super_block *sb = dentry->d_sb;
 	befs_inode_info *befs_ino = BEFS_I(dentry->d_inode);
 	char *link;
-	int res;
 
 	if (befs_ino->i_flags & BEFS_LONG_SYMLINK) {
+		struct super_block *sb = dentry->d_sb;
 		befs_data_stream *data = &befs_ino->i_data.ds;
-		befs_off_t linklen = data->size;
+		befs_off_t len = data->size;
 
 		befs_debug(sb, "Follow long symlink");
 
-		link = kmalloc(linklen, GFP_NOFS);
-		if (link == NULL)
-			return -ENOMEM;
-
-		if (befs_read_lsymlink(sb, data, link, linklen) != linklen) {
+		link = kmalloc(len, GFP_NOFS);
+		if (!link) {
+			link = ERR_PTR(-ENOMEM);
+		} else if (befs_read_lsymlink(sb, data, link, len) != len) {
 			kfree(link);
 			befs_error(sb, "Failed to read entire long symlink");
-			return -EIO;
+			link = ERR_PTR(-EIO);
 		}
-
-		res = vfs_follow_link(nd, link);
-
-		kfree(link);
 	} else {
 		link = befs_ino->i_data.symlink;
-		res = vfs_follow_link(nd, link);
 	}
 
-	return res;
+	nd_set_link(nd, link);
+	return 0;
 }
 
-static int
-befs_readlink(struct dentry *dentry, char __user *buffer, int buflen)
+static void befs_put_link(struct dentry *dentry, struct nameidata *nd)
 {
-	struct super_block *sb = dentry->d_sb;
 	befs_inode_info *befs_ino = BEFS_I(dentry->d_inode);
-	char *link;
-	int res;
-
 	if (befs_ino->i_flags & BEFS_LONG_SYMLINK) {
-		befs_data_stream *data = &befs_ino->i_data.ds;
-		befs_off_t linklen = data->size;
-
-		befs_debug(sb, "Read long symlink");
-
-		link = kmalloc(linklen, GFP_NOFS);
-		if (link == NULL)
-			return -ENOMEM;
-
-		if (befs_read_lsymlink(sb, data, link, linklen) != linklen) {
-			kfree(link);
-			befs_error(sb, "Failed to read entire long symlink");
-			return -EIO;
-		}
-
-		res = vfs_readlink(dentry, buffer, buflen, link);
-
-		kfree(link);
-	} else {
-		link = befs_ino->i_data.symlink;
-		res = vfs_readlink(dentry, buffer, buflen, link);
+		char *p = nd_get_link(nd);
+		if (!IS_ERR(p))
+			kfree(p);
 	}
-
-	return res;
 }
 
 /*
diff --git a/fs/binfmt_aout.c b/fs/binfmt_aout.c
index 40ce9d484..85e855611 100644
--- a/fs/binfmt_aout.c
+++ b/fs/binfmt_aout.c
@@ -28,7 +28,6 @@
 
 #include <asm/system.h>
 #include <asm/uaccess.h>
-#include <asm/pgalloc.h>
 #include <asm/cacheflush.h>
 
 static int load_aout_binary(struct linux_binprm *, struct pt_regs * regs);
@@ -142,14 +141,14 @@ static int aout_core_dump(long signr, struct pt_regs * regs, struct file *file)
 /* make sure we actually have a data and stack area to dump */
 	set_fs(USER_DS);
 #ifdef __sparc__
-	if (verify_area(VERIFY_READ, (void *) START_DATA(dump), dump.u_dsize))
+	if (verify_area(VERIFY_READ, (void __user *)START_DATA(dump), dump.u_dsize))
 		dump.u_dsize = 0;
-	if (verify_area(VERIFY_READ, (void *) START_STACK(dump), dump.u_ssize))
+	if (verify_area(VERIFY_READ, (void __user *)START_STACK(dump), dump.u_ssize))
 		dump.u_ssize = 0;
 #else
-	if (verify_area(VERIFY_READ, (void *) START_DATA(dump), dump.u_dsize << PAGE_SHIFT))
+	if (verify_area(VERIFY_READ, (void __user *)START_DATA(dump), dump.u_dsize << PAGE_SHIFT))
 		dump.u_dsize = 0;
-	if (verify_area(VERIFY_READ, (void *) START_STACK(dump), dump.u_ssize << PAGE_SHIFT))
+	if (verify_area(VERIFY_READ, (void __user *)START_STACK(dump), dump.u_ssize << PAGE_SHIFT))
 		dump.u_ssize = 0;
 #endif
 
@@ -195,17 +194,18 @@ end_coredump:
  * memory and creates the pointer tables from them, and puts their
  * addresses on the "stack", returning the new stack pointer value.
  */
-static unsigned long * create_aout_tables(char * p, struct linux_binprm * bprm)
+static unsigned long __user *create_aout_tables(char __user *p, struct linux_binprm * bprm)
 {
-	char **argv, **envp;
-	unsigned long * sp;
+	char __user * __user *argv;
+	char __user * __user *envp;
+	unsigned long __user *sp;
 	int argc = bprm->argc;
 	int envc = bprm->envc;
 
-	sp = (unsigned long *) ((-(unsigned long)sizeof(char *)) & (unsigned long) p);
+	sp = (void __user *)((-(unsigned long)sizeof(char *)) & (unsigned long) p);
 #ifdef __sparc__
 	/* This imposes the proper stack alignment for a new process. */
-	sp = (unsigned long *) (((unsigned long) sp) & ~7);
+	sp = (void __user *) (((unsigned long) sp) & ~7);
 	if ((envc+argc+3)&1) --sp;
 #endif
 #ifdef __alpha__
@@ -222,9 +222,9 @@ static unsigned long * create_aout_tables(char * p, struct linux_binprm * bprm)
 	put_user(0x3e9, --sp);
 #endif
 	sp -= envc+1;
-	envp = (char **) sp;
+	envp = (char __user * __user *) sp;
 	sp -= argc+1;
-	argv = (char **) sp;
+	argv = (char __user * __user *) sp;
 #if defined(__i386__) || defined(__mc68000__) || defined(__arm__) || defined(__arch_um__)
 	put_user((unsigned long) envp,--sp);
 	put_user((unsigned long) argv,--sp);
@@ -350,7 +350,8 @@ static int load_aout_binary(struct linux_binprm * bprm, struct pt_regs * regs)
 			return error;
 		}
 
-		error = bprm->file->f_op->read(bprm->file, (char *)text_addr,
+		error = bprm->file->f_op->read(bprm->file,
+			  (char __user *)text_addr,
 			  ex.a_text+ex.a_data, &pos);
 		if ((signed long)error < 0) {
 			send_sig(SIGKILL, current, 0);
@@ -379,7 +380,8 @@ static int load_aout_binary(struct linux_binprm * bprm, struct pt_regs * regs)
 		if (!bprm->file->f_op->mmap||((fd_offset & ~PAGE_MASK) != 0)) {
 			loff_t pos = fd_offset;
 			do_brk(N_TXTADDR(ex), ex.a_text+ex.a_data);
-			bprm->file->f_op->read(bprm->file,(char *)N_TXTADDR(ex),
+			bprm->file->f_op->read(bprm->file,
+					(char __user *)N_TXTADDR(ex),
 					ex.a_text+ex.a_data, &pos);
 			flush_icache_range((unsigned long) N_TXTADDR(ex),
 					   (unsigned long) N_TXTADDR(ex) +
@@ -423,7 +425,7 @@ beyond_if:
 	}
 
 	current->mm->start_stack =
-		(unsigned long) create_aout_tables((char *) bprm->p, bprm);
+		(unsigned long) create_aout_tables((char __user *) bprm->p, bprm);
 #ifdef __alpha__
 	regs->gp = ex.a_gpvalue;
 #endif
@@ -481,7 +483,7 @@ static int load_aout_library(struct file *file)
 
 		do_brk(start_addr, ex.a_text + ex.a_data + ex.a_bss);
 		
-		file->f_op->read(file, (char *)start_addr,
+		file->f_op->read(file, (char __user *)start_addr,
 			ex.a_text + ex.a_data, &pos);
 		flush_icache_range((unsigned long) start_addr,
 				   (unsigned long) start_addr + ex.a_text + ex.a_data);
diff --git a/fs/binfmt_elf.c b/fs/binfmt_elf.c
index 38130a276..785da46c8 100644
--- a/fs/binfmt_elf.c
+++ b/fs/binfmt_elf.c
@@ -37,10 +37,10 @@
 #include <linux/pagemap.h>
 #include <linux/security.h>
 #include <linux/syscalls.h>
+#include <linux/vs_memory.h>
 
 #include <asm/uaccess.h>
 #include <asm/param.h>
-#include <asm/pgalloc.h>
 
 #include <linux/elf.h>
 
@@ -202,7 +202,10 @@ create_elf_tables(struct linux_binprm *bprm, struct elfhdr * exec,
 	NEW_AUX_ENT(AT_EGID, (elf_addr_t) tsk->egid);
  	NEW_AUX_ENT(AT_SECURE, (elf_addr_t) security_bprm_secureexec(bprm));
 	if (k_platform) {
-		NEW_AUX_ENT(AT_PLATFORM, (elf_addr_t)(long)u_platform);
+		NEW_AUX_ENT(AT_PLATFORM, (elf_addr_t)(unsigned long)u_platform);
+	}
+	if (bprm->interp_flags & BINPRM_FLAGS_EXECFD) {
+		NEW_AUX_ENT(AT_EXECFD, (elf_addr_t) bprm->interp_data);
 	}
 #undef NEW_AUX_ENT
 	/* AT_NULL is zero; clear the rest too */
@@ -235,8 +238,8 @@ create_elf_tables(struct linux_binprm *bprm, struct elfhdr * exec,
 	if (interp_aout) {
 		argv = sp + 2;
 		envp = argv + argc + 1;
-		__put_user((elf_addr_t)(long)argv, sp++);
-		__put_user((elf_addr_t)(long)envp, sp++);
+		__put_user((elf_addr_t)(unsigned long)argv, sp++);
+		__put_user((elf_addr_t)(unsigned long)envp, sp++);
 	} else {
 		argv = sp;
 		envp = argv + argc + 1;
@@ -490,7 +493,8 @@ static int load_elf_binary(struct linux_binprm * bprm, struct pt_regs * regs)
   	struct exec interp_ex;
 	char passed_fileno[6];
 	struct files_struct *files;
-	int executable_stack = EXSTACK_DEFAULT;
+	int have_pt_gnu_stack, executable_stack = EXSTACK_DEFAULT;
+	unsigned long def_flags = 0;
 	
 	/* Get the exec-header */
 	elf_ex = *((struct elfhdr *) bprm->buf);
@@ -622,7 +626,9 @@ static int load_elf_binary(struct linux_binprm * bprm, struct pt_regs * regs)
 				executable_stack = EXSTACK_ENABLE_X;
 			else
 				executable_stack = EXSTACK_DISABLE_X;
+			break;
 		}
+	have_pt_gnu_stack = (i < elf_ex.e_phnum);
 
 	/* Some simple consistency checks for the interpreter */
 	if (elf_interpreter) {
@@ -690,10 +696,13 @@ static int load_elf_binary(struct linux_binprm * bprm, struct pt_regs * regs)
 	current->mm->end_code = 0;
 	current->mm->mmap = NULL;
 	current->flags &= ~PF_FORKNOEXEC;
+	current->mm->def_flags = def_flags;
 
 	/* Do this immediately, since STACK_TOP as used in setup_arg_pages
 	   may depend on the personality.  */
 	SET_PERSONALITY(elf_ex, ibcs2_interpreter);
+	if (elf_read_implies_exec(elf_ex, have_pt_gnu_stack))
+		current->personality |= READ_IMPLIES_EXEC;
 
 	/* Do this so that we can load the interpreter, if need be.  We will
 	   change some of these later */
diff --git a/fs/binfmt_flat.c b/fs/binfmt_flat.c
index 8728d532d..0bc28feab 100644
--- a/fs/binfmt_flat.c
+++ b/fs/binfmt_flat.c
@@ -36,11 +36,11 @@
 #include <linux/personality.h>
 #include <linux/init.h>
 #include <linux/flat.h>
+#include <linux/vs_memory.h>
 
 #include <asm/byteorder.h>
 #include <asm/system.h>
 #include <asm/uaccess.h>
-#include <asm/pgalloc.h>
 #include <asm/unaligned.h>
 #include <asm/cacheflush.h>
 
diff --git a/fs/binfmt_misc.c b/fs/binfmt_misc.c
index 9f2c43aba..3f66d3834 100644
--- a/fs/binfmt_misc.c
+++ b/fs/binfmt_misc.c
@@ -39,6 +39,8 @@ static int enabled = 1;
 
 enum {Enabled, Magic};
 #define MISC_FMT_PRESERVE_ARGV0 (1<<31)
+#define MISC_FMT_OPEN_BINARY (1<<30)
+#define MISC_FMT_CREDENTIALS (1<<29)
 
 typedef struct {
 	struct list_head list;
@@ -102,10 +104,12 @@ static Node *check_file(struct linux_binprm *bprm)
 static int load_misc_binary(struct linux_binprm *bprm, struct pt_regs *regs)
 {
 	Node *fmt;
-	struct file * file;
+	struct file * interp_file = NULL;
 	char iname[BINPRM_BUF_SIZE];
 	char *iname_addr = iname;
 	int retval;
+	int fd_binary = -1;
+	struct files_struct *files = NULL;
 
 	retval = -ENOEXEC;
 	if (!enabled)
@@ -120,33 +124,102 @@ static int load_misc_binary(struct linux_binprm *bprm, struct pt_regs *regs)
 	if (!fmt)
 		goto _ret;
 
-	allow_write_access(bprm->file);
-	fput(bprm->file);
-	bprm->file = NULL;
-
-	/* Build args for interpreter */
 	if (!(fmt->flags & MISC_FMT_PRESERVE_ARGV0)) {
 		remove_arg_zero(bprm);
 	}
-	retval = copy_strings_kernel(1, &bprm->interp, bprm);
-	if (retval < 0) goto _ret; 
-	bprm->argc++;
-	retval = copy_strings_kernel(1, &iname_addr, bprm);
-	if (retval < 0) goto _ret; 
+
+	if (fmt->flags & MISC_FMT_OPEN_BINARY) {
+
+		files = current->files;
+		retval = unshare_files();
+		if (retval < 0)
+			goto _ret;
+		if (files == current->files) {
+			put_files_struct(files);
+			files = NULL;
+		}
+		/* if the binary should be opened on behalf of the
+		 * interpreter than keep it open and assign descriptor
+		 * to it */
+ 		fd_binary = get_unused_fd();
+ 		if (fd_binary < 0) {
+ 			retval = fd_binary;
+ 			goto _unshare;
+ 		}
+ 		fd_install(fd_binary, bprm->file);
+
+		/* if the binary is not readable than enforce mm->dumpable=0
+		   regardless of the interpreter's permissions */
+		if (permission(bprm->file->f_dentry->d_inode, MAY_READ, NULL))
+			bprm->interp_flags |= BINPRM_FLAGS_ENFORCE_NONDUMP;
+
+		allow_write_access(bprm->file);
+		bprm->file = NULL;
+
+		/* mark the bprm that fd should be passed to interp */
+		bprm->interp_flags |= BINPRM_FLAGS_EXECFD;
+		bprm->interp_data = fd_binary;
+
+ 	} else {
+ 		allow_write_access(bprm->file);
+ 		fput(bprm->file);
+ 		bprm->file = NULL;
+ 	}
+	/* make argv[1] be the path to the binary */
+	retval = copy_strings_kernel (1, &bprm->interp, bprm);
+	if (retval < 0)
+		goto _error;
 	bprm->argc++;
-	bprm->interp = iname;	/* for binfmt_script */
 
-	file = open_exec(iname);
-	retval = PTR_ERR(file);
-	if (IS_ERR(file))
-		goto _ret;
-	bprm->file = file;
+	/* add the interp as argv[0] */
+	retval = copy_strings_kernel (1, &iname_addr, bprm);
+	if (retval < 0)
+		goto _error;
+	bprm->argc ++;
 
-	retval = prepare_binprm(bprm);
-	if (retval >= 0)
-		retval = search_binary_handler(bprm, regs);
+	bprm->interp = iname;	/* for binfmt_script */
+
+	interp_file = open_exec (iname);
+	retval = PTR_ERR (interp_file);
+	if (IS_ERR (interp_file))
+		goto _error;
+
+	bprm->file = interp_file;
+	if (fmt->flags & MISC_FMT_CREDENTIALS) {
+		/*
+		 * No need to call prepare_binprm(), it's already been
+		 * done.  bprm->buf is stale, update from interp_file.
+		 */
+		memset(bprm->buf, 0, BINPRM_BUF_SIZE);
+		retval = kernel_read(bprm->file, 0, bprm->buf, BINPRM_BUF_SIZE);
+	} else
+		retval = prepare_binprm (bprm);
+
+	if (retval < 0)
+		goto _error;
+
+	retval = search_binary_handler (bprm, regs);
+	if (retval < 0)
+		goto _error;
+
+	if (files) {
+		steal_locks(files);
+		put_files_struct(files);
+		files = NULL;
+	}
 _ret:
 	return retval;
+_error:
+	if (fd_binary > 0)
+		sys_close(fd_binary);
+	bprm->interp_flags = 0;
+	bprm->interp_data = 0;
+_unshare:
+	if (files) {
+		put_files_struct(current->files);
+		current->files = files;
+	}
+	goto _ret;
 }
 
 /* Command parsers */
@@ -191,9 +264,39 @@ static int unquote(char *from)
 	return p - from;
 }
 
+static inline char * check_special_flags (char * sfs, Node * e)
+{
+	char * p = sfs;
+	int cont = 1;
+
+	/* special flags */
+	while (cont) {
+		switch (*p) {
+			case 'P':
+				p++;
+				e->flags |= MISC_FMT_PRESERVE_ARGV0;
+				break;
+			case 'O':
+				p++;
+				e->flags |= MISC_FMT_OPEN_BINARY;
+				break;
+			case 'C':
+				p++;
+				/* this flags also implies the
+				   open-binary flag */
+				e->flags |= (MISC_FMT_CREDENTIALS |
+						MISC_FMT_OPEN_BINARY);
+				break;
+			default:
+				cont = 0;
+		}
+	}
+
+	return p;
+}
 /*
  * This registers a new binary format, it recognises the syntax
- * ':name:type:offset:magic:mask:interpreter:'
+ * ':name:type:offset:magic:mask:interpreter:flags'
  * where the ':' is the IFS, that can be chosen with the first char
  */
 static Node *create_entry(const char __user *buffer, size_t count)
@@ -293,10 +396,8 @@ static Node *create_entry(const char __user *buffer, size_t count)
 	if (!e->interpreter[0])
 		goto Einval;
 
-	if (*p == 'P') {
-		p++;
-		e->flags |= MISC_FMT_PRESERVE_ARGV0;
-	}
+
+	p = check_special_flags (p, e);
 
 	if (*p == '\n')
 		p++;
@@ -346,6 +447,7 @@ static void entry_status(Node *e, char *page)
 {
 	char *dp;
 	char *status = "disabled";
+	const char * flags = "flags: ";
 
 	if (test_bit(Enabled, &e->flags))
 		status = "enabled";
@@ -357,6 +459,22 @@ static void entry_status(Node *e, char *page)
 
 	sprintf(page, "%s\ninterpreter %s\n", status, e->interpreter);
 	dp = page + strlen(page);
+
+	/* print the special flags */
+	sprintf (dp, "%s", flags);
+	dp += strlen (flags);
+	if (e->flags & MISC_FMT_PRESERVE_ARGV0) {
+		*dp ++ = 'P';
+	}
+	if (e->flags & MISC_FMT_OPEN_BINARY) {
+		*dp ++ = 'O';
+	}
+	if (e->flags & MISC_FMT_CREDENTIALS) {
+		*dp ++ = 'C';
+	}
+	*dp ++ = '\n';
+
+
 	if (!test_bit(Magic, &e->flags)) {
 		sprintf(dp, "extension .%s\n", e->magic);
 	} else {
diff --git a/fs/binfmt_script.c b/fs/binfmt_script.c
index 3c81f785e..44d37eb61 100644
--- a/fs/binfmt_script.c
+++ b/fs/binfmt_script.c
@@ -50,7 +50,7 @@ static int load_script(struct linux_binprm *bprm,struct pt_regs *regs)
 	if (*cp == '\0') 
 		return -ENOEXEC; /* No interpreter name found */
 	i_name = cp;
-	i_arg = 0;
+	i_arg = NULL;
 	for ( ; *cp && (*cp != ' ') && (*cp != '\t'); cp++)
 		/* nothing */ ;
 	while ((*cp == ' ') || (*cp == '\t'))
diff --git a/fs/binfmt_som.c b/fs/binfmt_som.c
index 496196b4e..4969da676 100644
--- a/fs/binfmt_som.c
+++ b/fs/binfmt_som.c
@@ -28,6 +28,7 @@
 #include <linux/shm.h>
 #include <linux/personality.h>
 #include <linux/init.h>
+#include <linux/vs_memory.h>
 
 #include <asm/uaccess.h>
 #include <asm/pgtable.h>
diff --git a/fs/bio.c b/fs/bio.c
index 2d1ec6536..e246f542a 100644
--- a/fs/bio.c
+++ b/fs/bio.c
@@ -116,6 +116,8 @@ inline void bio_init(struct bio *bio)
 	bio->bi_idx = 0;
 	bio->bi_phys_segments = 0;
 	bio->bi_hw_segments = 0;
+	bio->bi_hw_front_size = 0;
+	bio->bi_hw_back_size = 0;
 	bio->bi_size = 0;
 	bio->bi_max_vecs = 0;
 	bio->bi_end_io = NULL;
@@ -304,14 +306,15 @@ static int __bio_add_page(request_queue_t *q, struct bio *bio, struct page
 	 * make this too complex.
 	 */
 
-	while (bio_phys_segments(q, bio) >= q->max_phys_segments
-	    || bio_hw_segments(q, bio) >= q->max_hw_segments) {
+	while (bio->bi_phys_segments >= q->max_phys_segments
+	       || bio->bi_hw_segments >= q->max_hw_segments
+	       || BIOVEC_VIRT_OVERSIZE(bio->bi_size)) {
 
 		if (retried_segments)
 			return 0;
 
-		bio->bi_flags &= ~(1 << BIO_SEG_VALID);
 		retried_segments = 1;
+		blk_recount_segments(q, bio);
 	}
 
 	/*
@@ -341,6 +344,11 @@ static int __bio_add_page(request_queue_t *q, struct bio *bio, struct page
 		}
 	}
 
+	/* If we may be able to merge these biovecs, force a recount */
+	if (bio->bi_vcnt && (BIOVEC_PHYS_MERGEABLE(bvec-1, bvec) ||
+	    BIOVEC_VIRT_MERGEABLE(bvec-1, bvec)))
+		bio->bi_flags &= ~(1 << BIO_SEG_VALID);
+
 	bio->bi_vcnt++;
 	bio->bi_phys_segments++;
 	bio->bi_hw_segments++;
@@ -368,6 +376,115 @@ int bio_add_page(struct bio *bio, struct page *page, unsigned int len,
 			      len, offset);
 }
 
+/**
+ *	bio_uncopy_user	-	finish previously mapped bio
+ *	@bio: bio being terminated
+ *
+ *	Free pages allocated from bio_copy_user() and write back data
+ *	to user space in case of a read.
+ */
+int bio_uncopy_user(struct bio *bio)
+{
+	struct bio_vec *bvec;
+	int i, ret = 0;
+
+	if (bio_data_dir(bio) == READ) {
+		char *uaddr = bio->bi_private;
+
+		__bio_for_each_segment(bvec, bio, i, 0) {
+			char *addr = page_address(bvec->bv_page);
+
+			if (!ret && copy_to_user(uaddr, addr, bvec->bv_len))
+				ret = -EFAULT;
+
+			__free_page(bvec->bv_page);
+			uaddr += bvec->bv_len;
+		}
+	}
+
+	bio_put(bio);
+	return ret;
+}
+
+/**
+ *	bio_copy_user	-	copy user data to bio
+ *	@q: destination block queue
+ *	@uaddr: start of user address
+ *	@len: length in bytes
+ *	@write_to_vm: bool indicating writing to pages or not
+ *
+ *	Prepares and returns a bio for indirect user io, bouncing data
+ *	to/from kernel pages as necessary. Must be paired with
+ *	call bio_uncopy_user() on io completion.
+ */
+struct bio *bio_copy_user(request_queue_t *q, unsigned long uaddr,
+			  unsigned int len, int write_to_vm)
+{
+	unsigned long end = (uaddr + len + PAGE_SIZE - 1) >> PAGE_SHIFT;
+	unsigned long start = uaddr >> PAGE_SHIFT;
+	struct bio_vec *bvec;
+	struct page *page;
+	struct bio *bio;
+	int i, ret;
+
+	bio = bio_alloc(GFP_KERNEL, end - start);
+	if (!bio)
+		return ERR_PTR(-ENOMEM);
+
+	ret = 0;
+	while (len) {
+		unsigned int bytes = PAGE_SIZE;
+
+		if (bytes > len)
+			bytes = len;
+
+		page = alloc_page(q->bounce_gfp | GFP_KERNEL);
+		if (!page) {
+			ret = -ENOMEM;
+			break;
+		}
+
+		if (__bio_add_page(q, bio, page, bytes, 0) < bytes) {
+			ret = -EINVAL;
+			break;
+		}
+
+		len -= bytes;
+	}
+
+	/*
+	 * success
+	 */
+	if (!ret) {
+		if (!write_to_vm) {
+			bio->bi_rw |= (1 << BIO_RW);
+			/*
+	 		 * for a write, copy in data to kernel pages
+			 */
+			ret = -EFAULT;
+			bio_for_each_segment(bvec, bio, i) {
+				char *addr = page_address(bvec->bv_page);
+
+				if (copy_from_user(addr, (char *) uaddr, bvec->bv_len))
+					goto cleanup;
+			}
+		}
+
+		bio->bi_private = (void *) uaddr;
+		return bio;
+	}
+
+	/*
+	 * cleanup
+	 */
+cleanup:
+	bio_for_each_segment(bvec, bio, i)
+		__free_page(bvec->bv_page);
+
+	bio_put(bio);
+	return ERR_PTR(ret);
+}
+
 static struct bio *__bio_map_user(request_queue_t *q, struct block_device *bdev,
 				  unsigned long uaddr, unsigned int len,
 				  int write_to_vm)
@@ -384,12 +501,13 @@ static struct bio *__bio_map_user(request_queue_t *q, struct block_device *bdev,
 	 * size for now, in the future we can relax this restriction
 	 */
 	if ((uaddr & queue_dma_alignment(q)) || (len & queue_dma_alignment(q)))
-		return NULL;
+		return ERR_PTR(-EINVAL);
 
 	bio = bio_alloc(GFP_KERNEL, nr_pages);
 	if (!bio)
-		return NULL;
+		return ERR_PTR(-ENOMEM);
 
+	ret = -ENOMEM;
 	pages = kmalloc(nr_pages * sizeof(struct page *), GFP_KERNEL);
 	if (!pages)
 		goto out;
@@ -438,12 +556,12 @@ static struct bio *__bio_map_user(request_queue_t *q, struct block_device *bdev,
 	if (!write_to_vm)
 		bio->bi_rw |= (1 << BIO_RW);
 
-	blk_queue_bounce(q, &bio);
+	bio->bi_flags |= (1 << BIO_USER_MAPPED);
 	return bio;
 out:
 	kfree(pages);
 	bio_put(bio);
-	return NULL;
+	return ERR_PTR(ret);
 }
 
 /**
@@ -454,7 +572,7 @@ out:
  *	@write_to_vm: bool indicating writing to pages or not
  *
  *	Map the user space address into a bio suitable for io to a block
- *	device.
+ *	device. Returns an error pointer in case of error.
  */
 struct bio *bio_map_user(request_queue_t *q, struct block_device *bdev,
 			 unsigned long uaddr, unsigned int len, int write_to_vm)
@@ -463,26 +581,29 @@ struct bio *bio_map_user(request_queue_t *q, struct block_device *bdev,
 
 	bio = __bio_map_user(q, bdev, uaddr, len, write_to_vm);
 
-	if (bio) {
-		/*
-		 * subtle -- if __bio_map_user() ended up bouncing a bio,
-		 * it would normally disappear when its bi_end_io is run.
-		 * however, we need it for the unmap, so grab an extra
-		 * reference to it
-		 */
-		bio_get(bio);
+	if (IS_ERR(bio))
+		return bio;
 
-		if (bio->bi_size < len) {
-			bio_endio(bio, bio->bi_size, 0);
-			bio_unmap_user(bio, 0);
-			return NULL;
-		}
-	}
+	/*
+	 * subtle -- if __bio_map_user() ended up bouncing a bio,
+	 * it would normally disappear when its bi_end_io is run.
+	 * however, we need it for the unmap, so grab an extra
+	 * reference to it
+	 */
+	bio_get(bio);
 
-	return bio;
+	if (bio->bi_size == len)
+		return bio;
+
+	/*
+	 * don't support partial mappings
+	 */
+	bio_endio(bio, bio->bi_size, 0);
+	bio_unmap_user(bio);
+	return ERR_PTR(-EINVAL);
 }
 
-static void __bio_unmap_user(struct bio *bio, int write_to_vm)
+static void __bio_unmap_user(struct bio *bio)
 {
 	struct bio_vec *bvec;
 	int i;
@@ -503,7 +624,7 @@ static void __bio_unmap_user(struct bio *bio, int write_to_vm)
 	 * make sure we dirty pages we wrote to
 	 */
 	__bio_for_each_segment(bvec, bio, i, 0) {
-		if (write_to_vm)
+		if (bio_data_dir(bio) == READ)
 			set_page_dirty_lock(bvec->bv_page);
 
 		page_cache_release(bvec->bv_page);
@@ -515,17 +636,15 @@ static void __bio_unmap_user(struct bio *bio, int write_to_vm)
 /**
  *	bio_unmap_user	-	unmap a bio
  *	@bio:		the bio being unmapped
- *	@write_to_vm:	bool indicating whether pages were written to
  *
- *	Unmap a bio previously mapped by bio_map_user(). The @write_to_vm
- *	must be the same as passed into bio_map_user(). Must be called with
+ *	Unmap a bio previously mapped by bio_map_user(). Must be called with
  *	a process context.
  *
  *	bio_unmap_user() may sleep.
  */
-void bio_unmap_user(struct bio *bio, int write_to_vm)
+void bio_unmap_user(struct bio *bio)
 {
-	__bio_unmap_user(bio, write_to_vm);
+	__bio_unmap_user(bio);
 	bio_put(bio);
 }
 
@@ -856,3 +975,5 @@ EXPORT_SYMBOL(bio_unmap_user);
 EXPORT_SYMBOL(bio_pair_release);
 EXPORT_SYMBOL(bio_split);
 EXPORT_SYMBOL(bio_split_pool);
+EXPORT_SYMBOL(bio_copy_user);
+EXPORT_SYMBOL(bio_uncopy_user);
diff --git a/fs/block_dev.c b/fs/block_dev.c
index f3089810d..5c3f09b86 100644
--- a/fs/block_dev.c
+++ b/fs/block_dev.c
@@ -64,8 +64,6 @@ static void kill_bdev(struct block_device *bdev)
 
 int set_blocksize(struct block_device *bdev, int size)
 {
-	int oldsize;
-
 	/* Size must be a power of two, and between 512 and PAGE_SIZE */
 	if (size > PAGE_SIZE || size < 512 || (size & (size-1)))
 		return -EINVAL;
@@ -74,15 +72,13 @@ int set_blocksize(struct block_device *bdev, int size)
 	if (size < bdev_hardsect_size(bdev))
 		return -EINVAL;
 
-	oldsize = bdev->bd_block_size;
-	if (oldsize == size)
-		return 0;
-
-	/* Ok, we're actually changing the blocksize.. */
-	sync_blockdev(bdev);
-	bdev->bd_block_size = size;
-	bdev->bd_inode->i_blkbits = blksize_bits(size);
-	kill_bdev(bdev);
+	/* Don't change the size if it is same as current */
+	if (bdev->bd_block_size != size) {
+		sync_blockdev(bdev);
+		bdev->bd_block_size = size;
+		bdev->bd_inode->i_blkbits = blksize_bits(size);
+		kill_bdev(bdev);
+	}
 	return 0;
 }
 
@@ -90,12 +86,15 @@ EXPORT_SYMBOL(set_blocksize);
 
 int sb_set_blocksize(struct super_block *sb, int size)
 {
-	int bits;
-	if (set_blocksize(sb->s_bdev, size) < 0)
+	int bits = 9; /* 2^9 = 512 */
+
+	if (set_blocksize(sb->s_bdev, size))
 		return 0;
+	/* If we get here, we know size is power of two
+	 * and it's value is between 512 and PAGE_SIZE */
 	sb->s_blocksize = size;
-	for (bits = 9, size >>= 9; size >>= 1; bits++)
-		;
+	for (size >>= 10; size; size >>= 1)
+		++bits;
 	sb->s_blocksize_bits = bits;
 	return sb->s_blocksize;
 }
diff --git a/fs/buffer.c b/fs/buffer.c
index 0b84c0f84..c70e72ef5 100644
--- a/fs/buffer.c
+++ b/fs/buffer.c
@@ -1420,7 +1420,7 @@ struct bh_lru {
 	struct buffer_head *bhs[BH_LRU_SIZE];
 };
 
-static DEFINE_PER_CPU(struct bh_lru, bh_lrus) = {{0}};
+static DEFINE_PER_CPU(struct bh_lru, bh_lrus) = {{ NULL }};
 
 #ifdef CONFIG_SMP
 #define bh_lru_lock()	local_irq_disable()
@@ -1588,10 +1588,9 @@ __bread(struct block_device *bdev, sector_t block, int size)
 EXPORT_SYMBOL(__bread);
 
 /*
- * invalidate_bh_lrus() is called rarely - at unmount.  Because it is only for
- * unmount it only needs to ensure that all buffers from the target device are
- * invalidated on return and it doesn't need to worry about new buffers from
- * that device being added - the unmount code has to prevent that.
+ * invalidate_bh_lrus() is called rarely - but not only at unmount.
+ * This doesn't race because it runs in each cpu either in irq
+ * or with preempt disabled.
  */
 static void invalidate_bh_lru(void *arg)
 {
@@ -1807,10 +1806,10 @@ EXPORT_SYMBOL(unmap_underlying_metadata);
  * state inside lock_buffer().
  *
  * If block_write_full_page() is called for regular writeback
- * (called_for_sync() is false) then it will redirty a page which has a locked
- * buffer.   This only can happen if someone has written the buffer directly,
- * with submit_bh().  At the address_space level PageWriteback prevents this
- * contention from occurring.
+ * (wbc->sync_mode == WB_SYNC_NONE) then it will redirty a page which has a
+ * locked buffer.   This only can happen if someone has written the buffer
+ * directly, with submit_bh().  At the address_space level PageWriteback
+ * prevents this contention from occurring.
  */
 static int __block_write_full_page(struct inode *inode, struct page *page,
 			get_block_t *get_block, struct writeback_control *wbc)
@@ -1899,14 +1898,14 @@ static int __block_write_full_page(struct inode *inode, struct page *page,
 		}
 	} while ((bh = bh->b_this_page) != head);
 
+	/*
+	 * The page and its buffers are protected by PageWriteback(), so we can
+	 * drop the bh refcounts early.
+	 */
 	BUG_ON(PageWriteback(page));
-	set_page_writeback(page);	/* Keeps try_to_free_buffers() away */
+	set_page_writeback(page);
 	unlock_page(page);
 
-	/*
-	 * The page may come unlocked any time after the *first* submit_bh()
-	 * call.  Be careful with its buffers.
-	 */
 	do {
 		struct buffer_head *next = bh->b_this_page;
 		if (buffer_async_write(bh)) {
@@ -1936,6 +1935,10 @@ done:
 		if (uptodate)
 			SetPageUptodate(page);
 		end_page_writeback(page);
+		/*
+		 * The page and buffer_heads can be released at any time from
+		 * here on.
+		 */
 		wbc->pages_skipped++;	/* We didn't write this page */
 	}
 	return err;
@@ -2487,7 +2490,7 @@ int nobh_prepare_write(struct page *page, unsigned from, unsigned to,
 			}
 			bh->b_state = map_bh.b_state;
 			atomic_set(&bh->b_count, 0);
-			bh->b_this_page = 0;
+			bh->b_this_page = NULL;
 			bh->b_page = page;
 			bh->b_blocknr = map_bh.b_blocknr;
 			bh->b_size = blocksize;
@@ -2723,7 +2726,7 @@ int block_write_full_page(struct page *page, get_block_t *get_block,
 
 	/*
 	 * The page straddles i_size.  It must be zeroed out on each and every
-	 * writepage invocation because it may be mmapped.  "A file is mapped
+	 * writepage invokation because it may be mmapped.  "A file is mapped
 	 * in multiples of the page size.  For a file that is not a multiple of
 	 * the  page size, the remaining memory is zeroed when mapped, and
 	 * writes to that region are not written out to the file."
@@ -2895,7 +2898,6 @@ drop_buffers(struct page *page, struct buffer_head **buffers_to_free)
 {
 	struct buffer_head *head = page_buffers(page);
 	struct buffer_head *bh;
-	int was_uptodate = 1;
 
 	bh = head;
 	do {
@@ -2903,8 +2905,6 @@ drop_buffers(struct page *page, struct buffer_head **buffers_to_free)
 			set_bit(AS_EIO, &page->mapping->flags);
 		if (buffer_busy(bh))
 			goto failed;
-		if (!buffer_uptodate(bh) && !buffer_req(bh))
-			was_uptodate = 0;
 		bh = bh->b_this_page;
 	} while (bh != head);
 
diff --git a/fs/cifs/AUTHORS b/fs/cifs/AUTHORS
index ac239020f..43a7b6534 100644
--- a/fs/cifs/AUTHORS
+++ b/fs/cifs/AUTHORS
@@ -31,7 +31,7 @@ Thanks to those in the community who have submitted detailed bug reports
 and debug of problems they have found:  Jochen Dolze, David Blaine,
 Rene Scharfe, Martin Josefsson, Alexander Wild, Anthony Liguori,
 Lars Muller, Urban Widmark, Massimiliano Ferrero, Howard Owen,
-Olaf Kirch, Kieron Briggs and others. 
+Olaf Kirch, Kieron Briggs, Nick Millington and others. 
 
 And thanks to the IBM LTC and Power test teams and SuSE testers for
 finding multiple bugs during excellent stress test runs.
diff --git a/fs/cifs/CHANGES b/fs/cifs/CHANGES
index cae2bfb99..a853ec02e 100644
--- a/fs/cifs/CHANGES
+++ b/fs/cifs/CHANGES
@@ -1,9 +1,49 @@
+Version 1.22
+------------
+Add config option to enable XATTR (extended attribute) support, mapping
+xattr names in the "user." namespace space to SMB/CIFS EAs.
+
+Version 1.21
+------------
+Add new mount parm to control whether mode check (vfs_permission) is done on
+the client.  If Unix extensions are enabled and the uids on the client
+and server do not match, client permission checks are meaningless on
+server uids that do not exist on the client (this does not affect the
+normal ACL check which occurs on the server).  Fix default uid
+on mknod to match create and mkdir. Add optional mount parm to allow
+override of the default uid behavior (in which the server sets the uid
+and gid of newly created files). Normally for network filesystem mounts
+user want the server to set the uid/gid on newly created files (rather than 
+using uid of the client processes you would in a local filesystem).
+
+Version 1.20
+------------
+Make transaction counts more consistent. Merge /proc/fs/cifs/SimultaneousOps
+info into /proc/fs/cifs/DebugData.  Fix oops in rare oops in readdir 
+(in build_wildcard_path_from_dentry).  Fix mknod to pass type field
+(block/char/fifo) properly.  Remove spurious mount warning log entry when
+credentials passed as mount argument. Set major/minor device number in
+inode for block and char devices when unix extensions enabled.
+
+Version 1.19
+------------
+Fix /proc/fs/cifs/Stats and DebugData display to handle larger
+amounts of return data. Properly limit requests to MAX_REQ (50
+is the usual maximum active multiplex SMB/CIFS requests per server).
+Do not kill cifsd (and thus hurt the other SMB session) when more than one
+session to the same server (but with different userids) exists and one
+of the two user's smb sessions is being removed while leaving the other.
+Do not loop reconnecting in cifsd demultiplex thread when admin
+kills the thread without going through unmount.
+
 Version 1.18
 ------------
 Do not rename hardlinked files (since that should be a noop). Flush
 cached write behind data when reopening a file after session abend,
 except when already in write. Grab per socket sem during reconnect 
-to avoid oops in sendmsg if overlapping with reconnect.
+to avoid oops in sendmsg if overlapping with reconnect. Do not
+reset cached inode file size on readdir for files open for write on 
+client.
 
 
 Version 1.17
diff --git a/fs/cifs/README b/fs/cifs/README
index 09b49c804..acf1448e6 100644
--- a/fs/cifs/README
+++ b/fs/cifs/README
@@ -31,7 +31,7 @@ the cifs download to your kernel build directory e.g.
 5) make dep
 6) make modules (or "make" if CIFS VFS not to be built as a module)
 
-For Linux 2.5:
+For Linux 2.6:
 1) Download the kernel (e.g. from http://www.kernel.org or from bitkeeper
 at bk://linux.bkbits.net/linux-2.5) and change directory into the top
 of the kernel directory tree (e.g. /usr/src/linux-2.5.73)
@@ -56,7 +56,7 @@ the CIFS VFS web site) copy it to the same directory in which mount.smbfs and
 similar files reside (usually /sbin).  Although the helper software is not  
 required, mount.cifs is recommended.  Eventually the Samba 3.0 utility program 
 "net" may also be helpful since it may someday provide easier mount syntax for
-users who are used to Windows e.g.  net use <mount point> <UNC name or cifs URL>  
+users who are used to Windows e.g.  net use <mount point> <UNC name or cifs URL>
 Note that running the Winbind pam/nss module (logon service) on all of your
 Linux clients is useful in mapping Uids and Gids consistently across the
 domain to the proper network user.  The mount.cifs mount helper can be
@@ -64,6 +64,17 @@ trivially built from Samba 3.0 or later source e.g. by executing:
 
 	gcc samba/source/client/mount.cifs.c -o mount.cifs
 
+Allowing User Mounts
+====================
+To permit users to mount and unmount over directories they own is possible
+with the cifs vfs.  A way to enable such mounting is to mark the mount.cifs
+utility as suid (e.g. "chmod +s /sbin/mount/cifs). To enable users to 
+umount shares they mount requires
+1) mount.cifs version 1.4 or later
+2) an entry for the share in /etc/fstab indicating that a user may
+unmount it e.g.
+//server/usersharename  /mnt/username cifs user 0 0
+
 Note that when the mount.cifs utility is run suid (allowing user mounts), 
 in order to reduce risks, the "nosuid" mount flag is passed in on mount to
 disallow execution of an suid program mounted on the remote target.
@@ -99,20 +110,27 @@ Linux:
 	delete readonly = yes 
 	ea support = yes
 
-Note that ea support is required for supporting Linux xattrs. 
-Some administrators also change the "map archive" and the "create mask" 
-parameters from their default values.  Creating special devices (mknod) remotely 
-may require specifying a mkdev function to Samba.  For more information on these 
-see the manual pages ("man smb.conf") on the Samba server system.  Note that the 
-cifs vfs, unlike the smbfs vfs, does not read the smb.conf on the client system 
+Note that server ea support is required for supporting xattrs from the Linux
+cifs client, and that EA support is present in later versions of Samba (e.g. 
+3.0.6 and later (also EA support works in all versions of Windows, at least to
+shares on NTFS filesystems).  Extended Attribute (xattr) support is an optional
+feature of most Linux filesystems which may require enabling via
+make menuconfig
+ 
+Some administrators may want to change Samba's smb.conf "map archive" and 
+"create mask" parameters from the default.  Creating special devices (mknod) 
+remotely may require specifying a mkdev function to Samba if you are not using 
+Samba 3.0.6 or later.  For more information on these see the manual pages
+("man smb.conf") on the Samba server system.  Note that the cifs vfs,
+unlike the smbfs vfs, does not read the smb.conf on the client system 
 (the few optional settings are passed in on mount via -o parameters instead).  
 Note that Samba 2.2.7 or later includes a fix that allows the CIFS VFS to delete
 open files (required for strict POSIX compliance).  Windows Servers already 
 supported this feature. Samba server does not allow symlinks that refer to files
-outside of the share, so in Samba versions prior to 3.0.5, most symlinks to
+outside of the share, so in Samba versions prior to 3.0.6, most symlinks to
 files with absolute paths (ie beginning with slash) such as:
 	 ln -s /mnt/foo bar
-would be forbidden. Samba 3.0.5 server or later includes the ability to create 
+would be forbidden. Samba 3.0.6 server or later includes the ability to create 
 such symlinks safely by converting unsafe symlinks (ie symlinks to server 
 files that are outside of the share) to a samba specific format on the server
 that is ignored by local server applications and non-cifs clients and that will
@@ -147,6 +165,12 @@ of the standard mount options "noexec" and "nosuid" to reduce the risk of
 running an altered binary on your local system (downloaded from a hostile server
 or altered by a hostile router).
 
+Although mounting using format corresponding to the CIFS URL specification is
+not possible in mount.cifs yet, it is possible to use an alternate format
+for the server and sharename (which is somewhat similar to NFS style mount
+syntax) instead of the more widely used UNC format (i.e. \\server\share):
+  mount -t cifs tcp_name_of_server:share_name /mnt -o user=myname,pass=mypasswd
+
 When using the mount helper mount.cifs, passwords may be specified via alternate
 mechanisms, instead of specifying it after -o using the normal "pass=" syntax
 on the command line:
@@ -254,7 +278,33 @@ A partial list of the supported mount options follows:
 		mount helper will not prompt the user for a password
 		if guest is specified on the mount options.  If no
 		password is specified a null password will be used.
-
+  perm          Client does permission checks (vfs_permission check of uid
+		and gid of the file against the mode and desired operation),
+		Note that this is in addition to the normal ACL check on the
+		target machine done by the server software. 
+		Client permission checking is enabled by default.
+  noperm        Client does not do permission checks.  This can expose
+		files on this mount to access by other users on the local
+		client system. It is typically only needed when the server
+		supports the CIFS Unix Extensions but the UIDs/GIDs on the
+		client and server system do not match closely enough to allow
+		access by the user doing the mount.
+		Note that this does not affect the normal ACL check on the
+		target machine done by the server software (of the server
+		ACL against the user name provided at mount time).
+  setuids       If the CIFS Unix extensions are negotiated with the server
+		the client will attempt to set the effective uid and gid of
+		the local process on newly created files, directories, and
+		devices (create, mkdir, mknod).
+  nosetuids     The client will not attempt to set the uid and gid on
+		on newly created files, directories, and devices (create, 
+		mkdir, mknod) which will result in the server setting the
+		uid and gid to the default (usually the server uid of the
+		usern who mounted the share).  Letting the server (rather than
+		the client) set the uid and gid is the default. This
+		parameter has no effect if the CIFS Unix Extensions are not
+		negotiated.
+		
 The mount.cifs mount helper also accepts a few mount options before -o
 including:
 
@@ -271,8 +321,6 @@ Misc /proc/fs/cifs Flags and Debug Info
 Informational pseudo-files:
 DebugData		Displays information about active CIFS sessions
 			and shares.
-SimultaneousOps		Counter which holds maximum number of
-			simultaneous outstanding SMB/CIFS requests.
 Stats			Lists summary resource usage information as well as per
 			share statistics, if CONFIG_CIFS_STATS in enabled
 			in the kernel configuration.
@@ -326,13 +374,11 @@ and for more extensive tracing including the start of smb requests and responses
 
 	echo 1 > /proc/fs/cifs/traceSMB
 
-Three other experimental features are under development and to test 
+Two other experimental features are under development and to test 
 require enabling an ifdef (e.g. by  adding "#define CIFS_FCNTL" in cifsglob.h)
 
 	CONFIG_CIFS_QUOTA
 
-	CONFIG_CIFS_XATTR
-
 	CONFIG_CIFS_FCNTL  (fcntl needed for support of directory change 
 			    notification and perhaps later for file leases)
 
diff --git a/fs/cifs/TODO b/fs/cifs/TODO
index c4ee8107a..05464a35b 100644
--- a/fs/cifs/TODO
+++ b/fs/cifs/TODO
@@ -1,4 +1,4 @@
-version 1.16 May 27, 2004
+version 1.22 July 30, 2004 
 
 A Partial List of Missing Features
 ==================================
@@ -10,7 +10,8 @@ is a partial list of the known problems and missing features:
 a) Support for SecurityDescriptors for chmod/chgrp/chown so
 these can be supported for Windows servers
 
-b) Better pam/winbind integration
+b) Better pam/winbind integration (e.g. to handle uid mapping
+better)
 
 c) multi-user mounts - multiplexed sessionsetups over single vc
 (ie tcp session) - prettying up needed
@@ -32,42 +33,37 @@ style byte range lock differences
 
 h) quota support
 
-i) support for the Linux 2.5 kernel new feature get_xattr and set_xattr
-which will allow us to expose dos attributes as well as real
-ACLs. This support has been started in the current code, but is
-ifdeffed out.
-
-k) finish writepages support (multi-page write behind for improved
+j) finish writepages support (multi-page write behind for improved
 performance) and syncpage
 
-l) hook lower into the sockets api (as NFS/SunRPC does) to avoid the
+k) hook lower into the sockets api (as NFS/SunRPC does) to avoid the
 extra copy in/out of the socket buffers in some cases.
 
-m) finish support for IPv6.  This is mostly complete but
+l) finish support for IPv6.  This is mostly complete but
 needs a simple inet_pton like function to convert ipv6
 addresses in string representation.
 
-o) Better optimize open (and pathbased setfilesize) to reduce the
+m) Better optimize open (and pathbased setfilesize) to reduce the
 oplock breaks coming from windows srv.  Piggyback identical file
 opens on top of each other by incrementing reference count rather
 than resending (helps reduce server resource utilization and avoid
 spurious oplock breaks).
 
-p) Improve performance of readpages by sending more than one read
+o) Improve performance of readpages by sending more than one read
 at a time when 8 pages or more are requested.  Evaluate whether
 reads larger than 16K would be helpful.
 
-q) For support of Windows9x/98 we need to retry failed mounts
+p) For support of Windows9x/98 we need to retry failed mounts
 to *SMBSERVER (default server name) with the uppercase hostname
 in the RFC1001 session_init request.
 
-r) Add Extended Attributed support (for storing UID/GID info
-to Windows servers)
+q) Add support for storing symlink and fifo info to Windows servers 
+in the Extended Attribute format their SFU clients would recognize.
 
-s) Finish fcntl D_NOTIFY support so kde and gnome file list windows
+r) Finish fcntl D_NOTIFY support so kde and gnome file list windows
 will autorefresh
 
-t) Add GUI tool to configure /proc/fs/cifs settings and for display of
+s) Add GUI tool to configure /proc/fs/cifs settings and for display of
 the CIFS statistics
 
 KNOWN BUGS (updated May 27, 2004)
@@ -82,16 +78,19 @@ but recognizes them
 succeed but still return access denied (appears to be Windows 
 server not cifs client problem) and has not been reproduced recently.
 NTFS partitions do not have this problem.
-4) debug connectation lock test case 10 which fails against
+4) debug connectathon lock test case 10 which fails against
 Samba (may be unmappable due to POSIX to Windows lock model
 differences but worth investigating).  Also debug Samba to 
 see why lock test case 7 takes longer to complete to Samba
 than to Windows.
+5) implement search rewind (seeking backward in a readdir), which is
+necessary for one of the "special" subsection of posix file API
+tests in the Connectathon nfs test suite.
 
 Misc testing to do
 ==================
 1) check out max path names and max path name components against various server
-types. Return max path name in stat -f information
+types. Try nested symlinks (8 deep). Return max path name in stat -f information
 
 2) Modify file portion of ltp so it can run against a mounted network
 share and run it against cifs vfs.
@@ -102,5 +101,6 @@ and when signing is disabled to request larger read sizes (larger than
 negotiated size) and send larger write sizes to modern servers.
 
 4) More exhaustively test the recently added NT4 support against various
-NT4 service pack levels.
+NT4 service pack levels, and fix cifs_setattr for setting file times and 
+size to fall back to level 1 when error invalid level returned.
 
diff --git a/fs/cifs/asn1.c b/fs/cifs/asn1.c
index a59742e04..cf3c02767 100644
--- a/fs/cifs/asn1.c
+++ b/fs/cifs/asn1.c
@@ -201,7 +201,7 @@ asn1_header_decode(struct asn1_ctx *ctx,
 	if (def)
 		*eoc = ctx->pointer + len;
 	else
-		*eoc = 0;
+		*eoc = NULL;
 	return 1;
 }
 
diff --git a/fs/cifs/cifs_debug.c b/fs/cifs/cifs_debug.c
index 2c3d9a867..5ed31456f 100644
--- a/fs/cifs/cifs_debug.c
+++ b/fs/cifs/cifs_debug.c
@@ -62,12 +62,17 @@ cifs_debug_data_read(char *buf, char **beginBuffer, off_t offset,
 		     int count, int *eof, void *data)
 {
 	struct list_head *tmp;
+	struct list_head *tmp1;
+	struct mid_q_entry * mid_entry;
 	struct cifsSesInfo *ses;
 	struct cifsTconInfo *tcon;
 	int i;
 	int length = 0;
-	char *buf_start = buf;
+	char * original_buf = buf;
 
+	*beginBuffer = buf + offset;
+
+	
 	length =
 	    sprintf(buf,
 		    "Display Internal CIFS Data Structures for Debugging\n"
@@ -94,7 +99,7 @@ cifs_debug_data_read(char *buf, char **beginBuffer, off_t offset,
 				ses->server->secMode,
 				atomic_read(&ses->server->inFlight));
 			
-			/* length = sprintf(buf, "\nMIDs: \n");
+			length = sprintf(buf, "\nMIDs: \n");
 			buf += length;
 
 			spin_lock(&GlobalMid_Lock);
@@ -103,11 +108,11 @@ cifs_debug_data_read(char *buf, char **beginBuffer, off_t offset,
 					mid_q_entry,
 					qhead);
 				if(mid_entry) {
-					length = sprintf(buf,"State: %d com: %d pid: %d tsk: %p\n",mid_entry->midState,mid_entry->command,mid_entry->pid,mid_entry->tsk);
+					length = sprintf(buf,"State: %d com: %d pid: %d tsk: %p mid %d\n",mid_entry->midState,mid_entry->command,mid_entry->pid,mid_entry->tsk,mid_entry->mid);
 					buf += length;
 				}
 			}
-			spin_unlock(&GlobalMid_Lock); */
+			spin_unlock(&GlobalMid_Lock); 
 		}
 
 	}
@@ -152,30 +157,20 @@ cifs_debug_data_read(char *buf, char **beginBuffer, off_t offset,
 	length = sprintf(buf, "\n");
 	buf += length;
 
-	*eof = 1;
 	/* BB add code to dump additional info such as TCP session info now */
-	/*
-	   if (offset >= (buf - buf_start)) 
-	   {
-	   *beginBuffer = buf;
-	   return 0;
-	   }
-	   *beginBuffer = buf + offset;
-	   if ((buf - buf_start - offset) > count)
-	   return count;
-   else */
-	return (buf - buf_start - offset);
-}
-
-int
-cifs_total_xid_read(char *buf, char **beginBuffer, off_t offset,
-		    int length, int *eof, void *data)
-{
+	/* Now calculate total size of returned data */
+	length = buf - original_buf;
 
-	length =
-	    sprintf(buf,
-		    "Total vfs operations: %d and maximum simultaneous serviced by this filesystem: %d\n",
-		    GlobalCurrentXid,GlobalMaxActiveXid);
+	if(offset + count >= length)
+		*eof = 1;
+	if(length < offset) {
+		*eof = 1;
+		return 0;
+	} else {
+		length = length - offset;
+	}
+	if (length > count)
+		length = count;
 
 	return length;
 }
@@ -183,12 +178,14 @@ cifs_total_xid_read(char *buf, char **beginBuffer, off_t offset,
 #ifdef CONFIG_CIFS_STATS
 int
 cifs_stats_read(char *buf, char **beginBuffer, off_t offset,
-		  int length, int *eof, void *data)
+		  int count, int *eof, void *data)
 {
-	int item_length,i;
+	int item_length,i,length;
 	struct list_head *tmp;
 	struct cifsTconInfo *tcon;
 
+	*beginBuffer = buf + offset;
+
 	length = sprintf(buf,
 			"Resources in use\nCIFS Session: %d\n",
 			sesInfoAllocCount.counter);
@@ -214,6 +211,12 @@ cifs_stats_read(char *buf, char **beginBuffer, off_t offset,
 	length += item_length;
 	buf += item_length;
 
+	item_length = sprintf(buf,
+		"Total vfs operations: %d maximum at one time: %d\n",
+		GlobalCurrentXid,GlobalMaxActiveXid);
+	length += item_length;
+	buf += item_length;
+
 	i = 0;
 	read_lock(&GlobalSMBSeslock);
 	list_for_each(tmp, &GlobalTreeConnectionList) {
@@ -235,10 +238,12 @@ cifs_stats_read(char *buf, char **beginBuffer, off_t offset,
 			atomic_read(&tcon->num_reads),
 			(long long)(tcon->bytes_read));
 		buf += item_length;
+		length += item_length;
 		item_length = sprintf(buf,"\nWrites: %d Bytes: %lld",
 			atomic_read(&tcon->num_writes),
 			(long long)(tcon->bytes_written));
 		buf += item_length;
+		length += item_length;
 		item_length = sprintf(buf,
 			"\nOpens: %d Deletes: %d\nMkdirs: %d Rmdirs: %d",
 			atomic_read(&tcon->num_opens),
@@ -247,10 +252,29 @@ cifs_stats_read(char *buf, char **beginBuffer, off_t offset,
 			atomic_read(&tcon->num_rmdirs));
 		buf += item_length;
 		length += item_length;
+		item_length = sprintf(buf,
+			"\nRenames: %d T2 Renames %d",
+			atomic_read(&tcon->num_renames),
+			atomic_read(&tcon->num_t2renames));
+		buf += item_length;
+		length += item_length;
 	}
 	read_unlock(&GlobalSMBSeslock);
 
+	buf += sprintf(buf,"\n");
+	length++;
 
+	if(offset + count >= length)
+		*eof = 1;
+	if(length < offset) {
+		*eof = 1;
+		return 0;
+	} else {
+		length = length - offset;
+	}
+	if (length > count)
+		length = count;
+		
 	return length;
 }
 #endif
@@ -289,67 +313,65 @@ cifs_proc_init(void)
 
 	proc_fs_cifs->owner = THIS_MODULE;
 	create_proc_read_entry("DebugData", 0, proc_fs_cifs,
-				cifs_debug_data_read, 0);
+				cifs_debug_data_read, NULL);
 
-	create_proc_read_entry("SimultaneousOps", 0, proc_fs_cifs,
-				cifs_total_xid_read, 0);
 #ifdef CONFIG_CIFS_STATS
 	create_proc_read_entry("Stats", 0, proc_fs_cifs,
-				cifs_stats_read, 0);
+				cifs_stats_read, NULL);
 #endif
 	pde = create_proc_read_entry("cifsFYI", 0, proc_fs_cifs,
-				cifsFYI_read, 0);
+				cifsFYI_read, NULL);
 	if (pde)
 		pde->write_proc = cifsFYI_write;
 
 	pde =
 	    create_proc_read_entry("traceSMB", 0, proc_fs_cifs,
-				traceSMB_read, 0);
+				traceSMB_read, NULL);
 	if (pde)
 		pde->write_proc = traceSMB_write;
 
 	pde = create_proc_read_entry("OplockEnabled", 0, proc_fs_cifs,
-				oplockEnabled_read, 0);
+				oplockEnabled_read, NULL);
 	if (pde)
 		pde->write_proc = oplockEnabled_write;
 
 	pde = create_proc_read_entry("QuotaEnabled", 0, proc_fs_cifs,
-				quotaEnabled_read, 0);
+				quotaEnabled_read, NULL);
 	if (pde)
 		pde->write_proc = quotaEnabled_write;
 
 	pde = create_proc_read_entry("LinuxExtensionsEnabled", 0, proc_fs_cifs,
-				linuxExtensionsEnabled_read, 0);
+				linuxExtensionsEnabled_read, NULL);
 	if (pde)
 		pde->write_proc = linuxExtensionsEnabled_write;
 
 	pde =
 	    create_proc_read_entry("MultiuserMount", 0, proc_fs_cifs,
-				multiuser_mount_read, 0);
+				multiuser_mount_read, NULL);
 	if (pde)
 		pde->write_proc = multiuser_mount_write;
 
 	pde =
 	    create_proc_read_entry("ExtendedSecurity", 0, proc_fs_cifs,
-				extended_security_read, 0);
+				extended_security_read, NULL);
 	if (pde)
 		pde->write_proc = extended_security_write;
 
 	pde =
 	create_proc_read_entry("LookupCacheEnabled", 0, proc_fs_cifs,
-				lookupFlag_read, 0);
+				lookupFlag_read, NULL);
 	if (pde)
 		pde->write_proc = lookupFlag_write;
 
 	pde =
 	    create_proc_read_entry("NTLMV2Enabled", 0, proc_fs_cifs,
-				ntlmv2_enabled_read, 0);
+				ntlmv2_enabled_read, NULL);
 	if (pde)
 		pde->write_proc = ntlmv2_enabled_write;
 
 	pde =
 	    create_proc_read_entry("PacketSigningEnabled", 0, proc_fs_cifs,
-				packet_signing_enabled_read, 0);
+				packet_signing_enabled_read, NULL);
 	if (pde)
 		pde->write_proc = packet_signing_enabled_write;
 }
@@ -363,7 +385,6 @@ cifs_proc_clean(void)
 	remove_proc_entry("DebugData", proc_fs_cifs);
 	remove_proc_entry("cifsFYI", proc_fs_cifs);
 	remove_proc_entry("traceSMB", proc_fs_cifs);
-	remove_proc_entry("SimultaneousOps", proc_fs_cifs);
 #ifdef CONFIG_CIFS_STATS
 	remove_proc_entry("Stats", proc_fs_cifs);
 #endif
diff --git a/fs/cifs/cifs_fs_sb.h b/fs/cifs/cifs_fs_sb.h
index 8007c2e92..592af83bc 100644
--- a/fs/cifs/cifs_fs_sb.h
+++ b/fs/cifs/cifs_fs_sb.h
@@ -18,6 +18,9 @@
 #ifndef _CIFS_FS_SB_H
 #define _CIFS_FS_SB_H
 
+#define CIFS_MOUNT_NO_PERM	1 /* do not do client vfs_perm check */
+#define CIFS_MOUNT_SET_UID      2 /* set current->euid in create etc. */
+
 struct cifs_sb_info {
 	struct cifsTconInfo *tcon;	/* primary mount */
 	struct list_head nested_tcon_q;
@@ -28,5 +31,6 @@ struct cifs_sb_info {
 	gid_t	mnt_gid;
 	mode_t	mnt_file_mode;
 	mode_t	mnt_dir_mode;
+	int     mnt_cifs_flags;
 };
 #endif				/* _CIFS_FS_SB_H */
diff --git a/fs/cifs/cifs_uniupr.h b/fs/cifs/cifs_uniupr.h
index f31b1b1ac..decd138f1 100644
--- a/fs/cifs/cifs_uniupr.h
+++ b/fs/cifs/cifs_uniupr.h
@@ -132,7 +132,7 @@ const struct UniCaseRange CifsUniUpperRange[] = {
 	{0x0490, 0x04cc, UniCaseRangeU0490},
 	{0x1e00, 0x1ffc, UniCaseRangeU1e00},
 	{0xff40, 0xff5a, UniCaseRangeUff40},
-	{0, 0, 0}
+	{0}
 };
 #endif
 
diff --git a/fs/cifs/cifsfs.c b/fs/cifs/cifsfs.c
index 1fe2654a7..fbc737e2e 100644
--- a/fs/cifs/cifsfs.c
+++ b/fs/cifs/cifsfs.c
@@ -41,15 +41,11 @@
 #include "cifs_fs_sb.h"
 #include <linux/mm.h>
 #define CIFS_MAGIC_NUMBER 0xFF534D42	/* the first four bytes of SMB PDUs */
-/* BB when mempool_resize is added back in, we will resize pool on new mount */
-#define CIFS_MIN_RCV_POOL 11 /* enough for progress to five servers */
 
 #ifdef CONFIG_CIFS_QUOTA
 static struct quotactl_ops cifs_quotactl_ops;
 #endif
 
-extern struct file_system_type cifs_fs_type;
-
 int cifsFYI = 0;
 int cifsERROR = 1;
 int traceSMB = 0;
@@ -194,15 +190,11 @@ cifs_statfs(struct super_block *sb, struct kstatfs *buf)
 
 static int cifs_permission(struct inode * inode, int mask, struct nameidata *nd)
 {
-        struct cifs_sb_info *cifs_sb;
+	struct cifs_sb_info *cifs_sb;
 
-        cifs_sb = CIFS_SB(inode->i_sb);
+	cifs_sb = CIFS_SB(inode->i_sb);
 
-        if (cifs_sb->tcon->ses->capabilities & CAP_UNIX) {
-		/* the server supports the Unix-like mode bits and does its
-		own permission checks, and therefore we do not allow the file
-		mode to be overriden on these mounts - so do not do perm
-		check on client side */
+	if (cifs_sb->mnt_cifs_flags & CIFS_MOUNT_NO_PERM) {
 		return 0;
 	} else /* file mode might have been restricted at mount time 
 		on the client (above and beyond ACL on servers) for  
@@ -542,18 +534,14 @@ struct file_operations cifs_file_ops = {
 	.flush = cifs_flush,
 	.mmap  = cifs_file_mmap,
 	.sendfile = generic_file_sendfile,
-#ifdef CONFIG_CIFS_FCNTL
-	.fcntl = cifs_fcntl,
-#endif
+	.dir_notify = cifs_dir_notify,
 };
 
 struct file_operations cifs_dir_ops = {
 	.readdir = cifs_readdir,
 	.release = cifs_closedir,
 	.read    = generic_read_dir,
-#ifdef CONFIG_CIFS_FCNTL
-	.fcntl   = cifs_fcntl,
-#endif
+	.dir_notify = cifs_dir_notify,
 };
 
 static void
@@ -748,6 +736,7 @@ init_cifs(void)
  */
 	atomic_set(&sesInfoAllocCount, 0);
 	atomic_set(&tconInfoAllocCount, 0);
+	atomic_set(&tcpSesAllocCount,0);
 	atomic_set(&tcpSesReconnectCount, 0);
 	atomic_set(&tconInfoReconnectCount, 0);
 
diff --git a/fs/cifs/cifsfs.h b/fs/cifs/cifsfs.h
index b8be30c09..866b68c8b 100644
--- a/fs/cifs/cifsfs.h
+++ b/fs/cifs/cifsfs.h
@@ -32,14 +32,10 @@
 #define TRUE 1
 #endif
 
-extern int map_cifs_error(int error_class, int error_code,
-			  int status_codes_negotiated);
-
 extern struct address_space_operations cifs_addr_ops;
 
 /* Functions related to super block operations */
 extern struct super_operations cifs_super_ops;
-extern void cifs_put_inode(struct inode *);
 extern void cifs_read_inode(struct inode *);
 extern void cifs_delete_inode(struct inode *);
 /* extern void cifs_write_inode(struct inode *); *//* BB not needed yet */
@@ -78,7 +74,7 @@ extern int cifs_file_mmap(struct file * , struct vm_area_struct *);
 extern struct file_operations cifs_dir_ops;
 extern int cifs_dir_open(struct inode *inode, struct file *file);
 extern int cifs_readdir(struct file *file, void *direntry, filldir_t filldir);
-extern long cifs_fcntl(int, unsigned int, unsigned long, struct file *);
+extern int cifs_dir_notify(struct file *, unsigned long arg);
 
 /* Functions related to dir entries */
 extern struct dentry_operations cifs_dentry_ops;
@@ -93,5 +89,5 @@ extern int 	cifs_setxattr(struct dentry *, const char *, const void *,
 			 size_t, int);
 extern ssize_t	cifs_getxattr(struct dentry *, const char *, void *, size_t);
 extern ssize_t	cifs_listxattr(struct dentry *, char *, size_t);
-#define CIFS_VERSION   "1.18"
+#define CIFS_VERSION   "1.20"
 #endif				/* _CIFSFS_H */
diff --git a/fs/cifs/cifsglob.h b/fs/cifs/cifsglob.h
index 427d9c9d5..21ac75cf0 100644
--- a/fs/cifs/cifsglob.h
+++ b/fs/cifs/cifsglob.h
@@ -32,6 +32,8 @@
 				   termination then *2 for unicode versions */
 #define MAX_PASSWORD_SIZE 16
 
+#define CIFS_MIN_RCV_POOL 4
+
 /*
  * MAX_REQ is the maximum number of requests that WE will send
  * on one socket concurently. It also matches the most common
@@ -211,6 +213,8 @@ struct cifsTconInfo {
 	atomic_t num_deletes;
 	atomic_t num_mkdirs;
 	atomic_t num_rmdirs;
+	atomic_t num_renames;
+	atomic_t num_t2renames;
 	__u64    bytes_read;
 	__u64    bytes_written;
 	spinlock_t stat_lock;
@@ -389,7 +393,7 @@ GLOBAL_EXTERN char Local_System_Name[15];
  */
 GLOBAL_EXTERN atomic_t sesInfoAllocCount;
 GLOBAL_EXTERN atomic_t tconInfoAllocCount;
-
+GLOBAL_EXTERN atomic_t tcpSesAllocCount;
 GLOBAL_EXTERN atomic_t tcpSesReconnectCount;
 GLOBAL_EXTERN atomic_t tconInfoReconnectCount;
 
diff --git a/fs/cifs/cifspdu.h b/fs/cifs/cifspdu.h
index 067eb4e3e..94646af9f 100644
--- a/fs/cifs/cifspdu.h
+++ b/fs/cifs/cifspdu.h
@@ -1046,6 +1046,8 @@ typedef union smb_com_transaction2 {
 
 /* PathInfo/FileInfo infolevels */
 #define SMB_INFO_STANDARD                   1
+#define SMB_SET_FILE_EA                     2
+#define SMB_QUERY_FILE_EA_SIZE              2
 #define SMB_INFO_QUERY_EAS_FROM_LIST        3
 #define SMB_INFO_QUERY_ALL_EAS              4
 #define SMB_INFO_IS_NAME_VALID              6
@@ -1620,6 +1622,19 @@ typedef struct {
 	char LinkDest[1];
 } FILE_UNIX_LINK_INFO;		/* level 513 QPathInfo */
 
+typedef struct {
+	__u16 CreationDate;
+	__u16 CreationTime;
+	__u16 LastAccessDate;
+	__u16 LastAccessTime;
+	__u16 LastWriteDate;
+	__u16 LastWriteTime;
+	__u32 DataSize; /* File Size (EOF) */
+	__u32 AllocationSize;
+	__u16 Attributes; /* verify not u32 */
+	__u32 EASize;
+} FILE_INFO_STANDARD;  /* level 1 SetPath/FileInfo */
+
 /* defines for enumerating possible values of the Unix type field below */
 #define UNIX_FILE      0
 #define UNIX_DIR       1
@@ -1680,12 +1695,12 @@ typedef struct {
 } FILE_DIRECTORY_INFO;   /* level 257 FF response data area */
 
 struct gea {
-	unsigned char cbName;
-	char szName[1];
+	unsigned char name_len;
+	char name[1];
 };
 
 struct gealist {
-	unsigned long cbList;
+	unsigned long list_len;
 	struct gea list[1];
 };
 
@@ -1693,7 +1708,7 @@ struct fea {
 	unsigned char EA_flags;
 	__u8 name_len;
 	__u16 value_len;
-	char szName[1];
+	char name[1];
 	/* optionally followed by value */
 };
 /* flags for _FEA.fEA */
diff --git a/fs/cifs/cifsproto.h b/fs/cifs/cifsproto.h
index cf99e22c6..827370077 100644
--- a/fs/cifs/cifsproto.h
+++ b/fs/cifs/cifsproto.h
@@ -63,10 +63,10 @@ extern u64 cifs_UnixTimeToNT(struct timespec);
 extern int cifs_get_inode_info(struct inode **pinode,
 			const unsigned char *search_path, 
 			FILE_ALL_INFO * pfile_info,
-			struct super_block *sb);
+			struct super_block *sb, int xid);
 extern int cifs_get_inode_info_unix(struct inode **pinode,
 			const unsigned char *search_path,
-			struct super_block *sb);
+			struct super_block *sb,int xid);
 
 extern int cifs_setup_session(unsigned int xid, struct cifsSesInfo *pSesInfo, 
 			struct nls_table * nls_info);
@@ -128,10 +128,10 @@ extern int CIFSSMBQFSUnixInfo(const int xid, struct cifsTconInfo *tcon,
 			const struct nls_table *nls_codepage);
 
 extern int CIFSSMBSetTimes(const int xid, struct cifsTconInfo *tcon,
-			char *fileName, FILE_BASIC_INFO * data,
+			const char *fileName, const FILE_BASIC_INFO * data,
 			const struct nls_table *nls_codepage);
 extern int CIFSSMBSetEOF(const int xid, struct cifsTconInfo *tcon,
-			char *fileName, __u64 size,int setAllocationSizeFlag,
+			const char *fileName, __u64 size,int setAllocationSizeFlag,
 			const struct nls_table *nls_codepage);
 extern int CIFSSMBSetFileSize(const int xid, struct cifsTconInfo *tcon,
 			 __u64 size, __u16 fileHandle,__u32 opener_pid, int AllocSizeFlag);
@@ -213,31 +213,6 @@ extern int cifs_verify_signature(const struct smb_hdr *, const char * mac_key,
 extern int cifs_calculate_mac_key(char * key,const char * rn,const char * pass);
 extern void CalcNTLMv2_partial_mac_key(struct cifsSesInfo *, struct nls_table *);
 extern void CalcNTLMv2_response(const struct cifsSesInfo *,char * );
-
-extern int CIFSBuildServerList(int xid, char *serverBufferList,
-			int recordlength, int *entries,
-			int *totalEntries, int *topoChangedFlag);
-extern int CIFSSMBQueryShares(int xid, struct cifsTconInfo *tcon,
-			struct shareInfo *shareList, int bufferLen,
-			int *entries, int *totalEntries);
-extern int CIFSSMBQueryAlias(int xid, struct cifsTconInfo *tcon,
-			struct aliasInfo *aliasList, int bufferLen,
-			int *entries, int *totalEntries);
-extern int CIFSSMBAliasInfo(int xid, struct cifsTconInfo *tcon,
-			char *aliasName, char *serverName,
-			char *shareName, char *comment);
-extern int CIFSSMBGetShareInfo(int xid, struct cifsTconInfo *tcon,
-			char *share, char *comment);
-extern int CIFSSMBGetUserPerms(int xid, struct cifsTconInfo *tcon,
-			char *userName, char *searchName, int *perms);
-extern int CIFSSMBSync(int xid, struct cifsTconInfo *tcon, int netfid, int pid);
-
-extern int CIFSSMBSeek(int xid,
-			struct cifsTconInfo *tcon,
-			int netfid,
-			int pid,
-			int whence, unsigned long offset, long long *newoffset);
-
 extern int CIFSSMBCopy(int xid,
 			struct cifsTconInfo *source_tcon,
 			const char *fromName,
@@ -247,8 +222,15 @@ extern int CIFSSMBCopy(int xid,
 extern int CIFSSMBNotify(const int xid, struct cifsTconInfo *tcon, 
 			const int notify_subdirs,const __u16 netfid,__u32 filter,
 			const struct nls_table *nls_codepage);
-extern int CIFSSMBQAllEAs(const int xid, struct cifsTconInfo *tcon,
-		 const unsigned char *searchName,
-		 char * EAData, size_t size,
-		 const struct nls_table *nls_codepage);
+extern ssize_t CIFSSMBQAllEAs(const int xid, struct cifsTconInfo *tcon,
+			const unsigned char *searchName, char * EAData,
+			size_t bufsize, const struct nls_table *nls_codepage);
+extern ssize_t CIFSSMBQueryEA(const int xid,struct cifsTconInfo * tcon,
+		const unsigned char * searchName,const unsigned char * ea_name,
+		unsigned char * ea_value, size_t buf_size, 
+		const struct nls_table *nls_codepage);
+extern int CIFSSMBSetEA(const int xid, struct cifsTconInfo *tcon, 
+		const char *fileName, const char * ea_name, 
+		const void * ea_value, const __u16 ea_value_len, 
+		const struct nls_table *nls_codepage);
 #endif			/* _CIFSPROTO_H */
diff --git a/fs/cifs/cifssmb.c b/fs/cifs/cifssmb.c
index 420742abb..dc9e0fd4e 100644
--- a/fs/cifs/cifssmb.c
+++ b/fs/cifs/cifssmb.c
@@ -190,7 +190,7 @@ CIFSSMBNegotiate(unsigned int xid, struct cifsSesInfo *ses)
 		rc = -EIO;
 		return rc;
 	}
-	rc = smb_init(SMB_COM_NEGOTIATE, 0, 0 /* no tcon yet */ ,
+	rc = smb_init(SMB_COM_NEGOTIATE, 0, NULL /* no tcon yet */ ,
 		      (void **) &pSMB, (void **) &pSMBr);
 	if (rc)
 		return rc;
@@ -315,8 +315,6 @@ CIFSSMBTDis(const int xid, struct cifsTconInfo *tcon)
 		return 0;  
 	}
 
-/* BB remove (from server) list of shares - but with smp safety  BB */
-/* BB is ses active - do we need to check here - but how? BB */
 	if((tcon->ses == 0) || (tcon->ses->server == 0)) {    
 		up(&tcon->tconSem);
 		return -EIO;
@@ -365,7 +363,7 @@ CIFSSMBLogoff(const int xid, struct cifsSesInfo *ses)
 		return -EBUSY;
 	}
 
-	rc = smb_init(SMB_COM_LOGOFF_ANDX, 2, 0 /* no tcon anymore */,
+	rc = smb_init(SMB_COM_LOGOFF_ANDX, 2, NULL /* no tcon anymore */,
 		 (void **) &pSMB, (void **) &smb_buffer_response);
 
 	if(ses->server->secMode & (SECMODE_SIGN_REQUIRED | SECMODE_SIGN_ENABLED))
@@ -387,6 +385,7 @@ CIFSSMBLogoff(const int xid, struct cifsSesInfo *ses)
 			spin_lock(&GlobalMid_Lock);
 			ses->server->tcpStatus = CifsExiting;
 			spin_unlock(&GlobalMid_Lock);
+			rc = -ESHUTDOWN;
 		}
 	}
 	if (pSMB)
@@ -819,14 +818,20 @@ CIFSSMBLock(const int xid, struct cifsTconInfo *tcon,
 	pSMB->AndXCommand = 0xFF;	/* none */
 	pSMB->Fid = smb_file_id; /* netfid stays le */
 
-	pSMB->Locks[0].Pid = cpu_to_le16(current->tgid);
-	temp = cpu_to_le64(len);
-	pSMB->Locks[0].LengthLow = (__u32)(len & 0xFFFFFFFF);
-	pSMB->Locks[0].LengthHigh =  (__u32)(len>>32);
-	temp = cpu_to_le64(offset);
-	pSMB->Locks[0].OffsetLow = (__u32)(offset & 0xFFFFFFFF);
-	pSMB->Locks[0].OffsetHigh = (__u32)(offset>>32);
-	pSMB->ByteCount = sizeof (LOCKING_ANDX_RANGE);
+	if(numLock != 0) {
+		pSMB->Locks[0].Pid = cpu_to_le16(current->tgid);
+		/* BB where to store pid high? */
+		temp = cpu_to_le64(len);
+		pSMB->Locks[0].LengthLow = (__u32)(temp & 0xFFFFFFFF);
+		pSMB->Locks[0].LengthHigh =  (__u32)(temp>>32);
+		temp = cpu_to_le64(offset);
+		pSMB->Locks[0].OffsetLow = (__u32)(temp & 0xFFFFFFFF);
+		pSMB->Locks[0].OffsetHigh = (__u32)(temp>>32);
+		pSMB->ByteCount = sizeof (LOCKING_ANDX_RANGE);
+	} else {
+		/* oplock break */
+		pSMB->ByteCount = 0;
+	}
 	pSMB->hdr.smb_buf_length += pSMB->ByteCount;
 	pSMB->ByteCount = cpu_to_le16(pSMB->ByteCount);
 
@@ -941,7 +946,14 @@ renameRetry:
 			 (struct smb_hdr *) pSMBr, &bytes_returned, 0);
 	if (rc) {
 		cFYI(1, ("Send error in rename = %d", rc));
+	} 
+
+#ifdef CONFIG_CIFS_STATS
+	  else {
+		atomic_inc(&tcon->num_renames);
 	}
+#endif
+
 	if (pSMB)
 		cifs_buf_release(pSMB);
 
@@ -1017,7 +1029,11 @@ int CIFSSMBRenameOpenFile(const int xid,struct cifsTconInfo *pTcon,
 	if (rc) {
 		cFYI(1,("Send error in Rename (by file handle) = %d", rc));
 	}
-
+#ifdef CONFIG_CIFS_STATS
+	  else {
+		atomic_inc(&pTcon->num_t2renames);
+	}
+#endif
 	if (pSMB)
 		cifs_buf_release(pSMB);
 
@@ -2051,7 +2067,7 @@ CIFSGetDFSRefer(const int xid, struct cifsSesInfo *ses,
 	if (ses == NULL)
 		return -ENODEV;
 getDFSRetry:
-	rc = smb_init(SMB_COM_TRANSACTION2, 15, 0, (void **) &pSMB,
+	rc = smb_init(SMB_COM_TRANSACTION2, 15, NULL, (void **) &pSMB,
 		      (void **) &pSMBr);
 	if (rc)
 		return rc;
@@ -2271,7 +2287,7 @@ QFSInfoRetry:
 }
 
 int
-CIFSSMBQFSAttributeInfo(int xid, struct cifsTconInfo *tcon,
+CIFSSMBQFSAttributeInfo(const int xid, struct cifsTconInfo *tcon,
 			const struct nls_table *nls_codepage)
 {
 /* level 0x105  SMB_QUERY_FILE_SYSTEM_INFO */
@@ -2343,7 +2359,7 @@ QFSAttributeRetry:
 }
 
 int
-CIFSSMBQFSDeviceInfo(int xid, struct cifsTconInfo *tcon,
+CIFSSMBQFSDeviceInfo(const int xid, struct cifsTconInfo *tcon,
 		     const struct nls_table *nls_codepage)
 {
 /* level 0x104 SMB_QUERY_FILE_SYSTEM_INFO */
@@ -2416,7 +2432,7 @@ QFSDeviceRetry:
 }
 
 int
-CIFSSMBQFSUnixInfo(int xid, struct cifsTconInfo *tcon,
+CIFSSMBQFSUnixInfo(const int xid, struct cifsTconInfo *tcon,
 		   const struct nls_table *nls_codepage)
 {
 /* level 0x200  SMB_QUERY_CIFS_UNIX_INFO */
@@ -2496,7 +2512,7 @@ QFSUnixRetry:
    in Samba which this routine can run into */
 
 int
-CIFSSMBSetEOF(int xid, struct cifsTconInfo *tcon, char *fileName,
+CIFSSMBSetEOF(const int xid, struct cifsTconInfo *tcon, const char *fileName,
 	      __u64 size, int SetAllocation, const struct nls_table *nls_codepage)
 {
 	struct smb_com_transaction2_spi_req *pSMB = NULL;
@@ -2676,8 +2692,9 @@ CIFSSMBSetFileSize(const int xid, struct cifsTconInfo *tcon, __u64 size,
 }
 
 int
-CIFSSMBSetTimes(int xid, struct cifsTconInfo *tcon, char *fileName,
-		FILE_BASIC_INFO * data, const struct nls_table *nls_codepage)
+CIFSSMBSetTimes(const int xid, struct cifsTconInfo *tcon, const char *fileName,
+		const FILE_BASIC_INFO * data, 
+		const struct nls_table *nls_codepage)
 {
 	TRANSACTION2_SPI_REQ *pSMB = NULL;
 	TRANSACTION2_SPI_RSP *pSMBr = NULL;
@@ -2754,6 +2771,89 @@ SetTimesRetry:
 	return rc;
 }
 
+
+int
+CIFSSMBSetTimesLegacy(int xid, struct cifsTconInfo *tcon, char *fileName,
+		FILE_INFO_STANDARD * data, const struct nls_table *nls_codepage)
+{
+	TRANSACTION2_SPI_REQ *pSMB = NULL;
+	TRANSACTION2_SPI_RSP *pSMBr = NULL;
+	int name_len;
+	int rc = 0;
+	int bytes_returned = 0;
+	char *data_offset;
+
+	cFYI(1, ("In SetTimesLegacy"));
+
+SetTimesRetryLegacy:
+	rc = smb_init(SMB_COM_TRANSACTION2, 15, tcon, (void **) &pSMB,
+		      (void **) &pSMBr);
+	if (rc)
+		return rc;
+
+	if (pSMB->hdr.Flags2 & SMBFLG2_UNICODE) {
+		name_len =
+		    cifs_strtoUCS((wchar_t *) pSMB->FileName, fileName, 530
+				  /* find define for this maxpathcomponent */
+				  , nls_codepage);
+		name_len++;	/* trailing null */
+		name_len *= 2;
+	} else {		/* BB improve the check for buffer overruns BB */
+		name_len = strnlen(fileName, 530);
+		name_len++;	/* trailing null */
+		strncpy(pSMB->FileName, fileName, name_len);
+	}
+/* BB fixme - we have to map to FILE_STANDARD_INFO (level 1 info
+	in parent function, from the better and ususal FILE_BASIC_INFO */
+	pSMB->ParameterCount = 6 + name_len;
+	pSMB->DataCount = sizeof (FILE_INFO_STANDARD);
+	pSMB->MaxParameterCount = cpu_to_le16(2);
+	pSMB->MaxDataCount = cpu_to_le16(1000);	/* BB find exact max SMB PDU from sess structure BB */
+	pSMB->MaxSetupCount = 0;
+	pSMB->Reserved = 0;
+	pSMB->Flags = 0;
+	pSMB->Timeout = 0;
+	pSMB->Reserved2 = 0;
+	pSMB->ParameterOffset = offsetof(struct smb_com_transaction2_spi_req,
+                                     InformationLevel) - 4;
+	pSMB->DataOffset = pSMB->ParameterOffset + pSMB->ParameterCount;
+	data_offset = (char *) (&pSMB->hdr.Protocol) + pSMB->DataOffset;
+	pSMB->ParameterOffset = cpu_to_le16(pSMB->ParameterOffset);
+	pSMB->DataOffset = cpu_to_le16(pSMB->DataOffset);
+	pSMB->SetupCount = 1;
+	pSMB->Reserved3 = 0;
+	pSMB->SubCommand = cpu_to_le16(TRANS2_SET_PATH_INFORMATION);
+	pSMB->ByteCount = 3 /* pad */  + pSMB->ParameterCount + pSMB->DataCount;
+
+	pSMB->DataCount = cpu_to_le16(pSMB->DataCount);
+	pSMB->ParameterCount = cpu_to_le16(pSMB->ParameterCount);
+	pSMB->TotalDataCount = pSMB->DataCount;
+	pSMB->TotalParameterCount = pSMB->ParameterCount;
+	/* I doubt that passthrough levels apply to this old
+	preNT info level */
+/*	if (tcon->ses->capabilities & CAP_INFOLEVEL_PASSTHRU)
+		pSMB->InformationLevel = cpu_to_le16(SMB_SET_FILE_BASIC_INFO2);
+	else*/
+		pSMB->InformationLevel = cpu_to_le16(SMB_INFO_STANDARD);
+	pSMB->Reserved4 = 0;
+	pSMB->hdr.smb_buf_length += pSMB->ByteCount;
+	memcpy(data_offset, data, sizeof (FILE_INFO_STANDARD));
+	pSMB->ByteCount = cpu_to_le16(pSMB->ByteCount);
+	rc = SendReceive(xid, tcon->ses, (struct smb_hdr *) pSMB,
+			 (struct smb_hdr *) pSMBr, &bytes_returned, 0);
+	if (rc) {
+		cFYI(1, ("SetPathInfo (times legacy) returned %d", rc));
+	}
+
+	if (pSMB)
+		cifs_buf_release(pSMB);
+
+	if (rc == -EAGAIN)
+		goto SetTimesRetryLegacy;
+
+	return rc;
+}
+
 int
 CIFSSMBUnixSetPerms(const int xid, struct cifsTconInfo *tcon,
 		    char *fileName, __u64 mode, __u64 uid, __u64 gid,
@@ -2820,6 +2920,23 @@ setPermsRetry:
 	data_offset->DevMajor = cpu_to_le64(MAJOR(device));
 	data_offset->DevMinor = cpu_to_le64(MINOR(device));
 	data_offset->Permissions = cpu_to_le64(mode);
+    
+	if(S_ISREG(mode))
+		data_offset->Type = cpu_to_le32(UNIX_FILE);
+	else if(S_ISDIR(mode))
+		data_offset->Type = cpu_to_le32(UNIX_DIR);
+	else if(S_ISLNK(mode))
+		data_offset->Type = cpu_to_le32(UNIX_SYMLINK);
+	else if(S_ISCHR(mode))
+		data_offset->Type = cpu_to_le32(UNIX_CHARDEV);
+	else if(S_ISBLK(mode))
+		data_offset->Type = cpu_to_le32(UNIX_BLOCKDEV);
+	else if(S_ISFIFO(mode))
+		data_offset->Type = cpu_to_le32(UNIX_FIFO);
+	else if(S_ISSOCK(mode))
+		data_offset->Type = cpu_to_le32(UNIX_SOCKET);
+
+
 	pSMB->ByteCount = cpu_to_le16(pSMB->ByteCount);
 	rc = SendReceive(xid, tcon->ses, (struct smb_hdr *) pSMB,
 			 (struct smb_hdr *) pSMBr, &bytes_returned, 0);
@@ -2882,10 +2999,10 @@ int CIFSSMBNotify(const int xid, struct cifsTconInfo *tcon,
 	return rc;	
 }
 #ifdef CONFIG_CIFS_XATTR
-int
+ssize_t
 CIFSSMBQAllEAs(const int xid, struct cifsTconInfo *tcon,
 		 const unsigned char *searchName,
-		 char * EAData, size_t size,
+		 char * EAData, size_t buf_size,
 		 const struct nls_table *nls_codepage)
 {
 		/* BB assumes one setup word */
@@ -2894,6 +3011,8 @@ CIFSSMBQAllEAs(const int xid, struct cifsTconInfo *tcon,
 	int rc = 0;
 	int bytes_returned;
 	int name_len;
+	struct fea * temp_fea;
+	char * temp_ptr;
 
 	cFYI(1, ("In Query All EAs path %s", searchName));
 QAllEAsRetry:
@@ -2909,7 +3028,7 @@ QAllEAsRetry:
 				  , nls_codepage);
 		name_len++;	/* trailing null */
 		name_len *= 2;
-	} else {		/* BB improve the check for buffer overruns BB */
+	} else {	/* BB improve the check for buffer overruns BB */
 		name_len = strnlen(searchName, 530);
 		name_len++;	/* trailing null */
 		strncpy(pSMB->FileName, searchName, name_len);
@@ -2968,7 +3087,53 @@ QAllEAsRetry:
 			ea_response_data = (struct fealist *)
 				(((char *) &pSMBr->hdr.Protocol) +
 				pSMBr->DataOffset);
+			ea_response_data->list_len = 
+				cpu_to_le32(ea_response_data->list_len);
 			cFYI(1,("ea length %d",ea_response_data->list_len));
+			name_len = ea_response_data->list_len;
+			if(name_len <= 8) {
+			/* returned EA size zeroed at top of function */
+				cFYI(1,("empty EA list returned from server"));
+			} else {
+				/* account for ea list len */
+				name_len -= 4;
+				temp_fea = ea_response_data->list;
+				temp_ptr = (char *)temp_fea;
+				while(name_len > 0) {
+					name_len -= 4;
+					temp_ptr += 4;
+					rc += temp_fea->name_len;
+				/* account for prefix user. and trailing null */
+					rc = rc + 5 + 1; 
+					if(rc<buf_size) {
+						memcpy(EAData,"user.",5);
+						EAData+=5;
+						memcpy(EAData,temp_ptr,temp_fea->name_len);
+						EAData+=temp_fea->name_len;
+						/* null terminate name */
+						*EAData = 0;
+						EAData = EAData + 1;
+					} else if(buf_size == 0) {
+						/* skip copy - calc size only */
+					} else {
+						/* stop before overrun buffer */
+						rc = -ERANGE;
+						break;
+					}
+					name_len -= temp_fea->name_len;
+					temp_ptr += temp_fea->name_len;
+					/* account for trailing null */
+					name_len--;
+					temp_ptr++;
+					temp_fea->value_len = cpu_to_le16(temp_fea->value_len);
+					name_len -= temp_fea->value_len;
+					temp_ptr += temp_fea->value_len;
+					/* BB check that temp_ptr is still within smb BB*/
+				/* no trailing null to account for in value len */
+					/* go on to next EA */
+					temp_fea = (struct fea *)temp_ptr;
+				}
+			}
 		}
 	}
 	if (pSMB)
@@ -2978,4 +3143,255 @@ QAllEAsRetry:
 
 	return rc;
 }
+
+ssize_t CIFSSMBQueryEA(const int xid,struct cifsTconInfo * tcon,
+		const unsigned char * searchName,const unsigned char * ea_name,
+		unsigned char * ea_value, size_t buf_size, 
+		const struct nls_table *nls_codepage)
+{
+	TRANSACTION2_QPI_REQ *pSMB = NULL;
+	TRANSACTION2_QPI_RSP *pSMBr = NULL;
+	int rc = 0;
+	int bytes_returned;
+	int name_len;
+	struct fea * temp_fea;
+	char * temp_ptr;
+
+	cFYI(1, ("In Query EA path %s", searchName));
+QEARetry:
+	rc = smb_init(SMB_COM_TRANSACTION2, 15, tcon, (void **) &pSMB,
+		      (void **) &pSMBr);
+	if (rc)
+		return rc;
+
+	if (pSMB->hdr.Flags2 & SMBFLG2_UNICODE) {
+		name_len =
+		    cifs_strtoUCS((wchar_t *) pSMB->FileName, searchName, 530
+				  /* find define for this maxpathcomponent */
+				  , nls_codepage);
+		name_len++;	/* trailing null */
+		name_len *= 2;
+	} else {	/* BB improve the check for buffer overruns BB */
+		name_len = strnlen(searchName, 530);
+		name_len++;	/* trailing null */
+		strncpy(pSMB->FileName, searchName, name_len);
+	}
+
+	pSMB->TotalParameterCount = 2 /* level */  + 4 /* reserved */  +
+	    name_len /* includes null */ ;
+	pSMB->TotalDataCount = 0;
+	pSMB->MaxParameterCount = cpu_to_le16(2);
+	pSMB->MaxDataCount = cpu_to_le16(4000);	/* BB find exact max SMB PDU from sess structure BB */
+	pSMB->MaxSetupCount = 0;
+	pSMB->Reserved = 0;
+	pSMB->Flags = 0;
+	pSMB->Timeout = 0;
+	pSMB->Reserved2 = 0;
+	pSMB->ParameterOffset = cpu_to_le16(offsetof(
+        struct smb_com_transaction2_qpi_req ,InformationLevel) - 4);
+	pSMB->DataCount = 0;
+	pSMB->DataOffset = 0;
+	pSMB->SetupCount = 1;
+	pSMB->Reserved3 = 0;
+	pSMB->SubCommand = cpu_to_le16(TRANS2_QUERY_PATH_INFORMATION);
+	pSMB->ByteCount = pSMB->TotalParameterCount + 1 /* pad */ ;
+	pSMB->TotalParameterCount = cpu_to_le16(pSMB->TotalParameterCount);
+	pSMB->ParameterCount = pSMB->TotalParameterCount;
+	pSMB->InformationLevel = cpu_to_le16(SMB_INFO_QUERY_ALL_EAS);
+	pSMB->Reserved4 = 0;
+	pSMB->hdr.smb_buf_length += pSMB->ByteCount;
+	pSMB->ByteCount = cpu_to_le16(pSMB->ByteCount);
+
+	rc = SendReceive(xid, tcon->ses, (struct smb_hdr *) pSMB,
+			 (struct smb_hdr *) pSMBr, &bytes_returned, 0);
+	if (rc) {
+		cFYI(1, ("Send error in Query EA = %d", rc));
+	} else {		/* decode response */
+		pSMBr->DataOffset = le16_to_cpu(pSMBr->DataOffset);
+		/* BB also check enough total bytes returned */
+		/* BB we need to improve the validity checking
+		of these trans2 responses */
+		if ((pSMBr->ByteCount < 4) || (pSMBr->DataOffset > 512)) 
+			rc = -EIO;	/* bad smb */
+	   /* else if (pFindData){
+			memcpy((char *) pFindData,
+			       (char *) &pSMBr->hdr.Protocol +
+			       pSMBr->DataOffset, kl);
+		}*/ else {
+			/* check that length of list is not more than bcc */
+			/* check that each entry does not go beyond length
+			   of list */
+			/* check that each element of each entry does not
+			   go beyond end of list */
+			struct fealist * ea_response_data;
+			rc = -ENOENT;
+			/* validate_trans2_offsets() */
+			/* BB to check if(start of smb + pSMBr->DataOffset > &bcc+ bcc)*/
+			ea_response_data = (struct fealist *)
+				(((char *) &pSMBr->hdr.Protocol) +
+				pSMBr->DataOffset);
+			ea_response_data->list_len = 
+				cpu_to_le32(ea_response_data->list_len);
+			cFYI(1,("ea length %d",ea_response_data->list_len));
+			name_len = ea_response_data->list_len;
+			if(name_len <= 8) {
+			/* returned EA size zeroed at top of function */
+				cFYI(1,("empty EA list returned from server"));
+			} else {
+				/* account for ea list len */
+				name_len -= 4;
+				temp_fea = ea_response_data->list;
+				temp_ptr = (char *)temp_fea;
+				/* loop through checking if we have a matching
+				name and then return the associated value */
+				while(name_len > 0) {
+					name_len -= 4;
+					temp_ptr += 4;
+					temp_fea->value_len = cpu_to_le16(temp_fea->value_len);
+				/* BB validate that value_len falls within SMB, 
+				even though maximum for name_len is 255 */ 
+					if(memcmp(temp_fea->name,ea_name,
+						  temp_fea->name_len) == 0) {
+						/* found a match */
+						rc = temp_fea->value_len;
+				/* account for prefix user. and trailing null */
+						if(rc<=buf_size) {
+							memcpy(ea_value,
+								temp_fea->name+temp_fea->name_len+1,
+								rc);
+							/* ea values, unlike ea names,
+							are not null terminated */
+						} else if(buf_size == 0) {
+						/* skip copy - calc size only */
+						} else {
+							/* stop before overrun buffer */
+							rc = -ERANGE;
+						}
+						break;
+					}
+					name_len -= temp_fea->name_len;
+					temp_ptr += temp_fea->name_len;
+					/* account for trailing null */
+					name_len--;
+					temp_ptr++;
+					name_len -= temp_fea->value_len;
+					temp_ptr += temp_fea->value_len;
+				/* no trailing null to account for in value len */
+					/* go on to next EA */
+					temp_fea = (struct fea *)temp_ptr;
+				}
+			} 
+		}
+	}
+	if (pSMB)
+		cifs_buf_release(pSMB);
+	if (rc == -EAGAIN)
+		goto QEARetry;
+
+	return rc;
+}
+
+int
+CIFSSMBSetEA(const int xid, struct cifsTconInfo *tcon, const char *fileName,
+		const char * ea_name, const void * ea_value, 
+		const __u16 ea_value_len, const struct nls_table *nls_codepage)
+{
+	struct smb_com_transaction2_spi_req *pSMB = NULL;
+	struct smb_com_transaction2_spi_rsp *pSMBr = NULL;
+	struct fealist *parm_data;
+	int name_len;
+	int rc = 0;
+	int bytes_returned = 0;
+
+	cFYI(1, ("In SetEA"));
+SetEARetry:
+	rc = smb_init(SMB_COM_TRANSACTION2, 15, tcon, (void **) &pSMB,
+		      (void **) &pSMBr);
+	if (rc)
+		return rc;
+
+	if (pSMB->hdr.Flags2 & SMBFLG2_UNICODE) {
+		name_len =
+		    cifs_strtoUCS((wchar_t *) pSMB->FileName, fileName, 530
+				  /* find define for this maxpathcomponent */
+				  , nls_codepage);
+		name_len++;	/* trailing null */
+		name_len *= 2;
+	} else {		/* BB improve the check for buffer overruns BB */
+		name_len = strnlen(fileName, 530);
+		name_len++;	/* trailing null */
+		strncpy(pSMB->FileName, fileName, name_len);
+	}
+
+	pSMB->ParameterCount = 6 + name_len;
+
+	/* done calculating parms using name_len of file name,
+	now use name_len to calculate length of ea name
+	we are going to create in the inode xattrs */
+	if(ea_name == NULL)
+		name_len = 0;
+	else
+		name_len = strnlen(ea_name,255);
+
+	pSMB->DataCount = sizeof(*parm_data) + ea_value_len + name_len + 1;
+	pSMB->MaxParameterCount = cpu_to_le16(2);
+	pSMB->MaxDataCount = cpu_to_le16(1000);	/* BB find max SMB size from sess */
+	pSMB->MaxSetupCount = 0;
+	pSMB->Reserved = 0;
+	pSMB->Flags = 0;
+	pSMB->Timeout = 0;
+	pSMB->Reserved2 = 0;
+	pSMB->ParameterOffset = offsetof(struct smb_com_transaction2_spi_req,
+                                     InformationLevel) - 4;
+	pSMB->DataOffset = pSMB->ParameterOffset + pSMB->ParameterCount;
+	pSMB->InformationLevel =
+		cpu_to_le16(SMB_SET_FILE_EA);
+
+	parm_data =
+		(struct fealist *) (((char *) &pSMB->hdr.Protocol) +
+				       pSMB->DataOffset);
+	pSMB->ParameterOffset = cpu_to_le16(pSMB->ParameterOffset);
+	pSMB->DataOffset = cpu_to_le16(pSMB->DataOffset);
+	pSMB->SetupCount = 1;
+	pSMB->Reserved3 = 0;
+	pSMB->SubCommand = cpu_to_le16(TRANS2_SET_PATH_INFORMATION);
+	pSMB->ByteCount = 3 /* pad */  + pSMB->ParameterCount + pSMB->DataCount;
+	pSMB->DataCount = cpu_to_le16(pSMB->DataCount);
+	parm_data->list_len = (__u32)(pSMB->DataCount);
+	parm_data->list[0].EA_flags = 0;
+	/* we checked above that name len is less than 255 */
+	parm_data->list[0].name_len = (__u8)name_len;;
+	/* EA names are always ASCII */
+	strncpy(parm_data->list[0].name,ea_name,name_len);
+	parm_data->list[0].name[name_len] = 0;
+	parm_data->list[0].value_len = cpu_to_le16(ea_value_len);
+	/* caller ensures that ea_value_len is less than 64K but
+	we need to ensure that it fits within the smb */
+
+	/*BB add length check that it would fit in negotiated SMB buffer size BB */
+	/* if(ea_value_len > buffer_size - 512 (enough for header)) */
+	if(ea_value_len)
+		memcpy(parm_data->list[0].name+name_len+1,ea_value,ea_value_len);
+
+	pSMB->TotalDataCount = pSMB->DataCount;
+	pSMB->ParameterCount = cpu_to_le16(pSMB->ParameterCount);
+	pSMB->TotalParameterCount = pSMB->ParameterCount;
+	pSMB->Reserved4 = 0;
+	pSMB->hdr.smb_buf_length += pSMB->ByteCount;
+	pSMB->ByteCount = cpu_to_le16(pSMB->ByteCount);
+	rc = SendReceive(xid, tcon->ses, (struct smb_hdr *) pSMB,
+			 (struct smb_hdr *) pSMBr, &bytes_returned, 0);
+	if (rc) {
+		cFYI(1, ("SetPathInfo (EA) returned %d", rc));
+	}
+
+	if (pSMB)
+		cifs_buf_release(pSMB);
+
+	if (rc == -EAGAIN)
+		goto SetEARetry;
+
+	return rc;
+}
+
 #endif
diff --git a/fs/cifs/connect.c b/fs/cifs/connect.c
index befbff5d6..bb6b0f3b2 100644
--- a/fs/cifs/connect.c
+++ b/fs/cifs/connect.c
@@ -28,6 +28,7 @@
 #include <linux/pagemap.h>
 #include <linux/ctype.h>
 #include <linux/utsname.h>
+#include <linux/mempool.h>
 #include <asm/uaccess.h>
 #include <asm/processor.h>
 #include "cifspdu.h"
@@ -49,6 +50,8 @@ extern void SMBNTencrypt(unsigned char *passwd, unsigned char *c8,
 			 unsigned char *p24);
 extern int cifs_inet_pton(int, const char *, void *dst);
 
+extern mempool_t *cifs_req_poolp;
+
 struct smb_vol {
 	char *username;
 	char *password;
@@ -64,6 +67,8 @@ struct smb_vol {
 	int rw:1;
 	int retry:1;
 	int intr:1;
+	int setuids:1;
+	int noperm:1;
 	unsigned int rsize;
 	unsigned int wsize;
 	unsigned int sockopt;
@@ -175,7 +180,7 @@ cifs_reconnect(struct TCP_Server_Info *server)
 			if(server->tcpStatus != CifsExiting)
 				server->tcpStatus = CifsGood;
 			spin_unlock(&GlobalMid_Lock);
-			atomic_set(&server->inFlight,0);
+	/*		atomic_set(&server->inFlight,0);*/
 			wake_up(&server->response_q);
 		}
 	}
@@ -189,8 +194,7 @@ cifs_demultiplex_thread(struct TCP_Server_Info *server)
 	unsigned int pdu_length, total_read;
 	struct smb_hdr *smb_buffer = NULL;
 	struct msghdr smb_msg;
-	mm_segment_t temp_fs;
-	struct iovec iov;
+	struct kvec iov;
 	struct socket *csocket = server->ssocket;
 	struct list_head *tmp;
 	struct cifsSesInfo *ses;
@@ -203,9 +207,15 @@ cifs_demultiplex_thread(struct TCP_Server_Info *server)
 	current->flags |= PF_MEMALLOC;
 	server->tsk = current;	/* save process info to wake at shutdown */
 	cFYI(1, ("Demultiplex PID: %d", current->pid));
-
-	temp_fs = get_fs();	/* we must turn off socket api parm checking */
-	set_fs(get_ds());
+	write_lock(&GlobalSMBSeslock);
+	atomic_inc(&tcpSesAllocCount);
+	length = tcpSesAllocCount.counter;
+	write_unlock(&GlobalSMBSeslock);
+	if(length  > 1) {
+		mempool_resize(cifs_req_poolp,
+			length + CIFS_MIN_RCV_POOL,
+			GFP_KERNEL);
+	}
 
 	while (server->tcpStatus != CifsExiting) {
 		if (smb_buffer == NULL)
@@ -222,16 +232,15 @@ cifs_demultiplex_thread(struct TCP_Server_Info *server)
 		iov.iov_base = smb_buffer;
 		iov.iov_len = sizeof (struct smb_hdr) - 1;	
         /* 1 byte less above since wct is not always returned in error cases */
-		smb_msg.msg_iov = &iov;
-		smb_msg.msg_iovlen = 1;
 		smb_msg.msg_control = NULL;
 		smb_msg.msg_controllen = 0;
 
 		length =
-		    sock_recvmsg(csocket, &smb_msg,
-				 sizeof (struct smb_hdr) -
-				 1 /* RFC1001 header and SMB header */ ,
-				 MSG_PEEK /* flags see socket.h */ );
+		    kernel_recvmsg(csocket, &smb_msg,
+				   &iov, 1,
+				   sizeof (struct smb_hdr) -
+				   1 /* RFC1001 header and SMB header */ ,
+				   MSG_PEEK /* flags see socket.h */ );
 
 		if(server->tcpStatus == CifsExiting) {
 			break;
@@ -253,13 +262,12 @@ cifs_demultiplex_thread(struct TCP_Server_Info *server)
 				/* some servers kill tcp session rather than returning
 					smb negprot error in which case reconnecting here is
 					not going to help - return error to mount */
-				spin_lock(&GlobalMid_Lock);
-				server->tcpStatus = CifsExiting;
-				spin_unlock(&GlobalMid_Lock);
-				wake_up(&server->response_q);
 				break;
 			}
-
+			if(length == -EINTR) { 
+				cFYI(1,("cifsd thread killed"));
+				break;
+			}
 			cFYI(1,("Reconnecting after unexpected peek error %d",length));
 			cifs_reconnect(server);
 			csocket = server->ssocket;
@@ -277,12 +285,14 @@ cifs_demultiplex_thread(struct TCP_Server_Info *server)
 			if (temp[0] == (char) RFC1002_SESSION_KEEP_ALIVE) {
 				iov.iov_base = smb_buffer;
 				iov.iov_len = 4;
-				length = sock_recvmsg(csocket, &smb_msg, 4, 0);
+				length = kernel_recvmsg(csocket, &smb_msg,
+							&iov, 1, 4, 0);
 				cFYI(0,("Received 4 byte keep alive packet"));
 			} else if (temp[0] == (char) RFC1002_POSITIVE_SESSION_RESPONSE) {
-					iov.iov_base = smb_buffer;
-					iov.iov_len = 4;
-					length = sock_recvmsg(csocket, &smb_msg, 4, 0);
+				iov.iov_base = smb_buffer;
+				iov.iov_len = 4;
+				length = kernel_recvmsg(csocket, &smb_msg,
+							&iov, 1, 4, 0);
 					cFYI(1,("Good RFC 1002 session rsp"));
 			} else if ((temp[0] == (char)RFC1002_NEGATIVE_SESSION_RESPONSE)
 				   && (length == 5)) {
@@ -292,11 +302,6 @@ cifs_demultiplex_thread(struct TCP_Server_Info *server)
 					/* if nack on negprot (rather than 
 					ret of smb negprot error) reconnecting
 					not going to help, ret error to mount */
-					spin_lock(&GlobalMid_Lock);
-					server->tcpStatus = CifsExiting;
-					spin_unlock(&GlobalMid_Lock);
-					/* wake up thread doing negprot */
-					wake_up(&server->response_q);
 					break;
 				} else {
 					/* give server a second to
@@ -347,7 +352,8 @@ cifs_demultiplex_thread(struct TCP_Server_Info *server)
 					for (total_read = 0; 
 					     total_read < pdu_length;
 					     total_read += length) {	
-						length = sock_recvmsg(csocket, &smb_msg, 
+						length = kernel_recvmsg(csocket, &smb_msg, 
+							&iov, 1,
 							pdu_length - total_read, 0);
 						if (length == 0) {
 							cERROR(1,
@@ -398,7 +404,9 @@ cifs_demultiplex_thread(struct TCP_Server_Info *server)
 			     ("Frame less than four bytes received  %d bytes long.",
 			      length));
 			if (length > 0) {
-				length = sock_recvmsg(csocket, &smb_msg, length, 0);	/* throw away junk frame */
+				length = kernel_recvmsg(csocket, &smb_msg,
+					&iov, 1,
+					length, 0);	/* throw away junk frame */
 				cFYI(1,
 				     (" with junk  0x%x in it ",
 				      *(__u32 *) smb_buffer));
@@ -407,20 +415,23 @@ cifs_demultiplex_thread(struct TCP_Server_Info *server)
 	}
 	spin_lock(&GlobalMid_Lock);
 	server->tcpStatus = CifsExiting;
-	spin_unlock(&GlobalMid_Lock);
+	server->tsk = NULL;
 	atomic_set(&server->inFlight, 0);
+	spin_unlock(&GlobalMid_Lock);
 	/* Although there should not be any requests blocked on 
 	this queue it can not hurt to be paranoid and try to wake up requests
 	that may haven been blocked when more than 50 at time were on the wire 
 	to the same server - they now will see the session is in exit state
 	and get out of SendReceive.  */
-	wake_up_all(&server->request_q);   
-	server->tsk = NULL;
+	wake_up_all(&server->request_q);
+	/* give those requests time to exit */
+	set_current_state(TASK_INTERRUPTIBLE);
+	schedule_timeout(HZ/8);
+
 	if(server->ssocket) {
 		sock_release(csocket);
 		server->ssocket = NULL;
 	}
-	set_fs(temp_fs);
 	if (smb_buffer) /* buffer usually freed in free_mid - need to free it on error or exit */
 		cifs_buf_release(smb_buffer);
 
@@ -453,7 +464,7 @@ cifs_demultiplex_thread(struct TCP_Server_Info *server)
 		spin_unlock(&GlobalMid_Lock);
 		read_unlock(&GlobalSMBSeslock);
 		set_current_state(TASK_INTERRUPTIBLE);
-		/* 1/8th of sec should be more than enough time for them to exit */
+		/* 1/8th of sec is more than enough time for them to exit */
 		schedule_timeout(HZ/8); 
 	}
 
@@ -468,7 +479,18 @@ cifs_demultiplex_thread(struct TCP_Server_Info *server)
 	}
 	kfree(server);
 
-	cFYI(1, ("About to exit from demultiplex thread"));
+	write_lock(&GlobalSMBSeslock);
+	atomic_dec(&tcpSesAllocCount);
+	length = tcpSesAllocCount.counter;
+	write_unlock(&GlobalSMBSeslock);
+	if(length  > 0) {
+		mempool_resize(cifs_req_poolp,
+			length + CIFS_MIN_RCV_POOL,
+			GFP_KERNEL);
+	}
+
+	set_current_state(TASK_INTERRUPTIBLE);
+	schedule_timeout(HZ/4);
 	return 0;
 }
 
@@ -716,6 +738,8 @@ cifs_parse_mount_options(char *options, const char *devname, struct smb_vol *vol
 				if((i==15) && (value[i] != 0))
 					printk(KERN_WARNING "CIFS: netbiosname longer than 15 and was truncated.\n");
 			}
+		} else if (strnicmp(data, "credentials", 4) == 0) {
+			/* ignore */
 		} else if (strnicmp(data, "version", 3) == 0) {
 			/* ignore */
 		} else if (strnicmp(data, "rw", 2) == 0) {
@@ -740,6 +764,14 @@ cifs_parse_mount_options(char *options, const char *devname, struct smb_vol *vol
 			vol->retry = 1;
 		} else if (strnicmp(data, "soft", 4) == 0) {
 			vol->retry = 0;
+		} else if (strnicmp(data, "perm", 4) == 0) {
+			vol->noperm = 0;
+		} else if (strnicmp(data, "noperm", 6) == 0) {
+			vol->noperm = 1;
+		} else if (strnicmp(data, "setuids", 7) == 0) {
+			vol->setuids = 1;
+		} else if (strnicmp(data, "nosetuids", 9) == 0) {
+			vol->setuids = 0;
 		} else if (strnicmp(data, "nohard", 6) == 0) {
 			vol->retry = 0;
 		} else if (strnicmp(data, "nosoft", 6) == 0) {
@@ -1314,6 +1346,12 @@ cifs_mount(struct super_block *sb, struct cifs_sb_info *cifs_sb,
 		cifs_sb->mnt_file_mode = volume_info.file_mode;
 		cifs_sb->mnt_dir_mode = volume_info.dir_mode;
 		cFYI(1,("file mode: 0x%x  dir mode: 0x%x",cifs_sb->mnt_file_mode,cifs_sb->mnt_dir_mode));
+
+		if(volume_info.noperm)
+			cifs_sb->mnt_cifs_flags |= CIFS_MOUNT_NO_PERM;
+		if(volume_info.setuids)
+			cifs_sb->mnt_cifs_flags |= CIFS_MOUNT_SET_UID;
+
 		tcon =
 		    find_unc(sin_server.sin_addr.s_addr, volume_info.UNC,
 			     volume_info.username);
@@ -1357,31 +1395,37 @@ cifs_mount(struct super_block *sb, struct cifs_sb_info *cifs_sb,
 			}
 		}
 	}
-	if (pSesInfo->capabilities & CAP_LARGE_FILES) {
-		cFYI(0, ("Large files supported "));
-		sb->s_maxbytes = (u64) 1 << 63;
-	} else
-		sb->s_maxbytes = (u64) 1 << 31;	/* 2 GB */
+	if(pSesInfo) {
+		if (pSesInfo->capabilities & CAP_LARGE_FILES) {
+			sb->s_maxbytes = (u64) 1 << 63;
+		} else
+			sb->s_maxbytes = (u64) 1 << 31;	/* 2 GB */
+	}
 
 /* on error free sesinfo and tcon struct if needed */
 	if (rc) {
+		/* if session setup failed, use count is zero but
+		we still need to free cifsd thread */
 		if(atomic_read(&srvTcp->socketUseCount) == 0) {
 			spin_lock(&GlobalMid_Lock);
 			srvTcp->tcpStatus = CifsExiting;
 			spin_unlock(&GlobalMid_Lock);
+			if(srvTcp->tsk)
+				send_sig(SIGKILL,srvTcp->tsk,1);
 		}
 		 /* If find_unc succeeded then rc == 0 so we can not end */
-		if (tcon)  /* up here accidently freeing someone elses tcon struct */
+		if (tcon)  /* up accidently freeing someone elses tcon struct */
 			tconInfoFree(tcon);
 		if (existingCifsSes == 0) {
 			if (pSesInfo) {
-				if (pSesInfo->server) {
-					if (pSesInfo->Suid)
-						CIFSSMBLogoff(xid, pSesInfo);
-					if(pSesInfo->server->tsk)
+				if ((pSesInfo->server) && 
+				    (pSesInfo->status == CifsGood)) {
+					int temp_rc;
+					temp_rc = CIFSSMBLogoff(xid, pSesInfo);
+					/* if the socketUseCount is now zero */
+					if((temp_rc == -ESHUTDOWN) &&
+					   (pSesInfo->server->tsk))
 						send_sig(SIGKILL,pSesInfo->server->tsk,1);
-					set_current_state(TASK_INTERRUPTIBLE);
-					schedule_timeout(HZ / 4);	/* give captive thread time to exit */
 				} else
 					cFYI(1, ("No session or bad tcon"));
 				sesInfoFree(pSesInfo);
@@ -1438,7 +1482,7 @@ CIFSSessSetup(unsigned int xid, struct cifsSesInfo *ses,
 
 	/* send SMBsessionSetup here */
 	header_assemble(smb_buffer, SMB_COM_SESSION_SETUP_ANDX,
-			0 /* no tCon exists yet */ , 13 /* wct */ );
+			NULL /* no tCon exists yet */ , 13 /* wct */ );
 
 	pSMB->req_no_secext.AndXCommand = 0xFF;
 	pSMB->req_no_secext.MaxBufferSize = cpu_to_le16(ses->server->maxBuf);
@@ -1694,7 +1738,7 @@ CIFSSpnegoSessSetup(unsigned int xid, struct cifsSesInfo *ses,
 
 	/* send SMBsessionSetup here */
 	header_assemble(smb_buffer, SMB_COM_SESSION_SETUP_ANDX,
-			0 /* no tCon exists yet */ , 12 /* wct */ );
+			NULL /* no tCon exists yet */ , 12 /* wct */ );
 	pSMB->req.hdr.Flags2 |= SMBFLG2_EXT_SEC;
 	pSMB->req.AndXCommand = 0xFF;
 	pSMB->req.MaxBufferSize = cpu_to_le16(ses->server->maxBuf);
@@ -1956,7 +2000,7 @@ CIFSNTLMSSPNegotiateSessSetup(unsigned int xid,
 
 	/* send SMBsessionSetup here */
 	header_assemble(smb_buffer, SMB_COM_SESSION_SETUP_ANDX,
-			0 /* no tCon exists yet */ , 12 /* wct */ );
+			NULL /* no tCon exists yet */ , 12 /* wct */ );
 	pSMB->req.hdr.Flags2 |= SMBFLG2_EXT_SEC;
 	pSMB->req.hdr.Flags |= (SMBFLG_CASELESS | SMBFLG_CANONICAL_PATH_FORMAT);
 
@@ -2296,7 +2340,7 @@ CIFSNTLMSSPAuthSessSetup(unsigned int xid, struct cifsSesInfo *ses,
 
 	/* send SMBsessionSetup here */
 	header_assemble(smb_buffer, SMB_COM_SESSION_SETUP_ANDX,
-			0 /* no tCon exists yet */ , 12 /* wct */ );
+			NULL /* no tCon exists yet */ , 12 /* wct */ );
 	pSMB->req.hdr.Flags |= (SMBFLG_CASELESS | SMBFLG_CANONICAL_PATH_FORMAT);
 	pSMB->req.hdr.Flags2 |= SMBFLG2_EXT_SEC;
 	pSMB->req.AndXCommand = 0xFF;
@@ -2669,7 +2713,7 @@ CIFSTCon(unsigned int xid, struct cifsSesInfo *ses,
 	smb_buffer_response = smb_buffer;
 
 	header_assemble(smb_buffer, SMB_COM_TREE_CONNECT_ANDX,
-			0 /*no tid */ , 4 /*wct */ );
+			NULL /*no tid */ , 4 /*wct */ );
 	smb_buffer->Uid = ses->Suid;
 	pSMB = (TCONX_REQ *) smb_buffer;
 	pSMBr = (TCONX_RSP *) smb_buffer_response;
@@ -2769,6 +2813,7 @@ cifs_umount(struct super_block *sb, struct cifs_sb_info *cifs_sb)
 	int rc = 0;
 	int xid;
 	struct cifsSesInfo *ses = NULL;
+	struct task_struct *cifsd_task;
 
 	xid = GetXid();
 
@@ -2781,19 +2826,19 @@ cifs_umount(struct super_block *sb, struct cifs_sb_info *cifs_sb)
 		}
 		tconInfoFree(cifs_sb->tcon);
 		if ((ses) && (ses->server)) {
+			/* save off task so we do not refer to ses later */
+			cifsd_task = ses->server->tsk;
 			cFYI(1, ("About to do SMBLogoff "));
 			rc = CIFSSMBLogoff(xid, ses);
 			if (rc == -EBUSY) {
 				FreeXid(xid);
 				return 0;
-			}
- 
-			set_current_state(TASK_INTERRUPTIBLE);
-			schedule_timeout(HZ / 4);	/* give captive thread time to exit */
-			if((ses->server) && (ses->server->ssocket)) {            
-				cFYI(1,("Waking up socket by sending it signal "));
-				send_sig(SIGKILL,ses->server->tsk,1);
-			}
+			} else if (rc == -ESHUTDOWN) {
+				cFYI(1,("Waking up socket by sending it signal"));
+				send_sig(SIGKILL,cifsd_task,1);
+				rc = 0;
+			} /* else - we have an smb session
+				left on this socket do not kill cifsd */
 		} else
 			cFYI(1, ("No session or bad tcon"));
 	}
diff --git a/fs/cifs/dir.c b/fs/cifs/dir.c
index 85cccbb05..91567f61d 100644
--- a/fs/cifs/dir.c
+++ b/fs/cifs/dir.c
@@ -101,6 +101,7 @@ cifs_bp_rename_retry:
 	return full_path;
 }
 
+/* Note: caller must free return buffer */
 char *
 build_wildcard_path_from_dentry(struct dentry *direntry)
 {
@@ -108,18 +109,28 @@ build_wildcard_path_from_dentry(struct dentry *direntry)
 	int namelen = 0;
 	char *full_path;
 
+	if(direntry == NULL)
+		return NULL;  /* not much we can do if dentry is freed and
+		we need to reopen the file after it was closed implicitly
+		when the server crashed */
+
+cifs_bwp_rename_retry:
 	for (temp = direntry; !IS_ROOT(temp);) {
 		namelen += (1 + temp->d_name.len);
 		temp = temp->d_parent;
+		if(temp == NULL) {
+			cERROR(1,("corrupt dentry"));
+			return NULL;
+		}
 	}
-	namelen += 3;		/* allow for trailing null and wildcard (slash and *) */
-	full_path = kmalloc(namelen, GFP_KERNEL);
-	namelen--;
-	full_path[namelen] = 0;	/* trailing null */
-	namelen--;
-	full_path[namelen] = '*';
-	namelen--;
+
+	full_path = kmalloc(namelen+3, GFP_KERNEL);
+	if(full_path == NULL)
+		return full_path;
+
 	full_path[namelen] = '\\';
+	full_path[namelen+1] = '*';
+	full_path[namelen+2] = 0;  /* trailing null */
 
 	for (temp = direntry; !IS_ROOT(temp);) {
 		namelen -= 1 + temp->d_name.len;
@@ -129,13 +140,26 @@ build_wildcard_path_from_dentry(struct dentry *direntry)
 			full_path[namelen] = '\\';
 			strncpy(full_path + namelen + 1, temp->d_name.name,
 				temp->d_name.len);
+			cFYI(0, (" name: %s ", full_path + namelen));
 		}
 		temp = temp->d_parent;
+		if(temp == NULL) {
+			cERROR(1,("corrupt dentry"));
+			kfree(full_path);
+			return NULL;
+		}
 	}
-	if (namelen != 0)
+	if (namelen != 0) {
 		cERROR(1,
 		       ("We did not end path lookup where we expected namelen is %d",
 			namelen));
+		/* presumably this is only possible if we were racing with a rename 
+		of one of the parent directories  (we can not lock the dentries
+		above us to prevent this, but retrying should be harmless) */
+		kfree(full_path);
+		namelen = 0;
+		goto cifs_bwp_rename_retry;
+	}
 
 	return full_path;
 }
@@ -219,11 +243,19 @@ cifs_create(struct inode *inode, struct dentry *direntry, int mode,
 		then we now have to set the mode if possible */
 		if ((cifs_sb->tcon->ses->capabilities & CAP_UNIX) &&
 			(oplock & CIFS_CREATE_ACTION))
-			CIFSSMBUnixSetPerms(xid, pTcon, full_path, mode,
+			if(cifs_sb->mnt_cifs_flags & CIFS_MOUNT_SET_UID) {
+				CIFSSMBUnixSetPerms(xid, pTcon, full_path, mode,
+					(__u64)current->euid,
+					(__u64)current->egid,
+					0 /* dev */,
+					cifs_sb->local_nls);
+			} else {
+				CIFSSMBUnixSetPerms(xid, pTcon, full_path, mode,
 					(__u64)-1,
 					(__u64)-1,
 					0 /* dev */,
 					cifs_sb->local_nls);
+			}
 		else {
 			/* BB implement via Windows security descriptors */
 			/* eg CIFSSMBWinSetPerms(xid,pTcon,full_path,mode,-1,-1,local_nls);*/
@@ -233,10 +265,10 @@ cifs_create(struct inode *inode, struct dentry *direntry, int mode,
 	/* BB server might mask mode so we have to query for Unix case*/
 		if (pTcon->ses->capabilities & CAP_UNIX)
 			rc = cifs_get_inode_info_unix(&newinode, full_path,
-						 inode->i_sb);
+						 inode->i_sb,xid);
 		else {
 			rc = cifs_get_inode_info(&newinode, full_path,
-						 buf, inode->i_sb);
+						 buf, inode->i_sb,xid);
 			if(newinode)
 				newinode->i_mode = mode;
 		}
@@ -324,12 +356,19 @@ int cifs_mknod(struct inode *inode, struct dentry *direntry, int mode, dev_t dev
 		rc = -ENOMEM;
 	
 	if (full_path && (pTcon->ses->capabilities & CAP_UNIX)) {
-		rc = CIFSSMBUnixSetPerms(xid, pTcon,
-			full_path, mode, current->euid, current->egid,
-			device_number, cifs_sb->local_nls);
+		if(cifs_sb->mnt_cifs_flags & CIFS_MOUNT_SET_UID) {
+			rc = CIFSSMBUnixSetPerms(xid, pTcon, full_path,
+				mode,(__u64)current->euid,(__u64)current->egid,
+				device_number, cifs_sb->local_nls);
+		} else {
+			rc = CIFSSMBUnixSetPerms(xid, pTcon,
+				full_path, mode, (__u64)-1, (__u64)-1,
+				device_number, cifs_sb->local_nls);
+		}
+
 		if(!rc) {
 			rc = cifs_get_inode_info_unix(&newinode, full_path,
-						inode->i_sb);
+						inode->i_sb,xid);
 			direntry->d_op = &cifs_dentry_ops;
 			if(rc == 0)
 				d_instantiate(direntry, newinode);
@@ -389,10 +428,10 @@ cifs_lookup(struct inode *parent_dir_inode, struct dentry *direntry, struct name
 
 	if (pTcon->ses->capabilities & CAP_UNIX)
 		rc = cifs_get_inode_info_unix(&newInode, full_path,
-					      parent_dir_inode->i_sb);
+					      parent_dir_inode->i_sb,xid);
 	else
 		rc = cifs_get_inode_info(&newInode, full_path, NULL,
-					 parent_dir_inode->i_sb);
+					 parent_dir_inode->i_sb,xid);
 
 	if ((rc == 0) && (newInode != NULL)) {
 		direntry->d_op = &cifs_dentry_ops;
@@ -431,9 +470,16 @@ cifs_dir_open(struct inode *inode, struct file *file)
 	cifs_sb = CIFS_SB(inode->i_sb);
 	pTcon = cifs_sb->tcon;
 
-	full_path = build_wildcard_path_from_dentry(file->f_dentry);
+	if(file->f_dentry) {
+		down(&file->f_dentry->d_sb->s_vfs_rename_sem);
+		full_path = build_wildcard_path_from_dentry(file->f_dentry);
+		up(&file->f_dentry->d_sb->s_vfs_rename_sem);
+	} else {
+		FreeXid(xid);
+		return -EIO;
+	}
 
-	cFYI(1, (" inode = 0x%p and full path is %s", inode, full_path));
+	cFYI(1, ("inode = 0x%p and full path is %s", inode, full_path));
 
 	if (full_path)
 		kfree(full_path);
diff --git a/fs/cifs/fcntl.c b/fs/cifs/fcntl.c
index 1469a406f..b908768b6 100644
--- a/fs/cifs/fcntl.c
+++ b/fs/cifs/fcntl.c
@@ -28,7 +28,7 @@
 #include "cifs_unicode.h"
 #include "cifs_debug.h"
 
-int cifs_directory_notify(unsigned long arg, struct file * file)
+int cifs_dir_notify(struct file * file, unsigned long arg)
 {
 	int xid;
 	int rc = -EINVAL;
@@ -70,53 +70,3 @@ int cifs_directory_notify(unsigned long arg, struct file * file)
 	FreeXid(xid);
 	return rc;
 }
-
-
-long cifs_fcntl(int file_desc, unsigned int command, unsigned long arg,
-				struct file * file)
-{
-	/* Few few file control functions need to be specially mapped. So far
-	only:
-		F_NOTIFY (for directory change notification)
-	And eventually:
-		F_GETLEASE
-		F_SETLEASE 
-	need to be mapped here. The others either already are mapped downstream
-	or do not need to go to the server (client only sideeffects):
-		F_DUPFD:
-		F_GETFD:
-		F_SETFD:
-		F_GETFL:
-		F_SETFL:
-		F_GETLK:
-		F_SETLK:
-		F_SETLKW:
-		F_GETOWN:
-		F_SETOWN:
-		F_GETSIG:
-		F_SETSIG:
-	*/
-	long rc = 0;
-
-	cFYI(1,("cifs_fcntl: command %d with arg %lx",command,arg)); /* BB removeme BB */
-
-	switch (command) {
-	case F_NOTIFY:
-		/* let the local call have a chance to fail first */
-		rc = generic_file_fcntl(file_desc,command,arg,file);
-		if(rc)
-			return rc;
-		else {
-			/* local call succeeded try to do remote notify to
-			pick up changes from other clients to server file */
-			cifs_directory_notify(arg, file);
-			/* BB add case to long and return rc from above */
-			return rc;
-		}
-		break;
-	default:
-		break;
-	}
-	return generic_file_fcntl(file_desc,command,arg,file);
-}
-                
diff --git a/fs/cifs/file.c b/fs/cifs/file.c
index 7d0ac5104..73505c6cc 100644
--- a/fs/cifs/file.c
+++ b/fs/cifs/file.c
@@ -215,10 +215,10 @@ cifs_open(struct inode *inode, struct file *file)
 				}
 				if (pTcon->ses->capabilities & CAP_UNIX)
 					rc = cifs_get_inode_info_unix(&file->f_dentry->d_inode,
-						full_path, inode->i_sb);
+						full_path, inode->i_sb,xid);
 				else
 					rc = cifs_get_inode_info(&file->f_dentry->d_inode,
-						full_path, buf, inode->i_sb);
+						full_path, buf, inode->i_sb,xid);
 
 				if((oplock & 0xF) == OPLOCK_EXCLUSIVE) {
 					pCifsInode->clientCanCacheAll = TRUE;
@@ -367,10 +367,10 @@ and we can never tell if the caller already has the rename_sem */
 				pCifsInode->clientCanCacheRead = FALSE;
 				if (pTcon->ses->capabilities & CAP_UNIX)
 					rc = cifs_get_inode_info_unix(&inode,
-						full_path, inode->i_sb);
+						full_path, inode->i_sb,xid);
 				else
 					rc = cifs_get_inode_info(&inode,
-						full_path, NULL, inode->i_sb);
+						full_path, NULL, inode->i_sb,xid);
 			} /* else we are writing out data to server already
 			and could deadlock if we tried to flush data, and 
 			since we do not know if we have data that would
@@ -588,9 +588,10 @@ cifs_write(struct file * file, const char *write_data,
 	if(file->f_dentry == NULL)
 		return -EBADF;
 
-	xid = GetXid();
-
 	cifs_sb = CIFS_SB(file->f_dentry->d_sb);
+	if(cifs_sb == NULL) {
+		return -EBADF;
+	}
 	pTcon = cifs_sb->tcon;
 
 	/*cFYI(1,
@@ -598,11 +599,12 @@ cifs_write(struct file * file, const char *write_data,
 	   *poffset, file->f_dentry->d_name.name)); */
 
 	if (file->private_data == NULL) {
-		FreeXid(xid);
 		return -EBADF;
+	} else {
+		open_file = (struct cifsFileInfo *) file->private_data;
 	}
-	open_file = (struct cifsFileInfo *) file->private_data;
-
+	
+	xid = GetXid();
 	if(file->f_dentry->d_inode == NULL) {
 		FreeXid(xid);
 		return -EBADF;
@@ -620,10 +622,21 @@ cifs_write(struct file * file, const char *write_data,
 			if(file->private_data == NULL) {
 				/* file has been closed on us */
 				FreeXid(xid);
+			/* if we have gotten here we have written some data
+			and blocked, and the file has been freed on us
+			while we blocked so return what we managed to write */
 				return total_written;
+			} 
+			if(open_file->closePend) {
+				FreeXid(xid);
+				if(total_written)
+					return total_written;
+				else
+					return -EBADF;
 			}
-			if ((open_file->invalidHandle) && (!open_file->closePend)) {
-				if((file->f_dentry == NULL) || (file->f_dentry->d_inode == NULL)) {
+			if (open_file->invalidHandle) {
+				if((file->f_dentry == NULL) ||
+				   (file->f_dentry->d_inode == NULL)) {
 					FreeXid(xid);
 					return total_written;
 				}
@@ -1092,7 +1105,7 @@ cifs_readpages(struct file *file, struct address_space *mapping,
 	struct cifsTconInfo *pTcon;
 	int bytes_read = 0;
 	unsigned int read_size,i;
-	char * smb_read_data = 0;
+	char * smb_read_data = NULL;
 	struct smb_com_read_rsp * pSMBr;
 	struct pagevec lru_pvec;
 	struct cifsFileInfo * open_file;
@@ -1157,7 +1170,7 @@ cifs_readpages(struct file *file, struct address_space *mapping,
 			if(rc== -EAGAIN) {
 				if(smb_read_data) {
 					cifs_buf_release(smb_read_data);
-					smb_read_data = 0;
+					smb_read_data = NULL;
 				}
 			}
 		}
@@ -1211,7 +1224,7 @@ cifs_readpages(struct file *file, struct address_space *mapping,
 		}
 		if(smb_read_data) {
 			cifs_buf_release(smb_read_data);
-			smb_read_data = 0;
+			smb_read_data = NULL;
 		}
 		bytes_read = 0;
 	}
@@ -1221,7 +1234,7 @@ cifs_readpages(struct file *file, struct address_space *mapping,
 /* need to free smb_read_data buf before exit */
 	if(smb_read_data) {
 		cifs_buf_release(smb_read_data);
-		smb_read_data = 0;
+		smb_read_data = NULL;
 	} 
 
 	FreeXid(xid);
@@ -1450,9 +1463,13 @@ unix_fill_in_inode(struct inode *tmp_inode,
 	} else if (pfindData->Type == UNIX_CHARDEV) {
 		*pobject_type = DT_CHR;
 		tmp_inode->i_mode |= S_IFCHR;
+		tmp_inode->i_rdev = MKDEV(le64_to_cpu(pfindData->DevMajor),
+				le64_to_cpu(pfindData->DevMinor) & MINORMASK);
 	} else if (pfindData->Type == UNIX_BLOCKDEV) {
 		*pobject_type = DT_BLK;
 		tmp_inode->i_mode |= S_IFBLK;
+		tmp_inode->i_rdev = MKDEV(le64_to_cpu(pfindData->DevMajor),
+				le64_to_cpu(pfindData->DevMinor) & MINORMASK);
 	} else if (pfindData->Type == UNIX_FIFO) {
 		*pobject_type = DT_FIFO;
 		tmp_inode->i_mode |= S_IFIFO;
@@ -1521,6 +1538,7 @@ construct_dentry(struct qstr *qstring, struct file *file,
 			if(*ptmp_inode == NULL)
 				return;
 			d_instantiate(tmp_dentry, *ptmp_inode);
+			insert_inode_hash(*ptmp_inode);
 		}
 	} else {
 		tmp_dentry = d_alloc(file->f_dentry, qstring);
@@ -1532,12 +1550,11 @@ construct_dentry(struct qstr *qstring, struct file *file,
 			
 		*ptmp_inode = new_inode(file->f_dentry->d_sb);
 		tmp_dentry->d_op = &cifs_dentry_ops;
-		cFYI(0, (" instantiate dentry 0x%p with inode 0x%p ",
-			 tmp_dentry, *ptmp_inode));
 		if(*ptmp_inode == NULL)
 			return;
 		d_instantiate(tmp_dentry, *ptmp_inode);
 		d_rehash(tmp_dentry);
+		insert_inode_hash(*ptmp_inode);
 	}
 
 	tmp_dentry->d_time = jiffies;
@@ -1669,7 +1686,14 @@ cifs_readdir(struct file *file, void *direntry, filldir_t filldir)
 	data = kmalloc(bufsize, GFP_KERNEL);
 	pfindData = (FILE_DIRECTORY_INFO *) data;
 
+	if(file->f_dentry == NULL) {
+		FreeXid(xid);
+		return -EIO;
+	}
+	down(&file->f_dentry->d_sb->s_vfs_rename_sem);
 	full_path = build_wildcard_path_from_dentry(file->f_dentry);
+	up(&file->f_dentry->d_sb->s_vfs_rename_sem);
+
 
 	cFYI(1, ("Full path: %s start at: %lld ", full_path, file->f_pos));
 
@@ -2123,6 +2147,7 @@ struct address_space_operations cifs_addr_ops = {
 	.writepage = cifs_writepage,
 	.prepare_write = cifs_prepare_write, 
 	.commit_write = cifs_commit_write,
+	.set_page_dirty = __set_page_dirty_nobuffers,
    /* .sync_page = cifs_sync_page, */
 	/*.direct_IO = */
 };
diff --git a/fs/cifs/inode.c b/fs/cifs/inode.c
index c12231b48..a2965cfd3 100644
--- a/fs/cifs/inode.c
+++ b/fs/cifs/inode.c
@@ -35,9 +35,8 @@ extern int is_size_safe_to_change(struct cifsInodeInfo *);
 int
 cifs_get_inode_info_unix(struct inode **pinode,
 			 const unsigned char *search_path,
-			 struct super_block *sb)
+			 struct super_block *sb,int xid)
 {
-	int xid;
 	int rc = 0;
 	FILE_UNIX_BASIC_INFO findData;
 	struct cifsTconInfo *pTcon;
@@ -45,8 +44,6 @@ cifs_get_inode_info_unix(struct inode **pinode,
 	struct cifs_sb_info *cifs_sb = CIFS_SB(sb);
 	char *tmp_path;
 
-	xid = GetXid();
-
 	pTcon = cifs_sb->tcon;
 	cFYI(1, (" Getting info on %s ", search_path));
 	/* we could have done a find first instead but this returns more info */
@@ -62,7 +59,6 @@ cifs_get_inode_info_unix(struct inode **pinode,
 				    strnlen(search_path, MAX_PATHCONF) + 1,
 				    GFP_KERNEL);
 			if (tmp_path == NULL) {
-				FreeXid(xid);
 				return -ENOMEM;
 			}
         /* have to skip first of the double backslash of UNC name */
@@ -75,7 +71,6 @@ cifs_get_inode_info_unix(struct inode **pinode,
 
 			/* BB fix up inode etc. */
 		} else if (rc) {
-			FreeXid(xid);
 			return rc;
 		}
 
@@ -85,9 +80,12 @@ cifs_get_inode_info_unix(struct inode **pinode,
 		/* get new inode */
 		if (*pinode == NULL) {
 			*pinode = new_inode(sb);
+			if(*pinode == NULL) 
+				return -ENOMEM;
+			insert_inode_hash(*pinode);
 		}
+			
 		inode = *pinode;
-
 		cifsInfo = CIFS_I(inode);
 
 		cFYI(1, (" Old time %ld ", cifsInfo->time));
@@ -112,8 +110,12 @@ cifs_get_inode_info_unix(struct inode **pinode,
 			inode->i_mode |= S_IFDIR;
 		} else if (findData.Type == UNIX_CHARDEV) {
 			inode->i_mode |= S_IFCHR;
+			inode->i_rdev = MKDEV(le64_to_cpu(findData.DevMajor),
+				le64_to_cpu(findData.DevMinor) & MINORMASK);
 		} else if (findData.Type == UNIX_BLOCKDEV) {
 			inode->i_mode |= S_IFBLK;
+			inode->i_rdev = MKDEV(le64_to_cpu(findData.DevMajor),
+				le64_to_cpu(findData.DevMinor) & MINORMASK);
 		} else if (findData.Type == UNIX_FIFO) {
 			inode->i_mode |= S_IFIFO;
 		} else if (findData.Type == UNIX_SOCKET) {
@@ -172,15 +174,13 @@ cifs_get_inode_info_unix(struct inode **pinode,
 					   inode->i_rdev);
 		}
 	}
-	FreeXid(xid);
 	return rc;
 }
 
 int
 cifs_get_inode_info(struct inode **pinode, const unsigned char *search_path, 
-		FILE_ALL_INFO * pfindData, struct super_block *sb)
+		FILE_ALL_INFO * pfindData, struct super_block *sb, int xid)
 {
-	int xid;
 	int rc = 0;
 	struct cifsTconInfo *pTcon;
 	struct inode *inode;
@@ -188,15 +188,12 @@ cifs_get_inode_info(struct inode **pinode, const unsigned char *search_path,
 	char *tmp_path;
 	char *buf = NULL;
 
-	xid = GetXid();
-
 	pTcon = cifs_sb->tcon;
 	cFYI(1,("Getting info on %s ", search_path));
 
 	if((pfindData == NULL) && (*pinode != NULL)) {
 		if(CIFS_I(*pinode)->clientCanCacheRead) {
 			cFYI(1,("No need to revalidate inode sizes on cached file "));
-			FreeXid(xid);
 			return rc;
 		}
 	}
@@ -221,7 +218,6 @@ cifs_get_inode_info(struct inode **pinode, const unsigned char *search_path,
 			if (tmp_path == NULL) {
 				if(buf)
 					kfree(buf);
-				FreeXid(xid);
 				return -ENOMEM;
 			}
 
@@ -235,7 +231,6 @@ cifs_get_inode_info(struct inode **pinode, const unsigned char *search_path,
 		} else if (rc) {
 			if(buf)
 				kfree(buf);
-			FreeXid(xid);
 			return rc;
 		}
 	} else {
@@ -244,8 +239,10 @@ cifs_get_inode_info(struct inode **pinode, const unsigned char *search_path,
 		/* get new inode */
 		if (*pinode == NULL) {
 			*pinode = new_inode(sb);
+			if(*pinode == NULL)
+				return -ENOMEM;
+			insert_inode_hash(*pinode);
 		}
-
 		inode = *pinode;
 		cifsInfo = CIFS_I(inode);
 		pfindData->Attributes = le32_to_cpu(pfindData->Attributes);
@@ -332,22 +329,23 @@ cifs_get_inode_info(struct inode **pinode, const unsigned char *search_path,
 	}
 	if(buf)
 	    kfree(buf);
-	FreeXid(xid);
 	return rc;
 }
 
 void
 cifs_read_inode(struct inode *inode)
 {				/* gets root inode */
-
+	int xid;
 	struct cifs_sb_info *cifs_sb;
 
 	cifs_sb = CIFS_SB(inode->i_sb);
-
+	xid = GetXid();
 	if (cifs_sb->tcon->ses->capabilities & CAP_UNIX)
-		cifs_get_inode_info_unix(&inode, "", inode->i_sb);
+		cifs_get_inode_info_unix(&inode, "", inode->i_sb,xid);
 	else
-		cifs_get_inode_info(&inode, "", NULL, inode->i_sb);
+		cifs_get_inode_info(&inode, "", NULL, inode->i_sb,xid);
+	/* can not call macro FreeXid here since in a void func */
+	_FreeXid(xid);
 }
 
 int
@@ -473,21 +471,29 @@ cifs_mkdir(struct inode *inode, struct dentry *direntry, int mode)
 		inode->i_nlink++;
 		if (pTcon->ses->capabilities & CAP_UNIX)
 			rc = cifs_get_inode_info_unix(&newinode, full_path,
-						      inode->i_sb);
+						      inode->i_sb,xid);
 		else
 			rc = cifs_get_inode_info(&newinode, full_path,NULL,
-						 inode->i_sb);
+						 inode->i_sb,xid);
 
 		direntry->d_op = &cifs_dentry_ops;
 		d_instantiate(direntry, newinode);
 		if(direntry->d_inode)
 			direntry->d_inode->i_nlink = 2;
-		if (cifs_sb->tcon->ses->capabilities & CAP_UNIX)                
-			CIFSSMBUnixSetPerms(xid, pTcon, full_path, mode,
-				(__u64)-1,  
-				(__u64)-1,
-				0 /* dev_t */,
-				cifs_sb->local_nls);
+		if (cifs_sb->tcon->ses->capabilities & CAP_UNIX)
+			if(cifs_sb->mnt_cifs_flags & CIFS_MOUNT_SET_UID) {
+				CIFSSMBUnixSetPerms(xid, pTcon, full_path, mode,
+						(__u64)current->euid,  
+						(__u64)current->egid,
+						0 /* dev_t */,
+						cifs_sb->local_nls);
+			} else {
+				CIFSSMBUnixSetPerms(xid, pTcon, full_path, mode,
+						(__u64)-1,  
+						(__u64)-1,
+						0 /* dev_t */,
+						cifs_sb->local_nls);
+			}
 		else { /* BB to be implemented via Windows secrty descriptors*/
 		/* eg CIFSSMBWinSetPerms(xid,pTcon,full_path,mode,-1,-1,local_nls);*/
 		}
@@ -698,7 +704,7 @@ cifs_revalidate(struct dentry *direntry)
 
 	if (cifs_sb->tcon->ses->capabilities & CAP_UNIX) {
 		rc = cifs_get_inode_info_unix(&direntry->d_inode, full_path,
-					 direntry->d_sb);
+					 direntry->d_sb,xid);
 		if(rc) {
 			cFYI(1,("error on getting revalidate info %d",rc));
 /*			if(rc != -ENOENT)
@@ -706,7 +712,7 @@ cifs_revalidate(struct dentry *direntry)
 		}
 	} else {
 		rc = cifs_get_inode_info(&direntry->d_inode, full_path, NULL,
-				    direntry->d_sb);
+				    direntry->d_sb,xid);
 		if(rc) {
 			cFYI(1,("error on getting revalidate info %d",rc));
 /*			if(rc != -ENOENT)
@@ -954,7 +960,8 @@ cifs_setattr(struct dentry *direntry, struct iattr *attrs)
 	}
 
 	/* do not  need local check to inode_check_ok since the server does that */
-	inode_setattr(direntry->d_inode, attrs);
+	if (!rc)
+		rc = inode_setattr(direntry->d_inode, attrs);
 	if (full_path)
 		kfree(full_path);
 	FreeXid(xid);
diff --git a/fs/cifs/link.c b/fs/cifs/link.c
index f257ff0ad..8d1c2cb3b 100644
--- a/fs/cifs/link.c
+++ b/fs/cifs/link.c
@@ -188,10 +188,10 @@ cifs_symlink(struct inode *inode, struct dentry *direntry, const char *symname)
 	if (rc == 0) {
 		if (pTcon->ses->capabilities & CAP_UNIX)
 			rc = cifs_get_inode_info_unix(&newinode, full_path,
-						      inode->i_sb);
+						      inode->i_sb,xid);
 		else
 			rc = cifs_get_inode_info(&newinode, full_path, NULL,
-						 inode->i_sb);
+						 inode->i_sb,xid);
 
 		if (rc != 0) {
 			cFYI(1,
diff --git a/fs/cifs/misc.c b/fs/cifs/misc.c
index 0d690174e..f3e258d11 100644
--- a/fs/cifs/misc.c
+++ b/fs/cifs/misc.c
@@ -150,7 +150,7 @@ tconInfoFree(struct cifsTconInfo *buf_to_free)
 struct smb_hdr *
 cifs_buf_get(void)
 {
-	struct smb_hdr *ret_buf = 0;
+	struct smb_hdr *ret_buf = NULL;
 
 /* We could use negotiated size instead of max_msgsize - 
    but it may be more efficient to always alloc same size 
diff --git a/fs/cifs/smbencrypt.c b/fs/cifs/smbencrypt.c
index 18329601b..c6dfc2277 100644
--- a/fs/cifs/smbencrypt.c
+++ b/fs/cifs/smbencrypt.c
@@ -70,8 +70,6 @@ void SMBOWFencrypt(unsigned char passwd[16], unsigned char *c8,
 void NTLMSSPOWFencrypt(unsigned char passwd[8],
 		       unsigned char *ntlmchalresp, unsigned char p24[24]);
 void SMBNTencrypt(unsigned char *passwd, unsigned char *c8, unsigned char *p24);
-int decode_pw_buffer(char in_buffer[516], char *new_pwrd,
-		     int new_pwrd_size, __u32 * new_pw_len);
 
 /*
    This implements the X/Open SMB password encryption
diff --git a/fs/cifs/smberr.h b/fs/cifs/smberr.h
index 25a39bf34..8db20a0f7 100644
--- a/fs/cifs/smberr.h
+++ b/fs/cifs/smberr.h
@@ -1,7 +1,7 @@
 /*
  *   fs/cifs/smberr.h
  *
- *   Copyright (c) International Business Machines  Corp., 2002
+ *   Copyright (c) International Business Machines  Corp., 2002,2004
  *   Author(s): Steve French (sfrench@us.ibm.com)
  *
  *   See Error Codes section of the SNIA CIFS Specification 
@@ -60,6 +60,7 @@
 #define ERRinvparm   87
 #define ERRdiskfull  112
 #define ERRinvname   123
+#define ERRinvlevel  124
 #define ERRdirnotempty 145
 #define ERRnotlocked   158
 #define ERRalreadyexists 183
diff --git a/fs/cifs/transport.c b/fs/cifs/transport.c
index 3668ab00b..cdc7ed342 100644
--- a/fs/cifs/transport.c
+++ b/fs/cifs/transport.c
@@ -122,8 +122,7 @@ smb_send(struct socket *ssocket, struct smb_hdr *smb_buffer,
 	int rc = 0;
 	int i = 0;
 	struct msghdr smb_msg;
-	struct iovec iov;
-	mm_segment_t temp_fs;
+	struct kvec iov;
 
 	if(ssocket == NULL)
 		return -ENOTSOCK; /* BB eventually add reconnect code here */
@@ -132,8 +131,6 @@ smb_send(struct socket *ssocket, struct smb_hdr *smb_buffer,
 
 	smb_msg.msg_name = sin;
 	smb_msg.msg_namelen = sizeof (struct sockaddr);
-	smb_msg.msg_iov = &iov;
-	smb_msg.msg_iovlen = 1;
 	smb_msg.msg_control = NULL;
 	smb_msg.msg_controllen = 0;
 	smb_msg.msg_flags = MSG_DONTWAIT + MSG_NOSIGNAL; /* BB add more flags?*/
@@ -147,10 +144,8 @@ smb_send(struct socket *ssocket, struct smb_hdr *smb_buffer,
 	cFYI(1, ("Sending smb of length %d ", smb_buf_length));
 	dump_smb(smb_buffer, smb_buf_length + 4);
 
-	temp_fs = get_fs();	/* we must turn off socket api parm checking */
-	set_fs(get_ds());
 	while(iov.iov_len > 0) {
-		rc = sock_sendmsg(ssocket, &smb_msg, smb_buf_length + 4);
+		rc = kernel_sendmsg(ssocket, &smb_msg, &iov, 1, smb_buf_length + 4);
 		if ((rc == -ENOSPC) || (rc == -EAGAIN)) {
 			i++;
 			if(i > 60) {
@@ -169,7 +164,6 @@ smb_send(struct socket *ssocket, struct smb_hdr *smb_buffer,
 		iov.iov_base += rc;
 		iov.iov_len -= rc;
 	}
-	set_fs(temp_fs);
 
 	if (rc < 0) {
 		cERROR(1,("Error %d sending data on socket to server.", rc));
@@ -200,23 +194,41 @@ SendReceive(const unsigned int xid, struct cifsSesInfo *ses,
 	}
 
 	/* Ensure that we do not send more than 50 overlapping requests 
-		to the same server. We may make this configurable later or
-		use ses->maxReq */
-
-	/* can not count locking commands against the total since
-		they are allowed to block on server */
-	if(long_op < 3) {
-		/* update # of requests on the wire to this server */
-		atomic_inc(&ses->server->inFlight); 
-	}
- 
-	if(atomic_read(&ses->server->inFlight) > CIFS_MAX_REQ) {
-		wait_event(ses->server->request_q,atomic_read(&ses->server->inFlight) <= CIFS_MAX_REQ);
+	   to the same server. We may make this configurable later or
+	   use ses->maxReq */
+	if(long_op == -1) {
+		/* oplock breaks must not be held up */
+		atomic_inc(&ses->server->inFlight);
+	} else {
+		spin_lock(&GlobalMid_Lock); 
+		while(1) {        
+			if(atomic_read(&ses->server->inFlight) >= CIFS_MAX_REQ){
+				spin_unlock(&GlobalMid_Lock);
+				wait_event(ses->server->request_q,
+					atomic_read(&ses->server->inFlight)
+					 < CIFS_MAX_REQ);
+				spin_lock(&GlobalMid_Lock);
+			} else {
+				if(ses->server->tcpStatus == CifsExiting) {
+					spin_unlock(&GlobalMid_Lock);
+					return -ENOENT;
+				}
+
+			/* can not count locking commands against total since
+			   they are allowed to block on server */
+					
+				if(long_op < 3) {
+				/* update # of requests on the wire to server */
+					atomic_inc(&ses->server->inFlight);
+				}
+				spin_unlock(&GlobalMid_Lock);
+				break;
+			}
+		}
 	}
-
 	/* make sure that we sign in the same order that we send on this socket 
-		and avoid races inside tcp sendmsg code that could cause corruption
-		of smb data */
+	   and avoid races inside tcp sendmsg code that could cause corruption
+	   of smb data */
 
 	down(&ses->server->tcpSem); 
 
diff --git a/fs/cifs/xattr.c b/fs/cifs/xattr.c
index dd6a2c08c..ebc69c385 100644
--- a/fs/cifs/xattr.c
+++ b/fs/cifs/xattr.c
@@ -26,27 +26,178 @@
 #include "cifsproto.h"
 #include "cifs_debug.h"
 
-int cifs_removexattr(struct dentry * direntry, const char * name)
+#define MAX_EA_VALUE_SIZE 65535
+#define CIFS_XATTR_DOS_ATTRIB "user.DOSATTRIB"
+#define CIFS_XATTR_USER_PREFIX "user."
+#define CIFS_XATTR_SYSTEM_PREFIX "system."
+#define CIFS_XATTR_OS2_PREFIX "OS2." /* BB should check for this someday */
+/* also note could add check for security prefix XATTR_SECURITY_PREFIX */ 
+
+
+int cifs_removexattr(struct dentry * direntry, const char * ea_name)
 {
 	int rc = -EOPNOTSUPP;
+#ifdef CONFIG_CIFS_XATTR
+	int xid;
+	struct cifs_sb_info *cifs_sb;
+	struct cifsTconInfo *pTcon;
+	struct super_block * sb;
+	char * full_path;
+                                                                                     
+	if(direntry == NULL)
+		return -EIO;
+	if(direntry->d_inode == NULL)
+		return -EIO;
+	sb = direntry->d_inode->i_sb;
+	if(sb == NULL)
+		return -EIO;
+	xid = GetXid();
+                                                                                     
+	cifs_sb = CIFS_SB(sb);
+	pTcon = cifs_sb->tcon;
+                                                                                     
+	down(&sb->s_vfs_rename_sem);
+	full_path = build_path_from_dentry(direntry);
+	up(&sb->s_vfs_rename_sem);
+	if(full_path == NULL) {
+		FreeXid(xid);
+		return -ENOMEM;
+	}
+	if(ea_name == NULL) {
+		cFYI(1,("Null xattr names not supported"));
+	} else if(strncmp(ea_name,CIFS_XATTR_USER_PREFIX,5)) {
+		cFYI(1,("illegal xattr namespace %s (only user namespace supported)",ea_name));
+		/* BB what if no namespace prefix? */
+		/* Should we just pass them to server, except for
+		system and perhaps security prefixes? */
+	} else {
+		ea_name+=5; /* skip past user. prefix */
+		rc = CIFSSMBSetEA(xid,pTcon,full_path,ea_name,NULL,
+			(__u16)0, cifs_sb->local_nls);
+	}
+	if (full_path)
+		kfree(full_path);
+	FreeXid(xid);
+#endif
 	return rc;
 }
 
-int cifs_setxattr(struct dentry * direntry, const char * name,
-        const void * value, size_t size, int flags)
+int cifs_setxattr(struct dentry * direntry, const char * ea_name,
+        const void * ea_value, size_t value_size, int flags)
 {
 	int rc = -EOPNOTSUPP;
+#ifdef CONFIG_CIFS_XATTR
+	int xid;
+	struct cifs_sb_info *cifs_sb;
+	struct cifsTconInfo *pTcon;
+	struct super_block * sb;
+	char * full_path;
+
+	if(direntry == NULL)
+		return -EIO;
+	if(direntry->d_inode == NULL)
+		return -EIO;
+	sb = direntry->d_inode->i_sb;
+	if(sb == NULL)
+		return -EIO;
+	xid = GetXid();
+
+	cifs_sb = CIFS_SB(sb);
+	pTcon = cifs_sb->tcon;
+
+	down(&sb->s_vfs_rename_sem);
+	full_path = build_path_from_dentry(direntry);
+	up(&sb->s_vfs_rename_sem);
+	if(full_path == NULL) {
+		FreeXid(xid);
+		return -ENOMEM;
+	}
+	/* return dos attributes as pseudo xattr */
+	/* return alt name if available as pseudo attr */
+
+	/* if proc/fs/cifs/streamstoxattr is set then
+		search server for EAs or streams to 
+		returns as xattrs */
+	if(value_size > MAX_EA_VALUE_SIZE) {
+		cFYI(1,("size of EA value too large"));
+		if(full_path)
+			kfree(full_path);
+		FreeXid(xid);
+		return -EOPNOTSUPP;
+	}
+
+	if(ea_name == NULL) {
+		cFYI(1,("Null xattr names not supported"));
+	} else if(strncmp(ea_name,CIFS_XATTR_USER_PREFIX,5)) {
+		cFYI(1,("illegal xattr namespace %s (only user namespace supported)",ea_name));
+		  /* BB what if no namespace prefix? */
+		  /* Should we just pass them to server, except for 
+		  system and perhaps security prefixes? */
+	} else {
+		ea_name+=5; /* skip past user. prefix */
+		rc = CIFSSMBSetEA(xid,pTcon,full_path,ea_name,ea_value,
+			(__u16)value_size, cifs_sb->local_nls);
+	}
+	if (full_path)
+		kfree(full_path);
+	FreeXid(xid);
+#endif
 	return rc;
 }
 
-ssize_t cifs_getxattr(struct dentry * direntry, const char * name,
-         void * value, size_t size)
+ssize_t cifs_getxattr(struct dentry * direntry, const char * ea_name,
+         void * ea_value, size_t buf_size)
 {
 	ssize_t rc = -EOPNOTSUPP;
+#ifdef CONFIG_CIFS_XATTR
+	int xid;
+	struct cifs_sb_info *cifs_sb;
+	struct cifsTconInfo *pTcon;
+	struct super_block * sb;
+	char * full_path;
+
+	if(direntry == NULL)
+		return -EIO;
+	if(direntry->d_inode == NULL)
+		return -EIO;
+	sb = direntry->d_inode->i_sb;
+	if(sb == NULL)
+		return -EIO;
+	xid = GetXid();
+
+	cifs_sb = CIFS_SB(sb);
+	pTcon = cifs_sb->tcon;
+
+	down(&sb->s_vfs_rename_sem);
+	full_path = build_path_from_dentry(direntry);
+	up(&sb->s_vfs_rename_sem);
+	if(full_path == NULL) {
+		FreeXid(xid);
+		return -ENOMEM;
+	}
+	/* return dos attributes as pseudo xattr */
+	/* return alt name if available as pseudo attr */
+	if(strncmp(ea_name,CIFS_XATTR_USER_PREFIX,5)) {
+		cFYI(1,("illegal xattr namespace %s (only user namespace supported)",ea_name));
+		/* BB what if no namespace prefix? */
+		/* Should we just pass them to server, except for system? */
+	} else {
+	/* We could add a check here
+	    if proc/fs/cifs/streamstoxattr is set then
+		search server for EAs or streams to 
+		returns as xattrs */
+		ea_name+=5; /* skip past user. */
+		rc = CIFSSMBQueryEA(xid,pTcon,full_path,ea_name,ea_value,
+				buf_size, cifs_sb->local_nls);
+	}
+	if (full_path)
+		kfree(full_path);
+	FreeXid(xid);
+#endif
 	return rc;
 }
 
-ssize_t cifs_listxattr(struct dentry * direntry, char * ea_data, size_t ea_size)
+ssize_t cifs_listxattr(struct dentry * direntry, char * data, size_t buf_size)
 {
 	ssize_t rc = -EOPNOTSUPP;
 #ifdef CONFIG_CIFS_XATTR
@@ -55,6 +206,7 @@ ssize_t cifs_listxattr(struct dentry * direntry, char * ea_data, size_t ea_size)
 	struct cifsTconInfo *pTcon;
 	struct super_block * sb;
 	char * full_path;
+
 	if(direntry == NULL)
 		return -EIO;
 	if(direntry->d_inode == NULL)
@@ -74,13 +226,17 @@ ssize_t cifs_listxattr(struct dentry * direntry, char * ea_data, size_t ea_size)
 		FreeXid(xid);
 		return -ENOMEM;
 	}
-	/* return dosattributes as pseudo xattr */
+	/* return dos attributes as pseudo xattr */
 	/* return alt name if available as pseudo attr */
 
 	/* if proc/fs/cifs/streamstoxattr is set then
 		search server for EAs or streams to 
 		returns as xattrs */
-	rc = CIFSSMBQAllEAs(xid,pTcon,full_path,ea_data,ea_size,cifs_sb->local_nls);
+	rc = CIFSSMBQAllEAs(xid,pTcon,full_path,data,buf_size,
+				cifs_sb->local_nls);
+
+	if (full_path)
+		kfree(full_path);
 	FreeXid(xid);
 #endif
 	return rc;
diff --git a/fs/coda/cnode.c b/fs/coda/cnode.c
index 9ef74a31a..6bf72ebb1 100644
--- a/fs/coda/cnode.c
+++ b/fs/coda/cnode.c
@@ -17,8 +17,9 @@ inline int coda_fideq(struct CodaFid *fid1, struct CodaFid *fid2)
 }
 
 static struct inode_operations coda_symlink_inode_operations = {
-	.readlink	= page_readlink,
-	.follow_link	= page_follow_link,
+	.readlink	= generic_readlink,
+	.follow_link	= page_follow_link_light,
+	.put_link	= page_put_link,
 	.setattr	= coda_setattr,
 };
 
diff --git a/fs/coda/inode.c b/fs/coda/inode.c
index 7345de45f..9d39ef496 100644
--- a/fs/coda/inode.c
+++ b/fs/coda/inode.c
@@ -142,7 +142,7 @@ static int get_device_index(struct coda_mount_data *data)
 
 static int coda_fill_super(struct super_block *sb, void *data, int silent)
 {
-        struct inode *root = 0; 
+        struct inode *root = NULL; 
 	struct coda_sb_info *sbi = NULL;
 	struct venus_comm *vc = NULL;
 	struct CodaFid fid;
diff --git a/fs/coda/psdev.c b/fs/coda/psdev.c
index 7d55a28b2..6793b3740 100644
--- a/fs/coda/psdev.c
+++ b/fs/coda/psdev.c
@@ -296,7 +296,7 @@ static int coda_psdev_open(struct inode * inode, struct file * file)
 		INIT_LIST_HEAD(&vcp->vc_pending);
 		INIT_LIST_HEAD(&vcp->vc_processing);
 		init_waitqueue_head(&vcp->vc_waitq);
-		vcp->vc_sb = 0;
+		vcp->vc_sb = NULL;
 		vcp->vc_seq = 0;
 	}
 	
diff --git a/fs/coda/sysctl.c b/fs/coda/sysctl.c
index f1692b563..fd98626ba 100644
--- a/fs/coda/sysctl.c
+++ b/fs/coda/sysctl.c
@@ -69,12 +69,12 @@ void reset_coda_cache_inv_stats( void )
 }
 
 int do_reset_coda_vfs_stats( ctl_table * table, int write, struct file * filp,
-			     void __user * buffer, size_t * lenp )
+			     void __user * buffer, size_t * lenp, loff_t * ppos )
 {
 	if ( write ) {
 		reset_coda_vfs_stats();
 
-		filp->f_pos += *lenp;
+		*ppos += *lenp;
 	} else {
 		*lenp = 0;
 	}
@@ -84,12 +84,12 @@ int do_reset_coda_vfs_stats( ctl_table * table, int write, struct file * filp,
 
 int do_reset_coda_cache_inv_stats( ctl_table * table, int write, 
 				   struct file * filp, void __user * buffer, 
-				   size_t * lenp )
+				   size_t * lenp, loff_t * ppos )
 {
 	if ( write ) {
 		reset_coda_cache_inv_stats();
 
-		filp->f_pos += *lenp;
+		*ppos += *lenp;
 	} else {
 		*lenp = 0;
 	}
@@ -240,7 +240,7 @@ void coda_sysctl_clean(void)
 #ifdef CONFIG_SYSCTL
 	if ( fs_table_header ) {
 		unregister_sysctl_table(fs_table_header);
-		fs_table_header = 0;
+		fs_table_header = NULL;
 	}
 #endif
 
diff --git a/fs/compat.c b/fs/compat.c
index 689fdd017..07f06a307 100644
--- a/fs/compat.c
+++ b/fs/compat.c
@@ -34,6 +34,7 @@
 #include <linux/syscalls.h>
 #include <linux/ctype.h>
 #include <linux/module.h>
+#include <linux/dirent.h>
 #include <linux/dnotify.h>
 #include <linux/highuid.h>
 #include <linux/sunrpc/svc.h>
@@ -268,7 +269,7 @@ static void ioctl32_insert_translation(struct ioctl_trans *trans)
 		t = ioctl32_hash_table[hash];
 		while (t->next)
 			t = t->next;
-		trans->next = 0;
+		trans->next = NULL;
 		t->next = trans;
 	}
 }
@@ -797,6 +798,260 @@ asmlinkage long compat_sys_mount(char __user * dev_name, char __user * dir_name,
 	return retval;
 }
 
+#define NAME_OFFSET(de) ((int) ((de)->d_name - (char __user *) (de)))
+#define COMPAT_ROUND_UP(x) (((x)+sizeof(compat_long_t)-1) & \
+				~(sizeof(compat_long_t)-1))
+
+struct compat_old_linux_dirent {
+	compat_ulong_t	d_ino;
+	compat_ulong_t	d_offset;
+	unsigned short	d_namlen;
+	char		d_name[1];
+};
+
+struct compat_readdir_callback {
+	struct compat_old_linux_dirent __user *dirent;
+	int result;
+};
+
+static int compat_fillonedir(void *__buf, const char *name, int namlen,
+			loff_t offset, ino_t ino, unsigned int d_type)
+{
+	struct compat_readdir_callback *buf = __buf;
+	struct compat_old_linux_dirent __user *dirent;
+
+	if (buf->result)
+		return -EINVAL;
+	buf->result++;
+	dirent = buf->dirent;
+	if (!access_ok(VERIFY_WRITE, dirent,
+			(unsigned long)(dirent->d_name + namlen + 1) -
+				(unsigned long)dirent))
+		goto efault;
+	if (	__put_user(ino, &dirent->d_ino) ||
+		__put_user(offset, &dirent->d_offset) ||
+		__put_user(namlen, &dirent->d_namlen) ||
+		__copy_to_user(dirent->d_name, name, namlen) ||
+		__put_user(0, dirent->d_name + namlen))
+		goto efault;
+	return 0;
+efault:
+	buf->result = -EFAULT;
+	return -EFAULT;
+}
+
+asmlinkage long compat_old_readdir(unsigned int fd,
+	struct compat_old_linux_dirent __user *dirent, unsigned int count)
+{
+	int error;
+	struct file *file;
+	struct compat_readdir_callback buf;
+
+	error = -EBADF;
+	file = fget(fd);
+	if (!file)
+		goto out;
+
+	buf.result = 0;
+	buf.dirent = dirent;
+
+	error = vfs_readdir(file, compat_fillonedir, &buf);
+	if (error >= 0)
+		error = buf.result;
+
+	fput(file);
+out:
+	return error;
+}
+
+struct compat_linux_dirent {
+	compat_ulong_t	d_ino;
+	compat_ulong_t	d_off;
+	unsigned short	d_reclen;
+	char		d_name[1];
+};
+
+struct compat_getdents_callback {
+	struct compat_linux_dirent __user *current_dir;
+	struct compat_linux_dirent __user *previous;
+	int count;
+	int error;
+};
+
+static int compat_filldir(void *__buf, const char *name, int namlen,
+		loff_t offset, ino_t ino, unsigned int d_type)
+{
+	struct compat_linux_dirent __user * dirent;
+	struct compat_getdents_callback *buf = __buf;
+	int reclen = COMPAT_ROUND_UP(NAME_OFFSET(dirent) + namlen + 2);
+
+	buf->error = -EINVAL;	/* only used if we fail.. */
+	if (reclen > buf->count)
+		return -EINVAL;
+	dirent = buf->previous;
+	if (dirent) {
+		if (__put_user(offset, &dirent->d_off))
+			goto efault;
+	}
+	dirent = buf->current_dir;
+	if (__put_user(ino, &dirent->d_ino))
+		goto efault;
+	if (__put_user(reclen, &dirent->d_reclen))
+		goto efault;
+	if (copy_to_user(dirent->d_name, name, namlen))
+		goto efault;
+	if (__put_user(0, dirent->d_name + namlen))
+		goto efault;
+	if (__put_user(d_type, (char  __user *) dirent + reclen - 1))
+		goto efault;
+	buf->previous = dirent;
+	dirent = (void __user *)dirent + reclen;
+	buf->current_dir = dirent;
+	buf->count -= reclen;
+	return 0;
+efault:
+	buf->error = -EFAULT;
+	return -EFAULT;
+}
+
+asmlinkage long compat_sys_getdents(unsigned int fd,
+		struct compat_linux_dirent __user *dirent, unsigned int count)
+{
+	struct file * file;
+	struct compat_linux_dirent __user * lastdirent;
+	struct compat_getdents_callback buf;
+	int error;
+
+	error = -EFAULT;
+	if (!access_ok(VERIFY_WRITE, dirent, count))
+		goto out;
+
+	error = -EBADF;
+	file = fget(fd);
+	if (!file)
+		goto out;
+
+	buf.current_dir = dirent;
+	buf.previous = NULL;
+	buf.count = count;
+	buf.error = 0;
+
+	error = vfs_readdir(file, compat_filldir, &buf);
+	if (error < 0)
+		goto out_putf;
+	error = buf.error;
+	lastdirent = buf.previous;
+	if (lastdirent) {
+		if (put_user(file->f_pos, &lastdirent->d_off))
+			error = -EFAULT;
+		else
+			error = count - buf.count;
+	}
+
+out_putf:
+	fput(file);
+out:
+	return error;
+}
+
+#ifndef __ARCH_OMIT_COMPAT_SYS_GETDENTS64
+#define COMPAT_ROUND_UP64(x) (((x)+sizeof(u64)-1) & ~(sizeof(u64)-1))
+
+struct compat_getdents_callback64 {
+	struct linux_dirent64 __user *current_dir;
+	struct linux_dirent64 __user *previous;
+	int count;
+	int error;
+};
+
+static int compat_filldir64(void * __buf, const char * name, int namlen, loff_t offset,
+		     ino_t ino, unsigned int d_type)
+{
+	struct linux_dirent64 __user *dirent;
+	struct compat_getdents_callback64 *buf = __buf;
+	int jj = NAME_OFFSET(dirent);
+	int reclen = COMPAT_ROUND_UP64(jj + namlen + 1);
+	u64 off;
+
+	buf->error = -EINVAL;	/* only used if we fail.. */
+	if (reclen > buf->count)
+		return -EINVAL;
+	dirent = buf->previous;
+
+	if (dirent) {
+		if (__put_user(offset, (u32 __user *)&dirent->d_off))
+			goto efault;
+		if (__put_user(offset >> 32,
+				((u32 __user *)&dirent->d_off) + 1))
+			goto efault;
+	}
+	dirent = buf->current_dir;
+	if ((__put_user(ino, (u32 __user *)&dirent->d_ino))
+	 || (__put_user(ino >> 32, ((u32 __user *)&dirent->d_ino) + 1)))
+		goto efault;
+	off = 0;
+	if ((__put_user(off, (u32 __user *)&dirent->d_off))
+	 || (__put_user(off >> 32, ((u32 __user *)&dirent->d_off) + 1)))
+		goto efault;
+	if (__put_user(reclen, &dirent->d_reclen))
+		goto efault;
+	if (__put_user(d_type, &dirent->d_type))
+		goto efault;
+	if (copy_to_user(dirent->d_name, name, namlen))
+		goto efault;
+	if (__put_user(0, dirent->d_name + namlen))
+		goto efault;
+	buf->previous = dirent;
+	dirent = (void __user *)dirent + reclen;
+	buf->current_dir = dirent;
+	buf->count -= reclen;
+	return 0;
+efault:
+	buf->error = -EFAULT;
+	return -EFAULT;
+}
+
+asmlinkage long compat_sys_getdents64(unsigned int fd,
+		struct linux_dirent64 __user * dirent, unsigned int count)
+{
+	struct file * file;
+	struct linux_dirent64 __user * lastdirent;
+	struct compat_getdents_callback64 buf;
+	int error;
+
+	error = -EFAULT;
+	if (!access_ok(VERIFY_WRITE, dirent, count))
+		goto out;
+
+	error = -EBADF;
+	file = fget(fd);
+	if (!file)
+		goto out;
+
+	buf.current_dir = dirent;
+	buf.previous = NULL;
+	buf.count = count;
+	buf.error = 0;
+
+	error = vfs_readdir(file, compat_filldir64, &buf);
+	if (error < 0)
+		goto out_putf;
+	error = buf.error;
+	lastdirent = buf.previous;
+	if (lastdirent) {
+		typeof(lastdirent->d_off) d_off = file->f_pos;
+		__put_user(d_off, (u32 __user *)&lastdirent->d_off);
+		__put_user(d_off >> 32, ((u32 __user *)&lastdirent->d_off) + 1);
+		error = count - buf.count;
+	}
+
+out_putf:
+	fput(file);
+out:
+	return error;
+}
+#endif /* ! __ARCH_OMIT_COMPAT_SYS_GETDENTS64 */
+
 static ssize_t compat_do_readv_writev(int type, struct file *file,
 			       const struct compat_iovec __user *uvector,
 			       unsigned long nr_segs, loff_t *pos)
diff --git a/fs/compat_ioctl.c b/fs/compat_ioctl.c
index fc3fb9f14..dc1a2d2c4 100644
--- a/fs/compat_ioctl.c
+++ b/fs/compat_ioctl.c
@@ -257,66 +257,6 @@ struct video_window32 {
 	compat_int_t clipcount;
 };
 
-static void free_kvideo_clips(struct video_window *kp)
-{
-	struct video_clip *cp;
-
-	cp = kp->clips;
-	if(cp != NULL)
-		kfree(cp);
-}
-
-static int get_video_window32(struct video_window *kp, struct video_window32 __user *up)
-{
-	struct video_clip32 __user *ucp;
-	struct video_clip *kcp;
-	int nclips, err, i;
-	u32 tmp;
-
-	if(get_user(kp->x, &up->x))
-		return -EFAULT;
-	__get_user(kp->y, &up->y);
-	__get_user(kp->width, &up->width);
-	__get_user(kp->height, &up->height);
-	__get_user(kp->chromakey, &up->chromakey);
-	__get_user(kp->flags, &up->flags);
-	__get_user(kp->clipcount, &up->clipcount);
-	__get_user(tmp, &up->clips);
-	ucp = compat_ptr(tmp);
-	kp->clips = NULL;
-
-	nclips = kp->clipcount;
-	if(nclips == 0)
-		return 0;
-
-	if(ucp == 0)
-		return -EINVAL;
-
-	/* Peculiar interface... */
-	if(nclips < 0)
-		nclips = VIDEO_CLIPMAP_SIZE;
-
-	kcp = kmalloc(nclips * sizeof(struct video_clip), GFP_KERNEL);
-	err = -ENOMEM;
-	if(kcp == NULL)
-		goto cleanup_and_err;
-
-	kp->clips = kcp;
-	for(i = 0; i < nclips; i++) {
-		__get_user(kcp[i].x, &ucp[i].x);
-		__get_user(kcp[i].y, &ucp[i].y);
-		__get_user(kcp[i].width, &ucp[i].width);
-		__get_user(kcp[i].height, &ucp[i].height);
-		kcp[nclips].next = NULL;
-	}
-
-	return 0;
-
-cleanup_and_err:
-	free_kvideo_clips(kp);
-	return err;
-}
-
 /* You get back everything except the clips... */
 static int put_video_window32(struct video_window *kp, struct video_window32 __user *up)
 {
@@ -340,6 +280,66 @@ static int put_video_window32(struct video_window *kp, struct video_window32 __u
 #define VIDIOCGFREQ32		_IOR('v',14, u32)
 #define VIDIOCSFREQ32		_IOW('v',15, u32)
 
+enum {
+	MaxClips = (~0U-sizeof(struct video_window))/sizeof(struct video_clip)
+};
+
+static int do_set_window(unsigned int fd, unsigned int cmd, unsigned long arg)
+{
+	struct video_window32 __user *up = compat_ptr(arg);
+	struct video_window __user *vw;
+	struct video_clip __user *p;
+	int nclips;
+	u32 n;
+
+	if (get_user(nclips, &up->clipcount))
+		return -EFAULT;
+
+	/* Peculiar interface... */
+	if (nclips < 0)
+		nclips = VIDEO_CLIPMAP_SIZE;
+
+	if (nclips > MaxClips)
+		return -ENOMEM;
+
+	vw = compat_alloc_user_space(sizeof(struct video_window) +
+				    nclips * sizeof(struct video_clip));
+
+	p = nclips ? (struct video_clip __user *)(vw + 1) : NULL;
+
+	if (get_user(n, &up->x) || put_user(n, &vw->x) ||
+	    get_user(n, &up->y) || put_user(n, &vw->y) ||
+	    get_user(n, &up->width) || put_user(n, &vw->width) ||
+	    get_user(n, &up->height) || put_user(n, &vw->height) ||
+	    get_user(n, &up->chromakey) || put_user(n, &vw->chromakey) ||
+	    get_user(n, &up->flags) || put_user(n, &vw->flags) ||
+	    get_user(n, &up->clipcount) || put_user(n, &vw->clipcount) ||
+	    get_user(n, &up->clips) || put_user(p, &vw->clips))
+		return -EFAULT;
+
+	if (nclips) {
+		struct video_clip32 __user *u = compat_ptr(n);
+		int i;
+		if (!u)
+			return -EINVAL;
+		for (i = 0; i < nclips; i++, u++, p++) {
+			s32 v;
+			if (get_user(v, &u->x) ||
+			    put_user(v, &p->x) ||
+			    get_user(v, &u->y) ||
+			    put_user(v, &p->y) ||
+			    get_user(v, &u->width) ||
+			    put_user(v, &p->width) ||
+			    get_user(v, &u->height) ||
+			    put_user(v, &p->height) ||
+			    put_user(NULL, &p->next))
+				return -EFAULT;
+		}
+	}
+
+	return sys_ioctl(fd, VIDIOCSWIN, (unsigned long)p);
+}
+
 static int do_video_ioctl(unsigned int fd, unsigned int cmd, unsigned long arg)
 {
 	union {
@@ -357,7 +357,6 @@ static int do_video_ioctl(unsigned int fd, unsigned int cmd, unsigned long arg)
 	case VIDIOCGTUNER32: cmd = VIDIOCGTUNER; break;
 	case VIDIOCSTUNER32: cmd = VIDIOCSTUNER; break;
 	case VIDIOCGWIN32: cmd = VIDIOCGWIN; break;
-	case VIDIOCSWIN32: cmd = VIDIOCSWIN; break;
 	case VIDIOCGFBUF32: cmd = VIDIOCGFBUF; break;
 	case VIDIOCSFBUF32: cmd = VIDIOCSFBUF; break;
 	case VIDIOCGFREQ32: cmd = VIDIOCGFREQ; break;
@@ -370,10 +369,6 @@ static int do_video_ioctl(unsigned int fd, unsigned int cmd, unsigned long arg)
 		err = get_video_tuner32(&karg.vt, up);
 		break;
 
-	case VIDIOCSWIN:
-		err = get_video_window32(&karg.vw, up);
-		break;
-
 	case VIDIOCSFBUF:
 		err = get_video_buffer32(&karg.vb, up);
 		break;
@@ -389,9 +384,6 @@ static int do_video_ioctl(unsigned int fd, unsigned int cmd, unsigned long arg)
 	err = sys_ioctl(fd, cmd, (unsigned long)&karg);
 	set_fs(old_fs);
 
-	if(cmd == VIDIOCSWIN)
-		free_kvideo_clips(&karg.vw);
-
 	if(err == 0) {
 		switch(cmd) {
 		case VIDIOCGTUNER:
@@ -788,7 +780,7 @@ static int routing_ioctl(unsigned int fd, unsigned int cmd, unsigned long arg)
 			ret |= copy_from_user (devname, compat_ptr(rtdev), 15);
 			r4.rt_dev = devname; devname[15] = 0;
 		} else
-			r4.rt_dev = 0;
+			r4.rt_dev = NULL;
 
 		r = (void *) &r4;
 	}
@@ -859,7 +851,7 @@ struct fb_cmap32 {
 
 static int fb_getput_cmap(unsigned int fd, unsigned int cmd, unsigned long arg)
 {
-	struct fb_cmap __user *cmap;
+	struct fb_cmap_user __user *cmap;
 	struct fb_cmap32 __user *cmap32;
 	__u32 data;
 	int err;
@@ -1960,6 +1952,11 @@ static int do_blkgetsize64(unsigned int fd, unsigned int cmd,
 #define CMTPGETCONNLIST	_IOR('C', 210, int)
 #define CMTPGETCONNINFO	_IOR('C', 211, int)
 
+#define HIDPCONNADD	_IOW('H', 200, int)
+#define HIDPCONNDEL	_IOW('H', 201, int)
+#define HIDPGETCONNLIST	_IOR('H', 210, int)
+#define HIDPGETCONNINFO	_IOR('H', 211, int)
+
 struct floppy_struct32 {
 	compat_uint_t	size;
 	compat_uint_t	sect;
@@ -2520,54 +2517,15 @@ struct usbdevfs_ctrltransfer32 {
 
 static int do_usbdevfs_control(unsigned int fd, unsigned int cmd, unsigned long arg)
 {
-        struct usbdevfs_ctrltransfer kctrl;
-        struct usbdevfs_ctrltransfer32 __user *uctrl;
-        mm_segment_t old_fs;
+        struct usbdevfs_ctrltransfer32 __user *p32 = compat_ptr(arg);
+        struct usbdevfs_ctrltransfer __user *p;
         __u32 udata;
-        void __user *uptr;
-        void *kptr;
-        int err;
-
-        uctrl = compat_ptr(arg);
-
-        if (copy_from_user(&kctrl, uctrl,
-                           (sizeof(struct usbdevfs_ctrltransfer32) -
-                            sizeof(compat_caddr_t))))
-                return -EFAULT;
-
-        if (get_user(udata, &uctrl->data))
-                return -EFAULT;
-        uptr = compat_ptr(udata);
-        /* In usbdevice_fs, it limits the control buffer to a page,
-         * for simplicity so do we.
-         */
-        if (!uptr || kctrl.wLength > PAGE_SIZE)
-                return -EINVAL;
-
-        kptr = (void *)__get_free_page(GFP_KERNEL);
-
-        if ((kctrl.bRequestType & USB_DIR_IN) == 0) {
-                err = -EFAULT;
-                if (copy_from_user(kptr, uptr, kctrl.wLength))
-                        goto out;
-        }
-
-        kctrl.data = kptr;
-
-        old_fs = get_fs();
-        set_fs(KERNEL_DS);
-        err = sys_ioctl(fd, USBDEVFS_CONTROL, (unsigned long)&kctrl);
-        set_fs(old_fs);
-
-        if (err >= 0 &&
-            ((kctrl.bRequestType & USB_DIR_IN) != 0)) {
-                if (copy_to_user(uptr, kptr, kctrl.wLength))
-                        err = -EFAULT;
-        }
-
-out:
-        free_page((unsigned long) kptr);
-        return err;
+        p = compat_alloc_user_space(sizeof(*p));
+        if (copy_in_user(p, p32, (sizeof(*p32) - sizeof(compat_caddr_t))) ||
+            get_user(udata, &p32->data) ||
+	    put_user(compat_ptr(udata), &p->data))
+		return -EFAULT;
+        return sys_ioctl(fd, USBDEVFS_CONTROL, (unsigned long)p);
 }
 
 
@@ -2582,54 +2540,20 @@ struct usbdevfs_bulktransfer32 {
 
 static int do_usbdevfs_bulk(unsigned int fd, unsigned int cmd, unsigned long arg)
 {
-        struct usbdevfs_bulktransfer kbulk;
-        struct usbdevfs_bulktransfer32 __user *ubulk;
-        mm_segment_t old_fs;
-        __u32 udata;
-        void __user *uptr;
-        void *kptr;
-        int err;
+        struct usbdevfs_bulktransfer32 __user *p32 = compat_ptr(arg);
+        struct usbdevfs_bulktransfer __user *p;
+        compat_uint_t n;
+        compat_caddr_t addr;
 
-	ubulk = compat_ptr(arg);
+        p = compat_alloc_user_space(sizeof(*p));
 
-        if (get_user(kbulk.ep, &ubulk->ep) ||
-            get_user(kbulk.len, &ubulk->len) ||
-            get_user(kbulk.timeout, &ubulk->timeout) ||
-            get_user(udata, &ubulk->data))
+        if (get_user(n, &p32->ep) || put_user(n, &p->ep) ||
+            get_user(n, &p32->len) || put_user(n, &p->len) ||
+            get_user(n, &p32->timeout) || put_user(n, &p->timeout) ||
+            get_user(addr, &p32->data) || put_user(compat_ptr(addr), &p->data))
                 return -EFAULT;
 
-        uptr = compat_ptr(udata);
-
-        /* In usbdevice_fs, it limits the control buffer to a page,
-         * for simplicity so do we.
-         */
-        if (!uptr || kbulk.len > PAGE_SIZE)
-                return -EINVAL;
-
-        kptr = (void *) __get_free_page(GFP_KERNEL);
-
-        if ((kbulk.ep & 0x80) == 0) {
-                err = -EFAULT;
-	        if (copy_from_user(kptr, uptr, kbulk.len))
-                        goto out;
-        }
-
-        kbulk.data = kptr;
-
-	old_fs = get_fs();
-        set_fs(KERNEL_DS);
-        err = sys_ioctl(fd, USBDEVFS_BULK, (unsigned long) &kbulk);
-        set_fs(old_fs);
-
-        if (err >= 0 &&
-            ((kbulk.ep & 0x80) != 0)) {
-                if (copy_to_user(uptr, kptr, kbulk.len))
-                        err = -EFAULT;
-        }
-
-out:
-        free_page((unsigned long) kptr);
-        return err;
+        return sys_ioctl(fd, USBDEVFS_BULK, (unsigned long)p);
 }
 
 /* This needs more work before we can enable it.  Unfortunately
@@ -3337,7 +3261,7 @@ HANDLE_IOCTL(EXT2_IOC32_SETVERSION, do_ext2_ioctl)
 HANDLE_IOCTL(VIDIOCGTUNER32, do_video_ioctl)
 HANDLE_IOCTL(VIDIOCSTUNER32, do_video_ioctl)
 HANDLE_IOCTL(VIDIOCGWIN32, do_video_ioctl)
-HANDLE_IOCTL(VIDIOCSWIN32, do_video_ioctl)
+HANDLE_IOCTL(VIDIOCSWIN32, do_set_window)
 HANDLE_IOCTL(VIDIOCGFBUF32, do_video_ioctl)
 HANDLE_IOCTL(VIDIOCSFBUF32, do_video_ioctl)
 HANDLE_IOCTL(VIDIOCGFREQ32, do_video_ioctl)
diff --git a/fs/dcache.c b/fs/dcache.c
index 613ff66da..425c2e568 100644
--- a/fs/dcache.c
+++ b/fs/dcache.c
@@ -30,10 +30,12 @@
 #include <linux/security.h>
 #include <linux/seqlock.h>
 #include <linux/swap.h>
+#include <linux/bootmem.h>
 
-#define DCACHE_PARANOIA 1
 /* #define DCACHE_DEBUG 1 */
 
+int sysctl_vfs_cache_pressure = 100;
+
 spinlock_t dcache_lock __cacheline_aligned_in_smp = SPIN_LOCK_UNLOCKED;
 seqlock_t rename_lock __cacheline_aligned_in_smp = SEQLOCK_UNLOCKED;
 
@@ -64,9 +66,9 @@ struct dentry_stat_t dentry_stat = {
 	.age_limit = 45,
 };
 
-static void d_callback(void *arg)
+static void d_callback(struct rcu_head *head)
 {
-	struct dentry * dentry = (struct dentry *)arg;
+	struct dentry * dentry = container_of(head, struct dentry, d_rcu);
 
 	if (dname_external(dentry))
 		kfree(dentry->d_name.name);
@@ -81,7 +83,7 @@ static void d_free(struct dentry *dentry)
 {
 	if (dentry->d_op && dentry->d_op->d_release)
 		dentry->d_op->d_release(dentry);
- 	call_rcu(&dentry->d_rcu, d_callback, dentry);
+ 	call_rcu(&dentry->d_rcu, d_callback);
 }
 
 /*
@@ -626,7 +628,7 @@ void shrink_dcache_anon(struct hlist_head *head)
 			struct dentry *this = hlist_entry(lp, struct dentry, d_hash);
 			if (!list_empty(&this->d_lru)) {
 				dentry_stat.nr_unused--;
-				list_del(&this->d_lru);
+				list_del_init(&this->d_lru);
 			}
 
 			/* 
@@ -663,7 +665,7 @@ static int shrink_dcache_memory(int nr, unsigned int gfp_mask)
 			return -1;
 		prune_dcache(nr);
 	}
-	return dentry_stat.nr_unused;
+	return (dentry_stat.nr_unused / 100) * sysctl_vfs_cache_pressure;
 }
 
 /**
@@ -1561,13 +1563,25 @@ static int __init set_dhash_entries(char *str)
 }
 __setup("dhash_entries=", set_dhash_entries);
 
-static void __init dcache_init(unsigned long mempages)
+static void __init dcache_init_early(void)
 {
-	struct hlist_head *d;
-	unsigned long order;
-	unsigned int nr_hash;
-	int i;
+	int loop;
+
+	dentry_hashtable =
+		alloc_large_system_hash("Dentry cache",
+					sizeof(struct hlist_head),
+					dhash_entries,
+					13,
+					0,
+					&d_hash_shift,
+					&d_hash_mask);
+
+	for (loop = 0; loop < (1 << d_hash_shift); loop++)
+		INIT_HLIST_HEAD(&dentry_hashtable[loop]);
+}
 
+static void __init dcache_init(unsigned long mempages)
+{
 	/* 
 	 * A constructor could be added for stable state like the lists,
 	 * but it is probably not worth it because of the cache nature
@@ -1580,45 +1594,6 @@ static void __init dcache_init(unsigned long mempages)
 					 NULL, NULL);
 	
 	set_shrinker(DEFAULT_SEEKS, shrink_dcache_memory);
-
-	if (!dhash_entries)
-		dhash_entries = PAGE_SHIFT < 13 ?
-				mempages >> (13 - PAGE_SHIFT) :
-				mempages << (PAGE_SHIFT - 13);
-
-	dhash_entries *= sizeof(struct hlist_head);
-	for (order = 0; ((1UL << order) << PAGE_SHIFT) < dhash_entries; order++)
-		;
-
-	do {
-		unsigned long tmp;
-
-		nr_hash = (1UL << order) * PAGE_SIZE /
-			sizeof(struct hlist_head);
-		d_hash_mask = (nr_hash - 1);
-
-		tmp = nr_hash;
-		d_hash_shift = 0;
-		while ((tmp >>= 1UL) != 0UL)
-			d_hash_shift++;
-
-		dentry_hashtable = (struct hlist_head *)
-			__get_free_pages(GFP_ATOMIC, order);
-	} while (dentry_hashtable == NULL && --order >= 0);
-
-	printk(KERN_INFO "Dentry cache hash table entries: %d (order: %ld, %ld bytes)\n",
-			nr_hash, order, (PAGE_SIZE << order));
-
-	if (!dentry_hashtable)
-		panic("Failed to allocate dcache hash table\n");
-
-	d = dentry_hashtable;
-	i = nr_hash;
-	do {
-		INIT_HLIST_HEAD(d);
-		d++;
-		i--;
-	} while (i);
 }
 
 /* SLAB cache for __getname() consumers */
@@ -1632,6 +1607,12 @@ EXPORT_SYMBOL(d_genocide);
 extern void bdev_cache_init(void);
 extern void chrdev_init(void);
 
+void __init vfs_caches_init_early(void)
+{
+	dcache_init_early();
+	inode_init_early();
+}
+
 void __init vfs_caches_init(unsigned long mempages)
 {
 	unsigned long reserve;
diff --git a/fs/dcookies.c b/fs/dcookies.c
index 70fd5f138..8ecfe5ecb 100644
--- a/fs/dcookies.c
+++ b/fs/dcookies.c
@@ -60,7 +60,7 @@ static size_t dcookie_hash(unsigned long dcookie)
 
 static struct dcookie_struct * find_dcookie(unsigned long dcookie)
 {
-	struct dcookie_struct * found = 0;
+	struct dcookie_struct *found = NULL;
 	struct dcookie_struct * dcs;
 	struct list_head * pos;
 	struct list_head * list;
diff --git a/fs/devfs/base.c b/fs/devfs/base.c
index 5e66bc917..a62d9412e 100644
--- a/fs/devfs/base.c
+++ b/fs/devfs/base.c
@@ -857,12 +857,14 @@ static int devfsd_close(struct inode *inode, struct file *file);
 static ssize_t stat_read(struct file *file, char __user *buf, size_t len,
 			 loff_t * ppos);
 static struct file_operations stat_fops = {
+	.open = nonseekable_open,
 	.read = stat_read,
 };
 #endif
 
 /*  Devfs daemon file operations  */
 static struct file_operations devfsd_fops = {
+	.open = nonseekable_open,
 	.read = devfsd_read,
 	.ioctl = devfsd_ioctl,
 	.release = devfsd_close,
@@ -2490,28 +2492,11 @@ static int devfs_mknod(struct inode *dir, struct dentry *dentry, int mode,
 	return 0;
 }				/*  End Function devfs_mknod  */
 
-static int devfs_readlink(struct dentry *dentry, char *buffer, int buflen)
-{
-	int err;
-	struct devfs_entry *de;
-
-	de = get_devfs_entry_from_vfs_inode(dentry->d_inode);
-	if (!de)
-		return -ENODEV;
-	err = vfs_readlink(dentry, buffer, buflen, de->u.symlink.linkname);
-	return err;
-}				/*  End Function devfs_readlink  */
-
 static int devfs_follow_link(struct dentry *dentry, struct nameidata *nd)
 {
-	int err;
-	struct devfs_entry *de;
-
-	de = get_devfs_entry_from_vfs_inode(dentry->d_inode);
-	if (!de)
-		return -ENODEV;
-	err = vfs_follow_link(nd, de->u.symlink.linkname);
-	return err;
+	struct devfs_entry *p = get_devfs_entry_from_vfs_inode(dentry->d_inode);
+	nd_set_link(nd, p ? p->u.symlink.linkname : ERR_PTR(-ENODEV));
+	return 0;
 }				/*  End Function devfs_follow_link  */
 
 static struct inode_operations devfs_iops = {
@@ -2529,7 +2514,7 @@ static struct inode_operations devfs_dir_iops = {
 };
 
 static struct inode_operations devfs_symlink_iops = {
-	.readlink = devfs_readlink,
+	.readlink = generic_readlink,
 	.follow_link = devfs_follow_link,
 	.setattr = devfs_notify_change,
 };
@@ -2591,9 +2576,6 @@ static ssize_t devfsd_read(struct file *file, char __user *buf, size_t len,
 	struct devfsd_notify_struct *info = fs_info->devfsd_info;
 	DECLARE_WAITQUEUE(wait, current);
 
-	/*  Can't seek (pread) on this device  */
-	if (ppos != &file->f_pos)
-		return -ESPIPE;
 	/*  Verify the task has grabbed the queue  */
 	if (fs_info->devfsd_task != current)
 		return -EPERM;
@@ -2780,9 +2762,6 @@ static ssize_t stat_read(struct file *file, char __user *buf, size_t len,
 
 	num = sprintf(txt, "Number of entries: %u  number of bytes: %u\n",
 		      stat_num_entries, stat_num_bytes) + 1;
-	/*  Can't seek (pread) on this device  */
-	if (ppos != &file->f_pos)
-		return -ESPIPE;
 	if (*ppos >= num)
 		return 0;
 	if (*ppos + len > num)
diff --git a/fs/devpts/inode.c b/fs/devpts/inode.c
index 93b55afa1..a429f2817 100644
--- a/fs/devpts/inode.c
+++ b/fs/devpts/inode.c
@@ -21,8 +21,6 @@
 #include <linux/vs_base.h>
 #include "xattr.h"
 
-#define DEVPTS_SUPER_MAGIC 0x1cd1
-
 static struct vfsmount *devpts_mnt;
 static struct dentry *devpts_root;
 
@@ -98,6 +96,7 @@ devpts_fill_super(struct super_block *s, void *data, int silent)
 	inode->i_op = &simple_dir_inode_operations;
 	inode->i_fop = &simple_dir_operations;
 	inode->i_nlink = 2;
+	inode->i_xid = vx_current_xid();
 
 	devpts_root = s->s_root = d_alloc_root(inode);
 	if (s->s_root)
diff --git a/fs/direct-io.c b/fs/direct-io.c
index d498521c9..37f593c42 100644
--- a/fs/direct-io.c
+++ b/fs/direct-io.c
@@ -395,7 +395,7 @@ static int dio_bio_complete(struct dio *dio, struct bio *bio)
 		for (page_no = 0; page_no < bio->bi_vcnt; page_no++) {
 			struct page *page = bvec[page_no].bv_page;
 
-			if (dio->rw == READ)
+			if (dio->rw == READ && !PageCompound(page))
 				set_page_dirty_lock(page);
 			page_cache_release(page);
 		}
@@ -990,6 +990,13 @@ direct_io_worker(int rw, struct kiocb *iocb, struct inode *inode,
 		}
 	} /* end iovec loop */
 
+	if (ret == -ENOTBLK && rw == WRITE) {
+		/*
+		 * The remaining part of the request will be
+		 * be handled by buffered I/O when we return
+		 */
+		ret = 0;
+	}
 	/*
 	 * There may be some unwritten disk at the end of a part-written
 	 * fs-block-sized block.  Go zero that now.
@@ -1089,13 +1096,6 @@ direct_io_worker(int rw, struct kiocb *iocb, struct inode *inode,
 			aio_complete(iocb, ret, 0);
 		kfree(dio);
 	}
-	if (ret == -ENOTBLK && rw == WRITE) {
-		/*
-		 * The entire request will be be handled by buffered I/O
-		 * when we return
-		 */
-		ret = 0;
-	}
 	return ret;
 }
 
diff --git a/fs/dnotify.c b/fs/dnotify.c
index daee2edb1..f3b540dd5 100644
--- a/fs/dnotify.c
+++ b/fs/dnotify.c
@@ -23,7 +23,6 @@
 
 int dir_notify_enable = 1;
 
-static rwlock_t dn_lock = RW_LOCK_UNLOCKED;
 static kmem_cache_t *dn_cache;
 
 static void redo_inode_mask(struct inode *inode)
@@ -46,7 +45,7 @@ void dnotify_flush(struct file *filp, fl_owner_t id)
 	inode = filp->f_dentry->d_inode;
 	if (!S_ISDIR(inode->i_mode))
 		return;
-	write_lock(&dn_lock);
+	spin_lock(&inode->i_lock);
 	prev = &inode->i_dnotify;
 	while ((dn = *prev) != NULL) {
 		if ((dn->dn_owner == id) && (dn->dn_filp == filp)) {
@@ -57,7 +56,7 @@ void dnotify_flush(struct file *filp, fl_owner_t id)
 		}
 		prev = &dn->dn_next;
 	}
-	write_unlock(&dn_lock);
+	spin_unlock(&inode->i_lock);
 }
 
 int fcntl_dirnotify(int fd, struct file *filp, unsigned long arg)
@@ -81,7 +80,7 @@ int fcntl_dirnotify(int fd, struct file *filp, unsigned long arg)
 	dn = kmem_cache_alloc(dn_cache, SLAB_KERNEL);
 	if (dn == NULL)
 		return -ENOMEM;
-	write_lock(&dn_lock);
+	spin_lock(&inode->i_lock);
 	prev = &inode->i_dnotify;
 	while ((odn = *prev) != NULL) {
 		if ((odn->dn_owner == id) && (odn->dn_filp == filp)) {
@@ -104,12 +103,16 @@ int fcntl_dirnotify(int fd, struct file *filp, unsigned long arg)
 	inode->i_dnotify_mask |= arg & ~DN_MULTISHOT;
 	dn->dn_next = inode->i_dnotify;
 	inode->i_dnotify = dn;
-out:
-	write_unlock(&dn_lock);
-	return error;
+	spin_unlock(&inode->i_lock);
+
+	if (filp->f_op && filp->f_op->dir_notify)
+		return filp->f_op->dir_notify(filp, arg);
+	return 0;
+
 out_free:
+	spin_unlock(&inode->i_lock);
 	kmem_cache_free(dn_cache, dn);
-	goto out;
+	return error;
 }
 
 void __inode_dir_notify(struct inode *inode, unsigned long event)
@@ -119,7 +122,7 @@ void __inode_dir_notify(struct inode *inode, unsigned long event)
 	struct fown_struct *	fown;
 	int			changed = 0;
 
-	write_lock(&dn_lock);
+	spin_lock(&inode->i_lock);
 	prev = &inode->i_dnotify;
 	while ((dn = *prev) != NULL) {
 		if ((dn->dn_mask & event) == 0) {
@@ -138,7 +141,7 @@ void __inode_dir_notify(struct inode *inode, unsigned long event)
 	}
 	if (changed)
 		redo_inode_mask(inode);
-	write_unlock(&dn_lock);
+	spin_unlock(&inode->i_lock);
 }
 
 EXPORT_SYMBOL(__inode_dir_notify);
diff --git a/fs/dquot.c b/fs/dquot.c
index 70280bc2f..35c84acdc 100644
--- a/fs/dquot.c
+++ b/fs/dquot.c
@@ -96,9 +96,11 @@
  *
  * Any operation working on dquots via inode pointers must hold dqptr_sem.  If
  * operation is just reading pointers from inode (or not using them at all) the
- * read lock is enough. If pointers are altered function must hold write lock.
- * If operation is holding reference to dquot in other way (e.g. quotactl ops)
- * it must be guarded by dqonoff_sem.
+ * read lock is enough. If pointers are altered function must hold write lock
+ * (these locking rules also apply for S_NOQUOTA flag in the inode - note that
+ * for altering the flag i_sem is also needed).  If operation is holding
+ * reference to dquot in other way (e.g. quotactl ops) it must be guarded by
+ * dqonoff_sem.
  * This locking assures that:
  *   a) update/access to dquot pointers in inode is serialized
  *   b) everyone is guarded against invalidate_dquots()
@@ -112,8 +114,10 @@
  * operations on dquots don't hold dq_lock as they copy data under dq_data_lock
  * spinlock to internal buffers before writing.
  *
- * Lock ordering (including journal_lock) is following:
- *  dqonoff_sem > journal_lock > dqptr_sem > dquot->dq_lock > dqio_sem
+ * Lock ordering (including related VFS locks) is following:
+ *   i_sem > dqonoff_sem > iprune_sem > journal_lock > dqptr_sem >
+ *   > dquot->dq_lock > dqio_sem
+ * i_sem on quota files is special (it's below dqio_sem)
  */
 
 spinlock_t dq_list_lock = SPIN_LOCK_UNLOCKED;
@@ -202,9 +206,12 @@ struct dqstats dqstats;
 
 static void dqput(struct dquot *dquot);
 
-static inline int const hashfn(struct super_block *sb, unsigned int id, int type)
+static inline unsigned int
+hashfn(const struct super_block *sb, unsigned int id, int type)
 {
-	unsigned long tmp = (((unsigned long)sb>>L1_CACHE_SHIFT) ^ id) * (MAXQUOTAS - type);
+	unsigned long tmp;
+
+	tmp = (((unsigned long)sb>>L1_CACHE_SHIFT) ^ id) * (MAXQUOTAS - type);
 	return (tmp + (tmp >> dq_hash_bits)) & dq_hash_mask;
 }
 
@@ -684,16 +691,8 @@ static inline int dqput_blocks(struct dquot *dquot)
 int remove_inode_dquot_ref(struct inode *inode, int type, struct list_head *tofree_head)
 {
 	struct dquot *dquot = inode->i_dquot[type];
-	int cnt;
 
 	inode->i_dquot[type] = NODQUOT;
-	/* any other quota in use? */
-	for (cnt = 0; cnt < MAXQUOTAS; cnt++) {
-		if (inode->i_dquot[cnt] != NODQUOT)
-			goto put_it;
-	}
-	inode->i_flags &= ~S_QUOTA;
-put_it:
 	if (dquot != NODQUOT) {
 		if (dqput_blocks(dquot)) {
 #ifdef __DQUOT_PARANOIA
@@ -728,17 +727,18 @@ static void put_dquot_list(struct list_head *tofree_head)
 	}
 }
 
-/* Function in inode.c - remove pointers to dquots in icache */
-extern void remove_dquot_ref(struct super_block *, int, struct list_head *);
-
 /* Gather all references from inodes and drop them */
 static void drop_dquot_ref(struct super_block *sb, int type)
 {
 	LIST_HEAD(tofree_head);
 
+	/* We need to be guarded against prune_icache to reach all the
+	 * inodes - otherwise some can be on the local list of prune_icache */
+	down(&iprune_sem);
 	down_write(&sb_dqopt(sb)->dqptr_sem);
 	remove_dquot_ref(sb, type, &tofree_head);
 	up_write(&sb_dqopt(sb)->dqptr_sem);
+	up(&iprune_sem);
 	put_dquot_list(&tofree_head);
 }
 
@@ -953,8 +953,6 @@ int dquot_initialize(struct inode *inode, int type)
 					break;
 			}
 			inode->i_dquot[cnt] = dqget(inode->i_sb, id, cnt);
-			if (inode->i_dquot[cnt])
-				inode->i_flags |= S_QUOTA;
 		}
 	}
 out_err:
@@ -971,7 +969,6 @@ int dquot_drop(struct inode *inode)
 	int cnt;
 
 	down_write(&sb_dqopt(inode->i_sb)->dqptr_sem);
-	inode->i_flags &= ~S_QUOTA;
 	for (cnt = 0; cnt < MAXQUOTAS; cnt++) {
 		if (inode->i_dquot[cnt] != NODQUOT) {
 			dqput(inode->i_dquot[cnt]);
@@ -1364,7 +1361,7 @@ static int vfs_quota_on_file(struct file *f, int type, int format_id)
 	struct quota_info *dqopt = sb_dqopt(sb);
 	struct dquot *to_drop[MAXQUOTAS];
 	int error, cnt;
-	unsigned int oldflags;
+	unsigned int oldflags = -1;
 
 	if (!fmt)
 		return -ESRCH;
@@ -1376,22 +1373,26 @@ static int vfs_quota_on_file(struct file *f, int type, int format_id)
 	if (!S_ISREG(inode->i_mode))
 		goto out_fmt;
 
+	down(&inode->i_sem);
 	down(&dqopt->dqonoff_sem);
 	if (sb_has_quota_enabled(sb, type)) {
+		up(&inode->i_sem);
 		error = -EBUSY;
 		goto out_lock;
 	}
-	oldflags = inode->i_flags;
-	dqopt->files[type] = f;
-	error = -EINVAL;
-	if (!fmt->qf_ops->check_quota_file(sb, type))
-		goto out_file_init;
 	/* We don't want quota and atime on quota files (deadlocks possible)
 	 * We also need to set GFP mask differently because we cannot recurse
 	 * into filesystem when allocating page for quota inode */
 	down_write(&dqopt->dqptr_sem);
+	oldflags = inode->i_flags & (S_NOATIME | S_NOQUOTA);
 	inode->i_flags |= S_NOQUOTA | S_NOATIME;
+	up_write(&dqopt->dqptr_sem);
+	up(&inode->i_sem);
 
+	dqopt->files[type] = f;
+	error = -EINVAL;
+	if (!fmt->qf_ops->check_quota_file(sb, type))
+		goto out_file_init;
 	/*
 	 * We write to quota files deep within filesystem code.  We don't want
 	 * the VFS to reenter filesystem code when it tries to allocate a
@@ -1401,11 +1402,11 @@ static int vfs_quota_on_file(struct file *f, int type, int format_id)
 	mapping_set_gfp_mask(inode->i_mapping,
 		mapping_gfp_mask(inode->i_mapping) & ~__GFP_FS);
 
+	down_write(&dqopt->dqptr_sem);
 	for (cnt = 0; cnt < MAXQUOTAS; cnt++) {
 		to_drop[cnt] = inode->i_dquot[cnt];
 		inode->i_dquot[cnt] = NODQUOT;
 	}
-	inode->i_flags &= ~S_QUOTA;
 	up_write(&dqopt->dqptr_sem);
 	/* We must put dquots outside of dqptr_sem because we may need to
 	 * start transaction for dquot_release() */
@@ -1431,11 +1432,20 @@ static int vfs_quota_on_file(struct file *f, int type, int format_id)
 	return 0;
 
 out_file_init:
-	inode->i_flags = oldflags;
 	dqopt->files[type] = NULL;
 out_lock:
-	up_write(&dqopt->dqptr_sem);
 	up(&dqopt->dqonoff_sem);
+	if (oldflags != -1) {
+		down(&inode->i_sem);
+		down_write(&dqopt->dqptr_sem);
+		/* Reset the NOATIME flag back. I know it could change in the
+		 * mean time but playing with NOATIME flags on a quota file is
+		 * never a good idea */
+		inode->i_flags &= ~(S_NOATIME | S_NOQUOTA);
+		inode->i_flags |= oldflags;
+		up_write(&dqopt->dqptr_sem);
+		up(&inode->i_sem);
+	}
 out_fmt:
 	put_quota_format(fmt);
 
diff --git a/fs/eventpoll.c b/fs/eventpoll.c
index bc30a3cdd..c81ddcd31 100644
--- a/fs/eventpoll.c
+++ b/fs/eventpoll.c
@@ -29,6 +29,7 @@
 #include <linux/spinlock.h>
 #include <linux/syscalls.h>
 #include <linux/rwsem.h>
+#include <linux/rbtree.h>
 #include <linux/wait.h>
 #include <linux/eventpoll.h>
 #include <linux/mount.h>
@@ -100,22 +101,6 @@
 /* Maximum number of poll wake up nests we are allowing */
 #define EP_MAX_POLLWAKE_NESTS 4
 
-/* Maximum size of the hash in bits ( 2^N ) */
-#define EP_MAX_HASH_BITS 17
-
-/* Minimum size of the hash in bits ( 2^N ) */
-#define EP_MIN_HASH_BITS 9
-
-/* Number of hash entries ( "struct list_head" ) inside a page */
-#define EP_HENTRY_X_PAGE (PAGE_SIZE / sizeof(struct list_head))
-
-/* Maximum size of the hash in pages */
-#define EP_MAX_HPAGES ((1 << EP_MAX_HASH_BITS) / EP_HENTRY_X_PAGE + 1)
-
-/* Number of pages allocated for an "hbits" sized hash table */
-#define EP_HASH_PAGES(hbits) ((int) ((1 << (hbits)) / EP_HENTRY_X_PAGE + \
-				     ((1 << (hbits)) % EP_HENTRY_X_PAGE ? 1: 0)))
-
 /* Macro to allocate a "struct epitem" from the slab cache */
 #define EPI_MEM_ALLOC()	(struct epitem *) kmem_cache_alloc(epi_cache, SLAB_KERNEL)
 
@@ -131,6 +116,22 @@
 /* Fast test to see if the file is an evenpoll file */
 #define IS_FILE_EPOLL(f) ((f)->f_op == &eventpoll_fops)
 
+/* Setup the structure that is used as key for the rb-tree */
+#define EP_SET_FFD(p, f, d) do { (p)->file = (f); (p)->fd = (d); } while (0)
+
+/* Compare rb-tree keys */
+#define EP_CMP_FFD(p1, p2) ((p1)->file > (p2)->file ? +1: \
+			    ((p1)->file < (p2)->file ? -1: (p1)->fd - (p2)->fd))
+
+/* Special initialization for the rb-tree node to detect linkage */
+#define EP_RB_INITNODE(n) (n)->rb_parent = (n)
+
+/* Removes a node from the rb-tree and marks it for a fast is-linked check */
+#define EP_RB_ERASE(n, r) do { rb_erase(n, r); (n)->rb_parent = (n); } while (0)
+
+/* Fast check to verify that the item is linked to the main rb-tree */
+#define EP_RB_LINKED(n) ((n)->rb_parent != (n))
+
 /*
  * Remove the item from the list and perform its initialization.
  * This is useful for us because we can test if the item is linked
@@ -147,6 +148,12 @@
 /* Get the "struct epitem" from an epoll queue wrapper */
 #define EP_ITEM_FROM_EPQUEUE(p) (container_of(p, struct ep_pqueue, pt)->epi)
 
+
+struct epoll_filefd {
+	struct file *file;
+	int fd;
+};
+
 /*
  * Node that is linked into the "wake_task_list" member of the "struct poll_safewake".
  * It is used to keep track on all tasks that are currently inside the wake_up() code
@@ -195,11 +202,8 @@ struct eventpoll {
 	/* List of ready file descriptors */
 	struct list_head rdllist;
 
-	/* Size of the hash */
-	unsigned int hashbits;
-
-	/* Pages for the "struct epitem" hash */
-	char *hpages[EP_MAX_HPAGES];
+	/* RB-Tree root used to store monitored fd structs */
+	struct rb_root rbr;
 };
 
 /* Wait structure used by the poll hooks */
@@ -225,14 +229,14 @@ struct eppoll_entry {
  * have an entry of this type linked to the hash.
  */
 struct epitem {
-	/* List header used to link this structure to the eventpoll hash */
-	struct list_head llink;
+	/* RB-Tree node used to link this structure to the eventpoll rb-tree */
+	struct rb_node rbn;
 
 	/* List header used to link this structure to the eventpoll ready list */
 	struct list_head rdllink;
 
-	/* The file descriptor this item refers to */
-	int fd;
+	/* The file descriptor information this item refers to */
+	struct epoll_filefd ffd;
 
 	/* Number of active wait queue attached to poll operations */
 	int nwait;
@@ -243,9 +247,6 @@ struct epitem {
 	/* The "container" of this item */
 	struct eventpoll *ep;
 
-	/* The file this item refers to */
-	struct file *file;
-
 	/* The structure that describe the interested events and the source fd */
 	struct epoll_event event;
 
@@ -278,22 +279,15 @@ struct ep_pqueue {
 
 static void ep_poll_safewake_init(struct poll_safewake *psw);
 static void ep_poll_safewake(struct poll_safewake *psw, wait_queue_head_t *wq);
-static unsigned int ep_get_hash_bits(unsigned int hintsize);
 static int ep_getfd(int *efd, struct inode **einode, struct file **efile);
-static int ep_alloc_pages(char **pages, int numpages);
-static int ep_free_pages(char **pages, int numpages);
-static int ep_file_init(struct file *file, unsigned int hashbits);
-static unsigned int ep_hash_index(struct eventpoll *ep, struct file *file,
-				  int fd);
-static struct list_head *ep_hash_entry(struct eventpoll *ep,
-				       unsigned int index);
-static int ep_init(struct eventpoll *ep, unsigned int hashbits);
+static int ep_file_init(struct file *file);
 static void ep_free(struct eventpoll *ep);
 static struct epitem *ep_find(struct eventpoll *ep, struct file *file, int fd);
 static void ep_use_epitem(struct epitem *epi);
 static void ep_release_epitem(struct epitem *epi);
 static void ep_ptable_queue_proc(struct file *file, wait_queue_head_t *whead,
 				 poll_table *pt);
+static void ep_rbtree_insert(struct eventpoll *ep, struct epitem *epi);
 static int ep_insert(struct eventpoll *ep, struct epoll_event *event,
 		     struct file *tfile, int fd);
 static int ep_modify(struct eventpoll *ep, struct epitem *epi,
@@ -424,19 +418,6 @@ static void ep_poll_safewake(struct poll_safewake *psw, wait_queue_head_t *wq)
 }
 
 
-/*
- * Calculate the size of the hash in bits. The returned size will be
- * bounded between EP_MIN_HASH_BITS and EP_MAX_HASH_BITS.
- */
-static unsigned int ep_get_hash_bits(unsigned int hintsize)
-{
-	unsigned int i, val;
-
-	for (i = 0, val = 1; val < hintsize && i < EP_MAX_HASH_BITS; i++, val <<= 1);
-	return i <  EP_MIN_HASH_BITS ?	EP_MIN_HASH_BITS: i;
-}
-
-
 /* Used to initialize the epoll bits inside the "struct file" */
 void eventpoll_init_file(struct file *file)
 {
@@ -492,7 +473,6 @@ void eventpoll_release_file(struct file *file)
 asmlinkage long sys_epoll_create(int size)
 {
 	int error, fd;
-	unsigned int hashbits;
 	struct inode *inode;
 	struct file *file;
 
@@ -504,9 +484,6 @@ asmlinkage long sys_epoll_create(int size)
 	if (size <= 0)
 		goto eexit_1;
 
-	/* Correctly size the hash */
-	hashbits = ep_get_hash_bits((unsigned int) size);
-
 	/*
 	 * Creates all the items needed to setup an eventpoll file. That is,
 	 * a file structure, and inode and a free file descriptor.
@@ -516,7 +493,7 @@ asmlinkage long sys_epoll_create(int size)
 		goto eexit_1;
 
 	/* Setup the file internal data structure ( "struct eventpoll" ) */
-	error = ep_file_init(file, hashbits);
+	error = ep_file_init(file);
 	if (error)
 		goto eexit_2;
 
@@ -739,7 +716,7 @@ static int ep_getfd(int *efd, struct inode **einode, struct file **efile)
 	dentry->d_op = &eventpollfs_dentry_operations;
 	d_add(dentry, inode);
 	file->f_vfsmnt = mntget(eventpoll_mnt);
-	file->f_dentry = dget(dentry);
+	file->f_dentry = dentry;
 	file->f_mapping = inode->i_mapping;
 
 	file->f_pos = 0;
@@ -768,114 +745,32 @@ eexit_1:
 }
 
 
-static int ep_alloc_pages(char **pages, int numpages)
+static int ep_file_init(struct file *file)
 {
-	int i;
-
-	for (i = 0; i < numpages; i++) {
-		pages[i] = (char *) __get_free_pages(GFP_KERNEL, 0);
-		if (!pages[i]) {
-			for (--i; i >= 0; i--) {
-				ClearPageReserved(virt_to_page(pages[i]));
-				free_pages((unsigned long) pages[i], 0);
-			}
-			return -ENOMEM;
-		}
-		SetPageReserved(virt_to_page(pages[i]));
-	}
-	return 0;
-}
-
-
-static int ep_free_pages(char **pages, int numpages)
-{
-	int i;
-
-	for (i = 0; i < numpages; i++) {
-		ClearPageReserved(virt_to_page(pages[i]));
-		free_pages((unsigned long) pages[i], 0);
-	}
-	return 0;
-}
-
-
-static int ep_file_init(struct file *file, unsigned int hashbits)
-{
-	int error;
 	struct eventpoll *ep;
 
 	if (!(ep = kmalloc(sizeof(struct eventpoll), GFP_KERNEL)))
 		return -ENOMEM;
 
 	memset(ep, 0, sizeof(*ep));
-
-	error = ep_init(ep, hashbits);
-	if (error) {
-		kfree(ep);
-		return error;
-	}
-
-	file->private_data = ep;
-
-	DNPRINTK(3, (KERN_INFO "[%p] eventpoll: ep_file_init() ep=%p\n",
-		     current, ep));
-	return 0;
-}
-
-
-/*
- * Calculate the index of the hash relative to "file".
- */
-static unsigned int ep_hash_index(struct eventpoll *ep, struct file *file, int fd)
-{
-	unsigned long ptr = (unsigned long) file ^ (fd << ep->hashbits);
-
-	return (unsigned int) hash_ptr((void *) ptr, ep->hashbits);
-}
-
-
-/*
- * Returns the hash entry ( struct list_head * ) of the passed index.
- */
-static struct list_head *ep_hash_entry(struct eventpoll *ep, unsigned int index)
-{
-
-	return (struct list_head *) (ep->hpages[index / EP_HENTRY_X_PAGE] +
-				     (index % EP_HENTRY_X_PAGE) * sizeof(struct list_head));
-}
-
-
-static int ep_init(struct eventpoll *ep, unsigned int hashbits)
-{
-	int error;
-	unsigned int i, hsize;
-
 	rwlock_init(&ep->lock);
 	init_rwsem(&ep->sem);
 	init_waitqueue_head(&ep->wq);
 	init_waitqueue_head(&ep->poll_wait);
 	INIT_LIST_HEAD(&ep->rdllist);
+	ep->rbr = RB_ROOT;
 
-	/* Hash allocation and setup */
-	ep->hashbits = hashbits;
-	error = ep_alloc_pages(ep->hpages, EP_HASH_PAGES(ep->hashbits));
-	if (error)
-		goto eexit_1;
-
-	/* Initialize hash buckets */
-	for (i = 0, hsize = 1 << hashbits; i < hsize; i++)
-		INIT_LIST_HEAD(ep_hash_entry(ep, i));
+	file->private_data = ep;
 
+	DNPRINTK(3, (KERN_INFO "[%p] eventpoll: ep_file_init() ep=%p\n",
+		     current, ep));
 	return 0;
-eexit_1:
-	return error;
 }
 
 
 static void ep_free(struct eventpoll *ep)
 {
-	unsigned int i, hsize;
-	struct list_head *lsthead, *lnk;
+	struct rb_node *rbp;
 	struct epitem *epi;
 
 	/* We need to release all tasks waiting for these file */
@@ -893,16 +788,12 @@ static void ep_free(struct eventpoll *ep)
 	down(&epsem);
 
 	/*
-	 * Walks through the whole hash by unregistering poll callbacks.
+	 * Walks through the whole tree by unregistering poll callbacks.
 	 */
-	for (i = 0, hsize = 1 << ep->hashbits; i < hsize; i++) {
-		lsthead = ep_hash_entry(ep, i);
+	for (rbp = rb_first(&ep->rbr); rbp; rbp = rb_next(rbp)) {
+		epi = rb_entry(rbp, struct epitem, rbn);
 
-		list_for_each(lnk, lsthead) {
-			epi = list_entry(lnk, struct epitem, llink);
-
-			ep_unregister_pollwait(ep, epi);
-		}
+		ep_unregister_pollwait(ep, epi);
 	}
 
 	/*
@@ -911,20 +802,12 @@ static void ep_free(struct eventpoll *ep)
 	 * write-holding "sem" we can be sure that no file cleanup code will hit
 	 * us during this operation. So we can avoid the lock on "ep->lock".
 	 */
-	for (i = 0, hsize = 1 << ep->hashbits; i < hsize; i++) {
-		lsthead = ep_hash_entry(ep, i);
-
-		while (!list_empty(lsthead)) {
-			epi = list_entry(lsthead->next, struct epitem, llink);
-
-			ep_remove(ep, epi);
-		}
+	while ((rbp = rb_first(&ep->rbr)) != 0) {
+		epi = rb_entry(rbp, struct epitem, rbn);
+		ep_remove(ep, epi);
 	}
 
 	up(&epsem);
-
-	/* Free hash pages */
-	ep_free_pages(ep->hpages, EP_HASH_PAGES(ep->hashbits));
 }
 
 
@@ -935,29 +818,33 @@ static void ep_free(struct eventpoll *ep)
  */
 static struct epitem *ep_find(struct eventpoll *ep, struct file *file, int fd)
 {
+	int kcmp;
 	unsigned long flags;
-	struct list_head *lsthead, *lnk;
-	struct epitem *epi = NULL;
+	struct rb_node *rbp;
+	struct epitem *epi, *epir = NULL;
+	struct epoll_filefd ffd;
 
+	EP_SET_FFD(&ffd, file, fd);
 	read_lock_irqsave(&ep->lock, flags);
-
-	lsthead = ep_hash_entry(ep, ep_hash_index(ep, file, fd));
-	list_for_each(lnk, lsthead) {
-		epi = list_entry(lnk, struct epitem, llink);
-
-		if (epi->file == file && epi->fd == fd) {
+	for (rbp = ep->rbr.rb_node; rbp; ) {
+		epi = rb_entry(rbp, struct epitem, rbn);
+		kcmp = EP_CMP_FFD(&ffd, &epi->ffd);
+		if (kcmp > 0)
+			rbp = rbp->rb_right;
+		else if (kcmp < 0)
+			rbp = rbp->rb_left;
+		else {
 			ep_use_epitem(epi);
+			epir = epi;
 			break;
 		}
-		epi = NULL;
 	}
-
 	read_unlock_irqrestore(&ep->lock, flags);
 
 	DNPRINTK(3, (KERN_INFO "[%p] eventpoll: ep_find(%p) -> %p\n",
-		     current, file, epi));
+		     current, file, epir));
 
-	return epi;
+	return epir;
 }
 
 
@@ -1009,6 +896,26 @@ static void ep_ptable_queue_proc(struct file *file, wait_queue_head_t *whead,
 }
 
 
+static void ep_rbtree_insert(struct eventpoll *ep, struct epitem *epi)
+{
+	int kcmp;
+	struct rb_node **p = &ep->rbr.rb_node, *parent = NULL;
+	struct epitem *epic;
+
+	while (*p) {
+		parent = *p;
+		epic = rb_entry(parent, struct epitem, rbn);
+		kcmp = EP_CMP_FFD(&epi->ffd, &epic->ffd);
+		if (kcmp > 0)
+			p = &parent->rb_right;
+		else
+			p = &parent->rb_left;
+	}
+	rb_link_node(&epi->rbn, parent, p);
+	rb_insert_color(&epi->rbn, &ep->rbr);
+}
+
+
 static int ep_insert(struct eventpoll *ep, struct epoll_event *event,
 		     struct file *tfile, int fd)
 {
@@ -1022,14 +929,13 @@ static int ep_insert(struct eventpoll *ep, struct epoll_event *event,
 		goto eexit_1;
 
 	/* Item initialization follow here ... */
-	INIT_LIST_HEAD(&epi->llink);
+	EP_RB_INITNODE(&epi->rbn);
 	INIT_LIST_HEAD(&epi->rdllink);
 	INIT_LIST_HEAD(&epi->fllink);
 	INIT_LIST_HEAD(&epi->txlink);
 	INIT_LIST_HEAD(&epi->pwqlist);
 	epi->ep = ep;
-	epi->file = tfile;
-	epi->fd = fd;
+	EP_SET_FFD(&epi->ffd, tfile, fd);
 	epi->event = *event;
 	atomic_set(&epi->usecnt, 1);
 	epi->nwait = 0;
@@ -1061,8 +967,8 @@ static int ep_insert(struct eventpoll *ep, struct epoll_event *event,
 	/* We have to drop the new item inside our item list to keep track of it */
 	write_lock_irqsave(&ep->lock, flags);
 
-	/* Add the current item to the hash table */
-	list_add(&epi->llink, ep_hash_entry(ep, ep_hash_index(ep, tfile, fd)));
+	/* Add the current item to the rb-tree */
+	ep_rbtree_insert(ep, epi);
 
 	/* If the file is already "ready" we drop it inside the ready list */
 	if ((revents & event->events) && !EP_IS_LINKED(&epi->rdllink)) {
@@ -1126,7 +1032,7 @@ static int ep_modify(struct eventpoll *ep, struct epitem *epi, struct epoll_even
 	 * Get current event bits. We can safely use the file* here because
 	 * its usage count has been increased by the caller of this function.
 	 */
-	revents = epi->file->f_op->poll(epi->file, NULL);
+	revents = epi->ffd.file->f_op->poll(epi->ffd.file, NULL);
 
 	write_lock_irqsave(&ep->lock, flags);
 
@@ -1137,7 +1043,7 @@ static int ep_modify(struct eventpoll *ep, struct epitem *epi, struct epoll_even
 	 * If the item is not linked to the hash it means that it's on its
 	 * way toward the removal. Do nothing in this case.
 	 */
-	if (EP_IS_LINKED(&epi->llink)) {
+	if (EP_RB_LINKED(&epi->rbn)) {
 		/*
 		 * If the item is "hot" and it is not registered inside the ready
 		 * list, push it inside. If the item is not "hot" and it is currently
@@ -1205,7 +1111,7 @@ static int ep_unlink(struct eventpoll *ep, struct epitem *epi)
 	 * The check protect us from doing a double unlink ( crash ).
 	 */
 	error = -ENOENT;
-	if (!EP_IS_LINKED(&epi->llink))
+	if (!EP_RB_LINKED(&epi->rbn))
 		goto eexit_1;
 
 	/*
@@ -1216,11 +1122,11 @@ static int ep_unlink(struct eventpoll *ep, struct epitem *epi)
 	epi->event.events = 0;
 
 	/*
-	 * At this point is safe to do the job, unlink the item from our list.
+	 * At this point is safe to do the job, unlink the item from our rb-tree.
 	 * This operation togheter with the above check closes the door to
 	 * double unlinks.
 	 */
-	EP_LIST_DEL(&epi->llink);
+	EP_RB_ERASE(&epi->rbn, &ep->rbr);
 
 	/*
 	 * If the item we are going to remove is inside the ready file descriptors
@@ -1247,7 +1153,7 @@ static int ep_remove(struct eventpoll *ep, struct epitem *epi)
 {
 	int error;
 	unsigned long flags;
-	struct file *file = epi->file;
+	struct file *file = epi->ffd.file;
 
 	/*
 	 * Removes poll wait queue hooks. We _have_ to do this without holding
@@ -1446,7 +1352,7 @@ static int ep_send_events(struct eventpoll *ep, struct list_head *txlist,
 		 * because we are holding the "sem" in read and this will
 		 * guarantee that both the file and the item will not vanish.
 		 */
-		revents = epi->file->f_op->poll(epi->file, NULL);
+		revents = epi->ffd.file->f_op->poll(epi->ffd.file, NULL);
 
 		/*
 		 * Set the return event set for the current file descriptor.
@@ -1497,7 +1403,7 @@ static void ep_reinject_items(struct eventpoll *ep, struct list_head *txlist)
 		 * item is set to have an Edge Triggered behaviour, we don't have
 		 * to push it back either.
 		 */
-		if (EP_IS_LINKED(&epi->llink) && !(epi->event.events & EPOLLET) &&
+		if (EP_RB_LINKED(&epi->rbn) && !(epi->event.events & EPOLLET) &&
 		    (epi->revents & epi->event.events) && !EP_IS_LINKED(&epi->rdllink)) {
 			list_add_tail(&epi->rdllink, &ep->rdllist);
 			ricnt++;
diff --git a/fs/exec.c b/fs/exec.c
index d84bd1610..284207a1f 100644
--- a/fs/exec.c
+++ b/fs/exec.c
@@ -46,9 +46,9 @@
 #include <linux/security.h>
 #include <linux/syscalls.h>
 #include <linux/rmap.h>
+#include <linux/vs_memory.h>
 
 #include <asm/uaccess.h>
-#include <asm/pgalloc.h>
 #include <asm/mmu_context.h>
 
 #ifdef CONFIG_KMOD
@@ -433,6 +433,7 @@ int setup_arg_pages(struct linux_binprm *bprm, int executable_stack)
 			mpnt->vm_flags = VM_STACK_FLAGS & ~VM_EXEC;
 		else
 			mpnt->vm_flags = VM_STACK_FLAGS;
+		mpnt->vm_flags |= mm->def_flags;
 		mpnt->vm_page_prot = protection_map[mpnt->vm_flags & 0x7];
 		insert_vm_struct(mm, mpnt);
 		// mm->total_vm = (mpnt->vm_end - mpnt->vm_start) >> PAGE_SHIFT;
@@ -843,7 +844,8 @@ int flush_old_exec(struct linux_binprm * bprm)
 	flush_thread();
 
 	if (bprm->e_uid != current->euid || bprm->e_gid != current->egid || 
-	    permission(bprm->file->f_dentry->d_inode,MAY_READ, NULL))
+	    permission(bprm->file->f_dentry->d_inode,MAY_READ, NULL) ||
+	    (bprm->interp_flags & BINPRM_FLAGS_ENFORCE_NONDUMP))
 		current->mm->dumpable = 0;
 
 	/* An exec changes our domain. We are no longer part of the thread
@@ -890,8 +892,10 @@ int prepare_binprm(struct linux_binprm *bprm)
 
 	if(!(bprm->file->f_vfsmnt->mnt_flags & MNT_NOSUID)) {
 		/* Set-uid? */
-		if (mode & S_ISUID)
+		if (mode & S_ISUID) {
+			current->personality &= ~PER_CLEAR_ON_SETID;
 			bprm->e_uid = inode->i_uid;
+		}
 
 		/* Set-gid? */
 		/*
@@ -899,8 +903,10 @@ int prepare_binprm(struct linux_binprm *bprm)
 		 * is a candidate for mandatory locking, not a setgid
 		 * executable.
 		 */
-		if ((mode & (S_ISGID | S_IXGRP)) == (S_ISGID | S_IXGRP))
+		if ((mode & (S_ISGID | S_IXGRP)) == (S_ISGID | S_IXGRP)) {
+			current->personality &= ~PER_CLEAR_ON_SETID;
 			bprm->e_gid = inode->i_gid;
+		}
 	}
 
 	/* fill in binprm security blob */
@@ -1092,6 +1098,8 @@ int do_execve(char * filename,
 	bprm.file = file;
 	bprm.filename = filename;
 	bprm.interp = filename;
+	bprm.interp_flags = 0;
+	bprm.interp_data = 0;
 	bprm.sh_bang = 0;
 	bprm.loader = 0;
 	bprm.exec = 0;
diff --git a/fs/ext2/acl.c b/fs/ext2/acl.c
index 091a3175d..89d1df914 100644
--- a/fs/ext2/acl.c
+++ b/fs/ext2/acl.c
@@ -161,7 +161,7 @@ ext2_get_acl(struct inode *inode, int type)
 	int retval;
 
 	if (!test_opt(inode->i_sb, POSIX_ACL))
-		return 0;
+		return NULL;
 
 	switch(type) {
 		case ACL_TYPE_ACCESS:
diff --git a/fs/ext2/dir.c b/fs/ext2/dir.c
index 4f24afb64..6af27658b 100644
--- a/fs/ext2/dir.c
+++ b/fs/ext2/dir.c
@@ -257,10 +257,10 @@ ext2_readdir (struct file * filp, void * dirent, filldir_t filldir)
 	unsigned chunk_mask = ~(ext2_chunk_size(inode)-1);
 	unsigned char *types = NULL;
 	int need_revalidate = (filp->f_version != inode->i_version);
-	int ret = 0;
+	int ret;
 
 	if (pos > inode->i_size - EXT2_DIR_REC_LEN(1))
-		goto done;
+		goto success;
 
 	if (EXT2_HAS_INCOMPAT_FEATURE(sb, EXT2_FEATURE_INCOMPAT_FILETYPE))
 		types = ext2_filetype_table;
@@ -300,17 +300,19 @@ ext2_readdir (struct file * filp, void * dirent, filldir_t filldir)
 						le32_to_cpu(de->inode), d_type);
 				if (over) {
 					ext2_put_page(page);
-					goto done;
+					goto success;
 				}
 			}
 		}
 		ext2_put_page(page);
 	}
 
+success:
+	ret = 0;
 done:
 	filp->f_pos = (n << PAGE_CACHE_SHIFT) | offset;
 	filp->f_version = inode->i_version;
-	return 0;
+	return ret;
 }
 
 /*
diff --git a/fs/ext2/ialloc.c b/fs/ext2/ialloc.c
index 299ea3f92..1b1dce48f 100644
--- a/fs/ext2/ialloc.c
+++ b/fs/ext2/ialloc.c
@@ -469,6 +469,11 @@ struct inode *ext2_new_inode(struct inode *dir, int mode)
 	if (!inode)
 		return ERR_PTR(-ENOMEM);
 
+        if (sb->s_flags & MS_TAGXID)
+		inode->i_xid = current->xid;
+	else
+		inode->i_xid = 0;
+
 	if (DLIMIT_ALLOC_INODE(sb, inode->i_xid)) {
 		err = -ENOSPC;
 		goto fail_dlim;
diff --git a/fs/ext2/inode.c b/fs/ext2/inode.c
index 3a6b0883d..1ef02bccb 100644
--- a/fs/ext2/inode.c
+++ b/fs/ext2/inode.c
@@ -136,7 +136,7 @@ static int ext2_alloc_block (struct inode * inode, unsigned long goal, int *err)
 				 &ei->i_prealloc_count,
 				 &ei->i_prealloc_block, err);
 		else
-			result = ext2_new_block (inode, goal, 0, 0, err);
+			result = ext2_new_block(inode, goal, NULL, NULL, err);
 	}
 #else
 	result = ext2_new_block (inode, goal, 0, 0, err);
@@ -1071,10 +1071,10 @@ void ext2_read_inode (struct inode * inode)
 		uid |= le16_to_cpu(raw_inode->i_uid_high) << 16;
 		gid |= le16_to_cpu(raw_inode->i_gid_high) << 16;
 	}
-	inode->i_uid = INOXID_UID(uid, gid);
-	inode->i_gid = INOXID_GID(uid, gid);
-	if (inode->i_sb->s_flags & MS_TAGXID)
-		inode->i_xid = INOXID_XID(uid, gid, le16_to_cpu(raw_inode->i_raw_xid));
+	inode->i_uid = INOXID_UID(XID_TAG(inode), uid, gid);
+	inode->i_gid = INOXID_GID(XID_TAG(inode), uid, gid);
+	inode->i_xid = INOXID_XID(XID_TAG(inode), uid, gid,
+		le16_to_cpu(raw_inode->i_raw_xid));
 
 	inode->i_nlink = le16_to_cpu(raw_inode->i_links_count);
 	inode->i_size = le32_to_cpu(raw_inode->i_size);
@@ -1168,8 +1168,8 @@ static int ext2_update_inode(struct inode * inode, int do_sync)
 	struct ext2_inode_info *ei = EXT2_I(inode);
 	struct super_block *sb = inode->i_sb;
 	ino_t ino = inode->i_ino;
-	uid_t uid = XIDINO_UID(inode->i_uid, inode->i_xid);
-	gid_t gid = XIDINO_GID(inode->i_gid, inode->i_xid);
+	uid_t uid = XIDINO_UID(XID_TAG(inode), inode->i_uid, inode->i_xid);
+	gid_t gid = XIDINO_GID(XID_TAG(inode), inode->i_gid, inode->i_xid);
 	struct buffer_head * bh;
 	struct ext2_inode * raw_inode = ext2_get_inode(sb, ino, &bh);
 	int n;
@@ -1323,8 +1323,8 @@ int ext2_setattr(struct dentry *dentry, struct iattr *iattr)
 	if (iattr->ia_valid & ATTR_ATTR_FLAG)
 		ext2_setattr_flags(inode, iattr->ia_attr_flags);
 
-	inode_setattr(inode, iattr);
-	if (iattr->ia_valid & ATTR_MODE)
+	error = inode_setattr(inode, iattr);
+	if (!error && (iattr->ia_valid & ATTR_MODE))
 		error = ext2_acl_chmod(inode);
 	return error;
 }
diff --git a/fs/ext2/symlink.c b/fs/ext2/symlink.c
index b282670a5..4680ea7ec 100644
--- a/fs/ext2/symlink.c
+++ b/fs/ext2/symlink.c
@@ -19,23 +19,19 @@
 
 #include "ext2.h"
 #include "xattr.h"
-
-static int
-ext2_readlink(struct dentry *dentry, char __user *buffer, int buflen)
-{
-	struct ext2_inode_info *ei = EXT2_I(dentry->d_inode);
-	return vfs_readlink(dentry, buffer, buflen, (char *)ei->i_data);
-}
+#include <linux/namei.h>
 
 static int ext2_follow_link(struct dentry *dentry, struct nameidata *nd)
 {
 	struct ext2_inode_info *ei = EXT2_I(dentry->d_inode);
-	return vfs_follow_link(nd, (char *)ei->i_data);
+	nd_set_link(nd, (char *)ei->i_data);
+	return 0;
 }
 
 struct inode_operations ext2_symlink_inode_operations = {
-	.readlink	= page_readlink,
-	.follow_link	= page_follow_link,
+	.readlink	= generic_readlink,
+	.follow_link	= page_follow_link_light,
+	.put_link	= page_put_link,
 	.setxattr	= ext2_setxattr,
 	.getxattr	= ext2_getxattr,
 	.listxattr	= ext2_listxattr,
@@ -43,7 +39,7 @@ struct inode_operations ext2_symlink_inode_operations = {
 };
  
 struct inode_operations ext2_fast_symlink_inode_operations = {
-	.readlink	= ext2_readlink,
+	.readlink	= generic_readlink,
 	.follow_link	= ext2_follow_link,
 	.setxattr	= ext2_setxattr,
 	.getxattr	= ext2_getxattr,
diff --git a/fs/ext2/xattr.c b/fs/ext2/xattr.c
index 5543e6c65..ab8308a6d 100644
--- a/fs/ext2/xattr.c
+++ b/fs/ext2/xattr.c
@@ -777,7 +777,8 @@ ext2_xattr_set2(struct inode *inode, struct buffer_head *old_bh,
 						           s_first_data_block) +
 				   EXT2_I(inode)->i_block_group *
 				   EXT2_BLOCKS_PER_GROUP(sb);
-			int block = ext2_new_block(inode, goal, 0, 0, &error);
+			int block = ext2_new_block(inode, goal,
+						   NULL, NULL, &error);
 			if (error)
 				goto cleanup;
 			ea_idebug(inode, "creating block %d", block);
diff --git a/fs/ext3/acl.c b/fs/ext3/acl.c
index 7fd70c88e..a3cf77de0 100644
--- a/fs/ext3/acl.c
+++ b/fs/ext3/acl.c
@@ -164,7 +164,7 @@ ext3_get_acl(struct inode *inode, int type)
 	int retval;
 
 	if (!test_opt(inode->i_sb, POSIX_ACL))
-		return 0;
+		return NULL;
 
 	switch(type) {
 		case ACL_TYPE_ACCESS:
@@ -428,7 +428,9 @@ ext3_acl_chmod(struct inode *inode)
 	error = posix_acl_chmod_masq(clone, inode->i_mode);
 	if (!error) {
 		handle_t *handle;
+		int retries = 0;
 
+	retry:
 		handle = ext3_journal_start(inode, EXT3_DATA_TRANS_BLOCKS);
 		if (IS_ERR(handle)) {
 			error = PTR_ERR(handle);
@@ -437,6 +439,9 @@ ext3_acl_chmod(struct inode *inode)
 		}
 		error = ext3_set_acl(handle, inode, ACL_TYPE_ACCESS, clone);
 		ext3_journal_stop(handle);
+		if (error == -ENOSPC &&
+		    ext3_should_retry_alloc(inode->i_sb, &retries))
+			goto retry;
 	}
 out:
 	posix_acl_release(clone);
@@ -516,7 +521,7 @@ ext3_xattr_set_acl(struct inode *inode, int type, const void *value,
 {
 	handle_t *handle;
 	struct posix_acl *acl;
-	int error;
+	int error, retries = 0;
 
 	if (!test_opt(inode->i_sb, POSIX_ACL))
 		return -EOPNOTSUPP;
@@ -535,11 +540,14 @@ ext3_xattr_set_acl(struct inode *inode, int type, const void *value,
 	} else
 		acl = NULL;
 
+retry:
 	handle = ext3_journal_start(inode, EXT3_DATA_TRANS_BLOCKS);
 	if (IS_ERR(handle))
 		return PTR_ERR(handle);
 	error = ext3_set_acl(handle, inode, type, acl);
 	ext3_journal_stop(handle);
+	if (error == -ENOSPC && ext3_should_retry_alloc(inode->i_sb, &retries))
+		goto retry;
 
 release_and_out:
 	posix_acl_release(acl);
diff --git a/fs/ext3/balloc.c b/fs/ext3/balloc.c
index bff5a0dda..3b3160d8e 100644
--- a/fs/ext3/balloc.c
+++ b/fs/ext3/balloc.c
@@ -19,6 +19,7 @@
 #include <linux/ext3_jbd.h>
 #include <linux/quotaops.h>
 #include <linux/buffer_head.h>
+#include <linux/vs_base.h>
 #include <linux/vs_dlimit.h>
 
 /*
@@ -468,6 +469,50 @@ fail:
 	return -1;
 }
 
+static int ext3_has_free_blocks(struct super_block *sb)
+{
+	struct ext3_sb_info *sbi = EXT3_SB(sb);
+	int free_blocks, root_blocks, cond;
+
+	free_blocks = percpu_counter_read_positive(&sbi->s_freeblocks_counter);
+	root_blocks = le32_to_cpu(sbi->s_es->s_r_blocks_count);
+
+	vxdprintk(VXD_CBIT(dlim, 3),
+		"ext3_has_free_blocks(%p): free=%u, root=%u",
+		sb, free_blocks, root_blocks);
+
+	DLIMIT_ADJUST_BLOCK(sb, vx_current_xid(), &free_blocks, &root_blocks);
+
+	cond = (free_blocks < root_blocks + 1 &&
+		!capable(CAP_SYS_RESOURCE) &&
+		sbi->s_resuid != current->fsuid &&
+		(sbi->s_resgid == 0 || !in_group_p (sbi->s_resgid)));
+
+	vxdprintk(VXD_CBIT(dlim, 3),
+		"ext3_has_free_blocks(%p): %u<%u+1, %c, %u!=%u r=%d",
+		sb, free_blocks, root_blocks,
+		!capable(CAP_SYS_RESOURCE)?'1':'0',
+		sbi->s_resuid, current->fsuid, cond?0:1);
+
+	return (cond ? 0 : 1);
+}
+
+/*
+ * ext3_should_retry_alloc() is called when ENOSPC is returned, and if
+ * it is profitable to retry the operation, this function will wait
+ * for the current or commiting transaction to complete, and then
+ * return TRUE.
+ */
+int ext3_should_retry_alloc(struct super_block *sb, int *retries)
+{
+	if (!ext3_has_free_blocks(sb) || (*retries)++ > 3)
+		return 0;
+
+	jbd_debug(1, "%s: retrying operation after ENOSPC\n", sb->s_id);
+
+	return journal_force_commit_nested(EXT3_SB(sb)->s_journal);
+}
+
 /*
  * ext3_new_block uses a goal block to assist allocation.  If the goal is
  * free, or there is a free block within 32 blocks of the goal, that block
@@ -488,7 +533,7 @@ ext3_new_block(handle_t *handle, struct inode *inode, unsigned long goal,
 	int target_block;			/* tmp */
 	int fatal = 0, err;
 	int performed_allocation = 0;
-	int free_blocks, root_blocks;
+	int free_blocks;
 	struct super_block *sb;
 	struct ext3_group_desc *gdp;
 	struct ext3_super_block *es;
@@ -517,14 +562,7 @@ ext3_new_block(handle_t *handle, struct inode *inode, unsigned long goal,
 	es = EXT3_SB(sb)->s_es;
 	ext3_debug("goal=%lu.\n", goal);
 
-	free_blocks = percpu_counter_read_positive(&sbi->s_freeblocks_counter);
-	root_blocks = le32_to_cpu(es->s_r_blocks_count);
-
-	DLIMIT_ADJUST_BLOCK(sb, vx_current_xid(), &free_blocks, &root_blocks);
-
-	if (free_blocks < root_blocks + 1 && !capable(CAP_SYS_RESOURCE) &&
-		sbi->s_resuid != current->fsuid &&
-		(sbi->s_resgid == 0 || !in_group_p (sbi->s_resgid))) {
+	if (!ext3_has_free_blocks(sb)) {
 		*errp = -ENOSPC;
 		goto out;
 	}
@@ -679,7 +717,8 @@ allocated:
 io_error:
 	*errp = -EIO;
 out:
-	DLIMIT_FREE_BLOCK(sb, inode->i_xid, 1);
+	if (!performed_allocation)
+		DLIMIT_FREE_BLOCK(sb, inode->i_xid, 1);
 out_dlimit:
 	if (fatal) {
 		*errp = fatal;
@@ -688,10 +727,8 @@ out_dlimit:
 	/*
 	 * Undo the block allocation
 	 */
-	if (!performed_allocation) {
-		DLIMIT_FREE_BLOCK(sb, inode->i_xid, 1);
+	if (!performed_allocation)
 		DQUOT_FREE_BLOCK(inode, 1);
-	}
 	brelse(bitmap_bh);
 	return 0;
 }
diff --git a/fs/ext3/dir.c b/fs/ext3/dir.c
index 76ad9815f..b2bb90817 100644
--- a/fs/ext3/dir.c
+++ b/fs/ext3/dir.c
@@ -129,7 +129,7 @@ static int ext3_readdir(struct file * filp,
 
 	while (!error && !stored && filp->f_pos < inode->i_size) {
 		blk = (filp->f_pos) >> EXT3_BLOCK_SIZE_BITS(sb);
-		bh = ext3_bread (0, inode, blk, 0, &err);
+		bh = ext3_bread(NULL, inode, blk, 0, &err);
 		if (!bh) {
 			ext3_error (sb, "ext3_readdir",
 				"directory #%lu contains a hole at offset %lu",
@@ -295,14 +295,14 @@ static void free_rb_tree_fname(struct rb_root *root)
 			kfree (old);
 		}
 		if (!parent)
-			root->rb_node = 0;
+			root->rb_node = NULL;
 		else if (parent->rb_left == n)
-			parent->rb_left = 0;
+			parent->rb_left = NULL;
 		else if (parent->rb_right == n)
-			parent->rb_right = 0;
+			parent->rb_right = NULL;
 		n = parent;
 	}
-	root->rb_node = 0;
+	root->rb_node = NULL;
 }
 
 
@@ -313,9 +313,9 @@ struct dir_private_info *create_dir_info(loff_t pos)
 	p = kmalloc(sizeof(struct dir_private_info), GFP_KERNEL);
 	if (!p)
 		return NULL;
-	p->root.rb_node = 0;
-	p->curr_node = 0;
-	p->extra_fname = 0;
+	p->root.rb_node = NULL;
+	p->curr_node = NULL;
+	p->extra_fname = NULL;
 	p->last_pos = 0;
 	p->curr_hash = pos2maj_hash(pos);
 	p->curr_minor_hash = pos2min_hash(pos);
@@ -447,8 +447,8 @@ static int ext3_dx_readdir(struct file * filp,
 	/* Some one has messed with f_pos; reset the world */
 	if (info->last_pos != filp->f_pos) {
 		free_rb_tree_fname(&info->root);
-		info->curr_node = 0;
-		info->extra_fname = 0;
+		info->curr_node = NULL;
+		info->extra_fname = NULL;
 		info->curr_hash = pos2maj_hash(filp->f_pos);
 		info->curr_minor_hash = pos2min_hash(filp->f_pos);
 	}
@@ -472,7 +472,7 @@ static int ext3_dx_readdir(struct file * filp,
 		 */
 		if ((!info->curr_node) ||
 		    (filp->f_version != inode->i_version)) {
-			info->curr_node = 0;
+			info->curr_node = NULL;
 			free_rb_tree_fname(&info->root);
 			filp->f_version = inode->i_version;
 			ret = ext3_htree_fill_tree(filp, info->curr_hash,
diff --git a/fs/ext3/ialloc.c b/fs/ext3/ialloc.c
index 0c21ea4c2..f30a4f41a 100644
--- a/fs/ext3/ialloc.c
+++ b/fs/ext3/ialloc.c
@@ -446,9 +446,15 @@ struct inode *ext3_new_inode(handle_t *handle, struct inode * dir, int mode)
 	inode = new_inode(sb);
 	if (!inode)
 		return ERR_PTR(-ENOMEM);
+
+	if (sb->s_flags & MS_TAGXID)
+		inode->i_xid = current->xid;
+	else
+		inode->i_xid = 0;
+
 	if (DLIMIT_ALLOC_INODE(sb, inode->i_xid)) {
 		err = -ENOSPC;
-		goto fail_dlim;
+		goto out;
 	}
 	ei = EXT3_I(inode);
 
@@ -626,7 +632,6 @@ got:
 	goto really_out;
 fail:
 	DLIMIT_FREE_INODE(sb, inode->i_xid);
-fail_dlim:
 	ext3_std_error(sb, err);
 out:
 	iput(inode);
diff --git a/fs/ext3/inode.c b/fs/ext3/inode.c
index ebfa3b05e..da40fc7c6 100644
--- a/fs/ext3/inode.c
+++ b/fs/ext3/inode.c
@@ -290,7 +290,7 @@ static int ext3_alloc_block (handle_t *handle,
 				 &ei->i_prealloc_count,
 				 &ei->i_prealloc_block, err);
 		else
-			result = ext3_new_block (inode, goal, 0, 0, err);
+			result = ext3_new_block(inode, goal, NULL, NULL, err);
 		/*
 		 * AKPM: this is somewhat sticky.  I'm not surprised it was
 		 * disabled in 2.2's ext3.  Need to integrate b_committed_data
@@ -299,7 +299,7 @@ static int ext3_alloc_block (handle_t *handle,
 		 */
 	}
 #else
-	result = ext3_new_block (handle, inode, goal, 0, 0, err);
+	result = ext3_new_block(handle, inode, goal, NULL, NULL, err);
 #endif
 	return result;
 }
@@ -862,7 +862,7 @@ changed:
 static int ext3_get_block(struct inode *inode, sector_t iblock,
 			struct buffer_head *bh_result, int create)
 {
-	handle_t *handle = 0;
+	handle_t *handle = NULL;
 	int ret;
 
 	if (create) {
@@ -884,26 +884,42 @@ ext3_direct_io_get_blocks(struct inode *inode, sector_t iblock,
 	handle_t *handle = journal_current_handle();
 	int ret = 0;
 
-	if (handle && handle->h_buffer_credits <= EXT3_RESERVE_TRANS_BLOCKS) {
+	if (!handle)
+		goto get_block;		/* A read */
+
+	if (handle->h_transaction->t_state == T_LOCKED) {
+		/*
+		 * Huge direct-io writes can hold off commits for long
+		 * periods of time.  Let this commit run.
+		 */
+		ext3_journal_stop(handle);
+		handle = ext3_journal_start(inode, DIO_CREDITS);
+		if (IS_ERR(handle))
+			ret = PTR_ERR(handle);
+		goto get_block;
+	}
+
+	if (handle->h_buffer_credits <= EXT3_RESERVE_TRANS_BLOCKS) {
 		/*
 		 * Getting low on buffer credits...
 		 */
-		if (!ext3_journal_extend(handle, DIO_CREDITS)) {
+		ret = ext3_journal_extend(handle, DIO_CREDITS);
+		if (ret > 0) {
 			/*
-			 * Couldn't extend the transaction.  Start a new one
+			 * Couldn't extend the transaction.  Start a new one.
 			 */
 			ret = ext3_journal_restart(handle, DIO_CREDITS);
 		}
 	}
+
+get_block:
 	if (ret == 0)
 		ret = ext3_get_block_handle(handle, inode, iblock,
 					bh_result, create, 0);
-	if (ret == 0)
-		bh_result->b_size = (1 << inode->i_blkbits);
+	bh_result->b_size = (1 << inode->i_blkbits);
 	return ret;
 }
 
-
 /*
  * `handle' can be NULL if create is zero
  */
@@ -1083,7 +1099,7 @@ static int ext3_prepare_write(struct file *file, struct page *page,
 	struct inode *inode = page->mapping->host;
 	int ret, needed_blocks = ext3_writepage_trans_blocks(inode);
 	handle_t *handle;
-	int tried_commit = 0;
+	int retries = 0;
 
 retry:
 	handle = ext3_journal_start(inode, needed_blocks);
@@ -1092,19 +1108,8 @@ retry:
 		goto out;
 	}
 	ret = block_prepare_write(page, from, to, ext3_get_block);
-	if (ret) {
-		if (ret != -ENOSPC || tried_commit)
-			goto prepare_write_failed;
-		/*
-		 * It could be that there _is_ free space, but it's all tied up
-		 * in uncommitted bitmaps.  So force a commit here, which makes
-		 * those blocks allocatable and try again.
-		 */
-		tried_commit = 1;
-		handle->h_sync = 1;
-		ext3_journal_stop(handle);
-		goto retry;
-	}
+	if (ret)
+		goto prepare_write_failed;
 
 	if (ext3_should_journal_data(inode)) {
 		ret = walk_page_buffers(handle, page_buffers(page),
@@ -1113,6 +1118,8 @@ retry:
 prepare_write_failed:
 	if (ret)
 		ext3_journal_stop(handle);
+	if (ret == -ENOSPC && ext3_should_retry_alloc(inode->i_sb, &retries))
+		goto retry;
 out:
 	return ret;
 }
@@ -2507,10 +2514,10 @@ void ext3_read_inode(struct inode * inode)
 		uid |= le16_to_cpu(raw_inode->i_uid_high) << 16;
 		gid |= le16_to_cpu(raw_inode->i_gid_high) << 16;
 	}
-	inode->i_uid = INOXID_UID(uid, gid);
-	inode->i_gid = INOXID_GID(uid, gid);
-	if (inode->i_sb->s_flags & MS_TAGXID)
-		inode->i_xid = INOXID_XID(uid, gid, le16_to_cpu(raw_inode->i_raw_xid));
+	inode->i_uid = INOXID_UID(XID_TAG(inode), uid, gid);
+	inode->i_gid = INOXID_GID(XID_TAG(inode), uid, gid);
+	inode->i_xid = INOXID_XID(XID_TAG(inode), uid, gid,
+		le16_to_cpu(raw_inode->i_raw_xid));
 
 	inode->i_nlink = le16_to_cpu(raw_inode->i_links_count);
 	inode->i_size = le32_to_cpu(raw_inode->i_size);
@@ -2619,8 +2626,8 @@ static int ext3_do_update_inode(handle_t *handle,
 	struct ext3_inode *raw_inode = ext3_raw_inode(iloc);
 	struct ext3_inode_info *ei = EXT3_I(inode);
 	struct buffer_head *bh = iloc->bh;
-	uid_t uid = XIDINO_UID(inode->i_uid, inode->i_xid);
-	gid_t gid = XIDINO_GID(inode->i_gid, inode->i_xid);
+	uid_t uid = XIDINO_UID(XID_TAG(inode), inode->i_uid, inode->i_xid);
+	gid_t gid = XIDINO_GID(XID_TAG(inode), inode->i_gid, inode->i_xid);
 	int err = 0, rc, block;
 
 	/* For fields not not tracking in the in-memory inode,
@@ -2865,7 +2872,9 @@ int ext3_setattr(struct dentry *dentry, struct iattr *attr)
 			inode->i_uid = attr->ia_uid;
 		if (attr->ia_valid & ATTR_GID)
 			inode->i_gid = attr->ia_gid;
-		if (attr->ia_valid & ATTR_XID)
+		if ((attr->ia_valid & ATTR_XID)
+			&& inode->i_sb
+			&& (inode->i_sb->s_flags & MS_TAGXID))
 			inode->i_xid = attr->ia_xid;
 		error = ext3_mark_inode_dirty(handle, inode);
 		ext3_journal_stop(handle);
diff --git a/fs/ext3/namei.c b/fs/ext3/namei.c
index d2ad34e13..36e5b4ec3 100644
--- a/fs/ext3/namei.c
+++ b/fs/ext3/namei.c
@@ -557,6 +557,8 @@ static int htree_dirblock_to_tree(struct file *dir_file,
 		    ((hinfo->hash == start_hash) &&
 		     (hinfo->minor_hash < start_minor_hash)))
 			continue;
+		if (de->inode == 0)
+			continue;
 		if ((err = ext3_htree_store_dirent(dir_file,
 				   hinfo->hash, hinfo->minor_hash, de)) != 0) {
 			brelse(bh);
@@ -602,7 +604,7 @@ int ext3_htree_fill_tree(struct file *dir_file, __u32 start_hash,
 	}
 	hinfo.hash = start_hash;
 	hinfo.minor_hash = 0;
-	frame = dx_probe(0, dir_file->f_dentry->d_inode, &hinfo, frames, &err);
+	frame = dx_probe(NULL, dir_file->f_dentry->d_inode, &hinfo, frames, &err);
 	if (!frame)
 		return err;
 
@@ -928,7 +930,7 @@ static struct buffer_head * ext3_dx_find_entry(struct dentry *dentry,
 	struct inode *dir = dentry->d_parent->d_inode;
 
 	sb = dir->i_sb;
-	if (!(frame = dx_probe (dentry, 0, &hinfo, frames, err)))
+	if (!(frame = dx_probe(dentry, NULL, &hinfo, frames, err)))
 		return NULL;
 	hash = hinfo.hash;
 	do {
@@ -954,7 +956,7 @@ static struct buffer_head * ext3_dx_find_entry(struct dentry *dentry,
 		brelse (bh);
 		/* Check to see if we should continue to search */
 		retval = ext3_htree_next_block(dir, hash, frame,
-					       frames, 0);
+					       frames, NULL);
 		if (retval < 0) {
 			ext3_warning(sb, __FUNCTION__,
 			     "error reading index page in directory #%lu",
@@ -1390,7 +1392,7 @@ static int ext3_add_entry (handle_t *handle, struct dentry *dentry,
 		bh = ext3_bread(handle, dir, block, 0, &retval);
 		if(!bh)
 			return retval;
-		retval = add_dirent_to_buf(handle, dentry, inode, 0, bh);
+		retval = add_dirent_to_buf(handle, dentry, inode, NULL, bh);
 		if (retval != -ENOSPC)
 			return retval;
 
@@ -1427,7 +1429,7 @@ static int ext3_dx_add_entry(handle_t *handle, struct dentry *dentry,
 	struct ext3_dir_entry_2 *de;
 	int err;
 
-	frame = dx_probe(dentry, 0, &hinfo, frames, &err);
+	frame = dx_probe(dentry, NULL, &hinfo, frames, &err);
 	if (!frame)
 		return err;
 	entries = frame->entries;
@@ -1441,9 +1443,9 @@ static int ext3_dx_add_entry(handle_t *handle, struct dentry *dentry,
 	if (err)
 		goto journal_error;
 
-	err = add_dirent_to_buf(handle, dentry, inode, 0, bh);
+	err = add_dirent_to_buf(handle, dentry, inode, NULL, bh);
 	if (err != -ENOSPC) {
-		bh = 0;
+		bh = NULL;
 		goto cleanup;
 	}
 
@@ -1535,7 +1537,7 @@ static int ext3_dx_add_entry(handle_t *handle, struct dentry *dentry,
 	if (!de)
 		goto cleanup;
 	err = add_dirent_to_buf(handle, dentry, inode, de, bh);
-	bh = 0;
+	bh = NULL;
 	goto cleanup;
 
 journal_error:
@@ -1630,8 +1632,9 @@ static int ext3_create (struct inode * dir, struct dentry * dentry, int mode,
 {
 	handle_t *handle; 
 	struct inode * inode;
-	int err;
+	int err, retries = 0;
 
+retry:
 	handle = ext3_journal_start(dir, EXT3_DATA_TRANS_BLOCKS +
 					EXT3_INDEX_EXTRA_TRANS_BLOCKS + 3 +
 					2*EXT3_QUOTA_INIT_BLOCKS);
@@ -1650,6 +1653,8 @@ static int ext3_create (struct inode * dir, struct dentry * dentry, int mode,
 		err = ext3_add_nondir(handle, dentry, inode);
 	}
 	ext3_journal_stop(handle);
+	if (err == -ENOSPC && ext3_should_retry_alloc(dir->i_sb, &retries))
+		goto retry;
 	return err;
 }
 
@@ -1658,11 +1663,12 @@ static int ext3_mknod (struct inode * dir, struct dentry *dentry,
 {
 	handle_t *handle;
 	struct inode *inode;
-	int err;
+	int err, retries = 0;
 
 	if (!new_valid_dev(rdev))
 		return -EINVAL;
 
+retry:
 	handle = ext3_journal_start(dir, EXT3_DATA_TRANS_BLOCKS +
 			 		EXT3_INDEX_EXTRA_TRANS_BLOCKS + 3 +
 					2*EXT3_QUOTA_INIT_BLOCKS);
@@ -1682,6 +1688,8 @@ static int ext3_mknod (struct inode * dir, struct dentry *dentry,
 		err = ext3_add_nondir(handle, dentry, inode);
 	}
 	ext3_journal_stop(handle);
+	if (err == -ENOSPC && ext3_should_retry_alloc(dir->i_sb, &retries))
+		goto retry;
 	return err;
 }
 
@@ -1691,11 +1699,12 @@ static int ext3_mkdir(struct inode * dir, struct dentry * dentry, int mode)
 	struct inode * inode;
 	struct buffer_head * dir_block;
 	struct ext3_dir_entry_2 * de;
-	int err;
+	int err, retries = 0;
 
 	if (dir->i_nlink >= EXT3_LINK_MAX)
 		return -EMLINK;
 
+retry:
 	handle = ext3_journal_start(dir, EXT3_DATA_TRANS_BLOCKS +
 					EXT3_INDEX_EXTRA_TRANS_BLOCKS + 3 +
 					2*EXT3_QUOTA_INIT_BLOCKS);
@@ -1753,6 +1762,8 @@ static int ext3_mkdir(struct inode * dir, struct dentry * dentry, int mode)
 	d_instantiate(dentry, inode);
 out_stop:
 	ext3_journal_stop(handle);
+	if (err == -ENOSPC && ext3_should_retry_alloc(dir->i_sb, &retries))
+		goto retry;
 	return err;
 }
 
@@ -2092,12 +2103,13 @@ static int ext3_symlink (struct inode * dir,
 {
 	handle_t *handle;
 	struct inode * inode;
-	int l, err;
+	int l, err, retries = 0;
 
 	l = strlen(symname)+1;
 	if (l > dir->i_sb->s_blocksize)
 		return -ENAMETOOLONG;
 
+retry:
 	handle = ext3_journal_start(dir, EXT3_DATA_TRANS_BLOCKS +
 			 		EXT3_INDEX_EXTRA_TRANS_BLOCKS + 5 +
 					2*EXT3_QUOTA_INIT_BLOCKS);
@@ -2136,6 +2148,8 @@ static int ext3_symlink (struct inode * dir,
 	err = ext3_add_nondir(handle, dentry, inode);
 out_stop:
 	ext3_journal_stop(handle);
+	if (err == -ENOSPC && ext3_should_retry_alloc(dir->i_sb, &retries))
+		goto retry;
 	return err;
 }
 
@@ -2144,11 +2158,12 @@ static int ext3_link (struct dentry * old_dentry,
 {
 	handle_t *handle;
 	struct inode *inode = old_dentry->d_inode;
-	int err;
+	int err, retries = 0;
 
 	if (inode->i_nlink >= EXT3_LINK_MAX)
 		return -EMLINK;
 
+retry:
 	handle = ext3_journal_start(dir, EXT3_DATA_TRANS_BLOCKS +
 					EXT3_INDEX_EXTRA_TRANS_BLOCKS);
 	if (IS_ERR(handle))
@@ -2163,6 +2178,8 @@ static int ext3_link (struct dentry * old_dentry,
 
 	err = ext3_add_nondir(handle, dentry, inode);
 	ext3_journal_stop(handle);
+	if (err == -ENOSPC && ext3_should_retry_alloc(dir->i_sb, &retries))
+		goto retry;
 	return err;
 }
 
diff --git a/fs/ext3/super.c b/fs/ext3/super.c
index cf48f6123..27c0fe37d 100644
--- a/fs/ext3/super.c
+++ b/fs/ext3/super.c
@@ -356,7 +356,7 @@ static int ext3_blkdev_remove(struct ext3_sb_info *sbi)
 	bdev = sbi->journal_bdev;
 	if (bdev) {
 		ret = ext3_blkdev_put(bdev);
-		sbi->journal_bdev = 0;
+		sbi->journal_bdev = NULL;
 	}
 	return ret;
 }
@@ -724,6 +724,11 @@ static int parse_options (char * options, struct super_block *sb,
 			break;
 #ifndef CONFIG_INOXID_NONE
 		case Opt_tagxid:
+			if (is_remount) {
+				printk(KERN_ERR "EXT3-fs: cannot specify "
+				       "tagxid on remount\n");
+				return 0;
+			}
 			set_opt (sbi->s_mount_opt, TAG_XID);
 			break;
 #endif
@@ -1207,7 +1212,7 @@ static unsigned long descriptor_loc(struct super_block *sb,
 static int ext3_fill_super (struct super_block *sb, void *data, int silent)
 {
 	struct buffer_head * bh;
-	struct ext3_super_block *es = 0;
+	struct ext3_super_block *es = NULL;
 	struct ext3_sb_info *sbi;
 	unsigned long block;
 	unsigned long sb_block = get_sb_block(&data);
@@ -1481,7 +1486,7 @@ static int ext3_fill_super (struct super_block *sb, void *data, int silent)
 #endif
 	INIT_LIST_HEAD(&sbi->s_orphan); /* unlinked but open files */
 
-	sb->s_root = 0;
+	sb->s_root = NULL;
 
 	needs_recovery = (es->s_last_orphan != 0 ||
 			  EXT3_HAS_INCOMPAT_FEATURE(sb,
diff --git a/fs/ext3/symlink.c b/fs/ext3/symlink.c
index ae092875b..867f713a1 100644
--- a/fs/ext3/symlink.c
+++ b/fs/ext3/symlink.c
@@ -20,24 +20,20 @@
 #include <linux/fs.h>
 #include <linux/jbd.h>
 #include <linux/ext3_fs.h>
+#include <linux/namei.h>
 #include "xattr.h"
 
-static int
-ext3_readlink(struct dentry *dentry, char __user *buffer, int buflen)
-{
-	struct ext3_inode_info *ei = EXT3_I(dentry->d_inode);
-	return vfs_readlink(dentry, buffer, buflen, (char*)ei->i_data);
-}
-
 static int ext3_follow_link(struct dentry *dentry, struct nameidata *nd)
 {
 	struct ext3_inode_info *ei = EXT3_I(dentry->d_inode);
-	return vfs_follow_link(nd, (char*)ei->i_data);
+	nd_set_link(nd, (char*)ei->i_data);
+	return 0;
 }
 
 struct inode_operations ext3_symlink_inode_operations = {
-	.readlink	= page_readlink,
-	.follow_link	= page_follow_link,
+	.readlink	= generic_readlink,
+	.follow_link	= page_follow_link_light,
+	.put_link	= page_put_link,
 	.setxattr	= ext3_setxattr,
 	.getxattr	= ext3_getxattr,
 	.listxattr	= ext3_listxattr,
@@ -45,8 +41,8 @@ struct inode_operations ext3_symlink_inode_operations = {
 };
 
 struct inode_operations ext3_fast_symlink_inode_operations = {
-	.readlink	= ext3_readlink,	/* BKL not held.  Don't need */
-	.follow_link	= ext3_follow_link,	/* BKL not held.  Don't need */
+	.readlink	= generic_readlink,
+	.follow_link	= ext3_follow_link,
 	.setxattr	= ext3_setxattr,
 	.getxattr	= ext3_getxattr,
 	.listxattr	= ext3_listxattr,
diff --git a/fs/ext3/xattr.c b/fs/ext3/xattr.c
index 5cbac5df4..b6c382c83 100644
--- a/fs/ext3/xattr.c
+++ b/fs/ext3/xattr.c
@@ -791,8 +791,8 @@ ext3_xattr_set_handle2(handle_t *handle, struct inode *inode,
 					EXT3_SB(sb)->s_es->s_first_data_block) +
 				EXT3_I(inode)->i_block_group *
 				EXT3_BLOCKS_PER_GROUP(sb);
-			int block = ext3_new_block(handle,
-				inode, goal, 0, 0, &error);
+			int block = ext3_new_block(handle, inode, goal,
+						   NULL, NULL, &error);
 			if (error)
 				goto cleanup;
 			ea_idebug(inode, "creating block %d", block);
@@ -881,8 +881,9 @@ ext3_xattr_set(struct inode *inode, int name_index, const char *name,
 	       const void *value, size_t value_len, int flags)
 {
 	handle_t *handle;
-	int error;
+	int error, retries = 0;
 
+retry:
 	handle = ext3_journal_start(inode, EXT3_DATA_TRANS_BLOCKS);
 	if (IS_ERR(handle)) {
 		error = PTR_ERR(handle);
@@ -892,6 +893,9 @@ ext3_xattr_set(struct inode *inode, int name_index, const char *name,
 		error = ext3_xattr_set_handle(handle, inode, name_index, name,
 					      value, value_len, flags);
 		error2 = ext3_journal_stop(handle);
+		if (error == -ENOSPC &&
+		    ext3_should_retry_alloc(inode->i_sb, &retries))
+			goto retry;
 		if (error == 0)
 			error = error2;
 	}
diff --git a/fs/fat/inode.c b/fs/fat/inode.c
index 0da65be32..c0fc6b7d6 100644
--- a/fs/fat/inode.c
+++ b/fs/fat/inode.c
@@ -23,6 +23,14 @@
 #include <linux/parser.h>
 #include <asm/unaligned.h>
 
+#ifndef CONFIG_FAT_DEFAULT_IOCHARSET
+/* if user don't select VFAT, this is undefined. */
+#define CONFIG_FAT_DEFAULT_IOCHARSET	""
+#endif
+
+static int fat_default_codepage = CONFIG_FAT_DEFAULT_CODEPAGE;
+static char fat_default_iocharset[] = CONFIG_FAT_DEFAULT_IOCHARSET;
+
 /*
  * New FAT inode stuff. We do the following:
  *	a) i_ino is constant and has nothing with on-disk location.
@@ -166,20 +174,17 @@ void fat_put_super(struct super_block *sb)
 	if (sbi->nls_disk) {
 		unload_nls(sbi->nls_disk);
 		sbi->nls_disk = NULL;
-		sbi->options.codepage = 0;
+		sbi->options.codepage = fat_default_codepage;
 	}
 	if (sbi->nls_io) {
 		unload_nls(sbi->nls_io);
 		sbi->nls_io = NULL;
 	}
-	/*
-	 * Note: the iocharset option might have been specified
-	 * without enabling nls_io, so check for it here.
-	 */
-	if (sbi->options.iocharset) {
+	if (sbi->options.iocharset != fat_default_iocharset) {
 		kfree(sbi->options.iocharset);
-		sbi->options.iocharset = NULL;
+		sbi->options.iocharset = fat_default_iocharset;
 	}
+
 	sb->s_fs_info = NULL;
 	kfree(sbi);
 }
@@ -196,11 +201,11 @@ static int fat_show_options(struct seq_file *m, struct vfsmount *mnt)
 		seq_printf(m, ",gid=%u", opts->fs_gid);
 	seq_printf(m, ",fmask=%04o", opts->fs_fmask);
 	seq_printf(m, ",dmask=%04o", opts->fs_dmask);
-	if (sbi->nls_disk)
+	if (sbi->nls_disk && opts->codepage != fat_default_codepage)
 		seq_printf(m, ",codepage=%s", sbi->nls_disk->charset);
 	if (isvfat) {
-		if (sbi->nls_io
-		    && strcmp(sbi->nls_io->charset, CONFIG_NLS_DEFAULT))
+		if (sbi->nls_io &&
+		    strcmp(opts->iocharset, fat_default_iocharset))
 			seq_printf(m, ",iocharset=%s", sbi->nls_io->charset);
 
 		switch (opts->shortname) {
@@ -331,14 +336,15 @@ static int parse_options(char *options, int is_vfat, int *debug,
 	char *p;
 	substring_t args[MAX_OPT_ARGS];
 	int option;
+	char *iocharset;
 
 	opts->isvfat = is_vfat;
 
 	opts->fs_uid = current->uid;
 	opts->fs_gid = current->gid;
 	opts->fs_fmask = opts->fs_dmask = current->fs->umask;
-	opts->codepage = 0;
-	opts->iocharset = NULL;
+	opts->codepage = fat_default_codepage;
+	opts->iocharset = fat_default_iocharset;
 	if (is_vfat)
 		opts->shortname = VFAT_SFN_DISPLAY_LOWER|VFAT_SFN_CREATE_WIN95;
 	else
@@ -351,7 +357,7 @@ static int parse_options(char *options, int is_vfat, int *debug,
 	*debug = 0;
 
 	if (!options)
-		return 1;
+		return 0;
 
 	while ((p = strsep(&options, ",")) != NULL) {
 		int token;
@@ -437,10 +443,12 @@ static int parse_options(char *options, int is_vfat, int *debug,
 
 		/* vfat specific */
 		case Opt_charset:
-			kfree(opts->iocharset);
-			opts->iocharset = match_strdup(&args[0]);
-			if (!opts->iocharset)
-				return 0;
+			if (opts->iocharset != fat_default_iocharset)
+				kfree(opts->iocharset);
+			iocharset = match_strdup(&args[0]);
+			if (!iocharset)
+				return -ENOMEM;
+			opts->iocharset = iocharset;
 			break;
 		case Opt_shortname_lower:
 			opts->shortname = VFAT_SFN_DISPLAY_LOWER
@@ -486,14 +494,19 @@ static int parse_options(char *options, int is_vfat, int *debug,
 		default:
 			printk(KERN_ERR "FAT: Unrecognized mount option \"%s\" "
 			       "or missing value\n", p);
-			return 0;
+			return -EINVAL;
 		}
 	}
+	/* UTF8 doesn't provide FAT semantics */
+	if (!strcmp(opts->iocharset, "utf8")) {
+		printk(KERN_ERR "FAT: utf8 is not a recommended IO charset"
+		       " for FAT filesystems, filesystem will be case sensitive!\n");
+	}
 
 	if (opts->unicode_xlate)
 		opts->utf8 = 0;
 	
-	return 1;
+	return 0;
 }
 
 static int fat_calc_dir_size(struct inode *inode)
@@ -784,7 +797,7 @@ int fat_fill_super(struct super_block *sb, void *data, int silent,
 	struct msdos_sb_info *sbi;
 	u16 logical_sector_size;
 	u32 total_sectors, total_clusters, fat_clusters, rootdir_sectors;
-	int debug, cp, first;
+	int debug, first;
 	unsigned int media;
 	long error;
 	char buf[50];
@@ -801,8 +814,8 @@ int fat_fill_super(struct super_block *sb, void *data, int silent,
 	sb->s_export_op = &fat_export_ops;
 	sbi->dir_ops = fs_dir_inode_ops;
 
-	error = -EINVAL;
-	if (!parse_options(data, isvfat, &debug, &sbi->options))
+	error = parse_options(data, isvfat, &debug, &sbi->options);
+	if (error)
 		goto out_fail;
 
 	fat_cache_init(sb);
@@ -830,18 +843,12 @@ int fat_fill_super(struct super_block *sb, void *data, int silent,
 		brelse(bh);
 		goto out_invalid;
 	}
-	if (!b->secs_track) {
-		if (!silent)
-			printk(KERN_ERR "FAT: bogus sectors-per-track value\n");
-		brelse(bh);
-		goto out_invalid;
-	}
-	if (!b->heads) {
-		if (!silent)
-			printk(KERN_ERR "FAT: bogus number-of-heads value\n");
-		brelse(bh);
-		goto out_invalid;
-	}
+
+	/*
+	 * Earlier we checked here that b->secs_track and b->head are nonzero,
+	 * but it turns out valid FAT filesystems can have zero there.
+	 */
+
 	media = b->media;
 	if (!FAT_VALID_MEDIA(media)) {
 		if (!silent)
@@ -1009,31 +1016,21 @@ int fat_fill_super(struct super_block *sb, void *data, int silent,
 	}
 
 	error = -EINVAL;
-	cp = sbi->options.codepage ? sbi->options.codepage : 437;
-	sprintf(buf, "cp%d", cp);
+	sprintf(buf, "cp%d", sbi->options.codepage);
 	sbi->nls_disk = load_nls(buf);
 	if (!sbi->nls_disk) {
-		/* Fail only if explicit charset specified */
-		if (sbi->options.codepage != 0) {
-			printk(KERN_ERR "FAT: codepage %s not found\n", buf);
-			goto out_fail;
-		}
-		sbi->options.codepage = 0; /* already 0?? */
-		sbi->nls_disk = load_nls_default();
+		printk(KERN_ERR "FAT: codepage %s not found\n", buf);
+		goto out_fail;
 	}
 
 	/* FIXME: utf8 is using iocharset for upper/lower conversion */
 	if (sbi->options.isvfat) {
-		if (sbi->options.iocharset != NULL) {
-			sbi->nls_io = load_nls(sbi->options.iocharset);
-			if (!sbi->nls_io) {
-				printk(KERN_ERR
-				       "FAT: IO charset %s not found\n",
-				       sbi->options.iocharset);
-				goto out_fail;
-			}
-		} else
-			sbi->nls_io = load_nls_default();
+		sbi->nls_io = load_nls(sbi->options.iocharset);
+		if (!sbi->nls_io) {
+			printk(KERN_ERR "FAT: IO charset %s not found\n",
+			       sbi->options.iocharset);
+			goto out_fail;
+		}
 	}
 
 	error = -ENOMEM;
@@ -1068,7 +1065,7 @@ out_fail:
 		unload_nls(sbi->nls_io);
 	if (sbi->nls_disk)
 		unload_nls(sbi->nls_disk);
-	if (sbi->options.iocharset)
+	if (sbi->options.iocharset != fat_default_iocharset)
 		kfree(sbi->options.iocharset);
 	sb->s_fs_info = NULL;
 	kfree(sbi);
diff --git a/fs/fcntl.c b/fs/fcntl.c
index 3fe5cdae3..3d9a94866 100644
--- a/fs/fcntl.c
+++ b/fs/fcntl.c
@@ -142,7 +142,7 @@ static int dupfd(struct file *file, unsigned int start)
 		FD_SET(fd, files->open_fds);
 		FD_CLR(fd, files->close_on_exec);
 		spin_unlock(&files->file_lock);
-		vx_openfd_inc(fd);
+		// vx_openfd_inc(fd);
 		fd_install(fd, file);
 	} else {
 		spin_unlock(&files->file_lock);
@@ -190,7 +190,7 @@ asmlinkage long sys_dup2(unsigned int oldfd, unsigned int newfd)
 	FD_SET(newfd, files->open_fds);
 	FD_CLR(newfd, files->close_on_exec);
 	spin_unlock(&files->file_lock);
-	vx_openfd_inc(newfd);
+	// vx_openfd_inc(newfd);
 
 	if (tofree)
 		filp_close(tofree, files);
@@ -217,7 +217,7 @@ asmlinkage long sys_dup(unsigned int fildes)
 	return ret;
 }
 
-#define SETFL_MASK (O_APPEND | O_NONBLOCK | O_NDELAY | FASYNC | O_DIRECT)
+#define SETFL_MASK (O_APPEND | O_NONBLOCK | O_NDELAY | FASYNC | O_DIRECT | O_NOATIME)
 
 static int setfl(int fd, struct file * filp, unsigned long arg)
 {
@@ -228,6 +228,11 @@ static int setfl(int fd, struct file * filp, unsigned long arg)
 	if (!(arg & O_APPEND) && IS_APPEND(inode))
 		return -EPERM;
 
+	/* O_NOATIME can only be set by the owner or superuser */
+	if ((arg & O_NOATIME) && !(filp->f_flags & O_NOATIME))
+		if (current->fsuid != inode->i_uid && !capable(CAP_FOWNER))
+			return -EPERM;
+
 	/* required for strict SunOS emulation */
 	if (O_NONBLOCK != O_NDELAY)
 	       if (arg & O_NDELAY)
@@ -239,6 +244,11 @@ static int setfl(int fd, struct file * filp, unsigned long arg)
 				return -EINVAL;
 	}
 
+	if (filp->f_op && filp->f_op->check_flags)
+		error = filp->f_op->check_flags(arg);
+	if (error)
+		return error;
+
 	lock_kernel();
 	if ((arg ^ filp->f_flags) & FASYNC) {
 		if (filp->f_op && filp->f_op->fasync) {
@@ -287,8 +297,8 @@ void f_delown(struct file *filp)
 
 EXPORT_SYMBOL(f_delown);
 
-long generic_file_fcntl(int fd, unsigned int cmd,
-			unsigned long arg, struct file *filp)
+static long do_fcntl(int fd, unsigned int cmd, unsigned long arg,
+		struct file *filp)
 {
 	long err = -EINVAL;
 
@@ -356,15 +366,6 @@ long generic_file_fcntl(int fd, unsigned int cmd,
 	}
 	return err;
 }
-EXPORT_SYMBOL(generic_file_fcntl);
-
-static long do_fcntl(int fd, unsigned int cmd,
-			unsigned long arg, struct file *filp)
-{
-	if (filp->f_op && filp->f_op->fcntl)
-		return filp->f_op->fcntl(fd, cmd, arg, filp);
-	return generic_file_fcntl(fd, cmd, arg, filp);
-}
 
 asmlinkage long sys_fcntl(int fd, unsigned int cmd, unsigned long arg)
 {	
diff --git a/fs/fifo.c b/fs/fifo.c
index 7a6a01830..a045fa716 100644
--- a/fs/fifo.c
+++ b/fs/fifo.c
@@ -45,6 +45,9 @@ static int fifo_open(struct inode *inode, struct file *filp)
 	}
 	filp->f_version = 0;
 
+	/* We can only do regular read/write on fifos */
+	filp->f_mode &= (FMODE_READ | FMODE_WRITE);
+
 	switch (filp->f_mode) {
 	case 1:
 	/*
diff --git a/fs/file.c b/fs/file.c
index e97f3a867..d40c4028f 100644
--- a/fs/file.c
+++ b/fs/file.c
@@ -159,7 +159,7 @@ void free_fdset(fd_set *array, int num)
  */
 int expand_fdset(struct files_struct *files, int nr)
 {
-	fd_set *new_openset = 0, *new_execset = 0;
+	fd_set *new_openset = NULL, *new_execset = NULL;
 	int error, nfds = 0;
 
 	error = -EMFILE;
diff --git a/fs/file_table.c b/fs/file_table.c
index 7faf2b8c5..8996d4d11 100644
--- a/fs/file_table.c
+++ b/fs/file_table.c
@@ -119,7 +119,7 @@ int open_private_file(struct file *filp, struct dentry *dentry, int flags)
 	memset(filp, 0, sizeof(*filp));
 	eventpoll_init_file(filp);
 	filp->f_flags  = flags;
-	filp->f_mode   = (flags+1) & O_ACCMODE;
+	filp->f_mode   = ((flags+1) & O_ACCMODE) | FMODE_LSEEK | FMODE_PREAD | FMODE_PWRITE;
 	atomic_set(&filp->f_count, 1);
 	filp->f_dentry = dentry;
 	filp->f_mapping = dentry->d_inode->i_mapping;
diff --git a/fs/freevxfs/vxfs_immed.c b/fs/freevxfs/vxfs_immed.c
index be243053a..ac677ab26 100644
--- a/fs/freevxfs/vxfs_immed.c
+++ b/fs/freevxfs/vxfs_immed.c
@@ -32,12 +32,12 @@
  */
 #include <linux/fs.h>
 #include <linux/pagemap.h>
+#include <linux/namei.h>
 
 #include "vxfs.h"
 #include "vxfs_inode.h"
 
 
-static int	vxfs_immed_readlink(struct dentry *, char __user *, int);
 static int	vxfs_immed_follow_link(struct dentry *, struct nameidata *);
 
 static int	vxfs_immed_readpage(struct file *, struct page *);
@@ -49,7 +49,7 @@ static int	vxfs_immed_readpage(struct file *, struct page *);
  * but do all work directly on the inode.
  */
 struct inode_operations vxfs_immed_symlink_iops = {
-	.readlink =		vxfs_immed_readlink,
+	.readlink =		generic_readlink,
 	.follow_link =		vxfs_immed_follow_link,
 };
 
@@ -60,28 +60,6 @@ struct address_space_operations vxfs_immed_aops = {
 	.readpage =		vxfs_immed_readpage,
 };
 
-
-/**
- * vxfs_immed_readlink - read immed symlink
- * @dp:		dentry for the link
- * @bp:		output buffer
- * @buflen:	length of @bp
- *
- * Description:
- *   vxfs_immed_readlink calls vfs_readlink to read the link
- *   described by @dp into userspace.
- *
- * Returns:
- *   Number of bytes successfully copied to userspace.
- */
-static int
-vxfs_immed_readlink(struct dentry *dp, char __user *bp, int buflen)
-{
-	struct vxfs_inode_info		*vip = VXFS_INO(dp->d_inode);
-
-	return (vfs_readlink(dp, bp, buflen, vip->vii_immed.vi_immed));
-}
-
 /**
  * vxfs_immed_follow_link - follow immed symlink
  * @dp:		dentry for the link
@@ -98,8 +76,8 @@ static int
 vxfs_immed_follow_link(struct dentry *dp, struct nameidata *np)
 {
 	struct vxfs_inode_info		*vip = VXFS_INO(dp->d_inode);
-
-	return (vfs_follow_link(np, vip->vii_immed.vi_immed));
+	nd_set_link(np, vip->vii_immed.vi_immed);
+	return 0;
 }
 
 /**
diff --git a/fs/fs-writeback.c b/fs/fs-writeback.c
index 5f3ccf989..430afc37d 100644
--- a/fs/fs-writeback.c
+++ b/fs/fs-writeback.c
@@ -213,8 +213,9 @@ __sync_single_inode(struct inode *inode, struct writeback_control *wbc)
 		} else if (inode->i_state & I_DIRTY) {
 			/*
 			 * Someone redirtied the inode while were writing back
-			 * the pages: nothing to do.
+			 * the pages.
 			 */
+			list_move(&inode->i_list, &sb->s_dirty);
 		} else if (atomic_read(&inode->i_count)) {
 			/*
 			 * The inode is clean, inuse
@@ -225,6 +226,7 @@ __sync_single_inode(struct inode *inode, struct writeback_control *wbc)
 			 * The inode is clean, unused
 			 */
 			list_move(&inode->i_list, &inode_unused);
+			inodes_stat.nr_unused++;
 		}
 	}
 	wake_up_inode(inode);
diff --git a/fs/hfs/btree.c b/fs/hfs/btree.c
index 3e620efdd..19f10cf9f 100644
--- a/fs/hfs/btree.c
+++ b/fs/hfs/btree.c
@@ -19,7 +19,7 @@ struct hfs_btree *hfs_btree_open(struct super_block *sb, u32 id, btree_keycmp ke
 	struct hfs_btree_header_rec *head;
 	struct address_space *mapping;
 	struct page *page;
-	unsigned int shift, size;
+	unsigned int size;
 
 	tree = kmalloc(sizeof(*tree), GFP_KERNEL);
 	if (!tree)
@@ -82,10 +82,7 @@ struct hfs_btree *hfs_btree_open(struct super_block *sb, u32 id, btree_keycmp ke
 		goto fail_page;
 	if (!tree->node_count)
 		goto fail_page;
-	for (shift = 0; size >>= 1; shift += 1)
-		;
-	tree->node_size_shift = shift;
-
+	tree->node_size_shift = ffs(size) - 1;
 	tree->pages_per_bnode = (tree->node_size + PAGE_CACHE_SIZE - 1) >> PAGE_CACHE_SHIFT;
 
 	kunmap(page);
diff --git a/fs/hfs/super.c b/fs/hfs/super.c
index 2b7d0b21d..345651903 100644
--- a/fs/hfs/super.c
+++ b/fs/hfs/super.c
@@ -161,7 +161,7 @@ static int parse_options(char *options, struct hfs_sb_info *hsb)
 	if (!options)
 		return 1;
 
-	while ((this_char = strsep(&options, ","))) {
+	while ((this_char = strsep(&options, ",")) != 0) {
 		if (!*this_char)
 			continue;
 		value = strchr(this_char, '=');
diff --git a/fs/hfsplus/bnode.c b/fs/hfsplus/bnode.c
index ec8cb5dd2..5ce5d7713 100644
--- a/fs/hfsplus/bnode.c
+++ b/fs/hfsplus/bnode.c
@@ -34,7 +34,7 @@ void hfs_bnode_read(struct hfs_bnode *node, void *buf, int off, int len)
 	memcpy(buf, kmap(*pagep) + off, l);
 	kunmap(*pagep);
 
-	while ((len -= l)) {
+	while ((len -= l) != 0) {
 		buf += l;
 		l = min(len, (int)PAGE_CACHE_SIZE);
 		memcpy(buf, kmap(*++pagep), l);
@@ -87,7 +87,7 @@ void hfs_bnode_write(struct hfs_bnode *node, void *buf, int off, int len)
 	set_page_dirty(*pagep);
 	kunmap(*pagep);
 
-	while ((len -= l)) {
+	while ((len -= l) != 0) {
 		buf += l;
 		l = min(len, (int)PAGE_CACHE_SIZE);
 		memcpy(kmap(*++pagep), buf, l);
@@ -117,7 +117,7 @@ void hfs_bnode_clear(struct hfs_bnode *node, int off, int len)
 	set_page_dirty(*pagep);
 	kunmap(*pagep);
 
-	while ((len -= l)) {
+	while ((len -= l) != 0) {
 		l = min(len, (int)PAGE_CACHE_SIZE);
 		memset(kmap(*++pagep), 0, l);
 		set_page_dirty(*pagep);
@@ -150,7 +150,7 @@ void hfs_bnode_copy(struct hfs_bnode *dst_node, int dst,
 		set_page_dirty(*dst_page);
 		kunmap(*dst_page);
 
-		while ((len -= l)) {
+		while ((len -= l) != 0) {
 			l = min(len, (int)PAGE_CACHE_SIZE);
 			memcpy(kmap(*++dst_page), kmap(*++src_page), l);
 			kunmap(*src_page);
@@ -258,7 +258,7 @@ void hfs_bnode_move(struct hfs_bnode *node, int dst, int src, int len)
 			set_page_dirty(*dst_page);
 			kunmap(*dst_page);
 
-			while ((len -= l)) {
+			while ((len -= l) != 0) {
 				l = min(len, (int)PAGE_CACHE_SIZE);
 				memmove(kmap(*++dst_page), kmap(*++src_page), l);
 				kunmap(*src_page);
diff --git a/fs/hfsplus/btree.c b/fs/hfsplus/btree.c
index 84870a169..b07136490 100644
--- a/fs/hfsplus/btree.c
+++ b/fs/hfsplus/btree.c
@@ -22,7 +22,7 @@ struct hfs_btree *hfs_btree_open(struct super_block *sb, u32 id)
 	struct hfs_btree_header_rec *head;
 	struct address_space *mapping;
 	struct page *page;
-	unsigned int shift, size;
+	unsigned int size;
 
 	tree = kmalloc(sizeof(*tree), GFP_KERNEL);
 	if (!tree)
@@ -69,9 +69,7 @@ struct hfs_btree *hfs_btree_open(struct super_block *sb, u32 id)
 		goto fail_page;
 	if (!tree->node_count)
 		goto fail_page;
-	for (shift = 0; size >>= 1; shift += 1)
-		;
-	tree->node_size_shift = shift;
+	tree->node_size_shift = ffs(size) - 1;
 
 	tree->pages_per_bnode = (tree->node_size + PAGE_CACHE_SIZE - 1) >> PAGE_CACHE_SHIFT;
 
diff --git a/fs/hfsplus/inode.c b/fs/hfsplus/inode.c
index 69d9ea994..5dc9bdbd1 100644
--- a/fs/hfsplus/inode.c
+++ b/fs/hfsplus/inode.c
@@ -342,7 +342,7 @@ struct inode *hfsplus_new_inode(struct super_block *sb, int mode)
 	HFSPLUS_I(inode).cached_start = 0;
 	HFSPLUS_I(inode).cached_blocks = 0;
 	HFSPLUS_I(inode).phys_size = 0;
-	HFSPLUS_I(inode).rsrc_inode = 0;
+	HFSPLUS_I(inode).rsrc_inode = NULL;
 	if (S_ISDIR(inode->i_mode)) {
 		inode->i_size = 2;
 		HFSPLUS_SB(sb).folder_count++;
diff --git a/fs/hfsplus/wrapper.c b/fs/hfsplus/wrapper.c
index ca595223a..777db1122 100644
--- a/fs/hfsplus/wrapper.c
+++ b/fs/hfsplus/wrapper.c
@@ -135,7 +135,7 @@ int hfsplus_read_wrapper(struct super_block *sb)
 		return -EINVAL;
 	HFSPLUS_SB(sb).alloc_blksz = blocksize;
 	HFSPLUS_SB(sb).alloc_blksz_shift = 0;
-	while (blocksize >>= 1)
+	while ((blocksize >>= 1) != 0)
 		HFSPLUS_SB(sb).alloc_blksz_shift++;
 	blocksize = min(HFSPLUS_SB(sb).alloc_blksz, (u32)PAGE_SIZE);
 
diff --git a/fs/hpfs/alloc.c b/fs/hpfs/alloc.c
index 565d2b8b4..2baa977ff 100644
--- a/fs/hpfs/alloc.c
+++ b/fs/hpfs/alloc.c
@@ -79,16 +79,16 @@ static secno alloc_in_bmp(struct super_block *s, secno near, unsigned n, unsigne
 	} else {
 		if (!(bmp = hpfs_map_dnode_bitmap(s, &qbh))) goto uls;
 	}
-	/*if (!tstbits(bmp, nr + n, n + forward)) {
+	if (!tstbits(bmp, nr, n + forward)) {
 		ret = bs + nr;
 		goto rt;
 	}
-	if (!tstbits(bmp, nr + 2*n, n + forward)) {
+	/*if (!tstbits(bmp, nr + n, n + forward)) {
 		ret = bs + nr + n;
 		goto rt;
 	}*/
 	q = nr + n; b = 0;
-	while ((a = tstbits(bmp, q, n + forward))) {
+	while ((a = tstbits(bmp, q, n + forward)) != 0) {
 		q += a;
 		if (n != 1) q = ((q-1)&~(n-1))+n;
 		if (!b) {
@@ -103,9 +103,11 @@ static secno alloc_in_bmp(struct super_block *s, secno near, unsigned n, unsigne
 		goto rt;
 	}
 	nr >>= 5;
-	for (i = nr + 1; i != nr; i++, i &= 0x1ff) {
-		if (!bmp[i]) continue;
-		if (n + forward >= 0x3f && bmp[i] != -1) continue;
+	/*for (i = nr + 1; i != nr; i++, i &= 0x1ff) {*/
+	i = nr;
+	do {
+		if (!bmp[i]) goto cont;
+		if (n + forward >= 0x3f && bmp[i] != -1) goto cont;
 		q = i<<5;
 		if (i > 0) {
 			unsigned k = bmp[i-1];
@@ -114,7 +116,7 @@ static secno alloc_in_bmp(struct super_block *s, secno near, unsigned n, unsigne
 			}
 		}
 		if (n != 1) q = ((q-1)&~(n-1))+n;
-		while ((a = tstbits(bmp, q, n + forward))) {
+		while ((a = tstbits(bmp, q, n + forward)) != 0) {
 			q += a;
 			if (n != 1) q = ((q-1)&~(n-1))+n;
 			if (q>>5 > i) break;
@@ -123,7 +125,9 @@ static secno alloc_in_bmp(struct super_block *s, secno near, unsigned n, unsigne
 			ret = bs + q;
 			goto rt;
 		}
-	}
+		cont:
+		i++, i &= 0x1ff;
+	} while (i != nr);
 	rt:
 	if (ret) {
 		if (hpfs_sb(s)->sb_chk && ((ret >> 14) != (bs >> 14) || (bmp[(ret & 0x3fff) >> 5] | ~(((1 << n) - 1) << (ret & 0x1f))) != 0xffffffff)) {
@@ -152,46 +156,57 @@ static secno alloc_in_bmp(struct super_block *s, secno near, unsigned n, unsigne
 secno hpfs_alloc_sector(struct super_block *s, secno near, unsigned n, int forward, int lock)
 {
 	secno sec;
-	unsigned i;
+	int i;
 	unsigned n_bmps;
 	struct hpfs_sb_info *sbi = hpfs_sb(s);
-	int b = sbi->sb_c_bitmap;
 	int f_p = 0;
+	int near_bmp;
 	if (forward < 0) {
 		forward = -forward;
 		f_p = 1;
 	}
 	if (lock) hpfs_lock_creation(s);
-	if (near && near < sbi->sb_fs_size)
+	n_bmps = (sbi->sb_fs_size + 0x4000 - 1) >> 14;
+	if (near && near < sbi->sb_fs_size) {
 		if ((sec = alloc_in_bmp(s, near, n, f_p ? forward : forward/4))) goto ret;
+		near_bmp = near >> 14;
+	} else near_bmp = n_bmps / 2;
+	/*
 	if (b != -1) {
 		if ((sec = alloc_in_bmp(s, b<<14, n, f_p ? forward : forward/2))) {
 			b &= 0x0fffffff;
 			goto ret;
 		}
 		if (b > 0x10000000) if ((sec = alloc_in_bmp(s, (b&0xfffffff)<<14, n, f_p ? forward : 0))) goto ret;
-	}	
-	n_bmps = (sbi->sb_fs_size + 0x4000 - 1) >> 14;
-	for (i = 0; i < n_bmps / 2; i++) {
-		if ((sec = alloc_in_bmp(s, (n_bmps/2+i) << 14, n, forward))) {
-			sbi->sb_c_bitmap = n_bmps/2+i;
+	*/
+	if (!f_p) if (forward > sbi->sb_max_fwd_alloc) forward = sbi->sb_max_fwd_alloc;
+	less_fwd:
+	for (i = 0; i < n_bmps; i++) {
+		if (near_bmp+i < n_bmps && ((sec = alloc_in_bmp(s, (near_bmp+i) << 14, n, forward)))) {
+			sbi->sb_c_bitmap = near_bmp+i;
 			goto ret;
 		}	
-		if ((sec = alloc_in_bmp(s, (n_bmps/2-i-1) << 14, n, forward))) {
-			sbi->sb_c_bitmap = n_bmps/2-i-1;
+		if (!forward) {
+			if (near_bmp-i-1 >= 0 && ((sec = alloc_in_bmp(s, (near_bmp-i-1) << 14, n, forward)))) {
+				sbi->sb_c_bitmap = near_bmp-i-1;
+				goto ret;
+			}
+		} else {
+			if (near_bmp+i >= n_bmps && ((sec = alloc_in_bmp(s, (near_bmp+i-n_bmps) << 14, n, forward)))) {
+				sbi->sb_c_bitmap = near_bmp+i-n_bmps;
+				goto ret;
+			}
+		}
+		if (i == 1 && sbi->sb_c_bitmap != -1 && ((sec = alloc_in_bmp(s, (sbi->sb_c_bitmap) << 14, n, forward)))) {
 			goto ret;
 		}
 	}
-	if ((sec = alloc_in_bmp(s, (n_bmps-1) << 14, n, forward))) {
-		sbi->sb_c_bitmap = n_bmps-1;
-		goto ret;
-	}
 	if (!f_p) {
-		for (i = 0; i < n_bmps; i++)
-			if ((sec = alloc_in_bmp(s, i << 14, n, 0))) {
-				sbi->sb_c_bitmap = 0x10000000 + i;
-				goto ret;
-			}
+		if (forward) {
+			sbi->sb_max_fwd_alloc = forward * 3 / 4;
+			forward /= 2;
+			goto less_fwd;
+		}
 	}
 	sec = 0;
 	ret:
@@ -262,6 +277,7 @@ void hpfs_free_sectors(struct super_block *s, secno sec, unsigned n)
 {
 	struct quad_buffer_head qbh;
 	unsigned *bmp;
+	struct hpfs_sb_info *sbi = hpfs_sb(s);
 	/*printk("2 - ");*/
 	if (!n) return;
 	if (sec < 0x12) {
@@ -269,6 +285,8 @@ void hpfs_free_sectors(struct super_block *s, secno sec, unsigned n)
 		return;
 	}
 	lock_super(s);
+	sbi->sb_max_fwd_alloc += n > 0xffff ? 0xffff : n;
+	if (sbi->sb_max_fwd_alloc > 0xffffff) sbi->sb_max_fwd_alloc = 0xffffff;
 	new_map:
 	if (!(bmp = hpfs_map_bitmap(s, sec >> 14, &qbh, "free"))) {
 		unlock_super(s);
@@ -321,7 +339,7 @@ int hpfs_check_free_dnodes(struct super_block *s, int n)
 	}
 	hpfs_brelse4(&qbh);
 	i = 0;
-	if (hpfs_sb(s)->sb_c_bitmap != -1 ) {
+	if (hpfs_sb(s)->sb_c_bitmap != -1) {
 		bmp = hpfs_map_bitmap(s, b, &qbh, "chkdn1");
 		goto chk_bmp;
 	}
diff --git a/fs/hpfs/anode.c b/fs/hpfs/anode.c
index 1b6d1f820..1aa88c4e0 100644
--- a/fs/hpfs/anode.c
+++ b/fs/hpfs/anode.c
@@ -113,7 +113,7 @@ secno hpfs_add_sector_to_btree(struct super_block *s, secno node, int fnod, unsi
 			brelse(bh);
 			return -1;
 		}
-		se = node;
+		se = !fnod ? node : (node + 16384) & ~16383;
 	}	
 	if (!(se = hpfs_alloc_sector(s, se, 1, fsecno*ALLOC_M>ALLOC_FWD_MAX ? ALLOC_FWD_MAX : fsecno*ALLOC_M<ALLOC_FWD_MIN ? ALLOC_FWD_MIN : fsecno*ALLOC_M, 1))) {
 		brelse(bh);
@@ -192,7 +192,6 @@ secno hpfs_add_sector_to_btree(struct super_block *s, secno node, int fnod, unsi
 		}
 		up = up != node ? anode->up : -1;
 		btree->u.internal[btree->n_used_nodes - 1].file_secno = /*fs*/-1;
-		if (up == -1) anode->up = ra;
 		mark_buffer_dirty(bh);
 		brelse(bh);
 		a = na;
diff --git a/fs/hpfs/buffer.c b/fs/hpfs/buffer.c
index 77cd01ced..2807aa833 100644
--- a/fs/hpfs/buffer.c
+++ b/fs/hpfs/buffer.c
@@ -31,6 +31,8 @@ void *hpfs_map_sector(struct super_block *s, unsigned secno, struct buffer_head
 {
 	struct buffer_head *bh;
 
+	cond_resched();
+
 	*bhp = bh = sb_bread(s, secno);
 	if (bh != NULL)
 		return bh->b_data;
@@ -47,6 +49,8 @@ void *hpfs_get_sector(struct super_block *s, unsigned secno, struct buffer_head
 	struct buffer_head *bh;
 	/*return hpfs_map_sector(s, secno, bhp, 0);*/
 
+	cond_resched();
+
 	if ((*bhp = bh = sb_getblk(s, secno)) != NULL) {
 		if (!buffer_uptodate(bh)) wait_on_buffer(bh);
 		set_buffer_uptodate(bh);
@@ -65,9 +69,11 @@ void *hpfs_map_4sectors(struct super_block *s, unsigned secno, struct quad_buffe
 	struct buffer_head *bh;
 	char *data;
 
+	cond_resched();
+
 	if (secno & 3) {
 		printk("HPFS: hpfs_map_4sectors: unaligned read\n");
-		return 0;
+		return NULL;
 	}
 
 	qbh->data = data = (char *)kmalloc(2048, GFP_NOFS);
@@ -116,9 +122,11 @@ void *hpfs_map_4sectors(struct super_block *s, unsigned secno, struct quad_buffe
 void *hpfs_get_4sectors(struct super_block *s, unsigned secno,
                           struct quad_buffer_head *qbh)
 {
+	cond_resched();
+
 	if (secno & 3) {
 		printk("HPFS: hpfs_get_4sectors: unaligned read\n");
-		return 0;
+		return NULL;
 	}
 
 	/*return hpfs_map_4sectors(s, secno, qbh, 0);*/
diff --git a/fs/hpfs/ea.c b/fs/hpfs/ea.c
index 11057ec80..66339dc03 100644
--- a/fs/hpfs/ea.c
+++ b/fs/hpfs/ea.c
@@ -234,7 +234,7 @@ void hpfs_set_ea(struct inode *inode, struct fnode *fnode, char *key, char *data
 		}
 		pos += ea->namelen + ea->valuelen + 5;
 	}
-	if (!fnode->ea_size_s) {
+	if (!fnode->ea_offs) {
 		/*if (fnode->ea_size_s) {
 			hpfs_error(s, "fnode %08x: ea_size_s == %03x, ea_offs == 0",
 				inode->i_ino, fnode->ea_size_s);
@@ -242,15 +242,13 @@ void hpfs_set_ea(struct inode *inode, struct fnode *fnode, char *key, char *data
 		}*/
 		fnode->ea_offs = 0xc4;
 	}
-	if (fnode->ea_offs < 0xc4 || fnode->ea_offs + fnode->ea_size_s > 0x200) {
+	if (fnode->ea_offs < 0xc4 || fnode->ea_offs + fnode->acl_size_s + fnode->ea_size_s > 0x200) {
 		hpfs_error(s, "fnode %08x: ea_offs == %03x, ea_size_s == %03x",
 			inode->i_ino, fnode->ea_offs, fnode->ea_size_s);
 		return;
 	}
 	if ((fnode->ea_size_s || !fnode->ea_size_l) &&
-	     fnode->ea_offs + fnode->ea_size_s + strlen(key) + size + 5 <= 0x200) {
-		/* I'm not sure ... maybe we overwrite ACL here. I have no info
-		   on it right now :-( */
+	     fnode->ea_offs + fnode->acl_size_s + fnode->ea_size_s + strlen(key) + size + 5 <= 0x200) {
 		ea = fnode_end_ea(fnode);
 		*(char *)ea = 0;
 		ea->namelen = strlen(key);
diff --git a/fs/hpfs/hpfs.h b/fs/hpfs/hpfs.h
index 4d342db5f..da40420c7 100644
--- a/fs/hpfs/hpfs.h
+++ b/fs/hpfs/hpfs.h
@@ -408,7 +408,7 @@ struct fnode
   unsigned file_size;			/* file length, bytes */
   unsigned n_needea;			/* number of EA's with NEEDEA set */
   char user_id[16];			/* unused */
-  unsigned ea_offs;			/* offset from start of fnode
+  unsigned short ea_offs;		/* offset from start of fnode
 					   to first fnode-resident ea */
   char dasd_limit_treshhold;
   char dasd_limit_delta;
diff --git a/fs/hpfs/hpfs_fn.h b/fs/hpfs/hpfs_fn.h
index 0958e5cc5..ebe670a02 100644
--- a/fs/hpfs/hpfs_fn.h
+++ b/fs/hpfs/hpfs_fn.h
@@ -87,6 +87,7 @@ struct hpfs_sb_info {
 					/*	128 bytes lowercasing table */
 	unsigned *sb_bmp_dir;		/* main bitmap directory */
 	unsigned sb_c_bitmap;		/* current bitmap */
+	unsigned sb_max_fwd_alloc;	/* max forwad allocation */
 	struct semaphore hpfs_creation_de; /* when creating dirents, nobody else
 					   can alloc blocks */
 	/*unsigned sb_mounting : 1;*/
@@ -141,12 +142,12 @@ static inline struct hpfs_dirent *de_next_de (struct hpfs_dirent *de)
 
 static inline struct extended_attribute *fnode_ea(struct fnode *fnode)
 {
-	return (struct extended_attribute *)((char *)fnode + fnode->ea_offs);
+	return (struct extended_attribute *)((char *)fnode + fnode->ea_offs + fnode->acl_size_s);
 }
 
 static inline struct extended_attribute *fnode_end_ea(struct fnode *fnode)
 {
-	return (struct extended_attribute *)((char *)fnode + fnode->ea_offs + fnode->ea_size_s);
+	return (struct extended_attribute *)((char *)fnode + fnode->ea_offs + fnode->acl_size_s + fnode->ea_size_s);
 }
 
 static inline struct extended_attribute *next_ea(struct extended_attribute *ea)
diff --git a/fs/hpfs/inode.c b/fs/hpfs/inode.c
index dec2ad61c..28483e9e7 100644
--- a/fs/hpfs/inode.c
+++ b/fs/hpfs/inode.c
@@ -144,11 +144,11 @@ void hpfs_read_inode(struct inode *i)
 void hpfs_write_inode_ea(struct inode *i, struct fnode *fnode)
 {
 	struct hpfs_inode_info *hpfs_inode = hpfs_i(i);
-	if (fnode->acl_size_l || fnode->acl_size_s) {
-		/* Some unknown structures like ACL may be in fnode,
-		   we'd better not overwrite them */
+	/*if (fnode->acl_size_l || fnode->acl_size_s) {
+		   Some unknown structures like ACL may be in fnode,
+		   we'd better not overwrite them
 		hpfs_error(i->i_sb, "fnode %08x has some unknown HPFS386 stuctures", i->i_ino);
-	} else if (hpfs_sb(i->i_sb)->sb_eas >= 2) {
+	} else*/ if (hpfs_sb(i->i_sb)->sb_eas >= 2) {
 		u32 ea;
 		if ((i->i_uid != hpfs_sb(i->i_sb)->sb_uid) || hpfs_inode->i_ea_uid) {
 			ea = cpu_to_le32(i->i_uid);
@@ -218,16 +218,18 @@ void hpfs_write_inode_nolock(struct inode *i)
 	struct hpfs_dirent *de;
 	if (i->i_ino == hpfs_sb(i->i_sb)->sb_root) return;
 	if (!(fnode = hpfs_map_fnode(i->i_sb, i->i_ino, &bh))) return;
-	if (i->i_ino != hpfs_sb(i->i_sb)->sb_root) {
+	if (i->i_ino != hpfs_sb(i->i_sb)->sb_root && i->i_nlink) {
 		if (!(de = map_fnode_dirent(i->i_sb, i->i_ino, fnode, &qbh))) {
 			brelse(bh);
 			return;
 		}
 	} else de = NULL;
 	if (S_ISREG(i->i_mode)) {
-		fnode->file_size = de->file_size = i->i_size;
+		fnode->file_size = i->i_size;
+		if (de) de->file_size = i->i_size;
 	} else if (S_ISDIR(i->i_mode)) {
-		fnode->file_size = de->file_size = 0;
+		fnode->file_size = 0;
+		if (de) de->file_size = 0;
 	}
 	hpfs_write_inode_ea(i, fnode);
 	if (de) {
diff --git a/fs/hpfs/map.c b/fs/hpfs/map.c
index 8f21356e9..0fecdac22 100644
--- a/fs/hpfs/map.c
+++ b/fs/hpfs/map.c
@@ -142,7 +142,7 @@ struct fnode *hpfs_map_fnode(struct super_block *s, ino_t ino, struct buffer_hea
 				}
 			}
 			if (fnode->ea_size_s && ((signed int)fnode->ea_offs < 0xc4 ||
-			   (signed int)fnode->ea_offs + fnode->ea_size_s > 0x200)) {
+			   (signed int)fnode->ea_offs + fnode->acl_size_s + fnode->ea_size_s > 0x200)) {
 				hpfs_error(s, "bad EA info in fnode %08x: ea_offs == %04x ea_size_s == %04x",
 					ino, fnode->ea_offs, fnode->ea_size_s);
 				goto bail;
@@ -225,14 +225,16 @@ struct dnode *hpfs_map_dnode(struct super_block *s, unsigned secno,
 			}
 			for (p = 20; p < dnode->first_free; p += d[p] + (d[p+1] << 8)) {
 				struct hpfs_dirent *de = (struct hpfs_dirent *)((char *)dnode + p);
-				if (de->length > 292 || (de->length < 32) || (de->length & 3)) {
+				if (de->length > 292 || (de->length < 32) || (de->length & 3) || p + de->length > 2048) {
 					hpfs_error(s, "bad dirent size in dnode %08x, dirent %03x, last %03x", secno, p, pp);
 					goto bail;
 				}
 				if (((31 + de->namelen + de->down*4 + 3) & ~3) != de->length) {
+					if (((31 + de->namelen + de->down*4 + 3) & ~3) < de->length && s->s_flags & MS_RDONLY) goto ok;
 					hpfs_error(s, "namelen does not match dirent size in dnode %08x, dirent %03x, last %03x", secno, p, pp);
 					goto bail;
 				}
+				ok:
 				if (hpfs_sb(s)->sb_chk >= 2) b |= 1 << de->down;
 				if (de->down) if (de_down_pointer(de) < 0x10) {
 					hpfs_error(s, "bad down pointer in dnode %08x, dirent %03x, last %03x", secno, p, pp);
diff --git a/fs/hpfs/super.c b/fs/hpfs/super.c
index 0f61abb18..714f64447 100644
--- a/fs/hpfs/super.c
+++ b/fs/hpfs/super.c
@@ -542,6 +542,7 @@ static int hpfs_fill_super(struct super_block *s, void *options, int silent)
 	sbi->sb_was_error = 0;
 	sbi->sb_cp_table = NULL;
 	sbi->sb_c_bitmap = -1;
+	sbi->sb_max_fwd_alloc = 0xffffff;
 	
 	/* Load bitmap directory */
 	if (!(sbi->sb_bmp_dir = hpfs_load_bitmap_directory(s, superblock->bitmaps)))
diff --git a/fs/hugetlbfs/inode.c b/fs/hugetlbfs/inode.c
index f2893bbc5..4ec428315 100644
--- a/fs/hugetlbfs/inode.c
+++ b/fs/hugetlbfs/inode.c
@@ -52,6 +52,9 @@ static int hugetlbfs_file_mmap(struct file *file, struct vm_area_struct *vma)
 	loff_t len, vma_len;
 	int ret;
 
+	if (vma->vm_pgoff & (HPAGE_SIZE / PAGE_SIZE - 1))
+		return -EINVAL;
+
 	if (vma->vm_start & ~HPAGE_MASK)
 		return -EINVAL;
 
@@ -278,16 +281,16 @@ hugetlb_vmtruncate_list(struct prio_tree_root *root, unsigned long h_pgoff)
 		unsigned long v_length;
 		unsigned long v_offset;
 
-		h_vm_pgoff = vma->vm_pgoff << (HPAGE_SHIFT - PAGE_SHIFT);
-		v_length = vma->vm_end - vma->vm_start;
+		h_vm_pgoff = vma->vm_pgoff >> (HPAGE_SHIFT - PAGE_SHIFT);
 		v_offset = (h_pgoff - h_vm_pgoff) << HPAGE_SHIFT;
-
 		/*
 		 * Is this VMA fully outside the truncation point?
 		 */
 		if (h_vm_pgoff >= h_pgoff)
 			v_offset = 0;
 
+		v_length = vma->vm_end - vma->vm_start;
+
 		zap_hugepage_range(vma,
 				vma->vm_start + v_offset,
 				v_length - v_offset);
@@ -329,9 +332,6 @@ static int hugetlbfs_setattr(struct dentry *dentry, struct iattr *attr)
 	if (error)
 		goto out;
 
-	error = security_inode_setattr(dentry, attr);
-	if (error)
-		goto out;
 	if (ia_valid & ATTR_SIZE) {
 		error = -EINVAL;
 		if (!(attr->ia_size & ~HPAGE_MASK))
diff --git a/fs/inode.c b/fs/inode.c
index f699b9064..6a6f06f08 100644
--- a/fs/inode.c
+++ b/fs/inode.c
@@ -20,6 +20,7 @@
 #include <linux/security.h>
 #include <linux/pagemap.h>
 #include <linux/cdev.h>
+#include <linux/bootmem.h>
 #include <linux/vs_base.h>
 
 /*
@@ -90,7 +91,7 @@ spinlock_t inode_lock = SPIN_LOCK_UNLOCKED;
  * from its final dispose_list, the struct super_block they refer to
  * (for inode->i_sb->s_op) may already have been freed and reused.
  */
-static DECLARE_MUTEX(iprune_sem);
+DECLARE_MUTEX(iprune_sem);
 
 /*
  * Statistics gathering..
@@ -115,11 +116,10 @@ static struct inode *alloc_inode(struct super_block *sb)
 		struct address_space * const mapping = &inode->i_data;
 
 		inode->i_sb = sb;
-		if (sb->s_flags & MS_TAGXID)
-			inode->i_xid = current->xid;
-		else
-			inode->i_xid = 0;       /* maybe xid -1 would be better? */
 		// inode->i_dqh = dqhget(sb->s_dqh);
+
+		/* important because of inode slab reuse */
+		inode->i_xid = 0;
 		inode->i_blkbits = sb->s_blocksize_bits;
 		inode->i_flags = 0;
 		atomic_set(&inode->i_count, 1);
@@ -139,7 +139,6 @@ static struct inode *alloc_inode(struct super_block *sb)
 		inode->i_bdev = NULL;
 		inode->i_cdev = NULL;
 		inode->i_rdev = 0;
-		// inode->i_xid = 0;	/* maybe not too wise ... */
 		inode->i_security = NULL;
 		inode->dirtied_when = 0;
 		if (security_inode_alloc(inode)) {
@@ -494,7 +493,7 @@ static int shrink_icache_memory(int nr, unsigned int gfp_mask)
 		if (gfp_mask & __GFP_FS)
 			prune_icache(nr);
 	}
-	return inodes_stat.nr_unused;
+	return (inodes_stat.nr_unused / 100) * sysctl_vfs_cache_pressure;
 }
 
 static void __wait_on_freeing_inode(struct inode *inode);
@@ -570,7 +569,6 @@ struct inode *new_inode(struct super_block *sb)
 		list_add(&inode->i_list, &inode_in_use);
 		inode->i_ino = ++last_ino;
 		inode->i_state = 0;
-		inode->i_xid = vx_current_xid();
 		spin_unlock(&inode_lock);
 	}
 	return inode;
@@ -1242,26 +1240,26 @@ void remove_dquot_ref(struct super_block *sb, int type, struct list_head *tofree
 	if (!sb->dq_op)
 		return;	/* nothing to do */
 	spin_lock(&inode_lock);	/* This lock is for inodes code */
-	/* We don't have to lock against quota code - test IS_QUOTAINIT is just for speedup... */
- 
+
+	/* We hold dqptr_sem so we are safe against the quota code */
 	list_for_each(act_head, &inode_in_use) {
 		inode = list_entry(act_head, struct inode, i_list);
-		if (inode->i_sb == sb && IS_QUOTAINIT(inode))
+		if (inode->i_sb == sb && !IS_NOQUOTA(inode))
 			remove_inode_dquot_ref(inode, type, tofree_head);
 	}
 	list_for_each(act_head, &inode_unused) {
 		inode = list_entry(act_head, struct inode, i_list);
-		if (inode->i_sb == sb && IS_QUOTAINIT(inode))
+		if (inode->i_sb == sb && !IS_NOQUOTA(inode))
 			remove_inode_dquot_ref(inode, type, tofree_head);
 	}
 	list_for_each(act_head, &sb->s_dirty) {
 		inode = list_entry(act_head, struct inode, i_list);
-		if (IS_QUOTAINIT(inode))
+		if (!IS_NOQUOTA(inode))
 			remove_inode_dquot_ref(inode, type, tofree_head);
 	}
 	list_for_each(act_head, &sb->s_io) {
 		inode = list_entry(act_head, struct inode, i_list);
-		if (IS_QUOTAINIT(inode))
+		if (!IS_NOQUOTA(inode))
 			remove_inode_dquot_ref(inode, type, tofree_head);
 	}
 	spin_unlock(&inode_lock);
@@ -1353,55 +1351,30 @@ __setup("ihash_entries=", set_ihash_entries);
 /*
  * Initialize the waitqueues and inode hash table.
  */
+void __init inode_init_early(void)
+{
+	int loop;
+
+	inode_hashtable =
+		alloc_large_system_hash("Inode-cache",
+					sizeof(struct hlist_head),
+					ihash_entries,
+					14,
+					0,
+					&i_hash_shift,
+					&i_hash_mask);
+
+	for (loop = 0; loop < (1 << i_hash_shift); loop++)
+		INIT_HLIST_HEAD(&inode_hashtable[loop]);
+}
+
 void __init inode_init(unsigned long mempages)
 {
-	struct hlist_head *head;
-	unsigned long order;
-	unsigned int nr_hash;
 	int i;
 
 	for (i = 0; i < ARRAY_SIZE(i_wait_queue_heads); i++)
 		init_waitqueue_head(&i_wait_queue_heads[i].wqh);
 
-	if (!ihash_entries)
-		ihash_entries = PAGE_SHIFT < 14 ?
-				mempages >> (14 - PAGE_SHIFT) :
-				mempages << (PAGE_SHIFT - 14);
-
-	ihash_entries *= sizeof(struct hlist_head);
-	for (order = 0; ((1UL << order) << PAGE_SHIFT) < ihash_entries; order++)
-		;
-
-	do {
-		unsigned long tmp;
-
-		nr_hash = (1UL << order) * PAGE_SIZE /
-			sizeof(struct hlist_head);
-		i_hash_mask = (nr_hash - 1);
-
-		tmp = nr_hash;
-		i_hash_shift = 0;
-		while ((tmp >>= 1UL) != 0UL)
-			i_hash_shift++;
-
-		inode_hashtable = (struct hlist_head *)
-			__get_free_pages(GFP_ATOMIC, order);
-	} while (inode_hashtable == NULL && --order >= 0);
-
-	printk("Inode-cache hash table entries: %d (order: %ld, %ld bytes)\n",
-			nr_hash, order, (PAGE_SIZE << order));
-
-	if (!inode_hashtable)
-		panic("Failed to allocate inode hash table\n");
-
-	head = inode_hashtable;
-	i = nr_hash;
-	do {
-		INIT_HLIST_HEAD(head);
-		head++;
-		i--;
-	} while (i);
-
 	/* inode slab cache */
 	inode_cachep = kmem_cache_create("inode_cache", sizeof(struct inode),
 				0, SLAB_HWCACHE_ALIGN|SLAB_PANIC, init_once,
diff --git a/fs/ioctl.c b/fs/ioctl.c
index 12f3e71d2..64ffa90a2 100644
--- a/fs/ioctl.c
+++ b/fs/ioctl.c
@@ -4,11 +4,13 @@
  *  Copyright (C) 1991, 1992  Linus Torvalds
  */
 
+#include <linux/config.h>
 #include <linux/mm.h>
 #include <linux/smp_lock.h>
 #include <linux/file.h>
 #include <linux/fs.h>
 #include <linux/security.h>
+#include <linux/module.h>
 #include <linux/proc_fs.h>
 #include <linux/vserver/inode.h>
 #include <linux/vserver/xid.h>
@@ -183,3 +185,11 @@ asmlinkage long sys_ioctl(unsigned int fd, unsigned int cmd, unsigned long arg)
 out:
 	return error;
 }
+
+/*
+ * Platforms implementing 32 bit compatibility ioctl handlers in
+ * modules need this exported
+ */
+#ifdef CONFIG_COMPAT
+EXPORT_SYMBOL(sys_ioctl);
+#endif
diff --git a/fs/isofs/Makefile b/fs/isofs/Makefile
index 35049c11d..bf162f094 100644
--- a/fs/isofs/Makefile
+++ b/fs/isofs/Makefile
@@ -4,7 +4,7 @@
 
 obj-$(CONFIG_ISO9660_FS) += isofs.o
 
-isofs-objs-y 			:= namei.o inode.o dir.o util.o rock.o
+isofs-objs-y 			:= namei.o inode.o dir.o util.o rock.o export.o
 isofs-objs-$(CONFIG_JOLIET)	+= joliet.o
 isofs-objs-$(CONFIG_ZISOFS)	+= compress.o
 isofs-objs			:= $(isofs-objs-y)
diff --git a/fs/isofs/compress.c b/fs/isofs/compress.c
index 8877508ea..877b4e47d 100644
--- a/fs/isofs/compress.c
+++ b/fs/isofs/compress.c
@@ -114,7 +114,7 @@ static int zisofs_readpage(struct file *file, struct page *page)
 	blockendptr = blockptr + 4;
 
 	indexblocks = ((blockptr^blockendptr) >> bufshift) ? 2 : 1;
-	ptrbh[0] = ptrbh[1] = 0;
+	ptrbh[0] = ptrbh[1] = NULL;
 
 	if ( isofs_get_blocks(inode, blockptr >> bufshift, ptrbh, indexblocks) != indexblocks ) {
 		if ( ptrbh[0] ) brelse(ptrbh[0]);
diff --git a/fs/isofs/dir.c b/fs/isofs/dir.c
index 1f2f92ab3..14d86de66 100644
--- a/fs/isofs/dir.c
+++ b/fs/isofs/dir.c
@@ -64,7 +64,8 @@ int isofs_name_translate(struct iso_directory_record *de, char *new, struct inod
 			break;
 
 		/* Convert remaining ';' to '.' */
-		if (c == ';')
+		/* Also '/' to '.' (broken Acorn-generated ISO9660 images) */
+		if (c == ';' || c == '/')
 			c = '.';
 
 		new[i] = c;
@@ -106,8 +107,8 @@ static int do_isofs_readdir(struct inode *inode, struct file *filp,
 {
 	unsigned long bufsize = ISOFS_BUFFER_SIZE(inode);
 	unsigned char bufbits = ISOFS_BUFFER_BITS(inode);
-	unsigned int block, offset;
-	int inode_number = 0;	/* Quiet GCC */
+	unsigned long block, offset, block_saved, offset_saved;
+	unsigned long inode_number = 0;	/* Quiet GCC */
 	struct buffer_head *bh = NULL;
 	int len;
 	int map;
@@ -129,8 +130,6 @@ static int do_isofs_readdir(struct inode *inode, struct file *filp,
 		}
 
 		de = (struct iso_directory_record *) (bh->b_data + offset);
-		if (first_de)
-			inode_number = (bh->b_blocknr << bufbits) + offset;
 
 		de_len = *(unsigned char *) de;
 
@@ -147,6 +146,8 @@ static int do_isofs_readdir(struct inode *inode, struct file *filp,
 			continue;
 		}
 
+		block_saved = block;
+		offset_saved = offset;
 		offset += de_len;
 
 		/* Make sure we have a full directory entry */
@@ -166,6 +167,15 @@ static int do_isofs_readdir(struct inode *inode, struct file *filp,
 			de = tmpde;
 		}
 
+		if (first_de) {
+			isofs_normalize_block_and_offset(de,
+							 &block_saved,
+							 &offset_saved);
+			inode_number = isofs_get_ino(block_saved,
+						     offset_saved,
+						     bufbits);
+		}
+
 		if (de->flags[-sbi->s_high_sierra] & 0x80) {
 			first_de = 0;
 			filp->f_pos += de_len;
diff --git a/fs/isofs/inode.c b/fs/isofs/inode.c
index 768367ef9..491dcde30 100644
--- a/fs/isofs/inode.c
+++ b/fs/isofs/inode.c
@@ -7,6 +7,8 @@
  *      1995  Mark Dobie - allow mounting of some weird VideoCDs and PhotoCDs.
  *	1997  Gordon Chaffee - Joliet CDs
  *	1998  Eric Lammerts - ISO 9660 Level 3
+ *	2004  Paul Serice - Inode Support pushed out from 4GB to 128GB
+ *	2004  Paul Serice - NFS Export Operations
  */
 
 #include <linux/config.h>
@@ -135,20 +137,6 @@ static struct super_operations isofs_sops = {
 	.remount_fs	= isofs_remount,
 };
 
-/* the export_operations structure for describing
- * how to export (e.g. via kNFSd) is deliberately
- * empty.
- * This means that the filesystem want to use iget
- * to map an inode number into an inode.
- * The lack of a get_parent operation means that 
- * if something isn't in the cache, then you cannot
- * access it.
- * It should be possible to write a get_parent,
- * but it would be a bit hairy...
- */
-static struct export_operations isofs_export_ops = {
-};
-
 
 static struct dentry_operations isofs_dentry_ops[] = {
 	{
@@ -738,19 +726,14 @@ root_found:
 	/* Set this for reference. Its not currently used except on write
 	   which we don't have .. */
 	   
-	/* RDE: data zone now byte offset! */
-
-	first_data_zone = ((isonum_733 (rootp->extent) +
-			  isonum_711 (rootp->ext_attr_length))
-			 << sbi->s_log_zone_size);
+	first_data_zone = isonum_733 (rootp->extent) +
+			  isonum_711 (rootp->ext_attr_length);
 	sbi->s_firstdatazone = first_data_zone;
 #ifndef BEQUIET
 	printk(KERN_DEBUG "Max size:%ld   Log zone size:%ld\n",
 	       sbi->s_max_size,
 	       1UL << sbi->s_log_zone_size);
-	printk(KERN_DEBUG "First datazone:%ld   Root inode number:%ld\n",
-	       sbi->s_firstdatazone >> sbi->s_log_zone_size,
-	       sbi->s_firstdatazone);
+	printk(KERN_DEBUG "First datazone:%ld\n", sbi->s_firstdatazone);
 	if(sbi->s_high_sierra)
 		printk(KERN_DEBUG "Disc in High Sierra format.\n");
 #endif
@@ -767,9 +750,8 @@ root_found:
 		pri = (struct iso_primary_descriptor *) sec;
 		rootp = (struct iso_directory_record *)
 			pri->root_directory_record;
-		first_data_zone = ((isonum_733 (rootp->extent) +
-			  	isonum_711 (rootp->ext_attr_length))
-				 << sbi->s_log_zone_size);
+		first_data_zone = isonum_733 (rootp->extent) +
+			  	isonum_711 (rootp->ext_attr_length);
 	}
 
 	/*
@@ -835,7 +817,7 @@ root_found:
 	 * the s_rock flag. Once we have the final s_rock value,
 	 * we then decide whether to use the Joliet descriptor.
 	 */
-	inode = iget(s, sbi->s_firstdatazone);
+	inode = isofs_iget(s, sbi->s_firstdatazone, 0);
 
 	/*
 	 * If this disk has both Rock Ridge and Joliet on it, then we
@@ -854,7 +836,7 @@ root_found:
 			printk(KERN_DEBUG 
 				"ISOFS: changing to secondary root\n");
 			iput(inode);
-			inode = iget(s, sbi->s_firstdatazone);
+			inode = isofs_iget(s, sbi->s_firstdatazone, 0);
 		}
 	}
 
@@ -952,7 +934,7 @@ int isofs_get_blocks(struct inode *inode, sector_t iblock_s,
 	unsigned long b_off;
 	unsigned offset, sect_size;
 	unsigned int firstext;
-	unsigned long nextino;
+	unsigned long nextblk, nextoff;
 	long iblock = (long)iblock_s;
 	int section, rv;
 	struct iso_inode_info *ei = ISOFS_I(inode);
@@ -970,7 +952,8 @@ int isofs_get_blocks(struct inode *inode, sector_t iblock_s,
 	offset    = 0;
 	firstext  = ei->i_first_extent;
 	sect_size = ei->i_section_size >> ISOFS_BUFFER_BITS(inode);
-	nextino   = ei->i_next_section_ino;
+	nextblk   = ei->i_next_section_block;
+	nextoff   = ei->i_next_section_offset;
 	section   = 0;
 
 	while ( nblocks ) {
@@ -987,25 +970,28 @@ int isofs_get_blocks(struct inode *inode, sector_t iblock_s,
 			goto abort;
 		}
 		
-		if (nextino) {
+		if (nextblk) {
 			while (b_off >= (offset + sect_size)) {
 				struct inode *ninode;
 				
 				offset += sect_size;
-				if (nextino == 0)
+				if (nextblk == 0)
 					goto abort;
-				ninode = iget(inode->i_sb, nextino);
+				ninode = isofs_iget(inode->i_sb, nextblk, nextoff);
 				if (!ninode)
 					goto abort;
 				firstext  = ISOFS_I(ninode)->i_first_extent;
-				sect_size = ISOFS_I(ninode)->i_section_size;
-				nextino   = ISOFS_I(ninode)->i_next_section_ino;
+				sect_size = ISOFS_I(ninode)->i_section_size >> ISOFS_BUFFER_BITS(ninode);
+				nextblk   = ISOFS_I(ninode)->i_next_section_block;
+				nextoff   = ISOFS_I(ninode)->i_next_section_offset;
 				iput(ninode);
 				
 				if (++section > 100) {
 					printk("isofs_get_blocks: More than 100 file sections ?!?, aborting...\n");
-					printk("isofs_get_blocks: ino=%lu block=%ld firstext=%u sect_size=%u nextino=%lu\n",
-					       inode->i_ino, iblock, firstext, (unsigned) sect_size, nextino);
+					printk("isofs_get_blocks: block=%ld firstext=%u sect_size=%u "
+					       "nextblk=%lu nextoff=%lu\n",
+					       iblock, firstext, (unsigned) sect_size,
+					       nextblk, nextoff);
 					goto abort;
 				}
 			}
@@ -1044,7 +1030,7 @@ static int isofs_get_block(struct inode *inode, sector_t iblock,
 	return isofs_get_blocks(inode, iblock, &bh_result, 1) ? 0 : -EIO;
 }
 
-static int isofs_bmap(struct inode *inode, int block)
+static int isofs_bmap(struct inode *inode, sector_t block)
 {
 	struct buffer_head dummy;
 	int error;
@@ -1097,21 +1083,25 @@ static inline void test_and_set_gid(gid_t *p, gid_t value)
 
 static int isofs_read_level3_size(struct inode * inode)
 {
-	unsigned long f_pos = inode->i_ino;
 	unsigned long bufsize = ISOFS_BUFFER_SIZE(inode);
 	int high_sierra = ISOFS_SB(inode->i_sb)->s_high_sierra;
 	struct buffer_head * bh = NULL;
-	unsigned long block, offset;
+	unsigned long block, offset, block_saved, offset_saved;
 	int i = 0;
 	int more_entries = 0;
 	struct iso_directory_record * tmpde = NULL;
 	struct iso_inode_info *ei = ISOFS_I(inode);
 
 	inode->i_size = 0;
-	ei->i_next_section_ino = 0;
 
-	block = f_pos >> ISOFS_BUFFER_BITS(inode);
-	offset = f_pos & (bufsize-1);
+	/* The first 16 blocks are reserved as the System Area.  Thus,
+	 * no inodes can appear in block 0.  We use this to flag that
+	 * this is the last section. */
+	ei->i_next_section_block = 0;
+	ei->i_next_section_offset = 0;
+
+	block = ei->i_iget5_block;
+	offset = ei->i_iget5_offset;
 
 	do {
 		struct iso_directory_record * de;
@@ -1128,12 +1118,13 @@ static int isofs_read_level3_size(struct inode * inode)
 		if (de_len == 0) {
 			brelse(bh);
 			bh = NULL;
-			f_pos = (f_pos + ISOFS_BLOCK_SIZE) & ~(ISOFS_BLOCK_SIZE - 1);
-			block = f_pos >> ISOFS_BUFFER_BITS(inode);
+			++block;
 			offset = 0;
 			continue;
 		}
 
+		block_saved = block;
+		offset_saved = offset;
 		offset += de_len;
 
 		/* Make sure we have a full directory entry */
@@ -1159,12 +1150,13 @@ static int isofs_read_level3_size(struct inode * inode)
 		}
 
 		inode->i_size += isonum_733(de->size);
-		if (i == 1)
-			ei->i_next_section_ino = f_pos;
+		if (i == 1) {
+			ei->i_next_section_block = block_saved;
+			ei->i_next_section_offset = offset_saved;
+		}
 
 		more_entries = de->flags[-high_sierra] & 0x80;
 
-		f_pos += de_len;
 		i++;
 		if(i > 100)
 			goto out_toomany;
@@ -1190,8 +1182,8 @@ out_noread:
 out_toomany:
 	printk(KERN_INFO "isofs_read_level3_size: "
 		"More than 100 file sections ?!?, aborting...\n"
-	  	"isofs_read_level3_size: inode=%lu ino=%lu\n",
-		inode->i_ino, f_pos);
+	  	"isofs_read_level3_size: inode=%lu\n",
+		inode->i_ino);
 	goto out;
 }
 
@@ -1200,21 +1192,22 @@ static void isofs_read_inode(struct inode * inode)
 	struct super_block *sb = inode->i_sb;
 	struct isofs_sb_info *sbi = ISOFS_SB(sb);
 	unsigned long bufsize = ISOFS_BUFFER_SIZE(inode);
-	int block = inode->i_ino >> ISOFS_BUFFER_BITS(inode);
+	unsigned long block;
 	int high_sierra = sbi->s_high_sierra;
 	struct buffer_head * bh = NULL;
 	struct iso_directory_record * de;
 	struct iso_directory_record * tmpde = NULL;
 	unsigned int de_len;
 	unsigned long offset;
-	int i;
 	struct iso_inode_info *ei = ISOFS_I(inode);
 
+	block = ei->i_iget5_block;
 	bh = sb_bread(inode->i_sb, block);
 	if (!bh)
 		goto out_badread;
 
-	offset = (inode->i_ino & (bufsize - 1));
+	offset = ei->i_iget5_offset;
+
 	de = (struct iso_directory_record *) (bh->b_data + offset);
 	de_len = *(unsigned char *) de;
 
@@ -1235,6 +1228,10 @@ static void isofs_read_inode(struct inode * inode)
 		de = tmpde;
 	}
 
+	inode->i_ino = isofs_get_ino(ei->i_iget5_block,
+				     ei->i_iget5_offset,
+				     ISOFS_BUFFER_BITS(inode));
+
 	/* Assume it is a normal-format file unless told otherwise */
 	ei->i_file_format = isofs_file_normal;
 
@@ -1250,14 +1247,6 @@ static void isofs_read_inode(struct inode * inode)
 		inode->i_mode = sbi->s_mode;
 		inode->i_nlink = 1;
 	        inode->i_mode |= S_IFREG;
-		/* If there are no periods in the name,
-		 * then set the execute permission bit
-		 */
-		for(i=0; i< de->name_len[0]; i++)
-			if(de->name[i]=='.' || de->name[i]==';')
-				break;
-		if(i == de->name_len[0] || de->name[i] == ';')
-			inode->i_mode |= S_IXUGO; /* execute permission */
 	}
 	inode->i_uid = sbi->s_uid;
 	inode->i_gid = sbi->s_gid;
@@ -1271,35 +1260,19 @@ static void isofs_read_inode(struct inode * inode)
 	if(de->flags[-high_sierra] & 0x80) {
 		if(isofs_read_level3_size(inode)) goto fail;
 	} else {
-		ei->i_next_section_ino = 0;
+		ei->i_next_section_block = 0;
+		ei->i_next_section_offset = 0;
 		inode->i_size = isonum_733 (de->size);
 	}
 
-	/*
-	 * The ISO-9660 filesystem only stores 32 bits for file size.
-	 * mkisofs handles files up to 2GB-2 = 2147483646 = 0x7FFFFFFE bytes
-	 * in size. This is according to the large file summit paper from 1996.
-	 * WARNING: ISO-9660 filesystems > 1 GB and even > 2 GB are fully
-	 *	    legal. Do not prevent to use DVD's schilling@fokus.gmd.de
-	 */
-	if ((inode->i_size < 0 || inode->i_size > 0x7FFFFFFE) &&
-	    sbi->s_cruft == 'n') {
-		printk(KERN_WARNING "Warning: defective CD-ROM.  "
-		       "Enabling \"cruft\" mount option.\n");
-		sbi->s_cruft = 'y';
-	}
-
 	/*
 	 * Some dipshit decided to store some other bit of information
-	 * in the high byte of the file length.  Catch this and holler.
-	 * WARNING: this will make it impossible for a file to be > 16MB
-	 * on the CDROM.
+	 * in the high byte of the file length.  Truncate size in case
+	 * this CDROM was mounted with the cruft option.
 	 */
 
-	if (sbi->s_cruft == 'y' &&
-	    inode->i_size & 0xff000000) {
+	if (sbi->s_cruft == 'y')
 		inode->i_size &= 0x00ffffff;
-	}
 
 	if (de->interleave[0]) {
 		printk("Interleaved files not (yet) supported.\n");
@@ -1385,6 +1358,61 @@ static void isofs_read_inode(struct inode * inode)
 	goto out;
 }
 
+struct isofs_iget5_callback_data {
+	unsigned long block;
+	unsigned long offset;
+};
+
+static int isofs_iget5_test(struct inode *ino, void *data)
+{
+	struct iso_inode_info *i = ISOFS_I(ino);
+	struct isofs_iget5_callback_data *d =
+		(struct isofs_iget5_callback_data*)data;
+	return (i->i_iget5_block == d->block)
+	       && (i->i_iget5_offset == d->offset);
+}
+
+static int isofs_iget5_set(struct inode *ino, void *data)
+{
+	struct iso_inode_info *i = ISOFS_I(ino);
+	struct isofs_iget5_callback_data *d =
+		(struct isofs_iget5_callback_data*)data;
+	i->i_iget5_block = d->block;
+	i->i_iget5_offset = d->offset;
+	return 0;
+}
+
+/* Store, in the inode's containing structure, the block and block
+ * offset that point to the underlying meta-data for the inode.  The
+ * code below is otherwise similar to the iget() code in
+ * include/linux/fs.h */
+struct inode *isofs_iget(struct super_block *sb,
+			 unsigned long block,
+			 unsigned long offset)
+{
+	unsigned long hashval;
+	struct inode *inode;
+	struct isofs_iget5_callback_data data;
+
+	data.block = block;
+	data.offset = offset;
+
+	hashval = (block << sb->s_blocksize_bits) | offset;
+
+	inode = iget5_locked(sb,
+			     hashval,
+			     &isofs_iget5_test,
+			     &isofs_iget5_set,
+			     &data);
+
+	if (inode && (inode->i_state & I_NEW)) {
+		sb->s_op->read_inode(inode);
+		unlock_new_inode(inode);
+	}
+
+	return inode;
+}
+
 #ifdef LEAK_CHECK
 #undef malloc
 #undef free_s
diff --git a/fs/isofs/namei.c b/fs/isofs/namei.c
index 8d525f6bf..9569fc441 100644
--- a/fs/isofs/namei.c
+++ b/fs/isofs/namei.c
@@ -17,6 +17,7 @@
 #include <linux/config.h>	/* Joliet? */
 #include <linux/smp_lock.h>
 #include <linux/buffer_head.h>
+#include <linux/dcache.h>
 
 #include <asm/uaccess.h>
 
@@ -59,12 +60,12 @@ isofs_cmp(struct dentry * dentry, const char * compare, int dlen)
  */
 static unsigned long
 isofs_find_entry(struct inode *dir, struct dentry *dentry,
+	unsigned long *block_rv, unsigned long* offset_rv,
 	char * tmpname, struct iso_directory_record * tmpde)
 {
-	unsigned long inode_number;
 	unsigned long bufsize = ISOFS_BUFFER_SIZE(dir);
 	unsigned char bufbits = ISOFS_BUFFER_BITS(dir);
-	unsigned int block, f_pos, offset;
+	unsigned long block, f_pos, offset, block_saved, offset_saved;
 	struct buffer_head * bh = NULL;
 	struct isofs_sb_info *sbi = ISOFS_SB(dir->i_sb);
 
@@ -87,7 +88,6 @@ isofs_find_entry(struct inode *dir, struct dentry *dentry,
 		}
 
 		de = (struct iso_directory_record *) (bh->b_data + offset);
-		inode_number = (bh->b_blocknr << bufbits) + offset;
 
 		de_len = *(unsigned char *) de;
 		if (!de_len) {
@@ -99,6 +99,8 @@ isofs_find_entry(struct inode *dir, struct dentry *dentry,
 			continue;
 		}
 
+		block_saved = bh->b_blocknr;
+		offset_saved = offset;
 		offset += de_len;
 		f_pos += de_len;
 
@@ -150,8 +152,13 @@ isofs_find_entry(struct inode *dir, struct dentry *dentry,
 			match = (isofs_cmp(dentry,dpnt,dlen) == 0);
 		}
 		if (match) {
+			isofs_normalize_block_and_offset(de,
+							 &block_saved,
+							 &offset_saved);
+                        *block_rv = block_saved;
+                        *offset_rv = offset_saved;
 			if (bh) brelse(bh);
-			return inode_number;
+			return 1;
 		}
 	}
 	if (bh) brelse(bh);
@@ -160,7 +167,8 @@ isofs_find_entry(struct inode *dir, struct dentry *dentry,
 
 struct dentry *isofs_lookup(struct inode * dir, struct dentry * dentry, struct nameidata *nd)
 {
-	unsigned long ino;
+	int found;
+	unsigned long block, offset;
 	struct inode *inode;
 	struct page *page;
 
@@ -171,19 +179,23 @@ struct dentry *isofs_lookup(struct inode * dir, struct dentry * dentry, struct n
 		return ERR_PTR(-ENOMEM);
 
 	lock_kernel();
-	ino = isofs_find_entry(dir, dentry, page_address(page),
-			       1024 + page_address(page));
+	found = isofs_find_entry(dir, dentry,
+				 &block, &offset,
+				 page_address(page),
+				 1024 + page_address(page));
 	__free_page(page);
 
 	inode = NULL;
-	if (ino) {
-		inode = iget(dir->i_sb, ino);
+	if (found) {
+		inode = isofs_iget(dir->i_sb, block, offset);
 		if (!inode) {
 			unlock_kernel();
 			return ERR_PTR(-EACCES);
 		}
 	}
 	unlock_kernel();
+	if (inode)
+		return d_splice_alias(inode, dentry);
 	d_add(dentry, inode);
 	return NULL;
 }
diff --git a/fs/isofs/rock.c b/fs/isofs/rock.c
index 088acdcc9..c09d4bd4b 100644
--- a/fs/isofs/rock.c
+++ b/fs/isofs/rock.c
@@ -41,7 +41,7 @@
 
 #define CONTINUE_DECLS \
   int cont_extent = 0, cont_offset = 0, cont_size = 0;   \
-  void * buffer = 0
+  void *buffer = NULL
 
 #define CHECK_CE	       			\
       {cont_extent = isonum_733(rr->u.CE.extent); \
@@ -306,9 +306,7 @@ int parse_rock_ridge_inode_internal(struct iso_directory_record * de,
 	goto out;
       case SIG('C','L'):
 	ISOFS_I(inode)->i_first_extent = isonum_733(rr->u.CL.location);
-	reloc = iget(inode->i_sb,
-		     (ISOFS_I(inode)->i_first_extent <<
-		      ISOFS_SB(inode->i_sb)->s_log_zone_size));
+	reloc = isofs_iget(inode->i_sb, ISOFS_I(inode)->i_first_extent, 0);
 	if (!reloc)
 		goto out;
 	inode->i_mode = reloc->i_mode;
@@ -447,15 +445,15 @@ int parse_rock_ridge_inode(struct iso_directory_record * de,
 static int rock_ridge_symlink_readpage(struct file *file, struct page *page)
 {
 	struct inode *inode = page->mapping->host;
+        struct iso_inode_info *ei = ISOFS_I(inode);
 	char *link = kmap(page);
 	unsigned long bufsize = ISOFS_BUFFER_SIZE(inode);
-	unsigned char bufbits = ISOFS_BUFFER_BITS(inode);
 	struct buffer_head *bh;
 	char *rpnt = link;
 	unsigned char *pnt;
 	struct iso_directory_record *raw_inode;
 	CONTINUE_DECLS;
-	int block;
+	unsigned long block, offset;
 	int sig;
 	int len;
 	unsigned char *chr;
@@ -464,20 +462,21 @@ static int rock_ridge_symlink_readpage(struct file *file, struct page *page)
 	if (!ISOFS_SB(inode->i_sb)->s_rock)
 		panic ("Cannot have symlink with high sierra variant of iso filesystem\n");
 
-	block = inode->i_ino >> bufbits;
+	block = ei->i_iget5_block;
 	lock_kernel();
 	bh = sb_bread(inode->i_sb, block);
 	if (!bh)
 		goto out_noread;
 
-	pnt = (unsigned char *) bh->b_data + (inode->i_ino & (bufsize - 1));
+        offset = ei->i_iget5_offset;
+	pnt = (unsigned char *) bh->b_data + offset;
 
 	raw_inode = (struct iso_directory_record *) pnt;
 
 	/*
 	 * If we go past the end of the buffer, there is some sort of error.
 	 */
-	if ((inode->i_ino & (bufsize - 1)) + *pnt > bufsize)
+	if (offset + *pnt > bufsize)
 		goto out_bad_span;
 
 	/* Now test for possible Rock Ridge extensions which will override
diff --git a/fs/jbd/commit.c b/fs/jbd/commit.c
index c1eb3c536..a540c7f03 100644
--- a/fs/jbd/commit.c
+++ b/fs/jbd/commit.c
@@ -362,7 +362,7 @@ write_out_data:
 	 */
 	commit_transaction->t_state = T_COMMIT;
 
-	descriptor = 0;
+	descriptor = NULL;
 	bufs = 0;
 	while (commit_transaction->t_buffers) {
 
@@ -503,7 +503,7 @@ write_out_data:
 start_journal_io:
 			for (i = 0; i < bufs; i++) {
 				struct buffer_head *bh = wbuf[i];
-				set_buffer_locked(bh);
+				lock_buffer(bh);
 				clear_buffer_dirty(bh);
 				set_buffer_uptodate(bh);
 				bh->b_end_io = journal_end_buffer_io_sync;
diff --git a/fs/jbd/journal.c b/fs/jbd/journal.c
index a1e2a5d12..1cf23ff17 100644
--- a/fs/jbd/journal.c
+++ b/fs/jbd/journal.c
@@ -73,6 +73,7 @@ EXPORT_SYMBOL(journal_ack_err);
 EXPORT_SYMBOL(journal_clear_err);
 EXPORT_SYMBOL(log_wait_commit);
 EXPORT_SYMBOL(journal_start_commit);
+EXPORT_SYMBOL(journal_force_commit_nested);
 EXPORT_SYMBOL(journal_wipe);
 EXPORT_SYMBOL(journal_blocks_per_page);
 EXPORT_SYMBOL(journal_invalidatepage);
@@ -464,6 +465,39 @@ int log_start_commit(journal_t *journal, tid_t tid)
 	return ret;
 }
 
+/*
+ * Force and wait upon a commit if the calling process is not within
+ * transaction.  This is used for forcing out undo-protected data which contains
+ * bitmaps, when the fs is running out of space.
+ *
+ * We can only force the running transaction if we don't have an active handle;
+ * otherwise, we will deadlock.
+ *
+ * Returns true if a transaction was started.
+ */
+int journal_force_commit_nested(journal_t *journal)
+{
+	transaction_t *transaction = NULL;
+	tid_t tid;
+
+	spin_lock(&journal->j_state_lock);
+	if (journal->j_running_transaction && !current->journal_info) {
+		transaction = journal->j_running_transaction;
+		__log_start_commit(journal, transaction->t_tid);
+	} else if (journal->j_committing_transaction)
+		transaction = journal->j_committing_transaction;
+
+	if (!transaction) {
+		spin_unlock(&journal->j_state_lock);
+		return 0;	/* Nothing to retry */
+	}
+
+	tid = transaction->t_tid;
+	spin_unlock(&journal->j_state_lock);
+	log_wait_commit(journal, tid);
+	return 1;
+}
+
 /*
  * Start a commit of the current running transaction (if any).  Returns true
  * if a transaction was started, and fills its tid in at *ptid
@@ -1583,7 +1617,7 @@ static void journal_destroy_journal_head_cache(void)
 {
 	J_ASSERT(journal_head_cache != NULL);
 	kmem_cache_destroy(journal_head_cache);
-	journal_head_cache = 0;
+	journal_head_cache = NULL;
 }
 
 /*
diff --git a/fs/jbd/revoke.c b/fs/jbd/revoke.c
index 6bbd73644..87cd0501d 100644
--- a/fs/jbd/revoke.c
+++ b/fs/jbd/revoke.c
@@ -187,9 +187,9 @@ int __init journal_init_revoke_caches(void)
 void journal_destroy_revoke_caches(void)
 {
 	kmem_cache_destroy(revoke_record_cache);
-	revoke_record_cache = 0;
+	revoke_record_cache = NULL;
 	kmem_cache_destroy(revoke_table_cache);
-	revoke_table_cache = 0;
+	revoke_table_cache = NULL;
 }
 
 /* Initialise the revoke table for a given journal to a given size. */
diff --git a/fs/jbd/transaction.c b/fs/jbd/transaction.c
index 21ddf0b28..18a678ce2 100644
--- a/fs/jbd/transaction.c
+++ b/fs/jbd/transaction.c
@@ -320,7 +320,7 @@ int journal_extend(handle_t *handle, int nblocks)
 
 	result = -EIO;
 	if (is_handle_aborted(handle))
-		goto error_out;
+		goto out;
 
 	result = 1;
 
@@ -357,6 +357,7 @@ unlock:
 	spin_unlock(&transaction->t_handle_lock);
 error_out:
 	spin_unlock(&journal->j_state_lock);
+out:
 	return result;
 }
 
@@ -1480,7 +1481,7 @@ __blist_del_buffer(struct journal_head **list, struct journal_head *jh)
 	if (*list == jh) {
 		*list = jh->b_tnext;
 		if (*list == jh)
-			*list = 0;
+			*list = NULL;
 	}
 	jh->b_tprev->b_tnext = jh->b_tnext;
 	jh->b_tnext->b_tprev = jh->b_tprev;
@@ -1499,7 +1500,7 @@ __blist_del_buffer(struct journal_head **list, struct journal_head *jh)
  */
 void __journal_unfile_buffer(struct journal_head *jh)
 {
-	struct journal_head **list = 0;
+	struct journal_head **list = NULL;
 	transaction_t *transaction;
 	struct buffer_head *bh = jh2bh(jh);
 
@@ -1772,14 +1773,10 @@ static int journal_unmap_buffer(journal_t *journal, struct buffer_head *bh)
 	jbd_lock_bh_state(bh);
 	spin_lock(&journal->j_list_lock);
 
-	/*
-	 * Now we have the locks, check again to see whether kjournald has
-	 * taken the buffer off the transaction.
-	 */
-	if (!buffer_jbd(bh))
-		goto zap_buffer;
+	jh = journal_grab_journal_head(bh);
+	if (!jh)
+		goto zap_buffer_no_jh;
 
-	jh = bh2jh(bh);
 	transaction = jh->b_transaction;
 	if (transaction == NULL) {
 		/* First case: not on any transaction.  If it
@@ -1810,6 +1807,7 @@ static int journal_unmap_buffer(journal_t *journal, struct buffer_head *bh)
 			spin_unlock(&journal->j_list_lock);
 			jbd_unlock_bh_state(bh);
 			spin_unlock(&journal->j_state_lock);
+			journal_put_journal_head(jh);
 			return ret;
 		} else {
 			/* There is no currently-running transaction. So the
@@ -1823,6 +1821,7 @@ static int journal_unmap_buffer(journal_t *journal, struct buffer_head *bh)
 				spin_unlock(&journal->j_list_lock);
 				jbd_unlock_bh_state(bh);
 				spin_unlock(&journal->j_state_lock);
+				journal_put_journal_head(jh);
 				return ret;
 			} else {
 				/* The orphan record's transaction has
@@ -1846,6 +1845,7 @@ static int journal_unmap_buffer(journal_t *journal, struct buffer_head *bh)
 		spin_unlock(&journal->j_list_lock);
 		jbd_unlock_bh_state(bh);
 		spin_unlock(&journal->j_state_lock);
+		journal_put_journal_head(jh);
 		return 0;
 	} else {
 		/* Good, the buffer belongs to the running transaction.
@@ -1859,6 +1859,8 @@ static int journal_unmap_buffer(journal_t *journal, struct buffer_head *bh)
 	}
 
 zap_buffer:
+	journal_put_journal_head(jh);
+zap_buffer_no_jh:
 	spin_unlock(&journal->j_list_lock);
 	jbd_unlock_bh_state(bh);
 	spin_unlock(&journal->j_state_lock);
@@ -1930,7 +1932,7 @@ int journal_invalidatepage(journal_t *journal,
 void __journal_file_buffer(struct journal_head *jh,
 			transaction_t *transaction, int jlist)
 {
-	struct journal_head **list = 0;
+	struct journal_head **list = NULL;
 	int was_dirty = 0;
 	struct buffer_head *bh = jh2bh(jh);
 
diff --git a/fs/jffs/inode-v23.c b/fs/jffs/inode-v23.c
index 4d34ba69c..1173626ca 100644
--- a/fs/jffs/inode-v23.c
+++ b/fs/jffs/inode-v23.c
@@ -315,7 +315,7 @@ jffs_setattr(struct dentry *dentry, struct iattr *iattr)
 	}
 
 	/* Write this node to the flash.  */
-	if ((res = jffs_write_node(c, new_node, &raw_inode, f->name, 0, recoverable, f)) < 0) {
+	if ((res = jffs_write_node(c, new_node, &raw_inode, f->name, NULL, recoverable, f)) < 0) {
 		D(printk("jffs_notify_change(): The write failed!\n"));
 		jffs_free_node(new_node);
 		D3(printk (KERN_NOTICE "n_c(): up biglock\n"));
@@ -323,7 +323,7 @@ jffs_setattr(struct dentry *dentry, struct iattr *iattr)
 		goto out;
 	}
 
-	jffs_insert_node(c, f, &raw_inode, 0, new_node);
+	jffs_insert_node(c, f, &raw_inode, NULL, new_node);
 
 	mark_inode_dirty(inode);
 	D3(printk (KERN_NOTICE "n_c(): up biglock\n"));
@@ -879,14 +879,14 @@ jffs_mkdir(struct inode *dir, struct dentry *dentry, int mode)
 
 	/* Write the new node to the flash.  */
 	if ((result = jffs_write_node(c, node, &raw_inode,
-				      dentry->d_name.name, 0, 0, NULL)) < 0) {
+				     dentry->d_name.name, NULL, 0, NULL)) < 0) {
 		D(printk("jffs_mkdir(): jffs_write_node() failed.\n"));
 		jffs_free_node(node);
 		goto jffs_mkdir_end;
 	}
 
 	/* Insert the new node into the file system.  */
-	if ((result = jffs_insert_node(c, 0, &raw_inode, dentry->d_name.name,
+	if ((result = jffs_insert_node(c, NULL, &raw_inode, dentry->d_name.name,
 				       node)) < 0) {
 		goto jffs_mkdir_end;
 	}
@@ -959,7 +959,7 @@ jffs_remove(struct inode *dir, struct dentry *dentry, int type)
 	struct jffs_file *dir_f; /* The file-to-remove's parent.  */
 	struct jffs_file *del_f; /* The file to remove.  */
 	struct jffs_node *del_node;
-	struct inode *inode = 0;
+	struct inode *inode = NULL;
 	int result = 0;
 
 	D1({
@@ -1041,7 +1041,7 @@ jffs_remove(struct inode *dir, struct dentry *dentry, int type)
 	raw_inode.deleted = 1;
 
 	/* Write the new node to the flash memory.  */
-	if (jffs_write_node(c, del_node, &raw_inode, 0, 0, 1, del_f) < 0) {
+	if (jffs_write_node(c, del_node, &raw_inode, NULL, NULL, 1, del_f) < 0) {
 		jffs_free_node(del_node);
 		result = -EIO;
 		goto jffs_remove_end;
@@ -1049,7 +1049,7 @@ jffs_remove(struct inode *dir, struct dentry *dentry, int type)
 
 	/* Update the file.  This operation will make the file disappear
 	   from the in-memory file system structures.  */
-	jffs_insert_node(c, del_f, &raw_inode, 0, del_node);
+	jffs_insert_node(c, del_f, &raw_inode, NULL, del_node);
 
 	dir->i_ctime = dir->i_mtime = CURRENT_TIME;
 	mark_inode_dirty(dir);
@@ -1070,7 +1070,7 @@ jffs_mknod(struct inode *dir, struct dentry *dentry, int mode, dev_t rdev)
 {
 	struct jffs_raw_inode raw_inode;
 	struct jffs_file *dir_f;
-	struct jffs_node *node = 0;
+	struct jffs_node *node = NULL;
 	struct jffs_control *c;
 	struct inode *inode;
 	int result = 0;
@@ -1127,7 +1127,7 @@ jffs_mknod(struct inode *dir, struct dentry *dentry, int mode, dev_t rdev)
 	}
 
 	/* Insert the new node into the file system.  */
-	if ((err = jffs_insert_node(c, 0, &raw_inode, dentry->d_name.name,
+	if ((err = jffs_insert_node(c, NULL, &raw_inode, dentry->d_name.name,
 				    node)) < 0) {
 		result = err;
 		goto jffs_mknod_end;
@@ -1237,7 +1237,7 @@ jffs_symlink(struct inode *dir, struct dentry *dentry, const char *symname)
 	}
 
 	/* Insert the new node into the file system.  */
-	if ((err = jffs_insert_node(c, 0, &raw_inode, dentry->d_name.name,
+	if ((err = jffs_insert_node(c, NULL, &raw_inode, dentry->d_name.name,
 				    node)) < 0) {
 		goto jffs_symlink_end;
 	}
@@ -1333,14 +1333,14 @@ jffs_create(struct inode *dir, struct dentry *dentry, int mode,
 
 	/* Write the new node to the flash.  */
 	if ((err = jffs_write_node(c, node, &raw_inode,
-				   dentry->d_name.name, 0, 0, NULL)) < 0) {
+				   dentry->d_name.name, NULL, 0, NULL)) < 0) {
 		D(printk("jffs_create(): jffs_write_node() failed.\n"));
 		jffs_free_node(node);
 		goto jffs_create_end;
 	}
 
 	/* Insert the new node into the file system.  */
-	if ((err = jffs_insert_node(c, 0, &raw_inode, dentry->d_name.name,
+	if ((err = jffs_insert_node(c, NULL, &raw_inode, dentry->d_name.name,
 				    node)) < 0) {
 		goto jffs_create_end;
 	}
@@ -1501,7 +1501,7 @@ jffs_file_write(struct file *filp, const char *buf, size_t count,
 		pos += err;
 
 		/* Insert the new node into the file system.  */
-		if ((err = jffs_insert_node(c, f, &raw_inode, 0, node)) < 0) {
+		if ((err = jffs_insert_node(c, f, &raw_inode, NULL, node)) < 0) {
 			goto out;
 		}
 
@@ -1750,7 +1750,7 @@ jffs_delete_inode(struct inode *inode)
 	lock_kernel();
 	inode->i_size = 0;
 	inode->i_blocks = 0;
-	inode->u.generic_ip = 0;
+	inode->u.generic_ip = NULL;
 	clear_inode(inode);
 	if (inode->i_nlink == 0) {
 		c = (struct jffs_control *) inode->i_sb->s_fs_info;
diff --git a/fs/jffs/intrep.c b/fs/jffs/intrep.c
index 816f07676..273a3c9cc 100644
--- a/fs/jffs/intrep.c
+++ b/fs/jffs/intrep.c
@@ -209,7 +209,7 @@ flash_safe_write(struct mtd_info *mtd, loff_t to,
 
 
 static int
-flash_safe_writev(struct mtd_info *mtd, const struct iovec *vecs,
+flash_safe_writev(struct mtd_info *mtd, const struct kvec *vecs,
 			unsigned long iovec_cnt, loff_t to)
 {
 	size_t retlen, retlen_a;
@@ -409,7 +409,7 @@ jffs_create_file(struct jffs_control *c,
 	if (!(f = (struct jffs_file *)kmalloc(sizeof(struct jffs_file),
 					      GFP_KERNEL))) {
 		D(printk("jffs_create_file(): Failed!\n"));
-		return 0;
+		return NULL;
 	}
 	no_jffs_file++;
 	memset(f, 0, sizeof(struct jffs_file));
@@ -438,8 +438,8 @@ jffs_create_control(struct super_block *sb)
 		goto fail_control;
 	}
 	DJM(no_jffs_control++);
-	c->root = 0;
-	c->gc_task = 0;
+	c->root = NULL;
+	c->gc_task = NULL;
 	c->hash_len = JFFS_HASH_SIZE;
 	s = sizeof(struct list_head) * c->hash_len;
 	if (!(c->hash = (struct list_head *)kmalloc(s, GFP_KERNEL))) {
@@ -752,7 +752,7 @@ jffs_scan_flash(struct jffs_control *c)
 {
 	char name[JFFS_MAX_NAME_LEN + 2];
 	struct jffs_raw_inode raw_inode;
-	struct jffs_node *node = 0;
+	struct jffs_node *node = NULL;
 	struct jffs_fmcontrol *fmc = c->fmc;
 	__u32 checksum;
 	__u8 tmp_accurate;
@@ -904,7 +904,7 @@ jffs_scan_flash(struct jffs_control *c)
 				        D1(printk("Dirty space: Starting 0x%x for 0x%x bytes\n",
 						  (unsigned int) start, (unsigned int) (pos - start)));
 					jffs_fmalloced(fmc, (__u32) start,
-						       (__u32) (pos - start), 0);
+						       (__u32) (pos - start), NULL);
 				}else{
 					/* "Flipping bits" detected. This means that our scan for them
 					   did not catch this offset. See check_partly_erased_sectors() for
@@ -964,7 +964,7 @@ jffs_scan_flash(struct jffs_control *c)
 					 D1(printk("Dirty space: Starting 0x%x for 0x%x bytes\n",
 						   (unsigned int) start, (unsigned int) (pos - start)));
 					 jffs_fmalloced(fmc, (__u32) start,
-							(__u32) (pos - start), 0);				           
+							(__u32) (pos - start), NULL);				           
 				 }
 				 
 			}
@@ -986,7 +986,7 @@ jffs_scan_flash(struct jffs_control *c)
 			D1(printk("jffs_scan_flash(): 0x00 ended at "
 				  "pos 0x%lx.\n", (long)pos));
 			jffs_fmalloced(fmc, (__u32) start,
-				       (__u32) (pos - start), 0);
+				       (__u32) (pos - start), NULL);
 			continue;
 
 		case JFFS_MAGIC_BITMASK:
@@ -1020,7 +1020,7 @@ jffs_scan_flash(struct jffs_control *c)
 			   which really does contain crap. */
 			jffs_fmalloced(fmc, (__u32) start,
 				       (__u32) (pos - start),
-				       0);
+				       NULL);
 			
 			continue;
 		}/* switch */
@@ -1067,7 +1067,7 @@ jffs_scan_flash(struct jffs_control *c)
 				  checksum, raw_inode.chksum));
 			pos += sizeof(struct jffs_raw_inode);
 			jffs_fmalloced(fmc, (__u32) start,
-				       (__u32) (pos - start), 0);
+				       (__u32) (pos - start), NULL);
 			/* Reuse this unused struct jffs_node.  */
 			continue;
 		}
@@ -1121,7 +1121,7 @@ jffs_scan_flash(struct jffs_control *c)
 					  "raw_inode.nchksum = %u\n",
 					  checksum, raw_inode.nchksum));
 				jffs_fmalloced(fmc, (__u32) start,
-					       (__u32) (pos - start), 0);
+					       (__u32) (pos - start), NULL);
 				/* Reuse this unused struct jffs_node.  */
 				continue;
 			}
@@ -1139,7 +1139,7 @@ jffs_scan_flash(struct jffs_control *c)
 			if (jffs_checksum_flash(fmc->mtd, pos, raw_inode.dsize, &checksum)) {
 				printk("jffs_checksum_flash() failed to calculate a checksum\n");
 				jffs_fmalloced(fmc, (__u32) start,
-					       (__u32) (pos - start), 0);
+					       (__u32) (pos - start), NULL);
 				/* Reuse this unused struct jffs_node.  */
 				continue;
 			}				
@@ -1152,7 +1152,7 @@ jffs_scan_flash(struct jffs_control *c)
 					  "raw_inode.dchksum = %u\n",
 					  checksum, raw_inode.dchksum));
 				jffs_fmalloced(fmc, (__u32) start,
-					       (__u32) (pos - start), 0);
+					       (__u32) (pos - start), NULL);
 				/* Reuse this unused struct jffs_node.  */
 				continue;
 			}
@@ -1194,7 +1194,7 @@ jffs_scan_flash(struct jffs_control *c)
 
 				return -ENOMEM;
 			}
-			if ((err = jffs_insert_node(c, 0, &raw_inode,
+			if ((err = jffs_insert_node(c, NULL, &raw_inode,
 						    name, node)) < 0) {
 				printk("JFFS: Failed to handle raw inode. "
 				       "(err = %d)\n", err);
@@ -1224,11 +1224,11 @@ jffs_scan_flash(struct jffs_control *c)
 				node->data_size = 0;
 			}
 			D3(jffs_print_node(node));
-			node = 0; /* Don't free the node!  */
+			node = NULL; /* Don't free the node!  */
 		}
 		else {
 			jffs_fmalloced(fmc, (__u32) start,
-				       (__u32) (pos - start), 0);
+				       (__u32) (pos - start), NULL);
 			D3(printk("jffs_scan_flash(): Just found an obsolete "
 				  "raw_inode. Continuing the scan...\n"));
 			/* Reuse this unused struct jffs_node.  */
@@ -1312,8 +1312,8 @@ jffs_insert_node(struct jffs_control *c, struct jffs_file *f,
 		/* This is the first node.  */
 		f->version_head = node;
 		f->version_tail = node;
-		node->version_prev = 0;
-		node->version_next = 0;
+		node->version_prev = NULL;
+		node->version_next = NULL;
 		f->highest_version = node->version;
 		update_name = 1;
 		f->mode = raw_inode->mode;
@@ -1328,7 +1328,7 @@ jffs_insert_node(struct jffs_control *c, struct jffs_file *f,
 		/* Insert at the end of the list.  I.e. this node is the
 		   newest one so far.  */
 		node->version_prev = f->version_tail;
-		node->version_next = 0;
+		node->version_next = NULL;
 		f->version_tail->version_next = node;
 		f->version_tail = node;
 		f->highest_version = node->version;
@@ -1343,7 +1343,7 @@ jffs_insert_node(struct jffs_control *c, struct jffs_file *f,
 	}
 	else if (f->version_head->version > node->version) {
 		/* Insert at the bottom of the list.  */
-		node->version_prev = 0;
+		node->version_prev = NULL;
 		node->version_next = f->version_head;
 		f->version_head->version_prev = node;
 		f->version_head = node;
@@ -1556,9 +1556,9 @@ jffs_insert_file_into_tree(struct jffs_file *f)
 	if (!(parent = jffs_find_file(f->c, f->pino))) {
 		if (f->pino == 0) {
 			f->c->root = f;
-			f->parent = 0;
-			f->sibling_prev = 0;
-			f->sibling_next = 0;
+			f->parent = NULL;
+			f->sibling_prev = NULL;
+			f->sibling_next = NULL;
 			return 0;
 		}
 		else {
@@ -1573,7 +1573,7 @@ jffs_insert_file_into_tree(struct jffs_file *f)
 	if (f->sibling_next) {
 		f->sibling_next->sibling_prev = f;
 	}
-	f->sibling_prev = 0;
+	f->sibling_prev = NULL;
 	parent->children = f;
 	return 0;
 }
@@ -1740,7 +1740,7 @@ jffs_write_node(struct jffs_control *c, struct jffs_node *node,
 {
 	struct jffs_fmcontrol *fmc = c->fmc;
 	struct jffs_fm *fm;
-	struct iovec node_iovec[4];
+	struct kvec node_iovec[4];
 	unsigned long iovec_cnt;
 
 	__u32 pos;
@@ -2311,7 +2311,7 @@ jffs_insert_data(struct jffs_file *f, struct jffs_node *node)
 	retry:
 	if (node->data_offset == f->size) {
 		/* A simple append.  This is the most common operation.  */
-		node->range_next = 0;
+		node->range_next = NULL;
 		node->range_prev = f->range_tail;
 		if (node->range_prev) {
 			node->range_prev->range_next = node;
@@ -2389,10 +2389,10 @@ jffs_insert_data(struct jffs_file *f, struct jffs_node *node)
 		virtual_node->removed_size = 0;
 		virtual_node->fm_offset = 0;
 		virtual_node->name_size = 0;
-		virtual_node->fm = 0; /* This is a virtual data holder.  */
-		virtual_node->version_prev = 0;
-		virtual_node->version_next = 0;
-		virtual_node->range_next = 0;
+		virtual_node->fm = NULL; /* This is a virtual data holder.  */
+		virtual_node->version_prev = NULL;
+		virtual_node->version_next = NULL;
+		virtual_node->range_next = NULL;
 
 		/* Are there any data at all in the file yet?  */
 		if (f->range_head) {
@@ -2407,7 +2407,7 @@ jffs_insert_data(struct jffs_file *f, struct jffs_node *node)
 		else {
 			virtual_node->data_offset = 0;
 			virtual_node->data_size = node->data_offset;
-			virtual_node->range_prev = 0;
+			virtual_node->range_prev = NULL;
 			f->range_head = virtual_node;
 		}
 
diff --git a/fs/jffs/jffs_fm.c b/fs/jffs/jffs_fm.c
index 71cda0ca0..fae439d48 100644
--- a/fs/jffs/jffs_fm.c
+++ b/fs/jffs/jffs_fm.c
@@ -77,10 +77,10 @@ jffs_build_begin(struct jffs_control *c, int unit)
 	fmc->min_free_size = fmc->sector_size << 2;
 	fmc->mtd = mtd;
 	fmc->c = c;
-	fmc->head = 0;
-	fmc->tail = 0;
-	fmc->head_extra = 0;
-	fmc->tail_extra = 0;
+	fmc->head = NULL;
+	fmc->tail = NULL;
+	fmc->head_extra = NULL;
+	fmc->tail_extra = NULL;
 	init_MUTEX(&fmc->biglock);
 	return fmc;
 }
@@ -102,8 +102,8 @@ jffs_build_end(struct jffs_fmcontrol *fmc)
 		fmc->head->prev = fmc->tail_extra;
 		fmc->head = fmc->head_extra;
 	}
-	fmc->head_extra = 0; /* These two instructions should be omitted.  */
-	fmc->tail_extra = 0;
+	fmc->head_extra = NULL; /* These two instructions should be omitted.  */
+	fmc->tail_extra = NULL;
 	D3(jffs_print_fmcontrol(fmc));
 }
 
@@ -114,10 +114,9 @@ void
 jffs_cleanup_fmcontrol(struct jffs_fmcontrol *fmc)
 {
 	if (fmc) {
-		struct jffs_fm *cur;
 		struct jffs_fm *next = fmc->head;
-
-		while ((cur = next)) {
+		while (next) {
+			struct jffs_fm *cur = next;
 			next = next->next;
 			jffs_free_fm(cur);
 		}
@@ -205,7 +204,7 @@ jffs_fmalloc(struct jffs_fmcontrol *fmc, __u32 size, struct jffs_node *node,
 	D2(printk("jffs_fmalloc(): fmc = 0x%p, size = %d, "
 		  "node = 0x%p\n", fmc, size, node));
 
-	*result = 0;
+	*result = NULL;
 
 	if (!(fm = jffs_alloc_fm())) {
 		D(printk("jffs_fmalloc(): kmalloc() failed! (fm)\n"));
@@ -234,7 +233,7 @@ jffs_fmalloc(struct jffs_fmcontrol *fmc, __u32 size, struct jffs_node *node,
 		}
 		DJM(no_jffs_node_ref++);
 		fm->nodes->node = node;
-		fm->nodes->next = 0;
+		fm->nodes->next = NULL;
 		if (fmc->tail) {
 			fm->offset = fmc->tail->offset + fmc->tail->size;
 			if (fm->offset == fmc->flash_size) {
@@ -264,7 +263,7 @@ jffs_fmalloc(struct jffs_fmcontrol *fmc, __u32 size, struct jffs_node *node,
 	else {
 		fm->offset = fmc->tail->offset + fmc->tail->size;
 		fm->size = free_chunk_size1;
-		fm->nodes = 0;
+		fm->nodes = NULL;
 		fmc->free_size -= fm->size;
 		fmc->dirty_size += fm->size; /* Changed by simonk. This seemingly fixes a 
 						bug that caused infinite garbage collection.
@@ -273,9 +272,9 @@ jffs_fmalloc(struct jffs_fmcontrol *fmc, __u32 size, struct jffs_node *node,
 					     */
 	}
 
-	fm->next = 0;
+	fm->next = NULL;
 	if (!fmc->head) {
-		fm->prev = 0;
+		fm->prev = NULL;
 		fmc->head = fm;
 		fmc->tail = fm;
 	}
@@ -309,13 +308,13 @@ jffs_fmfree(struct jffs_fmcontrol *fmc, struct jffs_fm *fm, struct jffs_node *no
 	ASSERT(if (!fmc || !fm || !fm->nodes) {
 		printk(KERN_ERR "jffs_fmfree(): fmc: 0x%p, fm: 0x%p, "
 		       "fm->nodes: 0x%p\n",
-		       fmc, fm, (fm ? fm->nodes : 0));
+		       fmc, fm, (fm ? fm->nodes : NULL));
 		return -1;
 	});
 
 	/* Find the reference to the node that is going to be removed
 	   and remove it.  */
-	for (ref = fm->nodes, prev = 0; ref; ref = ref->next) {
+	for (ref = fm->nodes, prev = NULL; ref; ref = ref->next) {
 		if (ref->node == node) {
 			if (prev) {
 				prev->next = ref->next;
@@ -368,13 +367,13 @@ jffs_fmalloced(struct jffs_fmcontrol *fmc, __u32 offset, __u32 size,
 	if (!(fm = jffs_alloc_fm())) {
 		D(printk("jffs_fmalloced(0x%p, %u, %u, 0x%p): failed!\n",
 			 fmc, offset, size, node));
-		return 0;
+		return NULL;
 	}
 	fm->offset = offset;
 	fm->size = size;
-	fm->prev = 0;
-	fm->next = 0;
-	fm->nodes = 0;
+	fm->prev = NULL;
+	fm->next = NULL;
+	fm->nodes = NULL;
 	if (node) {
 		/* `node' exists and it should be associated with the
 		    jffs_fm structure `fm'.  */
@@ -383,11 +382,11 @@ jffs_fmalloced(struct jffs_fmcontrol *fmc, __u32 offset, __u32 size,
 					  GFP_KERNEL))) {
 			D(printk("jffs_fmalloced(): !fm->nodes\n"));
 			jffs_free_fm(fm);
-			return 0;
+			return NULL;
 		}
 		DJM(no_jffs_node_ref++);
 		fm->nodes->node = node;
-		fm->nodes->next = 0;
+		fm->nodes->next = NULL;
 		fmc->used_size += size;
 		fmc->free_size -= size;
 	}
@@ -454,7 +453,7 @@ jffs_fmfree_partly(struct jffs_fmcontrol *fmc, struct jffs_fm *fm, __u32 size)
 	if (fm->nodes) {
 		kfree(fm->nodes);
 		DJM(no_jffs_node_ref--);
-		fm->nodes = 0;
+		fm->nodes = NULL;
 	}
 	fmc->used_size -= fm->size;
 	if (fm == fmc->tail) {
@@ -476,12 +475,12 @@ jffs_cut_node(struct jffs_fmcontrol *fmc, __u32 size)
 	__u32 pos = 0;
 
 	if (size == 0) {
-		return 0;
+		return NULL;
 	}
 
 	ASSERT(if (!fmc) {
 		printk(KERN_ERR "jffs_cut_node(): fmc == NULL\n");
-		return 0;
+		return NULL;
 	});
 
 	fm = fmc->head;
@@ -495,7 +494,7 @@ jffs_cut_node(struct jffs_fmcontrol *fmc, __u32 size)
 			break;
 		}
 		else {
-			fm = 0;
+			fm = NULL;
 			break;
 		}
 	}
@@ -524,7 +523,7 @@ jffs_sync_erase(struct jffs_fmcontrol *fmc, int erased_size)
 			erased_size -= fm->size;
 			del = fm;
 			fm = fm->next;
-			fm->prev = 0;
+			fm->prev = NULL;
 			fmc->head = fm;
 			jffs_free_fm(del);
 		}
@@ -543,17 +542,17 @@ jffs_get_oldest_node(struct jffs_fmcontrol *fmc)
 {
 	struct jffs_fm *fm;
 	struct jffs_node_ref *nref;
-	struct jffs_node *node = 0;
+	struct jffs_node *node = NULL;
 
 	ASSERT(if (!fmc) {
 		printk(KERN_ERR "jffs_get_oldest_node(): fmc == NULL\n");
-		return 0;
+		return NULL;
 	});
 
 	for (fm = fmc->head; fm && !fm->nodes; fm = fm->next);
 
 	if (!fm) {
-		return 0;
+		return NULL;
 	}
 
 	/* The oldest node is the last one in the reference list.  This list
diff --git a/fs/jffs/jffs_proc.c b/fs/jffs/jffs_proc.c
index 0262c93ef..9bdd99a55 100644
--- a/fs/jffs/jffs_proc.c
+++ b/fs/jffs/jffs_proc.c
@@ -68,9 +68,9 @@ static int jffs_proc_layout_read (char *page, char **start, off_t off,
 int jffs_register_jffs_proc_dir(int mtd, struct jffs_control *c)
 {
 	struct jffs_partition_dir *part_dir;
-	struct proc_dir_entry *part_info = 0;
-	struct proc_dir_entry *part_layout = 0;
-	struct proc_dir_entry *part_root = 0;
+	struct proc_dir_entry *part_info = NULL;
+	struct proc_dir_entry *part_layout = NULL;
+	struct proc_dir_entry *part_root = NULL;
 	char name[10];
 
 	sprintf(name, "%d", mtd);
@@ -127,7 +127,7 @@ out:
 int jffs_unregister_jffs_proc_dir(struct jffs_control *c)
 {
 	struct jffs_partition_dir *part_dir = jffs_part_dirs;
-	struct jffs_partition_dir *prev_part_dir = 0;
+	struct jffs_partition_dir *prev_part_dir = NULL;
 
 	while (part_dir) {
 		if (part_dir->c == c) {
@@ -209,8 +209,8 @@ static int jffs_proc_layout_read (char *page, char **start, off_t off,
 		int count, int *eof, void *data)
 {
 	struct jffs_control *c = (struct jffs_control *) data;
-	struct jffs_fm *fm = 0;
-	struct jffs_fm *last_fm = 0;
+	struct jffs_fm *fm = NULL;
+	struct jffs_fm *last_fm = NULL;
 	int len = 0;
 
 	/* Get the first item in the list */
diff --git a/fs/jffs2/Makefile b/fs/jffs2/Makefile
index 1a47874c7..27eaa6a2b 100644
--- a/fs/jffs2/Makefile
+++ b/fs/jffs2/Makefile
@@ -1,15 +1,17 @@
 #
-# Makefile for the linux Journalling Flash FileSystem (JFFS) routines.
+# Makefile for the Linux Journalling Flash File System v2 (JFFS2)
 #
-# $Id: Makefile,v 1.34 2002/03/08 11:27:59 dwmw2 Exp $
+# $Id: Makefile.common,v 1.6 2004/07/16 15:17:57 dwmw2 Exp $
 #
 
 obj-$(CONFIG_JFFS2_FS) += jffs2.o
 
-jffs2-y	:= compr.o compr_rubin.o compr_rtime.o compr_zlib.o
-jffs2-y	+= dir.o file.o ioctl.o nodelist.o malloc.o
+jffs2-y	:= compr.o dir.o file.o ioctl.o nodelist.o malloc.o
 jffs2-y	+= read.o nodemgmt.o readinode.o write.o scan.o gc.o
 jffs2-y	+= symlink.o build.o erase.o background.o fs.o writev.o
 jffs2-y	+= super.o
 
 jffs2-$(CONFIG_JFFS2_FS_NAND)	+= wbuf.o
+jffs2-$(CONFIG_JFFS2_RUBIN)	+= compr_rubin.o
+jffs2-$(CONFIG_JFFS2_RTIME)	+= compr_rtime.o
+jffs2-$(CONFIG_JFFS2_ZLIB)	+= compr_zlib.o
diff --git a/fs/jffs2/background.c b/fs/jffs2/background.c
index 621231064..ac59ee35d 100644
--- a/fs/jffs2/background.c
+++ b/fs/jffs2/background.c
@@ -7,7 +7,7 @@
  *
  * For licensing information, see the file 'LICENCE' in this directory.
  *
- * $Id: background.c,v 1.44 2003/10/08 13:29:55 dwmw2 Exp $
+ * $Id: background.c,v 1.49 2004/07/13 08:56:40 dwmw2 Exp $
  *
  */
 
@@ -20,12 +20,11 @@
 
 
 static int jffs2_garbage_collect_thread(void *);
-static int thread_should_wake(struct jffs2_sb_info *c);
 
 void jffs2_garbage_collect_trigger(struct jffs2_sb_info *c)
 {
 	spin_lock(&c->erase_completion_lock);
-        if (c->gc_task && thread_should_wake(c))
+        if (c->gc_task && jffs2_thread_should_wake(c))
                 send_sig(SIGHUP, c->gc_task, 1);
 	spin_unlock(&c->erase_completion_lock);
 }
@@ -84,11 +83,11 @@ static int jffs2_garbage_collect_thread(void *_c)
 	for (;;) {
 		allow_signal(SIGHUP);
 
-		if (!thread_should_wake(c)) {
+		if (!jffs2_thread_should_wake(c)) {
 			set_current_state (TASK_INTERRUPTIBLE);
 			D1(printk(KERN_DEBUG "jffs2_garbage_collect_thread sleeping...\n"));
-			/* Yes, there's a race here; we checked thread_should_wake() before
-			   setting current->state to TASK_INTERRUPTIBLE. But it doesn't
+			/* Yes, there's a race here; we checked jffs2_thread_should_wake()
+			   before setting current->state to TASK_INTERRUPTIBLE. But it doesn't
 			   matter - We don't care if we miss a wakeup, because the GC thread
 			   is only an optimisation anyway. */
 			schedule();
@@ -144,34 +143,3 @@ static int jffs2_garbage_collect_thread(void *_c)
 	spin_unlock(&c->erase_completion_lock);
 	complete_and_exit(&c->gc_thread_exit, 0);
 }
-
-static int thread_should_wake(struct jffs2_sb_info *c)
-{
-	int ret = 0;
-	uint32_t dirty;
-
-	if (c->unchecked_size) {
-		D1(printk(KERN_DEBUG "thread_should_wake(): unchecked_size %d, checked_ino #%d\n",
-			  c->unchecked_size, c->checked_ino));
-		return 1;
-	}
-
-	/* dirty_size contains blocks on erase_pending_list
-	 * those blocks are counted in c->nr_erasing_blocks.
-	 * If one block is actually erased, it is not longer counted as dirty_space
-	 * but it is counted in c->nr_erasing_blocks, so we add it and subtract it
-	 * with c->nr_erasing_blocks * c->sector_size again.
-	 * Blocks on erasable_list are counted as dirty_size, but not in c->nr_erasing_blocks
-	 * This helps us to force gc and pick eventually a clean block to spread the load.
-	 */
-	dirty = c->dirty_size + c->erasing_size - c->nr_erasing_blocks * c->sector_size;
-
-	if (c->nr_free_blocks + c->nr_erasing_blocks < c->resv_blocks_gctrigger && 
-			(dirty > c->nospc_dirty_size)) 
-		ret = 1;
-
-	D1(printk(KERN_DEBUG "thread_should_wake(): nr_free_blocks %d, nr_erasing_blocks %d, dirty_size 0x%x: %s\n", 
-		  c->nr_free_blocks, c->nr_erasing_blocks, c->dirty_size, ret?"yes":"no"));
-
-	return ret;
-}
diff --git a/fs/jffs2/build.c b/fs/jffs2/build.c
index c05f64b5a..9b6e1d8e4 100644
--- a/fs/jffs2/build.c
+++ b/fs/jffs2/build.c
@@ -7,7 +7,7 @@
  *
  * For licensing information, see the file 'LICENCE' in this directory.
  *
- * $Id: build.c,v 1.52 2003/10/09 00:38:38 dwmw2 Exp $
+ * $Id: build.c,v 1.55 2003/10/28 17:02:44 dwmw2 Exp $
  *
  */
 
@@ -16,8 +16,7 @@
 #include <linux/slab.h>
 #include "nodelist.h"
 
-int jffs2_build_inode_pass1(struct jffs2_sb_info *, struct jffs2_inode_cache *);
-int jffs2_build_remove_unlinked_inode(struct jffs2_sb_info *, struct jffs2_inode_cache *);
+static void jffs2_build_remove_unlinked_inode(struct jffs2_sb_info *, struct jffs2_inode_cache *, struct jffs2_full_dirent **);
 
 static inline struct jffs2_inode_cache *
 first_inode_chain(int *i, struct jffs2_sb_info *c)
@@ -44,6 +43,41 @@ next_inode(int *i, struct jffs2_inode_cache *ic, struct jffs2_sb_info *c)
 	     ic;					\
 	     ic = next_inode(&i, ic, (c)))
 
+
+static inline void jffs2_build_inode_pass1(struct jffs2_sb_info *c, struct jffs2_inode_cache *ic)
+{
+	struct jffs2_full_dirent *fd;
+
+	D1(printk(KERN_DEBUG "jffs2_build_inode building directory inode #%u\n", ic->ino));
+
+	/* For each child, increase nlink */
+	for(fd = ic->scan_dents; fd; fd = fd->next) {
+		struct jffs2_inode_cache *child_ic;
+		if (!fd->ino)
+			continue;
+
+		/* XXX: Can get high latency here with huge directories */
+
+		child_ic = jffs2_get_ino_cache(c, fd->ino);
+		if (!child_ic) {
+			printk(KERN_NOTICE "Eep. Child \"%s\" (ino #%u) of dir ino #%u doesn't exist!\n",
+				  fd->name, fd->ino, ic->ino);
+			continue;
+		}
+
+		if (child_ic->nlink++ && fd->type == DT_DIR) {
+			printk(KERN_NOTICE "Child dir \"%s\" (ino #%u) of dir ino #%u appears to be a hard link\n", fd->name, fd->ino, ic->ino);
+			if (fd->ino == 1 && ic->ino == 1) {
+				printk(KERN_NOTICE "This is mostly harmless, and probably caused by creating a JFFS2 image\n");
+				printk(KERN_NOTICE "using a buggy version of mkfs.jffs2. Use at least v1.17.\n");
+			}
+			/* What do we do about it? */
+		}
+		D1(printk(KERN_DEBUG "Increased nlink for child \"%s\" (ino #%u)\n", fd->name, fd->ino));
+		/* Can't free them. We might need them in pass 2 */
+	}
+}
+
 /* Scan plan:
  - Scan physical nodes. Build map of inodes/dirents. Allocate inocaches as we go
  - Scan directory tree from top down, setting nlink in inocaches
@@ -54,6 +88,7 @@ static int jffs2_build_filesystem(struct jffs2_sb_info *c)
 	int ret;
 	int i;
 	struct jffs2_inode_cache *ic;
+	struct jffs2_full_dirent *dead_fds = NULL;
 
 	/* First, scan the medium and build all the inode caches with
 	   lists of physical nodes */
@@ -71,47 +106,51 @@ static int jffs2_build_filesystem(struct jffs2_sb_info *c)
 	/* Now scan the directory tree, increasing nlink according to every dirent found. */
 	for_each_inode(i, c, ic) {
 		D1(printk(KERN_DEBUG "Pass 1: ino #%u\n", ic->ino));
-		ret = jffs2_build_inode_pass1(c, ic);
-		if (ret) {
-			D1(printk(KERN_WARNING "Eep. jffs2_build_inode_pass1 for ino %d returned %d\n", ic->ino, ret));
-			return ret;
+
+		D1(BUG_ON(ic->ino > c->highest_ino));
+
+		if (ic->scan_dents) {
+			jffs2_build_inode_pass1(c, ic);
+			cond_resched();
 		}
-		cond_resched();
 	}
 	D1(printk(KERN_DEBUG "Pass 1 complete\n"));
-	D1(jffs2_dump_block_lists(c));
 
 	/* Next, scan for inodes with nlink == 0 and remove them. If
 	   they were directories, then decrement the nlink of their
 	   children too, and repeat the scan. As that's going to be
 	   a fairly uncommon occurrence, it's not so evil to do it this
 	   way. Recursion bad. */
-	do { 
-		D1(printk(KERN_DEBUG "Pass 2 (re)starting\n"));
-		ret = 0;
-		for_each_inode(i, c, ic) {
-			D1(printk(KERN_DEBUG "Pass 2: ino #%u, nlink %d, ic %p, nodes %p\n", ic->ino, ic->nlink, ic, ic->nodes));
-			if (ic->nlink)
-				continue;
+	D1(printk(KERN_DEBUG "Pass 2 starting\n"));
+
+	for_each_inode(i, c, ic) {
+		D1(printk(KERN_DEBUG "Pass 2: ino #%u, nlink %d, ic %p, nodes %p\n", ic->ino, ic->nlink, ic, ic->nodes));
+		if (ic->nlink)
+			continue;
 			
-			/* XXX: Can get high latency here. Move the cond_resched() from the end of the loop? */
+		jffs2_build_remove_unlinked_inode(c, ic, &dead_fds);
+		cond_resched();
+	} 
 
-			ret = jffs2_build_remove_unlinked_inode(c, ic);
-			if (ret)
-				break;
-		/* -EAGAIN means the inode's nlink was zero, so we deleted it,
-		   and furthermore that it had children and their nlink has now
-		   gone to zero too. So we have to restart the scan. */
-		} 
-		D1(jffs2_dump_block_lists(c));
+	D1(printk(KERN_DEBUG "Pass 2a starting\n"));
 
-		cond_resched();
-	
-	} while(ret == -EAGAIN);
+	while (dead_fds) {
+		struct jffs2_inode_cache *ic;
+		struct jffs2_full_dirent *fd = dead_fds;
+
+		dead_fds = fd->next;
+
+		ic = jffs2_get_ino_cache(c, fd->ino);
+		D1(printk(KERN_DEBUG "Removing dead_fd ino #%u (\"%s\"), ic at %p\n", fd->ino, fd->name, ic));
+
+		if (ic)
+			jffs2_build_remove_unlinked_inode(c, ic, &dead_fds);
+		jffs2_free_full_dirent(fd);
+	}
 
 	D1(printk(KERN_DEBUG "Pass 2 complete\n"));
 	
-	/* Finally, we can scan again and free the dirent nodes and scan_info structs */
+	/* Finally, we can scan again and free the dirent structs */
 	for_each_inode(i, c, ic) {
 		struct jffs2_full_dirent *fd;
 		D1(printk(KERN_DEBUG "Pass 3: ino #%u, ic %p, nodes %p\n", ic->ino, ic, ic->nodes));
@@ -133,49 +172,10 @@ static int jffs2_build_filesystem(struct jffs2_sb_info *c)
 	return ret;
 }
 
-int jffs2_build_inode_pass1(struct jffs2_sb_info *c, struct jffs2_inode_cache *ic)
-{
-	struct jffs2_full_dirent *fd;
-
-	D1(printk(KERN_DEBUG "jffs2_build_inode building inode #%u\n", ic->ino));
-
-	if (ic->ino > c->highest_ino)
-		c->highest_ino = ic->ino;
-
-	/* For each child, increase nlink */
-	for(fd=ic->scan_dents; fd; fd = fd->next) {
-		struct jffs2_inode_cache *child_ic;
-		if (!fd->ino)
-			continue;
-		
-		/* XXX: Can get high latency here with huge directories */
-
-		child_ic = jffs2_get_ino_cache(c, fd->ino);
-		if (!child_ic) {
-			printk(KERN_NOTICE "Eep. Child \"%s\" (ino #%u) of dir ino #%u doesn't exist!\n",
-				  fd->name, fd->ino, ic->ino);
-			continue;
-		}
-
-		if (child_ic->nlink++ && fd->type == DT_DIR) {
-			printk(KERN_NOTICE "Child dir \"%s\" (ino #%u) of dir ino #%u appears to be a hard link\n", fd->name, fd->ino, ic->ino);
-			if (fd->ino == 1 && ic->ino == 1) {
-				printk(KERN_NOTICE "This is mostly harmless, and probably caused by creating a JFFS2 image\n");
-				printk(KERN_NOTICE "using a buggy version of mkfs.jffs2. Use at least v1.17.\n");
-			}
-			/* What do we do about it? */
-		}
-		D1(printk(KERN_DEBUG "Increased nlink for child \"%s\" (ino #%u)\n", fd->name, fd->ino));
-		/* Can't free them. We might need them in pass 2 */
-	}
-	return 0;
-}
-
-int jffs2_build_remove_unlinked_inode(struct jffs2_sb_info *c, struct jffs2_inode_cache *ic)
+static void jffs2_build_remove_unlinked_inode(struct jffs2_sb_info *c, struct jffs2_inode_cache *ic, struct jffs2_full_dirent **dead_fds)
 {
 	struct jffs2_raw_node_ref *raw;
 	struct jffs2_full_dirent *fd;
-	int ret = 0;
 
 	D1(printk(KERN_DEBUG "JFFS2: Removing ino #%u with nlink == zero.\n", ic->ino));
 	
@@ -214,18 +214,29 @@ int jffs2_build_remove_unlinked_inode(struct jffs2_sb_info *c, struct jffs2_inod
 				jffs2_free_full_dirent(fd);
 				continue;
 			}
-			jffs2_free_full_dirent(fd);
+
+			/* Reduce nlink of the child. If it's now zero, stick it on the 
+			   dead_fds list to be cleaned up later. Else just free the fd */
+
 			child_ic->nlink--;
+			
+			if (!child_ic->nlink) {
+				D1(printk(KERN_DEBUG "Inode #%u (\"%s\") has now got zero nlink. Adding to dead_fds list.\n",
+					  fd->ino, fd->name));
+				fd->next = *dead_fds;
+				*dead_fds = fd;
+			} else {
+				D1(printk(KERN_DEBUG "Inode #%u (\"%s\") has now got nlink %d. Ignoring.\n",
+					  fd->ino, fd->name, child_ic->nlink));
+				jffs2_free_full_dirent(fd);
+			}
 		}
-		ret = -EAGAIN;
 	}
 
 	/*
 	   We don't delete the inocache from the hash list and free it yet. 
 	   The erase code will do that, when all the nodes are completely gone.
 	*/
-
-	return ret;
 }
 
 static void jffs2_calc_trigger_levels(struct jffs2_sb_info *c)
diff --git a/fs/jffs2/compr.c b/fs/jffs2/compr.c
index 471ec55e6..9e5138a64 100644
--- a/fs/jffs2/compr.c
+++ b/fs/jffs2/compr.c
@@ -2,137 +2,473 @@
  * JFFS2 -- Journalling Flash File System, Version 2.
  *
  * Copyright (C) 2001-2003 Red Hat, Inc.
- *
  * Created by Arjan van de Ven <arjanv@redhat.com>
  *
+ * Copyright (C) 2004 Ferenc Havasi <havasi@inf.u-szeged.hu>,
+ *                    University of Szeged, Hungary
+ *
  * For licensing information, see the file 'LICENCE' in this directory.
  *
- * $Id: compr.c,v 1.27 2003/10/04 08:33:06 dwmw2 Exp $
+ * $Id: compr.c,v 1.41 2004/06/24 09:51:38 havasi Exp $
  *
  */
 
-#if defined(__KERNEL__) || defined (__ECOS)
-#include <linux/kernel.h>
-#include <linux/string.h>
-#include <linux/errno.h>
-#include <linux/types.h>
-#else 
-#define KERN_DEBUG
-#define KERN_NOTICE
-#define KERN_WARNING
-#define printk printf
-#include <stdio.h>
-#include <stdint.h>
-#include <errno.h>
-#endif
+#include "compr.h"
+
+static spinlock_t jffs2_compressor_list_lock = SPIN_LOCK_UNLOCKED;
+
+/* Available compressors are on this list */
+static LIST_HEAD(jffs2_compressor_list);
+
+/* Actual compression mode */
+static int jffs2_compression_mode = JFFS2_COMPR_MODE_PRIORITY;
 
-#include <linux/jffs2.h>
+void jffs2_set_compression_mode(int mode) 
+{
+        jffs2_compression_mode = mode;
+}
 
-int jffs2_zlib_compress(unsigned char *data_in, unsigned char *cpage_out, uint32_t *sourcelen, uint32_t *dstlen);
-void jffs2_zlib_decompress(unsigned char *data_in, unsigned char *cpage_out, uint32_t srclen, uint32_t destlen);
-int jffs2_rtime_compress(unsigned char *data_in, unsigned char *cpage_out, uint32_t *sourcelen, uint32_t *dstlen);
-void jffs2_rtime_decompress(unsigned char *data_in, unsigned char *cpage_out, uint32_t srclen, uint32_t destlen);
-int jffs2_rubinmips_compress(unsigned char *data_in, unsigned char *cpage_out, uint32_t *sourcelen, uint32_t *dstlen);
-void jffs2_rubinmips_decompress(unsigned char *data_in, unsigned char *cpage_out, uint32_t srclen, uint32_t destlen);
-int jffs2_dynrubin_compress(unsigned char *data_in, unsigned char *cpage_out, uint32_t *sourcelen, uint32_t *dstlen);
-void jffs2_dynrubin_decompress(unsigned char *data_in, unsigned char *cpage_out, uint32_t srclen, uint32_t destlen);
+int jffs2_get_compression_mode(void)
+{
+        return jffs2_compression_mode;
+}
 
+/* Statistics for blocks stored without compression */
+static uint32_t none_stat_compr_blocks=0,none_stat_decompr_blocks=0,none_stat_compr_size=0;
 
 /* jffs2_compress:
  * @data: Pointer to uncompressed data
- * @cdata: Pointer to buffer for compressed data
+ * @cdata: Pointer to returned pointer to buffer for compressed data
  * @datalen: On entry, holds the amount of data available for compression.
  *	On exit, expected to hold the amount of data actually compressed.
  * @cdatalen: On entry, holds the amount of space available for compressed
  *	data. On exit, expected to hold the actual size of the compressed
  *	data.
  *
- * Returns: Byte to be stored with data indicating compression type used.
+ * Returns: Lower byte to be stored with data indicating compression type used.
  * Zero is used to show that the data could not be compressed - the 
  * compressed version was actually larger than the original.
+ * Upper byte will be used later. (soon)
  *
  * If the cdata buffer isn't large enough to hold all the uncompressed data,
  * jffs2_compress should compress as much as will fit, and should set 
  * *datalen accordingly to show the amount of data which were compressed.
  */
-unsigned char jffs2_compress(unsigned char *data_in, unsigned char *cpage_out, 
-		    uint32_t *datalen, uint32_t *cdatalen)
+uint16_t jffs2_compress(struct jffs2_sb_info *c, struct jffs2_inode_info *f,
+			     unsigned char *data_in, unsigned char **cpage_out, 
+			     uint32_t *datalen, uint32_t *cdatalen)
 {
-	int ret;
+	int ret = JFFS2_COMPR_NONE;
+        int compr_ret;
+        struct jffs2_compressor *this, *best=NULL;
+        unsigned char *output_buf = NULL, *tmp_buf;
+        uint32_t orig_slen, orig_dlen;
+        uint32_t best_slen=0, best_dlen=0;
 
-	ret = jffs2_zlib_compress(data_in, cpage_out, datalen, cdatalen);
-	if (!ret) {
-		return JFFS2_COMPR_ZLIB;
-	}
-#if 0 /* Disabled 23/9/1. With zlib it hardly ever gets a look in */
-	ret = jffs2_dynrubin_compress(data_in, cpage_out, datalen, cdatalen);
-	if (!ret) {
-		return JFFS2_COMPR_DYNRUBIN;
-	}
-#endif
-#if 0 /* Disabled 26/2/1. Obsoleted by dynrubin */
-	ret = jffs2_rubinmips_compress(data_in, cpage_out, datalen, cdatalen);
-	if (!ret) {
-		return JFFS2_COMPR_RUBINMIPS;
-	}
-#endif
-	/* rtime does manage to recompress already-compressed data */
-	ret = jffs2_rtime_compress(data_in, cpage_out, datalen, cdatalen);
-	if (!ret) {
-		return JFFS2_COMPR_RTIME;
-	}
-#if 0
-	/* We don't need to copy. Let the caller special-case the COMPR_NONE case. */
-	/* If we get here, no compression is going to work */
-	/* But we might want to use the fragmentation part -- Arjan */
-	memcpy(cpage_out,data_in,min(*datalen,*cdatalen));
-	if (*datalen > *cdatalen)
-		*datalen = *cdatalen;
-#endif		
-	return JFFS2_COMPR_NONE; /* We failed to compress */
+        switch (jffs2_compression_mode) {
+        case JFFS2_COMPR_MODE_NONE:
+                break;
+        case JFFS2_COMPR_MODE_PRIORITY:
+                output_buf = kmalloc(*cdatalen,GFP_KERNEL);
+                if (!output_buf) {
+                        printk(KERN_WARNING "JFFS2: No memory for compressor allocation. Compression failed.\n");
+                        goto out;
+                }
+                orig_slen = *datalen;
+                orig_dlen = *cdatalen;
+                spin_lock(&jffs2_compressor_list_lock);
+                list_for_each_entry(this, &jffs2_compressor_list, list) {
+                        /* Skip decompress-only backwards-compatibility and disabled modules */
+                        if ((!this->compress)||(this->disabled))
+                                continue;
 
+                        this->usecount++;
+                        spin_unlock(&jffs2_compressor_list_lock);
+                        *datalen  = orig_slen;
+                        *cdatalen = orig_dlen;
+                        compr_ret = this->compress(data_in, output_buf, datalen, cdatalen, NULL);
+                        spin_lock(&jffs2_compressor_list_lock);
+                        this->usecount--;
+                        if (!compr_ret) {
+                                ret = this->compr;
+                                this->stat_compr_blocks++;
+                                this->stat_compr_orig_size += *datalen;
+                                this->stat_compr_new_size  += *cdatalen;
+                                break;
+                        }
+                }
+                spin_unlock(&jffs2_compressor_list_lock);
+                if (ret == JFFS2_COMPR_NONE) kfree(output_buf);
+                break;
+        case JFFS2_COMPR_MODE_SIZE:
+                orig_slen = *datalen;
+                orig_dlen = *cdatalen;
+                spin_lock(&jffs2_compressor_list_lock);
+                list_for_each_entry(this, &jffs2_compressor_list, list) {
+                        /* Skip decompress-only backwards-compatibility and disabled modules */
+                        if ((!this->compress)||(this->disabled))
+                                continue;
+                        /* Allocating memory for output buffer if necessary */
+                        if ((this->compr_buf_size<orig_dlen)&&(this->compr_buf)) {
+                                spin_unlock(&jffs2_compressor_list_lock);
+                                kfree(this->compr_buf);
+                                spin_lock(&jffs2_compressor_list_lock);
+                                this->compr_buf_size=0;
+                                this->compr_buf=NULL;
+                        }
+                        if (!this->compr_buf) {
+                                spin_unlock(&jffs2_compressor_list_lock);
+                                tmp_buf = kmalloc(orig_dlen,GFP_KERNEL);
+                                spin_lock(&jffs2_compressor_list_lock);
+                                if (!tmp_buf) {
+                                        printk(KERN_WARNING "JFFS2: No memory for compressor allocation. (%d bytes)\n",orig_dlen);
+                                        continue;
+                                }
+                                else {
+                                        this->compr_buf = tmp_buf;
+                                        this->compr_buf_size = orig_dlen;
+                                }
+                        }
+                        this->usecount++;
+                        spin_unlock(&jffs2_compressor_list_lock);
+                        *datalen  = orig_slen;
+                        *cdatalen = orig_dlen;
+                        compr_ret = this->compress(data_in, this->compr_buf, datalen, cdatalen, NULL);
+                        spin_lock(&jffs2_compressor_list_lock);
+                        this->usecount--;
+                        if (!compr_ret) {
+                                if ((!best_dlen)||(best_dlen>*cdatalen)) {
+                                        best_dlen = *cdatalen;
+                                        best_slen = *datalen;
+                                        best = this;
+                                }
+                        }
+                }
+                if (best_dlen) {
+                        *cdatalen = best_dlen;
+                        *datalen  = best_slen;
+                        output_buf = best->compr_buf;
+                        best->compr_buf = NULL;
+                        best->compr_buf_size = 0;
+                        best->stat_compr_blocks++;
+                        best->stat_compr_orig_size += best_slen;
+                        best->stat_compr_new_size  += best_dlen;
+                        ret = best->compr;
+                }
+                spin_unlock(&jffs2_compressor_list_lock);
+                break;
+        default:
+                printk(KERN_ERR "JFFS2: unknow compression mode.\n");
+        }
+ out:
+        if (ret == JFFS2_COMPR_NONE) {
+	        *cpage_out = data_in;
+	        *datalen = *cdatalen;
+                none_stat_compr_blocks++;
+                none_stat_compr_size += *datalen;
+        }
+        else {
+                *cpage_out = output_buf;
+        }
+	return ret;
 }
 
-
-int jffs2_decompress(unsigned char comprtype, unsigned char *cdata_in, 
+int jffs2_decompress(struct jffs2_sb_info *c, struct jffs2_inode_info *f,
+		     uint16_t comprtype, unsigned char *cdata_in, 
 		     unsigned char *data_out, uint32_t cdatalen, uint32_t datalen)
 {
-	switch (comprtype) {
+        struct jffs2_compressor *this;
+        int ret;
+
+	switch (comprtype & 0xff) {
 	case JFFS2_COMPR_NONE:
 		/* This should be special-cased elsewhere, but we might as well deal with it */
 		memcpy(data_out, cdata_in, datalen);
+                none_stat_decompr_blocks++;
 		break;
-
 	case JFFS2_COMPR_ZERO:
 		memset(data_out, 0, datalen);
 		break;
+	default:
+                spin_lock(&jffs2_compressor_list_lock);
+                list_for_each_entry(this, &jffs2_compressor_list, list) {
+                        if (comprtype == this->compr) {
+                                this->usecount++;
+                                spin_unlock(&jffs2_compressor_list_lock);
+                                ret = this->decompress(cdata_in, data_out, cdatalen, datalen, NULL);
+                                spin_lock(&jffs2_compressor_list_lock);
+                                if (ret) {
+                                        printk(KERN_WARNING "Decompressor \"%s\" returned %d\n", this->name, ret);
+                                }
+                                else {
+                                        this->stat_decompr_blocks++;
+                                }
+                                this->usecount--;
+                                spin_unlock(&jffs2_compressor_list_lock);
+                                return ret;
+                        }
+                }
+		printk(KERN_WARNING "JFFS2 compression type 0x%02x not avaiable.\n", comprtype);
+                spin_unlock(&jffs2_compressor_list_lock);
+		return -EIO;
+	}
+	return 0;
+}
 
-	case JFFS2_COMPR_ZLIB:
-		jffs2_zlib_decompress(cdata_in, data_out, cdatalen, datalen);
-		break;
+int jffs2_register_compressor(struct jffs2_compressor *comp)
+{
+        struct jffs2_compressor *this;
 
-	case JFFS2_COMPR_RTIME:
-		jffs2_rtime_decompress(cdata_in, data_out, cdatalen, datalen);
-		break;
+        if (!comp->name) {
+                printk(KERN_WARNING "NULL compressor name at registering JFFS2 compressor. Failed.\n");
+                return -1;
+        }
+        comp->compr_buf_size=0;
+        comp->compr_buf=NULL;
+        comp->usecount=0;
+        comp->stat_compr_orig_size=0;
+        comp->stat_compr_new_size=0;
+        comp->stat_compr_blocks=0;
+        comp->stat_decompr_blocks=0;
+        D1(printk(KERN_DEBUG "Registering JFFS2 compressor \"%s\"\n", comp->name));
+
+        spin_lock(&jffs2_compressor_list_lock);
+
+        list_for_each_entry(this, &jffs2_compressor_list, list) {
+                if (this->priority < comp->priority) {
+                        list_add(&comp->list, this->list.prev);
+                        goto out;
+                }
+        }
+        list_add_tail(&comp->list, &jffs2_compressor_list);
+out:
+        D2(list_for_each_entry(this, &jffs2_compressor_list, list) {
+                printk(KERN_DEBUG "Compressor \"%s\", prio %d\n", this->name, this->priority);
+        })
+
+        spin_unlock(&jffs2_compressor_list_lock);
+
+        return 0;
+}
+
+int jffs2_unregister_compressor(struct jffs2_compressor *comp)
+{
+        D2(struct jffs2_compressor *this;)
+
+        D1(printk(KERN_DEBUG "Unregistering JFFS2 compressor \"%s\"\n", comp->name));
+
+        spin_lock(&jffs2_compressor_list_lock);
+
+        if (comp->usecount) {
+                spin_unlock(&jffs2_compressor_list_lock);
+                printk(KERN_WARNING "JFFS2: Compressor modul is in use. Unregister failed.\n");
+                return -1;
+        }
+        list_del(&comp->list);
+
+        D2(list_for_each_entry(this, &jffs2_compressor_list, list) {
+                printk(KERN_DEBUG "Compressor \"%s\", prio %d\n", this->name, this->priority);
+        })
+        spin_unlock(&jffs2_compressor_list_lock);
+        return 0;
+}
+
+#ifdef CONFIG_JFFS2_PROC
+
+#define JFFS2_STAT_BUF_SIZE 16000
+
+char *jffs2_list_compressors(void)
+{
+        struct jffs2_compressor *this;
+        char *buf, *act_buf;
+
+        act_buf = buf = kmalloc(JFFS2_STAT_BUF_SIZE,GFP_KERNEL);
+        list_for_each_entry(this, &jffs2_compressor_list, list) {
+                act_buf += sprintf(act_buf, "%10s priority:%d ", this->name, this->priority);
+                if ((this->disabled)||(!this->compress))
+                        act_buf += sprintf(act_buf,"disabled");
+                else
+                        act_buf += sprintf(act_buf,"enabled");
+                act_buf += sprintf(act_buf,"\n");
+        }
+        return buf;
+}
+
+char *jffs2_stats(void)
+{
+        struct jffs2_compressor *this;
+        char *buf, *act_buf;
+
+        act_buf = buf = kmalloc(JFFS2_STAT_BUF_SIZE,GFP_KERNEL);
+
+        act_buf += sprintf(act_buf,"JFFS2 compressor statistics:\n");
+        act_buf += sprintf(act_buf,"%10s   ","none");
+        act_buf += sprintf(act_buf,"compr: %d blocks (%d)  decompr: %d blocks\n", none_stat_compr_blocks, 
+                           none_stat_compr_size, none_stat_decompr_blocks);
+        spin_lock(&jffs2_compressor_list_lock);
+        list_for_each_entry(this, &jffs2_compressor_list, list) {
+                act_buf += sprintf(act_buf,"%10s ",this->name);
+                if ((this->disabled)||(!this->compress))
+                        act_buf += sprintf(act_buf,"- ");
+                else
+                        act_buf += sprintf(act_buf,"+ ");
+                act_buf += sprintf(act_buf,"compr: %d blocks (%d/%d)  decompr: %d blocks ", this->stat_compr_blocks, 
+                                   this->stat_compr_new_size, this->stat_compr_orig_size, 
+                                   this->stat_decompr_blocks);
+                act_buf += sprintf(act_buf,"\n");
+        }
+        spin_unlock(&jffs2_compressor_list_lock);
+
+        return buf;
+}
+
+char *jffs2_get_compression_mode_name(void) 
+{
+        switch (jffs2_compression_mode) {
+        case JFFS2_COMPR_MODE_NONE:
+                return "none";
+        case JFFS2_COMPR_MODE_PRIORITY:
+                return "priority";
+        case JFFS2_COMPR_MODE_SIZE:
+                return "size";
+        }
+        return "unkown";
+}
+
+int jffs2_set_compression_mode_name(const char *name) 
+{
+        if (!strcmp("none",name)) {
+                jffs2_compression_mode = JFFS2_COMPR_MODE_NONE;
+                return 0;
+        }
+        if (!strcmp("priority",name)) {
+                jffs2_compression_mode = JFFS2_COMPR_MODE_PRIORITY;
+                return 0;
+        }
+        if (!strcmp("size",name)) {
+                jffs2_compression_mode = JFFS2_COMPR_MODE_SIZE;
+                return 0;
+        }
+        return 1;
+}
+
+static int jffs2_compressor_Xable(const char *name, int disabled)
+{
+        struct jffs2_compressor *this;
+        spin_lock(&jffs2_compressor_list_lock);
+        list_for_each_entry(this, &jffs2_compressor_list, list) {
+                if (!strcmp(this->name, name)) {
+                        this->disabled = disabled;
+                        spin_unlock(&jffs2_compressor_list_lock);
+                        return 0;                        
+                }
+        }
+        spin_unlock(&jffs2_compressor_list_lock);
+        printk(KERN_WARNING "JFFS2: compressor %s not found.\n",name);
+        return 1;
+}
+
+int jffs2_enable_compressor_name(const char *name)
+{
+        return jffs2_compressor_Xable(name, 0);
+}
+
+int jffs2_disable_compressor_name(const char *name)
+{
+        return jffs2_compressor_Xable(name, 1);
+}
+
+int jffs2_set_compressor_priority(const char *name, int priority)
+{
+        struct jffs2_compressor *this,*comp;
+        spin_lock(&jffs2_compressor_list_lock);
+        list_for_each_entry(this, &jffs2_compressor_list, list) {
+                if (!strcmp(this->name, name)) {
+                        this->priority = priority;
+                        comp = this;
+                        goto reinsert;
+                }
+        }
+        spin_unlock(&jffs2_compressor_list_lock);
+        printk(KERN_WARNING "JFFS2: compressor %s not found.\n",name);        
+        return 1;
+reinsert:
+        /* list is sorted in the order of priority, so if
+           we change it we have to reinsert it into the
+           good place */
+        list_del(&comp->list);
+        list_for_each_entry(this, &jffs2_compressor_list, list) {
+                if (this->priority < comp->priority) {
+                        list_add(&comp->list, this->list.prev);
+                        spin_unlock(&jffs2_compressor_list_lock);
+                        return 0;
+                }
+        }
+        list_add_tail(&comp->list, &jffs2_compressor_list);
+        spin_unlock(&jffs2_compressor_list_lock);
+        return 0;
+}
 
-	case JFFS2_COMPR_RUBINMIPS:
-#if 0 /* Disabled 23/9/1 */
-		jffs2_rubinmips_decompress(cdata_in, data_out, cdatalen, datalen);
-#else
-		printk(KERN_WARNING "JFFS2: Rubinmips compression encountered but support not compiled in!\n");
 #endif
-		break;
-	case JFFS2_COMPR_DYNRUBIN:
-#if 1 /* Phase this one out */
-		jffs2_dynrubin_decompress(cdata_in, data_out, cdatalen, datalen);
+
+void jffs2_free_comprbuf(unsigned char *comprbuf, unsigned char *orig)
+{
+        if (orig != comprbuf)
+                kfree(comprbuf);
+}
+
+int jffs2_compressors_init(void) 
+{
+/* Registering compressors */
+#ifdef CONFIG_JFFS2_ZLIB
+        jffs2_zlib_init();
+#endif
+#ifdef CONFIG_JFFS2_RTIME
+        jffs2_rtime_init();
+#endif
+#ifdef CONFIG_JFFS2_RUBIN
+        jffs2_rubinmips_init();
+        jffs2_dynrubin_init();
+#endif
+#ifdef CONFIG_JFFS2_LZARI
+        jffs2_lzari_init();
+#endif
+#ifdef CONFIG_JFFS2_LZO
+        jffs2_lzo_init();
+#endif
+/* Setting default compression mode */
+#ifdef CONFIG_JFFS2_CMODE_NONE
+        jffs2_compression_mode = JFFS2_COMPR_MODE_NONE;
+        D1(printk(KERN_INFO "JFFS2: default compression mode: none\n");)
 #else
-		printk(KERN_WARNING "JFFS2: Dynrubin compression encountered but support not compiled in!\n");
+#ifdef CONFIG_JFFS2_CMODE_SIZE
+        jffs2_compression_mode = JFFS2_COMPR_MODE_SIZE;
+        D1(printk(KERN_INFO "JFFS2: default compression mode: size\n");)
+#else
+        D1(printk(KERN_INFO "JFFS2: default compression mode: priority\n");)
 #endif
-		break;
+#endif
+        return 0;
+}
 
-	default:
-		printk(KERN_NOTICE "Unknown JFFS2 compression type 0x%02x\n", comprtype);
-		return -EIO;
-	}
-	return 0;
+int jffs2_compressors_exit(void) 
+{
+/* Unregistering compressors */
+#ifdef CONFIG_JFFS2_LZO
+        jffs2_lzo_exit();
+#endif
+#ifdef CONFIG_JFFS2_LZARI
+        jffs2_lzari_exit();
+#endif
+#ifdef CONFIG_JFFS2_RUBIN
+        jffs2_dynrubin_exit();
+        jffs2_rubinmips_exit();
+#endif
+#ifdef CONFIG_JFFS2_RTIME
+        jffs2_rtime_exit();
+#endif
+#ifdef CONFIG_JFFS2_ZLIB
+        jffs2_zlib_exit();
+#endif
+        return 0;
 }
diff --git a/fs/jffs2/compr.h b/fs/jffs2/compr.h
index 5e3445da3..6777d8c91 100644
--- a/fs/jffs2/compr.h
+++ b/fs/jffs2/compr.h
@@ -7,7 +7,7 @@
  * For licensing information, see the file 'LICENCE' in the 
  * jffs2 directory.
  *
- * $Id: compr.h,v 1.5 2004/06/23 16:34:39 havasi Exp $
+ * $Id: compr.h,v 1.6 2004/07/16 15:17:57 dwmw2 Exp $
  *
  */
 
@@ -115,8 +115,4 @@ int jffs2_lzo_init(void);
 void jffs2_lzo_exit(void);
 #endif
 
-/* Prototypes from proc.c */
-int jffs2_proc_init(void);
-int jffs2_proc_exit(void);
-
 #endif /* __JFFS2_COMPR_H__ */
diff --git a/fs/jffs2/compr_rtime.c b/fs/jffs2/compr_rtime.c
index a72ce670c..3bfe27773 100644
--- a/fs/jffs2/compr_rtime.c
+++ b/fs/jffs2/compr_rtime.c
@@ -7,7 +7,7 @@
  *
  * For licensing information, see the file 'LICENCE' in this directory.
  *
- * $Id: compr_rtime.c,v 1.11 2003/10/04 08:33:06 dwmw2 Exp $
+ * $Id: compr_rtime.c,v 1.14 2004/06/23 16:34:40 havasi Exp $
  *
  *
  * Very simple lz77-ish encoder.
@@ -25,10 +25,12 @@
 #include <linux/types.h>
 #include <linux/errno.h>
 #include <linux/string.h> 
+#include <linux/jffs2.h> 
+#include "compr.h"
 
 /* _compress returns the compressed size, -1 if bigger */
 int jffs2_rtime_compress(unsigned char *data_in, unsigned char *cpage_out, 
-		   uint32_t *sourcelen, uint32_t *dstlen)
+		   uint32_t *sourcelen, uint32_t *dstlen, void *model)
 {
 	short positions[256];
 	int outpos = 0;
@@ -67,8 +69,8 @@ int jffs2_rtime_compress(unsigned char *data_in, unsigned char *cpage_out,
 }		   
 
 
-void jffs2_rtime_decompress(unsigned char *data_in, unsigned char *cpage_out,
-		      uint32_t srclen, uint32_t destlen)
+int jffs2_rtime_decompress(unsigned char *data_in, unsigned char *cpage_out,
+		      uint32_t srclen, uint32_t destlen, void *model)
 {
 	short positions[256];
 	int outpos = 0;
@@ -98,7 +100,29 @@ void jffs2_rtime_decompress(unsigned char *data_in, unsigned char *cpage_out,
 				outpos+=repeat;		
 			}
 		}
-	}		
+	}
+        return 0;
 }		   
 
+static struct jffs2_compressor jffs2_rtime_comp = {
+    .priority = JFFS2_RTIME_PRIORITY,
+    .name = "rtime",
+    .compr = JFFS2_COMPR_RTIME,
+    .compress = &jffs2_rtime_compress,
+    .decompress = &jffs2_rtime_decompress,
+#ifdef JFFS2_RTIME_DISABLED
+    .disabled = 1,
+#else
+    .disabled = 0,
+#endif
+};
+
+int jffs2_rtime_init(void)
+{
+    return jffs2_register_compressor(&jffs2_rtime_comp);
+}
 
+void jffs2_rtime_exit(void)
+{
+    jffs2_unregister_compressor(&jffs2_rtime_comp);
+}
diff --git a/fs/jffs2/compr_rubin.c b/fs/jffs2/compr_rubin.c
index be8e8d501..450d66241 100644
--- a/fs/jffs2/compr_rubin.c
+++ b/fs/jffs2/compr_rubin.c
@@ -7,17 +7,17 @@
  *
  * For licensing information, see the file 'LICENCE' in this directory.
  *
- * $Id: compr_rubin.c,v 1.17 2002/05/20 14:56:37 dwmw2 Exp $
+ * $Id: compr_rubin.c,v 1.20 2004/06/23 16:34:40 havasi Exp $
  *
  */
 
  
 #include <linux/string.h>
 #include <linux/types.h>
+#include <linux/jffs2.h>
 #include "compr_rubin.h"
 #include "histo_mips.h"
-
-
+#include "compr.h"
 
 static void init_rubin(struct rubin_state *rs, int div, int *bits)
 {	
@@ -223,13 +223,13 @@ static int rubin_do_compress(int bit_divider, int *bits, unsigned char *data_in,
 #if 0
 /* _compress returns the compressed size, -1 if bigger */
 int jffs2_rubinmips_compress(unsigned char *data_in, unsigned char *cpage_out, 
-		   uint32_t *sourcelen, uint32_t *dstlen)
+		   uint32_t *sourcelen, uint32_t *dstlen, void *model)
 {
 	return rubin_do_compress(BIT_DIVIDER_MIPS, bits_mips, data_in, cpage_out, sourcelen, dstlen);
 }
 #endif
 int jffs2_dynrubin_compress(unsigned char *data_in, unsigned char *cpage_out, 
-		   uint32_t *sourcelen, uint32_t *dstlen)
+		   uint32_t *sourcelen, uint32_t *dstlen, void *model)
 {
 	int bits[8];
 	unsigned char histo[256];
@@ -306,14 +306,15 @@ static void rubin_do_decompress(int bit_divider, int *bits, unsigned char *cdata
 }		   
 
 
-void jffs2_rubinmips_decompress(unsigned char *data_in, unsigned char *cpage_out, 
-		   uint32_t sourcelen, uint32_t dstlen)
+int jffs2_rubinmips_decompress(unsigned char *data_in, unsigned char *cpage_out, 
+		   uint32_t sourcelen, uint32_t dstlen, void *model)
 {
 	rubin_do_decompress(BIT_DIVIDER_MIPS, bits_mips, data_in, cpage_out, sourcelen, dstlen);
+        return 0;
 }
 
-void jffs2_dynrubin_decompress(unsigned char *data_in, unsigned char *cpage_out, 
-		   uint32_t sourcelen, uint32_t dstlen)
+int jffs2_dynrubin_decompress(unsigned char *data_in, unsigned char *cpage_out, 
+		   uint32_t sourcelen, uint32_t dstlen, void *model)
 {
 	int bits[8];
 	int c;
@@ -322,4 +323,51 @@ void jffs2_dynrubin_decompress(unsigned char *data_in, unsigned char *cpage_out,
 		bits[c] = data_in[c];
 
 	rubin_do_decompress(256, bits, data_in+8, cpage_out, sourcelen-8, dstlen);
+        return 0;
+}
+
+static struct jffs2_compressor jffs2_rubinmips_comp = {
+    .priority = JFFS2_RUBINMIPS_PRIORITY,
+    .name = "rubinmips",
+    .compr = JFFS2_COMPR_DYNRUBIN,
+    .compress = NULL, /*&jffs2_rubinmips_compress,*/
+    .decompress = &jffs2_rubinmips_decompress,
+#ifdef JFFS2_RUBINMIPS_DISABLED
+    .disabled = 1,
+#else
+    .disabled = 0,
+#endif
+};
+
+int jffs2_rubinmips_init(void)
+{
+    return jffs2_register_compressor(&jffs2_rubinmips_comp);
+}
+
+void jffs2_rubinmips_exit(void)
+{
+    jffs2_unregister_compressor(&jffs2_rubinmips_comp);
+}
+
+static struct jffs2_compressor jffs2_dynrubin_comp = {
+    .priority = JFFS2_DYNRUBIN_PRIORITY,
+    .name = "dynrubin",
+    .compr = JFFS2_COMPR_RUBINMIPS,
+    .compress = jffs2_dynrubin_compress,
+    .decompress = &jffs2_dynrubin_decompress,
+#ifdef JFFS2_DYNRUBIN_DISABLED
+    .disabled = 1,
+#else
+    .disabled = 0,
+#endif
+};
+
+int jffs2_dynrubin_init(void)
+{
+    return jffs2_register_compressor(&jffs2_dynrubin_comp);
+}
+
+void jffs2_dynrubin_exit(void)
+{
+    jffs2_unregister_compressor(&jffs2_dynrubin_comp);
 }
diff --git a/fs/jffs2/compr_zlib.c b/fs/jffs2/compr_zlib.c
index c05e65f4c..f3b0bc97e 100644
--- a/fs/jffs2/compr_zlib.c
+++ b/fs/jffs2/compr_zlib.c
@@ -7,7 +7,7 @@
  *
  * For licensing information, see the file 'LICENCE' in this directory.
  *
- * $Id: compr_zlib.c,v 1.24 2003/10/04 08:33:06 dwmw2 Exp $
+ * $Id: compr_zlib.c,v 1.28 2004/06/23 16:34:40 havasi Exp $
  *
  */
 
@@ -17,13 +17,12 @@
 
 #include <linux/config.h>
 #include <linux/kernel.h>
-#include <linux/vmalloc.h>
-#include <linux/init.h>
 #include <linux/slab.h>
 #include <linux/zlib.h>
 #include <linux/zutil.h>
 #include <asm/semaphore.h>
 #include "nodelist.h"
+#include "compr.h"
 
 	/* Plan: call deflate() with avail_in == *sourcelen, 
 		avail_out = *dstlen - 12 and flush == Z_FINISH. 
@@ -39,7 +38,10 @@ static DECLARE_MUTEX(inflate_sem);
 static z_stream inf_strm, def_strm;
 
 #ifdef __KERNEL__ /* Linux-only */
-int __init jffs2_zlib_init(void)
+#include <linux/vmalloc.h>
+#include <linux/init.h>
+
+static int __init alloc_workspaces(void)
 {
 	def_strm.workspace = vmalloc(zlib_deflate_workspacesize());
 	if (!def_strm.workspace) {
@@ -57,15 +59,18 @@ int __init jffs2_zlib_init(void)
 	return 0;
 }
 
-void jffs2_zlib_exit(void)
+static void free_workspaces(void)
 {
 	vfree(def_strm.workspace);
 	vfree(inf_strm.workspace);
 }
+#else
+#define alloc_workspaces() (0)
+#define free_workspaces() do { } while(0)
 #endif /* __KERNEL__ */
 
 int jffs2_zlib_compress(unsigned char *data_in, unsigned char *cpage_out, 
-		   uint32_t *sourcelen, uint32_t *dstlen)
+		   uint32_t *sourcelen, uint32_t *dstlen, void *model)
 {
 	int ret;
 
@@ -130,8 +135,8 @@ int jffs2_zlib_compress(unsigned char *data_in, unsigned char *cpage_out,
 	return ret;
 }
 
-void jffs2_zlib_decompress(unsigned char *data_in, unsigned char *cpage_out,
-		      uint32_t srclen, uint32_t destlen)
+int jffs2_zlib_decompress(unsigned char *data_in, unsigned char *cpage_out,
+		      uint32_t srclen, uint32_t destlen, void *model)
 {
 	int ret;
 	int wbits = MAX_WBITS;
@@ -165,7 +170,7 @@ void jffs2_zlib_decompress(unsigned char *data_in, unsigned char *cpage_out,
 	if (Z_OK != zlib_inflateInit2(&inf_strm, wbits)) {
 		printk(KERN_WARNING "inflateInit failed\n");
 		up(&inflate_sem);
-		return;
+		return 1;
 	}
 
 	while((ret = zlib_inflate(&inf_strm, Z_FINISH)) == Z_OK)
@@ -175,4 +180,39 @@ void jffs2_zlib_decompress(unsigned char *data_in, unsigned char *cpage_out,
 	}
 	zlib_inflateEnd(&inf_strm);
 	up(&inflate_sem);
+        return 0;
+}
+
+static struct jffs2_compressor jffs2_zlib_comp = {
+    .priority = JFFS2_ZLIB_PRIORITY,
+    .name = "zlib",
+    .compr = JFFS2_COMPR_ZLIB,
+    .compress = &jffs2_zlib_compress,
+    .decompress = &jffs2_zlib_decompress,
+#ifdef JFFS2_ZLIB_DISABLED
+    .disabled = 1,
+#else
+    .disabled = 0,
+#endif
+};
+
+int __init jffs2_zlib_init(void)
+{
+    int ret;
+
+    ret = alloc_workspaces();
+    if (ret)
+        return ret;
+
+    ret = jffs2_register_compressor(&jffs2_zlib_comp);
+    if (ret)
+        free_workspaces();
+
+    return ret;
+}
+
+void jffs2_zlib_exit(void)
+{
+    jffs2_unregister_compressor(&jffs2_zlib_comp);
+    free_workspaces();
 }
diff --git a/fs/jffs2/erase.c b/fs/jffs2/erase.c
index f7a940962..f6efdbabb 100644
--- a/fs/jffs2/erase.c
+++ b/fs/jffs2/erase.c
@@ -7,7 +7,7 @@
  *
  * For licensing information, see the file 'LICENCE' in this directory.
  *
- * $Id: erase.c,v 1.53 2003/10/08 17:22:54 dwmw2 Exp $
+ * $Id: erase.c,v 1.60 2004/06/30 17:26:15 dbrown Exp $
  *
  */
 
@@ -28,7 +28,7 @@ struct erase_priv_struct {
 #ifndef __ECOS
 static void jffs2_erase_callback(struct erase_info *);
 #endif
-static void jffs2_erase_failed(struct jffs2_sb_info *c, struct jffs2_eraseblock *jeb);
+static void jffs2_erase_failed(struct jffs2_sb_info *c, struct jffs2_eraseblock *jeb, uint32_t bad_offset);
 static void jffs2_erase_succeeded(struct jffs2_sb_info *c, struct jffs2_eraseblock *jeb);
 static void jffs2_free_all_node_refs(struct jffs2_sb_info *c, struct jffs2_eraseblock *jeb);
 static void jffs2_mark_erased_block(struct jffs2_sb_info *c, struct jffs2_eraseblock *jeb);
@@ -36,6 +36,7 @@ static void jffs2_mark_erased_block(struct jffs2_sb_info *c, struct jffs2_eraseb
 void jffs2_erase_block(struct jffs2_sb_info *c, struct jffs2_eraseblock *jeb)
 {
 	int ret;
+	uint32_t bad_offset;
 #ifdef __ECOS
        ret = jffs2_flash_erase(c, jeb);
        if (!ret) {
@@ -65,18 +66,16 @@ void jffs2_erase_block(struct jffs2_sb_info *c, struct jffs2_eraseblock *jeb)
 	instr->len = c->sector_size;
 	instr->callback = jffs2_erase_callback;
 	instr->priv = (unsigned long)(&instr[1]);
+	instr->fail_addr = 0xffffffff;
 	
 	((struct erase_priv_struct *)instr->priv)->jeb = jeb;
 	((struct erase_priv_struct *)instr->priv)->c = c;
 
-	/* NAND , read out the fail counter, if possible */
-	if (!jffs2_can_mark_obsolete(c)) 
-		jffs2_nand_read_failcnt(c,jeb);
-		
 	ret = c->mtd->erase(c->mtd, instr);
 	if (!ret)
 		return;
 
+	bad_offset = instr->fail_addr;
 	kfree(instr);
 #endif /* __ECOS */
 
@@ -98,10 +97,10 @@ void jffs2_erase_block(struct jffs2_sb_info *c, struct jffs2_eraseblock *jeb)
 	else
 		printk(KERN_WARNING "Erase at 0x%08x failed immediately: errno %d\n", jeb->offset, ret);
 
-	jffs2_erase_failed(c, jeb);
+	jffs2_erase_failed(c, jeb, bad_offset);
 }
 
-void jffs2_erase_pending_blocks(struct jffs2_sb_info *c)
+void jffs2_erase_pending_blocks(struct jffs2_sb_info *c, int count)
 {
 	struct jffs2_eraseblock *jeb;
 
@@ -118,6 +117,11 @@ void jffs2_erase_pending_blocks(struct jffs2_sb_info *c)
 			spin_unlock(&c->erase_completion_lock);
 			jffs2_mark_erased_block(c, jeb);
 
+			if (!--count) {
+				D1(printk(KERN_DEBUG "Count reached. jffs2_erase_pending_blocks leaving\n"));
+				goto done;
+			}
+
 		} else if (!list_empty(&c->erase_pending_list)) {
 			jeb = list_entry(c->erase_pending_list.next, struct jffs2_eraseblock, list);
 			D1(printk(KERN_DEBUG "Starting erase of pending block 0x%08x\n", jeb->offset));
@@ -144,6 +148,7 @@ void jffs2_erase_pending_blocks(struct jffs2_sb_info *c)
 	}
 
 	spin_unlock(&c->erase_completion_lock);
+ done:
 	D1(printk(KERN_DEBUG "jffs2_erase_pending_blocks completed\n"));
 
 	up(&c->erase_free_sem);
@@ -160,16 +165,34 @@ static void jffs2_erase_succeeded(struct jffs2_sb_info *c, struct jffs2_eraseblo
 	jffs2_erase_pending_trigger(c);
 }
 
-static void jffs2_erase_failed(struct jffs2_sb_info *c, struct jffs2_eraseblock *jeb)
+static void jffs2_erase_failed(struct jffs2_sb_info *c, struct jffs2_eraseblock *jeb, uint32_t bad_offset)
 {
-	 spin_lock(&c->erase_completion_lock);
-	 c->erasing_size -= c->sector_size;
-	 c->bad_size += c->sector_size;
-	 list_del(&jeb->list);
-	 list_add(&jeb->list, &c->bad_list);
-	 c->nr_erasing_blocks--;
-	 spin_unlock(&c->erase_completion_lock);
-	 wake_up(&c->erase_wait);
+	/* For NAND, if the failure did not occur at the device level for a
+	   specific physical page, don't bother updating the bad block table. */
+	if (jffs2_cleanmarker_oob(c) && (bad_offset != 0xffffffff)) {
+		/* We had a device-level failure to erase.  Let's see if we've
+		   failed too many times. */
+		if (!jffs2_write_nand_badblock(c, jeb, bad_offset)) {
+			/* We'd like to give this block another try. */
+			spin_lock(&c->erase_completion_lock);
+			list_del(&jeb->list);
+			list_add(&jeb->list, &c->erase_pending_list);
+			c->erasing_size -= c->sector_size;
+			c->dirty_size += c->sector_size;
+			jeb->dirty_size = c->sector_size;
+			spin_unlock(&c->erase_completion_lock);
+			return;
+		}
+	}
+
+	spin_lock(&c->erase_completion_lock);
+	c->erasing_size -= c->sector_size;
+	c->bad_size += c->sector_size;
+	list_del(&jeb->list);
+	list_add(&jeb->list, &c->bad_list);
+	c->nr_erasing_blocks--;
+	spin_unlock(&c->erase_completion_lock);
+	wake_up(&c->erase_wait);
 }	 
 
 #ifndef __ECOS
@@ -179,7 +202,7 @@ static void jffs2_erase_callback(struct erase_info *instr)
 
 	if(instr->state != MTD_ERASE_DONE) {
 		printk(KERN_WARNING "Erase at 0x%08x finished, but state != MTD_ERASE_DONE. State is 0x%x instead.\n", instr->addr, instr->state);
-		jffs2_erase_failed(priv->c, priv->jeb);
+		jffs2_erase_failed(priv->c, priv->jeb, instr->fail_addr);
 	} else {
 		jffs2_erase_succeeded(priv->c, priv->jeb);
 	}	
@@ -277,17 +300,13 @@ static void jffs2_free_all_node_refs(struct jffs2_sb_info *c, struct jffs2_erase
 	jeb->last_node = NULL;
 }
 
-void jffs2_erase_pending_trigger(struct jffs2_sb_info *c)
-{
-	OFNI_BS_2SFFJ(c)->s_dirt = 1;
-}
-
 static void jffs2_mark_erased_block(struct jffs2_sb_info *c, struct jffs2_eraseblock *jeb)
 {
 	struct jffs2_raw_node_ref *marker_ref = NULL;
 	unsigned char *ebuf;
 	size_t retlen;
 	int ret;
+	uint32_t bad_offset;
 
 	if (!jffs2_cleanmarker_oob(c)) {
 		marker_ref = jffs2_alloc_raw_node_ref();
@@ -312,6 +331,8 @@ static void jffs2_mark_erased_block(struct jffs2_sb_info *c, struct jffs2_eraseb
 			uint32_t readlen = min((uint32_t)PAGE_SIZE, jeb->offset + c->sector_size - ofs);
 			int i;
 
+			bad_offset = ofs;
+
 			ret = jffs2_flash_read(c, ofs, readlen, &retlen, ebuf);
 			if (ret) {
 				printk(KERN_WARNING "Read of newly-erased block at 0x%08x failed: %d. Putting on bad_list\n", ofs, ret);
@@ -325,22 +346,21 @@ static void jffs2_mark_erased_block(struct jffs2_sb_info *c, struct jffs2_eraseb
 				/* It's OK. We know it's properly aligned */
 				unsigned long datum = *(unsigned long *)(&ebuf[i]);
 				if (datum + 1) {
-					printk(KERN_WARNING "Newly-erased block contained word 0x%lx at offset 0x%08x\n", datum, ofs + i);
+					bad_offset += i;
+					printk(KERN_WARNING "Newly-erased block contained word 0x%lx at offset 0x%08x\n", datum, bad_offset);
 				bad: 
 					if (!jffs2_cleanmarker_oob(c))
 						jffs2_free_raw_node_ref(marker_ref);
-					else 
-						jffs2_write_nand_badblock( c ,jeb );
 					kfree(ebuf);
 				bad2:
 					spin_lock(&c->erase_completion_lock);
-					c->erasing_size -= c->sector_size;
-					c->bad_size += c->sector_size;
-
-					list_add_tail(&jeb->list, &c->bad_list);
-					c->nr_erasing_blocks--;
+					/* Stick it on a list (any list) so
+					   erase_failed can take it right off
+					   again.  Silly, but shouldn't happen
+					   often. */
+					list_add(&jeb->list, &c->erasing_list);
 					spin_unlock(&c->erase_completion_lock);
-					wake_up(&c->erase_wait);
+					jffs2_erase_failed(c, jeb, bad_offset);
 					return;
 				}
 			}
@@ -349,7 +369,9 @@ static void jffs2_mark_erased_block(struct jffs2_sb_info *c, struct jffs2_eraseb
 		}
 		kfree(ebuf);
 	}
-					
+
+	bad_offset = jeb->offset;
+
 	/* Write the erase complete marker */	
 	D1(printk(KERN_DEBUG "Writing erased marker to block at 0x%08x\n", jeb->offset));
 	if (jffs2_cleanmarker_oob(c)) {
@@ -370,29 +392,30 @@ static void jffs2_mark_erased_block(struct jffs2_sb_info *c, struct jffs2_eraseb
 			.totlen =	cpu_to_je32(c->cleanmarker_size)
 		};
 
-		marker.hdr_crc = cpu_to_je32(crc32(0, &marker, je32_to_cpu(marker.totlen) - 4));
+		marker.hdr_crc = cpu_to_je32(crc32(0, &marker, sizeof(struct jffs2_unknown_node)-4));
 
-		ret = jffs2_flash_write(c, jeb->offset, je32_to_cpu(marker.totlen), &retlen, (char *)&marker);
+		/* We only write the header; the rest was noise or padding anyway */
+		ret = jffs2_flash_write(c, jeb->offset, sizeof(marker), &retlen, (char *)&marker);
 		if (ret) {
 			printk(KERN_WARNING "Write clean marker to block at 0x%08x failed: %d\n",
 			       jeb->offset, ret);
 			goto bad2;
 		}
-		if (retlen != je32_to_cpu(marker.totlen)) {
-			printk(KERN_WARNING "Short write to newly-erased block at 0x%08x: Wanted %d, got %zd\n",
-			       jeb->offset, je32_to_cpu(marker.totlen), retlen);
+		if (retlen != sizeof(marker)) {
+			printk(KERN_WARNING "Short write to newly-erased block at 0x%08x: Wanted %zd, got %zd\n",
+			       jeb->offset, sizeof(marker), retlen);
 			goto bad2;
 		}
 
 		marker_ref->next_in_ino = NULL;
 		marker_ref->next_phys = NULL;
 		marker_ref->flash_offset = jeb->offset | REF_NORMAL;
-		marker_ref->totlen = PAD(je32_to_cpu(marker.totlen));
+		marker_ref->__totlen = c->cleanmarker_size;
 			
 		jeb->first_node = jeb->last_node = marker_ref;
 			
-		jeb->free_size = c->sector_size - marker_ref->totlen;
-		jeb->used_size = marker_ref->totlen;
+		jeb->free_size = c->sector_size - c->cleanmarker_size;
+		jeb->used_size = c->cleanmarker_size;
 		jeb->dirty_size = 0;
 		jeb->wasted_size = 0;
 	}
diff --git a/fs/jffs2/file.c b/fs/jffs2/file.c
index 8b3f8e7e5..4b141011f 100644
--- a/fs/jffs2/file.c
+++ b/fs/jffs2/file.c
@@ -7,7 +7,7 @@
  *
  * For licensing information, see the file 'LICENCE' in this directory.
  *
- * $Id: file.c,v 1.96 2003/10/11 11:47:23 dwmw2 Exp $
+ * $Id: file.c,v 1.98 2004/03/19 16:41:09 dwmw2 Exp $
  *
  */
 
@@ -72,7 +72,7 @@ int jffs2_do_readpage_nolock (struct inode *inode, struct page *pg)
 	unsigned char *pg_buf;
 	int ret;
 
-	D1(printk(KERN_DEBUG "jffs2_do_readpage_nolock(): ino #%lu, page at offset 0x%lx\n", inode->i_ino, pg->index << PAGE_CACHE_SHIFT));
+	D2(printk(KERN_DEBUG "jffs2_do_readpage_nolock(): ino #%lu, page at offset 0x%lx\n", inode->i_ino, pg->index << PAGE_CACHE_SHIFT));
 
 	if (!PageLocked(pg))
                 PAGE_BUG(pg);
@@ -93,7 +93,7 @@ int jffs2_do_readpage_nolock (struct inode *inode, struct page *pg)
 	flush_dcache_page(pg);
 	kunmap(pg);
 
-	D1(printk(KERN_DEBUG "readpage finished\n"));
+	D2(printk(KERN_DEBUG "readpage finished\n"));
 	return 0;
 }
 
@@ -207,6 +207,7 @@ int jffs2_commit_write (struct file *filp, struct page *pg, unsigned start, unsi
 	struct jffs2_inode_info *f = JFFS2_INODE_INFO(inode);
 	struct jffs2_sb_info *c = JFFS2_SB_INFO(inode->i_sb);
 	struct jffs2_raw_inode *ri;
+	unsigned aligned_start = start & ~3;
 	int ret = 0;
 	uint32_t writtenlen = 0;
 
@@ -240,9 +241,9 @@ int jffs2_commit_write (struct file *filp, struct page *pg, unsigned start, unsi
 	   hurt to do it again. The alternative is ifdefs, which are ugly. */
 	kmap(pg);
 
-	ret = jffs2_write_inode_range(c, f, ri, page_address(pg) + start,
-				      (pg->index << PAGE_CACHE_SHIFT) + start,
-				      end - start, &writtenlen);
+	ret = jffs2_write_inode_range(c, f, ri, page_address(pg) + aligned_start,
+				      (pg->index << PAGE_CACHE_SHIFT) + aligned_start,
+				      end - aligned_start, &writtenlen);
 
 	kunmap(pg);
 
@@ -250,6 +251,12 @@ int jffs2_commit_write (struct file *filp, struct page *pg, unsigned start, unsi
 		/* There was an error writing. */
 		SetPageError(pg);
 	}
+	
+	/* Adjust writtenlen for the padding we did, so we don't confuse our caller */
+	if (writtenlen < (start&3))
+		writtenlen = 0;
+	else
+		writtenlen -= (start&3);
 
 	if (writtenlen) {
 		if (inode->i_size < (pg->index << PAGE_CACHE_SHIFT) + start + writtenlen) {
diff --git a/fs/jffs2/fs.c b/fs/jffs2/fs.c
index 1f9e5787f..76d7279c8 100644
--- a/fs/jffs2/fs.c
+++ b/fs/jffs2/fs.c
@@ -7,7 +7,7 @@
  *
  * For licensing information, see the file 'LICENCE' in this directory.
  *
- * $Id: fs.c,v 1.32 2003/10/11 11:47:23 dwmw2 Exp $
+ * $Id: fs.c,v 1.46 2004/07/13 08:56:54 dwmw2 Exp $
  *
  */
 
@@ -58,7 +58,7 @@ static int jffs2_do_setattr (struct inode *inode, struct iattr *iattr)
 		mdata = kmalloc(f->metadata->size, GFP_USER);
 		if (!mdata)
 			return -ENOMEM;
-		ret = jffs2_read_dnode(c, f->metadata, mdata, 0, mdatalen);
+		ret = jffs2_read_dnode(c, f, f->metadata, mdata, 0, mdatalen);
 		if (ret) {
 			kfree(mdata);
 			return ret;
@@ -145,10 +145,8 @@ static int jffs2_do_setattr (struct inode *inode, struct iattr *iattr)
 
 	old_metadata = f->metadata;
 
-	if (ivalid & ATTR_SIZE && inode->i_size > iattr->ia_size) {
-		vmtruncate(inode, iattr->ia_size);
+	if (ivalid & ATTR_SIZE && inode->i_size > iattr->ia_size)
 		jffs2_truncate_fraglist (c, &f->fragtree, iattr->ia_size);
-	}
 
 	if (ivalid & ATTR_SIZE && inode->i_size < iattr->ia_size) {
 		jffs2_add_full_dnode_to_inode(c, f, new_metadata);
@@ -166,6 +164,14 @@ static int jffs2_do_setattr (struct inode *inode, struct iattr *iattr)
 	up(&f->sem);
 	jffs2_complete_reservation(c);
 
+	/* We have to do the vmtruncate() without f->sem held, since
+	   some pages may be locked and waiting for it in readpage(). 
+	   We are protected from a simultaneous write() extending i_size
+	   back past iattr->ia_size, because do_truncate() holds the
+	   generic inode semaphore. */
+	if (ivalid & ATTR_SIZE && inode->i_size > iattr->ia_size)
+		vmtruncate(inode, iattr->ia_size);
+
 	return 0;
 }
 
@@ -287,7 +293,7 @@ void jffs2_read_inode (struct inode *inode)
 	case S_IFCHR:
 		/* Read the device numbers from the media */
 		D1(printk(KERN_DEBUG "Reading device numbers from flash\n"));
-		if (jffs2_read_dnode(c, f->metadata, (char *)&rdev, 0, sizeof(rdev)) < 0) {
+		if (jffs2_read_dnode(c, f, f->metadata, (char *)&rdev, 0, sizeof(rdev)) < 0) {
 			/* Eep */
 			printk(KERN_NOTICE "Read device numbers for inode %lu failed\n", (unsigned long)inode->i_ino);
 			up(&f->sem);
@@ -317,7 +323,7 @@ void jffs2_dirty_inode(struct inode *inode)
 	struct iattr iattr;
 
 	if (!(inode->i_state & I_DIRTY_DATASYNC)) {
-		D1(printk(KERN_DEBUG "jffs2_dirty_inode() not calling setattr() for ino #%lu\n", inode->i_ino));
+		D2(printk(KERN_DEBUG "jffs2_dirty_inode() not calling setattr() for ino #%lu\n", inode->i_ino));
 		return;
 	}
 
@@ -343,9 +349,14 @@ int jffs2_remount_fs (struct super_block *sb, int *flags, char *data)
 
 	/* We stop if it was running, then restart if it needs to.
 	   This also catches the case where it was stopped and this
-	   is just a remount to restart it */
-	if (!(sb->s_flags & MS_RDONLY))
+	   is just a remount to restart it.
+	   Flush the writebuffer, if neccecary, else we loose it */
+	if (!(sb->s_flags & MS_RDONLY)) {
 		jffs2_stop_garbage_collect_thread(c);
+		down(&c->alloc_sem);
+		jffs2_flush_wbuf_pad(c);
+		up(&c->alloc_sem);
+	}	
 
 	if (!(*flags & MS_RDONLY))
 		jffs2_start_garbage_collect_thread(c);
@@ -365,7 +376,7 @@ void jffs2_write_super (struct super_block *sb)
 
 	D1(printk(KERN_DEBUG "jffs2_write_super()\n"));
 	jffs2_garbage_collect_trigger(c);
-	jffs2_erase_pending_blocks(c);
+	jffs2_erase_pending_blocks(c, 0);
 	jffs2_flush_wbuf_gc(c, 0);
 }
 
@@ -437,17 +448,35 @@ int jffs2_do_fill_super(struct super_block *sb, void *data, int silent)
 
 	c = JFFS2_SB_INFO(sb);
 
+#ifndef CONFIG_JFFS2_FS_NAND
+	if (c->mtd->type == MTD_NANDFLASH) {
+		printk(KERN_ERR "jffs2: Cannot operate on NAND flash unless jffs2 NAND support is compiled in.\n");
+		return -EINVAL;
+	}
+#endif
+
 	c->flash_size = c->mtd->size;
 
 	/* 
 	 * Check, if we have to concatenate physical blocks to larger virtual blocks
 	 * to reduce the memorysize for c->blocks. (kmalloc allows max. 128K allocation)
 	 */
-	blocks = c->flash_size / c->mtd->erasesize;
-	while ((blocks * sizeof (struct jffs2_eraseblock)) > (128 * 1024))
+	c->sector_size = c->mtd->erasesize; 
+	blocks = c->flash_size / c->sector_size;
+	while ((blocks * sizeof (struct jffs2_eraseblock)) > (128 * 1024)) {
 		blocks >>= 1;
+		c->sector_size <<= 1;
+	}	
 	
-	c->sector_size = c->flash_size / blocks;
+	/*
+	 * Size alignment check
+	 */
+	if ((c->sector_size * blocks) != c->flash_size) {
+		c->flash_size = c->sector_size * blocks;		
+		printk(KERN_INFO "jffs2: Flash size not aligned to erasesize, reducing to %dKiB\n",
+			c->flash_size / 1024);
+	}
+
 	if (c->sector_size != c->mtd->erasesize)
 		printk(KERN_INFO "jffs2: Erase block size too small (%dKiB). Using virtual blocks size (%dKiB) instead\n", 
 			c->mtd->erasesize / 1024, c->sector_size / 1024);
@@ -460,12 +489,10 @@ int jffs2_do_fill_super(struct super_block *sb, void *data, int silent)
 	c->cleanmarker_size = sizeof(struct jffs2_unknown_node);
 	/* Joern -- stick alignment for weird 8-byte-page flash here */
 
-	if (jffs2_cleanmarker_oob(c)) {
-		/* NAND (or other bizarre) flash... do setup accordingly */
-		ret = jffs2_nand_flash_setup(c);
-		if (ret)
-			return ret;
-	}
+	/* NAND (or other bizarre) flash... do setup accordingly */
+	ret = jffs2_flash_setup(c);
+	if (ret)
+		return ret;
 
 	c->inocache_list = kmalloc(INOCACHE_HASHSIZE * sizeof(struct jffs2_inode_cache *), GFP_KERNEL);
 	if (!c->inocache_list) {
@@ -510,7 +537,126 @@ int jffs2_do_fill_super(struct super_block *sb, void *data, int silent)
  out_inohash:
 	kfree(c->inocache_list);
  out_wbuf:
-	jffs2_nand_flash_cleanup(c);
+	jffs2_flash_cleanup(c);
+
+	return ret;
+}
+
+void jffs2_gc_release_inode(struct jffs2_sb_info *c,
+				   struct jffs2_inode_info *f)
+{
+	iput(OFNI_EDONI_2SFFJ(f));
+}
+
+struct jffs2_inode_info *jffs2_gc_fetch_inode(struct jffs2_sb_info *c,
+						     int inum, int nlink)
+{
+	struct inode *inode;
+	struct jffs2_inode_cache *ic;
+	if (!nlink) {
+		/* The inode has zero nlink but its nodes weren't yet marked
+		   obsolete. This has to be because we're still waiting for 
+		   the final (close() and) iput() to happen.
+
+		   There's a possibility that the final iput() could have 
+		   happened while we were contemplating. In order to ensure
+		   that we don't cause a new read_inode() (which would fail)
+		   for the inode in question, we use ilookup() in this case
+		   instead of iget().
+
+		   The nlink can't _become_ zero at this point because we're 
+		   holding the alloc_sem, and jffs2_do_unlink() would also
+		   need that while decrementing nlink on any inode.
+		*/
+		inode = ilookup(OFNI_BS_2SFFJ(c), inum);
+		if (!inode) {
+			D1(printk(KERN_DEBUG "ilookup() failed for ino #%u; inode is probably deleted.\n",
+				  inum));
+
+			spin_lock(&c->inocache_lock);
+			ic = jffs2_get_ino_cache(c, inum);
+			if (!ic) {
+				D1(printk(KERN_DEBUG "Inode cache for ino #%u is gone.\n", inum));
+				spin_unlock(&c->inocache_lock);
+				return NULL;
+			}
+			if (ic->state != INO_STATE_CHECKEDABSENT) {
+				/* Wait for progress. Don't just loop */
+				D1(printk(KERN_DEBUG "Waiting for ino #%u in state %d\n",
+					  ic->ino, ic->state));
+				sleep_on_spinunlock(&c->inocache_wq, &c->inocache_lock);
+			} else {
+				spin_unlock(&c->inocache_lock);
+			}
+
+			return NULL;
+		}
+	} else {
+		/* Inode has links to it still; they're not going away because
+		   jffs2_do_unlink() would need the alloc_sem and we have it.
+		   Just iget() it, and if read_inode() is necessary that's OK.
+		*/
+		inode = iget(OFNI_BS_2SFFJ(c), inum);
+		if (!inode)
+			return ERR_PTR(-ENOMEM);
+	}
+	if (is_bad_inode(inode)) {
+		printk(KERN_NOTICE "Eep. read_inode() failed for ino #%u. nlink %d\n",
+		       inum, nlink);
+		/* NB. This will happen again. We need to do something appropriate here. */
+		iput(inode);
+		return ERR_PTR(-EIO);
+	}
+
+	return JFFS2_INODE_INFO(inode);
+}
+
+unsigned char *jffs2_gc_fetch_page(struct jffs2_sb_info *c, 
+				   struct jffs2_inode_info *f, 
+				   unsigned long offset,
+				   unsigned long *priv)
+{
+	struct inode *inode = OFNI_EDONI_2SFFJ(f);
+	struct page *pg;
+
+	pg = read_cache_page(inode->i_mapping, offset >> PAGE_CACHE_SHIFT, 
+			     (void *)jffs2_do_readpage_unlock, inode);
+	if (IS_ERR(pg))
+		return (void *)pg;
+	
+	*priv = (unsigned long)pg;
+	return kmap(pg);
+}
+
+void jffs2_gc_release_page(struct jffs2_sb_info *c,
+			   unsigned char *ptr,
+			   unsigned long *priv)
+{
+	struct page *pg = (void *)*priv;
+
+	kunmap(pg);
+	page_cache_release(pg);
+}
+
+int jffs2_flash_setup(struct jffs2_sb_info *c) {
+	int ret = 0;
+	
+	if (jffs2_cleanmarker_oob(c)) {
+		/* NAND flash... do setup accordingly */
+		ret = jffs2_nand_flash_setup(c);
+		if (ret)
+			return ret;
+	}
 
+	/* add setups for other bizarre flashes here... */
 	return ret;
 }
+
+void jffs2_flash_cleanup(struct jffs2_sb_info *c) {
+
+	if (jffs2_cleanmarker_oob(c)) {
+		jffs2_nand_flash_cleanup(c);
+	}
+
+	/* add cleanups for other bizarre flashes here... */
+}
diff --git a/fs/jffs2/gc.c b/fs/jffs2/gc.c
index 1cc6bfc8f..dc25d812a 100644
--- a/fs/jffs2/gc.c
+++ b/fs/jffs2/gc.c
@@ -7,7 +7,7 @@
  *
  * For licensing information, see the file 'LICENCE' in this directory.
  *
- * $Id: gc.c,v 1.114 2003/10/09 13:53:35 dwmw2 Exp $
+ * $Id: gc.c,v 1.136 2004/05/27 19:06:09 gleixner Exp $
  *
  */
 
@@ -19,6 +19,7 @@
 #include <linux/compiler.h>
 #include <linux/stat.h>
 #include "nodelist.h"
+#include "compr.h"
 
 static int jffs2_garbage_collect_pristine(struct jffs2_sb_info *c, 
 					  struct jffs2_inode_cache *ic,
@@ -36,7 +37,7 @@ static int jffs2_garbage_collect_dnode(struct jffs2_sb_info *c, struct jffs2_era
 				       struct jffs2_inode_info *f, struct jffs2_full_dnode *fn,
 				       uint32_t start, uint32_t end);
 static int jffs2_garbage_collect_live(struct jffs2_sb_info *c,  struct jffs2_eraseblock *jeb,
-			       struct jffs2_raw_node_ref *raw, struct jffs2_inode_cache *ic);
+			       struct jffs2_raw_node_ref *raw, struct jffs2_inode_info *f);
 
 /* Called with erase_completion_lock held */
 static struct jffs2_eraseblock *jffs2_find_gc_block(struct jffs2_sb_info *c)
@@ -80,7 +81,7 @@ static struct jffs2_eraseblock *jffs2_find_gc_block(struct jffs2_sb_info *c)
 		nextlist = &c->erasable_list;
 	} else {
 		/* Eep. All were empty */
-		printk(KERN_NOTICE "jffs2: No clean, dirty _or_ erasable blocks to GC from! Where are they all?\n");
+		D1(printk(KERN_NOTICE "jffs2: No clean, dirty _or_ erasable blocks to GC from! Where are they all?\n"));
 		return NULL;
 	}
 
@@ -112,11 +113,11 @@ static struct jffs2_eraseblock *jffs2_find_gc_block(struct jffs2_sb_info *c)
  */
 int jffs2_garbage_collect_pass(struct jffs2_sb_info *c)
 {
+	struct jffs2_inode_info *f;
 	struct jffs2_inode_cache *ic;
 	struct jffs2_eraseblock *jeb;
 	struct jffs2_raw_node_ref *raw;
-	uint32_t inum;
-	int ret = 0;
+	int ret = 0, inum, nlink;
 
 	if (down_interruptible(&c->alloc_sem))
 		return -EINTR;
@@ -186,7 +187,7 @@ int jffs2_garbage_collect_pass(struct jffs2_sb_info *c)
 		ic->state = INO_STATE_CHECKING;
 		spin_unlock(&c->inocache_lock);
 
-		D1(printk(KERN_DEBUG "jffs2_garbage_collect_pass() triggering inode scan of ino#%d\n", ic->ino));
+		D1(printk(KERN_DEBUG "jffs2_garbage_collect_pass() triggering inode scan of ino#%u\n", ic->ino));
 
 		ret = jffs2_do_crccheck_inode(c, ic);
 		if (ret)
@@ -204,7 +205,7 @@ int jffs2_garbage_collect_pass(struct jffs2_sb_info *c)
 		jeb = jffs2_find_gc_block(c);
 
 	if (!jeb) {
-		printk(KERN_NOTICE "jffs2: Couldn't find erase block to garbage collect!\n");
+		D1 (printk(KERN_NOTICE "jffs2: Couldn't find erase block to garbage collect!\n"));
 		spin_unlock(&c->erase_completion_lock);
 		up(&c->alloc_sem);
 		return -EIO;
@@ -223,17 +224,21 @@ int jffs2_garbage_collect_pass(struct jffs2_sb_info *c)
 			
 	while(ref_obsolete(raw)) {
 		D1(printk(KERN_DEBUG "Node at 0x%08x is obsolete... skipping\n", ref_offset(raw)));
-		jeb->gc_node = raw = raw->next_phys;
-		if (!raw) {
+		raw = raw->next_phys;
+		if (unlikely(!raw)) {
 			printk(KERN_WARNING "eep. End of raw list while still supposedly nodes to GC\n");
 			printk(KERN_WARNING "erase block at 0x%08x. free_size 0x%08x, dirty_size 0x%08x, used_size 0x%08x\n", 
 			       jeb->offset, jeb->free_size, jeb->dirty_size, jeb->used_size);
+			jeb->gc_node = raw;
 			spin_unlock(&c->erase_completion_lock);
 			up(&c->alloc_sem);
 			BUG();
 		}
 	}
+	jeb->gc_node = raw;
+
 	D1(printk(KERN_DEBUG "Going to garbage collect node at 0x%08x\n", ref_offset(raw)));
+
 	if (!raw->next_in_ino) {
 		/* Inode-less node. Clean marker, snapshot or something like that */
 		/* FIXME: If it's something that needs to be copied, including something
@@ -243,13 +248,17 @@ int jffs2_garbage_collect_pass(struct jffs2_sb_info *c)
 		up(&c->alloc_sem);
 		goto eraseit_lock;
 	}
-						     
-	inum = jffs2_raw_ref_to_inum(raw);
-	D1(printk(KERN_DEBUG "Inode number is #%u\n", inum));
+
+	ic = jffs2_raw_ref_to_ic(raw);
+
+	/* We need to hold the inocache. Either the erase_completion_lock or
+	   the inocache_lock are sufficient; we trade down since the inocache_lock 
+	   causes less contention. */
+	spin_lock(&c->inocache_lock);
 
 	spin_unlock(&c->erase_completion_lock);
 
-	D1(printk(KERN_DEBUG "jffs2_garbage_collect_pass collecting from block @0x%08x. Node @0x%08x(%d), ino #%u\n", jeb->offset, ref_offset(raw), ref_flags(raw), inum));
+	D1(printk(KERN_DEBUG "jffs2_garbage_collect_pass collecting from block @0x%08x. Node @0x%08x(%d), ino #%u\n", jeb->offset, ref_offset(raw), ref_flags(raw), ic->ino));
 
 	/* Three possibilities:
 	   1. Inode is already in-core. We must iget it and do proper
@@ -259,11 +268,6 @@ int jffs2_garbage_collect_pass(struct jffs2_sb_info *c)
 	   3. Inode is not in-core, node is not pristine. We must iget()
 	      and take the slow path.
 	*/
-	spin_lock(&c->inocache_lock);
-	ic = jffs2_get_ino_cache(c, inum);
-
-	/* This should never fail unless I'm particularly stupid.
-	   So we don't check before dereferencing it */
 
 	switch(ic->state) {
 	case INO_STATE_CHECKEDABSENT:
@@ -275,28 +279,28 @@ int jffs2_garbage_collect_pass(struct jffs2_sb_info *c)
 			ic->state = INO_STATE_GC;
 		else {
 			D1(printk(KERN_DEBUG "Ino #%u is absent but node not REF_PRISTINE. Reading.\n", 
-				  inum));
+				  ic->ino));
 		}
 		break;
 
 	case INO_STATE_PRESENT:
-	case INO_STATE_UNCHECKED:
-		/* It's in-core or hasn't been checked. GC must iget() it. */
+		/* It's in-core. GC must iget() it. */
 		break;
 
+	case INO_STATE_UNCHECKED:
 	case INO_STATE_CHECKING:
+	case INO_STATE_GC:
 		/* Should never happen. We should have finished checking
-		   by the time we actually start doing any GC. */
+		   by the time we actually start doing any GC, and since 
+		   we're holding the alloc_sem, no other garbage collection 
+		   can happen.
+		*/
+		printk(KERN_CRIT "Inode #%u already in state %d in jffs2_garbage_collect_pass()!\n",
+		       ic->ino, ic->state);
+		up(&c->alloc_sem);
+		spin_unlock(&c->inocache_lock);
 		BUG();
 
-	
-	case INO_STATE_GC:
-		/* Should never happen. We are holding the alloc_sem, 
-		   no other garbage collection can happen. Note that we
-		   do depend on this later when deciding to do a simple
-		   node copy */
-		BUG();
-			 
 	case INO_STATE_READING:
 		/* Someone's currently trying to read it. We must wait for
 		   them to finish and then go through the full iget() route
@@ -306,7 +310,7 @@ int jffs2_garbage_collect_pass(struct jffs2_sb_info *c)
 
 		up(&c->alloc_sem);
 		D1(printk(KERN_DEBUG "jffs2_garbage_collect_pass() waiting for ino #%u in state %d\n",
-			  inum, ic->state));
+			  ic->ino, ic->state));
 		sleep_on_spinunlock(&c->inocache_wq, &c->inocache_lock);
 		/* And because we dropped the alloc_sem we must start again from the 
 		   beginning. Ponder chance of livelock here -- we're returning success
@@ -319,27 +323,50 @@ int jffs2_garbage_collect_pass(struct jffs2_sb_info *c)
 		   A: Small enough that I don't care :) 
 		*/
 		return 0;
-
 	}
 
-	spin_unlock(&c->inocache_lock);
-
 	/* OK. Now if the inode is in state INO_STATE_GC, we are going to copy the
 	   node intact, and we don't have to muck about with the fragtree etc. 
 	   because we know it's not in-core. If it _was_ in-core, we go through
 	   all the iget() crap anyway */
 
 	if (ic->state == INO_STATE_GC) {
+		spin_unlock(&c->inocache_lock);
+
 		ret = jffs2_garbage_collect_pristine(c, ic, raw);
-		jffs2_set_inocache_state(c, ic, INO_STATE_CHECKEDABSENT);
 
-		if (ret != -EBADFD)
+		spin_lock(&c->inocache_lock);
+		ic->state = INO_STATE_CHECKEDABSENT;
+		wake_up(&c->inocache_wq);
+
+		if (ret != -EBADFD) {
+			spin_unlock(&c->inocache_lock);
 			goto release_sem;
+		}
 
-		/* Fall through if it wanted us to */
+		/* Fall through if it wanted us to, with inocache_lock held */
 	}
 
-	ret = jffs2_garbage_collect_live(c, jeb, raw, ic);
+	/* Prevent the fairly unlikely race where the gcblock is
+	   entirely obsoleted by the final close of a file which had
+	   the only valid nodes in the block, followed by erasure,
+	   followed by freeing of the ic because the erased block(s)
+	   held _all_ the nodes of that inode.... never been seen but
+	   it's vaguely possible. */
+
+	inum = ic->ino;
+	nlink = ic->nlink;
+	spin_unlock(&c->inocache_lock);
+
+	f = jffs2_gc_fetch_inode(c, inum, nlink);
+	if (IS_ERR(f))
+		return PTR_ERR(f);
+	if (!f)
+		return 0;
+
+	ret = jffs2_garbage_collect_live(c, jeb, raw, f);
+
+	jffs2_gc_release_inode(c, f);
 
  release_sem:
 	up(&c->alloc_sem);
@@ -362,38 +389,35 @@ int jffs2_garbage_collect_pass(struct jffs2_sb_info *c)
 	return ret;
 }
 
-
 static int jffs2_garbage_collect_live(struct jffs2_sb_info *c,  struct jffs2_eraseblock *jeb,
-			       struct jffs2_raw_node_ref *raw, struct jffs2_inode_cache *ic)
+				      struct jffs2_raw_node_ref *raw, struct jffs2_inode_info *f)
 {
-	struct jffs2_inode_info *f;
 	struct jffs2_node_frag *frag;
 	struct jffs2_full_dnode *fn = NULL;
 	struct jffs2_full_dirent *fd;
 	uint32_t start = 0, end = 0, nrfrags = 0;
-	struct inode *inode;
 	int ret = 0;
 
-	inode = iget(OFNI_BS_2SFFJ(c), ic->ino);
-	if (is_bad_inode(inode)) {
-		printk(KERN_NOTICE "Eep. read_inode() failed for ino #%u\n", ic->ino);
-		/* NB. This will happen again. We need to do something appropriate here. */
-		up(&c->alloc_sem);
-		iput(inode);
-		return -EIO;
-	}
-
-	f = JFFS2_INODE_INFO(inode);
 	down(&f->sem);
 
 	/* Now we have the lock for this inode. Check that it's still the one at the head
 	   of the list. */
 
+	spin_lock(&c->erase_completion_lock);
+
+	if (c->gcblock != jeb) {
+		spin_unlock(&c->erase_completion_lock);
+		D1(printk(KERN_DEBUG "GC block is no longer gcblock. Restart\n"));
+		goto upnout;
+	}
 	if (ref_obsolete(raw)) {
+		spin_unlock(&c->erase_completion_lock);
 		D1(printk(KERN_DEBUG "node to be GC'd was obsoleted in the meantime.\n"));
 		/* They'll call again */
 		goto upnout;
 	}
+	spin_unlock(&c->erase_completion_lock);
+
 	/* OK. Looks safe. And nobody can get us now because we have the semaphore. Move the block */
 	if (f->metadata && f->metadata->raw == raw) {
 		fn = f->metadata;
@@ -406,30 +430,6 @@ static int jffs2_garbage_collect_live(struct jffs2_sb_info *c,  struct jffs2_era
 		if (frag->node && frag->node->raw == raw) {
 			fn = frag->node;
 			end = frag->ofs + frag->size;
-#if 1 /* Temporary debugging sanity checks, till we're ready to _trust_ the REF_PRISTINE flag stuff */ 
-			if (!nrfrags && ref_flags(fn->raw) == REF_PRISTINE) {
-				if (fn->frags > 1) {
-					printk(KERN_WARNING "REF_PRISTINE node at 0x%08x had %d frags. Tell dwmw2\n", ref_offset(raw), fn->frags);
-					mark_ref_normal(raw);
-				}
-				/* A hole node which isn't multi-page should be garbage-collected
-				   and merged anyway, so we just check for the frag size here,
-				   rather than mucking around with actually reading the node
-				   and checking the compression type, which is the real way
-				   to tell a hole node. */
-				if (frag->ofs & (PAGE_CACHE_SIZE-1) && frag_prev(frag) && frag_prev(frag)->size < PAGE_CACHE_SIZE) {
-					printk(KERN_WARNING "REF_PRISTINE node at 0x%08x had a previous non-hole frag in the same page. Tell dwmw2\n",
-					       ref_offset(raw));
-					mark_ref_normal(raw);
-				}
-
-				if ((frag->ofs+frag->size) & (PAGE_CACHE_SIZE-1) && frag_next(frag) && frag_next(frag)->size < PAGE_CACHE_SIZE) {
-					printk(KERN_WARNING "REF_PRISTINE node at 0x%08x (%08x-%08x) had a following non-hole frag in the same page. Tell dwmw2\n",
-					       ref_offset(raw), frag->ofs, frag->ofs+frag->size);
-					mark_ref_normal(raw);
-				}
-			}
-#endif
 			if (!nrfrags++)
 				start = frag->ofs;
 			if (nrfrags == frag->node->frags)
@@ -438,10 +438,10 @@ static int jffs2_garbage_collect_live(struct jffs2_sb_info *c,  struct jffs2_era
 	}
 	if (fn) {
 		if (ref_flags(raw) == REF_PRISTINE) {
-			ret = jffs2_garbage_collect_pristine(c, ic, raw);
+			ret = jffs2_garbage_collect_pristine(c, f->inocache, raw);
 			if (!ret) {
 				/* Urgh. Return it sensibly. */
-				frag->node->raw = ic->nodes;
+				frag->node->raw = f->inocache->nodes;
 			}	
 			if (ret != -EBADFD)
 				goto upnout;
@@ -478,7 +478,6 @@ static int jffs2_garbage_collect_live(struct jffs2_sb_info *c,  struct jffs2_era
 	}
  upnout:
 	up(&f->sem);
-	iput(inode);
 
 	return ret;
 }
@@ -492,30 +491,32 @@ static int jffs2_garbage_collect_pristine(struct jffs2_sb_info *c,
 	size_t retlen;
 	int ret;
 	uint32_t phys_ofs, alloclen;
-	uint32_t crc;
+	uint32_t crc, rawlen;
 	int retried = 0;
 
 	D1(printk(KERN_DEBUG "Going to GC REF_PRISTINE node at 0x%08x\n", ref_offset(raw)));
 
+	rawlen = ref_totlen(c, c->gcblock, raw);
+
 	/* Ask for a small amount of space (or the totlen if smaller) because we
 	   don't want to force wastage of the end of a block if splitting would
 	   work. */
-	ret = jffs2_reserve_space_gc(c, min_t(uint32_t, sizeof(struct jffs2_raw_inode) + JFFS2_MIN_DATA_LEN, raw->totlen),
-				     &phys_ofs, &alloclen);
+	ret = jffs2_reserve_space_gc(c, min_t(uint32_t, sizeof(struct jffs2_raw_inode) + JFFS2_MIN_DATA_LEN, 
+					      rawlen), &phys_ofs, &alloclen);
 	if (ret)
 		return ret;
 
-	if (alloclen < raw->totlen) {
+	if (alloclen < rawlen) {
 		/* Doesn't fit untouched. We'll go the old route and split it */
 		return -EBADFD;
 	}
 
-	node = kmalloc(raw->totlen, GFP_KERNEL);
+	node = kmalloc(rawlen, GFP_KERNEL);
 	if (!node)
                return -ENOMEM;
 
-	ret = jffs2_flash_read(c, ref_offset(raw), raw->totlen, &retlen, (char *)node);
-	if (!ret && retlen != raw->totlen)
+	ret = jffs2_flash_read(c, ref_offset(raw), rawlen, &retlen, (char *)node);
+	if (!ret && retlen != rawlen)
 		ret = -EIO;
 	if (ret)
 		goto out_node;
@@ -578,14 +579,14 @@ static int jffs2_garbage_collect_pristine(struct jffs2_sb_info *c,
 	/* OK, all the CRCs are good; this node can just be copied as-is. */
  retry:
 	nraw->flash_offset = phys_ofs;
-	nraw->totlen = raw->totlen;
+	nraw->__totlen = rawlen;
 	nraw->next_phys = NULL;
 
-	ret = jffs2_flash_write(c, phys_ofs, raw->totlen, &retlen, (char *)node);
+	ret = jffs2_flash_write(c, phys_ofs, rawlen, &retlen, (char *)node);
 
-	if (ret || (retlen != raw->totlen)) {
+	if (ret || (retlen != rawlen)) {
 		printk(KERN_NOTICE "Write of %d bytes at 0x%08x failed. returned %d, retlen %zd\n",
-                       raw->totlen, phys_ofs, ret, retlen);
+                       rawlen, phys_ofs, ret, retlen);
 		if (retlen) {
                         /* Doesn't belong to any inode */
 			nraw->next_in_ino = NULL;
@@ -609,7 +610,7 @@ static int jffs2_garbage_collect_pristine(struct jffs2_sb_info *c,
 			ACCT_SANITY_CHECK(c,jeb);
 			D1(ACCT_PARANOIA_CHECK(jeb));
 
-			ret = jffs2_reserve_space_gc(c, raw->totlen, &phys_ofs, &dummy);
+			ret = jffs2_reserve_space_gc(c, rawlen, &phys_ofs, &dummy);
 
 			if (!ret) {
 				D1(printk(KERN_DEBUG "Allocated space at 0x%08x to retry failed write.\n", phys_ofs));
@@ -674,7 +675,7 @@ static int jffs2_garbage_collect_metadata(struct jffs2_sb_info *c, struct jffs2_
 			printk(KERN_WARNING "kmalloc of mdata failed in jffs2_garbage_collect_metadata()\n");
 			return -ENOMEM;
 		}
-		ret = jffs2_read_dnode(c, fn, mdata, 0, mdatalen);
+		ret = jffs2_read_dnode(c, f, fn, mdata, 0, mdatalen);
 		if (ret) {
 			printk(KERN_WARNING "read of old metadata failed in jffs2_garbage_collect_metadata(): %d\n", ret);
 			kfree(mdata);
@@ -779,13 +780,17 @@ static int jffs2_garbage_collect_deletion_dirent(struct jffs2_sb_info *c, struct
 	   delete a 'real' dirent with the same name that's still
 	   somewhere else on the flash. */
 	if (!jffs2_can_mark_obsolete(c)) {
-		struct jffs2_raw_dirent rd;
+		struct jffs2_raw_dirent *rd;
 		struct jffs2_raw_node_ref *raw;
 		int ret;
 		size_t retlen;
 		int name_len = strlen(fd->name);
 		uint32_t name_crc = crc32(0, fd->name, name_len);
-		char *namebuf = NULL;
+		uint32_t rawlen = ref_totlen(c, jeb, fd->raw);
+
+		rd = kmalloc(rawlen, GFP_KERNEL);
+		if (!rd)
+			return -ENOMEM;
 
 		/* Prevent the erase code from nicking the obsolete node refs while
 		   we're looking at them. I really don't like this extra lock but
@@ -793,91 +798,66 @@ static int jffs2_garbage_collect_deletion_dirent(struct jffs2_sb_info *c, struct
 		down(&c->erase_free_sem);
 
 		for (raw = f->inocache->nodes; raw != (void *)f->inocache; raw = raw->next_in_ino) {
+
 			/* We only care about obsolete ones */
 			if (!(ref_obsolete(raw)))
 				continue;
 
+			/* Any dirent with the same name is going to have the same length... */
+			if (ref_totlen(c, NULL, raw) != rawlen)
+				continue;
+
 			/* Doesn't matter if there's one in the same erase block. We're going to 
 			   delete it too at the same time. */
 			if ((raw->flash_offset & ~(c->sector_size-1)) ==
 			    (fd->raw->flash_offset & ~(c->sector_size-1)))
 				continue;
 
-			/* This is an obsolete node belonging to the same directory */
-			ret = jffs2_flash_read(c, ref_offset(raw), sizeof(struct jffs2_unknown_node), &retlen, (char *)&rd);
+			D1(printk(KERN_DEBUG "Check potential deletion dirent at %08x\n", ref_offset(raw)));
+
+			/* This is an obsolete node belonging to the same directory, and it's of the right
+			   length. We need to take a closer look...*/
+			ret = jffs2_flash_read(c, ref_offset(raw), rawlen, &retlen, (char *)rd);
 			if (ret) {
-				printk(KERN_WARNING "jffs2_g_c_deletion_dirent(): Read error (%d) reading header from obsolete node at %08x\n", ret, ref_offset(raw));
+				printk(KERN_WARNING "jffs2_g_c_deletion_dirent(): Read error (%d) reading obsolete node at %08x\n", ret, ref_offset(raw));
 				/* If we can't read it, we don't need to continue to obsolete it. Continue */
 				continue;
 			}
-			if (retlen != sizeof(struct jffs2_unknown_node)) {
-				printk(KERN_WARNING "jffs2_g_c_deletion_dirent(): Short read (%zd not %zd) reading header from obsolete node at %08x\n",
-				       retlen, sizeof(struct jffs2_unknown_node), ref_offset(raw));
+			if (retlen != rawlen) {
+				printk(KERN_WARNING "jffs2_g_c_deletion_dirent(): Short read (%zd not %u) reading header from obsolete node at %08x\n",
+				       retlen, rawlen, ref_offset(raw));
 				continue;
 			}
-			if (je16_to_cpu(rd.nodetype) != JFFS2_NODETYPE_DIRENT ||
-			    PAD(je32_to_cpu(rd.totlen)) != PAD(sizeof(rd) + name_len))
-				continue;
 
-			/* OK, it's a dirent node, it's the right length. We have to take a 
-			   closer look at it... */
-			ret = jffs2_flash_read(c, ref_offset(raw), sizeof(rd), &retlen, (char *)&rd);
-			if (ret) {
-				printk(KERN_WARNING "jffs2_g_c_deletion_dirent(): Read error (%d) reading from obsolete node at %08x\n", ret, ref_offset(raw));
-				/* If we can't read it, we don't need to continune to obsolete it. Continue */
+			if (je16_to_cpu(rd->nodetype) != JFFS2_NODETYPE_DIRENT)
 				continue;
-			}
-			if (retlen != sizeof(rd)) {
-				printk(KERN_WARNING "jffs2_g_c_deletion_dirent(): Short read (%zd not %zd) reading from obsolete node at %08x\n",
-				       retlen, sizeof(rd), ref_offset(raw));
-				continue;
-			}
 
 			/* If the name CRC doesn't match, skip */
-			if (je32_to_cpu(rd.name_crc) != name_crc)
+			if (je32_to_cpu(rd->name_crc) != name_crc)
 				continue;
+
 			/* If the name length doesn't match, or it's another deletion dirent, skip */
-			if (rd.nsize != name_len || !je32_to_cpu(rd.ino))
+			if (rd->nsize != name_len || !je32_to_cpu(rd->ino))
 				continue;
 
 			/* OK, check the actual name now */
-			if (!namebuf) {
-				namebuf = kmalloc(name_len + 1, GFP_KERNEL);
-				if (!namebuf) {
-					up(&c->erase_free_sem);
-					return -ENOMEM;
-				}
-			}
-			/* We read the extra byte before it so it's a word-aligned read */
-			ret = jffs2_flash_read(c, (ref_offset(raw))+sizeof(rd)-1, name_len+1, &retlen, namebuf);
-			if (ret) {
-				printk(KERN_WARNING "jffs2_g_c_deletion_dirent(): Read error (%d) reading name from obsolete node at %08x\n", ret, ref_offset(raw));
-				/* If we can't read it, we don't need to continune to obsolete it. Continue */
-				continue;
-			}
-			if (retlen != name_len+1) {
-				printk(KERN_WARNING "jffs2_g_c_deletion_dirent(): Short read (%zd not %d) reading name from obsolete node at %08x\n",
-				       retlen, name_len+1, ref_offset(raw));
-				continue;
-			}
-			if (memcmp(namebuf+1, fd->name, name_len))
+			if (memcmp(rd->name, fd->name, name_len))
 				continue;
 
 			/* OK. The name really does match. There really is still an older node on
 			   the flash which our deletion dirent obsoletes. So we have to write out
 			   a new deletion dirent to replace it */
-			
-			if (namebuf)
-				kfree(namebuf);
-
 			up(&c->erase_free_sem);
+
+			D1(printk(KERN_DEBUG "Deletion dirent at %08x still obsoletes real dirent \"%s\" at %08x for ino #%u\n",
+				  ref_offset(fd->raw), fd->name, ref_offset(raw), je32_to_cpu(rd->ino)));
+			kfree(rd);
+
 			return jffs2_garbage_collect_dirent(c, jeb, f, fd);
 		}
 
 		up(&c->erase_free_sem);
-
-		if (namebuf) 
-			kfree(namebuf);
+		kfree(rd);
 	}
 
 	/* No need for it any more. Just mark it obsolete and remove it from the list */
@@ -1008,6 +988,9 @@ static int jffs2_garbage_collect_hole(struct jffs2_sb_info *c, struct jffs2_eras
 		       je32_to_cpu(ri.ino));
 	});
 
+	/* This is a partially-overlapped hole node. Mark it REF_NORMAL not REF_PRISTINE */
+	mark_ref_normal(new_fn->raw);
+
 	for (frag = jffs2_lookup_node_frag(&f->fragtree, fn->ofs); 
 	     frag; frag = frag_next(frag)) {
 		if (frag->ofs > fn->size + fn->ofs)
@@ -1042,10 +1025,9 @@ static int jffs2_garbage_collect_dnode(struct jffs2_sb_info *c, struct jffs2_era
 	uint32_t alloclen, phys_ofs, offset, orig_end, orig_start;	
 	int ret = 0;
 	unsigned char *comprbuf = NULL, *writebuf;
-	struct page *pg;
+	unsigned long pg;
 	unsigned char *pg_ptr;
-	/* FIXME: */ struct inode *inode = OFNI_EDONI_2SFFJ(f);
-
+ 
 	memset(&ri, 0, sizeof(ri));
 
 	D1(printk(KERN_DEBUG "Writing replacement dnode for ino #%u from offset 0x%x to 0x%x\n",
@@ -1184,23 +1166,18 @@ static int jffs2_garbage_collect_dnode(struct jffs2_sb_info *c, struct jffs2_era
 	 *    page OK. We'll actually write it out again in commit_write, which is a little
 	 *    suboptimal, but at least we're correct.
 	 */
-#ifdef __ECOS
-	pg = read_cache_page(start >> PAGE_CACHE_SHIFT, (void *)jffs2_do_readpage_unlock, inode);
-#else
-	pg = read_cache_page(inode->i_mapping, start >> PAGE_CACHE_SHIFT, (void *)jffs2_do_readpage_unlock, inode);
-#endif
-	if (IS_ERR(pg)) {
-		printk(KERN_WARNING "read_cache_page() returned error: %ld\n", PTR_ERR(pg));
-		return PTR_ERR(pg);
+	pg_ptr = jffs2_gc_fetch_page(c, f, start, &pg);
+
+	if (IS_ERR(pg_ptr)) {
+		printk(KERN_WARNING "read_cache_page() returned error: %ld\n", PTR_ERR(pg_ptr));
+		return PTR_ERR(pg_ptr);
 	}
-	pg_ptr = (char *)kmap(pg);
-	comprbuf = kmalloc(end - start, GFP_KERNEL);
 
 	offset = start;
 	while(offset < orig_end) {
 		uint32_t datalen;
 		uint32_t cdatalen;
-		char comprtype = JFFS2_COMPR_NONE;
+		uint16_t comprtype = JFFS2_COMPR_NONE;
 
 		ret = jffs2_reserve_space_gc(c, sizeof(ri) + JFFS2_MIN_DATA_LEN, &phys_ofs, &alloclen);
 
@@ -1214,14 +1191,8 @@ static int jffs2_garbage_collect_dnode(struct jffs2_sb_info *c, struct jffs2_era
 
 		writebuf = pg_ptr + (offset & (PAGE_CACHE_SIZE -1));
 
-		if (comprbuf) {
-			comprtype = jffs2_compress(writebuf, comprbuf, &datalen, &cdatalen);
-		}
-		if (comprtype) {
-			writebuf = comprbuf;
-		} else {
-			datalen = cdatalen;
-		}
+		comprtype = jffs2_compress(c, f, writebuf, &comprbuf, &datalen, &cdatalen);
+
 		ri.magic = cpu_to_je16(JFFS2_MAGIC_BITMASK);
 		ri.nodetype = cpu_to_je16(JFFS2_NODETYPE_INODE);
 		ri.totlen = cpu_to_je32(sizeof(ri) + cdatalen);
@@ -1239,11 +1210,14 @@ static int jffs2_garbage_collect_dnode(struct jffs2_sb_info *c, struct jffs2_era
 		ri.offset = cpu_to_je32(offset);
 		ri.csize = cpu_to_je32(cdatalen);
 		ri.dsize = cpu_to_je32(datalen);
-		ri.compr = comprtype;
+		ri.compr = comprtype & 0xff;
+		ri.usercompr = (comprtype >> 8) & 0xff;
 		ri.node_crc = cpu_to_je32(crc32(0, &ri, sizeof(ri)-8));
-		ri.data_crc = cpu_to_je32(crc32(0, writebuf, cdatalen));
+		ri.data_crc = cpu_to_je32(crc32(0, comprbuf, cdatalen));
 	
-		new_fn = jffs2_write_dnode(c, f, &ri, writebuf, cdatalen, phys_ofs, ALLOC_GC);
+		new_fn = jffs2_write_dnode(c, f, &ri, comprbuf, cdatalen, phys_ofs, ALLOC_GC);
+
+		jffs2_free_comprbuf(comprbuf, writebuf);
 
 		if (IS_ERR(new_fn)) {
 			printk(KERN_WARNING "Error writing new dnode: %ld\n", PTR_ERR(new_fn));
@@ -1258,12 +1232,8 @@ static int jffs2_garbage_collect_dnode(struct jffs2_sb_info *c, struct jffs2_era
 			f->metadata = NULL;
 		}
 	}
-	if (comprbuf) kfree(comprbuf);
 
-	kunmap(pg);
-	/* XXX: Does the page get freed automatically? */
-	/* AAA: Judging by the unmount getting stuck in __wait_on_page, nope. */
-	page_cache_release(pg);
+	jffs2_gc_release_page(c, pg_ptr, &pg);
 	return ret;
 }
 
diff --git a/fs/jffs2/ioctl.c b/fs/jffs2/ioctl.c
index 1c0bebc6b..1f8fb486c 100644
--- a/fs/jffs2/ioctl.c
+++ b/fs/jffs2/ioctl.c
@@ -1,13 +1,13 @@
 /*
  * JFFS2 -- Journalling Flash File System, Version 2.
  *
- * Copyright (C) 2001 Red Hat, Inc.
+ * Copyright (C) 2001-2003 Red Hat, Inc.
  *
  * Created by David Woodhouse <dwmw2@redhat.com>
  *
  * For licensing information, see the file 'LICENCE' in this directory.
  *
- * $Id: ioctl.c,v 1.7 2003/10/04 08:33:06 dwmw2 Exp $
+ * $Id: ioctl.c,v 1.8 2003/10/28 16:16:28 dwmw2 Exp $
  *
  */
 
@@ -18,6 +18,6 @@ int jffs2_ioctl(struct inode *inode, struct file *filp, unsigned int cmd,
 {
 	/* Later, this will provide for lsattr.jffs2 and chattr.jffs2, which
 	   will include compression support etc. */
-	return -EINVAL;
+	return -ENOTTY;
 }
 	
diff --git a/fs/jffs2/malloc.c b/fs/jffs2/malloc.c
index d81680fe6..b0bbe8a01 100644
--- a/fs/jffs2/malloc.c
+++ b/fs/jffs2/malloc.c
@@ -7,7 +7,7 @@
  *
  * For licensing information, see the file 'LICENCE' in this directory.
  *
- * $Id: malloc.c,v 1.25 2003/10/04 08:33:06 dwmw2 Exp $
+ * $Id: malloc.c,v 1.27 2003/10/28 17:14:58 dwmw2 Exp $
  *
  */
 
diff --git a/fs/jffs2/nodelist.c b/fs/jffs2/nodelist.c
index 6c94c3699..b359f8a14 100644
--- a/fs/jffs2/nodelist.c
+++ b/fs/jffs2/nodelist.c
@@ -7,7 +7,7 @@
  *
  * For licensing information, see the file 'LICENCE' in this directory.
  *
- * $Id: nodelist.c,v 1.80 2003/10/04 08:33:06 dwmw2 Exp $
+ * $Id: nodelist.c,v 1.86 2003/10/31 15:37:51 dwmw2 Exp $
  *
  */
 
@@ -58,7 +58,7 @@ void jffs2_add_fd_to_list(struct jffs2_sb_info *c, struct jffs2_full_dirent *new
 /* Put a new tmp_dnode_info into the list, keeping the list in 
    order of increasing version
 */
-void jffs2_add_tn_to_list(struct jffs2_tmp_dnode_info *tn, struct jffs2_tmp_dnode_info **list)
+static void jffs2_add_tn_to_list(struct jffs2_tmp_dnode_info *tn, struct jffs2_tmp_dnode_info **list)
 {
 	struct jffs2_tmp_dnode_info **prev = list;
 	
@@ -133,7 +133,9 @@ int jffs2_get_inode_nodes(struct jffs2_sb_info *c, ino_t ino, struct jffs2_inode
 		cond_resched();
 
 		/* FIXME: point() */
-		err = jffs2_flash_read(c, (ref_offset(ref)), min_t(uint32_t, ref->totlen, sizeof(node)), &retlen, (void *)&node);
+		err = jffs2_flash_read(c, (ref_offset(ref)), 
+				       min_t(uint32_t, ref_totlen(c, NULL, ref), sizeof(node)),
+				       &retlen, (void *)&node);
 		if (err) {
 			printk(KERN_WARNING "error %d reading node at 0x%08x in get_inode_nodes()\n", err, ref_offset(ref));
 			goto free_out;
@@ -141,7 +143,7 @@ int jffs2_get_inode_nodes(struct jffs2_sb_info *c, ino_t ino, struct jffs2_inode
 			
 
 			/* Check we've managed to read at least the common node header */
-		if (retlen < min_t(uint32_t, ref->totlen, sizeof(node.u))) {
+		if (retlen < min_t(uint32_t, ref_totlen(c, NULL, ref), sizeof(node.u))) {
 			printk(KERN_WARNING "short read in get_inode_nodes()\n");
 			err = -EIO;
 			goto free_out;
@@ -246,7 +248,7 @@ int jffs2_get_inode_nodes(struct jffs2_sb_info *c, ino_t ino, struct jffs2_inode
 
 			/* If we've never checked the CRCs on this node, check them now. */
 			if (ref_flags(ref) == REF_UNCHECKED) {
-				uint32_t crc;
+				uint32_t crc, len;
 				struct jffs2_eraseblock *jeb;
 
 				crc = crc32(0, &node, sizeof(node.i)-8);
@@ -321,10 +323,12 @@ int jffs2_get_inode_nodes(struct jffs2_sb_info *c, ino_t ino, struct jffs2_inode
 				/* Mark the node as having been checked and fix the accounting accordingly */
 				spin_lock(&c->erase_completion_lock);
 				jeb = &c->blocks[ref->flash_offset / c->sector_size];
-				jeb->used_size += ref->totlen;
-				jeb->unchecked_size -= ref->totlen;
-				c->used_size += ref->totlen;
-				c->unchecked_size -= ref->totlen;
+				len = ref_totlen(c, jeb, ref);
+
+				jeb->used_size += len;
+				jeb->unchecked_size -= len;
+				c->used_size += len;
+				c->unchecked_size -= len;
 
 				/* If node covers at least a whole page, or if it starts at the 
 				   beginning of a page and runs to the end of the file, or if 
@@ -377,6 +381,7 @@ int jffs2_get_inode_nodes(struct jffs2_sb_info *c, ino_t ino, struct jffs2_inode
 		default:
 			if (ref_flags(ref) == REF_UNCHECKED) {
 				struct jffs2_eraseblock *jeb;
+				uint32_t len;
 
 				printk(KERN_ERR "Eep. Unknown node type %04x at %08x was marked REF_UNCHECKED\n",
 				       je16_to_cpu(node.u.nodetype), ref_offset(ref));
@@ -384,10 +389,12 @@ int jffs2_get_inode_nodes(struct jffs2_sb_info *c, ino_t ino, struct jffs2_inode
 				/* Mark the node as having been checked and fix the accounting accordingly */
 				spin_lock(&c->erase_completion_lock);
 				jeb = &c->blocks[ref->flash_offset / c->sector_size];
-				jeb->used_size += ref->totlen;
-				jeb->unchecked_size -= ref->totlen;
-				c->used_size += ref->totlen;
-				c->unchecked_size -= ref->totlen;
+				len = ref_totlen(c, jeb, ref);
+
+				jeb->used_size += len;
+				jeb->unchecked_size -= len;
+				c->used_size += len;
+				c->unchecked_size -= len;
 
 				mark_ref_normal(ref);
 				spin_unlock(&c->erase_completion_lock);
@@ -631,6 +638,8 @@ void jffs2_kill_fragtree(struct rb_root *root, struct jffs2_sb_info *c)
 
 		jffs2_free_node_frag(frag);
 		frag = parent;
+
+		cond_resched();
 	}
 }
 
diff --git a/fs/jffs2/nodelist.h b/fs/jffs2/nodelist.h
index d36f29aa5..cea0c1390 100644
--- a/fs/jffs2/nodelist.h
+++ b/fs/jffs2/nodelist.h
@@ -7,7 +7,7 @@
  *
  * For licensing information, see the file 'LICENCE' in this directory.
  *
- * $Id: nodelist.h,v 1.104 2003/10/08 11:45:11 dwmw2 Exp $
+ * $Id: nodelist.h,v 1.119 2004/05/26 12:28:12 gleixner Exp $
  *
  */
 
@@ -44,6 +44,39 @@
 #define D2(x)
 #endif
 
+#define JFFS2_NATIVE_ENDIAN
+
+/* Note we handle mode bits conversion from JFFS2 (i.e. Linux) to/from
+   whatever OS we're actually running on here too. */
+
+#if defined(JFFS2_NATIVE_ENDIAN)
+#define cpu_to_je16(x) ((jint16_t){x})
+#define cpu_to_je32(x) ((jint32_t){x})
+#define cpu_to_jemode(x) ((jmode_t){os_to_jffs2_mode(x)})
+
+#define je16_to_cpu(x) ((x).v16)
+#define je32_to_cpu(x) ((x).v32)
+#define jemode_to_cpu(x) (jffs2_to_os_mode((x).m))
+#elif defined(JFFS2_BIG_ENDIAN)
+#define cpu_to_je16(x) ((jint16_t){cpu_to_be16(x)})
+#define cpu_to_je32(x) ((jint32_t){cpu_to_be32(x)})
+#define cpu_to_jemode(x) ((jmode_t){cpu_to_be32(os_to_jffs2_mode(x))})
+
+#define je16_to_cpu(x) (be16_to_cpu(x.v16))
+#define je32_to_cpu(x) (be32_to_cpu(x.v32))
+#define jemode_to_cpu(x) (be32_to_cpu(jffs2_to_os_mode((x).m)))
+#elif defined(JFFS2_LITTLE_ENDIAN)
+#define cpu_to_je16(x) ((jint16_t){cpu_to_le16(x)})
+#define cpu_to_je32(x) ((jint32_t){cpu_to_le32(x)})
+#define cpu_to_jemode(x) ((jmode_t){cpu_to_le32(os_to_jffs2_mode(x))})
+
+#define je16_to_cpu(x) (le16_to_cpu(x.v16))
+#define je32_to_cpu(x) (le32_to_cpu(x.v32))
+#define jemode_to_cpu(x) (le32_to_cpu(jffs2_to_os_mode((x).m)))
+#else 
+#error wibble
+#endif
+
 /*
   This is all we need to keep in-core for each raw node during normal
   operation. As and when we do read_inode on a particular inode, we can
@@ -59,13 +92,12 @@ struct jffs2_raw_node_ref
 		word so you know when you've got there :) */
 	struct jffs2_raw_node_ref *next_phys;
 	uint32_t flash_offset;
-	uint32_t totlen;
-	
+	uint32_t __totlen; /* This may die; use ref_totlen(c, jeb, ) below */
+};
+
         /* flash_offset & 3 always has to be zero, because nodes are
 	   always aligned at 4 bytes. So we have a couple of extra bits
-	   to play with. So we set the least significant bit to 1 to
-	   signify that the node is obsoleted by later nodes.
-	*/
+	   to play with, which indicate the node's status; see below: */ 
 #define REF_UNCHECKED	0	/* We haven't yet checked the CRC or built its inode */
 #define REF_OBSOLETE	1	/* Obsolete, can be completely ignored */
 #define REF_PRISTINE	2	/* Completely clean. GC without looking */
@@ -74,7 +106,6 @@ struct jffs2_raw_node_ref
 #define ref_offset(ref)		((ref)->flash_offset & ~3)
 #define ref_obsolete(ref)	(((ref)->flash_offset & 3) == REF_OBSOLETE)
 #define mark_ref_normal(ref)    do { (ref)->flash_offset = ref_offset(ref) | REF_NORMAL; } while(0)
-};
 
 /* 
    Used for keeping track of deletion nodes &c, which can only be marked
@@ -246,9 +277,9 @@ static inline void paranoia_failed_dump(struct jffs2_eraseblock *jeb)
 				BUG(); \
 			} \
 			if (ref_flags(ref2) == REF_UNCHECKED) \
-				my_unchecked_size += ref2->totlen; \
+				my_unchecked_size += ref_totlen(c, jeb, ref2); \
 			else if (!ref_obsolete(ref2)) \
-				my_used_size += ref2->totlen; \
+				my_used_size += ref_totlen(c, jeb, ref2); \
 			if (unlikely((!ref2->next_phys) != (ref2 == jeb->last_node))) { \
 				printk("ref for node at %p (phys %08x) has next_phys->%p (%08x), last_node->%p (phys %08x)\n", \
 				       ref2, ref_offset(ref2), ref2->next_phys, ref_offset(ref2->next_phys), \
@@ -268,6 +299,57 @@ static inline void paranoia_failed_dump(struct jffs2_eraseblock *jeb)
 		} \
 	} while(0)
 
+/* Calculate totlen from surrounding nodes or eraseblock */
+static inline uint32_t __ref_totlen(struct jffs2_sb_info *c,
+				    struct jffs2_eraseblock *jeb,
+				    struct jffs2_raw_node_ref *ref)
+{
+	uint32_t ref_end;
+	
+	if (ref->next_phys)
+		ref_end = ref_offset(ref->next_phys);
+	else {
+		if (!jeb)
+			jeb = &c->blocks[ref->flash_offset / c->sector_size];
+
+		/* Last node in block. Use free_space */
+		BUG_ON(ref != jeb->last_node);
+		ref_end = jeb->offset + c->sector_size - jeb->free_size;
+	}
+	return ref_end - ref_offset(ref);
+}
+
+static inline uint32_t ref_totlen(struct jffs2_sb_info *c,
+				  struct jffs2_eraseblock *jeb,
+				  struct jffs2_raw_node_ref *ref)
+{
+	uint32_t ret;
+
+	D1(if (jeb && jeb != &c->blocks[ref->flash_offset / c->sector_size]) {
+		printk(KERN_CRIT "ref_totlen called with wrong block -- at 0x%08x instead of 0x%08x; ref 0x%08x\n",
+		       jeb->offset, c->blocks[ref->flash_offset / c->sector_size].offset, ref_offset(ref));
+		BUG();
+	})
+
+#if 1
+	ret = ref->__totlen;
+#else
+	/* This doesn't actually work yet */
+	ret = __ref_totlen(c, jeb, ref);
+	if (ret != ref->__totlen) {
+		printk(KERN_CRIT "Totlen for ref at %p (0x%08x-0x%08x) miscalculated as 0x%x instead of %x\n",
+		       ref, ref_offset(ref), ref_offset(ref)+ref->__totlen,
+		       ret, ref->__totlen);
+		if (!jeb)
+			jeb = &c->blocks[ref->flash_offset / c->sector_size];
+		paranoia_failed_dump(jeb);
+		BUG();
+	}
+#endif
+	return ret;
+}
+
+
 #define ALLOC_NORMAL	0	/* Normal allocation */
 #define ALLOC_DELETION	1	/* Deletion node. Best to allow it */
 #define ALLOC_GC	2	/* Space requested for GC. Give it or die */
@@ -281,13 +363,13 @@ static inline void paranoia_failed_dump(struct jffs2_eraseblock *jeb)
 
 #define PAD(x) (((x)+3)&~3)
 
-static inline int jffs2_raw_ref_to_inum(struct jffs2_raw_node_ref *raw)
+static inline struct jffs2_inode_cache *jffs2_raw_ref_to_ic(struct jffs2_raw_node_ref *raw)
 {
 	while(raw->next_in_ino) {
 		raw = raw->next_in_ino;
 	}
 
-	return ((struct jffs2_inode_cache *)raw)->ino;
+	return ((struct jffs2_inode_cache *)raw);
 }
 
 static inline struct jffs2_node_frag *frag_first(struct rb_root *root)
@@ -311,7 +393,6 @@ static inline struct jffs2_node_frag *frag_first(struct rb_root *root)
 /* nodelist.c */
 D1(void jffs2_print_frag_list(struct jffs2_inode_info *f));
 void jffs2_add_fd_to_list(struct jffs2_sb_info *c, struct jffs2_full_dirent *new, struct jffs2_full_dirent **list);
-void jffs2_add_tn_to_list(struct jffs2_tmp_dnode_info *tn, struct jffs2_tmp_dnode_info **list);
 int jffs2_get_inode_nodes(struct jffs2_sb_info *c, ino_t ino, struct jffs2_inode_info *f,
 			  struct jffs2_tmp_dnode_info **tnp, struct jffs2_full_dirent **fdp,
 			  uint32_t *highest_version, uint32_t *latest_mctime,
@@ -330,6 +411,7 @@ struct rb_node *rb_prev(struct rb_node *);
 void rb_replace_node(struct rb_node *victim, struct rb_node *new, struct rb_root *root);
 
 /* nodemgmt.c */
+int jffs2_thread_should_wake(struct jffs2_sb_info *c);
 int jffs2_reserve_space(struct jffs2_sb_info *c, uint32_t minsize, uint32_t *ofs, uint32_t *len, int prio);
 int jffs2_reserve_space_gc(struct jffs2_sb_info *c, uint32_t minsize, uint32_t *ofs, uint32_t *len);
 int jffs2_add_physical_node_ref(struct jffs2_sb_info *c, struct jffs2_raw_node_ref *new);
@@ -383,18 +465,13 @@ void jffs2_free_inode_cache(struct jffs2_inode_cache *);
 int jffs2_garbage_collect_pass(struct jffs2_sb_info *c);
 
 /* read.c */
-int jffs2_read_dnode(struct jffs2_sb_info *c, struct jffs2_full_dnode *fd, unsigned char *buf, int ofs, int len);
+int jffs2_read_dnode(struct jffs2_sb_info *c, struct jffs2_inode_info *f,
+		     struct jffs2_full_dnode *fd, unsigned char *buf,
+		     int ofs, int len);
 int jffs2_read_inode_range(struct jffs2_sb_info *c, struct jffs2_inode_info *f,
 			   unsigned char *buf, uint32_t offset, uint32_t len);
 char *jffs2_getlink(struct jffs2_sb_info *c, struct jffs2_inode_info *f);
 
-
-/* compr.c */
-unsigned char jffs2_compress(unsigned char *data_in, unsigned char *cpage_out, 
-			     uint32_t *datalen, uint32_t *cdatalen);
-int jffs2_decompress(unsigned char comprtype, unsigned char *cdata_in, 
-		     unsigned char *data_out, uint32_t cdatalen, uint32_t datalen);
-
 /* scan.c */
 int jffs2_scan_medium(struct jffs2_sb_info *c);
 void jffs2_rotate_lists(struct jffs2_sb_info *c);
@@ -404,8 +481,7 @@ int jffs2_do_mount_fs(struct jffs2_sb_info *c);
 
 /* erase.c */
 void jffs2_erase_block(struct jffs2_sb_info *c, struct jffs2_eraseblock *jeb);
-void jffs2_erase_pending_blocks(struct jffs2_sb_info *c);
-void jffs2_erase_pending_trigger(struct jffs2_sb_info *c);
+void jffs2_erase_pending_blocks(struct jffs2_sb_info *c, int count);
 
 #ifdef CONFIG_JFFS2_FS_NAND
 /* wbuf.c */
@@ -413,11 +489,6 @@ int jffs2_flush_wbuf_gc(struct jffs2_sb_info *c, uint32_t ino);
 int jffs2_flush_wbuf_pad(struct jffs2_sb_info *c);
 int jffs2_check_nand_cleanmarker(struct jffs2_sb_info *c, struct jffs2_eraseblock *jeb);
 int jffs2_write_nand_cleanmarker(struct jffs2_sb_info *c, struct jffs2_eraseblock *jeb);
-int jffs2_nand_read_failcnt(struct jffs2_sb_info *c, struct jffs2_eraseblock *jeb);
 #endif
 
-/* compr_zlib.c */
-int jffs2_zlib_init(void);
-void jffs2_zlib_exit(void);
-
 #endif /* __JFFS2_NODELIST_H__ */
diff --git a/fs/jffs2/nodemgmt.c b/fs/jffs2/nodemgmt.c
index 980de2e22..5043d1a6f 100644
--- a/fs/jffs2/nodemgmt.c
+++ b/fs/jffs2/nodemgmt.c
@@ -7,7 +7,7 @@
  *
  * For licensing information, see the file 'LICENCE' in this directory.
  *
- * $Id: nodemgmt.c,v 1.102 2003/10/08 17:21:19 dwmw2 Exp $
+ * $Id: nodemgmt.c,v 1.107 2003/11/26 15:30:58 dwmw2 Exp $
  *
  */
 
@@ -209,8 +209,6 @@ static int jffs2_do_reserve_space(struct jffs2_sb_info *c,  uint32_t minsize, ui
 
 		if (list_empty(&c->free_list)) {
 
-			DECLARE_WAITQUEUE(wait, current);
-			
 			if (!c->nr_erasing_blocks && 
 			    !list_empty(&c->erasable_list)) {
 				struct jffs2_eraseblock *ejeb;
@@ -243,30 +241,12 @@ static int jffs2_do_reserve_space(struct jffs2_sb_info *c,  uint32_t minsize, ui
 				       list_empty(&c->erasing_list)?"yes":"no", list_empty(&c->erase_pending_list)?"yes":"no");
 				return -ENOSPC;
 			}
-			/* Make sure this can't deadlock. Someone has to start the erases
-			   of erase_pending blocks */
-#ifdef __ECOS
-			/* In eCos, we don't have a handy kernel thread doing the erases for
-			   us. We do them ourselves right now. */
-			jffs2_erase_pending_blocks(c);
-#else
-			set_current_state(TASK_INTERRUPTIBLE);
-			add_wait_queue(&c->erase_wait, &wait);
-			D1(printk(KERN_DEBUG "Waiting for erases to complete. erasing_blocks is %d. (erasableempty: %s, erasingempty: %s, erasependingempty: %s)\n", 
-				  c->nr_erasing_blocks, list_empty(&c->erasable_list)?"yes":"no",
-				  list_empty(&c->erasing_list)?"yes":"no", list_empty(&c->erase_pending_list)?"yes":"no"));
-			if (!list_empty(&c->erase_pending_list)) {
-				D1(printk(KERN_DEBUG "Triggering pending erases\n"));
-				jffs2_erase_pending_trigger(c);
-			}
+
 			spin_unlock(&c->erase_completion_lock);
-			schedule();
-			remove_wait_queue(&c->erase_wait, &wait);
+			/* Don't wait for it; just erase one right now */
+			jffs2_erase_pending_blocks(c, 1);
 			spin_lock(&c->erase_completion_lock);
-			if (signal_pending(current)) {
-				return -EINTR;
-			}
-#endif
+
 			/* An erase may have failed, decreasing the
 			   amount of free space available. So we must
 			   restart from the beginning */
@@ -321,9 +301,11 @@ static int jffs2_do_reserve_space(struct jffs2_sb_info *c,  uint32_t minsize, ui
 int jffs2_add_physical_node_ref(struct jffs2_sb_info *c, struct jffs2_raw_node_ref *new)
 {
 	struct jffs2_eraseblock *jeb;
-	uint32_t len = new->totlen;
+	uint32_t len;
 
 	jeb = &c->blocks[new->flash_offset / c->sector_size];
+	len = ref_totlen(c, jeb, new);
+
 	D1(printk(KERN_DEBUG "jffs2_add_physical_node_ref(): Node at 0x%x(%d), size 0x%x\n", ref_offset(new), ref_flags(new), len));
 #if 1
 	if (jeb != c->nextblock || (ref_offset(new)) != jeb->offset + (c->sector_size - jeb->free_size)) {
@@ -420,31 +402,31 @@ void jffs2_mark_node_obsolete(struct jffs2_sb_info *c, struct jffs2_raw_node_ref
 	spin_lock(&c->erase_completion_lock);
 
 	if (ref_flags(ref) == REF_UNCHECKED) {
-		D1(if (unlikely(jeb->unchecked_size < ref->totlen)) {
+		D1(if (unlikely(jeb->unchecked_size < ref_totlen(c, jeb, ref))) {
 			printk(KERN_NOTICE "raw unchecked node of size 0x%08x freed from erase block %d at 0x%08x, but unchecked_size was already 0x%08x\n",
-			       ref->totlen, blocknr, ref->flash_offset, jeb->used_size);
+			       ref_totlen(c, jeb, ref), blocknr, ref->flash_offset, jeb->used_size);
 			BUG();
 		})
-		D1(printk(KERN_DEBUG "Obsoleting previously unchecked node at 0x%08x of len %x: ", ref_offset(ref), ref->totlen));
-		jeb->unchecked_size -= ref->totlen;
-		c->unchecked_size -= ref->totlen;
+		D1(printk(KERN_DEBUG "Obsoleting previously unchecked node at 0x%08x of len %x: ", ref_offset(ref), ref_totlen(c, jeb, ref)));
+		jeb->unchecked_size -= ref_totlen(c, jeb, ref);
+		c->unchecked_size -= ref_totlen(c, jeb, ref);
 	} else {
-		D1(if (unlikely(jeb->used_size < ref->totlen)) {
+		D1(if (unlikely(jeb->used_size < ref_totlen(c, jeb, ref))) {
 			printk(KERN_NOTICE "raw node of size 0x%08x freed from erase block %d at 0x%08x, but used_size was already 0x%08x\n",
-			       ref->totlen, blocknr, ref->flash_offset, jeb->used_size);
+			       ref_totlen(c, jeb, ref), blocknr, ref->flash_offset, jeb->used_size);
 			BUG();
 		})
-		D1(printk(KERN_DEBUG "Obsoleting node at 0x%08x of len %x: ", ref_offset(ref), ref->totlen));
-		jeb->used_size -= ref->totlen;
-		c->used_size -= ref->totlen;
+		D1(printk(KERN_DEBUG "Obsoleting node at 0x%08x of len %x: ", ref_offset(ref), ref_totlen(c, jeb, ref)));
+		jeb->used_size -= ref_totlen(c, jeb, ref);
+		c->used_size -= ref_totlen(c, jeb, ref);
 	}
 
 	// Take care, that wasted size is taken into concern
-	if ((jeb->dirty_size || ISDIRTY(jeb->wasted_size + ref->totlen)) && jeb != c->nextblock) {
+	if ((jeb->dirty_size || ISDIRTY(jeb->wasted_size + ref_totlen(c, jeb, ref))) && jeb != c->nextblock) {
 		D1(printk("Dirtying\n"));
-		addedsize = ref->totlen;
-		jeb->dirty_size += ref->totlen;
-		c->dirty_size += ref->totlen;
+		addedsize = ref_totlen(c, jeb, ref);
+		jeb->dirty_size += ref_totlen(c, jeb, ref);
+		c->dirty_size += ref_totlen(c, jeb, ref);
 
 		/* Convert wasted space to dirty, if not a bad block */
 		if (jeb->wasted_size) {
@@ -465,8 +447,8 @@ void jffs2_mark_node_obsolete(struct jffs2_sb_info *c, struct jffs2_raw_node_ref
 	} else {
 		D1(printk("Wasting\n"));
 		addedsize = 0;
-		jeb->wasted_size += ref->totlen;
-		c->wasted_size += ref->totlen;	
+		jeb->wasted_size += ref_totlen(c, jeb, ref);
+		c->wasted_size += ref_totlen(c, jeb, ref);	
 	}
 	ref->flash_offset = ref_offset(ref) | REF_OBSOLETE;
 	
@@ -497,30 +479,6 @@ void jffs2_mark_node_obsolete(struct jffs2_sb_info *c, struct jffs2_raw_node_ref
 		if (jffs2_wbuf_dirty(c)) {
 			D1(printk(KERN_DEBUG "...and adding to erasable_pending_wbuf_list\n"));
 			list_add_tail(&jeb->list, &c->erasable_pending_wbuf_list);
-#if 0 /* This check was added to allow us to find places where we added nodes to the lists
-	 after dropping the alloc_sem, and it did that just fine. But it also caused us to
-	 lock the alloc_sem in other places, like clear_inode(), when we wouldn't otherwise
-	 have needed to. So I suspect it's outlived its usefulness. Thomas? */
-
-			/* We've changed the rules slightly. After
-			   writing a node you now mustn't drop the
-			   alloc_sem before you've finished all the
-			   list management - this is so that when we
-			   get here, we know that no other nodes have
-			   been written, and the above check on wbuf
-			   is valid - wbuf_len is nonzero IFF the node
-			   which obsoletes this node is still in the
-			   wbuf.
-
-			   So we BUG() if that new rule is broken, to
-			   make sure we catch it and fix it.
-			*/
-			if (!down_trylock(&c->alloc_sem)) {
-				up(&c->alloc_sem);
-				printk(KERN_CRIT "jffs2_mark_node_obsolete() called with wbuf active but alloc_sem not locked!\n");
-				BUG();
-			}
-#endif
 		} else {
 			if (jiffies & 127) {
 				/* Most of the time, we just erase it immediately. Otherwise we
@@ -572,12 +530,12 @@ void jffs2_mark_node_obsolete(struct jffs2_sb_info *c, struct jffs2_raw_node_ref
 		printk(KERN_WARNING "Short read from obsoleted node at 0x%08x: %zd\n", ref_offset(ref), retlen);
 		return;
 	}
-	if (PAD(je32_to_cpu(n.totlen)) != PAD(ref->totlen)) {
-		printk(KERN_WARNING "Node totlen on flash (0x%08x) != totlen in node ref (0x%08x)\n", je32_to_cpu(n.totlen), ref->totlen);
+	if (PAD(je32_to_cpu(n.totlen)) != PAD(ref_totlen(c, jeb, ref))) {
+		printk(KERN_WARNING "Node totlen on flash (0x%08x) != totlen from node ref (0x%08x)\n", je32_to_cpu(n.totlen), ref_totlen(c, jeb, ref));
 		return;
 	}
 	if (!(je16_to_cpu(n.nodetype) & JFFS2_NODE_ACCURATE)) {
-		D1(printk(KERN_DEBUG "Node at 0x%08x was already marked obsolete (nodetype 0x%04x\n", ref_offset(ref), je16_to_cpu(n.nodetype)));
+		D1(printk(KERN_DEBUG "Node at 0x%08x was already marked obsolete (nodetype 0x%04x)\n", ref_offset(ref), je16_to_cpu(n.nodetype)));
 		return;
 	}
 	/* XXX FIXME: This is ugly now */
@@ -750,3 +708,34 @@ void jffs2_dump_block_lists(struct jffs2_sb_info *c)
 	}
 }
 #endif /* CONFIG_JFFS2_FS_DEBUG */
+
+int jffs2_thread_should_wake(struct jffs2_sb_info *c)
+{
+	int ret = 0;
+	uint32_t dirty;
+
+	if (c->unchecked_size) {
+		D1(printk(KERN_DEBUG "jffs2_thread_should_wake(): unchecked_size %d, checked_ino #%d\n",
+			  c->unchecked_size, c->checked_ino));
+		return 1;
+	}
+
+	/* dirty_size contains blocks on erase_pending_list
+	 * those blocks are counted in c->nr_erasing_blocks.
+	 * If one block is actually erased, it is not longer counted as dirty_space
+	 * but it is counted in c->nr_erasing_blocks, so we add it and subtract it
+	 * with c->nr_erasing_blocks * c->sector_size again.
+	 * Blocks on erasable_list are counted as dirty_size, but not in c->nr_erasing_blocks
+	 * This helps us to force gc and pick eventually a clean block to spread the load.
+	 */
+	dirty = c->dirty_size + c->erasing_size - c->nr_erasing_blocks * c->sector_size;
+
+	if (c->nr_free_blocks + c->nr_erasing_blocks < c->resv_blocks_gctrigger && 
+			(dirty > c->nospc_dirty_size)) 
+		ret = 1;
+
+	D1(printk(KERN_DEBUG "jffs2_thread_should_wake(): nr_free_blocks %d, nr_erasing_blocks %d, dirty_size 0x%x: %s\n", 
+		  c->nr_free_blocks, c->nr_erasing_blocks, c->dirty_size, ret?"yes":"no"));
+
+	return ret;
+}
diff --git a/fs/jffs2/os-linux.h b/fs/jffs2/os-linux.h
index 91401c1c9..9a7e01ca2 100644
--- a/fs/jffs2/os-linux.h
+++ b/fs/jffs2/os-linux.h
@@ -7,7 +7,7 @@
  *
  * For licensing information, see the file 'LICENCE' in this directory.
  *
- * $Id: os-linux.h,v 1.37 2003/10/11 11:47:23 dwmw2 Exp $
+ * $Id: os-linux.h,v 1.47 2004/07/14 13:20:23 dwmw2 Exp $
  *
  */
 
@@ -23,6 +23,9 @@
 #define kstatfs statfs
 #endif
 
+struct kstatfs;
+struct kvec;
+
 #if LINUX_VERSION_CODE > KERNEL_VERSION(2,5,2)
 #define JFFS2_INODE_INFO(i) (list_entry(i, struct jffs2_inode_info, vfs_inode))
 #define OFNI_EDONI_2SFFJ(f)  (&(f)->vfs_inode)
@@ -69,14 +72,6 @@
 #define JFFS2_F_I_ATIME(f) (OFNI_EDONI_2SFFJ(f)->i_atime)
 #endif
 
-/* Hmmm. P'raps generic code should only ever see versions of signal
-   functions which do the locking automatically? */
-#if LINUX_VERSION_CODE < KERNEL_VERSION(2,5,40) && !defined(__rh_config_h__)
-#define current_sig_lock current->sigmask_lock
-#else
-#define current_sig_lock current->sighand->siglock
-#endif
-
 #define sleep_on_spinunlock(wq, s)				\
 	do {							\
 		DECLARE_WAITQUEUE(__wait, current);		\
@@ -113,8 +108,7 @@ static inline void jffs2_init_inode_info(struct jffs2_inode_info *f)
 #define jffs2_flash_read(c, ofs, len, retlen, buf) ((c)->mtd->read((c)->mtd, ofs, len, retlen, buf))
 #define jffs2_flush_wbuf_pad(c) ({ (void)(c), 0; })
 #define jffs2_flush_wbuf_gc(c, i) ({ (void)(c), (void) i, 0; })
-#define jffs2_nand_read_failcnt(c,jeb) do { ; } while(0)
-#define jffs2_write_nand_badblock(c,jeb) do { ; } while(0)
+#define jffs2_write_nand_badblock(c,jeb,bad_offset) (1)
 #define jffs2_nand_flash_setup(c) (0)
 #define jffs2_nand_flash_cleanup(c) do {} while(0)
 #define jffs2_wbuf_dirty(c) (0)
@@ -130,22 +124,27 @@ static inline void jffs2_init_inode_info(struct jffs2_inode_info *f)
 #define jffs2_flash_write_oob(c, ofs, len, retlen, buf) ((c)->mtd->write_oob((c)->mtd, ofs, len, retlen, buf))
 #define jffs2_flash_read_oob(c, ofs, len, retlen, buf) ((c)->mtd->read_oob((c)->mtd, ofs, len, retlen, buf))
 #define jffs2_wbuf_dirty(c) (!!(c)->wbuf_len)
-struct kstatfs;
 
 /* wbuf.c */
-int jffs2_flash_writev(struct jffs2_sb_info *c, const struct iovec *vecs, unsigned long count, loff_t to, size_t *retlen, uint32_t ino);
+int jffs2_flash_writev(struct jffs2_sb_info *c, const struct kvec *vecs, unsigned long count, loff_t to, size_t *retlen, uint32_t ino);
 int jffs2_flash_write(struct jffs2_sb_info *c, loff_t ofs, size_t len, size_t *retlen, const u_char *buf);
 int jffs2_flash_read(struct jffs2_sb_info *c, loff_t ofs, size_t len, size_t *retlen, u_char *buf);
 int jffs2_check_oob_empty(struct jffs2_sb_info *c, struct jffs2_eraseblock *jeb,int mode);
 int jffs2_check_nand_cleanmarker(struct jffs2_sb_info *c, struct jffs2_eraseblock *jeb);
 int jffs2_write_nand_cleanmarker(struct jffs2_sb_info *c, struct jffs2_eraseblock *jeb);
-int jffs2_write_nand_badblock(struct jffs2_sb_info *c, struct jffs2_eraseblock *jeb);
+int jffs2_write_nand_badblock(struct jffs2_sb_info *c, struct jffs2_eraseblock *jeb, uint32_t bad_offset);
 void jffs2_wbuf_timeout(unsigned long data);
 void jffs2_wbuf_process(void *data);
 int jffs2_nand_flash_setup(struct jffs2_sb_info *c);
 void jffs2_nand_flash_cleanup(struct jffs2_sb_info *c);
 #endif /* NAND */
 
+/* erase.c */
+static inline void jffs2_erase_pending_trigger(struct jffs2_sb_info *c)
+{
+	OFNI_BS_2SFFJ(c)->s_dirt = 1;
+}
+
 /* background.c */
 int jffs2_start_garbage_collect_thread(struct jffs2_sb_info *c);
 void jffs2_stop_garbage_collect_thread(struct jffs2_sb_info *c);
@@ -183,13 +182,26 @@ int jffs2_statfs (struct super_block *, struct kstatfs *);
 void jffs2_write_super (struct super_block *);
 int jffs2_remount_fs (struct super_block *, int *, char *);
 int jffs2_do_fill_super(struct super_block *sb, void *data, int silent);
+void jffs2_gc_release_inode(struct jffs2_sb_info *c,
+			    struct jffs2_inode_info *f);
+struct jffs2_inode_info *jffs2_gc_fetch_inode(struct jffs2_sb_info *c,
+					      int inum, int nlink);
+
+unsigned char *jffs2_gc_fetch_page(struct jffs2_sb_info *c, 
+				   struct jffs2_inode_info *f, 
+				   unsigned long offset,
+				   unsigned long *priv);
+void jffs2_gc_release_page(struct jffs2_sb_info *c,
+			   unsigned char *pg,
+			   unsigned long *priv);
+int jffs2_flash_setup(struct jffs2_sb_info *c);
+void jffs2_flash_cleanup(struct jffs2_sb_info *c);
+     
 
 /* writev.c */
-int jffs2_flash_direct_writev(struct jffs2_sb_info *c, const struct iovec *vecs, 
+int jffs2_flash_direct_writev(struct jffs2_sb_info *c, const struct kvec *vecs, 
 		       unsigned long count, loff_t to, size_t *retlen);
 
-/* super.c */
-
 
 #endif /* __JFFS2_OS_LINUX_H__ */
 
diff --git a/fs/jffs2/read.c b/fs/jffs2/read.c
index adeeeb19a..37375950f 100644
--- a/fs/jffs2/read.c
+++ b/fs/jffs2/read.c
@@ -7,7 +7,7 @@
  *
  * For licensing information, see the file 'LICENCE' in this directory.
  *
- * $Id: read.c,v 1.34 2003/10/04 08:33:06 dwmw2 Exp $
+ * $Id: read.c,v 1.36 2004/05/25 11:12:32 havasi Exp $
  *
  */
 
@@ -18,8 +18,11 @@
 #include <linux/mtd/mtd.h>
 #include <linux/compiler.h>
 #include "nodelist.h"
+#include "compr.h"
 
-int jffs2_read_dnode(struct jffs2_sb_info *c, struct jffs2_full_dnode *fd, unsigned char *buf, int ofs, int len)
+int jffs2_read_dnode(struct jffs2_sb_info *c, struct jffs2_inode_info *f,
+		     struct jffs2_full_dnode *fd, unsigned char *buf,
+		     int ofs, int len)
 {
 	struct jffs2_raw_inode *ri;
 	size_t readlen;
@@ -127,7 +130,7 @@ int jffs2_read_dnode(struct jffs2_sb_info *c, struct jffs2_full_dnode *fd, unsig
 	if (ri->compr != JFFS2_COMPR_NONE) {
 		D2(printk(KERN_DEBUG "Decompress %d bytes from %p to %d bytes at %p\n",
 			  je32_to_cpu(ri->csize), readbuf, je32_to_cpu(ri->dsize), decomprbuf)); 
-		ret = jffs2_decompress(ri->compr, readbuf, decomprbuf, je32_to_cpu(ri->csize), je32_to_cpu(ri->dsize));
+		ret = jffs2_decompress(c, f, ri->compr | (ri->usercompr << 8), readbuf, decomprbuf, je32_to_cpu(ri->csize), je32_to_cpu(ri->dsize));
 		if (ret) {
 			printk(KERN_WARNING "Error: jffs2_decompress returned %d\n", ret);
 			goto out_decomprbuf;
@@ -195,7 +198,7 @@ int jffs2_read_inode_range(struct jffs2_sb_info *c, struct jffs2_inode_info *f,
 			D1(printk(KERN_DEBUG "Reading %d-%d from node at 0x%08x (%d)\n",
 				  frag->ofs+fragofs, frag->ofs+fragofs+readlen,
 				  ref_offset(frag->node->raw), ref_flags(frag->node->raw)));
-			ret = jffs2_read_dnode(c, frag->node, buf, fragofs + frag->ofs - frag->node->ofs, readlen);
+			ret = jffs2_read_dnode(c, f, frag->node, buf, fragofs + frag->ofs - frag->node->ofs, readlen);
 			D2(printk(KERN_DEBUG "node read done\n"));
 			if (ret) {
 				D1(printk(KERN_DEBUG"jffs2_read_inode_range error %d\n",ret));
@@ -231,7 +234,7 @@ char *jffs2_getlink(struct jffs2_sb_info *c, struct jffs2_inode_info *f)
 	}
 	buf[f->metadata->size]=0;
 
-	ret = jffs2_read_dnode(c, f->metadata, buf, 0, f->metadata->size);
+	ret = jffs2_read_dnode(c, f, f->metadata, buf, 0, f->metadata->size);
 
 	up(&f->sem);
 
diff --git a/fs/jffs2/readinode.c b/fs/jffs2/readinode.c
index ea4bbf7f2..54a5d1ac3 100644
--- a/fs/jffs2/readinode.c
+++ b/fs/jffs2/readinode.c
@@ -7,7 +7,7 @@
  *
  * For licensing information, see the file 'LICENCE' in this directory.
  *
- * $Id: readinode.c,v 1.107 2003/10/04 08:33:06 dwmw2 Exp $
+ * $Id: readinode.c,v 1.113 2003/11/03 13:20:33 dwmw2 Exp $
  *
  */
 
@@ -56,6 +56,66 @@ void jffs2_print_frag_list(struct jffs2_inode_info *f)
 		printk(KERN_DEBUG "metadata at 0x%08x\n", ref_offset(f->metadata->raw));
 	}
 }
+
+static int jffs2_sanitycheck_fragtree(struct jffs2_inode_info *f)
+{
+	struct jffs2_node_frag *frag;
+	int bitched = 0;
+
+	for (frag = frag_first(&f->fragtree); frag; frag = frag_next(frag)) {
+
+		struct jffs2_full_dnode *fn = frag->node;
+		if (!fn || !fn->raw)
+			continue;
+
+		if (ref_flags(fn->raw) == REF_PRISTINE) {
+
+			if (fn->frags > 1) {
+				printk(KERN_WARNING "REF_PRISTINE node at 0x%08x had %d frags. Tell dwmw2\n", ref_offset(fn->raw), fn->frags);
+				bitched = 1;
+			}
+			/* A hole node which isn't multi-page should be garbage-collected
+			   and merged anyway, so we just check for the frag size here,
+			   rather than mucking around with actually reading the node
+			   and checking the compression type, which is the real way
+			   to tell a hole node. */
+			if (frag->ofs & (PAGE_CACHE_SIZE-1) && frag_prev(frag) && frag_prev(frag)->size < PAGE_CACHE_SIZE && frag_prev(frag)->node) {
+				printk(KERN_WARNING "REF_PRISTINE node at 0x%08x had a previous non-hole frag in the same page. Tell dwmw2\n",
+				       ref_offset(fn->raw));
+				bitched = 1;
+			}
+
+			if ((frag->ofs+frag->size) & (PAGE_CACHE_SIZE-1) && frag_next(frag) && frag_next(frag)->size < PAGE_CACHE_SIZE && frag_next(frag)->node) {
+				printk(KERN_WARNING "REF_PRISTINE node at 0x%08x (%08x-%08x) had a following non-hole frag in the same page. Tell dwmw2\n",
+				       ref_offset(fn->raw), frag->ofs, frag->ofs+frag->size);
+				bitched = 1;
+			}
+		}
+	}
+	
+	if (bitched) {
+		struct jffs2_node_frag *thisfrag;
+
+		printk(KERN_WARNING "Inode is #%u\n", f->inocache->ino);
+		thisfrag = frag_first(&f->fragtree);
+		while (thisfrag) {
+			if (!thisfrag->node) {
+				printk("Frag @0x%x-0x%x; node-less hole\n",
+				       thisfrag->ofs, thisfrag->size + thisfrag->ofs);
+			} else if (!thisfrag->node->raw) {
+				printk("Frag @0x%x-0x%x; raw-less hole\n",
+				       thisfrag->ofs, thisfrag->size + thisfrag->ofs);
+			} else {
+				printk("Frag @0x%x-0x%x; raw at 0x%08x(%d) (0x%x-0x%x)\n",
+				       thisfrag->ofs, thisfrag->size + thisfrag->ofs,
+				       ref_offset(thisfrag->node->raw), ref_flags(thisfrag->node->raw),
+				       thisfrag->node->ofs, thisfrag->node->ofs+thisfrag->node->size);
+			}
+			thisfrag = frag_next(thisfrag);
+		}
+	}
+	return bitched;
+}
 #endif /* D1 */
 
 static void jffs2_obsolete_node_frag(struct jffs2_sb_info *c, struct jffs2_node_frag *this)
@@ -130,6 +190,11 @@ int jffs2_add_full_dnode_to_inode(struct jffs2_sb_info *c, struct jffs2_inode_in
 				mark_ref_normal(next->node->raw);
 		}
 	}
+	D2(if (jffs2_sanitycheck_fragtree(f)) {
+		   printk(KERN_WARNING "Just added node %04x-%04x @0x%08x on flash, newfrag *%p\n",
+			  fn->ofs, fn->ofs+fn->size, ref_offset(fn->raw), newfrag);
+		   return 0;
+	   })
 	D2(jffs2_print_frag_list(f));
 	return 0;
 }
@@ -384,6 +449,7 @@ int jffs2_do_read_inode(struct jffs2_sb_info *c, struct jffs2_inode_info *f,
 		}
 	}
 	spin_unlock(&c->inocache_lock);
+
 	if (!f->inocache && ino == 1) {
 		/* Special case - no root inode on medium */
 		f->inocache = jffs2_alloc_inode_cache();
@@ -460,7 +526,7 @@ static int jffs2_do_read_inode_internal(struct jffs2_sb_info *c,
 		fn = tn->fn;
 
 		if (f->metadata) {
-			if (tn->version > mdata_ver) {
+			if (likely(tn->version >= mdata_ver)) {
 				D1(printk(KERN_DEBUG "Obsoleting old metadata at 0x%08x\n", ref_offset(f->metadata->raw)));
 				jffs2_mark_node_obsolete(c, f->metadata->raw);
 				jffs2_free_full_dnode(f->metadata);
@@ -468,10 +534,13 @@ static int jffs2_do_read_inode_internal(struct jffs2_sb_info *c,
 				
 				mdata_ver = 0;
 			} else {
-				D1(printk(KERN_DEBUG "Er. New metadata at 0x%08x with ver %d is actually older than previous %d\n",
-				       ref_offset(f->metadata->raw), tn->version, mdata_ver));
+				/* This should never happen. */
+				printk(KERN_WARNING "Er. New metadata at 0x%08x with ver %d is actually older than previous ver %d at 0x%08x\n",
+					  ref_offset(fn->raw), tn->version, mdata_ver, ref_offset(f->metadata->raw));
 				jffs2_mark_node_obsolete(c, fn->raw);
 				jffs2_free_full_dnode(fn);
+				/* Fill in latest_node from the metadata, not this one we're about to free... */
+				fn = f->metadata;
 				goto next_tn;
 			}
 		}
@@ -488,6 +557,8 @@ static int jffs2_do_read_inode_internal(struct jffs2_sb_info *c,
 		tn_list = tn->next;
 		jffs2_free_tmp_dnode_info(tn);
 	}
+	D1(jffs2_sanitycheck_fragtree(f));
+
 	if (!fn) {
 		/* No data nodes for this inode. */
 		if (f->inocache->ino != 1) {
@@ -594,24 +665,10 @@ static int jffs2_do_read_inode_internal(struct jffs2_sb_info *c,
 void jffs2_do_clear_inode(struct jffs2_sb_info *c, struct jffs2_inode_info *f)
 {
 	struct jffs2_full_dirent *fd, *fds;
-	/* I don't think we care about the potential race due to reading this
-	   without f->sem. It can never get undeleted. */
-	int deleted = f->inocache && !f->inocache->nlink;
-
-	/* If it's a deleted inode, grab the alloc_sem. This prevents
-	   jffs2_garbage_collect_pass() from deciding that it wants to
-	   garbage collect one of the nodes we're just about to mark 
-	   obsolete -- by the time we drop alloc_sem and return, all
-	   the nodes are marked obsolete, and jffs2_g_c_pass() won't
-	   call iget() for the inode in question.
-
-	   We also used to do this to keep the temporary BUG() in 
-	   jffs2_mark_node_obsolete() from triggering. 
-	*/
-	if(deleted)
-		down(&c->alloc_sem);
+	int deleted;
 
 	down(&f->sem);
+	deleted = f->inocache && !f->inocache->nlink;
 
 	if (f->metadata) {
 		if (deleted)
@@ -633,7 +690,4 @@ void jffs2_do_clear_inode(struct jffs2_sb_info *c, struct jffs2_inode_info *f)
 		jffs2_set_inocache_state(c, f->inocache, INO_STATE_CHECKEDABSENT);
 
 	up(&f->sem);
-
-	if(deleted)
-		up(&c->alloc_sem);
 }
diff --git a/fs/jffs2/scan.c b/fs/jffs2/scan.c
index 6e59cad2d..67a1d1bce 100644
--- a/fs/jffs2/scan.c
+++ b/fs/jffs2/scan.c
@@ -7,7 +7,7 @@
  *
  * For licensing information, see the file 'LICENCE' in this directory.
  *
- * $Id: scan.c,v 1.104 2003/10/11 14:52:48 dwmw2 Exp $
+ * $Id: scan.c,v 1.110 2004/06/17 17:15:31 gleixner Exp $
  *
  */
 #include <linux/kernel.h>
@@ -285,8 +285,6 @@ static int jffs2_scan_eraseblock (struct jffs2_sb_info *c, struct jffs2_eraseblo
 	uint32_t hdr_crc, buf_ofs, buf_len;
 	int err;
 	int noise = 0;
-	int wasempty = 0;
-	uint32_t empty_start = 0;
 #ifdef CONFIG_JFFS2_FS_NAND
 	int cleanmarkerfound = 0;
 #endif
@@ -339,8 +337,6 @@ static int jffs2_scan_eraseblock (struct jffs2_sb_info *c, struct jffs2_eraseblo
 			switch (ret) {
 			case 0:		return cleanmarkerfound ? BLK_STATE_CLEANMARKER : BLK_STATE_ALLFF;
 			case 1: 	return BLK_STATE_ALLDIRTY;
-			case 2: 	return BLK_STATE_BADBLOCK; /* case 2/3 are paranoia checks */
-			case 3:		return BLK_STATE_ALLDIRTY; /* Block has failed to erase min. once */
 			default: 	return ret;
 			}
 		}
@@ -359,6 +355,7 @@ static int jffs2_scan_eraseblock (struct jffs2_sb_info *c, struct jffs2_eraseblo
 
 	noise = 10;
 
+scan_more:	
 	while(ofs < jeb->offset + c->sector_size) {
 
 		D1(ACCT_PARANOIA_CHECK(jeb));
@@ -398,42 +395,52 @@ static int jffs2_scan_eraseblock (struct jffs2_sb_info *c, struct jffs2_eraseblo
 		node = (struct jffs2_unknown_node *)&buf[ofs-buf_ofs];
 
 		if (*(uint32_t *)(&buf[ofs-buf_ofs]) == 0xffffffff) {
-			uint32_t inbuf_ofs = ofs - buf_ofs + 4;
-			uint32_t scanend;
+			uint32_t inbuf_ofs;
+			uint32_t empty_start;
 
 			empty_start = ofs;
 			ofs += 4;
 
-			/* If scanning empty space after only a cleanmarker, don't
-			   bother scanning the whole block */
-			if (unlikely(empty_start == jeb->offset + c->cleanmarker_size &&
-				     jeb->offset + EMPTY_SCAN_SIZE < buf_ofs + buf_len))
-				scanend = jeb->offset + EMPTY_SCAN_SIZE - buf_ofs;
-			else
-				scanend = buf_len;
-
 			D1(printk(KERN_DEBUG "Found empty flash at 0x%08x\n", ofs));
-			while (inbuf_ofs < scanend) {
-				if (*(uint32_t *)(&buf[inbuf_ofs]) != 0xffffffff)
-					goto emptyends;
+		more_empty:
+			inbuf_ofs = ofs - buf_ofs;
+			while (inbuf_ofs < buf_len) {
+				if (*(uint32_t *)(&buf[inbuf_ofs]) != 0xffffffff) {
+					printk(KERN_WARNING "Empty flash at 0x%08x ends at 0x%08x\n",
+					       empty_start, ofs);
+					DIRTY_SPACE(ofs-empty_start);
+					goto scan_more;
+				}
 
 				inbuf_ofs+=4;
 				ofs += 4;
 			}
 			/* Ran off end. */
-			D1(printk(KERN_DEBUG "Empty flash ends normally at 0x%08x\n", ofs));
+			D1(printk(KERN_DEBUG "Empty flash to end of buffer at 0x%08x\n", ofs));
 
-			if (buf_ofs == jeb->offset &&  jeb->used_size == PAD(c->cleanmarker_size) && 
-			    c->cleanmarker_size && !jeb->first_node->next_in_ino && !jeb->dirty_size)
+			/* If we're only checking the beginning of a block with a cleanmarker,
+			   bail now */
+			if (buf_ofs == jeb->offset && jeb->used_size == PAD(c->cleanmarker_size) && 
+			    c->cleanmarker_size && !jeb->dirty_size && !jeb->first_node->next_in_ino) {
+				D1(printk(KERN_DEBUG "%d bytes at start of block seems clean... assuming all clean\n", EMPTY_SCAN_SIZE));
 				return BLK_STATE_CLEANMARKER;
-			wasempty = 1;
-			continue;
-		} else if (wasempty) {
-		emptyends:
-			printk(KERN_WARNING "Empty flash at 0x%08x ends at 0x%08x\n", empty_start, ofs);
-			DIRTY_SPACE(ofs-empty_start);
-			wasempty = 0;
-			continue;
+			}
+
+			/* See how much more there is to read in this eraseblock... */
+			buf_len = min_t(uint32_t, buf_size, jeb->offset + c->sector_size - ofs);
+			if (!buf_len) {
+				/* No more to read. Break out of main loop without marking 
+				   this range of empty space as dirty (because it's not) */
+				D1(printk(KERN_DEBUG "Empty flash at %08x runs to end of block. Treating as free_space\n",
+					  empty_start));
+				break;
+			}
+			D1(printk(KERN_DEBUG "Reading another 0x%x at 0x%08x\n", buf_len, ofs));
+			err = jffs2_fill_scan_buf(c, buf, ofs, buf_len);
+			if (err)
+				return err;
+			buf_ofs = ofs;
+			goto more_empty;
 		}
 
 		if (ofs == jeb->offset && je16_to_cpu(node->magic) == KSAMTIB_CIGAM_2SFFJ) {
@@ -554,7 +561,7 @@ static int jffs2_scan_eraseblock (struct jffs2_sb_info *c, struct jffs2_eraseblo
 				marker_ref->next_in_ino = NULL;
 				marker_ref->next_phys = NULL;
 				marker_ref->flash_offset = ofs | REF_NORMAL;
-				marker_ref->totlen = c->cleanmarker_size;
+				marker_ref->__totlen = c->cleanmarker_size;
 				jeb->first_node = jeb->last_node = marker_ref;
 			     
 				USED_SPACE(PAD(c->cleanmarker_size));
@@ -610,7 +617,7 @@ static int jffs2_scan_eraseblock (struct jffs2_sb_info *c, struct jffs2_eraseblo
 	}
 
 	if ((jeb->used_size + jeb->unchecked_size) == PAD(c->cleanmarker_size) && !jeb->dirty_size 
-		&& (!jeb->first_node || jeb->first_node->next_in_ino) )
+		&& (!jeb->first_node || !jeb->first_node->next_in_ino) )
 		return BLK_STATE_CLEANMARKER;
 		
 	/* move blocks with max 4 byte dirty space to cleanlist */	
@@ -634,6 +641,9 @@ static struct jffs2_inode_cache *jffs2_scan_make_ino_cache(struct jffs2_sb_info
 	if (ic)
 		return ic;
 
+	if (ino > c->highest_ino)
+		c->highest_ino = ino;
+
 	ic = jffs2_alloc_inode_cache();
 	if (!ic) {
 		printk(KERN_NOTICE "jffs2_scan_make_inode_cache(): allocation of inode cache failed\n");
@@ -645,7 +655,7 @@ static struct jffs2_inode_cache *jffs2_scan_make_ino_cache(struct jffs2_sb_info
 	ic->nodes = (void *)ic;
 	jffs2_add_ino_cache(c, ic);
 	if (ino == 1)
-		ic->nlink=1;
+		ic->nlink = 1;
 	return ic;
 }
 
@@ -698,7 +708,7 @@ static int jffs2_scan_inode_node(struct jffs2_sb_info *c, struct jffs2_erasebloc
 	/* Wheee. It worked */
 
 	raw->flash_offset = ofs | REF_UNCHECKED;
-	raw->totlen = PAD(je32_to_cpu(ri->totlen));
+	raw->__totlen = PAD(je32_to_cpu(ri->totlen));
 	raw->next_phys = NULL;
 	raw->next_in_ino = ic->nodes;
 
@@ -775,7 +785,7 @@ static int jffs2_scan_dirent_node(struct jffs2_sb_info *c, struct jffs2_eraseblo
 		return -ENOMEM;
 	}
 	
-	raw->totlen = PAD(je32_to_cpu(rd->totlen));
+	raw->__totlen = PAD(je32_to_cpu(rd->totlen));
 	raw->flash_offset = ofs | REF_PRISTINE;
 	raw->next_phys = NULL;
 	raw->next_in_ino = ic->nodes;
diff --git a/fs/jffs2/super.c b/fs/jffs2/super.c
index b657c55d5..c37fb163e 100644
--- a/fs/jffs2/super.c
+++ b/fs/jffs2/super.c
@@ -7,7 +7,7 @@
  *
  * For licensing information, see the file 'LICENCE' in this directory.
  *
- * $Id: super.c,v 1.90 2003/10/11 11:47:23 dwmw2 Exp $
+ * $Id: super.c,v 1.97 2004/07/16 15:17:57 dwmw2 Exp $
  *
  */
 
@@ -24,6 +24,7 @@
 #include <linux/mtd/mtd.h>
 #include <linux/ctype.h>
 #include <linux/namei.h>
+#include "compr.h"
 #include "nodelist.h"
 
 static void jffs2_put_super(struct super_block *);
@@ -266,7 +267,7 @@ static void jffs2_put_super (struct super_block *sb)
 	jffs2_free_ino_caches(c);
 	jffs2_free_raw_node_refs(c);
 	kfree(c->blocks);
-	jffs2_nand_flash_cleanup(c);
+	jffs2_flash_cleanup(c);
 	kfree(c->inocache_list);
 	if (c->mtd->sync)
 		c->mtd->sync(c->mtd);
@@ -294,7 +295,7 @@ static int __init init_jffs2_fs(void)
 	int ret;
 
 	printk(KERN_INFO "JFFS2 version 2.2."
-#ifdef CONFIG_FS_JFFS2_NAND
+#ifdef CONFIG_JFFS2_FS_NAND
 	       " (NAND)"
 #endif
 	       " (C) 2001-2003 Red Hat, Inc.\n");
@@ -307,15 +308,15 @@ static int __init init_jffs2_fs(void)
 		printk(KERN_ERR "JFFS2 error: Failed to initialise inode cache\n");
 		return -ENOMEM;
 	}
-	ret = jffs2_zlib_init();
+	ret = jffs2_compressors_init();
 	if (ret) {
-		printk(KERN_ERR "JFFS2 error: Failed to initialise zlib workspaces\n");
+		printk(KERN_ERR "JFFS2 error: Failed to initialise compressors\n");
 		goto out;
 	}
 	ret = jffs2_create_slab_caches();
 	if (ret) {
 		printk(KERN_ERR "JFFS2 error: Failed to initialise slab caches\n");
-		goto out_zlib;
+		goto out_compressors;
 	}
 	ret = register_filesystem(&jffs2_fs_type);
 	if (ret) {
@@ -326,8 +327,8 @@ static int __init init_jffs2_fs(void)
 
  out_slab:
 	jffs2_destroy_slab_caches();
- out_zlib:
-	jffs2_zlib_exit();
+ out_compressors:
+	jffs2_compressors_exit();
  out:
 	return ret;
 }
@@ -336,7 +337,7 @@ static void __exit exit_jffs2_fs(void)
 {
 	unregister_filesystem(&jffs2_fs_type);
 	jffs2_destroy_slab_caches();
-	jffs2_zlib_exit();
+	jffs2_compressors_exit();
 	kmem_cache_destroy(jffs2_inode_cachep);
 }
 
diff --git a/fs/jffs2/symlink.c b/fs/jffs2/symlink.c
index 46d306cf0..958cafb90 100644
--- a/fs/jffs2/symlink.c
+++ b/fs/jffs2/symlink.c
@@ -7,7 +7,7 @@
  *
  * For licensing information, see the file 'LICENCE' in this directory.
  *
- * $Id: symlink.c,v 1.12 2003/10/04 08:33:07 dwmw2 Exp $
+ * $Id: symlink.c,v 1.13 2004/07/13 08:59:04 dwmw2 Exp $
  *
  */
 
@@ -15,43 +15,31 @@
 #include <linux/kernel.h>
 #include <linux/slab.h>
 #include <linux/fs.h>
+#include <linux/namei.h>
 #include "nodelist.h"
 
-int jffs2_readlink(struct dentry *dentry, char *buffer, int buflen);
-int jffs2_follow_link(struct dentry *dentry, struct nameidata *nd);
+static int jffs2_follow_link(struct dentry *dentry, struct nameidata *nd);
+static void jffs2_put_link(struct dentry *dentry, struct nameidata *nd);
 
 struct inode_operations jffs2_symlink_inode_operations =
 {	
-	.readlink =	jffs2_readlink,
+	.readlink =	generic_readlink,
 	.follow_link =	jffs2_follow_link,
+	.put_link =	jffs2_put_link,
 	.setattr =	jffs2_setattr
 };
 
-int jffs2_readlink(struct dentry *dentry, char *buffer, int buflen)
-{
-	unsigned char *kbuf;
-	int ret;
-
-	kbuf = jffs2_getlink(JFFS2_SB_INFO(dentry->d_inode->i_sb), JFFS2_INODE_INFO(dentry->d_inode));
-	if (IS_ERR(kbuf))
-		return PTR_ERR(kbuf);
-
-	ret = vfs_readlink(dentry, buffer, buflen, kbuf);
-	kfree(kbuf);
-	return ret;
-}
-
-int jffs2_follow_link(struct dentry *dentry, struct nameidata *nd)
+static int jffs2_follow_link(struct dentry *dentry, struct nameidata *nd)
 {
 	unsigned char *buf;
-	int ret;
-
 	buf = jffs2_getlink(JFFS2_SB_INFO(dentry->d_inode->i_sb), JFFS2_INODE_INFO(dentry->d_inode));
+	nd_set_link(nd, buf);
+	return 0;
+}
 
-	if (IS_ERR(buf))
-		return PTR_ERR(buf);
-
-	ret = vfs_follow_link(nd, buf);
-	kfree(buf);
-	return ret;
+static void jffs2_put_link(struct dentry *dentry, struct nameidata *nd)
+{
+	char *s = nd_get_link(nd);
+	if (!IS_ERR(s))
+		kfree(s);
 }
diff --git a/fs/jffs2/wbuf.c b/fs/jffs2/wbuf.c
index ecfb155cb..2470eef95 100644
--- a/fs/jffs2/wbuf.c
+++ b/fs/jffs2/wbuf.c
@@ -2,12 +2,14 @@
  * JFFS2 -- Journalling Flash File System, Version 2.
  *
  * Copyright (C) 2001-2003 Red Hat, Inc.
+ * Copyright (C) 2004 Thomas Gleixner <tglx@linutronix.de>
  *
  * Created by David Woodhouse <dwmw2@redhat.com>
+ * Modified debugged and enhanced by Thomas Gleixner <tglx@linutronix.de>
  *
  * For licensing information, see the file 'LICENCE' in this directory.
  *
- * $Id: wbuf.c,v 1.53 2003/10/11 11:46:09 dwmw2 Exp $
+ * $Id: wbuf.c,v 1.70 2004/07/13 08:58:25 dwmw2 Exp $
  *
  */
 
@@ -27,7 +29,7 @@ static unsigned char *brokenbuf;
 #endif
 
 /* max. erase failures before we mark a block bad */
-#define MAX_ERASE_FAILURES 	5
+#define MAX_ERASE_FAILURES 	2
 
 /* two seconds timeout for timed wbuf-flushing */
 #define WBUF_FLUSH_TIMEOUT	2 * HZ
@@ -179,10 +181,10 @@ static void jffs2_wbuf_recover(struct jffs2_sb_info *c)
 	first_raw = &jeb->first_node;
 	while (*first_raw && 
 	       (ref_obsolete(*first_raw) ||
-		(ref_offset(*first_raw) + (*first_raw)->totlen) < c->wbuf_ofs)) {
+		(ref_offset(*first_raw)+ref_totlen(c, jeb, *first_raw)) < c->wbuf_ofs)) {
 		D1(printk(KERN_DEBUG "Skipping node at 0x%08x(%d)-0x%08x which is either before 0x%08x or obsolete\n",
 			  ref_offset(*first_raw), ref_flags(*first_raw),
-			  (ref_offset(*first_raw) + (*first_raw)->totlen),
+			  (ref_offset(*first_raw) + ref_totlen(c, jeb, *first_raw)),
 			  c->wbuf_ofs));
 		first_raw = &(*first_raw)->next_phys;
 	}
@@ -195,13 +197,13 @@ static void jffs2_wbuf_recover(struct jffs2_sb_info *c)
 	}
 
 	start = ref_offset(*first_raw);
-	end = ref_offset(*first_raw) + (*first_raw)->totlen;
+	end = ref_offset(*first_raw) + ref_totlen(c, jeb, *first_raw);
 
 	/* Find the last node to be recovered */
 	raw = first_raw;
 	while ((*raw)) {
 		if (!ref_obsolete(*raw))
-			end = ref_offset(*raw) + (*raw)->totlen;
+			end = ref_offset(*raw) + ref_totlen(c, jeb, *raw);
 
 		raw = &(*raw)->next_phys;
 	}
@@ -295,7 +297,7 @@ static void jffs2_wbuf_recover(struct jffs2_sb_info *c)
 					return;
 
 				raw2->flash_offset = ofs | REF_OBSOLETE;
-				raw2->totlen = (*first_raw)->totlen;
+				raw2->__totlen = ref_totlen(c, jeb, *first_raw);
 				raw2->next_phys = NULL;
 				raw2->next_in_ino = NULL;
 
@@ -336,24 +338,26 @@ static void jffs2_wbuf_recover(struct jffs2_sb_info *c)
 
 	raw = first_raw;
 	while (*raw) {
+		uint32_t rawlen = ref_totlen(c, jeb, *raw);
+
 		D1(printk(KERN_DEBUG "Refiling block of %08x at %08x(%d) to %08x\n",
-			  (*raw)->totlen, ref_offset(*raw), ref_flags(*raw), ofs));
+			  rawlen, ref_offset(*raw), ref_flags(*raw), ofs));
 
 		if (ref_obsolete(*raw)) {
 			/* Shouldn't really happen much */
-			new_jeb->dirty_size += (*raw)->totlen;
-			new_jeb->free_size -= (*raw)->totlen;
-			c->dirty_size += (*raw)->totlen;
+			new_jeb->dirty_size += rawlen;
+			new_jeb->free_size -= rawlen;
+			c->dirty_size += rawlen;
 		} else {
-			new_jeb->used_size += (*raw)->totlen;
-			new_jeb->free_size -= (*raw)->totlen;
-			jeb->dirty_size += (*raw)->totlen;
-			jeb->used_size  -= (*raw)->totlen;
-			c->dirty_size += (*raw)->totlen;
+			new_jeb->used_size += rawlen;
+			new_jeb->free_size -= rawlen;
+			jeb->dirty_size += rawlen;
+			jeb->used_size  -= rawlen;
+			c->dirty_size += rawlen;
 		}
-		c->free_size -= (*raw)->totlen;
+		c->free_size -= rawlen;
 		(*raw)->flash_offset = ofs | ref_flags(*raw);
-		ofs += (*raw)->totlen;
+		ofs += rawlen;
 		new_jeb->last_node = *raw;
 
 		raw = &(*raw)->next_phys;
@@ -422,6 +426,9 @@ static int __jffs2_flush_wbuf(struct jffs2_sb_info *c, int pad)
 			padnode->nodetype = cpu_to_je16(JFFS2_NODETYPE_PADDING);
 			padnode->totlen = cpu_to_je32(c->wbuf_pagesize - c->wbuf_len);
 			padnode->hdr_crc = cpu_to_je32(crc32(0, padnode, sizeof(*padnode)-4));
+		} else {
+			/* Pad with JFFS2_DIRTY_BITMASK */
+			memset(c->wbuf + c->wbuf_len, 0, c->wbuf_pagesize - c->wbuf_len);
 		}
 	}
 	/* else jffs2_flash_writev has actually filled in the rest of the
@@ -454,31 +461,34 @@ static int __jffs2_flush_wbuf(struct jffs2_sb_info *c, int pad)
 		return ret; 
 	}
 
-	/* Adjusting free size of next block only, if it's called from fsync ! */
-	if (pad == 2) {
-		D1(printk(KERN_DEBUG "jffs2_flush_wbuf() adjusting free_size of c->nextblock\n"));
-		spin_lock(&c->erase_completion_lock);
-		if (!c->nextblock)
-			BUG();
+	spin_lock(&c->erase_completion_lock);
+
+	/* Adjust free size of the block if we padded. */
+	if (pad) {
+		struct jffs2_eraseblock *jeb;
+
+		jeb = &c->blocks[c->wbuf_ofs / c->sector_size];
+
+		D1(printk(KERN_DEBUG "jffs2_flush_wbuf() adjusting free_size of %sblock at %08x\n",
+			  (jeb==c->nextblock)?"next":"", jeb->offset));
+
 		/* wbuf_pagesize - wbuf_len is the amount of space that's to be 
 		   padded. If there is less free space in the block than that,
 		   something screwed up */
-		if (c->nextblock->free_size < (c->wbuf_pagesize - c->wbuf_len)) {
+		if (jeb->free_size < (c->wbuf_pagesize - c->wbuf_len)) {
 			printk(KERN_CRIT "jffs2_flush_wbuf(): Accounting error. wbuf at 0x%08x has 0x%03x bytes, 0x%03x left.\n",
 			       c->wbuf_ofs, c->wbuf_len, c->wbuf_pagesize-c->wbuf_len);
 			printk(KERN_CRIT "jffs2_flush_wbuf(): But free_size for block at 0x%08x is only 0x%08x\n",
-			       c->nextblock->offset, c->nextblock->free_size);
+			       jeb->offset, jeb->free_size);
 			BUG();
 		}
-		c->nextblock->free_size -= (c->wbuf_pagesize - c->wbuf_len);
+		jeb->free_size -= (c->wbuf_pagesize - c->wbuf_len);
 		c->free_size -= (c->wbuf_pagesize - c->wbuf_len);
-		c->nextblock->wasted_size += (c->wbuf_pagesize - c->wbuf_len);
+		jeb->wasted_size += (c->wbuf_pagesize - c->wbuf_len);
 		c->wasted_size += (c->wbuf_pagesize - c->wbuf_len);
-		spin_unlock(&c->erase_completion_lock);
 	}
 
 	/* Stick any now-obsoleted blocks on the erase_pending_list */
-	spin_lock(&c->erase_completion_lock);
 	jffs2_refile_wbuf_blocks(c);
 	jffs2_clear_wbuf_ino_list(c);
 	spin_unlock(&c->erase_completion_lock);
@@ -512,8 +522,12 @@ int jffs2_flush_wbuf_gc(struct jffs2_sb_info *c, uint32_t ino)
 	old_wbuf_ofs = c->wbuf_ofs;
 	old_wbuf_len = c->wbuf_len;
 
-	while (old_wbuf_len &&
-	       old_wbuf_ofs == c->wbuf_ofs) {
+	if (c->unchecked_size) {
+		/* GC won't make any progress for a while */
+		D1(printk(KERN_DEBUG "jffs2_flush_wbuf_gc() padding. Not finished checking\n"));
+		ret = __jffs2_flush_wbuf(c, 2);
+	} else while (old_wbuf_len &&
+		      old_wbuf_ofs == c->wbuf_ofs) {
 
 		up(&c->alloc_sem);
 
@@ -544,9 +558,9 @@ int jffs2_flush_wbuf_pad(struct jffs2_sb_info *c)
 
 #define PAGE_DIV(x) ( (x) & (~(c->wbuf_pagesize - 1)) )
 #define PAGE_MOD(x) ( (x) & (c->wbuf_pagesize - 1) )
-int jffs2_flash_writev(struct jffs2_sb_info *c, const struct iovec *invecs, unsigned long count, loff_t to, size_t *retlen, uint32_t ino)
+int jffs2_flash_writev(struct jffs2_sb_info *c, const struct kvec *invecs, unsigned long count, loff_t to, size_t *retlen, uint32_t ino)
 {
-	struct iovec outvecs[3];
+	struct kvec outvecs[3];
 	uint32_t totlen = 0;
 	uint32_t split_ofs = 0;
 	uint32_t old_totlen;
@@ -751,11 +765,11 @@ alldone:
 
 /*
  *	This is the entry for flash write.
- *	Check, if we work on NAND FLASH, if so build an iovec and write it via vritev
+ *	Check, if we work on NAND FLASH, if so build an kvec and write it via vritev
 */
 int jffs2_flash_write(struct jffs2_sb_info *c, loff_t ofs, size_t len, size_t *retlen, const u_char *buf)
 {
-	struct iovec vecs[1];
+	struct kvec vecs[1];
 
 	if (jffs2_can_mark_obsolete(c))
 		return c->mtd->write(c->mtd, ofs, len, retlen, buf);
@@ -835,9 +849,8 @@ int jffs2_check_oob_empty( struct jffs2_sb_info *c, struct jffs2_eraseblock *jeb
 	size_t  retlen;
 	int	oob_size;
 
-	oob_size = c->mtd->oobsize;
-
 	/* allocate a buffer for all oob data in this sector */
+	oob_size = c->mtd->oobsize;
 	len = 4 * oob_size;
 	buf = kmalloc(len, GFP_KERNEL);
 	if (!buf) {
@@ -861,35 +874,23 @@ int jffs2_check_oob_empty( struct jffs2_sb_info *c, struct jffs2_eraseblock *jeb
 		goto out;
 	}
 	
-	/* Special check for first two pages */
-	for (page = 0; page < 2 * oob_size; page += oob_size) {
-		/* Check for bad block marker */
-		if (buf[page+c->badblock_pos] != 0xff) {
-			D1(printk(KERN_WARNING "jffs2_check_oob_empty(): Bad or failed block at %08x\n",jeb->offset));
-			/* Return 2 for bad and 3 for failed block 
-			   bad goes to list_bad and failed to list_erase */
-			ret = (!page) ? 2 : 3;
+	/* Special check for first page */
+	for(i = 0; i < oob_size ; i++) {
+		/* Yeah, we know about the cleanmarker. */
+		if (mode && i >= c->fsdata_pos && 
+		    i < c->fsdata_pos + c->fsdata_len)
+			continue;
+
+		if (buf[i] != 0xFF) {
+			D2(printk(KERN_DEBUG "Found %02x at %x in OOB for %08x\n",
+				  buf[page+i], page+i, jeb->offset));
+			ret = 1; 
 			goto out;
 		}
-		for(i = 0; i < oob_size ; i++) {
-			/* Yeah, we know about the cleanmarker. */
-			if (mode && i >= c->fsdata_pos && 
-			    i < c->fsdata_pos+c->fsdata_len)
-				continue;
-
-			if (buf[page+i] != 0xFF) {
-				D2(printk(KERN_DEBUG "Found %02x at %x in OOB for %08x\n",
-					  buf[page+i], page+i, jeb->offset));
-				ret = 1; 
-				goto out;
-			}
-		}
-		/* only the first page can contain a cleanmarker !*/
-		mode = 0;
-	}	
+	}
 
 	/* we know, we are aligned :) */	
-	for (; page < len; page += sizeof(long)) {
+	for (page = oob_size; page < len; page += sizeof(long)) {
 		unsigned long dat = *(unsigned long *)(&buf[page]);
 		if(dat != -1) {
 			ret = 1; 
@@ -912,7 +913,7 @@ out:
 int jffs2_check_nand_cleanmarker (struct jffs2_sb_info *c, struct jffs2_eraseblock *jeb)
 {
 	struct jffs2_unknown_node n;
-	unsigned char buf[32];
+	unsigned char buf[2 * NAND_MAX_OOBSIZE];
 	unsigned char *p;
 	int ret, i, cnt, retval = 0;
 	size_t retlen, offset;
@@ -923,6 +924,11 @@ int jffs2_check_nand_cleanmarker (struct jffs2_sb_info *c, struct jffs2_eraseblo
 
 	/* Loop through the physical blocks */
 	for (cnt = 0; cnt < (c->sector_size / c->mtd->erasesize); cnt++) {
+		/* Check first if the block is bad. */
+		if (c->mtd->block_isbad (c->mtd, offset)) {
+			D1 (printk (KERN_WARNING "jffs2_check_nand_cleanmarker(): Bad block at %08x\n", jeb->offset));
+			return 2;
+		}
 		/*
 		   *    We read oob data from page 0 and 1 of the block.
 		   *    page 0 contains cleanmarker and badblock info
@@ -939,19 +945,6 @@ int jffs2_check_nand_cleanmarker (struct jffs2_sb_info *c, struct jffs2_eraseblo
 			return -EIO;
 		}
 
-		/* Check for bad block marker */
-		if (buf[c->badblock_pos] != 0xff) {
-			D1 (printk (KERN_WARNING "jffs2_check_nand_cleanmarker(): Bad block at %08x (has %02x %02x in badblock_pos %d\n",
-				    jeb->offset, buf[c->badblock_pos],  buf[c->badblock_pos + oob_size], c->badblock_pos));
-			return 2;
-		}
-
-		/* Check for failure counter in the second page */
-		if (buf[c->badblock_pos + oob_size] != 0xff) {
-			D1 (printk (KERN_WARNING "jffs2_check_nand_cleanmarker(): Block marked as failed at %08x, fail count:%d\n", jeb->offset, buf[c->badblock_pos + oob_size]));
-			return 3;
-		}
-
 		/* Check cleanmarker only on the first physical block */
 		if (!cnt) {
 			n.magic = cpu_to_je16 (JFFS2_MAGIC_BITMASK);
@@ -1002,136 +995,100 @@ int jffs2_write_nand_cleanmarker(struct jffs2_sb_info *c, struct jffs2_erasebloc
 }
 
 /* 
- * We try to get the failure count of this block.
- */
-int jffs2_nand_read_failcnt(struct jffs2_sb_info *c, struct jffs2_eraseblock *jeb) {
-
-	unsigned char buf[16];
-	int	ret;
-	size_t 	retlen;
-	int	oob_size;
-
-	oob_size = c->mtd->oobsize;
-	
-	ret = c->mtd->read_oob(c->mtd, jeb->offset + c->mtd->oobblock, oob_size , &retlen, buf);
-	
-	if (ret) {
-		D1(printk(KERN_WARNING "jffs2_nand_read_failcnt(): Read OOB failed %d for block at %08x\n", ret, jeb->offset));
-		return ret;
-	}
-
-	if (retlen < oob_size) {
-		D1(printk(KERN_WARNING "jffs2_nand_read_failcnt(): Read OOB return short read (%zd bytes not %d) for block at %08x\n", retlen, oob_size, jeb->offset));
-		return -EIO;
-	}
-
-	jeb->bad_count =  buf[c->badblock_pos];	
-	return 0;
-}
-
-/* 
- * On NAND we try to mark this block bad. We try to write how often
- * the block was erased and mark it finaly bad, if the count
- * is > MAX_ERASE_FAILURES. We read this information on mount !
- * jeb->bad_count contains the count before this erase.
+ * On NAND we try to mark this block bad. If the block was erased more
+ * than MAX_ERASE_FAILURES we mark it finaly bad.
  * Don't care about failures. This block remains on the erase-pending
  * or badblock list as long as nobody manipulates the flash with
  * a bootloader or something like that.
  */
 
-int jffs2_write_nand_badblock(struct jffs2_sb_info *c, struct jffs2_eraseblock *jeb)
+int jffs2_write_nand_badblock(struct jffs2_sb_info *c, struct jffs2_eraseblock *jeb, uint32_t bad_offset)
 {
-	unsigned char buf = 0x0;
 	int 	ret;
-	size_t 	retlen;
 
 	/* if the count is < max, we try to write the counter to the 2nd page oob area */
-	if( ++jeb->bad_count < MAX_ERASE_FAILURES) {
-		buf = (unsigned char)jeb->bad_count;
-		c->badblock_pos += c->mtd->oobblock;
-	}
-	
-	ret = jffs2_flash_write_oob(c, jeb->offset + c->badblock_pos, 1, &retlen, &buf);
+	if( ++jeb->bad_count < MAX_ERASE_FAILURES)
+		return 0;
+
+	if (!c->mtd->block_markbad)
+		return 1; // What else can we do?
+
+	D1(printk(KERN_WARNING "jffs2_write_nand_badblock(): Marking bad block at %08x\n", bad_offset));
+	ret = c->mtd->block_markbad(c->mtd, bad_offset);
 	
 	if (ret) {
 		D1(printk(KERN_WARNING "jffs2_write_nand_badblock(): Write failed for block at %08x: error %d\n", jeb->offset, ret));
 		return ret;
 	}
-	if (retlen != 1) {
-		D1(printk(KERN_WARNING "jffs2_write_nand_badblock(): Short write for block at %08x: %zd not 1\n", jeb->offset, retlen));
-		return ret;
-	}
-	return 0;
+	return 1;
 }
 
-#define JFFS2_OOB_ECCPOS0		0
-#define JFFS2_OOB_ECCPOS1		1
-#define JFFS2_OOB_ECCPOS2		2
-#define JFFS2_OOB_ECCPOS3		3
-#define JFFS2_OOB_ECCPOS4		6
-#define JFFS2_OOB_ECCPOS5		7
-
-#define NAND_JFFS2_OOB8_FSDAPOS		6
-#define NAND_JFFS2_OOB16_FSDAPOS	8
-#define NAND_JFFS2_OOB8_FSDALEN		2
 #define NAND_JFFS2_OOB16_FSDALEN	8
 
-static struct nand_oobinfo jffs2_oobinfo_swecc = {
-	.useecc = 1,
-	.eccpos = {JFFS2_OOB_ECCPOS0, JFFS2_OOB_ECCPOS1, JFFS2_OOB_ECCPOS2,
-		   JFFS2_OOB_ECCPOS3, JFFS2_OOB_ECCPOS4, JFFS2_OOB_ECCPOS5}
-};
-
 static struct nand_oobinfo jffs2_oobinfo_docecc = {
-	.useecc = 1,
+	.useecc = MTD_NANDECC_PLACE,
+	.eccbytes = 6,
 	.eccpos = {0,1,2,3,4,5}
 };
 
 
-
-int jffs2_nand_flash_setup(struct jffs2_sb_info *c)
+int jffs2_nand_set_oobinfo(struct jffs2_sb_info *c)
 {
+	struct nand_oobinfo *oinfo = &c->mtd->oobinfo;
+
+	/* Do this only, if we have an oob buffer */
+	if (!c->mtd->oobsize)
+		return 0;
+	
 	/* Cleanmarker is out-of-band, so inline size zero */
 	c->cleanmarker_size = 0;
 
-	/* Initialise write buffer */
-	c->wbuf_pagesize = c->mtd->oobblock;
-	c->wbuf_ofs = 0xFFFFFFFF;
-
-	/* FIXME: If we had a generic way of describing the hardware's
-	   use of OOB area, we could perhaps make this generic too. */
-	switch(c->mtd->ecctype) {
-	case MTD_ECC_SW:
-		D1(printk(KERN_DEBUG "JFFS2 using software ECC\n"));
-		c->oobinfo = &jffs2_oobinfo_swecc;
-		if (c->mtd->oobsize == 8) {
-			c->fsdata_pos = NAND_JFFS2_OOB8_FSDAPOS;
-			c->fsdata_len = NAND_JFFS2_OOB8_FSDALEN;
-		} else {
-			c->fsdata_pos = NAND_JFFS2_OOB16_FSDAPOS;
+	/* Should we use autoplacement ? */
+	if (oinfo && oinfo->useecc == MTD_NANDECC_AUTOPLACE) {
+		D1(printk(KERN_DEBUG "JFFS2 using autoplace on NAND\n"));
+		/* Get the position of the free bytes */
+		if (!oinfo->oobfree[0][0]) {
+			printk (KERN_WARNING "jffs2_nand_set_oobinfo(): Eeep. Autoplacement selected and no empty space in oob\n");
+			return -ENOSPC;
+		}
+		c->fsdata_pos = oinfo->oobfree[0][0];
+		c->fsdata_len = oinfo->oobfree[0][1];
+		if (c->fsdata_len > 8)
+			c->fsdata_len = 8;
+	} else {
+		/* This is just a legacy fallback and should go away soon */
+		switch(c->mtd->ecctype) {
+		case MTD_ECC_RS_DiskOnChip:
+			printk(KERN_WARNING "JFFS2 using DiskOnChip hardware ECC without autoplacement. Fix it!\n");
+			c->oobinfo = &jffs2_oobinfo_docecc;
+			c->fsdata_pos = 6;
 			c->fsdata_len = NAND_JFFS2_OOB16_FSDALEN;
+			c->badblock_pos = 15;
+			break;
+	
+		default:
+			D1(printk(KERN_DEBUG "JFFS2 on NAND. No autoplacment info found\n"));
+			return -EINVAL;
 		}
-		c->badblock_pos = NAND_BADBLOCK_POS;
-		break;
-
-	case MTD_ECC_RS_DiskOnChip:
-		D1(printk(KERN_DEBUG "JFFS2 using DiskOnChip hardware ECC\n"));
-		c->oobinfo = &jffs2_oobinfo_docecc;
-		c->fsdata_pos = 6;
-		c->fsdata_len = NAND_JFFS2_OOB16_FSDALEN;
-		c->badblock_pos = 15;
-		break;
-
-	default:
-		printk("JFFS2 doesn't yet know how to handle ECC type %d\n",
-		       c->mtd->ecctype);
-		return -EINVAL;
 	}
+	return 0;
+}
 
+int jffs2_nand_flash_setup(struct jffs2_sb_info *c)
+{
+	int res;
+
+	/* Initialise write buffer */
+	c->wbuf_pagesize = c->mtd->oobblock;
+	c->wbuf_ofs = 0xFFFFFFFF;
+
+	
 	c->wbuf = kmalloc(c->wbuf_pagesize, GFP_KERNEL);
 	if (!c->wbuf)
 		return -ENOMEM;
 
+	res = jffs2_nand_set_oobinfo(c);
+
 #ifdef BREAKME
 	if (!brokenbuf)
 		brokenbuf = kmalloc(c->wbuf_pagesize, GFP_KERNEL);
@@ -1141,7 +1098,7 @@ int jffs2_nand_flash_setup(struct jffs2_sb_info *c)
 	}
 	memset(brokenbuf, 0xdb, c->wbuf_pagesize);
 #endif
-	return 0;
+	return res;
 }
 
 void jffs2_nand_flash_cleanup(struct jffs2_sb_info *c)
diff --git a/fs/jffs2/write.c b/fs/jffs2/write.c
index f28d9d5bc..1253c48da 100644
--- a/fs/jffs2/write.c
+++ b/fs/jffs2/write.c
@@ -7,7 +7,7 @@
  *
  * For licensing information, see the file 'LICENCE' in this directory.
  *
- * $Id: write.c,v 1.75 2003/10/08 11:45:11 dwmw2 Exp $
+ * $Id: write.c,v 1.85 2004/07/13 08:58:25 dwmw2 Exp $
  *
  */
 
@@ -18,6 +18,7 @@
 #include <linux/pagemap.h>
 #include <linux/mtd/mtd.h>
 #include "nodelist.h"
+#include "compr.h"
 
 
 int jffs2_do_new_inode(struct jffs2_sb_info *c, struct jffs2_inode_info *f, uint32_t mode, struct jffs2_raw_inode *ri)
@@ -31,7 +32,6 @@ int jffs2_do_new_inode(struct jffs2_sb_info *c, struct jffs2_inode_info *f, uint
 
 	memset(ic, 0, sizeof(*ic));
 
-	init_MUTEX_LOCKED(&f->sem);
 	f->inocache = ic;
 	f->inocache->nlink = 1;
 	f->inocache->nodes = (struct jffs2_raw_node_ref *)f->inocache;
@@ -92,7 +92,7 @@ struct jffs2_full_dnode *jffs2_write_dnode(struct jffs2_sb_info *c, struct jffs2
 	struct jffs2_raw_node_ref *raw;
 	struct jffs2_full_dnode *fn;
 	size_t retlen;
-	struct iovec vecs[2];
+	struct kvec vecs[2];
 	int ret;
 	int retried = 0;
 	unsigned long cnt = 2;
@@ -133,7 +133,7 @@ struct jffs2_full_dnode *jffs2_write_dnode(struct jffs2_sb_info *c, struct jffs2
 	fn->raw = raw;
 
 	raw->flash_offset = flash_ofs;
-	raw->totlen = PAD(sizeof(*ri)+datalen);
+	raw->__totlen = PAD(sizeof(*ri)+datalen);
 	raw->next_phys = NULL;
 
 	ret = jffs2_flash_writev(c, vecs, cnt, flash_ofs, &retlen,
@@ -233,7 +233,7 @@ struct jffs2_full_dirent *jffs2_write_dirent(struct jffs2_sb_info *c, struct jff
 	struct jffs2_raw_node_ref *raw;
 	struct jffs2_full_dirent *fd;
 	size_t retlen;
-	struct iovec vecs[2];
+	struct kvec vecs[2];
 	int retried = 0;
 	int ret;
 
@@ -275,11 +275,11 @@ struct jffs2_full_dirent *jffs2_write_dirent(struct jffs2_sb_info *c, struct jff
 	fd->raw = raw;
 
 	raw->flash_offset = flash_ofs;
-	raw->totlen = PAD(sizeof(*rd)+namelen);
+	raw->__totlen = PAD(sizeof(*rd)+namelen);
 	raw->next_phys = NULL;
 
 	ret = jffs2_flash_writev(c, vecs, 2, flash_ofs, &retlen,
-				 (alloc_mode==ALLOC_GC)?0:fd->ino);
+				 (alloc_mode==ALLOC_GC)?0:je32_to_cpu(rd->pino));
 	if (ret || (retlen != sizeof(*rd) + namelen)) {
 		printk(KERN_NOTICE "Write of %zd bytes at 0x%08x failed. returned %d, retlen %zd\n", 
 			       sizeof(*rd)+namelen, flash_ofs, ret, retlen);
@@ -359,7 +359,7 @@ int jffs2_write_inode_range(struct jffs2_sb_info *c, struct jffs2_inode_info *f,
 	while(writelen) {
 		struct jffs2_full_dnode *fn;
 		unsigned char *comprbuf = NULL;
-		unsigned char comprtype = JFFS2_COMPR_NONE;
+		uint16_t comprtype = JFFS2_COMPR_NONE;
 		uint32_t phys_ofs, alloclen;
 		uint32_t datalen, cdatalen;
 		int retried = 0;
@@ -373,24 +373,10 @@ int jffs2_write_inode_range(struct jffs2_sb_info *c, struct jffs2_inode_info *f,
 			break;
 		}
 		down(&f->sem);
-		datalen = writelen;
-		cdatalen = min_t(uint32_t, alloclen - sizeof(*ri), writelen);
+		datalen = min_t(uint32_t, writelen, PAGE_CACHE_SIZE - (offset & (PAGE_CACHE_SIZE-1)));
+		cdatalen = min_t(uint32_t, alloclen - sizeof(*ri), datalen);
 
-		comprbuf = kmalloc(cdatalen, GFP_KERNEL);
-		if (comprbuf) {
-			comprtype = jffs2_compress(buf, comprbuf, &datalen, &cdatalen);
-		}
-		if (comprtype == JFFS2_COMPR_NONE) {
-			/* Either compression failed, or the allocation of comprbuf failed */
-			if (comprbuf)
-				kfree(comprbuf);
-			comprbuf = buf;
-			datalen = cdatalen;
-		}
-		/* Now comprbuf points to the data to be written, be it compressed or not.
-		   comprtype holds the compression type, and comprtype == JFFS2_COMPR_NONE means
-		   that the comprbuf doesn't need to be kfree()d. 
-		*/
+		comprtype = jffs2_compress(c, f, buf, &comprbuf, &datalen, &cdatalen);
 
 		ri->magic = cpu_to_je16(JFFS2_MAGIC_BITMASK);
 		ri->nodetype = cpu_to_je16(JFFS2_NODETYPE_INODE);
@@ -403,14 +389,14 @@ int jffs2_write_inode_range(struct jffs2_sb_info *c, struct jffs2_inode_info *f,
 		ri->offset = cpu_to_je32(offset);
 		ri->csize = cpu_to_je32(cdatalen);
 		ri->dsize = cpu_to_je32(datalen);
-		ri->compr = comprtype;
+		ri->compr = comprtype & 0xff;
+		ri->usercompr = (comprtype >> 8 ) & 0xff;
 		ri->node_crc = cpu_to_je32(crc32(0, ri, sizeof(*ri)-8));
 		ri->data_crc = cpu_to_je32(crc32(0, comprbuf, cdatalen));
 
 		fn = jffs2_write_dnode(c, f, ri, comprbuf, cdatalen, phys_ofs, ALLOC_NORETRY);
 
-		if (comprtype != JFFS2_COMPR_NONE)
-			kfree(comprbuf);
+		jffs2_free_comprbuf(comprbuf, buf);
 
 		if (IS_ERR(fn)) {
 			ret = PTR_ERR(fn);
@@ -559,48 +545,75 @@ int jffs2_do_unlink(struct jffs2_sb_info *c, struct jffs2_inode_info *dir_f,
 	uint32_t alloclen, phys_ofs;
 	int ret;
 
-	rd = jffs2_alloc_raw_dirent();
-	if (!rd)
-		return -ENOMEM;
+	if (1 /* alternative branch needs testing */ || 
+	    !jffs2_can_mark_obsolete(c)) {
+		/* We can't mark stuff obsolete on the medium. We need to write a deletion dirent */
 
-	ret = jffs2_reserve_space(c, sizeof(*rd)+namelen, &phys_ofs, &alloclen, ALLOC_DELETION);
-	if (ret) {
+		rd = jffs2_alloc_raw_dirent();
+		if (!rd)
+			return -ENOMEM;
+
+		ret = jffs2_reserve_space(c, sizeof(*rd)+namelen, &phys_ofs, &alloclen, ALLOC_DELETION);
+		if (ret) {
+			jffs2_free_raw_dirent(rd);
+			return ret;
+		}
+
+		down(&dir_f->sem);
+
+		/* Build a deletion node */
+		rd->magic = cpu_to_je16(JFFS2_MAGIC_BITMASK);
+		rd->nodetype = cpu_to_je16(JFFS2_NODETYPE_DIRENT);
+		rd->totlen = cpu_to_je32(sizeof(*rd) + namelen);
+		rd->hdr_crc = cpu_to_je32(crc32(0, rd, sizeof(struct jffs2_unknown_node)-4));
+		
+		rd->pino = cpu_to_je32(dir_f->inocache->ino);
+		rd->version = cpu_to_je32(++dir_f->highest_version);
+		rd->ino = cpu_to_je32(0);
+		rd->mctime = cpu_to_je32(get_seconds());
+		rd->nsize = namelen;
+		rd->type = DT_UNKNOWN;
+		rd->node_crc = cpu_to_je32(crc32(0, rd, sizeof(*rd)-8));
+		rd->name_crc = cpu_to_je32(crc32(0, name, namelen));
+
+		fd = jffs2_write_dirent(c, dir_f, rd, name, namelen, phys_ofs, ALLOC_DELETION);
+		
 		jffs2_free_raw_dirent(rd);
-		return ret;
-	}
 
-	down(&dir_f->sem);
+		if (IS_ERR(fd)) {
+			jffs2_complete_reservation(c);
+			up(&dir_f->sem);
+			return PTR_ERR(fd);
+		}
 
-	/* Build a deletion node */
-	rd->magic = cpu_to_je16(JFFS2_MAGIC_BITMASK);
-	rd->nodetype = cpu_to_je16(JFFS2_NODETYPE_DIRENT);
-	rd->totlen = cpu_to_je32(sizeof(*rd) + namelen);
-	rd->hdr_crc = cpu_to_je32(crc32(0, rd, sizeof(struct jffs2_unknown_node)-4));
+		/* File it. This will mark the old one obsolete. */
+		jffs2_add_fd_to_list(c, fd, &dir_f->dents);
+		up(&dir_f->sem);
+	} else {
+		struct jffs2_full_dirent **prev = &dir_f->dents;
+		uint32_t nhash = full_name_hash(name, namelen);
 
-	rd->pino = cpu_to_je32(dir_f->inocache->ino);
-	rd->version = cpu_to_je32(++dir_f->highest_version);
-	rd->ino = cpu_to_je32(0);
-	rd->mctime = cpu_to_je32(get_seconds());
-	rd->nsize = namelen;
-	rd->type = DT_UNKNOWN;
-	rd->node_crc = cpu_to_je32(crc32(0, rd, sizeof(*rd)-8));
-	rd->name_crc = cpu_to_je32(crc32(0, name, namelen));
+		down(&dir_f->sem);
 
-	fd = jffs2_write_dirent(c, dir_f, rd, name, namelen, phys_ofs, ALLOC_DELETION);
-	
-	jffs2_free_raw_dirent(rd);
+		while ((*prev) && (*prev)->nhash <= nhash) {
+			if ((*prev)->nhash == nhash && 
+			    !memcmp((*prev)->name, name, namelen) &&
+			    !(*prev)->name[namelen]) {
+				struct jffs2_full_dirent *this = *prev;
 
-	if (IS_ERR(fd)) {
-		jffs2_complete_reservation(c);
+				D1(printk(KERN_DEBUG "Marking old dirent node (ino #%u) @%08x obsolete\n",
+					  this->ino, ref_offset(this->raw)));
+
+				*prev = this->next;
+				jffs2_mark_node_obsolete(c, (this->raw));
+				jffs2_free_full_dirent(this);
+				break;
+			}
+			prev = &((*prev)->next);
+		}
 		up(&dir_f->sem);
-		return PTR_ERR(fd);
 	}
 
-	/* File it. This will mark the old one obsolete. */
-	jffs2_add_fd_to_list(c, fd, &dir_f->dents);
-
-	up(&dir_f->sem);
-	
 	/* dead_f is NULL if this was a rename not a real unlink */
 	/* Also catch the !f->inocache case, where there was a dirent
 	   pointing to an inode which didn't exist. */
diff --git a/fs/jffs2/writev.c b/fs/jffs2/writev.c
index 80cd38203..7e46e952d 100644
--- a/fs/jffs2/writev.c
+++ b/fs/jffs2/writev.c
@@ -7,7 +7,7 @@
  *
  * For licensing information, see the file 'LICENCE' in this directory.
  *
- * $Id: writev.c,v 1.4 2003/10/04 08:33:07 dwmw2 Exp $
+ * $Id: writev.c,v 1.5 2004/07/13 08:58:25 dwmw2 Exp $
  *
  */
 
@@ -18,7 +18,7 @@
 /* This ought to be in core MTD code. All registered MTD devices
    without writev should have this put in place. Bug the MTD
    maintainer */
-static inline int mtd_fake_writev(struct mtd_info *mtd, const struct iovec *vecs,
+static inline int mtd_fake_writev(struct mtd_info *mtd, const struct kvec *vecs,
 				  unsigned long count, loff_t to, size_t *retlen)
 {
 	unsigned long i;
@@ -39,7 +39,7 @@ static inline int mtd_fake_writev(struct mtd_info *mtd, const struct iovec *vecs
 	return ret;
 }
 
-int jffs2_flash_direct_writev(struct jffs2_sb_info *c, const struct iovec *vecs,
+int jffs2_flash_direct_writev(struct jffs2_sb_info *c, const struct kvec *vecs,
 			      unsigned long count, loff_t to, size_t *retlen)
 {
 	if (c->mtd->writev)
diff --git a/fs/jfs/acl.c b/fs/jfs/acl.c
index 958cdfb04..8353f48f7 100644
--- a/fs/jfs/acl.c
+++ b/fs/jfs/acl.c
@@ -281,9 +281,9 @@ int jfs_setattr(struct dentry *dentry, struct iattr *iattr)
 	if (rc)
 		return rc;
 
-	inode_setattr(inode, iattr);
+	rc = inode_setattr(inode, iattr);
 
-	if (iattr->ia_valid & ATTR_MODE)
+	if (!rc && (iattr->ia_valid & ATTR_MODE))
 		rc = jfs_acl_chmod(inode);
 
 	return rc;
diff --git a/fs/jfs/file.c b/fs/jfs/file.c
index 67e4ba8ce..a87b06fa8 100644
--- a/fs/jfs/file.c
+++ b/fs/jfs/file.c
@@ -65,11 +65,13 @@ static int jfs_open(struct inode *inode, struct file *file)
 	if (S_ISREG(inode->i_mode) && file->f_mode & FMODE_WRITE &&
 	    (inode->i_size == 0)) {
 		struct jfs_inode_info *ji = JFS_IP(inode);
+		spin_lock_irq(&ji->ag_lock);
 		if (ji->active_ag == -1) {
 			ji->active_ag = ji->agno;
 			atomic_inc(
 			    &JFS_SBI(inode->i_sb)->bmap->db_active[ji->agno]);
 		}
+		spin_unlock_irq(&ji->ag_lock);
 	}
 
 	return 0;
@@ -78,11 +80,13 @@ static int jfs_release(struct inode *inode, struct file *file)
 {
 	struct jfs_inode_info *ji = JFS_IP(inode);
 
+	spin_lock_irq(&ji->ag_lock);
 	if (ji->active_ag != -1) {
 		struct bmap *bmap = JFS_SBI(inode->i_sb)->bmap;
 		atomic_dec(&bmap->db_active[ji->active_ag]);
 		ji->active_ag = -1;
 	}
+	spin_unlock_irq(&ji->ag_lock);
 
 	return 0;
 }
diff --git a/fs/jfs/jfs_btree.h b/fs/jfs/jfs_btree.h
index ba4fb09f5..7f3e9ac45 100644
--- a/fs/jfs/jfs_btree.h
+++ b/fs/jfs/jfs_btree.h
@@ -147,7 +147,7 @@ static inline void BT_STACK_DUMP(struct btstack *btstack)
 	printk("btstack dump:\n");
 	for (i = 0; i < MAXTREEHEIGHT; i++)
 		printk(KERN_ERR "bn = %Lx, index = %d\n",
-		       btstack->stack[i].bn,
+		       (long long)btstack->stack[i].bn,
 		       btstack->stack[i].index);
 }
 
diff --git a/fs/jfs/jfs_dmap.c b/fs/jfs/jfs_dmap.c
index 1b55df36f..ed7343305 100644
--- a/fs/jfs/jfs_dmap.c
+++ b/fs/jfs/jfs_dmap.c
@@ -1204,6 +1204,12 @@ static int dbAllocNext(struct bmap * bmp, struct dmap * dp, s64 blkno,
 	s8 *leaf;
 	u32 mask;
 
+	if (dp->tree.leafidx != cpu_to_le32(LEAFIND)) {
+		jfs_error(bmp->db_ipbmap->i_sb,
+			  "dbAllocNext: Corrupt dmap page");
+		return -EIO;
+	}
+
 	/* pick up a pointer to the leaves of the dmap tree.
 	 */
 	leaf = dp->tree.stree + le32_to_cpu(dp->tree.leafidx);
@@ -1327,7 +1333,15 @@ dbAllocNear(struct bmap * bmp,
 	    struct dmap * dp, s64 blkno, int nblocks, int l2nb, s64 * results)
 {
 	int word, lword, rc;
-	s8 *leaf = dp->tree.stree + le32_to_cpu(dp->tree.leafidx);
+	s8 *leaf;
+
+	if (dp->tree.leafidx != cpu_to_le32(LEAFIND)) {
+		jfs_error(bmp->db_ipbmap->i_sb,
+			  "dbAllocNear: Corrupt dmap page");
+		return -EIO;
+	}
+
+	leaf = dp->tree.stree + le32_to_cpu(dp->tree.leafidx);
 
 	/* determine the word within the dmap that holds the hint
 	 * (i.e. blkno).  also, determine the last word in the dmap
@@ -1489,6 +1503,13 @@ dbAllocAG(struct bmap * bmp, int agno, s64 nblocks, int l2nb, s64 * results)
 	dcp = (struct dmapctl *) mp->data;
 	budmin = dcp->budmin;
 
+	if (dcp->leafidx != cpu_to_le32(CTLLEAFIND)) {
+		jfs_error(bmp->db_ipbmap->i_sb,
+			  "dbAllocAG: Corrupt dmapctl page");
+		release_metapage(mp);
+		return -EIO;
+	}
+
 	/* search the subtree(s) of the dmap control page that describes
 	 * the allocation group, looking for sufficient free space.  to begin,
 	 * determine how many allocation groups are represented in a dmap
@@ -1697,6 +1718,13 @@ static int dbFindCtl(struct bmap * bmp, int l2nb, int level, s64 * blkno)
 		dcp = (struct dmapctl *) mp->data;
 		budmin = dcp->budmin;
 
+		if (dcp->leafidx != cpu_to_le32(CTLLEAFIND)) {
+			jfs_error(bmp->db_ipbmap->i_sb,
+				  "dbFindCtl: Corrupt dmapctl page");
+			release_metapage(mp);
+			return -EIO;
+		}
+
 		/* search the tree within the dmap control page for
 		 * sufficent free space.  if sufficient free space is found,
 		 * dbFindLeaf() returns the index of the leaf at which
@@ -2459,6 +2487,13 @@ dbAdjCtl(struct bmap * bmp, s64 blkno, int newval, int alloc, int level)
 		return -EIO;
 	dcp = (struct dmapctl *) mp->data;
 
+	if (dcp->leafidx != cpu_to_le32(CTLLEAFIND)) {
+		jfs_error(bmp->db_ipbmap->i_sb,
+			  "dbAdjCtl: Corrupt dmapctl page");
+		release_metapage(mp);
+		return -EIO;
+	}
+
 	/* determine the leaf number corresponding to the block and
 	 * the index within the dmap control tree.
 	 */
diff --git a/fs/jfs/jfs_dtree.c b/fs/jfs/jfs_dtree.c
index 3c3140dd7..71e797774 100644
--- a/fs/jfs/jfs_dtree.c
+++ b/fs/jfs/jfs_dtree.c
@@ -259,19 +259,19 @@ static struct dir_table_slot *find_index(struct inode *ip, u32 index,
 			jfs_warn("find_entry called with index = %d", index);
 			maxWarnings--;
 		}
-		return 0;
+		return NULL;
 	}
 
 	if (index >= jfs_ip->next_index) {
 		jfs_warn("find_entry called with index >= next_index");
-		return 0;
+		return NULL;
 	}
 
 	if (jfs_ip->next_index <= (MAX_INLINE_DIRTABLE_ENTRY + 1)) {
 		/*
 		 * Inline directory table
 		 */
-		*mp = 0;
+		*mp = NULL;
 		slot = &jfs_ip->i_dirtable[index - 2];
 	} else {
 		offset = (index - 2) * sizeof(struct dir_table_slot);
@@ -281,7 +281,7 @@ static struct dir_table_slot *find_index(struct inode *ip, u32 index,
 
 		if (*mp && (*lblock != blkno)) {
 			release_metapage(*mp);
-			*mp = 0;
+			*mp = NULL;
 		}
 		if (*mp == 0) {
 			*lblock = blkno;
@@ -289,7 +289,7 @@ static struct dir_table_slot *find_index(struct inode *ip, u32 index,
 		}
 		if (*mp == 0) {
 			jfs_err("free_index: error reading directory table");
-			return 0;
+			return NULL;
 		}
 
 		slot =
@@ -374,6 +374,8 @@ static u32 add_index(tid_t tid, struct inode *ip, s64 bn, int slot)
 		return index;
 	}
 	if (index == (MAX_INLINE_DIRTABLE_ENTRY + 1)) {
+		struct dir_table_slot temp_table[12];
+
 		/*
 		 * It's time to move the inline table to an external
 		 * page and begin to build the xtree
@@ -385,7 +387,6 @@ static u32 add_index(tid_t tid, struct inode *ip, s64 bn, int slot)
 		 * Save the table, we're going to overwrite it with the
 		 * xtree root
 		 */
-		struct dir_table_slot temp_table[12];
 		memcpy(temp_table, &jfs_ip->i_dirtable, sizeof(temp_table));
 
 		/*
@@ -489,7 +490,7 @@ static void free_index(tid_t tid, struct inode *ip, u32 index, u32 next)
 {
 	struct dir_table_slot *dirtab_slot;
 	s64 lblock;
-	struct metapage *mp = 0;
+	struct metapage *mp = NULL;
 
 	dirtab_slot = find_index(ip, index, &mp, &lblock);
 
@@ -542,7 +543,7 @@ static int read_index(struct inode *ip, u32 index,
 		     struct dir_table_slot * dirtab_slot)
 {
 	s64 lblock;
-	struct metapage *mp = 0;
+	struct metapage *mp = NULL;
 	struct dir_table_slot *slot;
 
 	slot = find_index(ip, index, &mp, &lblock);
@@ -849,7 +850,7 @@ int dtInsert(tid_t tid, struct inode *ip,
 		data.leaf.ip = ip;
 	} else {
 		n = NDTLEAF_LEGACY(name->namlen);
-		data.leaf.ip = 0;	/* signifies legacy directory format */
+		data.leaf.ip = NULL;	/* signifies legacy directory format */
 	}
 	data.leaf.ino = cpu_to_le32(*fsn);
 
@@ -939,7 +940,7 @@ static int dtSplitUp(tid_t tid,
 	int xlen, xsize;
 	struct pxdlist pxdlist;
 	pxd_t *pxd;
-	struct component_name key = { 0, 0 };
+	struct component_name key = { 0, NULL };
 	ddata_t *data = split->data;
 	int n;
 	struct dt_lock *dtlck;
@@ -1549,7 +1550,7 @@ static int dtSplitPage(tid_t tid, struct inode *ip, struct dtsplit * split,
 	if ((rp->header.flag & BT_LEAF) && DO_INDEX(ip)) {
 		s64 lblock;
 
-		mp = 0;
+		mp = NULL;
 		stbl = DT_GETSTBL(rp);
 		for (n = 0; n < rp->header.nextindex; n++) {
 			ldtentry = (struct ldtentry *) & rp->slot[stbl[n]];
@@ -1675,7 +1676,7 @@ static int dtExtendPage(tid_t tid,
 		if (DO_INDEX(ip)) {
 			s64 lblock;
 
-			mp = 0;
+			mp = NULL;
 			stbl = DT_GETSTBL(sp);
 			for (n = 0; n < sp->header.nextindex; n++) {
 				ldtentry =
@@ -1969,7 +1970,7 @@ static int dtSplitRoot(tid_t tid,
 	 */
 	if ((rp->header.flag & BT_LEAF) && DO_INDEX(ip)) {
 		s64 lblock;
-		struct metapage *mp = 0;
+		struct metapage *mp = NULL;
 		struct ldtentry *ldtentry;
 
 		stbl = DT_GETSTBL(rp);
@@ -2180,7 +2181,7 @@ int dtDelete(tid_t tid,
 		if (DO_INDEX(ip) && index < p->header.nextindex) {
 			s64 lblock;
 
-			imp = 0;
+			imp = NULL;
 			stbl = DT_GETSTBL(p);
 			for (i = index; i < p->header.nextindex; i++) {
 				ldtentry =
@@ -3872,8 +3873,8 @@ static void dtInsertEntry(dtpage_t * p, int index, struct component_name * key,
 			  ddata_t * data, struct dt_lock ** dtlock)
 {
 	struct dtslot *h, *t;
-	struct ldtentry *lh = 0;
-	struct idtentry *ih = 0;
+	struct ldtentry *lh = NULL;
+	struct idtentry *ih = NULL;
 	int hsi, fsi, klen, len, nextindex;
 	wchar_t *kname, *name;
 	s8 *stbl;
@@ -3882,7 +3883,7 @@ static void dtInsertEntry(dtpage_t * p, int index, struct component_name * key,
 	struct lv *lv;
 	int xsi, n;
 	s64 bn = 0;
-	struct metapage *mp = 0;
+	struct metapage *mp = NULL;
 
 	klen = key->namlen;
 	kname = key->name;
@@ -3998,7 +3999,7 @@ static void dtInsertEntry(dtpage_t * p, int index, struct component_name * key,
 			 * Need to update slot number for entries that moved
 			 * in the stbl
 			 */
-			mp = 0;
+			mp = NULL;
 			for (n = index + 1; n <= nextindex; n++) {
 				lh = (struct ldtentry *) & (p->slot[stbl[n]]);
 				modify_index(data->leaf.tid, data->leaf.ip,
@@ -4034,8 +4035,8 @@ static void dtMoveEntry(dtpage_t * sp, int si, dtpage_t * dp,
 	int dsi;		/* dst slot index */
 	s8 *sstbl, *dstbl;	/* sorted entry table */
 	int snamlen, len;
-	struct ldtentry *slh, *dlh = 0;
-	struct idtentry *sih, *dih = 0;
+	struct ldtentry *slh, *dlh = NULL;
+	struct idtentry *sih, *dih = NULL;
 	struct dtslot *h, *s, *d;
 	struct dt_lock *sdtlck = *sdtlock, *ddtlck = *ddtlock;
 	struct lv *slv, *dlv;
diff --git a/fs/jfs/jfs_extent.c b/fs/jfs/jfs_extent.c
index 399572237..2b411bc32 100644
--- a/fs/jfs/jfs_extent.c
+++ b/fs/jfs/jfs_extent.c
@@ -533,7 +533,7 @@ extBalloc(struct inode *ip, s64 hint, s64 * nblocks, s64 * blkno)
 		nb = nblks = *nblocks;
 
 	/* try to allocate blocks */
-	while ((rc = dbAlloc(ip, hint, nb, &daddr))) {
+	while ((rc = dbAlloc(ip, hint, nb, &daddr)) != 0) {
 		/* if something other than an out of space error,
 		 * stop and return this error.
 		 */
@@ -553,6 +553,7 @@ extBalloc(struct inode *ip, s64 hint, s64 * nblocks, s64 * blkno)
 
 	if (S_ISREG(ip->i_mode) && (ji->fileset == FILESYSTEM_I)) {
 		ag = BLKTOAG(daddr, sbi);
+		spin_lock_irq(&ji->ag_lock);
 		if (ji->active_ag == -1) {
 			atomic_inc(&bmp->db_active[ag]);
 			ji->active_ag = ag;
@@ -561,6 +562,7 @@ extBalloc(struct inode *ip, s64 hint, s64 * nblocks, s64 * blkno)
 			atomic_inc(&bmp->db_active[ag]);
 			ji->active_ag = ag;
 		}
+		spin_unlock_irq(&ji->ag_lock);
 	}
 
 	return (0);
diff --git a/fs/jfs/jfs_imap.c b/fs/jfs/jfs_imap.c
index 848fbc8ba..6a6f147e8 100644
--- a/fs/jfs/jfs_imap.c
+++ b/fs/jfs/jfs_imap.c
@@ -1281,6 +1281,7 @@ int diFree(struct inode *ip)
 	 * to be freed by the transaction;  
 	 */
 	tid = txBegin(ipimap->i_sb, COMMIT_FORCE);
+	down(&JFS_IP(ipimap)->commit_sem);
 
 	/* acquire tlock of the iag page of the freed ixad 
 	 * to force the page NOHOMEOK (even though no data is
@@ -1313,6 +1314,7 @@ int diFree(struct inode *ip)
 	rc = txCommit(tid, 1, &iplist[0], COMMIT_FORCE);
 
 	txEnd(tid);
+	up(&JFS_IP(ipimap)->commit_sem);
 
 	/* unlock the AG inode map information */
 	AG_UNLOCK(imap, agno);
@@ -2062,7 +2064,7 @@ static int diAllocBit(struct inomap * imap, struct iag * iagp, int ino)
 {
 	int extno, bitno, agno, sword, rc;
 	struct metapage *amp = NULL, *bmp = NULL;
-	struct iag *aiagp = 0, *biagp = 0;
+	struct iag *aiagp = NULL, *biagp = NULL;
 	u32 mask;
 
 	/* check if this is the last free inode within the iag.
@@ -2208,7 +2210,7 @@ static int diAllocBit(struct inomap * imap, struct iag * iagp, int ino)
 static int diNewExt(struct inomap * imap, struct iag * iagp, int extno)
 {
 	int agno, iagno, fwd, back, freei = 0, sword, rc;
-	struct iag *aiagp = 0, *biagp = 0, *ciagp = 0;
+	struct iag *aiagp = NULL, *biagp = NULL, *ciagp = NULL;
 	struct metapage *amp, *bmp, *cmp, *dmp;
 	struct inode *ipimap;
 	s64 blkno, hint;
@@ -2623,10 +2625,13 @@ diNewIAG(struct inomap * imap, int *iagnop, int agno, struct metapage ** mpp)
 		 */
 #endif				/*  _STILL_TO_PORT */
 		tid = txBegin(sb, COMMIT_FORCE);
+		down(&JFS_IP(ipimap)->commit_sem);
 
 		/* update the inode map addressing structure to point to it */
 		if ((rc =
 		     xtInsert(tid, ipimap, 0, blkno, xlen, &xaddr, 0))) {
+			txEnd(tid);
+			up(&JFS_IP(ipimap)->commit_sem);
 			/* Free the blocks allocated for the iag since it was
 			 * not successfully added to the inode map
 			 */
@@ -2651,6 +2656,7 @@ diNewIAG(struct inomap * imap, int *iagnop, int agno, struct metapage ** mpp)
 		rc = txCommit(tid, 1, &iplist[0], COMMIT_FORCE);
 
 		txEnd(tid);
+		up(&JFS_IP(ipimap)->commit_sem);
 
 		duplicateIXtree(sb, blkno, xlen, &xaddr);
 
@@ -2911,7 +2917,7 @@ int diExtendFS(struct inode *ipimap, struct inode *ipbmap)
 {
 	int rc, rcx = 0;
 	struct inomap *imap = JFS_IP(ipimap)->i_imap;
-	struct iag *iagp = 0, *hiagp = 0;
+	struct iag *iagp = NULL, *hiagp = NULL;
 	struct bmap *mp = JFS_SBI(ipbmap->i_sb)->bmap;
 	struct metapage *bp, *hbp;
 	int i, n, head;
@@ -3110,9 +3116,9 @@ static int copy_from_dinode(struct dinode * dip, struct inode *ip)
 
 	uid = le32_to_cpu(dip->di_uid);
 	gid = le32_to_cpu(dip->di_gid);
-	ip->i_uid = INOXID_UID(uid, gid);
-	ip->i_gid = INOXID_GID(uid, gid);
-	ip->i_xid = INOXID_XID(uid, gid, 0);
+	ip->i_uid = INOXID_UID(XID_TAG(ip), uid, gid);
+	ip->i_gid = INOXID_GID(XID_TAG(ip), uid, gid);
+	ip->i_xid = INOXID_XID(XID_TAG(ip), uid, gid, 0);
 	
 	ip->i_size = le64_to_cpu(dip->di_size);
 	ip->i_atime.tv_sec = le32_to_cpu(dip->di_atime.tv_sec);
@@ -3175,8 +3181,8 @@ static void copy_to_dinode(struct dinode * dip, struct inode *ip)
 	dip->di_nblocks = cpu_to_le64(PBLK2LBLK(ip->i_sb, ip->i_blocks));
 	dip->di_nlink = cpu_to_le32(ip->i_nlink);
 
-	uid = XIDINO_UID(ip->i_uid, ip->i_xid);
-	gid = XIDINO_GID(ip->i_gid, ip->i_xid);
+	uid = XIDINO_UID(XID_TAG(ip), ip->i_uid, ip->i_xid);
+	gid = XIDINO_GID(XID_TAG(ip), ip->i_gid, ip->i_xid);
 	dip->di_uid = cpu_to_le32(uid);
 	dip->di_gid = cpu_to_le32(gid);
 	/*
diff --git a/fs/jfs/jfs_incore.h b/fs/jfs/jfs_incore.h
index ac608c9ff..5496bfb14 100644
--- a/fs/jfs/jfs_incore.h
+++ b/fs/jfs/jfs_incore.h
@@ -53,6 +53,7 @@ struct jfs_inode_info {
 	lid_t	blid;		/* lid of pseudo buffer?	*/
 	lid_t	atlhead;	/* anonymous tlock list head	*/
 	lid_t	atltail;	/* anonymous tlock list tail	*/
+	spinlock_t ag_lock;	/* protects active_ag		*/
 	struct list_head anon_inode_list; /* inodes having anonymous txns */
 	/*
 	 * rdwrlock serializes xtree between reads & writes and synchronizes
diff --git a/fs/jfs/jfs_logmgr.c b/fs/jfs/jfs_logmgr.c
index f4ce4609c..83dc99db1 100644
--- a/fs/jfs/jfs_logmgr.c
+++ b/fs/jfs/jfs_logmgr.c
@@ -2321,7 +2321,7 @@ int jfsIOWait(void *arg)
 		DECLARE_WAITQUEUE(wq, current);
 
 		spin_lock_irq(&log_redrive_lock);
-		while ((bp = log_redrive_list)) {
+		while ((bp = log_redrive_list) != 0) {
 			log_redrive_list = bp->l_redrive_next;
 			bp->l_redrive_next = NULL;
 			spin_unlock_irq(&log_redrive_lock);
diff --git a/fs/jfs/jfs_metapage.c b/fs/jfs/jfs_metapage.c
index 8c94bb015..831ee09c2 100644
--- a/fs/jfs/jfs_metapage.c
+++ b/fs/jfs/jfs_metapage.c
@@ -225,8 +225,16 @@ struct metapage *__get_metapage(struct inode *inode, unsigned long lblock,
 
 	if (absolute)
 		mapping = inode->i_sb->s_bdev->bd_inode->i_mapping;
-	else
+	else {
+		/*
+		 * If an nfs client tries to read an inode that is larger
+		 * than any existing inodes, we may try to read past the
+		 * end of the inode map
+		 */
+		if ((lblock << inode->i_blkbits) >= inode->i_size)
+			return NULL;
 		mapping = inode->i_mapping;
+	}
 
 	hash_ptr = meta_hash(mapping, lblock);
 again:
@@ -320,7 +328,7 @@ again:
 		atomic_set(&mp->nohomeok,0);
 		mp->mapping = mapping;
 		mp->index = lblock;
-		mp->page = 0;
+		mp->page = NULL;
 		mp->logical_size = size;
 		add_to_hash(mp, hash_ptr);
 		spin_unlock(&meta_lock);
@@ -465,7 +473,7 @@ void release_metapage(struct metapage * mp)
 		set_bit(META_stale, &mp->flag);
 		spin_unlock(&meta_lock);
 		kunmap(mp->page);
-		mp->data = 0;
+		mp->data = NULL;
 		if (test_bit(META_dirty, &mp->flag))
 			__write_metapage(mp);
 		if (test_bit(META_sync, &mp->flag)) {
@@ -491,7 +499,7 @@ void release_metapage(struct metapage * mp)
 		 */
 		log = mp->log;
 		LOGSYNC_LOCK(log);
-		mp->log = 0;
+		mp->log = NULL;
 		mp->lsn = 0;
 		mp->clsn = 0;
 		log->count--;
diff --git a/fs/jfs/jfs_mount.c b/fs/jfs/jfs_mount.c
index 3de7db13d..fad757e9e 100644
--- a/fs/jfs/jfs_mount.c
+++ b/fs/jfs/jfs_mount.c
@@ -166,7 +166,7 @@ int jfs_mount(struct super_block *sb)
 		}
 	} else
 		/* Secondary aggregate inode table is not valid */
-		sbi->ipaimap2 = 0;
+		sbi->ipaimap2 = NULL;
 
 	/*
 	 *      mount (the only/single) fileset
diff --git a/fs/jfs/jfs_txnmgr.c b/fs/jfs/jfs_txnmgr.c
index f48fdeae5..f4bd79b70 100644
--- a/fs/jfs/jfs_txnmgr.c
+++ b/fs/jfs/jfs_txnmgr.c
@@ -330,9 +330,9 @@ int txInit(void)
 void txExit(void)
 {
 	vfree(TxLock);
-	TxLock = 0;
+	TxLock = NULL;
 	vfree(TxBlock);
-	TxBlock = 0;
+	TxBlock = NULL;
 }
 
 
@@ -1554,7 +1554,7 @@ static int dataLog(struct jfs_log * log, struct tblock * tblk, struct lrd * lrd,
 		hold_metapage(mp, 0);
 		atomic_dec(&mp->nohomeok);
 		discard_metapage(mp);
-		tlck->mp = 0;
+		tlck->mp = NULL;
 		return 0;
 	}
 
@@ -2270,7 +2270,7 @@ static void txUpdateMap(struct tblock * tblk)
 	struct pxd_lock pxdlock;
 	int maptype;
 	int k, nlock;
-	struct metapage *mp = 0;
+	struct metapage *mp = NULL;
 
 	ipimap = JFS_SBI(tblk->sb)->ipimap;
 
@@ -2358,7 +2358,7 @@ static void txUpdateMap(struct tblock * tblk)
 			assert(atomic_read(&mp->nohomeok) == 1);
 			atomic_dec(&mp->nohomeok);
 			discard_metapage(mp);
-			tlck->mp = 0;
+			tlck->mp = NULL;
 		}
 	}
 	/*
@@ -2580,7 +2580,7 @@ void txFreelock(struct inode *ip)
 	TXN_LOCK();
 	xtlck = (struct tlock *) &jfs_ip->atlhead;
 
-	while ((lid = xtlck->next)) {
+	while ((lid = xtlck->next) != 0) {
 		tlck = lid_to_tlock(lid);
 		if (tlck->flag & tlckFREELOCK) {
 			xtlck->next = tlck->next;
diff --git a/fs/jfs/jfs_uniupr.c b/fs/jfs/jfs_uniupr.c
index af63d97bb..4ab185d26 100644
--- a/fs/jfs/jfs_uniupr.c
+++ b/fs/jfs/jfs_uniupr.c
@@ -130,5 +130,5 @@ UNICASERANGE UniUpperRange[] = {
     { 0x0490,  0x04cc,  UniCaseRangeU0490 },
     { 0x1e00,  0x1ffc,  UniCaseRangeU1e00 },
     { 0xff40,  0xff5a,  UniCaseRangeUff40 },
-    { 0, 0, 0 }
+    { 0 }
 };
diff --git a/fs/jfs/jfs_xtree.c b/fs/jfs/jfs_xtree.c
index fab2bbcfe..19913fcd4 100644
--- a/fs/jfs/jfs_xtree.c
+++ b/fs/jfs/jfs_xtree.c
@@ -1071,8 +1071,10 @@ xtSplitUp(tid_t tid,
 		 */
 		/* get/pin the parent page <sp> */
 		XT_GETPAGE(ip, parent->bn, smp, PSIZE, sp, rc);
-		if (rc)
-			goto errout2;
+		if (rc) {
+			XT_PUTPAGE(rcmp);
+			return rc;
+		}
 
 		/*
 		 * The new key entry goes ONE AFTER the index of parent entry,
@@ -1106,8 +1108,10 @@ xtSplitUp(tid_t tid,
 			rc = (sp->header.flag & BT_ROOT) ?
 			    xtSplitRoot(tid, ip, split, &rmp) :
 			    xtSplitPage(tid, ip, split, &rmp, &rbn);
-			if (rc)
-				goto errout1;
+			if (rc) {
+				XT_PUTPAGE(smp);
+				return rc;
+			}
 
 			XT_PUTPAGE(smp);
 			/* keep new child page <rp> pinned */
@@ -1170,19 +1174,6 @@ xtSplitUp(tid_t tid,
 	XT_PUTPAGE(rmp);
 
 	return 0;
-
-	/*
-	 * If something fails in the above loop we were already walking back
-	 * up the tree and the tree is now inconsistent.
-	 * release all pages we're holding.
-	 */
-      errout1:
-	XT_PUTPAGE(smp);
-
-      errout2:
-	XT_PUTPAGE(rcmp);
-
-	return rc;
 }
 
 
@@ -1222,7 +1213,7 @@ xtSplitPage(tid_t tid, struct inode *ip,
 	struct pxdlist *pxdlist;
 	pxd_t *pxd;
 	struct tlock *tlck;
-	struct xtlock *sxtlck = 0, *rxtlck = 0;
+	struct xtlock *sxtlck = NULL, *rxtlck = NULL;
 
 	smp = split->mp;
 	sp = XT_PAGE(ip, smp);
@@ -1603,7 +1594,7 @@ int xtExtend(tid_t tid,		/* transaction id */
 	xad_t *xad;
 	s64 xaddr;
 	struct tlock *tlck;
-	struct xtlock *xtlck = 0;
+	struct xtlock *xtlck = NULL;
 	int rootsplit = 0;
 
 	jfs_info("xtExtend: nxoff:0x%lx nxlen:0x%x", (ulong) xoff, xlen);
@@ -1957,7 +1948,7 @@ int xtUpdate(tid_t tid, struct inode *ip, xad_t * nxad)
 	int nxlen, xlen, lxlen, rxlen;
 	s64 nxaddr, xaddr;
 	struct tlock *tlck;
-	struct xtlock *xtlck = 0;
+	struct xtlock *xtlck = NULL;
 	int rootsplit = 0, newpage = 0;
 
 	/* there must exist extent to be tailgated */
@@ -3416,9 +3407,9 @@ s64 xtTruncate(tid_t tid, struct inode *ip, s64 newsize, int flag)
 	int xlen, len, freexlen;
 	struct btstack btstack;
 	struct btframe *parent;
-	struct tblock *tblk = 0;
-	struct tlock *tlck = 0;
-	struct xtlock *xtlck = 0;
+	struct tblock *tblk = NULL;
+	struct tlock *tlck = NULL;
+	struct xtlock *xtlck = NULL;
 	struct xdlistlock xadlock;	/* maplock for COMMIT_WMAP */
 	struct pxd_lock *pxdlock;		/* maplock for COMMIT_WMAP */
 	s64 nfreed;
@@ -3504,7 +3495,17 @@ s64 xtTruncate(tid_t tid, struct inode *ip, s64 newsize, int flag)
 	 * a page that was formerly to the right, let's make sure that the
 	 * next pointer is zero.
 	 */
-	p->header.next = 0;
+	if (p->header.next) {
+		if (log)
+			/*
+			 * Make sure this change to the header is logged.
+			 * If we really truncate this leaf, the flag
+			 * will be changed to tlckTRUNCATE
+			 */
+			tlck = txLock(tid, ip, mp, tlckXTREE|tlckGROW);
+		BT_MARK_DIRTY(mp, ip);
+		p->header.next = 0;
+	}
 
 	freed = 0;
 
@@ -3614,7 +3615,7 @@ s64 xtTruncate(tid_t tid, struct inode *ip, s64 newsize, int flag)
 				pxdlock->flag = mlckFREEPXD;
 				PXDaddress(&pxdlock->pxd, xaddr);
 				PXDlength(&pxdlock->pxd, freexlen);
-				txFreeMap(ip, pxdlock, 0, COMMIT_WMAP);
+				txFreeMap(ip, pxdlock, NULL, COMMIT_WMAP);
 
 				/* reset map lock */
 				xadlock.flag = mlckFREEXADLIST;
@@ -3642,8 +3643,8 @@ s64 xtTruncate(tid_t tid, struct inode *ip, s64 newsize, int flag)
 				xadlock.count =
 				    le16_to_cpu(p->header.nextindex) -
 				    nextindex;
-				txFreeMap(ip, (struct maplock *) & xadlock, 0,
-					  COMMIT_WMAP);
+				txFreeMap(ip, (struct maplock *) & xadlock,
+					  NULL, COMMIT_WMAP);
 			}
 			p->header.nextindex = cpu_to_le16(nextindex);
 		}
@@ -3672,7 +3673,7 @@ s64 xtTruncate(tid_t tid, struct inode *ip, s64 newsize, int flag)
 		xadlock.xdlist = &p->xad[XTENTRYSTART];
 		xadlock.count =
 		    le16_to_cpu(p->header.nextindex) - XTENTRYSTART;
-		txFreeMap(ip, (struct maplock *) & xadlock, 0, COMMIT_WMAP);
+		txFreeMap(ip, (struct maplock *) & xadlock, NULL, COMMIT_WMAP);
 	}
 
 	if (p->header.flag & BT_ROOT) {
@@ -3747,8 +3748,8 @@ s64 xtTruncate(tid_t tid, struct inode *ip, s64 newsize, int flag)
 				xadlock.count =
 				    le16_to_cpu(p->header.nextindex) -
 				    index - 1;
-				txFreeMap(ip, (struct maplock *) & xadlock, 0,
-					  COMMIT_WMAP);
+				txFreeMap(ip, (struct maplock *) & xadlock,
+					  NULL, COMMIT_WMAP);
 			}
 			BT_MARK_DIRTY(mp, ip);
 
@@ -3819,7 +3820,7 @@ s64 xtTruncate(tid_t tid, struct inode *ip, s64 newsize, int flag)
 			xadlock.count =
 			    le16_to_cpu(p->header.nextindex) -
 			    XTENTRYSTART;
-			txFreeMap(ip, (struct maplock *) & xadlock, 0,
+			txFreeMap(ip, (struct maplock *) & xadlock, NULL,
 				  COMMIT_WMAP);
 		}
 		BT_MARK_DIRTY(mp, ip);
@@ -3956,11 +3957,11 @@ s64 xtTruncate_pmap(tid_t tid, struct inode *ip, s64 committed_size)
 	struct btframe *parent;
 	int rc;
 	struct tblock *tblk;
-	struct tlock *tlck = 0;
+	struct tlock *tlck = NULL;
 	xad_t *xad;
 	int xlen;
 	s64 xoff;
-	struct xtlock *xtlck = 0;
+	struct xtlock *xtlck = NULL;
 
 	/* save object truncation type */
 	tblk = tid_to_tblock(tid);
diff --git a/fs/jfs/namei.c b/fs/jfs/namei.c
index 998410ccc..8c3a8e78d 100644
--- a/fs/jfs/namei.c
+++ b/fs/jfs/namei.c
@@ -1,5 +1,5 @@
 /*
- *   Copyright (C) International Business Machines Corp., 2000-2003
+ *   Copyright (C) International Business Machines Corp., 2000-2004
  *   Portions Copyright (C) Christoph Hellwig, 2001-2002
  *
  *   This program is free software;  you can redistribute it and/or modify
@@ -18,6 +18,7 @@
  */
 
 #include <linux/fs.h>
+#include <linux/ctype.h>
 #include "jfs_incore.h"
 #include "jfs_superblock.h"
 #include "jfs_inode.h"
@@ -43,6 +44,7 @@ extern int jfs_init_acl(struct inode *, struct inode *);
  */
 struct inode_operations jfs_dir_inode_operations;
 struct file_operations jfs_dir_operations;
+struct dentry_operations jfs_ci_dentry_operations;
 
 static s64 commitZeroLink(tid_t, struct inode *);
 
@@ -702,7 +704,7 @@ int freeZeroLink(struct inode *ip)
 		pxdlock->flag = mlckFREEPXD;
 		PXDaddress(&pxdlock->pxd, xaddr);
 		PXDlength(&pxdlock->pxd, xlen);
-		txFreeMap(ip, pxdlock, 0, COMMIT_WMAP);
+		txFreeMap(ip, pxdlock, NULL, COMMIT_WMAP);
 	}
 
 	/*
@@ -722,7 +724,7 @@ int freeZeroLink(struct inode *ip)
 		pxdlock->flag = mlckFREEPXD;
 		PXDaddress(&pxdlock->pxd, xaddr);
 		PXDlength(&pxdlock->pxd, xlen);
-		txFreeMap(ip, pxdlock, 0, COMMIT_WMAP);
+		txFreeMap(ip, pxdlock, NULL, COMMIT_WMAP);
 	}
 
 	/*
@@ -1422,7 +1424,15 @@ static struct dentry *jfs_lookup(struct inode *dip, struct dentry *dentry, struc
 		return ERR_PTR(-EACCES);
 	}
 
-	return d_splice_alias(ip, dentry);
+	if (JFS_SBI(dip->i_sb)->mntflag & JFS_OS2)
+		dentry->d_op = &jfs_ci_dentry_operations;
+
+	dentry = d_splice_alias(ip, dentry);
+
+	if (dentry && (JFS_SBI(dip->i_sb)->mntflag & JFS_OS2))
+		dentry->d_op = &jfs_ci_dentry_operations;
+
+	return dentry;
 }
 
 struct dentry *jfs_get_parent(struct dentry *dentry)
@@ -1476,3 +1486,46 @@ struct file_operations jfs_dir_operations = {
 	.readdir	= jfs_readdir,
 	.fsync		= jfs_fsync,
 };
+
+static int jfs_ci_hash(struct dentry *dir, struct qstr *this)
+{
+	unsigned long hash;
+	int i;
+
+	hash = init_name_hash();
+	for (i=0; i < this->len; i++)
+		hash = partial_name_hash(tolower(this->name[i]), hash);
+	this->hash = end_name_hash(hash);
+
+	return 0;
+}
+
+static int jfs_ci_compare(struct dentry *dir, struct qstr *a, struct qstr *b)
+{
+	int i, result = 1;
+
+	if (a->len != b->len)
+		goto out;
+	for (i=0; i < a->len; i++) {
+		if (tolower(a->name[i]) != tolower(b->name[i]))
+			goto out;
+	}
+	result = 0;
+
+	/*
+	 * We want creates to preserve case.  A negative dentry, a, that
+	 * has a different case than b may cause a new entry to be created
+	 * with the wrong case.  Since we can't tell if a comes from a negative
+	 * dentry, we blindly replace it with b.  This should be harmless if
+	 * a is not a negative dentry.
+	 */
+	memcpy((unsigned char *)a->name, b->name, a->len);
+out:
+	return result;
+}
+
+struct dentry_operations jfs_ci_dentry_operations =
+{
+	.d_hash = jfs_ci_hash,
+	.d_compare = jfs_ci_compare,
+};
diff --git a/fs/jfs/super.c b/fs/jfs/super.c
index d359c2619..9615a83d7 100644
--- a/fs/jfs/super.c
+++ b/fs/jfs/super.c
@@ -82,6 +82,8 @@ extern void jfs_write_inode(struct inode *inode, int wait);
 extern struct dentry *jfs_get_parent(struct dentry *dentry);
 extern int jfs_extendfs(struct super_block *, s64, int);
 
+extern struct dentry_operations jfs_ci_dentry_operations;
+
 #ifdef PROC_FS_JFS		/* see jfs_debug.h */
 extern void jfs_proc_init(void);
 extern void jfs_proc_clean(void);
@@ -141,10 +143,13 @@ static void jfs_destroy_inode(struct inode *inode)
 {
 	struct jfs_inode_info *ji = JFS_IP(inode);
 
+	spin_lock_irq(&ji->ag_lock);
 	if (ji->active_ag != -1) {
 		struct bmap *bmap = JFS_SBI(inode->i_sb)->bmap;
 		atomic_dec(&bmap->db_active[ji->active_ag]);
+		ji->active_ag = -1;
 	}
+	spin_unlock_irq(&ji->ag_lock);
 
 #ifdef CONFIG_JFS_POSIX_ACL
 	if (ji->i_acl != JFS_ACL_NOT_CACHED) {
@@ -422,7 +427,7 @@ static int jfs_fill_super(struct super_block *sb, void *data, int silent)
 		goto out_kfree;
 	}
 	if (sb->s_flags & MS_RDONLY)
-		sbi->log = 0;
+		sbi->log = NULL;
 	else {
 		rc = jfs_mount_rw(sb, 0);
 		if (rc) {
@@ -443,6 +448,9 @@ static int jfs_fill_super(struct super_block *sb, void *data, int silent)
 	if (!sb->s_root)
 		goto out_no_root;
 
+	if (sbi->mntflag & JFS_OS2)
+		sb->s_root->d_op = &jfs_ci_dentry_operations;
+
 	/* logical blocks are represented by 40 bits in pxd_t, etc. */
 	sb->s_maxbytes = ((u64) sb->s_blocksize) << 40;
 #if BITS_PER_LONG == 32
@@ -559,6 +567,7 @@ static void init_once(void *foo, kmem_cache_t * cachep, unsigned long flags)
 		init_rwsem(&jfs_ip->rdwrlock);
 		init_MUTEX(&jfs_ip->commit_sem);
 		init_rwsem(&jfs_ip->xattr_sem);
+		spin_lock_init(&jfs_ip->ag_lock);
 		jfs_ip->active_ag = -1;
 #ifdef CONFIG_JFS_POSIX_ACL
 		jfs_ip->i_acl = JFS_ACL_NOT_CACHED;
@@ -600,7 +609,7 @@ static int __init init_jfs_fs(void)
 	/*
 	 * I/O completion thread (endio)
 	 */
-	jfsIOthread = kernel_thread(jfsIOWait, 0, CLONE_KERNEL);
+	jfsIOthread = kernel_thread(jfsIOWait, NULL, CLONE_KERNEL);
 	if (jfsIOthread < 0) {
 		jfs_err("init_jfs_fs: fork failed w/rc = %d", jfsIOthread);
 		goto end_txmngr;
@@ -613,7 +622,7 @@ static int __init init_jfs_fs(void)
 		commit_threads = MAX_COMMIT_THREADS;
 
 	for (i = 0; i < commit_threads; i++) {
-		jfsCommitThread[i] = kernel_thread(jfs_lazycommit, 0,
+		jfsCommitThread[i] = kernel_thread(jfs_lazycommit, NULL,
 						   CLONE_KERNEL);
 		if (jfsCommitThread[i] < 0) {
 			jfs_err("init_jfs_fs: fork failed w/rc = %d",
@@ -625,7 +634,7 @@ static int __init init_jfs_fs(void)
 		wait_for_completion(&jfsIOwait);
 	}
 
-	jfsSyncThread = kernel_thread(jfs_sync, 0, CLONE_KERNEL);
+	jfsSyncThread = kernel_thread(jfs_sync, NULL, CLONE_KERNEL);
 	if (jfsSyncThread < 0) {
 		jfs_err("init_jfs_fs: fork failed w/rc = %d", jfsSyncThread);
 		goto kill_committask;
diff --git a/fs/jfs/symlink.c b/fs/jfs/symlink.c
index 6e028d912..ef4c07ee9 100644
--- a/fs/jfs/symlink.c
+++ b/fs/jfs/symlink.c
@@ -17,23 +17,19 @@
  */
 
 #include <linux/fs.h>
+#include <linux/namei.h>
 #include "jfs_incore.h"
 #include "jfs_xattr.h"
 
 static int jfs_follow_link(struct dentry *dentry, struct nameidata *nd)
 {
 	char *s = JFS_IP(dentry->d_inode)->i_inline;
-	return vfs_follow_link(nd, s);
-}
-
-static int jfs_readlink(struct dentry *dentry, char __user *buffer, int buflen)
-{
-	char *s = JFS_IP(dentry->d_inode)->i_inline;
-	return vfs_readlink(dentry, buffer, buflen, s);
+	nd_set_link(nd, s);
+	return 0;
 }
 
 struct inode_operations jfs_symlink_inode_operations = {
-	.readlink	= jfs_readlink,
+	.readlink	= generic_readlink,
 	.follow_link	= jfs_follow_link,
 	.setxattr	= jfs_setxattr,
 	.getxattr	= jfs_getxattr,
diff --git a/fs/jfs/xattr.c b/fs/jfs/xattr.c
index c786348cd..cf3fba6e5 100644
--- a/fs/jfs/xattr.c
+++ b/fs/jfs/xattr.c
@@ -592,7 +592,7 @@ static int ea_put(struct inode *inode, struct ea_buffer *ea_buf, int new_size)
 
 	if (new_size == 0) {
 		ea_release(inode, ea_buf);
-		ea_buf = 0;
+		ea_buf = NULL;
 	} else if (ea_buf->flag & EA_INLINE) {
 		assert(new_size <= sizeof (ji->i_inline_ea));
 		ji->mode2 &= ~INLINEEA;
@@ -633,7 +633,7 @@ static int ea_put(struct inode *inode, struct ea_buffer *ea_buf, int new_size)
 		}
 		ji->ea = ea_buf->new_ea;
 	} else {
-		txEA(tid, inode, &ji->ea, 0);
+		txEA(tid, inode, &ji->ea, NULL);
 		if (ji->ea.flag & DXD_INLINE)
 			ji->mode2 |= INLINEEA;
 		ji->ea.flag = 0;
@@ -1039,5 +1039,5 @@ ssize_t jfs_listxattr(struct dentry * dentry, char *data, size_t buf_size)
 
 int jfs_removexattr(struct dentry *dentry, const char *name)
 {
-	return __jfs_setxattr(dentry->d_inode, name, 0, 0, XATTR_REPLACE);
+	return __jfs_setxattr(dentry->d_inode, name, NULL, 0, XATTR_REPLACE);
 }
diff --git a/fs/libfs.c b/fs/libfs.c
index dfe6ac5ac..205cfdbe2 100644
--- a/fs/libfs.c
+++ b/fs/libfs.c
@@ -7,6 +7,7 @@
 #include <linux/pagemap.h>
 #include <linux/mount.h>
 #include <linux/vfs.h>
+#include <asm/uaccess.h>
 
 int simple_getattr(struct vfsmount *mnt, struct dentry *dentry,
 		   struct kstat *stat)
@@ -439,6 +440,22 @@ void simple_release_fs(struct vfsmount **mount, int *count)
 	mntput(mnt);
 }
 
+ssize_t simple_read_from_buffer(void __user *to, size_t count, loff_t *ppos,
+				const void *from, size_t available)
+{
+	loff_t pos = *ppos;
+	if (pos < 0)
+		return -EINVAL;
+	if (pos >= available)
+		return 0;
+	if (count > available - pos)
+		count = available - pos;
+	if (copy_to_user(to, from + pos, count))
+		return -EFAULT;
+	*ppos = pos + count;
+	return count;
+}
+
 EXPORT_SYMBOL(dcache_dir_close);
 EXPORT_SYMBOL(dcache_dir_lseek);
 EXPORT_SYMBOL(dcache_dir_open);
@@ -461,3 +478,4 @@ EXPORT_SYMBOL(simple_rmdir);
 EXPORT_SYMBOL(simple_statfs);
 EXPORT_SYMBOL(simple_sync_file);
 EXPORT_SYMBOL(simple_unlink);
+EXPORT_SYMBOL(simple_read_from_buffer);
diff --git a/fs/lockd/host.c b/fs/lockd/host.c
index 67f6a5886..6bf6befe6 100644
--- a/fs/lockd/host.c
+++ b/fs/lockd/host.c
@@ -76,7 +76,7 @@ nlm_lookup_host(int server, struct sockaddr_in *sin,
 	if (time_after_eq(jiffies, next_gc))
 		nlm_gc_hosts();
 
-	for (hp = &nlm_hosts[hash]; (host = *hp); hp = &host->h_next) {
+	for (hp = &nlm_hosts[hash]; (host = *hp) != 0; hp = &host->h_next) {
 		if (host->h_proto != proto)
 			continue;
 		if (host->h_version != version)
@@ -145,7 +145,7 @@ nlm_find_client(void)
 	down(&nlm_host_sema);
 	for (hash = 0 ; hash < NLM_HOST_NRHASH; hash++) {
 		struct nlm_host *host, **hp;
-		for (hp = &nlm_hosts[hash]; (host = *hp) ; hp = &host->h_next) {
+		for (hp = &nlm_hosts[hash]; (host = *hp) != 0; hp = &host->h_next) {
 			if (host->h_server &&
 			    host->h_killed == 0) {
 				nlm_get_host(host);
diff --git a/fs/lockd/svclock.c b/fs/lockd/svclock.c
index d96319004..2addc9200 100644
--- a/fs/lockd/svclock.c
+++ b/fs/lockd/svclock.c
@@ -67,7 +67,7 @@ nlmsvc_insert_block(struct nlm_block *block, unsigned long when)
 		while ((b = *bp) && time_before_eq(b->b_when,when) && b->b_when != NLM_NEVER)
 			bp = &b->b_next;
 	} else
-		while ((b = *bp))
+		while ((b = *bp) != 0)
 			bp = &b->b_next;
 
 	block->b_queued = 1;
@@ -86,7 +86,7 @@ nlmsvc_remove_block(struct nlm_block *block)
 
 	if (!block->b_queued)
 		return 1;
-	for (bp = &nlm_blocked; (b = *bp); bp = &b->b_next) {
+	for (bp = &nlm_blocked; (b = *bp) != 0; bp = &b->b_next) {
 		if (b == block) {
 			*bp = block->b_next;
 			block->b_queued = 0;
@@ -111,7 +111,7 @@ nlmsvc_lookup_block(struct nlm_file *file, struct nlm_lock *lock, int remove)
 				file, lock->fl.fl_pid,
 				(long long)lock->fl.fl_start,
 				(long long)lock->fl.fl_end, lock->fl.fl_type);
-	for (head = &nlm_blocked; (block = *head); head = &block->b_next) {
+	for (head = &nlm_blocked; (block = *head) != 0; head = &block->b_next) {
 		fl = &block->b_call.a_args.lock.fl;
 		dprintk("lockd: check f=%p pd=%d %Ld-%Ld ty=%d cookie=%x\n",
 				block->b_file, fl->fl_pid,
@@ -468,7 +468,7 @@ nlmsvc_notify_blocked(struct file_lock *fl)
 	struct nlm_block	**bp, *block;
 
 	dprintk("lockd: VFS unblock notification for block %p\n", fl);
-	for (bp = &nlm_blocked; (block = *bp); bp = &block->b_next) {
+	for (bp = &nlm_blocked; (block = *bp) != 0; bp = &block->b_next) {
 		if (nlm_compare_locks(&block->b_call.a_args.lock.fl, fl)) {
 			nlmsvc_insert_block(block, 0);
 			svc_wake_up(block->b_daemon);
@@ -653,7 +653,7 @@ nlmsvc_retry_blocked(void)
 	dprintk("nlmsvc_retry_blocked(%p, when=%ld)\n",
 			nlm_blocked,
 			nlm_blocked? nlm_blocked->b_when : 0);
-	while ((block = nlm_blocked)) {
+	while ((block = nlm_blocked) != 0) {
 		if (block->b_when == NLM_NEVER)
 			break;
 	        if (time_after(block->b_when,jiffies))
diff --git a/fs/lockd/svcshare.c b/fs/lockd/svcshare.c
index ef24965f9..4943fb783 100644
--- a/fs/lockd/svcshare.c
+++ b/fs/lockd/svcshare.c
@@ -71,7 +71,7 @@ nlmsvc_unshare_file(struct nlm_host *host, struct nlm_file *file,
 	struct nlm_share	*share, **shpp;
 	struct xdr_netobj	*oh = &argp->lock.oh;
 
-	for (shpp = &file->f_shares; (share = *shpp); shpp = &share->s_next) {
+	for (shpp = &file->f_shares; (share = *shpp) != 0; shpp = &share->s_next) {
 		if (share->s_host == host && nlm_cmp_owner(share, oh)) {
 			*shpp = share->s_next;
 			kfree(share);
diff --git a/fs/lockd/xdr.c b/fs/lockd/xdr.c
index 5d4b339df..a76c496a5 100644
--- a/fs/lockd/xdr.c
+++ b/fs/lockd/xdr.c
@@ -190,7 +190,7 @@ nlm_encode_testres(u32 *p, struct nlm_res *resp)
 	s32		start, len;
 
 	if (!(p = nlm_encode_cookie(p, &resp->cookie)))
-		return 0;
+		return NULL;
 	*p++ = resp->status;
 
 	if (resp->status == nlm_lck_denied) {
@@ -201,7 +201,7 @@ nlm_encode_testres(u32 *p, struct nlm_res *resp)
 
 		/* Encode owner handle. */
 		if (!(p = xdr_encode_netobj(p, &resp->lock.oh)))
-			return 0;
+			return NULL;
 
 		start = loff_t_to_s32(fl->fl_start);
 		if (fl->fl_end == OFFSET_MAX)
diff --git a/fs/lockd/xdr4.c b/fs/lockd/xdr4.c
index 389aadcd9..10562d31f 100644
--- a/fs/lockd/xdr4.c
+++ b/fs/lockd/xdr4.c
@@ -191,7 +191,7 @@ nlm4_encode_testres(u32 *p, struct nlm_res *resp)
 
 	dprintk("xdr: before encode_testres (p %p resp %p)\n", p, resp);
 	if (!(p = nlm4_encode_cookie(p, &resp->cookie)))
-		return 0;
+		return NULL;
 	*p++ = resp->status;
 
 	if (resp->status == nlm_lck_denied) {
@@ -202,7 +202,7 @@ nlm4_encode_testres(u32 *p, struct nlm_res *resp)
 
 		/* Encode owner handle. */
 		if (!(p = xdr_encode_netobj(p, &resp->lock.oh)))
-			return 0;
+			return NULL;
 
 		start = loff_t_to_s64(fl->fl_start);
 		if (fl->fl_end == OFFSET_MAX)
diff --git a/fs/locks.c b/fs/locks.c
index fbd048304..0204acb9f 100644
--- a/fs/locks.c
+++ b/fs/locks.c
@@ -60,7 +60,7 @@
  *
  *  Initial implementation of mandatory locks. SunOS turned out to be
  *  a rotten model, so I implemented the "obvious" semantics.
- *  See 'linux/Documentation/mandatory.txt' for details.
+ *  See 'Documentation/mandatory.txt' for details.
  *  Andy Walker (andy@lysaker.kvaerner.no), April 06, 1996.
  *
  *  Don't allow mandatory locks on mmap()'ed files. Added simple functions to
@@ -177,7 +177,7 @@ void locks_init_lock(struct file_lock *fl)
 	init_waitqueue_head(&fl->fl_wait);
 	fl->fl_next = NULL;
 	fl->fl_fasync = NULL;
-	fl->fl_owner = 0;
+	fl->fl_owner = NULL;
 	fl->fl_pid = 0;
 	fl->fl_file = NULL;
 	fl->fl_flags = 0;
diff --git a/fs/minix/inode.c b/fs/minix/inode.c
index 11dab7f1a..9295de94d 100644
--- a/fs/minix/inode.c
+++ b/fs/minix/inode.c
@@ -343,8 +343,9 @@ static struct address_space_operations minix_aops = {
 };
 
 static struct inode_operations minix_symlink_inode_operations = {
-	.readlink	= page_readlink,
-	.follow_link	= page_follow_link,
+	.readlink	= generic_readlink,
+	.follow_link	= page_follow_link_light,
+	.put_link	= page_put_link,
 	.getattr	= minix_getattr,
 };
 
@@ -452,7 +453,7 @@ static struct buffer_head * V1_minix_update_inode(struct inode * inode)
 
 	raw_inode = minix_V1_raw_inode(inode->i_sb, inode->i_ino, &bh);
 	if (!raw_inode)
-		return 0;
+		return NULL;
 	raw_inode->i_mode = inode->i_mode;
 	raw_inode->i_uid = fs_high2lowuid(inode->i_uid);
 	raw_inode->i_gid = fs_high2lowgid(inode->i_gid);
@@ -479,7 +480,7 @@ static struct buffer_head * V2_minix_update_inode(struct inode * inode)
 
 	raw_inode = minix_V2_raw_inode(inode->i_sb, inode->i_ino, &bh);
 	if (!raw_inode)
-		return 0;
+		return NULL;
 	raw_inode->i_mode = inode->i_mode;
 	raw_inode->i_uid = fs_high2lowuid(inode->i_uid);
 	raw_inode->i_gid = fs_high2lowgid(inode->i_gid);
diff --git a/fs/mpage.c b/fs/mpage.c
index a22fc8f0b..71c7ca3a4 100644
--- a/fs/mpage.c
+++ b/fs/mpage.c
@@ -404,6 +404,7 @@ mpage_writepage(struct bio *bio, struct page *page, get_block_t get_block,
 	struct block_device *boundary_bdev = NULL;
 	int length;
 	struct buffer_head map_bh;
+	loff_t i_size = i_size_read(inode);
 
 	if (page_has_buffers(page)) {
 		struct buffer_head *head = page_buffers(page);
@@ -460,7 +461,7 @@ mpage_writepage(struct bio *bio, struct page *page, get_block_t get_block,
 	 */
 	BUG_ON(!PageUptodate(page));
 	block_in_file = page->index << (PAGE_CACHE_SHIFT - blkbits);
-	last_block = (i_size_read(inode) - 1) >> blkbits;
+	last_block = (i_size - 1) >> blkbits;
 	map_bh.b_page = page;
 	for (page_block = 0; page_block < blocks_per_page; ) {
 
@@ -489,9 +490,18 @@ mpage_writepage(struct bio *bio, struct page *page, get_block_t get_block,
 
 	first_unmapped = page_block;
 
-	end_index = i_size_read(inode) >> PAGE_CACHE_SHIFT;
+page_is_mapped:
+	end_index = i_size >> PAGE_CACHE_SHIFT;
 	if (page->index >= end_index) {
-		unsigned offset = i_size_read(inode) & (PAGE_CACHE_SIZE - 1);
+		/*
+		 * The page straddles i_size.  It must be zeroed out on each
+		 * and every writepage invokation because it may be mmapped.
+		 * "A file is mapped in multiples of the page size.  For a file
+		 * that is not a multiple of the page size, the remaining memory
+		 * is zeroed when mapped, and writes to that region are not
+		 * written out to the file."
+		 */
+		unsigned offset = i_size & (PAGE_CACHE_SIZE - 1);
 		char *kaddr;
 
 		if (page->index > end_index || !offset)
@@ -502,8 +512,6 @@ mpage_writepage(struct bio *bio, struct page *page, get_block_t get_block,
 		kunmap_atomic(kaddr, KM_USER0);
 	}
 
-page_is_mapped:
-
 	/*
 	 * This page will go to BIO.  Do we need to send this BIO off first?
 	 */
@@ -518,6 +526,17 @@ alloc_new:
 			goto confused;
 	}
 
+	/*
+	 * Must try to add the page before marking the buffer clean or
+	 * the confused fail path above (OOM) will be very confused when
+	 * it finds all bh marked clean (i.e. it will not write anything)
+	 */
+	length = first_unmapped << blkbits;
+	if (bio_add_page(bio, page, length, 0) < length) {
+		bio = mpage_bio_submit(WRITE, bio);
+		goto alloc_new;
+	}
+
 	/*
 	 * OK, we have our BIO, so we can now mark the buffers clean.  Make
 	 * sure to only clean buffers which we know we'll be writing.
@@ -534,16 +553,15 @@ alloc_new:
 			bh = bh->b_this_page;
 		} while (bh != head);
 
-		if (buffer_heads_over_limit)
+		/*
+		 * we cannot drop the bh if the page is not uptodate
+		 * or a concurrent readpage would fail to serialize with the bh
+		 * and it would read from disk before we reach the platter.
+		 */
+		if (buffer_heads_over_limit && PageUptodate(page))
 			try_to_free_buffers(page);
 	}
 
-	length = first_unmapped << blkbits;
-	if (bio_add_page(bio, page, length, 0) < length) {
-		bio = mpage_bio_submit(WRITE, bio);
-		goto alloc_new;
-	}
-
 	BUG_ON(PageWriteback(page));
 	set_page_writeback(page);
 	unlock_page(page);
diff --git a/fs/namei.c b/fs/namei.c
index 763e95840..8a1943d4f 100644
--- a/fs/namei.c
+++ b/fs/namei.c
@@ -165,9 +165,6 @@ int vfs_permission(struct inode * inode, int mask)
 {
 	umode_t			mode = inode->i_mode;
 
-	if (IS_BARRIER(inode) && !vx_check(0, VX_ADMIN|VX_WATCH))
-		return -EACCES;
-
 	if (mask & MAY_WRITE) {
 		/*
 		 * Nobody gets write access to a read-only fs.
@@ -213,12 +210,17 @@ int vfs_permission(struct inode * inode, int mask)
 	return -EACCES;
 }
 
-static inline int xid_permission(struct inode *inode)
+static inline int xid_permission(struct inode *inode, int mask, struct nameidata *nd)
 {
 	if (inode->i_xid == 0)
 		return 0;
 	if (vx_check(inode->i_xid, VX_ADMIN|VX_WATCH|VX_IDENT))
 		return 0;
+/*
+	printk("VSW: xid=%d denied access to %p[#%d,%lu] »%*s«.\n",
+		vx_current_xid(), inode, inode->i_xid, inode->i_ino,
+		nd->dentry->d_name.len, nd->dentry->d_name.name);
+*/
 	return -EACCES;
 }
 
@@ -230,7 +232,7 @@ int permission(struct inode * inode,int mask, struct nameidata *nd)
 	/* Ordinary permission routines do not understand MAY_APPEND. */
 	submask = mask & ~MAY_APPEND;
 
-	if ((retval = xid_permission(inode)))
+	if ((retval = xid_permission(inode, mask, nd)))
 		return retval;
 	if (inode->i_op && inode->i_op->permission)
 		retval = inode->i_op->permission(inode, submask, nd);
@@ -294,6 +296,16 @@ void path_release(struct nameidata *nd)
 	mntput(nd->mnt);
 }
 
+/*
+ * umount() mustn't call path_release()/mntput() as that would clear
+ * mnt_expiry_mark
+ */
+void path_release_on_umount(struct nameidata *nd)
+{
+	dput(nd->dentry);
+	_mntput(nd->mnt);
+}
+
 /*
  * Internal lookup() using the new generic dcache.
  * SMP-safe
@@ -332,7 +344,7 @@ static inline int exec_permission_lite(struct inode *inode,
 {
 	umode_t	mode = inode->i_mode;
 
-	if ((inode->i_op && inode->i_op->permission))
+	if (inode->i_op && inode->i_op->permission)
 		return -EAGAIN;
 
 	if (current->fsuid == inode->i_uid)
@@ -346,6 +358,9 @@ static inline int exec_permission_lite(struct inode *inode,
 	if ((inode->i_mode & S_IXUGO) && capable(CAP_DAC_OVERRIDE))
 		goto ok;
 
+	if (S_ISDIR(inode->i_mode) && capable(CAP_DAC_OVERRIDE))
+		goto ok;
+
 	if (S_ISDIR(inode->i_mode) && capable(CAP_DAC_READ_SEARCH))
 		goto ok;
 
@@ -411,6 +426,62 @@ static struct dentry * real_lookup(struct dentry * parent, struct qstr * name, s
 	return result;
 }
 
+static int __emul_lookup_dentry(const char *, struct nameidata *);
+
+/* SMP-safe */
+static inline int
+walk_init_root(const char *name, struct nameidata *nd)
+{
+	read_lock(&current->fs->lock);
+	if (current->fs->altroot && !(nd->flags & LOOKUP_NOALT)) {
+		nd->mnt = mntget(current->fs->altrootmnt);
+		nd->dentry = dget(current->fs->altroot);
+		read_unlock(&current->fs->lock);
+		if (__emul_lookup_dentry(name,nd))
+			return 0;
+		read_lock(&current->fs->lock);
+	}
+	nd->mnt = mntget(current->fs->rootmnt);
+	nd->dentry = dget(current->fs->root);
+	read_unlock(&current->fs->lock);
+	return 1;
+}
+
+static inline int __vfs_follow_link(struct nameidata *nd, const char *link)
+{
+	int res = 0;
+	char *name;
+	if (IS_ERR(link))
+		goto fail;
+
+	if (*link == '/') {
+		path_release(nd);
+		if (!walk_init_root(link, nd))
+			/* weird __emul_prefix() stuff did it */
+			goto out;
+	}
+	res = link_path_walk(link, nd);
+out:
+	if (nd->depth || res || nd->last_type!=LAST_NORM)
+		return res;
+	/*
+	 * If it is an iterative symlinks resolution in open_namei() we
+	 * have to copy the last component. And all that crap because of
+	 * bloody create() on broken symlinks. Furrfu...
+	 */
+	name = __getname();
+	if (unlikely(!name)) {
+		path_release(nd);
+		return -ENOMEM;
+	}
+	strcpy(name, nd->last.name);
+	nd->last.name = name;
+	return 0;
+fail:
+	path_release(nd);
+	return PTR_ERR(link);
+}
+
 /*
  * This limits recursive symlink follows to 8, while
  * limiting consecutive symlinks to 40.
@@ -421,19 +492,30 @@ static struct dentry * real_lookup(struct dentry * parent, struct qstr * name, s
 static inline int do_follow_link(struct dentry *dentry, struct nameidata *nd)
 {
 	int err = -ELOOP;
-	if (current->link_count >= 5)
+	if (current->link_count >= MAX_NESTED_LINKS)
 		goto loop;
 	if (current->total_link_count >= 40)
 		goto loop;
+	BUG_ON(nd->depth >= MAX_NESTED_LINKS);
 	cond_resched();
 	err = security_inode_follow_link(dentry, nd);
 	if (err)
 		goto loop;
 	current->link_count++;
 	current->total_link_count++;
+	nd->depth++;
 	touch_atime(nd->mnt, dentry);
+	nd_set_link(nd, NULL);
 	err = dentry->d_inode->i_op->follow_link(dentry, nd);
+	if (!err) {
+		char *s = nd_get_link(nd);
+		if (s)
+			err = __vfs_follow_link(nd, s);
+		if (dentry->d_inode->i_op->put_link)
+			dentry->d_inode->i_op->put_link(dentry, nd);
+	}
 	current->link_count--;
+	nd->depth--;
 	return err;
 loop:
 	path_release(nd);
@@ -603,7 +685,7 @@ int fastcall link_path_walk(const char * name, struct nameidata *nd)
 		goto return_reval;
 
 	inode = nd->dentry->d_inode;
-	if (current->link_count)
+	if (nd->depth)
 		lookup_flags = LOOKUP_FOLLOW;
 
 	/* At this point we know we have a real path component. */
@@ -811,6 +893,7 @@ static int __emul_lookup_dentry(const char *name, struct nameidata *nd)
 		 */
 		nd_root.last_type = LAST_ROOT;
 		nd_root.flags = nd->flags;
+		nd_root.depth = 0;
 		memcpy(&nd_root.intent, &nd->intent, sizeof(nd_root.intent));
 		read_lock(&current->fs->lock);
 		nd_root.mnt = mntget(current->fs->rootmnt);
@@ -858,31 +941,13 @@ set_it:
 	}
 }
 
-/* SMP-safe */
-static inline int
-walk_init_root(const char *name, struct nameidata *nd)
-{
-	read_lock(&current->fs->lock);
-	if (current->fs->altroot && !(nd->flags & LOOKUP_NOALT)) {
-		nd->mnt = mntget(current->fs->altrootmnt);
-		nd->dentry = dget(current->fs->altroot);
-		read_unlock(&current->fs->lock);
-		if (__emul_lookup_dentry(name,nd))
-			return 0;
-		read_lock(&current->fs->lock);
-	}
-	nd->mnt = mntget(current->fs->rootmnt);
-	nd->dentry = dget(current->fs->root);
-	read_unlock(&current->fs->lock);
-	return 1;
-}
-
 int fastcall path_lookup(const char *name, unsigned int flags, struct nameidata *nd)
 {
 	int retval;
 
 	nd->last_type = LAST_ROOT; /* if there are only slashes... */
 	nd->flags = flags;
+	nd->depth = 0;
 
 	read_lock(&current->fs->lock);
 	if (*name=='/') {
@@ -1222,6 +1287,11 @@ int may_open(struct nameidata *nd, int acc_mode, int flag)
 			return -EPERM;
 	}
 
+	/* O_NOATIME can only be set by the owner or superuser */
+	if (flag & O_NOATIME)
+		if (current->fsuid != inode->i_uid && !capable(CAP_FOWNER))
+			return -EPERM;
+
 	/*
 	 * Ensure there are no outstanding leases on the file.
 	 */
@@ -1396,7 +1466,15 @@ do_link:
 	if (error)
 		goto exit_dput;
 	touch_atime(nd->mnt, dentry);
+	nd_set_link(nd, NULL);
 	error = dentry->d_inode->i_op->follow_link(dentry, nd);
+	if (!error) {
+		char *s = nd_get_link(nd);
+		if (s)
+			error = __vfs_follow_link(nd, s);
+		if (dentry->d_inode->i_op->put_link)
+			dentry->d_inode->i_op->put_link(dentry, nd);
+	}
 	dput(dentry);
 	if (error)
 		return error;
@@ -2177,40 +2255,23 @@ out:
 	return len;
 }
 
-static inline int
-__vfs_follow_link(struct nameidata *nd, const char *link)
+/*
+ * A helper for ->readlink().  This should be used *ONLY* for symlinks that
+ * have ->follow_link() touching nd only in nd_set_link().  Using (or not
+ * using) it for any given inode is up to filesystem.
+ */
+int generic_readlink(struct dentry *dentry, char __user *buffer, int buflen)
 {
-	int res = 0;
-	char *name;
-	if (IS_ERR(link))
-		goto fail;
-
-	if (*link == '/') {
-		path_release(nd);
-		if (!walk_init_root(link, nd))
-			/* weird __emul_prefix() stuff did it */
-			goto out;
-	}
-	res = link_path_walk(link, nd);
-out:
-	if (current->link_count || res || nd->last_type!=LAST_NORM)
-		return res;
-	/*
-	 * If it is an iterative symlinks resolution in open_namei() we
-	 * have to copy the last component. And all that crap because of
-	 * bloody create() on broken symlinks. Furrfu...
-	 */
-	name = __getname();
-	if (unlikely(!name)) {
-		path_release(nd);
-		return -ENOMEM;
+	struct nameidata nd;
+	int res;
+	nd.depth = 0;
+	res = dentry->d_inode->i_op->follow_link(dentry, &nd);
+	if (!res) {
+		res = vfs_readlink(dentry, buffer, buflen, nd_get_link(&nd));
+		if (dentry->d_inode->i_op->put_link)
+			dentry->d_inode->i_op->put_link(dentry, &nd);
 	}
-	strcpy(name, nd->last.name);
-	nd->last.name = name;
-	return 0;
-fail:
-	path_release(nd);
-	return PTR_ERR(link);
+	return res;
 }
 
 int vfs_follow_link(struct nameidata *nd, const char *link)
@@ -2253,6 +2314,30 @@ int page_readlink(struct dentry *dentry, char __user *buffer, int buflen)
 	return res;
 }
 
+int page_follow_link_light(struct dentry *dentry, struct nameidata *nd)
+{
+	struct page *page;
+	char *s = page_getlink(dentry, &page);
+	if (!IS_ERR(s)) {
+		nd_set_link(nd, s);
+		s = NULL;
+	}
+	return PTR_ERR(s);
+}
+
+void page_put_link(struct dentry *dentry, struct nameidata *nd)
+{
+	if (!IS_ERR(nd_get_link(nd))) {
+		struct page *page;
+		page = find_get_page(dentry->d_inode->i_mapping, 0);
+		if (!page)
+			BUG();
+		kunmap(page);
+		page_cache_release(page);
+		page_cache_release(page);
+	}
+}
+
 int page_follow_link(struct dentry *dentry, struct nameidata *nd)
 {
 	struct page *page = NULL;
@@ -2307,8 +2392,9 @@ fail:
 }
 
 struct inode_operations page_symlink_inode_operations = {
-	.readlink	= page_readlink,
-	.follow_link	= page_follow_link,
+	.readlink	= generic_readlink,
+	.follow_link	= page_follow_link_light,
+	.put_link	= page_put_link,
 };
 
 EXPORT_SYMBOL(__user_walk);
@@ -2321,6 +2407,8 @@ EXPORT_SYMBOL(lookup_create);
 EXPORT_SYMBOL(lookup_hash);
 EXPORT_SYMBOL(lookup_one_len);
 EXPORT_SYMBOL(page_follow_link);
+EXPORT_SYMBOL(page_follow_link_light);
+EXPORT_SYMBOL(page_put_link);
 EXPORT_SYMBOL(page_readlink);
 EXPORT_SYMBOL(page_symlink);
 EXPORT_SYMBOL(page_symlink_inode_operations);
@@ -2340,3 +2428,4 @@ EXPORT_SYMBOL(vfs_rename);
 EXPORT_SYMBOL(vfs_rmdir);
 EXPORT_SYMBOL(vfs_symlink);
 EXPORT_SYMBOL(vfs_unlink);
+EXPORT_SYMBOL(generic_readlink);
diff --git a/fs/namespace.c b/fs/namespace.c
index 9bd40b9ed..9b7d73b2b 100644
--- a/fs/namespace.c
+++ b/fs/namespace.c
@@ -62,6 +62,7 @@ struct vfsmount *alloc_vfsmnt(const char *name)
 		INIT_LIST_HEAD(&mnt->mnt_child);
 		INIT_LIST_HEAD(&mnt->mnt_mounts);
 		INIT_LIST_HEAD(&mnt->mnt_list);
+		INIT_LIST_HEAD(&mnt->mnt_fslink);
 		if (name) {
 			int size = strlen(name)+1;
 			char *newname = kmalloc(size, GFP_KERNEL);
@@ -108,13 +109,9 @@ struct vfsmount *lookup_mnt(struct vfsmount *mnt, struct dentry *dentry)
 
 EXPORT_SYMBOL(lookup_mnt);
 
-static int check_mnt(struct vfsmount *mnt)
+static inline int check_mnt(struct vfsmount *mnt)
 {
-	spin_lock(&vfsmount_lock);
-	while (mnt->mnt_parent != mnt)
-		mnt = mnt->mnt_parent;
-	spin_unlock(&vfsmount_lock);
-	return mnt == current->namespace->root;
+	return mnt->mnt_namespace == current->namespace;
 }
 
 static void detach_mnt(struct vfsmount *mnt, struct nameidata *old_nd)
@@ -166,6 +163,14 @@ clone_mnt(struct vfsmount *old, struct dentry *root)
 		mnt->mnt_root = dget(root);
 		mnt->mnt_mountpoint = mnt->mnt_root;
 		mnt->mnt_parent = mnt;
+		mnt->mnt_namespace = old->mnt_namespace;
+
+		/* stick the duplicate mount on the same expiry list
+		 * as the original if that was on one */
+		spin_lock(&vfsmount_lock);
+		if (!list_empty(&old->mnt_fslink))
+			list_add(&mnt->mnt_fslink, &old->mnt_fslink);
+		spin_unlock(&vfsmount_lock);
 	}
 	return mnt;
 }
@@ -226,6 +231,7 @@ static int show_vfsmnt(struct seq_file *m, void *v)
 		{ MS_MANDLOCK, ",mand" },
 		{ MS_NOATIME, ",noatime" },
 		{ MS_NODIRATIME, ",nodiratime" },
+		{ MS_TAGXID, ",tagxid" },
 		{ 0, NULL }
 	};
 	static struct proc_fs_info mnt_info[] = {
@@ -343,6 +349,7 @@ static inline void __umount_tree(struct vfsmount *mnt, struct list_head *kill)
 	while (!list_empty(kill)) {
 		mnt = list_entry(kill->next, struct vfsmount, mnt_list);
 		list_del_init(&mnt->mnt_list);
+		list_del_init(&mnt->mnt_fslink);
 		if (mnt->mnt_parent == mnt) {
 			spin_unlock(&vfsmount_lock);
 		} else {
@@ -391,6 +398,24 @@ static int do_umount(struct vfsmount *mnt, int flags)
 	if (retval)
 		return retval;
 
+	/*
+	 * Allow userspace to request a mountpoint be expired rather than
+	 * unmounting unconditionally. Unmount only happens if:
+	 *  (1) the mark is already set (the mark is cleared by mntput())
+	 *  (2) the usage count == 1 [parent vfsmount] + 1 [sys_umount]
+	 */
+	if (flags & MNT_EXPIRE) {
+		if (mnt == current->fs->rootmnt ||
+		    flags & (MNT_FORCE | MNT_DETACH))
+			return -EINVAL;
+
+		if (atomic_read(&mnt->mnt_count) != 2)
+			return -EBUSY;
+
+		if (!xchg(&mnt->mnt_expiry_mark, 1))
+			return -EAGAIN;
+	}
+
 	/*
 	 * If we may have to abort operations to get out of this
 	 * mount, and they will themselves hold resources we must
@@ -423,7 +448,7 @@ static int do_umount(struct vfsmount *mnt, int flags)
 		down_write(&sb->s_umount);
 		if (!(sb->s_flags & MS_RDONLY)) {
 			lock_kernel();
-			retval = do_remount_sb(sb, MS_RDONLY, 0, 0);
+			retval = do_remount_sb(sb, MS_RDONLY, NULL, 0);
 			unlock_kernel();
 		}
 		up_write(&sb->s_umount);
@@ -484,7 +509,7 @@ asmlinkage long sys_umount(char __user * name, int flags)
 
 	retval = do_umount(nd.mnt, flags);
 dput_and_out:
-	path_release(&nd);
+	path_release_on_umount(&nd);
 out:
 	return retval;
 }
@@ -643,6 +668,11 @@ static int do_loopback(struct nameidata *nd, char *old_name, int recurse)
 	}
 
 	if (mnt) {
+		/* stop bind mounts from expiring */
+		spin_lock(&vfsmount_lock);
+		list_del_init(&mnt->mnt_fslink);
+		spin_unlock(&vfsmount_lock);
+
 		err = graft_tree(mnt, nd);
 		if (err) {
 			spin_lock(&vfsmount_lock);
@@ -663,7 +693,8 @@ static int do_loopback(struct nameidata *nd, char *old_name, int recurse)
  * on it - tough luck.
  */
 
-static int do_remount(struct nameidata *nd,int flags,int mnt_flags,void *data)
+static int do_remount(struct nameidata *nd, int flags, int mnt_flags,
+		      void *data)
 {
 	int err;
 	struct super_block * sb = nd->mnt->mnt_sb;
@@ -735,6 +766,10 @@ static int do_move_mount(struct nameidata *nd, char *old_name)
 
 	detach_mnt(old_nd.mnt, &parent_nd);
 	attach_mnt(old_nd.mnt, nd);
+
+	/* if the mount is moved, it should no longer be expire
+	 * automatically */
+	list_del_init(&old_nd.mnt->mnt_fslink);
 out2:
 	spin_unlock(&vfsmount_lock);
 out1:
@@ -747,11 +782,14 @@ out:
 	return err;
 }
 
-static int do_add_mount(struct nameidata *nd, char *type, int flags,
+/*
+ * create a new mount for userspace and request it to be added into the
+ * namespace's tree
+ */
+static int do_new_mount(struct nameidata *nd, char *type, int flags,
 			int mnt_flags, char *name, void *data)
 {
 	struct vfsmount *mnt;
-	int err;
 
 	if (!type || !memchr(type, 0, PAGE_SIZE))
 		return -EINVAL;
@@ -761,9 +799,20 @@ static int do_add_mount(struct nameidata *nd, char *type, int flags,
 		return -EPERM;
 
 	mnt = do_kern_mount(type, flags, name, data);
-	err = PTR_ERR(mnt);
 	if (IS_ERR(mnt))
-		goto out;
+		return PTR_ERR(mnt);
+
+	return do_add_mount(mnt, nd, mnt_flags, NULL);
+}
+
+/*
+ * add a mount into a namespace's mount tree
+ * - provide the option of adding the new mount to an expiration list
+ */
+int do_add_mount(struct vfsmount *newmnt, struct nameidata *nd,
+		 int mnt_flags, struct list_head *fslist)
+{
+	int err;
 
 	down_write(&current->namespace->sem);
 	/* Something was mounted here while we slept */
@@ -775,22 +824,138 @@ static int do_add_mount(struct nameidata *nd, char *type, int flags,
 
 	/* Refuse the same filesystem on the same mount point */
 	err = -EBUSY;
-	if (nd->mnt->mnt_sb == mnt->mnt_sb && nd->mnt->mnt_root == nd->dentry)
+	if (nd->mnt->mnt_sb == newmnt->mnt_sb &&
+	    nd->mnt->mnt_root == nd->dentry)
 		goto unlock;
 
 	err = -EINVAL;
-	if (S_ISLNK(mnt->mnt_root->d_inode->i_mode))
+	if (S_ISLNK(newmnt->mnt_root->d_inode->i_mode))
 		goto unlock;
 
-	mnt->mnt_flags = mnt_flags;
-	err = graft_tree(mnt, nd);
+	newmnt->mnt_flags = mnt_flags;
+	err = graft_tree(newmnt, nd);
+
+	if (err == 0 && fslist) {
+		/* add to the specified expiration list */
+		spin_lock(&vfsmount_lock);
+		list_add_tail(&newmnt->mnt_fslink, fslist);
+		spin_unlock(&vfsmount_lock);
+	}
+
 unlock:
 	up_write(&current->namespace->sem);
-	mntput(mnt);
-out:
+	mntput(newmnt);
 	return err;
 }
 
+EXPORT_SYMBOL_GPL(do_add_mount);
+
+/*
+ * process a list of expirable mountpoints with the intent of discarding any
+ * mountpoints that aren't in use and haven't been touched since last we came
+ * here
+ */
+void mark_mounts_for_expiry(struct list_head *mounts)
+{
+	struct namespace *namespace;
+	struct vfsmount *mnt, *next;
+	LIST_HEAD(graveyard);
+
+	if (list_empty(mounts))
+		return;
+
+	spin_lock(&vfsmount_lock);
+
+	/* extract from the expiration list every vfsmount that matches the
+	 * following criteria:
+	 * - only referenced by its parent vfsmount
+	 * - still marked for expiry (marked on the last call here; marks are
+	 *   cleared by mntput())
+	 */
+	list_for_each_entry_safe(mnt, next, mounts, mnt_fslink) {
+		if (!xchg(&mnt->mnt_expiry_mark, 1) ||
+		    atomic_read(&mnt->mnt_count) != 1)
+			continue;
+
+		mntget(mnt);
+		list_move(&mnt->mnt_fslink, &graveyard);
+	}
+
+	/*
+	 * go through the vfsmounts we've just consigned to the graveyard to
+	 * - check that they're still dead
+	 * - delete the vfsmount from the appropriate namespace under lock
+	 * - dispose of the corpse
+	 */
+	while (!list_empty(&graveyard)) {
+		mnt = list_entry(graveyard.next, struct vfsmount, mnt_fslink);
+		list_del_init(&mnt->mnt_fslink);
+
+		/* don't do anything if the namespace is dead - all the
+		 * vfsmounts from it are going away anyway */
+		namespace = mnt->mnt_namespace;
+		if (!namespace || atomic_read(&namespace->count) <= 0)
+			continue;
+		get_namespace(namespace);
+
+		spin_unlock(&vfsmount_lock);
+		down_write(&namespace->sem);
+		spin_lock(&vfsmount_lock);
+
+		/* check that it is still dead: the count should now be 2 - as
+		 * contributed by the vfsmount parent and the mntget above */
+		if (atomic_read(&mnt->mnt_count) == 2) {
+			struct vfsmount *xdmnt;
+			struct dentry *xdentry;
+
+			/* delete from the namespace */
+			list_del_init(&mnt->mnt_list);
+			list_del_init(&mnt->mnt_child);
+			list_del_init(&mnt->mnt_hash);
+			mnt->mnt_mountpoint->d_mounted--;
+
+			xdentry = mnt->mnt_mountpoint;
+			mnt->mnt_mountpoint = mnt->mnt_root;
+			xdmnt = mnt->mnt_parent;
+			mnt->mnt_parent = mnt;
+
+			spin_unlock(&vfsmount_lock);
+
+			mntput(xdmnt);
+			dput(xdentry);
+
+			/* now lay it to rest if this was the last ref on the
+			 * superblock */
+			if (atomic_read(&mnt->mnt_sb->s_active) == 1) {
+				/* last instance - try to be smart */
+				lock_kernel();
+				DQUOT_OFF(mnt->mnt_sb);
+				acct_auto_close(mnt->mnt_sb);
+				unlock_kernel();
+			}
+
+			mntput(mnt);
+		} else {
+			/* someone brought it back to life whilst we didn't
+			 * have any locks held so return it to the expiration
+			 * list */
+			list_add_tail(&mnt->mnt_fslink, mounts);
+			spin_unlock(&vfsmount_lock);
+		}
+
+		up_write(&namespace->sem);
+
+		mntput(mnt);
+		put_namespace(namespace);
+
+		spin_lock(&vfsmount_lock);
+	}
+
+	spin_unlock(&vfsmount_lock);
+}
+
+EXPORT_SYMBOL_GPL(mark_mounts_for_expiry);
+
 int copy_mount_options (const void __user *data, unsigned long *where)
 {
 	int i;
@@ -888,7 +1053,7 @@ long do_mount(char * dev_name, char * dir_name, char *type_page,
 	else if (flags & MS_MOVE)
 		retval = do_move_mount(&nd, dev_name);
 	else
-		retval = do_add_mount(&nd, type_page, flags, mnt_flags,
+		retval = do_new_mount(&nd, type_page, flags, mnt_flags,
 				      dev_name, data_page);
 dput_out:
 	path_release(&nd);
@@ -901,6 +1066,7 @@ int copy_namespace(int flags, struct task_struct *tsk)
 	struct namespace *new_ns;
 	struct vfsmount *rootmnt = NULL, *pwdmnt = NULL, *altrootmnt = NULL;
 	struct fs_struct *fs = tsk->fs;
+	struct vfsmount *p, *q;
 
 	if (!namespace)
 		return 0;
@@ -935,14 +1101,16 @@ int copy_namespace(int flags, struct task_struct *tsk)
 	list_add_tail(&new_ns->list, &new_ns->root->mnt_list);
 	spin_unlock(&vfsmount_lock);
 
-	/* Second pass: switch the tsk->fs->* elements */
-	if (fs) {
-		struct vfsmount *p, *q;
-		write_lock(&fs->lock);
-
-		p = namespace->root;
-		q = new_ns->root;
-		while (p) {
+	/*
+	 * Second pass: switch the tsk->fs->* elements and mark new vfsmounts
+	 * as belonging to new namespace.  We have already acquired a private
+	 * fs_struct, so tsk->fs->lock is not needed.
+	 */
+	p = namespace->root;
+	q = new_ns->root;
+	while (p) {
+		q->mnt_namespace = new_ns;
+		if (fs) {
 			if (p == fs->rootmnt) {
 				rootmnt = p;
 				fs->rootmnt = mntget(q);
@@ -955,10 +1123,9 @@ int copy_namespace(int flags, struct task_struct *tsk)
 				altrootmnt = p;
 				fs->altrootmnt = mntget(q);
 			}
-			p = next_mnt(p, namespace->root);
-			q = next_mnt(q, new_ns->root);
 		}
-		write_unlock(&fs->lock);
+		p = next_mnt(p, namespace->root);
+		q = next_mnt(q, new_ns->root);
 	}
 	up_write(&tsk->namespace->sem);
 
@@ -1213,6 +1380,7 @@ static void __init init_mount_tree(void)
 	init_rwsem(&namespace->sem);
 	list_add(&mnt->mnt_list, &namespace->list);
 	namespace->root = mnt;
+	mnt->mnt_namespace = namespace;
 
 	init_task.namespace = namespace;
 	read_lock(&tasklist_lock);
@@ -1280,8 +1448,15 @@ void __init mnt_init(unsigned long mempages)
 
 void __put_namespace(struct namespace *namespace)
 {
+	struct vfsmount *mnt;
+
 	down_write(&namespace->sem);
 	spin_lock(&vfsmount_lock);
+
+	list_for_each_entry(mnt, &namespace->list, mnt_list) {
+		mnt->mnt_namespace = NULL;
+	}
+
 	umount_tree(namespace->root);
 	spin_unlock(&vfsmount_lock);
 	up_write(&namespace->sem);
diff --git a/fs/ncpfs/dir.c b/fs/ncpfs/dir.c
index 9184fbbeb..cfb6c2938 100644
--- a/fs/ncpfs/dir.c
+++ b/fs/ncpfs/dir.c
@@ -762,12 +762,12 @@ ncp_do_readdir(struct file *filp, void *dirent, filldir_t filldir,
 int ncp_conn_logged_in(struct super_block *sb)
 {
 	struct ncp_server* server = NCP_SBP(sb);
-	struct nw_info_struct i;
 	int result;
 
 	if (ncp_single_volume(server)) {
 		int len;
 		struct dentry* dent;
+		__u32 volNumber, dirEntNum, DosDirNum;
 		__u8 __name[NCP_MAXPATHLEN + 1];
 
 		len = sizeof(__name);
@@ -776,7 +776,7 @@ int ncp_conn_logged_in(struct super_block *sb)
 		if (result)
 			goto out;
 		result = -ENOENT;
-		if (ncp_lookup_volume(server, __name, &i)) {
+		if (ncp_get_volume_root(server, __name, &volNumber, &dirEntNum, &DosDirNum)) {
 			PPRINTK("ncp_conn_logged_in: %s not found\n",
 				server->m.mounted_vol);
 			goto out;
@@ -785,9 +785,9 @@ int ncp_conn_logged_in(struct super_block *sb)
 		if (dent) {
 			struct inode* ino = dent->d_inode;
 			if (ino) {
-				NCP_FINFO(ino)->volNumber = i.volNumber;
-				NCP_FINFO(ino)->dirEntNum = i.dirEntNum;
-				NCP_FINFO(ino)->DosDirNum = i.DosDirNum;
+				NCP_FINFO(ino)->volNumber = volNumber;
+				NCP_FINFO(ino)->dirEntNum = dirEntNum;
+				NCP_FINFO(ino)->DosDirNum = DosDirNum;
 			} else {
 				DPRINTK("ncpfs: sb->s_root->d_inode == NULL!\n");
 			}
diff --git a/fs/ncpfs/inode.c b/fs/ncpfs/inode.c
index cda1ffd34..bea651fd2 100644
--- a/fs/ncpfs/inode.c
+++ b/fs/ncpfs/inode.c
@@ -873,7 +873,9 @@ int ncp_notify_change(struct dentry *dentry, struct iattr *attr)
 				tmpattr.ia_valid = ATTR_MODE;
 				tmpattr.ia_mode = attr->ia_mode;
 
-				inode_setattr(inode, &tmpattr);
+				result = inode_setattr(inode, &tmpattr);
+				if (result)
+					goto out;
 			}
 		}
 #endif
@@ -899,13 +901,17 @@ int ncp_notify_change(struct dentry *dentry, struct iattr *attr)
 		   closing the file */
 		ncp_inode_close(inode);
 		result = ncp_make_closed(inode);
+		if (result)
+			goto out;
 		{
 			struct iattr tmpattr;
 			
 			tmpattr.ia_valid = ATTR_SIZE;
 			tmpattr.ia_size = attr->ia_size;
 			
-			inode_setattr(inode, &tmpattr);
+			result = inode_setattr(inode, &tmpattr);
+			if (result)
+				goto out;
 		}
 	}
 	if ((attr->ia_valid & ATTR_CTIME) != 0) {
@@ -951,7 +957,7 @@ int ncp_notify_change(struct dentry *dentry, struct iattr *attr)
 #endif
 	}
 	if (!result)
-		inode_setattr(inode, attr);
+		result = inode_setattr(inode, attr);
 out:
 	unlock_kernel();
 	return result;
diff --git a/fs/ncpfs/ioctl.c b/fs/ncpfs/ioctl.c
index a25f957ad..a7eb88163 100644
--- a/fs/ncpfs/ioctl.c
+++ b/fs/ncpfs/ioctl.c
@@ -29,6 +29,155 @@
 /* maximum negotiable packet size */
 #define NCP_PACKET_SIZE_INTERNAL 65536
 
+static int
+ncp_get_fs_info(struct ncp_server* server, struct inode* inode, struct ncp_fs_info __user *arg)
+{
+	struct ncp_fs_info info;
+
+	if ((permission(inode, MAY_WRITE, NULL) != 0)
+	    && (current->uid != server->m.mounted_uid)) {
+		return -EACCES;
+	}
+	if (copy_from_user(&info, arg, sizeof(info)))
+		return -EFAULT;
+
+	if (info.version != NCP_GET_FS_INFO_VERSION) {
+		DPRINTK("info.version invalid: %d\n", info.version);
+		return -EINVAL;
+	}
+	/* TODO: info.addr = server->m.serv_addr; */
+	SET_UID(info.mounted_uid, server->m.mounted_uid);
+	info.connection		= server->connection;
+	info.buffer_size	= server->buffer_size;
+	info.volume_number	= NCP_FINFO(inode)->volNumber;
+	info.directory_id	= NCP_FINFO(inode)->DosDirNum;
+
+	if (copy_to_user(arg, &info, sizeof(info)))
+		return -EFAULT;
+	return 0;
+}
+
+static int
+ncp_get_fs_info_v2(struct ncp_server* server, struct inode* inode, struct ncp_fs_info_v2 __user * arg)
+{
+	struct ncp_fs_info_v2 info2;
+
+	if ((permission(inode, MAY_WRITE, NULL) != 0)
+	    && (current->uid != server->m.mounted_uid)) {
+		return -EACCES;
+	}
+	if (copy_from_user(&info2, arg, sizeof(info2)))
+		return -EFAULT;
+
+	if (info2.version != NCP_GET_FS_INFO_VERSION_V2) {
+		DPRINTK("info.version invalid: %d\n", info2.version);
+		return -EINVAL;
+	}
+	info2.mounted_uid   = server->m.mounted_uid;
+	info2.connection    = server->connection;
+	info2.buffer_size   = server->buffer_size;
+	info2.volume_number = NCP_FINFO(inode)->volNumber;
+	info2.directory_id  = NCP_FINFO(inode)->DosDirNum;
+	info2.dummy1 = info2.dummy2 = info2.dummy3 = 0;
+
+	if (copy_to_user(arg, &info2, sizeof(info2)))
+		return -EFAULT;
+	return 0;
+}
+
+#ifdef CONFIG_NCPFS_NLS
+/* Here we are select the iocharset and the codepage for NLS.
+ * Thanks Petr Vandrovec for idea and many hints.
+ */
+static int
+ncp_set_charsets(struct ncp_server* server, struct ncp_nls_ioctl __user *arg)
+{
+	struct ncp_nls_ioctl user;
+	struct nls_table *codepage;
+	struct nls_table *iocharset;
+	struct nls_table *oldset_io;
+	struct nls_table *oldset_cp;
+
+	if (!capable(CAP_SYS_ADMIN))
+		return -EACCES;
+	if (server->root_setuped)
+		return -EBUSY;
+
+	if (copy_from_user(&user, arg, sizeof(user)))
+		return -EFAULT;
+
+	codepage = NULL;
+	user.codepage[NCP_IOCSNAME_LEN] = 0;
+	if (!user.codepage[0] || !strcmp(user.codepage, "default"))
+		codepage = load_nls_default();
+	else {
+		codepage = load_nls(user.codepage);
+		if (!codepage) {
+			return -EBADRQC;
+		}
+	}
+
+	iocharset = NULL;
+	user.iocharset[NCP_IOCSNAME_LEN] = 0;
+	if (!user.iocharset[0] || !strcmp(user.iocharset, "default")) {
+		iocharset = load_nls_default();
+		NCP_CLR_FLAG(server, NCP_FLAG_UTF8);
+	} else if (!strcmp(user.iocharset, "utf8")) {
+		iocharset = load_nls_default();
+		NCP_SET_FLAG(server, NCP_FLAG_UTF8);
+	} else {
+		iocharset = load_nls(user.iocharset);
+		if (!iocharset) {
+			unload_nls(codepage);
+			return -EBADRQC;
+		}
+		NCP_CLR_FLAG(server, NCP_FLAG_UTF8);
+	}
+
+	oldset_cp = server->nls_vol;
+	server->nls_vol = codepage;
+	oldset_io = server->nls_io;
+	server->nls_io = iocharset;
+
+	if (oldset_cp)
+		unload_nls(oldset_cp);
+	if (oldset_io)
+		unload_nls(oldset_io);
+
+	return 0;
+}
+
+static int
+ncp_get_charsets(struct ncp_server* server, struct ncp_nls_ioctl __user *arg)
+{
+	struct ncp_nls_ioctl user;
+	int len;
+
+	memset(&user, 0, sizeof(user));
+	if (server->nls_vol && server->nls_vol->charset) {
+		len = strlen(server->nls_vol->charset);
+		if (len > NCP_IOCSNAME_LEN)
+			len = NCP_IOCSNAME_LEN;
+		strncpy(user.codepage, server->nls_vol->charset, len);
+		user.codepage[len] = 0;
+	}
+
+	if (NCP_IS_FLAG(server, NCP_FLAG_UTF8))
+		strcpy(user.iocharset, "utf8");
+	else if (server->nls_io && server->nls_io->charset) {
+		len = strlen(server->nls_io->charset);
+		if (len > NCP_IOCSNAME_LEN)
+			len = NCP_IOCSNAME_LEN;
+		strncpy(user.iocharset,	server->nls_io->charset, len);
+		user.iocharset[len] = 0;
+	}
+
+	if (copy_to_user(arg, &user, sizeof(user)))
+		return -EFAULT;
+	return 0;
+}
+#endif /* CONFIG_NCPFS_NLS */
+
 int ncp_ioctl(struct inode *inode, struct file *filp,
 	      unsigned int cmd, unsigned long arg)
 {
@@ -36,6 +185,7 @@ int ncp_ioctl(struct inode *inode, struct file *filp,
 	int result;
 	struct ncp_ioctl_request request;
 	char* bouncebuffer;
+	void __user *argp = (void __user *)arg;
 
 	switch (cmd) {
 	case NCP_IOC_NCPREQUEST:
@@ -44,8 +194,7 @@ int ncp_ioctl(struct inode *inode, struct file *filp,
 		    && (current->uid != server->m.mounted_uid)) {
 			return -EACCES;
 		}
-		if (copy_from_user(&request, (struct ncp_ioctl_request *) arg,
-			       sizeof(request)))
+		if (copy_from_user(&request, argp, sizeof(request)))
 			return -EFAULT;
 
 		if ((request.function > 255)
@@ -96,60 +245,10 @@ int ncp_ioctl(struct inode *inode, struct file *filp,
 		return ncp_conn_logged_in(inode->i_sb);
 
 	case NCP_IOC_GET_FS_INFO:
-		{
-			struct ncp_fs_info info;
-
-			if ((permission(inode, MAY_WRITE, NULL) != 0)
-			    && (current->uid != server->m.mounted_uid)) {
-				return -EACCES;
-			}
-			if (copy_from_user(&info, (struct ncp_fs_info *) arg, 
-				sizeof(info)))
-				return -EFAULT;
-
-			if (info.version != NCP_GET_FS_INFO_VERSION) {
-				DPRINTK("info.version invalid: %d\n", info.version);
-				return -EINVAL;
-			}
-			/* TODO: info.addr = server->m.serv_addr; */
-			SET_UID(info.mounted_uid, server->m.mounted_uid);
-			info.connection		= server->connection;
-			info.buffer_size	= server->buffer_size;
-			info.volume_number	= NCP_FINFO(inode)->volNumber;
-			info.directory_id	= NCP_FINFO(inode)->DosDirNum;
-
-			if (copy_to_user((struct ncp_fs_info *) arg, &info, 
-				sizeof(info))) return -EFAULT;
-			return 0;
-		}
+		return ncp_get_fs_info(server, inode, argp);
 
 	case NCP_IOC_GET_FS_INFO_V2:
-		{
-			struct ncp_fs_info_v2 info2;
-
-			if ((permission(inode, MAY_WRITE, NULL) != 0)
-			    && (current->uid != server->m.mounted_uid)) {
-				return -EACCES;
-			}
-			if (copy_from_user(&info2, (struct ncp_fs_info_v2 *) arg, 
-				sizeof(info2)))
-				return -EFAULT;
-
-			if (info2.version != NCP_GET_FS_INFO_VERSION_V2) {
-				DPRINTK("info.version invalid: %d\n", info2.version);
-				return -EINVAL;
-			}
-			info2.mounted_uid   = server->m.mounted_uid;
-			info2.connection    = server->connection;
-			info2.buffer_size   = server->buffer_size;
-			info2.volume_number = NCP_FINFO(inode)->volNumber;
-			info2.directory_id  = NCP_FINFO(inode)->DosDirNum;
-			info2.dummy1 = info2.dummy2 = info2.dummy3 = 0;
-
-			if (copy_to_user((struct ncp_fs_info_v2 *) arg, &info2, 
-				sizeof(info2))) return -EFAULT;
-			return 0;
-		}
+		return ncp_get_fs_info_v2(server, inode, argp);
 
 	case NCP_IOC_GETMOUNTUID2:
 		{
@@ -160,7 +259,7 @@ int ncp_ioctl(struct inode *inode, struct file *filp,
 			{
 				return -EACCES;
 			}
-			if (put_user(tmp, (unsigned long*) arg)) 
+			if (put_user(tmp, (unsigned long __user *)argp)) 
 				return -EFAULT;
 			return 0;
 		}
@@ -193,15 +292,14 @@ int ncp_ioctl(struct inode *inode, struct file *filp,
 				sr.namespace = 0;
 				sr.dirEntNum = 0;
 			}
-			if (copy_to_user((struct ncp_setroot_ioctl*)arg, 
-				    	  &sr, 
-					  sizeof(sr))) return -EFAULT;
+			if (copy_to_user(argp, &sr, sizeof(sr)))
+				return -EFAULT;
 			return 0;
 		}
 	case NCP_IOC_SETROOT:
 		{
 			struct ncp_setroot_ioctl sr;
-			unsigned int vnum, de, dosde;
+			__u32 vnum, de, dosde;
 			struct dentry* dentry;
 
 			if (!capable(CAP_SYS_ADMIN))
@@ -209,9 +307,8 @@ int ncp_ioctl(struct inode *inode, struct file *filp,
 				return -EACCES;
 			}
 			if (server->root_setuped) return -EBUSY;
-			if (copy_from_user(&sr,
-					   (struct ncp_setroot_ioctl*)arg, 
-					   sizeof(sr))) return -EFAULT;
+			if (copy_from_user(&sr, argp, sizeof(sr)))
+				return -EFAULT;
 			if (sr.volNumber < 0) {
 				server->m.mounted_vol[0] = 0;
 				vnum = NCP_NUMBER_OF_VOLUMES;
@@ -219,15 +316,10 @@ int ncp_ioctl(struct inode *inode, struct file *filp,
 				dosde = 0;
 			} else if (sr.volNumber >= NCP_NUMBER_OF_VOLUMES) {
 				return -EINVAL;
-			} else {
-				struct nw_info_struct ni;
-				
-				if (ncp_mount_subdir(server, &ni, sr.volNumber,
-						sr.namespace, sr.dirEntNum))
-					return -ENOENT;
-				vnum = ni.volNumber;
-				de = ni.dirEntNum;
-				dosde = ni.DosDirNum;
+			} else if (ncp_mount_subdir(server, sr.volNumber,
+						sr.namespace, sr.dirEntNum,
+						&vnum, &de, &dosde)) {
+				return -ENOENT;
 			}
 			
 			dentry = inode->i_sb->s_root;
@@ -254,13 +346,13 @@ int ncp_ioctl(struct inode *inode, struct file *filp,
 		{
 			return -EACCES;
 		}
-		if (arg) {
+		if (argp) {
 			if (server->sign_wanted)
 			{
 				struct ncp_sign_init sign;
 
-				if (copy_from_user(&sign, (struct ncp_sign_init *) arg,
-				      sizeof(sign))) return -EFAULT;
+				if (copy_from_user(&sign, argp, sizeof(sign)))
+					return -EFAULT;
 				memcpy(server->sign_root,sign.sign_root,8);
 				memcpy(server->sign_last,sign.sign_last,16);
 				server->sign_active = 1;
@@ -278,7 +370,7 @@ int ncp_ioctl(struct inode *inode, struct file *filp,
 			return -EACCES;
 		}
 		
-                if (put_user(server->sign_wanted, (int*) arg))
+                if (put_user(server->sign_wanted, (int __user *)argp))
 			return -EFAULT;
                 return 0;
 	case NCP_IOC_SET_SIGN_WANTED:
@@ -291,7 +383,7 @@ int ncp_ioctl(struct inode *inode, struct file *filp,
 				return -EACCES;
 			}
 			/* get only low 8 bits... */
-			if (get_user(newstate, (unsigned char *) arg))
+			if (get_user(newstate, (unsigned char __user *)argp))
 				return -EFAULT;
 			if (server->sign_active) {
 				/* cannot turn signatures OFF when active */
@@ -315,8 +407,8 @@ int ncp_ioctl(struct inode *inode, struct file *filp,
 			struct ncp_lock_ioctl	 rqdata;
 			int result;
 
-			if (copy_from_user(&rqdata, (struct ncp_lock_ioctl*)arg,
-				sizeof(rqdata))) return -EFAULT;
+			if (copy_from_user(&rqdata, argp, sizeof(rqdata)))
+				return -EFAULT;
 			if (rqdata.origin != 0)
 				return -EINVAL;
 			/* check for cmd */
@@ -386,9 +478,8 @@ outrel:
 			struct ncp_objectname_ioctl user;
 			size_t outl;
 
-			if (copy_from_user(&user, 
-					   (struct ncp_objectname_ioctl*)arg,
-					   sizeof(user))) return -EFAULT;
+			if (copy_from_user(&user, argp, sizeof(user)))
+				return -EFAULT;
 			user.auth_type = server->auth.auth_type;
 			outl = user.object_name_len;
 			user.object_name_len = server->auth.object_name_len;
@@ -399,9 +490,8 @@ outrel:
 						 server->auth.object_name,
 						 outl)) return -EFAULT;
 			}
-			if (copy_to_user((struct ncp_objectname_ioctl*)arg,
-					 &user,
-					 sizeof(user))) return -EFAULT;
+			if (copy_to_user(argp, &user, sizeof(user)))
+				return -EFAULT;
 			return 0;
 		}
 	case NCP_IOC_SETOBJECTNAME:
@@ -416,9 +506,8 @@ outrel:
 			void* oldprivate;
 			size_t oldprivatelen;
 
-			if (copy_from_user(&user, 
-					   (struct ncp_objectname_ioctl*)arg,
-					   sizeof(user))) return -EFAULT;
+			if (copy_from_user(&user, argp, sizeof(user)))
+				return -EFAULT;
 			if (user.object_name_len > NCP_OBJECT_NAME_MAX_LEN)
 				return -ENOMEM;
 			if (user.object_name_len) {
@@ -456,9 +545,8 @@ outrel:
 			struct ncp_privatedata_ioctl user;
 			size_t outl;
 
-			if (copy_from_user(&user, 
-					   (struct ncp_privatedata_ioctl*)arg,
-					   sizeof(user))) return -EFAULT;
+			if (copy_from_user(&user, argp, sizeof(user)))
+				return -EFAULT;
 			outl = user.len;
 			user.len = server->priv.len;
 			if (outl > user.len) outl = user.len;
@@ -467,9 +555,8 @@ outrel:
 						 server->priv.data,
 						 outl)) return -EFAULT;
 			}
-			if (copy_to_user((struct ncp_privatedata_ioctl*)arg,
-					 &user,
-					 sizeof(user))) return -EFAULT;
+			if (copy_to_user(argp, &user, sizeof(user)))
+				return -EFAULT;
 			return 0;
 		}
 	case NCP_IOC_SETPRIVATEDATA:
@@ -482,9 +569,8 @@ outrel:
 			void* old;
 			size_t oldlen;
 
-			if (copy_from_user(&user, 
-					   (struct ncp_privatedata_ioctl*)arg,
-					   sizeof(user))) return -EFAULT;
+			if (copy_from_user(&user, argp, sizeof(user)))
+				return -EFAULT;
 			if (user.len > NCP_PRIVATE_DATA_MAX_LEN)
 				return -ENOMEM;
 			if (user.len) {
@@ -508,105 +594,14 @@ outrel:
 		}
 
 #ifdef CONFIG_NCPFS_NLS
-/* Here we are select the iocharset and the codepage for NLS.
- * Thanks Petr Vandrovec for idea and many hints.
- */
 	case NCP_IOC_SETCHARSETS:
-		if (!capable(CAP_SYS_ADMIN))
-			return -EACCES;
-		if (server->root_setuped)
-			return -EBUSY;
-
-		{
-			struct ncp_nls_ioctl user;
-			struct nls_table *codepage;
-			struct nls_table *iocharset;
-			struct nls_table *oldset_io;
-			struct nls_table *oldset_cp;
-			
-			if (copy_from_user(&user, (struct ncp_nls_ioctl*)arg,
-					sizeof(user)))
-				return -EFAULT;
-
-			codepage = NULL;
-			user.codepage[NCP_IOCSNAME_LEN] = 0;
-			if (!user.codepage[0] ||
-					!strcmp(user.codepage, "default"))
-				codepage = load_nls_default();
-			else {
-				codepage = load_nls(user.codepage);
-				if (!codepage) {
-					return -EBADRQC;
-				}
-			}
-
-			iocharset = NULL;
-			user.iocharset[NCP_IOCSNAME_LEN] = 0;
-			if (!user.iocharset[0] ||
-					!strcmp(user.iocharset, "default")) {
-				iocharset = load_nls_default();
-				NCP_CLR_FLAG(server, NCP_FLAG_UTF8);
-			} else {
-				if (!strcmp(user.iocharset, "utf8")) {
-					iocharset = load_nls_default();
-					NCP_SET_FLAG(server, NCP_FLAG_UTF8);
-				} else {
-					iocharset = load_nls(user.iocharset);
-					if (!iocharset) {
-						unload_nls(codepage);
-						return -EBADRQC;
-					}
-					NCP_CLR_FLAG(server, NCP_FLAG_UTF8);
-				}
-			}
-
-			oldset_cp = server->nls_vol;
-			server->nls_vol = codepage;
-			oldset_io = server->nls_io;
-			server->nls_io = iocharset;
-
-			if (oldset_cp)
-				unload_nls(oldset_cp);
-			if (oldset_io)
-				unload_nls(oldset_io);
-
-			return 0;
-		}
+		return ncp_set_charsets(server, argp);
 		
-	case NCP_IOC_GETCHARSETS: /* not tested */
-		{
-			struct ncp_nls_ioctl user;
-			int len;
-
-			memset(&user, 0, sizeof(user));
-			if (server->nls_vol && server->nls_vol->charset) {
-				len = strlen(server->nls_vol->charset);
-				if (len > NCP_IOCSNAME_LEN)
-					len = NCP_IOCSNAME_LEN;
-				strncpy(user.codepage,
-						server->nls_vol->charset, len);
-				user.codepage[len] = 0;
-			}
-
-			if (NCP_IS_FLAG(server, NCP_FLAG_UTF8))
-				strcpy(user.iocharset, "utf8");
-			else
-				if (server->nls_io && server->nls_io->charset) {
-					len = strlen(server->nls_io->charset);
-					if (len > NCP_IOCSNAME_LEN)
-						len = NCP_IOCSNAME_LEN;
-					strncpy(user.iocharset,
-						server->nls_io->charset, len);
-					user.iocharset[len] = 0;
-				}
-
-			if (copy_to_user((struct ncp_nls_ioctl*)arg, &user,
-					sizeof(user)))
-				return -EFAULT;
+	case NCP_IOC_GETCHARSETS:
+		return ncp_get_charsets(server, argp);
 
-			return 0;
-		}
 #endif /* CONFIG_NCPFS_NLS */
+
 	case NCP_IOC_SETDENTRYTTL:
 		if ((permission(inode, MAY_WRITE, NULL) != 0) &&
 				 (current->uid != server->m.mounted_uid))
@@ -614,7 +609,7 @@ outrel:
 		{
 			u_int32_t user;
 
-			if (copy_from_user(&user, (u_int32_t*)arg, sizeof(user)))
+			if (copy_from_user(&user, argp, sizeof(user)))
 				return -EFAULT;
 			/* 20 secs at most... */
 			if (user > 20000)
@@ -627,7 +622,7 @@ outrel:
 	case NCP_IOC_GETDENTRYTTL:
 		{
 			u_int32_t user = (server->dentry_ttl * 1000) / HZ;
-			if (copy_to_user((u_int32_t*)arg, &user, sizeof(user)))
+			if (copy_to_user(argp, &user, sizeof(user)))
 				return -EFAULT;
 			return 0;
 		}
@@ -643,7 +638,7 @@ outrel:
 			return -EACCES;
 		}
 		SET_UID(uid, server->m.mounted_uid);
-		if (put_user(uid, (__kernel_uid_t *) arg))
+		if (put_user(uid, (__kernel_uid_t __user *)argp))
 			return -EFAULT;
 		return 0;
 	}
diff --git a/fs/ncpfs/ncplib_kernel.c b/fs/ncpfs/ncplib_kernel.c
index 107c0b393..ad99ac0ec 100644
--- a/fs/ncpfs/ncplib_kernel.c
+++ b/fs/ncpfs/ncplib_kernel.c
@@ -536,37 +536,34 @@ ncp_ObtainSpecificDirBase(struct ncp_server *server,
 }
 
 int
-ncp_mount_subdir(struct ncp_server *server, struct nw_info_struct *i,
-			__u8 volNumber, __u8 srcNS, __u32 dirEntNum)
+ncp_mount_subdir(struct ncp_server *server,
+		 __u8 volNumber, __u8 srcNS, __u32 dirEntNum,
+		 __u32* volume, __u32* newDirEnt, __u32* newDosEnt)
 {
 	int dstNS;
 	int result;
-	__u32 newDirEnt;
-	__u32 newDosEnt;
 	
 	dstNS = ncp_get_known_namespace(server, volNumber);
 	if ((result = ncp_ObtainSpecificDirBase(server, srcNS, dstNS, volNumber, 
-				      dirEntNum, NULL, &newDirEnt, &newDosEnt)) != 0)
+				      dirEntNum, NULL, newDirEnt, newDosEnt)) != 0)
 	{
 		return result;
 	}
 	server->name_space[volNumber] = dstNS;
-	i->volNumber = volNumber;
-	i->dirEntNum = newDirEnt;
-	i->DosDirNum = newDosEnt;
+	*volume = volNumber;
 	server->m.mounted_vol[1] = 0;
 	server->m.mounted_vol[0] = 'X';
 	return 0;
 }
 
 int 
-ncp_lookup_volume(struct ncp_server *server, char *volname,
-		      struct nw_info_struct *target)
+ncp_get_volume_root(struct ncp_server *server, const char *volname,
+		    __u32* volume, __u32* dirent, __u32* dosdirent)
 {
 	int result;
-	int volnum;
+	__u8 volnum;
 
-	DPRINTK("ncp_lookup_volume: looking up vol %s\n", volname);
+	DPRINTK("ncp_get_volume_root: looking up vol %s\n", volname);
 
 	ncp_init_request(server);
 	ncp_add_byte(server, 22);	/* Subfunction: Generate dir handle */
@@ -585,16 +582,31 @@ ncp_lookup_volume(struct ncp_server *server, char *volname,
 		ncp_unlock_server(server);
 		return result;
 	}
-	memset(target, 0, sizeof(*target));
-	target->DosDirNum = target->dirEntNum = ncp_reply_dword(server, 4);
-	target->volNumber = volnum = ncp_reply_byte(server, 8);
+	*dirent = *dosdirent = ncp_reply_dword(server, 4);
+	volnum = ncp_reply_byte(server, 8);
 	ncp_unlock_server(server);
+	*volume = volnum;
 
 	server->name_space[volnum] = ncp_get_known_namespace(server, volnum);
 
 	DPRINTK("lookup_vol: namespace[%d] = %d\n",
 		volnum, server->name_space[volnum]);
 
+	return 0;
+}
+
+int
+ncp_lookup_volume(struct ncp_server *server, const char *volname,
+		  struct nw_info_struct *target)
+{
+	int result;
+
+	memset(target, 0, sizeof(*target));
+	result = ncp_get_volume_root(server, volname,
+			&target->volNumber, &target->dirEntNum, &target->DosDirNum);
+	if (result) {
+		return result;
+	}
 	target->nameLen = strlen(volname);
 	memcpy(target->entryName, volname, target->nameLen+1);
 	target->attributes = aDIR;
diff --git a/fs/ncpfs/ncplib_kernel.h b/fs/ncpfs/ncplib_kernel.h
index 6c0af0198..7edb9e131 100644
--- a/fs/ncpfs/ncplib_kernel.h
+++ b/fs/ncpfs/ncplib_kernel.h
@@ -70,7 +70,9 @@ void ncp_extract_file_info(void* src, struct nw_info_struct* target);
 int ncp_obtain_info(struct ncp_server *server, struct inode *, char *,
 		struct nw_info_struct *target);
 int ncp_obtain_nfs_info(struct ncp_server *server, struct nw_info_struct *target);
-int ncp_lookup_volume(struct ncp_server *, char *, struct nw_info_struct *);
+int ncp_get_volume_root(struct ncp_server *server, const char *volname,
+			__u32 *volume, __u32 *dirent, __u32 *dosdirent);
+int ncp_lookup_volume(struct ncp_server *, const char *, struct nw_info_struct *);
 int ncp_modify_file_or_subdir_dos_info(struct ncp_server *, struct inode *,
 	 __u32, const struct nw_modify_dos_info *info);
 int ncp_modify_file_or_subdir_dos_info_path(struct ncp_server *, struct inode *,
@@ -111,8 +113,8 @@ ncp_ClearPhysicalRecord(struct ncp_server *server,
 #endif	/* CONFIG_NCPFS_IOCTL_LOCKING */
 
 int
-ncp_mount_subdir(struct ncp_server *, struct nw_info_struct *,
-			__u8, __u8, __u32);
+ncp_mount_subdir(struct ncp_server *, __u8, __u8, __u32,
+		 __u32* volume, __u32* dirent, __u32* dosdirent);
 int ncp_dirhandle_alloc(struct ncp_server *, __u8 vol, __u32 dirent, __u8 *dirhandle);
 int ncp_dirhandle_free(struct ncp_server *, __u8 dirhandle);
 
diff --git a/fs/ncpfs/sock.c b/fs/ncpfs/sock.c
index 4d49900d4..845bfe43e 100644
--- a/fs/ncpfs/sock.c
+++ b/fs/ncpfs/sock.c
@@ -31,40 +31,26 @@
 
 #include "ncpsign_kernel.h"
 
-static int _recv(struct socket *sock, unsigned char *ubuf, int size,
-		 unsigned flags)
+static int _recv(struct socket *sock, void *buf, int size, unsigned flags)
 {
-	struct iovec iov;
-	struct msghdr msg;
-
-	iov.iov_base = ubuf;
-	iov.iov_len = size;
-
-	msg.msg_name = NULL;
-	msg.msg_namelen = 0;
-	msg.msg_control = NULL;
-	msg.msg_iov = &iov;
-	msg.msg_iovlen = 1;
-
-	return sock_recvmsg(sock, &msg, size, flags);
+	struct msghdr msg = {NULL, };
+	struct kvec iov = {buf, size};
+	return kernel_recvmsg(sock, &msg, &iov, 1, size, flags);
 }
 
-static inline int _send(struct socket *sock, const void *buff, int len)
+static inline int do_send(struct socket *sock, struct kvec *vec, int count,
+			  int len, unsigned flags)
 {
-	struct iovec iov;
-	struct msghdr msg;
-
-	iov.iov_base = (void *) buff;
-	iov.iov_len = len;
-
-	msg.msg_name = NULL;
-	msg.msg_namelen = 0;
-	msg.msg_control = NULL;
-	msg.msg_iov = &iov;
-	msg.msg_iovlen = 1;
-	msg.msg_flags = 0;
+	struct msghdr msg = { .msg_flags = flags };
+	return kernel_sendmsg(sock, &msg, vec, count, len);
+}
 
-	return sock_sendmsg(sock, &msg, len);
+static int _send(struct socket *sock, const void *buff, int len)
+{
+	struct kvec vec;
+	vec.iov_base = (void *) buff;
+	vec.iov_len = len;
+	return do_send(sock, &vec, 1, len, 0);
 }
 
 struct ncp_request_reply {
@@ -74,52 +60,57 @@ struct ncp_request_reply {
 	size_t datalen;
 	int result;
 	enum { RQ_DONE, RQ_INPROGRESS, RQ_QUEUED, RQ_IDLE } status;
-	struct iovec* tx_ciov;
+	struct kvec* tx_ciov;
 	size_t tx_totallen;
 	size_t tx_iovlen;
-	struct iovec tx_iov[3];
+	struct kvec tx_iov[3];
 	u_int16_t tx_type;
 	u_int32_t sign[6];
 };
 
-void ncp_tcp_data_ready(struct sock *sk, int len) {
+void ncp_tcp_data_ready(struct sock *sk, int len)
+{
 	struct ncp_server *server = sk->sk_user_data;
 
 	server->data_ready(sk, len);
 	schedule_work(&server->rcv.tq);
 }
 
-void ncp_tcp_error_report(struct sock *sk) {
+void ncp_tcp_error_report(struct sock *sk)
+{
 	struct ncp_server *server = sk->sk_user_data;
 	
 	server->error_report(sk);
 	schedule_work(&server->rcv.tq);
 }
 
-void ncp_tcp_write_space(struct sock *sk) {
+void ncp_tcp_write_space(struct sock *sk)
+{
 	struct ncp_server *server = sk->sk_user_data;
 	
 	/* We do not need any locking: we first set tx.creq, and then we do sendmsg,
 	   not vice versa... */
 	server->write_space(sk);
-	if (server->tx.creq) {
+	if (server->tx.creq)
 		schedule_work(&server->tx.tq);
-	}
 }
 
-void ncpdgram_timeout_call(unsigned long v) {
+void ncpdgram_timeout_call(unsigned long v)
+{
 	struct ncp_server *server = (void*)v;
 	
 	schedule_work(&server->timeout_tq);
 }
 
-static inline void ncp_finish_request(struct ncp_request_reply *req, int result) {
+static inline void ncp_finish_request(struct ncp_request_reply *req, int result)
+{
 	req->result = result;
 	req->status = RQ_DONE;
 	wake_up_all(&req->wq);
 }
 
-static void __abort_ncp_connection(struct ncp_server *server, struct ncp_request_reply *aborted, int err) {
+static void __abort_ncp_connection(struct ncp_server *server, struct ncp_request_reply *aborted, int err)
+{
 	struct ncp_request_reply *req;
 
 	ncp_invalidate_conn(server);
@@ -156,11 +147,13 @@ static void __abort_ncp_connection(struct ncp_server *server, struct ncp_request
 	}
 }
 
-static inline int get_conn_number(struct ncp_reply_header *rp) {
+static inline int get_conn_number(struct ncp_reply_header *rp)
+{
 	return rp->conn_low | (rp->conn_high << 8);
 }
 
-static inline void __ncp_abort_request(struct ncp_server *server, struct ncp_request_reply *req, int err) {
+static inline void __ncp_abort_request(struct ncp_server *server, struct ncp_request_reply *req, int err)
+{
 	/* If req is done, we got signal, but we also received answer... */
 	switch (req->status) {
 		case RQ_IDLE:
@@ -176,55 +169,46 @@ static inline void __ncp_abort_request(struct ncp_server *server, struct ncp_req
 	}
 }
 
-static inline void ncp_abort_request(struct ncp_server *server, struct ncp_request_reply *req, int err) {
+static inline void ncp_abort_request(struct ncp_server *server, struct ncp_request_reply *req, int err)
+{
 	down(&server->rcv.creq_sem);
 	__ncp_abort_request(server, req, err);
 	up(&server->rcv.creq_sem);
 }
 
-static inline void __ncptcp_abort(struct ncp_server *server) {
+static inline void __ncptcp_abort(struct ncp_server *server)
+{
 	__abort_ncp_connection(server, NULL, 0);
 }
 
-static int ncpdgram_send(struct socket *sock, struct ncp_request_reply *req) {
-	struct msghdr msg;
-	struct iovec iov[3];
-	
+static int ncpdgram_send(struct socket *sock, struct ncp_request_reply *req)
+{
+	struct kvec vec[3];
 	/* sock_sendmsg updates iov pointers for us :-( */
-	memcpy(iov, req->tx_ciov, req->tx_iovlen * sizeof(iov[0]));
-	msg.msg_name = NULL;
-	msg.msg_namelen = 0;
-	msg.msg_control = NULL;
-	msg.msg_iov = iov;
-	msg.msg_iovlen = req->tx_iovlen;
-	msg.msg_flags = MSG_DONTWAIT;
-	return sock_sendmsg(sock, &msg, req->tx_totallen);
+	memcpy(vec, req->tx_ciov, req->tx_iovlen * sizeof(vec[0]));
+	return do_send(sock, vec, req->tx_iovlen,
+		       req->tx_totallen, MSG_DONTWAIT);
 }
 
-static void __ncptcp_try_send(struct ncp_server *server) {
+static void __ncptcp_try_send(struct ncp_server *server)
+{
 	struct ncp_request_reply *rq;
-	struct msghdr msg;
-	struct iovec* iov;
-	struct iovec iovc[3];
+	struct kvec *iov;
+	struct kvec iovc[3];
 	int result;
 
 	rq = server->tx.creq;
-	if (!rq) {
+	if (!rq)
 		return;
-	}
 
 	/* sock_sendmsg updates iov pointers for us :-( */
 	memcpy(iovc, rq->tx_ciov, rq->tx_iovlen * sizeof(iov[0]));
-	msg.msg_name = NULL;
-	msg.msg_namelen = 0;
-	msg.msg_control = NULL;
-	msg.msg_iov = iovc;
-	msg.msg_iovlen = rq->tx_iovlen;
-	msg.msg_flags = MSG_NOSIGNAL | MSG_DONTWAIT;
-	result = sock_sendmsg(server->ncp_sock, &msg, rq->tx_totallen);
-	if (result == -EAGAIN) {
+	result = do_send(server->ncp_sock, iovc, rq->tx_iovlen,
+			 rq->tx_totallen, MSG_NOSIGNAL | MSG_DONTWAIT);
+
+	if (result == -EAGAIN)
 		return;
-	}
+
 	if (result < 0) {
 		printk(KERN_ERR "ncpfs: tcp: Send failed: %d\n", result);
 		__ncp_abort_request(server, rq, result);
@@ -247,14 +231,16 @@ static void __ncptcp_try_send(struct ncp_server *server) {
 	rq->tx_ciov = iov;
 }
 
-static inline void ncp_init_header(struct ncp_server *server, struct ncp_request_reply *req, struct ncp_request_header *h) {
+static inline void ncp_init_header(struct ncp_server *server, struct ncp_request_reply *req, struct ncp_request_header *h)
+{
 	req->status = RQ_INPROGRESS;
 	h->conn_low = server->connection;
 	h->conn_high = server->connection >> 8;
 	h->sequence = ++server->sequence;
 }
 	
-static void ncpdgram_start_request(struct ncp_server *server, struct ncp_request_reply *req) {
+static void ncpdgram_start_request(struct ncp_server *server, struct ncp_request_reply *req)
+{
 	size_t signlen;
 	struct ncp_request_header* h;
 	
@@ -282,7 +268,8 @@ static void ncpdgram_start_request(struct ncp_server *server, struct ncp_request
 #define NCP_TCP_XMIT_VERSION	(1)
 #define NCP_TCP_RCVD_MAGIC	(0x744E6350)
 
-static void ncptcp_start_request(struct ncp_server *server, struct ncp_request_reply *req) {
+static void ncptcp_start_request(struct ncp_server *server, struct ncp_request_reply *req)
+{
 	size_t signlen;
 	struct ncp_request_header* h;
 
@@ -306,14 +293,16 @@ static void ncptcp_start_request(struct ncp_server *server, struct ncp_request_r
 	__ncptcp_try_send(server);
 }
 
-static inline void __ncp_start_request(struct ncp_server *server, struct ncp_request_reply *req) {
+static inline void __ncp_start_request(struct ncp_server *server, struct ncp_request_reply *req)
+{
 	if (server->ncp_sock->type == SOCK_STREAM)
 		ncptcp_start_request(server, req);
 	else
 		ncpdgram_start_request(server, req);
 }
 
-static int ncp_add_request(struct ncp_server *server, struct ncp_request_reply *req) {
+static int ncp_add_request(struct ncp_server *server, struct ncp_request_reply *req)
+{
 	down(&server->rcv.creq_sem);
 	if (!ncp_conn_valid(server)) {
 		up(&server->rcv.creq_sem);
@@ -331,7 +320,8 @@ static int ncp_add_request(struct ncp_server *server, struct ncp_request_reply *
 	return 0;
 }
 
-static void __ncp_next_request(struct ncp_server *server) {
+static void __ncp_next_request(struct ncp_server *server)
+{
 	struct ncp_request_reply *req;
 
 	server->rcv.creq = NULL;
@@ -343,10 +333,10 @@ static void __ncp_next_request(struct ncp_server *server) {
 	__ncp_start_request(server, req);
 }
 
-static void info_server(struct ncp_server *server, unsigned int id, const void * data, size_t len) {
+static void info_server(struct ncp_server *server, unsigned int id, const void * data, size_t len)
+{
 	if (server->info_sock) {
-		struct iovec iov[2];
-		struct msghdr msg;
+		struct kvec iov[2];
 		__u32 hdr[2];
 	
 		hdr[0] = cpu_to_be32(len + 8);
@@ -357,18 +347,12 @@ static void info_server(struct ncp_server *server, unsigned int id, const void *
 		iov[1].iov_base = (void *) data;
 		iov[1].iov_len = len;
 
-		msg.msg_name = NULL;
-		msg.msg_namelen = 0;
-		msg.msg_control = NULL;
-		msg.msg_iov = iov;
-		msg.msg_iovlen = 2;
-		msg.msg_flags = MSG_NOSIGNAL;
-
-		sock_sendmsg(server->info_sock, &msg, len + 8);
+		do_send(server->info_sock, iov, 2, len + 8, MSG_NOSIGNAL);
 	}
 }
 
-static void __ncpdgram_rcv_proc(void *s) {
+void ncpdgram_rcv_proc(void *s)
+{
 	struct ncp_server *server = s;
 	struct socket* sock;
 	
@@ -378,7 +362,7 @@ static void __ncpdgram_rcv_proc(void *s) {
 		struct ncp_reply_header reply;
 		int result;
 
-		result = _recv(sock, (void*)&reply, sizeof(reply), MSG_PEEK | MSG_DONTWAIT);
+		result = _recv(sock, &reply, sizeof(reply), MSG_PEEK | MSG_DONTWAIT);
 		if (result < 0) {
 			break;
 		}
@@ -453,21 +437,12 @@ static void __ncpdgram_rcv_proc(void *s) {
 			up(&server->rcv.creq_sem);
 		}
 drop:;		
-		_recv(sock, (void*)&reply, sizeof(reply), MSG_DONTWAIT);
+		_recv(sock, &reply, sizeof(reply), MSG_DONTWAIT);
 	}
 }
 
-void ncpdgram_rcv_proc(void *s) {
-	mm_segment_t fs;
-	struct ncp_server *server = s;
-	
-	fs = get_fs();
-	set_fs(get_ds());
-	__ncpdgram_rcv_proc(server);
-	set_fs(fs);
-}
-
-static void __ncpdgram_timeout_proc(struct ncp_server *server) {
+static void __ncpdgram_timeout_proc(struct ncp_server *server)
+{
 	/* If timer is pending, we are processing another request... */
 	if (!timer_pending(&server->timeout_tm)) {
 		struct ncp_request_reply* req;
@@ -494,24 +469,22 @@ static void __ncpdgram_timeout_proc(struct ncp_server *server) {
 	}
 }
 
-void ncpdgram_timeout_proc(void *s) {
-	mm_segment_t fs;
+void ncpdgram_timeout_proc(void *s)
+{
 	struct ncp_server *server = s;
-	
-	fs = get_fs();
-	set_fs(get_ds());
 	down(&server->rcv.creq_sem);
 	__ncpdgram_timeout_proc(server);
 	up(&server->rcv.creq_sem);
-	set_fs(fs);
 }
 
-static inline void ncp_init_req(struct ncp_request_reply* req) {
+static inline void ncp_init_req(struct ncp_request_reply* req)
+{
 	init_waitqueue_head(&req->wq);
 	req->status = RQ_IDLE;
 }
 
-static int do_tcp_rcv(struct ncp_server *server, void *buffer, size_t len) {
+static int do_tcp_rcv(struct ncp_server *server, void *buffer, size_t len)
+{
 	int result;
 	
 	if (buffer) {
@@ -534,7 +507,8 @@ static int do_tcp_rcv(struct ncp_server *server, void *buffer, size_t len) {
 	return result;
 }	
 
-static int __ncptcp_rcv_proc(struct ncp_server *server) {
+static int __ncptcp_rcv_proc(struct ncp_server *server)
+{
 	/* We have to check the result, so store the complete header */
 	while (1) {
 		int result;
@@ -679,30 +653,22 @@ skipdata:;
 	}
 }
 
-void ncp_tcp_rcv_proc(void *s) {
-	mm_segment_t fs;
+void ncp_tcp_rcv_proc(void *s)
+{
 	struct ncp_server *server = s;
 
-	fs = get_fs();
-	set_fs(get_ds());
 	down(&server->rcv.creq_sem);
 	__ncptcp_rcv_proc(server);
 	up(&server->rcv.creq_sem);
-	set_fs(fs);
-	return;
 }
 
-void ncp_tcp_tx_proc(void *s) {
-	mm_segment_t fs;
+void ncp_tcp_tx_proc(void *s)
+{
 	struct ncp_server *server = s;
 	
-	fs = get_fs();
-	set_fs(get_ds());
 	down(&server->rcv.creq_sem);
 	__ncptcp_try_send(server);
 	up(&server->rcv.creq_sem);
-	set_fs(fs);
-	return;
 }
 
 static int do_ncp_rpc_call(struct ncp_server *server, int size,
@@ -714,7 +680,7 @@ static int do_ncp_rpc_call(struct ncp_server *server, int size,
 	ncp_init_req(&req);
 	req.reply_buf = reply_buf;
 	req.datalen = max_reply_size;
-	req.tx_iov[1].iov_base = (void *) server->packet;
+	req.tx_iov[1].iov_base = server->packet;
 	req.tx_iov[1].iov_len = size;
 	req.tx_iovlen = 1;
 	req.tx_totallen = size;
@@ -748,7 +714,6 @@ static int ncp_do_request(struct ncp_server *server, int size,
 		return -EIO;
 	}
 	{
-		mm_segment_t fs;
 		sigset_t old_set;
 		unsigned long mask, flags;
 
@@ -773,13 +738,8 @@ static int ncp_do_request(struct ncp_server *server, int size,
 		recalc_sigpending();
 		spin_unlock_irqrestore(&current->sighand->siglock, flags);
 		
-		fs = get_fs();
-		set_fs(get_ds());
-
 		result = do_ncp_rpc_call(server, size, reply, max_reply_size);
 
-		set_fs(fs);
-
 		spin_lock_irqsave(&current->sighand->siglock, flags);
 		current->blocked = old_set;
 		recalc_sigpending();
diff --git a/fs/nfs/dir.c b/fs/nfs/dir.c
index b3a950c20..f061e70cd 100644
--- a/fs/nfs/dir.c
+++ b/fs/nfs/dir.c
@@ -1015,7 +1015,7 @@ static int nfs_create(struct inode *dir, struct dentry *dentry, int mode,
 	int error;
 	int open_flags = 0;
 
-	dfprintk(VFS, "NFS: create(%s/%ld, %s)\n", dir->i_sb->s_id,
+	dfprintk(VFS, "NFS: create(%s/%ld, %s\n", dir->i_sb->s_id, 
 		dir->i_ino, dentry->d_name.name);
 
 	attr.ia_mode = mode;
@@ -1032,12 +1032,9 @@ static int nfs_create(struct inode *dir, struct dentry *dentry, int mode,
 	 */
 	lock_kernel();
 	nfs_begin_data_update(dir);
-	dfprintk(VFS, "NFS: attr %d.%d #%d\n", attr.ia_uid, attr.ia_gid, attr.ia_xid);
 	inode = NFS_PROTO(dir)->create(dir, &dentry->d_name, &attr, open_flags);
 	nfs_end_data_update(dir);
 	if (!IS_ERR(inode)) {
-		dfprintk(VFS, "NFS: inode=%p %d.%d #%d\n", inode,
-			inode->i_uid, inode->i_gid, inode->i_xid);
 		d_instantiate(dentry, inode);
 		nfs_renew_times(dentry);
 		nfs_set_verifier(dentry, nfs_save_change_attribute(dir));
diff --git a/fs/nfs/direct.c b/fs/nfs/direct.c
index 77f051eef..e4e228ea9 100644
--- a/fs/nfs/direct.c
+++ b/fs/nfs/direct.c
@@ -475,7 +475,7 @@ nfs_file_direct_read(struct kiocb *iocb, char __user *buf, size_t count, loff_t
 	struct address_space *mapping = file->f_mapping;
 	struct inode *inode = mapping->host;
 	struct iovec iov = {
-		.iov_base = (char *)buf,
+		.iov_base = buf,
 		.iov_len = count,
 	};
 
diff --git a/fs/nfs/file.c b/fs/nfs/file.c
index 1ea93c580..ee2addb5c 100644
--- a/fs/nfs/file.c
+++ b/fs/nfs/file.c
@@ -33,16 +33,15 @@
 
 #define NFSDBG_FACILITY		NFSDBG_FILE
 
-static long nfs_file_fcntl(int fd, unsigned int cmd,
-			unsigned long arg, struct file *filp);
 static int nfs_file_open(struct inode *, struct file *);
 static int nfs_file_release(struct inode *, struct file *);
 static int  nfs_file_mmap(struct file *, struct vm_area_struct *);
-static ssize_t nfs_file_sendfile(struct file *, loff_t *, size_t, read_actor_t, void __user *);
+static ssize_t nfs_file_sendfile(struct file *, loff_t *, size_t, read_actor_t, void *);
 static ssize_t nfs_file_read(struct kiocb *, char __user *, size_t, loff_t);
 static ssize_t nfs_file_write(struct kiocb *, const char __user *, size_t, loff_t);
 static int  nfs_file_flush(struct file *);
 static int  nfs_fsync(struct file *, struct dentry *dentry, int datasync);
+static int nfs_check_flags(int flags);
 
 struct file_operations nfs_file_operations = {
 	.llseek		= remote_llseek,
@@ -57,7 +56,7 @@ struct file_operations nfs_file_operations = {
 	.fsync		= nfs_fsync,
 	.lock		= nfs_lock,
 	.sendfile	= nfs_file_sendfile,
-	.fcntl		= nfs_file_fcntl,
+	.check_flags	= nfs_check_flags,
 };
 
 struct inode_operations nfs_file_inode_operations = {
@@ -71,26 +70,12 @@ struct inode_operations nfs_file_inode_operations = {
 # define IS_SWAPFILE(inode)	(0)
 #endif
 
-#define nfs_invalid_flags	(O_APPEND | O_DIRECT)
-
-/*
- * Check for special cases that NFS doesn't support, and
- * pass the rest to the generic fcntl function.
- */
-static long
-nfs_file_fcntl(int fd, unsigned int cmd,
-		unsigned long arg, struct file *filp)
+static int nfs_check_flags(int flags)
 {
-	switch (cmd) {
-	case F_SETFL:
-		if ((filp->f_flags & nfs_invalid_flags) == nfs_invalid_flags)
-			return -EINVAL;
-		break;
-	default:
-		break;
-	}
+	if (flags & (O_APPEND | O_DIRECT))
+		return -EINVAL;
 
-	return generic_file_fcntl(fd, cmd, arg, filp);
+	return 0;
 }
 
 /*
@@ -101,10 +86,11 @@ nfs_file_open(struct inode *inode, struct file *filp)
 {
 	struct nfs_server *server = NFS_SERVER(inode);
 	int (*open)(struct inode *, struct file *);
-	int res = 0;
+	int res;
 
-	if ((filp->f_flags & nfs_invalid_flags) == nfs_invalid_flags)
-		return -EINVAL;
+	res = nfs_check_flags(filp->f_flags);
+	if (!res)
+		return res;
 
 	lock_kernel();
 	/* Do NFSv4 open() call */
@@ -171,7 +157,7 @@ nfs_file_read(struct kiocb *iocb, char __user * buf, size_t count, loff_t pos)
 
 static ssize_t
 nfs_file_sendfile(struct file *filp, loff_t *ppos, size_t count,
-		read_actor_t actor, void __user *target)
+		read_actor_t actor, void *target)
 {
 	struct dentry *dentry = filp->f_dentry;
 	struct inode *inode = dentry->d_inode;
diff --git a/fs/nfs/idmap.c b/fs/nfs/idmap.c
index 1d5d8a9db..b74c4e3a6 100644
--- a/fs/nfs/idmap.c
+++ b/fs/nfs/idmap.c
@@ -75,9 +75,10 @@ struct idmap {
 	struct idmap_hashtable idmap_group_hash;
 };
 
-static ssize_t   idmap_pipe_upcall(struct file *, struct rpc_pipe_msg *, char *,
-                     size_t);
-static ssize_t   idmap_pipe_downcall(struct file *, const char *, size_t);
+static ssize_t   idmap_pipe_upcall(struct file *, struct rpc_pipe_msg *,
+		     char __user *, size_t);
+static ssize_t   idmap_pipe_downcall(struct file *, const char __user *,
+		     size_t);
 void             idmap_pipe_destroy_msg(struct rpc_pipe_msg *);
 
 static unsigned int fnvhash32(const void *, size_t);
@@ -332,7 +333,7 @@ nfs_idmap_name(struct idmap *idmap, struct idmap_hashtable *h,
 /* RPC pipefs upcall/downcall routines */
 static ssize_t
 idmap_pipe_upcall(struct file *filp, struct rpc_pipe_msg *msg,
-    char *dst, size_t buflen)
+    char __user *dst, size_t buflen)
 {
         char *data = (char *)msg->data + msg->copied;
         ssize_t mlen = msg->len - msg->copied;
@@ -353,7 +354,7 @@ idmap_pipe_upcall(struct file *filp, struct rpc_pipe_msg *msg,
 }
 
 static ssize_t
-idmap_pipe_downcall(struct file *filp, const char *src, size_t mlen)
+idmap_pipe_downcall(struct file *filp, const char __user *src, size_t mlen)
 {
         struct rpc_inode *rpci = RPC_I(filp->f_dentry->d_inode);
 	struct idmap *idmap = (struct idmap *)rpci->private;
diff --git a/fs/nfs/inode.c b/fs/nfs/inode.c
index c04ca51a7..7f25c31fd 100644
--- a/fs/nfs/inode.c
+++ b/fs/nfs/inode.c
@@ -131,7 +131,6 @@ nfs_delete_inode(struct inode * inode)
 		printk(KERN_ERR "nfs_delete_inode: inode %ld has pending RPC requests\n", inode->i_ino);
 	}
 
-//	DLIMIT_FREE_INODE(inode->i_sb, inode->i_xid);
 	clear_inode(inode);
 }
 
@@ -391,6 +390,7 @@ nfs_create_client(struct nfs_server *server, const struct nfs_mount_data *data)
 	clnt->cl_intr     = (server->flags & NFS_MOUNT_INTR) ? 1 : 0;
 	clnt->cl_softrtry = (server->flags & NFS_MOUNT_SOFT) ? 1 : 0;
 	clnt->cl_droppriv = (server->flags & NFS_MOUNT_BROKEN_SUID) ? 1 : 0;
+	clnt->cl_tagxid   = (server->flags & NFS_MOUNT_TAGXID) ? 1 : 0;
 	clnt->cl_chatty   = 1;
 
 	return clnt;
@@ -461,7 +461,7 @@ nfs_fill_super(struct super_block *sb, struct nfs_mount_data *data, int silent)
 
 	/* Create RPC client handles */
 	server->client = nfs_create_client(server, data);
-	if (server->client == NULL)
+	if (IS_ERR(server->client))
 		goto out_fail;
 	/* RFC 2623, sec 2.3.2 */
 	if (authflavor != RPC_AUTH_UNIX) {
@@ -700,11 +700,6 @@ nfs_fhget(struct super_block *sb, struct nfs_fh *fh, struct nfs_fattr *fattr)
 	if (inode->i_state & I_NEW) {
 		struct nfs_inode *nfsi = NFS_I(inode);
 
-/*		if (DLIMIT_ALLOC_INODE(sb, inode->i_xid)) {
-			err = -ENOSPC;
-			goto fail_dlim;
-		}
-*/
 		/* We set i_ino for the few things that still rely on it,
 		 * such as stat(2) */
 		inode->i_ino = hash;
@@ -739,10 +734,9 @@ nfs_fhget(struct super_block *sb, struct nfs_fh *fh, struct nfs_fattr *fattr)
 			nfsi->change_attr = fattr->change_attr;
 		inode->i_size = nfs_size_to_loff_t(fattr->size);
 		inode->i_nlink = fattr->nlink;
-		inode->i_uid = INOXID_UID(fattr->uid, fattr->gid);
-		inode->i_gid = INOXID_GID(fattr->uid, fattr->gid);
-		if (inode->i_sb->s_flags & MS_TAGXID)
-			inode->i_xid = INOXID_XID(fattr->uid, fattr->gid, 0);
+		inode->i_uid = INOXID_UID(XID_TAG(inode), fattr->uid, fattr->gid);
+		inode->i_gid = INOXID_GID(XID_TAG(inode), fattr->uid, fattr->gid);
+		inode->i_xid = INOXID_XID(XID_TAG(inode), fattr->uid, fattr->gid, 0);
 					 /* maybe fattr->xid someday */
 		if (fattr->valid & (NFS_ATTR_FATTR_V3 | NFS_ATTR_FATTR_V4)) {
 			/*
@@ -1131,10 +1125,9 @@ int nfs_refresh_inode(struct inode *inode, struct nfs_fattr *fattr)
 	} else if (S_ISREG(inode->i_mode) && new_isize > cur_size)
 			nfsi->flags |= NFS_INO_INVALID_ATTR;
 
-	uid = INOXID_UID(fattr->uid, fattr->gid);
-	gid = INOXID_GID(fattr->uid, fattr->gid);
-	if (inode->i_sb->s_flags & MS_TAGXID)
-		xid = INOXID_XID(fattr->uid, fattr->gid, 0);
+	uid = INOXID_UID(XID_TAG(inode), fattr->uid, fattr->gid);
+	gid = INOXID_GID(XID_TAG(inode), fattr->uid, fattr->gid);
+	xid = INOXID_XID(XID_TAG(inode), fattr->uid, fattr->gid, 0);
 
 	/* Have any file permissions changed? */
 	if ((inode->i_mode & S_IALLUGO) != (fattr->mode & S_IALLUGO)
@@ -1259,10 +1252,9 @@ static int nfs_update_inode(struct inode *inode, struct nfs_fattr *fattr, unsign
 	memcpy(&inode->i_ctime, &fattr->ctime, sizeof(inode->i_ctime));
 	memcpy(&inode->i_atime, &fattr->atime, sizeof(inode->i_atime));
 
-	uid = INOXID_UID(fattr->uid, fattr->gid);
-	gid = INOXID_GID(fattr->uid, fattr->gid);
-	if (inode->i_sb->s_flags & MS_TAGXID)
-		xid = INOXID_XID(fattr->uid, fattr->gid, 0);
+	uid = INOXID_UID(XID_TAG(inode), fattr->uid, fattr->gid);
+	gid = INOXID_GID(XID_TAG(inode), fattr->uid, fattr->gid);
+	xid = INOXID_XID(XID_TAG(inode), fattr->uid, fattr->gid, 0);
 
 	if ((inode->i_mode & S_IALLUGO) != (fattr->mode & S_IALLUGO) ||
 	    inode->i_uid != uid ||
@@ -1591,16 +1583,17 @@ static int nfs4_fill_super(struct super_block *sb, struct nfs4_mount_data *data,
 		err = PTR_ERR(clnt);
 		goto out_remove_list;
 	}
+
+	clnt->cl_intr     = (server->flags & NFS4_MOUNT_INTR) ? 1 : 0;
+	clnt->cl_softrtry = (server->flags & NFS4_MOUNT_SOFT) ? 1 : 0;
+	server->client    = clnt;
+
 	err = -ENOMEM;
 	if (server->nfs4_state->cl_idmap == NULL) {
 		printk(KERN_WARNING "NFS: failed to create idmapper.\n");
 		goto out_shutdown;
 	}
 
-	clnt->cl_intr     = (server->flags & NFS4_MOUNT_INTR) ? 1 : 0;
-	clnt->cl_softrtry = (server->flags & NFS4_MOUNT_SOFT) ? 1 : 0;
-	server->client    = clnt;
-
 	if (clnt->cl_auth->au_flavor != authflavour) {
 		if (rpcauth_create(authflavour, clnt) == NULL) {
 			printk(KERN_WARNING "NFS: couldn't create credcache!\n");
diff --git a/fs/nfs/nfs2xdr.c b/fs/nfs/nfs2xdr.c
index 6a324838f..01aebbf13 100644
--- a/fs/nfs/nfs2xdr.c
+++ b/fs/nfs/nfs2xdr.c
@@ -231,7 +231,7 @@ nfs_xdr_readargs(struct rpc_rqst *req, u32 *p, struct nfs_readargs *args)
 static int
 nfs_xdr_readres(struct rpc_rqst *req, u32 *p, struct nfs_readres *res)
 {
-	struct iovec *iov = req->rq_rcv_buf.head;
+	struct kvec *iov = req->rq_rcv_buf.head;
 	int	status, count, recvd, hdrlen;
 
 	if ((status = ntohl(*p++)))
@@ -375,7 +375,7 @@ static int
 nfs_xdr_readdirres(struct rpc_rqst *req, u32 *p, void *dummy)
 {
 	struct xdr_buf *rcvbuf = &req->rq_rcv_buf;
-	struct iovec *iov = rcvbuf->head;
+	struct kvec *iov = rcvbuf->head;
 	struct page **page;
 	int hdrlen, recvd;
 	int status, nr;
@@ -530,7 +530,7 @@ static int
 nfs_xdr_readlinkres(struct rpc_rqst *req, u32 *p, void *dummy)
 {
 	struct xdr_buf *rcvbuf = &req->rq_rcv_buf;
-	struct iovec *iov = rcvbuf->head;
+	struct kvec *iov = rcvbuf->head;
 	unsigned int hdrlen;
 	u32	*strlen, len;
 	char	*string;
diff --git a/fs/nfs/nfs3xdr.c b/fs/nfs/nfs3xdr.c
index 4708e632a..ebfc60759 100644
--- a/fs/nfs/nfs3xdr.c
+++ b/fs/nfs/nfs3xdr.c
@@ -178,7 +178,7 @@ xdr_decode_fattr(u32 *p, struct nfs_fattr *fattr)
 }
 
 static inline u32 *
-xdr_encode_sattr(u32 *p, struct iattr *attr)
+xdr_encode_sattr(u32 *p, struct iattr *attr, int tagxid)
 {
 	if (attr->ia_valid & ATTR_MODE) {
 		*p++ = xdr_one;
@@ -186,15 +186,17 @@ xdr_encode_sattr(u32 *p, struct iattr *attr)
 	} else {
 		*p++ = xdr_zero;
 	}
-	if (attr->ia_valid & ATTR_UID || attr->ia_valid & ATTR_XID) {
+	if (attr->ia_valid & ATTR_UID ||
+		(tagxid && (attr->ia_valid & ATTR_XID))) {
 		*p++ = xdr_one;
-		*p++ = htonl(XIDINO_UID(attr->ia_uid, attr->ia_xid));
+		*p++ = htonl(XIDINO_UID(tagxid, attr->ia_uid, attr->ia_xid));
 	} else {
 		*p++ = xdr_zero;
 	}
-	if (attr->ia_valid & ATTR_GID || attr->ia_valid & ATTR_XID) {
+	if (attr->ia_valid & ATTR_GID ||
+		(tagxid && (attr->ia_valid & ATTR_XID))) {
 		*p++ = xdr_one;
-		*p++ = htonl(XIDINO_GID(attr->ia_gid, attr->ia_xid));
+		*p++ = htonl(XIDINO_GID(tagxid, attr->ia_gid, attr->ia_xid));
 	} else {
 		*p++ = xdr_zero;
 	}
@@ -279,7 +281,8 @@ static int
 nfs3_xdr_sattrargs(struct rpc_rqst *req, u32 *p, struct nfs3_sattrargs *args)
 {
 	p = xdr_encode_fhandle(p, args->fh);
-	p = xdr_encode_sattr(p, args->sattr);
+	p = xdr_encode_sattr(p, args->sattr,
+		req->rq_task->tk_client->cl_tagxid);
 	*p++ = htonl(args->guard);
 	if (args->guard)
 		p = xdr_encode_time3(p, &args->guardtime);
@@ -370,7 +373,8 @@ nfs3_xdr_createargs(struct rpc_rqst *req, u32 *p, struct nfs3_createargs *args)
 		*p++ = args->verifier[0];
 		*p++ = args->verifier[1];
 	} else
-		p = xdr_encode_sattr(p, args->sattr);
+		p = xdr_encode_sattr(p, args->sattr,
+			req->rq_task->tk_client->cl_tagxid);
 
 	req->rq_slen = xdr_adjust_iovec(req->rq_svec, p);
 	return 0;
@@ -384,7 +388,8 @@ nfs3_xdr_mkdirargs(struct rpc_rqst *req, u32 *p, struct nfs3_mkdirargs *args)
 {
 	p = xdr_encode_fhandle(p, args->fh);
 	p = xdr_encode_array(p, args->name, args->len);
-	p = xdr_encode_sattr(p, args->sattr);
+	p = xdr_encode_sattr(p, args->sattr,
+		req->rq_task->tk_client->cl_tagxid);
 	req->rq_slen = xdr_adjust_iovec(req->rq_svec, p);
 	return 0;
 }
@@ -397,7 +402,8 @@ nfs3_xdr_symlinkargs(struct rpc_rqst *req, u32 *p, struct nfs3_symlinkargs *args
 {
 	p = xdr_encode_fhandle(p, args->fromfh);
 	p = xdr_encode_array(p, args->fromname, args->fromlen);
-	p = xdr_encode_sattr(p, args->sattr);
+	p = xdr_encode_sattr(p, args->sattr,
+		req->rq_task->tk_client->cl_tagxid);
 	p = xdr_encode_array(p, args->topath, args->tolen);
 	req->rq_slen = xdr_adjust_iovec(req->rq_svec, p);
 	return 0;
@@ -412,7 +418,8 @@ nfs3_xdr_mknodargs(struct rpc_rqst *req, u32 *p, struct nfs3_mknodargs *args)
 	p = xdr_encode_fhandle(p, args->fh);
 	p = xdr_encode_array(p, args->name, args->len);
 	*p++ = htonl(args->type);
-	p = xdr_encode_sattr(p, args->sattr);
+	p = xdr_encode_sattr(p, args->sattr,
+		req->rq_task->tk_client->cl_tagxid);
 	if (args->type == NF3CHR || args->type == NF3BLK) {
 		*p++ = htonl(MAJOR(args->rdev));
 		*p++ = htonl(MINOR(args->rdev));
@@ -485,7 +492,7 @@ static int
 nfs3_xdr_readdirres(struct rpc_rqst *req, u32 *p, struct nfs3_readdirres *res)
 {
 	struct xdr_buf *rcvbuf = &req->rq_rcv_buf;
-	struct iovec *iov = rcvbuf->head;
+	struct kvec *iov = rcvbuf->head;
 	struct page **page;
 	int hdrlen, recvd;
 	int status, nr;
@@ -722,7 +729,7 @@ static int
 nfs3_xdr_readlinkres(struct rpc_rqst *req, u32 *p, struct nfs_fattr *fattr)
 {
 	struct xdr_buf *rcvbuf = &req->rq_rcv_buf;
-	struct iovec *iov = rcvbuf->head;
+	struct kvec *iov = rcvbuf->head;
 	unsigned int hdrlen;
 	u32	*strlen, len;
 	char	*string;
@@ -762,7 +769,7 @@ nfs3_xdr_readlinkres(struct rpc_rqst *req, u32 *p, struct nfs_fattr *fattr)
 static int
 nfs3_xdr_readres(struct rpc_rqst *req, u32 *p, struct nfs_readres *res)
 {
-	struct iovec *iov = req->rq_rcv_buf.head;
+	struct kvec *iov = req->rq_rcv_buf.head;
 	int	status, count, ocount, recvd, hdrlen;
 
 	status = ntohl(*p++);
diff --git a/fs/nfs/nfs4proc.c b/fs/nfs/nfs4proc.c
index 6060f32d7..2eb124475 100644
--- a/fs/nfs/nfs4proc.c
+++ b/fs/nfs/nfs4proc.c
@@ -387,7 +387,7 @@ retry:
         fattr->valid = 0;
 
 	if (sattr->ia_valid & ATTR_SIZE)
-		nfs4_copy_stateid(&arg.stateid, state, 0);
+		nfs4_copy_stateid(&arg.stateid, state, NULL);
 	else
 		memcpy(&arg.stateid, &zero_stateid, sizeof(arg.stateid));
 
diff --git a/fs/nfs/nfs4xdr.c b/fs/nfs/nfs4xdr.c
index a2cd1178e..a14079f53 100644
--- a/fs/nfs/nfs4xdr.c
+++ b/fs/nfs/nfs4xdr.c
@@ -933,7 +933,7 @@ static int encode_readdir(struct xdr_stream *xdr, const struct nfs4_readdir_arg
 	WRITE32(FATTR4_WORD0_FILEID);
 	WRITE32(0);
 
-	/* set up reply iovec
+	/* set up reply kvec
 	 *    toplevel_status + taglen + rescount + OP_PUTFH + status
 	 *      + OP_READDIR + status + verifer(2)  = 9
 	 */
@@ -954,7 +954,7 @@ static int encode_readlink(struct xdr_stream *xdr, const struct nfs4_readlink *r
 	RESERVE_SPACE(4);
 	WRITE32(OP_READLINK);
 
-	/* set up reply iovec
+	/* set up reply kvec
 	 *    toplevel_status + taglen + rescount + OP_PUTFH + status
 	 *      + OP_READLINK + status  = 7
 	 */
@@ -1501,7 +1501,7 @@ static int nfs4_xdr_enc_read(struct rpc_rqst *req, uint32_t *p, struct nfs_reada
 	if (status)
 		goto out;
 
-	/* set up reply iovec
+	/* set up reply kvec
 	 *    toplevel status + taglen=0 + rescount + OP_PUTFH + status
 	 *       + OP_READ + status + eof + datalen = 9
 	 */
@@ -2785,7 +2785,7 @@ static int decode_putrootfh(struct xdr_stream *xdr)
 
 static int decode_read(struct xdr_stream *xdr, struct rpc_rqst *req, struct nfs_readres *res)
 {
-	struct iovec *iov = req->rq_rcv_buf.head;
+	struct kvec *iov = req->rq_rcv_buf.head;
 	uint32_t *p;
 	uint32_t count, eof, recvd, hdrlen;
 	int status;
@@ -2814,7 +2814,7 @@ static int decode_readdir(struct xdr_stream *xdr, struct rpc_rqst *req, struct n
 {
 	struct xdr_buf	*rcvbuf = &req->rq_rcv_buf;
 	struct page	*page = *rcvbuf->pages;
-	struct iovec	*iov = rcvbuf->head;
+	struct kvec	*iov = rcvbuf->head;
 	unsigned int	nr, pglen = rcvbuf->page_len;
 	uint32_t	*end, *entry, *p, *kaddr;
 	uint32_t	len, attrlen, word;
@@ -2897,7 +2897,7 @@ err_unmap:
 static int decode_readlink(struct xdr_stream *xdr, struct rpc_rqst *req)
 {
 	struct xdr_buf *rcvbuf = &req->rq_rcv_buf;
-	struct iovec *iov = rcvbuf->head;
+	struct kvec *iov = rcvbuf->head;
 	uint32_t *strlen;
 	unsigned int hdrlen, len;
 	char *string;
diff --git a/fs/nfs/proc.c b/fs/nfs/proc.c
index 171a34a87..8dc6a981c 100644
--- a/fs/nfs/proc.c
+++ b/fs/nfs/proc.c
@@ -244,9 +244,6 @@ nfs_proc_create(struct inode *dir, struct qstr *name, struct iattr *sattr,
 	int			status;
 
 	fattr.valid = 0;
-	memset(&fattr, 0, sizeof(struct nfs_fattr));
-
-
 	dprintk("NFS call  create %s\n", name->name);
 	status = rpc_call(NFS_CLIENT(dir), NFSPROC_CREATE, &arg, &res, 0);
 	dprintk("NFS reply create: %d\n", status);
diff --git a/fs/nfsctl.c b/fs/nfsctl.c
index 12472dd2a..aaf9f5640 100644
--- a/fs/nfsctl.c
+++ b/fs/nfsctl.c
@@ -32,6 +32,7 @@ static struct file *do_open(char *name, int flags)
 	nd.dentry = dget(nd.mnt->mnt_root);
 	nd.last_type = LAST_ROOT;
 	nd.flags = 0;
+	nd.depth = 0;
 
 	error = path_walk(name, &nd);
 	if (error)
diff --git a/fs/nfsd/auth.c b/fs/nfsd/auth.c
index 05822ee82..8d35f45d9 100644
--- a/fs/nfsd/auth.c
+++ b/fs/nfsd/auth.c
@@ -43,20 +43,20 @@ int nfsd_setuser(struct svc_rqst *rqstp, struct svc_export *exp)
 	}
 
 	if (cred->cr_uid != (uid_t) -1)
-		current->fsuid = INOXID_UID(cred->cr_uid, cred->cr_gid);
+		current->fsuid = INOXID_UID(1, cred->cr_uid, cred->cr_gid);
 	else
 		current->fsuid = exp->ex_anon_uid;
 	if (cred->cr_gid != (gid_t) -1)
-		current->fsgid = INOXID_GID(cred->cr_uid, cred->cr_gid);
+		current->fsgid = INOXID_GID(1, cred->cr_uid, cred->cr_gid);
 	else
 		current->fsgid = exp->ex_anon_gid;
 	
-	current->xid = INOXID_XID(cred->cr_uid, cred->cr_gid, 0);
+	current->xid = INOXID_XID(1, cred->cr_uid, cred->cr_gid, 0);
 
 	if (!cred->cr_group_info)
 		return -ENOMEM;
 	ret = set_current_groups(cred->cr_group_info);
-	if ((cred->cr_uid)) {
+	if (INOXID_UID(1, cred->cr_uid, cred->cr_gid)) {
 		cap_t(current->cap_effective) &= ~CAP_NFSD_MASK;
 	} else {
 		cap_t(current->cap_effective) |= (CAP_NFSD_MASK &
diff --git a/fs/nfsd/nfs3xdr.c b/fs/nfsd/nfs3xdr.c
index a45bd68c3..d102365fa 100644
--- a/fs/nfsd/nfs3xdr.c
+++ b/fs/nfsd/nfs3xdr.c
@@ -75,7 +75,7 @@ decode_fh(u32 *p, struct svc_fh *fhp)
 static inline u32 *
 encode_fh(u32 *p, struct svc_fh *fhp)
 {
-	int size = fhp->fh_handle.fh_size;
+	unsigned int size = fhp->fh_handle.fh_size;
 	*p++ = htonl(size);
 	if (size) p[XDR_QUADLEN(size)-1]=0;
 	memcpy(p, &fhp->fh_handle.fh_base, size);
@@ -122,6 +122,8 @@ static inline u32 *
 decode_sattr3(u32 *p, struct iattr *iap)
 {
 	u32	tmp;
+	uid_t	uid = 0;
+	gid_t	gid = 0;
 
 	iap->ia_valid = 0;
 
@@ -131,12 +133,15 @@ decode_sattr3(u32 *p, struct iattr *iap)
 	}
 	if (*p++) {
 		iap->ia_valid |= ATTR_UID;
-		iap->ia_uid = ntohl(*p++);
+		uid = ntohl(*p++);
 	}
 	if (*p++) {
 		iap->ia_valid |= ATTR_GID;
-		iap->ia_gid = ntohl(*p++);
+		gid = ntohl(*p++);
 	}
+	iap->ia_uid = INOXID_UID(1, uid, gid);
+	iap->ia_gid = INOXID_GID(1, uid, gid);
+	iap->ia_xid = INOXID_XID(1, uid, gid, 0);
 	if (*p++) {
 		u64	newsize;
 
@@ -178,9 +183,9 @@ encode_fattr3(struct svc_rqst *rqstp, u32 *p, struct svc_fh *fhp)
 	*p++ = htonl((u32) stat.mode);
 	*p++ = htonl((u32) stat.nlink);
 	*p++ = htonl((u32) nfsd_ruid(rqstp,
-		XIDINO_UID(stat.uid, stat.xid)));
+		XIDINO_UID(XID_TAG(dentry->d_inode), stat.uid, stat.xid)));
 	*p++ = htonl((u32) nfsd_rgid(rqstp,
-		XIDINO_GID(stat.gid, stat.xid)));
+		XIDINO_GID(XID_TAG(dentry->d_inode), stat.gid, stat.xid)));
 	if (S_ISLNK(stat.mode) && stat.size > NFS3_MAXPATHLEN) {
 		p = xdr_encode_hyper(p, (u64) NFS3_MAXPATHLEN);
 	} else {
@@ -331,7 +336,7 @@ int
 nfs3svc_decode_readargs(struct svc_rqst *rqstp, u32 *p,
 					struct nfsd3_readargs *args)
 {
-	int len;
+	unsigned int len;
 	int v,pn;
 
 	if (!(p = decode_fh(p, &args->fh))
@@ -343,15 +348,15 @@ nfs3svc_decode_readargs(struct svc_rqst *rqstp, u32 *p,
 	if (len > NFSSVC_MAXBLKSIZE)
 		len = NFSSVC_MAXBLKSIZE;
 
-	/* set up the iovec */
+	/* set up the kvec */
 	v=0;
 	while (len > 0) {
 		pn = rqstp->rq_resused;
 		svc_take_page(rqstp);
 		args->vec[v].iov_base = page_address(rqstp->rq_respages[pn]);
 		args->vec[v].iov_len = len < PAGE_SIZE? len : PAGE_SIZE;
+		len -= args->vec[v].iov_len;
 		v++;
-		len -= PAGE_SIZE;
 	}
 	args->vlen = v;
 	return xdr_argsize_check(rqstp, p);
@@ -361,7 +366,7 @@ int
 nfs3svc_decode_writeargs(struct svc_rqst *rqstp, u32 *p,
 					struct nfsd3_writeargs *args)
 {
-	int len, v;
+	unsigned int len, v, hdr;
 
 	if (!(p = decode_fh(p, &args->fh))
 	 || !(p = xdr_decode_hyper(p, &args->offset)))
@@ -371,9 +376,12 @@ nfs3svc_decode_writeargs(struct svc_rqst *rqstp, u32 *p,
 	args->stable = ntohl(*p++);
 	len = args->len = ntohl(*p++);
 
+	hdr = (void*)p - rqstp->rq_arg.head[0].iov_base;
+	if (rqstp->rq_arg.len < len + hdr)
+		return 0;
+
 	args->vec[0].iov_base = (void*)p;
-	args->vec[0].iov_len = rqstp->rq_arg.head[0].iov_len -
-		(((void*)p) - rqstp->rq_arg.head[0].iov_base);
+	args->vec[0].iov_len = rqstp->rq_arg.head[0].iov_len - hdr;
 
 	if (len > NFSSVC_MAXBLKSIZE)
 		len = NFSSVC_MAXBLKSIZE;
@@ -430,10 +438,10 @@ int
 nfs3svc_decode_symlinkargs(struct svc_rqst *rqstp, u32 *p,
 					struct nfsd3_symlinkargs *args)
 {
-	int len;
+	unsigned int len;
 	int avail;
 	char *old, *new;
-	struct iovec *vec;
+	struct kvec *vec;
 
 	if (!(p = decode_fh(p, &args->ffh))
 	 || !(p = decode_filename(p, &args->fname, &args->flen))
@@ -447,7 +455,7 @@ nfs3svc_decode_symlinkargs(struct svc_rqst *rqstp, u32 *p,
 	 */
 	svc_take_page(rqstp);
 	len = ntohl(*p++);
-	if (len <= 0 || len > NFS3_MAXPATHLEN || len >= PAGE_SIZE)
+	if (len == 0 || len > NFS3_MAXPATHLEN || len >= PAGE_SIZE)
 		return 0;
 	args->tname = new = page_address(rqstp->rq_respages[rqstp->rq_resused-1]);
 	args->tlen = len;
diff --git a/fs/nfsd/nfs4proc.c b/fs/nfsd/nfs4proc.c
index d54c85ade..ff8c203e0 100644
--- a/fs/nfsd/nfs4proc.c
+++ b/fs/nfsd/nfs4proc.c
@@ -135,9 +135,11 @@ do_open_fhandle(struct svc_rqst *rqstp, struct svc_fh *current_fh, struct nfsd4_
 {
 	int status;
 
-	dprintk("NFSD: do_open_fhandle\n");
+	/* Only reclaims from previously confirmed clients are valid */
+	if ((status = nfs4_check_open_reclaim(&open->op_clientid)))
+		return status;
 
-	/* we don't know the target directory, and therefore can not
+	/* We don't know the target directory, and therefore can not
 	* set the change info
 	*/
 
@@ -172,8 +174,7 @@ nfsd4_open(struct svc_rqst *rqstp, struct svc_fh *current_fh, struct nfsd4_open
 	if (nfs4_in_grace() && open->op_claim_type != NFS4_OPEN_CLAIM_PREVIOUS)
 		return nfserr_grace;
 
-	if (nfs4_in_no_grace() &&
-		           open->op_claim_type == NFS4_OPEN_CLAIM_PREVIOUS)
+	if (!nfs4_in_grace() && open->op_claim_type == NFS4_OPEN_CLAIM_PREVIOUS)
 		return nfserr_no_grace;
 
 	/* This check required by spec. */
@@ -318,7 +319,7 @@ nfsd4_commit(struct svc_rqst *rqstp, struct svc_fh *current_fh, struct nfsd4_com
 	return status;
 }
 
-static inline int
+static int
 nfsd4_create(struct svc_rqst *rqstp, struct svc_fh *current_fh, struct nfsd4_create *create)
 {
 	struct svc_fh resfh;
@@ -435,7 +436,7 @@ nfsd4_link(struct svc_rqst *rqstp, struct svc_fh *current_fh,
 	return status;
 }
 
-static inline int
+static int
 nfsd4_lookupp(struct svc_rqst *rqstp, struct svc_fh *current_fh)
 {
 	struct svc_fh tmp_fh;
@@ -773,13 +774,20 @@ nfsd4_proc_compound(struct svc_rqst *rqstp,
 		    struct nfsd4_compoundres *resp)
 {
 	struct nfsd4_op	*op;
-	struct svc_fh	current_fh;
-	struct svc_fh	save_fh;
+	struct svc_fh	*current_fh = NULL;
+	struct svc_fh	*save_fh = NULL;
 	int		slack_space;    /* in words, not bytes! */
 	int		status;
 
-	fh_init(&current_fh, NFS4_FHSIZE);
-	fh_init(&save_fh, NFS4_FHSIZE);
+	status = nfserr_resource;
+	current_fh = kmalloc(sizeof(*current_fh), GFP_KERNEL);
+	if (current_fh == NULL)
+		goto out;
+	fh_init(current_fh, NFS4_FHSIZE);
+	save_fh = kmalloc(sizeof(*save_fh), GFP_KERNEL);
+	if (save_fh == NULL)
+		goto out;
+	fh_init(save_fh, NFS4_FHSIZE);
 
 	resp->xbuf = &rqstp->rq_res;
 	resp->p = rqstp->rq_res.head[0].iov_base + rqstp->rq_res.head[0].iov_len;
@@ -831,7 +839,7 @@ nfsd4_proc_compound(struct svc_rqst *rqstp,
 		* SETATTR NOFILEHANDLE error handled in nfsd4_setattr
 		* due to required returned bitmap argument
 		*/
-		if ((!current_fh.fh_dentry) &&
+		if ((!current_fh->fh_dentry) &&
 		   !((op->opnum == OP_PUTFH) || (op->opnum == OP_PUTROOTFH) ||
 		   (op->opnum == OP_SETCLIENTID) ||
 		   (op->opnum == OP_SETCLIENTID_CONFIRM) ||
@@ -843,105 +851,105 @@ nfsd4_proc_compound(struct svc_rqst *rqstp,
 		}
 		switch (op->opnum) {
 		case OP_ACCESS:
-			op->status = nfsd4_access(rqstp, &current_fh, &op->u.access);
+			op->status = nfsd4_access(rqstp, current_fh, &op->u.access);
 			break;
 		case OP_CLOSE:
-			op->status = nfsd4_close(rqstp, &current_fh, &op->u.close);
+			op->status = nfsd4_close(rqstp, current_fh, &op->u.close);
 			if (op->u.close.cl_stateowner)
 				op->replay =
 					&op->u.close.cl_stateowner->so_replay;
 			break;
 		case OP_COMMIT:
-			op->status = nfsd4_commit(rqstp, &current_fh, &op->u.commit);
+			op->status = nfsd4_commit(rqstp, current_fh, &op->u.commit);
 			break;
 		case OP_CREATE:
-			op->status = nfsd4_create(rqstp, &current_fh, &op->u.create);
+			op->status = nfsd4_create(rqstp, current_fh, &op->u.create);
 			break;
 		case OP_GETATTR:
-			op->status = nfsd4_getattr(rqstp, &current_fh, &op->u.getattr);
+			op->status = nfsd4_getattr(rqstp, current_fh, &op->u.getattr);
 			break;
 		case OP_GETFH:
-			op->status = nfsd4_getfh(&current_fh, &op->u.getfh);
+			op->status = nfsd4_getfh(current_fh, &op->u.getfh);
 			break;
 		case OP_LINK:
-			op->status = nfsd4_link(rqstp, &current_fh, &save_fh, &op->u.link);
+			op->status = nfsd4_link(rqstp, current_fh, save_fh, &op->u.link);
 			break;
 		case OP_LOCK:
-			op->status = nfsd4_lock(rqstp, &current_fh, &op->u.lock);
+			op->status = nfsd4_lock(rqstp, current_fh, &op->u.lock);
 			if (op->u.lock.lk_stateowner)
 				op->replay =
 					&op->u.lock.lk_stateowner->so_replay;
 			break;
 		case OP_LOCKT:
-			op->status = nfsd4_lockt(rqstp, &current_fh, &op->u.lockt);
+			op->status = nfsd4_lockt(rqstp, current_fh, &op->u.lockt);
 			break;
 		case OP_LOCKU:
-			op->status = nfsd4_locku(rqstp, &current_fh, &op->u.locku);
+			op->status = nfsd4_locku(rqstp, current_fh, &op->u.locku);
 			if (op->u.locku.lu_stateowner)
 				op->replay =
 					&op->u.locku.lu_stateowner->so_replay;
 			break;
 		case OP_LOOKUP:
-			op->status = nfsd4_lookup(rqstp, &current_fh, &op->u.lookup);
+			op->status = nfsd4_lookup(rqstp, current_fh, &op->u.lookup);
 			break;
 		case OP_LOOKUPP:
-			op->status = nfsd4_lookupp(rqstp, &current_fh);
+			op->status = nfsd4_lookupp(rqstp, current_fh);
 			break;
 		case OP_NVERIFY:
-			op->status = nfsd4_verify(rqstp, &current_fh, &op->u.nverify);
+			op->status = nfsd4_verify(rqstp, current_fh, &op->u.nverify);
 			if (op->status == nfserr_not_same)
 				op->status = nfs_ok;
 			break;
 		case OP_OPEN:
-			op->status = nfsd4_open(rqstp, &current_fh, &op->u.open);
+			op->status = nfsd4_open(rqstp, current_fh, &op->u.open);
 			if (op->u.open.op_stateowner)
 				op->replay =
 					&op->u.open.op_stateowner->so_replay;
 			break;
 		case OP_OPEN_CONFIRM:
-			op->status = nfsd4_open_confirm(rqstp, &current_fh, &op->u.open_confirm);
+			op->status = nfsd4_open_confirm(rqstp, current_fh, &op->u.open_confirm);
 			if (op->u.open_confirm.oc_stateowner)
 				op->replay =
 					&op->u.open_confirm.oc_stateowner->so_replay;
 			break;
 		case OP_OPEN_DOWNGRADE:
-			op->status = nfsd4_open_downgrade(rqstp, &current_fh, &op->u.open_downgrade);
+			op->status = nfsd4_open_downgrade(rqstp, current_fh, &op->u.open_downgrade);
 			if (op->u.open_downgrade.od_stateowner)
 				op->replay =
 					&op->u.open_downgrade.od_stateowner->so_replay;
 			break;
 		case OP_PUTFH:
-			op->status = nfsd4_putfh(rqstp, &current_fh, &op->u.putfh);
+			op->status = nfsd4_putfh(rqstp, current_fh, &op->u.putfh);
 			break;
 		case OP_PUTROOTFH:
-			op->status = nfsd4_putrootfh(rqstp, &current_fh);
+			op->status = nfsd4_putrootfh(rqstp, current_fh);
 			break;
 		case OP_READ:
-			op->status = nfsd4_read(rqstp, &current_fh, &op->u.read);
+			op->status = nfsd4_read(rqstp, current_fh, &op->u.read);
 			break;
 		case OP_READDIR:
-			op->status = nfsd4_readdir(rqstp, &current_fh, &op->u.readdir);
+			op->status = nfsd4_readdir(rqstp, current_fh, &op->u.readdir);
 			break;
 		case OP_READLINK:
-			op->status = nfsd4_readlink(rqstp, &current_fh, &op->u.readlink);
+			op->status = nfsd4_readlink(rqstp, current_fh, &op->u.readlink);
 			break;
 		case OP_REMOVE:
-			op->status = nfsd4_remove(rqstp, &current_fh, &op->u.remove);
+			op->status = nfsd4_remove(rqstp, current_fh, &op->u.remove);
 			break;
 		case OP_RENAME:
-			op->status = nfsd4_rename(rqstp, &current_fh, &save_fh, &op->u.rename);
+			op->status = nfsd4_rename(rqstp, current_fh, save_fh, &op->u.rename);
 			break;
 		case OP_RENEW:
 			op->status = nfsd4_renew(&op->u.renew);
 			break;
 		case OP_RESTOREFH:
-			op->status = nfsd4_restorefh(&current_fh, &save_fh);
+			op->status = nfsd4_restorefh(current_fh, save_fh);
 			break;
 		case OP_SAVEFH:
-			op->status = nfsd4_savefh(&current_fh, &save_fh);
+			op->status = nfsd4_savefh(current_fh, save_fh);
 			break;
 		case OP_SETATTR:
-			op->status = nfsd4_setattr(rqstp, &current_fh, &op->u.setattr);
+			op->status = nfsd4_setattr(rqstp, current_fh, &op->u.setattr);
 			break;
 		case OP_SETCLIENTID:
 			op->status = nfsd4_setclientid(rqstp, &op->u.setclientid);
@@ -950,12 +958,12 @@ nfsd4_proc_compound(struct svc_rqst *rqstp,
 			op->status = nfsd4_setclientid_confirm(rqstp, &op->u.setclientid_confirm);
 			break;
 		case OP_VERIFY:
-			op->status = nfsd4_verify(rqstp, &current_fh, &op->u.verify);
+			op->status = nfsd4_verify(rqstp, current_fh, &op->u.verify);
 			if (op->status == nfserr_same)
 				op->status = nfs_ok;
 			break;
 		case OP_WRITE:
-			op->status = nfsd4_write(rqstp, &current_fh, &op->u.write);
+			op->status = nfsd4_write(rqstp, current_fh, &op->u.write);
 			break;
 		case OP_RELEASE_LOCKOWNER:
 			op->status = nfsd4_release_lockowner(rqstp, &op->u.release_lockowner);
@@ -976,22 +984,13 @@ encode_op:
 	}
 
 out:
-	if (args->ops != args->iops) {
-		kfree(args->ops);
-		args->ops = args->iops;
-	}
-	if (args->tmpp) {
-		kfree(args->tmpp);
-		args->tmpp = NULL;
-	}
-	while (args->to_free) {
-		struct tmpbuf *tb = args->to_free;
-		args->to_free = tb->next;
-		kfree(tb->buf);
-		kfree(tb);
-	}
-	fh_put(&current_fh);
-	fh_put(&save_fh);
+	nfsd4_release_compoundargs(args);
+	if (current_fh)
+		fh_put(current_fh);
+	kfree(current_fh);
+	if (save_fh)
+		fh_put(save_fh);
+	kfree(save_fh);
 	return status;
 }
 
diff --git a/fs/nfsd/nfs4state.c b/fs/nfsd/nfs4state.c
index 848c4851d..0ff4425ca 100644
--- a/fs/nfsd/nfs4state.c
+++ b/fs/nfsd/nfs4state.c
@@ -51,6 +51,9 @@
 #define NFSDDBG_FACILITY                NFSDDBG_PROC
 
 /* Globals */
+static time_t lease_time = 90;     /* default lease time */
+static time_t old_lease_time = 90; /* past incarnation lease time */
+static u32 nfs4_reclaim_init = 0;
 time_t boot_time;
 static time_t grace_end = 0;
 static u32 current_clientid = 1;
@@ -82,7 +85,7 @@ struct nfs4_stateid * find_stateid(stateid_t *stid, int flags);
  * 	protects clientid_hashtbl[], clientstr_hashtbl[],
  * 	unconfstr_hashtbl[], uncofid_hashtbl[].
  */
-static struct semaphore client_sema;
+static DECLARE_MUTEX(client_sema);
 
 void
 nfs4_lock_state(void)
@@ -131,8 +134,11 @@ static void release_file(struct nfs4_file *fp);
 	((id) & CLIENT_HASH_MASK)
 #define clientstr_hashval(name, namelen) \
 	(opaque_hashval((name), (namelen)) & CLIENT_HASH_MASK)
-
-/* conf_id_hashtbl[], and conf_str_hashtbl[] hold confirmed
+/*
+ * reclaim_str_hashtbl[] holds known client info from previous reset/reboot
+ * used in reboot/reset lease grace period processing
+ *
+ * conf_id_hashtbl[], and conf_str_hashtbl[] hold confirmed
  * setclientid_confirmed info. 
  *
  * unconf_str_hastbl[] and unconf_id_hashtbl[] hold unconfirmed 
@@ -144,6 +150,8 @@ static void release_file(struct nfs4_file *fp);
  * close_lru holds (open) stateowner queue ordered by nfs4_stateowner.so_time
  * for last close replay.
  */
+static struct list_head	reclaim_str_hashtbl[CLIENT_HASH_SIZE];
+static int reclaim_str_hashtbl_size;
 static struct list_head	conf_id_hashtbl[CLIENT_HASH_SIZE];
 static struct list_head	conf_str_hashtbl[CLIENT_HASH_SIZE];
 static struct list_head	unconf_str_hashtbl[CLIENT_HASH_SIZE];
@@ -339,6 +347,95 @@ move_to_confirmed(struct nfs4_client *clp, unsigned int idhashval)
 	renew_client(clp);
 }
 
+
+/* a helper function for parse_callback */
+static int
+parse_octet(unsigned int *lenp, char **addrp)
+{
+	unsigned int len = *lenp;
+	char *p = *addrp;
+	int n = -1;
+	char c;
+
+	for (;;) {
+		if (!len)
+			break;
+		len--;
+		c = *p++;
+		if (c == '.')
+			break;
+		if ((c < '0') || (c > '9')) {
+			n = -1;
+			break;
+		}
+		if (n < 0)
+			n = 0;
+		n = (n * 10) + (c - '0');
+		if (n > 255) {
+			n = -1;
+			break;
+		}
+	}
+	*lenp = len;
+	*addrp = p;
+	return n;
+}
+
+/* parse and set the setclientid ipv4 callback address */
+int
+parse_ipv4(unsigned int addr_len, char *addr_val, unsigned int *cbaddrp, unsigned short *cbportp)
+{
+	int temp = 0;
+	u32 cbaddr = 0;
+	u16 cbport = 0;
+	u32 addrlen = addr_len;
+	char *addr = addr_val;
+	int i, shift;
+
+	/* ipaddress */
+	shift = 24;
+	for(i = 4; i > 0  ; i--) {
+		if ((temp = parse_octet(&addrlen, &addr)) < 0) {
+			return 0;
+		}
+		cbaddr |= (temp << shift);
+		if(shift > 0)
+		shift -= 8;
+	}
+	*cbaddrp = cbaddr;
+
+	/* port */
+	shift = 8;
+	for(i = 2; i > 0  ; i--) {
+		if ((temp = parse_octet(&addrlen, &addr)) < 0) {
+			return 0;
+		}
+		cbport |= (temp << shift);
+		if(shift > 0)
+			shift -= 8;
+	}
+	*cbportp = cbport;
+	return 1;
+}
+
+void
+gen_callback(struct nfs4_client *clp, struct nfsd4_setclientid *se)
+{
+	struct nfs4_callback *cb = &clp->cl_callback;
+
+	if( !(parse_ipv4(se->se_callback_addr_len, se->se_callback_addr_val,
+		         &cb->cb_addr, &cb->cb_port))) {
+		printk(KERN_INFO "NFSD: BAD callback address. client will not receive delegations\n");
+		cb->cb_parsed = 0;
+		return;
+	}
+	cb->cb_netid.len = se->se_callback_netid_len;
+	cb->cb_netid.data = se->se_callback_netid_val;
+        cb->cb_prog = se->se_callback_prog;
+        cb->cb_ident = se->se_callback_ident;
+        cb->cb_parsed = 1;
+}
+
 /*
  * RFC 3010 has a complex implmentation description of processing a 
  * SETCLIENTID request consisting of 5 bullets, labeled as 
@@ -450,6 +547,7 @@ nfsd4_setclientid(struct svc_rqst *rqstp, struct nfsd4_setclientid *setclid)
 		copy_cred(&new->cl_cred,&rqstp->rq_cred);
 		gen_clid(new);
 		gen_confirm(new);
+		gen_callback(new, setclid);
 		add_to_unconfirmed(new, strhashval);
 	} else if (cmp_verf(&conf->cl_verifier, &clverifier)) {
 		/*
@@ -477,6 +575,7 @@ nfsd4_setclientid(struct svc_rqst *rqstp, struct nfsd4_setclientid *setclid)
 		copy_cred(&new->cl_cred,&rqstp->rq_cred);
 		copy_clid(new, conf);
 		gen_confirm(new);
+		gen_callback(new, setclid);
 		add_to_unconfirmed(new,strhashval);
 	} else if (!unconf) {
 		/*
@@ -494,6 +593,7 @@ nfsd4_setclientid(struct svc_rqst *rqstp, struct nfsd4_setclientid *setclid)
 		copy_cred(&new->cl_cred,&rqstp->rq_cred);
 		gen_clid(new);
 		gen_confirm(new);
+		gen_callback(new, setclid);
 		add_to_unconfirmed(new, strhashval);
 	} else if (!cmp_verf(&conf->cl_confirm, &unconf->cl_confirm)) {
 		/*	
@@ -519,6 +619,7 @@ nfsd4_setclientid(struct svc_rqst *rqstp, struct nfsd4_setclientid *setclid)
 		copy_cred(&new->cl_cred,&rqstp->rq_cred);
 		gen_clid(new);
 		gen_confirm(new);
+		gen_callback(new, setclid);
 		add_to_unconfirmed(new, strhashval);
 	} else {
 		/* No cases hit !!! */
@@ -529,7 +630,6 @@ nfsd4_setclientid(struct svc_rqst *rqstp, struct nfsd4_setclientid *setclid)
 	setclid->se_clientid.cl_boot = new->cl_clientid.cl_boot;
 	setclid->se_clientid.cl_id = new->cl_clientid.cl_id;
 	memcpy(setclid->se_confirm.data, new->cl_confirm.data, sizeof(setclid->se_confirm.data));
-	printk(KERN_INFO "NFSD: this client will not receive delegations\n");
 	status = nfs_ok;
 out:
 	nfs4_unlock_state();
@@ -1040,10 +1140,9 @@ int status;
 
 	if (share_access & NFS4_SHARE_ACCESS_WRITE) {
 		status = get_write_access(filp->f_dentry->d_inode);
-		if (!status)
-			filp->f_mode = FMODE_WRITE;
-		else
+		if (status)
 			return nfserrno(status);
+		filp->f_mode = (filp->f_mode | FMODE_WRITE) & ~FMODE_READ;
 	}
 	return nfs_ok;
 }
@@ -1053,7 +1152,7 @@ nfs4_file_downgrade(struct file *filp, unsigned int share_access)
 {
 	if (share_access & NFS4_SHARE_ACCESS_WRITE) {
 		put_write_access(filp->f_dentry->d_inode);
-		filp->f_mode = FMODE_READ;
+		filp->f_mode = (filp->f_mode | FMODE_READ) & ~FMODE_WRITE;
 	}
 }
 
@@ -1510,10 +1609,12 @@ nfs4_preprocess_seqid_op(struct svc_fh *current_fh, u32 seqid, stateid_t *statei
 
 	status = nfserr_bad_stateid;
 
-	/* for new lock stateowners, check that the lock->v.new.open_stateid
-	 * refers to an open stateowner, and that the lockclid
-	 * (nfs4_lock->v.new.clientid) is the same as the
-	 * open_stateid->st_stateowner->so_client->clientid
+	/* for new lock stateowners:
+	 * check that the lock->v.new.open_stateid
+	 * refers to an open stateowner
+	 *
+	 * check that the lockclid (nfs4_lock->v.new.clientid) is the same
+	 * as the open_stateid->st_stateowner->so_client->clientid
 	 */
 	if (lockclid) {
 		struct nfs4_stateowner *sop = stp->st_stateowner;
@@ -1598,6 +1699,17 @@ check_replay:
 	goto out;
 }
 
+/*
+ * eventually, this will perform an upcall to the 'state daemon' as well as
+ * set the cl_first_state field.
+ */
+void
+first_state(struct nfs4_client *clp)
+{
+	if (!clp->cl_first_state)
+		clp->cl_first_state = get_seconds();
+}
+
 /*
  * nfs4_unlock_state(); called in encode
  */
@@ -1635,6 +1747,7 @@ nfsd4_open_confirm(struct svc_rqst *rqstp, struct svc_fh *current_fh, struct nfs
 		         stp->st_stateid.si_fileid,
 		         stp->st_stateid.si_generation);
 	status = nfs_ok;
+	first_state(sop->so_client);
 out:
 	return status;
 }
@@ -1850,6 +1963,21 @@ nfs4_set_lock_denied(struct file_lock *fl, struct nfsd4_lock_denied *deny)
 		deny->ld_type = NFS4_WRITE_LT;
 }
 
+static struct nfs4_stateowner *
+find_lockstateowner(struct xdr_netobj *owner, clientid_t *clid)
+{
+	struct nfs4_stateowner *local = NULL;
+	int i;
+
+	for (i = 0; i < LOCK_HASH_SIZE; i++) {
+		list_for_each_entry(local, &lock_ownerid_hashtbl[i], so_idhash) {
+			if(!cmp_owner_str(local, owner, clid))
+				continue;
+			return local;
+		}
+	}
+	return NULL;
+}
 
 static int
 find_lockstateowner_str(unsigned int hashval, struct xdr_netobj *owner, clientid_t *clid, struct nfs4_stateowner **op) {
@@ -1969,7 +2097,7 @@ nfsd4_lock(struct svc_rqst *rqstp, struct svc_fh *current_fh, struct nfsd4_lock
 
 	if (nfs4_in_grace() && !lock->lk_reclaim)
 		return nfserr_grace;
-	if (nfs4_in_no_grace() && lock->lk_reclaim)
+	if (!nfs4_in_grace() && lock->lk_reclaim)
 		return nfserr_no_grace;
 
 	if (check_lock_length(lock->lk_offset, lock->lk_length))
@@ -1992,7 +2120,11 @@ nfsd4_lock(struct svc_rqst *rqstp, struct svc_fh *current_fh, struct nfsd4_lock
 			printk("NFSD: nfsd4_lock: clientid is stale!\n");
 			goto out;
 		}
-		/* does the clientid in the lock owner own the open stateid? */
+
+		/* is the new lock seqid presented by the client zero? */
+		status = nfserr_bad_seqid;
+		if (lock->v.new.lock_seqid != 0)
+			goto out;
 
 		/* validate and update open stateid and open seqid */
 		status = nfs4_preprocess_seqid_op(current_fh, 
@@ -2011,15 +2143,15 @@ nfsd4_lock(struct svc_rqst *rqstp, struct svc_fh *current_fh, struct nfsd4_lock
 		strhashval = lock_ownerstr_hashval(fp->fi_inode, 
 				open_sop->so_client->cl_clientid.cl_id, 
 				lock->v.new.owner);
-
 		/* 
 		 * If we already have this lock owner, the client is in 
 		 * error (or our bookeeping is wrong!) 
 		 * for asking for a 'new lock'.
 		 */
 		status = nfserr_bad_stateid;
-		if (find_lockstateowner_str(strhashval, &lock->v.new.owner,
-					&lock->v.new.clientid, &lock_sop))
+		lock_sop = find_lockstateowner(&lock->v.new.owner,
+						&lock->v.new.clientid);
+		if (lock_sop)
 			goto out;
 		status = nfserr_resource;
 		if (!(lock->lk_stateowner = alloc_init_lock_stateowner(strhashval, open_sop->so_client, open_stp, lock)))
@@ -2315,7 +2447,7 @@ nfsd4_release_lockowner(struct svc_rqst *rqstp, struct nfsd4_release_lockowner *
 	clientid_t *clid = &rlockowner->rl_clientid;
 	struct nfs4_stateowner *local = NULL;
 	struct xdr_netobj *owner = &rlockowner->rl_owner;
-	int status, i;
+	int status;
 
 	dprintk("nfsd4_release_lockowner clientid: (%08x/%08x):\n",
 		clid->cl_boot, clid->cl_id);
@@ -2330,34 +2462,136 @@ nfsd4_release_lockowner(struct svc_rqst *rqstp, struct nfsd4_release_lockowner *
 
 	nfs4_lock_state();
 
-	/* find the lockowner */
         status = nfs_ok;
-	for (i=0; i < LOCK_HASH_SIZE; i++)
-		list_for_each_entry(local, &lock_ownerstr_hashtbl[i], so_strhash)
-			if(cmp_owner_str(local, owner, clid)) {
-				struct nfs4_stateid *stp;
-
-				/* check for any locks held by any stateid
-				 * associated with the (lock) stateowner */
-				status = nfserr_locks_held;
-				list_for_each_entry(stp, &local->so_perfilestate,
-						    st_perfilestate) {
-					if(stp->st_vfs_set) {
-						if (check_for_locks(&stp->st_vfs_file,
-								    local))
-							goto out;
-					}
-				}
-				/* no locks held by (lock) stateowner */
-				status = nfs_ok;
-				release_stateowner(local);
-				goto out;
+	local = find_lockstateowner(owner, clid);
+	if (local) {
+		struct nfs4_stateid *stp;
+
+		/* check for any locks held by any stateid
+		 * associated with the (lock) stateowner */
+		status = nfserr_locks_held;
+		list_for_each_entry(stp, &local->so_perfilestate,
+				st_perfilestate) {
+			if(stp->st_vfs_set) {
+				if (check_for_locks(&stp->st_vfs_file, local))
+					goto out;
 			}
+		}
+		/* no locks held by (lock) stateowner */
+		status = nfs_ok;
+		release_stateowner(local);
+	}
 out:
 	nfs4_unlock_state();
 	return status;
 }
 
+static inline struct nfs4_client_reclaim *
+alloc_reclaim(int namelen)
+{
+	struct nfs4_client_reclaim *crp = NULL;
+
+	crp = kmalloc(sizeof(struct nfs4_client_reclaim), GFP_KERNEL);
+	if (!crp)
+		return NULL;
+	crp->cr_name.data = kmalloc(namelen, GFP_KERNEL);
+	if (!crp->cr_name.data) {
+		kfree(crp);
+		return NULL;
+	}
+       	return crp;
+}
+
+/*
+ * failure => all reset bets are off, nfserr_no_grace...
+ */
+static int
+nfs4_client_to_reclaim(struct nfs4_client *clp)
+{
+	unsigned int strhashval;
+	struct nfs4_client_reclaim *crp = NULL;
+
+	crp = alloc_reclaim(clp->cl_name.len);
+	if (!crp)
+		return 0;
+	strhashval = clientstr_hashval(clp->cl_name.data, clp->cl_name.len);
+	INIT_LIST_HEAD(&crp->cr_strhash);
+	list_add(&crp->cr_strhash, &reclaim_str_hashtbl[strhashval]);
+	memcpy(crp->cr_name.data, clp->cl_name.data, clp->cl_name.len);
+	crp->cr_name.len = clp->cl_name.len;
+	crp->cr_first_state = clp->cl_first_state;
+	crp->cr_expired = 0;
+	return 1;
+}
+
+static void
+nfs4_release_reclaim(void)
+{
+	struct nfs4_client_reclaim *crp = NULL;
+	int i;
+
+	BUG_ON(!nfs4_reclaim_init);
+	for (i = 0; i < CLIENT_HASH_SIZE; i++) {
+		while (!list_empty(&reclaim_str_hashtbl[i])) {
+			crp = list_entry(reclaim_str_hashtbl[i].next,
+			                struct nfs4_client_reclaim, cr_strhash);
+			list_del(&crp->cr_strhash);
+			kfree(crp->cr_name.data);
+			kfree(crp);
+			reclaim_str_hashtbl_size--;
+		}
+	}
+	BUG_ON(reclaim_str_hashtbl_size);
+}
+
+/*
+ * called from OPEN, CLAIM_PREVIOUS with a new clientid. */
+struct nfs4_client_reclaim *
+nfs4_find_reclaim_client(clientid_t *clid)
+{
+	unsigned int idhashval = clientid_hashval(clid->cl_id);
+	unsigned int strhashval;
+	struct nfs4_client *clp, *client = NULL;
+	struct nfs4_client_reclaim *crp = NULL;
+
+
+	/* find clientid in conf_id_hashtbl */
+	list_for_each_entry(clp, &conf_id_hashtbl[idhashval], cl_idhash) {
+		if (cmp_clid(&clp->cl_clientid, clid)) {
+			client = clp;
+			break;
+		}
+	}
+	if (!client)
+		return NULL;
+
+	/* find clp->cl_name in reclaim_str_hashtbl */
+	strhashval = clientstr_hashval(client->cl_name.data,
+	                              client->cl_name.len);
+	list_for_each_entry(crp, &reclaim_str_hashtbl[strhashval], cr_strhash) {
+		if(cmp_name(&crp->cr_name, &client->cl_name)) {
+			return crp;
+		}
+	}
+	return NULL;
+}
+
+/*
+* Called from OPEN. Look for clientid in reclaim list.
+*/
+int
+nfs4_check_open_reclaim(clientid_t *clid)
+{
+	struct nfs4_client_reclaim *crp;
+
+	if ((crp = nfs4_find_reclaim_client(clid)) == NULL)
+		return nfserr_reclaim_bad;
+	if (crp->cr_expired)
+		return nfserr_no_grace;
+	return nfs_ok;
+}
+
+
 /* 
  * Start and stop routines
  */
@@ -2366,10 +2600,16 @@ void
 nfs4_state_init(void)
 {
 	int i;
-	time_t start = get_seconds();
+	time_t grace_time;
 
 	if (nfs4_init)
 		return;
+	if (!nfs4_reclaim_init) {
+		for (i = 0; i < CLIENT_HASH_SIZE; i++)
+			INIT_LIST_HEAD(&reclaim_str_hashtbl[i]);
+		reclaim_str_hashtbl_size = 0;
+		nfs4_reclaim_init = 1;
+	}
 	for (i = 0; i < CLIENT_HASH_SIZE; i++) {
 		INIT_LIST_HEAD(&conf_id_hashtbl[i]);
 		INIT_LIST_HEAD(&conf_str_hashtbl[i]);
@@ -2396,27 +2636,36 @@ nfs4_state_init(void)
 
 	INIT_LIST_HEAD(&close_lru);
 	INIT_LIST_HEAD(&client_lru);
-	init_MUTEX(&client_sema);
-	boot_time = start;
-	grace_end = start + NFSD_LEASE_TIME;
+	boot_time = get_seconds();
+	grace_time = max(old_lease_time, lease_time);
+	if (reclaim_str_hashtbl_size == 0)
+		grace_time = 0;
+	if (grace_time)
+		printk("NFSD: starting %ld-second grace period\n", grace_time);
+	grace_end = boot_time + grace_time;
 	INIT_WORK(&laundromat_work,laundromat_main, NULL);
 	schedule_delayed_work(&laundromat_work, NFSD_LEASE_TIME*HZ);
 	nfs4_init = 1;
-
 }
 
 int
 nfs4_in_grace(void)
 {
-	return time_before(get_seconds(), (unsigned long)grace_end);
+	return get_seconds() < grace_end;
 }
 
-int
-nfs4_in_no_grace(void)
+void
+set_no_grace(void)
 {
-	return (grace_end < get_seconds());
+	printk("NFSD: ERROR in reboot recovery.  State reclaims will fail.\n");
+	grace_end = get_seconds();
 }
 
+time_t
+nfs4_lease_time(void)
+{
+	return lease_time;
+}
 
 static void
 __nfs4_state_shutdown(void)
@@ -2454,6 +2703,61 @@ void
 nfs4_state_shutdown(void)
 {
 	nfs4_lock_state();
+	nfs4_release_reclaim();
 	__nfs4_state_shutdown();
 	nfs4_unlock_state();
 }
+
+/*
+ * Called when leasetime is changed.
+ *
+ * if nfsd is not started, simply set the global lease.
+ *
+ * if nfsd(s) are running, lease change requires nfsv4 state to be reset.
+ * e.g: boot_time is reset, existing nfs4_client structs are
+ * used to fill reclaim_str_hashtbl, then all state (except for the
+ * reclaim_str_hashtbl) is re-initialized.
+ *
+ * if the old lease time is greater than the new lease time, the grace
+ * period needs to be set to the old lease time to allow clients to reclaim
+ * their state. XXX - we may want to set the grace period == lease time
+ * after an initial grace period == old lease time
+ *
+ * if an error occurs in this process, the new lease is set, but the server
+ * will not honor OPEN or LOCK reclaims, and will return nfserr_no_grace
+ * which means OPEN/LOCK/READ/WRITE will fail during grace period.
+ *
+ * clients will attempt to reset all state with SETCLIENTID/CONFIRM, and
+ * OPEN and LOCK reclaims.
+ */
+void
+nfs4_reset_lease(time_t leasetime)
+{
+	struct nfs4_client *clp;
+	int i;
+
+	printk("NFSD: New leasetime %ld\n",leasetime);
+	if (!nfs4_init)
+		return;
+	nfs4_lock_state();
+	old_lease_time = lease_time;
+	lease_time = leasetime;
+
+	nfs4_release_reclaim();
+
+	/* populate reclaim_str_hashtbl with current confirmed nfs4_clientid */
+	for (i = 0; i < CLIENT_HASH_SIZE; i++) {
+		list_for_each_entry(clp, &conf_id_hashtbl[i], cl_idhash) {
+			if (!nfs4_client_to_reclaim(clp)) {
+				nfs4_release_reclaim();
+				goto init_state;
+			}
+			reclaim_str_hashtbl_size++;
+		}
+	}
+init_state:
+	__nfs4_state_shutdown();
+	nfs4_state_init();
+	nfs4_unlock_state();
+}
+
diff --git a/fs/nfsd/nfs4xdr.c b/fs/nfsd/nfs4xdr.c
index 1634701eb..e95b02a70 100644
--- a/fs/nfsd/nfs4xdr.c
+++ b/fs/nfsd/nfs4xdr.c
@@ -288,27 +288,40 @@ u32 *read_buf(struct nfsd4_compoundargs *argp, int nbytes)
 	return p;
 }
 
-char *savemem(struct nfsd4_compoundargs *argp, u32 *p, int nbytes)
+static int
+defer_free(struct nfsd4_compoundargs *argp,
+		void (*release)(const void *), void *p)
 {
 	struct tmpbuf *tb;
+
+	tb = kmalloc(sizeof(*tb), GFP_KERNEL);
+	if (!tb)
+		return -ENOMEM;
+	tb->buf = p;
+	tb->release = release;
+	tb->next = argp->to_free;
+	argp->to_free = tb;
+	return 0;
+}
+
+char *savemem(struct nfsd4_compoundargs *argp, u32 *p, int nbytes)
+{
+	void *new = NULL;
 	if (p == argp->tmp) {
-		p = kmalloc(nbytes, GFP_KERNEL);
-		if (!p) return NULL;
+		new = kmalloc(nbytes, GFP_KERNEL);
+		if (!new) return NULL;
+		p = new;
 		memcpy(p, argp->tmp, nbytes);
 	} else {
 		if (p != argp->tmpp)
 			BUG();
 		argp->tmpp = NULL;
 	}
-	tb = kmalloc(sizeof(*tb), GFP_KERNEL);
-	if (!tb) {
-		kfree(p);
+	if (defer_free(argp, kfree, p)) {
+		kfree(new);
 		return NULL;
-	}
-	tb->buf = p;
-	tb->next = argp->to_free;
-	argp->to_free = tb;
-	return (char*)p;
+	} else
+		return (char *)p;
 }
 
 
@@ -1289,18 +1302,11 @@ static u32 nfs4_ftypes[16] = {
         NF4SOCK, NF4BAD,  NF4LNK, NF4BAD,
 };
 
-static inline int
-xdr_padding(int l)
-{
-       return 3 - ((l - 1) & 3); /* smallest i>=0 such that (l+i)%4 = 0 */
-}
-
 static int
 nfsd4_encode_name(struct svc_rqst *rqstp, int group, uid_t id,
 			u32 **p, int *buflen)
 {
 	int status;
-	u32 len;
 
 	if (*buflen < (XDR_QUADLEN(IDMAP_NAMESZ) << 2) + 4)
 		return nfserr_resource;
@@ -1310,11 +1316,8 @@ nfsd4_encode_name(struct svc_rqst *rqstp, int group, uid_t id,
 		status = nfsd_map_uid_to_name(rqstp, id, (u8 *)(*p + 1));
 	if (status < 0)
 		return nfserrno(status);
-	len = (unsigned)status;
-	*(*p)++ = htonl(len);
-	memset((u8 *)*p + len, 0, xdr_padding(len));
-	*p += XDR_QUADLEN(len);
-	*buflen -= (XDR_QUADLEN(len) << 2) + 4;
+	*p = xdr_encode_opaque(*p, NULL, status);
+	*buflen -= (XDR_QUADLEN(status) << 2) + 4;
 	BUG_ON(*buflen < 0);
 	return 0;
 }
@@ -1559,7 +1562,8 @@ nfsd4_encode_fattr(struct svc_fh *fhp, struct svc_export *exp,
 	}
 	if (bmval1 & FATTR4_WORD1_OWNER) {
 		status = nfsd4_encode_user(rqstp,
-			XIDINO_UID(stat.uid, stat.xid), &p, &buflen);
+			XIDINO_UID(XID_TAG(dentry->d_inode),
+			stat.uid, stat.xid), &p, &buflen);
 		if (status == nfserr_resource)
 			goto out_resource;
 		if (status)
@@ -1567,7 +1571,8 @@ nfsd4_encode_fattr(struct svc_fh *fhp, struct svc_export *exp,
 	}
 	if (bmval1 & FATTR4_WORD1_OWNER_GROUP) {
 		status = nfsd4_encode_group(rqstp,
-			XIDINO_GID(stat.gid, stat.xid), &p, &buflen);
+			XIDINO_GID(XID_TAG(dentry->d_inode),
+			stat.gid, stat.xid), &p, &buflen);
 		if (status == nfserr_resource)
 			goto out_resource;
 		if (status)
@@ -2474,6 +2479,24 @@ nfs4svc_encode_voidres(struct svc_rqst *rqstp, u32 *p, void *dummy)
         return xdr_ressize_check(rqstp, p);
 }
 
+void nfsd4_release_compoundargs(struct nfsd4_compoundargs *args)
+{
+	if (args->ops != args->iops) {
+		kfree(args->ops);
+		args->ops = args->iops;
+	}
+	if (args->tmpp) {
+		kfree(args->tmpp);
+		args->tmpp = NULL;
+	}
+	while (args->to_free) {
+		struct tmpbuf *tb = args->to_free;
+		args->to_free = tb->next;
+		tb->release(tb->buf);
+		kfree(tb);
+	}
+}
+
 int
 nfs4svc_decode_compoundargs(struct svc_rqst *rqstp, u32 *p, struct nfsd4_compoundargs *args)
 {
@@ -2490,20 +2513,7 @@ nfs4svc_decode_compoundargs(struct svc_rqst *rqstp, u32 *p, struct nfsd4_compoun
 
 	status = nfsd4_decode_compound(args);
 	if (status) {
-		if (args->ops != args->iops) {
-			kfree(args->ops);
-			args->ops = args->iops;
-		}
-		if (args->tmpp) {
-			kfree(args->tmpp);
-			args->tmpp = NULL;
-		}
-		while (args->to_free) {
-			struct tmpbuf *tb = args->to_free;
-			args->to_free = tb->next;
-			kfree(tb->buf);
-			kfree(tb);
-		}
+		nfsd4_release_compoundargs(args);
 	}
 	return !status;
 }
@@ -2514,7 +2524,7 @@ nfs4svc_encode_compoundres(struct svc_rqst *rqstp, u32 *p, struct nfsd4_compound
 	/*
 	 * All that remains is to write the tag and operation count...
 	 */
-	struct iovec *iov;
+	struct kvec *iov;
 	p = resp->tagp;
 	*p++ = htonl(resp->taglen);
 	memcpy(p, resp->tag, resp->taglen);
diff --git a/fs/nfsd/nfscache.c b/fs/nfsd/nfscache.c
index 608a197c1..9ab14f56d 100644
--- a/fs/nfsd/nfscache.c
+++ b/fs/nfsd/nfscache.c
@@ -41,7 +41,7 @@ static struct svc_cacherep *	lru_tail;
 static struct svc_cacherep *	nfscache;
 static int			cache_disabled = 1;
 
-static int	nfsd_cache_append(struct svc_rqst *rqstp, struct iovec *vec);
+static int	nfsd_cache_append(struct svc_rqst *rqstp, struct kvec *vec);
 
 /* 
  * locking for the reply cache:
@@ -308,7 +308,7 @@ void
 nfsd_cache_update(struct svc_rqst *rqstp, int cachetype, u32 *statp)
 {
 	struct svc_cacherep *rp;
-	struct iovec	*resv = &rqstp->rq_res.head[0], *cachv;
+	struct kvec	*resv = &rqstp->rq_res.head[0], *cachv;
 	int		len;
 
 	if (!(rp = rqstp->rq_cacherep) || cache_disabled)
@@ -358,9 +358,9 @@ nfsd_cache_update(struct svc_rqst *rqstp, int cachetype, u32 *statp)
  * keep a refcount....
  */
 static int
-nfsd_cache_append(struct svc_rqst *rqstp, struct iovec *data)
+nfsd_cache_append(struct svc_rqst *rqstp, struct kvec *data)
 {
-	struct iovec	*vec = &rqstp->rq_res.head[0];
+	struct kvec	*vec = &rqstp->rq_res.head[0];
 
 	if (vec->iov_len + data->iov_len > PAGE_SIZE) {
 		printk(KERN_WARNING "nfsd: cached reply too large (%Zd).\n",
diff --git a/fs/nfsd/nfsctl.c b/fs/nfsd/nfsctl.c
index 5014476b1..9c9399258 100644
--- a/fs/nfsd/nfsctl.c
+++ b/fs/nfsd/nfsctl.c
@@ -36,7 +36,7 @@
 #include <asm/uaccess.h>
 
 /*
- *	We have a single directory with 8 nodes in it.
+ *	We have a single directory with 9 nodes in it.
  */
 enum {
 	NFSD_Root = 1,
@@ -50,6 +50,7 @@ enum {
 	NFSD_List,
 	NFSD_Fh,
 	NFSD_Threads,
+	NFSD_Leasetime,
 };
 
 /*
@@ -64,6 +65,7 @@ static ssize_t write_getfd(struct file *file, char *buf, size_t size);
 static ssize_t write_getfs(struct file *file, char *buf, size_t size);
 static ssize_t write_filehandle(struct file *file, char *buf, size_t size);
 static ssize_t write_threads(struct file *file, char *buf, size_t size);
+static ssize_t write_leasetime(struct file *file, char *buf, size_t size);
 
 static ssize_t (*write_op[])(struct file *, char *, size_t) = {
 	[NFSD_Svc] = write_svc,
@@ -75,6 +77,7 @@ static ssize_t (*write_op[])(struct file *, char *, size_t) = {
 	[NFSD_Getfs] = write_getfs,
 	[NFSD_Fh] = write_filehandle,
 	[NFSD_Threads] = write_threads,
+	[NFSD_Leasetime] = write_leasetime,
 };
 
 /* an argresp is stored in an allocated page and holds the 
@@ -393,6 +396,29 @@ static ssize_t write_threads(struct file *file, char *buf, size_t size)
 	return strlen(buf);
 }
 
+extern time_t nfs4_leasetime(void);
+
+static ssize_t write_leasetime(struct file *file, char *buf, size_t size)
+{
+	/* if size > 10 seconds, call
+	 * nfs4_reset_lease() then write out the new lease (seconds) as reply
+	 */
+	char *mesg = buf;
+	int rv;
+
+	if (size > 0) {
+		int lease;
+		rv = get_int(&mesg, &lease);
+		if (rv)
+			return rv;
+		if (lease < 10 || lease > 3600)
+			return -EINVAL;
+		nfs4_reset_lease(lease);
+	}
+	sprintf(buf, "%ld\n", nfs4_lease_time());
+	return strlen(buf);
+}
+
 /*----------------------------------------------------------------------------*/
 /*
  *	populating the filesystem.
@@ -411,6 +437,9 @@ static int nfsd_fill_super(struct super_block * sb, void * data, int silent)
 		[NFSD_List] = {"exports", &exports_operations, S_IRUGO},
 		[NFSD_Fh] = {"filehandle", &transaction_ops, S_IWUSR|S_IRUSR},
 		[NFSD_Threads] = {"threads", &transaction_ops, S_IWUSR|S_IRUSR},
+#ifdef CONFIG_NFSD_V4
+		[NFSD_Leasetime] = {"nfsv4leasetime", &transaction_ops, S_IWUSR|S_IRUSR},
+#endif
 		/* last one */ {""}
 	};
 	return simple_fill_super(sb, 0x6e667364, nfsd_files);
@@ -441,7 +470,7 @@ static int __init init_nfsd(void)
 #ifdef CONFIG_NFSD_V4
 	nfsd_idmap_init();      /* Name to ID mapping */
 #endif /* CONFIG_NFSD_V4 */
-	if (proc_mkdir("fs/nfs", 0)) {
+	if (proc_mkdir("fs/nfs", NULL)) {
 		struct proc_dir_entry *entry;
 		entry = create_proc_entry("fs/nfs/exports", 0, NULL);
 		if (entry)
diff --git a/fs/nfsd/nfsxdr.c b/fs/nfsd/nfsxdr.c
index 6e230b5c1..77b18baab 100644
--- a/fs/nfsd/nfsxdr.c
+++ b/fs/nfsd/nfsxdr.c
@@ -97,6 +97,8 @@ static inline u32 *
 decode_sattr(u32 *p, struct iattr *iap)
 {
 	u32	tmp, tmp1;
+	uid_t	uid = 0;
+	gid_t	gid = 0;
 
 	iap->ia_valid = 0;
 
@@ -110,12 +112,15 @@ decode_sattr(u32 *p, struct iattr *iap)
 	}
 	if ((tmp = ntohl(*p++)) != (u32)-1) {
 		iap->ia_valid |= ATTR_UID;
-		iap->ia_uid = tmp;
+		uid = tmp;
 	}
 	if ((tmp = ntohl(*p++)) != (u32)-1) {
 		iap->ia_valid |= ATTR_GID;
-		iap->ia_gid = tmp;
+		gid = tmp;
 	}
+	iap->ia_uid = INOXID_UID(1, uid, gid);
+	iap->ia_gid = INOXID_GID(1, uid, gid);
+	iap->ia_xid = INOXID_XID(1, uid, gid, 0);
 	if ((tmp = ntohl(*p++)) != (u32)-1) {
 		iap->ia_valid |= ATTR_SIZE;
 		iap->ia_size = tmp;
@@ -162,9 +167,9 @@ encode_fattr(struct svc_rqst *rqstp, u32 *p, struct svc_fh *fhp)
 	*p++ = htonl((u32) stat.mode);
 	*p++ = htonl((u32) stat.nlink);
 	*p++ = htonl((u32) nfsd_ruid(rqstp,
-		XIDINO_UID(stat.uid, stat.xid)));
+		XIDINO_UID(XID_TAG(dentry->d_inode), stat.uid, stat.xid)));
 	*p++ = htonl((u32) nfsd_rgid(rqstp,
-		XIDINO_GID(stat.gid, stat.xid)));
+		XIDINO_GID(XID_TAG(dentry->d_inode), stat.gid, stat.xid)));
 
 	if (S_ISLNK(type) && stat.size > NFS_MAXPATHLEN) {
 		*p++ = htonl(NFS_MAXPATHLEN);
@@ -237,7 +242,7 @@ int
 nfssvc_decode_readargs(struct svc_rqst *rqstp, u32 *p,
 					struct nfsd_readargs *args)
 {
-	int len;
+	unsigned int len;
 	int v,pn;
 	if (!(p = decode_fh(p, &args->fh)))
 		return 0;
@@ -258,8 +263,8 @@ nfssvc_decode_readargs(struct svc_rqst *rqstp, u32 *p,
 		svc_take_page(rqstp);
 		args->vec[v].iov_base = page_address(rqstp->rq_respages[pn]);
 		args->vec[v].iov_len = len < PAGE_SIZE?len:PAGE_SIZE;
+		len -= args->vec[v].iov_len;
 		v++;
-		len -= PAGE_SIZE;
 	}
 	args->vlen = v;
 	return xdr_argsize_check(rqstp, p);
@@ -269,7 +274,7 @@ int
 nfssvc_decode_writeargs(struct svc_rqst *rqstp, u32 *p,
 					struct nfsd_writeargs *args)
 {
-	int len;
+	unsigned int len;
 	int v;
 	if (!(p = decode_fh(p, &args->fh)))
 		return 0;
diff --git a/fs/nfsd/vfs.c b/fs/nfsd/vfs.c
index d520feaa1..d50269bc5 100644
--- a/fs/nfsd/vfs.c
+++ b/fs/nfsd/vfs.c
@@ -611,7 +611,7 @@ static int
 nfsd_read_actor(read_descriptor_t *desc, struct page *page, unsigned long offset , unsigned long size)
 {
 	unsigned long count = desc->count;
-	struct svc_rqst *rqstp = (struct svc_rqst *)desc->buf;
+	struct svc_rqst *rqstp = desc->arg.data;
 
 	if (size > count)
 		size = count;
@@ -641,7 +641,7 @@ nfsd_read_actor(read_descriptor_t *desc, struct page *page, unsigned long offset
  */
 int
 nfsd_read(struct svc_rqst *rqstp, struct svc_fh *fhp, loff_t offset,
-          struct iovec *vec, int vlen, unsigned long *count)
+          struct kvec *vec, int vlen, unsigned long *count)
 {
 	struct raparms	*ra;
 	mm_segment_t	oldfs;
@@ -673,7 +673,7 @@ nfsd_read(struct svc_rqst *rqstp, struct svc_fh *fhp, loff_t offset,
 	} else {
 		oldfs = get_fs();
 		set_fs(KERNEL_DS);
-		err = vfs_readv(&file, vec, vlen, &offset);
+		err = vfs_readv(&file, (struct iovec __user *)vec, vlen, &offset);
 		set_fs(oldfs);
 	}
 
@@ -704,7 +704,7 @@ out:
  */
 int
 nfsd_write(struct svc_rqst *rqstp, struct svc_fh *fhp, loff_t offset,
-				struct iovec *vec, int vlen,
+				struct kvec *vec, int vlen,
 	   			unsigned long cnt, int *stablep)
 {
 	struct svc_export	*exp;
@@ -753,7 +753,7 @@ nfsd_write(struct svc_rqst *rqstp, struct svc_fh *fhp, loff_t offset,
 
 	/* Write the data. */
 	oldfs = get_fs(); set_fs(KERNEL_DS);
-	err = vfs_writev(&file, vec, vlen, &offset);
+	err = vfs_writev(&file, (struct iovec __user *)vec, vlen, &offset);
 	set_fs(oldfs);
 	if (err >= 0) {
 		nfsdstats.io_write += cnt;
@@ -1477,10 +1477,12 @@ nfsd_readdir(struct svc_rqst *rqstp, struct svc_fh *fhp, loff_t *offsetp,
 	err = nfsd_open(rqstp, fhp, S_IFDIR, MAY_READ, &file);
 	if (err)
 		goto out;
-	if (offset > ~(u32) 0)
-		goto out_close;
 
-	file.f_pos = offset;
+	offset = vfs_llseek(&file, offset, 0);
+	if (offset < 0) {
+		err = nfserrno((int)offset);
+		goto out_close;
+	}
 
 	/*
 	 * Read the directory entries. This silly loop is necessary because
@@ -1496,7 +1498,7 @@ nfsd_readdir(struct svc_rqst *rqstp, struct svc_fh *fhp, loff_t *offsetp,
 		err = nfserrno(err);
 	else
 		err = cdp->err;
-	*offsetp = file.f_pos;
+	*offsetp = vfs_llseek(&file, 0, 1);
 
 	if (err == nfserr_eof || err == nfserr_toosmall)
 		err = nfs_ok; /* can still be found in ->err */
@@ -1514,7 +1516,6 @@ int
 nfsd_statfs(struct svc_rqst *rqstp, struct svc_fh *fhp, struct kstatfs *stat)
 {
 	int err = fh_verify(rqstp, fhp, 0, MAY_NOP);
-
 	if (!err && vfs_statfs(fhp->fh_dentry->d_inode->i_sb,stat))
 		err = nfserr_io;
 	return err;
@@ -1532,7 +1533,7 @@ nfsd_permission(struct svc_export *exp, struct dentry *dentry, int acc)
 	if (acc == MAY_NOP)
 		return 0;
 #if 0
-	printk("nfsd: permission 0x%x%s%s%s%s%s%s%s mode 0%o%s%s%s\n",
+	dprintk("nfsd: permission 0x%x%s%s%s%s%s%s%s mode 0%o%s%s%s\n",
 		acc,
 		(acc & MAY_READ)?	" read"  : "",
 		(acc & MAY_WRITE)?	" write" : "",
@@ -1545,7 +1546,7 @@ nfsd_permission(struct svc_export *exp, struct dentry *dentry, int acc)
 		IS_IMMUTABLE(inode)?	" immut" : "",
 		IS_APPEND(inode)?	" append" : "",
 		IS_RDONLY(inode)?	" ro" : "");
-	printk("      owner %d/%d user %d/%d\n",
+	dprintk("      owner %d/%d user %d/%d\n",
 		inode->i_uid, inode->i_gid, current->fsuid, current->fsgid);
 #endif
 
diff --git a/fs/nls/Kconfig b/fs/nls/Kconfig
index 21c2559ea..0ab8f00bd 100644
--- a/fs/nls/Kconfig
+++ b/fs/nls/Kconfig
@@ -332,6 +332,14 @@ config NLS_CODEPAGE_1251
 	  say Y here if you want to include the DOS codepage for Russian and
 	  Bulgarian and Belarusian.
 
+config NLS_ASCII
+	tristate "ASCII (United States)"
+	depends on NLS
+	help
+	  An ASCII NLS module is needed if you want to override the
+	  DEFAULT NLS with this very basic charset and don't want any
+	  non-ASCII characters to be translated.
+
 config NLS_ISO8859_1
 	tristate "NLS ISO 8859-1  (Latin 1; Western European Languages)"
 	depends on NLS
diff --git a/fs/nls/Makefile b/fs/nls/Makefile
index 4548f2940..a7ade138d 100644
--- a/fs/nls/Makefile
+++ b/fs/nls/Makefile
@@ -26,6 +26,7 @@ obj-$(CONFIG_NLS_CODEPAGE_949)	+= nls_cp949.o
 obj-$(CONFIG_NLS_CODEPAGE_950)	+= nls_cp950.o
 obj-$(CONFIG_NLS_CODEPAGE_1250) += nls_cp1250.o
 obj-$(CONFIG_NLS_CODEPAGE_1251)	+= nls_cp1251.o
+obj-$(CONFIG_NLS_ASCII)		+= nls_ascii.o
 obj-$(CONFIG_NLS_ISO8859_1)	+= nls_iso8859-1.o
 obj-$(CONFIG_NLS_ISO8859_2)	+= nls_iso8859-2.o
 obj-$(CONFIG_NLS_ISO8859_3)	+= nls_iso8859-3.o
diff --git a/fs/ntfs/ChangeLog b/fs/ntfs/ChangeLog
index 57e8c7ec7..fa1442d2f 100644
--- a/fs/ntfs/ChangeLog
+++ b/fs/ntfs/ChangeLog
@@ -1,15 +1,6 @@
 ToDo/Notes:
 	- Find and fix bugs.
-	- Either invalidate quotas or update the quota charges on NTFS 3.x
-	  volumes with quota tracking enabled ($Quota).
 	- Checkpoint or disable the user space journal ($UsnJrnl).
-	- Implement aops->set_page_dirty() in order to take control of buffer
-	  dirtying. Not having it means if page_has_buffers(), all buffers
-	  will be dirtied with the page. And if not they won't be. That is
-	  fine for the moment but will break once we enable metadata updates.
-	  For now just always using __set_page_dirty_nobuffers() for metadata
-	  pages as nothing can dirty a page other than ourselves. Should this
-	  change, we will really need to roll our own ->set_page_dirty().
 	- Implement sops->dirty_inode() to implement {a,m,c}time updates and
 	  such things.  This should probably just flag the ntfs inode such that
 	  sops->write_inode(), i.e. ntfs_write_inode(), will copy the times
@@ -35,6 +26,67 @@ ToDo/Notes:
 	- Enable the code for setting the NT4 compatibility flag when we start
 	  making NTFS 1.2 specific modifications.
 
+2.1.15 - Invalidate quotas when (re)mounting read-write.
+
+	- Add new element itype.index.collation_rule to the ntfs inode
+	  structure and set it appropriately in ntfs_read_locked_inode().
+	- Implement a new inode type "index" to allow efficient access to the
+	  indices found in various system files and adapt inode handling
+	  accordingly (fs/ntfs/inode.[hc]).  An index inode is essentially an
+	  attribute inode (NInoAttr() is true) with an attribute type of
+	  AT_INDEX_ALLOCATION.  As such, it is no longer allowed to call
+	  ntfs_attr_iget() with an attribute type of AT_INDEX_ALLOCATION as
+	  there would be no way to distinguish between normal attribute inodes
+	  and index inodes.  The function to obtain an index inode is
+	  ntfs_index_iget() and it uses the helper function
+	  ntfs_read_locked_index_inode().  Note, we do not overload
+	  ntfs_attr_iget() as indices consist of multiple attributes so using
+	  ntfs_attr_iget() to obtain an index inode would be confusing.
+	- Ensure that there is no overflow when doing page->index <<
+	  PAGE_CACHE_SHIFT by casting page->index to s64 in fs/ntfs/aops.c.
+	- Use atomic kmap instead of kmap() in fs/ntfs/aops.c::ntfs_read_page()
+	  and ntfs_read_block().
+	- Use case sensitive attribute lookups instead of case insensitive ones.
+	- Lock all page cache pages belonging to mst protected attributes while
+	  accessing them to ensure we never see corrupt data while the page is
+	  under writeout.
+	- Add framework for generic ntfs collation (fs/ntfs/collation.[hc]).
+	  We have ntfs_is_collation_rule_supported() to check if the collation
+	  rule you want to use is supported and ntfs_collation() which actually
+	  collates two data items.  We currently only support COLLATION_BINARY
+	  and COLLATION_NTOFS_ULONG but support for other collation rules will
+	  be added as the need arises.
+	- Add a new type, ntfs_index_context, to allow retrieval of an index
+	  entry using the corresponding index key.  To get an index context,
+	  use ntfs_index_ctx_get() and to release it, use ntfs_index_ctx_put().
+	  This also adds a new slab cache for the index contexts.  To lookup a
+	  key in an index inode, use ntfs_index_lookup().  After modifying an
+	  index entry, call ntfs_index_entry_flush_dcache_page() followed by
+	  ntfs_index_entry_mark_dirty() to ensure the changes are written out
+	  to disk.  For details see fs/ntfs/index.[hc].  Note, at present, if
+	  an index entry is in the index allocation attribute rather than the
+	  index root attribute it will not be written out (you will get a
+	  warning message about discarded changes instead).
+	- Load the quota file ($Quota) and check if quota tracking is enabled
+	  and if so, mark the quotas out of date.  This causes windows to
+	  rescan the volume on boot and update all quota entries.
+	- Add a set_page_dirty address space operation for ntfs_m[fs]t_aops.
+	  It is simply set to __set_page_dirty_nobuffers() to make sure that
+	  running set_page_dirty() on a page containing mft/ntfs records will
+	  not affect the dirty state of the page buffers.
+	- Add fs/ntfs/index.c::__ntfs_index_entry_mark_dirty() which sets all
+	  buffers that are inside the ntfs record in the page dirty after which
+	  it sets the page dirty.  This allows ->writepage to only write the
+	  dirty index records rather than having to write all the records in
+	  the page.  Modify fs/ntfs/index.h::ntfs_index_entry_mark_dirty() to
+	  use this rather than __set_page_dirty_nobuffers().
+	- Implement fs/ntfs/aops.c::ntfs_write_mst_block() which enables the
+	  writing of page cache pages belonging to mst protected attributes
+	  like the index allocation attribute in directory indices and other
+	  indices like $Quota/$Q, etc.  This means that the quota is now marked
+	  out of date on all volumes rather than only on ones where the quota
+	  defaults entry is in the index root attribute of the $Quota/$Q index.
+
 2.1.14 - Fix an NFSd caused deadlock reported by several users.
 
 	- Modify fs/ntfs/ntfs_readdir() to copy the index root attribute value
diff --git a/fs/ntfs/Makefile b/fs/ntfs/Makefile
index 3665464f4..0e3fd2f01 100644
--- a/fs/ntfs/Makefile
+++ b/fs/ntfs/Makefile
@@ -2,10 +2,11 @@
 
 obj-$(CONFIG_NTFS_FS) += ntfs.o
 
-ntfs-objs := aops.o attrib.o compress.o debug.o dir.o file.o inode.o mft.o \
-	     mst.o namei.o super.o sysctl.o unistr.o upcase.o
+ntfs-objs := aops.o attrib.o collate.o compress.o debug.o dir.o file.o \
+	     index.o inode.o mft.o mst.o namei.o super.o sysctl.o unistr.o \
+	     upcase.o
 
-EXTRA_CFLAGS = -DNTFS_VERSION=\"2.1.14\"
+EXTRA_CFLAGS = -DNTFS_VERSION=\"2.1.15\"
 
 ifeq ($(CONFIG_NTFS_DEBUG),y)
 EXTRA_CFLAGS += -DDEBUG
@@ -14,5 +15,5 @@ endif
 ifeq ($(CONFIG_NTFS_RW),y)
 EXTRA_CFLAGS += -DNTFS_RW
 
-ntfs-objs += logfile.o
+ntfs-objs += logfile.o quota.o
 endif
diff --git a/fs/ntfs/aops.c b/fs/ntfs/aops.c
index 08aa85b44..0ffc1d19c 100644
--- a/fs/ntfs/aops.c
+++ b/fs/ntfs/aops.c
@@ -62,7 +62,8 @@ static void ntfs_end_buffer_async_read(struct buffer_head *bh, int uptodate)
 
 		set_buffer_uptodate(bh);
 
-		file_ofs = (page->index << PAGE_CACHE_SHIFT) + bh_offset(bh);
+		file_ofs = ((s64)page->index << PAGE_CACHE_SHIFT) +
+				bh_offset(bh);
 		/* Check for the current buffer head overflowing. */
 		if (file_ofs + bh->b_size > ni->initialized_size) {
 			char *addr;
@@ -190,7 +191,7 @@ static int ntfs_read_block(struct page *page)
 		return -ENOMEM;
 	}
 
-	iblock = page->index << (PAGE_CACHE_SHIFT - blocksize_bits);
+	iblock = (s64)page->index << (PAGE_CACHE_SHIFT - blocksize_bits);
 	lblock = (ni->allocated_size + blocksize - 1) >> blocksize_bits;
 	zblock = (ni->initialized_size + blocksize - 1) >> blocksize_bits;
 
@@ -204,6 +205,8 @@ static int ntfs_read_block(struct page *page)
 	rl = NULL;
 	nr = i = 0;
 	do {
+		u8 *kaddr;
+
 		if (unlikely(buffer_uptodate(bh)))
 			continue;
 		if (unlikely(buffer_mapped(bh))) {
@@ -279,9 +282,10 @@ handle_hole:
 		bh->b_blocknr = -1UL;
 		clear_buffer_mapped(bh);
 handle_zblock:
-		memset(kmap(page) + i * blocksize, 0, blocksize);
+		kaddr = kmap_atomic(page, KM_USER0);
+		memset(kaddr + i * blocksize, 0, blocksize);
 		flush_dcache_page(page);
-		kunmap(page);
+		kunmap_atomic(kaddr, KM_USER0);
 		set_buffer_uptodate(bh);
 	} while (i++, iblock++, (bh = bh->b_this_page) != head);
 
@@ -343,7 +347,7 @@ int ntfs_readpage(struct file *file, struct page *page)
 {
 	s64 attr_pos;
 	ntfs_inode *ni, *base_ni;
-	char *addr;
+	u8 *kaddr;
 	attr_search_context *ctx;
 	MFT_RECORD *mrec;
 	u32 attr_len;
@@ -362,6 +366,7 @@ int ntfs_readpage(struct file *file, struct page *page)
 
 	ni = NTFS_I(page->mapping->host);
 
+	/* NInoNonResident() == NInoIndexAllocPresent() */
 	if (NInoNonResident(ni)) {
 		/*
 		 * Only unnamed $DATA attributes can be compressed or
@@ -398,7 +403,7 @@ int ntfs_readpage(struct file *file, struct page *page)
 		goto unm_err_out;
 	}
 	if (unlikely(!lookup_attr(ni->type, ni->name, ni->name_len,
-			IGNORE_CASE, 0, NULL, 0, ctx))) {
+			CASE_SENSITIVE, 0, NULL, 0, ctx))) {
 		err = -ENOENT;
 		goto put_unm_err_out;
 	}
@@ -409,22 +414,22 @@ int ntfs_readpage(struct file *file, struct page *page)
 	/* The total length of the attribute value. */
 	attr_len = le32_to_cpu(ctx->attr->data.resident.value_length);
 
-	addr = kmap(page);
+	kaddr = kmap_atomic(page, KM_USER0);
 	/* Copy over in bounds data, zeroing the remainder of the page. */
 	if (attr_pos < attr_len) {
 		u32 bytes = attr_len - attr_pos;
 		if (bytes > PAGE_CACHE_SIZE)
 			bytes = PAGE_CACHE_SIZE;
 		else if (bytes < PAGE_CACHE_SIZE)
-			memset(addr + bytes, 0, PAGE_CACHE_SIZE - bytes);
+			memset(kaddr + bytes, 0, PAGE_CACHE_SIZE - bytes);
 		/* Copy the data to the page. */
-		memcpy(addr, attr_pos + (char*)ctx->attr +
+		memcpy(kaddr, attr_pos + (char*)ctx->attr +
 				le16_to_cpu(
 				ctx->attr->data.resident.value_offset), bytes);
 	} else
-		memset(addr, 0, PAGE_CACHE_SIZE);
+		memset(kaddr, 0, PAGE_CACHE_SIZE);
 	flush_dcache_page(page);
-	kunmap(page);
+	kunmap_atomic(kaddr, KM_USER0);
 
 	SetPageUptodate(page);
 put_unm_err_out:
@@ -440,6 +445,7 @@ err_out:
 
 /**
  * ntfs_write_block - write a @page to the backing store
+ * @wbc:	writeback control structure
  * @page:	page cache page to write out
  *
  * This function is for writing pages belonging to non-resident, non-mst
@@ -508,7 +514,7 @@ static int ntfs_write_block(struct writeback_control *wbc, struct page *page)
 	/* NOTE: Different naming scheme to ntfs_read_block()! */
 
 	/* The first block in the page. */
-	block = page->index << (PAGE_CACHE_SHIFT - blocksize_bits);
+	block = (s64)page->index << (PAGE_CACHE_SHIFT - blocksize_bits);
 
 	/* The first out of bounds block for the data size. */
 	dblock = (vi->i_size + blocksize - 1) >> blocksize_bits;
@@ -767,9 +773,240 @@ lock_retry_remap:
 	return err;
 }
 
+static const char *ntfs_please_email = "Please email "
+		"linux-ntfs-dev@lists.sourceforge.net and say that you saw "
+		"this message.  Thank you.";
+
+/**
+ * ntfs_write_mst_block - write a @page to the backing store
+ * @wbc:	writeback control structure
+ * @page:	page cache page to write out
+ *
+ * This function is for writing pages belonging to non-resident, mst protected
+ * attributes to their backing store.  The only supported attribute is the
+ * index allocation attribute.  Both directory inodes and index inodes are
+ * supported.
+ *
+ * The page must remain locked for the duration of the write because we apply
+ * the mst fixups, write, and then undo the fixups, so if we were to unlock the
+ * page before undoing the fixups, any other user of the page will see the
+ * page contents as corrupt.
+ *
+ * Return 0 on success and -errno on error.
+ *
+ * Based on ntfs_write_block(), ntfs_mft_writepage(), and
+ * write_mft_record_nolock().
+ */
+static int ntfs_write_mst_block(struct writeback_control *wbc,
+		struct page *page)
+{
+	sector_t block, dblock, rec_block;
+	struct inode *vi = page->mapping->host;
+	ntfs_inode *ni = NTFS_I(vi);
+	ntfs_volume *vol = ni->vol;
+	u8 *kaddr;
+	unsigned int bh_size = 1 << vi->i_blkbits;
+	unsigned int rec_size;
+	struct buffer_head *bh, *head;
+	int max_bhs = PAGE_CACHE_SIZE / bh_size;
+	struct buffer_head *bhs[max_bhs];
+	int i, nr_recs, nr_bhs, bhs_per_rec, err;
+	unsigned char bh_size_bits;
+	BOOL rec_is_dirty;
+
+	ntfs_debug("Entering for inode 0x%lx, attribute type 0x%x, page index "
+			"0x%lx.", vi->i_ino, ni->type, page->index);
+	BUG_ON(!NInoNonResident(ni));
+	BUG_ON(!NInoMstProtected(ni));
+	BUG_ON(!(S_ISDIR(vi->i_mode) ||
+			(NInoAttr(ni) && ni->type == AT_INDEX_ALLOCATION)));
+	BUG_ON(PageWriteback(page));
+	BUG_ON(!PageUptodate(page));
+	BUG_ON(!max_bhs);
+
+	/* Make sure we have mapped buffers. */
+	if (unlikely(!page_has_buffers(page))) {
+no_buffers_err_out:
+		ntfs_error(vol->sb, "Writing ntfs records without existing "
+				"buffers is not implemented yet.  %s",
+				ntfs_please_email);
+		err = -EOPNOTSUPP;
+		goto err_out;
+	}
+	bh = head = page_buffers(page);
+	if (unlikely(!bh))
+		goto no_buffers_err_out;
+
+	bh_size_bits = vi->i_blkbits;
+	rec_size = ni->itype.index.block_size;
+	nr_recs = PAGE_CACHE_SIZE / rec_size;
+	BUG_ON(!nr_recs);
+	bhs_per_rec = rec_size >> bh_size_bits;
+	BUG_ON(!bhs_per_rec);
+
+	/* The first block in the page. */
+	rec_block = block = (s64)page->index <<
+			(PAGE_CACHE_SHIFT - bh_size_bits);
+
+	/* The first out of bounds block for the data size. */
+	dblock = (vi->i_size + bh_size - 1) >> bh_size_bits;
+
+	err = nr_bhs = 0;
+	/* Need this to silence a stupid gcc warning. */
+	rec_is_dirty = FALSE;
+	do {
+		if (unlikely(block >= dblock)) {
+			/*
+			 * Mapped buffers outside i_size will occur, because
+			 * this page can be outside i_size when there is a
+			 * truncate in progress. The contents of such buffers
+			 * were zeroed by ntfs_writepage().
+			 *
+			 * FIXME: What about the small race window where
+			 * ntfs_writepage() has not done any clearing because
+			 * the page was within i_size but before we get here,
+			 * vmtruncate() modifies i_size?
+			 */
+			clear_buffer_dirty(bh);
+			continue;
+		}
+		if (rec_block == block) {
+			/* This block is the first one in the record. */
+			rec_block += rec_size >> bh_size_bits;
+			if (!buffer_dirty(bh)) {
+				/* Clean buffers are not written out. */
+				rec_is_dirty = FALSE;
+				continue;
+			}
+			rec_is_dirty = TRUE;
+		} else {
+			/* This block is not the first one in the record. */
+			if (!buffer_dirty(bh)) {
+				/* Clean buffers are not written out. */
+				BUG_ON(rec_is_dirty);
+				continue;
+			}
+			BUG_ON(!rec_is_dirty);
+		}
+		/* Attempting to write outside the initialized size is a bug. */
+		BUG_ON(((block + 1) << bh_size_bits) > ni->initialized_size);
+		if (!buffer_mapped(bh)) {
+			ntfs_error(vol->sb, "Writing ntfs records without "
+					"existing mapped buffers is not "
+					"implemented yet.  %s",
+					ntfs_please_email);
+			clear_buffer_dirty(bh);
+			err = -EOPNOTSUPP;
+			goto cleanup_out;
+		}
+		if (!buffer_uptodate(bh)) {
+			ntfs_error(vol->sb, "Writing ntfs records without "
+					"existing uptodate buffers is not "
+					"implemented yet.  %s",
+					ntfs_please_email);
+			clear_buffer_dirty(bh);
+			err = -EOPNOTSUPP;
+			goto cleanup_out;
+		}
+		bhs[nr_bhs++] = bh;
+		BUG_ON(nr_bhs > max_bhs);
+	} while (block++, (bh = bh->b_this_page) != head);
+	/* If there were no dirty buffers, we are done. */
+	if (!nr_bhs)
+		goto done;
+	/* Apply the mst protection fixups. */
+	kaddr = page_address(page);
+	for (i = 0; i < nr_bhs; i++) {
+		if (!(i % bhs_per_rec)) {
+			err = pre_write_mst_fixup((NTFS_RECORD*)(kaddr +
+					bh_offset(bhs[i])), rec_size);
+			if (err) {
+				ntfs_error(vol->sb, "Failed to apply mst "
+						"fixups (inode 0x%lx, "
+						"attribute type 0x%x, page "
+						"index 0x%lx)!  Umount and "
+						"run chkdsk.", vi->i_ino,
+						ni->type,
+				page->index);
+				nr_bhs = i;
+				goto mst_cleanup_out;
+			}
+		}
+	}
+	flush_dcache_page(page);
+	/* Lock buffers and start synchronous write i/o on them. */
+	for (i = 0; i < nr_bhs; i++) {
+		struct buffer_head *tbh = bhs[i];
+
+		if (unlikely(test_set_buffer_locked(tbh)))
+			BUG();
+		if (unlikely(!test_clear_buffer_dirty(tbh))) {
+			unlock_buffer(tbh);
+			continue;
+		}
+		BUG_ON(!buffer_uptodate(tbh));
+		BUG_ON(!buffer_mapped(tbh));
+		get_bh(tbh);
+		tbh->b_end_io = end_buffer_write_sync;
+		submit_bh(WRITE, tbh);
+	}
+	/* Wait on i/o completion of buffers. */
+	for (i = 0; i < nr_bhs; i++) {
+		struct buffer_head *tbh = bhs[i];
+
+		wait_on_buffer(tbh);
+		if (unlikely(!buffer_uptodate(tbh))) {
+			err = -EIO;
+			/*
+			 * Set the buffer uptodate so the page & buffer states
+			 * don't become out of sync.
+			 */
+			if (PageUptodate(page))
+				set_buffer_uptodate(tbh);
+		}
+	}
+	/* Remove the mst protection fixups again. */
+	for (i = 0; i < nr_bhs; i++) {
+		if (!(i % bhs_per_rec))
+			post_write_mst_fixup((NTFS_RECORD*)(kaddr +
+					bh_offset(bhs[i])));
+	}
+	flush_dcache_page(page);
+	if (unlikely(err)) {
+		/* I/O error during writing.  This is really bad! */
+		ntfs_error(vol->sb, "I/O error while writing ntfs record "
+				"(inode 0x%lx, attribute type 0x%x, page "
+				"index 0x%lx)!  Umount and run chkdsk.",
+				vi->i_ino, ni->type, page->index);
+		goto err_out;
+	}
+done:
+	set_page_writeback(page);
+	unlock_page(page);
+	end_page_writeback(page);
+	if (!err)
+		ntfs_debug("Done.");
+	return err;
+mst_cleanup_out:
+	/* Remove the mst protection fixups again. */
+	for (i = 0; i < nr_bhs; i++) {
+		if (!(i % bhs_per_rec))
+			post_write_mst_fixup((NTFS_RECORD*)(kaddr +
+					bh_offset(bhs[i])));
+	}
+cleanup_out:
+	/* Clean the buffers. */
+	for (i = 0; i < nr_bhs; i++)
+		clear_buffer_dirty(bhs[i]);
+err_out:
+	SetPageError(page);
+	goto done;
+}
+
 /**
  * ntfs_writepage - write a @page to the backing store
  * @page:	page cache page to write out
+ * @wbc:	writeback control structure
  *
  * For non-resident attributes, ntfs_writepage() writes the @page by calling
  * the ntfs version of the generic block_write_full_page() function,
@@ -812,6 +1049,7 @@ static int ntfs_writepage(struct page *page, struct writeback_control *wbc)
 
 	ni = NTFS_I(vi);
 
+	/* NInoNonResident() == NInoIndexAllocPresent() */
 	if (NInoNonResident(ni)) {
 		/*
 		 * Only unnamed $DATA attributes can be compressed, encrypted,
@@ -843,7 +1081,6 @@ static int ntfs_writepage(struct page *page, struct writeback_control *wbc)
 				return -EOPNOTSUPP;
 			}
 		}
-
 		/* We have to zero every time due to mmap-at-end-of-file. */
 		if (page->index >= (vi->i_size >> PAGE_CACHE_SHIFT)) {
 			/* The page straddles i_size. */
@@ -853,16 +1090,9 @@ static int ntfs_writepage(struct page *page, struct writeback_control *wbc)
 			flush_dcache_page(page);
 			kunmap_atomic(kaddr, KM_USER0);
 		}
-
-		// TODO: Implement and remove this check.
-		if (NInoMstProtected(ni)) {
-			unlock_page(page);
-			ntfs_error(vi->i_sb, "Writing to MST protected "
-					"attributes is not supported yet. "
-					"Sorry.");
-			return -EOPNOTSUPP;
-		}
-
+		/* Handle mst protected attributes. */
+		if (NInoMstProtected(ni))
+			return ntfs_write_mst_block(wbc, page);
 		/* Normal data stream. */
 		return ntfs_write_block(wbc, page);
 	}
@@ -893,7 +1123,7 @@ static int ntfs_writepage(struct page *page, struct writeback_control *wbc)
 		goto err_out;
 	}
 	if (unlikely(!lookup_attr(ni->type, ni->name, ni->name_len,
-			IGNORE_CASE, 0, NULL, 0, ctx))) {
+			CASE_SENSITIVE, 0, NULL, 0, ctx))) {
 		err = -ENOENT;
 		goto err_out;
 	}
@@ -1042,7 +1272,7 @@ static int ntfs_prepare_nonresident_write(struct page *page,
 		return -ENOMEM;
 
 	/* The first block in the page. */
-	block = page->index << (PAGE_CACHE_SHIFT - blocksize_bits);
+	block = (s64)page->index << (PAGE_CACHE_SHIFT - blocksize_bits);
 
 	/*
 	 * The first out of bounds block for the allocated size. No need to
@@ -1667,7 +1897,7 @@ static int ntfs_commit_write(struct file *file, struct page *page,
 		goto err_out;
 	}
 	if (unlikely(!lookup_attr(ni->type, ni->name, ni->name_len,
-			IGNORE_CASE, 0, NULL, 0, ctx))) {
+			CASE_SENSITIVE, 0, NULL, 0, ctx))) {
 		err = -ENOENT;
 		goto err_out;
 	}
@@ -1783,7 +2013,7 @@ struct address_space_operations ntfs_aops = {
 	.prepare_write	= ntfs_prepare_write,	/* Prepare page and buffers
 						   ready to receive data. */
 	.commit_write	= ntfs_commit_write,	/* Commit received data. */
-#endif
+#endif /* NTFS_RW */
 };
 
 /**
@@ -1794,4 +2024,10 @@ struct address_space_operations ntfs_mst_aops = {
 	.readpage	= ntfs_readpage,	/* Fill page with data. */
 	.sync_page	= block_sync_page,	/* Currently, just unplugs the
 						   disk request queue. */
+#ifdef NTFS_RW
+	.writepage	= ntfs_writepage,	/* Write dirty page to disk. */
+	.set_page_dirty	= __set_page_dirty_nobuffers,	/* Set the page dirty
+						   without touching the buffers
+						   belonging to the page. */
+#endif /* NTFS_RW */
 };
diff --git a/fs/ntfs/attrib.c b/fs/ntfs/attrib.c
index 6c7fb2a2b..55686f7bd 100644
--- a/fs/ntfs/attrib.c
+++ b/fs/ntfs/attrib.c
@@ -963,7 +963,7 @@ int map_run_list(ntfs_inode *ni, VCN vcn)
 		err = -ENOMEM;
 		goto err_out;
 	}
-	if (!lookup_attr(ni->type, ni->name, ni->name_len, IGNORE_CASE, vcn,
+	if (!lookup_attr(ni->type, ni->name, ni->name_len, CASE_SENSITIVE, vcn,
 			NULL, 0, ctx)) {
 		put_attr_search_ctx(ctx);
 		err = -ENOENT;
@@ -1343,8 +1343,8 @@ err_out:
  * base inode).
  *
  * After finishing with the attribute/mft record you need to call
- * release_attr_search_ctx() to cleanup the search context (unmapping any
- * mapped inodes, etc).
+ * put_attr_search_ctx() to cleanup the search context (unmapping any mapped
+ * inodes, etc).
  *
  * Return TRUE if the search was successful and FALSE if not. When TRUE,
  * @ctx->attr is the found attribute and it is in mft record @ctx->mrec. When
@@ -1614,8 +1614,8 @@ not_found:
  * continue searches where they were left off at.
  *
  * After finishing with the attribute/mft record you need to call
- * release_attr_search_ctx() to cleanup the search context (unmapping any
- * mapped inodes, etc).
+ * put_attr_search_ctx() to cleanup the search context (unmapping any mapped
+ * inodes, etc).
  *
  * Return TRUE if the search was successful and FALSE if not. When TRUE,
  * @ctx->attr is the found attribute and it is in mft record @ctx->mrec. When
diff --git a/fs/ntfs/compress.c b/fs/ntfs/compress.c
index f9aca53c7..c39391bab 100644
--- a/fs/ntfs/compress.c
+++ b/fs/ntfs/compress.c
@@ -195,7 +195,7 @@ static int ntfs_decompress(struct page *dest_pages[], int *dest_index,
 
 	ntfs_debug("Entering, cb_size = 0x%x.", cb_size);
 do_next_sb:
-	ntfs_debug("Beginning sub-block at offset = 0x%x in the cb.",
+	ntfs_debug("Beginning sub-block at offset = 0x%zx in the cb.",
 			cb - cb_start);
 	/*
 	 * Have we reached the end of the compression block or the end of the
diff --git a/fs/ntfs/dir.c b/fs/ntfs/dir.c
index 153100bfc..246862279 100644
--- a/fs/ntfs/dir.c
+++ b/fs/ntfs/dir.c
@@ -63,6 +63,14 @@ ntfschar I30[5] = { const_cpu_to_le16('$'), const_cpu_to_le16('I'),
  * This is to avoid polluting the dcache with short file names. We want them to
  * work but we don't care for how quickly one can access them. This also fixes
  * the dcache aliasing issues.
+ *
+ * Locking:  - Caller must hold i_sem on the directory.
+ *	     - Each page cache page in the index allocation mapping must be
+ *	       locked whilst being accessed otherwise we may find a corrupt
+ *	       page due to it being under ->writepage at the moment which
+ *	       applies the mst protection fixups before writing out and then
+ *	       removes them again after the write is complete after which it 
+ *	       unlocks the page.
  */
 MFT_REF ntfs_lookup_inode_by_name(ntfs_inode *dir_ni, const ntfschar *uname,
 		const int uname_len, ntfs_name **res)
@@ -83,6 +91,8 @@ MFT_REF ntfs_lookup_inode_by_name(ntfs_inode *dir_ni, const ntfschar *uname,
 	u8 *kaddr;
 	ntfs_name *name = NULL;
 
+	BUG_ON(!S_ISDIR(VFS_I(dir_ni)->i_mode));
+	BUG_ON(NInoAttr(dir_ni));
 	/* Get hold of the mft record for the directory. */
 	m = map_mft_record(dir_ni);
 	if (unlikely(IS_ERR(m))) {
@@ -309,6 +319,7 @@ descend_into_child_node:
 		err = PTR_ERR(page);
 		goto err_out;
 	}
+	lock_page(page);
 	kaddr = (u8*)page_address(page);
 fast_descend_into_child_node:
 	/* Get to the index allocation block. */
@@ -429,6 +440,7 @@ found_it2:
 				*res = NULL;
 			}
 			mref = le64_to_cpu(ie->data.dir.indexed_file);
+			unlock_page(page);
 			ntfs_unmap_page(page);
 			return mref;
 		}
@@ -461,6 +473,7 @@ found_it2:
 						"this message to "
 						"linux-ntfs-dev@lists."
 						"sourceforge.net.");
+				unlock_page(page);
 				ntfs_unmap_page(page);
 				goto dir_err_out;
 			}
@@ -543,6 +556,7 @@ found_it2:
 					vol->cluster_size_bits >>
 					PAGE_CACHE_SHIFT)
 				goto fast_descend_into_child_node;
+			unlock_page(page);
 			ntfs_unmap_page(page);
 			goto descend_into_child_node;
 		}
@@ -557,12 +571,14 @@ found_it2:
 	 * associated with it.
 	 */
 	if (name) {
+		unlock_page(page);
 		ntfs_unmap_page(page);
 		return name->mref;
 	}
 	ntfs_debug("Entry not found.");
 	err = -ENOENT;
 unm_err_out:
+	unlock_page(page);
 	ntfs_unmap_page(page);
 err_out:
 	if (ctx)
@@ -778,6 +794,7 @@ descend_into_child_node:
 		err = PTR_ERR(page);
 		goto err_out;
 	}
+	lock_page(page);
 	kaddr = (u8*)page_address(page);
 fast_descend_into_child_node:
 	/* Get to the index allocation block. */
@@ -880,6 +897,7 @@ fast_descend_into_child_node:
 				vol->upcase, vol->upcase_len)) {
 found_it2:
 			mref = le64_to_cpu(ie->data.dir.indexed_file);
+			unlock_page(page);
 			ntfs_unmap_page(page);
 			return mref;
 		}
@@ -944,6 +962,7 @@ found_it2:
 					vol->cluster_size_bits >>
 					PAGE_CACHE_SHIFT)
 				goto fast_descend_into_child_node;
+			unlock_page(page);
 			ntfs_unmap_page(page);
 			goto descend_into_child_node;
 		}
@@ -956,6 +975,7 @@ found_it2:
 	ntfs_debug("Entry not found.");
 	err = -ENOENT;
 unm_err_out:
+	unlock_page(page);
 	ntfs_unmap_page(page);
 err_out:
 	if (ctx)
@@ -988,6 +1008,7 @@ typedef enum {
  * @ndir:	ntfs inode of current directory
  * @index_type:	specifies whether @iu is an index root or an index allocation
  * @iu:		index root or index allocation attribute to which @ie belongs
+ * @ia_page:	page in which the index allocation buffer @ie is in resides
  * @ie:		current index entry
  * @name:	buffer to use for the converted name
  * @dirent:	vfs filldir callback context
@@ -995,13 +1016,24 @@ typedef enum {
  *
  * Convert the Unicode @name to the loaded NLS and pass it to the @filldir
  * callback.
+ *
+ * If @index_type is INDEX_TYPE_ALLOCATION, @ia_page is the locked page
+ * containing the index allocation block containing the index entry @ie.
+ * Otherwise, @ia_page is NULL.
+ *
+ * Note, we drop (and then reacquire) the page lock on @ia_page across the
+ * @filldir() call otherwise we would deadlock with NFSd when it calls ->lookup
+ * since ntfs_lookup() will lock the same page.  As an optimization, we do not
+ * retake the lock if we are returning a non-zero value as ntfs_readdir()
+ * would need to drop the lock immediately anyway.
  */
 static inline int ntfs_filldir(ntfs_volume *vol, loff_t *fpos,
 		ntfs_inode *ndir, const INDEX_TYPE index_type,
-		index_union iu, INDEX_ENTRY *ie, u8 *name,
-		void *dirent, filldir_t filldir)
+		index_union iu, struct page *ia_page, INDEX_ENTRY *ie,
+		u8 *name, void *dirent, filldir_t filldir)
 {
-	int name_len;
+	unsigned long mref;
+	int name_len, rc;
 	unsigned dt_type;
 	FILE_NAME_TYPE_FLAGS name_type;
 
@@ -1039,24 +1071,42 @@ static inline int ntfs_filldir(ntfs_volume *vol, loff_t *fpos,
 		dt_type = DT_DIR;
 	else
 		dt_type = DT_REG;
+	mref = MREF_LE(ie->data.dir.indexed_file);
+	/*
+	 * Drop the page lock otherwise we deadlock with NFS when it calls
+	 * ->lookup since ntfs_lookup() will lock the same page.
+	 */
+	if (index_type == INDEX_TYPE_ALLOCATION)
+		unlock_page(ia_page);
 	ntfs_debug("Calling filldir for %s with len %i, fpos 0x%llx, inode "
-			"0x%lx, DT_%s.", name, name_len, *fpos,
-			MREF_LE(ie->data.dir.indexed_file),
+			"0x%lx, DT_%s.", name, name_len, *fpos, mref,
 			dt_type == DT_DIR ? "DIR" : "REG");
-	return filldir(dirent, name, name_len, *fpos,
-			MREF_LE(ie->data.dir.indexed_file), dt_type);
+	rc = filldir(dirent, name, name_len, *fpos, mref, dt_type);
+	/* Relock the page but not if we are aborting ->readdir. */
+	if (!rc && index_type == INDEX_TYPE_ALLOCATION)
+		lock_page(ia_page);
+	return rc;
 }
 
 /*
- * VFS calls readdir without BKL but with i_sem held. This protects the VFS
- * parts (e.g. ->f_pos and ->i_size, and it also protects against directory
- * modifications).
- *
  * We use the same basic approach as the old NTFS driver, i.e. we parse the
  * index root entries and then the index allocation entries that are marked
  * as in use in the index bitmap.
+ *
  * While this will return the names in random order this doesn't matter for
- * readdir but OTOH results in a faster readdir.
+ * ->readdir but OTOH results in a faster ->readdir.
+ *
+ * VFS calls ->readdir without BKL but with i_sem held. This protects the VFS
+ * parts (e.g. ->f_pos and ->i_size, and it also protects against directory
+ * modifications).
+ *
+ * Locking:  - Caller must hold i_sem on the directory.
+ *	     - Each page cache page in the index allocation mapping must be
+ *	       locked whilst being accessed otherwise we may find a corrupt
+ *	       page due to it being under ->writepage at the moment which
+ *	       applies the mst protection fixups before writing out and then
+ *	       removes them again after the write is complete after which it 
+ *	       unlocks the page.
  */
 static int ntfs_readdir(struct file *filp, void *dirent, filldir_t filldir)
 {
@@ -1172,7 +1222,7 @@ static int ntfs_readdir(struct file *filp, void *dirent, filldir_t filldir)
 	 * or signals an error (both covered by the rc test).
 	 */
 	for (;; ie = (INDEX_ENTRY*)((u8*)ie + le16_to_cpu(ie->length))) {
-		ntfs_debug("In index root, offset 0x%x.", (u8*)ie - (u8*)ir);
+		ntfs_debug("In index root, offset 0x%zx.", (u8*)ie - (u8*)ir);
 		/* Bounds checks. */
 		if (unlikely((u8*)ie < (u8*)ir || (u8*)ie +
 				sizeof(INDEX_ENTRY_HEADER) > index_end ||
@@ -1186,8 +1236,8 @@ static int ntfs_readdir(struct file *filp, void *dirent, filldir_t filldir)
 		if (ir_pos > (u8*)ie - (u8*)ir)
 			continue;
 		/* Submit the name to the filldir callback. */
-		rc = ntfs_filldir(vol, &fpos, ndir, INDEX_TYPE_ROOT, ir, ie,
-				name, dirent, filldir);
+		rc = ntfs_filldir(vol, &fpos, ndir, INDEX_TYPE_ROOT, ir, NULL,
+				ie, name, dirent, filldir);
 		if (rc) {
 			kfree(ir);
 			goto abort;
@@ -1268,8 +1318,10 @@ find_next_index_buffer:
 	/* If the current index buffer is in the same page we reuse the page. */
 	if ((prev_ia_pos & PAGE_CACHE_MASK) != (ia_pos & PAGE_CACHE_MASK)) {
 		prev_ia_pos = ia_pos;
-		if (likely(ia_page != NULL))
+		if (likely(ia_page != NULL)) {
+			unlock_page(ia_page);
 			ntfs_unmap_page(ia_page);
+		}
 		/*
 		 * Map the page cache page containing the current ia_pos,
 		 * reading it from disk if necessary.
@@ -1281,6 +1333,7 @@ find_next_index_buffer:
 			ia_page = NULL;
 			goto err_out;
 		}
+		lock_page(ia_page);
 		kaddr = (u8*)page_address(ia_page);
 	}
 	/* Get the current index buffer. */
@@ -1358,10 +1411,16 @@ find_next_index_buffer:
 		/* Skip index block entry if continuing previous readdir. */
 		if (ia_pos - ia_start > (u8*)ie - (u8*)ia)
 			continue;
-		/* Submit the name to the filldir callback. */
+		/*
+		 * Submit the name to the @filldir callback.  Note,
+		 * ntfs_filldir() drops the lock on @ia_page but it retakes it
+		 * before returning, unless a non-zero value is returned in
+		 * which case the page is left unlocked.
+		 */
 		rc = ntfs_filldir(vol, &fpos, ndir, INDEX_TYPE_ALLOCATION, ia,
-				ie, name, dirent, filldir);
+				ia_page, ie, name, dirent, filldir);
 		if (rc) {
+			/* @ia_page is already unlocked in this case. */
 			ntfs_unmap_page(ia_page);
 			ntfs_unmap_page(bmp_page);
 			goto abort;
@@ -1369,8 +1428,10 @@ find_next_index_buffer:
 	}
 	goto find_next_index_buffer;
 unm_EOD:
-	if (ia_page)
+	if (ia_page) {
+		unlock_page(ia_page);
 		ntfs_unmap_page(ia_page);
+	}
 	ntfs_unmap_page(bmp_page);
 EOD:
 	/* We are finished, set fpos to EOD. */
@@ -1390,8 +1451,10 @@ done:
 err_out:
 	if (bmp_page)
 		ntfs_unmap_page(bmp_page);
-	if (ia_page)
+	if (ia_page) {
+		unlock_page(ia_page);
 		ntfs_unmap_page(ia_page);
+	}
 	if (ir)
 		kfree(ir);
 	if (name)
diff --git a/fs/ntfs/inode.c b/fs/ntfs/inode.c
index 1abe1b399..686d5bbb5 100644
--- a/fs/ntfs/inode.c
+++ b/fs/ntfs/inode.c
@@ -134,6 +134,8 @@ static int ntfs_init_locked_inode(struct inode *vi, ntfs_attr *na)
 typedef int (*set_t)(struct inode *, void *);
 static int ntfs_read_locked_inode(struct inode *vi);
 static int ntfs_read_locked_attr_inode(struct inode *base_vi, struct inode *vi);
+static int ntfs_read_locked_index_inode(struct inode *base_vi,
+		struct inode *vi);
 
 /**
  * ntfs_iget - obtain a struct inode corresponding to a specific normal inode
@@ -201,6 +203,9 @@ struct inode *ntfs_iget(struct super_block *sb, unsigned long mft_no)
  * initialized, and finally ntfs_read_locked_attr_inode() is called to read the
  * attribute and fill in the inode structure.
  *
+ * Note, for index allocation attributes, you need to use ntfs_index_iget()
+ * instead of ntfs_attr_iget() as working with indices is a lot more complex.
+ *
  * Return the struct inode of the attribute inode on success. Check the return
  * value with IS_ERR() and if true, the function failed and the error code is
  * obtained from PTR_ERR().
@@ -212,6 +217,9 @@ struct inode *ntfs_attr_iget(struct inode *base_vi, ATTR_TYPES type,
 	ntfs_attr na;
 	int err;
 
+	/* Make sure no one calls ntfs_attr_iget() for indices. */
+	BUG_ON(type == AT_INDEX_ALLOCATION);
+
 	na.mft_no = base_vi->i_ino;
 	na.type = type;
 	na.name = name;
@@ -241,6 +249,61 @@ struct inode *ntfs_attr_iget(struct inode *base_vi, ATTR_TYPES type,
 	return vi;
 }
 
+/**
+ * ntfs_index_iget - obtain a struct inode corresponding to an index
+ * @base_vi:	vfs base inode containing the index related attributes
+ * @name:	Unicode name of the index
+ * @name_len:	length of @name in Unicode characters
+ *
+ * Obtain the (fake) struct inode corresponding to the index specified by @name
+ * and @name_len, which is present in the base mft record specified by the vfs
+ * inode @base_vi.
+ *
+ * If the index inode is in the cache, it is just returned with an increased
+ * reference count.  Otherwise, a new struct inode is allocated and
+ * initialized, and finally ntfs_read_locked_index_inode() is called to read
+ * the index related attributes and fill in the inode structure.
+ *
+ * Return the struct inode of the index inode on success. Check the return
+ * value with IS_ERR() and if true, the function failed and the error code is
+ * obtained from PTR_ERR().
+ */
+struct inode *ntfs_index_iget(struct inode *base_vi, ntfschar *name,
+		u32 name_len)
+{
+	struct inode *vi;
+	ntfs_attr na;
+	int err;
+
+	na.mft_no = base_vi->i_ino;
+	na.type = AT_INDEX_ALLOCATION;
+	na.name = name;
+	na.name_len = name_len;
+
+	vi = iget5_locked(base_vi->i_sb, na.mft_no, (test_t)ntfs_test_inode,
+			(set_t)ntfs_init_locked_inode, &na);
+	if (!vi)
+		return ERR_PTR(-ENOMEM);
+
+	err = 0;
+
+	/* If this is a freshly allocated inode, need to read it now. */
+	if (vi->i_state & I_NEW) {
+		err = ntfs_read_locked_index_inode(base_vi, vi);
+		unlock_new_inode(vi);
+	}
+	/*
+	 * There is no point in keeping bad index inodes around.  This also
+	 * simplifies things in that we never need to check for bad index
+	 * inodes elsewhere.
+	 */
+	if (err) {
+		iput(vi);
+		vi = ERR_PTR(err);
+	}
+	return vi;
+}
+
 struct inode *ntfs_alloc_big_inode(struct super_block *sb)
 {
 	ntfs_inode *ni;
@@ -319,6 +382,7 @@ static void __ntfs_init_inode(struct super_block *sb, ntfs_inode *ni)
 	ni->itype.index.bmp_ino = NULL;
 	ni->itype.index.block_size = 0;
 	ni->itype.index.vcn_size = 0;
+	ni->itype.index.collation_rule = 0;
 	ni->itype.index.block_size_bits = 0;
 	ni->itype.index.vcn_size_bits = 0;
 	init_MUTEX(&ni->extent_lock);
@@ -438,9 +502,7 @@ err_corrupt_attr:
  *
  * The only fields in @vi that we need to/can look at when the function is
  * called are i_sb, pointing to the mounted device's super block, and i_ino,
- * the number of the inode to load. If this is a fake inode, i.e. NInoAttr(),
- * then the fields type, name, and name_len are also valid, and describe the
- * attribute which this fake inode represents.
+ * the number of the inode to load.
  *
  * ntfs_read_locked_inode() maps, pins and locks the mft record number i_ino
  * for reading and sets up the necessary @vi fields as well as initializing
@@ -449,12 +511,12 @@ err_corrupt_attr:
  * Q: What locks are held when the function is called?
  * A: i_state has I_LOCK set, hence the inode is locked, also
  *    i_count is set to 1, so it is not going to go away
- *    i_flags is set to 0 and we have no business touching it. Only an ioctl()
+ *    i_flags is set to 0 and we have no business touching it.  Only an ioctl()
  *    is allowed to write to them. We should of course be honouring them but
  *    we need to do that using the IS_* macros defined in include/linux/fs.h.
  *    In any case ntfs_read_locked_inode() has nothing to do with i_flags.
  *
- * Return 0 on success and -errno on error. In the error case, the inode will
+ * Return 0 on success and -errno on error.  In the error case, the inode will
  * have had make_bad_inode() executed on it.
  */
 static int ntfs_read_locked_inode(struct inode *vi)
@@ -730,6 +792,7 @@ skip_attr_list_load:
 					"COLLATION_FILE_NAME. Not allowed.");
 			goto unm_err_out;
 		}
+		ni->itype.index.collation_rule = ir->collation_rule;
 		ni->itype.index.block_size = le32_to_cpu(ir->index_block_size);
 		if (ni->itype.index.block_size &
 				(ni->itype.index.block_size - 1)) {
@@ -1050,8 +1113,8 @@ err_out:
  * @base_vi:	base inode
  * @vi:		attribute inode to read
  *
- * ntfs_read_locked_attr_inode() is called from the ntfs_attr_iget() to read
- * the attribute inode described by @vi into memory from the base mft record
+ * ntfs_read_locked_attr_inode() is called from ntfs_attr_iget() to read the
+ * attribute inode described by @vi into memory from the base mft record
  * described by @base_ni.
  *
  * ntfs_read_locked_attr_inode() maps, pins and locks the base inode for
@@ -1061,6 +1124,9 @@ err_out:
  * Q: What locks are held when the function is called?
  * A: i_state has I_LOCK set, hence the inode is locked, also
  *    i_count is set to 1, so it is not going to go away
+ *
+ * Return 0 on success and -errno on error.  In the error case, the inode will
+ * have had make_bad_inode() executed on it.
  */
 static int ntfs_read_locked_attr_inode(struct inode *base_vi, struct inode *vi)
 {
@@ -1103,7 +1169,7 @@ static int ntfs_read_locked_attr_inode(struct inode *base_vi, struct inode *vi)
 	}
 
 	/* Find the attribute. */
-	if (!lookup_attr(ni->type, ni->name, ni->name_len, IGNORE_CASE, 0,
+	if (!lookup_attr(ni->type, ni->name, ni->name_len, CASE_SENSITIVE, 0,
 			NULL, 0, ctx))
 		goto unm_err_out;
 
@@ -1287,6 +1353,261 @@ err_out:
 	return err;
 }
 
+/**
+ * ntfs_read_locked_index_inode - read an index inode from its base inode
+ * @base_vi:	base inode
+ * @vi:		index inode to read
+ *
+ * ntfs_read_locked_index_inode() is called from ntfs_index_iget() to read the
+ * index inode described by @vi into memory from the base mft record described
+ * by @base_ni.
+ *
+ * ntfs_read_locked_index_inode() maps, pins and locks the base inode for
+ * reading and looks up the attributes relating to the index described by @vi
+ * before setting up the necessary fields in @vi as well as initializing the
+ * ntfs inode.
+ *
+ * Note, index inodes are essentially attribute inodes (NInoAttr() is true)
+ * with the attribute type set to AT_INDEX_ALLOCATION.  Apart from that, they
+ * are setup like directory inodes since directories are a special case of
+ * indices ao they need to be treated in much the same way.  Most importantly,
+ * for small indices the index allocation attribute might not actually exist.
+ * However, the index root attribute always exists but this does not need to
+ * have an inode associated with it and this is why we define a new inode type
+ * index.  Also, like for directories, we need to have an attribute inode for
+ * the bitmap attribute corresponding to the index allocation attribute and we
+ * can store this in the appropriate field of the inode, just like we do for
+ * normal directory inodes.
+ *
+ * Q: What locks are held when the function is called?
+ * A: i_state has I_LOCK set, hence the inode is locked, also
+ *    i_count is set to 1, so it is not going to go away
+ *
+ * Return 0 on success and -errno on error.  In the error case, the inode will
+ * have had make_bad_inode() executed on it.
+ */
+static int ntfs_read_locked_index_inode(struct inode *base_vi, struct inode *vi)
+{
+	ntfs_volume *vol = NTFS_SB(vi->i_sb);
+	ntfs_inode *ni, *base_ni, *bni;
+	struct inode *bvi;
+	MFT_RECORD *m;
+	attr_search_context *ctx;
+	INDEX_ROOT *ir;
+	u8 *ir_end, *index_end;
+	int err = 0;
+
+	ntfs_debug("Entering for i_ino 0x%lx.", vi->i_ino);
+	ntfs_init_big_inode(vi);
+	ni	= NTFS_I(vi);
+	base_ni = NTFS_I(base_vi);
+	/* Just mirror the values from the base inode. */
+	vi->i_blksize	= base_vi->i_blksize;
+	vi->i_version	= base_vi->i_version;
+	vi->i_uid	= base_vi->i_uid;
+	vi->i_gid	= base_vi->i_gid;
+	vi->i_nlink	= base_vi->i_nlink;
+	vi->i_mtime	= base_vi->i_mtime;
+	vi->i_ctime	= base_vi->i_ctime;
+	vi->i_atime	= base_vi->i_atime;
+	vi->i_generation = ni->seq_no = base_ni->seq_no;
+	/* Set inode type to zero but preserve permissions. */
+	vi->i_mode	= base_vi->i_mode & ~S_IFMT;
+	/* Map the mft record for the base inode. */
+	m = map_mft_record(base_ni);
+	if (IS_ERR(m)) {
+		err = PTR_ERR(m);
+		goto err_out;
+	}
+	ctx = get_attr_search_ctx(base_ni, m);
+	if (!ctx) {
+		err = -ENOMEM;
+		goto unm_err_out;
+	}
+	/* Find the index root attribute. */
+	if (!lookup_attr(AT_INDEX_ROOT, ni->name, ni->name_len, CASE_SENSITIVE,
+			0, NULL, 0, ctx)) {
+		ntfs_error(vi->i_sb, "$INDEX_ROOT attribute is missing.");
+		goto unm_err_out;
+	}
+	/* Set up the state. */
+	if (ctx->attr->non_resident) {
+		ntfs_error(vi->i_sb, "$INDEX_ROOT attribute is not resident.  "
+				"Not allowed.");
+		goto unm_err_out;
+	}
+	/* Compressed/encrypted/sparse index root is not allowed. */
+	if (ctx->attr->flags & (ATTR_COMPRESSION_MASK | ATTR_IS_ENCRYPTED |
+			ATTR_IS_SPARSE)) {
+		ntfs_error(vi->i_sb, "Found compressed/encrypted/sparse index "
+				"root attribute.  Not allowed.");
+		goto unm_err_out;
+	}
+	ir = (INDEX_ROOT*)((u8*)ctx->attr +
+			le16_to_cpu(ctx->attr->data.resident.value_offset));
+	ir_end = (u8*)ir + le32_to_cpu(ctx->attr->data.resident.value_length);
+	if (ir_end > (u8*)ctx->mrec + vol->mft_record_size) {
+		ntfs_error(vi->i_sb, "$INDEX_ROOT attribute is corrupt.");
+		goto unm_err_out;
+	}
+	index_end = (u8*)&ir->index + le32_to_cpu(ir->index.index_length);
+	if (index_end > ir_end) {
+		ntfs_error(vi->i_sb, "Index is corrupt.");
+		goto unm_err_out;
+	}
+	if (ir->type) {
+		ntfs_error(vi->i_sb, "Index type is not 0 (type is 0x%x).  "
+				"Not allowed.", le32_to_cpu(ir->type));
+		goto unm_err_out;
+	}
+	ni->itype.index.collation_rule = ir->collation_rule;
+	ntfs_debug("Index collation rule is 0x%x.",
+			le32_to_cpu(ir->collation_rule));
+	ni->itype.index.block_size = le32_to_cpu(ir->index_block_size);
+	if (ni->itype.index.block_size & (ni->itype.index.block_size - 1)) {
+		ntfs_error(vi->i_sb, "Index block size (%u) is not a power of "
+				"two.", ni->itype.index.block_size);
+		goto unm_err_out;
+	}
+	if (ni->itype.index.block_size > PAGE_CACHE_SIZE) {
+		ntfs_error(vi->i_sb, "Index block size (%u) > PAGE_CACHE_SIZE "
+				"(%ld) is not supported.  Sorry.",
+				ni->itype.index.block_size, PAGE_CACHE_SIZE);
+		err = -EOPNOTSUPP;
+		goto unm_err_out;
+	}
+	if (ni->itype.index.block_size < NTFS_BLOCK_SIZE) {
+		ntfs_error(vi->i_sb, "Index block size (%u) < NTFS_BLOCK_SIZE "
+				"(%i) is not supported.  Sorry.",
+				ni->itype.index.block_size, NTFS_BLOCK_SIZE);
+		err = -EOPNOTSUPP;
+		goto unm_err_out;
+	}
+	ni->itype.index.block_size_bits = ffs(ni->itype.index.block_size) - 1;
+	/* Determine the size of a vcn in the index. */
+	if (vol->cluster_size <= ni->itype.index.block_size) {
+		ni->itype.index.vcn_size = vol->cluster_size;
+		ni->itype.index.vcn_size_bits = vol->cluster_size_bits;
+	} else {
+		ni->itype.index.vcn_size = vol->sector_size;
+		ni->itype.index.vcn_size_bits = vol->sector_size_bits;
+	}
+	/* Check for presence of index allocation attribute. */
+	if (!(ir->index.flags & LARGE_INDEX)) {
+		/* No index allocation. */
+		vi->i_size = ni->initialized_size = ni->allocated_size = 0;
+		/* We are done with the mft record, so we release it. */
+		put_attr_search_ctx(ctx);
+		unmap_mft_record(base_ni);
+		m = NULL;
+		ctx = NULL;
+		goto skip_large_index_stuff;
+	} /* LARGE_INDEX:  Index allocation present.  Setup state. */
+	NInoSetIndexAllocPresent(ni);
+	/* Find index allocation attribute. */
+	reinit_attr_search_ctx(ctx);
+	if (!lookup_attr(AT_INDEX_ALLOCATION, ni->name, ni->name_len,
+			CASE_SENSITIVE, 0, NULL, 0, ctx)) {
+		ntfs_error(vi->i_sb, "$INDEX_ALLOCATION attribute is not "
+				"present but $INDEX_ROOT indicated it is.");
+		goto unm_err_out;
+	}
+	if (!ctx->attr->non_resident) {
+		ntfs_error(vi->i_sb, "$INDEX_ALLOCATION attribute is "
+				"resident.");
+		goto unm_err_out;
+	}
+	if (ctx->attr->flags & ATTR_IS_ENCRYPTED) {
+		ntfs_error(vi->i_sb, "$INDEX_ALLOCATION attribute is "
+				"encrypted.");
+		goto unm_err_out;
+	}
+	if (ctx->attr->flags & ATTR_IS_SPARSE) {
+		ntfs_error(vi->i_sb, "$INDEX_ALLOCATION attribute is sparse.");
+		goto unm_err_out;
+	}
+	if (ctx->attr->flags & ATTR_COMPRESSION_MASK) {
+		ntfs_error(vi->i_sb, "$INDEX_ALLOCATION attribute is "
+				"compressed.");
+		goto unm_err_out;
+	}
+	if (ctx->attr->data.non_resident.lowest_vcn) {
+		ntfs_error(vi->i_sb, "First extent of $INDEX_ALLOCATION "
+				"attribute has non zero lowest_vcn.  Inode is "
+				"corrupt. You should run chkdsk.");
+		goto unm_err_out;
+	}
+	vi->i_size = sle64_to_cpu(ctx->attr->data.non_resident.data_size);
+	ni->initialized_size = sle64_to_cpu(
+			ctx->attr->data.non_resident.initialized_size);
+	ni->allocated_size = sle64_to_cpu(
+			ctx->attr->data.non_resident.allocated_size);
+	/*
+	 * We are done with the mft record, so we release it.  Otherwise
+	 * we would deadlock in ntfs_attr_iget().
+	 */
+	put_attr_search_ctx(ctx);
+	unmap_mft_record(base_ni);
+	m = NULL;
+	ctx = NULL;
+	/* Get the index bitmap attribute inode. */
+	bvi = ntfs_attr_iget(base_vi, AT_BITMAP, ni->name, ni->name_len);
+	if (unlikely(IS_ERR(bvi))) {
+		ntfs_error(vi->i_sb, "Failed to get bitmap attribute.");
+		err = PTR_ERR(bvi);
+		goto unm_err_out;
+	}
+	bni = NTFS_I(bvi);
+	if (NInoCompressed(bni) || NInoEncrypted(bni) ||
+			NInoSparse(bni)) {
+		ntfs_error(vi->i_sb, "$BITMAP attribute is compressed "
+				"and/or encrypted and/or sparse.");
+		goto iput_unm_err_out;
+	}
+	/* Consistency check bitmap size vs. index allocation size. */
+	if ((bvi->i_size << 3) < (vi->i_size >>
+			ni->itype.index.block_size_bits)) {
+		ntfs_error(vi->i_sb, "Index bitmap too small (0x%llx) "
+				"for index allocation (0x%llx).",
+				bvi->i_size << 3, vi->i_size);
+		goto iput_unm_err_out;
+	}
+	ni->itype.index.bmp_ino = bvi;
+skip_large_index_stuff:
+	/* Setup the operations for this index inode. */
+	vi->i_op = NULL;
+	vi->i_fop = NULL;
+	vi->i_mapping->a_ops = &ntfs_mst_aops;
+	vi->i_blocks = ni->allocated_size >> 9;
+
+	/*
+	 * Make sure the base inode doesn't go away and attach it to the
+	 * index inode.
+	 */
+	igrab(base_vi);
+	ni->ext.base_ntfs_ino = base_ni;
+	ni->nr_extents = -1;
+
+	ntfs_debug("Done.");
+	return 0;
+
+iput_unm_err_out:
+	iput(bvi);
+unm_err_out:
+	if (!err)
+		err = -EIO;
+	if (ctx)
+		put_attr_search_ctx(ctx);
+	if (m)
+		unmap_mft_record(base_ni);
+err_out:
+	ntfs_error(vi->i_sb, "Failed with error code %i while reading index "
+			"inode (mft_no 0x%lx, name_len %i.", -err, vi->i_ino,
+			ni->name_len);
+	make_bad_inode(vi);
+	return err;
+}
+
 /**
  * ntfs_read_inode_mount - special read_inode for mount time use only
  * @vi:		inode to read
@@ -1712,21 +2033,39 @@ err_out:
  * The VFS calls ntfs_put_inode() every time the inode reference count (i_count)
  * is about to be decremented (but before the decrement itself.
  *
- * If the inode @vi is a directory with a single reference, we need to put the
- * attribute inode for the directory index bitmap, if it is present, otherwise
- * the directory inode would remain pinned for ever (or rather until umount()
- * time.
+ * If the inode @vi is a directory with two references, one of which is being
+ * dropped, we need to put the attribute inode for the directory index bitmap,
+ * if it is present, otherwise the directory inode would remain pinned for
+ * ever.
+ *
+ * If the inode @vi is an index inode with only one reference which is being
+ * dropped, we need to put the attribute inode for the index bitmap, if it is
+ * present, otherwise the index inode would disappear and the attribute inode
+ * for the index bitmap would no longer be referenced from anywhere and thus it
+ * would remain pinned for ever.
  */
 void ntfs_put_inode(struct inode *vi)
 {
-	if (S_ISDIR(vi->i_mode) && (atomic_read(&vi->i_count) == 2)) {
-		ntfs_inode *ni;
+	ntfs_inode *ni;
 
-		ni = NTFS_I(vi);
-		if (NInoIndexAllocPresent(ni) && ni->itype.index.bmp_ino) {
-			iput(ni->itype.index.bmp_ino);
-			ni->itype.index.bmp_ino = NULL;
+	if (S_ISDIR(vi->i_mode)) {
+		if (atomic_read(&vi->i_count) == 2) {
+			ni = NTFS_I(vi);
+			if (NInoIndexAllocPresent(ni) &&
+					ni->itype.index.bmp_ino) {
+				iput(ni->itype.index.bmp_ino);
+				ni->itype.index.bmp_ino = NULL;
+			}
 		}
+		return;
+	}
+	if (atomic_read(&vi->i_count) != 1)
+		return;
+	ni = NTFS_I(vi);
+	if (NInoAttr(ni) && (ni->type == AT_INDEX_ALLOCATION) &&
+			NInoIndexAllocPresent(ni) && ni->itype.index.bmp_ino) {
+		iput(ni->itype.index.bmp_ino);
+		ni->itype.index.bmp_ino = NULL;
 	}
 	return;
 }
@@ -2009,7 +2348,7 @@ void ntfs_write_inode(struct inode *vi, int sync)
 		goto unm_err_out;
 	}
 	if (unlikely(!lookup_attr(AT_STANDARD_INFORMATION, NULL, 0,
-			IGNORE_CASE, 0, NULL, 0, ctx))) {
+			CASE_SENSITIVE, 0, NULL, 0, ctx))) {
 		put_attr_search_ctx(ctx);
 		err = -ENOENT;
 		goto unm_err_out;
diff --git a/fs/ntfs/inode.h b/fs/ntfs/inode.h
index 59af63e6c..465bef639 100644
--- a/fs/ntfs/inode.h
+++ b/fs/ntfs/inode.h
@@ -90,16 +90,18 @@ struct _ntfs_inode {
 	u8 *attr_list;		/* Attribute list value itself. */
 	run_list attr_list_rl;	/* Run list for the attribute list value. */
 	union {
-		struct { /* It is a directory or $MFT. */
+		struct { /* It is a directory, $MFT, or an index inode. */
 			struct inode *bmp_ino;	/* Attribute inode for the
-						   directory index $BITMAP. */
+						   index $BITMAP. */
 			u32 block_size;		/* Size of an index block. */
 			u32 vcn_size;		/* Size of a vcn in this
-						   directory index. */
+						   index. */
+			COLLATION_RULES collation_rule; /* The collation rule
+						   for the index. */
 			u8 block_size_bits; 	/* Log2 of the above. */
 			u8 vcn_size_bits;	/* Log2 of the above. */
 		} index;
-		struct { /* It is a compressed file or fake inode. */
+		struct { /* It is a compressed file or an attribute inode. */
 			s64 size;		/* Copy of compressed_size from
 						   $DATA. */
 			u32 block_size;		/* Size of a compression block
@@ -260,6 +262,8 @@ extern int ntfs_test_inode(struct inode *vi, ntfs_attr *na);
 extern struct inode *ntfs_iget(struct super_block *sb, unsigned long mft_no);
 extern struct inode *ntfs_attr_iget(struct inode *base_vi, ATTR_TYPES type,
 		ntfschar *name, u32 name_len);
+extern struct inode *ntfs_index_iget(struct inode *base_vi, ntfschar *name,
+		u32 name_len);
 
 extern struct inode *ntfs_alloc_big_inode(struct super_block *sb);
 extern void ntfs_destroy_big_inode(struct inode *inode);
diff --git a/fs/ntfs/layout.h b/fs/ntfs/layout.h
index bad68c2f5..b2b6161eb 100644
--- a/fs/ntfs/layout.h
+++ b/fs/ntfs/layout.h
@@ -459,21 +459,21 @@ typedef enum {
  *	equal then the second u32 values would be compared, etc.
  */
 typedef enum {
-	COLLATION_BINARY	 = const_cpu_to_le32(0), /* Collate by binary
-					compare where the first byte is most
-					significant. */
-	COLLATION_FILE_NAME	 = const_cpu_to_le32(1), /* Collate file names
-					as Unicode strings. */
-	COLLATION_UNICODE_STRING = const_cpu_to_le32(2), /* Collate Unicode
+	COLLATION_BINARY	 = const_cpu_to_le32(0x00), /* Collate by
+					binary compare where the first byte is
+					most significant. */
+	COLLATION_FILE_NAME	 = const_cpu_to_le32(0x01), /* Collate file
+					names as Unicode strings. */
+	COLLATION_UNICODE_STRING = const_cpu_to_le32(0x02), /* Collate Unicode
 					strings by comparing their binary
 					Unicode values, except that when a
 					character can be uppercased, the upper
 					case value collates before the lower
 					case one. */
-	COLLATION_NTOFS_ULONG		= const_cpu_to_le32(16),
-	COLLATION_NTOFS_SID		= const_cpu_to_le32(17),
-	COLLATION_NTOFS_SECURITY_HASH	= const_cpu_to_le32(18),
-	COLLATION_NTOFS_ULONGS		= const_cpu_to_le32(19),
+	COLLATION_NTOFS_ULONG		= const_cpu_to_le32(0x10),
+	COLLATION_NTOFS_SID		= const_cpu_to_le32(0x11),
+	COLLATION_NTOFS_SECURITY_HASH	= const_cpu_to_le32(0x12),
+	COLLATION_NTOFS_ULONGS		= const_cpu_to_le32(0x13),
 } COLLATION_RULES;
 
 /*
@@ -2019,8 +2019,9 @@ typedef struct {
 	s64 limit;		/* Hard quota (-1 if not limited). */
 	s64 exceeded_time;	/* How long the soft quota has been exceeded. */
 	SID sid;		/* The SID of the user/object associated with
-				   this quota entry. Equals zero for the quota
-				   defaults entry. */
+				   this quota entry.  Equals zero for the quota
+				   defaults entry (and in fact on a WinXP
+				   volume, it is not present at all). */
 } __attribute__ ((__packed__)) QUOTA_CONTROL_ENTRY;
 
 /*
@@ -2032,18 +2033,27 @@ typedef enum {
 	QUOTA_FIRST_USER_ID	= const_cpu_to_le32(0x00000100),
 } PREDEFINED_OWNER_IDS;
 
+/*
+ * Current constants for quota control entries.
+ */
+typedef enum {
+	/* Current version. */
+	QUOTA_VERSION	= 2,
+} QUOTA_CONTROL_ENTRY_CONSTANTS;
+
 /*
  * Index entry flags (16-bit).
  */
 typedef enum {
-	INDEX_ENTRY_NODE = const_cpu_to_le16(1), /* This entry contains a sub-node,
-					      i.e. a reference to an index
-					      block in form of a virtual
+	INDEX_ENTRY_NODE = const_cpu_to_le16(1), /* This entry contains a
+					      sub-node, i.e. a reference to an
+					      index block in form of a virtual
 					      cluster number (see below). */
-	INDEX_ENTRY_END  = const_cpu_to_le16(2), /* This signifies the last entry in
-					      an index block. The index entry
-					      does not represent a file but it
-					      can point to a sub-node. */
+	INDEX_ENTRY_END  = const_cpu_to_le16(2), /* This signifies the last
+					      entry in an index block.  The
+					      index entry does not represent a
+					      file but it can point to a
+					      sub-node. */
 	INDEX_ENTRY_SPACE_FILLER = 0xffff, /* Just to force 16-bit width. */
 } __attribute__ ((__packed__)) INDEX_ENTRY_FLAGS;
 
diff --git a/fs/ntfs/logfile.c b/fs/ntfs/logfile.c
index a34a2e165..5b448b184 100644
--- a/fs/ntfs/logfile.c
+++ b/fs/ntfs/logfile.c
@@ -672,7 +672,7 @@ err_out:
  * @log_vi:	struct inode of loaded journal $LogFile to empty
  *
  * Empty the contents of the $LogFile journal @log_vi and return TRUE on
- * success FALSE on error.
+ * success and FALSE on error.
  *
  * This function assumes that the $LogFile journal has already been consistency
  * checked by a call to ntfs_check_logfile() and that ntfs_is_logfile_clean()
diff --git a/fs/ntfs/malloc.h b/fs/ntfs/malloc.h
index c921960bf..c8548a533 100644
--- a/fs/ntfs/malloc.h
+++ b/fs/ntfs/malloc.h
@@ -37,13 +37,10 @@
 static inline void *ntfs_malloc_nofs(unsigned long size)
 {
 	if (likely(size <= PAGE_SIZE)) {
-		if (likely(size)) {
-			/* kmalloc() has per-CPU caches so is faster for now. */
-			return kmalloc(PAGE_SIZE, GFP_NOFS);
-			/* return (void *)__get_free_page(GFP_NOFS |
-					__GFP_HIGHMEM); */
-		}
-		BUG();
+		BUG_ON(!size);
+		/* kmalloc() has per-CPU caches so is faster for now. */
+		return kmalloc(PAGE_SIZE, GFP_NOFS);
+		/* return (void *)__get_free_page(GFP_NOFS | __GFP_HIGHMEM); */
 	}
 	if (likely(size >> PAGE_SHIFT < num_physpages))
 		return __vmalloc(size, GFP_NOFS | __GFP_HIGHMEM, PAGE_KERNEL);
@@ -54,8 +51,9 @@ static inline void ntfs_free(void *addr)
 {
 	if (likely(((unsigned long)addr < VMALLOC_START) ||
 			((unsigned long)addr >= VMALLOC_END ))) {
-		return kfree(addr);
-		/* return free_page((unsigned long)addr); */
+		kfree(addr);
+		/* free_page((unsigned long)addr); */
+		return;
 	}
 	vfree(addr);
 }
diff --git a/fs/ntfs/mft.c b/fs/ntfs/mft.c
index 8875af935..712f7ad0a 100644
--- a/fs/ntfs/mft.c
+++ b/fs/ntfs/mft.c
@@ -122,6 +122,9 @@ struct address_space_operations ntfs_mft_aops = {
 #ifdef NTFS_RW
 	.writepage	= ntfs_mft_writepage,	/* Write out the dirty mft
 						   records in a page. */
+	.set_page_dirty	= __set_page_dirty_nobuffers,	/* Set the page dirty
+						   without touching the buffers
+						   belonging to the page. */
 #endif /* NTFS_RW */
 };
 
@@ -741,13 +744,12 @@ int write_mft_record_nolock(ntfs_inode *ni, MFT_RECORD *m, int sync)
 	ntfs_debug("Entering for inode 0x%lx.", ni->mft_no);
 	BUG_ON(NInoAttr(ni));
 	BUG_ON(!max_bhs);
-	BUG_ON(!page);
 	BUG_ON(!PageLocked(page));
 	/*
 	 * If the ntfs_inode is clean no need to do anything.  If it is dirty,
 	 * mark it as clean now so that it can be redirtied later on if needed.
-	 * There is no danger of races as as long as the caller is holding the
-	 * locks for the mft record @m and the page it is in.
+	 * There is no danger of races since the caller is holding the locks
+	 * for the mft record @m and the page it is in.
 	 */
 	if (!NInoTestClearDirty(ni))
 		goto done;
@@ -915,6 +917,8 @@ static int ntfs_mft_writepage(struct page *page, struct writeback_control *wbc)
 	int nr, i, j;
 	BOOL is_dirty = FALSE;
 
+	BUG_ON(!PageLocked(page));
+	BUG_ON(PageWriteback(page));
 	BUG_ON(mft_vi != vol->mft_ino);
 	/* The first mft record number in the page. */
 	mft_no = page->index << (PAGE_CACHE_SHIFT - vol->mft_record_size_bits);
diff --git a/fs/ntfs/namei.c b/fs/ntfs/namei.c
index 6a6273811..c5ab58086 100644
--- a/fs/ntfs/namei.c
+++ b/fs/ntfs/namei.c
@@ -92,6 +92,8 @@
  *    file name in the WIN32 namespace corresponding to the matched short file
  *    name. We then convert the name to the current NLS code page, and proceed
  *    searching for a dentry with this name, etc, as in case 2), above.
+ *
+ * Locking: Caller must hold i_sem on the directory.
  */
 static struct dentry *ntfs_lookup(struct inode *dir_ino, struct dentry *dent,
 		struct nameidata *nd)
@@ -383,7 +385,7 @@ struct dentry *ntfs_get_parent(struct dentry *child_dent)
 		return ERR_PTR(-ENOMEM);
 	}
 try_next:
-	if (unlikely(!lookup_attr(AT_FILE_NAME, NULL, 0, IGNORE_CASE, 0,
+	if (unlikely(!lookup_attr(AT_FILE_NAME, NULL, 0, CASE_SENSITIVE, 0,
 			NULL, 0, ctx))) {
 		put_attr_search_ctx(ctx);
 		unmap_mft_record(ni);
diff --git a/fs/ntfs/ntfs.h b/fs/ntfs/ntfs.h
index c4ccbc9b6..abc057ecc 100644
--- a/fs/ntfs/ntfs.h
+++ b/fs/ntfs/ntfs.h
@@ -24,6 +24,7 @@
 #ifndef _LINUX_NTFS_H
 #define _LINUX_NTFS_H
 
+#include <linux/stddef.h>
 #include <linux/kernel.h>
 #include <linux/module.h>
 #include <linux/compiler.h>
@@ -58,6 +59,7 @@ extern kmem_cache_t *ntfs_name_cache;
 extern kmem_cache_t *ntfs_inode_cache;
 extern kmem_cache_t *ntfs_big_inode_cache;
 extern kmem_cache_t *ntfs_attr_ctx_cache;
+extern kmem_cache_t *ntfs_index_ctx_cache;
 
 /* The various operations structs defined throughout the driver files. */
 extern struct super_operations ntfs_sops;
diff --git a/fs/ntfs/super.c b/fs/ntfs/super.c
index 4c3a32b74..e49428592 100644
--- a/fs/ntfs/super.c
+++ b/fs/ntfs/super.c
@@ -32,6 +32,9 @@
 #include "ntfs.h"
 #include "sysctl.h"
 #include "logfile.h"
+#include "quota.h"
+#include "dir.h"
+#include "index.h"
 
 /* Number of mounted file systems which have compression enabled. */
 static unsigned long ntfs_nr_compression_users;
@@ -413,7 +416,8 @@ static int ntfs_remount(struct super_block *sb, int *flags, char *opt)
 	 * flags are set.  Also, empty the logfile journal as it would become
 	 * stale as soon as something is written to the volume and mark the
 	 * volume dirty so that chkdsk is run if the volume is not umounted
-	 * cleanly.
+	 * cleanly.  Finally, mark the quotas out of date so Windows rescans
+	 * the volume on boot and updates them.
 	 *
 	 * When remounting read-only, mark the volume clean if no volume errors
 	 * have occured.
@@ -460,6 +464,12 @@ static int ntfs_remount(struct super_block *sb, int *flags, char *opt)
 			NVolSetErrors(vol);
 			return -EROFS;
 		}
+		if (!ntfs_mark_quotas_out_of_date(vol)) {
+			ntfs_error(sb, "Failed to mark quotas out of date%s",
+					es);
+			NVolSetErrors(vol);
+			return -EROFS;
+		}
 	} else if (!(sb->s_flags & MS_RDONLY) && (*flags & MS_RDONLY)) {
 		/* Remounting read-only. */
 		if (!NVolErrors(vol)) {
@@ -875,6 +885,7 @@ static BOOL load_and_init_mft_mirror(ntfs_volume *vol)
 	struct inode *tmp_ino;
 	ntfs_inode *tmp_ni;
 
+	ntfs_debug("Entering.");
 	/* Get mft mirror inode. */
 	tmp_ino = ntfs_iget(vol->sb, FILE_MFTMirr);
 	if (IS_ERR(tmp_ino) || is_bad_inode(tmp_ino)) {
@@ -906,6 +917,7 @@ static BOOL load_and_init_mft_mirror(ntfs_volume *vol)
 	tmp_ni->itype.index.block_size = vol->mft_record_size;
 	tmp_ni->itype.index.block_size_bits = vol->mft_record_size_bits;
 	vol->mftmirr_ino = tmp_ino;
+	ntfs_debug("Done.");
 	return TRUE;
 }
 
@@ -1054,6 +1066,76 @@ static BOOL load_and_check_logfile(ntfs_volume *vol)
 	return TRUE;
 }
 
+/**
+ * load_and_init_quota - load and setup the quota file for a volume if present
+ * @vol:	ntfs super block describing device whose quota file to load
+ *
+ * Return TRUE on success or FALSE on error.  If $Quota is not present, we
+ * leave vol->quota_ino as NULL and return success.
+ */
+static BOOL load_and_init_quota(ntfs_volume *vol)
+{
+	MFT_REF mref;
+	struct inode *tmp_ino;
+	ntfs_name *name = NULL;
+	static const ntfschar Quota[7] = { const_cpu_to_le16('$'),
+			const_cpu_to_le16('Q'), const_cpu_to_le16('u'),
+			const_cpu_to_le16('o'), const_cpu_to_le16('t'),
+			const_cpu_to_le16('a'), const_cpu_to_le16(0) };
+	static ntfschar Q[3] = { const_cpu_to_le16('$'),
+			const_cpu_to_le16('Q'), const_cpu_to_le16(0) };
+
+	ntfs_debug("Entering.");
+	/*
+	 * Find the inode number for the quota file by looking up the filename
+	 * $Quota in the extended system files directory $Extend.
+	 */
+	down(&vol->extend_ino->i_sem);
+	mref = ntfs_lookup_inode_by_name(NTFS_I(vol->extend_ino), Quota, 6,
+			&name);
+	up(&vol->extend_ino->i_sem);
+	if (IS_ERR_MREF(mref)) {
+		/*
+		 * If the file does not exist, quotas are disabled and have
+		 * never been enabled on this volume, just return success.
+		 */
+		if (MREF_ERR(mref) == -ENOENT) {
+			ntfs_debug("$Quota not present.  Volume does not have "
+					"quotas enabled.");
+			/*
+			 * No need to try to set quotas out of date if they are
+			 * not enabled.
+			 */
+			NVolSetQuotaOutOfDate(vol);
+			return TRUE;
+		}
+		/* A real error occured. */
+		ntfs_error(vol->sb, "Failed to find inode number for $Quota.");
+		return FALSE;
+	}
+	/* We do not care for the type of match that was found. */
+	if (name)
+		kfree(name);
+	/* Get the inode. */
+	tmp_ino = ntfs_iget(vol->sb, MREF(mref));
+	if (IS_ERR(tmp_ino) || is_bad_inode(tmp_ino)) {
+		if (!IS_ERR(tmp_ino))
+			iput(tmp_ino);
+		ntfs_error(vol->sb, "Failed to load $Quota.");
+		return FALSE;
+	}
+	vol->quota_ino = tmp_ino;
+	/* Get the $Q index allocation attribute. */
+	tmp_ino = ntfs_index_iget(vol->quota_ino, Q, 2);
+	if (IS_ERR(tmp_ino)) {
+		ntfs_error(vol->sb, "Failed to load $Quota/$Q index.");
+		return FALSE;
+	}
+	vol->quota_q_ino = tmp_ino;
+	ntfs_debug("Done.");
+	return TRUE;
+}
+
 #endif /* NTFS_RW */
 
 /**
@@ -1108,7 +1190,7 @@ read_partial_upcase_page:
 			goto read_partial_upcase_page;
 	}
 	vol->upcase_len = ino->i_size >> UCHAR_T_SIZE_BITS;
-	ntfs_debug("Read %llu bytes from $UpCase (expected %u bytes).",
+	ntfs_debug("Read %llu bytes from $UpCase (expected %zu bytes).",
 			ino->i_size, 64 * 1024 * sizeof(ntfschar));
 	iput(ino);
 	down(&ntfs_lock);
@@ -1436,20 +1518,66 @@ get_ctx_vol_failed:
 	}
 	// FIXME: Initialize security.
 	/* Get the extended system files' directory inode. */
-	tmp_ino = ntfs_iget(sb, FILE_Extend);
-	if (IS_ERR(tmp_ino) || is_bad_inode(tmp_ino)) {
-		if (!IS_ERR(tmp_ino))
-			iput(tmp_ino);
+	vol->extend_ino = ntfs_iget(sb, FILE_Extend);
+	if (IS_ERR(vol->extend_ino) || is_bad_inode(vol->extend_ino)) {
+		if (!IS_ERR(vol->extend_ino))
+			iput(vol->extend_ino);
 		ntfs_error(sb, "Failed to load $Extend.");
 		goto iput_sec_err_out;
 	}
-	// FIXME: Do something. E.g. want to delete the $UsnJrnl if exists.
-	// Note we might be doing this at the wrong level; we might want to
-	// d_alloc_root() and then do a "normal" open(2) of $Extend\$UsnJrnl
-	// rather than using ntfs_iget here, as we don't know the inode number
-	// for the files in $Extend directory.
-	iput(tmp_ino);
+#ifdef NTFS_RW
+	/* Find the quota file, load it if present, and set it up. */
+	if (!load_and_init_quota(vol)) {
+		static const char *es1 = "Failed to load $Quota";
+		static const char *es2 = ".  Run chkdsk.";
+
+		/* If a read-write mount, convert it to a read-only mount. */
+		if (!(sb->s_flags & MS_RDONLY)) {
+			if (!(vol->on_errors & (ON_ERRORS_REMOUNT_RO |
+					ON_ERRORS_CONTINUE))) {
+				ntfs_error(sb, "%s and neither on_errors="
+						"continue nor on_errors="
+						"remount-ro was specified%s",
+						es1, es2);
+				goto iput_quota_err_out;
+			}
+			sb->s_flags |= MS_RDONLY | MS_NOATIME | MS_NODIRATIME;
+			ntfs_error(sb, "%s.  Mounting read-only%s", es1, es2);
+		} else
+			ntfs_warning(sb, "%s.  Will not be able to remount "
+					"read-write%s", es1, es2);
+		/* This will prevent a read-write remount. */
+		NVolSetErrors(vol);
+	}
+	/* If (still) a read-write mount, mark the quotas out of date. */
+	if (!(sb->s_flags & MS_RDONLY) &&
+			!ntfs_mark_quotas_out_of_date(vol)) {
+		static const char *es1 = "Failed to mark quotas out of date";
+		static const char *es2 = ".  Run chkdsk.";
+
+		/* Convert to a read-only mount. */
+		if (!(vol->on_errors & (ON_ERRORS_REMOUNT_RO |
+				ON_ERRORS_CONTINUE))) {
+			ntfs_error(sb, "%s and neither on_errors=continue nor "
+					"on_errors=remount-ro was specified%s",
+					es1, es2);
+			goto iput_quota_err_out;
+		}
+		ntfs_error(sb, "%s.  Mounting read-only%s", es1, es2);
+		sb->s_flags |= MS_RDONLY | MS_NOATIME | MS_NODIRATIME;
+		NVolSetErrors(vol);
+	}
+	// TODO: Delete or checkpoint the $UsnJrnl if it exists.
+#endif /* NTFS_RW */
 	return TRUE;
+#ifdef NTFS_RW
+iput_quota_err_out:
+	if (vol->quota_q_ino)
+		iput(vol->quota_q_ino);
+	if (vol->quota_ino)
+		iput(vol->quota_ino);
+	iput(vol->extend_ino);
+#endif /* NTFS_RW */
 iput_sec_err_out:
 	iput(vol->secure_ino);
 iput_root_err_out:
@@ -1496,6 +1624,12 @@ static void ntfs_put_super(struct super_block *sb)
 
 	/* NTFS 3.0+ specific. */
 	if (vol->major_ver >= 3) {
+		if (vol->quota_q_ino)
+			ntfs_commit_inode(vol->quota_q_ino);
+		if (vol->quota_ino)
+			ntfs_commit_inode(vol->quota_ino);
+		if (vol->extend_ino)
+			ntfs_commit_inode(vol->extend_ino);
 		if (vol->secure_ino)
 			ntfs_commit_inode(vol->secure_ino);
 	}
@@ -1544,6 +1678,20 @@ static void ntfs_put_super(struct super_block *sb)
 
 	/* NTFS 3.0+ specific clean up. */
 	if (vol->major_ver >= 3) {
+#ifdef NTFS_RW
+		if (vol->quota_q_ino) {
+			iput(vol->quota_q_ino);
+			vol->quota_q_ino = NULL;
+		}
+		if (vol->quota_ino) {
+			iput(vol->quota_ino);
+			vol->quota_ino = NULL;
+		}
+#endif /* NTFS_RW */
+		if (vol->extend_ino) {
+			iput(vol->extend_ino);
+			vol->extend_ino = NULL;
+		}
 		if (vol->secure_ino) {
 			iput(vol->secure_ino);
 			vol->secure_ino = NULL;
@@ -2018,7 +2166,6 @@ static int ntfs_fill_super(struct super_block *sb, void *opt, const int silent)
 	init_rwsem(&vol->mftbmp_lock);
 #ifdef NTFS_RW
 	vol->mftmirr_ino = NULL;
-	vol->mftmirr_size = 0;
 	vol->logfile_ino = NULL;
 #endif /* NTFS_RW */
 	vol->lcnbmp_ino = NULL;
@@ -2026,10 +2173,11 @@ static int ntfs_fill_super(struct super_block *sb, void *opt, const int silent)
 	vol->vol_ino = NULL;
 	vol->root_ino = NULL;
 	vol->secure_ino = NULL;
-	vol->uid = vol->gid = 0;
-	vol->flags = 0;
-	vol->on_errors = 0;
-	vol->mft_zone_multiplier = 0;
+	vol->extend_ino = NULL;
+#ifdef NTFS_RW
+	vol->quota_ino = NULL;
+	vol->quota_q_ino = NULL;
+#endif /* NTFS_RW */
 	vol->nls_map = NULL;
 
 	/*
@@ -2178,23 +2326,48 @@ static int ntfs_fill_super(struct super_block *sb, void *opt, const int silent)
 	}
 	ntfs_error(sb, "Failed to allocate root directory.");
 	/* Clean up after the successful load_system_files() call from above. */
+	// TODO: Use ntfs_put_super() instead of repeating all this code...
+	// FIXME: Should mark the volume clean as the error is most likely
+	// 	  -ENOMEM.
 	iput(vol->vol_ino);
 	vol->vol_ino = NULL;
 	/* NTFS 3.0+ specific clean up. */
 	if (vol->major_ver >= 3) {
-		iput(vol->secure_ino);
-		vol->secure_ino = NULL;
+#ifdef NTFS_RW
+		if (vol->quota_q_ino) {
+			iput(vol->quota_q_ino);
+			vol->quota_q_ino = NULL;
+		}
+		if (vol->quota_ino) {
+			iput(vol->quota_ino);
+			vol->quota_ino = NULL;
+		}
+#endif /* NTFS_RW */
+		if (vol->extend_ino) {
+			iput(vol->extend_ino);
+			vol->extend_ino = NULL;
+		}
+		if (vol->secure_ino) {
+			iput(vol->secure_ino);
+			vol->secure_ino = NULL;
+		}
 	}
 	iput(vol->root_ino);
 	vol->root_ino = NULL;
 	iput(vol->lcnbmp_ino);
 	vol->lcnbmp_ino = NULL;
-#ifdef NTFS_RW
-	iput(vol->mftmirr_ino);
-	vol->mftmirr_ino = NULL;
-#endif /* NTFS_RW */
 	iput(vol->mftbmp_ino);
 	vol->mftbmp_ino = NULL;
+#ifdef NTFS_RW
+	if (vol->logfile_ino) {
+		iput(vol->logfile_ino);
+		vol->logfile_ino = NULL;
+	}
+	if (vol->mftmirr_ino) {
+		iput(vol->mftmirr_ino);
+		vol->mftmirr_ino = NULL;
+	}
+#endif /* NTFS_RW */
 	vol->upcase_len = 0;
 	if (vol->upcase != default_upcase)
 		ntfs_free(vol->upcase);
@@ -2220,10 +2393,9 @@ unl_upcase_iput_tmp_ino_err_out_now:
 	up(&ntfs_lock);
 iput_tmp_ino_err_out_now:
 	iput(tmp_ino);
-	if (vol->mft_ino && vol->mft_ino != tmp_ino) {
+	if (vol->mft_ino && vol->mft_ino != tmp_ino)
 		iput(vol->mft_ino);
-		vol->mft_ino = NULL;
-	}
+	vol->mft_ino = NULL;
 	/*
 	 * This is needed to get ntfs_clear_extent_inode() called for each
 	 * inode we have ever called ntfs_iget()/iput() on, otherwise we A)
@@ -2270,10 +2442,11 @@ static void ntfs_big_inode_init_once(void *foo, kmem_cache_t *cachep,
 }
 
 /*
- * Slab cache to optimize allocations and deallocations of attribute search
- * contexts.
+ * Slab caches to optimize allocations and deallocations of attribute search
+ * contexts and index contexts, respectively.
  */
 kmem_cache_t *ntfs_attr_ctx_cache;
+kmem_cache_t *ntfs_index_ctx_cache;
 
 /* A global default upcase table and a corresponding reference count. */
 wchar_t *default_upcase = NULL;
@@ -2300,6 +2473,7 @@ static struct file_system_type ntfs_fs_type = {
 };
 
 /* Stable names for the slab caches. */
+static const char ntfs_index_ctx_cache_name[] = "ntfs_index_ctx_cache";
 static const char ntfs_attr_ctx_cache_name[] = "ntfs_attr_ctx_cache";
 static const char ntfs_name_cache_name[] = "ntfs_name_cache";
 static const char ntfs_inode_cache_name[] = "ntfs_inode_cache";
@@ -2326,13 +2500,21 @@ static int __init init_ntfs_fs(void)
 
 	ntfs_debug("Debug messages are enabled.");
 
+	ntfs_index_ctx_cache = kmem_cache_create(ntfs_index_ctx_cache_name,
+			sizeof(ntfs_index_context), 0 /* offset */,
+			SLAB_HWCACHE_ALIGN, NULL /* ctor */, NULL /* dtor */);
+	if (!ntfs_index_ctx_cache) {
+		printk(KERN_CRIT "NTFS: Failed to create %s!\n",
+				ntfs_index_ctx_cache_name);
+		goto ictx_err_out;
+	}
 	ntfs_attr_ctx_cache = kmem_cache_create(ntfs_attr_ctx_cache_name,
 			sizeof(attr_search_context), 0 /* offset */,
 			SLAB_HWCACHE_ALIGN, NULL /* ctor */, NULL /* dtor */);
 	if (!ntfs_attr_ctx_cache) {
 		printk(KERN_CRIT "NTFS: Failed to create %s!\n",
 				ntfs_attr_ctx_cache_name);
-		goto ctx_err_out;
+		goto actx_err_out;
 	}
 
 	ntfs_name_cache = kmem_cache_create(ntfs_name_cache_name,
@@ -2385,7 +2567,9 @@ inode_err_out:
 	kmem_cache_destroy(ntfs_name_cache);
 name_err_out:
 	kmem_cache_destroy(ntfs_attr_ctx_cache);
-ctx_err_out:
+actx_err_out:
+	kmem_cache_destroy(ntfs_index_ctx_cache);
+ictx_err_out:
 	if (!err) {
 		printk(KERN_CRIT "NTFS: Aborting NTFS file system driver "
 				"registration...\n");
@@ -2414,6 +2598,9 @@ static void __exit exit_ntfs_fs(void)
 	if (kmem_cache_destroy(ntfs_attr_ctx_cache) && (err = 1))
 		printk(KERN_CRIT "NTFS: Failed to destory %s.\n",
 				ntfs_attr_ctx_cache_name);
+	if (kmem_cache_destroy(ntfs_index_ctx_cache) && (err = 1))
+		printk(KERN_CRIT "NTFS: Failed to destory %s.\n",
+				ntfs_index_ctx_cache_name);
 	if (err)
 		printk(KERN_CRIT "NTFS: This causes memory to leak! There is "
 				"probably a BUG in the driver! Please report "
diff --git a/fs/ntfs/volume.h b/fs/ntfs/volume.h
index 7bd6a80df..330c3a229 100644
--- a/fs/ntfs/volume.h
+++ b/fs/ntfs/volume.h
@@ -103,6 +103,13 @@ typedef struct {
 					   directory. */
 	struct inode *secure_ino;	/* The VFS inode of $Secure (NTFS3.0+
 					   only, otherwise NULL). */
+	struct inode *extend_ino;	/* The VFS inode of $Extend (NTFS3.0+
+					   only, otherwise NULL). */
+#ifdef NTFS_RW
+	/* $Quota stuff is NTFS3.0+ specific.  Unused/NULL otherwise. */
+	struct inode *quota_ino;	/* The VFS inode of $Quota. */
+	struct inode *quota_q_ino;	/* Attribute inode for $Quota/$Q. */
+#endif /* NTFS_RW */
 	struct nls_table *nls_map;
 } ntfs_volume;
 
@@ -117,6 +124,7 @@ typedef enum {
 				      Otherwise be case insensitive and create
 				      file names in WIN32 namespace. */
 	NV_LogFileEmpty,	/* 1: $LogFile journal is empty. */
+	NV_QuotaOutOfDate,	/* 1: $Quota is out of date. */
 } ntfs_volume_flags;
 
 /*
@@ -142,5 +150,6 @@ NVOL_FNS(Errors)
 NVOL_FNS(ShowSystemFiles)
 NVOL_FNS(CaseSensitive)
 NVOL_FNS(LogFileEmpty)
+NVOL_FNS(QuotaOutOfDate)
 
 #endif /* _LINUX_NTFS_VOLUME_H */
diff --git a/fs/open.c b/fs/open.c
index 6f9a31e6e..4bd34f4f8 100644
--- a/fs/open.c
+++ b/fs/open.c
@@ -613,9 +613,6 @@ asmlinkage long sys_fchmod(unsigned int fd, mode_t mode)
 	dentry = file->f_dentry;
 	inode = dentry->d_inode;
 
-	err = -EPERM;
-	if (IS_BARRIER(inode) && !vx_check(0, VX_ADMIN))
-		goto out_putf;
 	err = -EROFS;
 	if (IS_RDONLY(inode))
 		goto out_putf;
@@ -648,10 +645,6 @@ asmlinkage long sys_chmod(const char __user * filename, mode_t mode)
 		goto out;
 	inode = nd.dentry->d_inode;
 
-	error = -EPERM;
-	if (IS_BARRIER(inode) && !vx_check(0, VX_ADMIN))
-		goto dput_and_out;
-
 	error = -EROFS;
 	if (IS_RDONLY(inode))
 		goto dput_and_out;
@@ -795,7 +788,7 @@ struct file *dentry_open(struct dentry *dentry, struct vfsmount *mnt, int flags)
 	if (!f)
 		goto cleanup_dentry;
 	f->f_flags = flags;
-	f->f_mode = (flags+1) & O_ACCMODE;
+	f->f_mode = ((flags+1) & O_ACCMODE) | FMODE_LSEEK | FMODE_PREAD | FMODE_PWRITE;
 	inode = dentry->d_inode;
 	if (f->f_mode & FMODE_WRITE) {
 		error = get_write_access(inode);
@@ -894,7 +887,7 @@ repeat:
 	FD_SET(fd, files->open_fds);
 	FD_CLR(fd, files->close_on_exec);
 	files->next_fd = fd + 1;
-	vx_openfd_inc(fd);
+	// vx_openfd_inc(fd);
 #if 1
 	/* Sanity check */
 	if (files->fd[fd] != NULL) {
@@ -916,7 +909,7 @@ static inline void __put_unused_fd(struct files_struct *files, unsigned int fd)
 	__FD_CLR(fd, files->open_fds);
 	if (fd < files->next_fd)
 		files->next_fd = fd;
-	vx_openfd_dec(fd);
+	// vx_openfd_dec(fd);
 }
 
 void fastcall put_unused_fd(unsigned int fd)
@@ -1086,3 +1079,15 @@ int generic_file_open(struct inode * inode, struct file * filp)
 }
 
 EXPORT_SYMBOL(generic_file_open);
+
+/*
+ * This is used by subsystems that don't want seekable
+ * file descriptors
+ */
+int nonseekable_open(struct inode *inode, struct file *filp)
+{
+	filp->f_mode &= ~(FMODE_LSEEK | FMODE_PREAD | FMODE_PWRITE);
+	return 0;
+}
+
+EXPORT_SYMBOL(nonseekable_open);
diff --git a/fs/openpromfs/inode.c b/fs/openpromfs/inode.c
index 28d884553..d6d65be61 100644
--- a/fs/openpromfs/inode.c
+++ b/fs/openpromfs/inode.c
@@ -64,7 +64,7 @@ static int openpromfs_readdir(struct file *, void *, filldir_t);
 static struct dentry *openpromfs_lookup(struct inode *, struct dentry *dentry, struct nameidata *nd);
 static int openpromfs_unlink (struct inode *, struct dentry *dentry);
 
-static ssize_t nodenum_read(struct file *file, char *buf,
+static ssize_t nodenum_read(struct file *file, char __user *buf,
 			    size_t count, loff_t *ppos)
 {
 	struct inode *inode = file->f_dentry->d_inode;
@@ -83,7 +83,7 @@ static ssize_t nodenum_read(struct file *file, char *buf,
 	return count;
 }
 
-static ssize_t property_read(struct file *filp, char *buf,
+static ssize_t property_read(struct file *filp, char __user *buf,
 			     size_t count, loff_t *ppos)
 {
 	struct inode *inode = filp->f_dentry->d_inode;
@@ -101,7 +101,7 @@ static ssize_t property_read(struct file *filp, char *buf,
 		i = ((u32)(long)inode->u.generic_ip) >> 16;
 		if ((u16)((long)inode->u.generic_ip) == aliases) {
 			if (i >= aliases_nodes)
-				p = 0;
+				p = NULL;
 			else
 				p = alias_names [i];
 		} else
@@ -135,7 +135,7 @@ static ssize_t property_read(struct file *filp, char *buf,
 			return -EIO;
 		op->value [k] = 0;
 		if (k) {
-			for (s = 0, p = op->value; p < op->value + k; p++) {
+			for (s = NULL, p = op->value; p < op->value + k; p++) {
 				if ((*p >= ' ' && *p <= '~') || *p == '\n') {
 					op->flag |= OPP_STRING;
 					s = p;
@@ -318,7 +318,7 @@ static ssize_t property_read(struct file *filp, char *buf,
 	return count;
 }
 
-static ssize_t property_write(struct file *filp, const char *buf,
+static ssize_t property_write(struct file *filp, const char __user *buf,
 			      size_t count, loff_t *ppos)
 {
 	int i, j, k;
@@ -330,7 +330,7 @@ static ssize_t property_write(struct file *filp, const char *buf,
 	if (filp->f_pos >= 0xffffff || count >= 0xffffff)
 		return -EINVAL;
 	if (!filp->private_data) {
-		i = property_read (filp, NULL, 0, 0);
+		i = property_read (filp, NULL, 0, NULL);
 		if (i)
 			return i;
 	}
@@ -416,7 +416,7 @@ static ssize_t property_write(struct file *filp, const char *buf,
 			mask &= mask2;
 			if (mask) {
 				*first &= ~mask;
-				*first |= simple_strtoul (tmp, 0, 16);
+				*first |= simple_strtoul (tmp, NULL, 16);
 				op->flag |= OPP_DIRTY;
 			}
 		} else {
@@ -433,7 +433,7 @@ static ssize_t property_write(struct file *filp, const char *buf,
 						for (j = 0; j < first_off; j++)
 							mask >>= 1;
 						*q &= ~mask;
-						*q |= simple_strtoul (tmp,0,16);
+						*q |= simple_strtoul (tmp,NULL,16);
 					}
 					buf += 9;
 				} else if ((q == last - 1) && last_cnt
@@ -445,14 +445,14 @@ static ssize_t property_write(struct file *filp, const char *buf,
 					for (j = 0; j < 8 - last_cnt; j++)
 						mask <<= 1;
 					*q &= ~mask;
-					*q |= simple_strtoul (tmp, 0, 16);
+					*q |= simple_strtoul (tmp, NULL, 16);
 					buf += last_cnt;
 				} else {
 					char tchars[17]; /* XXX yuck... */
 
 					if (copy_from_user(tchars, buf, 16))
 						return -EFAULT;
-					*q = simple_strtoul (tchars, 0, 16);
+					*q = simple_strtoul (tchars, NULL, 16);
 					buf += 9;
 				}
 			}
diff --git a/fs/partitions/Kconfig b/fs/partitions/Kconfig
index cf379e6f0..7d74b0067 100644
--- a/fs/partitions/Kconfig
+++ b/fs/partitions/Kconfig
@@ -187,13 +187,6 @@ config LDM_DEBUG
 
 	  If unsure, say N.
 
-config NEC98_PARTITION
-	bool "NEC PC-9800 partition table support" if PARTITION_ADVANCED
-	default y if !PARTITION_ADVANCED && X86_PC9800
-	help
-	  Say Y here if you would like to be able to read the hard disk
-	  partition table format used by NEC PC-9800 machines.
-
 config SGI_PARTITION
 	bool "SGI partition support" if PARTITION_ADVANCED
 	default y if !PARTITION_ADVANCED && (SGI_IP22 || SGI_IP27)
diff --git a/fs/partitions/check.c b/fs/partitions/check.c
index b16b949f0..ed3084943 100644
--- a/fs/partitions/check.c
+++ b/fs/partitions/check.c
@@ -29,7 +29,6 @@
 #include "ldm.h"
 #include "mac.h"
 #include "msdos.h"
-#include "nec98.h"
 #include "osf.h"
 #include "sgi.h"
 #include "sun.h"
@@ -138,25 +137,14 @@ const char *bdevname(struct block_device *bdev, char *buf)
 EXPORT_SYMBOL(bdevname);
 
 /*
- * NOTE: this cannot be called from interrupt context.
- *
- * But in interrupt context you should really have a struct
- * block_device anyway and use bdevname() above.
+ * There's very little reason to use this, you should really
+ * have a struct block_device just about everywhere and use
+ * bdevname() instead.
  */
 const char *__bdevname(dev_t dev, char *buffer)
 {
-	struct gendisk *disk;
-	int part;
-
-	disk = get_gendisk(dev, &part);
-	if (disk) {
-		buffer = disk_name(disk, part, buffer);
-		put_disk(disk);
-	} else {
-		snprintf(buffer, BDEVNAME_SIZE, "unknown-block(%u,%u)",
+	scnprintf(buffer, BDEVNAME_SIZE, "unknown-block(%u,%u)",
 				MAJOR(dev), MINOR(dev));
-	}
-
 	return buffer;
 }
 
@@ -407,7 +395,7 @@ int rescan_partitions(struct gendisk *disk, struct block_device *bdev)
 	if (disk->fops->revalidate_disk)
 		disk->fops->revalidate_disk(disk);
 	if (!get_capacity(disk) || !(state = check_partition(disk, bdev)))
-		return res;
+		return -EIO;
 	for (p = 1; p < state->limit; p++) {
 		sector_t size = state->parts[p].size;
 		sector_t from = state->parts[p].from;
@@ -420,7 +408,7 @@ int rescan_partitions(struct gendisk *disk, struct block_device *bdev)
 #endif
 	}
 	kfree(state);
-	return res;
+	return 0;
 }
 
 unsigned char *read_dev_sector(struct block_device *bdev, sector_t n, Sector *p)
diff --git a/fs/partitions/msdos.c b/fs/partitions/msdos.c
index e98505bf8..100fa7548 100644
--- a/fs/partitions/msdos.c
+++ b/fs/partitions/msdos.c
@@ -422,8 +422,8 @@ int msdos_partition(struct parsed_partitions *state, struct block_device *bdev)
 	 * On the second pass look inside *BSD, Unixware and Solaris partitions.
 	 */
 
-	state->next = DOS_EXTENDED_PARTITION;
-	for (slot = 1 ; slot < DOS_EXTENDED_PARTITION ; slot++, p++) {
+	state->next = 5;
+	for (slot = 1 ; slot <= 4 ; slot++, p++) {
 		u32 start = START_SECT(p)*sector_size;
 		u32 size = NR_SECTS(p)*sector_size;
 		if (!size)
@@ -450,7 +450,7 @@ int msdos_partition(struct parsed_partitions *state, struct block_device *bdev)
 
 	/* second pass - output for each on a separate line */
 	p = (struct partition *) (0x1be + data);
-	for (slot = 1 ; slot < DOS_EXTENDED_PARTITION ; slot++, p++) {
+	for (slot = 1 ; slot <= 4 ; slot++, p++) {
 		unsigned char id = SYS_IND(p);
 		int n;
 
diff --git a/fs/pipe.c b/fs/pipe.c
index 737271c0c..2b42a25a4 100644
--- a/fs/pipe.c
+++ b/fs/pipe.c
@@ -94,10 +94,6 @@ pipe_readv(struct file *filp, const struct iovec *_iov,
 	struct iovec *iov = (struct iovec *)_iov;
 	size_t total_len;
 
-	/* pread is not allowed on pipes. */
-	if (unlikely(ppos != &filp->f_pos))
-		return -ESPIPE;
-
 	total_len = iov_length(iov, nr_segs);
 	/* Null read succeeds. */
 	if (unlikely(total_len == 0))
@@ -187,10 +183,6 @@ pipe_writev(struct file *filp, const struct iovec *_iov,
 	struct iovec *iov = (struct iovec *)_iov;
 	size_t total_len;
 
-	/* pwrite is not allowed on pipes. */
-	if (unlikely(ppos != &filp->f_pos))
-		return -ESPIPE;
-
 	total_len = iov_length(iov, nr_segs);
 	/* Null write succeeds. */
 	if (unlikely(total_len == 0))
@@ -656,13 +648,13 @@ int do_pipe(int *fd)
 	f1->f_pos = f2->f_pos = 0;
 	f1->f_flags = O_RDONLY;
 	f1->f_op = &read_pipe_fops;
-	f1->f_mode = 1;
+	f1->f_mode = FMODE_READ;
 	f1->f_version = 0;
 
 	/* write file */
 	f2->f_flags = O_WRONLY;
 	f2->f_op = &write_pipe_fops;
-	f2->f_mode = 2;
+	f2->f_mode = FMODE_WRITE;
 	f2->f_version = 0;
 
 	fd_install(i, f1);
diff --git a/fs/proc/array.c b/fs/proc/array.c
index bf42e9756..190ba24f3 100644
--- a/fs/proc/array.c
+++ b/fs/proc/array.c
@@ -142,6 +142,7 @@ static inline const char * get_task_state(struct task_struct *tsk)
 					   TASK_INTERRUPTIBLE |
 					   TASK_UNINTERRUPTIBLE |
 					   TASK_ZOMBIE |
+					   TASK_DEAD |
 					   TASK_STOPPED |
 					   TASK_ONHOLD);
 	const char **p = &task_state_array[0];
@@ -157,9 +158,11 @@ static inline char * task_state(struct task_struct *p, char *buffer)
 {
 	struct group_info *group_info;
 	int g;
-	pid_t ppid;
+	pid_t pid, ppid, tgid;
 
 	read_lock(&tasklist_lock);
+	tgid = vx_map_tgid(current->vx_info, p->tgid);
+	pid = vx_map_tgid(current->vx_info, p->pid);
 	ppid = vx_map_tgid(current->vx_info, p->real_parent->pid);
 	buffer += sprintf(buffer,
 		"State:\t%s\n"
@@ -172,8 +175,7 @@ static inline char * task_state(struct task_struct *p, char *buffer)
 		"Gid:\t%d\t%d\t%d\t%d\n",
 		get_task_state(p),
 		(p->sleep_avg/1024)*100/(1020000000/1024),
-	       	p->tgid,
-		p->pid, p->pid ? ppid : 0,
+		tgid, pid, p->pid ? ppid : 0,
 		p->pid && p->ptrace ? p->parent->pid : 0,
 		p->uid, p->euid, p->suid, p->fsuid,
 		p->gid, p->egid, p->sgid, p->fsgid);
@@ -350,7 +352,7 @@ int proc_pid_stat(struct task_struct *task, char * buffer)
 	sigset_t sigign, sigcatch;
 	char state;
 	int res;
- 	pid_t ppid, pgid = -1, sid = -1;
+	pid_t pid, ppid, pgid = -1, sid = -1;
 	int num_threads = 0;
 	struct mm_struct *mm;
 	unsigned long long start_time;
@@ -366,6 +368,7 @@ int proc_pid_stat(struct task_struct *task, char * buffer)
 		if (bias_jiffies > task->start_time)
 			bias_jiffies = task->start_time;
 	}
+	pid = vx_map_tgid(task->vx_info, task->pid);
 
 	mm = task->mm;
 	if(mm)
@@ -415,7 +418,7 @@ int proc_pid_stat(struct task_struct *task, char * buffer)
 	res = sprintf(buffer,"%d (%s) %c %d %d %d %d %d %lu %lu \
 %lu %lu %lu %lu %lu %ld %ld %ld %ld %d %ld %llu %lu %ld %lu %lu %lu %lu %lu \
 %lu %lu %lu %lu %lu %lu %lu %lu %d %d %lu %lu\n",
-		task->pid,
+		pid,
 		task->comm,
 		state,
 		ppid,
diff --git a/fs/proc/base.c b/fs/proc/base.c
index e65659409..e1c3a5d9b 100644
--- a/fs/proc/base.c
+++ b/fs/proc/base.c
@@ -1490,7 +1490,8 @@ static struct inode_operations proc_tid_attr_inode_operations = {
 /*
  * /proc/self:
  */
-static int proc_self_readlink(struct dentry *dentry, char *buffer, int buflen)
+static int proc_self_readlink(struct dentry *dentry, char __user *buffer,
+			      int buflen)
 {
 	char tmp[30];
 	sprintf(tmp, "%d", current->tgid);
@@ -1783,7 +1784,9 @@ int proc_pid_readdir(struct file * filp, void * dirent, filldir_t filldir)
 		ino_t ino = fake_ino(tgid,PROC_TGID_INO);
 		unsigned long j = PROC_NUMBUF;
 
-		do buf[--j] = '0' + (tgid % 10); while (tgid/=10);
+		do
+			buf[--j] = '0' + (tgid % 10);
+		while ((tgid /= 10) != 0);
 
 		if (filldir(dirent, buf+j, PROC_NUMBUF-j, filp->f_pos, ino, DT_DIR) < 0) {
 			filp->f_version = tgid;
@@ -1838,7 +1841,7 @@ static int proc_task_readdir(struct file * filp, void * dirent, filldir_t filldi
 
 		do
 			buf[--j] = '0' + (tid % 10);
-		while (tid /= 10);
+		while ((tid /= 10) != 0);
 
 		if (filldir(dirent, buf+j, PROC_NUMBUF-j, pos, ino, DT_DIR) < 0)
 			break;
diff --git a/fs/proc/generic.c b/fs/proc/generic.c
index aa836b91d..e77cf186e 100644
--- a/fs/proc/generic.c
+++ b/fs/proc/generic.c
@@ -17,6 +17,7 @@
 #include <linux/smp_lock.h>
 #include <linux/init.h>
 #include <linux/idr.h>
+#include <linux/namei.h>
 #include <linux/vs_base.h>
 #include <linux/vserver/inode.h>
 #include <asm/uaccess.h>
@@ -232,14 +233,21 @@ out:
 static int proc_notify_change(struct dentry *dentry, struct iattr *iattr)
 {
 	struct inode *inode = dentry->d_inode;
-	int error = inode_setattr(inode, iattr);
-	if (!error) {
-		struct proc_dir_entry *de = PDE(inode);
-		de->uid = inode->i_uid;
-		de->gid = inode->i_gid;
-		de->mode = inode->i_mode;
-	}
+	struct proc_dir_entry *de = PDE(inode);
+	int error;
+
+	error = inode_change_ok(inode, iattr);
+	if (error)
+		goto out;
 
+	error = inode_setattr(inode, iattr);
+	if (error)
+		goto out;
+	
+	de->uid = inode->i_uid;
+	de->gid = inode->i_gid;
+	de->mode = inode->i_mode;
+out:
 	return error;
 }
 
@@ -290,18 +298,20 @@ static spinlock_t proc_inum_lock = SPIN_LOCK_UNLOCKED; /* protects the above */
  */
 static unsigned int get_inode_number(void)
 {
-	unsigned int i, inum = 0;
+	int i, inum = 0;
+	int error;
 
 retry:
 	if (idr_pre_get(&proc_inum_idr, GFP_KERNEL) == 0)
 		return 0;
 
 	spin_lock(&proc_inum_lock);
-	i = idr_get_new(&proc_inum_idr, NULL);
+	error = idr_get_new(&proc_inum_idr, NULL, &i);
 	spin_unlock(&proc_inum_lock);
-
-	if (i == -1)
+	if (error == -EAGAIN)
 		goto retry;
+	else if (error)
+		return 0;
 
 	inum = (i & MAX_ID_MASK) + PROC_DYNAMIC_FIRST;
 
@@ -321,21 +331,14 @@ static void release_inode_number(unsigned int inum)
 	spin_unlock(&proc_inum_lock);
 }
 
-static int
-proc_readlink(struct dentry *dentry, char __user *buffer, int buflen)
-{
-	char *s = PDE(dentry->d_inode)->data;
-	return vfs_readlink(dentry, buffer, buflen, s);
-}
-
 static int proc_follow_link(struct dentry *dentry, struct nameidata *nd)
 {
-	char *s = PDE(dentry->d_inode)->data;
-	return vfs_follow_link(nd, s);
+	nd_set_link(nd, PDE(dentry->d_inode)->data);
+	return 0;
 }
 
 static struct inode_operations proc_link_inode_operations = {
-	.readlink	= proc_readlink,
+	.readlink	= generic_readlink,
 	.follow_link	= proc_follow_link,
 };
 
@@ -385,6 +388,7 @@ struct dentry *proc_lookup(struct inode * dir, struct dentry *dentry, struct nam
 
 				error = -EINVAL;
 				inode = proc_get_inode(dir->i_sb, ino, de);
+				inode->i_xid = vx_current_xid();
 				break;
 			}
 		}
diff --git a/fs/proc/kcore.c b/fs/proc/kcore.c
index 1f55db799..f7c0cda58 100644
--- a/fs/proc/kcore.c
+++ b/fs/proc/kcore.c
@@ -18,6 +18,7 @@
 #include <linux/elfcore.h>
 #include <linux/vmalloc.h>
 #include <linux/highmem.h>
+#include <linux/init.h>
 #include <asm/uaccess.h>
 #include <asm/io.h>
 
@@ -81,11 +82,9 @@ kclist_del(void *addr)
 		}
 	}
 	write_unlock(&kclist_lock);
-	return 0;
+	return NULL;
 }
 
-extern char saved_command_line[];
-
 static size_t get_kcore_size(int *nphdr, size_t *elf_buflen)
 {
 	size_t try, size;
diff --git a/fs/proc/kmsg.c b/fs/proc/kmsg.c
index 211b1fe2a..10d37bf25 100644
--- a/fs/proc/kmsg.c
+++ b/fs/proc/kmsg.c
@@ -33,7 +33,7 @@ static int kmsg_release(struct inode * inode, struct file * file)
 static ssize_t kmsg_read(struct file *file, char __user *buf,
 			 size_t count, loff_t *ppos)
 {
-	if ((file->f_flags & O_NONBLOCK) && !do_syslog(9, 0, 0))
+	if ((file->f_flags & O_NONBLOCK) && !do_syslog(9, NULL, 0))
 		return -EAGAIN;
 	return do_syslog(2, buf, count);
 }
@@ -41,7 +41,7 @@ static ssize_t kmsg_read(struct file *file, char __user *buf,
 static unsigned int kmsg_poll(struct file *file, poll_table *wait)
 {
 	poll_wait(file, &log_wait, wait);
-	if (do_syslog(9, 0, 0))
+	if (do_syslog(9, NULL, 0))
 		return POLLIN | POLLRDNORM;
 	return 0;
 }
diff --git a/fs/proc/proc_devtree.c b/fs/proc/proc_devtree.c
index e7c813c99..67423c696 100644
--- a/fs/proc/proc_devtree.c
+++ b/fs/proc/proc_devtree.c
@@ -88,7 +88,7 @@ void proc_device_tree_add_node(struct device_node *np, struct proc_dir_entry *de
 	child = NULL;
 	while ((child = of_get_next_child(np, child))) {
 		p = strrchr(child->full_name, '/');
-		if (p == 0)
+		if (!p)
 			p = child->full_name;
 		else
 			++p;
@@ -140,7 +140,7 @@ void proc_device_tree_add_node(struct device_node *np, struct proc_dir_entry *de
 		lastp = &al->next;
 	}
 	of_node_put(child);
-	*lastp = 0;
+	*lastp = NULL;
 	de->subdir = list;
 }
 
@@ -152,7 +152,7 @@ void proc_device_tree_init(void)
 	struct device_node *root;
 	if ( !have_of )
 		return;
-	proc_device_tree = proc_mkdir("device-tree", 0);
+	proc_device_tree = proc_mkdir("device-tree", NULL);
 	if (proc_device_tree == 0)
 		return;
 	root = of_find_node_by_path("/");
diff --git a/fs/proc/proc_misc.c b/fs/proc/proc_misc.c
index b3d800378..d94d5960b 100644
--- a/fs/proc/proc_misc.c
+++ b/fs/proc/proc_misc.c
@@ -50,7 +50,6 @@
 #include <asm/uaccess.h>
 #include <asm/pgtable.h>
 #include <asm/io.h>
-#include <asm/pgalloc.h>
 #include <asm/tlb.h>
 #include <asm/div64.h>
 
@@ -70,9 +69,6 @@ extern int get_filesystem_list(char *);
 extern int get_exec_domain_list(char *);
 extern int get_dma_list(char *);
 extern int get_locks_status (char *, char **, off_t, int);
-#ifdef CONFIG_SGI_DS1286
-extern int get_ds1286_status(char *);
-#endif
 
 static int proc_calc_metrics(char *page, char **start, off_t off,
 				 int count, int *eof, int len)
@@ -528,22 +524,12 @@ static int filesystems_read_proc(char *page, char **start, off_t off,
 static int cmdline_read_proc(char *page, char **start, off_t off,
 				 int count, int *eof, void *data)
 {
-	extern char saved_command_line[];
 	int len;
 
 	len = sprintf(page, "%s\n", saved_command_line);
 	return proc_calc_metrics(page, start, off, count, eof, len);
 }
 
-#ifdef CONFIG_SGI_DS1286
-static int ds1286_read_proc(char *page, char **start, off_t off,
-				 int count, int *eof, void *data)
-{
-	int len = get_ds1286_status(page);
-	return proc_calc_metrics(page, start, off, count, eof, len);
-}
-#endif
-
 static int locks_read_proc(char *page, char **start, off_t off,
 				 int count, int *eof, void *data)
 {
@@ -677,9 +663,6 @@ void __init proc_misc_init(void)
 		{"devices",	devices_read_proc},
 		{"filesystems",	filesystems_read_proc},
 		{"cmdline",	cmdline_read_proc},
-#ifdef CONFIG_SGI_DS1286
-		{"rtc",		ds1286_read_proc},
-#endif
 		{"locks",	locks_read_proc},
 		{"execdomains",	execdomains_read_proc},
 		{NULL,}
diff --git a/fs/proc/proc_tty.c b/fs/proc/proc_tty.c
index 401688e36..a0d4404cc 100644
--- a/fs/proc/proc_tty.c
+++ b/fs/proc/proc_tty.c
@@ -217,7 +217,7 @@ void proc_tty_unregister_driver(struct tty_driver *driver)
 		
 	remove_proc_entry(driver->driver_name, proc_tty_driver);
 	
-	driver->proc_entry = 0;
+	driver->proc_entry = NULL;
 }
 
 /*
@@ -226,18 +226,18 @@ void proc_tty_unregister_driver(struct tty_driver *driver)
 void __init proc_tty_init(void)
 {
 	struct proc_dir_entry *entry;
-	if (!proc_mkdir("tty", 0))
+	if (!proc_mkdir("tty", NULL))
 		return;
-	proc_tty_ldisc = proc_mkdir("tty/ldisc", 0);
+	proc_tty_ldisc = proc_mkdir("tty/ldisc", NULL);
 	/*
 	 * /proc/tty/driver/serial reveals the exact character counts for
 	 * serial links which is just too easy to abuse for inferring
 	 * password lengths and inter-keystroke timings during password
 	 * entry.
 	 */
-	proc_tty_driver = proc_mkdir_mode("tty/driver", S_IRUSR | S_IXUSR, 0);
+	proc_tty_driver = proc_mkdir_mode("tty/driver", S_IRUSR | S_IXUSR, NULL);
 
-	create_proc_read_entry("tty/ldiscs", 0, 0, tty_ldiscs_read_proc,NULL);
+	create_proc_read_entry("tty/ldiscs", 0, NULL, tty_ldiscs_read_proc, NULL);
 	entry = create_proc_entry("tty/drivers", 0, NULL);
 	if (entry)
 		entry->proc_fops = &proc_tty_drivers_operations;
diff --git a/fs/proc/root.c b/fs/proc/root.c
index c84e88fe0..6d8492bc6 100644
--- a/fs/proc/root.c
+++ b/fs/proc/root.c
@@ -55,29 +55,29 @@ void __init proc_root_init(void)
 		return;
 	}
 	proc_misc_init();
-	proc_net = proc_mkdir("net", 0);
+	proc_net = proc_mkdir("net", NULL);
 #ifdef CONFIG_SYSVIPC
-	proc_mkdir("sysvipc", 0);
+	proc_mkdir("sysvipc", NULL);
 #endif
 #ifdef CONFIG_SYSCTL
-	proc_sys_root = proc_mkdir("sys", 0);
+	proc_sys_root = proc_mkdir("sys", NULL);
 #endif
 #if defined(CONFIG_BINFMT_MISC) || defined(CONFIG_BINFMT_MISC_MODULE)
-	proc_mkdir("sys/fs", 0);
-	proc_mkdir("sys/fs/binfmt_misc", 0);
+	proc_mkdir("sys/fs", NULL);
+	proc_mkdir("sys/fs/binfmt_misc", NULL);
 #endif
-	proc_root_fs = proc_mkdir("fs", 0);
-	proc_root_driver = proc_mkdir("driver", 0);
-	proc_mkdir("fs/nfsd", 0); /* somewhere for the nfsd filesystem to be mounted */
+	proc_root_fs = proc_mkdir("fs", NULL);
+	proc_root_driver = proc_mkdir("driver", NULL);
+	proc_mkdir("fs/nfsd", NULL); /* somewhere for the nfsd filesystem to be mounted */
 #if defined(CONFIG_SUN_OPENPROMFS) || defined(CONFIG_SUN_OPENPROMFS_MODULE)
 	/* just give it a mountpoint */
-	proc_mkdir("openprom", 0);
+	proc_mkdir("openprom", NULL);
 #endif
 	proc_tty_init();
 #ifdef CONFIG_PROC_DEVICETREE
 	proc_device_tree_init();
 #endif
-	proc_bus = proc_mkdir("bus", 0);
+	proc_bus = proc_mkdir("bus", NULL);
 	proc_vx_init();
 }
 
diff --git a/fs/qnx4/inode.c b/fs/qnx4/inode.c
index aa9dadb48..19b7d5a05 100644
--- a/fs/qnx4/inode.c
+++ b/fs/qnx4/inode.c
@@ -232,8 +232,8 @@ unsigned long qnx4_block_map( struct inode *inode, long iblock )
 	int ix;
 	long offset, i_xblk;
 	unsigned long block = 0;
-	struct buffer_head *bh = 0;
-	struct qnx4_xblk *xblk = 0;
+	struct buffer_head *bh = NULL;
+	struct qnx4_xblk *xblk = NULL;
 	struct qnx4_inode_entry *qnx4_inode = qnx4_raw_inode(inode);
 	qnx4_nxtnt_t nxtnt = le16_to_cpu(qnx4_inode->di_num_xtnts);
 
@@ -269,7 +269,7 @@ unsigned long qnx4_block_map( struct inode *inode, long iblock )
 				i_xblk = le32_to_cpu(xblk->xblk_next_xblk);
 				ix = 0;
 				brelse( bh );
-				bh = 0;
+				bh = NULL;
 			}
 		}
 		if ( bh )
diff --git a/fs/quota.c b/fs/quota.c
index 867fe35e5..3dd9be6b2 100644
--- a/fs/quota.c
+++ b/fs/quota.c
@@ -141,7 +141,7 @@ void sync_dquots(struct super_block *sb, int type)
 			sb->s_qcop->quota_sync(sb, type);
 	}
 	else {
-		while ((sb = get_super_to_sync(type))) {
+		while ((sb = get_super_to_sync(type)) != 0) {
 			if (sb->s_qcop->quota_sync)
 				sb->s_qcop->quota_sync(sb, type);
 			drop_super(sb);
@@ -150,7 +150,7 @@ void sync_dquots(struct super_block *sb, int type)
 }
 
 /* Copy parameters and call proper function */
-static int do_quotactl(struct super_block *sb, int type, int cmd, qid_t id, caddr_t addr)
+static int do_quotactl(struct super_block *sb, int type, int cmd, qid_t id, void __user *addr)
 {
 	int ret;
 
@@ -264,7 +264,7 @@ static int do_quotactl(struct super_block *sb, int type, int cmd, qid_t id, cadd
  * calls. Maybe we need to add the process quotas etc. in the future,
  * but we probably should use rlimits for that.
  */
-asmlinkage long sys_quotactl(unsigned int cmd, const char *special, qid_t id, caddr_t addr)
+asmlinkage long sys_quotactl(unsigned int cmd, const char __user *special, qid_t id, void __user *addr)
 {
 	uint cmds, type;
 	struct super_block *sb = NULL;
diff --git a/fs/read_write.c b/fs/read_write.c
index f765a22b4..d85431d5d 100644
--- a/fs/read_write.c
+++ b/fs/read_write.c
@@ -76,14 +76,12 @@ loff_t remote_llseek(struct file *file, loff_t offset, int origin)
 	unlock_kernel();
 	return retval;
 }
-
 EXPORT_SYMBOL(remote_llseek);
 
 loff_t no_llseek(struct file *file, loff_t offset, int origin)
 {
 	return -ESPIPE;
 }
-
 EXPORT_SYMBOL(no_llseek);
 
 loff_t default_llseek(struct file *file, loff_t offset, int origin)
@@ -109,18 +107,21 @@ loff_t default_llseek(struct file *file, loff_t offset, int origin)
 	unlock_kernel();
 	return retval;
 }
-
 EXPORT_SYMBOL(default_llseek);
 
-static inline loff_t llseek(struct file *file, loff_t offset, int origin)
+loff_t vfs_llseek(struct file *file, loff_t offset, int origin)
 {
 	loff_t (*fn)(struct file *, loff_t, int);
 
-	fn = default_llseek;
-	if (file->f_op && file->f_op->llseek)
-		fn = file->f_op->llseek;
+	fn = no_llseek;
+	if (file->f_mode & FMODE_LSEEK) {
+		fn = default_llseek;
+		if (file->f_op && file->f_op->llseek)
+			fn = file->f_op->llseek;
+	}
 	return fn(file, offset, origin);
 }
+EXPORT_SYMBOL(vfs_llseek);
 
 asmlinkage off_t sys_lseek(unsigned int fd, off_t offset, unsigned int origin)
 {
@@ -135,7 +136,7 @@ asmlinkage off_t sys_lseek(unsigned int fd, off_t offset, unsigned int origin)
 
 	retval = -EINVAL;
 	if (origin <= 2) {
-		loff_t res = llseek(file, offset, origin);
+		loff_t res = vfs_llseek(file, offset, origin);
 		retval = res;
 		if (res != (loff_t)retval)
 			retval = -EOVERFLOW;	/* LFS: should only happen on 32 bit platforms */
@@ -165,7 +166,7 @@ asmlinkage long sys_llseek(unsigned int fd, unsigned long offset_high,
 	if (origin > 2)
 		goto out_putf;
 
-	offset = llseek(file, ((loff_t) offset_high << 32) | offset_low,
+	offset = vfs_llseek(file, ((loff_t) offset_high << 32) | offset_low,
 			origin);
 
 	retval = (int)offset;
@@ -269,6 +270,16 @@ ssize_t vfs_write(struct file *file, const char __user *buf, size_t count, loff_
 
 EXPORT_SYMBOL(vfs_write);
 
+static inline loff_t file_pos_read(struct file *file)
+{
+	return file->f_pos;
+}
+
+static inline void file_pos_write(struct file *file, loff_t pos)
+{
+	file->f_pos = pos;
+}
+
 asmlinkage ssize_t sys_read(unsigned int fd, char __user * buf, size_t count)
 {
 	struct file *file;
@@ -277,7 +288,9 @@ asmlinkage ssize_t sys_read(unsigned int fd, char __user * buf, size_t count)
 
 	file = fget_light(fd, &fput_needed);
 	if (file) {
-		ret = vfs_read(file, buf, count, &file->f_pos);
+		loff_t pos = file_pos_read(file);
+		ret = vfs_read(file, buf, count, &pos);
+		file_pos_write(file, pos);
 		fput_light(file, fput_needed);
 	}
 
@@ -293,7 +306,9 @@ asmlinkage ssize_t sys_write(unsigned int fd, const char __user * buf, size_t co
 
 	file = fget_light(fd, &fput_needed);
 	if (file) {
-		ret = vfs_write(file, buf, count, &file->f_pos);
+		loff_t pos = file_pos_read(file);
+		ret = vfs_write(file, buf, count, &pos);
+		file_pos_write(file, pos);
 		fput_light(file, fput_needed);
 	}
 
@@ -312,7 +327,9 @@ asmlinkage ssize_t sys_pread64(unsigned int fd, char __user *buf,
 
 	file = fget_light(fd, &fput_needed);
 	if (file) {
-		ret = vfs_read(file, buf, count, &pos);
+		ret = -ESPIPE;
+		if (file->f_mode & FMODE_PREAD)
+			ret = vfs_read(file, buf, count, &pos);
 		fput_light(file, fput_needed);
 	}
 
@@ -331,7 +348,9 @@ asmlinkage ssize_t sys_pwrite64(unsigned int fd, const char __user *buf,
 
 	file = fget_light(fd, &fput_needed);
 	if (file) {
-		ret = vfs_write(file, buf, count, &pos);
+		ret = -ESPIPE;
+		if (file->f_mode & FMODE_PWRITE)  
+			ret = vfs_write(file, buf, count, &pos);
 		fput_light(file, fput_needed);
 	}
 
@@ -515,7 +534,9 @@ sys_readv(unsigned long fd, const struct iovec __user *vec, unsigned long vlen)
 
 	file = fget_light(fd, &fput_needed);
 	if (file) {
-		ret = vfs_readv(file, vec, vlen, &file->f_pos);
+		loff_t pos = file_pos_read(file);
+		ret = vfs_readv(file, vec, vlen, &pos);
+		file_pos_write(file, pos);
 		fput_light(file, fput_needed);
 	}
 
@@ -531,7 +552,9 @@ sys_writev(unsigned long fd, const struct iovec __user *vec, unsigned long vlen)
 
 	file = fget_light(fd, &fput_needed);
 	if (file) {
-		ret = vfs_writev(file, vec, vlen, &file->f_pos);
+		loff_t pos = file_pos_read(file);
+		ret = vfs_writev(file, vec, vlen, &pos);
+		file_pos_write(file, pos);
 		fput_light(file, fput_needed);
 	}
 
@@ -562,8 +585,12 @@ static ssize_t do_sendfile(int out_fd, int in_fd, loff_t *ppos,
 		goto fput_in;
 	if (!in_file->f_op || !in_file->f_op->sendfile)
 		goto fput_in;
+	retval = -ESPIPE;
 	if (!ppos)
 		ppos = &in_file->f_pos;
+	else
+		if (!(in_file->f_mode & FMODE_PREAD))
+			goto fput_in;
 	retval = locks_verify_area(FLOCK_VERIFY_READ, in_inode, in_file, *ppos, count);
 	if (retval)
 		goto fput_in;
diff --git a/fs/reiserfs/bitmap.c b/fs/reiserfs/bitmap.c
index 86639019d..b5e4498fc 100644
--- a/fs/reiserfs/bitmap.c
+++ b/fs/reiserfs/bitmap.c
@@ -30,6 +30,9 @@
 #define  _ALLOC_hashed_formatted_nodes 7
 #define  _ALLOC_old_way 8
 #define  _ALLOC_hundredth_slices 9
+#define  _ALLOC_dirid_groups 10
+#define  _ALLOC_oid_groups 11
+#define  _ALLOC_packing_groups 12
 
 #define  concentrating_formatted_nodes(s)	test_bit(_ALLOC_concentrating_formatted_nodes, &SB_ALLOC_OPTS(s))
 #define  displacing_large_files(s)		test_bit(_ALLOC_displacing_large_files, &SB_ALLOC_OPTS(s))
@@ -150,11 +153,6 @@ static int scan_bitmap_block (struct reiserfs_transaction_handle *th,
        __wait_on_buffer (bi->bh);
     }
 
-    /* If we know that first zero bit is only one or first zero bit is
-       closer to the end of bitmap than our start pointer */
-    if (bi->first_zero_hint > *beg || bi->free_count == 1)
-	*beg = bi->first_zero_hint;
-
     while (1) {
 	cont:
 	if (bi->free_count < min)
@@ -204,21 +202,12 @@ static int scan_bitmap_block (struct reiserfs_transaction_handle *th,
 		    while (--i >= *beg)
 			reiserfs_test_and_clear_le_bit (i, bi->bh->b_data);
 		    reiserfs_restore_prepared_buffer (s, bi->bh);
-		    *beg = max(org, (int)bi->first_zero_hint);
+		    *beg = org;
 		    /* ... and search again in current block from beginning */
 		    goto cont;	
 		}
 	    }
 	    bi->free_count -= (end - *beg);
-
-	    /* if search started from zero_hint bit, and zero hint have not
-                changed since, then we need to update first_zero_hint */
-	    if ( bi->first_zero_hint >= *beg)
-		/* no point in looking for free bit if there is not any */
-		bi->first_zero_hint = (bi->free_count > 0 ) ?
-			reiserfs_find_next_zero_le_bit
-			((unsigned long*)(bi->bh->b_data), s->s_blocksize << 3, end) : (s->s_blocksize << 3);
-
 	    journal_mark_dirty (th, s, bi->bh);
 
 	    /* free block count calculation */
@@ -231,7 +220,57 @@ static int scan_bitmap_block (struct reiserfs_transaction_handle *th,
 	    *beg = next;
 	}
     }
-  }
+}
+
+static int bmap_hash_id(struct super_block *s, u32 id) {
+    char * hash_in = NULL;
+    unsigned long hash;
+    unsigned bm;
+
+    if (id <= 2) {
+	bm = 1;
+    } else {
+        hash_in = (char *)(&id);
+        hash = keyed_hash(hash_in, 4);
+	bm = hash % SB_BMAP_NR(s);
+	if (!bm)
+	    bm = 1;
+    }
+    return bm;
+}
+
+/*
+ * hashes the id and then returns > 0 if the block group for the
+ * corresponding hash is full
+ */
+static inline int block_group_used(struct super_block *s, u32 id) {
+    int bm;
+    bm = bmap_hash_id(s, id);
+    if (SB_AP_BITMAP(s)[bm].free_count > ((s->s_blocksize << 3) * 60 / 100) ) {
+        return 0;
+    }
+    return 1;
+}
+
+/*
+ * the packing is returned in disk byte order
+ */
+u32 reiserfs_choose_packing(struct inode *dir) {
+    u32 packing;
+    if (TEST_OPTION(packing_groups, dir->i_sb)) {
+	u32 parent_dir = le32_to_cpu(INODE_PKEY(dir)->k_dir_id);
+	/*
+	 * some versions of reiserfsck expect packing locality 1 to be
+	 * special
+	 */
+	if (parent_dir == 1 || block_group_used(dir->i_sb,parent_dir))
+            packing = INODE_PKEY(dir)->k_objectid;
+        else
+            packing = INODE_PKEY(dir)->k_dir_id;
+    } else
+        packing = INODE_PKEY(dir)->k_objectid;
+    return packing;
+}
   
 /* Tries to find contiguous zero bit window (given size) in given region of
  * bitmap and place new blocks there. Returns number of allocated blocks. */
@@ -255,8 +294,18 @@ static int scan_bitmap (struct reiserfs_transaction_handle *th,
     get_bit_address (s, *start, &bm, &off);
     get_bit_address (s, finish, &end_bm, &end_off);
 
-    // With this option set first we try to find a bitmap that is at least 10%
-    // free, and if that fails, then we fall back to old whole bitmap scanning
+    /* When the bitmap is more than 10% free, anyone can allocate.
+     * When it's less than 10% free, only files that already use the
+     * bitmap are allowed. Once we pass 80% full, this restriction
+     * is lifted.
+     *
+     * We do this so that files that grow later still have space close to
+     * their original allocation. This improves locality, and presumably
+     * performance as a result.
+     *
+     * This is only an allocation policy and does not make up for getting a
+     * bad hint. Decent hinting must be implemented for this to work well.
+     */
     if ( TEST_OPTION(skip_busy, s) && SB_FREE_BLOCKS(s) > SB_BLOCK_COUNT(s)/20 ) {
 	for (;bm < end_bm; bm++, off = 0) {
 	    if ( ( off && (!unfm || (file_block != 0))) || SB_AP_BITMAP(s)[bm].free_count > (s->s_blocksize << 3) / 10 )
@@ -314,9 +363,6 @@ static void _reiserfs_free_block (struct reiserfs_transaction_handle *th,
 			  "free_block (%s:%lu)[dev:blocknr]: bit already cleared",
 			  reiserfs_bdevname (s), block);
     }
-    if (offset < apbi[nr].first_zero_hint) {
-      apbi[nr].first_zero_hint = offset;
-    }
     apbi[nr].free_count ++;
     journal_mark_dirty (th, s, apbi[nr].bh);
 
@@ -396,6 +442,14 @@ void reiserfs_discard_all_prealloc (struct reiserfs_transaction_handle *th)
 	__discard_prealloc(th, ei);
     }
 }
+
+void reiserfs_init_alloc_options (struct super_block *s)
+{
+    set_bit (_ALLOC_skip_busy, &SB_ALLOC_OPTS(s));
+    set_bit (_ALLOC_dirid_groups, &SB_ALLOC_OPTS(s));
+    set_bit (_ALLOC_packing_groups, &SB_ALLOC_OPTS(s));
+}
+
 /* block allocator related options are parsed here */
 int reiserfs_parse_alloc_options(struct super_block * s, char * options)
 {
@@ -439,6 +493,18 @@ int reiserfs_parse_alloc_options(struct super_block * s, char * options)
 	    continue;
 	}
 
+        if (!strcmp(this_char, "dirid_groups")) {
+	    SET_OPTION(dirid_groups);
+	    continue;
+        }
+        if (!strcmp(this_char, "oid_groups")) {
+	    SET_OPTION(oid_groups);
+	    continue;
+        }
+        if (!strcmp(this_char, "packing_groups")) {
+	    SET_OPTION(packing_groups);
+	    continue;
+        }
 	if (!strcmp(this_char, "hashed_formatted_nodes")) {
 	    SET_OPTION(hashed_formatted_nodes);
 	    continue;
@@ -481,6 +547,7 @@ int reiserfs_parse_alloc_options(struct super_block * s, char * options)
 	return 1;
       }
   
+    reiserfs_warning (s, "allocator options = [%08x]\n", SB_ALLOC_OPTS(s));
     return 0;
 }
   
@@ -503,17 +570,76 @@ static inline void new_hashed_relocation (reiserfs_blocknr_hint_t * hint)
     hint->search_start = hint->beg + keyed_hash(hash_in, 4) % (hint->end - hint->beg);
 }
 
-static inline void get_left_neighbor(reiserfs_blocknr_hint_t *hint)
+/*
+ * Relocation based on dirid, hashing them into a given bitmap block
+ * files. Formatted nodes are unaffected, a seperate policy covers them
+ */
+static void
+dirid_groups (reiserfs_blocknr_hint_t *hint)
+{
+    unsigned long hash;
+    __u32 dirid = 0;
+    int bm = 0;
+    struct super_block *sb = hint->th->t_super;
+    if (hint->inode)
+	dirid = le32_to_cpu(INODE_PKEY(hint->inode)->k_dir_id);
+    else if (hint->formatted_node)
+        dirid = hint->key.k_dir_id;
+
+    if (dirid) {
+	bm = bmap_hash_id(sb, dirid);
+	hash = bm * (sb->s_blocksize << 3);
+	/* give a portion of the block group to metadata */
+	if (hint->inode)
+	    hash += sb->s_blocksize/2;
+	hint->search_start = hash;
+    }
+}
+
+/*
+ * Relocation based on oid, hashing them into a given bitmap block
+ * files. Formatted nodes are unaffected, a seperate policy covers them
+ */
+static void
+oid_groups (reiserfs_blocknr_hint_t *hint)
+{
+    if (hint->inode) {
+	unsigned long hash;
+	__u32 oid;
+	__u32 dirid;
+	int bm;
+
+	dirid = le32_to_cpu(INODE_PKEY(hint->inode)->k_dir_id);
+
+	/* keep the root dir and it's first set of subdirs close to
+	 * the start of the disk
+	 */
+	if (dirid <= 2)
+	    hash = (hint->inode->i_sb->s_blocksize << 3);
+	else {
+	    oid = le32_to_cpu(INODE_PKEY(hint->inode)->k_objectid);
+	    bm = bmap_hash_id(hint->inode->i_sb, oid);
+	    hash = bm * (hint->inode->i_sb->s_blocksize << 3);
+	}
+	hint->search_start = hash;
+    }
+}
+
+/* returns 1 if it finds an indirect item and gets valid hint info
+ * from it, otherwise 0
+ */
+static int get_left_neighbor(reiserfs_blocknr_hint_t *hint)
 {
     struct path * path;
     struct buffer_head * bh;
     struct item_head * ih;
     int pos_in_item;
     __u32 * item;
+    int ret = 0;
 
     if (!hint->path)		/* reiserfs code can call this function w/o pointer to path
 				 * structure supplied; then we rely on supplied search_start */
-	return;
+	return 0;
 
     path = hint->path;
     bh = get_last_bh(path);
@@ -534,15 +660,15 @@ static inline void get_left_neighbor(reiserfs_blocknr_hint_t *hint)
 	    int t=get_block_num(item,pos_in_item);
 	    if (t) {
 		hint->search_start = t;
+		ret = 1;
 		break;
 	    }
 	    pos_in_item --;
 	}
-    } else {
-      }
+    }
 
     /* does result value fit into specified region? */
-    return;
+    return ret;
 }
 
 /* should be, if formatted node, then try to put on first part of the device
@@ -639,10 +765,12 @@ static inline void hundredth_slices (reiserfs_blocknr_hint_t * hint)
     }
 }
   
-static inline void determine_search_start(reiserfs_blocknr_hint_t *hint,
+static void determine_search_start(reiserfs_blocknr_hint_t *hint,
 					  int amount_needed)
 {
     struct super_block *s = hint->th->t_super;
+    int unfm_hint;
+
     hint->beg = 0;
     hint->end = SB_BLOCK_COUNT(s) - 1;
 
@@ -673,19 +801,14 @@ static inline void determine_search_start(reiserfs_blocknr_hint_t *hint,
 	return;
     }
 
-    /* attempt to copy a feature from old block allocator code */
-    if (TEST_OPTION(old_hashed_relocation, s) && !hint->formatted_node) {
-	old_hashed_relocation(hint);
-    }
-
     /* if none of our special cases is relevant, use the left neighbor in the
        tree order of the new node we are allocating for */
     if (hint->formatted_node && TEST_OPTION(hashed_formatted_nodes,s)) {
-	hash_formatted_node(hint);
+        hash_formatted_node(hint);
 	return;
-    } 
+    }
 
-    get_left_neighbor(hint);
+    unfm_hint = get_left_neighbor(hint);
 
     /* Mimic old block allocator behaviour, that is if VFS allowed for preallocation,
        new blocks are displaced based on directory ID. Also, if suggested search_start
@@ -710,10 +833,36 @@ static inline void determine_search_start(reiserfs_blocknr_hint_t *hint,
 	return;
     }
 
-    if (TEST_OPTION(old_hashed_relocation, s))
+    /* old_hashed_relocation only works on unformatted */
+    if (!unfm_hint && !hint->formatted_node &&
+        TEST_OPTION(old_hashed_relocation, s))
+    {
 	old_hashed_relocation(hint);
-    if (TEST_OPTION(new_hashed_relocation, s))
+    }
+    /* new_hashed_relocation works with both formatted/unformatted nodes */
+    if ((!unfm_hint || hint->formatted_node) &&
+        TEST_OPTION(new_hashed_relocation, s))
+    {
 	new_hashed_relocation(hint);
+    }
+    /* dirid grouping works only on unformatted nodes */
+    if (!unfm_hint && !hint->formatted_node && TEST_OPTION(dirid_groups,s))
+    {
+        dirid_groups(hint);
+    }
+
+#ifdef DISPLACE_NEW_PACKING_LOCALITIES
+    if (hint->formatted_node && TEST_OPTION(dirid_groups,s))
+    {
+        dirid_groups(hint);
+    }
+#endif
+
+    /* oid grouping works only on unformatted nodes */
+    if (!unfm_hint && !hint->formatted_node && TEST_OPTION(oid_groups,s))
+    {
+        oid_groups(hint);
+    }
     return;
 }
 
@@ -738,13 +887,14 @@ static int determine_prealloc_size(reiserfs_blocknr_hint_t * hint)
 static inline int allocate_without_wrapping_disk (reiserfs_blocknr_hint_t * hint,
 					 b_blocknr_t * new_blocknrs,
 					 b_blocknr_t start, b_blocknr_t finish,
+					 int min,
 					 int amount_needed, int prealloc_size)
 {
     int rest = amount_needed;
     int nr_allocated;
   
     while (rest > 0 && start <= finish) {
-	nr_allocated = scan_bitmap (hint->th, &start, finish, 1,
+	nr_allocated = scan_bitmap (hint->th, &start, finish, min,
 				    rest + prealloc_size, !hint->formatted_node,
 				    hint->block);
 
@@ -777,8 +927,9 @@ static inline int blocknrs_and_prealloc_arrays_from_search_start
     struct super_block *s = hint->th->t_super;
     b_blocknr_t start = hint->search_start;
     b_blocknr_t finish = SB_BLOCK_COUNT(s) - 1;
-    int second_pass = 0;
+    int passno = 0;
     int nr_allocated = 0;
+    int bigalloc = 0;
 
     determine_prealloc_size(hint);
     if (!hint->formatted_node) {
@@ -797,32 +948,61 @@ static inline int blocknrs_and_prealloc_arrays_from_search_start
 	    if (quota_ret)
 		hint->preallocate=hint->prealloc_size=0;
 	}
+	/* for unformatted nodes, force large allocations */
+	bigalloc = amount_needed;
     }
 
-    while((nr_allocated
-	  += allocate_without_wrapping_disk(hint, new_blocknrs + nr_allocated, start, finish,
-					  amount_needed - nr_allocated, hint->prealloc_size))
-	  < amount_needed) {
-
-	/* not all blocks were successfully allocated yet*/
-	if (second_pass) {	/* it was a second pass; we must free all blocks */
+    do {
+	/* in bigalloc mode, nr_allocated should stay zero until
+	 * the entire allocation is filled
+	 */
+	if (unlikely(bigalloc && nr_allocated)) {
+	    reiserfs_warning(s, "bigalloc is %d, nr_allocated %d\n",
+	    bigalloc, nr_allocated);
+	    /* reset things to a sane value */
+	    bigalloc = amount_needed - nr_allocated;
+	}
+	/*
+	 * try pass 0 and pass 1 looking for a nice big
+	 * contiguous allocation.  Then reset and look
+	 * for anything you can find.
+	 */
+	if (passno == 2 && bigalloc) {
+	    passno = 0;
+	    bigalloc = 0;
+	}
+	switch (passno++) {
+        case 0: /* Search from hint->search_start to end of disk */
+	    start = hint->search_start;
+	    finish = SB_BLOCK_COUNT(s) - 1;
+	    break;
+        case 1: /* Search from hint->beg to hint->search_start */
+	    start = hint->beg;
+	    finish = hint->search_start;
+	    break;
+	case 2: /* Last chance: Search from 0 to hint->beg */
+	    start = 0;
+	    finish = hint->beg;
+	    break;
+	default: /* We've tried searching everywhere, not enough space */
+	    /* Free the blocks */
 	    if (!hint->formatted_node) {
 #ifdef REISERQUOTA_DEBUG
 		reiserfs_debug (s, "reiserquota: freeing (nospace) %d blocks id=%u", amount_needed + hint->prealloc_size - nr_allocated, hint->inode->i_uid);
 #endif
 		DQUOT_FREE_BLOCK_NODIRTY(hint->inode, amount_needed + hint->prealloc_size - nr_allocated);     /* Free not allocated blocks */
 	    }
-	    while (nr_allocated --)
+  	    while (nr_allocated --)
 		reiserfs_free_block(hint->th, hint->inode, new_blocknrs[nr_allocated], !hint->formatted_node);
 
 	    return NO_DISK_SPACE;
-	} else {		/* refine search parameters for next pass */
-	    second_pass = 1;
-	    finish = start;
-	    start = 0;
-	    continue;
 	}
-    }
+    } while ((nr_allocated += allocate_without_wrapping_disk (hint,
+			    new_blocknrs + nr_allocated, start, finish,
+			    bigalloc ? bigalloc : 1,
+			    amount_needed - nr_allocated,
+			    hint->prealloc_size))
+			< amount_needed);
     if ( !hint->formatted_node &&
          amount_needed + hint->prealloc_size >
 	 nr_allocated + REISERFS_I(hint->inode)->i_prealloc_count) {
diff --git a/fs/reiserfs/dir.c b/fs/reiserfs/dir.c
index 12090d1f1..887fab38a 100644
--- a/fs/reiserfs/dir.c
+++ b/fs/reiserfs/dir.c
@@ -64,6 +64,7 @@ static int reiserfs_readdir (struct file * filp, void * dirent, filldir_t filldi
 
     /*  reiserfs_warning (inode->i_sb, "reiserfs_readdir 1: f_pos = %Ld", filp->f_pos);*/
 
+    path_to_entry.reada = PATH_READA;
     while (1) {
     research:
 	/* search the directory item, containing entry with specified key */
diff --git a/fs/reiserfs/do_balan.c b/fs/reiserfs/do_balan.c
index 58b3c4272..4faa48685 100644
--- a/fs/reiserfs/do_balan.c
+++ b/fs/reiserfs/do_balan.c
@@ -169,8 +169,8 @@ static int balance_leaf_when_delete (struct tree_balance * tb, int flag)
 		    if ( PATH_H_POSITION (tb->tb_path, 1) == 0 && 1 < B_NR_ITEMS(tb->FR[0]) )
 			replace_key(tb, tb->CFL[0],tb->lkey[0],tb->FR[0],1);
 
-		    leaf_move_items (LEAF_FROM_S_TO_L, tb, n, -1, 0);
-		    leaf_move_items (LEAF_FROM_R_TO_L, tb, B_NR_ITEMS(tb->R[0]), -1, 0);
+		    leaf_move_items (LEAF_FROM_S_TO_L, tb, n, -1, NULL);
+		    leaf_move_items (LEAF_FROM_R_TO_L, tb, B_NR_ITEMS(tb->R[0]), -1, NULL);
 
 		    reiserfs_invalidate_buffer (tb, tbS0);
 		    reiserfs_invalidate_buffer (tb, tb->R[0]);
@@ -178,8 +178,8 @@ static int balance_leaf_when_delete (struct tree_balance * tb, int flag)
 		    return 0;
 		}
 		/* all contents of all the 3 buffers will be in R[0] */
-		leaf_move_items (LEAF_FROM_S_TO_R, tb, n, -1, 0);
-		leaf_move_items (LEAF_FROM_L_TO_R, tb, B_NR_ITEMS(tb->L[0]), -1, 0);
+		leaf_move_items (LEAF_FROM_S_TO_R, tb, n, -1, NULL);
+		leaf_move_items (LEAF_FROM_L_TO_R, tb, B_NR_ITEMS(tb->L[0]), -1, NULL);
 
 		/* right_delimiting_key is correct in R[0] */
 		replace_key(tb, tb->CFR[0],tb->rkey[0],tb->R[0],0);
@@ -854,7 +854,7 @@ static int balance_leaf (struct tree_balance * tb,
 		    /* Insert part of the item into S_new[i] before 0-th item */
 		    bi.tb = tb;
 		    bi.bi_bh = S_new[i];
-		    bi.bi_parent = 0;
+		    bi.bi_parent = NULL;
 		    bi.bi_position = 0;
 
 		    if ( (old_len - sbytes[i]) > zeros_num ) {
@@ -882,7 +882,7 @@ static int balance_leaf (struct tree_balance * tb,
 		    /* Insert new item into S_new[i] */
 		    bi.tb = tb;
 		    bi.bi_bh = S_new[i];
-		    bi.bi_parent = 0;
+		    bi.bi_parent = NULL;
 		    bi.bi_position = 0;
 		    leaf_insert_into_buf (&bi, item_pos - n + snum[i] - 1, ih, body, zeros_num);
 
@@ -927,7 +927,7 @@ static int balance_leaf (struct tree_balance * tb,
 			    /* Paste given directory entry to directory item */
 			    bi.tb = tb;
 			    bi.bi_bh = S_new[i];
-			    bi.bi_parent = 0;
+			    bi.bi_parent = NULL;
 			    bi.bi_position = 0;
 			    leaf_paste_in_buffer (&bi, 0, pos_in_item - entry_count + sbytes[i] - 1,
 						  tb->insert_size[0], body,zeros_num);
@@ -965,7 +965,7 @@ static int balance_leaf (struct tree_balance * tb,
 			/* Append part of body into S_new[0] */
 			bi.tb = tb;
 			bi.bi_bh = S_new[i];
-			bi.bi_parent = 0;
+			bi.bi_parent = NULL;
 			bi.bi_position = 0;
 
 			if ( n_rem > zeros_num ) {
@@ -1021,7 +1021,7 @@ static int balance_leaf (struct tree_balance * tb,
 		    /* paste into item */
 		    bi.tb = tb;
 		    bi.bi_bh = S_new[i];
-		    bi.bi_parent = 0;
+		    bi.bi_parent = NULL;
 		    bi.bi_position = 0;
 		    leaf_paste_in_buffer(&bi, item_pos - n + snum[i], pos_in_item, tb->insert_size[0], body, zeros_num);
 
@@ -1196,11 +1196,11 @@ struct buffer_head * get_FEB (struct tree_balance * tb)
 
     bi.tb = tb;
     bi.bi_bh = first_b = tb->FEB[i];
-    bi.bi_parent = 0;
+    bi.bi_parent = NULL;
     bi.bi_position = 0;
     make_empty_node (&bi);
     set_buffer_uptodate(first_b);
-    tb->FEB[i] = 0;
+    tb->FEB[i] = NULL;
     tb->used[i] = first_b;
 
     return(first_b);
diff --git a/fs/reiserfs/file.c b/fs/reiserfs/file.c
index b74f71043..f52b701fc 100644
--- a/fs/reiserfs/file.c
+++ b/fs/reiserfs/file.c
@@ -131,7 +131,7 @@ int reiserfs_allocate_blocks_for_region(
     struct buffer_head *bh; // Buffer head that contains items that we are going to deal with
     __u32 * item; // pointer to item we are going to deal with
     INITIALIZE_PATH(path); // path to item, that we are going to deal with.
-    b_blocknr_t allocated_blocks[blocks_to_allocate]; // Pointer to a place where allocated blocknumbers would be stored. Right now statically allocated, later that will change.
+    b_blocknr_t *allocated_blocks; // Pointer to a place where allocated blocknumbers would be stored.
     reiserfs_blocknr_hint_t hint; // hint structure for block allocator.
     size_t res; // return value of various functions that we call.
     int curr_block; // current block used to keep track of unmapped blocks.
@@ -144,10 +144,20 @@ int reiserfs_allocate_blocks_for_region(
     int modifying_this_item = 0; // Flag for items traversal code to keep track
 				 // of the fact that we already prepared
 				 // current block for journal
-
+    int will_prealloc = 0;
 
     RFALSE(!blocks_to_allocate, "green-9004: tried to allocate zero blocks?");
 
+    /* only preallocate if this is a small write */
+    if (REISERFS_I(inode)->i_prealloc_count ||
+       (!(write_bytes & (inode->i_sb->s_blocksize -1)) &&
+        blocks_to_allocate <
+        REISERFS_SB(inode->i_sb)->s_alloc_options.preallocsize))
+        will_prealloc = REISERFS_SB(inode->i_sb)->s_alloc_options.preallocsize;
+
+    allocated_blocks = kmalloc((blocks_to_allocate + will_prealloc) *
+    					sizeof(b_blocknr_t), GFP_NOFS);
+
     /* First we compose a key to point at the writing position, we want to do
        that outside of any locking region. */
     make_cpu_key (&key, inode, pos+1, TYPE_ANY, 3/*key length*/);
@@ -174,13 +184,7 @@ int reiserfs_allocate_blocks_for_region(
     hint.key = key.on_disk_key; // on disk key of file.
     hint.block = inode->i_blocks>>(inode->i_sb->s_blocksize_bits-9); // Number of disk blocks this file occupies already.
     hint.formatted_node = 0; // We are allocating blocks for unformatted node.
-
-    /* only preallocate if this is a small write */
-    if (blocks_to_allocate <
-        REISERFS_SB(inode->i_sb)->s_alloc_options.preallocsize)
-        hint.preallocate = 1;
-    else
-        hint.preallocate = 0;
+    hint.preallocate = will_prealloc;
 
     /* Call block allocator to allocate blocks */
     res = reiserfs_allocate_blocknrs(&hint, allocated_blocks, blocks_to_allocate, blocks_to_allocate);
@@ -467,6 +471,12 @@ retry:
     // the inode.
     //
     pathrelse(&path);
+    /*
+     * cleanup prellocation from previous writes
+     * if this is a partial block write
+     */
+    if (write_bytes & (inode->i_sb->s_blocksize -1))
+        reiserfs_discard_prealloc(th, inode);
     reiserfs_write_unlock(inode->i_sb);
 
     // go through all the pages/buffers and map the buffers to newly allocated
@@ -504,6 +514,7 @@ retry:
 
     RFALSE( curr_block > blocks_to_allocate, "green-9007: Used too many blocks? weird");
 
+    kfree(allocated_blocks);
     return 0;
 
 // Need to deal with transaction here.
@@ -517,6 +528,7 @@ error_exit:
     reiserfs_update_sd(th, inode); // update any changes we made to blk count
     journal_end(th, inode->i_sb, JOURNAL_PER_BALANCE_CNT * 3 + 1);
     reiserfs_write_unlock(inode->i_sb);
+    kfree(allocated_blocks);
 
     return res;
 }
@@ -585,9 +597,19 @@ int reiserfs_commit_page(struct inode *inode, struct page *page,
     struct buffer_head *bh, *head;
     unsigned long i_size_index = inode->i_size >> PAGE_CACHE_SHIFT;
     int new;
+    int logit = reiserfs_file_data_log(inode);
+    struct super_block *s = inode->i_sb;
+    int bh_per_page = PAGE_CACHE_SIZE / s->s_blocksize;
+    struct reiserfs_transaction_handle th;
+    th.t_trans_id = 0;
 
     blocksize = 1 << inode->i_blkbits;
 
+    if (logit) {
+	reiserfs_write_lock(s);
+	journal_begin(&th, s, bh_per_page + 1);
+	reiserfs_update_inode_transaction(inode);
+    }
     for(bh = head = page_buffers(page), block_start = 0;
         bh != head || !block_start;
 	block_start=block_end, bh = bh->b_this_page)
@@ -601,7 +623,10 @@ int reiserfs_commit_page(struct inode *inode, struct page *page,
 		    partial = 1;
 	} else {
 	    set_buffer_uptodate(bh);
-	    if (!buffer_dirty(bh)) {
+	    if (logit) {
+		reiserfs_prepare_for_journal(s, bh, 1);
+		journal_mark_dirty(&th, s, bh);
+	    } else if (!buffer_dirty(bh)) {
 		mark_buffer_dirty(bh);
 		/* do data=ordered on any page past the end
 		 * of file and any buffer marked BH_New.
@@ -613,7 +638,10 @@ int reiserfs_commit_page(struct inode *inode, struct page *page,
 	    }
 	}
     }
-
+    if (logit) {
+	journal_end(&th, s, bh_per_page + 1);
+	reiserfs_write_unlock(s);
+    }
     /*
      * If this is a partial write which happened to make all buffers
      * uptodate then we can optimize away a bogus readpage() for
@@ -804,7 +832,7 @@ int reiserfs_prepare_file_region_for_write(
     struct item_head *ih = NULL; // pointer to item head that we are going to deal with
     struct buffer_head *itembuf=NULL; // Buffer head that contains items that we are going to deal with
     INITIALIZE_PATH(path); // path to item, that we are going to deal with.
-    __u32 * item=0; // pointer to item we are going to deal with
+    __u32 * item=NULL; // pointer to item we are going to deal with
     int item_pos=-1; /* Position in indirect item */
 
 
@@ -1254,6 +1282,7 @@ ssize_t reiserfs_file_write( struct file *file, /* the file we are going to writ
 	journal_end(&th, th.t_super, th.t_blocks_allocated);
         reiserfs_write_unlock(inode->i_sb);
     }
+
     if ((file->f_flags & O_SYNC) || IS_SYNC(inode))
 	res = generic_osync_inode(inode, file->f_mapping, OSYNC_METADATA|OSYNC_DATA);
 
diff --git a/fs/reiserfs/fix_node.c b/fs/reiserfs/fix_node.c
index 032201b08..649e32a5e 100644
--- a/fs/reiserfs/fix_node.c
+++ b/fs/reiserfs/fix_node.c
@@ -2445,12 +2445,12 @@ int fix_nodes (int n_op_mode,
 		reiserfs_restore_prepared_buffer(p_s_tb->tb_sb, p_s_tb->CFR[i]);
 	    }
 
-	    brelse (p_s_tb->L[i]);p_s_tb->L[i] = 0;
-	    brelse (p_s_tb->R[i]);p_s_tb->R[i] = 0;
-	    brelse (p_s_tb->FL[i]);p_s_tb->FL[i] = 0;
-	    brelse (p_s_tb->FR[i]);p_s_tb->FR[i] = 0;
-	    brelse (p_s_tb->CFL[i]);p_s_tb->CFL[i] = 0;
-	    brelse (p_s_tb->CFR[i]);p_s_tb->CFR[i] = 0;
+	    brelse (p_s_tb->L[i]);p_s_tb->L[i] = NULL;
+	    brelse (p_s_tb->R[i]);p_s_tb->R[i] = NULL;
+	    brelse (p_s_tb->FL[i]);p_s_tb->FL[i] = NULL;
+	    brelse (p_s_tb->FR[i]);p_s_tb->FR[i] = NULL;
+	    brelse (p_s_tb->CFL[i]);p_s_tb->CFL[i] = NULL;
+	    brelse (p_s_tb->CFR[i]);p_s_tb->CFR[i] = NULL;
 	}
 
 	if (wait_tb_buffers_run) {
diff --git a/fs/reiserfs/ibalance.c b/fs/reiserfs/ibalance.c
index 3df6dda7d..5b9dee2ac 100644
--- a/fs/reiserfs/ibalance.c
+++ b/fs/reiserfs/ibalance.c
@@ -922,7 +922,7 @@ int balance_internal (struct tree_balance * tb,			/* tree_balance structure 		*/
 
 
 	if ( tb->blknum[h] != 1 )
-	    reiserfs_panic(0, "balance_internal: One new node required for creating the new root");
+	    reiserfs_panic(NULL, "balance_internal: One new node required for creating the new root");
 	/* S[h] = empty buffer from the list FEB. */
 	tbSh = get_FEB (tb);
         blkh = B_BLK_HEAD(tbSh);
@@ -964,7 +964,7 @@ int balance_internal (struct tree_balance * tb,			/* tree_balance structure 		*/
 
 	dest_bi.tb = tb;
 	dest_bi.bi_bh = S_new;
-	dest_bi.bi_parent = 0;
+	dest_bi.bi_parent = NULL;
 	dest_bi.bi_position = 0;
 	src_bi.tb = tb;
 	src_bi.bi_bh = tbSh;
diff --git a/fs/reiserfs/inode.c b/fs/reiserfs/inode.c
index fde429f2b..8f983da39 100644
--- a/fs/reiserfs/inode.c
+++ b/fs/reiserfs/inode.c
@@ -557,7 +557,7 @@ int reiserfs_get_block (struct inode * inode, sector_t block,
     INITIALIZE_PATH(path);
     int pos_in_item;
     struct cpu_key key;
-    struct buffer_head * bh, * unbh = 0;
+    struct buffer_head * bh, * unbh = NULL;
     struct item_head * ih, tmp_ih;
     __u32 * item;
     int done;
@@ -1114,9 +1114,9 @@ static void init_inode (struct inode * inode, struct path * path)
 	REISERFS_I(inode)->i_attrs = sd_v2_attrs( sd );
 	sd_attrs_to_i_attrs( sd_v2_attrs( sd ), inode );
     }
-    inode->i_uid = INOXID_UID(uid, gid);
-    inode->i_gid = INOXID_GID(uid, gid);
-    inode->i_xid = INOXID_XID(uid, gid, 0);
+    inode->i_uid = INOXID_UID(XID_TAG(inode), uid, gid);
+    inode->i_gid = INOXID_GID(XID_TAG(inode), uid, gid);
+    inode->i_xid = INOXID_XID(XID_TAG(inode), uid, gid, 0);
 
     pathrelse (path);
     if (S_ISREG (inode->i_mode)) {
@@ -1141,8 +1141,8 @@ static void init_inode (struct inode * inode, struct path * path)
 static void inode2sd (void * sd, struct inode * inode, loff_t size)
 {
     struct stat_data * sd_v2 = (struct stat_data *)sd;
-    uid_t uid = XIDINO_UID(inode->i_uid, inode->i_xid);
-    gid_t gid = XIDINO_GID(inode->i_gid, inode->i_xid);
+    uid_t uid = XIDINO_UID(XID_TAG(inode), inode->i_uid, inode->i_xid);
+    gid_t gid = XIDINO_GID(XID_TAG(inode), inode->i_gid, inode->i_xid);
     __u16 flags;
 
     set_sd_v2_uid(sd_v2, uid );
@@ -1404,7 +1404,7 @@ struct inode * reiserfs_iget (struct super_block * s, const struct cpu_key * key
     if (comp_short_keys (INODE_PKEY (inode), key) || is_bad_inode (inode)) {
 	/* either due to i/o error or a stale NFS handle */
 	iput (inode);
-	inode = 0;
+	inode = NULL;
     }
     return inode;
 }
@@ -1568,13 +1568,13 @@ static int reiserfs_new_directory (struct reiserfs_transaction_handle *th,
        old type (ITEM_VERSION_1). Do not set key (second arg is 0), it
        is done by reiserfs_new_inode */
     if (old_format_only (sb)) {
-	make_le_item_head (ih, 0, KEY_FORMAT_3_5, DOT_OFFSET, TYPE_DIRENTRY, EMPTY_DIR_SIZE_V1, 2);
+	make_le_item_head (ih, NULL, KEY_FORMAT_3_5, DOT_OFFSET, TYPE_DIRENTRY, EMPTY_DIR_SIZE_V1, 2);
 	
 	make_empty_dir_item_v1 (body, ih->ih_key.k_dir_id, ih->ih_key.k_objectid,
 				INODE_PKEY (dir)->k_dir_id, 
 				INODE_PKEY (dir)->k_objectid );
     } else {
-	make_le_item_head (ih, 0, KEY_FORMAT_3_5, DOT_OFFSET, TYPE_DIRENTRY, EMPTY_DIR_SIZE, 2);
+	make_le_item_head (ih, NULL, KEY_FORMAT_3_5, DOT_OFFSET, TYPE_DIRENTRY, EMPTY_DIR_SIZE, 2);
 	
 	make_empty_dir_item (body, ih->ih_key.k_dir_id, ih->ih_key.k_objectid,
 		   		INODE_PKEY (dir)->k_dir_id, 
@@ -1616,7 +1616,7 @@ static int reiserfs_new_symlink (struct reiserfs_transaction_handle *th,
 		   le32_to_cpu (ih->ih_key.k_objectid),
 		   1, TYPE_DIRECT, 3/*key length*/);
 
-    make_le_item_head (ih, 0, KEY_FORMAT_3_5, 1, TYPE_DIRECT, item_len, 0/*free_space*/);
+    make_le_item_head (ih, NULL, KEY_FORMAT_3_5, 1, TYPE_DIRECT, item_len, 0/*free_space*/);
 
     /* look for place in the tree for new item */
     retval = search_item (sb, &key, path);
@@ -1670,7 +1670,7 @@ int reiserfs_new_inode (struct reiserfs_transaction_handle *th,
     sb = dir->i_sb;
 
     /* item head of new item */
-    ih.ih_key.k_dir_id = INODE_PKEY (dir)->k_objectid;
+    ih.ih_key.k_dir_id = reiserfs_choose_packing(dir);
     ih.ih_key.k_objectid = cpu_to_le32 (reiserfs_get_unused_objectid (th));
     if (!ih.ih_key.k_objectid) {
 	err = -ENOMEM;
@@ -1711,7 +1711,7 @@ int reiserfs_new_inode (struct reiserfs_transaction_handle *th,
     REISERFS_I(inode)->i_prealloc_block = 0;
     REISERFS_I(inode)->i_prealloc_count = 0;
     REISERFS_I(inode)->i_trans_id = 0;
-    REISERFS_I(inode)->i_jl = 0;
+    REISERFS_I(inode)->i_jl = NULL;
     REISERFS_I(inode)->i_attrs =
 	REISERFS_I(dir)->i_attrs & REISERFS_INHERIT_MASK;
     sd_attrs_to_i_attrs( REISERFS_I(inode) -> i_attrs, inode );
@@ -1720,9 +1720,9 @@ int reiserfs_new_inode (struct reiserfs_transaction_handle *th,
     init_rwsem (&REISERFS_I(inode)->xattr_sem);
 
     if (old_format_only (sb))
-	make_le_item_head (&ih, 0, KEY_FORMAT_3_5, SD_OFFSET, TYPE_STAT_DATA, SD_V1_SIZE, MAX_US_INT);
+	make_le_item_head (&ih, NULL, KEY_FORMAT_3_5, SD_OFFSET, TYPE_STAT_DATA, SD_V1_SIZE, MAX_US_INT);
     else
-	make_le_item_head (&ih, 0, KEY_FORMAT_3_6, SD_OFFSET, TYPE_STAT_DATA, SD_SIZE, MAX_US_INT);
+	make_le_item_head (&ih, NULL, KEY_FORMAT_3_6, SD_OFFSET, TYPE_STAT_DATA, SD_SIZE, MAX_US_INT);
 
     /* key to search for correct place for new stat data */
     _make_cpu_key (&key, KEY_FORMAT_3_6, le32_to_cpu (ih.ih_key.k_dir_id),
@@ -1739,7 +1739,6 @@ int reiserfs_new_inode (struct reiserfs_transaction_handle *th,
 	err = -EEXIST;
 	goto out_bad_inode;
     }
-
     if (old_format_only (sb)) {
 	if (inode->i_uid & ~0xffff || inode->i_gid & ~0xffff) {
 	    pathrelse (&path_to_key);
@@ -2158,6 +2157,11 @@ static int reiserfs_write_full_page(struct page *page, struct writeback_control
     struct buffer_head *head, *bh;
     int partial = 0 ;
     int nr = 0;
+    int checked = PageChecked(page);
+    struct reiserfs_transaction_handle th;
+    struct super_block *s = inode->i_sb;
+    int bh_per_page = PAGE_CACHE_SIZE / s->s_blocksize;
+    th.t_trans_id = 0;
 
     /* The page dirty bit is cleared before writepage is called, which
      * means we have to tell create_empty_buffers to make dirty buffers
@@ -2165,7 +2169,7 @@ static int reiserfs_write_full_page(struct page *page, struct writeback_control
      * in the BH_Uptodate is just a sanity check.
      */
     if (!page_has_buffers(page)) {
-	create_empty_buffers(page, inode->i_sb->s_blocksize, 
+	create_empty_buffers(page, s->s_blocksize,
 	                    (1 << BH_Dirty) | (1 << BH_Uptodate));
     }
     head = page_buffers(page) ;
@@ -2189,10 +2193,10 @@ static int reiserfs_write_full_page(struct page *page, struct writeback_control
 	kunmap_atomic(kaddr, KM_USER0) ;
     }
     bh = head ;
-    block = page->index << (PAGE_CACHE_SHIFT - inode->i_sb->s_blocksize_bits) ;
+    block = page->index << (PAGE_CACHE_SHIFT - s->s_blocksize_bits) ;
     /* first map all the buffers, logging any direct items we find */
     do {
-	if (buffer_dirty(bh) && (!buffer_mapped(bh) ||
+	if ((checked || buffer_dirty(bh)) && (!buffer_mapped(bh) ||
 	   (buffer_mapped(bh) && bh->b_blocknr == 0))) {
 	    /* not mapped yet, or it points to a direct item, search
 	     * the btree for the mapping info, and log any direct
@@ -2206,6 +2210,18 @@ static int reiserfs_write_full_page(struct page *page, struct writeback_control
 	block++;
     } while(bh != head) ;
 
+    /*
+     * we start the transaction after map_block_for_writepage,
+     * because it can create holes in the file (an unbounded operation).
+     * starting it here, we can make a reliable estimate for how many
+     * blocks we're going to log
+     */
+    if (checked) {
+	ClearPageChecked(page);
+	reiserfs_write_lock(s);
+	journal_begin(&th, s, bh_per_page + 1);
+	reiserfs_update_inode_transaction(inode);
+    }
     /* now go through and lock any dirty buffers on the page */
     do {
 	get_bh(bh);
@@ -2214,6 +2230,11 @@ static int reiserfs_write_full_page(struct page *page, struct writeback_control
 	if (buffer_mapped(bh) && bh->b_blocknr == 0)
 	    continue;
 
+	if (checked) {
+	    reiserfs_prepare_for_journal(s, bh, 1);
+	    journal_mark_dirty(&th, s, bh);
+	    continue;
+	}
 	/* from this point on, we know the buffer is mapped to a
 	 * real block and not a direct item
 	 */
@@ -2232,6 +2253,10 @@ static int reiserfs_write_full_page(struct page *page, struct writeback_control
 	}
     } while((bh = bh->b_this_page) != head);
 
+    if (checked) {
+	journal_end(&th, s, bh_per_page + 1);
+	reiserfs_write_unlock(s);
+    }
     BUG_ON(PageWriteback(page));
     set_page_writeback(page);
     unlock_page(page);
@@ -2507,17 +2532,15 @@ static int invalidatepage_can_drop(struct inode *inode, struct buffer_head *bh)
     /* the page is locked, and the only places that log a data buffer
      * also lock the page.
      */
-#if 0
     if (reiserfs_file_data_log(inode)) {
-	/* very conservative, leave the buffer pinned if anyone might need it.
-	** this should be changed to drop the buffer if it is only in the
-	** current transaction
-	*/
+	/*
+	 * very conservative, leave the buffer pinned if
+	 * anyone might need it.
+	 */
         if (buffer_journaled(bh) || buffer_journal_dirty(bh)) {
 	    ret = 0 ;
 	}
     } else
-#endif
     if (buffer_dirty(bh) || buffer_locked(bh)) {
 	struct reiserfs_journal_list *jl;
 	struct reiserfs_jh *jh = bh->b_private;
@@ -2555,6 +2578,10 @@ static int reiserfs_invalidatepage(struct page *page, unsigned long offset)
     int ret = 1;
 
     BUG_ON(!PageLocked(page));
+
+    if (offset == 0)
+	ClearPageChecked(page);
+
     if (!page_has_buffers(page))
 	goto out;
 
@@ -2588,6 +2615,15 @@ out:
     return ret;
 }
 
+static int reiserfs_set_page_dirty(struct page *page) {
+    struct inode *inode = page->mapping->host;
+    if (reiserfs_file_data_log(inode)) {
+	SetPageChecked(page);
+	return __set_page_dirty_nobuffers(page);
+    }
+    return __set_page_dirty_buffers(page);
+}
+
 /*
  * Returns 1 if the page's buffers were dropped.  The page is locked.
  *
@@ -2605,6 +2641,7 @@ static int reiserfs_releasepage(struct page *page, int unused_gfp_flags)
     struct buffer_head *bh ;
     int ret = 1 ;
 
+    WARN_ON(PageChecked(page));
     spin_lock(&j->j_dirty_buffers_lock) ;
     head = page_buffers(page) ;
     bh = head ;
@@ -2709,7 +2746,7 @@ int reiserfs_setattr(struct dentry *dentry, struct iattr *attr) {
                     error = DQUOT_TRANSFER(inode, attr) ? -EDQUOT : 0;
         }
         if (!error)
-            inode_setattr(inode, attr) ;
+            error = inode_setattr(inode, attr) ;
     }
 
 
@@ -2735,5 +2772,6 @@ struct address_space_operations reiserfs_address_space_operations = {
     .prepare_write = reiserfs_prepare_write,
     .commit_write = reiserfs_commit_write,
     .bmap = reiserfs_aop_bmap,
-    .direct_IO = reiserfs_direct_IO
+    .direct_IO = reiserfs_direct_IO,
+    .set_page_dirty = reiserfs_set_page_dirty,
 } ;
diff --git a/fs/reiserfs/ioctl.c b/fs/reiserfs/ioctl.c
index 21d7c8310..6885230ec 100644
--- a/fs/reiserfs/ioctl.c
+++ b/fs/reiserfs/ioctl.c
@@ -49,9 +49,11 @@ int reiserfs_ioctl (struct inode * inode, struct file * filp, unsigned int cmd,
 			return -EFAULT;
 
 		oldflags = REISERFS_I(inode) -> i_attrs;
-		if ( (oldflags & REISERFS_IMMUTABLE_FL) || ( ( (flags ^ oldflags) &
-		   (REISERFS_IMMUTABLE_FL | REISERFS_IUNLINK_FL | REISERFS_APPEND_FL)) &&
-		     !capable( CAP_LINUX_IMMUTABLE ) ) )
+		if ( ( (oldflags & REISERFS_IMMUTABLE_FL) ||
+			( (flags ^ oldflags) &
+			(REISERFS_IMMUTABLE_FL | REISERFS_IUNLINK_FL |
+			 REISERFS_APPEND_FL) ) ) &&
+			!capable( CAP_LINUX_IMMUTABLE ) )
 			return -EPERM;
 			
 		if( ( flags & REISERFS_NOTAIL_FL ) &&
diff --git a/fs/reiserfs/item_ops.c b/fs/reiserfs/item_ops.c
index 7ad205848..c315edbb2 100644
--- a/fs/reiserfs/item_ops.c
+++ b/fs/reiserfs/item_ops.c
@@ -549,7 +549,7 @@ static int direntry_create_vi (struct virtual_node * vn,
     
 	if (l + IH_SIZE != vi->vi_item_len + 
 	    ((is_affected && (vn->vn_mode == M_PASTE || vn->vn_mode == M_CUT)) ? insert_size : 0) ) {
-	    reiserfs_panic (0, "vs-8025: set_entry_sizes: (mode==%c, insert_size==%d), invalid length of directory item",
+	    reiserfs_panic (NULL, "vs-8025: set_entry_sizes: (mode==%c, insert_size==%d), invalid length of directory item",
 			    vn->vn_mode, insert_size);
 	}
     }
diff --git a/fs/reiserfs/journal.c b/fs/reiserfs/journal.c
index 52e637f8b..7ced01070 100644
--- a/fs/reiserfs/journal.c
+++ b/fs/reiserfs/journal.c
@@ -1024,7 +1024,6 @@ static int flush_commit_list(struct super_block *s, struct reiserfs_journal_list
   up(&jl->j_commit_lock);
 put_jl:
   put_journal_list(s, jl);
-
   return 0 ;
 }
 
@@ -1544,14 +1543,18 @@ static int flush_used_journal_lists(struct super_block *s,
     unsigned long cur_len;
     int ret;
     int i;
+    int limit = 256;
     struct reiserfs_journal_list *tjl;
     struct reiserfs_journal_list *flush_jl;
     unsigned long trans_id;
 
     flush_jl = tjl = jl;
 
-    /* flush for 256 transactions or 256 blocks, whichever comes first */
-    for(i = 0 ; i < 256 && len < 256 ; i++) {
+    /* in data logging mode, try harder to flush a lot of blocks */
+    if (reiserfs_data_log(s))
+	limit = 1024;
+    /* flush for 256 transactions or limit blocks, whichever comes first */
+    for(i = 0 ; i < 256 && len < limit ; i++) {
 	if (atomic_read(&tjl->j_commit_left) ||
 	    tjl->j_trans_id < jl->j_trans_id) {
 	    break;
@@ -3482,10 +3485,16 @@ static int do_journal_end(struct reiserfs_transaction_handle *th, struct super_b
     /* copy all the real blocks into log area.  dirty log blocks */
     if (test_bit(BH_JDirty, &cn->bh->b_state)) {
       struct buffer_head *tmp_bh ;
+      char *addr;
+      struct page *page;
       tmp_bh =  journal_getblk(p_s_sb, SB_ONDISK_JOURNAL_1st_BLOCK(p_s_sb) + 
 		       ((cur_write_start + jindex) % SB_ONDISK_JOURNAL_SIZE(p_s_sb))) ;
       set_buffer_uptodate(tmp_bh);
-      memcpy(tmp_bh->b_data, cn->bh->b_data, cn->bh->b_size) ;  
+      page = cn->bh->b_page;
+      addr = kmap(page);
+      memcpy(tmp_bh->b_data, addr + offset_in_page(cn->bh->b_data),
+             cn->bh->b_size);
+      kunmap(page);
       mark_buffer_dirty(tmp_bh);
       jindex++ ;
       set_bit(BH_JDirty_wait, &(cn->bh->b_state)) ; 
diff --git a/fs/reiserfs/lbalance.c b/fs/reiserfs/lbalance.c
index b1cef222a..2406608fc 100644
--- a/fs/reiserfs/lbalance.c
+++ b/fs/reiserfs/lbalance.c
@@ -49,7 +49,7 @@ static void leaf_copy_dir_entries (struct buffer_info * dest_bi, struct buffer_h
                                 deh_location( &(deh[from + copy_count - 1]));
     } else {
 	copy_records_len = 0;
-	records = 0;
+	records = NULL;
     }
 
     /* when copy last to first, dest buffer can contain 0 items */
@@ -145,7 +145,7 @@ static int leaf_copy_boundary_item (struct buffer_info * dest_bi, struct buffer_
     else {
       if (bytes_or_entries == ih_item_len(ih) && is_indirect_le_ih(ih))
 	if (get_ih_free_space (ih))
-	  reiserfs_panic (0, "vs-10020: leaf_copy_boundary_item: "
+	  reiserfs_panic (NULL, "vs-10020: leaf_copy_boundary_item: "
 			  "last unformatted node must be filled entirely (%h)",
 			  ih);
     }
@@ -552,13 +552,13 @@ static void leaf_define_dest_src_infos (int shift_mode, struct tree_balance * tb
 	src_bi->bi_position = PATH_H_B_ITEM_ORDER (tb->tb_path, 0);
 	dest_bi->tb = tb;
 	dest_bi->bi_bh = Snew;
-	dest_bi->bi_parent = 0;
+	dest_bi->bi_parent = NULL;
 	dest_bi->bi_position = 0;
 	*first_last = LAST_TO_FIRST;
 	break;
     
     default:
-	reiserfs_panic (0, "vs-10250: leaf_define_dest_src_infos: shift type is unknown (%d)", shift_mode);
+	reiserfs_panic (NULL, "vs-10250: leaf_define_dest_src_infos: shift type is unknown (%d)", shift_mode);
     }
     RFALSE( src_bi->bi_bh == 0 || dest_bi->bi_bh == 0,
 	    "vs-10260: mode==%d, source (%p) or dest (%p) buffer is initialized incorrectly",
@@ -595,7 +595,7 @@ int leaf_shift_left (struct tree_balance * tb, int shift_num, int shift_bytes)
   int i;
 
   /* move shift_num (and shift_bytes bytes) items from S[0] to left neighbor L[0] */
-  i = leaf_move_items (LEAF_FROM_S_TO_L, tb, shift_num, shift_bytes, 0);
+  i = leaf_move_items (LEAF_FROM_S_TO_L, tb, shift_num, shift_bytes, NULL);
 
   if ( shift_num ) {
     if (B_NR_ITEMS (S0) == 0) { /* number of items in S[0] == 0 */
@@ -648,7 +648,7 @@ int	leaf_shift_right(
   int ret_value;
 
   /* move shift_num (and shift_bytes) items from S[0] to right neighbor R[0] */
-  ret_value = leaf_move_items (LEAF_FROM_S_TO_R, tb, shift_num, shift_bytes, 0);
+  ret_value = leaf_move_items (LEAF_FROM_S_TO_R, tb, shift_num, shift_bytes, NULL);
 
   /* replace rkey in CFR[0] by the 0-th key from R[0] */
   if (shift_num) {
@@ -829,7 +829,7 @@ void leaf_paste_in_buffer (struct buffer_info * bi, int affected_item_num,
 #ifdef CONFIG_REISERFS_CHECK
     if (zeros_number > paste_size) {
 	print_cur_tb ("10177");
-	reiserfs_panic ( 0, "vs-10177: leaf_paste_in_buffer: ero number == %d, paste_size == %d",
+	reiserfs_panic ( NULL, "vs-10177: leaf_paste_in_buffer: ero number == %d, paste_size == %d",
                          zeros_number, paste_size);
     }
 #endif /* CONFIG_REISERFS_CHECK */
diff --git a/fs/reiserfs/namei.c b/fs/reiserfs/namei.c
index 52d88ae28..fb17ab491 100644
--- a/fs/reiserfs/namei.c
+++ b/fs/reiserfs/namei.c
@@ -331,7 +331,7 @@ static struct dentry * reiserfs_lookup (struct inode * dir, struct dentry * dent
 	return ERR_PTR(-ENAMETOOLONG);
 
     reiserfs_write_lock(dir->i_sb);
-    de.de_gen_number_bit_string = 0;
+    de.de_gen_number_bit_string = NULL;
     retval = reiserfs_find_entry (dir, dentry->d_name.name, dentry->d_name.len, &path_to_entry, &de);
     pathrelse (&path_to_entry);
     if (retval == NAME_FOUND) {
@@ -384,7 +384,7 @@ struct dentry *reiserfs_get_parent(struct dentry *child)
     if (dir->i_nlink == 0) {
 	return ERR_PTR(-ENOENT);
     }
-    de.de_gen_number_bit_string = 0;
+    de.de_gen_number_bit_string = NULL;
 
     reiserfs_write_lock(dir->i_sb);
     retval = reiserfs_find_entry (dir, "..", 2, &path_to_entry, &de);
@@ -607,7 +607,7 @@ static int reiserfs_create (struct inode * dir, struct dentry *dentry, int mode,
         reiserfs_write_lock_xattrs (dir->i_sb);
 
     journal_begin(&th, dir->i_sb, jbegin_count) ;
-    retval = reiserfs_new_inode (&th, dir, mode, 0, 0/*i_size*/, dentry, inode);
+    retval = reiserfs_new_inode (&th, dir, mode, NULL, 0/*i_size*/, dentry, inode);
 
     if (locked)
         reiserfs_write_unlock_xattrs (dir->i_sb);
@@ -668,7 +668,7 @@ static int reiserfs_mknod (struct inode * dir, struct dentry *dentry, int mode,
 
     journal_begin(&th, dir->i_sb, jbegin_count) ;
 
-    retval = reiserfs_new_inode (&th, dir, mode, 0, 0/*i_size*/, dentry, inode);
+    retval = reiserfs_new_inode (&th, dir, mode, NULL, 0/*i_size*/, dentry, inode);
 
     if (locked)
         reiserfs_write_unlock_xattrs (dir->i_sb);
@@ -737,7 +737,7 @@ static int reiserfs_mkdir (struct inode * dir, struct dentry *dentry, int mode)
     */
     INC_DIR_INODE_NLINK(dir)
 
-    retval = reiserfs_new_inode (&th, dir, mode, 0/*symlink*/,
+    retval = reiserfs_new_inode (&th, dir, mode, NULL/*symlink*/,
 				old_format_only (dir->i_sb) ? 
 				EMPTY_DIR_SIZE_V1 : EMPTY_DIR_SIZE,
 				dentry, inode);
@@ -805,7 +805,7 @@ static int reiserfs_rmdir (struct inode * dir, struct dentry *dentry)
     reiserfs_write_lock(dir->i_sb);
     journal_begin(&th, dir->i_sb, jbegin_count) ;
 
-    de.de_gen_number_bit_string = 0;
+    de.de_gen_number_bit_string = NULL;
     if ( (retval = reiserfs_find_entry (dir, dentry->d_name.name, dentry->d_name.len, &path, &de)) == NAME_NOT_FOUND) {
 	retval = -ENOENT;
 	goto end_rmdir;
@@ -886,7 +886,7 @@ static int reiserfs_unlink (struct inode * dir, struct dentry *dentry)
     reiserfs_write_lock(dir->i_sb);
     journal_begin(&th, dir->i_sb, jbegin_count) ;
 	
-    de.de_gen_number_bit_string = 0;
+    de.de_gen_number_bit_string = NULL;
     if ( (retval = reiserfs_find_entry (dir, dentry->d_name.name, dentry->d_name.len, &path, &de)) == NAME_NOT_FOUND) {
 	retval = -ENOENT;
 	goto end_unlink;
@@ -1093,13 +1093,13 @@ static int entry_points_to_object (const char * name, int len, struct reiserfs_d
 
     if (inode) {
 	if (!de_visible (de->de_deh + de->de_entry_num))
-	    reiserfs_panic (0, "vs-7042: entry_points_to_object: entry must be visible");
+	    reiserfs_panic (NULL, "vs-7042: entry_points_to_object: entry must be visible");
 	return (de->de_objectid == inode->i_ino) ? 1 : 0;
     }
 
     /* this must be added hidden entry */
     if (de_visible (de->de_deh + de->de_entry_num))
-	reiserfs_panic (0, "vs-7043: entry_points_to_object: entry must be visible");
+	reiserfs_panic (NULL, "vs-7043: entry_points_to_object: entry must be visible");
 
     return 1;
 }
@@ -1149,7 +1149,7 @@ static int reiserfs_rename (struct inode * old_dir, struct dentry *old_dentry,
 
     // make sure, that oldname still exists and points to an object we
     // are going to rename
-    old_de.de_gen_number_bit_string = 0;
+    old_de.de_gen_number_bit_string = NULL;
     reiserfs_write_lock(old_dir->i_sb);
     retval = reiserfs_find_entry (old_dir, old_dentry->d_name.name, old_dentry->d_name.len,
 				  &old_entry_path, &old_de);
@@ -1180,7 +1180,7 @@ static int reiserfs_rename (struct inode * old_dir, struct dentry *old_dentry,
 	/* directory is renamed, its parent directory will be changed, 
 	** so find ".." entry 
 	*/
-	dot_dot_de.de_gen_number_bit_string = 0;
+	dot_dot_de.de_gen_number_bit_string = NULL;
 	retval = reiserfs_find_entry (old_inode, "..", 2, &dot_dot_entry_path, &dot_dot_de);
 	pathrelse (&dot_dot_entry_path);
 	if (retval != NAME_FOUND) {
@@ -1232,7 +1232,7 @@ static int reiserfs_rename (struct inode * old_dir, struct dentry *old_dentry,
 	reiserfs_prepare_for_journal(old_inode->i_sb, old_de.de_bh, 1) ;
 
 	// look for new name by reiserfs_find_entry
-	new_de.de_gen_number_bit_string = 0;
+	new_de.de_gen_number_bit_string = NULL;
 	retval = reiserfs_find_entry (new_dir, new_dentry->d_name.name, new_dentry->d_name.len, 
 				      &new_entry_path, &new_de);
 	// reiserfs_add_entry should not return IO_ERROR, because it is called with essentially same parameters from
@@ -1389,8 +1389,9 @@ struct inode_operations reiserfs_dir_inode_operations = {
  * stuff added
  */
 struct inode_operations reiserfs_symlink_inode_operations = {
-    .readlink       = page_readlink,
-    .follow_link    = page_follow_link,
+    .readlink       = generic_readlink,
+    .follow_link    = page_follow_link_light,
+    .put_link       = page_put_link,
     .setattr        = reiserfs_setattr,
     .setxattr       = reiserfs_setxattr,
     .getxattr       = reiserfs_getxattr,
diff --git a/fs/reiserfs/prints.c b/fs/reiserfs/prints.c
index 450208848..95217062f 100644
--- a/fs/reiserfs/prints.c
+++ b/fs/reiserfs/prints.c
@@ -631,8 +631,8 @@ void store_print_tb (struct tree_balance * tb)
 	    tbSh = PATH_H_PBUFFER (tb->tb_path, h);
 	    tbFh = PATH_H_PPARENT (tb->tb_path, h);
 	} else {
-	    tbSh = 0;
-	    tbFh = 0;
+	    tbSh = NULL;
+	    tbFh = NULL;
 	}
 	sprintf (print_tb_buf + strlen (print_tb_buf),
 		 "* %d * %3lld(%2d) * %3lld(%2d) * %3lld(%2d) * %5lld * %5lld * %5lld * %5lld * %5lld *\n",
@@ -695,10 +695,10 @@ static void check_leaf_block_head (struct buffer_head * bh)
   blkh = B_BLK_HEAD (bh);
   nr = blkh_nr_item(blkh);
   if ( nr > (bh->b_size - BLKH_SIZE) / IH_SIZE)
-    reiserfs_panic (0, "vs-6010: check_leaf_block_head: invalid item number %z", bh);
+    reiserfs_panic (NULL, "vs-6010: check_leaf_block_head: invalid item number %z", bh);
   if ( blkh_free_space(blkh) > 
       bh->b_size - BLKH_SIZE - IH_SIZE * nr )
-    reiserfs_panic (0, "vs-6020: check_leaf_block_head: invalid free space %z", bh);
+    reiserfs_panic (NULL, "vs-6020: check_leaf_block_head: invalid free space %z", bh);
     
 }
 
@@ -708,14 +708,14 @@ static void check_internal_block_head (struct buffer_head * bh)
     
     blkh = B_BLK_HEAD (bh);
     if (!(B_LEVEL (bh) > DISK_LEAF_NODE_LEVEL && B_LEVEL (bh) <= MAX_HEIGHT))
-	reiserfs_panic (0, "vs-6025: check_internal_block_head: invalid level %z", bh);
+	reiserfs_panic (NULL, "vs-6025: check_internal_block_head: invalid level %z", bh);
 
     if (B_NR_ITEMS (bh) > (bh->b_size - BLKH_SIZE) / IH_SIZE)
-	reiserfs_panic (0, "vs-6030: check_internal_block_head: invalid item number %z", bh);
+	reiserfs_panic (NULL, "vs-6030: check_internal_block_head: invalid item number %z", bh);
 
     if (B_FREE_SPACE (bh) != 
 	bh->b_size - BLKH_SIZE - KEY_SIZE * B_NR_ITEMS (bh) - DC_SIZE * (B_NR_ITEMS (bh) + 1))
-	reiserfs_panic (0, "vs-6040: check_internal_block_head: invalid free space %z", bh);
+	reiserfs_panic (NULL, "vs-6040: check_internal_block_head: invalid free space %z", bh);
 
 }
 
diff --git a/fs/reiserfs/procfs.c b/fs/reiserfs/procfs.c
index b9f5be9d8..950998419 100644
--- a/fs/reiserfs/procfs.c
+++ b/fs/reiserfs/procfs.c
@@ -591,7 +591,7 @@ void reiserfs_proc_unregister_global( const char *name )
 int reiserfs_proc_info_global_init( void )
 {
 	if( proc_info_root == NULL ) {
-		proc_info_root = proc_mkdir( proc_info_root_name, 0 );
+		proc_info_root = proc_mkdir(proc_info_root_name, NULL);
 		if( proc_info_root ) {
 			proc_info_root -> owner = THIS_MODULE;
 		} else {
@@ -608,7 +608,7 @@ int reiserfs_proc_info_global_done( void )
 {
 	if ( proc_info_root != NULL ) {
 		proc_info_root = NULL;
-		remove_proc_entry( proc_info_root_name, 0 );
+		remove_proc_entry(proc_info_root_name, NULL);
 	}
 	return 0;
 }
diff --git a/fs/reiserfs/stree.c b/fs/reiserfs/stree.c
index ab1c01dd6..497b2f371 100644
--- a/fs/reiserfs/stree.c
+++ b/fs/reiserfs/stree.c
@@ -596,26 +596,29 @@ static int is_tree_node (struct buffer_head * bh, int level)
 
 
 
-#ifdef SEARCH_BY_KEY_READA
+#define SEARCH_BY_KEY_READA 16
 
 /* The function is NOT SCHEDULE-SAFE! */
-static void search_by_key_reada (struct super_block * s, int blocknr)
+static void search_by_key_reada (struct super_block * s,
+                                 struct buffer_head **bh,
+				 unsigned long *b, int num)
 {
-    struct buffer_head * bh;
-  
-    if (blocknr == 0)
-	return;
-
-    bh = sb_getblk (s, blocknr);
+    int i,j;
   
-    if (!buffer_uptodate (bh)) {
-	ll_rw_block (READA, 1, &bh);
+    for (i = 0 ; i < num ; i++) {
+	bh[i] = sb_getblk (s, b[i]);
+    }
+    for (j = 0 ; j < i ; j++) {
+	/*
+	 * note, this needs attention if we are getting rid of the BKL
+	 * you have to make sure the prepared bit isn't set on this buffer
+	 */
+	if (!buffer_uptodate(bh[j]))
+	    ll_rw_block(READA, 1, bh + j);
+    	brelse(bh[j]);
     }
-    bh->b_count --;
 }
 
-#endif
-
 /**************************************************************************
  * Algorithm   SearchByKey                                                *
  *             look for item in the Disk S+Tree by its key                *
@@ -657,6 +660,9 @@ int search_by_key (struct super_block * p_s_sb,
     int				n_node_level, n_retval;
     int 			right_neighbor_of_leaf_node;
     int				fs_gen;
+    struct buffer_head *reada_bh[SEARCH_BY_KEY_READA];
+    unsigned long      reada_blocks[SEARCH_BY_KEY_READA];
+    int reada_count = 0;
 
 #ifdef CONFIG_REISERFS_CHECK
     int n_repeat_counter = 0;
@@ -691,19 +697,25 @@ int search_by_key (struct super_block * p_s_sb,
 	p_s_last_element = PATH_OFFSET_PELEMENT(p_s_search_path, ++p_s_search_path->path_length);
 	fs_gen = get_generation (p_s_sb);
 
-#ifdef SEARCH_BY_KEY_READA
-	/* schedule read of right neighbor */
-	search_by_key_reada (p_s_sb, right_neighbor_of_leaf_node);
-#endif
-
 	/* Read the next tree node, and set the last element in the path to
            have a pointer to it. */
-	if ( ! (p_s_bh = p_s_last_element->pe_buffer =
-		sb_bread(p_s_sb, n_block_number)) ) {
+	if ((p_s_bh = p_s_last_element->pe_buffer =
+	     sb_getblk(p_s_sb, n_block_number)) ) {
+	    if (!buffer_uptodate(p_s_bh) && reada_count > 1) {
+		search_by_key_reada (p_s_sb, reada_bh,
+		                     reada_blocks, reada_count);
+	    }
+	    ll_rw_block(READ, 1, &p_s_bh);
+	    wait_on_buffer(p_s_bh);
+	    if (!buffer_uptodate(p_s_bh))
+	        goto io_error;
+	} else {
+io_error:
 	    p_s_search_path->path_length --;
 	    pathrelse(p_s_search_path);
 	    return IO_ERROR;
 	}
+	reada_count = 0;
 	if (expected_level == -1)
 		expected_level = SB_TREE_HEIGHT (p_s_sb);
 	expected_level --;
@@ -784,11 +796,36 @@ int search_by_key (struct super_block * p_s_sb,
 	   position in the node. */
 	n_block_number = B_N_CHILD_NUM(p_s_bh, p_s_last_element->pe_position);
 
-#ifdef SEARCH_BY_KEY_READA
-	/* if we are going to read leaf node, then calculate its right neighbor if possible */
-	if (n_node_level == DISK_LEAF_NODE_LEVEL + 1 && p_s_last_element->pe_position < B_NR_ITEMS (p_s_bh))
-	    right_neighbor_of_leaf_node = B_N_CHILD_NUM(p_s_bh, p_s_last_element->pe_position + 1);
-#endif
+	/* if we are going to read leaf nodes, try for read ahead as well */
+	if ((p_s_search_path->reada & PATH_READA) &&
+	    n_node_level == DISK_LEAF_NODE_LEVEL + 1)
+	{
+	    int pos = p_s_last_element->pe_position;
+	    int limit = B_NR_ITEMS(p_s_bh);
+	    struct key *le_key;
+
+	    if (p_s_search_path->reada & PATH_READA_BACK)
+		limit = 0;
+	    while(reada_count < SEARCH_BY_KEY_READA) {
+		if (pos == limit)
+		    break;
+	        reada_blocks[reada_count++] = B_N_CHILD_NUM(p_s_bh, pos);
+		if (p_s_search_path->reada & PATH_READA_BACK)
+		    pos--;
+		else
+		    pos++;
+
+		/*
+		 * check to make sure we're in the same object
+		 */
+		le_key = B_N_PDELIM_KEY(p_s_bh, pos);
+		if (le32_to_cpu(le_key->k_objectid) !=
+		    p_s_key->on_disk_key.k_objectid)
+		{
+		    break;
+		}
+	    }
+        }
     }
 }
 
@@ -1269,7 +1306,7 @@ int reiserfs_delete_item (struct reiserfs_transaction_handle *th,
 	copy_item_head(&s_ih, PATH_PITEM_HEAD(p_s_path));
 	s_del_balance.insert_size[0] = n_del_size;
 
-	n_ret_value = fix_nodes(M_DELETE, &s_del_balance, NULL, 0);
+	n_ret_value = fix_nodes(M_DELETE, &s_del_balance, NULL, NULL);
 	if ( n_ret_value != REPEAT_SEARCH )
 	    break;
 
@@ -1409,14 +1446,14 @@ void reiserfs_delete_solid_item (struct reiserfs_transaction_handle *th,
 	}
 	quota_cut_bytes = ih_item_len(PATH_PITEM_HEAD(&path)) ;
 
-	retval = fix_nodes (M_DELETE, &tb, NULL, 0);
+	retval = fix_nodes (M_DELETE, &tb, NULL, NULL);
 	if (retval == REPEAT_SEARCH) {
 	    PROC_INFO_INC( th -> t_super, delete_solid_item_restarted );
 	    continue;
 	}
 
 	if (retval == CARRY_ON) {
-	    do_balance (&tb, 0, 0, M_DELETE);
+	    do_balance (&tb, NULL, NULL, M_DELETE);
 	    if (inode) {	/* Should we count quota for item? (we don't count quotas for save-links) */
 #ifdef REISERQUOTA_DEBUG
 		reiserfs_debug (th->t_super, "reiserquota delete_solid_item(): freeing %u id=%u type=%c", quota_cut_bytes, inode->i_uid, key2type(key));
@@ -1458,6 +1495,41 @@ void reiserfs_delete_object (struct reiserfs_transaction_handle *th, struct inod
     reiserfs_delete_solid_item (th, inode, INODE_PKEY (inode));
 }
 
+static void
+unmap_buffers(struct page *page, loff_t pos) {
+    struct buffer_head *bh ;
+    struct buffer_head *head ;
+    struct buffer_head *next ;
+    unsigned long tail_index ;
+    unsigned long cur_index ;
+
+    if (page) {
+	if (page_has_buffers(page)) {
+	    tail_index = pos & (PAGE_CACHE_SIZE - 1) ;
+	    cur_index = 0 ;
+	    head = page_buffers(page) ;
+	    bh = head ;
+	    do {
+		next = bh->b_this_page ;
+
+		/* we want to unmap the buffers that contain the tail, and
+		** all the buffers after it (since the tail must be at the
+		** end of the file).  We don't want to unmap file data
+		** before the tail, since it might be dirty and waiting to
+		** reach disk
+		*/
+		cur_index += bh->b_size ;
+		if (cur_index > tail_index) {
+		    reiserfs_unmap_buffer(bh) ;
+		}
+		bh = next ;
+	    } while (bh != head) ;
+	    if ( PAGE_SIZE == bh->b_size ) {
+		clear_page_dirty(page);
+	    }
+	}
+    }
+}
 
 static int maybe_indirect_to_direct (struct reiserfs_transaction_handle *th, 
 			      struct inode * p_s_inode,
@@ -1515,7 +1587,7 @@ static void indirect_to_direct_roll_back (struct reiserfs_transaction_handle *th
 	        "vs-5616: appended bytes found");
 	PATH_LAST_POSITION (path) --;
 	
-	removed = reiserfs_delete_item (th, path, &tail_key, inode, 0/*unbh not needed*/);
+	removed = reiserfs_delete_item (th, path, &tail_key, inode, NULL/*unbh not needed*/);
 	RFALSE( removed <= 0 || removed > tail_len,
 	        "vs-5617: there was tail %d bytes, removed item length %d bytes",
                 tail_len, removed);
@@ -1550,7 +1622,7 @@ int reiserfs_cut_from_item (struct reiserfs_transaction_handle *th,
     char                c_mode;            /* Mode of the balance. */
     int retval2 = -1;
     int quota_cut_bytes;
-    
+    loff_t tail_pos = 0;
     
     init_tb_struct(th, &s_cut_balance, p_s_inode->i_sb, p_s_path, n_cut_size);
 
@@ -1590,6 +1662,7 @@ int reiserfs_cut_from_item (struct reiserfs_transaction_handle *th,
       	    set_cpu_key_k_type (p_s_item_key, TYPE_INDIRECT);
 	    p_s_item_key->key_length = 4;
 	    n_new_file_size -= (n_new_file_size & (p_s_sb->s_blocksize - 1));
+	    tail_pos = n_new_file_size;
 	    set_cpu_key_k_offset (p_s_item_key, n_new_file_size + 1);
 	    if ( search_for_position_by_key(p_s_sb, p_s_item_key, p_s_path) == POSITION_NOT_FOUND ){
 		print_block (PATH_PLAST_BUFFER (p_s_path), 3, PATH_LAST_POSITION (p_s_path) - 1, PATH_LAST_POSITION (p_s_path) + 1);
@@ -1604,7 +1677,7 @@ int reiserfs_cut_from_item (struct reiserfs_transaction_handle *th,
 
 	s_cut_balance.insert_size[0] = n_cut_size;
 	
-	n_ret_value = fix_nodes(c_mode, &s_cut_balance, NULL, 0);
+	n_ret_value = fix_nodes(c_mode, &s_cut_balance, NULL, NULL);
       	if ( n_ret_value != REPEAT_SEARCH )
 	    break;
 	
@@ -1687,9 +1760,10 @@ int reiserfs_cut_from_item (struct reiserfs_transaction_handle *th,
     if ( n_is_inode_locked ) {
 	/* we've done an indirect->direct conversion.  when the data block
 	** was freed, it was removed from the list of blocks that must
-	** be flushed before the transaction commits, so we don't need to
-	** deal with it here.
+	** be flushed before the transaction commits, make sure to
+	** unmap and invalidate it
 	*/
+	unmap_buffers(page, tail_pos);
 	REISERFS_I(p_s_inode)->i_flags &= ~i_pack_on_close_mask ;
     }
 #ifdef REISERQUOTA_DEBUG
@@ -1778,6 +1852,12 @@ void reiserfs_do_truncate (struct reiserfs_transaction_handle *th,
            space, this file would have this file size */
 	n_file_size = offset + bytes - 1;
     }
+    /*
+     * are we doing a full truncate or delete, if so
+     * kick in the reada code
+     */
+    if (n_new_file_size == 0)
+        s_search_path.reada = PATH_READA | PATH_READA_BACK;
 
     if ( n_file_size == 0 || n_file_size < n_new_file_size ) {
 	goto update_and_out ;
@@ -1855,7 +1935,7 @@ static void check_research_for_paste (struct path * path,
 	if (le_ih_k_offset (found_ih) + op_bytes_number (found_ih, get_last_bh (path)->b_size) !=
 	    cpu_key_k_offset (p_s_key) ||
 	    op_bytes_number (found_ih, get_last_bh (path)->b_size) != pos_in_item (path))
-	    reiserfs_panic (0, "PAP-5720: check_research_for_paste: "
+	    reiserfs_panic (NULL, "PAP-5720: check_research_for_paste: "
 			    "found direct item %h or position (%d) does not match to key %K",
 			    found_ih, pos_in_item (path), p_s_key);
     }
@@ -1863,7 +1943,7 @@ static void check_research_for_paste (struct path * path,
 	if (le_ih_k_offset (found_ih) + op_bytes_number (found_ih, get_last_bh (path)->b_size) != cpu_key_k_offset (p_s_key) || 
 	    I_UNFM_NUM (found_ih) != pos_in_item (path) ||
 	    get_ih_free_space (found_ih) != 0)
-	    reiserfs_panic (0, "PAP-5730: check_research_for_paste: "
+	    reiserfs_panic (NULL, "PAP-5730: check_research_for_paste: "
 			    "found indirect item (%h) or position (%d) does not match to key (%K)",
 			    found_ih, pos_in_item (path), p_s_key);
     }
diff --git a/fs/reiserfs/super.c b/fs/reiserfs/super.c
index 50e5aaf05..71eaa0651 100644
--- a/fs/reiserfs/super.c
+++ b/fs/reiserfs/super.c
@@ -492,7 +492,6 @@ static void reiserfs_clear_inode (struct inode *inode)
     REISERFS_I(inode)->i_acl_default = NULL;
 }
 
-
 struct super_operations reiserfs_sops = 
 {
   .alloc_inode = reiserfs_alloc_inode,
@@ -651,7 +650,7 @@ static int reiserfs_getopt ( struct super_block * s, char ** cur, opt_desc_t * o
 	reiserfs_warning (s, "head of option \"%s\" is only correct", opt->option_name);
 	return -1;
     }
-	
+
     /* move to the argument, or to next option if argument is not required */
     p ++;
     
@@ -696,29 +695,30 @@ static int reiserfs_parse_options (struct super_block * s, char * options, /* st
     char * arg = NULL;
     char * pos;
     opt_desc_t opts[] = {
-	{"tails", 't', tails, 0, 0}, /* Compatibility stuff, so that -o notail for old setups still work */
-	{"notail", 0, 0, 0,  (1<<REISERFS_LARGETAIL)|(1<<REISERFS_SMALLTAIL)},
-	{"conv", 0, 0, 1<<REISERFS_CONVERT, 0},
-	{"attrs", 0, 0, 1<<REISERFS_ATTRS, 0},
-	{"noattrs", 0, 0, 0, 1<<REISERFS_ATTRS},
-	{"user_xattr", 0, 0, 1<<REISERFS_XATTRS_USER, 0},
-	{"nouser_xattr", 0, 0, 0, 1<<REISERFS_XATTRS_USER},
+	/* Compatibility stuff, so that -o notail for old setups still work */
+	{"tails",	.arg_required = 't', .values = tails},
+	{"notail",	.clrmask = (1<<REISERFS_LARGETAIL)|(1<<REISERFS_SMALLTAIL)},
+	{"conv",	.setmask = 1<<REISERFS_CONVERT},
+	{"attrs",	.setmask = 1<<REISERFS_ATTRS},
+	{"noattrs",	.clrmask = 1<<REISERFS_ATTRS},
+	{"user_xattr",	.setmask = 1<<REISERFS_XATTRS_USER},
+	{"nouser_xattr",.clrmask = 1<<REISERFS_XATTRS_USER},
+	{"tagxid",	.setmask = 1<<REISERFS_TAGXID},
 #ifdef CONFIG_REISERFS_FS_POSIX_ACL
-	{"acl", 0, 0, 1<<REISERFS_POSIXACL, 0},
-	{"noacl", 0, 0, 0, 1<<REISERFS_POSIXACL},
+	{"acl",		.setmask = 1<<REISERFS_POSIXACL},
+	{"noacl",	.clrmask = 1<<REISERFS_POSIXACL},
 #endif
-	{"nolog", 0, 0, 0, 0}, /* This is unsupported */
-	{"replayonly", 0, 0, 1<<REPLAYONLY, 0},
-	{"block-allocator", 'a', balloc, 0, 0},
-	{"data", 'd', logging_mode, 0, 0},
-	{"resize", 'r', 0, 0, 0},
-	{"jdev", 'j', 0, 0, 0},
-	{"nolargeio", 'w', 0, 0, 0},
-	{"commit", 'c', 0, 0, 0},
-	{"usrquota", 0, 0, 0, 0},
-	{"grpquota", 0, 0, 0, 0},
-	{"tagxid", 0, 0, 1<<REISERFS_TAGXID, 0},
-	{NULL, 0, 0, 0, 0}
+	{"nolog",},	 /* This is unsupported */
+	{"replayonly",	.setmask = 1<<REPLAYONLY},
+	{"block-allocator", .arg_required = 'a', .values = balloc},
+	{"data",	.arg_required = 'd', .values = logging_mode},
+	{"resize",	.arg_required = 'r', .values = NULL},
+	{"jdev",	.arg_required = 'j', .values = NULL},
+	{"nolargeio",	.arg_required = 'w', .values = NULL},
+	{"commit",	.arg_required = 'c', .values = NULL},
+	{"usrquota",},
+	{"grpquota",},
+	{NULL,}
     };
 	
     *blocks = 0;
@@ -736,7 +736,7 @@ static int reiserfs_parse_options (struct super_block * s, char * options, /* st
 	if (c == 'r') {
 	    char * p;
 	    
-	    p = 0;
+	    p = NULL;
 	    /* "resize=NNN" */
 	    *blocks = simple_strtoul (arg, &p, 0);
 	    if (*p != '\0') {
@@ -747,7 +747,7 @@ static int reiserfs_parse_options (struct super_block * s, char * options, /* st
 	}
 
 	if ( c == 'c' ) {
-		char *p = 0;
+		char *p = NULL;
 		unsigned long val = simple_strtoul (arg, &p, 0);
 		/* commit=NNN (time in seconds) */
 		if ( *p != '\0' || val >= (unsigned int)-1) {
@@ -757,7 +757,7 @@ static int reiserfs_parse_options (struct super_block * s, char * options, /* st
 	}
 
 	if ( c == 'w' ) {
-		char *p=0;
+		char *p=NULL;
 		int val = simple_strtoul (arg, &p, 0);
 
 		if ( *p != '\0') {
@@ -1346,15 +1346,17 @@ static int reiserfs_fill_super (struct super_block * s, void * data, int silent)
     memset (sbi, 0, sizeof (struct reiserfs_sb_info));
     /* Set default values for options: non-aggressive tails */
     REISERFS_SB(s)->s_mount_opt = ( 1 << REISERFS_SMALLTAIL );
-    /* default block allocator option: skip_busy */
-    REISERFS_SB(s)->s_alloc_options.bits = ( 1 << 5);
-    /* If file grew past 4 blocks, start preallocation blocks for it. */
-    REISERFS_SB(s)->s_alloc_options.preallocmin = 4;
+    /* no preallocation minimum, be smart in
+       reiserfs_file_write instead */
+    REISERFS_SB(s)->s_alloc_options.preallocmin = 0;
     /* Preallocate by 16 blocks (17-1) at once */
     REISERFS_SB(s)->s_alloc_options.preallocsize = 17;
     /* Initialize the rwsem for xattr dir */
     init_rwsem(&REISERFS_SB(s)->xattr_dir_sem);
 
+    /* setup default block allocator options */
+    reiserfs_init_alloc_options(s);
+
     jdev_name = NULL;
     if (reiserfs_parse_options (s, (char *) data, &(sbi->s_mount_opt), &blocks, &jdev_name, &commit_max_age) == 0) {
 	goto error;
diff --git a/fs/reiserfs/tail_conversion.c b/fs/reiserfs/tail_conversion.c
index 29e6a7ca8..0d8a6a611 100644
--- a/fs/reiserfs/tail_conversion.c
+++ b/fs/reiserfs/tail_conversion.c
@@ -162,42 +162,6 @@ void reiserfs_unmap_buffer(struct buffer_head *bh) {
     unlock_buffer(bh) ;
 }
 
-static void
-unmap_buffers(struct page *page, loff_t pos) {
-  struct buffer_head *bh ;
-  struct buffer_head *head ;
-  struct buffer_head *next ;
-  unsigned long tail_index ;
-  unsigned long cur_index ;
-
-  if (page) {
-    if (page_has_buffers(page)) {
-      tail_index = pos & (PAGE_CACHE_SIZE - 1) ;
-      cur_index = 0 ;
-      head = page_buffers(page) ;
-      bh = head ;
-      do {
-	next = bh->b_this_page ;
-
-        /* we want to unmap the buffers that contain the tail, and
-        ** all the buffers after it (since the tail must be at the
-        ** end of the file).  We don't want to unmap file data 
-        ** before the tail, since it might be dirty and waiting to 
-        ** reach disk
-        */
-        cur_index += bh->b_size ;
-        if (cur_index > tail_index) {
-          reiserfs_unmap_buffer(bh) ;
-        }
-	bh = next ;
-      } while (bh != head) ;
-      if ( PAGE_SIZE == bh->b_size ) {
-	clear_page_dirty(page);
-      }
-    }
-  } 
-}
-
 /* this first locks inode (neither reads nor sync are permitted),
    reads tail through page cache, insert direct item. When direct item
    inserted successfully inode is left locked. Return value is always
@@ -259,7 +223,7 @@ int indirect2direct (struct reiserfs_transaction_handle *th,
 
 
     /* Set direct item header to insert. */
-    make_le_item_head (&s_ih, 0, get_inode_item_key_version (p_s_inode), pos1 + 1,
+    make_le_item_head (&s_ih, NULL, get_inode_item_key_version (p_s_inode), pos1 + 1,
 		       TYPE_DIRECT, round_tail_len, 0xffff/*ih_free_space*/);
 
     /* we want a pointer to the first byte of the tail in the page.
@@ -287,11 +251,6 @@ int indirect2direct (struct reiserfs_transaction_handle *th,
     }
     kunmap(page) ;
 
-    /* this will invalidate all the buffers in the page after
-    ** pos1
-    */
-    unmap_buffers(page, pos1) ;
-
     /* make sure to get the i_blocks changes from reiserfs_insert_item */
     reiserfs_update_sd(th, p_s_inode);
 
diff --git a/fs/seq_file.c b/fs/seq_file.c
index 8bd7097f3..5a73e085f 100644
--- a/fs/seq_file.c
+++ b/fs/seq_file.c
@@ -35,6 +35,9 @@ int seq_open(struct file *file, struct seq_operations *op)
 	sema_init(&p->sem, 1);
 	p->op = op;
 	file->private_data = p;
+
+	/* SEQ files support lseek, but not pread/pwrite */
+	file->f_mode &= ~(FMODE_PREAD | FMODE_PWRITE);
 	return 0;
 }
 EXPORT_SYMBOL(seq_open);
@@ -54,9 +57,6 @@ ssize_t seq_read(struct file *file, char __user *buf, size_t size, loff_t *ppos)
 	void *p;
 	int err = 0;
 
-	if (ppos != &file->f_pos)
-		return -EPIPE;
-
 	down(&m->sem);
 	/* grab buffer if we didn't have one */
 	if (!m->buf) {
diff --git a/fs/smbfs/file.c b/fs/smbfs/file.c
index 12fc56cac..e97fc5807 100644
--- a/fs/smbfs/file.c
+++ b/fs/smbfs/file.c
@@ -261,7 +261,7 @@ out:
 
 static ssize_t
 smb_file_sendfile(struct file *file, loff_t *ppos,
-		  size_t count, read_actor_t actor, void __user *target)
+		  size_t count, read_actor_t actor, void *target)
 {
 	struct dentry *dentry = file->f_dentry;
 	ssize_t status;
@@ -271,7 +271,7 @@ smb_file_sendfile(struct file *file, loff_t *ppos,
 
 	status = smb_revalidate_inode(dentry);
 	if (status) {
-		PARANOIA("%s/%s validation failed, error=%zd\n",
+		PARANOIA("%s/%s validation failed, error=%Zd\n",
 			 DENTRY_PATH(dentry), status);
 		goto out;
 	}
diff --git a/fs/smbfs/inode.c b/fs/smbfs/inode.c
index 4d4b5f400..c8ca98ab2 100644
--- a/fs/smbfs/inode.c
+++ b/fs/smbfs/inode.c
@@ -521,6 +521,7 @@ int smb_fill_super(struct super_block *sb, void *raw_data, int silent)
 	server->super_block = sb;
 	server->mnt = NULL;
 	server->sock_file = NULL;
+	init_waitqueue_head(&server->conn_wq);
 	init_MUTEX(&server->sem);
 	INIT_LIST_HEAD(&server->entry);
 	INIT_LIST_HEAD(&server->xmitq);
diff --git a/fs/smbfs/proc.c b/fs/smbfs/proc.c
index 21c90222b..8096d7492 100644
--- a/fs/smbfs/proc.c
+++ b/fs/smbfs/proc.c
@@ -56,6 +56,7 @@ static struct smb_ops smb_ops_os2;
 static struct smb_ops smb_ops_win95;
 static struct smb_ops smb_ops_winNT;
 static struct smb_ops smb_ops_unix;
+static struct smb_ops smb_ops_null;
 
 static void
 smb_init_dirent(struct smb_sb_info *server, struct smb_fattr *fattr);
@@ -981,6 +982,9 @@ smb_newconn(struct smb_sb_info *server, struct smb_conn_opt *opt)
 	smbiod_wake_up();
 	if (server->opt.capabilities & SMB_CAP_UNIX)
 		smb_proc_query_cifsunix(server);
+
+	server->conn_complete++;
+	wake_up_interruptible_all(&server->conn_wq);
 	return error;
 
 out:
@@ -2305,16 +2309,14 @@ smb_proc_readdir_long(struct file *filp, void *dirent, filldir_t filldir,
 	 */
 	mask = param + 12;
 
-	mask_len = smb_encode_path(server, mask, SMB_MAXPATHLEN+1, dir, &star);
-	if (mask_len < 0) {
-		result = mask_len;
+	result = smb_encode_path(server, mask, SMB_MAXPATHLEN+1, dir, &star);
+	if (result <= 0)
 		goto out_free;
-	}
-	mask_len--;	/* mask_len is strlen, not #bytes */
+	mask_len = result - 1;	/* mask_len is strlen, not #bytes */
+	result = 0;
 	first = 1;
 	VERBOSE("starting mask_len=%d, mask=%s\n", mask_len, mask);
 
-	result = 0;
 	entries_seen = 2;
 	ff_eos = 0;
 
@@ -2370,7 +2372,7 @@ smb_proc_readdir_long(struct file *filp, void *dirent, filldir_t filldir,
 		if (req->rq_rcls != 0) {
 			result = smb_errno(req);
 			PARANOIA("name=%s, result=%d, rcls=%d, err=%d\n",
-				 mask, result, server->rcls, server->err);
+				 mask, result, req->rq_rcls, req->rq_err);
 			break;
 		}
 
@@ -2460,8 +2462,6 @@ smb_proc_readdir_long(struct file *filp, void *dirent, filldir_t filldir,
 			/*
 			 * Update the mask string for the next message.
 			 */
-			if (mask_len < 0)
-				mask_len = 0;
 			if (mask_len > 255)
 				mask_len = 255;
 			if (mask_len)
@@ -2526,7 +2526,7 @@ smb_proc_getattr_ff(struct smb_sb_info *server, struct dentry *dentry,
 	result = smb_add_request(req);
 	if (result < 0)
 		goto out_free;
-	if (server->rcls != 0) {
+	if (req->rq_rcls != 0) {
 		result = smb_errno(req);
 #ifdef SMBFS_PARANOIA
 		if (result != -ENOENT)
@@ -2639,7 +2639,7 @@ smb_proc_getattr_trans2(struct smb_sb_info *server, struct dentry *dir,
 	result = smb_add_request(req);
 	if (result < 0)
 		goto out;
-	if (server->rcls != 0) {
+	if (req->rq_rcls != 0) {
 		VERBOSE("for %s: result=%d, rcls=%d, err=%d\n",
 			&param[6], result, req->rq_rcls, req->rq_err);
 		result = smb_errno(req);
@@ -2793,11 +2793,46 @@ out:
 	return result;
 }
 
+static int
+smb_proc_ops_wait(struct smb_sb_info *server)
+{
+	int result;
+
+	result = wait_event_interruptible_timeout(server->conn_wq,
+				server->conn_complete, 30*HZ);
+
+	if (!result || signal_pending(current))
+		return -EIO;
+
+	return 0;
+}
+
 static int
 smb_proc_getattr_null(struct smb_sb_info *server, struct dentry *dir,
-		      struct smb_fattr *attr)
+			  struct smb_fattr *fattr)
 {
-	return -EIO;
+	int result;
+
+	if (smb_proc_ops_wait(server) < 0)
+		return -EIO;
+
+	smb_init_dirent(server, fattr);
+	result = server->ops->getattr(server, dir, fattr);
+	smb_finish_dirent(server, fattr);
+
+	return result;
+}
+
+static int
+smb_proc_readdir_null(struct file *filp, void *dirent, filldir_t filldir,
+		      struct smb_cache_control *ctl)
+{
+	struct smb_sb_info *server = server_from_dentry(filp->f_dentry);
+
+	if (smb_proc_ops_wait(server) < 0)
+		return -EIO;
+
+	return server->ops->readdir(filp, dirent, filldir, ctl);
 }
 
 int
@@ -3218,7 +3253,7 @@ smb_proc_read_link(struct smb_sb_info *server, struct dentry *d,
 	if (result < 0)
 		goto out_free;
 	DEBUG1("for %s: result=%d, rcls=%d, err=%d\n",
-		&param[6], result, server->rcls, server->err);
+		&param[6], result, req->rq_rcls, req->rq_err);
 
 	/* copy data up to the \0 or buffer length */
 	result = len;
@@ -3268,7 +3303,7 @@ smb_proc_symlink(struct smb_sb_info *server, struct dentry *d,
 		goto out_free;
 
 	DEBUG1("for %s: result=%d, rcls=%d, err=%d\n",
-		&param[6], result, server->rcls, server->err);
+		&param[6], result, req->rq_rcls, req->rq_err);
 	result = 0;
 
 out_free:
@@ -3315,7 +3350,7 @@ smb_proc_link(struct smb_sb_info *server, struct dentry *dentry,
 		goto out_free;
 
 	DEBUG1("for %s: result=%d, rcls=%d, err=%d\n",
-	       &param[6], result, server->rcls, server->err);
+	       &param[6], result, req->rq_rcls, req->rq_err);
 	result = 0;
 
 out_free:
@@ -3431,6 +3466,7 @@ static struct smb_ops smb_ops_unix =
 /* Place holder until real ops are in place */
 static struct smb_ops smb_ops_null =
 {
+	.readdir	= smb_proc_readdir_null,
 	.getattr	= smb_proc_getattr_null,
 };
 
diff --git a/fs/smbfs/proto.h b/fs/smbfs/proto.h
index 7266ff5f3..e8946c455 100644
--- a/fs/smbfs/proto.h
+++ b/fs/smbfs/proto.h
@@ -87,7 +87,5 @@ extern int smb_request_send_req(struct smb_request *req);
 extern int smb_request_send_server(struct smb_sb_info *server);
 extern int smb_request_recv(struct smb_sb_info *server);
 /* symlink.c */
-extern int smb_read_link(struct dentry *dentry, char *buffer, int len);
 extern int smb_symlink(struct inode *inode, struct dentry *dentry, const char *oldname);
-extern int smb_follow_link(struct dentry *dentry, struct nameidata *nd);
 extern struct inode_operations smb_link_inode_operations;
diff --git a/fs/smbfs/request.h b/fs/smbfs/request.h
index 137d79a43..efb21451e 100644
--- a/fs/smbfs/request.h
+++ b/fs/smbfs/request.h
@@ -34,7 +34,7 @@ struct smb_request {
 	int rq_bytes_sent;
 
 	int rq_iovlen;
-	struct iovec rq_iov[4];
+	struct kvec rq_iov[4];
 
 	int (*rq_setup_read) (struct smb_request *);
 	void (*rq_callback) (struct smb_request *);
diff --git a/fs/smbfs/smbiod.c b/fs/smbfs/smbiod.c
index 6d8b28756..0dd22bc4c 100644
--- a/fs/smbfs/smbiod.c
+++ b/fs/smbfs/smbiod.c
@@ -65,7 +65,7 @@ void smbiod_wake_up(void)
 /*
  * start smbiod if none is running
  */
-static int smbiod_start()
+static int smbiod_start(void)
 {
 	pid_t pid;
 	if (smbiod_state != SMBIOD_DEAD)
diff --git a/fs/smbfs/sock.c b/fs/smbfs/sock.c
index 74d6a3e27..93f3cd22a 100644
--- a/fs/smbfs/sock.c
+++ b/fs/smbfs/sock.c
@@ -38,27 +38,10 @@
 static int
 _recvfrom(struct socket *socket, unsigned char *ubuf, int size, unsigned flags)
 {
-	struct iovec iov;
-	struct msghdr msg;
-	mm_segment_t fs;
-
-	fs = get_fs();
-	set_fs(get_ds());
-	flags |= MSG_DONTWAIT | MSG_NOSIGNAL;
-
-	msg.msg_flags = flags;
-	msg.msg_name = NULL;
-	msg.msg_namelen = 0;
-	msg.msg_iov = &iov;
-	msg.msg_iovlen = 1;
-	msg.msg_control = NULL;
-	iov.iov_base = ubuf;
-	iov.iov_len = size;
-
-	size = sock_recvmsg(socket, &msg, size, flags);
-
-	set_fs(fs);
-	return size;
+	struct kvec iov = {ubuf, size};
+	struct msghdr msg = {.msg_flags = flags};
+	msg.msg_flags |= MSG_DONTWAIT | MSG_NOSIGNAL;
+	return kernel_recvmsg(socket, &msg, &iov, 1, size, msg.msg_flags);
 }
 
 /*
@@ -171,42 +154,42 @@ smb_recv_available(struct smb_sb_info *server)
 }
 
 /*
- * Adjust the iovec to move on 'n' bytes (from nfs/sunrpc)
+ * Adjust the kvec to move on 'n' bytes (from nfs/sunrpc)
  */
 static int
-smb_move_iov(struct msghdr *msg, struct iovec *niv, unsigned amount)
+smb_move_iov(struct kvec **data, size_t *num, struct kvec *vec, unsigned amount)
 {
-	struct iovec *iv = msg->msg_iov;
+	struct kvec *iv = *data;
 	int i;
 	int len;
 
 	/*
-	 *	Eat any sent iovecs
+	 *	Eat any sent kvecs
 	 */
 	while (iv->iov_len <= amount) {
 		amount -= iv->iov_len;
 		iv++;
-		msg->msg_iovlen--;
+		(*num)--;
 	}
 
 	/*
 	 *	And chew down the partial one
 	 */
-	niv[0].iov_len = iv->iov_len-amount;
-	niv[0].iov_base =((unsigned char *)iv->iov_base)+amount;
+	vec[0].iov_len = iv->iov_len-amount;
+	vec[0].iov_base =((unsigned char *)iv->iov_base)+amount;
 	iv++;
 
-	len = niv[0].iov_len;
+	len = vec[0].iov_len;
 
 	/*
 	 *	And copy any others
 	 */
-	for (i = 1; i < msg->msg_iovlen; i++) {
-		niv[i] = *iv++;
-		len += niv[i].iov_len;
+	for (i = 1; i < *num; i++) {
+		vec[i] = *iv++;
+		len += vec[i].iov_len;
 	}
 
-	msg->msg_iov = niv;
+	*data = vec;
 	return len;
 }
 
@@ -280,37 +263,29 @@ smb_receive_drop(struct smb_sb_info *server)
 {
 	struct socket *sock;
 	unsigned int flags;
-	struct iovec iov;
+	struct kvec iov;
 	struct msghdr msg;
-	mm_segment_t fs;
 	int rlen = smb_len(server->header) - server->smb_read + 4;
 	int result = -EIO;
 
+	if (rlen > PAGE_SIZE)
+		rlen = PAGE_SIZE;
+
 	sock = server_sock(server);
 	if (!sock)
 		goto out;
 	if (sock->sk->sk_state != TCP_ESTABLISHED)
 		goto out;
 
-	fs = get_fs();
-	set_fs(get_ds());
-
 	flags = MSG_DONTWAIT | MSG_NOSIGNAL;
 	iov.iov_base = drop_buffer;
 	iov.iov_len = PAGE_SIZE;
 	msg.msg_flags = flags;
 	msg.msg_name = NULL;
 	msg.msg_namelen = 0;
-	msg.msg_iov = &iov;
-	msg.msg_iovlen = 1;
 	msg.msg_control = NULL;
 
-	if (rlen > PAGE_SIZE)
-		rlen = PAGE_SIZE;
-
-	result = sock_recvmsg(sock, &msg, rlen, flags);
-
-	set_fs(fs);
+	result = kernel_recvmsg(sock, &msg, &iov, 1, rlen, flags);
 
 	VERBOSE("read: %d\n", result);
 	if (result < 0) {
@@ -335,9 +310,10 @@ smb_receive(struct smb_sb_info *server, struct smb_request *req)
 {
 	struct socket *sock;
 	unsigned int flags;
-	struct iovec iov[4];
+	struct kvec iov[4];
+	struct kvec *p = req->rq_iov;
+	size_t num = req->rq_iovlen;
 	struct msghdr msg;
-	mm_segment_t fs;
 	int rlen;
 	int result = -EIO;
 
@@ -347,25 +323,18 @@ smb_receive(struct smb_sb_info *server, struct smb_request *req)
 	if (sock->sk->sk_state != TCP_ESTABLISHED)
 		goto out;
 
-	fs = get_fs();
-	set_fs(get_ds());
-
 	flags = MSG_DONTWAIT | MSG_NOSIGNAL;
 	msg.msg_flags = flags;
 	msg.msg_name = NULL;
 	msg.msg_namelen = 0;
-	msg.msg_iov = req->rq_iov;
-	msg.msg_iovlen = req->rq_iovlen;
 	msg.msg_control = NULL;
 
 	/* Dont repeat bytes and count available bufferspace */
-	rlen = smb_move_iov(&msg, iov, req->rq_bytes_recvd);
+	rlen = smb_move_iov(&p, &num, iov, req->rq_bytes_recvd);
 	if (req->rq_rlen < rlen)
 		rlen = req->rq_rlen;
 
-	result = sock_recvmsg(sock, &msg, rlen, flags);
-
-	set_fs(fs);
+	result = kernel_recvmsg(sock, &msg, p, num, rlen, flags);
 
 	VERBOSE("read: %d\n", result);
 	if (result < 0) {
@@ -388,13 +357,14 @@ out:
 int
 smb_send_request(struct smb_request *req)
 {
-	mm_segment_t fs;
 	struct smb_sb_info *server = req->rq_server;
 	struct socket *sock;
-	struct msghdr msg;
+	struct msghdr msg = {.msg_flags = MSG_NOSIGNAL | MSG_DONTWAIT};
         int slen = req->rq_slen - req->rq_bytes_sent;
 	int result = -EIO;
-	struct iovec iov[4];
+	struct kvec iov[4];
+	struct kvec *p = req->rq_iov;
+	size_t num = req->rq_iovlen;
 
 	sock = server_sock(server);
 	if (!sock)
@@ -402,22 +372,11 @@ smb_send_request(struct smb_request *req)
 	if (sock->sk->sk_state != TCP_ESTABLISHED)
 		goto out;
 
-	msg.msg_name = NULL;
-	msg.msg_namelen = 0;
-	msg.msg_control = NULL;
-	msg.msg_controllen = 0;
-	msg.msg_iov = req->rq_iov;
-	msg.msg_iovlen = req->rq_iovlen;
-	msg.msg_flags = MSG_NOSIGNAL | MSG_DONTWAIT;
-
 	/* Dont repeat bytes */
 	if (req->rq_bytes_sent)
-		smb_move_iov(&msg, iov, req->rq_bytes_sent);
+		smb_move_iov(&p, &num, iov, req->rq_bytes_sent);
 
-	fs = get_fs();
-	set_fs(get_ds());
-	result = sock_sendmsg(sock, &msg, slen);
-	set_fs(fs);
+	result = kernel_sendmsg(sock, &msg, p, num, slen);
 
 	if (result >= 0) {
 		req->rq_bytes_sent += result;
diff --git a/fs/smbfs/symlink.c b/fs/smbfs/symlink.c
index 44d6f58b0..8b069e064 100644
--- a/fs/smbfs/symlink.c
+++ b/fs/smbfs/symlink.c
@@ -16,6 +16,7 @@
 #include <linux/pagemap.h>
 #include <linux/smp_lock.h>
 #include <linux/net.h>
+#include <linux/namei.h>
 
 #include <asm/uaccess.h>
 #include <asm/system.h>
@@ -26,19 +27,6 @@
 #include "smb_debug.h"
 #include "proto.h"
 
-int smb_read_link(struct dentry *dentry, char *buffer, int len)
-{
-	char link[256];		/* FIXME: pain ... */
-	int r;
-	DEBUG1("read link buffer len = %d\n", len);
-
-	r = smb_proc_read_link(server_from_dentry(dentry), dentry, link,
-			       sizeof(link) - 1);
-	if (r < 0)
-		return -ENOENT;
-	return vfs_readlink(dentry, buffer, len, link);
-}
-
 int smb_symlink(struct inode *inode, struct dentry *dentry, const char *oldname)
 {
 	DEBUG1("create symlink %s -> %s/%s\n", oldname, DENTRY_PATH(dentry));
@@ -46,24 +34,37 @@ int smb_symlink(struct inode *inode, struct dentry *dentry, const char *oldname)
 	return smb_proc_symlink(server_from_dentry(dentry), dentry, oldname);
 }
 
-int smb_follow_link(struct dentry *dentry, struct nameidata *nd)
+static int smb_follow_link(struct dentry *dentry, struct nameidata *nd)
 {
-	char link[256];		/* FIXME: pain ... */
-	int len;
+	char *link = __getname();
 	DEBUG1("followlink of %s/%s\n", DENTRY_PATH(dentry));
 
-	len = smb_proc_read_link(server_from_dentry(dentry), dentry, link,
-				 sizeof(link) - 1);
-	if(len < 0)
-		return -ENOENT;
-
-	link[len] = 0;
-	return vfs_follow_link(nd, link);
+	if (!link) {
+		link = ERR_PTR(-ENOMEM);
+	} else {
+		int len = smb_proc_read_link(server_from_dentry(dentry),
+						dentry, link, PATH_MAX - 1);
+		if (len < 0) {
+			putname(link);
+			link = ERR_PTR(len);
+		} else {
+			link[len] = 0;
+		}
+	}
+	nd_set_link(nd, link);
+	return 0;
 }
 
+static void smb_put_link(struct dentry *dentry, struct nameidata *nd)
+{
+	char *s = nd_get_link(nd);
+	if (!IS_ERR(s))
+		putname(s);
+}
 
 struct inode_operations smb_link_inode_operations =
 {
-	.readlink	= smb_read_link,
+	.readlink	= generic_readlink,
 	.follow_link	= smb_follow_link,
+	.put_link	= smb_put_link,
 };
diff --git a/fs/super.c b/fs/super.c
index 8d9bff178..37b76d7cf 100644
--- a/fs/super.c
+++ b/fs/super.c
@@ -35,6 +35,8 @@
 #include <linux/vfs.h>
 #include <linux/writeback.h>		/* for the emergency remount stuff */
 #include <linux/idr.h>
+#include <linux/devpts_fs.h>
+#include <linux/proc_fs.h>
 #include <asm/uaccess.h>
 
 
@@ -569,14 +571,19 @@ static spinlock_t unnamed_dev_lock = SPIN_LOCK_UNLOCKED;/* protects the above */
 int set_anon_super(struct super_block *s, void *data)
 {
 	int dev;
+	int error;
 
-	spin_lock(&unnamed_dev_lock);
-	if (idr_pre_get(&unnamed_dev_idr, GFP_ATOMIC) == 0) {
-		spin_unlock(&unnamed_dev_lock);
+ retry:
+	if (idr_pre_get(&unnamed_dev_idr, GFP_ATOMIC) == 0)
 		return -ENOMEM;
-	}
-	dev = idr_get_new(&unnamed_dev_idr, NULL);
+	spin_lock(&unnamed_dev_lock);
+	error = idr_get_new(&unnamed_dev_idr, NULL, &dev);
 	spin_unlock(&unnamed_dev_lock);
+	if (error == -EAGAIN)
+		/* We raced and lost with another CPU. */
+		goto retry;
+	else if (error)
+		return -EAGAIN;
 
 	if ((dev & MAX_ID_MASK) == (1 << MINORBITS)) {
 		spin_lock(&unnamed_dev_lock);
@@ -781,6 +788,13 @@ do_kern_mount(const char *fstype, int flags, const char *name, void *data)
 	sb = type->get_sb(type, flags, name, data);
 	if (IS_ERR(sb))
 		goto out_free_secdata;
+
+	error = -EPERM;
+	if (!capable(CAP_SYS_ADMIN) && !sb->s_bdev &&
+		(sb->s_magic != PROC_SUPER_MAGIC) &&
+		(sb->s_magic != DEVPTS_SUPER_MAGIC))
+		goto out_sb;
+
  	error = security_sb_kern_mount(sb, secdata);
  	if (error)
  		goto out_sb;
@@ -788,6 +802,7 @@ do_kern_mount(const char *fstype, int flags, const char *name, void *data)
 	mnt->mnt_root = dget(sb->s_root);
 	mnt->mnt_mountpoint = sb->s_root;
 	mnt->mnt_parent = mnt;
+	mnt->mnt_namespace = current->namespace;
 	up_write(&sb->s_umount);
 	put_filesystem(type);
 	return mnt;
@@ -804,6 +819,8 @@ out:
 	return (struct vfsmount *)sb;
 }
 
+EXPORT_SYMBOL_GPL(do_kern_mount);
+
 struct vfsmount *kern_mount(struct file_system_type *type)
 {
 	return do_kern_mount(type->name, 0, type->name, NULL);
diff --git a/fs/sysfs/file.c b/fs/sysfs/file.c
index 72cd7076c..159d99f06 100644
--- a/fs/sysfs/file.c
+++ b/fs/sysfs/file.c
@@ -89,7 +89,7 @@ static int fill_read_buffer(struct file * file, struct sysfs_buffer * buffer)
 		return -ENOMEM;
 
 	count = ops->show(kobj,attr,buffer->page);
-	BUG_ON(count > PAGE_SIZE);
+	BUG_ON(count > (ssize_t)PAGE_SIZE);
 	if (count >= 0)
 		buffer->count = count;
 	else
diff --git a/fs/sysfs/inode.c b/fs/sysfs/inode.c
index ac5c0b962..d0030a4b1 100644
--- a/fs/sysfs/inode.c
+++ b/fs/sysfs/inode.c
@@ -46,8 +46,13 @@ int sysfs_create(struct dentry * dentry, int mode, int (*init)(struct inode *))
 	struct inode * inode = NULL;
 	if (dentry) {
 		if (!dentry->d_inode) {
-			if ((inode = sysfs_new_inode(mode)))
+			if ((inode = sysfs_new_inode(mode))) {
+				if (dentry->d_parent && dentry->d_parent->d_inode) {
+					struct inode *p_inode = dentry->d_parent->d_inode;
+					p_inode->i_mtime = p_inode->i_ctime = CURRENT_TIME;
+				}
 				goto Proceed;
+			}
 			else 
 				error = -ENOMEM;
 		} else
diff --git a/fs/sysfs/mount.c b/fs/sysfs/mount.c
index c3e5dbe17..823813ce0 100644
--- a/fs/sysfs/mount.c
+++ b/fs/sysfs/mount.c
@@ -11,8 +11,6 @@
 
 #include "sysfs.h"
 
-/* Random magic number */
-#define SYSFS_MAGIC 0x62656572
 
 struct vfsmount *sysfs_mount;
 struct super_block * sysfs_sb = NULL;
@@ -29,7 +27,7 @@ static int sysfs_fill_super(struct super_block *sb, void *data, int silent)
 
 	sb->s_blocksize = PAGE_CACHE_SIZE;
 	sb->s_blocksize_bits = PAGE_CACHE_SHIFT;
-	sb->s_magic = SYSFS_MAGIC;
+	sb->s_magic = SYSFS_SUPER_MAGIC;
 	sb->s_op = &sysfs_ops;
 	sysfs_sb = sb;
 
diff --git a/fs/sysv/inode.c b/fs/sysv/inode.c
index 379d42408..2be44b7a9 100644
--- a/fs/sysv/inode.c
+++ b/fs/sysv/inode.c
@@ -142,8 +142,9 @@ static inline void write3byte(struct sysv_sb_info *sbi,
 }
 
 static struct inode_operations sysv_symlink_inode_operations = {
-	.readlink	= page_readlink,
-	.follow_link	= page_follow_link,
+	.readlink	= generic_readlink,
+	.follow_link	= page_follow_link_light,
+	.put_link	= page_put_link,
 	.getattr	= sysv_getattr,
 };
 
@@ -232,12 +233,12 @@ static struct buffer_head * sysv_update_inode(struct inode * inode)
 	if (!ino || ino > sbi->s_ninodes) {
 		printk("Bad inode number on dev %s: %d is out of range\n",
 		       inode->i_sb->s_id, ino);
-		return 0;
+		return NULL;
 	}
 	raw_inode = sysv_raw_inode(sb, ino, &bh);
 	if (!raw_inode) {
 		printk("unable to read i-node block\n");
-		return 0;
+		return NULL;
 	}
 
 	raw_inode->i_mode = cpu_to_fs16(sbi, inode->i_mode);
diff --git a/fs/sysv/itree.c b/fs/sysv/itree.c
index 60b405067..490188b38 100644
--- a/fs/sysv/itree.c
+++ b/fs/sysv/itree.c
@@ -81,6 +81,9 @@ static inline u32 *block_end(struct buffer_head *bh)
 	return (u32*)((char*)bh->b_data + bh->b_size);
 }
 
+/*
+ * Requires read_lock(&pointers_lock) or write_lock(&pointers_lock)
+ */
 static Indirect *get_branch(struct inode *inode,
 			    int depth,
 			    int offsets[],
@@ -100,18 +103,15 @@ static Indirect *get_branch(struct inode *inode,
 		bh = sb_bread(sb, block);
 		if (!bh)
 			goto failure;
-		read_lock(&pointers_lock);
 		if (!verify_chain(chain, p))
 			goto changed;
 		add_chain(++p, bh, (u32*)bh->b_data + *++offsets);
-		read_unlock(&pointers_lock);
 		if (!p->key)
 			goto no_block;
 	}
 	return NULL;
 
 changed:
-	read_unlock(&pointers_lock);
 	brelse(bh);
 	*err = -EAGAIN;
 	goto no_block;
@@ -213,7 +213,9 @@ static int get_block(struct inode *inode, sector_t iblock, struct buffer_head *b
 		goto out;
 
 reread:
+	read_lock(&pointers_lock);
 	partial = get_branch(inode, depth, offsets, chain, &err);
+	read_unlock(&pointers_lock);
 
 	/* Simplest case - block found, no allocation needed */
 	if (!partial) {
diff --git a/fs/sysv/symlink.c b/fs/sysv/symlink.c
index 97ea76137..ed637db2d 100644
--- a/fs/sysv/symlink.c
+++ b/fs/sysv/symlink.c
@@ -6,20 +6,15 @@
  */
 
 #include "sysv.h"
-
-static int sysv_readlink(struct dentry *dentry, char *buffer, int buflen)
-{
-	char *s = (char *)SYSV_I(dentry->d_inode)->i_data;
-	return vfs_readlink(dentry, buffer, buflen, s);
-}
+#include <linux/namei.h>
 
 static int sysv_follow_link(struct dentry *dentry, struct nameidata *nd)
 {
-	char *s = (char *)SYSV_I(dentry->d_inode)->i_data;
-	return vfs_follow_link(nd, s);
+	nd_set_link(nd, (char *)SYSV_I(dentry->d_inode)->i_data);
+	return 0;
 }
 
 struct inode_operations sysv_fast_symlink_inode_operations = {
-	.readlink	= sysv_readlink,
+	.readlink	= generic_readlink,
 	.follow_link	= sysv_follow_link,
 };
diff --git a/fs/udf/crc.c b/fs/udf/crc.c
index 1dc900e7a..d95c6e38a 100644
--- a/fs/udf/crc.c
+++ b/fs/udf/crc.c
@@ -84,7 +84,7 @@ static uint16_t crc_table[256] = {
  *	July 21, 1997 - Andrew E. Mileski
  *	Adapted from OSTA-UDF(tm) 1.50 standard.
  */
-extern uint16_t
+uint16_t
 udf_crc(uint8_t *data, uint32_t size, uint16_t crc)
 {
 	while (size--)
diff --git a/fs/udf/dir.c b/fs/udf/dir.c
index a67dceb36..33228f149 100644
--- a/fs/udf/dir.c
+++ b/fs/udf/dir.c
@@ -237,7 +237,9 @@ do_udf_readdir(struct inode * dir, struct file *filp, filldir_t filldir, void *d
 		}
 		else
 		{
-			iblock = udf_get_lb_pblock(dir->i_sb, lelb_to_cpu(cfi.icb.extLocation), 0);
+			lb_addr tloc = lelb_to_cpu(cfi.icb.extLocation);
+
+			iblock = udf_get_lb_pblock(dir->i_sb, tloc, 0);
 			flen = udf_get_filename(dir->i_sb, nameptr, fname, lfi);
 			dt_type = DT_UNKNOWN;
 		}
diff --git a/fs/udf/misc.c b/fs/udf/misc.c
index b6e1c25f6..174d7a3ec 100644
--- a/fs/udf/misc.c
+++ b/fs/udf/misc.c
@@ -34,7 +34,7 @@
 #include "udf_i.h"
 #include "udf_sb.h"
 
-extern struct buffer_head *
+struct buffer_head *
 udf_tgetblk(struct super_block *sb, int block)
 {
 	if (UDF_QUERY_FLAG(sb, UDF_FLAG_VARCONV))
@@ -43,7 +43,7 @@ udf_tgetblk(struct super_block *sb, int block)
 		return sb_getblk(sb, block);
 }
 
-extern struct buffer_head *
+struct buffer_head *
 udf_tread(struct super_block *sb, int block)
 {
 	if (UDF_QUERY_FLAG(sb, UDF_FLAG_VARCONV))
@@ -52,7 +52,7 @@ udf_tread(struct super_block *sb, int block)
 		return sb_bread(sb, block);
 }
 
-extern struct genericFormat *
+struct genericFormat *
 udf_add_extendedattr(struct inode * inode, uint32_t size, uint32_t type,
 	uint8_t loc)
 {
@@ -157,7 +157,7 @@ udf_add_extendedattr(struct inode * inode, uint32_t size, uint32_t type,
 	return NULL;
 }
 
-extern struct genericFormat *
+struct genericFormat *
 udf_get_extendedattr(struct inode *inode, uint32_t type, uint8_t subtype)
 {
 	struct genericFormat *gaf;
@@ -207,7 +207,7 @@ udf_get_extendedattr(struct inode *inode, uint32_t type, uint8_t subtype)
  *	July 1, 1997 - Andrew E. Mileski
  *	Written, tested, and released.
  */
-extern struct buffer_head *
+struct buffer_head *
 udf_read_tagged(struct super_block *sb, uint32_t block, uint32_t location, uint16_t *ident)
 {
 	tag *tag_p;
@@ -272,7 +272,7 @@ error_out:
 	return NULL;
 }
 
-extern struct buffer_head *
+struct buffer_head *
 udf_read_ptagged(struct super_block *sb, lb_addr loc, uint32_t offset, uint16_t *ident)
 {
 	return udf_read_tagged(sb, udf_get_lb_pblock(sb, loc, offset),
diff --git a/fs/udf/namei.c b/fs/udf/namei.c
index ee346b772..86cf34e77 100644
--- a/fs/udf/namei.c
+++ b/fs/udf/namei.c
@@ -861,6 +861,7 @@ static int udf_rmdir(struct inode * dir, struct dentry * dentry)
 	struct inode * inode = dentry->d_inode;
 	struct udf_fileident_bh fibh;
 	struct fileIdentDesc *fi, cfi;
+	lb_addr tloc;
 
 	retval = -ENOENT;
 	lock_kernel();
@@ -869,7 +870,8 @@ static int udf_rmdir(struct inode * dir, struct dentry * dentry)
 		goto out;
 
 	retval = -EIO;
-	if (udf_get_lb_pblock(dir->i_sb, lelb_to_cpu(cfi.icb.extLocation), 0) != inode->i_ino)
+	tloc = lelb_to_cpu(cfi.icb.extLocation);
+	if (udf_get_lb_pblock(dir->i_sb, tloc, 0) != inode->i_ino)
 		goto end_rmdir;
 	retval = -ENOTEMPTY;
 	if (!empty_dir(inode))
@@ -904,6 +906,7 @@ static int udf_unlink(struct inode * dir, struct dentry * dentry)
 	struct udf_fileident_bh fibh;
 	struct fileIdentDesc *fi;
 	struct fileIdentDesc cfi;
+	lb_addr tloc;
 
 	retval = -ENOENT;
 	lock_kernel();
@@ -912,12 +915,9 @@ static int udf_unlink(struct inode * dir, struct dentry * dentry)
 		goto out;
 
 	retval = -EIO;
-
-	if (udf_get_lb_pblock(dir->i_sb, lelb_to_cpu(cfi.icb.extLocation), 0) !=
-		inode->i_ino)
-	{
+	tloc = lelb_to_cpu(cfi.icb.extLocation);
+	if (udf_get_lb_pblock(dir->i_sb, tloc, 0) != inode->i_ino)
 		goto end_unlink;
-	}
 
 	if (!inode->i_nlink)
 	{
@@ -1178,6 +1178,7 @@ static int udf_rename (struct inode * old_dir, struct dentry * old_dentry,
 	struct fileIdentDesc *ofi = NULL, *nfi = NULL, *dir_fi = NULL, ocfi, ncfi;
 	struct buffer_head *dir_bh = NULL;
 	int retval = -ENOENT;
+	lb_addr tloc;
 
 	lock_kernel();
 	if ((ofi = udf_find_entry(old_dir, old_dentry, &ofibh, &ocfi)))
@@ -1186,11 +1187,10 @@ static int udf_rename (struct inode * old_dir, struct dentry * old_dentry,
 			udf_release_data(ofibh.ebh);
 		udf_release_data(ofibh.sbh);
 	}
-	if (!ofi || udf_get_lb_pblock(old_dir->i_sb, lelb_to_cpu(ocfi.icb.extLocation), 0) !=
-		old_inode->i_ino)
-	{
+	tloc = lelb_to_cpu(ocfi.icb.extLocation);
+	if (!ofi || udf_get_lb_pblock(old_dir->i_sb, tloc, 0)
+					!= old_inode->i_ino)
 		goto end_rename;
-	}
 
 	nfi = udf_find_entry(new_dir, new_dentry, &nfibh, &ncfi);
 	if (nfi)
@@ -1231,11 +1231,11 @@ static int udf_rename (struct inode * old_dir, struct dentry * old_dentry,
 		}
 		if (!dir_fi)
 			goto end_rename;
-		if (udf_get_lb_pblock(old_inode->i_sb, cpu_to_lelb(dir_fi->icb.extLocation), 0) !=
-			old_dir->i_ino)
-		{
+		tloc = cpu_to_lelb(dir_fi->icb.extLocation);
+		if (udf_get_lb_pblock(old_inode->i_sb, tloc, 0)
+					!= old_dir->i_ino)
 			goto end_rename;
-		}
+
 		retval = -EMLINK;
 		if (!new_inode && new_dir->i_nlink >= (256<<sizeof(new_dir->i_nlink))-1)
 			goto end_rename;
diff --git a/fs/udf/super.c b/fs/udf/super.c
index bbad84970..54e1ecffa 100644
--- a/fs/udf/super.c
+++ b/fs/udf/super.c
@@ -417,7 +417,7 @@ udf_parse_options(char *options, struct udf_options *uopt)
 			case Opt_utf8:
 				uopt->flags |= (1 << UDF_FLAG_UTF8);
 				break;
-#if defined(CONFIG_NLS) || defined(CONFIG_NLS_MODULE)
+#ifdef CONFIG_UDF_NLS
 			case Opt_iocharset:
 				uopt->nls_map = load_nls(args[0].from);
 				uopt->flags |= (1 << UDF_FLAG_NLS_MAP);
@@ -1518,7 +1518,7 @@ static int udf_fill_super(struct super_block *sb, void *options, int silent)
 			"utf8 cannot be combined with iocharset\n");
 		goto error_out;
 	}
-#if defined(CONFIG_NLS) || defined(CONFIG_NLS_MODULE)
+#ifdef CONFIG_UDF_NLS
 	if ((uopt.flags & (1 << UDF_FLAG_NLS_MAP)) && !uopt.nls_map)
 	{
 		uopt.nls_map = load_nls_default();
@@ -1668,7 +1668,7 @@ error_out:
 				udf_release_data(UDF_SB_TYPESPAR(sb, UDF_SB_PARTITION(sb)).s_spar_map[i]);
 		}
 	}
-#if defined(CONFIG_NLS) || defined(CONFIG_NLS_MODULE)
+#ifdef CONFIG_UDF_NLS
 	if (UDF_QUERY_FLAG(sb, UDF_FLAG_NLS_MAP))
 		unload_nls(UDF_SB(sb)->s_nls_map);
 #endif
@@ -1746,7 +1746,7 @@ udf_put_super(struct super_block *sb)
 				udf_release_data(UDF_SB_TYPESPAR(sb, UDF_SB_PARTITION(sb)).s_spar_map[i]);
 		}
 	}
-#if defined(CONFIG_NLS) || defined(CONFIG_NLS_MODULE)
+#ifdef CONFIG_UDF_NLS
 	if (UDF_QUERY_FLAG(sb, UDF_FLAG_NLS_MAP))
 		unload_nls(UDF_SB(sb)->s_nls_map);
 #endif
diff --git a/fs/ufs/balloc.c b/fs/ufs/balloc.c
index 4209eb7f2..2e90984b0 100644
--- a/fs/ufs/balloc.c
+++ b/fs/ufs/balloc.c
@@ -371,6 +371,7 @@ unsigned ufs_new_fragments (struct inode * inode, u32 * p, unsigned fragment,
 			else
 			{
 				printk(KERN_ERR "ufs_new_fragments: bread fail\n");
+				unlock_super(sb);
 				return 0;
 			}
 		}
diff --git a/fs/ufs/symlink.c b/fs/ufs/symlink.c
index 245225e0d..a0e491490 100644
--- a/fs/ufs/symlink.c
+++ b/fs/ufs/symlink.c
@@ -26,21 +26,17 @@
  */
 
 #include <linux/fs.h>
+#include <linux/namei.h>
 #include <linux/ufs_fs.h>
 
-static int ufs_readlink(struct dentry *dentry, char *buffer, int buflen)
-{
-	struct ufs_inode_info *p = UFS_I(dentry->d_inode);
-	return vfs_readlink(dentry, buffer, buflen, (char*)p->i_u1.i_symlink);
-}
-
 static int ufs_follow_link(struct dentry *dentry, struct nameidata *nd)
 {
 	struct ufs_inode_info *p = UFS_I(dentry->d_inode);
-	return vfs_follow_link(nd, (char*)p->i_u1.i_symlink);
+	nd_set_link(nd, (char*)p->i_u1.i_symlink);
+	return 0;
 }
 
 struct inode_operations ufs_fast_symlink_inode_operations = {
-	.readlink	= ufs_readlink,
+	.readlink	= generic_readlink,
 	.follow_link	= ufs_follow_link,
 };
diff --git a/fs/xfs/Makefile b/fs/xfs/Makefile
index 3795a5c8e..09f81b379 100644
--- a/fs/xfs/Makefile
+++ b/fs/xfs/Makefile
@@ -126,6 +126,7 @@ xfs-$(CONFIG_XFS_TRACE)		+= xfs_dir2_trace.o
 
 # Objects in linux-2.6/
 xfs-y				+= $(addprefix linux-2.6/, \
+				   kmem.o \
 				   xfs_aops.o \
 				   xfs_buf.o \
 				   xfs_file.o \
diff --git a/fs/xfs/linux-2.6/kmem.h b/fs/xfs/linux-2.6/kmem.h
index 13e6dcd59..ffe383e14 100644
--- a/fs/xfs/linux-2.6/kmem.h
+++ b/fs/xfs/linux-2.6/kmem.h
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2000-2003 Silicon Graphics, Inc.  All Rights Reserved.
+ * Copyright (c) 2000-2004 Silicon Graphics, Inc.  All Rights Reserved.
  *
  * This program is free software; you can redistribute it and/or modify it
  * under the terms of version 2 of the GNU General Public License as
@@ -32,32 +32,34 @@
 #ifndef __XFS_SUPPORT_KMEM_H__
 #define __XFS_SUPPORT_KMEM_H__
 
-#include <linux/mm.h>
-#include <linux/highmem.h>
 #include <linux/slab.h>
-#include <linux/vmalloc.h>
-
-/*
- * Cutoff point to use vmalloc instead of kmalloc.
- */
-#define MAX_SLAB_SIZE	0x20000
+#include <linux/sched.h>
+#include <linux/mm.h>
 
 /*
- * XFS uses slightly different names for these due to the
- * IRIX heritage.
+ * memory management routines
  */
-#define	kmem_zone	kmem_cache_s
-#define kmem_zone_t	kmem_cache_t
-
 #define KM_SLEEP	0x0001
 #define KM_NOSLEEP	0x0002
 #define KM_NOFS		0x0004
-#define KM_MAYFAIL	0x0005
+#define KM_MAYFAIL	0x0008
+
+#define	kmem_zone	kmem_cache_s
+#define kmem_zone_t	kmem_cache_t
 
 typedef unsigned long xfs_pflags_t;
 
+#define PFLAGS_TEST_NOIO()              (current->flags & PF_NOIO)
 #define PFLAGS_TEST_FSTRANS()           (current->flags & PF_FSTRANS)
 
+#define PFLAGS_SET_NOIO() do {		\
+	current->flags |= PF_NOIO;	\
+} while (0)
+
+#define PFLAGS_CLEAR_NOIO() do {	\
+	current->flags &= ~PF_NOIO;	\
+} while (0)
+
 /* these could be nested, so we save state */
 #define PFLAGS_SET_FSTRANS(STATEP) do {	\
 	*(STATEP) = current->flags;	\
@@ -79,12 +81,11 @@ typedef unsigned long xfs_pflags_t;
 	*(NSTATEP) = *(OSTATEP);	\
 } while (0)
 
-static __inline unsigned int
-kmem_flags_convert(int flags)
+static __inline unsigned int kmem_flags_convert(int flags)
 {
 	int lflags;
 
-#if DEBUG
+#ifdef DEBUG
 	if (unlikely(flags & ~(KM_SLEEP|KM_NOSLEEP|KM_NOFS|KM_MAYFAIL))) {
 		printk(KERN_WARNING
 		    "XFS: memory allocation with wrong flags (%x)\n", flags);
@@ -100,54 +101,9 @@ kmem_flags_convert(int flags)
 		/* avoid recusive callbacks to filesystem during transactions */
 		if (PFLAGS_TEST_FSTRANS() || (flags & KM_NOFS))
 			lflags &= ~__GFP_FS;
-
-		if (!(flags & KM_MAYFAIL))
-			lflags |= __GFP_NOFAIL;
-	}
-
-	return lflags;
-}
-
-static __inline void *
-kmem_alloc(size_t size, int flags)
-{
-	if (unlikely(MAX_SLAB_SIZE < size))
-		/* Avoid doing filesystem sensitive stuff to get this */
-		return __vmalloc(size, kmem_flags_convert(flags), PAGE_KERNEL);
-	return kmalloc(size, kmem_flags_convert(flags));
-}
-
-static __inline void *
-kmem_zalloc(size_t size, int flags)
-{
-	void *ptr = kmem_alloc(size, flags);
-	if (likely(ptr != NULL))
-		memset(ptr, 0, size);
-	return ptr;
-}
-
-static __inline void
-kmem_free(void *ptr, size_t size)
-{
-	if (unlikely((unsigned long)ptr < VMALLOC_START ||
-		     (unsigned long)ptr >= VMALLOC_END))
-		kfree(ptr);
-	else
-		vfree(ptr);
-}
-
-static __inline void *
-kmem_realloc(void *ptr, size_t newsize, size_t oldsize, int flags)
-{
-	void *new = kmem_alloc(newsize, flags);
-
-	if (likely(ptr != NULL)) {
-		if (likely(new != NULL))
-			memcpy(new, ptr, min(oldsize, newsize));
-		kmem_free(ptr, oldsize);
 	}
-
-	return new;
+        
+        return lflags;
 }
 
 static __inline kmem_zone_t *
@@ -156,27 +112,33 @@ kmem_zone_init(int size, char *zone_name)
 	return kmem_cache_create(zone_name, size, 0, 0, NULL, NULL);
 }
 
-static __inline void *
-kmem_zone_alloc(kmem_zone_t *zone, int flags)
+static __inline void
+kmem_zone_free(kmem_zone_t *zone, void *ptr)
 {
-	return kmem_cache_alloc(zone, kmem_flags_convert(flags));
+	kmem_cache_free(zone, ptr);
 }
 
-static __inline void *
-kmem_zone_zalloc(kmem_zone_t *zone, int flags)
+static __inline void
+kmem_zone_destroy(kmem_zone_t *zone)
 {
-	void *ptr = kmem_zone_alloc(zone, flags);
-	if (likely(ptr != NULL))
-		memset(ptr, 0, kmem_cache_size(zone));
-	return ptr;
+	if (zone && kmem_cache_destroy(zone))
+		BUG();
 }
 
-static __inline void
-kmem_zone_free(kmem_zone_t *zone, void *ptr)
+static __inline int
+kmem_zone_shrink(kmem_zone_t *zone)
 {
-	kmem_cache_free(zone, ptr);
+	return kmem_cache_shrink(zone);
 }
 
+extern void	    *kmem_zone_zalloc(kmem_zone_t *, int);
+extern void	    *kmem_zone_alloc(kmem_zone_t *, int);
+
+extern void	    *kmem_alloc(size_t, int);
+extern void	    *kmem_realloc(void *, size_t, size_t, int);
+extern void	    *kmem_zalloc(size_t, int);
+extern void         kmem_free(void *, size_t);
+
 typedef struct shrinker *kmem_shaker_t;
 typedef int (*kmem_shake_func_t)(int, unsigned int);
 
diff --git a/fs/xfs/linux-2.6/xfs_aops.c b/fs/xfs/linux-2.6/xfs_aops.c
index 200159fec..7122efdba 100644
--- a/fs/xfs/linux-2.6/xfs_aops.c
+++ b/fs/xfs/linux-2.6/xfs_aops.c
@@ -172,28 +172,15 @@ xfs_map_blocks(
 	struct inode		*inode,
 	loff_t			offset,
 	ssize_t			count,
-	xfs_iomap_t		*iomapp,
+	xfs_iomap_t		*mapp,
 	int			flags)
 {
 	vnode_t			*vp = LINVFS_GET_VP(inode);
-	int			error, niomaps = 1;
-
-	if (((flags & (BMAPI_DIRECT|BMAPI_SYNC)) == BMAPI_DIRECT) &&
-	    (offset >= i_size_read(inode)))
-		count = max_t(ssize_t, count, XFS_WRITE_IO_LOG);
-retry:
-	VOP_BMAP(vp, offset, count, flags, iomapp, &niomaps, error);
-	if ((error == EAGAIN) || (error == EIO))
-		return -error;
-	if (unlikely((flags & (BMAPI_WRITE|BMAPI_DIRECT)) ==
-					(BMAPI_WRITE|BMAPI_DIRECT) && niomaps &&
-					(iomapp->iomap_flags & IOMAP_DELAY))) {
-		flags = BMAPI_ALLOCATE;
-		goto retry;
-	}
-	if (flags & (BMAPI_WRITE|BMAPI_ALLOCATE)) {
+	int			error, nmaps = 1;
+
+	VOP_BMAP(vp, offset, count, flags, mapp, &nmaps, error);
+	if (!error && (flags & (BMAPI_WRITE|BMAPI_ALLOCATE)))
 		VMODIFY(vp);
-	}
 	return -error;
 }
 
@@ -288,7 +275,7 @@ xfs_probe_unwritten_page(
 		*fsbs = 0;
 		bh = head = page_buffers(page);
 		do {
-			if (!buffer_unwritten(bh))
+			if (!buffer_unwritten(bh) || !buffer_uptodate(bh))
 				break;
 			if (!xfs_offset_to_map(page, iomapp, p_offset))
 				break;
@@ -681,13 +668,12 @@ xfs_cluster_write(
 	xfs_iomap_t		*iomapp,
 	struct writeback_control *wbc,
 	int			startio,
-	int			all_bh)
+	int			all_bh,
+	pgoff_t			tlast)
 {
-	pgoff_t			tlast;
 	struct page		*page;
 
-	tlast = (iomapp->iomap_offset + iomapp->iomap_bsize) >> PAGE_CACHE_SHIFT;
-	for (; tindex < tlast; tindex++) {
+	for (; tindex <= tlast; tindex++) {
 		page = xfs_probe_delalloc_page(inode, tindex);
 		if (!page)
 			break;
@@ -725,17 +711,20 @@ xfs_page_state_convert(
 {
 	struct buffer_head	*bh_arr[MAX_BUF_PER_PAGE], *bh, *head;
 	xfs_iomap_t		*iomp, iomap;
-	unsigned long		p_offset = 0;
-	pgoff_t			end_index;
 	loff_t			offset;
-	unsigned long long	end_offset;
+	unsigned long           p_offset = 0;
+	__uint64_t              end_offset;
+	pgoff_t                 end_index, last_index, tlast;
 	int			len, err, i, cnt = 0, uptodate = 1;
 	int			flags = startio ? 0 : BMAPI_TRYLOCK;
 	int			page_dirty = 1;
+	int                     delalloc = 0;
 
 
 	/* Are we off the end of the file ? */
-	end_index = i_size_read(inode) >> PAGE_CACHE_SHIFT;
+	offset = i_size_read(inode);
+	end_index = offset >> PAGE_CACHE_SHIFT;
+	last_index = (offset - 1) >> PAGE_CACHE_SHIFT;
 	if (page->index >= end_index) {
 		if ((page->index >= end_index + 1) ||
 		    !(i_size_read(inode) & (PAGE_CACHE_SIZE - 1))) {
@@ -769,6 +758,8 @@ xfs_page_state_convert(
 		 * extent state conversion transaction on completion.
 		 */
 		if (buffer_unwritten(bh)) {
+			if (!startio)
+				continue;
 			if (!iomp) {
 				err = xfs_map_blocks(inode, offset, len, &iomap,
 						BMAPI_READ|BMAPI_IGNSTATE);
@@ -778,7 +769,7 @@ xfs_page_state_convert(
 				iomp = xfs_offset_to_map(page, &iomap,
 								p_offset);
 			}
-			if (iomp && startio) {
+			if (iomp) {
 				if (!bh->b_end_io) {
 					err = xfs_map_unwritten(inode, page,
 							head, bh, p_offset,
@@ -787,7 +778,10 @@ xfs_page_state_convert(
 					if (err) {
 						goto error;
 					}
+				} else {
+					set_bit(BH_Lock, &bh->b_state);
 				}
+				BUG_ON(!buffer_locked(bh));
 				bh_arr[cnt++] = bh;
 				page_dirty = 0;
 			}
@@ -797,6 +791,7 @@ xfs_page_state_convert(
 		 */
 		} else if (buffer_delay(bh)) {
 			if (!iomp) {
+				delalloc = 1;
 				err = xfs_map_blocks(inode, offset, len, &iomap,
 						BMAPI_ALLOCATE | flags);
 				if (err) {
@@ -871,8 +866,12 @@ xfs_page_state_convert(
 		xfs_submit_page(page, bh_arr, cnt);
 
 	if (iomp) {
+		tlast = (iomp->iomap_offset + iomp->iomap_bsize - 1) >>
+					PAGE_CACHE_SHIFT;
+		if (delalloc && (tlast > last_index))
+			tlast = last_index;
 		xfs_cluster_write(inode, page->index + 1, iomp, wbc,
-				startio, unmapped);
+					startio, unmapped, tlast);
 	}
 
 	return page_dirty;
diff --git a/fs/xfs/linux-2.6/xfs_buf.c b/fs/xfs/linux-2.6/xfs_buf.c
index b6dc7d9dc..ed8abf22d 100644
--- a/fs/xfs/linux-2.6/xfs_buf.c
+++ b/fs/xfs/linux-2.6/xfs_buf.c
@@ -65,7 +65,8 @@
  */
 
 STATIC kmem_cache_t *pagebuf_cache;
-STATIC void pagebuf_daemon_wakeup(void);
+STATIC kmem_shaker_t pagebuf_shake;
+STATIC int pagebuf_daemon_wakeup(int, unsigned int);
 STATIC void pagebuf_delwri_queue(xfs_buf_t *, int);
 STATIC struct workqueue_struct *pagebuf_logio_workqueue;
 STATIC struct workqueue_struct *pagebuf_dataio_workqueue;
@@ -384,13 +385,13 @@ _pagebuf_lookup_pages(
 			 * But until all the XFS lowlevel code is revamped to
 			 * handle buffer allocation failures we can't do much.
 			 */
-			if (!(++retries % 100)) {
-				printk(KERN_ERR "possibly deadlocking in %s\n",
-						__FUNCTION__);
-			}
+			if (!(++retries % 100))
+				printk(KERN_ERR
+					"possible deadlock in %s (mode:0x%x)\n",
+					__FUNCTION__, gfp_mask);
 
 			XFS_STATS_INC(pb_page_retries);
-			pagebuf_daemon_wakeup();
+			pagebuf_daemon_wakeup(0, gfp_mask);
 			set_current_state(TASK_UNINTERRUPTIBLE);
 			schedule_timeout(10);
 			goto retry;
@@ -1566,11 +1567,20 @@ void
 pagebuf_delwri_dequeue(
 	xfs_buf_t		*pb)
 {
-	PB_TRACE(pb, "delwri_uq", 0);
+	int			dequeued = 0;
+
 	spin_lock(&pbd_delwrite_lock);
-	list_del_init(&pb->pb_list);
+	if ((pb->pb_flags & PBF_DELWRI) && !list_empty(&pb->pb_list)) {
+		list_del_init(&pb->pb_list);
+		dequeued = 1;
+	}
 	pb->pb_flags &= ~PBF_DELWRI;
 	spin_unlock(&pbd_delwrite_lock);
+
+	if (dequeued)
+		pagebuf_rele(pb);
+
+	PB_TRACE(pb, "delwri_dq", (long)dequeued);
 }
 
 STATIC void
@@ -1586,12 +1596,16 @@ STATIC struct task_struct *pagebuf_daemon_task;
 STATIC int pagebuf_daemon_active;
 STATIC int force_flush;
 
-STATIC void
-pagebuf_daemon_wakeup(void)
+
+STATIC int
+pagebuf_daemon_wakeup(
+	int			priority,
+	unsigned int		mask)
 {
 	force_flush = 1;
 	barrier();
 	wake_up_process(pagebuf_daemon_task);
+	return 0;
 }
 
 STATIC int
@@ -1600,6 +1614,7 @@ pagebuf_daemon(
 {
 	struct list_head	tmp;
 	unsigned long		age;
+	xfs_buftarg_t		*target;
 	xfs_buf_t		*pb, *n;
 
 	/*  Set up the thread  */
@@ -1642,9 +1657,12 @@ pagebuf_daemon(
 
 		while (!list_empty(&tmp)) {
 			pb = list_entry(tmp.next, xfs_buf_t, pb_list);
+			target = pb->pb_target;
+
 			list_del_init(&pb->pb_list);
 			pagebuf_iostrategy(pb);
-			blk_run_address_space(pb->pb_target->pbr_mapping);
+
+			blk_run_address_space(target->pbr_mapping);
 		}
 
 		if (as_list_len > 0)
@@ -1775,21 +1793,28 @@ pagebuf_init(void)
 	pagebuf_cache = kmem_cache_create("xfs_buf_t", sizeof(xfs_buf_t), 0,
 			SLAB_HWCACHE_ALIGN, NULL, NULL);
 	if (pagebuf_cache == NULL) {
-		printk("pagebuf: couldn't init pagebuf cache\n");
+		printk("XFS: couldn't init xfs_buf_t cache\n");
 		pagebuf_terminate();
 		return -ENOMEM;
 	}
 
-	for (i = 0; i < NHASH; i++) {
-		spin_lock_init(&pbhash[i].pb_hash_lock);
-		INIT_LIST_HEAD(&pbhash[i].pb_hash);
-	}
-
 #ifdef PAGEBUF_TRACE
 	pagebuf_trace_buf = ktrace_alloc(PAGEBUF_TRACE_SIZE, KM_SLEEP);
 #endif
 
 	pagebuf_daemon_start();
+
+	pagebuf_shake = kmem_shake_register(pagebuf_daemon_wakeup);
+	if (pagebuf_shake == NULL) {
+		pagebuf_terminate();
+		return -ENOMEM;
+	}
+
+	for (i = 0; i < NHASH; i++) {
+		spin_lock_init(&pbhash[i].pb_hash_lock);
+		INIT_LIST_HEAD(&pbhash[i].pb_hash);
+	}
+
 	return 0;
 }
 
@@ -1808,5 +1833,6 @@ pagebuf_terminate(void)
 	ktrace_free(pagebuf_trace_buf);
 #endif
 
-	kmem_cache_destroy(pagebuf_cache);
+	kmem_zone_destroy(pagebuf_cache);
+	kmem_shake_deregister(pagebuf_shake);
 }
diff --git a/fs/xfs/linux-2.6/xfs_buf.h b/fs/xfs/linux-2.6/xfs_buf.h
index f97e6c0cd..7bebfd65a 100644
--- a/fs/xfs/linux-2.6/xfs_buf.h
+++ b/fs/xfs/linux-2.6/xfs_buf.h
@@ -347,27 +347,15 @@ extern void pagebuf_trace(
 #define XFS_BUF_ISSTALE(x)	((x)->pb_flags & XFS_B_STALE)
 #define XFS_BUF_SUPER_STALE(x)	do {				\
 					XFS_BUF_STALE(x);	\
-					xfs_buf_undelay(x);	\
+					pagebuf_delwri_dequeue(x);	\
 					XFS_BUF_DONE(x);	\
 				} while (0)
 
 #define XFS_BUF_MANAGE		PBF_FS_MANAGED
 #define XFS_BUF_UNMANAGE(x)	((x)->pb_flags &= ~PBF_FS_MANAGED)
 
-static inline void xfs_buf_undelay(xfs_buf_t *pb)
-{
-	if (pb->pb_flags & PBF_DELWRI) {
-		if (pb->pb_list.next != &pb->pb_list) {
-			pagebuf_delwri_dequeue(pb);
-			pagebuf_rele(pb);
-		} else {
-			pb->pb_flags &= ~PBF_DELWRI;
-		}
-	}
-}
-
 #define XFS_BUF_DELAYWRITE(x)	 ((x)->pb_flags |= PBF_DELWRI)
-#define XFS_BUF_UNDELAYWRITE(x)	 xfs_buf_undelay(x)
+#define XFS_BUF_UNDELAYWRITE(x)	 pagebuf_delwri_dequeue(x)
 #define XFS_BUF_ISDELAYWRITE(x)	 ((x)->pb_flags & PBF_DELWRI)
 
 #define XFS_BUF_ERROR(x,no)	 pagebuf_ioerror(x,no)
@@ -500,7 +488,7 @@ static inline int	xfs_bawrite(void *mp, xfs_buf_t *bp)
 {
 	bp->pb_fspriv3 = mp;
 	bp->pb_strat = xfs_bdstrat_cb;
-	xfs_buf_undelay(bp);
+	pagebuf_delwri_dequeue(bp);
 	return pagebuf_iostart(bp, PBF_WRITE | PBF_ASYNC | _PBF_RUN_QUEUES);
 }
 
@@ -540,7 +528,7 @@ static inline int	XFS_bwrite(xfs_buf_t *pb)
 	if (!iowait)
 		pb->pb_flags |= _PBF_RUN_QUEUES;
 
-	xfs_buf_undelay(pb);
+	pagebuf_delwri_dequeue(pb);
 	pagebuf_iostrategy(pb);
 	if (iowait) {
 		error = pagebuf_iowait(pb);
diff --git a/fs/xfs/linux-2.6/xfs_file.c b/fs/xfs/linux-2.6/xfs_file.c
index aaa74d256..e8e02f501 100644
--- a/fs/xfs/linux-2.6/xfs_file.c
+++ b/fs/xfs/linux-2.6/xfs_file.c
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2000-2003 Silicon Graphics, Inc.  All Rights Reserved.
+ * Copyright (c) 2000-2004 Silicon Graphics, Inc.  All Rights Reserved.
  *
  * This program is free software; you can redistribute it and/or modify it
  * under the terms of version 2 of the GNU General Public License as
@@ -53,6 +53,7 @@
 #include "xfs_rw.h"
 
 #include <linux/dcache.h>
+#include <linux/smp_lock.h>
 
 static struct vm_operations_struct linvfs_file_vm_ops;
 
@@ -440,9 +441,10 @@ linvfs_ioctl(
 	int		error;
 	vnode_t		*vp = LINVFS_GET_VP(inode);
 
-	ASSERT(vp);
+	unlock_kernel();
 	VOP_IOCTL(vp, inode, filp, 0, cmd, arg, error);
 	VMODIFY(vp);
+	lock_kernel();
 
 	/* NOTE:  some of the ioctl's return positive #'s as a
 	 *	  byte count indicating success, such as
@@ -463,9 +465,11 @@ linvfs_ioctl_invis(
 	int		error;
 	vnode_t		*vp = LINVFS_GET_VP(inode);
 
+	unlock_kernel();
 	ASSERT(vp);
 	VOP_IOCTL(vp, inode, filp, IO_INVIS, cmd, arg, error);
 	VMODIFY(vp);
+	lock_kernel();
 
 	/* NOTE:  some of the ioctl's return positive #'s as a
 	 *	  byte count indicating success, such as
diff --git a/fs/xfs/linux-2.6/xfs_fs_subr.c b/fs/xfs/linux-2.6/xfs_fs_subr.c
index afad97018..05ebd30ec 100644
--- a/fs/xfs/linux-2.6/xfs_fs_subr.c
+++ b/fs/xfs/linux-2.6/xfs_fs_subr.c
@@ -36,7 +36,7 @@
  * Stub for no-op vnode operations that return error status.
  */
 int
-fs_noerr()
+fs_noerr(void)
 {
 	return 0;
 }
@@ -45,7 +45,7 @@ fs_noerr()
  * Operation unsupported under this file system.
  */
 int
-fs_nosys()
+fs_nosys(void)
 {
 	return ENOSYS;
 }
@@ -55,7 +55,7 @@ fs_nosys()
  */
 /* ARGSUSED */
 void
-fs_noval()
+fs_noval(void)
 {
 }
 
diff --git a/fs/xfs/linux-2.6/xfs_iops.c b/fs/xfs/linux-2.6/xfs_iops.c
index 8a0814055..962cf8d6b 100644
--- a/fs/xfs/linux-2.6/xfs_iops.c
+++ b/fs/xfs/linux-2.6/xfs_iops.c
@@ -67,6 +67,7 @@
 #include "xfs_utils.h"
 
 #include <linux/xattr.h>
+#include <linux/namei.h>
 
 
 /*
@@ -419,13 +420,16 @@ linvfs_follow_link(
 	ASSERT(nd);
 
 	link = (char *)kmalloc(MAXNAMELEN+1, GFP_KERNEL);
-	if (!link)
-		return -ENOMEM;
+	if (!link) {
+		nd_set_link(nd, ERR_PTR(-ENOMEM));
+		return 0;
+	}
 
 	uio = (uio_t *)kmalloc(sizeof(uio_t), GFP_KERNEL);
 	if (!uio) {
 		kfree(link);
-		return -ENOMEM;
+		nd_set_link(nd, ERR_PTR(-ENOMEM));
+		return 0;
 	}
 
 	vp = LINVFS_GET_VP(dentry->d_inode);
@@ -441,18 +445,22 @@ linvfs_follow_link(
 
 	VOP_READLINK(vp, uio, 0, NULL, error);
 	if (error) {
-		kfree(uio);
 		kfree(link);
-		return -error;
+		link = ERR_PTR(-error);
+	} else {
+		link[MAXNAMELEN - uio->uio_resid] = '\0';
 	}
-
-	link[MAXNAMELEN - uio->uio_resid] = '\0';
 	kfree(uio);
 
-	/* vfs_follow_link returns (-) errors */
-	error = vfs_follow_link(nd, link);
-	kfree(link);
-	return error;
+	nd_set_link(nd, link);
+	return 0;
+}
+
+static void linvfs_put_link(struct dentry *dentry, struct nameidata *nd)
+{
+	char *s = nd_get_link(nd);
+	if (!IS_ERR(s))
+		kfree(s);
 }
 
 #ifdef CONFIG_XFS_POSIX_ACL
@@ -719,6 +727,7 @@ struct inode_operations linvfs_dir_inode_operations = {
 struct inode_operations linvfs_symlink_inode_operations = {
 	.readlink		= linvfs_readlink,
 	.follow_link		= linvfs_follow_link,
+	.put_link		= linvfs_put_link,
 	.permission		= linvfs_permission,
 	.getattr		= linvfs_getattr,
 	.setattr		= linvfs_setattr,
diff --git a/fs/xfs/linux-2.6/xfs_super.c b/fs/xfs/linux-2.6/xfs_super.c
index 8bed3a1b9..3a2e961ea 100644
--- a/fs/xfs/linux-2.6/xfs_super.c
+++ b/fs/xfs/linux-2.6/xfs_super.c
@@ -76,7 +76,8 @@
 STATIC struct quotactl_ops linvfs_qops;
 STATIC struct super_operations linvfs_sops;
 STATIC struct export_operations linvfs_export_ops;
-STATIC kmem_cache_t * linvfs_inode_cachep;
+STATIC kmem_zone_t *linvfs_inode_zone;
+STATIC kmem_shaker_t xfs_inode_shaker;
 
 STATIC struct xfs_mount_args *
 xfs_args_allocate(
@@ -297,7 +298,7 @@ linvfs_alloc_inode(
 {
 	vnode_t			*vp;
 
-	vp = (vnode_t *)kmem_cache_alloc(linvfs_inode_cachep, 
+	vp = (vnode_t *)kmem_cache_alloc(linvfs_inode_zone, 
                 kmem_flags_convert(KM_SLEEP));
 	if (!vp)
 		return NULL;
@@ -308,7 +309,20 @@ STATIC void
 linvfs_destroy_inode(
 	struct inode		*inode)
 {
-	kmem_cache_free(linvfs_inode_cachep, LINVFS_GET_VP(inode));
+	kmem_cache_free(linvfs_inode_zone, LINVFS_GET_VP(inode));
+}
+
+int
+xfs_inode_shake(
+	int		priority,
+	unsigned int	gfp_mask)
+{
+	int		pages;
+
+	
+	pages = kmem_zone_shrink(linvfs_inode_zone);
+	pages += kmem_zone_shrink(xfs_inode_zone);
+	return pages;
 }
 
 STATIC void
@@ -327,12 +341,12 @@ init_once(
 STATIC int
 init_inodecache( void )
 {
-	linvfs_inode_cachep = kmem_cache_create("linvfs_icache",
+	linvfs_inode_zone = kmem_cache_create("linvfs_icache",
 				sizeof(vnode_t), 0,
 				SLAB_HWCACHE_ALIGN|SLAB_RECLAIM_ACCOUNT,
 				init_once, NULL);
 
-	if (linvfs_inode_cachep == NULL)
+	if (linvfs_inode_zone == NULL)
 		return -ENOMEM;
 	return 0;
 }
@@ -340,7 +354,7 @@ init_inodecache( void )
 STATIC void
 destroy_inodecache( void )
 {
-	if (kmem_cache_destroy(linvfs_inode_cachep))
+	if (kmem_cache_destroy(linvfs_inode_zone))
 		printk(KERN_WARNING "%s: cache still in use!\n", __FUNCTION__);
 }
 
@@ -843,15 +857,24 @@ init_xfs_fs( void )
 	vn_init();
 	xfs_init();
 	uuid_init();
-	vfs_initdmapi();
 	vfs_initquota();
 
+	xfs_inode_shaker = kmem_shake_register(xfs_inode_shake);
+	if (!xfs_inode_shaker) {
+		error = -ENOMEM;
+		goto undo_shaker;
+	}
+
 	error = register_filesystem(&xfs_fs_type);
 	if (error)
 		goto undo_register;
+	XFS_DM_INIT(&xfs_fs_type);
 	return 0;
 
 undo_register:
+	kmem_shake_deregister(xfs_inode_shaker);
+
+undo_shaker:
 	pagebuf_terminate();
 
 undo_pagebuf:
@@ -865,8 +888,9 @@ STATIC void __exit
 exit_xfs_fs( void )
 {
 	vfs_exitquota();
-	vfs_exitdmapi();
+	XFS_DM_EXIT(&xfs_fs_type);
 	unregister_filesystem(&xfs_fs_type);
+	kmem_shake_deregister(xfs_inode_shaker);
 	xfs_cleanup();
 	pagebuf_terminate();
 	destroy_inodecache();
diff --git a/fs/xfs/linux-2.6/xfs_super.h b/fs/xfs/linux-2.6/xfs_super.h
index 0d3703db3..866c7ad75 100644
--- a/fs/xfs/linux-2.6/xfs_super.h
+++ b/fs/xfs/linux-2.6/xfs_super.h
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2000-2003 Silicon Graphics, Inc.  All Rights Reserved.
+ * Copyright (c) 2000-2004 Silicon Graphics, Inc.  All Rights Reserved.
  *
  * This program is free software; you can redistribute it and/or modify it
  * under the terms of version 2 of the GNU General Public License as
@@ -92,6 +92,12 @@ extern void xfs_qm_exit(void);
 # define XFS_TRACE_STRING
 #endif
 
+#ifdef CONFIG_XFS_DMAPI
+# define XFS_DMAPI_STRING	"dmapi support, "
+#else
+# define XFS_DMAPI_STRING
+#endif
+
 #ifdef DEBUG
 # define XFS_DBG_STRING		"debug"
 #else
@@ -103,6 +109,7 @@ extern void xfs_qm_exit(void);
 				XFS_REALTIME_STRING \
 				XFS_BIGFS_STRING \
 				XFS_TRACE_STRING \
+				XFS_DMAPI_STRING \
 				XFS_DBG_STRING /* DBG must be last */
 
 #define LINVFS_GET_VFS(s) \
diff --git a/fs/xfs/linux-2.6/xfs_sysctl.c b/fs/xfs/linux-2.6/xfs_sysctl.c
index 570d1a942..4a173d3d8 100644
--- a/fs/xfs/linux-2.6/xfs_sysctl.c
+++ b/fs/xfs/linux-2.6/xfs_sysctl.c
@@ -46,12 +46,13 @@ xfs_stats_clear_proc_handler(
 	int		write,
 	struct file	*filp,
 	void		*buffer,
-	size_t		*lenp)
+	size_t		*lenp,
+	loff_t		*ppos)
 {
 	int		c, ret, *valp = ctl->data;
 	__uint32_t	vn_active;
 
-	ret = proc_dointvec_minmax(ctl, write, filp, buffer, lenp);
+	ret = proc_dointvec_minmax(ctl, write, filp, buffer, lenp, ppos);
 
 	if (!ret && write && *valp) {
 		printk("XFS Clearing xfsstats\n");
diff --git a/fs/xfs/xfs.h b/fs/xfs/xfs.h
index 809bee71d..7e276dcaf 100644
--- a/fs/xfs/xfs.h
+++ b/fs/xfs/xfs.h
@@ -35,5 +35,6 @@
 #include <linux-2.6/xfs_linux.h>
 
 #include <xfs_fs.h> 
+#include <xfs_macros.h>
 
 #endif	/* __XFS_H__ */
diff --git a/fs/xfs/xfs_acl.c b/fs/xfs/xfs_acl.c
index ad9f5de3a..b800f8f4e 100644
--- a/fs/xfs/xfs_acl.c
+++ b/fs/xfs/xfs_acl.c
@@ -231,8 +231,6 @@ xfs_acl_vget(
 	int			flags = 0;
 
 	VN_HOLD(vp);
-	if ((error = _MAC_VACCESS(vp, NULL, VREAD)))
-		goto out;
 	if(size) {
 		if (!(_ACL_ALLOC(xfs_acl))) {
 			error = ENOMEM;
@@ -395,8 +393,6 @@ xfs_acl_allow_set(
 		return ENOTDIR;
 	if (vp->v_vfsp->vfs_flag & VFS_RDONLY)
 		return EROFS;
-	if ((error = _MAC_VACCESS(vp, NULL, VWRITE)))
-		return error;
 	va.va_mask = XFS_AT_UID;
 	VOP_GETATTR(vp, &va, 0, NULL, error);
 	if (error)
diff --git a/fs/xfs/xfs_acl.h b/fs/xfs/xfs_acl.h
index ab15998d4..35e56b7f0 100644
--- a/fs/xfs/xfs_acl.h
+++ b/fs/xfs/xfs_acl.h
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2001-2003 Silicon Graphics, Inc.  All Rights Reserved.
+ * Copyright (c) 2001-2004 Silicon Graphics, Inc.  All Rights Reserved.
  *
  * This program is free software; you can redistribute it and/or modify it
  * under the terms of version 2 of the GNU General Public License as
@@ -61,14 +61,17 @@ typedef struct xfs_acl {
 #define SGI_ACL_DEFAULT_SIZE	(sizeof(SGI_ACL_DEFAULT)-1)
 
 
-#ifdef __KERNEL__
-
 #ifdef CONFIG_XFS_POSIX_ACL
 
 struct vattr;
 struct vnode;
 struct xfs_inode;
 
+extern struct kmem_zone *xfs_acl_zone;
+#define xfs_acl_zone_init(zone, name)	\
+		(zone) = kmem_zone_init(sizeof(xfs_acl_t), name)
+#define xfs_acl_zone_destroy(zone)	kmem_cache_destroy(zone)
+
 extern int xfs_acl_inherit(struct vnode *, struct vattr *, xfs_acl_t *);
 extern int xfs_acl_iaccess(struct xfs_inode *, mode_t, cred_t *);
 extern int xfs_acl_get(struct vnode *, xfs_acl_t *, xfs_acl_t *);
@@ -80,17 +83,10 @@ extern int xfs_acl_vset(struct vnode *, void *, size_t, int);
 extern int xfs_acl_vget(struct vnode *, void *, size_t, int);
 extern int xfs_acl_vremove(struct vnode *vp, int);
 
-extern struct kmem_zone *xfs_acl_zone;
-
 #define _ACL_TYPE_ACCESS	1
 #define _ACL_TYPE_DEFAULT	2
 #define _ACL_PERM_INVALID(perm)	((perm) & ~(ACL_READ|ACL_WRITE|ACL_EXECUTE))
 
-#define _ACL_DECL(a)		xfs_acl_t *(a) = NULL
-#define _ACL_ALLOC(a)		((a) = kmem_zone_alloc(xfs_acl_zone, KM_SLEEP))
-#define _ACL_FREE(a)		((a)? kmem_zone_free(xfs_acl_zone, (a)) : 0)
-#define _ACL_ZONE_INIT(z,name)	((z) = kmem_zone_init(sizeof(xfs_acl_t), name))
-#define _ACL_ZONE_DESTROY(z)	(kmem_cache_destroy(z))
 #define _ACL_INHERIT(c,v,d)	(xfs_acl_inherit(c,v,d))
 #define _ACL_GET_ACCESS(pv,pa)	(xfs_acl_vtoacl(pv,pa,NULL) == 0)
 #define _ACL_GET_DEFAULT(pv,pd)	(xfs_acl_vtoacl(pv,NULL,pd) == 0)
@@ -98,17 +94,19 @@ extern struct kmem_zone *xfs_acl_zone;
 #define _ACL_DEFAULT_EXISTS	xfs_acl_vhasacl_default
 #define _ACL_XFS_IACCESS(i,m,c) (XFS_IFORK_Q(i) ? xfs_acl_iaccess(i,m,c) : -1)
 
+#define _ACL_ALLOC(a)		((a) = kmem_zone_alloc(xfs_acl_zone, KM_SLEEP))
+#define _ACL_FREE(a)		((a)? kmem_zone_free(xfs_acl_zone, (a)) : 0)
+
 #else
+#define xfs_acl_zone_init(zone,name)
+#define xfs_acl_zone_destroy(zone)
 #define xfs_acl_vset(v,p,sz,t)	(-EOPNOTSUPP)
 #define xfs_acl_vget(v,p,sz,t)	(-EOPNOTSUPP)
 #define xfs_acl_vremove(v,t)	(-EOPNOTSUPP)
 #define xfs_acl_vhasacl_access(v)	(0)
 #define xfs_acl_vhasacl_default(v)	(0)
-#define _ACL_DECL(a)		((void)0)
 #define _ACL_ALLOC(a)		(1)	/* successfully allocate nothing */
 #define _ACL_FREE(a)		((void)0)
-#define _ACL_ZONE_INIT(z,name)	((void)0)
-#define _ACL_ZONE_DESTROY(z)	((void)0)
 #define _ACL_INHERIT(c,v,d)	(0)
 #define _ACL_GET_ACCESS(pv,pa)	(0)
 #define _ACL_GET_DEFAULT(pv,pd)	(0)
@@ -117,6 +115,4 @@ extern struct kmem_zone *xfs_acl_zone;
 #define _ACL_XFS_IACCESS(i,m,c) (-1)
 #endif
 
-#endif	/* __KERNEL__ */
-
 #endif	/* __XFS_ACL_H__ */
diff --git a/fs/xfs/xfs_arch.h b/fs/xfs/xfs_arch.h
index 3d65fe3c6..3c7a90bfb 100644
--- a/fs/xfs/xfs_arch.h
+++ b/fs/xfs/xfs_arch.h
@@ -157,11 +157,11 @@
 
 /* does not return a value */
 #define INT_MOD_EXPR(reference,arch,code) \
-    (void)(((arch) == ARCH_NOCONVERT) \
+    (((arch) == ARCH_NOCONVERT) \
 	? \
-	    ((reference) code) \
+	    (void)((reference) code) \
 	: \
-	    ( \
+	    (void)( \
 		(reference) = INT_GET((reference),arch) , \
 		((reference) code), \
 		INT_SET(reference, arch, reference) \
@@ -187,10 +187,10 @@
 
 /* does not return a value */
 #define INT_COPY(dst,src,arch) \
-    (void)( \
+    ( \
 	((sizeof(dst) == sizeof(src)) || ((arch) == ARCH_NOCONVERT)) \
 	    ? \
-		((dst) = (src)) \
+		(void)((dst) = (src)) \
 	    : \
 		INT_SET(dst, arch, INT_GET(src, arch)) \
     )
diff --git a/fs/xfs/xfs_attr.c b/fs/xfs/xfs_attr.c
index 8eb321eec..f1ccb5890 100644
--- a/fs/xfs/xfs_attr.c
+++ b/fs/xfs/xfs_attr.c
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2000-2003 Silicon Graphics, Inc.  All Rights Reserved.
+ * Copyright (c) 2000-2004 Silicon Graphics, Inc.  All Rights Reserved.
  *
  * This program is free software; you can redistribute it and/or modify it
  * under the terms of version 2 of the GNU General Public License as
@@ -2149,8 +2149,8 @@ xfs_attr_rmtval_remove(xfs_da_args_t *args)
 		/*
 		 * If the "remote" value is in the cache, remove it.
 		 */
-		/* bp = incore(mp->m_dev, dblkno, blkcnt, 1); */
-		bp = xfs_incore(mp->m_ddev_targp, dblkno, blkcnt, 1);
+		bp = xfs_incore(mp->m_ddev_targp, dblkno, blkcnt,
+				XFS_INCORE_TRYLOCK);
 		if (bp) {
 			XFS_BUF_STALE(bp);
 			XFS_BUF_UNDELAYWRITE(bp);
diff --git a/fs/xfs/xfs_bit.c b/fs/xfs/xfs_bit.c
index ec12a13d8..a20a6c3dc 100644
--- a/fs/xfs/xfs_bit.c
+++ b/fs/xfs/xfs_bit.c
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2000-2002 Silicon Graphics, Inc.  All Rights Reserved.
+ * Copyright (c) 2000-2004 Silicon Graphics, Inc.  All Rights Reserved.
  *
  * This program is free software; you can redistribute it and/or modify it
  * under the terms of version 2 of the GNU General Public License as
@@ -154,14 +154,17 @@ int
 xfs_lowbit64(
 	__uint64_t	v)
 {
-	int n;
-	n = ffs((unsigned)v);
-	if (n <= 0) {
-		n = ffs(v >> 32);
-		if (n >= 0)
-			n+=32;
+	__uint32_t	w = (__uint32_t)v;
+	int		n = 0;
+
+	if (w) {	/* lower bits */
+		n = ffs(w);
+	} else {	/* upper bits */
+		w = (__uint32_t)(v >> 32);
+		if (w && (n = ffs(w)))
+			n += 32;
 	}
-	return (n <= 0) ? n : n-1;
+	return n - 1;
 }
 
 /*
@@ -171,10 +174,11 @@ int
 xfs_highbit64(
 	__uint64_t	v)
 {
-	__uint32_t h = v >> 32;
+	__uint32_t	h = (__uint32_t)(v >> 32);
+
 	if (h)
 		return xfs_highbit32(h) + 32;
-	return xfs_highbit32((__u32)v);
+	return xfs_highbit32((__uint32_t)v);
 }
 
 
diff --git a/fs/xfs/xfs_dmapi.h b/fs/xfs/xfs_dmapi.h
index 53838b48b..55ae3e67d 100644
--- a/fs/xfs/xfs_dmapi.h
+++ b/fs/xfs/xfs_dmapi.h
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2000-2003 Silicon Graphics, Inc.  All Rights Reserved.
+ * Copyright (c) 2000-2004 Silicon Graphics, Inc.  All Rights Reserved.
  *
  * This program is free software; you can redistribute it and/or modify it
  * under the terms of version 2 of the GNU General Public License as
@@ -199,7 +199,14 @@ typedef enum {
 
 extern struct bhv_vfsops xfs_dmops;
 
-extern int dmapi_init(void);
-extern void dmapi_uninit(void);
+#ifdef CONFIG_XFS_DMAPI
+void xfs_dm_init(struct file_system_type *);
+void xfs_dm_exit(struct file_system_type *);
+#define XFS_DM_INIT(fstype)	xfs_dm_init(fstype)
+#define XFS_DM_EXIT(fstype)	xfs_dm_exit(fstype)
+#else
+#define XFS_DM_INIT(fstype)
+#define XFS_DM_EXIT(fstype)
+#endif
 
 #endif  /* __XFS_DMAPI_H__ */
diff --git a/fs/xfs/xfs_inode.c b/fs/xfs/xfs_inode.c
index ab973fe10..8a821fed5 100644
--- a/fs/xfs/xfs_inode.c
+++ b/fs/xfs/xfs_inode.c
@@ -1140,8 +1140,7 @@ xfs_ialloc(
 	 * Call the space management code to pick
 	 * the on-disk inode to be allocated.
 	 */
-	ASSERT(pip != NULL);
-	error = xfs_dialloc(tp, pip ? pip->i_ino : 0, mode, okalloc,
+	error = xfs_dialloc(tp, pip->i_ino, mode, okalloc,
 			    ialloc_context, call_again, &ino);
 	if (error != 0) {
 		return error;
@@ -3696,12 +3695,6 @@ xfs_iaccess(
 	mode_t		orgmode = mode;
 	struct inode	*inode = LINVFS_GET_IP(XFS_ITOV(ip));
 
-	/*
-	 * Verify that the MAC policy allows the requested access.
-	 */
-	if ((error = _MAC_XFS_IACCESS(ip, mode, cr)))
-		return XFS_ERROR(error);
-
 	if (mode & S_IWUSR) {
 		umode_t		imode = inode->i_mode;
 
diff --git a/fs/xfs/xfs_inode.h b/fs/xfs/xfs_inode.h
index 13abdd55e..f606073ad 100644
--- a/fs/xfs/xfs_inode.h
+++ b/fs/xfs/xfs_inode.h
@@ -459,8 +459,8 @@ xfs_inode_t *xfs_bhvtoi(struct bhv_desc *bhvp);
  * directory, group of new file is set to that of the parent, and
  * new subdirectory gets S_ISGID bit from parent.
  */
-#define XFS_INHERIT_GID(pip, vfsp)	((pip) != NULL && \
-	(((vfsp)->vfs_flag & VFS_GRPID) || ((pip)->i_d.di_mode & S_ISGID)))
+#define XFS_INHERIT_GID(pip, vfsp)	\
+	(((vfsp)->vfs_flag & VFS_GRPID) || ((pip)->i_d.di_mode & S_ISGID))
 
 /*
  * xfs_iget.c prototypes.
diff --git a/fs/xfs/xfs_mount.h b/fs/xfs/xfs_mount.h
index 1ee2bbf63..f51ec1296 100644
--- a/fs/xfs/xfs_mount.h
+++ b/fs/xfs/xfs_mount.h
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2000-2003 Silicon Graphics, Inc.  All Rights Reserved.
+ * Copyright (c) 2000-2004 Silicon Graphics, Inc.  All Rights Reserved.
  *
  * This program is free software; you can redistribute it and/or modify it
  * under the terms of version 2 of the GNU General Public License as
@@ -424,10 +424,6 @@ typedef struct xfs_mount {
  */
 #define XFS_READIO_LOG_LARGE	16
 #define XFS_WRITEIO_LOG_LARGE	16
-/*
- * Default allocation size
- */
-#define XFS_WRITE_IO_LOG	16
 
 /*
  * Max and min values for UIO and mount-option defined I/O sizes;
diff --git a/fs/xfs/xfs_rtalloc.c b/fs/xfs/xfs_rtalloc.c
index 524d8b211..c130d4259 100644
--- a/fs/xfs/xfs_rtalloc.c
+++ b/fs/xfs/xfs_rtalloc.c
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2000-2002 Silicon Graphics, Inc.  All Rights Reserved.
+ * Copyright (c) 2000-2004 Silicon Graphics, Inc.  All Rights Reserved.
  *
  * This program is free software; you can redistribute it and/or modify it
  * under the terms of version 2 of the GNU General Public License as
@@ -100,7 +100,9 @@ STATIC int
 xfs_lowbit32(
 	__uint32_t	v)
 {
-	return ffs(v)-1;
+	if (v)
+		return ffs(v) - 1;
+	return -1;
 }
 
 /*
diff --git a/fs/xfs/xfs_vfsops.c b/fs/xfs/xfs_vfsops.c
index be1188165..114c53a76 100644
--- a/fs/xfs/xfs_vfsops.c
+++ b/fs/xfs/xfs_vfsops.c
@@ -118,7 +118,7 @@ xfs_init(void)
 	xfs_ili_zone = kmem_zone_init(sizeof(xfs_inode_log_item_t), "xfs_ili");
 	xfs_chashlist_zone = kmem_zone_init(sizeof(xfs_chashlist_t),
 					    "xfs_chashlist");
-	_ACL_ZONE_INIT(xfs_acl_zone, "xfs_acl");
+	xfs_acl_zone_init(xfs_acl_zone, "xfs_acl");
 
 	/*
 	 * Allocate global trace buffers.
@@ -170,6 +170,7 @@ xfs_cleanup(void)
 	xfs_cleanup_procfs();
 	xfs_sysctl_unregister();
 	xfs_refcache_destroy();
+	xfs_acl_zone_destroy(xfs_acl_zone);
 
 #ifdef XFS_DIR2_TRACE
 	ktrace_free(xfs_dir2_trace_buf);
@@ -202,7 +203,6 @@ xfs_cleanup(void)
 	kmem_cache_destroy(xfs_ifork_zone);
 	kmem_cache_destroy(xfs_ili_zone);
 	kmem_cache_destroy(xfs_chashlist_zone);
-	_ACL_ZONE_DESTROY(xfs_acl_zone);
 }
 
 /*
diff --git a/fs/xfs/xfs_vnodeops.c b/fs/xfs/xfs_vnodeops.c
index 2777aca04..05ab682c6 100644
--- a/fs/xfs/xfs_vnodeops.c
+++ b/fs/xfs/xfs_vnodeops.c
@@ -411,11 +411,6 @@ xfs_setattr(
 
 	xfs_ilock(ip, lock_flags);
 
-	if (_MAC_XFS_IACCESS(ip, MACWRITE, credp)) {
-		code = XFS_ERROR(EACCES);
-		goto error_return;
-	}
-
 	/* boolean: are we the file owner? */
 	file_owner = (current_fsuid(credp) == ip->i_d.di_uid);
 
@@ -2450,11 +2445,6 @@ xfs_remove(
 		xfs_trans_ijoin(tp, ip, XFS_ILOCK_EXCL);
 	}
 
-	if ((error = _MAC_XFS_IACCESS(ip, MACWRITE, credp))) {
-		REMOVE_DEBUG_TRACE(__LINE__);
-		goto error_return;
-	}
-
 	/*
 	 * Entry must exist since we did a lookup in xfs_lock_dir_and_entry.
 	 */
@@ -2540,8 +2530,6 @@ xfs_remove(
  error1:
 	xfs_bmap_cancel(&free_list);
 	cancel_flags |= XFS_TRANS_ABORT;
-
- error_return:
 	xfs_trans_cancel(tp, cancel_flags);
 	goto std_return;
 
@@ -3109,10 +3097,6 @@ xfs_rmdir(
 	ITRACE(cdp);
 	xfs_trans_ijoin(tp, cdp, XFS_ILOCK_EXCL);
 
-	if ((error = _MAC_XFS_IACCESS(cdp, MACWRITE, credp))) {
-		goto error_return;
-	}
-
 	ASSERT(cdp->i_d.di_nlink >= 2);
 	if (cdp->i_d.di_nlink != 2) {
 		error = XFS_ERROR(ENOTEMPTY);
diff --git a/include/acpi/acpi_drivers.h b/include/acpi/acpi_drivers.h
index fadb1c956..c4d9a8ebb 100644
--- a/include/acpi/acpi_drivers.h
+++ b/include/acpi/acpi_drivers.h
@@ -55,7 +55,7 @@
 
 /* ACPI PCI Interrupt Link (pci_link.c) */
 
-int acpi_pci_link_check (void);
+int acpi_irq_penalty_init (void);
 int acpi_pci_link_get_irq (acpi_handle handle, int index, int* edge_level, int* active_high_low);
 
 /* ACPI PCI Interrupt Routing (pci_irq.c) */
diff --git a/include/asm-alpha/bitops.h b/include/asm-alpha/bitops.h
index 4c0e5f417..22ecbf95f 100644
--- a/include/asm-alpha/bitops.h
+++ b/include/asm-alpha/bitops.h
@@ -418,9 +418,9 @@ find_next_zero_bit(void * addr, unsigned long size, unsigned long offset)
  * Find next one bit in a bitmap reasonably efficiently.
  */
 static inline unsigned long
-find_next_bit(void * addr, unsigned long size, unsigned long offset)
+find_next_bit(const void * addr, unsigned long size, unsigned long offset)
 {
-	unsigned long * p = ((unsigned long *) addr) + (offset >> 6);
+	const unsigned long * p = ((const unsigned long *) addr) + (offset >> 6);
 	unsigned long result = offset & ~63UL;
 	unsigned long tmp;
 
diff --git a/include/asm-alpha/checksum.h b/include/asm-alpha/checksum.h
index f3e379787..a5c9f0844 100644
--- a/include/asm-alpha/checksum.h
+++ b/include/asm-alpha/checksum.h
@@ -1,6 +1,7 @@
 #ifndef _ALPHA_CHECKSUM_H
 #define _ALPHA_CHECKSUM_H
 
+#include <linux/in6.h>
 
 /*
  *	This is a version of ip_compute_csum() optimized for IP headers,
diff --git a/include/asm-alpha/core_lca.h b/include/asm-alpha/core_lca.h
index d4f397543..a2a55b54a 100644
--- a/include/asm-alpha/core_lca.h
+++ b/include/asm-alpha/core_lca.h
@@ -136,7 +136,7 @@
 #define LCA_PMR_DMAO    0x80                    /* DMA override */
 #define LCA_PMR_OCCEB   0xffff0000L             /* Override cycle counter - even bits */
 #define LCA_PMR_OCCOB   0xffff000000000000L     /* Override cycle counter - even bits */
-#define LCA_PMR_PRIMARY_MASK    0xfffffffffffffff8
+#define LCA_PMR_PRIMARY_MASK    0xfffffffffffffff8L
 
 /* LCA PMR Macros */
 
diff --git a/include/asm-alpha/fcntl.h b/include/asm-alpha/fcntl.h
index ad40d002f..6b7d6c164 100644
--- a/include/asm-alpha/fcntl.h
+++ b/include/asm-alpha/fcntl.h
@@ -21,6 +21,7 @@
 #define O_NOFOLLOW	0200000 /* don't follow links */
 #define O_LARGEFILE	0400000 /* will be set by the kernel on every open */
 #define O_DIRECT	02000000 /* direct disk access - should check with OSF/1 */
+#define O_NOATIME	04000000
 
 #define F_DUPFD		0	/* dup */
 #define F_GETFD		1	/* get close_on_exec */
diff --git a/include/asm-alpha/fpu.h b/include/asm-alpha/fpu.h
index 3cd9b4dd5..c203fc2fa 100644
--- a/include/asm-alpha/fpu.h
+++ b/include/asm-alpha/fpu.h
@@ -27,7 +27,7 @@
 #define FPCR_DYN_PLUS	 (0x3UL << FPCR_DYN_SHIFT)	/* towards +INF */
 #define FPCR_DYN_MASK	 (0x3UL << FPCR_DYN_SHIFT)
 
-#define FPCR_MASK	0xffff800000000000
+#define FPCR_MASK	0xffff800000000000L
 
 /*
  * IEEE trap enables are implemented in software.  These per-thread
diff --git a/include/asm-alpha/pgalloc.h b/include/asm-alpha/pgalloc.h
index 2ef3066df..b671bb3c2 100644
--- a/include/asm-alpha/pgalloc.h
+++ b/include/asm-alpha/pgalloc.h
@@ -66,7 +66,7 @@ pte_alloc_one(struct mm_struct *mm, unsigned long addr)
 	pte_t *pte = pte_alloc_one_kernel(mm, addr);
 	if (pte)
 		return virt_to_page(pte);
-	return 0;
+	return NULL;
 }
 
 static inline void
diff --git a/include/asm-alpha/resource.h b/include/asm-alpha/resource.h
index 686b9558d..b94759c61 100644
--- a/include/asm-alpha/resource.h
+++ b/include/asm-alpha/resource.h
@@ -15,9 +15,11 @@
 #define RLIMIT_AS	7		/* address space limit(?) */
 #define RLIMIT_NPROC	8		/* max number of processes */
 #define RLIMIT_MEMLOCK	9		/* max locked-in-memory address space */
-#define RLIMIT_LOCKS   10              /* maximum file locks held */
+#define RLIMIT_LOCKS	10		/* maximum file locks held */
+#define RLIMIT_SIGPENDING 11		/* max number of pending signals */
+#define RLIMIT_MSGQUEUE 12		/* maximum bytes in POSIX mqueues */
 
-#define RLIM_NLIMITS	11
+#define RLIM_NLIMITS	13
 
 /*
  * SuS says limits have to be unsigned.  Fine, it's unsigned, but
@@ -40,7 +42,9 @@
     {LONG_MAX, LONG_MAX},			/* RLIMIT_AS */		\
     {LONG_MAX, LONG_MAX},			/* RLIMIT_NPROC */	\
     {LONG_MAX, LONG_MAX},			/* RLIMIT_MEMLOCK */	\
-    {LONG_MAX, LONG_MAX},                       /* RLIMIT_LOCKS */      \
+    {LONG_MAX, LONG_MAX},			/* RLIMIT_LOCKS */	\
+    {MAX_SIGPENDING, MAX_SIGPENDING},		/* RLIMIT_SIGPENDING */ \
+    {MQ_BYTES_MAX, MQ_BYTES_MAX},		/* RLIMIT_MSGQUEUE */	\
 }
 
 #endif /* __KERNEL__ */
diff --git a/include/asm-alpha/signal.h b/include/asm-alpha/signal.h
index 37f1742ff..25f98bc55 100644
--- a/include/asm-alpha/signal.h
+++ b/include/asm-alpha/signal.h
@@ -128,7 +128,11 @@ typedef unsigned long sigset_t;
 #define SIG_SETMASK        3	/* for setting the signal mask */
 
 /* Type of a signal handler.  */
-typedef void (*__sighandler_t)(int);
+typedef void __signalfn_t(int);
+typedef __signalfn_t __user *__sighandler_t;
+
+typedef void __restorefn_t(void);
+typedef __restorefn_t __user *__sigrestore_t;
 
 #define SIG_DFL	((__sighandler_t)0)	/* default signal handling */
 #define SIG_IGN	((__sighandler_t)1)	/* ignore signal */
@@ -149,7 +153,7 @@ struct sigaction {
 
 struct k_sigaction {
 	struct sigaction sa;
-	void (*ka_restorer)(void);
+	__sigrestore_t ka_restorer;
 };
 #else
 /* Here we must cater to libcs that poke about in kernel headers.  */
@@ -169,7 +173,7 @@ struct sigaction {
 #endif /* __KERNEL__ */
 
 typedef struct sigaltstack {
-	void *ss_sp;
+	void __user *ss_sp;
 	int ss_flags;
 	size_t ss_size;
 } stack_t;
@@ -179,7 +183,7 @@ typedef struct sigaltstack {
    implemented here for OSF/1 compatibility.  */
 
 struct sigstack {
-	void *ss_sp;
+	void __user *ss_sp;
 	int ss_onstack;
 };
 
diff --git a/include/asm-alpha/smp.h b/include/asm-alpha/smp.h
index d342a017c..cbc173ae4 100644
--- a/include/asm-alpha/smp.h
+++ b/include/asm-alpha/smp.h
@@ -50,9 +50,7 @@ extern cpumask_t cpu_online_map;
 extern int smp_num_cpus;
 #define cpu_possible_map	cpu_present_mask
 
-#define cpu_online(cpu)		cpu_isset(cpu, cpu_online_map)
-
-extern int smp_call_function_on_cpu(void (*func) (void *info), void *info,int retry, int wait, unsigned long cpu);
+int smp_call_function_on_cpu(void (*func) (void *info), void *info,int retry, int wait, cpumask_t cpu);
 
 #else /* CONFIG_SMP */
 
diff --git a/include/asm-alpha/spinlock.h b/include/asm-alpha/spinlock.h
index 71d9743b8..1fc53a935 100644
--- a/include/asm-alpha/spinlock.h
+++ b/include/asm-alpha/spinlock.h
@@ -26,9 +26,9 @@ typedef struct {
 } spinlock_t;
 
 #ifdef CONFIG_DEBUG_SPINLOCK
-#define SPIN_LOCK_UNLOCKED (spinlock_t) {0, -1, 0, 0, 0, 0}
+#define SPIN_LOCK_UNLOCKED (spinlock_t) {0, -1, 0, NULL, NULL, NULL}
 #define spin_lock_init(x)						\
-	((x)->lock = 0, (x)->on_cpu = -1, (x)->previous = 0, (x)->task = 0)
+	((x)->lock = 0, (x)->on_cpu = -1, (x)->previous = NULL, (x)->task = NULL)
 #else
 #define SPIN_LOCK_UNLOCKED	(spinlock_t) { 0 }
 #define spin_lock_init(x)	((x)->lock = 0)
diff --git a/include/asm-alpha/system.h b/include/asm-alpha/system.h
index 606a0553c..1e5ac92d2 100644
--- a/include/asm-alpha/system.h
+++ b/include/asm-alpha/system.h
@@ -43,7 +43,6 @@
  */
 #define PARAM			ZERO_PGE
 #define COMMAND_LINE		((char*)(PARAM + 0x0000))
-#define COMMAND_LINE_SIZE	256
 #define INITRD_START		(*(unsigned long *) (PARAM+0x100))
 #define INITRD_SIZE		(*(unsigned long *) (PARAM+0x108))
 
diff --git a/include/asm-alpha/topology.h b/include/asm-alpha/topology.h
index 65a6a2e8b..271d21c24 100644
--- a/include/asm-alpha/topology.h
+++ b/include/asm-alpha/topology.h
@@ -22,17 +22,17 @@ static inline int cpu_to_node(int cpu)
 	return node;
 }
 
-static inline int node_to_cpumask(int node)
+static inline cpumask_t node_to_cpumask(int node)
 {
-	unsigned long node_cpu_mask = 0;
+	cpumask_t node_cpu_mask = CPU_MASK_NONE;
 	int cpu;
 
 	for(cpu = 0; cpu < NR_CPUS; cpu++) {
 		if (cpu_online(cpu) && (cpu_to_node(cpu) == node))
-			node_cpu_mask |= 1UL << cpu;
+			cpu_set(cpu, node_cpu_mask);
 	}
 
-#if DEBUG_NUMA
+#ifdef DEBUG_NUMA
 	printk("node %d: cpu_mask: %016lx\n", node, node_cpu_mask);
 #endif
 
@@ -42,6 +42,8 @@ static inline int node_to_cpumask(int node)
 /* Cross-node load balancing interval. */
 # define NODE_BALANCE_RATE 10
 
+#define pcibus_to_cpumask(bus)	(cpu_online_map)
+
 #else /* CONFIG_NUMA */
 # include <asm-generic/topology.h>
 #endif /* !CONFIG_NUMA */
diff --git a/include/asm-alpha/uaccess.h b/include/asm-alpha/uaccess.h
index a65bfb31a..c9bb9f103 100644
--- a/include/asm-alpha/uaccess.h
+++ b/include/asm-alpha/uaccess.h
@@ -29,15 +29,6 @@
 
 #define segment_eq(a,b)	((a).seg == (b).seg)
 
-#ifdef __CHECKER__
-#define CHECK_UPTR(ptr) do {                            \
-        __typeof__(*(ptr)) *__dummy_check_uptr =        \
-		(void __user *)&__dummy_check_uptr;     \
-} while(0)
-#else
-#define CHECK_UPTR(ptr)
-#endif
-
 /*
  * Is a address valid? This does a straightforward calculation rather
  * than tests.
@@ -53,7 +44,7 @@
 
 #define access_ok(type,addr,size)				\
 ({								\
-	CHECK_UPTR(addr);					\
+	__chk_user_ptr(addr);					\
 	__access_ok(((unsigned long)(addr)),(size),get_fs());	\
 })
 
@@ -101,7 +92,7 @@ extern void __get_user_unknown(void);
 #define __get_user_nocheck(x,ptr,size)				\
 ({								\
 	long __gu_err = 0, __gu_val;				\
-	CHECK_UPTR(ptr);					\
+	__chk_user_ptr(ptr);					\
 	switch (size) {						\
 	  case 1: __get_user_8(ptr); break;			\
 	  case 2: __get_user_16(ptr); break;			\
@@ -113,23 +104,23 @@ extern void __get_user_unknown(void);
 	__gu_err;						\
 })
 
-#define __get_user_check(x,ptr,size,segment)			\
-({								\
-	long __gu_err = -EFAULT, __gu_val = 0;			\
-	const __typeof__(*(ptr)) *__gu_addr = (ptr);		\
-	CHECK_UPTR(ptr);					\
-	if (__access_ok((long)__gu_addr,size,segment)) {	\
-		__gu_err = 0;					\
-		switch (size) {					\
-		  case 1: __get_user_8(__gu_addr); break;	\
-		  case 2: __get_user_16(__gu_addr); break;	\
-		  case 4: __get_user_32(__gu_addr); break;	\
-		  case 8: __get_user_64(__gu_addr); break;	\
-		  default: __get_user_unknown(); break;		\
-		}						\
-	}							\
-	(x) = (__typeof__(*(ptr))) __gu_val;			\
-	__gu_err;						\
+#define __get_user_check(x,ptr,size,segment)				\
+({									\
+	long __gu_err = -EFAULT, __gu_val = 0;				\
+	const __typeof__(*(ptr)) __user *__gu_addr = (ptr);		\
+	__chk_user_ptr(ptr);						\
+	if (__access_ok((unsigned long)__gu_addr,size,segment)) {	\
+		__gu_err = 0;						\
+		switch (size) {						\
+		  case 1: __get_user_8(__gu_addr); break;		\
+		  case 2: __get_user_16(__gu_addr); break;		\
+		  case 4: __get_user_32(__gu_addr); break;		\
+		  case 8: __get_user_64(__gu_addr); break;		\
+		  default: __get_user_unknown(); break;			\
+		}							\
+	}								\
+	(x) = (__typeof__(*(ptr))) __gu_val;				\
+	__gu_err;							\
 })
 
 struct __large_struct { unsigned long buf[100]; };
@@ -217,7 +208,7 @@ extern void __put_user_unknown(void);
 #define __put_user_nocheck(x,ptr,size)				\
 ({								\
 	long __pu_err = 0;					\
-	CHECK_UPTR(ptr);					\
+	__chk_user_ptr(ptr);					\
 	switch (size) {						\
 	  case 1: __put_user_8(x,ptr); break;			\
 	  case 2: __put_user_16(x,ptr); break;			\
@@ -228,22 +219,22 @@ extern void __put_user_unknown(void);
 	__pu_err;						\
 })
 
-#define __put_user_check(x,ptr,size,segment)			\
-({								\
-	long __pu_err = -EFAULT;				\
-	__typeof__(*(ptr)) *__pu_addr = (ptr);			\
-	CHECK_UPTR(ptr);					\
-	if (__access_ok((long)__pu_addr,size,segment)) {	\
-		__pu_err = 0;					\
-		switch (size) {					\
-		  case 1: __put_user_8(x,__pu_addr); break;	\
-		  case 2: __put_user_16(x,__pu_addr); break;	\
-		  case 4: __put_user_32(x,__pu_addr); break;	\
-		  case 8: __put_user_64(x,__pu_addr); break;	\
-		  default: __put_user_unknown(); break;		\
-		}						\
-	}							\
-	__pu_err;						\
+#define __put_user_check(x,ptr,size,segment)				\
+({									\
+	long __pu_err = -EFAULT;					\
+	__typeof__(*(ptr)) __user *__pu_addr = (ptr);			\
+	__chk_user_ptr(ptr);						\
+	if (__access_ok((unsigned long)__pu_addr,size,segment)) {	\
+		__pu_err = 0;						\
+		switch (size) {						\
+		  case 1: __put_user_8(x,__pu_addr); break;		\
+		  case 2: __put_user_16(x,__pu_addr); break;		\
+		  case 4: __put_user_32(x,__pu_addr); break;		\
+		  case 8: __put_user_64(x,__pu_addr); break;		\
+		  default: __put_user_unknown(); break;			\
+		}							\
+	}								\
+	__pu_err;							\
 })
 
 /*
@@ -388,32 +379,32 @@ __copy_tofrom_user_nocheck(void *to, const void *from, long len)
 extern inline long
 __copy_tofrom_user(void *to, const void *from, long len, const void __user *validate)
 {
-	if (__access_ok((long)validate, len, get_fs()))
+	if (__access_ok((unsigned long)validate, len, get_fs()))
 		len = __copy_tofrom_user_nocheck(to, from, len);
 	return len;
 }
 
-#define __copy_to_user(to,from,n)				\
-({								\
-	CHECK_UPTR(to);						\
-	__copy_tofrom_user_nocheck((void *)(to),(from),(n));	\
+#define __copy_to_user(to,from,n)					\
+({									\
+	__chk_user_ptr(to);						\
+	__copy_tofrom_user_nocheck((__force void *)(to),(from),(n));	\
 })
-#define __copy_from_user(to,from,n)				\
-({								\
-	CHECK_UPTR(from);					\
-	__copy_tofrom_user_nocheck((to),(void *)(from),(n));	\
+#define __copy_from_user(to,from,n)					\
+({									\
+	__chk_user_ptr(from);						\
+	__copy_tofrom_user_nocheck((to),(__force void *)(from),(n));	\
 })
 
 extern inline long
 copy_to_user(void __user *to, const void *from, long n)
 {
-	return __copy_tofrom_user((void *)to, from, n, to);
+	return __copy_tofrom_user((__force void *)to, from, n, to);
 }
 
 extern inline long
 copy_from_user(void *to, const void __user *from, long n)
 {
-	return __copy_tofrom_user(to, (void *)from, n, from);
+	return __copy_tofrom_user(to, (__force void *)from, n, from);
 }
 
 extern void __do_clear_user(void);
@@ -435,7 +426,7 @@ __clear_user(void __user *to, long len)
 extern inline long
 clear_user(void __user *to, long len)
 {
-	if (__access_ok((long)to, len, get_fs()))
+	if (__access_ok((unsigned long)to, len, get_fs()))
 		len = __clear_user(to, len);
 	return len;
 }
@@ -452,7 +443,7 @@ extern inline long
 strncpy_from_user(char *to, const char __user *from, long n)
 {
 	long ret = -EFAULT;
-	if (__access_ok((long)from, 0, get_fs()))
+	if (__access_ok((unsigned long)from, 0, get_fs()))
 		ret = __strncpy_from_user(to, from, n);
 	return ret;
 }
diff --git a/include/asm-arm/arch-ebsa110/io.h b/include/asm-arm/arch-ebsa110/io.h
index 52030abe9..e2c242ff0 100644
--- a/include/asm-arm/arch-ebsa110/io.h
+++ b/include/asm-arm/arch-ebsa110/io.h
@@ -15,26 +15,44 @@
 
 #define IO_SPACE_LIMIT 0xffff
 
-u8  __inb(int port);
-u16 __inw(int port);
-u32 __inl(int port);
+u8 __inb8(unsigned int port);
+void __outb8(u8  val, unsigned int port);
 
-#define inb(p)			__inb(p)
-#define inw(p)			__inw(p)
-#define inl(p)			__inl(p)
+u8 __inb16(unsigned int port);
+void __outb16(u8  val, unsigned int port);
 
-void __outb(u8  val, int port);
-void __outw(u16 val, int port);
-void __outl(u32 val, int port);
+u16 __inw(unsigned int port);
+void __outw(u16 val, unsigned int port);
 
-#define outb(v,p)		__outb(v,p)
-#define outw(v,p)		__outw(v,p)
-#define outl(v,p)		__outl(v,p)
+u32 __inl(unsigned int port);
+void __outl(u32 val, unsigned int port);
 
 u8  __readb(void *addr);
 u16 __readw(void *addr);
 u32 __readl(void *addr);
 
+void __writeb(u8  val, void *addr);
+void __writew(u16 val, void *addr);
+void __writel(u32 val, void *addr);
+
+/*
+ * Argh, someone forgot the IOCS16 line.  We therefore have to handle
+ * the byte stearing by selecting the correct byte IO functions here.
+ */
+#ifdef ISA_SIXTEEN_BIT_PERIPHERAL
+#define inb(p) 			__inb16(p)
+#define outb(v,p)		__outb16(v,p)
+#else
+#define inb(p)			__inb8(p)
+#define outb(v,p)		__outb8(v,p)
+#endif
+
+#define inw(p)			__inw(p)
+#define outw(v,p)		__outw(v,p)
+
+#define inl(p)			__inl(p)
+#define outl(v,p)		__outl(v,p)
+
 #define readb(b)		__readb(b)
 #define readw(b)		__readw(b)
 #define readl(b)		__readl(b)
@@ -42,10 +60,6 @@ u32 __readl(void *addr);
 #define readw_relaxed(addr)	readw(addr)
 #define readl_relaxed(addr)	readl(addr)
 
-void __writeb(u8  val, void *addr);
-void __writew(u16 val, void *addr);
-void __writel(u32 val, void *addr);
-
 #define writeb(v,b)		__writeb(v,b)
 #define writew(v,b)		__writew(v,b)
 #define writel(v,b)		__writel(v,b)
@@ -53,4 +67,12 @@ void __writel(u32 val, void *addr);
 #define __arch_ioremap(cookie,sz,c,a)	((void *)(cookie))
 #define __arch_iounmap(cookie)		do { } while (0)
 
+extern void insb(unsigned int port, void *buf, int sz);
+extern void insw(unsigned int port, void *buf, int sz);
+extern void insl(unsigned int port, void *buf, int sz);
+
+extern void outsb(unsigned int port, const void *buf, int sz);
+extern void outsw(unsigned int port, const void *buf, int sz);
+extern void outsl(unsigned int port, const void *buf, int sz);
+
 #endif
diff --git a/include/asm-arm/arch-ebsa110/uncompress.h b/include/asm-arm/arch-ebsa110/uncompress.h
index 8396e9a3d..1d7d841ef 100644
--- a/include/asm-arm/arch-ebsa110/uncompress.h
+++ b/include/asm-arm/arch-ebsa110/uncompress.h
@@ -13,6 +13,7 @@
  */
 static void puts(const char *s)
 {
+	unsigned long tmp1, tmp2;
 	__asm__ __volatile__(
 	"ldrb	%0, [%2], #1\n"
 "	teq	%0, #0\n"
@@ -32,7 +33,8 @@ static void puts(const char *s)
 "	and	%1, %1, #0x60\n"
 "	teq	%1, #0x60\n"
 "	bne	3b"
-	: : "r" (0), "r" (0), "r" (s), "r" (0xf0000be0) : "cc");
+	: "=&r" (tmp1), "=&r" (tmp2)
+	: "r" (s), "r" (0xf0000be0) : "cc");
 }
 
 /*
diff --git a/include/asm-arm/arch-integrator/impd1.h b/include/asm-arm/arch-integrator/impd1.h
index 178fbac02..d75de4b14 100644
--- a/include/asm-arm/arch-integrator/impd1.h
+++ b/include/asm-arm/arch-integrator/impd1.h
@@ -14,6 +14,5 @@
 
 struct device;
 
-void impd1_set_vco(struct device *dev, int vconr, unsigned long period);
 void impd1_tweak_control(struct device *dev, u32 mask, u32 val);
 
diff --git a/include/asm-arm/arch-integrator/platform.h b/include/asm-arm/arch-integrator/platform.h
index 6b67e4166..09ec7902f 100644
--- a/include/asm-arm/arch-integrator/platform.h
+++ b/include/asm-arm/arch-integrator/platform.h
@@ -457,6 +457,10 @@
 #define mSEC_25                         (mSEC_1 * 25)
 #define SEC_1                           (mSEC_1 * 1000)
 
+#ifndef __ASSEMBLY__
+extern void integrator_time_init(unsigned long, unsigned int);
+#endif
+
 #define INTEGRATOR_CSR_BASE             0x10000000
 #define INTEGRATOR_CSR_SIZE             0x10000000
 
diff --git a/include/asm-arm/arch-ixp4xx/dma.h b/include/asm-arm/arch-ixp4xx/dma.h
index 686eacaf0..312065dc0 100644
--- a/include/asm-arm/arch-ixp4xx/dma.h
+++ b/include/asm-arm/arch-ixp4xx/dma.h
@@ -23,30 +23,4 @@
 /* No DMA */
 #define MAX_DMA_CHANNELS	0
 
-/*
- * Only first 64MB of memory can be accessed via PCI.
- * We use GFP_DMA to allocate safe buffers to do map/unmap.
- * This is really ugly and we need a better way of specifying
- * DMA-capable regions of memory.
- */
-static inline void __arch_adjust_zones(int node, unsigned long *zone_size, 
-	unsigned long *zhole_size) 
-{
-	unsigned int sz = SZ_64M >> PAGE_SHIFT;
-
-	/*
-	 * Only adjust if > 64M on current system
-	 */
-	if (node || (zone_size[0] <= sz))
-		return;
-
-	zone_size[1] = zone_size[0] - sz;
-	zone_size[0] = sz;
-	zhole_size[1] = zhole_size[0];
-	zhole_size[0] = 0;
-}
-
-#define arch_adjust_zones(node, size, holes) \
-	__arch_adjust_zones(node, size, holes)
-
 #endif /* _ASM_ARCH_DMA_H */
diff --git a/include/asm-arm/arch-ixp4xx/memory.h b/include/asm-arm/arch-ixp4xx/memory.h
index 3f6da1127..d348548b5 100644
--- a/include/asm-arm/arch-ixp4xx/memory.h
+++ b/include/asm-arm/arch-ixp4xx/memory.h
@@ -7,11 +7,45 @@
 #ifndef __ASM_ARCH_MEMORY_H
 #define __ASM_ARCH_MEMORY_H
 
+#include <asm/sizes.h>
+
 /*
  * Physical DRAM offset.
  */
 #define PHYS_OFFSET	(0x00000000UL)
 
+#ifndef __ASSEMBLY__
+
+/*
+ * Only first 64MB of memory can be accessed via PCI.
+ * We use GFP_DMA to allocate safe buffers to do map/unmap.
+ * This is really ugly and we need a better way of specifying
+ * DMA-capable regions of memory.
+ */
+static inline void __arch_adjust_zones(int node, unsigned long *zone_size, 
+	unsigned long *zhole_size) 
+{
+	unsigned int sz = SZ_64M >> PAGE_SHIFT;
+
+	/*
+	 * Only adjust if > 64M on current system
+	 */
+	if (node || (zone_size[0] <= sz))
+		return;
+
+	zone_size[1] = zone_size[0] - sz;
+	zone_size[0] = sz;
+	zhole_size[1] = zhole_size[0];
+	zhole_size[0] = 0;
+}
+
+#define arch_adjust_zones(node, size, holes) \
+	__arch_adjust_zones(node, size, holes)
+
+#define ISA_DMA_THRESHOLD (SZ_64M - 1)
+
+#endif
+
 /*
  * Virtual view <-> DMA view memory address translations
  * virt_to_bus: Used to translate the virtual address to an
diff --git a/include/asm-arm/arch-ixp4xx/platform.h b/include/asm-arm/arch-ixp4xx/platform.h
index 52c1c445c..b8ea57968 100644
--- a/include/asm-arm/arch-ixp4xx/platform.h
+++ b/include/asm-arm/arch-ixp4xx/platform.h
@@ -58,6 +58,7 @@ struct ixp4xx_i2c_pins {
  */
 extern void ixp4xx_map_io(void);
 extern void ixp4xx_init_irq(void);
+extern void ixp4xx_init_time(void);
 extern void ixp4xx_pci_preinit(void);
 struct pci_sys_data;
 extern int ixp4xx_setup(int nr, struct pci_sys_data *sys);
diff --git a/include/asm-arm/arch-lh7a40x/memory.h b/include/asm-arm/arch-lh7a40x/memory.h
index 1a1b1a3d5..3480cb7f4 100644
--- a/include/asm-arm/arch-lh7a40x/memory.h
+++ b/include/asm-arm/arch-lh7a40x/memory.h
@@ -6,14 +6,14 @@
  *  modify it under the terms of the GNU General Public License
  *  version 2 as published by the Free Software Foundation.
  *
+ *
+ *  Refer to <file:Documentation/arm/Sharp-LH/SDRAM> for more information.
+ *
  */
 
 #ifndef __ASM_ARCH_MEMORY_H
 #define __ASM_ARCH_MEMORY_H
 
-
-#define BANKS_PER_NODE 1	/* Define as either 1 or 2 */
-
 /*
  * Physical DRAM offset.
  */
@@ -30,57 +30,30 @@
 #define __bus_to_virt(x)	 __phys_to_virt(x)
 
 #ifdef CONFIG_DISCONTIGMEM
-/*
- * Because of the wide memory address space between physical RAM
- * banks, it's convenient to use Linux's NUMA support to represent our
- * memory map.  Assuming all memory nodes have equal access
- * characteristics, we then have a generic discontiguous memory setup.
- *
- * Of course, all this isn't mandatory for implementations with only
- * one used memory bank.  For those, simply undefine
- * CONFIG_DISCONTIGMEM.  However, keep in mind that a featurefull
- * system will need more than 4MiB of RAM.
- *
- * The contiguous memory blocks are small enough that it pays to
- * aggregate two banks into one node.  Setting BANKS_PER_NODE to 2
- * puts pairs of banks into a node.
- *
- * A typical layout would start like this:
- *
- *  node 0: 0xc0000000
- *          0xc1000000
- *  node 1: 0xc4000000
- *          0xc5000000
- *  node 2: 0xc8000000
- *          0xc9000000
- *
- * The proximity of the pairs of blocks makes it feasible to combine them.
- *
- */
 
 /*
  * Given a kernel address, find the home node of the underlying memory.
  */
 
-#if BANKS_PER_NODE==1
-#define KVADDR_TO_NID(addr) \
+# ifdef CONFIG_LH7A40X_ONE_BANK_PER_NODE
+#  define KVADDR_TO_NID(addr) \
   (  ((((unsigned long) (addr) - PAGE_OFFSET) >> 24) &  1)\
    | ((((unsigned long) (addr) - PAGE_OFFSET) >> 25) & ~1))
-#else  /* 2 banks per node */
-#define KVADDR_TO_NID(addr) \
-       ((unsigned long) (addr) - PAGE_OFFSET) >> 26)
-#endif
+# else  /* 2 banks per node */
+#  define KVADDR_TO_NID(addr) \
+      (((unsigned long) (addr) - PAGE_OFFSET) >> 26)
+# endif
 
 /*
  * Given a page frame number, convert it to a node id.
  */
 
-#if BANKS_PER_NODE==1
-#define PFN_TO_NID(pfn) \
+# ifdef CONFIG_LH7A40X_ONE_BANK_PER_NODE
+#  define PFN_TO_NID(pfn) \
   (((((pfn) - PHYS_PFN_OFFSET) >> (24 - PAGE_SHIFT)) &  1)\
  | ((((pfn) - PHYS_PFN_OFFSET) >> (25 - PAGE_SHIFT)) & ~1))
-#else  /* 2 banks per node */
-#define PFN_TO_NID(addr) \
+# else  /* 2 banks per node */
+#  define PFN_TO_NID(pfn) \
     (((pfn) - PHYS_PFN_OFFSET) >> (26 - PAGE_SHIFT))
 #endif
 
@@ -88,13 +61,13 @@
  * Given a kaddr, ADDR_TO_MAPBASE finds the owning node of the memory
  * and return the mem_map of that node.
  */
-#define ADDR_TO_MAPBASE(kaddr)	NODE_MEM_MAP(KVADDR_TO_NID(kaddr))
+# define ADDR_TO_MAPBASE(kaddr)	NODE_MEM_MAP(KVADDR_TO_NID(kaddr))
 
 /*
  * Given a page frame number, find the owning node of the memory
  * and return the mem_map of that node.
  */
-#define PFN_TO_MAPBASE(pfn)	NODE_MEM_MAP(PFN_TO_NID(pfn))
+# define PFN_TO_MAPBASE(pfn)	NODE_MEM_MAP(PFN_TO_NID(pfn))
 
 /*
  * Given a kaddr, LOCAL_MEM_MAP finds the owning node of the memory
@@ -102,17 +75,17 @@
  * node's mem_map.
  */
 
-#if BANKS_PER_NODE==1
-#define LOCAL_MAP_NR(addr) \
+# ifdef CONFIG_LH7A40X_ONE_BANK_PER_NODE
+#  define LOCAL_MAP_NR(addr) \
        (((unsigned long)(addr) & 0x003fffff) >> PAGE_SHIFT)
-#else  /* 2 banks per node */
-#define LOCAL_MAP_NR(addr) \
+# else  /* 2 banks per node */
+#  define LOCAL_MAP_NR(addr) \
        (((unsigned long)(addr) & 0x01ffffff) >> PAGE_SHIFT)
-#endif
+# endif
 
 #else
 
-#define PFN_TO_NID(addr)	(0)
+# define PFN_TO_NID(addr)	(0)
 
 #endif
 
diff --git a/include/asm-arm/arch-omap/memory.h b/include/asm-arm/arch-omap/memory.h
index 106af7555..4f9e8c842 100644
--- a/include/asm-arm/arch-omap/memory.h
+++ b/include/asm-arm/arch-omap/memory.h
@@ -57,12 +57,28 @@
 
 /*
  * OMAP-1510 bus address is translated into a Local Bus address if the
- * OMAP bus type is lbus. See dmadev_uses_omap_lbus().
+ * OMAP bus type is lbus. We do the address translation based on the
+ * device overriding the defaults used in the dma-mapping API.
  */
 #ifdef CONFIG_ARCH_OMAP1510
-#define bus_to_lbus(x)	((x) + (OMAP1510_LB_OFFSET - PHYS_OFFSET))
-#define lbus_to_bus(x)	((x) - (OMAP1510_LB_OFFSET - PHYS_OFFSET))
-#endif
+
+#define virt_to_lbus(x)		((x) - PAGE_OFFSET + OMAP1510_LB_OFFSET)
+#define lbus_to_virt(x)		((x) - OMAP1510_LB_OFFSET + PAGE_OFFSET)
+#define is_lbus_device(dev)	(cpu_is_omap1510() && dev->coherent_dma_mask == 0x0fffffff)
+
+#define __arch_page_to_dma(dev, page)	({is_lbus_device(dev) ? \
+					(dma_addr_t)virt_to_lbus(page_address(page)) : \
+					(dma_addr_t)__virt_to_bus(page_address(page));})
+
+#define __arch_dma_to_virt(dev, addr)	({is_lbus_device(dev) ? \
+					lbus_to_virt(addr) : \
+					__bus_to_virt(addr);})
+
+#define __arch_virt_to_dma(dev, addr)	({is_lbus_device(dev) ? \
+					virt_to_lbus(addr) : \
+					__virt_to_bus(addr);})
+
+#endif	/* CONFIG_ARCH_OMAP1510 */
 
 #define PHYS_TO_NID(addr) (0)
 #endif
diff --git a/include/asm-arm/arch-omap/pm.h b/include/asm-arm/arch-omap/pm.h
index 2976b46c3..83911b919 100644
--- a/include/asm-arm/arch-omap/pm.h
+++ b/include/asm-arm/arch-omap/pm.h
@@ -85,9 +85,6 @@ extern void omap_pm_idle(void);
 extern void omap_pm_suspend(void);
 extern int omap_cpu_suspend(unsigned short, unsigned short);
 extern int omap_idle_loop_suspend(void);
-extern struct async_struct *omap_pm_sercons;
-extern unsigned int serial_in(struct async_struct *, int);
-extern unsigned int serial_out(struct async_struct *, int, int);
 
 #ifdef CONFIG_ARCH_OMAP1510
 #define OMAP_SRAM_IDLE_SUSPEND	0xd002F000
diff --git a/include/asm-arm/arch-pxa/hardware.h b/include/asm-arm/arch-pxa/hardware.h
index ffd2fa2eb..127fc1af1 100644
--- a/include/asm-arm/arch-pxa/hardware.h
+++ b/include/asm-arm/arch-pxa/hardware.h
@@ -82,6 +82,11 @@ typedef struct { volatile u32 offset[4096]; } __regbase;
  */
 extern void pxa_gpio_mode( int gpio_mode );
 
+/*
+ * Routine to enable or disable CKEN
+ */
+extern void pxa_set_cken(int clock, int enable);
+
 /*
  * return current memory and LCD clock frequency in units of 10kHz
  */
diff --git a/include/asm-arm/arch-rpc/uncompress.h b/include/asm-arm/arch-rpc/uncompress.h
index 4a3036dad..845db9498 100644
--- a/include/asm-arm/arch-rpc/uncompress.h
+++ b/include/asm-arm/arch-rpc/uncompress.h
@@ -56,7 +56,12 @@ static const unsigned long palette_4[16] = {
 #define palette_setpixel(p)	*(unsigned long *)(IO_START+0x00400000) = 0x10000000|((p) & 255)
 #define palette_write(v)	*(unsigned long *)(IO_START+0x00400000) = 0x00000000|((v) & 0x00ffffff)
 
-static struct param_struct *params = (struct param_struct *)PARAMS_PHYS;
+/*
+ * params_phys is a linker defined symbol - see
+ * arch/arm/boot/compressed/Makefile
+ */
+extern struct param_struct params_phys;
+#define params (&params_phys)
 
 #ifndef STANDALONE_DEBUG 
 /*
diff --git a/include/asm-arm/arch-s3c2410/hardware.h b/include/asm-arm/arch-s3c2410/hardware.h
index 2e1235a55..d434d77fe 100644
--- a/include/asm-arm/arch-s3c2410/hardware.h
+++ b/include/asm-arm/arch-s3c2410/hardware.h
@@ -26,6 +26,41 @@ extern unsigned long s3c2410_pclk;
 extern unsigned long s3c2410_hclk;
 extern unsigned long s3c2410_fclk;
 
+/* external functions for GPIO support
+ *
+ * These allow various different clients to access the same GPIO
+ * registers without conflicting. If your driver only owns the entire
+ * GPIO register, then it is safe to ioremap/__raw_{read|write} to it.
+*/
+
+/* s3c2410_gpio_cfgpin
+ *
+ * set the configuration of the given pin to the value passed.
+ *
+ * eg:
+ *    s3c2410_gpio_cfgpin(S3C2410_GPA0, S3C2410_GPA0_ADDR0);
+ *    s3c2410_gpio_cfgpin(S3C2410_GPE8, S3C2410_GPE8_SDDAT1);
+*/
+
+extern void s3c2410_gpio_cfgpin(unsigned int pin, unsigned int function);
+
+/* s3c2410_gpio_pullup
+ *
+ * configure the pull-up control on the given pin
+ *
+ * to = 1 => disable the pull-up
+ *      0 => enable the pull-up
+ *
+ * eg;
+ *
+ *   s3c2410_gpio_pullup(S3C2410_GPB0, 0);
+ *   s3c2410_gpio_pullup(S3C2410_GPE8, 0);
+*/
+
+extern void s3c2410_gpio_pullup(unsigned int pin, unsigned int to);
+
+extern void s3c2410_gpio_setpin(unsigned int pin, unsigned int to);
+
 #endif /* __ASSEMBLY__ */
 
 #include <asm/sizes.h>
diff --git a/include/asm-arm/arch-s3c2410/regs-gpio.h b/include/asm-arm/arch-s3c2410/regs-gpio.h
index a8cc78960..661cf97ac 100644
--- a/include/asm-arm/arch-s3c2410/regs-gpio.h
+++ b/include/asm-arm/arch-s3c2410/regs-gpio.h
@@ -1,7 +1,7 @@
 /* linux/include/asm/hardware/s3c2410/
  *
- * Copyright (c) 2003 Simtec Electronics <linux@simtec.co.uk>
- *		      http://www.simtec.co.uk/products/SWLINUX/
+ * Copyright (c) 2003,2004 Simtec Electronics <linux@simtec.co.uk>
+ *		           http://www.simtec.co.uk/products/SWLINUX/
  *
  * 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
@@ -13,12 +13,31 @@
  *    19-06-2003     BJD     Created file
  *    23-06-2003     BJD     Updated GSTATUS registers
  *    12-03-2004     BJD     Updated include protection
+ *    20-07-2004     BJD     Added GPIO pin numbers, added Port A definitions
  */
 
 
 #ifndef __ASM_ARCH_REGS_GPIO_H
 #define __ASM_ARCH_REGS_GPIO_H "$Id: gpio.h,v 1.5 2003/05/19 12:51:08 ben Exp $"
 
+#define S3C2410_GPIONO(bank,offset) ((bank) + (offset))
+
+#define S3C2410_GPIO_BANKA   (32*0)
+#define S3C2410_GPIO_BANKB   (32*1)
+#define S3C2410_GPIO_BANKC   (32*2)
+#define S3C2410_GPIO_BANKD   (32*3)
+#define S3C2410_GPIO_BANKE   (32*4)
+#define S3C2410_GPIO_BANKF   (32*5)
+#define S3C2410_GPIO_BANKG   (32*6)
+#define S3C2410_GPIO_BANKH   (32*7)
+
+#define S3C2410_GPIO_BASE(pin)   ((((pin) & ~31) >> 1) + S3C2410_VA_GPIO)
+#define S3C2410_GPIO_OFFSET(pin) ((pin) & 31)
+
+/* general configuration options */
+
+#define S3C2410_GPIO_LEAVE   (0xFFFFFFFF)
+
 /* configure GPIO ports A..G */
 
 #define S3C2410_GPIOREG(x) ((x) + S3C2410_VA_GPIO)
@@ -29,6 +48,98 @@
 #define S3C2410_GPACON	   S3C2410_GPIOREG(0x00)
 #define S3C2410_GPADAT	   S3C2410_GPIOREG(0x04)
 
+#define S3C2410_GPA0         S3C2410_GPIONO(S3C2410_GPIO_BANKA, 0)
+#define S3C2410_GPA0_OUT     (0<<0)
+#define S3C2410_GPA0_ADDR0   (1<<0)
+
+#define S3C2410_GPA1         S3C2410_GPIONO(S3C2410_GPIO_BANKA, 1)
+#define S3C2410_GPA1_OUT     (0<<1)
+#define S3C2410_GPA1_ADDR16  (1<<1)
+
+#define S3C2410_GPA2         S3C2410_GPIONO(S3C2410_GPIO_BANKA, 2)
+#define S3C2410_GPA2_OUT     (0<<2)
+#define S3C2410_GPA2_ADDR17  (1<<2)
+
+#define S3C2410_GPA3         S3C2410_GPIONO(S3C2410_GPIO_BANKA, 3)
+#define S3C2410_GPA3_OUT     (0<<3)
+#define S3C2410_GPA3_ADDR18  (1<<3)
+
+#define S3C2410_GPA4         S3C2410_GPIONO(S3C2410_GPIO_BANKA, 4)
+#define S3C2410_GPA4_OUT     (0<<4)
+#define S3C2410_GPA4_ADDR19  (1<<4)
+
+#define S3C2410_GPA5         S3C2410_GPIONO(S3C2410_GPIO_BANKA, 5)
+#define S3C2410_GPA5_OUT     (0<<5)
+#define S3C2410_GPA5_ADDR20  (1<<5)
+
+#define S3C2410_GPA6         S3C2410_GPIONO(S3C2410_GPIO_BANKA, 6)
+#define S3C2410_GPA6_OUT     (0<<6)
+#define S3C2410_GPA6_ADDR21  (1<<6)
+
+#define S3C2410_GPA7         S3C2410_GPIONO(S3C2410_GPIO_BANKA, 7)
+#define S3C2410_GPA7_OUT     (0<<7)
+#define S3C2410_GPA7_ADDR22  (1<<7)
+
+#define S3C2410_GPA8         S3C2410_GPIONO(S3C2410_GPIO_BANKA, 8)
+#define S3C2410_GPA8_OUT     (0<<8)
+#define S3C2410_GPA8_ADDR23  (1<<8)
+
+#define S3C2410_GPA9         S3C2410_GPIONO(S3C2410_GPIO_BANKA, 9)
+#define S3C2410_GPA9_OUT     (0<<9)
+#define S3C2410_GPA9_ADDR24  (1<<9)
+
+#define S3C2410_GPA10        S3C2410_GPIONO(S3C2410_GPIO_BANKA, 10)
+#define S3C2410_GPA10_OUT    (0<<10)
+#define S3C2410_GPA10_ADDR25 (1<<10)
+
+#define S3C2410_GPA11        S3C2410_GPIONO(S3C2410_GPIO_BANKA, 11)
+#define S3C2410_GPA11_OUT    (0<<11)
+#define S3C2410_GPA11_ADDR26 (1<<11)
+
+#define S3C2410_GPA12        S3C2410_GPIONO(S3C2410_GPIO_BANKA, 12)
+#define S3C2410_GPA12_OUT    (0<<12)
+#define S3C2410_GPA12_nGCS1  (1<<12)
+
+#define S3C2410_GPA13        S3C2410_GPIONO(S3C2410_GPIO_BANKA, 13)
+#define S3C2410_GPA13_OUT    (0<<13)
+#define S3C2410_GPA13_nGCS2  (1<<13)
+
+#define S3C2410_GPA14        S3C2410_GPIONO(S3C2410_GPIO_BANKA, 14)
+#define S3C2410_GPA14_OUT    (0<<14)
+#define S3C2410_GPA14_nGCS3  (1<<14)
+
+#define S3C2410_GPA15        S3C2410_GPIONO(S3C2410_GPIO_BANKA, 15)
+#define S3C2410_GPA15_OUT    (0<<15)
+#define S3C2410_GPA15_nGCS4  (1<<15)
+
+#define S3C2410_GPA16        S3C2410_GPIONO(S3C2410_GPIO_BANKA, 16)
+#define S3C2410_GPA16_OUT    (0<<16)
+#define S3C2410_GPA16_nGCS5  (1<<16)
+
+#define S3C2410_GPA17        S3C2410_GPIONO(S3C2410_GPIO_BANKA, 17)
+#define S3C2410_GPA17_OUT    (0<<17)
+#define S3C2410_GPA17_CLE    (1<<17)
+
+#define S3C2410_GPA18        S3C2410_GPIONO(S3C2410_GPIO_BANKA, 18)
+#define S3C2410_GPA18_OUT    (0<<18)
+#define S3C2410_GPA18_ALE    (1<<18)
+
+#define S3C2410_GPA19        S3C2410_GPIONO(S3C2410_GPIO_BANKA, 19)
+#define S3C2410_GPA19_OUT    (0<<19)
+#define S3C2410_GPA19_nFWE   (1<<19)
+
+#define S3C2410_GPA20        S3C2410_GPIONO(S3C2410_GPIO_BANKA, 20)
+#define S3C2410_GPA20_OUT    (0<<20)
+#define S3C2410_GPA20_nFRE   (1<<20)
+
+#define S3C2410_GPA21        S3C2410_GPIONO(S3C2410_GPIO_BANKA, 21)
+#define S3C2410_GPA21_OUT    (0<<21)
+#define S3C2410_GPA21_nRSTOUT (1<<21)
+
+#define S3C2410_GPA22        S3C2410_GPIONO(S3C2410_GPIO_BANKA, 22)
+#define S3C2410_GPA22_OUT    (0<<22)
+#define S3C2410_GPA22_nFCE   (1<<22)
+
 /* 0x08 and 0x0c are reserved */
 
 /* GPB is 10 IO pins, each configured by 2 bits each in GPBCON.
@@ -44,49 +155,60 @@
 
 /* no i/o pin in port b can have value 3! */
 
+#define S3C2410_GPB0         S3C2410_GPIONO(S3C2410_GPIO_BANKB, 0)
 #define S3C2410_GPB0_INP     (0x00 << 0)
 #define S3C2410_GPB0_OUTP    (0x01 << 0)
 #define S3C2410_GPB0_TOUT0   (0x02 << 0)
 
+#define S3C2410_GPB1         S3C2410_GPIONO(S3C2410_GPIO_BANKB, 1)
 #define S3C2410_GPB1_INP     (0x00 << 2)
 #define S3C2410_GPB1_OUTP    (0x01 << 2)
 #define S3C2410_GPB1_TOUT1   (0x02 << 2)
 
+#define S3C2410_GPB2         S3C2410_GPIONO(S3C2410_GPIO_BANKB, 2)
 #define S3C2410_GPB2_INP     (0x00 << 4)
 #define S3C2410_GPB2_OUTP    (0x01 << 4)
 #define S3C2410_GPB2_TOUT2   (0x02 << 4)
 
+#define S3C2410_GPB3         S3C2410_GPIONO(S3C2410_GPIO_BANKB, 3)
 #define S3C2410_GPB3_INP     (0x00 << 6)
 #define S3C2410_GPB3_OUTP    (0x01 << 6)
 #define S3C2410_GPB3_TOUT3   (0x02 << 6)
 
+#define S3C2410_GPB4         S3C2410_GPIONO(S3C2410_GPIO_BANKB, 4)
 #define S3C2410_GPB4_INP     (0x00 << 8)
 #define S3C2410_GPB4_OUTP    (0x01 << 8)
 #define S3C2410_GPB4_TCLK0   (0x02 << 8)
 #define S3C2410_GPB4_MASK    (0x03 << 8)
 
+#define S3C2410_GPB5         S3C2410_GPIONO(S3C2410_GPIO_BANKB, 5)
 #define S3C2410_GPB5_INP     (0x00 << 10)
 #define S3C2410_GPB5_OUTP    (0x01 << 10)
 #define S3C2410_GPB5_nXBACK  (0x02 << 10)
 
+#define S3C2410_GPB6         S3C2410_GPIONO(S3C2410_GPIO_BANKB, 6)
 #define S3C2410_GPB6_INP     (0x00 << 12)
 #define S3C2410_GPB6_OUTP    (0x01 << 12)
 #define S3C2410_GPB6_nXBREQ  (0x02 << 12)
 
+#define S3C2410_GPB7         S3C2410_GPIONO(S3C2410_GPIO_BANKB, 7)
 #define S3C2410_GPB7_INP     (0x00 << 14)
 #define S3C2410_GPB7_OUTP    (0x01 << 14)
 #define S3C2410_GPB7_nXDACK1 (0x02 << 14)
 
+#define S3C2410_GPB8         S3C2410_GPIONO(S3C2410_GPIO_BANKB, 8)
 #define S3C2410_GPB8_INP     (0x00 << 16)
 #define S3C2410_GPB8_OUTP    (0x01 << 16)
 #define S3C2410_GPB8_nXDREQ1 (0x02 << 16)
 
+#define S3C2410_GPB9         S3C2410_GPIONO(S3C2410_GPIO_BANKB, 9)
 #define S3C2410_GPB9_INP     (0x00 << 18)
 #define S3C2410_GPB9_OUTP    (0x01 << 18)
 #define S3C2410_GPB9_nXDACK0 (0x02 << 18)
 
-#define S3C2410_GPB10_INP     (0x00 << 18)
-#define S3C2410_GPB10_OUTP    (0x01 << 18)
+#define S3C2410_GPB10        S3C2410_GPIONO(S3C2410_GPIO_BANKB, 10)
+#define S3C2410_GPB10_INP    (0x00 << 18)
+#define S3C2410_GPB10_OUTP   (0x01 << 18)
 #define S3C2410_GPB10_nXDRE0 (0x02 << 18)
 
 /* Port C consits of 16 GPIO/Special function
@@ -99,66 +221,82 @@
 #define S3C2410_GPCDAT	   S3C2410_GPIOREG(0x24)
 #define S3C2410_GPCUP	   S3C2410_GPIOREG(0x28)
 
+#define S3C2410_GPC0            S3C2410_GPIONO(S3C2410_GPIO_BANKC, 0)
 #define S3C2410_GPC0_INP	(0x00 << 0)
 #define S3C2410_GPC0_OUTP	(0x01 << 0)
 #define S3C2410_GPC0_LEND	(0x02 << 0)
 
+#define S3C2410_GPC1            S3C2410_GPIONO(S3C2410_GPIO_BANKC, 1)
 #define S3C2410_GPC1_INP	(0x00 << 2)
 #define S3C2410_GPC1_OUTP	(0x01 << 2)
 #define S3C2410_GPC1_VCLK	(0x02 << 2)
 
+#define S3C2410_GPC2            S3C2410_GPIONO(S3C2410_GPIO_BANKC, 2)
 #define S3C2410_GPC2_INP	(0x00 << 4)
 #define S3C2410_GPC2_OUTP	(0x01 << 4)
 #define S3C2410_GPC2_VLINE	(0x02 << 4)
 
+#define S3C2410_GPC3            S3C2410_GPIONO(S3C2410_GPIO_BANKC, 3)
 #define S3C2410_GPC3_INP	(0x00 << 6)
 #define S3C2410_GPC3_OUTP	(0x01 << 6)
 #define S3C2410_GPC3_VFRAME	(0x02 << 6)
 
+#define S3C2410_GPC4            S3C2410_GPIONO(S3C2410_GPIO_BANKC, 4)
 #define S3C2410_GPC4_INP	(0x00 << 8)
 #define S3C2410_GPC4_OUTP	(0x01 << 8)
 #define S3C2410_GPC4_VM		(0x02 << 8)
 
+#define S3C2410_GPC5            S3C2410_GPIONO(S3C2410_GPIO_BANKC, 5)
 #define S3C2410_GPC5_INP	(0x00 << 10)
 #define S3C2410_GPC5_OUTP	(0x01 << 10)
 #define S3C2410_GPC5_LCDVF0	(0x02 << 10)
 
+#define S3C2410_GPC6            S3C2410_GPIONO(S3C2410_GPIO_BANKC, 6)
 #define S3C2410_GPC6_INP	(0x00 << 12)
 #define S3C2410_GPC6_OUTP	(0x01 << 12)
 #define S3C2410_GPC6_LCDVF1	(0x02 << 12)
 
+#define S3C2410_GPC7            S3C2410_GPIONO(S3C2410_GPIO_BANKC, 7)
 #define S3C2410_GPC7_INP	(0x00 << 14)
 #define S3C2410_GPC7_OUTP	(0x01 << 14)
 #define S3C2410_GPC7_LCDVF2	(0x02 << 14)
 
+#define S3C2410_GPC8            S3C2410_GPIONO(S3C2410_GPIO_BANKC, 8)
 #define S3C2410_GPC8_INP	(0x00 << 16)
 #define S3C2410_GPC8_OUTP	(0x01 << 16)
 #define S3C2410_GPC8_VD0	(0x02 << 16)
 
+#define S3C2410_GPC9            S3C2410_GPIONO(S3C2410_GPIO_BANKC, 9)
 #define S3C2410_GPC9_INP	(0x00 << 18)
 #define S3C2410_GPC9_OUTP	(0x01 << 18)
 #define S3C2410_GPC9_VD1	(0x02 << 18)
 
+#define S3C2410_GPC10           S3C2410_GPIONO(S3C2410_GPIO_BANKC, 10)
 #define S3C2410_GPC10_INP	(0x00 << 20)
 #define S3C2410_GPC10_OUTP	(0x01 << 20)
 #define S3C2410_GPC10_VD2	(0x02 << 20)
 
+#define S3C2410_GPC11           S3C2410_GPIONO(S3C2410_GPIO_BANKC, 11)
 #define S3C2410_GPC11_INP	(0x00 << 22)
 #define S3C2410_GPC11_OUTP	(0x01 << 22)
 #define S3C2410_GPC11_VD3	(0x02 << 22)
 
+#define S3C2410_GPC12           S3C2410_GPIONO(S3C2410_GPIO_BANKC, 12)
 #define S3C2410_GPC12_INP	(0x00 << 24)
 #define S3C2410_GPC12_OUTP	(0x01 << 24)
 #define S3C2410_GPC12_VD4	(0x02 << 24)
 
+#define S3C2410_GPC13           S3C2410_GPIONO(S3C2410_GPIO_BANKC, 13)
 #define S3C2410_GPC13_INP	(0x00 << 26)
 #define S3C2410_GPC13_OUTP	(0x01 << 26)
 #define S3C2410_GPC13_VD5	(0x02 << 26)
 
+#define S3C2410_GPC14           S3C2410_GPIONO(S3C2410_GPIO_BANKC, 14)
 #define S3C2410_GPC14_INP	(0x00 << 28)
 #define S3C2410_GPC14_OUTP	(0x01 << 28)
 #define S3C2410_GPC14_VD6	(0x02 << 28)
 
+#define S3C2410_GPC15           S3C2410_GPIONO(S3C2410_GPIO_BANKC, 15)
 #define S3C2410_GPC15_INP	(0x00 << 30)
 #define S3C2410_GPC15_OUTP	(0x01 << 30)
 #define S3C2410_GPC15_VD7	(0x02 << 30)
@@ -173,66 +311,82 @@
 #define S3C2410_GPDDAT	   S3C2410_GPIOREG(0x34)
 #define S3C2410_GPDUP	   S3C2410_GPIOREG(0x38)
 
+#define S3C2410_GPD0            S3C2410_GPIONO(S3C2410_GPIO_BANKD, 0)
 #define S3C2410_GPD0_INP	(0x00 << 0)
 #define S3C2410_GPD0_OUTP	(0x01 << 0)
 #define S3C2410_GPD0_VD8	(0x02 << 0)
 
+#define S3C2410_GPD1            S3C2410_GPIONO(S3C2410_GPIO_BANKD, 1)
 #define S3C2410_GPD1_INP	(0x00 << 2)
 #define S3C2410_GPD1_OUTP	(0x01 << 2)
 #define S3C2410_GPD1_VD9	(0x02 << 2)
 
+#define S3C2410_GPD2            S3C2410_GPIONO(S3C2410_GPIO_BANKD, 2)
 #define S3C2410_GPD2_INP	(0x00 << 4)
 #define S3C2410_GPD2_OUTP	(0x01 << 4)
 #define S3C2410_GPD2_VD10	(0x02 << 4)
 
+#define S3C2410_GPD3            S3C2410_GPIONO(S3C2410_GPIO_BANKD, 3)
 #define S3C2410_GPD3_INP	(0x00 << 6)
 #define S3C2410_GPD3_OUTP	(0x01 << 6)
 #define S3C2410_GPD3_VD11	(0x02 << 6)
 
+#define S3C2410_GPD4            S3C2410_GPIONO(S3C2410_GPIO_BANKD, 4)
 #define S3C2410_GPD4_INP	(0x00 << 8)
 #define S3C2410_GPD4_OUTP	(0x01 << 8)
 #define S3C2410_GPD4_VD12	(0x02 << 8)
 
+#define S3C2410_GPD5            S3C2410_GPIONO(S3C2410_GPIO_BANKD, 5)
 #define S3C2410_GPD5_INP	(0x00 << 10)
 #define S3C2410_GPD5_OUTP	(0x01 << 10)
 #define S3C2410_GPD5_VD13	(0x02 << 10)
 
+#define S3C2410_GPD6            S3C2410_GPIONO(S3C2410_GPIO_BANKD, 6)
 #define S3C2410_GPD6_INP	(0x00 << 12)
 #define S3C2410_GPD6_OUTP	(0x01 << 12)
 #define S3C2410_GPD6_VD14	(0x02 << 12)
 
+#define S3C2410_GPD7            S3C2410_GPIONO(S3C2410_GPIO_BANKD, 7)
 #define S3C2410_GPD7_INP	(0x00 << 14)
 #define S3C2410_GPD7_OUTP	(0x01 << 14)
 #define S3C2410_GPD7_VD15	(0x02 << 14)
 
+#define S3C2410_GPD8            S3C2410_GPIONO(S3C2410_GPIO_BANKD, 8)
 #define S3C2410_GPD8_INP	(0x00 << 16)
 #define S3C2410_GPD8_OUTP	(0x01 << 16)
 #define S3C2410_GPD8_VD16	(0x02 << 16)
 
+#define S3C2410_GPD9            S3C2410_GPIONO(S3C2410_GPIO_BANKD, 9)
 #define S3C2410_GPD9_INP	(0x00 << 18)
 #define S3C2410_GPD9_OUTP	(0x01 << 18)
 #define S3C2410_GPD9_VD17	(0x02 << 18)
 
+#define S3C2410_GPD10           S3C2410_GPIONO(S3C2410_GPIO_BANKD, 10)
 #define S3C2410_GPD10_INP	(0x00 << 20)
 #define S3C2410_GPD10_OUTP	(0x01 << 20)
 #define S3C2410_GPD10_VD18	(0x02 << 20)
 
+#define S3C2410_GPD11           S3C2410_GPIONO(S3C2410_GPIO_BANKD, 11)
 #define S3C2410_GPD11_INP	(0x00 << 22)
 #define S3C2410_GPD11_OUTP	(0x01 << 22)
 #define S3C2410_GPD11_VD19	(0x02 << 22)
 
+#define S3C2410_GPD12           S3C2410_GPIONO(S3C2410_GPIO_BANKD, 12)
 #define S3C2410_GPD12_INP	(0x00 << 24)
 #define S3C2410_GPD12_OUTP	(0x01 << 24)
 #define S3C2410_GPD12_VD20	(0x02 << 24)
 
+#define S3C2410_GPD13           S3C2410_GPIONO(S3C2410_GPIO_BANKD, 13)
 #define S3C2410_GPD13_INP	(0x00 << 26)
 #define S3C2410_GPD13_OUTP	(0x01 << 26)
 #define S3C2410_GPD13_VD21	(0x02 << 26)
 
+#define S3C2410_GPD14           S3C2410_GPIONO(S3C2410_GPIO_BANKD, 14)
 #define S3C2410_GPD14_INP	(0x00 << 28)
 #define S3C2410_GPD14_OUTP	(0x01 << 28)
 #define S3C2410_GPD14_VD22	(0x02 << 28)
 
+#define S3C2410_GPD15           S3C2410_GPIONO(S3C2410_GPIO_BANKD, 15)
 #define S3C2410_GPD15_INP	(0x00 << 30)
 #define S3C2410_GPD15_OUTP	(0x01 << 30)
 #define S3C2410_GPD15_VD23	(0x02 << 30)
@@ -247,71 +401,87 @@
 #define S3C2410_GPEDAT	   S3C2410_GPIOREG(0x44)
 #define S3C2410_GPEUP	   S3C2410_GPIOREG(0x48)
 
+#define S3C2410_GPE0           S3C2410_GPIONO(S3C2410_GPIO_BANKE, 0)
 #define S3C2410_GPE0_INP       (0x00 << 0)
 #define S3C2410_GPE0_OUTP      (0x01 << 0)
 #define S3C2410_GPE0_I2SLRCK   (0x02 << 0)
 #define S3C2410_GPE0_MASK      (0x03 << 0)
 
+#define S3C2410_GPE1           S3C2410_GPIONO(S3C2410_GPIO_BANKE, 1)
 #define S3C2410_GPE1_INP       (0x00 << 2)
 #define S3C2410_GPE1_OUTP      (0x01 << 2)
 #define S3C2410_GPE1_I2SSCLK   (0x02 << 2)
 #define S3C2410_GPE1_MASK      (0x03 << 2)
 
+#define S3C2410_GPE2           S3C2410_GPIONO(S3C2410_GPIO_BANKE, 2)
 #define S3C2410_GPE2_INP       (0x00 << 4)
 #define S3C2410_GPE2_OUTP      (0x01 << 4)
 #define S3C2410_GPE2_CDCLK     (0x02 << 4)
 
+#define S3C2410_GPE3           S3C2410_GPIONO(S3C2410_GPIO_BANKE, 3)
 #define S3C2410_GPE3_INP       (0x00 << 6)
 #define S3C2410_GPE3_OUTP      (0x01 << 6)
 #define S3C2410_GPE3_I2SSDI    (0x02 << 6)
 #define S3C2410_GPE3_MASK      (0x03 << 6)
 
+#define S3C2410_GPE4           S3C2410_GPIONO(S3C2410_GPIO_BANKE, 4)
 #define S3C2410_GPE4_INP       (0x00 << 8)
 #define S3C2410_GPE4_OUTP      (0x01 << 8)
 #define S3C2410_GPE4_I2SSDO    (0x02 << 8)
 #define S3C2410_GPE4_MASK      (0x03 << 8)
 
+#define S3C2410_GPE5           S3C2410_GPIONO(S3C2410_GPIO_BANKE, 5)
 #define S3C2410_GPE5_INP       (0x00 << 10)
 #define S3C2410_GPE5_OUTP      (0x01 << 10)
 #define S3C2410_GPE5_SDCLK     (0x02 << 10)
 
+#define S3C2410_GPE6           S3C2410_GPIONO(S3C2410_GPIO_BANKE, 6)
 #define S3C2410_GPE6_INP       (0x00 << 12)
 #define S3C2410_GPE6_OUTP      (0x01 << 12)
 #define S3C2410_GPE6_SDCLK     (0x02 << 12)
 
+#define S3C2410_GPE7           S3C2410_GPIONO(S3C2410_GPIO_BANKE, 7)
 #define S3C2410_GPE7_INP       (0x00 << 14)
 #define S3C2410_GPE7_OUTP      (0x01 << 14)
 #define S3C2410_GPE7_SDCMD     (0x02 << 14)
 
+#define S3C2410_GPE8           S3C2410_GPIONO(S3C2410_GPIO_BANKE, 8)
 #define S3C2410_GPE8_INP       (0x00 << 16)
 #define S3C2410_GPE8_OUTP      (0x01 << 16)
 #define S3C2410_GPE8_SDDAT1    (0x02 << 16)
 
+#define S3C2410_GPE9           S3C2410_GPIONO(S3C2410_GPIO_BANKE, 9)
 #define S3C2410_GPE9_INP       (0x00 << 18)
 #define S3C2410_GPE9_OUTP      (0x01 << 18)
 #define S3C2410_GPE9_SDDAT2    (0x02 << 18)
 
+#define S3C2410_GPE10          S3C2410_GPIONO(S3C2410_GPIO_BANKE, 10)
 #define S3C2410_GPE10_INP      (0x00 << 20)
 #define S3C2410_GPE10_OUTP     (0x01 << 20)
 #define S3C2410_GPE10_SDDAT3   (0x02 << 20)
 
+#define S3C2410_GPE11          S3C2410_GPIONO(S3C2410_GPIO_BANKE, 11)
 #define S3C2410_GPE11_INP      (0x00 << 22)
 #define S3C2410_GPE11_OUTP     (0x01 << 22)
 #define S3C2410_GPE11_SPIMISO0 (0x02 << 22)
 
+#define S3C2410_GPE12          S3C2410_GPIONO(S3C2410_GPIO_BANKE, 12)
 #define S3C2410_GPE12_INP      (0x00 << 24)
 #define S3C2410_GPE12_OUTP     (0x01 << 24)
 #define S3C2410_GPE12_SPIMOSI0 (0x02 << 24)
 
+#define S3C2410_GPE13          S3C2410_GPIONO(S3C2410_GPIO_BANKE, 13)
 #define S3C2410_GPE13_INP      (0x00 << 26)
 #define S3C2410_GPE13_OUTP     (0x01 << 26)
 #define S3C2410_GPE13_SPICLK0  (0x02 << 26)
 
+#define S3C2410_GPE14          S3C2410_GPIONO(S3C2410_GPIO_BANKE, 14)
 #define S3C2410_GPE14_INP      (0x00 << 28)
 #define S3C2410_GPE14_OUTP     (0x01 << 28)
 #define S3C2410_GPE14_IICSCL   (0x02 << 28)
 #define S3C2410_GPE14_MASK     (0x03 << 28)
 
+#define S3C2410_GPE15          S3C2410_GPIONO(S3C2410_GPIO_BANKE, 15)
 #define S3C2410_GPE15_INP      (0x00 << 30)
 #define S3C2410_GPE15_OUTP     (0x01 << 30)
 #define S3C2410_GPE15_IICSDA   (0x02 << 30)
@@ -333,35 +503,42 @@
 #define S3C2410_GPFDAT	   S3C2410_GPIOREG(0x54)
 #define S3C2410_GPFUP	   S3C2410_GPIOREG(0x58)
 
-
+#define S3C2410_GPF0        S3C2410_GPIONO(S3C2410_GPIO_BANKF, 0)
 #define S3C2410_GPF0_INP    (0x00 << 0)
 #define S3C2410_GPF0_OUTP   (0x01 << 0)
 #define S3C2410_GPF0_EINT0  (0x02 << 0)
 
+#define S3C2410_GPF1        S3C2410_GPIONO(S3C2410_GPIO_BANKF, 1)
 #define S3C2410_GPF1_INP    (0x00 << 2)
 #define S3C2410_GPF1_OUTP   (0x01 << 2)
 #define S3C2410_GPF1_EINT1  (0x02 << 2)
 
+#define S3C2410_GPF2        S3C2410_GPIONO(S3C2410_GPIO_BANKF, 2)
 #define S3C2410_GPF2_INP    (0x00 << 4)
 #define S3C2410_GPF2_OUTP   (0x01 << 4)
 #define S3C2410_GPF2_EINT2  (0x02 << 4)
 
+#define S3C2410_GPF3        S3C2410_GPIONO(S3C2410_GPIO_BANKF, 3)
 #define S3C2410_GPF3_INP    (0x00 << 6)
 #define S3C2410_GPF3_OUTP   (0x01 << 6)
 #define S3C2410_GPF3_EINT3  (0x02 << 6)
 
+#define S3C2410_GPF4        S3C2410_GPIONO(S3C2410_GPIO_BANKF, 4)
 #define S3C2410_GPF4_INP    (0x00 << 8)
 #define S3C2410_GPF4_OUTP   (0x01 << 8)
 #define S3C2410_GPF4_EINT4  (0x02 << 8)
 
+#define S3C2410_GPF5        S3C2410_GPIONO(S3C2410_GPIO_BANKF, 5)
 #define S3C2410_GPF5_INP    (0x00 << 10)
 #define S3C2410_GPF5_OUTP   (0x01 << 10)
 #define S3C2410_GPF5_EINT5  (0x02 << 10)
 
+#define S3C2410_GPF6        S3C2410_GPIONO(S3C2410_GPIO_BANKF, 6)
 #define S3C2410_GPF6_INP    (0x00 << 12)
 #define S3C2410_GPF6_OUTP   (0x01 << 12)
 #define S3C2410_GPF6_EINT6  (0x02 << 12)
 
+#define S3C2410_GPF7        S3C2410_GPIONO(S3C2410_GPIO_BANKF, 7)
 #define S3C2410_GPF7_INP    (0x00 << 14)
 #define S3C2410_GPF7_OUTP   (0x01 << 14)
 #define S3C2410_GPF7_EINT7  (0x02 << 14)
@@ -378,74 +555,90 @@
 #define S3C2410_GPGDAT	   S3C2410_GPIOREG(0x64)
 #define S3C2410_GPGUP	   S3C2410_GPIOREG(0x68)
 
+#define S3C2410_GPG0          S3C2410_GPIONO(S3C2410_GPIO_BANKG, 0)
 #define S3C2410_GPG0_INP      (0x00 << 0)
 #define S3C2410_GPG0_OUTP     (0x01 << 0)
 #define S3C2410_GPG0_EINT8    (0x02 << 0)
 
+#define S3C2410_GPG1          S3C2410_GPIONO(S3C2410_GPIO_BANKG, 1)
 #define S3C2410_GPG1_INP      (0x00 << 2)
 #define S3C2410_GPG1_OUTP     (0x01 << 2)
 #define S3C2410_GPG1_EINT9    (0x02 << 2)
 
+#define S3C2410_GPG2          S3C2410_GPIONO(S3C2410_GPIO_BANKG, 2)
 #define S3C2410_GPG2_INP      (0x00 << 4)
 #define S3C2410_GPG2_OUTP     (0x01 << 4)
 #define S3C2410_GPG2_EINT10   (0x02 << 4)
 
+#define S3C2410_GPG3          S3C2410_GPIONO(S3C2410_GPIO_BANKG, 3)
 #define S3C2410_GPG3_INP      (0x00 << 6)
 #define S3C2410_GPG3_OUTP     (0x01 << 6)
 #define S3C2410_GPG3_EINT11   (0x02 << 6)
 
+#define S3C2410_GPG4          S3C2410_GPIONO(S3C2410_GPIO_BANKG, 4)
 #define S3C2410_GPG4_INP      (0x00 << 8)
 #define S3C2410_GPG4_OUTP     (0x01 << 8)
 #define S3C2410_GPG4_EINT12   (0x02 << 8)
 #define S3C2410_GPG4_LCDPWREN (0x03 << 8)
 
+#define S3C2410_GPG5          S3C2410_GPIONO(S3C2410_GPIO_BANKG, 5)
 #define S3C2410_GPG5_INP      (0x00 << 10)
 #define S3C2410_GPG5_OUTP     (0x01 << 10)
 #define S3C2410_GPG5_EINT13   (0x02 << 10)
 #define S3C2410_GPG5_SPIMISO1 (0x03 << 10)
 
+#define S3C2410_GPG6          S3C2410_GPIONO(S3C2410_GPIO_BANKG, 6)
 #define S3C2410_GPG6_INP      (0x00 << 12)
 #define S3C2410_GPG6_OUTP     (0x01 << 12)
 #define S3C2410_GPG6_EINT14   (0x02 << 12)
 #define S3C2410_GPG6_SPIMOSI1 (0x03 << 12)
 
+#define S3C2410_GPG7          S3C2410_GPIONO(S3C2410_GPIO_BANKG, 7)
 #define S3C2410_GPG7_INP      (0x00 << 14)
 #define S3C2410_GPG7_OUTP     (0x01 << 14)
 #define S3C2410_GPG7_EINT15   (0x02 << 14)
 #define S3C2410_GPG7_SPICLK1  (0x03 << 14)
 
+#define S3C2410_GPG8          S3C2410_GPIONO(S3C2410_GPIO_BANKG, 8)
 #define S3C2410_GPG8_INP      (0x00 << 16)
 #define S3C2410_GPG8_OUTP     (0x01 << 16)
 #define S3C2410_GPG8_EINT16   (0x02 << 16)
 
+#define S3C2410_GPG9          S3C2410_GPIONO(S3C2410_GPIO_BANKG, 9)
 #define S3C2410_GPG9_INP      (0x00 << 18)
 #define S3C2410_GPG9_OUTP     (0x01 << 18)
 #define S3C2410_GPG9_EINT17   (0x02 << 18)
 
+#define S3C2410_GPG10         S3C2410_GPIONO(S3C2410_GPIO_BANKG, 10)
 #define S3C2410_GPG10_INP     (0x00 << 20)
 #define S3C2410_GPG10_OUTP    (0x01 << 20)
 #define S3C2410_GPG10_EINT18  (0x02 << 20)
 
+#define S3C2410_GPG10         S3C2410_GPIONO(S3C2410_GPIO_BANKG, 10)
 #define S3C2410_GPG11_INP     (0x00 << 22)
 #define S3C2410_GPG11_OUTP    (0x01 << 22)
 #define S3C2410_GPG11_EINT19  (0x02 << 22)
 #define S3C2410_GPG11_TCLK1   (0x03 << 22)
 
+#define S3C2410_GPG10         S3C2410_GPIONO(S3C2410_GPIO_BANKG, 10)
 #define S3C2410_GPG12_INP     (0x00 << 24)
 #define S3C2410_GPG12_OUTP    (0x01 << 24)
 #define S3C2410_GPG12_EINT18  (0x02 << 24)
 #define S3C2410_GPG12_XMON    (0x03 << 24)
 
+#define S3C2410_GPG10         S3C2410_GPIONO(S3C2410_GPIO_BANKG, 10)
 #define S3C2410_GPG13_INP     (0x00 << 26)
 #define S3C2410_GPG13_OUTP    (0x01 << 26)
 #define S3C2410_GPG13_EINT18  (0x02 << 26)
 #define S3C2410_GPG13_nXPON   (0x03 << 26)
 
+#define S3C2410_GPG10         S3C2410_GPIONO(S3C2410_GPIO_BANKG, 10)
 #define S3C2410_GPG14_INP     (0x00 << 28)
 #define S3C2410_GPG14_OUTP    (0x01 << 28)
 #define S3C2410_GPG14_EINT18  (0x02 << 28)
 #define S3C2410_GPG14_YMON    (0x03 << 28)
 
+#define S3C2410_GPG10         S3C2410_GPIONO(S3C2410_GPIO_BANKG, 10)
 #define S3C2410_GPG15_INP     (0x00 << 30)
 #define S3C2410_GPG15_OUTP    (0x01 << 30)
 #define S3C2410_GPG15_EINT18  (0x02 << 30)
@@ -466,51 +659,62 @@
 #define S3C2410_GPHDAT	   S3C2410_GPIOREG(0x74)
 #define S3C2410_GPHUP	   S3C2410_GPIOREG(0x78)
 
+#define S3C2410_GPH0        S3C2410_GPIONO(S3C2410_GPIO_BANKH, 0)
 #define S3C2410_GPH0_INP    (0x00 << 0)
 #define S3C2410_GPH0_OUTP   (0x01 << 0)
 #define S3C2410_GPH0_nCTS0  (0x02 << 0)
 
+#define S3C2410_GPH1        S3C2410_GPIONO(S3C2410_GPIO_BANKH, 1)
 #define S3C2410_GPH1_INP    (0x00 << 2)
 #define S3C2410_GPH1_OUTP   (0x01 << 2)
 #define S3C2410_GPH1_nRTS0  (0x02 << 2)
 
+#define S3C2410_GPH2        S3C2410_GPIONO(S3C2410_GPIO_BANKH, 2)
 #define S3C2410_GPH2_INP    (0x00 << 4)
 #define S3C2410_GPH2_OUTP   (0x01 << 4)
 #define S3C2410_GPH2_TXD0   (0x02 << 4)
 
+#define S3C2410_GPH3        S3C2410_GPIONO(S3C2410_GPIO_BANKH, 3)
 #define S3C2410_GPH3_INP    (0x00 << 6)
 #define S3C2410_GPH3_OUTP   (0x01 << 6)
 #define S3C2410_GPH3_RXD0   (0x02 << 6)
 
+#define S3C2410_GPH4        S3C2410_GPIONO(S3C2410_GPIO_BANKH, 4)
 #define S3C2410_GPH4_INP    (0x00 << 8)
 #define S3C2410_GPH4_OUTP   (0x01 << 8)
 #define S3C2410_GPH4_TXD1   (0x02 << 8)
 
+#define S3C2410_GPH5        S3C2410_GPIONO(S3C2410_GPIO_BANKH, 5)
 #define S3C2410_GPH5_INP    (0x00 << 10)
 #define S3C2410_GPH5_OUTP   (0x01 << 10)
 #define S3C2410_GPH5_RXD1   (0x02 << 10)
 
+#define S3C2410_GPH6        S3C2410_GPIONO(S3C2410_GPIO_BANKH, 6)
 #define S3C2410_GPH6_INP    (0x00 << 12)
 #define S3C2410_GPH6_OUTP   (0x01 << 12)
 #define S3C2410_GPH6_TXD2   (0x02 << 12)
 #define S3C2410_GPH6_nRTS1  (0x03 << 12)
 
+#define S3C2410_GPH7        S3C2410_GPIONO(S3C2410_GPIO_BANKH, 7)
 #define S3C2410_GPH7_INP    (0x00 << 14)
 #define S3C2410_GPH7_OUTP   (0x01 << 14)
 #define S3C2410_GPH7_RXD2   (0x02 << 14)
 #define S3C2410_GPH7_nCTS1  (0x03 << 14)
 
+#define S3C2410_GPH8        S3C2410_GPIONO(S3C2410_GPIO_BANKH, 8)
 #define S3C2410_GPH8_INP    (0x00 << 16)
 #define S3C2410_GPH8_OUTP   (0x01 << 16)
 #define S3C2410_GPH8_UCLK   (0x02 << 16)
 
-#define S3C2410_GPH9_INP     (0x00 << 18)
-#define S3C2410_GPH9_OUTP    (0x01 << 18)
-#define S3C2410_GPH9_CLKOUT0 (0x02 << 18)
+#define S3C2410_GPH9          S3C2410_GPIONO(S3C2410_GPIO_BANKH, 9)
+#define S3C2410_GPH9_INP      (0x00 << 18)
+#define S3C2410_GPH9_OUTP     (0x01 << 18)
+#define S3C2410_GPH9_CLKOUT0  (0x02 << 18)
 
-#define S3C2410_GPH10_INP   (0x00 << 20)
-#define S3C2410_GPH10_OUTP  (0x01 << 20)
-#define S3C2410_GPH10_CLKOUT1  (0x02 << 20)
+#define S3C2410_GPH10         S3C2410_GPIONO(S3C2410_GPIO_BANKH, 10)
+#define S3C2410_GPH10_INP     (0x00 << 20)
+#define S3C2410_GPH10_OUTP    (0x01 << 20)
+#define S3C2410_GPH10_CLKOUT1 (0x02 << 20)
 
 /* miscellaneous control */
 
diff --git a/include/asm-arm/arch-s3c2410/regs-serial.h b/include/asm-arm/arch-s3c2410/regs-serial.h
index 56455c34e..b8dce8a1a 100644
--- a/include/asm-arm/arch-s3c2410/regs-serial.h
+++ b/include/asm-arm/arch-s3c2410/regs-serial.h
@@ -106,8 +106,23 @@
 
 /* fifo size information */
 
-#define S3C2410_UFCON_RXC(fcon)	  (((fcon) & S3C2410_UFSTAT_RXMASK) >> S3C2410_UFSTAT_RXSHIFT)
-#define S3C2410_UFCON_TXC(fcon)	  (((fcon) & S3C2410_UFSTAT_TXMASK) >> S3C2410_UFSTAT_TXSHIFT)
+#ifndef __ASSEMBLY__
+static inline int S3C2410_UFCON_RXC(int fcon)
+{
+	if (fcon & S3C2410_UFSTAT_RXFULL)
+		return 16;
+
+	return ((fcon) & S3C2410_UFSTAT_RXMASK) >> S3C2410_UFSTAT_RXSHIFT;
+}
+
+static inline int S3C2410_UFCON_TXC(int fcon)
+{
+	if (fcon & S3C2410_UFSTAT_TXFULL)
+		return 16;
+
+	return ((fcon) & S3C2410_UFSTAT_TXMASK) >> S3C2410_UFSTAT_TXSHIFT;
+}
+#endif /* __ASSEMBLY__ */
 
 #define S3C2410_UMSTAT_CTS	  (1<<0)
 #define S3C2410_UMSTAT_DeltaCTS	  (1<<2)
diff --git a/include/asm-arm/arch-sa1100/dma.h b/include/asm-arm/arch-sa1100/dma.h
index 8927a3d26..3d60ed9f8 100644
--- a/include/asm-arm/arch-sa1100/dma.h
+++ b/include/asm-arm/arch-sa1100/dma.h
@@ -129,21 +129,4 @@ extern void sa1100_reset_dma(dma_regs_t *regs);
 
 #define sa1100_clear_dma(regs)	((regs)->ClrDCSR = DCSR_IE|DCSR_RUN|DCSR_STRTA|DCSR_STRTB)
 
-
-#ifdef CONFIG_SA1111
-static inline void
-__arch_adjust_zones(int node, unsigned long *size, unsigned long *holes)
-{
-	unsigned int sz = 256;
-
-	if (node != 0)
-		sz = 0;
-
-	size[1] = size[0] - sz;
-	size[0] = sz;
-}
-
-#define arch_adjust_zones(node,size,holes) __arch_adjust_zones(node,size,holes)
-#endif
-
 #endif /* _ASM_ARCH_DMA_H */
diff --git a/include/asm-arm/arch-sa1100/irqs.h b/include/asm-arm/arch-sa1100/irqs.h
index 4d906d33a..7c6ac3e5f 100644
--- a/include/asm-arm/arch-sa1100/irqs.h
+++ b/include/asm-arm/arch-sa1100/irqs.h
@@ -121,10 +121,35 @@
 #define IRQ_S0_BVD1_STSCHG	(IRQ_BOARD_END + 53)
 #define IRQ_S1_BVD1_STSCHG	(IRQ_BOARD_END + 54)
 
+#define IRQ_LOCOMO_START	(IRQ_BOARD_END)
+#define IRQ_LOCOMO_KEY		(IRQ_BOARD_END + 0)
+#define IRQ_LOCOMO_GPIO0	(IRQ_BOARD_END + 1)
+#define IRQ_LOCOMO_GPIO1	(IRQ_BOARD_END + 2)
+#define IRQ_LOCOMO_GPIO2	(IRQ_BOARD_END + 3)
+#define IRQ_LOCOMO_GPIO3	(IRQ_BOARD_END + 4)
+#define IRQ_LOCOMO_GPIO4	(IRQ_BOARD_END + 5)
+#define IRQ_LOCOMO_GPIO5	(IRQ_BOARD_END + 6)
+#define IRQ_LOCOMO_GPIO6	(IRQ_BOARD_END + 7)
+#define IRQ_LOCOMO_GPIO7	(IRQ_BOARD_END + 8)
+#define IRQ_LOCOMO_GPIO8	(IRQ_BOARD_END + 9)
+#define IRQ_LOCOMO_GPIO9	(IRQ_BOARD_END + 10)
+#define IRQ_LOCOMO_GPIO10	(IRQ_BOARD_END + 11)
+#define IRQ_LOCOMO_GPIO11	(IRQ_BOARD_END + 12)
+#define IRQ_LOCOMO_GPIO12	(IRQ_BOARD_END + 13)
+#define IRQ_LOCOMO_GPIO13	(IRQ_BOARD_END + 14)
+#define IRQ_LOCOMO_GPIO14	(IRQ_BOARD_END + 15)
+#define IRQ_LOCOMO_GPIO15	(IRQ_BOARD_END + 16)
+#define IRQ_LOCOMO_LT		(IRQ_BOARD_END + 17)
+#define IRQ_LOCOMO_SPI_RFR	(IRQ_BOARD_END + 18)
+#define IRQ_LOCOMO_SPI_RFW	(IRQ_BOARD_END + 19)
+#define IRQ_LOCOMO_SPI_OVRN	(IRQ_BOARD_END + 20)
+#define IRQ_LOCOMO_SPI_TEND	(IRQ_BOARD_END + 21)
+
 /*
  * Figure out the MAX IRQ number.
  *
  * If we have an SA1111, the max IRQ is S1_BVD1_STSCHG+1.
+ * If we have an LoCoMo, the max IRQ is IRQ_LOCOMO_SPI_TEND+1
  * If graphicsclient or graphicsmaster, we don't have a SA1111.
  * Otherwise, we have the standard IRQs only.
  */
@@ -134,6 +159,8 @@
       defined(CONFIG_SA1100_GRAPHICSMASTER) || \
       defined(CONFIG_SA1100_H3800)
 #define NR_IRQS			(IRQ_BOARD_END)
+#elif defined(CONFIG_SHARP_LOCOMO)
+#define NR_IRQS			(IRQ_LOCOMO_SPI_TEND + 1)
 #else
 #define NR_IRQS			(IRQ_BOARD_START)
 #endif
@@ -150,6 +177,12 @@
 #define IRQ_SYSTEM3_SA1111	(IRQ_BOARD_START + 0)
 #define IRQ_SYSTEM3_SMC9196	(IRQ_BOARD_START + 1)
 
+/* LoCoMo Interrupts (CONFIG_SHARP_LOCOMO) */
+#define IRQ_LOCOMO_KEY_BASE	(IRQ_BOARD_START + 0)
+#define IRQ_LOCOMO_GPIO_BASE	(IRQ_BOARD_START + 1)
+#define IRQ_LOCOMO_LT_BASE	(IRQ_BOARD_START + 2)
+#define IRQ_LOCOMO_SPI_BASE	(IRQ_BOARD_START + 3)
+
 /* H3800-specific IRQs (CONFIG_SA1100_H3800) */
 #define H3800_KPIO_IRQ_START    (IRQ_BOARD_START)
 #define IRQ_H3800_KEY           (IRQ_BOARD_START + 0)
diff --git a/include/asm-arm/arch-sa1100/memory.h b/include/asm-arm/arch-sa1100/memory.h
index 38794846b..32d3d5bde 100644
--- a/include/asm-arm/arch-sa1100/memory.h
+++ b/include/asm-arm/arch-sa1100/memory.h
@@ -8,12 +8,36 @@
 #define __ASM_ARCH_MEMORY_H
 
 #include <linux/config.h>
+#include <asm/sizes.h>
 
 /*
  * Physical DRAM offset is 0xc0000000 on the SA1100
  */
 #define PHYS_OFFSET	(0xc0000000UL)
 
+#ifndef __ASSEMBLY__
+
+#ifdef CONFIG_SA1111
+static inline void
+__arch_adjust_zones(int node, unsigned long *size, unsigned long *holes)
+{
+	unsigned int sz = SZ_1M >> PAGE_SHIFT;
+
+	if (node != 0)
+		sz = 0;
+
+	size[1] = size[0] - sz;
+	size[0] = sz;
+}
+
+#define arch_adjust_zones(node, size, holes) \
+	__arch_adjust_zones(node, size, holes)
+
+#define ISA_DMA_THRESHOLD	(PHYS_OFFSET + SZ_1M - 1)
+
+#endif
+#endif
+
 /*
  * Virtual view <-> DMA view memory address translations
  * virt_to_bus: Used to translate the virtual address to an
diff --git a/include/asm-arm/arch-shark/dma.h b/include/asm-arm/arch-shark/dma.h
index 5c1562f14..fc985d5e6 100644
--- a/include/asm-arm/arch-shark/dma.h
+++ b/include/asm-arm/arch-shark/dma.h
@@ -14,17 +14,5 @@
 #define MAX_DMA_CHANNELS	8
 #define DMA_ISA_CASCADE         4
 
-static inline void __arch_adjust_zones(int node, unsigned long *zone_size, unsigned long *zhole_size) 
-{
-  if (node != 0) return;
-  /* Only the first 4 MB (=1024 Pages) are usable for DMA */
-  zone_size[1] = zone_size[0] - 1024;
-  zone_size[0] = 1024;
-  zhole_size[1] = zhole_size[0];
-  zhole_size[0] = 0;
-}
-
-#define arch_adjust_zones(node,size,holes) __arch_adjust_zones(node,size,holes)
-
 #endif /* _ASM_ARCH_DMA_H */
 
diff --git a/include/asm-arm/arch-shark/memory.h b/include/asm-arm/arch-shark/memory.h
index 7a06f07f6..8ff956d25 100644
--- a/include/asm-arm/arch-shark/memory.h
+++ b/include/asm-arm/arch-shark/memory.h
@@ -10,11 +10,32 @@
 #ifndef __ASM_ARCH_MEMORY_H
 #define __ASM_ARCH_MEMORY_H
 
+#include <asm/sizes.h>
+
 /*
  * Physical DRAM offset.
  */
 #define PHYS_OFFSET     (0x08000000UL)
 
+#ifndef __ASSEMBLY__
+
+static inline void __arch_adjust_zones(int node, unsigned long *zone_size, unsigned long *zhole_size) 
+{
+  if (node != 0) return;
+  /* Only the first 4 MB (=1024 Pages) are usable for DMA */
+  zone_size[1] = zone_size[0] - 1024;
+  zone_size[0] = 1024;
+  zhole_size[1] = zhole_size[0];
+  zhole_size[0] = 0;
+}
+
+#define arch_adjust_zones(node, size, holes) \
+	__arch_adjust_zones(node, size, holes)
+
+#define ISA_DMA_THRESHOLD	(PHYS_OFFSET + SZ_4M - 1)
+
+#endif
+
 #define __virt_to_bus(x)	__virt_to_phys(x)
 #define __bus_to_virt(x)	__phys_to_virt(x)
 
diff --git a/include/asm-arm/arch-versatile/uncompress.h b/include/asm-arm/arch-versatile/uncompress.h
index 148ad3755..0397911fe 100644
--- a/include/asm-arm/arch-versatile/uncompress.h
+++ b/include/asm-arm/arch-versatile/uncompress.h
@@ -17,8 +17,6 @@
  * along with this program; if not, write to the Free Software
  * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA
  */
-#include <linux/kernel.h>
-
 #define AMBA_UART_DR	(*(volatile unsigned char *)0x101F1000)
 #define AMBA_UART_LCRH	(*(volatile unsigned char *)0x101F102C)
 #define AMBA_UART_CR	(*(volatile unsigned char *)0x101F1030)
diff --git a/include/asm-arm/bitops.h b/include/asm-arm/bitops.h
index 7fb3046c6..5f1c975e0 100644
--- a/include/asm-arm/bitops.h
+++ b/include/asm-arm/bitops.h
@@ -227,7 +227,7 @@ extern int _test_and_change_bit_be(int nr, volatile unsigned long * p);
 extern int _find_first_zero_bit_be(void * p, unsigned size);
 extern int _find_next_zero_bit_be(void * p, int size, int offset);
 extern int _find_first_bit_be(const unsigned long *p, unsigned size);
-extern int _find_next_bit_be(unsigned long *p, int size, int offset);
+extern int _find_next_bit_be(const unsigned long *p, int size, int offset);
 
 /*
  * The __* form of bitops are non-atomic and may be reordered.
diff --git a/include/asm-arm/cacheflush.h b/include/asm-arm/cacheflush.h
index 048ed44db..84d875206 100644
--- a/include/asm-arm/cacheflush.h
+++ b/include/asm-arm/cacheflush.h
@@ -97,7 +97,7 @@
  *	Start addresses are inclusive and end addresses are exclusive;
  *	start addresses should be rounded down, end addresses up.
  *
- *	See linux/Documentation/cachetlb.txt for more information.
+ *	See Documentation/cachetlb.txt for more information.
  *	Please note that the implementation of these, and the required
  *	effects are cache-type (VIVT/VIPT/PIPT) specific.
  *
diff --git a/include/asm-arm/checksum.h b/include/asm-arm/checksum.h
index daa0f4e0a..f82f595c7 100644
--- a/include/asm-arm/checksum.h
+++ b/include/asm-arm/checksum.h
@@ -9,6 +9,8 @@
 #ifndef __ASM_ARM_CHECKSUM_H
 #define __ASM_ARM_CHECKSUM_H
 
+#include <linux/in6.h>
+
 /*
  * computes the checksum of a memory block at buff, length len,
  * and adds in "sum" (32-bit)
diff --git a/include/asm-arm/cpu-multi32.h b/include/asm-arm/cpu-multi32.h
index 00f936197..ff48022e4 100644
--- a/include/asm-arm/cpu-multi32.h
+++ b/include/asm-arm/cpu-multi32.h
@@ -7,9 +7,6 @@
  * it under the terms of the GNU General Public License version 2 as
  * published by the Free Software Foundation.
  */
-#ifndef __ASSEMBLY__
-
-#include <asm/memory.h>
 #include <asm/page.h>
 
 struct mm_struct;
@@ -64,16 +61,4 @@ extern struct processor {
 #define cpu_do_idle()			processor._do_idle()
 #define cpu_dcache_clean_area(addr,sz)	processor.dcache_clean_area(addr,sz)
 #define cpu_set_pte(ptep, pte)		processor.set_pte(ptep, pte)
-
-#define cpu_switch_mm(pgd,mm)	processor.switch_mm(__virt_to_phys((unsigned long)(pgd)),mm)
-
-#define cpu_get_pgd()	\
-	({						\
-		unsigned long pg;			\
-		__asm__("mrc	p15, 0, %0, c2, c0, 0"	\
-			 : "=r" (pg) : : "cc");		\
-		pg &= ~0x3fff;				\
-		(pgd_t *)phys_to_virt(pg);		\
-	})
-
-#endif
+#define cpu_do_switch_mm(pgd,mm)	processor.switch_mm(pgd,mm)
diff --git a/include/asm-arm/cpu-single.h b/include/asm-arm/cpu-single.h
index cc213ad71..b5ec5d546 100644
--- a/include/asm-arm/cpu-single.h
+++ b/include/asm-arm/cpu-single.h
@@ -27,12 +27,9 @@
 #define cpu_reset			__cpu_fn(CPU_NAME,_reset)
 #define cpu_do_idle			__cpu_fn(CPU_NAME,_do_idle)
 #define cpu_dcache_clean_area		__cpu_fn(CPU_NAME,_dcache_clean_area)
-#define cpu__switch_mm			__cpu_fn(CPU_NAME,_switch_mm)
+#define cpu_do_switch_mm		__cpu_fn(CPU_NAME,_switch_mm)
 #define cpu_set_pte			__cpu_fn(CPU_NAME,_set_pte)
 
-#ifndef __ASSEMBLY__
-
-#include <asm/memory.h>
 #include <asm/page.h>
 
 struct mm_struct;
@@ -42,20 +39,6 @@ extern void cpu_proc_init(void);
 extern void cpu_proc_fin(void);
 extern int cpu_do_idle(void);
 extern void cpu_dcache_clean_area(void *, int);
-extern void cpu__switch_mm(unsigned long pgd_phys, struct mm_struct *mm);
+extern void cpu_do_switch_mm(unsigned long pgd_phys, struct mm_struct *mm);
 extern void cpu_set_pte(pte_t *ptep, pte_t pte);
-
 extern volatile void cpu_reset(unsigned long addr);
-
-#define cpu_switch_mm(pgd,mm) cpu__switch_mm(__virt_to_phys((unsigned long)(pgd)),mm)
-
-#define cpu_get_pgd()	\
-	({						\
-		unsigned long pg;			\
-		__asm__("mrc	p15, 0, %0, c2, c0, 0"	\
-			 : "=r" (pg) : : "cc");		\
-		pg &= ~0x3fff;				\
-		(pgd_t *)phys_to_virt(pg);		\
-	})
-
-#endif
diff --git a/include/asm-arm/dma-mapping.h b/include/asm-arm/dma-mapping.h
index 011c539c7..b8750631d 100644
--- a/include/asm-arm/dma-mapping.h
+++ b/include/asm-arm/dma-mapping.h
@@ -124,7 +124,7 @@ dma_map_single(struct device *dev, void *cpu_addr, size_t size,
 	       enum dma_data_direction dir)
 {
 	consistent_sync(cpu_addr, size, dir);
-	return __virt_to_bus((unsigned long)cpu_addr);
+	return virt_to_dma(dev, (unsigned long)cpu_addr);
 }
 #else
 extern dma_addr_t dma_map_single(struct device *,void *, size_t, enum dma_data_direction);
@@ -231,7 +231,7 @@ dma_map_sg(struct device *dev, struct scatterlist *sg, int nents,
 	for (i = 0; i < nents; i++, sg++) {
 		char *virt;
 
-		sg->dma_address = page_to_bus(sg->page) + sg->offset;
+		sg->dma_address = page_to_dma(dev, sg->page) + sg->offset;
 		virt = page_address(sg->page) + sg->offset;
 		consistent_sync(virt, sg->length, dir);
 	}
@@ -288,14 +288,14 @@ static inline void
 dma_sync_single_for_cpu(struct device *dev, dma_addr_t handle, size_t size,
 			enum dma_data_direction dir)
 {
-	consistent_sync((void *)__bus_to_virt(handle), size, dir);
+	consistent_sync((void *)dma_to_virt(dev, handle), size, dir);
 }
 
 static inline void
 dma_sync_single_for_device(struct device *dev, dma_addr_t handle, size_t size,
 			   enum dma_data_direction dir)
 {
-	consistent_sync((void *)__bus_to_virt(handle), size, dir);
+	consistent_sync((void *)dma_to_virt(dev, handle), size, dir);
 }
 #else
 extern void dma_sync_single_for_cpu(struct device*, dma_addr_t, size_t, enum dma_data_direction);
diff --git a/include/asm-arm/dma.h b/include/asm-arm/dma.h
index 0dee33c1a..ef41df43a 100644
--- a/include/asm-arm/dma.h
+++ b/include/asm-arm/dma.h
@@ -6,7 +6,6 @@ typedef unsigned int dmach_t;
 #include <linux/config.h>
 #include <linux/spinlock.h>
 #include <asm/system.h>
-#include <asm/memory.h>
 #include <asm/scatterlist.h>
 #include <asm/arch/dma.h>
 
@@ -133,8 +132,4 @@ extern int isa_dma_bridge_buggy;
 #define isa_dma_bridge_buggy    (0)
 #endif
 
-#ifndef arch_adjust_zones
-#define arch_adjust_zones(node,size,holes)
-#endif
-
 #endif /* _ARM_DMA_H */
diff --git a/include/asm-arm/ecard.h b/include/asm-arm/ecard.h
index fe356f18b..0aa513f2c 100644
--- a/include/asm-arm/ecard.h
+++ b/include/asm-arm/ecard.h
@@ -241,11 +241,11 @@ struct ex_ecid {
 
 	unsigned char	r_country;
 
-	unsigned char	r_irqmask;
-	unsigned char	r_irqoff[3];
-
 	unsigned char	r_fiqmask;
 	unsigned char	r_fiqoff[3];
+
+	unsigned char	r_irqmask;
+	unsigned char	r_irqoff[3];
 };
 
 /*
diff --git a/include/asm-arm/fcntl.h b/include/asm-arm/fcntl.h
index da2861ca3..485b6bdf4 100644
--- a/include/asm-arm/fcntl.h
+++ b/include/asm-arm/fcntl.h
@@ -20,6 +20,7 @@
 #define O_NOFOLLOW	0100000	/* don't follow links */
 #define O_DIRECT	0200000	/* direct disk access hint - currently ignored */
 #define O_LARGEFILE	0400000
+#define O_NOATIME	01000000
 
 #define F_DUPFD		0	/* dup */
 #define F_GETFD		1	/* get close_on_exec */
diff --git a/include/asm-arm/fpstate.h b/include/asm-arm/fpstate.h
index 785749b3c..7492cfa21 100644
--- a/include/asm-arm/fpstate.h
+++ b/include/asm-arm/fpstate.h
@@ -13,6 +13,36 @@
 
 #define FP_SIZE 35
 
+#ifndef __ASSEMBLY__
+
+/*
+ * VFP storage area has:
+ *  - FPEXC, FPSCR, FPINST and FPINST2.
+ *  - 16 double precision data registers
+ *  - an implementation-dependant word of state for FLDMX/FSTMX
+ * 
+ *  FPEXC will always be non-zero once the VFP has been used in this process.
+ */
+
+struct vfp_hard_struct {
+	__u64 fpregs[16];
+	__u32 fpmx_state;
+	__u32 fpexc;
+	__u32 fpscr;
+	/*
+	 * VFP implementation specific state
+	 */
+	__u32 fpinst;
+	__u32 fpinst2;
+};
+
+union vfp_state {
+	struct vfp_hard_struct	hard;
+};
+
+extern void vfp_flush_thread(union vfp_state *);
+extern void vfp_release_thread(union vfp_state *);
+
 struct fp_hard_struct {
 	unsigned int save[FP_SIZE];		/* as yet undefined */
 };
@@ -27,3 +57,5 @@ union fp_state {
 };
 
 #endif
+
+#endif
diff --git a/include/asm-arm/hardware/clock.h b/include/asm-arm/hardware/clock.h
index 2fbf6078b..9dfc0624b 100644
--- a/include/asm-arm/hardware/clock.h
+++ b/include/asm-arm/hardware/clock.h
@@ -108,7 +108,7 @@ int clk_set_rate(struct clk *clk, unsigned long rate);
  * Returns success (0) or negative errno.
  */
 int clk_set_parent(struct clk *clk, struct clk *parent);
-                                                                                
+
 /**
  * clk_get_parent - get the parent clock source for this clock
  * @clk: clock source
diff --git a/include/asm-arm/ide.h b/include/asm-arm/ide.h
index b2b9b3da6..cf9b1b35f 100644
--- a/include/asm-arm/ide.h
+++ b/include/asm-arm/ide.h
@@ -17,18 +17,18 @@
 #define MAX_HWIFS	4
 #endif
 
-#if defined(CONFIG_ARCH_LH7A40X) || defined(CONFIG_ARCH_SA1100)
+#if defined(CONFIG_ARCH_SA1100)
 # include <asm/arch/ide.h>	/* obsolete + broken */
 #endif
 
-#if !defined(CONFIG_ARCH_L7200) && !defined(CONFIG_ARCH_LH7A40X)
+#if !defined(CONFIG_ARCH_L7200)
 # define IDE_ARCH_OBSOLETE_INIT
 # ifdef CONFIG_ARCH_CLPS7500
 #  define ide_default_io_ctl(base)	((base) + 0x206) /* obsolete */
 # else
 #  define ide_default_io_ctl(base)	(0)
 # endif
-#endif /* !ARCH_L7200 && !ARCH_LH7A40X */
+#endif /* !ARCH_L7200 */
 
 #define __ide_mm_insw(port,addr,len)	readsw(port,addr,len)
 #define __ide_mm_insl(port,addr,len)	readsl(port,addr,len)
diff --git a/include/asm-arm/io.h b/include/asm-arm/io.h
index 9d7b1be3a..93aa555cf 100644
--- a/include/asm-arm/io.h
+++ b/include/asm-arm/io.h
@@ -263,7 +263,7 @@ out:
  * ioremap and friends.
  *
  * ioremap takes a PCI memory address, as specified in
- * linux/Documentation/IO-mapping.txt.
+ * Documentation/IO-mapping.txt.
  */
 extern void * __ioremap(unsigned long, size_t, unsigned long, unsigned long);
 extern void __iounmap(void *addr);
diff --git a/include/asm-arm/ipc.h b/include/asm-arm/ipc.h
index c330504ba..affae4b95 100644
--- a/include/asm-arm/ipc.h
+++ b/include/asm-arm/ipc.h
@@ -7,7 +7,7 @@
  * See arch/arm/kernel/sys-arm.c for ugly details..
  */
 struct ipc_kludge {
-	struct msgbuf *msgp;
+	struct msgbuf __user *msgp;
 	long msgtyp;
 };
 
diff --git a/include/asm-arm/mach/arch.h b/include/asm-arm/mach/arch.h
index d751faf72..5c37b709f 100644
--- a/include/asm-arm/mach/arch.h
+++ b/include/asm-arm/mach/arch.h
@@ -8,12 +8,6 @@
  * published by the Free Software Foundation.
  */
 
-/*
- * The size of struct machine_desc
- *   (for assembler code)
- */
-#define SIZEOF_MACHINE_DESC	52
-
 #ifndef __ASSEMBLY__
 
 struct tag;
@@ -45,6 +39,7 @@ struct machine_desc {
 					 struct meminfo *);
 	void			(*map_io)(void);/* IO mapping function	*/
 	void			(*init_irq)(void);
+	void			(*init_time)(void);
 	void			(*init_machine)(void);
 };
 
@@ -87,6 +82,9 @@ const struct machine_desc __mach_desc_##_type	\
 #define INITIRQ(_func)				\
 	.init_irq	= _func,
 
+#define INITTIME(_func)				\
+	.init_time	= _func,
+
 #define INIT_MACHINE(_func)			\
 	.init_machine	= _func,
 
diff --git a/include/asm-arm/memory.h b/include/asm-arm/memory.h
index 75da0b9c4..41f117fb5 100644
--- a/include/asm-arm/memory.h
+++ b/include/asm-arm/memory.h
@@ -59,6 +59,20 @@
 
 #ifndef __ASSEMBLY__
 
+/*
+ * The DMA mask corresponding to the maximum bus address allocatable
+ * using GFP_DMA.  The default here places no restriction on DMA
+ * allocations.  This must be the smallest DMA mask in the system,
+ * so a successful GFP_DMA allocation will always satisfy this.
+ */
+#ifndef ISA_DMA_THRESHOLD
+#define ISA_DMA_THRESHOLD	(0xffffffffULL)
+#endif
+
+#ifndef arch_adjust_zones
+#define arch_adjust_zones(node,size,holes) do { } while (0)
+#endif
+
 /*
  * PFNs are used to describe any physical page; this means
  * PFN 0 == physical address 0.
@@ -159,9 +173,18 @@ static inline void *phys_to_virt(unsigned long x)
 #define page_to_phys(page)	(page_to_pfn(page) << PAGE_SHIFT)
 
 /*
+ * Optional device DMA address remapping. Do _not_ use directly!
  * We should really eliminate virt_to_bus() here - it's deprecated.
  */
-#define page_to_bus(page)	(virt_to_bus(page_address(page)))
+#ifndef __arch_page_to_dma
+#define page_to_dma(dev, page)		((dma_addr_t)__virt_to_bus(page_address(page)))
+#define dma_to_virt(dev, addr)		(__bus_to_virt(addr))
+#define virt_to_dma(dev, addr)		(__virt_to_bus(addr))
+#else
+#define page_to_dma(dev, page)		(__arch_page_to_dma(dev, page))
+#define dma_to_virt(dev, addr)		(__arch_dma_to_virt(dev, addr))
+#define virt_to_dma(dev, addr)		(__arch_virt_to_dma(dev, addr))
+#endif
 
 #endif
 
diff --git a/include/asm-arm/proc-fns.h b/include/asm-arm/proc-fns.h
index 9599c6e2f..7bef2bf6b 100644
--- a/include/asm-arm/proc-fns.h
+++ b/include/asm-arm/proc-fns.h
@@ -148,11 +148,27 @@
 # endif
 #endif
 
+#ifndef __ASSEMBLY__
+
 #ifndef MULTI_CPU
 #include "asm/cpu-single.h"
 #else
 #include "asm/cpu-multi32.h"
 #endif
 
+#include <asm/memory.h>
+
+#define cpu_switch_mm(pgd,mm) cpu_do_switch_mm(virt_to_phys(pgd),mm)
+
+#define cpu_get_pgd()	\
+	({						\
+		unsigned long pg;			\
+		__asm__("mrc	p15, 0, %0, c2, c0, 0"	\
+			 : "=r" (pg) : : "cc");		\
+		pg &= ~0x3fff;				\
+		(pgd_t *)phys_to_virt(pg);		\
+	})
+
+#endif /* __ASSEMBLY__ */
 #endif /* __KERNEL__ */
 #endif /* __ASM_PROCFNS_H */
diff --git a/include/asm-arm/processor.h b/include/asm-arm/processor.h
index 3890d6038..e2de28eec 100644
--- a/include/asm-arm/processor.h
+++ b/include/asm-arm/processor.h
@@ -25,7 +25,6 @@
 #include <asm/atomic.h>
 #include <asm/ptrace.h>
 #include <asm/procinfo.h>
-#include <asm/arch/memory.h>
 #include <asm/types.h>
 
 #define KERNEL_STACK_SIZE	PAGE_SIZE
diff --git a/include/asm-arm/resource.h b/include/asm-arm/resource.h
index 9da87b622..748c660ed 100644
--- a/include/asm-arm/resource.h
+++ b/include/asm-arm/resource.h
@@ -16,8 +16,10 @@
 #define RLIMIT_MEMLOCK	8		/* max locked-in-memory address space */
 #define RLIMIT_AS	9		/* address space limit */
 #define RLIMIT_LOCKS	10		/* maximum file locks held */
+#define RLIMIT_SIGPENDING 11		/* max number of pending signals */
+#define RLIMIT_MSGQUEUE 12		/* maximum bytes in POSIX mqueues */
 
-#define RLIM_NLIMITS	11
+#define RLIM_NLIMITS	13
 
 #ifdef __KERNEL__
 
@@ -40,6 +42,8 @@
 	{ RLIM_INFINITY, RLIM_INFINITY },	\
 	{ RLIM_INFINITY, RLIM_INFINITY },	\
 	{ RLIM_INFINITY, RLIM_INFINITY },	\
+	{ MAX_SIGPENDING, MAX_SIGPENDING},	\
+	{ MQ_BYTES_MAX, MQ_BYTES_MAX},		\
 }
 
 #endif /* __KERNEL__ */
diff --git a/include/asm-arm/scatterlist.h b/include/asm-arm/scatterlist.h
index d9c056c77..83b876fb0 100644
--- a/include/asm-arm/scatterlist.h
+++ b/include/asm-arm/scatterlist.h
@@ -1,6 +1,7 @@
 #ifndef _ASMARM_SCATTERLIST_H
 #define _ASMARM_SCATTERLIST_H
 
+#include <asm/memory.h>
 #include <asm/types.h>
 
 struct scatterlist {
@@ -21,6 +22,4 @@ struct scatterlist {
 #define sg_dma_address(sg)      ((sg)->dma_address)
 #define sg_dma_len(sg)          ((sg)->length)
 
-#define ISA_DMA_THRESHOLD (0xffffffff)
-
 #endif /* _ASMARM_SCATTERLIST_H */
diff --git a/include/asm-arm/setup.h b/include/asm-arm/setup.h
index dc58da851..ac311c56e 100644
--- a/include/asm-arm/setup.h
+++ b/include/asm-arm/setup.h
@@ -8,7 +8,7 @@
  * published by the Free Software Foundation.
  *
  *  Structure passed to kernel to tell it about the
- *  hardware it's running on.  See linux/Documentation/arm/Setup
+ *  hardware it's running on.  See Documentation/arm/Setup
  *  for more info.
  */
 #ifndef __ASMARM_SETUP_H
diff --git a/include/asm-arm/signal.h b/include/asm-arm/signal.h
index 6d623e24c..b033e5fd6 100644
--- a/include/asm-arm/signal.h
+++ b/include/asm-arm/signal.h
@@ -133,7 +133,11 @@ typedef unsigned long sigset_t;
 #define SIG_SETMASK        2	/* for setting the signal mask */
 
 /* Type of a signal handler.  */
-typedef void (*__sighandler_t)(int);
+typedef void __signalfn_t(int);
+typedef __signalfn_t __user *__sighandler_t;
+
+typedef void __restorefn_t(void);
+typedef __restorefn_t __user *__sigrestore_t;
 
 #define SIG_DFL	((__sighandler_t)0)	/* default signal handling */
 #define SIG_IGN	((__sighandler_t)1)	/* ignore signal */
@@ -144,13 +148,13 @@ struct old_sigaction {
 	__sighandler_t sa_handler;
 	old_sigset_t sa_mask;
 	unsigned long sa_flags;
-	void (*sa_restorer)(void);
+	__sigrestore_t sa_restorer;
 };
 
 struct sigaction {
 	__sighandler_t sa_handler;
 	unsigned long sa_flags;
-	void (*sa_restorer)(void);
+	__sigrestore_t sa_restorer;
 	sigset_t sa_mask;		/* mask last for extensibility */
 };
 
@@ -177,7 +181,7 @@ struct sigaction {
 #endif /* __KERNEL__ */
 
 typedef struct sigaltstack {
-	void *ss_sp;
+	void __user *ss_sp;
 	int ss_flags;
 	size_t ss_size;
 } stack_t;
diff --git a/include/asm-arm/thread_info.h b/include/asm-arm/thread_info.h
index f67431fdd..b3ef76481 100644
--- a/include/asm-arm/thread_info.h
+++ b/include/asm-arm/thread_info.h
@@ -12,12 +12,13 @@
 
 #ifdef __KERNEL__
 
+#include <asm/fpstate.h>
+
 #ifndef __ASSEMBLY__
 
 struct task_struct;
 struct exec_domain;
 
-#include <asm/fpstate.h>
 #include <asm/ptrace.h>
 #include <asm/types.h>
 #include <asm/domain.h>
@@ -53,7 +54,8 @@ struct thread_info {
 	struct cpu_context_save	cpu_context;	/* cpu context */
 	__u8			used_cp[16];	/* thread used copro */
 	union fp_state		fpstate;
-	struct restart_block    restart_block;
+	union vfp_state		vfpstate;
+	struct restart_block	restart_block;
 };
 
 #define INIT_THREAD_INFO(tsk)						\
@@ -110,6 +112,7 @@ extern void free_thread_info(struct thread_info *);
 #define TI_CPU_SAVE	28
 #define TI_USED_CP	76
 #define TI_FPSTATE	(TI_USED_CP+16)
+#define TI_VFPSTATE	(TI_FPSTATE+FP_SIZE*4)
 
 #endif
 
diff --git a/include/asm-arm/uaccess.h b/include/asm-arm/uaccess.h
index d01310569..51bc2a968 100644
--- a/include/asm-arm/uaccess.h
+++ b/include/asm-arm/uaccess.h
@@ -68,6 +68,7 @@ static inline void set_fs (mm_segment_t fs)
 /* We use 33-bit arithmetic here... */
 #define __range_ok(addr,size) ({ \
 	unsigned long flag, sum; \
+	__chk_user_ptr(addr);	\
 	__asm__("adds %1, %2, %3; sbcccs %1, %1, %0; movcc %0, #0" \
 		: "=&r" (flag), "=&r" (sum) \
 		: "r" (addr), "Ir" (size), "0" (current_thread_info()->addr_limit) \
@@ -117,7 +118,7 @@ extern int __get_user_bad(void);
 
 #define get_user(x,p)							\
 	({								\
-		const register typeof(*(p)) *__p asm("r0") = (p);	\
+		const register typeof(*(p)) __user *__p asm("r0") = (p);\
 		register typeof(*(p)) __r1 asm("r1");			\
 		register int __e asm("r0");				\
 		switch (sizeof(*(__p))) {				\
@@ -156,6 +157,7 @@ extern int __get_user_bad(void);
 do {									\
 	unsigned long __gu_addr = (unsigned long)(ptr);			\
 	unsigned long __gu_val;						\
+	__chk_user_ptr(ptr);						\
 	switch (sizeof(*(ptr))) {					\
 	case 1:	__get_user_asm_byte(__gu_val,__gu_addr,err);	break;	\
 	case 2:	__get_user_asm_half(__gu_val,__gu_addr,err);	break;	\
@@ -236,7 +238,7 @@ extern int __put_user_bad(void);
 #define put_user(x,p)							\
 	({								\
 		const register typeof(*(p)) __r1 asm("r1") = (x);	\
-		const register typeof(*(p)) *__p asm("r0") = (p);	\
+		const register typeof(*(p)) __user *__p asm("r0") = (p);\
 		register int __e asm("r0");				\
 		switch (sizeof(*(__p))) {				\
 		case 1:							\
@@ -273,6 +275,7 @@ extern int __put_user_bad(void);
 do {									\
 	unsigned long __pu_addr = (unsigned long)(ptr);			\
 	__typeof__(*(ptr)) __pu_val = (x);				\
+	__chk_user_ptr(ptr);						\
 	switch (sizeof(*(ptr))) {					\
 	case 1: __put_user_asm_byte(__pu_val,__pu_addr,err);	break;	\
 	case 2: __put_user_asm_half(__pu_val,__pu_addr,err);	break;	\
diff --git a/include/asm-arm26/fcntl.h b/include/asm-arm26/fcntl.h
index da2861ca3..485b6bdf4 100644
--- a/include/asm-arm26/fcntl.h
+++ b/include/asm-arm26/fcntl.h
@@ -20,6 +20,7 @@
 #define O_NOFOLLOW	0100000	/* don't follow links */
 #define O_DIRECT	0200000	/* direct disk access hint - currently ignored */
 #define O_LARGEFILE	0400000
+#define O_NOATIME	01000000
 
 #define F_DUPFD		0	/* dup */
 #define F_GETFD		1	/* get close_on_exec */
diff --git a/include/asm-arm26/io.h b/include/asm-arm26/io.h
index d9885d087..b1f181282 100644
--- a/include/asm-arm26/io.h
+++ b/include/asm-arm26/io.h
@@ -386,7 +386,7 @@ extern void _memset_io(unsigned long, int, size_t);
  * ioremap and friends.
  *
  * ioremap takes a PCI memory address, as specified in
- * linux/Documentation/IO-mapping.txt.
+ * Documentation/IO-mapping.txt.
  */
 extern void * __ioremap(unsigned long, size_t, unsigned long, unsigned long);
 extern void __iounmap(void *addr);
diff --git a/include/asm-arm26/resource.h b/include/asm-arm26/resource.h
index 9da87b622..748c660ed 100644
--- a/include/asm-arm26/resource.h
+++ b/include/asm-arm26/resource.h
@@ -16,8 +16,10 @@
 #define RLIMIT_MEMLOCK	8		/* max locked-in-memory address space */
 #define RLIMIT_AS	9		/* address space limit */
 #define RLIMIT_LOCKS	10		/* maximum file locks held */
+#define RLIMIT_SIGPENDING 11		/* max number of pending signals */
+#define RLIMIT_MSGQUEUE 12		/* maximum bytes in POSIX mqueues */
 
-#define RLIM_NLIMITS	11
+#define RLIM_NLIMITS	13
 
 #ifdef __KERNEL__
 
@@ -40,6 +42,8 @@
 	{ RLIM_INFINITY, RLIM_INFINITY },	\
 	{ RLIM_INFINITY, RLIM_INFINITY },	\
 	{ RLIM_INFINITY, RLIM_INFINITY },	\
+	{ MAX_SIGPENDING, MAX_SIGPENDING},	\
+	{ MQ_BYTES_MAX, MQ_BYTES_MAX},		\
 }
 
 #endif /* __KERNEL__ */
diff --git a/include/asm-arm26/setup.h b/include/asm-arm26/setup.h
index 1e1002711..387c3c6b2 100644
--- a/include/asm-arm26/setup.h
+++ b/include/asm-arm26/setup.h
@@ -8,7 +8,7 @@
  * published by the Free Software Foundation.
  *
  *  Structure passed to kernel to tell it about the
- *  hardware it's running on.  See linux/Documentation/arm/Setup
+ *  hardware it's running on.  See Documentation/arm/Setup
  *  for more info.
  */
 #ifndef __ASMARM_SETUP_H
diff --git a/include/asm-arm26/tlb.h b/include/asm-arm26/tlb.h
index 214185e68..2da30180a 100644
--- a/include/asm-arm26/tlb.h
+++ b/include/asm-arm26/tlb.h
@@ -1,6 +1,7 @@
 #ifndef __ASMARM_TLB_H
 #define __ASMARM_TLB_H
 
+#include <asm/pgalloc.h>
 #include <asm/tlbflush.h>
 
 /*
diff --git a/include/asm-cris/fcntl.h b/include/asm-cris/fcntl.h
index a68e2886e..61c563242 100644
--- a/include/asm-cris/fcntl.h
+++ b/include/asm-cris/fcntl.h
@@ -22,6 +22,7 @@
 #define O_LARGEFILE	0100000
 #define O_DIRECTORY	0200000	/* must be a directory */
 #define O_NOFOLLOW	0400000 /* don't follow links */
+#define O_NOATIME	01000000
 
 #define F_DUPFD		0	/* dup */
 #define F_GETFD		1	/* get f_flags */
diff --git a/include/asm-cris/resource.h b/include/asm-cris/resource.h
index 83561dab9..e33ada08d 100644
--- a/include/asm-cris/resource.h
+++ b/include/asm-cris/resource.h
@@ -15,9 +15,11 @@
 #define RLIMIT_NOFILE	7		/* max number of open files */
 #define RLIMIT_MEMLOCK	8		/* max locked-in-memory address space */
 #define RLIMIT_AS	9		/* address space limit */
-#define RLIMIT_LOCKS   10              /* maximum file locks held */
+#define RLIMIT_LOCKS	10		/* maximum file locks held */
+#define RLIMIT_SIGPENDING 11		/* max number of pending signals */
+#define RLIMIT_MSGQUEUE 12		/* maximum bytes in POSIX mqueues */
 
-#define RLIM_NLIMITS	11
+#define RLIM_NLIMITS	13
 
 /*
  * SuS says limits have to be unsigned.
@@ -38,8 +40,10 @@
 	{             0,             0 },		\
 	{      INR_OPEN,     INR_OPEN  },		\
 	{ RLIM_INFINITY, RLIM_INFINITY },               \
-        { RLIM_INFINITY, RLIM_INFINITY },		\
 	{ RLIM_INFINITY, RLIM_INFINITY },		\
+	{ RLIM_INFINITY, RLIM_INFINITY },		\
+	{ MAX_SIGPENDING, MAX_SIGPENDING },		\
+	{ MQ_BYTES_MAX, MQ_BYTES_MAX },			\
 }
 
 #endif /* __KERNEL__ */
diff --git a/include/asm-cris/setup.h b/include/asm-cris/setup.h
index 832c197ed..b90728652 100644
--- a/include/asm-cris/setup.h
+++ b/include/asm-cris/setup.h
@@ -1,3 +1,6 @@
 #ifndef _CRIS_SETUP_H
 #define _CRIS_SETUP_H
+
+#define COMMAND_LINE_SIZE	256
+
 #endif
diff --git a/include/asm-generic/bitops.h b/include/asm-generic/bitops.h
index 23ac5227b..ce31b739f 100644
--- a/include/asm-generic/bitops.h
+++ b/include/asm-generic/bitops.h
@@ -42,7 +42,7 @@ extern __inline__ int clear_bit(int nr, long * addr)
 	return retval;
 }
 
-extern __inline__ int test_bit(int nr, long * addr)
+extern __inline__ int test_bit(int nr, const unsigned long * addr)
 {
 	int	mask;
 
diff --git a/include/asm-generic/pgtable.h b/include/asm-generic/pgtable.h
index ee74be68c..29573197c 100644
--- a/include/asm-generic/pgtable.h
+++ b/include/asm-generic/pgtable.h
@@ -122,4 +122,8 @@ static inline void ptep_mkdirty(pte_t *ptep)
 #define page_test_and_clear_young(page) (0)
 #endif
 
+#ifndef __HAVE_ARCH_PGD_OFFSET_GATE
+#define pgd_offset_gate(mm, addr)	pgd_offset(mm, addr)
+#endif
+
 #endif /* _ASM_GENERIC_PGTABLE_H */
diff --git a/include/asm-generic/rtc.h b/include/asm-generic/rtc.h
index 1a1ea0200..cef08db34 100644
--- a/include/asm-generic/rtc.h
+++ b/include/asm-generic/rtc.h
@@ -46,7 +46,7 @@ static inline unsigned int get_rtc_time(struct rtc_time *time)
 {
 	unsigned long uip_watchdog = jiffies;
 	unsigned char ctrl;
-#ifdef CONFIG_DECSTATION
+#ifdef CONFIG_MACH_DECSTATION
 	unsigned int real_year;
 #endif
 
@@ -79,7 +79,7 @@ static inline unsigned int get_rtc_time(struct rtc_time *time)
 	time->tm_mday = CMOS_READ(RTC_DAY_OF_MONTH);
 	time->tm_mon = CMOS_READ(RTC_MONTH);
 	time->tm_year = CMOS_READ(RTC_YEAR);
-#ifdef CONFIG_DECSTATION
+#ifdef CONFIG_MACH_DECSTATION
 	real_year = CMOS_READ(RTC_DEC_YEAR);
 #endif
 	ctrl = CMOS_READ(RTC_CONTROL);
@@ -95,7 +95,7 @@ static inline unsigned int get_rtc_time(struct rtc_time *time)
 		BCD_TO_BIN(time->tm_year);
 	}
 
-#ifdef CONFIG_DECSTATION
+#ifdef CONFIG_MACH_DECSTATION
 	time->tm_year += real_year - 72;
 #endif
 
@@ -117,7 +117,7 @@ static inline int set_rtc_time(struct rtc_time *time)
 	unsigned char mon, day, hrs, min, sec;
 	unsigned char save_control, save_freq_select;
 	unsigned int yrs;
-#ifdef CONFIG_DECSTATION
+#ifdef CONFIG_MACH_DECSTATION
 	unsigned int real_yrs, leap_yr;
 #endif
 
@@ -132,7 +132,7 @@ static inline int set_rtc_time(struct rtc_time *time)
 		return -EINVAL;
 
 	spin_lock_irq(&rtc_lock);
-#ifdef CONFIG_DECSTATION
+#ifdef CONFIG_MACH_DECSTATION
 	real_yrs = yrs;
 	leap_yr = ((!((yrs + 1900) % 4) && ((yrs + 1900) % 100)) ||
 			!((yrs + 1900) % 400));
@@ -174,7 +174,7 @@ static inline int set_rtc_time(struct rtc_time *time)
 	save_freq_select = CMOS_READ(RTC_FREQ_SELECT);
 	CMOS_WRITE((save_freq_select|RTC_DIV_RESET2), RTC_FREQ_SELECT);
 
-#ifdef CONFIG_DECSTATION
+#ifdef CONFIG_MACH_DECSTATION
 	CMOS_WRITE(real_yrs, RTC_DEC_YEAR);
 #endif
 	CMOS_WRITE(yrs, RTC_YEAR);
diff --git a/include/asm-generic/siginfo.h b/include/asm-generic/siginfo.h
index fe02b1a4d..f757d2d51 100644
--- a/include/asm-generic/siginfo.h
+++ b/include/asm-generic/siginfo.h
@@ -6,7 +6,7 @@
 
 typedef union sigval {
 	int sival_int;
-	void *sival_ptr;
+	void __user *sival_ptr;
 } sigval_t;
 
 /*
@@ -78,7 +78,7 @@ typedef struct siginfo {
 
 		/* SIGILL, SIGFPE, SIGSEGV, SIGBUS */
 		struct {
-			void *_addr; /* faulting insn/memory ref. */
+			void __user *_addr; /* faulting insn/memory ref. */
 #ifdef __ARCH_SI_TRAPNO
 			int _trapno;	/* TRAP # which caused the signal */
 #endif
diff --git a/include/asm-generic/tlb.h b/include/asm-generic/tlb.h
index 9a15e1544..c2931499b 100644
--- a/include/asm-generic/tlb.h
+++ b/include/asm-generic/tlb.h
@@ -16,6 +16,7 @@
 #include <linux/config.h>
 #include <linux/swap.h>
 #include <linux/vs_memory.h>
+#include <asm/pgalloc.h>
 #include <asm/tlbflush.h>
 
 /*
@@ -148,4 +149,6 @@ static inline void tlb_remove_page(struct mmu_gather *tlb, struct page *page)
 		__pmd_free_tlb(tlb, pmdp);			\
 	} while (0)
 
+#define tlb_migrate_finish(mm) do {} while (0)
+
 #endif /* _ASM_GENERIC__TLB_H */
diff --git a/include/asm-h8300/fcntl.h b/include/asm-h8300/fcntl.h
index a7e7ac01d..355350a57 100644
--- a/include/asm-h8300/fcntl.h
+++ b/include/asm-h8300/fcntl.h
@@ -20,6 +20,7 @@
 #define O_NOFOLLOW	0100000	/* don't follow links */
 #define O_DIRECT	0200000	/* direct disk access hint - currently ignored */
 #define O_LARGEFILE	0400000
+#define O_NOATIME	01000000
 
 #define F_DUPFD		0	/* dup */
 #define F_GETFD		1	/* get close_on_exec */
diff --git a/include/asm-h8300/io.h b/include/asm-h8300/io.h
index ceef5200c..bd9f37cfc 100644
--- a/include/asm-h8300/io.h
+++ b/include/asm-h8300/io.h
@@ -35,27 +35,38 @@
 
 static inline unsigned short _swapw(volatile unsigned short v)
 {
-	unsigned short r,t;
-	__asm__("mov.b %w2,%x1\n\t"
-		"mov.b %x2,%w1\n\t"
-		"mov.w %1,%0"
-		:"=r"(r),"=r"(t)
-		:"r"(v));
+#ifndef H8300_IO_NOSWAP
+	unsigned short r;
+	__asm__("xor.b %w0,%x0\n\t"
+		"xor.b %x0,%w0\n\t"
+		"xor.b %w0,%x0"
+		:"=r"(r)
+		:"0"(v));
 	return r;
+#else
+	return v;
+#endif
 }
 
-static inline unsigned int _swapl(volatile unsigned long v)
+static inline unsigned long _swapl(volatile unsigned long v)
 {
-	unsigned int r,t;
-	__asm__("mov.b %w2,%x1\n\t"
-		"mov.b %x2,%w1\n\t"
-		"mov.w %f1,%e0\n\t"
-		"mov.w %e2,%f1\n\t"
-		"mov.b %w1,%x0\n\t"
-		"mov.b %x1,%w0"
-		:"=r"(r),"=r"(t)
-		:"r"(v));
+#ifndef H8300_IO_NOSWAP
+	unsigned long r;
+	__asm__("xor.b %w0,%x0\n\t"
+		"xor.b %x0,%w0\n\t"
+		"xor.b %w0,%x0\n\t"
+		"xor.w %e0,%f0\n\t"
+		"xor.w %f0,%e0\n\t"
+		"xor.w %e0,%f0\n\t"
+		"xor.b %w0,%x0\n\t"
+		"xor.b %x0,%w0\n\t"
+		"xor.b %w0,%x0"
+		:"=r"(r)
+		:"0"(v));
 	return r;
+#else
+	return v;
+#endif
 }
 
 #define readb(addr) \
@@ -109,12 +120,28 @@ static inline void io_outsw(unsigned int addr, const void *buf, int len)
 
 static inline void io_outsl(unsigned int addr, const void *buf, int len)
 {
-	volatile unsigned int *ap = (volatile unsigned int *) addr;
+	volatile unsigned long *ap = (volatile unsigned long *) addr;
 	unsigned long *bp = (unsigned long *) buf;
 	while (len--)
 		*ap = _swapl(*bp++);
 }
 
+static inline void io_outsw_noswap(unsigned int addr, const void *buf, int len)
+{
+	volatile unsigned short *ap = (volatile unsigned short *) addr;
+	unsigned short *bp = (unsigned short *) buf;
+	while (len--)
+		*ap = *bp++;
+}
+
+static inline void io_outsl_noswap(unsigned int addr, const void *buf, int len)
+{
+	volatile unsigned long *ap = (volatile unsigned long *) addr;
+	unsigned long *bp = (unsigned long *) buf;
+	while (len--)
+		*ap = *bp++;
+}
+
 static inline void io_insb(unsigned int addr, void *buf, int len)
 {
 	volatile unsigned char  *ap_b;
@@ -142,12 +169,28 @@ static inline void io_insw(unsigned int addr, void *buf, int len)
 
 static inline void io_insl(unsigned int addr, void *buf, int len)
 {
-	volatile unsigned int *ap = (volatile unsigned int *) addr;
+	volatile unsigned long *ap = (volatile unsigned long *) addr;
 	unsigned long *bp = (unsigned long *) buf;
 	while (len--)
 		*bp++ = _swapl(*ap);
 }
 
+static inline void io_insw_noswap(unsigned int addr, void *buf, int len)
+{
+	volatile unsigned short *ap = (volatile unsigned short *) addr;
+	unsigned short *bp = (unsigned short *) buf;
+	while (len--)
+		*bp++ = *ap;
+}
+
+static inline void io_insl_noswap(unsigned int addr, void *buf, int len)
+{
+	volatile unsigned long *ap = (volatile unsigned long *) addr;
+	unsigned long *bp = (unsigned long *) buf;
+	while (len--)
+		*bp++ = *ap;
+}
+
 /*
  *	make the short names macros so specific devices
  *	can override them as required
@@ -160,7 +203,8 @@ static inline void io_insl(unsigned int addr, void *buf, int len)
 #define inb(addr)    ((h8300_buswidth(addr))?readw((addr) & ~1) & 0xff:readb(addr))
 #define inw(addr)    _swapw(readw(addr))
 #define inl(addr)    _swapl(readl(addr))
-#define outb(x,addr) ((void)((h8300_buswidth(addr) && ((addr) & 1))?writew(x,(addr) & ~1):writeb(x,addr)))
+#define outb(x,addr) ((void)((h8300_buswidth(addr) && \
+                      ((addr) & 1))?writew(x,(addr) & ~1):writeb(x,addr)))
 #define outw(x,addr) ((void) writew(_swapw(x),addr))
 #define outl(x,addr) ((void) writel(_swapl(x),addr))
 
@@ -227,7 +271,7 @@ static __inline__ unsigned short ctrl_inw(unsigned long addr)
 	return *(volatile unsigned short*)addr;
 }
 
-static __inline__ unsigned int ctrl_inl(unsigned long addr)
+static __inline__ unsigned long ctrl_inl(unsigned long addr)
 {
 	return *(volatile unsigned long*)addr;
 }
@@ -242,7 +286,7 @@ static __inline__ void ctrl_outw(unsigned short b, unsigned long addr)
 	*(volatile unsigned short*)addr = b;
 }
 
-static __inline__ void ctrl_outl(unsigned int b, unsigned long addr)
+static __inline__ void ctrl_outl(unsigned long b, unsigned long addr)
 {
         *(volatile unsigned long*)addr = b;
 }
diff --git a/include/asm-h8300/resource.h b/include/asm-h8300/resource.h
index 38b8e942a..a87720b14 100644
--- a/include/asm-h8300/resource.h
+++ b/include/asm-h8300/resource.h
@@ -16,8 +16,10 @@
 #define RLIMIT_MEMLOCK	8		/* max locked-in-memory address space */
 #define RLIMIT_AS	9		/* address space limit */
 #define RLIMIT_LOCKS	10		/* maximum file locks held */
+#define RLIMIT_SIGPENDING 11		/* max number of pending signals */
+#define RLIMIT_MSGQUEUE 12		/* maximum bytes in POSIX mqueues */
 
-#define RLIM_NLIMITS	11
+#define RLIM_NLIMITS	13
 
 /*
  * SuS says limits have to be unsigned.
@@ -39,7 +41,9 @@
 	{      INR_OPEN,     INR_OPEN  },		\
 	{ RLIM_INFINITY, RLIM_INFINITY },		\
 	{ RLIM_INFINITY, RLIM_INFINITY },		\
-        { RLIM_INFINITY, RLIM_INFINITY },		\
+	{ RLIM_INFINITY, RLIM_INFINITY },		\
+	{ MAX_SIGPENDING, MAX_SIGPENDING },		\
+	{ MQ_BYTES_MAX, MQ_BYTES_MAX },			\
 }
 
 #endif /* __KERNEL__ */
diff --git a/include/asm-h8300/setup.h b/include/asm-h8300/setup.h
index 4fc416e80..e2c600e96 100644
--- a/include/asm-h8300/setup.h
+++ b/include/asm-h8300/setup.h
@@ -1 +1,6 @@
-/* Nothing do */
+#ifndef __H8300_SETUP_H
+#define __H8300_SETUP_H
+
+#define COMMAND_LINE_SIZE	512
+
+#endif
diff --git a/include/asm-i386/apic.h b/include/asm-i386/apic.h
index cd1bb1cf7..95cc9c1ba 100644
--- a/include/asm-i386/apic.h
+++ b/include/asm-i386/apic.h
@@ -41,6 +41,8 @@ static __inline__ void apic_wait_icr_idle(void)
 	do { } while ( apic_read( APIC_ICR ) & APIC_ICR_BUSY );
 }
 
+int get_physical_broadcast(void);
+
 #ifdef CONFIG_X86_GOOD_APIC
 # define FORCE_READ_AROUND_WRITE 0
 # define apic_read_around(x)
diff --git a/include/asm-i386/bitops.h b/include/asm-i386/bitops.h
index 2c6a7bb1e..8fd938fa9 100644
--- a/include/asm-i386/bitops.h
+++ b/include/asm-i386/bitops.h
@@ -34,7 +34,7 @@
  * Note that @nr may be almost arbitrarily large; this function is not
  * restricted to acting on a single-word quantity.
  */
-static __inline__ void set_bit(int nr, volatile unsigned long * addr)
+static inline void set_bit(int nr, volatile unsigned long * addr)
 {
 	__asm__ __volatile__( LOCK_PREFIX
 		"btsl %1,%0"
@@ -51,7 +51,7 @@ static __inline__ void set_bit(int nr, volatile unsigned long * addr)
  * If it's called on the same region of memory simultaneously, the effect
  * may be that only one operation succeeds.
  */
-static __inline__ void __set_bit(int nr, volatile unsigned long * addr)
+static inline void __set_bit(int nr, volatile unsigned long * addr)
 {
 	__asm__(
 		"btsl %1,%0"
@@ -69,7 +69,7 @@ static __inline__ void __set_bit(int nr, volatile unsigned long * addr)
  * you should call smp_mb__before_clear_bit() and/or smp_mb__after_clear_bit()
  * in order to ensure changes are visible on other processors.
  */
-static __inline__ void clear_bit(int nr, volatile unsigned long * addr)
+static inline void clear_bit(int nr, volatile unsigned long * addr)
 {
 	__asm__ __volatile__( LOCK_PREFIX
 		"btrl %1,%0"
@@ -77,7 +77,7 @@ static __inline__ void clear_bit(int nr, volatile unsigned long * addr)
 		:"Ir" (nr));
 }
 
-static __inline__ void __clear_bit(int nr, volatile unsigned long * addr)
+static inline void __clear_bit(int nr, volatile unsigned long * addr)
 {
 	__asm__ __volatile__(
 		"btrl %1,%0"
@@ -96,7 +96,7 @@ static __inline__ void __clear_bit(int nr, volatile unsigned long * addr)
  * If it's called on the same region of memory simultaneously, the effect
  * may be that only one operation succeeds.
  */
-static __inline__ void __change_bit(int nr, volatile unsigned long * addr)
+static inline void __change_bit(int nr, volatile unsigned long * addr)
 {
 	__asm__ __volatile__(
 		"btcl %1,%0"
@@ -113,7 +113,7 @@ static __inline__ void __change_bit(int nr, volatile unsigned long * addr)
  * Note that @nr may be almost arbitrarily large; this function is not
  * restricted to acting on a single-word quantity.
  */
-static __inline__ void change_bit(int nr, volatile unsigned long * addr)
+static inline void change_bit(int nr, volatile unsigned long * addr)
 {
 	__asm__ __volatile__( LOCK_PREFIX
 		"btcl %1,%0"
@@ -129,7 +129,7 @@ static __inline__ void change_bit(int nr, volatile unsigned long * addr)
  * This operation is atomic and cannot be reordered.  
  * It also implies a memory barrier.
  */
-static __inline__ int test_and_set_bit(int nr, volatile unsigned long * addr)
+static inline int test_and_set_bit(int nr, volatile unsigned long * addr)
 {
 	int oldbit;
 
@@ -149,7 +149,7 @@ static __inline__ int test_and_set_bit(int nr, volatile unsigned long * addr)
  * If two examples of this operation race, one can appear to succeed
  * but actually fail.  You must protect multiple accesses with a lock.
  */
-static __inline__ int __test_and_set_bit(int nr, volatile unsigned long * addr)
+static inline int __test_and_set_bit(int nr, volatile unsigned long * addr)
 {
 	int oldbit;
 
@@ -168,7 +168,7 @@ static __inline__ int __test_and_set_bit(int nr, volatile unsigned long * addr)
  * This operation is atomic and cannot be reordered.  
  * It also implies a memory barrier.
  */
-static __inline__ int test_and_clear_bit(int nr, volatile unsigned long * addr)
+static inline int test_and_clear_bit(int nr, volatile unsigned long * addr)
 {
 	int oldbit;
 
@@ -188,7 +188,7 @@ static __inline__ int test_and_clear_bit(int nr, volatile unsigned long * addr)
  * If two examples of this operation race, one can appear to succeed
  * but actually fail.  You must protect multiple accesses with a lock.
  */
-static __inline__ int __test_and_clear_bit(int nr, volatile unsigned long *addr)
+static inline int __test_and_clear_bit(int nr, volatile unsigned long *addr)
 {
 	int oldbit;
 
@@ -200,7 +200,7 @@ static __inline__ int __test_and_clear_bit(int nr, volatile unsigned long *addr)
 }
 
 /* WARNING: non atomic and it can be reordered! */
-static __inline__ int __test_and_change_bit(int nr, volatile unsigned long *addr)
+static inline int __test_and_change_bit(int nr, volatile unsigned long *addr)
 {
 	int oldbit;
 
@@ -219,7 +219,7 @@ static __inline__ int __test_and_change_bit(int nr, volatile unsigned long *addr
  * This operation is atomic and cannot be reordered.  
  * It also implies a memory barrier.
  */
-static __inline__ int test_and_change_bit(int nr, volatile unsigned long* addr)
+static inline int test_and_change_bit(int nr, volatile unsigned long* addr)
 {
 	int oldbit;
 
@@ -244,7 +244,7 @@ static inline int constant_test_bit(int nr, const volatile unsigned long *addr)
 	return ((1UL << (nr & 31)) & (addr[nr >> 5])) != 0;
 }
 
-static __inline__ int variable_test_bit(int nr, const volatile unsigned long * addr)
+static inline int variable_test_bit(int nr, const volatile unsigned long * addr)
 {
 	int oldbit;
 
@@ -270,7 +270,7 @@ static __inline__ int variable_test_bit(int nr, const volatile unsigned long * a
  * Returns the bit-number of the first zero bit, not the number of the byte
  * containing a bit.
  */
-static __inline__ int find_first_zero_bit(const unsigned long *addr, unsigned size)
+static inline int find_first_zero_bit(const unsigned long *addr, unsigned size)
 {
 	int d0, d1, d2;
 	int res;
@@ -294,6 +294,14 @@ static __inline__ int find_first_zero_bit(const unsigned long *addr, unsigned si
 	return res;
 }
 
+/**
+ * find_next_zero_bit - find the first zero bit in a memory region
+ * @addr: The address to base the search on
+ * @offset: The bitnumber to start searching at
+ * @size: The maximum size to search
+ */
+int find_next_zero_bit(const unsigned long *addr, int size, int offset);
+
 /**
  * find_first_bit - find the first set bit in a memory region
  * @addr: The address to start the search at
@@ -302,7 +310,7 @@ static __inline__ int find_first_zero_bit(const unsigned long *addr, unsigned si
  * Returns the bit-number of the first set bit, not the number of the byte
  * containing a bit.
  */
-static __inline__ int find_first_bit(const unsigned long *addr, unsigned size)
+static inline int find_first_bit(const unsigned long *addr, unsigned size)
 {
 	int d0, d1;
 	int res;
@@ -322,71 +330,13 @@ static __inline__ int find_first_bit(const unsigned long *addr, unsigned size)
 	return res;
 }
 
-/**
- * find_next_zero_bit - find the first zero bit in a memory region
- * @addr: The address to base the search on
- * @offset: The bitnumber to start searching at
- * @size: The maximum size to search
- */
-static __inline__ int find_next_zero_bit(const unsigned long *addr, int size, int offset)
-{
-	unsigned long * p = ((unsigned long *) addr) + (offset >> 5);
-	int set = 0, bit = offset & 31, res;
-	
-	if (bit) {
-		/*
-		 * Look for zero in the first 32 bits.
-		 */
-		__asm__("bsfl %1,%0\n\t"
-			"jne 1f\n\t"
-			"movl $32, %0\n"
-			"1:"
-			: "=r" (set)
-			: "r" (~(*p >> bit)));
-		if (set < (32 - bit))
-			return set + offset;
-		set = 32 - bit;
-		p++;
-	}
-	/*
-	 * No zero yet, search remaining full bytes for a zero
-	 */
-	res = find_first_zero_bit (p, size - 32 * (p - (unsigned long *) addr));
-	return (offset + set + res);
-}
-
 /**
  * find_next_bit - find the first set bit in a memory region
  * @addr: The address to base the search on
  * @offset: The bitnumber to start searching at
  * @size: The maximum size to search
  */
-static __inline__ int find_next_bit(const unsigned long *addr, int size, int offset)
-{
-	const unsigned long *p = addr + (offset >> 5);
-	int set = 0, bit = offset & 31, res;
-
-	if (bit) {
-		/*
-		 * Look for nonzero in the first 32 bits:
-		 */
-		__asm__("bsfl %1,%0\n\t"
-			"jne 1f\n\t"
-			"movl $32, %0\n"
-			"1:"
-			: "=r" (set)
-			: "r" (*p >> bit));
-		if (set < (32 - bit))
-			return set + offset;
-		set = 32 - bit;
-		p++;
-	}
-	/*
-	 * No set bit yet, search remaining full words for a bit
-	 */
-	res = find_first_bit (p, size - 32 * (p - addr));
-	return (offset + set + res);
-}
+int find_next_bit(const unsigned long *addr, int size, int offset);
 
 /**
  * ffz - find first zero in word.
@@ -394,7 +344,7 @@ static __inline__ int find_next_bit(const unsigned long *addr, int size, int off
  *
  * Undefined if no zero exists, so code should check against ~0UL first.
  */
-static __inline__ unsigned long ffz(unsigned long word)
+static inline unsigned long ffz(unsigned long word)
 {
 	__asm__("bsfl %1,%0"
 		:"=r" (word)
@@ -408,7 +358,7 @@ static __inline__ unsigned long ffz(unsigned long word)
  *
  * Undefined if no bit exists, so code should check against 0 first.
  */
-static __inline__ unsigned long __ffs(unsigned long word)
+static inline unsigned long __ffs(unsigned long word)
 {
 	__asm__("bsfl %1,%0"
 		:"=r" (word)
@@ -451,7 +401,7 @@ static inline int sched_find_first_bit(const unsigned long *b)
  * the libc and compiler builtin ffs routines, therefore
  * differs in spirit from the above ffz (man ffs).
  */
-static __inline__ int ffs(int x)
+static inline int ffs(int x)
 {
 	int r;
 
diff --git a/include/asm-i386/checksum.h b/include/asm-i386/checksum.h
index 1afe056aa..96e4b2df8 100644
--- a/include/asm-i386/checksum.h
+++ b/include/asm-i386/checksum.h
@@ -43,10 +43,10 @@ unsigned int csum_partial_copy_nocheck ( const char *src, char *dst,
 }
 
 static __inline__
-unsigned int csum_partial_copy_from_user ( const char *src, char *dst,
+unsigned int csum_partial_copy_from_user ( const char __user *src, char *dst,
 						int len, int sum, int *err_ptr)
 {
-	return csum_partial_copy_generic ( src, dst, len, sum, err_ptr, NULL);
+	return csum_partial_copy_generic ( (__force char *)src, dst, len, sum, err_ptr, NULL);
 }
 
 /*
@@ -172,11 +172,13 @@ static __inline__ unsigned short int csum_ipv6_magic(struct in6_addr *saddr,
  *	Copy and checksum to user
  */
 #define HAVE_CSUM_COPY_USER
-static __inline__ unsigned int csum_and_copy_to_user(const char *src, char *dst,
-				    int len, int sum, int *err_ptr)
+static __inline__ unsigned int csum_and_copy_to_user(const char *src, 
+						     char __user *dst,
+						     int len, int sum, 
+						     int *err_ptr)
 {
 	if (access_ok(VERIFY_WRITE, dst, len))
-		return csum_partial_copy_generic(src, dst, len, sum, NULL, err_ptr);
+		return csum_partial_copy_generic(src, (__force char *)dst, len, sum, NULL, err_ptr);
 
 	if (len)
 		*err_ptr = -EFAULT;
diff --git a/include/asm-i386/cpufeature.h b/include/asm-i386/cpufeature.h
index a6fceb3ce..d6005e6e8 100644
--- a/include/asm-i386/cpufeature.h
+++ b/include/asm-i386/cpufeature.h
@@ -47,6 +47,7 @@
 /* Don't duplicate feature flags which are redundant with Intel! */
 #define X86_FEATURE_SYSCALL	(1*32+11) /* SYSCALL/SYSRET */
 #define X86_FEATURE_MP		(1*32+19) /* MP Capable. */
+#define X86_FEATURE_NX		(1*32+20) /* Execute Disable */
 #define X86_FEATURE_MMXEXT	(1*32+22) /* AMD MMX extensions */
 #define X86_FEATURE_LM		(1*32+29) /* Long Mode (x86-64) */
 #define X86_FEATURE_3DNOWEXT	(1*32+30) /* AMD 3DNow! extensions */
@@ -100,6 +101,7 @@
 #define cpu_has_xmm		boot_cpu_has(X86_FEATURE_XMM)
 #define cpu_has_ht		boot_cpu_has(X86_FEATURE_HT)
 #define cpu_has_mp		boot_cpu_has(X86_FEATURE_MP)
+#define cpu_has_nx		boot_cpu_has(X86_FEATURE_NX)
 #define cpu_has_k6_mtrr		boot_cpu_has(X86_FEATURE_K6_MTRR)
 #define cpu_has_cyrix_arr	boot_cpu_has(X86_FEATURE_CYRIX_ARR)
 #define cpu_has_centaur_mcr	boot_cpu_has(X86_FEATURE_CENTAUR_MCR)
diff --git a/include/asm-i386/delay.h b/include/asm-i386/delay.h
index 72930c710..456db8501 100644
--- a/include/asm-i386/delay.h
+++ b/include/asm-i386/delay.h
@@ -16,7 +16,7 @@ extern void __const_udelay(unsigned long usecs);
 extern void __delay(unsigned long loops);
 
 #define udelay(n) (__builtin_constant_p(n) ? \
-	((n) > 20000 ? __bad_udelay() : __const_udelay((n) * 0x10c6ul)) : \
+	((n) > 20000 ? __bad_udelay() : __const_udelay((n) * 0x10c7ul)) : \
 	__udelay(n))
 	
 #define ndelay(n) (__builtin_constant_p(n) ? \
diff --git a/include/asm-i386/desc.h b/include/asm-i386/desc.h
index 9361aff2e..5d126f733 100644
--- a/include/asm-i386/desc.h
+++ b/include/asm-i386/desc.h
@@ -44,7 +44,8 @@ __asm__ __volatile__ ("movw %w3,0(%2)\n\t" \
 
 static inline void __set_tss_desc(unsigned int cpu, unsigned int entry, void *addr)
 {
-	_set_tssldt_desc(&cpu_gdt_table[cpu][entry], (int)addr, 235, 0x89);
+	_set_tssldt_desc(&cpu_gdt_table[cpu][entry], (int)addr,
+		offsetof(struct tss_struct, __cacheline_filler) - 1, 0x89);
 }
 
 #define set_tss_desc(cpu,addr) __set_tss_desc(cpu, GDT_ENTRY_TSS, addr)
diff --git a/include/asm-i386/dma-mapping.h b/include/asm-i386/dma-mapping.h
index 410430ccb..79bfab5cb 100644
--- a/include/asm-i386/dma-mapping.h
+++ b/include/asm-i386/dma-mapping.h
@@ -1,6 +1,9 @@
 #ifndef _ASM_I386_DMA_MAPPING_H
 #define _ASM_I386_DMA_MAPPING_H
 
+#include <linux/device.h>
+#include <linux/mm.h>
+
 #include <asm/cache.h>
 #include <asm/io.h>
 #include <asm/scatterlist.h>
diff --git a/include/asm-i386/elf.h b/include/asm-i386/elf.h
index cda7f174b..a53f1fc65 100644
--- a/include/asm-i386/elf.h
+++ b/include/asm-i386/elf.h
@@ -117,7 +117,13 @@ typedef struct user_fxsr_struct elf_fpxregset_t;
 #define AT_SYSINFO_EHDR		33
 
 #ifdef __KERNEL__
-#define SET_PERSONALITY(ex, ibcs2) set_personality((ibcs2)?PER_SVR4:PER_LINUX)
+#define SET_PERSONALITY(ex, ibcs2) do { } while (0)
+
+/*
+ * An executable for which elf_read_implies_exec() returns TRUE will
+ * have the READ_IMPLIES_EXEC personality flag set automatically.
+ */
+#define elf_read_implies_exec_binary(ex, have_pt_gnu_stack)	(!(have_pt_gnu_stack))
 
 extern int dump_task_regs (struct task_struct *, elf_gregset_t *);
 extern int dump_task_fpu (struct task_struct *, elf_fpregset_t *);
diff --git a/include/asm-i386/fcntl.h b/include/asm-i386/fcntl.h
index 41e3c4d91..511cde94a 100644
--- a/include/asm-i386/fcntl.h
+++ b/include/asm-i386/fcntl.h
@@ -20,6 +20,7 @@
 #define O_LARGEFILE	0100000
 #define O_DIRECTORY	0200000	/* must be a directory */
 #define O_NOFOLLOW	0400000 /* don't follow links */
+#define O_NOATIME	01000000
 
 #define F_DUPFD		0	/* dup */
 #define F_GETFD		1	/* get close_on_exec */
diff --git a/include/asm-i386/genapic.h b/include/asm-i386/genapic.h
index cf61fde56..fc813b2e8 100644
--- a/include/asm-i386/genapic.h
+++ b/include/asm-i386/genapic.h
@@ -25,7 +25,6 @@ struct genapic {
 	cpumask_t (*target_cpus)(void);
 	int int_delivery_mode;
 	int int_dest_mode; 
-	int apic_broadcast_id; 
 	int ESR_DISABLE;
 	int apic_destination_logical;
 	unsigned long (*check_apicid_used)(physid_mask_t bitmap, int apicid);
@@ -63,7 +62,7 @@ struct genapic {
 
 	unsigned (*get_apic_id)(unsigned long x);
 	unsigned long apic_id_mask;
-	unsigned int (*cpu_mask_to_apicid)(cpumask_const_t cpumask);
+	unsigned int (*cpu_mask_to_apicid)(cpumask_t cpumask);
 	
 	/* ipi */
 	void (*send_IPI_mask)(cpumask_t mask, int vector);
@@ -78,7 +77,6 @@ struct genapic {
 	.probe = aprobe, \
 	.int_delivery_mode = INT_DELIVERY_MODE, \
 	.int_dest_mode = INT_DEST_MODE, \
-	.apic_broadcast_id = APIC_BROADCAST_ID, \
 	.no_balance_irq = NO_BALANCE_IRQ, \
 	.no_ioapic_check = NO_IOAPIC_CHECK, \
 	.ESR_DISABLE = esr_disable, \
diff --git a/include/asm-i386/hpet.h b/include/asm-i386/hpet.h
index 9382e160c..8fd9f4018 100644
--- a/include/asm-i386/hpet.h
+++ b/include/asm-i386/hpet.h
@@ -57,9 +57,12 @@
 #define HPET_ID_LEGSUP	0x00008000
 #define HPET_ID_NUMBER	0x00001f00
 #define HPET_ID_REV	0x000000ff
+#define	HPET_ID_NUMBER_SHIFT	8
 
 #define HPET_CFG_ENABLE	0x001
 #define HPET_CFG_LEGACY	0x002
+#define	HPET_LEGACY_8254	2
+#define	HPET_LEGACY_RTC		8
 
 #define HPET_TN_ENABLE		0x004
 #define HPET_TN_PERIODIC	0x008
diff --git a/include/asm-i386/ide.h b/include/asm-i386/ide.h
index 0409c22f1..859ebf4da 100644
--- a/include/asm-i386/ide.h
+++ b/include/asm-i386/ide.h
@@ -28,9 +28,6 @@
 static __inline__ int ide_default_irq(unsigned long base)
 {
 	switch (base) {
-#ifdef CONFIG_X86_PC9800
-		case 0x640: return 9;
-#endif
 		case 0x1f0: return 14;
 		case 0x170: return 15;
 		case 0x1e8: return 11;
@@ -45,48 +42,17 @@ static __inline__ int ide_default_irq(unsigned long base)
 static __inline__ unsigned long ide_default_io_base(int index)
 {
 	switch (index) {
-#ifdef CONFIG_X86_PC9800
-		case 0:
-		case 1:	return 0x640;
-#else
 		case 0:	return 0x1f0;
 		case 1:	return 0x170;
 		case 2: return 0x1e8;
 		case 3: return 0x168;
 		case 4: return 0x1e0;
 		case 5: return 0x160;
-#endif
 		default:
 			return 0;
 	}
 }
 
-#ifdef CONFIG_X86_PC9800
-static __inline__ void ide_init_hwif_ports(hw_regs_t *hw, unsigned long data_port,
-	 unsigned long ctrl_port, int *irq)
-{
-	unsigned long reg = data_port;
-	int i;
-
-	unsigned long increment = data_port == 0x640 ? 2 : 1;
-
-	for (i = IDE_DATA_OFFSET; i <= IDE_STATUS_OFFSET; i++) {
-		hw->io_ports[i] = reg;
-		reg += increment;
-	}
-	if (ctrl_port) {
-		hw->io_ports[IDE_CONTROL_OFFSET] = ctrl_port;
-	} else if (data_port == 0x640) {
-		hw->io_ports[IDE_CONTROL_OFFSET] = 0x74c;
-	} else {
-		hw->io_ports[IDE_CONTROL_OFFSET] = hw->io_ports[IDE_DATA_OFFSET] + 0x206;
-	}
-	if (irq != NULL)
-		*irq = 0;
-	hw->io_ports[IDE_IRQ_OFFSET] = 0;
-}
-#endif
-
 #define IDE_ARCH_OBSOLETE_INIT
 #define ide_default_io_ctl(base)	((base) + 0x206) /* obsolete */
 
diff --git a/include/asm-i386/io_apic.h b/include/asm-i386/io_apic.h
index 861eceefc..a387a7f98 100644
--- a/include/asm-i386/io_apic.h
+++ b/include/asm-i386/io_apic.h
@@ -13,7 +13,7 @@
 
 #ifdef CONFIG_X86_IO_APIC
 
-#ifdef CONFIG_PCI_USE_VECTOR
+#ifdef CONFIG_PCI_MSI
 static inline int use_pci_vector(void)	{return 1;}
 static inline void disable_edge_ioapic_vector(unsigned int vector) { }
 static inline void mask_and_ack_level_ioapic_vector(unsigned int vector) { }
@@ -188,15 +188,6 @@ static inline void io_apic_modify(unsigned int apic, unsigned int reg, unsigned
 	*(IO_APIC_BASE(apic)+4) = value;
 }
 
-/*
- * Synchronize the IO-APIC and the CPU by doing
- * a dummy read from the IO-APIC
- */
-static inline void io_apic_sync(unsigned int apic)
-{
-	(void) *(IO_APIC_BASE(apic)+4);
-}
-
 /* 1 if "noapic" boot option passed */
 extern int skip_ioapic_setup;
 
diff --git a/include/asm-i386/mach-bigsmp/mach_apic.h b/include/asm-i386/mach-bigsmp/mach_apic.h
index e7b7b2ddd..233986827 100644
--- a/include/asm-i386/mach-bigsmp/mach_apic.h
+++ b/include/asm-i386/mach-bigsmp/mach_apic.h
@@ -28,18 +28,17 @@ static inline cpumask_t target_cpus(void)
 	static unsigned long cpu = NR_CPUS;
 	do {
 		if (cpu >= NR_CPUS)
-			cpu = first_cpu_const(cpu_online_map);
+			cpu = first_cpu(cpu_online_map);
 		else
-			cpu = next_cpu_const(cpu, cpu_online_map);
+			cpu = next_cpu(cpu, cpu_online_map);
 	} while (cpu >= NR_CPUS);
-	return mk_cpumask_const(cpumask_of_cpu(cpu));
+	return cpumask_of_cpu(cpu);
 }
 #define TARGET_CPUS	(target_cpus())
 
 #define INT_DELIVERY_MODE dest_Fixed
 #define INT_DEST_MODE 1     /* logical delivery broadcast to all procs */
 
-#define APIC_BROADCAST_ID     (0xff)
 static inline unsigned long check_apicid_used(physid_mask_t bitmap, int apicid)
 {
 	return 0;
@@ -150,12 +149,12 @@ static inline int check_phys_apicid_present(int boot_cpu_physical_apicid)
 }
 
 /* As we are using single CPU as destination, pick only one CPU here */
-static inline unsigned int cpu_mask_to_apicid(cpumask_const_t cpumask)
+static inline unsigned int cpu_mask_to_apicid(cpumask_t cpumask)
 {
 	int cpu;
 	int apicid;	
 
-	cpu = first_cpu_const(cpumask);
+	cpu = first_cpu(cpumask);
 	apicid = cpu_to_logical_apicid(cpu);
 	return apicid;
 }
diff --git a/include/asm-i386/mach-bigsmp/mach_mpspec.h b/include/asm-i386/mach-bigsmp/mach_mpspec.h
index cf0b2f643..6b5dadcf1 100644
--- a/include/asm-i386/mach-bigsmp/mach_mpspec.h
+++ b/include/asm-i386/mach-bigsmp/mach_mpspec.h
@@ -1,11 +1,6 @@
 #ifndef __ASM_MACH_MPSPEC_H
 #define __ASM_MACH_MPSPEC_H
 
-/*
- * a maximum of 16 APICs with the current APIC ID architecture.
- */
-#define MAX_APICS 16
-
 #define MAX_IRQ_SOURCES 256
 
 #define MAX_MP_BUSSES 32
diff --git a/include/asm-i386/mach-default/irq_vectors_limits.h b/include/asm-i386/mach-default/irq_vectors_limits.h
index 78c30cbce..b330026e6 100644
--- a/include/asm-i386/mach-default/irq_vectors_limits.h
+++ b/include/asm-i386/mach-default/irq_vectors_limits.h
@@ -1,7 +1,7 @@
 #ifndef _ASM_IRQ_VECTORS_LIMITS_H
 #define _ASM_IRQ_VECTORS_LIMITS_H
 
-#ifdef CONFIG_PCI_USE_VECTOR
+#ifdef CONFIG_PCI_MSI
 #define NR_IRQS FIRST_SYSTEM_VECTOR
 #define NR_IRQ_VECTORS NR_IRQS
 #else
diff --git a/include/asm-i386/mach-default/mach_apic.h b/include/asm-i386/mach-default/mach_apic.h
index 5111b015f..627f1cd08 100644
--- a/include/asm-i386/mach-default/mach_apic.h
+++ b/include/asm-i386/mach-default/mach_apic.h
@@ -2,15 +2,16 @@
 #define __ASM_MACH_APIC_H
 
 #include <mach_apicdef.h>
+#include <asm/smp.h>
 
 #define APIC_DFR_VALUE	(APIC_DFR_FLAT)
 
-static inline cpumask_const_t target_cpus(void)
+static inline cpumask_t target_cpus(void)
 { 
 #ifdef CONFIG_SMP
-	return mk_cpumask_const(cpu_online_map);
+	return cpu_online_map;
 #else
-	return mk_cpumask_const(cpumask_of_cpu(0));
+	return cpumask_of_cpu(0);
 #endif
 } 
 #define TARGET_CPUS (target_cpus())
@@ -23,12 +24,6 @@ static inline cpumask_const_t target_cpus(void)
 #define INT_DELIVERY_MODE dest_LowestPrio
 #define INT_DEST_MODE 1     /* logical delivery broadcast to all procs */
 
-/*
- * this isn't really broadcast, just a (potentially inaccurate) upper
- * bound for valid physical APIC id's
- */
-#define APIC_BROADCAST_ID      0x0F
-
 static inline unsigned long check_apicid_used(physid_mask_t bitmap, int apicid)
 {
 	return physid_isset(apicid, bitmap);
@@ -85,7 +80,10 @@ static inline int cpu_to_logical_apicid(int cpu)
 
 static inline int cpu_present_to_apicid(int mps_cpu)
 {
-	return  mps_cpu;
+	if (mps_cpu < get_physical_broadcast())
+		return  mps_cpu;
+	else
+		return BAD_APICID;
 }
 
 static inline physid_mask_t apicid_to_cpu_present(int phys_apicid)
@@ -118,9 +116,9 @@ static inline int apic_id_registered(void)
 	return physid_isset(GET_APIC_ID(apic_read(APIC_ID)), phys_cpu_present_map);
 }
 
-static inline unsigned int cpu_mask_to_apicid(cpumask_const_t cpumask)
+static inline unsigned int cpu_mask_to_apicid(cpumask_t cpumask)
 {
-	return cpus_coerce_const(cpumask);
+	return cpus_addr(cpumask)[0];
 }
 
 static inline void enable_apic_mode(void)
diff --git a/include/asm-i386/mach-default/mach_mpspec.h b/include/asm-i386/mach-default/mach_mpspec.h
index cf0b2f643..6b5dadcf1 100644
--- a/include/asm-i386/mach-default/mach_mpspec.h
+++ b/include/asm-i386/mach-default/mach_mpspec.h
@@ -1,11 +1,6 @@
 #ifndef __ASM_MACH_MPSPEC_H
 #define __ASM_MACH_MPSPEC_H
 
-/*
- * a maximum of 16 APICs with the current APIC ID architecture.
- */
-#define MAX_APICS 16
-
 #define MAX_IRQ_SOURCES 256
 
 #define MAX_MP_BUSSES 32
diff --git a/include/asm-i386/mach-default/setup_arch_post.h b/include/asm-i386/mach-default/setup_arch_post.h
index 43b3b2d1f..2fc488872 100644
--- a/include/asm-i386/mach-default/setup_arch_post.h
+++ b/include/asm-i386/mach-default/setup_arch_post.h
@@ -6,7 +6,7 @@
  *	use of all of the static functions.
  **/
 
-static inline char * __init machine_specific_memory_setup(void)
+static char * __init machine_specific_memory_setup(void)
 {
 	char *who;
 
diff --git a/include/asm-i386/mach-es7000/mach_apic.h b/include/asm-i386/mach-es7000/mach_apic.h
index 0405b6b42..ceab2c464 100644
--- a/include/asm-i386/mach-es7000/mach_apic.h
+++ b/include/asm-i386/mach-es7000/mach_apic.h
@@ -16,7 +16,7 @@ static inline cpumask_t target_cpus(void)
 #if defined CONFIG_ES7000_CLUSTERED_APIC
 	return CPU_MASK_ALL;
 #else
-	return cpumask_of_cpu(bios_cpu_apicid[smp_processor_id()]);
+	return cpumask_of_cpu(smp_processor_id());
 #endif
 }
 #define TARGET_CPUS	(target_cpus())
@@ -38,7 +38,6 @@ static inline cpumask_t target_cpus(void)
 #define WAKE_SECONDARY_VIA_INIT
 #endif
 
-#define APIC_BROADCAST_ID	(0xff)
 #define NO_IOAPIC_CHECK (1)
 
 static inline unsigned long check_apicid_used(physid_mask_t bitmap, int apicid)
@@ -89,7 +88,7 @@ static inline void clustered_apic_check(void)
 	int apic = bios_cpu_apicid[smp_processor_id()];
 	printk("Enabling APIC mode:  %s.  Using %d I/O APICs, target cpus %lx\n",
 		(apic_version[apic] == 0x14) ? 
-		"Physical Cluster" : "Logical Cluster", nr_ioapics, cpus_coerce(TARGET_CPUS));
+		"Physical Cluster" : "Logical Cluster", nr_ioapics, cpus_addr(TARGET_CPUS)[0]);
 }
 
 static inline int multi_timer_check(int apic, int irq)
@@ -159,14 +158,14 @@ static inline int check_phys_apicid_present(int cpu_physical_apicid)
 	return (1);
 }
 
-static inline unsigned int cpu_mask_to_apicid(cpumask_const_t cpumask)
+static inline unsigned int cpu_mask_to_apicid(cpumask_t cpumask)
 {
 	int num_bits_set;
 	int cpus_found = 0;
 	int cpu;
 	int apicid;	
 
-	num_bits_set = cpus_weight_const(cpumask);
+	num_bits_set = cpus_weight(cpumask);
 	/* Return id to all */
 	if (num_bits_set == NR_CPUS)
 #if defined CONFIG_ES7000_CLUSTERED_APIC
@@ -178,10 +177,10 @@ static inline unsigned int cpu_mask_to_apicid(cpumask_const_t cpumask)
 	 * The cpus in the mask must all be on the apic cluster.  If are not 
 	 * on the same apicid cluster return default value of TARGET_CPUS. 
 	 */
-	cpu = first_cpu_const(cpumask);
+	cpu = first_cpu(cpumask);
 	apicid = cpu_to_logical_apicid(cpu);
 	while (cpus_found < num_bits_set) {
-		if (cpu_isset_const(cpu, cpumask)) {
+		if (cpu_isset(cpu, cpumask)) {
 			int new_apicid = cpu_to_logical_apicid(cpu);
 			if (apicid_cluster(apicid) != 
 					apicid_cluster(new_apicid)){
diff --git a/include/asm-i386/mach-es7000/mach_ipi.h b/include/asm-i386/mach-es7000/mach_ipi.h
index 6b7a56c1d..cb8a2fdb5 100644
--- a/include/asm-i386/mach-es7000/mach_ipi.h
+++ b/include/asm-i386/mach-es7000/mach_ipi.h
@@ -10,9 +10,8 @@ static inline void send_IPI_mask(cpumask_t mask, int vector)
 
 static inline void send_IPI_allbutself(int vector)
 {
-	cpumask_t mask = cpumask_of_cpu(smp_processor_id());
-	cpus_complement(mask);
-	cpus_and(mask, mask, cpu_online_map);
+	cpumask_t mask = cpu_online_map;
+	cpu_clear(smp_processor_id(), mask);
 	if (!cpus_empty(mask))
 		send_IPI_mask(mask, vector);
 }
diff --git a/include/asm-i386/mach-es7000/mach_mpspec.h b/include/asm-i386/mach-es7000/mach_mpspec.h
index ef10cd205..6b5dadcf1 100644
--- a/include/asm-i386/mach-es7000/mach_mpspec.h
+++ b/include/asm-i386/mach-es7000/mach_mpspec.h
@@ -1,11 +1,6 @@
 #ifndef __ASM_MACH_MPSPEC_H
 #define __ASM_MACH_MPSPEC_H
 
-/*
- * a maximum of 256 APICs with the current APIC ID architecture.
- */
-#define MAX_APICS 256
-
 #define MAX_IRQ_SOURCES 256
 
 #define MAX_MP_BUSSES 32
diff --git a/include/asm-i386/mach-generic/mach_apic.h b/include/asm-i386/mach-generic/mach_apic.h
index a7d6246ad..ab36d02eb 100644
--- a/include/asm-i386/mach-generic/mach_apic.h
+++ b/include/asm-i386/mach-generic/mach_apic.h
@@ -6,7 +6,6 @@
 #define esr_disable (genapic->ESR_DISABLE)
 #define NO_BALANCE_IRQ (genapic->no_balance_irq)
 #define NO_IOAPIC_CHECK	(genapic->no_ioapic_check)
-#define APIC_BROADCAST_ID (genapic->apic_broadcast_id)
 #define INT_DELIVERY_MODE (genapic->int_delivery_mode)
 #define INT_DEST_MODE (genapic->int_dest_mode)
 #undef APIC_DEST_LOGICAL
diff --git a/include/asm-i386/mach-generic/mach_mpspec.h b/include/asm-i386/mach-generic/mach_mpspec.h
index fbb6a40ff..9ef0b941b 100644
--- a/include/asm-i386/mach-generic/mach_mpspec.h
+++ b/include/asm-i386/mach-generic/mach_mpspec.h
@@ -1,11 +1,6 @@
 #ifndef __ASM_MACH_MPSPEC_H
 #define __ASM_MACH_MPSPEC_H
 
-/*
- * a maximum of 256 APICs with the current APIC ID architecture.
- */
-#define MAX_APICS 256
-
 #define MAX_IRQ_SOURCES 256
 
 /* Summit or generic (i.e. installer) kernels need lots of bus entries. */
diff --git a/include/asm-i386/mach-numaq/mach_apic.h b/include/asm-i386/mach-numaq/mach_apic.h
index 743bb69aa..b852593a1 100644
--- a/include/asm-i386/mach-numaq/mach_apic.h
+++ b/include/asm-i386/mach-numaq/mach_apic.h
@@ -8,8 +8,7 @@
 
 static inline cpumask_t target_cpus(void)
 {
-	cpumask_t tmp = CPU_MASK_ALL;
-	return tmp;
+	return CPU_MASK_ALL;
 }
 
 #define TARGET_CPUS (target_cpus())
@@ -22,7 +21,6 @@ static inline cpumask_t target_cpus(void)
 #define INT_DELIVERY_MODE dest_LowestPrio
 #define INT_DEST_MODE 0     /* physical delivery on LOCAL quad */
  
-#define APIC_BROADCAST_ID      0x0F
 #define check_apicid_used(bitmap, apicid) physid_isset(apicid, bitmap)
 #define check_apicid_present(bit) physid_isset(bit, phys_cpu_present_map)
 #define apicid_cluster(apicid) (apicid & 0xF0)
@@ -136,7 +134,7 @@ static inline void enable_apic_mode(void)
  * We use physical apicids here, not logical, so just return the default
  * physical broadcast to stop people from breaking us
  */
-static inline unsigned int cpu_mask_to_apicid(cpumask_const_t cpumask)
+static inline unsigned int cpu_mask_to_apicid(cpumask_t cpumask)
 {
 	return (int) 0xF;
 }
diff --git a/include/asm-i386/mach-numaq/mach_mpspec.h b/include/asm-i386/mach-numaq/mach_mpspec.h
index badb10cdb..dffb09856 100644
--- a/include/asm-i386/mach-numaq/mach_mpspec.h
+++ b/include/asm-i386/mach-numaq/mach_mpspec.h
@@ -1,11 +1,6 @@
 #ifndef __ASM_MACH_MPSPEC_H
 #define __ASM_MACH_MPSPEC_H
 
-/*
- * a maximum of 256 APICs with the current APIC ID architecture.
- */
-#define MAX_APICS 256
-
 #define MAX_IRQ_SOURCES 512
 
 #define MAX_MP_BUSSES 32
diff --git a/include/asm-i386/mach-summit/mach_apic.h b/include/asm-i386/mach-summit/mach_apic.h
index accca8fcc..214263a48 100644
--- a/include/asm-i386/mach-summit/mach_apic.h
+++ b/include/asm-i386/mach-summit/mach_apic.h
@@ -19,15 +19,13 @@
 
 static inline cpumask_t target_cpus(void)
 {
-	cpumask_t tmp = CPU_MASK_ALL;
-	return tmp;
+	return CPU_MASK_ALL;
 } 
 #define TARGET_CPUS	(target_cpus())
 
 #define INT_DELIVERY_MODE (dest_Fixed)
 #define INT_DEST_MODE 1     /* logical delivery broadcast to all procs */
 
-#define APIC_BROADCAST_ID     (0xFF)
 static inline unsigned long check_apicid_used(physid_mask_t bitmap, int apicid)
 {
 	return 0;
@@ -140,14 +138,14 @@ static inline void enable_apic_mode(void)
 {
 }
 
-static inline unsigned int cpu_mask_to_apicid(cpumask_const_t cpumask)
+static inline unsigned int cpu_mask_to_apicid(cpumask_t cpumask)
 {
 	int num_bits_set;
 	int cpus_found = 0;
 	int cpu;
 	int apicid;	
 
-	num_bits_set = cpus_weight_const(cpumask);
+	num_bits_set = cpus_weight(cpumask);
 	/* Return id to all */
 	if (num_bits_set == NR_CPUS)
 		return (int) 0xFF;
@@ -155,10 +153,10 @@ static inline unsigned int cpu_mask_to_apicid(cpumask_const_t cpumask)
 	 * The cpus in the mask must all be on the apic cluster.  If are not 
 	 * on the same apicid cluster return default value of TARGET_CPUS. 
 	 */
-	cpu = first_cpu_const(cpumask);
+	cpu = first_cpu(cpumask);
 	apicid = cpu_to_logical_apicid(cpu);
 	while (cpus_found < num_bits_set) {
-		if (cpu_isset_const(cpu, cpumask)) {
+		if (cpu_isset(cpu, cpumask)) {
 			int new_apicid = cpu_to_logical_apicid(cpu);
 			if (apicid_cluster(apicid) != 
 					apicid_cluster(new_apicid)){
diff --git a/include/asm-i386/mach-summit/mach_mpspec.h b/include/asm-i386/mach-summit/mach_mpspec.h
index bc8f7177d..bd7655235 100644
--- a/include/asm-i386/mach-summit/mach_mpspec.h
+++ b/include/asm-i386/mach-summit/mach_mpspec.h
@@ -1,11 +1,6 @@
 #ifndef __ASM_MACH_MPSPEC_H
 #define __ASM_MACH_MPSPEC_H
 
-/*
- * a maximum of 256 APICs with the current APIC ID architecture.
- */
-#define MAX_APICS 256
-
 #define MAX_IRQ_SOURCES 256
 
 /* Maximum 256 PCI busses, plus 1 ISA bus in each of 4 cabinets. */
diff --git a/include/asm-i386/mach-visws/mach_apic.h b/include/asm-i386/mach-visws/mach_apic.h
index 3ec402a3a..c367d820f 100644
--- a/include/asm-i386/mach-visws/mach_apic.h
+++ b/include/asm-i386/mach-visws/mach_apic.h
@@ -19,7 +19,6 @@
  #define TARGET_CPUS cpumask_of_cpu(0)
 #endif
 
-#define APIC_BROADCAST_ID      0x0F
 #define check_apicid_used(bitmap, apicid)	physid_isset(apicid, bitmap)
 #define check_apicid_present(bit)		physid_isset(bit, phys_cpu_present_map)
 
@@ -61,7 +60,10 @@ static inline int cpu_to_logical_apicid(int cpu)
 
 static inline int cpu_present_to_apicid(int mps_cpu)
 {
-	return mps_cpu;
+	if (mps_cpu < get_physical_broadcast())
+		return mps_cpu;
+	else
+		return BAD_APICID;
 }
 
 static inline physid_mask_t apicid_to_cpu_present(int apicid)
@@ -84,9 +86,9 @@ static inline int check_phys_apicid_present(int boot_cpu_physical_apicid)
 	return physid_isset(boot_cpu_physical_apicid, phys_cpu_present_map);
 }
 
-static inline unsigned int cpu_mask_to_apicid(cpumask_const_t cpumask)
+static inline unsigned int cpu_mask_to_apicid(cpumask_t cpumask)
 {
-	return cpus_coerce_const(cpumask);
+	return cpus_addr(cpumask)[0];
 }
 
 static inline u32 phys_pkg_id(u32 cpuid_apic, int index_msb)
diff --git a/include/asm-i386/mach-visws/setup_arch_post.h b/include/asm-i386/mach-visws/setup_arch_post.h
index 2857daf5a..cdbd895a5 100644
--- a/include/asm-i386/mach-visws/setup_arch_post.h
+++ b/include/asm-i386/mach-visws/setup_arch_post.h
@@ -10,7 +10,7 @@ unsigned long sgivwfb_mem_size;
 
 long long mem_size __initdata = 0;
 
-static inline char * __init machine_specific_memory_setup(void)
+static char * __init machine_specific_memory_setup(void)
 {
 	long long gfx_mem_size = 8 * MB;
 
diff --git a/include/asm-i386/mach-voyager/setup_arch_post.h b/include/asm-i386/mach-voyager/setup_arch_post.h
index 4c7cef49b..f6f6c2cbc 100644
--- a/include/asm-i386/mach-voyager/setup_arch_post.h
+++ b/include/asm-i386/mach-voyager/setup_arch_post.h
@@ -3,7 +3,7 @@
  * This is included late in kernel/setup.c so that it can make use of all of
  * the static functions. */
 
-static inline char * __init machine_specific_memory_setup(void)
+static char * __init machine_specific_memory_setup(void)
 {
 	char *who;
 
diff --git a/include/asm-i386/mmzone.h b/include/asm-i386/mmzone.h
index 3b8e4b7cc..ed348f37e 100644
--- a/include/asm-i386/mmzone.h
+++ b/include/asm-i386/mmzone.h
@@ -37,12 +37,12 @@ extern struct pglist_data *node_data[];
 #define MAX_ELEMENTS 256
 #define PAGES_PER_ELEMENT (MAX_NR_PAGES/MAX_ELEMENTS)
 
-extern u8 physnode_map[];
+extern s8 physnode_map[];
 
 static inline int pfn_to_nid(unsigned long pfn)
 {
 #ifdef CONFIG_NUMA
-	return(physnode_map[(pfn) / PAGES_PER_ELEMENT]);
+	return((int) physnode_map[(pfn) / PAGES_PER_ELEMENT]);
 #else
 	return 0;
 #endif
diff --git a/include/asm-i386/mpspec.h b/include/asm-i386/mpspec.h
index b376b0937..8170e019a 100644
--- a/include/asm-i386/mpspec.h
+++ b/include/asm-i386/mpspec.h
@@ -33,7 +33,7 @@ extern void mp_register_lapic_address (u64 address);
 extern void mp_register_ioapic (u8 id, u32 address, u32 gsi_base);
 extern void mp_override_legacy_irq (u8 bus_irq, u8 polarity, u8 trigger, u32 gsi);
 extern void mp_config_acpi_legacy_irqs (void);
-extern void mp_parse_prt (void);
+extern void mp_register_gsi (u32 gsi, int edge_level, int active_high_low);
 #endif /*CONFIG_ACPI_BOOT*/
 
 #define PHYSID_ARRAY_SIZE	BITS_TO_LONGS(MAX_APICS)
@@ -53,7 +53,7 @@ typedef struct physid_mask physid_mask_t;
 #define physids_and(dst, src1, src2)		bitmap_and((dst).mask, (src1).mask, (src2).mask, MAX_APICS)
 #define physids_or(dst, src1, src2)		bitmap_or((dst).mask, (src1).mask, (src2).mask, MAX_APICS)
 #define physids_clear(map)			bitmap_zero((map).mask, MAX_APICS)
-#define physids_complement(map)			bitmap_complement((map).mask, MAX_APICS)
+#define physids_complement(dst, src)		bitmap_complement((dst).mask,(src).mask, MAX_APICS)
 #define physids_empty(map)			bitmap_empty((map).mask, MAX_APICS)
 #define physids_equal(map1, map2)		bitmap_equal((map1).mask, (map2).mask, MAX_APICS)
 #define physids_weight(map)			bitmap_weight((map).mask, MAX_APICS)
diff --git a/include/asm-i386/mpspec_def.h b/include/asm-i386/mpspec_def.h
index 0546e451d..a961093db 100644
--- a/include/asm-i386/mpspec_def.h
+++ b/include/asm-i386/mpspec_def.h
@@ -14,6 +14,7 @@
 #define SMP_MAGIC_IDENT	(('_'<<24)|('P'<<16)|('M'<<8)|'_')
 
 #define MAX_MPC_ENTRY 1024
+#define MAX_APICS      256
 
 struct intel_mp_floating
 {
diff --git a/include/asm-i386/msi.h b/include/asm-i386/msi.h
index e7047ef3a..b85393094 100644
--- a/include/asm-i386/msi.h
+++ b/include/asm-i386/msi.h
@@ -16,7 +16,7 @@
 #ifdef CONFIG_SMP
 #define MSI_TARGET_CPU		logical_smp_processor_id()
 #else
-#define MSI_TARGET_CPU		TARGET_CPUS
+#define MSI_TARGET_CPU	cpu_to_logical_apicid(first_cpu(cpu_online_map))
 #endif
 
 #endif /* ASM_MSI_H */
diff --git a/include/asm-i386/msr.h b/include/asm-i386/msr.h
index ffdeea9d1..3589c36b8 100644
--- a/include/asm-i386/msr.h
+++ b/include/asm-i386/msr.h
@@ -217,6 +217,15 @@ static inline void wrmsrl (unsigned long msr, unsigned long long val)
 #define MSR_K7_FID_VID_CTL		0xC0010041
 #define MSR_K7_FID_VID_STATUS		0xC0010042
 
+/* extended feature register */
+#define MSR_EFER 			0xc0000080
+
+/* EFER bits: */
+
+/* Execute Disable enable */
+#define _EFER_NX			11
+#define EFER_NX				(1<<_EFER_NX)
+
 /* Centaur-Hauls/IDT defined MSRs. */
 #define MSR_IDT_FCR1			0x107
 #define MSR_IDT_FCR2			0x108
diff --git a/include/asm-i386/page.h b/include/asm-i386/page.h
index 5884b3c92..eb0e11f10 100644
--- a/include/asm-i386/page.h
+++ b/include/asm-i386/page.h
@@ -40,15 +40,20 @@
  * These are used to make use of C type-checking..
  */
 #ifdef CONFIG_X86_PAE
+extern unsigned long long __supported_pte_mask;
+extern int nx_enabled;
 typedef struct { unsigned long pte_low, pte_high; } pte_t;
 typedef struct { unsigned long long pmd; } pmd_t;
 typedef struct { unsigned long long pgd; } pgd_t;
+typedef struct { unsigned long long pgprot; } pgprot_t;
 #define pte_val(x)	((x).pte_low | ((unsigned long long)(x).pte_high << 32))
 #define HPAGE_SHIFT	21
 #else
+#define nx_enabled 0
 typedef struct { unsigned long pte_low; } pte_t;
 typedef struct { unsigned long pmd; } pmd_t;
 typedef struct { unsigned long pgd; } pgd_t;
+typedef struct { unsigned long pgprot; } pgprot_t;
 #define boot_pte_t pte_t /* or would you rather have a typedef */
 #define pte_val(x)	((x).pte_low)
 #define HPAGE_SHIFT	22
@@ -61,7 +66,6 @@ typedef struct { unsigned long pgd; } pgd_t;
 #define HUGETLB_PAGE_ORDER	(HPAGE_SHIFT - PAGE_SHIFT)
 #endif
 
-typedef struct { unsigned long pgprot; } pgprot_t;
 
 #define pmd_val(x)	((x).pmd)
 #define pgd_val(x)	((x).pgd)
@@ -136,8 +140,10 @@ static __inline__ int get_order(unsigned long size)
 
 #define virt_addr_valid(kaddr)	pfn_valid(__pa(kaddr) >> PAGE_SHIFT)
 
-#define VM_DATA_DEFAULT_FLAGS	(VM_READ | VM_WRITE | VM_EXEC | \
-				 VM_MAYREAD | VM_MAYWRITE | VM_MAYEXEC)
+#define VM_DATA_DEFAULT_FLAGS \
+	(VM_READ | VM_WRITE | \
+	((current->personality & READ_IMPLIES_EXEC) ? VM_EXEC : 0 ) | \
+		 VM_MAYREAD | VM_MAYWRITE | VM_MAYEXEC)
 
 #endif /* __KERNEL__ */
 
diff --git a/include/asm-i386/param.h b/include/asm-i386/param.h
index e0a475028..b6440526e 100644
--- a/include/asm-i386/param.h
+++ b/include/asm-i386/param.h
@@ -18,5 +18,6 @@
 #endif
 
 #define MAXHOSTNAMELEN	64	/* max length of hostname */
+#define COMMAND_LINE_SIZE 256
 
 #endif
diff --git a/include/asm-i386/pgtable-2level.h b/include/asm-i386/pgtable-2level.h
index cea397939..de5111056 100644
--- a/include/asm-i386/pgtable-2level.h
+++ b/include/asm-i386/pgtable-2level.h
@@ -1,22 +1,6 @@
 #ifndef _I386_PGTABLE_2LEVEL_H
 #define _I386_PGTABLE_2LEVEL_H
 
-/*
- * traditional i386 two-level paging structure:
- */
-
-#define PGDIR_SHIFT	22
-#define PTRS_PER_PGD	1024
-
-/*
- * the i386 is two-level, so we don't really have any
- * PMD directory physically.
- */
-#define PMD_SHIFT	22
-#define PTRS_PER_PMD	1
-
-#define PTRS_PER_PTE	1024
-
 #define pte_ERROR(e) \
 	printk("%s:%d: bad pte %08lx.\n", __FILE__, __LINE__, (e).pte_low)
 #define pmd_ERROR(e) \
@@ -63,6 +47,22 @@ static inline pmd_t * pmd_offset(pgd_t * dir, unsigned long address)
 #define pfn_pte(pfn, prot)	__pte(((pfn) << PAGE_SHIFT) | pgprot_val(prot))
 #define pfn_pmd(pfn, prot)	__pmd(((pfn) << PAGE_SHIFT) | pgprot_val(prot))
 
+/*
+ * All present user pages are user-executable:
+ */
+static inline int pte_exec(pte_t pte)
+{
+	return pte_user(pte);
+}
+
+/*
+ * All present pages are kernel-executable:
+ */
+static inline int pte_exec_kernel(pte_t pte)
+{
+	return 1;
+}
+
 /*
  * Bits 0, 6 and 7 are taken, split up the 29 bits of offset
  * into this range:
diff --git a/include/asm-i386/pgtable-3level.h b/include/asm-i386/pgtable-3level.h
index 147acd853..d78e3493d 100644
--- a/include/asm-i386/pgtable-3level.h
+++ b/include/asm-i386/pgtable-3level.h
@@ -8,24 +8,6 @@
  * Copyright (C) 1999 Ingo Molnar <mingo@redhat.com>
  */
 
-/*
- * PGDIR_SHIFT determines what a top-level page table entry can map
- */
-#define PGDIR_SHIFT	30
-#define PTRS_PER_PGD	4
-
-/*
- * PMD_SHIFT determines the size of the area a middle-level
- * page table can map
- */
-#define PMD_SHIFT	21
-#define PTRS_PER_PMD	512
-
-/*
- * entries per page directory level
- */
-#define PTRS_PER_PTE	512
-
 #define pte_ERROR(e) \
 	printk("%s:%d: bad pte %p(%08lx%08lx).\n", __FILE__, __LINE__, &(e), (e).pte_high, (e).pte_low)
 #define pmd_ERROR(e) \
@@ -37,6 +19,29 @@ static inline int pgd_none(pgd_t pgd)		{ return 0; }
 static inline int pgd_bad(pgd_t pgd)		{ return 0; }
 static inline int pgd_present(pgd_t pgd)	{ return 1; }
 
+/*
+ * Is the pte executable?
+ */
+static inline int pte_x(pte_t pte)
+{
+	return !(pte_val(pte) & _PAGE_NX);
+}
+
+/*
+ * All present user-pages with !NX bit are user-executable:
+ */
+static inline int pte_exec(pte_t pte)
+{
+	return pte_user(pte) && pte_x(pte);
+}
+/*
+ * All present pages with !NX bit are kernel-executable:
+ */
+static inline int pte_exec_kernel(pte_t pte)
+{
+	return pte_x(pte);
+}
+
 /* Rules for using set_pte: the pte being assigned *must* be
  * either not present or in a state where the hardware will
  * not attempt to update the pte.  In places where this is
@@ -101,18 +106,24 @@ static inline unsigned long pte_pfn(pte_t pte)
 		(pte.pte_high << (32 - PAGE_SHIFT));
 }
 
+extern unsigned long long __supported_pte_mask;
+
 static inline pte_t pfn_pte(unsigned long page_nr, pgprot_t pgprot)
 {
 	pte_t pte;
 
-	pte.pte_high = page_nr >> (32 - PAGE_SHIFT);
-	pte.pte_low = (page_nr << PAGE_SHIFT) | pgprot_val(pgprot);
+	pte.pte_high = (page_nr >> (32 - PAGE_SHIFT)) | \
+					(pgprot_val(pgprot) >> 32);
+	pte.pte_high &= (__supported_pte_mask >> 32);
+	pte.pte_low = ((page_nr << PAGE_SHIFT) | pgprot_val(pgprot)) & \
+							__supported_pte_mask;
 	return pte;
 }
 
 static inline pmd_t pfn_pmd(unsigned long page_nr, pgprot_t pgprot)
 {
-	return __pmd(((unsigned long long)page_nr << PAGE_SHIFT) | pgprot_val(pgprot));
+	return __pmd((((unsigned long long)page_nr << PAGE_SHIFT) | \
+			pgprot_val(pgprot)) & __supported_pte_mask);
 }
 
 /*
diff --git a/include/asm-i386/pgtable.h b/include/asm-i386/pgtable.h
index 299c75871..8f9fcab61 100644
--- a/include/asm-i386/pgtable.h
+++ b/include/asm-i386/pgtable.h
@@ -43,19 +43,15 @@ void pgd_dtor(void *, kmem_cache_t *, unsigned long);
 void pgtable_cache_init(void);
 void paging_init(void);
 
-#endif /* !__ASSEMBLY__ */
-
 /*
  * The Linux x86 paging architecture is 'compile-time dual-mode', it
  * implements both the traditional 2-level x86 page tables and the
  * newer 3-level PAE-mode page tables.
  */
-#ifndef __ASSEMBLY__
 #ifdef CONFIG_X86_PAE
-# include <asm/pgtable-3level.h>
+# include <asm/pgtable-3level-defs.h>
 #else
-# include <asm/pgtable-2level.h>
-#endif
+# include <asm/pgtable-2level-defs.h>
 #endif
 
 #define PMD_SIZE	(1UL << PMD_SHIFT)
@@ -73,8 +69,6 @@ void paging_init(void);
 #define BOOT_USER_PGD_PTRS (__PAGE_OFFSET >> TWOLEVEL_PGDIR_SHIFT)
 #define BOOT_KERNEL_PGD_PTRS (1024-BOOT_USER_PGD_PTRS)
 
-
-#ifndef __ASSEMBLY__
 /* Just any arbitrary offset to the start of the vmalloc VM area: the
  * current 8MB value just means that there will be a 8MB "hole" after the
  * physical memory until the kernel virtual memory starts.  That means that
@@ -83,8 +77,8 @@ void paging_init(void);
  * area for the same reason. ;)
  */
 #define VMALLOC_OFFSET	(8*1024*1024)
-#define VMALLOC_START	(((unsigned long) high_memory + 2*VMALLOC_OFFSET-1) & \
-						~(VMALLOC_OFFSET-1))
+#define VMALLOC_START	(((unsigned long) high_memory + vmalloc_earlyreserve + \
+			2*VMALLOC_OFFSET-1) & ~(VMALLOC_OFFSET-1))
 #ifdef CONFIG_HIGHMEM
 # define VMALLOC_END	(PKMAP_BASE-2*PAGE_SIZE)
 #else
@@ -110,6 +104,7 @@ void paging_init(void);
 #define _PAGE_BIT_UNUSED1	9	/* available for programmer */
 #define _PAGE_BIT_UNUSED2	10
 #define _PAGE_BIT_UNUSED3	11
+#define _PAGE_BIT_NX		63
 
 #define _PAGE_PRESENT	0x001
 #define _PAGE_RW	0x002
@@ -126,28 +121,51 @@ void paging_init(void);
 
 #define _PAGE_FILE	0x040	/* set:pagecache unset:swap */
 #define _PAGE_PROTNONE	0x080	/* If not present */
+#ifdef CONFIG_X86_PAE
+#define _PAGE_NX	(1ULL<<_PAGE_BIT_NX)
+#else
+#define _PAGE_NX	0
+#endif
 
 #define _PAGE_TABLE	(_PAGE_PRESENT | _PAGE_RW | _PAGE_USER | _PAGE_ACCESSED | _PAGE_DIRTY)
 #define _KERNPG_TABLE	(_PAGE_PRESENT | _PAGE_RW | _PAGE_ACCESSED | _PAGE_DIRTY)
 #define _PAGE_CHG_MASK	(PTE_MASK | _PAGE_ACCESSED | _PAGE_DIRTY)
 
-#define PAGE_NONE	__pgprot(_PAGE_PROTNONE | _PAGE_ACCESSED)
-#define PAGE_SHARED	__pgprot(_PAGE_PRESENT | _PAGE_RW | _PAGE_USER | _PAGE_ACCESSED)
-#define PAGE_COPY	__pgprot(_PAGE_PRESENT | _PAGE_USER | _PAGE_ACCESSED)
-#define PAGE_READONLY	__pgprot(_PAGE_PRESENT | _PAGE_USER | _PAGE_ACCESSED)
+#define PAGE_NONE \
+	__pgprot(_PAGE_PROTNONE | _PAGE_ACCESSED)
+#define PAGE_SHARED \
+	__pgprot(_PAGE_PRESENT | _PAGE_RW | _PAGE_USER | _PAGE_ACCESSED)
+
+#define PAGE_SHARED_EXEC \
+	__pgprot(_PAGE_PRESENT | _PAGE_RW | _PAGE_USER | _PAGE_ACCESSED)
+#define PAGE_COPY_NOEXEC \
+	__pgprot(_PAGE_PRESENT | _PAGE_USER | _PAGE_ACCESSED | _PAGE_NX)
+#define PAGE_COPY_EXEC \
+	__pgprot(_PAGE_PRESENT | _PAGE_USER | _PAGE_ACCESSED)
+#define PAGE_COPY \
+	PAGE_COPY_NOEXEC
+#define PAGE_READONLY \
+	__pgprot(_PAGE_PRESENT | _PAGE_USER | _PAGE_ACCESSED | _PAGE_NX)
+#define PAGE_READONLY_EXEC \
+	__pgprot(_PAGE_PRESENT | _PAGE_USER | _PAGE_ACCESSED)
 
 #define _PAGE_KERNEL \
+	(_PAGE_PRESENT | _PAGE_RW | _PAGE_DIRTY | _PAGE_ACCESSED | _PAGE_NX)
+#define _PAGE_KERNEL_EXEC \
 	(_PAGE_PRESENT | _PAGE_RW | _PAGE_DIRTY | _PAGE_ACCESSED)
 
-extern unsigned long __PAGE_KERNEL;
-#define __PAGE_KERNEL_RO	(__PAGE_KERNEL & ~_PAGE_RW)
-#define __PAGE_KERNEL_NOCACHE	(__PAGE_KERNEL | _PAGE_PCD)
-#define __PAGE_KERNEL_LARGE	(__PAGE_KERNEL | _PAGE_PSE)
+extern unsigned long long __PAGE_KERNEL, __PAGE_KERNEL_EXEC;
+#define __PAGE_KERNEL_RO		(__PAGE_KERNEL & ~_PAGE_RW)
+#define __PAGE_KERNEL_NOCACHE		(__PAGE_KERNEL | _PAGE_PCD)
+#define __PAGE_KERNEL_LARGE		(__PAGE_KERNEL | _PAGE_PSE)
+#define __PAGE_KERNEL_LARGE_EXEC	(__PAGE_KERNEL_EXEC | _PAGE_PSE)
 
 #define PAGE_KERNEL		__pgprot(__PAGE_KERNEL)
 #define PAGE_KERNEL_RO		__pgprot(__PAGE_KERNEL_RO)
+#define PAGE_KERNEL_EXEC	__pgprot(__PAGE_KERNEL_EXEC)
 #define PAGE_KERNEL_NOCACHE	__pgprot(__PAGE_KERNEL_NOCACHE)
 #define PAGE_KERNEL_LARGE	__pgprot(__PAGE_KERNEL_LARGE)
+#define PAGE_KERNEL_LARGE_EXEC	__pgprot(__PAGE_KERNEL_LARGE_EXEC)
 
 /*
  * The i386 can't do page protection for execute, and considers that
@@ -158,19 +176,19 @@ extern unsigned long __PAGE_KERNEL;
 #define __P001	PAGE_READONLY
 #define __P010	PAGE_COPY
 #define __P011	PAGE_COPY
-#define __P100	PAGE_READONLY
-#define __P101	PAGE_READONLY
-#define __P110	PAGE_COPY
-#define __P111	PAGE_COPY
+#define __P100	PAGE_READONLY_EXEC
+#define __P101	PAGE_READONLY_EXEC
+#define __P110	PAGE_COPY_EXEC
+#define __P111	PAGE_COPY_EXEC
 
 #define __S000	PAGE_NONE
 #define __S001	PAGE_READONLY
 #define __S010	PAGE_SHARED
 #define __S011	PAGE_SHARED
-#define __S100	PAGE_READONLY
-#define __S101	PAGE_READONLY
-#define __S110	PAGE_SHARED
-#define __S111	PAGE_SHARED
+#define __S100	PAGE_READONLY_EXEC
+#define __S101	PAGE_READONLY_EXEC
+#define __S110	PAGE_SHARED_EXEC
+#define __S111	PAGE_SHARED_EXEC
 
 /*
  * Define this if things work differently on an i386 and an i486:
@@ -199,7 +217,6 @@ extern unsigned long pg0[];
  */
 static inline int pte_user(pte_t pte)		{ return (pte).pte_low & _PAGE_USER; }
 static inline int pte_read(pte_t pte)		{ return (pte).pte_low & _PAGE_USER; }
-static inline int pte_exec(pte_t pte)		{ return (pte).pte_low & _PAGE_USER; }
 static inline int pte_dirty(pte_t pte)		{ return (pte).pte_low & _PAGE_DIRTY; }
 static inline int pte_young(pte_t pte)		{ return (pte).pte_low & _PAGE_ACCESSED; }
 static inline int pte_write(pte_t pte)		{ return (pte).pte_low & _PAGE_RW; }
@@ -220,8 +237,26 @@ static inline pte_t pte_mkdirty(pte_t pte)	{ (pte).pte_low |= _PAGE_DIRTY; retur
 static inline pte_t pte_mkyoung(pte_t pte)	{ (pte).pte_low |= _PAGE_ACCESSED; return pte; }
 static inline pte_t pte_mkwrite(pte_t pte)	{ (pte).pte_low |= _PAGE_RW; return pte; }
 
-static inline  int ptep_test_and_clear_dirty(pte_t *ptep)	{ return test_and_clear_bit(_PAGE_BIT_DIRTY, &ptep->pte_low); }
-static inline  int ptep_test_and_clear_young(pte_t *ptep)	{ return test_and_clear_bit(_PAGE_BIT_ACCESSED, &ptep->pte_low); }
+#ifdef CONFIG_X86_PAE
+# include <asm/pgtable-3level.h>
+#else
+# include <asm/pgtable-2level.h>
+#endif
+
+static inline int ptep_test_and_clear_dirty(pte_t *ptep)
+{
+	if (!pte_dirty(*ptep))
+		return 0;
+	return test_and_clear_bit(_PAGE_BIT_DIRTY, &ptep->pte_low);
+}
+
+static inline int ptep_test_and_clear_young(pte_t *ptep)
+{
+	if (!pte_young(*ptep))
+		return 0;
+	return test_and_clear_bit(_PAGE_BIT_ACCESSED, &ptep->pte_low);
+}
+
 static inline void ptep_set_wrprotect(pte_t *ptep)		{ clear_bit(_PAGE_BIT_RW, &ptep->pte_low); }
 static inline void ptep_mkdirty(pte_t *ptep)			{ set_bit(_PAGE_BIT_DIRTY, &ptep->pte_low); }
 
@@ -244,6 +279,15 @@ static inline pte_t pte_modify(pte_t pte, pgprot_t newprot)
 {
 	pte.pte_low &= _PAGE_CHG_MASK;
 	pte.pte_low |= pgprot_val(newprot);
+#ifdef CONFIG_X86_PAE
+	/*
+	 * Chop off the NX bit (if present), and add the NX portion of
+	 * the newprot (if present):
+	 */
+	pte.pte_high &= ~(1 << (_PAGE_BIT_NX - 32));
+	pte.pte_high |= (pgprot_val(newprot) >> 32) & \
+					(__supported_pte_mask >> 32);
+#endif
 	return pte;
 }
 
@@ -299,6 +343,26 @@ static inline pte_t pte_modify(pte_t pte, pgprot_t newprot)
 #define pte_offset_kernel(dir, address) \
 	((pte_t *) pmd_page_kernel(*(dir)) +  pte_index(address))
 
+/*
+ * Helper function that returns the kernel pagetable entry controlling
+ * the virtual address 'address'. NULL means no pagetable entry present.
+ * NOTE: the return type is pte_t but if the pmd is PSE then we return it
+ * as a pte too.
+ */
+extern pte_t *lookup_address(unsigned long address);
+
+/*
+ * Make a given kernel text page executable/non-executable.
+ * Returns the previous executability setting of that page (which
+ * is used to restore the previous state). Used by the SMP bootup code.
+ * NOTE: this is an __init function for security reasons.
+ */
+#ifdef CONFIG_X86_PAE
+ extern int set_kernel_exec(unsigned long vaddr, int enable);
+#else
+ static inline int set_kernel_exec(unsigned long vaddr, int enable) { return 0;}
+#endif
+
 #if defined(CONFIG_HIGHPTE)
 #define pte_offset_map(dir, address) \
 	((pte_t *)kmap_atomic(pmd_page(*(dir)),KM_PTE0) + pte_index(address))
diff --git a/include/asm-i386/processor.h b/include/asm-i386/processor.h
index 9d49ea237..6fcdb7d1d 100644
--- a/include/asm-i386/processor.h
+++ b/include/asm-i386/processor.h
@@ -259,14 +259,8 @@ static inline void clear_in_cr4 (unsigned long mask)
 
 /*
  * Bus types (default is ISA, but people can check others with these..)
- * pc98 indicates PC98 systems (CBUS)
  */
 extern int MCA_bus;
-#ifdef CONFIG_X86_PC9800
-#define pc98 1
-#else
-#define pc98 0
-#endif
 
 static inline void __monitor(const void *eax, unsigned long ecx,
 		unsigned long edx)
@@ -303,9 +297,9 @@ extern unsigned int mca_pentium_flag;
 #define TASK_UNMAPPED_BASE	(PAGE_ALIGN(TASK_SIZE / 3))
 
 /*
- * Size of io_bitmap, covering ports 0 to 0x3ff.
+ * Size of io_bitmap.
  */
-#define IO_BITMAP_BITS  1024
+#define IO_BITMAP_BITS  65536
 #define IO_BITMAP_BYTES (IO_BITMAP_BITS/8)
 #define IO_BITMAP_LONGS (IO_BITMAP_BYTES/sizeof(long))
 #define IO_BITMAP_OFFSET offsetof(struct tss_struct,io_bitmap)
@@ -397,7 +391,7 @@ struct tss_struct {
 	/*
 	 * pads the TSS to be cacheline-aligned (size is 0x100)
 	 */
-	unsigned long __cacheline_filler[5];
+	unsigned long __cacheline_filler[37];
 	/*
 	 * .. and then another 0x100 bytes for emergency kernel stack
 	 */
diff --git a/include/asm-i386/resource.h b/include/asm-i386/resource.h
index e0da3ad1d..3e391b2e9 100644
--- a/include/asm-i386/resource.h
+++ b/include/asm-i386/resource.h
@@ -16,8 +16,11 @@
 #define RLIMIT_MEMLOCK	8		/* max locked-in-memory address space */
 #define RLIMIT_AS	9		/* address space limit */
 #define RLIMIT_LOCKS	10		/* maximum file locks held */
+#define RLIMIT_SIGPENDING 11		/* max number of pending signals */
+#define RLIMIT_MSGQUEUE 12		/* maximum bytes in POSIX mqueues */
+
+#define RLIM_NLIMITS	13
 
-#define RLIM_NLIMITS	11
 
 /*
  * SuS says limits have to be unsigned.
@@ -39,7 +42,9 @@
 	{      INR_OPEN,     INR_OPEN  },		\
 	{ RLIM_INFINITY, RLIM_INFINITY },		\
 	{ RLIM_INFINITY, RLIM_INFINITY },		\
-        { RLIM_INFINITY, RLIM_INFINITY },		\
+	{ RLIM_INFINITY, RLIM_INFINITY },		\
+	{ MAX_SIGPENDING, MAX_SIGPENDING },		\
+	{ MQ_BYTES_MAX, MQ_BYTES_MAX },			\
 }
 
 #endif /* __KERNEL__ */
diff --git a/include/asm-i386/serial.h b/include/asm-i386/serial.h
index 9d67798a3..21ddecc77 100644
--- a/include/asm-i386/serial.h
+++ b/include/asm-i386/serial.h
@@ -47,19 +47,12 @@
 
 #define C_P(card,port) (((card)<<6|(port)<<3) + 1)
 
-#ifndef CONFIG_X86_PC9800
 #define STD_SERIAL_PORT_DEFNS			\
 	/* UART CLK   PORT IRQ     FLAGS        */			\
 	{ 0, BASE_BAUD, 0x3F8, 4, STD_COM_FLAGS },	/* ttyS0 */	\
 	{ 0, BASE_BAUD, 0x2F8, 3, STD_COM_FLAGS },	/* ttyS1 */	\
 	{ 0, BASE_BAUD, 0x3E8, 4, STD_COM_FLAGS },	/* ttyS2 */	\
 	{ 0, BASE_BAUD, 0x2E8, 3, STD_COM4_FLAGS },	/* ttyS3 */
-#else
-#define STD_SERIAL_PORT_DEFNS			\
-	/* UART CLK   PORT IRQ     FLAGS        */			\
-	{ 0, BASE_BAUD, 0x30, 4, STD_COM_FLAGS },	/* ttyS0 */	\
-	{ 0, BASE_BAUD, 0x238, 5, STD_COM_FLAGS },	/* ttyS1 */
-#endif /* CONFIG_X86_PC9800 */
 
 
 #ifdef CONFIG_SERIAL_MANY_PORTS
diff --git a/include/asm-i386/setup.h b/include/asm-i386/setup.h
index e17ba1cd8..59f4a1ad3 100644
--- a/include/asm-i386/setup.h
+++ b/include/asm-i386/setup.h
@@ -56,8 +56,9 @@ extern unsigned char boot_params[PARAM_SIZE];
 #define INITRD_START (*(unsigned long *) (PARAM+0x218))
 #define INITRD_SIZE (*(unsigned long *) (PARAM+0x21c))
 #define EDID_INFO   (*(struct edid_info *) (PARAM+0x440))
-#define DISK80_SIGNATURE (*(unsigned int*) (PARAM+DISK80_SIG_BUFFER))
 #define EDD_NR     (*(unsigned char *) (PARAM+EDDNR))
+#define EDD_MBR_SIG_NR (*(unsigned char *) (PARAM+EDD_MBR_SIG_NR_BUF))
+#define EDD_MBR_SIGNATURE ((unsigned int *) (PARAM+EDD_MBR_SIG_BUF))
 #define EDD_BUF     ((struct edd_info *) (PARAM+EDDBUF))
 
 #endif /* __ASSEMBLY__ */
diff --git a/include/asm-i386/signal.h b/include/asm-i386/signal.h
index e3397cd6f..de3da5b31 100644
--- a/include/asm-i386/signal.h
+++ b/include/asm-i386/signal.h
@@ -4,6 +4,7 @@
 #include <linux/types.h>
 #include <linux/linkage.h>
 #include <linux/time.h>
+#include <linux/compiler.h>
 
 /* Avoid too many header ordering problems.  */
 struct siginfo;
@@ -128,7 +129,11 @@ typedef unsigned long sigset_t;
 #define SIG_SETMASK        2	/* for setting the signal mask */
 
 /* Type of a signal handler.  */
-typedef void (*__sighandler_t)(int);
+typedef void __signalfn_t(int);
+typedef __signalfn_t __user *__sighandler_t;
+
+typedef void __restorefn_t(void);
+typedef __restorefn_t __user *__sigrestore_t;
 
 #define SIG_DFL	((__sighandler_t)0)	/* default signal handling */
 #define SIG_IGN	((__sighandler_t)1)	/* ignore signal */
@@ -139,13 +144,13 @@ struct old_sigaction {
 	__sighandler_t sa_handler;
 	old_sigset_t sa_mask;
 	unsigned long sa_flags;
-	void (*sa_restorer)(void);
+	__sigrestore_t sa_restorer;
 };
 
 struct sigaction {
 	__sighandler_t sa_handler;
 	unsigned long sa_flags;
-	void (*sa_restorer)(void);
+	__sigrestore_t sa_restorer;
 	sigset_t sa_mask;		/* mask last for extensibility */
 };
 
@@ -171,7 +176,7 @@ struct sigaction {
 #endif /* __KERNEL__ */
 
 typedef struct sigaltstack {
-	void *ss_sp;
+	void __user *ss_sp;
 	int ss_flags;
 	size_t ss_size;
 } stack_t;
diff --git a/include/asm-i386/spinlock.h b/include/asm-i386/spinlock.h
index 8bd4f23a5..d6dbfd469 100644
--- a/include/asm-i386/spinlock.h
+++ b/include/asm-i386/spinlock.h
@@ -42,7 +42,6 @@ typedef struct {
 
 #define spin_is_locked(x)	(*(volatile signed char *)(&(x)->lock) <= 0)
 #define spin_unlock_wait(x)	do { barrier(); } while(spin_is_locked(x))
-#define _raw_spin_lock_flags(lock, flags) _raw_spin_lock(lock)
 
 #define spin_lock_string \
 	"\n1:\t" \
@@ -56,6 +55,23 @@ typedef struct {
 	"jmp 1b\n" \
 	LOCK_SECTION_END
 
+#define spin_lock_string_flags \
+	"\n1:\t" \
+	"lock ; decb %0\n\t" \
+	"js 2f\n\t" \
+	LOCK_SECTION_START("") \
+	"2:\t" \
+	"testl $0x200, %1\n\t" \
+	"jz 3f\n\t" \
+	"sti\n\t" \
+	"3:\t" \
+	"rep;nop\n\t" \
+	"cmpb $0, %0\n\t" \
+	"jle 3b\n\t" \
+	"cli\n\t" \
+	"jmp 1b\n" \
+	LOCK_SECTION_END
+
 /*
  * This works. Despite all the confusion.
  * (except on PPro SMP or if we are using OOSTORE)
@@ -126,6 +142,20 @@ here:
 		:"=m" (lock->lock) : : "memory");
 }
 
+static inline void _raw_spin_lock_flags (spinlock_t *lock, unsigned long flags)
+{
+#ifdef CONFIG_DEBUG_SPINLOCK
+	__label__ here;
+here:
+	if (unlikely(lock->magic != SPINLOCK_MAGIC)) {
+		printk("eip: %p\n", &&here);
+		BUG();
+	}
+#endif
+	__asm__ __volatile__(
+		spin_lock_string_flags
+		:"=m" (lock->lock) : "r" (flags) : "memory");
+}
 
 /*
  * Read-write spinlocks, allowing multiple readers
diff --git a/include/asm-i386/string.h b/include/asm-i386/string.h
index a14f9f37d..fc66609bb 100644
--- a/include/asm-i386/string.h
+++ b/include/asm-i386/string.h
@@ -27,6 +27,7 @@
  */
 #if !defined(IN_STRING_C)
 
+#define __HAVE_ARCH_STRCPY
 static inline char * strcpy(char * dest,const char *src)
 {
 int d0, d1, d2;
@@ -40,6 +41,7 @@ __asm__ __volatile__(
 return dest;
 }
 
+#define __HAVE_ARCH_STRNCPY
 static inline char * strncpy(char * dest,const char *src,size_t count)
 {
 int d0, d1, d2, d3;
@@ -58,6 +60,7 @@ __asm__ __volatile__(
 return dest;
 }
 
+#define __HAVE_ARCH_STRCAT
 static inline char * strcat(char * dest,const char * src)
 {
 int d0, d1, d2, d3;
@@ -74,6 +77,7 @@ __asm__ __volatile__(
 return dest;
 }
 
+#define __HAVE_ARCH_STRNCAT
 static inline char * strncat(char * dest,const char * src,size_t count)
 {
 int d0, d1, d2, d3;
@@ -96,6 +100,7 @@ __asm__ __volatile__(
 return dest;
 }
 
+#define __HAVE_ARCH_STRCMP
 static inline int strcmp(const char * cs,const char * ct)
 {
 int d0, d1;
@@ -116,6 +121,7 @@ __asm__ __volatile__(
 return __res;
 }
 
+#define __HAVE_ARCH_STRNCMP
 static inline int strncmp(const char * cs,const char * ct,size_t count)
 {
 register int __res;
@@ -138,6 +144,7 @@ __asm__ __volatile__(
 return __res;
 }
 
+#define __HAVE_ARCH_STRCHR
 static inline char * strchr(const char * s, int c)
 {
 int d0;
@@ -156,6 +163,7 @@ __asm__ __volatile__(
 return __res;
 }
 
+#define __HAVE_ARCH_STRRCHR
 static inline char * strrchr(const char * s, int c)
 {
 int d0, d1;
@@ -277,41 +285,8 @@ static __inline__ void *__memcpy3d(void *to, const void *from, size_t len)
 
 #endif
 
-/*
- * struct_cpy(x,y), copy structure *x into (matching structure) *y.
- *
- * We get link-time errors if the structure sizes do not match.
- * There is no runtime overhead, it's all optimized away at
- * compile time.
- */
-extern void __struct_cpy_bug (void);
-
-#define struct_cpy(x,y) 			\
-({						\
-	if (sizeof(*(x)) != sizeof(*(y))) 	\
-		__struct_cpy_bug();		\
-	memcpy(x, y, sizeof(*(x)));		\
-})
-
 #define __HAVE_ARCH_MEMMOVE
-static inline void * memmove(void * dest,const void * src, size_t n)
-{
-int d0, d1, d2;
-if (dest<src) {
-	memcpy(dest,src,n);
-} else
-__asm__ __volatile__(
-	"std\n\t"
-	"rep\n\t"
-	"movsb\n\t"
-	"cld"
-	: "=&c" (d0), "=&S" (d1), "=&D" (d2)
-	:"0" (n),
-	 "1" (n-1+(const char *)src),
-	 "2" (n-1+(char *)dest)
-	:"memory");
-return dest;
-}
+void *memmove(void * dest,const void * src, size_t n);
 
 #define memcmp __builtin_memcmp
 
diff --git a/include/asm-i386/suspend.h b/include/asm-i386/suspend.h
index 2febd2d28..2794a173f 100644
--- a/include/asm-i386/suspend.h
+++ b/include/asm-i386/suspend.h
@@ -36,9 +36,6 @@ struct saved_context {
                        : /* no output */ \
                        :"r" ((thread)->debugreg[register]))
 
-extern void save_processor_state(void);
-extern void restore_processor_state(void);
-
 #ifdef CONFIG_ACPI_SLEEP
 extern unsigned long saved_eip;
 extern unsigned long saved_esp;
diff --git a/include/asm-i386/system.h b/include/asm-i386/system.h
index 6b1d2e84a..d4bb72a58 100644
--- a/include/asm-i386/system.h
+++ b/include/asm-i386/system.h
@@ -465,13 +465,6 @@ struct alt_instr {
 void disable_hlt(void);
 void enable_hlt(void);
 
-extern unsigned long dmi_broken;
-extern int is_sony_vaio_laptop;
 extern int es7000_plat;
 
-#define BROKEN_ACPI_Sx		0x0001
-#define BROKEN_INIT_AFTER_S1	0x0002
-#define BROKEN_PNP_BIOS		0x0004
-#define BROKEN_CPUFREQ		0x0008
-
 #endif
diff --git a/include/asm-i386/timex.h b/include/asm-i386/timex.h
index a447a9938..e73772931 100644
--- a/include/asm-i386/timex.h
+++ b/include/asm-i386/timex.h
@@ -9,15 +9,11 @@
 #include <linux/config.h>
 #include <asm/msr.h>
 
-#ifdef CONFIG_X86_PC9800
-   extern int CLOCK_TICK_RATE;
-#else
 #ifdef CONFIG_X86_ELAN
 #  define CLOCK_TICK_RATE 1189200 /* AMD Elan has different frequency! */
 #else
 #  define CLOCK_TICK_RATE 1193182 /* Underlying HZ */
 #endif
-#endif
 
 #define CLOCK_TICK_FACTOR	20	/* Factor of both 1000000 and CLOCK_TICK_RATE */
 #define FINETUNE ((((((long)LATCH * HZ - CLOCK_TICK_RATE) << SHIFT_HZ) * \
diff --git a/include/asm-i386/uaccess.h b/include/asm-i386/uaccess.h
index 656be13d0..bb202d212 100644
--- a/include/asm-i386/uaccess.h
+++ b/include/asm-i386/uaccess.h
@@ -261,7 +261,7 @@ extern void __put_user_bad(void);
 #define __put_user_check(x,ptr,size)					\
 ({									\
 	long __pu_err = -EFAULT;					\
-	__typeof__(*(ptr)) *__pu_addr = (ptr);				\
+	__typeof__(*(ptr)) __user *__pu_addr = (ptr);			\
 	might_sleep();						\
 	if (access_ok(VERIFY_WRITE,__pu_addr,size))			\
 		__put_user_size((x),__pu_addr,(size),__pu_err,-EFAULT);	\
diff --git a/include/asm-i386/unistd.h b/include/asm-i386/unistd.h
index 0df3f9b0a..ef936b861 100644
--- a/include/asm-i386/unistd.h
+++ b/include/asm-i386/unistd.h
@@ -425,15 +425,7 @@ __syscall_return(type,__res); \
  * won't be any messing with the stack from main(), but we define
  * some others too.
  */
-static inline _syscall0(pid_t,setsid)
-static inline _syscall3(int,write,int,fd,const char *,buf,off_t,count)
-static inline _syscall3(int,read,int,fd,char *,buf,off_t,count)
-static inline _syscall3(off_t,lseek,int,fd,off_t,offset,int,count)
-static inline _syscall1(int,dup,int,fd)
 static inline _syscall3(int,execve,const char *,file,char **,argv,char **,envp)
-static inline _syscall3(int,open,const char *,file,int,flag,int,mode)
-static inline _syscall1(int,close,int,fd)
-static inline _syscall3(pid_t,waitpid,pid_t,pid,int *,wait_stat,int,options)
 
 asmlinkage int sys_modify_ldt(int func, void __user *ptr, unsigned long bytecount);
 asmlinkage long sys_mmap2(unsigned long addr, unsigned long len,
diff --git a/include/asm-ia64/atomic.h b/include/asm-ia64/atomic.h
index cd49762ec..874a6f890 100644
--- a/include/asm-ia64/atomic.h
+++ b/include/asm-ia64/atomic.h
@@ -56,7 +56,7 @@ ia64_atomic64_add (__s64 i, atomic64_t *v)
 		CMPXCHG_BUGCHECK(v);
 		old = atomic_read(v);
 		new = old + i;
-	} while (ia64_cmpxchg(acq, v, old, new, sizeof(atomic_t)) != old);
+	} while (ia64_cmpxchg(acq, v, old, new, sizeof(atomic64_t)) != old);
 	return new;
 }
 
@@ -84,7 +84,7 @@ ia64_atomic64_sub (__s64 i, atomic64_t *v)
 		CMPXCHG_BUGCHECK(v);
 		old = atomic_read(v);
 		new = old - i;
-	} while (ia64_cmpxchg(acq, v, old, new, sizeof(atomic_t)) != old);
+	} while (ia64_cmpxchg(acq, v, old, new, sizeof(atomic64_t)) != old);
 	return new;
 }
 
diff --git a/include/asm-ia64/cyclone.h b/include/asm-ia64/cyclone.h
index 89cc100fa..88f6500e8 100644
--- a/include/asm-ia64/cyclone.h
+++ b/include/asm-ia64/cyclone.h
@@ -3,10 +3,10 @@
 
 #ifdef	CONFIG_IA64_CYCLONE
 extern int use_cyclone;
-extern int __init cyclone_setup(char*);
+extern void __init cyclone_setup(void);
 #else	/* CONFIG_IA64_CYCLONE */
 #define use_cyclone 0
-static inline void cyclone_setup(char* s)
+static inline void cyclone_setup(void)
 {
 	printk(KERN_ERR "Cyclone Counter: System not configured"
 					" w/ CONFIG_IA64_CYCLONE.\n");
diff --git a/include/asm-ia64/dma-mapping.h b/include/asm-ia64/dma-mapping.h
index e2748fadd..8a6d5d72b 100644
--- a/include/asm-ia64/dma-mapping.h
+++ b/include/asm-ia64/dma-mapping.h
@@ -6,6 +6,8 @@
  *	David Mosberger-Tang <davidm@hpl.hp.com>
  */
 
+#include <asm/machvec.h>
+
 #define dma_alloc_coherent	platform_dma_alloc_coherent
 #define dma_alloc_noncoherent	platform_dma_alloc_coherent	/* coherent mem. is cheap */
 #define dma_free_coherent	platform_dma_free_coherent
diff --git a/include/asm-ia64/elf.h b/include/asm-ia64/elf.h
index 9364bb2ee..9557b4998 100644
--- a/include/asm-ia64/elf.h
+++ b/include/asm-ia64/elf.h
@@ -185,9 +185,9 @@ extern void ia64_elf_core_copy_regs (struct pt_regs *src, elf_gregset_t dst);
 #define AT_SYSINFO_EHDR	33
 
 #ifdef __KERNEL__
-struct elf64_hdr;
-extern void ia64_set_personality (struct elf64_hdr *elf_ex, int ibcs2_interpreter);
-#define SET_PERSONALITY(ex, ibcs2)	ia64_set_personality(&(ex), ibcs2)
+#define SET_PERSONALITY(ex, ibcs2)	set_personality(PER_LINUX)
+#define elf_read_implies_exec(ex, have_pt_gnu_stack)					\
+	(!(have_pt_gnu_stack) && ((ex).e_flags & EF_IA_64_LINUX_EXECUTABLE_STACK) != 0)
 
 struct task_struct;
 
diff --git a/include/asm-ia64/fcntl.h b/include/asm-ia64/fcntl.h
index 697dd0bc0..d193981bb 100644
--- a/include/asm-ia64/fcntl.h
+++ b/include/asm-ia64/fcntl.h
@@ -28,6 +28,7 @@
 #define O_LARGEFILE	0100000
 #define O_DIRECTORY	0200000	/* must be a directory */
 #define O_NOFOLLOW	0400000 /* don't follow links */
+#define O_NOATIME	01000000
 
 #define F_DUPFD		0	/* dup */
 #define F_GETFD		1	/* get close_on_exec */
diff --git a/include/asm-ia64/gcc_intrin.h b/include/asm-ia64/gcc_intrin.h
index d3d94e85c..7d2b1e4cd 100644
--- a/include/asm-ia64/gcc_intrin.h
+++ b/include/asm-ia64/gcc_intrin.h
@@ -489,10 +489,16 @@ register unsigned long ia64_r13 asm ("r13") __attribute_used__;
 #define ia64_ptce(addr)	asm volatile ("ptc.e %0" :: "r"(addr))
 
 #define ia64_ptcga(addr, size)							\
-	asm volatile ("ptc.ga %0,%1" :: "r"(addr), "r"(size) : "memory")
+do {										\
+	asm volatile ("ptc.ga %0,%1" :: "r"(addr), "r"(size) : "memory");	\
+	ia64_dv_serialize_data();						\
+} while (0)
 
-#define ia64_ptcl(addr, size)						\
-	asm volatile ("ptc.l %0,%1" :: "r"(addr), "r"(size) : "memory")
+#define ia64_ptcl(addr, size)							\
+do {										\
+	asm volatile ("ptc.l %0,%1" :: "r"(addr), "r"(size) : "memory");	\
+	ia64_dv_serialize_data();						\
+} while (0)
 
 #define ia64_ptri(addr, size)						\
 	asm volatile ("ptr.i %0,%1" :: "r"(addr), "r"(size) : "memory")
@@ -581,7 +587,7 @@ register unsigned long ia64_r13 asm ("r13") __attribute_used__;
 
 #define ia64_intrin_local_irq_restore(x)			\
 do {								\
-	asm volatile ("     cmp.ne p6,p7=%0,r0;;"		\
+	asm volatile (";;   cmp.ne p6,p7=%0,r0;;"		\
 		      "(p6) ssm psr.i;"				\
 		      "(p7) rsm psr.i;;"			\
 		      "(p6) srlz.d"				\
diff --git a/include/asm-ia64/ia32.h b/include/asm-ia64/ia32.h
index 75dd0d334..4fa4b8e12 100644
--- a/include/asm-ia64/ia32.h
+++ b/include/asm-ia64/ia32.h
@@ -6,7 +6,8 @@
 #include <asm/ptrace.h>
 #include <asm/signal.h>
 
-#define IA32_NR_syscalls		283 /* length of syscall table */
+#define IA32_NR_syscalls		283	/* length of syscall table */
+#define IA32_PAGE_SHIFT			12	/* 4KB pages */
 
 #ifndef __ASSEMBLY__
 
@@ -24,6 +25,13 @@ extern int ia32_clone_tls (struct task_struct *child, struct pt_regs *childregs)
 /* Declare this unconditionally, so we don't get warnings for unreachable code.  */
 extern int ia32_setup_frame1 (int sig, struct k_sigaction *ka, siginfo_t *info,
 			      sigset_t *set, struct pt_regs *regs);
+#if PAGE_SHIFT > IA32_PAGE_SHIFT
+extern int ia32_copy_partial_page_list (struct task_struct *, unsigned long);
+extern void ia32_drop_partial_page_list (struct task_struct *);
+#else
+# define ia32_copy_partial_page_list(a1, a2)	0
+# define ia32_drop_partial_page_list(a1)	do { ; } while (0)
+#endif
 
 #endif /* !__ASSEMBLY__ */
 
diff --git a/include/asm-ia64/iosapic.h b/include/asm-ia64/iosapic.h
index d5bda84ae..3fac17e98 100644
--- a/include/asm-ia64/iosapic.h
+++ b/include/asm-ia64/iosapic.h
@@ -1,13 +1,11 @@
 #ifndef __ASM_IA64_IOSAPIC_H
 #define __ASM_IA64_IOSAPIC_H
 
-#define	IOSAPIC_DEFAULT_ADDR	0xFEC00000
-
 #define	IOSAPIC_REG_SELECT	0x0
 #define	IOSAPIC_WINDOW		0x10
 #define	IOSAPIC_EOI		0x40
 
-#define	IOSAPIC_VERSION	0x1
+#define	IOSAPIC_VERSION		0x1
 
 /*
  * Redirection table entry
@@ -55,12 +53,28 @@
 
 #define NR_IOSAPICS			256
 
+static inline unsigned int iosapic_read(char *iosapic, unsigned int reg)
+{
+	writel(reg, iosapic + IOSAPIC_REG_SELECT);
+	return readl(iosapic + IOSAPIC_WINDOW);
+}
+
+static inline void iosapic_write(char *iosapic, unsigned int reg, u32 val)
+{
+	writel(reg, iosapic + IOSAPIC_REG_SELECT);
+	writel(val, iosapic + IOSAPIC_WINDOW);
+}
+
+static inline void iosapic_eoi(char *iosapic, u32 vector)
+{
+	writel(vector, iosapic + IOSAPIC_EOI);
+}
+
 extern void __init iosapic_system_init (int pcat_compat);
 extern void __init iosapic_init (unsigned long address,
 				    unsigned int gsi_base);
 extern int gsi_to_vector (unsigned int gsi);
 extern int gsi_to_irq (unsigned int gsi);
-extern void __init iosapic_parse_prt (void);
 extern void iosapic_enable_intr (unsigned int vector);
 extern int iosapic_register_intr (unsigned int gsi, unsigned long polarity,
 				  unsigned long trigger);
diff --git a/include/asm-ia64/irq.h b/include/asm-ia64/irq.h
index 5d930fdc0..bd07d11d9 100644
--- a/include/asm-ia64/irq.h
+++ b/include/asm-ia64/irq.h
@@ -30,6 +30,12 @@ extern void disable_irq_nosync (unsigned int);
 extern void enable_irq (unsigned int);
 extern void set_irq_affinity_info (unsigned int irq, int dest, int redir);
 
+#ifdef CONFIG_SMP
+extern void move_irq(int irq);
+#else
+#define move_irq(irq)
+#endif
+
 struct irqaction;
 struct pt_regs;
 int handle_IRQ_event(unsigned int, struct pt_regs *, struct irqaction *);
diff --git a/include/asm-ia64/machvec.h b/include/asm-ia64/machvec.h
index 257b98074..ff881e2bf 100644
--- a/include/asm-ia64/machvec.h
+++ b/include/asm-ia64/machvec.h
@@ -19,6 +19,7 @@ struct pt_regs;
 struct scatterlist;
 struct irq_desc;
 struct page;
+struct mm_struct;
 
 typedef void ia64_mv_setup_t (char **);
 typedef void ia64_mv_cpu_init_t (void);
@@ -26,9 +27,10 @@ typedef void ia64_mv_irq_init_t (void);
 typedef void ia64_mv_send_ipi_t (int, int, int, int);
 typedef void ia64_mv_timer_interrupt_t (int, void *, struct pt_regs *);
 typedef void ia64_mv_global_tlb_purge_t (unsigned long, unsigned long, unsigned long);
+typedef void ia64_mv_tlb_migrate_finish_t (struct mm_struct *);
 typedef struct irq_desc *ia64_mv_irq_desc (unsigned int);
-typedef u8 ia64_mv_irq_to_vector (u8);
-typedef unsigned int ia64_mv_local_vector_to_irq (u8 vector);
+typedef u8 ia64_mv_irq_to_vector (unsigned int);
+typedef unsigned int ia64_mv_local_vector_to_irq (u8);
 
 /* DMA-mapping interface: */
 typedef void ia64_mv_dma_init (void);
@@ -69,11 +71,21 @@ typedef unsigned short ia64_mv_readw_relaxed_t (void *);
 typedef unsigned int ia64_mv_readl_relaxed_t (void *);
 typedef unsigned long ia64_mv_readq_relaxed_t (void *);
 
-extern void machvec_noop (void);
+static inline void
+machvec_noop (void)
+{
+}
+
+static inline void
+machvec_noop_mm (struct mm_struct *mm)
+{
+}
+
 extern void machvec_setup (char **);
 extern void machvec_timer_interrupt (int, void *, struct pt_regs *);
 extern void machvec_dma_sync_single (struct device *, dma_addr_t, size_t, int);
 extern void machvec_dma_sync_sg (struct device *, struct scatterlist *, int, int);
+extern void machvec_tlb_migrate_finish (struct mm_struct *);
 
 # if defined (CONFIG_IA64_HP_SIM)
 #  include <asm/machvec_hpsim.h>
@@ -95,6 +107,7 @@ extern void machvec_dma_sync_sg (struct device *, struct scatterlist *, int, int
 #  define platform_send_ipi	ia64_mv.send_ipi
 #  define platform_timer_interrupt	ia64_mv.timer_interrupt
 #  define platform_global_tlb_purge	ia64_mv.global_tlb_purge
+#  define platform_tlb_migrate_finish	ia64_mv.tlb_migrate_finish
 #  define platform_dma_init		ia64_mv.dma_init
 #  define platform_dma_alloc_coherent	ia64_mv.dma_alloc_coherent
 #  define platform_dma_free_coherent	ia64_mv.dma_free_coherent
@@ -140,6 +153,7 @@ struct ia64_machine_vector {
 	ia64_mv_send_ipi_t *send_ipi;
 	ia64_mv_timer_interrupt_t *timer_interrupt;
 	ia64_mv_global_tlb_purge_t *global_tlb_purge;
+	ia64_mv_tlb_migrate_finish_t *tlb_migrate_finish;
 	ia64_mv_dma_init *dma_init;
 	ia64_mv_dma_alloc_coherent *dma_alloc_coherent;
 	ia64_mv_dma_free_coherent *dma_free_coherent;
@@ -181,6 +195,7 @@ struct ia64_machine_vector {
 	platform_send_ipi,			\
 	platform_timer_interrupt,		\
 	platform_global_tlb_purge,		\
+	platform_tlb_migrate_finish,		\
 	platform_dma_init,			\
 	platform_dma_alloc_coherent,		\
 	platform_dma_free_coherent,		\
@@ -260,6 +275,9 @@ extern ia64_mv_dma_supported		swiotlb_dma_supported;
 #ifndef platform_global_tlb_purge
 # define platform_global_tlb_purge	ia64_global_tlb_purge /* default to architected version */
 #endif
+#ifndef platform_tlb_migrate_finish
+# define platform_tlb_migrate_finish	machvec_noop_mm
+#endif
 #ifndef platform_dma_init
 # define platform_dma_init		swiotlb_init
 #endif
diff --git a/include/asm-ia64/machvec_sn2.h b/include/asm-ia64/machvec_sn2.h
index 61227b8aa..9334851e1 100644
--- a/include/asm-ia64/machvec_sn2.h
+++ b/include/asm-ia64/machvec_sn2.h
@@ -39,6 +39,7 @@ extern ia64_mv_irq_init_t sn_irq_init;
 extern ia64_mv_send_ipi_t sn2_send_IPI;
 extern ia64_mv_timer_interrupt_t sn_timer_interrupt;
 extern ia64_mv_global_tlb_purge_t sn2_global_tlb_purge;
+extern ia64_mv_tlb_migrate_finish_t	sn_tlb_migrate_finish;
 extern ia64_mv_irq_desc sn_irq_desc;
 extern ia64_mv_irq_to_vector sn_irq_to_vector;
 extern ia64_mv_local_vector_to_irq sn_local_vector_to_irq;
@@ -83,6 +84,7 @@ extern ia64_mv_dma_supported		sn_dma_supported;
 #define platform_send_ipi		sn2_send_IPI
 #define platform_timer_interrupt	sn_timer_interrupt
 #define platform_global_tlb_purge       sn2_global_tlb_purge
+#define platform_tlb_migrate_finish	sn_tlb_migrate_finish
 #define platform_pci_fixup		sn_pci_fixup
 #define platform_inb			__sn_inb
 #define platform_inw			__sn_inw
diff --git a/include/asm-ia64/numnodes.h b/include/asm-ia64/numnodes.h
index 217171bc3..4fed3ac3c 100644
--- a/include/asm-ia64/numnodes.h
+++ b/include/asm-ia64/numnodes.h
@@ -4,6 +4,9 @@
 #ifdef CONFIG_IA64_DIG
 /* Max 8 Nodes */
 #define NODES_SHIFT	3
+#elif defined(CONFIG_IA64_HP_ZX1)
+/* Max 32 Nodes */
+#define NODES_SHIFT	5
 #elif defined(CONFIG_IA64_SGI_SN2) || defined(CONFIG_IA64_GENERIC)
 /* Max 256 Nodes */
 #define NODES_SHIFT	8
diff --git a/include/asm-ia64/page.h b/include/asm-ia64/page.h
index 58cc74482..315a86310 100644
--- a/include/asm-ia64/page.h
+++ b/include/asm-ia64/page.h
@@ -184,7 +184,7 @@ get_order (unsigned long size)
 
 #define VM_DATA_DEFAULT_FLAGS		(VM_READ | VM_WRITE |					\
 					 VM_MAYREAD | VM_MAYWRITE | VM_MAYEXEC |		\
-					 (((current->thread.flags & IA64_THREAD_XSTACK) != 0)	\
+					 (((current->personality & READ_IMPLIES_EXEC) != 0)	\
 					  ? VM_EXEC : 0))
 
 #endif /* _ASM_IA64_PAGE_H */
diff --git a/include/asm-ia64/pgalloc.h b/include/asm-ia64/pgalloc.h
index 68be9d57c..973316828 100644
--- a/include/asm-ia64/pgalloc.h
+++ b/include/asm-ia64/pgalloc.h
@@ -37,14 +37,20 @@
 static inline pgd_t*
 pgd_alloc_one_fast (struct mm_struct *mm)
 {
-	unsigned long *ret = pgd_quicklist;
+	unsigned long *ret = NULL;
 
+	preempt_disable();
+
+	ret = pgd_quicklist;
 	if (likely(ret != NULL)) {
 		pgd_quicklist = (unsigned long *)(*ret);
 		ret[0] = 0;
 		--pgtable_cache_size;
 	} else
 		ret = NULL;
+
+	preempt_enable();
+
 	return (pgd_t *) ret;
 }
 
@@ -65,9 +71,11 @@ pgd_alloc (struct mm_struct *mm)
 static inline void
 pgd_free (pgd_t *pgd)
 {
+	preempt_disable();
 	*(unsigned long *)pgd = (unsigned long) pgd_quicklist;
 	pgd_quicklist = (unsigned long *) pgd;
 	++pgtable_cache_size;
+	preempt_enable();
 }
 
 static inline void
@@ -80,13 +88,19 @@ pgd_populate (struct mm_struct *mm, pgd_t *pgd_entry, pmd_t *pmd)
 static inline pmd_t*
 pmd_alloc_one_fast (struct mm_struct *mm, unsigned long addr)
 {
-	unsigned long *ret = (unsigned long *)pmd_quicklist;
+	unsigned long *ret = NULL;
 
+	preempt_disable();
+
+	ret = (unsigned long *)pmd_quicklist;
 	if (likely(ret != NULL)) {
 		pmd_quicklist = (unsigned long *)(*ret);
 		ret[0] = 0;
 		--pgtable_cache_size;
 	}
+
+	preempt_enable();
+
 	return (pmd_t *)ret;
 }
 
@@ -103,9 +117,11 @@ pmd_alloc_one (struct mm_struct *mm, unsigned long addr)
 static inline void
 pmd_free (pmd_t *pmd)
 {
+	preempt_disable();
 	*(unsigned long *)pmd = (unsigned long) pmd_quicklist;
 	pmd_quicklist = (unsigned long *) pmd;
 	++pgtable_cache_size;
+	preempt_enable();
 }
 
 #define __pmd_free_tlb(tlb, pmd)	pmd_free(pmd)
diff --git a/include/asm-ia64/pgtable.h b/include/asm-ia64/pgtable.h
index 590432c08..843396653 100644
--- a/include/asm-ia64/pgtable.h
+++ b/include/asm-ia64/pgtable.h
@@ -297,11 +297,7 @@ ia64_phys_addr_valid (unsigned long addr)
  * works bypasses the caches, but does allow for consecutive writes to
  * be combined into single (but larger) write transactions.
  */
-#ifdef CONFIG_MCKINLEY_A0_SPECIFIC
-# define pgprot_writecombine(prot)	prot
-#else
-# define pgprot_writecombine(prot)	__pgprot((pgprot_val(prot) & ~_PAGE_MA_MASK) | _PAGE_MA_WC)
-#endif
+#define pgprot_writecombine(prot)	__pgprot((pgprot_val(prot) & ~_PAGE_MA_MASK) | _PAGE_MA_WC)
 
 static inline unsigned long
 pgd_index (unsigned long address)
@@ -325,6 +321,11 @@ pgd_offset (struct mm_struct *mm, unsigned long address)
 #define pgd_offset_k(addr) \
 	(init_mm.pgd + (((addr) >> PGDIR_SHIFT) & (PTRS_PER_PGD - 1)))
 
+/* Look up a pgd entry in the gate area.  On IA-64, the gate-area
+   resides in the kernel-mapped segment, hence we use pgd_offset_k()
+   here.  */
+#define pgd_offset_gate(mm, addr)	pgd_offset_k(addr)
+
 /* Find an entry in the second-level page table.. */
 #define pmd_offset(dir,addr) \
 	((pmd_t *) pgd_page(*(dir)) + (((addr) >> PMD_SHIFT) & (PTRS_PER_PMD - 1)))
@@ -346,6 +347,8 @@ static inline int
 ptep_test_and_clear_young (pte_t *ptep)
 {
 #ifdef CONFIG_SMP
+	if (!pte_young(*ptep))
+		return 0;
 	return test_and_clear_bit(_PAGE_A_BIT, ptep);
 #else
 	pte_t pte = *ptep;
@@ -360,6 +363,8 @@ static inline int
 ptep_test_and_clear_dirty (pte_t *ptep)
 {
 #ifdef CONFIG_SMP
+	if (!pte_dirty(*ptep))
+		return 0;
 	return test_and_clear_bit(_PAGE_D_BIT, ptep);
 #else
 	pte_t pte = *ptep;
@@ -552,6 +557,7 @@ do {											\
 #define __HAVE_ARCH_PTEP_SET_WRPROTECT
 #define __HAVE_ARCH_PTEP_MKDIRTY
 #define __HAVE_ARCH_PTE_SAME
+#define __HAVE_ARCH_PGD_OFFSET_GATE
 #include <asm-generic/pgtable.h>
 
 #endif /* _ASM_IA64_PGTABLE_H */
diff --git a/include/asm-ia64/processor.h b/include/asm-ia64/processor.h
index 05e9913e0..f62f93c29 100644
--- a/include/asm-ia64/processor.h
+++ b/include/asm-ia64/processor.h
@@ -2,7 +2,7 @@
 #define _ASM_IA64_PROCESSOR_H
 
 /*
- * Copyright (C) 1998-2003 Hewlett-Packard Co
+ * Copyright (C) 1998-2004 Hewlett-Packard Co
  *	David Mosberger-Tang <davidm@hpl.hp.com>
  *	Stephane Eranian <eranian@hpl.hp.com>
  * Copyright (C) 1999 Asit Mallick <asit.k.mallick@intel.com>
@@ -61,7 +61,6 @@
 							/* bit 5 is currently unused */
 #define IA64_THREAD_FPEMU_NOPRINT (__IA64_UL(1) << 6)	/* don't log any fpswa faults */
 #define IA64_THREAD_FPEMU_SIGFPE  (__IA64_UL(1) << 7)	/* send a SIGFPE for fpswa faults */
-#define IA64_THREAD_XSTACK	(__IA64_UL(1) << 8)	/* stack executable by default? */
 
 #define IA64_THREAD_UAC_SHIFT	3
 #define IA64_THREAD_UAC_MASK	(IA64_THREAD_UAC_NOPRINT | IA64_THREAD_UAC_SIGBUS)
@@ -230,6 +229,7 @@ struct desc_struct {
 
 #define TLS_SIZE (GDT_ENTRY_TLS_ENTRIES * 8)
 
+struct partial_page_list;
 #endif
 
 struct thread_struct {
@@ -251,6 +251,7 @@ struct thread_struct {
 	__u64 fdr;			/* IA32 fp except. data reg */
 	__u64 old_k1;			/* old value of ar.k1 */
 	__u64 old_iob;			/* old IOBase value */
+	struct partial_page_list *ppl;	/* partial page list for 4K page size issue */
         /* cached TLS descriptors. */
 	struct desc_struct tls_array[GDT_ENTRY_TLS_ENTRIES];
 
@@ -260,7 +261,8 @@ struct thread_struct {
 				.fir =		0,			\
 				.fdr =		0,			\
 				.old_k1 =	0,			\
-				.old_iob =	0,
+				.old_iob =	0,			\
+				.ppl =		0,
 #else
 # define INIT_THREAD_IA32
 #endif /* CONFIG_IA32_SUPPORT */
diff --git a/include/asm-ia64/resource.h b/include/asm-ia64/resource.h
index 06d11777d..76345b5c1 100644
--- a/include/asm-ia64/resource.h
+++ b/include/asm-ia64/resource.h
@@ -23,8 +23,10 @@
 #define RLIMIT_MEMLOCK	8		/* max locked-in-memory address space */
 #define RLIMIT_AS	9		/* address space limit */
 #define RLIMIT_LOCKS	10		/* maximum file locks held */
+#define RLIMIT_SIGPENDING 11		/* max number of pending signals */
+#define RLIMIT_MSGQUEUE 12		/* maximum bytes in POSIX mqueues */
 
-#define RLIM_NLIMITS	11
+#define RLIM_NLIMITS	13
 
 /*
  * SuS says limits have to be unsigned.
@@ -47,6 +49,8 @@
 	{ RLIM_INFINITY, RLIM_INFINITY },		\
 	{ RLIM_INFINITY, RLIM_INFINITY },		\
 	{ RLIM_INFINITY, RLIM_INFINITY },		\
+	{ MAX_SIGPENDING, MAX_SIGPENDING },		\
+	{ MQ_BYTES_MAX, MQ_BYTES_MAX },			\
 }
 
 # endif /* __KERNEL__ */
diff --git a/include/asm-ia64/smp.h b/include/asm-ia64/smp.h
index f12f939e3..513c704d1 100644
--- a/include/asm-ia64/smp.h
+++ b/include/asm-ia64/smp.h
@@ -123,5 +123,9 @@ extern void smp_send_reschedule (int cpu);
 extern void lock_ipi_calllock(void);
 extern void unlock_ipi_calllock(void);
 
+#else
+
+#define cpu_logical_id(cpuid)		0
+
 #endif /* CONFIG_SMP */
 #endif /* _ASM_IA64_SMP_H */
diff --git a/include/asm-ia64/sn/bte.h b/include/asm-ia64/sn/bte.h
index 538385a21..1b643d1e0 100644
--- a/include/asm-ia64/sn/bte.h
+++ b/include/asm-ia64/sn/bte.h
@@ -3,7 +3,7 @@
  * License.  See the file "COPYING" in the main directory of this archive
  * for more details.
  *
- * Copyright (c) 2000-2003 Silicon Graphics, Inc.  All Rights Reserved.
+ * Copyright (c) 2000-2004 Silicon Graphics, Inc.  All Rights Reserved.
  */
 
 
@@ -48,35 +48,31 @@
 #define BTE_ZERO_FILL (BTE_NOTIFY | IBCT_ZFIL_MODE)
 /* Use a reserved bit to let the caller specify a wait for any BTE */
 #define BTE_WACQUIRE (0x4000)
+/* Use the BTE on the node with the destination memory */
+#define BTE_USE_DEST (BTE_WACQUIRE << 1)
+/* Use any available BTE interface on any node for the transfer */
+#define BTE_USE_ANY (BTE_USE_DEST << 1)
 /* macro to force the IBCT0 value valid */
 #define BTE_VALID_MODE(x) ((x) & (IBCT_NOTIFY | IBCT_ZFIL_MODE))
 
-
-/*
- * Handle locking of the bte interfaces.
- *
- * All transfers spinlock the interface before setting up the SHUB
- * registers.  Sync transfers hold the lock until all processing is
- * complete.  Async transfers release the lock as soon as the transfer
- * is initiated.
- *
- * To determine if an interface is available, we must check both the
- * busy bit and the spinlock for that interface.
- */
-#define BTE_LOCK_IF_AVAIL(_x) (\
-	(*pda->cpu_bte_if[_x]->most_rcnt_na & (IBLS_BUSY | IBLS_ERROR)) && \
-	(!(spin_trylock(&(pda->cpu_bte_if[_x]->spinlock)))) \
-	)
+#define BTE_ACTIVE	(IBLS_BUSY | IBLS_ERROR)
 
 /*
  * Some macros to simplify reading.
  * Start with macros to locate the BTE control registers.
  */
-#define BTEREG_LNSTAT_ADDR ((u64 *)(bte->bte_base_addr))
-#define BTEREG_SRC_ADDR ((u64 *)(bte->bte_base_addr + BTEOFF_SRC))
-#define BTEREG_DEST_ADDR ((u64 *)(bte->bte_base_addr + BTEOFF_DEST))
-#define BTEREG_CTRL_ADDR ((u64 *)(bte->bte_base_addr + BTEOFF_CTRL))
-#define BTEREG_NOTIF_ADDR ((u64 *)(bte->bte_base_addr + BTEOFF_NOTIFY))
+#define BTE_LNSTAT_LOAD(_bte)						\
+			HUB_L(_bte->bte_base_addr)
+#define BTE_LNSTAT_STORE(_bte, _x)					\
+			HUB_S(_bte->bte_base_addr, (_x))
+#define BTE_SRC_STORE(_bte, _x)						\
+			HUB_S(_bte->bte_base_addr + (BTEOFF_SRC/8), (_x))
+#define BTE_DEST_STORE(_bte, _x)					\
+			HUB_S(_bte->bte_base_addr + (BTEOFF_DEST/8), (_x))
+#define BTE_CTRL_STORE(_bte, _x)					\
+			HUB_S(_bte->bte_base_addr + (BTEOFF_CTRL/8), (_x))
+#define BTE_NOTIF_STORE(_bte, _x)					\
+			HUB_S(_bte->bte_base_addr + (BTEOFF_NOTIFY/8), (_x))
 
 
 /* Possible results from bte_copy and bte_unaligned_copy */
@@ -110,16 +106,15 @@ typedef enum {
  * to work with a BTE.
  */
 struct bteinfo_s {
-	u64 volatile notify ____cacheline_aligned;
-	char *bte_base_addr ____cacheline_aligned;
+	volatile u64 notify ____cacheline_aligned;
+	u64 *bte_base_addr ____cacheline_aligned;
 	spinlock_t spinlock;
 	cnodeid_t bte_cnode;	/* cnode                            */
 	int bte_error_count;	/* Number of errors encountered     */
 	int bte_num;		/* 0 --> BTE0, 1 --> BTE1           */
 	int cleanup_active;	/* Interface is locked for cleanup  */
 	volatile bte_result_t bh_error;	/* error while processing   */
-	u64 volatile *most_rcnt_na;
-	void *scratch_buf;	/* Node local scratch buffer        */
+	volatile u64 *most_rcnt_na;
 };
 
 
@@ -130,6 +125,8 @@ extern bte_result_t bte_copy(u64, u64, u64, u64, void *);
 extern bte_result_t bte_unaligned_copy(u64, u64, u64, u64);
 extern void bte_error_handler(unsigned long);
 
+#define bte_zero(dest, len, mode, notification) \
+	bte_copy(0, dest, len, ((mode) | BTE_ZERO_FILL), notification)
 
 /*
  * The following is the prefered way of calling bte_unaligned_copy
diff --git a/include/asm-ia64/sn/module.h b/include/asm-ia64/sn/module.h
index b7c7dd2ab..172f459fc 100644
--- a/include/asm-ia64/sn/module.h
+++ b/include/asm-ia64/sn/module.h
@@ -180,7 +180,7 @@ struct module_s {
 };
 
 /* module.c */
-extern module_t	       *modules[MODULE_MAX];	/* Indexed by cmoduleid_t   */
+extern module_t	       *sn_modules[MODULE_MAX];	/* Indexed by cmoduleid_t   */
 extern int		nummodules;
 
 extern module_t	       *module_lookup(moduleid_t id);
diff --git a/include/asm-ia64/sn/pda.h b/include/asm-ia64/sn/pda.h
index 20e9b5775..fa472c3f9 100644
--- a/include/asm-ia64/sn/pda.h
+++ b/include/asm-ia64/sn/pda.h
@@ -49,8 +49,6 @@ typedef struct pda_s {
 	volatile unsigned long *pio_shub_war_cam_addr;
 	volatile unsigned long *mem_write_status_addr;
 
-	struct bteinfo_s *cpu_bte_if[BTES_PER_NODE];	/* cpu interface order */
-
 	unsigned long	sn_soft_irr[4];
 	unsigned long	sn_in_service_ivecs[4];
 	short		cnodeid_to_nasid_table[MAX_NUMNODES];
diff --git a/include/asm-ia64/sn/sn2/io.h b/include/asm-ia64/sn/sn2/io.h
index 1ed535abd..4cc94e9ad 100644
--- a/include/asm-ia64/sn/sn2/io.h
+++ b/include/asm-ia64/sn/sn2/io.h
@@ -8,10 +8,11 @@
 
 #ifndef _ASM_SN_SN2_IO_H
 #define _ASM_SN_SN2_IO_H
+#include <linux/compiler.h>
+#include <asm/intrinsics.h>
 
-extern void * sn_io_addr(unsigned long port); /* Forward definition */
+extern void * sn_io_addr(unsigned long port) __attribute_const__; /* Forward definition */
 extern void sn_mmiob(void); /* Forward definition */
-#include <asm/intrinsics.h>
 
 #define __sn_mf_a()   ia64_mfa()
 
diff --git a/include/asm-ia64/sn/sn_cpuid.h b/include/asm-ia64/sn/sn_cpuid.h
index 0c7cce652..6f1128f1e 100644
--- a/include/asm-ia64/sn/sn_cpuid.h
+++ b/include/asm-ia64/sn/sn_cpuid.h
@@ -84,7 +84,6 @@
  */
 
 #ifndef CONFIG_SMP
-#define cpu_logical_id(cpu)				0
 #define cpu_physical_id(cpuid)			((ia64_getreg(_IA64_REG_CR_LID) >> 16) & 0xffff)
 #endif
 
diff --git a/include/asm-ia64/sn/sn_sal.h b/include/asm-ia64/sn/sn_sal.h
index 0c2343152..5bd9b3335 100644
--- a/include/asm-ia64/sn/sn_sal.h
+++ b/include/asm-ia64/sn/sn_sal.h
@@ -33,6 +33,7 @@
 #define  SN_SAL_NO_FAULT_ZONE_VIRTUAL		   0x02000010
 #define  SN_SAL_NO_FAULT_ZONE_PHYSICAL		   0x02000011
 #define  SN_SAL_PRINT_ERROR			   0x02000012
+#define  SN_SAL_SET_ERROR_HANDLING_FEATURES	   0x0200001a	// reentrant
 #define  SN_SAL_CONSOLE_PUTC                       0x02000021
 #define  SN_SAL_CONSOLE_GETC                       0x02000022
 #define  SN_SAL_CONSOLE_PUTS                       0x02000023
@@ -92,6 +93,19 @@
 #define SALRET_INVALID_ARG	-2
 #define SALRET_ERROR		-3
 
+/*
+ * SN_SAL_SET_ERROR_HANDLING_FEATURES bit settings
+ */
+enum 
+{
+	/* if "rz always" is set, have the mca slaves call os_init_slave */
+	SN_SAL_EHF_MCA_SLV_TO_OS_INIT_SLV=0,
+	/* do not rz on tlb checks, even if "rz always" is set */
+	SN_SAL_EHF_NO_RZ_TLBC,
+	/* do not rz on PIO reads to I/O space, even if "rz always" is set */
+	SN_SAL_EHF_NO_RZ_IO_READ,
+};
+
 
 /**
  * sn_sal_rev_major - get the major SGI SAL revision number
@@ -127,8 +141,8 @@ sn_sal_rev_minor(void)
  * Specify the minimum PROM revsion required for this kernel.
  * Note that they're stored in hex format...
  */
-#define SN_SAL_MIN_MAJOR	0x1  /* SN2 kernels need at least PROM 1.0 */
-#define SN_SAL_MIN_MINOR	0x0
+#define SN_SAL_MIN_MAJOR	0x3  /* SN2 kernels need at least PROM 3.40 */
+#define SN_SAL_MIN_MINOR	0x40
 
 u64 ia64_sn_probe_io_slot(long paddr, long size, void *data_ptr);
 
@@ -670,4 +684,24 @@ ia64_sn_sysctl_iobrick_pci_op(nasid_t n, u64 connection_type,
 	return 0;
 }
 
+/*
+ * Tell the prom how the OS wants to handle specific error features.
+ * It takes an array of 7 u64.
+ */
+static inline u64
+ia64_sn_set_error_handling_features(const u64 *feature_bits)
+{
+	struct ia64_sal_retval rv = {0, 0, 0, 0};
+
+	SAL_CALL_REENTRANT(rv, SN_SAL_SET_ERROR_HANDLING_FEATURES,
+			feature_bits[0],
+			feature_bits[1],
+			feature_bits[2],
+			feature_bits[3],
+			feature_bits[4],
+			feature_bits[5],
+			feature_bits[6]);
+	return rv.status;
+}
+
 #endif /* _ASM_IA64_SN_SN_SAL_H */
diff --git a/include/asm-ia64/system.h b/include/asm-ia64/system.h
index 57c7db10a..83b2c1bc0 100644
--- a/include/asm-ia64/system.h
+++ b/include/asm-ia64/system.h
@@ -171,7 +171,7 @@ do {								\
 # define local_irq_restore(x)	__local_irq_restore(x)
 #endif /* !CONFIG_IA64_DEBUG_IRQ */
 
-#define local_irq_enable()	({ ia64_ssm(IA64_PSR_I); ia64_srlz_d(); })
+#define local_irq_enable()	({ ia64_stop(); ia64_ssm(IA64_PSR_I); ia64_srlz_d(); })
 #define local_save_flags(flags)	({ ia64_stop(); (flags) = ia64_getreg(_IA64_REG_PSR); })
 
 #define irqs_disabled()				\
diff --git a/include/asm-ia64/thread_info.h b/include/asm-ia64/thread_info.h
index f7141942e..665623bf4 100644
--- a/include/asm-ia64/thread_info.h
+++ b/include/asm-ia64/thread_info.h
@@ -73,12 +73,15 @@ struct thread_info {
 #define TIF_SIGPENDING		1	/* signal pending */
 #define TIF_NEED_RESCHED	2	/* rescheduling necessary */
 #define TIF_SYSCALL_TRACE	3	/* syscall trace active */
+#define TIF_SYSCALL_AUDIT	4	/* syscall auditing active */
 #define TIF_POLLING_NRFLAG	16	/* true if poll_idle() is polling TIF_NEED_RESCHED */
 
 #define TIF_WORK_MASK		0x7	/* like TIF_ALLWORK_BITS but sans TIF_SYSCALL_TRACE */
-#define TIF_ALLWORK_MASK	0xf	/* bits 0..3 are "work to do on user-return" bits */
+#define TIF_ALLWORK_MASK	0x1f	/* bits 0..4 are "work to do on user-return" bits */
 
 #define _TIF_SYSCALL_TRACE	(1 << TIF_SYSCALL_TRACE)
+#define _TIF_SYSCALL_AUDIT	(1 << TIF_SYSCALL_AUDIT)
+#define _TIF_SYSCALL_TRACEAUDIT	(_TIF_SYSCALL_TRACE|_TIF_SYSCALL_AUDIT)
 #define _TIF_NOTIFY_RESUME	(1 << TIF_NOTIFY_RESUME)
 #define _TIF_SIGPENDING		(1 << TIF_SIGPENDING)
 #define _TIF_NEED_RESCHED	(1 << TIF_NEED_RESCHED)
diff --git a/include/asm-ia64/tlb.h b/include/asm-ia64/tlb.h
index f1ff70964..d5c39f752 100644
--- a/include/asm-ia64/tlb.h
+++ b/include/asm-ia64/tlb.h
@@ -44,6 +44,7 @@
 #include <asm/pgalloc.h>
 #include <asm/processor.h>
 #include <asm/tlbflush.h>
+#include <asm/machvec.h>
 
 #ifdef CONFIG_SMP
 # define FREE_PTE_NR		2048
@@ -212,6 +213,8 @@ __tlb_remove_tlb_entry (struct mmu_gather *tlb, pte_t *ptep, unsigned long addre
 	tlb->end_addr = address + PAGE_SIZE;
 }
 
+#define tlb_migrate_finish(mm)	platform_tlb_migrate_finish(mm)
+
 #define tlb_start_vma(tlb, vma)			do { } while (0)
 #define tlb_end_vma(tlb, vma)			do { } while (0)
 
diff --git a/include/asm-ia64/unistd.h b/include/asm-ia64/unistd.h
index ca3c7b958..d46f47f97 100644
--- a/include/asm-ia64/unistd.h
+++ b/include/asm-ia64/unistd.h
@@ -266,6 +266,8 @@
 
 #define NR_syscalls			256 /* length of syscall table */
 
+#define __ARCH_WANT_SYS_RT_SIGACTION
+
 #ifdef CONFIG_IA32_SUPPORT
 # define __ARCH_WANT_SYS_FADVISE64
 # define __ARCH_WANT_SYS_GETPGRP
@@ -275,7 +277,6 @@
 # define __ARCH_WANT_SYS_OLDUMOUNT
 # define __ARCH_WANT_SYS_SIGPENDING
 # define __ARCH_WANT_SYS_SIGPROCMASK
-# define __ARCH_WANT_SYS_RT_SIGACTION
 #endif
 
 #if !defined(__ASSEMBLY__) && !defined(ASSEMBLER)
diff --git a/include/asm-m68k/atomic.h b/include/asm-m68k/atomic.h
index d7ef37661..3f8677380 100644
--- a/include/asm-m68k/atomic.h
+++ b/include/asm-m68k/atomic.h
@@ -1,6 +1,8 @@
 #ifndef __ARCH_M68K_ATOMIC__
 #define __ARCH_M68K_ATOMIC__
 
+#include <asm/system.h>	/* local_irq_XXX() */
+
 /*
  * Atomic operations that C can't guarantee us.  Useful for
  * resource counting etc..
@@ -16,38 +18,124 @@ typedef struct { int counter; } atomic_t;
 #define atomic_read(v)		((v)->counter)
 #define atomic_set(v, i)	(((v)->counter) = i)
 
-static __inline__ void atomic_add(int i, atomic_t *v)
+static inline void atomic_add(int i, atomic_t *v)
+{
+	__asm__ __volatile__("addl %1,%0" : "+m" (*v) : "id" (i));
+}
+
+static inline void atomic_sub(int i, atomic_t *v)
+{
+	__asm__ __volatile__("subl %1,%0" : "+m" (*v) : "id" (i));
+}
+
+static inline void atomic_inc(atomic_t *v)
+{
+	__asm__ __volatile__("addql #1,%0" : "+m" (*v));
+}
+
+static inline void atomic_dec(atomic_t *v)
+{
+	__asm__ __volatile__("subql #1,%0" : "+m" (*v));
+}
+
+static inline int atomic_dec_and_test(atomic_t *v)
+{
+	char c;
+	__asm__ __volatile__("subql #1,%1; seq %0" : "=d" (c), "+m" (*v));
+	return c != 0;
+}
+
+static inline int atomic_inc_and_test(atomic_t *v)
+{
+	char c;
+	__asm__ __volatile__("addql #1,%1; seq %0" : "=d" (c), "+m" (*v));
+	return c != 0;
+}
+
+#ifdef CONFIG_RMW_INSNS
+static inline int atomic_add_return(int i, atomic_t *v)
 {
-	__asm__ __volatile__("addl %1,%0" : "=m" (*v) : "id" (i), "0" (*v));
+	int t, tmp;
+
+	__asm__ __volatile__(
+			"1:	movel %2,%1\n"
+			"	addl %3,%1\n"
+			"	casl %2,%1,%0\n"
+			"	jne 1b"
+			: "+m" (*v), "=&d" (t), "=&d" (tmp)
+			: "g" (i), "2" (atomic_read(v)));
+	return t;
 }
 
-static __inline__ void atomic_sub(int i, atomic_t *v)
+static inline int atomic_sub_return(int i, atomic_t *v)
 {
-	__asm__ __volatile__("subl %1,%0" : "=m" (*v) : "id" (i), "0" (*v));
+	int t, tmp;
+
+	__asm__ __volatile__(
+			"1:	movel %2,%1\n"
+			"	subl %3,%1\n"
+			"	casl %2,%1,%0\n"
+			"	jne 1b"
+			: "+m" (*v), "=&d" (t), "=&d" (tmp)
+			: "g" (i), "2" (atomic_read(v)));
+	return t;
+}
+#else /* !CONFIG_RMW_INSNS */
+static inline int atomic_add_return(int i, atomic_t * v)
+{
+	unsigned long flags;
+	int t;
+
+	local_irq_save(flags);
+	t = atomic_read(v);
+	t += i;
+	atomic_set(v, t);
+	local_irq_restore(flags);
+
+	return t;
 }
 
-static __inline__ void atomic_inc(volatile atomic_t *v)
+static inline int atomic_sub_return(int i, atomic_t * v)
 {
-	__asm__ __volatile__("addql #1,%0" : "=m" (*v): "0" (*v));
+	unsigned long flags;
+	int t;
+
+	local_irq_save(flags);
+	t = atomic_read(v);
+	t -= i;
+	atomic_set(v, t);
+	local_irq_restore(flags);
+
+	return t;
 }
+#endif /* !CONFIG_RMW_INSNS */
+
+#define atomic_dec_return(v)	atomic_sub_return(1, (v))
+#define atomic_inc_return(v)	atomic_add_return(1, (v))
 
-static __inline__ void atomic_dec(volatile atomic_t *v)
+static inline int atomic_sub_and_test(int i, atomic_t *v)
 {
-	__asm__ __volatile__("subql #1,%0" : "=m" (*v): "0" (*v));
+	char c;
+	__asm__ __volatile__("subl %2,%1; seq %0" : "=d" (c), "+m" (*v): "g" (i));
+	return c != 0;
 }
 
-static __inline__ int atomic_dec_and_test(volatile atomic_t *v)
+static inline int atomic_add_negative(int i, atomic_t *v)
 {
 	char c;
-	__asm__ __volatile__("subql #1,%1; seq %0" : "=d" (c), "=m" (*v): "1" (*v));
+	__asm__ __volatile__("addl %2,%1; smi %0" : "=d" (c), "+m" (*v): "g" (i));
 	return c != 0;
 }
 
-#define atomic_clear_mask(mask, v) \
-	__asm__ __volatile__("andl %1,%0" : "=m" (*v) : "id" (~(mask)),"0"(*v))
+static inline void atomic_clear_mask(unsigned long mask, unsigned long *v)
+{
+	__asm__ __volatile__("andl %1,%0" : "+m" (*v) : "id" (~(mask)));
+}
 
-#define atomic_set_mask(mask, v) \
-	__asm__ __volatile__("orl %1,%0" : "=m" (*v) : "id" (mask),"0"(*v))
+static inline void atomic_set_mask(unsigned long mask, unsigned long *v)
+{
+	__asm__ __volatile__("orl %1,%0" : "+m" (*v) : "id" (mask));
+}
 
 /* Atomic operations are already serializing */
 #define smp_mb__before_atomic_dec()	barrier()
diff --git a/include/asm-m68k/bitops.h b/include/asm-m68k/bitops.h
index ec1e32ecb..b1bcf7c66 100644
--- a/include/asm-m68k/bitops.h
+++ b/include/asm-m68k/bitops.h
@@ -23,25 +23,24 @@
 
 #define __test_and_set_bit(nr,vaddr) test_and_set_bit(nr,vaddr)
 
-static inline int __constant_test_and_set_bit(int nr,
-					      volatile unsigned long *vaddr)
+static inline int __constant_test_and_set_bit(int nr, unsigned long *vaddr)
 {
+	char *p = (char *)vaddr + (nr ^ 31) / 8;
 	char retval;
 
 	__asm__ __volatile__ ("bset %2,%1; sne %0"
-	     : "=d" (retval), "+m" (((volatile char *)vaddr)[(nr^31) >> 3])
-	     : "di" (nr & 7));
+			: "=d" (retval), "+m" (*p)
+			: "di" (nr & 7));
 
 	return retval;
 }
 
-static inline int __generic_test_and_set_bit(int nr,
-					     volatile unsigned long *vaddr)
+static inline int __generic_test_and_set_bit(int nr, unsigned long *vaddr)
 {
 	char retval;
 
-	__asm__ __volatile__ ("bfset %2@{%1:#1}; sne %0"
-	     : "=d" (retval) : "d" (nr^31), "a" (vaddr) : "memory");
+	__asm__ __volatile__ ("bfset %2{%1:#1}; sne %0"
+			: "=d" (retval) : "d" (nr^31), "o" (*vaddr) : "memory");
 
 	return retval;
 }
@@ -55,14 +54,15 @@ static inline int __generic_test_and_set_bit(int nr,
 
 static inline void __constant_set_bit(int nr, volatile unsigned long *vaddr)
 {
+	char *p = (char *)vaddr + (nr ^ 31) / 8;
 	__asm__ __volatile__ ("bset %1,%0"
-	     : "+m" (((volatile char *)vaddr)[(nr^31) >> 3]) : "di" (nr & 7));
+			: "+m" (*p) : "di" (nr & 7));
 }
 
 static inline void __generic_set_bit(int nr, volatile unsigned long *vaddr)
 {
-	__asm__ __volatile__ ("bfset %1@{%0:#1}"
-	     : : "d" (nr^31), "a" (vaddr) : "memory");
+	__asm__ __volatile__ ("bfset %1{%0:#1}"
+			: : "d" (nr^31), "o" (*vaddr) : "memory");
 }
 
 #define test_and_clear_bit(nr,vaddr) \
@@ -72,25 +72,24 @@ static inline void __generic_set_bit(int nr, volatile unsigned long *vaddr)
 
 #define __test_and_clear_bit(nr,vaddr) test_and_clear_bit(nr,vaddr)
 
-static inline int __constant_test_and_clear_bit(int nr,
-						volatile unsigned long *vaddr)
+static inline int __constant_test_and_clear_bit(int nr, unsigned long *vaddr)
 {
+	char *p = (char *)vaddr + (nr ^ 31) / 8;
 	char retval;
 
 	__asm__ __volatile__ ("bclr %2,%1; sne %0"
-	     : "=d" (retval), "+m" (((volatile char *)vaddr)[(nr^31) >> 3])
-	     : "di" (nr & 7));
+			: "=d" (retval), "+m" (*p)
+			: "di" (nr & 7));
 
 	return retval;
 }
 
-static inline int __generic_test_and_clear_bit(int nr,
-					       volatile unsigned long *vaddr)
+static inline int __generic_test_and_clear_bit(int nr, unsigned long *vaddr)
 {
 	char retval;
 
-	__asm__ __volatile__ ("bfclr %2@{%1:#1}; sne %0"
-	     : "=d" (retval) : "d" (nr^31), "a" (vaddr) : "memory");
+	__asm__ __volatile__ ("bfclr %2{%1:#1}; sne %0"
+			: "=d" (retval) : "d" (nr^31), "o" (*vaddr) : "memory");
 
 	return retval;
 }
@@ -109,14 +108,15 @@ static inline int __generic_test_and_clear_bit(int nr,
 
 static inline void __constant_clear_bit(int nr, volatile unsigned long *vaddr)
 {
+	char *p = (char *)vaddr + (nr ^ 31) / 8;
 	__asm__ __volatile__ ("bclr %1,%0"
-	     : "+m" (((volatile char *)vaddr)[(nr^31) >> 3]) : "di" (nr & 7));
+			: "+m" (*p) : "di" (nr & 7));
 }
 
 static inline void __generic_clear_bit(int nr, volatile unsigned long *vaddr)
 {
-	__asm__ __volatile__ ("bfclr %1@{%0:#1}"
-	     : : "d" (nr^31), "a" (vaddr) : "memory");
+	__asm__ __volatile__ ("bfclr %1{%0:#1}"
+			: : "d" (nr^31), "o" (*vaddr) : "memory");
 }
 
 #define test_and_change_bit(nr,vaddr) \
@@ -127,25 +127,24 @@ static inline void __generic_clear_bit(int nr, volatile unsigned long *vaddr)
 #define __test_and_change_bit(nr,vaddr) test_and_change_bit(nr,vaddr)
 #define __change_bit(nr,vaddr) change_bit(nr,vaddr)
 
-static inline int __constant_test_and_change_bit(int nr,
-						 volatile unsigned long *vaddr)
+static inline int __constant_test_and_change_bit(int nr, unsigned long *vaddr)
 {
+	char *p = (char *)vaddr + (nr ^ 31) / 8;
 	char retval;
 
 	__asm__ __volatile__ ("bchg %2,%1; sne %0"
-	     : "=d" (retval), "+m" (((volatile char *)vaddr)[(nr^31) >> 3])
-	     : "di" (nr & 7));
+			: "=d" (retval), "+m" (*p)
+			: "di" (nr & 7));
 
 	return retval;
 }
 
-static inline int __generic_test_and_change_bit(int nr,
-						volatile unsigned long *vaddr)
+static inline int __generic_test_and_change_bit(int nr, unsigned long *vaddr)
 {
 	char retval;
 
-	__asm__ __volatile__ ("bfchg %2@{%1:#1}; sne %0"
-	     : "=d" (retval) : "d" (nr^31), "a" (vaddr) : "memory");
+	__asm__ __volatile__ ("bfchg %2{%1:#1}; sne %0"
+			: "=d" (retval) : "d" (nr^31), "o" (*vaddr) : "memory");
 
 	return retval;
 }
@@ -155,21 +154,22 @@ static inline int __generic_test_and_change_bit(int nr,
    __constant_change_bit(nr, vaddr) : \
    __generic_change_bit(nr, vaddr))
 
-static inline void __constant_change_bit(int nr, volatile unsigned long *vaddr)
+static inline void __constant_change_bit(int nr, unsigned long *vaddr)
 {
+	char *p = (char *)vaddr + (nr ^ 31) / 8;
 	__asm__ __volatile__ ("bchg %1,%0"
-	     : "+m" (((volatile char *)vaddr)[(nr^31) >> 3]) : "di" (nr & 7));
+			: "+m" (*p) : "di" (nr & 7));
 }
 
-static inline void __generic_change_bit(int nr, volatile unsigned long *vaddr)
+static inline void __generic_change_bit(int nr, unsigned long *vaddr)
 {
-	__asm__ __volatile__ ("bfchg %1@{%0:#1}"
-	     : : "d" (nr^31), "a" (vaddr) : "memory");
+	__asm__ __volatile__ ("bfchg %1{%0:#1}"
+			: : "d" (nr^31), "o" (*vaddr) : "memory");
 }
 
-static inline int test_bit(int nr, const volatile unsigned long *vaddr)
+static inline int test_bit(int nr, const unsigned long *vaddr)
 {
-	return ((1UL << (nr & 31)) & (((const volatile unsigned long *) vaddr)[nr >> 5])) != 0;
+	return (vaddr[nr >> 5] & (1UL << (nr & 31))) != 0;
 }
 
 static inline int find_first_zero_bit(const unsigned long *vaddr,
@@ -364,76 +364,27 @@ static inline int minix_find_first_zero_bit(const void *vaddr, unsigned size)
 	return ((p - addr) << 4) + (res ^ 31);
 }
 
-static inline int minix_test_and_set_bit(int nr, volatile void *vaddr)
-{
-	char retval;
-
-	__asm__ __volatile__ ("bfset %2{%1:#1}; sne %0"
-	     : "=d" (retval) : "d" (nr^15), "m" (*(volatile char *)vaddr) : "memory");
-
-	return retval;
-}
-
-#define minix_set_bit(nr,addr)	((void)minix_test_and_set_bit(nr,addr))
+#define minix_test_and_set_bit(nr, addr)	test_and_set_bit((nr) ^ 16, (unsigned long *)(addr))
+#define minix_set_bit(nr,addr)			set_bit((nr) ^ 16, (unsigned long *)(addr))
+#define minix_test_and_clear_bit(nr, addr)	test_and_clear_bit((nr) ^ 16, (unsigned long *)(addr))
 
-static inline int minix_test_and_clear_bit(int nr, volatile void *vaddr)
+static inline int minix_test_bit(int nr, const void *vaddr)
 {
-	char retval;
-
-	__asm__ __volatile__ ("bfclr %2{%1:#1}; sne %0"
-	     : "=d" (retval) : "d" (nr^15), "m" (*(volatile char *) vaddr) : "memory");
-
-	return retval;
-}
-
-static inline int minix_test_bit(int nr, const volatile void *vaddr)
-{
-	return ((1U << (nr & 15)) & (((const volatile unsigned short *) vaddr)[nr >> 4])) != 0;
+	const unsigned short *p = vaddr;
+	return (p[nr >> 4] & (1U << (nr & 15))) != 0;
 }
 
 /* Bitmap functions for the ext2 filesystem. */
 
-static inline int ext2_set_bit(int nr, volatile void *vaddr)
-{
-	char retval;
-
-	__asm__ __volatile__ ("bfset %2{%1,#1}; sne %0"
-	     : "=d" (retval) : "d" (nr^7), "m" (*(volatile char *) vaddr) : "memory");
-
-	return retval;
-}
-
-static inline int ext2_clear_bit(int nr, volatile void *vaddr)
-{
-	char retval;
-
-	__asm__ __volatile__ ("bfclr %2{%1,#1}; sne %0"
-	     : "=d" (retval) : "d" (nr^7), "m" (*(volatile char *) vaddr) : "memory");
-
-	return retval;
-}
+#define ext2_set_bit(nr, addr)			test_and_set_bit((nr) ^ 24, (unsigned long *)(addr))
+#define ext2_set_bit_atomic(lock, nr, addr)	test_and_set_bit((nr) ^ 24, (unsigned long *)(addr))
+#define ext2_clear_bit(nr, addr)		test_and_clear_bit((nr) ^ 24, (unsigned long *)(addr))
+#define ext2_clear_bit_atomic(lock, nr, addr)	test_and_clear_bit((nr) ^ 24, (unsigned long *)(addr))
 
-#define ext2_set_bit_atomic(lock, nr, addr)		\
-	({						\
-		int ret;				\
-		spin_lock(lock);			\
-		ret = ext2_set_bit((nr), (addr));	\
-		spin_unlock(lock);			\
-		ret;					\
-	})
-
-#define ext2_clear_bit_atomic(lock, nr, addr)		\
-	({						\
-		int ret;				\
-		spin_lock(lock);			\
-		ret = ext2_clear_bit((nr), (addr));	\
-		spin_unlock(lock);			\
-		ret;					\
-	})
-
-static inline int ext2_test_bit(int nr, const volatile void *vaddr)
+static inline int ext2_test_bit(int nr, const void *vaddr)
 {
-	return ((1U << (nr & 7)) & (((const volatile unsigned char *) vaddr)[nr >> 3])) != 0;
+	const unsigned char *p = vaddr;
+	return (p[nr >> 3] & (1U << (nr & 7))) != 0;
 }
 
 static inline int ext2_find_first_zero_bit(const void *vaddr, unsigned size)
diff --git a/include/asm-m68k/fcntl.h b/include/asm-m68k/fcntl.h
index c0b273f68..0d4212983 100644
--- a/include/asm-m68k/fcntl.h
+++ b/include/asm-m68k/fcntl.h
@@ -20,6 +20,7 @@
 #define O_NOFOLLOW	0100000	/* don't follow links */
 #define O_DIRECT	0200000	/* direct disk access hint - currently ignored */
 #define O_LARGEFILE	0400000
+#define O_NOATIME	01000000
 
 #define F_DUPFD		0	/* dup */
 #define F_GETFD		1	/* get close_on_exec */
diff --git a/include/asm-m68k/hardirq.h b/include/asm-m68k/hardirq.h
index 22dc9cf91..80c86ec3b 100644
--- a/include/asm-m68k/hardirq.h
+++ b/include/asm-m68k/hardirq.h
@@ -1,6 +1,7 @@
 #ifndef __M68K_HARDIRQ_H
 #define __M68K_HARDIRQ_H
 
+#include <linux/config.h>
 #include <linux/threads.h>
 #include <linux/cache.h>
 
diff --git a/include/asm-m68k/io.h b/include/asm-m68k/io.h
index aa6fffff2..d32a489f4 100644
--- a/include/asm-m68k/io.h
+++ b/include/asm-m68k/io.h
@@ -120,7 +120,7 @@ extern int isa_sex;
  * be compiled in so the case statement will be optimised away
  */
 
-static inline u8 *isa_itb(long addr)
+static inline u8 *isa_itb(unsigned long addr)
 {
   switch(ISA_TYPE)
     {
@@ -136,7 +136,7 @@ static inline u8 *isa_itb(long addr)
     default: return 0; /* avoid warnings, just in case */
     }
 }
-static inline u16 *isa_itw(long addr)
+static inline u16 *isa_itw(unsigned long addr)
 {
   switch(ISA_TYPE)
     {
@@ -152,7 +152,7 @@ static inline u16 *isa_itw(long addr)
     default: return 0; /* avoid warnings, just in case */
     }
 }
-static inline u8 *isa_mtb(long addr)
+static inline u8 *isa_mtb(unsigned long addr)
 {
   switch(ISA_TYPE)
     {
@@ -168,7 +168,7 @@ static inline u8 *isa_mtb(long addr)
     default: return 0; /* avoid warnings, just in case */
     }
 }
-static inline u16 *isa_mtw(long addr)
+static inline u16 *isa_mtw(unsigned long addr)
 {
   switch(ISA_TYPE)
     {
@@ -191,10 +191,14 @@ static inline u16 *isa_mtw(long addr)
 #define isa_outb(val,port) out_8(isa_itb(port),(val))
 #define isa_outw(val,port) (ISA_SEX ? out_be16(isa_itw(port),(val)) : out_le16(isa_itw(port),(val)))
 
-#define isa_readb(p)       in_8(isa_mtb(p))
-#define isa_readw(p)       (ISA_SEX ? in_be16(isa_mtw(p)) : in_le16(isa_mtw(p)))
-#define isa_writeb(val,p)  out_8(isa_mtb(p),(val))
-#define isa_writew(val,p)  (ISA_SEX ? out_be16(isa_mtw(p),(val)) : out_le16(isa_mtw(p),(val)))
+#define isa_readb(p)       in_8(isa_mtb((unsigned long)(p)))
+#define isa_readw(p)       \
+	(ISA_SEX ? in_be16(isa_mtw((unsigned long)(p)))	\
+		 : in_le16(isa_mtw((unsigned long)(p))))
+#define isa_writeb(val,p)  out_8(isa_mtb((unsigned long)(p)),(val))
+#define isa_writew(val,p)  \
+	(ISA_SEX ? out_be16(isa_mtw((unsigned long)(p)),(val))	\
+		 : out_le16(isa_mtw((unsigned long)(p)),(val)))
 
 static inline void isa_delay(void)
 {
@@ -215,17 +219,21 @@ static inline void isa_delay(void)
 
 #define isa_inb_p(p)      ({u8 v=isa_inb(p);isa_delay();v;})
 #define isa_outb_p(v,p)   ({isa_outb((v),(p));isa_delay();})
+#define isa_inw_p(p)      ({u16 v=isa_inw(p);isa_delay();v;})
+#define isa_outw_p(v,p)   ({isa_outw((v),(p));isa_delay();})
+#define isa_inl_p(p)      ({u32 v=isa_inl(p);isa_delay();v;})
+#define isa_outl_p(v,p)   ({isa_outl((v),(p));isa_delay();})
 
-#define isa_insb(port, buf, nr) raw_insb(isa_itb(port), (buf), (nr))
-#define isa_outsb(port, buf, nr) raw_outsb(isa_itb(port), (buf), (nr))
+#define isa_insb(port, buf, nr) raw_insb(isa_itb(port), (u8 *)(buf), (nr))
+#define isa_outsb(port, buf, nr) raw_outsb(isa_itb(port), (u8 *)(buf), (nr))
 
 #define isa_insw(port, buf, nr)     \
-       (ISA_SEX ? raw_insw(isa_itw(port), (buf), (nr)) :    \
-                  raw_insw_swapw(isa_itw(port), (buf), (nr)))
+       (ISA_SEX ? raw_insw(isa_itw(port), (u16 *)(buf), (nr)) :    \
+                  raw_insw_swapw(isa_itw(port), (u16 *)(buf), (nr)))
 
 #define isa_outsw(port, buf, nr)    \
-       (ISA_SEX ? raw_outsw(isa_itw(port), (buf), (nr)) :  \
-                  raw_outsw_swapw(isa_itw(port), (buf), (nr)))
+       (ISA_SEX ? raw_outsw(isa_itw(port), (u16 *)(buf), (nr)) :  \
+                  raw_outsw_swapw(isa_itw(port), (u16 *)(buf), (nr)))
 #endif  /* CONFIG_ISA */
 
 
@@ -235,9 +243,13 @@ static inline void isa_delay(void)
 #define outb    isa_outb
 #define outb_p  isa_outb_p
 #define inw     isa_inw
+#define inw_p   isa_inw_p
 #define outw    isa_outw
+#define outw_p  isa_outw_p
 #define inl     isa_inw
+#define inl_p   isa_inw_p
 #define outl    isa_outw
+#define outl_p  isa_outw_p
 #define insb    isa_insb
 #define insw    isa_insw
 #define outsb   isa_outsb
@@ -281,10 +293,16 @@ static inline void isa_delay(void)
 #define inb(port) ((port)<1024 ? isa_inb(port) : in_8(port))
 #define inb_p(port) ((port)<1024 ? isa_inb_p(port) : in_8(port))
 #define inw(port) ((port)<1024 ? isa_inw(port) : in_le16(port))
+#define inw_p(port) ((port)<1024 ? isa_inw_p(port) : in_le16(port))
+#define inl(port) ((port)<1024 ? isa_inl(port) : in_le32(port))
+#define inl_p(port) ((port)<1024 ? isa_inl_p(port) : in_le32(port))
 
 #define outb(val,port) ((port)<1024 ? isa_outb((val),(port)) : out_8((port),(val)))
 #define outb_p(val,port) ((port)<1024 ? isa_outb_p((val),(port)) : out_8((port),(val)))
 #define outw(val,port) ((port)<1024 ? isa_outw((val),(port)) : out_le16((port),(val)))
+#define outw_p(val,port) ((port)<1024 ? isa_outw_p((val),(port)) : out_le16((port),(val)))
+#define outl(val,port) ((port)<1024 ? isa_outl((val),(port)) : out_le32((port),(val)))
+#define outl_p(val,port) ((port)<1024 ? isa_outl_p((val),(port)) : out_le32((port),(val)))
 #endif
 #endif /* CONFIG_PCI */
 
diff --git a/include/asm-m68k/math-emu.h b/include/asm-m68k/math-emu.h
index a09dc54f2..7ac6259b6 100644
--- a/include/asm-m68k/math-emu.h
+++ b/include/asm-m68k/math-emu.h
@@ -102,7 +102,7 @@ struct fp_data {
 	struct fp_ext temp[2];
 };
 
-#if FPU_EMU_DEBUG
+#ifdef FPU_EMU_DEBUG
 extern unsigned int fp_debugprint;
 
 #define dprint(bit, fmt, args...) ({			\
diff --git a/include/asm-m68k/motorola_pgalloc.h b/include/asm-m68k/motorola_pgalloc.h
index f315615e4..dda9618ad 100644
--- a/include/asm-m68k/motorola_pgalloc.h
+++ b/include/asm-m68k/motorola_pgalloc.h
@@ -2,6 +2,7 @@
 #define _MOTOROLA_PGALLOC_H
 
 #include <asm/tlb.h>
+#include <asm/tlbflush.h>
 
 extern pmd_t *get_pointer_table(void);
 extern int free_pointer_table(pmd_t *);
diff --git a/include/asm-m68k/page.h b/include/asm-m68k/page.h
index 6b7d6a040..99a516709 100644
--- a/include/asm-m68k/page.h
+++ b/include/asm-m68k/page.h
@@ -52,15 +52,13 @@ static inline void copy_page(void *to, void *from)
 
 static inline void clear_page(void *page)
 {
-	unsigned long data, tmp;
-	void *sp = page;
+	unsigned long tmp;
+	unsigned long *sp = page;
 
-	data = 0;
-
-	*((unsigned long *)(page))++ = 0;
-	*((unsigned long *)(page))++ = 0;
-	*((unsigned long *)(page))++ = 0;
-	*((unsigned long *)(page))++ = 0;
+	*sp++ = 0;
+	*sp++ = 0;
+	*sp++ = 0;
+	*sp++ = 0;
 
 	__asm__ __volatile__("1:\t"
 			     ".chip 68040\n\t"
@@ -69,8 +67,8 @@ static inline void clear_page(void *page)
 			     "subqw  #8,%2\n\t"
 			     "subqw  #8,%2\n\t"
 			     "dbra   %1,1b\n\t"
-			     : "=a" (page), "=d" (tmp)
-			     : "a" (sp), "0" (page),
+			     : "=a" (sp), "=d" (tmp)
+			     : "a" (page), "0" (sp),
 			       "1" ((PAGE_SIZE - 16) / 16 - 1));
 }
 
diff --git a/include/asm-m68k/resource.h b/include/asm-m68k/resource.h
index e2ad93f6a..8362001c2 100644
--- a/include/asm-m68k/resource.h
+++ b/include/asm-m68k/resource.h
@@ -16,8 +16,10 @@
 #define RLIMIT_MEMLOCK	8		/* max locked-in-memory address space */
 #define RLIMIT_AS	9		/* address space limit */
 #define RLIMIT_LOCKS	10		/* maximum file locks held */
+#define RLIMIT_SIGPENDING 11		/* max number of pending signals */
+#define RLIMIT_MSGQUEUE 12		/* maximum bytes in POSIX mqueues */
 
-#define RLIM_NLIMITS	11
+#define RLIM_NLIMITS	13
 
 /*
  * SuS says limits have to be unsigned.
@@ -39,7 +41,9 @@
 	{      INR_OPEN,     INR_OPEN  },		\
 	{ RLIM_INFINITY, RLIM_INFINITY },		\
 	{ RLIM_INFINITY, RLIM_INFINITY },		\
-        { RLIM_INFINITY, RLIM_INFINITY },		\
+	{ RLIM_INFINITY, RLIM_INFINITY },		\
+	{ MAX_SIGPENDING, MAX_SIGPENDING },		\
+	{ MQ_BYTES_MAX, MQ_BYTES_MAX },			\
 }
 
 #endif /* __KERNEL__ */
diff --git a/include/asm-m68k/semaphore.h b/include/asm-m68k/semaphore.h
index 964aff90f..213d4f796 100644
--- a/include/asm-m68k/semaphore.h
+++ b/include/asm-m68k/semaphore.h
@@ -27,12 +27,12 @@ struct semaphore {
 	atomic_t count;
 	atomic_t waking;
 	wait_queue_head_t wait;
-#if WAITQUEUE_DEBUG
+#ifdef WAITQUEUE_DEBUG
 	long __magic;
 #endif
 };
 
-#if WAITQUEUE_DEBUG
+#ifdef WAITQUEUE_DEBUG
 # define __SEM_DEBUG_INIT(name) \
 		, (long)&(name).__magic
 #else
@@ -86,7 +86,7 @@ static inline void down(struct semaphore *sem)
 {
 	register struct semaphore *sem1 __asm__ ("%a1") = sem;
 
-#if WAITQUEUE_DEBUG
+#ifdef WAITQUEUE_DEBUG
 	CHECK_MAGIC(sem->__magic);
 #endif
 	might_sleep();
@@ -109,7 +109,7 @@ static inline int down_interruptible(struct semaphore *sem)
 	register struct semaphore *sem1 __asm__ ("%a1") = sem;
 	register int result __asm__ ("%d0");
 
-#if WAITQUEUE_DEBUG
+#ifdef WAITQUEUE_DEBUG
 	CHECK_MAGIC(sem->__magic);
 #endif
 	might_sleep();
@@ -134,7 +134,7 @@ static inline int down_trylock(struct semaphore *sem)
 	register struct semaphore *sem1 __asm__ ("%a1") = sem;
 	register int result __asm__ ("%d0");
 
-#if WAITQUEUE_DEBUG
+#ifdef WAITQUEUE_DEBUG
 	CHECK_MAGIC(sem->__magic);
 #endif
 
@@ -164,7 +164,7 @@ static inline void up(struct semaphore *sem)
 {
 	register struct semaphore *sem1 __asm__ ("%a1") = sem;
 
-#if WAITQUEUE_DEBUG
+#ifdef WAITQUEUE_DEBUG
 	CHECK_MAGIC(sem->__magic);
 #endif
 
diff --git a/include/asm-m68k/setup.h b/include/asm-m68k/setup.h
index 47b4627ef..ce2762822 100644
--- a/include/asm-m68k/setup.h
+++ b/include/asm-m68k/setup.h
@@ -357,6 +357,7 @@ extern int m68k_is040or060;
 
 #define NUM_MEMINFO	4
 #define CL_SIZE		256
+#define COMMAND_LINE_SIZE	CL_SIZE
 
 #ifndef __ASSEMBLY__
 extern int m68k_num_memory;		/* # of memory blocks found (and used) */
diff --git a/include/asm-m68k/string.h b/include/asm-m68k/string.h
index 7ea5dc8e7..44def0781 100644
--- a/include/asm-m68k/string.h
+++ b/include/asm-m68k/string.h
@@ -290,9 +290,7 @@ static inline void * __memset_g(void * s, int c, size_t count)
 static inline void * __memset_page(void * s,int c,size_t count)
 {
   unsigned long data, tmp;
-  void *xs, *sp;
-
-  xs = sp = s;
+  void *xs = s;
 
   c = c & 255;
   data = c | (c << 8);
@@ -303,10 +301,11 @@ static inline void * __memset_page(void * s,int c,size_t count)
   if (((unsigned long) s) & 0x0f)
 	  __memset_g(s, c, count);
   else{
-	  *((unsigned long *)(s))++ = data;
-	  *((unsigned long *)(s))++ = data;
-	  *((unsigned long *)(s))++ = data;
-	  *((unsigned long *)(s))++ = data;
+	  unsigned long *sp = s;
+	  *sp++ = data;
+	  *sp++ = data;
+	  *sp++ = data;
+	  *sp++ = data;
 
 	  __asm__ __volatile__("1:\t"
 			       ".chip 68040\n\t"
@@ -315,8 +314,8 @@ static inline void * __memset_page(void * s,int c,size_t count)
 			       "subqw  #8,%2\n\t"
 			       "subqw  #8,%2\n\t"
 			       "dbra   %1,1b\n\t"
-			       : "=a" (s), "=d" (tmp)
-			       : "a" (sp), "0" (s), "1" ((count - 16) / 16 - 1)
+			       : "=a" (sp), "=d" (tmp)
+			       : "a" (s), "0" (sp), "1" ((count - 16) / 16 - 1)
 			       );
   }
 
diff --git a/include/asm-m68k/sun3_pgalloc.h b/include/asm-m68k/sun3_pgalloc.h
index d00e10ff6..fd8241117 100644
--- a/include/asm-m68k/sun3_pgalloc.h
+++ b/include/asm-m68k/sun3_pgalloc.h
@@ -31,10 +31,7 @@ static inline void pte_free(struct page *page)
         __free_page(page);
 }
 
-static inline void __pte_free_tlb(struct mmu_gather *tlb, struct page *page)
-{
-	tlb_remove_page(tlb, page);
-}
+#define __pte_free_tlb(tlb,pte) tlb_remove_page((tlb),(pte))
 
 static inline pte_t *pte_alloc_one_kernel(struct mm_struct *mm,
 					  unsigned long address)
diff --git a/include/asm-m68k/ucontext.h b/include/asm-m68k/ucontext.h
index fb6d732ad..e4e22669e 100644
--- a/include/asm-m68k/ucontext.h
+++ b/include/asm-m68k/ucontext.h
@@ -6,10 +6,8 @@ typedef int greg_t;
 typedef greg_t gregset_t[NGREG];
 
 typedef struct fpregset {
-	int f_pcr;
-	int f_psr;
-	int f_fpiaddr;
-	int f_fpregs[8][3];
+	int f_fpcntl[3];
+	int f_fpregs[8*3];
 } fpregset_t;
 
 struct mcontext {
diff --git a/include/asm-m68knommu/setup.h b/include/asm-m68knommu/setup.h
index ff4565ead..d2b0fcce4 100644
--- a/include/asm-m68knommu/setup.h
+++ b/include/asm-m68knommu/setup.h
@@ -1 +1,5 @@
 #include <asm-m68k/setup.h>
+
+/* We have a bigger command line buffer. */
+#undef COMMAND_LINE_SIZE
+#define COMMAND_LINE_SIZE	512
diff --git a/include/asm-mips/asmmacro.h b/include/asm-mips/asmmacro.h
index c70f00d83..37a460aa0 100644
--- a/include/asm-mips/asmmacro.h
+++ b/include/asm-mips/asmmacro.h
@@ -9,6 +9,7 @@
 #define _ASM_ASMMACRO_H
  
 #include <linux/config.h>
+#include <asm/hazards.h>
  
 #ifdef CONFIG_MIPS32
 #include <asm/asmmacro-32.h>
@@ -21,6 +22,7 @@
 	mfc0	\reg, CP0_STATUS
 	ori	\reg, \reg, 1
 	mtc0	\reg, CP0_STATUS
+	irq_enable_hazard
 	.endm
 
 	.macro	local_irq_disable reg=t0
@@ -28,7 +30,7 @@
 	ori	\reg, \reg, 1
 	xori	\reg, \reg, 1
 	mtc0	\reg, CP0_STATUS
-	SSNOP; SSNOP; SSNOP
+	irq_disable_hazard
 	.endm
 
 #ifdef CONFIG_CPU_SB1
diff --git a/include/asm-mips/atomic.h b/include/asm-mips/atomic.h
index 1262c6eaf..c8c6a5a8c 100644
--- a/include/asm-mips/atomic.h
+++ b/include/asm-mips/atomic.h
@@ -9,7 +9,7 @@
  * License.  See the file "COPYING" in the main directory of this archive
  * for more details.
  *
- * Copyright (C) 1996, 97, 99, 2000, 03 by Ralf Baechle
+ * Copyright (C) 1996, 97, 99, 2000, 03, 04 by Ralf Baechle
  */
 
 /*
@@ -127,6 +127,32 @@ static __inline__ int atomic_sub_return(int i, atomic_t * v)
 	return result;
 }
 
+/*
+ * atomic_sub_if_positive - add integer to atomic variable
+ * @v: pointer of type atomic_t
+ *
+ * Atomically test @v and decrement if it is greater than 0.
+ * The function returns the old value of @v minus 1.
+ */
+static __inline__ int atomic_sub_if_positive(int i, atomic_t * v)
+{
+	unsigned long temp, result;
+
+	__asm__ __volatile__(
+	"1:	ll	%1, %2		# atomic_sub_if_positive\n"
+	"	subu	%0, %1, %3				\n"
+	"	bltz	%0, 1f					\n"
+	"	sc	%0, %2					\n"
+	"	beqz	%0, 1b					\n"
+	"	sync						\n"
+	"1:							\n"
+	: "=&r" (result), "=&r" (temp), "=m" (v->counter)
+	: "Ir" (i), "m" (v->counter)
+	: "memory");
+
+	return result;
+}
+
 #else
 
 /*
@@ -192,6 +218,28 @@ static __inline__ int atomic_sub_return(int i, atomic_t * v)
 	return temp;
 }
 
+/*
+ * atomic_sub_if_positive - add integer to atomic variable
+ * @v: pointer of type atomic_t
+ *
+ * Atomically test @v and decrement if it is greater than 0.
+ * The function returns the old value of @v minus 1.
+ */
+static __inline__ int atomic_sub_if_positive(int i, atomic_t * v)
+{
+	unsigned long flags;
+	int temp;
+
+	spin_lock_irqsave(&atomic_lock, flags);
+	temp = v->counter;
+	temp -= i;
+	if (temp >= 0)
+		v->counter = temp;
+	spin_unlock_irqrestore(&atomic_lock, flags);
+
+	return temp;
+}
+
 #endif /* CONFIG_CPU_HAS_LLSC */
 
 #define atomic_dec_return(v) atomic_sub_return(1,(v))
@@ -228,6 +276,12 @@ static __inline__ int atomic_sub_return(int i, atomic_t * v)
  */
 #define atomic_dec_and_test(v) (atomic_sub_return(1, (v)) == 0)
 
+/*
+ * atomic_dec_if_positive - decrement by 1 if old value positive
+ * @v: pointer of type atomic_t
+ */
+#define atomic_dec_if_positive(v)	atomic_sub_if_positive(1, v)
+
 /*
  * atomic_inc - increment atomic variable
  * @v: pointer of type atomic_t
@@ -284,7 +338,7 @@ typedef struct { volatile __s64 counter; } atomic64_t;
  *
  * Atomically adds @i to @v.
  */
-static __inline__ void atomic64_add(int i, atomic64_t * v)
+static __inline__ void atomic64_add(long i, atomic64_t * v)
 {
 	unsigned long temp;
 
@@ -304,7 +358,7 @@ static __inline__ void atomic64_add(int i, atomic64_t * v)
  *
  * Atomically subtracts @i from @v.
  */
-static __inline__ void atomic64_sub(int i, atomic64_t * v)
+static __inline__ void atomic64_sub(long i, atomic64_t * v)
 {
 	unsigned long temp;
 
@@ -320,7 +374,7 @@ static __inline__ void atomic64_sub(int i, atomic64_t * v)
 /*
  * Same as above, but return the result value
  */
-static __inline__ int atomic64_add_return(int i, atomic64_t * v)
+static __inline__ long atomic64_add_return(long i, atomic64_t * v)
 {
 	unsigned long temp, result;
 
@@ -338,7 +392,7 @@ static __inline__ int atomic64_add_return(int i, atomic64_t * v)
 	return result;
 }
 
-static __inline__ int atomic64_sub_return(int i, atomic64_t * v)
+static __inline__ long atomic64_sub_return(long i, atomic64_t * v)
 {
 	unsigned long temp, result;
 
@@ -356,6 +410,32 @@ static __inline__ int atomic64_sub_return(int i, atomic64_t * v)
 	return result;
 }
 
+/*
+ * atomic64_sub_if_positive - add integer to atomic variable
+ * @v: pointer of type atomic64_t
+ *
+ * Atomically test @v and decrement if it is greater than 0.
+ * The function returns the old value of @v minus 1.
+ */
+static __inline__ long atomic64_sub_if_positive(long i, atomic64_t * v)
+{
+	unsigned long temp, result;
+
+	__asm__ __volatile__(
+	"1:	lld	%1, %2		# atomic64_sub_if_positive\n"
+	"	dsubu	%0, %1, %3				\n"
+	"	bltz	%0, 1f					\n"
+	"	scd	%0, %2					\n"
+	"	beqz	%0, 1b					\n"
+	"	sync						\n"
+	"1:							\n"
+	: "=&r" (result), "=&r" (temp), "=m" (v->counter)
+	: "Ir" (i), "m" (v->counter)
+	: "memory");
+
+	return result;
+}
+
 #else
 
 /*
@@ -368,7 +448,7 @@ static __inline__ int atomic64_sub_return(int i, atomic64_t * v)
  *
  * Atomically adds @i to @v.
  */
-static __inline__ void atomic64_add(int i, atomic64_t * v)
+static __inline__ void atomic64_add(long i, atomic64_t * v)
 {
 	unsigned long flags;
 
@@ -384,7 +464,7 @@ static __inline__ void atomic64_add(int i, atomic64_t * v)
  *
  * Atomically subtracts @i from @v.
  */
-static __inline__ void atomic64_sub(int i, atomic64_t * v)
+static __inline__ void atomic64_sub(long i, atomic64_t * v)
 {
 	unsigned long flags;
 
@@ -393,10 +473,10 @@ static __inline__ void atomic64_sub(int i, atomic64_t * v)
 	spin_unlock_irqrestore(&atomic_lock, flags);
 }
 
-static __inline__ int atomic64_add_return(int i, atomic64_t * v)
+static __inline__ long atomic64_add_return(long i, atomic64_t * v)
 {
 	unsigned long flags;
-	int temp;
+	long temp;
 
 	spin_lock_irqsave(&atomic_lock, flags);
 	temp = v->counter;
@@ -407,10 +487,10 @@ static __inline__ int atomic64_add_return(int i, atomic64_t * v)
 	return temp;
 }
 
-static __inline__ int atomic64_sub_return(int i, atomic64_t * v)
+static __inline__ long atomic64_sub_return(long i, atomic64_t * v)
 {
 	unsigned long flags;
-	int temp;
+	long temp;
 
 	spin_lock_irqsave(&atomic_lock, flags);
 	temp = v->counter;
@@ -421,6 +501,28 @@ static __inline__ int atomic64_sub_return(int i, atomic64_t * v)
 	return temp;
 }
 
+/*
+ * atomic64_sub_if_positive - add integer to atomic variable
+ * @v: pointer of type atomic64_t
+ *
+ * Atomically test @v and decrement if it is greater than 0.
+ * The function returns the old value of @v minus 1.
+ */
+static __inline__ long atomic64_sub_if_positive(long i, atomic64_t * v)
+{
+	unsigned long flags;
+	long temp;
+
+	spin_lock_irqsave(&atomic_lock, flags);
+	temp = v->counter;
+	temp -= i;
+	if (temp >= 0)
+		v->counter = temp;
+	spin_unlock_irqrestore(&atomic_lock, flags);
+
+	return temp;
+}
+
 #endif /* CONFIG_CPU_HAS_LLDSCD */
 
 #define atomic64_dec_return(v) atomic64_sub_return(1,(v))
@@ -457,6 +559,12 @@ static __inline__ int atomic64_sub_return(int i, atomic64_t * v)
  */
 #define atomic64_dec_and_test(v) (atomic64_sub_return(1, (v)) == 0)
 
+/*
+ * atomic64_dec_if_positive - decrement by 1 if old value positive
+ * @v: pointer of type atomic64_t
+ */
+#define atomic64_dec_if_positive(v)	atomic64_sub_if_positive(1, v)
+
 /*
  * atomic64_inc - increment atomic variable
  * @v: pointer of type atomic64_t
diff --git a/include/asm-mips/bootinfo.h b/include/asm-mips/bootinfo.h
index aacab4d6e..c9c257c20 100644
--- a/include/asm-mips/bootinfo.h
+++ b/include/asm-mips/bootinfo.h
@@ -12,6 +12,7 @@
 #define _ASM_BOOTINFO_H
 
 #include <linux/types.h>
+#include <asm/setup.h>
 
 /*
  * The MACH_GROUP_ IDs are the equivalent to PCI vendor IDs; the remaining
@@ -209,7 +210,7 @@
 #define MACH_GROUP_TITAN       22	/* PMC-Sierra Titan		*/
 #define  MACH_TITAN_YOSEMITE	1	/* PMC-Sierra Yosemite		*/
 
-#define CL_SIZE			(256)
+#define CL_SIZE			COMMAND_LINE_SIZE
 
 const char *get_system_type(void);
 
diff --git a/include/asm-mips/cache.h b/include/asm-mips/cache.h
index fda57132d..4517bdf20 100644
--- a/include/asm-mips/cache.h
+++ b/include/asm-mips/cache.h
@@ -18,4 +18,6 @@
 #define SMP_CACHE_SHIFT		L1_CACHE_SHIFT
 #define SMP_CACHE_BYTES		L1_CACHE_BYTES
 
+#define ARCH_KMALLOC_MINALIGN	8
+
 #endif /* _ASM_CACHE_H */
diff --git a/include/asm-mips/checksum.h b/include/asm-mips/checksum.h
index e31681afb..065426468 100644
--- a/include/asm-mips/checksum.h
+++ b/include/asm-mips/checksum.h
@@ -41,7 +41,8 @@ unsigned int csum_partial_copy_from_user(const char *src, char *dst, int len,
  * Copy and checksum to user
  */
 #define HAVE_CSUM_COPY_USER
-static inline unsigned int csum_and_copy_to_user (const char *src, char *dst,
+static inline unsigned int csum_and_copy_to_user (const char *src, 
+						  char __user *dst,
 						  int len, int sum,
 						  int *err_ptr)
 {
diff --git a/include/asm-mips/fcntl.h b/include/asm-mips/fcntl.h
index e2b9c0a25..2436392e7 100644
--- a/include/asm-mips/fcntl.h
+++ b/include/asm-mips/fcntl.h
@@ -26,6 +26,7 @@
 #define O_DIRECT	0x8000	/* direct disk access hint */
 #define O_DIRECTORY	0x10000	/* must be a directory */
 #define O_NOFOLLOW	0x20000	/* don't follow links */
+#define O_NOATIME	0x40000
 
 #define O_NDELAY	O_NONBLOCK
 
diff --git a/include/asm-mips/hazards.h b/include/asm-mips/hazards.h
index 4a024fa72..f70b9362a 100644
--- a/include/asm-mips/hazards.h
+++ b/include/asm-mips/hazards.h
@@ -12,22 +12,27 @@
 
 #ifdef __ASSEMBLY__
 
+	.macro	_ssnop
+	sll	$0, $2, 1
+	.endm
+
 /*
  * RM9000 hazards.  When the JTLB is updated by tlbwi or tlbwr, a subsequent
  * use of the JTLB for instructions should not occur for 4 cpu cycles and use
  * for data translations should not occur for 3 cpu cycles.
  */
 #ifdef CONFIG_CPU_RM9000
+
 #define mtc0_tlbw_hazard						\
 	.set	push;							\
 	.set	mips32;							\
-	ssnop; ssnop; ssnop; ssnop;					\
+	_ssnop; _ssnop; _ssnop; _ssnop;					\
 	.set	pop
 
 #define tlbw_eret_hazard						\
 	.set	push;							\
 	.set	mips32;							\
-	ssnop; ssnop; ssnop; ssnop;					\
+	_ssnop; _ssnop; _ssnop; _ssnop;					\
 	.set	pop
 
 #else
@@ -43,6 +48,33 @@
 #define tlbw_eret_hazard
 #endif
 
+/*
+ * mtc0->mfc0 hazard
+ * The 24K has a 2 cycle mtc0/mfc0 execution hazard.
+ * It is a MIPS32R2 processor so ehb will clear the hazard.
+ */
+
+#ifdef CONFIG_CPU_MIPSR2
+/*
+ * Use a macro for ehb unless explicit support for MIPSR2 is enabled
+ */
+	.macro	ehb
+	sll	$0, $0, 3
+	.endm
+
+#define irq_enable_hazard						\
+	ehb		# irq_enable_hazard
+
+#define irq_disable_hazard						\
+	ehb		# irq_disable_hazard
+
+#else
+
+#define irq_enable_hazard
+#define irq_disable_hazard
+
+#endif
+
 #else /* __ASSEMBLY__ */
 
 /*
@@ -55,13 +87,13 @@
 #define mtc0_tlbw_hazard()						\
 	__asm__ __volatile__(						\
 		".set\tmips32\n\t"					\
-		"ssnop; ssnop; ssnop; ssnop\n\t"			\
+		"_ssnop; _ssnop; _ssnop; _ssnop\n\t"			\
 		".set\tmips0")
 
 #define tlbw_use_hazard()						\
 	__asm__ __volatile__(						\
 		".set\tmips32\n\t"					\
-		"ssnop; ssnop; ssnop; ssnop\n\t"			\
+		"_ssnop; _ssnop; _ssnop; _ssnop\n\t"			\
 		".set\tmips0")
 #else
 
@@ -82,6 +114,83 @@
 
 #endif
 
+/*
+ * mtc0->mfc0 hazard
+ * The 24K has a 2 cycle mtc0/mfc0 execution hazard.
+ * It is a MIPS32R2 processor so ehb will clear the hazard.
+ */
+
+#ifdef CONFIG_CPU_MIPSR2
+/*
+ * Use a macro for ehb unless explicit support for MIPSR2 is enabled
+ */
+__asm__(
+	"	.macro	ehb					\n\t"
+	"	sll	$0, $0, 3				\n\t"
+	"	.endm						\n\t"
+	"							\n\t"
+	"	.macro\tirq_enable_hazard			\n\t"
+	"	ehb						\n\t"
+	"	.endm						\n\t"
+	"							\n\t"
+	"	.macro\tirq_disable_hazard			\n\t"
+	"	ehb						\n\t"
+	"	.endm");
+
+#define irq_enable_hazard()						\
+	__asm__ __volatile__(						\
+	"ehb\t\t\t\t# irq_enable_hazard")
+
+#define irq_disable_hazard()						\
+	__asm__ __volatile__(						\
+	"ehb\t\t\t\t# irq_disable_hazard")
+
+#elif defined(CONFIG_CPU_R10000)
+
+/*
+ * R10000 rocks - all hazards handled in hardware, so this becomes a nobrainer.
+ */
+
+__asm__(
+	"	.macro\tirq_enable_hazard			\n\t"
+	"	.endm						\n\t"
+	"							\n\t"
+	"	.macro\tirq_disable_hazard			\n\t"
+	"	.endm");
+
+#define irq_enable_hazard()	do { } while (0)
+#define irq_disable_hazard()	do { } while (0)
+
+#else
+
+/*
+ * Default for classic MIPS processors.  Assume worst case hazards but don't
+ * care about the irq_enable_hazard - sooner or later the hardware will
+ * enable it and we don't care when exactly.
+ */
+
+__asm__(
+	"	.macro	_ssnop					\n\t"
+	"	sll	$0, $2, 1				\n\t"
+	"	.endm						\n\t"
+	"							\n\t"
+	"	#						\n\t"
+	"	# There is a hazard but we do not care		\n\t"
+	"	#						\n\t"
+	"	.macro\tirq_enable_hazard			\n\t"
+	"	.endm						\n\t"
+	"							\n\t"
+	"	.macro\tirq_disable_hazard			\n\t"
+	"	_ssnop; _ssnop; _ssnop				\n\t"
+	"	.endm");
+
+#define irq_enable_hazard()	do { } while (0)
+#define irq_disable_hazard()						\
+	__asm__ __volatile__(						\
+	"_ssnop; _ssnop; _ssnop;\t\t# irq_disable_hazard")
+
+#endif
+
 #endif /* __ASSEMBLY__ */
 
 #endif /* _ASM_HAZARDS_H */
diff --git a/include/asm-mips/mipsregs.h b/include/asm-mips/mipsregs.h
index 8bdab9794..71198779f 100644
--- a/include/asm-mips/mipsregs.h
+++ b/include/asm-mips/mipsregs.h
@@ -632,7 +632,7 @@ do {									\
 } while (0)
 
 /*
- * On The RM7000 these are use to access cop0 set 1 registers
+ * On RM7000/RM9000 these are uses to access cop0 set 1 registers
  */
 #define __read_32bit_c0_ctrl_register(source)				\
 ({ int __res;								\
diff --git a/include/asm-mips/mmu_context.h b/include/asm-mips/mmu_context.h
index e42794180..dd7591b48 100644
--- a/include/asm-mips/mmu_context.h
+++ b/include/asm-mips/mmu_context.h
@@ -45,12 +45,17 @@ extern unsigned long pgd_current[];
 #define ASID_INC	0x40
 #define ASID_MASK	0xfc0
 
+#elif defined(CONFIG_CPU_R8000)
+
+#define ASID_INC	0x10
+#define ASID_MASK	0xff0
+
 #elif defined(CONFIG_CPU_RM9000)
 
 #define ASID_INC	0x1
 #define ASID_MASK	0xfff
 
-#else /* FIXME: not correct for R6000, R8000 */
+#else /* FIXME: not correct for R6000 */
 
 #define ASID_INC	0x1
 #define ASID_MASK	0xff
@@ -78,9 +83,8 @@ get_new_mmu_context(struct mm_struct *mm, unsigned long cpu)
 	unsigned long asid = asid_cache(cpu);
 
 	if (! ((asid += ASID_INC) & ASID_MASK) ) {
-#ifdef CONFIG_VTAG_ICACHE
-		flush_icache_all();
-#endif
+		if (cpu_has_vtag_icache)
+			flush_icache_all();
 		local_flush_tlb_all();	/* start new asid cycle */
 		if (!asid)		/* fix version if needed */
 			asid = ASID_FIRST_VERSION;
diff --git a/include/asm-mips/module.h b/include/asm-mips/module.h
index 99635e6b6..90ee24aad 100644
--- a/include/asm-mips/module.h
+++ b/include/asm-mips/module.h
@@ -2,11 +2,14 @@
 #define _ASM_MODULE_H
 
 #include <linux/config.h>
+#include <linux/list.h>
+#include <asm/uaccess.h>
 
 struct mod_arch_specific {
 	/* Data Bus Error exception tables */
-	const struct exception_table_entry *dbe_table_start;
-	const struct exception_table_entry *dbe_table_end;
+	struct list_head dbe_list;
+	const struct exception_table_entry *dbe_start;
+	const struct exception_table_entry *dbe_end;
 };
 
 typedef uint8_t Elf64_Byte;		/* Type for a 8-bit quantity.  */
@@ -38,4 +41,16 @@ typedef struct
 
 #endif
 
+#ifdef CONFIG_MODULES
+/* Given an address, look for it in the exception tables. */
+const struct exception_table_entry*search_module_dbetables(unsigned long addr);
+#else
+/* Given an address, look for it in the exception tables. */
+static inline const struct exception_table_entry *
+search_module_dbetables(unsigned long addr)
+{
+	return NULL;
+}
+#endif
+
 #endif /* _ASM_MODULE_H */
diff --git a/include/asm-mips/mv64340.h b/include/asm-mips/mv64340.h
index 442f2fbf7..a889dd978 100644
--- a/include/asm-mips/mv64340.h
+++ b/include/asm-mips/mv64340.h
@@ -14,7 +14,7 @@
 #define __ASM_MV64340_H
 
 #include <asm/addrspace.h>
-#include <asm/byteorder.h>
+#include <asm/marvell.h>
 
 /****************************************/
 /* Processor Address Space              */
@@ -1034,38 +1034,6 @@
 #define MV64340_SERIAL_INIT_CONTROL                                 0xf328
 #define MV64340_SERIAL_INIT_STATUS                                  0xf32c
 
-extern unsigned long mv64340_base;
-
-#define MV64340_BASE       (mv64340_base)
-
-/*
- * Because of an error/peculiarity in the Galileo chip, we need to swap the
- * bytes when running bigendian.
- */
-
-#define MV_WRITE(ofs, data)		\
-        *(volatile u32 *)(MV64340_BASE + (ofs)) = cpu_to_le32((u32)data)
-#define MV_READ(ofs)			\
-        (le32_to_cpu(*(volatile u32 *)(MV64340_BASE + (ofs))))
-
-#define MV_WRITE_16(ofs, data)		\
-        *(volatile u16 *)(MV64340_BASE + (ofs)) = cpu_to_le16((u16)data)
-#define MV_READ_16(ofs)			\
-        le16_to_cpu(*(volatile u16 *)(MV64340_BASE + (ofs)))
-
-#define MV_WRITE_8(ofs, data)		\
-        *(volatile u8 *)(MV64340_BASE + (ofs)) = ((u16)data)
-#define MV_READ_8(ofs)			\
-        (*(volatile u8 *)(MV64340_BASE + (ofs)))
-
-#define MV_SET_REG_BITS(ofs, bits)	\
-	(*((volatile u32 *)(MV64340_BASE + (ofs)))) |= ((u32)cpu_to_le32(bits))
-#define MV_RESET_REG_BITS(ofs, bits)	\
-	(*((volatile u32 *)(MV64340_BASE + (ofs)))) &= ~((u32)cpu_to_le32(bits))
-
 extern void mv64340_irq_init(unsigned int base);
 
-extern struct pci_ops mv64340_bus0_pci_ops;
-extern struct pci_ops mv64340_bus1_pci_ops;
-
 #endif /* __ASM_MV64340_H */
diff --git a/include/asm-mips/page.h b/include/asm-mips/page.h
index 37de18f63..47ca67f25 100644
--- a/include/asm-mips/page.h
+++ b/include/asm-mips/page.h
@@ -10,16 +10,20 @@
 #define _ASM_PAGE_H
 
 #include <linux/config.h>
-#include <spaces.h>
 
 #ifdef __KERNEL__
 
+#include <spaces.h>
+
 /*
  * PAGE_SHIFT determines the page size
  */
 #ifdef CONFIG_PAGE_SIZE_4KB
 #define PAGE_SHIFT	12
 #endif
+#ifdef CONFIG_PAGE_SIZE_8KB
+#define PAGE_SHIFT	13
+#endif
 #ifdef CONFIG_PAGE_SIZE_16KB
 #define PAGE_SHIFT	14
 #endif
diff --git a/include/asm-mips/pci.h b/include/asm-mips/pci.h
index ba29750e4..1af4e5b60 100644
--- a/include/asm-mips/pci.h
+++ b/include/asm-mips/pci.h
@@ -87,6 +87,9 @@ extern void pci_dac_dma_sync_single_for_cpu(struct pci_dev *pdev,
 extern void pci_dac_dma_sync_single_for_device(struct pci_dev *pdev,
 	dma64_addr_t dma_addr, size_t len, int direction);
 
+extern void pcibios_resource_to_bus(struct pci_dev *dev,
+	struct pci_bus_region *region, struct resource *res);
+
 #endif /* __KERNEL__ */
 
 /* implement the pci_ DMA API in terms of the generic device dma_ one */
diff --git a/include/asm-mips/pgtable-32.h b/include/asm-mips/pgtable-32.h
index 51326d10b..65bee143e 100644
--- a/include/asm-mips/pgtable-32.h
+++ b/include/asm-mips/pgtable-32.h
@@ -141,35 +141,8 @@ static inline void pgd_clear(pgd_t *pgdp)	{ }
 #define pfn_pte(pfn, prot)	__pte(((pfn) << PAGE_SHIFT) | pgprot_val(prot))
 #endif
 
-#if defined(CONFIG_CPU_R3000) || defined(CONFIG_CPU_TX39XX)
-
-/*
- * Bits 0, 1, 2, 9 and 10 are taken, split up the 27 bits of offset
- * into this range:
- */
-#define pte_to_pgoff(_pte) \
-	((((_pte).pte >> 3) & 0x3f ) + (((_pte).pte >> 11) << 8 ))
-
-#define pgoff_to_pte(off) \
-	((pte_t) { (((off) & 0x3f) << 3) + (((off) >> 8) << 11) + _PAGE_FILE })
-
-#else
-
-/*
- * Bits 0, 1, 2, 7 and 8 are taken, split up the 27 bits of offset
- * into this range:
- */
-#define pte_to_pgoff(_pte) \
-	((((_pte).pte >> 3) & 0x1f ) + (((_pte).pte >> 9) << 6 ))
- 
-#define pgoff_to_pte(off) \
-	((pte_t) { (((off) & 0x1f) << 3) + (((off) >> 6) << 9) + _PAGE_FILE })
-
-#endif
-
 #define __pgd_offset(address)	pgd_index(address)
-#define __pmd_offset(address) \
-	(((address) >> PMD_SHIFT) & (PTRS_PER_PMD-1))
+#define __pmd_offset(address)	(((address) >> PMD_SHIFT) & (PTRS_PER_PMD-1))
 
 /* to find an entry in a kernel page-table-directory */
 #define pgd_offset_k(address) pgd_offset(&init_mm, address)
@@ -200,17 +173,46 @@ static inline pmd_t *pmd_offset(pgd_t *dir, unsigned long address)
 #define pte_unmap(pte) ((void)(pte))
 #define pte_unmap_nested(pte) ((void)(pte))
 
-/* Swap entries must have VALID and GLOBAL bits cleared. */
 #if defined(CONFIG_CPU_R3000) || defined(CONFIG_CPU_TX39XX)
 
-#define __swp_type(x)		(((x).val >> 1) & 0x7f)
-#define __swp_offset(x)		((x).val >> 10)
-#define __swp_entry(type,offset)	((swp_entry_t) { ((type) << 1) | ((offset) << 10) })
+/* Swap entries must have VALID bit cleared. */
+#define __swp_type(x)		(((x).val >> 10) & 0x1f)
+#define __swp_offset(x)		((x).val >> 15)
+#define __swp_entry(type,offset)	\
+	((swp_entry_t) { ((type) << 10) | ((offset) << 15) })
+
+/*
+ * Bits 0, 1, 2, 9 and 10 are taken, split up the 27 bits of offset
+ * into this range:
+ */
+#define PTE_FILE_MAX_BITS	27
+
+#define pte_to_pgoff(_pte) \
+	((((_pte).pte >> 3) & 0x3f ) + (((_pte).pte >> 11) << 8 ))
+
+#define pgoff_to_pte(off) \
+	((pte_t) { (((off) & 0x3f) << 3) + (((off) >> 8) << 11) + _PAGE_FILE })
+
 #else
 
-#define __swp_type(x)		(((x).val >> 1) & 0x1f)
-#define __swp_offset(x)		((x).val >> 8)
-#define __swp_entry(type,offset)	((swp_entry_t) { ((type) << 1) | ((offset) << 8) })
+/* Swap entries must have VALID and GLOBAL bits cleared. */
+#define __swp_type(x)		(((x).val >> 8) & 0x1f)
+#define __swp_offset(x)		((x).val >> 13)
+#define __swp_entry(type,offset)	\
+		((swp_entry_t) { ((type) << 8) | ((offset) << 13) })
+
+/*
+ * Bits 0, 1, 2, 7 and 8 are taken, split up the 27 bits of offset
+ * into this range:
+ */
+#define PTE_FILE_MAX_BITS	27
+
+#define pte_to_pgoff(_pte) \
+	((((_pte).pte >> 3) & 0x1f ) + (((_pte).pte >> 9) << 6 ))
+
+#define pgoff_to_pte(off) \
+	((pte_t) { (((off) & 0x1f) << 3) + (((off) >> 6) << 9) + _PAGE_FILE })
+
 #endif
 
 #define __pte_to_swp_entry(pte)	((swp_entry_t) { pte_val(pte) })
diff --git a/include/asm-mips/pgtable-64.h b/include/asm-mips/pgtable-64.h
index eba84a79e..333d9a8f5 100644
--- a/include/asm-mips/pgtable-64.h
+++ b/include/asm-mips/pgtable-64.h
@@ -53,7 +53,11 @@
  * We used to implement 41 bits by having an order 1 pmd level but that seemed
  * rather pointless.
  *
- * For 16kB page size we use a 2 level page tree which permit a total of
+ * For 8kB page size we use a 3 level page tree which permits a total of
+ * 8TB of address space.  Alternatively a 33-bit / 8GB organization using
+ * two levels would be easy to implement.
+ *
+ * For 16kB page size we use a 2 level page tree which permits a total of
  * 36 bits of virtual address space.  We could add a third leve. but it seems
  * like at the moment there's no need for this.
  *
@@ -65,6 +69,11 @@
 #define PMD_ORDER		1
 #define PTE_ORDER		0
 #endif
+#ifdef CONFIG_PAGE_SIZE_8KB
+#define PGD_ORDER		0
+#define PMD_ORDER		0
+#define PTE_ORDER		0
+#endif
 #ifdef CONFIG_PAGE_SIZE_16KB
 #define PGD_ORDER		0
 #define PMD_ORDER		0
@@ -148,16 +157,6 @@ static inline void pgd_clear(pgd_t *pgdp)
 #define pfn_pte(pfn, prot)	__pte(((pfn) << PAGE_SHIFT) | pgprot_val(prot))
 #endif
 
-/*
- * Bits 0, 1, 2, 7 and 8 are taken, split up the 27 bits of offset
- * into this range:
- */
-#define pte_to_pgoff(_pte) \
-	((((_pte).pte >> 3) & 0x1f ) + (((_pte).pte >> 9) << 6 ))
-
-#define pgoff_to_pte(off) \
-	((pte_t) { (((off) & 0x1f) << 3) + (((off) >> 6) << 9) + _PAGE_FILE })
-
 #define __pgd_offset(address)	pgd_index(address)
 #define page_pte(page) page_pte_prot(page, __pgprot(0))
 
@@ -214,6 +213,18 @@ static inline pte_t mk_swap_pte(unsigned long type, unsigned long offset)
 #define __pte_to_swp_entry(pte)	((swp_entry_t) { pte_val(pte) })
 #define __swp_entry_to_pte(x)	((pte_t) { (x).val })
 
+/*
+ * Bits 0, 1, 2, 7 and 8 are taken, split up the 32 bits of offset
+ * into this range:
+ */
+#define PTE_FILE_MAX_BITS	32
+
+#define pte_to_pgoff(_pte) \
+	((((_pte).pte >> 3) & 0x1f ) + (((_pte).pte >> 9) << 6 ))
+
+#define pgoff_to_pte(off) \
+	((pte_t) { (((off) & 0x1f) << 3) + (((off) >> 6) << 9) + _PAGE_FILE })
+
 /*
  * Used for the b0rked handling of kernel pagetables on the 64-bit kernel.
  */
diff --git a/include/asm-mips/pgtable-bits.h b/include/asm-mips/pgtable-bits.h
index 22d19833a..6a8904206 100644
--- a/include/asm-mips/pgtable-bits.h
+++ b/include/asm-mips/pgtable-bits.h
@@ -60,7 +60,7 @@
 #define _PAGE_SILENT_WRITE          (1<<8)
 #define _CACHE_MASK                 (7<<9)
 
-#if defined(CONFIG_CPU_SB1)
+#ifdef CONFIG_CPU_SB1
 
 /* No penalty for being coherent on the SB1, so just
    use it for "noncoherent" spaces, too.  Shouldn't hurt. */
@@ -70,6 +70,20 @@
 #define _CACHE_CACHABLE_NONCOHERENT (5<<9)
 #define _CACHE_UNCACHED_ACCELERATED (7<<9)
 
+#elif defined(CONFIG_CPU_RM9000)
+
+#define _CACHE_WT			(0 << 9)
+#define _CACHE_WTWA			(1 << 9)
+#define _CACHE_UC_B			(2 << 9)
+#define _CACHE_WB			(3 << 9)
+#define _CACHE_CWBEA			(4 << 9)
+#define _CACHE_CWB			(5 << 9)
+#define _CACHE_UCNB			(6 << 9)
+#define _CACHE_FPC			(7 << 9)
+
+#define _CACHE_UNCACHED			_CACHE_UC_B
+#define _CACHE_CACHABLE_NONCOHERENT	_CACHE_WB
+
 #else
 
 #define _CACHE_CACHABLE_NO_WA       (0<<9)  /* R4600 only              */
@@ -93,6 +107,8 @@
 #define PAGE_CACHABLE_DEFAULT	_CACHE_UNCACHED
 #elif defined(CONFIG_DMA_NONCOHERENT)
 #define PAGE_CACHABLE_DEFAULT	_CACHE_CACHABLE_NONCOHERENT
+#elif defined(CONFIG_CPU_RM9000)
+#define PAGE_CACHABLE_DEFAULT	_CACHE_CWBEA
 #else
 #define PAGE_CACHABLE_DEFAULT	_CACHE_CACHABLE_COW
 #endif
diff --git a/include/asm-mips/pgtable.h b/include/asm-mips/pgtable.h
index 5b2aa070c..9d5a8fad0 100644
--- a/include/asm-mips/pgtable.h
+++ b/include/asm-mips/pgtable.h
@@ -125,8 +125,6 @@ static inline void pte_clear(pte_t *ptep)
 
 extern pgd_t swapper_pg_dir[PTRS_PER_PGD];
 
-#define PTE_FILE_MAX_BITS	27
-
 /*
  * The following only work if pte_present() is true.
  * Undefined behaviour if not..
diff --git a/include/asm-mips/pmon.h b/include/asm-mips/pmon.h
index 016251785..7b4f990e1 100644
--- a/include/asm-mips/pmon.h
+++ b/include/asm-mips/pmon.h
@@ -17,6 +17,9 @@ struct callvectors {
 	int	(*printf) (const char*, ...);		/*	20 */
 	void	(*cacheflush) (void);			/*	24 */
 	char*	(*gets) (char*);			/*	28 */
+	int	(*cpustart) (int, void *, int, int);	/*	32 */
 };
 
+extern struct callvectors *debug_vectors;
+
 #endif /* _ASM_PMON_H */
diff --git a/include/asm-mips/processor.h b/include/asm-mips/processor.h
index 70534af2a..a502e8360 100644
--- a/include/asm-mips/processor.h
+++ b/include/asm-mips/processor.h
@@ -137,9 +137,9 @@ extern unsigned int vced_count, vcei_count;
 #endif
 
 /*
- * Size of io_bitmap in longwords: 32 is ports 0-0x3ff.
+ * Size of io_bitmap in longwords.
  */
-#define IO_BITMAP_SIZE	32
+#define IO_BITMAP_SIZE	2048
 
 #define NUM_FPU_REGS	32
 
@@ -280,15 +280,6 @@ unsigned long get_wchan(struct task_struct *p);
  */
 #define return_address() ({__asm__ __volatile__("":::"$31");__builtin_return_address(0);})
 
-/*
- * For now.  The 32-bit cycle counter is screwed up so solving this nicely takes a little
- * brainwork ...
- */
-static inline unsigned long long sched_clock(void)
-{
-	return 0ULL;
-}
-
 #ifdef CONFIG_CPU_HAS_PREFETCH
 
 #define ARCH_HAS_PREFETCH
diff --git a/include/asm-mips/resource.h b/include/asm-mips/resource.h
index 4beb2150f..2453e0d1c 100644
--- a/include/asm-mips/resource.h
+++ b/include/asm-mips/resource.h
@@ -23,8 +23,10 @@
 #define RLIMIT_NPROC 8			/* max number of processes */
 #define RLIMIT_MEMLOCK 9		/* max locked-in-memory address space */
 #define RLIMIT_LOCKS 10			/* maximum file locks held */
+#define RLIMIT_SIGPENDING 11		/* max number of pending signals */
+#define RLIMIT_MSGQUEUE 12		/* maximum bytes in POSIX mqueues */
 
-#define RLIM_NLIMITS 11			/* Number of limit flavors.  */
+#define RLIM_NLIMITS 13			/* Number of limit flavors.  */
 
 #ifdef __KERNEL__
 
@@ -54,6 +56,8 @@
 	{ 0,             0             },		\
 	{ RLIM_INFINITY, RLIM_INFINITY },		\
 	{ RLIM_INFINITY, RLIM_INFINITY },		\
+	{ MAX_SIGPENDING, MAX_SIGPENDING },		\
+	{ MQ_BYTES_MAX, MQ_BYTES_MAX },			\
 }
 
 #endif /* __KERNEL__ */
diff --git a/include/asm-mips/semaphore.h b/include/asm-mips/semaphore.h
index bab913a90..ed9a3d774 100644
--- a/include/asm-mips/semaphore.h
+++ b/include/asm-mips/semaphore.h
@@ -4,61 +4,70 @@
  * for more details.
  *
  * Copyright (C) 1996  Linus Torvalds
- * Copyright (C) 1998, 99, 2000, 01  Ralf Baechle
+ * Copyright (C) 1998, 99, 2000, 01, 04  Ralf Baechle
  * Copyright (C) 1999, 2000, 01  Silicon Graphics, Inc.
  * Copyright (C) 2000, 01 MIPS Technologies, Inc.
+ *
+ * In all honesty, little of the old MIPS code left - the PPC64 variant was
+ * just looking nice and portable so I ripped it.  Credits to whoever wrote
+ * it.
  */
-#ifndef _ASM_SEMAPHORE_H
-#define _ASM_SEMAPHORE_H
+#ifndef __ASM_SEMAPHORE_H
+#define __ASM_SEMAPHORE_H
+
+/*
+ * Remove spinlock-based RW semaphores; RW semaphore definitions are
+ * now in rwsem.h and we use the generic lib/rwsem.c implementation.
+ * Rework semaphores to use atomic_dec_if_positive.
+ * -- Paul Mackerras (paulus@samba.org)
+ */
+
+#ifdef __KERNEL__
 
-#include <linux/compiler.h>
-#include <linux/config.h>
-#include <linux/spinlock.h>
+#include <asm/atomic.h>
+#include <asm/system.h>
 #include <linux/wait.h>
 #include <linux/rwsem.h>
-#include <asm/atomic.h>
 
 struct semaphore {
-#ifdef __MIPSEB__
-	atomic_t count;
-	atomic_t waking;
-#else
-	atomic_t waking;
+	/*
+	 * Note that any negative value of count is equivalent to 0,
+	 * but additionally indicates that some process(es) might be
+	 * sleeping on `wait'.
+	 */
 	atomic_t count;
-#endif
 	wait_queue_head_t wait;
-#if WAITQUEUE_DEBUG
+#ifdef WAITQUEUE_DEBUG
 	long __magic;
 #endif
-} __attribute__((aligned(8)));
+};
 
-#if WAITQUEUE_DEBUG
-# define __SEM_DEBUG_INIT(name) , .__magic = (long)&(name).__magic
+#ifdef WAITQUEUE_DEBUG
+# define __SEM_DEBUG_INIT(name) \
+		, (long)&(name).__magic
 #else
 # define __SEM_DEBUG_INIT(name)
 #endif
 
-#define __SEMAPHORE_INITIALIZER(name,_count) {				\
-	.count	= ATOMIC_INIT(_count),					\
-	.waking	= ATOMIC_INIT(0),					\
-	.wait	= __WAIT_QUEUE_HEAD_INITIALIZER((name).wait)		\
-	__SEM_DEBUG_INIT(name)						\
-}
+#define __SEMAPHORE_INITIALIZER(name, count) \
+	{ ATOMIC_INIT(count), \
+	  __WAIT_QUEUE_HEAD_INITIALIZER((name).wait) \
+	  __SEM_DEBUG_INIT(name) }
 
-#define __MUTEX_INITIALIZER(name) __SEMAPHORE_INITIALIZER(name, 1)
+#define __MUTEX_INITIALIZER(name) \
+	__SEMAPHORE_INITIALIZER(name, 1)
 
-#define __DECLARE_SEMAPHORE_GENERIC(name,count) \
-	struct semaphore name = __SEMAPHORE_INITIALIZER(name, count)
+#define __DECLARE_SEMAPHORE_GENERIC(name, count) \
+	struct semaphore name = __SEMAPHORE_INITIALIZER(name,count)
 
-#define DECLARE_MUTEX(name) __DECLARE_SEMAPHORE_GENERIC(name, 1)
-#define DECLARE_MUTEX_LOCKED(name) __DECLARE_SEMAPHORE_GENERIC(name,0)
+#define DECLARE_MUTEX(name)		__DECLARE_SEMAPHORE_GENERIC(name, 1)
+#define DECLARE_MUTEX_LOCKED(name)	__DECLARE_SEMAPHORE_GENERIC(name, 0)
 
 static inline void sema_init (struct semaphore *sem, int val)
 {
 	atomic_set(&sem->count, val);
-	atomic_set(&sem->waking, 0);
 	init_waitqueue_head(&sem->wait);
-#if WAITQUEUE_DEBUG
+#ifdef WAITQUEUE_DEBUG
 	sem->__magic = (long)&sem->__magic;
 #endif
 }
@@ -73,211 +82,57 @@ static inline void init_MUTEX_LOCKED (struct semaphore *sem)
 	sema_init(sem, 0);
 }
 
-#ifndef CONFIG_CPU_HAS_LLDSCD
-/*
- * On machines without lld/scd we need a spinlock to make the manipulation of
- * sem->count and sem->waking atomic.
- */
-extern spinlock_t semaphore_lock;
-#endif
-
-extern void __down_failed(struct semaphore * sem);
-extern int  __down_failed_interruptible(struct semaphore * sem);
-extern void __up_wakeup(struct semaphore * sem);
+extern void __down(struct semaphore * sem);
+extern int  __down_interruptible(struct semaphore * sem);
+extern void __up(struct semaphore * sem);
 
 static inline void down(struct semaphore * sem)
 {
-	int count;
-
-#if WAITQUEUE_DEBUG
+#ifdef WAITQUEUE_DEBUG
 	CHECK_MAGIC(sem->__magic);
 #endif
 	might_sleep();
-	count = atomic_dec_return(&sem->count);
-	if (unlikely(count < 0))
-		__down_failed(sem);
+
+	/*
+	 * Try to get the semaphore, take the slow path if we fail.
+	 */
+	if (unlikely(atomic_dec_return(&sem->count) < 0))
+		__down(sem);
 }
 
-/*
- * Interruptible try to acquire a semaphore.  If we obtained
- * it, return zero.  If we were interrupted, returns -EINTR
- */
 static inline int down_interruptible(struct semaphore * sem)
 {
-	int count;
+	int ret = 0;
 
-#if WAITQUEUE_DEBUG
+#ifdef WAITQUEUE_DEBUG
 	CHECK_MAGIC(sem->__magic);
 #endif
 	might_sleep();
-	count = atomic_dec_return(&sem->count);
-	if (unlikely(count < 0))
-		return __down_failed_interruptible(sem);
-
-	return 0;
-}
-
-#ifdef CONFIG_CPU_HAS_LLDSCD
-
-/*
- * down_trylock returns 0 on success, 1 if we failed to get the lock.
- *
- * We must manipulate count and waking simultaneously and atomically.
- * Here, we do this by using lld/scd on the pair of 32-bit words.
- *
- * Pseudocode:
- *
- *   Decrement(sem->count)
- *   If(sem->count >=0) {
- *	Return(SUCCESS)			// resource is free
- *   } else {
- *	If(sem->waking <= 0) {		// if no wakeup pending
- *	   Increment(sem->count)	// undo decrement
- *	   Return(FAILURE)
- *      } else {
- *	   Decrement(sem->waking)	// otherwise "steal" wakeup
- *	   Return(SUCCESS)
- *	}
- *   }
- */
-static inline int down_trylock(struct semaphore * sem)
-{
-	long ret, tmp, tmp2, sub;
-
-#if WAITQUEUE_DEBUG
-	CHECK_MAGIC(sem->__magic);
-#endif
-
-	__asm__ __volatile__(
-	"	.set	mips3			# down_trylock		\n"
-	"0:	lld	%1, %4						\n"
-	"	dli	%3, 0x0000000100000000	# count -= 1		\n"
-	"	dsubu	%1, %3						\n"
-	"	li	%0, 0			# ret = 0		\n"
-	"	bgez	%1, 2f			# if count >= 0		\n"
-	"	sll	%2, %1, 0		# extract waking	\n"
-	"	blez	%2, 1f			# if waking < 0 -> 1f	\n"
-	"	daddiu	%1, %1, -1		# waking -= 1		\n"
-	"	b	2f						\n"
-	"1:	daddu	%1, %1, %3		# count += 1		\n"
-	"	li	%0, 1			# ret = 1		\n"
-	"2:	scd	%1, %4						\n"
-	"	beqz	%1, 0b						\n"
-	"	sync							\n"
-	"	.set	mips0						\n"
-	: "=&r"(ret), "=&r"(tmp), "=&r"(tmp2), "=&r"(sub)
-	: "m"(*sem)
-	: "memory");
 
+	if (unlikely(atomic_dec_return(&sem->count) < 0))
+		ret = __down_interruptible(sem);
 	return ret;
 }
 
-/*
- * Note! This is subtle. We jump to wake people up only if
- * the semaphore was negative (== somebody was waiting on it).
- */
-static inline void up(struct semaphore * sem)
-{
-	unsigned long tmp, tmp2;
-	int count;
-
-#if WAITQUEUE_DEBUG
-	CHECK_MAGIC(sem->__magic);
-#endif
-	/*
-	 * We must manipulate count and waking simultaneously and atomically.
-	 * Otherwise we have races between up and __down_failed_interruptible
-	 * waking up on a signal.
-	 */
-
-	__asm__ __volatile__(
-	"	.set	mips3					\n"
-	"	sync			# up			\n"
-	"1:	lld	%1, %3					\n"
-	"	dsra32	%0, %1, 0	# extract count to %0	\n"
-	"	daddiu	%0, 1		# count += 1		\n"
-	"	slti	%2, %0, 1	# %3 = (%0 <= 0)	\n"
-	"	daddu	%1, %2		# waking += %3		\n"
-	"	dsll32 %1, %1, 0	# zero-extend %1	\n"
-	"	dsrl32 %1, %1, 0				\n"
-	"	dsll32	%2, %0, 0	# Reassemble union	\n"
-	"	or	%1, %2		# from count and waking	\n"
-	"	scd	%1, %3					\n"
-	"	beqz	%1, 1b					\n"
-	"	.set	mips0					\n"
-	: "=&r"(count), "=&r"(tmp), "=&r"(tmp2), "+m"(*sem)
-	:
-	: "memory");
-
-	if (unlikely(count <= 0))
-		__up_wakeup(sem);
-}
-
-#else
-
-/*
- * Non-blockingly attempt to down() a semaphore.
- * Returns zero if we acquired it
- */
 static inline int down_trylock(struct semaphore * sem)
 {
-	unsigned long flags;
-	int count, waking;
-	int ret = 0;
-
-#if WAITQUEUE_DEBUG
+#ifdef WAITQUEUE_DEBUG
 	CHECK_MAGIC(sem->__magic);
 #endif
 
-	spin_lock_irqsave(&semaphore_lock, flags);
-	count = atomic_read(&sem->count) - 1;
-	atomic_set(&sem->count, count);
-	if (unlikely(count < 0)) {
-		waking = atomic_read(&sem->waking);
-		if (waking <= 0) {
-			atomic_set(&sem->count, count + 1);
-			ret = 1;
-		} else {
-			atomic_set(&sem->waking, waking - 1);
-			ret = 0;
-		}
-	}
-	spin_unlock_irqrestore(&semaphore_lock, flags);
-
-	return ret;
+	return atomic_dec_if_positive(&sem->count) < 0;
 }
 
-/*
- * Note! This is subtle. We jump to wake people up only if
- * the semaphore was negative (== somebody was waiting on it).
- */
 static inline void up(struct semaphore * sem)
 {
-	unsigned long flags;
-	int count, waking;
-
-#if WAITQUEUE_DEBUG
+#ifdef WAITQUEUE_DEBUG
 	CHECK_MAGIC(sem->__magic);
 #endif
-	/*
-	 * We must manipulate count and waking simultaneously and atomically.
-	 * Otherwise we have races between up and __down_failed_interruptible
-	 * waking up on a signal.
-	 */
-
-	spin_lock_irqsave(&semaphore_lock, flags);
-	count = atomic_read(&sem->count) + 1;
-	waking = atomic_read(&sem->waking);
-	if (count <= 0)
-		waking++;
-	atomic_set(&sem->count, count);
-	atomic_set(&sem->waking, waking);
-	spin_unlock_irqrestore(&semaphore_lock, flags);
 
-	if (unlikely(count <= 0))
-		__up_wakeup(sem);
+	if (unlikely(atomic_inc_return(&sem->count) <= 0))
+		__up(sem);
 }
 
-#endif /* CONFIG_CPU_HAS_LLDSCD */
+#endif /* __KERNEL__ */
 
-#endif /* _ASM_SEMAPHORE_H */
+#endif /* __ASM_SEMAPHORE_H */
diff --git a/include/asm-mips/serial.h b/include/asm-mips/serial.h
index ae455b04b..83c735ade 100644
--- a/include/asm-mips/serial.h
+++ b/include/asm-mips/serial.h
@@ -315,24 +315,6 @@
 #define MOMENCO_OCELOT_C_SERIAL_PORT_DEFNS
 #endif
 
-#ifdef CONFIG_TITAN_SERIAL
-/* 16552 20 MHz crystal */
-#define TITAN_SERIAL_BASE_BAUD	( 20000000 / 16 )
-#define	TITAN_SERIAL_IRQ	XXX
-#define	TITAN_SERIAL_BASE	0xffffffff
-
-#define	_TITAN_SERIAL_INIT(int, base)					\
-	{ baud_base: TITAN_SERIAL_BASE_BAUD, irq: int,			\
-	  flags: STD_COM_FLAGS,	iomem_base: (u8 *) base,		\
-	  iomem_reg_shift: 2, io_type: SERIAL_IO_MEM			\
-	}
-
-#define TITAN_SERIAL_PORT_DEFNS						\
-	_TITAN_SERIAL_INIT(TITAN_SERIAL_IRQ, TITAN_SERIAL_BASE)
-#else
-#define TITAN_SERIAL_PORT_DEFNS
-#endif
-
 #ifdef CONFIG_DDB5477
 #include <asm/ddb5xxx/ddb5477.h>
 #define DDB5477_SERIAL_PORT_DEFNS                                       \
@@ -371,7 +353,6 @@
 	MOMENCO_OCELOT_G_SERIAL_PORT_DEFNS		\
 	MOMENCO_OCELOT_C_SERIAL_PORT_DEFNS		\
 	MOMENCO_OCELOT_SERIAL_PORT_DEFNS		\
-	TITAN_SERIAL_PORT_DEFNS				\
 	TXX927_SERIAL_PORT_DEFNS                        \
 	AU1000_SERIAL_PORT_DEFNS
 
diff --git a/include/asm-mips/smp.h b/include/asm-mips/smp.h
index 4146d42d4..f0ef26b43 100644
--- a/include/asm-mips/smp.h
+++ b/include/asm-mips/smp.h
@@ -51,8 +51,6 @@ extern cpumask_t phys_cpu_present_map;
 extern cpumask_t cpu_online_map;
 #define cpu_possible_map	phys_cpu_present_map
 
-#define cpu_online(cpu)		cpu_isset(cpu, cpu_online_map)
-
 extern cpumask_t cpu_callout_map;
 /* We don't mark CPUs online until __cpu_up(), so we need another measure */
 static inline int num_booting_cpus(void)
@@ -90,12 +88,6 @@ extern void prom_init_secondary(void);
  */
 extern void prom_prepare_cpus(unsigned int max_cpus);
 
-/*
- * Do whatever setup needs to be done for SMP at the board level.  Return
- * the number of cpus in the system, including this one
- */
-extern int prom_setup_smp(void);
-
 /*
  * Last chance for the board code to finish SMP initialization before
  * the CPU is "online".
diff --git a/include/asm-mips/stackframe.h b/include/asm-mips/stackframe.h
index 626a8ab28..53a441c3c 100644
--- a/include/asm-mips/stackframe.h
+++ b/include/asm-mips/stackframe.h
@@ -302,6 +302,7 @@
 		or	t0, t1
 		xori	t0, 0x1f
 		mtc0	t0, CP0_STATUS
+		irq_disable_hazard
 		.endm
 
 /*
@@ -314,6 +315,7 @@
 		or	t0, t1
 		xori	t0, 0x1e
 		mtc0	t0, CP0_STATUS
+		irq_enable_hazard
 		.endm
 
 /*
@@ -326,6 +328,7 @@
 		or	t0, t1
 		xori	t0, 0x1e
 		mtc0	t0, CP0_STATUS
+		irq_disable_hazard
 		.endm
 
 #endif /* _ASM_STACKFRAME_H */
diff --git a/include/asm-mips/system.h b/include/asm-mips/system.h
index 9b7354b87..9bacd1197 100644
--- a/include/asm-mips/system.h
+++ b/include/asm-mips/system.h
@@ -19,6 +19,7 @@
 
 #include <asm/addrspace.h>
 #include <asm/ptrace.h>
+#include <asm/hazards.h>
 
 __asm__ (
 	".macro\tlocal_irq_enable\n\t"
@@ -29,6 +30,7 @@ __asm__ (
 	"ori\t$1,0x1f\n\t"
 	"xori\t$1,0x1e\n\t"
 	"mtc0\t$1,$12\n\t"
+	"irq_enable_hazard\n\t"
 	".set\tpop\n\t"
 	".endm");
 
@@ -57,9 +59,7 @@ __asm__ (
 	"xori\t$1,1\n\t"
 	".set\tnoreorder\n\t"
 	"mtc0\t$1,$12\n\t"
-	"sll\t$0, $0, 1\t\t\t# nop\n\t"
-	"sll\t$0, $0, 1\t\t\t# nop\n\t"
-	"sll\t$0, $0, 1\t\t\t# nop\n\t"
+	"irq_disable_hazard\n\t"
 	".set\tpop\n\t"
 	".endm");
 
@@ -80,7 +80,7 @@ __asm__ (
 	".set\tpop\n\t"
 	".endm");
 
-#define local_save_flags(x)							\
+#define local_save_flags(x)						\
 __asm__ __volatile__(							\
 	"local_save_flags %0"						\
 	: "=r" (x))
@@ -95,9 +95,7 @@ __asm__ (
 	"xori\t$1, 1\n\t"
 	".set\tnoreorder\n\t"
 	"mtc0\t$1, $12\n\t"
-	"sll\t$0, $0, 1\t\t\t# nop\n\t"
-	"sll\t$0, $0, 1\t\t\t# nop\n\t"
-	"sll\t$0, $0, 1\t\t\t# nop\n\t"
+	"irq_disable_hazard\n\t"
 	".set\tpop\n\t"
 	".endm");
 
@@ -108,7 +106,8 @@ __asm__ __volatile__(							\
 	: /* no inputs */						\
 	: "memory")
 
-__asm__(".macro\tlocal_irq_restore flags\n\t"
+__asm__ (
+	".macro\tlocal_irq_restore flags\n\t"
 	".set\tnoreorder\n\t"
 	".set\tnoat\n\t"
 	"mfc0\t$1, $12\n\t"
@@ -117,14 +116,12 @@ __asm__(".macro\tlocal_irq_restore flags\n\t"
 	"xori\t$1, 1\n\t"
 	"or\t\\flags, $1\n\t"
 	"mtc0\t\\flags, $12\n\t"
-	"sll\t$0, $0, 1\t\t\t# nop\n\t"
-	"sll\t$0, $0, 1\t\t\t# nop\n\t"
-	"sll\t$0, $0, 1\t\t\t# nop\n\t"
+	"irq_disable_hazard\n\t"
 	".set\tat\n\t"
 	".set\treorder\n\t"
 	".endm");
 
-#define local_irq_restore(flags)						\
+#define local_irq_restore(flags)					\
 do {									\
 	unsigned long __tmp1;						\
 									\
diff --git a/include/asm-mips/thread_info.h b/include/asm-mips/thread_info.h
index 117825203..508b32ad3 100644
--- a/include/asm-mips/thread_info.h
+++ b/include/asm-mips/thread_info.h
@@ -68,6 +68,9 @@ register struct thread_info *__current_thread_info __asm__("$28");
 #if defined(CONFIG_PAGE_SIZE_4KB) && defined(CONFIG_MIPS64)
 #define THREAD_SIZE_ORDER (2)
 #endif
+#ifdef CONFIG_PAGE_SIZE_8KB
+#define THREAD_SIZE_ORDER (1)
+#endif
 #ifdef CONFIG_PAGE_SIZE_16KB
 #define THREAD_SIZE_ORDER (0)
 #endif
diff --git a/include/asm-mips/titan_dep.h b/include/asm-mips/titan_dep.h
index e25423d39..d820445e8 100644
--- a/include/asm-mips/titan_dep.h
+++ b/include/asm-mips/titan_dep.h
@@ -16,9 +16,6 @@
 #include <asm/addrspace.h>              /* for KSEG1ADDR() */
 #include <asm/byteorder.h>              /* for cpu_to_le32() */
 
-/* Turn on serial */
-#define	CONFIG_TITAN_SERIAL
-
 /* PCI */
 #define	TITAN_PCI_BASE			0xbb000000
 
@@ -50,8 +47,181 @@
  */
 #define RM9000x2_HTLINK_REG     0xbb000644
 #define RM9000x2_BASE_ADDR      0xbb000000
-#define RM9000x2_OCD_HTCFGA     0x06f8
-#define RM9000x2_OCD_HTCFGD     0x06fc
+
+#define OCD_BASE                0xfb000000UL
+#define OCD_SIZE                0x3000UL
+
+extern unsigned long ocd_base;
+
+/*
+ * OCD Registers
+ */
+#define RM9000x2_OCD_LKB5		0x0128		/* Ethernet */
+#define RM9000x2_OCD_LKM5		0x012c
+
+#define RM9000x2_OCD_LKB7		0x0138		/* HT Region 0 */
+#define RM9000x2_OCD_LKM7		0x013c
+#define RM9000x2_OCD_LKB8		0x0140		/* HT Region 1 */
+#define RM9000x2_OCD_LKM8		0x0144
+
+#define RM9000x2_OCD_LKB9		0x0148		/* Local Bus */
+#define RM9000x2_OCD_LKM9		0x014c
+#define RM9000x2_OCD_LKB10		0x0150
+#define RM9000x2_OCD_LKM10		0x0154
+#define RM9000x2_OCD_LKB11		0x0158
+#define RM9000x2_OCD_LKM11		0x015c
+#define RM9000x2_OCD_LKB12		0x0160
+#define RM9000x2_OCD_LKM12		0x0164
+
+#define RM9000x2_OCD_LKB13		0x0168		/* Scratch RAM */
+#define RM9000x2_OCD_LKM13		0x016c
+
+#define RM9000x2_OCD_LPD0		0x0200		/* Local Bus */
+#define RM9000x2_OCD_LPD1		0x0210
+#define RM9000x2_OCD_LPD2		0x0220
+#define RM9000x2_OCD_LPD3		0x0230
+
+#define RM9000x2_OCD_HTDVID		0x0600	/* HT Device Header */
+#define RM9000x2_OCD_HTSC		0x0604
+#define RM9000x2_OCD_HTCCR		0x0608
+#define RM9000x2_OCD_HTBHL		0x060c
+#define RM9000x2_OCD_HTBAR0		0x0610
+#define RM9000x2_OCD_HTBAR1		0x0614
+#define RM9000x2_OCD_HTBAR2		0x0618
+#define RM9000x2_OCD_HTBAR3		0x061c
+#define RM9000x2_OCD_HTBAR4		0x0620
+#define RM9000x2_OCD_HTBAR5		0x0624
+#define RM9000x2_OCD_HTCBCPT		0x0628
+#define RM9000x2_OCD_HTSDVID		0x062c
+#define RM9000x2_OCD_HTXRA		0x0630
+#define RM9000x2_OCD_HTCAP1		0x0634
+#define RM9000x2_OCD_HTIL		0x063c
+
+#define RM9000x2_OCD_HTLCC		0x0640	/* HT Capability Block */
+#define RM9000x2_OCD_HTLINK		0x0644
+#define RM9000x2_OCD_HTFQREV		0x0648
+
+#define RM9000x2_OCD_HTERCTL		0x0668	/* HT Controller */
+#define RM9000x2_OCD_HTRXDB		0x066c
+#define RM9000x2_OCD_HTIMPED		0x0670
+#define RM9000x2_OCD_HTSWIMP		0x0674
+#define RM9000x2_OCD_HTCAL		0x0678
+
+#define RM9000x2_OCD_HTBAA30		0x0680
+#define RM9000x2_OCD_HTBAA54		0x0684
+#define RM9000x2_OCD_HTMASK0		0x0688
+#define RM9000x2_OCD_HTMASK1		0x068c
+#define RM9000x2_OCD_HTMASK2		0x0690
+#define RM9000x2_OCD_HTMASK3		0x0694
+#define RM9000x2_OCD_HTMASK4		0x0698
+#define RM9000x2_OCD_HTMASK5		0x069c
+
+#define RM9000x2_OCD_HTIFCTL		0x06a0
+#define RM9000x2_OCD_HTPLL		0x06a4
+
+#define RM9000x2_OCD_HTSRI		0x06b0
+#define RM9000x2_OCD_HTRXNUM		0x06b4
+#define RM9000x2_OCD_HTTXNUM		0x06b8
+
+#define RM9000x2_OCD_HTTXCNT		0x06c8
+
+#define RM9000x2_OCD_HTERROR		0x06d8
+#define RM9000x2_OCD_HTRCRCE		0x06dc
+#define RM9000x2_OCD_HTEOI		0x06e0
+
+#define RM9000x2_OCD_CRCR		0x06f0
+
+#define RM9000x2_OCD_HTCFGA		0x06f8
+#define RM9000x2_OCD_HTCFGD		0x06fc
+
+#define RM9000x2_OCD_INTMSG		0x0a00
+
+#define RM9000x2_OCD_INTPIN0		0x0a40
+#define RM9000x2_OCD_INTPIN1		0x0a44
+#define RM9000x2_OCD_INTPIN2		0x0a48
+#define RM9000x2_OCD_INTPIN3		0x0a4c
+#define RM9000x2_OCD_INTPIN4		0x0a50
+#define RM9000x2_OCD_INTPIN5		0x0a54
+#define RM9000x2_OCD_INTPIN6		0x0a58
+#define RM9000x2_OCD_INTPIN7		0x0a5c
+#define RM9000x2_OCD_SEM		0x0a60
+#define RM9000x2_OCD_SEMSET		0x0a64
+#define RM9000x2_OCD_SEMCLR		0x0a68
+
+#define RM9000x2_OCD_TKT		0x0a70
+#define RM9000x2_OCD_TKTINC		0x0a74
+
+#define RM9000x2_OCD_NMICONFIG		0x0ac0		/* Interrupts */
+#define RM9000x2_OCD_INTP0PRI		0x1a80
+#define RM9000x2_OCD_INTP1PRI		0x1a80
+#define RM9000x2_OCD_INTP0STATUS0	0x1b00
+#define RM9000x2_OCD_INTP0MASK0		0x1b04
+#define RM9000x2_OCD_INTP0SET0		0x1b08
+#define RM9000x2_OCD_INTP0CLEAR0	0x1b0c
+#define RM9000x2_OCD_INTP0STATUS1	0x1b10
+#define RM9000x2_OCD_INTP0MASK1		0x1b14
+#define RM9000x2_OCD_INTP0SET1		0x1b18
+#define RM9000x2_OCD_INTP0CLEAR1	0x1b1c
+#define RM9000x2_OCD_INTP0STATUS2	0x1b20
+#define RM9000x2_OCD_INTP0MASK2		0x1b24
+#define RM9000x2_OCD_INTP0SET2		0x1b28
+#define RM9000x2_OCD_INTP0CLEAR2	0x1b2c
+#define RM9000x2_OCD_INTP0STATUS3	0x1b30
+#define RM9000x2_OCD_INTP0MASK3		0x1b34
+#define RM9000x2_OCD_INTP0SET3		0x1b38
+#define RM9000x2_OCD_INTP0CLEAR3	0x1b3c
+#define RM9000x2_OCD_INTP0STATUS4	0x1b40
+#define RM9000x2_OCD_INTP0MASK4		0x1b44
+#define RM9000x2_OCD_INTP0SET4		0x1b48
+#define RM9000x2_OCD_INTP0CLEAR4	0x1b4c
+#define RM9000x2_OCD_INTP0STATUS5	0x1b50
+#define RM9000x2_OCD_INTP0MASK5		0x1b54
+#define RM9000x2_OCD_INTP0SET5		0x1b58
+#define RM9000x2_OCD_INTP0CLEAR5	0x1b5c
+#define RM9000x2_OCD_INTP0STATUS6	0x1b60
+#define RM9000x2_OCD_INTP0MASK6		0x1b64
+#define RM9000x2_OCD_INTP0SET6		0x1b68
+#define RM9000x2_OCD_INTP0CLEAR6	0x1b6c
+#define RM9000x2_OCD_INTP0STATUS7	0x1b70
+#define RM9000x2_OCD_INTP0MASK7		0x1b74
+#define RM9000x2_OCD_INTP0SET7		0x1b78
+#define RM9000x2_OCD_INTP0CLEAR7	0x1b7c
+#define RM9000x2_OCD_INTP1STATUS0	0x2b00
+#define RM9000x2_OCD_INTP1MASK0		0x2b04
+#define RM9000x2_OCD_INTP1SET0		0x2b08
+#define RM9000x2_OCD_INTP1CLEAR0	0x2b0c
+#define RM9000x2_OCD_INTP1STATUS1	0x2b10
+#define RM9000x2_OCD_INTP1MASK1		0x2b14
+#define RM9000x2_OCD_INTP1SET1		0x2b18
+#define RM9000x2_OCD_INTP1CLEAR1	0x2b1c
+#define RM9000x2_OCD_INTP1STATUS2	0x2b20
+#define RM9000x2_OCD_INTP1MASK2		0x2b24
+#define RM9000x2_OCD_INTP1SET2		0x2b28
+#define RM9000x2_OCD_INTP1CLEAR2	0x2b2c
+#define RM9000x2_OCD_INTP1STATUS3	0x2b30
+#define RM9000x2_OCD_INTP1MASK3		0x2b34
+#define RM9000x2_OCD_INTP1SET3		0x2b38
+#define RM9000x2_OCD_INTP1CLEAR3	0x2b3c
+#define RM9000x2_OCD_INTP1STATUS4	0x2b40
+#define RM9000x2_OCD_INTP1MASK4		0x2b44
+#define RM9000x2_OCD_INTP1SET4		0x2b48
+#define RM9000x2_OCD_INTP1CLEAR4	0x2b4c
+#define RM9000x2_OCD_INTP1STATUS5	0x2b50
+#define RM9000x2_OCD_INTP1MASK5		0x2b54
+#define RM9000x2_OCD_INTP1SET5		0x2b58
+#define RM9000x2_OCD_INTP1CLEAR5	0x2b5c
+#define RM9000x2_OCD_INTP1STATUS6	0x2b60
+#define RM9000x2_OCD_INTP1MASK6		0x2b64
+#define RM9000x2_OCD_INTP1SET6		0x2b68
+#define RM9000x2_OCD_INTP1CLEAR6	0x2b6c
+#define RM9000x2_OCD_INTP1STATUS7	0x2b70
+#define RM9000x2_OCD_INTP1MASK7		0x2b74
+#define RM9000x2_OCD_INTP1SET7		0x2b78
+#define RM9000x2_OCD_INTP1CLEAR7	0x2b7c
+
+#define OCD_READ(reg)		(*(volatile unsigned int *)(ocd_base + (reg)))
+#define OCD_WRITE(reg, val)					\
+	do { *(volatile unsigned int *)(ocd_base + (reg)) = (val); } while (0)
 
 /*
  * Hypertransport specific macros
@@ -65,4 +235,3 @@
 #define RM9K_READ_16(ofs, val)  *(val) = *(volatile u16 *)(RM9000x2_BASE_ADDR+ofs)
 
 #endif 
-
diff --git a/include/asm-mips/unistd.h b/include/asm-mips/unistd.h
index 36f8b1a4e..7c5a30028 100644
--- a/include/asm-mips/unistd.h
+++ b/include/asm-mips/unistd.h
@@ -297,7 +297,6 @@
 #define __NR_mq_timedreceive		(__NR_Linux + 274)
 #define __NR_mq_notify			(__NR_Linux + 275)
 #define __NR_mq_getsetattr		(__NR_Linux + 276)
-
 #define __NR_vserver			(__NR_Linux + 277)
 
 /*
@@ -308,7 +307,7 @@
 #endif /* _MIPS_SIM == _MIPS_SIM_ABI32 */
 
 #define __NR_O32_Linux			4000
-#define __NR_O32_Linux_syscalls		276
+#define __NR_O32_Linux_syscalls		277
 
 #if _MIPS_SIM == _MIPS_SIM_ABI64
 
@@ -552,16 +551,17 @@
 #define __NR_mq_timedreceive		(__NR_Linux + 233)
 #define __NR_mq_notify			(__NR_Linux + 234)
 #define __NR_mq_getsetattr		(__NR_Linux + 235)
+#define __NR_vserver			(__NR_Linux + 236)
 
 /*
  * Offset of the last Linux flavoured syscall
  */
-#define __NR_Linux_syscalls		235
+#define __NR_Linux_syscalls		236
 
 #endif /* _MIPS_SIM == _MIPS_SIM_ABI64 */
 
 #define __NR_64_Linux			5000
-#define __NR_64_Linux_syscalls		235
+#define __NR_64_Linux_syscalls		236
 
 #if _MIPS_SIM == _MIPS_SIM_NABI32
 
@@ -809,16 +809,17 @@
 #define __NR_mq_timedreceive		(__NR_Linux + 237)
 #define __NR_mq_notify			(__NR_Linux + 238)
 #define __NR_mq_getsetattr		(__NR_Linux + 239)
+#define __NR_vserver			(__NR_Linux + 240)
 
 /*
  * Offset of the last N32 flavoured syscall
  */
-#define __NR_Linux_syscalls		239
+#define __NR_Linux_syscalls		240
 
 #endif /* _MIPS_SIM == _MIPS_SIM_NABI32 */
 
 #define __NR_N32_Linux			6000
-#define __NR_N32_Linux_syscalls		239
+#define __NR_N32_Linux_syscalls		240
 
 #ifndef __ASSEMBLY__
 
diff --git a/include/asm-mips/vr41xx/capcella.h b/include/asm-mips/vr41xx/capcella.h
index 82d9db6cb..5b55083c5 100644
--- a/include/asm-mips/vr41xx/capcella.h
+++ b/include/asm-mips/vr41xx/capcella.h
@@ -1,53 +1,27 @@
 /*
- * FILE NAME
- *	include/asm-mips/vr41xx/capcella.h
+ *  capcella.h, Include file for ZAO Networks Capcella.
  *
- * BRIEF MODULE DESCRIPTION
- *	Include file for ZAO Networks Capcella.
+ *  Copyright (C) 2002-2004  Yoichi Yuasa <yuasa@hh.iij4u.or.jp>
  *
- * Copyright 2002,2003 Yoichi Yuasa
- *                yuasa@hh.iij4u.or.jp
+ *  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 free software; you can redistribute it and/or modify it
- *  under the terms of the GNU General Public License as published by the
- *  Free Software Foundation; either version 2 of the License, or (at your
- *  option) any later version.
+ *  This program is distributed in the hope that it will be useful,
+ *  but WITHOUT ANY WARRANTY; without even the implied warranty of
+ *  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ *  GNU General Public License for more details.
+ *
+ *  You should have received a copy of the GNU General Public License
+ *  along with this program; if not, write to the Free Software
+ *  Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA
  */
 #ifndef __ZAO_CAPCELLA_H
 #define __ZAO_CAPCELLA_H
 
-#include <asm/addrspace.h>
 #include <asm/vr41xx/vr41xx.h>
 
-/*
- * Board specific address mapping
- */
-#define VR41XX_PCI_MEM1_BASE		0x10000000
-#define VR41XX_PCI_MEM1_SIZE		0x04000000
-#define VR41XX_PCI_MEM1_MASK		0x7c000000
-
-#define VR41XX_PCI_MEM2_BASE		0x14000000
-#define VR41XX_PCI_MEM2_SIZE		0x02000000
-#define VR41XX_PCI_MEM2_MASK		0x7e000000
-
-#define VR41XX_PCI_IO_BASE		0x16000000
-#define VR41XX_PCI_IO_SIZE		0x02000000
-#define VR41XX_PCI_IO_MASK		0x7e000000
-
-#define VR41XX_PCI_IO_START		0x01000000
-#define VR41XX_PCI_IO_END		0x01ffffff
-
-#define VR41XX_PCI_MEM_START		0x12000000
-#define VR41XX_PCI_MEM_END		0x15ffffff
-
-#define IO_PORT_BASE			KSEG1ADDR(VR41XX_PCI_IO_BASE)
-#define IO_PORT_RESOURCE_START		0
-#define IO_PORT_RESOURCE_END		VR41XX_PCI_IO_SIZE
-#define IO_MEM1_RESOURCE_START		VR41XX_PCI_MEM1_BASE
-#define IO_MEM1_RESOURCE_END		(VR41XX_PCI_MEM1_BASE + VR41XX_PCI_MEM1_SIZE)
-#define IO_MEM2_RESOURCE_START		VR41XX_PCI_MEM2_BASE
-#define IO_MEM2_RESOURCE_END		(VR41XX_PCI_MEM2_BASE + VR41XX_PCI_MEM2_SIZE)
-
 /*
  * General-Purpose I/O Pin Number
  */
diff --git a/include/asm-mips/vr41xx/mpc30x.h b/include/asm-mips/vr41xx/mpc30x.h
index bff9f0aaf..e6ac3c8e8 100644
--- a/include/asm-mips/vr41xx/mpc30x.h
+++ b/include/asm-mips/vr41xx/mpc30x.h
@@ -1,53 +1,27 @@
 /*
- * FILE NAME
- *	include/asm-mips/vr41xx/mpc30x.h
+ *  mpc30x.h, Include file for Victor MP-C303/304.
  *
- * BRIEF MODULE DESCRIPTION
- *	Include file for Victor MP-C303/304.
+ *  Copyright (C) 2002-2004  Yoichi Yuasa <yuasa@hh.iij4u.or.jp>
  *
- * Copyright 2002,2003 Yoichi Yuasa
- *                yuasa@hh.iij4u.or.jp
+ *  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 free software; you can redistribute it and/or modify it
- *  under the terms of the GNU General Public License as published by the
- *  Free Software Foundation; either version 2 of the License, or (at your
- *  option) any later version.
+ *  This program is distributed in the hope that it will be useful,
+ *  but WITHOUT ANY WARRANTY; without even the implied warranty of
+ *  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ *  GNU General Public License for more details.
+ *
+ *  You should have received a copy of the GNU General Public License
+ *  along with this program; if not, write to the Free Software
+ *  Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA
  */
 #ifndef __VICTOR_MPC30X_H
 #define __VICTOR_MPC30X_H
 
-#include <asm/addrspace.h>
 #include <asm/vr41xx/vr41xx.h>
 
-/*
- * Board specific address mapping
- */
-#define VR41XX_PCI_MEM1_BASE		0x10000000
-#define VR41XX_PCI_MEM1_SIZE		0x04000000
-#define VR41XX_PCI_MEM1_MASK		0x7c000000
-
-#define VR41XX_PCI_MEM2_BASE		0x14000000
-#define VR41XX_PCI_MEM2_SIZE		0x02000000
-#define VR41XX_PCI_MEM2_MASK		0x7e000000
-
-#define VR41XX_PCI_IO_BASE		0x16000000
-#define VR41XX_PCI_IO_SIZE		0x02000000
-#define VR41XX_PCI_IO_MASK		0x7e000000
-
-#define VR41XX_PCI_IO_START		0x01000000
-#define VR41XX_PCI_IO_END		0x01ffffff
-
-#define VR41XX_PCI_MEM_START		0x12000000
-#define VR41XX_PCI_MEM_END		0x15ffffff
-
-#define IO_PORT_BASE			KSEG1ADDR(VR41XX_PCI_IO_BASE)
-#define IO_PORT_RESOURCE_START		0
-#define IO_PORT_RESOURCE_END		VR41XX_PCI_IO_SIZE
-#define IO_MEM1_RESOURCE_START		VR41XX_PCI_MEM1_BASE
-#define IO_MEM1_RESOURCE_END		(VR41XX_PCI_MEM1_BASE + VR41XX_PCI_MEM1_SIZE)
-#define IO_MEM2_RESOURCE_START		VR41XX_PCI_MEM2_BASE
-#define IO_MEM2_RESOURCE_END		(VR41XX_PCI_MEM2_BASE + VR41XX_PCI_MEM2_SIZE)
-
 /*
  * General-Purpose I/O Pin Number
  */
diff --git a/include/asm-mips/vr41xx/tb0226.h b/include/asm-mips/vr41xx/tb0226.h
index 97ca8898b..0ff9a60ec 100644
--- a/include/asm-mips/vr41xx/tb0226.h
+++ b/include/asm-mips/vr41xx/tb0226.h
@@ -1,53 +1,27 @@
 /*
- * FILE NAME
- *	include/asm-mips/vr41xx/tb0226.h
+ *  tb0226.h, Include file for TANBAC TB0226.
  *
- * BRIEF MODULE DESCRIPTION
- *	Include file for TANBAC TB0226.
+ *  Copyright (C) 2002-2004  Yoichi Yuasa <yuasa@hh.iij4u.or.jp>
  *
- * Copyright 2002,2003 Yoichi Yuasa
- *                yuasa@hh.iij4u.or.jp
+ *  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 free software; you can redistribute it and/or modify it
- *  under the terms of the GNU General Public License as published by the
- *  Free Software Foundation; either version 2 of the License, or (at your
- *  option) any later version.
+ *  This program is distributed in the hope that it will be useful,
+ *  but WITHOUT ANY WARRANTY; without even the implied warranty of
+ *  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ *  GNU General Public License for more details.
+ *
+ *  You should have received a copy of the GNU General Public License
+ *  along with this program; if not, write to the Free Software
+ *  Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA
  */
 #ifndef __TANBAC_TB0226_H
 #define __TANBAC_TB0226_H
 
-#include <asm/addrspace.h>
 #include <asm/vr41xx/vr41xx.h>
 
-/*
- * Board specific address mapping
- */
-#define VR41XX_PCI_MEM1_BASE		0x10000000
-#define VR41XX_PCI_MEM1_SIZE		0x04000000
-#define VR41XX_PCI_MEM1_MASK		0x7c000000
-
-#define VR41XX_PCI_MEM2_BASE		0x14000000
-#define VR41XX_PCI_MEM2_SIZE		0x02000000
-#define VR41XX_PCI_MEM2_MASK		0x7e000000
-
-#define VR41XX_PCI_IO_BASE		0x16000000
-#define VR41XX_PCI_IO_SIZE		0x02000000
-#define VR41XX_PCI_IO_MASK		0x7e000000
-
-#define VR41XX_PCI_IO_START		0x01000000
-#define VR41XX_PCI_IO_END		0x01ffffff
-
-#define VR41XX_PCI_MEM_START		0x12000000
-#define VR41XX_PCI_MEM_END		0x15ffffff
-
-#define IO_PORT_BASE			KSEG1ADDR(VR41XX_PCI_IO_BASE)
-#define IO_PORT_RESOURCE_START		0
-#define IO_PORT_RESOURCE_END		VR41XX_PCI_IO_SIZE
-#define IO_MEM1_RESOURCE_START		VR41XX_PCI_MEM1_BASE
-#define IO_MEM1_RESOURCE_END		(VR41XX_PCI_MEM1_BASE + VR41XX_PCI_MEM1_SIZE)
-#define IO_MEM2_RESOURCE_START		VR41XX_PCI_MEM2_BASE
-#define IO_MEM2_RESOURCE_END		(VR41XX_PCI_MEM2_BASE + VR41XX_PCI_MEM2_SIZE)
-
 /*
  * General-Purpose I/O Pin Number
  */
diff --git a/include/asm-mips/vr41xx/vr41xx.h b/include/asm-mips/vr41xx/vr41xx.h
index 53fe1162a..c57c8dca6 100644
--- a/include/asm-mips/vr41xx/vr41xx.h
+++ b/include/asm-mips/vr41xx/vr41xx.h
@@ -42,12 +42,6 @@
 /* VR4133 0x00000c84- */
 #define PRID_VR4133		0x00000c84
 
-/*
- * Memory resource
- */
-#define IO_MEM_RESOURCE_START	0UL
-#define IO_MEM_RESOURCE_END	0x1fffffffUL
-
 /*
  * Bus Control Uint
  */
@@ -136,8 +130,71 @@ extern void vr41xx_mask_clock(vr41xx_clock_t clock);
 extern int vr41xx_set_intassign(unsigned int irq, unsigned char intassign);
 extern int vr41xx_cascade_irq(unsigned int irq, int (*get_irq_number)(int irq));
 
-extern void vr41xx_enable_dsiuint(void);
-extern void vr41xx_disable_dsiuint(void);
+#define PIUINT_COMMAND		0x0040
+#define PIUINT_DATA		0x0020
+#define PIUINT_PAGE1		0x0010
+#define PIUINT_PAGE0		0x0008
+#define PIUINT_DATALOST		0x0004
+#define PIUINT_STATUSCHANGE	0x0001
+
+extern void vr41xx_enable_piuint(uint16_t mask);
+extern void vr41xx_disable_piuint(uint16_t mask);
+
+#define AIUINT_INPUT_DMAEND	0x0800
+#define AIUINT_INPUT_DMAHALT	0x0400
+#define AIUINT_INPUT_DATALOST	0x0200
+#define AIUINT_INPUT_DATA	0x0100
+#define AIUINT_OUTPUT_DMAEND	0x0008
+#define AIUINT_OUTPUT_DMAHALT	0x0004
+#define AIUINT_OUTPUT_NODATA	0x0002
+
+extern void vr41xx_enable_aiuint(uint16_t mask);
+extern void vr41xx_disable_aiuint(uint16_t mask);
+
+#define KIUINT_DATALOST		0x0004
+#define KIUINT_DATAREADY	0x0002
+#define KIUINT_SCAN		0x0001
+
+extern void vr41xx_enable_kiuint(uint16_t mask);
+extern void vr41xx_disable_kiuint(uint16_t mask);
+
+#define DSIUINT_CTS		0x0800
+#define DSIUINT_RXERR		0x0400
+#define DSIUINT_RX		0x0200
+#define DSIUINT_TX		0x0100
+#define DSIUINT_ALL		0x0f00
+
+extern void vr41xx_enable_dsiuint(uint16_t mask);
+extern void vr41xx_disable_dsiuint(uint16_t mask);
+
+#define FIRINT_UNIT		0x0010
+#define FIRINT_RX_DMAEND	0x0008
+#define FIRINT_RX_DMAHALT	0x0004
+#define FIRINT_TX_DMAEND	0x0002
+#define FIRINT_TX_DMAHALT	0x0001
+
+extern void vr41xx_enable_firint(uint16_t mask);
+extern void vr41xx_disable_firint(uint16_t mask);
+
+extern void vr41xx_enable_pciint(void);
+extern void vr41xx_disable_pciint(void);
+
+extern void vr41xx_enable_scuint(void);
+extern void vr41xx_disable_scuint(void);
+
+#define CSIINT_TX_DMAEND	0x0040
+#define CSIINT_TX_DMAHALT	0x0020
+#define CSIINT_TX_DATA		0x0010
+#define CSIINT_TX_FIFOEMPTY	0x0008
+#define CSIINT_RX_DMAEND	0x0004
+#define CSIINT_RX_DMAHALT	0x0002
+#define CSIINT_RX_FIFOEMPTY	0x0001
+
+extern void vr41xx_enable_csiint(uint16_t mask);
+extern void vr41xx_disable_csiint(uint16_t mask);
+
+extern void vr41xx_enable_bcuint(void);
+extern void vr41xx_disable_bcuint(void);
 
 /*
  * Power Management Unit
@@ -220,18 +277,71 @@ extern void vr41xx_dsiu_init(void);
 /*
  * PCI Control Unit
  */
-struct vr41xx_pci_address_space {
-	u32 internal_base;
-	u32 address_mask;
-	u32 pci_base;
+#define PCI_MASTER_ADDRESS_MASK	0x7fffffffU
+
+struct pci_master_address_conversion {
+	uint32_t bus_base_address;
+	uint32_t address_mask;
+	uint32_t pci_base_address;
+};
+
+struct pci_target_address_conversion {
+	uint32_t address_mask;
+	uint32_t bus_base_address;
+};
+
+typedef enum {
+	CANNOT_LOCK_FROM_DEVICE,
+	CAN_LOCK_FROM_DEVICE,
+} pci_exclusive_access_t;
+
+struct pci_mailbox_address {
+	uint32_t base_address;
 };
 
-struct vr41xx_pci_address_map {
-	struct vr41xx_pci_address_space *mem1;
-	struct vr41xx_pci_address_space *mem2;
-	struct vr41xx_pci_address_space *io;
+struct pci_target_address_window {
+	uint32_t base_address;
+};
+
+typedef enum {
+	PCI_ARBITRATION_MODE_FAIR,
+	PCI_ARBITRATION_MODE_ALTERNATE_0,
+	PCI_ARBITRATION_MODE_ALTERNATE_B,
+} pci_arbiter_priority_control_t;
+
+typedef enum {
+	PCI_TAKE_AWAY_GNT_DISABLE,
+	PCI_TAKE_AWAY_GNT_ENABLE,
+} pci_take_away_gnt_mode_t;
+
+struct pci_controller_unit_setup {
+	struct pci_master_address_conversion *master_memory1;
+	struct pci_master_address_conversion *master_memory2;
+
+	struct pci_target_address_conversion *target_memory1;
+	struct pci_target_address_conversion *target_memory2;
+
+	struct pci_master_address_conversion *master_io;
+
+	pci_exclusive_access_t exclusive_access;
+
+	uint32_t pci_clock_max;
+	uint8_t wait_time_limit_from_irdy_to_trdy;	/* Only VR4122 is supported */
+
+	struct pci_mailbox_address *mailbox;
+	struct pci_target_address_window *target_window1;
+	struct pci_target_address_window *target_window2;
+
+	uint8_t master_latency_timer;
+	uint8_t retry_limit;
+
+	pci_arbiter_priority_control_t arbiter_priority_control;
+	pci_take_away_gnt_mode_t take_away_gnt_mode;
+
+	struct resource *mem_resource;
+	struct resource *io_resource;
 };
 
-extern void vr41xx_pciu_init(struct vr41xx_pci_address_map *map);
+extern void vr41xx_pciu_setup(struct pci_controller_unit_setup *setup);
 
 #endif /* __NEC_VR41XX_H */
diff --git a/include/asm-mips/vr41xx/vrc4173.h b/include/asm-mips/vr41xx/vrc4173.h
index a8e873c06..b14ef0377 100644
--- a/include/asm-mips/vr41xx/vrc4173.h
+++ b/include/asm-mips/vr41xx/vrc4173.h
@@ -1,19 +1,24 @@
 /*
- * FILE NAME
- *	include/asm-mips/vr41xx/vrc4173.h
+ *  vrc4173.h, Include file for NEC VRC4173.
  *
- * BRIEF MODULE DESCRIPTION
- *	Include file for NEC VRC4173.
+ *  Copyright (C) 2000  Michael R. McDonald
+ *  Copyright (C) 2001-2003 Montavista Software Inc.
+ *    Author: Yoichi Yuasa <yyuasa@mvista.com, or source@mvista.com>
+ *  Copyright (C) 2004  Yoichi Yuasa <yuasa@hh.iij4u.or.jp>
  *
- * This file is subject to the terms and conditions of the GNU General Public
- * License.  See the file "COPYING" in the main directory of this archive
- * for more details.
+ *  This 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) 2000 by Michael R. McDonald
+ *  This program is distributed in the hope that it will be useful,
+ *  but WITHOUT ANY WARRANTY; without even the implied warranty of
+ *  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ *  GNU General Public License for more details.
  *
- * Copyright 2001-2003 Montavista Software Inc.
- * Author: Yoichi Yuasa
- *         yyuasa@mvista.com or source@mvista.com
+ *  You should have received a copy of the GNU General Public License
+ *  along with this program; if not, write to the Free Software
+ *  Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA
  */
 #ifndef __NEC_VRC4173_H 
 #define __NEC_VRC4173_H 
@@ -72,35 +77,38 @@ extern unsigned long vrc4173_io_offset;
 /*
  * Clock Mask Unit
  */
-#define VRC4173_PIU_CLOCK		0x0001
-#define VRC4173_KIU_CLOCK		0x0002
-#define VRC4173_AIU_CLOCK		0x0004
-#define VRC4173_PS2CH1_CLOCK		0x0008
-#define VRC4173_PS2CH2_CLOCK		0x0010
-#define VRC4173_USBU_PCI_CLOCK		0x0020
-#define VRC4173_CARDU1_PCI_CLOCK	0x0040
-#define VRC4173_CARDU2_PCI_CLOCK	0x0080
-#define VRC4173_AC97U_PCI_CLOCK		0x0100
-#define VRC4173_USBU_48MHz_CLOCK	0x0400
-#define VRC4173_EXT_48MHz_CLOCK		0x0800
-#define VRC4173_48MHz_CLOCK		0x1000
+typedef enum vrc4173_clock {
+	VRC4173_PIU_CLOCK,
+	VRC4173_KIU_CLOCK,
+	VRC4173_AIU_CLOCK,
+	VRC4173_PS2_CH1_CLOCK,
+	VRC4173_PS2_CH2_CLOCK,
+	VRC4173_USBU_PCI_CLOCK,
+	VRC4173_CARDU1_PCI_CLOCK,
+	VRC4173_CARDU2_PCI_CLOCK,
+	VRC4173_AC97U_PCI_CLOCK,
+	VRC4173_USBU_48MHz_CLOCK,
+	VRC4173_EXT_48MHz_CLOCK,
+	VRC4173_48MHz_CLOCK,
+} vrc4173_clock_t;
 
-extern void vrc4173_clock_supply(u16 mask);
-extern void vrc4173_clock_mask(u16 mask);
+extern void vrc4173_supply_clock(vrc4173_clock_t clock);
+extern void vrc4173_mask_clock(vrc4173_clock_t clock);
 
 /*
  * General-Purpose I/O Unit
  */
-enum {
-	PS2CH1_SELECT,
-	PS2CH2_SELECT,
-	TOUCHPANEL_SELECT,
-	KIU8_SELECT,
-	KIU10_SELECT,
-	KIU12_SELECT,
-	GPIO_SELECT
-};
+typedef enum vrc4173_function {
+	PS2_CHANNEL1,
+	PS2_CHANNEL2,
+	TOUCHPANEL,
+	KEYBOARD_8SCANLINES,
+	KEYBOARD_10SCANLINES,
+	KEYBOARD_12SCANLINES,
+	GPIO_0_15PINS,
+	GPIO_16_20PINS,
+} vrc4173_function_t;
 
-extern void vrc4173_select_function(int func);
+extern void vrc4173_select_function(vrc4173_function_t function);
 
 #endif /* __NEC_VRC4173_H */
diff --git a/include/asm-parisc/assembly.h b/include/asm-parisc/assembly.h
index b421d4b8d..5ba8c5cd4 100644
--- a/include/asm-parisc/assembly.h
+++ b/include/asm-parisc/assembly.h
@@ -24,6 +24,7 @@
 #ifdef __LP64__
 #define LDREG	ldd
 #define STREG	std
+#define LDREGX  ldd,s
 #define LDREGM	ldd,mb
 #define STREGM	std,ma
 #define RP_OFFSET	16
@@ -31,12 +32,19 @@
 #else
 #define LDREG	ldw
 #define STREG	stw
+#define LDREGX  ldwx,s
 #define LDREGM	ldwm
 #define STREGM	stwm
 #define RP_OFFSET	20
 #define FRAME_SIZE	64
 #endif
 
+#ifdef CONFIG_PA20
+#define BL		b,l
+#else
+#define BL		bl
+#endif
+
 #ifdef __ASSEMBLY__
 
 #ifdef __LP64__
@@ -110,6 +118,16 @@
 	depd,z	\r, 63-\sa, 64-\sa, \t
 	.endm
 
+	/* Shift Right - note the r and t can NOT be the same! */
+	.macro shr r, sa, t
+	extru \r, 31-\sa, 32-\sa, \t
+	.endm
+
+	/* pa20w version of shift right */
+	.macro shrd r, sa, t
+	extrd,u \r, 63-\sa, 64-\sa, \t
+	.endm
+
 	/* load 32-bit 'value' into 'reg' compensating for the ldil
 	 * sign-extension when running in wide mode.
 	 * WARNING!! neither 'value' nor 'reg' can be expressions
diff --git a/include/asm-parisc/bitops.h b/include/asm-parisc/bitops.h
index caa317328..914f70ce0 100644
--- a/include/asm-parisc/bitops.h
+++ b/include/asm-parisc/bitops.h
@@ -30,7 +30,7 @@
 #define smp_mb__before_clear_bit()      smp_mb()
 #define smp_mb__after_clear_bit()       smp_mb()
 
-static __inline__ void set_bit(int nr, void * address)
+static __inline__ void set_bit(int nr, volatile unsigned long * address)
 {
 	unsigned long mask;
 	unsigned long *addr = (unsigned long *) address;
@@ -43,7 +43,7 @@ static __inline__ void set_bit(int nr, void * address)
 	atomic_spin_unlock_irqrestore(ATOMIC_HASH(addr), flags);
 }
 
-static __inline__ void __set_bit(int nr, void * address)
+static __inline__ void __set_bit(int nr, volatile unsigned long * address)
 {
 	unsigned long mask;
 	unsigned long *addr = (unsigned long *) address;
@@ -53,7 +53,7 @@ static __inline__ void __set_bit(int nr, void * address)
 	*addr |= mask;
 }
 
-static __inline__ void clear_bit(int nr, void * address)
+static __inline__ void clear_bit(int nr, volatile unsigned long * address)
 {
 	unsigned long mask;
 	unsigned long *addr = (unsigned long *) address;
@@ -66,7 +66,7 @@ static __inline__ void clear_bit(int nr, void * address)
 	atomic_spin_unlock_irqrestore(ATOMIC_HASH(addr), flags);
 }
 
-static __inline__ void __clear_bit(unsigned long nr, volatile void * address)
+static __inline__ void __clear_bit(unsigned long nr, volatile unsigned long * address)
 {
 	unsigned long mask;
 	unsigned long *addr = (unsigned long *) address;
@@ -76,7 +76,7 @@ static __inline__ void __clear_bit(unsigned long nr, volatile void * address)
 	*addr &= ~mask;
 }
 
-static __inline__ void change_bit(int nr, void * address)
+static __inline__ void change_bit(int nr, volatile unsigned long * address)
 {
 	unsigned long mask;
 	unsigned long *addr = (unsigned long *) address;
@@ -89,7 +89,7 @@ static __inline__ void change_bit(int nr, void * address)
 	atomic_spin_unlock_irqrestore(ATOMIC_HASH(addr), flags);
 }
 
-static __inline__ void __change_bit(int nr, void * address)
+static __inline__ void __change_bit(int nr, volatile unsigned long * address)
 {
 	unsigned long mask;
 	unsigned long *addr = (unsigned long *) address;
@@ -99,7 +99,7 @@ static __inline__ void __change_bit(int nr, void * address)
 	*addr ^= mask;
 }
 
-static __inline__ int test_and_set_bit(int nr, void * address)
+static __inline__ int test_and_set_bit(int nr, volatile unsigned long * address)
 {
 	unsigned long mask;
 	unsigned long *addr = (unsigned long *) address;
@@ -116,7 +116,7 @@ static __inline__ int test_and_set_bit(int nr, void * address)
 	return oldbit;
 }
 
-static __inline__ int __test_and_set_bit(int nr, void * address)
+static __inline__ int __test_and_set_bit(int nr, volatile unsigned long * address)
 {
 	unsigned long mask;
 	unsigned long *addr = (unsigned long *) address;
@@ -130,7 +130,7 @@ static __inline__ int __test_and_set_bit(int nr, void * address)
 	return oldbit;
 }
 
-static __inline__ int test_and_clear_bit(int nr, void * address)
+static __inline__ int test_and_clear_bit(int nr, volatile unsigned long * address)
 {
 	unsigned long mask;
 	unsigned long *addr = (unsigned long *) address;
@@ -147,7 +147,7 @@ static __inline__ int test_and_clear_bit(int nr, void * address)
 	return oldbit;
 }
 
-static __inline__ int __test_and_clear_bit(int nr, void * address)
+static __inline__ int __test_and_clear_bit(int nr, volatile unsigned long * address)
 {
 	unsigned long mask;
 	unsigned long *addr = (unsigned long *) address;
@@ -161,7 +161,7 @@ static __inline__ int __test_and_clear_bit(int nr, void * address)
 	return oldbit;
 }
 
-static __inline__ int test_and_change_bit(int nr, void * address)
+static __inline__ int test_and_change_bit(int nr, volatile unsigned long * address)
 {
 	unsigned long mask;
 	unsigned long *addr = (unsigned long *) address;
@@ -178,7 +178,7 @@ static __inline__ int test_and_change_bit(int nr, void * address)
 	return oldbit;
 }
 
-static __inline__ int __test_and_change_bit(int nr, void * address)
+static __inline__ int __test_and_change_bit(int nr, volatile unsigned long * address)
 {
 	unsigned long mask;
 	unsigned long *addr = (unsigned long *) address;
@@ -192,10 +192,10 @@ static __inline__ int __test_and_change_bit(int nr, void * address)
 	return oldbit;
 }
 
-static __inline__ int test_bit(int nr, const void *address)
+static __inline__ int test_bit(int nr, const volatile unsigned long *address)
 {
 	unsigned long mask;
-	unsigned long *addr = (unsigned long *) address;
+	const unsigned long *addr = (const unsigned long *)address;
 	
 	addr += (nr >> SHIFT_PER_LONG);
 	mask = 1L << CHOP_SHIFTCOUNT(nr);
@@ -322,7 +322,7 @@ static __inline__ int fls(int x)
  * unlikely to be set. It's guaranteed that at least one of the 140
  * bits is cleared.
  */
-static inline int sched_find_first_bit(unsigned long *b)
+static inline int sched_find_first_bit(const unsigned long *b)
 {
 #ifndef __LP64__
 	if (unlikely(b[0]))
@@ -354,9 +354,9 @@ static inline int sched_find_first_bit(unsigned long *b)
 #define find_first_zero_bit(addr, size) \
 	find_next_zero_bit((addr), (size), 0)
 
-static __inline__ unsigned long find_next_zero_bit(void * addr, unsigned long size, unsigned long offset)
+static __inline__ unsigned long find_next_zero_bit(const void * addr, unsigned long size, unsigned long offset)
 {
-	unsigned long * p = ((unsigned long *) addr) + (offset >> SHIFT_PER_LONG);
+	const unsigned long * p = ((unsigned long *) addr) + (offset >> SHIFT_PER_LONG);
 	unsigned long result = offset & ~(BITS_PER_LONG-1);
 	unsigned long tmp;
 
@@ -389,9 +389,9 @@ found_middle:
 	return result + ffz(tmp);
 }
 
-static __inline__ unsigned long find_next_bit(unsigned long *addr, unsigned long size, unsigned long offset)
+static __inline__ unsigned long find_next_bit(const unsigned long *addr, unsigned long size, unsigned long offset)
 {
-	unsigned long *p = addr + (offset >> 6);
+	const unsigned long *p = addr + (offset >> 6);
 	unsigned long result = offset & ~(BITS_PER_LONG-1);
 	unsigned long tmp;
 
@@ -446,15 +446,15 @@ found_middle:
  * disabling interrupts.
  */
 #ifdef __LP64__
-#define ext2_set_bit(nr, addr)		test_and_set_bit((nr) ^ 0x38, addr)
-#define ext2_set_bit_atomic(l,nr,addr)  test_and_set_bit((nr) ^ 0x38, addr)
-#define ext2_clear_bit(nr, addr)	test_and_clear_bit((nr) ^ 0x38, addr)
-#define ext2_clear_bit_atomic(l,nr,addr) test_and_clear_bit((nr) ^ 0x38, addr)
+#define ext2_set_bit(nr, addr)		test_and_set_bit((nr) ^ 0x38, (unsigned long *)addr)
+#define ext2_set_bit_atomic(l,nr,addr)  test_and_set_bit((nr) ^ 0x38, (unsigned long *)addr)
+#define ext2_clear_bit(nr, addr)	test_and_clear_bit((nr) ^ 0x38, (unsigned long *)addr)
+#define ext2_clear_bit_atomic(l,nr,addr) test_and_clear_bit((nr) ^ 0x38, (unsigned long *)addr)
 #else
-#define ext2_set_bit(nr, addr)		test_and_set_bit((nr) ^ 0x18, addr)
-#define ext2_set_bit_atomic(l,nr,addr)  test_and_set_bit((nr) ^ 0x18, addr)
-#define ext2_clear_bit(nr, addr)	test_and_clear_bit((nr) ^ 0x18, addr)
-#define ext2_clear_bit_atomic(l,nr,addr) test_and_clear_bit((nr) ^ 0x18, addr)
+#define ext2_set_bit(nr, addr)		test_and_set_bit((nr) ^ 0x18, (unsigned long *)addr)
+#define ext2_set_bit_atomic(l,nr,addr)  test_and_set_bit((nr) ^ 0x18, (unsigned long *)addr)
+#define ext2_clear_bit(nr, addr)	test_and_clear_bit((nr) ^ 0x18, (unsigned long *)addr)
+#define ext2_clear_bit_atomic(l,nr,addr) test_and_clear_bit((nr) ^ 0x18, (unsigned long *)addr)
 #endif
 
 #endif	/* __KERNEL__ */
diff --git a/include/asm-parisc/cacheflush.h b/include/asm-parisc/cacheflush.h
index a5700c29f..3086cdaf4 100644
--- a/include/asm-parisc/cacheflush.h
+++ b/include/asm-parisc/cacheflush.h
@@ -65,18 +65,7 @@ flush_user_icache_range(unsigned long start, unsigned long end)
 #endif
 }
 
-extern void __flush_dcache_page(struct page *page);
-
-static inline void flush_dcache_page(struct page *page)
-{
-	struct address_space *mapping = page_mapping(page);
-
-	if (mapping && !mapping_mapped(mapping)) {
-		set_bit(PG_dcache_dirty, &page->flags);
-	} else {
-		__flush_dcache_page(page);
-	}
-}
+extern void flush_dcache_page(struct page *page);
 
 #define flush_dcache_mmap_lock(mapping) \
 	spin_lock_irq(&(mapping)->tree_lock)
@@ -115,28 +104,29 @@ static inline void flush_cache_range(struct vm_area_struct *vma,
 
 /* Simple function to work out if we have an existing address translation
  * for a user space vma. */
-static inline int translation_exists(struct vm_area_struct *vma,
-				     unsigned long addr)
+static inline pte_t *__translation_exists(struct mm_struct *mm,
+					  unsigned long addr)
 {
-	pgd_t *pgd = pgd_offset(vma->vm_mm, addr);
+	pgd_t *pgd = pgd_offset(mm, addr);
 	pmd_t *pmd;
 	pte_t *pte;
 
 	if(pgd_none(*pgd))
-		return 0;
+		return NULL;
 
 	pmd = pmd_offset(pgd, addr);
 	if(pmd_none(*pmd) || pmd_bad(*pmd))
-		return 0;
+		return NULL;
 
 	pte = pte_offset_map(pmd, addr);
 
 	/* The PA flush mappings show up as pte_none, but they're
 	 * valid none the less */
 	if(pte_none(*pte) && ((pte_val(*pte) & _PAGE_FLUSH) == 0))
-		return 0;
-	return 1;
+		return NULL;
+	return pte;
 }
+#define	translation_exists(vma, addr)	__translation_exists((vma)->vm_mm, addr)
 
 
 /* Private function to flush a page from the cache of a non-current
diff --git a/include/asm-parisc/checksum.h b/include/asm-parisc/checksum.h
index 5681db84a..2dcadec88 100644
--- a/include/asm-parisc/checksum.h
+++ b/include/asm-parisc/checksum.h
@@ -191,8 +191,10 @@ static __inline__ unsigned short int csum_ipv6_magic(struct in6_addr *saddr,
  *	Copy and checksum to user
  */
 #define HAVE_CSUM_COPY_USER
-static __inline__ unsigned int csum_and_copy_to_user (const char *src, char *dst,
-				    int len, int sum, int *err_ptr)
+static __inline__ unsigned int csum_and_copy_to_user (const char *src, 
+						      char __user *dst,
+						      int len, int sum, 
+						      int *err_ptr)
 {
 	/* code stolen from include/asm-mips64 */
 	sum = csum_partial(src, len, sum);
diff --git a/include/asm-parisc/dma-mapping.h b/include/asm-parisc/dma-mapping.h
index 89808f778..be4458181 100644
--- a/include/asm-parisc/dma-mapping.h
+++ b/include/asm-parisc/dma-mapping.h
@@ -4,6 +4,7 @@
 #include <linux/mm.h>
 #include <linux/config.h>
 #include <asm/cacheflush.h>
+#include <asm/scatterlist.h>
 
 /* See Documentation/DMA-mapping.txt */
 struct hppa_dma_ops {
diff --git a/include/asm-parisc/fcntl.h b/include/asm-parisc/fcntl.h
index 01fe48b0b..def352307 100644
--- a/include/asm-parisc/fcntl.h
+++ b/include/asm-parisc/fcntl.h
@@ -19,6 +19,7 @@
 #define O_NOCTTY	00400000 /* not fcntl */
 #define O_DSYNC		01000000 /* HPUX only */
 #define O_RSYNC		02000000 /* HPUX only */
+#define O_NOATIME	04000000
 
 #define FASYNC		00020000 /* fcntl, for BSD compatibility */
 #define O_DIRECT	00040000 /* direct disk access hint - currently ignored */
diff --git a/include/asm-parisc/hardware.h b/include/asm-parisc/hardware.h
index 3fc29c68f..b383b3c75 100644
--- a/include/asm-parisc/hardware.h
+++ b/include/asm-parisc/hardware.h
@@ -97,6 +97,7 @@ struct bc_module {
 #define HPHW_IOA       12
 #define HPHW_BRIDGE    13
 #define HPHW_FABRIC    14
+#define HPHW_MC	       15
 #define HPHW_FAULTY    31
 
 
diff --git a/include/asm-parisc/io.h b/include/asm-parisc/io.h
index 714db8ebf..fe536cfa3 100644
--- a/include/asm-parisc/io.h
+++ b/include/asm-parisc/io.h
@@ -24,11 +24,6 @@ extern unsigned long parisc_vmerge_max_size;
 #define virt_to_bus virt_to_phys
 #define bus_to_virt phys_to_virt
 
-/*
- * Change "struct page" to physical address.
- */
-#define page_to_phys(page)	((page - mem_map) << PAGE_SHIFT)
-
 /* Memory mapped IO */
 
 extern void * __ioremap(unsigned long offset, unsigned long size, unsigned long flags);
diff --git a/include/asm-parisc/mmzone.h b/include/asm-parisc/mmzone.h
index 221a7ef1f..928bf50c4 100644
--- a/include/asm-parisc/mmzone.h
+++ b/include/asm-parisc/mmzone.h
@@ -1,31 +1,102 @@
 #ifndef _PARISC_MMZONE_H
 #define _PARISC_MMZONE_H
 
+#ifdef CONFIG_DISCONTIGMEM
+
+#define MAX_PHYSMEM_RANGES 8 /* Fix the size for now (current known max is 3) */
+extern int npmem_ranges;
+
 struct node_map_data {
     pg_data_t pg_data;
-    struct page *adj_node_mem_map;
 };
 
 extern struct node_map_data node_data[];
-extern unsigned char *chunkmap;
-
-#define BADCHUNK                ((unsigned char)0xff)
-#define CHUNKSZ                 (256*1024*1024)
-#define CHUNKSHIFT              28
-#define CHUNKMASK               (~(CHUNKSZ - 1))
-#define CHUNKNUM(paddr)         ((paddr) >> CHUNKSHIFT)
 
 #define NODE_DATA(nid)          (&node_data[nid].pg_data)
-#define NODE_MEM_MAP(nid)       (NODE_DATA(nid)->node_mem_map)
-#define ADJ_NODE_MEM_MAP(nid)   (node_data[nid].adj_node_mem_map)
 
-#define phys_to_page(paddr) \
-	(ADJ_NODE_MEM_MAP(chunkmap[CHUNKNUM((paddr))]) \
-	+ ((paddr) >> PAGE_SHIFT))
+/*
+ * Given a kernel address, find the home node of the underlying memory.
+ */
+#define kvaddr_to_nid(kaddr)	pfn_to_nid(__pa(kaddr) >> PAGE_SHIFT)
+
+#define node_mem_map(nid)	(NODE_DATA(nid)->node_mem_map)
+#define node_start_pfn(nid)	(NODE_DATA(nid)->node_start_pfn)
+#define node_end_pfn(nid)						\
+({									\
+	pg_data_t *__pgdat = NODE_DATA(nid);				\
+	__pgdat->node_start_pfn + __pgdat->node_spanned_pages;		\
+})
+#define node_localnr(pfn, nid)		((pfn) - node_start_pfn(nid))
+
+#define local_mapnr(kvaddr)						\
+({									\
+	unsigned long __pfn = __pa(kvaddr) >> PAGE_SHIFT;		\
+	(__pfn - node_start_pfn(pfn_to_nid(__pfn)));			\
+})
+
+#define pfn_to_page(pfn)						\
+({									\
+	unsigned long __pfn = (pfn);					\
+	int __node  = pfn_to_nid(__pfn);				\
+	&node_mem_map(__node)[node_localnr(__pfn,__node)];		\
+})
+
+#define page_to_pfn(pg)							\
+({									\
+	struct page *__page = pg;					\
+	struct zone *__zone = page_zone(__page);			\
+	BUG_ON(__zone == NULL);						\
+	(unsigned long)(__page - __zone->zone_mem_map)			\
+		+ __zone->zone_start_pfn;				\
+})
+
+/* We have these possible memory map layouts:
+ * Astro: 0-3.75, 67.75-68, 4-64
+ * zx1: 0-1, 257-260, 4-256
+ * Stretch (N-class): 0-2, 4-32, 34-xxx
+ */
+
+/* Since each 1GB can only belong to one region (node), we can create
+ * an index table for pfn to nid lookup; each entry in pfnnid_map 
+ * represents 1GB, and contains the node that the memory belongs to. */
+
+#define PFNNID_SHIFT (30 - PAGE_SHIFT)
+#define PFNNID_MAP_MAX  512     /* support 512GB */
+extern unsigned char pfnnid_map[PFNNID_MAP_MAX];
+
+#ifndef __LP64__
+#define pfn_is_io(pfn) ((pfn & (0xf0000000UL >> PAGE_SHIFT)) == (0xf0000000UL >> PAGE_SHIFT))
+#else
+/* io can be 0xf0f0f0f0f0xxxxxx or 0xfffffffff0000000 */
+#define pfn_is_io(pfn) ((pfn & (0xf000000000000000UL >> PAGE_SHIFT)) == (0xf000000000000000UL >> PAGE_SHIFT))
+#endif
+
+static inline int pfn_to_nid(unsigned long pfn)
+{
+	unsigned int i;
+	unsigned char r;
+
+	if (unlikely(pfn_is_io(pfn)))
+		return 0;
+
+	i = pfn >> PFNNID_SHIFT;
+	BUG_ON(i >= sizeof(pfnnid_map) / sizeof(pfnnid_map[0]));
+	r = pfnnid_map[i];
+	BUG_ON(r == 0xff);
+
+	return (int)r;
+}
 
-#define virt_to_page(kvaddr) phys_to_page(__pa(kvaddr))
+static inline int pfn_valid(int pfn)
+{
+	int nid = pfn_to_nid(pfn);
 
-/* This is kind of bogus, need to investigate performance of doing it right */
-#define VALID_PAGE(page)	((page - mem_map) < max_mapnr)
+	if (nid >= 0)
+		return (pfn < node_end_pfn(nid));
+	return 0;
+}
 
-#endif /* !_PARISC_MMZONE_H */
+#else /* !CONFIG_DISCONTIGMEM */
+#define MAX_PHYSMEM_RANGES 	1 
+#endif
+#endif /* _PARISC_MMZONE_H */
diff --git a/include/asm-parisc/page.h b/include/asm-parisc/page.h
index 54cc342e4..4a12692f9 100644
--- a/include/asm-parisc/page.h
+++ b/include/asm-parisc/page.h
@@ -60,10 +60,15 @@ typedef struct { unsigned long pgprot; } pgprot_t;
 #else
 #define pte_flags(x)	((x).flags)
 #endif
-#define pmd_val(x)	((x).pmd)
-#define pgd_val(x)	((x).pgd)
+
+/* These do not work lvalues, so make sure we don't use them as such. */
+#define pmd_val(x)	((x).pmd + 0)
+#define pgd_val(x)	((x).pgd + 0)
 #define pgprot_val(x)	((x).pgprot)
 
+#define __pmd_val_set(x,n) (x).pmd = (n)
+#define __pgd_val_set(x,n) (x).pgd = (n)
+
 #define __pte(x)	((pte_t) { (x) } )
 #define __pmd(x)	((pmd_t) { (x) } )
 #define __pgd(x)	((pgd_t) { (x) } )
@@ -83,12 +88,6 @@ extern __inline__ int get_order(unsigned long size)
 	return order;
 }
 
-#ifdef __LP64__
-#define MAX_PHYSMEM_RANGES 8 /* Fix the size for now (current known max is 3) */
-#else
-#define MAX_PHYSMEM_RANGES 1 /* First range is only range that fits in 32 bits */
-#endif
-
 typedef struct __physmem_range {
 	unsigned long start_pfn;
 	unsigned long pages;       /* PAGE_SIZE pages */
@@ -144,15 +143,16 @@ extern int npmem_ranges;
 #define __pa(x)			((unsigned long)(x)-PAGE_OFFSET)
 #define __va(x)			((void *)((unsigned long)(x)+PAGE_OFFSET))
 
+#ifndef CONFIG_DISCONTIGMEM
 #define pfn_to_page(pfn)	(mem_map + (pfn))
 #define page_to_pfn(page)	((unsigned long)((page) - mem_map))
 #define pfn_valid(pfn)		((pfn) < max_mapnr)
+#endif /* CONFIG_DISCONTIGMEM */
+
 #define virt_addr_valid(kaddr)	pfn_valid(__pa(kaddr) >> PAGE_SHIFT)
 
-#ifndef CONFIG_DISCONTIGMEM
-#define virt_to_page(kaddr)     (mem_map + (__pa(kaddr) >> PAGE_SHIFT))
-#define VALID_PAGE(page)	((page - mem_map) < max_mapnr)
-#endif  /* !CONFIG_DISCONTIGMEM */
+#define page_to_phys(page)	(page_to_pfn(page) << PAGE_SHIFT)
+#define virt_to_page(kaddr)     pfn_to_page(__pa(kaddr) >> PAGE_SHIFT)
 
 #define VM_DATA_DEFAULT_FLAGS	(VM_READ | VM_WRITE | VM_EXEC | \
 				 VM_MAYREAD | VM_MAYWRITE | VM_MAYEXEC)
diff --git a/include/asm-parisc/pci.h b/include/asm-parisc/pci.h
index b091f0845..ba34a4e49 100644
--- a/include/asm-parisc/pci.h
+++ b/include/asm-parisc/pci.h
@@ -16,28 +16,6 @@
 */
 #define PCI_MAX_BUSSES	256
 
-/* [soapbox on]
-** Who the hell can develop stuff without ASSERT or VASSERT?
-** No one understands all the modules across all platforms.
-** For linux add another dimension - processor architectures.
-**
-** This should be a standard/global macro used liberally
-** in all code. Every respectable engineer I know in HP
-** would support this argument. - grant
-** [soapbox off]
-*/
-#ifdef PCI_DEBUG
-#define ASSERT(expr) \
-	if(!(expr)) { \
-		printk("\n%s:%d: Assertion " #expr " failed!\n", \
-		       __FILE__, __LINE__); \
-		panic(#expr); \
-	}
-#else
-#define ASSERT(expr)
-#endif
-
-
 /*
 ** pci_hba_data (aka H2P_OBJECT in HP/UX)
 **
diff --git a/include/asm-parisc/pdc.h b/include/asm-parisc/pdc.h
index 990ddd36d..ce9a9e1b3 100644
--- a/include/asm-parisc/pdc.h
+++ b/include/asm-parisc/pdc.h
@@ -297,175 +297,6 @@ typedef struct {
 #define OSTAT_RUN		6
 #define OSTAT_ON		7
 
-#ifdef __LP64__
-/* PDC PAT CELL */
-#define PDC_PAT_CELL	64L		/* Interface for gaining and 
-					 * manipulating cell state within PD */
-#define PDC_PAT_CELL_GET_NUMBER	   0L	/* Return Cell number		*/
-#define PDC_PAT_CELL_GET_INFO      1L	/* Returns info about Cell	*/
-#define PDC_PAT_CELL_MODULE        2L	/* Returns info about Module	*/
-#define PDC_PAT_CELL_SET_ATTENTION 9L	/* Set Cell Attention indicator	*/
-#define PDC_PAT_CELL_NUMBER_TO_LOC 10L	/* Cell Number -> Location	*/
-#define PDC_PAT_CELL_WALK_FABRIC   11L	/* Walk the Fabric		*/
-#define PDC_PAT_CELL_GET_RDT_SIZE  12L	/* Return Route Distance Table Sizes */
-#define PDC_PAT_CELL_GET_RDT       13L	/* Return Route Distance Tables	*/
-#define PDC_PAT_CELL_GET_LOCAL_PDH_SZ  14L /* Read Local PDH Buffer Size*/
-#define PDC_PAT_CELL_SET_LOCAL_PDH     15L /* Write Local PDH Buffer	*/
-#define PDC_PAT_CELL_GET_REMOTE_PDH_SZ 16L /* Return Remote PDH Buffer Size */
-#define PDC_PAT_CELL_GET_REMOTE_PDH    17L /* Read Remote PDH Buffer	*/
-#define PDC_PAT_CELL_GET_DBG_INFO  128L	/* Return DBG Buffer Info	*/
-#define PDC_PAT_CELL_CHANGE_ALIAS  129L	/* Change Non-Equivalent Alias Checking */
-
-/*
-** Arg to PDC_PAT_CELL_MODULE memaddr[4]
-**
-** Addresses on the Merced Bus != all Runway Bus addresses.
-** This is intended for programming SBA/LBA chips range registers.
-*/
-#define IO_VIEW			0UL
-#define PA_VIEW			1UL
-
-/* PDC_PAT_CELL_MODULE entity type values */
-#define PAT_ENTITY_CA		0	/* central agent	*/
-#define PAT_ENTITY_PROC		1	/* processor		*/
-#define PAT_ENTITY_MEM		2	/* memory controller	*/
-#define PAT_ENTITY_SBA		3	/* system bus adapter	*/
-#define PAT_ENTITY_LBA		4	/* local bus adapter	*/
-#define PAT_ENTITY_PBC		5	/* processor bus converter */
-#define PAT_ENTITY_XBC		6	/* crossbar fabric connect */
-#define PAT_ENTITY_RC		7	/* fabric interconnect	*/
-
-/* PDC_PAT_CELL_MODULE address range type values */
-#define PAT_PBNUM		0	/* PCI Bus Number	*/
-#define PAT_LMMIO		1	/* < 4G MMIO Space	*/
-#define PAT_GMMIO		2	/* > 4G MMIO Space	*/
-#define PAT_NPIOP		3	/* Non Postable I/O Port Space */
-#define PAT_PIOP		4	/* Postable I/O Port Space */
-#define PAT_AHPA		5	/* Additional HPA Space	*/
-#define PAT_UFO			6	/* HPA Space (UFO for Mariposa) */
-#define PAT_GNIP		7	/* GNI Reserved Space	*/
-
-
-/* PDC PAT CHASSIS LOG */
-#define PDC_PAT_CHASSIS_LOG	65L	/* Platform logging & forward
-					 ** progress functions	*/
-#define PDC_PAT_CHASSIS_WRITE_LOG	0L /* Write Log Entry	*/
-#define PDC_PAT_CHASSIS_READ_LOG	1L /* Read  Log Entry	*/
-
-
-/* PDC PAT CPU  */
-#define PDC_PAT_CPU		67L	/* Interface to CPU configuration
-					 * within the protection domain */
-#define PDC_PAT_CPU_INFO		0L /* Return CPU config info	*/
-#define PDC_PAT_CPU_DELETE		1L /* Delete CPU		*/
-#define PDC_PAT_CPU_ADD			2L /* Add    CPU		*/
-#define PDC_PAT_CPU_GET_NUMBER		3L /* Return CPU Number		*/
-#define PDC_PAT_CPU_GET_HPA		4L /* Return CPU HPA		*/
-#define PDC_PAT_CPU_STOP            	5L /* Stop   CPU		*/
-#define PDC_PAT_CPU_RENDEZVOUS      	6L /* Rendezvous CPU		*/
-#define PDC_PAT_CPU_GET_CLOCK_INFO  	7L /* Return CPU Clock info	*/
-#define PDC_PAT_CPU_GET_RENDEZVOUS_STATE 8L /* Return Rendezvous State	*/
-#define PDC_PAT_CPU_PLUNGE_FABRIC	128L /* Plunge Fabric		*/
-#define PDC_PAT_CPU_UPDATE_CACHE_CLEANSING 129L /* Manipulate Cache 
-                                                 * Cleansing Mode	*/
-
-/*  PDC PAT EVENT */
-#define PDC_PAT_EVENT		68L	/* Interface to Platform Events */
-#define PDC_PAT_EVENT_GET_CAPS		0L /* Get Capabilities		*/
-#define PDC_PAT_EVENT_SET_MODE		1L /* Set Notification Mode	*/
-#define PDC_PAT_EVENT_SCAN		2L /* Scan Event		*/
-#define PDC_PAT_EVENT_HANDLE		3L /* Handle Event		*/
-#define PDC_PAT_EVENT_GET_NB_CALL	4L /* Get Non-Blocking call Args*/
-
-/*  PDC PAT HPMC */
-#define PDC_PAT_HPMC		70L	/* Cause processor to go into spin
-					 ** loop, and wait for wake up from
-					 ** Monarch Processor		*/
-#define PDC_PAT_HPMC_RENDEZ_CPU		0L /* go into spin loop		*/
-#define PDC_PAT_HPMC_SET_PARAMS		1L /* Allows OS to specify intr which PDC 
-                                        * will use to interrupt OS during machine
-                                        * check rendezvous		*/
-
-/* parameters for PDC_PAT_HPMC_SET_PARAMS */
-#define HPMC_SET_PARAMS_INTR		1L /* Rendezvous Interrupt	*/
-#define HPMC_SET_PARAMS_WAKE		2L /* Wake up processor		*/
-
-/*  PDC PAT IO */
-#define PDC_PAT_IO		71L	/* On-line services for I/O modules */
-#define PDC_PAT_IO_GET_SLOT_STATUS	 5L /* Get Slot Status Info	*/
-#define PDC_PAT_IO_GET_LOC_FROM_HARDWARE 6L /* Get Physical Location from */
-                                            /* Hardware Path		*/
-#define PDC_PAT_IO_GET_HARDWARE_FROM_LOC 7L /* Get Hardware Path from 
-                                             * Physical Location	*/
-#define PDC_PAT_IO_GET_PCI_CONFIG_FROM_HW 11L /* Get PCI Configuration
-                                               * Address from Hardware Path */
-#define PDC_PAT_IO_GET_HW_FROM_PCI_CONFIG 12L /* Get Hardware Path 
-                                               * from PCI Configuration Address */
-#define PDC_PAT_IO_READ_HOST_BRIDGE_INFO  13L /* Read Host Bridge State Info */
-#define PDC_PAT_IO_CLEAR_HOST_BRIDGE_INFO 14L /* Clear Host Bridge State Info*/
-#define PDC_PAT_IO_GET_PCI_ROUTING_TABLE_SIZE 15L /* Get PCI INT Routing Table 
-                                                   * Size		*/
-#define PDC_PAT_IO_GET_PCI_ROUTING_TABLE  16L /* Get PCI INT Routing Table */
-#define PDC_PAT_IO_GET_HINT_TABLE_SIZE    17L /* Get Hint Table Size	*/
-#define PDC_PAT_IO_GET_HINT_TABLE	18L /* Get Hint Table		*/
-#define PDC_PAT_IO_PCI_CONFIG_READ	19L /* PCI Config Read		*/
-#define PDC_PAT_IO_PCI_CONFIG_WRITE	20L /* PCI Config Write		*/
-#define PDC_PAT_IO_GET_NUM_IO_SLOTS	21L /* Get Number of I/O Bay Slots in 
-                                       		  * Cabinet		*/
-#define PDC_PAT_IO_GET_LOC_IO_SLOTS	22L /* Get Physical Location of I/O */
-                                   	    /* Bay Slots in Cabinet	*/
-#define PDC_PAT_IO_BAY_STATUS_INFO	28L /* Get I/O Bay Slot Status Info */
-#define PDC_PAT_IO_GET_PROC_VIEW	29L /* Get Processor view of IO address */
-#define PDC_PAT_IO_PROG_SBA_DIR_RANGE	30L /* Program directed range	*/
-
-/* PDC PAT MEM */
-#define PDC_PAT_MEM		72L  /* Manage memory page deallocation */
-#define PDC_PAT_MEM_PD_INFO     	0L /* Return PDT info for PD	*/
-#define PDC_PAT_MEM_PD_CLEAR    	1L /* Clear PDT for PD		*/
-#define PDC_PAT_MEM_PD_READ     	2L /* Read PDT entries for PD	*/
-#define PDC_PAT_MEM_PD_RESET    	3L /* Reset clear bit for PD	*/
-#define PDC_PAT_MEM_CELL_INFO   	5L /* Return PDT info For Cell	*/
-#define PDC_PAT_MEM_CELL_CLEAR  	6L /* Clear PDT For Cell	*/
-#define PDC_PAT_MEM_CELL_READ   	7L /* Read PDT entries For Cell	*/
-#define PDC_PAT_MEM_CELL_RESET  	8L /* Reset clear bit For Cell	*/
-#define PDC_PAT_MEM_SETGM	  	9L /* Set Golden Memory value	*/
-#define PDC_PAT_MEM_ADD_PAGE    	10L /* ADDs a page to the cell	*/
-#define PDC_PAT_MEM_ADDRESS     	11L /* Get Physical Location From*/
-					    /* Memory Address		*/
-#define PDC_PAT_MEM_GET_TXT_SIZE   	12L /* Get Formatted Text Size	*/
-#define PDC_PAT_MEM_GET_PD_TXT     	13L /* Get PD Formatted Text	*/
-#define PDC_PAT_MEM_GET_CELL_TXT   	14L /* Get Cell Formatted Text	*/
-#define PDC_PAT_MEM_RD_STATE_INFO  	15L /* Read Mem Module State Info*/
-#define PDC_PAT_MEM_CLR_STATE_INFO 	16L /*Clear Mem Module State Info*/
-#define PDC_PAT_MEM_CLEAN_RANGE    	128L /*Clean Mem in specific range*/
-#define PDC_PAT_MEM_GET_TBL_SIZE   	131L /* Get Memory Table Size	*/
-#define PDC_PAT_MEM_GET_TBL        	132L /* Get Memory Table	*/
-
-/* PDC PAT NVOLATILE */
-#define PDC_PAT_NVOLATILE	73L	   /* Access Non-Volatile Memory*/
-#define PDC_PAT_NVOLATILE_READ		0L /* Read Non-Volatile Memory	*/
-#define PDC_PAT_NVOLATILE_WRITE		1L /* Write Non-Volatile Memory	*/
-#define PDC_PAT_NVOLATILE_GET_SIZE	2L /* Return size of NVM	*/
-#define PDC_PAT_NVOLATILE_VERIFY	3L /* Verify contents of NVM	*/
-#define PDC_PAT_NVOLATILE_INIT		4L /* Initialize NVM		*/
-
-/* PDC PAT PD */
-#define PDC_PAT_PD		74L	    /* Protection Domain Info	*/
-#define PDC_PAT_PD_GET_ADDR_MAP		0L  /* Get Address Map		*/
-
-/* PDC_PAT_PD_GET_ADDR_MAP entry types */
-#define PAT_MEMORY_DESCRIPTOR		1
-
-/* PDC_PAT_PD_GET_ADDR_MAP memory types */
-#define PAT_MEMTYPE_MEMORY		0
-#define PAT_MEMTYPE_FIRMWARE		4
-
-/* PDC_PAT_PD_GET_ADDR_MAP memory usage */
-#define PAT_MEMUSE_GENERAL		0
-#define PAT_MEMUSE_GI			128
-#define PAT_MEMUSE_GNI			129
-#endif /* __LP64__ */
-
 #ifndef __ASSEMBLY__
 
 #include <linux/types.h>
@@ -478,12 +309,6 @@ extern int pdc_type;
 #define PDC_TYPE_SYSTEM_MAP	 1 /* 32-bit, but supports PDC_SYSTEM_MAP */
 #define PDC_TYPE_SNAKE		 2 /* Doesn't support SYSTEM_MAP */
 
-#ifdef CONFIG_PARISC64
-#define is_pdc_pat()    (PDC_TYPE_PAT == pdc_type)
-#else
-#define is_pdc_pat()    (0)
-#endif
-
 struct pdc_chassis_info {       /* for PDC_CHASSIS_INFO */
 	unsigned long actcnt;   /* actual number of bytes returned */
 	unsigned long maxcnt;   /* maximum number of bytes that could be returned */
@@ -521,10 +346,10 @@ struct pdc_cache_cf {		/* for PDC_CACHE  (I/D-caches) */
 #ifdef __LP64__
 		cc_padW:32,
 #endif
-		cc_alias:4,	/* alias boundaries for virtual addresses   */
+		cc_alias: 4,	/* alias boundaries for virtual addresses   */
 		cc_block: 4,	/* to determine most efficient stride */
 		cc_line	: 3,	/* maximum amount written back as a result of store (multiple of 16 bytes) */
-		cc_pad0 : 2,	/* reserved */
+		cc_shift: 2,	/* how much to shift cc_block left */
 		cc_wt	: 1,	/* 0 = WT-Dcache, 1 = WB-Dcache */
 		cc_sh	: 2,	/* 0 = separate I/D-cache, else shared I/D-cache */
 		cc_cst  : 3,	/* 0 = incoherent D-cache, 1=coherent D-cache */
@@ -674,40 +499,6 @@ struct pdc_tod {
 	unsigned long tod_usec;
 };
 
-#ifdef __LP64__
-struct pdc_pat_cell_num {
-	unsigned long cell_num;
-	unsigned long cell_loc;
-};
-
-struct pdc_pat_cpu_num {
-	unsigned long cpu_num;
-	unsigned long cpu_loc;
-};
-
-struct pdc_pat_pd_addr_map_entry {
-	unsigned char entry_type;       /* 1 = Memory Descriptor Entry Type */
-	unsigned char reserve1[5];
-	unsigned char memory_type;
-	unsigned char memory_usage;
-	unsigned long paddr;
-	unsigned int  pages;            /* Length in 4K pages */
-	unsigned int  reserve2;
-	unsigned long cell_map;
-};
-
-/* FIXME: mod[508] should really be a union of the various mod components */
-struct pdc_pat_cell_mod_maddr_block {	/* PDC_PAT_CELL_MODULE */
-	unsigned long cba;              /* function 0 configuration space address */
-	unsigned long mod_info;         /* module information */
-	unsigned long mod_location;     /* physical location of the module */
-	struct hardware_path mod_path;	/* hardware path */
-	unsigned long mod[508];		/* PAT cell module components */
-};
-
-typedef struct pdc_pat_cell_mod_maddr_block pdc_pat_cell_mod_maddr_block_t;
-#endif /* __LP64__ */
-
 /* architected results from PDC_PIM/transfer hpmc on a PA1.1 machine */
 
 struct pdc_hpmc_pim_11 { /* PDC_PIM */
@@ -969,52 +760,6 @@ int pdc_sti_call(unsigned long func, unsigned long flags,
                  unsigned long inptr, unsigned long outputr,
                  unsigned long glob_cfg);
 
-#ifdef __LP64__
-int pdc_pat_chassis_send_log(unsigned long status, unsigned long data);
-int pdc_pat_cell_get_number(struct pdc_pat_cell_num *cell_info);
-int pdc_pat_cell_module(unsigned long *actcnt, unsigned long ploc, unsigned long mod,
-			unsigned long view_type, void *mem_addr);
-int pdc_pat_cpu_get_number(struct pdc_pat_cpu_num *cpu_info, void *hpa);
-int pdc_pat_get_irt_size(unsigned long *num_entries, unsigned long cell_num);
-int pdc_pat_get_irt(void *r_addr, unsigned long cell_num);
-int pdc_pat_pd_get_addr_map(unsigned long *actual_len, void *mem_addr, 
-			    unsigned long count, unsigned long offset);
-
-/********************************************************************
-* PDC_PAT_CELL[Return Cell Module] memaddr[0] conf_base_addr
-* ----------------------------------------------------------
-* Bit  0 to 51 - conf_base_addr
-* Bit 52 to 62 - reserved
-* Bit       63 - endianess bit
-********************************************************************/
-#define PAT_GET_CBA(value) ((value) & 0xfffffffffffff000UL)
-
-/********************************************************************
-* PDC_PAT_CELL[Return Cell Module] memaddr[1] mod_info
-* ----------------------------------------------------
-* Bit  0 to  7 - entity type
-*    0 = central agent,            1 = processor,
-*    2 = memory controller,        3 = system bus adapter,
-*    4 = local bus adapter,        5 = processor bus converter,
-*    6 = crossbar fabric connect,  7 = fabric interconnect,
-*    8 to 254 reserved,            255 = unknown.
-* Bit  8 to 15 - DVI
-* Bit 16 to 23 - IOC functions
-* Bit 24 to 39 - reserved
-* Bit 40 to 63 - mod_pages
-*    number of 4K pages a module occupies starting at conf_base_addr
-********************************************************************/
-#define PAT_GET_ENTITY(value)	(((value) >> 56) & 0xffUL)
-#define PAT_GET_DVI(value)	(((value) >> 48) & 0xffUL)
-#define PAT_GET_IOC(value)	(((value) >> 40) & 0xffUL)
-#define PAT_GET_MOD_PAGES(value)(((value) & 0xffffffUL)
-
-#else /* !__LP64__ */
-/* No PAT support for 32-bit kernels...sorry */
-#define pdc_pat_get_irt_size(num_entries, cell_numn)	PDC_BAD_PROC
-#define pdc_pat_get_irt(r_addr, cell_num)	PDC_BAD_PROC
-#endif /* !__LP64__ */
-
 extern void pdc_init(void);
 
 #endif /* __ASSEMBLY__ */
diff --git a/include/asm-parisc/pdcpat.h b/include/asm-parisc/pdcpat.h
index 2f74d9008..715d94da6 100644
--- a/include/asm-parisc/pdcpat.h
+++ b/include/asm-parisc/pdcpat.h
@@ -6,12 +6,11 @@
  * License.  See the file "COPYING" in the main directory of this archive
  * for more details.
  *
- * Copyright (c) Hewlett Packard (Paul Bame <bame@puffin.external.hp.com>)
- * Copyright 2000 (c) Grant Grundler <grundler@puffin.external.hp.com>
+ * Copyright 2000 (c) Hewlett Packard (Paul Bame <bame()spam.parisc-linux.org>)
+ * Copyright 2000,2004 (c) Grant Grundler <grundler()nahspam.parisc-linux.org>
  */
 
 
-/* PDC PAT CELL */
 #define PDC_PAT_CELL           	64L   /* Interface for gaining and 
                                          * manipulatin g cell state within PD */
 #define PDC_PAT_CELL_GET_NUMBER    0L   /* Return Cell number */
@@ -60,17 +59,17 @@
 #define PAT_GNIP            7         /* GNI Reserved Space */
 
 
-/* PDC PAT CHASSIS LOG */
 
-#define PDC_PAT_CHASSIS_LOG		65L /* Platform logging & forward
-					    ** progress functions */
+/* PDC PAT CHASSIS LOG -- Platform logging & forward progress functions */
+
+#define PDC_PAT_CHASSIS_LOG		65L
 #define PDC_PAT_CHASSIS_WRITE_LOG    	0L /* Write Log Entry */
 #define PDC_PAT_CHASSIS_READ_LOG     	1L /* Read  Log Entry */
 
-/* PDC PAT CPU  */
 
-#define PDC_PAT_CPU                	67L /* Interface to CPU configuration
-                                        	* within the protection domain */
+/* PDC PAT CPU  -- CPU configuration within the protection domain */
+
+#define PDC_PAT_CPU                	67L
 #define PDC_PAT_CPU_INFO            	0L /* Return CPU config info */
 #define PDC_PAT_CPU_DELETE          	1L /* Delete CPU */
 #define PDC_PAT_CPU_ADD             	2L /* Add    CPU */
@@ -83,32 +82,33 @@
 #define PDC_PAT_CPU_PLUNGE_FABRIC 	128L /* Plunge Fabric */
 #define PDC_PAT_CPU_UPDATE_CACHE_CLEANSING 129L /* Manipulate Cache 
                                                  * Cleansing Mode */
-/*  PDC PAT EVENT */
+/*  PDC PAT EVENT -- Platform Events */
 
-#define PDC_PAT_EVENT              	68L /* Interface to Platform Events */
+#define PDC_PAT_EVENT              	68L
 #define PDC_PAT_EVENT_GET_CAPS     	0L /* Get Capabilities */
 #define PDC_PAT_EVENT_SET_MODE     	1L /* Set Notification Mode */
 #define PDC_PAT_EVENT_SCAN         	2L /* Scan Event */
 #define PDC_PAT_EVENT_HANDLE       	3L /* Handle Event */
 #define PDC_PAT_EVENT_GET_NB_CALL  	4L /* Get Non-Blocking call Args */
 
-/*  PDC PAT HPMC */
+/*  PDC PAT HPMC -- Cause processor to go into spin loop, and wait
+ *  			for wake up from Monarch Processor.
+ */
 
-#define PDC_PAT_HPMC               70L /* Cause processor to go into spin
-				       ** loop, and wait for wake up from
-				       ** Monarch Processor */
+#define PDC_PAT_HPMC               70L
 #define PDC_PAT_HPMC_RENDEZ_CPU     0L /* go into spin loop */
 #define PDC_PAT_HPMC_SET_PARAMS     1L /* Allows OS to specify intr which PDC 
-                                        * will use to interrupt OS during machine
-                                        * check rendezvous */
+                                        * will use to interrupt OS during
+                                        * machine check rendezvous */
 
 /* parameters for PDC_PAT_HPMC_SET_PARAMS: */
 #define HPMC_SET_PARAMS_INTR 	    1L /* Rendezvous Interrupt */
 #define HPMC_SET_PARAMS_WAKE 	    2L /* Wake up processor */
 
-/*  PDC PAT IO */
 
-#define PDC_PAT_IO                  71L /* On-line services for I/O modules */
+/*  PDC PAT IO  -- On-line services for I/O modules */
+
+#define PDC_PAT_IO                  71L
 #define PDC_PAT_IO_GET_SLOT_STATUS   	5L /* Get Slot Status Info*/
 #define PDC_PAT_IO_GET_LOC_FROM_HARDWARE 6L /* Get Physical Location from */
                                             /* Hardware Path */
@@ -135,9 +135,10 @@
 #define PDC_PAT_IO_GET_PROC_VIEW        29L /* Get Processor view of IO address */
 #define PDC_PAT_IO_PROG_SBA_DIR_RANGE   30L /* Program directed range */
 
-/* PDC PAT MEM */
 
-#define PDC_PAT_MEM             	72L /* Manage memory page deallocation */
+/* PDC PAT MEM  -- Manage memory page deallocation */
+
+#define PDC_PAT_MEM            72L
 #define PDC_PAT_MEM_PD_INFO     	0L /* Return PDT info for PD       */
 #define PDC_PAT_MEM_PD_CLEAR    	1L /* Clear PDT for PD             */
 #define PDC_PAT_MEM_PD_READ     	2L /* Read PDT entries for PD      */
@@ -159,18 +160,99 @@
 #define PDC_PAT_MEM_GET_TBL_SIZE   	131L /* Get Memory Table Size     */
 #define PDC_PAT_MEM_GET_TBL        	132L /* Get Memory Table          */
 
-/* PDC PAT NVOLATILE */
 
-#define PDC_PAT_NVOLATILE          	73L /* Access Non-Volatile Memory */
-#define PDC_PAT_NVOLATILE_READ      	0L /* Read Non-Volatile Memory   */
-#define PDC_PAT_NVOLATILE_WRITE     	1L /* Write Non-Volatile Memory  */
-#define PDC_PAT_NVOLATILE_GET_SIZE  	2L /* Return size of NVM         */
-#define PDC_PAT_NVOLATILE_VERIFY    	3L /* Verify contents of NVM     */
-#define PDC_PAT_NVOLATILE_INIT      	4L /* Initialize NVM             */
+/* PDC PAT NVOLATILE  --  Access Non-Volatile Memory */
+
+#define PDC_PAT_NVOLATILE	73L
+#define PDC_PAT_NVOLATILE_READ		0L /* Read Non-Volatile Memory   */
+#define PDC_PAT_NVOLATILE_WRITE		1L /* Write Non-Volatile Memory  */
+#define PDC_PAT_NVOLATILE_GET_SIZE	2L /* Return size of NVM         */
+#define PDC_PAT_NVOLATILE_VERIFY	3L /* Verify contents of NVM     */
+#define PDC_PAT_NVOLATILE_INIT		4L /* Initialize NVM             */
+
+/* PDC PAT PD */
+#define PDC_PAT_PD		74L         /* Protection Domain Info   */
+#define PDC_PAT_PD_GET_ADDR_MAP		0L  /* Get Address Map          */
+
+/* PDC_PAT_PD_GET_ADDR_MAP entry types */
+#define PAT_MEMORY_DESCRIPTOR		1   
+
+/* PDC_PAT_PD_GET_ADDR_MAP memory types */
+#define PAT_MEMTYPE_MEMORY		0
+#define PAT_MEMTYPE_FIRMWARE		4
+
+/* PDC_PAT_PD_GET_ADDR_MAP memory usage */
+#define PAT_MEMUSE_GENERAL		0
+#define PAT_MEMUSE_GI			128
+#define PAT_MEMUSE_GNI			129
+
 
 #ifndef __ASSEMBLY__
 #include <linux/types.h>
 
+#ifdef CONFIG_PARISC64
+#define is_pdc_pat()	(PDC_TYPE_PAT == pdc_type)
+extern int pdc_pat_get_irt_size(unsigned long *num_entries, unsigned long cell_num);
+extern int pdc_pat_get_irt(void *r_addr, unsigned long cell_num);
+#else	/* ! CONFIG_PARISC64 */
+/* No PAT support for 32-bit kernels...sorry */
+#define is_pdc_pat()	(0)
+#define pdc_pat_get_irt_size(num_entries, cell_numn)	PDC_BAD_PROC
+#define pdc_pat_get_irt(r_addr, cell_num)		PDC_BAD_PROC
+#endif	/* ! CONFIG_PARISC64 */
+
+
+struct pdc_pat_cell_num {
+	unsigned long cell_num;
+	unsigned long cell_loc;
+};
+
+struct pdc_pat_cpu_num {
+	unsigned long cpu_num;
+	unsigned long cpu_loc;
+};
+
+struct pdc_pat_pd_addr_map_entry {
+	unsigned char entry_type;       /* 1 = Memory Descriptor Entry Type */
+	unsigned char reserve1[5];
+	unsigned char memory_type;
+	unsigned char memory_usage;
+	unsigned long paddr;
+	unsigned int  pages;            /* Length in 4K pages */
+	unsigned int  reserve2;
+	unsigned long cell_map;
+};
+
+/********************************************************************
+* PDC_PAT_CELL[Return Cell Module] memaddr[0] conf_base_addr
+* ----------------------------------------------------------
+* Bit  0 to 51 - conf_base_addr
+* Bit 52 to 62 - reserved
+* Bit       63 - endianess bit
+********************************************************************/
+#define PAT_GET_CBA(value) ((value) & 0xfffffffffffff000UL)
+
+/********************************************************************
+* PDC_PAT_CELL[Return Cell Module] memaddr[1] mod_info
+* ----------------------------------------------------
+* Bit  0 to  7 - entity type
+*    0 = central agent,            1 = processor,
+*    2 = memory controller,        3 = system bus adapter,
+*    4 = local bus adapter,        5 = processor bus converter,
+*    6 = crossbar fabric connect,  7 = fabric interconnect,
+*    8 to 254 reserved,            255 = unknown.
+* Bit  8 to 15 - DVI
+* Bit 16 to 23 - IOC functions
+* Bit 24 to 39 - reserved
+* Bit 40 to 63 - mod_pages
+*    number of 4K pages a module occupies starting at conf_base_addr
+********************************************************************/
+#define PAT_GET_ENTITY(value)	(((value) >> 56) & 0xffUL)
+#define PAT_GET_DVI(value)	(((value) >> 48) & 0xffUL)
+#define PAT_GET_IOC(value)	(((value) >> 40) & 0xffUL)
+#define PAT_GET_MOD_PAGES(value)(((value) & 0xffffffUL)
+
+
 /*
 ** PDC_PAT_CELL_GET_INFO return block
 */
@@ -192,26 +274,34 @@ typedef struct pdc_pat_cell_info_rtn_block {
 
 /* FIXME: mod[508] should really be a union of the various mod components */
 struct pdc_pat_cell_mod_maddr_block {	/* PDC_PAT_CELL_MODULE */
-	unsigned long cba;              /* function 0 configuration space address */
-	unsigned long mod_info;         /* module information */
-	unsigned long mod_location;     /* physical location of the module */
-	unsigned long mod_path;         /* module path (device path - layers) */
+	unsigned long cba;		/* func 0 cfg space address */
+	unsigned long mod_info;		/* module information */
+	unsigned long mod_location;	/* physical location of the module */
+	struct hardware_path mod_path;	/* module path (device path - layers) */
 	unsigned long mod[508];		/* PAT cell module components */
 } __attribute__((aligned(8))) ;
 
 typedef struct pdc_pat_cell_mod_maddr_block pdc_pat_cell_mod_maddr_block_t;
 
 
-extern int pdc_pat_cell_get_number(void *);
-extern int pdc_pat_cell_module(void *, unsigned long, unsigned long, unsigned long, void *);
+extern int pdc_pat_chassis_send_log(unsigned long status, unsigned long data);
+extern int pdc_pat_cell_get_number(struct pdc_pat_cell_num *cell_info);
+extern int pdc_pat_cell_module(unsigned long *actcnt, unsigned long ploc, unsigned long mod, unsigned long view_type, void *mem_addr);
 extern int pdc_pat_cell_num_to_loc(void *, unsigned long);
 
+extern int pdc_pat_cpu_get_number(struct pdc_pat_cpu_num *cpu_info, void *hpa);
+
+extern int pdc_pat_pd_get_addr_map(unsigned long *actual_len, void *mem_addr, unsigned long count, unsigned long offset);
+
+
+extern int pdc_pat_io_pci_cfg_read(unsigned long pci_addr, int pci_size, u32 *val); 
+extern int pdc_pat_io_pci_cfg_write(unsigned long pci_addr, int pci_size, u32 val); 
+
+
 /* Flag to indicate this is a PAT box...don't use this unless you
 ** really have to...it might go away some day.
 */
-#ifdef __LP64__
 extern int pdc_pat;     /* arch/parisc/kernel/inventory.c */
-#endif
 
 /********************************************************************
 * PDC_PAT_CELL[Return Cell Module] memaddr[0] conf_base_addr
diff --git a/include/asm-parisc/pgalloc.h b/include/asm-parisc/pgalloc.h
index 7b2a36c9d..53a6fec7d 100644
--- a/include/asm-parisc/pgalloc.h
+++ b/include/asm-parisc/pgalloc.h
@@ -21,7 +21,7 @@
  * kernel for machines with under 4GB of memory) */
 static inline pgd_t *pgd_alloc(struct mm_struct *mm)
 {
-	pgd_t *pgd = (pgd_t *)__get_free_pages(GFP_KERNEL|GFP_DMA,
+	pgd_t *pgd = (pgd_t *)__get_free_pages(GFP_KERNEL,
 					       PGD_ALLOC_ORDER);
 	pgd_t *actual_pgd = pgd;
 
@@ -30,13 +30,15 @@ static inline pgd_t *pgd_alloc(struct mm_struct *mm)
 #ifdef __LP64__
 		actual_pgd += PTRS_PER_PGD;
 		/* Populate first pmd with allocated memory.  We mark it
-		 * with _PAGE_GATEWAY as a signal to the system that this
+		 * with PxD_FLAG_ATTACHED as a signal to the system that this
 		 * pmd entry may not be cleared. */
-		pgd_val(*actual_pgd) = (_PAGE_TABLE | _PAGE_GATEWAY) + 
-			(__u32)__pa((unsigned long)pgd);
+		__pgd_val_set(*actual_pgd, (PxD_FLAG_PRESENT | 
+				        PxD_FLAG_VALID | 
+					PxD_FLAG_ATTACHED) 
+			+ (__u32)(__pa((unsigned long)pgd) >> PxD_VALUE_SHIFT));
 		/* The first pmd entry also is marked with _PAGE_GATEWAY as
 		 * a signal that this pmd may not be freed */
-		pgd_val(*pgd) = _PAGE_GATEWAY;
+		__pgd_val_set(*pgd, PxD_FLAG_ATTACHED);
 #endif
 	}
 	return actual_pgd;
@@ -56,14 +58,13 @@ static inline void pgd_free(pgd_t *pgd)
 
 static inline void pgd_populate(struct mm_struct *mm, pgd_t *pgd, pmd_t *pmd)
 {
-	pgd_val(*pgd) = _PAGE_TABLE + (__u32)__pa((unsigned long)pmd);
+	__pgd_val_set(*pgd, (PxD_FLAG_PRESENT | PxD_FLAG_VALID) +
+		        (__u32)(__pa((unsigned long)pmd) >> PxD_VALUE_SHIFT));
 }
 
-/* NOTE: pmd must be in ZONE_DMA (<4GB) so the pgd pointer can be
- * housed in 32 bits */
 static inline pmd_t *pmd_alloc_one(struct mm_struct *mm, unsigned long address)
 {
-	pmd_t *pmd = (pmd_t *)__get_free_pages(GFP_KERNEL|__GFP_REPEAT|GFP_DMA,
+	pmd_t *pmd = (pmd_t *)__get_free_pages(GFP_KERNEL|__GFP_REPEAT,
 					       PMD_ORDER);
 	if (pmd)
 		memset(pmd, 0, PAGE_SIZE<<PMD_ORDER);
@@ -73,7 +74,7 @@ static inline pmd_t *pmd_alloc_one(struct mm_struct *mm, unsigned long address)
 static inline void pmd_free(pmd_t *pmd)
 {
 #ifdef __LP64__
-	if(pmd_val(*pmd) & _PAGE_GATEWAY)
+	if(pmd_flag(*pmd) & PxD_FLAG_ATTACHED)
 		/* This is the permanent pmd attached to the pgd;
 		 * cannot free it */
 		return;
@@ -102,23 +103,24 @@ pmd_populate_kernel(struct mm_struct *mm, pmd_t *pmd, pte_t *pte)
 #ifdef __LP64__
 	/* preserve the gateway marker if this is the beginning of
 	 * the permanent pmd */
-	if(pmd_val(*pmd) & _PAGE_GATEWAY)
-		pmd_val(*pmd) = (_PAGE_TABLE | _PAGE_GATEWAY)
-			+ (__u32)__pa((unsigned long)pte);
+	if(pmd_flag(*pmd) & PxD_FLAG_ATTACHED)
+		__pmd_val_set(*pmd, (PxD_FLAG_PRESENT |
+				 PxD_FLAG_VALID |
+				 PxD_FLAG_ATTACHED) 
+			+ (__u32)(__pa((unsigned long)pte) >> PxD_VALUE_SHIFT));
 	else
 #endif
-		pmd_val(*pmd) = _PAGE_TABLE + (__u32)__pa((unsigned long)pte);
+		__pmd_val_set(*pmd, (PxD_FLAG_PRESENT | PxD_FLAG_VALID) 
+			+ (__u32)(__pa((unsigned long)pte) >> PxD_VALUE_SHIFT));
 }
 
 #define pmd_populate(mm, pmd, pte_page) \
 	pmd_populate_kernel(mm, pmd, page_address(pte_page))
 
-/* NOTE: pte must be in ZONE_DMA (<4GB) so that the pmd pointer
- * can be housed in 32 bits */
 static inline struct page *
 pte_alloc_one(struct mm_struct *mm, unsigned long address)
 {
-	struct page *page = alloc_page(GFP_KERNEL|__GFP_REPEAT|GFP_DMA);
+	struct page *page = alloc_page(GFP_KERNEL|__GFP_REPEAT);
 	if (likely(page != NULL))
 		clear_page(page_address(page));
 	return page;
@@ -127,7 +129,7 @@ pte_alloc_one(struct mm_struct *mm, unsigned long address)
 static inline pte_t *
 pte_alloc_one_kernel(struct mm_struct *mm, unsigned long addr)
 {
-	pte_t *pte = (pte_t *)__get_free_page(GFP_KERNEL|__GFP_REPEAT|GFP_DMA);
+	pte_t *pte = (pte_t *)__get_free_page(GFP_KERNEL|__GFP_REPEAT);
 	if (likely(pte != NULL))
 		clear_page(pte);
 	return pte;
diff --git a/include/asm-parisc/pgtable.h b/include/asm-parisc/pgtable.h
index cadae7fb3..1593a8a7a 100644
--- a/include/asm-parisc/pgtable.h
+++ b/include/asm-parisc/pgtable.h
@@ -57,10 +57,14 @@
 
 /* This is the size of the initially mapped kernel memory (i.e. currently
  * 0 to 1<<23 == 8MB */
+#ifdef CONFIG_64BIT
+#define KERNEL_INITIAL_ORDER	24
+#else
 #define KERNEL_INITIAL_ORDER	23
+#endif
 #define KERNEL_INITIAL_SIZE	(1 << KERNEL_INITIAL_ORDER)
 
-#ifdef __LP64__
+#ifdef CONFIG_64BIT
 #define PT_NLEVELS	3
 #define PGD_ORDER	1 /* Number of pages per pgd */
 #define PMD_ORDER	1 /* Number of pages per pmd */
@@ -177,6 +181,21 @@ extern  void *vmalloc_start;
 #define _PAGE_CHG_MASK	(PAGE_MASK | _PAGE_ACCESSED | _PAGE_DIRTY)
 #define _PAGE_KERNEL	(_PAGE_PRESENT | _PAGE_EXEC | _PAGE_READ | _PAGE_WRITE | _PAGE_DIRTY | _PAGE_ACCESSED)
 
+/* The pgd/pmd contains a ptr (in phys addr space); since all pgds/pmds
+ * are page-aligned, we don't care about the PAGE_OFFSET bits, except
+ * for a few meta-information bits, so we shift the address to be
+ * able to effectively address 40-bits of physical address space. */
+#define _PxD_PRESENT_BIT   31
+#define _PxD_ATTACHED_BIT  30
+#define _PxD_VALID_BIT     29
+
+#define PxD_FLAG_PRESENT  (1 << xlate_pabit(_PxD_PRESENT_BIT))
+#define PxD_FLAG_ATTACHED (1 << xlate_pabit(_PxD_ATTACHED_BIT))
+#define PxD_FLAG_VALID    (1 << xlate_pabit(_PxD_VALID_BIT))
+#define PxD_FLAG_MASK     (0xf)
+#define PxD_FLAG_SHIFT    (4)
+#define PxD_VALUE_SHIFT   (8)
+
 #ifndef __ASSEMBLY__
 
 #define PAGE_NONE	__pgprot(_PAGE_PRESENT | _PAGE_USER | _PAGE_ACCESSED)
@@ -244,49 +263,49 @@ extern unsigned long *empty_zero_page;
 #define pte_present(x)	(pte_val(x) & _PAGE_PRESENT)
 #define pte_clear(xp)	do { pte_val(*(xp)) = 0; } while (0)
 
-#ifdef __LP64__
+#define pmd_flag(x)	(pmd_val(x) & PxD_FLAG_MASK)
+#define pmd_address(x)	((unsigned long)(pmd_val(x) &~ PxD_FLAG_MASK) << PxD_VALUE_SHIFT)
+#define pgd_flag(x)	(pgd_val(x) & PxD_FLAG_MASK)
+#define pgd_address(x)	((unsigned long)(pgd_val(x) &~ PxD_FLAG_MASK) << PxD_VALUE_SHIFT)
+
+#ifdef CONFIG_64BIT
 /* The first entry of the permanent pmd is not there if it contains
  * the gateway marker */
-#define pmd_none(x)	(!pmd_val(x) || pmd_val(x) == _PAGE_GATEWAY)
-#define pmd_bad(x)	((pmd_val(x) & ~PAGE_MASK) != _PAGE_TABLE && (pmd_val(x) & ~PAGE_MASK) != (_PAGE_TABLE | _PAGE_GATEWAY))
+#define pmd_none(x)	(!pmd_val(x) || pmd_flag(x) == PxD_FLAG_ATTACHED)
 #else
 #define pmd_none(x)	(!pmd_val(x))
-#define pmd_bad(x)	((pmd_val(x) & ~PAGE_MASK) != _PAGE_TABLE)
 #endif
-#define pmd_present(x)	(pmd_val(x) & _PAGE_PRESENT)
+#define pmd_bad(x)	(!(pmd_flag(x) & PxD_FLAG_VALID))
+#define pmd_present(x)	(pmd_flag(x) & PxD_FLAG_PRESENT)
 static inline void pmd_clear(pmd_t *pmd) {
-#ifdef __LP64__
-	if(pmd_val(*pmd) & _PAGE_GATEWAY)
+#ifdef CONFIG_64BIT
+	if (pmd_flag(*pmd) & PxD_FLAG_ATTACHED)
 		/* This is the entry pointing to the permanent pmd
 		 * attached to the pgd; cannot clear it */
-		pmd_val(*pmd) = _PAGE_GATEWAY;
+		__pmd_val_set(*pmd, PxD_FLAG_ATTACHED);
 	else
 #endif
-		pmd_val(*pmd) = 0;
+		__pmd_val_set(*pmd,  0);
 }
 
 
 
 #if PT_NLEVELS == 3
-#define pgd_page(pgd) ((unsigned long) __va(pgd_val(pgd) & PAGE_MASK))
+#define pgd_page(pgd) ((unsigned long) __va(pgd_address(pgd)))
 
 /* For 64 bit we have three level tables */
 
 #define pgd_none(x)     (!pgd_val(x))
-#ifdef __LP64__
-#define pgd_bad(x)      ((pgd_val(x) & ~PAGE_MASK) != _PAGE_TABLE && (pgd_val(x) & ~PAGE_MASK) != (_PAGE_TABLE | _PAGE_GATEWAY))
-#else
-#define pgd_bad(x)      ((pgd_val(x) & ~PAGE_MASK) != _PAGE_TABLE)
-#endif
-#define pgd_present(x)  (pgd_val(x) & _PAGE_PRESENT)
+#define pgd_bad(x)      (!(pgd_flag(x) & PxD_FLAG_VALID))
+#define pgd_present(x)  (pgd_flag(x) & PxD_FLAG_PRESENT)
 static inline void pgd_clear(pgd_t *pgd) {
-#ifdef __LP64__
-	if(pgd_val(*pgd) & _PAGE_GATEWAY)
+#ifdef CONFIG_64BIT
+	if(pgd_flag(*pgd) & PxD_FLAG_ATTACHED)
 		/* This is the permanent pmd attached to the pgd; cannot
 		 * free it */
 		return;
 #endif
-	pgd_val(*pgd) = 0;
+	__pgd_val_set(*pgd, 0);
 }
 #else
 /*
@@ -353,15 +372,11 @@ extern inline pte_t pte_modify(pte_t pte, pgprot_t newprot)
 
 #define pte_pfn(x) (pte_val(x) >> PAGE_SHIFT)
 
-#ifdef CONFIG_DISCONTIGMEM
-#define pte_page(x) (phys_to_page(pte_val(x)))
-#else
-#define pte_page(x) (mem_map+(pte_val(x) >> PAGE_SHIFT))
-#endif
+#define pte_page(pte)		(pfn_to_page(pte_pfn(pte)))
 
-#define pmd_page_kernel(pmd)	((unsigned long) __va(pmd_val(pmd) & PAGE_MASK))
+#define pmd_page_kernel(pmd)	((unsigned long) __va(pmd_address(pmd)))
 
-#define __pmd_page(pmd) ((unsigned long) __va(pmd_val(pmd) & PAGE_MASK))
+#define __pmd_page(pmd) ((unsigned long) __va(pmd_address(pmd)))
 #define pmd_page(pmd)	virt_to_page((void *)__pmd_page(pmd))
 
 #define pgd_index(address) ((address) >> PGDIR_SHIFT)
@@ -417,7 +432,9 @@ extern void update_mmu_cache(struct vm_area_struct *, unsigned long, pte_t);
 static inline int ptep_test_and_clear_young(pte_t *ptep)
 {
 #ifdef CONFIG_SMP
-	return test_and_clear_bit(xlate_pabit(_PAGE_ACCESSED_BIT), ptep);
+	if (!pte_young(*ptep))
+		return 0;
+	return test_and_clear_bit(xlate_pabit(_PAGE_ACCESSED_BIT), &pte_val(*ptep));
 #else
 	pte_t pte = *ptep;
 	if (!pte_young(pte))
@@ -430,7 +447,9 @@ static inline int ptep_test_and_clear_young(pte_t *ptep)
 static inline int ptep_test_and_clear_dirty(pte_t *ptep)
 {
 #ifdef CONFIG_SMP
-	return test_and_clear_bit(xlate_pabit(_PAGE_DIRTY_BIT), ptep);
+	if (!pte_dirty(*ptep))
+		return 0;
+	return test_and_clear_bit(xlate_pabit(_PAGE_DIRTY_BIT), &pte_val(*ptep));
 #else
 	pte_t pte = *ptep;
 	if (!pte_dirty(pte))
@@ -440,11 +459,7 @@ static inline int ptep_test_and_clear_dirty(pte_t *ptep)
 #endif
 }
 
-#ifdef CONFIG_SMP
 extern spinlock_t pa_dbit_lock;
-#else
-static int pa_dbit_lock; /* dummy to keep the compilers happy */
-#endif
 
 static inline pte_t ptep_get_and_clear(pte_t *ptep)
 {
@@ -479,7 +494,7 @@ static inline void ptep_set_wrprotect(pte_t *ptep)
 static inline void ptep_mkdirty(pte_t *ptep)
 {
 #ifdef CONFIG_SMP
-	set_bit(xlate_pabit(_PAGE_DIRTY_BIT), ptep);
+	set_bit(xlate_pabit(_PAGE_DIRTY_BIT), &pte_val(*ptep));
 #else
 	pte_t old_pte = *ptep;
 	set_pte(ptep, pte_mkdirty(old_pte));
diff --git a/include/asm-parisc/resource.h b/include/asm-parisc/resource.h
index f9088848f..59a446534 100644
--- a/include/asm-parisc/resource.h
+++ b/include/asm-parisc/resource.h
@@ -16,8 +16,10 @@
 #define RLIMIT_MEMLOCK	8		/* max locked-in-memory address space */
 #define RLIMIT_AS	9		/* address space limit */
 #define RLIMIT_LOCKS	10		/* maximum file locks held */
+#define RLIMIT_SIGPENDING 11		/* max number of pending signals */
+#define RLIMIT_MSGQUEUE 12		/* maximum bytes in POSIX mqueues */
 
-#define RLIM_NLIMITS	11
+#define RLIM_NLIMITS	13
 
 /*
  * SuS says limits have to be unsigned.
@@ -40,6 +42,8 @@
 	{ RLIM_INFINITY, RLIM_INFINITY },		\
 	{ RLIM_INFINITY, RLIM_INFINITY },		\
 	{ RLIM_INFINITY, RLIM_INFINITY },		\
+	{ MAX_SIGPENDING, MAX_SIGPENDING },		\
+	{ MQ_BYTES_MAX, MQ_BYTES_MAX },			\
 }
 
 #endif /* __KERNEL__ */
diff --git a/include/asm-parisc/setup.h b/include/asm-parisc/setup.h
index ae25cc427..7da2e5b87 100644
--- a/include/asm-parisc/setup.h
+++ b/include/asm-parisc/setup.h
@@ -1,10 +1,6 @@
-/*
- *	Just a place holder. We don't want to have to test x86 before
- *	we include stuff
- */
+#ifndef _PARISC_SETUP_H
+#define _PARISC_SETUP_H
 
-#ifndef _i386_SETUP_H
-#define _i386_SETUP_H
+#define COMMAND_LINE_SIZE	1024
 
-
-#endif /* _i386_SETUP_H */
+#endif /* _PARISC_SETUP_H */
diff --git a/include/asm-parisc/smp.h b/include/asm-parisc/smp.h
index 1efee5886..fde77ac35 100644
--- a/include/asm-parisc/smp.h
+++ b/include/asm-parisc/smp.h
@@ -52,11 +52,18 @@ extern void smp_send_reschedule(int cpu);
 extern unsigned long cpu_present_mask;
 
 #define smp_processor_id()	(current_thread_info()->cpu)
-#define cpu_online(cpu)		cpu_isset(cpu, cpu_online_map)
 
 #endif /* CONFIG_SMP */
 
 #define NO_PROC_ID		0xFF		/* No processor magic marker */
 #define ANY_PROC_ID		0xFF		/* Any processor magic marker */
+static inline int __cpu_disable (void) {
+  return 0;
+}
+static inline void __cpu_die (unsigned int cpu) {
+  while(1)
+    ;
+}
+extern int __cpu_up (unsigned int cpu);
 
 #endif /*  __ASM_SMP_H */
diff --git a/include/asm-parisc/spinlock.h b/include/asm-parisc/spinlock.h
index 1ad3aaa6d..7a2c25d47 100644
--- a/include/asm-parisc/spinlock.h
+++ b/include/asm-parisc/spinlock.h
@@ -8,8 +8,11 @@
  * the semaphore address has to be 16-byte aligned.
  */
 
+#ifndef CONFIG_DEBUG_SPINLOCK
+
+#define __SPIN_LOCK_UNLOCKED	{ { 1, 1, 1, 1 } }
 #undef SPIN_LOCK_UNLOCKED
-#define SPIN_LOCK_UNLOCKED (spinlock_t) { { 1, 1, 1, 1 } }
+#define SPIN_LOCK_UNLOCKED (spinlock_t) __SPIN_LOCK_UNLOCKED
 
 #define spin_lock_init(x)	do { *(x) = SPIN_LOCK_UNLOCKED; } while(0)
 
@@ -41,6 +44,83 @@ static inline int _raw_spin_trylock(spinlock_t *x)
 	return __ldcw(a) != 0;
 }
 	
+#define spin_lock_own(LOCK, LOCATION)	((void)0)
+
+#else /* !(CONFIG_DEBUG_SPINLOCK) */
+
+#define SPINLOCK_MAGIC	0x1D244B3C
+
+#define __SPIN_LOCK_UNLOCKED	{ { 1, 1, 1, 1 }, SPINLOCK_MAGIC, 10, __FILE__ , NULL, 0, -1, NULL, NULL }
+#undef SPIN_LOCK_UNLOCKED
+#define SPIN_LOCK_UNLOCKED (spinlock_t) __SPIN_LOCK_UNLOCKED
+
+#define spin_lock_init(x)	do { *(x) = SPIN_LOCK_UNLOCKED; } while(0)
+
+#define CHECK_LOCK(x)							\
+	do {								\
+	 	if (unlikely((x)->magic != SPINLOCK_MAGIC)) {			\
+			printk(KERN_ERR "%s:%d: spin_is_locked"		\
+			" on uninitialized spinlock %p.\n",		\
+				__FILE__, __LINE__, (x)); 		\
+		} 							\
+	} while(0)
+
+#define spin_is_locked(x)						\
+	({								\
+	 	CHECK_LOCK(x);						\
+		volatile unsigned int *a = __ldcw_align(x);		\
+		if (unlikely((*a == 0) && (x)->babble)) {				\
+			(x)->babble--;					\
+			printk("KERN_WARNING				\
+				%s:%d: spin_is_locked(%s/%p) already"	\
+				" locked by %s:%d in %s at %p(%d)\n",	\
+				__FILE__,__LINE__, (x)->module,	(x),	\
+				(x)->bfile, (x)->bline, (x)->task->comm,\
+				(x)->previous, (x)->oncpu);		\
+		}							\
+		*a == 0;						\
+	})
+
+#define spin_unlock_wait(x)						\
+	do {								\
+	 	CHECK_LOCK(x);						\
+		volatile unsigned int *a = __ldcw_align(x);		\
+		if (unlikely((*a == 0) && (x)->babble)) {				\
+			(x)->babble--;					\
+			printk("KERN_WARNING				\
+				%s:%d: spin_unlock_wait(%s/%p)"		\
+				" owned by %s:%d in %s at %p(%d)\n",	\
+				__FILE__,__LINE__, (x)->module, (x),	\
+				(x)->bfile, (x)->bline, (x)->task->comm,\
+				(x)->previous, (x)->oncpu);		\
+		}							\
+		barrier();						\
+	} while (*((volatile unsigned char *)(__ldcw_align(x))) == 0)
+
+extern void _dbg_spin_lock(spinlock_t *lock, const char *base_file, int line_no);
+extern void _dbg_spin_unlock(spinlock_t *lock, const char *, int);
+extern int _dbg_spin_trylock(spinlock_t * lock, const char *, int);
+
+#define _raw_spin_lock_flags(lock, flags) _raw_spin_lock(lock)
+
+#define _raw_spin_unlock(lock)	_dbg_spin_unlock(lock, __FILE__, __LINE__)
+#define _raw_spin_lock(lock) _dbg_spin_lock(lock, __FILE__, __LINE__)
+#define _raw_spin_trylock(lock) _dbg_spin_trylock(lock, __FILE__, __LINE__)
+
+/* just in case we need it */
+#define spin_lock_own(LOCK, LOCATION)					\
+do {									\
+	volatile unsigned int *a = __ldcw_align(LOCK);			\
+	if (!((*a == 0) && ((LOCK)->oncpu == smp_processor_id())))	\
+		printk("KERN_WARNING					\
+			%s: called on %d from %p but lock %s on %d\n",	\
+			LOCATION, smp_processor_id(),			\
+			__builtin_return_address(0),			\
+			(*a == 0) ? "taken" : "freed", (LOCK)->on_cpu);	\
+} while (0)
+
+#endif /* !(CONFIG_DEBUG_SPINLOCK) */
+
 /*
  * Read-write spinlocks, allowing multiple readers
  * but only one writer.
@@ -50,7 +130,7 @@ typedef struct {
 	volatile int counter;
 } rwlock_t;
 
-#define RW_LOCK_UNLOCKED (rwlock_t) { { { 1, 1, 1, 1 } }, 0 }
+#define RW_LOCK_UNLOCKED (rwlock_t) { __SPIN_LOCK_UNLOCKED, 0 }
 
 #define rwlock_init(lp)	do { *(lp) = RW_LOCK_UNLOCKED; } while (0)
 
@@ -59,6 +139,10 @@ typedef struct {
 /* read_lock, read_unlock are pretty straightforward.  Of course it somehow
  * sucks we end up saving/restoring flags twice for read_lock_irqsave aso. */
 
+#ifdef CONFIG_DEBUG_RWLOCK
+extern void _dbg_read_lock(rwlock_t * rw, const char *bfile, int bline);
+#define _raw_read_lock(rw) _dbg_read_lock(rw, __FILE__, __LINE__)
+#else
 static  __inline__ void _raw_read_lock(rwlock_t *rw)
 {
 	unsigned long flags;
@@ -70,6 +154,7 @@ static  __inline__ void _raw_read_lock(rwlock_t *rw)
 	_raw_spin_unlock(&rw->lock);
 	local_irq_restore(flags);
 }
+#endif	/* CONFIG_DEBUG_RWLOCK */
 
 static  __inline__ void _raw_read_unlock(rwlock_t *rw)
 {
@@ -92,6 +177,10 @@ static  __inline__ void _raw_read_unlock(rwlock_t *rw)
  * writers) in interrupt handlers someone fucked up and we'd dead-lock
  * sooner or later anyway.   prumpf */
 
+#ifdef CONFIG_DEBUG_RWLOCK
+extern void _dbg_write_lock(rwlock_t * rw, const char *bfile, int bline);
+#define _raw_write_lock(rw) _dbg_write_lock(rw, __FILE__, __LINE__)
+#else
 static  __inline__ void _raw_write_lock(rwlock_t *rw)
 {
 retry:
@@ -109,6 +198,7 @@ retry:
 	/* got it.  now leave without unlocking */
 	rw->counter = -1; /* remember we are locked */
 }
+#endif /* CONFIG_DEBUG_RWLOCK */
 
 /* write_unlock is absolutely trivial - we don't have to wait for anything */
 
diff --git a/include/asm-parisc/system.h b/include/asm-parisc/system.h
index d73c20d42..e2b84285d 100644
--- a/include/asm-parisc/system.h
+++ b/include/asm-parisc/system.h
@@ -166,6 +166,16 @@ static inline void set_eiem(unsigned long val)
 
 typedef struct {
 	volatile unsigned int lock[4];
+#ifdef CONFIG_DEBUG_SPINLOCK
+	unsigned long magic;
+	volatile unsigned int babble;
+	const char *module;
+	char *bfile;
+	int bline;
+	int oncpu;
+	void *previous;
+	struct task_struct * task;
+#endif
 } spinlock_t;
 
 #define __lock_aligned __attribute__((__section__(".data.lock_aligned")))
diff --git a/include/asm-parisc/thread_info.h b/include/asm-parisc/thread_info.h
index c709d0049..07c1a9f40 100644
--- a/include/asm-parisc/thread_info.h
+++ b/include/asm-parisc/thread_info.h
@@ -9,11 +9,11 @@
 struct thread_info {
 	struct task_struct *task;	/* main task structure */
 	struct exec_domain *exec_domain;/* execution domain */
-	__u32 flags;			/* thread_info flags (see TIF_*) */
-	__u32 cpu;			/* current CPU */
+	unsigned long flags;		/* thread_info flags (see TIF_*) */
 	mm_segment_t addr_limit;	/* user-level address space limit */
-	struct restart_block restart_block;
+	__u32 cpu;			/* current CPU */
 	__s32 preempt_count;		/* 0=premptable, <0=BUG; will also serve as bh-counter */
+	struct restart_block restart_block;
 };
 
 #define INIT_THREAD_INFO(tsk)			\
diff --git a/include/asm-parisc/unistd.h b/include/asm-parisc/unistd.h
index 1c827ff05..2a3434de2 100644
--- a/include/asm-parisc/unistd.h
+++ b/include/asm-parisc/unistd.h
@@ -960,9 +960,9 @@ static inline int close(int fd)
 	return sys_close(fd);
 }
 
-static inline int _exit(int exitcode)
+static inline void _exit(int exitcode)
 {
-	return sys_exit(exitcode);
+	sys_exit(exitcode);
 }
 
 static inline pid_t waitpid(pid_t pid, int *wait_stat, int options)
diff --git a/include/asm-parisc/unwind.h b/include/asm-parisc/unwind.h
index 5a52cb1f1..ff9396b01 100644
--- a/include/asm-parisc/unwind.h
+++ b/include/asm-parisc/unwind.h
@@ -50,22 +50,22 @@ struct unwind_table {
 };
 
 struct unwind_frame_info {
-	unsigned long sp;
-	unsigned long ip;
 	struct task_struct *t;
 	/* Eventually we would like to be able to get at any of the registers
 	   available; but for now we only try to get the sp and ip for each
 	   frame */
 	/* struct pt_regs regs; */
+	unsigned long sp, ip, rp;
 	unsigned long prev_sp, prev_ip;
 };
 
 void * unwind_table_add(const char *name, unsigned long base_addr, 
 		 unsigned long gp,
-                 const void *start, const void *end);
+                 void *start, void *end);
 void unwind_frame_init(struct unwind_frame_info *info, struct task_struct *t, 
-		       struct pt_regs *regs);
+		       unsigned long sp, unsigned long ip, unsigned long rp);
 void unwind_frame_init_from_blocked_task(struct unwind_frame_info *info, struct task_struct *t);
+void unwind_frame_init_running(struct unwind_frame_info *info, struct pt_regs *regs);
 int unwind_once(struct unwind_frame_info *info);
 int unwind_to_user(struct unwind_frame_info *info);
 
diff --git a/include/asm-ppc/checksum.h b/include/asm-ppc/checksum.h
index 231cb2b64..d98a93d82 100644
--- a/include/asm-ppc/checksum.h
+++ b/include/asm-ppc/checksum.h
@@ -33,11 +33,11 @@ extern unsigned int csum_partial_copy_generic(const char *src, char *dst,
 					      int *src_err, int *dst_err);
 
 #define csum_partial_copy_from_user(src, dst, len, sum, errp)	\
-	csum_partial_copy_generic((src), (dst), (len), (sum), (errp), 0)
+	csum_partial_copy_generic((src), (dst), (len), (sum), (errp), NULL)
 
 /* FIXME: this needs to be written to really do no check -- Cort */
 #define csum_partial_copy_nocheck(src, dst, len, sum)	\
-	csum_partial_copy_generic((src), (dst), (len), (sum), 0, 0)
+	csum_partial_copy_generic((src), (dst), (len), (sum), NULL, NULL)
 
 /*
  * turns a 32-bit partial checksum (e.g. from csum_partial) into a
diff --git a/include/asm-ppc/commproc.h b/include/asm-ppc/commproc.h
index 170095a88..5a58b9e03 100644
--- a/include/asm-ppc/commproc.h
+++ b/include/asm-ppc/commproc.h
@@ -62,13 +62,23 @@
 #define CPM_DATAONLY_SIZE	((uint)0x0700)
 #define CPM_DP_NOSPACE		((uint)0x7fffffff)
 
+static inline long IS_DPERR(const uint offset)
+{
+	return (uint)offset > (uint)-1000L;
+}
+
 /* Export the base address of the communication processor registers
  * and dual port ram.
  */
 extern	cpm8xx_t	*cpmp;		/* Pointer to comm processor */
-uint		m8xx_cpm_dpalloc(uint size);
+extern uint cpm_dpalloc(uint size, uint align);
+extern int cpm_dpfree(uint offset);
+extern uint cpm_dpalloc_fixed(uint offset, uint size, uint align);
+extern void cpm_dpdump(void);
+extern void *cpm_dpram_addr(uint offset);
+extern void cpm_setbrg(uint brg, uint rate);
+
 uint		m8xx_cpm_hostalloc(uint size);
-void		m8xx_cpm_setbrg(uint brg, uint rate);
 
 /* Buffer descriptors used by many of the CPM protocols.
 */
diff --git a/include/asm-ppc/cpm2.h b/include/asm-ppc/cpm2.h
index dc899d3b5..2957e796b 100644
--- a/include/asm-ppc/cpm2.h
+++ b/include/asm-ppc/cpm2.h
@@ -99,18 +99,21 @@
  */
 #define NUM_CPM_HOST_PAGES	2
 
+static inline long IS_DPERR(const uint offset)
+{
+	return (uint)offset > (uint)-1000L;
+}
 
 /* Export the base address of the communication processor registers
  * and dual port ram.
  */
 extern		cpm_cpm2_t	*cpmp;	 /* Pointer to comm processor */
-extern void *cpm2_dpalloc(uint size, uint align);
-extern int cpm2_dpfree(void *addr);
-extern void *cpm2_dpalloc_fixed(void *addr, uint size, uint allign);
-extern void cpm2_dpdump(void);
-extern unsigned int cpm2_dpram_offset(void *addr);
-extern void *cpm2_dpram_addr(int offset);
-extern void cpm2_setbrg(uint brg, uint rate);
+extern uint cpm_dpalloc(uint size, uint align);
+extern int cpm_dpfree(uint offset);
+extern uint cpm_dpalloc_fixed(uint offset, uint size, uint align);
+extern void cpm_dpdump(void);
+extern void *cpm_dpram_addr(uint offset);
+extern void cpm_setbrg(uint brg, uint rate);
 extern void cpm2_fastbrg(uint brg, uint rate, int div16);
 
 /* Buffer descriptors used by many of the CPM protocols.
diff --git a/include/asm-ppc/cputable.h b/include/asm-ppc/cputable.h
index 4c07a0cac..fcdb87db3 100644
--- a/include/asm-ppc/cputable.h
+++ b/include/asm-ppc/cputable.h
@@ -76,6 +76,7 @@ extern struct cpu_spec		*cur_cpu_spec[];
 #define CPU_FTR_NO_DPM			0x00008000
 #define CPU_FTR_HAS_HIGH_BATS		0x00010000
 #define CPU_FTR_NEED_COHERENT           0x00020000
+#define CPU_FTR_NO_BTIC			0x00040000
 
 #ifdef __ASSEMBLY__
 
diff --git a/include/asm-ppc/elf.h b/include/asm-ppc/elf.h
index 174fb0c35..2c056966e 100644
--- a/include/asm-ppc/elf.h
+++ b/include/asm-ppc/elf.h
@@ -52,6 +52,7 @@
 #define ELF_NGREG	48	/* includes nip, msr, lr, etc. */
 #define ELF_NFPREG	33	/* includes fpscr */
 #define ELF_NVRREG	33	/* includes vscr */
+#define ELF_NEVRREG	34	/* includes acc (as 2) */
 
 /*
  * These are used to set parameters in the core dumps.
diff --git a/include/asm-ppc/fcntl.h b/include/asm-ppc/fcntl.h
index 27ae7d2f6..5e28e41fb 100644
--- a/include/asm-ppc/fcntl.h
+++ b/include/asm-ppc/fcntl.h
@@ -20,6 +20,7 @@
 #define O_NOFOLLOW      0100000	/* don't follow links */
 #define O_LARGEFILE     0200000
 #define O_DIRECT	0400000	/* direct disk access hint */
+#define O_NOATIME	01000000
 
 #define F_DUPFD		0	/* dup */
 #define F_GETFD		1	/* get close_on_exec */
diff --git a/include/asm-ppc/highmem.h b/include/asm-ppc/highmem.h
index aa3e74516..928f8447a 100644
--- a/include/asm-ppc/highmem.h
+++ b/include/asm-ppc/highmem.h
@@ -91,7 +91,7 @@ static inline void *kmap_atomic(struct page *page, enum km_type type)
 	BUG_ON(!pte_none(*(kmap_pte+idx)));
 #endif
 	set_pte(kmap_pte+idx, mk_pte(page, kmap_prot));
-	flush_tlb_page(0, vaddr);
+	flush_tlb_page(NULL, vaddr);
 
 	return (void*) vaddr;
 }
@@ -115,7 +115,7 @@ static inline void kunmap_atomic(void *kvaddr, enum km_type type)
 	 * this pte without first remap it
 	 */
 	pte_clear(kmap_pte+idx);
-	flush_tlb_page(0, vaddr);
+	flush_tlb_page(NULL, vaddr);
 #endif
 	dec_preempt_count();
 	preempt_check_resched();
diff --git a/include/asm-ppc/io.h b/include/asm-ppc/io.h
index 9cc9d5f99..a893418be 100644
--- a/include/asm-ppc/io.h
+++ b/include/asm-ppc/io.h
@@ -30,6 +30,8 @@
 #include <asm/mpc8xx.h>
 #elif defined(CONFIG_8260)
 #include <asm/mpc8260.h>
+#elif defined(CONFIG_85xx)
+#include <asm/mpc85xx.h>
 #elif defined(CONFIG_APUS)
 #define _IO_BASE	0
 #define _ISA_MEM_BASE	0
@@ -138,18 +140,27 @@ extern __inline__ void name(unsigned int val, unsigned int port) \
 		: : "r" (val), "r" (port + _IO_BASE));	\
 }
 
-__do_in_asm(inb, "lbzx")
 __do_out_asm(outb, "stbx")
 #ifdef CONFIG_APUS
+__do_in_asm(inb, "lbzx")
 __do_in_asm(inw, "lhz%U1%X1")
 __do_in_asm(inl, "lwz%U1%X1")
 __do_out_asm(outl,"stw%U0%X0")
 __do_out_asm(outw, "sth%U0%X0")
+#elif defined (CONFIG_8260_PCI9)
+/* in asm cannot be defined if PCI9 workaround is used */
+#define inb(port)		in_8((u8 *)((port)+_IO_BASE))
+#define inw(port)		in_le16((u16 *)((port)+_IO_BASE))
+#define inl(port)		in_le32((u32 *)((port)+_IO_BASE))
+__do_out_asm(outw, "sthbrx")
+__do_out_asm(outl, "stwbrx")
 #else
+__do_in_asm(inb, "lbzx")
 __do_in_asm(inw, "lhbrx")
 __do_in_asm(inl, "lwbrx")
 __do_out_asm(outw, "sthbrx")
 __do_out_asm(outl, "stwbrx")
+
 #endif
 
 #define inb_p(port)		inb((port))
@@ -226,7 +237,7 @@ extern inline void * bus_to_virt(unsigned long address)
 {
 #ifndef CONFIG_APUS
         if (address == 0)
-		return 0;
+		return NULL;
         return (void *)(address - PCI_DRAM_OFFSET + KERNELBASE);
 #else
 	return (void*) mm_ptov (address);
@@ -389,4 +400,9 @@ static inline int isa_check_signature(unsigned long io_addr,
 }
 
 #endif /* _PPC_IO_H */
+
+#ifdef CONFIG_8260_PCI9
+#include <asm/mpc8260_pci9.h>
+#endif
+
 #endif /* __KERNEL__ */
diff --git a/include/asm-ppc/irq.h b/include/asm-ppc/irq.h
index df5b76306..54dddea83 100644
--- a/include/asm-ppc/irq.h
+++ b/include/asm-ppc/irq.h
@@ -153,6 +153,79 @@ static __inline__ int irq_canonicalize(int irq)
 	return irq;
 }
 
+#elif defined(CONFIG_CPM2) && defined(CONFIG_85xx)
+/* Now include the board configuration specific associations.
+*/
+#include <asm/mpc85xx.h>
+
+/* The MPC8560 openpic has  32 internal interrupts and 12 external
+ * interrupts.
+ *
+ * We are "flattening" the interrupt vectors of the cascaded CPM
+ * so that we can uniquely identify any interrupt source with a
+ * single integer.
+ */
+#define NR_CPM_INTS	64
+#define NR_EPIC_INTS	44
+#ifndef NR_8259_INTS
+#define NR_8259_INTS 0
+#endif
+#define NUM_8259_INTERRUPTS NR_8259_INTS
+
+#ifndef CPM_IRQ_OFFSET
+#define CPM_IRQ_OFFSET	0
+#endif
+
+#define NR_IRQS	(NR_EPIC_INTS + NR_CPM_INTS + NR_8259_INTS)
+
+/* These values must be zero-based and map 1:1 with the EPIC configuration.
+ * They are used throughout the 8560 I/O subsystem to generate
+ * interrupt masks, flags, and other control patterns.  This is why the
+ * current kernel assumption of the 8259 as the base controller is such
+ * a pain in the butt.
+ */
+
+#define	SIU_INT_ERROR		((uint)0x00+CPM_IRQ_OFFSET)
+#define	SIU_INT_I2C		((uint)0x01+CPM_IRQ_OFFSET)
+#define	SIU_INT_SPI		((uint)0x02+CPM_IRQ_OFFSET)
+#define	SIU_INT_RISC		((uint)0x03+CPM_IRQ_OFFSET)
+#define	SIU_INT_SMC1		((uint)0x04+CPM_IRQ_OFFSET)
+#define	SIU_INT_SMC2		((uint)0x05+CPM_IRQ_OFFSET)
+#define	SIU_INT_TIMER1		((uint)0x0c+CPM_IRQ_OFFSET)
+#define	SIU_INT_TIMER2		((uint)0x0d+CPM_IRQ_OFFSET)
+#define	SIU_INT_TIMER3		((uint)0x0e+CPM_IRQ_OFFSET)
+#define	SIU_INT_TIMER4		((uint)0x0f+CPM_IRQ_OFFSET)
+#define	SIU_INT_FCC1		((uint)0x20+CPM_IRQ_OFFSET)
+#define	SIU_INT_FCC2		((uint)0x21+CPM_IRQ_OFFSET)
+#define	SIU_INT_FCC3		((uint)0x22+CPM_IRQ_OFFSET)
+#define	SIU_INT_MCC1		((uint)0x24+CPM_IRQ_OFFSET)
+#define	SIU_INT_MCC2		((uint)0x25+CPM_IRQ_OFFSET)
+#define	SIU_INT_SCC1		((uint)0x28+CPM_IRQ_OFFSET)
+#define	SIU_INT_SCC2		((uint)0x29+CPM_IRQ_OFFSET)
+#define	SIU_INT_SCC3		((uint)0x2a+CPM_IRQ_OFFSET)
+#define	SIU_INT_SCC4		((uint)0x2b+CPM_IRQ_OFFSET)
+#define	SIU_INT_PC15		((uint)0x30+CPM_IRQ_OFFSET)
+#define	SIU_INT_PC14		((uint)0x31+CPM_IRQ_OFFSET)
+#define	SIU_INT_PC13		((uint)0x32+CPM_IRQ_OFFSET)
+#define	SIU_INT_PC12		((uint)0x33+CPM_IRQ_OFFSET)
+#define	SIU_INT_PC11		((uint)0x34+CPM_IRQ_OFFSET)
+#define	SIU_INT_PC10		((uint)0x35+CPM_IRQ_OFFSET)
+#define	SIU_INT_PC9		((uint)0x36+CPM_IRQ_OFFSET)
+#define	SIU_INT_PC8		((uint)0x37+CPM_IRQ_OFFSET)
+#define	SIU_INT_PC7		((uint)0x38+CPM_IRQ_OFFSET)
+#define	SIU_INT_PC6		((uint)0x39+CPM_IRQ_OFFSET)
+#define	SIU_INT_PC5		((uint)0x3a+CPM_IRQ_OFFSET)
+#define	SIU_INT_PC4		((uint)0x3b+CPM_IRQ_OFFSET)
+#define	SIU_INT_PC3		((uint)0x3c+CPM_IRQ_OFFSET)
+#define	SIU_INT_PC2		((uint)0x3d+CPM_IRQ_OFFSET)
+#define	SIU_INT_PC1		((uint)0x3e+CPM_IRQ_OFFSET)
+#define	SIU_INT_PC0		((uint)0x3f+CPM_IRQ_OFFSET)
+
+static __inline__ int irq_canonicalize(int irq)
+{
+	return irq;
+}
+
 #else /* CONFIG_40x + CONFIG_8xx */
 /*
  * this is the # irq's for all ppc arch's (pmac/chrp/prep)
@@ -177,17 +250,55 @@ static __inline__ int irq_canonicalize(int irq)
  */
 #define NR_SIU_INTS	64
 
-/* There are many more than these, we will add them as we need them.
-*/
+#define	SIU_INT_ERROR		((uint)0x00)
+#define	SIU_INT_I2C		((uint)0x01)
+#define	SIU_INT_SPI		((uint)0x02)
+#define	SIU_INT_RISC		((uint)0x03)
 #define	SIU_INT_SMC1		((uint)0x04)
 #define	SIU_INT_SMC2		((uint)0x05)
+#define	SIU_INT_IDMA1		((uint)0x06)
+#define	SIU_INT_IDMA2		((uint)0x07)
+#define	SIU_INT_IDMA3		((uint)0x08)
+#define	SIU_INT_IDMA4		((uint)0x09)
+#define	SIU_INT_SDMA		((uint)0x0a)
+#define	SIU_INT_TIMER1		((uint)0x0c)
+#define	SIU_INT_TIMER2		((uint)0x0d)
+#define	SIU_INT_TIMER3		((uint)0x0e)
+#define	SIU_INT_TIMER4		((uint)0x0f)
+#define	SIU_INT_TMCNT		((uint)0x10)
+#define	SIU_INT_PIT		((uint)0x11)
+#define	SIU_INT_IRQ1		((uint)0x13)
+#define	SIU_INT_IRQ2		((uint)0x14)
+#define	SIU_INT_IRQ3		((uint)0x15)
+#define	SIU_INT_IRQ4		((uint)0x16)
+#define	SIU_INT_IRQ5		((uint)0x17)
+#define	SIU_INT_IRQ6		((uint)0x18)
+#define	SIU_INT_IRQ7		((uint)0x19)
 #define	SIU_INT_FCC1		((uint)0x20)
 #define	SIU_INT_FCC2		((uint)0x21)
 #define	SIU_INT_FCC3		((uint)0x22)
+#define	SIU_INT_MCC1		((uint)0x24)
+#define	SIU_INT_MCC2		((uint)0x25)
 #define	SIU_INT_SCC1		((uint)0x28)
 #define	SIU_INT_SCC2		((uint)0x29)
 #define	SIU_INT_SCC3		((uint)0x2a)
 #define	SIU_INT_SCC4		((uint)0x2b)
+#define	SIU_INT_PC15		((uint)0x30)
+#define	SIU_INT_PC14		((uint)0x31)
+#define	SIU_INT_PC13		((uint)0x32)
+#define	SIU_INT_PC12		((uint)0x33)
+#define	SIU_INT_PC11		((uint)0x34)
+#define	SIU_INT_PC10		((uint)0x35)
+#define	SIU_INT_PC9		((uint)0x36)
+#define	SIU_INT_PC8		((uint)0x37)
+#define	SIU_INT_PC7		((uint)0x38)
+#define	SIU_INT_PC6		((uint)0x39)
+#define	SIU_INT_PC5		((uint)0x3a)
+#define	SIU_INT_PC4		((uint)0x3b)
+#define	SIU_INT_PC3		((uint)0x3c)
+#define	SIU_INT_PC2		((uint)0x3d)
+#define	SIU_INT_PC1		((uint)0x3e)
+#define	SIU_INT_PC0		((uint)0x3f)
 
 #endif /* CONFIG_8260 */
 
diff --git a/include/asm-ppc/machdep.h b/include/asm-ppc/machdep.h
index 4ace72fc4..b1c0bb787 100644
--- a/include/asm-ppc/machdep.h
+++ b/include/asm-ppc/machdep.h
@@ -5,6 +5,8 @@
 #include <linux/config.h>
 #include <linux/init.h>
 
+#include <asm/setup.h>
+
 #ifdef CONFIG_APUS
 #include <asm-m68k/machdep.h>
 #endif
@@ -106,7 +108,6 @@ struct machdep_calls {
 };
 
 extern struct machdep_calls ppc_md;
-#define COMMAND_LINE_SIZE 512
 extern char cmd_line[COMMAND_LINE_SIZE];
 
 extern void setup_pci_ptrs(void);
diff --git a/include/asm-ppc/mmu.h b/include/asm-ppc/mmu.h
index 5797fd1cf..7bf3a4d36 100644
--- a/include/asm-ppc/mmu.h
+++ b/include/asm-ppc/mmu.h
@@ -379,6 +379,74 @@ typedef struct _P601_BAT {
 #define PPC44x_TLB_SW		0x00000002      /* Super write */
 #define PPC44x_TLB_SR		0x00000001      /* Super read */
 
+/* Book-E defined page sizes */
+#define BOOKE_PAGESZ_1K		0
+#define BOOKE_PAGESZ_4K		1
+#define BOOKE_PAGESZ_16K	2
+#define BOOKE_PAGESZ_64K	3
+#define BOOKE_PAGESZ_256K	4
+#define BOOKE_PAGESZ_1M		5
+#define BOOKE_PAGESZ_4M		6
+#define BOOKE_PAGESZ_16M	7
+#define BOOKE_PAGESZ_64M	8
+#define BOOKE_PAGESZ_256M	9
+#define BOOKE_PAGESZ_1GB	10
+#define BOOKE_PAGESZ_4GB	11
+#define BOOKE_PAGESZ_16GB	12
+#define BOOKE_PAGESZ_64GB	13
+#define BOOKE_PAGESZ_256GB	14
+#define BOOKE_PAGESZ_1TB	15
+
+/*
+ * Freescale Book-E MMU support
+ */
+
+#define MAS0_TLBSEL	0x10000000
+#define MAS0_ESEL	0x000F0000
+#define MAS0_NV		0x00000001
+
+#define MAS1_VALID 	0x80000000
+#define MAS1_IPROT	0x40000000
+#define MAS1_TID 	0x03FF0000
+#define MAS1_TS		0x00001000
+#define MAS1_TSIZE(x)	(x << 8)
+
+#define MAS2_EPN	0xFFFFF000
+#define MAS2_SHAREN	0x00000200
+#define MAS2_X0		0x00000040
+#define MAS2_X1		0x00000020
+#define MAS2_W		0x00000010
+#define MAS2_I		0x00000008
+#define MAS2_M		0x00000004
+#define MAS2_G		0x00000002
+#define MAS2_E		0x00000001
+
+#define MAS3_RPN	0xFFFFF000
+#define MAS3_U0		0x00000200
+#define MAS3_U1		0x00000100
+#define MAS3_U2		0x00000080
+#define MAS3_U3		0x00000040
+#define MAS3_UX		0x00000020
+#define MAS3_SX		0x00000010
+#define MAS3_UW		0x00000008
+#define MAS3_SW		0x00000004
+#define MAS3_UR		0x00000002
+#define MAS3_SR		0x00000001
+
+#define MAS4_TLBSELD	0x10000000
+#define MAS4_TIDDSEL	0x00030000
+#define MAS4_DSHAREN	0x00001000
+#define MAS4_TSIZED(x)	(x << 8)
+#define MAS4_X0D	0x00000040
+#define MAS4_X1D	0x00000020
+#define MAS4_WD		0x00000010
+#define MAS4_ID		0x00000008
+#define MAS4_MD		0x00000004
+#define MAS4_GD		0x00000002
+#define MAS4_ED		0x00000001
+
+#define MAS6_SPID	0x00FF0000
+#define MAS6_SAS	0x00000001
 
 #endif /* _PPC_MMU_H_ */
 #endif /* __KERNEL__ */
diff --git a/include/asm-ppc/mmu_context.h b/include/asm-ppc/mmu_context.h
index ff1883f79..9222fa6ca 100644
--- a/include/asm-ppc/mmu_context.h
+++ b/include/asm-ppc/mmu_context.h
@@ -63,6 +63,11 @@ static inline void enter_lazy_tlb(struct mm_struct *mm, struct task_struct *tsk)
 #define LAST_CONTEXT    	255
 #define FIRST_CONTEXT    	1
 
+#elif defined(CONFIG_E500)
+#define NO_CONTEXT      	256
+#define LAST_CONTEXT    	255
+#define FIRST_CONTEXT    	1
+
 #else
 
 /* PPC 6xx, 7xx CPUs */
diff --git a/include/asm-ppc/mpc10x.h b/include/asm-ppc/mpc10x.h
index f413daf79..dbdc7cd29 100644
--- a/include/asm-ppc/mpc10x.h
+++ b/include/asm-ppc/mpc10x.h
@@ -164,4 +164,7 @@ unsigned long mpc10x_get_mem_size(uint mem_map);
 int mpc10x_enable_store_gathering(struct pci_controller *hose);
 int mpc10x_disable_store_gathering(struct pci_controller *hose);
 
+/* For MPC107 boards that use the built-in openpic */
+void mpc10x_set_openpic(void);
+
 #endif	/* __PPC_KERNEL_MPC10X_H */
diff --git a/include/asm-ppc/mpc8260.h b/include/asm-ppc/mpc8260.h
index 213b0a702..61b6a191a 100644
--- a/include/asm-ppc/mpc8260.h
+++ b/include/asm-ppc/mpc8260.h
@@ -24,8 +24,8 @@
 #include <platforms/sbs8260.h>
 #endif
 
-#ifdef CONFIG_RPX6
-#include <platforms/rpxsuper.h>
+#ifdef CONFIG_RPX8260
+#include <platforms/rpx8260.h>
 #endif
 
 #ifdef CONFIG_WILLOW
@@ -36,6 +36,10 @@
 #include <platforms/tqm8260.h>
 #endif
 
+#ifdef CONFIG_PQ2ADS
+#include <platforms/pq2ads.h>
+#endif
+
 /* Make sure the memory translation stuff is there if PCI not used.
  */
 #ifndef _IO_BASE
diff --git a/include/asm-ppc/mpc85xx.h b/include/asm-ppc/mpc85xx.h
index 276a81706..d3be23538 100644
--- a/include/asm-ppc/mpc85xx.h
+++ b/include/asm-ppc/mpc85xx.h
@@ -25,10 +25,23 @@
 #ifdef CONFIG_MPC8540_ADS
 #include <platforms/85xx/mpc8540_ads.h>
 #endif
+#ifdef CONFIG_MPC8555_CDS
+#include <platforms/85xx/mpc8555_cds.h>
+#endif
+#ifdef CONFIG_MPC8560_ADS
+#include <platforms/85xx/mpc8560_ads.h>
+#endif
+#ifdef CONFIG_SBC8560
+#include <platforms/85xx/sbc8560.h>
+#endif
 
 #define _IO_BASE        isa_io_base
 #define _ISA_MEM_BASE   isa_mem_base
+#ifdef CONFIG_PCI
 #define PCI_DRAM_OFFSET pci_dram_offset
+#else
+#define PCI_DRAM_OFFSET 0
+#endif
 
 /*
  * The "residual" board information structure the boot loader passes
diff --git a/include/asm-ppc/ocp.h b/include/asm-ppc/ocp.h
index 3d735b9e9..5ea44cabf 100644
--- a/include/asm-ppc/ocp.h
+++ b/include/asm-ppc/ocp.h
@@ -202,6 +202,10 @@ static DEVICE_ATTR(name##_##field, S_IRUGO, show_##name##_##field, NULL);
 #include <asm/ibm_ocp.h>
 #endif
 
+#ifdef CONFIG_FSL_OCP
+#include <asm/fsl_ocp.h>
+#endif
+
 #endif				/* CONFIG_PPC_OCP */
 #endif				/* __OCP_H__ */
 #endif				/* __KERNEL__ */
diff --git a/include/asm-ppc/ocp_ids.h b/include/asm-ppc/ocp_ids.h
index da5ad07ab..91be19d2d 100644
--- a/include/asm-ppc/ocp_ids.h
+++ b/include/asm-ppc/ocp_ids.h
@@ -42,9 +42,11 @@
 #define OCP_FUNC_16550		0x0031
 #define OCP_FUNC_IIC		0x0032
 #define OCP_FUNC_USB		0x0033
+#define OCP_FUNC_PSC_UART	0x0034
 
 /* Memory devices 0x0090 - 0x009F */
 #define OCP_FUNC_MAL		0x0090
+#define OCP_FUNC_DMA		0x0091
 
 /* Display 0x00A0 - 0x00AF */
 
@@ -62,7 +64,7 @@
 
 /* Network 0x0200 - 0x02FF */
 #define OCP_FUNC_EMAC		0x0200
-#define OCP_FUNC_ENET		0x0201	/* TSEC & FEC */
+#define OCP_FUNC_GFAR		0x0201	/* TSEC & FEC */
 
 /* Bridge devices 0xE00 - 0xEFF */
 #define OCP_FUNC_OPB		0x0E00
diff --git a/include/asm-ppc/open_pic.h b/include/asm-ppc/open_pic.h
index df14f8650..38d8edb1b 100644
--- a/include/asm-ppc/open_pic.h
+++ b/include/asm-ppc/open_pic.h
@@ -50,7 +50,7 @@ extern void do_openpic_setup_cpu(void);
 extern int openpic_get_irq(struct pt_regs *regs);
 extern void openpic_reset_processor_phys(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 openpic_cause_IPI(u_int ipi, cpumask_t cpumask);
 extern void smp_openpic_message_pass(int target, int msg, unsigned long data,
 				     int wait);
 extern void openpic_set_k2_cascade(int irq);
diff --git a/include/asm-ppc/pgtable.h b/include/asm-ppc/pgtable.h
index 01256bda1..5effe3d09 100644
--- a/include/asm-ppc/pgtable.h
+++ b/include/asm-ppc/pgtable.h
@@ -222,6 +222,43 @@ extern unsigned long ioremap_bot, ioremap_base;
 /* ERPN in a PTE never gets cleared, ignore it */
 #define _PTE_NONE_MASK	0xffffffff00000000ULL
 
+#elif defined(CONFIG_E500)
+
+/*
+   MMU Assist Register 3:
+
+   32 33 34 35 36  ... 50 51 52 53 54 55 56 57 58 59 60 61 62 63
+   RPN......................  0  0 U0 U1 U2 U3 UX SX UW SW UR SR
+
+   - PRESENT *must* be in the bottom three bits because swap cache
+     entries use the top 29 bits.
+
+   - FILE *must* be in the bottom three bits because swap cache
+     entries use the top 29 bits.
+*/
+
+/* Definitions for e500 core */
+#define _PAGE_PRESENT	0x001	/* S: PTE contains a translation */
+#define _PAGE_USER	0x002	/* S: User page (maps to UR) */
+#define _PAGE_FILE	0x002	/* S: when !present: nonlinear file mapping */
+#define _PAGE_ACCESSED	0x004	/* S: Page referenced */
+#define _PAGE_HWWRITE	0x008	/* H: Dirty & RW, set in exception */
+#define _PAGE_RW	0x010	/* S: Write permission */
+#define _PAGE_HWEXEC	0x020	/* H: UX permission */
+
+#define _PAGE_ENDIAN	0x040	/* H: E bit */
+#define _PAGE_GUARDED	0x080	/* H: G bit */
+#define _PAGE_COHERENT	0x100	/* H: M bit */
+#define _PAGE_NO_CACHE	0x200	/* H: I bit */
+#define _PAGE_WRITETHRU	0x400	/* H: W bit */
+#define _PAGE_DIRTY	0x800	/* S: Page dirty */
+
+#define _PMD_PRESENT	0
+#define _PMD_PRESENT_MASK (PAGE_MASK)
+#define _PMD_BAD	(~PAGE_MASK)
+
+#define NUM_TLBCAMS	(16)
+
 #elif defined(CONFIG_8xx)
 /* Definitions for 8xx embedded chips. */
 #define _PAGE_PRESENT	0x0001	/* Page is valid */
diff --git a/include/asm-ppc/pmac_feature.h b/include/asm-ppc/pmac_feature.h
index 11065e368..ee15e9c59 100644
--- a/include/asm-ppc/pmac_feature.h
+++ b/include/asm-ppc/pmac_feature.h
@@ -273,6 +273,12 @@ static inline long pmac_call_feature(int selector, struct device_node* node,
  */
 #define PMAC_FTR_ENABLE_MPIC		PMAC_FTR_DEF(19)
 
+/* PMAC_FTR_AACK_DELAY_ENABLE	(NULL, int enable, 0)
+ *
+ * Enable/disable the AACK delay on the northbridge for systems using DFS
+ */
+#define PMAC_FTR_AACK_DELAY_ENABLE     	PMAC_FTR_DEF(20)
+
 
 /* Don't use those directly, they are for the sake of pmac_setup.c */
 extern long pmac_do_feature_call(unsigned int selector, ...);
diff --git a/include/asm-ppc/ppc_asm.h b/include/asm-ppc/ppc_asm.h
index c8de15c77..13fa8e748 100644
--- a/include/asm-ppc/ppc_asm.h
+++ b/include/asm-ppc/ppc_asm.h
@@ -59,6 +59,20 @@
 #define REST_16VR(n,b,base)	REST_8VR(n,b,base); REST_8VR(n+8,b,base)
 #define REST_32VR(n,b,base)	REST_16VR(n,b,base); REST_16VR(n+16,b,base)
 
+#define SAVE_EVR(n,s,base)	evmergehi s,s,n; stw s,THREAD_EVR0+4*(n)(base)
+#define SAVE_2EVR(n,s,base)	SAVE_EVR(n,s,base); SAVE_EVR(n+1,s,base)
+#define SAVE_4EVR(n,s,base)	SAVE_2EVR(n,s,base); SAVE_2EVR(n+2,s,base)
+#define SAVE_8EVR(n,s,base)	SAVE_4EVR(n,s,base); SAVE_4EVR(n+4,s,base)
+#define SAVE_16EVR(n,s,base)	SAVE_8EVR(n,s,base); SAVE_8EVR(n+8,s,base)
+#define SAVE_32EVR(n,s,base)	SAVE_16EVR(n,s,base); SAVE_16EVR(n+16,s,base)
+
+#define REST_EVR(n,s,base)	lwz s,THREAD_EVR0+4*(n)(base); evmergelo n,s,n
+#define REST_2EVR(n,s,base)	REST_EVR(n,s,base); REST_EVR(n+1,s,base)
+#define REST_4EVR(n,s,base)	REST_2EVR(n,s,base); REST_2EVR(n+2,s,base)
+#define REST_8EVR(n,s,base)	REST_4EVR(n,s,base); REST_4EVR(n+4,s,base)
+#define REST_16EVR(n,s,base)	REST_8EVR(n,s,base); REST_8EVR(n+8,s,base)
+#define REST_32EVR(n,s,base)	REST_16EVR(n,s,base); REST_16EVR(n+16,s,base)
+
 #ifdef CONFIG_PPC601_SYNC_FIX
 #define SYNC				\
 BEGIN_FTR_SECTION			\
@@ -107,7 +121,14 @@ END_FTR_SECTION_IFCLR(CPU_FTR_601)
 	bdnz	0b
 #endif
 
-#if !defined(CONFIG_44x)
+#ifdef CONFIG_BOOKE
+#define tophys(rd,rs)				\
+	addis	rd,rs,0
+
+#define tovirt(rd,rs)				\
+	addis	rd,rs,0
+
+#else  /* CONFIG_BOOKE */
 /*
  * On APUS (Amiga PowerPC cpu upgrade board), we don't know the
  * physical base address of RAM at compile time.
@@ -125,15 +146,7 @@ END_FTR_SECTION_IFCLR(CPU_FTR_601)
 	.align  1;				\
 	.long   0b;				\
 	.previous
-#else  /* CONFIG_44x */
-
-#define tophys(rd,rs)				\
-	mr	rd,rs
-
-#define tovirt(rd,rs)				\
-	mr	rd,rs
-
-#endif /* CONFIG_44x */
+#endif  /* CONFIG_BOOKE */
 
 /*
  * On 64-bit cpus, we use the rfid instruction instead of rfi, but
@@ -289,6 +302,39 @@ END_FTR_SECTION_IFCLR(CPU_FTR_601)
 #define	vr30	30
 #define	vr31	31
 
+#define	evr0	0
+#define	evr1	1
+#define	evr2	2
+#define	evr3	3
+#define	evr4	4
+#define	evr5	5
+#define	evr6	6
+#define	evr7	7
+#define	evr8	8
+#define	evr9	9
+#define	evr10	10
+#define	evr11	11
+#define	evr12	12
+#define	evr13	13
+#define	evr14	14
+#define	evr15	15
+#define	evr16	16
+#define	evr17	17
+#define	evr18	18
+#define	evr19	19
+#define	evr20	20
+#define	evr21	21
+#define	evr22	22
+#define	evr23	23
+#define	evr24	24
+#define	evr25	25
+#define	evr26	26
+#define	evr27	27
+#define	evr28	28
+#define	evr29	29
+#define	evr30	30
+#define	evr31	31
+
 /* some stab codes */
 #define N_FUN	36
 #define N_RSYM	64
diff --git a/include/asm-ppc/ppcboot.h b/include/asm-ppc/ppcboot.h
index bccb6e385..ca2c16b8c 100644
--- a/include/asm-ppc/ppcboot.h
+++ b/include/asm-ppc/ppcboot.h
@@ -52,8 +52,11 @@ typedef struct bd_info {
 	unsigned long	bi_flashoffset; /* reserved area for startup monitor */
 	unsigned long	bi_sramstart;	/* start of SRAM memory */
 	unsigned long	bi_sramsize;	/* size	 of SRAM memory */
-#if defined(CONFIG_8xx) || defined(CONFIG_8260)
+#if defined(CONFIG_8xx) || defined(CONFIG_CPM2) || defined(CONFIG_85xx)
 	unsigned long	bi_immr_base;	/* base of IMMR register */
+#endif
+#if defined(CONFIG_PPC_MPC52xx)
+	unsigned long   bi_mbar_base;   /* base of internal registers */
 #endif
 	unsigned long	bi_bootflags;	/* boot / reboot flag (for LynxOS) */
 	unsigned long	bi_ip_addr;	/* IP Address */
@@ -61,11 +64,15 @@ typedef struct bd_info {
 	unsigned short	bi_ethspeed;	/* Ethernet speed in Mbps */
 	unsigned long	bi_intfreq;	/* Internal Freq, in MHz */
 	unsigned long	bi_busfreq;	/* Bus Freq, in MHz */
-#if defined(CONFIG_8260)
+#if defined(CONFIG_CPM2)
 	unsigned long	bi_cpmfreq;	/* CPM_CLK Freq, in MHz */
 	unsigned long	bi_brgfreq;	/* BRG_CLK Freq, in MHz */
 	unsigned long	bi_sccfreq;	/* SCC_CLK Freq, in MHz */
 	unsigned long	bi_vco;		/* VCO Out from PLL, in MHz */
+#endif
+#if defined(CONFIG_PPC_MPC52xx)
+	unsigned long   bi_ipbfreq;     /* IPB Bus Freq, in MHz */
+	unsigned long   bi_pcifreq;     /* PCI Bus Freq, in MHz */
 #endif
 	unsigned long	bi_baudrate;	/* Console Baudrate */
 #if defined(CONFIG_405GP)
@@ -79,7 +86,7 @@ typedef struct bd_info {
 #if defined(CONFIG_HYMOD)
 	hymod_conf_t	bi_hymod_conf;	/* hymod configuration information */
 #endif
-#if defined(CONFIG_EVB64260)
+#if defined(CONFIG_EVB64260) || defined(CONFIG_85xx)
 	/* the board has three onboard ethernet ports */
 	unsigned char	bi_enet1addr[6];
 	unsigned char	bi_enet2addr[6];
diff --git a/include/asm-ppc/processor.h b/include/asm-ppc/processor.h
index 0439ec643..63fc68e78 100644
--- a/include/asm-ppc/processor.h
+++ b/include/asm-ppc/processor.h
@@ -40,6 +40,14 @@
 	.globl n;\
 n:
 
+/*
+ * this is the minimum allowable io space due to the location
+ * of the io areas on prep (first one at 0x80000000) but
+ * as soon as I get around to remapping the io areas with the BATs
+ * to match the mac we can raise this. -- Cort
+ */
+#define TASK_SIZE	(CONFIG_TASK_SIZE)
+
 #ifndef __ASSEMBLY__
 #ifdef CONFIG_PPC_MULTIPLATFORM
 extern int _machine;
@@ -79,14 +87,7 @@ extern long kernel_thread(int (*fn)(void *), void *arg, unsigned long flags);
 /* Lazy FPU handling on uni-processor */
 extern struct task_struct *last_task_used_math;
 extern struct task_struct *last_task_used_altivec;
-
-/*
- * this is the minimum allowable io space due to the location
- * of the io areas on prep (first one at 0x80000000) but
- * as soon as I get around to remapping the io areas with the BATs
- * to match the mac we can raise this. -- Cort
- */
-#define TASK_SIZE	(CONFIG_TASK_SIZE)
+extern struct task_struct *last_task_used_spe;
 
 /* This decides where the kernel will search for a free chunk of vm
  * space during mmap's.
@@ -104,7 +105,7 @@ struct thread_struct {
 	void		*pgdir;		/* root of page-table tree */
 	int		fpexc_mode;	/* floating-point exception mode */
 	signed long	last_syscall;
-#ifdef CONFIG_4xx
+#if defined(CONFIG_4xx) || defined (CONFIG_BOOKE)
 	unsigned long	dbcr0;		/* debug control register values */
 	unsigned long	dbcr1;
 #endif
@@ -119,6 +120,12 @@ struct thread_struct {
 	unsigned long	vrsave;
 	int		used_vr;	/* set if process has used altivec */
 #endif /* CONFIG_ALTIVEC */
+#ifdef CONFIG_SPE
+	unsigned long	evr[32];	/* upper 32-bits of SPE regs */
+	u64		acc;		/* Accumulator */
+	unsigned long	spefscr;	/* SPE & eFP status */
+	int		used_spe;	/* set if process has used spe */
+#endif /* CONFIG_SPE */
 };
 
 #define ARCH_MIN_TASKALIGN 16
@@ -190,6 +197,8 @@ extern inline void prefetchw(const void *x)
 
 #define spin_lock_prefetch(x)	prefetchw(x)
 
+extern int emulate_altivec(struct pt_regs *regs);
+
 #endif /* !__ASSEMBLY__ */
 
 #endif /* __ASM_PPC_PROCESSOR_H */
diff --git a/include/asm-ppc/ptrace.h b/include/asm-ppc/ptrace.h
index f13233eac..2576a7f90 100644
--- a/include/asm-ppc/ptrace.h
+++ b/include/asm-ppc/ptrace.h
@@ -131,4 +131,9 @@ do {									      \
 #define PTRACE_GETVRREGS	18
 #define PTRACE_SETVRREGS	19
 
+/* Get/set all the upper 32-bits of the SPE registers, accumulator, and
+ * spefscr, in one go */
+#define PTRACE_GETEVRREGS	20
+#define PTRACE_SETEVRREGS	21
+
 #endif
diff --git a/include/asm-ppc/reg.h b/include/asm-ppc/reg.h
index e1defaea3..73eab4528 100644
--- a/include/asm-ppc/reg.h
+++ b/include/asm-ppc/reg.h
@@ -174,6 +174,7 @@
 
 #define SPRN_HID1	0x3F1		/* Hardware Implementation Register 1 */
 #define HID1_EMCP	(1<<31)		/* 7450 Machine Check Pin Enable */
+#define HID1_DFS	(1<<22)		/* 7447A Dynamic Frequency Scaling */
 #define HID1_PC0	(1<<16)		/* 7450 PLL_CFG[0] */
 #define HID1_PC1	(1<<15)		/* 7450 PLL_CFG[1] */
 #define HID1_PC2	(1<<14)		/* 7450 PLL_CFG[2] */
@@ -294,6 +295,9 @@
 #define SPRN_SPRG7	0x117	/* Special Purpose Register General 7 */
 #define SPRN_SRR0	0x01A	/* Save/Restore Register 0 */
 #define SPRN_SRR1	0x01B	/* Save/Restore Register 1 */
+#ifndef SPRN_SVR
+#define SPRN_SVR	0x11E	/* System Version Register */
+#endif
 #define SPRN_THRM1	0x3FC		/* Thermal Management Register 1 */
 /* these bits were defined in inverted endian sense originally, ugh, confusing */
 #define THRM1_TIN	(1 << 31)
@@ -346,7 +350,7 @@
 #define DBAT6U	SPRN_DBAT6U	/* Data BAT 6 Upper Register */
 #define DBAT7L	SPRN_DBAT7L	/* Data BAT 7 Lower Register */
 #define DBAT7U	SPRN_DBAT7U	/* Data BAT 7 Upper Register */
-#define DEC	SPRN_DEC	/* Decrement Register */
+//#define DEC	SPRN_DEC	/* Decrement Register */
 #define DMISS	SPRN_DMISS	/* Data TLB Miss Register */
 #define DSISR	SPRN_DSISR	/* Data Storage Interrupt Status Register */
 #define EAR	SPRN_EAR	/* External Address Register */
@@ -376,9 +380,9 @@
 #define IMMR	SPRN_IMMR	/* PPC 860/821 Internal Memory Map Register */
 #define L2CR	SPRN_L2CR	/* Classic PPC L2 cache control register */
 #define L3CR	SPRN_L3CR	/* PPC 745x L3 cache control register */
-#define LR	SPRN_LR
+//#define LR	SPRN_LR
 #define PVR	SPRN_PVR	/* Processor Version */
-#define RPA	SPRN_RPA	/* Required Physical Address Register */
+//#define RPA	SPRN_RPA	/* Required Physical Address Register */
 #define SDR1	SPRN_SDR1	/* MMU hash base register */
 #define SPR0	SPRN_SPRG0	/* Supervisor Private Registers */
 #define SPR1	SPRN_SPRG1
@@ -400,6 +404,7 @@
 #define SRR1	SPRN_SRR1	/* Save and Restore Register 1 */
 #define SRR2	SPRN_SRR2	/* Save and Restore Register 2 */
 #define SRR3	SPRN_SRR3	/* Save and Restore Register 3 */
+#define SVR	SPRN_SVR	/* System Version Register */
 #define ICTC	SPRN_ICTC	/* Instruction Cache Throttling Control Reg */
 #define THRM1	SPRN_THRM1	/* Thermal Management Register 1 */
 #define THRM2	SPRN_THRM2	/* Thermal Management Register 2 */
@@ -462,6 +467,8 @@
 #define PVR_7400	0x000C0000
 #define PVR_7410	0x800C0000
 #define PVR_7450	0x80000000
+#define PVR_8540	0x80200000
+#define PVR_8560	0x80200000
 /*
  * For the 8xx processors, all of them report the same PVR family for
  * the PowerPC core. The various versions of these processors must be
@@ -476,6 +483,13 @@
 #define PVR_8245	0x80811014
 #define PVR_8260	PVR_8240
 
+/* System Version Numbers */
+#define SVR_8540	0x80300000
+#define SVR_8541E	0x807A0000
+#define SVR_8555E	0x80790000
+#define SVR_8560	0x80700000
+
+#if 0
 /* Segment Registers */
 #define SR0	0
 #define SR1	1
@@ -493,6 +507,7 @@
 #define SR13	13
 #define SR14	14
 #define SR15	15
+#endif
 
 /* Macros for setting and retrieving special purpose registers */
 #ifndef __ASSEMBLY__
diff --git a/include/asm-ppc/reg_booke.h b/include/asm-ppc/reg_booke.h
index 2c688c1fd..474abb894 100644
--- a/include/asm-ppc/reg_booke.h
+++ b/include/asm-ppc/reg_booke.h
@@ -43,13 +43,23 @@ do {						\
 	mtdcr(base ## _CFGADDR, base ## _ ## reg);	\
 	mtdcr(base ## _CFGDATA, data);		\
 } while (0)
+
+/* Performance Monitor Registers */
+#define mfpmr(rn)	({unsigned int rval; \
+			asm volatile("mfpmr %0," __stringify(rn) \
+				     : "=r" (rval)); rval;})
+#define mtpmr(rn, v)	asm volatile("mtpmr " __stringify(rn) ",%0" : : "r" (v))
 #endif /* __ASSEMBLY__ */
 
 
 /* Machine State Register (MSR) Fields */
+#define MSR_UCLE	(1<<26)	/* User-mode cache lock enable */
+#define MSR_SPE		(1<<25)	/* Enable SPE */
 #define MSR_DWE		(1<<10)	/* Debug Wait Enable */
+#define MSR_UBLE	(1<<10)	/* BTB lock enable (e500) */
 #define MSR_IS		MSR_IR	/* Instruction Space */
 #define MSR_DS		MSR_DR	/* Data Space */
+#define MSR_PMM		(1<<2)	/* Performance monitor mark bit */
 
 /* Default MSR for kernel mode. */
 #if defined (CONFIG_40x)
@@ -91,20 +101,28 @@ do {						\
 #define SPRN_IVOR13	0x19D	/* Interrupt Vector Offset Register 13 */
 #define SPRN_IVOR14	0x19E	/* Interrupt Vector Offset Register 14 */
 #define SPRN_IVOR15	0x19F	/* Interrupt Vector Offset Register 15 */
+#define SPRN_SPEFSCR	0x200	/* SPE & Embedded FP Status & Control */
+#define SPRN_BBEAR	0x201	/* Branch Buffer Entry Address Register */
+#define SPRN_BBTAR	0x202	/* Branch Buffer Target Address Register */
+#define SPRN_IVOR32	0x210	/* Interrupt Vector Offset Register 32 */
+#define SPRN_IVOR33	0x211	/* Interrupt Vector Offset Register 33 */
+#define SPRN_IVOR34	0x212	/* Interrupt Vector Offset Register 34 */
+#define SPRN_IVOR35	0x213	/* Interrupt Vector Offset Register 35 */
 #define SPRN_MCSRR0	0x23A	/* Machine Check Save and Restore Register 0 */
 #define SPRN_MCSRR1	0x23B	/* Machine Check Save and Restore Register 1 */
 #define SPRN_MCSR	0x23C	/* Machine Check Status Register */
-#ifdef CONFIG_440A
-#define  MCSR_MCS	0x80000000 /* Machine Check Summary */
-#define  MCSR_IB	0x40000000 /* Instruction PLB Error */
-#define  MCSR_DRB	0x20000000 /* Data Read PLB Error */
-#define  MCSR_DWB	0x10000000 /* Data Write PLB Error */
-#define  MCSR_TLBP	0x08000000 /* TLB Parity Error */
-#define  MCSR_ICP	0x04000000 /* I-Cache Parity Error */
-#define  MCSR_DCSP	0x02000000 /* D-Cache Search Parity Error */
-#define  MCSR_DCFP	0x01000000 /* D-Cache Flush Parity Error */
-#define  MCSR_IMPE	0x00800000 /* Imprecise Machine Check Exception */
-#endif
+#define SPRN_MCAR	0x23D	/* Machine Check Address Register */
+#define SPRN_MAS0	0x270	/* MMU Assist Register 0 */
+#define SPRN_MAS1	0x271	/* MMU Assist Register 1 */
+#define SPRN_MAS2	0x272	/* MMU Assist Register 2 */
+#define SPRN_MAS3	0x273	/* MMU Assist Register 3 */
+#define SPRN_MAS4	0x274	/* MMU Assist Register 4 */
+#define SPRN_MAS5	0x275	/* MMU Assist Register 5 */
+#define SPRN_MAS6	0x276	/* MMU Assist Register 6 */
+#define SPRN_PID1	0x279	/* Process ID Register 1 */
+#define SPRN_PID2	0x27A	/* Process ID Register 2 */
+#define SPRN_TLB0CFG	0x2B0	/* TLB 0 Config Register */
+#define SPRN_TLB1CFG	0x2B1	/* TLB 1 Config Register */
 #define SPRN_ZPR	0x3B0	/* Zone Protection Register (40x) */
 #define SPRN_MMUCR	0x3B2	/* MMU Control Register */
 #define SPRN_CCR0	0x3B3	/* Core Configuration Register */
@@ -115,9 +133,12 @@ do {						\
 #define SPRN_DCMP	0x3D1	/* Data TLB Compare Register */
 #define SPRN_ICDBDR	0x3D3	/* Instruction Cache Debug Data Register */
 #define SPRN_EVPR	0x3D6	/* Exception Vector Prefix Register */
+#define SPRN_L1CSR0	0x3F2	/* L1 Cache Control and Status Register 0 */
+#define SPRN_L1CSR1	0x3F3	/* L1 Cache Control and Status Register 1 */
 #define SPRN_PIT	0x3DB	/* Programmable Interval Timer */
 #define SPRN_DCCR	0x3FA	/* Data Cache Cacheability Register */
 #define SPRN_ICCR	0x3FB	/* Instruction Cache Cacheability Register */
+#define SPRN_SVR	0x3FF	/* System Version Register */
 
 /*
  * SPRs which have conflicting definitions on true Book E versus classic,
@@ -125,6 +146,7 @@ do {						\
  */
 #ifdef CONFIG_BOOKE
 #define SPRN_PID	0x030	/* Process ID */
+#define SPRN_PID0	SPRN_PID/* Process ID Register 0 */
 #define SPRN_CSRR0	0x03A	/* Critical Save and Restore Register 0 */
 #define SPRN_CSRR1	0x03B	/* Critical Save and Restore Register 1 */
 #define SPRN_DEAR	0x03D	/* Data Error Address Register */
@@ -157,6 +179,34 @@ do {						\
 #define SPRN_CSRR1	SPRN_SRR3 /* Critical Save and Restore Register 1 */
 #endif
 
+/* Bit definitions for the MCSR. */
+#ifdef CONFIG_440A
+#define MCSR_MCS	0x80000000 /* Machine Check Summary */
+#define MCSR_IB		0x40000000 /* Instruction PLB Error */
+#define MCSR_DRB	0x20000000 /* Data Read PLB Error */
+#define MCSR_DWB	0x10000000 /* Data Write PLB Error */
+#define MCSR_TLBP	0x08000000 /* TLB Parity Error */
+#define MCSR_ICP	0x04000000 /* I-Cache Parity Error */
+#define MCSR_DCSP	0x02000000 /* D-Cache Search Parity Error */
+#define MCSR_DCFP	0x01000000 /* D-Cache Flush Parity Error */
+#define MCSR_IMPE	0x00800000 /* Imprecise Machine Check Exception */
+#endif
+#ifdef CONFIG_E500
+#define MCSR_MCP 	0x80000000UL /* Machine Check Input Pin */
+#define MCSR_ICPERR 	0x40000000UL /* I-Cache Parity Error */
+#define MCSR_DCP_PERR 	0x20000000UL /* D-Cache Push Parity Error */
+#define MCSR_DCPERR 	0x10000000UL /* D-Cache Parity Error */
+#define MCSR_GL_CI 	0x00010000UL /* Guarded Load or Cache-Inhibited stwcx. */
+#define MCSR_BUS_IAERR 	0x00000080UL /* Instruction Address Error */
+#define MCSR_BUS_RAERR 	0x00000040UL /* Read Address Error */
+#define MCSR_BUS_WAERR 	0x00000020UL /* Write Address Error */
+#define MCSR_BUS_IBERR 	0x00000010UL /* Instruction Data Error */
+#define MCSR_BUS_RBERR 	0x00000008UL /* Read Data Bus Error */
+#define MCSR_BUS_WBERR 	0x00000004UL /* Write Data Bus Error */
+#define MCSR_BUS_IPERR 	0x00000002UL /* Instruction parity Error */
+#define MCSR_BUS_RPERR 	0x00000001UL /* Read parity Error */
+#endif
+
 /* Bit definitions for the DBSR. */
 /*
  * DBSR bits which have conflicting definitions on true Book E versus IBM 40x.
@@ -165,11 +215,27 @@ do {						\
 #define DBSR_IC		0x08000000	/* Instruction Completion */
 #define DBSR_BT		0x04000000	/* Branch Taken */
 #define DBSR_TIE	0x01000000	/* Trap Instruction Event */
+#define DBSR_IAC1	0x00800000	/* Instr Address Compare 1 Event */
+#define DBSR_IAC2	0x00400000	/* Instr Address Compare 2 Event */
+#define DBSR_IAC3	0x00200000	/* Instr Address Compare 3 Event */
+#define DBSR_IAC4	0x00100000	/* Instr Address Compare 4 Event */
+#define DBSR_DAC1R	0x00080000	/* Data Addr Compare 1 Read Event */
+#define DBSR_DAC1W	0x00040000	/* Data Addr Compare 1 Write Event */
+#define DBSR_DAC2R	0x00020000	/* Data Addr Compare 2 Read Event */
+#define DBSR_DAC2W	0x00010000	/* Data Addr Compare 2 Write Event */
 #endif
 #ifdef CONFIG_40x
 #define DBSR_IC		0x80000000	/* Instruction Completion */
 #define DBSR_BT		0x40000000	/* Branch taken */
 #define DBSR_TIE	0x10000000	/* Trap Instruction debug Event */
+#define DBSR_IAC1	0x00800000	/* Instruction Address Compare 1 Event */
+#define DBSR_IAC2	0x00400000	/* Instruction Address Compare 2 Event */
+#define DBSR_IAC3	0x00200000	/* Instruction Address Compare 3 Event */
+#define DBSR_IAC4	0x00100000	/* Instruction Address Compare 4 Event */
+#define DBSR_DAC1R	0x00080000	/* Data Address Compare 1 Read Event */
+#define DBSR_DAC1W	0x00040000	/* Data Address Compare 1 Write Event */
+#define DBSR_DAC2R	0x00020000	/* Data Address Compare 2 Read Event */
+#define DBSR_DAC2W	0x00010000	/* Data Address Compare 2 Write Event */
 #endif
 
 /* Bit definitions related to the ESR. */
@@ -184,6 +250,9 @@ do {						\
 #define ESR_DST		0x00800000	/* Storage Exception - Data miss */
 #define ESR_DIZ		0x00400000	/* Storage Exception - Zone fault */
 #define ESR_ST		0x00800000	/* Store Operation */
+#define ESR_DLK		0x00200000	/* Data Cache Locking */
+#define ESR_ILK		0x00100000	/* Instr. Cache Locking */
+#define ESR_BO		0x00020000	/* Byte Ordering */
 
 /* Bit definitions related to the DBCR0. */
 #define DBCR0_EDM	0x80000000	/* External Debug Mode */
@@ -258,10 +327,49 @@ do {						\
 #define ICCR_NOCACHE	0		/* Noncacheable */
 #define ICCR_CACHE	1		/* Cacheable */
 
+/* Bit definitions for L1CSR0. */
+#define L1CSR0_DCFI	0x00000002	/* Data Cache Flash Invalidate */
+#define L1CSR0_DCE	0x00000001	/* Data Cache Enable */
+
+/* Bit definitions for L1CSR0. */
+#define L1CSR1_ICLFR	0x00000100	/* Instr Cache Lock Bits Flash Reset */
+#define L1CSR1_ICFI	0x00000002	/* Instr Cache Flash Invalidate */
+#define L1CSR1_ICE	0x00000001	/* Instr Cache Enable */
+
 /* Bit definitions for SGR. */
 #define SGR_NORMAL	0		/* Speculative fetching allowed. */
 #define SGR_GUARDED	1		/* Speculative fetching disallowed. */
 
+/* Bit definitions for SPEFSCR. */
+#define SPEFSCR_SOVH	0x80000000	/* Summary integer overflow high */
+#define SPEFSCR_OVH	0x40000000	/* Integer overflow high */
+#define SPEFSCR_FGH	0x20000000	/* Embedded FP guard bit high */
+#define SPEFSCR_FXH	0x10000000	/* Embedded FP sticky bit high */
+#define SPEFSCR_FINVH	0x08000000	/* Embedded FP invalid operation high */
+#define SPEFSCR_FDBZH	0x04000000	/* Embedded FP div by zero high */
+#define SPEFSCR_FUNFH	0x02000000	/* Embedded FP underflow high */
+#define SPEFSCR_FOVFH	0x01000000	/* Embedded FP overflow high */
+#define SPEFSCR_FINXS	0x00200000	/* Embedded FP inexact sticky */
+#define SPEFSCR_FINVS	0x00100000	/* Embedded FP invalid op. sticky */
+#define SPEFSCR_FDBZS	0x00080000	/* Embedded FP div by zero sticky */
+#define SPEFSCR_FUNFS	0x00040000	/* Embedded FP underflow sticky */
+#define SPEFSCR_FOVFS	0x00020000	/* Embedded FP overflow sticky */
+#define SPEFSCR_MODE	0x00010000	/* Embedded FP mode */
+#define SPEFSCR_SOV	0x00008000	/* Integer summary overflow */
+#define SPEFSCR_OV	0x00004000	/* Integer overflow */
+#define SPEFSCR_FG	0x00002000	/* Embedded FP guard bit */
+#define SPEFSCR_FX	0x00001000	/* Embedded FP sticky bit */
+#define SPEFSCR_FINV	0x00000800	/* Embedded FP invalid operation */
+#define SPEFSCR_FDBZ	0x00000400	/* Embedded FP div by zero */
+#define SPEFSCR_FUNF	0x00000200	/* Embedded FP underflow */
+#define SPEFSCR_FOVF	0x00000100	/* Embedded FP overflow */
+#define SPEFSCR_FINXE	0x00000040	/* Embedded FP inexact enable */
+#define SPEFSCR_FINVE	0x00000020	/* Embedded FP invalid op. enable */
+#define SPEFSCR_FDBZE	0x00000010	/* Embedded FP div by zero enable */
+#define SPEFSCR_FUNFE	0x00000008	/* Embedded FP underflow enable */
+#define SPEFSCR_FOVFE	0x00000004	/* Embedded FP overflow enable */
+#define SPEFSCR_FRMC 	0x00000003	/* Embedded FP rounding mode control */
+
 /* Short-hand for various SPRs. */
 #ifdef CONFIG_BOOKE
 #define CSRR0	SPRN_CSRR0	/* Critical Save and Restore Register 0 */
diff --git a/include/asm-ppc/resource.h b/include/asm-ppc/resource.h
index 956b34602..3d2991455 100644
--- a/include/asm-ppc/resource.h
+++ b/include/asm-ppc/resource.h
@@ -12,8 +12,10 @@
 #define RLIMIT_MEMLOCK	8		/* max locked-in-memory address space */
 #define RLIMIT_AS	9		/* address space limit(?) */
 #define RLIMIT_LOCKS	10		/* maximum file locks held */
+#define RLIMIT_SIGPENDING 11		/* max number of pending signals */
+#define RLIMIT_MSGQUEUE 12		/* maximum bytes in POSIX mqueues */
 
-#define RLIM_NLIMITS	11
+#define RLIM_NLIMITS	13
 
 #ifdef __KERNEL__
 
@@ -37,6 +39,8 @@
 	{ RLIM_INFINITY, RLIM_INFINITY },		\
 	{ RLIM_INFINITY, RLIM_INFINITY },		\
 	{ RLIM_INFINITY, RLIM_INFINITY },		\
+	{ MAX_SIGPENDING, MAX_SIGPENDING },		\
+	{ MQ_BYTES_MAX, MQ_BYTES_MAX },			\
 }
 
 #endif /* __KERNEL__ */
diff --git a/include/asm-ppc/serial.h b/include/asm-ppc/serial.h
index a9422c20d..310206e28 100644
--- a/include/asm-ppc/serial.h
+++ b/include/asm-ppc/serial.h
@@ -30,6 +30,8 @@
 #include <platforms/spruce.h>
 #elif defined(CONFIG_4xx)
 #include <asm/ibm4xx.h>
+#elif defined(CONFIG_85xx)
+#include <asm/mpc85xx.h>
 #else
 
 /*
diff --git a/include/asm-ppc/setup.h b/include/asm-ppc/setup.h
index cd458c4f1..d2d19ee10 100644
--- a/include/asm-ppc/setup.h
+++ b/include/asm-ppc/setup.h
@@ -6,6 +6,9 @@
 #define m68k_memory memory
 
 #include <asm-m68k/setup.h>
+/* We have a bigger command line buffer. */
+#undef COMMAND_LINE_SIZE
+#define COMMAND_LINE_SIZE	512
 
 #endif /* _PPC_SETUP_H */
 #endif /* __KERNEL__ */
diff --git a/include/asm-ppc/signal.h b/include/asm-ppc/signal.h
index 108bec27d..580fcc148 100644
--- a/include/asm-ppc/signal.h
+++ b/include/asm-ppc/signal.h
@@ -118,7 +118,11 @@ typedef struct {
 #define SIG_SETMASK        2	/* for setting the signal mask */
 
 /* Type of a signal handler.  */
-typedef void (*__sighandler_t)(int);
+typedef void __signalfn_t(int);
+typedef __signalfn_t __user *__sighandler_t;
+
+typedef void __restorefn_t(void);
+typedef __restorefn_t __user *__sigrestore_t;
 
 #define SIG_DFL	((__sighandler_t)0)	/* default signal handling */
 #define SIG_IGN	((__sighandler_t)1)	/* ignore signal */
@@ -128,13 +132,13 @@ struct old_sigaction {
 	__sighandler_t sa_handler;
 	old_sigset_t sa_mask;
 	unsigned long sa_flags;
-	void (*sa_restorer)(void);
+	__sigrestore_t sa_restorer;
 };
 
 struct sigaction {
 	__sighandler_t sa_handler;
 	unsigned long sa_flags;
-	void (*sa_restorer)(void);
+	__sigrestore_t sa_restorer;
 	sigset_t sa_mask;		/* mask last for extensibility */
 };
 
@@ -143,7 +147,7 @@ struct k_sigaction {
 };
 
 typedef struct sigaltstack {
-	void *ss_sp;
+	void __user *ss_sp;
 	int ss_flags;
 	size_t ss_size;
 } stack_t;
diff --git a/include/asm-ppc/smp.h b/include/asm-ppc/smp.h
index 803fdb583..4bd15cbdc 100644
--- a/include/asm-ppc/smp.h
+++ b/include/asm-ppc/smp.h
@@ -47,8 +47,6 @@ extern void smp_local_timer_interrupt(struct pt_regs *);
 
 #define smp_processor_id() (current_thread_info()->cpu)
 
-#define cpu_online(cpu) cpu_isset(cpu, cpu_online_map)
-
 extern int __cpu_up(unsigned int cpu);
 
 extern int smp_hw_index[];
diff --git a/include/asm-ppc/system.h b/include/asm-ppc/system.h
index e8c8e88dc..e49964652 100644
--- a/include/asm-ppc/system.h
+++ b/include/asm-ppc/system.h
@@ -76,11 +76,12 @@ extern void giveup_fpu(struct task_struct *);
 extern void enable_kernel_fp(void);
 extern void giveup_altivec(struct task_struct *);
 extern void load_up_altivec(struct task_struct *);
+extern void giveup_spe(struct task_struct *);
+extern void load_up_spe(struct task_struct *);
 extern int fix_alignment(struct pt_regs *);
 extern void cvt_fd(float *from, double *to, unsigned long *fpscr);
 extern void cvt_df(double *from, float *to, unsigned long *fpscr);
 extern int call_rtas(const char *, int, int, unsigned long *, ...);
-extern int abs(int);
 extern void cacheable_memzero(void *p, unsigned int nb);
 extern int do_page_fault(struct pt_regs *, unsigned long, unsigned long);
 extern void bad_page_fault(struct pt_regs *, unsigned long, int);
diff --git a/include/asm-ppc/tlbflush.h b/include/asm-ppc/tlbflush.h
index 6c6842fb4..9850f53f5 100644
--- a/include/asm-ppc/tlbflush.h
+++ b/include/asm-ppc/tlbflush.h
@@ -24,6 +24,28 @@ extern void _tlbia(void);
 #define __tlbia		_tlbia
 #endif
 
+static inline void flush_tlb_mm(struct mm_struct *mm)
+	{ __tlbia(); }
+static inline void flush_tlb_page(struct vm_area_struct *vma,
+				unsigned long vmaddr)
+	{ _tlbie(vmaddr); }
+static inline void flush_tlb_page_nohash(struct vm_area_struct *vma,
+					 unsigned long vmaddr)
+	{ _tlbie(vmaddr); }
+static inline void flush_tlb_range(struct vm_area_struct *vma,
+				unsigned long start, unsigned long end)
+	{ __tlbia(); }
+static inline void flush_tlb_kernel_range(unsigned long start,
+				unsigned long end)
+	{ __tlbia(); }
+
+#elif defined(CONFIG_FSL_BOOKE)
+
+/* TODO: determine if flush_tlb_range & flush_tlb_kernel_range
+ * are best implemented as tlbia vs specific tlbie's */
+
+#define __tlbia()	_tlbia()
+
 static inline void flush_tlb_mm(struct mm_struct *mm)
 	{ __tlbia(); }
 static inline void flush_tlb_page(struct vm_area_struct *vma,
diff --git a/include/asm-ppc/uaccess.h b/include/asm-ppc/uaccess.h
index 0a1a1a86a..b9d763e0d 100644
--- a/include/asm-ppc/uaccess.h
+++ b/include/asm-ppc/uaccess.h
@@ -34,7 +34,8 @@
 	((addr) <= current->thread.fs.seg				    \
 	 && ((size) == 0 || (size) - 1 <= current->thread.fs.seg - (addr)))
 
-#define access_ok(type, addr, size) __access_ok((unsigned long)(addr),(size))
+#define access_ok(type, addr, size) \
+	(__chk_user_ptr(addr),__access_ok((unsigned long)(addr),(size)))
 
 extern inline int verify_area(int type, const void __user * addr, unsigned long size)
 {
@@ -105,6 +106,7 @@ extern long __put_user_bad(void);
 #define __put_user_nocheck(x,ptr,size)			\
 ({							\
 	long __pu_err;					\
+	__chk_user_ptr(ptr);				\
 	__put_user_size((x),(ptr),(size),__pu_err);	\
 	__pu_err;					\
 })
@@ -112,7 +114,7 @@ extern long __put_user_bad(void);
 #define __put_user_check(x,ptr,size)				\
 ({								\
 	long __pu_err = -EFAULT;				\
-	__typeof__(*(ptr)) *__pu_addr = (ptr);			\
+	__typeof__(*(ptr)) __user *__pu_addr = (ptr);		\
 	if (access_ok(VERIFY_WRITE,__pu_addr,size))		\
 		__put_user_size((x),__pu_addr,(size),__pu_err);	\
 	__pu_err;						\
@@ -179,6 +181,7 @@ do {							\
 #define __get_user_nocheck(x, ptr, size)			\
 ({								\
 	long __gu_err, __gu_val;				\
+	__chk_user_ptr(ptr);					\
 	__get_user_size(__gu_val, (ptr), (size), __gu_err);	\
 	(x) = (__typeof__(*(ptr)))__gu_val;			\
 	__gu_err;						\
@@ -188,6 +191,7 @@ do {							\
 ({								\
 	long __gu_err;						\
 	long long __gu_val;					\
+	__chk_user_ptr(ptr);					\
 	__get_user_size64(__gu_val, (ptr), (size), __gu_err);	\
 	(x) = (__typeof__(*(ptr)))__gu_val;			\
 	__gu_err;						\
@@ -196,7 +200,7 @@ do {							\
 #define __get_user_check(x, ptr, size)					\
 ({									\
 	long __gu_err = -EFAULT, __gu_val = 0;				\
-	const __typeof__(*(ptr)) *__gu_addr = (ptr);			\
+	const __typeof__(*(ptr)) __user *__gu_addr = (ptr);		\
 	if (access_ok(VERIFY_READ, __gu_addr, (size)))			\
 		__get_user_size(__gu_val, __gu_addr, (size), __gu_err);	\
 	(x) = (__typeof__(*(ptr)))__gu_val;				\
@@ -207,7 +211,7 @@ do {							\
 ({									  \
 	long __gu_err = -EFAULT;					  \
 	long long __gu_val = 0;						  \
-	const __typeof__(*(ptr)) *__gu_addr = (ptr);			  \
+	const __typeof__(*(ptr)) __user *__gu_addr = (ptr);		  \
 	if (access_ok(VERIFY_READ, __gu_addr, (size)))			  \
 		__get_user_size64(__gu_val, __gu_addr, (size), __gu_err); \
 	(x) = (__typeof__(*(ptr)))__gu_val;				  \
diff --git a/include/asm-ppc/ucontext.h b/include/asm-ppc/ucontext.h
index 53da26040..664bc984d 100644
--- a/include/asm-ppc/ucontext.h
+++ b/include/asm-ppc/ucontext.h
@@ -13,10 +13,10 @@ struct mcontext {
 
 struct ucontext {
 	unsigned long	 uc_flags;
-	struct ucontext *uc_link;
+	struct ucontext __user *uc_link;
 	stack_t		 uc_stack;
 	int		 uc_pad[7];
-	struct mcontext	*uc_regs;	/* points to uc_mcontext field */
+	struct mcontext	__user *uc_regs;/* points to uc_mcontext field */
 	sigset_t	 uc_sigmask;
 	/* glibc has 1024-bit signal masks, ours are 64-bit */
 	int		 uc_maskext[30];
diff --git a/include/asm-ppc/uninorth.h b/include/asm-ppc/uninorth.h
index eeff122f3..2cf025936 100644
--- a/include/asm-ppc/uninorth.h
+++ b/include/asm-ppc/uninorth.h
@@ -142,6 +142,12 @@
  */
 #define UNI_N_HWINIT_STATE_CPU1_FLAG	0x10000000
 
+/* This register controls AACK delay, which is set when 2004 iBook/PowerBook
+ * is in low speed mode.
+ */
+#define UNI_N_AACK_DELAY		0x0100
+#define UNI_N_AACK_DELAY_ENABLE		0x00000001
+
 /* Uninorth 1.5 rev. has additional perf. monitor registers at 0xf00-0xf50 */
 
 
diff --git a/include/asm-ppc64/bitops.h b/include/asm-ppc64/bitops.h
index feeeb9b77..6d820e7ea 100644
--- a/include/asm-ppc64/bitops.h
+++ b/include/asm-ppc64/bitops.h
@@ -288,15 +288,15 @@ static __inline__ int ffs(int x)
 #define hweight16(x) generic_hweight16(x)
 #define hweight8(x) generic_hweight8(x)
 
-extern unsigned long find_next_zero_bit(unsigned long *addr, unsigned long size, unsigned long offset);
+extern unsigned long find_next_zero_bit(const unsigned long *addr, unsigned long size, unsigned long offset);
 #define find_first_zero_bit(addr, size) \
 	find_next_zero_bit((addr), (size), 0)
 
-extern unsigned long find_next_bit(unsigned long *addr, unsigned long size, unsigned long offset);
+extern unsigned long find_next_bit(const unsigned long *addr, unsigned long size, unsigned long offset);
 #define find_first_bit(addr, size) \
 	find_next_bit((addr), (size), 0)
 
-extern unsigned long find_next_zero_le_bit(unsigned long *addr, unsigned long size, unsigned long offset);
+extern unsigned long find_next_zero_le_bit(const unsigned long *addr, unsigned long size, unsigned long offset);
 #define find_first_zero_le_bit(addr, size) \
 	find_next_zero_le_bit((addr), (size), 0)
 
diff --git a/include/asm-ppc64/cputable.h b/include/asm-ppc64/cputable.h
index abca635f9..fa9b231ef 100644
--- a/include/asm-ppc64/cputable.h
+++ b/include/asm-ppc64/cputable.h
@@ -131,6 +131,7 @@ extern firmware_feature_t firmware_features_table[];
 #define CPU_FTR_SMT  			0x0000010000000000
 #define CPU_FTR_COHERENT_ICACHE  	0x0000020000000000
 #define CPU_FTR_LOCKLESS_TLBIE		0x0000040000000000
+#define CPU_FTR_MMCRA_SIHV		0x0000080000000000
 
 /* Platform firmware features */
 #define FW_FTR_                         0x0000000000000001
diff --git a/include/asm-ppc64/current.h b/include/asm-ppc64/current.h
index 24ea6e1ab..52ddc60c8 100644
--- a/include/asm-ppc64/current.h
+++ b/include/asm-ppc64/current.h
@@ -10,9 +10,7 @@
  * 2 of the License, or (at your option) any later version.
  */
 
-#include <asm/thread_info.h>
-
-#define get_current()   (get_paca()->xCurrent)
+#define get_current()   (get_paca()->__current)
 #define current         get_current()
 
 #endif /* !(_PPC64_CURRENT_H) */
diff --git a/include/asm-ppc64/eeh.h b/include/asm-ppc64/eeh.h
index 928dc5e39..a877ce9aa 100644
--- a/include/asm-ppc64/eeh.h
+++ b/include/asm-ppc64/eeh.h
@@ -24,6 +24,7 @@
 #include <linux/init.h>
 
 struct pci_dev;
+struct device_node;
 
 /* I/O addresses are converted to EEH "tokens" such that a driver will cause
  * a bad page fault if the address is used directly (i.e. these addresses are
@@ -55,6 +56,7 @@ void __init pci_addr_cache_build(void);
  * device (including config space i/o).  Call eeh_add_device_late
  * to finish the eeh setup for this device.
  */
+struct device_node;
 void eeh_add_device_early(struct device_node *);
 void eeh_add_device_late(struct pci_dev *);
 
@@ -178,27 +180,96 @@ static inline void eeh_raw_writeq(u64 val, void *addr) {
 	out_be64(vaddr, val);
 }
 
+#define EEH_CHECK_ALIGN(v,a) \
+	((((unsigned long)(v)) & ((a) - 1)) == 0)
+
 static inline void eeh_memset_io(void *addr, int c, unsigned long n) {
 	void *vaddr = (void *)IO_TOKEN_TO_ADDR(addr);
-	memset(vaddr, c, n);
+	u32 lc = c;
+	lc |= lc << 8;
+	lc |= lc << 16;
+
+	while(n && !EEH_CHECK_ALIGN(vaddr, 4)) {
+		*((volatile u8 *)vaddr) = c;
+		vaddr = (void *)((unsigned long)vaddr + 1);
+		n--;
+	}
+	while(n >= 4) {
+		*((volatile u32 *)vaddr) = lc;
+		vaddr = (void *)((unsigned long)vaddr + 4);
+		n -= 4;
+	}
+	while(n) {
+		*((volatile u8 *)vaddr) = c;
+		vaddr = (void *)((unsigned long)vaddr + 1);
+		n--;
+	}
+	__asm__ __volatile__ ("sync" : : : "memory");
 }
 static inline void eeh_memcpy_fromio(void *dest, void *src, unsigned long n) {
 	void *vsrc = (void *)IO_TOKEN_TO_ADDR(src);
-	memcpy(dest, vsrc, n);
+	void *vsrcsave = vsrc, *destsave = dest, *srcsave = src;
+	unsigned long nsave = n;
+
+	while(n && (!EEH_CHECK_ALIGN(vsrc, 4) || !EEH_CHECK_ALIGN(dest, 4))) {
+		*((u8 *)dest) = *((volatile u8 *)vsrc);
+		__asm__ __volatile__ ("eieio" : : : "memory");
+		vsrc = (void *)((unsigned long)vsrc + 1);
+		dest = (void *)((unsigned long)dest + 1);			
+		n--;
+	}
+	while(n > 4) {
+		*((u32 *)dest) = *((volatile u32 *)vsrc);
+		__asm__ __volatile__ ("eieio" : : : "memory");
+		vsrc = (void *)((unsigned long)vsrc + 4);
+		dest = (void *)((unsigned long)dest + 4);			
+		n -= 4;
+	}
+	while(n) {
+		*((u8 *)dest) = *((volatile u8 *)vsrc);
+		__asm__ __volatile__ ("eieio" : : : "memory");
+		vsrc = (void *)((unsigned long)vsrc + 1);
+		dest = (void *)((unsigned long)dest + 1);			
+		n--;
+	}
+	__asm__ __volatile__ ("sync" : : : "memory");
+
 	/* Look for ffff's here at dest[n].  Assume that at least 4 bytes
 	 * were copied. Check all four bytes.
 	 */
-	if ((n >= 4) &&
-		(EEH_POSSIBLE_ERROR(src, vsrc, (*((u32 *) dest+n-4)), u32))) {
-		eeh_check_failure(src, (*((u32 *) dest+n-4)));
+	if ((nsave >= 4) &&
+		(EEH_POSSIBLE_ERROR(srcsave, vsrcsave, (*((u32 *) destsave+nsave-4)),
+				    u32))) {
+		eeh_check_failure(srcsave, (*((u32 *) destsave+nsave-4)));
 	}
 }
 
 static inline void eeh_memcpy_toio(void *dest, void *src, unsigned long n) {
 	void *vdest = (void *)IO_TOKEN_TO_ADDR(dest);
-	memcpy(vdest, src, n);
+
+	while(n && (!EEH_CHECK_ALIGN(vdest, 4) || !EEH_CHECK_ALIGN(src, 4))) {
+		*((volatile u8 *)vdest) = *((u8 *)src);
+		src = (void *)((unsigned long)src + 1);
+		vdest = (void *)((unsigned long)vdest + 1);			
+		n--;
+	}
+	while(n > 4) {
+		*((volatile u32 *)vdest) = *((volatile u32 *)src);
+		src = (void *)((unsigned long)src + 4);
+		vdest = (void *)((unsigned long)vdest + 4);			
+		n-=4;
+	}
+	while(n) {
+		*((volatile u8 *)vdest) = *((u8 *)src);
+		src = (void *)((unsigned long)src + 1);
+		vdest = (void *)((unsigned long)vdest + 1);			
+		n--;
+	}
+	__asm__ __volatile__ ("sync" : : : "memory");
 }
 
+#undef EEH_CHECK_ALIGN
+
 #define MAX_ISA_PORT 0x10000
 extern unsigned long io_page_mask;
 #define _IO_IS_VALID(port) ((port) >= MAX_ISA_PORT || (1 << (port>>PAGE_SHIFT)) & io_page_mask)
diff --git a/include/asm-ppc64/fcntl.h b/include/asm-ppc64/fcntl.h
index 1ef83570b..842560d50 100644
--- a/include/asm-ppc64/fcntl.h
+++ b/include/asm-ppc64/fcntl.h
@@ -27,6 +27,7 @@
 #define O_NOFOLLOW      0100000	/* don't follow links */
 #define O_LARGEFILE     0200000
 #define O_DIRECT	0400000	/* direct disk access hint */
+#define O_NOATIME	01000000
 
 #define F_DUPFD		0	/* dup */
 #define F_GETFD		1	/* get close_on_exec */
diff --git a/include/asm-ppc64/hardirq.h b/include/asm-ppc64/hardirq.h
index 9744b7cb4..e1a2fec9f 100644
--- a/include/asm-ppc64/hardirq.h
+++ b/include/asm-ppc64/hardirq.h
@@ -82,9 +82,11 @@ typedef struct {
 
 #ifdef CONFIG_PREEMPT
 # define in_atomic()	((preempt_count() & ~PREEMPT_ACTIVE) != kernel_locked())
+# define preemptible()	(preempt_count() == 0 && !irqs_disabled())
 # define IRQ_EXIT_OFFSET (HARDIRQ_OFFSET-1)
 #else
 # define in_atomic()	(preempt_count() != 0)
+# define preemptible()	0
 # define IRQ_EXIT_OFFSET HARDIRQ_OFFSET
 #endif
 #define irq_exit()							\
diff --git a/include/asm-ppc64/iSeries/HvCall.h b/include/asm-ppc64/iSeries/HvCall.h
index d91eaa284..d9a2e74e2 100644
--- a/include/asm-ppc64/iSeries/HvCall.h
+++ b/include/asm-ppc64/iSeries/HvCall.h
@@ -183,7 +183,7 @@ void HvCall_writeLogBuffer(const void *buffer, u64 bufLen);
 //=====================================================================
 static inline void		HvCall_sendIPI(struct paca_struct * targetPaca)
 {
-	HvCall1( HvCallBaseSendIPI, targetPaca->xPacaIndex );
+	HvCall1( HvCallBaseSendIPI, targetPaca->paca_index );
 }
 
 //=====================================================================
diff --git a/include/asm-ppc64/iSeries/HvTypes.h b/include/asm-ppc64/iSeries/HvTypes.h
index bdaaa2c5d..3ec49c1ae 100644
--- a/include/asm-ppc64/iSeries/HvTypes.h
+++ b/include/asm-ppc64/iSeries/HvTypes.h
@@ -65,6 +65,10 @@ typedef u8	HvAgentId;		// Hypervisor DevFn
 
 
 #define HVMAXARCHITECTEDLPS 32
+#define HVMAXARCHITECTEDVIRTUALLANS 16
+#define HVMAXARCHITECTEDVIRTUALDISKS 32
+#define HVMAXARCHITECTEDVIRTUALCDROMS 8
+#define HVMAXARCHITECTEDVIRTUALTAPES 8
 #define HVCHUNKSIZE 256 * 1024
 #define HVPAGESIZE 4 * 1024
 #define HVLPMINMEGSPRIMARY 256
diff --git a/include/asm-ppc64/irq.h b/include/asm-ppc64/irq.h
index 6544827f7..9c491814d 100644
--- a/include/asm-ppc64/irq.h
+++ b/include/asm-ppc64/irq.h
@@ -9,8 +9,8 @@
  * 2 of the License, or (at your option) any later version.
  */
 
+#include <linux/config.h>
 #include <linux/threads.h>
-#include <asm/atomic.h>
 
 /*
  * Maximum number of interrupt sources that we can handle.
@@ -46,6 +46,8 @@ static inline unsigned int virt_irq_to_real(unsigned int virt_irq)
 	return virt_irq_to_real_map[virt_irq];
 }
 
+extern unsigned int real_irq_to_virt_slowpath(unsigned int real_irq);
+
 /*
  * Because many systems have two overlapping names spaces for
  * interrupts (ISA and XICS for example), and the ISA interrupts
diff --git a/include/asm-ppc64/machdep.h b/include/asm-ppc64/machdep.h
index bb961a029..020c7922f 100644
--- a/include/asm-ppc64/machdep.h
+++ b/include/asm-ppc64/machdep.h
@@ -11,8 +11,11 @@
 
 #include <linux/config.h>
 #include <linux/seq_file.h>
+#include <linux/init.h>
 #include <linux/dma-mapping.h>
 
+#include <asm/setup.h>
+
 struct pt_regs;
 struct pci_bus;	
 struct device_node;
@@ -112,9 +115,7 @@ struct machdep_calls {
 };
 
 extern struct machdep_calls ppc_md;
-#define COMMAND_LINE_SIZE 512
 extern char cmd_line[COMMAND_LINE_SIZE];
-extern char saved_command_line[COMMAND_LINE_SIZE];
 
 /* Functions to produce codes on the leds.
  * The SRC code should be unique for the message category and should
diff --git a/include/asm-ppc64/mmu.h b/include/asm-ppc64/mmu.h
index f9823b2ac..3b66f32b6 100644
--- a/include/asm-ppc64/mmu.h
+++ b/include/asm-ppc64/mmu.h
@@ -37,12 +37,6 @@ typedef struct {
 		mm_context_t ctx = { .id = REGION_ID(ea), KERNEL_LOW_HPAGES}; \
 		ctx; })
 
-/*
- * Hardware Segment Lookaside Buffer Entry
- * This structure has been padded out to two 64b doublewords (actual SLBE's are
- * 94 bits).  This padding facilites use by the segment management
- * instructions.
- */
 typedef struct {
 	unsigned long esid: 36; /* Effective segment ID */
 	unsigned long resv0:20; /* Reserved */
@@ -71,45 +65,6 @@ typedef struct _STE {
 	} dw1;
 } STE;
 
-typedef struct {
-	unsigned long esid: 36; /* Effective segment ID */
-	unsigned long v:     1; /* Entry valid (v=1) or invalid */
-	unsigned long null1:15; /* padding to a 64b boundary */
-	unsigned long index:12; /* Index to select SLB entry. Used by slbmte */
-} slb_dword0;
-
-typedef struct {
-	unsigned long vsid: 52; /* Virtual segment ID */
-	unsigned long ks:    1; /* Supervisor (privileged) state storage key */
-	unsigned long kp:    1; /* Problem state storage key */
-	unsigned long n:     1; /* No-execute if n=1 */
-	unsigned long l:     1; /* Virt pages are large (l=1) or 4KB (l=0) */
-	unsigned long c:     1; /* Class */
-	unsigned long resv0: 7; /* Padding to a 64b boundary */
-} slb_dword1;
-
-typedef struct {
-	union {
-		unsigned long dword0;
-		slb_dword0    dw0;
-	} dw0;
-
-	union {
-		unsigned long dword1;
-		slb_dword1    dw1;
-	} dw1;
-} SLBE;
-
-/*
- * This structure is used in paca.h where the layout depends on the 
- * size being 24B.
- */
-typedef struct {
-        unsigned long   real;
-        unsigned long   virt;
-        unsigned long   next_round_robin;
-} STAB;
-
 /* Hardware Page Table Entry */
 
 #define HPTES_PER_GROUP 8
@@ -269,6 +224,30 @@ extern void htab_finish_init(void);
 #define STAB0_PHYS_ADDR	(STAB0_PAGE<<PAGE_SHIFT)
 #define STAB0_VIRT_ADDR	(KERNELBASE+STAB0_PHYS_ADDR)
 
+#define SLB_NUM_BOLTED		2
+#define SLB_CACHE_ENTRIES	8
+
+/* Bits in the SLB ESID word */
+#define SLB_ESID_V		0x0000000008000000	/* entry is valid */
+
+/* Bits in the SLB VSID word */
+#define SLB_VSID_SHIFT		12
+#define SLB_VSID_KS		0x0000000000000800
+#define SLB_VSID_KP		0x0000000000000400
+#define SLB_VSID_N		0x0000000000000200	/* no-execute */
+#define SLB_VSID_L		0x0000000000000100	/* largepage (4M) */
+#define SLB_VSID_C		0x0000000000000080	/* class */
+
+#define SLB_VSID_KERNEL		(SLB_VSID_KP|SLB_VSID_C)
+#define SLB_VSID_USER		(SLB_VSID_KP|SLB_VSID_KS)
+
+#define VSID_RANDOMIZER ASM_CONST(42470972311)
+#define VSID_MASK	0xfffffffffUL
+/* Because we never access addresses below KERNELBASE as kernel
+ * addresses, this VSID is never used for anything real, and will
+ * never have pages hashed into it */
+#define BAD_VSID	ASM_CONST(0)
+
 /* Block size masks */
 #define BL_128K	0x000
 #define BL_256K 0x001
diff --git a/include/asm-ppc64/mmu_context.h b/include/asm-ppc64/mmu_context.h
index 505ad13b3..03561b589 100644
--- a/include/asm-ppc64/mmu_context.h
+++ b/include/asm-ppc64/mmu_context.h
@@ -136,7 +136,7 @@ destroy_context(struct mm_struct *mm)
 }
 
 extern void flush_stab(struct task_struct *tsk, struct mm_struct *mm);
-extern void flush_slb(struct task_struct *tsk, struct mm_struct *mm);
+extern void switch_slb(struct task_struct *tsk, struct mm_struct *mm);
 
 /*
  * switch_mm is the entry point called from the architecture independent
@@ -161,7 +161,7 @@ static inline void switch_mm(struct mm_struct *prev, struct mm_struct *next,
 		return;
 
 	if (cur_cpu_spec->cpu_features & CPU_FTR_SLB)
-		flush_slb(tsk, next);
+		switch_slb(tsk, next);
 	else
 		flush_stab(tsk, next);
 }
@@ -181,10 +181,6 @@ static inline void activate_mm(struct mm_struct *prev, struct mm_struct *next)
 	local_irq_restore(flags);
 }
 
-#define VSID_RANDOMIZER 42470972311UL
-#define VSID_MASK	0xfffffffffUL
-
-
 /* This is only valid for kernel (including vmalloc, imalloc and bolted) EA's
  */
 static inline unsigned long
diff --git a/include/asm-ppc64/paca.h b/include/asm-ppc64/paca.h
index bf38c7f01..851082cd2 100644
--- a/include/asm-ppc64/paca.h
+++ b/include/asm-ppc64/paca.h
@@ -1,11 +1,8 @@
 #ifndef _PPC64_PACA_H
 #define _PPC64_PACA_H
 
-/*============================================================================
- *                                                         Header File Id
- * Name______________:	paca.h
- *
- * Description_______:
+/*
+ * include/asm-ppc64/paca.h
  *
  * This control block defines the PACA which defines the processor 
  * specific data for each logical processor on the system.  
@@ -18,141 +15,111 @@
  * as published by the Free Software Foundation; either version
  * 2 of the License, or (at your option) any later version.
  */    
-#include	<asm/types.h>
 
-#define N_EXC_STACK    2
-
-/*-----------------------------------------------------------------------------
- * Other Includes
- *-----------------------------------------------------------------------------
- */
+#include	<asm/types.h>
 #include	<asm/iSeries/ItLpPaca.h>
 #include	<asm/iSeries/ItLpRegSave.h>
-#include	<asm/iSeries/ItLpQueue.h>
-#include	<asm/rtas.h>
 #include	<asm/mmu.h>
-#include	<asm/processor.h>
 
 extern struct paca_struct paca[];
 register struct paca_struct *local_paca asm("r13");
 #define get_paca()	local_paca
 
 struct task_struct;
+struct ItLpQueue;
 
-/*============================================================================
- * Name_______:	paca
- *
- * Description:
- *
- *	Defines the layout of the paca.  
+/*
+ * Defines the layout of the paca.
  *
- *	This structure is not directly accessed by PLIC or the SP except
- *	for the first two pointers that point to the ItLpPaca area and the
- *	ItLpRegSave area for this processor.  Both the ItLpPaca and
- *	ItLpRegSave objects are currently contained within the
- *	PACA but they do not need to be.
- *
- *============================================================================
+ * This structure is not directly accessed by firmware or the service
+ * processor except for the first two pointers that point to the
+ * ItLpPaca area and the ItLpRegSave area for this CPU.  Both the
+ * ItLpPaca and ItLpRegSave objects are currently contained within the
+ * PACA but they do not need to be.
  */
 struct paca_struct {
-/*=====================================================================================
- * CACHE_LINE_1 0x0000 - 0x007F
- *=====================================================================================
- */
-	struct ItLpPaca *xLpPacaPtr;	/* Pointer to LpPaca for PLIC		0x00 */
-	struct ItLpRegSave *xLpRegSavePtr; /* Pointer to LpRegSave for PLIC	0x08 */
-	struct task_struct *xCurrent;	/* Pointer to current			0x10 */
-	/* Note: the spinlock functions in arch/ppc64/lib/locks.c load lock_token and
-	   xPacaIndex with a single lwz instruction, using the constant offset 24.
-	   If you move either field, fix the spinlocks and rwlocks. */
-	u16 lock_token;			/* Constant 0x8000, used in spinlocks	0x18 */
-	u16 xPacaIndex;			/* Logical processor number		0x1A */
-	u32 default_decr;		/* Default decrementer value		0x1c */	
-	u64 xKsave;			/* Saved Kernel stack addr or zero	0x20 */
-	struct ItLpQueue *lpQueuePtr;	/* LpQueue handled by this processor    0x28 */
-	u64  xTOC;			/* Kernel TOC address			0x30 */
-	STAB xStab_data;		/* Segment table information		0x38,0x40,0x48 */
-	u8 *exception_sp;		/*                                      0x50 */
-	u8 xProcEnabled;		/*                                      0x58 */
-	u8 prof_enabled;		/* 1=iSeries profiling enabled          0x59 */
-	u16 xHwProcNum;			/* Physical processor number		0x5a */
-	u8 resv1[36];			/*					0x5c */
-
-/*=====================================================================================
- * CACHE_LINE_2 0x0080 - 0x00FF
- *=====================================================================================
- */
-	u64 spare1;			/*					0x00 */
-	u64 spare2;			/*					0x08 */
-	u64 spare3;			/*					0x10 */
-	u64 spare4;		/*					0x18 */
-	u64 next_jiffy_update_tb;	/* TB value for next jiffy update	0x20 */
-	u32 lpEvent_count;		/* lpEvents processed			0x28 */
-	u32 prof_multiplier;		/*					0x2C */
-	u32 prof_counter;		/*					0x30 */
-	u32 prof_shift;			/* iSeries shift for profile bucket size0x34 */
-	u32 *prof_buffer;		/* iSeries profiling buffer		0x38 */
-	u32 *prof_stext;		/* iSeries start of kernel text		0x40 */
-	u32 prof_len;			/* iSeries length of profile buffer -1	0x48 */
-	u8  yielded;                    /* 0 = this processor is running        0x4c */
-	                                /* 1 = this processor is yielded             */
-	u8  rsvd2[128-77];		/*					0x49 */
-
-/*=====================================================================================
- * CACHE_LINE_3 0x0100 - 0x017F
- *=====================================================================================
- */
-	u8		xProcStart;	/* At startup, processor spins until	0x100 */
-  					/* xProcStart becomes non-zero. */
-	u8		rsvd3[127];
-
-/*=====================================================================================
- * CACHE_LINE_4-8  0x0180 - 0x03FF Contains ItLpPaca
- *=====================================================================================
- */
-	struct ItLpPaca xLpPaca;	/* Space for ItLpPaca */
-
-/*=====================================================================================
- * CACHE_LINE_9-16 0x0400 - 0x07FF Contains ItLpRegSave
- *=====================================================================================
- */
-	struct ItLpRegSave xRegSav;	/* Register save for proc */
-
-/*=====================================================================================
- * CACHE_LINE_17-18 0x0800 - 0x08FF Reserved
- *=====================================================================================
- */
-	struct rtas_args xRtas;		/* Per processor RTAS struct */
-	u64 xR1;			/* r1 save for RTAS calls */
-	u64 xSavedMsr;			/* Old msr saved here by HvCall */
-	u8 rsvd5[256-16-sizeof(struct rtas_args)];
-
-/*=====================================================================================
- * CACHE_LINE_19-30 0x0900 - 0x0EFF Reserved
- *=====================================================================================
- */
-	u64 slb_shadow[0x20];
-	u64 dispatch_log;
-	u8  rsvd6[0x500 - 0x8];
-
-/*=====================================================================================
- * CACHE_LINE_31 0x0F00 - 0x0F7F Exception stack
- *=====================================================================================
- */
-	u8 exception_stack[N_EXC_STACK*EXC_FRAME_SIZE];
-
-/*=====================================================================================
- * CACHE_LINE_32 0x0F80 - 0x0FFF Reserved
- *=====================================================================================
- */
-	u8 rsvd7[0x80];                  /* Give the stack some rope ... */
-
-/*=====================================================================================
- * Page 2 Reserved for guard page.  Also used as a stack early in SMP boots before
- *        relocation is enabled.
- *=====================================================================================
- */
-	u8 guard[0x1000];               /* ... and then hang 'em         */ 
+	/*
+	 * Because hw_cpu_id, unlike other paca fields, is accessed
+	 * routinely from other CPUs (from the IRQ code), we stick to
+	 * read-only (after boot) fields in the first cacheline to
+	 * avoid cacheline bouncing.
+	 */
+
+	/*
+	 * MAGIC: These first two pointers can't be moved - they're
+	 * accessed by the firmware
+	 */
+	struct ItLpPaca *lppaca_ptr;	/* Pointer to LpPaca for PLIC */
+	struct ItLpRegSave *reg_save_ptr; /* Pointer to LpRegSave for PLIC */
+
+	/*
+	 * MAGIC: the spinlock functions in arch/ppc64/lib/locks.c
+	 * load lock_token and paca_index with a single lwz
+	 * instruction.  They must travel together and be properly
+	 * aligned.
+	 */
+	u16 lock_token;			/* Constant 0x8000, used in locks */
+	u16 paca_index;			/* Logical processor number */
+
+	u32 default_decr;		/* Default decrementer value */
+	struct ItLpQueue *lpqueue_ptr;	/* LpQueue handled by this CPU */
+	u64 kernel_toc;			/* Kernel TOC address */
+	u64 stab_real;			/* Absolute address of segment table */
+	u64 stab_addr;			/* Virtual address of segment table */
+	void *emergency_sp;		/* pointer to emergency stack */
+	u16 hw_cpu_id;			/* Physical processor number */
+	u8 cpu_start;			/* At startup, processor spins until */
+					/* this becomes non-zero. */
+
+	/*
+	 * Now, starting in cacheline 2, the exception save areas
+	 */
+	u64 exgen[8] __attribute__((aligned(0x80))); /* used for most interrupts/exceptions */
+	u64 exmc[8];		/* used for machine checks */
+	u64 exslb[8];		/* used for SLB/segment table misses
+				 * on the linear mapping */
+	u64 slb_r3;		/* spot to save R3 on SLB miss */
+	mm_context_t context;
+	u16 slb_cache[SLB_CACHE_ENTRIES];
+	u16 slb_cache_ptr;
+
+	/*
+	 * then miscellaneous read-write fields
+	 */
+	struct task_struct *__current;	/* Pointer to current */
+	u64 kstack;			/* Saved Kernel stack addr */
+	u64 stab_rr;			/* stab/slb round-robin counter */
+	u64 next_jiffy_update_tb;	/* TB value for next jiffy update */
+	u64 saved_r1;			/* r1 save for RTAS calls */
+	u64 saved_msr;			/* MSR saved here by enter_rtas */
+	u32 lpevent_count;		/* lpevents processed  */
+	u8 proc_enabled;		/* irq soft-enable flag */
+
+	/* not yet used */
+	u64 exdsi[8];		/* used for linear mapping hash table misses */
+
+	/*
+	 * iSeries structues which the hypervisor knows about - Not
+	 * sure if these particularly need to be cacheline aligned.
+	 * The lppaca is also used on POWER5 pSeries boxes.
+	 */
+	struct ItLpPaca lppaca __attribute__((aligned(0x80)));
+	struct ItLpRegSave reg_save;
+
+	/*
+	 * iSeries profiling support
+	 *
+	 * FIXME: do we still want this, or can we ditch it in favour
+	 * of oprofile?
+	 */
+	u32 *prof_buffer;		/* iSeries profiling buffer */
+	u32 *prof_stext;		/* iSeries start of kernel text */
+	u32 prof_multiplier;
+	u32 prof_counter;
+	u32 prof_shift;			/* iSeries shift for profile
+					 * bucket size */
+	u32 prof_len;			/* iSeries length of profile */
+	u8 prof_enabled;		/* 1=iSeries profiling enabled */
 };
 
 #endif /* _PPC64_PACA_H */
diff --git a/include/asm-ppc64/page.h b/include/asm-ppc64/page.h
index b144b14dc..a30e2a97b 100644
--- a/include/asm-ppc64/page.h
+++ b/include/asm-ppc64/page.h
@@ -27,6 +27,7 @@
 
 #define SID_SHIFT       28
 #define SID_MASK        0xfffffffffUL
+#define ESID_MASK	0xfffffffff0000000UL
 #define GET_ESID(x)     (((x) >> SID_SHIFT) & SID_MASK)
 
 #ifdef CONFIG_HUGETLB_PAGE
@@ -37,8 +38,8 @@
 #define HUGETLB_PAGE_ORDER	(HPAGE_SHIFT - PAGE_SHIFT)
 
 /* For 64-bit processes the hugepage range is 1T-1.5T */
-#define TASK_HPAGE_BASE 	(0x0000010000000000UL)
-#define TASK_HPAGE_END 	(0x0000018000000000UL)
+#define TASK_HPAGE_BASE ASM_CONST(0x0000010000000000)
+#define TASK_HPAGE_END 	ASM_CONST(0x0000018000000000)
 
 #define LOW_ESID_MASK(addr, len)	(((1U << (GET_ESID(addr+len-1)+1)) \
 	   	                	- (1U << GET_ESID(addr))) & 0xffff)
diff --git a/include/asm-ppc64/pci-bridge.h b/include/asm-ppc64/pci-bridge.h
index 08ba3f2b8..acb6aff2a 100644
--- a/include/asm-ppc64/pci-bridge.h
+++ b/include/asm-ppc64/pci-bridge.h
@@ -47,7 +47,6 @@ struct pci_controller {
 	 * the PCI memory space in the CPU bus space
 	 */
 	unsigned long pci_mem_offset;
-	unsigned long pci_io_offset;
 
 	struct pci_ops *ops;
 	volatile unsigned int *cfg_addr;
diff --git a/include/asm-ppc64/pgalloc.h b/include/asm-ppc64/pgalloc.h
index 3a073a3c0..8b79f3626 100644
--- a/include/asm-ppc64/pgalloc.h
+++ b/include/asm-ppc64/pgalloc.h
@@ -101,33 +101,7 @@ extern void pte_free_submit(struct pte_freelist_batch *batch);
 
 DECLARE_PER_CPU(struct pte_freelist_batch *, pte_freelist_cur);
 
-static inline void __pte_free_tlb(struct mmu_gather *tlb, struct page *ptepage)
-{
-	/* This is safe as we are holding page_table_lock */
-        cpumask_t local_cpumask = cpumask_of_cpu(smp_processor_id());
-	struct pte_freelist_batch **batchp = &__get_cpu_var(pte_freelist_cur);
-
-	if (atomic_read(&tlb->mm->mm_users) < 2 ||
-	    cpus_equal(tlb->mm->cpu_vm_mask, local_cpumask)) {
-		pte_free(ptepage);
-		return;
-	}
-
-	if (*batchp == NULL) {
-		*batchp = (struct pte_freelist_batch *)__get_free_page(GFP_ATOMIC);
-		if (*batchp == NULL) {
-			pte_free_now(ptepage);
-			return;
-		}
-		(*batchp)->index = 0;
-	}
-	(*batchp)->pages[(*batchp)->index++] = ptepage;
-	if ((*batchp)->index == PTE_FREELIST_SIZE) {
-		pte_free_submit(*batchp);
-		*batchp = NULL;
-	}
-}
-
+void __pte_free_tlb(struct mmu_gather *tlb, struct page *ptepage);
 #define __pmd_free_tlb(tlb, pmd)	__pte_free_tlb(tlb, virt_to_page(pmd))
 
 #define check_pgt_cache()	do { } while (0)
diff --git a/include/asm-ppc64/pgtable.h b/include/asm-ppc64/pgtable.h
index b1e7f6d4f..8499868b2 100644
--- a/include/asm-ppc64/pgtable.h
+++ b/include/asm-ppc64/pgtable.h
@@ -424,7 +424,7 @@ static inline void __ptep_set_access_flags(pte_t *ptep, pte_t entry, int dirty)
 		stdcx.	%0,0,%4\n\
 		bne-	1b"
 	:"=&r" (old), "=&r" (tmp), "=m" (*ptep)
-	:"r" (bits), "r" (ptep), "m" (ptep), "i" (_PAGE_BUSY)
+	:"r" (bits), "r" (ptep), "m" (*ptep), "i" (_PAGE_BUSY)
 	:"cc");
 }
 #define  ptep_set_access_flags(__vma, __address, __ptep, __entry, __dirty) \
diff --git a/include/asm-ppc64/ppc_asm.h b/include/asm-ppc64/ppc_asm.h
index 6ac08bb26..9031d8a29 100644
--- a/include/asm-ppc64/ppc_asm.h
+++ b/include/asm-ppc64/ppc_asm.h
@@ -28,6 +28,9 @@
 #define REST_8GPRS(n, base)	REST_4GPRS(n, base); REST_4GPRS(n+4, base)
 #define REST_10GPRS(n, base)	REST_8GPRS(n, base); REST_2GPRS(n+8, base)
 
+#define SAVE_NVGPRS(base)	SAVE_8GPRS(14, base); SAVE_10GPRS(22, base)
+#define REST_NVGPRS(base)	REST_8GPRS(14, base); REST_10GPRS(22, base)
+
 #define SAVE_FPR(n, base)	stfd	n,THREAD_FPR0+8*(n)(base)
 #define SAVE_2FPRS(n, base)	SAVE_FPR(n, base); SAVE_FPR(n+1, base)
 #define SAVE_4FPRS(n, base)	SAVE_2FPRS(n, base); SAVE_2FPRS(n+2, base)
@@ -54,11 +57,6 @@
 #define REST_16VRS(n,b,base)	REST_8VRS(n,b,base); REST_8VRS(n+8,b,base)
 #define REST_32VRS(n,b,base)	REST_16VRS(n,b,base); REST_16VRS(n+16,b,base)
 
-#define CHECKANYINT(ra,rb)			\
-	mfspr	rb,SPRG3;		/* Get Paca address */\
-	ld	ra,PACALPPACA+LPPACAANYINT(rb); /* Get pending interrupt flags */\
-	cmpldi	0,ra,0;
-
 /* Macros to adjust thread priority for Iseries hardware multithreading */
 #define HMT_LOW		or 1,1,1
 #define HMT_MEDIUM	or 2,2,2
diff --git a/include/asm-ppc64/processor.h b/include/asm-ppc64/processor.h
index 428080919..d5e383732 100644
--- a/include/asm-ppc64/processor.h
+++ b/include/asm-ppc64/processor.h
@@ -348,7 +348,7 @@
 #define	PVR	SPRN_PVR	/* Processor Version */
 #define	PIR	SPRN_PIR	/* Processor ID */
 #define	PURR	SPRN_PURR	/* Processor Utilization of Resource Register */
-#define	RPA	SPRN_RPA	/* Required Physical Address Register */
+//#define	RPA	SPRN_RPA	/* Required Physical Address Register */
 #define	SDR1	SPRN_SDR1      	/* MMU hash base register */
 #define	SPR0	SPRN_SPRG0	/* Supervisor Private Registers */
 #define	SPR1	SPRN_SPRG1
@@ -382,10 +382,10 @@
 #define	PV_ICESTAR	0x0036
 #define	PV_SSTAR	0x0037
 #define	PV_POWER4p	0x0038
-#define PV_GPUL		0x0039
+#define PV_970		0x0039
 #define	PV_POWER5	0x003A
 #define PV_POWER5p	0x003B
-#define PV_GPULp	0x003C
+#define PV_970FX	0x003C
 #define	PV_630        	0x0040
 #define	PV_630p	        0x0041
 
@@ -543,8 +543,7 @@ struct thread_struct {
 	double		fpr[32];	/* Complete floating point set */
 	unsigned long	fpscr;		/* Floating point status (plus pad) */
 	unsigned long	fpexc_mode;	/* Floating-point exception mode */
-	unsigned long	saved_msr;	/* Save MSR across signal handlers */
-	unsigned long	saved_softe;	/* Ditto for Soft Enable/Disable */
+	unsigned long	pad[3];		/* was saved_msr, saved_softe */
 #ifdef CONFIG_ALTIVEC
 	/* Complete AltiVec register set */
 	vector128	vr[32] __attribute((aligned(16)));
diff --git a/include/asm-ppc64/prom.h b/include/asm-ppc64/prom.h
index c39e11597..87db2ece0 100644
--- a/include/asm-ppc64/prom.h
+++ b/include/asm-ppc64/prom.h
@@ -25,7 +25,7 @@
 #define LONG_MSW(X) (((unsigned long)X) >> 32)
 
 typedef u32 phandle;
-typedef void *ihandle;
+typedef u32 ihandle;
 typedef u32 phandle32;
 typedef u32 ihandle32;
 
@@ -269,6 +269,7 @@ extern unsigned char *get_property(struct device_node *node, const char *name,
 extern void print_properties(struct device_node *node);
 extern int prom_n_addr_cells(struct device_node* np);
 extern int prom_n_size_cells(struct device_node* np);
+extern int prom_n_intr_cells(struct device_node* np);
 extern void prom_get_irq_senses(unsigned char *senses, int off, int max);
 extern void prom_add_property(struct device_node* np, struct property* prop);
 
diff --git a/include/asm-ppc64/ptrace.h b/include/asm-ppc64/ptrace.h
index c4e809d69..2ec5d7bc4 100644
--- a/include/asm-ppc64/ptrace.h
+++ b/include/asm-ppc64/ptrace.h
@@ -71,6 +71,18 @@ struct pt_regs32 {
 #define instruction_pointer(regs) ((regs)->nip)
 #define user_mode(regs) ((((regs)->msr) >> MSR_PR_LG) & 0x1)
 
+#define force_successful_syscall_return()   \
+		(current_thread_info()->syscall_noerror = 1)
+
+/*
+ * We use the least-significant bit of the trap field to indicate
+ * whether we have saved the full set of registers, or only a
+ * partial set.  A 1 there means the partial set.
+ */
+#define FULL_REGS(regs)		(((regs)->trap & 1) == 0)
+#define TRAP(regs)		((regs)->trap & ~0xF)
+#define CHECK_FULL_REGS(regs)	BUG_ON(regs->trap & 1)
+
 /*
  * Offsets used by 'ptrace' system call interface.
  */
diff --git a/include/asm-ppc64/resource.h b/include/asm-ppc64/resource.h
index b43a4ea0a..c54e9d69d 100644
--- a/include/asm-ppc64/resource.h
+++ b/include/asm-ppc64/resource.h
@@ -21,8 +21,10 @@
 #define RLIMIT_MEMLOCK	8		/* max locked-in-memory address space */
 #define RLIMIT_AS	9		/* address space limit(?) */
 #define RLIMIT_LOCKS	10		/* maximum file locks held */
+#define RLIMIT_SIGPENDING 11		/* max number of pending signals */
+#define RLIMIT_MSGQUEUE 12		/* maximum bytes in POSIX mqueues */
 
-#define RLIM_NLIMITS	11
+#define RLIM_NLIMITS	13
 
 #ifdef __KERNEL__
 
@@ -46,6 +48,8 @@
 	{ RLIM_INFINITY, RLIM_INFINITY },		\
 	{ RLIM_INFINITY, RLIM_INFINITY },		\
 	{ RLIM_INFINITY, RLIM_INFINITY },		\
+	{ MAX_SIGPENDING, MAX_SIGPENDING },		\
+	{ MQ_BYTES_MAX, MQ_BYTES_MAX },			\
 }
 
 #endif /* __KERNEL__ */
diff --git a/include/asm-ppc64/rtas.h b/include/asm-ppc64/rtas.h
index e51ebb166..d596ec5b4 100644
--- a/include/asm-ppc64/rtas.h
+++ b/include/asm-ppc64/rtas.h
@@ -37,7 +37,7 @@
  * Where n_in is the number of input parameters and
  *       n_out is the number of output parameters
  *
- * If the "string" is invalid on this system, RTAS_UNKOWN_SERVICE
+ * If the "string" is invalid on this system, RTAS_UNKNOWN_SERVICE
  * will be returned as a token.  rtas_call() does look for this
  * token and error out gracefully so rtas_call(rtas_token("str"), ...)
  * may be safely used for one-shot calls to RTAS.
@@ -51,18 +51,17 @@ struct rtas_args {
 	u32 nargs;
 	u32 nret; 
 	rtas_arg_t args[16];
-#if 0
-	spinlock_t lock;
-#endif
 	rtas_arg_t *rets;     /* Pointer to return values in args[]. */
 };  
 
+extern struct rtas_args rtas_stop_self_args;
+
 struct rtas_t {
 	unsigned long entry;		/* physical address pointer */
 	unsigned long base;		/* physical address pointer */
 	unsigned long size;
 	spinlock_t lock;
-
+	struct rtas_args args;
 	struct device_node *dev;	/* virtual address pointer */
 };
 
@@ -168,7 +167,7 @@ extern struct rtas_t rtas;
 
 extern void enter_rtas(unsigned long);
 extern int rtas_token(const char *service);
-extern long rtas_call(int token, int, int, unsigned long *, ...);
+extern int rtas_call(int token, int, int, int *, ...);
 extern void call_rtas_display_status(char);
 extern void rtas_restart(char *cmd);
 extern void rtas_power_off(void);
diff --git a/include/asm-ppc64/setup.h b/include/asm-ppc64/setup.h
index d6e62d15a..b257b8348 100644
--- a/include/asm-ppc64/setup.h
+++ b/include/asm-ppc64/setup.h
@@ -1,6 +1,6 @@
 #ifndef _PPC_SETUP_H
 #define _PPC_SETUP_H
 
-/* This is a place holder include */
+#define COMMAND_LINE_SIZE 512
 
 #endif /* _PPC_SETUP_H */
diff --git a/include/asm-ppc64/signal.h b/include/asm-ppc64/signal.h
index 7cd1f9a09..fe5401adb 100644
--- a/include/asm-ppc64/signal.h
+++ b/include/asm-ppc64/signal.h
@@ -2,6 +2,7 @@
 #define _ASMPPC64_SIGNAL_H
 
 #include <linux/types.h>
+#include <linux/compiler.h>
 #include <asm/siginfo.h>
 
 /* Avoid too many header ordering problems.  */
@@ -114,7 +115,12 @@ typedef struct {
 #define SIG_SETMASK        2	/* for setting the signal mask */
 
 /* Type of a signal handler.  */
-typedef void (*__sighandler_t)(int);
+typedef void __sigfunction(int);
+typedef __sigfunction __user * __sighandler_t;
+
+/* Type of the restorer function */
+typedef void __sigrestorer(void);
+typedef __sigrestorer __user * __sigrestorer_t;
 
 #define SIG_DFL	((__sighandler_t)0)	/* default signal handling */
 #define SIG_IGN	((__sighandler_t)1)	/* ignore signal */
@@ -124,13 +130,13 @@ struct old_sigaction {
 	__sighandler_t sa_handler;
 	old_sigset_t sa_mask;
 	unsigned long sa_flags;
-	void (*sa_restorer)(void);
+	__sigrestorer_t sa_restorer;
 };
 
 struct sigaction {
 	__sighandler_t sa_handler;
 	unsigned long sa_flags;
-	void (*sa_restorer)(void);
+	__sigrestorer_t sa_restorer;
 	sigset_t sa_mask;		/* mask last for extensibility */
 };
 
@@ -139,7 +145,7 @@ struct k_sigaction {
 };
 
 typedef struct sigaltstack {
-	void *ss_sp;
+	void __user *ss_sp;
 	int ss_flags;
 	size_t ss_size;
 } stack_t;
diff --git a/include/asm-ppc64/smp.h b/include/asm-ppc64/smp.h
index 3d7e3d7c7..139e88e50 100644
--- a/include/asm-ppc64/smp.h
+++ b/include/asm-ppc64/smp.h
@@ -33,8 +33,8 @@ struct pt_regs;
 extern void smp_message_recv(int, struct pt_regs *);
 
 
-#define smp_processor_id() (get_paca()->xPacaIndex)
-#define hard_smp_processor_id() (get_paca()->xHwProcNum)
+#define smp_processor_id() (get_paca()->paca_index)
+#define hard_smp_processor_id() (get_paca()->hw_cpu_id)
 
 /*
  * Retrieve the state of a CPU:
@@ -51,8 +51,6 @@ extern cpumask_t cpu_possible_map;
 extern cpumask_t cpu_available_map;
 
 #define cpu_present_at_boot(cpu) cpu_isset(cpu, cpu_present_at_boot)
-#define cpu_online(cpu)          cpu_isset(cpu, cpu_online_map) 
-#define cpu_possible(cpu)        cpu_isset(cpu, cpu_possible_map) 
 #define cpu_available(cpu)       cpu_isset(cpu, cpu_available_map) 
 
 /* Since OpenPIC has only 4 IPIs, we use slightly different message numbers.
@@ -77,9 +75,9 @@ extern void __cpu_die(unsigned int cpu);
 extern void cpu_die(void) __attribute__((noreturn));
 #endif /* !(CONFIG_SMP) */
 
-#define get_hard_smp_processor_id(CPU) (paca[(CPU)].xHwProcNum)
+#define get_hard_smp_processor_id(CPU) (paca[(CPU)].hw_cpu_id)
 #define set_hard_smp_processor_id(CPU, VAL) \
-	do { (paca[(CPU)].xHwProcNum = VAL); } while (0)
+	do { (paca[(CPU)].hw_proc_num = (VAL)); } while (0)
 
 #endif /* __ASSEMBLY__ */
 
diff --git a/include/asm-ppc64/spinlock.h b/include/asm-ppc64/spinlock.h
index a16b2ff58..d2074c44f 100644
--- a/include/asm-ppc64/spinlock.h
+++ b/include/asm-ppc64/spinlock.h
@@ -15,6 +15,7 @@
  * 2 of the License, or (at your option) any later version.
  */
 #include <linux/config.h>
+#include <asm/paca.h>
 
 typedef struct {
 	volatile unsigned int lock;
@@ -57,12 +58,12 @@ static __inline__ int _raw_spin_trylock(spinlock_t *lock)
 "1:	lwarx		%0,0,%2		# spin_trylock\n\
 	cmpwi		0,%0,0\n\
 	bne-		2f\n\
-	lwz		%1,24(13)\n\
+	lwz		%1,%3(13)\n\
 	stwcx.		%1,0,%2\n\
 	bne-		1b\n\
 	isync\n\
 2:"	: "=&r"(tmp), "=&r"(tmp2)
-	: "r"(&lock->lock)
+	: "r"(&lock->lock), "i"(offsetof(struct paca_struct, lock_token))
 	: "cr0", "memory");
 
 	return tmp == 0;
@@ -83,12 +84,12 @@ static __inline__ void _raw_spin_lock(spinlock_t *lock)
 "2:	lwarx		%0,0,%1\n\
 	cmpwi		0,%0,0\n\
 	bne-		1b\n\
-	lwz		%0,24(13)\n\
+	lwz		%0,%2(13)\n\
 	stwcx.		%0,0,%1\n\
 	bne-		2b\n\
 	isync"
 	: "=&r"(tmp)
-	: "r"(&lock->lock)
+	: "r"(&lock->lock), "i"(offsetof(struct paca_struct, lock_token))
 	: "cr0", "memory");
 }
 
@@ -115,12 +116,13 @@ static __inline__ void _raw_spin_lock_flags(spinlock_t *lock,
 3:	lwarx		%0,0,%2\n\
 	cmpwi		0,%0,0\n\
 	bne-		1b\n\
-	lwz		%1,24(13)\n\
+	lwz		%1,%4(13)\n\
 	stwcx.		%1,0,%2\n\
 	bne-		3b\n\
 	isync"
 	: "=&r"(tmp), "=&r"(tmp2)
-	: "r"(&lock->lock), "r"(flags)
+	: "r"(&lock->lock), "r"(flags),
+	  "i" (offsetof(struct paca_struct, lock_token))
 	: "cr0", "memory");
 }
 
diff --git a/include/asm-ppc64/system.h b/include/asm-ppc64/system.h
index bb1ebb203..276bfa813 100644
--- a/include/asm-ppc64/system.h
+++ b/include/asm-ppc64/system.h
@@ -111,13 +111,25 @@ extern void flush_instruction_cache(void);
 extern int _get_PVR(void);
 extern void giveup_fpu(struct task_struct *);
 extern void disable_kernel_fp(void);
+extern void flush_fp_to_thread(struct task_struct *);
 extern void enable_kernel_fp(void);
 extern void giveup_altivec(struct task_struct *);
 extern void disable_kernel_altivec(void);
 extern void enable_kernel_altivec(void);
+extern int emulate_altivec(struct pt_regs *);
 extern void cvt_fd(float *from, double *to, unsigned long *fpscr);
 extern void cvt_df(double *from, float *to, unsigned long *fpscr);
-extern int abs(int);
+
+#ifdef CONFIG_ALTIVEC
+extern void flush_altivec_to_thread(struct task_struct *);
+#else
+static inline void flush_altivec_to_thread(struct task_struct *t)
+{
+}
+#endif
+
+/* EBCDIC -> ASCII conversion for [0-9A-Z] on iSeries */
+extern unsigned char e2a(unsigned char);
 
 extern struct task_struct *__switch_to(struct task_struct *,
 				       struct task_struct *);
@@ -277,5 +289,14 @@ __cmpxchg(volatile void *ptr, unsigned long old, unsigned long new, int size)
 				    (unsigned long)_n_, sizeof(*(ptr))); \
   })
 
+/*
+ * We handle most unaligned accesses in hardware. On the other hand 
+ * unaligned DMA can be very expensive on some ppc64 IO chips (it does
+ * powers of 2 writes until it reaches sufficient alignment).
+ *
+ * Based on this we disable the IP header alignment in network drivers.
+ */
+#define NET_IP_ALIGN   0
+
 #endif /* __KERNEL__ */
 #endif
diff --git a/include/asm-ppc64/systemcfg.h b/include/asm-ppc64/systemcfg.h
index 72b5adba9..7cefeef2b 100644
--- a/include/asm-ppc64/systemcfg.h
+++ b/include/asm-ppc64/systemcfg.h
@@ -73,6 +73,8 @@ extern struct systemcfg *systemcfg;
 #define PV_SSTAR        0x0037
 #define PV_POWER4p      0x0038
 #define PV_GPUL		0x0039
+#define PV_POWER5	0x003a
+#define PV_970FX	0x003c
 #define PV_630          0x0040
 #define PV_630p         0x0041
 
diff --git a/include/asm-ppc64/thread_info.h b/include/asm-ppc64/thread_info.h
index a4674974c..04aec3ba8 100644
--- a/include/asm-ppc64/thread_info.h
+++ b/include/asm-ppc64/thread_info.h
@@ -13,6 +13,7 @@
 #ifndef __ASSEMBLY__
 #include <linux/config.h>
 #include <asm/processor.h>
+#include <asm/page.h>
 #include <linux/stringify.h>
 
 /*
@@ -23,8 +24,10 @@ struct thread_info {
 	struct exec_domain *exec_domain;	/* execution domain */
 	unsigned long	flags;			/* low level flags */
 	int		cpu;			/* cpu we're on */
-	int		preempt_count;		/* not used at present */
+	int		preempt_count;
 	struct restart_block restart_block;
+	/* set by force_successful_syscall_return */
+	unsigned char	syscall_noerror;
 };
 
 /*
@@ -73,7 +76,7 @@ struct thread_info {
 static inline struct thread_info *current_thread_info(void)
 {
 	struct thread_info *ti;
-	__asm__("clrrdi %0,1,14" : "=r"(ti));
+	__asm__("clrrdi %0,1,%1" : "=r"(ti) : "i" (THREAD_SHIFT));
 	return ti;
 }
 
diff --git a/include/asm-ppc64/time.h b/include/asm-ppc64/time.h
index dfa720214..1e0162c2f 100644
--- a/include/asm-ppc64/time.h
+++ b/include/asm-ppc64/time.h
@@ -78,8 +78,8 @@ static __inline__ void set_dec(int val)
 	struct paca_struct *lpaca = get_paca();
 	int cur_dec;
 
-	if (lpaca->xLpPaca.xSharedProc) {
-		lpaca->xLpPaca.xVirtualDecr = val;
+	if (lpaca->lppaca.xSharedProc) {
+		lpaca->lppaca.xVirtualDecr = val;
 		cur_dec = get_dec();
 		if (cur_dec > val)
 			HvCall_setVirtualDecr();
diff --git a/include/asm-ppc64/uaccess.h b/include/asm-ppc64/uaccess.h
index 9423be5ad..77906c935 100644
--- a/include/asm-ppc64/uaccess.h
+++ b/include/asm-ppc64/uaccess.h
@@ -175,7 +175,7 @@ do {									\
 #define __get_user_check(x,ptr,size)					\
 ({									\
 	long __gu_err = -EFAULT, __gu_val = 0;				\
-	const __typeof__(*(ptr)) *__gu_addr = (ptr);			\
+	const __typeof__(*(ptr)) __user *__gu_addr = (ptr);		\
 	if (access_ok(VERIFY_READ,__gu_addr,size))			\
 		__get_user_size(__gu_val,__gu_addr,(size),__gu_err,-EFAULT);\
 	(x) = (__typeof__(*(ptr)))__gu_val;				\
@@ -272,33 +272,12 @@ __copy_to_user(void __user *to, const void *from, unsigned long n)
 #define __copy_in_user(to, from, size) \
 	__copy_tofrom_user((to), (from), (size))
 
-static inline unsigned long
-copy_from_user(void *to, const void __user *from, unsigned long n)
-{
-	if (likely(access_ok(VERIFY_READ, from, n)))
-		n = __copy_from_user(to, from, n);
-	else
-		memset(to, 0, n);
-	return n;
-}
-
-static inline unsigned long
-copy_to_user(void __user *to, const void *from, unsigned long n)
-{
-	if (likely(access_ok(VERIFY_WRITE, to, n)))
-		n = __copy_to_user(to, from, n);
-	return n;
-}
-
-static inline unsigned long
-copy_in_user(void __user *to, const void __user *from, unsigned long n)
-{
-	might_sleep();
-	if (likely(access_ok(VERIFY_READ, from, n) &&
-	    access_ok(VERIFY_WRITE, to, n)))
-		n =__copy_tofrom_user(to, from, n);
-	return n;
-}
+extern unsigned long copy_from_user(void *to, const void __user *from,
+				    unsigned long n);
+extern unsigned long copy_to_user(void __user *to, const void *from,
+				  unsigned long n);
+extern unsigned long copy_in_user(void __user *to, const void __user *from,
+				  unsigned long n);
 
 extern unsigned long __clear_user(void __user *addr, unsigned long size);
 
diff --git a/include/asm-ppc64/udbg.h b/include/asm-ppc64/udbg.h
index cdc306b17..804e3b9b3 100644
--- a/include/asm-ppc64/udbg.h
+++ b/include/asm-ppc64/udbg.h
@@ -19,11 +19,8 @@ int udbg_write(const char *s, int n);
 int udbg_read(char *buf, int buflen);
 struct console;
 void udbg_console_write(struct console *con, const char *s, unsigned int n);
-void udbg_puthex(unsigned long val);
-void udbg_printSP(const char *s);
 void udbg_printf(const char *fmt, ...);
 void udbg_ppcdbg(unsigned long flags, const char *fmt, ...);
 unsigned long udbg_ifdebug(unsigned long flags);
 
-void udbg_init_uart(void *comport);
 #endif
diff --git a/include/asm-ppc64/vio.h b/include/asm-ppc64/vio.h
index 36fc9f9d1..3fd465c92 100644
--- a/include/asm-ppc64/vio.h
+++ b/include/asm-ppc64/vio.h
@@ -14,6 +14,7 @@
 #ifndef _ASM_VIO_H
 #define _ASM_VIO_H
 
+#include <linux/config.h>
 #include <linux/init.h>
 #include <linux/errno.h>
 #include <linux/device.h>
@@ -44,7 +45,10 @@ struct iommu_table;
 int vio_register_driver(struct vio_driver *drv);
 void vio_unregister_driver(struct vio_driver *drv);
 
-struct vio_dev * __devinit vio_register_device(struct device_node *node_vdev);
+#ifdef CONFIG_PPC_PSERIES
+struct vio_dev * __devinit vio_register_device_node(
+		struct device_node *node_vdev);
+#endif
 void __devinit vio_unregister_device(struct vio_dev *dev);
 struct vio_dev *vio_find_node(struct device_node *vnode);
 
@@ -108,6 +112,8 @@ static inline struct vio_driver *to_vio_driver(struct device_driver *drv)
  */
 struct vio_dev {
 	struct iommu_table *iommu_table;     /* vio_map_* uses this */
+	char *name;
+	char *type;
 	uint32_t unit_address;	
 	unsigned int irq;
 
diff --git a/include/asm-ppc64/xics.h b/include/asm-ppc64/xics.h
index fc103cedb..560f4fd99 100644
--- a/include/asm-ppc64/xics.h
+++ b/include/asm-ppc64/xics.h
@@ -19,6 +19,9 @@ int xics_get_irq(struct pt_regs *);
 void xics_setup_cpu(void);
 void xics_cause_IPI(int cpu);
 
+/* first argument is ignored for now*/
+void pSeriesLP_cppr_info(int n_cpu, u8 value);
+
 struct xics_ipi_struct {
 	volatile unsigned long value;
 } ____cacheline_aligned;
diff --git a/include/asm-s390/byteorder.h b/include/asm-s390/byteorder.h
index 91a6f3893..2cc35a0e1 100644
--- a/include/asm-s390/byteorder.h
+++ b/include/asm-s390/byteorder.h
@@ -14,7 +14,7 @@
 #ifdef __GNUC__
 
 #ifdef __s390x__
-static __inline__ __u64 ___arch__swab64p(__u64 *x)
+static __inline__ __u64 ___arch__swab64p(const __u64 *x)
 {
 	__u64 result;
 
@@ -40,7 +40,7 @@ static __inline__ void ___arch__swab64s(__u64 *x)
 }
 #endif /* __s390x__ */
 
-static __inline__ __u32 ___arch__swab32p(__u32 *x)
+static __inline__ __u32 ___arch__swab32p(const __u32 *x)
 {
 	__u32 result;
 	
@@ -77,7 +77,7 @@ static __inline__ void ___arch__swab32s(__u32 *x)
 	*x = ___arch__swab32p(x);
 }
 
-static __inline__ __u16 ___arch__swab16p(__u16 *x)
+static __inline__ __u16 ___arch__swab16p(const __u16 *x)
 {
 	__u16 result;
 	
diff --git a/include/asm-s390/debug.h b/include/asm-s390/debug.h
index 3148d5b2c..d8a34532b 100644
--- a/include/asm-s390/debug.h
+++ b/include/asm-s390/debug.h
@@ -34,7 +34,6 @@ struct __debug_entry{
 #define __DEBUG_FEATURE_VERSION      1  /* version of debug feature */
 
 #ifdef __KERNEL__
-#include <linux/version.h>
 #include <linux/spinlock.h>
 #include <linux/kernel.h>
 #include <linux/time.h>
diff --git a/include/asm-s390/fcntl.h b/include/asm-s390/fcntl.h
index 307c01b45..48f692b45 100644
--- a/include/asm-s390/fcntl.h
+++ b/include/asm-s390/fcntl.h
@@ -27,6 +27,7 @@
 #define O_LARGEFILE	0100000
 #define O_DIRECTORY	0200000	/* must be a directory */
 #define O_NOFOLLOW	0400000 /* don't follow links */
+#define O_NOATIME	01000000
 
 #define F_DUPFD		0	/* dup */
 #define F_GETFD		1	/* get close_on_exec */
diff --git a/include/asm-s390/percpu.h b/include/asm-s390/percpu.h
index 7adef697a..123fcaca2 100644
--- a/include/asm-s390/percpu.h
+++ b/include/asm-s390/percpu.h
@@ -1,30 +1,70 @@
 #ifndef __ARCH_S390_PERCPU__
 #define __ARCH_S390_PERCPU__
 
-#include <asm-generic/percpu.h>
+#include <linux/compiler.h>
 #include <asm/lowcore.h>
 
+#define __GENERIC_PER_CPU
+
 /*
- * For builtin kernel code s390 uses the generic implementation for
- * per cpu data, with the exception that the offset of the cpu local
- * data area is cached in the cpu's lowcore memory
+ * s390 uses its own implementation for per cpu data, the offset of
+ * the cpu local data area is cached in the cpu's lowcore memory.
  * For 64 bit module code s390 forces the use of a GOT slot for the
  * address of the per cpu variable. This is needed because the module
  * may be more than 4G above the per cpu area.
  */
 #if defined(__s390x__) && defined(MODULE)
-#define __get_got_cpu_var(var,offset) \
+
+#define __reloc_hide(var,offset) \
   (*({ unsigned long *__ptr; \
-       asm ( "larl %0,per_cpu__"#var"@GOTENT" : "=a" (__ptr) ); \
-       ((typeof(&per_cpu__##var))((*__ptr) + offset)); \
-    }))
-#undef __get_cpu_var
-#define __get_cpu_var(var) __get_got_cpu_var(var,S390_lowcore.percpu_offset)
-#undef per_cpu
-#define per_cpu(var,cpu) __get_got_cpu_var(var,__per_cpu_offset[cpu])
+       asm ( "larl %0,per_cpu__"#var"@GOTENT" \
+             : "=a" (__ptr) : "X" (per_cpu__##var) ); \
+       (typeof(&per_cpu__##var))((*__ptr) + (offset)); }))
+
 #else
-#undef __get_cpu_var
-#define __get_cpu_var(var) (*RELOC_HIDE(&per_cpu__##var, S390_lowcore.percpu_offset))
+
+#define __reloc_hide(var, offset) \
+  (*({ unsigned long __ptr; \
+       asm ( "" : "=a" (__ptr) : "0" (&per_cpu__##var) ); \
+       (typeof(&per_cpu__##var)) (__ptr + (offset)); }))
+
 #endif
 
+#ifdef CONFIG_SMP
+
+extern unsigned long __per_cpu_offset[NR_CPUS];
+
+/* Separate out the type, so (int[3], foo) works. */
+#define DEFINE_PER_CPU(type, name) \
+    __attribute__((__section__(".data.percpu"))) \
+    __typeof__(type) per_cpu__##name
+
+#define __get_cpu_var(var) __reloc_hide(var,S390_lowcore.percpu_offset)
+#define per_cpu(var,cpu) __reloc_hide(var,__per_cpu_offset[cpu])
+
+/* A macro to avoid #include hell... */
+#define percpu_modcopy(pcpudst, src, size)			\
+do {								\
+	unsigned int __i;					\
+	for (__i = 0; __i < NR_CPUS; __i++)			\
+		if (cpu_possible(__i))				\
+			memcpy((pcpudst)+__per_cpu_offset[__i],	\
+			       (src), (size));			\
+} while (0)
+
+#else /* ! SMP */
+
+#define DEFINE_PER_CPU(type, name) \
+    __typeof__(type) per_cpu__##name
+
+#define __get_cpu_var(var) __reloc_hide(var,0)
+#define per_cpu(var,cpu) __reloc_hide(var,0)
+
+#endif /* SMP */
+
+#define DECLARE_PER_CPU(type, name) extern __typeof__(type) per_cpu__##name
+
+#define EXPORT_PER_CPU_SYMBOL(var) EXPORT_SYMBOL(per_cpu__##var)
+#define EXPORT_PER_CPU_SYMBOL_GPL(var) EXPORT_SYMBOL_GPL(per_cpu__##var)
+
 #endif /* __ARCH_S390_PERCPU__ */
diff --git a/include/asm-s390/pgtable.h b/include/asm-s390/pgtable.h
index 11b67469b..05ac76fd3 100644
--- a/include/asm-s390/pgtable.h
+++ b/include/asm-s390/pgtable.h
@@ -654,9 +654,11 @@ static inline pte_t mk_pte_phys(unsigned long physpage, pgprot_t pgprot)
 	__pte;                                                            \
 })
 
-#define arch_set_page_uptodate(__page)					  \
+#define SetPageUptodate(_page) \
 	do {								  \
-		asm volatile ("sske %0,%1" : : "d" (0),			  \
+		struct page *__page = (_page);				  \
+		if (!test_and_set_bit(PG_uptodate, &__page->flags))	  \
+			asm volatile ("sske %0,%1" : : "d" (0),		  \
 			      "a" (__pa((__page-mem_map) << PAGE_SHIFT)));\
 	} while (0)
 
diff --git a/include/asm-s390/processor.h b/include/asm-s390/processor.h
index 33154f85a..4c9d60702 100644
--- a/include/asm-s390/processor.h
+++ b/include/asm-s390/processor.h
@@ -319,6 +319,16 @@ static inline void disabled_wait(unsigned long code)
 #endif /* __s390x__ */
 }
 
+/*
+ * CPU idle notifier chain.
+ */
+#define CPU_IDLE	0
+#define CPU_NOT_IDLE	1
+
+struct notifier_block;
+int register_idle_notifier(struct notifier_block *nb);
+int unregister_idle_notifier(struct notifier_block *nb);
+
 #endif
 
 #endif                                 /* __ASM_S390_PROCESSOR_H           */
diff --git a/include/asm-s390/resource.h b/include/asm-s390/resource.h
index bc2520e1d..5f0f2ba95 100644
--- a/include/asm-s390/resource.h
+++ b/include/asm-s390/resource.h
@@ -24,8 +24,10 @@
 #define RLIMIT_MEMLOCK	8		/* max locked-in-memory address space */
 #define RLIMIT_AS	9		/* address space limit */
 #define RLIMIT_LOCKS	10		/* maximum file locks held */
-  
-#define RLIM_NLIMITS	11
+#define RLIMIT_SIGPENDING 11		/* max number of pending signals */
+#define RLIMIT_MSGQUEUE 12		/* maximum bytes in POSIX mqueues */
+
+#define RLIM_NLIMITS	13
 
 /*
  * SuS says limits have to be unsigned.
@@ -48,6 +50,8 @@
 	{ RLIM_INFINITY, RLIM_INFINITY },		\
 	{ RLIM_INFINITY, RLIM_INFINITY },		\
 	{ RLIM_INFINITY, RLIM_INFINITY },		\
+	{ MAX_SIGPENDING, MAX_SIGPENDING },		\
+	{ MQ_BYTES_MAX, MQ_BYTES_MAX },			\
 }
 
 #endif /* __KERNEL__ */
diff --git a/include/asm-s390/setup.h b/include/asm-s390/setup.h
index ba3b3510e..0d51c484c 100644
--- a/include/asm-s390/setup.h
+++ b/include/asm-s390/setup.h
@@ -36,7 +36,6 @@ extern unsigned long machine_flags;
 #define MACHINE_IS_P390		(machine_flags & 4)
 #define MACHINE_HAS_MVPG	(machine_flags & 16)
 #define MACHINE_HAS_DIAG44	(machine_flags & 32)
-#define MACHINE_NEW_STIDP	(machine_flags & 64)
 #define MACHINE_HAS_IDTE	(machine_flags & 128)
 
 #ifndef __s390x__
@@ -54,7 +53,7 @@ extern unsigned long machine_flags;
  * Console mode. Override with conmode=
  */
 extern unsigned int console_mode;
-extern unsigned int console_device;
+extern unsigned int console_devno;
 extern unsigned int console_irq;
 
 #define CONSOLE_IS_UNDEFINED	(console_mode == 0)
diff --git a/include/asm-s390/sigp.h b/include/asm-s390/sigp.h
index d5583c78d..3979bc385 100644
--- a/include/asm-s390/sigp.h
+++ b/include/asm-s390/sigp.h
@@ -5,6 +5,7 @@
  *    Copyright (C) 1999 IBM Deutschland Entwicklung GmbH, IBM Corporation
  *    Author(s): Denis Joseph Barrow (djbarrow@de.ibm.com,barrow_dj@yahoo.com),
  *               Martin Schwidefsky (schwidefsky@de.ibm.com)
+ *               Heiko Carstens (heiko.carstens@de.ibm.com)
  *
  *  sigp.h by D.J. Barrow (c) IBM 1999
  *  contains routines / structures for signalling other S/390 processors in an
@@ -72,17 +73,10 @@ signal_processor(__u16 cpu_addr, sigp_order_code order_code)
 	sigp_ccode ccode;
 
 	__asm__ __volatile__(
-#ifndef __s390x__
 		"    sr     1,1\n"        /* parameter=0 in gpr 1 */
 		"    sigp   1,%1,0(%2)\n"
 		"    ipm    %0\n"
 		"    srl    %0,28\n"
-#else /* __s390x__ */
-		"    sgr    1,1\n"        /* parameter=0 in gpr 1 */
-		"    sigp   1,%1,0(%2)\n"
-		"    ipm    %0\n"
-		"    srl    %0,28"
-#endif /* __s390x__ */
 		: "=d" (ccode)
 		: "d" (__cpu_logical_map[cpu_addr]), "a" (order_code)
 		: "cc" , "memory", "1" );
@@ -93,23 +87,16 @@ signal_processor(__u16 cpu_addr, sigp_order_code order_code)
  * Signal processor with parameter
  */
 extern __inline__ sigp_ccode
-signal_processor_p(unsigned long parameter,__u16 cpu_addr,
+signal_processor_p(__u32 parameter, __u16 cpu_addr,
 		   sigp_order_code order_code)
 {
 	sigp_ccode ccode;
 	
 	__asm__ __volatile__(
-#ifndef __s390x__
 		"    lr     1,%1\n"       /* parameter in gpr 1 */
 		"    sigp   1,%2,0(%3)\n"
 		"    ipm    %0\n"
 		"    srl    %0,28\n"
-#else /* __s390x__ */
-		"    lgr    1,%1\n"       /* parameter in gpr 1 */
-		"    sigp   1,%2,0(%3)\n"
-		"    ipm    %0\n"
-		"    srl    %0,28\n"
-#endif /* __s390x__ */
 		: "=d" (ccode)
 		: "d" (parameter), "d" (__cpu_logical_map[cpu_addr]),
                   "a" (order_code)
@@ -121,27 +108,18 @@ signal_processor_p(unsigned long parameter,__u16 cpu_addr,
  * Signal processor with parameter and return status
  */
 extern __inline__ sigp_ccode
-signal_processor_ps(unsigned long *statusptr, unsigned long parameter,
+signal_processor_ps(__u32 *statusptr, __u32 parameter,
 		    __u16 cpu_addr, sigp_order_code order_code)
 {
 	sigp_ccode ccode;
 	
 	__asm__ __volatile__(
-#ifndef __s390x__
-		"    sr     2,2\n"        /* clear status so it doesn't contain rubbish if not saved. */
+		"    sr     2,2\n"        /* clear status */
 		"    lr     3,%2\n"       /* parameter in gpr 3 */
 		"    sigp   2,%3,0(%4)\n"
 		"    st     2,%1\n"
 		"    ipm    %0\n"
 		"    srl    %0,28\n"
-#else /* __s390x__ */
-		"    sgr    2,2\n"        /* clear status so it doesn't contain rubbish if not saved. */
-		"    lgr    3,%2\n"       /* parameter in gpr 3 */
-		"    sigp   2,%3,0(%4)\n"
-		"    stg    2,%1\n"
-		"    ipm    %0\n"
-		"    srl    %0,28\n"
-#endif /* __s390x__ */
 		: "=d" (ccode), "=m" (*statusptr)
 		: "d" (parameter), "d" (__cpu_logical_map[cpu_addr]),
                   "a" (order_code)
@@ -151,5 +129,3 @@ signal_processor_ps(unsigned long *statusptr, unsigned long parameter,
 }
 
 #endif /* __SIGP__ */
-
-
diff --git a/include/asm-s390/smp.h b/include/asm-s390/smp.h
index 7e6132400..e992bd6b5 100644
--- a/include/asm-s390/smp.h
+++ b/include/asm-s390/smp.h
@@ -5,6 +5,7 @@
  *    Copyright (C) 1999 IBM Deutschland Entwicklung GmbH, IBM Corporation
  *    Author(s): Denis Joseph Barrow (djbarrow@de.ibm.com,barrow_dj@yahoo.com),
  *               Martin Schwidefsky (schwidefsky@de.ibm.com)
+ *               Heiko Carstens (heiko.carstens@de.ibm.com)
  */
 #ifndef __ASM_SMP_H
 #define __ASM_SMP_H
@@ -31,10 +32,6 @@ typedef struct
 
 extern int smp_call_function_on(void (*func) (void *info), void *info,
 				int nonatomic, int wait, int cpu);
-
-extern cpumask_t cpu_online_map;
-extern cpumask_t cpu_possible_map;
-
 #define NO_PROC_ID		0xFF		/* No processor magic marker */
 
 /*
@@ -51,7 +48,8 @@ extern cpumask_t cpu_possible_map;
 
 #define smp_processor_id() (S390_lowcore.cpu_data.cpu_nr)
 
-#define cpu_online(cpu) cpu_isset(cpu, cpu_online_map)
+extern int smp_get_cpu(cpumask_t cpu_map);
+extern void smp_put_cpu(int cpu);
 
 extern __inline__ __u16 hard_smp_processor_id(void)
 {
@@ -63,10 +61,23 @@ extern __inline__ __u16 hard_smp_processor_id(void)
 
 #define cpu_logical_map(cpu) (cpu)
 
+extern int __cpu_disable (void);
+extern void __cpu_die (unsigned int cpu);
+extern void cpu_die (void) __attribute__ ((noreturn));
+extern int __cpu_up (unsigned int cpu);
+
 #endif
 
 #ifndef CONFIG_SMP
-#define smp_call_function_on(func,info,nonatomic,wait,cpu)      ({ 0; })
+static inline int
+smp_call_function_on(void (*func) (void *info), void *info,
+		     int nonatomic, int wait, int cpu)
+{
+	func(info);
+	return 0;
+}
+#define smp_get_cpu(cpu) ({ 0; })
+#define smp_put_cpu(cpu) ({ 0; })
 #endif
 
 #endif
diff --git a/include/asm-s390/thread_info.h b/include/asm-s390/thread_info.h
index a2bfdeedf..b4b2d323d 100644
--- a/include/asm-s390/thread_info.h
+++ b/include/asm-s390/thread_info.h
@@ -85,7 +85,7 @@ static inline struct thread_info *current_thread_info(void)
 #define TIF_NEED_RESCHED	3	/* rescheduling necessary */
 #define TIF_RESTART_SVC		4	/* restart svc with new svc number */
 #define TIF_SYSCALL_AUDIT	5	/* syscall auditing active */
-#define TIF_SINGLE_STEP		6	/* single stepped svc */
+#define TIF_SINGLE_STEP		6	/* deliver sigtrap on return to user */
 #define TIF_USEDFPU		16	/* FPU was used by this task this quantum (SMP) */
 #define TIF_POLLING_NRFLAG	17	/* true if poll_idle() is polling 
 					   TIF_NEED_RESCHED */
diff --git a/include/asm-s390/vtoc.h b/include/asm-s390/vtoc.h
index f805a0b46..a14e34e80 100644
--- a/include/asm-s390/vtoc.h
+++ b/include/asm-s390/vtoc.h
@@ -14,7 +14,6 @@
 #include <linux/fs.h>
 #include <linux/types.h>
 #include <linux/hdreg.h>
-#include <linux/version.h>
 #include <asm/dasd.h>
 #endif
 
diff --git a/include/asm-sh/bugs.h b/include/asm-sh/bugs.h
index 9ceca407f..154d774f9 100644
--- a/include/asm-sh/bugs.h
+++ b/include/asm-sh/bugs.h
@@ -26,7 +26,7 @@ static void __init check_bugs(void)
 	case CPU_SH7604:
 		*p++ = '2';
 		break;
-	case CPU_SH7708 ... CPU_SH7729:
+	case CPU_SH7705 ... CPU_SH7300:
 		*p++ = '3';
 		break;
 	case CPU_SH7750 ... CPU_ST40GX1:
diff --git a/include/asm-sh/cache.h b/include/asm-sh/cache.h
index 9decb1ced..62b2f50fb 100644
--- a/include/asm-sh/cache.h
+++ b/include/asm-sh/cache.h
@@ -28,7 +28,8 @@ struct cache_info {
 	unsigned int sets;
 	unsigned int linesz;
 
-	unsigned int way_shift;
+	unsigned int way_incr;
+
 	unsigned int entry_shift;
 	unsigned int entry_mask;
 
diff --git a/include/asm-sh/checksum.h b/include/asm-sh/checksum.h
index 5b96a7771..512ffe62c 100644
--- a/include/asm-sh/checksum.h
+++ b/include/asm-sh/checksum.h
@@ -201,8 +201,10 @@ static __inline__ unsigned short int csum_ipv6_magic(struct in6_addr *saddr,
  *	Copy and checksum to user
  */
 #define HAVE_CSUM_COPY_USER
-static __inline__ unsigned int csum_and_copy_to_user (const char *src, char *dst,
-				    int len, int sum, int *err_ptr)
+static __inline__ unsigned int csum_and_copy_to_user (const char *src, 
+						      char __user *dst,
+						      int len, int sum,
+						      int *err_ptr)
 {
 	if (access_ok(VERIFY_WRITE, dst, len))
 		return csum_partial_copy_generic(src, dst, len, sum, NULL, err_ptr);
diff --git a/include/asm-sh/cpu-sh3/dac.h b/include/asm-sh/cpu-sh3/dac.h
index 7f4129d25..05fda8316 100644
--- a/include/asm-sh/cpu-sh3/dac.h
+++ b/include/asm-sh/cpu-sh3/dac.h
@@ -1,5 +1,5 @@
-#ifndef __ASM_SH_DAC_H
-#define __ASM_SH_DAC_H
+#ifndef __ASM_CPU_SH3_DAC_H
+#define __ASM_CPU_SH3_DAC_H
 
 /*
  * Copyright (C) 2003  Andriy Skulysh
@@ -38,5 +38,4 @@ static __inline__ void sh_dac_output(u8 value, int channel)
 	else ctrl_outb(value,DADR0);
 }
 
-#endif /* __ASM_SH_DAC_H */
-
+#endif /* __ASM_CPU_SH3_DAC_H */
diff --git a/include/asm-sh/cpu-sh4/dma.h b/include/asm-sh/cpu-sh4/dma.h
index 3ef2d0a54..e2b91adf8 100644
--- a/include/asm-sh/cpu-sh4/dma.h
+++ b/include/asm-sh/cpu-sh4/dma.h
@@ -3,5 +3,15 @@
 
 #define SH_DMAC_BASE	0xffa00000
 
+#define SAR	((unsigned long[]){SH_DMAC_BASE + 0x00, SH_DMAC_BASE + 0x10, \
+				   SH_DMAC_BASE + 0x20, SH_DMAC_BASE + 0x30})
+#define DAR	((unsigned long[]){SH_DMAC_BASE + 0x04, SH_DMAC_BASE + 0x14, \
+				   SH_DMAC_BASE + 0x24, SH_DMAC_BASE + 0x34})
+#define DMATCR	((unsigned long[]){SH_DMAC_BASE + 0x08, SH_DMAC_BASE + 0x18, \
+				   SH_DMAC_BASE + 0x28, SH_DMAC_BASE + 0x38})
+#define CHCR	((unsigned long[]){SH_DMAC_BASE + 0x0c, SH_DMAC_BASE + 0x1c, \
+				   SH_DMAC_BASE + 0x2c, SH_DMAC_BASE + 0x3c})
+#define DMAOR	(SH_DMAC_BASE + 0x40)
+
 #endif /* __ASM_CPU_SH4_DMA_H */
 
diff --git a/include/asm-sh/dma-mapping.h b/include/asm-sh/dma-mapping.h
index f3817945e..8f149477e 100644
--- a/include/asm-sh/dma-mapping.h
+++ b/include/asm-sh/dma-mapping.h
@@ -44,6 +44,8 @@ static inline void *dma_alloc_coherent(struct device *dev, size_t size,
 	if (dev && dev->bus == &pci_bus_type)
 		return __pci_alloc_consistent(NULL, size, dma_handle);
 #endif
+	if (sh_mv.mv_consistent_alloc)
+		return sh_mv.mv_consistent_alloc(dev, size, dma_handle, flag);
 
 	return consistent_alloc(flag, size, dma_handle);
 }
@@ -61,6 +63,11 @@ static inline void dma_free_coherent(struct device *dev, size_t size,
 	}
 #endif
 
+	if (sh_mv.mv_consistent_free) {
+		sh_mv.mv_consistent_free(dev, size, vaddr, dma_handle);
+		return;
+	}
+
 	consistent_free(vaddr, size);
 }
 
@@ -152,6 +159,26 @@ static inline void dma_sync_sg(struct device *dev, struct scatterlist *sg,
 	}
 }
 
+static inline void dma_sync_single_for_cpu(struct device *dev,
+					   dma_addr_t dma_handle, size_t size,
+					   enum dma_data_direction dir)
+	__attribute__ ((alias("dma_sync_single")));
+
+static inline void dma_sync_single_for_device(struct device *dev,
+					   dma_addr_t dma_handle, size_t size,
+					   enum dma_data_direction dir)
+	__attribute__ ((alias("dma_sync_single")));
+
+static inline void dma_sync_sg_for_cpu(struct device *dev,
+				       struct scatterlist *sg, int nelems,
+				       enum dma_data_direction dir)
+	__attribute__ ((alias("dma_sync_sg")));
+
+static inline void dma_sync_sg_for_device(struct device *dev,
+				       struct scatterlist *sg, int nelems,
+				       enum dma_data_direction dir)
+	__attribute__ ((alias("dma_sync_sg")));
+
 static inline int dma_get_cache_alignment(void)
 {
 	/*
@@ -161,5 +188,10 @@ static inline int dma_get_cache_alignment(void)
 	return L1_CACHE_BYTES;
 }
 
+static inline int dma_mapping_error(dma_addr_t dma_addr)
+{
+	return dma_addr == 0;
+}
+
 #endif /* __ASM_SH_DMA_MAPPING_H */
 
diff --git a/include/asm-sh/dma.h b/include/asm-sh/dma.h
index bc5c3b6a2..f9b95e211 100644
--- a/include/asm-sh/dma.h
+++ b/include/asm-sh/dma.h
@@ -1,7 +1,7 @@
 /*
  * include/asm-sh/dma.h
  *
- * Copyright (C) 2003  Paul Mundt
+ * Copyright (C) 2003, 2004  Paul Mundt
  *
  * This file is subject to the terms and conditions of the GNU General Public
  * License.  See the file "COPYING" in the main directory of this archive
@@ -13,6 +13,7 @@
 #include <linux/config.h>
 #include <linux/spinlock.h>
 #include <linux/wait.h>
+#include <linux/sysdev.h>
 #include <asm/cpu/dma.h>
 #include <asm/semaphore.h>
 
@@ -29,7 +30,7 @@
 #  define MAX_DMA_CHANNELS	(CONFIG_NR_ONCHIP_DMA_CHANNELS)
 #endif
 
-/* 
+/*
  * Read and write modes can mean drastically different things depending on the
  * channel configuration. Consult your DMAC documentation and module
  * implementation for further clues.
@@ -38,40 +39,69 @@
 #define DMA_MODE_WRITE		0x01
 #define DMA_MODE_MASK		0x01
 
+#define DMA_AUTOINIT		0x10
+
+/*
+ * DMAC (dma_info) flags
+ */
+enum {
+	DMAC_CHANNELS_CONFIGURED	= 0x00,
+	DMAC_CHANNELS_TEI_CAPABLE	= 0x01,
+};
+
+/*
+ * DMA channel capabilities / flags
+ */
+enum {
+	DMA_CONFIGURED			= 0x00,
+	DMA_TEI_CAPABLE			= 0x01,
+};
+
 extern spinlock_t dma_spin_lock;
 
-struct dma_info;
+struct dma_channel;
 
 struct dma_ops {
-	const char *name;
-
-	int (*request)(struct dma_info *info);
-	void (*free)(struct dma_info *info);
+	int (*request)(struct dma_channel *chan);
+	void (*free)(struct dma_channel *chan);
 
-	int (*get_residue)(struct dma_info *info);
-	int (*xfer)(struct dma_info *info);
-	void (*configure)(struct dma_info *info, unsigned long flags);
+	int (*get_residue)(struct dma_channel *chan);
+	int (*xfer)(struct dma_channel *chan);
+	void (*configure)(struct dma_channel *chan, unsigned long flags);
 };
 
-struct dma_info {
-	const char *dev_id;
+struct dma_channel {
+	char dev_id[16];
 
 	unsigned int chan;
 	unsigned int mode;
 	unsigned int count;
-	
+
 	unsigned long sar;
 	unsigned long dar;
 
-	unsigned int configured:1;
-	unsigned int tei_capable:1;
+	unsigned long flags;
 	atomic_t busy;
 
 	struct semaphore sem;
 	wait_queue_head_t wait_queue;
+
+	struct sys_device dev;
+};
+
+struct dma_info {
+	const char *name;
+	unsigned int nr_channels;
+	unsigned long flags;
+
 	struct dma_ops *ops;
+	struct dma_channel *channels;
+
+	struct list_head list;
 };
 
+#define to_dma_channel(channel) container_of(channel, struct dma_channel, dev)
+
 /* arch/sh/drivers/dma/dma-api.c */
 extern int dma_xfer(unsigned int chan, unsigned long from,
 		    unsigned long to, size_t size, unsigned int mode);
@@ -90,17 +120,22 @@ extern int request_dma(unsigned int chan, const char *dev_id);
 extern void free_dma(unsigned int chan);
 extern int get_dma_residue(unsigned int chan);
 extern struct dma_info *get_dma_info(unsigned int chan);
+extern struct dma_channel *get_dma_channel(unsigned int chan);
 extern void dma_wait_for_completion(unsigned int chan);
 extern void dma_configure_channel(unsigned int chan, unsigned long flags);
 
-extern int register_dmac(struct dma_ops *ops);
+extern int register_dmac(struct dma_info *info);
+extern void unregister_dmac(struct dma_info *info);
 
-extern struct dma_info dma_info[];
+#ifdef CONFIG_SYSFS
+/* arch/sh/drivers/dma/dma-sysfs.c */
+extern int dma_create_sysfs_files(struct dma_channel *);
+#endif
 
 #ifdef CONFIG_PCI
 extern int isa_dma_bridge_buggy;
 #else
-#define isa_dma_bridge_buggy 	(0)
+#define isa_dma_bridge_buggy	(0)
 #endif
 
 #endif /* __ASM_SH_DMA_H */
diff --git a/include/asm-sh/fcntl.h b/include/asm-sh/fcntl.h
index 21e39b7cc..0b3ae524e 100644
--- a/include/asm-sh/fcntl.h
+++ b/include/asm-sh/fcntl.h
@@ -20,6 +20,7 @@
 #define O_LARGEFILE	0100000
 #define O_DIRECTORY	0200000	/* must be a directory */
 #define O_NOFOLLOW	0400000 /* don't follow links */
+#define O_NOATIME	01000000
 
 #define F_DUPFD		0	/* dup */
 #define F_GETFD		1	/* get close_on_exec */
diff --git a/include/asm-sh/hp6xx/hp6xx.h b/include/asm-sh/hp6xx/hp6xx.h
index 53079d295..a26247fd3 100644
--- a/include/asm-sh/hp6xx/hp6xx.h
+++ b/include/asm-sh/hp6xx/hp6xx.h
@@ -5,9 +5,22 @@
  * Copyright (C) 2003  Andriy Skulysh
  */
 
+#define HP680_TS_IRQ IRQ3_IRQ
 
-#define DAC_LCD_BRIGHTNESS		0
-#define DAC_SPEAKER_VOLUME		1
+#define DAC_LCD_BRIGHTNESS	0
+#define DAC_SPEAKER_VOLUME	1
+
+#define PHDR_TS_PEN_DOWN	0x08
+
+#define SCPDR_TS_SCAN_ENABLE	0x20
+#define SCPDR_TS_SCAN_Y		0x02
+#define SCPDR_TS_SCAN_X		0x01
+
+#define SCPCR_TS_ENABLE		0x405
+#define SCPCR_TS_MASK		0xc0f
+
+#define ADC_CHANNEL_TS_Y	1
+#define ADC_CHANNEL_TS_X	2
 
 #define HD64461_GPADR_SPEAKER	0x01
 #define HD64461_GPADR_PCMCIA0	(0x02|0x08)
@@ -16,4 +29,3 @@
 
 
 #endif /* __ASM_SH_HP6XX_H */
-
diff --git a/include/asm-sh/ide.h b/include/asm-sh/ide.h
index 7758b3ec3..f42cf3977 100644
--- a/include/asm-sh/ide.h
+++ b/include/asm-sh/ide.h
@@ -15,73 +15,12 @@
 #ifdef __KERNEL__
 
 #include <linux/config.h>
-#include <asm/machvec.h>
 
 #ifndef MAX_HWIFS
-/* Should never have less than 2, ide-pci.c(ide_match_hwif) requires it */
-#define MAX_HWIFS	2
+#define MAX_HWIFS	CONFIG_IDE_MAX_HWIFS
 #endif
 
-#define IDE_ARCH_OBSOLETE_DEFAULTS
-
-static inline int ide_default_irq_hp600(unsigned long base)
-{
-	switch (base) {
-		case 0x01f0: return 93;
-		case 0x0170: return 94;
-		default:
-			return 0;
-	}
-}
-
-static inline int ide_default_irq(unsigned long base)
-{
-	if (MACH_HP600) {
-		return ide_default_irq_hp600(base);
-	}
-	switch (base) {
-		case 0x01f0: return 14;
-		case 0x0170: return 15;
-		default:
-			return 0;
-	}
-}
-
-static inline unsigned long ide_default_io_base_hp600(int index)
-{
-	switch (index) {
-		case 0:	
-			return 0x01f0;
-		case 1:	
-			return 0x0170;
-		default:
-			return 0;
-	}
-}
-
-static inline unsigned long ide_default_io_base(int index)
-{
-	if (MACH_HP600) {
-		return ide_default_io_base_hp600(index);
-	}
-	switch (index) {
-		case 0:	
-			return 0x1f0;
-		case 1:	
-			return 0x170;
-		default:
-			return 0;
-	}
-}
-
-#define IDE_ARCH_OBSOLETE_INIT
-#define ide_default_io_ctl(base)	((base) + 0x206) /* obsolete */
-
-#ifdef CONFIG_PCI
-#define ide_init_default_irq(base)	(0)
-#else
-#define ide_init_default_irq(base)	ide_default_irq(base)
-#endif
+#define ide_default_io_ctl(base)	(0)
 
 #include <asm-generic/ide_iops.h>
 
diff --git a/include/asm-sh/irq.h b/include/asm-sh/irq.h
index 7dd2a5ae1..58bd8df7a 100644
--- a/include/asm-sh/irq.h
+++ b/include/asm-sh/irq.h
@@ -15,9 +15,15 @@
 #include <asm/machvec.h>
 #include <asm/ptrace.h>		/* for pt_regs */
 
+#if defined(CONFIG_SH_HP600) || \
+    defined(CONFIG_SH_RTS7751R2D) || \
+    defined(CONFIG_SH_HS7751RVOIP)
+#include <asm/mach/ide.h>
+#endif
+
 #if defined(CONFIG_CPU_SH3)
-#define INTC_IPRA  	0xfffffee2UL
-#define INTC_IPRB  	0xfffffee4UL
+#define INTC_IPRA	0xfffffee2UL
+#define INTC_IPRB	0xfffffee4UL
 #elif defined(CONFIG_CPU_SH4)
 #define INTC_IPRA	0xffd00004UL
 #define INTC_IPRB	0xffd00008UL
@@ -25,6 +31,15 @@
 #define INTC_IPRD	0xffd00010UL
 #endif
 
+#ifdef CONFIG_IDE
+# ifndef IRQ_CFCARD
+#  define IRQ_CFCARD	14
+# endif
+# ifndef IRQ_PCMCIA
+#  define IRQ_PCMCIA	15
+# endif
+#endif
+
 #define TIMER_IRQ	16
 #define TIMER_IPR_ADDR	INTC_IPRA
 #define TIMER_IPR_POS	 3
@@ -48,6 +63,111 @@
 #define DMA_IPR_ADDR	INTC_IPRE
 #define DMA_IPR_POS	3
 #define DMA_PRIORITY	7
+#if defined(CONFIG_CPU_SUBTYPE_SH7300)
+/* TMU2 */
+#define TIMER2_IRQ      18
+#define TIMER2_IPR_ADDR INTC_IPRA
+#define TIMER2_IPR_POS   1
+#define TIMER2_PRIORITY  2
+
+/* WDT */
+#define WDT_IRQ		27
+#define WDT_IPR_ADDR	INTC_IPRB
+#define WDT_IPR_POS	 3
+#define WDT_PRIORITY	 2
+
+/* SIM (SIM Card Module) */
+#define SIM_ERI_IRQ	23
+#define SIM_RXI_IRQ	24
+#define SIM_TXI_IRQ	25
+#define SIM_TEND_IRQ	26
+#define SIM_IPR_ADDR	INTC_IPRB
+#define SIM_IPR_POS	 1
+#define SIM_PRIORITY	 2
+
+/* VIO (Video I/O) */
+#define VIO_IRQ		52
+#define VIO_IPR_ADDR	INTC_IPRE
+#define VIO_IPR_POS	 2
+#define VIO_PRIORITY	 2
+
+/* MFI (Multi Functional Interface) */
+#define MFI_IRQ		56
+#define MFI_IPR_ADDR	INTC_IPRE
+#define MFI_IPR_POS	 1
+#define MFI_PRIORITY	 2
+
+/* VPU (Video Processing Unit) */
+#define VPU_IRQ		60
+#define VPU_IPR_ADDR	INTC_IPRE
+#define VPU_IPR_POS	 0
+#define VPU_PRIORITY	 2
+
+/* KEY (Key Scan Interface) */
+#define KEY_IRQ		79
+#define KEY_IPR_ADDR	INTC_IPRF
+#define KEY_IPR_POS	 3
+#define KEY_PRIORITY	 2
+
+/* CMT (Compare Match Timer) */
+#define CMT_IRQ		104
+#define CMT_IPR_ADDR	INTC_IPRF
+#define CMT_IPR_POS	 0
+#define CMT_PRIORITY	 2
+
+/* DMAC(1) */
+#define DMTE0_IRQ	48
+#define DMTE1_IRQ	49
+#define DMTE2_IRQ	50
+#define DMTE3_IRQ	51
+#define DMA1_IPR_ADDR	INTC_IPRE
+#define DMA1_IPR_POS	3
+#define DMA1_PRIORITY	7
+
+/* DMAC(2) */
+#define DMTE4_IRQ	76
+#define DMTE5_IRQ	77
+#define DMA2_IPR_ADDR	INTC_IPRF
+#define DMA2_IPR_POS	2
+#define DMA2_PRIORITY	7
+
+/* SIOF0 */
+#define SIOF0_IRQ	84
+#define SIOF0_IPR_ADDR	INTC_IPRH
+#define SIOF0_IPR_POS	3
+#define SIOF0_PRIORITY	3
+
+/* FLCTL (Flash Memory Controller) */
+#define FLSTE_IRQ	92
+#define FLTEND_IRQ	93
+#define FLTRQ0_IRQ	94
+#define FLTRQ1_IRQ	95
+#define FLCTL_IPR_ADDR	INTC_IPRH
+#define FLCTL_IPR_POS	1
+#define FLCTL_PRIORITY	3
+
+/* IIC (IIC Bus Interface) */
+#define IIC_ALI_IRQ	96
+#define IIC_TACKI_IRQ	97
+#define IIC_WAITI_IRQ	98
+#define IIC_DTEI_IRQ	99
+#define IIC_IPR_ADDR	INTC_IPRH
+#define IIC_IPR_POS	0
+#define IIC_PRIORITY	3
+
+/* SIO0 */
+#define SIO0_IRQ	88
+#define SIO0_IPR_ADDR	INTC_IPRI
+#define SIO0_IPR_POS	3
+#define SIO0_PRIORITY	3
+
+/* SIU (Sound Interface Unit) */
+#define SIU_IRQ		108
+#define SIU_IPR_ADDR	INTC_IPRJ
+#define SIU_IPR_POS	1
+#define SIU_PRIORITY	3
+
+#endif
 #elif defined(CONFIG_CPU_SH4)
 #define DMTE0_IRQ	34
 #define DMTE1_IRQ	35
@@ -74,7 +194,14 @@
 #define SCI_PRIORITY	3
 #endif
 
-#if defined(CONFIG_CPU_SUBTYPE_SH7707) || defined(CONFIG_CPU_SUBTYPE_SH7709)
+#if defined(CONFIG_CPU_SUBTYPE_SH7300)
+#define SCIF0_IRQ	80
+#define SCIF0_IPR_ADDR	INTC_IPRG
+#define SCIF0_IPR_POS	3
+#define SCIF0_PRIORITY	3
+#elif defined(CONFIG_CPU_SUBTYPE_SH7705) || \
+      defined(CONFIG_CPU_SUBTYPE_SH7707) || \
+      defined(CONFIG_CPU_SUBTYPE_SH7709)
 #define SCIF_ERI_IRQ	56
 #define SCIF_RXI_IRQ	57
 #define SCIF_BRI_IRQ	58
@@ -127,7 +254,8 @@
 #  define PINT_NR_IRQS   16
 # elif defined(CONFIG_CPU_SUBTYPE_SH7708)
 #  define ONCHIP_NR_IRQS 32
-# elif defined(CONFIG_CPU_SUBTYPE_SH7709)
+# elif defined(CONFIG_CPU_SUBTYPE_SH7709) || \
+       defined(CONFIG_CPU_SUBTYPE_SH7705)
 #  define ONCHIP_NR_IRQS 64	// Actually 61
 #  define PINT_NR_IRQS   16
 # elif defined(CONFIG_CPU_SUBTYPE_SH7750)
@@ -138,6 +266,8 @@
 #  define ONCHIP_NR_IRQS 110
 # elif defined(CONFIG_CPU_SUBTYPE_ST40STB1)
 #  define ONCHIP_NR_IRQS 144
+# elif defined(CONFIG_CPU_SUBTYPE_SH7300)
+#  define ONCHIP_NR_IRQS 109
 # endif
 #endif
 
@@ -207,7 +337,121 @@ extern void make_ipr_irq(unsigned int irq, unsigned int addr,
 			 int pos,  int priority);
 extern void make_imask_irq(unsigned int irq);
 
-#if defined(CONFIG_CPU_SUBTYPE_SH7604)
+#if defined(CONFIG_CPU_SUBTYPE_SH7300)
+#undef INTC_IPRA
+#undef INTC_IPRB
+#define INTC_IPRA  	0xA414FEE2UL
+#define INTC_IPRB  	0xA414FEE4UL
+#define INTC_IPRC  	0xA4140016UL
+#define INTC_IPRD  	0xA4140018UL
+#define INTC_IPRE  	0xA414001AUL
+#define INTC_IPRF  	0xA4080000UL
+#define INTC_IPRG  	0xA4080002UL
+#define INTC_IPRH  	0xA4080004UL
+#define INTC_IPRI  	0xA4080006UL
+#define INTC_IPRJ  	0xA4080008UL
+
+#define INTC_IMR0	0xA4080040UL
+#define INTC_IMR1	0xA4080042UL
+#define INTC_IMR2	0xA4080044UL
+#define INTC_IMR3	0xA4080046UL
+#define INTC_IMR4	0xA4080048UL
+#define INTC_IMR5	0xA408004AUL
+#define INTC_IMR6	0xA408004CUL
+#define INTC_IMR7	0xA408004EUL
+#define INTC_IMR8	0xA4080050UL
+#define INTC_IMR9	0xA4080052UL
+#define INTC_IMR10	0xA4080054UL
+
+#define INTC_IMCR0	0xA4080060UL
+#define INTC_IMCR1	0xA4080062UL
+#define INTC_IMCR2	0xA4080064UL
+#define INTC_IMCR3	0xA4080066UL
+#define INTC_IMCR4	0xA4080068UL
+#define INTC_IMCR5	0xA408006AUL
+#define INTC_IMCR6	0xA408006CUL
+#define INTC_IMCR7	0xA408006EUL
+#define INTC_IMCR8	0xA4080070UL
+#define INTC_IMCR9	0xA4080072UL
+#define INTC_IMCR10	0xA4080074UL
+
+#define INTC_ICR0	0xA414FEE0UL
+#define INTC_ICR1	0xA4140010UL
+
+#define INTC_IRR0	0xA4140004UL
+
+#define PORT_PACR	0xA4050100UL
+#define PORT_PBCR	0xA4050102UL
+#define PORT_PCCR	0xA4050104UL
+#define PORT_PDCR	0xA4050106UL
+#define PORT_PECR	0xA4050108UL
+#define PORT_PFCR	0xA405010AUL
+#define PORT_PGCR	0xA405010CUL
+#define PORT_PHCR	0xA405010EUL
+#define PORT_PJCR	0xA4050110UL
+#define PORT_PKCR	0xA4050112UL
+#define PORT_PLCR	0xA4050114UL
+#define PORT_SCPCR	0xA4050116UL
+#define PORT_PMCR	0xA4050118UL
+#define PORT_PNCR	0xA405011AUL
+#define PORT_PQCR	0xA405011CUL
+
+#define PORT_PSELA	0xA4050140UL
+#define PORT_PSELB	0xA4050142UL
+#define PORT_PSELC	0xA4050144UL
+
+#define PORT_HIZCRA	0xA4050146UL
+#define PORT_HIZCRB	0xA4050148UL
+#define PORT_DRVCR	0xA4050150UL
+
+#define PORT_PADR  	0xA4050120UL
+#define PORT_PBDR  	0xA4050122UL
+#define PORT_PCDR  	0xA4050124UL
+#define PORT_PDDR  	0xA4050126UL
+#define PORT_PEDR  	0xA4050128UL
+#define PORT_PFDR  	0xA405012AUL
+#define PORT_PGDR  	0xA405012CUL
+#define PORT_PHDR  	0xA405012EUL
+#define PORT_PJDR  	0xA4050130UL
+#define PORT_PKDR  	0xA4050132UL
+#define PORT_PLDR  	0xA4050134UL
+#define PORT_SCPDR  	0xA4050136UL
+#define PORT_PMDR  	0xA4050138UL
+#define PORT_PNDR  	0xA405013AUL
+#define PORT_PQDR  	0xA405013CUL
+
+#define IRQ0_IRQ	32
+#define IRQ1_IRQ	33
+#define IRQ2_IRQ	34
+#define IRQ3_IRQ	35
+#define IRQ4_IRQ	36
+#define IRQ5_IRQ	37
+
+#define IRQ0_IPR_ADDR	INTC_IPRC
+#define IRQ1_IPR_ADDR	INTC_IPRC
+#define IRQ2_IPR_ADDR	INTC_IPRC
+#define IRQ3_IPR_ADDR	INTC_IPRC
+#define IRQ4_IPR_ADDR	INTC_IPRD
+#define IRQ5_IPR_ADDR	INTC_IPRD
+
+#define IRQ0_IPR_POS	0
+#define IRQ1_IPR_POS	1
+#define IRQ2_IPR_POS	2
+#define IRQ3_IPR_POS	3
+#define IRQ4_IPR_POS	0
+#define IRQ5_IPR_POS	1
+
+#define IRQ0_PRIORITY	1
+#define IRQ1_PRIORITY	1
+#define IRQ2_PRIORITY	1
+#define IRQ3_PRIORITY	1
+#define IRQ4_PRIORITY	1
+#define IRQ5_PRIORITY	1
+
+extern int ipr_irq_demux(int irq);
+#define __irq_demux(irq) ipr_irq_demux(irq)
+
+#elif defined(CONFIG_CPU_SUBTYPE_SH7604)
 #define INTC_IPRA	0xfffffee2UL
 #define INTC_IPRB	0xfffffe60UL
 
@@ -222,21 +466,27 @@ extern void make_imask_irq(unsigned int irq);
 #define INTC_VCRDMA1	0xffffffa8UL
 
 #define INTC_ICR	0xfffffee0UL
-#elif defined(CONFIG_CPU_SUBTYPE_SH7707) || defined(CONFIG_CPU_SUBTYPE_SH7709)
+#elif defined(CONFIG_CPU_SUBTYPE_SH7705) || \
+      defined(CONFIG_CPU_SUBTYPE_SH7707) || \
+      defined(CONFIG_CPU_SUBTYPE_SH7709)
 #define INTC_IRR0	0xa4000004UL
 #define INTC_IRR1	0xa4000006UL
 #define INTC_IRR2	0xa4000008UL
 
-#define INTC_ICR0  	0xfffffee0UL
-#define INTC_ICR1  	0xa4000010UL
-#define INTC_ICR2  	0xa4000012UL
-#define INTC_INTER 	0xa4000014UL
+#define INTC_ICR0	0xfffffee0UL
+#define INTC_ICR1	0xa4000010UL
+#define INTC_ICR2	0xa4000012UL
+#define INTC_INTER	0xa4000014UL
 
-#define INTC_IPRC  	0xa4000016UL
-#define INTC_IPRD  	0xa4000018UL
-#define INTC_IPRE  	0xa400001aUL
+#define INTC_IPRC	0xa4000016UL
+#define INTC_IPRD	0xa4000018UL
+#define INTC_IPRE	0xa400001aUL
 #if defined(CONFIG_CPU_SUBTYPE_SH7707)
 #define INTC_IPRF	0xa400001cUL
+#elif defined(CONFIG_CPU_SUBTYPE_SH7705)
+#define INTC_IPRF	0xa4080000UL
+#define INTC_IPRG	0xa4080002UL
+#define INTC_IPRH	0xa4080004UL
 #endif
 
 #define PORT_PACR	0xa4000100UL
@@ -307,20 +557,20 @@ extern int ipr_irq_demux(int irq);
 #ifdef CONFIG_CPU_SUBTYPE_ST40STB1
 #define INTC2_FIRST_IRQ 64
 #define NR_INTC2_IRQS 25
- 
+
 #define INTC2_BASE0 0xfe080000
 #define INTC2_INTC2MODE  (INTC2_BASE0+0x80)
- 
+
 #define INTC2_INTPRI_OFFSET	0x00
 #define INTC2_INTREQ_OFFSET	0x20
 #define INTC2_INTMSK_OFFSET	0x40
 #define INTC2_INTMSKCLR_OFFSET	0x60
- 
+
 extern void make_intc2_irq(unsigned int irq,unsigned int addr,
                            unsigned int group,int pos,int priority);
- 
-#endif                                                                        
-       
+
+#endif
+
 static inline int generic_irq_demux(int irq)
 {
 	return irq;
diff --git a/include/asm-sh/machvec.h b/include/asm-sh/machvec.h
index 4953570c9..8a2e3dcd1 100644
--- a/include/asm-sh/machvec.h
+++ b/include/asm-sh/machvec.h
@@ -17,6 +17,7 @@
 #include <asm/machtypes.h>
 #include <asm/machvec_init.h>
 
+struct device;
 struct timeval;
 
 struct sh_machine_vector
@@ -62,6 +63,9 @@ struct sh_machine_vector
 	void (*mv_init_pci)(void);
 
 	void (*mv_heartbeat)(void);
+
+	void *(*mv_consistent_alloc)(struct device *, size_t, dma_addr_t *, int);
+	void (*mv_consistent_free)(struct device *, size_t, void *, dma_addr_t);
 };
 
 extern struct sh_machine_vector sh_mv;
diff --git a/include/asm-sh/pgalloc.h b/include/asm-sh/pgalloc.h
index 9b7038442..8a1b3597f 100644
--- a/include/asm-sh/pgalloc.h
+++ b/include/asm-sh/pgalloc.h
@@ -84,71 +84,10 @@ static inline void pte_free(struct page *pte)
 #define pmd_free(x)			do { } while (0)
 #define __pmd_free_tlb(tlb,x)		do { } while (0)
 #define pgd_populate(mm, pmd, pte)	BUG()
+#define check_pgt_cache()		do { } while (0)
 
-#if defined(CONFIG_CPU_SH4)
-#define PG_mapped	PG_arch_1
-
-/*
- * For SH-4, we have our own implementation for ptep_get_and_clear
- */
-static inline pte_t ptep_get_and_clear(pte_t *ptep)
-{
-	pte_t pte = *ptep;
-
-	pte_clear(ptep);
-	if (!pte_not_present(pte)) {
-		unsigned long pfn = pte_pfn(pte);
-		if (pfn_valid(pfn)) {
-			struct page *page = pfn_to_page(pfn);
-			struct address_space *mapping = page_mapping(page);
-			if (!mapping || !mapping_writably_mapped(mapping))
-				__clear_bit(PG_mapped, &page->flags);
-		}
-	}
-	return pte;
-}
-#else
-static inline pte_t ptep_get_and_clear(pte_t *ptep)
-{
-	pte_t pte = *ptep;
-	pte_clear(ptep);
-	return pte;
-}
+#ifdef CONFIG_CPU_SH4
+#define PG_mapped			PG_arch_1
 #endif
 
-/*
- * Following functions are same as generic ones.
- */
-static inline int ptep_test_and_clear_young(pte_t *ptep)
-{
-	pte_t pte = *ptep;
-	if (!pte_young(pte))
-		return 0;
-	set_pte(ptep, pte_mkold(pte));
-	return 1;
-}
-
-static inline int ptep_test_and_clear_dirty(pte_t *ptep)
-{
-	pte_t pte = *ptep;
-	if (!pte_dirty(pte))
-		return 0;
-	set_pte(ptep, pte_mkclean(pte));
-	return 1;
-}
-
-static inline void ptep_set_wrprotect(pte_t *ptep)
-{
-	pte_t old_pte = *ptep;
-	set_pte(ptep, pte_wrprotect(old_pte));
-}
-
-static inline void ptep_mkdirty(pte_t *ptep)
-{
-	pte_t old_pte = *ptep;
-	set_pte(ptep, pte_mkdirty(old_pte));
-}
-
-#define check_pgt_cache()	do { } while (0)
-
 #endif /* __ASM_SH_PGALLOC_H */
diff --git a/include/asm-sh/pgtable.h b/include/asm-sh/pgtable.h
index 292511404..7cbe42971 100644
--- a/include/asm-sh/pgtable.h
+++ b/include/asm-sh/pgtable.h
@@ -3,7 +3,7 @@
 
 /*
  * Copyright (C) 1999 Niibe Yutaka
- * Copyright (C) 2002, 2003 Paul Mundt
+ * Copyright (C) 2002, 2003, 2004 Paul Mundt
  */
 
 #include <linux/config.h>
@@ -16,6 +16,7 @@
 #ifndef __ASSEMBLY__
 #include <asm/processor.h>
 #include <asm/addrspace.h>
+#include <asm/fixmap.h>
 #include <linux/threads.h>
 
 extern pgd_t swapper_pg_dir[PTRS_PER_PGD];
@@ -51,7 +52,7 @@ extern unsigned long empty_zero_page[1024];
  * Currently only 4-enty (16kB) is used (see arch/sh/mm/cache.c)
  */
 #define VMALLOC_START	(P3SEG+0x00100000)
-#define VMALLOC_END	P4SEG
+#define VMALLOC_END	(FIXADDR_START-2*PAGE_SIZE)
 
 #define	_PAGE_WT	0x001  /* WT-bit on SH-4, 0 on SH-3 */
 #define _PAGE_HW_SHARED	0x002  /* SH-bit  : page is shared among processes */
@@ -119,17 +120,20 @@ extern unsigned long empty_zero_page[1024];
 #define PAGE_COPY	__pgprot(_PAGE_PRESENT | _PAGE_USER | _PAGE_CACHABLE | _PAGE_ACCESSED | _PAGE_FLAGS_HARD)
 #define PAGE_READONLY	__pgprot(_PAGE_PRESENT | _PAGE_USER | _PAGE_CACHABLE | _PAGE_ACCESSED | _PAGE_FLAGS_HARD)
 #define PAGE_KERNEL	__pgprot(_PAGE_PRESENT | _PAGE_RW | _PAGE_CACHABLE | _PAGE_DIRTY | _PAGE_ACCESSED | _PAGE_HW_SHARED | _PAGE_FLAGS_HARD)
+#define PAGE_KERNEL_NOCACHE \
+			__pgprot(_PAGE_PRESENT | _PAGE_RW | _PAGE_DIRTY | _PAGE_ACCESSED | _PAGE_HW_SHARED | _PAGE_FLAGS_HARD)
 #define PAGE_KERNEL_RO	__pgprot(_PAGE_PRESENT | _PAGE_CACHABLE | _PAGE_DIRTY | _PAGE_ACCESSED | _PAGE_HW_SHARED | _PAGE_FLAGS_HARD)
 #define PAGE_KERNEL_PCC(slot, type) \
 			__pgprot(_PAGE_PRESENT | _PAGE_RW | _PAGE_DIRTY | _PAGE_ACCESSED | _PAGE_FLAGS_HARD | (slot ? _PAGE_PCC_AREA5 : _PAGE_PCC_AREA6) | (type))
 #else /* no mmu */
-#define PAGE_NONE	__pgprot(0)
-#define PAGE_SHARED	__pgprot(0)
-#define PAGE_COPY	__pgprot(0)
-#define PAGE_READONLY	__pgprot(0)
-#define PAGE_KERNEL	__pgprot(0)
-#define PAGE_KERNEL_RO	__pgprot(0)
-#define PAGE_KERNEL_PCC	__pgprot(0)
+#define PAGE_NONE		__pgprot(0)
+#define PAGE_SHARED		__pgprot(0)
+#define PAGE_COPY		__pgprot(0)
+#define PAGE_READONLY		__pgprot(0)
+#define PAGE_KERNEL		__pgprot(0)
+#define PAGE_KERNEL_NOCACHE	__pgprot(0)
+#define PAGE_KERNEL_RO		__pgprot(0)
+#define PAGE_KERNEL_PCC		__pgprot(0)
 #endif
 
 /*
@@ -254,25 +258,17 @@ extern void update_mmu_cache(struct vm_area_struct * vma,
 #define __swp_type(x)		((x).val & 0xff)
 #define __swp_offset(x)		((x).val >> 10)
 #define __swp_entry(type, offset) ((swp_entry_t) { (type) | ((offset) << 10) })
-#define __pte_to_swp_entry(pte)	((swp_entry_t) { pte_val(pte) })
-#define __swp_entry_to_pte(x)	((pte_t) { (x).val })
+#define __pte_to_swp_entry(pte)	((swp_entry_t) { pte_val(pte) >> 1 })
+#define __swp_entry_to_pte(x)	((pte_t) { (x).val << 1 })
 
 /*
  * Encode and decode a nonlinear file mapping entry
  */
 #define PTE_FILE_MAX_BITS	29
-#define pte_to_pgoff(pte)	(pte_val(pte))
-#define pgoff_to_pte(off)	((pte_t) { (off) | _PAGE_FILE })
+#define pte_to_pgoff(pte)	(pte_val(pte) >> 1)
+#define pgoff_to_pte(off)	((pte_t) { ((off) << 1) | _PAGE_FILE })
 
-/*
- * Routines for update of PTE 
- *
- * We just can use generic implementation, as SuperH has no SMP feature.
- * (We needed atomic implementation for SMP)
- *
- */
-
-#define pte_same(A,B)	(pte_val(A) == pte_val(B))
+typedef pte_t *pte_addr_t;
 
 #endif /* !__ASSEMBLY__ */
 
@@ -289,12 +285,11 @@ extern void update_mmu_cache(struct vm_area_struct * vma,
 extern unsigned int kobjsize(const void *objp);
 #endif /* !CONFIG_MMU */
 
-#define __HAVE_ARCH_PTEP_TEST_AND_CLEAR_YOUNG
-#define __HAVE_ARCH_PTEP_TEST_AND_CLEAR_DIRTY
+#ifdef CONFIG_CPU_SH4
 #define __HAVE_ARCH_PTEP_GET_AND_CLEAR
-#define __HAVE_ARCH_PTEP_SET_WRPROTECT
-#define __HAVE_ARCH_PTEP_MKDIRTY
-#define __HAVE_ARCH_PTE_SAME
+extern inline pte_t ptep_get_and_clear(pte_t *ptep);
+#endif
+
 #include <asm-generic/pgtable.h>
 
 #endif /* __ASM_SH_PAGE_H */
diff --git a/include/asm-sh/processor.h b/include/asm-sh/processor.h
index 786d41c36..922c92747 100644
--- a/include/asm-sh/processor.h
+++ b/include/asm-sh/processor.h
@@ -37,8 +37,8 @@ enum cpu_type {
 	CPU_SH7604,
 
 	/* SH-3 types */
-	CPU_SH7707,  CPU_SH7708, CPU_SH7708S, CPU_SH7708R, CPU_SH7709,
-	CPU_SH7709A, CPU_SH7729, CPU_SH7300,
+	CPU_SH7705, CPU_SH7707,  CPU_SH7708, CPU_SH7708S, CPU_SH7708R,
+	CPU_SH7709, CPU_SH7709A, CPU_SH7729, CPU_SH7300,
 
 	/* SH-4 types */
 	CPU_SH7750, CPU_SH7750S, CPU_SH7750R, CPU_SH7751, CPU_SH7751R,
@@ -271,6 +271,7 @@ extern unsigned long get_wchan(struct task_struct *p);
 #define KSTK_EIP(tsk)  ((tsk)->thread.pc)
 #define KSTK_ESP(tsk)  ((tsk)->thread.sp)
 
-#define cpu_relax()	__asm__ __volatile__ ("sleep" : : : "memory")
+#define cpu_sleep()	__asm__ __volatile__ ("sleep" : : : "memory")
+#define cpu_relax()	do { } while (0)
 
 #endif /* __ASM_SH_PROCESSOR_H */
diff --git a/include/asm-sh/resource.h b/include/asm-sh/resource.h
index 574b64488..73e517a3e 100644
--- a/include/asm-sh/resource.h
+++ b/include/asm-sh/resource.h
@@ -16,8 +16,10 @@
 #define RLIMIT_MEMLOCK	8		/* max locked-in-memory address space */
 #define RLIMIT_AS	9		/* address space limit */
 #define RLIMIT_LOCKS	10		/* maximum file locks held */
+#define RLIMIT_SIGPENDING 11		/* max number of pending signals */
+#define RLIMIT_MSGQUEUE 12		/* maximum bytes in POSIX mqueues */
 
-#define RLIM_NLIMITS	11
+#define RLIM_NLIMITS	13
 
 #ifdef __KERNEL__
 
@@ -40,6 +42,8 @@
 	{ RLIM_INFINITY, RLIM_INFINITY },		\
 	{ RLIM_INFINITY, RLIM_INFINITY },		\
 	{ RLIM_INFINITY, RLIM_INFINITY },		\
+	{ MAX_SIGPENDING, MAX_SIGPENDING },		\
+	{ MQ_BYTES_MAX, MQ_BYTES_MAX },			\
 }
 
 #endif /* __KERNEL__ */
diff --git a/include/asm-sh/serial.h b/include/asm-sh/serial.h
index 012649927..5474dbdba 100644
--- a/include/asm-sh/serial.h
+++ b/include/asm-sh/serial.h
@@ -44,8 +44,5 @@
 
 #define SERIAL_PORT_DFNS STD_SERIAL_PORT_DEFNS
 
-/* XXX: This should be moved ino irq.h */
-#define irq_canonicalize(x) (x)
-
 #endif
 #endif /* _ASM_SERIAL_H */
diff --git a/include/asm-sh/sigcontext.h b/include/asm-sh/sigcontext.h
index 46fbc6fed..eb8effba2 100644
--- a/include/asm-sh/sigcontext.h
+++ b/include/asm-sh/sigcontext.h
@@ -1,6 +1,26 @@
 #ifndef __ASM_SH_SIGCONTEXT_H
 #define __ASM_SH_SIGCONTEXT_H
 
-#include <asm/cpu/sigcontext.h>
+struct sigcontext {
+	unsigned long	oldmask;
+
+	/* CPU registers */
+	unsigned long sc_regs[16];
+	unsigned long sc_pc;
+	unsigned long sc_pr;
+	unsigned long sc_sr;
+	unsigned long sc_gbr;
+	unsigned long sc_mach;
+	unsigned long sc_macl;
+
+#if defined(__SH4__) || defined(CONFIG_CPU_SH4)
+	/* FPU registers */
+	unsigned long sc_fpregs[16];
+	unsigned long sc_xfpregs[16];
+	unsigned int sc_fpscr;
+	unsigned int sc_fpul;
+	unsigned int sc_ownedfp;
+#endif
+};
 
 #endif /* __ASM_SH_SIGCONTEXT_H */
diff --git a/include/asm-sh/ubc.h b/include/asm-sh/ubc.h
index 412a6496c..a42dd7adf 100644
--- a/include/asm-sh/ubc.h
+++ b/include/asm-sh/ubc.h
@@ -14,7 +14,8 @@
 #include <asm/cpu/ubc.h>
 
 /* User Break Controller */
-#if defined(CONFIG_CPU_SUBTYPE_SH7709)
+#if defined(CONFIG_CPU_SUBTYPE_SH7707) || defined(CONFIG_CPU_SUBTYPE_SH7709) || \
+    defined(CONFIG_CPU_SUBTYPE_SH7300)
 #define UBC_TYPE_SH7729	(cpu_data->type == CPU_SH7729)
 #else
 #define UBC_TYPE_SH7729	0
diff --git a/include/asm-sh/unistd.h b/include/asm-sh/unistd.h
index 26ad6dd92..a20677454 100644
--- a/include/asm-sh/unistd.h
+++ b/include/asm-sh/unistd.h
@@ -281,8 +281,17 @@
 #define __NR_utimes		271
 #define __NR_fadvise64_64	272
 #define __NR_vserver		273
+#define __NR_mbind              274
+#define __NR_get_mempolicy      275
+#define __NR_set_mempolicy      276
+#define __NR_mq_open            277
+#define __NR_mq_unlink          (__NR_mq_open+1)
+#define __NR_mq_timedsend       (__NR_mq_open+2)
+#define __NR_mq_timedreceive    (__NR_mq_open+3)
+#define __NR_mq_notify          (__NR_mq_open+4)
+#define __NR_mq_getsetattr      (__NR_mq_open+5)
 
-#define NR_syscalls 274
+#define NR_syscalls 283
 
 /* user-visible error numbers are in the range -1 - -124: see <asm-sh/errno.h> */
 
@@ -429,6 +438,7 @@ __syscall_return(type,__sc0); \
 
 #include <linux/compiler.h>
 #include <linux/types.h>
+#include <linux/linkage.h>
 #include <asm/ptrace.h>
 
 /*
diff --git a/include/asm-sh64/uaccess.h b/include/asm-sh64/uaccess.h
index 588065c63..0207bae93 100644
--- a/include/asm-sh64/uaccess.h
+++ b/include/asm-sh64/uaccess.h
@@ -261,9 +261,6 @@ if (__copy_from_user(to,from,n)) \
 	return retval; \
 })
 
-#define __copy_to_user_inatomic __copy_to_user
-#define __copy_from_user_inatomic __copy_from_user
-
 /* XXX: Not sure it works well..
    should be such that: 4byte clear and the rest. */
 extern __kernel_size_t __clear_user(void *addr, __kernel_size_t size);
diff --git a/include/asm-sparc/bitops.h b/include/asm-sparc/bitops.h
index a0e09a70f..c1009b30e 100644
--- a/include/asm-sparc/bitops.h
+++ b/include/asm-sparc/bitops.h
@@ -366,9 +366,9 @@ found_middle:
  *
  * Scheduler induced bitop, do not use.
  */
-static inline int find_next_bit(unsigned long *addr, int size, int offset)
+static inline int find_next_bit(const unsigned long *addr, int size, int offset)
 {
-	unsigned long *p = addr + (offset >> 5);
+	const unsigned long *p = addr + (offset >> 5);
 	int num = offset & ~0x1f;
 	unsigned long word;
 
@@ -384,6 +384,17 @@ static inline int find_next_bit(unsigned long *addr, int size, int offset)
 	return num;
 }
 
+/**
+ * find_first_bit - find the first set bit in a memory region
+ * @addr: The address to start the search at
+ * @size: The maximum size to search
+ *
+ * Returns the bit-number of the first set bit, not the number of the byte
+ * containing a bit.
+ */
+#define find_first_bit(addr, size) \
+	find_next_bit((addr), (size), 0)
+
 /*
  */
 static inline int test_le_bit(int nr, __const__ unsigned long * addr)
diff --git a/include/asm-sparc/bpp.h b/include/asm-sparc/bpp.h
index ad4a84571..3578ac113 100644
--- a/include/asm-sparc/bpp.h
+++ b/include/asm-sparc/bpp.h
@@ -40,9 +40,9 @@
  */
 
 # define BPP_PUT_PINS _IOW('B', 1, int)
-# define BPP_GET_PINS _IOR('B', 2, void)
+# define BPP_GET_PINS _IOR('B', 2, char) /* that's bogus - should've been _IO */
 # define BPP_PUT_DATA _IOW('B', 3, int)
-# define BPP_GET_DATA _IOR('B', 4, void)
+# define BPP_GET_DATA _IOR('B', 4, char) /* ditto */
 
 /*
  * Set the data bus to input mode. Disengage the data bin driver and
diff --git a/include/asm-sparc/bug.h b/include/asm-sparc/bug.h
index 8f04d6106..1f321b091 100644
--- a/include/asm-sparc/bug.h
+++ b/include/asm-sparc/bug.h
@@ -8,7 +8,7 @@
  */
 #if (__GNUC__ > 3) || \
     (__GNUC__ == 3 && __GNUC_MINOR__ > 3) || \
-    (__GNUC__ == 3 && __GNUC_MINOR__ == 3 && __GNUC_PATCHLEVEL__ >= 1)
+    (__GNUC__ == 3 && __GNUC_MINOR__ == 3 && __GNUC_PATCHLEVEL__ >= 4)
 #define __bug_trap()		__builtin_trap()
 #else
 #define __bug_trap()					\
diff --git a/include/asm-sparc/checksum.h b/include/asm-sparc/checksum.h
index ea48d2ea7..60c563341 100644
--- a/include/asm-sparc/checksum.h
+++ b/include/asm-sparc/checksum.h
@@ -91,7 +91,7 @@ csum_partial_copy_from_user(const char *src, char *dst, int len,
   }
   
 static inline unsigned int 
-csum_partial_copy_to_user(const char *src, char *dst, int len, 
+csum_partial_copy_to_user(const char *src, char __user *dst, int len, 
 			  unsigned int sum, int *err)
 {
 	if (!access_ok (VERIFY_WRITE, dst, len)) {
diff --git a/include/asm-sparc/dma.h b/include/asm-sparc/dma.h
index 32607e9da..59a07c792 100644
--- a/include/asm-sparc/dma.h
+++ b/include/asm-sparc/dma.h
@@ -19,6 +19,7 @@
 #include <asm/io.h>
 #include <linux/spinlock.h>
 
+struct page;
 extern spinlock_t  dma_spin_lock;
 
 static __inline__ unsigned long claim_dma_lock(void)
@@ -244,4 +245,46 @@ extern int isa_dma_bridge_buggy;
 #define isa_dma_bridge_buggy	(0)
 #endif
 
+/* Routines for data transfer buffers. */
+BTFIXUPDEF_CALL(char *, mmu_lockarea, char *, unsigned long)
+BTFIXUPDEF_CALL(void,   mmu_unlockarea, char *, unsigned long)
+
+#define mmu_lockarea(vaddr,len) BTFIXUP_CALL(mmu_lockarea)(vaddr,len)
+#define mmu_unlockarea(vaddr,len) BTFIXUP_CALL(mmu_unlockarea)(vaddr,len)
+
+/* These are implementations for sbus_map_sg/sbus_unmap_sg... collapse later */
+BTFIXUPDEF_CALL(__u32, mmu_get_scsi_one, char *, unsigned long, struct sbus_bus *sbus)
+BTFIXUPDEF_CALL(void,  mmu_get_scsi_sgl, struct scatterlist *, int, struct sbus_bus *sbus)
+BTFIXUPDEF_CALL(void,  mmu_release_scsi_one, __u32, unsigned long, struct sbus_bus *sbus)
+BTFIXUPDEF_CALL(void,  mmu_release_scsi_sgl, struct scatterlist *, int, struct sbus_bus *sbus)
+
+#define mmu_get_scsi_one(vaddr,len,sbus) BTFIXUP_CALL(mmu_get_scsi_one)(vaddr,len,sbus)
+#define mmu_get_scsi_sgl(sg,sz,sbus) BTFIXUP_CALL(mmu_get_scsi_sgl)(sg,sz,sbus)
+#define mmu_release_scsi_one(vaddr,len,sbus) BTFIXUP_CALL(mmu_release_scsi_one)(vaddr,len,sbus)
+#define mmu_release_scsi_sgl(sg,sz,sbus) BTFIXUP_CALL(mmu_release_scsi_sgl)(sg,sz,sbus)
+
+/*
+ * mmu_map/unmap are provided by iommu/iounit; Invalid to call on IIep.
+ *
+ * The mmu_map_dma_area establishes two mappings in one go.
+ * These mappings point to pages normally mapped at 'va' (linear address).
+ * First mapping is for CPU visible address at 'a', uncached.
+ * This is an alias, but it works because it is an uncached mapping.
+ * Second mapping is for device visible address, or "bus" address.
+ * The bus address is returned at '*pba'.
+ *
+ * These functions seem distinct, but are hard to split. On sun4c,
+ * at least for now, 'a' is equal to bus address, and retured in *pba.
+ * On sun4m, page attributes depend on the CPU type, so we have to
+ * know if we are mapping RAM or I/O, so it has to be an additional argument
+ * to a separate mapping function for CPU visible mappings.
+ */
+BTFIXUPDEF_CALL(int,  mmu_map_dma_area, dma_addr_t *, unsigned long, unsigned long, int len)
+BTFIXUPDEF_CALL(struct page *, mmu_translate_dvma, unsigned long busa)
+BTFIXUPDEF_CALL(void,  mmu_unmap_dma_area, unsigned long busa, int len)
+
+#define mmu_map_dma_area(pba,va,a,len) BTFIXUP_CALL(mmu_map_dma_area)(pba,va,a,len)
+#define mmu_unmap_dma_area(ba,len) BTFIXUP_CALL(mmu_unmap_dma_area)(ba,len)
+#define mmu_translate_dvma(ba)     BTFIXUP_CALL(mmu_translate_dvma)(ba)
+
 #endif /* !(_ASM_SPARC_DMA_H) */
diff --git a/include/asm-sparc/fcntl.h b/include/asm-sparc/fcntl.h
index aa64cfc1d..df9c75d41 100644
--- a/include/asm-sparc/fcntl.h
+++ b/include/asm-sparc/fcntl.h
@@ -21,6 +21,7 @@
 #define O_NOFOLLOW	0x20000	/* don't follow links */
 #define O_LARGEFILE	0x40000
 #define O_DIRECT        0x100000 /* direct disk access hint */
+#define O_NOATIME	0x200000
 
 #define F_DUPFD		0	/* dup */
 #define F_GETFD		1	/* get close_on_exec */
diff --git a/include/asm-sparc/openpromio.h b/include/asm-sparc/openpromio.h
index 6e32823ab..917fb8e9c 100644
--- a/include/asm-sparc/openpromio.h
+++ b/include/asm-sparc/openpromio.h
@@ -1,6 +1,7 @@
 #ifndef	_SPARC_OPENPROMIO_H
 #define	_SPARC_OPENPROMIO_H
 
+#include <linux/compiler.h>
 #include <linux/ioctl.h>
 #include <linux/types.h>
 
@@ -52,9 +53,9 @@ struct opiocdesc
 {
 	int	op_nodeid;		/* PROM Node ID (value-result) */
 	int	op_namelen;		/* Length of op_name. */
-	char	*op_name;		/* Pointer to the property name. */
+	char	__user *op_name;	/* Pointer to the property name. */
 	int	op_buflen;		/* Length of op_buf (value-result) */
-	char	*op_buf;		/* Pointer to buffer. */
+	char	__user *op_buf;		/* Pointer to buffer. */
 };
 
 #define	OPIOCGET	_IOWR('O', 1, struct opiocdesc)
diff --git a/include/asm-sparc/pci.h b/include/asm-sparc/pci.h
index 0a87b8a7c..d200a25a7 100644
--- a/include/asm-sparc/pci.h
+++ b/include/asm-sparc/pci.h
@@ -148,6 +148,13 @@ static inline void pcibios_add_platform_entries(struct pci_dev *dev)
 {
 }
 
+#define PCI_DMA_ERROR_CODE      (~(dma_addr_t)0x0)
+
+static inline int pci_dma_mapping_error(dma_addr_t dma_addr)
+{
+        return (dma_addr == PCI_DMA_ERROR_CODE);
+}
+
 #endif /* __KERNEL__ */
 
 /* generic pci stuff */
diff --git a/include/asm-sparc/pgtable.h b/include/asm-sparc/pgtable.h
index fa537363f..c8201746f 100644
--- a/include/asm-sparc/pgtable.h
+++ b/include/asm-sparc/pgtable.h
@@ -21,7 +21,6 @@
 #include <asm/pgtsrmmu.h>
 #include <asm/vac-ops.h>
 #include <asm/oplib.h>
-#include <asm/sbus.h>
 #include <asm/btfixup.h>
 #include <asm/system.h>
 
@@ -33,48 +32,6 @@ struct page;
 extern void load_mmu(void);
 extern unsigned long calc_highpages(void);
 
-/* Routines for data transfer buffers. */
-BTFIXUPDEF_CALL(char *, mmu_lockarea, char *, unsigned long)
-BTFIXUPDEF_CALL(void,   mmu_unlockarea, char *, unsigned long)
-
-#define mmu_lockarea(vaddr,len) BTFIXUP_CALL(mmu_lockarea)(vaddr,len)
-#define mmu_unlockarea(vaddr,len) BTFIXUP_CALL(mmu_unlockarea)(vaddr,len)
-
-/* These are implementations for sbus_map_sg/sbus_unmap_sg... collapse later */
-BTFIXUPDEF_CALL(__u32, mmu_get_scsi_one, char *, unsigned long, struct sbus_bus *sbus)
-BTFIXUPDEF_CALL(void,  mmu_get_scsi_sgl, struct scatterlist *, int, struct sbus_bus *sbus)
-BTFIXUPDEF_CALL(void,  mmu_release_scsi_one, __u32, unsigned long, struct sbus_bus *sbus)
-BTFIXUPDEF_CALL(void,  mmu_release_scsi_sgl, struct scatterlist *, int, struct sbus_bus *sbus)
-
-#define mmu_get_scsi_one(vaddr,len,sbus) BTFIXUP_CALL(mmu_get_scsi_one)(vaddr,len,sbus)
-#define mmu_get_scsi_sgl(sg,sz,sbus) BTFIXUP_CALL(mmu_get_scsi_sgl)(sg,sz,sbus)
-#define mmu_release_scsi_one(vaddr,len,sbus) BTFIXUP_CALL(mmu_release_scsi_one)(vaddr,len,sbus)
-#define mmu_release_scsi_sgl(sg,sz,sbus) BTFIXUP_CALL(mmu_release_scsi_sgl)(sg,sz,sbus)
-
-/*
- * mmu_map/unmap are provided by iommu/iounit; Invalid to call on IIep.
- *
- * The mmu_map_dma_area establishes two mappings in one go.
- * These mappings point to pages normally mapped at 'va' (linear address).
- * First mapping is for CPU visible address at 'a', uncached.
- * This is an alias, but it works because it is an uncached mapping.
- * Second mapping is for device visible address, or "bus" address.
- * The bus address is returned at '*pba'.
- *
- * These functions seem distinct, but are hard to split. On sun4c,
- * at least for now, 'a' is equal to bus address, and retured in *pba.
- * On sun4m, page attributes depend on the CPU type, so we have to
- * know if we are mapping RAM or I/O, so it has to be an additional argument
- * to a separate mapping function for CPU visible mappings.
- */
-BTFIXUPDEF_CALL(int,  mmu_map_dma_area, dma_addr_t *, unsigned long, unsigned long, int len)
-BTFIXUPDEF_CALL(struct page *, mmu_translate_dvma, unsigned long busa)
-BTFIXUPDEF_CALL(void,  mmu_unmap_dma_area, unsigned long busa, int len)
-
-#define mmu_map_dma_area(pba,va,a,len) BTFIXUP_CALL(mmu_map_dma_area)(pba,va,a,len)
-#define mmu_unmap_dma_area(ba,len) BTFIXUP_CALL(mmu_unmap_dma_area)(ba,len)
-#define mmu_translate_dvma(ba)     BTFIXUP_CALL(mmu_translate_dvma)(ba)
-
 BTFIXUPDEF_SIMM13(pgdir_shift)
 BTFIXUPDEF_SETHI(pgdir_size)
 BTFIXUPDEF_SETHI(pgdir_mask)
diff --git a/include/asm-sparc/pgtsrmmu.h b/include/asm-sparc/pgtsrmmu.h
index 3107339dd..7e57043a1 100644
--- a/include/asm-sparc/pgtsrmmu.h
+++ b/include/asm-sparc/pgtsrmmu.h
@@ -106,7 +106,7 @@
  * enforce all the protection levels that vma's can have.
  * XXX But for now...
  */
-#define SRMMU_PAGE_NONE    __pgprot(SRMMU_VALID | SRMMU_CACHE | \
+#define SRMMU_PAGE_NONE    __pgprot(SRMMU_CACHE | \
 				    SRMMU_PRIV | SRMMU_REF)
 #define SRMMU_PAGE_SHARED  __pgprot(SRMMU_VALID | SRMMU_CACHE | \
 				    SRMMU_EXEC | SRMMU_WRITE | SRMMU_REF)
diff --git a/include/asm-sparc/pgtsun4.h b/include/asm-sparc/pgtsun4.h
index ecd5afcf2..60bda107f 100644
--- a/include/asm-sparc/pgtsun4.h
+++ b/include/asm-sparc/pgtsun4.h
@@ -51,6 +51,7 @@
 #define _SUN4C_PAGE_NOCACHE      0x10000000   /* non-cacheable page */
 #define _SUN4C_PAGE_PRESENT      0x08000000   /* implemented in software */
 #define _SUN4C_PAGE_IO           0x04000000   /* I/O page */
+#define _SUN4C_PAGE_FILE         0x02000000   /* implemented in software */
 #define _SUN4C_PAGE_READ         0x00800000   /* implemented in software */
 #define _SUN4C_PAGE_WRITE        0x00400000   /* implemented in software */
 #define _SUN4C_PAGE_ACCESSED     0x00200000   /* implemented in software */
@@ -71,6 +72,21 @@
 #define SUN4C_PAGE_KERNEL	__pgprot(_SUN4C_READABLE|_SUN4C_WRITEABLE|\
 					 _SUN4C_PAGE_DIRTY|_SUN4C_PAGE_PRIV)
 
+/* SUN4C swap entry encoding
+ *
+ * We use 5 bits for the type and 19 for the offset.  This gives us
+ * 32 swapfiles of 4GB each.  Encoding looks like:
+ *
+ * RRRRRRRRooooooooooooooooooottttt
+ * fedcba9876543210fedcba9876543210
+ *
+ * The top 8 bits are reserved for protection and status bits, especially
+ * FILE and PRESENT.
+ */
+#define SUN4C_SWP_TYPE_MASK	0x1f
+#define SUN4C_SWP_OFF_MASK	0x7ffff
+#define SUN4C_SWP_OFF_SHIFT	5
+
 #ifndef __ASSEMBLY__
 
 static inline unsigned long sun4c_get_synchronous_error(void)
diff --git a/include/asm-sparc/processor.h b/include/asm-sparc/processor.h
index 0a9a4f5bc..371a10505 100644
--- a/include/asm-sparc/processor.h
+++ b/include/asm-sparc/processor.h
@@ -76,20 +76,8 @@ struct thread_struct {
 #define SPARC_FLAG_UNALIGNED    0x2    /* is allowed to do unaligned accesses */
 
 #define INIT_THREAD  { \
-/* kregs, _pad1, */ \
-   0, 0,  \
-/* fork_kpsr, fork_kwim */ \
-   0,         0, \
-/* FPU regs */   { 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, \
-                   0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, }, \
-/* FPU status, FPU qdepth, FPU queue */ \
-   0,          0,  { { 0, 0, }, }, \
-/* flags,              current_ds, */ \
-   SPARC_FLAG_KTHREAD, KERNEL_DS, \
-/* core_exec */ \
-{ 0, }, \
-/* new_signal */ \
-  0, \
+	.flags = SPARC_FLAG_KTHREAD, \
+	.current_ds = KERNEL_DS, \
 }
 
 /* Return saved PC of a blocked thread. */
diff --git a/include/asm-sparc/resource.h b/include/asm-sparc/resource.h
index 8237763e5..58e90f72c 100644
--- a/include/asm-sparc/resource.h
+++ b/include/asm-sparc/resource.h
@@ -19,11 +19,13 @@
 #define RLIMIT_RSS	5		/* max resident set size */
 #define RLIMIT_NOFILE	6		/* max number of open files */
 #define RLIMIT_NPROC	7		/* max number of processes */
-#define RLIMIT_MEMLOCK  8               /* max locked-in-memory address space */
-#define RLIMIT_AS       9               /* address space limit */
+#define RLIMIT_MEMLOCK	8		/* max locked-in-memory address space */
+#define RLIMIT_AS	9		/* address space limit */
 #define RLIMIT_LOCKS	10		/* maximum file locks held */
+#define RLIMIT_SIGPENDING 11		/* max number of pending signals */
+#define RLIMIT_MSGQUEUE 12		/* maximum bytes in POSIX mqueues */
 
-#define RLIM_NLIMITS	11
+#define RLIM_NLIMITS	13
 
 /*
  * SuS says limits have to be unsigned.
@@ -44,7 +46,9 @@
     {INR_OPEN, INR_OPEN}, {0, 0},	\
     {RLIM_INFINITY, RLIM_INFINITY},	\
     {RLIM_INFINITY, RLIM_INFINITY},	\
-    {RLIM_INFINITY, RLIM_INFINITY}	\
+    {RLIM_INFINITY, RLIM_INFINITY},	\
+    {MAX_SIGPENDING, MAX_SIGPENDING},	\
+    {MQ_BYTES_MAX, MQ_BYTES_MAX},	\
 }
 
 #endif /* __KERNEL__ */
diff --git a/include/asm-sparc/setup.h b/include/asm-sparc/setup.h
index d8aaa7205..b3af958a2 100644
--- a/include/asm-sparc/setup.h
+++ b/include/asm-sparc/setup.h
@@ -5,5 +5,6 @@
 #ifndef _SPARC_SETUP_H
 #define _SPARC_SETUP_H
 
+#define COMMAND_LINE_SIZE	256
 
 #endif /* _SPARC_SETUP_H */
diff --git a/include/asm-sparc/sun4prom.h b/include/asm-sparc/sun4prom.h
index 3a6167f4b..9c8b4cbf6 100644
--- a/include/asm-sparc/sun4prom.h
+++ b/include/asm-sparc/sun4prom.h
@@ -25,7 +25,7 @@ typedef struct {
 	unsigned char	(*getchar)(void);	/* Get char from input device */ 
 	void		(*putchar)(char);	/* Put char to output device */
 	int		(*mayget)(void);	/* Maybe get char, or -1 */
-	int		(*mayput)(void);	/* Maybe put char, or -1 */
+	int		(*mayput)(int);		/* Maybe put char, or -1 */
 	unsigned char	*echo;			/* Should getchar echo? */
 	unsigned char	*insource;		/* Input source selector */
 	unsigned char	*outsink;		/* Output sink selector */
diff --git a/include/asm-sparc/system.h b/include/asm-sparc/system.h
index 2497d51bb..808fb0b96 100644
--- a/include/asm-sparc/system.h
+++ b/include/asm-sparc/system.h
@@ -126,7 +126,7 @@ extern void fpsave(unsigned long *fpregs, unsigned long *fsr,
 #define switch_to(prev, next, last) do {						\
 	SWITCH_ENTER(prev);								\
 	SWITCH_DO_LAZY_FPU(next);							\
-	next->active_mm->cpu_vm_mask |= (1 << smp_processor_id());			\
+	cpu_set(smp_processor_id(), next->active_mm->cpu_vm_mask);			\
 	__asm__ __volatile__(								\
 	"sethi	%%hi(here - 0x8), %%o7\n\t"						\
 	"mov	%%g6, %%g3\n\t"								\
diff --git a/include/asm-sparc/vfc_ioctls.h b/include/asm-sparc/vfc_ioctls.h
index 05205f80c..af8b69007 100644
--- a/include/asm-sparc/vfc_ioctls.h
+++ b/include/asm-sparc/vfc_ioctls.h
@@ -52,7 +52,7 @@ struct vfc_debug_inout
 	unsigned long addr;
 	unsigned long ret;
 	unsigned long len;
-	unsigned char *buffer;
+	unsigned char __user *buffer;
 };
 
 #endif /* _LINUX_VFC_IOCTLS_H_ */
diff --git a/include/asm-sparc64/asi.h b/include/asm-sparc64/asi.h
index 2a6d3c33b..534855660 100644
--- a/include/asm-sparc64/asi.h
+++ b/include/asm-sparc64/asi.h
@@ -8,125 +8,138 @@
  */
 
 /* V9 Architecture mandary ASIs. */
-#define ASI_N			0x04 /* Nucleus					*/
-#define ASI_NL			0x0c /* Nucleus, little endian			*/
-#define ASI_AIUP		0x10 /* Primary, user				*/
-#define ASI_AIUS		0x11 /* Secondary, user				*/
-#define ASI_AIUPL		0x18 /* Primary, user, little endian		*/
-#define ASI_AIUSL		0x19 /* Secondary, user, little endian		*/
-#define ASI_P			0x80 /* Primary, implicit			*/
-#define ASI_S			0x81 /* Secondary, implicit			*/
-#define ASI_PNF			0x82 /* Primary, no fault			*/
-#define ASI_SNF			0x83 /* Secondary, no fault			*/
-#define ASI_PL			0x88 /* Primary, implicit, little endian	*/
-#define ASI_SL			0x89 /* Secondary, implicit, little endian	*/
-#define ASI_PNFL		0x8a /* Primary, no fault, little endian	*/
-#define ASI_SNFL		0x8b /* Secondary, no fault, little endian	*/
+#define ASI_N			0x04 /* Nucleus				*/
+#define ASI_NL			0x0c /* Nucleus, little endian		*/
+#define ASI_AIUP		0x10 /* Primary, user			*/
+#define ASI_AIUS		0x11 /* Secondary, user			*/
+#define ASI_AIUPL		0x18 /* Primary, user, little endian	*/
+#define ASI_AIUSL		0x19 /* Secondary, user, little endian	*/
+#define ASI_P			0x80 /* Primary, implicit		*/
+#define ASI_S			0x81 /* Secondary, implicit		*/
+#define ASI_PNF			0x82 /* Primary, no fault		*/
+#define ASI_SNF			0x83 /* Secondary, no fault		*/
+#define ASI_PL			0x88 /* Primary, implicit, l-endian	*/
+#define ASI_SL			0x89 /* Secondary, implicit, l-endian	*/
+#define ASI_PNFL		0x8a /* Primary, no fault, l-endian	*/
+#define ASI_SNFL		0x8b /* Secondary, no fault, l-endian	*/
 
 /* SpitFire and later extended ASIs.  The "(III)" marker designates
- * UltraSparc-III specific ASIs.
+ * UltraSparc-III and later specific ASIs.  The "(CMT)" marker designates
+ * Chip Multi Threading specific ASIs.
  */
-#define ASI_PHYS_USE_EC		0x14 /* PADDR, E-cachable			*/
-#define ASI_PHYS_BYPASS_EC_E	0x15 /* PADDR, E-bit				*/
-#define ASI_PHYS_USE_EC_L	0x1c /* PADDR, E-cachable, little endian	*/
-#define ASI_PHYS_BYPASS_EC_E_L	0x1d /* PADDR, E-bit, little endian		*/
-#define ASI_NUCLEUS_QUAD_LDD	0x24 /* Cachable, qword load			*/
-#define ASI_NUCLEUS_QUAD_LDD_L	0x2c /* Cachable, qword load, little endian 	*/
-#define ASI_PCACHE_DATA_STATUS	0x30 /* (III) PCache data status RAM diag	*/
-#define ASI_PCACHE_DATA		0x31 /* (III) PCache data RAM diag		*/
-#define ASI_PCACHE_TAG		0x32 /* (III) PCache tag RAM diag		*/
-#define ASI_PCACHE_SNOOP_TAG	0x33 /* (III) PCache snoop tag RAM diag		*/
-#define ASI_QUAD_LDD_PHYS	0x34 /* (III+) PADDR, qword load		*/
-#define ASI_WCACHE_VALID_BITS	0x38 /* (III) WCache Valid Bits diag		*/
-#define ASI_WCACHE_DATA		0x39 /* (III) WCache data RAM diag		*/
-#define ASI_WCACHE_TAG		0x3a /* (III) WCache tag RAM diag		*/
-#define ASI_WCACHE_SNOOP_TAG	0x3b /* (III) WCache snoop tag RAM diag		*/
-#define ASI_QUAD_LDD_PHYS_L	0x3c /* (III+) PADDR, qword load, little endian	*/
-#define ASI_SRAM_FAST_INIT	0x40 /* (III+) Fast SRAM init			*/
-#define ASI_DCACHE_INVALIDATE	0x42 /* (III) DCache Invalidate diag		*/
-#define ASI_DCACHE_UTAG		0x43 /* (III) DCache uTag diag			*/
-#define ASI_DCACHE_SNOOP_TAG	0x44 /* (III) DCache snoop tag RAM diag		*/
-#define ASI_LSU_CONTROL		0x45 /* Load-store control unit			*/
-#define ASI_DCU_CONTROL_REG	0x45 /* (III) DCache Unit Control Register	*/
-#define ASI_DCACHE_DATA		0x46 /* Data cache data-ram diag access		*/
-#define ASI_DCACHE_TAG		0x47 /* Data cache tag/valid ram diag access	*/
-#define ASI_INTR_DISPATCH_STAT	0x48 /* IRQ vector dispatch status		*/
-#define ASI_INTR_RECEIVE	0x49 /* IRQ vector receive status		*/
-#define ASI_UPA_CONFIG		0x4a /* UPA config space			*/
-#define ASI_JBUS_CONFIG		0x4a /* (IIIi) JBUS Config Register		*/
-#define ASI_SAFARI_CONFIG	0x4a /* (III) Safari Config Register		*/
-#define ASI_SAFARI_ADDRESS	0x4a /* (III) Safari Address Register		*/
-#define ASI_ESTATE_ERROR_EN	0x4b /* E-cache error enable space		*/
-#define ASI_AFSR		0x4c /* Async fault status register		*/
-#define ASI_AFAR		0x4d /* Async fault address register		*/
-#define ASI_EC_TAG_DATA		0x4e /* E-cache tag/valid ram diag access	*/
-#define ASI_IMMU		0x50 /* Insn-MMU main register space		*/
-#define ASI_IMMU_TSB_8KB_PTR	0x51 /* Insn-MMU 8KB TSB pointer register	*/
-#define ASI_IMMU_TSB_64KB_PTR	0x52 /* Insn-MMU 64KB TSB pointer register	*/
-#define ASI_ITLB_DATA_IN	0x54 /* Insn-MMU TLB data in register		*/
-#define ASI_ITLB_DATA_ACCESS	0x55 /* Insn-MMU TLB data access register	*/
-#define ASI_ITLB_TAG_READ	0x56 /* Insn-MMU TLB tag read register		*/
-#define ASI_IMMU_DEMAP		0x57 /* Insn-MMU TLB demap			*/
-#define ASI_DMMU		0x58 /* Data-MMU main register space		*/
-#define ASI_DMMU_TSB_8KB_PTR	0x59 /* Data-MMU 8KB TSB pointer register	*/
-#define ASI_DMMU_TSB_64KB_PTR	0x5a /* Data-MMU 16KB TSB pointer register	*/
-#define ASI_DMMU_TSB_DIRECT_PTR	0x5b /* Data-MMU TSB direct pointer register	*/
-#define ASI_DTLB_DATA_IN	0x5c /* Data-MMU TLB data in register		*/
-#define ASI_DTLB_DATA_ACCESS	0x5d /* Data-MMU TLB data access register	*/
-#define ASI_DTLB_TAG_READ	0x5e /* Data-MMU TLB tag read register		*/
-#define ASI_DMMU_DEMAP		0x5f /* Data-MMU TLB demap			*/
-#define ASI_IIU_INST_TRAP	0x60 /* (III) Instruction Breakpoint register	*/
-#define ASI_IC_INSTR		0x66 /* Insn cache instrucion ram diag access	*/
-#define ASI_IC_TAG		0x67 /* Insn cache tag/valid ram diag access	*/
-#define ASI_IC_STAG		0x68 /* (III) Insn cache snoop tag ram diag	*/
-#define ASI_IC_PRE_DECODE	0x6e /* Insn cache pre-decode ram diag access	*/
-#define ASI_IC_NEXT_FIELD	0x6f /* Insn cache next-field ram diag access	*/
-#define ASI_BRPRED_ARRAY	0x6f /* (III) Branch Prediction RAM diag	*/
-#define ASI_BLK_AIUP		0x70 /* Primary, user, block load/store		*/
-#define ASI_BLK_AIUS		0x71 /* Secondary, user, block load/store	*/
-#define ASI_MCU_CTRL_REG	0x72 /* (III) Memory controller registers	*/
-#define ASI_EC_DATA		0x74 /* (III) E-cache data staging register	*/
-#define ASI_EC_CTRL		0x75 /* (III) E-cache control register		*/
-#define ASI_EC_W		0x76 /* E-cache diag write access		*/
-#define ASI_UDB_ERROR_W		0x77 /* External UDB error registers write	*/
-#define ASI_UDB_CONTROL_W	0x77 /* External UDB control registers write	*/
-#define ASI_INTR_W		0x77 /* IRQ vector dispatch write		*/
-#define ASI_INTR_DATAN_W	0x77 /* (III) Outgoing irq vector data reg N	*/
-#define ASI_INTR_DISPATCH_W	0x77 /* (III) Interrupt vector dispatch		*/
-#define ASI_BLK_AIUPL		0x78 /* Primary, user, little, blk ld/st	*/
-#define ASI_BLK_AIUSL		0x79 /* Secondary, user, little, blk ld/st	*/
-#define ASI_EC_R		0x7e /* E-cache diag read access		*/
-#define ASI_UDBH_ERROR_R	0x7f /* External UDB error registers read hi	*/
-#define ASI_UDBL_ERROR_R	0x7f /* External UDB error registers read low	*/
-#define ASI_UDBH_CONTROL_R	0x7f /* External UDB control registers read hi	*/
-#define ASI_UDBL_CONTROL_R	0x7f /* External UDB control registers read low	*/
-#define ASI_INTR_R		0x7f /* IRQ vector dispatch read		*/
-#define ASI_INTR_DATAN_R	0x7f /* (III) Incoming irq vector data reg N	*/
-#define ASI_PST8_P		0xc0 /* Primary, 8 8-bit, partial		*/
-#define ASI_PST8_S		0xc1 /* Secondary, 8 8-bit, partial		*/
-#define ASI_PST16_P		0xc2 /* Primary, 4 16-bit, partial		*/
-#define ASI_PST16_S		0xc3 /* Secondary, 4 16-bit, partial		*/
-#define ASI_PST32_P		0xc4 /* Primary, 2 32-bit, partial		*/
-#define ASI_PST32_S		0xc5 /* Secondary, 2 32-bit, partial		*/
-#define ASI_PST8_PL		0xc8 /* Primary, 8 8-bit, partial, little	*/
-#define ASI_PST8_SL		0xc9 /* Secondary, 8 8-bit, partial, little	*/
-#define ASI_PST16_PL		0xca /* Primary, 4 16-bit, partial, little	*/
-#define ASI_PST16_SL		0xcb /* Secondary, 4 16-bit, partial, little	*/
-#define ASI_PST32_PL		0xcc /* Primary, 2 32-bit, partial, little	*/
-#define ASI_PST32_SL		0xcd /* Secondary, 2 32-bit, partial, little	*/
-#define ASI_FL8_P		0xd0 /* Primary, 1 8-bit, fpu ld/st		*/
-#define ASI_FL8_S		0xd1 /* Secondary, 1 8-bit, fpu ld/st		*/
-#define ASI_FL16_P		0xd2 /* Primary, 1 16-bit, fpu ld/st		*/
-#define ASI_FL16_S		0xd3 /* Secondary, 1 16-bit, fpu ld/st		*/
-#define ASI_FL8_PL		0xd8 /* Primary, 1 8-bit, fpu ld/st, little	*/
-#define ASI_FL8_SL		0xd9 /* Secondary, 1 8-bit, fpu ld/st, little	*/
-#define ASI_FL16_PL		0xda /* Primary, 1 16-bit, fpu ld/st, little	*/
-#define ASI_FL16_SL		0xdb /* Secondary, 1 16-bit, fpu ld/st, little	*/
-#define ASI_BLK_COMMIT_P	0xe0 /* Primary, blk store commit		*/
-#define ASI_BLK_COMMIT_S	0xe1 /* Secondary, blk store commit		*/
-#define ASI_BLK_P		0xf0 /* Primary, blk ld/st			*/
-#define ASI_BLK_S		0xf1 /* Secondary, blk ld/st			*/
-#define ASI_BLK_PL		0xf8 /* Primary, blk ld/st, little		*/
-#define ASI_BLK_SL		0xf9 /* Secondary, blk ld/st, little		*/
+#define ASI_PHYS_USE_EC		0x14 /* PADDR, E-cachable		*/
+#define ASI_PHYS_BYPASS_EC_E	0x15 /* PADDR, E-bit			*/
+#define ASI_PHYS_USE_EC_L	0x1c /* PADDR, E-cachable, little endian*/
+#define ASI_PHYS_BYPASS_EC_E_L	0x1d /* PADDR, E-bit, little endian	*/
+#define ASI_NUCLEUS_QUAD_LDD	0x24 /* Cachable, qword load		*/
+#define ASI_NUCLEUS_QUAD_LDD_L	0x2c /* Cachable, qword load, l-endian 	*/
+#define ASI_PCACHE_DATA_STATUS	0x30 /* (III) PCache data stat RAM diag	*/
+#define ASI_PCACHE_DATA		0x31 /* (III) PCache data RAM diag	*/
+#define ASI_PCACHE_TAG		0x32 /* (III) PCache tag RAM diag	*/
+#define ASI_PCACHE_SNOOP_TAG	0x33 /* (III) PCache snoop tag RAM diag	*/
+#define ASI_QUAD_LDD_PHYS	0x34 /* (III+) PADDR, qword load	*/
+#define ASI_WCACHE_VALID_BITS	0x38 /* (III) WCache Valid Bits diag	*/
+#define ASI_WCACHE_DATA		0x39 /* (III) WCache data RAM diag	*/
+#define ASI_WCACHE_TAG		0x3a /* (III) WCache tag RAM diag	*/
+#define ASI_WCACHE_SNOOP_TAG	0x3b /* (III) WCache snoop tag RAM diag	*/
+#define ASI_QUAD_LDD_PHYS_L	0x3c /* (III+) PADDR, qw-load, l-endian	*/
+#define ASI_SRAM_FAST_INIT	0x40 /* (III+) Fast SRAM init		*/
+#define ASI_CORE_AVAILABLE	0x41 /* (CMT) LP Available		*/
+#define ASI_CORE_ENABLE_STAT	0x41 /* (CMT) LP Enable Status		*/
+#define ASI_CORE_ENABLE		0x41 /* (CMT) LP Enable RW		*/
+#define ASI_XIR_STEERING	0x41 /* (CMT) XIR Steering RW		*/
+#define ASI_CORE_RUNNING_RW	0x41 /* (CMT) LP Running RW		*/
+#define ASI_CORE_RUNNING_W1S	0x41 /* (CMT) LP Running Write-One Set	*/
+#define ASI_CORE_RUNNING_W1C	0x41 /* (CMT) LP Running Write-One Clr	*/
+#define ASI_CORE_RUNNING_STAT	0x41 /* (CMT) LP Running Status		*/
+#define ASI_CMT_ERROR_STEERING	0x41 /* (CMT) Error Steering RW		*/
+#define ASI_DCACHE_INVALIDATE	0x42 /* (III) DCache Invalidate diag	*/
+#define ASI_DCACHE_UTAG		0x43 /* (III) DCache uTag diag		*/
+#define ASI_DCACHE_SNOOP_TAG	0x44 /* (III) DCache snoop tag RAM diag	*/
+#define ASI_LSU_CONTROL		0x45 /* Load-store control unit		*/
+#define ASI_DCU_CONTROL_REG	0x45 /* (III) DCache Unit Control reg	*/
+#define ASI_DCACHE_DATA		0x46 /* DCache data-ram diag access	*/
+#define ASI_DCACHE_TAG		0x47 /* Dcache tag/valid ram diag access*/
+#define ASI_INTR_DISPATCH_STAT	0x48 /* IRQ vector dispatch status	*/
+#define ASI_INTR_RECEIVE	0x49 /* IRQ vector receive status	*/
+#define ASI_UPA_CONFIG		0x4a /* UPA config space		*/
+#define ASI_JBUS_CONFIG		0x4a /* (IIIi) JBUS Config Register	*/
+#define ASI_SAFARI_CONFIG	0x4a /* (III) Safari Config Register	*/
+#define ASI_SAFARI_ADDRESS	0x4a /* (III) Safari Address Register	*/
+#define ASI_ESTATE_ERROR_EN	0x4b /* E-cache error enable space	*/
+#define ASI_AFSR		0x4c /* Async fault status register	*/
+#define ASI_AFAR		0x4d /* Async fault address register	*/
+#define ASI_EC_TAG_DATA		0x4e /* E-cache tag/valid ram diag acc	*/
+#define ASI_IMMU		0x50 /* Insn-MMU main register space	*/
+#define ASI_IMMU_TSB_8KB_PTR	0x51 /* Insn-MMU 8KB TSB pointer reg	*/
+#define ASI_IMMU_TSB_64KB_PTR	0x52 /* Insn-MMU 64KB TSB pointer reg	*/
+#define ASI_ITLB_DATA_IN	0x54 /* Insn-MMU TLB data in reg	*/
+#define ASI_ITLB_DATA_ACCESS	0x55 /* Insn-MMU TLB data access reg	*/
+#define ASI_ITLB_TAG_READ	0x56 /* Insn-MMU TLB tag read reg	*/
+#define ASI_IMMU_DEMAP		0x57 /* Insn-MMU TLB demap		*/
+#define ASI_DMMU		0x58 /* Data-MMU main register space	*/
+#define ASI_DMMU_TSB_8KB_PTR	0x59 /* Data-MMU 8KB TSB pointer reg	*/
+#define ASI_DMMU_TSB_64KB_PTR	0x5a /* Data-MMU 16KB TSB pointer reg	*/
+#define ASI_DMMU_TSB_DIRECT_PTR	0x5b /* Data-MMU TSB direct pointer reg	*/
+#define ASI_DTLB_DATA_IN	0x5c /* Data-MMU TLB data in reg	*/
+#define ASI_DTLB_DATA_ACCESS	0x5d /* Data-MMU TLB data access reg	*/
+#define ASI_DTLB_TAG_READ	0x5e /* Data-MMU TLB tag read reg	*/
+#define ASI_DMMU_DEMAP		0x5f /* Data-MMU TLB demap		*/
+#define ASI_IIU_INST_TRAP	0x60 /* (III) Instruction Breakpoint	*/
+#define ASI_INTR_ID		0x63 /* (CMT) Interrupt ID register	*/
+#define ASI_CORE_ID		0x63 /* (CMT) LP ID register		*/
+#define ASI_CESR_ID		0x63 /* (CMT) CESR ID register		*/
+#define ASI_IC_INSTR		0x66 /* Insn cache instrucion ram diag	*/
+#define ASI_IC_TAG		0x67 /* Insn cache tag/valid ram diag 	*/
+#define ASI_IC_STAG		0x68 /* (III) Insn cache snoop tag ram	*/
+#define ASI_IC_PRE_DECODE	0x6e /* Insn cache pre-decode ram diag	*/
+#define ASI_IC_NEXT_FIELD	0x6f /* Insn cache next-field ram diag	*/
+#define ASI_BRPRED_ARRAY	0x6f /* (III) Branch Prediction RAM diag*/
+#define ASI_BLK_AIUP		0x70 /* Primary, user, block load/store	*/
+#define ASI_BLK_AIUS		0x71 /* Secondary, user, block ld/st	*/
+#define ASI_MCU_CTRL_REG	0x72 /* (III) Memory controller regs	*/
+#define ASI_EC_DATA		0x74 /* (III) E-cache data staging reg	*/
+#define ASI_EC_CTRL		0x75 /* (III) E-cache control reg	*/
+#define ASI_EC_W		0x76 /* E-cache diag write access	*/
+#define ASI_UDB_ERROR_W		0x77 /* External UDB error regs W	*/
+#define ASI_UDB_CONTROL_W	0x77 /* External UDB control regs W	*/
+#define ASI_INTR_W		0x77 /* IRQ vector dispatch write	*/
+#define ASI_INTR_DATAN_W	0x77 /* (III) Out irq vector data reg N	*/
+#define ASI_INTR_DISPATCH_W	0x77 /* (III) Interrupt vector dispatch	*/
+#define ASI_BLK_AIUPL		0x78 /* Primary, user, little, blk ld/st*/
+#define ASI_BLK_AIUSL		0x79 /* Secondary, user, little, blk ld/st*/
+#define ASI_EC_R		0x7e /* E-cache diag read access	*/
+#define ASI_UDBH_ERROR_R	0x7f /* External UDB error regs rd hi	*/
+#define ASI_UDBL_ERROR_R	0x7f /* External UDB error regs rd low	*/
+#define ASI_UDBH_CONTROL_R	0x7f /* External UDB control regs rd hi	*/
+#define ASI_UDBL_CONTROL_R	0x7f /* External UDB control regs rd low*/
+#define ASI_INTR_R		0x7f /* IRQ vector dispatch read	*/
+#define ASI_INTR_DATAN_R	0x7f /* (III) In irq vector data reg N	*/
+#define ASI_PST8_P		0xc0 /* Primary, 8 8-bit, partial	*/
+#define ASI_PST8_S		0xc1 /* Secondary, 8 8-bit, partial	*/
+#define ASI_PST16_P		0xc2 /* Primary, 4 16-bit, partial	*/
+#define ASI_PST16_S		0xc3 /* Secondary, 4 16-bit, partial	*/
+#define ASI_PST32_P		0xc4 /* Primary, 2 32-bit, partial	*/
+#define ASI_PST32_S		0xc5 /* Secondary, 2 32-bit, partial	*/
+#define ASI_PST8_PL		0xc8 /* Primary, 8 8-bit, partial, L	*/
+#define ASI_PST8_SL		0xc9 /* Secondary, 8 8-bit, partial, L	*/
+#define ASI_PST16_PL		0xca /* Primary, 4 16-bit, partial, L	*/
+#define ASI_PST16_SL		0xcb /* Secondary, 4 16-bit, partial, L	*/
+#define ASI_PST32_PL		0xcc /* Primary, 2 32-bit, partial, L	*/
+#define ASI_PST32_SL		0xcd /* Secondary, 2 32-bit, partial, L	*/
+#define ASI_FL8_P		0xd0 /* Primary, 1 8-bit, fpu ld/st	*/
+#define ASI_FL8_S		0xd1 /* Secondary, 1 8-bit, fpu ld/st	*/
+#define ASI_FL16_P		0xd2 /* Primary, 1 16-bit, fpu ld/st	*/
+#define ASI_FL16_S		0xd3 /* Secondary, 1 16-bit, fpu ld/st	*/
+#define ASI_FL8_PL		0xd8 /* Primary, 1 8-bit, fpu ld/st, L	*/
+#define ASI_FL8_SL		0xd9 /* Secondary, 1 8-bit, fpu ld/st, L*/
+#define ASI_FL16_PL		0xda /* Primary, 1 16-bit, fpu ld/st, L	*/
+#define ASI_FL16_SL		0xdb /* Secondary, 1 16-bit, fpu ld/st,L*/
+#define ASI_BLK_COMMIT_P	0xe0 /* Primary, blk store commit	*/
+#define ASI_BLK_COMMIT_S	0xe1 /* Secondary, blk store commit	*/
+#define ASI_BLK_P		0xf0 /* Primary, blk ld/st		*/
+#define ASI_BLK_S		0xf1 /* Secondary, blk ld/st		*/
+#define ASI_BLK_PL		0xf8 /* Primary, blk ld/st, little	*/
+#define ASI_BLK_SL		0xf9 /* Secondary, blk ld/st, little	*/
 
 #endif /* _SPARC64_ASI_H */
diff --git a/include/asm-sparc64/bitops.h b/include/asm-sparc64/bitops.h
index d32c13843..f13765454 100644
--- a/include/asm-sparc64/bitops.h
+++ b/include/asm-sparc64/bitops.h
@@ -204,7 +204,8 @@ static __inline__ unsigned int hweight8(unsigned int w)
  * @offset: The bitnumber to start searching at
  * @size: The maximum size to search
  */
-extern unsigned long find_next_bit(unsigned long *, unsigned long, unsigned long);
+extern unsigned long find_next_bit(const unsigned long *, unsigned long,
+					unsigned long);
 
 /**
  * find_first_bit - find the first set bit in a memory region
diff --git a/include/asm-sparc64/bpp.h b/include/asm-sparc64/bpp.h
index 9b12a088a..abe163a50 100644
--- a/include/asm-sparc64/bpp.h
+++ b/include/asm-sparc64/bpp.h
@@ -40,9 +40,9 @@
  */
 
 # define BPP_PUT_PINS _IOW('B', 1, int)
-# define BPP_GET_PINS _IOR('B', 2, void)
+# define BPP_GET_PINS _IOR('B', 2, char) /* that's bogus - should've been _IO */
 # define BPP_PUT_DATA _IOW('B', 3, int)
-# define BPP_GET_DATA _IOR('B', 4, void)
+# define BPP_GET_DATA _IOR('B', 4, char) /* ditto */
 
 /*
  * Set the data bus to input mode. Disengage the data bin driver and
diff --git a/include/asm-sparc64/bug.h b/include/asm-sparc64/bug.h
index bdaba5ccc..bfac1afa9 100644
--- a/include/asm-sparc64/bug.h
+++ b/include/asm-sparc64/bug.h
@@ -3,6 +3,8 @@
 #ifndef _SPARC64_BUG_H
 #define _SPARC64_BUG_H
 
+#include <linux/compiler.h>
+
 #ifdef CONFIG_DEBUG_BUGVERBOSE
 extern void do_BUG(const char *file, int line);
 #define BUG() do {					\
diff --git a/include/asm-sparc64/byteorder.h b/include/asm-sparc64/byteorder.h
index f8c370d26..c69b08af5 100644
--- a/include/asm-sparc64/byteorder.h
+++ b/include/asm-sparc64/byteorder.h
@@ -7,7 +7,7 @@
 
 #ifdef __GNUC__
 
-static __inline__ __u16 ___arch__swab16p(__u16 *addr)
+static __inline__ __u16 ___arch__swab16p(const __u16 *addr)
 {
 	__u16 ret;
 
@@ -17,7 +17,7 @@ static __inline__ __u16 ___arch__swab16p(__u16 *addr)
 	return ret;
 }
 
-static __inline__ __u32 ___arch__swab32p(__u32 *addr)
+static __inline__ __u32 ___arch__swab32p(const __u32 *addr)
 {
 	__u32 ret;
 
@@ -27,7 +27,7 @@ static __inline__ __u32 ___arch__swab32p(__u32 *addr)
 	return ret;
 }
 
-static __inline__ __u64 ___arch__swab64p(__u64 *addr)
+static __inline__ __u64 ___arch__swab64p(const __u64 *addr)
 {
 	__u64 ret;
 
diff --git a/include/asm-sparc64/cacheflush.h b/include/asm-sparc64/cacheflush.h
index fc1931681..b04024ff5 100644
--- a/include/asm-sparc64/cacheflush.h
+++ b/include/asm-sparc64/cacheflush.h
@@ -9,7 +9,8 @@
 /* These are the same regardless of whether this is an SMP kernel or not. */
 #define flush_cache_mm(__mm) \
 	do { if ((__mm) == current->mm) flushw_user(); } while(0)
-extern void flush_cache_range(struct vm_area_struct *, unsigned long, unsigned long);
+#define flush_cache_range(vma, start, end) \
+	flush_cache_mm((vma)->vm_mm)
 #define flush_cache_page(vma, page) \
 	flush_cache_mm((vma)->vm_mm)
 
diff --git a/include/asm-sparc64/checksum.h b/include/asm-sparc64/checksum.h
index a7d31c896..c388e6e06 100644
--- a/include/asm-sparc64/checksum.h
+++ b/include/asm-sparc64/checksum.h
@@ -66,8 +66,9 @@ csum_partial_copy_from_user(const char *src, char *dst, int len,
  */
 #define HAVE_CSUM_COPY_USER
 extern unsigned int csum_partial_copy_user_sparc64(const char *src, char *dst, int len, unsigned int sum);
+
 static __inline__ unsigned int 
-csum_and_copy_to_user(const char *src, char *dst, int len, 
+csum_and_copy_to_user(const char *src, char __user *dst, int len, 
 		      unsigned int sum, int *err)
 {
 	__asm__ __volatile__ ("stx	%0, [%%sp + 0x7ff + 128]"
diff --git a/include/asm-sparc64/fbio.h b/include/asm-sparc64/fbio.h
index f21477bcf..c6c4da6e1 100644
--- a/include/asm-sparc64/fbio.h
+++ b/include/asm-sparc64/fbio.h
@@ -1,6 +1,8 @@
 #ifndef __LINUX_FBIO_H
 #define __LINUX_FBIO_H
 
+#include <linux/compiler.h>
+
 /* Constants used for fbio SunOS compatibility */
 /* (C) 1996 Miguel de Icaza */
 
@@ -56,9 +58,9 @@ struct  fbtype {
 struct  fbcmap {
         int             index;          /* first element (0 origin) */
         int             count;
-        unsigned char   *red;
-        unsigned char   *green;
-        unsigned char   *blue;
+        unsigned char   __user *red;
+        unsigned char   __user *green;
+        unsigned char   __user *blue;
 };
 
 #ifdef __KERNEL__
diff --git a/include/asm-sparc64/fcntl.h b/include/asm-sparc64/fcntl.h
index 0999d6d52..e36def0d0 100644
--- a/include/asm-sparc64/fcntl.h
+++ b/include/asm-sparc64/fcntl.h
@@ -21,6 +21,7 @@
 #define O_NOFOLLOW	0x20000	/* don't follow links */
 #define O_LARGEFILE	0x40000
 #define O_DIRECT        0x100000 /* direct disk access hint */
+#define O_NOATIME	0x200000
 
 
 #define F_DUPFD		0	/* dup */
diff --git a/include/asm-sparc64/floppy.h b/include/asm-sparc64/floppy.h
index 1bc43aaa4..e071b4b4e 100644
--- a/include/asm-sparc64/floppy.h
+++ b/include/asm-sparc64/floppy.h
@@ -164,7 +164,7 @@ unsigned long pdma_size;
 volatile int doing_pdma = 0;
 
 /* This is software state */
-char *pdma_base = 0;
+char *pdma_base = NULL;
 unsigned long pdma_areasize;
 
 /* Common routines to all controller types on the Sparc. */
@@ -173,7 +173,7 @@ static void sun_fd_disable_dma(void)
 	doing_pdma = 0;
 	if (pdma_base) {
 		mmu_unlockarea(pdma_base, pdma_areasize);
-		pdma_base = 0;
+		pdma_base = NULL;
 	}
 }
 
@@ -613,7 +613,7 @@ static unsigned long __init sun_floppy_init(void)
 	} else {
 #ifdef CONFIG_PCI
 		struct linux_ebus *ebus;
-		struct linux_ebus_device *edev = 0;
+		struct linux_ebus_device *edev = NULL;
 		unsigned long config = 0;
 		unsigned long auxio_reg;
 
diff --git a/include/asm-sparc64/io.h b/include/asm-sparc64/io.h
index da716a21f..94a8a70cd 100644
--- a/include/asm-sparc64/io.h
+++ b/include/asm-sparc64/io.h
@@ -19,8 +19,8 @@ extern unsigned long bus_to_virt_not_defined_use_pci_map(volatile void *addr);
 #define bus_to_virt bus_to_virt_not_defined_use_pci_map
 
 /* BIO layer definitions. */
-extern unsigned long phys_base, kern_base, kern_size;
-#define page_to_phys(page)	((((page) - mem_map) << PAGE_SHIFT)+phys_base)
+extern unsigned long kern_base, kern_size;
+#define page_to_phys(page)	(page_to_pfn(page) << PAGE_SHIFT)
 #define BIO_VMERGE_BOUNDARY	8192
 
 /* Different PCI controllers we support have their PCI MEM space
diff --git a/include/asm-sparc64/mmu_context.h b/include/asm-sparc64/mmu_context.h
index 1081acb1c..89490da2c 100644
--- a/include/asm-sparc64/mmu_context.h
+++ b/include/asm-sparc64/mmu_context.h
@@ -142,8 +142,6 @@ static inline void switch_mm(struct mm_struct *old_mm, struct mm_struct *mm, str
 	spin_unlock(&mm->page_table_lock);
 }
 
-extern void __flush_tlb_mm(unsigned long, unsigned long);
-
 #define deactivate_mm(tsk,mm)	do { } while (0)
 
 /* Activate a new MM instance for the current task. */
diff --git a/include/asm-sparc64/openpromio.h b/include/asm-sparc64/openpromio.h
index 555b3b5b1..847ce2326 100644
--- a/include/asm-sparc64/openpromio.h
+++ b/include/asm-sparc64/openpromio.h
@@ -1,6 +1,7 @@
 #ifndef	_SPARC64_OPENPROMIO_H
 #define	_SPARC64_OPENPROMIO_H
 
+#include <linux/compiler.h>
 #include <linux/ioctl.h>
 #include <linux/types.h>
 
@@ -52,9 +53,9 @@ struct opiocdesc
 {
 	int	op_nodeid;		/* PROM Node ID (value-result) */
 	int	op_namelen;		/* Length of op_name. */
-	char	*op_name;		/* Pointer to the property name. */
+	char	__user *op_name;	/* Pointer to the property name. */
 	int	op_buflen;		/* Length of op_buf (value-result) */
-	char	*op_buf;		/* Pointer to buffer. */
+	char	__user *op_buf;		/* Pointer to buffer. */
 };
 
 #define	OPIOCGET	_IOWR('O', 1, struct opiocdesc)
diff --git a/include/asm-sparc64/page.h b/include/asm-sparc64/page.h
index c543310b9..7259d9984 100644
--- a/include/asm-sparc64/page.h
+++ b/include/asm-sparc64/page.h
@@ -14,14 +14,11 @@
 
 #ifndef __ASSEMBLY__
 
-/* Sparc64 is slow at multiplication, we prefer to use some extra space. */
-#define WANT_PAGE_VIRTUAL 1
-
 extern void _clear_page(void *page);
 #define clear_page(X)	_clear_page((void *)(X))
 struct page;
 extern void clear_user_page(void *addr, unsigned long vaddr, struct page *page);
-#define copy_page(X,Y)	__memcpy((void *)(X), (void *)(Y), PAGE_SIZE)
+#define copy_page(X,Y)	memcpy((void *)(X), (void *)(Y), PAGE_SIZE)
 extern void copy_user_page(void *to, void *from, unsigned long vaddr, struct page *topage);
 
 /* GROSS, defining this makes gcc pass these types as aggregates,
@@ -111,17 +108,19 @@ typedef unsigned long iopgprot_t;
  */
 #define PAGE_OFFSET		_AC(0xFFFFF80000000000,UL)
 
+#ifndef __ASSEMBLY__
+
 #define __pa(x)			((unsigned long)(x) - PAGE_OFFSET)
 #define __va(x)			((void *)((unsigned long) (x) + PAGE_OFFSET))
 
 /* PFNs are real physical page numbers.  However, mem_map only begins to record
  * per-page information starting at pfn_base.  This is to handle systems where
- * the first physical page in the machine is at some huge physical address, such
- * as 4GB.   This is common on a partitioned E10000, for example.
+ * the first physical page in the machine is at some huge physical address,
+ * such as 4GB.   This is common on a partitioned E10000, for example.
  */
+extern struct page *pfn_to_page(unsigned long pfn);
+extern unsigned long page_to_pfn(struct page *);
 
-#define pfn_to_page(pfn)	(mem_map + ((pfn)-(pfn_base)))
-#define page_to_pfn(page)	((unsigned long)(((page) - mem_map) + pfn_base))
 #define virt_to_page(kaddr)	pfn_to_page(__pa(kaddr)>>PAGE_SHIFT)
 
 #define pfn_valid(pfn)		(((pfn)-(pfn_base)) < max_mapnr)
@@ -130,8 +129,6 @@ typedef unsigned long iopgprot_t;
 #define virt_to_phys __pa
 #define phys_to_virt __va
 
-#ifndef __ASSEMBLY__
-
 /* The following structure is used to hold the physical
  * memory configuration of the machine.  This is filled in
  * probe_memory() and is later used by mem_init() to set up
diff --git a/include/asm-sparc64/pgalloc.h b/include/asm-sparc64/pgalloc.h
index 8354a057b..fa5c704de 100644
--- a/include/asm-sparc64/pgalloc.h
+++ b/include/asm-sparc64/pgalloc.h
@@ -188,15 +188,30 @@ static __inline__ void free_pmd_slow(pmd_t *pmd)
 #define pmd_populate(MM,PMD,PTE_PAGE)		\
 	pmd_populate_kernel(MM,PMD,page_address(PTE_PAGE))
 
-extern pte_t *pte_alloc_one_kernel(struct mm_struct *mm, unsigned long address);
+extern pte_t *__pte_alloc_one_kernel(struct mm_struct *mm, unsigned long address);
+
+static inline pte_t *pte_alloc_one_kernel(struct mm_struct *mm, unsigned long address)
+{
+	pte_t *pte = __pte_alloc_one_kernel(mm, address);
+	if (pte) {
+		struct page *page = virt_to_page(pte);
+		page->mapping = (void *) mm;
+		page->index = address & PMD_MASK;
+	}
+	return pte;
+}
 
 static inline struct page *
 pte_alloc_one(struct mm_struct *mm, unsigned long addr)
 {
-	pte_t *pte = pte_alloc_one_kernel(mm, addr);
-	if (pte)
-		return virt_to_page(pte);
-	return 0;
+	pte_t *pte = __pte_alloc_one_kernel(mm, addr);
+	if (pte) {
+		struct page *page = virt_to_page(pte);
+		page->mapping = (void *) mm;
+		page->index = addr & PMD_MASK;
+		return page;
+	}
+	return NULL;
 }
 
 static __inline__ pte_t *pte_alloc_one_fast(struct mm_struct *mm, unsigned long address)
@@ -230,8 +245,18 @@ static __inline__ void free_pte_slow(pte_t *pte)
 	free_page((unsigned long)pte);
 }
 
-#define pte_free_kernel(pte)	free_pte_fast(pte)
-#define pte_free(pte)		free_pte_fast(page_address(pte))
+static inline void pte_free_kernel(pte_t *pte)
+{
+	virt_to_page(pte)->mapping = NULL;
+	free_pte_fast(pte);
+}
+
+static inline void pte_free(struct page *ptepage)
+{
+	ptepage->mapping = NULL;
+	free_pte_fast(page_address(ptepage));
+}
+
 #define pmd_free(pmd)		free_pmd_fast(pmd)
 #define pgd_free(pgd)		free_pgd_fast(pgd)
 #define pgd_alloc(mm)		get_pgd_fast()
diff --git a/include/asm-sparc64/pgtable.h b/include/asm-sparc64/pgtable.h
index 44b67330f..cb0b46923 100644
--- a/include/asm-sparc64/pgtable.h
+++ b/include/asm-sparc64/pgtable.h
@@ -67,12 +67,6 @@
 
 #include <linux/sched.h>
 
-/* Certain architectures need to do special things when pte's
- * within a page table are directly modified.  Thus, the following
- * hook is made available.
- */
-#define set_pte(pteptr, pteval) ((*(pteptr)) = (pteval))
-
 /* Entries per page directory level. */
 #define PTRS_PER_PTE		(1UL << (PAGE_SHIFT-3))
 
@@ -80,9 +74,12 @@
  * is different so we can optimize correctly for 32-bit tasks.
  */
 #define REAL_PTRS_PER_PMD	(1UL << PMD_BITS)
-#define PTRS_PER_PMD		((const int)(test_thread_flag(TIF_32BIT) ? \
-				 (1UL << (32 - (PAGE_SHIFT-3) - PAGE_SHIFT)) : \
-				 (REAL_PTRS_PER_PMD)))
+
+/* This is gross, but unless we do this gcc retests the
+ * thread flag every interation in pmd traversal loops.
+ */
+extern unsigned long __ptrs_per_pmd(void) __attribute_const__;
+#define PTRS_PER_PMD		__ptrs_per_pmd()
 
 /*
  * We cannot use the top address range because VPTE table lives there. This
@@ -106,33 +103,49 @@
 #endif /* !(__ASSEMBLY__) */
 
 /* Spitfire/Cheetah TTE bits. */
-#define _PAGE_VALID	_AC(0x8000000000000000,UL) /* Valid TTE               */
-#define _PAGE_R		_AC(0x8000000000000000,UL) /* Keep ref bit up to date */
-#define _PAGE_SZ4MB	_AC(0x6000000000000000,UL) /* 4MB Page                */
-#define _PAGE_SZ512K	_AC(0x4000000000000000,UL) /* 512K Page               */
-#define _PAGE_SZ64K	_AC(0x2000000000000000,UL) /* 64K Page                */
-#define _PAGE_SZ8K	_AC(0x0000000000000000,UL) /* 8K Page                 */
-#define _PAGE_NFO	_AC(0x1000000000000000,UL) /* No Fault Only           */
-#define _PAGE_IE	_AC(0x0800000000000000,UL) /* Invert Endianness       */
-#define _PAGE_SN	_AC(0x0000800000000000,UL) /* (Cheetah) Snoop         */
-#define _PAGE_PADDR_SF	_AC(0x000001FFFFFFE000,UL) /* (Spitfire) paddr [40:13]*/
-#define _PAGE_PADDR	_AC(0x000007FFFFFFE000,UL) /* (Cheetah) paddr [42:13] */
-#define _PAGE_SOFT	_AC(0x0000000000001F80,UL) /* Software bits           */
-#define _PAGE_L		_AC(0x0000000000000040,UL) /* Locked TTE              */
-#define _PAGE_CP	_AC(0x0000000000000020,UL) /* Cacheable in P-Cache    */
-#define _PAGE_CV	_AC(0x0000000000000010,UL) /* Cacheable in V-Cache    */
-#define _PAGE_E		_AC(0x0000000000000008,UL) /* side-Effect             */
-#define _PAGE_P		_AC(0x0000000000000004,UL) /* Privileged Page         */
-#define _PAGE_W		_AC(0x0000000000000002,UL) /* Writable                */
-#define _PAGE_G		_AC(0x0000000000000001,UL) /* Global                  */
-
-/* Here are the SpitFire software bits we use in the TTE's. */
-#define _PAGE_FILE	_AC(0x0000000000001000,UL)	/* Pagecache page     */
-#define _PAGE_MODIFIED	_AC(0x0000000000000800,UL)	/* Modified (dirty)   */
-#define _PAGE_ACCESSED	_AC(0x0000000000000400,UL)	/* Accessed (ref'd)   */
-#define _PAGE_READ	_AC(0x0000000000000200,UL)	/* Readable SW Bit    */
-#define _PAGE_WRITE	_AC(0x0000000000000100,UL)	/* Writable SW Bit    */
-#define _PAGE_PRESENT	_AC(0x0000000000000080,UL)	/* Present            */
+#define _PAGE_VALID	_AC(0x8000000000000000,UL) /* Valid TTE              */
+#define _PAGE_R		_AC(0x8000000000000000,UL) /* Keep ref bit up to date*/
+#define _PAGE_SZ4MB	_AC(0x6000000000000000,UL) /* 4MB Page               */
+#define _PAGE_SZ512K	_AC(0x4000000000000000,UL) /* 512K Page              */
+#define _PAGE_SZ64K	_AC(0x2000000000000000,UL) /* 64K Page               */
+#define _PAGE_SZ8K	_AC(0x0000000000000000,UL) /* 8K Page                */
+#define _PAGE_NFO	_AC(0x1000000000000000,UL) /* No Fault Only          */
+#define _PAGE_IE	_AC(0x0800000000000000,UL) /* Invert Endianness      */
+#define _PAGE_SOFT2	_AC(0x07FC000000000000,UL) /* Software bits, set 2   */
+#define _PAGE_RES1	_AC(0x0003000000000000,UL) /* Reserved               */
+#define _PAGE_SN	_AC(0x0000800000000000,UL) /* (Cheetah) Snoop        */
+#define _PAGE_RES2	_AC(0x0000780000000000,UL) /* Reserved               */
+#define _PAGE_PADDR_SF	_AC(0x000001FFFFFFE000,UL) /* (Spitfire) paddr[40:13]*/
+#define _PAGE_PADDR	_AC(0x000007FFFFFFE000,UL) /* (Cheetah) paddr[42:13] */
+#define _PAGE_SOFT	_AC(0x0000000000001F80,UL) /* Software bits          */
+#define _PAGE_L		_AC(0x0000000000000040,UL) /* Locked TTE             */
+#define _PAGE_CP	_AC(0x0000000000000020,UL) /* Cacheable in P-Cache   */
+#define _PAGE_CV	_AC(0x0000000000000010,UL) /* Cacheable in V-Cache   */
+#define _PAGE_E		_AC(0x0000000000000008,UL) /* side-Effect            */
+#define _PAGE_P		_AC(0x0000000000000004,UL) /* Privileged Page        */
+#define _PAGE_W		_AC(0x0000000000000002,UL) /* Writable               */
+#define _PAGE_G		_AC(0x0000000000000001,UL) /* Global                 */
+
+/* Here are the SpitFire software bits we use in the TTE's.
+ *
+ * WARNING: If you are going to try and start using some
+ *          of the soft2 bits, you will need to make
+ *          modifications to the swap entry implementation.
+ *	    For example, one thing that could happen is that
+ *          swp_entry_to_pte() would BUG_ON() if you tried
+ *          to use one of the soft2 bits for _PAGE_FILE.
+ *
+ * Like other architectures, I have aliased _PAGE_FILE with
+ * _PAGE_MODIFIED.  This works because _PAGE_FILE is never
+ * interpreted that way unless _PAGE_PRESENT is clear.
+ */
+#define _PAGE_EXEC	_AC(0x0000000000001000,UL)	/* Executable SW bit */
+#define _PAGE_MODIFIED	_AC(0x0000000000000800,UL)	/* Modified (dirty)  */
+#define _PAGE_FILE	_AC(0x0000000000000800,UL)	/* Pagecache page    */
+#define _PAGE_ACCESSED	_AC(0x0000000000000400,UL)	/* Accessed (ref'd)  */
+#define _PAGE_READ	_AC(0x0000000000000200,UL)	/* Readable SW Bit   */
+#define _PAGE_WRITE	_AC(0x0000000000000100,UL)	/* Writable SW Bit   */
+#define _PAGE_PRESENT	_AC(0x0000000000000080,UL)	/* Present           */
 
 #if PAGE_SHIFT == 13
 #define _PAGE_SZBITS	_PAGE_SZ8K
@@ -164,16 +177,27 @@
 
 /* Don't set the TTE _PAGE_W bit here, else the dirty bit never gets set. */
 #define PAGE_SHARED	__pgprot (_PAGE_PRESENT | _PAGE_VALID | _PAGE_CACHE | \
-				  __ACCESS_BITS | _PAGE_WRITE)
+				  __ACCESS_BITS | _PAGE_WRITE | _PAGE_EXEC)
 
 #define PAGE_COPY	__pgprot (_PAGE_PRESENT | _PAGE_VALID | _PAGE_CACHE | \
-				  __ACCESS_BITS)
+				  __ACCESS_BITS | _PAGE_EXEC)
 
 #define PAGE_READONLY	__pgprot (_PAGE_PRESENT | _PAGE_VALID | _PAGE_CACHE | \
-				  __ACCESS_BITS)
+				  __ACCESS_BITS | _PAGE_EXEC)
 
 #define PAGE_KERNEL	__pgprot (_PAGE_PRESENT | _PAGE_VALID | _PAGE_CACHE | \
-				  __PRIV_BITS | __ACCESS_BITS | __DIRTY_BITS)
+				  __PRIV_BITS | \
+				  __ACCESS_BITS | __DIRTY_BITS | _PAGE_EXEC)
+
+#define PAGE_SHARED_NOEXEC	__pgprot (_PAGE_PRESENT | _PAGE_VALID | \
+					  _PAGE_CACHE | \
+					  __ACCESS_BITS | _PAGE_WRITE)
+
+#define PAGE_COPY_NOEXEC	__pgprot (_PAGE_PRESENT | _PAGE_VALID | \
+					  _PAGE_CACHE | __ACCESS_BITS)
+
+#define PAGE_READONLY_NOEXEC	__pgprot (_PAGE_PRESENT | _PAGE_VALID | \
+					  _PAGE_CACHE | __ACCESS_BITS)
 
 #define _PFN_MASK	_PAGE_PADDR
 
@@ -181,18 +205,18 @@
 		   __ACCESS_BITS | _PAGE_E)
 
 #define __P000	PAGE_NONE
-#define __P001	PAGE_READONLY
-#define __P010	PAGE_COPY
-#define __P011	PAGE_COPY
+#define __P001	PAGE_READONLY_NOEXEC
+#define __P010	PAGE_COPY_NOEXEC
+#define __P011	PAGE_COPY_NOEXEC
 #define __P100	PAGE_READONLY
 #define __P101	PAGE_READONLY
 #define __P110	PAGE_COPY
 #define __P111	PAGE_COPY
 
 #define __S000	PAGE_NONE
-#define __S001	PAGE_READONLY
-#define __S010	PAGE_SHARED
-#define __S011	PAGE_SHARED
+#define __S001	PAGE_READONLY_NOEXEC
+#define __S010	PAGE_SHARED_NOEXEC
+#define __S011	PAGE_SHARED_NOEXEC
 #define __S100	PAGE_READONLY
 #define __S101	PAGE_READONLY
 #define __S110	PAGE_SHARED
@@ -246,7 +270,6 @@ static inline pte_t pte_modify(pte_t orig_pte, pgprot_t new_prot)
 	((unsigned long) __va((((unsigned long)pgd_val(pgd))<<11UL)))
 #define pte_none(pte) 			(!pte_val(pte))
 #define pte_present(pte)		(pte_val(pte) & _PAGE_PRESENT)
-#define pte_clear(pte)			(pte_val(*(pte)) = 0UL)
 #define pmd_none(pmd)			(!pmd_val(pmd))
 #define pmd_bad(pmd)			(0)
 #define pmd_present(pmd)		(pmd_val(pmd) != 0U)
@@ -260,7 +283,7 @@ static inline pte_t pte_modify(pte_t orig_pte, pgprot_t new_prot)
  * Undefined behaviour if not..
  */
 #define pte_read(pte)		(pte_val(pte) & _PAGE_READ)
-#define pte_exec(pte)		pte_read(pte)
+#define pte_exec(pte)		(pte_val(pte) & _PAGE_EXEC)
 #define pte_write(pte)		(pte_val(pte) & _PAGE_WRITE)
 #define pte_dirty(pte)		(pte_val(pte) & _PAGE_MODIFIED)
 #define pte_young(pte)		(pte_val(pte) & _PAGE_ACCESSED)
@@ -302,6 +325,20 @@ static inline pte_t pte_modify(pte_t orig_pte, pgprot_t new_prot)
 #define pte_unmap(pte)			do { } while (0)
 #define pte_unmap_nested(pte)		do { } while (0)
 
+/* Actual page table PTE updates.  */
+extern void tlb_batch_add(pte_t *ptep, pte_t orig);
+
+static inline void set_pte(pte_t *ptep, pte_t pte)
+{
+	pte_t orig = *ptep;
+
+	*ptep = pte;
+	if (pte_present(orig))
+		tlb_batch_add(ptep, orig);
+}
+
+#define pte_clear(ptep)		set_pte((ptep), __pte(0UL))
+
 extern pgd_t swapper_pg_dir[1];
 
 /* These do nothing with the way I have things setup. */
@@ -351,7 +388,7 @@ sun4u_get_pte (unsigned long addr)
 	if (addr >= PAGE_OFFSET)
 		return addr & _PAGE_PADDR;
 	if ((addr >= LOW_OBP_ADDRESS) && (addr < HI_OBP_ADDRESS))
-		return prom_virt_to_phys(addr, 0);
+		return prom_virt_to_phys(addr, NULL);
 	pgdp = pgd_offset_k(addr);
 	pmdp = pmd_offset(pgdp, addr);
 	ptep = pte_offset_kernel(pmdp, addr);
diff --git a/include/asm-sparc64/resource.h b/include/asm-sparc64/resource.h
index 06150c09f..4a77dd620 100644
--- a/include/asm-sparc64/resource.h
+++ b/include/asm-sparc64/resource.h
@@ -19,11 +19,13 @@
 #define RLIMIT_RSS	5		/* max resident set size */
 #define RLIMIT_NOFILE	6		/* max number of open files */
 #define RLIMIT_NPROC	7		/* max number of processes */
-#define RLIMIT_MEMLOCK  8               /* max locked-in-memory address space */
-#define RLIMIT_AS       9               /* address space limit */
+#define RLIMIT_MEMLOCK	8		/* max locked-in-memory address space */
+#define RLIMIT_AS	9		/* address space limit */
 #define RLIMIT_LOCKS	10		/* maximum file locks held */
+#define RLIMIT_SIGPENDING 11		/* max number of pending signals */
+#define RLIMIT_MSGQUEUE 12		/* maximum bytes in POSIX mqueues */
 
-#define RLIM_NLIMITS	11
+#define RLIM_NLIMITS	13
 
 /*
  * SuS says limits have to be unsigned.
@@ -43,7 +45,9 @@
     {INR_OPEN, INR_OPEN}, {0, 0},	\
     {RLIM_INFINITY, RLIM_INFINITY},	\
     {RLIM_INFINITY, RLIM_INFINITY},	\
-    {RLIM_INFINITY, RLIM_INFINITY}	\
+    {RLIM_INFINITY, RLIM_INFINITY},	\
+    {MAX_SIGPENDING, MAX_SIGPENDING},	\
+    {MQ_BYTES_MAX, MQ_BYTES_MAX},	\
 }
 
 #endif /* __KERNEL__ */
diff --git a/include/asm-sparc64/setup.h b/include/asm-sparc64/setup.h
index 97ae5d456..b356ee2cd 100644
--- a/include/asm-sparc64/setup.h
+++ b/include/asm-sparc64/setup.h
@@ -5,5 +5,6 @@
 #ifndef _SPARC64_SETUP_H
 #define _SPARC64_SETUP_H
 
+#define COMMAND_LINE_SIZE	256
 
 #endif /* _SPARC64_SETUP_H */
diff --git a/include/asm-sparc64/siginfo.h b/include/asm-sparc64/siginfo.h
index 7e5459fa4..fde85211a 100644
--- a/include/asm-sparc64/siginfo.h
+++ b/include/asm-sparc64/siginfo.h
@@ -14,8 +14,11 @@
 
 #ifdef __KERNEL__
 
+#include <linux/config.h>
 #include <linux/compat.h>
 
+#ifdef CONFIG_COMPAT
+
 typedef union sigval32 {
 	int sival_int;
 	u32 sival_ptr;
@@ -72,6 +75,7 @@ typedef struct siginfo32 {
 		} _sigpoll;
 	} _sifields;
 } siginfo_t32;
+#endif /* CONFIG_COMPAT */
 
 #endif /* __KERNEL__ */
 
@@ -85,6 +89,8 @@ typedef struct siginfo32 {
 
 #ifdef __KERNEL__
 
+#ifdef CONFIG_COMPAT
+
 typedef struct sigevent32 {
 	sigval_t32 sigev_value;
 	int sigev_signo;
@@ -101,6 +107,8 @@ typedef struct sigevent32 {
 
 extern int copy_siginfo_to_user32(siginfo_t32 __user *to, siginfo_t *from);
 
+#endif /* CONFIG_COMPAT */
+
 #endif /* __KERNEL__ */
 
 #endif
diff --git a/include/asm-sparc64/signal.h b/include/asm-sparc64/signal.h
index 1673945ea..6428e366c 100644
--- a/include/asm-sparc64/signal.h
+++ b/include/asm-sparc64/signal.h
@@ -6,6 +6,7 @@
 
 #ifdef __KERNEL__
 #ifndef __ASSEMBLY__
+#include <linux/config.h>
 #include <linux/personality.h>
 #include <linux/types.h>
 #include <linux/compat.h>
@@ -186,9 +187,14 @@ struct sigstack {
 
 /* Type of a signal handler.  */
 #ifdef __KERNEL__
-typedef void (*__sighandler_t)(int, struct sigcontext *);
+typedef void __signalfn_t(int);
+typedef __signalfn_t __user *__sighandler_t;
+
+typedef void __restorefn_t(void);
+typedef __restorefn_t __user *__sigrestore_t;
 #else
 typedef void (*__sighandler_t)(int);
+typedef void (*__sigrestore_t)(void);
 #endif
 
 #define SIG_DFL	((__sighandler_t)0)	/* default signal handling */
@@ -198,17 +204,20 @@ typedef void (*__sighandler_t)(int);
 struct __new_sigaction {
 	__sighandler_t		sa_handler;
 	unsigned long		sa_flags;
-	void 			(*sa_restorer)(void);     /* not used by Linux/SPARC yet */
+	__sigrestore_t 		sa_restorer;  /* not used by Linux/SPARC yet */
 	__new_sigset_t		sa_mask;
 };
 
 #ifdef __KERNEL__
+
+#ifdef CONFIG_COMPAT
 struct __new_sigaction32 {
 	unsigned		sa_handler;
 	unsigned int    	sa_flags;
 	unsigned		sa_restorer;     /* not used by Linux/SPARC yet */
 	compat_sigset_t 	sa_mask;
 };
+#endif
 
 struct k_sigaction {
 	struct __new_sigaction 	sa;
@@ -224,6 +233,8 @@ struct __old_sigaction {
 };
 
 #ifdef __KERNEL__
+
+#ifdef CONFIG_COMPAT
 struct __old_sigaction32 {
 	unsigned		sa_handler;
 	compat_old_sigset_t  	sa_mask;
@@ -232,18 +243,23 @@ struct __old_sigaction32 {
 };
 #endif
 
+#endif
+
 typedef struct sigaltstack {
-	void			*ss_sp;
+	void			__user *ss_sp;
 	int			ss_flags;
 	size_t			ss_size;
 } stack_t;
 
 #ifdef __KERNEL__
+
+#ifdef CONFIG_COMPAT
 typedef struct sigaltstack32 {
 	u32			ss_sp;
 	int			ss_flags;
 	compat_size_t		ss_size;
 } stack_t32;
+#endif
 
 struct signal_deliver_cookie {
 	int restart_syscall;
diff --git a/include/asm-sparc64/spinlock.h b/include/asm-sparc64/spinlock.h
index 08a6e551c..a995805ba 100644
--- a/include/asm-sparc64/spinlock.h
+++ b/include/asm-sparc64/spinlock.h
@@ -41,22 +41,8 @@ typedef unsigned char spinlock_t;
 do {	membar("#LoadLoad");	\
 } while(*((volatile unsigned char *)lock))
 
-static __inline__ void _raw_spin_lock(spinlock_t *lock)
-{
-	__asm__ __volatile__(
-"1:	ldstub		[%0], %%g7\n"
-"	brnz,pn		%%g7, 2f\n"
-"	 membar		#StoreLoad | #StoreStore\n"
-"	.subsection	2\n"
-"2:	ldub		[%0], %%g7\n"
-"	brnz,pt		%%g7, 2b\n"
-"	 membar		#LoadLoad\n"
-"	b,a,pt		%%xcc, 1b\n"
-"	.previous\n"
-	: /* no outputs */
-	: "r" (lock)
-	: "g7", "memory");
-}
+/* arch/sparc64/lib/spinlock.S */
+extern void _raw_spin_lock(spinlock_t *lock);
 
 static __inline__ int _raw_spin_trylock(spinlock_t *lock)
 {
diff --git a/include/asm-sparc64/string.h b/include/asm-sparc64/string.h
index 88348de56..c1a4f1df8 100644
--- a/include/asm-sparc64/string.h
+++ b/include/asm-sparc64/string.h
@@ -16,9 +16,7 @@
 #include <asm/asi.h>
 
 extern void __memmove(void *,const void *,__kernel_size_t);
-extern __kernel_size_t __memcpy(void *,const void *,__kernel_size_t);
 extern void *__memset(void *,int,__kernel_size_t);
-extern void *__builtin_memcpy(void *,const void *,__kernel_size_t);
 extern void *__builtin_memset(void *,int,__kernel_size_t);
 
 #ifndef EXPORT_SYMTAB_STROPS
@@ -37,29 +35,7 @@ extern void *__builtin_memset(void *,int,__kernel_size_t);
 
 #define __HAVE_ARCH_MEMCPY
 
-static inline void *__constant_memcpy(void *to, const void *from, __kernel_size_t n)
-{
-	if(n) {
-		if(n <= 32) {
-			__builtin_memcpy(to, from, n);
-		} else {
-			__memcpy(to, from, n);
-		}
-	}
-	return to;
-}
-
-static inline void *__nonconstant_memcpy(void *to, const void *from, __kernel_size_t n)
-{
-	__memcpy(to, from, n);
-	return to;
-}
-
-#undef memcpy
-#define memcpy(t, f, n) \
-(__builtin_constant_p(n) ? \
- __constant_memcpy((t),(f),(n)) : \
- __nonconstant_memcpy((t),(f),(n)))
+extern void * memcpy(void *,const void *,__kernel_size_t);
 
 #define __HAVE_ARCH_MEMSET
 
diff --git a/include/asm-sparc64/system.h b/include/asm-sparc64/system.h
index ca08f8cad..d6d22f9c2 100644
--- a/include/asm-sparc64/system.h
+++ b/include/asm-sparc64/system.h
@@ -175,6 +175,7 @@ do {	if (test_thread_flag(TIF_PERFCTR)) {				\
 		current_thread_info()->kernel_cntd0 += (unsigned int)(__tmp);\
 		current_thread_info()->kernel_cntd1 += ((__tmp) >> 32);	\
 	}								\
+	flush_tlb_pending();						\
 	save_and_clear_fpu();						\
 	/* If you are tempted to conditionalize the following */	\
 	/* so that ASI is only written if it changes, think again. */	\
diff --git a/include/asm-sparc64/thread_info.h b/include/asm-sparc64/thread_info.h
index f989fbdc5..d1a536260 100644
--- a/include/asm-sparc64/thread_info.h
+++ b/include/asm-sparc64/thread_info.h
@@ -47,6 +47,7 @@ struct thread_info {
 	struct pt_regs		*kregs;
 	struct exec_domain	*exec_domain;
 	int			preempt_count;
+	int			__pad;
 
 	unsigned long		*utraps;
 
@@ -101,10 +102,11 @@ struct thread_info {
 #define TI_FPREGS	0x00000500
 
 /* We embed this in the uppermost byte of thread_info->flags */
-#define FAULT_CODE_WRITE	0x01	/* Write access, implies D-TLB		*/
-#define FAULT_CODE_DTLB		0x02	/* Miss happened in D-TLB		*/
-#define FAULT_CODE_ITLB		0x04	/* Miss happened in I-TLB		*/
-#define FAULT_CODE_WINFIXUP	0x08	/* Miss happened during spill/fill	*/
+#define FAULT_CODE_WRITE	0x01	/* Write access, implies D-TLB	   */
+#define FAULT_CODE_DTLB		0x02	/* Miss happened in D-TLB	   */
+#define FAULT_CODE_ITLB		0x04	/* Miss happened in I-TLB	   */
+#define FAULT_CODE_WINFIXUP	0x08	/* Miss happened during spill/fill */
+#define FAULT_CODE_BLKCOMMIT	0x10	/* Use blk-commit ASI in copy_page */
 
 #if PAGE_SHIFT == 13
 #define THREAD_SIZE (2*PAGE_SIZE)
@@ -218,10 +220,7 @@ register struct thread_info *current_thread_info_reg asm("g6");
 #define TIF_NEWSIGNALS		6	/* wants new-style signals */
 #define TIF_32BIT		7	/* 32-bit binary */
 #define TIF_NEWCHILD		8	/* just-spawned child process */
-
-/* XXX Make this one FAULT_CODE_BLKCOMMIT XXX */
-#define TIF_BLKCOMMIT		9	/* use ASI_BLK_COMMIT_* in copy_user_page */
-
+/* TIF_* value 9 is available */
 #define TIF_POLLING_NRFLAG	10
 #define TIF_SYSCALL_SUCCESS	11
 /* NOTE: Thread flags >= 12 should be ones we have no interest
@@ -239,7 +238,6 @@ register struct thread_info *current_thread_info_reg asm("g6");
 #define _TIF_NEWSIGNALS		(1<<TIF_NEWSIGNALS)
 #define _TIF_32BIT		(1<<TIF_32BIT)
 #define _TIF_NEWCHILD		(1<<TIF_NEWCHILD)
-#define _TIF_BLKCOMMIT		(1<<TIF_BLKCOMMIT)
 #define _TIF_POLLING_NRFLAG	(1<<TIF_POLLING_NRFLAG)
 #define _TIF_ABI_PENDING	(1<<TIF_ABI_PENDING)
 #define _TIF_SYSCALL_SUCCESS	(1<<TIF_SYSCALL_SUCCESS)
diff --git a/include/asm-sparc64/tlb.h b/include/asm-sparc64/tlb.h
index 8b507a36c..874a46373 100644
--- a/include/asm-sparc64/tlb.h
+++ b/include/asm-sparc64/tlb.h
@@ -1,27 +1,129 @@
 #ifndef _SPARC64_TLB_H
 #define _SPARC64_TLB_H
 
-#define tlb_flush(tlb)			\
-do {	if ((tlb)->fullmm)		\
-		flush_tlb_mm((tlb)->mm);\
-} while (0)
+#include <linux/config.h>
+#include <linux/swap.h>
+#include <asm/pgalloc.h>
+#include <asm/tlbflush.h>
+#include <asm/mmu_context.h>
 
-#define tlb_start_vma(tlb, vma) \
-do {	if (!(tlb)->fullmm)	\
-		flush_cache_range(vma, vma->vm_start, vma->vm_end); \
-} while (0)
+#define TLB_BATCH_NR	192
 
-#define tlb_end_vma(tlb, vma)	\
-do {	if (!(tlb)->fullmm)	\
-		flush_tlb_range(vma, vma->vm_start, vma->vm_end); \
-} while (0)
+/*
+ * For UP we don't need to worry about TLB flush
+ * and page free order so much..
+ */
+#ifdef CONFIG_SMP
+  #define FREE_PTE_NR	506
+  #define tlb_fast_mode(bp) ((bp)->pages_nr == ~0U)
+#else
+  #define FREE_PTE_NR	1
+  #define tlb_fast_mode(bp) 1
+#endif
 
-#define __tlb_remove_tlb_entry(tlb, ptep, address) \
-	do { } while (0)
+struct mmu_gather {
+	struct mm_struct *mm;
+	unsigned int pages_nr;
+	unsigned int need_flush;
+	unsigned int tlb_frozen;
+	unsigned int tlb_nr;
+	unsigned long freed;
+	unsigned long vaddrs[TLB_BATCH_NR];
+	struct page *pages[FREE_PTE_NR];
+};
 
-#include <asm-generic/tlb.h>
+DECLARE_PER_CPU(struct mmu_gather, mmu_gathers);
 
-#define __pmd_free_tlb(tlb, pmd)	pmd_free(pmd)
-#define __pte_free_tlb(tlb, pte)	pte_free(pte)
+#ifdef CONFIG_SMP
+extern void smp_flush_tlb_pending(struct mm_struct *,
+				  unsigned long, unsigned long *);
+#endif
+
+extern void __flush_tlb_pending(unsigned long, unsigned long, unsigned long *);
+extern void flush_tlb_pending(void);
+
+static inline struct mmu_gather *tlb_gather_mmu(struct mm_struct *mm, unsigned int full_mm_flush)
+{
+	struct mmu_gather *mp = &per_cpu(mmu_gathers, smp_processor_id());
+
+	BUG_ON(mp->tlb_nr);
+
+	mp->mm = mm;
+	mp->pages_nr = num_online_cpus() > 1 ? 0U : ~0U;
+	mp->tlb_frozen = full_mm_flush;
+	mp->freed = 0;
+
+	return mp;
+}
+
+
+static inline void tlb_flush_mmu(struct mmu_gather *mp)
+{
+	if (mp->need_flush) {
+		mp->need_flush = 0;
+		if (!tlb_fast_mode(mp)) {
+			free_pages_and_swap_cache(mp->pages, mp->pages_nr);
+			mp->pages_nr = 0;
+		}
+	}
+
+}
+
+#ifdef CONFIG_SMP
+extern void smp_flush_tlb_mm(struct mm_struct *mm);
+#define do_flush_tlb_mm(mm) smp_flush_tlb_mm(mm)
+#else
+#define do_flush_tlb_mm(mm) __flush_tlb_mm(CTX_HWBITS(mm->context), SECONDARY_CONTEXT)
+#endif
+
+static inline void tlb_finish_mmu(struct mmu_gather *mp, unsigned long start, unsigned long end)
+{
+	unsigned long freed = mp->freed;
+	struct mm_struct *mm = mp->mm;
+	unsigned long rss = mm->rss;
+
+	if (rss < freed)
+		freed = rss;
+	mm->rss = rss - freed;
+
+	tlb_flush_mmu(mp);
+
+	if (mp->tlb_frozen) {
+		unsigned long context = mm->context;
+
+		if (CTX_VALID(context))
+			do_flush_tlb_mm(mm);
+		mp->tlb_frozen = 0;
+	} else
+		flush_tlb_pending();
+
+	/* keep the page table cache within bounds */
+	check_pgt_cache();
+}
+
+static inline unsigned int tlb_is_full_mm(struct mmu_gather *mp)
+{
+	return mp->tlb_frozen;
+}
+
+static inline void tlb_remove_page(struct mmu_gather *mp, struct page *page)
+{
+	mp->need_flush = 1;
+	if (tlb_fast_mode(mp)) {
+		free_page_and_swap_cache(page);
+		return;
+	}
+	mp->pages[mp->pages_nr++] = page;
+	if (mp->pages_nr >= FREE_PTE_NR)
+		tlb_flush_mmu(mp);
+}
+
+#define tlb_remove_tlb_entry(mp,ptep,addr) do { } while (0)
+#define pte_free_tlb(mp,ptepage) pte_free(ptepage)
+#define pmd_free_tlb(mp,pmdp) pmd_free(pmdp)
+
+#define tlb_migrate_finish(mm)	do { } while (0)
+#define tlb_start_vma(tlb, vma) do { } while (0)
+#define tlb_end_vma(tlb, vma)	do { } while (0)
 
 #endif /* _SPARC64_TLB_H */
diff --git a/include/asm-sparc64/tlbflush.h b/include/asm-sparc64/tlbflush.h
index 8c70fdd03..3ef9909ac 100644
--- a/include/asm-sparc64/tlbflush.h
+++ b/include/asm-sparc64/tlbflush.h
@@ -7,11 +7,14 @@
 
 /* TLB flush operations. */
 
+extern void flush_tlb_pending(void);
+
+#define flush_tlb_range(vma,start,end)	\
+	do { (void)(start); flush_tlb_pending(); } while (0)
+#define flush_tlb_page(vma,addr)	flush_tlb_pending()
+#define flush_tlb_mm(mm)		flush_tlb_pending()
+
 extern void __flush_tlb_all(void);
-extern void __flush_tlb_mm(unsigned long context, unsigned long r);
-extern void __flush_tlb_range(unsigned long context, unsigned long start,
-			      unsigned long r, unsigned long end,
-			      unsigned long pgsz, unsigned long size);
 extern void __flush_tlb_page(unsigned long context, unsigned long page, unsigned long r);
 
 extern void __flush_tlb_kernel_range(unsigned long start, unsigned long end);
@@ -22,89 +25,17 @@ extern void __flush_tlb_kernel_range(unsigned long start, unsigned long end);
 #define flush_tlb_kernel_range(start,end) \
 	__flush_tlb_kernel_range(start,end)
 
-#define flush_tlb_mm(__mm) \
-do { if (CTX_VALID((__mm)->context)) \
-	__flush_tlb_mm(CTX_HWBITS((__mm)->context), SECONDARY_CONTEXT); \
-} while (0)
-
-#define flush_tlb_range(__vma, start, end) \
-do { if (CTX_VALID((__vma)->vm_mm->context)) { \
-	unsigned long __start = (start)&PAGE_MASK; \
-	unsigned long __end = PAGE_ALIGN(end); \
-	__flush_tlb_range(CTX_HWBITS((__vma)->vm_mm->context), __start, \
-			  SECONDARY_CONTEXT, __end, PAGE_SIZE, \
-			  (__end - __start)); \
-     } \
-} while (0)
-
-#define flush_tlb_vpte_range(__mm, start, end) \
-do { if (CTX_VALID((__mm)->context)) { \
-	unsigned long __start = (start)&PAGE_MASK; \
-	unsigned long __end = PAGE_ALIGN(end); \
-	__flush_tlb_range(CTX_HWBITS((__mm)->context), __start, \
-			  SECONDARY_CONTEXT, __end, PAGE_SIZE, \
-			  (__end - __start)); \
-     } \
-} while (0)
-
-#define flush_tlb_page(vma, page) \
-do { struct mm_struct *__mm = (vma)->vm_mm; \
-     if (CTX_VALID(__mm->context)) \
-	__flush_tlb_page(CTX_HWBITS(__mm->context), (page)&PAGE_MASK, \
-			 SECONDARY_CONTEXT); \
-} while (0)
-
-#define flush_tlb_vpte_page(mm, addr) \
-do { struct mm_struct *__mm = (mm); \
-     if (CTX_VALID(__mm->context)) \
-	__flush_tlb_page(CTX_HWBITS(__mm->context), (addr)&PAGE_MASK, \
-			 SECONDARY_CONTEXT); \
-} while (0)
-
 #else /* CONFIG_SMP */
 
 extern void smp_flush_tlb_all(void);
-extern void smp_flush_tlb_mm(struct mm_struct *mm);
-extern void smp_flush_tlb_range(struct mm_struct *mm, unsigned long start,
-				unsigned long end);
 extern void smp_flush_tlb_kernel_range(unsigned long start, unsigned long end);
-extern void smp_flush_tlb_page(struct mm_struct *mm, unsigned long page);
 
 #define flush_tlb_all()		smp_flush_tlb_all()
-#define flush_tlb_mm(mm)	smp_flush_tlb_mm(mm)
-#define flush_tlb_range(vma, start, end) \
-	smp_flush_tlb_range((vma)->vm_mm, start, end)
-#define flush_tlb_vpte_range(mm, start, end) \
-	smp_flush_tlb_range(mm, start, end)
 #define flush_tlb_kernel_range(start, end) \
 	smp_flush_tlb_kernel_range(start, end)
-#define flush_tlb_page(vma, page) \
-	smp_flush_tlb_page((vma)->vm_mm, page)
-#define flush_tlb_vpte_page(mm, page) \
-	smp_flush_tlb_page((mm), page)
 
 #endif /* ! CONFIG_SMP */
 
-static __inline__ void flush_tlb_pgtables(struct mm_struct *mm, unsigned long start,
-					  unsigned long end)
-{
-	/* Note the signed type.  */
-	long s = start, e = end, vpte_base;
-		/* Nobody should call us with start below VM hole and end above.
-		   See if it is really true.  */
-	BUG_ON(s > e);
-#if 0
-	/* Currently free_pgtables guarantees this.  */
-	s &= PMD_MASK;
-	e = (e + PMD_SIZE - 1) & PMD_MASK;
-#endif
-	vpte_base = (tlb_type == spitfire ?
-		     VPTE_BASE_SPITFIRE :
-		     VPTE_BASE_CHEETAH);
-
-	flush_tlb_vpte_range(mm,
-			     vpte_base + (s >> (PAGE_SHIFT - 3)),
-			     vpte_base + (e >> (PAGE_SHIFT - 3)));
-}
+extern void flush_tlb_pgtables(struct mm_struct *, unsigned long, unsigned long);
 
 #endif /* _SPARC64_TLBFLUSH_H */
diff --git a/include/asm-sparc64/ttable.h b/include/asm-sparc64/ttable.h
index 677134344..2b454ef67 100644
--- a/include/asm-sparc64/ttable.h
+++ b/include/asm-sparc64/ttable.h
@@ -123,7 +123,11 @@
 #else
 #define SUNOS_SYSCALL_TRAP TRAP(sunos_syscall)
 #endif
+#ifdef CONFIG_COMPAT
 #define	LINUX_32BIT_SYSCALL_TRAP SYSCALL_TRAP(linux_sparc_syscall32, sys_call_table32)
+#else
+#define	LINUX_32BIT_SYSCALL_TRAP BTRAP(0x110)
+#endif
 #define LINUX_64BIT_SYSCALL_TRAP SYSCALL_TRAP(linux_sparc_syscall, sys_call_table64)
 #define GETCC_TRAP TRAP(getcc)
 #define SETCC_TRAP TRAP(setcc)
diff --git a/include/asm-v850/bitops.h b/include/asm-v850/bitops.h
index c837ea08c..7c4ecaf51 100644
--- a/include/asm-v850/bitops.h
+++ b/include/asm-v850/bitops.h
@@ -127,20 +127,20 @@ extern __inline__ unsigned long ffz (unsigned long word)
 #define test_and_change_bit(nr, addr)	__tns_atomic_bit_op ("not1", nr, addr)
 
 
-#define __const_test_bit(nr, addr)					\
-  ({ int __test_bit_res;						\
-     __asm__ ("tst1 (%1 - 0x123), %2; setf nz, %0"			\
-	      : "=r" (__test_bit_res)					\
-	      : "g" (((nr) & 0x7) + 0x123),				\
-                "m" (*((const char *)(addr) + ((nr) >> 3))));		\
-     __test_bit_res;							\
+#define __const_test_bit(nr, addr)					      \
+  ({ int __test_bit_res;						      \
+     __asm__ __volatile__ ("tst1 (%1 - 0x123), %2; setf nz, %0"		      \
+			   : "=r" (__test_bit_res)			      \
+			   : "g" (((nr) & 0x7) + 0x123),		      \
+			     "m" (*((const char *)(addr) + ((nr) >> 3))));    \
+     __test_bit_res;							      \
   })
 extern __inline__ int __test_bit (int nr, const void *addr)
 {
 	int res;
-	__asm__ ("tst1 %1, [%2]; setf nz, %0"
-		 : "=r" (res)
-		 : "r" (nr & 0x7), "r" (addr + (nr >> 3)));
+	__asm__ __volatile__ ("tst1 %1, [%2]; setf nz, %0"
+			      : "=r" (res)
+			      : "r" (nr & 0x7), "r" (addr + (nr >> 3)));
 	return res;
 }
 #define test_bit(nr,addr)						\
@@ -193,10 +193,92 @@ extern __inline__ int find_next_zero_bit (void *addr, int size, int offset)
 	return result + ffz (tmp);
 }
 
+
+/* This is the same as generic_ffs, but we can't use that because it's
+   inline and the #include order mucks things up.  */
+static inline int generic_ffs_for_find_next_bit(int x)
+{
+	int r = 1;
+
+	if (!x)
+		return 0;
+	if (!(x & 0xffff)) {
+		x >>= 16;
+		r += 16;
+	}
+	if (!(x & 0xff)) {
+		x >>= 8;
+		r += 8;
+	}
+	if (!(x & 0xf)) {
+		x >>= 4;
+		r += 4;
+	}
+	if (!(x & 3)) {
+		x >>= 2;
+		r += 2;
+	}
+	if (!(x & 1)) {
+		x >>= 1;
+		r += 1;
+	}
+	return r;
+}
+
+/*
+ * Find next one bit in a bitmap reasonably efficiently.
+ */
+static __inline__ unsigned long find_next_bit(const unsigned long *addr,
+	unsigned long size, unsigned long offset)
+{
+	unsigned int *p = ((unsigned int *) addr) + (offset >> 5);
+	unsigned int result = offset & ~31UL;
+	unsigned int tmp;
+
+	if (offset >= size)
+		return size;
+	size -= result;
+	offset &= 31UL;
+	if (offset) {
+		tmp = *p++;
+		tmp &= ~0UL << offset;
+		if (size < 32)
+			goto found_first;
+		if (tmp)
+			goto found_middle;
+		size -= 32;
+		result += 32;
+	}
+	while (size >= 32) {
+		if ((tmp = *p++) != 0)
+			goto found_middle;
+		result += 32;
+		size -= 32;
+	}
+	if (!size)
+		return result;
+	tmp = *p;
+
+found_first:
+	tmp &= ~0UL >> (32 - size);
+	if (tmp == 0UL)        /* Are any bits set? */
+		return result + size; /* Nope. */
+found_middle:
+	return result + generic_ffs_for_find_next_bit(tmp);
+}
+
+/*
+ * find_first_bit - find the first set bit in a memory region
+ */
+#define find_first_bit(addr, size) \
+	find_next_bit((addr), (size), 0)
+
+
 #define ffs(x) generic_ffs (x)
 #define fls(x) generic_fls (x)
 #define __ffs(x) ffs(x)
 
+
 /*
  * This is just `generic_ffs' from <linux/bitops.h>, except that it assumes
  * that at least one bit is set, and returns the real index of the bit
diff --git a/include/asm-v850/fcntl.h b/include/asm-v850/fcntl.h
index 42e358ff0..31d4b5961 100644
--- a/include/asm-v850/fcntl.h
+++ b/include/asm-v850/fcntl.h
@@ -20,6 +20,7 @@
 #define O_NOFOLLOW     0100000	/* don't follow links */
 #define O_DIRECT       0200000	/* direct disk access hint - currently ignored */
 #define O_LARGEFILE    0400000
+#define O_NOATIME	01000000
 
 #define F_DUPFD		0	/* dup */
 #define F_GETFD		1	/* get close_on_exec */
diff --git a/include/asm-v850/irq.h b/include/asm-v850/irq.h
index 90c83aa05..44431152b 100644
--- a/include/asm-v850/irq.h
+++ b/include/asm-v850/irq.h
@@ -1,8 +1,8 @@
 /*
  * include/asm-v850/irq.h -- Machine interrupt handling
  *
- *  Copyright (C) 2001,02  NEC Corporation
- *  Copyright (C) 2001,02  Miles Bader <miles@gnu.org>
+ *  Copyright (C) 2001,02,04  NEC Electronics Corporation
+ *  Copyright (C) 2001,02,04  Miles Bader <miles@gnu.org>
  *
  * 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
@@ -62,11 +62,8 @@ extern void disable_irq (unsigned int irq);
 /* Disable an irq without waiting. */
 extern void disable_irq_nosync (unsigned int irq);
 
+extern int handle_IRQ_event(unsigned int, struct pt_regs *, struct irqaction *);
 
 #endif /* !__ASSEMBLY__ */
 
-struct irqaction;
-struct pt_regs;
-int handle_IRQ_event(unsigned int, struct pt_regs *, struct irqaction *);
-
 #endif /* __V850_IRQ_H__ */
diff --git a/include/asm-v850/resource.h b/include/asm-v850/resource.h
index 6f59c85fe..9f4ca4ae6 100644
--- a/include/asm-v850/resource.h
+++ b/include/asm-v850/resource.h
@@ -16,8 +16,10 @@
 #define RLIMIT_MEMLOCK	8		/* max locked-in-memory address space */
 #define RLIMIT_AS	9		/* address space limit */
 #define RLIMIT_LOCKS	10		/* maximum file locks held */
+#define RLIMIT_SIGPENDING 11		/* max number of pending signals */
+#define RLIMIT_MSGQUEUE 12		/* maximum bytes in POSIX mqueues */
 
-#define RLIM_NLIMITS	11
+#define RLIM_NLIMITS	13
 
 /*
  * SuS says limits have to be unsigned.
@@ -39,7 +41,9 @@
 	{      INR_OPEN,     INR_OPEN  },		\
 	{ RLIM_INFINITY, RLIM_INFINITY },		\
 	{ RLIM_INFINITY, RLIM_INFINITY },		\
-        { RLIM_INFINITY, RLIM_INFINITY },		\
+	{ RLIM_INFINITY, RLIM_INFINITY },		\
+	{ MAX_SIGPENDING, MAX_SIGPENDING },		\
+	{ MQ_BYTES_MAX, MQ_BYTES_MAX },			\
 }
 
 #endif /* __KERNEL__ */
diff --git a/include/asm-v850/unistd.h b/include/asm-v850/unistd.h
index f8163e806..9517031d8 100644
--- a/include/asm-v850/unistd.h
+++ b/include/asm-v850/unistd.h
@@ -1,8 +1,8 @@
 /*
  * include/asm-v850/unistd.h -- System call numbers and invocation mechanism
  *
- *  Copyright (C) 2001,02,03  NEC Electronics Corporation
- *  Copyright (C) 2001,02,03  Miles Bader <miles@gnu.org>
+ *  Copyright (C) 2001,02,03,04  NEC Electronics Corporation
+ *  Copyright (C) 2001,02,03,04  Miles Bader <miles@gnu.org>
  *
  * 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
@@ -389,7 +389,6 @@ type name (atype a, btype b, ctype c, dtype d, etype e, ftype f)	      \
 #ifdef __KERNEL__
 #define __ARCH_WANT_IPC_PARSE_VERSION
 #define __ARCH_WANT_OLD_READDIR
-#define __ARCH_WANT_OLD_STAT
 #define __ARCH_WANT_STAT64
 #define __ARCH_WANT_SYS_ALARM
 #define __ARCH_WANT_SYS_GETHOSTNAME
@@ -404,7 +403,6 @@ type name (atype a, btype b, ctype c, dtype d, etype e, ftype f)	      \
 #define __ARCH_WANT_SYS_GETPGRP
 #define __ARCH_WANT_SYS_LLSEEK
 #define __ARCH_WANT_SYS_NICE
-#define __ARCH_WANT_SYS_OLD_GETRLIMIT
 #define __ARCH_WANT_SYS_OLDUMOUNT
 #define __ARCH_WANT_SYS_SIGPENDING
 #define __ARCH_WANT_SYS_SIGPROCMASK
diff --git a/include/asm-x86_64/acpi.h b/include/asm-x86_64/acpi.h
index b768ed272..22a130b59 100644
--- a/include/asm-x86_64/acpi.h
+++ b/include/asm-x86_64/acpi.h
@@ -159,10 +159,6 @@ extern void acpi_reserve_bootmem(void);
 extern int acpi_disabled;
 extern int acpi_pci_disabled;
 
-#define dmi_broken (0)
-#define BROKEN_ACPI_Sx		0x0001
-#define BROKEN_INIT_AFTER_S1	0x0002
-
 #endif /*__KERNEL__*/
 
 #endif /*_ASM_ACPI_H*/
diff --git a/include/asm-x86_64/bootsetup.h b/include/asm-x86_64/bootsetup.h
index ee1557748..c7e76baaa 100644
--- a/include/asm-x86_64/bootsetup.h
+++ b/include/asm-x86_64/bootsetup.h
@@ -26,11 +26,11 @@ extern char x86_boot_params[2048];
 #define INITRD_START (*(unsigned int *) (PARAM+0x218))
 #define INITRD_SIZE (*(unsigned int *) (PARAM+0x21c))
 #define EDID_INFO (*(struct edid_info *) (PARAM+0x440))
-#define DISK80_SIGNATURE (*(unsigned int*) (PARAM+DISK80_SIG_BUFFER))
 #define EDD_NR     (*(unsigned char *) (PARAM+EDDNR))
+#define EDD_MBR_SIG_NR (*(unsigned char *) (PARAM+EDD_MBR_SIG_NR_BUF))
+#define EDD_MBR_SIGNATURE ((unsigned int *) (PARAM+EDD_MBR_SIG_BUF))
 #define EDD_BUF     ((struct edd_info *) (PARAM+EDDBUF))
 #define COMMAND_LINE saved_command_line
-#define COMMAND_LINE_SIZE 256
 
 #define RAMDISK_IMAGE_START_MASK  	0x07FF
 #define RAMDISK_PROMPT_FLAG		0x8000
diff --git a/include/asm-x86_64/compat.h b/include/asm-x86_64/compat.h
index c1e04aa5a..3acf9f227 100644
--- a/include/asm-x86_64/compat.h
+++ b/include/asm-x86_64/compat.h
@@ -118,7 +118,7 @@ typedef u32		compat_old_sigset_t;	/* at least 32 bits */
 typedef u32               compat_sigset_word;
 
 #define COMPAT_OFF_T_MAX	0x7fffffff
-#define COMPAT_LOFF_T_MAX	0x7fffffffffffffff
+#define COMPAT_LOFF_T_MAX	0x7fffffffffffffffL
 
 struct compat_ipc64_perm {
 	compat_key_t key;
diff --git a/include/asm-x86_64/fcntl.h b/include/asm-x86_64/fcntl.h
index aabf1a30a..4411f221c 100644
--- a/include/asm-x86_64/fcntl.h
+++ b/include/asm-x86_64/fcntl.h
@@ -20,6 +20,7 @@
 #define O_LARGEFILE	0100000
 #define O_DIRECTORY	0200000	/* must be a directory */
 #define O_NOFOLLOW	0400000 /* don't follow links */
+#define O_NOATIME	01000000
 
 #define F_DUPFD		0	/* dup */
 #define F_GETFD		1	/* get close_on_exec */
diff --git a/include/asm-x86_64/hw_irq.h b/include/asm-x86_64/hw_irq.h
index 161edad6a..2df689dd6 100644
--- a/include/asm-x86_64/hw_irq.h
+++ b/include/asm-x86_64/hw_irq.h
@@ -78,6 +78,7 @@ struct hw_interrupt_type;
 #ifndef __ASSEMBLY__
 extern u8 irq_vector[NR_IRQ_VECTORS];
 #define IO_APIC_VECTOR(irq)	(irq_vector[irq])
+#define AUTO_ASSIGN		-1
 
 /*
  * Various low-level irq details needed by irq.c, process.c,
diff --git a/include/asm-x86_64/i387.h b/include/asm-x86_64/i387.h
index 10638b850..229401824 100644
--- a/include/asm-x86_64/i387.h
+++ b/include/asm-x86_64/i387.h
@@ -138,7 +138,7 @@ static inline void save_init_fpu( struct task_struct *tsk )
  */
 static inline int restore_i387(struct _fpstate __user *buf)
 {
-	return restore_fpu_checking((struct i387_fxsave_struct *)buf);
+	return restore_fpu_checking((__force struct i387_fxsave_struct *)buf);
 }
 
 #endif /* __ASM_X86_64_I387_H */
diff --git a/include/asm-x86_64/io_apic.h b/include/asm-x86_64/io_apic.h
index 5f31a27b0..288296121 100644
--- a/include/asm-x86_64/io_apic.h
+++ b/include/asm-x86_64/io_apic.h
@@ -13,7 +13,7 @@
 
 #ifdef CONFIG_X86_IO_APIC
 
-#ifdef CONFIG_PCI_USE_VECTOR
+#ifdef CONFIG_PCI_MSI
 static inline int use_pci_vector(void)	{return 1;}
 static inline void disable_edge_ioapic_vector(unsigned int vector) { }
 static inline void mask_and_ack_level_ioapic_vector(unsigned int vector) { }
diff --git a/include/asm-x86_64/irq.h b/include/asm-x86_64/irq.h
index 37c9fd65c..34bd00bfc 100644
--- a/include/asm-x86_64/irq.h
+++ b/include/asm-x86_64/irq.h
@@ -31,7 +31,7 @@
 
 #define FIRST_SYSTEM_VECTOR	0xef   /* duplicated in hw_irq.h */
 
-#ifdef CONFIG_PCI_USE_VECTOR
+#ifdef CONFIG_PCI_MSI
 #define NR_IRQS FIRST_SYSTEM_VECTOR
 #define NR_IRQ_VECTORS NR_IRQS
 #else
diff --git a/include/asm-x86_64/mpspec.h b/include/asm-x86_64/mpspec.h
index cbe6058e9..2768b7c83 100644
--- a/include/asm-x86_64/mpspec.h
+++ b/include/asm-x86_64/mpspec.h
@@ -166,7 +166,7 @@ enum mp_bustype {
 };
 extern unsigned char mp_bus_id_to_type [MAX_MP_BUSSES];
 extern int mp_bus_id_to_pci_bus [MAX_MP_BUSSES];
-extern cpumask_t mp_bus_to_cpumask [MAX_MP_BUSSES];
+extern cpumask_t pci_bus_to_cpumask [256];
 
 extern unsigned int boot_cpu_physical_apicid;
 extern int smp_found_config;
@@ -189,7 +189,7 @@ extern void mp_register_lapic_address (u64 address);
 extern void mp_register_ioapic (u8 id, u32 address, u32 gsi_base);
 extern void mp_override_legacy_irq (u8 bus_irq, u8 polarity, u8 trigger, u32 gsi);
 extern void mp_config_acpi_legacy_irqs (void);
-extern void mp_parse_prt (void);
+extern void mp_register_gsi (u32 gsi, int edge_level, int active_high_low);
 #endif /*CONFIG_X86_IO_APIC*/
 #endif
 
@@ -212,7 +212,7 @@ typedef struct physid_mask physid_mask_t;
 #define physids_and(dst, src1, src2)		bitmap_and((dst).mask, (src1).mask, (src2).mask, MAX_APICS)
 #define physids_or(dst, src1, src2)		bitmap_or((dst).mask, (src1).mask, (src2).mask, MAX_APICS)
 #define physids_clear(map)			bitmap_zero((map).mask, MAX_APICS)
-#define physids_complement(map)			bitmap_complement((map).mask, MAX_APICS)
+#define physids_complement(dst, src)		bitmap_complement((dst).mask, (src).mask, MAX_APICS)
 #define physids_empty(map)			bitmap_empty((map).mask, MAX_APICS)
 #define physids_equal(map1, map2)		bitmap_equal((map1).mask, (map2).mask, MAX_APICS)
 #define physids_weight(map)			bitmap_weight((map).mask, MAX_APICS)
diff --git a/include/asm-x86_64/msi.h b/include/asm-x86_64/msi.h
index 727b911f2..e0e1e9b3b 100644
--- a/include/asm-x86_64/msi.h
+++ b/include/asm-x86_64/msi.h
@@ -11,11 +11,6 @@
 #define LAST_DEVICE_VECTOR		232
 #define MSI_DEST_MODE			MSI_LOGICAL_MODE
 #define MSI_TARGET_CPU_SHIFT		12
-
-#ifdef CONFIG_SMP
-#define MSI_TARGET_CPU		logical_smp_processor_id()
-#else
-#define MSI_TARGET_CPU		TARGET_CPUS
-#endif
+#define MSI_TARGET_CPU			TARGET_CPUS
 
 #endif /* ASM_MSI_H */
diff --git a/include/asm-x86_64/pgtable.h b/include/asm-x86_64/pgtable.h
index 37ebbad00..059ba4a7d 100644
--- a/include/asm-x86_64/pgtable.h
+++ b/include/asm-x86_64/pgtable.h
@@ -172,7 +172,7 @@ static inline void set_pml4(pml4_t *dst, pml4_t val)
 #define PAGE_READONLY_EXEC __pgprot(_PAGE_PRESENT | _PAGE_USER | _PAGE_ACCESSED)
 #define __PAGE_KERNEL \
 	(_PAGE_PRESENT | _PAGE_RW | _PAGE_DIRTY | _PAGE_ACCESSED | _PAGE_NX)
-#define __PAGE_KERNEL_EXECUTABLE \
+#define __PAGE_KERNEL_EXEC \
 	(_PAGE_PRESENT | _PAGE_RW | _PAGE_DIRTY | _PAGE_ACCESSED)
 #define __PAGE_KERNEL_NOCACHE \
 	(_PAGE_PRESENT | _PAGE_RW | _PAGE_DIRTY | _PAGE_PCD | _PAGE_ACCESSED | _PAGE_NX)
@@ -188,7 +188,7 @@ static inline void set_pml4(pml4_t *dst, pml4_t val)
 #define MAKE_GLOBAL(x) __pgprot((x) | _PAGE_GLOBAL)
 
 #define PAGE_KERNEL MAKE_GLOBAL(__PAGE_KERNEL)
-#define PAGE_KERNEL_EXECUTABLE MAKE_GLOBAL(__PAGE_KERNEL_EXECUTABLE)
+#define PAGE_KERNEL_EXEC MAKE_GLOBAL(__PAGE_KERNEL_EXEC)
 #define PAGE_KERNEL_RO MAKE_GLOBAL(__PAGE_KERNEL_RO)
 #define PAGE_KERNEL_NOCACHE MAKE_GLOBAL(__PAGE_KERNEL_NOCACHE)
 #define PAGE_KERNEL_VSYSCALL MAKE_GLOBAL(__PAGE_KERNEL_VSYSCALL)
@@ -262,8 +262,21 @@ extern inline pte_t pte_mkexec(pte_t pte)	{ set_pte(&pte, __pte(pte_val(pte) | _
 extern inline pte_t pte_mkdirty(pte_t pte)	{ set_pte(&pte, __pte(pte_val(pte) | _PAGE_DIRTY)); return pte; }
 extern inline pte_t pte_mkyoung(pte_t pte)	{ set_pte(&pte, __pte(pte_val(pte) | _PAGE_ACCESSED)); return pte; }
 extern inline pte_t pte_mkwrite(pte_t pte)	{ set_pte(&pte, __pte(pte_val(pte) | _PAGE_RW)); return pte; }
-static inline  int ptep_test_and_clear_dirty(pte_t *ptep)	{ return test_and_clear_bit(_PAGE_BIT_DIRTY, ptep); }
-static inline  int ptep_test_and_clear_young(pte_t *ptep)	{ return test_and_clear_bit(_PAGE_BIT_ACCESSED, ptep); }
+
+static inline int ptep_test_and_clear_dirty(pte_t *ptep)
+{
+	if (!pte_dirty(*ptep))
+		return 0;
+	return test_and_clear_bit(_PAGE_BIT_DIRTY, ptep);
+}
+
+static inline int ptep_test_and_clear_young(pte_t *ptep)
+{
+	if (!pte_young(*ptep))
+		return 0;
+	return test_and_clear_bit(_PAGE_BIT_ACCESSED, ptep);
+}
+
 static inline void ptep_set_wrprotect(pte_t *ptep)		{ clear_bit(_PAGE_BIT_RW, ptep); }
 static inline void ptep_mkdirty(pte_t *ptep)			{ set_bit(_PAGE_BIT_DIRTY, ptep); }
 
diff --git a/include/asm-x86_64/processor.h b/include/asm-x86_64/processor.h
index ec696b271..934828c82 100644
--- a/include/asm-x86_64/processor.h
+++ b/include/asm-x86_64/processor.h
@@ -178,9 +178,9 @@ static inline void clear_in_cr4 (unsigned long mask)
 	(test_thread_flag(TIF_IA32) ? TASK_UNMAPPED_32 : TASK_UNMAPPED_64)  
 
 /*
- * Size of io_bitmap, covering ports 0 to 0x3ff.
+ * Size of io_bitmap.
  */
-#define IO_BITMAP_BITS  1024
+#define IO_BITMAP_BITS  65536
 #define IO_BITMAP_BYTES (IO_BITMAP_BITS/8)
 #define IO_BITMAP_LONGS (IO_BITMAP_BYTES/sizeof(long))
 #define IO_BITMAP_OFFSET offsetof(struct tss_struct,io_bitmap)
diff --git a/include/asm-x86_64/resource.h b/include/asm-x86_64/resource.h
index b430c854b..9628f7717 100644
--- a/include/asm-x86_64/resource.h
+++ b/include/asm-x86_64/resource.h
@@ -16,8 +16,10 @@
 #define RLIMIT_MEMLOCK	8		/* max locked-in-memory address space */
 #define RLIMIT_AS	9		/* address space limit */
 #define RLIMIT_LOCKS	10		/* maximum file locks held */
+#define RLIMIT_SIGPENDING 11		/* max number of pending signals */
+#define RLIMIT_MSGQUEUE 12		/* maximum bytes in POSIX mqueues */
 
-#define RLIM_NLIMITS	11
+#define RLIM_NLIMITS	13
 
 /*
  * SuS says limits have to be unsigned.
@@ -39,7 +41,9 @@
 	{      INR_OPEN,     INR_OPEN  },		\
 	{ RLIM_INFINITY, RLIM_INFINITY },		\
 	{ RLIM_INFINITY, RLIM_INFINITY },		\
-        { RLIM_INFINITY, RLIM_INFINITY },		\
+	{ RLIM_INFINITY, RLIM_INFINITY },		\
+	{ MAX_SIGPENDING, MAX_SIGPENDING },		\
+	{ MQ_BYTES_MAX, MQ_BYTES_MAX },			\
 }
 
 #endif /* __KERNEL__ */
diff --git a/include/asm-x86_64/setup.h b/include/asm-x86_64/setup.h
index 7079a136c..985d4e3c7 100644
--- a/include/asm-x86_64/setup.h
+++ b/include/asm-x86_64/setup.h
@@ -1,10 +1,6 @@
-/*
- *	Just a place holder. We don't want to have to test x86 before
- *	we include stuff
- */
-
 #ifndef _x8664_SETUP_H
 #define _x8664_SETUP_H
 
+#define COMMAND_LINE_SIZE	256
 
 #endif
diff --git a/include/asm-x86_64/signal.h b/include/asm-x86_64/signal.h
index 21c4bf716..643a20d73 100644
--- a/include/asm-x86_64/signal.h
+++ b/include/asm-x86_64/signal.h
@@ -136,7 +136,11 @@ typedef unsigned long sigset_t;
 
 #ifndef __ASSEMBLY__
 /* Type of a signal handler.  */
-typedef void (*__sighandler_t)(int);
+typedef void __signalfn_t(int);
+typedef __signalfn_t __user *__sighandler_t;
+
+typedef void __restorefn_t(void);
+typedef __restorefn_t __user *__sigrestore_t;
 
 #define SIG_DFL	((__sighandler_t)0)	/* default signal handling */
 #define SIG_IGN	((__sighandler_t)1)	/* ignore signal */
@@ -145,7 +149,7 @@ typedef void (*__sighandler_t)(int);
 struct sigaction {
 	__sighandler_t sa_handler;
 	unsigned long sa_flags;
-	void (*sa_restorer)(void);
+	__sigrestore_t sa_restorer;
 	sigset_t sa_mask;		/* mask last for extensibility */
 };
 
@@ -154,7 +158,7 @@ struct k_sigaction {
 };
 
 typedef struct sigaltstack {
-	void *ss_sp;
+	void __user *ss_sp;
 	int ss_flags;
 	size_t ss_size;
 } stack_t;
diff --git a/include/asm-x86_64/smp.h b/include/asm-x86_64/smp.h
index 2878896de..c210e398a 100644
--- a/include/asm-x86_64/smp.h
+++ b/include/asm-x86_64/smp.h
@@ -60,7 +60,6 @@ extern char phys_proc_id[NR_CPUS];
 
 extern cpumask_t cpu_callout_map;
 #define cpu_possible_map cpu_callout_map
-#define cpu_online(cpu) cpu_isset(cpu, cpu_online_map)
 
 static inline int num_booting_cpus(void)
 {
@@ -105,7 +104,6 @@ static inline int cpu_present_to_apicid(int mps_cpu)
 		return BAD_APICID;
 }
 
-#define cpu_online(cpu) cpu_isset(cpu, cpu_online_map)
 #endif /* !ASSEMBLY */
 
 #define NO_PROC_ID		0xFF		/* No processor magic marker */
@@ -115,9 +113,9 @@ static inline int cpu_present_to_apicid(int mps_cpu)
 #define TARGET_CPUS 1
 
 #ifndef ASSEMBLY
-static inline unsigned int cpu_mask_to_apicid(cpumask_const_t cpumask)
+static inline unsigned int cpu_mask_to_apicid(cpumask_t cpumask)
 {
-	return cpus_coerce_const(cpumask);
+	return cpus_addr(cpumask)[0];
 }
 #endif
 
diff --git a/include/asm-x86_64/string.h b/include/asm-x86_64/string.h
index 27876b9da..a3493ee28 100644
--- a/include/asm-x86_64/string.h
+++ b/include/asm-x86_64/string.h
@@ -3,8 +3,6 @@
 
 #ifdef __KERNEL__
 
-#define struct_cpy(x,y) (*(x)=*(y))
-
 /* Written 2002 by Andi Kleen */ 
 
 /* Only used for special circumstances. Stolen from i386/string.h */ 
diff --git a/include/asm-x86_64/suspend.h b/include/asm-x86_64/suspend.h
index 914d98371..508e924b8 100644
--- a/include/asm-x86_64/suspend.h
+++ b/include/asm-x86_64/suspend.h
@@ -38,7 +38,6 @@ extern unsigned long saved_context_r08, saved_context_r09, saved_context_r10, sa
 extern unsigned long saved_context_r12, saved_context_r13, saved_context_r14, saved_context_r15;
 extern unsigned long saved_context_eflags;
 
-
 #define loaddebug(thread,register) \
                __asm__("movq %0,%%db" #register  \
                        : /* no output */ \
diff --git a/include/asm-x86_64/topology.h b/include/asm-x86_64/topology.h
index bb9a99ba2..dbc3f1579 100644
--- a/include/asm-x86_64/topology.h
+++ b/include/asm-x86_64/topology.h
@@ -20,9 +20,11 @@ extern cpumask_t     node_to_cpumask[];
 #define node_to_first_cpu(node) 	(__ffs(node_to_cpumask[node]))
 #define node_to_cpumask(node)		(node_to_cpumask[node])
 
-static inline unsigned long pcibus_to_cpumask(int bus)
+static inline cpumask_t pcibus_to_cpumask(int bus)
 {
-	return mp_bus_to_cpumask[bus] & cpu_online_map; 
+	cpumask_t res;
+	cpus_and(res,  pci_bus_to_cpumask[bus], cpu_online_map);
+	return res;
 }
 
 #define NODE_BALANCE_RATE 30	/* CHECKME */ 
diff --git a/include/asm-x86_64/uaccess.h b/include/asm-x86_64/uaccess.h
index 779c74260..ba3d49d8a 100644
--- a/include/asm-x86_64/uaccess.h
+++ b/include/asm-x86_64/uaccess.h
@@ -33,16 +33,6 @@
 
 #define segment_eq(a,b)	((a).seg == (b).seg)
 
-#ifdef __CHECKER__
-#define CHECK_UPTR(ptr) do {				\
-	__typeof__(*(ptr)) *__dummy_check_uptr =	\
-		(void __user *)&__dummy_check_uptr;	\
-} while(0)
-#else
-#define CHECK_UPTR(ptr)
-#endif
-
-
 #define __addr_ok(addr) (!((unsigned long)(addr) & (current_thread_info()->addr_limit.seg)))
 
 /*
@@ -50,7 +40,7 @@
  */
 #define __range_not_ok(addr,size) ({ \
 	unsigned long flag,sum; \
-	CHECK_UPTR(addr);	\
+	__chk_user_ptr(addr); \
 	asm("# range_ok\n\r" \
 		"addq %3,%1 ; sbbq %0,%0 ; cmpq %1,%4 ; sbbq $0,%0"  \
 		:"=&r" (flag), "=r" (sum) \
@@ -114,7 +104,7 @@ extern void __get_user_8(void);
 #define get_user(x,ptr)							\
 ({	long __val_gu;							\
 	int __ret_gu; 							\
-	CHECK_UPTR(ptr);						\
+	__chk_user_ptr(ptr);						\
 	switch(sizeof (*(ptr))) {					\
 	case 1:  __get_user_x(1,__ret_gu,__val_gu,ptr); break;		\
 	case 2:  __get_user_x(2,__ret_gu,__val_gu,ptr); break;		\
@@ -150,7 +140,6 @@ extern void __put_user_bad(void);
 #define __put_user_nocheck(x,ptr,size)			\
 ({							\
 	int __pu_err;					\
-	CHECK_UPTR(ptr);				\
 	__put_user_size((x),(ptr),(size),__pu_err);	\
 	__pu_err;					\
 })
@@ -159,7 +148,7 @@ extern void __put_user_bad(void);
 #define __put_user_check(x,ptr,size)			\
 ({							\
 	int __pu_err = -EFAULT;				\
-	__typeof__(*(ptr)) *__pu_addr = (ptr);		\
+	__typeof__(*(ptr)) __user *__pu_addr = (ptr);	\
 	if (likely(access_ok(VERIFY_WRITE,__pu_addr,size)))	\
 		__put_user_size((x),__pu_addr,(size),__pu_err);	\
 	__pu_err;					\
@@ -168,6 +157,7 @@ extern void __put_user_bad(void);
 #define __put_user_size(x,ptr,size,retval)				\
 do {									\
 	retval = 0;							\
+	__chk_user_ptr(ptr);						\
 	switch (size) {							\
 	  case 1: __put_user_asm(x,ptr,retval,"b","b","iq",-EFAULT); break;\
 	  case 2: __put_user_asm(x,ptr,retval,"w","w","ir",-EFAULT); break;\
@@ -206,7 +196,6 @@ struct __large_struct { unsigned long buf[100]; };
 ({								\
 	int __gu_err;						\
 	long __gu_val;						\
-	CHECK_UPTR(ptr);					\
 	__get_user_size(__gu_val,(ptr),(size),__gu_err);	\
 	(x) = (__typeof__(*(ptr)))__gu_val;			\
 	__gu_err;						\
@@ -217,6 +206,7 @@ extern int __get_user_bad(void);
 #define __get_user_size(x,ptr,size,retval)				\
 do {									\
 	retval = 0;							\
+	__chk_user_ptr(ptr);						\
 	switch (size) {							\
 	  case 1: __get_user_asm(x,ptr,retval,"b","b","=q",-EFAULT); break;\
 	  case 2: __get_user_asm(x,ptr,retval,"w","w","=r",-EFAULT); break;\
@@ -257,28 +247,28 @@ static inline int __copy_from_user(void *dst, const void __user *src, unsigned s
 { 
        int ret = 0;
 	if (!__builtin_constant_p(size))
-		return copy_user_generic(dst,(void *)src,size);
+		return copy_user_generic(dst,(__force void *)src,size);
 	switch (size) { 
-	case 1:__get_user_asm(*(u8*)dst,(u8 *)src,ret,"b","b","=q",1); 
+	case 1:__get_user_asm(*(u8*)dst,(u8 __user *)src,ret,"b","b","=q",1); 
 		return ret;
-	case 2:__get_user_asm(*(u16*)dst,(u16*)src,ret,"w","w","=r",2);
+	case 2:__get_user_asm(*(u16*)dst,(u16 __user *)src,ret,"w","w","=r",2);
 		return ret;
-	case 4:__get_user_asm(*(u32*)dst,(u32*)src,ret,"l","k","=r",4);
+	case 4:__get_user_asm(*(u32*)dst,(u32 __user *)src,ret,"l","k","=r",4);
 		return ret;
-	case 8:__get_user_asm(*(u64*)dst,(u64*)src,ret,"q","","=r",8);
+	case 8:__get_user_asm(*(u64*)dst,(u64 __user *)src,ret,"q","","=r",8);
 		return ret; 
 	case 10:
-	       	__get_user_asm(*(u64*)dst,(u64*)src,ret,"q","","=r",16);
+	       	__get_user_asm(*(u64*)dst,(u64 __user *)src,ret,"q","","=r",16);
 		if (unlikely(ret)) return ret;
-		__get_user_asm(*(u16*)(8+(char*)dst),(u16*)(8+(char*)src),ret,"w","w","=r",2);
+		__get_user_asm(*(u16*)(8+(char*)dst),(u16 __user *)(8+(char __user *)src),ret,"w","w","=r",2);
 		return ret; 
 	case 16:
-		__get_user_asm(*(u64*)dst,(u64*)src,ret,"q","","=r",16);
+		__get_user_asm(*(u64*)dst,(u64 __user *)src,ret,"q","","=r",16);
 		if (unlikely(ret)) return ret;
-		__get_user_asm(*(u64*)(8+(char*)dst),(u64*)(8+(char*)src),ret,"q","","=r",8);
+		__get_user_asm(*(u64*)(8+(char*)dst),(u64 __user *)(8+(char __user *)src),ret,"q","","=r",8);
 		return ret; 
 	default:
-		return copy_user_generic(dst,(void *)src,size); 
+		return copy_user_generic(dst,(__force void *)src,size); 
 	}
 }	
 
@@ -286,30 +276,30 @@ static inline int __copy_to_user(void __user *dst, const void *src, unsigned siz
 { 
        int ret = 0;
 	if (!__builtin_constant_p(size))
-		return copy_user_generic((void *)dst,src,size);
+		return copy_user_generic((__force void *)dst,src,size);
 	switch (size) { 
-	case 1:__put_user_asm(*(u8*)src,(u8 *)dst,ret,"b","b","iq",1); 
+	case 1:__put_user_asm(*(u8*)src,(u8 __user *)dst,ret,"b","b","iq",1); 
 		return ret;
-	case 2:__put_user_asm(*(u16*)src,(u16*)dst,ret,"w","w","ir",2);
+	case 2:__put_user_asm(*(u16*)src,(u16 __user *)dst,ret,"w","w","ir",2);
 		return ret;
-	case 4:__put_user_asm(*(u32*)src,(u32*)dst,ret,"l","k","ir",4);
+	case 4:__put_user_asm(*(u32*)src,(u32 __user *)dst,ret,"l","k","ir",4);
 		return ret;
-	case 8:__put_user_asm(*(u64*)src,(u64*)dst,ret,"q","","ir",8);
+	case 8:__put_user_asm(*(u64*)src,(u64 __user *)dst,ret,"q","","ir",8);
 		return ret; 
 	case 10:
-		__put_user_asm(*(u64*)src,(u64*)dst,ret,"q","","ir",10);
+		__put_user_asm(*(u64*)src,(u64 __user *)dst,ret,"q","","ir",10);
 		if (unlikely(ret)) return ret;
 		asm("":::"memory");
-		__put_user_asm(4[(u16*)src],4+(u16*)dst,ret,"w","w","ir",2);
+		__put_user_asm(4[(u16*)src],4+(u16 __user *)dst,ret,"w","w","ir",2);
 		return ret; 
 	case 16:
-		__put_user_asm(*(u64*)src,(u64*)dst,ret,"q","","ir",16);
+		__put_user_asm(*(u64*)src,(u64 __user *)dst,ret,"q","","ir",16);
 		if (unlikely(ret)) return ret;
 		asm("":::"memory");
-		__put_user_asm(1[(u64*)src],1+(u64*)dst,ret,"q","","ir",8);
+		__put_user_asm(1[(u64*)src],1+(u64 __user *)dst,ret,"q","","ir",8);
 		return ret; 
 	default:
-		return copy_user_generic((void *)dst,src,size); 
+		return copy_user_generic((__force void *)dst,src,size); 
 	}
 }	
 
@@ -318,39 +308,39 @@ static inline int __copy_in_user(void __user *dst, const void __user *src, unsig
 { 
        int ret = 0;
 	if (!__builtin_constant_p(size))
-		return copy_user_generic((void *)dst,(void *)src,size);
+		return copy_user_generic((__force void *)dst,(__force void *)src,size);
 	switch (size) { 
 	case 1: { 
 		u8 tmp;
-		__get_user_asm(tmp,(u8 *)src,ret,"b","b","=q",1); 
+		__get_user_asm(tmp,(u8 __user *)src,ret,"b","b","=q",1); 
 		if (likely(!ret))
-			__put_user_asm(tmp,(u8 *)dst,ret,"b","b","iq",1); 
+			__put_user_asm(tmp,(u8 __user *)dst,ret,"b","b","iq",1); 
 		return ret;
 	}
 	case 2: { 
 		u16 tmp;
-		__get_user_asm(tmp,(u16 *)src,ret,"w","w","=r",2); 
+		__get_user_asm(tmp,(u16 __user *)src,ret,"w","w","=r",2); 
 		if (likely(!ret))
-			__put_user_asm(tmp,(u16 *)dst,ret,"w","w","ir",2); 
+			__put_user_asm(tmp,(u16 __user *)dst,ret,"w","w","ir",2); 
 		return ret;
 	}
 
 	case 4: { 
 		u32 tmp;
-		__get_user_asm(tmp,(u32 *)src,ret,"l","k","=r",4); 
+		__get_user_asm(tmp,(u32 __user *)src,ret,"l","k","=r",4); 
 		if (likely(!ret))
-			__put_user_asm(tmp,(u32 *)dst,ret,"l","k","ir",4); 
+			__put_user_asm(tmp,(u32 __user *)dst,ret,"l","k","ir",4); 
 		return ret;
 	}
 	case 8: { 
 		u64 tmp;
-		__get_user_asm(tmp,(u64 *)src,ret,"q","","=r",8); 
+		__get_user_asm(tmp,(u64 __user *)src,ret,"q","","=r",8); 
 		if (likely(!ret))
-			__put_user_asm(tmp,(u64 *)dst,ret,"q","","ir",8); 
+			__put_user_asm(tmp,(u64 __user *)dst,ret,"q","","ir",8); 
 		return ret;
 	}
 	default:
-		return copy_user_generic((void *)dst,(void *)src,size); 
+		return copy_user_generic((__force void *)dst,(__force void *)src,size); 
 	}
 }	
 
diff --git a/include/asm-x86_64/vsyscall32.h b/include/asm-x86_64/vsyscall32.h
index c44a49d43..c631c082f 100644
--- a/include/asm-x86_64/vsyscall32.h
+++ b/include/asm-x86_64/vsyscall32.h
@@ -13,8 +13,8 @@
 
 #define VSYSCALL32_VSYSCALL ((void *)VSYSCALL32_BASE + 0x400) 
 #define VSYSCALL32_SYSEXIT ((void *)VSYSCALL32_BASE + 0x410)
-#define VSYSCALL32_SIGRETURN ((void *)VSYSCALL32_BASE + 0x500) 
-#define VSYSCALL32_RTSIGRETURN ((void *)VSYSCALL32_BASE + 0x600) 
+#define VSYSCALL32_SIGRETURN ((void __user *)VSYSCALL32_BASE + 0x500) 
+#define VSYSCALL32_RTSIGRETURN ((void __user *)VSYSCALL32_BASE + 0x600) 
 #endif
 
 #endif
diff --git a/include/linux/acct.h b/include/linux/acct.h
index 69389c4af..b46ce1ac1 100644
--- a/include/linux/acct.h
+++ b/include/linux/acct.h
@@ -16,14 +16,19 @@
 #define _LINUX_ACCT_H
 
 #include <linux/types.h>
+#include <asm/param.h>
+#include <asm/byteorder.h>
 
 /* 
  *  comp_t is a 16-bit "floating" point number with a 3-bit base 8
- *  exponent and a 13-bit fraction. See linux/kernel/acct.c for the
- *  specific encoding system used.
+ *  exponent and a 13-bit fraction.
+ *  comp2_t is 24-bit with 5-bit base 2 exponent and 20 bit fraction
+ *  (leading 1 not stored).
+ *  See linux/kernel/acct.c for the specific encoding systems used.
  */
 
 typedef __u16	comp_t;
+typedef __u32	comp2_t;
 
 /*
  *   accounting file record
@@ -36,27 +41,59 @@ typedef __u16	comp_t;
 
 struct acct
 {
-	char		ac_flag;		/* Accounting Flags */
-/*
- *	No binary format break with 2.0 - but when we hit 32bit uid we'll
- *	have to bite one
- */
-	__u16		ac_uid;			/* Accounting Real User ID */
-	__u16		ac_gid;			/* Accounting Real Group ID */
-	__u16		ac_tty;			/* Accounting Control Terminal */
-	__u32		ac_btime;		/* Accounting Process Creation Time */
-	comp_t		ac_utime;		/* Accounting User Time */
-	comp_t		ac_stime;		/* Accounting System Time */
-	comp_t		ac_etime;		/* Accounting Elapsed Time */
-	comp_t		ac_mem;			/* Accounting Average Memory Usage */
-	comp_t		ac_io;			/* Accounting Chars Transferred */
-	comp_t		ac_rw;			/* Accounting Blocks Read or Written */
-	comp_t		ac_minflt;		/* Accounting Minor Pagefaults */
-	comp_t		ac_majflt;		/* Accounting Major Pagefaults */
-	comp_t		ac_swaps;		/* Accounting Number of Swaps */
-	__u32		ac_exitcode;		/* Accounting Exitcode */
-	char		ac_comm[ACCT_COMM + 1];	/* Accounting Command Name */
-	char		ac_pad[10];		/* Accounting Padding Bytes */
+	char		ac_flag;		/* Flags */
+	char		ac_version;		/* Always set to ACCT_VERSION */
+	/* for binary compatibility back until 2.0 */
+	__u16		ac_uid16;		/* LSB of Real User ID */
+	__u16		ac_gid16;		/* LSB of Real Group ID */
+	__u16		ac_tty;			/* Control Terminal */
+	__u32		ac_btime;		/* Process Creation Time */
+	comp_t		ac_utime;		/* User Time */
+	comp_t		ac_stime;		/* System Time */
+	comp_t		ac_etime;		/* Elapsed Time */
+	comp_t		ac_mem;			/* Average Memory Usage */
+	comp_t		ac_io;			/* Chars Transferred */
+	comp_t		ac_rw;			/* Blocks Read or Written */
+	comp_t		ac_minflt;		/* Minor Pagefaults */
+	comp_t		ac_majflt;		/* Major Pagefaults */
+	comp_t		ac_swaps;		/* Number of Swaps */
+/* m68k had no padding here. */
+#if !defined(CONFIG_M68K) || !defined(__KERNEL__)
+	__u16		ac_ahz;			/* AHZ */
+#endif
+	__u32		ac_exitcode;		/* Exitcode */
+	char		ac_comm[ACCT_COMM + 1];	/* Command Name */
+	__u8		ac_etime_hi;		/* Elapsed Time MSB */
+	__u16		ac_etime_lo;		/* Elapsed Time LSB */
+	__u32		ac_uid;			/* Real User ID */
+	__u32		ac_gid;			/* Real Group ID */
+};
+
+struct acct_v3
+{
+	char		ac_flag;		/* Flags */
+	char		ac_version;		/* Always set to ACCT_VERSION */
+	__u16		ac_tty;			/* Control Terminal */
+	__u32		ac_exitcode;		/* Exitcode */
+	__u32		ac_uid;			/* Real User ID */
+	__u32		ac_gid;			/* Real Group ID */
+	__u32		ac_pid;			/* Process ID */
+	__u32		ac_ppid;		/* Parent Process ID */
+	__u32		ac_btime;		/* Process Creation Time */
+#ifdef __KERNEL__
+	__u32		ac_etime;		/* Elapsed Time */
+#else
+	float		ac_etime;		/* Elapsed Time */
+#endif
+	comp_t		ac_utime;		/* User Time */
+	comp_t		ac_stime;		/* System Time */
+	comp_t		ac_mem;			/* Average Memory Usage */
+	comp_t		ac_io;			/* Chars Transferred */
+	comp_t		ac_rw;			/* Blocks Read or Written */
+	comp_t		ac_minflt;		/* Minor Pagefaults */
+	comp_t		ac_majflt;		/* Major Pagefaults */
+	comp_t		ac_swaps;		/* Number of Swaps */
+	char		ac_comm[ACCT_COMM];	/* Command Name */
 };
 
 /*
@@ -69,7 +106,11 @@ struct acct
 #define ACORE		0x08	/* ... dumped core */
 #define AXSIG		0x10	/* ... was killed by a signal */
 
-#define AHZ		100
+#ifdef __BIG_ENDIAN
+#define ACCT_BYTEORDER	0x80	/* accounting file is big endian */
+#else
+#define ACCT_BYTEORDER	0x00	/* accounting file is little endian */
+#endif
 
 #ifdef __KERNEL__
 
@@ -84,6 +125,66 @@ extern void acct_process(long exitcode);
 #define acct_process(x)		do { } while (0)
 #endif
 
+/*
+ * ACCT_VERSION numbers as yet defined:
+ * 0: old format (until 2.6.7) with 16 bit uid/gid
+ * 1: extended variant (binary compatible on M68K)
+ * 2: extended variant (binary compatible on everything except M68K)
+ * 3: new binary incompatible format (64 bytes)
+ * 4: new binary incompatible format (128 bytes)
+ * 5: new binary incompatible format (128 bytes, second half)
+ *
+ */
+
+#ifdef CONFIG_BSD_PROCESS_ACCT_V3
+#define ACCT_VERSION	3
+#define AHZ		100
+typedef struct acct_v3 acct_t;
+#else
+#ifdef CONFIG_M68K
+#define ACCT_VERSION	1
+#else
+#define ACCT_VERSION	2
+#endif
+#define AHZ		(USER_HZ)
+typedef struct acct acct_t;
+#endif
+
+#else
+#define ACCT_VERSION	2
+#define AHZ		(HZ)
 #endif	/* __KERNEL */
 
+#ifdef __KERNEL__
+/*
+ * Yet another set of HZ to *HZ helper functions.
+ * See <linux/times.h> for the original.
+ */
+
+static inline u32 jiffies_to_AHZ(unsigned long x)
+{
+#if (TICK_NSEC % (NSEC_PER_SEC / AHZ)) == 0
+	return x / (HZ / USER_HZ);
+#else
+        u64 tmp = (u64)x * TICK_NSEC;
+        do_div(tmp, (NSEC_PER_SEC / AHZ));
+        return (long)tmp;
+#endif
+}
+
+static inline u64 jiffies_64_to_AHZ(u64 x)
+{
+#if (TICK_NSEC % (NSEC_PER_SEC / AHZ)) == 0
+#if HZ != AHZ
+	do_div(x, HZ / AHZ);
+#endif
+#else
+	x *= TICK_NSEC;
+	do_div(x, (NSEC_PER_SEC / AHZ));
+#endif
+       return x;
+}
+
+#endif  /* __KERNEL */
+
 #endif	/* _LINUX_ACCT_H */
diff --git a/include/linux/acpi.h b/include/linux/acpi.h
index d56069ba4..f82aa67ea 100644
--- a/include/linux/acpi.h
+++ b/include/linux/acpi.h
@@ -413,6 +413,8 @@ static inline int acpi_boot_init(void)
 
 #endif 	/*!CONFIG_ACPI_BOOT*/
 
+unsigned int acpi_register_gsi (u32 gsi, int edge_level, int active_high_low);
+int acpi_gsi_to_irq (u32 gsi, unsigned int *irq);
 
 #ifdef CONFIG_ACPI_PCI
 
@@ -437,8 +439,6 @@ extern struct acpi_prt_list	acpi_prt;
 struct pci_dev;
 
 int acpi_pci_irq_enable (struct pci_dev *dev);
-int acpi_pci_irq_init (void);
-int acpi_gsi_to_irq (u32 gsi, unsigned int *irq);
 
 struct acpi_pci_driver {
 	struct acpi_pci_driver *next;
diff --git a/include/linux/affs_fs.h b/include/linux/affs_fs.h
index c849309b1..5ba9d6205 100644
--- a/include/linux/affs_fs.h
+++ b/include/linux/affs_fs.h
@@ -36,7 +36,8 @@ extern u32	affs_count_free_bits(u32 blocksize, const void *data);
 extern u32	affs_count_free_blocks(struct super_block *s);
 extern void	affs_free_block(struct super_block *sb, u32 block);
 extern u32	affs_alloc_block(struct inode *inode, u32 goal);
-extern int	affs_init_bitmap(struct super_block *sb);
+extern int	affs_init_bitmap(struct super_block *sb, int *flags);
+extern void	affs_free_bitmap(struct super_block *sb);
 
 /* namei.c */
 
diff --git a/include/linux/affs_fs_sb.h b/include/linux/affs_fs_sb.h
index d2f86715c..d722befe1 100644
--- a/include/linux/affs_fs_sb.h
+++ b/include/linux/affs_fs_sb.h
@@ -47,7 +47,6 @@ struct affs_sb_info {
 #define SF_OFS		0x0200		/* Old filesystem */
 #define SF_PREFIX	0x0400		/* Buffer for prefix is allocated */
 #define SF_VERBOSE	0x0800		/* Talk about fs when mounting */
-#define SF_READONLY	0x1000		/* Don't allow to remount rw */
 
 /* short cut to get to the affs specific sb data */
 static inline struct affs_sb_info *AFFS_SB(struct super_block *sb)
diff --git a/include/linux/aio.h b/include/linux/aio.h
index 93fe78800..461a3b073 100644
--- a/include/linux/aio.h
+++ b/include/linux/aio.h
@@ -23,8 +23,6 @@ struct kioctx;
 
 #define KIOCB_SYNC_KEY		(~0U)
 
-#define KIOCB_PRIVATE_SIZE	(24 * sizeof(long))
-
 /* ki_flags bits */
 #define KIF_LOCKED		0
 #define KIF_KICKED		1
@@ -55,6 +53,7 @@ struct kiocb {
 	struct kioctx		*ki_ctx;	/* may be NULL for sync ops */
 	int			(*ki_cancel)(struct kiocb *, struct io_event *);
 	long			(*ki_retry)(struct kiocb *);
+	void			(*ki_dtor)(struct kiocb *);
 
 	struct list_head	ki_list;	/* the aio core uses this
 						 * for cancellation */
@@ -65,8 +64,7 @@ struct kiocb {
 	} ki_obj;
 	__u64			ki_user_data;	/* user's data for completion */
 	loff_t			ki_pos;
-
-	char			private[KIOCB_PRIVATE_SIZE];
+	void			*private;
 };
 
 #define is_sync_kiocb(iocb)	((iocb)->ki_key == KIOCB_SYNC_KEY)
@@ -79,6 +77,7 @@ struct kiocb {
 		(x)->ki_filp = (filp);			\
 		(x)->ki_ctx = &tsk->active_mm->default_kioctx;	\
 		(x)->ki_cancel = NULL;			\
+		(x)->ki_dtor = NULL;			\
 		(x)->ki_obj.tsk = tsk;			\
 	} while (0)
 
diff --git a/include/linux/ata.h b/include/linux/ata.h
index 38ccb84c0..4b6d0e417 100644
--- a/include/linux/ata.h
+++ b/include/linux/ata.h
@@ -78,9 +78,11 @@ enum {
 	ATA_NIEN		= (1 << 1),	/* disable-irq flag */
 	ATA_LBA			= (1 << 6),	/* LBA28 selector */
 	ATA_DEV1		= (1 << 4),	/* Select Device 1 (slave) */
-	ATA_BUSY		= (1 << 7),	/* BSY status bit */
 	ATA_DEVICE_OBS		= (1 << 7) | (1 << 5), /* obs bits in dev reg */
 	ATA_DEVCTL_OBS		= (1 << 3),	/* obsolete bit in devctl reg */
+	ATA_BUSY		= (1 << 7),	/* BSY status bit */
+	ATA_DRDY		= (1 << 6),	/* device ready */
+	ATA_DF			= (1 << 5),	/* device fault */
 	ATA_DRQ			= (1 << 3),	/* data request i/o */
 	ATA_ERR			= (1 << 0),	/* have an error */
 	ATA_SRST		= (1 << 2),	/* software reset */
@@ -207,8 +209,8 @@ struct ata_taskfile {
 #define ata_id_has_lba48(dev)	((dev)->id[83] & (1 << 10))
 #define ata_id_has_wcache(dev)	((dev)->id[82] & (1 << 5))
 #define ata_id_has_pm(dev)	((dev)->id[82] & (1 << 3))
-#define ata_id_has_lba(dev)	((dev)->id[49] & (1 << 8))
-#define ata_id_has_dma(dev)	((dev)->id[49] & (1 << 9))
+#define ata_id_has_lba(dev)	((dev)->id[49] & (1 << 9))
+#define ata_id_has_dma(dev)	((dev)->id[49] & (1 << 8))
 #define ata_id_removeable(dev)	((dev)->id[0] & (1 << 7))
 #define ata_id_u32(dev,n)	\
 	(((u32) (dev)->id[(n) + 1] << 16) | ((u32) (dev)->id[(n)]))
@@ -224,4 +226,10 @@ static inline int is_atapi_taskfile(struct ata_taskfile *tf)
 	       (tf->protocol == ATA_PROT_ATAPI_DMA);
 }
 
+static inline int ata_ok(u8 status)
+{
+	return ((status & (ATA_BUSY | ATA_DRDY | ATA_DF | ATA_DRQ | ATA_ERR))
+			== ATA_DRDY);
+}
+
 #endif /* __LINUX_ATA_H__ */
diff --git a/include/linux/atm.h b/include/linux/atm.h
index 04e917069..7aec49cbd 100644
--- a/include/linux/atm.h
+++ b/include/linux/atm.h
@@ -20,6 +20,7 @@
 #include <linux/socket.h>
 #include <linux/types.h>
 #endif
+#include <linux/compiler.h>
 #include <linux/atmapi.h>
 #include <linux/atmsap.h>
 #include <linux/atmioc.h>
diff --git a/include/linux/atmdev.h b/include/linux/atmdev.h
index b19303d3f..35d22064c 100644
--- a/include/linux/atmdev.h
+++ b/include/linux/atmdev.h
@@ -147,7 +147,7 @@ struct atm_dev_stats {
 
 struct atm_iobuf {
 	int length;
-	void *buffer;
+	void __user *buffer;
 };
 
 /* for ATM_GETCIRANGE / ATM_SETCIRANGE */
@@ -155,8 +155,8 @@ struct atm_iobuf {
 #define ATM_CI_MAX      -1              /* use maximum range of VPI/VCI */
  
 struct atm_cirange {
-	char	vpi_bits;		/* 1..8, ATM_CI_MAX (-1) for maximum */
-	char	vci_bits;		/* 1..16, ATM_CI_MAX (-1) for maximum */
+	signed char	vpi_bits;	/* 1..8, ATM_CI_MAX (-1) for maximum */
+	signed char	vci_bits;	/* 1..16, ATM_CI_MAX (-1) for maximum */
 };
 
 /* for ATM_SETSC; actually taken from the ATM_VF number space */
diff --git a/include/linux/atmlec.h b/include/linux/atmlec.h
index dd6b349a0..f267f2442 100644
--- a/include/linux/atmlec.h
+++ b/include/linux/atmlec.h
@@ -2,7 +2,7 @@
  * 
  * ATM Lan Emulation Daemon vs. driver interface
  *
- * carnil@cs.tut.fi
+ * mkiiskila@yahoo.com
  *
  */
 
diff --git a/include/linux/binfmts.h b/include/linux/binfmts.h
index 392602dbd..d3f220b57 100644
--- a/include/linux/binfmts.h
+++ b/include/linux/binfmts.h
@@ -2,7 +2,6 @@
 #define _LINUX_BINFMTS_H
 
 #include <linux/capability.h>
-#include <linux/vs_memory.h>
 
 struct pt_regs;
 
@@ -36,9 +35,19 @@ struct linux_binprm{
 	char * interp;		/* Name of the binary really executed. Most
 				   of the time same as filename, but could be
 				   different for binfmt_{misc,script} */
+	unsigned interp_flags;
+	unsigned interp_data;
 	unsigned long loader, exec;
 };
 
+#define BINPRM_FLAGS_ENFORCE_NONDUMP_BIT 0
+#define BINPRM_FLAGS_ENFORCE_NONDUMP (1 << BINPRM_FLAGS_ENFORCE_NONDUMP_BIT)
+
+/* fd of the binary should be passed to the interpreter */
+#define BINPRM_FLAGS_EXECFD_BIT 1
+#define BINPRM_FLAGS_EXECFD (1 << BINPRM_FLAGS_EXECFD_BIT)
+
+
 /*
  * This structure defines the functions that are used to load the binary formats that
  * linux accepts.
diff --git a/include/linux/bio.h b/include/linux/bio.h
index c4dd287dd..b90e06c17 100644
--- a/include/linux/bio.h
+++ b/include/linux/bio.h
@@ -25,6 +25,15 @@
 
 /* Platforms may set this to teach the BIO layer about IOMMU hardware. */
 #include <asm/io.h>
+
+#if defined(BIO_VMERGE_MAX_SIZE) && defined(BIO_VMERGE_BOUNDARY)
+#define BIOVEC_VIRT_START_SIZE(x) (bvec_to_phys(x) & (BIO_VMERGE_BOUNDARY - 1))
+#define BIOVEC_VIRT_OVERSIZE(x)	((x) > BIO_VMERGE_MAX_SIZE)
+#else
+#define BIOVEC_VIRT_START_SIZE(x)	0
+#define BIOVEC_VIRT_OVERSIZE(x)		0
+#endif
+
 #ifndef BIO_VMERGE_BOUNDARY
 #define BIO_VMERGE_BOUNDARY	0
 #endif
@@ -81,6 +90,15 @@ struct bio {
 	unsigned short		bi_hw_segments;
 
 	unsigned int		bi_size;	/* residual I/O count */
+
+	/*
+	 * To keep track of the max hw size, we account for the
+	 * sizes of the first and last virtually mergeable segments
+	 * in this bio
+	 */
+	unsigned int		bi_hw_front_size;
+	unsigned int		bi_hw_back_size;
+
 	unsigned int		bi_max_vecs;	/* max bvl_vecs we can hold */
 
 	struct bio_vec		*bi_io_vec;	/* the actual vec list */
@@ -102,6 +120,7 @@ struct bio {
 #define BIO_SEG_VALID	3	/* nr_hw_seg valid */
 #define BIO_CLONED	4	/* doesn't own data */
 #define BIO_BOUNCED	5	/* bio is a bounce bio */
+#define BIO_USER_MAPPED 6	/* contains user pages */
 #define bio_flagged(bio, flag)	((bio)->bi_flags & (1 << (flag)))
 
 /*
@@ -246,9 +265,11 @@ extern int bio_add_page(struct bio *, struct page *, unsigned int,unsigned int);
 extern int bio_get_nr_vecs(struct block_device *);
 extern struct bio *bio_map_user(struct request_queue *, struct block_device *,
 				unsigned long, unsigned int, int);
-extern void bio_unmap_user(struct bio *, int);
+extern void bio_unmap_user(struct bio *);
 extern void bio_set_pages_dirty(struct bio *bio);
 extern void bio_check_pages_dirty(struct bio *bio);
+extern struct bio *bio_copy_user(struct request_queue *, unsigned long, unsigned int, int);
+extern int bio_uncopy_user(struct bio *);
 
 #ifdef CONFIG_HIGHMEM
 /*
diff --git a/include/linux/bitmap.h b/include/linux/bitmap.h
index c301d121c..9dadd08e2 100644
--- a/include/linux/bitmap.h
+++ b/include/linux/bitmap.h
@@ -3,49 +3,249 @@
 
 #ifndef __ASSEMBLY__
 
-#include <linux/config.h>
-#include <linux/compiler.h>
 #include <linux/types.h>
-#include <linux/kernel.h>
 #include <linux/bitops.h>
 #include <linux/string.h>
 
-int bitmap_empty(const unsigned long *bitmap, int bits);
-int bitmap_full(const unsigned long *bitmap, int bits);
-int bitmap_equal(const unsigned long *bitmap1,
-			unsigned long *bitmap2, int bits);
-void bitmap_complement(unsigned long *bitmap, int bits);
+/*
+ * bitmaps provide bit arrays that consume one or more unsigned
+ * longs.  The bitmap interface and available operations are listed
+ * here, in bitmap.h
+ *
+ * Function implementations generic to all architectures are in
+ * lib/bitmap.c.  Functions implementations that are architecture
+ * specific are in various include/asm-<arch>/bitops.h headers
+ * and other arch/<arch> specific files.
+ *
+ * See lib/bitmap.c for more details.
+ */
 
-static inline void bitmap_zero(unsigned long *bitmap, int bits)
+/*
+ * The available bitmap operations and their rough meaning in the
+ * case that the bitmap is a single unsigned long are thus:
+ *
+ * bitmap_zero(dst, nbits)			*dst = 0UL
+ * bitmap_fill(dst, nbits)			*dst = ~0UL
+ * bitmap_copy(dst, src, nbits)			*dst = *src
+ * bitmap_and(dst, src1, src2, nbits)		*dst = *src1 & *src2
+ * bitmap_or(dst, src1, src2, nbits)		*dst = *src1 | *src2
+ * bitmap_xor(dst, src1, src2, nbits)		*dst = *src1 ^ *src2
+ * bitmap_andnot(dst, src1, src2, nbits)	*dst = *src1 & ~(*src2)
+ * bitmap_complement(dst, src, nbits)		*dst = ~(*src)
+ * bitmap_equal(src1, src2, nbits)		Are *src1 and *src2 equal?
+ * bitmap_intersects(src1, src2, nbits) 	Do *src1 and *src2 overlap?
+ * bitmap_subset(src1, src2, nbits)		Is *src1 a subset of *src2?
+ * bitmap_empty(src, nbits)			Are all bits zero in *src?
+ * bitmap_full(src, nbits)			Are all bits set in *src?
+ * bitmap_weight(src, nbits)			Hamming Weight: number set bits
+ * bitmap_shift_right(dst, src, n, nbits)	*dst = *src >> n
+ * bitmap_shift_left(dst, src, n, nbits)	*dst = *src << n
+ * bitmap_scnprintf(buf, len, src, nbits)	Print bitmap src to buf
+ * bitmap_parse(ubuf, ulen, dst, nbits)		Parse bitmap dst from buf
+ */
+
+/*
+ * Also the following operations in asm/bitops.h apply to bitmaps.
+ *
+ * set_bit(bit, addr)			*addr |= bit
+ * clear_bit(bit, addr)			*addr &= ~bit
+ * change_bit(bit, addr)		*addr ^= bit
+ * test_bit(bit, addr)			Is bit set in *addr?
+ * test_and_set_bit(bit, addr)		Set bit and return old value
+ * test_and_clear_bit(bit, addr)	Clear bit and return old value
+ * test_and_change_bit(bit, addr)	Change bit and return old value
+ * find_first_zero_bit(addr, nbits)	Position first zero bit in *addr
+ * find_first_bit(addr, nbits)		Position first set bit in *addr
+ * find_next_zero_bit(addr, nbits, bit)	Position next zero bit in *addr >= bit
+ * find_next_bit(addr, nbits, bit)	Position next set bit in *addr >= bit
+ */
+
+/*
+ * The DECLARE_BITMAP(name,bits) macro, in linux/types.h, can be used
+ * to declare an array named 'name' of just enough unsigned longs to
+ * contain all bit positions from 0 to 'bits' - 1.
+ */
+
+/*
+ * lib/bitmap.c provides these functions:
+ */
+
+extern int __bitmap_empty(const unsigned long *bitmap, int bits);
+extern int __bitmap_full(const unsigned long *bitmap, int bits);
+extern int __bitmap_equal(const unsigned long *bitmap1,
+                	const unsigned long *bitmap2, int bits);
+extern void __bitmap_complement(unsigned long *dst, const unsigned long *src,
+			int bits);
+extern void __bitmap_shift_right(unsigned long *dst,
+                        const unsigned long *src, int shift, int bits);
+extern void __bitmap_shift_left(unsigned long *dst,
+                        const unsigned long *src, int shift, int bits);
+extern void __bitmap_and(unsigned long *dst, const unsigned long *bitmap1,
+			const unsigned long *bitmap2, int bits);
+extern void __bitmap_or(unsigned long *dst, const unsigned long *bitmap1,
+			const unsigned long *bitmap2, int bits);
+extern void __bitmap_xor(unsigned long *dst, const unsigned long *bitmap1,
+			const unsigned long *bitmap2, int bits);
+extern void __bitmap_andnot(unsigned long *dst, const unsigned long *bitmap1,
+			const unsigned long *bitmap2, int bits);
+extern int __bitmap_intersects(const unsigned long *bitmap1,
+			const unsigned long *bitmap2, int bits);
+extern int __bitmap_subset(const unsigned long *bitmap1,
+			const unsigned long *bitmap2, int bits);
+extern int __bitmap_weight(const unsigned long *bitmap, int bits);
+
+extern int bitmap_scnprintf(char *buf, unsigned int len,
+			const unsigned long *src, int nbits);
+extern int bitmap_parse(const char __user *ubuf, unsigned int ulen,
+			unsigned long *dst, int nbits);
+
+#define BITMAP_LAST_WORD_MASK(nbits)					\
+(									\
+	((nbits) % BITS_PER_LONG) ?					\
+		(1UL<<((nbits) % BITS_PER_LONG))-1 : ~0UL		\
+)
+
+static inline void bitmap_zero(unsigned long *dst, int nbits)
 {
-	memset(bitmap, 0, BITS_TO_LONGS(bits)*sizeof(unsigned long));
+	if (nbits <= BITS_PER_LONG)
+		*dst = 0UL;
+	else {
+		int len = BITS_TO_LONGS(nbits) * sizeof(unsigned long);
+		memset(dst, 0, len);
+	}
 }
 
-static inline void bitmap_fill(unsigned long *bitmap, int bits)
+static inline void bitmap_fill(unsigned long *dst, int nbits)
 {
-	memset(bitmap, 0xff, BITS_TO_LONGS(bits)*sizeof(unsigned long));
+	size_t nlongs = BITS_TO_LONGS(nbits);
+	if (nlongs > 1) {
+		int len = (nlongs - 1) * sizeof(unsigned long);
+		memset(dst, 0xff,  len);
+	}
+	dst[nlongs - 1] = BITMAP_LAST_WORD_MASK(nbits);
 }
 
-static inline void bitmap_copy(unsigned long *dst,
-			const unsigned long *src, int bits)
+static inline void bitmap_copy(unsigned long *dst, const unsigned long *src,
+			int nbits)
 {
-	int len = BITS_TO_LONGS(bits)*sizeof(unsigned long);
-	memcpy(dst, src, len);
+	if (nbits <= BITS_PER_LONG)
+		*dst = *src;
+	else {
+		int len = BITS_TO_LONGS(nbits) * sizeof(unsigned long);
+		memcpy(dst, src, len);
+	}
 }
 
-void bitmap_shift_right(unsigned long *dst,
-			const unsigned long *src, int shift, int bits);
-void bitmap_shift_left(unsigned long *dst,
-			const unsigned long *src, int shift, int bits);
-void bitmap_and(unsigned long *dst, const unsigned long *bitmap1,
-			const unsigned long *bitmap2, int bits);
-void bitmap_or(unsigned long *dst, const unsigned long *bitmap1,
-			const unsigned long *bitmap2, int bits);
-int bitmap_weight(const unsigned long *bitmap, int bits);
-int bitmap_scnprintf(char *buf, unsigned int buflen,
-			const unsigned long *maskp, int bits);
-int bitmap_parse(const char __user *ubuf, unsigned int ubuflen,
-			unsigned long *maskp, int bits);
+static inline void bitmap_and(unsigned long *dst, const unsigned long *src1,
+			const unsigned long *src2, int nbits)
+{
+	if (nbits <= BITS_PER_LONG)
+		*dst = *src1 & *src2;
+	else
+		__bitmap_and(dst, src1, src2, nbits);
+}
+
+static inline void bitmap_or(unsigned long *dst, const unsigned long *src1,
+			const unsigned long *src2, int nbits)
+{
+	if (nbits <= BITS_PER_LONG)
+		*dst = *src1 | *src2;
+	else
+		__bitmap_or(dst, src1, src2, nbits);
+}
+
+static inline void bitmap_xor(unsigned long *dst, const unsigned long *src1,
+			const unsigned long *src2, int nbits)
+{
+	if (nbits <= BITS_PER_LONG)
+		*dst = *src1 ^ *src2;
+	else
+		__bitmap_xor(dst, src1, src2, nbits);
+}
+
+static inline void bitmap_andnot(unsigned long *dst, const unsigned long *src1,
+			const unsigned long *src2, int nbits)
+{
+	if (nbits <= BITS_PER_LONG)
+		*dst = *src1 & ~(*src2);
+	else
+		__bitmap_andnot(dst, src1, src2, nbits);
+}
+
+static inline void bitmap_complement(unsigned long *dst, const unsigned long *src,
+			int nbits)
+{
+	if (nbits <= BITS_PER_LONG)
+		*dst = ~(*src) & BITMAP_LAST_WORD_MASK(nbits);
+	else
+		__bitmap_complement(dst, src, nbits);
+}
+
+static inline int bitmap_equal(const unsigned long *src1,
+			const unsigned long *src2, int nbits)
+{
+	if (nbits <= BITS_PER_LONG)
+		return ! ((*src1 ^ *src2) & BITMAP_LAST_WORD_MASK(nbits));
+	else
+		return __bitmap_equal(src1, src2, nbits);
+}
+
+static inline int bitmap_intersects(const unsigned long *src1,
+			const unsigned long *src2, int nbits)
+{
+	if (nbits <= BITS_PER_LONG)
+		return ((*src1 & *src2) & BITMAP_LAST_WORD_MASK(nbits)) != 0;
+	else
+		return __bitmap_intersects(src1, src2, nbits);
+}
+
+static inline int bitmap_subset(const unsigned long *src1,
+			const unsigned long *src2, int nbits)
+{
+	if (nbits <= BITS_PER_LONG)
+		return ! ((*src1 & ~(*src2)) & BITMAP_LAST_WORD_MASK(nbits));
+	else
+		return __bitmap_subset(src1, src2, nbits);
+}
+
+static inline int bitmap_empty(const unsigned long *src, int nbits)
+{
+	if (nbits <= BITS_PER_LONG)
+		return ! (*src & BITMAP_LAST_WORD_MASK(nbits));
+	else
+		return __bitmap_empty(src, nbits);
+}
+
+static inline int bitmap_full(const unsigned long *src, int nbits)
+{
+	if (nbits <= BITS_PER_LONG)
+		return ! (~(*src) & BITMAP_LAST_WORD_MASK(nbits));
+	else
+		return __bitmap_full(src, nbits);
+}
+
+static inline int bitmap_weight(const unsigned long *src, int nbits)
+{
+	return __bitmap_weight(src, nbits);
+}
+
+static inline void bitmap_shift_right(unsigned long *dst,
+			const unsigned long *src, int n, int nbits)
+{
+	if (nbits <= BITS_PER_LONG)
+		*dst = *src >> n;
+	else
+		__bitmap_shift_right(dst, src, n, nbits);
+}
+
+static inline void bitmap_shift_left(unsigned long *dst,
+			const unsigned long *src, int n, int nbits)
+{
+	if (nbits <= BITS_PER_LONG)
+		*dst = (*src << n) & BITMAP_LAST_WORD_MASK(nbits);
+	else
+		__bitmap_shift_left(dst, src, n, nbits);
+}
 
 #endif /* __ASSEMBLY__ */
 
diff --git a/include/linux/blkdev.h b/include/linux/blkdev.h
index fae1c4dca..eb4d10be7 100644
--- a/include/linux/blkdev.h
+++ b/include/linux/blkdev.h
@@ -517,14 +517,14 @@ extern int blk_remove_plug(request_queue_t *);
 extern void blk_recount_segments(request_queue_t *, struct bio *);
 extern int blk_phys_contig_segment(request_queue_t *q, struct bio *, struct bio *);
 extern int blk_hw_contig_segment(request_queue_t *q, struct bio *, struct bio *);
-extern int scsi_cmd_ioctl(struct gendisk *, unsigned int, void __user *);
+extern int scsi_cmd_ioctl(struct file *, struct gendisk *, unsigned int, void __user *);
 extern void blk_start_queue(request_queue_t *q);
 extern void blk_stop_queue(request_queue_t *q);
 extern void __blk_stop_queue(request_queue_t *q);
 extern void blk_run_queue(request_queue_t *);
 extern void blk_queue_activity_fn(request_queue_t *, activity_fn *, void *);
 extern struct request *blk_rq_map_user(request_queue_t *, int, void __user *, unsigned int);
-extern int blk_rq_unmap_user(struct request *, void __user *, struct bio *, unsigned int);
+extern int blk_rq_unmap_user(struct request *, struct bio *, unsigned int);
 extern int blk_execute_rq(request_queue_t *, struct gendisk *, struct request *);
 
 static inline request_queue_t *bdev_get_queue(struct block_device *bdev)
@@ -592,6 +592,7 @@ extern struct backing_dev_info *blk_get_backing_dev_info(struct block_device *bd
 extern int blk_rq_map_sg(request_queue_t *, struct request *, struct scatterlist *);
 extern void blk_dump_rq_flags(struct request *, char *);
 extern void generic_unplug_device(request_queue_t *);
+extern void __generic_unplug_device(request_queue_t *);
 extern long nr_blockdev_pages(void);
 
 int blk_get_queue(request_queue_t *);
diff --git a/include/linux/blockgroup_lock.h b/include/linux/blockgroup_lock.h
index 87a890c4a..0137ee5dd 100644
--- a/include/linux/blockgroup_lock.h
+++ b/include/linux/blockgroup_lock.h
@@ -1,3 +1,5 @@
+#ifndef _LINUX_BLOCKGROUP_LOCK_H
+#define _LINUX_BLOCKGROUP_LOCK_H
 /*
  * Per-blockgroup locking for ext2 and ext3.
  *
@@ -55,4 +57,4 @@ static inline void bgl_lock_init(struct blockgroup_lock *bgl)
 #define sb_bgl_lock(sb, block_group) \
 	(&(sb)->s_blockgroup_lock.locks[(block_group) & (NR_BG_LOCKS-1)].lock)
 
-
+#endif
diff --git a/include/linux/bootmem.h b/include/linux/bootmem.h
index 690272469..e038f9a3d 100644
--- a/include/linux/bootmem.h
+++ b/include/linux/bootmem.h
@@ -67,4 +67,12 @@ extern void * __init __alloc_bootmem_node (pg_data_t *pgdat, unsigned long size,
 	__alloc_bootmem_node((pgdat), (x), PAGE_SIZE, 0)
 #endif /* !CONFIG_HAVE_ARCH_BOOTMEM_NODE */
 
+extern void *__init alloc_large_system_hash(const char *tablename,
+					    unsigned long bucketsize,
+					    unsigned long numentries,
+					    int scale,
+					    int consider_highmem,
+					    unsigned int *_hash_shift,
+					    unsigned int *_hash_mask);
+
 #endif /* _LINUX_BOOTMEM_H */
diff --git a/include/linux/byteorder/swab.h b/include/linux/byteorder/swab.h
index 02ad0b524..2f1cb7751 100644
--- a/include/linux/byteorder/swab.h
+++ b/include/linux/byteorder/swab.h
@@ -134,7 +134,7 @@ static __inline__ __attribute_const__ __u16 __fswab16(__u16 x)
 {
 	return __arch__swab16(x);
 }
-static __inline__ __u16 __swab16p(__u16 *x)
+static __inline__ __u16 __swab16p(const __u16 *x)
 {
 	return __arch__swab16p(x);
 }
@@ -147,7 +147,7 @@ static __inline__ __attribute_const__ __u32 __fswab32(__u32 x)
 {
 	return __arch__swab32(x);
 }
-static __inline__ __u32 __swab32p(__u32 *x)
+static __inline__ __u32 __swab32p(const __u32 *x)
 {
 	return __arch__swab32p(x);
 }
@@ -167,7 +167,7 @@ static __inline__ __attribute_const__ __u64 __fswab64(__u64 x)
 	return __arch__swab64(x);
 #  endif
 }
-static __inline__ __u64 __swab64p(__u64 *x)
+static __inline__ __u64 __swab64p(const __u64 *x)
 {
 	return __arch__swab64p(x);
 }
diff --git a/include/linux/capi.h b/include/linux/capi.h
index 501ea6d59..fdebaaa9f 100644
--- a/include/linux/capi.h
+++ b/include/linux/capi.h
@@ -77,7 +77,7 @@ typedef struct capi_profile {
 
 typedef struct capi_manufacturer_cmd {
 	unsigned long cmd;
-	void *data;
+	void __user *data;
 } capi_manufacturer_cmd;
 
 /*
diff --git a/include/linux/cciss_ioctl.h b/include/linux/cciss_ioctl.h
index 22b342ef9..ee0c6e899 100644
--- a/include/linux/cciss_ioctl.h
+++ b/include/linux/cciss_ioctl.h
@@ -206,7 +206,35 @@ typedef struct _LogvolInfo_struct{
 #define CCISS_REGNEWDISK  _IOW(CCISS_IOC_MAGIC, 13, int)
 
 #define CCISS_REGNEWD	   _IO(CCISS_IOC_MAGIC, 14)
+#define CCISS_RESCANDISK   _IO(CCISS_IOC_MAGIC, 16)
 #define CCISS_GETLUNINFO   _IOR(CCISS_IOC_MAGIC, 17, LogvolInfo_struct)
 #define CCISS_BIG_PASSTHRU _IOWR(CCISS_IOC_MAGIC, 18, BIG_IOCTL_Command_struct)
 
+#ifdef __KERNEL__
+#ifdef CONFIG_COMPAT
+
+/* 32 bit compatible ioctl structs */
+typedef struct _IOCTL32_Command_struct {
+  LUNAddr_struct	   LUN_info;
+  RequestBlock_struct      Request;
+  ErrorInfo_struct  	   error_info;
+  WORD			   buf_size;  /* size in bytes of the buf */
+  __u32			   buf; /* 32 bit pointer to data buffer */
+} IOCTL32_Command_struct;
+
+typedef struct _BIG_IOCTL32_Command_struct {
+  LUNAddr_struct	   LUN_info;
+  RequestBlock_struct      Request;
+  ErrorInfo_struct  	   error_info;
+  DWORD			   malloc_size; /* < MAX_KMALLOC_SIZE in cciss.c */
+  DWORD			   buf_size;    /* size in bytes of the buf */
+  				        /* < malloc_size * MAXSGENTRIES */
+  __u32 		buf;	/* 32 bit pointer to data buffer */
+} BIG_IOCTL32_Command_struct;
+
+#define CCISS_PASSTHRU32   _IOWR(CCISS_IOC_MAGIC, 11, IOCTL32_Command_struct)
+#define CCISS_BIG_PASSTHRU32 _IOWR(CCISS_IOC_MAGIC, 18, BIG_IOCTL32_Command_struct)
+
+#endif /* CONFIG_COMPAT */
+#endif /* __KERNEL__ */
 #endif  
diff --git a/include/linux/cd1400.h b/include/linux/cd1400.h
index 69f9730eb..1dc3ab052 100644
--- a/include/linux/cd1400.h
+++ b/include/linux/cd1400.h
@@ -3,7 +3,7 @@
 /*
  *	cd1400.h  -- cd1400 UART hardware info.
  *
- *	Copyright (C) 1996-1998  Stallion Technologies (support@stallion.oz.au).
+ *	Copyright (C) 1996-1998  Stallion Technologies
  *	Copyright (C) 1994-1996  Greg Ungerer.
  *
  *	This program is free software; you can redistribute it and/or modify
diff --git a/include/linux/cdk.h b/include/linux/cdk.h
index b7576643d..0908daf7b 100644
--- a/include/linux/cdk.h
+++ b/include/linux/cdk.h
@@ -3,7 +3,7 @@
 /*
  *	cdk.h  -- CDK interface definitions.
  *
- *	Copyright (C) 1996-1998  Stallion Technologies (support@stallion.oz.au).
+ *	Copyright (C) 1996-1998  Stallion Technologies
  *	Copyright (C) 1994-1996  Greg Ungerer.
  *
  *	This program is free software; you can redistribute it and/or modify
diff --git a/include/linux/cdrom.h b/include/linux/cdrom.h
index 282e9b793..0e46b2d0d 100644
--- a/include/linux/cdrom.h
+++ b/include/linux/cdrom.h
@@ -984,8 +984,8 @@ struct cdrom_device_ops {
 extern int cdrom_open(struct cdrom_device_info *cdi, struct inode *ip,
 			struct file *fp);
 extern int cdrom_release(struct cdrom_device_info *cdi, struct file *fp);
-extern int cdrom_ioctl(struct cdrom_device_info *cdi, struct inode *ip,
-		unsigned int cmd, unsigned long arg);
+extern int cdrom_ioctl(struct file *file, struct cdrom_device_info *cdi,
+		struct inode *ip, unsigned int cmd, unsigned long arg);
 extern int cdrom_media_changed(struct cdrom_device_info *);
 
 extern int register_cdrom(struct cdrom_device_info *cdi);
diff --git a/include/linux/coda_proc.h b/include/linux/coda_proc.h
index 5bf752163..c061a22ed 100644
--- a/include/linux/coda_proc.h
+++ b/include/linux/coda_proc.h
@@ -82,10 +82,10 @@ void reset_coda_cache_inv_stats( void );
  * data structure for /proc/sys/... files 
  */
 int do_reset_coda_vfs_stats( ctl_table * table, int write, struct file * filp,
-			     void __user * buffer, size_t * lenp );
+			     void __user * buffer, size_t * lenp, loff_t * ppos );
 int do_reset_coda_cache_inv_stats( ctl_table * table, int write, 
 				   struct file * filp, void __user * buffer, 
-				   size_t * lenp );
+				   size_t * lenp, loff_t * ppos );
 
 /* these functions are called to form the content of /proc/fs/coda/... files */
 int coda_vfs_stats_get_info( char * buffer, char ** start, off_t offset,
diff --git a/include/linux/compat_ioctl.h b/include/linux/compat_ioctl.h
index 356590d44..f8159ddb6 100644
--- a/include/linux/compat_ioctl.h
+++ b/include/linux/compat_ioctl.h
@@ -640,6 +640,10 @@ COMPATIBLE_IOCTL(CMTPCONNADD)
 COMPATIBLE_IOCTL(CMTPCONNDEL)
 COMPATIBLE_IOCTL(CMTPGETCONNLIST)
 COMPATIBLE_IOCTL(CMTPGETCONNINFO)
+COMPATIBLE_IOCTL(HIDPCONNADD)
+COMPATIBLE_IOCTL(HIDPCONNDEL)
+COMPATIBLE_IOCTL(HIDPGETCONNLIST)
+COMPATIBLE_IOCTL(HIDPGETCONNINFO)
 /* CAPI */
 COMPATIBLE_IOCTL(CAPI_REGISTER)
 COMPATIBLE_IOCTL(CAPI_GET_MANUFACTURER)
diff --git a/include/linux/compiler-gcc+.h b/include/linux/compiler-gcc+.h
index 94e677887..5629cf5cd 100644
--- a/include/linux/compiler-gcc+.h
+++ b/include/linux/compiler-gcc+.h
@@ -13,3 +13,4 @@
 #define __attribute_used__	__attribute__((__used__))
 #define __attribute_pure__	__attribute__((pure))
 #define __attribute_const__	__attribute__((__const__))
+#define __must_check 		__attribute__((warn_unused_result))
diff --git a/include/linux/compiler-gcc3.h b/include/linux/compiler-gcc3.h
index 265dad4c3..7965ae53d 100644
--- a/include/linux/compiler-gcc3.h
+++ b/include/linux/compiler-gcc3.h
@@ -25,3 +25,6 @@
 #if __GNUC_MINOR__ >= 1
 #define  noinline __attribute__((noinline))
 #endif
+#if __GNUC_MINOR__ >= 4
+#define __must_check __attribute__((warn_unused_result))
+#endif
diff --git a/include/linux/compiler.h b/include/linux/compiler.h
index 151ab34a5..22d83706f 100644
--- a/include/linux/compiler.h
+++ b/include/linux/compiler.h
@@ -69,6 +69,10 @@ extern void __chk_user_ptr(void __user *);
 # define __deprecated		/* unimplemented */
 #endif
 
+#ifndef __must_check
+#define __must_check
+#endif
+
 /*
  * Allow us to avoid 'defined but not used' warnings on functions and data,
  * as well as force them to be emitted to the assembly file.
diff --git a/include/linux/comstats.h b/include/linux/comstats.h
index 84ef9b2b0..3f5ea8e80 100644
--- a/include/linux/comstats.h
+++ b/include/linux/comstats.h
@@ -3,7 +3,7 @@
 /*
  *	comstats.h  -- Serial Port Stats.
  *
- *	Copyright (C) 1996-1998  Stallion Technologies (support@stallion.oz.au).
+ *	Copyright (C) 1996-1998  Stallion Technologies
  *	Copyright (C) 1994-1996  Greg Ungerer.
  *
  *	This program is free software; you can redistribute it and/or modify
diff --git a/include/linux/console.h b/include/linux/console.h
index c8a8fe4f2..d5077755f 100644
--- a/include/linux/console.h
+++ b/include/linux/console.h
@@ -19,6 +19,7 @@
 
 struct vc_data;
 struct console_font_op;
+struct console_font;
 struct module;
 
 /*
@@ -40,7 +41,10 @@ struct consw {
 	void	(*con_bmove)(struct vc_data *, int, int, int, int, int, int);
 	int	(*con_switch)(struct vc_data *);
 	int	(*con_blank)(struct vc_data *, int, int);
-	int	(*con_font_op)(struct vc_data *, struct console_font_op *);
+	int	(*con_font_set)(struct vc_data *, struct console_font *, unsigned);
+	int	(*con_font_get)(struct vc_data *, struct console_font *);
+	int	(*con_font_default)(struct vc_data *, struct console_font *, char *);
+	int	(*con_font_copy)(struct vc_data *, int);
 	int	(*con_resize)(struct vc_data *, unsigned int, unsigned int);
 	int	(*con_set_palette)(struct vc_data *, unsigned char *);
 	int	(*con_scrolldelta)(struct vc_data *, int);
@@ -104,6 +108,9 @@ extern void acquire_console_sem(void);
 extern void release_console_sem(void);
 extern void console_conditional_schedule(void);
 extern void console_unblank(void);
+extern struct tty_driver *console_device(int *);
+extern void console_stop(struct console *);
+extern void console_start(struct console *);
 extern int is_console_locked(void);
 
 /* Some debug stub to catch some of the obvious races in the VT code */
diff --git a/include/linux/console_struct.h b/include/linux/console_struct.h
index df81e37a9..a9a2a4862 100644
--- a/include/linux/console_struct.h
+++ b/include/linux/console_struct.h
@@ -40,7 +40,7 @@ struct vc_data {
 	unsigned long	vc_pos;			/* Cursor address */
 	/* fonts */	
 	unsigned short	vc_hi_font_mask;	/* [#] Attribute set for upper 256 chars of font or 0 if not supported */
-	struct console_font_op vc_font;		/* Current VC font set */
+	struct console_font vc_font;		/* Current VC font set */
 	unsigned short	vc_video_erase_char;	/* Background erase character */
 	/* VT terminal data */
 	unsigned int	vc_state;		/* Escape sequence parser state */
diff --git a/include/linux/cpu.h b/include/linux/cpu.h
index 2c3d97fc5..5925e83d9 100644
--- a/include/linux/cpu.h
+++ b/include/linux/cpu.h
@@ -27,6 +27,7 @@
 
 struct cpu {
 	int node_id;		/* The node which contains the CPU */
+	int no_control;		/* Should the sysfs control file be created? */
 	struct sys_device sysdev;
 };
 
diff --git a/include/linux/cpumask.h b/include/linux/cpumask.h
index 4293a465d..7109aa6e5 100644
--- a/include/linux/cpumask.h
+++ b/include/linux/cpumask.h
@@ -1,56 +1,376 @@
 #ifndef __LINUX_CPUMASK_H
 #define __LINUX_CPUMASK_H
 
+/*
+ * Cpumasks provide a bitmap suitable for representing the
+ * set of CPU's in a system, one bit position per CPU number.
+ *
+ * See detailed comments in the file linux/bitmap.h describing the
+ * data type on which these cpumasks are based.
+ *
+ * For details of cpumask_scnprintf() and cpumask_parse(),
+ * see bitmap_scnprintf() and bitmap_parse() in lib/bitmap.c.
+ *
+ * The available cpumask operations are:
+ *
+ * void cpu_set(cpu, mask)		turn on bit 'cpu' in mask
+ * void cpu_clear(cpu, mask)		turn off bit 'cpu' in mask
+ * void cpus_setall(mask)		set all bits
+ * void cpus_clear(mask)		clear all bits
+ * int cpu_isset(cpu, mask)		true iff bit 'cpu' set in mask
+ * int cpu_test_and_set(cpu, mask)	test and set bit 'cpu' in mask
+ *
+ * void cpus_and(dst, src1, src2)	dst = src1 & src2  [intersection]
+ * void cpus_or(dst, src1, src2)	dst = src1 | src2  [union]
+ * void cpus_xor(dst, src1, src2)	dst = src1 ^ src2
+ * void cpus_andnot(dst, src1, src2)	dst = src1 & ~src2
+ * void cpus_complement(dst, src)	dst = ~src
+ *
+ * int cpus_equal(mask1, mask2)		Does mask1 == mask2?
+ * int cpus_intersects(mask1, mask2)	Do mask1 and mask2 intersect?
+ * int cpus_subset(mask1, mask2)	Is mask1 a subset of mask2?
+ * int cpus_empty(mask)			Is mask empty (no bits sets)?
+ * int cpus_full(mask)			Is mask full (all bits sets)?
+ * int cpus_weight(mask)		Hamming weigh - number of set bits
+ *
+ * void cpus_shift_right(dst, src, n)	Shift right
+ * void cpus_shift_left(dst, src, n)	Shift left
+ *
+ * int first_cpu(mask)			Number lowest set bit, or NR_CPUS
+ * int next_cpu(cpu, mask)		Next cpu past 'cpu', or NR_CPUS
+ *
+ * cpumask_t cpumask_of_cpu(cpu)	Return cpumask with bit 'cpu' set
+ * CPU_MASK_ALL				Initializer - all bits set
+ * CPU_MASK_NONE			Initializer - no bits set
+ * unsigned long *cpus_addr(mask)	Array of unsigned long's in mask
+ *
+ * int cpumask_scnprintf(buf, len, mask) Format cpumask for printing
+ * int cpumask_parse(ubuf, ulen, mask)	Parse ascii string as cpumask
+ *
+ * for_each_cpu_mask(cpu, mask)		for-loop cpu over mask
+ *
+ * int num_online_cpus()		Number of online CPUs
+ * int num_possible_cpus()		Number of all possible CPUs
+ * int num_present_cpus()		Number of present CPUs
+ *
+ * int cpu_online(cpu)			Is some cpu online?
+ * int cpu_possible(cpu)		Is some cpu possible?
+ * int cpu_present(cpu)			Is some cpu present (can schedule)?
+ *
+ * int any_online_cpu(mask)		First online cpu in mask
+ *
+ * for_each_cpu(cpu)			for-loop cpu over cpu_possible_map
+ * for_each_online_cpu(cpu)		for-loop cpu over cpu_online_map
+ * for_each_present_cpu(cpu)		for-loop cpu over cpu_present_map
+ *
+ * Subtlety:
+ * 1) The 'type-checked' form of cpu_isset() causes gcc (3.3.2, anyway)
+ *    to generate slightly worse code.  Note for example the additional
+ *    40 lines of assembly code compiling the "for each possible cpu"
+ *    loops buried in the disk_stat_read() macros calls when compiling
+ *    drivers/block/genhd.c (arch i386, CONFIG_SMP=y).  So use a simple
+ *    one-line #define for cpu_isset(), instead of wrapping an inline
+ *    inside a macro, the way we do the other calls.
+ */
+
 #include <linux/threads.h>
 #include <linux/bitmap.h>
-#include <asm/cpumask.h>
 #include <asm/bug.h>
 
-#ifdef CONFIG_SMP
+typedef struct { DECLARE_BITMAP(bits, NR_CPUS); } cpumask_t;
+extern cpumask_t _unused_cpumask_arg_;
 
-extern cpumask_t cpu_online_map;
-extern cpumask_t cpu_possible_map;
-extern cpumask_t cpu_present_map;
+#define cpu_set(cpu, dst) __cpu_set((cpu), &(dst))
+static inline void __cpu_set(int cpu, volatile cpumask_t *dstp)
+{
+	set_bit(cpu, dstp->bits);
+}
+
+#define cpu_clear(cpu, dst) __cpu_clear((cpu), &(dst))
+static inline void __cpu_clear(int cpu, volatile cpumask_t *dstp)
+{
+	clear_bit(cpu, dstp->bits);
+}
+
+#define cpus_setall(dst) __cpus_setall(&(dst), NR_CPUS)
+static inline void __cpus_setall(cpumask_t *dstp, int nbits)
+{
+	bitmap_fill(dstp->bits, nbits);
+}
+
+#define cpus_clear(dst) __cpus_clear(&(dst), NR_CPUS)
+static inline void __cpus_clear(cpumask_t *dstp, int nbits)
+{
+	bitmap_zero(dstp->bits, nbits);
+}
+
+/* No static inline type checking - see Subtlety (1) above. */
+#define cpu_isset(cpu, cpumask) test_bit((cpu), (cpumask).bits)
+
+#define cpu_test_and_set(cpu, cpumask) __cpu_test_and_set((cpu), &(cpumask))
+static inline int __cpu_test_and_set(int cpu, cpumask_t *addr)
+{
+	return test_and_set_bit(cpu, addr->bits);
+}
+
+#define cpus_and(dst, src1, src2) __cpus_and(&(dst), &(src1), &(src2), NR_CPUS)
+static inline void __cpus_and(cpumask_t *dstp, const cpumask_t *src1p,
+					const cpumask_t *src2p, int nbits)
+{
+	bitmap_and(dstp->bits, src1p->bits, src2p->bits, nbits);
+}
+
+#define cpus_or(dst, src1, src2) __cpus_or(&(dst), &(src1), &(src2), NR_CPUS)
+static inline void __cpus_or(cpumask_t *dstp, const cpumask_t *src1p,
+					const cpumask_t *src2p, int nbits)
+{
+	bitmap_or(dstp->bits, src1p->bits, src2p->bits, nbits);
+}
+
+#define cpus_xor(dst, src1, src2) __cpus_xor(&(dst), &(src1), &(src2), NR_CPUS)
+static inline void __cpus_xor(cpumask_t *dstp, const cpumask_t *src1p,
+					const cpumask_t *src2p, int nbits)
+{
+	bitmap_xor(dstp->bits, src1p->bits, src2p->bits, nbits);
+}
+
+#define cpus_andnot(dst, src1, src2) \
+				__cpus_andnot(&(dst), &(src1), &(src2), NR_CPUS)
+static inline void __cpus_andnot(cpumask_t *dstp, const cpumask_t *src1p,
+					const cpumask_t *src2p, int nbits)
+{
+	bitmap_andnot(dstp->bits, src1p->bits, src2p->bits, nbits);
+}
+
+#define cpus_complement(dst, src) __cpus_complement(&(dst), &(src), NR_CPUS)
+static inline void __cpus_complement(cpumask_t *dstp,
+					const cpumask_t *srcp, int nbits)
+{
+	bitmap_complement(dstp->bits, srcp->bits, nbits);
+}
+
+#define cpus_equal(src1, src2) __cpus_equal(&(src1), &(src2), NR_CPUS)
+static inline int __cpus_equal(const cpumask_t *src1p,
+					const cpumask_t *src2p, int nbits)
+{
+	return bitmap_equal(src1p->bits, src2p->bits, nbits);
+}
+
+#define cpus_intersects(src1, src2) __cpus_intersects(&(src1), &(src2), NR_CPUS)
+static inline int __cpus_intersects(const cpumask_t *src1p,
+					const cpumask_t *src2p, int nbits)
+{
+	return bitmap_intersects(src1p->bits, src2p->bits, nbits);
+}
+
+#define cpus_subset(src1, src2) __cpus_subset(&(src1), &(src2), NR_CPUS)
+static inline int __cpus_subset(const cpumask_t *src1p,
+					const cpumask_t *src2p, int nbits)
+{
+	return bitmap_subset(src1p->bits, src2p->bits, nbits);
+}
+
+#define cpus_empty(src) __cpus_empty(&(src), NR_CPUS)
+static inline int __cpus_empty(const cpumask_t *srcp, int nbits)
+{
+	return bitmap_empty(srcp->bits, nbits);
+}
+
+#define cpus_full(cpumask) __cpus_full(&(cpumask), NR_CPUS)
+static inline int __cpus_full(const cpumask_t *srcp, int nbits)
+{
+	return bitmap_full(srcp->bits, nbits);
+}
+
+#define cpus_weight(cpumask) __cpus_weight(&(cpumask), NR_CPUS)
+static inline int __cpus_weight(const cpumask_t *srcp, int nbits)
+{
+	return bitmap_weight(srcp->bits, nbits);
+}
+
+#define cpus_shift_right(dst, src, n) \
+			__cpus_shift_right(&(dst), &(src), (n), NR_CPUS)
+static inline void __cpus_shift_right(cpumask_t *dstp,
+					const cpumask_t *srcp, int n, int nbits)
+{
+	bitmap_shift_right(dstp->bits, srcp->bits, n, nbits);
+}
 
-#define num_online_cpus()		cpus_weight(cpu_online_map)
-#define num_possible_cpus()		cpus_weight(cpu_possible_map)
-#define num_present_cpus()		cpus_weight(cpu_present_map)
+#define cpus_shift_left(dst, src, n) \
+			__cpus_shift_left(&(dst), &(src), (n), NR_CPUS)
+static inline void __cpus_shift_left(cpumask_t *dstp,
+					const cpumask_t *srcp, int n, int nbits)
+{
+	bitmap_shift_left(dstp->bits, srcp->bits, n, nbits);
+}
 
-#define cpu_online(cpu)			cpu_isset(cpu, cpu_online_map)
-#define cpu_possible(cpu)		cpu_isset(cpu, cpu_possible_map)
-#define cpu_present(cpu)		cpu_isset(cpu, cpu_present_map)
+#define first_cpu(src) __first_cpu(&(src), NR_CPUS)
+static inline int __first_cpu(const cpumask_t *srcp, int nbits)
+{
+	return find_first_bit(srcp->bits, nbits);
+}
 
-#define for_each_cpu_mask(cpu, mask)					\
-	for (cpu = first_cpu_const(mk_cpumask_const(mask));		\
-		cpu < NR_CPUS;						\
-		cpu = next_cpu_const(cpu, mk_cpumask_const(mask)))
+#define next_cpu(n, src) __next_cpu((n), &(src), NR_CPUS)
+static inline int __next_cpu(int n, const cpumask_t *srcp, int nbits)
+{
+	return find_next_bit(srcp->bits, nbits, n+1);
+}
+
+#define cpumask_of_cpu(cpu)						\
+({									\
+	typeof(_unused_cpumask_arg_) m;					\
+	if (sizeof(m) == sizeof(unsigned long)) {			\
+		m.bits[0] = 1UL<<(cpu);					\
+	} else {							\
+		cpus_clear(m);						\
+		cpu_set((cpu), m);					\
+	}								\
+	m;								\
+})
+
+#define CPU_MASK_LAST_WORD BITMAP_LAST_WORD_MASK(NR_CPUS)
+
+#if NR_CPUS <= BITS_PER_LONG
+
+#define CPU_MASK_ALL							\
+((cpumask_t) { {							\
+	[BITS_TO_LONGS(NR_CPUS)-1] = CPU_MASK_LAST_WORD			\
+} })
+
+#else
+
+#define CPU_MASK_ALL							\
+((cpumask_t) { {							\
+	[0 ... BITS_TO_LONGS(NR_CPUS)-2] = ~0UL,			\
+	[BITS_TO_LONGS(NR_CPUS)-1] = CPU_MASK_LAST_WORD			\
+} })
+
+#endif
+
+#define CPU_MASK_NONE							\
+((cpumask_t) { {							\
+	[0 ... BITS_TO_LONGS(NR_CPUS)-1] =  0UL				\
+} })
+
+#define CPU_MASK_CPU0							\
+((cpumask_t) { {							\
+	[0] =  1UL							\
+} })
+
+#define cpus_addr(src) ((src).bits)
+
+#define cpumask_scnprintf(buf, len, src) \
+			__cpumask_scnprintf((buf), (len), &(src), NR_CPUS)
+static inline int __cpumask_scnprintf(char *buf, int len,
+					const cpumask_t *srcp, int nbits)
+{
+	return bitmap_scnprintf(buf, len, srcp->bits, nbits);
+}
+
+#define cpumask_parse(ubuf, ulen, src) \
+			__cpumask_parse((ubuf), (ulen), &(src), NR_CPUS)
+static inline int __cpumask_parse(const char __user *buf, int len,
+					cpumask_t *dstp, int nbits)
+{
+	return bitmap_parse(buf, len, dstp->bits, nbits);
+}
+
+#if NR_CPUS > 1
+#define for_each_cpu_mask(cpu, mask)		\
+	for ((cpu) = first_cpu(mask);		\
+		(cpu) < NR_CPUS;		\
+		(cpu) = next_cpu((cpu), (mask)))
+#else /* NR_CPUS == 1 */
+#define for_each_cpu_mask(cpu, mask) for ((cpu) = 0; (cpu) < 1; (cpu)++)
+#endif /* NR_CPUS */
+
+/*
+ * The following particular system cpumasks and operations manage
+ * possible, present and online cpus.  Each of them is a fixed size
+ * bitmap of size NR_CPUS.
+ *
+ *  #ifdef CONFIG_HOTPLUG_CPU
+ *     cpu_possible_map - all NR_CPUS bits set
+ *     cpu_present_map  - has bit 'cpu' set iff cpu is populated
+ *     cpu_online_map   - has bit 'cpu' set iff cpu available to scheduler
+ *  #else
+ *     cpu_possible_map - has bit 'cpu' set iff cpu is populated
+ *     cpu_present_map  - copy of cpu_possible_map
+ *     cpu_online_map   - has bit 'cpu' set iff cpu available to scheduler
+ *  #endif
+ *
+ *  In either case, NR_CPUS is fixed at compile time, as the static
+ *  size of these bitmaps.  The cpu_possible_map is fixed at boot
+ *  time, as the set of CPU id's that it is possible might ever
+ *  be plugged in at anytime during the life of that system boot.
+ *  The cpu_present_map is dynamic(*), representing which CPUs
+ *  are currently plugged in.  And cpu_online_map is the dynamic
+ *  subset of cpu_present_map, indicating those CPUs available
+ *  for scheduling.
+ *
+ *  If HOTPLUG is enabled, then cpu_possible_map is forced to have
+ *  all NR_CPUS bits set, otherwise it is just the set of CPUs that
+ *  ACPI reports present at boot.
+ *
+ *  If HOTPLUG is enabled, then cpu_present_map varies dynamically,
+ *  depending on what ACPI reports as currently plugged in, otherwise
+ *  cpu_present_map is just a copy of cpu_possible_map.
+ *
+ *  (*) Well, cpu_present_map is dynamic in the hotplug case.  If not
+ *      hotplug, it's a copy of cpu_possible_map, hence fixed at boot.
+ *
+ * Subtleties:
+ * 1) UP arch's (NR_CPUS == 1, CONFIG_SMP not defined) hardcode
+ *    assumption that their single CPU is online.  The UP
+ *    cpu_{online,possible,present}_maps are placebos.  Changing them
+ *    will have no useful affect on the following num_*_cpus()
+ *    and cpu_*() macros in the UP case.  This ugliness is a UP
+ *    optimization - don't waste any instructions or memory references
+ *    asking if you're online or how many CPUs there are if there is
+ *    only one CPU.
+ * 2) Most SMP arch's #define some of these maps to be some
+ *    other map specific to that arch.  Therefore, the following
+ *    must be #define macros, not inlines.  To see why, examine
+ *    the assembly code produced by the following.  Note that
+ *    set1() writes phys_x_map, but set2() writes x_map:
+ *        int x_map, phys_x_map;
+ *        #define set1(a) x_map = a
+ *        inline void set2(int a) { x_map = a; }
+ *        #define x_map phys_x_map
+ *        main(){ set1(3); set2(5); }
+ */
+
+extern cpumask_t cpu_possible_map;
+extern cpumask_t cpu_online_map;
+extern cpumask_t cpu_present_map;
 
-#define for_each_cpu(cpu) for_each_cpu_mask(cpu, cpu_possible_map)
-#define for_each_online_cpu(cpu) for_each_cpu_mask(cpu, cpu_online_map)
-#define for_each_present_cpu(cpu) for_each_cpu_mask(cpu, cpu_present_map)
+#if NR_CPUS > 1
+#define num_online_cpus()	cpus_weight(cpu_online_map)
+#define num_possible_cpus()	cpus_weight(cpu_possible_map)
+#define num_present_cpus()	cpus_weight(cpu_present_map)
+#define cpu_online(cpu)		cpu_isset((cpu), cpu_online_map)
+#define cpu_possible(cpu)	cpu_isset((cpu), cpu_possible_map)
+#define cpu_present(cpu)	cpu_isset((cpu), cpu_present_map)
 #else
-#define	cpu_online_map			cpumask_of_cpu(0)
-#define	cpu_possible_map		cpumask_of_cpu(0)
-#define	cpu_present_map			cpumask_of_cpu(0)
-
-#define num_online_cpus()		1
-#define num_possible_cpus()		1
-#define num_present_cpus()		1
-
-#define cpu_online(cpu)			({ BUG_ON((cpu) != 0); 1; })
-#define cpu_possible(cpu)		({ BUG_ON((cpu) != 0); 1; })
-#define cpu_present(cpu)		({ BUG_ON((cpu) != 0); 1; })
-
-#define for_each_cpu_mask(cpu, mask) for (cpu = 0; cpu < 1; cpu++)
-#define for_each_cpu(cpu) for (cpu = 0; cpu < 1; cpu++)
-#define for_each_online_cpu(cpu) for (cpu = 0; cpu < 1; cpu++)
-#define for_each_present_cpu(cpu) for (cpu = 0; cpu < 1; cpu++)
+#define num_online_cpus()	1
+#define num_possible_cpus()	1
+#define num_present_cpus()	1
+#define cpu_online(cpu)		((cpu) == 0)
+#define cpu_possible(cpu)	((cpu) == 0)
+#define cpu_present(cpu)	((cpu) == 0)
 #endif
 
-#define cpumask_scnprintf(buf, buflen, map)				\
-	bitmap_scnprintf(buf, buflen, cpus_addr(map), NR_CPUS)
+#define any_online_cpu(mask)			\
+({						\
+	int cpu;				\
+	for_each_cpu_mask(cpu, (mask))		\
+		if (cpu_online(cpu))		\
+			break;			\
+	cpu;					\
+})
 
-#define cpumask_parse(buf, buflen, map)					\
-	bitmap_parse(buf, buflen, cpus_addr(map), NR_CPUS)
+#define for_each_cpu(cpu)	  for_each_cpu_mask((cpu), cpu_possible_map)
+#define for_each_online_cpu(cpu)  for_each_cpu_mask((cpu), cpu_online_map)
+#define for_each_present_cpu(cpu) for_each_cpu_mask((cpu), cpu_present_map)
 
 #endif /* __LINUX_CPUMASK_H */
diff --git a/include/linux/dcache.h b/include/linux/dcache.h
index 72f48658a..66e273284 100644
--- a/include/linux/dcache.h
+++ b/include/linux/dcache.h
@@ -313,6 +313,8 @@ static inline int d_mountpoint(struct dentry *dentry)
 extern struct vfsmount *lookup_mnt(struct vfsmount *, struct dentry *);
 extern struct dentry *lookup_create(struct nameidata *nd, int is_dir);
 
+extern int sysctl_vfs_cache_pressure;
+
 #endif /* __KERNEL__ */
 
 #endif	/* __LINUX_DCACHE_H */
diff --git a/include/linux/dcookies.h b/include/linux/dcookies.h
index b2ae9692d..c28050136 100644
--- a/include/linux/dcookies.h
+++ b/include/linux/dcookies.h
@@ -50,7 +50,7 @@ int get_dcookie(struct dentry * dentry, struct vfsmount * vfsmnt,
 
 struct dcookie_user * dcookie_register(void)
 {
-	return 0;
+	return NULL;
 }
 
 void dcookie_unregister(struct dcookie_user * user)
diff --git a/include/linux/device.h b/include/linux/device.h
index 2b8b3d636..49d3865aa 100644
--- a/include/linux/device.h
+++ b/include/linux/device.h
@@ -54,6 +54,10 @@ struct bus_type {
 	struct kset		drivers;
 	struct kset		devices;
 
+	struct bus_attribute	* bus_attrs;
+	struct device_attribute	* dev_attrs;
+	struct driver_attribute	* drv_attrs;
+
 	int		(*match)(struct device * dev, struct device_driver * drv);
 	struct device * (*add)	(struct device * parent, char * bus_id);
 	int		(*hotplug) (struct device *dev, char **envp, 
@@ -90,11 +94,7 @@ struct bus_attribute {
 };
 
 #define BUS_ATTR(_name,_mode,_show,_store)	\
-struct bus_attribute bus_attr_##_name = { 		\
-	.attr = {.name = __stringify(_name), .mode = _mode, .owner = THIS_MODULE },	\
-	.show	= _show,				\
-	.store	= _store,				\
-};
+struct bus_attribute bus_attr_##_name = __ATTR(_name,_mode,_show,_store)
 
 extern int bus_create_file(struct bus_type *, struct bus_attribute *);
 extern void bus_remove_file(struct bus_type *, struct bus_attribute *);
@@ -120,6 +120,7 @@ extern void driver_unregister(struct device_driver * drv);
 
 extern struct device_driver * get_driver(struct device_driver * drv);
 extern void put_driver(struct device_driver * drv);
+extern struct device_driver *driver_find(const char *name, struct bus_type *bus);
 
 
 /* driverfs interface for exporting driver attributes */
@@ -131,11 +132,7 @@ struct driver_attribute {
 };
 
 #define DRIVER_ATTR(_name,_mode,_show,_store)	\
-struct driver_attribute driver_attr_##_name = { 		\
-	.attr = {.name = __stringify(_name), .mode = _mode, .owner = THIS_MODULE },	\
-	.show	= _show,				\
-	.store	= _store,				\
-};
+struct driver_attribute driver_attr_##_name = __ATTR(_name,_mode,_show,_store)
 
 extern int driver_create_file(struct device_driver *, struct driver_attribute *);
 extern void driver_remove_file(struct device_driver *, struct driver_attribute *);
@@ -151,6 +148,9 @@ struct class {
 	struct list_head	children;
 	struct list_head	interfaces;
 
+	struct class_attribute		* class_attrs;
+	struct class_device_attribute	* class_dev_attrs;
+
 	int	(*hotplug)(struct class_device *dev, char **envp, 
 			   int num_envp, char *buffer, int buffer_size);
 
@@ -172,11 +172,7 @@ struct class_attribute {
 };
 
 #define CLASS_ATTR(_name,_mode,_show,_store)			\
-struct class_attribute class_attr_##_name = { 			\
-	.attr = {.name = __stringify(_name), .mode = _mode, .owner = THIS_MODULE },	\
-	.show	= _show,					\
-	.store	= _store,					\
-};
+struct class_attribute class_attr_##_name = __ATTR(_name,_mode,_show,_store) 
 
 extern int class_create_file(struct class *, const struct class_attribute *);
 extern void class_remove_file(struct class *, const struct class_attribute *);
@@ -224,11 +220,8 @@ struct class_device_attribute {
 };
 
 #define CLASS_DEVICE_ATTR(_name,_mode,_show,_store)		\
-struct class_device_attribute class_device_attr_##_name = { 	\
-	.attr = {.name = __stringify(_name), .mode = _mode, .owner = THIS_MODULE },	\
-	.show	= _show,					\
-	.store	= _store,					\
-};
+struct class_device_attribute class_device_attr_##_name = 	\
+	__ATTR(_name,_mode,_show,_store)
 
 extern int class_device_create_file(struct class_device *, 
 				    const struct class_device_attribute *);
@@ -342,11 +335,7 @@ struct device_attribute {
 };
 
 #define DEVICE_ATTR(_name,_mode,_show,_store) \
-struct device_attribute dev_attr_##_name = { 		\
-	.attr = {.name = __stringify(_name), .mode = _mode, .owner = THIS_MODULE },	\
-	.show	= _show,				\
-	.store	= _store,				\
-};
+struct device_attribute dev_attr_##_name = __ATTR(_name,_mode,_show,_store)
 
 
 extern int device_create_file(struct device *device, struct device_attribute * entry);
@@ -390,6 +379,12 @@ extern void platform_device_unregister(struct platform_device *);
 extern struct bus_type platform_bus_type;
 extern struct device platform_bus;
 
+extern struct resource *platform_get_resource(struct platform_device *, unsigned int, unsigned int);
+extern int platform_get_irq(struct platform_device *, unsigned int);
+extern int platform_add_devices(struct platform_device **, int);
+
+extern struct platform_device *platform_device_register_simple(char *, unsigned int, struct resource *, unsigned int);
+
 /* drivers/base/power.c */
 extern void device_shutdown(void);
 
diff --git a/include/linux/devpts_fs.h b/include/linux/devpts_fs.h
index b672ddc00..5f8269936 100644
--- a/include/linux/devpts_fs.h
+++ b/include/linux/devpts_fs.h
@@ -30,5 +30,7 @@ static inline void devpts_pty_kill(int number) { }
 
 #endif
 
+#define DEVPTS_SUPER_MAGIC 0x1cd1
+
 
 #endif /* _LINUX_DEVPTS_FS_H */
diff --git a/include/linux/dma-mapping.h b/include/linux/dma-mapping.h
index 2c0f0b593..43f6c726c 100644
--- a/include/linux/dma-mapping.h
+++ b/include/linux/dma-mapping.h
@@ -19,6 +19,8 @@ enum dma_data_direction {
 #define dma_sync_single		dma_sync_single_for_cpu
 #define dma_sync_sg		dma_sync_sg_for_cpu
 
+extern u64 dma_get_required_mask(struct device *dev);
+
 #endif
 
 
diff --git a/include/linux/dvb/osd.h b/include/linux/dvb/osd.h
index 0d8143960..cdaff25ec 100644
--- a/include/linux/dvb/osd.h
+++ b/include/linux/dvb/osd.h
@@ -24,6 +24,8 @@
 #ifndef _DVBOSD_H_
 #define _DVBOSD_H_
 
+#include <linux/compiler.h>
+
 typedef enum {
   // All functions return -2 on "not open"
   OSD_Close=1,    // ()
@@ -101,7 +103,7 @@ typedef struct osd_cmd_s {
         int x1;
         int y1;
         int color;
-        void *data;
+        void __user *data;
 } osd_cmd_t;
 
 
diff --git a/include/linux/dvb/video.h b/include/linux/dvb/video.h
index 09a4286fb..2ed5d7bc4 100644
--- a/include/linux/dvb/video.h
+++ b/include/linux/dvb/video.h
@@ -24,6 +24,8 @@
 #ifndef _DVBVIDEO_H_
 #define _DVBVIDEO_H_
 
+#include <linux/compiler.h>
+
 #ifdef __KERNEL__
 #include <linux/types.h>
 #else
@@ -100,7 +102,7 @@ struct video_status {
 
 
 struct video_still_picture {
-        char *iFrame;        /* pointer to a single iframe in memory */
+        char __user *iFrame;        /* pointer to a single iframe in memory */
         int32_t size; 
 };
 
diff --git a/include/linux/edd.h b/include/linux/edd.h
index b3b36e283..5f9388110 100644
--- a/include/linux/edd.h
+++ b/include/linux/edd.h
@@ -1,6 +1,6 @@
 /*
  * linux/include/linux/edd.h
- *  Copyright (C) 2002, 2003 Dell Inc.
+ *  Copyright (C) 2002, 2003, 2004 Dell Inc.
  *  by Matt Domsch <Matt_Domsch@dell.com>
  *
  * structures and definitions for the int 13h, ax={41,48}h
@@ -9,8 +9,8 @@
  * available at http://www.t13.org/docs2002/d1572r0.pdf.  It is
  * very similar to D1484 Revision 3 http://www.t13.org/docs2002/d1484r3.pdf
  *
- * In a nutshell, arch/{i386,x86_64}/boot/setup.S populates a scratch table
- * in the empty_zero_block that contains a list of BIOS-enumerated
+ * In a nutshell, arch/{i386,x86_64}/boot/setup.S populates a scratch
+ * table in the boot_params that contains a list of BIOS-enumerated
  * boot devices.
  * In arch/{i386,x86_64}/kernel/setup.c, this information is
  * transferred into the edd structure, and in drivers/firmware/edd.c, that
@@ -31,8 +31,8 @@
 #define _LINUX_EDD_H
 
 #define EDDNR 0x1e9		/* addr of number of edd_info structs at EDDBUF
-				   in empty_zero_block - treat this as 1 byte  */
-#define EDDBUF	0x600		/* addr of edd_info structs in empty_zero_block */
+				   in boot_params - treat this as 1 byte  */
+#define EDDBUF	0x600		/* addr of edd_info structs in boot_params */
 #define EDDMAXNR 6		/* number of edd_info structs starting at EDDBUF  */
 #define EDDEXTSIZE 8		/* change these if you muck with the structures */
 #define EDDPARMSIZE 74
@@ -42,9 +42,13 @@
 #define EDDMAGIC1 0x55AA
 #define EDDMAGIC2 0xAA55
 
-#define READ_SECTORS 0x02
-#define MBR_SIG_OFFSET 0x1B8
-#define DISK80_SIG_BUFFER 0x2cc
+
+#define READ_SECTORS 0x02         /* int13 AH=0x02 is READ_SECTORS command */
+#define EDD_MBR_SIG_OFFSET 0x1B8  /* offset of signature in the MBR */
+#define EDD_MBR_SIG_BUF    0x290  /* addr in boot params */
+#define EDD_MBR_SIG_MAX 16        /* max number of signatures to store */
+#define EDD_MBR_SIG_NR_BUF 0x1ea  /* addr of number of MBR signtaures at EDD_MBR_SIG_BUF
+				     in boot_params - treat this as 1 byte  */
 #ifndef __ASSEMBLY__
 
 #define EDD_EXT_FIXED_DISK_ACCESS           (1 << 0)
@@ -172,9 +176,14 @@ struct edd_info {
 	struct edd_device_params params;
 } __attribute__ ((packed));
 
-extern struct edd_info edd[EDDMAXNR];
-extern unsigned char eddnr;
-extern unsigned int edd_disk80_sig;
+struct edd {
+	unsigned int mbr_signature[EDD_MBR_SIG_MAX];
+	struct edd_info edd_info[EDDMAXNR];
+	unsigned char mbr_signature_nr;
+	unsigned char edd_info_nr;
+};
+
+extern struct edd edd;
 
 #endif				/*!__ASSEMBLY__ */
 
diff --git a/include/linux/efi.h b/include/linux/efi.h
index b6b470e99..0c5c94ab1 100644
--- a/include/linux/efi.h
+++ b/include/linux/efi.h
@@ -108,7 +108,7 @@ typedef struct {
 #endif
 } efi_memory_desc_t;
 
-typedef int efi_freemem_callback_t (unsigned long start, unsigned long end, void *arg);
+typedef int (*efi_freemem_callback_t) (unsigned long start, unsigned long end, void *arg);
 
 /*
  * Types and defines for Time Services
@@ -305,6 +305,10 @@ extern unsigned long __init efi_get_time(void);
 extern int __init efi_set_rtc_mmss(unsigned long nowtime);
 extern struct efi_memory_map memmap;
 
+#ifdef CONFIG_EFI_PCDP
+extern void __init efi_setup_pcdp_console(char *);
+#endif
+
 /*
  * We play games with efi_enabled so that the compiler will, if possible, remove
  * EFI-related code altogether.
diff --git a/include/linux/elf.h b/include/linux/elf.h
index f8115ac02..8d0dd82cc 100644
--- a/include/linux/elf.h
+++ b/include/linux/elf.h
@@ -4,6 +4,13 @@
 #include <linux/types.h>
 #include <asm/elf.h>
 
+#ifndef elf_read_implies_exec
+  /* Executables for which elf_read_implies_exec() returns TRUE will
+     have the READ_IMPLIES_EXEC personality flag set automatically.
+     Override in asm/elf.h as needed.  */
+# define elf_read_implies_exec(ex, have_pt_gnu_stack)	0
+#endif
+
 /* 32-bit ELF base types. */
 typedef __u32	Elf32_Addr;
 typedef __u16	Elf32_Half;
diff --git a/include/linux/errqueue.h b/include/linux/errqueue.h
index 0d87e62ec..174582fed 100644
--- a/include/linux/errqueue.h
+++ b/include/linux/errqueue.h
@@ -22,6 +22,10 @@ struct sock_extended_err
 #ifdef __KERNEL__
 
 #include <linux/config.h>
+#include <net/ip.h>
+#if defined(CONFIG_IPV6) || defined (CONFIG_IPV6_MODULE)
+#include <linux/ipv6.h>
+#endif
 
 #define SKB_EXT_ERR(skb) ((struct sock_exterr_skb *) ((skb)->cb))
 
diff --git a/include/linux/ext3_fs.h b/include/linux/ext3_fs.h
index 27449a4a2..9a5137606 100644
--- a/include/linux/ext3_fs.h
+++ b/include/linux/ext3_fs.h
@@ -696,6 +696,7 @@ extern void ext3_check_blocks_bitmap (struct super_block *);
 extern struct ext3_group_desc * ext3_get_group_desc(struct super_block * sb,
 						    unsigned int block_group,
 						    struct buffer_head ** bh);
+extern int ext3_should_retry_alloc(struct super_block *sb, int *retries);
 
 /* dir.c */
 extern int ext3_check_dir_entry(const char *, struct inode *,
diff --git a/include/linux/fb.h b/include/linux/fb.h
index 84f0fe1a4..9186883fc 100644
--- a/include/linux/fb.h
+++ b/include/linux/fb.h
@@ -16,7 +16,11 @@
 #define FBIOGETCMAP		0x4604
 #define FBIOPUTCMAP		0x4605
 #define FBIOPAN_DISPLAY		0x4606
+#ifdef __KERNEL__
+#define FBIO_CURSOR            _IOWR('F', 0x08, struct fb_cursor_user)
+#else
 #define FBIO_CURSOR            _IOWR('F', 0x08, struct fb_cursor)
+#endif
 /* 0x4607-0x460B are defined below */
 /* #define FBIOGET_MONITORSPEC	0x460C */
 /* #define FBIOPUT_MONITORSPEC	0x460D */
@@ -125,7 +129,8 @@ struct fb_fix_screeninfo {
 	unsigned long mmio_start;	/* Start of Memory Mapped I/O   */
 					/* (physical address) */
 	__u32 mmio_len;			/* Length of Memory Mapped I/O  */
-	__u32 accel;			/* Type of acceleration available */
+	__u32 accel;			/* Indicate to driver which	*/
+					/*  specific chip/card we have	*/
 	__u16 reserved[3];		/* Reserved for future compatibility */
 };
 
@@ -154,7 +159,7 @@ struct fb_bitfield {
 #define FB_ACTIVATE_ALL	       64	/* change all VCs on this fb	*/
 #define FB_ACTIVATE_FORCE     128	/* force apply even when no change*/
 
-#define FB_ACCELF_TEXT		1	/* text mode acceleration */
+#define FB_ACCELF_TEXT		1	/* (OBSOLETE) see fb_info.flags and vc_mode */
 
 #define FB_SYNC_HOR_HIGH_ACT	1	/* horizontal sync high active	*/
 #define FB_SYNC_VERT_HIGH_ACT	2	/* vertical sync high active	*/
@@ -200,7 +205,7 @@ struct fb_var_screeninfo {
 	__u32 height;			/* height of picture in mm    */
 	__u32 width;			/* width of picture in mm     */
 
-	__u32 accel_flags;		/* acceleration flags (hints)	*/
+	__u32 accel_flags;		/* (OBSOLETE) see fb_info.flags */
 
 	/* Timing: All values in pixclocks, except pixclock (of course) */
 	__u32 pixclock;			/* pixel clock in ps (pico seconds) */
@@ -375,7 +380,7 @@ struct fb_cursor {
 	__u16 set;		/* what to set */
 	__u16 enable;		/* cursor on/off */
 	__u16 rop;		/* bitop operation */
-	char *mask;		/* cursor mask bits */
+	const char *mask;	/* cursor mask bits */
 	struct fbcurpos hot;	/* cursor hot spot */
 	struct fb_image	image;	/* Cursor image */
 };
@@ -396,6 +401,36 @@ struct fb_info;
 struct device;
 struct file;
 
+struct fb_cmap_user {
+	__u32 start;			/* First entry	*/
+	__u32 len;			/* Number of entries */
+	__u16 __user *red;		/* Red values	*/
+	__u16 __user *green;
+	__u16 __user *blue;
+	__u16 __user *transp;		/* transparency, can be NULL */
+};
+
+struct fb_image_user {
+	__u32 dx;			/* Where to place image */
+	__u32 dy;
+	__u32 width;			/* Size of image */
+	__u32 height;
+	__u32 fg_color;			/* Only used when a mono bitmap */
+	__u32 bg_color;
+	__u8  depth;			/* Depth of the image */
+	const char __user *data;	/* Pointer to image data */
+	struct fb_cmap_user cmap;	/* color map info */
+};
+
+struct fb_cursor_user {
+	__u16 set;			/* what to set */
+	__u16 enable;			/* cursor on/off */
+	__u16 rop;			/* bitop operation */
+	const char __user *mask;	/* cursor mask bits */
+	struct fbcurpos hot;		/* cursor hot spot */
+	struct fb_image_user image;	/* Cursor image */
+};
+
 /*
  * Register/unregister for framebuffer events
  */
@@ -458,8 +493,8 @@ struct fb_ops {
 	/* For framebuffers with strange non linear layouts or that do not
 	 * work with normal memory mapped access
 	 */
-	ssize_t (*fb_read)(struct file *file, char *buf, size_t count, loff_t *ppos);
-	ssize_t (*fb_write)(struct file *file, const char *buf, size_t count, loff_t *ppos);
+	ssize_t (*fb_read)(struct file *file, char __user *buf, size_t count, loff_t *ppos);
+	ssize_t (*fb_write)(struct file *file, const char __user *buf, size_t count, loff_t *ppos);
 
 	/* checks var and eventually tweaks it to something supported,
 	 * DO NOT MODIFY PAR */
@@ -502,15 +537,47 @@ struct fb_ops {
 	int (*fb_mmap)(struct fb_info *info, struct file *file, struct vm_area_struct *vma);
 };
 
+/* FBINFO_* = fb_info.flags bit flags */
+#define FBINFO_MODULE		0x0001	/* Low-level driver is a module */
+#define FBINFO_HWACCEL_DISABLED	0x0002
+	/* When FBINFO_HWACCEL_DISABLED is set:
+	 *  Hardware acceleration is turned off.  Software implementations
+	 *  of required functions (copyarea(), fillrect(), and imageblit())
+	 *  takes over; acceleration engine should be in a quiescent state */
+
+/* hints */
+#define FBINFO_PARTIAL_PAN_OK	0x0040 /* otw use pan only for double-buffering */
+#define FBINFO_READS_FAST	0x0080 /* soft-copy faster than rendering */
+
+/* hardware supported ops */
+/*  semantics: when a bit is set, it indicates that the operation is
+ *   accelerated by hardware.
+ *  required functions will still work even if the bit is not set.
+ *  optional functions may not even exist if the flag bit is not set.
+ */
+#define FBINFO_HWACCEL_NONE		0x0000
+#define FBINFO_HWACCEL_COPYAREA		0x0100 /* required */
+#define FBINFO_HWACCEL_FILLRECT		0x0200 /* required */
+#define FBINFO_HWACCEL_IMAGEBLIT	0x0400 /* required */
+#define FBINFO_HWACCEL_ROTATE		0x0800 /* optional */
+#define FBINFO_HWACCEL_XPAN		0x1000 /* optional */
+#define FBINFO_HWACCEL_YPAN		0x2000 /* optional */
+#define FBINFO_HWACCEL_YWRAP		0x4000 /* optional */
+
+#define FBINFO_MISC_MODECHANGEUSER     0x10000 /* mode change request
+						  from userspace */
+#define FBINFO_MISC_MODESWITCH         0x20000 /* mode switch */
+#define FBINFO_MISC_MODESWITCHLATE     0x40000 /* init hardware later */
+
 struct fb_info {
 	int node;
 	int flags;
-#define FBINFO_FLAG_MODULE	1	/* Low-level driver is a module */
 	struct fb_var_screeninfo var;	/* Current var */
 	struct fb_fix_screeninfo fix;	/* Current fix */
 	struct fb_monspecs monspecs;	/* Current Monitor specs */
 	struct fb_cursor cursor;	/* Current cursor */	
 	struct work_struct queue;	/* Framebuffer event queue */
+	struct timer_list cursor_timer; /* Cursor timer */
 	struct fb_pixmap pixmap;	/* Image hardware mapper */
 	struct fb_pixmap sprite;	/* Cursor hardware mapper */
 	struct fb_cmap cmap;		/* Current cmap */
@@ -527,11 +594,23 @@ struct fb_info {
 };
 
 #ifdef MODULE
-#define FBINFO_FLAG_DEFAULT	FBINFO_FLAG_MODULE
+#define FBINFO_DEFAULT	FBINFO_MODULE
 #else
-#define FBINFO_FLAG_DEFAULT	0
+#define FBINFO_DEFAULT	0
 #endif
 
+// This will go away
+#define FBINFO_FLAG_MODULE	FBINFO_MODULE
+#define FBINFO_FLAG_DEFAULT	FBINFO_DEFAULT
+
+/* This will go away
+ * fbset currently hacks in FB_ACCELF_TEXT into var.accel_flags
+ * when it wants to turn the acceleration engine on.  This is
+ * really a separate operation, and should be modified via sysfs.
+ *  But for now, we leave it broken with the following define
+ */
+#define STUPID_ACCELF_TEXT_SHIT
+
 // This will go away
 #if defined(__sparc__)
 
@@ -550,7 +629,7 @@ struct fb_info {
 #define fb_writeq sbus_writeq
 #define fb_memset sbus_memset_io
 
-#elif defined(__i386__) || defined(__alpha__) || defined(__x86_64__) || defined(__hppa__) || defined(__sh__) || defined(__powerpc__)
+#elif defined(__i386__) || defined(__alpha__) || defined(__x86_64__) || defined(__hppa__) || (defined(__sh__) && !defined(__SH5__)) || defined(__powerpc__)
 
 #define fb_readb __raw_readb
 #define fb_readw __raw_readw
@@ -594,10 +673,16 @@ extern int unregister_framebuffer(struct fb_info *fb_info);
 extern int fb_prepare_logo(struct fb_info *fb_info);
 extern int fb_show_logo(struct fb_info *fb_info);
 extern char* fb_get_buffer_offset(struct fb_info *info, struct fb_pixmap *buf, u32 size);
-extern void fb_move_buf_unaligned(struct fb_info *info, struct fb_pixmap *buf,
+extern void fb_iomove_buf_unaligned(struct fb_info *info, struct fb_pixmap *buf,
+				u8 *dst, u32 d_pitch, u8 *src, u32 idx,
+				u32 height, u32 shift_high, u32 shift_low, u32 mod);
+extern void fb_iomove_buf_aligned(struct fb_info *info, struct fb_pixmap *buf,
+				u8 *dst, u32 d_pitch, u8 *src, u32 s_pitch,
+				u32 height);
+extern void fb_sysmove_buf_unaligned(struct fb_info *info, struct fb_pixmap *buf,
 				u8 *dst, u32 d_pitch, u8 *src, u32 idx,
 				u32 height, u32 shift_high, u32 shift_low, u32 mod);
-extern void fb_move_buf_aligned(struct fb_info *info, struct fb_pixmap *buf,
+extern void fb_sysmove_buf_aligned(struct fb_info *info, struct fb_pixmap *buf,
 				u8 *dst, u32 d_pitch, u8 *src, u32 s_pitch,
 				u32 height);
 extern void fb_load_cursor_image(struct fb_info *);
@@ -645,8 +730,10 @@ extern const struct fb_videomode vesa_modes[];
 /* drivers/video/fbcmap.c */
 extern int fb_alloc_cmap(struct fb_cmap *cmap, int len, int transp);
 extern void fb_dealloc_cmap(struct fb_cmap *cmap);
-extern int fb_copy_cmap(struct fb_cmap *from, struct fb_cmap *to, int fsfromto);
-extern int fb_set_cmap(struct fb_cmap *cmap, int kspc, struct fb_info *fb_info);
+extern int fb_copy_cmap(struct fb_cmap *from, struct fb_cmap *to);
+extern int fb_cmap_to_user(struct fb_cmap *from, struct fb_cmap_user *to);
+extern int fb_set_cmap(struct fb_cmap *cmap, struct fb_info *fb_info);
+extern int fb_set_user_cmap(struct fb_cmap_user *cmap, struct fb_info *fb_info);
 extern struct fb_cmap *fb_default_cmap(int len);
 extern void fb_invert_cmaps(void);
 
diff --git a/include/linux/fd.h b/include/linux/fd.h
index 7ce5f01a4..b6bd41d2b 100644
--- a/include/linux/fd.h
+++ b/include/linux/fd.h
@@ -2,6 +2,7 @@
 #define _LINUX_FD_H
 
 #include <linux/ioctl.h>
+#include <linux/compiler.h>
 
 /* New file layout: Now the ioctl definitions immediately follow the
  * definitions of the structures that they use */
diff --git a/include/linux/filter.h b/include/linux/filter.h
index bfbb7453b..e5234d847 100644
--- a/include/linux/filter.h
+++ b/include/linux/filter.h
@@ -5,6 +5,8 @@
 #ifndef __LINUX_FILTER_H__
 #define __LINUX_FILTER_H__
 
+#include <linux/compiler.h>
+
 /*
  * Current version of the filter code architecture.
  */
@@ -27,7 +29,7 @@ struct sock_filter	/* Filter block */
 struct sock_fprog	/* Required for SO_ATTACH_FILTER. */
 {
 	unsigned short		len;	/* Number of filter blocks */
-	struct sock_filter	*filter;
+	struct sock_filter __user *filter;
 };
 
 #ifdef __KERNEL__
diff --git a/include/linux/fs.h b/include/linux/fs.h
index 71e297368..1e60528ca 100644
--- a/include/linux/fs.h
+++ b/include/linux/fs.h
@@ -75,6 +75,11 @@ extern int leases_enable, dir_notify_enable, lease_break_time;
 #define FMODE_READ 1
 #define FMODE_WRITE 2
 
+/* Internal kernel extensions */
+#define FMODE_LSEEK	4
+#define FMODE_PREAD	8
+#define FMODE_PWRITE	FMODE_PREAD	/* These go hand in hand */
+
 #define RW_MASK		1
 #define RWA_MASK	2
 #define READ 0
@@ -134,15 +139,15 @@ extern int leases_enable, dir_notify_enable, lease_break_time;
 
 #define S_SYNC		1	/* Writes are synced at once */
 #define S_NOATIME	2	/* Do not update access times */
-#define S_QUOTA		4	/* Quota initialized for file */
-#define S_APPEND	8	/* Append-only file */
-#define S_IMMUTABLE	16	/* Immutable file */
-#define S_DEAD		32	/* removed, but still open directory */
-#define S_NOQUOTA	64	/* Inode is not counted to quota */
-#define S_DIRSYNC	128	/* Directory modifications are synchronous */
-#define S_NOCMTIME	256	/* Do not update file c/mtime */
-#define S_BARRIER	512	/* Barrier for chroot() */
-#define S_IUNLINK	1024	/* Immutable unlink */
+#define S_APPEND	4	/* Append-only file */
+#define S_IMMUTABLE	8	/* Immutable file */
+#define S_DEAD		16	/* removed, but still open directory */
+#define S_NOQUOTA	32	/* Inode is not counted to quota */
+#define S_DIRSYNC	64	/* Directory modifications are synchronous */
+#define S_NOCMTIME	128	/* Do not update file c/mtime */
+#define S_SWAPFILE	256	/* Do not truncate: swapon got its bmaps */
+#define S_BARRIER	1024	/* Barrier for chroot() */
+#define S_IUNLINK	2048	/* Immutable unlink */
 
 /*
  * Note that nosuid etc flags are inode-specific: setting some file-system
@@ -166,7 +171,6 @@ extern int leases_enable, dir_notify_enable, lease_break_time;
 					((inode)->i_flags & (S_SYNC|S_DIRSYNC)))
 #define IS_MANDLOCK(inode)	__IS_FLG(inode, MS_MANDLOCK)
 
-#define IS_QUOTAINIT(inode)	((inode)->i_flags & S_QUOTA)
 #define IS_NOQUOTA(inode)	((inode)->i_flags & S_NOQUOTA)
 #define IS_APPEND(inode)	((inode)->i_flags & S_APPEND)
 #define IS_IMMUTABLE(inode)	((inode)->i_flags & S_IMMUTABLE)
@@ -180,6 +184,7 @@ extern int leases_enable, dir_notify_enable, lease_break_time;
 #define IS_BARRIER(inode)	(S_ISDIR((inode)->i_mode) && ((inode)->i_flags & S_BARRIER))
 #define IS_DEADDIR(inode)	((inode)->i_flags & S_DEAD)
 #define IS_NOCMTIME(inode)	((inode)->i_flags & S_NOCMTIME)
+#define IS_SWAPFILE(inode)	((inode)->i_flags & S_SWAPFILE)
 
 /* the read-only stuff doesn't really belong here, but any other place is
    probably as bad and I don't want to create yet another include file. */
@@ -220,15 +225,17 @@ extern int leases_enable, dir_notify_enable, lease_break_time;
 #include <linux/list.h>
 #include <linux/radix-tree.h>
 #include <linux/audit.h>
+#include <linux/init.h>
 #include <asm/semaphore.h>
 #include <asm/byteorder.h>
 
 /* Used to be a macro which just called the function, now just a function */
 extern void update_atime (struct inode *);
 
-extern void inode_init(unsigned long);
-extern void mnt_init(unsigned long);
-extern void files_init(unsigned long);
+extern void __init inode_init(unsigned long);
+extern void __init inode_init_early(void);
+extern void __init mnt_init(unsigned long);
+extern void __init files_init(unsigned long);
 
 struct buffer_head;
 typedef int (get_block_t)(struct inode *inode, sector_t iblock,
@@ -256,7 +263,7 @@ typedef void (dio_iodone_t)(struct inode *inode, loff_t offset,
 #define ATTR_ATTR_FLAG	1024
 #define ATTR_KILL_SUID	2048
 #define ATTR_KILL_SGID	4096
-#define	ATTR_XID	8192
+#define ATTR_XID	8192
 
 /*
  * This is the Inode Attributes structure, used for notify_change().  It
@@ -365,6 +372,7 @@ struct block_device {
 	struct block_device *	bd_contains;
 	unsigned		bd_block_size;
 	struct hd_struct *	bd_part;
+	/* number of times partitions within this device have been opened. */
 	unsigned		bd_part_count;
 	int			bd_invalidated;
 	struct gendisk *	bd_disk;
@@ -669,9 +677,6 @@ extern struct list_head file_lock_list;
 
 #include <linux/fcntl.h>
 
-extern long generic_file_fcntl(int fd, unsigned int cmd,
-				unsigned long arg, struct file *filp);
-
 extern int fcntl_getlk(struct file *, struct flock __user *);
 extern int fcntl_setlk(struct file *, unsigned int, struct flock __user *);
 
@@ -726,6 +731,7 @@ extern int send_sigurg(struct fown_struct *fown);
 
 #define MNT_FORCE	0x00000001	/* Attempt to forcibily umount */
 #define MNT_DETACH	0x00000002	/* Just detach from the tree */
+#define MNT_EXPIRE	0x00000004	/* Mark for expiry */
 
 extern struct list_head super_blocks;
 extern spinlock_t sb_lock;
@@ -861,7 +867,10 @@ struct block_device_operations {
 typedef struct {
 	size_t written;
 	size_t count;
-	char __user * buf;
+	union {
+		char __user * buf;
+		void *data;
+	} arg;
 	int error;
 } read_descriptor_t;
 
@@ -892,11 +901,11 @@ struct file_operations {
 	int (*lock) (struct file *, int, struct file_lock *);
 	ssize_t (*readv) (struct file *, const struct iovec *, unsigned long, loff_t *);
 	ssize_t (*writev) (struct file *, const struct iovec *, unsigned long, loff_t *);
-	ssize_t (*sendfile) (struct file *, loff_t *, size_t, read_actor_t, void __user *);
+	ssize_t (*sendfile) (struct file *, loff_t *, size_t, read_actor_t, void *);
 	ssize_t (*sendpage) (struct file *, struct page *, int, size_t, loff_t *, int);
 	unsigned long (*get_unmapped_area)(struct file *, unsigned long, unsigned long, unsigned long, unsigned long);
-	long (*fcntl)(int fd, unsigned int cmd,
-			unsigned long arg, struct file *filp);
+	int (*check_flags)(int);
+	int (*dir_notify)(struct file *filp, unsigned long arg);
 };
 
 struct inode_operations {
@@ -912,6 +921,7 @@ struct inode_operations {
 			struct inode *, struct dentry *);
 	int (*readlink) (struct dentry *, char __user *,int);
 	int (*follow_link) (struct dentry *, struct nameidata *);
+	void (*put_link) (struct dentry *, struct nameidata *);
 	void (*truncate) (struct inode *);
 	int (*permission) (struct inode *, int, struct nameidata *);
 	int (*setattr) (struct dentry *, struct iattr *);
@@ -989,7 +999,8 @@ static inline void touch_atime(struct vfsmount *mnt, struct dentry *dentry)
 
 static inline void file_accessed(struct file *file)
 {
-	touch_atime(file->f_vfsmnt, file->f_dentry);
+	if (!(file->f_flags & O_NOATIME))
+		touch_atime(file->f_vfsmnt, file->f_dentry);
 }
 
 int sync_inode(struct inode *inode, struct writeback_control *wbc);
@@ -1211,7 +1222,8 @@ extern int filp_close(struct file *, fl_owner_t id);
 extern char * getname(const char __user *);
 
 /* fs/dcache.c */
-extern void vfs_caches_init(unsigned long);
+extern void __init vfs_caches_init_early(void);
+extern void __init vfs_caches_init(unsigned long);
 
 #define __getname()	kmem_cache_alloc(names_cachep, SLAB_KERNEL)
 #define __putname(name) kmem_cache_free(names_cachep, (void *)(name))
@@ -1347,6 +1359,8 @@ extern ino_t find_inode_number(struct dentry *, struct qstr *);
 /* needed for stackable file system support */
 extern loff_t default_llseek(struct file *file, loff_t offset, int origin);
 
+extern loff_t vfs_llseek(struct file *file, loff_t offset, int origin);
+
 extern void inode_init_once(struct inode *);
 extern void iput(struct inode *);
 extern struct inode * igrab(struct inode *);
@@ -1379,6 +1393,8 @@ extern void clear_inode(struct inode *);
 extern void destroy_inode(struct inode *);
 extern struct inode *new_inode(struct super_block *);
 extern int remove_suid(struct dentry *);
+extern void remove_dquot_ref(struct super_block *, int, struct list_head *);
+extern struct semaphore iprune_sem;
 
 extern void __insert_inode_hash(struct inode *, unsigned long hashval);
 extern void remove_inode_hash(struct inode *);
@@ -1412,7 +1428,7 @@ extern ssize_t do_sync_read(struct file *filp, char __user *buf, size_t len, lof
 extern ssize_t do_sync_write(struct file *filp, const char __user *buf, size_t len, loff_t *ppos);
 ssize_t generic_file_write_nolock(struct file *file, const struct iovec *iov,
 				unsigned long nr_segs, loff_t *ppos);
-extern ssize_t generic_file_sendfile(struct file *, loff_t *, size_t, read_actor_t, void __user *);
+extern ssize_t generic_file_sendfile(struct file *, loff_t *, size_t, read_actor_t, void *);
 extern void do_generic_mapping_read(struct address_space *mapping,
 				    struct file_ra_state *, struct file *,
 				    loff_t *, read_descriptor_t *, read_actor_t);
@@ -1428,6 +1444,7 @@ extern loff_t no_llseek(struct file *file, loff_t offset, int origin);
 extern loff_t generic_file_llseek(struct file *file, loff_t offset, int origin);
 extern loff_t remote_llseek(struct file *file, loff_t offset, int origin);
 extern int generic_file_open(struct inode * inode, struct file * filp);
+extern int nonseekable_open(struct inode * inode, struct file * filp);
 
 static inline void do_generic_file_read(struct file * filp, loff_t *ppos,
 					read_descriptor_t * desc,
@@ -1475,8 +1492,11 @@ extern int vfs_readlink(struct dentry *, char __user *, int, const char *);
 extern int vfs_follow_link(struct nameidata *, const char *);
 extern int page_readlink(struct dentry *, char __user *, int);
 extern int page_follow_link(struct dentry *, struct nameidata *);
+extern int page_follow_link_light(struct dentry *, struct nameidata *);
+extern void page_put_link(struct dentry *, struct nameidata *);
 extern int page_symlink(struct inode *inode, const char *symname, int len);
 extern struct inode_operations page_symlink_inode_operations;
+extern int generic_readlink(struct dentry *, char __user *, int);
 extern void generic_fillattr(struct inode *, struct kstat *);
 extern int vfs_getattr(struct vfsmount *, struct dentry *, struct kstat *);
 void inode_add_bytes(struct inode *inode, loff_t bytes);
@@ -1522,8 +1542,10 @@ extern int simple_fill_super(struct super_block *, int, struct tree_descr *);
 extern int simple_pin_fs(char *name, struct vfsmount **mount, int *count);
 extern void simple_release_fs(struct vfsmount **mount, int *count);
 
+extern ssize_t simple_read_from_buffer(void __user *, size_t, loff_t *, const void *, size_t);
+
 extern int inode_change_ok(struct inode *, struct iattr *);
-extern int inode_setattr(struct inode *, struct iattr *);
+extern int __must_check inode_setattr(struct inode *, struct iattr *);
 
 extern void inode_update_time(struct inode *inode, int ctime_too);
 
diff --git a/include/linux/ftape.h b/include/linux/ftape.h
index 5774b1bfc..c6b38d5b9 100644
--- a/include/linux/ftape.h
+++ b/include/linux/ftape.h
@@ -195,7 +195,6 @@ typedef union {
 
 /*      some useful macro's
  */
-#define ABS(a)          ((a) < 0 ? -(a) : (a))
 #define NR_ITEMS(x)     (int)(sizeof(x)/ sizeof(*x))
 
 #endif  /* __KERNEL__ */
diff --git a/include/linux/generic_serial.h b/include/linux/generic_serial.h
index fcd3c18a9..f2bd22edb 100644
--- a/include/linux/generic_serial.h
+++ b/include/linux/generic_serial.h
@@ -88,8 +88,8 @@ void gs_close(struct tty_struct *tty, struct file *filp);
 void gs_set_termios (struct tty_struct * tty, 
                      struct termios * old_termios);
 int  gs_init_port(struct gs_port *port);
-int  gs_setserial(struct gs_port *port, struct serial_struct *sp);
-int  gs_getserial(struct gs_port *port, struct serial_struct *sp);
+int  gs_setserial(struct gs_port *port, struct serial_struct __user *sp);
+int  gs_getserial(struct gs_port *port, struct serial_struct __user *sp);
 void gs_got_break(struct gs_port *port);
 
 extern int gs_debug;
diff --git a/include/linux/genhd.h b/include/linux/genhd.h
index 91443522b..884d18df6 100644
--- a/include/linux/genhd.h
+++ b/include/linux/genhd.h
@@ -82,7 +82,8 @@ struct disk_stats {
 struct gendisk {
 	int major;			/* major number of driver */
 	int first_minor;
-	int minors;
+	int minors;                     /* maximum number of minors, =1 for
+                                         * disks that can't be partitioned. */
 	char disk_name[32];		/* name of major driver */
 	struct hd_struct **part;	/* [indexed by minor] */
 	struct block_device_operations *fops;
diff --git a/include/linux/hpet.h b/include/linux/hpet.h
index 9ab04e988..af4da7d30 100644
--- a/include/linux/hpet.h
+++ b/include/linux/hpet.h
@@ -54,12 +54,6 @@ struct hpet {
 #define	HPET_LEG_RT_CNF_MASK		(2UL)
 #define	HPET_ENABLE_CNF_MASK		(1UL)
 
-/*
- * HPET interrupt status register
- */
-
-#define	HPET_ISR_CLEAR(HPET, TIMER)				\
-		(HPET)->hpet_isr |= (1UL << TIMER)
 
 /*
  * Timer configuration register
@@ -125,6 +119,12 @@ struct hpet_data {
 
 #define	HPET_DATA_PLATFORM	0x0001	/* platform call to hpet_alloc */
 
+static inline void hpet_reserve_timer(struct hpet_data *hd, int timer)
+{
+	hd->hd_state |= (1 << timer);
+	return;
+}
+
 int hpet_alloc(struct hpet_data *);
 int hpet_register(struct hpet_task *, int);
 int hpet_unregister(struct hpet_task *);
diff --git a/include/linux/hugetlb.h b/include/linux/hugetlb.h
index 6908f29d3..954af9d82 100644
--- a/include/linux/hugetlb.h
+++ b/include/linux/hugetlb.h
@@ -12,13 +12,14 @@ static inline int is_vm_hugetlb_page(struct vm_area_struct *vma)
 	return vma->vm_flags & VM_HUGETLB;
 }
 
-int hugetlb_sysctl_handler(struct ctl_table *, int, struct file *, void __user *, size_t *);
+int hugetlb_sysctl_handler(struct ctl_table *, int, struct file *, void __user *, size_t *, loff_t *);
 int copy_hugetlb_page_range(struct mm_struct *, struct mm_struct *, struct vm_area_struct *);
 int follow_hugetlb_page(struct mm_struct *, struct vm_area_struct *, struct page **, struct vm_area_struct **, unsigned long *, int *, int);
 void zap_hugepage_range(struct vm_area_struct *, unsigned long, unsigned long);
 void unmap_hugepage_range(struct vm_area_struct *, unsigned long, unsigned long);
 int hugetlb_prefault(struct address_space *, struct vm_area_struct *);
 int hugetlb_report_meminfo(char *);
+int hugetlb_report_node_meminfo(int, char *);
 int is_hugepage_mem_enough(size_t);
 unsigned long hugetlb_total_pages(void);
 struct page *follow_huge_addr(struct mm_struct *mm, unsigned long address,
@@ -34,13 +35,6 @@ extern unsigned long max_huge_pages;
 extern const unsigned long hugetlb_zero, hugetlb_infinity;
 extern int sysctl_hugetlb_shm_group;
 
-static inline void
-mark_mm_hugetlb(struct mm_struct *mm, struct vm_area_struct *vma)
-{
-	if (is_vm_hugetlb_page(vma))
-		mm->used_hugetlb = 1;
-}
-
 #ifndef ARCH_HAS_HUGEPAGE_ONLY_RANGE
 #define is_hugepage_only_range(addr, len)	0
 #define hugetlb_free_pgtables(tlb, prev, start, end) do { } while (0)
@@ -72,8 +66,8 @@ static inline unsigned long hugetlb_total_pages(void)
 #define unmap_hugepage_range(vma, start, end)	BUG()
 #define is_hugepage_mem_enough(size)		0
 #define hugetlb_report_meminfo(buf)		0
-#define mark_mm_hugetlb(mm, vma)		do { } while (0)
-#define follow_huge_pmd(mm, addr, pmd, write)	0
+#define hugetlb_report_node_meminfo(n, buf)	0
+#define follow_huge_pmd(mm, addr, pmd, write)	NULL
 #define is_aligned_hugepage_range(addr, len)	0
 #define prepare_hugepage_range(addr, len)	(-EINVAL)
 #define pmd_huge(x)	0
diff --git a/include/linux/i2c-id.h b/include/linux/i2c-id.h
index 591e7ad68..520fe7220 100644
--- a/include/linux/i2c-id.h
+++ b/include/linux/i2c-id.h
@@ -101,6 +101,14 @@
 #define I2C_DRIVERID_UDA1342	53	/* UDA1342 audio codec		*/
 #define I2C_DRIVERID_ADV7170	54	/* video encoder		*/
 #define I2C_DRIVERID_RADEON	55	/* I2C bus on Radeon boards	*/
+#define I2C_DRIVERID_MAX1617	56	/* temp sensor			*/
+#define I2C_DRIVERID_SAA7191	57	/* video encoder		*/
+#define I2C_DRIVERID_INDYCAM	58	/* SGI IndyCam			*/
+#define I2C_DRIVERID_BT832	59	/* CMOS camera video processor	*/
+#define I2C_DRIVERID_TDA9887	60	/* TDA988x IF-PLL demodulator	*/
+#define I2C_DRIVERID_OVCAMCHIP	61	/* OmniVision CMOS image sens.	*/
+#define I2C_DRIVERID_TDA7313	62	/* TDA7313 audio processor	*/
+#define I2C_DRIVERID_MAX6900	63	/* MAX6900 real-time clock	*/
 
 
 #define I2C_DRIVERID_EXP0	0xF0	/* experimental use id's	*/
@@ -264,6 +272,10 @@
 #define I2C_HW_SMBUS_SCX200	0x0b
 #define I2C_HW_SMBUS_NFORCE2	0x0c
 #define I2C_HW_SMBUS_W9968CF	0x0d
+#define I2C_HW_SMBUS_OV511	0x0e	/* OV511(+) USB 1.1 webcam ICs	*/
+#define I2C_HW_SMBUS_OV518	0x0f	/* OV518(+) USB 1.1 webcam ICs	*/
+#define I2C_HW_SMBUS_OV519	0x10	/* OV519 USB 1.1 webcam IC	*/
+#define I2C_HW_SMBUS_OVFX2	0x11	/* Cypress/OmniVision FX2 webcam */
 
 /* --- ISA pseudo-adapter						*/
 #define I2C_HW_ISA 0x00
diff --git a/include/linux/i2o-dev.h b/include/linux/i2o-dev.h
index c79f39745..9ef82bf1a 100644
--- a/include/linux/i2o-dev.h
+++ b/include/linux/i2o-dev.h
@@ -46,24 +46,24 @@
 struct i2o_cmd_passthru
 {
 	unsigned int iop;	/* IOP unit number */
-	void *msg;		/* message */
+	void __user *msg;	/* message */
 };
 
 struct i2o_cmd_hrtlct
 {
 	unsigned int iop;	/* IOP unit number */
-	void *resbuf;		/* Buffer for result */
-	unsigned int *reslen;	/* Buffer length in bytes */
+	void __user *resbuf;	/* Buffer for result */
+	unsigned int __user *reslen;	/* Buffer length in bytes */
 };
 
 struct i2o_cmd_psetget
 {
 	unsigned int iop;	/* IOP unit number */
 	unsigned int tid;	/* Target device TID */
-	void *opbuf;		/* Operation List buffer */
+	void __user *opbuf;	/* Operation List buffer */
 	unsigned int oplen;	/* Operation List buffer length in bytes */
-	void *resbuf;		/* Result List buffer */
-	unsigned int *reslen;	/* Result List buffer length in bytes */
+	void __user *resbuf;	/* Result List buffer */
+	unsigned int __user *reslen;	/* Result List buffer length in bytes */
 };
 
 struct i2o_sw_xfer
@@ -72,10 +72,10 @@ struct i2o_sw_xfer
 	unsigned char flags;	/* Flags field */
 	unsigned char sw_type;	/* Software type */
 	unsigned int sw_id;	/* Software ID */
-	void *buf;		/* Pointer to software buffer */
-	unsigned int *swlen;	/* Length of software data */
-	unsigned int *maxfrag;	/* Maximum fragment count */
-	unsigned int *curfrag;	/* Current fragment count */
+	void __user *buf;	/* Pointer to software buffer */
+	unsigned int __user *swlen;	/* Length of software data */
+	unsigned int __user *maxfrag;	/* Maximum fragment count */
+	unsigned int __user *curfrag;	/* Current fragment count */
 };
 
 struct i2o_html
@@ -83,9 +83,9 @@ struct i2o_html
 	unsigned int iop;	/* IOP unit number */
 	unsigned int tid;	/* Target device ID */
 	unsigned int page;	/* HTML page */
-	void *resbuf;		/* Buffer for reply HTML page */
-	unsigned int *reslen;	/* Length in bytes of reply buffer */
-	void *qbuf;		/* Pointer to HTTP query string */
+	void __user *resbuf;		/* Buffer for reply HTML page */
+	unsigned int __user *reslen;	/* Length in bytes of reply buffer */
+	void __user *qbuf;		/* Pointer to HTTP query string */
 	unsigned int qlen;	/* Length in bytes of query string buffer */
 };
 
diff --git a/include/linux/i2o.h b/include/linux/i2o.h
index 239036553..9104dd403 100644
--- a/include/linux/i2o.h
+++ b/include/linux/i2o.h
@@ -99,6 +99,7 @@ struct i2o_controller
 	int		irq;
 	int		short_req:1;	/* Use small block sizes        */
 	int		dpt:1;		/* Don't quiesce                */
+	int		raptor:1;	/* split bar                    */
 	int		promise:1;	/* Promise controller		*/
 #ifdef CONFIG_MTRR
 	int		mtrr_reg0;
@@ -109,9 +110,9 @@ struct i2o_controller
 	atomic_t users;
 	struct i2o_device *devices;		/* I2O device chain */
 	struct i2o_controller *next;		/* Controller chain */
-	unsigned long post_port;		/* Inbout port address */
-	unsigned long reply_port;		/* Outbound port address */
-	unsigned long irq_mask;			/* Interrupt register address */
+	void *post_port;			/* Inbout port address */
+	void *reply_port;			/* Outbound port address */
+	void *irq_mask;				/* Interrupt register address */
 
 	/* Dynamic LCT related data */
 	struct semaphore lct_sem;
@@ -128,8 +129,11 @@ struct i2o_controller
 	dma_addr_t hrt_phys;
 	u32 hrt_len;
 
-	unsigned long mem_offset;		/* MFA offset */
-	unsigned long mem_phys;			/* MFA physical */
+	void *base_virt;			/* base virtual address */
+	unsigned long base_phys;		/* base physical address */
+
+	void *msg_virt;				/* messages virtual address */
+	unsigned long msg_phys;			/* messages physical address */
 
 	int battery:1;				/* Has a battery backup */
 	int io_alloc:1;				/* An I/O resource was allocated */
diff --git a/include/linux/icmpv6.h b/include/linux/icmpv6.h
index 6b2bf70d2..0cf6c8b12 100644
--- a/include/linux/icmpv6.h
+++ b/include/linux/icmpv6.h
@@ -86,17 +86,15 @@ struct icmp6hdr {
 #define ICMPV6_MGM_REPORT       	131
 #define ICMPV6_MGM_REDUCTION    	132
 
-/* definitions for MLDv2 */
-
-#define MLD2_MODE_IS_INCLUDE	1
-#define MLD2_MODE_IS_EXCLUDE	2
-#define MLD2_CHANGE_TO_INCLUDE	3
-#define MLD2_CHANGE_TO_EXCLUDE	4
-#define MLD2_ALLOW_NEW_SOURCES	5
-#define MLD2_BLOCK_OLD_SOURCES	6
+#define ICMPV6_NI_QUERY			139
+#define ICMPV6_NI_REPLY			140
 
 #define ICMPV6_MLD2_REPORT		143
-#define MLD2_ALL_MCR_INIT { { { 0xff,0x02,0,0,0,0,0,0,0,0,0,0,0,0,0,0x16 } } }
+
+#define ICMPV6_DHAAD_REQUEST		144
+#define ICMPV6_DHAAD_REPLY		145
+#define ICMPV6_MOBILE_PREFIX_SOL	146
+#define ICMPV6_MOBILE_PREFIX_ADV	147
 
 /*
  *	Codes for Destination Unreachable
@@ -139,6 +137,18 @@ struct icmp6_filter {
 	__u32		data[8];
 };
 
+/*
+ *	Definitions for MLDv2
+ */
+#define MLD2_MODE_IS_INCLUDE	1
+#define MLD2_MODE_IS_EXCLUDE	2
+#define MLD2_CHANGE_TO_INCLUDE	3
+#define MLD2_CHANGE_TO_EXCLUDE	4
+#define MLD2_ALLOW_NEW_SOURCES	5
+#define MLD2_BLOCK_OLD_SOURCES	6
+
+#define MLD2_ALL_MCR_INIT { { { 0xff,0x02,0,0,0,0,0,0,0,0,0,0,0,0,0,0x16 } } }
+
 #ifdef __KERNEL__
 
 #include <linux/netdevice.h>
diff --git a/include/linux/ide.h b/include/linux/ide.h
index ade3bb869..06542968a 100644
--- a/include/linux/ide.h
+++ b/include/linux/ide.h
@@ -255,7 +255,7 @@ typedef enum {	ide_unknown,	ide_generic,	ide_pci,
 		ide_pdc4030,	ide_rz1000,	ide_trm290,
 		ide_cmd646,	ide_cy82c693,	ide_4drives,
 		ide_pmac,	ide_etrax100,	ide_acorn,
-		ide_pc9800,	ide_forced
+		ide_forced
 } hwif_chipset_t;
 
 /*
@@ -833,30 +833,14 @@ typedef struct ide_dma_ops_s {
 #define ide_rq_offset(rq) \
 	(((rq)->hard_cur_sectors - (rq)->current_nr_sectors) << 9)
 
-/*
- * taskfiles really should use hard_cur_sectors as well!
- */
-#define task_rq_offset(rq) \
-	(((rq)->nr_sectors - (rq)->current_nr_sectors) * SECTOR_SIZE)
-
 static inline void *ide_map_buffer(struct request *rq, unsigned long *flags)
 {
-	/*
-	 * fs request
-	 */
-	if (rq->bio)
-		return bio_kmap_irq(rq->bio, flags) + ide_rq_offset(rq);
-
-	/*
-	 * task request
-	 */
-	return rq->buffer + task_rq_offset(rq);
+	return bio_kmap_irq(rq->bio, flags) + ide_rq_offset(rq);
 }
 
 static inline void ide_unmap_buffer(struct request *rq, char *buffer, unsigned long *flags)
 {
-	if (rq->bio)
-		bio_kunmap_irq(buffer, flags);
+	bio_kunmap_irq(buffer, flags);
 }
 #endif /* !CONFIG_IDE_TASKFILE_IO */
 
@@ -1210,7 +1194,7 @@ typedef struct ide_driver_s {
 
 #define DRIVER(drive)		((drive)->driver)
 
-extern int generic_ide_ioctl(struct block_device *, unsigned, unsigned long);
+extern int generic_ide_ioctl(struct file *, struct block_device *, unsigned, unsigned long);
 
 /*
  * ide_hwifs[] is the master data structure used to keep track
@@ -1415,42 +1399,32 @@ extern void atapi_output_bytes(ide_drive_t *, void *, u32);
 extern void taskfile_input_data(ide_drive_t *, void *, u32);
 extern void taskfile_output_data(ide_drive_t *, void *, u32);
 
-#ifdef CONFIG_IDE_TASKFILE_IO
-
 #define IDE_PIO_IN	0
 #define IDE_PIO_OUT	1
 
-static inline void task_sectors(ide_drive_t *drive, struct request *rq,
-				unsigned nsect, int rw)
+static inline void __task_sectors(ide_drive_t *drive, char *buf,
+				  unsigned nsect, unsigned rw)
 {
-	unsigned long flags;
-	unsigned int bio_rq;
-	char *buf;
-
-	/*
-	 * bio_rq flag is needed because we can call
-	 * rq_unmap_buffer() with rq->cbio == NULL
-	 */
-	bio_rq = rq->cbio ? 1 : 0;
-
-	if (bio_rq)
-		buf = rq_map_buffer(rq, &flags);	/* fs request */
-	else
-		buf = rq->buffer + blk_rq_offset(rq);	/* task request */
-
 	/*
 	 * IRQ can happen instantly after reading/writing
 	 * last sector of the datablock.
 	 */
-	process_that_request_first(rq, nsect);
-
 	if (rw == IDE_PIO_OUT)
 		taskfile_output_data(drive, buf, nsect * SECTOR_WORDS);
 	else
 		taskfile_input_data(drive, buf, nsect * SECTOR_WORDS);
+}
+
+#ifdef CONFIG_IDE_TASKFILE_IO
+static inline void task_bio_sectors(ide_drive_t *drive, struct request *rq,
+				    unsigned nsect, unsigned rw)
+{
+	unsigned long flags;
+	char *buf = rq_map_buffer(rq, &flags);
 
-	if (bio_rq)
-		rq_unmap_buffer(buf, &flags);
+	process_that_request_first(rq, nsect);
+	__task_sectors(drive, buf, nsect, rw);
+	rq_unmap_buffer(buf, &flags);
 }
 #endif /* CONFIG_IDE_TASKFILE_IO */
 
diff --git a/include/linux/idr.h b/include/linux/idr.h
index 81439bfc0..1b0c1e6d1 100644
--- a/include/linux/idr.h
+++ b/include/linux/idr.h
@@ -1,5 +1,5 @@
 /*
- * include/linux/id.h
+ * include/linux/idr.h
  * 
  * 2002-10-18  written by Jim Houston jim.houston@ccur.com
  *	Copyright (C) 2002 by Concurrent Computer Corporation
@@ -11,14 +11,20 @@
 #include <linux/types.h>
 #include <asm/bitops.h>
 
-#define RESERVED_ID_BITS 8
-
 #if BITS_PER_LONG == 32
 # define IDR_BITS 5
 # define IDR_FULL 0xfffffffful
+/* We can only use two of the bits in the top level because there is
+   only one possible bit in the top level (5 bits * 7 levels = 35
+   bits, but you only use 31 bits in the id). */
+# define TOP_LEVEL_FULL (IDR_FULL >> 30)
 #elif BITS_PER_LONG == 64
 # define IDR_BITS 6
 # define IDR_FULL 0xfffffffffffffffful
+/* We can only use two of the bits in the top level because there is
+   only one possible bit in the top level (6 bits * 6 levels = 36
+   bits, but you only use 31 bits in the id). */
+# define TOP_LEVEL_FULL (IDR_FULL >> 62)
 #else
 # error "BITS_PER_LONG is not 32 or 64"
 #endif
@@ -26,11 +32,8 @@
 #define IDR_SIZE (1 << IDR_BITS)
 #define IDR_MASK ((1 << IDR_BITS)-1)
 
-/* Define the size of the id's */
-#define BITS_PER_INT (sizeof(int)*8)
-
-#define MAX_ID_SHIFT (BITS_PER_INT - RESERVED_ID_BITS)
-#define MAX_ID_BIT (1 << MAX_ID_SHIFT)
+#define MAX_ID_SHIFT (sizeof(int)*8 - 1)
+#define MAX_ID_BIT (1U << MAX_ID_SHIFT)
 #define MAX_ID_MASK (MAX_ID_BIT - 1)
 
 /* Leave the possibility of an incomplete final layer */
@@ -40,25 +43,23 @@
 #define IDR_FREE_MAX MAX_LEVEL + MAX_LEVEL
 
 struct idr_layer {
-	unsigned long		 bitmap;	/* A zero bit means "space here" */
+	unsigned long		 bitmap; /* A zero bit means "space here" */
 	struct idr_layer	*ary[1<<IDR_BITS];
-	int			 count;		/* When zero, we can release it */
+	int			 count;	 /* When zero, we can release it */
 };
 
 struct idr {
 	struct idr_layer *top;
 	struct idr_layer *id_free;
-	long		  count;
 	int		  layers;
 	int		  id_free_cnt;
 	spinlock_t	  lock;
 };
 
-#define IDR_INIT(name)	\
+#define IDR_INIT(name)						\
 {								\
 	.top		= NULL,					\
 	.id_free	= NULL,					\
-	.count		= 0,					\
 	.layers 	= 0,					\
 	.id_free_cnt	= 0,					\
 	.lock		= SPIN_LOCK_UNLOCKED,			\
@@ -71,9 +72,7 @@ struct idr {
 
 void *idr_find(struct idr *idp, int id);
 int idr_pre_get(struct idr *idp, unsigned gfp_mask);
-int idr_get_new(struct idr *idp, void *ptr);
+int idr_get_new(struct idr *idp, void *ptr, int *id);
+int idr_get_new_above(struct idr *idp, void *ptr, int starting_id, int *id);
 void idr_remove(struct idr *idp, int id);
 void idr_init(struct idr *idp);
-
-extern kmem_cache_t *idr_layer_cache;
-
diff --git a/include/linux/if.h b/include/linux/if.h
index 296a6c21e..110282dbd 100644
--- a/include/linux/if.h
+++ b/include/linux/if.h
@@ -108,15 +108,15 @@ struct if_settings
 	unsigned int size;	/* Size of the data allocated by the caller */
 	union {
 		/* {atm/eth/dsl}_settings anyone ? */
-		raw_hdlc_proto		*raw_hdlc;
-		cisco_proto		*cisco;
-		fr_proto		*fr;
-		fr_proto_pvc		*fr_pvc;
-		fr_proto_pvc_info	*fr_pvc_info;
+		raw_hdlc_proto		__user *raw_hdlc;
+		cisco_proto		__user *cisco;
+		fr_proto		__user *fr;
+		fr_proto_pvc		__user *fr_pvc;
+		fr_proto_pvc_info	__user *fr_pvc_info;
 
 		/* interface settings */
-		sync_serial_settings	*sync;
-		te1_settings		*te1;
+		sync_serial_settings	__user *sync;
+		te1_settings		__user *te1;
 	} ifs_ifsu;
 };
 
diff --git a/include/linux/if_pppox.h b/include/linux/if_pppox.h
index 3348fc7f6..1030b41e2 100644
--- a/include/linux/if_pppox.h
+++ b/include/linux/if_pppox.h
@@ -159,8 +159,6 @@ enum {
     PPPOX_DEAD		= 16  /* dead, useless, please clean me up!*/
 };
 
-extern struct ppp_channel_ops pppoe_chan_ops;
-
 #endif /* __KERNEL__ */
 
 #endif /* !(__LINUX_IF_PPPOX_H) */
diff --git a/include/linux/if_vlan.h b/include/linux/if_vlan.h
index 46d246bac..420767fcb 100644
--- a/include/linux/if_vlan.h
+++ b/include/linux/if_vlan.h
@@ -22,6 +22,7 @@ struct sk_buff;
 struct packet_type;
 struct vlan_collection;
 struct vlan_dev_info;
+struct hlist_node;
 
 #include <linux/proc_fs.h> /* for proc_dir_entry */
 #include <linux/netdevice.h>
@@ -67,9 +68,9 @@ extern void vlan_ioctl_set(int (*hook)(void __user *));
 
 struct vlan_group {
 	int real_dev_ifindex; /* The ifindex of the ethernet(like) device the vlan is attached to. */
+	struct hlist_node	hlist;	/* linked list */
 	struct net_device *vlan_devices[VLAN_GROUP_ARRAY_LEN];
-
-	struct vlan_group *next; /* the next in the list */
+	struct rcu_head		rcu;
 };
 
 struct vlan_priority_tci_mapping {
diff --git a/include/linux/init.h b/include/linux/init.h
index 45069e275..7a9f69992 100644
--- a/include/linux/init.h
+++ b/include/linux/init.h
@@ -66,6 +66,9 @@ typedef void (*exitcall_t)(void);
 
 extern initcall_t __con_initcall_start, __con_initcall_end;
 extern initcall_t __security_initcall_start, __security_initcall_end;
+
+/* Defined in init/main.c */
+extern char saved_command_line[];
 #endif
   
 #ifndef MODULE
@@ -107,25 +110,39 @@ extern initcall_t __security_initcall_start, __security_initcall_end;
 struct obs_kernel_param {
 	const char *str;
 	int (*setup_func)(char *);
+	int early;
 };
 
-/* OBSOLETE: see moduleparam.h for the right way. */
-#define __setup_param(str, unique_id, fn)			\
+/*
+ * Only for really core code.  See moduleparam.h for the normal way.
+ *
+ * Force the alignment so the compiler doesn't space elements of the
+ * obs_kernel_param "array" too far apart in .init.setup.
+ */
+#define __setup_param(str, unique_id, fn, early)			\
 	static char __setup_str_##unique_id[] __initdata = str;	\
 	static struct obs_kernel_param __setup_##unique_id	\
-		 __attribute_used__				\
-		 __attribute__((__section__(".init.setup")))	\
-		= { __setup_str_##unique_id, fn }
+		__attribute_used__				\
+		__attribute__((__section__(".init.setup")))	\
+		__attribute__((aligned((sizeof(long)))))	\
+		= { __setup_str_##unique_id, fn, early }
 
 #define __setup_null_param(str, unique_id)			\
-	__setup_param(str, unique_id, NULL)
+	__setup_param(str, unique_id, NULL, 0)
 
 #define __setup(str, fn)					\
-	__setup_param(str, fn, fn)
+	__setup_param(str, fn, fn, 0)
 
 #define __obsolete_setup(str)					\
 	__setup_null_param(str, __LINE__)
 
+/* NOTE: fn is as per module_param, not __setup!  Emits warning if fn
+ * returns non-zero. */
+#define early_param(str, fn)					\
+	__setup_param(str, fn, fn, 1)
+
+/* Relies on saved_command_line being set */
+void __init parse_early_param(void);
 #endif /* __ASSEMBLY__ */
 
 /**
diff --git a/include/linux/init_task.h b/include/linux/init_task.h
index 3ba25d682..9bcf2db6d 100644
--- a/include/linux/init_task.h
+++ b/include/linux/init_task.h
@@ -54,7 +54,7 @@
 
 #define INIT_SIGHAND(sighand) {	\
 	.count		= ATOMIC_INIT(1), 		\
-	.action		= { {{0,}}, }, 			\
+	.action		= { {{NULL,}}, },		\
 	.siglock	= SPIN_LOCK_UNLOCKED, 		\
 }
 
@@ -113,8 +113,8 @@ extern struct group_info init_groups;
 	.switch_lock	= SPIN_LOCK_UNLOCKED,				\
 	.journal_info	= NULL,						\
 	.xid		= 0,						\
-	.nid		= 0,						\
 	.vx_info	= NULL,						\
+	.nid		= 0,						\
 	.nx_info	= NULL,						\
 }
 
diff --git a/include/linux/interrupt.h b/include/linux/interrupt.h
index 220f2a860..565321b05 100644
--- a/include/linux/interrupt.h
+++ b/include/linux/interrupt.h
@@ -7,6 +7,7 @@
 #include <linux/linkage.h>
 #include <linux/bitops.h>
 #include <linux/preempt.h>
+#include <linux/cpumask.h>
 #include <asm/atomic.h>
 #include <asm/hardirq.h>
 #include <asm/ptrace.h>
@@ -35,7 +36,7 @@ typedef int irqreturn_t;
 struct irqaction {
 	irqreturn_t (*handler)(int, void *, struct pt_regs *);
 	unsigned long flags;
-	unsigned long mask;
+	cpumask_t mask;
 	const char *name;
 	void *dev_id;
 	struct irqaction *next;
diff --git a/include/linux/ip.h b/include/linux/ip.h
index 5ea190d1b..ed8b641ef 100644
--- a/include/linux/ip.h
+++ b/include/linux/ip.h
@@ -130,8 +130,6 @@ struct inet_opt {
 	int			mc_index;	/* Multicast device index */
 	__u32			mc_addr;
 	struct ip_mc_socklist	*mc_list;	/* Group array */
-	struct page		*sndmsg_page;	/* Cached page for sendmsg */
-	u32			sndmsg_off;	/* Cached offset for sendmsg */
 	/*
 	 * Following members are used to retain the infomation to build
 	 * an ip header on each ip fragmentation while the socket is corked.
diff --git a/include/linux/ipmi.h b/include/linux/ipmi.h
index 75311f205..4a448922b 100644
--- a/include/linux/ipmi.h
+++ b/include/linux/ipmi.h
@@ -155,6 +155,14 @@ struct ipmi_lan_addr
  * out).
  */
 struct ipmi_msg
+{
+	unsigned char  netfn;
+	unsigned char  cmd;
+	unsigned short data_len;
+	unsigned char  __user *data;
+};
+
+struct kernel_ipmi_msg
 {
 	unsigned char  netfn;
 	unsigned char  cmd;
@@ -223,7 +231,7 @@ struct ipmi_recv_msg
 	ipmi_user_t      user;
 	struct ipmi_addr addr;
 	long             msgid;
-	struct ipmi_msg  msg;
+	struct kernel_ipmi_msg  msg;
 
 	/* The user_msg_data is the data supplied when a message was
 	   sent, if this is a response to a sent message.  If this is
@@ -316,7 +324,7 @@ unsigned char ipmi_get_my_LUN(ipmi_user_t user);
 int ipmi_request(ipmi_user_t      user,
 		 struct ipmi_addr *addr,
 		 long             msgid,
-		 struct ipmi_msg  *msg,
+		 struct kernel_ipmi_msg *msg,
 		 void             *user_msg_data,
 		 int              priority);
 
@@ -336,7 +344,7 @@ int ipmi_request(ipmi_user_t      user,
 int ipmi_request_settime(ipmi_user_t      user,
 			 struct ipmi_addr *addr,
 			 long             msgid,
-			 struct ipmi_msg  *msg,
+			 struct kernel_ipmi_msg  *msg,
 			 void             *user_msg_data,
 			 int              priority,
 			 int              max_retries,
@@ -348,7 +356,7 @@ int ipmi_request_settime(ipmi_user_t      user,
 int ipmi_request_with_source(ipmi_user_t      user,
 			     struct ipmi_addr *addr,
 			     long             msgid,
-			     struct ipmi_msg  *msg,
+			     struct kernel_ipmi_msg  *msg,
 			     void             *user_msg_data,
 			     int              priority,
 			     unsigned char    source_address,
@@ -366,12 +374,22 @@ int ipmi_request_with_source(ipmi_user_t      user,
 int ipmi_request_supply_msgs(ipmi_user_t          user,
 			     struct ipmi_addr     *addr,
 			     long                 msgid,
-			     struct ipmi_msg      *msg,
+			     struct kernel_ipmi_msg *msg,
 			     void                 *user_msg_data,
 			     void                 *supplied_smi,
 			     struct ipmi_recv_msg *supplied_recv,
 			     int                  priority);
 
+/*
+ * Do polling on the IPMI interface the user is attached to.  This
+ * causes the IPMI code to do an immediate check for information from
+ * the driver and handle anything that is immediately pending.  This
+ * will not block in anyway.  This is useful if you need to implement
+ * polling from the user like you need to send periodic watchdog pings
+ * from a crash dump, or something like that.
+ */
+void ipmi_poll_interface(ipmi_user_t user);
+
 /*
  * When commands come in to the SMS, the user can register to receive
  * them.  Only one user can be listening on a specific netfn/cmd pair
@@ -488,7 +506,7 @@ int ipmi_addr_equal(struct ipmi_addr *addr1, struct ipmi_addr *addr2);
 /* Messages sent to the interface are this format. */
 struct ipmi_req
 {
-	unsigned char *addr; /* Address to send the message to. */
+	unsigned char __user *addr; /* Address to send the message to. */
 	unsigned int  addr_len;
 
 	long    msgid; /* The sequence number for the message.  This
@@ -539,7 +557,7 @@ struct ipmi_recv
 	int     recv_type; /* Is this a command, response or an
 			      asyncronous event. */
 
-	unsigned char *addr;    /* Address the message was from is put
+	unsigned char __user *addr;    /* Address the message was from is put
 				   here.  The caller must supply the
 				   memory. */
 	unsigned int  addr_len; /* The size of the address buffer.
diff --git a/include/linux/ipmi_msgdefs.h b/include/linux/ipmi_msgdefs.h
index 40ed591fd..03e05d552 100644
--- a/include/linux/ipmi_msgdefs.h
+++ b/include/linux/ipmi_msgdefs.h
@@ -71,6 +71,7 @@
 
 #define IPMI_CC_NO_ERROR		0x00
 #define IPMI_NODE_BUSY_ERR		0xc0
+#define IPMI_INVALID_COMMAND_ERR	0xc1
 #define IPMI_ERR_MSG_TRUNCATED		0xc6
 #define IPMI_LOST_ARBITRATION_ERR	0x81
 #define IPMI_ERR_UNSPECIFIED		0xff
diff --git a/include/linux/ipmi_smi.h b/include/linux/ipmi_smi.h
index 6b42943ac..88dd37439 100644
--- a/include/linux/ipmi_smi.h
+++ b/include/linux/ipmi_smi.h
@@ -100,6 +100,10 @@ struct ipmi_smi_handlers
 	   out and that none are pending, and any new requests are run
 	   to completion immediately. */
 	void (*set_run_to_completion)(void *send_info, int run_to_completion);
+
+	/* Called to poll for work to do.  This is so upper layers can
+	   poll for operations during things like crash dumps. */
+	void (*poll)(void *send_info);
 };
 
 /* Add a low-level interface to the IPMI driver. */
diff --git a/include/linux/isdn_ppp.h b/include/linux/isdn_ppp.h
index 0cc5f030d..26b00a76e 100644
--- a/include/linux/isdn_ppp.h
+++ b/include/linux/isdn_ppp.h
@@ -233,8 +233,9 @@ struct ippp_struct {
   struct slcompress *slcomp;
 #endif
 #ifdef CONFIG_IPPP_FILTER
-  struct sock_fprog pass_filter;	/* filter for packets to pass */
-  struct sock_fprog active_filter;	/* filter for pkts to reset idle */
+  struct sock_filter *pass_filter;	/* filter for packets to pass */
+  struct sock_filter *active_filter;	/* filter for pkts to reset idle */
+  unsigned pass_len, active_len;
 #endif
   unsigned long debug;
   struct isdn_ppp_compressor *compressor,*decompressor;
diff --git a/include/linux/isdnif.h b/include/linux/isdnif.h
index 823e516b1..7a4eacd77 100644
--- a/include/linux/isdnif.h
+++ b/include/linux/isdnif.h
@@ -502,26 +502,18 @@ typedef struct {
    * Parameters:
    *             u_char pointer data
    *             int    length of data
-   *             int    Flag: 0 = Call form Kernel-Space (use memcpy,
-   *                              no schedule allowed) 
-   *                          1 = Data is in User-Space (use memcpy_fromfs,
-   *                              may schedule)
    *             int    driverId
    *             int    local channel-number (0 ...)
    */
-  int (*writecmd)(const u_char*, int, int, int, int);
+  int (*writecmd)(const u_char __user *, int, int, int);
 
   /* Read raw Status replies
    *             u_char pointer data (volatile)
    *             int    length of buffer
-   *             int    Flag: 0 = Call form Kernel-Space (use memcpy,
-   *                              no schedule allowed) 
-   *                          1 = Data is in User-Space (use memcpy_fromfs,
-   *                              may schedule)
    *             int    driverId
    *             int    local channel-number (0 ...)
    */
-  int (*readstat)(u_char*, int, int, int, int);
+  int (*readstat)(u_char __user *, int, int, int);
 
   char id[20];
 } isdn_if;
diff --git a/include/linux/iso_fs.h b/include/linux/iso_fs.h
index 223f161da..dd53b6cd2 100644
--- a/include/linux/iso_fs.h
+++ b/include/linux/iso_fs.h
@@ -190,28 +190,28 @@ static inline int isonum_712(char *p)
 {
 	return *(s8 *)p;
 }
-static inline int isonum_721(char *p)
+static inline unsigned int isonum_721(char *p)
 {
 	return le16_to_cpu(get_unaligned((u16 *)p));
 }
-static inline int isonum_722(char *p)
+static inline unsigned int isonum_722(char *p)
 {
 	return be16_to_cpu(get_unaligned((u16 *)p));
 }
-static inline int isonum_723(char *p)
+static inline unsigned int isonum_723(char *p)
 {
 	/* Ignore bigendian datum due to broken mastering programs */
 	return le16_to_cpu(get_unaligned((u16 *)p));
 }
-static inline int isonum_731(char *p)
+static inline unsigned int isonum_731(char *p)
 {
 	return le32_to_cpu(get_unaligned((u32 *)p));
 }
-static inline int isonum_732(char *p)
+static inline unsigned int isonum_732(char *p)
 {
 	return be32_to_cpu(get_unaligned((u32 *)p));
 }
-static inline int isonum_733(char *p)
+static inline unsigned int isonum_733(char *p)
 {
 	/* Ignore bigendian datum due to broken mastering programs */
 	return le32_to_cpu(get_unaligned((u32 *)p));
@@ -231,9 +231,69 @@ extern struct dentry *isofs_lookup(struct inode *, struct dentry *, struct namei
 extern struct buffer_head *isofs_bread(struct inode *, sector_t);
 extern int isofs_get_blocks(struct inode *, sector_t, struct buffer_head **, unsigned long);
 
+extern struct inode *isofs_iget(struct super_block *sb,
+                                unsigned long block,
+                                unsigned long offset);
+
+/* Because the inode number is no longer relevant to finding the
+ * underlying meta-data for an inode, we are free to choose a more
+ * convenient 32-bit number as the inode number.  The inode numbering
+ * scheme was recommended by Sergey Vlasov and Eric Lammerts. */
+static inline unsigned long isofs_get_ino(unsigned long block,
+					  unsigned long offset,
+					  unsigned long bufbits)
+{
+	return (block << (bufbits - 5)) | (offset >> 5);
+}
+
+/* Every directory can have many redundant directory entries scattered
+ * throughout the directory tree.  First there is the directory entry
+ * with the name of the directory stored in the parent directory.
+ * Then, there is the "." directory entry stored in the directory
+ * itself.  Finally, there are possibly many ".." directory entries
+ * stored in all the subdirectories.
+ *
+ * In order for the NFS get_parent() method to work and for the
+ * general consistency of the dcache, we need to make sure the
+ * "i_iget5_block" and "i_iget5_offset" all point to exactly one of
+ * the many redundant entries for each directory.  We normalize the
+ * block and offset by always making them point to the "."  directory.
+ *
+ * Notice that we do not use the entry for the directory with the name
+ * that is located in the parent directory.  Even though choosing this
+ * first directory is more natural, it is much easier to find the "."
+ * entry in the NFS get_parent() method because it is implicitly
+ * encoded in the "extent + ext_attr_length" fields of _all_ the
+ * redundant entries for the directory.  Thus, it can always be
+ * reached regardless of which directory entry you have in hand.
+ *
+ * This works because the "." entry is simply the first directory
+ * record when you start reading the file that holds all the directory
+ * records, and this file starts at "extent + ext_attr_length" blocks.
+ * Because the "." entry is always the first entry listed in the
+ * directories file, the normalized "offset" value is always 0.
+ *
+ * You should pass the directory entry in "de".  On return, "block"
+ * and "offset" will hold normalized values.  Only directories are
+ * affected making it safe to call even for non-directory file
+ * types. */
+static inline void
+isofs_normalize_block_and_offset(struct iso_directory_record* de,
+				 unsigned long *block,
+				 unsigned long *offset)
+{
+	/* Only directories are normalized. */
+	if (de->flags[0] & 2) {
+		*offset = 0;
+		*block = (unsigned long)isonum_733(de->extent)
+			+ (unsigned long)isonum_711(de->ext_attr_length);
+	}
+}
+
 extern struct inode_operations isofs_dir_inode_operations;
 extern struct file_operations isofs_dir_operations;
 extern struct address_space_operations isofs_symlink_aops;
+extern struct export_operations isofs_export_ops;
 
 /* The following macros are used to check for memory leaks. */
 #ifdef LEAK_CHECK
diff --git a/include/linux/iso_fs_i.h b/include/linux/iso_fs_i.h
index 01a1ae26b..59065e939 100644
--- a/include/linux/iso_fs_i.h
+++ b/include/linux/iso_fs_i.h
@@ -13,10 +13,13 @@ enum isofs_file_format {
  * iso fs inode data in memory
  */
 struct iso_inode_info {
+	unsigned long i_iget5_block;
+	unsigned long i_iget5_offset;
 	unsigned int i_first_extent;
 	unsigned char i_file_format;
 	unsigned char i_format_parm[3];
-	unsigned long i_next_section_ino;
+	unsigned long i_next_section_block;
+	unsigned long i_next_section_offset;
 	off_t i_section_size;
 	struct inode vfs_inode;
 };
diff --git a/include/linux/istallion.h b/include/linux/istallion.h
index 8de38f372..5f4ee646c 100644
--- a/include/linux/istallion.h
+++ b/include/linux/istallion.h
@@ -3,7 +3,7 @@
 /*
  *	istallion.h  -- stallion intelligent multiport serial driver.
  *
- *	Copyright (C) 1996-1998  Stallion Technologies (support@stallion.oz.au).
+ *	Copyright (C) 1996-1998  Stallion Technologies
  *	Copyright (C) 1994-1996  Greg Ungerer.
  *
  *	This program is free software; you can redistribute it and/or modify
diff --git a/include/linux/ixjuser.h b/include/linux/ixjuser.h
index 81e314d7d..88121166d 100644
--- a/include/linux/ixjuser.h
+++ b/include/linux/ixjuser.h
@@ -350,7 +350,7 @@ typedef enum {
 typedef struct {
 	int elements_used;
 	IXJ_CADENCE_TERM termination;
-	IXJ_CADENCE_ELEMENT *ce;
+	IXJ_CADENCE_ELEMENT __user *ce;
 } IXJ_CADENCE;
 
 #define IXJCTL_TONE_CADENCE		_IOW ('q', 0xCA, IXJ_CADENCE *)
diff --git a/include/linux/jbd.h b/include/linux/jbd.h
index 0a625c3cd..dec393a59 100644
--- a/include/linux/jbd.h
+++ b/include/linux/jbd.h
@@ -1006,6 +1006,7 @@ int __log_space_left(journal_t *); /* Called with journal locked */
 int log_start_commit(journal_t *journal, tid_t tid);
 int __log_start_commit(journal_t *journal, tid_t tid);
 int journal_start_commit(journal_t *journal, tid_t *tid);
+int journal_force_commit_nested(journal_t *journal);
 int log_wait_commit(journal_t *journal, tid_t tid);
 int log_do_checkpoint(journal_t *journal);
 
diff --git a/include/linux/jffs2.h b/include/linux/jffs2.h
index e1a49dca4..162f06ef5 100644
--- a/include/linux/jffs2.h
+++ b/include/linux/jffs2.h
@@ -8,7 +8,7 @@
  * For licensing information, see the file 'LICENCE' in the 
  * jffs2 directory.
  *
- * $Id: jffs2.h,v 1.31 2003/10/04 08:33:05 dwmw2 Exp $
+ * $Id: jffs2.h,v 1.33 2004/05/25 11:31:55 havasi Exp $
  *
  */
 
@@ -43,6 +43,8 @@
 #define JFFS2_COMPR_COPY	0x04
 #define JFFS2_COMPR_DYNRUBIN	0x05
 #define JFFS2_COMPR_ZLIB	0x06
+#define JFFS2_COMPR_LZO         0x07
+#define JFFS2_COMPR_LZARI       0x08
 /* Compatibility flags. */
 #define JFFS2_COMPAT_MASK 0xc000      /* What do to if an unknown nodetype is found */
 #define JFFS2_NODE_ACCURATE 0x2000
@@ -87,39 +89,6 @@ typedef struct {
 	uint16_t v16;
 } __attribute__((packed)) jint16_t;
 
-#define JFFS2_NATIVE_ENDIAN
-
-/* Note we handle mode bits conversion from JFFS2 (i.e. Linux) to/from
-   whatever OS we're actually running on here too. */
-
-#if defined(JFFS2_NATIVE_ENDIAN)
-#define cpu_to_je16(x) ((jint16_t){x})
-#define cpu_to_je32(x) ((jint32_t){x})
-#define cpu_to_jemode(x) ((jmode_t){os_to_jffs2_mode(x)})
-
-#define je16_to_cpu(x) ((x).v16)
-#define je32_to_cpu(x) ((x).v32)
-#define jemode_to_cpu(x) (jffs2_to_os_mode((x).m))
-#elif defined(JFFS2_BIG_ENDIAN)
-#define cpu_to_je16(x) ((jint16_t){cpu_to_be16(x)})
-#define cpu_to_je32(x) ((jint32_t){cpu_to_be32(x)})
-#define cpu_to_jemode(x) ((jmode_t){cpu_to_be32(os_to_jffs2_mode(x))})
-
-#define je16_to_cpu(x) (be16_to_cpu(x.v16))
-#define je32_to_cpu(x) (be32_to_cpu(x.v32))
-#define jemode_to_cpu(x) (be32_to_cpu(jffs2_to_os_mode((x).m)))
-#elif defined(JFFS2_LITTLE_ENDIAN)
-#define cpu_to_je16(x) ((jint16_t){cpu_to_le16(x)})
-#define cpu_to_je32(x) ((jint32_t){cpu_to_le32(x)})
-#define cpu_to_jemode(x) ((jmode_t){cpu_to_le32(os_to_jffs2_mode(x))})
-
-#define je16_to_cpu(x) (le16_to_cpu(x.v16))
-#define je32_to_cpu(x) (le32_to_cpu(x.v32))
-#define jemode_to_cpu(x) (le32_to_cpu(jffs2_to_os_mode((x).m)))
-#else 
-#error wibble
-#endif
-
 struct jffs2_unknown_node
 {
 	/* All start like this */
diff --git a/include/linux/jffs2_fs_i.h b/include/linux/jffs2_fs_i.h
index db91aa6c0..14743de6c 100644
--- a/include/linux/jffs2_fs_i.h
+++ b/include/linux/jffs2_fs_i.h
@@ -1,4 +1,4 @@
-/* $Id: jffs2_fs_i.h,v 1.15 2002/11/12 09:42:49 dwmw2 Exp $ */
+/* $Id: jffs2_fs_i.h,v 1.16 2003/01/09 14:03:21 dwmw2 Exp $ */
 
 #ifndef _JFFS2_FS_I
 #define _JFFS2_FS_I
@@ -36,9 +36,11 @@ struct jffs2_inode_info {
 
 	uint16_t flags;
 	uint8_t usercompr;
+#if !defined (__ECOS)
 #if LINUX_VERSION_CODE > KERNEL_VERSION(2,5,2)
 	struct inode vfs_inode;
 #endif
+#endif
 };
 
 #endif /* _JFFS2_FS_I */
diff --git a/include/linux/kallsyms.h b/include/linux/kallsyms.h
index 87b9bbbb4..1a5dce8f9 100644
--- a/include/linux/kallsyms.h
+++ b/include/linux/kallsyms.h
@@ -7,6 +7,8 @@
 
 #include <linux/config.h>
 
+#define KSYM_NAME_LEN 127
+
 #ifdef CONFIG_KALLSYMS
 /* Lookup the address for a symbol. Returns 0 if not found. */
 unsigned long kallsyms_lookup_name(const char *name);
diff --git a/include/linux/kd.h b/include/linux/kd.h
index f8c48b497..28be4fbe9 100644
--- a/include/linux/kd.h
+++ b/include/linux/kd.h
@@ -147,6 +147,12 @@ struct kbd_repeat {
 struct console_font_op {
 	unsigned int op;	/* operation code KD_FONT_OP_* */
 	unsigned int flags;	/* KD_FONT_FLAG_* */
+	unsigned int width, height;	/* font size */
+	unsigned int charcount;
+	unsigned char __user *data;	/* font data with height fixed to 32 */
+};
+
+struct console_font {
 	unsigned int width, height;	/* font size */
 	unsigned int charcount;
 	unsigned char *data;	/* font data with height fixed to 32 */
diff --git a/include/linux/kernel.h b/include/linux/kernel.h
index 67da15c2e..c4c862629 100644
--- a/include/linux/kernel.h
+++ b/include/linux/kernel.h
@@ -54,6 +54,16 @@ void __might_sleep(char *file, int line);
 #define might_sleep_if(cond) do {} while (0)
 #endif
 
+#define abs(x) ({				\
+		int __x = (x);			\
+		(__x < 0) ? -__x : __x;		\
+	})
+
+#define labs(x) ({				\
+		long __x = (x);			\
+		(__x < 0) ? -__x : __x;		\
+	})
+
 extern struct notifier_block *panic_notifier_list;
 NORET_TYPE void panic(const char * fmt, ...)
 	__attribute__ ((NORET_AND format (printf, 1, 2)));
@@ -61,7 +71,6 @@ asmlinkage NORET_TYPE void do_exit(long error_code)
 	ATTRIB_NORET;
 NORET_TYPE void complete_and_exit(struct completion *, long)
 	ATTRIB_NORET;
-extern int abs(int);
 extern unsigned long simple_strtoul(const char *,char **,unsigned int);
 extern long simple_strtol(const char *,char **,unsigned int);
 extern unsigned long long simple_strtoull(const char *,char **,unsigned int);
@@ -84,6 +93,7 @@ extern int get_option(char **str, int *pint);
 extern char *get_options(const char *str, int nints, int *ints);
 extern unsigned long long memparse(char *ptr, char **retptr);
 
+extern int __kernel_text_address(unsigned long addr);
 extern int kernel_text_address(unsigned long addr);
 extern int session_of_pgrp(int pgrp);
 
@@ -92,6 +102,15 @@ asmlinkage int printk(const char * fmt, ...)
 
 unsigned long int_sqrt(unsigned long);
 
+static inline int __attribute_pure__ long_log2(unsigned long x)
+{
+	int r = 0;
+	for (x >>= 1; x > 0; x >>= 1)
+		r++;
+	return r;
+}
+
+
 extern int printk_ratelimit(void);
 extern int __printk_ratelimit(int ratelimit_jiffies, int ratelimit_burst);
 
diff --git a/include/linux/kernelcapi.h b/include/linux/kernelcapi.h
index 1d4b1b15d..891bb2cf0 100644
--- a/include/linux/kernelcapi.h
+++ b/include/linux/kernelcapi.h
@@ -81,7 +81,7 @@ u16 capi20_get_manufacturer(u32 contr, u8 buf[CAPI_MANUFACTURER_LEN]);
 u16 capi20_get_version(u32 contr, struct capi_version *verp);
 u16 capi20_get_serial(u32 contr, u8 serial[CAPI_SERIAL_LEN]);
 u16 capi20_get_profile(u32 contr, struct capi_profile *profp);
-int capi20_manufacturer(unsigned int cmd, void *data);
+int capi20_manufacturer(unsigned int cmd, void __user *data);
 
 /* temporary hack XXX */
 void capi20_set_callback(struct capi20_appl *ap, 
diff --git a/include/linux/libata.h b/include/linux/libata.h
index 18c90a0c1..b646a4834 100644
--- a/include/linux/libata.h
+++ b/include/linux/libata.h
@@ -91,6 +91,7 @@ enum {
 	ATA_DFLAG_MASTER	= (1 << 2), /* is device 0? */
 	ATA_DFLAG_WCACHE	= (1 << 3), /* has write cache we can
 					     * (hopefully) flush? */
+	ATA_DFLAG_LOCK_SECTORS	= (1 << 4), /* don't adjust max_sectors */
 
 	ATA_DEV_UNKNOWN		= 0,	/* unknown device */
 	ATA_DEV_ATA		= 1,	/* ATA device */
@@ -111,7 +112,9 @@ enum {
 
 	ATA_QCFLAG_ACTIVE	= (1 << 1), /* cmd not yet ack'd to scsi lyer */
 	ATA_QCFLAG_DMA		= (1 << 2), /* data delivered via DMA */
-	ATA_QCFLAG_SG		= (1 << 4), /* have s/g table? */
+	ATA_QCFLAG_SG		= (1 << 3), /* have s/g table? */
+	ATA_QCFLAG_SINGLE	= (1 << 4), /* no s/g, just a single buffer */
+	ATA_QCFLAG_DMAMAP	= ATA_QCFLAG_SG | ATA_QCFLAG_SINGLE,
 
 	/* various lengths of time */
 	ATA_TMOUT_EDD		= 5 * HZ,	/* hueristic */
@@ -133,24 +136,10 @@ enum {
 	BUS_IDENTIFY		= 8,
 	BUS_PACKET		= 9,
 
-	/* thread states */
-	THR_UNKNOWN		= 0,
-	THR_PORT_RESET		= (THR_UNKNOWN + 1),
-	THR_AWAIT_DEATH		= (THR_PORT_RESET + 1),
-	THR_PROBE_FAILED	= (THR_AWAIT_DEATH + 1),
-	THR_IDLE		= (THR_PROBE_FAILED + 1),
-	THR_PROBE_SUCCESS	= (THR_IDLE + 1),
-	THR_PROBE_START		= (THR_PROBE_SUCCESS + 1),
-
 	/* SATA port states */
 	PORT_UNKNOWN		= 0,
 	PORT_ENABLED		= 1,
 	PORT_DISABLED		= 2,
-
-	/* ata_qc_cb_t flags - note uses above ATA_QCFLAG_xxx namespace,
-	 * but not numberspace
-	 */
-	ATA_QCFLAG_TIMEOUT	= (1 << 0),
 };
 
 enum pio_task_states {
@@ -171,7 +160,7 @@ struct ata_port;
 struct ata_queued_cmd;
 
 /* typedefs */
-typedef void (*ata_qc_cb_t) (struct ata_queued_cmd *qc, unsigned int flags);
+typedef int (*ata_qc_cb_t) (struct ata_queued_cmd *qc, u8 drv_stat);
 
 struct ata_ioports {
 	unsigned long		cmd_addr;
@@ -215,6 +204,7 @@ struct ata_host_set {
 	void			*mmio_base;
 	unsigned int		n_ports;
 	void			*private_data;
+	struct ata_port_operations *ops;
 	struct ata_port *	ports[0];
 };
 
@@ -228,16 +218,21 @@ struct ata_queued_cmd {
 	unsigned long		flags;		/* ATA_QCFLAG_xxx */
 	unsigned int		tag;
 	unsigned int		n_elem;
+
+	int			pci_dma_dir;
+
 	unsigned int		nsect;
 	unsigned int		cursect;
 	unsigned int		cursg;
 	unsigned int		cursg_ofs;
+
 	struct ata_taskfile	tf;
 	struct scatterlist	sgent;
+	void			*buf_virt;
 
 	struct scatterlist	*sg;
 
-	ata_qc_cb_t		callback;
+	ata_qc_cb_t		complete_fn;
 
 	struct completion	*waiting;
 
@@ -294,18 +289,12 @@ struct ata_port {
 	struct ata_host_stats	stats;
 	struct ata_host_set	*host_set;
 
-	struct semaphore	probe_sem;
-
-	unsigned int		thr_state;
-
 	struct work_struct	packet_task;
 
 	struct work_struct	pio_task;
 	unsigned int		pio_task_state;
 	unsigned long		pio_task_timeout;
 
-	struct work_struct	probe_task;
-
 	void			*private_data;
 };
 
@@ -330,10 +319,14 @@ struct ata_port_operations {
 
 	void (*bmdma_setup) (struct ata_queued_cmd *qc);
 	void (*bmdma_start) (struct ata_queued_cmd *qc);
-	void (*fill_sg) (struct ata_queued_cmd *qc);
+
+	void (*qc_prep) (struct ata_queued_cmd *qc);
+	int (*qc_issue) (struct ata_queued_cmd *qc);
+
 	void (*eng_timeout) (struct ata_port *ap);
 
 	irqreturn_t (*irq_handler)(int, void *, struct pt_regs *);
+	void (*irq_clear) (struct ata_port *);
 
 	u32 (*scr_read) (struct ata_port *ap, unsigned int sc_reg);
 	void (*scr_write) (struct ata_port *ap, unsigned int sc_reg,
@@ -390,13 +383,19 @@ extern void ata_exec_command_mmio(struct ata_port *ap, struct ata_taskfile *tf);
 extern int ata_port_start (struct ata_port *ap);
 extern void ata_port_stop (struct ata_port *ap);
 extern irqreturn_t ata_interrupt (int irq, void *dev_instance, struct pt_regs *regs);
-extern void ata_fill_sg(struct ata_queued_cmd *qc);
+extern void ata_qc_prep(struct ata_queued_cmd *qc);
+extern int ata_qc_issue_prot(struct ata_queued_cmd *qc);
+extern void ata_sg_init_one(struct ata_queued_cmd *qc, void *buf,
+		unsigned int buflen);
+extern void ata_sg_init(struct ata_queued_cmd *qc, struct scatterlist *sg,
+		 unsigned int n_elem);
 extern void ata_dev_id_string(struct ata_device *dev, unsigned char *s,
 			      unsigned int ofs, unsigned int len);
 extern void ata_bmdma_setup_mmio (struct ata_queued_cmd *qc);
 extern void ata_bmdma_start_mmio (struct ata_queued_cmd *qc);
 extern void ata_bmdma_setup_pio (struct ata_queued_cmd *qc);
 extern void ata_bmdma_start_pio (struct ata_queued_cmd *qc);
+extern void ata_bmdma_irq_clear(struct ata_port *ap);
 extern int pci_test_config_bits(struct pci_dev *pdev, struct pci_bits *bits);
 extern void ata_qc_complete(struct ata_queued_cmd *qc, u8 drv_stat);
 extern void ata_eng_timeout(struct ata_port *ap);
@@ -499,6 +498,7 @@ static inline void ata_tf_init(struct ata_port *ap, struct ata_taskfile *tf, uns
 static inline u8 ata_irq_on(struct ata_port *ap)
 {
 	struct ata_ioports *ioaddr = &ap->ioaddr;
+	u8 tmp;
 
 	ap->ctl &= ~ATA_NIEN;
 	ap->last_ctl = ap->ctl;
@@ -507,7 +507,11 @@ static inline u8 ata_irq_on(struct ata_port *ap)
 		writeb(ap->ctl, ioaddr->ctl_addr);
 	else
 		outb(ap->ctl, ioaddr->ctl_addr);
-	return ata_wait_idle(ap);
+	tmp = ata_wait_idle(ap);
+
+	ap->ops->irq_clear(ap);
+
+	return tmp;
 }
 
 static inline u8 ata_irq_ack(struct ata_port *ap, unsigned int chk_drq)
@@ -556,4 +560,44 @@ static inline unsigned int sata_dev_present(struct ata_port *ap)
 	return ((scr_read(ap, SCR_STATUS) & 0xf) == 0x3) ? 1 : 0;
 }
 
+static inline void ata_bmdma_stop(struct ata_port *ap)
+{
+	if (ap->flags & ATA_FLAG_MMIO) {
+		void *mmio = (void *) ap->ioaddr.bmdma_addr;
+
+		/* clear start/stop bit */
+		writeb(readb(mmio + ATA_DMA_CMD) & ~ATA_DMA_START,
+		      mmio + ATA_DMA_CMD);
+	} else {
+		/* clear start/stop bit */
+		outb(inb(ap->ioaddr.bmdma_addr + ATA_DMA_CMD) & ~ATA_DMA_START,
+		    ap->ioaddr.bmdma_addr + ATA_DMA_CMD);
+	}
+
+	/* one-PIO-cycle guaranteed wait, per spec, for HDMA1:0 transition */
+	ata_altstatus(ap);	      /* dummy read */
+}
+
+static inline void ata_bmdma_ack_irq(struct ata_port *ap)
+{
+	if (ap->flags & ATA_FLAG_MMIO) {
+		void *mmio = ((void *) ap->ioaddr.bmdma_addr) + ATA_DMA_STATUS;
+		writeb(readb(mmio), mmio);
+	} else {
+		unsigned long addr = ap->ioaddr.bmdma_addr + ATA_DMA_STATUS;
+		outb(inb(addr), addr);
+	}
+}
+
+static inline u8 ata_bmdma_status(struct ata_port *ap)
+{
+	u8 host_stat;
+	if (ap->flags & ATA_FLAG_MMIO) {
+		void *mmio = (void *) ap->ioaddr.bmdma_addr;
+		host_stat = readb(mmio + ATA_DMA_STATUS);
+	} else
+		host_stat = inb(ap->ioaddr.bmdma_addr + ATA_DMA_STATUS);
+	return host_stat;
+}
+
 #endif /* __LINUX_LIBATA_H__ */
diff --git a/include/linux/list.h b/include/linux/list.h
index 9e0c971de..33b863bcb 100644
--- a/include/linux/list.h
+++ b/include/linux/list.h
@@ -620,13 +620,12 @@ static inline void hlist_add_after(struct hlist_node *n,
 
 #define hlist_entry(ptr, type, member) container_of(ptr,type,member)
 
-/* Cannot easily do prefetch unfortunately */
 #define hlist_for_each(pos, head) \
 	for (pos = (head)->first; pos && ({ prefetch(pos->next); 1; }); \
 	     pos = pos->next)
 
 #define hlist_for_each_safe(pos, n, head) \
-	for (pos = (head)->first; n = pos ? pos->next : 0, pos; \
+	for (pos = (head)->first; pos && ({ n = pos->next; 1; }); \
 	     pos = n)
 
 /**
@@ -678,6 +677,24 @@ static inline void hlist_add_after(struct hlist_node *n,
 	     pos && ({ n = pos->next; 1; }) && 				 \
 		({ tpos = hlist_entry(pos, typeof(*tpos), member); 1;}); \
 	     pos = n)
+
+/**
+ * hlist_for_each_entry_rcu - iterate over rcu list of given type
+ * @pos:	the type * to use as a loop counter.
+ * @pos:	the &struct hlist_node to use as a loop counter.
+ * @head:	the head for your list.
+ * @member:	the name of the hlist_node within the struct.
+ *
+ * This list-traversal primitive may safely run concurrently with
+ * the _rcu list-mutation primitives such as hlist_add_rcu()
+ * as long as the traversal is guarded by rcu_read_lock().
+ */
+#define hlist_for_each_entry_rcu(tpos, pos, head, member)		 \
+	for (pos = (head)->first;					 \
+	     pos && ({ prefetch(pos->next); 1;}) &&			 \
+		({ tpos = hlist_entry(pos, typeof(*tpos), member); 1;}); \
+	     pos = pos->next, ({ smp_read_barrier_depends(); 0; }) )
+
 #else
 #warning "don't include kernel headers in userspace"
 #endif /* __KERNEL__ */
diff --git a/include/linux/mca.h b/include/linux/mca.h
index 554bbcf71..a80124c4a 100644
--- a/include/linux/mca.h
+++ b/include/linux/mca.h
@@ -12,7 +12,9 @@
 #include <linux/device.h>
 
 /* get the platform specific defines */
+#ifdef CONFIG_MCA
 #include <asm/mca.h>
+#endif
 
 /* The detection of MCA bus is done in the real mode (using BIOS).
  * The information is exported to the protected code, where this
diff --git a/include/linux/mempolicy.h b/include/linux/mempolicy.h
index 2aeecaf71..775c41590 100644
--- a/include/linux/mempolicy.h
+++ b/include/linux/mempolicy.h
@@ -153,6 +153,9 @@ void mpol_free_shared_policy(struct shared_policy *p);
 struct mempolicy *mpol_shared_policy_lookup(struct shared_policy *sp,
 					    unsigned long idx);
 
+extern void numa_default_policy(void);
+extern void numa_policy_init(void);
+
 #else
 
 struct mempolicy {};
@@ -215,6 +218,14 @@ mpol_shared_policy_lookup(struct shared_policy *sp, unsigned long idx)
 #define vma_policy(vma) NULL
 #define vma_set_policy(vma, pol) do {} while(0)
 
+static inline void numa_policy_init(void)
+{
+}
+
+static inline void numa_default_policy(void)
+{
+}
+
 #endif /* CONFIG_NUMA */
 #endif /* __KERNEL__ */
 
diff --git a/include/linux/miscdevice.h b/include/linux/miscdevice.h
index fe5dae18d..041263ab1 100644
--- a/include/linux/miscdevice.h
+++ b/include/linux/miscdevice.h
@@ -26,15 +26,8 @@
 #define MPT_MINOR	220
 #define MISC_DYNAMIC_MINOR 255
 
-#define SGI_GRAPHICS_MINOR   146
-#define SGI_OPENGL_MINOR     147
-#define SGI_GFX_MINOR        148
-#define SGI_STREAMS_MOUSE    149
-#define SGI_STREAMS_KEYBOARD 150
-/* drivers/sgi/char/usema.c */
-#define SGI_USEMACLONE	     151
-
 #define TUN_MINOR	     200
+#define	HPET_MINOR	     228
 
 struct device;
 
diff --git a/include/linux/mm.h b/include/linux/mm.h
index 8f8a8a3a3..5c584cced 100644
--- a/include/linux/mm.h
+++ b/include/linux/mm.h
@@ -23,6 +23,7 @@ extern unsigned long max_mapnr;
 
 extern unsigned long num_physpages;
 extern void * high_memory;
+extern unsigned long vmalloc_earlyreserve;
 extern int page_cluster;
 
 #include <asm/page.h>
@@ -705,8 +706,6 @@ static inline unsigned long vma_pages(struct vm_area_struct *vma)
 
 extern struct vm_area_struct *find_extend_vma(struct mm_struct *mm, unsigned long addr);
 
-extern unsigned int nr_used_zone_pages(void);
-
 extern struct page * vmalloc_to_page(void *addr);
 extern struct page * follow_page(struct mm_struct *mm, unsigned long address,
 		int write);
diff --git a/include/linux/mmzone.h b/include/linux/mmzone.h
index f1e1a727a..8a23709fe 100644
--- a/include/linux/mmzone.h
+++ b/include/linux/mmzone.h
@@ -20,6 +20,18 @@
 #define MAX_ORDER CONFIG_FORCE_MAX_ZONEORDER
 #endif
 
+/*
+ * system hash table size limits
+ * - on large memory machines, we may want to allocate a bigger hash than that
+ *   permitted by MAX_ORDER, so we allocate with the bootmem allocator, and are
+ *   limited to this size
+ */
+#if MAX_ORDER > 14
+#define MAX_SYS_HASH_TABLE_ORDER MAX_ORDER
+#else
+#define MAX_SYS_HASH_TABLE_ORDER 14
+#endif
+
 struct free_area {
 	struct list_head	free_list;
 	unsigned long		*map;
@@ -69,7 +81,34 @@ struct per_cpu_pageset {
 #define MAX_NR_ZONES		3	/* Sync this with ZONES_SHIFT */
 #define ZONES_SHIFT		2	/* ceil(log2(MAX_NR_ZONES)) */
 
+
+/*
+ * When a memory allocation must conform to specific limitations (such
+ * as being suitable for DMA) the caller will pass in hints to the
+ * allocator in the gfp_mask, in the zone modifier bits.  These bits
+ * are used to select a priority ordered list of memory zones which
+ * match the requested limits.  GFP_ZONEMASK defines which bits within
+ * the gfp_mask should be considered as zone modifiers.  Each valid
+ * combination of the zone modifier bits has a corresponding list
+ * of zones (in node_zonelists).  Thus for two zone modifiers there
+ * will be a maximum of 4 (2 ** 2) zonelists, for 3 modifiers there will
+ * be 8 (2 ** 3) zonelists.  GFP_ZONETYPES defines the number of possible
+ * combinations of zone modifiers in "zone modifier space".
+ */
 #define GFP_ZONEMASK	0x03
+/*
+ * As an optimisation any zone modifier bits which are only valid when
+ * no other zone modifier bits are set (loners) should be placed in
+ * the highest order bits of this field.  This allows us to reduce the
+ * extent of the zonelists thus saving space.  For example in the case
+ * of three zone modifier bits, we could require up to eight zonelists.
+ * If the left most zone modifier is a "loner" then the highest valid
+ * zonelist would be four allowing us to allocate only five zonelists.
+ * Use the first form when the left most bit is not a "loner", otherwise
+ * use the second.
+ */
+/* #define GFP_ZONETYPES	(GFP_ZONEMASK + 1) */		/* Non-loner */
+#define GFP_ZONETYPES	((GFP_ZONEMASK + 1) / 2 + 1)		/* Loner */
 
 /*
  * On machines where it is needed (eg PCs) we divide physical memory
@@ -106,8 +145,8 @@ struct zone {
 	spinlock_t		lru_lock;	
 	struct list_head	active_list;
 	struct list_head	inactive_list;
-	atomic_t		nr_scan_active;
-	atomic_t		nr_scan_inactive;
+	unsigned long		nr_scan_active;
+	unsigned long		nr_scan_inactive;
 	unsigned long		nr_active;
 	unsigned long		nr_inactive;
 	int			all_unreclaimable; /* All pages pinned */
@@ -225,7 +264,7 @@ struct zonelist {
 struct bootmem_data;
 typedef struct pglist_data {
 	struct zone node_zones[MAX_NR_ZONES];
-	struct zonelist node_zonelists[MAX_NR_ZONES];
+	struct zonelist node_zonelists[GFP_ZONETYPES];
 	int nr_zones;
 	struct page *node_mem_map;
 	struct bootmem_data *bdata;
@@ -306,6 +345,15 @@ static inline struct zone *next_zone(struct zone *zone)
 #define for_each_zone(zone) \
 	for (zone = pgdat_list->node_zones; zone; zone = next_zone(zone))
 
+static inline int is_highmem_idx(int idx)
+{
+	return (idx == ZONE_HIGHMEM);
+}
+
+static inline int is_normal_idx(int idx)
+{
+	return (idx == ZONE_NORMAL);
+}
 /**
  * is_highmem - helper function to quickly check if a struct zone is a 
  *              highmem zone or not.  This is an attempt to keep references
@@ -314,21 +362,21 @@ static inline struct zone *next_zone(struct zone *zone)
  */
 static inline int is_highmem(struct zone *zone)
 {
-	return (zone - zone->zone_pgdat->node_zones == ZONE_HIGHMEM);
+	return (is_highmem_idx(zone - zone->zone_pgdat->node_zones));
 }
 
 static inline int is_normal(struct zone *zone)
 {
-	return (zone - zone->zone_pgdat->node_zones == ZONE_NORMAL);
+	return (is_normal_idx(zone - zone->zone_pgdat->node_zones));
 }
 
 /* These two functions are used to setup the per zone pages min values */
 struct ctl_table;
 struct file;
 int min_free_kbytes_sysctl_handler(struct ctl_table *, int, struct file *, 
-					void __user *, size_t *);
+					void __user *, size_t *, loff_t *);
 int lower_zone_protection_sysctl_handler(struct ctl_table *, int, struct file *,
-					void __user *, size_t *);
+					void __user *, size_t *, loff_t *);
 
 #include <linux/topology.h>
 /* Returns the number of the current Node. */
diff --git a/include/linux/module.h b/include/linux/module.h
index 2709330e8..fbf2dfc90 100644
--- a/include/linux/module.h
+++ b/include/linux/module.h
@@ -225,6 +225,22 @@ struct module_kobject
 	struct module_attribute attr[0];
 };
 
+/* Similar stuff for section attributes. */
+#define MODULE_SECT_NAME_LEN 32
+struct module_sect_attr
+{
+	struct attribute attr;
+	char name[MODULE_SECT_NAME_LEN];
+	unsigned long address;
+};
+
+struct module_sections
+{
+	struct kobject kobj;
+	struct module_sect_attr attrs[0];
+};
+
+
 struct module
 {
 	enum module_state state;
@@ -298,6 +314,9 @@ struct module
 	Elf_Sym *symtab;
 	unsigned long num_symtab;
 	char *strtab;
+
+	/* Section attributes */
+	struct module_sections *sect_attrs;
 #endif
 
 	/* Per-cpu data. */
@@ -316,8 +335,9 @@ static inline int module_is_live(struct module *mod)
 	return mod->state != MODULE_STATE_GOING;
 }
 
-/* Is this address in a module? */
+/* Is this address in a module? (second is with no locks, for oops) */
 struct module *module_text_address(unsigned long addr);
+struct module *__module_text_address(unsigned long addr);
 
 /* Returns module and fills in value, defined and namebuf, or NULL if
    symnum out of range. */
@@ -443,6 +463,12 @@ static inline struct module *module_text_address(unsigned long addr)
 	return NULL;
 }
 
+/* Is this address in a module? (don't take a lock, we're oopsing) */
+static inline struct module *__module_text_address(unsigned long addr)
+{
+	return NULL;
+}
+
 /* Get/put a kernel symbol (calls should be symmetric) */
 #define symbol_get(x) ({ extern typeof(x) x __attribute__((weak)); &(x); })
 #define symbol_put(x) do { } while(0)
diff --git a/include/linux/mount.h b/include/linux/mount.h
index 61554dda7..42e2c9460 100644
--- a/include/linux/mount.h
+++ b/include/linux/mount.h
@@ -29,8 +29,11 @@ struct vfsmount
 	struct list_head mnt_child;	/* and going through their mnt_child */
 	atomic_t mnt_count;
 	int mnt_flags;
+	int mnt_expiry_mark;		/* true if marked for expiry */
 	char *mnt_devname;		/* Name of device e.g. /dev/dsk/hda1 */
 	struct list_head mnt_list;
+	struct list_head mnt_fslink;	/* link in fs-specific expiry list */
+	struct namespace *mnt_namespace; /* containing namespace */
 };
 
 static inline struct vfsmount *mntget(struct vfsmount *mnt)
@@ -42,7 +45,7 @@ static inline struct vfsmount *mntget(struct vfsmount *mnt)
 
 extern void __mntput(struct vfsmount *mnt);
 
-static inline void mntput(struct vfsmount *mnt)
+static inline void _mntput(struct vfsmount *mnt)
 {
 	if (mnt) {
 		if (atomic_dec_and_test(&mnt->mnt_count))
@@ -50,10 +53,26 @@ static inline void mntput(struct vfsmount *mnt)
 	}
 }
 
+static inline void mntput(struct vfsmount *mnt)
+{
+	if (mnt) {
+		mnt->mnt_expiry_mark = 0;
+		_mntput(mnt);
+	}
+}
+
 extern void free_vfsmnt(struct vfsmount *mnt);
 extern struct vfsmount *alloc_vfsmnt(const char *name);
 extern struct vfsmount *do_kern_mount(const char *fstype, int flags,
 				      const char *name, void *data);
+
+struct nameidata;
+
+extern int do_add_mount(struct vfsmount *newmnt, struct nameidata *nd,
+			int mnt_flags, struct list_head *fslist);
+
+extern void mark_mounts_for_expiry(struct list_head *mounts);
+
 extern spinlock_t vfsmount_lock;
 
 #endif
diff --git a/include/linux/mqueue.h b/include/linux/mqueue.h
index fc40b774b..8db9d7554 100644
--- a/include/linux/mqueue.h
+++ b/include/linux/mqueue.h
@@ -21,6 +21,8 @@
 #include <linux/types.h>
 
 #define MQ_PRIO_MAX 	32768
+/* per-uid limit of kernel memory used by mqueue, in bytes */
+#define MQ_BYTES_MAX	819200
 
 struct mq_attr {
 	long	mq_flags;	/* message queue flags			*/
diff --git a/include/linux/mtd/cfi.h b/include/linux/mtd/cfi.h
index fa32bf254..a3efae0cd 100644
--- a/include/linux/mtd/cfi.h
+++ b/include/linux/mtd/cfi.h
@@ -1,7 +1,7 @@
 
 /* Common Flash Interface structures 
  * See http://support.intel.com/design/flash/technote/index.htm
- * $Id: cfi.h,v 1.35 2003/05/28 15:37:32 dwmw2 Exp $
+ * $Id: cfi.h,v 1.45 2004/07/20 02:44:27 dwmw2 Exp $
  */
 
 #ifndef __MTD_CFI_H__
@@ -13,200 +13,74 @@
 #include <linux/types.h>
 #include <linux/interrupt.h>
 #include <linux/mtd/flashchip.h>
+#include <linux/mtd/map.h>
 #include <linux/mtd/cfi_endian.h>
 
-/*
- * You can optimize the code size and performance by defining only 
- * the geometry(ies) available on your hardware.
- * CFIDEV_INTERLEAVE_n, where  represents the interleave (number of chips to fill the bus width)
- * CFIDEV_BUSWIDTH_n, where n is the bus width in bytes (1, 2, 4 or 8 bytes)
- *
- * By default, all (known) geometries are supported.
- */
-
-#ifndef CONFIG_MTD_CFI_GEOMETRY
-
-/* The default case - support all but 64-bit, which has
-   a performance penalty */
-
-#define CFIDEV_INTERLEAVE_1 (1)
-#define CFIDEV_INTERLEAVE_2 (2)
-#define CFIDEV_INTERLEAVE_4 (4)
-
-#define CFIDEV_BUSWIDTH_1 (1)
-#define CFIDEV_BUSWIDTH_2 (2)
-#define CFIDEV_BUSWIDTH_4 (4)
-
-typedef __u32 cfi_word;
-
-#else
-
-/* Explicitly configured buswidth/interleave support */
-
 #ifdef CONFIG_MTD_CFI_I1
-#define CFIDEV_INTERLEAVE_1 (1)
-#endif
-#ifdef CONFIG_MTD_CFI_I2
-#define CFIDEV_INTERLEAVE_2 (2)
-#endif
-#ifdef CONFIG_MTD_CFI_I4
-#define CFIDEV_INTERLEAVE_4 (4)
-#endif
-#ifdef CONFIG_MTD_CFI_I8
-#define CFIDEV_INTERLEAVE_8 (8)
-#endif
-
-#ifdef CONFIG_MTD_CFI_B1
-#define CFIDEV_BUSWIDTH_1 (1)
-#endif
-#ifdef CONFIG_MTD_CFI_B2
-#define CFIDEV_BUSWIDTH_2 (2)
-#endif
-#ifdef CONFIG_MTD_CFI_B4
-#define CFIDEV_BUSWIDTH_4 (4)
-#endif
-#ifdef CONFIG_MTD_CFI_B8
-#define CFIDEV_BUSWIDTH_8 (8)
-#endif
-
-/* pick the largest necessary */
-#ifdef CONFIG_MTD_CFI_B8
-typedef __u64 cfi_word;
-
-/* This only works if asm/io.h is included first */
-#ifndef __raw_readll
-#define __raw_readll(addr)	(*(volatile __u64 *)(addr))
-#endif
-#ifndef __raw_writell
-#define __raw_writell(v, addr)	(*(volatile __u64 *)(addr) = (v))
-#endif
-#define CFI_WORD_64
-#else  /* CONFIG_MTD_CFI_B8 */
-/* All others can use 32-bits. It's probably more efficient than
-   the smaller types anyway */
-typedef __u32 cfi_word;
-#endif /* CONFIG_MTD_CFI_B8 */
-
-#endif
-
-/*
- * The following macros are used to select the code to execute:
- *   cfi_buswidth_is_*()
- *   cfi_interleave_is_*()
- *   [where * is either 1, 2, 4, or 8]
- * Those macros should be used with 'if' statements.  If only one of few
- * geometry arrangements are selected, they expand to constants thus allowing
- * the compiler (most of them being 0) to optimize away all the unneeded code,
- * while still validating the syntax (which is not possible with embedded 
- * #if ... #endif constructs).
- * The exception to this is the 64-bit versions, which need an extension
- * to the cfi_word type, and cause compiler warnings about shifts being
- * out of range.
- */
-
-#ifdef CFIDEV_INTERLEAVE_1
-# ifdef CFIDEV_INTERLEAVE
-#  undef CFIDEV_INTERLEAVE
-#  define CFIDEV_INTERLEAVE (cfi->interleave)
-# else
-#  define CFIDEV_INTERLEAVE CFIDEV_INTERLEAVE_1
-# endif
-# define cfi_interleave_is_1() (CFIDEV_INTERLEAVE == CFIDEV_INTERLEAVE_1)
+#define cfi_interleave(cfi) 1
+#define cfi_interleave_is_1(cfi) (cfi_interleave(cfi) == 1)
 #else
-# define cfi_interleave_is_1() (0)
+#define cfi_interleave_is_1(cfi) (0)
 #endif
 
-#ifdef CFIDEV_INTERLEAVE_2
-# ifdef CFIDEV_INTERLEAVE
-#  undef CFIDEV_INTERLEAVE
-#  define CFIDEV_INTERLEAVE (cfi->interleave)
+#ifdef CONFIG_MTD_CFI_I2
+# ifdef cfi_interleave
+#  undef cfi_interleave
+#  define cfi_interleave(cfi) ((cfi)->interleave)
 # else
-#  define CFIDEV_INTERLEAVE CFIDEV_INTERLEAVE_2
+#  define cfi_interleave(cfi) 2
 # endif
-# define cfi_interleave_is_2() (CFIDEV_INTERLEAVE == CFIDEV_INTERLEAVE_2)
+#define cfi_interleave_is_2(cfi) (cfi_interleave(cfi) == 2)
 #else
-# define cfi_interleave_is_2() (0)
+#define cfi_interleave_is_2(cfi) (0)
 #endif
 
-#ifdef CFIDEV_INTERLEAVE_4
-# ifdef CFIDEV_INTERLEAVE
-#  undef CFIDEV_INTERLEAVE
-#  define CFIDEV_INTERLEAVE (cfi->interleave)
+#ifdef CONFIG_MTD_CFI_I4
+# ifdef cfi_interleave
+#  undef cfi_interleave
+#  define cfi_interleave(cfi) ((cfi)->interleave)
 # else
-#  define CFIDEV_INTERLEAVE CFIDEV_INTERLEAVE_4
+#  define cfi_interleave(cfi) 4
 # endif
-# define cfi_interleave_is_4() (CFIDEV_INTERLEAVE == CFIDEV_INTERLEAVE_4)
+#define cfi_interleave_is_4(cfi) (cfi_interleave(cfi) == 4)
 #else
-# define cfi_interleave_is_4() (0)
+#define cfi_interleave_is_4(cfi) (0)
 #endif
 
-#ifdef CFIDEV_INTERLEAVE_8
-# ifdef CFIDEV_INTERLEAVE
-#  undef CFIDEV_INTERLEAVE
-#  define CFIDEV_INTERLEAVE (cfi->interleave)
+#ifdef CONFIG_MTD_CFI_I8
+# ifdef cfi_interleave
+#  undef cfi_interleave
+#  define cfi_interleave(cfi) ((cfi)->interleave)
 # else
-#  define CFIDEV_INTERLEAVE CFIDEV_INTERLEAVE_8
+#  define cfi_interleave(cfi) 8
 # endif
-# define cfi_interleave_is_8() (CFIDEV_INTERLEAVE == CFIDEV_INTERLEAVE_8)
+#define cfi_interleave_is_8(cfi) (cfi_interleave(cfi) == 8)
 #else
-# define cfi_interleave_is_8() (0)
+#define cfi_interleave_is_8(cfi) (0)
 #endif
 
-#ifndef CFIDEV_INTERLEAVE
-#error You must define at least one interleave to support!
+static inline int cfi_interleave_supported(int i)
+{
+	switch (i) {
+#ifdef CONFIG_MTD_CFI_I1
+	case 1:
 #endif
-
-#ifdef CFIDEV_BUSWIDTH_1
-# ifdef CFIDEV_BUSWIDTH
-#  undef CFIDEV_BUSWIDTH
-#  define CFIDEV_BUSWIDTH (map->buswidth)
-# else
-#  define CFIDEV_BUSWIDTH CFIDEV_BUSWIDTH_1
-# endif
-# define cfi_buswidth_is_1() (CFIDEV_BUSWIDTH == CFIDEV_BUSWIDTH_1)
-#else
-# define cfi_buswidth_is_1() (0)
+#ifdef CONFIG_MTD_CFI_I2
+	case 2:
 #endif
-
-#ifdef CFIDEV_BUSWIDTH_2
-# ifdef CFIDEV_BUSWIDTH
-#  undef CFIDEV_BUSWIDTH
-#  define CFIDEV_BUSWIDTH (map->buswidth)
-# else
-#  define CFIDEV_BUSWIDTH CFIDEV_BUSWIDTH_2
-# endif
-# define cfi_buswidth_is_2() (CFIDEV_BUSWIDTH == CFIDEV_BUSWIDTH_2)
-#else
-# define cfi_buswidth_is_2() (0)
+#ifdef CONFIG_MTD_CFI_I4
+	case 4:
 #endif
-
-#ifdef CFIDEV_BUSWIDTH_4
-# ifdef CFIDEV_BUSWIDTH
-#  undef CFIDEV_BUSWIDTH
-#  define CFIDEV_BUSWIDTH (map->buswidth)
-# else
-#  define CFIDEV_BUSWIDTH CFIDEV_BUSWIDTH_4
-# endif
-# define cfi_buswidth_is_4() (CFIDEV_BUSWIDTH == CFIDEV_BUSWIDTH_4)
-#else
-# define cfi_buswidth_is_4() (0)
+#ifdef CONFIG_MTD_CFI_I8
+	case 8:
 #endif
+		return 1;
 
-#ifdef CFIDEV_BUSWIDTH_8
-# ifdef CFIDEV_BUSWIDTH
-#  undef CFIDEV_BUSWIDTH
-#  define CFIDEV_BUSWIDTH (map->buswidth)
-# else
-#  define CFIDEV_BUSWIDTH CFIDEV_BUSWIDTH_8
-# endif
-# define cfi_buswidth_is_8() (CFIDEV_BUSWIDTH == CFIDEV_BUSWIDTH_8)
-#else
-# define cfi_buswidth_is_8() (0)
-#endif
+	default:
+		return 0;
+	}
+}
 
-#ifndef CFIDEV_BUSWIDTH
-#error You must define at least one bus width to support!
-#endif
 
 /* NB: these values must represents the number of bytes needed to meet the 
  *     device type (x8, x16, x32).  Eg. a 32 bit device is 4 x 8 bytes. 
@@ -223,64 +97,84 @@ typedef __u32 cfi_word;
 
 /* Basic Query Structure */
 struct cfi_ident {
-  __u8  qry[3];
-  __u16 P_ID;
-  __u16 P_ADR;
-  __u16 A_ID;
-  __u16 A_ADR;
-  __u8  VccMin;
-  __u8  VccMax;
-  __u8  VppMin;
-  __u8  VppMax;
-  __u8  WordWriteTimeoutTyp;
-  __u8  BufWriteTimeoutTyp;
-  __u8  BlockEraseTimeoutTyp;
-  __u8  ChipEraseTimeoutTyp;
-  __u8  WordWriteTimeoutMax;
-  __u8  BufWriteTimeoutMax;
-  __u8  BlockEraseTimeoutMax;
-  __u8  ChipEraseTimeoutMax;
-  __u8  DevSize;
-  __u16 InterfaceDesc;
-  __u16 MaxBufWriteSize;
-  __u8  NumEraseRegions;
-  __u32 EraseRegionInfo[0]; /* Not host ordered */
+	uint8_t  qry[3];
+	uint16_t P_ID;
+	uint16_t P_ADR;
+	uint16_t A_ID;
+	uint16_t A_ADR;
+	uint8_t  VccMin;
+	uint8_t  VccMax;
+	uint8_t  VppMin;
+	uint8_t  VppMax;
+	uint8_t  WordWriteTimeoutTyp;
+	uint8_t  BufWriteTimeoutTyp;
+	uint8_t  BlockEraseTimeoutTyp;
+	uint8_t  ChipEraseTimeoutTyp;
+	uint8_t  WordWriteTimeoutMax;
+	uint8_t  BufWriteTimeoutMax;
+	uint8_t  BlockEraseTimeoutMax;
+	uint8_t  ChipEraseTimeoutMax;
+	uint8_t  DevSize;
+	uint16_t InterfaceDesc;
+	uint16_t MaxBufWriteSize;
+	uint8_t  NumEraseRegions;
+	uint32_t EraseRegionInfo[0]; /* Not host ordered */
 } __attribute__((packed));
 
 /* Extended Query Structure for both PRI and ALT */
 
 struct cfi_extquery {
-  __u8  pri[3];
-  __u8  MajorVersion;
-  __u8  MinorVersion;
+	uint8_t  pri[3];
+	uint8_t  MajorVersion;
+	uint8_t  MinorVersion;
 } __attribute__((packed));
 
 /* Vendor-Specific PRI for Intel/Sharp Extended Command Set (0x0001) */
 
 struct cfi_pri_intelext {
-  __u8  pri[3];
-  __u8  MajorVersion;
-  __u8  MinorVersion;
-  __u32 FeatureSupport;
-  __u8  SuspendCmdSupport;
-  __u16 BlkStatusRegMask;
-  __u8  VccOptimal;
-  __u8  VppOptimal;
-  __u8  NumProtectionFields;
-  __u16 ProtRegAddr;
-  __u8  FactProtRegSize;
-  __u8  UserProtRegSize;
+	uint8_t  pri[3];
+	uint8_t  MajorVersion;
+	uint8_t  MinorVersion;
+	uint32_t FeatureSupport; /* if bit 31 is set then an additional uint32_t feature
+				    block follows - FIXME - not currently supported */
+	uint8_t  SuspendCmdSupport;
+	uint16_t BlkStatusRegMask;
+	uint8_t  VccOptimal;
+	uint8_t  VppOptimal;
+	uint8_t  NumProtectionFields;
+	uint16_t ProtRegAddr;
+	uint8_t  FactProtRegSize;
+	uint8_t  UserProtRegSize;
+} __attribute__((packed));
+
+/* Vendor-Specific PRI for AMD/Fujitsu Extended Command Set (0x0002) */
+
+struct cfi_pri_amdstd {
+	uint8_t  pri[3];
+	uint8_t  MajorVersion;
+	uint8_t  MinorVersion;
+	uint8_t  SiliconRevision; /* bits 1-0: Address Sensitive Unlock */
+	uint8_t  EraseSuspend;
+	uint8_t  BlkProt;
+	uint8_t  TmpBlkUnprotect;
+	uint8_t  BlkProtUnprot;
+	uint8_t  SimultaneousOps;
+	uint8_t  BurstMode;
+	uint8_t  PageMode;
+	uint8_t  VppMin;
+	uint8_t  VppMax;
+	uint8_t  TopBottom;
 } __attribute__((packed));
 
 struct cfi_pri_query {
-  __u8  NumFields;
-  __u32 ProtField[1]; /* Not host ordered */
+	uint8_t  NumFields;
+	uint32_t ProtField[1]; /* Not host ordered */
 } __attribute__((packed));
 
 struct cfi_bri_query {
-  __u8  PageModeReadCap;
-  __u8  NumFields;
-  __u32 ConfField[1]; /* Not host ordered */
+	uint8_t  PageModeReadCap;
+	uint8_t  NumFields;
+	uint32_t ConfField[1]; /* Not host ordered */
 } __attribute__((packed));
 
 #define P_ID_NONE 0
@@ -288,8 +182,10 @@ struct cfi_bri_query {
 #define P_ID_AMD_STD 2
 #define P_ID_INTEL_STD 3
 #define P_ID_AMD_EXT 4
+#define P_ID_ST_ADV 32
 #define P_ID_MITSUBISHI_STD 256
 #define P_ID_MITSUBISHI_EXT 257
+#define P_ID_SST_PAGE 258
 #define P_ID_RESERVED 65535
 
 
@@ -297,14 +193,13 @@ struct cfi_bri_query {
 #define CFI_MODE_JEDEC	0
 
 struct cfi_private {
-	__u16 cmdset;
+	uint16_t cmdset;
 	void *cmdset_priv;
 	int interleave;
 	int device_type;
 	int cfi_mode;		/* Are we a JEDEC device pretending to be CFI? */
 	int addr_unlock1;
 	int addr_unlock2;
-	int fast_prog;
 	struct mtd_info *(*cmdset_setup)(struct map_info *);
 	struct cfi_ident *cfiq; /* For now only one. We insist that all devs
 				  must be of the same type. */
@@ -315,107 +210,81 @@ struct cfi_private {
 	struct flchip chips[0];  /* per-chip data structure for each chip */
 };
 
-#define MAX_CFI_CHIPS 8 /* Entirely arbitrary to avoid realloc() */
-
 /*
  * Returns the command address according to the given geometry.
  */
-static inline __u32 cfi_build_cmd_addr(__u32 cmd_ofs, int interleave, int type)
+static inline uint32_t cfi_build_cmd_addr(uint32_t cmd_ofs, int interleave, int type)
 {
 	return (cmd_ofs * type) * interleave;
 }
 
 /*
- * Transforms the CFI command for the given geometry (bus width & interleave.
+ * Transforms the CFI command for the given geometry (bus width & interleave).
+ * It looks too long to be inline, but in the common case it should almost all
+ * get optimised away. 
  */
-static inline cfi_word cfi_build_cmd(u_char cmd, struct map_info *map, struct cfi_private *cfi)
+static inline map_word cfi_build_cmd(u_char cmd, struct map_info *map, struct cfi_private *cfi)
 {
-	cfi_word val = 0;
-
-	if (cfi_buswidth_is_1()) {
-		/* 1 x8 device */
-		val = cmd;
-	} else if (cfi_buswidth_is_2()) {
-		if (cfi_interleave_is_1()) {
-			/* 1 x16 device in x16 mode */
-			val = cpu_to_cfi16(cmd);
-		} else if (cfi_interleave_is_2()) {
-			/* 2 (x8, x16 or x32) devices in x8 mode */
-			val = cpu_to_cfi16((cmd << 8) | cmd);
-		}
-	} else if (cfi_buswidth_is_4()) {
-		if (cfi_interleave_is_1()) {
-			/* 1 x32 device in x32 mode */
-			val = cpu_to_cfi32(cmd);
-		} else if (cfi_interleave_is_2()) {
-			/* 2 x16 device in x16 mode */
-			val = cpu_to_cfi32((cmd << 16) | cmd);
-		} else if (cfi_interleave_is_4()) {
-			/* 4 (x8, x16 or x32) devices in x8 mode */
-			val = (cmd << 16) | cmd;
-			val = cpu_to_cfi32((val << 8) | val);
-		}
-#ifdef CFI_WORD_64
-	} else if (cfi_buswidth_is_8()) {
-		if (cfi_interleave_is_1()) {
-			/* 1 x64 device in x64 mode */
-			val = cpu_to_cfi64(cmd);
-		} else if (cfi_interleave_is_2()) {
-			/* 2 x32 device in x32 mode */
-			val = cmd;
-			val = cpu_to_cfi64((val << 32) | val);
-		} else if (cfi_interleave_is_4()) {
-			/* 4 (x16, x32 or x64) devices in x16 mode */
-			val = (cmd << 16) | cmd;
-			val = cpu_to_cfi64((val << 32) | val);
-		} else if (cfi_interleave_is_8()) {
-			/* 8 (x8, x16 or x32) devices in x8 mode */
-			val = (cmd << 8) | cmd;
-			val = (val << 16) | val;
-			val = (val << 32) | val;
-			val = cpu_to_cfi64(val);
-		}
-#endif /* CFI_WORD_64 */
-	}
-	return val;
-}
-#define CMD(x)  cfi_build_cmd((x), map, cfi)
-
-/*
- * Read a value according to the bus width.
- */
-
-static inline cfi_word cfi_read(struct map_info *map, __u32 addr)
-{
-	if (cfi_buswidth_is_1()) {
-		return map_read8(map, addr);
-	} else if (cfi_buswidth_is_2()) {
-		return map_read16(map, addr);
-	} else if (cfi_buswidth_is_4()) {
-		return map_read32(map, addr);
-	} else if (cfi_buswidth_is_8()) {
-		return map_read64(map, addr);
+	map_word val = { {0} };
+	int wordwidth, words_per_bus, chip_mode, chips_per_word;
+	unsigned long onecmd;
+	int i;
+
+	/* We do it this way to give the compiler a fighting chance 
+	   of optimising away all the crap for 'bankwidth' larger than
+	   an unsigned long, in the common case where that support is
+	   disabled */
+	if (map_bankwidth_is_large(map)) {
+		wordwidth = sizeof(unsigned long);
+		words_per_bus = (map_bankwidth(map)) / wordwidth; // i.e. normally 1
 	} else {
-		return 0;
+		wordwidth = map_bankwidth(map);
+		words_per_bus = 1;
+	}
+	
+	chip_mode = map_bankwidth(map) / cfi_interleave(cfi);
+	chips_per_word = wordwidth * cfi_interleave(cfi) / map_bankwidth(map);
+
+	/* First, determine what the bit-pattern should be for a single
+	   device, according to chip mode and endianness... */
+	switch (chip_mode) {
+	default: BUG();
+	case 1:
+		onecmd = cmd;
+		break;
+	case 2:
+		onecmd = cpu_to_cfi16(cmd);
+		break;
+	case 4:
+		onecmd = cpu_to_cfi32(cmd);
+		break;
 	}
-}
 
-/*
- * Write a value according to the bus width.
- */
+	/* Now replicate it across the size of an unsigned long, or 
+	   just to the bus width as appropriate */
+	switch (chips_per_word) {
+	default: BUG();
+#if BITS_PER_LONG >= 64
+	case 8:
+		onecmd |= (onecmd << (chip_mode * 32));
+#endif
+	case 4:
+		onecmd |= (onecmd << (chip_mode * 16));
+	case 2:
+		onecmd |= (onecmd << (chip_mode * 8));
+	case 1:
+		;
+	}
 
-static inline void cfi_write(struct map_info *map, cfi_word val, __u32 addr)
-{
-	if (cfi_buswidth_is_1()) {
-		map_write8(map, val, addr);
-	} else if (cfi_buswidth_is_2()) {
-		map_write16(map, val, addr);
-	} else if (cfi_buswidth_is_4()) {
-		map_write32(map, val, addr);
-	} else if (cfi_buswidth_is_8()) {
-		map_write64(map, val, addr);
+	/* And finally, for the multi-word case, replicate it 
+	   in all words in the structure */
+	for (i=0; i < words_per_bus; i++) {
+		val.x[i] = onecmd;
 	}
+
+	return val;
 }
+#define CMD(x)  cfi_build_cmd((x), map, cfi)
 
 /*
  * Sends a CFI command to a bank of flash for the given geometry.
@@ -424,48 +293,47 @@ static inline void cfi_write(struct map_info *map, cfi_word val, __u32 addr)
  * If prev_val is non-null, it will be set to the value at the command address,
  * before the command was written.
  */
-static inline __u32 cfi_send_gen_cmd(u_char cmd, __u32 cmd_addr, __u32 base,
+static inline uint32_t cfi_send_gen_cmd(u_char cmd, uint32_t cmd_addr, uint32_t base,
 				struct map_info *map, struct cfi_private *cfi,
-				int type, cfi_word *prev_val)
+				int type, map_word *prev_val)
 {
-	cfi_word val;
-	__u32 addr = base + cfi_build_cmd_addr(cmd_addr, CFIDEV_INTERLEAVE, type);
+	map_word val;
+	uint32_t addr = base + cfi_build_cmd_addr(cmd_addr, cfi_interleave(cfi), type);
 
 	val = cfi_build_cmd(cmd, map, cfi);
 
 	if (prev_val)
-		*prev_val = cfi_read(map, addr);
+		*prev_val = map_read(map, addr);
 
-	cfi_write(map, val, addr);
+	map_write(map, val, addr);
 
 	return addr - base;
 }
 
-static inline __u8 cfi_read_query(struct map_info *map, __u32 addr)
+static inline uint8_t cfi_read_query(struct map_info *map, uint32_t addr)
 {
-	if (cfi_buswidth_is_1()) {
-		return map_read8(map, addr);
-	} else if (cfi_buswidth_is_2()) {
-		return cfi16_to_cpu(map_read16(map, addr));
-	} else if (cfi_buswidth_is_4()) {
-		return cfi32_to_cpu(map_read32(map, addr));
-	} else if (cfi_buswidth_is_8()) {
-		return cfi64_to_cpu(map_read64(map, addr));
+	map_word val = map_read(map, addr);
+
+	if (map_bankwidth_is_1(map)) {
+		return val.x[0];
+	} else if (map_bankwidth_is_2(map)) {
+		return cfi16_to_cpu(val.x[0]);
 	} else {
-		return 0;
+		/* No point in a 64-bit byteswap since that would just be
+		   swapping the responses from different chips, and we are
+		   only interested in one chip (a representative sample) */
+		return cfi32_to_cpu(val.x[0]);
 	}
 }
 
 static inline void cfi_udelay(int us)
 {
-#if LINUX_VERSION_CODE >= KERNEL_VERSION(2,2,0)
 	unsigned long t = us * HZ / 1000000;
 	if (t) {
 		set_current_state(TASK_UNINTERRUPTIBLE);
 		schedule_timeout(t);
 		return;
 	}
-#endif
 	udelay(us);
 	cond_resched();
 }
@@ -480,4 +348,19 @@ static inline void cfi_spin_unlock(spinlock_t *mutex)
 	spin_unlock_bh(mutex);
 }
 
+struct cfi_extquery *cfi_read_pri(struct map_info *map, uint16_t adr, uint16_t size,
+			     const char* name);
+
+struct cfi_fixup {
+	uint16_t mfr;
+	uint16_t id;
+	void (*fixup)(struct map_info *map, void* param);
+	void* param;
+};
+
+#define CFI_MFR_ANY 0xffff
+#define CFI_ID_ANY  0xffff
+
+void cfi_fixup(struct map_info *map, struct cfi_fixup* fixups);
+
 #endif /* __MTD_CFI_H__ */
diff --git a/include/linux/mtd/doc2000.h b/include/linux/mtd/doc2000.h
index 64465a963..0fd8f49c6 100644
--- a/include/linux/mtd/doc2000.h
+++ b/include/linux/mtd/doc2000.h
@@ -1,13 +1,21 @@
-
-/* Linux driver for Disk-On-Chip 2000       */
-/* (c) 1999 Machine Vision Holdings, Inc.   */
-/* Author: David Woodhouse <dwmw2@mvhi.com> */
-/* $Id: doc2000.h,v 1.17 2003/06/12 01:20:46 gerg Exp $ */
+/* 
+ * Linux driver for Disk-On-Chip devices
+ *
+ * Copyright (C) 1999 Machine Vision Holdings, Inc.   
+ * Copyright (C) 2001-2003 David Woodhouse <dwmw2@infradead.org>
+ * Copyright (C) 2002-2003 Greg Ungerer <gerg@snapgear.com>
+ * Copyright (C) 2002-2003 SnapGear Inc
+ *
+ * $Id: doc2000.h,v 1.22 2003/11/05 10:51:36 dwmw2 Exp $ 
+ *
+ * Released under GPL
+ */
 
 #ifndef __MTD_DOC2000_H__
 #define __MTD_DOC2000_H__
 
 #include <linux/mtd/mtd.h>
+#include <asm/semaphore.h>
 
 #define DoC_Sig1 0
 #define DoC_Sig2 1
@@ -73,12 +81,12 @@
  * Others use readb/writeb 
  */
 #if defined(__arm__)
-#define ReadDOC_(adr, reg)      ((unsigned char)(*(__u32 *)(((unsigned long)adr)+((reg)<<2))))
-#define WriteDOC_(d, adr, reg)  do{ *(__u32 *)(((unsigned long)adr)+((reg)<<2)) = (__u32)d; wmb();} while(0)
+#define ReadDOC_(adr, reg)      ((unsigned char)(*(volatile __u32 *)(((unsigned long)adr)+((reg)<<2))))
+#define WriteDOC_(d, adr, reg)  do{ *(volatile __u32 *)(((unsigned long)adr)+((reg)<<2)) = (__u32)d; wmb();} while(0)
 #define DOC_IOREMAP_LEN 0x8000
 #elif defined(__ppc__)
-#define ReadDOC_(adr, reg)      ((unsigned char)(*(__u16 *)(((unsigned long)adr)+((reg)<<1))))
-#define WriteDOC_(d, adr, reg)  do{ *(__u16 *)(((unsigned long)adr)+((reg)<<1)) = (__u16)d; wmb();} while(0)
+#define ReadDOC_(adr, reg)      ((unsigned char)(*(volatile __u16 *)(((unsigned long)adr)+((reg)<<1))))
+#define WriteDOC_(d, adr, reg)  do{ *(volatile __u16 *)(((unsigned long)adr)+((reg)<<1)) = (__u16)d; wmb();} while(0)
 #define DOC_IOREMAP_LEN 0x4000
 #else
 #define ReadDOC_(adr, reg)      readb(((unsigned long)adr) + (reg))
@@ -106,6 +114,7 @@
 #define DOC_MODE_MDWREN 	0x04
 
 #define DOC_ChipID_Doc2k 	0x20
+#define DOC_ChipID_Doc2kTSOP 	0x21	/* internal number for MTD */
 #define DOC_ChipID_DocMil 	0x30
 #define DOC_ChipID_DocMilPlus32	0x40
 #define DOC_ChipID_DocMilPlus16	0x41
@@ -147,10 +156,10 @@ struct Nand {
 #define MAX_FLOORS 4
 #define MAX_CHIPS 4
 
-#define MAX_FLOORS_MIL 4
+#define MAX_FLOORS_MIL 1
 #define MAX_CHIPS_MIL 1
 
-#define MAX_FLOORS_MPLUS 1
+#define MAX_FLOORS_MPLUS 2
 #define MAX_CHIPS_MPLUS 1
 
 #define ADDR_COLUMN 1
@@ -161,7 +170,7 @@ struct DiskOnChip {
 	unsigned long physadr;
 	unsigned long virtadr;
 	unsigned long totlen;
-	char ChipID; /* Type of DiskOnChip */
+	unsigned char ChipID; /* Type of DiskOnChip */
 	int ioreg;
 	
 	unsigned long mfr; /* Flash IDs - only one type of flash per device */
diff --git a/include/linux/mtd/flashchip.h b/include/linux/mtd/flashchip.h
index 7e042bf5f..c3ac4df72 100644
--- a/include/linux/mtd/flashchip.h
+++ b/include/linux/mtd/flashchip.h
@@ -6,7 +6,7 @@
  *
  * (C) 2000 Red Hat. GPLd.
  *
- * $Id: flashchip.h,v 1.9 2003/04/30 11:15:22 dwmw2 Exp $
+ * $Id: flashchip.h,v 1.14 2004/06/15 16:44:59 nico Exp $
  *
  */
 
@@ -43,7 +43,8 @@ typedef enum {
 
 
 /* NOTE: confusingly, this can be used to refer to more than one chip at a time, 
-   if they're interleaved. */
+   if they're interleaved.  This can even refer to individual partitions on
+   the same physical chip when present. */
 
 struct flchip {
 	unsigned long start; /* Offset within the map */
@@ -61,6 +62,7 @@ struct flchip {
 
 	int write_suspended:1;
 	int erase_suspended:1;
+	unsigned long in_progress_block_addr;
 
 	spinlock_t *mutex;
 	spinlock_t _spinlock; /* We do it like this because sometimes they'll be shared. */
@@ -69,8 +71,17 @@ struct flchip {
 	int word_write_time;
 	int buffer_write_time;
 	int erase_time;
+
+	void *priv;
 };
 
+/* This is used to handle contention on write/erase operations
+   between partitions of the same physical chip. */
+struct flchip_shared {
+	spinlock_t lock;
+	struct flchip *writing;
+	struct flchip *erasing;
+};
 
 
 #endif /* __MTD_FLASHCHIP_H__ */
diff --git a/include/linux/mtd/ftl.h b/include/linux/mtd/ftl.h
index ae017efb9..3678459b4 100644
--- a/include/linux/mtd/ftl.h
+++ b/include/linux/mtd/ftl.h
@@ -1,5 +1,5 @@
 /*
- * $Id: ftl.h,v 1.5 2001/06/02 20:35:51 dwmw2 Exp $
+ * $Id: ftl.h,v 1.6 2003/01/24 13:20:04 dwmw2 Exp $
  * 
  * Derived from (and probably identical to):
  * ftl.h 1.7 1999/10/25 20:23:17
diff --git a/include/linux/mtd/gen_probe.h b/include/linux/mtd/gen_probe.h
index 43c3a08a4..2d66b33f8 100644
--- a/include/linux/mtd/gen_probe.h
+++ b/include/linux/mtd/gen_probe.h
@@ -1,7 +1,7 @@
 /*
  * (C) 2001, 2001 Red Hat, Inc.
  * GPL'd
- * $Id: gen_probe.h,v 1.1 2001/09/02 18:50:13 dwmw2 Exp $
+ * $Id: gen_probe.h,v 1.2 2003/11/08 00:51:21 dsaxena Exp $
  */
 
 #ifndef __LINUX_MTD_GEN_PROBE_H__
@@ -10,12 +10,12 @@
 #include <linux/mtd/flashchip.h>
 #include <linux/mtd/map.h> 
 #include <linux/mtd/cfi.h>
+#include <asm/bitops.h>
 
 struct chip_probe {
 	char *name;
 	int (*probe_chip)(struct map_info *map, __u32 base,
-			  struct flchip *chips, struct cfi_private *cfi);
-
+			  unsigned long *chip_map, struct cfi_private *cfi);
 };
 
 struct mtd_info *mtd_do_chip_probe(struct map_info *map, struct chip_probe *cp);
diff --git a/include/linux/mtd/inftl.h b/include/linux/mtd/inftl.h
index 5cc052da9..b52c8cbd2 100644
--- a/include/linux/mtd/inftl.h
+++ b/include/linux/mtd/inftl.h
@@ -3,105 +3,32 @@
  *
  *	(C) Copyright 2002, Greg Ungerer (gerg@snapgear.com)
  *
- *	$Id: inftl.h,v 1.3 2003/05/23 11:35:34 dwmw2 Exp $
+ *	$Id: inftl.h,v 1.6 2004/06/30 14:49:00 dbrown Exp $
  */
 
 #ifndef __MTD_INFTL_H__
 #define __MTD_INFTL_H__
 
+#ifndef __KERNEL__
+#error This is a kernel header. Perhaps include nftl-user.h instead?
+#endif
+
 #include <linux/mtd/blktrans.h>
 #include <linux/mtd/mtd.h>
 #include <linux/mtd/nftl.h>
 
-#define	OSAK_VERSION	0x5120
-#define	PERCENTUSED	98
-
-#define	SECTORSIZE	512
+#include <mtd/inftl-user.h>
 
 #ifndef INFTL_MAJOR
-#define INFTL_MAJOR 93 /* FIXME */
+#define INFTL_MAJOR 94
 #endif
 #define INFTL_PARTN_BITS 4
 
-/* Block Control Information */
-
-struct inftl_bci {
-	__u8 ECCsig[6];
-	__u8 Status;
-	__u8 Status1;
-} __attribute__((packed));
-
-struct inftl_unithead1 {
-	__u16 virtualUnitNo;
-	__u16 prevUnitNo;
-	__u8 ANAC;
-	__u8 NACs;
-	__u8 parityPerField;
-	__u8 discarded;
-} __attribute__((packed));
-
-struct inftl_unithead2 {
-	__u8 parityPerField;
-	__u8 ANAC;
-	__u16 prevUnitNo;
-	__u16 virtualUnitNo;
-	__u8 NACs;
-	__u8 discarded;
-} __attribute__((packed));
-
-struct inftl_unittail {
-	__u8 Reserved[4];
-	__u16 EraseMark;
-	__u16 EraseMark1;
-} __attribute__((packed));
-
-union inftl_uci {
-	struct inftl_unithead1 a;
-	struct inftl_unithead2 b;
-	struct inftl_unittail c;
-};
-
-struct inftl_oob {
-	struct inftl_bci b;
-	union inftl_uci u;
-};
-
-
-/* INFTL Media Header */
-
-struct INFTLPartition {
-	__u32 virtualUnits;
-	__u32 firstUnit;
-	__u32 lastUnit;
-	__u32 flags;
-	__u32 spareUnits;
-	__u32 Reserved0;
-	__u32 Reserved1;
-} __attribute__((packed));
-
-struct INFTLMediaHeader {
-	char bootRecordID[8];
-	__u32 NoOfBootImageBlocks;
-	__u32 NoOfBinaryPartitions;
-	__u32 NoOfBDTLPartitions;
-	__u32 BlockMultiplierBits;
-	__u32 FormatFlags;
-	__u32 OsakVersion;
-	__u32 PercentUsed;
-	struct INFTLPartition Partitions[4];
-} __attribute__((packed));
-
-/* Partition flag types */
-#define	INFTL_BINARY	0x20000000
-#define	INFTL_BDTL	0x40000000
-#define	INFTL_LAST	0x80000000
-
-
 #ifdef __KERNEL__
 
 struct INFTLrecord {
 	struct mtd_blktrans_dev mbd;
-	__u16 MediaUnit, SpareMediaUnit;
+	__u16 MediaUnit;
 	__u32 EraseSize;
 	struct INFTLMediaHeader MediaHdr;
 	int usecount;
@@ -119,6 +46,7 @@ struct INFTLrecord {
         unsigned int nb_blocks;		/* number of physical blocks */
         unsigned int nb_boot_blocks;	/* number of blocks used by the bios */
         struct erase_info instr;
+        struct nand_oobinfo oobinfo;
 };
 
 int INFTL_mount(struct INFTLrecord *s);
diff --git a/include/linux/mtd/map.h b/include/linux/mtd/map.h
index 0c933f9bf..ed41daec7 100644
--- a/include/linux/mtd/map.h
+++ b/include/linux/mtd/map.h
@@ -1,6 +1,6 @@
 
 /* Overhauled routines for dealing with different mmap regions of flash */
-/* $Id: map.h,v 1.34 2003/05/28 12:42:22 dwmw2 Exp $ */
+/* $Id: map.h,v 1.43 2004/07/14 13:30:27 dwmw2 Exp $ */
 
 #ifndef __LINUX_MTD_MAP_H__
 #define __LINUX_MTD_MAP_H__
@@ -8,17 +8,163 @@
 #include <linux/config.h>
 #include <linux/types.h>
 #include <linux/list.h>
+#include <asm/unaligned.h>
 #include <asm/system.h>
 #include <asm/io.h>
+#include <asm/bug.h>
+
+#ifdef CONFIG_MTD_MAP_BANK_WIDTH_1
+#define map_bankwidth(map) 1
+#define map_bankwidth_is_1(map) (map_bankwidth(map) == 1)
+#define map_bankwidth_is_large(map) (0)
+#define map_words(map) (1)
+#define MAX_MAP_BANKWIDTH 1
+#else
+#define map_bankwidth_is_1(map) (0)
+#endif
+
+#ifdef CONFIG_MTD_MAP_BANK_WIDTH_2
+# ifdef map_bankwidth
+#  undef map_bankwidth
+#  define map_bankwidth(map) ((map)->bankwidth)
+# else
+#  define map_bankwidth(map) 2
+#  define map_bankwidth_is_large(map) (0)
+#  define map_words(map) (1)
+# endif
+#define map_bankwidth_is_2(map) (map_bankwidth(map) == 2)
+#undef MAX_MAP_BANKWIDTH
+#define MAX_MAP_BANKWIDTH 2
+#else
+#define map_bankwidth_is_2(map) (0)
+#endif
+
+#ifdef CONFIG_MTD_MAP_BANK_WIDTH_4
+# ifdef map_bankwidth
+#  undef map_bankwidth
+#  define map_bankwidth(map) ((map)->bankwidth)
+# else
+#  define map_bankwidth(map) 4
+#  define map_bankwidth_is_large(map) (0)
+#  define map_words(map) (1)
+# endif
+#define map_bankwidth_is_4(map) (map_bankwidth(map) == 4)
+#undef MAX_MAP_BANKWIDTH
+#define MAX_MAP_BANKWIDTH 4
+#else
+#define map_bankwidth_is_4(map) (0)
+#endif
+
+#ifdef CONFIG_MTD_MAP_BANK_WIDTH_8
+# ifdef map_bankwidth
+#  undef map_bankwidth
+#  define map_bankwidth(map) ((map)->bankwidth)
+#  if BITS_PER_LONG < 64
+#   undef map_bankwidth_is_large
+#   define map_bankwidth_is_large(map) (map_bankwidth(map) > BITS_PER_LONG/8)
+#   undef map_words
+#   define map_words(map) (map_bankwidth(map) / sizeof(unsigned long))
+#  endif
+# else
+#  define map_bankwidth(map) 8
+#  define map_bankwidth_is_large(map) (BITS_PER_LONG < 64)
+#  define map_words(map) (map_bankwidth(map) / sizeof(unsigned long))
+# endif
+#define map_bankwidth_is_8(map) (map_bankwidth(map) == 8)
+#undef MAX_MAP_BANKWIDTH
+#define MAX_MAP_BANKWIDTH 8
+#else
+#define map_bankwidth_is_8(map) (0)
+#endif
+
+#ifdef CONFIG_MTD_MAP_BANK_WIDTH_16
+# ifdef map_bankwidth
+#  undef map_bankwidth
+#  define map_bankwidth(map) ((map)->bankwidth)
+#  undef map_bankwidth_is_large
+#  define map_bankwidth_is_large(map) (map_bankwidth(map) > BITS_PER_LONG/8)
+#  undef map_words
+#  define map_words(map) (map_bankwidth(map) / sizeof(unsigned long))
+# else
+#  define map_bankwidth(map) 16
+#  define map_bankwidth_is_large(map) (1)
+#  define map_words(map) (map_bankwidth(map) / sizeof(unsigned long))
+# endif
+#define map_bankwidth_is_16(map) (map_bankwidth(map) == 16)
+#undef MAX_MAP_BANKWIDTH
+#define MAX_MAP_BANKWIDTH 16
+#else
+#define map_bankwidth_is_16(map) (0)
+#endif
+
+#ifdef CONFIG_MTD_MAP_BANK_WIDTH_32
+# ifdef map_bankwidth
+#  undef map_bankwidth
+#  define map_bankwidth(map) ((map)->bankwidth)
+#  undef map_bankwidth_is_large
+#  define map_bankwidth_is_large(map) (map_bankwidth(map) > BITS_PER_LONG/8)
+#  undef map_words
+#  define map_words(map) (map_bankwidth(map) / sizeof(unsigned long))
+# else
+#  define map_bankwidth(map) 32
+#  define map_bankwidth_is_large(map) (1)
+#  define map_words(map) (map_bankwidth(map) / sizeof(unsigned long))
+# endif
+#define map_bankwidth_is_32(map) (map_bankwidth(map) == 32)
+#undef MAX_MAP_BANKWIDTH
+#define MAX_MAP_BANKWIDTH 32
+#else
+#define map_bankwidth_is_32(map) (0)
+#endif
+
+#ifndef map_bankwidth
+#error "No bus width supported. What's the point?"
+#endif
+
+static inline int map_bankwidth_supported(int w)
+{
+	switch (w) {
+#ifdef CONFIG_MTD_MAP_BANK_WIDTH_1
+	case 1:
+#endif
+#ifdef CONFIG_MTD_MAP_BANK_WIDTH_2
+	case 2:
+#endif
+#ifdef CONFIG_MTD_MAP_BANK_WIDTH_4
+	case 4:
+#endif
+#ifdef CONFIG_MTD_MAP_BANK_WIDTH_8
+	case 8:
+#endif
+#ifdef CONFIG_MTD_MAP_BANK_WIDTH_16
+	case 16:
+#endif
+#ifdef CONFIG_MTD_MAP_BANK_WIDTH_32
+	case 32:
+#endif
+		return 1;
+
+	default:
+		return 0;
+	}
+}
+
+#define MAX_MAP_LONGS ( ((MAX_MAP_BANKWIDTH*8) + BITS_PER_LONG - 1) / BITS_PER_LONG )
+
+typedef union {
+	unsigned long x[MAX_MAP_LONGS];
+} map_word;
 
 /* The map stuff is very simple. You fill in your struct map_info with
    a handful of routines for accessing the device, making sure they handle
    paging etc. correctly if your device needs it. Then you pass it off
-   to a chip driver which deals with a mapped device - generally either
-   do_cfi_probe() or do_ram_probe(), either of which will return a 
-   struct mtd_info if they liked what they saw. At which point, you
-   fill in the mtd->module with your own module address, and register 
-   it.
+   to a chip probe routine -- either JEDEC or CFI probe or both -- via
+   do_map_probe(). If a chip is recognised, the probe code will invoke the
+   appropriate chip driver (if present) and return a struct mtd_info.
+   At which point, you fill in the mtd->module with your own module 
+   address, and register it with the MTD core code. Or you could partition
+   it and register the partitions instead, or keep it for your own private
+   use; whatever.
    
    The mtd->priv field will point to the struct map_info, and any further
    private data required by the chip driver is linked from the 
@@ -36,28 +182,29 @@ struct map_info {
 	unsigned long virt;
 	void *cached;
 
-	int buswidth; /* in octets */
+	int bankwidth; /* in octets. This isn't necessarily the width
+		       of actual bus cycles -- it's the repeat interval
+		      in bytes, before you are talking to the first chip again.
+		      */
 
 #ifdef CONFIG_MTD_COMPLEX_MAPPINGS
-	u8 (*read8)(struct map_info *, unsigned long);
-	u16 (*read16)(struct map_info *, unsigned long);
-	u32 (*read32)(struct map_info *, unsigned long);  
-	u64 (*read64)(struct map_info *, unsigned long);  
-	/* If it returned a 'long' I'd call it readl.
-	 * It doesn't.
-	 * I won't.
-	 * dwmw2 */
-	
+	map_word (*read)(struct map_info *, unsigned long);
 	void (*copy_from)(struct map_info *, void *, unsigned long, ssize_t);
-	void (*write8)(struct map_info *, u8, unsigned long);
-	void (*write16)(struct map_info *, u16, unsigned long);
-	void (*write32)(struct map_info *, u32, unsigned long);
-	void (*write64)(struct map_info *, u64, unsigned long);
+
+	void (*write)(struct map_info *, const map_word, unsigned long);
 	void (*copy_to)(struct map_info *, unsigned long, const void *, ssize_t);
 
 	/* We can perhaps put in 'point' and 'unpoint' methods, if we really
 	   want to enable XIP for non-linear mappings. Not yet though. */
 #endif
+	/* It's possible for the map driver to use cached memory in its
+	   copy_from implementation (and _only_ with copy_from).  However,
+	   when the chip driver knows some flash area has changed contents,
+	   it will signal it to the map driver through this routine to let
+	   the map driver invalidate the corresponding cache as needed.
+	   If there is no cache to care about this can be set to NULL. */
+	void (*inval_cache)(struct map_info *, unsigned long, ssize_t);
+
 	/* set_vpp() must handle being reentered -- enable, enable, disable 
 	   must leave it enabled. */
 	void (*set_vpp)(struct map_info *, int);
@@ -85,86 +232,173 @@ void map_destroy(struct mtd_info *mtd);
 #define ENABLE_VPP(map) do { if(map->set_vpp) map->set_vpp(map, 1); } while(0)
 #define DISABLE_VPP(map) do { if(map->set_vpp) map->set_vpp(map, 0); } while(0)
 
-#ifdef CONFIG_MTD_COMPLEX_MAPPINGS
-#define map_read8(map, ofs) (map)->read8(map, ofs)
-#define map_read16(map, ofs) (map)->read16(map, ofs)
-#define map_read32(map, ofs) (map)->read32(map, ofs)
-#define map_read64(map, ofs) (map)->read64(map, ofs)
-#define map_copy_from(map, to, from, len) (map)->copy_from(map, to, from, len)
-#define map_write8(map, datum, ofs) (map)->write8(map, datum, ofs)
-#define map_write16(map, datum, ofs) (map)->write16(map, datum, ofs)
-#define map_write32(map, datum, ofs) (map)->write32(map, datum, ofs)
-#define map_write64(map, datum, ofs) (map)->write64(map, datum, ofs)
-#define map_copy_to(map, to, from, len) (map)->copy_to(map, to, from, len)
+#define INVALIDATE_CACHED_RANGE(map, from, size) \
+	do { if(map->inval_cache) map->inval_cache(map, from, size); } while(0)
 
-extern void simple_map_init(struct map_info *);
-#define map_is_linear(map) (map->phys != NO_XIP)
 
-#else
-static inline u8 map_read8(struct map_info *map, unsigned long ofs)
+static inline int map_word_equal(struct map_info *map, map_word val1, map_word val2)
 {
-	return __raw_readb(map->virt + ofs);
+	int i;
+	for (i=0; i<map_words(map); i++) {
+		if (val1.x[i] != val2.x[i])
+			return 0;
+	}
+	return 1;
 }
 
-static inline u16 map_read16(struct map_info *map, unsigned long ofs)
+static inline map_word map_word_and(struct map_info *map, map_word val1, map_word val2)
 {
-	return __raw_readw(map->virt + ofs);
+	map_word r;
+	int i;
+
+	for (i=0; i<map_words(map); i++) {
+		r.x[i] = val1.x[i] & val2.x[i];
+	}
+	return r;
 }
 
-static inline u32 map_read32(struct map_info *map, unsigned long ofs)
+static inline map_word map_word_or(struct map_info *map, map_word val1, map_word val2)
 {
-	return __raw_readl(map->virt + ofs);
+	map_word r;
+	int i;
+
+	for (i=0; i<map_words(map); i++) {
+		r.x[i] = val1.x[i] | val2.x[i];
+	}
+	return r;
 }
+#define map_word_andequal(m, a, b, z) map_word_equal(m, z, map_word_and(m, a, b))
 
-static inline u64 map_read64(struct map_info *map, unsigned long ofs)
+static inline int map_word_bitsset(struct map_info *map, map_word val1, map_word val2)
 {
-#ifndef CONFIG_MTD_CFI_B8 /* 64-bit mappings */
-	BUG();
+	int i;
+
+	for (i=0; i<map_words(map); i++) {
+		if (val1.x[i] & val2.x[i])
+			return 1;
+	}
 	return 0;
-#else
-	return __raw_readll(map->virt + ofs);
-#endif
 }
 
-static inline void map_write8(struct map_info *map, u8 datum, unsigned long ofs)
+static inline map_word map_word_load(struct map_info *map, const void *ptr)
 {
-	__raw_writeb(datum, map->virt + ofs);
-	mb();
+	map_word r;
+
+	if (map_bankwidth_is_1(map))
+		r.x[0] = *(unsigned char *)ptr;
+	else if (map_bankwidth_is_2(map))
+		r.x[0] = get_unaligned((uint16_t *)ptr);
+	else if (map_bankwidth_is_4(map))
+		r.x[0] = get_unaligned((uint32_t *)ptr);
+#if BITS_PER_LONG >= 64
+	else if (map_bankwidth_is_8(map))
+		r.x[0] = get_unaligned((uint64_t *)ptr);
+#endif
+	else if (map_bankwidth_is_large(map))
+		memcpy(r.x, ptr, map->bankwidth);
+
+	return r;
 }
 
-static inline void map_write16(struct map_info *map, u16 datum, unsigned long ofs)
+static inline map_word map_word_load_partial(struct map_info *map, map_word orig, const unsigned char *buf, int start, int len)
 {
-	__raw_writew(datum, map->virt + ofs);
-	mb();
+	int i;
+
+	if (map_bankwidth_is_large(map)) {
+		char *dest = (char *)&orig;
+		memcpy(dest+start, buf, len);
+	} else {
+		for (i=start; i < start+len; i++) {
+			int bitpos;
+#ifdef __LITTLE_ENDIAN
+			bitpos = i*8;
+#else /* __BIG_ENDIAN */
+			bitpos = (map_bankwidth(map)-1-i)*8;
+#endif
+			orig.x[0] &= ~(0xff << bitpos);
+			orig.x[0] |= buf[i] << bitpos;
+		}
+	}
+	return orig;
 }
 
-static inline void map_write32(struct map_info *map, u32 datum, unsigned long ofs)
+static inline map_word map_word_ff(struct map_info *map)
 {
-	__raw_writel(datum, map->virt + ofs);
-	mb();
+	map_word r;
+	int i;
+
+	for (i=0; i<map_words(map); i++) {
+		r.x[i] = ~0UL;
+	}
+	return r;
+}
+static inline map_word inline_map_read(struct map_info *map, unsigned long ofs)
+{
+	map_word r;
+
+	if (map_bankwidth_is_1(map))
+		r.x[0] = __raw_readb(map->virt + ofs);
+	else if (map_bankwidth_is_2(map))
+		r.x[0] = __raw_readw(map->virt + ofs);
+	else if (map_bankwidth_is_4(map))
+		r.x[0] = __raw_readl(map->virt + ofs);
+#if BITS_PER_LONG >= 64
+	else if (map_bankwidth_is_8(map))
+		r.x[0] = __raw_readq(map->virt + ofs);
+#endif
+	else if (map_bankwidth_is_large(map))
+		memcpy_fromio(r.x, map->virt+ofs, map->bankwidth);
+
+	return r;
 }
 
-static inline void map_write64(struct map_info *map, u64 datum, unsigned long ofs)
+static inline void inline_map_write(struct map_info *map, const map_word datum, unsigned long ofs)
 {
-#ifndef CONFIG_MTD_CFI_B8 /* 64-bit mappings */
-	BUG();
-#else
-	__raw_writell(datum, map->virt + ofs);
+	if (map_bankwidth_is_1(map))
+		__raw_writeb(datum.x[0], map->virt + ofs);
+	else if (map_bankwidth_is_2(map))
+		__raw_writew(datum.x[0], map->virt + ofs);
+	else if (map_bankwidth_is_4(map))
+		__raw_writel(datum.x[0], map->virt + ofs);
+#if BITS_PER_LONG >= 64
+	else if (map_bankwidth_is_8(map))
+		__raw_writeq(datum.x[0], map->virt + ofs);
+#endif
+	else if (map_bankwidth_is_large(map))
+		memcpy_toio(map->virt+ofs, datum.x, map->bankwidth);
 	mb();
-#endif /* CFI_B8 */
 }
 
-static inline void map_copy_from(struct map_info *map, void *to, unsigned long from, ssize_t len)
+static inline void inline_map_copy_from(struct map_info *map, void *to, unsigned long from, ssize_t len)
 {
-	memcpy_fromio(to, map->virt + from, len);
+	if (map->cached)
+		memcpy(to, (char *)map->cached + from, len);
+	else
+		memcpy_fromio(to, map->virt + from, len);
 }
 
-static inline void map_copy_to(struct map_info *map, unsigned long to, const void *from, ssize_t len)
+static inline void inline_map_copy_to(struct map_info *map, unsigned long to, const void *from, ssize_t len)
 {
 	memcpy_toio(map->virt + to, from, len);
 }
 
-#define simple_map_init(map) do { } while (0)
+#ifdef CONFIG_MTD_COMPLEX_MAPPINGS
+#define map_read(map, ofs) (map)->read(map, ofs)
+#define map_copy_from(map, to, from, len) (map)->copy_from(map, to, from, len)
+#define map_write(map, datum, ofs) (map)->write(map, datum, ofs)
+#define map_copy_to(map, to, from, len) (map)->copy_to(map, to, from, len)
+
+extern void simple_map_init(struct map_info *);
+#define map_is_linear(map) (map->phys != NO_XIP)
+
+#else
+#define map_read(map, ofs) inline_map_read(map, ofs)
+#define map_copy_from(map, to, from, len) inline_map_copy_from(map, to, from, len)
+#define map_write(map, datum, ofs) inline_map_write(map, datum, ofs)
+#define map_copy_to(map, to, from, len) inline_map_copy_to(map, to, from, len)
+
+
+#define simple_map_init(map) BUG_ON(!map_bankwidth_supported((map)->bankwidth))
 #define map_is_linear(map) (1)
 
 #endif /* !CONFIG_MTD_COMPLEX_MAPPINGS */
diff --git a/include/linux/mtd/mtd.h b/include/linux/mtd/mtd.h
index 9ac94aaab..b3d134392 100644
--- a/include/linux/mtd/mtd.h
+++ b/include/linux/mtd/mtd.h
@@ -1,10 +1,17 @@
-
-/* $Id: mtd.h,v 1.45 2003/05/20 21:56:40 dwmw2 Exp $ */
+/* 
+ * $Id: mtd.h,v 1.56 2004/08/09 18:46:04 dmarlin Exp $
+ *
+ * Copyright (C) 1999-2003 David Woodhouse <dwmw2@infradead.org> et al.
+ *
+ * Released under GPL
+ */
 
 #ifndef __MTD_MTD_H__
 #define __MTD_MTD_H__
 
-#ifdef __KERNEL__
+#ifndef __KERNEL__
+#error This is a kernel header. Perhaps include mtd-user.h instead?
+#endif
 
 #include <linux/config.h>
 #include <linux/version.h>
@@ -12,115 +19,27 @@
 #include <linux/module.h>
 #include <linux/uio.h>
 
-#endif /* __KERNEL__ */
-
-struct erase_info_user {
-	u_int32_t start;
-	u_int32_t length;
-};
-
-struct mtd_oob_buf {
-	u_int32_t start;
-	u_int32_t length;
-	unsigned char *ptr;
-};
+#include <linux/mtd/compatmac.h>
+#include <mtd/mtd-abi.h>
 
 #define MTD_CHAR_MAJOR 90
 #define MTD_BLOCK_MAJOR 31
 #define MAX_MTD_DEVICES 16
 
-
-
-#define MTD_ABSENT		0
-#define MTD_RAM			1
-#define MTD_ROM			2
-#define MTD_NORFLASH		3
-#define MTD_NANDFLASH		4
-#define MTD_PEROM		5
-#define MTD_OTHER		14
-#define MTD_UNKNOWN		15
-
-
-
-#define MTD_CLEAR_BITS		1       // Bits can be cleared (flash)
-#define MTD_SET_BITS		2       // Bits can be set
-#define MTD_ERASEABLE		4       // Has an erase function
-#define MTD_WRITEB_WRITEABLE	8       // Direct IO is possible
-#define MTD_VOLATILE		16      // Set for RAMs
-#define MTD_XIP			32	// eXecute-In-Place possible
-#define MTD_OOB			64	// Out-of-band data (NAND flash)
-#define MTD_ECC			128	// Device capable of automatic ECC
-
-// Some common devices / combinations of capabilities
-#define MTD_CAP_ROM		0
-#define MTD_CAP_RAM		(MTD_CLEAR_BITS|MTD_SET_BITS|MTD_WRITEB_WRITEABLE)
-#define MTD_CAP_NORFLASH        (MTD_CLEAR_BITS|MTD_ERASEABLE)
-#define MTD_CAP_NANDFLASH       (MTD_CLEAR_BITS|MTD_ERASEABLE|MTD_OOB)
-#define MTD_WRITEABLE		(MTD_CLEAR_BITS|MTD_SET_BITS)
-
-
-// Types of automatic ECC/Checksum available
-#define MTD_ECC_NONE		0 	// No automatic ECC available
-#define MTD_ECC_RS_DiskOnChip	1	// Automatic ECC on DiskOnChip
-#define MTD_ECC_SW		2	// SW ECC for Toshiba & Samsung devices
-
-struct mtd_info_user {
-	u_char type;
-	u_int32_t flags;
-	u_int32_t size;	 // Total size of the MTD
-	u_int32_t erasesize;
-	u_int32_t oobblock;  // Size of OOB blocks (e.g. 512)
-	u_int32_t oobsize;   // Amount of OOB data per block (e.g. 16)
-	u_int32_t ecctype;
-	u_int32_t eccsize;
-};
-
-struct region_info_user {
-	u_int32_t offset;		/* At which this region starts, 
-					 * from the beginning of the MTD */
-	u_int32_t erasesize;		/* For this region */
-	u_int32_t numblocks;		/* Number of blocks in this region */
-	u_int32_t regionindex;
-};
-
-#define MEMGETINFO              _IOR('M', 1, struct mtd_info_user)
-#define MEMERASE                _IOW('M', 2, struct erase_info_user)
-#define MEMWRITEOOB             _IOWR('M', 3, struct mtd_oob_buf)
-#define MEMREADOOB              _IOWR('M', 4, struct mtd_oob_buf)
-#define MEMLOCK                 _IOW('M', 5, struct erase_info_user)
-#define MEMUNLOCK               _IOW('M', 6, struct erase_info_user)
-#define MEMGETREGIONCOUNT	_IOR('M', 7, int)
-#define MEMGETREGIONINFO	_IOWR('M', 8, struct region_info_user)
-#define MEMSETOOBSEL		_IOW('M', 9, struct nand_oobinfo)
-
-struct nand_oobinfo {
-	int	useecc;
-	int	eccpos[6];	
-};
-
-
-#ifndef __KERNEL__
-
-typedef struct mtd_info_user mtd_info_t;
-typedef struct erase_info_user erase_info_t;
-typedef struct region_info_user region_info_t;
-typedef struct nand_oobinfo nand_oobinfo_t;
-
-	/* User-space ioctl definitions */
-
-#else /* __KERNEL__ */
-
-
 #define MTD_ERASE_PENDING      	0x01
 #define MTD_ERASING		0x02
 #define MTD_ERASE_SUSPEND	0x04
 #define MTD_ERASE_DONE          0x08
 #define MTD_ERASE_FAILED        0x10
 
+/* If the erase fails, fail_addr might indicate exactly which block failed.  If
+   fail_addr = 0xffffffff, the failure was not at the device level or was not
+   specific to any particular block. */
 struct erase_info {
 	struct mtd_info *mtd;
 	u_int32_t addr;
 	u_int32_t len;
+	u_int32_t fail_addr;
 	u_long time;
 	u_long retries;
 	u_int dev;
@@ -150,6 +69,7 @@ struct mtd_info {
 
 	u_int32_t oobblock;  // Size of OOB blocks (e.g. 512)
 	u_int32_t oobsize;   // Amount of OOB data per block (e.g. 16)
+	u_int32_t oobavail;  // Number of bytes in OOB area available for fs 
 	u_int32_t ecctype;
 	u_int32_t eccsize;
 	
@@ -200,16 +120,16 @@ struct mtd_info {
 	/* This function is not yet implemented */
 	int (*write_user_prot_reg) (struct mtd_info *mtd, loff_t from, size_t len, size_t *retlen, u_char *buf);
 
-	/* iovec-based read/write methods. We need these especially for NAND flash,
+	/* kvec-based read/write methods. We need these especially for NAND flash,
 	   with its limited number of write cycles per erase.
 	   NB: The 'count' parameter is the number of _vectors_, each of 
 	   which contains an (ofs, len) tuple.
 	*/
-	int (*readv) (struct mtd_info *mtd, struct iovec *vecs, unsigned long count, loff_t from, size_t *retlen);
-	int (*readv_ecc) (struct mtd_info *mtd, struct iovec *vecs, unsigned long count, loff_t from, 
+	int (*readv) (struct mtd_info *mtd, struct kvec *vecs, unsigned long count, loff_t from, size_t *retlen);
+	int (*readv_ecc) (struct mtd_info *mtd, struct kvec *vecs, unsigned long count, loff_t from, 
 		size_t *retlen, u_char *eccbuf, struct nand_oobinfo *oobsel);
-	int (*writev) (struct mtd_info *mtd, const struct iovec *vecs, unsigned long count, loff_t to, size_t *retlen);
-	int (*writev_ecc) (struct mtd_info *mtd, const struct iovec *vecs, unsigned long count, loff_t to, 
+	int (*writev) (struct mtd_info *mtd, const struct kvec *vecs, unsigned long count, loff_t to, size_t *retlen);
+	int (*writev_ecc) (struct mtd_info *mtd, const struct kvec *vecs, unsigned long count, loff_t to, 
 		size_t *retlen, u_char *eccbuf, struct nand_oobinfo *oobsel);
 
 	/* Sync */
@@ -223,6 +143,10 @@ struct mtd_info {
 	int (*suspend) (struct mtd_info *mtd);
 	void (*resume) (struct mtd_info *mtd);
 
+	/* Bad block management functions */
+	int (*block_isbad) (struct mtd_info *mtd, loff_t ofs);
+	int (*block_markbad) (struct mtd_info *mtd, loff_t ofs);
+
 	void *priv;
 
 	struct module *owner;
@@ -250,10 +174,10 @@ struct mtd_notifier {
 extern void register_mtd_user (struct mtd_notifier *new);
 extern int unregister_mtd_user (struct mtd_notifier *old);
 
-int default_mtd_writev(struct mtd_info *mtd, const struct iovec *vecs,
+int default_mtd_writev(struct mtd_info *mtd, const struct kvec *vecs,
 		       unsigned long count, loff_t to, size_t *retlen);
 
-int default_mtd_readv(struct mtd_info *mtd, struct iovec *vecs,
+int default_mtd_readv(struct mtd_info *mtd, struct kvec *vecs,
 		      unsigned long count, loff_t from, size_t *retlen);
 
 #define MTD_ERASE(mtd, args...) (*(mtd->erase))(mtd, args)
@@ -269,6 +193,17 @@ int default_mtd_readv(struct mtd_info *mtd, struct iovec *vecs,
 #define MTD_WRITEOOB(mtd, args...) (*(mtd->write_oob))(mtd, args)
 #define MTD_SYNC(mtd) do { if (mtd->sync) (*(mtd->sync))(mtd);  } while (0) 
 
+
+#ifdef CONFIG_MTD_PARTITIONS
+void mtd_erase_callback(struct erase_info *instr);
+#else
+static inline void mtd_erase_callback(struct erase_info *instr)
+{
+	if (instr->callback)
+		instr->callback(instr);
+}
+#endif
+
 /*
  * Debugging macro and defines
  */
@@ -288,6 +223,4 @@ int default_mtd_readv(struct mtd_info *mtd, struct iovec *vecs,
 
 #endif /* CONFIG_MTD_DEBUG */
 
-#endif /* __KERNEL__ */
-
 #endif /* __MTD_MTD_H__ */
diff --git a/include/linux/mtd/nand.h b/include/linux/mtd/nand.h
index 88d48a26b..7de9f8dfa 100644
--- a/include/linux/mtd/nand.h
+++ b/include/linux/mtd/nand.h
@@ -5,7 +5,7 @@
  *                     Steven J. Hill <sjhill@realitydiluted.com>
  *		       Thomas Gleixner <tglx@linutronix.de>
  *
- * $Id: nand.h,v 1.25 2003/05/21 15:15:02 dwmw2 Exp $
+ * $Id: nand.h,v 1.63 2004/07/07 16:29:43 gleixner Exp $
  *
  * 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
@@ -44,6 +44,10 @@
  *			NAND_YAFFS_OOB
  *  11-25-2002 tglx	Added Manufacturer code FUJITSU, NATIONAL
  *			Split manufacturer and device ID structures 
+ *
+ *  02-08-2004 tglx 	added option field to nand structure for chip anomalities
+ *  05-25-2004 tglx 	added bad block table support, ST-MICRO manufacturer id
+ *			update of nand_chip structure description
  */
 #ifndef __LINUX_MTD_NAND_H
 #define __LINUX_MTD_NAND_H
@@ -51,22 +55,46 @@
 #include <linux/config.h>
 #include <linux/wait.h>
 #include <linux/spinlock.h>
+#include <linux/mtd/mtd.h>
 
 struct mtd_info;
-/*
- * Searches for a NAND device
+/* Scan and identify a NAND device */
+extern int nand_scan (struct mtd_info *mtd, int max_chips);
+/* Free resources held by the NAND device */
+extern void nand_release (struct mtd_info *mtd);
+
+/* Read raw data from the device without ECC */
+extern int nand_read_raw (struct mtd_info *mtd, uint8_t *buf, loff_t from, size_t len, size_t ooblen);
+
+
+/* The maximum number of NAND chips in an array */
+#define NAND_MAX_CHIPS		8
+
+/* This constant declares the max. oobsize / page, which
+ * is supported now. If you add a chip with bigger oobsize/page
+ * adjust this accordingly.
  */
-extern int nand_scan (struct mtd_info *mtd);
+#define NAND_MAX_OOBSIZE	64
 
 /*
  * Constants for hardware specific CLE/ALE/NCE function
 */
+/* Select the chip by setting nCE to low */
 #define NAND_CTL_SETNCE 	1
+/* Deselect the chip by setting nCE to high */
 #define NAND_CTL_CLRNCE		2
+/* Select the command latch by setting CLE to high */
 #define NAND_CTL_SETCLE		3
+/* Deselect the command latch by setting CLE to low */
 #define NAND_CTL_CLRCLE		4
+/* Select the address latch by setting ALE to high */
 #define NAND_CTL_SETALE		5
+/* Deselect the address latch by setting ALE to low */
 #define NAND_CTL_CLRALE		6
+/* Set write protection by setting WP to high. Not used! */
+#define NAND_CTL_SETWP		7
+/* Clear write protection by setting WP to low. Not used! */
+#define NAND_CTL_CLRWP		8
 
 /*
  * Standard NAND flash commands
@@ -77,35 +105,102 @@ extern int nand_scan (struct mtd_info *mtd);
 #define NAND_CMD_READOOB	0x50
 #define NAND_CMD_ERASE1		0x60
 #define NAND_CMD_STATUS		0x70
+#define NAND_CMD_STATUS_MULTI	0x71
 #define NAND_CMD_SEQIN		0x80
 #define NAND_CMD_READID		0x90
 #define NAND_CMD_ERASE2		0xd0
 #define NAND_CMD_RESET		0xff
 
+/* Extended commands for large page devices */
+#define NAND_CMD_READSTART	0x30
+#define NAND_CMD_CACHEDPROG	0x15
+
+/* Status bits */
+#define NAND_STATUS_FAIL	0x01
+#define NAND_STATUS_FAIL_N1	0x02
+#define NAND_STATUS_TRUE_READY	0x20
+#define NAND_STATUS_READY	0x40
+#define NAND_STATUS_WP		0x80
+
 /* 
  * Constants for ECC_MODES
- *
- * NONE:	No ECC
- * SOFT:	Software ECC 3 byte ECC per 256 Byte data
- * HW3_256:	Hardware ECC 3 byte ECC per 256 Byte data
- * HW3_512:	Hardware ECC 3 byte ECC per 512 Byte data
- *
- *
-*/
+ */
+
+/* No ECC. Usage is not recommended ! */
 #define NAND_ECC_NONE		0
+/* Software ECC 3 byte ECC per 256 Byte data */
 #define NAND_ECC_SOFT		1
+/* Hardware ECC 3 byte ECC per 256 Byte data */
 #define NAND_ECC_HW3_256	2
+/* Hardware ECC 3 byte ECC per 512 Byte data */
 #define NAND_ECC_HW3_512	3
+/* Hardware ECC 3 byte ECC per 512 Byte data */
 #define NAND_ECC_HW6_512	4
-#define NAND_ECC_DISKONCHIP	5
+/* Hardware ECC 8 byte ECC per 512 Byte data */
+#define NAND_ECC_HW8_512	6
 
 /*
  * Constants for Hardware ECC
 */
+/* Reset Hardware ECC for read */
 #define NAND_ECC_READ		0
+/* Reset Hardware ECC for write */
 #define NAND_ECC_WRITE		1
-	
+/* Enable Hardware ECC before syndrom is read back from flash */
+#define NAND_ECC_READSYN	2
+
+/* Option constants for bizarre disfunctionality and real
+*  features
+*/
+/* Chip can not auto increment pages */
+#define NAND_NO_AUTOINCR	0x00000001
+/* Buswitdh is 16 bit */
+#define NAND_BUSWIDTH_16	0x00000002
+/* Device supports partial programming without padding */
+#define NAND_NO_PADDING		0x00000004
+/* Chip has cache program function */
+#define NAND_CACHEPRG		0x00000008
+/* Chip has copy back function */
+#define NAND_COPYBACK		0x00000010
+/* AND Chip which has 4 banks and a confusing page / block 
+ * assignment. See Renesas datasheet for further information */
+#define NAND_IS_AND		0x00000020
+/* Chip has a array of 4 pages which can be read without
+ * additional ready /busy waits */
+#define NAND_4PAGE_ARRAY	0x00000040 
+
+/* Options valid for Samsung large page devices */
+#define NAND_SAMSUNG_LP_OPTIONS \
+	(NAND_NO_PADDING | NAND_CACHEPRG | NAND_COPYBACK)
+
+/* Macros to identify the above */
+#define NAND_CANAUTOINCR(chip) (!(chip->options & NAND_NO_AUTOINCR))
+#define NAND_MUST_PAD(chip) (!(chip->options & NAND_NO_PADDING))
+#define NAND_HAS_CACHEPROG(chip) ((chip->options & NAND_CACHEPRG))
+#define NAND_HAS_COPYBACK(chip) ((chip->options & NAND_COPYBACK))
+
+/* Mask to zero out the chip options, which come from the id table */
+#define NAND_CHIPOPTIONS_MSK	(0x0000ffff & ~NAND_NO_AUTOINCR)
+
+/* Non chip related options */
+/* Use a flash based bad block table. This option is passed to the
+ * default bad block table function. */
+#define NAND_USE_FLASH_BBT	0x00010000
+/* The hw ecc generator provides a syndrome instead a ecc value on read 
+ * This can only work if we have the ecc bytes directly behind the 
+ * data bytes. Applies for DOC and AG-AND Renesas HW Reed Solomon generators */
+#define NAND_HWECC_SYNDROME	0x00020000
+
+
+/* Options set by nand scan */
+/* Nand scan has allocated oob_buf */
+#define NAND_OOBBUF_ALLOC	0x40000000
+/* Nand scan has allocated data_buf */
+#define NAND_DATABUF_ALLOC	0x80000000
+
+
 /*
+ * nand_state_t - chip states
  * Enumeration for NAND flash chip state
  */
 typedef enum {
@@ -113,71 +208,116 @@ typedef enum {
 	FL_READING,
 	FL_WRITING,
 	FL_ERASING,
-	FL_SYNCING
+	FL_SYNCING,
+	FL_CACHEDPRG,
 } nand_state_t;
 
 
-/*
- * NAND Private Flash Chip Data
- *
- * Structure overview:
- *
- *  IO_ADDR_R - address to read the 8 I/O lines of the flash device 
- *
- *  IO_ADDR_W - address to write the 8 I/O lines of the flash device 
- *
- *  hwcontrol - hardwarespecific function for accesing control-lines
- *
- *  dev_ready - hardwarespecific function for accesing device ready/busy line
- *
- *  waitfunc - hardwarespecific function for wait on ready
- *
- *  calculate_ecc - function for ecc calculation or readback from ecc hardware
- *
- *  correct_data - function for ecc correction, matching to ecc generator (sw/hw)
- *
- *  enable_hwecc - function to enable (reset) hardware ecc generator
- *
- *  eccmod - mode of ecc: see constants
- *
- *  eccsize - databytes used per ecc-calculation
- *
- *  chip_delay - chip dependent delay for transfering data from array to read regs (tR)
- *
- *  chip_lock - spinlock used to protect access to this structure
- *
- *  wq - wait queue to sleep on if a NAND operation is in progress
- *
- *  state - give the current state of the NAND device
- *
- *  page_shift - number of address bits in a page (column address bits)
- *
- *  data_buf - data buffer passed to/from MTD user modules
- *
- *  data_cache - data cache for redundant page access and shadow for
- *		 ECC failure
- *
- *  cache_page - number of last valid page in page_cache 
+/**
+ * struct nand_chip - NAND Private Flash Chip Data
+ * @IO_ADDR_R:		[BOARDSPECIFIC] address to read the 8 I/O lines of the flash device 
+ * @IO_ADDR_W:		[BOARDSPECIFIC] address to write the 8 I/O lines of the flash device 
+ * @read_byte:		[REPLACEABLE] read one byte from the chip
+ * @write_byte:		[REPLACEABLE] write one byte to the chip
+ * @read_word:		[REPLACEABLE] read one word from the chip
+ * @write_word:		[REPLACEABLE] write one word to the chip
+ * @write_buf:		[REPLACEABLE] write data from the buffer to the chip
+ * @read_buf:		[REPLACEABLE] read data from the chip into the buffer
+ * @verify_buf:		[REPLACEABLE] verify buffer contents against the chip data
+ * @select_chip:	[REPLACEABLE] select chip nr
+ * @block_bad:		[REPLACEABLE] check, if the block is bad
+ * @block_markbad:	[REPLACEABLE] mark the block bad
+ * @hwcontrol:		[BOARDSPECIFIC] hardwarespecific function for accesing control-lines
+ * @dev_ready:		[BOARDSPECIFIC] hardwarespecific function for accesing device ready/busy line
+ *			If set to NULL no access to ready/busy is available and the ready/busy information
+ *			is read from the chip status register
+ * @cmdfunc:		[REPLACEABLE] hardwarespecific function for writing commands to the chip
+ * @waitfunc:		[REPLACEABLE] hardwarespecific function for wait on ready
+ * @calculate_ecc: 	[REPLACEABLE] function for ecc calculation or readback from ecc hardware
+ * @correct_data:	[REPLACEABLE] function for ecc correction, matching to ecc generator (sw/hw)
+ * @enable_hwecc:	[BOARDSPECIFIC] function to enable (reset) hardware ecc generator. Must only
+ *			be provided if a hardware ECC is available
+ * @erase_cmd:		[INTERN] erase command write function, selectable due to AND support
+ * @scan_bbt:		[REPLACEABLE] function to scan bad block table
+ * @eccmode:		[BOARDSPECIFIC] mode of ecc, see defines 
+ * @eccsize: 		[INTERN] databytes used per ecc-calculation
+ * @eccsteps:		[INTERN] number of ecc calculation steps per page
+ * @chip_delay:		[BOARDSPECIFIC] chip dependent delay for transfering data from array to read regs (tR)
+ * @chip_lock:		[INTERN] spinlock used to protect access to this structure and the chip
+ * @wq:			[INTERN] wait queue to sleep on if a NAND operation is in progress
+ * @state: 		[INTERN] the current state of the NAND device
+ * @page_shift:		[INTERN] number of address bits in a page (column address bits)
+ * @phys_erase_shift:	[INTERN] number of address bits in a physical eraseblock
+ * @bbt_erase_shift:	[INTERN] number of address bits in a bbt entry
+ * @chip_shift:		[INTERN] number of address bits in one chip
+ * @data_buf:		[INTERN] internal buffer for one page + oob 
+ * @oob_buf:		[INTERN] oob buffer for one eraseblock
+ * @oobdirty:		[INTERN] indicates that oob_buf must be reinitialized
+ * @data_poi:		[INTERN] pointer to a data buffer
+ * @options:		[BOARDSPECIFIC] various chip options. They can partly be set to inform nand_scan about
+ *			special functionality. See the defines for further explanation
+ * @badblockpos:	[INTERN] position of the bad block marker in the oob area
+ * @numchips:		[INTERN] number of physical chips
+ * @chipsize:		[INTERN] the size of one chip for multichip arrays
+ * @pagemask:		[INTERN] page number mask = number of (pages / chip) - 1
+ * @pagebuf:		[INTERN] holds the pagenumber which is currently in data_buf
+ * @autooob:		[REPLACEABLE] the default (auto)placement scheme
+ * @bbt:		[INTERN] bad block table pointer
+ * @bbt_td:		[REPLACEABLE] bad block table descriptor for flash lookup
+ * @bbt_md:		[REPLACEABLE] bad block table mirror descriptor
+ * @priv:		[OPTIONAL] pointer to private chip date
  */
+ 
 struct nand_chip {
 	unsigned long 	IO_ADDR_R;
 	unsigned long 	IO_ADDR_W;
-	void 		(*hwcontrol)(int cmd);
-	int  		(*dev_ready)(void);
+	
+	u_char		(*read_byte)(struct mtd_info *mtd);
+	void		(*write_byte)(struct mtd_info *mtd, u_char byte);
+	u16		(*read_word)(struct mtd_info *mtd);
+	void		(*write_word)(struct mtd_info *mtd, u16 word);
+	
+	void		(*write_buf)(struct mtd_info *mtd, const u_char *buf, int len);
+	void		(*read_buf)(struct mtd_info *mtd, u_char *buf, int len);
+	int		(*verify_buf)(struct mtd_info *mtd, const u_char *buf, int len);
+	void		(*select_chip)(struct mtd_info *mtd, int chip);
+	int		(*block_bad)(struct mtd_info *mtd, loff_t ofs, int getchip);
+	int		(*block_markbad)(struct mtd_info *mtd, loff_t ofs);
+	void 		(*hwcontrol)(struct mtd_info *mtd, int cmd);
+	int  		(*dev_ready)(struct mtd_info *mtd);
 	void 		(*cmdfunc)(struct mtd_info *mtd, unsigned command, int column, int page_addr);
 	int 		(*waitfunc)(struct mtd_info *mtd, struct nand_chip *this, int state);
-	void		(*calculate_ecc)(const u_char *dat, u_char *ecc_code);
-	int 		(*correct_data)(u_char *dat, u_char *read_ecc, u_char *calc_ecc);
-	void		(*enable_hwecc)(int mode);
+	int		(*calculate_ecc)(struct mtd_info *mtd, const u_char *dat, u_char *ecc_code);
+	int 		(*correct_data)(struct mtd_info *mtd, u_char *dat, u_char *read_ecc, u_char *calc_ecc);
+	void		(*enable_hwecc)(struct mtd_info *mtd, int mode);
+	void		(*erase_cmd)(struct mtd_info *mtd, int page);
+	int		(*scan_bbt)(struct mtd_info *mtd);
 	int		eccmode;
 	int		eccsize;
+	int		eccsteps;
 	int 		chip_delay;
-	spinlock_t 	chip_lock;
+	spinlock_t	chip_lock;
 	wait_queue_head_t wq;
 	nand_state_t 	state;
 	int 		page_shift;
+	int		phys_erase_shift;
+	int		bbt_erase_shift;
+	int		chip_shift;
 	u_char 		*data_buf;
+	u_char		*oob_buf;
+	int		oobdirty;
 	u_char		*data_poi;
+	unsigned int	options;
+	int		badblockpos;
+	int		numchips;
+	unsigned long	chipsize;
+	int		pagemask;
+	int		pagebuf;
+	struct nand_oobinfo	*autooob;
+	uint8_t		*bbt;
+	struct nand_bbt_descr	*bbt_td;
+	struct nand_bbt_descr	*bbt_md;
+	void		*priv;
 };
 
 /*
@@ -187,46 +327,35 @@ struct nand_chip {
 #define NAND_MFR_SAMSUNG	0xec
 #define NAND_MFR_FUJITSU	0x04
 #define NAND_MFR_NATIONAL	0x8f
+#define NAND_MFR_RENESAS	0x07
+#define NAND_MFR_STMICRO	0x20
 
-/*
- * NAND Flash Device ID Structure
- *
- * Structure overview:
- *
- *  name - Identify the device type
- *
- *  id -  device ID code
- *
- *  chipshift - total number of address bits for the device which
- *              is used to calculate address offsets and the total
- *              number of bytes the device is capable of.
- *
- *  page256 - denotes if flash device has 256 byte pages or not.
- *
- *  pageadrlen - number of bytes minus one needed to hold the
- *               complete address into the flash array. Keep in
- *               mind that when a read or write is done to a
- *               specific address, the address is input serially
- *               8 bits at a time. This structure member is used
- *               by the read/write routines as a loop index for
- *               shifting the address out 8 bits at a time.
- *
- *  erasesize - size of an erase block in the flash device.
+/**
+ * struct nand_flash_dev - NAND Flash Device ID Structure
+ *
+ * @name:  	Identify the device type
+ * @id:   	device ID code
+ * @pagesize:  	Pagesize in bytes. Either 256 or 512 or 0
+ *		If the pagesize is 0, then the real pagesize 
+ *		and the eraseize are determined from the
+ *		extended id bytes in the chip
+ * @erasesize: 	Size of an erase block in the flash device.
+ * @chipsize:  	Total chipsize in Mega Bytes
+ * @options:	Bitfield to store chip relevant options
  */
 struct nand_flash_dev {
-	char * name;
+	char *name;
 	int id;
-	int chipshift;
+	unsigned long pagesize;
+	unsigned long chipsize;
 	unsigned long erasesize;
-	char page256;
+	unsigned long options;
 };
 
-/*
- * NAND Flash Manufacturer ID Structure
- *
- *  name - Manufacturer name
- *
- *  id - manufacturer ID code of device.
+/**
+ * struct nand_manufacturers - NAND Flash Manufacturer ID Structure
+ * @name:	Manufacturer name
+ * @id: 	manufacturer ID code of device.
 */
 struct nand_manufacturers {
 	int id;
@@ -236,9 +365,85 @@ struct nand_manufacturers {
 extern struct nand_flash_dev nand_flash_ids[];
 extern struct nand_manufacturers nand_manuf_ids[];
 
+/** 
+ * struct nand_bbt_descr - bad block table descriptor
+ * @options:	options for this descriptor
+ * @pages:	the page(s) where we find the bbt, used with option BBT_ABSPAGE
+ *		when bbt is searched, then we store the found bbts pages here.
+ *		Its an array and supports up to 8 chips now
+ * @offs:	offset of the pattern in the oob area of the page
+ * @veroffs:	offset of the bbt version counter in the oob are of the page
+ * @version:	version read from the bbt page during scan
+ * @len:	length of the pattern, if 0 no pattern check is performed
+ * @maxblocks:	maximum number of blocks to search for a bbt. This number of
+ *		blocks is reserved at the end of the device where the tables are 
+ *		written.
+ * @reserved_block_code: if non-0, this pattern denotes a reserved (rather than
+ *              bad) block in the stored bbt
+ * @pattern:	pattern to identify bad block table or factory marked good / 
+ *		bad blocks, can be NULL, if len = 0
+ *
+ * Descriptor for the bad block table marker and the descriptor for the 
+ * pattern which identifies good and bad blocks. The assumption is made
+ * that the pattern and the version count are always located in the oob area
+ * of the first block.
+ */
+struct nand_bbt_descr {
+	int	options;
+	int	pages[NAND_MAX_CHIPS];
+	int	offs;
+	int	veroffs;
+	uint8_t	version[NAND_MAX_CHIPS];
+	int	len;
+	int 	maxblocks;
+	int	reserved_block_code;
+	uint8_t	*pattern;
+};
+
+/* Options for the bad block table descriptors */
+
+/* The number of bits used per block in the bbt on the device */
+#define NAND_BBT_NRBITS_MSK	0x0000000F
+#define NAND_BBT_1BIT		0x00000001
+#define NAND_BBT_2BIT		0x00000002
+#define NAND_BBT_4BIT		0x00000004
+#define NAND_BBT_8BIT		0x00000008
+/* The bad block table is in the last good block of the device */
+#define	NAND_BBT_LASTBLOCK	0x00000010
+/* The bbt is at the given page, else we must scan for the bbt */
+#define NAND_BBT_ABSPAGE	0x00000020
+/* The bbt is at the given page, else we must scan for the bbt */
+#define NAND_BBT_SEARCH		0x00000040
+/* bbt is stored per chip on multichip devices */
+#define NAND_BBT_PERCHIP	0x00000080
+/* bbt has a version counter at offset veroffs */
+#define NAND_BBT_VERSION	0x00000100
+/* Create a bbt if none axists */
+#define NAND_BBT_CREATE		0x00000200
+/* Search good / bad pattern through all pages of a block */
+#define NAND_BBT_SCANALLPAGES	0x00000400
+/* Scan block empty during good / bad block scan */
+#define NAND_BBT_SCANEMPTY	0x00000800
+/* Write bbt if neccecary */
+#define NAND_BBT_WRITE		0x00001000
+/* Read and write back block contents when writing bbt */
+#define NAND_BBT_SAVECONTENT	0x00002000
+/* Search good / bad pattern on the first and the second page */
+#define NAND_BBT_SCAN2NDPAGE	0x00004000
+
+/* The maximum number of blocks to scan for a bbt */
+#define NAND_BBT_SCAN_MAXBLOCKS	4
+
+extern int nand_scan_bbt (struct mtd_info *mtd, struct nand_bbt_descr *bd);
+extern int nand_update_bbt (struct mtd_info *mtd, loff_t offs);
+extern int nand_default_bbt (struct mtd_info *mtd);
+extern int nand_isbad_bbt (struct mtd_info *mtd, loff_t offs, int allowbbt);
+extern int nand_erase_nand (struct mtd_info *mtd, struct erase_info *instr, int allowbbt);
+
 /*
 * Constants for oob configuration
 */
-#define NAND_BADBLOCK_POS		5
+#define NAND_SMALL_BADBLOCK_POS		5
+#define NAND_LARGE_BADBLOCK_POS		0
 
 #endif /* __LINUX_MTD_NAND_H */
diff --git a/include/linux/mtd/nand_ecc.h b/include/linux/mtd/nand_ecc.h
index c3b493c99..12c5bc342 100644
--- a/include/linux/mtd/nand_ecc.h
+++ b/include/linux/mtd/nand_ecc.h
@@ -3,7 +3,7 @@
  *
  *  Copyright (C) 2000 Steven J. Hill (sjhill@realitydiluted.com)
  *
- * $Id: nand_ecc.h,v 1.2 2003/02/20 13:34:20 sjhill Exp $
+ * $Id: nand_ecc.h,v 1.4 2004/06/17 02:35:02 dbrown Exp $
  *
  * 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
@@ -12,17 +12,19 @@
  * This file is the header for the ECC algorithm.
  */
 
-/*
- * Creates non-inverted ECC code from line parity
- */
-void nand_trans_result(u_char reg2, u_char reg3, u_char *ecc_code);
+#ifndef __MTD_NAND_ECC_H__
+#define __MTD_NAND_ECC_H__
+
+struct mtd_info;
 
 /*
  * Calculate 3 byte ECC code for 256 byte block
  */
-void nand_calculate_ecc (const u_char *dat, u_char *ecc_code);
+int nand_calculate_ecc(struct mtd_info *mtd, const u_char *dat, u_char *ecc_code);
 
 /*
  * Detect and correct a 1 bit error for 256 byte block
  */
-int nand_correct_data (u_char *dat, u_char *read_ecc, u_char *calc_ecc);
+int nand_correct_data(struct mtd_info *mtd, u_char *dat, u_char *read_ecc, u_char *calc_ecc);
+
+#endif /* __MTD_NAND_ECC_H__ */
diff --git a/include/linux/mtd/nftl.h b/include/linux/mtd/nftl.h
index fd57ffddd..d35d2c21f 100644
--- a/include/linux/mtd/nftl.h
+++ b/include/linux/mtd/nftl.h
@@ -1,5 +1,5 @@
 /*
- * $Id: nftl.h,v 1.13 2003/05/23 11:25:02 dwmw2 Exp $
+ * $Id: nftl.h,v 1.16 2004/06/30 14:49:00 dbrown Exp $
  *
  * (C) 1999-2003 David Woodhouse <dwmw2@infradead.org>
  */
@@ -10,71 +10,7 @@
 #include <linux/mtd/mtd.h>
 #include <linux/mtd/blktrans.h>
 
-/* Block Control Information */
-
-struct nftl_bci {
-	unsigned char ECCSig[6];
-	__u8 Status;
-	__u8 Status1;
-}__attribute__((packed));
-
-/* Unit Control Information */
-
-struct nftl_uci0 {
-	__u16 VirtUnitNum;
-	__u16 ReplUnitNum;
-	__u16 SpareVirtUnitNum;
-	__u16 SpareReplUnitNum;
-} __attribute__((packed));
-
-struct nftl_uci1 {
-	__u32 WearInfo;
-	__u16 EraseMark;
-	__u16 EraseMark1;
-} __attribute__((packed));
-
-struct nftl_uci2 {
-        __u16 FoldMark;
-        __u16 FoldMark1;
-	__u32 unused;
-} __attribute__((packed));
-
-union nftl_uci {
-	struct nftl_uci0 a;
-	struct nftl_uci1 b;
-	struct nftl_uci2 c;
-};
-
-struct nftl_oob {
-	struct nftl_bci b;
-	union nftl_uci u;
-};
-
-/* NFTL Media Header */
-
-struct NFTLMediaHeader {
-	char DataOrgID[6];
-	__u16 NumEraseUnits;
-	__u16 FirstPhysicalEUN;
-	__u32 FormattedSize;
-	unsigned char UnitSizeFactor;
-} __attribute__((packed));
-
-#define MAX_ERASE_ZONES (8192 - 512)
-
-#define ERASE_MARK 0x3c69
-#define SECTOR_FREE 0xff
-#define SECTOR_USED 0x55
-#define SECTOR_IGNORE 0x11
-#define SECTOR_DELETED 0x00
-
-#define FOLD_MARK_IN_PROGRESS 0x5555
-
-#define ZONE_GOOD 0xff
-#define ZONE_BAD_ORIGINAL 0
-#define ZONE_BAD_MARKED 7
-
-#ifdef __KERNEL__
+#include <mtd/nftl-user.h>
 
 /* these info are used in ReplUnitTable */
 #define BLOCK_NIL          0xffff /* last block of a chain */
@@ -101,6 +37,7 @@ struct NFTLrecord {
         unsigned int nb_blocks;		/* number of physical blocks */
         unsigned int nb_boot_blocks;	/* number of blocks used by the bios */
         struct erase_info instr;
+	struct nand_oobinfo oobinfo;
 };
 
 int NFTL_mount(struct NFTLrecord *s);
@@ -114,6 +51,4 @@ int NFTL_formatblock(struct NFTLrecord *s, int block);
 #define MAX_SECTORS_PER_UNIT 64
 #define NFTL_PARTN_BITS 4
 
-#endif /* __KERNEL__ */
-
 #endif /* __MTD_NFTL_H__ */
diff --git a/include/linux/mtd/partitions.h b/include/linux/mtd/partitions.h
index 5c5f8770b..100ea79de 100644
--- a/include/linux/mtd/partitions.h
+++ b/include/linux/mtd/partitions.h
@@ -5,7 +5,7 @@
  *
  * This code is GPL
  *
- * $Id: partitions.h,v 1.14 2003/05/20 21:56:29 dwmw2 Exp $
+ * $Id: partitions.h,v 1.15 2003/07/09 11:15:43 dwmw2 Exp $
  */
 
 #ifndef MTD_PARTITIONS_H
@@ -50,7 +50,7 @@ struct mtd_partition {
 #define MTDPART_SIZ_FULL	(0)
 
 
-int add_mtd_partitions(struct mtd_info *, struct mtd_partition *, int);
+int add_mtd_partitions(struct mtd_info *, const struct mtd_partition *, int);
 int del_mtd_partitions(struct mtd_info *);
 
 /*
diff --git a/include/linux/mtd/physmap.h b/include/linux/mtd/physmap.h
index d522d43d4..05aa49706 100644
--- a/include/linux/mtd/physmap.h
+++ b/include/linux/mtd/physmap.h
@@ -2,7 +2,7 @@
  * For boards with physically mapped flash and using 
  * drivers/mtd/maps/physmap.c mapping driver.
  *
- * $Id: physmap.h,v 1.2 2004/07/14 17:48:46 dwmw2 Exp $
+ * $Id: physmap.h,v 1.3 2004/07/21 00:16:15 jwboyer Exp $
  *
  * Copyright (C) 2003 MontaVista Software Inc.
  * Author: Jun Sun, jsun@mvista.com or jsun@junsun.net
@@ -33,11 +33,11 @@ extern struct map_info physmap_map;
 /*
  * Board needs to specify the exact mapping during their setup time.
  */
-static inline void physmap_configure(unsigned long addr, unsigned long size, int buswidth, void (*set_vpp)(struct map_info *, int) )
+static inline void physmap_configure(unsigned long addr, unsigned long size, int bankwidth, void (*set_vpp)(struct map_info *, int) )
 {
 	physmap_map.phys = addr;
 	physmap_map.size = size;
-	physmap_map.buswidth = buswidth;
+	physmap_map.bankwidth = bankwidth;
 	physmap_map.set_vpp = set_vpp;
 }
 
diff --git a/include/linux/mtio.h b/include/linux/mtio.h
index 692088c63..4f2daa83d 100644
--- a/include/linux/mtio.h
+++ b/include/linux/mtio.h
@@ -204,7 +204,7 @@ struct mtftseg
 	unsigned mt_segno;   /* the segment to read or write */
 	unsigned mt_mode;    /* modes for read/write (sync/async etc.) */
 	int      mt_result;  /* result of r/w request, not of the ioctl */
-	void    *mt_data;    /* User space buffer: must be 29kb */
+	void    __user *mt_data;    /* User space buffer: must be 29kb */
 };
 
 /* get tape capacity (ftape/zftape)
diff --git a/include/linux/namei.h b/include/linux/namei.h
index 4117cd90a..1bbfa296e 100644
--- a/include/linux/namei.h
+++ b/include/linux/namei.h
@@ -10,12 +10,16 @@ struct open_intent {
 	int	create_mode;
 };
 
+enum { MAX_NESTED_LINKS = 5 };
+
 struct nameidata {
 	struct dentry	*dentry;
 	struct vfsmount *mnt;
 	struct qstr	last;
 	unsigned int	flags;
 	int		last_type;
+	unsigned	depth;
+	char *saved_names[MAX_NESTED_LINKS + 1];
 
 	/* Intent data */
 	union {
@@ -57,6 +61,7 @@ extern int FASTCALL(path_lookup(const char *, unsigned, struct nameidata *));
 extern int FASTCALL(path_walk(const char *, struct nameidata *));
 extern int FASTCALL(link_path_walk(const char *, struct nameidata *));
 extern void path_release(struct nameidata *);
+extern void path_release_on_umount(struct nameidata *);
 
 extern struct dentry * lookup_one_len(const char *, struct dentry *, int);
 extern struct dentry * lookup_hash(struct qstr *, struct dentry *);
@@ -67,4 +72,14 @@ extern int follow_up(struct vfsmount **, struct dentry **);
 extern struct dentry *lock_rename(struct dentry *, struct dentry *);
 extern void unlock_rename(struct dentry *, struct dentry *);
 
+static inline void nd_set_link(struct nameidata *nd, char *path)
+{
+	nd->saved_names[nd->depth] = path;
+}
+
+static inline char *nd_get_link(struct nameidata *nd)
+{
+	return nd->saved_names[nd->depth];
+}
+
 #endif /* _LINUX_NAMEI_H */
diff --git a/include/linux/namespace.h b/include/linux/namespace.h
index ae9c17d6e..8728b3030 100644
--- a/include/linux/namespace.h
+++ b/include/linux/namespace.h
@@ -15,7 +15,7 @@ struct namespace {
 extern void umount_tree(struct vfsmount *);
 extern void umount_unused(struct vfsmount *, struct fs_struct *);
 extern int copy_namespace(int, struct task_struct *);
-void __put_namespace(struct namespace *namespace);
+extern void __put_namespace(struct namespace *namespace);
 
 static inline void put_namespace(struct namespace *namespace)
 {
diff --git a/include/linux/ncp_fs.h b/include/linux/ncp_fs.h
index 9e2f1923c..d9ab889ed 100644
--- a/include/linux/ncp_fs.h
+++ b/include/linux/ncp_fs.h
@@ -24,7 +24,7 @@
 struct ncp_ioctl_request {
 	unsigned int function;
 	unsigned int size;
-	char *data;
+	char __user *data;
 };
 
 struct ncp_fs_info {
@@ -88,13 +88,13 @@ struct ncp_objectname_ioctl
 #define NCP_AUTH_NDS	0x32
 	int		auth_type;
 	size_t		object_name_len;
-	void*		object_name;	/* an userspace data, in most cases user name */
+	void __user *	object_name;	/* an userspace data, in most cases user name */
 };
 
 struct ncp_privatedata_ioctl
 {
 	size_t		len;
-	void*		data;		/* ~1000 for NDS */
+	void __user *	data;		/* ~1000 for NDS */
 };
 
 /* NLS charsets by ioctl */
diff --git a/include/linux/net.h b/include/linux/net.h
index 1f531a9b5..22daf7858 100644
--- a/include/linux/net.h
+++ b/include/linux/net.h
@@ -143,6 +143,7 @@ struct net_proto_family {
 };
 
 struct iovec;
+struct kvec;
 
 extern int	     sock_wake_async(struct socket *sk, int how, int band);
 extern int	     sock_register(struct net_proto_family *fam);
@@ -170,6 +171,12 @@ extern int	     net_ratelimit(void);
 extern unsigned long net_random(void);
 extern void	     net_srandom(unsigned long);
 
+extern int   	     kernel_sendmsg(struct socket *sock, struct msghdr *msg,
+				    struct kvec *vec, size_t num, size_t len);
+extern int   	     kernel_recvmsg(struct socket *sock, struct msghdr *msg,
+				    struct kvec *vec, size_t num,
+				    size_t len, int flags);
+
 #ifndef CONFIG_SMP
 #define SOCKOPS_WRAPPED(name) name
 #define SOCKOPS_WRAP(name, fam)
diff --git a/include/linux/netdevice.h b/include/linux/netdevice.h
index a55f97a34..5edb93f16 100644
--- a/include/linux/netdevice.h
+++ b/include/linux/netdevice.h
@@ -362,10 +362,12 @@ struct net_device
 
 	struct Qdisc		*qdisc;
 	struct Qdisc		*qdisc_sleeping;
-	struct Qdisc		*qdisc_list;
 	struct Qdisc		*qdisc_ingress;
+	struct list_head	qdisc_list;
 	unsigned long		tx_queue_len;	/* Max frames per queue allowed */
 
+	/* ingress path synchronizer */
+	spinlock_t		ingress_lock;
 	/* hard_start_xmit synchronizer */
 	spinlock_t		xmit_lock;
 	/* cpu id of processor entered to hard_start_xmit or -1,
@@ -405,6 +407,7 @@ struct net_device
 #define NETIF_F_HW_VLAN_FILTER	512	/* Receive filtering on VLAN */
 #define NETIF_F_VLAN_CHALLENGED	1024	/* Device cannot handle VLAN packets */
 #define NETIF_F_TSO		2048	/* Can offload TCP/IP segmentation */
+#define NETIF_F_LLTX		4096	/* LockLess TX */
 
 	/* Called after device is detached from network. */
 	void			(*uninit)(struct net_device *dev);
@@ -469,12 +472,6 @@ struct net_device
 	/* bridge stuff */
 	struct net_bridge_port	*br_port;
 
-#ifdef CONFIG_NET_FASTROUTE
-#define NETDEV_FASTROUTE_HMASK 0xF
-	/* Semi-private data. Keep it at the end of device struct. */
-	rwlock_t		fastpath_lock;
-	struct dst_entry	*fastpath[NETDEV_FASTROUTE_HMASK+1];
-#endif
 #ifdef CONFIG_NET_DIVERT
 	/* this will get initialized at each interface type init routine */
 	struct divert_blk	*divert;
@@ -562,7 +559,7 @@ typedef int gifconf_func_t(struct net_device * dev, char __user * bufptr, int le
 extern int		register_gifconf(unsigned int family, gifconf_func_t * gifconf);
 static inline int unregister_gifconf(unsigned int family)
 {
-	return register_gifconf(family, 0);
+	return register_gifconf(family, NULL);
 }
 
 /*
@@ -944,11 +941,6 @@ extern unsigned long	netdev_fc_xoff;
 extern atomic_t netdev_dropping;
 extern int		netdev_set_master(struct net_device *dev, struct net_device *master);
 extern int skb_checksum_help(struct sk_buff **pskb, int inward);
-#ifdef CONFIG_NET_FASTROUTE
-extern int		netdev_fastroute;
-extern int		netdev_fastroute_obstacles;
-extern void		dev_clear_fastroute(struct net_device *dev);
-#endif
 
 #ifdef CONFIG_SYSCTL
 extern char *net_sysctl_strdup(const char *s);
diff --git a/include/linux/netfilter.h b/include/linux/netfilter.h
index b20c79258..83f966865 100644
--- a/include/linux/netfilter.h
+++ b/include/linux/netfilter.h
@@ -10,6 +10,7 @@
 #include <linux/wait.h>
 #include <linux/list.h>
 #endif
+#include <linux/compiler.h>
 
 /* Responses from hook functions. */
 #define NF_DROP 0
diff --git a/include/linux/netfilter_arp/arp_tables.h b/include/linux/netfilter_arp/arp_tables.h
index 78c4f7142..d6a7188b5 100644
--- a/include/linux/netfilter_arp/arp_tables.h
+++ b/include/linux/netfilter_arp/arp_tables.h
@@ -16,7 +16,7 @@
 #include <linux/if_arp.h>
 #include <linux/skbuff.h>
 #endif
-
+#include <linux/compiler.h>
 #include <linux/netfilter_arp.h>
 
 #define ARPT_FUNCTION_MAXNAMELEN 30
diff --git a/include/linux/netfilter_ipv4/ip_conntrack.h b/include/linux/netfilter_ipv4/ip_conntrack.h
index 26d7f3a11..1974f162f 100644
--- a/include/linux/netfilter_ipv4/ip_conntrack.h
+++ b/include/linux/netfilter_ipv4/ip_conntrack.h
@@ -103,7 +103,7 @@ union ip_conntrack_nat_help {
 #include <linux/types.h>
 #include <linux/skbuff.h>
 
-#ifdef CONFIG_NF_DEBUG
+#ifdef CONFIG_NETFILTER_DEBUG
 #define IP_NF_ASSERT(x)							\
 do {									\
 	if (!(x))							\
diff --git a/include/linux/netfilter_ipv4/ip_tables.h b/include/linux/netfilter_ipv4/ip_tables.h
index f43f1ddde..b4c2b2b38 100644
--- a/include/linux/netfilter_ipv4/ip_tables.h
+++ b/include/linux/netfilter_ipv4/ip_tables.h
@@ -22,6 +22,7 @@
 #include <linux/ip.h>
 #include <linux/skbuff.h>
 #endif
+#include <linux/compiler.h>
 #include <linux/netfilter_ipv4.h>
 
 #define IPT_FUNCTION_MAXNAMELEN 30
@@ -283,8 +284,6 @@ struct ipt_get_entries
 	struct ipt_entry entrytable[0];
 };
 
-extern struct semaphore ipt_mutex;
-
 /* Standard return verdict, or do jump. */
 #define IPT_STANDARD_TARGET ""
 /* Error verdict. */
@@ -336,8 +335,8 @@ ipt_get_target(struct ipt_entry *e)
 /*
  *	Main firewall chains definitions and global var's definitions.
  */
-static DECLARE_MUTEX(ipt_mutex);
 #ifdef __KERNEL__
+static DECLARE_MUTEX(ipt_mutex);
 
 #include <linux/init.h>
 extern void ipt_init(void) __init;
diff --git a/include/linux/netfilter_ipv6/ip6_tables.h b/include/linux/netfilter_ipv6/ip6_tables.h
index a09952719..f9983d16c 100644
--- a/include/linux/netfilter_ipv6/ip6_tables.h
+++ b/include/linux/netfilter_ipv6/ip6_tables.h
@@ -22,6 +22,7 @@
 #include <linux/ipv6.h>
 #include <linux/skbuff.h>
 #endif
+#include <linux/compiler.h>
 #include <linux/netfilter_ipv6.h>
 
 #define IP6T_FUNCTION_MAXNAMELEN 30
@@ -106,7 +107,9 @@ struct ip6t_counters
 	u_int64_t pcnt, bcnt;			/* Packet and byte counters */
 };
 
+#ifdef __KERNEL__
 static DECLARE_MUTEX(ip6t_mutex);
+#endif
 
 /* Values for "flag" field in struct ip6t_ip6 (general ip6 structure). */
 #define IP6T_F_PROTO		0x01	/* Set if rule cares about upper 
diff --git a/include/linux/netlink.h b/include/linux/netlink.h
index 0602eaffb..670558170 100644
--- a/include/linux/netlink.h
+++ b/include/linux/netlink.h
@@ -73,7 +73,8 @@ struct nlmsghdr
 #define NLMSG_DATA(nlh)  ((void*)(((char*)nlh) + NLMSG_LENGTH(0)))
 #define NLMSG_NEXT(nlh,len)	 ((len) -= NLMSG_ALIGN((nlh)->nlmsg_len), \
 				  (struct nlmsghdr*)(((char*)(nlh)) + NLMSG_ALIGN((nlh)->nlmsg_len)))
-#define NLMSG_OK(nlh,len) ((len) > 0 && (nlh)->nlmsg_len >= sizeof(struct nlmsghdr) && \
+#define NLMSG_OK(nlh,len) ((len) >= (int)sizeof(struct nlmsghdr) && \
+			   (nlh)->nlmsg_len >= sizeof(struct nlmsghdr) && \
 			   (nlh)->nlmsg_len <= (len))
 #define NLMSG_PAYLOAD(nlh,len) ((nlh)->nlmsg_len - NLMSG_SPACE((len)))
 
@@ -90,6 +91,11 @@ struct nlmsgerr
 
 #define NET_MAJOR 36		/* Major 36 is reserved for networking 						*/
 
+enum {
+	NETLINK_UNCONNECTED = 0,
+	NETLINK_CONNECTED,
+};
+
 #ifdef __KERNEL__
 
 #include <linux/capability.h>
diff --git a/include/linux/nfs4_mount.h b/include/linux/nfs4_mount.h
index 9a782c2bb..26b4c83f8 100644
--- a/include/linux/nfs4_mount.h
+++ b/include/linux/nfs4_mount.h
@@ -20,7 +20,7 @@
 
 struct nfs_string {
 	unsigned int len;
-	const char* data;
+	const char __user * data;
 };
 
 struct nfs4_mount_data {
@@ -45,14 +45,14 @@ struct nfs4_mount_data {
 	struct nfs_string hostname;		/* 1 */
 	/* Server IP address */
 	unsigned int host_addrlen;		/* 1 */
-	struct sockaddr* host_addr;		/* 1 */
+	struct sockaddr __user * host_addr;	/* 1 */
 
 	/* Transport protocol to use */
 	int proto;				/* 1 */
 
 	/* Pseudo-flavours to use for authentication. See RFC2623 */
 	int auth_flavourlen;			/* 1 */
-	int *auth_flavours;			/* 1 */
+	int __user *auth_flavours;		/* 1 */
 };
 
 /* bits in the flags field */
diff --git a/include/linux/nfsd/cache.h b/include/linux/nfsd/cache.h
index 25d2c099e..cfffc76fc 100644
--- a/include/linux/nfsd/cache.h
+++ b/include/linux/nfsd/cache.h
@@ -33,7 +33,7 @@ struct svc_cacherep {
 	u32			c_vers;
 	unsigned long		c_timestamp;
 	union {
-		struct iovec	u_vec;
+		struct kvec	u_vec;
 		u32		u_status;
 	}			c_u;
 };
diff --git a/include/linux/nfsd/nfsd.h b/include/linux/nfsd/nfsd.h
index e18185256..5757370b0 100644
--- a/include/linux/nfsd/nfsd.h
+++ b/include/linux/nfsd/nfsd.h
@@ -92,9 +92,9 @@ int		nfsd_open(struct svc_rqst *, struct svc_fh *, int,
 				int, struct file *);
 void		nfsd_close(struct file *);
 int		nfsd_read(struct svc_rqst *, struct svc_fh *,
-				loff_t, struct iovec *,int, unsigned long *);
+				loff_t, struct kvec *,int, unsigned long *);
 int		nfsd_write(struct svc_rqst *, struct svc_fh *,
-				loff_t, struct iovec *,int, unsigned long, int *);
+				loff_t, struct kvec *,int, unsigned long, int *);
 int		nfsd_readlink(struct svc_rqst *, struct svc_fh *,
 				char *, int *);
 int		nfsd_symlink(struct svc_rqst *, struct svc_fh *,
@@ -126,9 +126,13 @@ int		nfsd_permission(struct svc_export *, struct dentry *, int);
 #ifdef CONFIG_NFSD_V4
 void nfs4_state_init(void);
 void nfs4_state_shutdown(void);
+time_t nfs4_lease_time(void);
+void nfs4_reset_lease(time_t leasetime);
 #else
 void static inline nfs4_state_init(void){}
 void static inline nfs4_state_shutdown(void){}
+time_t static inline nfs4_lease_time(void){return 0;}
+void static inline nfs4_reset_lease(time_t leasetime){}
 #endif
 
 /*
@@ -249,7 +253,7 @@ static inline int is_fsid(struct svc_fh *fh, struct knfsd_fh *reffh)
 #define	COMPOUND_SLACK_SPACE		140    /* OP_GETFH */
 #define COMPOUND_ERR_SLACK_SPACE	12     /* OP_SETATTR */
 
-#define NFSD_LEASE_TIME			60  /* seconds */
+#define NFSD_LEASE_TIME                 (nfs4_lease_time())
 #define NFSD_LAUNDROMAT_MINTIMEOUT      10   /* seconds */
 
 /*
diff --git a/include/linux/nfsd/state.h b/include/linux/nfsd/state.h
index 06da18506..32ffcd82d 100644
--- a/include/linux/nfsd/state.h
+++ b/include/linux/nfsd/state.h
@@ -38,6 +38,7 @@
 #define _NFSD4_STATE_H
 
 #include <linux/list.h>
+#include <linux/sunrpc/clnt.h>
 
 #define NFS4_OPAQUE_LIMIT 1024
 typedef struct {
@@ -65,6 +66,22 @@ extern stateid_t onestateid;
 #define ZERO_STATEID(stateid)       (!memcmp((stateid), &zerostateid, sizeof(stateid_t)))
 #define ONE_STATEID(stateid)        (!memcmp((stateid), &onestateid, sizeof(stateid_t)))
 
+/* client delegation callback info */
+struct nfs4_callback {
+	/* SETCLIENTID info */
+	u32			cb_parsed;  /* addr parsed */
+	u32                     cb_addr;
+	unsigned short          cb_port;
+	u32                     cb_prog;
+	u32                     cb_ident;
+	struct xdr_netobj	cb_netid;
+	/* RPC client info */
+	u32			cb_set;     /* successful CB_NULL call */
+	struct rpc_program      cb_program;
+	struct rpc_stat         cb_stat;
+	struct rpc_clnt *       cb_client;
+};
+
 /*
  * struct nfs4_client - one per client.  Clientids live here.
  * 	o Each nfs4_client is hashed by clientid.
@@ -87,6 +104,20 @@ struct nfs4_client {
 	struct svc_cred		cl_cred; 	/* setclientid principal */
 	clientid_t		cl_clientid;	/* generated by server */
 	nfs4_verifier		cl_confirm;	/* generated by server */
+	struct nfs4_callback	cl_callback;    /* callback info */
+	time_t			cl_first_state; /* first state aquisition*/
+};
+
+/* struct nfs4_client_reset
+ * one per old client. Populates reset_str_hashtbl. Filled from conf_id_hashtbl
+ * upon lease reset, or from upcall to state_daemon (to read in state
+ * from non-volitile storage) upon reboot.
+ */
+struct nfs4_client_reclaim {
+	struct list_head	cr_strhash;	/* hash by cr_name */
+	struct xdr_netobj 	cr_name; 	/* id generated by client */
+	time_t			cr_first_state; /* first state aquisition */
+	u32			cr_expired;     /* boolean: lease expired? */
 };
 
 static inline void
@@ -216,5 +247,5 @@ extern int nfs4_share_conflict(struct svc_fh *current_fh,
 extern void nfs4_lock_state(void);
 extern void nfs4_unlock_state(void);
 extern int nfs4_in_grace(void);
-extern int nfs4_in_no_grace(void);
+extern int nfs4_check_open_reclaim(clientid_t *clid);
 #endif   /* NFSD4_STATE_H */
diff --git a/include/linux/nfsd/xdr.h b/include/linux/nfsd/xdr.h
index 0164bd1fc..ecccef777 100644
--- a/include/linux/nfsd/xdr.h
+++ b/include/linux/nfsd/xdr.h
@@ -30,7 +30,7 @@ struct nfsd_readargs {
 	struct svc_fh		fh;
 	__u32			offset;
 	__u32			count;
-	struct iovec		vec[RPCSVC_MAXPAGES];
+	struct kvec		vec[RPCSVC_MAXPAGES];
 	int			vlen;
 };
 
@@ -38,7 +38,7 @@ struct nfsd_writeargs {
 	svc_fh			fh;
 	__u32			offset;
 	int			len;
-	struct iovec		vec[RPCSVC_MAXPAGES];
+	struct kvec		vec[RPCSVC_MAXPAGES];
 	int			vlen;
 };
 
diff --git a/include/linux/nfsd/xdr3.h b/include/linux/nfsd/xdr3.h
index 13afff346..0ae9e0ef5 100644
--- a/include/linux/nfsd/xdr3.h
+++ b/include/linux/nfsd/xdr3.h
@@ -33,7 +33,7 @@ struct nfsd3_readargs {
 	struct svc_fh		fh;
 	__u64			offset;
 	__u32			count;
-	struct iovec		vec[RPCSVC_MAXPAGES];
+	struct kvec		vec[RPCSVC_MAXPAGES];
 	int			vlen;
 };
 
@@ -43,7 +43,7 @@ struct nfsd3_writeargs {
 	__u32			count;
 	int			stable;
 	int			len;
-	struct iovec		vec[RPCSVC_MAXPAGES];
+	struct kvec		vec[RPCSVC_MAXPAGES];
 	int			vlen;
 };
 
diff --git a/include/linux/nfsd/xdr4.h b/include/linux/nfsd/xdr4.h
index df35cb397..ff18ed764 100644
--- a/include/linux/nfsd/xdr4.h
+++ b/include/linux/nfsd/xdr4.h
@@ -241,7 +241,7 @@ struct nfsd4_read {
 	stateid_t	rd_stateid;         /* request */
 	u64		rd_offset;          /* request */
 	u32		rd_length;          /* request */
-	struct iovec	rd_iov[RPCSVC_MAXPAGES];
+	struct kvec	rd_iov[RPCSVC_MAXPAGES];
 	int		rd_vlen;
 	
 	struct svc_rqst *rd_rqstp;          /* response */
@@ -324,7 +324,7 @@ struct nfsd4_write {
 	u64		wr_offset;          /* request */
 	u32		wr_stable_how;      /* request */
 	u32		wr_buflen;          /* request */
-	struct iovec	wr_vec[RPCSVC_MAXPAGES]; /* request */
+	struct kvec	wr_vec[RPCSVC_MAXPAGES]; /* request */
 	int		wr_vlen;
 
 	u32		wr_bytes_written;   /* response */
@@ -378,6 +378,7 @@ struct nfsd4_compoundargs {
 	u32 *				tmpp;
 	struct tmpbuf {
 		struct tmpbuf *next;
+		void (*release)(const void *);
 		void *buf;
 	}				*to_free;
 
@@ -449,6 +450,7 @@ extern int nfsd4_locku(struct svc_rqst *rqstp, struct svc_fh *current_fh,
 extern int
 nfsd4_release_lockowner(struct svc_rqst *rqstp,
 		struct nfsd4_release_lockowner *rlockowner);
+extern void nfsd4_release_compoundargs(struct nfsd4_compoundargs *);
 #endif
 
 /*
diff --git a/include/linux/oprofile.h b/include/linux/oprofile.h
index 80cfea0fa..f17c89c37 100644
--- a/include/linux/oprofile.h
+++ b/include/linux/oprofile.h
@@ -65,6 +65,9 @@ extern void oprofile_add_sample(unsigned long eip, unsigned int is_kernel,
  */
 int oprofilefs_create_file(struct super_block * sb, struct dentry * root,
 	char const * name, struct file_operations * fops);
+
+int oprofilefs_create_file_perm(struct super_block * sb, struct dentry * root,
+	char const * name, struct file_operations * fops, int perm);
  
 /** Create a file for read/write access to an unsigned long. */
 int oprofilefs_create_ulong(struct super_block * sb, struct dentry * root,
diff --git a/include/linux/page-flags.h b/include/linux/page-flags.h
index 1d376d042..c6f5063f0 100644
--- a/include/linux/page-flags.h
+++ b/include/linux/page-flags.h
@@ -194,16 +194,10 @@ extern unsigned long __read_page_state(unsigned offset);
 #define ClearPageReferenced(page)	clear_bit(PG_referenced, &(page)->flags)
 #define TestClearPageReferenced(page) test_and_clear_bit(PG_referenced, &(page)->flags)
 
-#ifndef arch_set_page_uptodate
-#define arch_set_page_uptodate(page) do { } while (0)
-#endif
-
 #define PageUptodate(page)	test_bit(PG_uptodate, &(page)->flags)
-#define SetPageUptodate(page) \
-	do {								\
-		arch_set_page_uptodate(page);				\
-		set_bit(PG_uptodate, &(page)->flags);			\
-	} while (0)
+#ifndef SetPageUptodate
+#define SetPageUptodate(page)	set_bit(PG_uptodate, &(page)->flags)
+#endif
 #define ClearPageUptodate(page)	clear_bit(PG_uptodate, &(page)->flags)
 
 #define PageDirty(page)		test_bit(PG_dirty, &(page)->flags)
diff --git a/include/linux/pagemap.h b/include/linux/pagemap.h
index 427b696f4..4da205f3c 100644
--- a/include/linux/pagemap.h
+++ b/include/linux/pagemap.h
@@ -8,6 +8,7 @@
 #include <linux/fs.h>
 #include <linux/list.h>
 #include <linux/highmem.h>
+#include <linux/compiler.h>
 #include <asm/uaccess.h>
 #include <linux/gfp.h>
 
@@ -136,7 +137,10 @@ static inline void pagecache_acct(int count)
 
 static inline unsigned long get_page_cache_size(void)
 {
-        return atomic_read(&nr_pagecache);
+	int ret = atomic_read(&nr_pagecache);
+	if (unlikely(ret < 0))
+		ret = 0;
+	return ret;
 }
 
 static inline pgoff_t linear_page_index(struct vm_area_struct *vma,
diff --git a/include/linux/pci.h b/include/linux/pci.h
index 2662f462b..2ce5f957c 100644
--- a/include/linux/pci.h
+++ b/include/linux/pci.h
@@ -321,6 +321,50 @@
 #define  PCI_X_STATUS_266MHZ	0x40000000	/* 266 MHz capable */
 #define  PCI_X_STATUS_533MHZ	0x80000000	/* 533 MHz capable */
 
+/* PCI Express capability registers */
+
+#define PCI_EXP_FLAGS		2	/* Capabilities register */
+#define PCI_EXP_FLAGS_VERS	0x000f	/* Capability version */
+#define PCI_EXP_FLAGS_TYPE	0x00f0	/* Device/Port type */
+#define  PCI_EXP_TYPE_ENDPOINT	0x0	/* Express Endpoint */
+#define  PCI_EXP_TYPE_LEG_END	0x1	/* Legacy Endpoint */
+#define  PCI_EXP_TYPE_ROOT_PORT 0x4	/* Root Port */
+#define  PCI_EXP_TYPE_UPSTREAM	0x5	/* Upstream Port */
+#define  PCI_EXP_TYPE_DOWNSTREAM 0x6	/* Downstream Port */
+#define  PCI_EXP_TYPE_PCI_BRIDGE 0x7	/* PCI/PCI-X Bridge */
+#define PCI_EXP_FLAGS_SLOT	0x0100	/* Slot implemented */
+#define PCI_EXP_FLAGS_IRQ	0x3e00	/* Interrupt message number */
+#define PCI_EXP_DEVCAP		4	/* Device capabilities */
+#define  PCI_EXP_DEVCAP_PAYLOAD	0x07	/* Max_Payload_Size */
+#define  PCI_EXP_DEVCAP_PHANTOM	0x18	/* Phantom functions */
+#define  PCI_EXP_DEVCAP_EXT_TAG	0x20	/* Extended tags */
+#define  PCI_EXP_DEVCAP_L0S	0x1c0	/* L0s Acceptable Latency */
+#define  PCI_EXP_DEVCAP_L1	0xe00	/* L1 Acceptable Latency */
+#define  PCI_EXP_DEVCAP_ATN_BUT	0x1000	/* Attention Button Present */
+#define  PCI_EXP_DEVCAP_ATN_IND	0x2000	/* Attention Indicator Present */
+#define  PCI_EXP_DEVCAP_PWR_IND	0x4000	/* Power Indicator Present */
+#define  PCI_EXP_DEVCAP_PWR_VAL	0x3fc0000 /* Slot Power Limit Value */
+#define  PCI_EXP_DEVCAP_PWR_SCL	0xc000000 /* Slot Power Limit Scale */
+#define PCI_EXP_DEVCTL		8	/* Device Control */
+#define  PCI_EXP_DEVCTL_CERE	0x0001	/* Correctable Error Reporting En. */
+#define  PCI_EXP_DEVCTL_NFERE	0x0002	/* Non-Fatal Error Reporting Enable */
+#define  PCI_EXP_DEVCTL_FERE	0x0004	/* Fatal Error Reporting Enable */
+#define  PCI_EXP_DEVCTL_URRE	0x0008	/* Unsupported Request Reporting En. */
+#define  PCI_EXP_DEVCTL_RELAX_EN 0x0010 /* Enable relaxed ordering */
+#define  PCI_EXP_DEVCTL_PAYLOAD	0x00e0	/* Max_Payload_Size */
+#define  PCI_EXP_DEVCTL_EXT_TAG	0x0100	/* Extended Tag Field Enable */
+#define  PCI_EXP_DEVCTL_PHANTOM	0x0200	/* Phantom Functions Enable */
+#define  PCI_EXP_DEVCTL_AUX_PME	0x0400	/* Auxiliary Power PM Enable */
+#define  PCI_EXP_DEVCTL_NOSNOOP_EN 0x0800  /* Enable No Snoop */
+#define  PCI_EXP_DEVCTL_READRQ	0x7000	/* Max_Read_Request_Size */
+#define PCI_EXP_DEVSTA		10	/* Device Status */
+#define  PCI_EXP_DEVSTA_CED	0x01	/* Correctable Error Detected */
+#define  PCI_EXP_DEVSTA_NFED	0x02	/* Non-Fatal Error Detected */
+#define  PCI_EXP_DEVSTA_FED	0x04	/* Fatal Error Detected */
+#define  PCI_EXP_DEVSTA_URD	0x08	/* Unsupported Request Detected */
+#define  PCI_EXP_DEVSTA_AUXPD	0x10	/* AUX Power Detected */
+#define  PCI_EXP_DEVSTA_TRPND	0x20	/* Transactions Pending */
+
 /* Extended Capabilities (PCI-X 2.0 and Express) */
 #define PCI_EXT_CAP_ID(header)		(header & 0x0000ffff)
 #define PCI_EXT_CAP_VER(header)		((header >> 16) & 0xf)
@@ -659,6 +703,7 @@ static inline struct pci_bus *pci_scan_bus(int bus, struct pci_ops *ops, void *s
 }
 int pci_scan_slot(struct pci_bus *bus, int devfn);
 struct pci_dev * pci_scan_single_device(struct pci_bus *bus, int devfn);
+unsigned int pci_scan_child_bus(struct pci_bus *bus);
 void pci_bus_add_devices(struct pci_bus *bus);
 void pci_name_device(struct pci_dev *dev);
 char *pci_class_name(u32 class);
@@ -786,16 +831,27 @@ int pci_scan_bridge(struct pci_bus *bus, struct pci_dev * dev, int max, int pass
 extern struct pci_dev *isa_bridge;
 #endif
 
-#ifndef CONFIG_PCI_USE_VECTOR
+struct msix_entry {
+	u16 	vector;	/* kernel uses to write allocated vector */
+	u16	entry;	/* driver uses to specify entry, OS writes */
+};
+
+#ifndef CONFIG_PCI_MSI
 static inline void pci_scan_msi_device(struct pci_dev *dev) {}
 static inline int pci_enable_msi(struct pci_dev *dev) {return -1;}
+static inline void pci_disable_msi(struct pci_dev *dev) {}
+static inline int pci_enable_msix(struct pci_dev* dev,
+	struct msix_entry *entries, int nvec) {return -1;}
+static inline void pci_disable_msix(struct pci_dev *dev) {}
 static inline void msi_remove_pci_irq_vectors(struct pci_dev *dev) {}
 #else
 extern void pci_scan_msi_device(struct pci_dev *dev);
 extern int pci_enable_msi(struct pci_dev *dev);
+extern void pci_disable_msi(struct pci_dev *dev);
+extern int pci_enable_msix(struct pci_dev* dev,
+	struct msix_entry *entries, int nvec);
+extern void pci_disable_msix(struct pci_dev *dev);
 extern void msi_remove_pci_irq_vectors(struct pci_dev *dev);
-extern int msi_alloc_vectors(struct pci_dev* dev, int *vector, int nvec);
-extern int msi_free_vectors(struct pci_dev* dev, int *vector, int nvec);
 #endif
 
 #endif /* CONFIG_PCI */
diff --git a/include/linux/pci_ids.h b/include/linux/pci_ids.h
index 2a1a53f90..50a747035 100644
--- a/include/linux/pci_ids.h
+++ b/include/linux/pci_ids.h
@@ -967,12 +967,14 @@
 
 #define PCI_VENDOR_ID_3COM		0x10b7
 #define PCI_DEVICE_ID_3COM_3C985	0x0001
+#define PCI_DEVICE_ID_3COM_3C940	0x1700
 #define PCI_DEVICE_ID_3COM_3C339	0x3390
 #define PCI_DEVICE_ID_3COM_3C359	0x3590
 #define PCI_DEVICE_ID_3COM_3C590	0x5900
 #define PCI_DEVICE_ID_3COM_3C595TX	0x5950
 #define PCI_DEVICE_ID_3COM_3C595T4	0x5951
 #define PCI_DEVICE_ID_3COM_3C595MII	0x5952
+#define PCI_DEVICE_ID_3COM_3C940B	0x80eb
 #define PCI_DEVICE_ID_3COM_3C900TPO	0x9000
 #define PCI_DEVICE_ID_3COM_3C900COMBO	0x9001
 #define PCI_DEVICE_ID_3COM_3C905TX	0x9050
@@ -1061,21 +1063,33 @@
 #define PCI_DEVICE_ID_NVIDIA_UVTNT2		0x002D
 #define PCI_DEVICE_ID_NVIDIA_NFORCE_MCP04_IDE	0x0035
 #define PCI_DEVICE_ID_NVIDIA_NFORCE_MCP04_SATA	0x0036
+#define PCI_DEVICE_ID_NVIDIA_NVENET_10		0x0037
+#define PCI_DEVICE_ID_NVIDIA_NVENET_11		0x0038
 #define PCI_DEVICE_ID_NVIDIA_NFORCE_MCP04_SATA2	0x003e
 #define PCI_DEVICE_ID_NVIDIA_NFORCE_CK804_IDE	0x0053
 #define PCI_DEVICE_ID_NVIDIA_NFORCE_CK804_SATA	0x0054
 #define PCI_DEVICE_ID_NVIDIA_NFORCE_CK804_SATA2	0x0055
+#define PCI_DEVICE_ID_NVIDIA_NVENET_8		0x0056
+#define PCI_DEVICE_ID_NVIDIA_NVENET_9		0x0057
 #define PCI_DEVICE_ID_NVIDIA_NFORCE2_IDE	0x0065
+#define PCI_DEVICE_ID_NVIDIA_NVENET_2		0x0066
 #define PCI_DEVICE_ID_NVIDIA_MCP2_AUDIO		0x006a
 #define PCI_DEVICE_ID_NVIDIA_NFORCE2S_IDE	0x0085
+#define PCI_DEVICE_ID_NVIDIA_NVENET_4		0x0086
+#define PCI_DEVICE_ID_NVIDIA_NVENET_5		0x008c
 #define PCI_DEVICE_ID_NVIDIA_NFORCE2S_SATA	0x008e
 #define PCI_DEVICE_ID_NVIDIA_ITNT2		0x00A0
 #define PCI_DEVICE_ID_NVIDIA_NFORCE3		0x00d1
 #define PCI_DEVICE_ID_NVIDIA_MCP3_AUDIO		0x00da
 #define PCI_DEVICE_ID_NVIDIA_NFORCE3S  		0x00e1
 #define PCI_DEVICE_ID_NVIDIA_NFORCE3_IDE	0x00d5
+#define PCI_DEVICE_ID_NVIDIA_NVENET_3		0x00d6
+#define PCI_DEVICE_ID_NVIDIA_MCP3_AUDIO		0x00da
+#define PCI_DEVICE_ID_NVIDIA_NVENET_7		0x00df
+#define PCI_DEVICE_ID_NVIDIA_NFORCE3S		0x00e1
 #define PCI_DEVICE_ID_NVIDIA_NFORCE3S_SATA	0x00e3
 #define PCI_DEVICE_ID_NVIDIA_NFORCE3S_IDE	0x00e5
+#define PCI_DEVICE_ID_NVIDIA_NVENET_6		0x00e6
 #define PCI_DEVICE_ID_NVIDIA_NFORCE3S_SATA2	0x00ee
 #define PCI_DEVICE_ID_NVIDIA_GEFORCE_SDR	0x0100
 #define PCI_DEVICE_ID_NVIDIA_GEFORCE_DDR	0x0101
@@ -1103,6 +1117,7 @@
 #define PCI_DEVICE_ID_NVIDIA_NFORCE		0x01a4
 #define PCI_DEVICE_ID_NVIDIA_MCP1_AUDIO		0x01b1
 #define PCI_DEVICE_ID_NVIDIA_NFORCE_IDE		0x01bc
+#define PCI_DEVICE_ID_NVIDIA_NVENET_1		0x01c3
 #define PCI_DEVICE_ID_NVIDIA_NFORCE2		0x01e0
 #define PCI_DEVICE_ID_NVIDIA_GEFORCE3		0x0200
 #define PCI_DEVICE_ID_NVIDIA_GEFORCE3_1		0x0201
@@ -1169,12 +1184,16 @@
 #define PCI_DEVICE_ID_TTI_HPT302	0x0006
 #define PCI_DEVICE_ID_TTI_HPT371	0x0007
 #define PCI_DEVICE_ID_TTI_HPT374	0x0008
+#define PCI_DEVICE_ID_TTI_HPT372N	0x0009	// apparently a 372N variant?
 
 #define PCI_VENDOR_ID_VIA		0x1106
 #define PCI_DEVICE_ID_VIA_8763_0	0x0198
 #define PCI_DEVICE_ID_VIA_8380_0	0x0204
+#define PCI_DEVICE_ID_VIA_3238_0	0x0238
 #define PCI_DEVICE_ID_VIA_PX8X0_0	0x0259
-#define PCI_DEVICE_ID_VIA_8363_0	0x0305 
+#define PCI_DEVICE_ID_VIA_3269_0	0x0269
+#define PCI_DEVICE_ID_VIA_K8T800PRO_0	0x0282
+#define PCI_DEVICE_ID_VIA_8363_0	0x0305
 #define PCI_DEVICE_ID_VIA_8371_0	0x0391
 #define PCI_DEVICE_ID_VIA_8501_0	0x0501
 #define PCI_DEVICE_ID_VIA_82C505	0x0505
@@ -1209,9 +1228,9 @@
 #define PCI_DEVICE_ID_VIA_82C686_6	0x3068
 #define PCI_DEVICE_ID_VIA_8233_0	0x3074
 #define PCI_DEVICE_ID_VIA_8633_0	0x3091
-#define PCI_DEVICE_ID_VIA_8367_0	0x3099 
+#define PCI_DEVICE_ID_VIA_8367_0	0x3099
 #define PCI_DEVICE_ID_VIA_8653_0	0x3101
-#define PCI_DEVICE_ID_VIA_8622		0x3102 
+#define PCI_DEVICE_ID_VIA_8622		0x3102
 #define PCI_DEVICE_ID_VIA_8233C_0	0x3109
 #define PCI_DEVICE_ID_VIA_8361		0x3112
 #define PCI_DEVICE_ID_VIA_XM266		0x3116
@@ -1231,6 +1250,7 @@
 #define PCI_DEVICE_ID_VIA_PT880		0x3258
 #define PCI_DEVICE_ID_VIA_P4M400	0x3209
 #define PCI_DEVICE_ID_VIA_8237		0x3227
+#define PCI_DEVICE_ID_VIA_3296_0	0x0296
 #define PCI_DEVICE_ID_VIA_86C100A	0x6100
 #define PCI_DEVICE_ID_VIA_8231		0x8231
 #define PCI_DEVICE_ID_VIA_8231_4	0x8235
@@ -1420,6 +1440,9 @@
 #define PCI_DEVICE_ID_RICOH_RL5C476	0x0476
 #define PCI_DEVICE_ID_RICOH_RL5C478	0x0478
 
+#define PCI_VENDOR_ID_DLINK		0x1186
+#define PCI_DEVICE_ID_DLINK_DGE510T	0x4c00
+
 #define PCI_VENDOR_ID_ARTOP		0x1191
 #define PCI_DEVICE_ID_ARTOP_ATP8400	0x0004
 #define PCI_DEVICE_ID_ARTOP_ATP850UF	0x0005
@@ -1705,6 +1728,9 @@
 #define PCI_DEVICE_ID_SIIG_2S1P_20x_650	0x2061
 #define PCI_DEVICE_ID_SIIG_2S1P_20x_850	0x2062
 
+#define PCI_VENDOR_ID_RADISYS		0x1331
+#define PCI_DEVICE_ID_RADISYS_ENP2611	0x0030
+
 #define PCI_VENDOR_ID_DOMEX		0x134a
 #define PCI_DEVICE_ID_DOMEX_DMX3191D	0x0001
 
@@ -1735,6 +1761,9 @@
 #define PCI_VENDOR_ID_KAWASAKI		0x136b
 #define PCI_DEVICE_ID_MCHIP_KL5A72002	0xff01
 
+#define PCI_VENDOR_ID_CNET		0x1371
+#define PCI_DEVICE_ID_CNET_GIGACARD	0x434e
+
 #define PCI_VENDOR_ID_LMC		0x1376
 #define PCI_DEVICE_ID_LMC_HSSI		0x0003
 #define PCI_DEVICE_ID_LMC_DS3		0x0004
@@ -1769,8 +1798,16 @@
 #define PCI_DEVICE_ID_CCD_B00C		0xb00c
 #define PCI_DEVICE_ID_CCD_B100		0xb100
 
+#define PCI_VENDOR_ID_MICROGATE		0x13c0
+#define PCI_DEVICE_ID_MICROGATE_USC	0x0010
+#define PCI_DEVICE_ID_MICROGATE_SCC	0x0020
+#define PCI_DEVICE_ID_MICROGATE_SCA	0x0030
+#define PCI_DEVICE_ID_MICROGATE_USC2	0x0210
+
 #define PCI_VENDOR_ID_3WARE		0x13C1
 #define PCI_DEVICE_ID_3WARE_1000	0x1000
+#define PCI_DEVICE_ID_3WARE_7000	0x1001
+#define PCI_DEVICE_ID_3WARE_9000	0x1002
 
 #define PCI_VENDOR_ID_IOMEGA		0x13ca
 #define PCI_DEVICE_ID_IOMEGA_BUZ	0x4231
@@ -1911,6 +1948,10 @@
 #define PCI_DEVICE_ID_FARSITE_TE1       0x1610
 #define PCI_DEVICE_ID_FARSITE_TE1C      0x1612
 
+#define PCI_VENDOR_ID_LINKSYS		0x1737
+#define PCI_DEVICE_ID_LINKSYS_EG1032	0x1032
+#define PCI_DEVICE_ID_LINKSYS_EG1064	0x1064
+
 #define PCI_VENDOR_ID_ALTIMA		0x173b
 #define PCI_DEVICE_ID_ALTIMA_AC1000	0x03e8
 #define PCI_DEVICE_ID_ALTIMA_AC1001	0x03e9
@@ -2121,6 +2162,8 @@
 #define PCI_DEVICE_ID_INTEL_82865_IG	0x2572
 #define PCI_DEVICE_ID_INTEL_82875_HB	0x2578
 #define PCI_DEVICE_ID_INTEL_82875_IG	0x257b
+#define PCI_DEVICE_ID_INTEL_82915G_HB	0x2580
+#define PCI_DEVICE_ID_INTEL_82915G_IG	0x2582
 #define PCI_DEVICE_ID_INTEL_ICH6_0	0x2640
 #define PCI_DEVICE_ID_INTEL_ICH6_1	0x2641
 #define PCI_DEVICE_ID_INTEL_ICH6_2	0x2642
@@ -2250,8 +2293,12 @@
 #define PCI_DEVICE_ID_HOLTEK_6565	0x6565
 
 #define PCI_VENDOR_ID_NETMOS		0x9710
+#define PCI_DEVICE_ID_NETMOS_9705	0x9705
 #define PCI_DEVICE_ID_NETMOS_9735	0x9735
+#define PCI_DEVICE_ID_NETMOS_9805	0x9805
+#define PCI_DEVICE_ID_NETMOS_9815	0x9815
 #define PCI_DEVICE_ID_NETMOS_9835	0x9835
+#define PCI_DEVICE_ID_NETMOS_9855	0x9855
 
 #define PCI_SUBVENDOR_ID_EXSYS		0xd84d
 #define PCI_SUBDEVICE_ID_EXSYS_4014	0x4014
@@ -2264,12 +2311,3 @@
 #define PCI_DEVICE_ID_ARK_STING		0xa091
 #define PCI_DEVICE_ID_ARK_STINGARK	0xa099
 #define PCI_DEVICE_ID_ARK_2000MT	0xa0a1
-
-#define PCI_VENDOR_ID_MICROGATE		0x13c0
-#define PCI_DEVICE_ID_MICROGATE_USC	0x0010
-#define PCI_DEVICE_ID_MICROGATE_SCC	0x0020
-#define PCI_DEVICE_ID_MICROGATE_SCA	0x0030
-#define PCI_DEVICE_ID_MICROGATE_USC2	0x0210
-
-#define PCI_VENDOR_ID_HINT		0x3388
-#define PCI_DEVICE_ID_HINT_VXPROII_IDE	0x8013
diff --git a/include/linux/percpu_counter.h b/include/linux/percpu_counter.h
index 594f564e0..bd6708e2c 100644
--- a/include/linux/percpu_counter.h
+++ b/include/linux/percpu_counter.h
@@ -1,3 +1,5 @@
+#ifndef _LINUX_PERCPU_COUNTER_H
+#define _LINUX_PERCPU_COUNTER_H
 /*
  * A simple "approximate counter" for use in ext2 and ext3 superblocks.
  *
@@ -101,3 +103,5 @@ static inline void percpu_counter_dec(struct percpu_counter *fbc)
 {
 	percpu_counter_mod(fbc, -1);
 }
+
+#endif /* _LINUX_PERCPU_COUNTER_H */
diff --git a/include/linux/personality.h b/include/linux/personality.h
index 14b91221d..9b009b675 100644
--- a/include/linux/personality.h
+++ b/include/linux/personality.h
@@ -30,6 +30,7 @@ extern int abi_fake_utsname;
  */
 enum {
 	MMAP_PAGE_ZERO =	0x0100000,
+	READ_IMPLIES_EXEC =	0x0400000,
 	ADDR_LIMIT_32BIT =	0x0800000,
 	SHORT_INODE =		0x1000000,
 	WHOLE_SECONDS =		0x2000000,
@@ -37,6 +38,12 @@ enum {
 	ADDR_LIMIT_3GB = 	0x8000000,
 };
 
+/*
+ * Security-relevant compatibility flags that must be
+ * cleared upon setuid or setgid exec:
+ */
+#define PER_CLEAR_ON_SETID (READ_IMPLIES_EXEC)
+
 /*
  * Personality types.
  *
diff --git a/include/linux/pkt_cls.h b/include/linux/pkt_cls.h
index f54111f9d..9abc5b5a9 100644
--- a/include/linux/pkt_cls.h
+++ b/include/linux/pkt_cls.h
@@ -1,22 +1,159 @@
 #ifndef __LINUX_PKT_CLS_H
 #define __LINUX_PKT_CLS_H
 
+/* I think i could have done better macros ; for now this is stolen from
+ * some arch/mips code - jhs
+*/
+#define _TC_MAKE32(x) ((x))
+
+#define _TC_MAKEMASK1(n) (_TC_MAKE32(1) << _TC_MAKE32(n))
+#define _TC_MAKEMASK(v,n) (_TC_MAKE32((_TC_MAKE32(1)<<(v))-1) << _TC_MAKE32(n))
+#define _TC_MAKEVALUE(v,n) (_TC_MAKE32(v) << _TC_MAKE32(n))
+#define _TC_GETVALUE(v,n,m) ((_TC_MAKE32(v) & _TC_MAKE32(m)) >> _TC_MAKE32(n))
+
+/* verdict bit breakdown 
+ *
+bit 0: when set -> this packet has been munged already
+
+bit 1: when set -> It is ok to munge this packet
+
+bit 2,3,4,5: Reclassify counter - sort of reverse TTL - if exceeded
+assume loop
+
+bit 6,7: Where this packet was last seen 
+0: Above the transmit example at the socket level
+1: on the Ingress
+2: on the Egress
+
+bit 8: when set --> Request not to classify on ingress. 
+
+bits 9,10,11: redirect counter -  redirect TTL. Loop avoidance
+
+ *
+ * */
+
+#define TC_MUNGED          _TC_MAKEMASK1(0)
+#define SET_TC_MUNGED(v)   ( TC_MUNGED | (v & ~TC_MUNGED))
+#define CLR_TC_MUNGED(v)   ( v & ~TC_MUNGED)
+
+#define TC_OK2MUNGE        _TC_MAKEMASK1(1)
+#define SET_TC_OK2MUNGE(v)   ( TC_OK2MUNGE | (v & ~TC_OK2MUNGE))
+#define CLR_TC_OK2MUNGE(v)   ( v & ~TC_OK2MUNGE)
+
+#define S_TC_VERD          _TC_MAKE32(2)
+#define M_TC_VERD          _TC_MAKEMASK(4,S_TC_VERD)
+#define G_TC_VERD(x)       _TC_GETVALUE(x,S_TC_VERD,M_TC_VERD)
+#define V_TC_VERD(x)       _TC_MAKEVALUE(x,S_TC_VERD)
+#define SET_TC_VERD(v,n)   ((V_TC_VERD(n)) | (v & ~M_TC_VERD))
+
+#define S_TC_FROM          _TC_MAKE32(6)
+#define M_TC_FROM          _TC_MAKEMASK(2,S_TC_FROM)
+#define G_TC_FROM(x)       _TC_GETVALUE(x,S_TC_FROM,M_TC_FROM)
+#define V_TC_FROM(x)       _TC_MAKEVALUE(x,S_TC_FROM)
+#define SET_TC_FROM(v,n)   ((V_TC_FROM(n)) | (v & ~M_TC_FROM))
+#define AT_STACK	0x0
+#define AT_INGRESS	0x1
+#define AT_EGRESS	0x2
+
+#define TC_NCLS          _TC_MAKEMASK1(8)
+#define SET_TC_NCLS(v)   ( TC_NCLS | (v & ~TC_NCLS))
+#define CLR_TC_NCLS(v)   ( v & ~TC_NCLS)
+
+#define S_TC_RTTL          _TC_MAKE32(9)
+#define M_TC_RTTL          _TC_MAKEMASK(3,S_TC_RTTL)
+#define G_TC_RTTL(x)       _TC_GETVALUE(x,S_TC_RTTL,M_TC_RTTL)
+#define V_TC_RTTL(x)       _TC_MAKEVALUE(x,S_TC_RTTL)
+#define SET_TC_RTTL(v,n)   ((V_TC_RTTL(n)) | (v & ~M_TC_RTTL))
+
+#define S_TC_AT          _TC_MAKE32(12)
+#define M_TC_AT          _TC_MAKEMASK(2,S_TC_AT)
+#define G_TC_AT(x)       _TC_GETVALUE(x,S_TC_AT,M_TC_AT)
+#define V_TC_AT(x)       _TC_MAKEVALUE(x,S_TC_AT)
+#define SET_TC_AT(v,n)   ((V_TC_AT(n)) | (v & ~M_TC_AT))
+
+/* Action attributes */
+enum
+{
+	TCA_ACT_UNSPEC,
+	TCA_ACT_KIND,
+	TCA_ACT_OPTIONS,
+	TCA_ACT_INDEX,
+	__TCA_ACT_MAX
+};
+
+#define TCA_ACT_MAX __TCA_ACT_MAX
+#define TCA_OLD_COMPAT (TCA_ACT_MAX+1)
+#define TCA_ACT_MAX_PRIO 32
+#define TCA_ACT_BIND	1
+#define TCA_ACT_NOBIND	0
+#define TCA_ACT_UNBIND	1
+#define TCA_ACT_NOUNBIND	0
+#define TCA_ACT_REPLACE		1
+#define TCA_ACT_NOREPLACE	0
+#define MAX_REC_LOOP 4
+#define MAX_RED_LOOP 4
+
+#define TC_ACT_UNSPEC	(-1)
+#define TC_ACT_OK		0
+#define TC_ACT_RECLASSIFY	1
+#define TC_ACT_SHOT		2
+#define TC_ACT_PIPE		3
+#define TC_ACT_STOLEN		4
+#define TC_ACT_QUEUED		5
+#define TC_ACT_REPEAT		6
+#define TC_ACT_JUMP		0x10000000
+
+/* Action type identifiers*/
+enum
+{
+	TCA_ID_UNSPEC=0,
+	TCA_ID_POLICE=1,
+	/* other actions go here */
+	__TCA_ID_MAX=255
+};
+
+#define TCA_ID_MAX __TCA_ID_MAX
+
 struct tc_police
 {
 	__u32			index;
 	int			action;
-#define TC_POLICE_UNSPEC	(-1)
-#define TC_POLICE_OK		0
-#define TC_POLICE_RECLASSIFY	1
-#define TC_POLICE_SHOT		2
+#define TC_POLICE_UNSPEC	TC_ACT_UNSPEC
+#define TC_POLICE_OK		TC_ACT_OK
+#define TC_POLICE_RECLASSIFY	TC_ACT_RECLASSIFY
+#define TC_POLICE_SHOT		TC_ACT_SHOT
+#define TC_POLICE_PIPE		TC_ACT_PIPE
 
 	__u32			limit;
 	__u32			burst;
 	__u32			mtu;
 	struct tc_ratespec	rate;
 	struct tc_ratespec	peakrate;
+	int 			refcnt;
+	int 			bindcnt;
+	__u32			capab;
+};
+
+struct tcf_t
+{
+	__u32   install;
+	__u32   lastuse;
+	__u32   expires;
+};
+
+struct tc_cnt
+{
+	int                   refcnt; 
+	int                   bindcnt;
 };
 
+#define tc_gen \
+	__u32                 index; \
+	__u32                 capab; \
+	int                   action; \
+	int                   refcnt; \
+	int                   bindcnt
+
 enum
 {
 	TCA_POLICE_UNSPEC,
@@ -25,8 +162,8 @@ enum
 	TCA_POLICE_PEAKRATE,
 	TCA_POLICE_AVRATE,
 	TCA_POLICE_RESULT,
-#define TCA_POLICE_RESULT TCA_POLICE_RESULT
 	__TCA_POLICE_MAX
+#define TCA_POLICE_RESULT TCA_POLICE_RESULT
 };
 
 #define TCA_POLICE_MAX (__TCA_POLICE_MAX - 1)
@@ -50,6 +187,9 @@ enum
 	TCA_U32_DIVISOR,
 	TCA_U32_SEL,
 	TCA_U32_POLICE,
+	TCA_U32_ACT,   
+	TCA_U32_INDEV,
+	TCA_U32_PCNT,
 	__TCA_U32_MAX
 };
 
@@ -75,10 +215,17 @@ struct tc_u32_sel
 
 	short			hoff;
 	__u32			hmask;
-
 	struct tc_u32_key	keys[0];
 };
 
+#ifdef CONFIG_CLS_U32_PERF
+struct tc_u32_pcnt
+{
+	__u64 rcnt;
+	__u64 rhit;
+	__u64 kcnts[0];
+};
+#endif
 /* Flags */
 
 #define TC_U32_TERMINAL		1
@@ -102,7 +249,7 @@ enum
 	__TCA_RSVP_MAX
 };
 
-#define TCA_RSVP_MAX (__TCA_RSVP_MAX - 1)
+#define TCA_RSVP_MAX (__TCA_RSVP_MAX - 1 )
 
 struct tc_rsvp_gpi
 {
@@ -143,6 +290,8 @@ enum
 	TCA_FW_UNSPEC,
 	TCA_FW_CLASSID,
 	TCA_FW_POLICE,
+	TCA_FW_INDEV, /*  used by CONFIG_NET_CLS_IND */
+	TCA_FW_ACT, /* used by CONFIG_NET_CLS_ACT */
 	__TCA_FW_MAX
 };
 
@@ -162,6 +311,6 @@ enum
 	__TCA_TCINDEX_MAX
 };
 
-#define TCA_TCINDEX_MAX        (__TCA_TCINDEX_MAX - 1)
+#define TCA_TCINDEX_MAX     (__TCA_TCINDEX_MAX - 1)
 
 #endif
diff --git a/include/linux/pkt_sched.h b/include/linux/pkt_sched.h
index a3d6b59af..d98d8cfcd 100644
--- a/include/linux/pkt_sched.h
+++ b/include/linux/pkt_sched.h
@@ -38,9 +38,6 @@ struct tc_stats
 	__u32	pps;			/* Current flow packet rate */
 	__u32	qlen;
 	__u32	backlog;
-#ifdef __KERNEL__
-	spinlock_t *lock;
-#endif
 };
 
 struct tc_estimator
@@ -103,34 +100,6 @@ struct tc_prio_qopt
 	__u8	priomap[TC_PRIO_MAX+1];	/* Map: logical priority -> PRIO band */
 };
 
-/* CSZ section */
-
-struct tc_csz_qopt
-{
-	int		flows;		/* Maximal number of guaranteed flows */
-	unsigned char	R_log;		/* Fixed point position for round number */
-	unsigned char	delta_log;	/* Log of maximal managed time interval */
-	__u8		priomap[TC_PRIO_MAX+1];	/* Map: logical priority -> CSZ band */
-};
-
-struct tc_csz_copt
-{
-	struct tc_ratespec slice;
-	struct tc_ratespec rate;
-	struct tc_ratespec peakrate;
-	__u32		limit;
-	__u32		buffer;
-	__u32		mtu;
-};
-
-enum
-{
-	TCA_CSZ_UNSPEC,
-	TCA_CSZ_PARMS,
-	TCA_CSZ_RTAB,
-	TCA_CSZ_PTAB,
-};
-
 /* TBF section */
 
 struct tc_tbf_qopt
@@ -432,10 +401,14 @@ enum {
 
 #define TCA_ATM_MAX	TCA_ATM_STATE
 
-/* Delay section */
-struct tc_dly_qopt
+/* Network emulator */
+struct tc_netem_qopt
 {
-	__u32	latency;
-	__u32   limit;
-};	
+	__u32	latency;	/* added delay (us) */
+	__u32   limit;		/* fifo limit (packets) */
+	__u32	loss;		/* random packet loss (0=none ~0=100%) */
+	__u32	gap;		/* re-ordering gap (0 for delay all) */
+	__u32   duplicate;	/* random packet dup  (0=none ~0=100%) */
+	__u32	jitter;		/* random jitter in latency (us) */
+};
 #endif
diff --git a/include/linux/pm.h b/include/linux/pm.h
index 66e62c0df..d54bc441d 100644
--- a/include/linux/pm.h
+++ b/include/linux/pm.h
@@ -159,7 +159,7 @@ static inline struct pm_dev *pm_register(pm_dev_t type,
 					 unsigned long id,
 					 pm_callback callback)
 {
-	return 0;
+	return NULL;
 }
 
 static inline void pm_unregister(struct pm_dev *dev) {}
diff --git a/include/linux/pnpbios.h b/include/linux/pnpbios.h
index 0720cd72d..0a282ac1f 100644
--- a/include/linux/pnpbios.h
+++ b/include/linux/pnpbios.h
@@ -141,6 +141,7 @@ extern int pnp_bios_isapnp_config (struct pnp_isa_config_struc *data);
 extern int pnp_bios_escd_info (struct escd_info_struc *data);
 extern int pnp_bios_read_escd (char *data, u32 nvram_base);
 extern int pnp_bios_dock_station_info(struct pnp_docking_station_info *data);
+#define needed 0
 #if needed
 extern int pnp_bios_get_event (u16 *message);
 extern int pnp_bios_send_message (u16 message);
diff --git a/include/linux/posix-timers.h b/include/linux/posix-timers.h
index 637d2fb19..ec4910e37 100644
--- a/include/linux/posix-timers.h
+++ b/include/linux/posix-timers.h
@@ -1,8 +1,16 @@
 #ifndef _linux_POSIX_TIMERS_H
 #define _linux_POSIX_TIMERS_H
 
+#include <linux/spinlock.h>
+#include <linux/list.h>
+
+struct k_clock_abs {
+	struct list_head list;
+	spinlock_t lock;
+};
 struct k_clock {
 	int res;		/* in nano seconds */
+	struct k_clock_abs *abs_struct;
 	int (*clock_set) (struct timespec * tp);
 	int (*clock_get) (struct timespec * tp);
 	int (*nsleep) (int flags,
@@ -23,8 +31,14 @@ struct now_struct {
 #define posix_time_before(timer, now) \
                       time_before((timer)->expires, (now)->jiffies)
 
-#define posix_bump_timer(timr) do { \
-                        (timr)->it_timer.expires += (timr)->it_incr; \
-                        (timr)->it_overrun++;               \
-                       }while (0)
+#define posix_bump_timer(timr, now)					\
+         do {								\
+              long delta, orun;						\
+	      delta = now.jiffies - (timr)->it_timer.expires;		\
+              if (delta >= 0) {						\
+	           orun = 1 + (delta / (timr)->it_incr);		\
+	          (timr)->it_timer.expires += orun * (timr)->it_incr;	\
+                  (timr)->it_overrun += orun;				\
+              }								\
+            }while (0)
 #endif
diff --git a/include/linux/ppp_defs.h b/include/linux/ppp_defs.h
index fde9fa211..402056cd0 100644
--- a/include/linux/ppp_defs.h
+++ b/include/linux/ppp_defs.h
@@ -42,6 +42,8 @@
 #ifndef _PPP_DEFS_H_
 #define _PPP_DEFS_H_
 
+#include <linux/crc-ccitt.h>
+
 /*
  * The basic PPP frame.
  */
@@ -95,7 +97,7 @@
 
 #define PPP_INITFCS	0xffff	/* Initial FCS value */
 #define PPP_GOODFCS	0xf0b8	/* Good final FCS value */
-#define PPP_FCS(fcs, c)	(((fcs) >> 8) ^ fcstab[((fcs) ^ (c)) & 0xff])
+#define PPP_FCS(fcs, c) crc_ccitt_byte(fcs, c)
 
 /*
  * Extended asyncmap - allows any character to be escaped.
diff --git a/include/linux/prctl.h b/include/linux/prctl.h
index f9bfac952..c8b69670e 100644
--- a/include/linux/prctl.h
+++ b/include/linux/prctl.h
@@ -29,6 +29,12 @@
 /* Get/set floating-point exception mode (if meaningful) */
 #define PR_GET_FPEXC	11
 #define PR_SET_FPEXC	12
+# define PR_FP_EXC_SW_ENABLE	0x80	/* Use FPEXC for FP exception enables */
+# define PR_FP_EXC_DIV		0x010000	/* floating point divide by zero */
+# define PR_FP_EXC_OVF		0x020000	/* floating point overflow */
+# define PR_FP_EXC_UND		0x040000	/* floating point underflow */
+# define PR_FP_EXC_RES		0x080000	/* floating point inexact result */
+# define PR_FP_EXC_INV		0x100000	/* floating point invalid operation */
 # define PR_FP_EXC_DISABLED	0	/* FP exceptions disabled */
 # define PR_FP_EXC_NONRECOV	1	/* async non-recoverable exc. mode */
 # define PR_FP_EXC_ASYNC	2	/* async recoverable exception mode */
diff --git a/include/linux/quotaops.h b/include/linux/quotaops.h
index 9db474dca..acc926c64 100644
--- a/include/linux/quotaops.h
+++ b/include/linux/quotaops.h
@@ -69,9 +69,22 @@ static __inline__ void DQUOT_INIT(struct inode *inode)
 /* The same as with DQUOT_INIT */
 static __inline__ void DQUOT_DROP(struct inode *inode)
 {
-	if (IS_QUOTAINIT(inode)) {
-		BUG_ON(!inode->i_sb);
-		inode->i_sb->dq_op->drop(inode);	/* Ops must be set when there's any quota... */
+	/* Here we can get arbitrary inode from clear_inode() so we have
+	 * to be careful. OTOH we don't need locking as quota operations
+	 * are allowed to change only at mount time */
+	if (!IS_NOQUOTA(inode) && inode->i_sb && inode->i_sb->dq_op
+	    && inode->i_sb->dq_op->drop) {
+		int cnt;
+		/* Test before calling to rule out calls from proc and such
+                 * where we are not allowed to block. Note that this is
+		 * actually reliable test even without the lock - the caller
+		 * must assure that nobody can come after the DQUOT_DROP and
+		 * add quota pointers back anyway */
+		for (cnt = 0; cnt < MAXQUOTAS; cnt++)
+			if (inode->i_dquot[cnt] != NODQUOT)
+				break;
+		if (cnt < MAXQUOTAS)
+			inode->i_sb->dq_op->drop(inode);
 	}
 }
 
diff --git a/include/linux/rcupdate.h b/include/linux/rcupdate.h
index 58048abd7..10c4b8f24 100644
--- a/include/linux/rcupdate.h
+++ b/include/linux/rcupdate.h
@@ -36,41 +36,37 @@
 #ifdef __KERNEL__
 
 #include <linux/cache.h>
-#include <linux/list.h>
 #include <linux/spinlock.h>
 #include <linux/threads.h>
 #include <linux/percpu.h>
 #include <linux/cpumask.h>
+#include <linux/seqlock.h>
 
 /**
  * struct rcu_head - callback structure for use with RCU
- * @list: list_head to queue the update requests
+ * @next: next update requests in a list
  * @func: actual update function to call after the grace period.
- * @arg: argument to be passed to the actual update function.
  */
 struct rcu_head {
-	struct list_head list;
-	void (*func)(void *obj);
-	void *arg;
+	struct rcu_head *next;
+	void (*func)(struct rcu_head *head);
 };
 
-#define RCU_HEAD_INIT(head) \
-		{ .list = LIST_HEAD_INIT(head.list), .func = NULL, .arg = NULL }
+#define RCU_HEAD_INIT(head) { .next = NULL, .func = NULL }
 #define RCU_HEAD(head) struct rcu_head head = RCU_HEAD_INIT(head)
 #define INIT_RCU_HEAD(ptr) do { \
-       INIT_LIST_HEAD(&(ptr)->list); (ptr)->func = NULL; (ptr)->arg = NULL; \
+       (ptr)->next = NULL; (ptr)->func = NULL; \
 } while (0)
 
 
 
-/* Control variables for rcupdate callback mechanism. */
+/* Global control variables for rcupdate callback mechanism. */
 struct rcu_ctrlblk {
-	spinlock_t	mutex;		/* Guard this struct                  */
-	long		curbatch;	/* Current batch number.	      */
-	long		maxbatch;	/* Max requested batch number.        */
-	cpumask_t	rcu_cpu_mask; 	/* CPUs that need to switch in order  */
-					/* for current batch to proceed.      */
-};
+	long	cur;		/* Current batch number.                      */
+	long	completed;	/* Number of the last completed batch         */
+	int	next_pending;	/* Is the next batch already waiting?         */
+	seqcount_t lock;	/* For atomic reads of cur and next_pending.  */
+} ____cacheline_maxaligned_in_smp;
 
 /* Is batch a before batch b ? */
 static inline int rcu_batch_before(long a, long b)
@@ -90,35 +86,51 @@ static inline int rcu_batch_after(long a, long b)
  * curlist - current batch for which quiescent cycle started if any
  */
 struct rcu_data {
+	/* 1) quiescent state handling : */
+        long		quiescbatch;     /* Batch # for grace period */
 	long		qsctr;		 /* User-mode/idle loop etc. */
         long            last_qsctr;	 /* value of qsctr at beginning */
                                          /* of rcu grace period */
+	int		qs_pending;	 /* core waits for quiesc state */
+
+	/* 2) batch handling */
         long  	       	batch;           /* Batch # for current RCU batch */
-        struct list_head  nxtlist;
-        struct list_head  curlist;
+        struct rcu_head *nxtlist;
+	struct rcu_head **nxttail;
+        struct rcu_head *curlist;
 };
 
 DECLARE_PER_CPU(struct rcu_data, rcu_data);
 extern struct rcu_ctrlblk rcu_ctrlblk;
 
+#define RCU_quiescbatch(cpu)	(per_cpu(rcu_data, (cpu)).quiescbatch)
 #define RCU_qsctr(cpu) 		(per_cpu(rcu_data, (cpu)).qsctr)
 #define RCU_last_qsctr(cpu) 	(per_cpu(rcu_data, (cpu)).last_qsctr)
+#define RCU_qs_pending(cpu)	(per_cpu(rcu_data, (cpu)).qs_pending)
 #define RCU_batch(cpu) 		(per_cpu(rcu_data, (cpu)).batch)
 #define RCU_nxtlist(cpu) 	(per_cpu(rcu_data, (cpu)).nxtlist)
 #define RCU_curlist(cpu) 	(per_cpu(rcu_data, (cpu)).curlist)
-
-#define RCU_QSCTR_INVALID	0
+#define RCU_nxttail(cpu) 	(per_cpu(rcu_data, (cpu)).nxttail)
 
 static inline int rcu_pending(int cpu) 
 {
-	if ((!list_empty(&RCU_curlist(cpu)) &&
-	     rcu_batch_before(RCU_batch(cpu), rcu_ctrlblk.curbatch)) ||
-	    (list_empty(&RCU_curlist(cpu)) &&
-			 !list_empty(&RCU_nxtlist(cpu))) ||
-	    cpu_isset(cpu, rcu_ctrlblk.rcu_cpu_mask))
+	/* This cpu has pending rcu entries and the grace period
+	 * for them has completed.
+	 */
+	if (RCU_curlist(cpu) &&
+		  !rcu_batch_before(rcu_ctrlblk.completed,RCU_batch(cpu)))
+		return 1;
+
+	/* This cpu has no pending entries, but there are new entries */
+	if (!RCU_curlist(cpu) && RCU_nxtlist(cpu))
+		return 1;
+
+	/* The rcu core waits for a quiescent state from the cpu */
+	if (RCU_quiescbatch(cpu) != rcu_ctrlblk.cur || RCU_qs_pending(cpu))
 		return 1;
-	else
-		return 0;
+
+	/* nothing to do */
+	return 0;
 }
 
 #define rcu_read_lock()		preempt_disable()
@@ -126,10 +138,11 @@ static inline int rcu_pending(int cpu)
 
 extern void rcu_init(void);
 extern void rcu_check_callbacks(int cpu, int user);
+extern void rcu_restart_cpu(int cpu);
 
 /* Exported interfaces */
 extern void FASTCALL(call_rcu(struct rcu_head *head, 
-                          void (*func)(void *arg), void *arg));
+				void (*func)(struct rcu_head *head)));
 extern void synchronize_kernel(void);
 
 #endif /* __KERNEL__ */
diff --git a/include/linux/reiserfs_fs.h b/include/linux/reiserfs_fs.h
index 2eb4e7974..2a206e8e5 100644
--- a/include/linux/reiserfs_fs.h
+++ b/include/linux/reiserfs_fs.h
@@ -81,7 +81,7 @@ void reiserfs_warning (struct super_block *s, const char * fmt, ...);
 /** always check a condition and panic if it's false. */
 #define RASSERT( cond, format, args... )					\
 if( !( cond ) ) 								\
-  reiserfs_panic( 0, "reiserfs[%i]: assertion " #cond " failed at "	\
+  reiserfs_panic( NULL, "reiserfs[%i]: assertion " #cond " failed at "	\
 		  __FILE__ ":%i:%s: " format "\n",		\
 		  in_interrupt() ? -1 : current -> pid, __LINE__ , __FUNCTION__ , ##args )
 
@@ -630,8 +630,8 @@ static inline loff_t le_ih_k_type (const struct item_head * ih)
 static inline void set_le_key_k_offset (int version, struct key * key, loff_t offset)
 {
     (version == KEY_FORMAT_3_5) ?
-        (key->u.k_offset_v1.k_offset = cpu_to_le32 (offset)) : /* jdm check */
-	(set_offset_v2_k_offset( &(key->u.k_offset_v2), offset ));
+        (void)(key->u.k_offset_v1.k_offset = cpu_to_le32 (offset)) : /* jdm check */
+	(void)(set_offset_v2_k_offset( &(key->u.k_offset_v2), offset ));
 }
 
 
@@ -644,8 +644,8 @@ static inline void set_le_ih_k_offset (struct item_head * ih, loff_t offset)
 static inline void set_le_key_k_type (int version, struct key * key, int type)
 {
     (version == KEY_FORMAT_3_5) ?
-        (key->u.k_offset_v1.k_uniqueness = cpu_to_le32(type2uniqueness(type))):
-	(set_offset_v2_k_type( &(key->u.k_offset_v2), type ));
+        (void)(key->u.k_offset_v1.k_uniqueness = cpu_to_le32(type2uniqueness(type))):
+	(void)(set_offset_v2_k_type( &(key->u.k_offset_v2), type ));
 }
 static inline void set_le_ih_k_type (struct item_head * ih, int type)
 {
@@ -1245,8 +1245,12 @@ excessive effort to avoid disturbing the precious VFS code.:-( The
 gods only know how we are going to SMP the code that uses them.
 znodes are the way! */
 
+#define PATH_READA	0x1 /* do read ahead */
+#define PATH_READA_BACK 0x2 /* read backwards */
+
 struct  path {
   int                   path_length;                      	/* Length of the array above.   */
+  int			reada;
   struct  path_element  path_elements[EXTENDED_MAX_HEIGHT];	/* Array of the path elements.  */
   int			pos_in_item;
 };
@@ -1254,7 +1258,7 @@ struct  path {
 #define pos_in_item(path) ((path)->pos_in_item)
 
 #define INITIALIZE_PATH(var) \
-struct path var = {ILLEGAL_PATH_ELEMENT_OFFSET, }
+struct path var = {.path_length = ILLEGAL_PATH_ELEMENT_OFFSET, .reada = 0,}
 
 /* Get path element by path and path position. */
 #define PATH_OFFSET_PELEMENT(p_s_path,n_offset)  ((p_s_path)->path_elements +(n_offset))
@@ -1755,6 +1759,14 @@ int reiserfs_add_tail_list(struct inode *inode, struct buffer_head *bh);
 int reiserfs_add_ordered_list(struct inode *inode, struct buffer_head *bh);
 int journal_mark_dirty(struct reiserfs_transaction_handle *, struct super_block *, struct buffer_head *bh) ;
 
+static inline int
+reiserfs_file_data_log(struct inode *inode) {
+    if (reiserfs_data_log(inode->i_sb) ||
+       (REISERFS_I(inode)->i_flags & i_data_log))
+        return 1 ;
+    return 0 ;
+}
+
 static inline int reiserfs_transaction_running(struct super_block *s) {
     struct reiserfs_transaction_handle *th = current->journal_info ;
     if (th && th->t_super == s)
@@ -2156,6 +2168,15 @@ struct buffer_head * get_FEB (struct tree_balance *);
 typedef struct __reiserfs_blocknr_hint reiserfs_blocknr_hint_t;
 
 int reiserfs_parse_alloc_options (struct super_block *, char *);
+void reiserfs_init_alloc_options (struct super_block *s);
+
+/*
+ * given a directory, this will tell you what packing locality
+ * to use for a new object underneat it.  The locality is returned
+ * in disk byte order (le).
+ */
+u32 reiserfs_choose_packing(struct inode *dir);
+
 int is_reusable (struct super_block * s, b_blocknr_t block, int bit_value);
 void reiserfs_free_block (struct reiserfs_transaction_handle *th, struct inode *, b_blocknr_t, int for_unformatted);
 int reiserfs_allocate_blocknrs(reiserfs_blocknr_hint_t *, b_blocknr_t * , int, int);
diff --git a/include/linux/reiserfs_fs_i.h b/include/linux/reiserfs_fs_i.h
index 57eeaf7ed..adc71cd0b 100644
--- a/include/linux/reiserfs_fs_i.h
+++ b/include/linux/reiserfs_fs_i.h
@@ -25,6 +25,7 @@ typedef enum {
     i_link_saved_truncate_mask =  0x0020,
     i_priv_object              =  0x0080,
     i_has_xattr_dir            =  0x0100,
+    i_data_log	               =  0x0200,
 } reiserfs_inode_flags;
 
 
diff --git a/include/linux/route.h b/include/linux/route.h
index e670dbac5..f7ed35d5e 100644
--- a/include/linux/route.h
+++ b/include/linux/route.h
@@ -24,7 +24,7 @@
 #define _LINUX_ROUTE_H
 
 #include <linux/if.h>
-
+#include <linux/compiler.h>
 
 /* This structure gets passed by the SIOCADDRT and SIOCDELRT calls. */
 struct rtentry 
@@ -38,7 +38,7 @@ struct rtentry
 	unsigned long	rt_pad3;
 	void		*rt_pad4;
 	short		rt_metric;	/* +1 for binary compatibility!	*/
-	char		*rt_dev;	/* forcing the device at add	*/
+	char __user	*rt_dev;	/* forcing the device at add	*/
 	unsigned long	rt_mtu;		/* per route MTU/Window 	*/
 #ifndef __KERNEL__
 #define rt_mss	rt_mtu			/* Compatibility :-(            */
diff --git a/include/linux/rtnetlink.h b/include/linux/rtnetlink.h
index 4b3a0b5d4..58c6429cc 100644
--- a/include/linux/rtnetlink.h
+++ b/include/linux/rtnetlink.h
@@ -44,6 +44,10 @@
 #define	RTM_DELTFILTER	(RTM_BASE+29)
 #define	RTM_GETTFILTER	(RTM_BASE+30)
 
+#define RTM_NEWACTION   (RTM_BASE+32)
+#define RTM_DELACTION   (RTM_BASE+33)
+#define RTM_GETACTION   (RTM_BASE+34)
+
 #define RTM_NEWPREFIX	(RTM_BASE+36)
 #define RTM_GETPREFIX	(RTM_BASE+38)
 
@@ -69,7 +73,8 @@ struct rtattr
 
 #define RTA_ALIGNTO	4
 #define RTA_ALIGN(len) ( ((len)+RTA_ALIGNTO-1) & ~(RTA_ALIGNTO-1) )
-#define RTA_OK(rta,len) ((len) > 0 && (rta)->rta_len >= sizeof(struct rtattr) && \
+#define RTA_OK(rta,len) ((len) >= (int)sizeof(struct rtattr) && \
+			 (rta)->rta_len >= sizeof(struct rtattr) && \
 			 (rta)->rta_len <= (len))
 #define RTA_NEXT(rta,attrlen)	((attrlen) -= RTA_ALIGN((rta)->rta_len), \
 				 (struct rtattr*)(((char*)(rta)) + RTA_ALIGN((rta)->rta_len)))
@@ -639,6 +644,7 @@ enum
 	TCA_STATS,
 	TCA_XSTATS,
 	TCA_RATE,
+	TCA_FCNT,
 	__TCA_MAX
 };
 
@@ -673,6 +679,18 @@ enum
 
 #define RTMGRP_IPV6_PREFIX	0x20000
 
+/* TC action piece */
+struct tcamsg
+{
+	unsigned char	tca_family;
+	unsigned char	tca__pad1;
+	unsigned short	tca__pad2;
+};
+#define TA_RTA(r)  ((struct rtattr*)(((char*)(r)) + NLMSG_ALIGN(sizeof(struct tcamsg))))
+#define TA_PAYLOAD(n) NLMSG_PAYLOAD(n,sizeof(struct tcamsg))
+#define TCA_ACT_TAB 1 /* attr type must be >=1 */	
+#define TCAA_MAX 1
+
 /* End of information exported to user level */
 
 #ifdef __KERNEL__
@@ -728,10 +746,6 @@ extern void rtmsg_ifinfo(int type, struct net_device *dev, unsigned change);
 
 extern struct semaphore rtnl_sem;
 
-#define rtnl_exlock()		do { } while(0)
-#define rtnl_exunlock()		do { } while(0)
-#define rtnl_exlock_nowait()	(0)
-
 #define rtnl_shlock()		down(&rtnl_sem)
 #define rtnl_shlock_nowait()	down_trylock(&rtnl_sem)
 
diff --git a/include/linux/sc26198.h b/include/linux/sc26198.h
index 38685e077..7ca35abad 100644
--- a/include/linux/sc26198.h
+++ b/include/linux/sc26198.h
@@ -3,7 +3,7 @@
 /*
  *	sc26198.h  -- SC26198 UART hardware info.
  *
- *	Copyright (C) 1995-1998  Stallion Technologies (support@stallion.oz.au).
+ *	Copyright (C) 1995-1998  Stallion Technologies
  *
  *	This program is free software; you can redistribute it and/or modify
  *	it under the terms of the GNU General Public License as published by
diff --git a/include/linux/sched.h b/include/linux/sched.h
index 3ed211a17..7fc52d7b5 100644
--- a/include/linux/sched.h
+++ b/include/linux/sched.h
@@ -170,8 +170,6 @@ long io_schedule_timeout(long timeout);
 extern void cpu_init (void);
 extern void trap_init(void);
 extern void update_process_times(int user);
-extern void update_one_process(struct task_struct *p, unsigned long user,
-			       unsigned long system, int cpu);
 extern void scheduler_tick(int user_tick, int system);
 extern unsigned long cache_decay_ticks;
 
@@ -219,9 +217,6 @@ struct mm_struct {
 	unsigned long saved_auxv[40]; /* for /proc/PID/auxv */
 
 	unsigned dumpable:1;
-#ifdef CONFIG_HUGETLB_PAGE
-	int used_hugetlb;
-#endif
 	cpumask_t cpu_vm_mask;
 
 	/* Architecture-specific MM context */
@@ -317,6 +312,9 @@ struct user_struct {
 	atomic_t __count;	/* reference count */
 	atomic_t processes;	/* How many processes does this user have? */
 	atomic_t files;		/* How many open files does this user have? */
+	atomic_t sigpending;	/* How many pending signals does this user have? */
+	/* protected by mq_lock	*/
+	unsigned long mq_bytes;	/* How many bytes can be allocated to mqueue? */
 
 	/* Hash table maintenance information */
 	struct list_head uidhash_list;
@@ -349,6 +347,8 @@ struct k_itimer {
 	struct task_struct *it_process;	/* process to send signal to */
 	struct timer_list it_timer;
 	struct sigqueue *sigq;		/* signal queue entry. */
+	struct list_head abs_timer_entry; /* clock abs_timer_list */
+	struct timespec wall_to_prev;   /* wall_to_monotonic used when set */
 };
 
 
@@ -365,6 +365,12 @@ struct group_info {
 	gid_t *blocks[0];
 };
 
+/*
+ * get_group_info() must be called with the owning task locked (via task_lock())
+ * when task != current.  The reason being that the vast majority of callers are
+ * looking at current->group_info, which can not be changed except by the
+ * current task.  Changing current->group_info requires the task lock, too.
+ */
 #define get_group_info(group_info) do { \
 	atomic_inc(&(group_info)->usage); \
 } while (0)
@@ -408,6 +414,10 @@ struct task_struct {
 	unsigned int time_slice, first_time_slice;
 
 	struct list_head tasks;
+	/*
+	 * ptrace_list/ptrace_children forms the list of my children
+	 * that were stolen by a ptracer.
+	 */
 	struct list_head ptrace_children;
 	struct list_head ptrace_list;
 
@@ -429,6 +439,10 @@ struct task_struct {
 	 */
 	struct task_struct *real_parent; /* real parent process (when being debugged) */
 	struct task_struct *parent;	/* parent process */
+	/*
+	 * children/sibling forms the list of my children plus the
+	 * tasks I'm ptracing.
+	 */
 	struct list_head children;	/* list of my children */
 	struct list_head sibling;	/* linkage in my parent's children list */
 	struct task_struct *group_leader;	/* threadgroup leader */
@@ -693,9 +707,9 @@ extern void sched_balance_exec(void);
 
 extern void sched_idle_next(void);
 extern void set_user_nice(task_t *p, long nice);
-extern int task_prio(task_t *p);
-extern int task_nice(task_t *p);
-extern int task_curr(task_t *p);
+extern int task_prio(const task_t *p);
+extern int task_nice(const task_t *p);
+extern int task_curr(const task_t *p);
 extern int idle_cpu(int cpu);
 
 void yield(void);
@@ -731,6 +745,11 @@ extern void __set_special_pids(pid_t session, pid_t pgrp);
 
 /* per-UID process charging. */
 extern struct user_struct * alloc_uid(xid_t, uid_t);
+static inline struct user_struct *get_uid(struct user_struct *u)
+{
+	atomic_inc(&u->__count);
+	return u;
+}
 extern void free_uid(struct user_struct *);
 extern void switch_uid(struct user_struct *);
 
@@ -917,7 +936,7 @@ extern void wait_task_inactive(task_t * p);
 #define while_each_thread(g, t) \
 	while ((t = next_thread(t)) != g)
 
-extern task_t * FASTCALL(next_thread(task_t *p));
+extern task_t * FASTCALL(next_thread(const task_t *p));
 
 #define thread_group_leader(p)	(p->pid == p->tgid)
 
@@ -934,7 +953,9 @@ static inline int thread_group_empty(task_t *p)
 extern void unhash_process(struct task_struct *p);
 
 /*
- * Protects ->fs, ->files, ->mm, ->ptrace and synchronises with wait4().
+ * Protects ->fs, ->files, ->mm, ->ptrace, ->group_info and synchronises with
+ * wait4().
+ *
  * Nests both inside and outside of read_lock(&tasklist_lock).
  * It must not be nested with write_lock_irq(&tasklist_lock),
  * neither inside nor outside.
@@ -1056,7 +1077,7 @@ extern void signal_wake_up(struct task_struct *t, int resume_stopped);
  */
 #ifdef CONFIG_SMP
 
-static inline unsigned int task_cpu(struct task_struct *p)
+static inline unsigned int task_cpu(const struct task_struct *p)
 {
 	return p->thread_info->cpu;
 }
@@ -1068,7 +1089,7 @@ static inline void set_task_cpu(struct task_struct *p, unsigned int cpu)
 
 #else
 
-static inline unsigned int task_cpu(struct task_struct *p)
+static inline unsigned int task_cpu(const struct task_struct *p)
 {
 	return 0;
 }
diff --git a/include/linux/security.h b/include/linux/security.h
index e2f166907..983d7c226 100644
--- a/include/linux/security.h
+++ b/include/linux/security.h
@@ -53,7 +53,7 @@ extern void cap_task_reparent_to_init (struct task_struct *p);
 extern int cap_syslog (int type);
 extern int cap_vm_enough_memory (long pages);
 
-static inline int cap_netlink_send (struct sk_buff *skb)
+static inline int cap_netlink_send (struct sock *sk, struct sk_buff *skb)
 {
 	NETLINK_CB (skb).eff_cap = current->cap_effective;
 	return 0;
@@ -639,9 +639,12 @@ struct swap_info_struct;
  *	Save security information for a netlink message so that permission
  *	checking can be performed when the message is processed.  The security
  *	information can be saved using the eff_cap field of the
- *      netlink_skb_parms structure.
+ *      netlink_skb_parms structure.  Also may be used to provide fine
+ *	grained control over message transmission.
+ *	@sk associated sock of task sending the message.,
  *	@skb contains the sk_buff structure for the netlink message.
- *	Return 0 if the information was successfully saved.
+ *	Return 0 if the information was successfully saved and message
+ *	is allowed to be transmitted.
  * @netlink_recv:
  *	Check permission before processing the received netlink message in
  *	@skb.
@@ -1181,7 +1184,7 @@ struct security_operations {
 	int (*sem_semop) (struct sem_array * sma, 
 			  struct sembuf * sops, unsigned nsops, int alter);
 
-	int (*netlink_send) (struct sk_buff * skb);
+	int (*netlink_send) (struct sock * sk, struct sk_buff * skb);
 	int (*netlink_recv) (struct sk_buff * skb);
 
 	/* allow module stacking */
@@ -1873,9 +1876,9 @@ static inline int security_setprocattr(struct task_struct *p, char *name, void *
 	return security_ops->setprocattr(p, name, value, size);
 }
 
-static inline int security_netlink_send(struct sk_buff * skb)
+static inline int security_netlink_send(struct sock *sk, struct sk_buff * skb)
 {
-	return security_ops->netlink_send(skb);
+	return security_ops->netlink_send(sk, skb);
 }
 
 static inline int security_netlink_recv(struct sk_buff * skb)
@@ -2501,9 +2504,9 @@ static inline int security_setprocattr(struct task_struct *p, char *name, void *
  * (rather than hooking into the capability module) to reduce overhead
  * in the networking code.
  */
-static inline int security_netlink_send (struct sk_buff *skb)
+static inline int security_netlink_send (struct sock *sk, struct sk_buff *skb)
 {
-	return cap_netlink_send (skb);
+	return cap_netlink_send (sk, skb);
 }
 
 static inline int security_netlink_recv (struct sk_buff *skb)
diff --git a/include/linux/serialP.h b/include/linux/serialP.h
index 93f7492ed..2307f11d8 100644
--- a/include/linux/serialP.h
+++ b/include/linux/serialP.h
@@ -130,6 +130,13 @@ struct rs_multiport_struct {
  * reason (mips != alpha!)
  */
 #define ALPHA_KLUDGE_MCR  (UART_MCR_OUT2 | UART_MCR_OUT1)
+#elif defined(CONFIG_SBC8560)
+/*
+ * WindRiver did something similarly broken on their SBC8560 board. The
+ * UART tristates its IRQ output while OUT2 is clear, but they pulled
+ * the interrupt line _up_ instead of down, so if we register the IRQ
+ * while the UART is in that state, we die in an IRQ storm. */
+#define ALPHA_KLUDGE_MCR (UART_MCR_OUT2)
 #else
 #define ALPHA_KLUDGE_MCR 0
 #endif
diff --git a/include/linux/serial_core.h b/include/linux/serial_core.h
index 00c4b081f..e7e8bb92a 100644
--- a/include/linux/serial_core.h
+++ b/include/linux/serial_core.h
@@ -59,14 +59,6 @@
 /* NEC v850.  */
 #define PORT_V850E_UART	40
 
-/* NEC PC-9800 */
-#define PORT_8251_PC98	41
-#define PORT_19K_PC98	42
-#define PORT_FIFO_PC98	43
-#define PORT_VFAST_PC98	44
-#define PORT_PC9861	45
-#define PORT_PC9801_101	46
-
 /* DZ */
 #define PORT_DZ		47
 
@@ -88,6 +80,15 @@
 /* SGI IP22 aka Indy / Challenge S / Indigo 2 */
 #define PORT_IP22ZILOG	56
 
+/* Sharp LH7a40x -- an ARM9 SoC series */
+#define PORT_LH7A40X	57
+
+/* PPC CPM type number */
+#define PORT_CPM        58
+
+/* MPC52xx type numbers */
+#define PORT_MPC52xx	59
+
 #ifdef __KERNEL__
 
 #include <linux/config.h>
@@ -207,7 +208,6 @@ struct uart_port {
 #define UPF_CONS_FLOW		(1 << 23)
 #define UPF_SHARE_IRQ		(1 << 24)
 #define UPF_BOOT_AUTOCONF	(1 << 28)
-#define UPF_RESOURCES		(1 << 30)
 #define UPF_IOREMAP		(1 << 31)
 
 #define UPF_CHANGE_MASK		(0x17fff)
diff --git a/include/linux/serio.h b/include/linux/serio.h
index 28f62471a..be0ccba86 100644
--- a/include/linux/serio.h
+++ b/include/linux/serio.h
@@ -105,7 +105,6 @@ static __inline__ void serio_cleanup(struct serio *serio)
 #define SERIO_8042	0x01000000UL
 #define SERIO_RS232	0x02000000UL
 #define SERIO_HIL_MLC	0x03000000UL
-#define SERIO_PC9800	0x04000000UL
 #define SERIO_PS_PSTHRU	0x05000000UL
 #define SERIO_8042_XL	0x06000000UL
 
diff --git a/include/linux/shmem_fs.h b/include/linux/shmem_fs.h
index f8efcf10a..14a618109 100644
--- a/include/linux/shmem_fs.h
+++ b/include/linux/shmem_fs.h
@@ -8,6 +8,9 @@
 
 #define SHMEM_NR_DIRECT 16
 
+#define TMPFS_SUPER_MAGIC	0x01021994
+
+
 struct shmem_inode_info {
 	spinlock_t		lock;
 	unsigned long		next_index;
diff --git a/include/linux/signal.h b/include/linux/signal.h
index 0e95116b8..2407dd888 100644
--- a/include/linux/signal.h
+++ b/include/linux/signal.h
@@ -7,6 +7,9 @@
 #include <asm/siginfo.h>
 
 #ifdef __KERNEL__
+
+#define MAX_SIGPENDING	1024
+
 /*
  * Real Time signals may be queued.
  */
@@ -16,6 +19,7 @@ struct sigqueue {
 	spinlock_t *lock;
 	int flags;
 	siginfo_t info;
+	struct user_struct *user;
 };
 
 /* flags values. */
diff --git a/include/linux/skbuff.h b/include/linux/skbuff.h
index 7bf6501a9..724d6841d 100644
--- a/include/linux/skbuff.h
+++ b/include/linux/skbuff.h
@@ -27,6 +27,7 @@
 #include <linux/highmem.h>
 #include <linux/poll.h>
 #include <linux/net.h>
+#include <net/checksum.h>
 
 #define HAVE_ALLOC_SKB		/* For the drivers to know */
 #define HAVE_ALIGNABLE_SKB	/* Ditto 8)		   */
@@ -155,6 +156,7 @@ struct skb_shared_info {
  *	@sk: Socket we are owned by
  *	@stamp: Time we arrived
  *	@dev: Device we arrived on/are leaving by
+ *	@input_dev: Device we arrived on
  *      @real_dev: The real device we are using
  *	@h: Transport layer header
  *	@nh: Network layer header
@@ -197,6 +199,7 @@ struct sk_buff {
 	struct sock		*sk;
 	struct timeval		stamp;
 	struct net_device	*dev;
+	struct net_device	*input_dev;
 	struct net_device	*real_dev;
 
 	union {
@@ -230,7 +233,7 @@ struct sk_buff {
 	 * want to keep them across layers you have to do a skb_clone()
 	 * first. This is owned by whoever has the skb queued ATM.
 	 */
-	char			cb[48];
+	char			cb[40];
 
 	unsigned int		len,
 				data_len,
@@ -262,9 +265,15 @@ struct sk_buff {
 	} private;
 #endif
 #ifdef CONFIG_NET_SCHED
-       __u32			tc_index;               /* traffic control index */
+       __u32			tc_index;        /* traffic control index */
+#ifdef CONFIG_NET_CLS_ACT
+	__u32           tc_verd;               /* traffic control verdict */
+	__u32           tc_classid;            /* traffic control classid */
+ #endif
+
 #endif
 
+
 	/* These elements must be at the end, see alloc_skb() for details.  */
 	unsigned int		truesize;
 	atomic_t		users;
@@ -663,13 +672,15 @@ static inline int skb_pagelen(const struct sk_buff *skb)
 	return len + skb_headlen(skb);
 }
 
-static inline void skb_fill_page_desc(struct sk_buff *skb, int i, struct page *page, int off, int size)
+static inline void skb_fill_page_desc(struct sk_buff *skb, int i,
+				      struct page *page, int off, int size)
 {
 	skb_frag_t *frag = &skb_shinfo(skb)->frags[i];
-	frag->page = page;
-	frag->page_offset = off;
-	frag->size = size;
-	skb_shinfo(skb)->nr_frags = i+1;
+
+	frag->page		  = page;
+	frag->page_offset	  = off;
+	frag->size		  = size;
+	skb_shinfo(skb)->nr_frags = i + 1;
 }
 
 #define SKB_PAGE_ASSERT(skb) 	BUG_ON(skb_shinfo(skb)->nr_frags)
@@ -816,6 +827,30 @@ static inline void skb_reserve(struct sk_buff *skb, unsigned int len)
 	skb->tail += len;
 }
 
+/*
+ * CPUs often take a performance hit when accessing unaligned memory
+ * locations. The actual performance hit varies, it can be small if the
+ * hardware handles it or large if we have to take an exception and fix it
+ * in software.
+ *
+ * Since an ethernet header is 14 bytes network drivers often end up with
+ * the IP header at an unaligned offset. The IP header can be aligned by
+ * shifting the start of the packet by 2 bytes. Drivers should do this
+ * with:
+ *
+ * skb_reserve(NET_IP_ALIGN);
+ *
+ * The downside to this alignment of the IP header is that the DMA is now
+ * unaligned. On some architectures the cost of an unaligned DMA is high
+ * and this cost outweighs the gains made by aligning the IP header.
+ * 
+ * Since this trade off varies between architectures, we allow NET_IP_ALIGN
+ * to be overridden.
+ */
+#ifndef NET_IP_ALIGN
+#define NET_IP_ALIGN	2
+#endif
+
 extern int ___pskb_trim(struct sk_buff *skb, unsigned int len, int realloc);
 
 static inline void __skb_trim(struct sk_buff *skb, unsigned int len)
@@ -971,6 +1006,39 @@ static inline struct sk_buff *skb_padto(struct sk_buff *skb, unsigned int len)
 	return skb_pad(skb, len-size);
 }
 
+static inline int skb_add_data(struct sk_buff *skb,
+			       char __user *from, int copy)
+{
+	const int off = skb->len;
+
+	if (skb->ip_summed == CHECKSUM_NONE) {
+		int err = 0;
+		unsigned int csum = csum_and_copy_from_user(from,
+							    skb_put(skb, copy),
+							    copy, 0, &err);
+		if (!err) {
+			skb->csum = csum_block_add(skb->csum, csum, off);
+			return 0;
+		}
+	} else if (!copy_from_user(skb_put(skb, copy), from, copy))
+		return 0;
+
+	__skb_trim(skb, off);
+	return -EFAULT;
+}
+
+static inline int skb_can_coalesce(struct sk_buff *skb, int i,
+				   struct page *page, int off)
+{
+	if (i) {
+		struct skb_frag_struct *frag = &skb_shinfo(skb)->frags[i - 1];
+
+		return page == frag->page &&
+		       off == frag->page_offset + frag->size;
+	}
+	return 0;
+}
+
 /**
  *	skb_linearize - convert paged skb to linear one
  *	@skb: buffer to linarize
@@ -1034,10 +1102,28 @@ extern unsigned int    skb_copy_and_csum_bits(const struct sk_buff *skb,
 					      int offset, u8 *to, int len,
 					      unsigned int csum);
 extern void	       skb_copy_and_csum_dev(const struct sk_buff *skb, u8 *to);
+extern void	       skb_split(struct sk_buff *skb,
+				 struct sk_buff *skb1, const u32 len);
 
 extern void skb_init(void);
 extern void skb_add_mtu(int mtu);
 
+struct skb_iter {
+	/* Iteration functions set these */
+	unsigned char *data;
+	unsigned int len;
+
+	/* Private to iteration */
+	unsigned int nextfrag;
+	struct sk_buff *fraglist;
+};
+
+/* Keep iterating until skb_iter_next returns false. */
+extern void skb_iter_first(const struct sk_buff *skb, struct skb_iter *i);
+extern int skb_iter_next(const struct sk_buff *skb, struct skb_iter *i);
+/* Call this if aborting loop before !skb_iter_next */
+extern void skb_iter_abort(const struct sk_buff *skb, struct skb_iter *i);
+
 #ifdef CONFIG_NETFILTER
 static inline void nf_conntrack_put(struct nf_ct_info *nfct)
 {
@@ -1049,6 +1135,14 @@ static inline void nf_conntrack_get(struct nf_ct_info *nfct)
 	if (nfct)
 		atomic_inc(&nfct->master->use);
 }
+static inline void nf_reset(struct sk_buff *skb)
+{
+	nf_conntrack_put(skb->nfct);
+	skb->nfct = NULL;
+#ifdef CONFIG_NETFILTER_DEBUG
+	skb->nf_debug = 0;
+#endif
+}
 
 #ifdef CONFIG_BRIDGE_NETFILTER
 static inline void nf_bridge_put(struct nf_bridge_info *nf_bridge)
@@ -1061,9 +1155,10 @@ static inline void nf_bridge_get(struct nf_bridge_info *nf_bridge)
 	if (nf_bridge)
 		atomic_inc(&nf_bridge->use);
 }
-#endif
-
-#endif
+#endif /* CONFIG_BRIDGE_NETFILTER */
+#else /* CONFIG_NETFILTER */
+static inline void nf_reset(struct sk_buff *skb) {}
+#endif /* CONFIG_NETFILTER */
 
 #endif	/* __KERNEL__ */
 #endif	/* _LINUX_SKBUFF_H */
diff --git a/include/linux/smb_fs_sb.h b/include/linux/smb_fs_sb.h
index f2400292d..5b4ae2cc4 100644
--- a/include/linux/smb_fs_sb.h
+++ b/include/linux/smb_fs_sb.h
@@ -57,12 +57,10 @@ struct smb_sb_info {
 	unsigned int generation;
 	pid_t conn_pid;
 	struct smb_conn_opt opt;
-
+	wait_queue_head_t conn_wq;
+	int conn_complete;
 	struct semaphore sem;
 
-        unsigned short     rcls; /* The error codes we received */
-        unsigned short     err;
-
 	unsigned char      header[SMB_HEADER_LEN + 20*2 + 2];
 	u32                header_len;
 	u32                smb_len;
diff --git a/include/linux/stallion.h b/include/linux/stallion.h
index fc118c6f2..af82bd688 100644
--- a/include/linux/stallion.h
+++ b/include/linux/stallion.h
@@ -3,7 +3,7 @@
 /*
  *	stallion.h  -- stallion multiport serial driver.
  *
- *	Copyright (C) 1996-1998  Stallion Technologies (support@stallion.oz.au).
+ *	Copyright (C) 1996-1998  Stallion Technologies
  *	Copyright (C) 1994-1996  Greg Ungerer.
  *
  *	This program is free software; you can redistribute it and/or modify
diff --git a/include/linux/sunrpc/auth.h b/include/linux/sunrpc/auth.h
index a196e9b76..4eea2acb0 100644
--- a/include/linux/sunrpc/auth.h
+++ b/include/linux/sunrpc/auth.h
@@ -28,6 +28,7 @@
 struct auth_cred {
 	uid_t	uid;
 	gid_t	gid;
+	xid_t	xid;
 	struct group_info *group_info;
 };
 
diff --git a/include/linux/sunrpc/clnt.h b/include/linux/sunrpc/clnt.h
index 917ec29d7..62f97051c 100644
--- a/include/linux/sunrpc/clnt.h
+++ b/include/linux/sunrpc/clnt.h
@@ -53,7 +53,8 @@ struct rpc_clnt {
 				cl_autobind : 1,/* use getport() */
 				cl_droppriv : 1,/* enable NFS suid hack */
 				cl_oneshot  : 1,/* dispose after use */
-				cl_dead     : 1;/* abandoned */
+				cl_dead     : 1,/* abandoned */
+				cl_tagxid   : 1;/* do xid tagging */
 
 	struct rpc_rtt *	cl_rtt;		/* RTO estimator data */
 	struct rpc_portmap *	cl_pmap;	/* port mapping */
diff --git a/include/linux/sunrpc/svc.h b/include/linux/sunrpc/svc.h
index 980f2a4e4..7abde582f 100644
--- a/include/linux/sunrpc/svc.h
+++ b/include/linux/sunrpc/svc.h
@@ -67,7 +67,7 @@ struct svc_serv {
  * read responses (that have a header, and some data pages, and possibly
  * a tail) and means we can share some client side routines.
  *
- * The xdr_buf.head iovec always points to the first page in the rq_*pages
+ * The xdr_buf.head kvec always points to the first page in the rq_*pages
  * list.  The xdr_buf.pages pointer points to the second page on that
  * list.  xdr_buf.tail points to the end of the first page.
  * This assumes that the non-page part of an rpc reply will fit
@@ -78,7 +78,7 @@ struct svc_serv {
  */
 #define RPCSVC_MAXPAGES		((RPCSVC_MAXPAYLOAD+PAGE_SIZE-1)/PAGE_SIZE + 2)
 
-static inline u32 svc_getu32(struct iovec *iov)
+static inline u32 svc_getu32(struct kvec *iov)
 {
 	u32 val, *vp;
 	vp = iov->iov_base;
@@ -87,7 +87,7 @@ static inline u32 svc_getu32(struct iovec *iov)
 	iov->iov_len -= sizeof(u32);
 	return val;
 }
-static inline void svc_putu32(struct iovec *iov, u32 val)
+static inline void svc_putu32(struct kvec *iov, u32 val)
 {
 	u32 *vp = iov->iov_base + iov->iov_len;
 	*vp = val;
@@ -162,14 +162,14 @@ static inline int
 xdr_argsize_check(struct svc_rqst *rqstp, u32 *p)
 {
 	char *cp = (char *)p;
-	struct iovec *vec = &rqstp->rq_arg.head[0];
+	struct kvec *vec = &rqstp->rq_arg.head[0];
 	return cp - (char*)vec->iov_base <= vec->iov_len;
 }
 
 static inline int
 xdr_ressize_check(struct svc_rqst *rqstp, u32 *p)
 {
-	struct iovec *vec = &rqstp->rq_res.head[0];
+	struct kvec *vec = &rqstp->rq_res.head[0];
 	char *cp = (char*)p;
 
 	vec->iov_len = cp - (char*)vec->iov_base;
diff --git a/include/linux/sunrpc/svcauth.h b/include/linux/sunrpc/svcauth.h
index 30689cc57..5c16a7519 100644
--- a/include/linux/sunrpc/svcauth.h
+++ b/include/linux/sunrpc/svcauth.h
@@ -93,7 +93,6 @@ struct auth_ops {
 	int	(*release)(struct svc_rqst *rq);
 	void	(*domain_release)(struct auth_domain *);
 };
-extern struct auth_ops	*authtab[RPC_AUTH_MAXFLAVOR];
 
 #define	SVC_GARBAGE	1
 #define	SVC_SYSERR	2
diff --git a/include/linux/sunrpc/xdr.h b/include/linux/sunrpc/xdr.h
index 0b9aecd9b..112738cca 100644
--- a/include/linux/sunrpc/xdr.h
+++ b/include/linux/sunrpc/xdr.h
@@ -48,7 +48,7 @@ typedef int	(*kxdrproc_t)(void *rqstp, u32 *data, void *obj);
  * operations and/or has a need for scatter/gather involving pages.
  */
 struct xdr_buf {
-	struct iovec	head[1],	/* RPC header + non-page data */
+	struct kvec	head[1],	/* RPC header + non-page data */
 			tail[1];	/* Appended after page data */
 
 	struct page **	pages;		/* Array of contiguous pages */
@@ -127,15 +127,15 @@ xdr_decode_hyper(u32 *p, __u64 *valp)
 }
 
 /*
- * Adjust iovec to reflect end of xdr'ed data (RPC client XDR)
+ * Adjust kvec to reflect end of xdr'ed data (RPC client XDR)
  */
 static inline int
-xdr_adjust_iovec(struct iovec *iov, u32 *p)
+xdr_adjust_iovec(struct kvec *iov, u32 *p)
 {
 	return iov->iov_len = ((u8 *) p - (u8 *) iov->iov_base);
 }
 
-void xdr_shift_iovec(struct iovec *, int, size_t);
+void xdr_shift_iovec(struct kvec *, int, size_t);
 
 /*
  * Maximum number of iov's we use.
@@ -145,11 +145,11 @@ void xdr_shift_iovec(struct iovec *, int, size_t);
 /*
  * XDR buffer helper functions
  */
-extern int xdr_kmap(struct iovec *, struct xdr_buf *, size_t);
+extern int xdr_kmap(struct kvec *, struct xdr_buf *, size_t);
 extern void xdr_kunmap(struct xdr_buf *, size_t);
 extern void xdr_shift_buf(struct xdr_buf *, size_t);
 extern void _copy_from_pages(char *, struct page **, size_t, size_t);
-extern void xdr_buf_from_iov(struct iovec *, struct xdr_buf *);
+extern void xdr_buf_from_iov(struct kvec *, struct xdr_buf *);
 extern int xdr_buf_subsegment(struct xdr_buf *, struct xdr_buf *, int, int);
 extern int xdr_buf_read_netobj(struct xdr_buf *, struct xdr_netobj *, int);
 extern int read_bytes_from_xdr_buf(struct xdr_buf *buf, int base, void *obj, int len);
@@ -182,7 +182,7 @@ struct xdr_stream {
 	struct xdr_buf *buf;	/* XDR buffer to read/write */
 
 	uint32_t *end;		/* end of available buffer space */
-	struct iovec *iov;	/* pointer to the current iovec */
+	struct kvec *iov;	/* pointer to the current kvec */
 };
 
 extern void xdr_init_encode(struct xdr_stream *xdr, struct xdr_buf *buf, uint32_t *p);
diff --git a/include/linux/suspend.h b/include/linux/suspend.h
index 7e4409b7c..d0955f06c 100644
--- a/include/linux/suspend.h
+++ b/include/linux/suspend.h
@@ -67,24 +67,27 @@ extern int pm_prepare_console(void);
 extern void pm_restore_console(void);
 
 #else
-static inline void refrigerator(unsigned long flag)
-{
-
-}
-static inline int freeze_processes(void)
-{
-	return 0;
-}
-static inline void thaw_processes(void)
-{
-
-}
+static inline void refrigerator(unsigned long flag) {}
 #endif	/* CONFIG_PM */
 
+#ifdef CONFIG_SMP
+extern void disable_nonboot_cpus(void);
+extern void enable_nonboot_cpus(void);
+#else
+static inline void disable_nonboot_cpus(void) {}
+static inline void enable_nonboot_cpus(void) {}
+#endif
+
 asmlinkage void do_magic(int is_resume);
 asmlinkage void do_magic_resume_1(void);
 asmlinkage void do_magic_resume_2(void);
 asmlinkage void do_magic_suspend_1(void);
 asmlinkage void do_magic_suspend_2(void);
 
+void save_processor_state(void);
+void restore_processor_state(void);
+struct saved_context;
+void __save_processor_state(struct saved_context *ctxt);
+void __restore_processor_state(struct saved_context *ctxt);
+
 #endif /* _LINUX_SWSUSP_H */
diff --git a/include/linux/swap.h b/include/linux/swap.h
index a748538f3..b081066b5 100644
--- a/include/linux/swap.h
+++ b/include/linux/swap.h
@@ -148,7 +148,7 @@ struct swap_list_t {
 #define vm_swap_full() (nr_swap_pages*2 < total_swap_pages)
 
 /* linux/mm/oom_kill.c */
-extern void out_of_memory(void);
+extern void out_of_memory(int gfp_mask);
 
 /* linux/mm/memory.c */
 extern void swapin_readahead(swp_entry_t, unsigned long, struct vm_area_struct *);
@@ -156,7 +156,7 @@ extern void swapin_readahead(swp_entry_t, unsigned long, struct vm_area_struct *
 /* linux/mm/page_alloc.c */
 extern unsigned long totalram_pages;
 extern unsigned long totalhigh_pages;
-extern int nr_swap_pages;	/* XXX: shouldn't this be ulong? --hch */
+extern long nr_swap_pages;
 extern unsigned int nr_free_pages(void);
 extern unsigned int nr_free_pages_pgdat(pg_data_t *pgdat);
 extern unsigned int nr_free_buffer_pages(void);
@@ -206,7 +206,7 @@ extern struct page * read_swap_cache_async(swp_entry_t, struct vm_area_struct *v
 					   unsigned long addr);
 
 /* linux/mm/swapfile.c */
-extern int total_swap_pages;
+extern long total_swap_pages;
 extern unsigned int nr_swapfiles;
 extern struct swap_info_struct swap_info[];
 extern void si_swapinfo(struct sysinfo *);
diff --git a/include/linux/syscalls.h b/include/linux/syscalls.h
index ef193874f..fadfc6d7a 100644
--- a/include/linux/syscalls.h
+++ b/include/linux/syscalls.h
@@ -382,7 +382,7 @@ asmlinkage long sys_fchdir(unsigned int fd);
 asmlinkage long sys_rmdir(const char __user *pathname);
 asmlinkage long sys_lookup_dcookie(u64 cookie64, char __user *buf, size_t len);
 asmlinkage long sys_quotactl(unsigned int cmd, const char __user *special,
-				qid_t id, caddr_t addr);
+				qid_t id, void __user *addr);
 asmlinkage long sys_getdents(unsigned int fd,
 				struct linux_dirent __user *dirent,
 				unsigned int count);
diff --git a/include/linux/sysctl.h b/include/linux/sysctl.h
index 43cec328b..f3ce78734 100644
--- a/include/linux/sysctl.h
+++ b/include/linux/sysctl.h
@@ -165,6 +165,7 @@ enum
 	VM_LAPTOP_MODE=23,	/* vm laptop mode */
 	VM_BLOCK_DUMP=24,	/* block dump mode */
 	VM_HUGETLB_GROUP=25,	/* permitted hugetlb group */
+	VM_VFS_CACHE_PRESSURE=26, /* dcache/icache reclaim pressure */
 };
 
 
@@ -762,24 +763,24 @@ typedef int ctl_handler (ctl_table *table, int __user *name, int nlen,
 			 void **context);
 
 typedef int proc_handler (ctl_table *ctl, int write, struct file * filp,
-			  void __user *buffer, size_t *lenp);
+			  void __user *buffer, size_t *lenp, loff_t *ppos);
 
 extern int proc_dostring(ctl_table *, int, struct file *,
-			 void __user *, size_t *);
+			 void __user *, size_t *, loff_t *);
 extern int proc_dointvec(ctl_table *, int, struct file *,
-			 void __user *, size_t *);
+			 void __user *, size_t *, loff_t *);
 extern int proc_dointvec_bset(ctl_table *, int, struct file *,
-			      void __user *, size_t *);
+			      void __user *, size_t *, loff_t *);
 extern int proc_dointvec_minmax(ctl_table *, int, struct file *,
-				void __user *, size_t *);
+				void __user *, size_t *, loff_t *);
 extern int proc_dointvec_jiffies(ctl_table *, int, struct file *,
-				 void __user *, size_t *);
+				 void __user *, size_t *, loff_t *);
 extern int proc_dointvec_userhz_jiffies(ctl_table *, int, struct file *,
-					void __user *, size_t *);
+					void __user *, size_t *, loff_t *);
 extern int proc_doulongvec_minmax(ctl_table *, int, struct file *,
-				  void __user *, size_t *);
+				  void __user *, size_t *, loff_t *);
 extern int proc_doulongvec_ms_jiffies_minmax(ctl_table *table, int,
-				      struct file *, void __user *, size_t *);
+				      struct file *, void __user *, size_t *, loff_t *);
 
 extern int do_sysctl (int __user *name, int nlen,
 		      void __user *oldval, size_t __user *oldlenp,
diff --git a/include/linux/sysfs.h b/include/linux/sysfs.h
index 4cb54379e..23f783872 100644
--- a/include/linux/sysfs.h
+++ b/include/linux/sysfs.h
@@ -9,6 +9,8 @@
 #ifndef _SYSFS_H_
 #define _SYSFS_H_
 
+#define SYSFS_SUPER_MAGIC	0x62656572
+
 struct kobject;
 struct module;
 
@@ -24,6 +26,27 @@ struct attribute_group {
 };
 
 
+
+/**
+ * Use these macros to make defining attributes easier. See include/linux/device.h
+ * for examples..
+ */
+
+#define __ATTR(_name,_mode,_show,_store) { \
+	.attr = {.name = __stringify(_name), .mode = _mode, .owner = THIS_MODULE },	\
+	.show	= _show,					\
+	.store	= _store,					\
+}
+
+#define __ATTR_RO(_name) { \
+	.attr	= { .name = __stringify(_name), .mode = 0444, .owner = THIS_MODULE },	\
+	.show	= _name##_show,	\
+}
+
+#define __ATTR_NULL { .attr = { .name = NULL } }
+
+#define attr_name(_attr) (_attr).attr.name
+
 struct bin_attribute {
 	struct attribute	attr;
 	size_t			size;
diff --git a/include/linux/tcp.h b/include/linux/tcp.h
index 39e2d2261..9c42ac0b0 100644
--- a/include/linux/tcp.h
+++ b/include/linux/tcp.h
@@ -262,8 +262,8 @@ struct tcp_opt {
 	__u32	frto_highmark;	/* snd_nxt when RTO occurred */
 
 	__u8	unused_pad;
-	__u8	queue_shrunk;	/* Write queue has been shrunk recently.*/
 	__u8	defer_accept;	/* User waits for some data after accept() */
+	/* one byte hole, try to pack */
 
 /* RTT measurement */
 	__u8	backoff;	/* backoff				*/
@@ -297,7 +297,6 @@ struct tcp_opt {
 	struct sk_buff_head	out_of_order_queue; /* Out of order segments go here */
 
 	struct tcp_func		*af_specific;	/* Operations which are AF_INET{4,6} specific	*/
-	struct sk_buff		*send_head;	/* Front of stuff to transmit			*/
 
  	__u32	rcv_wnd;	/* Current receiver window		*/
 	__u32	rcv_wup;	/* rcv_nxt on last window update sent	*/
@@ -371,8 +370,6 @@ struct tcp_opt {
 	struct open_request	*accept_queue;
 	struct open_request	*accept_queue_tail;
 
-	int			write_pending;	/* A write to socket waits to start. */
-
 	unsigned int		keepalive_time;	  /* time before keep alive takes place */
 	unsigned int		keepalive_intvl;  /* time interval between keep alive probes */
 	int			linger2;
@@ -423,6 +420,7 @@ struct tcp_opt {
 		__u32	cnt;		/* increase cwnd by 1 after this number of ACKs */
 		__u32 	last_max_cwnd;	/* last maximium snd_cwnd */
 		__u32	last_cwnd;	/* the last snd_cwnd */
+		__u32   last_stamp;     /* time when updated last_cwnd */
 	} bictcp;
 };
 
diff --git a/include/linux/uio.h b/include/linux/uio.h
index 8bc074189..9af8bbcd8 100644
--- a/include/linux/uio.h
+++ b/include/linux/uio.h
@@ -23,6 +23,15 @@ struct iovec
 	__kernel_size_t iov_len; /* Must be size_t (1003.1g) */
 };
 
+#ifdef __KERNEL__
+
+struct kvec {
+	void *iov_base; /* and that should *never* hold a userland pointer */
+	size_t iov_len;
+};
+
+#endif
+
 /*
  *	UIO_MAXIOV shall be at least 16 1003.1g (5.4.1.1)
  */
diff --git a/include/linux/usb.h b/include/linux/usb.h
index 4013919ef..632e19947 100644
--- a/include/linux/usb.h
+++ b/include/linux/usb.h
@@ -241,6 +241,9 @@ struct usb_bus {
 	struct device *controller;	/* host/master side hardware */
 	int busnum;			/* Bus number (in order of reg) */
 	char *bus_name;			/* stable id (PCI slot_name etc) */
+	u8 otg_port;			/* 0, or number of OTG/HNP port */
+	unsigned is_b_host:1;		/* true during some HNP roleswitches */
+	unsigned b_hnp_enable:1;	/* OTG: did A-Host enable HNP? */
 
 	int devnum_next;		/* Next open device number in round-robin allocation */
 
@@ -355,7 +358,7 @@ extern int usb_driver_claim_interface(struct usb_driver *driver,
  * may need to explicitly claim that lock.
  *
  */
-static int inline usb_interface_claimed(struct usb_interface *iface) {
+static inline int usb_interface_claimed(struct usb_interface *iface) {
 	return (iface->dev.driver != NULL);
 }
 
@@ -657,7 +660,7 @@ typedef void (*usb_complete_t)(struct urb *, struct pt_regs *);
  * calling usb_alloc_urb() and freed with a call to usb_free_urb().
  * Initialization may be done using various usb_fill_*_urb() functions.  URBs
  * are submitted using usb_submit_urb(), and pending requests may be canceled
- * using usb_unlink_urb().
+ * using usb_unlink_urb() or usb_kill_urb().
  *
  * Data Transfer Buffers:
  *
@@ -684,7 +687,9 @@ typedef void (*usb_complete_t)(struct urb *, struct pt_regs *);
  * All URBs submitted must initialize dev, pipe,
  * transfer_flags (may be zero), complete, timeout (may be zero).
  * The URB_ASYNC_UNLINK transfer flag affects later invocations of
- * the usb_unlink_urb() routine.
+ * the usb_unlink_urb() routine.  Note: Failure to set URB_ASYNC_UNLINK
+ * with usb_unlink_urb() is deprecated.  For synchronous unlinks use
+ * usb_kill_urb() instead.
  *
  * All URBs must also initialize 
  * transfer_buffer and transfer_buffer_length.  They may provide the
@@ -762,6 +767,8 @@ struct urb
 	void *hcpriv;			/* private data for host controller */
 	struct list_head urb_list;	/* list pointer to all active urbs */
 	int bandwidth;			/* bandwidth for INT/ISO request */
+	atomic_t use_count;		/* concurrent submissions counter */
+	u8 reject;			/* submissions will fail */
 
 	/* public, documented fields in the urb that can be used by drivers */
 	struct usb_device *dev; 	/* (in) pointer to associated device */
@@ -897,6 +904,7 @@ extern void usb_free_urb(struct urb *urb);
 extern struct urb *usb_get_urb(struct urb *urb);
 extern int usb_submit_urb(struct urb *urb, int mem_flags);
 extern int usb_unlink_urb(struct urb *urb);
+extern void usb_kill_urb(struct urb *urb);
 
 #define HAVE_USB_BUFFERS
 void *usb_buffer_alloc (struct usb_device *dev, size_t size,
@@ -931,6 +939,11 @@ extern int usb_bulk_msg(struct usb_device *usb_dev, unsigned int pipe,
 	void *data, int len, int *actual_length,
 	int timeout);
 
+/* selective suspend/resume */
+extern int usb_suspend_device(struct usb_device *dev, u32 state);
+extern int usb_resume_device(struct usb_device *dev);
+
+
 /* wrappers around usb_control_msg() for the most common standard requests */
 extern int usb_get_descriptor(struct usb_device *dev, unsigned char desctype,
 	unsigned char descindex, void *buf, int size);
diff --git a/include/linux/usb_gadget.h b/include/linux/usb_gadget.h
index 3ba4e10d0..3f0831107 100644
--- a/include/linux/usb_gadget.h
+++ b/include/linux/usb_gadget.h
@@ -6,7 +6,7 @@
  * master many USB gadgets, but the gadgets are only slaved to one host.
  *
  *
- * (c) Copyright 2002-2003 by David Brownell
+ * (C) Copyright 2002-2004 by David Brownell
  * All Rights Reserved.
  *
  * This software is licensed under the GNU GPL version 2.
@@ -73,8 +73,6 @@ struct usb_ep;
  */
 	// NOTE this is analagous to 'struct urb' on the host side,
 	// except that it's thinner and promotes more pre-allocation.
-	//
-	// ISSUE should this be allocated through the device?
 
 struct usb_request {
 	void			*buf;
@@ -116,8 +114,8 @@ struct usb_ep_ops {
 		dma_addr_t *dma, int gfp_flags);
 	void (*free_buffer) (struct usb_ep *ep, void *buf, dma_addr_t dma,
 		unsigned bytes);
-	// NOTE:  on 2.5, drivers may also use dma_map() and
-	// dma_sync_single_*() to manage dma overhead.
+	// NOTE:  on 2.6, drivers may also use dma_map() and
+	// dma_sync_single_*() to directly manage dma overhead. 
 
 	int (*queue) (struct usb_ep *ep, struct usb_request *req,
 		int gfp_flags);
@@ -453,7 +451,10 @@ struct usb_gadget;
 struct usb_gadget_ops {
 	int	(*get_frame)(struct usb_gadget *);
 	int	(*wakeup)(struct usb_gadget *);
-	int	(*set_selfpowered) (struct usb_gadget *, int value);
+	int	(*set_selfpowered) (struct usb_gadget *, int is_selfpowered);
+	int	(*vbus_session) (struct usb_gadget *, int is_active);
+	int	(*vbus_draw) (struct usb_gadget *, unsigned mA);
+	int	(*pullup) (struct usb_gadget *, int is_on);
 	int	(*ioctl)(struct usb_gadget *,
 				unsigned code, unsigned long param);
 };
@@ -467,6 +468,17 @@ struct usb_gadget_ops {
  * @speed: Speed of current connection to USB host.
  * @is_dualspeed: True if the controller supports both high and full speed
  *	operation.  If it does, the gadget driver must also support both.
+ * @is_otg: True if the USB device port uses a Mini-AB jack, so that the
+ *	gadget driver must provide a USB OTG descriptor.
+ * @is_a_peripheral: False unless is_otg, the "A" end of a USB cable
+ *	is in the Mini-AB jack, and HNP has been used to switch roles
+ *	so that the "A" device currently acts as A-Peripheral, not A-Host.
+ * @a_hnp_support: OTG device feature flag, indicating that the A-Host
+ *	supports HNP at this port.
+ * @a_alt_hnp_support: OTG device feature flag, indicating that the A-Host
+ *	only supports HNP on a different root port.
+ * @b_hnp_enable: OTG device feature flag, indicating that the A-Host
+ *	enabled HNP support.
  * @name: Identifies the controller hardware type.  Used in diagnostics
  * 	and sometimes configuration.
  * @dev: Driver model state for this abstract device.
@@ -480,9 +492,14 @@ struct usb_gadget_ops {
  *
  * Except for the driver data, all fields in this structure are
  * read-only to the gadget driver.  That driver data is part of the
- * "driver model" infrastructure in 2.5 (and later) kernels, and for
+ * "driver model" infrastructure in 2.6 (and later) kernels, and for
  * earlier systems is grouped in a similar structure that's not known
  * to the rest of the kernel.
+ *
+ * Values of the three OTG device feature flags are updated before the
+ * setup() call corresponding to USB_REQ_SET_CONFIGURATION, and before
+ * driver suspend() calls.  They are valid only when is_otg, and when the
+ * device is acting as a B-Peripheral (so is_a_peripheral is false).
  */
 struct usb_gadget {
 	/* readonly to gadget driver */
@@ -491,6 +508,11 @@ struct usb_gadget {
 	struct list_head		ep_list;	/* of usb_ep */
 	enum usb_device_speed		speed;
 	unsigned			is_dualspeed:1;
+	unsigned			is_otg:1;
+	unsigned			is_a_peripheral:1;
+	unsigned			b_hnp_enable:1;
+	unsigned			a_hnp_support:1;
+	unsigned			a_alt_hnp_support:1;
 	const char			*name;
 	struct device			dev;
 };
@@ -525,6 +547,10 @@ static inline int usb_gadget_frame_number (struct usb_gadget *gadget)
  * doesn't support such attempts, or its support has not been enabled
  * by the usb host.  Drivers must return device descriptors that report
  * their ability to support this, or hosts won't enable it.
+ *
+ * This may also try to use SRP to wake the host and start enumeration,
+ * even if OTG isn't otherwise in use.  OTG devices may also start
+ * remote wakeup even when hosts don't explicitly enable it.
  */
 static inline int usb_gadget_wakeup (struct usb_gadget *gadget)
 {
@@ -568,6 +594,107 @@ usb_gadget_clear_selfpowered (struct usb_gadget *gadget)
 	return gadget->ops->set_selfpowered (gadget, 0);
 }
 
+/**
+ * usb_gadget_vbus_connect - Notify controller that VBUS is powered
+ * @gadget:The device which now has VBUS power.
+ *
+ * This call is used by a driver for an external transceiver (or GPIO)
+ * that detects a VBUS power session starting.  Common responses include
+ * resuming the controller, activating the D+ (or D-) pullup to let the
+ * host detect that a USB device is attached, and starting to draw power
+ * (8mA or possibly more, especially after SET_CONFIGURATION).
+ *
+ * Returns zero on success, else negative errno.
+ */
+static inline int
+usb_gadget_vbus_connect(struct usb_gadget *gadget)
+{
+	if (!gadget->ops->vbus_session)
+		return -EOPNOTSUPP;
+	return gadget->ops->vbus_session (gadget, 1);
+}
+
+/**
+ * usb_gadget_vbus_draw - constrain controller's VBUS power usage
+ * @gadget:The device whose VBUS usage is being described
+ * @mA:How much current to draw, in milliAmperes.  This should be twice
+ *	the value listed in the configuration descriptor bMaxPower field.
+ *
+ * This call is used by gadget drivers during SET_CONFIGURATION calls,
+ * reporting how much power the device may consume.  For example, this
+ * could affect how quickly batteries are recharged.
+ *
+ * Returns zero on success, else negative errno.
+ */
+static inline int
+usb_gadget_vbus_draw(struct usb_gadget *gadget, unsigned mA)
+{
+	if (!gadget->ops->vbus_draw)
+		return -EOPNOTSUPP;
+	return gadget->ops->vbus_draw (gadget, mA);
+}
+
+/**
+ * usb_gadget_vbus_disconnect - notify controller about VBUS session end
+ * @gadget:the device whose VBUS supply is being described
+ *
+ * This call is used by a driver for an external transceiver (or GPIO)
+ * that detects a VBUS power session ending.  Common responses include
+ * reversing everything done in usb_gadget_vbus_connect().
+ *
+ * Returns zero on success, else negative errno.
+ */
+static inline int
+usb_gadget_vbus_disconnect(struct usb_gadget *gadget)
+{
+	if (!gadget->ops->vbus_session)
+		return -EOPNOTSUPP;
+	return gadget->ops->vbus_session (gadget, 0);
+}
+
+/**
+ * usb_gadget_connect - software-controlled connect to USB host
+ * @gadget:the peripheral being connected
+ *
+ * Enables the D+ (or potentially D-) pullup.  The host will start
+ * enumerating this gadget when the pullup is active and a VBUS session
+ * is active (the link is powered).  This pullup is always enabled unless
+ * usb_gadget_disconnect() has been used to disable it.
+ *
+ * Returns zero on success, else negative errno.
+ */
+static inline int
+usb_gadget_connect (struct usb_gadget *gadget)
+{
+	if (!gadget->ops->pullup)
+		return -EOPNOTSUPP;
+	return gadget->ops->pullup (gadget, 1);
+}
+
+/**
+ * usb_gadget_disconnect - software-controlled disconnect from USB host
+ * @gadget:the peripheral being disconnected
+ *
+ * Disables the D+ (or potentially D-) pullup, which the host may see
+ * as a disconnect (when a VBUS session is active).  Not all systems
+ * support software pullup controls.
+ *
+ * This routine may be used during the gadget driver bind() call to prevent
+ * the peripheral from ever being visible to the USB host, unless later
+ * usb_gadget_connect() is called.  For example, user mode components may
+ * need to be activated before the system can talk to hosts.
+ *
+ * Returns zero on success, else negative errno.
+ */
+static inline int
+usb_gadget_disconnect (struct usb_gadget *gadget)
+{
+	if (!gadget->ops->pullup)
+		return -EOPNOTSUPP;
+	return gadget->ops->pullup (gadget, 0);
+}
+
+
 
 /*-------------------------------------------------------------------------*/
 
@@ -601,6 +728,12 @@ usb_gadget_clear_selfpowered (struct usb_gadget *gadget)
  * means the driver will handle setup() requests needed to enumerate (and
  * meet "chapter 9" requirements) then do some useful work.
  *
+ * If gadget->is_otg is true, the gadget driver must provide an OTG
+ * descriptor during enumeration, or else fail the bind() call.  In such
+ * cases, no USB traffic may flow until both bind() returns without
+ * having called usb_gadget_disconnect(), and the USB host stack has
+ * initialized.
+ *
  * Drivers use hardware-specific knowledge to configure the usb hardware.
  * endpoint addressing is only one of several hardware characteristics that
  * are in descriptors the ep0 implementation returns from setup() calls.
@@ -634,6 +767,12 @@ usb_gadget_clear_selfpowered (struct usb_gadget *gadget)
  * the (remote) host can't do that any longer; or an error state might
  * be cleared, to make the device behave identically whether or not
  * power is maintained.
+ *
+ * If the OTG b_hnp_enabled flag is set during a suspend() call, the
+ * device may use HNP to switch from "B-Peripheral" to "B-Host" mode
+ * (or back from "A-Peripheral" mode to the original "A-Host") if
+ * the gadget driver calls usb_gadget_disconnect() before the device
+ * is resumed.
  */
 struct usb_gadget_driver {
 	char			*function;
diff --git a/include/linux/usbdevice_fs.h b/include/linux/usbdevice_fs.h
index 4235d9f35..78f47434b 100644
--- a/include/linux/usbdevice_fs.h
+++ b/include/linux/usbdevice_fs.h
@@ -63,7 +63,7 @@ struct usbdevfs_setinterface {
 
 struct usbdevfs_disconnectsignal {
 	unsigned int signr;
-	void *context;
+	void __user *context;
 };
 
 #define USBDEVFS_MAXDRIVERNAME 255
@@ -162,7 +162,7 @@ struct dev_state {
 	wait_queue_head_t wait;     /* wake up if a request completed */
 	unsigned int discsignr;
 	struct task_struct *disctask;
-	void *disccontext;
+	void __user *disccontext;
 	unsigned long ifclaimed;
 };
 
diff --git a/include/linux/videodev.h b/include/linux/videodev.h
index cfcf6f1cd..f82a7451f 100644
--- a/include/linux/videodev.h
+++ b/include/linux/videodev.h
@@ -222,7 +222,7 @@ struct video_window
 	__u32	width,height;		/* Its size */
 	__u32	chromakey;
 	__u32	flags;
-	struct	video_clip *clips;	/* Set only */
+	struct	video_clip __user *clips;	/* Set only */
 	int	clipcount;
 #define VIDEO_WINDOW_INTERLACE	1
 #define VIDEO_WINDOW_CHROMAKEY	16	/* Overlay by chromakey */
@@ -429,8 +429,9 @@ struct video_code
 #define VID_HARDWARE_CPIA2	33
 #define VID_HARDWARE_VICAM      34
 #define VID_HARDWARE_SF16FMR2	35
-#define VID_HARDWARE_W9968CF    36
+#define VID_HARDWARE_W9968CF	36
 #define VID_HARDWARE_SAA7114H   37
+#define VID_HARDWARE_SN9C102	38
 #endif /* __LINUX_VIDEODEV_H */
 
 /*
diff --git a/include/linux/videodev2.h b/include/linux/videodev2.h
index a4ab8e826..076dd41d5 100644
--- a/include/linux/videodev2.h
+++ b/include/linux/videodev2.h
@@ -207,6 +207,9 @@ struct v4l2_pix_format
 #define V4L2_PIX_FMT_YYUV    v4l2_fourcc('Y','Y','U','V') /* 16  YUV 4:2:2     */
 #define V4L2_PIX_FMT_HI240   v4l2_fourcc('H','I','2','4') /*  8  8-bit color   */
 
+/* see http://www.siliconimaging.com/RGB%20Bayer.htm */
+#define V4L2_PIX_FMT_SBGGR8  v4l2_fourcc('B','A','8','1') /*  8  BGBG.. GRGR.. */
+
 /* compressed formats */
 #define V4L2_PIX_FMT_MJPEG    v4l2_fourcc('M','J','P','G') /* Motion-JPEG   */
 #define V4L2_PIX_FMT_JPEG     v4l2_fourcc('J','P','E','G') /* JFIF JPEG     */
@@ -383,8 +386,8 @@ struct v4l2_buffer
 		unsigned long   userptr;
 	} m;
 	__u32			length;
-
-	__u32			reserved[2];
+	__u32			input;
+	__u32			reserved;
 };
 
 /*  Flags for 'flags' field */
@@ -395,6 +398,7 @@ struct v4l2_buffer
 #define V4L2_BUF_FLAG_PFRAME	0x0010	/* Image is a P-frame */
 #define V4L2_BUF_FLAG_BFRAME	0x0020	/* Image is a B-frame */
 #define V4L2_BUF_FLAG_TIMECODE	0x0100	/* timecode field is valid */
+#define V4L2_BUF_FLAG_INPUT     0x0200  /* input field is valid */
 
 /*
  *	O V E R L A Y   P R E V I E W
@@ -429,9 +433,9 @@ struct v4l2_window
 	struct v4l2_rect        w;
 	enum v4l2_field  	field;
 	__u32			chromakey;
-	struct v4l2_clip	*clips;
+	struct v4l2_clip	__user *clips;
 	__u32			clipcount;
-	void			*bitmap;
+	void			__user *bitmap;
 };
 
 
@@ -526,12 +530,13 @@ typedef __u64 v4l2_std_id;
 				 V4L2_STD_PAL_I)
 #define V4L2_STD_NTSC           (V4L2_STD_NTSC_M	|\
 				 V4L2_STD_NTSC_M_JP)
+#define V4L2_STD_SECAM_DK      	(V4L2_STD_SECAM_D	|\
+				 V4L2_STD_SECAM_K	|\
+				 V4L2_STD_SECAM_K1)
 #define V4L2_STD_SECAM		(V4L2_STD_SECAM_B	|\
-				 V4L2_STD_SECAM_D	|\
 				 V4L2_STD_SECAM_G	|\
 				 V4L2_STD_SECAM_H	|\
-				 V4L2_STD_SECAM_K	|\
-				 V4L2_STD_SECAM_K1	|\
+				 V4L2_STD_SECAM_DK	|\
 				 V4L2_STD_SECAM_L)
 
 #define V4L2_STD_525_60		(V4L2_STD_PAL_M		|\
@@ -541,6 +546,8 @@ typedef __u64 v4l2_std_id;
 				 V4L2_STD_PAL_N		|\
 				 V4L2_STD_PAL_Nc	|\
 				 V4L2_STD_SECAM)
+#define V4L2_STD_ATSC           (V4L2_STD_ATSC_8_VSB    |\
+		                 V4L2_STD_ATSC_16_VSB)
 
 #define V4L2_STD_UNKNOWN        0
 #define V4L2_STD_ALL            (V4L2_STD_525_60	|\
diff --git a/include/linux/videotext.h b/include/linux/videotext.h
index 78faf6afe..ab778ef25 100644
--- a/include/linux/videotext.h
+++ b/include/linux/videotext.h
@@ -71,7 +71,7 @@ typedef struct
 	int pgbuf;	/* buffer where page will be stored */
 	int start;	/* start of requested part of page */
 	int end;	/* end of requested part of page */
-	void *buffer;	/* pointer to beginning of destination buffer */
+	void __user *buffer;	/* pointer to beginning of destination buffer */
 }
 vtx_pagereq_t;
 
diff --git a/include/linux/vmalloc.h b/include/linux/vmalloc.h
index 570778dde..8c6871781 100644
--- a/include/linux/vmalloc.h
+++ b/include/linux/vmalloc.h
@@ -23,6 +23,7 @@ struct vm_struct {
  *	Highlevel APIs for driver use
  */
 extern void *vmalloc(unsigned long size);
+extern void *vmalloc_exec(unsigned long size);
 extern void *vmalloc_32(unsigned long size);
 extern void *__vmalloc(unsigned long size, int gfp_mask, pgprot_t prot);
 extern void vfree(void *addr);
@@ -35,6 +36,8 @@ extern void vunmap(void *addr);
  *	Lowlevel-APIs (not for driver use!)
  */
 extern struct vm_struct *get_vm_area(unsigned long size, unsigned long flags);
+extern struct vm_struct *__get_vm_area(unsigned long size, unsigned long flags,
+					unsigned long start, unsigned long end);
 extern struct vm_struct *remove_vm_area(void *addr);
 extern int map_vm_area(struct vm_struct *area, pgprot_t prot,
 			struct page ***pages);
diff --git a/include/linux/vs_base.h b/include/linux/vs_base.h
index 4f04513ff..52096ed2b 100644
--- a/include/linux/vs_base.h
+++ b/include/linux/vs_base.h
@@ -3,15 +3,6 @@
 
 #include "vserver/context.h"
 
-// #define VX_DEBUG
-
-
-#if defined(VX_DEBUG)
-#define vxdprintk(x...) printk("vxd: " x)
-#else
-#define vxdprintk(x...)
-#endif
-
 
 #define vx_task_xid(t)	((t)->xid)
 
diff --git a/include/linux/vs_context.h b/include/linux/vs_context.h
index 727a16cdc..541935bcb 100644
--- a/include/linux/vs_context.h
+++ b/include/linux/vs_context.h
@@ -2,21 +2,12 @@
 #define _VX_VS_CONTEXT_H
 
 
-// #define VX_DEBUG
-
 #include <linux/kernel.h>
 #include <linux/rcupdate.h>
 #include <linux/sched.h>
 
 #include "vserver/context.h"
-
-#undef	vxdprintk
-#if defined(VX_DEBUG)
-#define vxdprintk(x...) printk("vxd: " x)
-#else
-#define vxdprintk(x...)
-#endif
-
+#include "vserver/debug.h"
 
 
 extern int proc_pid_vx_info(struct task_struct *, char *);
@@ -29,7 +20,7 @@ static inline struct vx_info *__get_vx_info(struct vx_info *vxi,
 {
 	if (!vxi)
 		return NULL;
-	vxdprintk("get_vx_info(%p[#%d.%d])\t%s:%d\n",
+	vxlprintk(VXD_CBIT(xid, 2), "get_vx_info(%p[#%d.%d])",
 		vxi, vxi?vxi->vx_id:0, vxi?atomic_read(&vxi->vx_usecnt):0,
 		_file, _line);
 	atomic_inc(&vxi->vx_usecnt);
@@ -38,7 +29,7 @@ static inline struct vx_info *__get_vx_info(struct vx_info *vxi,
 
 
 #define	free_vx_info(i)	\
-	call_rcu(&i->vx_rcu, rcu_free_vx_info, i);
+	call_rcu(&i->vx_rcu, rcu_free_vx_info);
 
 #define put_vx_info(i)	__put_vx_info(i,__FILE__,__LINE__)
 
@@ -46,7 +37,7 @@ static inline void __put_vx_info(struct vx_info *vxi, const char *_file, int _li
 {
 	if (!vxi)
 		return;
-	vxdprintk("put_vx_info(%p[#%d.%d])\t%s:%d\n",
+	vxlprintk(VXD_CBIT(xid, 2), "put_vx_info(%p[#%d.%d])",
 		vxi, vxi?vxi->vx_id:0, vxi?atomic_read(&vxi->vx_usecnt):0,
 		_file, _line);
 	if (atomic_dec_and_test(&vxi->vx_usecnt))
@@ -61,7 +52,7 @@ static inline void __set_vx_info(struct vx_info **vxp, struct vx_info *vxi,
 	BUG_ON(*vxp);
 	if (!vxi)
 		return;
-	vxdprintk("set_vx_info(%p[#%d.%d.%d])\t%s:%d\n",
+	vxlprintk(VXD_CBIT(xid, 3), "set_vx_info(%p[#%d.%d.%d])",
 		vxi, vxi?vxi->vx_id:0,
 		vxi?atomic_read(&vxi->vx_usecnt):0,
 		vxi?atomic_read(&vxi->vx_refcnt):0,
@@ -79,7 +70,7 @@ static inline void __clr_vx_info(struct vx_info **vxp,
 
 	if (!vxo)
 		return;
-	vxdprintk("clr_vx_info(%p[#%d.%d.%d])\t%s:%d\n",
+	vxlprintk(VXD_CBIT(xid, 3), "clr_vx_info(%p[#%d.%d.%d])",
 		vxo, vxo?vxo->vx_id:0,
 		vxo?atomic_read(&vxo->vx_usecnt):0,
 		vxo?atomic_read(&vxo->vx_refcnt):0,
@@ -100,6 +91,8 @@ static __inline__ struct vx_info *__task_get_vx_info(struct task_struct *p,
 	struct vx_info *vxi;
 	
 	task_lock(p);
+	vxlprintk(VXD_CBIT(xid, 5), "task_get_vx_info(%p)",
+		p, _file, _line);
 	vxi = __get_vx_info(p->vx_info, _file, _line);
 	task_unlock(p);
 	return vxi;
@@ -120,9 +113,6 @@ static __inline__ void __vx_verify_info(
 }
 
 
-#undef	vxdprintk
-#define vxdprintk(x...)
-
 #else
 #warning duplicate inclusion
 #endif
diff --git a/include/linux/vs_cvirt.h b/include/linux/vs_cvirt.h
index 65f430362..07c3e8620 100644
--- a/include/linux/vs_cvirt.h
+++ b/include/linux/vs_cvirt.h
@@ -1,18 +1,10 @@
 #ifndef _VX_VS_CVIRT_H
 #define _VX_VS_CVIRT_H
 
-
-// #define VX_DEBUG
-
 #include "vserver/cvirt.h"
+#include "vserver/debug.h"
 #include "vs_base.h"
 
-#if defined(VX_DEBUG)
-#define vxdprintk(x...) printk("vxd: " x)
-#else
-#define vxdprintk(x...)
-#endif
-
 
 /* utsname virtualization */
 
@@ -36,7 +28,8 @@ static inline int __vx_map_tgid(struct vx_info *vxi, int pid,
 	char *file, int line)
 {
 	if (vxi && __vx_flags(vxi->vx_flags, VXF_INFO_INIT, 0)) {
-		vxdprintk("vx_map_tgid: %p/%llx: %d -> %d in %s:%d\n",
+		vxlprintk(VXD_CBIT(cvirt, 2),
+			"vx_map_tgid: %p/%llx: %d -> %d",
 			vxi, vxi->vx_flags, pid,
 			(pid == vxi->vx_initpid)?1:pid,
 			file, line);
@@ -53,7 +46,8 @@ static inline int __vx_rmap_tgid(struct vx_info *vxi, int pid,
 	char *file, int line)
 {
 	if (vxi && __vx_flags(vxi->vx_flags, VXF_INFO_INIT, 0)) {
-		vxdprintk("vx_rmap_tgid: %p/%llx: %d -> %d in %s:%d\n",
+		vxlprintk(VXD_CBIT(cvirt, 2),
+			"vx_rmap_tgid: %p/%llx: %d -> %d",
 			vxi, vxi->vx_flags, pid,
 			(pid == 1)?vxi->vx_initpid:pid,
 			file, line);
@@ -63,8 +57,6 @@ static inline int __vx_rmap_tgid(struct vx_info *vxi, int pid,
 	return pid;
 }
 
-#undef	vxdprintk
-#define vxdprintk(x...)
 
 #else
 #warning duplicate inclusion
diff --git a/include/linux/vs_dlimit.h b/include/linux/vs_dlimit.h
index d80c563f6..53400ab98 100644
--- a/include/linux/vs_dlimit.h
+++ b/include/linux/vs_dlimit.h
@@ -1,21 +1,13 @@
 #ifndef _VX_VS_DLIMIT_H
 #define _VX_VS_DLIMIT_H
 
-
-// #define VX_DEBUG
-
 #include <linux/kernel.h>
 #include <linux/rcupdate.h>
 #include <linux/sched.h>
 
 #include "vserver/context.h"
 #include "vserver/dlimit.h"
-
-#if defined(VX_DEBUG)
-#define vxdprintk(x...) printk("vxd: " x)
-#else
-#define vxdprintk(x...)
-#endif
+#include "vserver/debug.h"
 
 
 #define get_dl_info(i)	__get_dl_info(i,__FILE__,__LINE__)
@@ -25,7 +17,7 @@ static inline struct dl_info *__get_dl_info(struct dl_info *dli,
 {
 	if (!dli)
 		return NULL;
-	vxdprintk("get_dl_info(%p[#%d.%d])\t%s:%d\n",
+	vxlprintk(VXD_CBIT(dlim, 4), "get_dl_info(%p[#%d.%d])",
 		dli, dli?dli->dl_xid:0, dli?atomic_read(&dli->dl_usecnt):0,
 		_file, _line);
 	atomic_inc(&dli->dl_usecnt);
@@ -34,15 +26,16 @@ static inline struct dl_info *__get_dl_info(struct dl_info *dli,
 
 
 #define	free_dl_info(i)	\
-	call_rcu(&i->dl_rcu, rcu_free_dl_info, i);
+	call_rcu(&i->dl_rcu, rcu_free_dl_info);
 
 #define put_dl_info(i)	__put_dl_info(i,__FILE__,__LINE__)
 
-static inline void __put_dl_info(struct dl_info *dli, const char *_file, int _line)
+static inline void __put_dl_info(struct dl_info *dli,
+	const char *_file, int _line)
 {
 	if (!dli)
 		return;
-	vxdprintk("put_dl_info(%p[#%d.%d])\t%s:%d\n",
+	vxlprintk(VXD_CBIT(dlim, 4), "put_dl_info(%p[#%d.%d])",
 		dli, dli?dli->dl_xid:0, dli?atomic_read(&dli->dl_usecnt):0,
 		_file, _line);
 	if (atomic_dec_and_test(&dli->dl_usecnt))
@@ -50,8 +43,6 @@ static inline void __put_dl_info(struct dl_info *dli, const char *_file, int _li
 }
 
 
-extern int vx_debug_dlimit;
-
 #define	__dlimit_char(d)	((d)?'*':' ')
 
 static inline int __dl_alloc_space(struct super_block *sb,
@@ -73,14 +64,14 @@ static inline int __dl_alloc_space(struct super_block *sb,
 	spin_unlock(&dli->dl_lock);
 	put_dl_info(dli);
 out:
-	if (vx_debug_dlimit)
-		printk("ALLOC (%p,#%d)%c %lld bytes (%d)@ %s:%d\n",
-			sb, xid, __dlimit_char(dli), nr, ret, file, line);
+	vxlprintk(VXD_CBIT(dlim, 1),
+		"ALLOC (%p,#%d)%c %lld bytes (%d)",
+		sb, xid, __dlimit_char(dli), nr, ret, file, line);
 	return ret;
 }
 
 static inline void __dl_free_space(struct super_block *sb,
-	xid_t xid, dlsize_t nr, const char *file, int line)
+	xid_t xid, dlsize_t nr, const char *_file, int _line)
 {
 	struct dl_info *dli = NULL;
 
@@ -91,17 +82,20 @@ static inline void __dl_free_space(struct super_block *sb,
 		goto out;
 
 	spin_lock(&dli->dl_lock);
-	dli->dl_space_used -= nr;
+	if (dli->dl_space_used > nr)
+		dli->dl_space_used -= nr;
+	else
+		dli->dl_space_used = 0;
 	spin_unlock(&dli->dl_lock);
 	put_dl_info(dli);
 out:
-	if (vx_debug_dlimit)
-		printk("FREE  (%p,#%d)%c %lld bytes @ %s:%d\n",
-			sb, xid, __dlimit_char(dli), nr, file, line);
+	vxlprintk(VXD_CBIT(dlim, 1),
+		"FREE  (%p,#%d)%c %lld bytes",
+		sb, xid, __dlimit_char(dli), nr, _file, _line);
 }
 
 static inline int __dl_alloc_inode(struct super_block *sb,
-	xid_t xid, const char *file, int line)
+	xid_t xid, const char *_file, int _line)
 {
 	struct dl_info *dli;
 	int ret = 0;
@@ -114,17 +108,24 @@ static inline int __dl_alloc_inode(struct super_block *sb,
 	ret = (dli->dl_inodes_used >= dli->dl_inodes_total);
 	if (!ret)
 		dli->dl_inodes_used++;
+#if 0
+	else
+		printk("VSW: DLIMIT hit (%p,#%d), inode %d>=%d @ %s:%d\n",
+			sb, xid,
+			dli->dl_inodes_used, dli->dl_inodes_total,
+			file, line);
+#endif
 	spin_unlock(&dli->dl_lock);
 	put_dl_info(dli);
 out:
-	if (vx_debug_dlimit)
-		printk("ALLOC (%p,#%d)%c inode (%d)@ %s:%d\n",
-			sb, xid, __dlimit_char(dli), ret, file, line);
+	vxlprintk(VXD_CBIT(dlim, 0),
+		"ALLOC (%p,#%d)%c inode (%d)",
+		sb, xid, __dlimit_char(dli), ret, _file, _line);
 	return ret;
 }
 
 static inline void __dl_free_inode(struct super_block *sb,
-	xid_t xid, const char *file, int line)
+	xid_t xid, const char *_file, int _line)
 {
 	struct dl_info *dli;
 
@@ -133,15 +134,51 @@ static inline void __dl_free_inode(struct super_block *sb,
 		goto out;
 
 	spin_lock(&dli->dl_lock);
-	dli->dl_inodes_used--;
+	if (dli->dl_inodes_used > 1)
+		dli->dl_inodes_used--;
+	else
+		dli->dl_inodes_used = 0;
 	spin_unlock(&dli->dl_lock);
 	put_dl_info(dli);
 out:
-	if (vx_debug_dlimit)
-		printk("FREE  (%p,#%d)%c inode @ %s:%d\n",
-			sb, xid, __dlimit_char(dli), file, line);
+	vxlprintk(VXD_CBIT(dlim, 0),
+		"FREE  (%p,#%d)%c inode",
+		sb, xid, __dlimit_char(dli), _file, _line);
 }
 
+static inline void __dl_adjust_block(struct super_block *sb, xid_t xid,
+	unsigned int *free_blocks, unsigned int *root_blocks,
+	const char *_file, int _line)
+{
+	struct dl_info *dli;
+	uint64_t broot, bfree;
+
+	dli = locate_dl_info(sb, xid);
+	if (!dli)
+		return;
+
+	spin_lock(&dli->dl_lock);
+	broot = (dli->dl_space_total -
+		(dli->dl_space_total >> 10) * dli->dl_nrlmult)
+		>> sb->s_blocksize_bits;
+	bfree = (dli->dl_space_total - dli->dl_space_used)
+			>> sb->s_blocksize_bits;
+	spin_unlock(&dli->dl_lock);
+
+	vxlprintk(VXD_CBIT(dlim, 2),
+		"ADJUST: %lld,%lld on %d,%d [mult=%d]",
+		bfree, broot, *free_blocks, *root_blocks,
+		dli->dl_nrlmult, _file, _line);
+	if (free_blocks) {
+		if (*free_blocks > bfree)
+			*free_blocks = bfree;
+	}
+	if (root_blocks) {
+		if (*root_blocks > broot)
+			*root_blocks = broot;
+	}
+	put_dl_info(dli);
+}
 
 
 #define DLIMIT_ALLOC_BLOCK(sb, xid, nr) \
@@ -161,7 +198,8 @@ out:
 	__dl_free_inode(sb, xid, __FILE__, __LINE__ )
 
 
-#define	DLIMIT_ADJUST_BLOCK(sb, xid, fb, rb)
+#define	DLIMIT_ADJUST_BLOCK(sb, xid, fb, rb) \
+	__dl_adjust_block(sb, xid, fb, rb, __FILE__, __LINE__ )
 
 
 #else
diff --git a/include/linux/vs_limit.h b/include/linux/vs_limit.h
index 82e8de4ec..ce0819404 100644
--- a/include/linux/vs_limit.h
+++ b/include/linux/vs_limit.h
@@ -1,42 +1,29 @@
 #ifndef _VX_VS_LIMIT_H
 #define _VX_VS_LIMIT_H
 
-
-// #define VX_DEBUG
-
 #include <linux/kernel.h>
 #include <linux/rcupdate.h>
 #include <linux/sched.h>
 
 #include "vserver/context.h"
 #include "vserver/limit.h"
+#include "vserver/debug.h"
 
 
 /* file limits */
 
-#define VX_DEBUG_ACC_FILE	0
-#define VX_DEBUG_ACC_OPENFD	0
-
-#if	(VX_DEBUG_ACC_FILE) || (VX_DEBUG_ACC_OPENFD)
-#define vxdprintk(x...) printk("vxd: " x)
-#else
-#define vxdprintk(x...)
-#endif
-
-
-#define vx_acc_cres(v,d,r) \
-	__vx_acc_cres((v), (r), (d), __FILE__, __LINE__)
 
 static inline void __vx_acc_cres(struct vx_info *vxi,
-	int res, int dir, char *file, int line)
+	int res, int dir, void *_data, char *_file, int _line)
 {
+	if (VXD_RLIMIT(res, RLIMIT_NOFILE) ||
+		VXD_RLIMIT(res, RLIMIT_NPROC) ||
+		VXD_RLIMIT(res, VLIMIT_NSOCK))
+		vxlprintk(1, "vx_acc_cres[%5d,%s,%2d]: %5d%s (%p)",
+			(vxi?vxi->vx_id:-1), vlimit_name[res], res,
+			(vxi?atomic_read(&vxi->limit.rcur[res]):0),
+			(dir>0)?"++":"--", _data, _file, _line);
         if (vxi) {
-	if ((res == RLIMIT_NOFILE && VX_DEBUG_ACC_FILE) ||
-			(res == RLIMIT_OPENFD && VX_DEBUG_ACC_OPENFD))
-	printk("vx_acc_cres[%5d,%2d]: %5d%s in %s:%d\n",
-                        (vxi?vxi->vx_id:-1), res,
-                        (vxi?atomic_read(&vxi->limit.rcur[res]):0),
-			(dir>0)?"++":"--", file, line);
                 if (dir > 0)
                         atomic_inc(&vxi->limit.rcur[res]);
                 else
@@ -44,14 +31,18 @@ static inline void __vx_acc_cres(struct vx_info *vxi,
         }
 }
 
-#define vx_nproc_inc(p)	vx_acc_cres(current->vx_info, 1, RLIMIT_NPROC)
-#define vx_nproc_dec(p)	vx_acc_cres(current->vx_info,-1, RLIMIT_NPROC)
+#define vx_acc_cres(v,d,p,r) \
+	__vx_acc_cres((v), (r), (d), (p), __FILE__, __LINE__)
 
-#define vx_files_inc(f)	vx_acc_cres(current->vx_info, 1, RLIMIT_NOFILE)
-#define vx_files_dec(f)	vx_acc_cres(current->vx_info,-1, RLIMIT_NOFILE)
+#define vx_nproc_inc(p)	\
+	vx_acc_cres(current->vx_info, 1, (p), RLIMIT_NPROC)
+#define vx_nproc_dec(p)	\
+	vx_acc_cres(current->vx_info,-1, (p), RLIMIT_NPROC)
 
-#define vx_openfd_inc(f) vx_acc_cres(current->vx_info, 1, RLIMIT_OPENFD)
-#define vx_openfd_dec(f) vx_acc_cres(current->vx_info,-1, RLIMIT_OPENFD)
+#define vx_files_inc(f)	\
+	vx_acc_cres(current->vx_info, 1, (f), RLIMIT_NOFILE)
+#define vx_files_dec(f)	\
+	vx_acc_cres(current->vx_info,-1, (f), RLIMIT_NOFILE)
 
 /*
 #define vx_openfd_inc(f) do {					\
@@ -71,17 +62,18 @@ static inline void __vx_acc_cres(struct vx_info *vxi,
         __vx_cres_avail((v), (r), (n), __FILE__, __LINE__)
 
 static inline int __vx_cres_avail(struct vx_info *vxi,
-                int res, int num, char *file, int line)
+                int res, int num, char *_file, int _line)
 {
 	unsigned long value;
 
-	if ((res == RLIMIT_NOFILE && VX_DEBUG_ACC_FILE) ||
-		(res == RLIMIT_OPENFD && VX_DEBUG_ACC_OPENFD))
-                printk("vx_cres_avail[%5d,%2d]: %5ld > %5d + %5d in %s:%d\n",
-                        (vxi?vxi->vx_id:-1), res,
+	if (VXD_RLIMIT(res, RLIMIT_NOFILE) ||
+		VXD_RLIMIT(res, RLIMIT_NPROC) ||
+		VXD_RLIMIT(res, VLIMIT_NSOCK))
+		vxlprintk(1, "vx_cres_avail[%5d,%s,%2d]: %5ld > %5d + %5d",
+                        (vxi?vxi->vx_id:-1), vlimit_name[res], res,
 			(vxi?vxi->limit.rlim[res]:1),
                         (vxi?atomic_read(&vxi->limit.rcur[res]):0),
-			num, file, line);
+			num, _file, _line);
         if (!vxi)
                 return 1;
 	value = atomic_read(&vxi->limit.rcur[res]);	
@@ -101,18 +93,16 @@ static inline int __vx_cres_avail(struct vx_info *vxi,
 #define vx_files_avail(n) \
 	vx_cres_avail(current->vx_info, (n), RLIMIT_NOFILE)
 
-#define vx_openfd_avail(n) \
-	vx_cres_avail(current->vx_info, (n), RLIMIT_OPENFD)
-
 
 /* socket limits */
 
-#define vx_sock_inc(f)	vx_acc_cres(current->vx_info, 1, VLIMIT_SOCK)
-#define vx_sock_dec(f)	vx_acc_cres(current->vx_info,-1, VLIMIT_SOCK)
+#define vx_sock_inc(s) \
+	vx_acc_cres((s)->sk_vx_info, 1, (s), VLIMIT_NSOCK)
+#define vx_sock_dec(s) \
+	vx_acc_cres((s)->sk_vx_info,-1, (s), VLIMIT_NSOCK)
 
 #define vx_sock_avail(n) \
-	vx_cres_avail(current->vx_info, (n), VLIMIT_SOCK)
-
+	vx_cres_avail(current->vx_info, (n), VLIMIT_NSOCK)
 
 #else
 #warning duplicate inclusion
diff --git a/include/linux/vs_memory.h b/include/linux/vs_memory.h
index 2fe9c0809..3bcfefd49 100644
--- a/include/linux/vs_memory.h
+++ b/include/linux/vs_memory.h
@@ -1,33 +1,28 @@
 #ifndef _VX_VS_MEMORY_H
 #define _VX_VS_MEMORY_H
 
-
-// #define VX_DEBUG
-
 #include <linux/kernel.h>
 #include <linux/rcupdate.h>
 #include <linux/sched.h>
 
 #include "vserver/context.h"
 #include "vserver/limit.h"
+#include "vserver/debug.h"
 
 
-#define VX_DEBUG_ACC_RSS   0
-#define VX_DEBUG_ACC_VM    0
-#define VX_DEBUG_ACC_VML   0
-
-#if	(VX_DEBUG_ACC_RSS) || (VX_DEBUG_ACC_VM) || (VX_DEBUG_ACC_VML)
-#define vxdprintk(x...) printk("vxd: " x)
-#else
-#define vxdprintk(x...)
-#endif
-
 #define vx_acc_page(m, d, v, r) \
 	__vx_acc_page(&(m->v), m->mm_vx_info, r, d, __FILE__, __LINE__)
 
 static inline void __vx_acc_page(unsigned long *v, struct vx_info *vxi,
                 int res, int dir, char *file, int line)
 {
+	if (VXD_RLIMIT(res, RLIMIT_RSS) ||
+		VXD_RLIMIT(res, RLIMIT_AS) ||
+		VXD_RLIMIT(res, RLIMIT_MEMLOCK))
+		vxlprintk(1, "vx_acc_page[%5d,%s,%2d]: %5d%s",
+			(vxi?vxi->vx_id:-1), vlimit_name[res], res,
+			(vxi?atomic_read(&vxi->limit.rcur[res]):0),
+			(dir?"++":"--"), file, line);
         if (v) {
                 if (dir > 0)
                         ++(*v);
@@ -47,15 +42,15 @@ static inline void __vx_acc_page(unsigned long *v, struct vx_info *vxi,
 	__vx_acc_pages(&(m->v), m->mm_vx_info, r, p, __FILE__, __LINE__)
 
 static inline void __vx_acc_pages(unsigned long *v, struct vx_info *vxi,
-                int res, int pages, char *file, int line)
+                int res, int pages, char *_file, int _line)
 {
-        if ((res == RLIMIT_RSS && VX_DEBUG_ACC_RSS) ||
-		(res == RLIMIT_AS && VX_DEBUG_ACC_VM) ||
-		(res == RLIMIT_MEMLOCK && VX_DEBUG_ACC_VML))
-		vxdprintk("vx_acc_pages  [%5d,%2d]: %5d += %5d in %s:%d\n",
-			(vxi?vxi->vx_id:-1), res,
-			(vxi?atomic_read(&vxi->limit.res[res]):0),
-			pages, file, line);
+	if (VXD_RLIMIT(res, RLIMIT_RSS) ||
+		VXD_RLIMIT(res, RLIMIT_AS) ||
+		VXD_RLIMIT(res, RLIMIT_MEMLOCK))
+		vxlprintk(1, "vx_acc_pages[%5d,%s,%2d]: %5d += %5d",
+			(vxi?vxi->vx_id:-1), vlimit_name[res], res,
+			(vxi?atomic_read(&vxi->limit.rcur[res]):0),
+			pages, _file, _line);
         if (pages == 0)
                 return;
         if (v)
@@ -75,7 +70,7 @@ static inline void __vx_acc_pages(unsigned long *v, struct vx_info *vxi,
 #define vx_acc_rsspages(m,p)   vx_acc_pages(m, p, rss,       RLIMIT_RSS)
 
 #define vx_pages_add(s,r,p)    __vx_acc_pages(0, s, r, p, __FILE__, __LINE__)
-#define vx_pages_sub(s,r,p)    __vx_pages_add(s, r, -(p))
+#define vx_pages_sub(s,r,p)    vx_pages_add(s, r, -(p))
 
 #define vx_vmpages_inc(m)      vx_acc_vmpage(m, 1)
 #define vx_vmpages_dec(m)      vx_acc_vmpage(m,-1)
@@ -98,18 +93,18 @@ static inline void __vx_acc_pages(unsigned long *v, struct vx_info *vxi,
         __vx_pages_avail((m)->mm_vx_info, (r), (p), __FILE__, __LINE__)
 
 static inline int __vx_pages_avail(struct vx_info *vxi,
-                int res, int pages, char *file, int line)
+                int res, int pages, char *_file, int _line)
 {
 	unsigned long value;
 
-        if ((res == RLIMIT_RSS && VX_DEBUG_ACC_RSS) ||
-                (res == RLIMIT_AS && VX_DEBUG_ACC_VM) ||
-                (res == RLIMIT_MEMLOCK && VX_DEBUG_ACC_VML))
-                printk("vx_pages_avail[%5d,%2d]: %5ld > %5d + %5d in %s:%d\n",
-                        (vxi?vxi->vx_id:-1), res,
+	if (VXD_RLIMIT(res, RLIMIT_RSS) ||
+		VXD_RLIMIT(res, RLIMIT_AS) ||
+		VXD_RLIMIT(res, RLIMIT_MEMLOCK))
+		vxlprintk(1, "vx_pages_avail[%5d,%s,%2d]: %5ld > %5d + %5d",
+                        (vxi?vxi->vx_id:-1), vlimit_name[res], res,
 			(vxi?vxi->limit.rlim[res]:1),
                         (vxi?atomic_read(&vxi->limit.rcur[res]):0),
-			pages, file, line);
+			pages, _file, _line);
         if (!vxi)
                 return 1;
 	value = atomic_read(&vxi->limit.rcur[res]);	
diff --git a/include/linux/vs_network.h b/include/linux/vs_network.h
index 0a3349c09..915ad174f 100644
--- a/include/linux/vs_network.h
+++ b/include/linux/vs_network.h
@@ -1,20 +1,12 @@
 #ifndef _NX_VS_NETWORK_H
 #define _NX_VS_NETWORK_H
 
-
-// #define NX_DEBUG
-
 #include <linux/kernel.h>
 #include <linux/rcupdate.h>
 #include <linux/sched.h>
 
 #include "vserver/network.h"
-
-#if defined(NX_DEBUG)
-#define nxdprintk(x...) printk("nxd: " x)
-#else
-#define nxdprintk(x...)
-#endif
+#include "vserver/debug.h"
 
 
 extern int proc_pid_nx_info(struct task_struct *, char *);
@@ -27,7 +19,7 @@ static inline struct nx_info *__get_nx_info(struct nx_info *nxi,
 {
 	if (!nxi)
 		return NULL;
-	nxdprintk("get_nx_info(%p[#%d.%d])\t%s:%d\n",
+	vxlprintk(VXD_CBIT(nid, 2), "get_nx_info(%p[#%d.%d])",
 		nxi, nxi?nxi->nx_id:0, nxi?atomic_read(&nxi->nx_usecnt):0,
 		_file, _line);
 	atomic_inc(&nxi->nx_usecnt);
@@ -35,8 +27,8 @@ static inline struct nx_info *__get_nx_info(struct nx_info *nxi,
 }
 
 
-#define	free_nx_info(nxi)	\
-	call_rcu(&nxi->nx_rcu, rcu_free_nx_info, nxi);
+#define	free_nx_info(i)	\
+	call_rcu(&i->nx_rcu, rcu_free_nx_info);
 
 #define put_nx_info(i)	__put_nx_info(i,__FILE__,__LINE__)
 
@@ -44,7 +36,7 @@ static inline void __put_nx_info(struct nx_info *nxi, const char *_file, int _li
 {
 	if (!nxi)
 		return;
-	nxdprintk("put_nx_info(%p[#%d.%d])\t%s:%d\n",
+	vxlprintk(VXD_CBIT(nid, 2), "put_nx_info(%p[#%d.%d])",
 		nxi, nxi?nxi->nx_id:0, nxi?atomic_read(&nxi->nx_usecnt):0,
 		_file, _line);
 	if (atomic_dec_and_test(&nxi->nx_usecnt))
@@ -60,7 +52,7 @@ static inline void __set_nx_info(struct nx_info **nxp, struct nx_info *nxi,
 	BUG_ON(*nxp);
 	if (!nxi)
 		return;
-	nxdprintk("set_nx_info(%p[#%d.%d.%d])\t%s:%d\n",
+	vxlprintk(VXD_CBIT(nid, 3), "set_nx_info(%p[#%d.%d.%d])",
 		nxi, nxi?nxi->nx_id:0,
 		nxi?atomic_read(&nxi->nx_usecnt):0,
 		nxi?atomic_read(&nxi->nx_refcnt):0,
@@ -78,7 +70,7 @@ static inline void __clr_nx_info(struct nx_info **nxp,
 
 	if (!nxo)
 		return;
-	nxdprintk("clr_nx_info(%p[#%d.%d.%d])\t%s:%d\n",
+	vxlprintk(VXD_CBIT(nid, 3), "clr_nx_info(%p[#%d.%d.%d])",
 		nxo, nxo?nxo->nx_id:0,
 		nxo?atomic_read(&nxo->nx_usecnt):0,
 		nxo?atomic_read(&nxo->nx_refcnt):0,
@@ -100,6 +92,8 @@ static __inline__ struct nx_info *__task_get_nx_info(struct task_struct *p,
 	
 	task_lock(p);
 	nxi = __get_nx_info(p->nx_info, _file, _line);
+	vxlprintk(VXD_CBIT(nid, 5), "task_get_nx_info(%p)",
+		p, _file, _line);
 	task_unlock(p);
 	return nxi;
 }
@@ -126,9 +120,6 @@ static __inline__ void __nx_verify_info(
 
 #define nx_weak_check(c,m)	((m) ? nx_check(c,m) : 1)
 
-#undef nxdprintk
-#define nxdprintk(x...)
-
 
 #define __nx_flags(v,m,f)	(((v) & (m)) ^ (f))
 
diff --git a/include/linux/vs_socket.h b/include/linux/vs_socket.h
index 499245822..560f2eb9b 100644
--- a/include/linux/vs_socket.h
+++ b/include/linux/vs_socket.h
@@ -1,5 +1,5 @@
-#ifndef _VX_VS_LIMIT_H
-#define _VX_VS_LIMIT_H
+#ifndef _VX_VS_SOCKET_H
+#define _VX_VS_SOCKET_H
 
 
 // #define VX_DEBUG
@@ -10,6 +10,7 @@
 
 #include "vserver/context.h"
 #include "vserver/network.h"
+#include "vserver/debug.h"
 
 
 /* socket accounting */
diff --git a/include/linux/vserver/context.h b/include/linux/vserver/context.h
index 7bc7f9373..434bfbaa2 100644
--- a/include/linux/vserver/context.h
+++ b/include/linux/vserver/context.h
@@ -62,7 +62,9 @@ struct vx_info {
 #define VX_ATR_MASK	0x0F00
 
 
-extern void rcu_free_vx_info(void *);
+struct rcu_head;
+
+extern void rcu_free_vx_info(struct rcu_head *);
 extern void unhash_vx_info(struct vx_info *);
 
 extern struct vx_info *locate_vx_info(int);
diff --git a/include/linux/vserver/cvirt.h b/include/linux/vserver/cvirt.h
index ba3a25356..7beeaaa7b 100644
--- a/include/linux/vserver/cvirt.h
+++ b/include/linux/vserver/cvirt.h
@@ -1,3 +1,5 @@
+/* _VX_CVIRT_H defined below */
+
 #if	defined(__KERNEL__) && defined(_VX_INFO_DEF_)
 
 #include <linux/utsname.h>
@@ -11,9 +13,7 @@
 struct _vx_cvirt {
 	int max_threads;
 
-	unsigned int bias_cswtch;
 	struct timespec bias_idle;
-	struct timespec bias_tp;
 	uint64_t bias_jiffies;
 
 	struct new_utsname utsname;
@@ -52,11 +52,8 @@ static inline void vx_info_init_cvirt(struct _vx_cvirt *cvirt)
 {
 	uint64_t idle_jiffies = vx_idle_jiffies();
 
-	// new->virt.bias_cswtch = kstat.context_swtch;
 	cvirt->bias_jiffies = get_jiffies_64();
-
 	jiffies_to_timespec(idle_jiffies, &cvirt->bias_idle);
-	do_posix_clock_monotonic_gettime(&cvirt->bias_tp);
 
 	down_read(&uts_sem);
 	cvirt->utsname = system_utsname;
@@ -89,6 +86,22 @@ static inline void vx_info_exit_cacct(struct _vx_cacct *cacct)
 static inline int vx_info_proc_cvirt(struct _vx_cvirt *cvirt, char *buffer)
 {
 	int length = 0;
+	length += sprintf(buffer + length,
+		"BiasJiffies:\t%lld\n", (long long int)cvirt->bias_jiffies);
+	length += sprintf(buffer + length,
+		"SysName:\t%.*s\n"
+		"NodeName:\t%.*s\n"
+		"Release:\t%.*s\n"
+		"Version:\t%.*s\n"
+		"Machine:\t%.*s\n"
+		"DomainName:\t%.*s\n"
+		,__NEW_UTS_LEN, cvirt->utsname.sysname
+		,__NEW_UTS_LEN, cvirt->utsname.nodename
+		,__NEW_UTS_LEN, cvirt->utsname.release
+		,__NEW_UTS_LEN, cvirt->utsname.version
+		,__NEW_UTS_LEN, cvirt->utsname.machine
+		,__NEW_UTS_LEN, cvirt->utsname.domainname
+		);
 	return length;
 }
 
diff --git a/include/linux/vserver/dlimit.h b/include/linux/vserver/dlimit.h
index 74872ed74..c0cfafcd9 100644
--- a/include/linux/vserver/dlimit.h
+++ b/include/linux/vserver/dlimit.h
@@ -57,7 +57,9 @@ struct dl_info {
 	unsigned int dl_nrlmult;		/* non root limit mult */
 };
 
-extern void rcu_free_dl_info(void *);
+struct rcu_head;
+
+extern void rcu_free_dl_info(struct rcu_head *);
 extern void unhash_dl_info(struct dl_info *);
 
 extern struct dl_info *locate_dl_info(struct super_block *, xid_t);
diff --git a/include/linux/vserver/inode.h b/include/linux/vserver/inode.h
index aa8852f43..fc49aba6d 100644
--- a/include/linux/vserver/inode.h
+++ b/include/linux/vserver/inode.h
@@ -39,7 +39,7 @@ struct  vcmd_ctx_iattr_v1 {
 #define IATTR_IMMUTABLE	0x00040000
 
 
-#ifdef	CONFIG_PROC_SECURE
+#ifdef	CONFIG_VSERVER_PROC_SECURE
 #define IATTR_PROC_DEFAULT	( IATTR_ADMIN | IATTR_HIDE )
 #define IATTR_PROC_SYMLINK	( IATTR_ADMIN )
 #else
diff --git a/include/linux/vserver/limit.h b/include/linux/vserver/limit.h
index a7a50f972..ef9c9fc2d 100644
--- a/include/linux/vserver/limit.h
+++ b/include/linux/vserver/limit.h
@@ -1,3 +1,5 @@
+/* _VX_LIMIT_H defined below */
+
 #if	defined(__KERNEL__) && defined(_VX_INFO_DEF_)
 
 #include <asm/atomic.h>
@@ -5,27 +7,26 @@
 
 /* context sub struct */
 
-#define	RLIMIT_OPENFD	12
-
-#define NUM_RLIMITS	16
+#define NUM_LIMITS	20
 
-#define VLIMIT_SOCK	16
+#define VLIMIT_NSOCK	16
 
+extern const char *vlimit_name[NUM_LIMITS];
 
 struct _vx_limit {
 	atomic_t ticks;
 
-	unsigned long rlim[NUM_RLIMITS];	/* Context limit */
-	unsigned long rmax[NUM_RLIMITS];	/* Context maximum */
-	atomic_t rcur[NUM_RLIMITS];		/* Current value */
-	atomic_t lhit[NUM_RLIMITS];		/* Limit hits */
+	unsigned long rlim[NUM_LIMITS];		/* Context limit */
+	unsigned long rmax[NUM_LIMITS];		/* Context maximum */
+	atomic_t rcur[NUM_LIMITS];		/* Current value */
+	atomic_t lhit[NUM_LIMITS];		/* Limit hits */
 };
 
 static inline void vx_info_init_limit(struct _vx_limit *limit)
 {
 	int lim;
 
-	for (lim=0; lim<NUM_RLIMITS; lim++) {
+	for (lim=0; lim<NUM_LIMITS; lim++) {
 		limit->rlim[lim] = RLIM_INFINITY;
 		limit->rmax[lim] = 0;
 		atomic_set(&limit->rcur[lim], 0);
@@ -33,21 +34,19 @@ static inline void vx_info_init_limit(struct _vx_limit *limit)
 	}
 }
 
-extern unsigned int vx_debug_limit;
-
 static inline void vx_info_exit_limit(struct _vx_limit *limit)
 {
+#ifdef	CONFIG_VSERVER_DEBUG
 	unsigned long value;
 	unsigned int lim;
 
-	if (!vx_debug_limit)
-		return;
-	for (lim=0; lim<NUM_RLIMITS; lim++) {
+	for (lim=0; lim<NUM_LIMITS; lim++) {
 		value = atomic_read(&limit->rcur[lim]);
 		if (value)
-			printk("!!! limit: %p[%d] = %ld on exit.\n",
-				limit, lim, value);
+			printk("!!! limit: %p[%s,%d] = %ld on exit.\n",
+				limit, vlimit_name[lim], lim, value);
 	}
+#endif
 }
 
 static inline void vx_limit_fixup(struct _vx_limit *limit)
@@ -55,7 +54,7 @@ static inline void vx_limit_fixup(struct _vx_limit *limit)
 	unsigned long value;
 	unsigned int lim;
 	
-        for (lim=0; lim<NUM_RLIMITS; lim++) {
+        for (lim=0; lim<NUM_LIMITS; lim++) {
                 value = atomic_read(&limit->rcur[lim]);
                 if (value > limit->rmax[lim])
 			limit->rmax[lim] = value;
@@ -81,13 +80,13 @@ static inline int vx_info_proc_limit(struct _vx_limit *limit, char *buffer)
 		"VML"	VX_LIMIT_FMT
 		"RSS"	VX_LIMIT_FMT
 		"FILES"	VX_LIMIT_FMT
-		"OFD"	VX_LIMIT_FMT
+		"SOCK"	VX_LIMIT_FMT
 		VX_LIMIT_ARG(RLIMIT_NPROC)
 		VX_LIMIT_ARG(RLIMIT_AS)
 		VX_LIMIT_ARG(RLIMIT_MEMLOCK)
 		VX_LIMIT_ARG(RLIMIT_RSS)
 		VX_LIMIT_ARG(RLIMIT_NOFILE)
-		VX_LIMIT_ARG(RLIMIT_OPENFD)
+		VX_LIMIT_ARG(VLIMIT_NSOCK)
 		);
 }
 
@@ -97,6 +96,8 @@ static inline int vx_info_proc_limit(struct _vx_limit *limit, char *buffer)
 
 #include "switch.h"
 
+#define	VXD_RLIMIT(r,l)		(VXD_CBIT(limit, (l)) && ((r) == (l)))
+
 /*  rlimit vserver commands */
 
 #define VCMD_get_rlimit		VC_CMD(RLIMIT, 1, 0)
@@ -138,3 +139,5 @@ void vx_vsi_swapinfo(struct sysinfo *);
 
 #endif	/* _VX_LIMIT_H */
 #endif
+
+
diff --git a/include/linux/vserver/network.h b/include/linux/vserver/network.h
index 086f566c4..a89265d3d 100644
--- a/include/linux/vserver/network.h
+++ b/include/linux/vserver/network.h
@@ -41,7 +41,9 @@ struct nx_info {
 };
 
 
-extern void rcu_free_nx_info(void *);
+struct rcu_head;
+
+extern void rcu_free_nx_info(struct rcu_head *);
 extern void unhash_nx_info(struct nx_info *);
 
 extern struct nx_info *locate_nx_info(int);
diff --git a/include/linux/vserver/sched.h b/include/linux/vserver/sched.h
index 0f4469383..fd6bc2af3 100644
--- a/include/linux/vserver/sched.h
+++ b/include/linux/vserver/sched.h
@@ -1,10 +1,12 @@
+/* _VX_SCHED_H defined below */
+
 #if	defined(__KERNEL__) && defined(_VX_INFO_DEF_)
 
 #include <linux/spinlock.h>
 #include <linux/jiffies.h>
+#include <linux/cpumask.h>
 #include <asm/atomic.h>
 #include <asm/param.h>
-#include <asm/cpumask.h>
 
 /* context sub struct */
 
diff --git a/include/linux/vserver/switch.h b/include/linux/vserver/switch.h
index 0e4c62dae..2aecbafd3 100644
--- a/include/linux/vserver/switch.h
+++ b/include/linux/vserver/switch.h
@@ -75,7 +75,7 @@
 	
 /*  interface version */
 
-#define VCI_VERSION		0x00010016
+#define VCI_VERSION		0x00010020
 
 
 /*  query version */
diff --git a/include/linux/vserver/xid.h b/include/linux/vserver/xid.h
index ba52c2588..3472defa5 100644
--- a/include/linux/vserver/xid.h
+++ b/include/linux/vserver/xid.h
@@ -1,15 +1,21 @@
-#ifndef _LINUX_XID_H_
-#define _LINUX_XID_H_
+#ifndef _VX_XID_H
+#define _VX_XID_H
+
+
+#define	XID_TAG(in)	(!(in) || \
+	(((struct inode *)in)->i_sb && \
+	(((struct inode *)in)->i_sb->s_flags & MS_TAGXID)))
+
 
 #ifdef CONFIG_INOXID_NONE
 
 #define MAX_UID		0xFFFFFFFF
 #define MAX_GID		0xFFFFFFFF
 
-#define INOXID_XID(uid, gid, xid)	(0)
+#define INOXID_XID(tag, uid, gid, xid)	(0)
 
-#define XIDINO_UID(uid, xid)		(uid)
-#define XIDINO_GID(gid, xid)		(gid)
+#define XIDINO_UID(tag, uid, xid)	(uid)
+#define XIDINO_GID(tag, gid, xid)	(gid)
 
 #endif
 
@@ -19,37 +25,57 @@
 #define MAX_UID		0xFFFFFFFF
 #define MAX_GID		0x0000FFFF
 
-#define INOXID_XID(uid, gid, xid)	(((gid) >> 16) & 0xFFFF)
-
-#define XIDINO_UID(uid, xid)		(uid)
-#define XIDINO_GID(gid, xid)		(((gid) & 0xFFFF) | ((xid) << 16))
+#define INOXID_XID(tag, uid, gid, xid)	\
+	((tag) ? (((gid) >> 16) & 0xFFFF) : 0)
 
+#define XIDINO_UID(tag, uid, xid)	(uid)
+#define XIDINO_GID(tag, gid, xid)	\
+	((tag) ? (((gid) & 0xFFFF) | ((xid) << 16)) : (gid))
 
 #endif
 
 
-#ifdef CONFIG_INOXID_GID24
+#ifdef CONFIG_INOXID_UGID24
 
 #define MAX_UID		0x00FFFFFF
 #define MAX_GID		0x00FFFFFF
 
-#define INOXID_XID(uid, gid, xid)	((((uid) >> 16) & 0xFF00) | (((gid) >> 24) & 0xFF))
+#define INOXID_XID(tag, uid, gid, xid)	\
+	((tag) ? ((((uid) >> 16) & 0xFF00) | (((gid) >> 24) & 0xFF)) : 0)
 
-#define XIDINO_UID(uid, xid)		(((uid) & 0xFFFFFF) | (((xid) & 0xFF00) << 16))
-#define XIDINO_GID(gid, xid)		(((gid) & 0xFFFFFF) | (((xid) & 0x00FF) << 24))
+#define XIDINO_UID(tag, uid, xid)	\
+	((tag) ? (((uid) & 0xFFFFFF) | (((xid) & 0xFF00) << 16)) : (uid))
+#define XIDINO_GID(tag, gid, xid)	\
+	((tag) ? (((gid) & 0xFFFFFF) | (((xid) & 0x00FF) << 24)) : (gid))
 
 #endif
 
 
-#ifdef CONFIG_INOXID_GID32
+#ifdef CONFIG_INOXID_UID16
+
+#define MAX_UID		0x0000FFFF
+#define MAX_GID		0xFFFFFFFF
+
+#define INOXID_XID(tag, uid, gid, xid)	\
+	((tag) ? ((uid) >> 16) & 0xFFFF) : 0)
+
+#define XIDINO_UID(tag, uid, xid)	\
+	((tag) ? (((uid) & 0xFFFF) | ((xid) << 16)) : (uid))
+#define XIDINO_GID(tag, gid, xid)	(gid)
+
+#endif
+
+
+#ifdef CONFIG_INOXID_INTERN
 
 #define MAX_UID		0xFFFFFFFF
 #define MAX_GID		0xFFFFFFFF
 
-#define INOXID_XID(uid, gid, xid)	(xid)
+#define INOXID_XID(tag, uid, gid, xid)	\
+	((tag) ? (xid) : 0)
 
-#define XIDINO_UID(uid, xid)		(uid)
-#define XIDINO_GID(gid, xid)		(gid)
+#define XIDINO_UID(tag, uid, xid)	(uid)
+#define XIDINO_GID(tag, gid, xid)	(gid)
 
 #endif
 
@@ -59,16 +85,19 @@
 #define MAX_UID		0xFFFFFFFF
 #define MAX_GID		0xFFFFFFFF
 
-#define INOXID_XID(uid, gid, xid)	(0)
+#define INOXID_XID(tag, uid, gid, xid)	(0)
 
-#define XIDINO_UID(uid, xid)		(uid)
-#define XIDINO_GID(gid, xid)		(gid)
+#define XIDINO_UID(tag, uid, xid)	(uid)
+#define XIDINO_GID(tag, gid, xid)	(gid)
 
 #endif
 
 
-#define INOXID_UID(uid, gid)		((uid) & MAX_UID)
-#define INOXID_GID(uid, gid)		((gid) & MAX_GID)
+#define INOXID_UID(tag, uid, gid)	\
+	((tag) ? ((uid) & MAX_UID) : (uid))
+#define INOXID_GID(tag, uid, gid)	\
+	((tag) ? ((gid) & MAX_GID) : (gid))
+
 
 static inline uid_t vx_map_uid(uid_t uid)
 {
@@ -91,4 +120,4 @@ static inline gid_t vx_map_gid(gid_t gid)
 #define FIOC_SETXIDJ	_IOW('x', 3, long)
 #endif
 
-#endif /* _LINUX_XID_H_ */
+#endif /* _VX_XID_H */
diff --git a/include/linux/vt_kern.h b/include/linux/vt_kern.h
index c310bcadc..383a93cbb 100644
--- a/include/linux/vt_kern.h
+++ b/include/linux/vt_kern.h
@@ -11,6 +11,7 @@
 #include <linux/kd.h>
 #include <linux/tty.h>
 #include <linux/console_struct.h>
+#include <linux/mm.h>
 
 /*
  * Presently, a lot of graphics programs do not restore the contents of
@@ -49,6 +50,10 @@ void do_unblank_screen(int leaving_gfx);
 void unblank_screen(void);
 void poke_blanked_console(void);
 int con_font_op(int currcons, struct console_font_op *op);
+int con_font_set(int currcons, struct console_font_op *op);
+int con_font_get(int currcons, struct console_font_op *op);
+int con_font_default(int currcons, struct console_font_op *op);
+int con_font_copy(int currcons, struct console_font_op *op);
 int con_set_cmap(unsigned char __user *cmap);
 int con_get_cmap(unsigned char __user *cmap);
 void scrollback(int);
@@ -84,4 +89,12 @@ int vt_waitactive(int vt);
 void change_console(unsigned int);
 void reset_vc(unsigned int new_console);
 
+/*
+ * vc_screen.c shares this temporary buffer with the console write code so that
+ * we can easily avoid touching user space while holding the console spinlock.
+ */
+extern char con_buf[PAGE_SIZE];
+#define CON_BUF_SIZE	PAGE_SIZE
+extern struct semaphore con_buf_sem;
+
 #endif /* _VT_KERN_H */
diff --git a/include/linux/wait.h b/include/linux/wait.h
index 52edb1786..e0f2b2ffc 100644
--- a/include/linux/wait.h
+++ b/include/linux/wait.h
@@ -120,18 +120,15 @@ extern void FASTCALL(__wake_up_sync(wait_queue_head_t *q, unsigned int mode, int
 
 #define __wait_event(wq, condition) 					\
 do {									\
-	wait_queue_t __wait;						\
-	init_waitqueue_entry(&__wait, current);				\
+	DEFINE_WAIT(__wait);						\
 									\
-	add_wait_queue(&wq, &__wait);					\
 	for (;;) {							\
-		set_current_state(TASK_UNINTERRUPTIBLE);		\
+		prepare_to_wait(&wq, &__wait, TASK_UNINTERRUPTIBLE);	\
 		if (condition)						\
 			break;						\
 		schedule();						\
 	}								\
-	current->state = TASK_RUNNING;					\
-	remove_wait_queue(&wq, &__wait);				\
+	finish_wait(&wq, &__wait);					\
 } while (0)
 
 #define wait_event(wq, condition) 					\
@@ -143,12 +140,10 @@ do {									\
 
 #define __wait_event_interruptible(wq, condition, ret)			\
 do {									\
-	wait_queue_t __wait;						\
-	init_waitqueue_entry(&__wait, current);				\
+	DEFINE_WAIT(__wait);						\
 									\
-	add_wait_queue(&wq, &__wait);					\
 	for (;;) {							\
-		set_current_state(TASK_INTERRUPTIBLE);			\
+		prepare_to_wait(&wq, &__wait, TASK_INTERRUPTIBLE);	\
 		if (condition)						\
 			break;						\
 		if (!signal_pending(current)) {				\
@@ -158,8 +153,7 @@ do {									\
 		ret = -ERESTARTSYS;					\
 		break;							\
 	}								\
-	current->state = TASK_RUNNING;					\
-	remove_wait_queue(&wq, &__wait);				\
+	finish_wait(&wq, &__wait);					\
 } while (0)
 
 #define wait_event_interruptible(wq, condition)				\
@@ -172,12 +166,10 @@ do {									\
 
 #define __wait_event_interruptible_timeout(wq, condition, ret)		\
 do {									\
-	wait_queue_t __wait;						\
-	init_waitqueue_entry(&__wait, current);				\
+	DEFINE_WAIT(__wait);						\
 									\
-	add_wait_queue(&wq, &__wait);					\
 	for (;;) {							\
-		set_current_state(TASK_INTERRUPTIBLE);			\
+		prepare_to_wait(&wq, &__wait, TASK_INTERRUPTIBLE);	\
 		if (condition)						\
 			break;						\
 		if (!signal_pending(current)) {				\
@@ -189,8 +181,7 @@ do {									\
 		ret = -ERESTARTSYS;					\
 		break;							\
 	}								\
-	current->state = TASK_RUNNING;					\
-	remove_wait_queue(&wq, &__wait);				\
+	finish_wait(&wq, &__wait);					\
 } while (0)
 
 #define wait_event_interruptible_timeout(wq, condition, timeout)	\
@@ -200,7 +191,34 @@ do {									\
 		__wait_event_interruptible_timeout(wq, condition, __ret); \
 	__ret;								\
 })
-	
+
+#define __wait_event_interruptible_exclusive(wq, condition, ret)	\
+do {									\
+	DEFINE_WAIT(__wait);						\
+									\
+	for (;;) {							\
+		prepare_to_wait_exclusive(&wq, &__wait,			\
+					TASK_INTERRUPTIBLE);		\
+		if (condition)						\
+			break;						\
+		if (!signal_pending(current)) {				\
+			schedule();					\
+			continue;					\
+		}							\
+		ret = -ERESTARTSYS;					\
+		break;							\
+	}								\
+	finish_wait(&wq, &__wait);					\
+} while (0)
+
+#define wait_event_interruptible_exclusive(wq, condition)		\
+({									\
+	int __ret = 0;							\
+	if (!(condition))						\
+		__wait_event_interruptible_exclusive(wq, condition, __ret);\
+	__ret;								\
+})
+
 /*
  * Must be called with the spinlock in the wait_queue_head_t held.
  */
diff --git a/include/linux/writeback.h b/include/linux/writeback.h
index f557b55e8..e4450070a 100644
--- a/include/linux/writeback.h
+++ b/include/linux/writeback.h
@@ -86,7 +86,7 @@ extern int laptop_mode;
 struct ctl_table;
 struct file;
 int dirty_writeback_centisecs_handler(struct ctl_table *, int, struct file *,
-				      void __user *, size_t *);
+				      void __user *, size_t *, loff_t *);
 
 void page_writeback_init(void);
 void balance_dirty_pages_ratelimited(struct address_space *mapping);
diff --git a/include/linux/xfrm.h b/include/linux/xfrm.h
index 5bd22740c..2e22a996f 100644
--- a/include/linux/xfrm.h
+++ b/include/linux/xfrm.h
@@ -103,26 +103,45 @@ enum
 };
 
 /* Netlink configuration messages.  */
-#define XFRM_MSG_BASE		0x10
-
-#define XFRM_MSG_NEWSA		(XFRM_MSG_BASE + 0)
-#define XFRM_MSG_DELSA		(XFRM_MSG_BASE + 1)
-#define XFRM_MSG_GETSA		(XFRM_MSG_BASE + 2)
-
-#define XFRM_MSG_NEWPOLICY	(XFRM_MSG_BASE + 3)
-#define XFRM_MSG_DELPOLICY	(XFRM_MSG_BASE + 4)
-#define XFRM_MSG_GETPOLICY	(XFRM_MSG_BASE + 5)
-
-#define XFRM_MSG_ALLOCSPI	(XFRM_MSG_BASE + 6)
-#define XFRM_MSG_ACQUIRE	(XFRM_MSG_BASE + 7)
-#define XFRM_MSG_EXPIRE		(XFRM_MSG_BASE + 8)
-
-#define XFRM_MSG_UPDPOLICY	(XFRM_MSG_BASE + 9)
-#define XFRM_MSG_UPDSA		(XFRM_MSG_BASE + 10)
-
-#define XFRM_MSG_POLEXPIRE	(XFRM_MSG_BASE + 11)
-
-#define XFRM_MSG_MAX		(XFRM_MSG_POLEXPIRE+1)
+enum {
+	XFRM_MSG_BASE = 0x10,
+
+	XFRM_MSG_NEWSA = 0x10,
+#define XFRM_MSG_NEWSA XFRM_MSG_NEWSA
+	XFRM_MSG_DELSA,
+#define XFRM_MSG_DELSA XFRM_MSG_DELSA
+	XFRM_MSG_GETSA,
+#define XFRM_MSG_GETSA XFRM_MSG_GETSA
+
+	XFRM_MSG_NEWPOLICY,
+#define XFRM_MSG_NEWPOLICY XFRM_MSG_NEWPOLICY
+	XFRM_MSG_DELPOLICY,
+#define XFRM_MSG_DELPOLICY XFRM_MSG_DELPOLICY
+	XFRM_MSG_GETPOLICY,
+#define XFRM_MSG_GETPOLICY XFRM_MSG_GETPOLICY
+
+	XFRM_MSG_ALLOCSPI,
+#define XFRM_MSG_ALLOCSPI XFRM_MSG_ALLOCSPI
+	XFRM_MSG_ACQUIRE,
+#define XFRM_MSG_ACQUIRE XFRM_MSG_ACQUIRE
+	XFRM_MSG_EXPIRE,
+#define XFRM_MSG_EXPIRE XFRM_MSG_EXPIRE
+
+	XFRM_MSG_UPDPOLICY,
+#define XFRM_MSG_UPDPOLICY XFRM_MSG_UPDPOLICY
+	XFRM_MSG_UPDSA,
+#define XFRM_MSG_UPDSA XFRM_MSG_UPDSA
+
+	XFRM_MSG_POLEXPIRE,
+#define XFRM_MSG_POLEXPIRE XFRM_MSG_POLEXPIRE
+
+	XFRM_MSG_FLUSHSA,
+#define XFRM_MSG_FLUSHSA XFRM_MSG_FLUSHSA
+	XFRM_MSG_FLUSHPOLICY,
+#define XFRM_MSG_FLUSHPOLICY XFRM_MSG_FLUSHPOLICY
+
+	XFRM_MSG_MAX
+};
 
 struct xfrm_user_tmpl {
 	struct xfrm_id		id;
@@ -228,6 +247,10 @@ struct xfrm_user_polexpire {
 	__u8				hard;
 };
 
+struct xfrm_usersa_flush {
+	__u8				proto;
+};
+
 #define XFRMGRP_ACQUIRE		1
 #define XFRMGRP_EXPIRE		2
 
diff --git a/include/media/ir-common.h b/include/media/ir-common.h
index 42206f88f..569f74839 100644
--- a/include/media/ir-common.h
+++ b/include/media/ir-common.h
@@ -27,7 +27,7 @@
 #define IR_TYPE_OTHER  99
 
 #define IR_KEYTAB_TYPE	u32
-#define IR_KEYTAB_SIZE	64  // enougth for rc5, probably need more some day ...
+#define IR_KEYTAB_SIZE	128  // enougth for rc5, probably need more some day ...
 
 #define IR_KEYCODE(tab,code)	(((unsigned)code < IR_KEYTAB_SIZE) \
 				 ? tab[code] : KEY_RESERVED)
diff --git a/include/media/saa7146_vv.h b/include/media/saa7146_vv.h
index 60cd29e52..de5672cde 100644
--- a/include/media/saa7146_vv.h
+++ b/include/media/saa7146_vv.h
@@ -184,7 +184,7 @@ struct saa7146_use_ops  {
         int(*open)(struct saa7146_dev *, struct file *);
         void (*release)(struct saa7146_dev *, struct file *);
         void (*irq_done)(struct saa7146_dev *, unsigned long status);
-	ssize_t (*read)(struct file *, char *, size_t, loff_t *);
+	ssize_t (*read)(struct file *, char __user *, size_t, loff_t *);
 };
 
 /* from saa7146_fops.c */
diff --git a/include/media/video-buf.h b/include/media/video-buf.h
index 41e9e58c4..3c17bdf0b 100644
--- a/include/media/video-buf.h
+++ b/include/media/video-buf.h
@@ -18,6 +18,8 @@
 
 #include <linux/videodev.h>
 
+#define UNSET (-1U)
+
 /* --------------------------------------------------------------------- */
 
 /*
@@ -34,8 +36,6 @@ struct scatterlist* videobuf_vmalloc_to_sg(unsigned char *virt, int nr_pages);
  */
 struct scatterlist* videobuf_pages_to_sg(struct page **pages, int nr_pages,
 					 int offset);
-int videobuf_lock(struct page **pages, int nr_pages);
-int videobuf_unlock(struct page **pages, int nr_pages);
 
 /* --------------------------------------------------------------------- */
 
@@ -59,6 +59,8 @@ int videobuf_unlock(struct page **pages, int nr_pages);
  */
 
 struct videobuf_dmabuf {
+	u32                 magic;
+
 	/* for userland buffer */
 	int                 offset;
 	struct page         **pages;
@@ -76,6 +78,7 @@ struct videobuf_dmabuf {
 	int                 direction;
 };
 
+void videobuf_dma_init(struct videobuf_dmabuf *dma);
 int videobuf_dma_init_user(struct videobuf_dmabuf *dma, int direction,
 			   unsigned long data, unsigned long size);
 int videobuf_dma_init_kernel(struct videobuf_dmabuf *dma, int direction,
@@ -134,12 +137,14 @@ enum videobuf_state {
 
 struct videobuf_buffer {
 	unsigned int            i;
+	u32                     magic;
 
 	/* info about the buffer */
 	unsigned int            width;
 	unsigned int            height;
 	unsigned int            bytesperline; /* use only if != 0 */
 	unsigned long           size;
+	unsigned int            input;
 	enum v4l2_field         field;
 	enum videobuf_state     state;
 	struct videobuf_dmabuf  dma;
@@ -174,9 +179,10 @@ struct videobuf_queue {
 	struct pci_dev             *pci;
 
 	enum v4l2_buf_type         type;
+	unsigned int               inputs; /* for V4L2_BUF_FLAG_INPUT */
 	unsigned int               msize;
 	enum v4l2_field            field;
-	enum v4l2_field            last; /* for field=V4L2_FIELD_ALTERNATE */
+	enum v4l2_field            last;   /* for field=V4L2_FIELD_ALTERNATE */
 	struct videobuf_buffer     *bufs[VIDEO_MAX_FRAME];
 	struct videobuf_queue_ops  *ops;
 
@@ -220,10 +226,10 @@ int videobuf_streamoff(struct file *file, struct videobuf_queue *q);
 int videobuf_read_start(struct file *file, struct videobuf_queue *q);
 void videobuf_read_stop(struct file *file, struct videobuf_queue *q);
 ssize_t videobuf_read_stream(struct file *file, struct videobuf_queue *q,
-			     char *data, size_t count, loff_t *ppos,
+			     char __user *data, size_t count, loff_t *ppos,
 			     int vbihack);
 ssize_t videobuf_read_one(struct file *file, struct videobuf_queue *q,
-			  char *data, size_t count, loff_t *ppos);
+			  char __user *data, size_t count, loff_t *ppos);
 unsigned int videobuf_poll_stream(struct file *file,
 				  struct videobuf_queue *q,
 				  poll_table *wait);
diff --git a/include/mtd/mtd-abi.h b/include/mtd/mtd-abi.h
index db5fca2fa..e872ad770 100644
--- a/include/mtd/mtd-abi.h
+++ b/include/mtd/mtd-abi.h
@@ -15,7 +15,7 @@ struct erase_info_user {
 struct mtd_oob_buf {
 	uint32_t start;
 	uint32_t length;
-	unsigned char *ptr;
+	unsigned char __user *ptr;
 };
 
 #define MTD_ABSENT		0
diff --git a/include/net/addrconf.h b/include/net/addrconf.h
index 4928cfdf1..fc2b279cd 100644
--- a/include/net/addrconf.h
+++ b/include/net/addrconf.h
@@ -160,8 +160,8 @@ static inline void in6_ifa_put(struct inet6_ifaddr *ifp)
 		inet6_ifa_finish_destroy(ifp);
 }
 
-#define __in6_ifa_put(idev)  atomic_dec(&(idev)->refcnt)
-#define in6_ifa_hold(idev)   atomic_inc(&(idev)->refcnt)
+#define __in6_ifa_put(ifp)	atomic_dec(&(ifp)->refcnt)
+#define in6_ifa_hold(ifp)	atomic_inc(&(ifp)->refcnt)
 
 
 extern void			addrconf_forwarding_on(void);
@@ -178,8 +178,8 @@ static __inline__ u8 ipv6_addr_hash(const struct in6_addr *addr)
 	 * This will include the IEEE address token on links that support it.
 	 */
 
-	word = addr->s6_addr[2] ^ addr->s6_addr32[3];
-	word  ^= (word>>16);
+	word = addr->s6_addr32[2] ^ addr->s6_addr32[3];
+	word ^= (word >> 16);
 	word ^= (word >> 8);
 
 	return ((word ^ (word >> 4)) & 0x0f);
diff --git a/include/net/bluetooth/bluetooth.h b/include/net/bluetooth/bluetooth.h
index 0106480b3..9c5436227 100644
--- a/include/net/bluetooth/bluetooth.h
+++ b/include/net/bluetooth/bluetooth.h
@@ -46,6 +46,7 @@
 #define BTPROTO_BNEP	4
 #define BTPROTO_CMTP	5
 #define BTPROTO_HIDP	6
+#define BTPROTO_AVDTP	7
 
 #define SOL_HCI		0
 #define SOL_L2CAP	6
diff --git a/include/net/bluetooth/hci.h b/include/net/bluetooth/hci.h
index 8bdea5773..06e19d370 100644
--- a/include/net/bluetooth/hci.h
+++ b/include/net/bluetooth/hci.h
@@ -432,7 +432,7 @@ struct inquiry_info_with_rssi {
 	__u8     pscan_period_mode;
 	__u8     dev_class[3];
 	__u16    clock_offset;
-	__u8     rssi;
+	__s8     rssi;
 } __attribute__ ((packed));
 
 #define HCI_EV_CONN_COMPLETE 	0x03
diff --git a/include/net/bluetooth/hci_core.h b/include/net/bluetooth/hci_core.h
index 830888147..63f73088b 100644
--- a/include/net/bluetooth/hci_core.h
+++ b/include/net/bluetooth/hci_core.h
@@ -195,10 +195,8 @@ static inline long inquiry_entry_age(struct inquiry_entry *e)
 	return jiffies - e->timestamp;
 }
 
-struct inquiry_entry *inquiry_cache_lookup(struct hci_dev *hdev, bdaddr_t *bdaddr);
-void inquiry_cache_update(struct hci_dev *hdev, struct inquiry_info *info);
-void inquiry_cache_flush(struct hci_dev *hdev);
-int  inquiry_cache_dump(struct hci_dev *hdev, int num, __u8 *buf);
+struct inquiry_entry *hci_inquiry_cache_lookup(struct hci_dev *hdev, bdaddr_t *bdaddr);
+void hci_inquiry_cache_update(struct hci_dev *hdev, struct inquiry_info *info);
 
 /* ----- HCI Connections ----- */
 enum {
diff --git a/include/net/bluetooth/l2cap.h b/include/net/bluetooth/l2cap.h
index d420305ff..bcbf4411b 100644
--- a/include/net/bluetooth/l2cap.h
+++ b/include/net/bluetooth/l2cap.h
@@ -176,6 +176,14 @@ struct l2cap_info_rsp {
 	__u8        data[0];
 } __attribute__ ((packed));
 
+/* info type */
+#define L2CAP_IT_CL_MTU     0x0001
+#define L2CAP_IT_FEAT_MASK  0x0002
+
+/* info result */
+#define L2CAP_IR_SUCCESS    0x0000
+#define L2CAP_IR_NOTSUPP    0x0001
+
 /* ----- L2CAP connections ----- */
 struct l2cap_chan_list {
 	struct sock	*head;
diff --git a/include/net/checksum.h b/include/net/checksum.h
index cd3c52a59..43f402351 100644
--- a/include/net/checksum.h
+++ b/include/net/checksum.h
@@ -16,83 +16,15 @@
  *		2 of the License, or (at your option) any later version.
  */
 
-/*
- *	Fixes:
- *
- *	Ralf Baechle			:	generic ipv6 checksum
- *	<ralf@waldorf-gmbh.de>
- */
-
 #ifndef _CHECKSUM_H
 #define _CHECKSUM_H
 
+#include <linux/errno.h>
 #include <asm/types.h>
 #include <asm/byteorder.h>
-#include <net/ip.h>
-#include <linux/in6.h>
 #include <asm/uaccess.h>
 #include <asm/checksum.h>
 
-#ifndef _HAVE_ARCH_IPV6_CSUM
-
-static __inline__ unsigned short int csum_ipv6_magic(struct in6_addr *saddr,
-						     struct in6_addr *daddr,
-						     __u16 len,
-						     unsigned short proto,
-						     unsigned int csum) 
-{
-
-	int carry;
-	__u32 ulen;
-	__u32 uproto;
-
-	csum += saddr->s6_addr32[0];
-	carry = (csum < saddr->s6_addr32[0]);
-	csum += carry;
-
-	csum += saddr->s6_addr32[1];
-	carry = (csum < saddr->s6_addr32[1]);
-	csum += carry;
-
-	csum += saddr->s6_addr32[2];
-	carry = (csum < saddr->s6_addr32[2]);
-	csum += carry;
-
-	csum += saddr->s6_addr32[3];
-	carry = (csum < saddr->s6_addr32[3]);
-	csum += carry;
-
-	csum += daddr->s6_addr32[0];
-	carry = (csum < daddr->s6_addr32[0]);
-	csum += carry;
-
-	csum += daddr->s6_addr32[1];
-	carry = (csum < daddr->s6_addr32[1]);
-	csum += carry;
-
-	csum += daddr->s6_addr32[2];
-	carry = (csum < daddr->s6_addr32[2]);
-	csum += carry;
-
-	csum += daddr->s6_addr32[3];
-	carry = (csum < daddr->s6_addr32[3]);
-	csum += carry;
-
-	ulen = htonl((__u32) len);
-	csum += ulen;
-	carry = (csum < ulen);
-	csum += carry;
-
-	uproto = htonl(proto);
-	csum += uproto;
-	carry = (csum < uproto);
-	csum += carry;
-
-	return csum_fold(csum);
-}
-
-#endif
-
 #ifndef _HAVE_ARCH_COPY_AND_CSUM_FROM_USER
 static inline
 unsigned int csum_and_copy_from_user (const char __user *src, char *dst,
diff --git a/include/net/dst.h b/include/net/dst.h
index ed2504c6b..33fd86690 100644
--- a/include/net/dst.h
+++ b/include/net/dst.h
@@ -142,15 +142,16 @@ struct dst_entry * dst_clone(struct dst_entry * dst)
 	return dst;
 }
 
+extern const char dst_underflow_bug_msg[];
+
 static inline
 void dst_release(struct dst_entry * dst)
 {
 	if (dst) {
-		if (atomic_read(&dst->__refcnt) < 1) {
-			printk("BUG: dst underflow %d: %p\n",
-			       atomic_read(&dst->__refcnt),
-			       current_text_addr());
-		}
+		if (atomic_read(&dst->__refcnt) < 1)
+			printk(dst_underflow_bug_msg, 
+			       atomic_read(&dst->__refcnt), 
+			       dst, current_text_addr());
 		atomic_dec(&dst->__refcnt);
 	}
 }
@@ -183,6 +184,12 @@ static inline void dst_free(struct dst_entry * dst)
 	__dst_free(dst);
 }
 
+static inline void dst_rcu_free(struct rcu_head *head)
+{
+	struct dst_entry *dst = container_of(head, struct dst_entry, rcu_head);
+	dst_free(dst);
+}
+
 static inline void dst_confirm(struct dst_entry *dst)
 {
 	if (dst)
diff --git a/include/net/esp.h b/include/net/esp.h
index a513d1452..90cd94fad 100644
--- a/include/net/esp.h
+++ b/include/net/esp.h
@@ -2,9 +2,14 @@
 #define _NET_ESP_H
 
 #include <net/xfrm.h>
+#include <asm/scatterlist.h>
+
+#define ESP_NUM_FAST_SG		4
 
 struct esp_data
 {
+	struct scatterlist		sgbuf[ESP_NUM_FAST_SG];
+
 	/* Confidentiality */
 	struct {
 		u8			*key;		/* Key */
diff --git a/include/net/icmp.h b/include/net/icmp.h
index edefb1387..aa260fcad 100644
--- a/include/net/icmp.h
+++ b/include/net/icmp.h
@@ -37,18 +37,6 @@ DECLARE_SNMP_STAT(struct icmp_mib, icmp_statistics);
 #define ICMP_INC_STATS(field)		SNMP_INC_STATS(icmp_statistics, field)
 #define ICMP_INC_STATS_BH(field)	SNMP_INC_STATS_BH(icmp_statistics, field)
 #define ICMP_INC_STATS_USER(field) 	SNMP_INC_STATS_USER(icmp_statistics, field)
-#define ICMP_INC_STATS_FIELD(offt)					\
-	(*((unsigned long *) ((void *)					\
-			     per_cpu_ptr(icmp_statistics[!in_softirq()],\
-					 smp_processor_id()) + offt)))++
-#define ICMP_INC_STATS_BH_FIELD(offt)					\
-	(*((unsigned long *) ((void *)					\
-			     per_cpu_ptr(icmp_statistics[0],		\
-					 smp_processor_id()) + offt)))++
-#define ICMP_INC_STATS_USER_FIELD(offt)					\
-	(*((unsigned long *) ((void *)					\
-			     per_cpu_ptr(icmp_statistics[1],		\
-					 smp_processor_id()) + offt)))++
 
 extern void	icmp_send(struct sk_buff *skb_in,  int type, int code, u32 info);
 extern int	icmp_rcv(struct sk_buff *skb);
diff --git a/include/net/inet_common.h b/include/net/inet_common.h
index e30543604..fbc1f4d14 100644
--- a/include/net/inet_common.h
+++ b/include/net/inet_common.h
@@ -20,27 +20,14 @@ extern int			inet_dgram_connect(struct socket *sock,
 						   int addr_len, int flags);
 extern int			inet_accept(struct socket *sock, 
 					    struct socket *newsock, int flags);
-extern int			inet_recvmsg(struct kiocb *iocb,
-					     struct socket *sock, 
-					     struct msghdr *ubuf, 
-					     size_t size, int flags);
 extern int			inet_sendmsg(struct kiocb *iocb,
 					     struct socket *sock, 
 					     struct msghdr *msg, 
 					     size_t size);
 extern int			inet_shutdown(struct socket *sock, int how);
 extern unsigned int		inet_poll(struct file * file, struct socket *sock, struct poll_table_struct *wait);
-extern int			inet_setsockopt(struct socket *sock, int level,
-						int optname,
-						char __user *optval, 
-						int optlen);
-extern int			inet_getsockopt(struct socket *sock, int level,
-						int optname,
-						char __user *optval, 
-						int __user *optlen);
 extern int			inet_listen(struct socket *sock, int backlog);
 
-extern void			inet_sock_release(struct sock *sk);
 extern void			inet_sock_destruct(struct sock *sk);
 extern atomic_t			inet_sock_nr;
 
diff --git a/include/net/inet_ecn.h b/include/net/inet_ecn.h
index 55dc2b3be..4b9c75562 100644
--- a/include/net/inet_ecn.h
+++ b/include/net/inet_ecn.h
@@ -3,39 +3,48 @@
 
 #include <linux/ip.h>
 
+enum {
+	INET_ECN_NOT_ECT = 0,
+	INET_ECN_ECT_1 = 1,
+	INET_ECN_ECT_0 = 2,
+	INET_ECN_CE = 3,
+	INET_ECN_MASK = 3,
+};
+
 static inline int INET_ECN_is_ce(__u8 dsfield)
 {
-	return (dsfield&3) == 3;
+	return (dsfield & INET_ECN_MASK) == INET_ECN_CE;
 }
 
 static inline int INET_ECN_is_not_ce(__u8 dsfield)
 {
-	return (dsfield&3) == 2;
+	return (dsfield & INET_ECN_MASK) == INET_ECN_ECT_0;
 }
 
 static inline int INET_ECN_is_capable(__u8 dsfield)
 {
-	return (dsfield&2);
+	return (dsfield & INET_ECN_ECT_0);
 }
 
 static inline __u8 INET_ECN_encapsulate(__u8 outer, __u8 inner)
 {
-	outer &= ~3;
+	outer &= ~INET_ECN_MASK;
 	if (INET_ECN_is_capable(inner))
-		outer |= (inner & 3);
+		outer |= (inner & INET_ECN_MASK);
 	return outer;
 }
 
-#define	INET_ECN_xmit(sk) do { inet_sk(sk)->tos |= 2; } while (0)
-#define	INET_ECN_dontxmit(sk) do { inet_sk(sk)->tos &= ~3; } while (0)
+#define	INET_ECN_xmit(sk) do { inet_sk(sk)->tos |= INET_ECN_ECT_0; } while (0)
+#define	INET_ECN_dontxmit(sk) \
+	do { inet_sk(sk)->tos &= ~INET_ECN_MASK; } while (0)
 
-#define IP6_ECN_flow_init(label) do {	\
-      (label) &= ~htonl(3<<20);		\
+#define IP6_ECN_flow_init(label) do {		\
+      (label) &= ~htonl(INET_ECN_MASK << 20);	\
     } while (0)
 
-#define	IP6_ECN_flow_xmit(sk, label) do {			\
-	if (INET_ECN_is_capable(inet_sk(sk)->tos))		\
-		(label) |= __constant_htons(2 << 4);		\
+#define	IP6_ECN_flow_xmit(sk, label) do {				\
+	if (INET_ECN_is_capable(inet_sk(sk)->tos))			\
+		(label) |= __constant_htons(INET_ECN_ECT_0 << 4);	\
     } while (0)
 
 static inline void IP_ECN_set_ce(struct iphdr *iph)
@@ -43,24 +52,24 @@ static inline void IP_ECN_set_ce(struct iphdr *iph)
 	u32 check = iph->check;
 	check += __constant_htons(0xFFFE);
 	iph->check = check + (check>=0xFFFF);
-	iph->tos |= 1;
+	iph->tos |= INET_ECN_CE;
 }
 
 static inline void IP_ECN_clear(struct iphdr *iph)
 {
-	iph->tos &= ~3;
+	iph->tos &= ~INET_ECN_MASK;
 }
 
 struct ipv6hdr;
 
 static inline void IP6_ECN_set_ce(struct ipv6hdr *iph)
 {
-	*(u32*)iph |= htonl(1<<20);
+	*(u32*)iph |= htonl(INET_ECN_CE << 20);
 }
 
 static inline void IP6_ECN_clear(struct ipv6hdr *iph)
 {
-	*(u32*)iph &= ~htonl(3<<20);
+	*(u32*)iph &= ~htonl(INET_ECN_MASK << 20);
 }
 
 #define ip6_get_dsfield(iph) ((ntohs(*(u16*)(iph)) >> 4) & 0xFF)
diff --git a/include/net/ip.h b/include/net/ip.h
index 5a683ccd4..bacccde1c 100644
--- a/include/net/ip.h
+++ b/include/net/ip.h
@@ -32,12 +32,9 @@
 #include <linux/in_route.h>
 #include <net/route.h>
 #include <net/arp.h>
-
-#ifndef _SNMP_H
 #include <net/snmp.h>
-#endif
 
-#include <net/sock.h>	/* struct sock */
+struct sock;
 
 struct inet_skb_parm
 {
@@ -112,6 +109,9 @@ extern ssize_t		ip_append_page(struct sock *sk, struct page *page,
 extern int		ip_push_pending_frames(struct sock *sk);
 extern void		ip_flush_pending_frames(struct sock *sk);
 
+/* datagram.c */
+extern int		ip4_datagram_connect(struct sock *sk, 
+					     struct sockaddr *uaddr, int addr_len);
 
 /*
  *	Map a multicast IP onto multicast MAC for type Token Ring.
@@ -131,10 +131,10 @@ static inline void ip_tr_mc_map(u32 addr, char *buf)
 }
 
 struct ip_reply_arg {
-	struct iovec iov[1];   
-	u32 	     csum; 
-	int	     csumoffset; /* u16 offset of csum in iov[0].iov_base */
-				 /* -1 if not needed */ 
+	struct kvec iov[1];   
+	u32 	    csum; 
+	int	    csumoffset; /* u16 offset of csum in iov[0].iov_base */
+				/* -1 if not needed */ 
 }; 
 
 void ip_send_reply(struct sock *sk, struct sk_buff *skb, struct ip_reply_arg *arg,
@@ -301,7 +301,7 @@ extern int ipv4_proc_init(void);
  */
 int ipv4_doint_and_flush(ctl_table *ctl, int write,
 			 struct file* filp, void __user *buffer,
-			 size_t *lenp);
+			 size_t *lenp, loff_t *ppos);
 int ipv4_doint_and_flush_strategy(ctl_table *table, int __user *name, int nlen,
 				  void __user *oldval, size_t __user *oldlenp,
 				  void __user *newval, size_t newlen, 
diff --git a/include/net/ip6_route.h b/include/net/ip6_route.h
index 291149080..75d503dc1 100644
--- a/include/net/ip6_route.h
+++ b/include/net/ip6_route.h
@@ -104,9 +104,7 @@ extern rwlock_t rt6_lock;
 
 /*
  *	Store a destination cache entry in a socket
- *	For UDP/RAW sockets this is done on udp_connect.
  */
-
 static inline void ip6_dst_store(struct sock *sk, struct dst_entry *dst,
 				     struct in6_addr *daddr)
 {
diff --git a/include/net/ipv6.h b/include/net/ipv6.h
index 8f647ae8e..034cf3084 100644
--- a/include/net/ipv6.h
+++ b/include/net/ipv6.h
@@ -406,6 +406,9 @@ extern void			ipv6_packet_init(void);
 
 extern void			ipv6_packet_cleanup(void);
 
+extern int			ip6_datagram_connect(struct sock *sk, 
+						     struct sockaddr *addr, int addr_len);
+
 extern int 			ipv6_recv_error(struct sock *sk, struct msghdr *msg, int len);
 extern void			ipv6_icmp_error(struct sock *sk, struct sk_buff *skb, int err, u16 port,
 						u32 info, u8 *payload);
diff --git a/include/net/irda/crc.h b/include/net/irda/crc.h
index 3cbbe798e..f202296df 100644
--- a/include/net/irda/crc.h
+++ b/include/net/irda/crc.h
@@ -15,19 +15,15 @@
 #define IRDA_CRC_H
 
 #include <linux/types.h>
+#include <linux/crc-ccitt.h>
 
 #define INIT_FCS  0xffff   /* Initial FCS value */
 #define GOOD_FCS  0xf0b8   /* Good final FCS value */
 
-extern __u16 const irda_crc16_table[];
-
 /* Recompute the FCS with one more character appended. */
-static inline __u16 irda_fcs(__u16 fcs, __u8 c)
-{
-	return (((fcs) >> 8) ^ irda_crc16_table[((fcs) ^ (c)) & 0xff]);
-}
+#define irda_fcs(fcs, c) crc_ccitt_byte(fcs, c)
 
 /* Recompute the FCS with len bytes appended. */
-__u16 irda_calc_crc16( __u16 fcs, __u8 const *buf, size_t len);
+#define irda_calc_crc16(fcs, buf, len) crc_ccitt(fcs, buf, len)
 
 #endif
diff --git a/include/net/irda/irda_device.h b/include/net/irda/irda_device.h
index 1d4cd8edc..2b245440b 100644
--- a/include/net/irda/irda_device.h
+++ b/include/net/irda/irda_device.h
@@ -39,11 +39,13 @@
 #ifndef IRDA_DEVICE_H
 #define IRDA_DEVICE_H
 
+#include <linux/config.h>
 #include <linux/tty.h>
 #include <linux/netdevice.h>
 #include <linux/spinlock.h>
 #include <linux/skbuff.h>		/* struct sk_buff */
 #include <linux/irda.h>
+#include <linux/types.h>
 
 #include <net/pkt_sched.h>
 #include <net/irda/irda.h>
@@ -236,7 +238,7 @@ dongle_t *irda_device_dongle_init(struct net_device *dev, int type);
 int irda_device_dongle_cleanup(dongle_t *dongle);
 
 #ifdef CONFIG_ISA
-void irda_setup_dma(int channel, char *buffer, int count, int mode);
+void irda_setup_dma(int channel, dma_addr_t buffer, int count, int mode);
 #endif
 
 void irda_task_delete(struct irda_task *task);
diff --git a/include/net/irda/irttp.h b/include/net/irda/irttp.h
index ef4727f60..600d5411d 100644
--- a/include/net/irda/irttp.h
+++ b/include/net/irda/irttp.h
@@ -210,6 +210,4 @@ static inline int irttp_is_primary(struct tsap_cb *self)
 	return(irlap_is_primary(self->lsap->lap->irlap));
 }
 
-extern struct irttp_cb *irttp;
-
 #endif /* IRTTP_H */
diff --git a/include/net/ndisc.h b/include/net/ndisc.h
index 95684d336..61d7033bc 100644
--- a/include/net/ndisc.h
+++ b/include/net/ndisc.h
@@ -103,7 +103,8 @@ extern int 			ndisc_ifinfo_sysctl_change(ctl_table *ctl,
 							   int write,
 							   struct file * filp,
 							   void __user *buffer,
-							   size_t *lenp);
+							   size_t *lenp,
+							   loff_t *ppos);
 #endif
 
 extern void 			inet6_ifinfo_notify(int event,
diff --git a/include/net/netrom.h b/include/net/netrom.h
index 816878041..d968252fe 100644
--- a/include/net/netrom.h
+++ b/include/net/netrom.h
@@ -112,9 +112,6 @@ struct nr_node {
  *	nr_node & nr_neigh lists, refcounting and locking
  *********************************************************************/
 
-extern struct hlist_head nr_node_list;
-extern struct hlist_head nr_neigh_list;
-
 #define nr_node_hold(__nr_node) \
 	atomic_inc(&((__nr_node)->refcount))
 
diff --git a/include/net/pkt_cls.h b/include/net/pkt_cls.h
index ca0736772..4de3ea73c 100644
--- a/include/net/pkt_cls.h
+++ b/include/net/pkt_cls.h
@@ -71,12 +71,38 @@ static inline int tc_classify(struct sk_buff *skb, struct tcf_proto *tp, struct
 {
 	int err = 0;
 	u32 protocol = skb->protocol;
+#ifdef CONFIG_NET_CLS_ACT
+	struct tcf_proto *otp = tp;
+reclassify:
+#endif
+	protocol = skb->protocol;
 
 	for ( ; tp; tp = tp->next) {
 		if ((tp->protocol == protocol ||
-		     tp->protocol == __constant_htons(ETH_P_ALL)) &&
-		    (err = tp->classify(skb, tp, res)) >= 0)
+			tp->protocol == __constant_htons(ETH_P_ALL)) &&
+			(err = tp->classify(skb, tp, res)) >= 0) {
+#ifdef CONFIG_NET_CLS_ACT
+			if ( TC_ACT_RECLASSIFY == err) {
+				__u32 verd = (__u32) G_TC_VERD(skb->tc_verd);
+				tp = otp;
+
+				if (MAX_REC_LOOP < verd++) {
+					printk("rule prio %d protocol %02x reclassify is buggy packet dropped\n",tp->prio&0xffff, ntohs(tp->protocol));
+					return TC_ACT_SHOT;
+				}
+				skb->tc_verd = SET_TC_VERD(skb->tc_verd,verd);
+				goto reclassify;
+			} else {
+				if (skb->tc_verd) 
+					skb->tc_verd = SET_TC_VERD(skb->tc_verd,0);
+				return err;
+			}
+#else
+
 			return err;
+#endif
+            }
+
 	}
 	return -1;
 }
@@ -90,6 +116,8 @@ static inline void tcf_destroy(struct tcf_proto *tp)
 
 extern int register_tcf_proto_ops(struct tcf_proto_ops *ops);
 extern int unregister_tcf_proto_ops(struct tcf_proto_ops *ops);
+extern int ing_filter(struct sk_buff *skb);
+
 
 
 
diff --git a/include/net/pkt_sched.h b/include/net/pkt_sched.h
index 80661d855..bce3aaf91 100644
--- a/include/net/pkt_sched.h
+++ b/include/net/pkt_sched.h
@@ -1,21 +1,14 @@
 #ifndef __NET_PKT_SCHED_H
 #define __NET_PKT_SCHED_H
 
-#define PSCHED_GETTIMEOFDAY	1
-#define PSCHED_JIFFIES 		2
-#define PSCHED_CPU 		3
-
-#define PSCHED_CLOCK_SOURCE	PSCHED_JIFFIES
-
 #include <linux/config.h>
 #include <linux/netdevice.h>
 #include <linux/types.h>
 #include <linux/pkt_sched.h>
+#include <linux/rcupdate.h>
 #include <net/pkt_cls.h>
-
-#ifdef CONFIG_X86_TSC
-#include <asm/msr.h>
-#endif
+#include <linux/module.h>
+#include <linux/rtnetlink.h>
 
 struct rtattr;
 struct Qdisc;
@@ -84,24 +77,34 @@ struct Qdisc
 #define TCQ_F_BUILTIN	1
 #define TCQ_F_THROTTLED	2
 #define TCQ_F_INGRES	4
+	int			padded;
 	struct Qdisc_ops	*ops;
-	struct Qdisc		*next;
 	u32			handle;
 	atomic_t		refcnt;
 	struct sk_buff_head	q;
 	struct net_device	*dev;
+	struct list_head	list;
 
 	struct tc_stats		stats;
+	spinlock_t		*stats_lock;
+	struct rcu_head 	q_rcu;
 	int			(*reshape_fail)(struct sk_buff *skb, struct Qdisc *q);
 
 	/* This field is deprecated, but it is still used by CBQ
 	 * and it will live until better solution will be invented.
 	 */
 	struct Qdisc		*__parent;
-
-	char			data[0];
 };
 
+#define	QDISC_ALIGN		32
+#define	QDISC_ALIGN_CONST	(QDISC_ALIGN - 1)
+
+static inline void *qdisc_priv(struct Qdisc *q)
+{
+	return (char *)q + ((sizeof(struct Qdisc) + QDISC_ALIGN_CONST)
+			      & ~QDISC_ALIGN_CONST);
+}
+
 struct qdisc_rate_table
 {
 	struct tc_ratespec rate;
@@ -110,43 +113,15 @@ struct qdisc_rate_table
 	int		refcnt;
 };
 
-static inline void sch_tree_lock(struct Qdisc *q)
-{
-	write_lock(&qdisc_tree_lock);
-	spin_lock_bh(&q->dev->queue_lock);
-}
-
-static inline void sch_tree_unlock(struct Qdisc *q)
-{
-	spin_unlock_bh(&q->dev->queue_lock);
-	write_unlock(&qdisc_tree_lock);
-}
-
-static inline void tcf_tree_lock(struct tcf_proto *tp)
-{
-	write_lock(&qdisc_tree_lock);
-	spin_lock_bh(&tp->q->dev->queue_lock);
-}
-
-static inline void tcf_tree_unlock(struct tcf_proto *tp)
-{
-	spin_unlock_bh(&tp->q->dev->queue_lock);
-	write_unlock(&qdisc_tree_lock);
-}
+extern void qdisc_lock_tree(struct net_device *dev);
+extern void qdisc_unlock_tree(struct net_device *dev);
 
+#define sch_tree_lock(q)	qdisc_lock_tree((q)->dev)
+#define sch_tree_unlock(q)	qdisc_unlock_tree((q)->dev)
+#define tcf_tree_lock(tp)	qdisc_lock_tree((tp)->q->dev)
+#define tcf_tree_unlock(tp)	qdisc_unlock_tree((tp)->q->dev)
 
-static inline unsigned long
-cls_set_class(struct tcf_proto *tp, unsigned long *clp, unsigned long cl)
-{
-	unsigned long old_cl;
-
-	tcf_tree_lock(tp);
-	old_cl = *clp;
-	*clp = cl;
-	tcf_tree_unlock(tp);
-	return old_cl;
-}
-
+#define cls_set_class(tp, clp, cl) tcf_set_class(tp, clp, cl)
 static inline unsigned long
 __cls_set_class(unsigned long *clp, unsigned long cl)
 {
@@ -178,25 +153,19 @@ __cls_set_class(unsigned long *clp, unsigned long cl)
    The reason is that, when it is not the same thing as
    gettimeofday, it returns invalid timestamp, which is
    not updated, when net_bh is active.
-
-   So, use PSCHED_CLOCK_SOURCE = PSCHED_CPU on alpha and pentiums
-   with rtdsc. And PSCHED_JIFFIES on all other architectures, including [34]86
-   and pentiums without rtdsc.
-   You can use PSCHED_GETTIMEOFDAY on another architectures,
-   which have fast and precise clock source, but it is too expensive.
  */
 
 /* General note about internal clock.
 
    Any clock source returns time intervals, measured in units
-   close to 1usec. With source PSCHED_GETTIMEOFDAY it is precisely
+   close to 1usec. With source CONFIG_NET_SCH_CLK_GETTIMEOFDAY it is precisely
    microseconds, otherwise something close but different chosen to minimize
    arithmetic cost. Ratio usec/internal untis in form nominator/denominator
    may be read from /proc/net/psched.
  */
 
 
-#if PSCHED_CLOCK_SOURCE == PSCHED_GETTIMEOFDAY
+#ifdef CONFIG_NET_SCH_CLK_GETTIMEOFDAY
 
 typedef struct timeval	psched_time_t;
 typedef long		psched_tdiff_t;
@@ -205,18 +174,12 @@ typedef long		psched_tdiff_t;
 #define PSCHED_US2JIFFIE(usecs) (((usecs)+(1000000/HZ-1))/(1000000/HZ))
 #define PSCHED_JIFFIE2US(delay) ((delay)*(1000000/HZ))
 
-#define PSCHED_EXPORTLIST EXPORT_SYMBOL(psched_tod_diff);
-
-#else /* PSCHED_CLOCK_SOURCE != PSCHED_GETTIMEOFDAY */
-
-#define PSCHED_EXPORTLIST PSCHED_EXPORTLIST_1 PSCHED_EXPORTLIST_2
+#else /* !CONFIG_NET_SCH_CLK_GETTIMEOFDAY */
 
 typedef u64	psched_time_t;
 typedef long	psched_tdiff_t;
 
-extern psched_time_t	psched_time_base;
-
-#if PSCHED_CLOCK_SOURCE == PSCHED_JIFFIES
+#ifdef CONFIG_NET_SCH_CLK_JIFFIES
 
 #if HZ < 96
 #define PSCHED_JSCALE 14
@@ -230,79 +193,39 @@ extern psched_time_t	psched_time_base;
 #define PSCHED_JSCALE 10
 #endif
 
-#define PSCHED_EXPORTLIST_2
-
-#if BITS_PER_LONG <= 32
-
-#define PSCHED_WATCHER unsigned long
-
-extern PSCHED_WATCHER psched_time_mark;
-
-#define PSCHED_GET_TIME(stamp) ((stamp) = psched_time_base + (((unsigned long)(jiffies-psched_time_mark))<<PSCHED_JSCALE))
-
-#define PSCHED_EXPORTLIST_1 EXPORT_SYMBOL(psched_time_base); \
-                            EXPORT_SYMBOL(psched_time_mark);
-
-#else
-
-#define PSCHED_GET_TIME(stamp) ((stamp) = (jiffies<<PSCHED_JSCALE))
-
-#define PSCHED_EXPORTLIST_1 
-
-#endif
-
+#define PSCHED_GET_TIME(stamp) ((stamp) = (get_jiffies_64()<<PSCHED_JSCALE))
 #define PSCHED_US2JIFFIE(delay) (((delay)+(1<<PSCHED_JSCALE)-1)>>PSCHED_JSCALE)
 #define PSCHED_JIFFIE2US(delay) ((delay)<<PSCHED_JSCALE)
 
-#elif PSCHED_CLOCK_SOURCE == PSCHED_CPU
+#endif /* CONFIG_NET_SCH_CLK_JIFFIES */
+#ifdef CONFIG_NET_SCH_CLK_CPU
+#include <asm/timex.h>
 
 extern psched_tdiff_t psched_clock_per_hz;
 extern int psched_clock_scale;
-
-#define PSCHED_EXPORTLIST_2 EXPORT_SYMBOL(psched_clock_per_hz); \
-                            EXPORT_SYMBOL(psched_clock_scale);
-
+extern psched_time_t psched_time_base;
+extern cycles_t psched_time_mark;
+
+#define PSCHED_GET_TIME(stamp)						\
+do {									\
+	cycles_t cur = get_cycles();					\
+	if (sizeof(cycles_t) == sizeof(u32)) {				\
+		if (cur <= psched_time_mark)				\
+			psched_time_base += 0x100000000ULL;		\
+		psched_time_mark = cur;					\
+		(stamp) = (psched_time_base + cur)>>psched_clock_scale;	\
+	} else {							\
+		(stamp) = cur>>psched_clock_scale;			\
+	}								\
+} while (0)
 #define PSCHED_US2JIFFIE(delay) (((delay)+psched_clock_per_hz-1)/psched_clock_per_hz)
 #define PSCHED_JIFFIE2US(delay) ((delay)*psched_clock_per_hz)
 
-#ifdef CONFIG_X86_TSC
-
-#define PSCHED_GET_TIME(stamp) \
-({ u64 __cur; \
-   rdtscll(__cur); \
-   (stamp) = __cur>>psched_clock_scale; \
-})
-
-#define PSCHED_EXPORTLIST_1
-
-#elif defined (__alpha__)
-
-#define PSCHED_WATCHER u32
-
-extern PSCHED_WATCHER psched_time_mark;
-
-#define PSCHED_GET_TIME(stamp) \
-({ u32 __res; \
-   __asm__ __volatile__ ("rpcc %0" : "r="(__res)); \
-   if (__res <= psched_time_mark) psched_time_base += 0x100000000UL; \
-   psched_time_mark = __res; \
-   (stamp) = (psched_time_base + __res)>>psched_clock_scale; \
-})
-
-#define PSCHED_EXPORTLIST_1 EXPORT_SYMBOL(psched_time_base); \
-                            EXPORT_SYMBOL(psched_time_mark);
+#endif /* CONFIG_NET_SCH_CLK_CPU */
 
-#else
-
-#error PSCHED_CLOCK_SOURCE=PSCHED_CPU is not supported on this arch.
-
-#endif /* ARCH */
+#endif /* !CONFIG_NET_SCH_CLK_GETTIMEOFDAY */
 
-#endif /* PSCHED_CLOCK_SOURCE == PSCHED_JIFFIES */
-
-#endif /* PSCHED_CLOCK_SOURCE == PSCHED_GETTIMEOFDAY */
-
-#if PSCHED_CLOCK_SOURCE == PSCHED_GETTIMEOFDAY
+#ifdef CONFIG_NET_SCH_CLK_GETTIMEOFDAY
 #define PSCHED_TDIFF(tv1, tv2) \
 ({ \
 	   int __delta_sec = (tv1).tv_sec - (tv2).tv_sec; \
@@ -322,13 +245,13 @@ extern PSCHED_WATCHER psched_time_mark;
 
 extern int psched_tod_diff(int delta_sec, int bound);
 
-#define PSCHED_TDIFF_SAFE(tv1, tv2, bound, guard) \
+#define PSCHED_TDIFF_SAFE(tv1, tv2, bound) \
 ({ \
 	   int __delta_sec = (tv1).tv_sec - (tv2).tv_sec; \
 	   int __delta = (tv1).tv_usec - (tv2).tv_usec; \
 	   switch (__delta_sec) { \
 	   default: \
-		   __delta = psched_tod_diff(__delta_sec, bound); guard; break; \
+		   __delta = psched_tod_diff(__delta_sec, bound);  break; \
 	   case 2: \
 		   __delta += 1000000; \
 	   case 1: \
@@ -366,15 +289,11 @@ extern int psched_tod_diff(int delta_sec, int bound);
 
 #define	PSCHED_AUDIT_TDIFF(t) ({ if ((t) > 2000000) (t) = 2000000; })
 
-#else
+#else /* !CONFIG_NET_SCH_CLK_GETTIMEOFDAY */
 
 #define PSCHED_TDIFF(tv1, tv2) (long)((tv1) - (tv2))
-#define PSCHED_TDIFF_SAFE(tv1, tv2, bound, guard) \
-({ \
-	   long long __delta = (tv1) - (tv2); \
-	   if ( __delta > (long long)(bound)) {  __delta = (bound); guard; } \
-	   __delta; \
-})
+#define PSCHED_TDIFF_SAFE(tv1, tv2, bound) \
+	min_t(long long, (tv1) - (tv2), bound)
 
 
 #define PSCHED_TLESS(tv1, tv2) ((tv1) < (tv2))
@@ -384,20 +303,21 @@ extern int psched_tod_diff(int delta_sec, int bound);
 #define PSCHED_IS_PASTPERFECT(t)	((t) == 0)
 #define	PSCHED_AUDIT_TDIFF(t)
 
-#endif
+#endif /* !CONFIG_NET_SCH_CLK_GETTIMEOFDAY */
 
 struct tcf_police
 {
 	struct tcf_police *next;
 	int		refcnt;
+#ifdef CONFIG_NET_CLS_ACT
+	int		bindcnt;
+#endif
 	u32		index;
-
 	int		action;
 	int		result;
 	u32		ewma_rate;
 	u32		burst;
 	u32		mtu;
-
 	u32		toks;
 	u32		ptoks;
 	psched_time_t	t_c;
@@ -406,18 +326,95 @@ struct tcf_police
 	struct qdisc_rate_table *P_tab;
 
 	struct tc_stats	stats;
+	spinlock_t	*stats_lock;
+};
+
+#ifdef CONFIG_NET_CLS_ACT
+
+#define ACT_P_CREATED 1
+#define ACT_P_DELETED 1
+#define tca_gen(name) \
+struct tcf_##name *next; \
+	u32 index; \
+	int refcnt; \
+	int bindcnt; \
+	u32 capab; \
+	int action; \
+	struct tcf_t tm; \
+	struct tc_stats stats; \
+	spinlock_t *stats_lock; \
+	spinlock_t lock
+
+
+struct tc_action
+{
+	void *priv;
+	struct tc_action_ops *ops;
+	__u32   type;   /* for backward compat(TCA_OLD_COMPAT) */
+	__u32   order; 
+	struct tc_action *next;
+};
+
+#define TCA_CAP_NONE 0
+struct tc_action_ops
+{
+	struct tc_action_ops *next;
+	char    kind[IFNAMSIZ];
+	__u32   type; /* TBD to match kind */
+	__u32 	capab;  /* capabilities includes 4 bit version */
+	struct module		*owner;
+	int     (*act)(struct sk_buff **, struct tc_action *);
+	int     (*get_stats)(struct sk_buff *, struct tc_action *);
+	int     (*dump)(struct sk_buff *, struct tc_action *,int , int);
+	int     (*cleanup)(struct tc_action *, int bind);
+	int     (*lookup)(struct tc_action *, u32 );
+	int     (*init)(struct rtattr *,struct rtattr *,struct tc_action *, int , int );
+	int     (*walk)(struct sk_buff *, struct netlink_callback *, int , struct tc_action *);
 };
 
-extern int qdisc_copy_stats(struct sk_buff *skb, struct tc_stats *st);
+extern int tcf_register_action(struct tc_action_ops *a);
+extern int tcf_unregister_action(struct tc_action_ops *a);
+extern void tcf_action_destroy(struct tc_action *a, int bind);
+extern int tcf_action_exec(struct sk_buff *skb, struct tc_action *a);
+extern int tcf_action_init(struct rtattr *rta, struct rtattr *est, struct tc_action *a,char *n, int ovr, int bind);
+extern int tcf_action_init_1(struct rtattr *rta, struct rtattr *est, struct tc_action *a,char *n, int ovr, int bind);
+extern int tcf_action_dump(struct sk_buff *skb, struct tc_action *a, int, int);
+extern int tcf_action_dump_old(struct sk_buff *skb, struct tc_action *a, int, int);
+extern int tcf_action_dump_1(struct sk_buff *skb, struct tc_action *a, int, int);
+extern int tcf_action_copy_stats (struct sk_buff *,struct tc_action *);
+extern int tcf_act_police_locate(struct rtattr *rta, struct rtattr *est,struct tc_action *,int , int );
+extern int tcf_act_police_dump(struct sk_buff *, struct tc_action *, int, int);
+extern int tcf_act_police(struct sk_buff **skb, struct tc_action *a);
+#endif
+
+extern unsigned long tcf_set_class(struct tcf_proto *tp, unsigned long *clp, 
+				   unsigned long cl);
+extern int tcf_police(struct sk_buff *skb, struct tcf_police *p);
+extern int qdisc_copy_stats(struct sk_buff *skb, struct tc_stats *st, spinlock_t *lock);
 extern void tcf_police_destroy(struct tcf_police *p);
 extern struct tcf_police * tcf_police_locate(struct rtattr *rta, struct rtattr *est);
 extern int tcf_police_dump(struct sk_buff *skb, struct tcf_police *p);
-extern int tcf_police(struct sk_buff *skb, struct tcf_police *p);
 
-static inline void tcf_police_release(struct tcf_police *p)
+static inline int tcf_police_release(struct tcf_police *p, int bind)
 {
+	int ret = 0;
+#ifdef CONFIG_NET_CLS_ACT
+	if (p) {
+		if (bind) {
+			 p->bindcnt--;
+		}
+		p->refcnt--;
+		if (p->refcnt <= 0 && !p->bindcnt) {
+			tcf_police_destroy(p);
+			ret = 1;
+		}
+	}
+#else
 	if (p && --p->refcnt == 0)
 		tcf_police_destroy(p);
+
+#endif
+	return ret;
 }
 
 extern struct Qdisc noop_qdisc;
@@ -436,20 +433,13 @@ void dev_deactivate(struct net_device *dev);
 void qdisc_reset(struct Qdisc *qdisc);
 void qdisc_destroy(struct Qdisc *qdisc);
 struct Qdisc * qdisc_create_dflt(struct net_device *dev, struct Qdisc_ops *ops);
-int qdisc_new_estimator(struct tc_stats *stats, struct rtattr *opt);
+int qdisc_new_estimator(struct tc_stats *stats, spinlock_t *stats_lock, struct rtattr *opt);
 void qdisc_kill_estimator(struct tc_stats *stats);
 struct qdisc_rate_table *qdisc_get_rtab(struct tc_ratespec *r, struct rtattr *tab);
 void qdisc_put_rtab(struct qdisc_rate_table *tab);
 
 extern int qdisc_restart(struct net_device *dev);
 
-static inline void qdisc_run(struct net_device *dev)
-{
-	while (!netif_queue_stopped(dev) &&
-	       qdisc_restart(dev)<0)
-		/* NOTHING */;
-}
-
 /* Calculate maximal size of packet seen by hard_start_xmit
    routine of this device.
  */
diff --git a/include/net/protocol.h b/include/net/protocol.h
index f67327486..357691f6a 100644
--- a/include/net/protocol.h
+++ b/include/net/protocol.h
@@ -34,8 +34,7 @@
 
 
 /* This is used to register protocols. */
-struct inet_protocol 
-{
+struct net_protocol {
 	int			(*handler)(struct sk_buff *skb);
 	void			(*err_handler)(struct sk_buff *skb, u32 info);
 	int			no_policy;
@@ -78,15 +77,15 @@ struct inet_protosw {
 #define INET_PROTOSW_REUSE 0x01	     /* Are ports automatically reusable? */
 #define INET_PROTOSW_PERMANENT 0x02  /* Permanent protocols are unremovable. */
 
-extern struct inet_protocol *inet_protocol_base;
-extern struct inet_protocol *inet_protos[MAX_INET_PROTOS];
+extern struct net_protocol *inet_protocol_base;
+extern struct net_protocol *inet_protos[MAX_INET_PROTOS];
 
 #if defined(CONFIG_IPV6) || defined (CONFIG_IPV6_MODULE)
 extern struct inet6_protocol *inet6_protos[MAX_INET_PROTOS];
 #endif
 
-extern int	inet_add_protocol(struct inet_protocol *prot, unsigned char num);
-extern int	inet_del_protocol(struct inet_protocol *prot, unsigned char num);
+extern int	inet_add_protocol(struct net_protocol *prot, unsigned char num);
+extern int	inet_del_protocol(struct net_protocol *prot, unsigned char num);
 extern void	inet_register_protosw(struct inet_protosw *p);
 extern void	inet_unregister_protosw(struct inet_protosw *p);
 
diff --git a/include/net/route.h b/include/net/route.h
index cabc34499..7252ea43e 100644
--- a/include/net/route.h
+++ b/include/net/route.h
@@ -132,7 +132,7 @@ extern void		ip_rt_send_redirect(struct sk_buff *skb);
 
 extern unsigned		inet_addr_type(u32 addr);
 extern void		ip_rt_multicast_event(struct in_device *);
-extern int		ip_rt_ioctl(unsigned int cmd, void *arg);
+extern int		ip_rt_ioctl(unsigned int cmd, void __user *arg);
 extern void		ip_rt_get_source(u8 *src, struct rtable *rt);
 extern int		ip_rt_dump(struct sk_buff *skb,  struct netlink_callback *cb);
 
@@ -222,7 +222,8 @@ static inline int ip_route_connect(struct rtable **rp, u32 dst,
 
 	if (sk)
 		nx_info = sk->sk_nx_info;
-	vxdprintk("ip_route_connect(%p) %p,%p;%lx\n",
+	vxdprintk(VXD_CBIT(net, 4),
+		"ip_route_connect(%p) %p,%p;%lx",
 		sk, nx_info, sk->sk_socket,
 		(sk->sk_socket?sk->sk_socket->flags:0));
 
diff --git a/include/net/sctp/command.h b/include/net/sctp/command.h
index c3088c127..4e0e2246d 100644
--- a/include/net/sctp/command.h
+++ b/include/net/sctp/command.h
@@ -94,6 +94,9 @@ typedef enum {
 	SCTP_CMD_REPORT_FWDTSN,	 /* Report new cumulative TSN Ack. */
 	SCTP_CMD_PROCESS_FWDTSN, /* Skips were reported, so process further. */
 	SCTP_CMD_CLEAR_INIT_TAG, /* Clears association peer's inittag. */
+	SCTP_CMD_DEL_NON_PRIMARY, /* Removes non-primary peer transports. */
+	SCTP_CMD_T3_RTX_TIMERS_STOP, /* Stops T3-rtx pending timers */
+	SCTP_CMD_FORCE_PRIM_RETRAN,  /* Forces retrans. over primary path. */
 	SCTP_CMD_LAST
 } sctp_verb_t;
 
diff --git a/include/net/sctp/constants.h b/include/net/sctp/constants.h
index c611176fb..bc1d9a63d 100644
--- a/include/net/sctp/constants.h
+++ b/include/net/sctp/constants.h
@@ -175,6 +175,10 @@ typedef enum {
 	SCTP_IERROR_BAD_TAG,
 	SCTP_IERROR_BIG_GAP,
 	SCTP_IERROR_DUP_TSN,
+	SCTP_IERROR_HIGH_TSN,
+	SCTP_IERROR_IGNORE_TSN,
+	SCTP_IERROR_NO_DATA,
+	SCTP_IERROR_BAD_STREAM,
 
 } sctp_ierror_t;
 
diff --git a/include/net/sctp/sm.h b/include/net/sctp/sm.h
index a73cea970..fc6175064 100644
--- a/include/net/sctp/sm.h
+++ b/include/net/sctp/sm.h
@@ -322,6 +322,9 @@ void sctp_send_stale_cookie_err(const struct sctp_endpoint *ep,
 				const struct sctp_chunk *chunk,
 				sctp_cmd_seq_t *commands,
 				struct sctp_chunk *err_chunk);
+int sctp_eat_data(const struct sctp_association *asoc,
+		  struct sctp_chunk *chunk,
+		  sctp_cmd_seq_t *commands);
 
 /* 3rd level prototypes */
 __u32 sctp_generate_tag(const struct sctp_endpoint *);
diff --git a/include/net/snmp.h b/include/net/snmp.h
index c702dda23..b7068876e 100644
--- a/include/net/snmp.h
+++ b/include/net/snmp.h
@@ -22,291 +22,102 @@
 #define _SNMP_H
 
 #include <linux/cache.h>
- 
-/*
- *	We use all unsigned longs. Linux will soon be so reliable that even these
- *	will rapidly get too small 8-). Seriously consider the IpInReceives count
- *	on the 20Gb/s + networks people expect in a few years time!
- */
-
-/* 
- * The rule for padding: 
- * Best is power of two because then the right structure can be found by a simple
- * shift. The structure should be always cache line aligned.
- * gcc needs n=alignto(cachelinesize, popcnt(sizeof(bla_mib))) shift/add instructions
- * to emulate multiply in case it is not power-of-two. Currently n is always <=3 for
- * all sizes so simple cache line alignment is enough. 
- * 
- * The best solution would be a global CPU local area , especially on 64 and 128byte 
- * cacheline machine it makes a *lot* of sense -AK
- */ 
-
-struct snmp_item {
-	char *name;
-	int offset;
-};
-
-#define SNMP_ITEM(mib,entry,procname)	{	\
-	.name = procname,			\
-	.offset = offsetof(mib, entry),		\
-}
-
-#define SNMP_ITEM_SENTINEL {			\
-	.name = NULL,				\
-	.offset = 0,				\
-}
+#include <linux/snmp.h>
 
 /*
- * RFC 1213:  MIB-II
- * RFC 2011 (updates 1213):  SNMPv2-MIB-IP
- * RFC 2863:  Interfaces Group MIB
- * RFC 2465:  IPv6 MIB: General Group
- * draft-ietf-ipv6-rfc2011-update-10.txt: MIB for IP: IP Statistics Tables
+ * Mibs are stored in array of unsigned long.
  */
-struct ipstats_mib
-{
-	unsigned long	InReceives;
- 	unsigned long	InHdrErrors;
- 	unsigned long	InTooBigErrors;
- 	unsigned long	InNoRoutes;
- 	unsigned long	InAddrErrors;
- 	unsigned long	InUnknownProtos;
- 	unsigned long	InTruncatedPkts;
- 	unsigned long	InDiscards;
- 	unsigned long	InDelivers;
- 	unsigned long	OutForwDatagrams;
- 	unsigned long	OutRequests;
- 	unsigned long	OutDiscards;
- 	unsigned long	OutNoRoutes;
- 	unsigned long	ReasmTimeout;
- 	unsigned long	ReasmReqds;
- 	unsigned long	ReasmOKs;
- 	unsigned long	ReasmFails;
- 	unsigned long	FragOKs;
- 	unsigned long	FragFails;
- 	unsigned long	FragCreates;
- 	unsigned long	InMcastPkts;
- 	unsigned long	OutMcastPkts;
-	unsigned long   __pad[0]; 
-};
- 
 /*
- * RFC 1213:  MIB-II ICMP Group
- * RFC 2011 (updates 1213):  SNMPv2 MIB for IP: ICMP group
+ * struct snmp_mib{}
+ *  - list of entries for particular API (such as /proc/net/snmp)
+ *  - name of entries.
  */
-struct icmp_mib
-{
- 	unsigned long	IcmpInMsgs;
- 	unsigned long	IcmpInErrors;
-  	unsigned long	IcmpInDestUnreachs;
- 	unsigned long	IcmpInTimeExcds;
- 	unsigned long	IcmpInParmProbs;
- 	unsigned long	IcmpInSrcQuenchs;
- 	unsigned long	IcmpInRedirects;
- 	unsigned long	IcmpInEchos;
- 	unsigned long	IcmpInEchoReps;
- 	unsigned long	IcmpInTimestamps;
- 	unsigned long	IcmpInTimestampReps;
- 	unsigned long	IcmpInAddrMasks;
- 	unsigned long	IcmpInAddrMaskReps;
- 	unsigned long	IcmpOutMsgs;
- 	unsigned long	IcmpOutErrors;
- 	unsigned long	IcmpOutDestUnreachs;
- 	unsigned long	IcmpOutTimeExcds;
- 	unsigned long	IcmpOutParmProbs;
- 	unsigned long	IcmpOutSrcQuenchs;
- 	unsigned long	IcmpOutRedirects;
- 	unsigned long	IcmpOutEchos;
- 	unsigned long	IcmpOutEchoReps;
- 	unsigned long	IcmpOutTimestamps;
- 	unsigned long	IcmpOutTimestampReps;
- 	unsigned long	IcmpOutAddrMasks;
- 	unsigned long	IcmpOutAddrMaskReps;
-	unsigned long	dummy;
-	unsigned long   __pad[0]; 
+struct snmp_mib {
+	char *name;
+	int entry;
 };
 
-/*
- * RFC 2466:  ICMPv6-MIB
- */
-struct icmpv6_mib
-{
-	unsigned long	Icmp6InMsgs;
-	unsigned long	Icmp6InErrors;
-
-	unsigned long	Icmp6InDestUnreachs;
-	unsigned long	Icmp6InPktTooBigs;
-	unsigned long	Icmp6InTimeExcds;
-	unsigned long	Icmp6InParmProblems;
-
-	unsigned long	Icmp6InEchos;
-	unsigned long	Icmp6InEchoReplies;
-	unsigned long	Icmp6InGroupMembQueries;
-	unsigned long	Icmp6InGroupMembResponses;
-	unsigned long	Icmp6InGroupMembReductions;
-	unsigned long	Icmp6InRouterSolicits;
-	unsigned long	Icmp6InRouterAdvertisements;
-	unsigned long	Icmp6InNeighborSolicits;
-	unsigned long	Icmp6InNeighborAdvertisements;
-	unsigned long	Icmp6InRedirects;
-
-	unsigned long	Icmp6OutMsgs;
+#define SNMP_MIB_ITEM(_name,_entry)	{	\
+	.name = _name,				\
+	.entry = _entry,			\
+}
 
-	unsigned long	Icmp6OutDestUnreachs;
-	unsigned long	Icmp6OutPktTooBigs;
-	unsigned long	Icmp6OutTimeExcds;
-	unsigned long	Icmp6OutParmProblems;
+#define SNMP_MIB_SENTINEL {	\
+	.name = NULL,		\
+	.entry = 0,		\
+}
 
-	unsigned long	Icmp6OutEchoReplies;
-	unsigned long	Icmp6OutRouterSolicits;
-	unsigned long	Icmp6OutNeighborSolicits;
-	unsigned long	Icmp6OutNeighborAdvertisements;
-	unsigned long	Icmp6OutRedirects;
-	unsigned long	Icmp6OutGroupMembResponses;
-	unsigned long	Icmp6OutGroupMembReductions;
-	unsigned long   __pad[0]; 
-};
- 
-/*
- * RFC 1213:  MIB-II TCP group
- * RFC 2012 (updates 1213):  SNMPv2-MIB-TCP
- */
-struct tcp_mib
-{
- 	unsigned long	TcpRtoAlgorithm;
- 	unsigned long	TcpRtoMin;
- 	unsigned long	TcpRtoMax;
- 	unsigned long	TcpMaxConn;
- 	unsigned long	TcpActiveOpens;
- 	unsigned long	TcpPassiveOpens;
- 	unsigned long	TcpAttemptFails;
- 	unsigned long	TcpEstabResets;
- 	unsigned long	TcpCurrEstab;
- 	unsigned long	TcpInSegs;
- 	unsigned long	TcpOutSegs;
- 	unsigned long	TcpRetransSegs;
- 	unsigned long	TcpInErrs;
- 	unsigned long	TcpOutRsts;
-	unsigned long   __pad[0]; 
-};
- 
 /*
- * RFC 1213:  MIB-II UDP group
- * RFC 2013 (updates 1213):  SNMPv2-MIB-UDP
+ * We use all unsigned longs. Linux will soon be so reliable that even 
+ * these will rapidly get too small 8-). Seriously consider the IpInReceives 
+ * count on the 20Gb/s + networks people expect in a few years time!
  */
-struct udp_mib
-{
- 	unsigned long	UdpInDatagrams;
- 	unsigned long	UdpNoPorts;
- 	unsigned long	UdpInErrors;
- 	unsigned long	UdpOutDatagrams;
-	unsigned long   __pad[0];
-}; 
 
-/* draft-ietf-sigtran-sctp-mib-07.txt */
-struct sctp_mib
-{
-	unsigned long   SctpCurrEstab;
-	unsigned long   SctpActiveEstabs;
-	unsigned long   SctpPassiveEstabs;
-	unsigned long   SctpAborteds;
-	unsigned long   SctpShutdowns;
-	unsigned long   SctpOutOfBlues;
-	unsigned long   SctpChecksumErrors;
-	unsigned long   SctpOutCtrlChunks;
-	unsigned long   SctpOutOrderChunks;
-	unsigned long   SctpOutUnorderChunks;
-	unsigned long   SctpInCtrlChunks;
-	unsigned long   SctpInOrderChunks;
-	unsigned long   SctpInUnorderChunks;
-	unsigned long   SctpFragUsrMsgs;
-	unsigned long   SctpReasmUsrMsgs;
-	unsigned long   SctpOutSCTPPacks;
-	unsigned long   SctpInSCTPPacks;
-	unsigned long   SctpRtoAlgorithm;
-	unsigned long   SctpRtoMin;
-	unsigned long   SctpRtoMax;
-	unsigned long   SctpRtoInitial;
-	unsigned long   SctpValCookieLife;
-	unsigned long   SctpMaxInitRetr;
-	unsigned long   __pad[0];
-};
+/* 
+ * The rule for padding: 
+ * Best is power of two because then the right structure can be found by a 
+ * simple shift. The structure should be always cache line aligned.
+ * gcc needs n=alignto(cachelinesize, popcnt(sizeof(bla_mib))) shift/add 
+ * instructions to emulate multiply in case it is not power-of-two. 
+ * Currently n is always <=3 for all sizes so simple cache line alignment 
+ * is enough. 
+ * 
+ * The best solution would be a global CPU local area , especially on 64 
+ * and 128byte cacheline machine it makes a *lot* of sense -AK
+ */ 
 
-struct linux_mib 
-{
-	unsigned long	SyncookiesSent;
-	unsigned long	SyncookiesRecv;
-	unsigned long	SyncookiesFailed;
-	unsigned long	EmbryonicRsts;
-	unsigned long	PruneCalled; 
-	unsigned long	RcvPruned;
-	unsigned long	OfoPruned;
-	unsigned long	OutOfWindowIcmps; 
-	unsigned long	LockDroppedIcmps; 
-        unsigned long   ArpFilter;
-	unsigned long	TimeWaited; 
-	unsigned long	TimeWaitRecycled; 
-	unsigned long	TimeWaitKilled; 
-	unsigned long	PAWSPassiveRejected; 
-	unsigned long	PAWSActiveRejected; 
-	unsigned long	PAWSEstabRejected; 
-	unsigned long	DelayedACKs;
-	unsigned long	DelayedACKLocked;
-	unsigned long	DelayedACKLost;
-	unsigned long	ListenOverflows;
-	unsigned long	ListenDrops;
-	unsigned long	TCPPrequeued;
-	unsigned long	TCPDirectCopyFromBacklog;
-	unsigned long	TCPDirectCopyFromPrequeue;
-	unsigned long	TCPPrequeueDropped;
-	unsigned long	TCPHPHits;
-	unsigned long	TCPHPHitsToUser;
-	unsigned long	TCPPureAcks;
-	unsigned long	TCPHPAcks;
-	unsigned long	TCPRenoRecovery;
-	unsigned long	TCPSackRecovery;
-	unsigned long	TCPSACKReneging;
-	unsigned long	TCPFACKReorder;
-	unsigned long	TCPSACKReorder;
-	unsigned long	TCPRenoReorder;
-	unsigned long	TCPTSReorder;
-	unsigned long	TCPFullUndo;
-	unsigned long	TCPPartialUndo;
-	unsigned long	TCPDSACKUndo;
-	unsigned long	TCPLossUndo;
-	unsigned long	TCPLoss;
-	unsigned long	TCPLostRetransmit;
-	unsigned long	TCPRenoFailures;
-	unsigned long	TCPSackFailures;
-	unsigned long	TCPLossFailures;
-	unsigned long	TCPFastRetrans;
-	unsigned long	TCPForwardRetrans;
-	unsigned long	TCPSlowStartRetrans;
-	unsigned long	TCPTimeouts;
-	unsigned long	TCPRenoRecoveryFail;
-	unsigned long	TCPSackRecoveryFail;
-	unsigned long	TCPSchedulerFailed;
-	unsigned long	TCPRcvCollapsed;
-	unsigned long	TCPDSACKOldSent;
-	unsigned long	TCPDSACKOfoSent;
-	unsigned long	TCPDSACKRecv;
-	unsigned long	TCPDSACKOfoRecv;
-	unsigned long	TCPAbortOnSyn;
-	unsigned long	TCPAbortOnData;
-	unsigned long	TCPAbortOnClose;
-	unsigned long	TCPAbortOnMemory;
-	unsigned long	TCPAbortOnTimeout;
-	unsigned long	TCPAbortOnLinger;
-	unsigned long	TCPAbortFailed;
-	unsigned long	TCPMemoryPressures;
-	unsigned long   __pad[0];
+#define __SNMP_MIB_ALIGN__	____cacheline_aligned
+
+/* IPstats */
+#define IPSTATS_MIB_MAX	__IPSTATS_MIB_MAX
+struct ipstats_mib {
+	unsigned long	mibs[IPSTATS_MIB_MAX];
+} __SNMP_MIB_ALIGN__;
+
+/* ICMP */
+#define ICMP_MIB_DUMMY	__ICMP_MIB_MAX
+#define ICMP_MIB_MAX	(__ICMP_MIB_MAX + 1)
+
+struct icmp_mib {
+	unsigned long	mibs[ICMP_MIB_MAX];
+} __SNMP_MIB_ALIGN__;
+
+/* ICMP6 (IPv6-ICMP) */
+#define ICMP6_MIB_MAX	__ICMP6_MIB_MAX
+struct icmpv6_mib {
+	unsigned long	mibs[ICMP6_MIB_MAX];
+} __SNMP_MIB_ALIGN__;
+
+/* TCP */
+#define TCP_MIB_MAX	__TCP_MIB_MAX
+struct tcp_mib {
+	unsigned long	mibs[TCP_MIB_MAX];
+} __SNMP_MIB_ALIGN__;
+
+/* UDP */
+#define UDP_MIB_MAX	__UDP_MIB_MAX
+struct udp_mib {
+	unsigned long	mibs[UDP_MIB_MAX];
+} __SNMP_MIB_ALIGN__;
+
+/* SCTP */
+#define SCTP_MIB_MAX	__SCTP_MIB_MAX
+struct sctp_mib {
+	unsigned long	mibs[SCTP_MIB_MAX];
+} __SNMP_MIB_ALIGN__;
+
+/* Linux */
+#define LINUX_MIB_MAX	__LINUX_MIB_MAX
+struct linux_mib {
+	unsigned long	mibs[LINUX_MIB_MAX];
 };
 
 
 /* 
- * FIXME: On x86 and some other CPUs the split into user and softirq parts is not needed because 
- * addl $1,memory is atomic against interrupts (but atomic_inc would be overkill because of the lock 
- * cycles). Wants new nonlocked_atomic_inc() primitives -AK
+ * FIXME: On x86 and some other CPUs the split into user and softirq parts
+ * is not needed because addl $1,memory is atomic against interrupts (but 
+ * atomic_inc would be overkill because of the lock cycles). Wants new 
+ * nonlocked_atomic_inc() primitives -AK
  */ 
 #define DEFINE_SNMP_STAT(type, name)	\
 	__typeof__(type) *name[2]
@@ -317,18 +128,18 @@ struct linux_mib
 #define SNMP_STAT_USRPTR(name)	(name[1])
 
 #define SNMP_INC_STATS_BH(mib, field) 	\
-	(per_cpu_ptr(mib[0], smp_processor_id())->field++)
+	(per_cpu_ptr(mib[0], smp_processor_id())->mibs[field]++)
 #define SNMP_INC_STATS_OFFSET_BH(mib, field, offset)	\
-	((*((&per_cpu_ptr(mib[0], smp_processor_id())->field) + (offset)))++)
+	(per_cpu_ptr(mib[0], smp_processor_id())->mibs[field + (offset)]++)
 #define SNMP_INC_STATS_USER(mib, field) \
-	(per_cpu_ptr(mib[1], smp_processor_id())->field++)
+	(per_cpu_ptr(mib[1], smp_processor_id())->mibs[field]++)
 #define SNMP_INC_STATS(mib, field) 	\
-	(per_cpu_ptr(mib[!in_softirq()], smp_processor_id())->field++)
+	(per_cpu_ptr(mib[!in_softirq()], smp_processor_id())->mibs[field]++)
 #define SNMP_DEC_STATS(mib, field) 	\
-	(per_cpu_ptr(mib[!in_softirq()], smp_processor_id())->field--)
+	(per_cpu_ptr(mib[!in_softirq()], smp_processor_id())->mibs[field]--)
 #define SNMP_ADD_STATS_BH(mib, field, addend) 	\
-	(per_cpu_ptr(mib[0], smp_processor_id())->field += addend)
+	(per_cpu_ptr(mib[0], smp_processor_id())->mibs[field] += addend)
 #define SNMP_ADD_STATS_USER(mib, field, addend) 	\
-	(per_cpu_ptr(mib[1], smp_processor_id())->field += addend)
- 	
+	(per_cpu_ptr(mib[1], smp_processor_id())->mibs[field] += addend)
+
 #endif
diff --git a/include/net/sock.h b/include/net/sock.h
index 8bc7d3465..fb4df58ec 100644
--- a/include/net/sock.h
+++ b/include/net/sock.h
@@ -53,6 +53,7 @@
 
 #include <asm/atomic.h>
 #include <net/dst.h>
+#include <net/checksum.h>
 
 /*
  * This structure really needs to be cleaned up.
@@ -170,6 +171,11 @@ struct sock_common {
   *	@sk_socket - Identd and reporting IO signals
   *	@sk_user_data - RPC layer private data
   *	@sk_owner - module that owns this socket
+  *	@sk_sndmsg_page - cached page for sendmsg
+  *	@sk_sndmsg_off - cached offset for sendmsg
+  *	@sk_send_head - front of stuff to transmit
+  *	@sk_write_pending - a write to stream socket waits to start
+  *	@sk_queue_shrunk - write queue has been shrunk recently
   *	@sk_state_change - callback to indicate change in the state of the sock
   *	@sk_data_ready - callback to indicate there is data to be processed
   *	@sk_write_space - callback to indicate there is bf sending space available
@@ -254,7 +260,13 @@ struct sock {
 	struct socket		*sk_socket;
 	void			*sk_user_data;
 	struct module		*sk_owner;
+	struct page		*sk_sndmsg_page;
+	__u32			sk_sndmsg_off;
+	struct sk_buff		*sk_send_head;
+	int			sk_write_pending;
 	void			*sk_security;
+	__u8			sk_queue_shrunk;
+	/* three bytes hole, try to pack */
 	void			(*sk_state_change)(struct sock *sk);
 	void			(*sk_data_ready)(struct sock *sk, int bytes);
 	void			(*sk_write_space)(struct sock *sk);
@@ -421,6 +433,44 @@ static inline int sk_acceptq_is_full(struct sock *sk)
 	return sk->sk_ack_backlog > sk->sk_max_ack_backlog;
 }
 
+/*
+ * Compute minimal free write space needed to queue new packets.
+ */
+static inline int sk_stream_min_wspace(struct sock *sk)
+{
+	return sk->sk_wmem_queued / 2;
+}
+
+static inline int sk_stream_wspace(struct sock *sk)
+{
+	return sk->sk_sndbuf - sk->sk_wmem_queued;
+}
+
+extern void sk_stream_write_space(struct sock *sk);
+
+static inline int sk_stream_memory_free(struct sock *sk)
+{
+	return sk->sk_wmem_queued < sk->sk_sndbuf;
+}
+
+extern void sk_stream_rfree(struct sk_buff *skb);
+
+static inline void sk_stream_set_owner_r(struct sk_buff *skb, struct sock *sk)
+{
+	skb->sk = sk;
+	skb->destructor = sk_stream_rfree;
+	atomic_add(skb->truesize, &sk->sk_rmem_alloc);
+	sk->sk_forward_alloc -= skb->truesize;
+}
+
+static inline void sk_stream_free_skb(struct sock *sk, struct sk_buff *skb)
+{
+	sk->sk_queue_shrunk   = 1;
+	sk->sk_wmem_queued   -= skb->truesize;
+	sk->sk_forward_alloc += skb->truesize;
+	__kfree_skb(skb);
+}
+
 /* The per-socket spinlock must be held here. */
 #define sk_add_backlog(__sk, __skb)				\
 do {	if (!(__sk)->sk_backlog.tail) {				\
@@ -445,9 +495,15 @@ do {	if (!(__sk)->sk_backlog.tail) {				\
 	rc;							\
 })
 
+extern int sk_stream_wait_connect(struct sock *sk, long *timeo_p);
+extern int sk_stream_wait_memory(struct sock *sk, long *timeo_p);
+extern void sk_stream_wait_close(struct sock *sk, long timeo_p);
+extern int sk_stream_error(struct sock *sk, int flags, int err);
+extern void sk_stream_kill_queues(struct sock *sk);
+
 extern int sk_wait_data(struct sock *sk, long *timeo);
 
-/* IP protocol blocks we attach to sockets.
+/* Networking protocol blocks we attach to sockets.
  * socket layer -> transport layer interface
  * transport -> network interface is defined by struct inet_proto
  */
@@ -491,6 +547,22 @@ struct proto {
 	void			(*unhash)(struct sock *sk);
 	int			(*get_port)(struct sock *sk, unsigned short snum);
 
+	/* Memory pressure */
+	void			(*enter_memory_pressure)(void);
+	atomic_t		*memory_allocated;	/* Current allocated memory. */
+	atomic_t		*sockets_allocated;	/* Current number of sockets. */
+	/*
+	 * Pressure flag: try to collapse.
+	 * Technical note: it is used by multiple contexts non atomically.
+	 * All the sk_stream_mem_schedule() is of this nature: accounting
+	 * is strict, actions are advisory and have some latency.
+	 */
+	int			*memory_pressure;
+	int			*sysctl_mem;
+	int			*sysctl_wmem;
+	int			*sysctl_rmem;
+	int			max_header;
+
 	char			name[32];
 
 	struct {
@@ -553,17 +625,17 @@ struct sock_iocb {
 	struct scm_cookie	*scm;
 	struct msghdr		*msg, async_msg;
 	struct iovec		async_iov;
+	struct kiocb		*kiocb;
 };
 
 static inline struct sock_iocb *kiocb_to_siocb(struct kiocb *iocb)
 {
-	BUG_ON(sizeof(struct sock_iocb) > KIOCB_PRIVATE_SIZE);
 	return (struct sock_iocb *)iocb->private;
 }
 
 static inline struct kiocb *siocb_to_kiocb(struct sock_iocb *si)
 {
-	return container_of((void *)si, struct kiocb, private);
+	return si->kiocb;
 }
 
 struct socket_alloc {
@@ -581,6 +653,37 @@ static inline struct inode *SOCK_INODE(struct socket *socket)
 	return &container_of(socket, struct socket_alloc, socket)->vfs_inode;
 }
 
+extern void __sk_stream_mem_reclaim(struct sock *sk);
+extern int sk_stream_mem_schedule(struct sock *sk, int size, int kind);
+
+#define SK_STREAM_MEM_QUANTUM ((int)PAGE_SIZE)
+
+static inline int sk_stream_pages(int amt)
+{
+	return (amt + SK_STREAM_MEM_QUANTUM - 1) / SK_STREAM_MEM_QUANTUM;
+}
+
+static inline void sk_stream_mem_reclaim(struct sock *sk)
+{
+	if (sk->sk_forward_alloc >= SK_STREAM_MEM_QUANTUM)
+		__sk_stream_mem_reclaim(sk);
+}
+
+static inline void sk_stream_writequeue_purge(struct sock *sk)
+{
+	struct sk_buff *skb;
+
+	while ((skb = __skb_dequeue(&sk->sk_write_queue)) != NULL)
+		sk_stream_free_skb(sk, skb);
+	sk_stream_mem_reclaim(sk);
+}
+
+static inline int sk_stream_rmem_schedule(struct sock *sk, struct sk_buff *skb)
+{
+	return (int)skb->truesize <= sk->sk_forward_alloc ||
+		sk_stream_mem_schedule(sk, skb->truesize, 1);
+}
+
 /* Used by processes to "lock" a socket state, so that
  * interrupts and bottom half handlers won't change it
  * from under us. It essentially blocks any incoming
@@ -675,6 +778,19 @@ extern ssize_t			sock_no_sendpage(struct socket *sock,
 						int offset, size_t size, 
 						int flags);
 
+/*
+ * Functions to fill in entries in struct proto_ops when a protocol
+ * uses the inet style.
+ */
+extern int sock_common_getsockopt(struct socket *sock, int level, int optname,
+				  char __user *optval, int __user *optlen);
+extern int sock_common_recvmsg(struct kiocb *iocb, struct socket *sock,
+			       struct msghdr *msg, size_t size, int flags);
+extern int sock_common_setsockopt(struct socket *sock, int level, int optname,
+				  char __user *optval, int optlen);
+
+extern void sk_common_release(struct sock *sk);
+
 /*
  *	Default socket callbacks and setup code
  */
@@ -809,25 +925,8 @@ static inline void sock_graft(struct sock *sk, struct socket *parent)
 	write_unlock_bh(&sk->sk_callback_lock);
 }
 
-static inline int sock_i_uid(struct sock *sk)
-{
-	int uid;
-
-	read_lock(&sk->sk_callback_lock);
-	uid = sk->sk_socket ? SOCK_INODE(sk->sk_socket)->i_uid : 0;
-	read_unlock(&sk->sk_callback_lock);
-	return uid;
-}
-
-static inline unsigned long sock_i_ino(struct sock *sk)
-{
-	unsigned long ino;
-
-	read_lock(&sk->sk_callback_lock);
-	ino = sk->sk_socket ? SOCK_INODE(sk->sk_socket)->i_ino : 0;
-	read_unlock(&sk->sk_callback_lock);
-	return ino;
-}
+extern int sock_i_uid(struct sock *sk);
+extern unsigned long sock_i_ino(struct sock *sk);
 
 static inline struct dst_entry *
 __sk_dst_get(struct sock *sk)
@@ -910,6 +1009,34 @@ sk_dst_check(struct sock *sk, u32 cookie)
 	return dst;
 }
 
+static inline void sk_charge_skb(struct sock *sk, struct sk_buff *skb)
+{
+	sk->sk_wmem_queued   += skb->truesize;
+	sk->sk_forward_alloc -= skb->truesize;
+}
+
+static inline int skb_copy_to_page(struct sock *sk, char __user *from,
+				   struct sk_buff *skb, struct page *page,
+				   int off, int copy)
+{
+	if (skb->ip_summed == CHECKSUM_NONE) {
+		int err = 0;
+		unsigned int csum = csum_and_copy_from_user(from,
+						     page_address(page) + off,
+							    copy, 0, &err);
+		if (err)
+			return err;
+		skb->csum = csum_block_add(skb->csum, csum, skb->len);
+	} else if (copy_from_user(page_address(page) + off, from, copy))
+		return -EFAULT;
+
+	skb->len	     += copy;
+	skb->data_len	     += copy;
+	skb->truesize	     += copy;
+	sk->sk_wmem_queued   += copy;
+	sk->sk_forward_alloc -= copy;
+	return 0;
+}
 
 /*
  * 	Queue a received datagram if it will fit. Stream and sequenced
@@ -1026,10 +1153,64 @@ static inline void sk_wake_async(struct sock *sk, int how, int band)
 #define SOCK_MIN_SNDBUF 2048
 #define SOCK_MIN_RCVBUF 256
 
+static inline void sk_stream_moderate_sndbuf(struct sock *sk)
+{
+	if (!(sk->sk_userlocks & SOCK_SNDBUF_LOCK)) {
+		sk->sk_sndbuf = min(sk->sk_sndbuf, sk->sk_wmem_queued / 2);
+		sk->sk_sndbuf = max(sk->sk_sndbuf, SOCK_MIN_SNDBUF);
+	}
+}
+
+static inline struct sk_buff *sk_stream_alloc_pskb(struct sock *sk,
+						   int size, int mem, int gfp)
+{
+	struct sk_buff *skb = alloc_skb(size + sk->sk_prot->max_header, gfp);
+
+	if (skb) {
+		skb->truesize += mem;
+		if (sk->sk_forward_alloc >= (int)skb->truesize ||
+		    sk_stream_mem_schedule(sk, skb->truesize, 0)) {
+			skb_reserve(skb, sk->sk_prot->max_header);
+			return skb;
+		}
+		__kfree_skb(skb);
+	} else {
+		sk->sk_prot->enter_memory_pressure();
+		sk_stream_moderate_sndbuf(sk);
+	}
+	return NULL;
+}
+
+static inline struct sk_buff *sk_stream_alloc_skb(struct sock *sk,
+						  int size, int gfp)
+{
+	return sk_stream_alloc_pskb(sk, size, 0, gfp);
+}
+
+static inline struct page *sk_stream_alloc_page(struct sock *sk)
+{
+	struct page *page = NULL;
+
+	if (sk->sk_forward_alloc >= (int)PAGE_SIZE ||
+	    sk_stream_mem_schedule(sk, PAGE_SIZE, 0))
+		page = alloc_pages(sk->sk_allocation, 0);
+	else {
+		sk->sk_prot->enter_memory_pressure();
+		sk_stream_moderate_sndbuf(sk);
+	}
+	return page;
+}
+
+#define sk_stream_for_retrans_queue(skb, sk)				\
+		for (skb = (sk)->sk_write_queue.next;			\
+		     (skb != (sk)->sk_send_head) &&			\
+		     (skb != (struct sk_buff *)&(sk)->sk_write_queue);	\
+		     skb = skb->next)
+
 /*
  *	Default write policy as shown to user space via poll/select/SIGIO
  */
-static inline int sock_writeable(struct sock *sk) 
+static inline int sock_writeable(const struct sock *sk) 
 {
 	return atomic_read(&sk->sk_wmem_alloc) < (sk->sk_sndbuf / 2);
 }
@@ -1039,17 +1220,17 @@ static inline int gfp_any(void)
 	return in_softirq() ? GFP_ATOMIC : GFP_KERNEL;
 }
 
-static inline long sock_rcvtimeo(struct sock *sk, int noblock)
+static inline long sock_rcvtimeo(const struct sock *sk, int noblock)
 {
 	return noblock ? 0 : sk->sk_rcvtimeo;
 }
 
-static inline long sock_sndtimeo(struct sock *sk, int noblock)
+static inline long sock_sndtimeo(const struct sock *sk, int noblock)
 {
 	return noblock ? 0 : sk->sk_sndtimeo;
 }
 
-static inline int sock_rcvlowat(struct sock *sk, int waitall, int len)
+static inline int sock_rcvlowat(const struct sock *sk, int waitall, int len)
 {
 	return (waitall ? len : min_t(int, sk->sk_rcvlowat, len)) ? : 1;
 }
diff --git a/include/net/tcp.h b/include/net/tcp.h
index 394c40479..75740eaa4 100644
--- a/include/net/tcp.h
+++ b/include/net/tcp.h
@@ -33,6 +33,7 @@
 #include <net/checksum.h>
 #include <net/sock.h>
 #include <net/snmp.h>
+#include <net/ip.h>
 #if defined(CONFIG_IPV6) || defined (CONFIG_IPV6_MODULE)
 #include <linux/ipv6.h>
 #endif
@@ -275,20 +276,20 @@ static __inline__ int tw_del_dead_node(struct tcp_tw_bucket *tw)
 
 #define tcptw_sk(__sk)	((struct tcp_tw_bucket *)(__sk))
 
-static inline const u32 tcp_v4_rcv_saddr(const struct sock *sk)
+static inline u32 tcp_v4_rcv_saddr(const struct sock *sk)
 {
 	return likely(sk->sk_state != TCP_TIME_WAIT) ?
 		inet_sk(sk)->rcv_saddr : tcptw_sk(sk)->tw_rcv_saddr;
 }
 
 #if defined(CONFIG_IPV6) || defined(CONFIG_IPV6_MODULE)
-static inline const struct in6_addr *__tcp_v6_rcv_saddr(const struct sock *sk)
+static inline struct in6_addr *__tcp_v6_rcv_saddr(const struct sock *sk)
 {
 	return likely(sk->sk_state != TCP_TIME_WAIT) ?
 		&inet6_sk(sk)->rcv_saddr : &tcptw_sk(sk)->tw_v6_rcv_saddr;
 }
 
-static inline const struct in6_addr *tcp_v6_rcv_saddr(const struct sock *sk)
+static inline struct in6_addr *tcp_v6_rcv_saddr(const struct sock *sk)
 {
 	return sk->sk_family == AF_INET6 ? __tcp_v6_rcv_saddr(sk) : NULL;
 }
@@ -874,7 +875,6 @@ extern void			tcp_close(struct sock *sk,
 					  long timeout);
 extern struct sock *		tcp_accept(struct sock *sk, int flags, int *err);
 extern unsigned int		tcp_poll(struct file * file, struct socket *sock, struct poll_table_struct *wait);
-extern void			tcp_write_space(struct sock *sk); 
 
 extern int			tcp_getsockopt(struct sock *sk, int level, 
 					       int optname,
@@ -1040,7 +1040,7 @@ static inline void tcp_reset_xmit_timer(struct sock *sk, int what, unsigned long
 		break;
 
 	default:
-		printk(KERN_DEBUG "bug: unknown timer value\n");
+		printk(timer_bug_msg);
 	};
 }
 
@@ -1190,30 +1190,8 @@ struct tcp_skb_cb {
 
 #define TCP_SKB_CB(__skb)	((struct tcp_skb_cb *)&((__skb)->cb[0]))
 
-#define for_retrans_queue(skb, sk, tp) \
-		for (skb = (sk)->sk_write_queue.next;			\
-		     (skb != (tp)->send_head) &&			\
-		     (skb != (struct sk_buff *)&(sk)->sk_write_queue);	\
-		     skb=skb->next)
-
-
 #include <net/tcp_ecn.h>
 
-
-/*
- *	Compute minimal free write space needed to queue new packets. 
- */
-static inline int tcp_min_write_space(struct sock *sk)
-{
-	return sk->sk_wmem_queued / 2;
-}
- 
-static inline int tcp_wspace(struct sock *sk)
-{
-	return sk->sk_sndbuf - sk->sk_wmem_queued;
-}
-
-
 /* This determines how many packets are "in the network" to the best
  * of our knowledge.  In many cases it is conservative, but where
  * detailed information is available from the receiver (via SACK
@@ -1419,7 +1397,7 @@ tcp_nagle_check(struct tcp_opt *tp, struct sk_buff *skb, unsigned mss_now, int n
 		  tcp_minshall_check(tp))));
 }
 
-/* This checks if the data bearing packet SKB (usually tp->send_head)
+/* This checks if the data bearing packet SKB (usually sk->sk_send_head)
  * should be put on the wire right now.
  */
 static __inline__ int tcp_snd_test(struct tcp_opt *tp, struct sk_buff *skb,
@@ -1476,7 +1454,7 @@ static __inline__ void __tcp_push_pending_frames(struct sock *sk,
 						 unsigned cur_mss,
 						 int nonagle)
 {
-	struct sk_buff *skb = tp->send_head;
+	struct sk_buff *skb = sk->sk_send_head;
 
 	if (skb) {
 		if (!tcp_skb_is_last(sk, skb))
@@ -1496,7 +1474,7 @@ static __inline__ void tcp_push_pending_frames(struct sock *sk,
 
 static __inline__ int tcp_may_send_now(struct sock *sk, struct tcp_opt *tp)
 {
-	struct sk_buff *skb = tp->send_head;
+	struct sk_buff *skb = sk->sk_send_head;
 
 	return (skb &&
 		tcp_snd_test(tp, skb, tcp_current_mss(sk, 1),
@@ -1569,7 +1547,7 @@ static __inline__ int tcp_prequeue(struct sock *sk, struct sk_buff *skb)
 
 			while ((skb1 = __skb_dequeue(&tp->ucopy.prequeue)) != NULL) {
 				sk->sk_backlog_rcv(sk, skb1);
-				NET_INC_STATS_BH(TCPPrequeueDropped);
+				NET_INC_STATS_BH(LINUX_MIB_TCPPREQUEUEDROPPED);
 			}
 
 			tp->ucopy.memory = 0;
@@ -1601,12 +1579,12 @@ static __inline__ void tcp_set_state(struct sock *sk, int state)
 	switch (state) {
 	case TCP_ESTABLISHED:
 		if (oldstate != TCP_ESTABLISHED)
-			TCP_INC_STATS(TcpCurrEstab);
+			TCP_INC_STATS(TCP_MIB_CURRESTAB);
 		break;
 
 	case TCP_CLOSE:
 		if (oldstate == TCP_CLOSE_WAIT || oldstate == TCP_ESTABLISHED)
-			TCP_INC_STATS(TcpEstabResets);
+			TCP_INC_STATS(TCP_MIB_ESTABRESETS);
 
 		sk->sk_prot->unhash(sk);
 		if (tcp_sk(sk)->bind_hash &&
@@ -1615,7 +1593,7 @@ static __inline__ void tcp_set_state(struct sock *sk, int state)
 		/* fall through */
 	default:
 		if (oldstate==TCP_ESTABLISHED)
-			TCP_DEC_STATS(TcpCurrEstab);
+			TCP_DEC_STATS(TCP_MIB_CURRESTAB);
 	}
 
 	/* Change state AFTER socket is unhashed to avoid closed
@@ -1893,102 +1871,7 @@ static __inline__ void tcp_openreq_init(struct open_request *req,
 	req->rmt_port = skb->h.th->source;
 }
 
-#define TCP_MEM_QUANTUM	((int)PAGE_SIZE)
-
-static inline void tcp_free_skb(struct sock *sk, struct sk_buff *skb)
-{
-	tcp_sk(sk)->queue_shrunk = 1;
-	sk->sk_wmem_queued -= skb->truesize;
-	sk->sk_forward_alloc += skb->truesize;
-	__kfree_skb(skb);
-}
-
-static inline void tcp_charge_skb(struct sock *sk, struct sk_buff *skb)
-{
-	sk->sk_wmem_queued += skb->truesize;
-	sk->sk_forward_alloc -= skb->truesize;
-}
-
-extern void __tcp_mem_reclaim(struct sock *sk);
-extern int tcp_mem_schedule(struct sock *sk, int size, int kind);
-
-static inline void tcp_mem_reclaim(struct sock *sk)
-{
-	if (sk->sk_forward_alloc >= TCP_MEM_QUANTUM)
-		__tcp_mem_reclaim(sk);
-}
-
-static inline void tcp_enter_memory_pressure(void)
-{
-	if (!tcp_memory_pressure) {
-		NET_INC_STATS(TCPMemoryPressures);
-		tcp_memory_pressure = 1;
-	}
-}
-
-static inline void tcp_moderate_sndbuf(struct sock *sk)
-{
-	if (!(sk->sk_userlocks & SOCK_SNDBUF_LOCK)) {
-		sk->sk_sndbuf = min(sk->sk_sndbuf, sk->sk_wmem_queued / 2);
-		sk->sk_sndbuf = max(sk->sk_sndbuf, SOCK_MIN_SNDBUF);
-	}
-}
-
-static inline struct sk_buff *tcp_alloc_pskb(struct sock *sk, int size, int mem, int gfp)
-{
-	struct sk_buff *skb = alloc_skb(size+MAX_TCP_HEADER, gfp);
-
-	if (skb) {
-		skb->truesize += mem;
-		if (sk->sk_forward_alloc >= (int)skb->truesize ||
-		    tcp_mem_schedule(sk, skb->truesize, 0)) {
-			skb_reserve(skb, MAX_TCP_HEADER);
-			return skb;
-		}
-		__kfree_skb(skb);
-	} else {
-		tcp_enter_memory_pressure();
-		tcp_moderate_sndbuf(sk);
-	}
-	return NULL;
-}
-
-static inline struct sk_buff *tcp_alloc_skb(struct sock *sk, int size, int gfp)
-{
-	return tcp_alloc_pskb(sk, size, 0, gfp);
-}
-
-static inline struct page * tcp_alloc_page(struct sock *sk)
-{
-	if (sk->sk_forward_alloc >= (int)PAGE_SIZE ||
-	    tcp_mem_schedule(sk, PAGE_SIZE, 0)) {
-		struct page *page = alloc_pages(sk->sk_allocation, 0);
-		if (page)
-			return page;
-	}
-	tcp_enter_memory_pressure();
-	tcp_moderate_sndbuf(sk);
-	return NULL;
-}
-
-static inline void tcp_writequeue_purge(struct sock *sk)
-{
-	struct sk_buff *skb;
-
-	while ((skb = __skb_dequeue(&sk->sk_write_queue)) != NULL)
-		tcp_free_skb(sk, skb);
-	tcp_mem_reclaim(sk);
-}
-
-extern void tcp_rfree(struct sk_buff *skb);
-
-static inline void tcp_set_owner_r(struct sk_buff *skb, struct sock *sk)
-{
-	skb->sk = sk;
-	skb->destructor = tcp_rfree;
-	atomic_add(skb->truesize, &sk->sk_rmem_alloc);
-	sk->sk_forward_alloc -= skb->truesize;
-}
+extern void tcp_enter_memory_pressure(void);
 
 extern void tcp_listen_wlock(void);
 
@@ -2074,18 +1957,18 @@ static inline int tcp_use_frto(const struct sock *sk)
 	 * unsent new data, and the advertised window should allow
 	 * sending it.
 	 */
-	return (sysctl_tcp_frto && tp->send_head &&
-		!after(TCP_SKB_CB(tp->send_head)->end_seq,
+	return (sysctl_tcp_frto && sk->sk_send_head &&
+		!after(TCP_SKB_CB(sk->sk_send_head)->end_seq,
 		       tp->snd_una + tp->snd_wnd));
 }
 
 static inline void tcp_mib_init(void)
 {
 	/* See RFC 2012 */
-	TCP_ADD_STATS_USER(TcpRtoAlgorithm, 1);
-	TCP_ADD_STATS_USER(TcpRtoMin, TCP_RTO_MIN*1000/HZ);
-	TCP_ADD_STATS_USER(TcpRtoMax, TCP_RTO_MAX*1000/HZ);
-	TCP_ADD_STATS_USER(TcpMaxConn, -1);
+	TCP_ADD_STATS_USER(TCP_MIB_RTOALGORITHM, 1);
+	TCP_ADD_STATS_USER(TCP_MIB_RTOMIN, TCP_RTO_MIN*1000/HZ);
+	TCP_ADD_STATS_USER(TCP_MIB_RTOMAX, TCP_RTO_MAX*1000/HZ);
+	TCP_ADD_STATS_USER(TCP_MIB_MAXCONN, -1);
 }
 
 /* /proc */
diff --git a/include/net/udp.h b/include/net/udp.h
index 12d5d7ef6..2ef99a71b 100644
--- a/include/net/udp.h
+++ b/include/net/udp.h
@@ -64,8 +64,6 @@ extern struct proto udp_prot;
 
 
 extern void	udp_err(struct sk_buff *, u32);
-extern int	udp_connect(struct sock *sk,
-			    struct sockaddr *usin, int addr_len);
 
 extern int	udp_sendmsg(struct kiocb *iocb, struct sock *sk,
 			    struct msghdr *msg, size_t len);
diff --git a/include/net/xfrm.h b/include/net/xfrm.h
index 647049685..aaf74999a 100644
--- a/include/net/xfrm.h
+++ b/include/net/xfrm.h
@@ -497,10 +497,6 @@ xfrm_selector_match(struct xfrm_selector *sel, struct flowi *fl,
 	return 0;
 }
 
-/* placeholder until xfrm6_tunnel.c is written */
-static inline int xfrm6_tunnel_check_size(struct sk_buff *skb)
-{ return 0; }
-
 /* A struct encoding bundle of transformations to apply to some set of flow.
  *
  * dst->child points to the next element of bundle.
@@ -783,6 +779,12 @@ struct xfrm_tunnel {
 	void (*err_handler)(struct sk_buff *skb, void *info);
 };
 
+struct xfrm6_tunnel {
+	int (*handler)(struct sk_buff **pskb, unsigned int *nhoffp);
+	void (*err_handler)(struct sk_buff *skb, struct inet6_skb_parm *opt,
+			    int type, int code, int offset, __u32 info);
+};
+
 extern void xfrm_init(void);
 extern void xfrm4_init(void);
 extern void xfrm4_fini(void);
@@ -793,6 +795,8 @@ extern void xfrm4_state_init(void);
 extern void xfrm4_state_fini(void);
 extern void xfrm6_state_init(void);
 extern void xfrm6_state_fini(void);
+extern void xfrm6_tunnel_init(void);
+extern void xfrm6_tunnel_fini(void);
 
 extern int xfrm_state_walk(u8 proto, int (*func)(struct xfrm_state *, int, void*), void *);
 extern struct xfrm_state *xfrm_state_alloc(void);
@@ -812,12 +816,18 @@ extern void xfrm_state_flush(u8 proto);
 extern int xfrm_replay_check(struct xfrm_state *x, u32 seq);
 extern void xfrm_replay_advance(struct xfrm_state *x, u32 seq);
 extern int xfrm_check_selectors(struct xfrm_state **x, int n, struct flowi *fl);
-extern int xfrm_check_output(struct xfrm_state *x, struct sk_buff *skb, unsigned short family);
+extern int xfrm_state_check(struct xfrm_state *x, struct sk_buff *skb);
 extern int xfrm4_rcv(struct sk_buff *skb);
+extern int xfrm4_output(struct sk_buff **pskb);
 extern int xfrm4_tunnel_register(struct xfrm_tunnel *handler);
 extern int xfrm4_tunnel_deregister(struct xfrm_tunnel *handler);
-extern int xfrm4_tunnel_check_size(struct sk_buff *skb);
 extern int xfrm6_rcv(struct sk_buff **pskb, unsigned int *nhoffp);
+extern int xfrm6_tunnel_register(struct xfrm6_tunnel *handler);
+extern int xfrm6_tunnel_deregister(struct xfrm6_tunnel *handler);
+extern u32 xfrm6_tunnel_alloc_spi(xfrm_address_t *saddr);
+extern void xfrm6_tunnel_free_spi(xfrm_address_t *saddr);
+extern u32 xfrm6_tunnel_spi_lookup(xfrm_address_t *saddr);
+extern int xfrm6_output(struct sk_buff **pskb);
 
 #ifdef CONFIG_XFRM
 extern int xfrm4_rcv_encap(struct sk_buff *skb, __u16 encap_type);
diff --git a/include/pcmcia/cs_types.h b/include/pcmcia/cs_types.h
index 3a0f7476d..abc32897e 100644
--- a/include/pcmcia/cs_types.h
+++ b/include/pcmcia/cs_types.h
@@ -36,7 +36,7 @@
 #include <sys/types.h>
 #endif
 
-#ifdef __arm__
+#if defined(__arm__) || defined(__mips__)
 typedef u_int   ioaddr_t;
 #else
 typedef u_short	ioaddr_t;
diff --git a/include/pcmcia/ss.h b/include/pcmcia/ss.h
index c45bed631..4df622f6d 100644
--- a/include/pcmcia/ss.h
+++ b/include/pcmcia/ss.h
@@ -105,6 +105,7 @@ typedef struct pccard_mem_map {
     u_short	speed;
     u_long	sys_start, sys_stop;
     u_int	card_start;
+    struct resource *res;
 } pccard_mem_map;
 
 typedef struct cb_bridge_map {
@@ -154,8 +155,6 @@ typedef struct window_t {
 	u_short			index;
 	client_handle_t		handle;
 	struct pcmcia_socket 	*sock;
-	u_long			base;
-	u_long			size;
 	pccard_mem_map		ctl;
 } window_t;
 
diff --git a/include/rxrpc/call.h b/include/rxrpc/call.h
index 9f0ce416a..2620d1921 100644
--- a/include/rxrpc/call.h
+++ b/include/rxrpc/call.h
@@ -204,7 +204,7 @@ extern int rxrpc_call_read_data(struct rxrpc_call *call, void *buffer, size_t si
 
 extern int rxrpc_call_write_data(struct rxrpc_call *call,
 				 size_t sioc,
-				 struct iovec siov[],
+				 struct kvec *siov,
 				 uint8_t rxhdr_flags,
 				 int alloc_flags,
 				 int dup_data,
diff --git a/include/rxrpc/message.h b/include/rxrpc/message.h
index d5755c6db..3a59df687 100644
--- a/include/rxrpc/message.h
+++ b/include/rxrpc/message.h
@@ -44,7 +44,7 @@ struct rxrpc_message
 	int			dcount;		/* data part count */
 	size_t			dsize;		/* data size */
 #define RXRPC_MSG_MAX_IOCS 8
-	struct iovec		data[RXRPC_MSG_MAX_IOCS]; /* message data */
+	struct kvec		data[RXRPC_MSG_MAX_IOCS]; /* message data */
 	unsigned long		dfree;		/* bit mask indicating kfree(data[x]) if T */
 };
 
@@ -62,7 +62,7 @@ extern int rxrpc_conn_newmsg(struct rxrpc_connection *conn,
 			     struct rxrpc_call *call,
 			     uint8_t type,
 			     int count,
-			     struct iovec diov[],
+			     struct kvec *diov,
 			     int alloc_flags,
 			     struct rxrpc_message **_msg);
 
diff --git a/include/scsi/scsi.h b/include/scsi/scsi.h
index ef5ef24cd..1c6d29384 100644
--- a/include/scsi/scsi.h
+++ b/include/scsi/scsi.h
@@ -214,25 +214,25 @@ static inline int scsi_status_is_good(int status)
  */
 
 struct ccs_modesel_head {
-	u8 _r1;			/* reserved */
-	u8 medium;		/* device-specific medium type */
-	u8 _r2;			/* reserved */
-	u8 block_desc_length;	/* block descriptor length */
-	u8 density;		/* device-specific density code */
-	u8 number_blocks_hi;	/* number of blocks in this block desc */
-	u8 number_blocks_med;
-	u8 number_blocks_lo;
-	u8 _r3;
-	u8 block_length_hi;	/* block length for blocks in this desc */
-	u8 block_length_med;
-	u8 block_length_lo;
+	__u8 _r1;			/* reserved */
+	__u8 medium;		/* device-specific medium type */
+	__u8 _r2;			/* reserved */
+	__u8 block_desc_length;	/* block descriptor length */
+	__u8 density;		/* device-specific density code */
+	__u8 number_blocks_hi;	/* number of blocks in this block desc */
+	__u8 number_blocks_med;
+	__u8 number_blocks_lo;
+	__u8 _r3;
+	__u8 block_length_hi;	/* block length for blocks in this desc */
+	__u8 block_length_med;
+	__u8 block_length_lo;
 };
 
 /*
  * ScsiLun: 8 byte LUN.
  */
 struct scsi_lun {
-	u8 scsi_lun[8];
+	__u8 scsi_lun[8];
 };
 
 /*
diff --git a/include/scsi/scsi_devinfo.h b/include/scsi/scsi_devinfo.h
index 21bf53ace..edf56685b 100644
--- a/include/scsi/scsi_devinfo.h
+++ b/include/scsi/scsi_devinfo.h
@@ -24,4 +24,5 @@
 #define BLIST_REPORTLUN2	0x20000	/* try REPORT_LUNS even for SCSI-2 devs
  					   (if HBA supports more than 8 LUNs) */
 #define BLIST_NOREPORTLUN	0x40000	/* don't try REPORT_LUNS scan (SCSI-3 devs) */
+#define BLIST_NOT_LOCKABLE	0x80000	/* don't use PREVENT-ALLOW commands */
 #endif
diff --git a/include/scsi/scsi_eh.h b/include/scsi/scsi_eh.h
index 9bfb4ac7e..887601dc6 100644
--- a/include/scsi/scsi_eh.h
+++ b/include/scsi/scsi_eh.h
@@ -1,6 +1,10 @@
 #ifndef _SCSI_SCSI_EH_H
 #define _SCSI_SCSI_EH_H
 
+struct scsi_cmnd;
+struct scsi_device;
+struct Scsi_Host;
+
 extern void scsi_add_timer(struct scsi_cmnd *, int,
 			   void (*)(struct scsi_cmnd *));
 extern int scsi_delete_timer(struct scsi_cmnd *);
diff --git a/include/scsi/scsi_host.h b/include/scsi/scsi_host.h
index 84a706599..2d3265c1c 100644
--- a/include/scsi/scsi_host.h
+++ b/include/scsi/scsi_host.h
@@ -30,6 +30,12 @@ struct scsi_transport_template;
 #define DISABLE_CLUSTERING 0
 #define ENABLE_CLUSTERING 1
 
+enum scsi_eh_timer_return {
+	EH_NOT_HANDLED,
+	EH_HANDLED,
+	EH_RESET_TIMER,
+};
+
 
 struct scsi_host_template {
 	struct module *module;
@@ -64,7 +70,7 @@ struct scsi_host_template {
 	 *
 	 * Status: OPTIONAL
 	 */
-	int (* ioctl)(struct scsi_device *dev, int cmd, void *arg);
+	int (* ioctl)(struct scsi_device *dev, int cmd, void __user *arg);
 	
 	/*
 	 * The queuecommand function is used to queue up a scsi
@@ -125,6 +131,20 @@ struct scsi_host_template {
 	int (* eh_bus_reset_handler)(struct scsi_cmnd *);
 	int (* eh_host_reset_handler)(struct scsi_cmnd *);
 
+	/*
+	 * This is an optional routine to notify the host that the scsi
+	 * timer just fired.  The returns tell the timer routine what to
+	 * do about this:
+	 *
+	 * EH_HANDLED:		I fixed the error, please complete the command
+	 * EH_RESET_TIMER:	I need more time, reset the timer and
+	 *			begin counting again
+	 * EH_NOT_HANDLED	Begin normal error recovery
+	 *
+	 * Status: OPTIONAL
+	 */
+	enum scsi_eh_timer_return (* eh_timed_out)(struct scsi_cmnd *);
+
 	/*
 	 * Old EH handlers, no longer used. Make them warn the user of old
 	 * drivers by using a wrong type
@@ -151,7 +171,7 @@ struct scsi_host_template {
 	 * here then you will get a call to slave_configure(), then the
 	 * device will be used for however long it is kept around, then when
 	 * the device is removed from the system (or * possibly at reboot
-	 * time), you will then get a call to slave_detach().  This is
+	 * time), you will then get a call to slave_destroy().  This is
 	 * assuming you implement slave_configure and slave_destroy.
 	 * However, if you allocate memory and hang it off the device struct,
 	 * then you must implement the slave_destroy() routine at a minimum
@@ -185,7 +205,7 @@ struct scsi_host_template {
 	 *     specific setup basis...
 	 * 6.  Return 0 on success, non-0 on error.  The device will be marked
 	 *     as offline on error so that no access will occur.  If you return
-	 *     non-0, your slave_detach routine will never get called for this
+	 *     non-0, your slave_destroy routine will never get called for this
 	 *     device, so don't leave any loose memory hanging around, clean
 	 *     up after yourself before returning non-0
 	 *
@@ -313,6 +333,11 @@ struct scsi_host_template {
 	 */
 	unsigned emulated:1;
 
+	/*
+	 * True if the low-level driver performs its own reset-settle delays.
+	 */
+	unsigned skip_settle_delay:1;
+
 	/*
 	 * Countdown for host blocking with no commands outstanding
 	 */
diff --git a/include/scsi/scsi_ioctl.h b/include/scsi/scsi_ioctl.h
index 688fa25e7..4a46f88e7 100644
--- a/include/scsi/scsi_ioctl.h
+++ b/include/scsi/scsi_ioctl.h
@@ -41,7 +41,6 @@ typedef struct scsi_fctargaddress {
 } Scsi_FCTargAddress;
 
 extern int scsi_ioctl(struct scsi_device *, int, void __user *);
-extern int kernel_scsi_ioctl(struct scsi_device *, int , void *);
 extern int scsi_ioctl_send_command(struct scsi_device *,
 				   struct scsi_ioctl_command __user *);
 
diff --git a/include/scsi/sg.h b/include/scsi/sg.h
index 01bf5b538..0a487fe26 100644
--- a/include/scsi/sg.h
+++ b/include/scsi/sg.h
@@ -1,6 +1,8 @@
 #ifndef _SCSI_GENERIC_H
 #define _SCSI_GENERIC_H
 
+#include <linux/compiler.h>
+
 /*
    History:
     Started: Aug 9 by Lawrence Foard (entropy@world.std.com), to allow user
@@ -76,7 +78,7 @@ Major new features in SG 3.x driver (cf SG 2.x drivers)
 	http://www.torque.net/sg/p/scsi-generic_long.txt
  A version of this document (potentially out of date) may also be found in
  the kernel source tree, probably at:
-        /usr/src/linux/Documentation/scsi/scsi-generic.txt .
+        Documentation/scsi/scsi-generic.txt .
 
  Utility and test programs are available at the sg web site. They are 
  bundled as sg_utils (for the lk 2.2 series) and sg3_utils (for the
diff --git a/include/sound/asound.h b/include/sound/asound.h
index 69dc1829e..23b27b73a 100644
--- a/include/sound/asound.h
+++ b/include/sound/asound.h
@@ -33,13 +33,15 @@
 #include <linux/time.h>
 #include <asm/byteorder.h>
 
-#if  __LITTLE_ENDIAN == 1234
+#ifdef  __LITTLE_ENDIAN
 #define SNDRV_LITTLE_ENDIAN
-#elif __BIG_ENDIAN == 4321
+#else
+#ifdef __BIG_ENDIAN
 #define SNDRV_BIG_ENDIAN
 #else
 #error "Unsupported endian..."
 #endif
+#endif
 
 #else /* !__KERNEL__ */
 
diff --git a/include/sound/info.h b/include/sound/info.h
index 9e33b58b8..29a6b83d1 100644
--- a/include/sound/info.h
+++ b/include/sound/info.h
@@ -54,9 +54,11 @@ struct snd_info_entry_ops {
 	int (*release) (snd_info_entry_t * entry,
 			unsigned short mode, void *file_private_data);
 	long (*read) (snd_info_entry_t *entry, void *file_private_data,
-		      struct file * file, char __user *buf, long count);
+		      struct file * file, char __user *buf,
+		      unsigned long count, unsigned long pos);
 	long (*write) (snd_info_entry_t *entry, void *file_private_data,
-		       struct file * file, const char __user *buf, long count);
+		       struct file * file, const char __user *buf,
+		       unsigned long count, unsigned long pos);
 	long long (*llseek) (snd_info_entry_t *entry, void *file_private_data,
 			    struct file * file, long long offset, int orig);
 	unsigned int (*poll) (snd_info_entry_t *entry, void *file_private_data,
diff --git a/include/video/sisfb.h b/include/video/sisfb.h
index 5d120172d..136bf7916 100644
--- a/include/video/sisfb.h
+++ b/include/video/sisfb.h
@@ -38,7 +38,8 @@
 #define TV_AVIDEO               0x00000100
 #define TV_SVIDEO               0x00000200
 #define TV_SCART                0x00000400
-#define VB_CONEXANT		0x00000800
+#define VB_CONEXANT		0x00000800	/* 661 series only */
+#define VB_TRUMPION		VB_CONEXANT	/* 300 series only */
 #define TV_PALM                 0x00001000
 #define TV_PALN                 0x00002000
 #define TV_NTSCJ		0x00001000
@@ -86,204 +87,112 @@
 #define VB_DISPMODE_DUAL	VB_DUALVIEW_MODE
 #define VB_DISPLAY_MODE       	(SINGLE_MODE | MIRROR_MODE | DUALVIEW_MODE)
 
-/* *Never* change the order of the following enum */
-typedef enum _SIS_CHIP_TYPE {
-	SIS_VGALegacy = 0,	/* chip_id in sisfb_info */
-	SIS_300,
-	SIS_630,
-	SIS_540,
-	SIS_730,
-	SIS_315H,
-	SIS_315,
-	SIS_315PRO,
-	SIS_550,
-	SIS_650,
-	SIS_740,
-	SIS_330,
-	SIS_661,
-	SIS_741,
-	SIS_660,
-	SIS_760,
-	MAX_SIS_CHIP
-} SIS_CHIP_TYPE;
-
-/* Addtional IOCTLs for communication sisfb <> X driver                */
-/* If changing this, vgatypes.h must also be changed (for X driver)    */
-
-/* ioctl for identifying and giving some info (esp. memory heap start) */
-#define SISFB_GET_INFO	  	_IOR('n',0xF8,__u32)
-/* ioctrl to get current vertical retrace status */
-#define SISFB_GET_VBRSTATUS  	_IOR('n',0xF9,__u32)
-/* ioctl to enable/disable panning auto-maximize (like nomax parameter) */
-#define SISFB_GET_AUTOMAXIMIZE 	_IOR('n',0xFA,__u32)
-#define SISFB_SET_AUTOMAXIMIZE 	_IOW('n',0xFA,__u32)
-
-/* TW: Structure argument for SISFB_GET_INFO ioctl  */
+/* Structure argument for SISFB_GET_INFO ioctl  */
 typedef struct _SISFB_INFO sisfb_info, *psisfb_info;
 
 struct _SISFB_INFO {
-	unsigned long sisfb_id;         /* for identifying sisfb */
+	__u32   sisfb_id;         	/* for identifying sisfb */
 #ifndef SISFB_ID
 #define SISFB_ID	  0x53495346    /* Identify myself with 'SISF' */
 #endif
- 	int    chip_id;			/* PCI ID of detected chip */
-	int    memory;			/* video memory in KB which sisfb manages */
-	int    heapstart;               /* heap start (= sisfb "mem" argument) in KB */
-	unsigned char fbvidmode;	/* current sisfb mode */
+ 	__u32   chip_id;		/* PCI-ID of detected chip */
+	__u32   memory;			/* video memory in KB which sisfb manages */
+	__u32   heapstart;            	/* heap start (= sisfb "mem" argument) in KB */
+	__u8    fbvidmode;		/* current sisfb mode */
 
-	unsigned char sisfb_version;
-	unsigned char sisfb_revision;
-	unsigned char sisfb_patchlevel;
+	__u8    sisfb_version;
+	__u8    sisfb_revision;
+	__u8 	sisfb_patchlevel;
 
-	unsigned char sisfb_caps;	/* Sisfb capabilities */
+	__u8 	sisfb_caps;		/* sisfb capabilities */
 
-	int    sisfb_tqlen;		/* turbo queue length (in KB) */
+	__u32	sisfb_tqlen;		/* turbo queue length (in KB) */
 
-	unsigned int sisfb_pcibus;      /* The card's PCI ID */
-	unsigned int sisfb_pcislot;
-	unsigned int sisfb_pcifunc;
+	__u32 	sisfb_pcibus;      	/* The card's PCI ID */
+	__u32 	sisfb_pcislot;
+	__u32 	sisfb_pcifunc;
 
-	unsigned char sisfb_lcdpdc;	/* PanelDelayCompensation */
+	__u8 	sisfb_lcdpdc;		/* PanelDelayCompensation */
 
-	unsigned char sisfb_lcda;	/* Detected status of LCDA for low res/text modes */
+	__u8 	sisfb_lcda;		/* Detected status of LCDA for low res/text modes */
 
-	unsigned long sisfb_vbflags;
-	unsigned long sisfb_currentvbflags;
+	__u32 	sisfb_vbflags;
+	__u32 	sisfb_currentvbflags;
 
-	int sisfb_scalelcd;
-	unsigned long sisfb_specialtiming;
+	__u32 	sisfb_scalelcd;
+	__u32 	sisfb_specialtiming;
 
-	unsigned char sisfb_haveemi;
-	unsigned char sisfb_emi30,sisfb_emi31,sisfb_emi32,sisfb_emi33;
-	unsigned char sisfb_haveemilcd;
+	__u8 	sisfb_haveemi;
+	__u8 	sisfb_emi30,sisfb_emi31,sisfb_emi32,sisfb_emi33;
+	__u8 	sisfb_haveemilcd;
 
-	char reserved[213]; 		/* for future use */
-};
+	__u8 	sisfb_lcdpdca;		/* PanelDelayCompensation for LCD-via-CRT1 */
 
-/* For fb memory manager */
-struct sis_memreq {
-	unsigned long offset;
-	unsigned long size;
-};
+	__u16	sisfb_tvxpos, sisfb_tvypos;  /* Warning: Values + 32 ! */
 
-/* More or less deprecated stuff follows: */
-typedef enum _TVTYPE {
-	TVMODE_NTSC = 0,
-	TVMODE_PAL,
-	TVMODE_HIVISION,
-	TVMODE_TOTAL
-} SIS_TV_TYPE;
-
-typedef enum _TVPLUGTYPE {
-	TVPLUG_Legacy = 0,
-	TVPLUG_COMPOSITE,
-	TVPLUG_SVIDEO,
-	TVPLUG_SCART,
-	TVPLUG_TOTAL
-} SIS_TV_PLUG;
-
-struct mode_info {
-	int    bpp;
-	int    xres;
-	int    yres;
-	int    v_xres;		/* deprecated - use var instead */
-	int    v_yres;		/* deprecated - use var instead */
-	int    org_x;		/* deprecated - use var instead */
-	int    org_y;		/* deprecated - use var instead */
-	unsigned int  vrate;
+	__u8 	reserved[208]; 		/* for future use */
 };
 
-struct ap_data {
-	struct mode_info minfo;
-	unsigned long iobase;
-	unsigned int  mem_size;
-	unsigned long disp_state;  /* deprecated */
-	SIS_CHIP_TYPE chip;
-	unsigned char hasVB;
-	SIS_TV_TYPE TV_type;	   /* deprecated */
-	SIS_TV_PLUG TV_plug;	   /* deprecated */
-	unsigned long version;
-	unsigned long vbflags;	   /* replaces deprecated entries above */
-	unsigned long currentvbflags;
-	char reserved[248];
+/* Addtional IOCTLs for communication sisfb <> X driver                */
+/* If changing this, vgatypes.h must also be changed (for X driver)    */
+
+/* ioctl for identifying and giving some info (esp. memory heap start) */
+#define SISFB_GET_INFO_SIZE  	_IOR(0xF3,0x00,__u32)
+#define SISFB_GET_INFO	  	_IOR(0xF3,0x01,struct _SISFB_INFO)
+
+/* ioctrl to get current vertical retrace status */
+#define SISFB_GET_VBRSTATUS  	_IOR(0xF3,0x02,__u32)
+
+/* ioctl to enable/disable panning auto-maximize (like nomax parameter) */
+#define SISFB_GET_AUTOMAXIMIZE 	_IOR(0xF3,0x03,__u32)
+#define SISFB_SET_AUTOMAXIMIZE 	_IOW(0xF3,0x03,__u32)
+
+/* ioctls to relocate TV output (x=D[31:16], y=D[15:0], + 32)*/
+#define SISFB_GET_TVPOSOFFSET   _IOR(0xF3,0x04,__u32)
+#define SISFB_SET_TVPOSOFFSET   _IOW(0xF3,0x04,__u32)
+
+/* ioctl for locking sisfb (no register access during lock) */
+/* As of now, only used to avoid register access during
+ * the ioctls listed above.
+ */
+#define SISFB_SET_LOCK  	_IOW(0xF3,0x06,__u32)
+
+/* more to come soon */
+
+/* ioctls 0xF3 up to 0x3F reserved for sisfb */
+
+/****************************************************************/
+/* The following are deprecated and should not be used anymore: */
+/****************************************************************/
+/* ioctl for identifying and giving some info (esp. memory heap start) */
+#define SISFB_GET_INFO_OLD  	   _IOR('n',0xF8,__u32)
+/* ioctrl to get current vertical retrace status */
+#define SISFB_GET_VBRSTATUS_OLD	   _IOR('n',0xF9,__u32)
+/* ioctl to enable/disable panning auto-maximize (like nomax parameter) */
+#define SISFB_GET_AUTOMAXIMIZE_OLD _IOR('n',0xFA,__u32)
+#define SISFB_SET_AUTOMAXIMIZE_OLD _IOW('n',0xFA,__u32)
+/****************************************************************/
+/*               End of deprecated ioctl numbers                */
+/****************************************************************/
+
+/* For fb memory manager (FBIO_ALLOC, FBIO_FREE) */
+struct sis_memreq {
+	__u32 	offset;
+	__u32 	size;
 };
 
 /**********************************************/
 /*                  PRIVATE                   */
+/*         (for IN-KERNEL usage only)         */
 /**********************************************/
 
 #ifdef __KERNEL__
-#include <linux/spinlock.h>
-
-typedef enum _VGA_ENGINE {
-	UNKNOWN_VGA = 0,
-	SIS_300_VGA,
-	SIS_315_VGA,
-} VGA_ENGINE;
-
-struct video_info {
-	int           chip_id;
-	unsigned int  video_size;
-	unsigned long video_base;
-	char  *       video_vbase;
-	unsigned long mmio_base;
-	char  *       mmio_vbase;
-	unsigned long vga_base;
-	unsigned long mtrr;
-	unsigned long heapstart;
-
-	int    video_bpp;
-	int    video_cmap_len;
-	int    video_width;
-	int    video_height;
-	int    video_vwidth;			/* DEPRECATED - use var instead */
-	int    video_vheight;			/* DEPRECATED - use var instead */
-	int    org_x;				/* DEPRECATED - use var instead */
-	int    org_y;				/* DEPRECATED - use var instead */
-	int    video_linelength;
-	unsigned int refresh_rate;
-
-	unsigned long disp_state;		/* DEPRECATED */
-	unsigned char hasVB;			/* DEPRECATED */
-	unsigned char TV_type;			/* DEPRECATED */
-	unsigned char TV_plug;			/* DEPRECATED */
-
-	SIS_CHIP_TYPE chip;
-	unsigned char revision_id;
-
-        unsigned short DstColor;		/* For 2d acceleration */
-	unsigned long  SiS310_AccelDepth;
-	unsigned long  CommandReg;
-
-	spinlock_t     lockaccel;		/* Do not use outside of kernel! */
-
-        unsigned int   pcibus;
-	unsigned int   pcislot;
-	unsigned int   pcifunc;
-
-	int 	       accel;
-
-	unsigned short subsysvendor;
-	unsigned short subsysdevice;
-
-	unsigned long  vbflags;			/* Replacing deprecated stuff from above */
-	unsigned long  currentvbflags;
-
-	int    current_bpp;
-	int    current_width;
-	int    current_height;
-	int    current_htotal;
-	int    current_vtotal;
-	__u32  current_pixclock;
-	int    current_refresh_rate;
-
-	char reserved[200];
-};
-
-extern struct video_info ivideo;
+#define	UNKNOWN_VGA  0
+#define	SIS_300_VGA  1
+#define	SIS_315_VGA  2
 
 extern void sis_malloc(struct sis_memreq *req);
-extern void sis_free(unsigned long base);
-extern void sis_dispinfo(struct ap_data *rec);
+extern void sis_free(u32 base);
 #endif
+
 #endif
diff --git a/include/video/sstfb.h b/include/video/sstfb.h
index dd3db8931..8dade38a7 100644
--- a/include/video/sstfb.h
+++ b/include/video/sstfb.h
@@ -72,10 +72,6 @@
 #define BIT(x)		(1ul<<(x))
 #define POW2(x)		(1ul<<(x))
 
-#ifndef ABS
-# define ABS(x)		(((x)<0)?-(x):(x))
-#endif
-
 /*
  *
  *  Const
diff --git a/include/video/vga.h b/include/video/vga.h
index 480c58417..e44593d3c 100644
--- a/include/video/vga.h
+++ b/include/video/vga.h
@@ -26,8 +26,15 @@
 /*
  * FIXME
  * Ugh, we don't have PCI space, so map readb() and friends to use Zorro space
- * for MMIO accesses. This should make clgenfb work again on Amiga
+ * for MMIO accesses. This should make cirrusfb work again on Amiga
  */
+#undef inb_p
+#undef inw_p
+#undef outb_p
+#undef outw
+#undef readb
+#undef writeb
+#undef writew
 #define inb_p(port)	0
 #define inw_p(port)	0
 #define outb_p(port, val)	do { } while (0)
diff --git a/init/Kconfig b/init/Kconfig
index 210ca2cb7..113a656f5 100644
--- a/init/Kconfig
+++ b/init/Kconfig
@@ -41,15 +41,6 @@ config CLEAN_COMPILE
 
 	  If unsure, say Y
 
-config STANDALONE
-	bool "Select only drivers that don't need compile-time external firmware" if EXPERIMENTAL
-	default y
-	help
-	  Select this option if you don't have magic firmware for drivers that
-	  need it.
-
-	  If unsure, say Y.
-
 config BROKEN
 	bool
 	depends on !CLEAN_COMPILE
@@ -77,6 +68,7 @@ config SWAP
 
 config SYSVIPC
 	bool "System V IPC"
+	depends on MMU
 	---help---
 	  Inter Process Communication is a suite of library functions and
 	  system calls which let processes (running programs) synchronize and
@@ -121,6 +113,18 @@ config BSD_PROCESS_ACCT
 	  up to the user level program to do useful things with this
 	  information.  This is generally a good idea, so say Y.
 
+config BSD_PROCESS_ACCT_V3
+	bool "BSD Process Accounting version 3 file format"
+	depends on BSD_PROCESS_ACCT
+	default n
+	help
+	  If you say Y here, the process accounting information is written
+	  in a new file format that also logs the process IDs of each
+	  process and it's parent. Note that this file format is incompatible
+	  with previous v0/v1/v2 file formats, so you will need updated tools
+	  for processing it. A preliminary version of these tools is available
+	  at <http://http://www.de.kernel.org/pub/linux/utils/acct/>.
+
 config SYSCTL
 	bool "Sysctl support"
 	---help---
@@ -149,7 +153,7 @@ config AUDIT
 
 config AUDITSYSCALL
 	bool "Enable system-call auditing support"
-	depends on AUDIT && (X86 || PPC64 || ARCH_S390)
+	depends on AUDIT && (X86 || PPC64 || ARCH_S390 || IA64)
 	default y if SECURITY_SELINUX
 	default n
 	help
@@ -197,26 +201,20 @@ config IKCONFIG
 	bool "Kernel .config support"
 	---help---
 	  This option enables the complete Linux kernel ".config" file
-	  contents, information on compiler used to build the kernel,
-	  kernel running when this kernel was built and kernel version
-	  from Makefile to be saved in the kernel. It provides documentation
+	  contents to be saved in the kernel. It provides documentation
 	  of which kernel options are used in a running kernel or in an
 	  on-disk kernel.  This information can be extracted from the kernel
 	  image file with the script scripts/extract-ikconfig and used as
 	  input to rebuild the current kernel or to build another kernel.
 	  It can also be extracted from a running kernel by reading
-	  /proc/config.gz and /proc/config_built_with, if enabled (below).
-	  /proc/config.gz will list the configuration that was used
-	  to build the kernel and /proc/config_built_with will list
-	  information on the compiler and host machine that was used to
-	  build the kernel.
+	  /proc/config.gz if enabled (below).
 
 config IKCONFIG_PROC
 	bool "Enable access to .config through /proc/config.gz"
 	depends on IKCONFIG && PROC_FS
 	---help---
-	  This option enables access to kernel configuration file and build
-	  information through /proc/config.gz.
+	  This option enables access to the kernel configuration file
+	  through /proc/config.gz.
 
 
 menuconfig EMBEDDED
@@ -246,6 +244,17 @@ config KALLSYMS_ALL
 
 	   Say N.
 
+config KALLSYMS_EXTRA_PASS
+	bool "Do an extra kallsyms pass"
+	depends on KALLSYMS
+	help
+	   If kallsyms is not working correctly, the build will fail with
+	   inconsistent kallsyms data.  If that occurs, log a bug report and
+	   turn on KALLSYMS_EXTRA_PASS which should result in a stable build.
+	   Always say N here unless you find a bug in kallsyms, which must be
+	   reported.  KALLSYMS_EXTRA_PASS is only a temporary workaround while
+	   you wait for kallsyms to be fixed.
+
 config FUTEX
 	bool "Enable futex support" if EMBEDDED
 	default y
diff --git a/init/do_mounts_initrd.c b/init/do_mounts_initrd.c
index e65c2e25d..07e7d31f2 100644
--- a/init/do_mounts_initrd.c
+++ b/init/do_mounts_initrd.c
@@ -58,7 +58,7 @@ static void __init handle_initrd(void)
 
 	pid = kernel_thread(do_linuxrc, "/linuxrc", SIGCHLD);
 	if (pid > 0) {
-		while (pid != sys_wait4(-1, &i, 0, 0))
+		while (pid != sys_wait4(-1, &i, 0, NULL))
 			yield();
 	}
 
diff --git a/init/initramfs.c b/init/initramfs.c
index 40042ef5f..20bd855f6 100644
--- a/init/initramfs.c
+++ b/init/initramfs.c
@@ -169,7 +169,7 @@ static int __init do_collect(void)
 	memcpy(collect, victim, n);
 	eat(n);
 	collect += n;
-	if (remains -= n)
+	if ((remains -= n) != 0)
 		return 1;
 	state = next_state;
 	return 0;
diff --git a/init/main.c b/init/main.c
index 613aaaba8..cafeaeb4e 100644
--- a/init/main.c
+++ b/init/main.c
@@ -43,9 +43,11 @@
 #include <linux/efi.h>
 #include <linux/unistd.h>
 #include <linux/rmap.h>
+#include <linux/mempolicy.h>
 
 #include <asm/io.h>
 #include <asm/bugs.h>
+#include <asm/setup.h>
 
 /*
  * This is one of the first .c files built. Error out early
@@ -110,6 +112,9 @@ extern void time_init(void);
 void (*late_time_init)(void);
 extern void softirq_init(void);
 
+/* Untouched command line (eg. for /proc) saved by arch-specific code. */
+char saved_command_line[COMMAND_LINE_SIZE];
+
 static char *execute_command;
 
 /* Setup configured maximum number of CPUs to activate */
@@ -156,8 +161,14 @@ static int __init obsolete_checksetup(char *line)
 	do {
 		int n = strlen(p->str);
 		if (!strncmp(line, p->str, n)) {
-			if (!p->setup_func) {
-				printk(KERN_WARNING "Parameter %s is obsolete, ignored\n", p->str);
+			if (p->early) {
+				/* Already done in parse_early_param?  (Needs
+				 * exact match on param part) */
+				if (line[n] == '\0' || line[n] == '=')
+					return 1;
+			} else if (!p->setup_func) {
+				printk(KERN_WARNING "Parameter %s is obsolete,"
+				       " ignored\n", p->str);
 				return 1;
 			} else if (p->setup_func(line + n))
 				return 1;
@@ -268,6 +279,8 @@ static int __init unknown_bootoption(char *param, char *val)
 				panic_later = "Too many boot env vars at `%s'";
 				panic_param = param;
 			}
+			if (!strncmp(param, envp_init[i], val - param))
+				break;
 		}
 		envp_init[i] = param;
 	} else {
@@ -385,10 +398,43 @@ static void __init smp_init(void)
 static void noinline rest_init(void)
 {
 	kernel_thread(init, NULL, CLONE_FS | CLONE_SIGHAND);
+	numa_default_policy();
 	unlock_kernel();
  	cpu_idle();
 } 
 
+/* Check for early params. */
+static int __init do_early_param(char *param, char *val)
+{
+	struct obs_kernel_param *p;
+	extern struct obs_kernel_param __setup_start, __setup_end;
+
+	for (p = &__setup_start; p < &__setup_end; p++) {
+		if (p->early && strcmp(param, p->str) == 0) {
+			if (p->setup_func(val) != 0)
+				printk(KERN_WARNING
+				       "Malformed early option '%s'\n", param);
+		}
+	}
+	/* We accept everything at this stage. */
+	return 0;
+}
+
+/* Arch code calls this early on, or if not, just before other parsing. */
+void __init parse_early_param(void)
+{
+	static __initdata int done = 0;
+	static __initdata char tmp_cmdline[COMMAND_LINE_SIZE];
+
+	if (done)
+		return;
+
+	/* All fall through to do_early_param. */
+	strlcpy(tmp_cmdline, saved_command_line, COMMAND_LINE_SIZE);
+	parse_args("early options", tmp_cmdline, NULL, 0, do_early_param);
+	done = 1;
+}
+
 /*
  *	Activate the first processor.
  */
@@ -396,7 +442,6 @@ static void noinline rest_init(void)
 asmlinkage void __init start_kernel(void)
 {
 	char * command_line;
-	extern char saved_command_line[];
 	extern struct kernel_param __start___param[], __stop___param[];
 /*
  * Interrupts are still disabled. Do necessary setups, then
@@ -424,6 +469,7 @@ asmlinkage void __init start_kernel(void)
 	build_all_zonelists();
 	page_alloc_init();
 	printk("Kernel command line: %s\n", saved_command_line);
+	parse_early_param();
 	parse_args("Booting kernel", command_line, __start___param,
 		   __stop___param - __start___param,
 		   &unknown_bootoption);
@@ -454,8 +500,10 @@ asmlinkage void __init start_kernel(void)
 		initrd_start = 0;
 	}
 #endif
+	vfs_caches_init_early();
 	mem_init();
 	kmem_cache_init();
+	numa_policy_init();
 	if (late_time_init)
 		late_time_init();
 	calibrate_delay();
@@ -645,6 +693,7 @@ static int init(void * unused)
 	free_initmem();
 	unlock_kernel();
 	system_state = SYSTEM_RUNNING;
+	numa_default_policy();
 
 	if (sys_open((const char __user *) "/dev/console", O_RDWR, 0) < 0)
 		printk("Warning: unable to open an initial console.\n");
@@ -669,3 +718,16 @@ static int init(void * unused)
 
 	panic("No init found.  Try passing init= option to kernel.");
 }
+
+static int early_param_test(char *rest)
+{
+	printk("early_parm_test: %s\n", rest ?: "(null)");
+	return rest ? 0 : -EINVAL;
+}
+early_param("testsetup", early_param_test);
+static int early_setup_test(char *rest)
+{
+	printk("early_setup_test: %s\n", rest ?: "(null)");
+	return 0;
+}
+__setup("testsetup_long", early_setup_test);
diff --git a/ipc/compat.c b/ipc/compat.c
index 8cbbdc49d..70e4e4e10 100644
--- a/ipc/compat.c
+++ b/ipc/compat.c
@@ -235,24 +235,13 @@ static inline int put_compat_semid_ds(struct semid64_ds *s,
 	return err;
 }
 
-static inline int do_semctl(int semid, int semnum, int cmd, union semun arg)
-{
-	mm_segment_t old_fs;
-	int err;
-
-	old_fs = get_fs();
-	set_fs(KERNEL_DS);
-	err = sys_semctl(semid, semnum, cmd, arg);
-	set_fs(old_fs);
-
-	return err;
-}
 long compat_sys_semctl(int first, int second, int third, void __user *uptr)
 {
 	union semun fourth;
 	u32 pad;
 	int err, err2;
 	struct semid64_ds s64;
+	struct semid64_ds __user *up64;
 	int version = compat_ipc_parse_version(&third);
 
 	if (!uptr)
@@ -279,16 +268,17 @@ long compat_sys_semctl(int first, int second, int third, void __user *uptr)
 
 	case IPC_STAT:
 	case SEM_STAT:
-		fourth.__pad = &s64;
-		err = do_semctl(first, second, third, fourth);
+		up64 = compat_alloc_user_space(sizeof(s64));
+		fourth.__pad = up64;
+		err = sys_semctl(first, second, third, fourth);
 		if (err < 0)
 			break;
-
-		if (version == IPC_64) {
+		if (copy_from_user(&s64, up64, sizeof(s64)))
+			err2 = -EFAULT;
+		else if (version == IPC_64)
 			err2 = put_compat_semid64_ds(&s64, compat_ptr(pad));
-		} else {
+		else
 			err2 = put_compat_semid_ds(&s64, compat_ptr(pad));
-		}
 		if (err2)
 			err = -EFAULT;
 		break;
@@ -299,11 +289,14 @@ long compat_sys_semctl(int first, int second, int third, void __user *uptr)
 		} else {
 			err = get_compat_semid_ds(&s64, compat_ptr(pad));
 		}
+		up64 = compat_alloc_user_space(sizeof(s64));
+		if (copy_to_user(up64, &s64, sizeof(s64)))
+			err = -EFAULT;
 		if (err)
 			break;
 
-		fourth.__pad = &s64;
-		err = do_semctl(first, second, third, fourth);
+		fourth.__pad = up64;
+		err = sys_semctl(first, second, third, fourth);
 		break;
 
 	default:
@@ -315,39 +308,30 @@ long compat_sys_semctl(int first, int second, int third, void __user *uptr)
 
 long compat_sys_msgsnd(int first, int second, int third, void __user *uptr)
 {
-	struct msgbuf *p;
-	struct compat_msgbuf __user *up;
-	mm_segment_t old_fs;
-	int err;
+	struct msgbuf __user *p;
+	struct compat_msgbuf __user *up = uptr;
+	long type;
 
 	if (first < 0)
 		return -EINVAL;
 	if (second < 0 || (second >= MAXBUF - sizeof(struct msgbuf)))
 		return -EINVAL;
 
-	p = kmalloc(second + sizeof(struct msgbuf), GFP_USER);
-	if (!p)
-		return -ENOMEM;
-	err = -EFAULT;
-	up = uptr;
-	if (get_user(p->mtype, &up->mtype) ||
-	    copy_from_user(p->mtext, &up->mtext, second))
-		goto out;
-	old_fs = get_fs();
-	set_fs(KERNEL_DS);
-	err = sys_msgsnd(first, p, second, third);
-	set_fs(old_fs);
-out:
-	kfree(p);
-	return err;
+	p = compat_alloc_user_space(second + sizeof(struct msgbuf));
+	if (get_user(type, &up->mtype) ||
+	    put_user(type, &p->mtype) ||
+	    copy_in_user(p->mtext, up->mtext, second))
+		return -EFAULT;
+
+	return sys_msgsnd(first, p, second, third);
 }
 
 long compat_sys_msgrcv(int first, int second, int msgtyp, int third,
 			   int version, void __user *uptr)
 {
-	struct msgbuf *p;
+	struct msgbuf __user *p;
 	struct compat_msgbuf __user *up;
-	mm_segment_t old_fs;
+	long type;
 	int err;
 
 	if (first < 0)
@@ -356,34 +340,25 @@ long compat_sys_msgrcv(int first, int second, int msgtyp, int third,
 		return -EINVAL;
 
 	if (!version) {
-		struct compat_ipc_kludge __user *uipck = uptr;
 		struct compat_ipc_kludge ipck;
-
 		err = -EINVAL;
 		if (!uptr)
 			goto out;
 		err = -EFAULT;
-		if (copy_from_user (&ipck, uipck, sizeof(ipck)))
+		if (copy_from_user (&ipck, uptr, sizeof(ipck)))
 			goto out;
 		uptr = compat_ptr(ipck.msgp);
 		msgtyp = ipck.msgtyp;
 	}
-	err = -ENOMEM;
-	p = kmalloc(second + sizeof(struct msgbuf), GFP_USER);
-	if (!p)
-		goto out;
-	old_fs = get_fs();
-	set_fs(KERNEL_DS);
+	p = compat_alloc_user_space(second + sizeof(struct msgbuf));
 	err = sys_msgrcv(first, p, second, msgtyp, third);
-	set_fs(old_fs);
 	if (err < 0)
-		goto free_then_out;
+		goto out;
 	up = uptr;
-	if (put_user(p->mtype, &up->mtype) ||
-	    __copy_to_user(&up->mtext, p->mtext, err))
+	if (get_user(type, &p->mtype) ||
+	    put_user(type, &up->mtype) ||
+	    copy_in_user(up->mtext, p->mtext, err))
 		err = -EFAULT;
-free_then_out:
-	kfree(p);
 out:
 	return err;
 }
@@ -450,24 +425,12 @@ static inline int put_compat_msqid_ds(struct msqid64_ds *m,
 	return err;
 }
 
-static inline int do_msgctl(int first, int second, void *buf)
-{
-	mm_segment_t old_fs;
-	int err;
-
-	old_fs = get_fs();
-	set_fs(KERNEL_DS);
-	err = sys_msgctl(first, second, buf);
-	set_fs(old_fs);
-
-	return err;
-}
-
 long compat_sys_msgctl(int first, int second, void __user *uptr)
 {
 	int err, err2;
 	struct msqid64_ds m64;
 	int version = compat_ipc_parse_version(&second);
+	void __user *p;
 
 	switch (second & (~IPC_64)) {
 	case IPC_INFO:
@@ -484,21 +447,25 @@ long compat_sys_msgctl(int first, int second, void __user *uptr)
 		}
 		if (err)
 			break;
-
-		err = do_msgctl(first, second, &m64);
+		p = compat_alloc_user_space(sizeof(m64));
+		if (copy_to_user(p, &m64, sizeof(m64)))
+			err = -EFAULT;
+		else
+			err = sys_msgctl(first, second, p);
 		break;
 
 	case IPC_STAT:
 	case MSG_STAT:
-		err = do_msgctl(first, second, &m64);
+		p = compat_alloc_user_space(sizeof(m64));
+		err = sys_msgctl(first, second, p);
 		if (err < 0)
 			break;
-
-		if (version == IPC_64) {
+		if (copy_from_user(&m64, p, sizeof(m64)))
+			err2 = -EFAULT;
+		else if (version == IPC_64)
 			err2 = put_compat_msqid64_ds(&m64, uptr);
-		} else {
+		else
 			err2 = put_compat_msqid_ds(&m64, uptr);
-		}
 		if (err2)
 			err = -EFAULT;
 		break;
@@ -607,40 +574,29 @@ static inline int put_compat_shminfo(struct shminfo64 *smi,
 	err |= __put_user(smi->shmall, &up->shmall);
 }
 
-static inline int put_compat_shm_info(struct shm_info *si,
+static inline int put_compat_shm_info(struct shm_info __user *ip,
 				      struct compat_shm_info __user *uip)
 {
 	int err;
+	struct shm_info si;
 
-	if (!access_ok(VERIFY_WRITE, uip, sizeof(*uip)))
+	if (!access_ok(VERIFY_WRITE, uip, sizeof(*uip)) ||
+	    copy_from_user(&si, ip, sizeof(si)))
 		return -EFAULT;
-	err  = __put_user(si->used_ids, &uip->used_ids);
-	err |= __put_user(si->shm_tot, &uip->shm_tot);
-	err |= __put_user(si->shm_rss, &uip->shm_rss);
-	err |= __put_user(si->shm_swp, &uip->shm_swp);
-	err |= __put_user(si->swap_attempts, &uip->swap_attempts);
-	err |= __put_user(si->swap_successes, &uip->swap_successes);
-	return err;
-}
-
-static inline int do_shmctl(int shmid, int cmd, void *buf)
-{
-	mm_segment_t old_fs;
-	int err;
-
-	old_fs = get_fs();
-	set_fs(KERNEL_DS);
-	err = sys_shmctl(shmid, cmd, buf);
-	set_fs(old_fs);
-
+	err  = __put_user(si.used_ids, &uip->used_ids);
+	err |= __put_user(si.shm_tot, &uip->shm_tot);
+	err |= __put_user(si.shm_rss, &uip->shm_rss);
+	err |= __put_user(si.shm_swp, &uip->shm_swp);
+	err |= __put_user(si.swap_attempts, &uip->swap_attempts);
+	err |= __put_user(si.swap_successes, &uip->swap_successes);
 	return err;
 }
 
 long compat_sys_shmctl(int first, int second, void __user *uptr)
 {
+	void __user *p;
 	struct shmid64_ds s64;
 	struct shminfo64 smi;
-	struct shm_info si;
 	int err, err2;
 	int version = compat_ipc_parse_version(&second);
 
@@ -652,15 +608,16 @@ long compat_sys_shmctl(int first, int second, void __user *uptr)
 		break;
 
 	case IPC_INFO:
-		err = do_shmctl(first, second, &smi);
+		p = compat_alloc_user_space(sizeof(smi));
+		err = sys_shmctl(first, second, p);
 		if (err < 0)
 			break;
-
-		if (version == IPC_64) {
+		if (copy_from_user(&smi, p, sizeof(smi)))
+			err2 = -EFAULT;
+		else if (version == IPC_64)
 			err2 = put_compat_shminfo64(&smi, uptr);
-		} else {
+		else
 			err2 = put_compat_shminfo(&smi, uptr);
-		}
 		if (err2)
 			err = -EFAULT;
 		break;
@@ -674,30 +631,35 @@ long compat_sys_shmctl(int first, int second, void __user *uptr)
 		}
 		if (err)
 			break;
-
-		err = do_shmctl(first, second, &s64);
+		p = compat_alloc_user_space(sizeof(s64));
+		if (copy_to_user(p, &s64, sizeof(s64)))
+			err = -EFAULT;
+		else
+			err = sys_shmctl(first, second, p);
 		break;
 
 	case IPC_STAT:
 	case SHM_STAT:
-		err = do_shmctl(first, second, &s64);
+		p = compat_alloc_user_space(sizeof(s64));
+		err = sys_shmctl(first, second, p);
 		if (err < 0)
 			break;
-
-		if (version == IPC_64) {
+		if (copy_from_user(&s64, p, sizeof(s64)))
+			err2 = -EFAULT;
+		else if (version == IPC_64)
 			err2 = put_compat_shmid64_ds(&s64, uptr);
-		} else {
+		else
 			err2 = put_compat_shmid_ds(&s64, uptr);
-		}
 		if (err2)
 			err = -EFAULT;
 		break;
 
 	case SHM_INFO:
-		err = do_shmctl(first, second, &si);
+		p = compat_alloc_user_space(sizeof(struct shm_info));
+		err = sys_shmctl(first, second, p);
 		if (err < 0)
 			break;
-		err2 = put_compat_shm_info(&si, uptr);
+		err2 = put_compat_shm_info(p, uptr);
 		if (err2)
 			err = -EFAULT;
 		break;
@@ -712,24 +674,14 @@ long compat_sys_shmctl(int first, int second, void __user *uptr)
 long compat_sys_semtimedop(int semid, struct sembuf __user *tsems,
 		unsigned nsops, const struct compat_timespec __user *timeout)
 {
-	struct timespec ts;
-	struct timespec __user *ts64;
-
-	/* parameter checking precedence should mirror sys_semtimedop() */
-	if (nsops < 1 || semid < 0)
-		return -EINVAL;
-	if (nsops > sc_semopm)
-		return -E2BIG;
-	if (!access_ok(VERIFY_READ, tsems, nsops * sizeof(struct sembuf)))
-		return -EFAULT;
-	if (!timeout)
-		return sys_semtimedop(semid, tsems, nsops, 0);
-
-	ts64 = compat_alloc_user_space(sizeof(*ts64));
-	if (get_compat_timespec(&ts, timeout))
-		return -EFAULT;
-	if (copy_to_user(ts64, &ts, sizeof(ts)))
-		return -EFAULT;
-
+	struct timespec __user *ts64 = NULL;
+	if (timeout) {
+		struct timespec ts;
+		ts64 = compat_alloc_user_space(sizeof(*ts64));
+		if (get_compat_timespec(&ts, timeout))
+			return -EFAULT;
+		if (copy_to_user(ts64, &ts, sizeof(ts)))
+			return -EFAULT;
+	}
 	return sys_semtimedop(semid, tsems, nsops, ts64);
 }
diff --git a/ipc/compat_mq.c b/ipc/compat_mq.c
index a411f4ebd..034d5d73c 100644
--- a/ipc/compat_mq.c
+++ b/ipc/compat_mq.c
@@ -50,45 +50,29 @@ asmlinkage long compat_sys_mq_open(const char __user *u_name,
 			int oflag, compat_mode_t mode,
 			struct compat_mq_attr __user *u_attr)
 {
-	struct mq_attr attr;
-	mm_segment_t oldfs;
-	char *name;
-	long ret;
-
-	if ((oflag & O_CREAT) == 0 || !u_attr)
-		return sys_mq_open(u_name, oflag, mode, 0);
-
-	if (get_compat_mq_attr(&attr, u_attr))
-		return -EFAULT;
-
-	name = getname(u_name);
-	if (IS_ERR(name))
-		return PTR_ERR(name);
-
-	oldfs = get_fs();
-	set_fs(KERNEL_DS);
-	ret = sys_mq_open(name, oflag, mode, &attr);
-	set_fs(oldfs);
-
-	putname(name);
-	return ret;
+	void __user *p = NULL;
+	if (u_attr && oflag & O_CREAT) {
+		struct mq_attr attr;
+		p = compat_alloc_user_space(sizeof(attr));
+		if (get_compat_mq_attr(&attr, u_attr) ||
+		    copy_to_user(p, &attr, sizeof(attr)))
+			return -EFAULT;
+	}
+	return sys_mq_open(u_name, oflag, mode, p);
 }
 
-static struct timespec __user *compat_prepare_timeout(
-			const struct compat_timespec __user *u_abs_timeout)
+static int compat_prepare_timeout(struct timespec __user * *p,
+				  const struct compat_timespec __user *u)
 {
 	struct timespec ts;
-	struct timespec __user *u_ts;
-
-	if (!u_abs_timeout)
+	if (!u) {
+		*p = NULL;
 		return 0;
-
-	u_ts = compat_alloc_user_space(sizeof(*u_ts));
-	if (get_compat_timespec(&ts, u_abs_timeout)
-		|| copy_to_user(u_ts, &ts, sizeof(*u_ts)))
-		return ERR_PTR(-EFAULT);
-
-	return u_ts;
+	}
+	*p = compat_alloc_user_space(sizeof(ts));
+	if (get_compat_timespec(&ts, u) || copy_to_user(*p, &ts, sizeof(ts)))
+		return -EFAULT;
+	return 0;
 }
 
 asmlinkage long compat_sys_mq_timedsend(mqd_t mqdes,
@@ -98,8 +82,7 @@ asmlinkage long compat_sys_mq_timedsend(mqd_t mqdes,
 {
 	struct timespec __user *u_ts;
 
-	u_ts = compat_prepare_timeout(u_abs_timeout);
-	if (IS_ERR(u_ts))
+	if (compat_prepare_timeout(&u_ts, u_abs_timeout))
 		return -EFAULT;
 
 	return sys_mq_timedsend(mqdes, u_msg_ptr, msg_len,
@@ -112,9 +95,7 @@ asmlinkage ssize_t compat_sys_mq_timedreceive(mqd_t mqdes,
 			const struct compat_timespec __user *u_abs_timeout)
 {
 	struct timespec __user *u_ts;
-
-	u_ts = compat_prepare_timeout(u_abs_timeout);
-	if (IS_ERR(u_ts))
+	if (compat_prepare_timeout(&u_ts, u_abs_timeout))
 		return -EFAULT;
 
 	return sys_mq_timedreceive(mqdes, u_msg_ptr, msg_len,
@@ -138,60 +119,42 @@ static int get_compat_sigevent(struct sigevent *event,
 asmlinkage long compat_sys_mq_notify(mqd_t mqdes,
 			const struct compat_sigevent __user *u_notification)
 {
-	mm_segment_t oldfs;
-	struct sigevent notification;
-	char cookie[NOTIFY_COOKIE_LEN];
-	compat_uptr_t u_cookie;
-	long ret;
-
-	if (!u_notification)
-		return sys_mq_notify(mqdes, 0);
-
-	if (get_compat_sigevent(&notification, u_notification))
-		return -EFAULT;
-
-	if (notification.sigev_notify == SIGEV_THREAD) {
-		u_cookie = (compat_uptr_t)notification.sigev_value.sival_int;
-		if (copy_from_user(cookie, compat_ptr(u_cookie),
-						NOTIFY_COOKIE_LEN)) {
+	struct sigevent __user *p = NULL;
+	if (u_notification) {
+		struct sigevent n;
+		p = compat_alloc_user_space(sizeof(*p));
+		if (get_compat_sigevent(&n, u_notification))
+			return -EFAULT;
+		if (n.sigev_notify == SIGEV_THREAD)
+			n.sigev_value.sival_ptr = compat_ptr(n.sigev_value.sival_int);
+		if (copy_to_user(p, &n, sizeof(*p)))
 			return -EFAULT;
-		}
-		notification.sigev_value.sival_ptr = cookie;
 	}
-
-	oldfs = get_fs();
-	set_fs(KERNEL_DS);
-	ret = sys_mq_notify(mqdes, &notification);
-	set_fs(oldfs);
-
-	return ret;
+	return sys_mq_notify(mqdes, p);
 }
 
 asmlinkage long compat_sys_mq_getsetattr(mqd_t mqdes,
 			const struct compat_mq_attr __user *u_mqstat,
 			struct compat_mq_attr __user *u_omqstat)
 {
-	struct mq_attr mqstat, omqstat;
-	struct mq_attr *p_mqstat = 0, *p_omqstat = 0;
-	mm_segment_t oldfs;
+	struct mq_attr mqstat;
+	struct mq_attr __user *p = compat_alloc_user_space(2 * sizeof(*p));
 	long ret;
 
 	if (u_mqstat) {
-		p_mqstat = &mqstat;
-		if (get_compat_mq_attr(p_mqstat, u_mqstat))
+		if (get_compat_mq_attr(&mqstat, u_mqstat) ||
+		    copy_to_user(p, &mqstat, sizeof(mqstat)))
 			return -EFAULT;
 	}
-
-	if (u_omqstat)
-		p_omqstat = &omqstat;
-
-	oldfs = get_fs();
-	set_fs(KERNEL_DS);
-	ret = sys_mq_getsetattr(mqdes, p_mqstat, p_omqstat);
-	set_fs(oldfs);
-
+	ret = sys_mq_getsetattr(mqdes,
+				u_mqstat ? p : NULL,
+				u_omqstat ? p + 1 : NULL);
 	if (ret)
 		return ret;
-
-	return (u_omqstat) ? put_compat_mq_attr(&omqstat, u_omqstat) : 0;
+	if (u_omqstat) {
+		if (copy_from_user(&mqstat, p + 1, sizeof(mqstat)) ||
+		    put_compat_mq_attr(&mqstat, u_omqstat))
+			return -EFAULT;
+	}
+	return 0;
 }
diff --git a/ipc/mqueue.c b/ipc/mqueue.c
index 40a8d414e..c9ea777b1 100644
--- a/ipc/mqueue.c
+++ b/ipc/mqueue.c
@@ -43,10 +43,10 @@
 #define CTL_MSGSIZEMAX 	4
 
 /* default values */
-#define DFLT_QUEUESMAX	64	/* max number of message queues */
-#define DFLT_MSGMAX 	40	/* max number of messages in each queue */
+#define DFLT_QUEUESMAX	256	/* max number of message queues */
+#define DFLT_MSGMAX 	10	/* max number of messages in each queue */
 #define HARD_MSGMAX 	(131072/sizeof(void*))
-#define DFLT_MSGSIZEMAX 16384	/* max message size */
+#define DFLT_MSGSIZEMAX 8192	/* max message size */
 
 #define NOTIFY_COOKIE_LEN	32
 
@@ -67,6 +67,7 @@ struct mqueue_inode_info {
 
 	struct sigevent notify;
 	pid_t notify_owner;
+ 	struct user_struct *user;	/* user who created, for accouting */
 	struct sock *notify_sock;
 	struct sk_buff *notify_cookie;
 
@@ -114,6 +115,9 @@ static struct inode *mqueue_get_inode(struct super_block *sb, int mode,
 
 		if (S_ISREG(mode)) {
 			struct mqueue_inode_info *info;
+			struct task_struct *p = current;
+			struct user_struct *u = p->user;
+			unsigned long mq_bytes, mq_msg_tblsz;
 
 			inode->i_fop = &mqueue_file_operations;
 			inode->i_size = FILENT_SIZE;
@@ -123,8 +127,10 @@ static struct inode *mqueue_get_inode(struct super_block *sb, int mode,
 			init_waitqueue_head(&info->wait_q);
 			INIT_LIST_HEAD(&info->e_wait_q[0].list);
 			INIT_LIST_HEAD(&info->e_wait_q[1].list);
+			info->messages = NULL;
 			info->notify_owner = 0;
 			info->qsize = 0;
+			info->user = NULL;	/* set when all is ok */
 			memset(&info->attr, 0, sizeof(info->attr));
 			info->attr.mq_maxmsg = DFLT_MSGMAX;
 			info->attr.mq_msgsize = DFLT_MSGSIZEMAX;
@@ -132,12 +138,29 @@ static struct inode *mqueue_get_inode(struct super_block *sb, int mode,
 				info->attr.mq_maxmsg = attr->mq_maxmsg;
 				info->attr.mq_msgsize = attr->mq_msgsize;
 			}
-			info->messages = kmalloc(info->attr.mq_maxmsg * sizeof(struct msg_msg *), GFP_KERNEL);
+			mq_msg_tblsz = info->attr.mq_maxmsg * sizeof(struct msg_msg *);
+			mq_bytes = (mq_msg_tblsz +
+				(info->attr.mq_maxmsg * info->attr.mq_msgsize));
+
+			spin_lock(&mq_lock);
+			if (u->mq_bytes + mq_bytes < u->mq_bytes ||
+		 	    u->mq_bytes + mq_bytes >
+			    p->rlim[RLIMIT_MSGQUEUE].rlim_cur) {
+				spin_unlock(&mq_lock);
+				goto out_inode;
+			}
+			u->mq_bytes += mq_bytes;
+			spin_unlock(&mq_lock);
+
+			info->messages = kmalloc(mq_msg_tblsz, GFP_KERNEL);
 			if (!info->messages) {
-				make_bad_inode(inode);
-				iput(inode);
-				inode = NULL;
+				spin_lock(&mq_lock);
+				u->mq_bytes -= mq_bytes;
+				spin_unlock(&mq_lock);
+				goto out_inode;
 			}
+			/* all is ok */
+			info->user = get_uid(u);
 		} else if (S_ISDIR(mode)) {
 			inode->i_nlink++;
 			/* Some things misbehave if size == 0 on a directory */
@@ -147,6 +170,10 @@ static struct inode *mqueue_get_inode(struct super_block *sb, int mode,
 		}
 	}
 	return inode;
+out_inode:
+	make_bad_inode(inode);
+	iput(inode);
+	return NULL;
 }
 
 static int mqueue_fill_super(struct super_block *sb, void *data, int silent)
@@ -205,6 +232,8 @@ static void mqueue_destroy_inode(struct inode *inode)
 static void mqueue_delete_inode(struct inode *inode)
 {
 	struct mqueue_inode_info *info;
+	struct user_struct *user;
+	unsigned long mq_bytes;
 	int i;
 
 	if (S_ISDIR(inode->i_mode)) {
@@ -220,10 +249,15 @@ static void mqueue_delete_inode(struct inode *inode)
 
 	clear_inode(inode);
 
-	if (info->messages) {
+	mq_bytes = (info->attr.mq_maxmsg * sizeof(struct msg_msg *) +
+		   (info->attr.mq_maxmsg * info->attr.mq_msgsize));
+	user = info->user;
+	if (user) {
 		spin_lock(&mq_lock);
+		user->mq_bytes -= mq_bytes;
 		queues_count--;
 		spin_unlock(&mq_lock);
+		free_uid(user);
 	}
 }
 
@@ -534,6 +568,28 @@ static void remove_notification(struct mqueue_inode_info *info)
 	info->notify_owner = 0;
 }
 
+static int mq_attr_ok(struct mq_attr *attr)
+{
+	if (attr->mq_maxmsg <= 0 || attr->mq_msgsize <= 0)
+		return 0;
+	if (capable(CAP_SYS_RESOURCE)) {
+		if (attr->mq_maxmsg > HARD_MSGMAX)
+			return 0;
+	} else {
+		if (attr->mq_maxmsg > msg_max ||
+				attr->mq_msgsize > msgsize_max)
+			return 0;
+	}
+	/* check for overflow */
+	if (attr->mq_msgsize > ULONG_MAX/attr->mq_maxmsg)
+		return 0;
+	if ((unsigned long)(attr->mq_maxmsg * attr->mq_msgsize) +
+	    (attr->mq_maxmsg * sizeof (struct msg_msg *)) <
+	    (unsigned long)(attr->mq_maxmsg * attr->mq_msgsize))
+		return 0;
+	return 1;
+}
+
 /*
  * Invoked when creating a new queue via sys_mq_open
  */
@@ -547,17 +603,8 @@ static struct file *do_create(struct dentry *dir, struct dentry *dentry,
 	if (u_attr != NULL) {
 		if (copy_from_user(&attr, u_attr, sizeof(attr)))
 			return ERR_PTR(-EFAULT);
-
-		if (attr.mq_maxmsg <= 0 || attr.mq_msgsize <= 0)
+		if (!mq_attr_ok(&attr))
 			return ERR_PTR(-EINVAL);
-		if (capable(CAP_SYS_RESOURCE)) {
-			if (attr.mq_maxmsg > HARD_MSGMAX)
-				return ERR_PTR(-EINVAL);
-		} else {
-			if (attr.mq_maxmsg > msg_max ||
-					attr.mq_msgsize > msgsize_max)
-				return ERR_PTR(-EINVAL);
-		}
 		/* store for use during create */
 		dentry->d_fsdata = &attr;
 	}
diff --git a/ipc/msg.c b/ipc/msg.c
index bfa208bcc..c4d3b2a7a 100644
--- a/ipc/msg.c
+++ b/ipc/msg.c
@@ -82,7 +82,7 @@ void __init msg_init (void)
 	ipc_init_ids(&msg_ids,msg_ctlmni);
 
 #ifdef CONFIG_PROC_FS
-	create_proc_read_entry("sysvipc/msg", 0, 0, sysvipc_msg_read_proc, NULL);
+	create_proc_read_entry("sysvipc/msg", 0, NULL, sysvipc_msg_read_proc, NULL);
 #endif
 }
 
diff --git a/ipc/sem.c b/ipc/sem.c
index bd8a4582c..71936c913 100644
--- a/ipc/sem.c
+++ b/ipc/sem.c
@@ -118,7 +118,7 @@ void __init sem_init (void)
 	ipc_init_ids(&sem_ids,sc_semmni);
 
 #ifdef CONFIG_PROC_FS
-	create_proc_read_entry("sysvipc/sem", 0, 0, sysvipc_sem_read_proc, NULL);
+	create_proc_read_entry("sysvipc/sem", 0, NULL, sysvipc_sem_read_proc, NULL);
 #endif
 }
 
diff --git a/ipc/shm.c b/ipc/shm.c
index 07fb859c6..62c5393bb 100644
--- a/ipc/shm.c
+++ b/ipc/shm.c
@@ -62,7 +62,7 @@ void __init shm_init (void)
 {
 	ipc_init_ids(&shm_ids, 1);
 #ifdef CONFIG_PROC_FS
-	create_proc_read_entry("sysvipc/shm", 0, 0, sysvipc_shm_read_proc, NULL);
+	create_proc_read_entry("sysvipc/shm", 0, NULL, sysvipc_shm_read_proc, NULL);
 #endif
 }
 
diff --git a/ipc/util.c b/ipc/util.c
index eb61fb726..d84ac5198 100644
--- a/ipc/util.c
+++ b/ipc/util.c
@@ -336,25 +336,40 @@ void* ipc_rcu_alloc(int size)
  * Since RCU callback function is called in bh,
  * we need to defer the vfree to schedule_work
  */
-static void ipc_schedule_free(void* arg)
+static void ipc_schedule_free(struct rcu_head *head)
 {
-	struct ipc_rcu_vmalloc *free = arg;
+	struct ipc_rcu_vmalloc *free =
+		container_of(head, struct ipc_rcu_vmalloc, rcu);
 
 	INIT_WORK(&free->work, vfree, free);
 	schedule_work(&free->work);
 }
 
+/**
+ *	ipc_immediate_free	- free ipc + rcu space
+ *
+ *	Free from the RCU callback context
+ *
+ */
+static void ipc_immediate_free(struct rcu_head *head)
+{
+	struct ipc_rcu_kmalloc *free =
+		container_of(head, struct ipc_rcu_kmalloc, rcu);
+	kfree(free);
+}
+
+
+
 void ipc_rcu_free(void* ptr, int size)
 {
 	if (rcu_use_vmalloc(size)) {
 		struct ipc_rcu_vmalloc *free;
 		free = ptr - sizeof(*free);
-		call_rcu(&free->rcu, ipc_schedule_free, free);
+		call_rcu(&free->rcu, ipc_schedule_free);
 	} else {
 		struct ipc_rcu_kmalloc *free;
 		free = ptr - sizeof(*free);
-		/* kfree takes a "const void *" so gcc warns.  So we cast. */
-		call_rcu(&free->rcu, (void (*)(void *))kfree, free);
+		call_rcu(&free->rcu, ipc_immediate_free);
 	}
 
 }
diff --git a/kernel/Makefile b/kernel/Makefile
index 81849958d..e56906d36 100644
--- a/kernel/Makefile
+++ b/kernel/Makefile
@@ -38,23 +38,7 @@ ifneq ($(CONFIG_IA64),y)
 CFLAGS_sched.o := $(PROFILING) -fno-omit-frame-pointer
 endif
 
-# configs.o uses generated files - dependecies must be listed explicitly
-$(obj)/configs.o: $(obj)/ikconfig.h
-
-ifdef CONFIG_IKCONFIG_PROC
 $(obj)/configs.o: $(obj)/config_data.h
-endif
-
-# ikconfig.h contains all the selected config entries - generated
-# from top-level Makefile and .config. Info from ikconfig.h can
-# be extracted from the kernel binary.
-
-quiet_cmd_ikconfig = IKCFG   $@
-      cmd_ikconfig = $(CONFIG_SHELL) $< .config $(srctree)/Makefile > $@
-
-targets += ikconfig.h
-$(obj)/ikconfig.h: scripts/mkconfigs .config Makefile FORCE
-	$(call if_changed,ikconfig)
 
 # config_data.h contains the same information as ikconfig.h but gzipped.
 # Info from config_data can be extracted from /proc/config*
@@ -63,7 +47,7 @@ $(obj)/config_data.gz: .config FORCE
 	$(call if_changed,gzip)
 
 quiet_cmd_ikconfiggz = IKCFG   $@
-      cmd_ikconfiggz = cat $< | scripts/bin2c kernel_config_data > $@
+      cmd_ikconfiggz = (echo "const char kernel_config_data[] = MAGIC_START"; cat $< | scripts/bin2c; echo "MAGIC_END;") > $@
 targets += config_data.h
 $(obj)/config_data.h: $(obj)/config_data.gz FORCE
 	$(call if_changed,ikconfiggz)
diff --git a/kernel/acct.c b/kernel/acct.c
index f0e2bd045..daf23c4ef 100644
--- a/kernel/acct.c
+++ b/kernel/acct.c
@@ -302,6 +302,69 @@ static comp_t encode_comp_t(unsigned long value)
 	return exp;
 }
 
+#if ACCT_VERSION==1 || ACCT_VERSION==2
+/*
+ * encode an u64 into a comp2_t (24 bits)
+ *
+ * Format: 5 bit base 2 exponent, 20 bits mantissa.
+ * The leading bit of the mantissa is not stored, but implied for
+ * non-zero exponents.
+ * Largest encodable value is 50 bits.
+ */
+
+#define MANTSIZE2       20                      /* 20 bit mantissa. */
+#define EXPSIZE2        5                       /* 5 bit base 2 exponent. */
+#define MAXFRACT2       ((1ul << MANTSIZE2) - 1) /* Maximum fractional value. */
+#define MAXEXP2         ((1 <<EXPSIZE2) - 1)    /* Maximum exponent. */
+
+static comp2_t encode_comp2_t(u64 value)
+{
+        int exp, rnd;
+
+        exp = (value > (MAXFRACT2>>1));
+        rnd = 0;
+        while (value > MAXFRACT2) {
+                rnd = value & 1;
+                value >>= 1;
+                exp++;
+        }
+
+        /*
+         * If we need to round up, do it (and handle overflow correctly).
+         */
+        if (rnd && (++value > MAXFRACT2)) {
+                value >>= 1;
+                exp++;
+        }
+
+        if (exp > MAXEXP2) {
+                /* Overflow. Return largest representable number instead. */
+                return (1ul << (MANTSIZE2+EXPSIZE2-1)) - 1;
+        } else {
+                return (value & (MAXFRACT2>>1)) | (exp << (MANTSIZE2-1));
+        }
+}
+#endif
+
+#if ACCT_VERSION==3
+/*
+ * encode an u64 into a 32 bit IEEE float
+ */
+static u32 encode_float(u64 value)
+{
+	unsigned exp = 190;
+	unsigned u;
+
+	if (value==0) return 0;
+	while ((s64)value > 0){
+		value <<= 1;
+		exp--;
+	}
+	u = (u32)(value >> 40) & 0x7fffffu;
+	return u | (exp << 23);
+}
+#endif
+
 /*
  *  Write an accounting entry for an exiting process
  *
@@ -316,7 +379,7 @@ static comp_t encode_comp_t(unsigned long value)
  */
 static void do_acct_process(long exitcode, struct file *file)
 {
-	struct acct ac;
+	acct_t ac;
 	mm_segment_t fs;
 	unsigned long vsize;
 	unsigned long flim;
@@ -333,20 +396,45 @@ static void do_acct_process(long exitcode, struct file *file)
 	 * Fill the accounting struct with the needed info as recorded
 	 * by the different kernel functions.
 	 */
-	memset((caddr_t)&ac, 0, sizeof(struct acct));
+	memset((caddr_t)&ac, 0, sizeof(acct_t));
 
+	ac.ac_version = ACCT_VERSION | ACCT_BYTEORDER;
 	strlcpy(ac.ac_comm, current->comm, sizeof(ac.ac_comm));
 
-	elapsed = jiffies_64_to_clock_t(get_jiffies_64() - current->start_time);
+	elapsed = jiffies_64_to_AHZ(get_jiffies_64() - current->start_time);
+#if ACCT_VERSION==3
+	ac.ac_etime = encode_float(elapsed);
+#else
 	ac.ac_etime = encode_comp_t(elapsed < (unsigned long) -1l ?
 	                       (unsigned long) elapsed : (unsigned long) -1l);
-	do_div(elapsed, USER_HZ);
+#endif
+#if ACCT_VERSION==1 || ACCT_VERSION==2
+	{
+		/* new enlarged etime field */
+		comp2_t etime = encode_comp2_t(elapsed);
+		ac.ac_etime_hi = etime >> 16;
+		ac.ac_etime_lo = (u16) etime;
+	}
+#endif
+	do_div(elapsed, AHZ);
 	ac.ac_btime = xtime.tv_sec - elapsed;
-	ac.ac_utime = encode_comp_t(jiffies_to_clock_t(current->utime));
-	ac.ac_stime = encode_comp_t(jiffies_to_clock_t(current->stime));
+	ac.ac_utime = encode_comp_t(jiffies_to_AHZ(current->utime));
+	ac.ac_stime = encode_comp_t(jiffies_to_AHZ(current->stime));
 	/* we really need to bite the bullet and change layout */
 	ac.ac_uid = current->uid;
 	ac.ac_gid = current->gid;
+#if ACCT_VERSION==2
+	ac.ac_ahz = AHZ;
+#endif
+#if ACCT_VERSION==1 || ACCT_VERSION==2
+	/* backward-compatible 16 bit fields */
+	ac.ac_uid16 = current->uid;
+	ac.ac_gid16 = current->gid;
+#endif
+#if ACCT_VERSION==3
+	ac.ac_pid = current->pid;
+	ac.ac_ppid = current->parent->pid;
+#endif
 
 	read_lock(&tasklist_lock);	/* pin current->signal */
 	ac.ac_tty = current->signal->tty ?
@@ -395,7 +483,7 @@ static void do_acct_process(long exitcode, struct file *file)
 	flim = current->rlim[RLIMIT_FSIZE].rlim_cur;
 	current->rlim[RLIMIT_FSIZE].rlim_cur = RLIM_INFINITY;
 	file->f_op->write(file, (char *)&ac,
-			       sizeof(struct acct), &file->f_pos);
+			       sizeof(acct_t), &file->f_pos);
 	current->rlim[RLIMIT_FSIZE].rlim_cur = flim;
 	set_fs(fs);
 }
diff --git a/kernel/auditsc.c b/kernel/auditsc.c
index 342b57141..e688c73f6 100644
--- a/kernel/auditsc.c
+++ b/kernel/auditsc.c
@@ -177,9 +177,10 @@ static inline int audit_add_rule(struct audit_entry *entry,
 	return 0;
 }
 
-static void audit_free_rule(void *arg)
+static void audit_free_rule(struct rcu_head *head)
 {
-	kfree(arg);
+	struct audit_entry *e = container_of(head, struct audit_entry, rcu);
+	kfree(e);
 }
 
 /* Note that audit_add_rule and audit_del_rule are called via
@@ -195,7 +196,7 @@ static inline int audit_del_rule(struct audit_rule *rule,
 	list_for_each_entry(e, list, list) {
 		if (!audit_compare_rule(rule, &e->rule)) {
 			list_del_rcu(&e->list);
-			call_rcu(&e->rcu, audit_free_rule, e);
+			call_rcu(&e->rcu, audit_free_rule);
 			return 0;
 		}
 	}
diff --git a/kernel/compat.c b/kernel/compat.c
index 57cc48e90..481ac0d4b 100644
--- a/kernel/compat.c
+++ b/kernel/compat.c
@@ -531,7 +531,7 @@ long compat_clock_getres(clockid_t which_clock,
 	err = sys_clock_getres(which_clock,
 			       (struct timespec __user *) &ts);
 	set_fs(oldfs);
-	if (!err && put_compat_timespec(&ts, tp))
+	if (!err && tp && put_compat_timespec(&ts, tp))
 		return -EFAULT; 
 	return err;
 } 
diff --git a/kernel/configs.c b/kernel/configs.c
index 326ab7b21..986f7af31 100644
--- a/kernel/configs.c
+++ b/kernel/configs.c
@@ -34,19 +34,30 @@
 /**************************************************/
 /* the actual current config file                 */
 
-/* This one is for extraction from the kernel binary file image. */
-#include "ikconfig.h"
+/*
+ * Define kernel_config_data and kernel_config_data_size, which contains the
+ * wrapped and compressed configuration file.  The file is first compressed
+ * with gzip and then bounded by two eight byte magic numbers to allow
+ * extraction from a binary kernel image:
+ *
+ *   IKCFG_ST
+ *   <image>
+ *   IKCFG_ED
+ */
+#define MAGIC_START	"IKCFG_ST"
+#define MAGIC_END	"IKCFG_ED"
+#include "config_data.h"
 
-#ifdef CONFIG_IKCONFIG_PROC
 
-/* This is the data that can be read from /proc/config.gz. */
-#include "config_data.h"
+#define MAGIC_SIZE (sizeof(MAGIC_START) - 1)
+#define kernel_config_data_size \
+	(sizeof(kernel_config_data) - 1 - MAGIC_SIZE * 2)
+
+#ifdef CONFIG_IKCONFIG_PROC
 
 /**************************************************/
 /* globals and useful constants                   */
 
-static const char IKCONFIG_VERSION[] __initdata = "0.7";
-
 static ssize_t
 ikconfig_read_current(struct file *file, char __user *buf,
 		      size_t len, loff_t * offset)
@@ -58,7 +69,7 @@ ikconfig_read_current(struct file *file, char __user *buf,
 		return 0;
 
 	count = min(len, (size_t)(kernel_config_data_size - pos));
-	if(copy_to_user(buf, kernel_config_data + pos, count))
+	if (copy_to_user(buf, kernel_config_data + MAGIC_SIZE + pos, count))
 		return -EFAULT;
 
 	*offset += count;
diff --git a/kernel/cpu.c b/kernel/cpu.c
index 72b984c67..083521327 100644
--- a/kernel/cpu.c
+++ b/kernel/cpu.c
@@ -20,14 +20,6 @@
 DECLARE_MUTEX(cpucontrol);
 
 static struct notifier_block *cpu_chain;
-/*
- * Represents all cpu's present in the system
- * In systems capable of hotplug, this map could dynamically grow
- * as new cpu's are detected in the system via any platform specific
- * method, such as ACPI for e.g.
- */
-cpumask_t	cpu_present_map;
-EXPORT_SYMBOL(cpu_present_map);
 
 /* Need to know about CPUs going up/down? */
 int register_cpu_notifier(struct notifier_block *nb)
diff --git a/kernel/dma.c b/kernel/dma.c
index af1d982a0..940d02c50 100644
--- a/kernel/dma.c
+++ b/kernel/dma.c
@@ -58,14 +58,7 @@ struct dma_chan {
 };
 
 static struct dma_chan dma_chan_busy[MAX_DMA_CHANNELS] = {
-	{ 0, 0 },
-	{ 0, 0 },
-	{ 0, 0 },
-	{ 0, 0 },
-	{ 1, "cascade" },
-	{ 0, 0 },
-	{ 0, 0 },
-	{ 0, 0 }
+	[4] = { 1, "cascade" },
 };
 
 
diff --git a/kernel/exit.c b/kernel/exit.c
index 37faf083e..8c5742ebb 100644
--- a/kernel/exit.c
+++ b/kernel/exit.c
@@ -41,8 +41,7 @@ static void __unhash_process(struct task_struct *p)
 	/* tasklist_lock is held, is this sufficient? */
 	if (p->vx_info) {
 		atomic_dec(&p->vx_info->cacct.nr_threads);
-		vx_nproc_dec(p->vx_info);
-		// atomic_dec(&p->vx_info->limit.res[RLIMIT_NPROC]);
+		atomic_dec(&p->vx_info->limit.rcur[RLIMIT_NPROC]);
 	}
 	detach_pid(p, PIDTYPE_PID);
 	detach_pid(p, PIDTYPE_TGID);
@@ -304,7 +303,7 @@ int allow_signal(int sig)
 		   Let the signal code know it'll be handled, so
 		   that they don't get converted to SIGKILL or
 		   just silently dropped */
-		current->sighand->action[(sig)-1].sa.sa_handler = (void *)2;
+		current->sighand->action[(sig)-1].sa.sa_handler = (void __user *)2;
 	}
 	recalc_sigpending();
 	spin_unlock_irq(&current->sighand->siglock);
@@ -388,7 +387,7 @@ static inline void close_files(struct files_struct * files)
 				struct file * file = xchg(&files->fd[i], NULL);
 				if (file)
 					filp_close(file, files);
-				vx_openfd_dec(i);
+				// vx_openfd_dec(i);
 			}
 			i++;
 			set >>= 1;
@@ -603,7 +602,8 @@ static inline void reparent_thread(task_t *p, task_t *father, int traced)
  * group, and if no such member exists, give it to
  * the global child reaper process (ie "init")
  */
-static inline void forget_original_parent(struct task_struct * father)
+static inline void forget_original_parent(struct task_struct * father,
+					  struct list_head *to_release)
 {
 	struct task_struct *p, *reaper = father;
 	struct list_head *_p, *_n;
@@ -622,16 +622,34 @@ static inline void forget_original_parent(struct task_struct * father)
 	 * Search them and reparent children.
 	 */
 	list_for_each_safe(_p, _n, &father->children) {
+		int ptrace;
 		p = list_entry(_p,struct task_struct,sibling);
+
+		ptrace = p->ptrace;
+
+		/* if father isn't the real parent, then ptrace must be enabled */
+		BUG_ON(father != p->real_parent && !ptrace);
+
 		if (father == p->real_parent) {
+			/* reparent with a reaper, real father it's us */
 			choose_new_parent(p, reaper, child_reaper);
 			reparent_thread(p, father, 0);
 		} else {
-			ptrace_unlink (p);
+			/* reparent ptraced task to its real parent */
+			__ptrace_unlink (p);
 			if (p->state == TASK_ZOMBIE && p->exit_signal != -1 &&
 			    thread_group_empty(p))
 				do_notify_parent(p, p->exit_signal);
 		}
+
+		/*
+		 * if the ptraced child is a zombie with exit_signal == -1
+		 * we must collect it before we exit, or it will remain
+		 * zombie forever since we prevented it from self-reap itself
+		 * while it was being traced by us, to be able to see it in wait4.
+		 */
+		if (unlikely(ptrace && p->state == TASK_ZOMBIE && p->exit_signal == -1))
+			list_add(&p->ptrace_list, to_release);
 	}
 	list_for_each_safe(_p, _n, &father->ptrace_children) {
 		p = list_entry(_p,struct task_struct,ptrace_list);
@@ -648,6 +666,7 @@ static void exit_notify(struct task_struct *tsk)
 {
 	int state;
 	struct task_struct *t;
+	struct list_head ptrace_dead, *_p, *_n;
 
 	if (signal_pending(tsk) && !tsk->signal->group_exit
 	    && !thread_group_empty(tsk)) {
@@ -683,8 +702,10 @@ static void exit_notify(struct task_struct *tsk)
 	 *	jobs, send them a SIGHUP and then a SIGCONT.  (POSIX 3.2.2.2)
 	 */
 
-	forget_original_parent(tsk);
+	INIT_LIST_HEAD(&ptrace_dead);
+	forget_original_parent(tsk, &ptrace_dead);
 	BUG_ON(!list_empty(&tsk->children));
+	BUG_ON(!list_empty(&tsk->ptrace_children));
 
 	/*
 	 * Check to see if any process groups have become orphaned
@@ -769,6 +790,12 @@ static void exit_notify(struct task_struct *tsk)
 	_raw_write_unlock(&tasklist_lock);
 	local_irq_enable();
 
+	list_for_each_safe(_p, _n, &ptrace_dead) {
+		list_del_init(_p);
+		t = list_entry(_p,struct task_struct,ptrace_list);
+		release_task(t);
+	}
+
 	/* If the process is dead, release it - nobody will wait for it */
 	if (state == TASK_DEAD)
 		release_task(tsk);
@@ -810,9 +837,6 @@ asmlinkage NORET_TYPE void do_exit(long code)
 	__exit_fs(tsk);
 	exit_namespace(tsk);
 	exit_thread();
-#ifdef CONFIG_NUMA
-	mpol_free(tsk->mempolicy);
-#endif
 
 	if (tsk->signal->leader)
 		disassociate_ctty(1);
@@ -823,6 +847,10 @@ asmlinkage NORET_TYPE void do_exit(long code)
 
 	tsk->exit_code = code;
 	exit_notify(tsk);
+#ifdef CONFIG_NUMA
+	mpol_free(tsk->mempolicy);
+	tsk->mempolicy = NULL;
+#endif
 	schedule();
 	BUG();
 	/* Avoid "noreturn function does return".  */
@@ -844,10 +872,10 @@ asmlinkage long sys_exit(int error_code)
 	do_exit((error_code&0xff)<<8);
 }
 
-task_t fastcall *next_thread(task_t *p)
+task_t fastcall *next_thread(const task_t *p)
 {
-	struct pid_link *link = p->pids + PIDTYPE_TGID;
-	struct list_head *tmp, *head = &link->pidptr->task_list;
+	const struct pid_link *link = p->pids + PIDTYPE_TGID;
+	const struct list_head *tmp, *head = &link->pidptr->task_list;
 
 #ifdef CONFIG_SMP
 	if (!p->sighand)
@@ -999,20 +1027,17 @@ static int wait_task_zombie(task_t *p, unsigned int __user *stat_addr, struct ru
 		if (p->real_parent != p->parent) {
 			__ptrace_unlink(p);
 			p->state = TASK_ZOMBIE;
-			/* If this is a detached thread, this is where it goes away.  */
-			if (p->exit_signal == -1) {
-				/* release_task takes the lock itself.  */
-				write_unlock_irq(&tasklist_lock);
-				release_task (p);
-			}
-			else {
+			/*
+			 * If this is not a detached task, notify the parent.  If it's
+			 * still not detached after that, don't release it now.
+			 */
+			if (p->exit_signal != -1) {
 				do_notify_parent(p, p->exit_signal);
-				write_unlock_irq(&tasklist_lock);
+				if (p->exit_signal != -1)
+					p = NULL;
 			}
-			p = NULL;
 		}
-		else
-			write_unlock_irq(&tasklist_lock);
+		write_unlock_irq(&tasklist_lock);
 	}
 	if (p != NULL)
 		release_task(p);
diff --git a/kernel/extable.c b/kernel/extable.c
index fbbfbf4fd..7501b531c 100644
--- a/kernel/extable.c
+++ b/kernel/extable.c
@@ -40,7 +40,7 @@ const struct exception_table_entry *search_exception_tables(unsigned long addr)
 	return e;
 }
 
-int kernel_text_address(unsigned long addr)
+static int core_kernel_text(unsigned long addr)
 {
 	if (addr >= (unsigned long)_stext &&
 	    addr <= (unsigned long)_etext)
@@ -49,6 +49,19 @@ int kernel_text_address(unsigned long addr)
 	if (addr >= (unsigned long)_sinittext &&
 	    addr <= (unsigned long)_einittext)
 		return 1;
+	return 0;
+}
 
+int __kernel_text_address(unsigned long addr)
+{
+	if (core_kernel_text(addr))
+		return 1;
+	return __module_text_address(addr) != NULL;
+}
+
+int kernel_text_address(unsigned long addr)
+{
+	if (core_kernel_text(addr))
+		return 1;
 	return module_text_address(addr) != NULL;
 }
diff --git a/kernel/fork.c b/kernel/fork.c
index bfb4ad667..be07582f0 100644
--- a/kernel/fork.c
+++ b/kernel/fork.c
@@ -38,6 +38,7 @@
 #include <linux/rmap.h>
 #include <linux/vs_network.h>
 #include <linux/vs_limit.h>
+#include <linux/vs_memory.h>
 
 #include <asm/pgtable.h>
 #include <asm/pgalloc.h>
@@ -80,7 +81,6 @@ static kmem_cache_t *task_struct_cachep;
 static void free_task(struct task_struct *tsk)
 {
 	free_thread_info(tsk->thread_info);
-	vxdprintk("freeing up task %p\n", tsk);
 	clr_vx_info(&tsk->vx_info);
 	clr_nx_info(&tsk->nx_info);
 	free_task_struct(tsk);
@@ -906,7 +906,6 @@ struct task_struct *copy_process(unsigned long clone_flags,
 		goto fork_out;
 
 	retval = -ENOMEM;
-
 	p = dup_task_struct(current);
 	if (!p)
 		goto fork_out;
@@ -925,18 +924,18 @@ struct task_struct *copy_process(unsigned long clone_flags,
 	}
 	if (p->mm && vx_flags(VXF_FORK_RSS, 0)) {
 		if (!vx_rsspages_avail(p->mm, p->mm->rss))
-			goto bad_fork_free;
+			goto bad_fork_cleanup_vm;
 	}
 
 	retval = -EAGAIN;
         if (!vx_nproc_avail(1))
-                goto bad_fork_free;
+                goto bad_fork_cleanup_vm;
 
 	if (atomic_read(&p->user->processes) >=
 			p->rlim[RLIMIT_NPROC].rlim_cur) {
 		if (!capable(CAP_SYS_ADMIN) && !capable(CAP_SYS_RESOURCE) &&
 				p->user != &root_user)
-			goto bad_fork_free;
+			goto bad_fork_cleanup_vm;
 	}
 
 	atomic_inc(&p->user->__count);
@@ -1004,7 +1003,6 @@ struct task_struct *copy_process(unsigned long clone_flags,
  	}
 #endif
 
-	retval = -ENOMEM;
 	if ((retval = security_task_alloc(p)))
 		goto bad_fork_cleanup_policy;
 	if ((retval = audit_alloc(p)))
@@ -1124,12 +1122,12 @@ struct task_struct *copy_process(unsigned long clone_flags,
 		link_pid(p, p->pids + PIDTYPE_TGID, &p->group_leader->pids[PIDTYPE_TGID].pid);
 
 	nr_threads++;
-	vxi = current->vx_info;
+	/* p is copy of current */
+	vxi = p->vx_info;
 	if (vxi) {
 		atomic_inc(&vxi->cacct.nr_threads);
-		// atomic_inc(&vxi->limit.rcur[RLIMIT_NPROC]);
+		atomic_inc(&vxi->limit.rcur[RLIMIT_NPROC]);
 	}
-	vx_nproc_inc();
 	write_unlock_irq(&tasklist_lock);
 	retval = 0;
 
@@ -1173,6 +1171,9 @@ bad_fork_cleanup_count:
 	put_group_info(p->group_info);
 	atomic_dec(&p->user->processes);
 	free_uid(p->user);
+bad_fork_cleanup_vm:
+	if (p->mm && !(clone_flags & CLONE_VM))
+		vx_pages_sub(p->mm->mm_vx_info, RLIMIT_AS, p->mm->total_vm);
 bad_fork_free:
 	free_task(p);
 	goto fork_out;
diff --git a/kernel/futex.c b/kernel/futex.c
index abae250cf..9a25d76bd 100644
--- a/kernel/futex.c
+++ b/kernel/futex.c
@@ -276,7 +276,7 @@ static void wake_futex(struct futex_q *q)
 	 * The waiting task can free the futex_q as soon as this is written,
 	 * without taking any locks.  This must come last.
 	 */
-	q->lock_ptr = 0;
+	q->lock_ptr = NULL;
 }
 
 /*
@@ -704,7 +704,7 @@ asmlinkage long sys_futex(u32 __user *uaddr, int op, int val,
 	 * requeue parameter in 'utime' if op == FUTEX_REQUEUE.
 	 */
 	if (op >= FUTEX_REQUEUE)
-		val2 = (int) (long) utime;
+		val2 = (int) (unsigned long) utime;
 
 	return do_futex((unsigned long)uaddr, op, val, timeout,
 			(unsigned long)uaddr2, val2, val3);
diff --git a/kernel/itimer.c b/kernel/itimer.c
index 1a95e09b4..6918cb746 100644
--- a/kernel/itimer.c
+++ b/kernel/itimer.c
@@ -134,7 +134,7 @@ asmlinkage long sys_setitimer(int which,
 	} else
 		memset((char *) &set_buffer, 0, sizeof(set_buffer));
 
-	error = do_setitimer(which, &set_buffer, ovalue ? &get_buffer : 0);
+	error = do_setitimer(which, &set_buffer, ovalue ? &get_buffer : NULL);
 	if (error || !ovalue)
 		return error;
 
diff --git a/kernel/kallsyms.c b/kernel/kallsyms.c
index 21387087b..74ba3cb21 100644
--- a/kernel/kallsyms.c
+++ b/kernel/kallsyms.c
@@ -40,14 +40,14 @@ static inline int is_kernel_text(unsigned long addr)
 /* Lookup the address for this symbol. Returns 0 if not found. */
 unsigned long kallsyms_lookup_name(const char *name)
 {
-	char namebuf[128];
+	char namebuf[KSYM_NAME_LEN+1];
 	unsigned long i;
 	char *knames;
 
 	for (i = 0, knames = kallsyms_names; i < kallsyms_num_syms; i++) {
 		unsigned prefix = *knames++;
 
-		strlcpy(namebuf + prefix, knames, 127 - prefix);
+		strlcpy(namebuf + prefix, knames, KSYM_NAME_LEN - prefix);
 		if (strcmp(namebuf, name) == 0)
 			return kallsyms_addresses[i];
 
@@ -67,7 +67,7 @@ const char *kallsyms_lookup(unsigned long addr,
 	/* This kernel should never had been booted. */
 	BUG_ON(!kallsyms_addresses);
 
-	namebuf[127] = 0;
+	namebuf[KSYM_NAME_LEN] = 0;
 	namebuf[0] = 0;
 
 	if (is_kernel_text(addr) || is_kernel_inittext(addr)) {
@@ -84,7 +84,7 @@ const char *kallsyms_lookup(unsigned long addr,
 		/* Grab name */
 		for (i = 0; i <= best; i++) { 
 			unsigned prefix = *name++;
-			strncpy(namebuf + prefix, name, 127 - prefix);
+			strncpy(namebuf + prefix, name, KSYM_NAME_LEN - prefix);
 			name += strlen(name) + 1;
 		}
 
@@ -117,34 +117,22 @@ void __print_symbol(const char *fmt, unsigned long address)
 	char *modname;
 	const char *name;
 	unsigned long offset, size;
-	char namebuf[128];
+	char namebuf[KSYM_NAME_LEN+1];
+	char buffer[sizeof("%s+%#lx/%#lx [%s]") + KSYM_NAME_LEN +
+		    2*(BITS_PER_LONG*3/10) + MODULE_NAME_LEN + 1];
 
 	name = kallsyms_lookup(address, &size, &offset, &modname, namebuf);
 
-	if (!name) {
-		char addrstr[sizeof("0x%lx") + (BITS_PER_LONG*3/10)];
-
-		sprintf(addrstr, "0x%lx", address);
-		printk(fmt, addrstr);
-		return;
-	}
-
-	if (modname) {
-		/* This is pretty small. */
-		char buffer[sizeof("%s+%#lx/%#lx [%s]")
-			   + strlen(name) + 2*(BITS_PER_LONG*3/10)
-			   + strlen(modname)];
-
-		sprintf(buffer, "%s+%#lx/%#lx [%s]",
-			name, offset, size, modname);
-		printk(fmt, buffer);
-	} else {
-		char buffer[sizeof("%s+%#lx/%#lx")
-			   + strlen(name) + 2*(BITS_PER_LONG*3/10)];
-
-		sprintf(buffer, "%s+%#lx/%#lx", name, offset, size);
-		printk(fmt, buffer);
+	if (!name)
+		sprintf(buffer, "0x%lx", address);
+	else {
+		if (modname)
+			sprintf(buffer, "%s+%#lx/%#lx [%s]", name, offset,
+				size, modname);
+		else
+			sprintf(buffer, "%s+%#lx/%#lx", name, offset, size);
 	}
+	printk(fmt, buffer);
 }
 
 /* To avoid O(n^2) iteration, we carry prefix along. */
@@ -155,7 +143,7 @@ struct kallsym_iter
 	unsigned long value;
 	unsigned int nameoff; /* If iterating in core kernel symbols */
 	char type;
-	char name[128];
+	char name[KSYM_NAME_LEN+1];
 };
 
 /* Only label it "global" if it is exported. */
@@ -186,7 +174,8 @@ static unsigned long get_ksymbol_core(struct kallsym_iter *iter)
 	   shared with previous name (stem compression). */
 	stemlen = kallsyms_names[off++];
 
-	strlcpy(iter->name+stemlen, kallsyms_names + off, 128-stemlen);
+	strlcpy(iter->name+stemlen, kallsyms_names + off,
+		KSYM_NAME_LEN+1-stemlen);
 	off += strlen(kallsyms_names + off) + 1;
 	iter->owner = NULL;
 	iter->value = kallsyms_addresses[iter->pos];
@@ -320,5 +309,4 @@ int __init kallsyms_init(void)
 }
 __initcall(kallsyms_init);
 
-EXPORT_SYMBOL(kallsyms_lookup);
 EXPORT_SYMBOL(__print_symbol);
diff --git a/kernel/kmod.c b/kernel/kmod.c
index ea62192b7..579269c38 100644
--- a/kernel/kmod.c
+++ b/kernel/kmod.c
@@ -154,7 +154,6 @@ static int ____call_usermodehelper(void *data)
 {
 	struct subprocess_info *sub_info = data;
 	int retval;
-	cpumask_t mask = CPU_MASK_ALL;
 
 	/* Unblock all signals. */
 	flush_signals(current);
@@ -165,7 +164,7 @@ static int ____call_usermodehelper(void *data)
 	spin_unlock_irq(&current->sighand->siglock);
 
 	/* We can run anywhere, unlike our parent keventd(). */
-	set_cpus_allowed(current, mask);
+	set_cpus_allowed(current, CPU_MASK_ALL);
 
 	retval = -EPERM;
 	if (current->fs->root)
diff --git a/kernel/kthread.c b/kernel/kthread.c
index da0ec5b25..5689ebb1a 100644
--- a/kernel/kthread.c
+++ b/kernel/kthread.c
@@ -65,7 +65,6 @@ static int kthread(void *_create)
 	void *data;
 	sigset_t blocked;
 	int ret = -EINTR;
-	cpumask_t mask = CPU_MASK_ALL;
 
 	kthread_exit_files();
 
@@ -79,7 +78,7 @@ static int kthread(void *_create)
 	flush_signals(current);
 
 	/* By default we can run anywhere, unlike keventd. */
-	set_cpus_allowed(current, mask);
+	set_cpus_allowed(current, CPU_MASK_ALL);
 
 	/* OK, tell user we're spawned, wait for stop or wakeup */
 	__set_current_state(TASK_INTERRUPTIBLE);
diff --git a/kernel/module.c b/kernel/module.c
index e7a73bac2..dfe295ecf 100644
--- a/kernel/module.c
+++ b/kernel/module.c
@@ -36,7 +36,6 @@
 #include <linux/stop_machine.h>
 #include <asm/uaccess.h>
 #include <asm/semaphore.h>
-#include <asm/pgalloc.h>
 #include <asm/cacheflush.h>
 
 #if 0
@@ -52,9 +51,6 @@
 /* If this is set, the section belongs in the init part of the module */
 #define INIT_OFFSET_MASK (1UL << (BITS_PER_LONG-1))
 
-#define symbol_is(literal, string)				\
-	(strcmp(MODULE_SYMBOL_PREFIX literal, (string)) == 0)
-
 /* Protects module list */
 static spinlock_t modlist_lock = SPIN_LOCK_UNLOCKED;
 
@@ -717,7 +713,7 @@ static inline void module_unload_init(struct module *mod)
 }
 
 asmlinkage long
-sys_delete_module(const char *name_user, unsigned int flags)
+sys_delete_module(const char __user *name_user, unsigned int flags)
 {
 	return -ENOSYS;
 }
@@ -981,6 +977,104 @@ static unsigned long resolve_symbol(Elf_Shdr *sechdrs,
 	return ret;
 }
 
+
+/*
+ * /sys/module/foo/sections stuff
+ * J. Corbet <corbet@lwn.net>
+ */
+#ifdef CONFIG_KALLSYMS
+static void module_sect_attrs_release(struct kobject *kobj)
+{
+	kfree(container_of(kobj, struct module_sections, kobj));
+}
+
+static ssize_t module_sect_show(struct kobject *kobj, struct attribute *attr,
+		char *buf)
+{
+	struct module_sect_attr *sattr =
+		container_of(attr, struct module_sect_attr, attr);
+	return sprintf(buf, "0x%lx\n", sattr->address);
+}
+
+static struct sysfs_ops module_sect_ops = {
+	.show = module_sect_show,
+};
+
+static struct kobj_type module_sect_ktype = {
+	.sysfs_ops = &module_sect_ops,
+	.release =   module_sect_attrs_release,
+};
+
+static void add_sect_attrs(struct module *mod, unsigned int nsect,
+		char *secstrings, Elf_Shdr *sechdrs)
+{
+	unsigned int nloaded = 0, i;
+	struct module_sect_attr *sattr;
+	
+	if (!mod->mkobj)
+		return;
+	
+	/* Count loaded sections and allocate structures */
+	for (i = 0; i < nsect; i++)
+		if (sechdrs[i].sh_flags & SHF_ALLOC)
+			nloaded++;
+	mod->sect_attrs = kmalloc(sizeof(struct module_sections) +
+			nloaded*sizeof(mod->sect_attrs->attrs[0]), GFP_KERNEL);
+	if (! mod->sect_attrs)
+		return;
+
+	/* sections entry setup */
+	memset(mod->sect_attrs, 0, sizeof(struct module_sections));
+	if (kobject_set_name(&mod->sect_attrs->kobj, "sections"))
+		goto out;
+	mod->sect_attrs->kobj.parent = &mod->mkobj->kobj;
+	mod->sect_attrs->kobj.ktype = &module_sect_ktype;
+	if (kobject_register(&mod->sect_attrs->kobj))
+		goto out;
+
+	/* And the section attributes. */
+	sattr = &mod->sect_attrs->attrs[0];
+	for (i = 0; i < nsect; i++) {
+		if (! (sechdrs[i].sh_flags & SHF_ALLOC))
+			continue;
+		sattr->address = sechdrs[i].sh_addr;
+		strlcpy(sattr->name, secstrings + sechdrs[i].sh_name,
+				MODULE_SECT_NAME_LEN);
+		sattr->attr.name = sattr->name;
+		sattr->attr.owner = mod;
+		sattr->attr.mode = S_IRUGO;
+		(void) sysfs_create_file(&mod->sect_attrs->kobj, &sattr->attr);
+		sattr++;
+	}
+	return;
+  out:
+	kfree(mod->sect_attrs);
+	mod->sect_attrs = NULL;
+}
+
+static void remove_sect_attrs(struct module *mod)
+{
+	if (mod->sect_attrs) {
+		kobject_unregister(&mod->sect_attrs->kobj);
+		mod->sect_attrs = NULL;
+	}
+}
+
+
+#else
+static inline void add_sect_attrs(struct module *mod, unsigned int nsect,
+		char *sectstrings, Elf_Shdr *sechdrs)
+{
+}
+
+static inline void remove_sect_attrs(struct module *mod)
+{
+}
+#endif /* CONFIG_KALLSYMS */
+
+
+
+
 #define to_module_attr(n) container_of(n, struct module_attribute, attr);
 
 static ssize_t module_attr_show(struct kobject *kobj,
@@ -1099,6 +1193,7 @@ static void free_module(struct module *mod)
 	list_del(&mod->list);
 	spin_unlock_irq(&modlist_lock);
 
+	remove_sect_attrs(mod);
 	mod_kobject_remove(mod);
 
 	/* Arch-specific cleanup. */
@@ -1712,6 +1807,7 @@ static struct module *load_module(void __user *umod,
 			      / sizeof(struct kernel_param));
 	if (err < 0)
 		goto arch_cleanup;
+	add_sect_attrs(mod, hdr->e_shnum, secstrings, sechdrs);
 
 	/* Get rid of temporary copy */
 	vfree(hdr);
@@ -2029,7 +2125,7 @@ const struct exception_table_entry *search_module_extables(unsigned long addr)
 }
 
 /* Is this a valid kernel address?  We don't grab the lock: we are oopsing. */
-struct module *module_text_address(unsigned long addr)
+struct module *__module_text_address(unsigned long addr)
 {
 	struct module *mod;
 
@@ -2040,6 +2136,18 @@ struct module *module_text_address(unsigned long addr)
 	return NULL;
 }
 
+struct module *module_text_address(unsigned long addr)
+{
+	struct module *mod;
+	unsigned long flags;
+
+	spin_lock_irqsave(&modlist_lock, flags);
+	mod = __module_text_address(addr);
+	spin_unlock_irqrestore(&modlist_lock, flags);
+
+	return mod;
+}
+
 /* Don't grab lock, we're oopsing. */
 void print_modules(void)
 {
diff --git a/kernel/posix-timers.c b/kernel/posix-timers.c
index f846b77a2..42c248688 100644
--- a/kernel/posix-timers.c
+++ b/kernel/posix-timers.c
@@ -7,6 +7,9 @@
  *
  *			     Copyright (C) 2002 2003 by MontaVista Software.
  *
+ * 2004-06-01  Fix CLOCK_REALTIME clock/timer TIMER_ABSTIME bug.
+ *			     Copyright (C) 2004 Boris Hu
+ *
  * 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
@@ -41,6 +44,7 @@
 #include <linux/idr.h>
 #include <linux/posix-timers.h>
 #include <linux/wait.h>
+#include <linux/workqueue.h>
 
 #ifndef div_long_long_rem
 #include <asm/div64.h>
@@ -169,6 +173,12 @@ static spinlock_t idr_lock = SPIN_LOCK_UNLOCKED;
  */
 
 static struct k_clock posix_clocks[MAX_CLOCKS];
+/*
+ * We only have one real clock that can be set so we need only one abs list,
+ * even if we should want to have several clocks with differing resolutions.
+ */
+static struct k_clock_abs abs_list = {.list = LIST_HEAD_INIT(abs_list.list),
+				      .lock = SPIN_LOCK_UNLOCKED};
 
 #define if_clock_do(clock_fun,alt_fun,parms) \
 		(!clock_fun) ? alt_fun parms : clock_fun parms
@@ -200,8 +210,11 @@ static inline void unlock_timer(struct k_itimer *timr, unsigned long flags)
  */
 static __init int init_posix_timers(void)
 {
-	struct k_clock clock_realtime = {.res = CLOCK_REALTIME_RES };
+	struct k_clock clock_realtime = {.res = CLOCK_REALTIME_RES,
+					 .abs_struct = &abs_list
+	};
 	struct k_clock clock_monotonic = {.res = CLOCK_REALTIME_RES,
+		.abs_struct = NULL,
 		.clock_get = do_posix_clock_monotonic_gettime,
 		.clock_set = do_posix_clock_monotonic_settime
 	};
@@ -210,9 +223,8 @@ static __init int init_posix_timers(void)
 	register_posix_clock(CLOCK_MONOTONIC, &clock_monotonic);
 
 	posix_timers_cache = kmem_cache_create("posix_timers_cache",
-					sizeof (struct k_itimer), 0, 0, 0, 0);
+					sizeof (struct k_itimer), 0, 0, NULL, NULL);
 	idr_init(&posix_timers_id);
-
 	return 0;
 }
 
@@ -239,19 +251,92 @@ static void tstojiffie(struct timespec *tp, int res, u64 *jiff)
 		   (NSEC_JIFFIE_SC - SEC_JIFFIE_SC))) >> SEC_JIFFIE_SC;
 }
 
+/*
+ * This function adjusts the timer as needed as a result of the clock
+ * being set.  It should only be called for absolute timers, and then
+ * under the abs_list lock.  It computes the time difference and sets
+ * the new jiffies value in the timer.  It also updates the timers
+ * reference wall_to_monotonic value.  It is complicated by the fact
+ * that tstojiffies() only handles positive times and it needs to work
+ * with both positive and negative times.  Also, for negative offsets,
+ * we need to defeat the res round up.
+ *
+ * Return is true if there is a new time, else false.
+ */
+static long add_clockset_delta(struct k_itimer *timr,
+			       struct timespec *new_wall_to)
+{
+	struct timespec delta;
+	int sign = 0;
+	u64 exp;
+
+	set_normalized_timespec(&delta,
+				new_wall_to->tv_sec -
+				timr->wall_to_prev.tv_sec,
+				new_wall_to->tv_nsec -
+				timr->wall_to_prev.tv_nsec);
+	if (likely(!(delta.tv_sec | delta.tv_nsec)))
+		return 0;
+	if (delta.tv_sec < 0) {
+		set_normalized_timespec(&delta,
+					-delta.tv_sec,
+					1 - delta.tv_nsec -
+					posix_clocks[timr->it_clock].res);
+		sign++;
+	}
+	tstojiffie(&delta, posix_clocks[timr->it_clock].res, &exp);
+	timr->wall_to_prev = *new_wall_to;
+	timr->it_timer.expires += (sign ? -exp : exp);
+	return 1;
+}
+
+static void remove_from_abslist(struct k_itimer *timr)
+{
+	if (!list_empty(&timr->abs_timer_entry)) {
+		spin_lock(&abs_list.lock);
+		list_del_init(&timr->abs_timer_entry);
+		spin_unlock(&abs_list.lock);
+	}
+}
+
 static void schedule_next_timer(struct k_itimer *timr)
 {
+	struct timespec new_wall_to;
 	struct now_struct now;
+	unsigned long seq;
 
-	/* Set up the timer for the next interval (if there is one) */
+	/*
+	 * Set up the timer for the next interval (if there is one).
+	 * Note: this code uses the abs_timer_lock to protect
+	 * wall_to_prev and must hold it until exp is set, not exactly
+	 * obvious...
+
+	 * This function is used for CLOCK_REALTIME* and
+	 * CLOCK_MONOTONIC* timers.  If we ever want to handle other
+	 * CLOCKs, the calling code (do_schedule_next_timer) would need
+	 * to pull the "clock" info from the timer and dispatch the
+	 * "other" CLOCKs "next timer" code (which, I suppose should
+	 * also be added to the k_clock structure).
+	 */
 	if (!timr->it_incr) 
 		return;
 
-	posix_get_now(&now);
 	do {
-		posix_bump_timer(timr);
-	}while (posix_time_before(&timr->it_timer, &now));
+		seq = read_seqbegin(&xtime_lock);
+		new_wall_to =	wall_to_monotonic;
+		posix_get_now(&now);
+	} while (read_seqretry(&xtime_lock, seq));
+
+	if (!list_empty(&timr->abs_timer_entry)) {
+		spin_lock(&abs_list.lock);
+		add_clockset_delta(timr, &new_wall_to);
 
+		posix_bump_timer(timr, now);
+
+		spin_unlock(&abs_list.lock);
+	} else {
+		posix_bump_timer(timr, now);
+	}
 	timr->it_overrun_last = timr->it_overrun;
 	timr->it_overrun = -1;
 	++timr->it_requeue_pending;
@@ -312,7 +397,15 @@ static void timer_notify_task(struct k_itimer *timr)
 
 	memset(&timr->sigq->info, 0, sizeof(siginfo_t));
 
-	/* Send signal to the process that owns this timer. */
+	/*
+	 * Send signal to the process that owns this timer.
+
+	 * This code assumes that all the possible abs_lists share the
+	 * same lock (there is only one list at this time). If this is
+	 * not the case, the CLOCK info would need to be used to find
+	 * the proper abs list lock.
+	 */
+
 	timr->sigq->info.si_signo = timr->it_sigev_signo;
 	timr->sigq->info.si_errno = 0;
 	timr->sigq->info.si_code = SI_TIMER;
@@ -320,6 +413,9 @@ static void timer_notify_task(struct k_itimer *timr)
 	timr->sigq->info.si_value = timr->it_sigev_value;
 	if (timr->it_incr)
 		timr->sigq->info.si_sys_private = ++timr->it_requeue_pending;
+	else {
+		remove_from_abslist(timr);
+	}
 
 	if (timr->it_sigev_notify & SIGEV_THREAD_ID) {
 		if (unlikely(timr->it_process->flags & PF_EXITING)) {
@@ -350,16 +446,51 @@ static void timer_notify_task(struct k_itimer *timr)
  * This function gets called when a POSIX.1b interval timer expires.  It
  * is used as a callback from the kernel internal timer.  The
  * run_timer_list code ALWAYS calls with interrutps on.
+
+ * This code is for CLOCK_REALTIME* and CLOCK_MONOTONIC* timers.
  */
 static void posix_timer_fn(unsigned long __data)
 {
 	struct k_itimer *timr = (struct k_itimer *) __data;
 	unsigned long flags;
+	unsigned long seq;
+	struct timespec delta, new_wall_to;
+	u64 exp = 0;
+	int do_notify = 1;
 
 	spin_lock_irqsave(&timr->it_lock, flags);
  	set_timer_inactive(timr);
-	timer_notify_task(timr);
-	unlock_timer(timr, flags);
+	if (!list_empty(&timr->abs_timer_entry)) {
+		spin_lock(&abs_list.lock);
+		do {
+			seq = read_seqbegin(&xtime_lock);
+			new_wall_to =	wall_to_monotonic;
+		} while (read_seqretry(&xtime_lock, seq));
+		set_normalized_timespec(&delta,
+					new_wall_to.tv_sec -
+					timr->wall_to_prev.tv_sec,
+					new_wall_to.tv_nsec -
+					timr->wall_to_prev.tv_nsec);
+		if (likely((delta.tv_sec | delta.tv_nsec ) == 0)) {
+			/* do nothing, timer is on time */
+		} else if (delta.tv_sec < 0) {
+			/* do nothing, timer is already late */
+		} else {
+			/* timer is early due to a clock set */
+			tstojiffie(&delta,
+				   posix_clocks[timr->it_clock].res,
+				   &exp);
+			timr->wall_to_prev = new_wall_to;
+			timr->it_timer.expires += exp;
+			add_timer(&timr->it_timer);
+			do_notify = 0;
+		}
+		spin_unlock(&abs_list.lock);
+
+	}
+	if (do_notify)
+		timer_notify_task(timr);
+	unlock_timer(timr, flags); /* hold thru abs lock to keep irq off */
 }
 
 
@@ -397,17 +528,19 @@ static struct k_itimer * alloc_posix_timer(void)
 	if (!tmr)
 		return tmr;
 	memset(tmr, 0, sizeof (struct k_itimer));
-	tmr->it_id = (timer_t)-1;
+	INIT_LIST_HEAD(&tmr->abs_timer_entry);
 	if (unlikely(!(tmr->sigq = sigqueue_alloc()))) {
 		kmem_cache_free(posix_timers_cache, tmr);
-		tmr = 0;
+		tmr = NULL;
 	}
 	return tmr;
 }
 
-static void release_posix_timer(struct k_itimer *tmr)
+#define IT_ID_SET	1
+#define IT_ID_NOT_SET	0
+static void release_posix_timer(struct k_itimer *tmr, int it_id_set)
 {
-	if (tmr->it_id != -1) {
+	if (it_id_set) {
 		unsigned long flags;
 		spin_lock_irqsave(&idr_lock, flags);
 		idr_remove(&posix_timers_id, tmr->it_id);
@@ -429,10 +562,11 @@ sys_timer_create(clockid_t which_clock,
 {
 	int error = 0;
 	struct k_itimer *new_timer = NULL;
-	timer_t new_timer_id;
-	struct task_struct *process = 0;
+	int new_timer_id;
+	struct task_struct *process = NULL;
 	unsigned long flags;
 	sigevent_t event;
+	int it_id_set = IT_ID_NOT_SET;
 
 	if ((unsigned) which_clock >= MAX_CLOCKS ||
 				!posix_clocks[which_clock].res)
@@ -443,19 +577,38 @@ sys_timer_create(clockid_t which_clock,
 		return -EAGAIN;
 
 	spin_lock_init(&new_timer->it_lock);
-	do {
-		if (unlikely(!idr_pre_get(&posix_timers_id, GFP_KERNEL))) {
-			error = -EAGAIN;
-			new_timer->it_id = (timer_t)-1;
-			goto out;
-		}
-		spin_lock_irq(&idr_lock);
-		new_timer_id = (timer_t) idr_get_new(&posix_timers_id,
-							(void *) new_timer);
-		spin_unlock_irq(&idr_lock);
-	} while (unlikely(new_timer_id == -1));
+ retry:
+	if (unlikely(!idr_pre_get(&posix_timers_id, GFP_KERNEL))) {
+		error = -EAGAIN;
+		goto out;
+	}
+	spin_lock_irq(&idr_lock);
+	error = idr_get_new(&posix_timers_id,
+			    (void *) new_timer,
+			    &new_timer_id);
+	spin_unlock_irq(&idr_lock);
+	if (error == -EAGAIN)
+		goto retry;
+	else if (error) {
+		/*
+		 * Wierd looking, but we return EAGAIN if the IDR is
+		 * full (proper POSIX return value for this)
+		 */
+		error = -EAGAIN;
+		goto out;
+	}
+
+	it_id_set = IT_ID_SET;
+	new_timer->it_id = (timer_t) new_timer_id;
+	new_timer->it_clock = which_clock;
+	new_timer->it_incr = 0;
+	new_timer->it_overrun = -1;
+	init_timer(&new_timer->it_timer);
+	new_timer->it_timer.expires = 0;
+	new_timer->it_timer.data = (unsigned long) new_timer;
+	new_timer->it_timer.function = posix_timer_fn;
+	set_timer_inactive(new_timer);
 
-	new_timer->it_id = new_timer_id;
 	/*
 	 * return the timer_id now.  The next step is hard to
 	 * back out if there is an error.
@@ -470,6 +623,10 @@ sys_timer_create(clockid_t which_clock,
 			error = -EFAULT;
 			goto out;
 		}
+		new_timer->it_sigev_notify = event.sigev_notify;
+		new_timer->it_sigev_signo = event.sigev_signo;
+		new_timer->it_sigev_value = event.sigev_value;
+
 		read_lock(&tasklist_lock);
 		if ((process = good_sigevent(&event))) {
 			/*
@@ -489,13 +646,14 @@ sys_timer_create(clockid_t which_clock,
 			 */
 			spin_lock_irqsave(&process->sighand->siglock, flags);
 			if (!(process->flags & PF_EXITING)) {
+				new_timer->it_process = process;
 				list_add(&new_timer->list,
 					 &process->signal->posix_timers);
 				spin_unlock_irqrestore(&process->sighand->siglock, flags);
 				get_task_struct(process);
 			} else {
 				spin_unlock_irqrestore(&process->sighand->siglock, flags);
-				process = 0;
+				process = NULL;
 			}
 		}
 		read_unlock(&tasklist_lock);
@@ -503,35 +661,27 @@ sys_timer_create(clockid_t which_clock,
 			error = -EINVAL;
 			goto out;
 		}
-		new_timer->it_sigev_notify = event.sigev_notify;
-		new_timer->it_sigev_signo = event.sigev_signo;
-		new_timer->it_sigev_value = event.sigev_value;
 	} else {
 		new_timer->it_sigev_notify = SIGEV_SIGNAL;
 		new_timer->it_sigev_signo = SIGALRM;
 		new_timer->it_sigev_value.sival_int = new_timer->it_id;
 		process = current->group_leader;
 		spin_lock_irqsave(&process->sighand->siglock, flags);
+		new_timer->it_process = process;
 		list_add(&new_timer->list, &process->signal->posix_timers);
 		spin_unlock_irqrestore(&process->sighand->siglock, flags);
 	}
 
-	new_timer->it_clock = which_clock;
-	new_timer->it_incr = 0;
-	new_timer->it_overrun = -1;
-	init_timer(&new_timer->it_timer);
-	new_timer->it_timer.expires = 0;
-	new_timer->it_timer.data = (unsigned long) new_timer;
-	new_timer->it_timer.function = posix_timer_fn;
-	set_timer_inactive(new_timer);
-
-	/*
-	 * Once we set the process, it can be found so do it last...
+ 	/*
+	 * In the case of the timer belonging to another task, after
+	 * the task is unlocked, the timer is owned by the other task
+	 * and may cease to exist at any time.  Don't use or modify
+	 * new_timer after the unlock call.
 	 */
-	new_timer->it_process = process;
+
 out:
 	if (error)
-		release_posix_timer(new_timer);
+		release_posix_timer(new_timer, it_id_set);
 
 	return error;
 }
@@ -626,8 +776,7 @@ do_timer_gettime(struct k_itimer *timr, struct itimerspec *cur_setting)
 	if (expires) {
 		if (timr->it_requeue_pending & REQUEUE_PENDING ||
 		    (timr->it_sigev_notify & ~SIGEV_THREAD_ID) == SIGEV_NONE) {
-			while (posix_time_before(&timr->it_timer, &now))
-				posix_bump_timer(timr);
+			posix_bump_timer(timr, now);
 			expires = timr->it_timer.expires;
 		}
 		else
@@ -703,11 +852,10 @@ sys_timer_getoverrun(timer_t timer_id)
  * time to it to get the proper time for the timer.
  */
 static int adjust_abs_time(struct k_clock *clock, struct timespec *tp, 
-			   int abs, u64 *exp)
+			   int abs, u64 *exp, struct timespec *wall_to)
 {
 	struct timespec now;
 	struct timespec oc = *tp;
-	struct timespec wall_to_mono;
 	u64 jiffies_64_f;
 	int rtn =0;
 
@@ -715,15 +863,15 @@ static int adjust_abs_time(struct k_clock *clock, struct timespec *tp,
 		/*
 		 * The mask pick up the 4 basic clocks 
 		 */
-		if (!(clock - &posix_clocks[0]) & ~CLOCKS_MASK) {
+		if (!((clock - &posix_clocks[0]) & ~CLOCKS_MASK)) {
 			jiffies_64_f = do_posix_clock_monotonic_gettime_parts(
-				&now,  &wall_to_mono);
+				&now,  wall_to);
 			/*
 			 * If we are doing a MONOTONIC clock
 			 */
 			if((clock - &posix_clocks[0]) & CLOCKS_MONO){
-				now.tv_sec += wall_to_mono.tv_sec;
-				now.tv_nsec += wall_to_mono.tv_nsec;
+				now.tv_sec += wall_to->tv_sec;
+				now.tv_nsec += wall_to->tv_nsec;
 			}
 		} else {
 			/*
@@ -813,6 +961,8 @@ do_timer_settime(struct k_itimer *timr, int flags,
 #else
 	del_timer(&timr->it_timer);
 #endif
+	remove_from_abslist(timr);
+
 	timr->it_requeue_pending = (timr->it_requeue_pending + 2) & 
 		~REQUEUE_PENDING;
 	timr->it_overrun_last = 0;
@@ -827,24 +977,25 @@ do_timer_settime(struct k_itimer *timr, int flags,
 
 	if (adjust_abs_time(clock,
 			    &new_setting->it_value, flags & TIMER_ABSTIME, 
-			    &expire_64)) {
+			    &expire_64, &(timr->wall_to_prev))) {
 		return -EINVAL;
 	}
 	timr->it_timer.expires = (unsigned long)expire_64;	
 	tstojiffie(&new_setting->it_interval, clock->res, &expire_64);
 	timr->it_incr = (unsigned long)expire_64;
 
-
 	/*
-	 * For some reason the timer does not fire immediately if expires is
-	 * equal to jiffies, so the timer notify function is called directly.
-	 * We do not even queue SIGEV_NONE timers!
+	 * We do not even queue SIGEV_NONE timers!  But we do put them
+	 * in the abs list so we can do that right.
 	 */
-	if (((timr->it_sigev_notify & ~SIGEV_THREAD_ID) != SIGEV_NONE)) {
-		if (timr->it_timer.expires == jiffies)
-			timer_notify_task(timr);
-		else
-			add_timer(&timr->it_timer);
+	if (((timr->it_sigev_notify & ~SIGEV_THREAD_ID) != SIGEV_NONE))
+		add_timer(&timr->it_timer);
+
+	if (flags & TIMER_ABSTIME && clock->abs_struct) {
+		spin_lock(&clock->abs_struct->lock);
+		list_add_tail(&(timr->abs_timer_entry),
+			      &(clock->abs_struct->list));
+		spin_unlock(&clock->abs_struct->lock);
 	}
 	return 0;
 }
@@ -878,7 +1029,7 @@ retry:
 	if (!posix_clocks[timr->it_clock].timer_set)
 		error = do_timer_settime(timr, flags, &new_spec, rtn);
 	else
-		error = posix_clocks[timr->it_clock].timer_set(timr,
+	        error = posix_clocks[timr->it_clock].timer_set(timr,
 							       flags,
 							       &new_spec, rtn);
 	unlock_timer(timr, flag);
@@ -911,6 +1062,8 @@ static inline int do_timer_delete(struct k_itimer *timer)
 #else
 	del_timer(&timer->it_timer);
 #endif
+	remove_from_abslist(timer);
+
 	return 0;
 }
 
@@ -952,7 +1105,7 @@ retry_delete:
 	timer->it_process = NULL;
 	}
 	unlock_timer(timer, flags);
-	release_posix_timer(timer);
+	release_posix_timer(timer, IT_ID_SET);
 	return 0;
 }
 /*
@@ -989,7 +1142,7 @@ retry_delete:
 		timer->it_process = NULL;
 	}
 	unlock_timer(timer, flags);
-	release_posix_timer(timer);
+	release_posix_timer(timer, IT_ID_SET);
 }
 
 /*
@@ -1153,13 +1306,93 @@ static void nanosleep_wake_up(unsigned long __data)
  * On locking, clock_was_set() is called from update_wall_clock which
  * holds (or has held for it) a write_lock_irq( xtime_lock) and is
  * called from the timer bh code.  Thus we need the irq save locks.
+ *
+ * Also, on the call from update_wall_clock, that is done as part of a
+ * softirq thing.  We don't want to delay the system that much (possibly
+ * long list of timers to fix), so we defer that work to keventd.
  */
 
 static DECLARE_WAIT_QUEUE_HEAD(nanosleep_abs_wqueue);
+static DECLARE_WORK(clock_was_set_work, (void(*)(void*))clock_was_set, NULL);
+
+static DECLARE_MUTEX(clock_was_set_lock);
 
 void clock_was_set(void)
 {
+	struct k_itimer *timr;
+	struct timespec new_wall_to;
+	LIST_HEAD(cws_list);
+	unsigned long seq;
+
+
+	if (unlikely(in_interrupt())) {
+		schedule_work(&clock_was_set_work);
+		return;
+	}
 	wake_up_all(&nanosleep_abs_wqueue);
+
+	/*
+	 * Check if there exist TIMER_ABSTIME timers to correct.
+	 *
+	 * Notes on locking: This code is run in task context with irq
+	 * on.  We CAN be interrupted!  All other usage of the abs list
+	 * lock is under the timer lock which holds the irq lock as
+	 * well.  We REALLY don't want to scan the whole list with the
+	 * interrupt system off, AND we would like a sequence lock on
+	 * this code as well.  Since we assume that the clock will not
+	 * be set often, it seems ok to take and release the irq lock
+	 * for each timer.  In fact add_timer will do this, so this is
+	 * not an issue.  So we know when we are done, we will move the
+	 * whole list to a new location.  Then as we process each entry,
+	 * we will move it to the actual list again.  This way, when our
+	 * copy is empty, we are done.  We are not all that concerned
+	 * about preemption so we will use a semaphore lock to protect
+	 * aginst reentry.  This way we will not stall another
+	 * processor.  It is possible that this may delay some timers
+	 * that should have expired, given the new clock, but even this
+	 * will be minimal as we will always update to the current time,
+	 * even if it was set by a task that is waiting for entry to
+	 * this code.  Timers that expire too early will be caught by
+	 * the expire code and restarted.
+
+	 * Absolute timers that repeat are left in the abs list while
+	 * waiting for the task to pick up the signal.  This means we
+	 * may find timers that are not in the "add_timer" list, but are
+	 * in the abs list.  We do the same thing for these, save
+	 * putting them back in the "add_timer" list.  (Note, these are
+	 * left in the abs list mainly to indicate that they are
+	 * ABSOLUTE timers, a fact that is used by the re-arm code, and
+	 * for which we have no other flag.)
+
+	 */
+
+	down(&clock_was_set_lock);
+	spin_lock_irq(&abs_list.lock);
+	list_splice_init(&abs_list.list, &cws_list);
+	spin_unlock_irq(&abs_list.lock);
+	do {
+		do {
+			seq = read_seqbegin(&xtime_lock);
+			new_wall_to =	wall_to_monotonic;
+		} while (read_seqretry(&xtime_lock, seq));
+
+		spin_lock_irq(&abs_list.lock);
+		if (list_empty(&cws_list)) {
+			spin_unlock_irq(&abs_list.lock);
+			break;
+		}
+		timr = list_entry(cws_list.next, struct k_itimer,
+				   abs_timer_entry);
+
+		list_del_init(&timr->abs_timer_entry);
+		if (add_clockset_delta(timr, &new_wall_to) &&
+		    del_timer(&timr->it_timer))  /* timer run yet? */
+			add_timer(&timr->it_timer);
+		list_add(&timr->abs_timer_entry, &abs_list.list);
+		spin_unlock_irq(&abs_list.lock);
+	} while (1);
+
+	up(&clock_was_set_lock);
 }
 
 long clock_nanosleep_restart(struct restart_block *restart_block);
@@ -1202,7 +1435,7 @@ sys_clock_nanosleep(clockid_t which_clock, int flags,
 long
 do_clock_nanosleep(clockid_t which_clock, int flags, struct timespec *tsave)
 {
-	struct timespec t;
+	struct timespec t, dum;
 	struct timer_list new_timer;
 	DECLARE_WAITQUEUE(abs_wqueue, current);
 	u64 rq_time = (u64)0;
@@ -1242,7 +1475,7 @@ do_clock_nanosleep(clockid_t which_clock, int flags, struct timespec *tsave)
 		t = *tsave;
 		if (abs || !rq_time) {
 			adjust_abs_time(&posix_clocks[which_clock], &t, abs,
-					&rq_time);
+					&rq_time, &dum);
 			rq_time += (t.tv_sec || t.tv_nsec);
 		}
 
diff --git a/kernel/power/Makefile b/kernel/power/Makefile
index d00edd15c..2509213f5 100644
--- a/kernel/power/Makefile
+++ b/kernel/power/Makefile
@@ -1,5 +1,8 @@
+
+swsusp-smp-$(CONFIG_SMP)	+= smp.o
+
 obj-y				:= main.o process.o console.o pm.o
-obj-$(CONFIG_SOFTWARE_SUSPEND)	+= swsusp.o
+obj-$(CONFIG_SOFTWARE_SUSPEND)	+= swsusp.o $(swsusp-smp-y)
 obj-$(CONFIG_PM_DISK)		+= disk.o pmdisk.o
 
 obj-$(CONFIG_MAGIC_SYSRQ)	+= poweroff.o
diff --git a/kernel/power/pm.c b/kernel/power/pm.c
index 09d55363c..d1bc94307 100644
--- a/kernel/power/pm.c
+++ b/kernel/power/pm.c
@@ -282,7 +282,7 @@ struct pm_dev *pm_find(pm_dev_t type, struct pm_dev *from)
 			return dev;
 		entry = entry->next;
 	}
-	return 0;
+	return NULL;
 }
 
 EXPORT_SYMBOL(pm_register);
diff --git a/kernel/power/pmdisk.c b/kernel/power/pmdisk.c
index 22855abbd..318bfb9fa 100644
--- a/kernel/power/pmdisk.c
+++ b/kernel/power/pmdisk.c
@@ -732,19 +732,6 @@ int pmdisk_resume(void)
 
 /* More restore stuff */
 
-/* FIXME: Why not memcpy(to, from, 1<<pagedir_order*PAGE_SIZE)? */
-static void __init copy_pagedir(suspend_pagedir_t *to, suspend_pagedir_t *from)
-{
-	int i;
-	char *topointer=(char *)to, *frompointer=(char *)from;
-
-	for(i=0; i < 1 << pagedir_order; i++) {
-		copy_page(topointer, frompointer);
-		topointer += PAGE_SIZE;
-		frompointer += PAGE_SIZE;
-	}
-}
-
 #define does_collide(addr) does_collide_order(pm_pagedir_nosave, addr, 0)
 
 /*
@@ -792,9 +779,10 @@ static int __init relocate_pagedir(void)
 	 * We have to avoid recursion (not to overflow kernel stack),
 	 * and that's why code looks pretty cryptic 
 	 */
-	suspend_pagedir_t *new_pagedir, *old_pagedir = pm_pagedir_nosave;
+	suspend_pagedir_t *old_pagedir = pm_pagedir_nosave;
 	void **eaten_memory = NULL;
 	void **c = eaten_memory, *m, *f;
+	int err;
 
 	pr_debug("pmdisk: Relocating pagedir\n");
 
@@ -803,32 +791,31 @@ static int __init relocate_pagedir(void)
 		return 0;
 	}
 
-	while ((m = (void *) __get_free_pages(GFP_ATOMIC, pagedir_order))) {
-		memset(m, 0, PAGE_SIZE);
-		if (!does_collide_order(old_pagedir, (unsigned long)m, pagedir_order))
+	err = -ENOMEM;
+	while ((m = (void *) __get_free_pages(GFP_ATOMIC, pagedir_order)) != NULL) {
+		if (!does_collide_order(old_pagedir, (unsigned long)m,
+					pagedir_order)) {
+			pm_pagedir_nosave =
+				memcpy(m, old_pagedir,
+				       PAGE_SIZE << pagedir_order);
+			err = 0;
 			break;
+		}
 		eaten_memory = m;
 		printk( "." ); 
 		*eaten_memory = c;
 		c = eaten_memory;
 	}
 
-	if (!m)
-		return -ENOMEM;
-
-	pm_pagedir_nosave = new_pagedir = m;
-	copy_pagedir(new_pagedir, old_pagedir);
-
 	c = eaten_memory;
 	while(c) {
 		printk(":");
-		f = *c;
+		f = c;
 		c = *c;
-		if (f)
-			free_pages((unsigned long)f, pagedir_order);
+		free_pages((unsigned long)f, pagedir_order);
 	}
 	printk("|\n");
-	return 0;
+	return err;
 }
 
 
@@ -966,7 +953,7 @@ static const char * __init sanity_check(void)
 		return "machine";
 	if(pmdisk_info.cpus != num_online_cpus())
 		return "number of cpus";
-	return 0;
+	return NULL;
 }
 
 
diff --git a/kernel/power/poweroff.c b/kernel/power/poweroff.c
index d921459b8..875d8f11a 100644
--- a/kernel/power/poweroff.c
+++ b/kernel/power/poweroff.c
@@ -21,7 +21,7 @@ static void do_poweroff(void *dummy)
 		pm_power_off();
 }
 
-static DECLARE_WORK(poweroff_work, do_poweroff, 0);
+static DECLARE_WORK(poweroff_work, do_poweroff, NULL);
 
 static void handle_poweroff(int key, struct pt_regs *pt_regs,
 				struct tty_struct *tty)
diff --git a/kernel/power/process.c b/kernel/power/process.c
index 347435415..0d1f63ec7 100644
--- a/kernel/power/process.c
+++ b/kernel/power/process.c
@@ -109,7 +109,6 @@ void thaw_processes(void)
 			wake_up_process(p);
 		} else
 			printk(KERN_INFO " Strange, %s not stopped\n", p->comm );
-		wake_up_process(p);
 	} while_each_thread(g, p);
 
 	read_unlock(&tasklist_lock);
diff --git a/kernel/power/swsusp.c b/kernel/power/swsusp.c
index 752f6cdb4..081b65103 100644
--- a/kernel/power/swsusp.c
+++ b/kernel/power/swsusp.c
@@ -317,7 +317,8 @@ static int write_suspend_image(void)
 	for (i=0; i<nr_copy_pages; i++) {
 		if (!(i%100))
 			printk( "." );
-		if (!(entry = get_swap_page()).val)
+		entry = get_swap_page();
+		if (!entry.val)
 			panic("\nNot enough swapspace when writing data" );
 		
 		if (swapfile_used[swp_type(entry)] != SWAPFILE_SUSPEND)
@@ -334,7 +335,8 @@ static int write_suspend_image(void)
 		cur = (union diskpage *)((char *) pagedir_nosave)+i;
 		BUG_ON ((char *) cur != (((char *) pagedir_nosave) + i*PAGE_SIZE));
 		printk( "." );
-		if (!(entry = get_swap_page()).val) {
+		entry = get_swap_page();
+		if (!entry.val) {
 			printk(KERN_CRIT "Not enough swapspace when writing pgdir\n" );
 			panic("Don't know how to recover");
 			free_page((unsigned long) buffer);
@@ -356,7 +358,8 @@ static int write_suspend_image(void)
 	BUG_ON (sizeof(struct suspend_header) > PAGE_SIZE-sizeof(swp_entry_t));
 	BUG_ON (sizeof(union diskpage) != PAGE_SIZE);
 	BUG_ON (sizeof(struct link) != PAGE_SIZE);
-	if (!(entry = get_swap_page()).val)
+	entry = get_swap_page();
+	if (!entry.val)
 		panic( "\nNot enough swapspace when writing header" );
 	if (swapfile_used[swp_type(entry)] != SWAPFILE_SUSPEND)
 		panic("\nNot enough swapspace for header on suspend device" );
@@ -503,6 +506,9 @@ static int count_and_copy_zone(struct zone *zone, struct pbe **pagedir_p)
 		if (!pbe)
 			continue;
 		pbe->orig_address = (long) page_address(page);
+		/* Copy page is dangerous: it likes to mess with
+		   preempt count on specific cpus. Wrong preempt count is then copied,
+		   oops. */
 		copy_page((void *)pbe->address, (void *)pbe->orig_address);
 		pbe++;
 	}
@@ -693,6 +699,7 @@ static void suspend_power_down(void)
 	else
 #endif
 	{
+		device_suspend(3);
 		device_shutdown();
 		machine_power_off();
 	}
@@ -713,7 +720,7 @@ asmlinkage void do_magic_resume_1(void)
 	mb();
 	spin_lock_irq(&suspend_pagedir_lock);	/* Done to disable interrupts */ 
 
-	device_power_down(4);
+	device_power_down(3);
 	PRINTK( "Waiting for DMAs to settle down...\n");
 	mdelay(1000);	/* We do not want some readahead with DMA to corrupt our memory, right?
 			   Do it with disabled interrupts for best effect. That way, if some
@@ -782,7 +789,7 @@ asmlinkage void do_magic_suspend_2(void)
 {
 	int is_problem;
 	read_swapfiles();
-	device_power_down(4);
+	device_power_down(3);
 	is_problem = suspend_prepare_image();
 	device_power_up();
 	spin_unlock_irq(&suspend_pagedir_lock);
@@ -799,7 +806,6 @@ asmlinkage void do_magic_suspend_2(void)
 	barrier();
 	mb();
 	spin_lock_irq(&suspend_pagedir_lock);	/* Done to disable interrupts */ 
-	mdelay(1000);
 
 	free_pages((unsigned long) pagedir_nosave, pagedir_order);
 	spin_unlock_irq(&suspend_pagedir_lock);
@@ -836,9 +842,10 @@ int software_suspend(void)
                    need half of memory free. */
 
 		free_some_memory();
-		
-		/* Save state of all device drivers, and stop them. */		   
-		if ((res = device_suspend(4))==0)
+		disable_nonboot_cpus();
+		/* Save state of all device drivers, and stop them. */
+		printk("Suspending devices... ");
+		if ((res = device_suspend(3))==0) {
 			/* If stopping device drivers worked, we proceed basically into
 			 * suspend_save_image.
 			 *
@@ -849,7 +856,9 @@ int software_suspend(void)
 			 * using normal kernel mechanism.
 			 */
 			do_magic(0);
+		}
 		thaw_processes();
+		enable_nonboot_cpus();
 	} else
 		res = -EBUSY;
 	software_suspend_enabled = 1;
@@ -860,19 +869,6 @@ int software_suspend(void)
 
 /* More restore stuff */
 
-/* FIXME: Why not memcpy(to, from, 1<<pagedir_order*PAGE_SIZE)? */
-static void copy_pagedir(suspend_pagedir_t *to, suspend_pagedir_t *from)
-{
-	int i;
-	char *topointer=(char *)to, *frompointer=(char *)from;
-
-	for(i=0; i < 1 << pagedir_order; i++) {
-		copy_page(topointer, frompointer);
-		topointer += PAGE_SIZE;
-		frompointer += PAGE_SIZE;
-	}
-}
-
 #define does_collide(addr) does_collide_order(pagedir_nosave, addr, 0)
 
 /*
@@ -920,19 +916,19 @@ static int relocate_pagedir(void)
 	 * We have to avoid recursion (not to overflow kernel stack),
 	 * and that's why code looks pretty cryptic 
 	 */
-	suspend_pagedir_t *new_pagedir, *old_pagedir = pagedir_nosave;
+	suspend_pagedir_t *old_pagedir = pagedir_nosave;
 	void **eaten_memory = NULL;
 	void **c = eaten_memory, *m, *f;
+	int ret = 0;
 
-	printk("Relocating pagedir");
+	printk("Relocating pagedir ");
 
 	if(!does_collide_order(old_pagedir, (unsigned long)old_pagedir, pagedir_order)) {
 		printk("not necessary\n");
 		return 0;
 	}
 
-	while ((m = (void *) __get_free_pages(GFP_ATOMIC, pagedir_order))) {
-		memset(m, 0, PAGE_SIZE);
+	while ((m = (void *) __get_free_pages(GFP_ATOMIC, pagedir_order)) != NULL) {
 		if (!does_collide_order(old_pagedir, (unsigned long)m, pagedir_order))
 			break;
 		eaten_memory = m;
@@ -941,22 +937,23 @@ static int relocate_pagedir(void)
 		c = eaten_memory;
 	}
 
-	if (!m)
-		return -ENOMEM;
-
-	pagedir_nosave = new_pagedir = m;
-	copy_pagedir(new_pagedir, old_pagedir);
+	if (!m) {
+		printk("out of memory\n");
+		ret = -ENOMEM;
+	} else {
+		pagedir_nosave =
+			memcpy(m, old_pagedir, PAGE_SIZE << pagedir_order);
+	}
 
 	c = eaten_memory;
-	while(c) {
+	while (c) {
 		printk(":");
-		f = *c;
+		f = c;
 		c = *c;
-		if (f)
-			free_pages((unsigned long)f, pagedir_order);
+		free_pages((unsigned long)f, pagedir_order);
 	}
 	printk("|\n");
-	return 0;
+	return ret;
 }
 
 /*
@@ -1201,7 +1198,9 @@ static int __init software_resume(void)
 	printk( "resuming from %s\n", resume_file);
 	if (read_suspend_image(resume_file, 0))
 		goto read_failure;
-	device_suspend(4);
+	/* FIXME: Should we stop processes here, just to be safer? */
+	disable_nonboot_cpus();
+	device_suspend(3);
 	do_magic(1);
 	panic("This never returns");
 
diff --git a/kernel/printk.c b/kernel/printk.c
index 3bf268b7f..9b1f825bc 100644
--- a/kernel/printk.c
+++ b/kernel/printk.c
@@ -687,6 +687,47 @@ void console_unblank(void)
 }
 EXPORT_SYMBOL(console_unblank);
 
+/*
+ * Return the console tty driver structure and its associated index
+ */
+struct tty_driver *console_device(int *index)
+{
+	struct console *c;
+	struct tty_driver *driver = NULL;
+
+	acquire_console_sem();
+	for (c = console_drivers; c != NULL; c = c->next) {
+		if (!c->device)
+			continue;
+		driver = c->device(c, index);
+		if (driver)
+			break;
+	}
+	release_console_sem();
+	return driver;
+}
+
+/*
+ * Prevent further output on the passed console device so that (for example)
+ * serial drivers can disable console output before suspending a port, and can
+ * re-enable output afterwards.
+ */
+void console_stop(struct console *console)
+{
+	acquire_console_sem();
+	console->flags &= ~CON_ENABLED;
+	release_console_sem();
+}
+EXPORT_SYMBOL(console_stop);
+
+void console_start(struct console *console)
+{
+	acquire_console_sem();
+	console->flags |= CON_ENABLED;
+	release_console_sem();
+}
+EXPORT_SYMBOL(console_start);
+
 /*
  * The console driver calls this routine during kernel initialization
  * to register the console printing procedure with printk() and to
diff --git a/kernel/rcupdate.c b/kernel/rcupdate.c
index 13a1b5a58..b331fe3f6 100644
--- a/kernel/rcupdate.c
+++ b/kernel/rcupdate.c
@@ -47,8 +47,17 @@
 
 /* Definition for rcupdate control block. */
 struct rcu_ctrlblk rcu_ctrlblk = 
-	{ .mutex = SPIN_LOCK_UNLOCKED, .curbatch = 1, 
-	  .maxbatch = 1, .rcu_cpu_mask = CPU_MASK_NONE };
+	{ .cur = -300, .completed = -300 , .lock = SEQCNT_ZERO };
+
+/* Bookkeeping of the progress of the grace period */
+struct {
+	spinlock_t	mutex; /* Guard this struct and writes to rcu_ctrlblk */
+	cpumask_t	rcu_cpu_mask; /* CPUs that need to switch in order    */
+	                              /* for current batch to proceed.        */
+} rcu_state ____cacheline_maxaligned_in_smp =
+	  {.mutex = SPIN_LOCK_UNLOCKED, .rcu_cpu_mask = CPU_MASK_NONE };
+
+
 DEFINE_PER_CPU(struct rcu_data, rcu_data) = { 0L };
 
 /* Fake initialization required by compiler */
@@ -59,23 +68,24 @@ static DEFINE_PER_CPU(struct tasklet_struct, rcu_tasklet) = {NULL};
  * call_rcu - Queue an RCU update request.
  * @head: structure to be used for queueing the RCU updates.
  * @func: actual update function to be invoked after the grace period
- * @arg: argument to be passed to the update function
  *
  * The update function will be invoked as soon as all CPUs have performed 
  * a context switch or been seen in the idle loop or in a user process. 
  * The read-side of critical section that use call_rcu() for updation must 
  * be protected by rcu_read_lock()/rcu_read_unlock().
  */
-void fastcall call_rcu(struct rcu_head *head, void (*func)(void *arg), void *arg)
+void fastcall call_rcu(struct rcu_head *head,
+				void (*func)(struct rcu_head *rcu))
 {
 	int cpu;
 	unsigned long flags;
 
 	head->func = func;
-	head->arg = arg;
+	head->next = NULL;
 	local_irq_save(flags);
 	cpu = smp_processor_id();
-	list_add_tail(&head->list, &RCU_nxtlist(cpu));
+	*RCU_nxttail(cpu) = head;
+	RCU_nxttail(cpu) = &head->next;
 	local_irq_restore(flags);
 }
 
@@ -83,39 +93,70 @@ void fastcall call_rcu(struct rcu_head *head, void (*func)(void *arg), void *arg
  * Invoke the completed RCU callbacks. They are expected to be in
  * a per-cpu list.
  */
-static void rcu_do_batch(struct list_head *list)
+static void rcu_do_batch(struct rcu_head *list)
 {
-	struct list_head *entry;
-	struct rcu_head *head;
-
-	while (!list_empty(list)) {
-		entry = list->next;
-		list_del(entry);
-		head = list_entry(entry, struct rcu_head, list);
-		head->func(head->arg);
+	struct rcu_head *next;
+
+	while (list) {
+		next = list->next;
+		list->func(list);
+		list = next;
 	}
 }
 
+/*
+ * Grace period handling:
+ * The grace period handling consists out of two steps:
+ * - A new grace period is started.
+ *   This is done by rcu_start_batch. The start is not broadcasted to
+ *   all cpus, they must pick this up by comparing rcu_ctrlblk.cur with
+ *   RCU_quiescbatch(cpu). All cpus are recorded  in the
+ *   rcu_state.rcu_cpu_mask bitmap.
+ * - All cpus must go through a quiescent state.
+ *   Since the start of the grace period is not broadcasted, at least two
+ *   calls to rcu_check_quiescent_state are required:
+ *   The first call just notices that a new grace period is running. The
+ *   following calls check if there was a quiescent state since the beginning
+ *   of the grace period. If so, it updates rcu_state.rcu_cpu_mask. If
+ *   the bitmap is empty, then the grace period is completed.
+ *   rcu_check_quiescent_state calls rcu_start_batch(0) to start the next grace
+ *   period (if necessary).
+ */
 /*
  * Register a new batch of callbacks, and start it up if there is currently no
  * active batch and the batch to be registered has not already occurred.
- * Caller must hold the rcu_ctrlblk lock.
+ * Caller must hold rcu_state.mutex.
  */
-static void rcu_start_batch(long newbatch)
+static void rcu_start_batch(int next_pending)
 {
-	cpumask_t active;
-
-	if (rcu_batch_before(rcu_ctrlblk.maxbatch, newbatch)) {
-		rcu_ctrlblk.maxbatch = newbatch;
+	if (next_pending)
+		rcu_ctrlblk.next_pending = 1;
+
+	if (rcu_ctrlblk.next_pending &&
+			rcu_ctrlblk.completed == rcu_ctrlblk.cur) {
+		/* Can't change, since spin lock held. */
+		cpus_andnot(rcu_state.rcu_cpu_mask, cpu_online_map,
+							nohz_cpu_mask);
+		write_seqcount_begin(&rcu_ctrlblk.lock);
+		rcu_ctrlblk.next_pending = 0;
+		rcu_ctrlblk.cur++;
+		write_seqcount_end(&rcu_ctrlblk.lock);
 	}
-	if (rcu_batch_before(rcu_ctrlblk.maxbatch, rcu_ctrlblk.curbatch) ||
-	    !cpus_empty(rcu_ctrlblk.rcu_cpu_mask)) {
-		return;
+}
+
+/*
+ * cpu went through a quiescent state since the beginning of the grace period.
+ * Clear it from the cpu mask and complete the grace period if it was the last
+ * cpu. Start another grace period if someone has further entries pending
+ */
+static void cpu_quiet(int cpu)
+{
+	cpu_clear(cpu, rcu_state.rcu_cpu_mask);
+	if (cpus_empty(rcu_state.rcu_cpu_mask)) {
+		/* batch completed ! */
+		rcu_ctrlblk.completed = rcu_ctrlblk.cur;
+		rcu_start_batch(0);
 	}
-	/* Can't change, since spin lock held. */
-	active = nohz_cpu_mask;
-	cpus_complement(active);
-	cpus_and(rcu_ctrlblk.rcu_cpu_mask, cpu_online_map, active);
 }
 
 /*
@@ -127,7 +168,19 @@ static void rcu_check_quiescent_state(void)
 {
 	int cpu = smp_processor_id();
 
-	if (!cpu_isset(cpu, rcu_ctrlblk.rcu_cpu_mask))
+	if (RCU_quiescbatch(cpu) != rcu_ctrlblk.cur) {
+		/* new grace period: record qsctr value. */
+		RCU_qs_pending(cpu) = 1;
+		RCU_last_qsctr(cpu) = RCU_qsctr(cpu);
+		RCU_quiescbatch(cpu) = rcu_ctrlblk.cur;
+		return;
+	}
+
+	/* Grace period already completed for this cpu?
+	 * qs_pending is checked instead of the actual bitmap to avoid
+	 * cacheline trashing.
+	 */
+	if (!RCU_qs_pending(cpu))
 		return;
 
 	/* 
@@ -135,27 +188,19 @@ static void rcu_check_quiescent_state(void)
 	 * we may miss one quiescent state of that CPU. That is
 	 * tolerable. So no need to disable interrupts.
 	 */
-	if (RCU_last_qsctr(cpu) == RCU_QSCTR_INVALID) {
-		RCU_last_qsctr(cpu) = RCU_qsctr(cpu);
-		return;
-	}
 	if (RCU_qsctr(cpu) == RCU_last_qsctr(cpu))
 		return;
+	RCU_qs_pending(cpu) = 0;
 
-	spin_lock(&rcu_ctrlblk.mutex);
-	if (!cpu_isset(cpu, rcu_ctrlblk.rcu_cpu_mask))
-		goto out_unlock;
-
-	cpu_clear(cpu, rcu_ctrlblk.rcu_cpu_mask);
-	RCU_last_qsctr(cpu) = RCU_QSCTR_INVALID;
-	if (!cpus_empty(rcu_ctrlblk.rcu_cpu_mask))
-		goto out_unlock;
-
-	rcu_ctrlblk.curbatch++;
-	rcu_start_batch(rcu_ctrlblk.maxbatch);
+	spin_lock(&rcu_state.mutex);
+	/*
+	 * RCU_quiescbatch/batch.cur and the cpu bitmap can come out of sync
+	 * during cpu startup. Ignore the quiescent state.
+	 */
+	if (likely(RCU_quiescbatch(cpu) == rcu_ctrlblk.cur))
+		cpu_quiet(cpu);
 
-out_unlock:
-	spin_unlock(&rcu_ctrlblk.mutex);
+	spin_unlock(&rcu_state.mutex);
 }
 
 
@@ -165,16 +210,18 @@ out_unlock:
  * locking requirements, the list it's pulling from has to belong to a cpu
  * which is dead and hence not processing interrupts.
  */
-static void rcu_move_batch(struct list_head *list)
+static void rcu_move_batch(struct rcu_head *list)
 {
-	struct list_head *entry;
-	int cpu = smp_processor_id();
+	int cpu;
 
 	local_irq_disable();
-	while (!list_empty(list)) {
-		entry = list->next;
-		list_del(entry);
-		list_add_tail(entry, &RCU_nxtlist(cpu));
+
+	cpu = smp_processor_id();
+
+	while (list != NULL) {
+		*RCU_nxttail(cpu) = list;
+		RCU_nxttail(cpu) = &list->next;
+		list = list->next;
 	}
 	local_irq_enable();
 }
@@ -185,67 +232,72 @@ static void rcu_offline_cpu(int cpu)
 	 * we can block indefinitely waiting for it, so flush
 	 * it here
 	 */
-	spin_lock_irq(&rcu_ctrlblk.mutex);
-	if (cpus_empty(rcu_ctrlblk.rcu_cpu_mask))
-		goto unlock;
-
-	cpu_clear(cpu, rcu_ctrlblk.rcu_cpu_mask);
-	if (cpus_empty(rcu_ctrlblk.rcu_cpu_mask)) {
-		rcu_ctrlblk.curbatch++;
-		/* We may avoid calling start batch if
-		 * we are starting the batch only
-		 * because of the DEAD CPU (the current
-		 * CPU will start a new batch anyway for
-		 * the callbacks we will move to current CPU).
-		 * However, we will avoid this optimisation
-		 * for now.
-		 */
-		rcu_start_batch(rcu_ctrlblk.maxbatch);
-	}
-unlock:
-	spin_unlock_irq(&rcu_ctrlblk.mutex);
+	spin_lock_bh(&rcu_state.mutex);
+	if (rcu_ctrlblk.cur != rcu_ctrlblk.completed)
+		cpu_quiet(cpu);
+	spin_unlock_bh(&rcu_state.mutex);
 
-	rcu_move_batch(&RCU_curlist(cpu));
-	rcu_move_batch(&RCU_nxtlist(cpu));
+	rcu_move_batch(RCU_curlist(cpu));
+	rcu_move_batch(RCU_nxtlist(cpu));
 
 	tasklet_kill_immediate(&RCU_tasklet(cpu), cpu);
 }
 
 #endif
 
+void rcu_restart_cpu(int cpu)
+{
+	spin_lock_bh(&rcu_state.mutex);
+	RCU_quiescbatch(cpu) = rcu_ctrlblk.completed;
+	RCU_qs_pending(cpu) = 0;
+	spin_unlock_bh(&rcu_state.mutex);
+}
+
 /*
  * This does the RCU processing work from tasklet context. 
  */
 static void rcu_process_callbacks(unsigned long unused)
 {
 	int cpu = smp_processor_id();
-	LIST_HEAD(list);
+	struct rcu_head *rcu_list = NULL;
 
-	if (!list_empty(&RCU_curlist(cpu)) &&
-	    rcu_batch_after(rcu_ctrlblk.curbatch, RCU_batch(cpu))) {
-		__list_splice(&RCU_curlist(cpu), &list);
-		INIT_LIST_HEAD(&RCU_curlist(cpu));
+	if (RCU_curlist(cpu) &&
+	    !rcu_batch_before(rcu_ctrlblk.completed, RCU_batch(cpu))) {
+		rcu_list = RCU_curlist(cpu);
+		RCU_curlist(cpu) = NULL;
 	}
 
 	local_irq_disable();
-	if (!list_empty(&RCU_nxtlist(cpu)) && list_empty(&RCU_curlist(cpu))) {
-		__list_splice(&RCU_nxtlist(cpu), &RCU_curlist(cpu));
-		INIT_LIST_HEAD(&RCU_nxtlist(cpu));
+	if (RCU_nxtlist(cpu) && !RCU_curlist(cpu)) {
+		int next_pending, seq;
+
+		RCU_curlist(cpu) = RCU_nxtlist(cpu);
+		RCU_nxtlist(cpu) = NULL;
+		RCU_nxttail(cpu) = &RCU_nxtlist(cpu);
 		local_irq_enable();
 
 		/*
 		 * start the next batch of callbacks
 		 */
-		spin_lock(&rcu_ctrlblk.mutex);
-		RCU_batch(cpu) = rcu_ctrlblk.curbatch + 1;
-		rcu_start_batch(RCU_batch(cpu));
-		spin_unlock(&rcu_ctrlblk.mutex);
+		do {
+			seq = read_seqcount_begin(&rcu_ctrlblk.lock);
+			/* determine batch number */
+			RCU_batch(cpu) = rcu_ctrlblk.cur + 1;
+			next_pending = rcu_ctrlblk.next_pending;
+		} while (read_seqcount_retry(&rcu_ctrlblk.lock, seq));
+
+		if (!next_pending) {
+			/* and start it/schedule start if it's a new batch */
+			spin_lock(&rcu_state.mutex);
+			rcu_start_batch(1);
+			spin_unlock(&rcu_state.mutex);
+		}
 	} else {
 		local_irq_enable();
 	}
 	rcu_check_quiescent_state();
-	if (!list_empty(&list))
-		rcu_do_batch(&list);
+	if (rcu_list)
+		rcu_do_batch(rcu_list);
 }
 
 void rcu_check_callbacks(int cpu, int user)
@@ -261,8 +313,9 @@ static void __devinit rcu_online_cpu(int cpu)
 {
 	memset(&per_cpu(rcu_data, cpu), 0, sizeof(struct rcu_data));
 	tasklet_init(&RCU_tasklet(cpu), rcu_process_callbacks, 0UL);
-	INIT_LIST_HEAD(&RCU_nxtlist(cpu));
-	INIT_LIST_HEAD(&RCU_curlist(cpu));
+	RCU_nxttail(cpu) = &RCU_nxtlist(cpu);
+	RCU_quiescbatch(cpu) = rcu_ctrlblk.completed;
+	RCU_qs_pending(cpu) = 0;
 }
 
 static int __devinit rcu_cpu_notify(struct notifier_block *self, 
@@ -302,11 +355,18 @@ void __init rcu_init(void)
 	register_cpu_notifier(&rcu_nb);
 }
 
+struct rcu_synchronize {
+	struct rcu_head head;
+	struct completion completion;
+};
 
 /* Because of FASTCALL declaration of complete, we use this wrapper */
-static void wakeme_after_rcu(void *completion)
+static void wakeme_after_rcu(struct rcu_head  *head)
 {
-	complete(completion);
+	struct rcu_synchronize *rcu;
+
+	rcu = container_of(head, struct rcu_synchronize, head);
+	complete(&rcu->completion);
 }
 
 /**
@@ -315,14 +375,14 @@ static void wakeme_after_rcu(void *completion)
  */
 void synchronize_kernel(void)
 {
-	struct rcu_head rcu;
-	DECLARE_COMPLETION(completion);
+	struct rcu_synchronize rcu;
 
+	init_completion(&rcu.completion);
 	/* Will wake me after RCU finished */
-	call_rcu(&rcu, wakeme_after_rcu, &completion);
+	call_rcu(&rcu.head, wakeme_after_rcu);
 
 	/* Wait for it */
-	wait_for_completion(&completion);
+	wait_for_completion(&rcu.completion);
 }
 
 
diff --git a/kernel/sched.c b/kernel/sched.c
index 022dabf96..305f94852 100644
--- a/kernel/sched.c
+++ b/kernel/sched.c
@@ -42,6 +42,7 @@
 #include <linux/kthread.h>
 #include <linux/vserver/sched.h>
 #include <linux/vs_base.h>
+#include <asm/tlb.h>
 
 #include <asm/unistd.h>
 
@@ -553,7 +554,7 @@ static inline void resched_task(task_t *p)
  * task_curr - is this task currently executing on a CPU?
  * @p: the task in question.
  */
-inline int task_curr(task_t *p)
+inline int task_curr(const task_t *p)
 {
 	return cpu_curr(task_cpu(p)) == p;
 }
@@ -703,10 +704,9 @@ static int wake_idle(int cpu, task_t *p)
 		return cpu;
 
 	cpus_and(tmp, sd->span, cpu_online_map);
-	for_each_cpu_mask(i, tmp) {
-		if (!cpu_isset(i, p->cpus_allowed))
-			continue;
+	cpus_and(tmp, tmp, p->cpus_allowed);
 
+	for_each_cpu_mask(i, tmp) {
 		if (idle_cpu(i))
 			return i;
 	}
@@ -1102,7 +1102,7 @@ unsigned long nr_uninterruptible(void)
 {
 	unsigned long i, sum = 0;
 
-	for_each_online_cpu(i)
+	for_each_cpu(i)
 		sum += cpu_rq(i)->nr_uninterruptible;
 
 	return sum;
@@ -1112,7 +1112,7 @@ unsigned long long nr_context_switches(void)
 {
 	unsigned long long i, sum = 0;
 
-	for_each_online_cpu(i)
+	for_each_cpu(i)
 		sum += cpu_rq(i)->nr_switches;
 
 	return sum;
@@ -1122,7 +1122,7 @@ unsigned long nr_iowait(void)
 {
 	unsigned long i, sum = 0;
 
-	for_each_online_cpu(i)
+	for_each_cpu(i)
 		sum += atomic_read(&cpu_rq(i)->nr_iowait);
 
 	return sum;
@@ -2720,7 +2720,7 @@ asmlinkage long sys_nice(int increment)
  * RT tasks are offset by -200. Normal tasks are centered
  * around 0, value goes from -16 to +15.
  */
-int task_prio(task_t *p)
+int task_prio(const task_t *p)
 {
 	return p->prio - MAX_RT_PRIO;
 }
@@ -2729,7 +2729,7 @@ int task_prio(task_t *p)
  * task_nice - return the nice value of a given task.
  * @p: the task in question.
  */
-int task_nice(task_t *p)
+int task_nice(const task_t *p)
 {
 	return TASK_NICE(p);
 }
@@ -3003,6 +3003,21 @@ out_unlock:
 	return retval;
 }
 
+/*
+ * Represents all cpu's present in the system
+ * In systems capable of hotplug, this map could dynamically grow
+ * as new cpu's are detected in the system via any platform specific
+ * method, such as ACPI for e.g.
+ */
+
+cpumask_t cpu_present_map;
+EXPORT_SYMBOL(cpu_present_map);
+
+#ifndef CONFIG_SMP
+cpumask_t cpu_online_map = CPU_MASK_ALL;
+cpumask_t cpu_possible_map = CPU_MASK_ALL;
+#endif
+
 /**
  * sys_sched_getaffinity - get the cpu affinity of a process
  * @pid: pid of the process
@@ -3382,7 +3397,7 @@ int set_cpus_allowed(task_t *p, cpumask_t new_mask)
 	runqueue_t *rq;
 
 	rq = task_rq_lock(p, &flags);
-	if (any_online_cpu(new_mask) == NR_CPUS) {
+	if (!cpus_intersects(new_mask, cpu_online_map)) {
 		ret = -EINVAL;
 		goto out;
 	}
@@ -3397,6 +3412,7 @@ int set_cpus_allowed(task_t *p, cpumask_t new_mask)
 		task_rq_unlock(rq, &flags);
 		wake_up_process(rq->migration_thread);
 		wait_for_completion(&req.done);
+		tlb_migrate_finish(p->mm);
 		return 0;
 	}
 out:
@@ -3557,8 +3573,7 @@ static void migrate_all_tasks(int src_cpu)
 		if (dest_cpu == NR_CPUS)
 			dest_cpu = any_online_cpu(tsk->cpus_allowed);
 		if (dest_cpu == NR_CPUS) {
-			cpus_clear(tsk->cpus_allowed);
-			cpus_complement(tsk->cpus_allowed);
+			cpus_setall(tsk->cpus_allowed);
 			dest_cpu = any_online_cpu(tsk->cpus_allowed);
 
 			/* Don't tell them about moving exiting tasks
@@ -3620,6 +3635,7 @@ static int migration_call(struct notifier_block *nfb, unsigned long action,
 		p = kthread_create(migration_thread, hcpu, "migration/%d",cpu);
 		if (IS_ERR(p))
 			return NOTIFY_BAD;
+		p->flags |= PF_NOFREEZE;
 		kthread_bind(p, cpu);
 		/* Must be high prio: stop_machine expects to yield to it. */
 		rq = task_rq_lock(p, &flags);
@@ -3874,7 +3890,7 @@ void sched_domain_debug(void)
 			int j;
 			char str[NR_CPUS];
 			struct sched_group *group = sd->groups;
-			cpumask_t groupmask, tmp;
+			cpumask_t groupmask;
 
 			cpumask_scnprintf(str, NR_CPUS, sd->span);
 			cpus_clear(groupmask);
@@ -3904,8 +3920,7 @@ void sched_domain_debug(void)
 				if (!cpus_weight(group->cpumask))
 					printk(" ERROR empty group:");
 
-				cpus_and(tmp, groupmask, group->cpumask);
-				if (cpus_weight(tmp) > 0)
+				if (cpus_intersects(groupmask, group->cpumask))
 					printk(" ERROR repeated CPUs:");
 
 				cpus_or(groupmask, groupmask, group->cpumask);
@@ -3924,8 +3939,7 @@ void sched_domain_debug(void)
 			sd = sd->parent;
 
 			if (sd) {
-				cpus_and(tmp, groupmask, sd->span);
-				if (!cpus_equal(tmp, groupmask))
+				if (!cpus_subset(groupmask, sd->span))
 					printk(KERN_DEBUG "ERROR parent span is not a superset of domain->span\n");
 			}
 
@@ -3964,16 +3978,16 @@ void __init sched_init(void)
 	/* Set up an initial dummy domain for early boot */
 	static struct sched_domain sched_domain_init;
 	static struct sched_group sched_group_init;
-	cpumask_t cpu_mask_all = CPU_MASK_ALL;
 
 	memset(&sched_domain_init, 0, sizeof(struct sched_domain));
-	sched_domain_init.span = cpu_mask_all;
+	sched_domain_init.span = CPU_MASK_ALL;
 	sched_domain_init.groups = &sched_group_init;
 	sched_domain_init.last_balance = jiffies;
 	sched_domain_init.balance_interval = INT_MAX; /* Don't balance */
+	sched_domain_init.busy_factor = 1;
 
 	memset(&sched_group_init, 0, sizeof(struct sched_group));
-	sched_group_init.cpumask = cpu_mask_all;
+	sched_group_init.cpumask = CPU_MASK_ALL;
 	sched_group_init.next = &sched_group_init;
 	sched_group_init.cpu_power = SCHED_LOAD_SCALE;
 #endif
diff --git a/kernel/signal.c b/kernel/signal.c
index c6b2701ea..74d1d9eec 100644
--- a/kernel/signal.c
+++ b/kernel/signal.c
@@ -32,9 +32,6 @@
 
 static kmem_cache_t *sigqueue_cachep;
 
-atomic_t nr_queued_signals;
-int max_queued_signals = 1024;
-
 /*
  * In POSIX a signal is sent either to a specific thread (Linux task)
  * or to the process as a whole (Linux thread group).  How the signal
@@ -160,7 +157,7 @@ int max_queued_signals = 1024;
 
 static int sig_ignored(struct task_struct *t, int sig)
 {
-	void * handler;
+	void __user * handler;
 
 	/*
 	 * Tracers always want to know about signals..
@@ -265,17 +262,19 @@ next_signal(struct sigpending *pending, sigset_t *mask)
 	return sig;
 }
 
-struct sigqueue *__sigqueue_alloc(void)
+static struct sigqueue *__sigqueue_alloc(void)
 {
-	struct sigqueue *q = 0;
+	struct sigqueue *q = NULL;
 
-	if (atomic_read(&nr_queued_signals) < max_queued_signals)
+	if (atomic_read(&current->user->sigpending) <
+			current->rlim[RLIMIT_SIGPENDING].rlim_cur)
 		q = kmem_cache_alloc(sigqueue_cachep, GFP_ATOMIC);
 	if (q) {
-		atomic_inc(&nr_queued_signals);
 		INIT_LIST_HEAD(&q->list);
 		q->flags = 0;
-		q->lock = 0;
+		q->lock = NULL;
+		q->user = get_uid(current->user);
+		atomic_inc(&q->user->sigpending);
 	}
 	return(q);
 }
@@ -284,8 +283,9 @@ static inline void __sigqueue_free(struct sigqueue *q)
 {
 	if (q->flags & SIGQUEUE_PREALLOC)
 		return;
+	atomic_dec(&q->user->sigpending);
+	free_uid(q->user);
 	kmem_cache_free(sigqueue_cachep, q);
-	atomic_dec(&nr_queued_signals);
 }
 
 static void flush_sigqueue(struct sigpending *queue)
@@ -454,7 +454,7 @@ unblock_all_signals(void)
 
 static inline int collect_signal(int sig, struct sigpending *list, siginfo_t *info)
 {
-	struct sigqueue *q, *first = 0;
+	struct sigqueue *q, *first = NULL;
 	int still_pending = 0;
 
 	if (unlikely(!sigismember(&list->signal, sig)))
@@ -699,7 +699,8 @@ static void handle_stop_signal(int sig, struct task_struct *p)
 	}
 }
 
-static int send_signal(int sig, struct siginfo *info, struct sigpending *signals)
+static int send_signal(int sig, struct siginfo *info, struct task_struct *t,
+			struct sigpending *signals)
 {
 	struct sigqueue * q = NULL;
 	int ret = 0;
@@ -719,12 +720,14 @@ static int send_signal(int sig, struct siginfo *info, struct sigpending *signals
 	   make sure at least one signal gets delivered and don't
 	   pass on the info struct.  */
 
-	if (atomic_read(&nr_queued_signals) < max_queued_signals)
+	if (atomic_read(&t->user->sigpending) <
+			t->rlim[RLIMIT_SIGPENDING].rlim_cur)
 		q = kmem_cache_alloc(sigqueue_cachep, GFP_ATOMIC);
 
 	if (q) {
-		atomic_inc(&nr_queued_signals);
 		q->flags = 0;
+		q->user = get_uid(t->user);
+		atomic_inc(&q->user->sigpending);
 		list_add_tail(&q->list, &signals->list);
 		switch ((unsigned long) info) {
 		case 0:
@@ -798,7 +801,7 @@ specific_send_sig_info(int sig, struct siginfo *info, struct task_struct *t)
 	if (LEGACY_QUEUE(&t->pending, sig))
 		goto out;
 
-	ret = send_signal(sig, info, &t->pending);
+	ret = send_signal(sig, info, t, &t->pending);
 	if (!ret && !sigismember(&t->blocked, sig))
 		signal_wake_up(t, sig == SIGKILL);
 out:
@@ -999,7 +1002,7 @@ __group_send_sig_info(int sig, struct siginfo *info, struct task_struct *p)
 	 * We always use the shared queue for process-wide signals,
 	 * to avoid several races.
 	 */
-	ret = send_signal(sig, info, &p->signal->shared_pending);
+	ret = send_signal(sig, info, p, &p->signal->shared_pending);
 	if (unlikely(ret))
 		return ret;
 
@@ -1074,23 +1077,19 @@ int __kill_pg_info(int sig, struct siginfo *info, pid_t pgrp)
 	struct task_struct *p;
 	struct list_head *l;
 	struct pid *pid;
-	int retval;
-	int found;
+	int retval, success;
 
 	if (pgrp <= 0)
 		return -EINVAL;
 
-	found = 0;
-	retval = 0;
+	success = 0;
+	retval = -ESRCH;
 	for_each_task_pid(pgrp, PIDTYPE_PGID, p, l, pid) {
-		int err;
-
-		found = 1;
-		err = group_send_sig_info(sig, info, p);
-		if (!retval)
-			retval = err;
+		int err = group_send_sig_info(sig, info, p);
+		success |= !err;
+		retval = err;
 	}
-	return found ? retval : -ESRCH;
+	return success ? 0 : retval;
 }
 
 int
@@ -1200,6 +1199,13 @@ send_sig_info(int sig, struct siginfo *info, struct task_struct *p)
 	int ret;
 	unsigned long flags;
 
+	/*
+	 * Make sure legacy kernel users don't send in bad values
+	 * (normal paths check this in check_kill_permission).
+	 */
+	if (sig < 0 || sig > _NSIG)
+		return -EINVAL;
+
 	/*
 	 * We need the tasklist lock even for the specific
 	 * thread case (when we don't need to follow the group
@@ -2359,13 +2365,13 @@ do_sigaltstack (const stack_t __user *uss, stack_t __user *uoss, unsigned long s
 	int error;
 
 	if (uoss) {
-		oss.ss_sp = (void *) current->sas_ss_sp;
+		oss.ss_sp = (void __user *) current->sas_ss_sp;
 		oss.ss_size = current->sas_ss_size;
 		oss.ss_flags = sas_ss_flags(sp);
 	}
 
 	if (uss) {
-		void *ss_sp;
+		void __user *ss_sp;
 		size_t ss_size;
 		int ss_flags;
 
diff --git a/kernel/sysctl.c b/kernel/sysctl.c
index e95f475d0..608fbac3e 100644
--- a/kernel/sysctl.c
+++ b/kernel/sysctl.c
@@ -39,6 +39,8 @@
 #include <linux/initrd.h>
 #include <linux/times.h>
 #include <linux/limits.h>
+#include <linux/dcache.h>
+
 #include <asm/uaccess.h>
 
 #ifdef CONFIG_ROOT_NFS
@@ -53,8 +55,6 @@ extern int C_A_D;
 extern int sysctl_overcommit_memory;
 extern int sysctl_overcommit_ratio;
 extern int max_threads;
-extern atomic_t nr_queued_signals;
-extern int max_queued_signals;
 extern int sysrq_enabled;
 extern int core_uses_pid;
 extern char core_pattern[];
@@ -114,7 +114,7 @@ extern int sysctl_hz_timer;
 #if defined(CONFIG_PPC32) && defined(CONFIG_6xx)
 extern unsigned long powersave_nap;
 int proc_dol2crvec(ctl_table *table, int write, struct file *filp,
-		  void *buffer, size_t *lenp);
+		  void __user *buffer, size_t *lenp, loff_t *ppos);
 #endif
 
 #ifdef CONFIG_BSD_PROCESS_ACCT
@@ -124,7 +124,7 @@ extern int acct_parm[];
 static int parse_table(int __user *, int, void __user *, size_t __user *, void __user *, size_t,
 		       ctl_table *, void **);
 static int proc_doutsstring(ctl_table *table, int write, struct file *filp,
-		  void __user *buffer, size_t *lenp);
+		  void __user *buffer, size_t *lenp, loff_t *ppos);
 
 static ctl_table root_table[];
 static struct ctl_table_header root_table_header =
@@ -439,22 +439,6 @@ static ctl_table kern_table[] = {
 		.proc_handler	= &proc_dointvec,
 	},
 #endif
-	{
-		.ctl_name	= KERN_RTSIGNR,
-		.procname	= "rtsig-nr",
-		.data		= &nr_queued_signals,
-		.maxlen		= sizeof(int),
-		.mode		= 0444,
-		.proc_handler	= &proc_dointvec,
-	},
-	{
-		.ctl_name	= KERN_RTSIGMAX,
-		.procname	= "rtsig-max",
-		.data		= &max_queued_signals,
-		.maxlen		= sizeof(int),
-		.mode		= 0644,
-		.proc_handler	= &proc_dointvec,
-	},
 #ifdef CONFIG_SYSVIPC
 	{
 		.ctl_name	= KERN_SHMMAX,
@@ -805,6 +789,16 @@ static ctl_table vm_table[] = {
 		.strategy	= &sysctl_intvec,
 		.extra1		= &zero,
 	},
+	{
+		.ctl_name	= VM_VFS_CACHE_PRESSURE,
+		.procname	= "vfs_cache_pressure",
+		.data		= &sysctl_vfs_cache_pressure,
+		.maxlen		= sizeof(sysctl_vfs_cache_pressure),
+		.mode		= 0644,
+		.proc_handler	= &proc_dointvec,
+		.strategy	= &sysctl_intvec,
+		.extra1		= &zero,
+	},
 	{ .ctl_name = 0 }
 };
 
@@ -1303,11 +1297,7 @@ static ssize_t do_rw_proc(int write, struct file * file, char __user * buf,
 	
 	res = count;
 
-	/*
-	 * FIXME: we need to pass on ppos to the handler.
-	 */
-
-	error = (*table->proc_handler) (table, write, file, buf, &res);
+	error = (*table->proc_handler) (table, write, file, buf, &res, ppos);
 	if (error)
 		return error;
 	return res;
@@ -1357,14 +1347,14 @@ static ssize_t proc_writesys(struct file * file, const char __user * buf,
  * Returns 0 on success.
  */
 int proc_dostring(ctl_table *table, int write, struct file *filp,
-		  void __user *buffer, size_t *lenp)
+		  void __user *buffer, size_t *lenp, loff_t *ppos)
 {
 	size_t len;
 	char __user *p;
 	char c;
 	
 	if (!table->data || !table->maxlen || !*lenp ||
-	    (filp->f_pos && !write)) {
+	    (*ppos && !write)) {
 		*lenp = 0;
 		return 0;
 	}
@@ -1384,7 +1374,7 @@ int proc_dostring(ctl_table *table, int write, struct file *filp,
 		if(copy_from_user(table->data, buffer, len))
 			return -EFAULT;
 		((char *) table->data)[len] = 0;
-		filp->f_pos += *lenp;
+		*ppos += *lenp;
 	} else {
 		len = strlen(table->data);
 		if (len > table->maxlen)
@@ -1400,7 +1390,7 @@ int proc_dostring(ctl_table *table, int write, struct file *filp,
 			len++;
 		}
 		*lenp = len;
-		filp->f_pos += len;
+		*ppos += len;
 	}
 	return 0;
 }
@@ -1411,17 +1401,17 @@ int proc_dostring(ctl_table *table, int write, struct file *filp,
  */
  
 static int proc_doutsstring(ctl_table *table, int write, struct file *filp,
-		  void __user *buffer, size_t *lenp)
+		  void __user *buffer, size_t *lenp, loff_t *ppos)
 {
 	int r;
 
 	if (!write) {
 		down_read(&uts_sem);
-		r=proc_dostring(table,0,filp,buffer,lenp);
+		r=proc_dostring(table,0,filp,buffer,lenp, ppos);
 		up_read(&uts_sem);
 	} else {
 		down_write(&uts_sem);
-		r=proc_dostring(table,1,filp,buffer,lenp);
+		r=proc_dostring(table,1,filp,buffer,lenp, ppos);
 		up_write(&uts_sem);
 	}
 	return r;
@@ -1447,12 +1437,12 @@ static int do_proc_dointvec_conv(int *negp, unsigned long *lvalp,
 }
 
 static int do_proc_dointvec(ctl_table *table, int write, struct file *filp,
-		  void __user *buffer, size_t *lenp, 
+		  void __user *buffer, size_t *lenp, loff_t *ppos,
 		  int (*conv)(int *negp, unsigned long *lvalp, int *valp,
 			      int write, void *data),
 		  void *data)
 {
-#define TMPBUFLEN 20
+#define TMPBUFLEN 21
 	int *i, vleft, first=1, neg, val;
 	unsigned long lval;
 	size_t left, len;
@@ -1461,7 +1451,7 @@ static int do_proc_dointvec(ctl_table *table, int write, struct file *filp,
 	char __user *s = buffer;
 	
 	if (!table->data || !table->maxlen || !*lenp ||
-	    (filp->f_pos && !write)) {
+	    (*ppos && !write)) {
 		*lenp = 0;
 		return 0;
 	}
@@ -1550,7 +1540,7 @@ static int do_proc_dointvec(ctl_table *table, int write, struct file *filp,
 	if (write && first)
 		return -EINVAL;
 	*lenp -= left;
-	filp->f_pos += *lenp;
+	*ppos += *lenp;
 	return 0;
 #undef TMPBUFLEN
 }
@@ -1569,9 +1559,9 @@ static int do_proc_dointvec(ctl_table *table, int write, struct file *filp,
  * Returns 0 on success.
  */
 int proc_dointvec(ctl_table *table, int write, struct file *filp,
-		     void __user *buffer, size_t *lenp)
+		     void __user *buffer, size_t *lenp, loff_t *ppos)
 {
-    return do_proc_dointvec(table,write,filp,buffer,lenp,
+    return do_proc_dointvec(table,write,filp,buffer,lenp,ppos,
 		    	    NULL,NULL);
 }
 
@@ -1617,7 +1607,7 @@ static int do_proc_dointvec_bset_conv(int *negp, unsigned long *lvalp,
  */
  
 int proc_dointvec_bset(ctl_table *table, int write, struct file *filp,
-			void __user *buffer, size_t *lenp)
+			void __user *buffer, size_t *lenp, loff_t *ppos)
 {
 	int op;
 
@@ -1626,7 +1616,7 @@ int proc_dointvec_bset(ctl_table *table, int write, struct file *filp,
 	}
 
 	op = (current->pid == 1) ? OP_SET : OP_AND;
-	return do_proc_dointvec(table,write,filp,buffer,lenp,
+	return do_proc_dointvec(table,write,filp,buffer,lenp,ppos,
 				do_proc_dointvec_bset_conv,&op);
 }
 
@@ -1676,23 +1666,24 @@ static int do_proc_dointvec_minmax_conv(int *negp, unsigned long *lvalp,
  * Returns 0 on success.
  */
 int proc_dointvec_minmax(ctl_table *table, int write, struct file *filp,
-		  void __user *buffer, size_t *lenp)
+		  void __user *buffer, size_t *lenp, loff_t *ppos)
 {
 	struct do_proc_dointvec_minmax_conv_param param = {
 		.min = (int *) table->extra1,
 		.max = (int *) table->extra2,
 	};
-	return do_proc_dointvec(table, write, filp, buffer, lenp,
+	return do_proc_dointvec(table, write, filp, buffer, lenp, ppos,
 				do_proc_dointvec_minmax_conv, &param);
 }
 
 static int do_proc_doulongvec_minmax(ctl_table *table, int write,
 				     struct file *filp,
-				     void __user *buffer, size_t *lenp,
+				     void __user *buffer,
+				     size_t *lenp, loff_t *ppos,
 				     unsigned long convmul,
 				     unsigned long convdiv)
 {
-#define TMPBUFLEN 20
+#define TMPBUFLEN 21
 	unsigned long *i, *min, *max, val;
 	int vleft, first=1, neg;
 	size_t len, left;
@@ -1700,7 +1691,7 @@ static int do_proc_doulongvec_minmax(ctl_table *table, int write,
 	char __user *s = buffer;
 	
 	if (!table->data || !table->maxlen || !*lenp ||
-	    (filp->f_pos && !write)) {
+	    (*ppos && !write)) {
 		*lenp = 0;
 		return 0;
 	}
@@ -1785,7 +1776,7 @@ static int do_proc_doulongvec_minmax(ctl_table *table, int write,
 	if (write && first)
 		return -EINVAL;
 	*lenp -= left;
-	filp->f_pos += *lenp;
+	*ppos += *lenp;
 	return 0;
 #undef TMPBUFLEN
 }
@@ -1807,9 +1798,9 @@ static int do_proc_doulongvec_minmax(ctl_table *table, int write,
  * Returns 0 on success.
  */
 int proc_doulongvec_minmax(ctl_table *table, int write, struct file *filp,
-			   void __user *buffer, size_t *lenp)
+			   void __user *buffer, size_t *lenp, loff_t *ppos)
 {
-    return do_proc_doulongvec_minmax(table, write, filp, buffer, lenp, 1l, 1l);
+    return do_proc_doulongvec_minmax(table, write, filp, buffer, lenp, ppos, 1l, 1l);
 }
 
 /**
@@ -1831,10 +1822,11 @@ int proc_doulongvec_minmax(ctl_table *table, int write, struct file *filp,
  */
 int proc_doulongvec_ms_jiffies_minmax(ctl_table *table, int write,
 				      struct file *filp,
-				      void __user *buffer, size_t *lenp)
+				      void __user *buffer,
+				      size_t *lenp, loff_t *ppos)
 {
     return do_proc_doulongvec_minmax(table, write, filp, buffer,
-				     lenp, HZ, 1000l);
+				     lenp, ppos, HZ, 1000l);
 }
 
 
@@ -1896,9 +1888,9 @@ static int do_proc_dointvec_userhz_jiffies_conv(int *negp, unsigned long *lvalp,
  * Returns 0 on success.
  */
 int proc_dointvec_jiffies(ctl_table *table, int write, struct file *filp,
-			  void __user *buffer, size_t *lenp)
+			  void __user *buffer, size_t *lenp, loff_t *ppos)
 {
-    return do_proc_dointvec(table,write,filp,buffer,lenp,
+    return do_proc_dointvec(table,write,filp,buffer,lenp,ppos,
 		    	    do_proc_dointvec_jiffies_conv,NULL);
 }
 
@@ -1918,65 +1910,66 @@ int proc_dointvec_jiffies(ctl_table *table, int write, struct file *filp,
  * Returns 0 on success.
  */
 int proc_dointvec_userhz_jiffies(ctl_table *table, int write, struct file *filp,
-				 void __user *buffer, size_t *lenp)
+				 void __user *buffer, size_t *lenp, loff_t *ppos)
 {
-    return do_proc_dointvec(table,write,filp,buffer,lenp,
+    return do_proc_dointvec(table,write,filp,buffer,lenp,ppos,
 		    	    do_proc_dointvec_userhz_jiffies_conv,NULL);
 }
 
 #else /* CONFIG_PROC_FS */
 
 int proc_dostring(ctl_table *table, int write, struct file *filp,
-		  void __user *buffer, size_t *lenp)
+		  void __user *buffer, size_t *lenp, loff_t *ppos)
 {
 	return -ENOSYS;
 }
 
 static int proc_doutsstring(ctl_table *table, int write, struct file *filp,
-			    void __user *buffer, size_t *lenp)
+			    void __user *buffer, size_t *lenp, loff_t *ppos)
 {
 	return -ENOSYS;
 }
 
 int proc_dointvec(ctl_table *table, int write, struct file *filp,
-		  void __user *buffer, size_t *lenp)
+		  void __user *buffer, size_t *lenp, loff_t *ppos)
 {
 	return -ENOSYS;
 }
 
 int proc_dointvec_bset(ctl_table *table, int write, struct file *filp,
-			void __user *buffer, size_t *lenp)
+			void __user *buffer, size_t *lenp, loff_t *ppos)
 {
 	return -ENOSYS;
 }
 
 int proc_dointvec_minmax(ctl_table *table, int write, struct file *filp,
-		    void __user *buffer, size_t *lenp)
+		    void __user *buffer, size_t *lenp, loff_t *ppos)
 {
 	return -ENOSYS;
 }
 
 int proc_dointvec_jiffies(ctl_table *table, int write, struct file *filp,
-		    void __user *buffer, size_t *lenp)
+		    void __user *buffer, size_t *lenp, loff_t *ppos)
 {
 	return -ENOSYS;
 }
 
 int proc_dointvec_userhz_jiffies(ctl_table *table, int write, struct file *filp,
-		    void __user *buffer, size_t *lenp)
+		    void __user *buffer, size_t *lenp, loff_t *ppos)
 {
 	return -ENOSYS;
 }
 
 int proc_doulongvec_minmax(ctl_table *table, int write, struct file *filp,
-		    void __user *buffer, size_t *lenp)
+		    void __user *buffer, size_t *lenp, loff_t *ppos)
 {
 	return -ENOSYS;
 }
 
 int proc_doulongvec_ms_jiffies_minmax(ctl_table *table, int write,
 				      struct file *filp,
-				      void __user *buffer, size_t *lenp)
+				      void __user *buffer,
+				      size_t *lenp, loff_t *ppos)
 {
     return -ENOSYS;
 }
@@ -2127,50 +2120,51 @@ int sysctl_jiffies(ctl_table *table, int __user *name, int nlen,
 }
 
 int proc_dostring(ctl_table *table, int write, struct file *filp,
-		  void __user *buffer, size_t *lenp)
+		  void __user *buffer, size_t *lenp, loff_t *ppos)
 {
 	return -ENOSYS;
 }
 
 int proc_dointvec(ctl_table *table, int write, struct file *filp,
-		  void __user *buffer, size_t *lenp)
+		  void __user *buffer, size_t *lenp, loff_t *ppos)
 {
 	return -ENOSYS;
 }
 
 int proc_dointvec_bset(ctl_table *table, int write, struct file *filp,
-			void __user *buffer, size_t *lenp)
+			void __user *buffer, size_t *lenp, loff_t *ppos)
 {
 	return -ENOSYS;
 }
 
 int proc_dointvec_minmax(ctl_table *table, int write, struct file *filp,
-		    void __user *buffer, size_t *lenp)
+		    void __user *buffer, size_t *lenp, loff_t *ppos)
 {
 	return -ENOSYS;
 }
 
 int proc_dointvec_jiffies(ctl_table *table, int write, struct file *filp,
-			  void __user *buffer, size_t *lenp)
+			  void __user *buffer, size_t *lenp, loff_t *ppos)
 {
 	return -ENOSYS;
 }
 
 int proc_dointvec_userhz_jiffies(ctl_table *table, int write, struct file *filp,
-			  void __user *buffer, size_t *lenp)
+			  void __user *buffer, size_t *lenp, loff_t *ppos)
 {
 	return -ENOSYS;
 }
 
 int proc_doulongvec_minmax(ctl_table *table, int write, struct file *filp,
-		    void __user *buffer, size_t *lenp)
+		    void __user *buffer, size_t *lenp, loff_t *ppos)
 {
 	return -ENOSYS;
 }
 
 int proc_doulongvec_ms_jiffies_minmax(ctl_table *table, int write,
 				      struct file *filp,
-				      void __user *buffer, size_t *lenp)
+				      void __user *buffer,
+				      size_t *lenp, loff_t *ppos)
 {
     return -ENOSYS;
 }
@@ -2178,7 +2172,7 @@ int proc_doulongvec_ms_jiffies_minmax(ctl_table *table, int write,
 struct ctl_table_header * register_sysctl_table(ctl_table * table, 
 						int insert_at_head)
 {
-	return 0;
+	return NULL;
 }
 
 void unregister_sysctl_table(struct ctl_table_header * table)
diff --git a/kernel/timer.c b/kernel/timer.c
index c80c14984..f7d42e8ec 100644
--- a/kernel/timer.c
+++ b/kernel/timer.c
@@ -795,12 +795,12 @@ static inline void do_process_times(struct task_struct *p,
 
 	psecs = (p->utime += user);
 	psecs += (p->stime += system);
-	if (psecs / HZ > p->rlim[RLIMIT_CPU].rlim_cur) {
+	if (psecs / HZ >= p->rlim[RLIMIT_CPU].rlim_cur) {
 		/* Send SIGXCPU every second.. */
 		if (!(psecs % HZ))
 			send_sig(SIGXCPU, p, 1);
 		/* and SIGKILL when we go over max.. */
-		if (psecs / HZ > p->rlim[RLIMIT_CPU].rlim_max)
+		if (psecs / HZ >= p->rlim[RLIMIT_CPU].rlim_max)
 			send_sig(SIGKILL, p, 1);
 	}
 }
@@ -832,7 +832,7 @@ static inline void do_it_prof(struct task_struct *p)
 	}
 }
 
-void update_one_process(struct task_struct *p, unsigned long user,
+static void update_one_process(struct task_struct *p, unsigned long user,
 			unsigned long system, int cpu)
 {
 	do_process_times(p, user, system);
diff --git a/kernel/uid16.c b/kernel/uid16.c
index 5ebaa3d6b..f669941e8 100644
--- a/kernel/uid16.c
+++ b/kernel/uid16.c
@@ -39,7 +39,7 @@ asmlinkage long sys_setregid16(old_gid_t rgid, old_gid_t egid)
 
 asmlinkage long sys_setgid16(old_gid_t gid)
 {
-	return sys_setgid((gid_t)gid);
+	return sys_setgid(low2highgid(gid));
 }
 
 asmlinkage long sys_setreuid16(old_uid_t ruid, old_uid_t euid)
@@ -49,7 +49,7 @@ asmlinkage long sys_setreuid16(old_uid_t ruid, old_uid_t euid)
 
 asmlinkage long sys_setuid16(old_uid_t uid)
 {
-	return sys_setuid((uid_t)uid);
+	return sys_setuid(low2highuid(uid));
 }
 
 asmlinkage long sys_setresuid16(old_uid_t ruid, old_uid_t euid, old_uid_t suid)
@@ -88,12 +88,12 @@ asmlinkage long sys_getresgid16(old_gid_t __user *rgid, old_gid_t __user *egid,
 
 asmlinkage long sys_setfsuid16(old_uid_t uid)
 {
-	return sys_setfsuid((uid_t)uid);
+	return sys_setfsuid(low2highuid(uid));
 }
 
 asmlinkage long sys_setfsgid16(old_gid_t gid)
 {
-	return sys_setfsgid((gid_t)gid);
+	return sys_setfsgid(low2highgid(gid));
 }
 
 static int groups16_to_user(old_gid_t __user *grouplist,
@@ -103,7 +103,7 @@ static int groups16_to_user(old_gid_t __user *grouplist,
 	old_gid_t group;
 
 	for (i = 0; i < group_info->ngroups; i++) {
-		group = (old_gid_t)GROUP_AT(group_info, i);
+		group = high2lowgid(GROUP_AT(group_info, i));
 		if (put_user(group, grouplist+i))
 			return -EFAULT;
 	}
@@ -120,7 +120,7 @@ static int groups16_from_user(struct group_info *group_info,
 	for (i = 0; i < group_info->ngroups; i++) {
 		if (get_user(group, grouplist+i))
 			return  -EFAULT;
-		GROUP_AT(group_info, i) = (gid_t)group;
+		GROUP_AT(group_info, i) = low2highgid(group);
 	}
 
 	return 0;
diff --git a/kernel/user.c b/kernel/user.c
index 209a7d1fa..850b0aeed 100644
--- a/kernel/user.c
+++ b/kernel/user.c
@@ -30,7 +30,9 @@ static spinlock_t uidhash_lock = SPIN_LOCK_UNLOCKED;
 struct user_struct root_user = {
 	.__count	= ATOMIC_INIT(1),
 	.processes	= ATOMIC_INIT(1),
-	.files		= ATOMIC_INIT(0)
+	.files		= ATOMIC_INIT(0),
+	.sigpending	= ATOMIC_INIT(0),
+	.mq_bytes	= 0
 };
 
 /*
@@ -109,6 +111,9 @@ struct user_struct * alloc_uid(xid_t xid, uid_t uid)
 		atomic_set(&new->__count, 1);
 		atomic_set(&new->processes, 0);
 		atomic_set(&new->files, 0);
+		atomic_set(&new->sigpending, 0);
+
+		new->mq_bytes = 0;
 
 		/*
 		 * Before adding this, check whether we raced
diff --git a/kernel/vserver/Kconfig b/kernel/vserver/Kconfig
index 635d8d488..5160a0135 100644
--- a/kernel/vserver/Kconfig
+++ b/kernel/vserver/Kconfig
@@ -11,7 +11,7 @@ config	VSERVER_LEGACY
 	  This enables the legacy API used in vs1.xx, which allows
 	  to use older tools (for migration purposes).
 
-config	PROC_SECURE
+config	VSERVER_PROC_SECURE
 	bool	"Enable Proc Security"
 	depends on PROC_FS
 	default y
@@ -27,7 +27,7 @@ config	VSERVER_HARDCPU
 
 choice
 	prompt	"Persistent Inode Context Tagging"
-	default	INOXID_GID24
+	default	INOXID_UGID24
 	help
 	  This adds persistent context information to filesystems
 	  mounted with the tagxid option. Tagging is a requirement
@@ -39,26 +39,31 @@ config	INOXID_NONE
 	help
 	  no context information is store for inodes
 
+config	INOXID_UID16
+	bool	"UID16/GID32"
+	help
+	  reduces UID to 16 bit, but leaves GID at 32 bit.
+
 config	INOXID_GID16
 	bool	"UID32/GID16"
 	help
 	  reduces GID to 16 bit, but leaves UID at 32 bit.
 
-config	INOXID_GID24
+config	INOXID_UGID24
 	bool	"UID24/GID24"
 	help
 	  uses the upper 8bit from UID and GID for XID tagging
 	  which leaves 24bit for UID/GID each, which should be
 	  more than sufficient for normal use.
 
-config	INOXID_GID32
+config	INOXID_INTERN
 	bool	"UID32/GID32"
 	help
 	  this uses otherwise reserved inode fields in the on
 	  disk representation, which limits the use to a few
 	  filesystems (currently ext2 and ext3)
 
-config	INOXID_MAGIC
+config	INOXID_RUNTIME
 	bool	"Runtime"
 	depends on EXPERIMENTAL
 	help
@@ -68,5 +73,14 @@ config	INOXID_MAGIC
 
 endchoice
 
+config	VSERVER_DEBUG
+	bool	"Compile Debugging Code"
+	default n
+	help
+	  Set this to yes if you want to be able to activate
+	  debugging output at runtime. It adds a probably small
+	  overhead (~ ??%) to all vserver related functions and
+	  increases the kernel size by about 20k.
+
 endmenu
 
diff --git a/kernel/vserver/Makefile b/kernel/vserver/Makefile
index de2ff2846..577c3ca7b 100644
--- a/kernel/vserver/Makefile
+++ b/kernel/vserver/Makefile
@@ -6,8 +6,8 @@
 obj-y		+= vserver.o
 
 vserver-y	:= switch.o context.o namespace.o sched.o network.o inode.o \
-		   limit.o cvirt.o signal.o proc.o sysctl.o helper.o init.o \
-		   dlimit.o
+		   limit.o cvirt.o signal.o proc.o helper.o init.o dlimit.o
 
+vserver-$(CONFIG_VSERVER_DEBUG) += sysctl.o
 vserver-$(CONFIG_VSERVER_LEGACY) += legacy.o
 
diff --git a/kernel/vserver/context.c b/kernel/vserver/context.c
index 533e10439..120ac1abc 100644
--- a/kernel/vserver/context.c
+++ b/kernel/vserver/context.c
@@ -38,7 +38,7 @@ static struct vx_info *__alloc_vx_info(xid_t xid)
 {
 	struct vx_info *new = NULL;
 	
-	vxdprintk("alloc_vx_info(%d)\n", xid);
+	vxdprintk(VXD_CBIT(xid, 0), "alloc_vx_info(%d)*", xid);
 
 	/* would this benefit from a slab cache? */
 	new = kmalloc(sizeof(struct vx_info), GFP_KERNEL);
@@ -62,7 +62,8 @@ static struct vx_info *__alloc_vx_info(xid_t xid)
 	new->vx_bcaps = CAP_INIT_EFF_SET;
 	new->vx_ccaps = 0;
 
-	vxdprintk("alloc_vx_info(%d) = %p\n", xid, new);
+	vxdprintk(VXD_CBIT(xid, 0),
+		"alloc_vx_info(%d) = %p", xid, new);
 	return new;
 }
 
@@ -72,7 +73,8 @@ static struct vx_info *__alloc_vx_info(xid_t xid)
 
 static void __dealloc_vx_info(struct vx_info *vxi)
 {
-	vxdprintk("dealloc_vx_info(%p)\n", vxi);
+	vxdprintk(VXD_CBIT(xid, 0),
+		"dealloc_vx_info(%p)", vxi);
 
 	vxi->vx_hlist.next = LIST_POISON1;
 	vxi->vx_id = -1;
@@ -119,7 +121,8 @@ static inline void __hash_vx_info(struct vx_info *vxi)
 {
 	struct hlist_head *head;
 	
-	vxdprintk("__hash_vx_info: %p[#%d]\n", vxi, vxi->vx_id);
+	vxdprintk(VXD_CBIT(xid, 4),
+		"__hash_vx_info: %p[#%d]", vxi, vxi->vx_id);
 	get_vx_info(vxi);
 	head = &vx_info_hash[__hashval(vxi->vx_id)];
 	hlist_add_head_rcu(&vxi->vx_hlist, head);
@@ -132,7 +135,8 @@ static inline void __hash_vx_info(struct vx_info *vxi)
 
 static inline void __unhash_vx_info(struct vx_info *vxi)
 {
-	vxdprintk("__unhash_vx_info: %p[#%d]\n", vxi, vxi->vx_id);
+	vxdprintk(VXD_CBIT(xid, 4),
+		"__unhash_vx_info: %p[#%d]", vxi, vxi->vx_id);
 	hlist_del_rcu(&vxi->vx_hlist);
 	put_vx_info(vxi);
 }
@@ -173,8 +177,11 @@ static inline xid_t __vx_dynamic_id(void)
 	do {
 		if (++seq > MAX_S_CONTEXT)
 			seq = MIN_D_CONTEXT;
-		if (!__lookup_vx_info(seq))
+		if (!__lookup_vx_info(seq)) {
+			vxdprintk(VXD_CBIT(xid, 4),
+				"__vx_dynamic_id: [#%d]", seq);
 			return seq;
+		}
 	} while (barrier != seq);
 	return 0;
 }
@@ -188,7 +195,7 @@ static struct vx_info * __loc_vx_info(int id, int *err)
 {
 	struct vx_info *new, *vxi = NULL;
 	
-	vxdprintk("loc_vx_info(%d)\n", id);
+	vxdprintk(VXD_CBIT(xid, 1), "loc_vx_info(%d)*", id);
 
 	if (!(new = __alloc_vx_info(id))) {
 		*err = -ENOMEM;
@@ -210,11 +217,13 @@ static struct vx_info * __loc_vx_info(int id, int *err)
 	else if ((vxi = __lookup_vx_info(id))) {
 		/* context in setup is not available */
 		if (vxi->vx_flags & VXF_STATE_SETUP) {
-			vxdprintk("loc_vx_info(%d) = %p (not available)\n", id, vxi);
+			vxdprintk(VXD_CBIT(xid, 0),
+				"loc_vx_info(%d) = %p (not available)", id, vxi);
 			vxi = NULL;
 			*err = -EBUSY;
 		} else {
-			vxdprintk("loc_vx_info(%d) = %p (found)\n", id, vxi);
+			vxdprintk(VXD_CBIT(xid, 0),
+				"loc_vx_info(%d) = %p (found)", id, vxi);
 			get_vx_info(vxi);
 			*err = 0;
 		}
@@ -222,7 +231,8 @@ static struct vx_info * __loc_vx_info(int id, int *err)
 	}
 
 	/* new context requested */
-	vxdprintk("loc_vx_info(%d) = %p (new)\n", id, new);
+	vxdprintk(VXD_CBIT(xid, 0),
+		"loc_vx_info(%d) = %p (new)", id, new);
 	__hash_vx_info(get_vx_info(new));
 	vxi = new, new = NULL;
 	*err = 1;
@@ -240,12 +250,12 @@ out_unlock:
 
 
 
-void rcu_free_vx_info(void *obj)
+void rcu_free_vx_info(struct rcu_head *head)
 {
-	struct vx_info *vxi = obj;
+	struct vx_info *vxi = container_of(head, struct vx_info, vx_rcu);
 	int usecnt, refcnt;
 
-	BUG_ON(!vxi);
+	BUG_ON(!vxi || !head);
 
 	usecnt = atomic_read(&vxi->vx_usecnt);
 	BUG_ON(usecnt < 0);
@@ -253,6 +263,8 @@ void rcu_free_vx_info(void *obj)
 	refcnt = atomic_read(&vxi->vx_refcnt);
 	BUG_ON(refcnt < 0);
 
+	vxdprintk(VXD_CBIT(xid, 3),
+		"rcu_free_vx_info(%p): uc=%d", vxi, usecnt);
 	if (!usecnt)
 		__dealloc_vx_info(vxi);
 	else
@@ -385,25 +397,23 @@ void vx_mask_bcaps(struct task_struct *p)
 static inline int vx_nofiles_task(struct task_struct *tsk)
 {
 	struct files_struct *files = tsk->files;
-	const unsigned long *obptr, *cbptr;
+	const unsigned long *obptr;
 	int count, total;
 
 	spin_lock(&files->file_lock);
 	obptr = files->open_fds->fds_bits;
-	cbptr = files->close_on_exec->fds_bits;
 	count = files->max_fds / (sizeof(unsigned long) * 8);
 	for (total = 0; count > 0; count--) {
 		if (*obptr)
 			total += hweight_long(*obptr);
 		obptr++;
-	/*	if (*cbptr)
-			total += hweight_long(*cbptr);
-		cbptr++; */
 	}
 	spin_unlock(&files->file_lock);
 	return total;
 }
 
+#if 0
+
 static inline int vx_openfd_task(struct task_struct *tsk)
 {
 	struct files_struct *files = tsk->files;
@@ -422,6 +432,8 @@ static inline int vx_openfd_task(struct task_struct *tsk)
 	return total;
 }
 
+#endif
+
 /*
  *	migrate task to new context
  *	gets vxi, puts old_vxi on change
@@ -439,26 +451,32 @@ int vx_migrate_task(struct task_struct *p, struct vx_info *vxi)
 	if (old_vxi == vxi)
 		goto out;
 
-	vxdprintk("vx_migrate_task(%p,%p[#%d.%d)\n", p, vxi,
+	vxdprintk(VXD_CBIT(xid, 5),
+		"vx_migrate_task(%p,%p[#%d.%d])", p, vxi,
 		vxi->vx_id, atomic_read(&vxi->vx_usecnt));
 
 	if (!(ret = vx_migrate_user(p, vxi))) {
-		int openfd, nofiles;
+		int nofiles;
 
 		task_lock(p);
-		openfd = vx_openfd_task(p);
+		// openfd = vx_openfd_task(p);
 		nofiles = vx_nofiles_task(p);
 
 		if (old_vxi) {
 			atomic_dec(&old_vxi->cacct.nr_threads);
 			atomic_dec(&old_vxi->limit.rcur[RLIMIT_NPROC]);
-			atomic_sub(nofiles, &vxi->limit.rcur[RLIMIT_NOFILE]);
-			atomic_sub(openfd, &vxi->limit.rcur[RLIMIT_OPENFD]);
+			atomic_sub(nofiles, &old_vxi->limit.rcur[RLIMIT_NOFILE]);
+			// atomic_sub(openfd, &old_vxi->limit.rcur[RLIMIT_OPENFD]);
 		}		
 		atomic_inc(&vxi->cacct.nr_threads);
 		atomic_inc(&vxi->limit.rcur[RLIMIT_NPROC]);
 		atomic_add(nofiles, &vxi->limit.rcur[RLIMIT_NOFILE]);
-		atomic_add(openfd, &vxi->limit.rcur[RLIMIT_OPENFD]);
+		// atomic_add(openfd, &vxi->limit.rcur[RLIMIT_OPENFD]);
+
+		vxdprintk(VXD_CBIT(xid, 5),
+			"moved task %p into vxi:%p[#%d]",
+			p, vxi, vxi->vx_id);
+
 		/* should be handled in set_vx_info !! */
 		if (old_vxi)
 			clr_vx_info(&p->vx_info);
diff --git a/kernel/vserver/cvirt.c b/kernel/vserver/cvirt.c
index cdcb86a13..a5192211f 100644
--- a/kernel/vserver/cvirt.c
+++ b/kernel/vserver/cvirt.c
@@ -24,10 +24,13 @@
 void vx_vsi_uptime(struct timespec *uptime, struct timespec *idle)
 {
 	struct vx_info *vxi = current->vx_info;
+	struct timeval bias;
+
+	jiffies_to_timeval(vxi->cvirt.bias_jiffies - INITIAL_JIFFIES, &bias);
 
 	set_normalized_timespec(uptime,
-		uptime->tv_sec - vxi->cvirt.bias_tp.tv_sec,
-		uptime->tv_nsec - vxi->cvirt.bias_tp.tv_nsec);
+		uptime->tv_sec - bias.tv_sec,
+		uptime->tv_nsec - bias.tv_usec*1000);
 	if (!idle)
 		return;
 	set_normalized_timespec(idle,
diff --git a/kernel/vserver/dlimit.c b/kernel/vserver/dlimit.c
index eb9282f9f..d9478ddd8 100644
--- a/kernel/vserver/dlimit.c
+++ b/kernel/vserver/dlimit.c
@@ -31,7 +31,8 @@ static struct dl_info *__alloc_dl_info(struct super_block *sb, xid_t xid)
 {
 	struct dl_info *new = NULL;
 	
-	vxdprintk("alloc_dl_info(%p,%d)\n", sb, xid);
+	vxdprintk(VXD_CBIT(dlim, 5),
+		"alloc_dl_info(%p,%d)*", sb, xid);
 
 	/* would this benefit from a slab cache? */
 	new = kmalloc(sizeof(struct dl_info), GFP_KERNEL);
@@ -49,7 +50,8 @@ static struct dl_info *__alloc_dl_info(struct super_block *sb, xid_t xid)
 
 	/* rest of init goes here */
 
-	vxdprintk("alloc_dl_info(%p,%d) = %p\n", sb, xid, new);
+	vxdprintk(VXD_CBIT(dlim, 4),
+		"alloc_dl_info(%p,%d) = %p", sb, xid, new);
 	return new;
 }
 
@@ -59,7 +61,8 @@ static struct dl_info *__alloc_dl_info(struct super_block *sb, xid_t xid)
 
 static void __dealloc_dl_info(struct dl_info *dli)
 {
-	vxdprintk("dealloc_dl_info(%p)\n", dli);
+	vxdprintk(VXD_CBIT(dlim, 4),
+		"dealloc_dl_info(%p)", dli);
 
 	dli->dl_hlist.next = LIST_POISON1;
 	dli->dl_xid = -1;
@@ -83,7 +86,7 @@ static spinlock_t dl_info_hash_lock = SPIN_LOCK_UNLOCKED;
 
 static inline unsigned int __hashval(struct super_block *sb, xid_t xid)
 {
-	return ((xid ^ (unsigned int)sb) % DL_HASH_SIZE);
+	return ((xid ^ (unsigned long)sb) % DL_HASH_SIZE);
 }
 
 
@@ -97,7 +100,8 @@ static inline void __hash_dl_info(struct dl_info *dli)
 {
 	struct hlist_head *head;
 	
-	vxdprintk("__hash_dl_info: %p[#%d]\n", dli, dli->dl_xid);
+	vxdprintk(VXD_CBIT(dlim, 6),
+		"__hash_dl_info: %p[#%d]", dli, dli->dl_xid);
 	get_dl_info(dli);
 	head = &dl_info_hash[__hashval(dli->dl_sb, dli->dl_xid)];
 	hlist_add_head_rcu(&dli->dl_hlist, head);
@@ -110,7 +114,8 @@ static inline void __hash_dl_info(struct dl_info *dli)
 
 static inline void __unhash_dl_info(struct dl_info *dli)
 {
-	vxdprintk("__unhash_dl_info: %p[#%d]\n", dli, dli->dl_xid);
+	vxdprintk(VXD_CBIT(dlim, 6),
+		"__unhash_dl_info: %p[#%d]", dli, dli->dl_xid);
 	hlist_del_rcu(&dli->dl_hlist);
 	put_dl_info(dli);
 }
@@ -149,16 +154,18 @@ struct dl_info *locate_dl_info(struct super_block *sb, xid_t xid)
 
 	rcu_read_lock();
 	dli = get_dl_info(__lookup_dl_info(sb, xid));
+	vxdprintk(VXD_CBIT(dlim, 7),
+		"locate_dl_info(%p,#%d) = %p", sb, xid, dli);
 	rcu_read_unlock();
         return dli;
 }
 
-void rcu_free_dl_info(void *obj)
+void rcu_free_dl_info(struct rcu_head *head)
 {
-	struct dl_info *dli = obj;
+	struct dl_info *dli = container_of(head, struct dl_info, dl_rcu);
 	int usecnt, refcnt;
 
-	BUG_ON(!dli);
+	BUG_ON(!dli || !head);
 
 	usecnt = atomic_read(&dli->dl_usecnt);
 	BUG_ON(usecnt < 0);
@@ -166,6 +173,8 @@ void rcu_free_dl_info(void *obj)
 	refcnt = atomic_read(&dli->dl_refcnt);
 	BUG_ON(refcnt < 0);
 
+	vxdprintk(VXD_CBIT(dlim, 3),
+		"rcu_free_dl_info(%p)", dli);
 	if (!usecnt)
 		__dealloc_dl_info(dli);
 	else
@@ -437,3 +446,10 @@ no_blim:
 	return;	
 }
 
+#include <linux/module.h>
+
+EXPORT_SYMBOL_GPL(locate_dl_info);
+EXPORT_SYMBOL_GPL(rcu_free_dl_info);
+// EXPORT_SYMBOL_GPL(dl_info_hash_lock);
+// EXPORT_SYMBOL_GPL(unhash_dl_info);
+
diff --git a/kernel/vserver/init.c b/kernel/vserver/init.c
index 4a20f268c..22cc81883 100644
--- a/kernel/vserver/init.c
+++ b/kernel/vserver/init.c
@@ -23,7 +23,9 @@ static int __init init_vserver(void)
 {
 	int ret = 0;
 
+#ifdef	CONFIG_VSERVER_DEBUG
 	vserver_register_sysctl();
+#endif
 	return ret;
 }
 
@@ -31,7 +33,9 @@ static int __init init_vserver(void)
 static void __exit exit_vserver(void)
 {
 
+#ifdef	CONFIG_VSERVER_DEBUG
 	vserver_unregister_sysctl();
+#endif
 	return;
 }
 
diff --git a/kernel/vserver/limit.c b/kernel/vserver/limit.c
index 94064117d..99590bbc0 100644
--- a/kernel/vserver/limit.c
+++ b/kernel/vserver/limit.c
@@ -21,6 +21,19 @@
 #include <asm/uaccess.h>
 
 
+const char *vlimit_name[NUM_LIMITS] = {
+	[RLIMIT_CPU]		= "CPU",
+	[RLIMIT_RSS]		= "RSS",
+	[RLIMIT_NPROC]		= "NPROC",
+	[RLIMIT_NOFILE]	= "NOFILE",
+	[RLIMIT_MEMLOCK]	= "VML",
+	[RLIMIT_AS]		= "VM",
+	[RLIMIT_LOCKS]		= "LOCKS",
+	[RLIMIT_MSGQUEUE]	= "MSGQ",
+	[VLIMIT_NSOCK]		= "NSOCK",
+};
+
+
 static int is_valid_rlimit(int id)
 {
 	int valid = 0;
diff --git a/kernel/vserver/network.c b/kernel/vserver/network.c
index b9b9327e8..a62d1c435 100644
--- a/kernel/vserver/network.c
+++ b/kernel/vserver/network.c
@@ -31,7 +31,7 @@ static struct nx_info *__alloc_nx_info(nid_t nid)
 {
 	struct nx_info *new = NULL;
 	
-	nxdprintk("alloc_nx_info()\n");
+	vxdprintk(VXD_CBIT(nid, 1), "alloc_nx_info(%d)*", nid);
 
 	/* would this benefit from a slab cache? */
 	new = kmalloc(sizeof(struct nx_info), GFP_KERNEL);
@@ -47,7 +47,8 @@ static struct nx_info *__alloc_nx_info(nid_t nid)
 
 	/* rest of init goes here */
 	
-	nxdprintk("alloc_nx_info() = %p\n", new);
+	vxdprintk(VXD_CBIT(nid, 0),
+		"alloc_nx_info() = %p", new);
 	return new;
 }
 
@@ -57,7 +58,8 @@ static struct nx_info *__alloc_nx_info(nid_t nid)
 
 static void __dealloc_nx_info(struct nx_info *nxi)
 {
-	nxdprintk("dealloc_nx_info(%p)\n", nxi);
+	vxdprintk(VXD_CBIT(nid, 0),
+		"dealloc_nx_info(%p)", nxi);
 
 	nxi->nx_hlist.next = LIST_POISON1;
 	nxi->nx_id = -1;
@@ -94,7 +96,8 @@ static inline void __hash_nx_info(struct nx_info *nxi)
 {
 	struct hlist_head *head;
 	
-	nxdprintk("__hash_nx_info: %p[#%d]\n", nxi, nxi->nx_id);
+	vxdprintk(VXD_CBIT(nid, 4),
+		"__hash_nx_info: %p[#%d]", nxi, nxi->nx_id);
 	get_nx_info(nxi);
 	head = &nx_info_hash[__hashval(nxi->nx_id)];
 	hlist_add_head_rcu(&nxi->nx_hlist, head);
@@ -107,7 +110,8 @@ static inline void __hash_nx_info(struct nx_info *nxi)
 
 static inline void __unhash_nx_info(struct nx_info *nxi)
 {
-	nxdprintk("__unhash_nx_info: %p[#%d]\n", nxi, nxi->nx_id);
+	vxdprintk(VXD_CBIT(nid, 4),
+		"__unhash_nx_info: %p[#%d]", nxi, nxi->nx_id);
 	hlist_del_rcu(&nxi->nx_hlist);
 	put_nx_info(nxi);
 }
@@ -148,8 +152,11 @@ static inline nid_t __nx_dynamic_id(void)
 	do {
 		if (++seq > MAX_N_CONTEXT)
 			seq = MIN_D_CONTEXT;
-		if (!__lookup_nx_info(seq))
+		if (!__lookup_nx_info(seq)) {
+			vxdprintk(VXD_CBIT(nid, 4),
+				"__nx_dynamic_id: [#%d]", seq);
 			return seq;
+		}
 	} while (barrier != seq);
 	return 0;
 }
@@ -163,7 +170,7 @@ static struct nx_info * __loc_nx_info(int id, int *err)
 {
 	struct nx_info *new, *nxi = NULL;
 	
-	nxdprintk("loc_nx_info(%d)\n", id);
+	vxdprintk(VXD_CBIT(nid, 1), "loc_nx_info(%d)*", id);
 
 	if (!(new = __alloc_nx_info(id))) {
 		*err = -ENOMEM;
@@ -185,11 +192,13 @@ static struct nx_info * __loc_nx_info(int id, int *err)
 	else if ((nxi = __lookup_nx_info(id))) {
 		/* context in setup is not available */
 		if (nxi->nx_flags & VXF_STATE_SETUP) {
-			nxdprintk("loc_nx_info(%d) = %p (not available)\n", id, nxi);
+			vxdprintk(VXD_CBIT(nid, 0),
+				"loc_nx_info(%d) = %p (not available)", id, nxi);
 			nxi = NULL;
 			*err = -EBUSY;
 		} else {
-			nxdprintk("loc_nx_info(%d) = %p (found)\n", id, nxi);
+			vxdprintk(VXD_CBIT(nid, 0),
+				"loc_nx_info(%d) = %p (found)", id, nxi);
 			get_nx_info(nxi);
 			*err = 0;
 		}
@@ -197,7 +206,8 @@ static struct nx_info * __loc_nx_info(int id, int *err)
 	}
 
 	/* new context requested */
-	nxdprintk("loc_nx_info(%d) = %p (new)\n", id, new);
+	vxdprintk(VXD_CBIT(nid, 0),
+		"loc_nx_info(%d) = %p (new)", id, new);
 	__hash_nx_info(get_nx_info(new));
 	nxi = new, new = NULL;
 	*err = 1;
@@ -216,17 +226,21 @@ out_unlock:
 
 
 
-void rcu_free_nx_info(void *obj)
+void rcu_free_nx_info(struct rcu_head *head)
 {
-	struct nx_info *nxi = obj;
+	struct nx_info *nxi = container_of(head, struct nx_info, nx_rcu);
 	int usecnt, refcnt;
 
+	BUG_ON(!nxi || !head);
+
 	usecnt = atomic_read(&nxi->nx_usecnt);
 	BUG_ON(usecnt < 0);
 
 	refcnt = atomic_read(&nxi->nx_refcnt);
 	BUG_ON(refcnt < 0);
 
+	vxdprintk(VXD_CBIT(nid, 3),
+		"rcu_free_nx_info(%p): uc=%d", nxi, usecnt);
 	if (!usecnt)
 		__dealloc_nx_info(nxi);
 	else
@@ -287,7 +301,7 @@ struct nx_info *create_nx_info(void)
 	struct nx_info *new;
 	int err;
 	
-	nxdprintk("create_nx_info()\n");
+	vxdprintk(VXD_CBIT(nid, 5), "create_nx_info(%s)", "void");
 	if (!(new = __loc_nx_info(NX_DYNAMIC_ID, &err)))
 		return NULL;
 	return new;
@@ -342,7 +356,8 @@ int nx_migrate_task(struct task_struct *p, struct nx_info *nxi)
 	if (!p || !nxi)
 		BUG();
 
-	nxdprintk("nx_migrate_task(%p,%p[#%d.%d.%d])\n",
+	vxdprintk(VXD_CBIT(nid, 5),
+		"nx_migrate_task(%p,%p[#%d.%d.%d])",
 		p, nxi, nxi->nx_id,
 		atomic_read(&nxi->nx_usecnt),
 		atomic_read(&nxi->nx_refcnt));
diff --git a/kernel/vserver/switch.c b/kernel/vserver/switch.c
index 25c1083e3..f13ee97a9 100644
--- a/kernel/vserver/switch.c
+++ b/kernel/vserver/switch.c
@@ -39,17 +39,14 @@ vc_get_version(uint32_t id)
 #include <linux/vserver/dlimit.h>
 
 
-extern unsigned int vx_debug_switch;
-
-
 extern asmlinkage long
 sys_vserver(uint32_t cmd, uint32_t id, void __user *data)
 {
 
-	if (vx_debug_switch)
-		printk( "vc: VCMD_%02d_%d[%d], %d\n",
-			VC_CATEGORY(cmd), VC_COMMAND(cmd),
-			VC_VERSION(cmd), id);
+	vxdprintk(VXD_CBIT(switch, 0),
+		"vc: VCMD_%02d_%d[%d], %d",
+		VC_CATEGORY(cmd), VC_COMMAND(cmd),
+		VC_VERSION(cmd), id);
 
 	switch (cmd) {
 	case VCMD_get_version:
diff --git a/kernel/vserver/sysctl.c b/kernel/vserver/sysctl.c
index 32fde9a93..298c62f18 100644
--- a/kernel/vserver/sysctl.c
+++ b/kernel/vserver/sysctl.c
@@ -26,14 +26,22 @@
 
 enum {
         CTL_DEBUG_SWITCH = 1,
+        CTL_DEBUG_XID,
+        CTL_DEBUG_NID,
+        CTL_DEBUG_NET,
         CTL_DEBUG_LIMIT,
-        CTL_DEBUG_DLIMIT,
+        CTL_DEBUG_DLIM,
+        CTL_DEBUG_CVIRT,
 };
 
 
 unsigned int vx_debug_switch = 0;
+unsigned int vx_debug_xid = 0;
+unsigned int vx_debug_nid = 0;
+unsigned int vx_debug_net = 0;
 unsigned int vx_debug_limit = 0;
-unsigned int vx_debug_dlimit = 0;
+unsigned int vx_debug_dlim = 0;
+unsigned int vx_debug_cvirt = 0;
 
 
 static struct ctl_table_header *vserver_table_header;
@@ -62,13 +70,13 @@ void vserver_unregister_sysctl(void)
 
 
 static int proc_dodebug(ctl_table *table, int write,
-	struct file *file, void *buffer, size_t *lenp)
+	struct file *filp, void __user *buffer, size_t *lenp, loff_t *ppos)
 {
 	char		tmpbuf[20], *p, c;
 	unsigned int	value;
 	size_t		left, len;
 
-	if ((file->f_pos && !write) || !*lenp) {
+	if ((*ppos && !write) || !*lenp) {
 		*lenp = 0;
 		return 0;
 	}
@@ -114,7 +122,7 @@ static int proc_dodebug(ctl_table *table, int write,
 
 done:
 	*lenp -= left;
-	file->f_pos += *lenp;
+	*ppos += *lenp;
 	return 0;
 }
 	
@@ -129,6 +137,30 @@ static ctl_table debug_table[] = {
                 .mode           = 0644,
                 .proc_handler   = &proc_dodebug
         },
+        {
+                .ctl_name       = CTL_DEBUG_XID,
+                .procname       = "debug_xid",
+                .data           = &vx_debug_xid,
+                .maxlen         = sizeof(int),
+                .mode           = 0644,
+                .proc_handler   = &proc_dodebug
+        },
+        {
+                .ctl_name       = CTL_DEBUG_NID,
+                .procname       = "debug_nid",
+                .data           = &vx_debug_nid,
+                .maxlen         = sizeof(int),
+                .mode           = 0644,
+                .proc_handler   = &proc_dodebug
+        },
+        {
+                .ctl_name       = CTL_DEBUG_NET,
+                .procname       = "debug_net",
+                .data           = &vx_debug_net,
+                .maxlen         = sizeof(int),
+                .mode           = 0644,
+                .proc_handler   = &proc_dodebug
+        },
         {
                 .ctl_name       = CTL_DEBUG_LIMIT,
                 .procname       = "debug_limit",
@@ -138,9 +170,17 @@ static ctl_table debug_table[] = {
                 .proc_handler   = &proc_dodebug
         },
         {
-                .ctl_name       = CTL_DEBUG_DLIMIT,
-                .procname       = "debug_dlimit",
-                .data           = &vx_debug_dlimit,
+                .ctl_name       = CTL_DEBUG_DLIM,
+                .procname       = "debug_dlim",
+                .data           = &vx_debug_dlim,
+                .maxlen         = sizeof(int),
+                .mode           = 0644,
+                .proc_handler   = &proc_dodebug
+        },
+        {
+                .ctl_name       = CTL_DEBUG_CVIRT,
+                .procname       = "debug_cvirt",
+                .data           = &vx_debug_cvirt,
                 .maxlen         = sizeof(int),
                 .mode           = 0644,
                 .proc_handler   = &proc_dodebug
@@ -158,3 +198,6 @@ static ctl_table vserver_table[] = {
         { .ctl_name = 0 }
 };
 
+
+EXPORT_SYMBOL_GPL(vx_debug_dlim);
+
diff --git a/lib/Kconfig b/lib/Kconfig
index 468ba1b99..2f25b0cfa 100644
--- a/lib/Kconfig
+++ b/lib/Kconfig
@@ -4,8 +4,17 @@
 
 menu "Library routines"
 
+config CRC_CCITT
+	tristate "CRC-CCITT functions"
+	help
+	  This option is provided for the case where no in-kernel-tree
+	  modules require CRC-CCITT functions, but a module built outside
+	  the kernel tree does. Such modules that use library CRC-CCITT
+	  functions require M here.
+
 config CRC32
 	tristate "CRC32 functions"
+	default y
 	help
 	  This option is provided for the case where no in-kernel-tree
 	  modules require CRC32 functions, but a module built outside the
diff --git a/lib/Makefile b/lib/Makefile
index e48f14226..295e70bcd 100644
--- a/lib/Makefile
+++ b/lib/Makefile
@@ -18,6 +18,7 @@ ifneq ($(CONFIG_HAVE_DEC_LOCK),y)
   lib-y += dec_and_lock.o
 endif
 
+obj-$(CONFIG_CRC_CCITT)	+= crc-ccitt.o
 obj-$(CONFIG_CRC32)	+= crc32.o
 obj-$(CONFIG_LIBCRC32C)	+= libcrc32c.o
 
diff --git a/lib/bitmap.c b/lib/bitmap.c
index 779d30365..7eb16be30 100644
--- a/lib/bitmap.c
+++ b/lib/bitmap.c
@@ -12,7 +12,33 @@
 #include <asm/bitops.h>
 #include <asm/uaccess.h>
 
-int bitmap_empty(const unsigned long *bitmap, int bits)
+/*
+ * bitmaps provide an array of bits, implemented using an an
+ * array of unsigned longs.  The number of valid bits in a
+ * given bitmap does _not_ need to be an exact multiple of
+ * BITS_PER_LONG.
+ *
+ * The possible unused bits in the last, partially used word
+ * of a bitmap are 'don't care'.  The implementation makes
+ * no particular effort to keep them zero.  It ensures that
+ * their value will not affect the results of any operation.
+ * The bitmap operations that return Boolean (bitmap_empty,
+ * for example) or scalar (bitmap_weight, for example) results
+ * carefully filter out these unused bits from impacting their
+ * results.
+ *
+ * These operations actually hold to a slightly stronger rule:
+ * if you don't input any bitmaps to these ops that have some
+ * unused bits set, then they won't output any set unused bits
+ * in output bitmaps.
+ *
+ * The byte ordering of bitmaps is more natural on little
+ * endian architectures.  See the big-endian headers
+ * include/asm-ppc64/bitops.h and include/asm-s390/bitops.h
+ * for the best explanations of this ordering.
+ */
+
+int __bitmap_empty(const unsigned long *bitmap, int bits)
 {
 	int k, lim = bits/BITS_PER_LONG;
 	for (k = 0; k < lim; ++k)
@@ -20,14 +46,14 @@ int bitmap_empty(const unsigned long *bitmap, int bits)
 			return 0;
 
 	if (bits % BITS_PER_LONG)
-		if (bitmap[k] & ((1UL << (bits % BITS_PER_LONG)) - 1))
+		if (bitmap[k] & BITMAP_LAST_WORD_MASK(bits))
 			return 0;
 
 	return 1;
 }
-EXPORT_SYMBOL(bitmap_empty);
+EXPORT_SYMBOL(__bitmap_empty);
 
-int bitmap_full(const unsigned long *bitmap, int bits)
+int __bitmap_full(const unsigned long *bitmap, int bits)
 {
 	int k, lim = bits/BITS_PER_LONG;
 	for (k = 0; k < lim; ++k)
@@ -35,15 +61,15 @@ int bitmap_full(const unsigned long *bitmap, int bits)
 			return 0;
 
 	if (bits % BITS_PER_LONG)
-		if (~bitmap[k] & ((1UL << (bits % BITS_PER_LONG)) - 1))
+		if (~bitmap[k] & BITMAP_LAST_WORD_MASK(bits))
 			return 0;
 
 	return 1;
 }
-EXPORT_SYMBOL(bitmap_full);
+EXPORT_SYMBOL(__bitmap_full);
 
-int bitmap_equal(const unsigned long *bitmap1,
-		unsigned long *bitmap2, int bits)
+int __bitmap_equal(const unsigned long *bitmap1,
+		const unsigned long *bitmap2, int bits)
 {
 	int k, lim = bits/BITS_PER_LONG;
 	for (k = 0; k < lim; ++k)
@@ -51,26 +77,26 @@ int bitmap_equal(const unsigned long *bitmap1,
 			return 0;
 
 	if (bits % BITS_PER_LONG)
-		if ((bitmap1[k] ^ bitmap2[k]) &
-				((1UL << (bits % BITS_PER_LONG)) - 1))
+		if ((bitmap1[k] ^ bitmap2[k]) & BITMAP_LAST_WORD_MASK(bits))
 			return 0;
 
 	return 1;
 }
-EXPORT_SYMBOL(bitmap_equal);
+EXPORT_SYMBOL(__bitmap_equal);
 
-void bitmap_complement(unsigned long *bitmap, int bits)
+void __bitmap_complement(unsigned long *dst, const unsigned long *src, int bits)
 {
-	int k;
-	int nr = BITS_TO_LONGS(bits);
+	int k, lim = bits/BITS_PER_LONG;
+	for (k = 0; k < lim; ++k)
+		dst[k] = ~src[k];
 
-	for (k = 0; k < nr; ++k)
-		bitmap[k] = ~bitmap[k];
+	if (bits % BITS_PER_LONG)
+		dst[k] = ~src[k] & BITMAP_LAST_WORD_MASK(bits);
 }
-EXPORT_SYMBOL(bitmap_complement);
+EXPORT_SYMBOL(__bitmap_complement);
 
 /*
- * bitmap_shift_right - logical right shift of the bits in a bitmap
+ * __bitmap_shift_right - logical right shift of the bits in a bitmap
  *   @dst - destination bitmap
  *   @src - source bitmap
  *   @nbits - shift by this many bits
@@ -80,7 +106,7 @@ EXPORT_SYMBOL(bitmap_complement);
  * direction.  Zeros are fed into the vacated MS positions and the
  * LS bits shifted off the bottom are lost.
  */
-void bitmap_shift_right(unsigned long *dst,
+void __bitmap_shift_right(unsigned long *dst,
 			const unsigned long *src, int shift, int bits)
 {
 	int k, lim = BITS_TO_LONGS(bits), left = bits % BITS_PER_LONG;
@@ -110,10 +136,11 @@ void bitmap_shift_right(unsigned long *dst,
 	if (off)
 		memset(&dst[lim - off], 0, off*sizeof(unsigned long));
 }
-EXPORT_SYMBOL(bitmap_shift_right);
+EXPORT_SYMBOL(__bitmap_shift_right);
+
 
 /*
- * bitmap_shift_left - logical left shift of the bits in a bitmap
+ * __bitmap_shift_left - logical left shift of the bits in a bitmap
  *   @dst - destination bitmap
  *   @src - source bitmap
  *   @nbits - shift by this many bits
@@ -123,7 +150,8 @@ EXPORT_SYMBOL(bitmap_shift_right);
  * direction.  Zeros are fed into the vacated LS bit positions
  * and those MS bits shifted off the top are lost.
  */
-void bitmap_shift_left(unsigned long *dst,
+
+void __bitmap_shift_left(unsigned long *dst,
 			const unsigned long *src, int shift, int bits)
 {
 	int k, lim = BITS_TO_LONGS(bits), left = bits % BITS_PER_LONG;
@@ -149,9 +177,9 @@ void bitmap_shift_left(unsigned long *dst,
 	if (off)
 		memset(dst, 0, off*sizeof(unsigned long));
 }
-EXPORT_SYMBOL(bitmap_shift_left);
+EXPORT_SYMBOL(__bitmap_shift_left);
 
-void bitmap_and(unsigned long *dst, const unsigned long *bitmap1,
+void __bitmap_and(unsigned long *dst, const unsigned long *bitmap1,
 				const unsigned long *bitmap2, int bits)
 {
 	int k;
@@ -160,9 +188,9 @@ void bitmap_and(unsigned long *dst, const unsigned long *bitmap1,
 	for (k = 0; k < nr; k++)
 		dst[k] = bitmap1[k] & bitmap2[k];
 }
-EXPORT_SYMBOL(bitmap_and);
+EXPORT_SYMBOL(__bitmap_and);
 
-void bitmap_or(unsigned long *dst, const unsigned long *bitmap1,
+void __bitmap_or(unsigned long *dst, const unsigned long *bitmap1,
 				const unsigned long *bitmap2, int bits)
 {
 	int k;
@@ -171,10 +199,62 @@ void bitmap_or(unsigned long *dst, const unsigned long *bitmap1,
 	for (k = 0; k < nr; k++)
 		dst[k] = bitmap1[k] | bitmap2[k];
 }
-EXPORT_SYMBOL(bitmap_or);
+EXPORT_SYMBOL(__bitmap_or);
+
+void __bitmap_xor(unsigned long *dst, const unsigned long *bitmap1,
+				const unsigned long *bitmap2, int bits)
+{
+	int k;
+	int nr = BITS_TO_LONGS(bits);
+
+	for (k = 0; k < nr; k++)
+		dst[k] = bitmap1[k] ^ bitmap2[k];
+}
+EXPORT_SYMBOL(__bitmap_xor);
+
+void __bitmap_andnot(unsigned long *dst, const unsigned long *bitmap1,
+				const unsigned long *bitmap2, int bits)
+{
+	int k;
+	int nr = BITS_TO_LONGS(bits);
+
+	for (k = 0; k < nr; k++)
+		dst[k] = bitmap1[k] & ~bitmap2[k];
+}
+EXPORT_SYMBOL(__bitmap_andnot);
+
+int __bitmap_intersects(const unsigned long *bitmap1,
+				const unsigned long *bitmap2, int bits)
+{
+	int k, lim = bits/BITS_PER_LONG;
+	for (k = 0; k < lim; ++k)
+		if (bitmap1[k] & bitmap2[k])
+			return 1;
+
+	if (bits % BITS_PER_LONG)
+		if ((bitmap1[k] & bitmap2[k]) & BITMAP_LAST_WORD_MASK(bits))
+			return 1;
+	return 0;
+}
+EXPORT_SYMBOL(__bitmap_intersects);
+
+int __bitmap_subset(const unsigned long *bitmap1,
+				const unsigned long *bitmap2, int bits)
+{
+	int k, lim = bits/BITS_PER_LONG;
+	for (k = 0; k < lim; ++k)
+		if (bitmap1[k] & ~bitmap2[k])
+			return 0;
+
+	if (bits % BITS_PER_LONG)
+		if ((bitmap1[k] & ~bitmap2[k]) & BITMAP_LAST_WORD_MASK(bits))
+			return 0;
+	return 1;
+}
+EXPORT_SYMBOL(__bitmap_subset);
 
 #if BITS_PER_LONG == 32
-int bitmap_weight(const unsigned long *bitmap, int bits)
+int __bitmap_weight(const unsigned long *bitmap, int bits)
 {
 	int k, w = 0, lim = bits/BITS_PER_LONG;
 
@@ -182,13 +262,12 @@ int bitmap_weight(const unsigned long *bitmap, int bits)
 		w += hweight32(bitmap[k]);
 
 	if (bits % BITS_PER_LONG)
-		w += hweight32(bitmap[k] &
-				((1UL << (bits % BITS_PER_LONG)) - 1));
+		w += hweight32(bitmap[k] & BITMAP_LAST_WORD_MASK(bits));
 
 	return w;
 }
 #else
-int bitmap_weight(const unsigned long *bitmap, int bits)
+int __bitmap_weight(const unsigned long *bitmap, int bits)
 {
 	int k, w = 0, lim = bits/BITS_PER_LONG;
 
@@ -196,13 +275,12 @@ int bitmap_weight(const unsigned long *bitmap, int bits)
 		w += hweight64(bitmap[k]);
 
 	if (bits % BITS_PER_LONG)
-		w += hweight64(bitmap[k] &
-				((1UL << (bits % BITS_PER_LONG)) - 1));
+		w += hweight64(bitmap[k] & BITMAP_LAST_WORD_MASK(bits));
 
 	return w;
 }
 #endif
-EXPORT_SYMBOL(bitmap_weight);
+EXPORT_SYMBOL(__bitmap_weight);
 
 /*
  * Bitmap printing & parsing functions: first version by Bill Irwin,
@@ -319,7 +397,7 @@ int bitmap_parse(const char __user *ubuf, unsigned int ubuflen,
 		if (nchunks == 0 && chunk == 0)
 			continue;
 
-		bitmap_shift_left(maskp, maskp, CHUNKSZ, nmaskbits);
+		__bitmap_shift_left(maskp, maskp, CHUNKSZ, nmaskbits);
 		*maskp |= chunk;
 		nchunks++;
 		nbits += (nchunks == 1) ? nbits_to_hold_value(chunk) : CHUNKSZ;
diff --git a/lib/idr.c b/lib/idr.c
index 8cdc5e821..6d1df639d 100644
--- a/lib/idr.c
+++ b/lib/idr.c
@@ -27,15 +27,6 @@
  * so you don't need to be too concerned about locking and conflicts
  * with the slab allocator.
 
- * A word on reuse.  We reuse empty id slots as soon as we can, always
- * using the lowest one available.  But we also merge a counter in the
- * high bits of the id.  The counter is RESERVED_ID_BITS (8 at this time)
- * long.  This means that if you allocate and release the same id in a 
- * loop we will reuse an id after about 256 times around the loop.  The
- * word about is used here as we will NOT return a valid id of -1 so if
- * you loop on the largest possible id (and that is 24 bits, wow!) we
- * will kick the counter to avoid -1.  (Paranoid?  You bet!)
- *
  * What you need to do is, since we don't keep the counter as part of
  * id / ptr pair, to keep a copy of it in the pointed to structure
  * (or else where) so that when you ask for a ptr you can varify that
@@ -70,14 +61,21 @@
  *   sleep, so must not be called with any spinlocks held.  If the system is
  *   REALLY out of memory this function returns 0, other wise 1.
 
- * int idr_get_new(struct idr *idp, void *ptr);
+ * int idr_get_new(struct idr *idp, void *ptr, int *id);
  
  *   This is the allocate id function.  It should be called with any
  *   required locks.  In fact, in the SMP case, you MUST lock prior to
- *   calling this function to avoid possible out of memory problems.  If
- *   memory is required, it will return a -1, in which case you should
- *   unlock and go back to the idr_pre_get() call.  ptr is the pointer
- *   you want associated with the id.  In other words:
+ *   calling this function to avoid possible out of memory problems.
+ *   If memory is required, it will return -EAGAIN, you should unlock
+ *   and go back to the idr_pre_get() call.  If the idr is full, it
+ *   will return a -ENOSPC.  ptr is the pointer you want associated
+ *   with the id.  The value is returned in the "id" field.  idr_get_new()
+ *   returns a value in the range 0 ... 0x7fffffff
+
+ * int idr_get_new_above(struct idr *idp, void *ptr, int start_id, int *id);
+
+ *   Like idr_get_new(), but the returned id is guaranteed to be at or
+ *   above start_id.
 
  * void *idr_find(struct idr *idp, int id);
  
@@ -92,6 +90,10 @@
  *   removes the given id, freeing that slot and any memory that may
  *   now be unused.  See idr_find() for locking restrictions.
 
+ * int idr_full(struct idr *idp);
+
+ *   Returns true if the idr is full and false if not.
+
  */
 
 
@@ -115,10 +117,10 @@ static struct idr_layer *alloc_layer(struct idr *idp)
 
 	spin_lock(&idp->lock);
 	if (!(p = idp->id_free))
-		BUG();
+		return NULL;
 	idp->id_free = p->ary[0];
 	idp->id_free_cnt--;
-	p->ary[0] = 0;
+	p->ary[0] = NULL;
 	spin_unlock(&idp->lock);
 	return(p);
 }
@@ -181,8 +183,8 @@ static int sub_alloc(struct idr *idp, void *ptr, int *starting_id)
 			sh = IDR_BITS*l;
 			id = ((id >> sh) ^ n ^ m) << sh;
 		}
-		if (id >= MAX_ID_BIT)
-			return -1;
+		if ((id >= MAX_ID_BIT) || (id < 0))
+			return -3;
 		if (l == 0)
 			break;
 		/*
@@ -220,7 +222,7 @@ static int sub_alloc(struct idr *idp, void *ptr, int *starting_id)
 	return(id);
 }
 
-int idr_get_new_above(struct idr *idp, void *ptr, int starting_id)
+static int idr_get_new_above_int(struct idr *idp, void *ptr, int starting_id)
 {
 	struct idr_layer *p, *new;
 	int layers, v, id;
@@ -238,7 +240,7 @@ build_up:
 	 * Add a new layer to the top of the tree if the requested
 	 * id is larger than the currently allocated space.
 	 */
-	while (id >= (1 << (layers*IDR_BITS))) {
+	while ((layers < MAX_LEVEL) && (id >= (1 << (layers*IDR_BITS)))) {
 		layers++;
 		if (!p->count)
 			continue;
@@ -249,7 +251,7 @@ build_up:
 			 */
 			for (new = p; p && p != idp->top; new = p) {
 				p = p->ary[0];
-				new->ary[0] = 0;
+				new->ary[0] = NULL;
 				new->bitmap = new->count = 0;
 				free_layer(idp, new);
 			}
@@ -266,23 +268,47 @@ build_up:
 	v = sub_alloc(idp, ptr, &id);
 	if (v == -2)
 		goto build_up;
-	if ( likely(v >= 0 )) {
-		idp->count++;
-		v += (idp->count << MAX_ID_SHIFT);
-		if ( unlikely( v == -1 ))
-		     v += (1L << MAX_ID_SHIFT);
-	}
 	return(v);
 }
+
+int idr_get_new_above(struct idr *idp, void *ptr, int starting_id, int *id)
+{
+	int rv;
+	rv = idr_get_new_above_int(idp, ptr, starting_id);
+	/*
+	 * This is a cheap hack until the IDR code can be fixed to
+	 * return proper error values.
+	 */
+	if (rv < 0) {
+		if (rv == -1)
+			return -EAGAIN;
+		else /* Will be -3 */
+			return -ENOSPC;
+	}
+	*id = rv;
+	return 0;
+}
 EXPORT_SYMBOL(idr_get_new_above);
 
-int idr_get_new(struct idr *idp, void *ptr)
+int idr_get_new(struct idr *idp, void *ptr, int *id)
 {
-	return idr_get_new_above(idp, ptr, 0);
+	int rv;
+	rv = idr_get_new_above_int(idp, ptr, 0);
+	/*
+	 * This is a cheap hack until the IDR code can be fixed to
+	 * return proper error values.
+	 */
+	if (rv < 0) {
+		if (rv == -1)
+			return -EAGAIN;
+		else /* Will be -3 */
+			return -ENOSPC;
+	}
+	*id = rv;
+	return 0;
 }
 EXPORT_SYMBOL(idr_get_new);
 
-
 static void sub_remove(struct idr *idp, int shift, int id)
 {
 	struct idr_layer *p = idp->top;
@@ -311,10 +337,14 @@ static void sub_remove(struct idr *idp, int shift, int id)
 			idp->layers = 0;
 	}
 }
+
 void idr_remove(struct idr *idp, int id)
 {
 	struct idr_layer *p;
 
+	/* Mask off upper bits we don't use for the search. */
+	id &= MAX_ID_MASK;
+
 	sub_remove(idp, (idp->layers - 1) * IDR_BITS, id);
 	if ( idp->top && idp->top->count == 1 && 
 	     (idp->layers > 1) &&
@@ -350,6 +380,9 @@ void *idr_find(struct idr *idp, int id)
 	if ( unlikely( (id & ~(~0 << MAX_ID_SHIFT)) >> (n + IDR_BITS)))
 	     return NULL;
 #endif
+	/* Mask off upper bits we don't use for the search. */
+	id &= MAX_ID_MASK;
+
 	while (n > 0 && p) {
 		n -= IDR_BITS;
 		p = p->ary[(id >> n) & IDR_MASK];
@@ -368,7 +401,7 @@ static  int init_id_cache(void)
 {
 	if (!idr_layer_cache)
 		idr_layer_cache = kmem_cache_create("idr_layer_cache", 
-			sizeof(struct idr_layer), 0, 0, idr_cache_ctor, 0);
+			sizeof(struct idr_layer), 0, 0, idr_cache_ctor, NULL);
 	return 0;
 }
 
diff --git a/lib/kobject.c b/lib/kobject.c
index 5c2ade573..781f3e896 100644
--- a/lib/kobject.c
+++ b/lib/kobject.c
@@ -37,7 +37,7 @@ static int populate_dir(struct kobject * kobj)
 	int i;
 	
 	if (t && t->default_attrs) {
-		for (i = 0; (attr = t->default_attrs[i]); i++) {
+		for (i = 0; (attr = t->default_attrs[i]) != NULL; i++) {
 			if ((error = sysfs_create_file(kobj,attr)))
 				break;
 		}
@@ -145,7 +145,7 @@ static void kset_hotplug(const char *action, struct kset *kset,
 
 	argv [0] = hotplug_path;
 	argv [1] = name;
-	argv [2] = 0;
+	argv [2] = NULL;
 
 	/* minimal command environment */
 	envp [i++] = "HOME=/";
@@ -537,7 +537,8 @@ void kset_unregister(struct kset * k)
  *	@name:	object's name.
  *
  *	Lock kset via @kset->subsys, and iterate over @kset->list,
- *	looking for a matching kobject. Return object if found.
+ *	looking for a matching kobject. If matching object is found
+ *	take a reference and return the object.
  */
 
 struct kobject * kset_find_obj(struct kset * kset, const char * name)
@@ -548,8 +549,8 @@ struct kobject * kset_find_obj(struct kset * kset, const char * name)
 	down_read(&kset->subsys->rwsem);
 	list_for_each(entry,&kset->list) {
 		struct kobject * k = to_kobj(entry);
-		if (kobject_name(k) && (!strcmp(kobject_name(k),name))) {
-			ret = k;
+		if (kobject_name(k) && !strcmp(kobject_name(k),name)) {
+			ret = kobject_get(k);
 			break;
 		}
 	}
diff --git a/lib/radix-tree.c b/lib/radix-tree.c
index 893822769..a0a090261 100644
--- a/lib/radix-tree.c
+++ b/lib/radix-tree.c
@@ -485,8 +485,8 @@ __lookup(struct radix_tree_root *root, void **results, unsigned long index,
 		for ( ; i < RADIX_TREE_MAP_SIZE; i++) {
 			if (slot->slots[i] != NULL)
 				break;
-			index &= ~((1 << shift) - 1);
-			index += 1 << shift;
+			index &= ~((1UL << shift) - 1);
+			index += 1UL << shift;
 			if (index == 0)
 				goto out;	/* 32-bit wraparound */
 		}
@@ -575,8 +575,8 @@ __lookup_tag(struct radix_tree_root *root, void **results, unsigned long index,
 				BUG_ON(slot->slots[i] == NULL);
 				break;
 			}
-			index &= ~((1 << shift) - 1);
-			index += 1 << shift;
+			index &= ~((1UL << shift) - 1);
+			index += 1UL << shift;
 			if (index == 0)
 				goto out;	/* 32-bit wraparound */
 		}
diff --git a/lib/rbtree.c b/lib/rbtree.c
index 860115d49..621552c34 100644
--- a/lib/rbtree.c
+++ b/lib/rbtree.c
@@ -235,7 +235,7 @@ void rb_erase(struct rb_node *node, struct rb_root *root)
 		struct rb_node *old = node, *left;
 
 		node = node->rb_right;
-		while ((left = node->rb_left))
+		while ((left = node->rb_left) != NULL)
 			node = left;
 		child = node->rb_right;
 		parent = node->rb_parent;
@@ -305,7 +305,7 @@ struct rb_node *rb_first(struct rb_root *root)
 
 	n = root->rb_node;
 	if (!n)
-		return 0;
+		return NULL;
 	while (n->rb_left)
 		n = n->rb_left;
 	return n;
diff --git a/lib/rwsem-spinlock.c b/lib/rwsem-spinlock.c
index a71152d55..96255f47b 100644
--- a/lib/rwsem-spinlock.c
+++ b/lib/rwsem-spinlock.c
@@ -1,5 +1,5 @@
-/* rwsem-spinlock.c: R/W semaphores: contention handling functions for generic spinlock
- *                                   implementation
+/* rwsem-spinlock.c: R/W semaphores: contention handling functions for
+ * generic spinlock implementation
  *
  * Copyright (c) 2001   David Howells (dhowells@redhat.com).
  * - Derived partially from idea by Andrea Arcangeli <andrea@suse.de>
@@ -10,9 +10,9 @@
 #include <linux/module.h>
 
 struct rwsem_waiter {
-	struct list_head	list;
-	struct task_struct	*task;
-	unsigned int		flags;
+	struct list_head list;
+	struct task_struct *task;
+	unsigned int flags;
 #define RWSEM_WAITING_FOR_READ	0x00000001
 #define RWSEM_WAITING_FOR_WRITE	0x00000002
 };
@@ -22,7 +22,8 @@ void rwsemtrace(struct rw_semaphore *sem, const char *str)
 {
 	if (sem->debug)
 		printk("[%d] %s({%d,%d})\n",
-		       current->pid,str,sem->activity,list_empty(&sem->wait_list)?0:1);
+		       current->pid, str, sem->activity,
+		       list_empty(&sem->wait_list) ? 0 : 1);
 }
 #endif
 
@@ -40,7 +41,7 @@ void fastcall init_rwsem(struct rw_semaphore *sem)
 }
 
 /*
- * handle the lock being released whilst there are processes blocked on it that can now run
+ * handle the lock release when processes blocked on it that can now run
  * - if we come here, then:
  *   - the 'active count' _reached_ zero
  *   - the 'waiting count' is non-zero
@@ -48,15 +49,16 @@ void fastcall init_rwsem(struct rw_semaphore *sem)
  * - woken process blocks are discarded from the list after having task zeroed
  * - writers are only woken if wakewrite is non-zero
  */
-static inline struct rw_semaphore *__rwsem_do_wake(struct rw_semaphore *sem, int wakewrite)
+static inline struct rw_semaphore *
+__rwsem_do_wake(struct rw_semaphore *sem, int wakewrite)
 {
 	struct rwsem_waiter *waiter;
 	struct task_struct *tsk;
 	int woken;
 
-	rwsemtrace(sem,"Entering __rwsem_do_wake");
+	rwsemtrace(sem, "Entering __rwsem_do_wake");
 
-	waiter = list_entry(sem->wait_list.next,struct rwsem_waiter,list);
+	waiter = list_entry(sem->wait_list.next, struct rwsem_waiter, list);
 
 	if (!wakewrite) {
 		if (waiter->flags & RWSEM_WAITING_FOR_WRITE)
@@ -64,14 +66,16 @@ static inline struct rw_semaphore *__rwsem_do_wake(struct rw_semaphore *sem, int
 		goto dont_wake_writers;
 	}
 
-	/* if we are allowed to wake writers try to grant a single write lock if there's a
-	 * writer at the front of the queue
-	 * - we leave the 'waiting count' incremented to signify potential contention
+	/* if we are allowed to wake writers try to grant a single write lock
+	 * if there's a writer at the front of the queue
+	 * - we leave the 'waiting count' incremented to signify potential
+	 *   contention
 	 */
 	if (waiter->flags & RWSEM_WAITING_FOR_WRITE) {
 		sem->activity = -1;
 		list_del(&waiter->list);
 		tsk = waiter->task;
+		/* Don't touch waiter after ->task has been NULLed */
 		mb();
 		waiter->task = NULL;
 		wake_up_process(tsk);
@@ -79,10 +83,10 @@ static inline struct rw_semaphore *__rwsem_do_wake(struct rw_semaphore *sem, int
 		goto out;
 	}
 
-	/* grant an infinite number of read locks to the readers at the front of the queue */
+	/* grant an infinite number of read locks to the front of the queue */
  dont_wake_writers:
 	woken = 0;
-	while (waiter->flags&RWSEM_WAITING_FOR_READ) {
+	while (waiter->flags & RWSEM_WAITING_FOR_READ) {
 		struct list_head *next = waiter->list.next;
 
 		list_del(&waiter->list);
@@ -94,27 +98,28 @@ static inline struct rw_semaphore *__rwsem_do_wake(struct rw_semaphore *sem, int
 		woken++;
 		if (list_empty(&sem->wait_list))
 			break;
-		waiter = list_entry(next,struct rwsem_waiter,list);
+		waiter = list_entry(next, struct rwsem_waiter, list);
 	}
 
 	sem->activity += woken;
 
  out:
-	rwsemtrace(sem,"Leaving __rwsem_do_wake");
+	rwsemtrace(sem, "Leaving __rwsem_do_wake");
 	return sem;
 }
 
 /*
  * wake a single writer
  */
-static inline struct rw_semaphore *__rwsem_wake_one_writer(struct rw_semaphore *sem)
+static inline struct rw_semaphore *
+__rwsem_wake_one_writer(struct rw_semaphore *sem)
 {
 	struct rwsem_waiter *waiter;
 	struct task_struct *tsk;
 
 	sem->activity = -1;
 
-	waiter = list_entry(sem->wait_list.next,struct rwsem_waiter,list);
+	waiter = list_entry(sem->wait_list.next, struct rwsem_waiter, list);
 	list_del(&waiter->list);
 
 	tsk = waiter->task;
@@ -128,16 +133,16 @@ static inline struct rw_semaphore *__rwsem_wake_one_writer(struct rw_semaphore *
 /*
  * get a read lock on the semaphore
  */
-void fastcall __down_read(struct rw_semaphore *sem)
+void fastcall __sched __down_read(struct rw_semaphore *sem)
 {
 	struct rwsem_waiter waiter;
 	struct task_struct *tsk;
 
-	rwsemtrace(sem,"Entering __down_read");
+	rwsemtrace(sem, "Entering __down_read");
 
 	spin_lock(&sem->wait_lock);
 
-	if (sem->activity>=0 && list_empty(&sem->wait_list)) {
+	if (sem->activity >= 0 && list_empty(&sem->wait_list)) {
 		/* granted */
 		sem->activity++;
 		spin_unlock(&sem->wait_lock);
@@ -145,14 +150,14 @@ void fastcall __down_read(struct rw_semaphore *sem)
 	}
 
 	tsk = current;
-	set_task_state(tsk,TASK_UNINTERRUPTIBLE);
+	set_task_state(tsk, TASK_UNINTERRUPTIBLE);
 
 	/* set up my own style of waitqueue */
 	waiter.task = tsk;
 	waiter.flags = RWSEM_WAITING_FOR_READ;
 	get_task_struct(tsk);
 
-	list_add_tail(&waiter.list,&sem->wait_list);
+	list_add_tail(&waiter.list, &sem->wait_list);
 
 	/* we don't need to touch the semaphore struct anymore */
 	spin_unlock(&sem->wait_lock);
@@ -168,7 +173,7 @@ void fastcall __down_read(struct rw_semaphore *sem)
 	tsk->state = TASK_RUNNING;
 
  out:
-	rwsemtrace(sem,"Leaving __down_read");
+	rwsemtrace(sem, "Leaving __down_read");
 }
 
 /*
@@ -177,11 +182,11 @@ void fastcall __down_read(struct rw_semaphore *sem)
 int fastcall __down_read_trylock(struct rw_semaphore *sem)
 {
 	int ret = 0;
-	rwsemtrace(sem,"Entering __down_read_trylock");
+	rwsemtrace(sem, "Entering __down_read_trylock");
 
 	spin_lock(&sem->wait_lock);
 
-	if (sem->activity>=0 && list_empty(&sem->wait_list)) {
+	if (sem->activity >= 0 && list_empty(&sem->wait_list)) {
 		/* granted */
 		sem->activity++;
 		ret = 1;
@@ -189,24 +194,24 @@ int fastcall __down_read_trylock(struct rw_semaphore *sem)
 
 	spin_unlock(&sem->wait_lock);
 
-	rwsemtrace(sem,"Leaving __down_read_trylock");
+	rwsemtrace(sem, "Leaving __down_read_trylock");
 	return ret;
 }
 
 /*
  * get a write lock on the semaphore
- * - note that we increment the waiting count anyway to indicate an exclusive lock
+ * - we increment the waiting count anyway to indicate an exclusive lock
  */
-void fastcall __down_write(struct rw_semaphore *sem)
+void fastcall __sched __down_write(struct rw_semaphore *sem)
 {
 	struct rwsem_waiter waiter;
 	struct task_struct *tsk;
 
-	rwsemtrace(sem,"Entering __down_write");
+	rwsemtrace(sem, "Entering __down_write");
 
 	spin_lock(&sem->wait_lock);
 
-	if (sem->activity==0 && list_empty(&sem->wait_list)) {
+	if (sem->activity == 0 && list_empty(&sem->wait_list)) {
 		/* granted */
 		sem->activity = -1;
 		spin_unlock(&sem->wait_lock);
@@ -214,14 +219,14 @@ void fastcall __down_write(struct rw_semaphore *sem)
 	}
 
 	tsk = current;
-	set_task_state(tsk,TASK_UNINTERRUPTIBLE);
+	set_task_state(tsk, TASK_UNINTERRUPTIBLE);
 
 	/* set up my own style of waitqueue */
 	waiter.task = tsk;
 	waiter.flags = RWSEM_WAITING_FOR_WRITE;
 	get_task_struct(tsk);
 
-	list_add_tail(&waiter.list,&sem->wait_list);
+	list_add_tail(&waiter.list, &sem->wait_list);
 
 	/* we don't need to touch the semaphore struct anymore */
 	spin_unlock(&sem->wait_lock);
@@ -237,7 +242,7 @@ void fastcall __down_write(struct rw_semaphore *sem)
 	tsk->state = TASK_RUNNING;
 
  out:
-	rwsemtrace(sem,"Leaving __down_write");
+	rwsemtrace(sem, "Leaving __down_write");
 }
 
 /*
@@ -246,11 +251,11 @@ void fastcall __down_write(struct rw_semaphore *sem)
 int fastcall __down_write_trylock(struct rw_semaphore *sem)
 {
 	int ret = 0;
-	rwsemtrace(sem,"Entering __down_write_trylock");
+	rwsemtrace(sem, "Entering __down_write_trylock");
 
 	spin_lock(&sem->wait_lock);
 
-	if (sem->activity==0 && list_empty(&sem->wait_list)) {
+	if (sem->activity == 0 && list_empty(&sem->wait_list)) {
 		/* granted */
 		sem->activity = -1;
 		ret = 1;
@@ -258,7 +263,7 @@ int fastcall __down_write_trylock(struct rw_semaphore *sem)
 
 	spin_unlock(&sem->wait_lock);
 
-	rwsemtrace(sem,"Leaving __down_write_trylock");
+	rwsemtrace(sem, "Leaving __down_write_trylock");
 	return ret;
 }
 
@@ -267,16 +272,16 @@ int fastcall __down_write_trylock(struct rw_semaphore *sem)
  */
 void fastcall __up_read(struct rw_semaphore *sem)
 {
-	rwsemtrace(sem,"Entering __up_read");
+	rwsemtrace(sem, "Entering __up_read");
 
 	spin_lock(&sem->wait_lock);
 
-	if (--sem->activity==0 && !list_empty(&sem->wait_list))
+	if (--sem->activity == 0 && !list_empty(&sem->wait_list))
 		sem = __rwsem_wake_one_writer(sem);
 
 	spin_unlock(&sem->wait_lock);
 
-	rwsemtrace(sem,"Leaving __up_read");
+	rwsemtrace(sem, "Leaving __up_read");
 }
 
 /*
@@ -284,7 +289,7 @@ void fastcall __up_read(struct rw_semaphore *sem)
  */
 void fastcall __up_write(struct rw_semaphore *sem)
 {
-	rwsemtrace(sem,"Entering __up_write");
+	rwsemtrace(sem, "Entering __up_write");
 
 	spin_lock(&sem->wait_lock);
 
@@ -294,7 +299,7 @@ void fastcall __up_write(struct rw_semaphore *sem)
 
 	spin_unlock(&sem->wait_lock);
 
-	rwsemtrace(sem,"Leaving __up_write");
+	rwsemtrace(sem, "Leaving __up_write");
 }
 
 /*
@@ -303,17 +308,17 @@ void fastcall __up_write(struct rw_semaphore *sem)
  */
 void fastcall __downgrade_write(struct rw_semaphore *sem)
 {
-	rwsemtrace(sem,"Entering __downgrade_write");
+	rwsemtrace(sem, "Entering __downgrade_write");
 
 	spin_lock(&sem->wait_lock);
 
 	sem->activity = 1;
 	if (!list_empty(&sem->wait_list))
-		sem = __rwsem_do_wake(sem,0);
+		sem = __rwsem_do_wake(sem, 0);
 
 	spin_unlock(&sem->wait_lock);
 
-	rwsemtrace(sem,"Leaving __downgrade_write");
+	rwsemtrace(sem, "Leaving __downgrade_write");
 }
 
 EXPORT_SYMBOL(init_rwsem);
diff --git a/lib/rwsem.c b/lib/rwsem.c
index 27dcd95f7..465ec7256 100644
--- a/lib/rwsem.c
+++ b/lib/rwsem.c
@@ -9,9 +9,9 @@
 #include <linux/module.h>
 
 struct rwsem_waiter {
-	struct list_head	list;
-	struct task_struct	*task;
-	unsigned int		flags;
+	struct list_head list;
+	struct task_struct *task;
+	unsigned int flags;
 #define RWSEM_WAITING_FOR_READ	0x00000001
 #define RWSEM_WAITING_FOR_WRITE	0x00000002
 };
@@ -20,31 +20,32 @@ struct rwsem_waiter {
 #undef rwsemtrace
 void rwsemtrace(struct rw_semaphore *sem, const char *str)
 {
-	printk("sem=%p\n",sem);
-	printk("(sem)=%08lx\n",sem->count);
+	printk("sem=%p\n", sem);
+	printk("(sem)=%08lx\n", sem->count);
 	if (sem->debug)
-		printk("[%d] %s({%08lx})\n",current->pid,str,sem->count);
+		printk("[%d] %s({%08lx})\n", current->pid, str, sem->count);
 }
 #endif
 
 /*
- * handle the lock being released whilst there are processes blocked on it that can now run
+ * handle the lock release when processes blocked on it that can now run
  * - if we come here from up_xxxx(), then:
- *   - the 'active part' of the count (&0x0000ffff) had reached zero (but may have changed)
- *   - the 'waiting part' of the count (&0xffff0000) is negative (and will still be so)
+ *   - the 'active part' of count (&0x0000ffff) reached 0 (but may have changed)
+ *   - the 'waiting part' of count (&0xffff0000) is -ve (and will still be so)
  *   - there must be someone on the queue
  * - the spinlock must be held by the caller
  * - woken process blocks are discarded from the list after having task zeroed
  * - writers are only woken if downgrading is false
  */
-static inline struct rw_semaphore *__rwsem_do_wake(struct rw_semaphore *sem, int downgrading)
+static inline struct rw_semaphore *
+__rwsem_do_wake(struct rw_semaphore *sem, int downgrading)
 {
 	struct rwsem_waiter *waiter;
 	struct task_struct *tsk;
 	struct list_head *next;
 	signed long oldcount, woken, loop;
 
-	rwsemtrace(sem,"Entering __rwsem_do_wake");
+	rwsemtrace(sem, "Entering __rwsem_do_wake");
 
 	if (downgrading)
 		goto dont_wake_writers;
@@ -53,19 +54,24 @@ static inline struct rw_semaphore *__rwsem_do_wake(struct rw_semaphore *sem, int
 	 * if we can transition the active part of the count from 0 -> 1
 	 */
  try_again:
-	oldcount = rwsem_atomic_update(RWSEM_ACTIVE_BIAS,sem) - RWSEM_ACTIVE_BIAS;
+	oldcount = rwsem_atomic_update(RWSEM_ACTIVE_BIAS, sem)
+						- RWSEM_ACTIVE_BIAS;
 	if (oldcount & RWSEM_ACTIVE_MASK)
 		goto undo;
 
-	waiter = list_entry(sem->wait_list.next,struct rwsem_waiter,list);
+	waiter = list_entry(sem->wait_list.next, struct rwsem_waiter, list);
 
-	/* try to grant a single write lock if there's a writer at the front of the queue
-	 * - note we leave the 'active part' of the count incremented by 1 and the waiting part
-	 *   incremented by 0x00010000
+	/* try to grant a single write lock if there's a writer at the front
+	 * of the queue - note we leave the 'active part' of the count
+	 * incremented by 1 and the waiting part incremented by 0x00010000
 	 */
 	if (!(waiter->flags & RWSEM_WAITING_FOR_WRITE))
 		goto readers_only;
 
+	/* We must be careful not to touch 'waiter' after we set ->task = NULL.
+	 * It is an allocated on the waiter's stack and may become invalid at
+	 * any time after that point (due to a wakeup from another source).
+	 */
 	list_del(&waiter->list);
 	tsk = waiter->task;
 	mb();
@@ -76,7 +82,7 @@ static inline struct rw_semaphore *__rwsem_do_wake(struct rw_semaphore *sem, int
 
 	/* don't want to wake any writers */
  dont_wake_writers:
-	waiter = list_entry(sem->wait_list.next,struct rwsem_waiter,list);
+	waiter = list_entry(sem->wait_list.next, struct rwsem_waiter, list);
 	if (waiter->flags & RWSEM_WAITING_FOR_WRITE)
 		goto out;
 
@@ -90,23 +96,25 @@ static inline struct rw_semaphore *__rwsem_do_wake(struct rw_semaphore *sem, int
 	do {
 		woken++;
 
-		if (waiter->list.next==&sem->wait_list)
+		if (waiter->list.next == &sem->wait_list)
 			break;
 
-		waiter = list_entry(waiter->list.next,struct rwsem_waiter,list);
+		waiter = list_entry(waiter->list.next,
+					struct rwsem_waiter, list);
 
 	} while (waiter->flags & RWSEM_WAITING_FOR_READ);
 
 	loop = woken;
 	woken *= RWSEM_ACTIVE_BIAS - RWSEM_WAITING_BIAS;
 	if (!downgrading)
-		woken -= RWSEM_ACTIVE_BIAS; /* we'd already done one increment
-					     * earlier */
-	rwsem_atomic_add(woken,sem);
+		/* we'd already done one increment earlier */
+		woken -= RWSEM_ACTIVE_BIAS;
+
+	rwsem_atomic_add(woken, sem);
 
 	next = sem->wait_list.next;
-	for (; loop>0; loop--) {
-		waiter = list_entry(next,struct rwsem_waiter,list);
+	for (; loop > 0; loop--) {
+		waiter = list_entry(next, struct rwsem_waiter, list);
 		next = waiter->list.next;
 		tsk = waiter->task;
 		mb();
@@ -119,12 +127,12 @@ static inline struct rw_semaphore *__rwsem_do_wake(struct rw_semaphore *sem, int
 	next->prev = &sem->wait_list;
 
  out:
-	rwsemtrace(sem,"Leaving __rwsem_do_wake");
+	rwsemtrace(sem, "Leaving __rwsem_do_wake");
 	return sem;
 
 	/* undo the change to count, but check for a transition 1->0 */
  undo:
-	if (rwsem_atomic_update(-RWSEM_ACTIVE_BIAS,sem)!=0)
+	if (rwsem_atomic_update(-RWSEM_ACTIVE_BIAS, sem) != 0)
 		goto out;
 	goto try_again;
 }
@@ -132,28 +140,26 @@ static inline struct rw_semaphore *__rwsem_do_wake(struct rw_semaphore *sem, int
 /*
  * wait for a lock to be granted
  */
-static inline struct rw_semaphore *rwsem_down_failed_common(struct rw_semaphore *sem,
-								 struct rwsem_waiter *waiter,
-								 signed long adjustment)
+static inline struct rw_semaphore *
+rwsem_down_failed_common(struct rw_semaphore *sem,
+			struct rwsem_waiter *waiter, signed long adjustment)
 {
 	struct task_struct *tsk = current;
 	signed long count;
 
-	set_task_state(tsk,TASK_UNINTERRUPTIBLE);
+	set_task_state(tsk, TASK_UNINTERRUPTIBLE);
 
 	/* set up my own style of waitqueue */
 	spin_lock(&sem->wait_lock);
 	waiter->task = tsk;
 	get_task_struct(tsk);
 
-	list_add_tail(&waiter->list,&sem->wait_list);
+	list_add_tail(&waiter->list, &sem->wait_list);
 
-	/* note that we're now waiting on the lock, but no longer actively read-locking */
-	count = rwsem_atomic_update(adjustment,sem);
+	/* we're now waiting on the lock, but no longer actively read-locking */
+	count = rwsem_atomic_update(adjustment, sem);
 
-	/* if there are no longer active locks, wake the front queued process(es) up
-	 * - it might even be this process, since the waker takes a more active part
-	 */
+	/* if there are no active locks, wake the front queued process(es) up */
 	if (!(count & RWSEM_ACTIVE_MASK))
 		sem = __rwsem_do_wake(sem, 0);
 
@@ -175,42 +181,45 @@ static inline struct rw_semaphore *rwsem_down_failed_common(struct rw_semaphore
 /*
  * wait for the read lock to be granted
  */
-struct rw_semaphore fastcall __sched *rwsem_down_read_failed(struct rw_semaphore *sem)
+struct rw_semaphore fastcall __sched *
+rwsem_down_read_failed(struct rw_semaphore *sem)
 {
 	struct rwsem_waiter waiter;
 
-	rwsemtrace(sem,"Entering rwsem_down_read_failed");
+	rwsemtrace(sem, "Entering rwsem_down_read_failed");
 
 	waiter.flags = RWSEM_WAITING_FOR_READ;
-	rwsem_down_failed_common(sem,&waiter,RWSEM_WAITING_BIAS-RWSEM_ACTIVE_BIAS);
+	rwsem_down_failed_common(sem, &waiter,
+				RWSEM_WAITING_BIAS - RWSEM_ACTIVE_BIAS);
 
-	rwsemtrace(sem,"Leaving rwsem_down_read_failed");
+	rwsemtrace(sem, "Leaving rwsem_down_read_failed");
 	return sem;
 }
 
 /*
  * wait for the write lock to be granted
  */
-struct rw_semaphore fastcall __sched *rwsem_down_write_failed(struct rw_semaphore *sem)
+struct rw_semaphore fastcall __sched *
+rwsem_down_write_failed(struct rw_semaphore *sem)
 {
 	struct rwsem_waiter waiter;
 
-	rwsemtrace(sem,"Entering rwsem_down_write_failed");
+	rwsemtrace(sem, "Entering rwsem_down_write_failed");
 
 	waiter.flags = RWSEM_WAITING_FOR_WRITE;
-	rwsem_down_failed_common(sem,&waiter,-RWSEM_ACTIVE_BIAS);
+	rwsem_down_failed_common(sem, &waiter, -RWSEM_ACTIVE_BIAS);
 
-	rwsemtrace(sem,"Leaving rwsem_down_write_failed");
+	rwsemtrace(sem, "Leaving rwsem_down_write_failed");
 	return sem;
 }
 
 /*
  * handle waking up a waiter on the semaphore
- * - up_read/up_write has decremented the active part of the count if we come here
+ * - up_read/up_write has decremented the active part of count if we come here
  */
 struct rw_semaphore fastcall *rwsem_wake(struct rw_semaphore *sem)
 {
-	rwsemtrace(sem,"Entering rwsem_wake");
+	rwsemtrace(sem, "Entering rwsem_wake");
 
 	spin_lock(&sem->wait_lock);
 
@@ -220,19 +229,19 @@ struct rw_semaphore fastcall *rwsem_wake(struct rw_semaphore *sem)
 
 	spin_unlock(&sem->wait_lock);
 
-	rwsemtrace(sem,"Leaving rwsem_wake");
+	rwsemtrace(sem, "Leaving rwsem_wake");
 
 	return sem;
 }
 
 /*
  * downgrade a write lock into a read lock
- * - caller incremented waiting part of count, and discovered it to be still negative
+ * - caller incremented waiting part of count and discovered it still negative
  * - just wake up any readers at the front of the queue
  */
 struct rw_semaphore fastcall *rwsem_downgrade_wake(struct rw_semaphore *sem)
 {
-	rwsemtrace(sem,"Entering rwsem_downgrade_wake");
+	rwsemtrace(sem, "Entering rwsem_downgrade_wake");
 
 	spin_lock(&sem->wait_lock);
 
@@ -242,7 +251,7 @@ struct rw_semaphore fastcall *rwsem_downgrade_wake(struct rw_semaphore *sem)
 
 	spin_unlock(&sem->wait_lock);
 
-	rwsemtrace(sem,"Leaving rwsem_downgrade_wake");
+	rwsemtrace(sem, "Leaving rwsem_downgrade_wake");
 	return sem;
 }
 
diff --git a/lib/string.c b/lib/string.c
index 603c7174f..c1b1b5874 100644
--- a/lib/string.c
+++ b/lib/string.c
@@ -75,6 +75,7 @@ char * strcpy(char * dest,const char *src)
 		/* nothing */;
 	return tmp;
 }
+EXPORT_SYMBOL(strcpy);
 #endif
 
 #ifndef __HAVE_ARCH_STRNCPY
@@ -98,6 +99,7 @@ char * strncpy(char * dest,const char *src,size_t count)
 	}
 	return dest;
 }
+EXPORT_SYMBOL(strncpy);
 #endif
 
 #ifndef __HAVE_ARCH_STRLCPY
@@ -143,6 +145,7 @@ char * strcat(char * dest, const char * src)
 
 	return tmp;
 }
+EXPORT_SYMBOL(strcat);
 #endif
 
 #ifndef __HAVE_ARCH_STRNCAT
@@ -162,7 +165,7 @@ char * strncat(char *dest, const char *src, size_t count)
 	if (count) {
 		while (*dest)
 			dest++;
-		while ((*dest++ = *src++)) {
+		while ((*dest++ = *src++) != 0) {
 			if (--count == 0) {
 				*dest = '\0';
 				break;
@@ -172,6 +175,7 @@ char * strncat(char *dest, const char *src, size_t count)
 
 	return tmp;
 }
+EXPORT_SYMBOL(strncat);
 #endif
 
 #ifndef __HAVE_ARCH_STRLCAT
@@ -218,6 +222,7 @@ int strcmp(const char * cs,const char * ct)
 
 	return __res;
 }
+EXPORT_SYMBOL(strcmp);
 #endif
 
 #ifndef __HAVE_ARCH_STRNCMP
@@ -239,6 +244,7 @@ int strncmp(const char * cs,const char * ct,size_t count)
 
 	return __res;
 }
+EXPORT_SYMBOL(strncmp);
 #endif
 
 #ifndef __HAVE_ARCH_STRCHR
@@ -254,6 +260,7 @@ char * strchr(const char * s, int c)
 			return NULL;
 	return (char *) s;
 }
+EXPORT_SYMBOL(strchr);
 #endif
 
 #ifndef __HAVE_ARCH_STRRCHR
@@ -271,6 +278,7 @@ char * strrchr(const char * s, int c)
        } while (--p >= s);
        return NULL;
 }
+EXPORT_SYMBOL(strrchr);
 #endif
 
 #ifndef __HAVE_ARCH_STRNCHR
@@ -287,6 +295,7 @@ char *strnchr(const char *s, size_t count, int c)
 			return (char *) s;
 	return NULL;
 }
+EXPORT_SYMBOL(strnchr);
 #endif
 
 #ifndef __HAVE_ARCH_STRLEN
@@ -302,6 +311,7 @@ size_t strlen(const char * s)
 		/* nothing */;
 	return sc - s;
 }
+EXPORT_SYMBOL(strlen);
 #endif
 
 #ifndef __HAVE_ARCH_STRNLEN
@@ -318,6 +328,7 @@ size_t strnlen(const char * s, size_t count)
 		/* nothing */;
 	return sc - s;
 }
+EXPORT_SYMBOL(strnlen);
 #endif
 
 #ifndef __HAVE_ARCH_STRSPN
@@ -371,6 +382,7 @@ size_t strcspn(const char *s, const char *reject)
 
 	return count;
 }	
+EXPORT_SYMBOL(strcspn);
 
 #ifndef __HAVE_ARCH_STRPBRK
 /**
@@ -390,6 +402,7 @@ char * strpbrk(const char * cs,const char * ct)
 	}
 	return NULL;
 }
+EXPORT_SYMBOL(strpbrk);
 #endif
 
 #ifndef __HAVE_ARCH_STRSEP
@@ -440,6 +453,7 @@ void * memset(void * s,int c,size_t count)
 
 	return s;
 }
+EXPORT_SYMBOL(memset);
 #endif
 
 #ifndef __HAVE_ARCH_BCOPY
@@ -463,6 +477,7 @@ void bcopy(const void * srcp, void * destp, size_t count)
 	while (count--)
 		*dest++ = *src++;
 }
+EXPORT_SYMBOL(bcopy);
 #endif
 
 #ifndef __HAVE_ARCH_MEMCPY
@@ -484,6 +499,7 @@ void * memcpy(void * dest,const void *src,size_t count)
 
 	return dest;
 }
+EXPORT_SYMBOL(memcpy);
 #endif
 
 #ifndef __HAVE_ARCH_MEMMOVE
@@ -514,6 +530,7 @@ void * memmove(void * dest,const void *src,size_t count)
 
 	return dest;
 }
+EXPORT_SYMBOL(memmove);
 #endif
 
 #ifndef __HAVE_ARCH_MEMCMP
@@ -533,6 +550,7 @@ int memcmp(const void * cs,const void * ct,size_t count)
 			break;
 	return res;
 }
+EXPORT_SYMBOL(memcmp);
 #endif
 
 #ifndef __HAVE_ARCH_MEMSCAN
@@ -557,6 +575,7 @@ void * memscan(void * addr, int c, size_t size)
 	}
   	return (void *) p;
 }
+EXPORT_SYMBOL(memscan);
 #endif
 
 #ifndef __HAVE_ARCH_STRSTR
@@ -581,6 +600,7 @@ char * strstr(const char * s1,const char * s2)
 	}
 	return NULL;
 }
+EXPORT_SYMBOL(strstr);
 #endif
 
 #ifndef __HAVE_ARCH_MEMCHR
@@ -603,5 +623,5 @@ void *memchr(const void *s, int c, size_t n)
 	}
 	return NULL;
 }
-
+EXPORT_SYMBOL(memchr);
 #endif
diff --git a/lib/vsprintf.c b/lib/vsprintf.c
index b6d283372..0b0935915 100644
--- a/lib/vsprintf.c
+++ b/lib/vsprintf.c
@@ -40,11 +40,14 @@ unsigned long simple_strtoul(const char *cp,char **endp,unsigned int base)
 		if (*cp == '0') {
 			base = 8;
 			cp++;
-			if ((*cp == 'x') && isxdigit(cp[1])) {
+			if ((toupper(*cp) == 'X') && isxdigit(cp[1])) {
 				cp++;
 				base = 16;
 			}
 		}
+	} else if (base == 16) {
+		if (cp[0] == '0' && toupper(cp[1]) == 'X')
+			cp += 2;
 	}
 	while (isxdigit(*cp) &&
 	       (value = isdigit(*cp) ? *cp-'0' : toupper(*cp)-'A'+10) < base) {
@@ -88,11 +91,14 @@ unsigned long long simple_strtoull(const char *cp,char **endp,unsigned int base)
 		if (*cp == '0') {
 			base = 8;
 			cp++;
-			if ((*cp == 'x') && isxdigit(cp[1])) {
+			if ((toupper(*cp) == 'X') && isxdigit(cp[1])) {
 				cp++;
 				base = 16;
 			}
 		}
+	} else if (base == 16) {
+		if (cp[0] == '0' && toupper(cp[1]) == 'X')
+			cp += 2;
 	}
 	while (isxdigit(*cp) && (value = isdigit(*cp) ? *cp-'0' : (islower(*cp)
 	    ? toupper(*cp) : *cp)-'A'+10) < base) {
@@ -148,7 +154,7 @@ static char * number(char * buf, char * end, unsigned long long num, int base, i
 	if (type & LEFT)
 		type &= ~ZEROPAD;
 	if (base < 2 || base > 36)
-		return 0;
+		return NULL;
 	c = (type & ZEROPAD) ? '0' : ' ';
 	sign = 0;
 	if (type & SIGN) {
@@ -662,8 +668,16 @@ int vsscanf(const char * buf, const char * fmt, va_list args)
 		qualifier = -1;
 		if (*fmt == 'h' || *fmt == 'l' || *fmt == 'L' ||
 		    *fmt == 'Z' || *fmt == 'z') {
-			qualifier = *fmt;
-			fmt++;
+			qualifier = *fmt++;
+			if (unlikely(qualifier == *fmt)) {
+				if (qualifier == 'h') {
+					qualifier = 'H';
+					fmt++;
+				} else if (qualifier == 'l') {
+					qualifier = 'L';
+					fmt++;
+				}
+			}
 		}
 		base = 10;
 		is_sign = 0;
@@ -748,6 +762,15 @@ int vsscanf(const char * buf, const char * fmt, va_list args)
 				break;
 
 		switch(qualifier) {
+		case 'H':	/* that's 'hh' in format */
+			if (is_sign) {
+				signed char *s = (signed char *) va_arg(args,signed char *);
+				*s = (signed char) simple_strtol(str,&next,base);
+			} else {
+				unsigned char *s = (unsigned char *) va_arg(args, unsigned char *);
+				*s = (unsigned char) simple_strtoul(str, &next, base);
+			}
+			break;
 		case 'h':
 			if (is_sign) {
 				short *s = (short *) va_arg(args,short *);
diff --git a/lib/zlib_deflate/deflate.c b/lib/zlib_deflate/deflate.c
index d5b3e0a3f..ad9a1bf4f 100644
--- a/lib/zlib_deflate/deflate.c
+++ b/lib/zlib_deflate/deflate.c
@@ -1262,7 +1262,7 @@ static block_state deflate_slow(
     return flush == Z_FINISH ? finish_done : block_done;
 }
 
-extern int zlib_deflate_workspacesize(void)
+int zlib_deflate_workspacesize(void)
 {
     return sizeof(deflate_workspace);
 }
diff --git a/lib/zlib_inflate/inftrees.c b/lib/zlib_inflate/inftrees.c
index edae599f6..b0b58b67e 100644
--- a/lib/zlib_inflate/inftrees.c
+++ b/lib/zlib_inflate/inftrees.c
@@ -7,7 +7,7 @@
 #include "inftrees.h"
 #include "infutil.h"
 
-static const char inflate_copyright[] =
+static const char inflate_copyright[] __attribute_used__ =
    " inflate 1.1.3 Copyright 1995-1998 Mark Adler ";
 /*
   If you use the zlib library in a product, an acknowledgment is welcome
diff --git a/mm/bootmem.c b/mm/bootmem.c
index 052dfeac0..966135b90 100644
--- a/mm/bootmem.c
+++ b/mm/bootmem.c
@@ -16,6 +16,7 @@
 #include <linux/init.h>
 #include <linux/bootmem.h>
 #include <linux/mmzone.h>
+#include <linux/module.h>
 #include <asm/dma.h>
 #include <asm/io.h>
 
@@ -27,6 +28,10 @@ unsigned long max_low_pfn;
 unsigned long min_low_pfn;
 unsigned long max_pfn;
 
+EXPORT_SYMBOL(max_pfn);		/* This is exported so
+				 * dma_get_required_mask(), which uses
+				 * it, can be an inline function */
+
 /* return the number of _pages_ that will be allocated for the boot bitmap */
 unsigned long __init bootmem_bootmap_pages (unsigned long pages)
 {
@@ -371,11 +376,6 @@ void * __init __alloc_bootmem_node (pg_data_t *pgdat, unsigned long size, unsign
 	if (ptr)
 		return (ptr);
 
-	/*
-	 * Whoops, we cannot satisfy the allocation request.
-	 */
-	printk(KERN_ALERT "bootmem alloc of %lu bytes failed!\n", size);
-	panic("Out of memory");
-	return NULL;
+	return __alloc_bootmem(size, align, goal);
 }
 
diff --git a/mm/filemap.c b/mm/filemap.c
index 6e59faaa6..ab85dcb49 100644
--- a/mm/filemap.c
+++ b/mm/filemap.c
@@ -60,6 +60,7 @@
  *      ->swap_list_lock
  *        ->swap_device_lock	(exclusive_swap_page, others)
  *          ->mapping->tree_lock
+ *    ->page_map_lock()		(try_to_unmap_file)
  *
  *  ->i_sem
  *    ->i_mmap_lock		(truncate->unmap_mapping_range)
@@ -87,6 +88,13 @@
  *    ->private_lock		(try_to_unmap_one)
  *    ->tree_lock		(try_to_unmap_one)
  *    ->zone.lru_lock		(follow_page->mark_page_accessed)
+ *    ->page_map_lock()		(page_add_anon_rmap)
+ *      ->tree_lock		(page_remove_rmap->set_page_dirty)
+ *      ->private_lock		(page_remove_rmap->set_page_dirty)
+ *      ->inode_lock		(page_remove_rmap->set_page_dirty)
+ *    ->anon_vma.lock		(anon_vma_prepare)
+ *    ->inode_lock		(zap_pte_range->set_page_dirty)
+ *    ->private_lock		(zap_pte_range->__set_page_dirty_buffers)
  *
  *  ->task->proc_lock
  *    ->dcache_lock		(proc_pid_lookup)
@@ -192,7 +200,7 @@ static int wait_on_page_writeback_range(struct address_space *mapping,
 	index = start;
 	while ((nr_pages = pagevec_lookup_tag(&pvec, mapping, &index,
 			PAGECACHE_TAG_WRITEBACK,
-			min(end - index, (pgoff_t)PAGEVEC_SIZE-1) + 1))) {
+			min(end - index, (pgoff_t)PAGEVEC_SIZE-1) + 1)) != 0) {
 		unsigned i;
 
 		for (i = 0; i < nr_pages; i++) {
@@ -432,10 +440,6 @@ struct page * find_get_page(struct address_space *mapping, unsigned long offset)
 {
 	struct page *page;
 
-	/*
-	 * We scan the hash list read-only. Addition to and removal from
-	 * the hash-list needs a held write-lock.
-	 */
 	spin_lock_irq(&mapping->tree_lock);
 	page = radix_tree_lookup(&mapping->page_tree, offset);
 	if (page)
@@ -650,7 +654,8 @@ void do_generic_mapping_read(struct address_space *mapping,
 			     read_actor_t actor)
 {
 	struct inode *inode = mapping->host;
-	unsigned long index, offset;
+	unsigned long index, end_index, offset;
+	loff_t isize;
 	struct page *cached_page;
 	int error;
 	struct file_ra_state ra = *_ra;
@@ -659,26 +664,18 @@ void do_generic_mapping_read(struct address_space *mapping,
 	index = *ppos >> PAGE_CACHE_SHIFT;
 	offset = *ppos & ~PAGE_CACHE_MASK;
 
+	isize = i_size_read(inode);
+	end_index = isize >> PAGE_CACHE_SHIFT;
+	if (index > end_index)
+		goto out;
+
 	for (;;) {
 		struct page *page;
-		unsigned long end_index, nr, ret;
-		loff_t isize = i_size_read(inode);
-
-		end_index = isize >> PAGE_CACHE_SHIFT;
-			
-		if (index > end_index)
-			break;
-		nr = PAGE_CACHE_SIZE;
-		if (index == end_index) {
-			nr = isize & ~PAGE_CACHE_MASK;
-			if (nr <= offset)
-				break;
-		}
+		unsigned long nr, ret;
 
 		cond_resched();
 		page_cache_readahead(mapping, &ra, filp, index);
 
-		nr = nr - offset;
 find_page:
 		page = find_get_page(mapping, index);
 		if (unlikely(page == NULL)) {
@@ -688,6 +685,17 @@ find_page:
 		if (!PageUptodate(page))
 			goto page_not_up_to_date;
 page_ok:
+		/* nr is the maximum number of bytes to copy from this page */
+		nr = PAGE_CACHE_SIZE;
+		if (index == end_index) {
+			nr = isize & ~PAGE_CACHE_MASK;
+			if (nr <= offset) {
+				page_cache_release(page);
+				goto out;
+			}
+		}
+		nr = nr - offset;
+
 		/* If users can be writing to this page using arbitrary
 		 * virtual addresses, take care about potential aliasing
 		 * before reading the page on the kernel side.
@@ -719,7 +727,7 @@ page_ok:
 		page_cache_release(page);
 		if (ret == nr && desc->count)
 			continue;
-		break;
+		goto out;
 
 page_not_up_to_date:
 		/* Get exclusive access to the page ... */
@@ -739,22 +747,41 @@ page_not_up_to_date:
 		}
 
 readpage:
-		/* ... and start the actual read. The read will unlock the page. */
+		/* Start the actual read. The read will unlock the page. */
 		error = mapping->a_ops->readpage(filp, page);
 
-		if (!error) {
-			if (PageUptodate(page))
-				goto page_ok;
+		if (unlikely(error))
+			goto readpage_error;
+
+		if (!PageUptodate(page)) {
 			wait_on_page_locked(page);
-			if (PageUptodate(page))
-				goto page_ok;
-			error = -EIO;
+			if (!PageUptodate(page)) {
+				error = -EIO;
+				goto readpage_error;
+			}
 		}
 
+		/*
+		 * i_size must be checked after we have done ->readpage.
+		 *
+		 * Checking i_size after the readpage allows us to calculate
+		 * the correct value for "nr", which means the zero-filled
+		 * part of the page is not copied back to userspace (unless
+		 * another truncate extends the file - this is desired though).
+		 */
+		isize = i_size_read(inode);
+		end_index = isize >> PAGE_CACHE_SHIFT;
+		if (index > end_index) {
+			page_cache_release(page);
+			goto out;
+		}
+		goto page_ok;
+
+readpage_error:
 		/* UHHUH! A synchronous read error occurred. Report it */
 		desc->error = error;
 		page_cache_release(page);
-		break;
+		goto out;
 
 no_cached_page:
 		/*
@@ -765,7 +792,7 @@ no_cached_page:
 			cached_page = page_cache_alloc_cold(mapping);
 			if (!cached_page) {
 				desc->error = -ENOMEM;
-				break;
+				goto out;
 			}
 		}
 		error = add_to_page_cache_lru(cached_page, mapping,
@@ -774,13 +801,14 @@ no_cached_page:
 			if (error == -EEXIST)
 				goto find_page;
 			desc->error = error;
-			break;
+			goto out;
 		}
 		page = cached_page;
 		cached_page = NULL;
 		goto readpage;
 	}
 
+out:
 	*_ra = ra;
 
 	*ppos = ((loff_t) index << PAGE_CACHE_SHIFT) + offset;
@@ -804,9 +832,9 @@ int file_read_actor(read_descriptor_t *desc, struct page *page,
 	 * Faults on the destination of a read are common, so do it before
 	 * taking the kmap.
 	 */
-	if (!fault_in_pages_writeable(desc->buf, size)) {
+	if (!fault_in_pages_writeable(desc->arg.buf, size)) {
 		kaddr = kmap_atomic(page, KM_USER0);
-		left = __copy_to_user(desc->buf, kaddr + offset, size);
+		left = __copy_to_user(desc->arg.buf, kaddr + offset, size);
 		kunmap_atomic(kaddr, KM_USER0);
 		if (left == 0)
 			goto success;
@@ -814,7 +842,7 @@ int file_read_actor(read_descriptor_t *desc, struct page *page,
 
 	/* Do it the slow way */
 	kaddr = kmap(page);
-	left = __copy_to_user(desc->buf, kaddr + offset, size);
+	left = __copy_to_user(desc->arg.buf, kaddr + offset, size);
 	kunmap(page);
 
 	if (left) {
@@ -824,7 +852,7 @@ int file_read_actor(read_descriptor_t *desc, struct page *page,
 success:
 	desc->count = count - size;
 	desc->written += size;
-	desc->buf += size;
+	desc->arg.buf += size;
 	return size;
 }
 
@@ -891,7 +919,7 @@ __generic_file_aio_read(struct kiocb *iocb, const struct iovec *iov,
 			read_descriptor_t desc;
 
 			desc.written = 0;
-			desc.buf = iov[seg].iov_base;
+			desc.arg.buf = iov[seg].iov_base;
 			desc.count = iov[seg].iov_len;
 			if (desc.count == 0)
 				continue;
@@ -941,7 +969,7 @@ int file_send_actor(read_descriptor_t * desc, struct page *page, unsigned long o
 {
 	ssize_t written;
 	unsigned long count = desc->count;
-	struct file *file = (struct file *) desc->buf;
+	struct file *file = desc->arg.data;
 
 	if (size > count)
 		size = count;
@@ -958,7 +986,7 @@ int file_send_actor(read_descriptor_t * desc, struct page *page, unsigned long o
 }
 
 ssize_t generic_file_sendfile(struct file *in_file, loff_t *ppos,
-			 size_t count, read_actor_t actor, void __user *target)
+			 size_t count, read_actor_t actor, void *target)
 {
 	read_descriptor_t desc;
 
@@ -967,7 +995,7 @@ ssize_t generic_file_sendfile(struct file *in_file, loff_t *ppos,
 
 	desc.written = 0;
 	desc.count = count;
-	desc.buf = target;
+	desc.arg.data = target;
 	desc.error = 0;
 
 	do_generic_file_read(in_file, ppos, &desc, actor);
@@ -1123,12 +1151,11 @@ retry_find:
 		did_readaround = 1;
 		ra_pages = max_sane_readahead(file->f_ra.ra_pages);
 		if (ra_pages) {
-			long start;
+			pgoff_t start = 0;
 
-			start = pgoff - ra_pages / 2;
-			if (pgoff < 0)
-				pgoff = 0;
-			do_page_cache_readahead(mapping, file, pgoff, ra_pages);
+			if (pgoff > ra_pages / 2)
+				start = pgoff - ra_pages / 2;
+			do_page_cache_readahead(mapping, file, start, ra_pages);
 		}
 		page = find_get_page(mapping, pgoff);
 		if (!page)
@@ -1390,15 +1417,9 @@ repeat:
 			return err;
 		}
 	} else {
-	    	/*
-		 * If a nonlinear mapping then store the file page offset
-		 * in the pte.
-		 */
-		if (pgoff != linear_page_index(vma, addr)) {
-	    		err = install_file_pte(mm, vma, addr, pgoff, prot);
-			if (err)
-		    		return err;
-		}
+		err = install_file_pte(mm, vma, addr, pgoff, prot);
+		if (err)
+			return err;
 	}
 
 	len -= PAGE_SIZE;
@@ -1891,7 +1912,7 @@ generic_file_aio_write_nolock(struct kiocb *iocb, const struct iovec *iov,
 		count -= written;
 	}
 
-	buf = iov->iov_base;
+	buf = iov->iov_base + written;	/* handle partial DIO write */
 	do {
 		unsigned long index;
 		unsigned long offset;
@@ -1989,7 +2010,7 @@ out_status:
 	err = written ? written : status;
 out:
 	pagevec_lru_add(&lru_pvec);
-	current->backing_dev_info = 0;
+	current->backing_dev_info = NULL;
 	return err;
 }
 
diff --git a/mm/fremap.c b/mm/fremap.c
index c708a5870..2f211f502 100644
--- a/mm/fremap.c
+++ b/mm/fremap.c
@@ -57,18 +57,14 @@ static inline void zap_pte(struct mm_struct *mm, struct vm_area_struct *vma,
 int install_page(struct mm_struct *mm, struct vm_area_struct *vma,
 		unsigned long addr, struct page *page, pgprot_t prot)
 {
+	struct inode *inode;
+	pgoff_t size;
 	int err = -ENOMEM;
 	pte_t *pte;
 	pgd_t *pgd;
 	pmd_t *pmd;
 	pte_t pte_val;
 
-	/*
-	 * We use page_add_file_rmap below: if install_page is
-	 * ever extended to anonymous pages, this will warn us.
-	 */
-	BUG_ON(!page_mapping(page));
-
 	pgd = pgd_offset(mm, addr);
 	spin_lock(&mm->page_table_lock);
 
@@ -83,6 +79,16 @@ int install_page(struct mm_struct *mm, struct vm_area_struct *vma,
 	if (!pte)
 		goto err_unlock;
 
+	/*
+	 * This page may have been truncated. Tell the
+	 * caller about it.
+	 */
+	err = -EINVAL;
+	inode = vma->vm_file->f_mapping->host;
+	size = (i_size_read(inode) + PAGE_CACHE_SIZE - 1) >> PAGE_CACHE_SHIFT;
+	if (!page->mapping || page->index >= size)
+		goto err_unlock;
+
 	zap_pte(mm, vma, addr, pte);
 
 	// mm->rss++;
@@ -167,6 +173,7 @@ asmlinkage long sys_remap_file_pages(unsigned long start, unsigned long size,
 	unsigned long end = start + size;
 	struct vm_area_struct *vma;
 	int err = -EINVAL;
+	int has_write_lock = 0;
 
 	if (__prot)
 		return err;
@@ -187,7 +194,8 @@ asmlinkage long sys_remap_file_pages(unsigned long start, unsigned long size,
 #endif
 
 	/* We need down_write() to change vma->vm_flags. */
-	down_write(&mm->mmap_sem);
+	down_read(&mm->mmap_sem);
+ retry:
 	vma = find_vma(mm, start);
 
 	/*
@@ -198,7 +206,8 @@ asmlinkage long sys_remap_file_pages(unsigned long start, unsigned long size,
 	 * or VM_LOCKED, but VM_LOCKED could be revoked later on).
 	 */
 	if (vma && (vma->vm_flags & VM_SHARED) &&
-		(!vma->vm_private_data || (vma->vm_flags & VM_RESERVED)) &&
+		(!vma->vm_private_data ||
+			(vma->vm_flags & (VM_NONLINEAR|VM_RESERVED))) &&
 		vma->vm_ops && vma->vm_ops->populate &&
 			end > start && start >= vma->vm_start &&
 				end <= vma->vm_end) {
@@ -206,6 +215,12 @@ asmlinkage long sys_remap_file_pages(unsigned long start, unsigned long size,
 		/* Must set VM_NONLINEAR before any pages are populated. */
 		if (pgoff != linear_page_index(vma, start) &&
 		    !(vma->vm_flags & VM_NONLINEAR)) {
+			if (!has_write_lock) {
+				up_read(&mm->mmap_sem);
+				down_write(&mm->mmap_sem);
+				has_write_lock = 1;
+				goto retry;
+			}
 			mapping = vma->vm_file->f_mapping;
 			spin_lock(&mapping->i_mmap_lock);
 			flush_dcache_mmap_lock(mapping);
@@ -218,8 +233,6 @@ asmlinkage long sys_remap_file_pages(unsigned long start, unsigned long size,
 			spin_unlock(&mapping->i_mmap_lock);
 		}
 
-		/* ->populate can take a long time, so downgrade the lock. */
-		downgrade_write(&mm->mmap_sem);
 		err = vma->vm_ops->populate(vma, start, size,
 					    vma->vm_page_prot,
 					    pgoff, flags & MAP_NONBLOCK);
@@ -229,10 +242,11 @@ asmlinkage long sys_remap_file_pages(unsigned long start, unsigned long size,
 		 * it after ->populate completes, and that would prevent
 		 * downgrading the lock.  (Locks can't be upgraded).
 		 */
+	}
+	if (likely(!has_write_lock))
 		up_read(&mm->mmap_sem);
-	} else {
+	else
 		up_write(&mm->mmap_sem);
-	}
 
 	return err;
 }
diff --git a/mm/highmem.c b/mm/highmem.c
index 9fc110699..432da5b68 100644
--- a/mm/highmem.c
+++ b/mm/highmem.c
@@ -26,7 +26,6 @@
 #include <linux/init.h>
 #include <linux/hash.h>
 #include <linux/highmem.h>
-#include <asm/pgalloc.h>
 #include <asm/tlbflush.h>
 
 static mempool_t *page_pool, *isa_page_pool;
@@ -309,12 +308,10 @@ static void bounce_end_io(struct bio *bio, mempool_t *pool)
 {
 	struct bio *bio_orig = bio->bi_private;
 	struct bio_vec *bvec, *org_vec;
-	int i;
+	int i, err = 0;
 
 	if (!test_bit(BIO_UPTODATE, &bio->bi_flags))
-		goto out_eio;
-
-	set_bit(BIO_UPTODATE, &bio_orig->bi_flags);
+		err = -EIO;
 
 	/*
 	 * free up bounce indirect pages used
@@ -327,8 +324,7 @@ static void bounce_end_io(struct bio *bio, mempool_t *pool)
 		mempool_free(bvec->bv_page, pool);	
 	}
 
-out_eio:
-	bio_endio(bio_orig, bio_orig->bi_size, 0);
+	bio_endio(bio_orig, bio_orig->bi_size, err);
 	bio_put(bio);
 }
 
diff --git a/mm/hugetlb.c b/mm/hugetlb.c
index bce0d47a4..6c522e127 100644
--- a/mm/hugetlb.c
+++ b/mm/hugetlb.c
@@ -15,12 +15,16 @@ const unsigned long hugetlb_zero = 0, hugetlb_infinity = ~0UL;
 static unsigned long nr_huge_pages, free_huge_pages;
 unsigned long max_huge_pages;
 static struct list_head hugepage_freelists[MAX_NUMNODES];
+static unsigned int nr_huge_pages_node[MAX_NUMNODES];
+static unsigned int free_huge_pages_node[MAX_NUMNODES];
 static spinlock_t hugetlb_lock = SPIN_LOCK_UNLOCKED;
 
 static void enqueue_huge_page(struct page *page)
 {
-	list_add(&page->lru,
-		 &hugepage_freelists[page_zone(page)->zone_pgdat->node_id]);
+	int nid = page_zone(page)->zone_pgdat->node_id;
+	list_add(&page->lru, &hugepage_freelists[nid]);
+	free_huge_pages++;
+	free_huge_pages_node[nid]++;
 }
 
 static struct page *dequeue_huge_page(void)
@@ -38,6 +42,8 @@ static struct page *dequeue_huge_page(void)
 		page = list_entry(hugepage_freelists[nid].next,
 				  struct page, lru);
 		list_del(&page->lru);
+		free_huge_pages--;
+		free_huge_pages_node[nid]--;
 	}
 	return page;
 }
@@ -49,6 +55,10 @@ static struct page *alloc_fresh_huge_page(void)
 	page = alloc_pages_node(nid, GFP_HIGHUSER|__GFP_COMP,
 					HUGETLB_PAGE_ORDER);
 	nid = (nid + 1) % numnodes;
+	if (page) {
+		nr_huge_pages++;
+		nr_huge_pages_node[page_zone(page)->zone_pgdat->node_id]++;
+	}
 	return page;
 }
 
@@ -61,7 +71,6 @@ void free_huge_page(struct page *page)
 
 	spin_lock(&hugetlb_lock);
 	enqueue_huge_page(page);
-	free_huge_pages++;
 	spin_unlock(&hugetlb_lock);
 }
 
@@ -76,7 +85,6 @@ struct page *alloc_huge_page(void)
 		spin_unlock(&hugetlb_lock);
 		return NULL;
 	}
-	free_huge_pages--;
 	spin_unlock(&hugetlb_lock);
 	set_page_count(page, 1);
 	page[1].mapping = (void *)free_huge_page;
@@ -119,6 +127,7 @@ static void update_and_free_page(struct page *page)
 {
 	int i;
 	nr_huge_pages--;
+	nr_huge_pages_node[page_zone(page)->zone_pgdat->node_id]--;
 	for (i = 0; i < (HPAGE_SIZE / PAGE_SIZE); i++) {
 		page[i].flags &= ~(1 << PG_locked | 1 << PG_error | 1 << PG_referenced |
 				1 << PG_dirty | 1 << PG_active | 1 << PG_reserved |
@@ -130,27 +139,27 @@ static void update_and_free_page(struct page *page)
 }
 
 #ifdef CONFIG_HIGHMEM
-static int try_to_free_low(unsigned long count)
+static void try_to_free_low(unsigned long count)
 {
-	int i;
+	int i, nid;
 	for (i = 0; i < MAX_NUMNODES; ++i) {
-		struct page *page;
-		list_for_each_entry(page, &hugepage_freelists[i], lru) {
+		struct page *page, *next;
+		list_for_each_entry_safe(page, next, &hugepage_freelists[i], lru) {
 			if (PageHighMem(page))
 				continue;
 			list_del(&page->lru);
 			update_and_free_page(page);
-			--free_huge_pages;
-			if (!--count)
-				return 0;
+			nid = page_zone(page)->zone_pgdat->node_id;
+			free_huge_pages--;
+			free_huge_pages_node[nid]--;
+			if (count >= nr_huge_pages)
+				return;
 		}
 	}
-	return count;
 }
 #else
-static inline int try_to_free_low(unsigned long count)
+static inline void try_to_free_low(unsigned long count)
 {
-	return count;
 }
 #endif
 
@@ -162,15 +171,14 @@ static unsigned long set_max_huge_pages(unsigned long count)
 			return nr_huge_pages;
 		spin_lock(&hugetlb_lock);
 		enqueue_huge_page(page);
-		free_huge_pages++;
-		nr_huge_pages++;
 		spin_unlock(&hugetlb_lock);
 	}
 	if (count >= nr_huge_pages)
 		return nr_huge_pages;
 
 	spin_lock(&hugetlb_lock);
-	for (count = try_to_free_low(count); count < nr_huge_pages; --free_huge_pages) {
+	try_to_free_low(count);
+	while (count < nr_huge_pages) {
 		struct page *page = dequeue_huge_page();
 		if (!page)
 			break;
@@ -183,9 +191,9 @@ static unsigned long set_max_huge_pages(unsigned long count)
 #ifdef CONFIG_SYSCTL
 int hugetlb_sysctl_handler(struct ctl_table *table, int write,
 			   struct file *file, void __user *buffer,
-			   size_t *length)
+			   size_t *length, loff_t *ppos)
 {
-	proc_doulongvec_minmax(table, write, file, buffer, length);
+	proc_doulongvec_minmax(table, write, file, buffer, length, ppos);
 	max_huge_pages = set_max_huge_pages(max_huge_pages);
 	return 0;
 }
@@ -202,6 +210,15 @@ int hugetlb_report_meminfo(char *buf)
 			HPAGE_SIZE/1024);
 }
 
+int hugetlb_report_node_meminfo(int nid, char *buf)
+{
+	return sprintf(buf,
+		"Node %d HugePages_Total: %5u\n"
+		"Node %d HugePages_Free:  %5u\n",
+		nid, nr_huge_pages_node[nid],
+		nid, free_huge_pages_node[nid]);
+}
+
 int is_hugepage_mem_enough(size_t size)
 {
 	return (size + ~HPAGE_MASK)/HPAGE_SIZE <= free_huge_pages;
diff --git a/mm/memory.c b/mm/memory.c
index 6fba00daf..adaca7c22 100644
--- a/mm/memory.c
+++ b/mm/memory.c
@@ -66,12 +66,21 @@ EXPORT_SYMBOL(mem_map);
 #endif
 
 unsigned long num_physpages;
+/*
+ * A number of key systems in x86 including ioremap() rely on the assumption
+ * that high_memory defines the upper bound on direct map memory, then end
+ * of ZONE_NORMAL.  Under CONFIG_DISCONTIG this means that max_low_pfn and
+ * highstart_pfn must be the same; there must be no gap between ZONE_NORMAL
+ * and ZONE_HIGHMEM.
+ */
 void * high_memory;
 struct page *highmem_start_page;
+unsigned long vmalloc_earlyreserve;
 
 EXPORT_SYMBOL(num_physpages);
 EXPORT_SYMBOL(highmem_start_page);
 EXPORT_SYMBOL(high_memory);
+EXPORT_SYMBOL(vmalloc_earlyreserve);
 
 /*
  * We special-case the C-O-W ZERO_PAGE, because it's such
@@ -412,7 +421,7 @@ static void zap_pte_range(struct mmu_gather *tlb,
 				set_pte(ptep, pgoff_to_pte(page->index));
 			if (pte_dirty(pte))
 				set_page_dirty(page);
-			if (pte_young(pte) && page_mapping(page))
+			if (pte_young(pte) && !PageAnon(page))
 				mark_page_accessed(page);
 			tlb->freed++;
 			page_remove_rmap(page);
@@ -665,7 +674,7 @@ out:
 static inline struct page *get_page_map(struct page *page)
 {
 	if (!pfn_valid(page_to_pfn(page)))
-		return 0;
+		return NULL;
 	return page;
 }
 
@@ -723,19 +732,24 @@ int get_user_pages(struct task_struct *tsk, struct mm_struct *mm,
 			pte_t *pte;
 			if (write) /* user gate pages are read-only */
 				return i ? : -EFAULT;
-			pgd = pgd_offset_k(pg);
+			pgd = pgd_offset_gate(mm, pg);
 			if (!pgd)
 				return i ? : -EFAULT;
 			pmd = pmd_offset(pgd, pg);
 			if (!pmd)
 				return i ? : -EFAULT;
-			pte = pte_offset_kernel(pmd, pg);
-			if (!pte || !pte_present(*pte))
+			pte = pte_offset_map(pmd, pg);
+			if (!pte)
+				return i ? : -EFAULT;
+			if (!pte_present(*pte)) {
+				pte_unmap(pte);
 				return i ? : -EFAULT;
+			}
 			if (pages) {
 				pages[i] = pte_page(*pte);
 				get_page(pages[i]);
 			}
+			pte_unmap(pte);
 			if (vmas)
 				vmas[i] = gate_vma;
 			i++;
@@ -1069,7 +1083,8 @@ static int do_wp_page(struct mm_struct *mm, struct vm_area_struct * vma,
 	/*
 	 * Ok, we need to copy. Oh, well..
 	 */
-	page_cache_get(old_page);
+	if (!PageReserved(old_page))
+		page_cache_get(old_page);
 	spin_unlock(&mm->page_table_lock);
 
 	if (unlikely(anon_vma_prepare(vma)))
@@ -1215,6 +1230,12 @@ int vmtruncate(struct inode * inode, loff_t offset)
 
 	if (inode->i_size < offset)
 		goto do_expand;
+	/*
+	 * truncation of in-use swapfiles is disallowed - it would cause
+	 * subsequent swapout to scribble on the now-freed blocks.
+	 */
+	if (IS_SWAPFILE(inode))
+		goto out_busy;
 	i_size_write(inode, offset);
 	unmap_mapping_range(mapping, offset + PAGE_SIZE - 1, 0, 1);
 	truncate_inode_pages(mapping, offset);
@@ -1225,7 +1246,7 @@ do_expand:
 	if (limit != RLIM_INFINITY && offset > limit)
 		goto out_sig;
 	if (offset > inode->i_sb->s_maxbytes)
-		goto out;
+		goto out_big;
 	i_size_write(inode, offset);
 
 out_truncate:
@@ -1234,8 +1255,10 @@ out_truncate:
 	return 0;
 out_sig:
 	send_sig(SIGXFSZ, current, 0);
-out:
+out_big:
 	return -EFBIG;
+out_busy:
+	return -ETXTBSY;
 }
 
 EXPORT_SYMBOL(vmtruncate);
@@ -1801,7 +1824,7 @@ struct vm_area_struct *get_gate_vma(struct task_struct *tsk)
 #ifdef AT_SYSINFO_EHDR
 	return &gate_vma;
 #else
-	return 0;
+	return NULL;
 #endif
 }
 
diff --git a/mm/mempolicy.c b/mm/mempolicy.c
index 1b11685f0..d06eabbf7 100644
--- a/mm/mempolicy.c
+++ b/mm/mempolicy.c
@@ -26,7 +26,7 @@
  *                process policy.
  * default        Allocate on the local node first, or when on a VMA
  *                use the process policy. This is what Linux always did
- *				   in a NUMA aware kernel and still does by, ahem, default.
+ *		  in a NUMA aware kernel and still does by, ahem, default.
  *
  * The process policy is applied for most non interrupt memory allocations
  * in that process' context. Interrupts ignore the policies and always
@@ -93,14 +93,12 @@ static struct mempolicy default_policy = {
 /* Check if all specified nodes are online */
 static int nodes_online(unsigned long *nodes)
 {
-	DECLARE_BITMAP(offline, MAX_NUMNODES);
+	DECLARE_BITMAP(online2, MAX_NUMNODES);
 
-	bitmap_copy(offline, node_online_map, MAX_NUMNODES);
-	if (bitmap_empty(offline, MAX_NUMNODES))
-		set_bit(0, offline);
-	bitmap_complement(offline, MAX_NUMNODES);
-	bitmap_and(offline, offline, nodes, MAX_NUMNODES);
-	if (!bitmap_empty(offline, MAX_NUMNODES))
+	bitmap_copy(online2, node_online_map, MAX_NUMNODES);
+	if (bitmap_empty(online2, MAX_NUMNODES))
+		set_bit(0, online2);
+	if (!bitmap_subset(nodes, online2, MAX_NUMNODES))
 		return -EINVAL;
 	return 0;
 }
@@ -135,6 +133,10 @@ static int get_nodes(unsigned long *nodes, unsigned long __user *nmask,
 	unsigned long endmask;
 
 	--maxnode;
+	bitmap_zero(nodes, MAX_NUMNODES);
+	if (maxnode == 0 || !nmask)
+		return 0;
+
 	nlongs = BITS_TO_LONGS(maxnode);
 	if ((maxnode % BITS_PER_LONG) == 0)
 		endmask = ~0UL;
@@ -143,7 +145,7 @@ static int get_nodes(unsigned long *nodes, unsigned long __user *nmask,
 
 	/* When the user specified more nodes than supported just check
 	   if the non supported part is all zero. */
-	if (nmask && nlongs > BITS_TO_LONGS(MAX_NUMNODES)) {
+	if (nlongs > BITS_TO_LONGS(MAX_NUMNODES)) {
 		for (k = BITS_TO_LONGS(MAX_NUMNODES); k < nlongs; k++) {
 			unsigned long t;
 			if (get_user(t,  nmask + k))
@@ -158,8 +160,7 @@ static int get_nodes(unsigned long *nodes, unsigned long __user *nmask,
 		endmask = ~0UL;
 	}
 
-	bitmap_zero(nodes, MAX_NUMNODES);
-	if (nmask && copy_from_user(nodes, nmask, nlongs*sizeof(unsigned long)))
+	if (copy_from_user(nodes, nmask, nlongs*sizeof(unsigned long)))
 		return -EFAULT;
 	nodes[nlongs-1] &= endmask;
 	return mpol_check_policy(mode, nodes);
@@ -622,14 +623,14 @@ static unsigned offset_il_node(struct mempolicy *pol,
 
 /* Allocate a page in interleaved policy.
    Own path because it needs to do special accounting. */
-static struct page *alloc_page_interleave(unsigned gfp, unsigned nid)
+static struct page *alloc_page_interleave(unsigned gfp, unsigned order, unsigned nid)
 {
 	struct zonelist *zl;
 	struct page *page;
 
 	BUG_ON(!test_bit(nid, node_online_map));
 	zl = NODE_DATA(nid)->node_zonelists + (gfp & GFP_ZONEMASK);
-	page = __alloc_pages(gfp, 0, zl);
+	page = __alloc_pages(gfp, order, zl);
 	if (page && page_zone(page) == zl->zones[0]) {
 		zl->zones[0]->pageset[get_cpu()].interleave_hit++;
 		put_cpu();
@@ -677,7 +678,7 @@ alloc_page_vma(unsigned gfp, struct vm_area_struct *vma, unsigned long addr)
 			/* fall back to process interleaving */
 			nid = interleave_nodes(pol);
 		}
-		return alloc_page_interleave(gfp, nid);
+		return alloc_page_interleave(gfp, 0, nid);
 	}
 	return __alloc_pages(gfp, 0, zonelist_policy(gfp, pol));
 }
@@ -686,7 +687,7 @@ alloc_page_vma(unsigned gfp, struct vm_area_struct *vma, unsigned long addr)
  * 	alloc_pages_current - Allocate pages.
  *
  *	@gfp:
- *			%GFP_USER   user allocation,
+ *		%GFP_USER   user allocation,
  *      	%GFP_KERNEL kernel allocation,
  *      	%GFP_HIGHMEM highmem allocation,
  *      	%GFP_FS     don't call back into a file system.
@@ -703,8 +704,8 @@ struct page *alloc_pages_current(unsigned gfp, unsigned order)
 
 	if (!pol || in_interrupt())
 		pol = &default_policy;
-	if (pol->policy == MPOL_INTERLEAVE && order == 0)
-		return alloc_page_interleave(gfp, interleave_nodes(pol));
+	if (pol->policy == MPOL_INTERLEAVE)
+		return alloc_page_interleave(gfp, order, interleave_nodes(pol));
 	return __alloc_pages(gfp, order, zonelist_policy(gfp, pol));
 }
 EXPORT_SYMBOL(alloc_pages_current);
@@ -1002,7 +1003,8 @@ void mpol_free_shared_policy(struct shared_policy *p)
 	up(&p->sem);
 }
 
-static __init int numa_policy_init(void)
+/* assumes fs == KERNEL_DS */
+void __init numa_policy_init(void)
 {
 	policy_cache = kmem_cache_create("numa_policy",
 					 sizeof(struct mempolicy),
@@ -1011,6 +1013,17 @@ static __init int numa_policy_init(void)
 	sn_cache = kmem_cache_create("shared_policy_node",
 				     sizeof(struct sp_node),
 				     0, SLAB_PANIC, NULL, NULL);
-	return 0;
+
+	/* Set interleaving policy for system init. This way not all
+	   the data structures allocated at system boot end up in node zero. */
+
+	if (sys_set_mempolicy(MPOL_INTERLEAVE, node_online_map, MAX_NUMNODES) < 0)
+		printk("numa_policy_init: interleaving failed\n");
+}
+
+/* Reset policy of current process to default.
+ * Assumes fs == KERNEL_DS */
+void numa_default_policy(void)
+{
+	sys_set_mempolicy(MPOL_DEFAULT, NULL, 0);
 }
-module_init(numa_policy_init);
diff --git a/mm/mempool.c b/mm/mempool.c
index da6ad1e12..a6c1537ee 100644
--- a/mm/mempool.c
+++ b/mm/mempool.c
@@ -89,11 +89,6 @@ mempool_t * mempool_create(int min_nr, mempool_alloc_t *alloc_fn,
 }
 EXPORT_SYMBOL(mempool_create);
 
-/*
- * mempool_resize is disabled for now, because it has no callers.  Feel free
- * to turn it back on if needed.
- */
-#if 0
 /**
  * mempool_resize - resize an existing memory pool
  * @pool:       pointer to the memory pool which was allocated via
@@ -163,7 +158,6 @@ out:
 	return 0;
 }
 EXPORT_SYMBOL(mempool_resize);
-#endif
 
 /**
  * mempool_destroy - deallocate a memory pool
diff --git a/mm/mincore.c b/mm/mincore.c
index eac70dbc4..280abef57 100644
--- a/mm/mincore.c
+++ b/mm/mincore.c
@@ -14,7 +14,6 @@
 
 #include <asm/uaccess.h>
 #include <asm/pgtable.h>
-#include <asm/pgalloc.h>
 
 /*
  * Later we can get more picky about what "in core" means precisely.
diff --git a/mm/mmap.c b/mm/mmap.c
index bc1c46cba..0a89be9fb 100644
--- a/mm/mmap.c
+++ b/mm/mmap.c
@@ -25,7 +25,6 @@
 #include <linux/rmap.h>
 
 #include <asm/uaccess.h>
-#include <asm/pgalloc.h>
 #include <asm/cacheflush.h>
 #include <asm/tlb.h>
 
@@ -318,7 +317,6 @@ static void vma_link(struct mm_struct *mm, struct vm_area_struct *vma,
 	if (mapping)
 		spin_unlock(&mapping->i_mmap_lock);
 
-	mark_mm_hugetlb(mm, vma);
 	mm->map_count++;
 	validate_mm(mm);
 }
@@ -363,6 +361,7 @@ void vma_adjust(struct vm_area_struct *vma, unsigned long start,
 {
 	struct mm_struct *mm = vma->vm_mm;
 	struct vm_area_struct *next = vma->vm_next;
+	struct vm_area_struct *importer = NULL;
 	struct address_space *mapping = NULL;
 	struct prio_tree_root *root = NULL;
 	struct file *file = vma->vm_file;
@@ -386,6 +385,7 @@ again:			remove_next = 1 + (end > next->vm_end);
 			 */
 			adjust_next = (end - next->vm_start) >> PAGE_SHIFT;
 			anon_vma = next->anon_vma;
+			importer = vma;
 		} else if (end < vma->vm_end) {
 			/*
 			 * vma shrinks, and !insert tells it's not
@@ -394,6 +394,7 @@ again:			remove_next = 1 + (end > next->vm_end);
 			 */
 			adjust_next = - ((vma->vm_end - end) >> PAGE_SHIFT);
 			anon_vma = next->anon_vma;
+			importer = next;
 		}
 	}
 
@@ -419,8 +420,18 @@ again:			remove_next = 1 + (end > next->vm_end);
 	 */
 	if (vma->anon_vma)
 		anon_vma = vma->anon_vma;
-	if (anon_vma)
+	if (anon_vma) {
 		spin_lock(&anon_vma->lock);
+		/*
+		 * Easily overlooked: when mprotect shifts the boundary,
+		 * make sure the expanding vma has anon_vma set if the
+		 * shrinking vma had, to cover any anon pages imported.
+		 */
+		if (importer && !importer->anon_vma) {
+			importer->anon_vma = anon_vma;
+			__anon_vma_link(importer);
+		}
+	}
 
 	if (root) {
 		flush_dcache_mmap_lock(mapping);
@@ -739,6 +750,13 @@ unsigned long do_mmap_pgoff(struct file * file, unsigned long addr,
 	int accountable = 1;
 	unsigned long charged = 0;
 
+	/*
+	 * Does the application expect PROT_READ to imply PROT_EXEC:
+	 */
+	if (unlikely((prot & PROT_READ) &&
+			(current->personality & READ_IMPLIES_EXEC)))
+		prot |= PROT_EXEC;
+
 	if (file) {
 		if (is_file_hugepages(file))
 			accountable = 0;
diff --git a/mm/mprotect.c b/mm/mprotect.c
index 5b438e1a0..88041d46a 100644
--- a/mm/mprotect.c
+++ b/mm/mprotect.c
@@ -17,9 +17,9 @@
 #include <linux/highmem.h>
 #include <linux/security.h>
 #include <linux/mempolicy.h>
+#include <linux/personality.h>
 
 #include <asm/uaccess.h>
-#include <asm/pgalloc.h>
 #include <asm/pgtable.h>
 #include <asm/cacheflush.h>
 #include <asm/tlbflush.h>
@@ -206,6 +206,12 @@ sys_mprotect(unsigned long start, size_t len, unsigned long prot)
 		return -EINVAL;
 	if (end == start)
 		return 0;
+	/*
+	 * Does the application expect PROT_READ to imply PROT_EXEC:
+	 */
+	if (unlikely((prot & PROT_READ) &&
+			(current->personality & READ_IMPLIES_EXEC)))
+		prot |= PROT_EXEC;
 
 	vm_flags = calc_vm_prot_bits(prot);
 
diff --git a/mm/mremap.c b/mm/mremap.c
index e2a1d61f5..330a32a4a 100644
--- a/mm/mremap.c
+++ b/mm/mremap.c
@@ -16,9 +16,9 @@
 #include <linux/fs.h>
 #include <linux/highmem.h>
 #include <linux/security.h>
+#include <linux/vs_memory.h>
 
 #include <asm/uaccess.h>
-#include <asm/pgalloc.h>
 #include <asm/cacheflush.h>
 #include <asm/tlbflush.h>
 
diff --git a/mm/msync.c b/mm/msync.c
index cd5e947da..2aaad0418 100644
--- a/mm/msync.c
+++ b/mm/msync.c
@@ -14,7 +14,6 @@
 #include <linux/hugetlb.h>
 
 #include <asm/pgtable.h>
-#include <asm/pgalloc.h>
 #include <asm/tlbflush.h>
 
 /*
diff --git a/mm/nommu.c b/mm/nommu.c
index 587290579..114c0ccb4 100644
--- a/mm/nommu.c
+++ b/mm/nommu.c
@@ -20,7 +20,6 @@
 #include <linux/blkdev.h>
 #include <linux/backing-dev.h>
 
-#include <asm/pgalloc.h>
 #include <asm/uaccess.h>
 #include <asm/tlb.h>
 #include <asm/tlbflush.h>
@@ -572,6 +571,6 @@ unsigned long get_unmapped_area(struct file *file, unsigned long addr,
 	return -ENOMEM;
 }
 
-void swap_unplug_io_fn(struct backing_dev_info *)
+void swap_unplug_io_fn(struct backing_dev_info *bdi, struct page *page)
 {
 }
diff --git a/mm/oom_kill.c b/mm/oom_kill.c
index 4285b59b3..3de04b617 100644
--- a/mm/oom_kill.c
+++ b/mm/oom_kill.c
@@ -221,7 +221,7 @@ retry:
 /**
  * out_of_memory - is the system out of memory?
  */
-void out_of_memory(void)
+void out_of_memory(int gfp_mask)
 {
 	/*
 	 * oom_lock protects out_of_memory()'s static variables.
@@ -231,12 +231,6 @@ void out_of_memory(void)
 	static unsigned long first, last, count, lastkill;
 	unsigned long now, since;
 
-	/*
-	 * Enough swap space left?  Not OOM.
-	 */
-	if (nr_swap_pages > 0)
-		return;
-
 	spin_lock(&oom_lock);
 	now = jiffies;
 	since = now - last;
@@ -278,6 +272,9 @@ void out_of_memory(void)
 	 */
 	lastkill = now;
 
+	printk("oom-killer: gfp_mask=0x%x\n", gfp_mask);
+	show_free_areas();
+
 	/* oom_kill() sleeps */
 	spin_unlock(&oom_lock);
 	oom_kill();
diff --git a/mm/page-writeback.c b/mm/page-writeback.c
index a2aa511ad..343998d46 100644
--- a/mm/page-writeback.c
+++ b/mm/page-writeback.c
@@ -399,9 +399,9 @@ static void wb_kupdate(unsigned long arg)
  * sysctl handler for /proc/sys/vm/dirty_writeback_centisecs
  */
 int dirty_writeback_centisecs_handler(ctl_table *table, int write,
-		struct file *file, void __user *buffer, size_t *length)
+		struct file *file, void __user *buffer, size_t *length, loff_t *ppos)
 {
-	proc_dointvec(table, write, file, buffer, length);
+	proc_dointvec(table, write, file, buffer, length, ppos);
 	if (dirty_writeback_centisecs) {
 		mod_timer(&wb_timer,
 			jiffies + (dirty_writeback_centisecs * HZ) / 100);
diff --git a/mm/page_alloc.c b/mm/page_alloc.c
index d7270d798..3fe5eb3ad 100644
--- a/mm/page_alloc.c
+++ b/mm/page_alloc.c
@@ -40,7 +40,7 @@ DECLARE_BITMAP(node_online_map, MAX_NUMNODES);
 struct pglist_data *pgdat_list;
 unsigned long totalram_pages;
 unsigned long totalhigh_pages;
-int nr_swap_pages;
+long nr_swap_pages;
 int numnodes = 1;
 int sysctl_lower_zone_protection = 0;
 
@@ -57,6 +57,9 @@ EXPORT_SYMBOL(zone_table);
 static char *zone_names[MAX_NR_ZONES] = { "DMA", "Normal", "HighMem" };
 int min_free_kbytes = 1024;
 
+static unsigned long __initdata nr_kernel_pages;
+static unsigned long __initdata nr_all_pages;
+
 /*
  * Temporary debugging check for pages not lying within a given zone.
  */
@@ -121,7 +124,7 @@ static void prep_compound_page(struct page *page, unsigned long order)
 	int i;
 	int nr_pages = 1 << order;
 
-	page[1].mapping = 0;
+	page[1].mapping = NULL;
 	page[1].index = order;
 	for (i = 0; i < nr_pages; i++) {
 		struct page *p = page + i;
@@ -178,20 +181,20 @@ static void destroy_compound_page(struct page *page, unsigned long order)
  */
 
 static inline void __free_pages_bulk (struct page *page, struct page *base,
-		struct zone *zone, struct free_area *area, unsigned long mask,
-		unsigned int order)
+		struct zone *zone, struct free_area *area, unsigned int order)
 {
-	unsigned long page_idx, index;
+	unsigned long page_idx, index, mask;
 
 	if (order)
 		destroy_compound_page(page, order);
+	mask = (~0UL) << order;
 	page_idx = page - base;
 	if (page_idx & ~mask)
 		BUG();
 	index = page_idx >> (1 + order);
 
-	zone->free_pages -= mask;
-	while (mask + (1 << (MAX_ORDER-1))) {
+	zone->free_pages += 1 << order;
+	while (order < MAX_ORDER-1) {
 		struct page *buddy1, *buddy2;
 
 		BUG_ON(area >= zone->free_area + MAX_ORDER);
@@ -200,17 +203,15 @@ static inline void __free_pages_bulk (struct page *page, struct page *base,
 			 * the buddy page is still allocated.
 			 */
 			break;
-		/*
-		 * Move the buddy up one level.
-		 * This code is taking advantage of the identity:
-		 * 	-mask = 1+~mask
-		 */
-		buddy1 = base + (page_idx ^ -mask);
+
+		/* Move the buddy up one level. */
+		buddy1 = base + (page_idx ^ (1 << order));
 		buddy2 = base + page_idx;
 		BUG_ON(bad_range(zone, buddy1));
 		BUG_ON(bad_range(zone, buddy2));
 		list_del(&buddy1->lru);
 		mask <<= 1;
+		order++;
 		area++;
 		index >>= 1;
 		page_idx &= mask;
@@ -254,12 +255,11 @@ static int
 free_pages_bulk(struct zone *zone, int count,
 		struct list_head *list, unsigned int order)
 {
-	unsigned long mask, flags;
+	unsigned long flags;
 	struct free_area *area;
 	struct page *base, *page = NULL;
 	int ret = 0;
 
-	mask = (~0UL) << order;
 	base = zone->zone_mem_map;
 	area = zone->free_area + order;
 	spin_lock_irqsave(&zone->lock, flags);
@@ -269,7 +269,7 @@ free_pages_bulk(struct zone *zone, int count,
 		page = list_entry(list->prev, struct page, lru);
 		/* have to delete it as __free_pages_bulk list manipulates */
 		list_del(&page->lru);
-		__free_pages_bulk(page, base, zone, area, mask, order);
+		__free_pages_bulk(page, base, zone, area, order);
 		ret++;
 	}
 	spin_unlock_irqrestore(&zone->lock, flags);
@@ -292,6 +292,20 @@ void __free_pages_ok(struct page *page, unsigned int order)
 #define MARK_USED(index, order, area) \
 	__change_bit((index) >> (1+(order)), (area)->map)
 
+/*
+ * The order of subdivision here is critical for the IO subsystem.
+ * Please do not alter this order without good reasons and regression
+ * testing. Specifically, as large blocks of memory are subdivided,
+ * the order in which smaller blocks are delivered depends on the order
+ * they're subdivided in this function. This is the primary factor
+ * influencing the order in which pages are delivered to the IO
+ * subsystem according to empirical testing, and this is also justified
+ * by considering the behavior of a buddy system containing a single
+ * large block of memory acted on by a series of small allocations.
+ * This behavior is a critical factor in sglist merging's success.
+ *
+ * -- wli
+ */
 static inline struct page *
 expand(struct zone *zone, struct page *page,
 	 unsigned long index, int low, int high, struct free_area *area)
@@ -299,14 +313,12 @@ expand(struct zone *zone, struct page *page,
 	unsigned long size = 1 << high;
 
 	while (high > low) {
-		BUG_ON(bad_range(zone, page));
 		area--;
 		high--;
 		size >>= 1;
-		list_add(&page->lru, &area->free_list);
-		MARK_USED(index, high, area);
-		index += size;
-		page += size;
+		BUG_ON(bad_range(zone, &page[size]));
+		list_add(&page[size].lru, &area->free_list);
+		MARK_USED(index + size, high, area);
 	}
 	return page;
 }
@@ -734,53 +746,12 @@ got_pg:
 
 EXPORT_SYMBOL(__alloc_pages);
 
-#ifdef CONFIG_NUMA
-/* Early boot: Everything is done by one cpu, but the data structures will be
- * used by all cpus - spread them on all nodes.
- */
-static __init unsigned long get_boot_pages(unsigned int gfp_mask, unsigned int order)
-{
-static int nodenr;
-	int i = nodenr;
-	struct page *page;
-
-	for (;;) {
-		if (i > nodenr + numnodes)
-			return 0;
-		if (node_present_pages(i%numnodes)) {
-			struct zone **z;
-			/* The node contains memory. Check that there is
-			 * memory in the intended zonelist.
-			 */
-			z = NODE_DATA(i%numnodes)->node_zonelists[gfp_mask & GFP_ZONEMASK].zones;
-			while (*z) {
-				if ( (*z)->free_pages > (1UL<<order))
-					goto found_node;
-				z++;
-			}
-		}
-		i++;
-	}
-found_node:
-	nodenr = i+1;
-	page = alloc_pages_node(i%numnodes, gfp_mask, order);
-	if (!page)
-		return 0;
-	return (unsigned long) page_address(page);
-}
-#endif
-
 /*
  * Common helper functions.
  */
 fastcall unsigned long __get_free_pages(unsigned int gfp_mask, unsigned int order)
 {
 	struct page * page;
-
-#ifdef CONFIG_NUMA
-	if (unlikely(system_state == SYSTEM_BOOTING))
-		return get_boot_pages(gfp_mask, order);
-#endif
 	page = alloc_pages(gfp_mask, order);
 	if (!page)
 		return 0;
@@ -856,17 +827,6 @@ unsigned int nr_free_pages(void)
 
 EXPORT_SYMBOL(nr_free_pages);
 
-unsigned int nr_used_zone_pages(void)
-{
-	unsigned int pages = 0;
-	struct zone *zone;
-
-	for_each_zone(zone)
-		pages += zone->nr_active + zone->nr_inactive;
-
-	return pages;
-}
-
 #ifdef CONFIG_NUMA
 unsigned int nr_free_pages_pgdat(pg_data_t *pgdat)
 {
@@ -1268,7 +1228,7 @@ static void __init build_zonelists(pg_data_t *pgdat)
 	DECLARE_BITMAP(used_mask, MAX_NUMNODES);
 
 	/* initialize zonelists */
-	for (i = 0; i < MAX_NR_ZONES; i++) {
+	for (i = 0; i < GFP_ZONETYPES; i++) {
 		zonelist = pgdat->node_zonelists + i;
 		memset(zonelist, 0, sizeof(*zonelist));
 		zonelist->zones[0] = NULL;
@@ -1290,7 +1250,7 @@ static void __init build_zonelists(pg_data_t *pgdat)
 			node_load[node] += load;
 		prev_node = node;
 		load--;
-		for (i = 0; i < MAX_NR_ZONES; i++) {
+		for (i = 0; i < GFP_ZONETYPES; i++) {
 			zonelist = pgdat->node_zonelists + i;
 			for (j = 0; zonelist->zones[j] != NULL; j++);
 
@@ -1313,7 +1273,7 @@ static void __init build_zonelists(pg_data_t *pgdat)
 	int i, j, k, node, local_node;
 
 	local_node = pgdat->node_id;
-	for (i = 0; i < MAX_NR_ZONES; i++) {
+	for (i = 0; i < GFP_ZONETYPES; i++) {
 		struct zonelist *zonelist;
 
 		zonelist = pgdat->node_zonelists + i;
@@ -1414,7 +1374,7 @@ static void __init calculate_zone_totalpages(struct pglist_data *pgdat,
 		for (i = 0; i < MAX_NR_ZONES; i++)
 			realtotalpages -= zholes_size[i];
 	pgdat->node_present_pages = realtotalpages;
-	printk("On node %d totalpages: %lu\n", pgdat->node_id, realtotalpages);
+	printk(KERN_DEBUG "On node %d totalpages: %lu\n", pgdat->node_id, realtotalpages);
 }
 
 
@@ -1435,7 +1395,7 @@ void __init memmap_init_zone(struct page *start, unsigned long size, int nid,
 		INIT_LIST_HEAD(&page->lru);
 #ifdef WANT_PAGE_VIRTUAL
 		/* The shift won't overflow because ZONE_NORMAL is below 4G. */
-		if (zone != ZONE_HIGHMEM)
+		if (!is_highmem_idx(zone))
 			set_page_address(page, __va(start_pfn << PAGE_SHIFT));
 #endif
 		start_pfn++;
@@ -1475,6 +1435,10 @@ static void __init free_area_init_core(struct pglist_data *pgdat,
 		if (zholes_size)
 			realsize -= zholes_size[j];
 
+		if (j == ZONE_DMA || j == ZONE_NORMAL)
+			nr_kernel_pages += realsize;
+		nr_all_pages += realsize;
+
 		zone->spanned_pages = size;
 		zone->present_pages = realsize;
 		zone->name = zone_names[j];
@@ -1516,12 +1480,12 @@ static void __init free_area_init_core(struct pglist_data *pgdat,
 			pcp->batch = 1 * batch;
 			INIT_LIST_HEAD(&pcp->list);
 		}
-		printk("  %s zone: %lu pages, LIFO batch:%lu\n",
+		printk(KERN_DEBUG "  %s zone: %lu pages, LIFO batch:%lu\n",
 				zone_names[j], realsize, batch);
 		INIT_LIST_HEAD(&zone->active_list);
 		INIT_LIST_HEAD(&zone->inactive_list);
-		atomic_set(&zone->nr_scan_active, 0);
-		atomic_set(&zone->nr_scan_inactive, 0);
+		zone->nr_scan_active = 0;
+		zone->nr_scan_inactive = 0;
 		zone->nr_active = 0;
 		zone->nr_inactive = 0;
 		if (!size)
@@ -1869,7 +1833,7 @@ static void setup_per_zone_protection(void)
 		 * For each of the different allocation types:
 		 * GFP_DMA -> GFP_KERNEL -> GFP_HIGHMEM
 		 */
-		for (i = 0; i < MAX_NR_ZONES; i++) {
+		for (i = 0; i < GFP_ZONETYPES; i++) {
 			/*
 			 * For each of the zones:
 			 * ZONE_HIGHMEM -> ZONE_NORMAL -> ZONE_DMA
@@ -1995,9 +1959,9 @@ module_init(init_per_zone_pages_min)
  *	changes.
  */
 int min_free_kbytes_sysctl_handler(ctl_table *table, int write, 
-		struct file *file, void __user *buffer, size_t *length)
+		struct file *file, void __user *buffer, size_t *length, loff_t *ppos)
 {
-	proc_dointvec(table, write, file, buffer, length);
+	proc_dointvec(table, write, file, buffer, length, ppos);
 	setup_per_zone_pages_min();
 	setup_per_zone_protection();
 	return 0;
@@ -2009,9 +1973,75 @@ int min_free_kbytes_sysctl_handler(ctl_table *table, int write,
  *	whenever sysctl_lower_zone_protection changes.
  */
 int lower_zone_protection_sysctl_handler(ctl_table *table, int write,
-		 struct file *file, void __user *buffer, size_t *length)
+		 struct file *file, void __user *buffer, size_t *length, loff_t *ppos)
 {
-	proc_dointvec_minmax(table, write, file, buffer, length);
+	proc_dointvec_minmax(table, write, file, buffer, length, ppos);
 	setup_per_zone_protection();
 	return 0;
 }
+
+/*
+ * allocate a large system hash table from bootmem
+ * - it is assumed that the hash table must contain an exact power-of-2
+ *   quantity of entries
+ */
+void *__init alloc_large_system_hash(const char *tablename,
+				     unsigned long bucketsize,
+				     unsigned long numentries,
+				     int scale,
+				     int consider_highmem,
+				     unsigned int *_hash_shift,
+				     unsigned int *_hash_mask)
+{
+	unsigned long mem, max, log2qty, size;
+	void *table;
+
+	/* round applicable memory size up to nearest megabyte */
+	mem = consider_highmem ? nr_all_pages : nr_kernel_pages;
+	mem += (1UL << (20 - PAGE_SHIFT)) - 1;
+	mem >>= 20 - PAGE_SHIFT;
+	mem <<= 20 - PAGE_SHIFT;
+
+	/* limit to 1 bucket per 2^scale bytes of low memory (rounded up to
+	 * nearest power of 2 in size) */
+	if (scale > PAGE_SHIFT)
+		mem >>= (scale - PAGE_SHIFT);
+	else
+		mem <<= (PAGE_SHIFT - scale);
+
+	mem = 1UL << (long_log2(mem) + 1);
+
+	/* limit allocation size */
+	max = (1UL << (PAGE_SHIFT + MAX_SYS_HASH_TABLE_ORDER)) / bucketsize;
+	if (max > mem)
+		max = mem;
+
+	/* allow the kernel cmdline to have a say */
+	if (!numentries || numentries > max)
+		numentries = max;
+
+	log2qty = long_log2(numentries);
+
+	do {
+		size = bucketsize << log2qty;
+
+		table = (void *) alloc_bootmem(size);
+
+	} while (!table && size > PAGE_SIZE);
+
+	if (!table)
+		panic("Failed to allocate %s hash table\n", tablename);
+
+	printk("%s hash table entries: %d (order: %d, %lu bytes)\n",
+	       tablename,
+	       (1U << log2qty),
+	       long_log2(size) - PAGE_SHIFT,
+	       size);
+
+	if (_hash_shift)
+		*_hash_shift = log2qty;
+	if (_hash_mask)
+		*_hash_mask = (1 << log2qty) - 1;
+
+	return table;
+}
diff --git a/mm/readahead.c b/mm/readahead.c
index 972395626..7073392b3 100644
--- a/mm/readahead.c
+++ b/mm/readahead.c
@@ -349,7 +349,6 @@ page_cache_readahead(struct address_space *mapping, struct file_ra_state *ra,
 			struct file *filp, unsigned long offset)
 {
 	unsigned max;
-	unsigned min;
 	unsigned orig_next_size;
 	unsigned actual;
 	int first_access=0;
@@ -374,7 +373,6 @@ page_cache_readahead(struct address_space *mapping, struct file_ra_state *ra,
 	if (max == 0)
 		goto out;	/* No readahead */
 
-	min = get_min_readahead(ra);
 	orig_next_size = ra->next_size;
 
 	if (ra->next_size == 0) {
@@ -470,7 +468,11 @@ do_io:
 			  * pages shall be accessed in the next
 			  * current window.
 			  */
-			ra->next_size = min(ra->average , (unsigned long)max);
+			average = ra->average;
+			if (ra->serial_cnt > average)
+				average = (ra->serial_cnt + ra->average + 1) / 2;
+
+			ra->next_size = min(average , (unsigned long)max);
 		}
 		ra->start = offset;
 		ra->size = ra->next_size;
@@ -552,6 +554,7 @@ void handle_ra_miss(struct address_space *mapping,
 				ra->size = max;
 				ra->ahead_start = 0;
 				ra->ahead_size = 0;
+				ra->average = max / 2;
 			}
 		}
 		ra->prev_page = offset;
diff --git a/mm/rmap.c b/mm/rmap.c
index 2dae0a82e..c8e236e58 100644
--- a/mm/rmap.c
+++ b/mm/rmap.c
@@ -18,14 +18,11 @@
  */
 
 /*
- * Locking:
- * - the page->mapcount field is protected by the PG_maplock bit,
- *   which nests within the mm->page_table_lock,
- *   which nests within the page lock.
- * - because swapout locking is opposite to the locking order
- *   in the page fault path, the swapout path uses trylocks
- *   on the mm->page_table_lock
+ * Locking: see "Lock ordering" summary in filemap.c.
+ * In swapout, page_map_lock is held on entry to page_referenced and
+ * try_to_unmap, so they trylock for i_mmap_lock and page_table_lock.
  */
+
 #include <linux/mm.h>
 #include <linux/pagemap.h>
 #include <linux/swap.h>
@@ -80,8 +77,12 @@ int anon_vma_prepare(struct vm_area_struct *vma)
 		/* page_table_lock to protect against threads */
 		spin_lock(&mm->page_table_lock);
 		if (likely(!vma->anon_vma)) {
+			if (!allocated)
+				spin_lock(&anon_vma->lock);
 			vma->anon_vma = anon_vma;
 			list_add(&vma->anon_vma_node, &anon_vma->head);
+			if (!allocated)
+				spin_unlock(&anon_vma->lock);
 			allocated = NULL;
 		}
 		spin_unlock(&mm->page_table_lock);
@@ -227,7 +228,7 @@ static int page_referenced_one(struct page *page,
 	if (page_to_pfn(page) != pte_pfn(*pte))
 		goto out_unmap;
 
-	if (ptep_test_and_clear_young(pte))
+	if (ptep_clear_flush_young(vma, address, pte))
 		referenced++;
 
 	(*mapcount)--;
@@ -466,7 +467,7 @@ static int try_to_unmap_one(struct page *page, struct vm_area_struct *vma)
 	 * skipped over this mm) then we should reactivate it.
 	 */
 	if ((vma->vm_flags & (VM_LOCKED|VM_RESERVED)) ||
-			ptep_test_and_clear_young(pte)) {
+			ptep_clear_flush_young(vma, address, pte)) {
 		ret = SWAP_FAIL;
 		goto out_unmap;
 	}
@@ -481,6 +482,10 @@ static int try_to_unmap_one(struct page *page, struct vm_area_struct *vma)
 	 * an exclusive swap page, do_wp_page will replace it by a copy
 	 * page, and the user never get to see the data GUP was holding
 	 * the original page for.
+	 *
+	 * This test is also useful for when swapoff (unuse_process) has
+	 * to drop page lock: its reference to the page stops existing
+	 * ptes from being unmapped, so swapoff can make progress.
 	 */
 	if (PageSwapCache(page) &&
 	    page_count(page) != page->mapcount + 2) {
@@ -594,7 +599,7 @@ static int try_to_unmap_cluster(unsigned long cursor,
 		if (PageReserved(page))
 			continue;
 
-		if (ptep_test_and_clear_young(pte))
+		if (ptep_clear_flush_young(vma, address, pte))
 			continue;
 
 		/* Nuke the page table entry. */
@@ -742,7 +747,7 @@ static inline int try_to_unmap_file(struct page *page)
 	list_for_each_entry(vma, &mapping->i_mmap_nonlinear,
 						shared.vm_set.list) {
 		if (!(vma->vm_flags & VM_RESERVED))
-			vma->vm_private_data = 0;
+			vma->vm_private_data = NULL;
 	}
 relock:
 	page_map_lock(page);
diff --git a/mm/shmem.c b/mm/shmem.c
index 5a6d56a45..57f861722 100644
--- a/mm/shmem.c
+++ b/mm/shmem.c
@@ -40,12 +40,12 @@
 #include <linux/security.h>
 #include <linux/swapops.h>
 #include <linux/mempolicy.h>
+#include <linux/namei.h>
 #include <asm/uaccess.h>
 #include <asm/div64.h>
 #include <asm/pgtable.h>
 
 /* This magic number is used in glibc for posix shared memory */
-#define TMPFS_MAGIC	0x01021994
 
 #define ENTRIES_PER_PAGE (PAGE_CACHE_SIZE/sizeof(unsigned long))
 #define ENTRIES_PER_PAGEPAGE (ENTRIES_PER_PAGE*ENTRIES_PER_PAGE)
@@ -103,23 +103,25 @@ static inline void shmem_dir_unmap(struct page **dir)
 }
 
 static swp_entry_t *shmem_swp_map(struct page *page)
+{
+	return (swp_entry_t *)kmap_atomic(page, KM_USER1);
+}
+
+static inline void shmem_swp_balance_unmap(void)
 {
 	/*
-	 * We have to avoid the unconditional inc_preempt_count()
-	 * in kmap_atomic(), since shmem_swp_unmap() will also be
-	 * applied to the low memory addresses within i_direct[].
-	 * PageHighMem and high_memory tests are good for all arches
-	 * and configs: highmem_start_page and FIXADDR_START are not.
+	 * When passing a pointer to an i_direct entry, to code which
+	 * also handles indirect entries and so will shmem_swp_unmap,
+	 * we must arrange for the preempt count to remain in balance.
+	 * What kmap_atomic of a lowmem page does depends on config
+	 * and architecture, so pretend to kmap_atomic some lowmem page.
 	 */
-	return PageHighMem(page)?
-		(swp_entry_t *)kmap_atomic(page, KM_USER1):
-		(swp_entry_t *)page_address(page);
+	(void) kmap_atomic(ZERO_PAGE(0), KM_USER1);
 }
 
 static inline void shmem_swp_unmap(swp_entry_t *entry)
 {
-	if (entry >= (swp_entry_t *)high_memory)
-		kunmap_atomic(entry, KM_USER1);
+	kunmap_atomic(entry, KM_USER1);
 }
 
 static inline struct shmem_sb_info *SHMEM_SB(struct super_block *sb)
@@ -262,8 +264,10 @@ static swp_entry_t *shmem_swp_entry(struct shmem_inode_info *info, unsigned long
 	struct page **dir;
 	struct page *subdir;
 
-	if (index < SHMEM_NR_DIRECT)
+	if (index < SHMEM_NR_DIRECT) {
+		shmem_swp_balance_unmap();
 		return info->i_direct+index;
+	}
 	if (!info->i_indirect) {
 		if (page) {
 			info->i_indirect = *page;
@@ -305,17 +309,7 @@ static swp_entry_t *shmem_swp_entry(struct shmem_inode_info *info, unsigned long
 		*page = NULL;
 	}
 	shmem_dir_unmap(dir);
-
-	/*
-	 * With apologies... caller shmem_swp_alloc passes non-NULL
-	 * page (though perhaps NULL *page); and now we know that this
-	 * indirect page has been allocated, we can shortcut the final
-	 * kmap if we know it contains no swap entries, as is commonly
-	 * the case: return pointer to a 0 which doesn't need kmapping.
-	 */
-	return (page && !subdir->nr_swapped)?
-		(swp_entry_t *)&subdir->nr_swapped:
-		shmem_swp_map(subdir) + offset;
+	return shmem_swp_map(subdir) + offset;
 }
 
 static void shmem_swp_set(struct shmem_inode_info *info, swp_entry_t *entry, unsigned long value)
@@ -342,7 +336,6 @@ static swp_entry_t *shmem_swp_alloc(struct shmem_inode_info *info, unsigned long
 	struct shmem_sb_info *sbinfo = SHMEM_SB(inode->i_sb);
 	struct page *page = NULL;
 	swp_entry_t *entry;
-	static const swp_entry_t unswapped = { 0 };
 
 	if (sgp != SGP_WRITE &&
 	    ((loff_t) index << PAGE_CACHE_SHIFT) >= i_size_read(inode))
@@ -350,7 +343,7 @@ static swp_entry_t *shmem_swp_alloc(struct shmem_inode_info *info, unsigned long
 
 	while (!(entry = shmem_swp_entry(info, index, &page))) {
 		if (sgp == SGP_READ)
-			return (swp_entry_t *) &unswapped;
+			return shmem_swp_map(ZERO_PAGE(0));
 		/*
 		 * Test free_blocks against 1 not 0, since we have 1 data
 		 * page (and perhaps indirect index pages) yet to allocate:
@@ -649,8 +642,10 @@ static int shmem_unuse_inode(struct shmem_inode_info *info, swp_entry_t entry, s
 	if (size > SHMEM_NR_DIRECT)
 		size = SHMEM_NR_DIRECT;
 	offset = shmem_find_swp(entry, ptr, ptr+size);
-	if (offset >= 0)
+	if (offset >= 0) {
+		shmem_swp_balance_unmap();
 		goto found;
+	}
 	if (!info->i_indirect)
 		goto lost2;
 	/* we might be racing with shmem_truncate */
@@ -1125,15 +1120,9 @@ static int shmem_populate(struct vm_area_struct *vma,
 				return err;
 			}
 		} else if (nonblock) {
-	    		/*
-		 	 * If a nonlinear mapping then store the file page
-			 * offset in the pte.
-			 */
-			if (pgoff != linear_page_index(vma, addr)) {
-	    			err = install_file_pte(mm, vma, addr, pgoff, prot);
-				if (err)
-		    			return err;
-			}
+    			err = install_file_pte(mm, vma, addr, pgoff, prot);
+			if (err)
+	    			return err;
 		}
 
 		len -= PAGE_SIZE;
@@ -1477,7 +1466,7 @@ static ssize_t shmem_file_read(struct file *filp, char __user *buf, size_t count
 
 	desc.written = 0;
 	desc.count = count;
-	desc.buf = buf;
+	desc.arg.buf = buf;
 	desc.error = 0;
 
 	do_shmem_file_read(filp, ppos, &desc, file_read_actor);
@@ -1487,7 +1476,7 @@ static ssize_t shmem_file_read(struct file *filp, char __user *buf, size_t count
 }
 
 static ssize_t shmem_file_sendfile(struct file *in_file, loff_t *ppos,
-			 size_t count, read_actor_t actor, void __user *target)
+			 size_t count, read_actor_t actor, void *target)
 {
 	read_descriptor_t desc;
 
@@ -1496,7 +1485,7 @@ static ssize_t shmem_file_sendfile(struct file *in_file, loff_t *ppos,
 
 	desc.written = 0;
 	desc.count = count;
-	desc.buf = target;
+	desc.arg.data = target;
 	desc.error = 0;
 
 	do_shmem_file_read(in_file, ppos, &desc, actor);
@@ -1509,7 +1498,7 @@ static int shmem_statfs(struct super_block *sb, struct kstatfs *buf)
 {
 	struct shmem_sb_info *sbinfo = SHMEM_SB(sb);
 
-	buf->f_type = TMPFS_MAGIC;
+	buf->f_type = TMPFS_SUPER_MAGIC;
 	buf->f_bsize = PAGE_CACHE_SIZE;
 	spin_lock(&sbinfo->stat_lock);
 	buf->f_blocks = sbinfo->max_blocks;
@@ -1676,51 +1665,45 @@ static int shmem_symlink(struct inode *dir, struct dentry *dentry, const char *s
 	return 0;
 }
 
-static int shmem_readlink_inline(struct dentry *dentry, char __user *buffer, int buflen)
-{
-	return vfs_readlink(dentry, buffer, buflen, (const char *)SHMEM_I(dentry->d_inode));
-}
-
 static int shmem_follow_link_inline(struct dentry *dentry, struct nameidata *nd)
 {
-	return vfs_follow_link(nd, (const char *)SHMEM_I(dentry->d_inode));
+	nd_set_link(nd, (char *)SHMEM_I(dentry->d_inode));
+	return 0;
 }
 
-static int shmem_readlink(struct dentry *dentry, char __user *buffer, int buflen)
+static int shmem_follow_link(struct dentry *dentry, struct nameidata *nd)
 {
 	struct page *page = NULL;
 	int res = shmem_getpage(dentry->d_inode, 0, &page, SGP_READ, NULL);
-	if (res)
-		return res;
-	res = vfs_readlink(dentry, buffer, buflen, kmap(page));
-	kunmap(page);
-	mark_page_accessed(page);
-	page_cache_release(page);
-	return res;
+	nd_set_link(nd, res ? ERR_PTR(res) : kmap(page));
+	return 0;
 }
 
-static int shmem_follow_link(struct dentry *dentry, struct nameidata *nd)
+static void shmem_put_link(struct dentry *dentry, struct nameidata *nd)
 {
-	struct page *page = NULL;
-	int res = shmem_getpage(dentry->d_inode, 0, &page, SGP_READ, NULL);
-	if (res)
-		return res;
-	res = vfs_follow_link(nd, kmap(page));
-	kunmap(page);
-	mark_page_accessed(page);
-	page_cache_release(page);
-	return res;
+	if (!IS_ERR(nd_get_link(nd))) {
+		struct page *page;
+
+		page = find_get_page(dentry->d_inode->i_mapping, 0);
+		if (!page)
+			BUG();
+		kunmap(page);
+		mark_page_accessed(page);
+		page_cache_release(page);
+		page_cache_release(page);
+	}
 }
 
 static struct inode_operations shmem_symlink_inline_operations = {
-	.readlink	= shmem_readlink_inline,
+	.readlink	= generic_readlink,
 	.follow_link	= shmem_follow_link_inline,
 };
 
 static struct inode_operations shmem_symlink_inode_operations = {
 	.truncate	= shmem_truncate,
-	.readlink	= shmem_readlink,
+	.readlink	= generic_readlink,
 	.follow_link	= shmem_follow_link,
+	.put_link	= shmem_put_link,
 };
 
 static int shmem_parse_options(char *options, int *mode, uid_t *uid, gid_t *gid, unsigned long *blocks, unsigned long *inodes)
@@ -1845,7 +1828,7 @@ static int shmem_fill_super(struct super_block *sb,
 	sb->s_maxbytes = SHMEM_MAX_BYTES;
 	sb->s_blocksize = PAGE_CACHE_SIZE;
 	sb->s_blocksize_bits = PAGE_CACHE_SHIFT;
-	sb->s_magic = TMPFS_MAGIC;
+	sb->s_magic = TMPFS_SUPER_MAGIC;
 	sb->s_op = &shmem_ops;
 	inode = shmem_get_inode(sb, S_IFDIR | mode, 0);
 	if (!inode)
diff --git a/mm/slab.c b/mm/slab.c
index 45c5c0549..34d9e5b5e 100644
--- a/mm/slab.c
+++ b/mm/slab.c
@@ -129,6 +129,10 @@
 #define ARCH_KMALLOC_MINALIGN 0
 #endif
 
+#ifndef ARCH_KMALLOC_FLAGS
+#define ARCH_KMALLOC_FLAGS SLAB_HWCACHE_ALIGN
+#endif
+
 /* Legal flag mask for kmem_cache_create(). */
 #if DEBUG
 # define CREATE_MASK	(SLAB_DEBUG_INITIAL | SLAB_RED_ZONE | \
@@ -380,12 +384,12 @@ struct kmem_cache_s {
  * cachep->objsize - 2* BYTES_PER_WORD: redzone word [BYTES_PER_WORD long]
  * cachep->objsize - 1* BYTES_PER_WORD: last caller address [BYTES_PER_WORD long]
  */
-static inline int obj_dbghead(kmem_cache_t *cachep)
+static int obj_dbghead(kmem_cache_t *cachep)
 {
 	return cachep->dbghead;
 }
 
-static inline int obj_reallen(kmem_cache_t *cachep)
+static int obj_reallen(kmem_cache_t *cachep)
 {
 	return cachep->reallen;
 }
@@ -409,30 +413,15 @@ static void **dbg_userword(kmem_cache_t *cachep, void *objp)
 	BUG_ON(!(cachep->flags & SLAB_STORE_USER));
 	return (void**)(objp+cachep->objsize-BYTES_PER_WORD);
 }
+
 #else
-static inline int obj_dbghead(kmem_cache_t *cachep)
-{
-	return 0;
-}
-static inline int obj_reallen(kmem_cache_t *cachep)
-{
-	return cachep->objsize;
-}
-static inline unsigned long *dbg_redzone1(kmem_cache_t *cachep, void *objp)
-{
-	BUG();
-	return 0;
-}
-static inline unsigned long *dbg_redzone2(kmem_cache_t *cachep, void *objp)
-{
-	BUG();
-	return 0;
-}
-static inline void **dbg_userword(kmem_cache_t *cachep, void *objp)
-{
-	BUG();
-	return 0;
-}
+
+#define obj_dbghead(x)			0
+#define obj_reallen(cachep)		(cachep->objsize)
+#define dbg_redzone1(cachep, objp)	({BUG(); (unsigned long *)NULL;})
+#define dbg_redzone2(cachep, objp)	({BUG(); (unsigned long *)NULL;})
+#define dbg_userword(cachep, objp)	({BUG(); (void **)NULL;})
+
 #endif
 
 /*
@@ -485,7 +474,7 @@ struct cache_names {
 static struct cache_names __initdata cache_names[] = {
 #define CACHE(x) { .name = "size-" #x, .name_dma = "size-" #x "(DMA)" },
 #include <linux/kmalloc_sizes.h>
-	{ 0, }
+	{ NULL, }
 #undef CACHE
 };
 
@@ -758,7 +747,7 @@ void __init kmem_cache_init(void)
 		 * allow tighter packing of the smaller caches. */
 		sizes->cs_cachep = kmem_cache_create(names->name,
 			sizes->cs_size, ARCH_KMALLOC_MINALIGN,
-			SLAB_PANIC, NULL, NULL);
+			(ARCH_KMALLOC_FLAGS | SLAB_PANIC), NULL, NULL);
 
 		/* Inc off-slab bufctl limit until the ceiling is hit. */
 		if (!(OFF_SLAB(sizes->cs_cachep))) {
@@ -768,7 +757,8 @@ void __init kmem_cache_init(void)
 
 		sizes->cs_dmacachep = kmem_cache_create(names->name_dma,
 			sizes->cs_size, ARCH_KMALLOC_MINALIGN,
-			(SLAB_CACHE_DMA | SLAB_PANIC), NULL, NULL);
+			(ARCH_KMALLOC_FLAGS | SLAB_CACHE_DMA | SLAB_PANIC),
+			NULL, NULL);
 
 		sizes++;
 		names++;
@@ -874,7 +864,7 @@ static void *kmem_getpages(kmem_cache_t *cachep, int flags, int nodeid)
 /*
  * Interface to system's page release.
  */
-static inline void kmem_freepages(kmem_cache_t *cachep, void *addr)
+static void kmem_freepages(kmem_cache_t *cachep, void *addr)
 {
 	unsigned long i = (1<<cachep->gfporder);
 	struct page *page = virt_to_page(addr);
@@ -1116,8 +1106,9 @@ static void slab_destroy (kmem_cache_t *cachep, struct slab *slabp)
  * %SLAB_NO_REAP - Don't automatically reap this cache when we're under
  * memory pressure.
  *
- * %SLAB_HWCACHE_ALIGN - This flag has no effect and will be removed soon.
- *
+ * %SLAB_HWCACHE_ALIGN - Align the objects in this cache to a hardware
+ * cacheline.  This can be beneficial if you're counting cycles as closely
+ * as davem.
  */
 kmem_cache_t *
 kmem_cache_create (const char *name, size_t size, size_t align,
@@ -1134,8 +1125,7 @@ kmem_cache_create (const char *name, size_t size, size_t align,
 		in_interrupt() ||
 		(size < BYTES_PER_WORD) ||
 		(size > (1<<MAX_OBJ_ORDER)*PAGE_SIZE) ||
-		(dtor && !ctor) ||
-		(align < 0)) {
+		(dtor && !ctor)) {
 			printk(KERN_ERR "%s: Early error in slab %s\n",
 					__FUNCTION__, name);
 			BUG();
@@ -1407,27 +1397,29 @@ opps:
 }
 EXPORT_SYMBOL(kmem_cache_create);
 
-static inline void check_irq_off(void)
-{
 #if DEBUG
+static void check_irq_off(void)
+{
 	BUG_ON(!irqs_disabled());
-#endif
 }
 
-static inline void check_irq_on(void)
+static void check_irq_on(void)
 {
-#if DEBUG
 	BUG_ON(irqs_disabled());
-#endif
 }
 
-static inline void check_spinlock_acquired(kmem_cache_t *cachep)
+static void check_spinlock_acquired(kmem_cache_t *cachep)
 {
 #ifdef CONFIG_SMP
 	check_irq_off();
 	BUG_ON(spin_trylock(&cachep->spinlock));
 #endif
 }
+#else
+#define check_irq_off()	do { } while(0)
+#define check_irq_on()	do { } while(0)
+#define check_spinlock_acquired(x) do { } while(0)
+#endif
 
 /*
  * Waits for all CPUs to execute func().
@@ -1590,7 +1582,7 @@ int kmem_cache_destroy (kmem_cache_t * cachep)
 EXPORT_SYMBOL(kmem_cache_destroy);
 
 /* Get the memory for a slab management obj. */
-static inline struct slab* alloc_slabmgmt (kmem_cache_t *cachep,
+static struct slab* alloc_slabmgmt (kmem_cache_t *cachep,
 			void *objp, int colour_off, int local_flags)
 {
 	struct slab *slabp;
@@ -1773,15 +1765,16 @@ failed:
 	return 0;
 }
 
+#if DEBUG
+
 /*
  * Perform extra freeing checks:
  * - detect bad pointers.
  * - POISON/RED_ZONE checking
  * - destructor calls, for caches with POISON+dtor
  */
-static inline void kfree_debugcheck(const void *objp)
+static void kfree_debugcheck(const void *objp)
 {
-#if DEBUG
 	struct page *page;
 
 	if (!virt_addr_valid(objp)) {
@@ -1794,12 +1787,10 @@ static inline void kfree_debugcheck(const void *objp)
 		printk(KERN_ERR "kfree_debugcheck: bad ptr %lxh.\n", (unsigned long)objp);
 		BUG();
 	}
-#endif 
 }
 
-static inline void *cache_free_debugcheck (kmem_cache_t * cachep, void * objp, void *caller)
+static void *cache_free_debugcheck (kmem_cache_t * cachep, void * objp, void *caller)
 {
-#if DEBUG
 	struct page *page;
 	unsigned int objnr;
 	struct slab *slabp;
@@ -1861,13 +1852,11 @@ static inline void *cache_free_debugcheck (kmem_cache_t * cachep, void * objp, v
 		poison_obj(cachep, objp, POISON_FREE);
 #endif
 	}
-#endif
 	return objp;
 }
 
-static inline void check_slabp(kmem_cache_t *cachep, struct slab *slabp)
+static void check_slabp(kmem_cache_t *cachep, struct slab *slabp)
 {
-#if DEBUG
 	int i;
 	int entries = 0;
 	
@@ -1891,8 +1880,12 @@ bad:
 		printk("\n");
 		BUG();
 	}
-#endif
 }
+#else
+#define kfree_debugcheck(x) do { } while(0)
+#define cache_free_debugcheck(x,objp,z) (objp)
+#define check_slabp(x,y) do { } while(0)
+#endif
 
 static void* cache_alloc_refill(kmem_cache_t* cachep, int flags)
 {
@@ -1999,11 +1992,11 @@ cache_alloc_debugcheck_before(kmem_cache_t *cachep, int flags)
 #endif
 }
 
-static inline void *
+#if DEBUG
+static void *
 cache_alloc_debugcheck_after(kmem_cache_t *cachep,
 			unsigned long flags, void *objp, void *caller)
 {
-#if DEBUG
 	if (!objp)	
 		return objp;
  	if (cachep->flags & SLAB_POISON) {
@@ -2039,9 +2032,11 @@ cache_alloc_debugcheck_after(kmem_cache_t *cachep,
 
 		cachep->ctor(objp, cachep, ctor_flags);
 	}	
-#endif
 	return objp;
 }
+#else
+#define cache_alloc_debugcheck_after(a,b,objp,d) (objp)
+#endif
 
 
 static inline void * __cache_alloc (kmem_cache_t *cachep, int flags)
@@ -2687,7 +2682,7 @@ static void drain_array_locked(kmem_cache_t *cachep,
  * If we cannot acquire the cache chain semaphore then just give up - we'll
  * try again next timer interrupt.
  */
-static inline void cache_reap (void)
+static void cache_reap (void)
 {
 	struct list_head *walk;
 
@@ -2838,8 +2833,6 @@ static int s_show(struct seq_file *m, void *p)
 	unsigned long	num_slabs;
 	const char *name; 
 	char *error = NULL;
-	mm_segment_t old_fs;
-	char tmp; 
 
 	check_irq_on();
 	spin_lock_irq(&cachep->spinlock);
@@ -2873,17 +2866,6 @@ static int s_show(struct seq_file *m, void *p)
 		error = "free_objects accounting error";
 
 	name = cachep->name; 
-
-	/*
-	 * Check to see if `name' resides inside a module which has been
-	 * unloaded (someone forgot to destroy their cache)
-	 */
-	old_fs = get_fs();
-	set_fs(KERNEL_DS);
-	if (__get_user(tmp, name)) 
-		name = "broken"; 
-	set_fs(old_fs);
-
 	if (error)
 		printk(KERN_ERR "slab: cache %s error: %s\n", name, error);
 
diff --git a/mm/swap.c b/mm/swap.c
index 75e93e201..7771d2803 100644
--- a/mm/swap.c
+++ b/mm/swap.c
@@ -7,7 +7,7 @@
 /*
  * This file contains the default values for the opereation of the
  * Linux VM subsystem. Fine-tuning documentation can be found in
- * linux/Documentation/sysctl/vm.txt.
+ * Documentation/sysctl/vm.txt.
  * Started 18.12.91
  * Swap aging added 23.2.95, Stephen Tweedie.
  * Buffermem limits added 12.3.98, Rik van Riel.
diff --git a/mm/swapfile.c b/mm/swapfile.c
index fce4cd466..89bc19ef3 100644
--- a/mm/swapfile.c
+++ b/mm/swapfile.c
@@ -30,10 +30,11 @@
 #include <asm/tlbflush.h>
 #include <linux/swapops.h>
 #include <linux/vs_base.h>
+#include <linux/vs_memory.h>
 
 spinlock_t swaplock = SPIN_LOCK_UNLOCKED;
 unsigned int nr_swapfiles;
-int total_swap_pages;
+long total_swap_pages;
 static int swap_overflow;
 
 EXPORT_SYMBOL(total_swap_pages);
@@ -111,7 +112,7 @@ static inline int scan_swap_map(struct swap_info_struct *si)
  check_next_cluster:
 	if (offset+SWAPFILE_CLUSTER-1 <= si->highest_bit)
 	{
-		int nr;
+		unsigned long nr;
 		for (nr = offset; nr < offset+SWAPFILE_CLUSTER; nr++)
 			if (si->swap_map[nr])
 			{
@@ -469,6 +470,13 @@ static unsigned long unuse_pmd(struct vm_area_struct * vma, pmd_t *dir,
 		if (unlikely(pte_same(*pte, swp_pte))) {
 			unuse_pte(vma, offset + address, pte, entry, page);
 			pte_unmap(pte);
+
+			/*
+			 * Move the page to the active list so it is not
+			 * immediately swapped out again after swapon.
+			 */
+			activate_page(page);
+
 			/* add 1 since address may be 0 */
 			return 1 + offset + address;
 		}
@@ -543,7 +551,15 @@ static int unuse_process(struct mm_struct * mm,
 	/*
 	 * Go through process' page directory.
 	 */
-	down_read(&mm->mmap_sem);
+	if (!down_read_trylock(&mm->mmap_sem)) {
+		/*
+		 * Our reference to the page stops try_to_unmap_one from
+		 * unmapping its ptes, so swapoff can make progress.
+		 */
+		unlock_page(page);
+		down_read(&mm->mmap_sem);
+		lock_page(page);
+	}
 	spin_lock(&mm->page_table_lock);
 	for (vma = mm->mmap; vma; vma = vma->vm_next) {
 		if (!is_vm_hugetlb_page(vma)) {
@@ -647,7 +663,7 @@ static int try_to_unuse(unsigned int type)
 	 * open() method called) - so swap entries may be invisible
 	 * to swapoff for a while, then reappear - but that is rare.
 	 */
-	while ((i = find_next_to_unuse(si, i))) {
+	while ((i = find_next_to_unuse(si, i)) != 0) {
 		if (signal_pending(current)) {
 			retval = -EINTR;
 			break;
@@ -1067,6 +1083,7 @@ asmlinkage long sys_swapoff(const char __user * specialfile)
 	unsigned short *swap_map;
 	struct file *swap_file, *victim;
 	struct address_space *mapping;
+	struct inode *inode;
 	char * pathname;
 	int i, type, prev;
 	int err;
@@ -1079,7 +1096,7 @@ asmlinkage long sys_swapoff(const char __user * specialfile)
 	if (IS_ERR(pathname))
 		goto out;
 
-	victim = filp_open(pathname, O_RDWR, 0);
+	victim = filp_open(pathname, O_RDWR|O_LARGEFILE, 0);
 	putname(pathname);
 	err = PTR_ERR(victim);
 	if (IS_ERR(victim))
@@ -1160,12 +1177,15 @@ asmlinkage long sys_swapoff(const char __user * specialfile)
 	swap_list_unlock();
 	up(&swapon_sem);
 	vfree(swap_map);
-	if (S_ISBLK(mapping->host->i_mode)) {
-		struct block_device *bdev = I_BDEV(mapping->host);
+	inode = mapping->host;
+	if (S_ISBLK(inode->i_mode)) {
+		struct block_device *bdev = I_BDEV(inode);
 		set_blocksize(bdev, p->old_block_size);
 		bd_release(bdev);
 	} else {
-		up(&mapping->host->i_sem);
+		down(&inode->i_sem);
+		inode->i_flags &= ~S_SWAPFILE;
+		up(&inode->i_sem);
 	}
 	filp_close(swap_file, NULL);
 	err = 0;
@@ -1284,7 +1304,7 @@ asmlinkage long sys_swapon(const char __user * specialfile, int swap_flags)
 	int i, prev;
 	int error;
 	static int least_priority;
-	union swap_header *swap_header = 0;
+	union swap_header *swap_header = NULL;
 	int swap_header_version;
 	int nr_good_pages = 0;
 	unsigned long maxpages = 1;
@@ -1345,7 +1365,7 @@ asmlinkage long sys_swapon(const char __user * specialfile, int swap_flags)
 		name = NULL;
 		goto bad_swap_2;
 	}
-	swap_file = filp_open(name, O_RDWR, 0);
+	swap_file = filp_open(name, O_RDWR|O_LARGEFILE, 0);
 	error = PTR_ERR(swap_file);
 	if (IS_ERR(swap_file)) {
 		swap_file = NULL;
@@ -1383,6 +1403,10 @@ asmlinkage long sys_swapon(const char __user * specialfile, int swap_flags)
 		p->bdev = inode->i_sb->s_bdev;
 		down(&inode->i_sem);
 		did_down = 1;
+		if (IS_SWAPFILE(inode)) {
+			error = -EBUSY;
+			goto bad_swap;
+		}
 	} else {
 		goto bad_swap;
 	}
@@ -1555,8 +1579,11 @@ out:
 	}
 	if (name)
 		putname(name);
-	if (error && did_down)
+	if (did_down) {
+		if (!error)
+			inode->i_flags |= S_SWAPFILE;
 		up(&inode->i_sem);
+	}
 	return error;
 }
 
diff --git a/mm/truncate.c b/mm/truncate.c
index 1dd32a204..c9a30ae62 100644
--- a/mm/truncate.c
+++ b/mm/truncate.c
@@ -243,6 +243,10 @@ EXPORT_SYMBOL(invalidate_inode_pages);
  * where the page is seen to be mapped into process pagetables.  In that case,
  * the page is marked clean but is left attached to its address_space.
  *
+ * The page is also marked not uptodate so that a subsequent pagefault will
+ * perform I/O to bringthe page's contents back into sync with its backing
+ * store.
+ *
  * FIXME: invalidate_inode_pages2() is probably trivially livelockable.
  */
 void invalidate_inode_pages2(struct address_space *mapping)
@@ -260,10 +264,12 @@ void invalidate_inode_pages2(struct address_space *mapping)
 			if (page->mapping == mapping) {	/* truncate race? */
 				wait_on_page_writeback(page);
 				next = page->index + 1;
-				if (page_mapped(page))
+				if (page_mapped(page)) {
 					clear_page_dirty(page);
-				else
+					ClearPageUptodate(page);
+				} else {
 					invalidate_complete_page(mapping, page);
+				}
 			}
 			unlock_page(page);
 		}
diff --git a/mm/vmalloc.c b/mm/vmalloc.c
index 16e6f88c2..a4c7c0a17 100644
--- a/mm/vmalloc.c
+++ b/mm/vmalloc.c
@@ -17,7 +17,6 @@
 #include <linux/vmalloc.h>
 
 #include <asm/uaccess.h>
-#include <asm/pgalloc.h>
 #include <asm/tlbflush.h>
 
 
@@ -200,7 +199,7 @@ struct vm_struct *__get_vm_area(unsigned long size, unsigned long flags,
 	}
 
 	write_lock(&vmlist_lock);
-	for (p = &vmlist; (tmp = *p) ;p = &tmp->next) {
+	for (p = &vmlist; (tmp = *p) != NULL ;p = &tmp->next) {
 		if ((unsigned long)tmp->addr < addr)
 			continue;
 		if ((size + addr) < addr)
@@ -261,7 +260,7 @@ struct vm_struct *remove_vm_area(void *addr)
 	struct vm_struct **p, *tmp;
 
 	write_lock(&vmlist_lock);
-	for (p = &vmlist ; (tmp = *p) ;p = &tmp->next) {
+	for (p = &vmlist ; (tmp = *p) != NULL ;p = &tmp->next) {
 		 if (tmp->addr == addr)
 			 goto found;
 	}
@@ -455,6 +454,28 @@ void *vmalloc(unsigned long size)
 
 EXPORT_SYMBOL(vmalloc);
 
+/**
+ *	vmalloc_exec  -  allocate virtually contiguous, executable memory
+ *
+ *	@size:		allocation size
+ *
+ *	Kernel-internal function to allocate enough pages to cover @size
+ *	the page level allocator and map them into contiguous and
+ *	executable kernel virtual space.
+ *
+ *	For tight cotrol over page level allocator and protection flags
+ *	use __vmalloc() instead.
+ */
+
+#ifndef PAGE_KERNEL_EXEC
+# define PAGE_KERNEL_EXEC PAGE_KERNEL
+#endif
+
+void *vmalloc_exec(unsigned long size)
+{
+	return __vmalloc(size, GFP_KERNEL | __GFP_HIGHMEM, PAGE_KERNEL_EXEC);
+}
+
 /**
  *	vmalloc_32  -  allocate virtually contiguous memory (32bit addressable)
  *
diff --git a/mm/vmscan.c b/mm/vmscan.c
index e5f0b0919..8e3b69342 100644
--- a/mm/vmscan.c
+++ b/mm/vmscan.c
@@ -33,17 +33,57 @@
 #include <linux/cpu.h>
 #include <linux/notifier.h>
 
-#include <asm/pgalloc.h>
 #include <asm/tlbflush.h>
 #include <asm/div64.h>
 
 #include <linux/swapops.h>
 
+/* possible outcome of pageout() */
+typedef enum {
+	/* failed to write page out, page is locked */
+	PAGE_KEEP,
+	/* move page to the active list, page is locked */
+	PAGE_ACTIVATE,
+	/* page has been sent to the disk successfully, page is unlocked */
+	PAGE_SUCCESS,
+	/* page is clean and locked */
+	PAGE_CLEAN,
+} pageout_t;
+
+struct scan_control {
+	/* Ask refill_inactive_zone, or shrink_cache to scan this many pages */
+	unsigned long nr_to_scan;
+
+	/* Incremented by the number of inactive pages that were scanned */
+	unsigned long nr_scanned;
+
+	/* Incremented by the number of pages reclaimed */
+	unsigned long nr_reclaimed;
+
+	unsigned long nr_mapped;	/* From page_state */
+
+	/* How many pages shrink_cache() should reclaim */
+	int nr_to_reclaim;
+
+	/* Ask shrink_caches, or shrink_zone to scan at this priority */
+	unsigned int priority;
+
+	/* This context's GFP mask */
+	unsigned int gfp_mask;
+
+	int may_writepage;
+};
+
 /*
- * From 0 .. 100.  Higher means more swappy.
+ * The list of shrinker callbacks used by to apply pressure to
+ * ageable caches.
  */
-int vm_swappiness = 60;
-static long total_memory;
+struct shrinker {
+	shrinker_t		shrinker;
+	struct list_head	list;
+	int			seeks;	/* seeks to recreate an obj */
+	long			nr;	/* objs pending delete */
+};
 
 #define lru_to_page(_head) (list_entry((_head)->prev, struct page, lru))
 
@@ -67,7 +107,7 @@ static long total_memory;
 		if ((_page)->lru.prev != _base) {			\
 			struct page *prev;				\
 									\
-			prev = lru_to_page(&(_page->lru));			\
+			prev = lru_to_page(&(_page->lru));		\
 			prefetchw(&prev->_field);			\
 		}							\
 	} while (0)
@@ -76,15 +116,10 @@ static long total_memory;
 #endif
 
 /*
- * The list of shrinker callbacks used by to apply pressure to
- * ageable caches.
+ * From 0 .. 100.  Higher means more swappy.
  */
-struct shrinker {
-	shrinker_t		shrinker;
-	struct list_head	list;
-	int			seeks;	/* seeks to recreate an obj */
-	long			nr;	/* objs pending delete */
-};
+int vm_swappiness = 60;
+static long total_memory;
 
 static LIST_HEAD(shrinker_list);
 static DECLARE_MUTEX(shrinker_sem);
@@ -107,7 +142,6 @@ struct shrinker *set_shrinker(int seeks, shrinker_t theshrinker)
 	}
 	return shrinker;
 }
-
 EXPORT_SYMBOL(set_shrinker);
 
 /*
@@ -120,7 +154,6 @@ void remove_shrinker(struct shrinker *shrinker)
 	up(&shrinker_sem);
 	kfree(shrinker);
 }
-
 EXPORT_SYMBOL(remove_shrinker);
  
 #define SHRINK_BATCH 128
@@ -136,22 +169,25 @@ EXPORT_SYMBOL(remove_shrinker);
  * slab to avoid swapping.
  *
  * We do weird things to avoid (scanned*seeks*entries) overflowing 32 bits.
+ *
+ * `lru_pages' represents the number of on-LRU pages in all the zones which
+ * are eligible for the caller's allocation attempt.  It is used for balancing
+ * slab reclaim versus page reclaim.
  */
-static int shrink_slab(unsigned long scanned, unsigned int gfp_mask)
+static int shrink_slab(unsigned long scanned, unsigned int gfp_mask,
+			unsigned long lru_pages)
 {
 	struct shrinker *shrinker;
-	long pages;
 
 	if (down_trylock(&shrinker_sem))
 		return 0;
 
-	pages = nr_used_zone_pages();
 	list_for_each_entry(shrinker, &shrinker_list, list) {
 		unsigned long long delta;
 
 		delta = (4 * scanned) / shrinker->seeks;
 		delta *= (*shrinker->shrinker)(0, gfp_mask);
-		do_div(delta, pages + 1);
+		do_div(delta, lru_pages + 1);
 		shrinker->nr += delta;
 		if (shrinker->nr < 0)
 			shrinker->nr = LONG_MAX;	/* It wrapped! */
@@ -240,18 +276,6 @@ static void handle_write_error(struct address_space *mapping,
 	unlock_page(page);
 }
 
-/* possible outcome of pageout() */
-typedef enum {
-	/* failed to write page out, page is locked */
-	PAGE_KEEP,
-	/* move page to the active list, page is locked */
-	PAGE_ACTIVATE,
-	/* page has been sent to the disk successfully, page is unlocked */
-	PAGE_SUCCESS,
-	/* page is clean and locked */
-	PAGE_CLEAN,
-} pageout_t;
-
 /*
  * pageout is called by shrink_list() for each dirty page. Calls ->writepage().
  */
@@ -311,27 +335,6 @@ static pageout_t pageout(struct page *page, struct address_space *mapping)
 	return PAGE_CLEAN;
 }
 
-struct scan_control {
-	/* Ask refill_inactive_zone, or shrink_cache to scan this many pages */
-	unsigned long nr_to_scan;
-
-	/* Incremented by the number of inactive pages that were scanned */
-	unsigned long nr_scanned;
-
-	/* Incremented by the number of pages reclaimed */
-	unsigned long nr_reclaimed;
-
-	unsigned long nr_mapped;	/* From page_state */
-
-	/* Ask shrink_caches, or shrink_zone to scan at this priority */
-	unsigned int priority;
-
-	/* This context's GFP mask */
-	unsigned int gfp_mask;
-
-	int may_writepage;
-};
-
 /*
  * shrink_list adds the number of reclaimed pages to sc->nr_reclaimed
  */
@@ -589,6 +592,7 @@ static void shrink_cache(struct zone *zone, struct scan_control *sc)
 		if (current_is_kswapd())
 			mod_page_state(kswapd_steal, nr_freed);
 		mod_page_state_zone(zone, pgsteal, nr_freed);
+		sc->nr_to_reclaim -= nr_freed;
 
 		spin_lock_irq(&zone->lru_lock);
 		/*
@@ -792,54 +796,50 @@ refill_inactive_zone(struct zone *zone, struct scan_control *sc)
 }
 
 /*
- * Scan `nr_pages' from this zone.  Returns the number of reclaimed pages.
  * This is a basic per-zone page freer.  Used by both kswapd and direct reclaim.
  */
 static void
 shrink_zone(struct zone *zone, struct scan_control *sc)
 {
-	unsigned long scan_active, scan_inactive;
-	int count;
-
-	scan_inactive = (zone->nr_active + zone->nr_inactive) >> sc->priority;
+	unsigned long nr_active;
+	unsigned long nr_inactive;
 
 	/*
-	 * Try to keep the active list 2/3 of the size of the cache.  And
-	 * make sure that refill_inactive is given a decent number of pages.
-	 *
-	 * The "scan_active + 1" here is important.  With pagecache-intensive
-	 * workloads the inactive list is huge, and `ratio' evaluates to zero
-	 * all the time.  Which pins the active list memory.  So we add one to
-	 * `scan_active' just to make sure that the kernel will slowly sift
-	 * through the active list.
+	 * Add one to `nr_to_scan' just to make sure that the kernel will
+	 * slowly sift through the active list.
 	 */
-	if (zone->nr_active >= 4*(zone->nr_inactive*2 + 1)) {
-		/* Don't scan more than 4 times the inactive list scan size */
-		scan_active = 4*scan_inactive;
-	} else {
-		unsigned long long tmp;
-
-		/* Cast to long long so the multiply doesn't overflow */
-
-		tmp = (unsigned long long)scan_inactive * zone->nr_active;
-		do_div(tmp, zone->nr_inactive*2 + 1);
-		scan_active = (unsigned long)tmp;
-	}
-
-	atomic_add(scan_active + 1, &zone->nr_scan_active);
-	count = atomic_read(&zone->nr_scan_active);
-	if (count >= SWAP_CLUSTER_MAX) {
-		atomic_set(&zone->nr_scan_active, 0);
-		sc->nr_to_scan = count;
-		refill_inactive_zone(zone, sc);
-	}
+	zone->nr_scan_active += (zone->nr_active >> sc->priority) + 1;
+	nr_active = zone->nr_scan_active;
+	if (nr_active >= SWAP_CLUSTER_MAX)
+		zone->nr_scan_active = 0;
+	else
+		nr_active = 0;
+
+	zone->nr_scan_inactive += (zone->nr_inactive >> sc->priority) + 1;
+	nr_inactive = zone->nr_scan_inactive;
+	if (nr_inactive >= SWAP_CLUSTER_MAX)
+		zone->nr_scan_inactive = 0;
+	else
+		nr_inactive = 0;
+
+	sc->nr_to_reclaim = SWAP_CLUSTER_MAX;
+
+	while (nr_active || nr_inactive) {
+		if (nr_active) {
+			sc->nr_to_scan = min(nr_active,
+					(unsigned long)SWAP_CLUSTER_MAX);
+			nr_active -= sc->nr_to_scan;
+			refill_inactive_zone(zone, sc);
+		}
 
-	atomic_add(scan_inactive, &zone->nr_scan_inactive);
-	count = atomic_read(&zone->nr_scan_inactive);
-	if (count >= SWAP_CLUSTER_MAX) {
-		atomic_set(&zone->nr_scan_inactive, 0);
-		sc->nr_to_scan = count;
-		shrink_cache(zone, sc);
+		if (nr_inactive) {
+			sc->nr_to_scan = min(nr_inactive,
+					(unsigned long)SWAP_CLUSTER_MAX);
+			nr_inactive -= sc->nr_to_scan;
+			shrink_cache(zone, sc);
+			if (sc->nr_to_reclaim <= 0)
+				break;
+		}
 	}
 }
 
@@ -899,6 +899,7 @@ int try_to_free_pages(struct zone **zones,
 	int total_scanned = 0, total_reclaimed = 0;
 	struct reclaim_state *reclaim_state = current->reclaim_state;
 	struct scan_control sc;
+	unsigned long lru_pages = 0;
 	int i;
 
 	sc.gfp_mask = gfp_mask;
@@ -906,8 +907,12 @@ int try_to_free_pages(struct zone **zones,
 
 	inc_page_state(allocstall);
 
-	for (i = 0; zones[i] != 0; i++)
-		zones[i]->temp_priority = DEF_PRIORITY;
+	for (i = 0; zones[i] != NULL; i++) {
+		struct zone *zone = zones[i];
+
+		zone->temp_priority = DEF_PRIORITY;
+		lru_pages += zone->nr_active + zone->nr_inactive;
+	}
 
 	for (priority = DEF_PRIORITY; priority >= 0; priority--) {
 		sc.nr_mapped = read_page_state(nr_mapped);
@@ -915,7 +920,7 @@ int try_to_free_pages(struct zone **zones,
 		sc.nr_reclaimed = 0;
 		sc.priority = priority;
 		shrink_caches(zones, &sc);
-		shrink_slab(sc.nr_scanned, gfp_mask);
+		shrink_slab(sc.nr_scanned, gfp_mask, lru_pages);
 		if (reclaim_state) {
 			sc.nr_reclaimed += reclaim_state->reclaimed_slab;
 			reclaim_state->reclaimed_slab = 0;
@@ -944,7 +949,7 @@ int try_to_free_pages(struct zone **zones,
 			blk_congestion_wait(WRITE, HZ/10);
 	}
 	if ((gfp_mask & __GFP_FS) && !(gfp_mask & __GFP_NORETRY))
-		out_of_memory();
+		out_of_memory(gfp_mask);
 out:
 	for (i = 0; zones[i] != 0; i++)
 		zones[i]->prev_priority = zones[i]->temp_priority;
@@ -1000,7 +1005,7 @@ static int balance_pgdat(pg_data_t *pgdat, int nr_pages)
 	for (priority = DEF_PRIORITY; priority >= 0; priority--) {
 		int all_zones_ok = 1;
 		int end_zone = 0;	/* Inclusive.  0 = ZONE_DMA */
-
+		unsigned long lru_pages = 0;
 
 		if (nr_pages == 0) {
 			/*
@@ -1024,6 +1029,12 @@ static int balance_pgdat(pg_data_t *pgdat, int nr_pages)
 			end_zone = pgdat->nr_zones - 1;
 		}
 scan:
+		for (i = 0; i <= end_zone; i++) {
+			struct zone *zone = pgdat->node_zones + i;
+
+			lru_pages += zone->nr_active + zone->nr_inactive;
+		}
+
 		/*
 		 * Now scan the zone in the dma->highmem direction, stopping
 		 * at the last zone which needs scanning.
@@ -1051,7 +1062,7 @@ scan:
 			sc.priority = priority;
 			shrink_zone(zone, &sc);
 			reclaim_state->reclaimed_slab = 0;
-			shrink_slab(sc.nr_scanned, GFP_KERNEL);
+			shrink_slab(sc.nr_scanned, GFP_KERNEL, lru_pages);
 			sc.nr_reclaimed += reclaim_state->reclaimed_slab;
 			total_reclaimed += sc.nr_reclaimed;
 			if (zone->all_unreclaimable)
@@ -1100,7 +1111,7 @@ out:
  * If there are applications that are active memory-allocators
  * (most normal use), this basically shouldn't matter.
  */
-int kswapd(void *p)
+static int kswapd(void *p)
 {
 	pg_data_t *pgdat = (pg_data_t*)p;
 	struct task_struct *tsk = current;
@@ -1139,6 +1150,7 @@ int kswapd(void *p)
 
 		balance_pgdat(pgdat, 0);
 	}
+	return 0;
 }
 
 /*
diff --git a/net/802/fc.c b/net/802/fc.c
index 7fa81023a..e7009186a 100644
--- a/net/802/fc.c
+++ b/net/802/fc.c
@@ -47,7 +47,7 @@ int fc_header(struct sk_buff *skb, struct net_device *dev, unsigned short type,
 	 */
 	if (type == ETH_P_IP || type == ETH_P_ARP)
 	{
-		struct fcllc *fcllc=(struct fcllc *)(fch+1);
+		struct fcllc *fcllc;
 
 		hdr_len = sizeof(struct fch_hdr) + sizeof(struct fcllc);
 		fch = (struct fch_hdr *)skb_push(skb, hdr_len);
diff --git a/net/802/tr.c b/net/802/tr.c
index 4f71bd37f..bd22ae2aa 100644
--- a/net/802/tr.c
+++ b/net/802/tr.c
@@ -110,7 +110,7 @@ int tr_header(struct sk_buff *skb, struct net_device *dev, unsigned short type,
 	 */
 	if (type == ETH_P_IP || type == ETH_P_IPV6 || type == ETH_P_ARP)
 	{
-		struct trllc *trllc=(struct trllc *)(trh+1);
+		struct trllc *trllc;
 
 		hdr_len = sizeof(struct trh_hdr) + sizeof(struct trllc);
 		trh = (struct trh_hdr *)skb_push(skb, hdr_len);
diff --git a/net/8021q/vlan.c b/net/8021q/vlan.c
index a44c900ac..df9970410 100644
--- a/net/8021q/vlan.c
+++ b/net/8021q/vlan.c
@@ -38,8 +38,7 @@
 /* Global VLAN variables */
 
 /* Our listing of VLAN group(s) */
-struct vlan_group *vlan_group_hash[VLAN_GRP_HASH_SIZE];
-spinlock_t vlan_group_lock = SPIN_LOCK_UNLOCKED;
+struct hlist_head vlan_group_hash[VLAN_GRP_HASH_SIZE];
 #define vlan_grp_hashfn(IDX)	((((IDX) >> VLAN_GRP_HASH_SHIFT) ^ (IDX)) & VLAN_GRP_HASH_MASK)
 
 static char vlan_fullname[] = "802.1Q VLAN Support";
@@ -69,6 +68,10 @@ static struct packet_type vlan_packet_type = {
 	.func = vlan_skb_recv, /* VLAN receive method */
 };
 
+/* Bits of netdev state that are propogated from real device to virtual */
+#define VLAN_LINK_STATE_MASK \
+	((1<<__LINK_STATE_PRESENT)|(1<<__LINK_STATE_NOCARRIER))
+
 /* End of global variables definitions. */
 
 /*
@@ -146,8 +149,7 @@ static void __exit vlan_cleanup_module(void)
 	 * references left.
 	 */
 	for (i = 0; i < VLAN_GRP_HASH_SIZE; i++) {
-		if (vlan_group_hash[i] != NULL)
-			BUG();
+		BUG_ON(!hlist_empty(&vlan_group_hash[i]));
 	}
 	vlan_proc_cleanup();
 
@@ -157,48 +159,24 @@ static void __exit vlan_cleanup_module(void)
 module_init(vlan_proto_init);
 module_exit(vlan_cleanup_module);
 
-/* Must be invoked with vlan_group_lock held. */
+/* Must be invoked with RCU read lock (no preempt) */
 static struct vlan_group *__vlan_find_group(int real_dev_ifindex)
 {
 	struct vlan_group *grp;
+	struct hlist_node *n;
+	int hash = vlan_grp_hashfn(real_dev_ifindex);
 
-	for (grp = vlan_group_hash[vlan_grp_hashfn(real_dev_ifindex)];
-	     grp != NULL;
-	     grp = grp->next) {
+	hlist_for_each_entry_rcu(grp, n, &vlan_group_hash[hash], hlist) {
 		if (grp->real_dev_ifindex == real_dev_ifindex)
-			break;
+			return grp;
 	}
 
-	return grp;
-}
-
-/* Must hold vlan_group_lock. */
-static void __grp_hash(struct vlan_group *grp)
-{
-	struct vlan_group **head;
-
-	head = &vlan_group_hash[vlan_grp_hashfn(grp->real_dev_ifindex)];
-	grp->next = *head;
-	*head = grp;
-}
-
-/* Must hold vlan_group_lock. */
-static void __grp_unhash(struct vlan_group *grp)
-{
-	struct vlan_group *next, **pprev;
-
-	pprev = &vlan_group_hash[vlan_grp_hashfn(grp->real_dev_ifindex)];
-	next = *pprev;
-	while (next != grp) {
-		pprev = &next->next;
-		next = *pprev;
-	}
-	*pprev = grp->next;
+	return NULL;
 }
 
 /*  Find the protocol handler.  Assumes VID < VLAN_VID_MASK.
  *
- * Must be invoked with vlan_group_lock held.
+ * Must be invoked with RCU read lock (no preempt)
  */
 struct net_device *__find_vlan_dev(struct net_device *real_dev,
 				   unsigned short VID)
@@ -211,6 +189,12 @@ struct net_device *__find_vlan_dev(struct net_device *real_dev,
 	return NULL;
 }
 
+static void vlan_rcu_free(struct rcu_head *rcu)
+{
+	kfree(container_of(rcu, struct vlan_group, rcu));
+}
+
+
 /* This returns 0 if everything went fine.
  * It will return 1 if the group was killed as a result.
  * A negative return indicates failure.
@@ -233,9 +217,8 @@ static int unregister_vlan_dev(struct net_device *real_dev,
 	if (vlan_id >= VLAN_VID_MASK)
 		return -EINVAL;
 
-	spin_lock_bh(&vlan_group_lock);
+	ASSERT_RTNL();
 	grp = __vlan_find_group(real_dev_ifindex);
-	spin_unlock_bh(&vlan_group_lock);
 
 	ret = 0;
 
@@ -275,16 +258,12 @@ static int unregister_vlan_dev(struct net_device *real_dev,
 				if (real_dev->features & NETIF_F_HW_VLAN_RX)
 					real_dev->vlan_rx_register(real_dev, NULL);
 
-				spin_lock_bh(&vlan_group_lock);
-				__grp_unhash(grp);
-				spin_unlock_bh(&vlan_group_lock);
+				hlist_del_rcu(&grp->hlist);
 
-				/* Free the group, after we have removed it
-				 * from the hash.
-				 */
-				kfree(grp);
-				grp = NULL;
+				/* Free the group, after all cpu's are done. */
+				call_rcu(&grp->rcu, vlan_rcu_free);
 
+				grp = NULL;
 				ret = 1;
 			}
 		}
@@ -358,6 +337,7 @@ static void vlan_setup(struct net_device *new_dev)
 	new_dev->set_mac_address = vlan_dev_set_mac_address;
 	new_dev->set_multicast_list = vlan_dev_set_multicast_list;
 	new_dev->destructor = free_netdev;
+	new_dev->do_ioctl = vlan_dev_ioctl;
 }
 
 /*  Attach a VLAN device to a mac address (ie Ethernet Card).
@@ -370,7 +350,6 @@ static struct net_device *register_vlan_device(const char *eth_IF_name,
 	struct vlan_group *grp;
 	struct net_device *new_dev;
 	struct net_device *real_dev; /* the ethernet device */
-	int r;
 	char name[IFNAMSIZ];
 
 #ifdef VLAN_DEBUG
@@ -419,11 +398,7 @@ static struct net_device *register_vlan_device(const char *eth_IF_name,
 	if (!(real_dev->flags & IFF_UP))
 		goto out_unlock;
 
-	spin_lock_bh(&vlan_group_lock);
-	r = (__find_vlan_dev(real_dev, VLAN_ID) != NULL);
-	spin_unlock_bh(&vlan_group_lock);
-
-	if (r) {
+	if (__find_vlan_dev(real_dev, VLAN_ID) != NULL) {
 		/* was already registered. */
 		printk(VLAN_DBG "%s: ALREADY had VLAN registered\n", __FUNCTION__);
 		goto out_unlock;
@@ -471,6 +446,8 @@ static struct net_device *register_vlan_device(const char *eth_IF_name,
 	new_dev->flags = real_dev->flags;
 	new_dev->flags &= ~IFF_UP;
 
+	new_dev->state = real_dev->state & VLAN_LINK_STATE_MASK;
+
 	/* need 4 bytes for extra VLAN header info,
 	 * hope the underlying device can handle it.
 	 */
@@ -520,9 +497,7 @@ static struct net_device *register_vlan_device(const char *eth_IF_name,
 	/* So, got the sucker initialized, now lets place
 	 * it into our local structure.
 	 */
-	spin_lock_bh(&vlan_group_lock);
 	grp = __vlan_find_group(real_dev->ifindex);
-	spin_unlock_bh(&vlan_group_lock);
 
 	/* Note, we are running under the RTNL semaphore
 	 * so it cannot "appear" on us.
@@ -536,9 +511,8 @@ static struct net_device *register_vlan_device(const char *eth_IF_name,
 		memset(grp, 0, sizeof(struct vlan_group));
 		grp->real_dev_ifindex = real_dev->ifindex;
 
-		spin_lock_bh(&vlan_group_lock);
-		__grp_hash(grp);
-		spin_unlock_bh(&vlan_group_lock);
+		hlist_add_head_rcu(&grp->hlist, 
+				   &vlan_group_hash[vlan_grp_hashfn(real_dev->ifindex)]);
 
 		if (real_dev->features & NETIF_F_HW_VLAN_RX)
 			real_dev->vlan_rx_register(real_dev, grp);
@@ -580,14 +554,10 @@ out_ret_null:
 
 static int vlan_device_event(struct notifier_block *unused, unsigned long event, void *ptr)
 {
-	struct net_device *dev = (struct net_device *)(ptr);
-	struct vlan_group *grp = NULL;
+	struct net_device *dev = ptr;
+	struct vlan_group *grp = __vlan_find_group(dev->ifindex);
 	int i, flgs;
-	struct net_device *vlandev = NULL;
-
-	spin_lock_bh(&vlan_group_lock);
-	grp = __vlan_find_group(dev->ifindex);
-	spin_unlock_bh(&vlan_group_lock);
+	struct net_device *vlandev;
 
 	if (!grp)
 		goto out;
@@ -597,9 +567,20 @@ static int vlan_device_event(struct notifier_block *unused, unsigned long event,
 	 */
 
 	switch (event) {
-	case NETDEV_CHANGEADDR:
-	case NETDEV_GOING_DOWN:
-		/* Ignore for now */
+	case NETDEV_CHANGE:
+		/* Propogate real device state to vlan devices */
+		flgs = dev->state & VLAN_LINK_STATE_MASK;
+		for (i = 0; i < VLAN_GROUP_ARRAY_LEN; i++) {
+			vlandev = grp->vlan_devices[i];
+			if (!vlandev)
+				continue;
+
+			if ((vlandev->state & VLAN_LINK_STATE_MASK) != flgs) {
+				vlandev->state = (vlandev->state &~ VLAN_LINK_STATE_MASK) 
+					| flgs;
+				netdev_state_change(vlandev);
+			}
+		}
 		break;
 
 	case NETDEV_DOWN:
@@ -644,7 +625,6 @@ static int vlan_device_event(struct notifier_block *unused, unsigned long event,
 			ret = unregister_vlan_dev(dev,
 						  VLAN_DEV_INFO(vlandev)->vlan_id);
 
-			dev_put(vlandev);
 			unregister_netdevice(vlandev);
 
 			/* Group was destroyed? */
diff --git a/net/8021q/vlan.h b/net/8021q/vlan.h
index 3a5ae4334..830282e6f 100644
--- a/net/8021q/vlan.h
+++ b/net/8021q/vlan.h
@@ -33,8 +33,7 @@ extern unsigned short vlan_name_type;
 #define VLAN_GRP_HASH_SHIFT	5
 #define VLAN_GRP_HASH_SIZE	(1 << VLAN_GRP_HASH_SHIFT)
 #define VLAN_GRP_HASH_MASK	(VLAN_GRP_HASH_SIZE - 1)
-extern struct vlan_group *vlan_group_hash[VLAN_GRP_HASH_SIZE];
-extern spinlock_t vlan_group_lock;
+extern struct  hlist_head vlan_group_hash[VLAN_GRP_HASH_SIZE];
 
 /*  Find a VLAN device by the MAC address of its Ethernet device, and
  *  it's VLAN ID.  The default configuration is to have VLAN's scope
@@ -44,10 +43,8 @@ extern spinlock_t vlan_group_lock;
  *  NOT follow the spec for VLANs, but may be useful for doing very
  *  large quantities of VLAN MUX/DEMUX onto FrameRelay or ATM PVCs.
  *
- *  Must be invoked with vlan_group_lock held and that lock MUST NOT
- *  be dropped until a reference is obtained on the returned device.
- *  You may drop the lock earlier if you are running under the RTNL
- *  semaphore, however.
+ *  Must be invoked with rcu_read_lock (ie preempt disabled)
+ *  or with RTNL.
  */
 struct net_device *__find_vlan_dev(struct net_device* real_dev,
 				   unsigned short VID); /* vlan.c */
@@ -65,6 +62,7 @@ int vlan_dev_change_mtu(struct net_device *dev, int new_mtu);
 int vlan_dev_set_mac_address(struct net_device *dev, void* addr);
 int vlan_dev_open(struct net_device* dev);
 int vlan_dev_stop(struct net_device* dev);
+int vlan_dev_ioctl(struct net_device* dev, struct ifreq *ifr, int cmd);
 int vlan_dev_set_ingress_priority(char* dev_name, __u32 skb_prio, short vlan_prio);
 int vlan_dev_set_egress_priority(char* dev_name, __u32 skb_prio, short vlan_prio);
 int vlan_dev_set_vlan_flag(char* dev_name, __u32 flag, short flag_val);
diff --git a/net/8021q/vlan_dev.c b/net/8021q/vlan_dev.c
index b91d251f3..460aabc09 100644
--- a/net/8021q/vlan_dev.c
+++ b/net/8021q/vlan_dev.c
@@ -138,15 +138,15 @@ int vlan_skb_recv(struct sk_buff *skb, struct net_device *dev,
 
 	/* We have 12 bits of vlan ID.
 	 *
-	 * We must not drop the vlan_group_lock until we hold a
+	 * We must not drop allow preempt until we hold a
 	 * reference to the device (netif_rx does that) or we
 	 * fail.
 	 */
 
-	spin_lock_bh(&vlan_group_lock);
+	rcu_read_lock();
 	skb->dev = __find_vlan_dev(dev, vid);
 	if (!skb->dev) {
-		spin_unlock_bh(&vlan_group_lock);
+		rcu_read_unlock();
 
 #ifdef VLAN_DEBUG
 		printk(VLAN_DBG "%s: ERROR: No net_device for VID: %i on dev: %s [%i]\n",
@@ -170,7 +170,7 @@ int vlan_skb_recv(struct sk_buff *skb, struct net_device *dev,
 	 */
 
 	if (dev != VLAN_DEV_INFO(skb->dev)->real_dev) {
-		spin_unlock_bh(&vlan_group_lock);
+		rcu_read_unlock();
 
 #ifdef VLAN_DEBUG
 		printk(VLAN_DBG "%s: dropping skb: %p because came in on wrong device, dev: %s  real_dev: %s, skb_dev: %s\n",
@@ -244,7 +244,7 @@ int vlan_skb_recv(struct sk_buff *skb, struct net_device *dev,
 			/* TODO:  Add a more specific counter here. */
 			stats->rx_errors++;
 		}
-		spin_unlock_bh(&vlan_group_lock);
+		rcu_read_lock();
 		return 0;
 	}
 
@@ -273,7 +273,7 @@ int vlan_skb_recv(struct sk_buff *skb, struct net_device *dev,
 			/* TODO:  Add a more specific counter here. */
 			stats->rx_errors++;
 		}
-		spin_unlock_bh(&vlan_group_lock);
+		rcu_read_unlock();
 		return 0;
 	}
 
@@ -296,7 +296,7 @@ int vlan_skb_recv(struct sk_buff *skb, struct net_device *dev,
 		/* TODO:  Add a more specific counter here. */
 		stats->rx_errors++;
 	}
-	spin_unlock_bh(&vlan_group_lock);
+	rcu_read_unlock();
 	return 0;
 }
 
@@ -727,7 +727,6 @@ static void vlan_flush_mc_list(struct net_device *dev)
 	struct dev_mc_list *dmi = dev->mc_list;
 
 	while (dmi) {
-		dev_mc_delete(dev, dmi->dmi_addr, dmi->dmi_addrlen, 0);
 		printk(KERN_DEBUG "%s: del %.2x:%.2x:%.2x:%.2x:%.2x:%.2x mcast address from vlan interface\n",
 		       dev->name,
 		       dmi->dmi_addr[0],
@@ -736,6 +735,7 @@ static void vlan_flush_mc_list(struct net_device *dev)
 		       dmi->dmi_addr[3],
 		       dmi->dmi_addr[4],
 		       dmi->dmi_addr[5]);
+		dev_mc_delete(dev, dmi->dmi_addr, dmi->dmi_addrlen, 0);
 		dmi = dev->mc_list;
 	}
 
@@ -757,6 +757,34 @@ int vlan_dev_stop(struct net_device *dev)
 	vlan_flush_mc_list(dev);
 	return 0;
 }
+
+int vlan_dev_ioctl(struct net_device *dev, struct ifreq *ifr, int cmd)
+{
+	struct net_device *real_dev = VLAN_DEV_INFO(dev)->real_dev;
+	struct ifreq ifrr;
+	int err = -EOPNOTSUPP;
+
+	strncpy(ifrr.ifr_name, real_dev->name, IFNAMSIZ);
+	ifrr.ifr_ifru = ifr->ifr_ifru;
+
+	switch(cmd) {
+	case SIOCGMIIPHY:
+	case SIOCGMIIREG:
+	case SIOCSMIIREG:
+		if (real_dev->do_ioctl && netif_device_present(real_dev)) 
+			err = real_dev->do_ioctl(dev, &ifrr, cmd);
+		break;
+
+	case SIOCETHTOOL:
+		err = dev_ethtool(&ifrr);
+	}
+
+	if (!err) 
+		ifr->ifr_ifru = ifrr.ifr_ifru;
+
+	return err;
+}
+
 /** Taken from Gleb + Lennert's VLAN code, and modified... */
 void vlan_dev_set_multicast_list(struct net_device *vlan_dev)
 {
diff --git a/net/Kconfig b/net/Kconfig
index 6b033215e..37ee31e7d 100644
--- a/net/Kconfig
+++ b/net/Kconfig
@@ -109,6 +109,8 @@ source "net/ipv4/Kconfig"
 config IPV6
 	tristate "The IPv6 protocol (EXPERIMENTAL)"
 	depends on INET && EXPERIMENTAL
+	select CRYPTO if IPV6_PRIVACY
+	select CRYPTO_MD5 if IPV6_PRIVACY
 	---help---
 	  This is experimental support for the IP version 6 (formerly called
 	  IPng "IP next generation").  You will still be able to do
@@ -549,26 +551,6 @@ config WAN_ROUTER
 
 	  If unsure, say N.
 
-config NET_FASTROUTE
-	bool "Fast switching (read help!)"
-	depends on EXPERIMENTAL
-	---help---
-	  Saying Y here enables direct NIC-to-NIC (NIC = Network Interface
-	  Card) data transfers on the local network, which is fast.
-
-	  IMPORTANT NOTE: This option is NOT COMPATIBLE with "Network packet
-	  filtering" (CONFIG_NETFILTER). Say N here if you say Y there.
-
-	  However, it will work with all options in the "Advanced router"
-	  section (except for "Use TOS value as routing key" and
-	  "Use FWMARK value as routing key").
-
-	  At the moment, few devices support fast switching (tulip is one of
-	  them, a modified 8390 driver can be found at
-	  <ftp://ftp.tux.org/pub/net/ip-routing/fastroute/fastroute-8390.tar.gz>).
-
-	  If unsure, say N.
-
 config NET_HW_FLOWCONTROL
 	bool "Forwarding between high speed interfaces"
 	depends on EXPERIMENTAL
diff --git a/net/appletalk/ddp.c b/net/appletalk/ddp.c
index 4170de1a0..4185d7b8e 100644
--- a/net/appletalk/ddp.c
+++ b/net/appletalk/ddp.c
@@ -908,12 +908,12 @@ static int atrtr_ioctl(unsigned int cmd, void __user *arg)
 
 		case SIOCADDRT: {
 			struct net_device *dev = NULL;
-			/*
-			 * FIXME: the name of the device is still in user
-			 * space, isn't it?
-			 */
 			if (rt.rt_dev) {
-				dev = __dev_get_by_name(rt.rt_dev);
+				char name[IFNAMSIZ];
+				if (copy_from_user(name, rt.rt_dev, IFNAMSIZ-1))
+					return -EFAULT;
+				name[IFNAMSIZ-1] = '\0';
+				dev = __dev_get_by_name(name);
 				if (!dev)
 					return -ENODEV;
 			}			
diff --git a/net/atm/br2684.c b/net/atm/br2684.c
index 91a89d3a2..66778f43a 100644
--- a/net/atm/br2684.c
+++ b/net/atm/br2684.c
@@ -558,12 +558,12 @@ Note: we do not have explicit unassign, but look at _push()
 	atmvcc->push = br2684_push;
 	skb_queue_head_init(&copy);
 	skb_migrate(&atmvcc->sk->sk_receive_queue, &copy);
-	while ((skb = skb_dequeue(&copy))) {
+	while ((skb = skb_dequeue(&copy)) != NULL) {
 		BRPRIV(skb->dev)->stats.rx_bytes -= skb->len;
 		BRPRIV(skb->dev)->stats.rx_packets--;
 		br2684_push(atmvcc, skb);
 	}
-	(void) try_module_get(THIS_MODULE);
+	__module_get(THIS_MODULE);
 	return 0;
     error:
 	write_unlock_irq(&devs_lock);
diff --git a/net/atm/clip.c b/net/atm/clip.c
index 7dc72ddf9..4417df3fa 100644
--- a/net/atm/clip.c
+++ b/net/atm/clip.c
@@ -503,7 +503,7 @@ static int clip_mkip(struct atm_vcc *vcc,int timeout)
 	skb_queue_head_init(&copy);
 	skb_migrate(&vcc->sk->sk_receive_queue, &copy);
 	/* re-process everything received between connection setup and MKIP */
-	while ((skb = skb_dequeue(&copy)))
+	while ((skb = skb_dequeue(&copy)) != NULL)
 		if (!clip_devs) {
 			atm_return(vcc,skb->truesize);
 			kfree_skb(skb);
@@ -998,7 +998,7 @@ static int __init atm_clip_init(void)
 
 	/* so neigh_ifdown() doesn't complain */
 	clip_tbl.proxy_timer.data = 0;
-	clip_tbl.proxy_timer.function = 0;
+	clip_tbl.proxy_timer.function = NULL;
 	init_timer(&clip_tbl.proxy_timer);
 	skb_queue_head_init(&clip_tbl.proxy_queue);
 
diff --git a/net/atm/common.c b/net/atm/common.c
index ce00ea644..19d31f1b2 100644
--- a/net/atm/common.c
+++ b/net/atm/common.c
@@ -187,7 +187,7 @@ static void vcc_destroy_socket(struct sock *sk)
 
 		vcc_remove_socket(sk);	/* no more receive */
 
-		while ((skb = skb_dequeue(&vcc->sk->sk_receive_queue))) {
+		while ((skb = skb_dequeue(&vcc->sk->sk_receive_queue)) != NULL) {
 			atm_return(vcc,skb->truesize);
 			kfree_skb(skb);
 		}
diff --git a/net/atm/lec.c b/net/atm/lec.c
index b005e1a5c..a920b9246 100644
--- a/net/atm/lec.c
+++ b/net/atm/lec.c
@@ -1,6 +1,6 @@
 /*
  * lec.c: Lan Emulation driver 
- * Marko Kiiskila carnil@cs.tut.fi
+ * Marko Kiiskila mkiiskila@yahoo.com
  *
  */
 
@@ -71,9 +71,9 @@ static int lec_start_xmit(struct sk_buff *skb, struct net_device *dev);
 static int lec_close(struct net_device *dev);
 static struct net_device_stats *lec_get_stats(struct net_device *dev);
 static void lec_init(struct net_device *dev);
-static inline struct lec_arp_table* lec_arp_find(struct lec_priv *priv,
+static struct lec_arp_table* lec_arp_find(struct lec_priv *priv,
                                                      unsigned char *mac_addr);
-static inline int lec_arp_remove(struct lec_priv *priv,
+static int lec_arp_remove(struct lec_priv *priv,
 				     struct lec_arp_table *to_remove);
 /* LANE2 functions */
 static void lane2_associate_ind (struct net_device *dev, u8 *mac_address,
@@ -567,7 +567,7 @@ lec_atm_close(struct atm_vcc *vcc)
         if (skb_peek(&vcc->sk->sk_receive_queue))
 		printk("%s lec_atm_close: closing with messages pending\n",
                        dev->name);
-        while ((skb = skb_dequeue(&vcc->sk->sk_receive_queue))) {
+        while ((skb = skb_dequeue(&vcc->sk->sk_receive_queue)) != NULL) {
                 atm_return(vcc, skb->truesize);
 		dev_kfree_skb(skb);
         }
@@ -1468,7 +1468,7 @@ lec_arp_add(struct lec_priv *priv, struct lec_arp_table *to_add)
 /*
  * Remove entry from lec_arp_table
  */
-static inline int 
+static int 
 lec_arp_remove(struct lec_priv *priv,
                struct lec_arp_table *to_remove)
 {
@@ -1755,7 +1755,7 @@ lec_arp_destroy(struct lec_priv *priv)
 /* 
  * Find entry by mac_address
  */
-static inline struct lec_arp_table*
+static struct lec_arp_table*
 lec_arp_find(struct lec_priv *priv,
              unsigned char *mac_addr)
 {
@@ -1940,7 +1940,7 @@ lec_arp_check_expire(unsigned long data)
                                            priv->path_switching_delay)) {
 			                        struct sk_buff *skb;
 
- 				                while ((skb = skb_dequeue(&entry->tx_wait)))
+ 				                while ((skb = skb_dequeue(&entry->tx_wait)) != NULL)
 					                lec_send(entry->vcc, skb, entry->priv);
                                                 entry->last_used = jiffies;
                                                 entry->status = 
@@ -2337,7 +2337,7 @@ lec_flush_complete(struct lec_priv *priv, unsigned long tran_id)
                             entry->status == ESI_FLUSH_PENDING) {
 			        struct sk_buff *skb;
 
- 				while ((skb = skb_dequeue(&entry->tx_wait)))
+ 				while ((skb = skb_dequeue(&entry->tx_wait)) != NULL)
 					lec_send(entry->vcc, skb, entry->priv);
                                 entry->status = ESI_FORWARD_DIRECT;
                                 DPRINTK("LEC_ARP: Flushed\n");
diff --git a/net/atm/lec.h b/net/atm/lec.h
index af6559193..c544f926e 100644
--- a/net/atm/lec.h
+++ b/net/atm/lec.h
@@ -2,7 +2,7 @@
  *
  * Lan Emulation client header file
  *
- * Marko Kiiskila carnil@cs.tut.fi
+ * Marko Kiiskila mkiiskila@yahoo.com
  *
  */
 
diff --git a/net/atm/lec_arpc.h b/net/atm/lec_arpc.h
index c0d00e3ea..d07fc6a0a 100644
--- a/net/atm/lec_arpc.h
+++ b/net/atm/lec_arpc.h
@@ -1,6 +1,6 @@
 /*
  * Lec arp cache
- * Marko Kiiskila carnil@cs.tut.fi
+ * Marko Kiiskila mkiiskila@yahoo.com
  *
  */
 #ifndef _LEC_ARP_H
diff --git a/net/atm/mpc.c b/net/atm/mpc.c
index e629e89d4..ba4a1569d 100644
--- a/net/atm/mpc.c
+++ b/net/atm/mpc.c
@@ -3,6 +3,7 @@
 #include <linux/timer.h>
 #include <linux/init.h>
 #include <linux/bitops.h>
+#include <linux/seq_file.h>
 
 /* We are an ethernet device */
 #include <linux/if_ether.h>
@@ -224,29 +225,27 @@ int atm_mpoa_delete_qos(struct atm_mpoa_qos *entry)
 	return 0;
 }
 
-void atm_mpoa_disp_qos(char *page, ssize_t *len)
+/* this is buggered - we need locking for qos_head */
+void atm_mpoa_disp_qos(struct seq_file *m)
 {
-
 	unsigned char *ip;
 	char ipaddr[16];
 	struct atm_mpoa_qos *qos;
 
 	qos = qos_head;
-	*len += sprintf(page + *len, "QoS entries for shortcuts:\n");
-	*len += sprintf(page + *len, "IP address\n  TX:max_pcr pcr     min_pcr max_cdv max_sdu\n  RX:max_pcr pcr     min_pcr max_cdv max_sdu\n");
+	seq_printf(m, "QoS entries for shortcuts:\n");
+	seq_printf(m, "IP address\n  TX:max_pcr pcr     min_pcr max_cdv max_sdu\n  RX:max_pcr pcr     min_pcr max_cdv max_sdu\n");
 
 	ipaddr[sizeof(ipaddr)-1] = '\0';
 	while (qos != NULL) {
 		ip = (unsigned char *)&qos->ipaddr;
 		sprintf(ipaddr, "%u.%u.%u.%u", NIPQUAD(ip));
-		*len += sprintf(page + *len, "%u.%u.%u.%u\n     %-7d %-7d %-7d %-7d %-7d\n     %-7d %-7d %-7d %-7d %-7d\n",
+		seq_printf(m, "%u.%u.%u.%u\n     %-7d %-7d %-7d %-7d %-7d\n     %-7d %-7d %-7d %-7d %-7d\n",
 				NIPQUAD(ipaddr),
 				qos->qos.txtp.max_pcr, qos->qos.txtp.pcr, qos->qos.txtp.min_pcr, qos->qos.txtp.max_cdv, qos->qos.txtp.max_sdu,
 				qos->qos.rxtp.max_pcr, qos->qos.rxtp.pcr, qos->qos.rxtp.min_pcr, qos->qos.rxtp.max_cdv, qos->qos.rxtp.max_sdu);
 		qos = qos->next;
 	}
-	
-	return;
 }
 
 static struct net_device *find_lec_by_itfnum(int itf)
diff --git a/net/atm/mpc.h b/net/atm/mpc.h
index c7b1108d0..cb6cbdd22 100644
--- a/net/atm/mpc.h
+++ b/net/atm/mpc.h
@@ -51,6 +51,7 @@ struct atm_mpoa_qos *atm_mpoa_search_qos(uint32_t dst_ip);
 int atm_mpoa_delete_qos(struct atm_mpoa_qos *qos);
 
 /* Display QoS entries. This is for the procfs */
-void atm_mpoa_disp_qos(char *page, ssize_t *len);
+struct seq_file;
+void atm_mpoa_disp_qos(struct seq_file *m);
 
 #endif /* _MPC_H_ */
diff --git a/net/atm/mpoa_proc.c b/net/atm/mpoa_proc.c
index 64c676dd5..4f1849f9a 100644
--- a/net/atm/mpoa_proc.c
+++ b/net/atm/mpoa_proc.c
@@ -8,6 +8,7 @@
 #include <linux/module.h>
 #include <linux/proc_fs.h>
 #include <linux/time.h>
+#include <linux/seq_file.h>
 #include <asm/uaccess.h>
 #include <linux/atmmpc.h>
 #include <linux/atm.h>
@@ -30,31 +31,24 @@
 extern struct mpoa_client *mpcs;
 extern struct proc_dir_entry *atm_proc_root;  /* from proc.c. */
 
-static ssize_t proc_mpc_read(struct file *file, char __user *buff,
-			     size_t count, loff_t *pos);
-
+static int proc_mpc_open(struct inode *inode, struct file *file);
 static ssize_t proc_mpc_write(struct file *file, const char __user *buff,
                               size_t nbytes, loff_t *ppos);
 
-static int parse_qos(const char *buff, int len);
+static int parse_qos(const char *buff);
 
 /*
  *   Define allowed FILE OPERATIONS
  */
 static struct file_operations mpc_file_operations = {
 	.owner =	THIS_MODULE,
-	.read =		proc_mpc_read,
+	.open =		proc_mpc_open,
+	.read =		seq_read,
+	.llseek =	seq_lseek,
 	.write =	proc_mpc_write,
+	.release =	seq_release,
 };
 
-static int print_header(char *buff,struct mpoa_client *mpc){
-        if(mpc != NULL){
-	        return sprintf(buff,"\nInterface %d:\n\n",mpc->dev_num);  
-	  
-	}
-	return 0;
-}
-
 /*
  * Returns the state of an ingress cache entry as a string
  */
@@ -96,211 +90,174 @@ static const char *egress_state_string(int state){
 	}
 }
 
+/*
+ * FIXME: mpcs (and per-mpc lists) have no locking whatsoever.
+ */
+
+static void *mpc_start(struct seq_file *m, loff_t *pos)
+{
+	loff_t l = *pos;
+	struct mpoa_client *mpc;
+
+	if (!l--)
+		return SEQ_START_TOKEN;
+	for (mpc = mpcs; mpc; mpc = mpc->next)
+		if (!l--)
+			return mpc;
+	return NULL;
+}
+
+static void *mpc_next(struct seq_file *m, void *v, loff_t *pos)
+{
+	struct mpoa_client *p = v;
+	(*pos)++;
+	return v == SEQ_START_TOKEN ? mpcs : p->next;
+}
+
+static void mpc_stop(struct seq_file *m, void *v)
+{
+}
+
 /*
  * READING function - called when the /proc/atm/mpoa file is read from.
  */
-static ssize_t proc_mpc_read(struct file *file, char __user *buff,
-			     size_t count, loff_t *pos){
-        unsigned long page = 0;
+static ssize_t mpc_show(struct seq_file *m, void *v)
+{
+	struct mpoa_client *mpc = v;
 	unsigned char *temp;
-        int length = 0;
-	int i = 0;
-	struct mpoa_client *mpc = mpcs;
+	int i;
 	in_cache_entry *in_entry;
 	eg_cache_entry *eg_entry;
 	struct timeval now;
 	unsigned char ip_string[16];
-	if(count == 0)
-	        return 0;
-	page = get_zeroed_page(GFP_KERNEL);
-	if(!page)
-	        return -ENOMEM;
-	atm_mpoa_disp_qos((char *)page, &length);
-	while(mpc != NULL){
-	        length += print_header((char *)page + length, mpc);
-		length += sprintf((char *)page + length,"Ingress Entries:\nIP address      State      Holding time  Packets fwded  VPI  VCI\n");
-		in_entry = mpc->in_cache;
-		do_gettimeofday(&now);
-		while(in_entry != NULL){
-		        temp = (unsigned char *)&in_entry->ctrl_info.in_dst_ip;                        sprintf(ip_string,"%d.%d.%d.%d", temp[0], temp[1], temp[2], temp[3]);
-		        length += sprintf((char *)page + length,"%-16s%s%-14lu%-12u", ip_string, ingress_state_string(in_entry->entry_state), (in_entry->ctrl_info.holding_time-(now.tv_sec-in_entry->tv.tv_sec)), in_entry->packets_fwded);
-			if(in_entry->shortcut)
-			        length += sprintf((char *)page + length,"   %-3d  %-3d",in_entry->shortcut->vpi,in_entry->shortcut->vci);
-			length += sprintf((char *)page + length,"\n");
-			in_entry = in_entry->next;
-		}
-		length += sprintf((char *)page + length,"\n");
-		eg_entry = mpc->eg_cache;
-		length += sprintf((char *)page + length,"Egress Entries:\nIngress MPC ATM addr\nCache-id        State      Holding time  Packets recvd  Latest IP addr   VPI VCI\n");
-		while(eg_entry != NULL){
-		  for(i=0;i<ATM_ESA_LEN;i++){
-		          length += sprintf((char *)page + length,"%02x",eg_entry->ctrl_info.in_MPC_data_ATM_addr[i]);}  
-		        length += sprintf((char *)page + length,"\n%-16lu%s%-14lu%-15u",(unsigned long) ntohl(eg_entry->ctrl_info.cache_id), egress_state_string(eg_entry->entry_state), (eg_entry->ctrl_info.holding_time-(now.tv_sec-eg_entry->tv.tv_sec)), eg_entry->packets_rcvd);
-			
-			/* latest IP address */
-			temp = (unsigned char *)&eg_entry->latest_ip_addr;
-			sprintf(ip_string, "%d.%d.%d.%d", temp[0], temp[1], temp[2], temp[3]);
-			length += sprintf((char *)page + length, "%-16s", ip_string);
-
-			if(eg_entry->shortcut)
-			        length += sprintf((char *)page + length," %-3d %-3d",eg_entry->shortcut->vpi,eg_entry->shortcut->vci);
-			length += sprintf((char *)page + length,"\n");
-			eg_entry = eg_entry->next;
-		}
-		length += sprintf((char *)page + length,"\n");
-		mpc = mpc->next;
+
+	if (v == SEQ_START_TOKEN) {
+		atm_mpoa_disp_qos(m);
+		return 0;
 	}
 
-	if (*pos >= length) length = 0;
-	else {
-	  if ((count + *pos) > length) count = length - *pos;
-	  if (copy_to_user(buff, (char *)page , count)) {
- 		  free_page(page);
-		  return -EFAULT;
-          }
-	  *pos += count;
+	seq_printf(m, "\nInterface %d:\n\n", mpc->dev_num);  
+	seq_printf(m, "Ingress Entries:\nIP address      State      Holding time  Packets fwded  VPI  VCI\n");
+	do_gettimeofday(&now);
+
+	for (in_entry = mpc->in_cache; in_entry; in_entry = in_entry->next) {
+		temp = (unsigned char *)&in_entry->ctrl_info.in_dst_ip;
+		sprintf(ip_string,"%d.%d.%d.%d", temp[0], temp[1], temp[2], temp[3]);
+		seq_printf(m, "%-16s%s%-14lu%-12u",
+			      ip_string,
+			      ingress_state_string(in_entry->entry_state),
+			      in_entry->ctrl_info.holding_time-(now.tv_sec-in_entry->tv.tv_sec),
+			      in_entry->packets_fwded);
+		if (in_entry->shortcut)
+			seq_printf(m, "   %-3d  %-3d",in_entry->shortcut->vpi,in_entry->shortcut->vci);
+		seq_printf(m, "\n");
 	}
 
- 	free_page(page);
-        return length;
+	seq_printf(m, "\n");
+	seq_printf(m, "Egress Entries:\nIngress MPC ATM addr\nCache-id        State      Holding time  Packets recvd  Latest IP addr   VPI VCI\n");
+	for (eg_entry = mpc->eg_cache; eg_entry; eg_entry = eg_entry->next) {
+		unsigned char *p = eg_entry->ctrl_info.in_MPC_data_ATM_addr;
+		for(i = 0; i < ATM_ESA_LEN; i++)
+			seq_printf(m, "%02x", p[i]);
+		seq_printf(m, "\n%-16lu%s%-14lu%-15u",
+			   (unsigned long)ntohl(eg_entry->ctrl_info.cache_id),
+			   egress_state_string(eg_entry->entry_state),
+			   (eg_entry->ctrl_info.holding_time-(now.tv_sec-eg_entry->tv.tv_sec)),
+			   eg_entry->packets_rcvd);
+		
+		/* latest IP address */
+		temp = (unsigned char *)&eg_entry->latest_ip_addr;
+		sprintf(ip_string, "%d.%d.%d.%d", temp[0], temp[1], temp[2], temp[3]);
+		seq_printf(m, "%-16s", ip_string);
+
+		if (eg_entry->shortcut)
+			seq_printf(m, " %-3d %-3d",eg_entry->shortcut->vpi,eg_entry->shortcut->vci);
+		seq_printf(m, "\n");
+	}
+	seq_printf(m, "\n");
+	return 0;
+}
+
+static struct seq_operations mpc_op = {
+	.start =	mpc_start,
+	.next =		mpc_next,
+	.stop =		mpc_stop,
+	.show =		mpc_show
+};
+
+static int proc_mpc_open(struct inode *inode, struct file *file)
+{
+	return seq_open(file, &mpc_op);
 }
 
 static ssize_t proc_mpc_write(struct file *file, const char __user *buff,
                               size_t nbytes, loff_t *ppos)
 {
-        int incoming, error, retval;
-        char *page, c;
-        const char __user *tmp;
+        char *page, *p;
+	unsigned len;
 
-        if (nbytes == 0) return 0;
-        if (nbytes >= PAGE_SIZE) nbytes = PAGE_SIZE-1;
+        if (nbytes == 0)
+		return 0;
 
-        error = verify_area(VERIFY_READ, buff, nbytes);
-        if (error) return error;
+        if (nbytes >= PAGE_SIZE)
+		nbytes = PAGE_SIZE-1;
 
         page = (char *)__get_free_page(GFP_KERNEL);
-        if (page == NULL) return -ENOMEM;
-
-        incoming = 0;
-        tmp = buff;
-        while(incoming < nbytes){
-                if (get_user(c, tmp++)) return -EFAULT;
-                incoming++;
-                if (c == '\0' || c == '\n')
-                        break;
-        }
+        if (!page)
+		return -ENOMEM;
 
-        retval = copy_from_user(page, buff, incoming);
-        if (retval != 0) {
-                printk("mpoa: proc_mpc_write: copy_from_user() failed\n");
-                return -EFAULT;
+        for (p = page, len = 0; len < nbytes; p++, len++) {
+                if (get_user(*p, buff++)) {
+			free_page((unsigned long)page);
+			return -EFAULT;
+		}
+                if (*p == '\0' || *p == '\n')
+                        break;
         }
 
-        *ppos += incoming;
+        *p = '\0';
 
-        page[incoming] = '\0';
-	retval = parse_qos(page, incoming);
-        if (retval == 0)
+	if (!parse_qos(page))
                 printk("mpoa: proc_mpc_write: could not parse '%s'\n", page);
 
         free_page((unsigned long)page);
         
-        return nbytes;
+        return len;
 }
 
-static int parse_qos(const char *buff, int len)
+static int parse_qos(const char *buff)
 {
         /* possible lines look like this
          * add 130.230.54.142 tx=max_pcr,max_sdu rx=max_pcr,max_sdu
          */
-        
-        int pos, i;
-        uint32_t ipaddr;
         unsigned char ip[4]; 
-        char cmd[4], temp[256];
-        const char *tmp, *prev;
+	int tx_pcr, tx_sdu, rx_pcr, rx_sdu;
+        uint32_t ipaddr;
 	struct atm_qos qos; 
-	int value[5];
         
         memset(&qos, 0, sizeof(struct atm_qos));
-        strlcpy(cmd, buff, sizeof(cmd));
-        if( strncmp(cmd,"add", 3) &&  strncmp(cmd,"del", 3))
-	        return 0;  /* not add or del */
-
-	pos = 4;
-        /* next parse ip */
-        prev = buff + pos;
-        for (i = 0; i < 3; i++) {
-                tmp = strchr(prev, '.');
-                if (tmp == NULL) return 0;
-                memset(temp, '\0', 256);
-                memcpy(temp, prev, tmp-prev);
-                ip[i] = (char)simple_strtoul(temp, NULL, 0);
-		tmp ++; 
-		prev = tmp;
-        }
-	tmp = strchr(prev, ' ');
-        if (tmp == NULL) return 0;
-        memset(temp, '\0', 256);
-        memcpy(temp, prev, tmp-prev);
-        ip[i] = (char)simple_strtoul(temp, NULL, 0);
-        ipaddr = *(uint32_t *)ip;
-                
-	if(!strncmp(cmd, "del", 3))
-	         return atm_mpoa_delete_qos(atm_mpoa_search_qos(ipaddr));
-
-        /* next transmit values */
-	tmp = strstr(buff, "tx=");
-	if(tmp == NULL) return 0;
-	tmp += 3;
-	prev = tmp;
-	for( i = 0; i < 1; i++){
-	         tmp = strchr(prev, ',');
-		 if (tmp == NULL) return 0;
-		 memset(temp, '\0', 256);
-		 memcpy(temp, prev, tmp-prev);
-		 value[i] = (int)simple_strtoul(temp, NULL, 0);
-		 tmp ++; 
-		 prev = tmp;
+
+	if (sscanf(buff, "del %hhu.%hhu.%hhu.%hhu",
+			ip, ip+1, ip+2, ip+3) == 4) {
+		ipaddr = *(uint32_t *)ip;
+		return atm_mpoa_delete_qos(atm_mpoa_search_qos(ipaddr));
 	}
-	tmp = strchr(prev, ' ');
-        if (tmp == NULL) return 0;
-	memset(temp, '\0', 256);
-        memcpy(temp, prev, tmp-prev);
-        value[i] = (int)simple_strtoul(temp, NULL, 0);
+
+	if (sscanf(buff, "add %hhu.%hhu.%hhu.%hhu tx=%d,%d rx=tx",
+			ip, ip+1, ip+2, ip+3, &tx_pcr, &tx_sdu) == 6) {
+		rx_pcr = tx_pcr;
+		rx_sdu = tx_sdu;
+	} else if (sscanf(buff, "add %hhu.%hhu.%hhu.%hhu tx=%d,%d rx=%d,%d",
+		ip, ip+1, ip+2, ip+3, &tx_pcr, &tx_sdu, &rx_pcr, &rx_sdu) != 8)
+		return 0;
+
+        ipaddr = *(uint32_t *)ip;
 	qos.txtp.traffic_class = ATM_CBR;
-	qos.txtp.max_pcr = value[0];
-	qos.txtp.max_sdu = value[1];
-
-        /* next receive values */
-	tmp = strstr(buff, "rx=");
-	if(tmp == NULL) return 0;
-        if (strstr(buff, "rx=tx")) { /* rx == tx */
-                qos.rxtp.traffic_class = qos.txtp.traffic_class;
-                qos.rxtp.max_pcr = qos.txtp.max_pcr;
-                qos.rxtp.max_cdv = qos.txtp.max_cdv;
-                qos.rxtp.max_sdu = qos.txtp.max_sdu;
-        } else {
-                tmp += 3;
-                prev = tmp;
-                for( i = 0; i < 1; i++){
-                        tmp = strchr(prev, ',');
-                        if (tmp == NULL) return 0;
-                        memset(temp, '\0', 256);
-                        memcpy(temp, prev, tmp-prev);
-                        value[i] = (int)simple_strtoul(temp, NULL, 0);
-                        tmp ++; 
-                        prev = tmp;
-                }
-                tmp = strchr(prev, '\0');
-                if (tmp == NULL) return 0;
-                memset(temp, '\0', 256);
-                memcpy(temp, prev, tmp-prev);
-                value[i] = (int)simple_strtoul(temp, NULL, 0);
-                qos.rxtp.traffic_class = ATM_CBR;
-                qos.rxtp.max_pcr = value[0];
-                qos.rxtp.max_sdu = value[1];
-        }
+	qos.txtp.max_pcr = tx_pcr;
+	qos.txtp.max_sdu = tx_sdu;
+	qos.rxtp.traffic_class = ATM_CBR;
+	qos.rxtp.max_pcr = rx_pcr;
+	qos.rxtp.max_sdu = rx_sdu;
         qos.aal = ATM_AAL5;
 	dprintk("mpoa: mpoa_proc.c: parse_qos(): setting qos paramameters to tx=%d,%d rx=%d,%d\n",
 		qos.txtp.max_pcr,
diff --git a/net/atm/pppoatm.c b/net/atm/pppoatm.c
index e430c24cc..bea4da1cf 100644
--- a/net/atm/pppoatm.c
+++ b/net/atm/pppoatm.c
@@ -307,7 +307,7 @@ static int pppoatm_assign_vcc(struct atm_vcc *atmvcc, void __user *arg)
 	atmvcc->user_back = pvcc;
 	atmvcc->push = pppoatm_push;
 	atmvcc->pop = pppoatm_pop;
-	(void) try_module_get(THIS_MODULE);
+	__module_get(THIS_MODULE);
 	return 0;
 }
 
diff --git a/net/atm/resources.c b/net/atm/resources.c
index 58de2ac93..fd4b35b8d 100644
--- a/net/atm/resources.c
+++ b/net/atm/resources.c
@@ -356,9 +356,9 @@ int atm_dev_ioctl(unsigned int cmd, void __user *arg)
 				? -EFAULT : 0;
 			goto done;
 		case ATM_SETLOOP:
-			if (__ATM_LM_XTRMT((int) (long) buf) &&
-			    __ATM_LM_XTLOC((int) (long) buf) >
-			    __ATM_LM_XTRMT((int) (long) buf)) {
+			if (__ATM_LM_XTRMT((int) (unsigned long) buf) &&
+			    __ATM_LM_XTLOC((int) (unsigned long) buf) >
+			    __ATM_LM_XTRMT((int) (unsigned long) buf)) {
 				error = -EINVAL;
 				goto done;
 			}
diff --git a/net/atm/signaling.c b/net/atm/signaling.c
index 074fe5c7f..1788799f4 100644
--- a/net/atm/signaling.c
+++ b/net/atm/signaling.c
@@ -135,7 +135,7 @@ static int sigd_send(struct atm_vcc *vcc,struct sk_buff *skb)
 			lock_sock(vcc->sk);
 			if (vcc->sk->sk_ack_backlog ==
 			    vcc->sk->sk_max_ack_backlog) {
-				sigd_enq(0,as_reject,vcc,NULL,NULL);
+				sigd_enq(NULL,as_reject,vcc,NULL,NULL);
 				goto as_indicate_complete;
 			}
 			vcc->sk->sk_ack_backlog++;
diff --git a/net/atm/svc.c b/net/atm/svc.c
index c3e321fd4..035068b47 100644
--- a/net/atm/svc.c
+++ b/net/atm/svc.c
@@ -66,7 +66,7 @@ static void svc_disconnect(struct atm_vcc *vcc)
 	}
 	/* beware - socket is still in use by atmsigd until the last
 	   as_indicate has been answered */
-	while ((skb = skb_dequeue(&vcc->sk->sk_receive_queue))) {
+	while ((skb = skb_dequeue(&vcc->sk->sk_receive_queue)) != NULL) {
 		DPRINTK("LISTEN REL\n");
 		sigd_enq2(NULL,as_reject,vcc,NULL,NULL,&vcc->qos,0);
 		dev_kfree_skb(skb);
diff --git a/net/ax25/ax25_ds_timer.c b/net/ax25/ax25_ds_timer.c
index 1a4660f1e..3a8b67316 100644
--- a/net/ax25/ax25_ds_timer.c
+++ b/net/ax25/ax25_ds_timer.c
@@ -180,7 +180,7 @@ void ax25_ds_idletimer_expiry(ax25_cb *ax25)
 			ax25->sk->sk_state_change(ax25->sk);
 			sock_set_flag(ax25->sk, SOCK_DEAD);
 		}
-		bh_lock_sock(ax25->sk);
+		bh_unlock_sock(ax25->sk);
 	}
 }
 
diff --git a/net/ax25/ax25_route.c b/net/ax25/ax25_route.c
index de40eee76..82c3c451f 100644
--- a/net/ax25/ax25_route.c
+++ b/net/ax25/ax25_route.c
@@ -122,6 +122,7 @@ static int ax25_rt_add(struct ax25_routes_struct *route)
 					ax25_rt->digipeat->calls[i]    = route->digi_addr[i];
 				}
 			}
+			write_unlock(&ax25_route_lock);
 			return 0;
 		}
 		ax25_rt = ax25_rt->next;
diff --git a/net/bluetooth/Kconfig b/net/bluetooth/Kconfig
index 7c050d65d..6929490d0 100644
--- a/net/bluetooth/Kconfig
+++ b/net/bluetooth/Kconfig
@@ -20,6 +20,7 @@ menuconfig BT
 	     RFCOMM Module (RFCOMM Protocol)  
 	     BNEP Module (Bluetooth Network Encapsulation Protocol)
 	     CMTP Module (CAPI Message Transport Protocol)
+	     HIDP Module (Human Interface Device Protocol)
 
 	  Say Y here to compile Bluetooth support into the kernel or say M to
 	  compile it as module (bluetooth).
@@ -56,5 +57,7 @@ source "net/bluetooth/bnep/Kconfig"
 
 source "net/bluetooth/cmtp/Kconfig"
 
+source "net/bluetooth/hidp/Kconfig"
+
 source "drivers/bluetooth/Kconfig"
 
diff --git a/net/bluetooth/Makefile b/net/bluetooth/Makefile
index ce0521706..d1e433f7d 100644
--- a/net/bluetooth/Makefile
+++ b/net/bluetooth/Makefile
@@ -8,5 +8,6 @@ obj-$(CONFIG_BT_SCO)	+= sco.o
 obj-$(CONFIG_BT_RFCOMM)	+= rfcomm/
 obj-$(CONFIG_BT_BNEP)	+= bnep/
 obj-$(CONFIG_BT_CMTP)	+= cmtp/
+obj-$(CONFIG_BT_HIDP)	+= hidp/
 
 bluetooth-objs := af_bluetooth.o hci_core.o hci_conn.o hci_event.o hci_sock.o hci_sysfs.o lib.o
diff --git a/net/bluetooth/af_bluetooth.c b/net/bluetooth/af_bluetooth.c
index e111cf3c3..e0fa1b0d0 100644
--- a/net/bluetooth/af_bluetooth.c
+++ b/net/bluetooth/af_bluetooth.c
@@ -51,13 +51,13 @@
 #define BT_DBG(D...)
 #endif
 
-#define VERSION "2.5"
+#define VERSION "2.6"
 
 struct proc_dir_entry *proc_bt;
 EXPORT_SYMBOL(proc_bt);
 
 /* Bluetooth sockets */
-#define BT_MAX_PROTO	7
+#define BT_MAX_PROTO	8
 static struct net_proto_family *bt_proto[BT_MAX_PROTO];
 
 static kmem_cache_t *bt_sock_cache;
@@ -354,7 +354,7 @@ static int __init bt_init(void)
 	/* Init socket cache */
 	bt_sock_cache = kmem_cache_create("bt_sock",
 			sizeof(struct bt_sock), 0,
-			SLAB_HWCACHE_ALIGN, 0, 0);
+			SLAB_HWCACHE_ALIGN, NULL, NULL);
 
 	if (!bt_sock_cache) {
 		BT_ERR("Socket cache creation failed");
diff --git a/net/bluetooth/bnep/bnep.h b/net/bluetooth/bnep/bnep.h
index 5334a2cc0..bbb1ed709 100644
--- a/net/bluetooth/bnep/bnep.h
+++ b/net/bluetooth/bnep/bnep.h
@@ -139,7 +139,7 @@ struct bnep_conninfo {
 
 struct bnep_connlist_req {
 	__u32  cnum;
-	struct bnep_conninfo *ci;
+	struct bnep_conninfo __user *ci;
 };
 
 struct bnep_proto_filter {
diff --git a/net/bluetooth/bnep/core.c b/net/bluetooth/bnep/core.c
index ce7b9a519..a87cc64e9 100644
--- a/net/bluetooth/bnep/core.c
+++ b/net/bluetooth/bnep/core.c
@@ -61,7 +61,7 @@
 #define BT_DBG(D...)
 #endif
 
-#define VERSION "1.0"
+#define VERSION "1.2"
 
 static LIST_HEAD(bnep_session_list);
 static DECLARE_RWSEM(bnep_session_sem);
@@ -99,11 +99,9 @@ static void __bnep_unlink_session(struct bnep_session *s)
 static int bnep_send(struct bnep_session *s, void *data, size_t len)
 {
 	struct socket *sock = s->sock;
-	struct iovec iv = { data, len };
+	struct kvec iv = { data, len };
 
-	s->msg.msg_iov    = &iv;
-	s->msg.msg_iovlen = 1;
-	return sock_sendmsg(sock, &s->msg, len);
+	return kernel_sendmsg(sock, &s->msg, &iv, 1, len);
 }
 
 static int bnep_send_rsp(struct bnep_session *s, u8 ctrl, u16 resp)
@@ -115,6 +113,21 @@ static int bnep_send_rsp(struct bnep_session *s, u8 ctrl, u16 resp)
 	return bnep_send(s, &rsp, sizeof(rsp));
 }
 
+#ifdef CONFIG_BT_BNEP_PROTO_FILTER
+static inline void bnep_set_default_proto_filter(struct bnep_session *s)
+{
+	/* (IPv4, ARP)  */
+	s->proto_filter[0].start = htons(0x0800);
+	s->proto_filter[0].end   = htons(0x0806);
+	/* (RARP, AppleTalk) */
+	s->proto_filter[1].start = htons(0x8035);
+	s->proto_filter[1].end   = htons(0x80F3);
+	/* (IPX, IPv6) */
+	s->proto_filter[2].start = htons(0x8137);
+	s->proto_filter[2].end   = htons(0x86DD);
+}
+#endif
+
 static int bnep_ctrl_set_netfilter(struct bnep_session *s, u16 *data, int len)
 {
 	int n;
@@ -143,9 +156,13 @@ static int bnep_ctrl_set_netfilter(struct bnep_session *s, u16 *data, int len)
 			BT_DBG("proto filter start %d end %d",
 				f[i].start, f[i].end);
 		}
+
 		if (i < BNEP_MAX_PROTO_FILTERS)
 			memset(f + i, 0, sizeof(*f));
 
+		if (n == 0)
+			bnep_set_default_proto_filter(s);
+
 		bnep_send_rsp(s, BNEP_FILTER_NET_TYPE_RSP, BNEP_SUCCESS);
 	} else {
 		bnep_send_rsp(s, BNEP_FILTER_NET_TYPE_RSP, BNEP_FILTER_LIMIT_REACHED);
@@ -389,7 +406,7 @@ static inline int bnep_tx_frame(struct bnep_session *s, struct sk_buff *skb)
 {
 	struct ethhdr *eh = (void *) skb->data;
 	struct socket *sock = s->sock;
-	struct iovec iv[3];
+	struct kvec iv[3];
 	int len = 0, il = 0;
 	u8 type = 0;
 
@@ -400,7 +417,7 @@ static inline int bnep_tx_frame(struct bnep_session *s, struct sk_buff *skb)
 		goto send;
 	}
 
-	iv[il++] = (struct iovec) { &type, 1 };
+	iv[il++] = (struct kvec) { &type, 1 };
 	len++;
 
 	if (!memcmp(eh->h_dest, s->eh.h_source, ETH_ALEN))
@@ -415,25 +432,23 @@ static inline int bnep_tx_frame(struct bnep_session *s, struct sk_buff *skb)
 	type = __bnep_tx_types[type];
 	switch (type) {
 	case BNEP_COMPRESSED_SRC_ONLY:
-		iv[il++] = (struct iovec) { eh->h_source, ETH_ALEN };
+		iv[il++] = (struct kvec) { eh->h_source, ETH_ALEN };
 		len += ETH_ALEN;
 		break;
 		
 	case BNEP_COMPRESSED_DST_ONLY:
-		iv[il++] = (struct iovec) { eh->h_dest, ETH_ALEN };
+		iv[il++] = (struct kvec) { eh->h_dest, ETH_ALEN };
 		len += ETH_ALEN;
 		break;
 	}
 
 send:
-	iv[il++] = (struct iovec) { skb->data, skb->len };
+	iv[il++] = (struct kvec) { skb->data, skb->len };
 	len += skb->len;
 	
 	/* FIXME: linearize skb */
 	{
-		s->msg.msg_iov    = iv;
-		s->msg.msg_iovlen = il;
-		len = sock_sendmsg(sock, &s->msg, len);
+		len = kernel_sendmsg(sock, &s->msg, iv, il, len);
 	}
 	kfree_skb(skb);
 
@@ -460,8 +475,6 @@ static int bnep_session(void *arg)
 	set_user_nice(current, -15);
 	current->flags |= PF_NOFREEZE;
 
-        set_fs(KERNEL_DS);
-
 	init_waitqueue_entry(&wait, current);
 	add_wait_queue(sk->sk_sleep, &wait);
 	while (!atomic_read(&s->killed)) {
@@ -550,21 +563,12 @@ int bnep_add_connection(struct bnep_connadd_req *req, struct socket *sock)
 	/* Set default mc filter */
 	set_bit(bnep_mc_hash(dev->broadcast), (ulong *) &s->mc_filter);
 #endif
-	
+
 #ifdef CONFIG_BT_BNEP_PROTO_FILTER
 	/* Set default protocol filter */
-
-	/* (IPv4, ARP)  */
-	s->proto_filter[0].start = htons(0x0800);
-	s->proto_filter[0].end   = htons(0x0806);
-	/* (RARP, AppleTalk) */
-	s->proto_filter[1].start = htons(0x8035);
-	s->proto_filter[1].end   = htons(0x80F3);
-	/* (IPX, IPv6) */
-	s->proto_filter[2].start = htons(0x8137);
-	s->proto_filter[2].end   = htons(0x86DD);
+	bnep_set_default_proto_filter(s);
 #endif
-	
+
 	err = register_netdev(dev);
 	if (err) {
 		goto failed;
diff --git a/net/bluetooth/cmtp/core.c b/net/bluetooth/cmtp/core.c
index 5d3d0dcce..20ce04f2b 100644
--- a/net/bluetooth/cmtp/core.c
+++ b/net/bluetooth/cmtp/core.c
@@ -201,7 +201,7 @@ static inline int cmtp_recv_frame(struct cmtp_session *session, struct sk_buff *
 static int cmtp_send_frame(struct cmtp_session *session, unsigned char *data, int len)
 {
 	struct socket *sock = session->sock;
-	struct iovec iv = { data, len };
+	struct kvec iv = { data, len };
 	struct msghdr msg;
 
 	BT_DBG("session %p data %p len %d", session, data, len);
@@ -210,10 +210,8 @@ static int cmtp_send_frame(struct cmtp_session *session, unsigned char *data, in
 		return 0;
 
 	memset(&msg, 0, sizeof(msg));
-	msg.msg_iovlen = 1;
-	msg.msg_iov = &iv;
 
-	return sock_sendmsg(sock, &msg, len);
+	return kernel_sendmsg(sock, &msg, &iv, 1, len);
 }
 
 static int cmtp_process_transmit(struct cmtp_session *session)
@@ -295,8 +293,6 @@ static int cmtp_session(void *arg)
 	set_user_nice(current, -15);
 	current->flags |= PF_NOFREEZE;
 
-	set_fs(KERNEL_DS);
-
 	init_waitqueue_entry(&wait, current);
 	add_wait_queue(sk->sk_sleep, &wait);
 	while (!atomic_read(&session->terminate)) {
diff --git a/net/bluetooth/hci_conn.c b/net/bluetooth/hci_conn.c
index 51976db01..91004ee5a 100644
--- a/net/bluetooth/hci_conn.c
+++ b/net/bluetooth/hci_conn.c
@@ -69,7 +69,7 @@ void hci_acl_connect(struct hci_conn *conn)
 	bacpy(&cp.bdaddr, &conn->dst);
 	cp.pscan_rep_mode = 0x02;
 
-	if ((ie = inquiry_cache_lookup(hdev, &conn->dst)) &&
+	if ((ie = hci_inquiry_cache_lookup(hdev, &conn->dst)) &&
 			inquiry_entry_age(ie) <= INQUIRY_ENTRY_AGE_MAX) {
 		cp.pscan_rep_mode = ie->info.pscan_rep_mode;
 		cp.pscan_mode     = ie->info.pscan_mode;
diff --git a/net/bluetooth/hci_core.c b/net/bluetooth/hci_core.c
index 69ab2e7b9..e7d26b0f9 100644
--- a/net/bluetooth/hci_core.c
+++ b/net/bluetooth/hci_core.c
@@ -287,7 +287,7 @@ struct hci_dev *hci_dev_get(int index)
 EXPORT_SYMBOL(hci_dev_get);
 
 /* ---- Inquiry support ---- */
-void inquiry_cache_flush(struct hci_dev *hdev)
+static void inquiry_cache_flush(struct hci_dev *hdev)
 {
 	struct inquiry_cache *cache = &hdev->inq_cache;
 	struct inquiry_entry *next  = cache->list, *e;
@@ -301,7 +301,7 @@ void inquiry_cache_flush(struct hci_dev *hdev)
 	}
 }
 
-struct inquiry_entry *inquiry_cache_lookup(struct hci_dev *hdev, bdaddr_t *bdaddr)
+struct inquiry_entry *hci_inquiry_cache_lookup(struct hci_dev *hdev, bdaddr_t *bdaddr)
 {
 	struct inquiry_cache *cache = &hdev->inq_cache;
 	struct inquiry_entry *e;
@@ -314,14 +314,14 @@ struct inquiry_entry *inquiry_cache_lookup(struct hci_dev *hdev, bdaddr_t *bdadd
 	return e;
 }
 
-void inquiry_cache_update(struct hci_dev *hdev, struct inquiry_info *info)
+void hci_inquiry_cache_update(struct hci_dev *hdev, struct inquiry_info *info)
 {
 	struct inquiry_cache *cache = &hdev->inq_cache;
 	struct inquiry_entry *e;
 
 	BT_DBG("cache %p, %s", cache, batostr(&info->bdaddr));
 
-	if (!(e = inquiry_cache_lookup(hdev, &info->bdaddr))) {
+	if (!(e = hci_inquiry_cache_lookup(hdev, &info->bdaddr))) {
 		/* Entry not in the cache. Add new one. */
 		if (!(e = kmalloc(sizeof(struct inquiry_entry), GFP_ATOMIC)))
 			return;
@@ -335,7 +335,7 @@ void inquiry_cache_update(struct hci_dev *hdev, struct inquiry_info *info)
 	cache->timestamp = jiffies;
 }
 
-int inquiry_cache_dump(struct hci_dev *hdev, int num, __u8 *buf)
+static int inquiry_cache_dump(struct hci_dev *hdev, int num, __u8 *buf)
 {
 	struct inquiry_cache *cache = &hdev->inq_cache;
 	struct inquiry_info *info = (struct inquiry_info *) buf;
diff --git a/net/bluetooth/hci_event.c b/net/bluetooth/hci_event.c
index ab63024de..8d8e775ca 100644
--- a/net/bluetooth/hci_event.c
+++ b/net/bluetooth/hci_event.c
@@ -358,7 +358,7 @@ static inline void hci_cs_create_conn(struct hci_dev *hdev, __u8 status)
 			status, batostr(&cp->bdaddr), conn);
 
 	if (status) {
-		if (conn) {
+		if (conn && conn->state == BT_CONNECT) {
 			conn->state = BT_CLOSED;
 			hci_proto_connect_cfm(conn, status);
 			hci_conn_del(conn);
@@ -486,7 +486,7 @@ static inline void hci_inquiry_result_evt(struct hci_dev *hdev, struct sk_buff *
 
 	hci_dev_lock(hdev);
 	for (; num_rsp; num_rsp--)
-		inquiry_cache_update(hdev, info++);
+		hci_inquiry_cache_update(hdev, info++);
 	hci_dev_unlock(hdev);
 }
 
@@ -508,7 +508,7 @@ static inline void hci_inquiry_result_with_rssi_evt(struct hci_dev *hdev, struct
 		memcpy(tmp.dev_class, &info->dev_class, 3);
 		tmp.clock_offset      = info->clock_offset;
 		info++;
-		inquiry_cache_update(hdev, &tmp);
+		hci_inquiry_cache_update(hdev, &tmp);
 	}
 	hci_dev_unlock(hdev);
 }
diff --git a/net/bluetooth/hci_sysfs.c b/net/bluetooth/hci_sysfs.c
index 1b8039fb4..314106635 100644
--- a/net/bluetooth/hci_sysfs.c
+++ b/net/bluetooth/hci_sysfs.c
@@ -91,7 +91,7 @@ static int bt_hotplug(struct class_device *cdev, char **envp, int num_envp, char
 	if ((size <= 0) || (i >= num_envp))
 		return -ENOMEM;
 
-	envp[i] = 0;
+	envp[i] = NULL;
 	return 0;
 }
 #endif
diff --git a/net/bluetooth/hidp/core.c b/net/bluetooth/hidp/core.c
index 7e8e7ba7b..ee652ae9c 100644
--- a/net/bluetooth/hidp/core.c
+++ b/net/bluetooth/hidp/core.c
@@ -274,7 +274,7 @@ static inline int hidp_recv_frame(struct hidp_session *session, struct sk_buff *
 
 static int hidp_send_frame(struct socket *sock, unsigned char *data, int len)
 {
-	struct iovec iv = { data, len };
+	struct kvec iv = { data, len };
 	struct msghdr msg;
 
 	BT_DBG("sock %p data %p len %d", sock, data, len);
@@ -283,10 +283,8 @@ static int hidp_send_frame(struct socket *sock, unsigned char *data, int len)
 		return 0;
 
 	memset(&msg, 0, sizeof(msg));
-	msg.msg_iovlen = 1;
-	msg.msg_iov = &iv;
 
-	return sock_sendmsg(sock, &msg, len);
+	return kernel_sendmsg(sock, &msg, &iv, 1, len);
 }
 
 static int hidp_process_transmit(struct hidp_session *session)
@@ -340,8 +338,6 @@ static int hidp_session(void *arg)
 	set_user_nice(current, -15);
 	current->flags |= PF_NOFREEZE;
 
-	set_fs(KERNEL_DS);
-
 	init_waitqueue_entry(&ctrl_wait, current);
 	init_waitqueue_entry(&intr_wait, current);
 	add_wait_queue(ctrl_sk->sk_sleep, &ctrl_wait);
diff --git a/net/bluetooth/l2cap.c b/net/bluetooth/l2cap.c
index 298a25fb3..cc323a7f0 100644
--- a/net/bluetooth/l2cap.c
+++ b/net/bluetooth/l2cap.c
@@ -57,7 +57,7 @@
 #define BT_DBG(D...)
 #endif
 
-#define VERSION "2.2"
+#define VERSION "2.3"
 
 static struct proto_ops l2cap_sock_ops;
 
@@ -718,8 +718,7 @@ fail:
 	return err;
 }
 
-static int l2cap_sock_sendmsg(struct kiocb *iocb, struct socket *sock, 
-			      struct msghdr *msg, size_t len)
+static int l2cap_sock_sendmsg(struct kiocb *iocb, struct socket *sock, struct msghdr *msg, size_t len)
 {
 	struct sock *sk = sock->sk;
 	int err = 0;
@@ -1444,7 +1443,7 @@ static inline int l2cap_connect_rsp(struct l2cap_conn *conn, struct l2cap_cmd_hd
 	struct l2cap_conn_rsp *rsp = (struct l2cap_conn_rsp *) data;
 	u16 scid, dcid, result, status;
 	struct sock *sk;
-	char req[128];
+	u8 req[128];
 
 	scid   = __le16_to_cpu(rsp->scid);
 	dcid   = __le16_to_cpu(rsp->dcid);
@@ -1481,7 +1480,7 @@ static inline int l2cap_config_req(struct l2cap_conn *conn, struct l2cap_cmd_hdr
 {
 	struct l2cap_conf_req *req = (struct l2cap_conf_req *) data;
 	u16 dcid, flags;
-	u8  rsp[64];
+	u8 rsp[64];
 	struct sock *sk;
 	int result;
 
@@ -1633,6 +1632,35 @@ static inline int l2cap_disconnect_rsp(struct l2cap_conn *conn, struct l2cap_cmd
 	return 0;
 }
 
+static inline int l2cap_info_req(struct l2cap_conn *conn, struct l2cap_cmd_hdr *cmd, u8 *data)
+{
+	struct l2cap_info_req *req = (struct l2cap_info_req *) data;
+	struct l2cap_info_rsp rsp;
+	u16 type;
+
+	type = __le16_to_cpu(req->type);
+
+	BT_DBG("type 0x%4.4x", type);
+
+	rsp.type   = __cpu_to_le16(type);
+	rsp.result = __cpu_to_le16(L2CAP_IR_NOTSUPP);
+	l2cap_send_rsp(conn, cmd->ident, L2CAP_INFO_RSP, sizeof(rsp), &rsp);
+	return 0;
+}
+
+static inline int l2cap_info_rsp(struct l2cap_conn *conn, struct l2cap_cmd_hdr *cmd, u8 *data)
+{
+	struct l2cap_info_rsp *rsp = (struct l2cap_info_rsp *) data;
+	u16 type, result;
+
+	type   = __le16_to_cpu(rsp->type);
+	result = __le16_to_cpu(rsp->result);
+
+	BT_DBG("type 0x%4.4x result 0x%2.2x", type, result);
+
+	return 0;
+}
+
 static inline void l2cap_sig_channel(struct l2cap_conn *conn, struct sk_buff *skb)
 {
 	u8 *data = skb->data;
@@ -1657,6 +1685,10 @@ static inline void l2cap_sig_channel(struct l2cap_conn *conn, struct sk_buff *sk
 		}
 
 		switch (cmd.code) {
+		case L2CAP_COMMAND_REJ:
+			/* FIXME: We should process this */
+			break;
+
 		case L2CAP_CONN_REQ:
 			err = l2cap_connect_req(conn, &cmd, data);
 			break;
@@ -1681,17 +1713,19 @@ static inline void l2cap_sig_channel(struct l2cap_conn *conn, struct sk_buff *sk
 			err = l2cap_disconnect_rsp(conn, &cmd, data);
 			break;
 
-		case L2CAP_COMMAND_REJ:
-			/* FIXME: We should process this */
-			break;
-
 		case L2CAP_ECHO_REQ:
 			l2cap_send_rsp(conn, cmd.ident, L2CAP_ECHO_RSP, cmd.len, data);
 			break;
 
 		case L2CAP_ECHO_RSP:
+			break;
+
 		case L2CAP_INFO_REQ:
+			err = l2cap_info_req(conn, &cmd, data);
+			break;
+
 		case L2CAP_INFO_RSP:
+			err = l2cap_info_rsp(conn, &cmd, data);
 			break;
 
 		default:
@@ -1704,7 +1738,7 @@ static inline void l2cap_sig_channel(struct l2cap_conn *conn, struct sk_buff *sk
 			struct l2cap_cmd_rej rej;
 			BT_DBG("error %d", err);
 
-			/* FIXME: Map err to a valid reason. */
+			/* FIXME: Map err to a valid reason */
 			rej.reason = __cpu_to_le16(0);
 			l2cap_send_rsp(conn, cmd.ident, L2CAP_COMMAND_REJ, sizeof(rej), &rej);
 		}
@@ -1737,7 +1771,7 @@ static inline int l2cap_data_channel(struct l2cap_conn *conn, u16 cid, struct sk
 	/* If socket recv buffers overflows we drop data here
 	 * which is *bad* because L2CAP has to be reliable.
 	 * But we don't have any other choice. L2CAP doesn't
-	 * provide flow control mechanism */
+	 * provide flow control mechanism. */
 
 	if (!sock_queue_rcv_skb(sk, skb))
 		goto done;
@@ -2210,7 +2244,7 @@ EXPORT_SYMBOL(l2cap_load);
 module_init(l2cap_init);
 module_exit(l2cap_exit);
 
-MODULE_AUTHOR("Maxim Krasnyansky <maxk@qualcomm.com>");
+MODULE_AUTHOR("Maxim Krasnyansky <maxk@qualcomm.com>, Marcel Holtmann <marcel@holtmann.org>");
 MODULE_DESCRIPTION("Bluetooth L2CAP ver " VERSION);
 MODULE_VERSION(VERSION);
 MODULE_LICENSE("GPL");
diff --git a/net/bluetooth/rfcomm/core.c b/net/bluetooth/rfcomm/core.c
index a2912da9c..f53a8b040 100644
--- a/net/bluetooth/rfcomm/core.c
+++ b/net/bluetooth/rfcomm/core.c
@@ -323,14 +323,11 @@ static int __rfcomm_dlc_open(struct rfcomm_dlc *d, bdaddr_t *src, bdaddr_t *dst,
 
 int rfcomm_dlc_open(struct rfcomm_dlc *d, bdaddr_t *src, bdaddr_t *dst, u8 channel)
 {
-	mm_segment_t fs;
 	int r;
 
 	rfcomm_lock();
 
-	fs = get_fs(); set_fs(KERNEL_DS);
 	r = __rfcomm_dlc_open(d, src, dst, channel);
-	set_fs(fs);
 
 	rfcomm_unlock();
 	return r;
@@ -376,14 +373,11 @@ static int __rfcomm_dlc_close(struct rfcomm_dlc *d, int err)
 
 int rfcomm_dlc_close(struct rfcomm_dlc *d, int err)
 {
-	mm_segment_t fs;
 	int r;
 
 	rfcomm_lock();
 
-	fs = get_fs(); set_fs(KERNEL_DS);
 	r = __rfcomm_dlc_close(d, err);
-	set_fs(fs);
 
 	rfcomm_unlock();
 	return r;
@@ -552,9 +546,8 @@ struct rfcomm_session *rfcomm_session_create(bdaddr_t *src, bdaddr_t *dst, int *
 {
 	struct rfcomm_session *s = NULL;
 	struct sockaddr_l2 addr;
-	struct l2cap_options opts;
 	struct socket *sock;
-	int    size;
+	struct sock *sk;
 
 	BT_DBG("%s %s", batostr(src), batostr(dst));
 
@@ -570,11 +563,10 @@ struct rfcomm_session *rfcomm_session_create(bdaddr_t *src, bdaddr_t *dst, int *
 		goto failed;
 
 	/* Set L2CAP options */
-	size = sizeof(opts);
-	sock->ops->getsockopt(sock, SOL_L2CAP, L2CAP_OPTIONS, (void *)&opts, &size);
-	
-	opts.imtu = RFCOMM_MAX_L2CAP_MTU;
-	sock->ops->setsockopt(sock, SOL_L2CAP, L2CAP_OPTIONS, (void *)&opts, size);
+	sk = sock->sk;
+	lock_sock(sk);
+	l2cap_pi(sk)->imtu = RFCOMM_MAX_L2CAP_MTU;
+	release_sock(sk);
 
 	s = rfcomm_session_add(sock, BT_BOUND);
 	if (!s) {
@@ -612,16 +604,14 @@ void rfcomm_session_getaddr(struct rfcomm_session *s, bdaddr_t *src, bdaddr_t *d
 static int rfcomm_send_frame(struct rfcomm_session *s, u8 *data, int len)
 {
 	struct socket *sock = s->sock;
-	struct iovec iv = { data, len };
+	struct kvec iv = { data, len };
 	struct msghdr msg;
 
 	BT_DBG("session %p len %d", s, len);
 
 	memset(&msg, 0, sizeof(msg));
-	msg.msg_iovlen = 1;
-	msg.msg_iov = &iv;
 
-	return sock_sendmsg(sock, &msg, len);
+	return kernel_sendmsg(sock, &msg, &iv, 1, len);
 }
 
 static int rfcomm_send_sabm(struct rfcomm_session *s, u8 dlci)
@@ -905,7 +895,7 @@ static int rfcomm_send_fcon(struct rfcomm_session *s, int cr)
 static int rfcomm_send_test(struct rfcomm_session *s, int cr, u8 *pattern, int len)
 {
 	struct socket *sock = s->sock;
-	struct iovec iv[3];
+	struct kvec iv[3];
 	struct msghdr msg;
 	unsigned char hdr[5], crc[1];
 
@@ -930,10 +920,8 @@ static int rfcomm_send_test(struct rfcomm_session *s, int cr, u8 *pattern, int l
 	iv[2].iov_len  = 1;
 
 	memset(&msg, 0, sizeof(msg));
-	msg.msg_iovlen = 3;
-	msg.msg_iov = iv;
 
-	return sock_sendmsg(sock, &msg, 6 + len);
+	return kernel_sendmsg(sock, &msg, iv, 3, 6 + len);
 }
 
 static int rfcomm_send_credits(struct rfcomm_session *s, u8 addr, u8 credits)
@@ -1749,10 +1737,10 @@ static void rfcomm_worker(void)
 static int rfcomm_add_listener(bdaddr_t *ba)
 {
 	struct sockaddr_l2 addr;
-	struct l2cap_options opts;
 	struct socket *sock;
+	struct sock *sk;
 	struct rfcomm_session *s;
-	int    size, err = 0;
+	int    err = 0;
 
 	/* Create socket */
 	err = rfcomm_l2sock_create(&sock);
@@ -1772,11 +1760,10 @@ static int rfcomm_add_listener(bdaddr_t *ba)
 	}
 
 	/* Set L2CAP options */
-	size = sizeof(opts);
-	sock->ops->getsockopt(sock, SOL_L2CAP, L2CAP_OPTIONS, (void *)&opts, &size);
-
-	opts.imtu = RFCOMM_MAX_L2CAP_MTU;
-	sock->ops->setsockopt(sock, SOL_L2CAP, L2CAP_OPTIONS, (void *)&opts, size);
+	sk = sock->sk;
+	lock_sock(sk);
+	l2cap_pi(sk)->imtu = RFCOMM_MAX_L2CAP_MTU;
+	release_sock(sk);
 
 	/* Start listening on the socket */
 	err = sock->ops->listen(sock, 10);
@@ -1820,8 +1807,6 @@ static int rfcomm_run(void *unused)
 	set_user_nice(current, -10);
 	current->flags |= PF_NOFREEZE;
 
-	set_fs(KERNEL_DS);
-
 	BT_DBG("");
 
 	rfcomm_add_listener(BDADDR_ANY);
diff --git a/net/bridge/br.c b/net/bridge/br.c
index 06fdee661..675d0709a 100644
--- a/net/bridge/br.c
+++ b/net/bridge/br.c
@@ -33,8 +33,6 @@ static int __init br_init(void)
 {
 	br_fdb_init();
 
-	br_sysfs_init();
-
 #ifdef CONFIG_BRIDGE_NETFILTER
 	if (br_netfilter_init())
 		return 1;
@@ -69,7 +67,6 @@ static void __exit br_deinit(void)
 #endif
 
 	br_handle_frame_hook = NULL;
-	br_sysfs_fini();
 	br_fdb_fini();
 }
 
diff --git a/net/bridge/br_device.c b/net/bridge/br_device.c
index b7e6adc0b..44a976221 100644
--- a/net/bridge/br_device.c
+++ b/net/bridge/br_device.c
@@ -28,43 +28,28 @@ static struct net_device_stats *br_dev_get_stats(struct net_device *dev)
 	return &br->statistics;
 }
 
-static int __br_dev_xmit(struct sk_buff *skb, struct net_device *dev)
+int br_dev_xmit(struct sk_buff *skb, struct net_device *dev)
 {
-	struct net_bridge *br;
-	unsigned char *dest;
+	struct net_bridge *br = netdev_priv(dev);
+	const unsigned char *dest = skb->data;
 	struct net_bridge_fdb_entry *dst;
 
-	br = dev->priv;
 	br->statistics.tx_packets++;
 	br->statistics.tx_bytes += skb->len;
 
-	dest = skb->mac.raw = skb->data;
+	skb->mac.raw = skb->data;
 	skb_pull(skb, ETH_HLEN);
 
-	if (dest[0] & 1) {
+	rcu_read_lock();
+	if (dest[0] & 1) 
 		br_flood_deliver(br, skb, 0);
-		return 0;
-	}
-
-	if ((dst = br_fdb_get(br, dest)) != NULL) {
+	else if ((dst = __br_fdb_get(br, dest)) != NULL)
 		br_deliver(dst->dst, skb);
-		br_fdb_put(dst);
-		return 0;
-	}
-
-	br_flood_deliver(br, skb, 0);
-	return 0;
-}
-
-int br_dev_xmit(struct sk_buff *skb, struct net_device *dev)
-{
-	int ret;
+	else
+		br_flood_deliver(br, skb, 0);
 
-	rcu_read_lock();
-	ret = __br_dev_xmit(skb, dev);
 	rcu_read_unlock();
-
-	return ret;
+	return 0;
 }
 
 static int br_dev_open(struct net_device *dev)
@@ -89,6 +74,15 @@ static int br_dev_stop(struct net_device *dev)
 	return 0;
 }
 
+static int br_change_mtu(struct net_device *dev, int new_mtu)
+{
+	if ((new_mtu < 68) || new_mtu > br_min_mtu(dev->priv))
+		return -EINVAL;
+
+	dev->mtu = new_mtu;
+	return 0;
+}
+
 static int br_dev_accept_fastpath(struct net_device *dev, struct dst_entry *dst)
 {
 	return -1;
@@ -105,6 +99,7 @@ void br_dev_setup(struct net_device *dev)
 	dev->hard_start_xmit = br_dev_xmit;
 	dev->open = br_dev_open;
 	dev->set_multicast_list = br_dev_set_multicast_list;
+	dev->change_mtu = br_change_mtu;
 	dev->destructor = free_netdev;
 	SET_MODULE_OWNER(dev);
 	dev->stop = br_dev_stop;
diff --git a/net/bridge/br_fdb.c b/net/bridge/br_fdb.c
index 324489dda..940699997 100644
--- a/net/bridge/br_fdb.c
+++ b/net/bridge/br_fdb.c
@@ -73,9 +73,9 @@ static __inline__ int br_mac_hash(const unsigned char *mac)
 
 static __inline__ void fdb_delete(struct net_bridge_fdb_entry *f)
 {
-	hlist_del(&f->hlist);
+	hlist_del_rcu(&f->hlist);
 	if (!f->is_static)
-		list_del(&f->age_list);
+		list_del(&f->u.age_list);
 
 	br_fdb_put(f);
 }
@@ -85,7 +85,7 @@ void br_fdb_changeaddr(struct net_bridge_port *p, const unsigned char *newaddr)
 	struct net_bridge *br = p->br;
 	int i;
 	
-	write_lock_bh(&br->hash_lock);
+	spin_lock_bh(&br->hash_lock);
 
 	/* Search all chains since old address/hash is unknown */
 	for (i = 0; i < BR_HASH_SIZE; i++) {
@@ -117,7 +117,7 @@ void br_fdb_changeaddr(struct net_bridge_port *p, const unsigned char *newaddr)
 	fdb_insert(br, p, newaddr, 1);
 
 
-	write_unlock_bh(&br->hash_lock);
+	spin_unlock_bh(&br->hash_lock);
 }
 
 void br_fdb_cleanup(unsigned long _data)
@@ -126,13 +126,15 @@ void br_fdb_cleanup(unsigned long _data)
 	struct list_head *l, *n;
 	unsigned long delay;
 
-	write_lock_bh(&br->hash_lock);
+	spin_lock_bh(&br->hash_lock);
 	delay = hold_time(br);
 
 	list_for_each_safe(l, n, &br->age_list) {
-		struct net_bridge_fdb_entry *f
-			= list_entry(l, struct net_bridge_fdb_entry, age_list);
-		unsigned long expires = f->ageing_timer + delay;
+		struct net_bridge_fdb_entry *f;
+		unsigned long expires;
+
+		f = list_entry(l, struct net_bridge_fdb_entry, u.age_list);
+		expires = f->ageing_timer + delay;
 
 		if (time_before_eq(expires, jiffies)) {
 			WARN_ON(f->is_static);
@@ -144,14 +146,14 @@ void br_fdb_cleanup(unsigned long _data)
 			break;
 		}
 	}
-	write_unlock_bh(&br->hash_lock);
+	spin_unlock_bh(&br->hash_lock);
 }
 
 void br_fdb_delete_by_port(struct net_bridge *br, struct net_bridge_port *p)
 {
 	int i;
 
-	write_lock_bh(&br->hash_lock);
+	spin_lock_bh(&br->hash_lock);
 	for (i = 0; i < BR_HASH_SIZE; i++) {
 		struct hlist_node *h, *g;
 		
@@ -182,37 +184,53 @@ void br_fdb_delete_by_port(struct net_bridge *br, struct net_bridge_port *p)
 		skip_delete: ;
 		}
 	}
-	write_unlock_bh(&br->hash_lock);
+	spin_unlock_bh(&br->hash_lock);
 }
 
-struct net_bridge_fdb_entry *br_fdb_get(struct net_bridge *br, unsigned char *addr)
+/* No locking or refcounting, assumes caller has no preempt (rcu_read_lock) */
+struct net_bridge_fdb_entry *__br_fdb_get(struct net_bridge *br,
+					  const unsigned char *addr)
 {
 	struct hlist_node *h;
+	struct net_bridge_fdb_entry *fdb;
 
-	read_lock_bh(&br->hash_lock);
-		
-	hlist_for_each(h, &br->hash[br_mac_hash(addr)]) {
-		struct net_bridge_fdb_entry *fdb
-			= hlist_entry(h, struct net_bridge_fdb_entry, hlist);
-
+	hlist_for_each_entry_rcu(fdb, h, &br->hash[br_mac_hash(addr)], hlist) {
 		if (!memcmp(fdb->addr.addr, addr, ETH_ALEN)) {
-			if (has_expired(br, fdb))
-				goto ret_null;
-
-			atomic_inc(&fdb->use_count);
-			read_unlock_bh(&br->hash_lock);
+			if (unlikely(has_expired(br, fdb)))
+				break;
 			return fdb;
 		}
 	}
- ret_null:
-	read_unlock_bh(&br->hash_lock);
+
 	return NULL;
 }
 
+/* Interface used by ATM hook that keeps a ref count */
+struct net_bridge_fdb_entry *br_fdb_get(struct net_bridge *br, 
+					unsigned char *addr)
+{
+	struct net_bridge_fdb_entry *fdb;
+
+	rcu_read_lock();
+	fdb = __br_fdb_get(br, addr);
+	if (fdb) 
+		atomic_inc(&fdb->use_count);
+	rcu_read_unlock();
+	return fdb;
+}
+
+static void fdb_rcu_free(struct rcu_head *head)
+{
+	struct net_bridge_fdb_entry *ent
+		= container_of(head, struct net_bridge_fdb_entry, u.rcu);
+	kmem_cache_free(br_fdb_cache, ent);
+}
+
+/* Set entry up for deletion with RCU  */
 void br_fdb_put(struct net_bridge_fdb_entry *ent)
 {
 	if (atomic_dec_and_test(&ent->use_count))
-		kmem_cache_free(br_fdb_cache, ent);
+		call_rcu(&ent->u.rcu, fdb_rcu_free);
 }
 
 /*
@@ -229,9 +247,9 @@ int br_fdb_fillbuf(struct net_bridge *br, void *buf,
 
 	memset(buf, 0, maxnum*sizeof(struct __fdb_entry));
 
-	read_lock_bh(&br->hash_lock);
+	rcu_read_lock();
 	for (i = 0; i < BR_HASH_SIZE; i++) {
-		hlist_for_each_entry(f, h, &br->hash[i], hlist) {
+		hlist_for_each_entry_rcu(f, h, &br->hash[i], hlist) {
 			if (num >= maxnum)
 				goto out;
 
@@ -255,7 +273,7 @@ int br_fdb_fillbuf(struct net_bridge *br, void *buf,
 	}
 
  out:
-	read_unlock_bh(&br->hash_lock);
+	rcu_read_unlock();
 
 	return num;
 }
@@ -298,7 +316,7 @@ static int fdb_insert(struct net_bridge *br, struct net_bridge_port *source,
 				return 0;
 
 			/* move to end of age list */
-			list_del(&fdb->age_list);
+			list_del(&fdb->u.age_list);
 			goto update;
 		}
 	}
@@ -309,7 +327,7 @@ static int fdb_insert(struct net_bridge *br, struct net_bridge_port *source,
 
 	memcpy(fdb->addr.addr, addr, ETH_ALEN);
 	atomic_set(&fdb->use_count, 1);
-	hlist_add_head(&fdb->hlist, &br->hash[hash]);
+	hlist_add_head_rcu(&fdb->hlist, &br->hash[hash]);
 
 	if (!timer_pending(&br->gc_timer)) {
 		br->gc_timer.expires = jiffies + hold_time(br);
@@ -322,7 +340,7 @@ static int fdb_insert(struct net_bridge *br, struct net_bridge_port *source,
 	fdb->is_static = is_local;
 	fdb->ageing_timer = jiffies;
 	if (!is_local) 
-		list_add_tail(&fdb->age_list, &br->age_list);
+		list_add_tail(&fdb->u.age_list, &br->age_list);
 
 	return 0;
 }
@@ -332,8 +350,8 @@ int br_fdb_insert(struct net_bridge *br, struct net_bridge_port *source,
 {
 	int ret;
 
-	write_lock_bh(&br->hash_lock);
+	spin_lock_bh(&br->hash_lock);
 	ret = fdb_insert(br, source, addr, is_local);
-	write_unlock_bh(&br->hash_lock);
+	spin_unlock_bh(&br->hash_lock);
 	return ret;
 }
diff --git a/net/bridge/br_forward.c b/net/bridge/br_forward.c
index 158976386..ef9f2095f 100644
--- a/net/bridge/br_forward.c
+++ b/net/bridge/br_forward.c
@@ -31,13 +31,17 @@ static inline int should_deliver(const struct net_bridge_port *p,
 
 int br_dev_queue_push_xmit(struct sk_buff *skb)
 {
+	if (skb->len > skb->dev->mtu) 
+		kfree_skb(skb);
+	else {
 #ifdef CONFIG_BRIDGE_NETFILTER
-	/* ip_refrag calls ip_fragment, which doesn't copy the MAC header. */
-	nf_bridge_maybe_copy_header(skb);
+		/* ip_refrag calls ip_fragment, doesn't copy the MAC header. */
+		nf_bridge_maybe_copy_header(skb);
 #endif
-	skb_push(skb, ETH_HLEN);
+		skb_push(skb, ETH_HLEN);
 
-	dev_queue_xmit(skb);
+		dev_queue_xmit(skb);
+	}
 
 	return 0;
 }
diff --git a/net/bridge/br_if.c b/net/bridge/br_if.c
index 8a6de043e..43d03734e 100644
--- a/net/bridge/br_if.c
+++ b/net/bridge/br_if.c
@@ -41,7 +41,7 @@ static int br_initial_port_cost(struct net_device *dev)
 	int err;
 
 	strncpy(ifr.ifr_name, dev->name, IFNAMSIZ);
-	ifr.ifr_data = (void *) &ecmd;
+	ifr.ifr_data = (void __user *) &ecmd;
 
 	old_fs = get_fs();
 	set_fs(KERNEL_DS);
@@ -75,9 +75,8 @@ static int br_initial_port_cost(struct net_device *dev)
 	return 100;	/* assume old 10Mbps */
 }
 
-static void destroy_nbp(void *arg)
+static void destroy_nbp(struct net_bridge_port *p)
 {
-	struct net_bridge_port *p = arg;
 	struct net_device *dev = p->dev;
 
 	dev->br_port = NULL;
@@ -88,6 +87,13 @@ static void destroy_nbp(void *arg)
 	br_sysfs_freeif(p);
 }
 
+static void destroy_nbp_rcu(struct rcu_head *head)
+{
+	struct net_bridge_port *p =
+			container_of(head, struct net_bridge_port, rcu);
+	destroy_nbp(p);
+}
+
 /* called with RTNL */
 static void del_nbp(struct net_bridge_port *p)
 {
@@ -108,7 +114,7 @@ static void del_nbp(struct net_bridge_port *p)
 	del_timer_sync(&p->forward_delay_timer);
 	del_timer_sync(&p->hold_timer);
 	
-	call_rcu(&p->rcu, destroy_nbp, p);
+	call_rcu(&p->rcu, destroy_nbp_rcu);
 }
 
 /* called with RTNL */
@@ -143,7 +149,7 @@ static struct net_device *new_bridge_dev(const char *name)
 
 	br->lock = SPIN_LOCK_UNLOCKED;
 	INIT_LIST_HEAD(&br->port_list);
-	br->hash_lock = RW_LOCK_UNLOCKED;
+	br->hash_lock = SPIN_LOCK_UNLOCKED;
 
 	br->bridge_id.prio[0] = 0x80;
 	br->bridge_id.prio[1] = 0x00;
@@ -289,6 +295,25 @@ int br_del_bridge(const char *name)
 	return ret;
 }
 
+/* Mtu of the bridge pseudo-device 1500 or the minimum of the ports */
+int br_min_mtu(const struct net_bridge *br)
+{
+	const struct net_bridge_port *p;
+	int mtu = 0;
+
+	ASSERT_RTNL();
+
+	if (list_empty(&br->port_list))
+		mtu = 1500;
+	else {
+		list_for_each_entry(p, &br->port_list, list) {
+			if (!mtu  || p->dev->mtu < mtu)
+				mtu = p->dev->mtu;
+		}
+	}
+	return mtu;
+}
+
 /* called with RTNL */
 int br_add_if(struct net_bridge *br, struct net_device *dev)
 {
@@ -319,9 +344,12 @@ int br_add_if(struct net_bridge *br, struct net_device *dev)
 
 		spin_lock_bh(&br->lock);
 		br_stp_recalculate_bridge_id(br);
-		if ((br->dev->flags & IFF_UP) && (dev->flags & IFF_UP))
+		if ((br->dev->flags & IFF_UP) 
+		    && (dev->flags & IFF_UP) && netif_carrier_ok(dev))
 			br_stp_enable_port(p);
 		spin_unlock_bh(&br->lock);
+
+		dev_set_mtu(br->dev, br_min_mtu(br));
 	}
 
 	return err;
diff --git a/net/bridge/br_input.c b/net/bridge/br_input.c
index 1c714c686..fdf8f9eb6 100644
--- a/net/bridge/br_input.c
+++ b/net/bridge/br_input.c
@@ -83,19 +83,17 @@ int br_handle_frame_finish(struct sk_buff *skb)
 		goto out;
 	}
 
-	dst = br_fdb_get(br, dest);
+	dst = __br_fdb_get(br, dest);
 	if (dst != NULL && dst->is_local) {
 		if (!passedup)
 			br_pass_frame_up(br, skb);
 		else
 			kfree_skb(skb);
-		br_fdb_put(dst);
 		goto out;
 	}
 
 	if (dst != NULL) {
 		br_forward(dst->dst, skb);
-		br_fdb_put(dst);
 		goto out;
 	}
 
diff --git a/net/bridge/br_ioctl.c b/net/bridge/br_ioctl.c
index cceb01866..363c73f28 100644
--- a/net/bridge/br_ioctl.c
+++ b/net/bridge/br_ioctl.c
@@ -403,6 +403,6 @@ int br_dev_ioctl(struct net_device *dev, struct ifreq *rq, int cmd)
 
 	}
 
-	printk(KERN_DEBUG "Bridge does not support ioctl 0x%x\n", cmd);
+	pr_debug("Bridge does not support ioctl 0x%x\n", cmd);
 	return -EOPNOTSUPP;
 }
diff --git a/net/bridge/br_netfilter.c b/net/bridge/br_netfilter.c
index 7313d06c9..404dda32b 100644
--- a/net/bridge/br_netfilter.c
+++ b/net/bridge/br_netfilter.c
@@ -800,11 +800,11 @@ static struct nf_hook_ops br_nf_ops[] = {
 #ifdef CONFIG_SYSCTL
 static
 int brnf_sysctl_call_tables(ctl_table *ctl, int write, struct file * filp,
-			void __user *buffer, size_t *lenp)
+			void __user *buffer, size_t *lenp, loff_t *ppos)
 {
 	int ret;
 
-	ret = proc_dointvec(ctl, write, filp, buffer, lenp);
+	ret = proc_dointvec(ctl, write, filp, buffer, lenp, ppos);
 
 	if (write && *(int *)(ctl->data))
 		*(int *)(ctl->data) = 1;
diff --git a/net/bridge/br_notify.c b/net/bridge/br_notify.c
index c59335e3b..d0702fbcb 100644
--- a/net/bridge/br_notify.c
+++ b/net/bridge/br_notify.c
@@ -19,54 +19,67 @@
 
 static int br_device_event(struct notifier_block *unused, unsigned long event, void *ptr);
 
-struct notifier_block br_device_notifier =
-{
+struct notifier_block br_device_notifier = {
 	.notifier_call = br_device_event
 };
 
+/*
+ * Handle changes in state of network devices enslaved to a bridge.
+ * 
+ * Note: don't care about up/down if bridge itself is down, because
+ *     port state is checked when bridge is brought up.
+ */
 static int br_device_event(struct notifier_block *unused, unsigned long event, void *ptr)
 {
-	struct net_device *dev;
-	struct net_bridge_port *p;
+	struct net_device *dev = ptr;
+	struct net_bridge_port *p = dev->br_port;
 	struct net_bridge *br;
 
-	dev = ptr;
-	p = dev->br_port;
-
+	/* not a port of a bridge */
 	if (p == NULL)
 		return NOTIFY_DONE;
 
 	br = p->br;
 
+	spin_lock_bh(&br->lock);
 	switch (event) {
+	case NETDEV_CHANGEMTU:
+		dev_set_mtu(br->dev, br_min_mtu(br));
+		break;
+
 	case NETDEV_CHANGEADDR:
-		spin_lock_bh(&br->lock);
 		br_fdb_changeaddr(p, dev->dev_addr);
-		if (br->dev->flags & IFF_UP)
-			br_stp_recalculate_bridge_id(br);
-		spin_unlock_bh(&br->lock);
+		br_stp_recalculate_bridge_id(br);
+		break;
+
+	case NETDEV_CHANGE:	/* device is up but carrier changed */
+		if (!(br->dev->flags & IFF_UP))
+			break;
+
+		if (netif_carrier_ok(dev)) {
+			if (p->state == BR_STATE_DISABLED)
+				br_stp_enable_port(p);
+		} else {
+			if (p->state != BR_STATE_DISABLED)
+				br_stp_disable_port(p);
+		}
 		break;
 
 	case NETDEV_DOWN:
-		if (br->dev->flags & IFF_UP) {
-			spin_lock_bh(&br->lock);
+		if (br->dev->flags & IFF_UP)
 			br_stp_disable_port(p);
-			spin_unlock_bh(&br->lock);
-		}
 		break;
 
 	case NETDEV_UP:
-		if (br->dev->flags & IFF_UP) {
-			spin_lock_bh(&br->lock);
+		if (netif_carrier_ok(dev) && (br->dev->flags & IFF_UP)) 
 			br_stp_enable_port(p);
-			spin_unlock_bh(&br->lock);
-		}
 		break;
 
 	case NETDEV_UNREGISTER:
 		br_del_if(br, dev);
 		break;
-	}
+	} 
+	spin_unlock_bh(&br->lock);
 
 	return NOTIFY_DONE;
 }
diff --git a/net/bridge/br_private.h b/net/bridge/br_private.h
index d3cd71517..d2b2fb27f 100644
--- a/net/bridge/br_private.h
+++ b/net/bridge/br_private.h
@@ -46,7 +46,10 @@ struct net_bridge_fdb_entry
 {
 	struct hlist_node		hlist;
 	struct net_bridge_port		*dst;
-	struct list_head		age_list;
+	union {
+		struct list_head	age_list;
+		struct rcu_head		rcu;
+	} u;
 	atomic_t			use_count;
 	unsigned long			ageing_timer;
 	mac_addr			addr;
@@ -86,7 +89,7 @@ struct net_bridge
 	struct list_head		port_list;
 	struct net_device		*dev;
 	struct net_device_stats		statistics;
-	rwlock_t			hash_lock;
+	spinlock_t			hash_lock;
 	struct hlist_head		hash[BR_HASH_SIZE];
 	struct list_head		age_list;
 
@@ -136,8 +139,10 @@ extern void br_fdb_changeaddr(struct net_bridge_port *p,
 extern void br_fdb_cleanup(unsigned long arg);
 extern void br_fdb_delete_by_port(struct net_bridge *br,
 			   struct net_bridge_port *p);
+extern struct net_bridge_fdb_entry *__br_fdb_get(struct net_bridge *br,
+						 const unsigned char *addr);
 extern struct net_bridge_fdb_entry *br_fdb_get(struct net_bridge *br,
-					unsigned char *addr);
+					       unsigned char *addr);
 extern void br_fdb_put(struct net_bridge_fdb_entry *ent);
 extern int br_fdb_fillbuf(struct net_bridge *br, void *buf, 
 			  unsigned long count, unsigned long off);
@@ -168,6 +173,7 @@ extern int br_add_if(struct net_bridge *br,
 	      struct net_device *dev);
 extern int br_del_if(struct net_bridge *br,
 	      struct net_device *dev);
+extern int br_min_mtu(const struct net_bridge *br);
 
 /* br_input.c */
 extern int br_handle_frame_finish(struct sk_buff *skb);
@@ -217,9 +223,6 @@ extern void br_sysfs_removeif(struct net_bridge_port *p);
 extern void br_sysfs_freeif(struct net_bridge_port *p);
 
 /* br_sysfs_br.c */
-extern struct subsystem bridge_subsys;
-extern void br_sysfs_init(void);
-extern void br_sysfs_fini(void);
 extern int br_sysfs_addbr(struct net_device *dev);
 extern void br_sysfs_delbr(struct net_device *dev);
 
@@ -228,8 +231,6 @@ extern void br_sysfs_delbr(struct net_device *dev);
 #define br_sysfs_addif(p)	(0)
 #define br_sysfs_removeif(p)	do { } while(0)
 #define br_sysfs_freeif(p)	kfree(p)
-#define br_sysfs_init()		do { } while(0)
-#define br_sysfs_fini()		do { } while(0)
 #define br_sysfs_addbr(dev)	(0)
 #define br_sysfs_delbr(dev)	do { } while(0)
 #endif /* CONFIG_SYSFS */
diff --git a/net/bridge/br_stp.c b/net/bridge/br_stp.c
index 9c5752df9..04ca0639a 100644
--- a/net/bridge/br_stp.c
+++ b/net/bridge/br_stp.c
@@ -18,6 +18,11 @@
 #include "br_private.h"
 #include "br_private_stp.h"
 
+/* since time values in bpdu are in jiffies and then scaled (1/256)
+ * before sending, make sure that is at least one.
+ */
+#define MESSAGE_AGE_INCR	((HZ < 256) ? 1 : (HZ/256))
+
 static const char *br_port_state_names[] = {
 	[BR_STATE_DISABLED] = "disabled", 
 	[BR_STATE_LISTENING] = "listening",
@@ -157,24 +162,25 @@ void br_transmit_config(struct net_bridge_port *p)
 	bpdu.root_path_cost = br->root_path_cost;
 	bpdu.bridge_id = br->bridge_id;
 	bpdu.port_id = p->port_id;
-	bpdu.message_age = 0;
-	if (!br_is_root_bridge(br)) {
+	if (br_is_root_bridge(br))
+		bpdu.message_age = 0;
+	else {
 		struct net_bridge_port *root
 			= br_get_port(br, br->root_port);
-		bpdu.max_age = root->message_age_timer.expires - jiffies;
-
-		if (bpdu.max_age <= 0) bpdu.max_age = 1;
+		bpdu.message_age = br->max_age
+			- (root->message_age_timer.expires - jiffies)
+			+ MESSAGE_AGE_INCR;
 	}
 	bpdu.max_age = br->max_age;
 	bpdu.hello_time = br->hello_time;
 	bpdu.forward_delay = br->forward_delay;
 
-	br_send_config_bpdu(p, &bpdu);
-
-	p->topology_change_ack = 0;
-	p->config_pending = 0;
-	
-	mod_timer(&p->hold_timer, jiffies + BR_HOLD_TIME);
+	if (bpdu.message_age < br->max_age) {
+		br_send_config_bpdu(p, &bpdu);
+		p->topology_change_ack = 0;
+		p->config_pending = 0;
+		mod_timer(&p->hold_timer, jiffies + BR_HOLD_TIME);
+	}
 }
 
 /* called under bridge lock */
@@ -293,7 +299,7 @@ void br_topology_change_detection(struct net_bridge *br)
 	int isroot = br_is_root_bridge(br);
 
 	pr_info("%s: topology change detected, %s\n", br->dev->name,
-		isroot ? "propgating" : "sending tcn bpdu");
+		isroot ? "propagating" : "sending tcn bpdu");
 
 	if (isroot) {
 		br->topology_change = 1;
diff --git a/net/bridge/br_stp_if.c b/net/bridge/br_stp_if.c
index 9e1d296b6..6c08fefcc 100644
--- a/net/bridge/br_stp_if.c
+++ b/net/bridge/br_stp_if.c
@@ -52,7 +52,7 @@ void br_stp_enable_bridge(struct net_bridge *br)
 	br_config_bpdu_generation(br);
 
 	list_for_each_entry(p, &br->port_list, list) {
-		if (p->dev->flags & IFF_UP)
+		if ((p->dev->flags & IFF_UP) && netif_carrier_ok(p->dev))
 			br_stp_enable_port(p);
 
 	}
diff --git a/net/bridge/br_sysfs_br.c b/net/bridge/br_sysfs_br.c
index 61f00fa3b..98cf53c81 100644
--- a/net/bridge/br_sysfs_br.c
+++ b/net/bridge/br_sysfs_br.c
@@ -300,25 +300,6 @@ static struct bin_attribute bridge_forward = {
 	.read = brforward_read,
 };
 
-
-/*
- * This is a dummy kset so bridge objects don't cause
- * hotplug events 
- */
-struct subsystem bridge_subsys = { 
-	.kset = { .hotplug_ops = NULL },
-};
-
-void br_sysfs_init(void)
-{
-	subsystem_register(&bridge_subsys);
-}
-
-void br_sysfs_fini(void)
-{
-	subsystem_unregister(&bridge_subsys);
-}
-
 /*
  * Add entries in sysfs onto the existing network class device
  * for the bridge.
@@ -353,7 +334,7 @@ int br_sysfs_addbr(struct net_device *dev)
 	
 	kobject_set_name(&br->ifobj, SYSFS_BRIDGE_PORT_SUBDIR);
 	br->ifobj.ktype = NULL;
-	br->ifobj.kset = &bridge_subsys.kset;
+	br->ifobj.kset = NULL;
 	br->ifobj.parent = brobj;
 
 	err = kobject_register(&br->ifobj);
diff --git a/net/bridge/br_sysfs_if.c b/net/bridge/br_sysfs_if.c
index 178822116..567249bf9 100644
--- a/net/bridge/br_sysfs_if.c
+++ b/net/bridge/br_sysfs_if.c
@@ -227,7 +227,7 @@ int br_sysfs_addif(struct net_bridge_port *p)
 	kobject_set_name(&p->kobj, SYSFS_BRIDGE_PORT_ATTR);
 	p->kobj.ktype = &brport_ktype;
 	p->kobj.parent = &(p->dev->class_dev.kobj);
-	p->kobj.kset = &bridge_subsys.kset;
+	p->kobj.kset = NULL;
 
 	err = kobject_add(&p->kobj);
 	if(err)
diff --git a/net/core/Makefile b/net/core/Makefile
index a1a8ff3c2..e9b21b941 100644
--- a/net/core/Makefile
+++ b/net/core/Makefile
@@ -2,7 +2,7 @@
 # Makefile for the Linux networking core.
 #
 
-obj-y := sock.o skbuff.o iovec.o datagram.o scm.o
+obj-y := sock.o skbuff.o iovec.o datagram.o stream.o scm.o
 
 obj-$(CONFIG_SYSCTL) += sysctl_net_core.o
 
diff --git a/net/core/dev.c b/net/core/dev.c
index 94565597b..0301ffcdc 100644
--- a/net/core/dev.c
+++ b/net/core/dev.c
@@ -107,11 +107,13 @@
 #include <linux/module.h>
 #include <linux/kallsyms.h>
 #include <linux/netpoll.h>
+#include <linux/rcupdate.h>
 #ifdef CONFIG_NET_RADIO
 #include <linux/wireless.h>		/* Note : will define WIRELESS_EXT */
 #include <net/iw_handler.h>
 #endif	/* CONFIG_NET_RADIO */
 #include <asm/current.h>
+#include <linux/vs_network.h>
 
 /* This define, if set, will randomly drop a packet when congestion
  * is more than moderate.  It helps fairness in the multi-interface
@@ -215,11 +217,6 @@ static struct notifier_block *netdev_chain;
  */
 DEFINE_PER_CPU(struct softnet_data, softnet_data) = { 0, };
 
-#ifdef CONFIG_NET_FASTROUTE
-int netdev_fastroute;
-int netdev_fastroute_obstacles;
-#endif
-
 #ifdef CONFIG_SYSFS
 extern int netdev_sysfs_init(void);
 extern int netdev_register_sysfs(struct net_device *);
@@ -277,12 +274,6 @@ void dev_add_pack(struct packet_type *pt)
 	int hash;
 
 	spin_lock_bh(&ptype_lock);
-#ifdef CONFIG_NET_FASTROUTE
-	if (pt->af_packet_priv) {
-		netdev_fastroute_obstacles++;
-		dev_clear_fastroute(pt->dev);
-	}
-#endif
 	if (pt->type == htons(ETH_P_ALL)) {
 		netdev_nit++;
 		list_add_rcu(&pt->list, &ptype_all);
@@ -325,10 +316,6 @@ void __dev_remove_pack(struct packet_type *pt)
 
 	list_for_each_entry(pt1, head, list) {
 		if (pt == pt1) {
-#ifdef CONFIG_NET_FASTROUTE
-			if (pt->af_packet_priv)
-				netdev_fastroute_obstacles--;
-#endif
 			list_del_rcu(&pt->list);
 			goto out;
 		}
@@ -970,39 +957,6 @@ int dev_open(struct net_device *dev)
 	return ret;
 }
 
-#ifdef CONFIG_NET_FASTROUTE
-
-static void dev_do_clear_fastroute(struct net_device *dev)
-{
-	if (dev->accept_fastpath) {
-		int i;
-
-		for (i = 0; i <= NETDEV_FASTROUTE_HMASK; i++) {
-			struct dst_entry *dst;
-
-			write_lock_irq(&dev->fastpath_lock);
-			dst = dev->fastpath[i];
-			dev->fastpath[i] = NULL;
-			write_unlock_irq(&dev->fastpath_lock);
-
-			dst_release(dst);
-		}
-	}
-}
-
-void dev_clear_fastroute(struct net_device *dev)
-{
-	if (dev) {
-		dev_do_clear_fastroute(dev);
-	} else {
-		read_lock(&dev_base_lock);
-		for (dev = dev_base; dev; dev = dev->next)
-			dev_do_clear_fastroute(dev);
-		read_unlock(&dev_base_lock);
-	}
-}
-#endif
-
 /**
  *	dev_close - shutdown an interface.
  *	@dev: device to shutdown
@@ -1055,9 +1009,6 @@ int dev_close(struct net_device *dev)
 	 */
 
 	dev->flags &= ~IFF_UP;
-#ifdef CONFIG_NET_FASTROUTE
-	dev_clear_fastroute(dev);
-#endif
 
 	/*
 	 * Tell people we are down
@@ -1305,6 +1256,27 @@ int __skb_linearize(struct sk_buff *skb, int gfp_mask)
 	return 0;
 }
 
+#define HARD_TX_LOCK_BH(dev, cpu) {			\
+	if ((dev->features & NETIF_F_LLTX) == 0) {	\
+		spin_lock_bh(&dev->xmit_lock);		\
+		dev->xmit_lock_owner = cpu;		\
+	}						\
+}
+
+#define HARD_TX_UNLOCK_BH(dev) {			\
+	if ((dev->features & NETIF_F_LLTX) == 0) {	\
+		dev->xmit_lock_owner = -1;		\
+		spin_unlock_bh(&dev->xmit_lock);	\
+	}						\
+}
+
+static inline void qdisc_run(struct net_device *dev)
+{
+	while (!netif_queue_stopped(dev) &&
+	       qdisc_restart(dev)<0)
+		/* NOTHING */;
+}
+
 /**
  *	dev_queue_xmit - transmit a buffer
  *	@skb: buffer to transmit
@@ -1348,18 +1320,38 @@ int dev_queue_xmit(struct sk_buff *skb)
 	      	if (skb_checksum_help(&skb, 0))
 	      		goto out_kfree_skb;
 
-	/* Grab device queue */
-	spin_lock_bh(&dev->queue_lock);
+	rcu_read_lock();
+	/* Updates of qdisc are serialized by queue_lock. 
+	 * The struct Qdisc which is pointed to by qdisc is now a 
+	 * rcu structure - it may be accessed without acquiring 
+	 * a lock (but the structure may be stale.) The freeing of the
+	 * qdisc will be deferred until it's known that there are no 
+	 * more references to it.
+	 * 
+	 * If the qdisc has an enqueue function, we still need to 
+	 * hold the queue_lock before calling it, since queue_lock
+	 * also serializes access to the device queue.
+	 */
+
 	q = dev->qdisc;
+	smp_read_barrier_depends();
+#ifdef CONFIG_NET_CLS_ACT
+	skb->tc_verd = SET_TC_AT(skb->tc_verd,AT_EGRESS);
+#endif
 	if (q->enqueue) {
+		/* Grab device queue */
+		spin_lock_bh(&dev->queue_lock);
+
 		rc = q->enqueue(skb, q);
 
 		qdisc_run(dev);
 
 		spin_unlock_bh(&dev->queue_lock);
+		rcu_read_unlock();
 		rc = rc == NET_XMIT_BYPASS ? NET_XMIT_SUCCESS : rc;
 		goto out;
 	}
+	rcu_read_unlock();
 
 	/* The device has no queue. Common case for software devices:
 	   loopback, all the sorts of tunnels...
@@ -1374,18 +1366,12 @@ int dev_queue_xmit(struct sk_buff *skb)
 	   Either shot noqueue qdisc, it is even simpler 8)
 	 */
 	if (dev->flags & IFF_UP) {
-		int cpu = smp_processor_id();
+		int cpu = get_cpu();
 
 		if (dev->xmit_lock_owner != cpu) {
-			/*
-			 * The spin_lock effectivly does a preempt lock, but 
-			 * we are about to drop that...
-			 */
-			preempt_disable();
-			spin_unlock(&dev->queue_lock);
-			spin_lock(&dev->xmit_lock);
-			dev->xmit_lock_owner = cpu;
-			preempt_enable();
+
+			HARD_TX_LOCK_BH(dev, cpu);
+			put_cpu();
 
 			if (!netif_queue_stopped(dev)) {
 				if (netdev_nit)
@@ -1393,18 +1379,17 @@ int dev_queue_xmit(struct sk_buff *skb)
 
 				rc = 0;
 				if (!dev->hard_start_xmit(skb, dev)) {
-					dev->xmit_lock_owner = -1;
-					spin_unlock_bh(&dev->xmit_lock);
+					HARD_TX_UNLOCK_BH(dev);
 					goto out;
 				}
 			}
-			dev->xmit_lock_owner = -1;
-			spin_unlock_bh(&dev->xmit_lock);
+			HARD_TX_UNLOCK_BH(dev);
 			if (net_ratelimit())
 				printk(KERN_CRIT "Virtual device %s asks to "
 				       "queue packet!\n", dev->name);
 			goto out_enetdown;
 		} else {
+			put_cpu();
 			/* Recursion is detected! It is possible,
 			 * unfortunately */
 			if (net_ratelimit())
@@ -1412,7 +1397,6 @@ int dev_queue_xmit(struct sk_buff *skb)
 				       "%s, fix it urgently!\n", dev->name);
 		}
 	}
-	spin_unlock_bh(&dev->queue_lock);
 out_enetdown:
 	rc = -ENETDOWN;
 out_kfree_skb:
@@ -1731,6 +1715,48 @@ static inline int __handle_bridge(struct sk_buff *skb,
 	return 0;
 }
 
+
+#ifdef CONFIG_NET_CLS_ACT
+/* TODO: Maybe we should just force sch_ingress to be compiled in
+ * when CONFIG_NET_CLS_ACT is? otherwise some useless instructions
+ * a compare and 2 stores extra right now if we dont have it on
+ * but have CONFIG_NET_CLS_ACT
+ * NOTE: This doesnt stop any functionality; if you dont have 
+ * the ingress scheduler, you just cant add policies on ingress.
+ *
+ */
+int ing_filter(struct sk_buff *skb) 
+{
+	struct Qdisc *q;
+	struct net_device *dev = skb->dev;
+	int result = TC_ACT_OK;
+	
+	if (dev->qdisc_ingress) {
+		__u32 ttl = (__u32) G_TC_RTTL(skb->tc_verd);
+		if (MAX_RED_LOOP < ttl++) {
+			printk("Redir loop detected Dropping packet (%s->%s)\n",
+				skb->input_dev?skb->input_dev->name:"??",skb->dev->name);
+			return TC_ACT_SHOT;
+		}
+
+		skb->tc_verd = SET_TC_RTTL(skb->tc_verd,ttl);
+
+		skb->tc_verd = SET_TC_AT(skb->tc_verd,AT_INGRESS);
+		if (NULL == skb->input_dev) {
+			skb->input_dev = skb->dev;
+			printk("ing_filter:  fixed  %s out %s\n",skb->input_dev->name,skb->dev->name);
+		}
+		spin_lock(&dev->ingress_lock);
+		if ((q = dev->qdisc_ingress) != NULL)
+			result = q->enqueue(skb, q);
+		spin_unlock(&dev->ingress_lock);
+
+	}
+
+	return result;
+}
+#endif
+
 int netif_receive_skb(struct sk_buff *skb)
 {
 	struct packet_type *ptype, *pt_prev;
@@ -1751,17 +1777,18 @@ int netif_receive_skb(struct sk_buff *skb)
 
 	__get_cpu_var(netdev_rx_stat).total++;
 
-#ifdef CONFIG_NET_FASTROUTE
-	if (skb->pkt_type == PACKET_FASTROUTE) {
-		__get_cpu_var(netdev_rx_stat).fastroute_deferred_out++;
-		return dev_queue_xmit(skb);
-	}
-#endif
-
 	skb->h.raw = skb->nh.raw = skb->data;
 	skb->mac_len = skb->nh.raw - skb->mac.raw;
 
 	pt_prev = NULL;
+#ifdef CONFIG_NET_CLS_ACT
+	if (skb->tc_verd & TC_NCLS) {
+		skb->tc_verd = CLR_TC_NCLS(skb->tc_verd);
+		rcu_read_lock();
+		goto ncls;
+	}
+ #endif
+
 	rcu_read_lock();
 	list_for_each_entry_rcu(ptype, &ptype_all, list) {
 		if (!ptype->dev || ptype->dev == skb->dev) {
@@ -1771,6 +1798,26 @@ int netif_receive_skb(struct sk_buff *skb)
 		}
 	}
 
+#ifdef CONFIG_NET_CLS_ACT
+	if (pt_prev) {
+		atomic_inc(&skb->users);
+		ret = pt_prev->func(skb, skb->dev, pt_prev);
+		pt_prev = NULL; /* noone else should process this after*/
+	} else {
+		skb->tc_verd = SET_TC_OK2MUNGE(skb->tc_verd);
+	}
+
+	ret = ing_filter(skb);
+
+	if (ret == TC_ACT_SHOT || (ret == TC_ACT_STOLEN)) {
+		kfree_skb(skb);
+		goto out;
+	}
+
+	skb->tc_verd = 0;
+ncls:
+#endif
+
 	handle_diverter(skb);
 
 	if (__handle_bridge(skb, &pt_prev, &ret))
@@ -2275,13 +2322,6 @@ void dev_set_promiscuity(struct net_device *dev, int inc)
 	if ((dev->promiscuity += inc) == 0)
 		dev->flags &= ~IFF_PROMISC;
 	if (dev->flags ^ old_flags) {
-#ifdef CONFIG_NET_FASTROUTE
-		if (dev->flags & IFF_PROMISC) {
-			netdev_fastroute_obstacles++;
-			dev_clear_fastroute(dev);
-		} else
-			netdev_fastroute_obstacles--;
-#endif
 		dev_mc_upload(dev);
 		printk(KERN_INFO "device %s %s promiscuous mode\n",
 		       dev->name, (dev->flags & IFF_PROMISC) ? "entered" :
@@ -2830,8 +2870,8 @@ int register_netdevice(struct net_device *dev)
 	spin_lock_init(&dev->queue_lock);
 	spin_lock_init(&dev->xmit_lock);
 	dev->xmit_lock_owner = -1;
-#ifdef CONFIG_NET_FASTROUTE
-	dev->fastpath_lock = RW_LOCK_UNLOCKED;
+#ifdef CONFIG_NET_CLS_ACT
+	spin_lock_init(&dev->ingress_lock);
 #endif
 
 	ret = alloc_divert_blk(dev);
@@ -2939,7 +2979,6 @@ static void netdev_wait_allrefs(struct net_device *dev)
 	while (atomic_read(&dev->refcnt) != 0) {
 		if (time_after(jiffies, rebroadcast_time + 1 * HZ)) {
 			rtnl_shlock();
-			rtnl_exlock();
 
 			/* Rebroadcast unregister notification */
 			notifier_call_chain(&netdev_chain,
@@ -2956,7 +2995,6 @@ static void netdev_wait_allrefs(struct net_device *dev)
 				linkwatch_run_queue();
 			}
 
-			rtnl_exunlock();
 			rtnl_shunlock();
 
 			rebroadcast_time = jiffies;
@@ -3154,10 +3192,6 @@ int unregister_netdevice(struct net_device *dev)
 
 	synchronize_net();
 
-#ifdef CONFIG_NET_FASTROUTE
-	dev_clear_fastroute(dev);
-#endif
-
 	/* Shutdown queueing discipline. */
 	dev_shutdown(dev);
 
@@ -3183,6 +3217,8 @@ int unregister_netdevice(struct net_device *dev)
 	/* Finish processing unregister after unlock */
 	net_set_todo(dev);
 
+	synchronize_net();
+
 	dev_put(dev);
 	return 0;
 }
@@ -3329,6 +3365,8 @@ EXPORT_SYMBOL(dev_queue_xmit_nit);
 EXPORT_SYMBOL(dev_remove_pack);
 EXPORT_SYMBOL(dev_set_allmulti);
 EXPORT_SYMBOL(dev_set_promiscuity);
+EXPORT_SYMBOL(dev_change_flags);
+EXPORT_SYMBOL(dev_set_mtu);
 EXPORT_SYMBOL(free_netdev);
 EXPORT_SYMBOL(netdev_boot_setup_check);
 EXPORT_SYMBOL(netdev_set_master);
@@ -3346,10 +3384,7 @@ EXPORT_SYMBOL(unregister_netdevice_notifier);
 #if defined(CONFIG_BRIDGE) || defined(CONFIG_BRIDGE_MODULE)
 EXPORT_SYMBOL(br_handle_frame_hook);
 #endif
-/* for 801q VLAN support */
-#if defined(CONFIG_VLAN_8021Q) || defined(CONFIG_VLAN_8021Q_MODULE)
-EXPORT_SYMBOL(dev_change_flags);
-#endif
+
 #ifdef CONFIG_KMOD
 EXPORT_SYMBOL(dev_load);
 #endif
@@ -3359,9 +3394,10 @@ EXPORT_SYMBOL(netdev_fc_xoff);
 EXPORT_SYMBOL(netdev_register_fc);
 EXPORT_SYMBOL(netdev_unregister_fc);
 #endif
-#ifdef CONFIG_NET_FASTROUTE
-EXPORT_SYMBOL(netdev_fastroute);
-EXPORT_SYMBOL(netdev_fastroute_obstacles);
+
+#ifdef CONFIG_NET_CLS_ACT
+EXPORT_SYMBOL(ing_filter);
 #endif
 
+
 EXPORT_PER_CPU_SYMBOL(softnet_data);
diff --git a/net/core/dst.c b/net/core/dst.c
index 571ef1f2c..9f14ae8a7 100644
--- a/net/core/dst.c
+++ b/net/core/dst.c
@@ -19,6 +19,8 @@
 
 #include <net/dst.h>
 
+const char dst_underflow_bug_msg[] = KERN_DEBUG "BUG: dst underflow %d: %p at %p\n";
+
 /* Locking strategy:
  * 1) Garbage collection state of dead destination cache
  *    entries is protected by dst_lock.
@@ -210,6 +212,41 @@ again:
 	return NULL;
 }
 
+/* Dirty hack. We did it in 2.2 (in __dst_free),
+ * we have _very_ good reasons not to repeat
+ * this mistake in 2.3, but we have no choice
+ * now. _It_ _is_ _explicit_ _deliberate_
+ * _race_ _condition_.
+ *
+ * Commented and originally written by Alexey.
+ */
+static void dst_ifdown(struct dst_entry *dst, int unregister)
+{
+	struct net_device *dev = dst->dev;
+
+	if (!unregister) {
+		dst->input = dst_discard_in;
+		dst->output = dst_discard_out;
+	}
+
+	do {
+		if (unregister) {
+			dst->dev = &loopback_dev;
+			dev_hold(&loopback_dev);
+			dev_put(dev);
+			if (dst->neighbour && dst->neighbour->dev == dev) {
+				dst->neighbour->dev = &loopback_dev;
+				dev_put(dev);
+				dev_hold(&loopback_dev);
+			}
+		}
+
+		if (dst->ops->ifdown)
+			dst->ops->ifdown(dst, unregister);
+	} while ((dst = dst->child) && dst->flags & DST_NOHASH &&
+		 dst->dev == dev);
+}
+
 static int dst_dev_event(struct notifier_block *this, unsigned long event, void *ptr)
 {
 	struct net_device *dev = ptr;
@@ -220,31 +257,8 @@ static int dst_dev_event(struct notifier_block *this, unsigned long event, void
 	case NETDEV_DOWN:
 		spin_lock_bh(&dst_lock);
 		for (dst = dst_garbage_list; dst; dst = dst->next) {
-			if (dst->dev == dev) {
-				/* Dirty hack. We did it in 2.2 (in __dst_free),
-				   we have _very_ good reasons not to repeat
-				   this mistake in 2.3, but we have no choice
-				   now. _It_ _is_ _explicit_ _deliberate_
-				   _race_ _condition_.
-				 */
-				if (event!=NETDEV_DOWN &&
-				    dst->output == dst_discard_out) {
-					dst->dev = &loopback_dev;
-					dev_hold(&loopback_dev);
-					dev_put(dev);
-					dst->output = dst_discard_out;
-					if (dst->neighbour && dst->neighbour->dev == dev) {
-						dst->neighbour->dev = &loopback_dev;
-						dev_put(dev);
-						dev_hold(&loopback_dev);
-					}
-				} else {
-					dst->input = dst_discard_in;
-					dst->output = dst_discard_out;
-				}
-				if (dst->ops->ifdown)
-					dst->ops->ifdown(dst, event != NETDEV_DOWN);
-			}
+			if (dst->dev == dev)
+				dst_ifdown(dst, event != NETDEV_DOWN);
 		}
 		spin_unlock_bh(&dst_lock);
 		break;
@@ -261,6 +275,7 @@ void __init dst_init(void)
 	register_netdevice_notifier(&dst_dev_notifier);
 }
 
+EXPORT_SYMBOL(dst_underflow_bug_msg);
 EXPORT_SYMBOL(__dst_free);
 EXPORT_SYMBOL(dst_alloc);
 EXPORT_SYMBOL(dst_destroy);
diff --git a/net/core/ethtool.c b/net/core/ethtool.c
index d996db798..866f29277 100644
--- a/net/core/ethtool.c
+++ b/net/core/ethtool.c
@@ -157,7 +157,7 @@ static int ethtool_get_regs(struct net_device *dev, char __user *useraddr)
 	if (copy_to_user(useraddr, &regs, sizeof(regs)))
 		goto out;
 	useraddr += offsetof(struct ethtool_regs, data);
-	if (copy_to_user(useraddr, regbuf, reglen))
+	if (copy_to_user(useraddr, regbuf, regs.len))
 		goto out;
 	ret = 0;
 
diff --git a/net/core/link_watch.c b/net/core/link_watch.c
index ae661b3a3..6dd61ea39 100644
--- a/net/core/link_watch.c
+++ b/net/core/link_watch.c
@@ -93,9 +93,7 @@ static void linkwatch_event(void *dummy)
 	clear_bit(LW_RUNNING, &linkwatch_flags);
 
 	rtnl_shlock();
-	rtnl_exlock();
 	linkwatch_run_queue();
-	rtnl_exunlock();
 	rtnl_shunlock();
 }
 
diff --git a/net/core/net-sysfs.c b/net/core/net-sysfs.c
index 16baf92f6..46d26fc92 100644
--- a/net/core/net-sysfs.c
+++ b/net/core/net-sysfs.c
@@ -356,7 +356,7 @@ static int netdev_hotplug(struct class_device *cd, char **envp,
 	if ((size <= 0) || (i >= num_envp))
 		return -ENOMEM;
 
-	envp[i] = 0;
+	envp[i] = NULL;
 	return 0;
 }
 #endif
@@ -414,7 +414,7 @@ int netdev_register_sysfs(struct net_device *net)
 	if ((ret = class_device_register(class_dev)))
 		goto out;
 
-	for (i = 0; (attr = net_class_attributes[i]); i++) {
+	for (i = 0; (attr = net_class_attributes[i]) != NULL; i++) {
 		if ((ret = class_device_create_file(class_dev, attr)))
 		    goto out_unreg;
 	}
diff --git a/net/core/netpoll.c b/net/core/netpoll.c
index 4115945f3..daac16887 100644
--- a/net/core/netpoll.c
+++ b/net/core/netpoll.c
@@ -237,14 +237,14 @@ static void arp_reply(struct sk_buff *skb)
 	struct sk_buff *send_skb;
 	unsigned long flags;
 	struct list_head *p;
-	struct netpoll *np = 0;
+	struct netpoll *np = NULL;
 
 	spin_lock_irqsave(&rx_list_lock, flags);
 	list_for_each(p, &rx_list) {
 		np = list_entry(p, struct netpoll, rx_list);
 		if ( np->dev == skb->dev )
 			break;
-		np = 0;
+		np = NULL;
 	}
 	spin_unlock_irqrestore(&rx_list_lock, flags);
 
@@ -411,7 +411,7 @@ int netpoll_parse_options(struct netpoll *np, char *opt)
 		if ((delim = strchr(cur, '@')) == NULL)
 			goto parse_failed;
 		*delim=0;
-		np->local_port=simple_strtol(cur, 0, 10);
+		np->local_port=simple_strtol(cur, NULL, 10);
 		cur=delim;
 	}
 	cur++;
@@ -446,7 +446,7 @@ int netpoll_parse_options(struct netpoll *np, char *opt)
 		if ((delim = strchr(cur, '@')) == NULL)
 			goto parse_failed;
 		*delim=0;
-		np->remote_port=simple_strtol(cur, 0, 10);
+		np->remote_port=simple_strtol(cur, NULL, 10);
 		cur=delim;
 	}
 	cur++;
@@ -468,29 +468,29 @@ int netpoll_parse_options(struct netpoll *np, char *opt)
 		if ((delim = strchr(cur, ':')) == NULL)
 			goto parse_failed;
 		*delim=0;
-		np->remote_mac[0]=simple_strtol(cur, 0, 16);
+		np->remote_mac[0]=simple_strtol(cur, NULL, 16);
 		cur=delim+1;
 		if ((delim = strchr(cur, ':')) == NULL)
 			goto parse_failed;
 		*delim=0;
-		np->remote_mac[1]=simple_strtol(cur, 0, 16);
+		np->remote_mac[1]=simple_strtol(cur, NULL, 16);
 		cur=delim+1;
 		if ((delim = strchr(cur, ':')) == NULL)
 			goto parse_failed;
 		*delim=0;
-		np->remote_mac[2]=simple_strtol(cur, 0, 16);
+		np->remote_mac[2]=simple_strtol(cur, NULL, 16);
 		cur=delim+1;
 		if ((delim = strchr(cur, ':')) == NULL)
 			goto parse_failed;
 		*delim=0;
-		np->remote_mac[3]=simple_strtol(cur, 0, 16);
+		np->remote_mac[3]=simple_strtol(cur, NULL, 16);
 		cur=delim+1;
 		if ((delim = strchr(cur, ':')) == NULL)
 			goto parse_failed;
 		*delim=0;
-		np->remote_mac[4]=simple_strtol(cur, 0, 16);
+		np->remote_mac[4]=simple_strtol(cur, NULL, 16);
 		cur=delim+1;
-		np->remote_mac[5]=simple_strtol(cur, 0, 16);
+		np->remote_mac[5]=simple_strtol(cur, NULL, 16);
 	}
 
 	printk(KERN_INFO "%s: remote ethernet address "
@@ -620,7 +620,7 @@ void netpoll_cleanup(struct netpoll *np)
 	}
 
 	dev_put(np->dev);
-	np->dev = 0;
+	np->dev = NULL;
 }
 
 int netpoll_trap(void)
diff --git a/net/core/pktgen.c b/net/core/pktgen.c
index 3821caa36..d1a62cddb 100644
--- a/net/core/pktgen.c
+++ b/net/core/pktgen.c
@@ -56,6 +56,7 @@
  */
 
 #include <linux/module.h>
+#include <linux/moduleparam.h>
 #include <linux/kernel.h>
 #include <linux/sched.h>
 #include <linux/types.h>
@@ -1355,7 +1356,7 @@ static int __init init(void)
 		pginfos[i].udp_dst_max = 9;
 		
 		sprintf(pginfos[i].fname, "net/%s/pg%i", PG_PROC_DIR, i);
-		pginfos[i].proc_ent = create_proc_entry(pginfos[i].fname, 0600, 0);
+		pginfos[i].proc_ent = create_proc_entry(pginfos[i].fname, 0600, NULL);
 		if (!pginfos[i].proc_ent) {
 			printk("pktgen: Error: cannot create net/%s/pg procfs entry.\n", PG_PROC_DIR);
 			goto cleanup_mem;
@@ -1366,7 +1367,7 @@ static int __init init(void)
 		pginfos[i].proc_ent->owner = THIS_MODULE;
 
 		sprintf(pginfos[i].busy_fname, "net/%s/pg_busy%i",  PG_PROC_DIR, i);
-		pginfos[i].busy_proc_ent = create_proc_entry(pginfos[i].busy_fname, 0, 0);
+		pginfos[i].busy_proc_ent = create_proc_entry(pginfos[i].busy_fname, 0, NULL);
 		if (!pginfos[i].busy_proc_ent) {
 			printk("pktgen: Error: cannot create net/%s/pg_busy procfs entry.\n", PG_PROC_DIR);
 			goto cleanup_mem;
@@ -1409,7 +1410,7 @@ module_exit(cleanup);
 MODULE_AUTHOR("Robert Olsson <robert.olsson@its.uu.se");
 MODULE_DESCRIPTION("Packet Generator tool");
 MODULE_LICENSE("GPL");
-MODULE_PARM(count_d, "i");
-MODULE_PARM(ipg_d, "i");
-MODULE_PARM(cpu_speed, "i");
-MODULE_PARM(clone_skb_d, "i");
+module_param(count_d, int, 0);
+module_param(ipg_d, int, 0);
+module_param(cpu_speed, int, 0);
+module_param(clone_skb_d, int, 0);
diff --git a/net/core/rtnetlink.c b/net/core/rtnetlink.c
index f577cba67..9afe9d13d 100644
--- a/net/core/rtnetlink.c
+++ b/net/core/rtnetlink.c
@@ -56,12 +56,10 @@ DECLARE_MUTEX(rtnl_sem);
 void rtnl_lock(void)
 {
 	rtnl_shlock();
-	rtnl_exlock();
 }
  
 void rtnl_unlock(void)
 {
-	rtnl_exunlock();
 	rtnl_shunlock();
 
 	netdev_run_todo();
@@ -93,7 +91,8 @@ static const int rtm_min[(RTM_MAX+1-RTM_BASE)/4] =
 	NLMSG_LENGTH(sizeof(struct rtmsg)),
 	NLMSG_LENGTH(sizeof(struct tcmsg)),
 	NLMSG_LENGTH(sizeof(struct tcmsg)),
-	NLMSG_LENGTH(sizeof(struct tcmsg))
+	NLMSG_LENGTH(sizeof(struct tcmsg)),
+	NLMSG_LENGTH(sizeof(struct tcamsg))
 };
 
 static const int rta_max[(RTM_MAX+1-RTM_BASE)/4] =
@@ -105,7 +104,8 @@ static const int rta_max[(RTM_MAX+1-RTM_BASE)/4] =
 	RTA_MAX,
 	TCA_MAX,
 	TCA_MAX,
-	TCA_MAX
+	TCA_MAX,
+	TCAA_MAX
 };
 
 void __rta_fill(struct sk_buff *skb, int attrtype, int attrlen, const void *data)
@@ -339,7 +339,6 @@ rtnetlink_rcv_msg(struct sk_buff *skb, struct nlmsghdr *nlh, int *errp)
 	struct rtnetlink_link *link_tab;
 	struct rtattr	*rta[RTATTR_MAX];
 
-	int exclusive = 0;
 	int sz_idx, kind;
 	int min_len;
 	int family;
@@ -406,14 +405,6 @@ rtnetlink_rcv_msg(struct sk_buff *skb, struct nlmsghdr *nlh, int *errp)
 		return -1;
 	}
 
-	if (kind != 2) {
-		if (rtnl_exlock_nowait()) {
-			*errp = 0;
-			return -1;
-		}
-		exclusive = 1;
-	}
-
 	memset(&rta, 0, sizeof(rta));
 
 	min_len = rtm_min[sz_idx];
@@ -441,14 +432,10 @@ rtnetlink_rcv_msg(struct sk_buff *skb, struct nlmsghdr *nlh, int *errp)
 		goto err_inval;
 	err = link->doit(skb, nlh, (void *)&rta);
 
-	if (exclusive)
-		rtnl_exunlock();
 	*errp = err;
 	return err;
 
 err_inval:
-	if (exclusive)
-		rtnl_exunlock();
 	*errp = -EINVAL;
 	return -1;
 }
diff --git a/net/core/skbuff.c b/net/core/skbuff.c
index 7d72cdb49..c34a3a9db 100644
--- a/net/core/skbuff.c
+++ b/net/core/skbuff.c
@@ -49,6 +49,9 @@
 #include <linux/inet.h>
 #include <linux/slab.h>
 #include <linux/netdevice.h>
+#ifdef CONFIG_NET_CLS_ACT
+#include <net/pkt_sched.h>
+#endif
 #include <linux/string.h>
 #include <linux/skbuff.h>
 #include <linux/cache.h>
@@ -241,6 +244,15 @@ void __kfree_skb(struct sk_buff *skb)
 	nf_bridge_put(skb->nf_bridge);
 #endif
 #endif
+/* XXX: IS this still necessary? - JHS */
+#ifdef CONFIG_NET_SCHED
+	skb->tc_index = 0;
+#ifdef CONFIG_NET_CLS_ACT
+	skb->tc_verd = 0;
+	skb->tc_classid = 0;
+#endif
+#endif
+
 	kfree_skbmem(skb);
 }
 
@@ -312,6 +324,14 @@ struct sk_buff *skb_clone(struct sk_buff *skb, int gfp_mask)
 #endif
 #ifdef CONFIG_NET_SCHED
 	C(tc_index);
+#ifdef CONFIG_NET_CLS_ACT
+	n->tc_verd = SET_TC_VERD(skb->tc_verd,0);
+	n->tc_verd = CLR_TC_OK2MUNGE(skb->tc_verd);
+	n->tc_verd = CLR_TC_MUNGED(skb->tc_verd);
+	C(input_dev);
+	C(tc_classid);
+#endif
+
 #endif
 	C(truesize);
 	atomic_set(&n->users, 1);
@@ -366,6 +386,9 @@ static void copy_skb_header(struct sk_buff *new, const struct sk_buff *old)
 #endif
 #endif
 #ifdef CONFIG_NET_SCHED
+#ifdef CONFIG_NET_CLS_ACT
+	new->tc_verd = old->tc_verd;
+#endif
 	new->tc_index	= old->tc_index;
 #endif
 	atomic_set(&new->users, 1);
@@ -906,6 +929,70 @@ fault:
 	return -EFAULT;
 }
 
+/* Keep iterating until skb_iter_next returns false. */
+void skb_iter_first(const struct sk_buff *skb, struct skb_iter *i)
+{
+	i->len = skb_headlen(skb);
+	i->data = (unsigned char *)skb->data;
+	i->nextfrag = 0;
+	i->fraglist = NULL;
+}
+
+int skb_iter_next(const struct sk_buff *skb, struct skb_iter *i)
+{
+	/* Unmap previous, if not head fragment. */
+	if (i->nextfrag)
+		kunmap_skb_frag(i->data);
+
+	if (i->fraglist) {
+	fraglist:
+		/* We're iterating through fraglist. */
+		if (i->nextfrag < skb_shinfo(i->fraglist)->nr_frags) {
+			i->data = kmap_skb_frag(&skb_shinfo(i->fraglist)
+						->frags[i->nextfrag]);
+			i->len = skb_shinfo(i->fraglist)->frags[i->nextfrag]
+				.size;
+			i->nextfrag++;
+			return 1;
+		}
+		/* Fragments with fragments?  Too hard! */
+		BUG_ON(skb_shinfo(i->fraglist)->frag_list);
+		i->fraglist = i->fraglist->next;
+		if (!i->fraglist)
+			goto end;
+
+		i->len = skb_headlen(i->fraglist);
+		i->data = i->fraglist->data;
+		i->nextfrag = 0;
+		return 1;
+	}
+
+	if (i->nextfrag < skb_shinfo(skb)->nr_frags) {
+		i->data = kmap_skb_frag(&skb_shinfo(skb)->frags[i->nextfrag]);
+		i->len = skb_shinfo(skb)->frags[i->nextfrag].size;
+		i->nextfrag++;
+		return 1;
+	}
+
+	i->fraglist = skb_shinfo(skb)->frag_list;
+	if (i->fraglist)
+		goto fraglist;
+
+end:
+	/* Bug trap for callers */
+	i->data = NULL;
+	return 0;
+}
+
+void skb_iter_abort(const struct sk_buff *skb, struct skb_iter *i)
+{
+	/* Unmap previous, if not head fragment. */
+	if (i->data && i->nextfrag)
+		kunmap_skb_frag(i->data);
+	/* Bug trap for callers */
+	i->data = NULL;
+}
+
 /* Checksum skb data. */
 
 unsigned int skb_checksum(const struct sk_buff *skb, int offset,
@@ -1263,6 +1350,81 @@ void skb_add_mtu(int mtu)
 }
 #endif
 
+static void inline skb_split_inside_header(struct sk_buff *skb,
+					   struct sk_buff* skb1,
+					   const u32 len, const int pos)
+{
+	int i;
+
+	memcpy(skb_put(skb1, pos - len), skb->data + len, pos - len);
+
+	/* And move data appendix as is. */
+	for (i = 0; i < skb_shinfo(skb)->nr_frags; i++)
+		skb_shinfo(skb1)->frags[i] = skb_shinfo(skb)->frags[i];
+
+	skb_shinfo(skb1)->nr_frags = skb_shinfo(skb)->nr_frags;
+	skb_shinfo(skb)->nr_frags  = 0;
+	skb1->data_len		   = skb->data_len;
+	skb1->len		   += skb1->data_len;
+	skb->data_len		   = 0;
+	skb->len		   = len;
+	skb->tail		   = skb->data + len;
+}
+
+static void inline skb_split_no_header(struct sk_buff *skb,
+				       struct sk_buff* skb1,
+				       const u32 len, int pos)
+{
+	int i, k = 0;
+	const int nfrags = skb_shinfo(skb)->nr_frags;
+
+	skb_shinfo(skb)->nr_frags = 0;
+	skb1->len		  = skb1->data_len = skb->len - len;
+	skb->len		  = len;
+	skb->data_len		  = len - pos;
+
+	for (i = 0; i < nfrags; i++) {
+		int size = skb_shinfo(skb)->frags[i].size;
+
+		if (pos + size > len) {
+			skb_shinfo(skb1)->frags[k] = skb_shinfo(skb)->frags[i];
+
+			if (pos < len) {
+				/* Split frag.
+				 * We have to variants in this case:
+				 * 1. Move all the frag to the second
+				 *    part, if it is possible. F.e.
+				 *    this approach is mandatory for TUX,
+				 *    where splitting is expensive.
+				 * 2. Split is accurately. We make this.
+				 */
+				get_page(skb_shinfo(skb)->frags[i].page);
+				skb_shinfo(skb1)->frags[0].page_offset += len - pos;
+				skb_shinfo(skb1)->frags[0].size -= len - pos;
+				skb_shinfo(skb)->frags[i].size	= len - pos;
+				skb_shinfo(skb)->nr_frags++;
+			}
+			k++;
+		} else
+			skb_shinfo(skb)->nr_frags++;
+		pos += size;
+	}
+	skb_shinfo(skb1)->nr_frags = k;
+}
+
+/**
+ * skb_split - Split fragmented skb to two parts at length len.
+ */
+void skb_split(struct sk_buff *skb, struct sk_buff *skb1, const u32 len)
+{
+	int pos = skb_headlen(skb);
+
+	if (len < pos)	/* Split line is inside header. */
+		skb_split_inside_header(skb, skb1, len, pos);
+	else		/* Second chunk has no header, nothing to copy. */
+		skb_split_no_header(skb, skb1, len, pos);
+}
+
 void __init skb_init(void)
 {
 	skbuff_head_cache = kmem_cache_create("skbuff_head_cache",
@@ -1300,3 +1462,7 @@ EXPORT_SYMBOL(skb_queue_head);
 EXPORT_SYMBOL(skb_queue_tail);
 EXPORT_SYMBOL(skb_unlink);
 EXPORT_SYMBOL(skb_append);
+EXPORT_SYMBOL(skb_split);
+EXPORT_SYMBOL(skb_iter_first);
+EXPORT_SYMBOL(skb_iter_next);
+EXPORT_SYMBOL(skb_iter_abort);
diff --git a/net/core/sock.c b/net/core/sock.c
index 5cc0268b0..d5b2d9105 100644
--- a/net/core/sock.c
+++ b/net/core/sock.c
@@ -118,6 +118,7 @@
 #include <net/protocol.h>
 #include <linux/skbuff.h>
 #include <net/sock.h>
+#include <net/xfrm.h>
 #include <linux/ipsec.h>
 
 #include <linux/filter.h>
@@ -446,7 +447,8 @@ int sock_getsockopt(struct socket *sock, int level, int optname,
 		struct timeval tm;
 	} v;
 	
-	unsigned int lv=sizeof(int),len;
+	unsigned int lv = sizeof(int);
+	int len;
   	
   	if(get_user(len,optlen))
   		return -EFAULT;
@@ -526,7 +528,7 @@ int sock_getsockopt(struct socket *sock, int level, int optname,
 				v.tm.tv_usec = 0;
 			} else {
 				v.tm.tv_sec = sk->sk_rcvtimeo / HZ;
-				v.tm.tv_usec = ((sk->sk_rcvtimeo % HZ) * 1000) / HZ;
+				v.tm.tv_usec = ((sk->sk_rcvtimeo % HZ) * 1000000) / HZ;
 			}
 			break;
 
@@ -537,7 +539,7 @@ int sock_getsockopt(struct socket *sock, int level, int optname,
 				v.tm.tv_usec = 0;
 			} else {
 				v.tm.tv_sec = sk->sk_sndtimeo / HZ;
-				v.tm.tv_usec = ((sk->sk_sndtimeo % HZ) * 1000) / HZ;
+				v.tm.tv_usec = ((sk->sk_sndtimeo % HZ) * 1000000) / HZ;
 			}
 			break;
 
@@ -666,7 +668,7 @@ void sk_free(struct sock *sk)
 void __init sk_init(void)
 {
 	sk_cachep = kmem_cache_create("sock", sizeof(struct sock), 0,
-				      SLAB_HWCACHE_ALIGN, 0, 0);
+				      SLAB_HWCACHE_ALIGN, NULL, NULL);
 	if (!sk_cachep)
 		printk(KERN_CRIT "sk_init: Cannot create sock SLAB cache!");
 
@@ -710,6 +712,27 @@ void sock_rfree(struct sk_buff *skb)
 	atomic_sub(skb->truesize, &sk->sk_rmem_alloc);
 }
 
+
+int sock_i_uid(struct sock *sk)
+{
+	int uid;
+
+	read_lock(&sk->sk_callback_lock);
+	uid = sk->sk_socket ? SOCK_INODE(sk->sk_socket)->i_uid : 0;
+	read_unlock(&sk->sk_callback_lock);
+	return uid;
+}
+
+unsigned long sock_i_ino(struct sock *sk)
+{
+	unsigned long ino;
+
+	read_lock(&sk->sk_callback_lock);
+	ino = sk->sk_socket ? SOCK_INODE(sk->sk_socket)->i_ino : 0;
+	read_unlock(&sk->sk_callback_lock);
+	return ino;
+}
+
 /*
  * Allocate a skb from the socket's send buffer.
  */
@@ -1042,30 +1065,12 @@ int sock_no_mmap(struct file *file, struct socket *sock, struct vm_area_struct *
 ssize_t sock_no_sendpage(struct socket *sock, struct page *page, int offset, size_t size, int flags)
 {
 	ssize_t res;
-	struct msghdr msg;
-	struct iovec iov;
-	mm_segment_t old_fs;
-	char *kaddr;
-
-	kaddr = kmap(page);
-
-	msg.msg_name = NULL;
-	msg.msg_namelen = 0;
-	msg.msg_iov = &iov;
-	msg.msg_iovlen = 1;
-	msg.msg_control = NULL;
-	msg.msg_controllen = 0;
-	msg.msg_flags = flags;
-
-	/* This cast is ok because of the "set_fs(KERNEL_DS)" */
-	iov.iov_base = (void __user *) (kaddr + offset);
+	struct msghdr msg = {.msg_flags = flags};
+	struct kvec iov;
+	char *kaddr = kmap(page);
+	iov.iov_base = kaddr + offset;
 	iov.iov_len = size;
-
-	old_fs = get_fs();
-	set_fs(KERNEL_DS);
-	res = sock_sendmsg(sock, &msg, size);
-	set_fs(old_fs);
-
+	res = kernel_sendmsg(sock, &msg, &iov, 1, size);
 	kunmap(page);
 	return res;
 }
@@ -1155,6 +1160,8 @@ void sock_init_data(struct socket *sock, struct sock *sk)
 	skb_queue_head_init(&sk->sk_write_queue);
 	skb_queue_head_init(&sk->sk_error_queue);
 
+	sk->sk_send_head	=	NULL;
+
 	init_timer(&sk->sk_timer);
 	
 	sk->sk_allocation	=	GFP_KERNEL;
@@ -1181,9 +1188,13 @@ void sock_init_data(struct socket *sock, struct sock *sk)
 	sk->sk_error_report	=	sock_def_error_report;
 	sk->sk_destruct		=	sock_def_destruct;
 
+	sk->sk_sndmsg_page	=	NULL;
+	sk->sk_sndmsg_off	=	0;
+
 	sk->sk_peercred.pid 	=	0;
 	sk->sk_peercred.uid	=	-1;
 	sk->sk_peercred.gid	=	-1;
+	sk->sk_write_pending	=	0;
 	sk->sk_rcvlowat		=	1;
 	sk->sk_rcvtimeo		=	MAX_SCHEDULE_TIMEOUT;
 	sk->sk_sndtimeo		=	MAX_SCHEDULE_TIMEOUT;
@@ -1258,6 +1269,93 @@ void sock_disable_timestamp(struct sock *sk)
 }
 EXPORT_SYMBOL(sock_disable_timestamp);
 
+/*
+ *	Get a socket option on an socket.
+ *
+ *	FIX: POSIX 1003.1g is very ambiguous here. It states that
+ *	asynchronous errors should be reported by getsockopt. We assume
+ *	this means if you specify SO_ERROR (otherwise whats the point of it).
+ */
+int sock_common_getsockopt(struct socket *sock, int level, int optname,
+			   char __user *optval, int __user *optlen)
+{
+	struct sock *sk = sock->sk;
+
+	return sk->sk_prot->getsockopt(sk, level, optname, optval, optlen);
+}
+
+EXPORT_SYMBOL(sock_common_getsockopt);
+
+int sock_common_recvmsg(struct kiocb *iocb, struct socket *sock,
+			struct msghdr *msg, size_t size, int flags)
+{
+	struct sock *sk = sock->sk;
+	int addr_len = 0;
+	int err;
+
+	err = sk->sk_prot->recvmsg(iocb, sk, msg, size, flags & MSG_DONTWAIT,
+				   flags & ~MSG_DONTWAIT, &addr_len);
+	if (err >= 0)
+		msg->msg_namelen = addr_len;
+	return err;
+}
+
+EXPORT_SYMBOL(sock_common_recvmsg);
+
+/*
+ *	Set socket options on an inet socket.
+ */
+int sock_common_setsockopt(struct socket *sock, int level, int optname,
+			   char __user *optval, int optlen)
+{
+	struct sock *sk = sock->sk;
+
+	return sk->sk_prot->setsockopt(sk, level, optname, optval, optlen);
+}
+
+EXPORT_SYMBOL(sock_common_setsockopt);
+
+void sk_common_release(struct sock *sk)
+{
+	if (sk->sk_prot->destroy)
+		sk->sk_prot->destroy(sk);
+
+	/*
+	 * Observation: when sock_common_release is called, processes have
+	 * no access to socket. But net still has.
+	 * Step one, detach it from networking:
+	 *
+	 * A. Remove from hash tables.
+	 */
+
+	sk->sk_prot->unhash(sk);
+
+	/*
+	 * In this point socket cannot receive new packets, but it is possible
+	 * that some packets are in flight because some CPU runs receiver and
+	 * did hash table lookup before we unhashed socket. They will achieve
+	 * receive queue and will be purged by socket destructor.
+	 *
+	 * Also we still have packets pending on receive queue and probably,
+	 * our own packets waiting in device queues. sock_destroy will drain
+	 * receive queue, but transmitted packets will delay socket destruction
+	 * until the last reference will be released.
+	 */
+
+	sock_orphan(sk);
+
+	xfrm_sk_free_policy(sk);
+
+#ifdef INET_REFCNT_DEBUG
+	if (atomic_read(&sk->sk_refcnt) != 1)
+		printk(KERN_DEBUG "Destruction of the socket %p delayed, c=%d\n",
+		       sk, atomic_read(&sk->sk_refcnt));
+#endif
+	sock_put(sk);
+}
+
+EXPORT_SYMBOL(sk_common_release);
+
 EXPORT_SYMBOL(__lock_sock);
 EXPORT_SYMBOL(__release_sock);
 EXPORT_SYMBOL(sk_alloc);
@@ -1290,6 +1388,8 @@ EXPORT_SYMBOL(sock_rmalloc);
 EXPORT_SYMBOL(sock_setsockopt);
 EXPORT_SYMBOL(sock_wfree);
 EXPORT_SYMBOL(sock_wmalloc);
+EXPORT_SYMBOL(sock_i_uid);
+EXPORT_SYMBOL(sock_i_ino);
 #ifdef CONFIG_SYSCTL
 EXPORT_SYMBOL(sysctl_optmem_max);
 EXPORT_SYMBOL(sysctl_rmem_max);
diff --git a/net/core/stream.c b/net/core/stream.c
index 24a6f72a0..1e27a57b5 100644
--- a/net/core/stream.c
+++ b/net/core/stream.c
@@ -15,6 +15,7 @@
 #include <linux/module.h>
 #include <linux/net.h>
 #include <linux/signal.h>
+#include <linux/tcp.h>
 #include <linux/wait.h>
 #include <net/sock.h>
 
@@ -39,3 +40,248 @@ void sk_stream_write_space(struct sock *sk)
 }
 
 EXPORT_SYMBOL(sk_stream_write_space);
+
+/**
+ * sk_stream_wait_connect - Wait for a socket to get into the connected state
+ * @sk - sock to wait on
+ * @timeo_p - for how long to wait
+ *
+ * Must be called with the socket locked.
+ */
+int sk_stream_wait_connect(struct sock *sk, long *timeo_p)
+{
+	struct task_struct *tsk = current;
+	DEFINE_WAIT(wait);
+
+	while (1) {
+		if (sk->sk_err)
+			return sock_error(sk);
+		if ((1 << sk->sk_state) & ~(TCPF_SYN_SENT | TCPF_SYN_RECV))
+			return -EPIPE;
+		if (!*timeo_p)
+			return -EAGAIN;
+		if (signal_pending(tsk))
+			return sock_intr_errno(*timeo_p);
+
+		prepare_to_wait(sk->sk_sleep, &wait, TASK_INTERRUPTIBLE);
+		sk->sk_write_pending++;
+		if (sk_wait_event(sk, timeo_p,
+				  !((1 << sk->sk_state) & 
+				    ~(TCPF_ESTABLISHED | TCPF_CLOSE_WAIT))))
+			break;
+		finish_wait(sk->sk_sleep, &wait);
+		sk->sk_write_pending--;
+	}
+	return 0;
+}
+
+EXPORT_SYMBOL(sk_stream_wait_connect);
+
+/**
+ * sk_stream_closing - Return 1 if we still have things to send in our buffers.
+ * @sk - socket to verify
+ */
+static inline int sk_stream_closing(struct sock *sk)
+{
+	return (1 << sk->sk_state) &
+	       (TCPF_FIN_WAIT1 | TCPF_CLOSING | TCPF_LAST_ACK);
+}
+
+void sk_stream_wait_close(struct sock *sk, long timeout)
+{
+	if (timeout) {
+		DEFINE_WAIT(wait);
+
+		do {
+			prepare_to_wait(sk->sk_sleep, &wait,
+					TASK_INTERRUPTIBLE);
+			if (sk_wait_event(sk, &timeout, !sk_stream_closing(sk)))
+				break;
+		} while (!signal_pending(current) && timeout);
+
+		finish_wait(sk->sk_sleep, &wait);
+	}
+}
+
+EXPORT_SYMBOL(sk_stream_wait_close);
+
+/**
+ * sk_stream_wait_memory - Wait for more memory for a socket
+ * @sk - socket to wait for memory
+ * @timeo_p - for how long
+ */
+int sk_stream_wait_memory(struct sock *sk, long *timeo_p)
+{
+	int err = 0;
+	long vm_wait = 0;
+	long current_timeo = *timeo_p;
+	DEFINE_WAIT(wait);
+
+	if (sk_stream_memory_free(sk))
+		current_timeo = vm_wait = (net_random() % (HZ / 5)) + 2;
+
+	while (1) {
+		set_bit(SOCK_ASYNC_NOSPACE, &sk->sk_socket->flags);
+
+		prepare_to_wait(sk->sk_sleep, &wait, TASK_INTERRUPTIBLE);
+
+		if (sk->sk_err || (sk->sk_shutdown & SEND_SHUTDOWN))
+			goto do_error;
+		if (!*timeo_p)
+			goto do_nonblock;
+		if (signal_pending(current))
+			goto do_interrupted;
+		clear_bit(SOCK_ASYNC_NOSPACE, &sk->sk_socket->flags);
+		if (sk_stream_memory_free(sk) && !vm_wait)
+			break;
+
+		set_bit(SOCK_NOSPACE, &sk->sk_socket->flags);
+		sk->sk_write_pending++;
+		sk_wait_event(sk, &current_timeo, sk_stream_memory_free(sk) &&
+						  vm_wait);
+		sk->sk_write_pending--;
+
+		if (vm_wait) {
+			vm_wait -= current_timeo;
+			current_timeo = *timeo_p;
+			if (current_timeo != MAX_SCHEDULE_TIMEOUT &&
+			    (current_timeo -= vm_wait) < 0)
+				current_timeo = 0;
+			vm_wait = 0;
+		}
+		*timeo_p = current_timeo;
+	}
+out:
+	finish_wait(sk->sk_sleep, &wait);
+	return err;
+
+do_error:
+	err = -EPIPE;
+	goto out;
+do_nonblock:
+	err = -EAGAIN;
+	goto out;
+do_interrupted:
+	err = sock_intr_errno(*timeo_p);
+	goto out;
+}
+
+EXPORT_SYMBOL(sk_stream_wait_memory);
+
+void sk_stream_rfree(struct sk_buff *skb)
+{
+	struct sock *sk = skb->sk;
+
+	atomic_sub(skb->truesize, &sk->sk_rmem_alloc);
+	sk->sk_forward_alloc += skb->truesize;
+}
+
+EXPORT_SYMBOL(sk_stream_rfree);
+
+int sk_stream_error(struct sock *sk, int flags, int err)
+{
+	if (err == -EPIPE)
+		err = sock_error(sk) ? : -EPIPE;
+	if (err == -EPIPE && !(flags & MSG_NOSIGNAL))
+		send_sig(SIGPIPE, current, 0);
+	return err;
+}
+
+EXPORT_SYMBOL(sk_stream_error);
+
+void __sk_stream_mem_reclaim(struct sock *sk)
+{
+	if (sk->sk_forward_alloc >= SK_STREAM_MEM_QUANTUM) {
+		atomic_sub(sk->sk_forward_alloc / SK_STREAM_MEM_QUANTUM,
+			   sk->sk_prot->memory_allocated);
+		sk->sk_forward_alloc &= SK_STREAM_MEM_QUANTUM - 1;
+		if (*sk->sk_prot->memory_pressure &&
+		    (atomic_read(sk->sk_prot->memory_allocated) <
+		     sk->sk_prot->sysctl_mem[0]))
+			*sk->sk_prot->memory_pressure = 0;
+	}
+}
+
+EXPORT_SYMBOL(__sk_stream_mem_reclaim);
+
+int sk_stream_mem_schedule(struct sock *sk, int size, int kind)
+{
+	int amt = sk_stream_pages(size);
+
+	sk->sk_forward_alloc += amt * SK_STREAM_MEM_QUANTUM;
+	atomic_add(amt, sk->sk_prot->memory_allocated);
+
+	/* Under limit. */
+	if (atomic_read(sk->sk_prot->memory_allocated) < sk->sk_prot->sysctl_mem[0]) {
+		if (*sk->sk_prot->memory_pressure)
+			*sk->sk_prot->memory_pressure = 0;
+		return 1;
+	}
+
+	/* Over hard limit. */
+	if (atomic_read(sk->sk_prot->memory_allocated) > sk->sk_prot->sysctl_mem[2]) {
+		sk->sk_prot->enter_memory_pressure();
+		goto suppress_allocation;
+	}
+
+	/* Under pressure. */
+	if (atomic_read(sk->sk_prot->memory_allocated) > sk->sk_prot->sysctl_mem[1])
+		sk->sk_prot->enter_memory_pressure();
+
+	if (kind) {
+		if (atomic_read(&sk->sk_rmem_alloc) < sk->sk_prot->sysctl_rmem[0])
+			return 1;
+	} else if (sk->sk_wmem_queued < sk->sk_prot->sysctl_wmem[0])
+		return 1;
+
+	if (!*sk->sk_prot->memory_pressure ||
+	    sk->sk_prot->sysctl_mem[2] > atomic_read(sk->sk_prot->sockets_allocated) *
+				sk_stream_pages(sk->sk_wmem_queued +
+						atomic_read(&sk->sk_rmem_alloc) +
+						sk->sk_forward_alloc))
+		return 1;
+
+suppress_allocation:
+
+	if (!kind) {
+		sk_stream_moderate_sndbuf(sk);
+
+		/* Fail only if socket is _under_ its sndbuf.
+		 * In this case we cannot block, so that we have to fail.
+		 */
+		if (sk->sk_wmem_queued + size >= sk->sk_sndbuf)
+			return 1;
+	}
+
+	/* Alas. Undo changes. */
+	sk->sk_forward_alloc -= amt * SK_STREAM_MEM_QUANTUM;
+	atomic_sub(amt, sk->sk_prot->memory_allocated);
+	return 0;
+}
+
+EXPORT_SYMBOL(sk_stream_mem_schedule);
+
+void sk_stream_kill_queues(struct sock *sk)
+{
+	/* First the read buffer. */
+	__skb_queue_purge(&sk->sk_receive_queue);
+
+	/* Next, the error queue. */
+	__skb_queue_purge(&sk->sk_error_queue);
+
+	/* Next, the write queue. */
+	BUG_TRAP(skb_queue_empty(&sk->sk_write_queue));
+
+	/* Account for returned memory. */
+	sk_stream_mem_reclaim(sk);
+
+	BUG_TRAP(!sk->sk_wmem_queued);
+	BUG_TRAP(!sk->sk_forward_alloc);
+
+	/* It is _impossible_ for the backlog to contain anything
+	 * when we get here.  All user references to this socket
+	 * have gone away, only the net layer knows can touch it.
+	 */
+}
+
+EXPORT_SYMBOL(sk_stream_kill_queues);
diff --git a/net/core/sysctl_net_core.c b/net/core/sysctl_net_core.c
index 6889e4306..c8be646cb 100644
--- a/net/core/sysctl_net_core.c
+++ b/net/core/sysctl_net_core.c
@@ -130,16 +130,6 @@ ctl_table core_table[] = {
 		.mode		= 0644,
 		.proc_handler	= &proc_dointvec
 	},
-#ifdef CONFIG_NET_FASTROUTE
-	{
-		.ctl_name	= NET_CORE_FASTROUTE,
-		.procname	= "netdev_fastroute",
-		.data		= &netdev_fastroute,
-		.maxlen		= sizeof(int),
-		.mode		= 0644,
-		.proc_handler	= &proc_dointvec
-	},
-#endif
 	{
 		.ctl_name	= NET_CORE_MSG_COST,
 		.procname	= "message_cost",
diff --git a/net/decnet/dn_dev.c b/net/decnet/dn_dev.c
index 6b6e49a9e..11b0f0c6d 100644
--- a/net/decnet/dn_dev.c
+++ b/net/decnet/dn_dev.c
@@ -161,7 +161,7 @@ static int min_priority[1];
 static int max_priority[] = { 127 }; /* From DECnet spec */
 
 static int dn_forwarding_proc(ctl_table *, int, struct file *,
-			void __user *, size_t *);
+			void __user *, size_t *, loff_t *);
 static int dn_forwarding_sysctl(ctl_table *table, int __user *name, int nlen,
 			void __user *oldval, size_t __user *oldlenp,
 			void __user *newval, size_t newlen,
@@ -362,7 +362,8 @@ static void dn_dev_check_default(struct net_device *dev)
 
 static int dn_forwarding_proc(ctl_table *table, int write, 
 				struct file *filep,
-				void __user *buffer, size_t *lenp)
+				void __user *buffer,
+				size_t *lenp, loff_t *ppos)
 {
 #ifdef CONFIG_DECNET_ROUTER
 	struct net_device *dev = table->extra1;
@@ -376,7 +377,7 @@ static int dn_forwarding_proc(ctl_table *table, int write,
 	dn_db = dev->dn_ptr;
 	old = dn_db->parms.forwarding;
 
-	err = proc_dointvec(table, write, filep, buffer, lenp);
+	err = proc_dointvec(table, write, filep, buffer, lenp, ppos);
 
 	if ((err >= 0) && write) {
 		if (dn_db->parms.forwarding < 0)
diff --git a/net/decnet/dn_nsp_in.c b/net/decnet/dn_nsp_in.c
index a77fa9fd1..05d84ed7e 100644
--- a/net/decnet/dn_nsp_in.c
+++ b/net/decnet/dn_nsp_in.c
@@ -504,7 +504,7 @@ static void dn_nsp_linkservice(struct sock *sk, struct sk_buff *skb)
 	struct dn_scp *scp = DN_SK(sk);
 	unsigned short segnum;
 	unsigned char lsflags;
-	char fcval;
+	signed char fcval;
 	int wake_up = 0;
 	char *ptr = skb->data;
 	unsigned char fctype = scp->services_rem & NSP_FC_MASK;
diff --git a/net/decnet/dn_route.c b/net/decnet/dn_route.c
index 90d0583f5..c181467dd 100644
--- a/net/decnet/dn_route.c
+++ b/net/decnet/dn_route.c
@@ -146,14 +146,14 @@ static __inline__ unsigned dn_hash(unsigned short src, unsigned short dst)
 
 static inline void dnrt_free(struct dn_route *rt)
 {
-	call_rcu(&rt->u.dst.rcu_head, (void (*)(void *))dst_free, &rt->u.dst);
+	call_rcu(&rt->u.dst.rcu_head, dst_rcu_free);
 }
 
 static inline void dnrt_drop(struct dn_route *rt)
 {
 	if (rt)
 		dst_release(&rt->u.dst);
-	call_rcu(&rt->u.dst.rcu_head, (void (*)(void *))dst_free, &rt->u.dst);
+	call_rcu(&rt->u.dst.rcu_head, dst_rcu_free);
 }
 
 static void dn_dst_check_expire(unsigned long dummy)
diff --git a/net/decnet/sysctl_net_decnet.c b/net/decnet/sysctl_net_decnet.c
index 65ce3bb95..02bca49cb 100644
--- a/net/decnet/sysctl_net_decnet.c
+++ b/net/decnet/sysctl_net_decnet.c
@@ -162,13 +162,14 @@ static int dn_node_address_strategy(ctl_table *table, int __user *name, int nlen
 
 static int dn_node_address_handler(ctl_table *table, int write, 
 				struct file *filp,
-				void __user *buffer, size_t *lenp)
+				void __user *buffer,
+				size_t *lenp, loff_t *ppos)
 {
 	char addr[DN_ASCBUF_LEN];
 	size_t len;
 	dn_address dnaddr;
 
-	if (!*lenp || (filp->f_pos && !write)) {
+	if (!*lenp || (*ppos && !write)) {
 		*lenp = 0;
 		return 0;
 	}
@@ -191,7 +192,7 @@ static int dn_node_address_handler(ctl_table *table, int write,
 
 		dn_dev_devices_on();
 
-		filp->f_pos += len;
+		*ppos += len;
 
 		return 0;
 	}
@@ -206,7 +207,7 @@ static int dn_node_address_handler(ctl_table *table, int write,
 		return -EFAULT;
 
 	*lenp = len;
-	filp->f_pos += len;
+	*ppos += len;
 
 	return 0;
 }
@@ -273,13 +274,14 @@ static int dn_def_dev_strategy(ctl_table *table, int __user *name, int nlen,
 
 static int dn_def_dev_handler(ctl_table *table, int write, 
 				struct file * filp,
-				void __user *buffer, size_t *lenp)
+				void __user *buffer,
+				size_t *lenp, loff_t *ppos)
 {
 	size_t len;
 	struct net_device *dev;
 	char devname[17];
 
-	if (!*lenp || (filp->f_pos && !write)) {
+	if (!*lenp || (*ppos && !write)) {
 		*lenp = 0;
 		return 0;
 	}
@@ -307,7 +309,7 @@ static int dn_def_dev_handler(ctl_table *table, int write,
 			dev_put(dev);
 			return -ENODEV;
 		}
-		filp->f_pos += *lenp;
+		*ppos += *lenp;
 
 		return 0;
 	}
@@ -329,7 +331,7 @@ static int dn_def_dev_handler(ctl_table *table, int write,
 		return -EFAULT;
 
 	*lenp = len;
-	filp->f_pos += len;
+	*ppos += len;
 
 	return 0;
 }
diff --git a/net/econet/af_econet.c b/net/econet/af_econet.c
index ce383ad75..07b4cff2f 100644
--- a/net/econet/af_econet.c
+++ b/net/econet/af_econet.c
@@ -201,6 +201,7 @@ static int econet_bind(struct socket *sock, struct sockaddr *uaddr, int addr_len
 	return 0;
 }
 
+#if defined(CONFIG_ECONET_AUNUDP) || defined(CONFIG_ECONET_NATIVE)
 /*
  *	Queue a transmit result for the user to be told about.
  */
@@ -227,6 +228,7 @@ static void tx_result(struct sock *sk, unsigned long cookie, int result)
 	if (sock_queue_rcv_skb(sk, skb) < 0)
 		kfree_skb(skb);
 }
+#endif
 
 #ifdef CONFIG_ECONET_NATIVE
 /*
@@ -255,10 +257,9 @@ static int econet_sendmsg(struct kiocb *iocb, struct socket *sock,
 	struct ec_addr addr;
 	int err;
 	unsigned char port, cb;
+#if defined(CONFIG_ECONET_AUNUDP) || defined(CONFIG_ECONET_NATIVE)
 	struct sk_buff *skb;
 	struct ec_cb *eb;
-#ifdef CONFIG_ECONET_NATIVE
-	unsigned short proto = 0;
 #endif
 #ifdef CONFIG_ECONET_AUNUDP
 	struct msghdr udpmsg;
@@ -316,6 +317,8 @@ static int econet_sendmsg(struct kiocb *iocb, struct socket *sock,
 	{
 		/* Real hardware Econet.  We're not worthy etc. */
 #ifdef CONFIG_ECONET_NATIVE
+		unsigned short proto = 0;
+
 		dev_hold(dev);
 		
 		skb = sock_alloc_send_skb(sk, len+LL_RESERVED_SPACE(dev), 
@@ -718,6 +721,7 @@ static struct proto_ops SOCKOPS_WRAPPED(econet_ops) = {
 #include <linux/smp_lock.h>
 SOCKOPS_WRAP(econet, PF_ECONET);
 
+#if defined(CONFIG_ECONET_AUNUDP) || defined(CONFIG_ECONET_NATIVE)
 /*
  *	Find the listening socket, if any, for the given data.
  */
@@ -761,47 +765,31 @@ static int ec_queue_packet(struct sock *sk, struct sk_buff *skb,
 
 	return sock_queue_rcv_skb(sk, skb);
 }
+#endif
 
 #ifdef CONFIG_ECONET_AUNUDP
-
 /*
  *	Send an AUN protocol response. 
  */
 
 static void aun_send_response(__u32 addr, unsigned long seq, int code, int cb)
 {
-	struct sockaddr_in sin;
-	struct iovec iov;
-	struct aunhdr ah;
+	struct sockaddr_in sin = {
+		.sin_family = AF_INET,
+		.sin_port = htons(AUN_PORT),
+		.sin_addr = {.s_addr = addr}
+	};
+	struct aunhdr ah = {.code = code, .cb = cb, .handle = seq};
+	struct kvec iov = {.iov_base = (void *)&ah, .iov_len = sizeof(ah)};
 	struct msghdr udpmsg;
-	int err;
-	mm_segment_t oldfs;
 	
-	memset(&sin, 0, sizeof(sin));
-	sin.sin_family = AF_INET;
-	sin.sin_port = htons(AUN_PORT);
-	sin.sin_addr.s_addr = addr;
-
-	ah.code = code;
-	ah.pad = 0;
-	ah.port = 0;
-	ah.cb = cb;
-	ah.handle = seq;
-
-	iov.iov_base = (void *)&ah;
-	iov.iov_len = sizeof(ah);
-
 	udpmsg.msg_name = (void *)&sin;
 	udpmsg.msg_namelen = sizeof(sin);
-	udpmsg.msg_iov = &iov;
-	udpmsg.msg_iovlen = 1;
 	udpmsg.msg_control = NULL;
 	udpmsg.msg_controllen = 0;
 	udpmsg.msg_flags=0;
 
-	oldfs = get_fs(); set_fs(KERNEL_DS);
-	err = sock_sendmsg(udpsock, &udpmsg, sizeof(ah));
-	set_fs(oldfs);
+	kernel_sendmsg(udpsock, &udpmsg, &iov, 1, sizeof(ah));
 }
 
 
@@ -1087,7 +1075,7 @@ static int econet_notifier(struct notifier_block *this, unsigned long msg, void
 		if (edev)
 		{
 			if (net2dev_map[0] == dev)
-				net2dev_map[0] = 0;
+				net2dev_map[0] = NULL;
 			net2dev_map[edev->net] = NULL;
 			kfree(edev);
 			dev->ec_ptr = NULL;
diff --git a/net/ethernet/eth.c b/net/ethernet/eth.c
index 4b3fa0084..9569f3a80 100644
--- a/net/ethernet/eth.c
+++ b/net/ethernet/eth.c
@@ -164,6 +164,9 @@ unsigned short eth_type_trans(struct sk_buff *skb, struct net_device *dev)
 	skb->mac.raw=skb->data;
 	skb_pull(skb,ETH_HLEN);
 	eth= skb->mac.ethernet;
+#ifdef CONFIG_NET_CLS_ACT
+	skb->input_dev = dev;
+#endif
 	
 	if(*eth->h_dest&1)
 	{
diff --git a/net/ipv4/Kconfig b/net/ipv4/Kconfig
index 0bb1b8808..de00c668c 100644
--- a/net/ipv4/Kconfig
+++ b/net/ipv4/Kconfig
@@ -196,8 +196,7 @@ config NET_IPIP
 	  can be useful if you want to make your (or some other) machine
 	  appear on a different network than it physically is, or to use
 	  mobile-IP facilities (allowing laptops to seamlessly move between
-	  networks without changing their IP addresses; check out
-	  <http://anchor.cs.binghamton.edu/~mobileip/LJ/index.html>).
+	  networks without changing their IP addresses).
 
 	  Saying Y to this option will produce two modules ( = code which can
 	  be inserted in and removed from the running kernel whenever you
diff --git a/net/ipv4/Makefile b/net/ipv4/Makefile
index 5412b1caa..0fe409afa 100644
--- a/net/ipv4/Makefile
+++ b/net/ipv4/Makefile
@@ -6,7 +6,7 @@ obj-y     := utils.o route.o inetpeer.o protocol.o \
 	     ip_input.o ip_fragment.o ip_forward.o ip_options.o \
 	     ip_output.o ip_sockglue.o \
 	     tcp.o tcp_input.o tcp_output.o tcp_timer.o tcp_ipv4.o tcp_minisocks.o \
-	     tcp_diag.o raw.o udp.o arp.o icmp.o devinet.o af_inet.o igmp.o \
+	     tcp_diag.o datagram.o raw.o udp.o arp.o icmp.o devinet.o af_inet.o igmp.o \
 	     sysctl_net_ipv4.o fib_frontend.o fib_semantics.o fib_hash.o
 
 obj-$(CONFIG_PROC_FS) += proc.o
@@ -23,4 +23,5 @@ obj-$(CONFIG_IP_PNP) += ipconfig.o
 obj-$(CONFIG_NETFILTER)	+= netfilter/
 obj-$(CONFIG_IP_VS) += ipvs/
 
-obj-$(CONFIG_XFRM) += xfrm4_policy.o xfrm4_state.o xfrm4_input.o xfrm4_tunnel.o
+obj-$(CONFIG_XFRM) += xfrm4_policy.o xfrm4_state.o xfrm4_input.o \
+		      xfrm4_tunnel.o xfrm4_output.o
diff --git a/net/ipv4/af_inet.c b/net/ipv4/af_inet.c
index 0ba06a4f5..c4a967b81 100644
--- a/net/ipv4/af_inet.c
+++ b/net/ipv4/af_inet.c
@@ -112,6 +112,7 @@
 #ifdef CONFIG_IP_MROUTE
 #include <linux/mroute.h>
 #endif
+#include <linux/vs_limit.h>
 
 DEFINE_SNMP_STAT(struct linux_mib, net_statistics);
 
@@ -159,6 +160,7 @@ void inet_sock_destruct(struct sock *sk)
 	if (inet->opt)
 		kfree(inet->opt);
 	
+	vx_sock_dec(sk);
 	clr_vx_info(&sk->sk_vx_info);
 	sk->sk_xid = -1;
 	clr_nx_info(&sk->sk_nx_info);
@@ -172,79 +174,12 @@ void inet_sock_destruct(struct sock *sk)
 #endif
 }
 
-void inet_sock_release(struct sock *sk)
-{
-	if (sk->sk_prot->destroy)
-		sk->sk_prot->destroy(sk);
-
-	/* Observation: when inet_sock_release is called, processes have
-	 * no access to socket. But net still has.
-	 * Step one, detach it from networking:
-	 *
-	 * A. Remove from hash tables.
-	 */
-
-	sk->sk_prot->unhash(sk);
-
-	/* In this point socket cannot receive new packets,
-	 * but it is possible that some packets are in flight
-	 * because some CPU runs receiver and did hash table lookup
-	 * before we unhashed socket. They will achieve receive queue
-	 * and will be purged by socket destructor.
-	 *
-	 * Also we still have packets pending on receive
-	 * queue and probably, our own packets waiting in device queues.
-	 * sock_destroy will drain receive queue, but transmitted
-	 * packets will delay socket destruction until the last reference
-	 * will be released.
-	 */
-
-	sock_orphan(sk);
-
-	xfrm_sk_free_policy(sk);
-
-#ifdef INET_REFCNT_DEBUG
-	if (atomic_read(&sk->sk_refcnt) != 1)
-		printk(KERN_DEBUG "Destruction inet %p delayed, c=%d\n",
-		       sk, atomic_read(&sk->sk_refcnt));
-#endif
-	sock_put(sk);
-}
-
-
 /*
  *	The routines beyond this point handle the behaviour of an AF_INET
  *	socket object. Mostly it punts to the subprotocols of IP to do
  *	the work.
  */
 
-/*
- *	Set socket options on an inet socket.
- */
-int inet_setsockopt(struct socket *sock, int level, int optname,
-		    char __user *optval, int optlen)
-{
-	struct sock *sk = sock->sk;
-
-	return sk->sk_prot->setsockopt(sk, level, optname, optval, optlen);
-}
-
-/*
- *	Get a socket option on an AF_INET socket.
- *
- *	FIX: POSIX 1003.1g is very ambiguous here. It states that
- *	asynchronous errors should be reported by getsockopt. We assume
- *	this means if you specify SO_ERROR (otherwise whats the point of it).
- */
-
-int inet_getsockopt(struct socket *sock, int level, int optname,
-		    char __user *optval, int __user *optlen)
-{
-	struct sock *sk = sock->sk;
-
-	return sk->sk_prot->getsockopt(sk, level, optname, optval, optlen);
-}
-
 /*
  *	Automatically bind an unbound socket.
  */
@@ -409,6 +344,7 @@ override:
 	
 	set_vx_info(&sk->sk_vx_info, current->vx_info);
 	sk->sk_xid = vx_current_xid();
+	vx_sock_inc(sk);
 	set_nx_info(&sk->sk_nx_info, current->nx_info);
 	sk->sk_nid = nx_current_nid();
 
@@ -436,7 +372,7 @@ override:
 	if (sk->sk_prot->init) {
 		err = sk->sk_prot->init(sk);
 		if (err)
-			inet_sock_release(sk);
+			sk_common_release(sk);
 	}
 out:
 	return err;
@@ -474,6 +410,7 @@ int inet_release(struct socket *sock)
 		    !(current->flags & PF_EXITING))
 			timeout = sk->sk_lingertime;
 		sock->sk = NULL;
+		vx_sock_dec(sk);
 		clr_vx_info(&sk->sk_vx_info);
 	sk->sk_xid = -1;
 		clr_nx_info(&sk->sk_nx_info);
@@ -509,8 +446,9 @@ int inet_bind(struct socket *sock, struct sockaddr *uaddr, int addr_len)
 		goto out;
 
 	s_addr = s_addr1 = addr->sin_addr.s_addr;
-	nxdprintk("inet_bind(%p) %p,%p;%lx\n",
-		sk, nx_info, sk->sk_socket,
+	vxdprintk(VXD_CBIT(net, 3),
+		"inet_bind(%p) %p,%p;%lx",
+		sk, sk->sk_nx_info, sk->sk_socket,
 		(sk->sk_socket?sk->sk_socket->flags:0));
 	if (nxi) {
 		__u32 v4_bcast = nxi->v4_bcast;
@@ -781,22 +719,6 @@ int inet_getname(struct socket *sock, struct sockaddr *uaddr,
 	return 0;
 }
 
-
-int inet_recvmsg(struct kiocb *iocb, struct socket *sock, struct msghdr *msg,
-		 size_t size, int flags)
-{
-	struct sock *sk = sock->sk;
-	int addr_len = 0;
-	int err;
-
-	err = sk->sk_prot->recvmsg(iocb, sk, msg, size, flags & MSG_DONTWAIT,
-				   flags & ~MSG_DONTWAIT, &addr_len);
-	if (err >= 0)
-		msg->msg_namelen = addr_len;
-	return err;
-}
-
-
 int inet_sendmsg(struct kiocb *iocb, struct socket *sock, struct msghdr *msg,
 		 size_t size)
 {
@@ -900,7 +822,7 @@ int inet_ioctl(struct socket *sock, unsigned int cmd, unsigned long arg)
 		case SIOCADDRT:
 		case SIOCDELRT:
 		case SIOCRTMSG:
-			err = ip_rt_ioctl(cmd, (void *)arg);
+			err = ip_rt_ioctl(cmd, (void __user *)arg);
 			break;
 		case SIOCDARP:
 		case SIOCGARP:
@@ -943,10 +865,10 @@ struct proto_ops inet_stream_ops = {
 	.ioctl =	inet_ioctl,
 	.listen =	inet_listen,
 	.shutdown =	inet_shutdown,
-	.setsockopt =	inet_setsockopt,
-	.getsockopt =	inet_getsockopt,
+	.setsockopt =	sock_common_setsockopt,
+	.getsockopt =	sock_common_getsockopt,
 	.sendmsg =	inet_sendmsg,
-	.recvmsg =	inet_recvmsg,
+	.recvmsg =	sock_common_recvmsg,
 	.mmap =		sock_no_mmap,
 	.sendpage =	tcp_sendpage
 };
@@ -964,10 +886,10 @@ struct proto_ops inet_dgram_ops = {
 	.ioctl =	inet_ioctl,
 	.listen =	sock_no_listen,
 	.shutdown =	inet_shutdown,
-	.setsockopt =	inet_setsockopt,
-	.getsockopt =	inet_getsockopt,
+	.setsockopt =	sock_common_setsockopt,
+	.getsockopt =	sock_common_getsockopt,
 	.sendmsg =	inet_sendmsg,
-	.recvmsg =	inet_recvmsg,
+	.recvmsg =	sock_common_recvmsg,
 	.mmap =		sock_no_mmap,
 	.sendpage =	inet_sendpage,
 };
@@ -1093,24 +1015,24 @@ void inet_unregister_protosw(struct inet_protosw *p)
 }
 
 #ifdef CONFIG_IP_MULTICAST
-static struct inet_protocol igmp_protocol = {
+static struct net_protocol igmp_protocol = {
 	.handler =	igmp_rcv,
 };
 #endif
 
-static struct inet_protocol tcp_protocol = {
+static struct net_protocol tcp_protocol = {
 	.handler =	tcp_v4_rcv,
 	.err_handler =	tcp_v4_err,
 	.no_policy =	1,
 };
 
-static struct inet_protocol udp_protocol = {
+static struct net_protocol udp_protocol = {
 	.handler =	udp_rcv,
 	.err_handler =	udp_err,
 	.no_policy =	1,
 };
 
-static struct inet_protocol icmp_protocol = {
+static struct net_protocol icmp_protocol = {
 	.handler =	icmp_rcv,
 };
 
@@ -1153,13 +1075,13 @@ static int __init inet_init(void)
 
 	tcp_sk_cachep = kmem_cache_create("tcp_sock",
 					  sizeof(struct tcp_sock), 0,
-					  SLAB_HWCACHE_ALIGN, 0, 0);
+					  SLAB_HWCACHE_ALIGN, NULL, NULL);
 	udp_sk_cachep = kmem_cache_create("udp_sock",
 					  sizeof(struct udp_sock), 0,
-					  SLAB_HWCACHE_ALIGN, 0, 0);
+					  SLAB_HWCACHE_ALIGN, NULL, NULL);
 	raw4_sk_cachep = kmem_cache_create("raw4_sock",
 					   sizeof(struct raw_sock), 0,
-					   SLAB_HWCACHE_ALIGN, 0, 0);
+					   SLAB_HWCACHE_ALIGN, NULL, NULL);
 	if (!tcp_sk_cachep || !udp_sk_cachep || !raw4_sk_cachep)
 		printk(KERN_CRIT
 		       "inet_init: Can't create protocol sock SLAB caches!\n");
@@ -1294,17 +1216,13 @@ EXPORT_SYMBOL(inet_dgram_connect);
 EXPORT_SYMBOL(inet_dgram_ops);
 EXPORT_SYMBOL(inet_family_ops);
 EXPORT_SYMBOL(inet_getname);
-EXPORT_SYMBOL(inet_getsockopt);
 EXPORT_SYMBOL(inet_ioctl);
 EXPORT_SYMBOL(inet_listen);
-EXPORT_SYMBOL(inet_recvmsg);
 EXPORT_SYMBOL(inet_register_protosw);
 EXPORT_SYMBOL(inet_release);
 EXPORT_SYMBOL(inet_sendmsg);
-EXPORT_SYMBOL(inet_setsockopt);
 EXPORT_SYMBOL(inet_shutdown);
 EXPORT_SYMBOL(inet_sock_destruct);
-EXPORT_SYMBOL(inet_sock_release);
 EXPORT_SYMBOL(inet_stream_connect);
 EXPORT_SYMBOL(inet_stream_ops);
 EXPORT_SYMBOL(inet_unregister_protosw);
diff --git a/net/ipv4/ah4.c b/net/ipv4/ah4.c
index 0d62398f7..9784f0376 100644
--- a/net/ipv4/ah4.c
+++ b/net/ipv4/ah4.c
@@ -1,6 +1,5 @@
 #include <linux/config.h>
 #include <linux/module.h>
-#include <net/inet_ecn.h>
 #include <net/ip.h>
 #include <net/xfrm.h>
 #include <net/ah.h>
@@ -67,53 +66,31 @@ static int ah_output(struct sk_buff **pskb)
 		char 		buf[60];
 	} tmp_iph;
 
-	if ((*pskb)->ip_summed == CHECKSUM_HW) {
-		err = skb_checksum_help(pskb, 0);
+	top_iph = (*pskb)->nh.iph;
+	iph = &tmp_iph.iph;
+
+	iph->tos = top_iph->tos;
+	iph->ttl = top_iph->ttl;
+	iph->frag_off = top_iph->frag_off;
+
+	if (top_iph->ihl != 5) {
+		iph->daddr = top_iph->daddr;
+		memcpy(iph+1, top_iph+1, top_iph->ihl*4 - sizeof(struct iphdr));
+		err = ip_clear_mutable_options(top_iph, &top_iph->daddr);
 		if (err)
-			goto error_nolock;
+			goto error;
 	}
 
-	spin_lock_bh(&x->lock);
-	err = xfrm_check_output(x, *pskb, AF_INET);
-	if (err)
-		goto error;
+	ah = (struct ip_auth_hdr *)((char *)top_iph+top_iph->ihl*4);
+	ah->nexthdr = top_iph->protocol;
+
+	top_iph->tos = 0;
+	top_iph->tot_len = htons((*pskb)->len);
+	top_iph->frag_off = 0;
+	top_iph->ttl = 0;
+	top_iph->protocol = IPPROTO_AH;
+	top_iph->check = 0;
 
-	iph = (*pskb)->nh.iph;
-	if (x->props.mode) {
-		top_iph = (struct iphdr*)skb_push(*pskb, x->props.header_len);
-		top_iph->ihl = 5;
-		top_iph->version = 4;
-		top_iph->tos = 0;
-		top_iph->tot_len = htons((*pskb)->len);
-		top_iph->frag_off = 0;
-		if (!(iph->frag_off&htons(IP_DF)))
-			__ip_select_ident(top_iph, dst, 0);
-		top_iph->ttl = 0;
-		top_iph->protocol = IPPROTO_AH;
-		top_iph->check = 0;
-		top_iph->saddr = x->props.saddr.a4;
-		top_iph->daddr = x->id.daddr.a4;
-		ah = (struct ip_auth_hdr*)(top_iph+1);
-		ah->nexthdr = IPPROTO_IPIP;
-	} else {
-		memcpy(&tmp_iph, (*pskb)->data, iph->ihl*4);
-		top_iph = (struct iphdr*)skb_push(*pskb, x->props.header_len);
-		memcpy(top_iph, &tmp_iph, iph->ihl*4);
-		iph = &tmp_iph.iph;
-		top_iph->tos = 0;
-		top_iph->tot_len = htons((*pskb)->len);
-		top_iph->frag_off = 0;
-		top_iph->ttl = 0;
-		top_iph->protocol = IPPROTO_AH;
-		top_iph->check = 0;
-		if (top_iph->ihl != 5) {
-			err = ip_clear_mutable_options(top_iph, &top_iph->daddr);
-			if (err)
-				goto error;
-		}
-		ah = (struct ip_auth_hdr*)((char*)top_iph+iph->ihl*4);
-		ah->nexthdr = iph->protocol;
-	}
 	ahp = x->data;
 	ah->hdrlen  = (XFRM_ALIGN8(sizeof(struct ip_auth_hdr) + 
 				   ahp->icv_trunc_len) >> 2) - 2;
@@ -122,36 +99,20 @@ static int ah_output(struct sk_buff **pskb)
 	ah->spi = x->id.spi;
 	ah->seq_no = htonl(++x->replay.oseq);
 	ahp->icv(ahp, *pskb, ah->auth_data);
+
 	top_iph->tos = iph->tos;
 	top_iph->ttl = iph->ttl;
-	if (x->props.mode) {
-		if (x->props.flags & XFRM_STATE_NOECN)
-			IP_ECN_clear(top_iph);
-		top_iph->frag_off = iph->frag_off&~htons(IP_MF|IP_OFFSET);
-		memset(&(IPCB(*pskb)->opt), 0, sizeof(struct ip_options));
-	} else {
-		top_iph->frag_off = iph->frag_off;
+	top_iph->frag_off = iph->frag_off;
+	if (top_iph->ihl != 5) {
 		top_iph->daddr = iph->daddr;
-		if (iph->ihl != 5)
-			memcpy(top_iph+1, iph+1, iph->ihl*4 - sizeof(struct iphdr));
+		memcpy(top_iph+1, iph+1, top_iph->ihl*4 - sizeof(struct iphdr));
 	}
-	ip_send_check(top_iph);
 
-	(*pskb)->nh.raw = (*pskb)->data;
+	ip_send_check(top_iph);
 
-	x->curlft.bytes += (*pskb)->len;
-	x->curlft.packets++;
-	spin_unlock_bh(&x->lock);
-	if (((*pskb)->dst = dst_pop(dst)) == NULL) {
-		err = -EHOSTUNREACH;
-		goto error_nolock;
-	}
-	return NET_XMIT_BYPASS;
+	err = 0;
 
 error:
-	spin_unlock_bh(&x->lock);
-error_nolock:
-	kfree_skb(*pskb);
 	return err;
 }
 
@@ -340,7 +301,7 @@ static struct xfrm_type ah_type =
 	.output		= ah_output
 };
 
-static struct inet_protocol ah4_protocol = {
+static struct net_protocol ah4_protocol = {
 	.handler	=	xfrm4_rcv,
 	.err_handler	=	ah4_err,
 	.no_policy	=	1,
diff --git a/net/ipv4/arp.c b/net/ipv4/arp.c
index b6f3840b4..c472a6653 100644
--- a/net/ipv4/arp.c
+++ b/net/ipv4/arp.c
@@ -426,7 +426,7 @@ static int arp_filter(__u32 sip, __u32 tip, struct net_device *dev)
 	if (ip_route_output_key(&rt, &fl) < 0) 
 		return 1;
 	if (rt->u.dst.dev != dev) { 
-		NET_INC_STATS_BH(ArpFilter);
+		NET_INC_STATS_BH(LINUX_MIB_ARPFILTER);
 		flag = 1;
 	} 
 	ip_rt_put(rt); 
diff --git a/net/ipv4/devinet.c b/net/ipv4/devinet.c
index 37581ba5b..a85a45964 100644
--- a/net/ipv4/devinet.c
+++ b/net/ipv4/devinet.c
@@ -728,6 +728,20 @@ int devinet_ioctl(unsigned int cmd, void __user *arg)
 			inet_del_ifa(in_dev, ifap, 0);
 			ifa->ifa_mask = sin->sin_addr.s_addr;
 			ifa->ifa_prefixlen = inet_mask_len(ifa->ifa_mask);
+
+			/* See if current broadcast address matches
+			 * with current netmask, then recalculate
+			 * the broadcast address. Otherwise it's a
+			 * funny address, so don't touch it since
+			 * the user seems to know what (s)he's doing...
+			 */
+			if ((dev->flags & IFF_BROADCAST) &&
+			    (ifa->ifa_prefixlen < 31) &&
+			    (ifa->ifa_broadcast ==
+			     (ifa->ifa_local|~ifa->ifa_mask))) {
+				ifa->ifa_broadcast = (ifa->ifa_local |
+						      ~sin->sin_addr.s_addr);
+			}
 			inet_insert_ifa(ifa);
 		}
 		break;
@@ -1170,11 +1184,11 @@ void inet_forward_change(void)
 
 static int devinet_sysctl_forward(ctl_table *ctl, int write,
 				  struct file* filp, void __user *buffer,
-				  size_t *lenp)
+				  size_t *lenp, loff_t *ppos)
 {
 	int *valp = ctl->data;
 	int val = *valp;
-	int ret = proc_dointvec(ctl, write, filp, buffer, lenp);
+	int ret = proc_dointvec(ctl, write, filp, buffer, lenp, ppos);
 
 	if (write && *valp != val) {
 		if (valp == &ipv4_devconf.forwarding)
@@ -1188,11 +1202,11 @@ static int devinet_sysctl_forward(ctl_table *ctl, int write,
 
 int ipv4_doint_and_flush(ctl_table *ctl, int write,
 			 struct file* filp, void __user *buffer,
-			 size_t *lenp)
+			 size_t *lenp, loff_t *ppos)
 {
 	int *valp = ctl->data;
 	int val = *valp;
-	int ret = proc_dointvec(ctl, write, filp, buffer, lenp);
+	int ret = proc_dointvec(ctl, write, filp, buffer, lenp, ppos);
 
 	if (write && *valp != val)
 		rt_cache_flush(0);
diff --git a/net/ipv4/esp4.c b/net/ipv4/esp4.c
index 4755e0dcc..07a594b83 100644
--- a/net/ipv4/esp4.c
+++ b/net/ipv4/esp4.c
@@ -1,6 +1,5 @@
 #include <linux/config.h>
 #include <linux/module.h>
-#include <net/inet_ecn.h>
 #include <net/ip.h>
 #include <net/xfrm.h>
 #include <net/esp.h>
@@ -11,8 +10,6 @@
 #include <net/icmp.h>
 #include <net/udp.h>
 
-#define MAX_SG_ONSTACK 4
-
 /* decapsulation data for use when post-processing */
 struct esp_decap_data {
 	xfrm_address_t	saddr;
@@ -25,43 +22,22 @@ int esp_output(struct sk_buff **pskb)
 	int err;
 	struct dst_entry *dst = (*pskb)->dst;
 	struct xfrm_state *x  = dst->xfrm;
-	struct iphdr *iph, *top_iph;
+	struct iphdr *top_iph;
 	struct ip_esp_hdr *esph;
 	struct crypto_tfm *tfm;
 	struct esp_data *esp;
 	struct sk_buff *trailer;
-	struct udphdr *uh = NULL;
-	u32 *udpdata32;
-	struct xfrm_encap_tmpl *encap = NULL;
 	int blksize;
 	int clen;
 	int alen;
 	int nfrags;
-	union {
-		struct iphdr	iph;
-		char 		buf[60];
-	} tmp_iph;
-
-	if ((*pskb)->ip_summed == CHECKSUM_HW) {
-		err = skb_checksum_help(pskb, 0);
-		if (err)
-			goto error_nolock;
-	}
-
-	spin_lock_bh(&x->lock);
-	err = xfrm_check_output(x, *pskb, AF_INET);
-	if (err)
-		goto error;
-	err = -ENOMEM;
 
-	/* Strip IP header in transport mode. Save it. */
-	if (!x->props.mode) {
-		iph = (*pskb)->nh.iph;
-		memcpy(&tmp_iph, iph, iph->ihl*4);
-		__skb_pull(*pskb, iph->ihl*4);
-	}
+	/* Strip IP+ESP header. */
+	__skb_pull(*pskb, (*pskb)->h.raw - (*pskb)->data);
 	/* Now skb is pure payload to encrypt */
 
+	err = -ENOMEM;
+
 	/* Round to block size */
 	clen = (*pskb)->len;
 
@@ -85,93 +61,39 @@ int esp_output(struct sk_buff **pskb)
 	*(u8*)(trailer->tail + clen-(*pskb)->len - 2) = (clen - (*pskb)->len)-2;
 	pskb_put(*pskb, trailer, clen - (*pskb)->len);
 
-	encap = x->encap;
-
-	iph = (*pskb)->nh.iph;
-	if (x->props.mode) {
-		top_iph = (struct iphdr*)skb_push(*pskb, x->props.header_len);
-		esph = (struct ip_esp_hdr*)(top_iph+1);
-		if (encap && encap->encap_type) {
-			switch (encap->encap_type) {
-			case UDP_ENCAP_ESPINUDP:
-				uh = (struct udphdr*) esph;
-				esph = (struct ip_esp_hdr*)(uh+1);
-				top_iph->protocol = IPPROTO_UDP;
-				break;
-			case UDP_ENCAP_ESPINUDP_NON_IKE:
-				uh = (struct udphdr*) esph;
-				udpdata32 = (u32*)(uh+1);
-				udpdata32[0] = udpdata32[1] = 0;
-				esph = (struct ip_esp_hdr*)(udpdata32+2);
-				alen += 2;
-				top_iph->protocol = IPPROTO_UDP;
-				break;
-			default:
-				printk(KERN_INFO
-				       "esp_output(): Unhandled encap: %u\n",
-				       encap->encap_type);
-				top_iph->protocol = IPPROTO_ESP;
-				break;
-			}
-		} else
-			top_iph->protocol = IPPROTO_ESP;
-		*(u8*)(trailer->tail - 1) = IPPROTO_IPIP;
-		top_iph->ihl = 5;
-		top_iph->version = 4;
-		top_iph->tos = iph->tos;	/* DS disclosed */
-		if (x->props.flags & XFRM_STATE_NOECN)
-			IP_ECN_clear(top_iph);
-		top_iph->tot_len = htons((*pskb)->len + alen);
-		top_iph->frag_off = iph->frag_off&htons(IP_DF);
-		if (!(top_iph->frag_off))
-			ip_select_ident(top_iph, dst, 0);
-		top_iph->ttl = iph->ttl;	/* TTL disclosed */
-		top_iph->check = 0;
-		top_iph->saddr = x->props.saddr.a4;
-		top_iph->daddr = x->id.daddr.a4;
-		memset(&(IPCB(*pskb)->opt), 0, sizeof(struct ip_options));
-	} else {
-		esph = (struct ip_esp_hdr*)skb_push(*pskb, x->props.header_len);
-		top_iph = (struct iphdr*)skb_push(*pskb, iph->ihl*4);
-		memcpy(top_iph, &tmp_iph, iph->ihl*4);
-		if (encap && encap->encap_type) {
-			switch (encap->encap_type) {
-			case UDP_ENCAP_ESPINUDP:
-				uh = (struct udphdr*) esph;
-				esph = (struct ip_esp_hdr*)(uh+1);
-				top_iph->protocol = IPPROTO_UDP;
-				break;
-			case UDP_ENCAP_ESPINUDP_NON_IKE:
-				uh = (struct udphdr*) esph;
-				udpdata32 = (u32*)(uh+1);
-				udpdata32[0] = udpdata32[1] = 0;
-				esph = (struct ip_esp_hdr*)(udpdata32+2);
-				alen += 2;
-				top_iph->protocol = IPPROTO_UDP;
-				break;
-			default:
-				printk(KERN_INFO
-				       "esp_output(): Unhandled encap: %u\n",
-				       encap->encap_type);
-				top_iph->protocol = IPPROTO_ESP;
-				break;
-			}
-		} else
-			top_iph->protocol = IPPROTO_ESP;
-		iph = &tmp_iph.iph;
-		top_iph->tot_len = htons((*pskb)->len + alen);
-		top_iph->check = 0;
-		top_iph->frag_off = iph->frag_off;
-		*(u8*)(trailer->tail - 1) = iph->protocol;
-	}
+	__skb_push(*pskb, (*pskb)->data - (*pskb)->nh.raw);
+	top_iph = (*pskb)->nh.iph;
+	esph = (struct ip_esp_hdr *)((*pskb)->nh.raw + top_iph->ihl*4);
+	top_iph->tot_len = htons((*pskb)->len + alen);
+	*(u8*)(trailer->tail - 1) = top_iph->protocol;
 
 	/* this is non-NULL only with UDP Encapsulation */
-	if (encap && uh) {
+	if (x->encap) {
+		struct xfrm_encap_tmpl *encap = x->encap;
+		struct udphdr *uh;
+		u32 *udpdata32;
+
+		uh = (struct udphdr *)esph;
 		uh->source = encap->encap_sport;
 		uh->dest = encap->encap_dport;
-		uh->len = htons((*pskb)->len + alen - sizeof(struct iphdr));
+		uh->len = htons((*pskb)->len + alen - top_iph->ihl*4);
 		uh->check = 0;
-	}
+
+		switch (encap->encap_type) {
+		default:
+		case UDP_ENCAP_ESPINUDP:
+			esph = (struct ip_esp_hdr *)(uh + 1);
+			break;
+		case UDP_ENCAP_ESPINUDP_NON_IKE:
+			udpdata32 = (u32 *)(uh + 1);
+			udpdata32[0] = udpdata32[1] = 0;
+			esph = (struct ip_esp_hdr *)(udpdata32 + 2);
+			break;
+		}
+
+		top_iph->protocol = IPPROTO_UDP;
+	} else
+		top_iph->protocol = IPPROTO_ESP;
 
 	esph->spi = x->id.spi;
 	esph->seq_no = htonl(++x->replay.oseq);
@@ -180,17 +102,16 @@ int esp_output(struct sk_buff **pskb)
 		crypto_cipher_set_iv(tfm, esp->conf.ivec, crypto_tfm_alg_ivsize(tfm));
 
 	do {
-		struct scatterlist sgbuf[nfrags>MAX_SG_ONSTACK ? 0 : nfrags];
-		struct scatterlist *sg = sgbuf;
+		struct scatterlist *sg = &esp->sgbuf[0];
 
-		if (unlikely(nfrags > MAX_SG_ONSTACK)) {
+		if (unlikely(nfrags > ESP_NUM_FAST_SG)) {
 			sg = kmalloc(sizeof(struct scatterlist)*nfrags, GFP_ATOMIC);
 			if (!sg)
 				goto error;
 		}
 		skb_to_sgvec(*pskb, sg, esph->enc_data+esp->conf.ivlen-(*pskb)->data, clen);
 		crypto_cipher_encrypt(tfm, sg, sg, clen);
-		if (unlikely(sg != sgbuf))
+		if (unlikely(sg != &esp->sgbuf[0]))
 			kfree(sg);
 	} while (0);
 
@@ -207,21 +128,9 @@ int esp_output(struct sk_buff **pskb)
 
 	ip_send_check(top_iph);
 
-	(*pskb)->nh.raw = (*pskb)->data;
-
-	x->curlft.bytes += (*pskb)->len;
-	x->curlft.packets++;
-	spin_unlock_bh(&x->lock);
-	if (((*pskb)->dst = dst_pop(dst)) == NULL) {
-		err = -EHOSTUNREACH;
-		goto error_nolock;
-	}
-	return NET_XMIT_BYPASS;
+	err = 0;
 
 error:
-	spin_unlock_bh(&x->lock);
-error_nolock:
-	kfree_skb(*pskb);
 	return err;
 }
 
@@ -278,19 +187,18 @@ int esp_input(struct xfrm_state *x, struct xfrm_decap_state *decap, struct sk_bu
 
         {
 		u8 nexthdr[2];
-		struct scatterlist sgbuf[nfrags>MAX_SG_ONSTACK ? 0 : nfrags];
-		struct scatterlist *sg = sgbuf;
+		struct scatterlist *sg = &esp->sgbuf[0];
 		u8 workbuf[60];
 		int padlen;
 
-		if (unlikely(nfrags > MAX_SG_ONSTACK)) {
+		if (unlikely(nfrags > ESP_NUM_FAST_SG)) {
 			sg = kmalloc(sizeof(struct scatterlist)*nfrags, GFP_ATOMIC);
 			if (!sg)
 				goto out;
 		}
 		skb_to_sgvec(skb, sg, sizeof(struct ip_esp_hdr) + esp->conf.ivlen, elen);
 		crypto_cipher_decrypt(esp->conf.tfm, sg, sg, elen);
-		if (unlikely(sg != sgbuf))
+		if (unlikely(sg != &esp->sgbuf[0]))
 			kfree(sg);
 
 		if (skb_copy_bits(skb, skb->len-alen-2, nexthdr, 2))
@@ -312,28 +220,14 @@ int esp_input(struct xfrm_state *x, struct xfrm_decap_state *decap, struct sk_bu
 			switch (decap->decap_type) {
 			case UDP_ENCAP_ESPINUDP:
 			case UDP_ENCAP_ESPINUDP_NON_IKE:
-
-				if ((void*)uh == (void*)esph) {
-					printk(KERN_DEBUG
-					       "esp_input(): Got ESP; expecting ESPinUDP\n");
-					break;
-				}
-
 				encap_data->proto = AF_INET;
 				encap_data->saddr.a4 = iph->saddr;
 				encap_data->sport = uh->source;
 				encap_len = (void*)esph - (void*)uh;
-				if (encap_len != sizeof(*uh))
-				  printk(KERN_DEBUG
-					 "esp_input(): UDP -> ESP: too much room: %d\n",
-					 encap_len);
 				break;
 
 			default:
-				printk(KERN_INFO
-			       "esp_input(): processing unknown encap type: %u\n",
-				       decap->decap_type);
-				break;
+				goto out;
 			}
 		}
 
@@ -366,11 +260,8 @@ int esp_post_input(struct xfrm_state *x, struct xfrm_decap_state *decap, struct
 		if (encap->encap_type != decap->decap_type)
 			return -EINVAL;
 
-		/* Next, if we don't have an encap type, then ignore it */
-		if (!encap->encap_type)
-			return 0;
-
 		switch (encap->encap_type) {
+		default:
 		case UDP_ENCAP_ESPINUDP:
 		case UDP_ENCAP_ESPINUDP_NON_IKE:
 			/*
@@ -407,11 +298,6 @@ int esp_post_input(struct xfrm_state *x, struct xfrm_decap_state *decap, struct
 				skb->ip_summed = CHECKSUM_UNNECESSARY;
 
 			break;
-		default:
-			printk(KERN_INFO
-			       "esp4_post_input(): Unhandled encap type: %u\n",
-			       encap->encap_type);
-			break;
 		}
 	}
 	return 0;
@@ -548,20 +434,14 @@ int esp_init_state(struct xfrm_state *x, void *args)
 	if (x->encap) {
 		struct xfrm_encap_tmpl *encap = x->encap;
 
-		if (encap->encap_type) {
-			switch (encap->encap_type) {
-			case UDP_ENCAP_ESPINUDP:
-				x->props.header_len += sizeof(struct udphdr);
-				break;
-			case UDP_ENCAP_ESPINUDP_NON_IKE:
-				x->props.header_len += sizeof(struct udphdr) + 2 * sizeof(u32);
-				break;
-			default:
-				printk (KERN_INFO
-				"esp_init_state(): Unhandled encap type: %u\n",
-					encap->encap_type);
-				break;
-			}
+		switch (encap->encap_type) {
+		default:
+		case UDP_ENCAP_ESPINUDP:
+			x->props.header_len += sizeof(struct udphdr);
+			break;
+		case UDP_ENCAP_ESPINUDP_NON_IKE:
+			x->props.header_len += sizeof(struct udphdr) + 2 * sizeof(u32);
+			break;
 		}
 	}
 	x->data = esp;
@@ -594,7 +474,7 @@ static struct xfrm_type esp_type =
 	.output		= esp_output
 };
 
-static struct inet_protocol esp4_protocol = {
+static struct net_protocol esp4_protocol = {
 	.handler	=	xfrm4_rcv,
 	.err_handler	=	esp4_err,
 	.no_policy	=	1,
diff --git a/net/ipv4/fib_frontend.c b/net/ipv4/fib_frontend.c
index fc4e9f8e6..f5b008a9d 100644
--- a/net/ipv4/fib_frontend.c
+++ b/net/ipv4/fib_frontend.c
@@ -235,7 +235,7 @@ e_inval:
  *	Handle IP routing ioctl calls. These are used to manipulate the routing tables
  */
  
-int ip_rt_ioctl(unsigned int cmd, void *arg)
+int ip_rt_ioctl(unsigned int cmd, void __user *arg)
 {
 	int err;
 	struct kern_rta rta;
diff --git a/net/ipv4/icmp.c b/net/ipv4/icmp.c
index 4a1a8e21d..69261324d 100644
--- a/net/ipv4/icmp.c
+++ b/net/ipv4/icmp.c
@@ -213,8 +213,8 @@ int sysctl_icmp_ratemask = 0x1818;
  */
 
 struct icmp_control {
-	int output_off;		/* Field offset for increment on output */
-	int input_off;		/* Field offset for increment on input */
+	int output_entry;	/* Field for increment on output */
+	int input_entry;	/* Field for increment on input */
 	void (*handler)(struct sk_buff *skb);
 	short   error;		/* This ICMP is classed as an error message */
 };
@@ -318,8 +318,8 @@ out:
 static void icmp_out_count(int type)
 {
 	if (type <= NR_ICMP_TYPES) {
-		ICMP_INC_STATS_FIELD(icmp_pointers[type].output_off);
-		ICMP_INC_STATS(IcmpOutMsgs);
+		ICMP_INC_STATS(icmp_pointers[type].output_entry);
+		ICMP_INC_STATS(ICMP_MIB_OUTMSGS);
 	}
 }
 
@@ -526,7 +526,6 @@ void icmp_send(struct sk_buff *skb_in, int type, int code, u32 info)
 							 .saddr = saddr,
 							 .tos = RT_TOS(tos) } },
 				    .proto = IPPROTO_ICMP };
-
 		if (ip_route_output_key(&rt, &fl))
 		    goto out_unlock;
 	}
@@ -593,7 +592,7 @@ static void icmp_unreach(struct sk_buff *skb)
 	struct iphdr *iph;
 	struct icmphdr *icmph;
 	int hash, protocol;
-	struct inet_protocol *ipprot;
+	struct net_protocol *ipprot;
 	struct sock *raw_sk;
 	u32 info = 0;
 
@@ -715,7 +714,7 @@ static void icmp_unreach(struct sk_buff *skb)
 out:
 	return;
 out_err:
-	ICMP_INC_STATS_BH(IcmpInErrors);
+	ICMP_INC_STATS_BH(ICMP_MIB_INERRORS);
 	goto out;
 }
 
@@ -756,7 +755,7 @@ static void icmp_redirect(struct sk_buff *skb)
 out:
 	return;
 out_err:
-	ICMP_INC_STATS_BH(IcmpInErrors);
+	ICMP_INC_STATS_BH(ICMP_MIB_INERRORS);
 	goto out;
 }
 
@@ -824,7 +823,7 @@ static void icmp_timestamp(struct sk_buff *skb)
 out:
 	return;
 out_err:
-	ICMP_INC_STATS_BH(IcmpInErrors);
+	ICMP_INC_STATS_BH(ICMP_MIB_INERRORS);
 	goto out;
 }
 
@@ -923,7 +922,7 @@ int icmp_rcv(struct sk_buff *skb)
 	struct icmphdr *icmph;
 	struct rtable *rt = (struct rtable *)skb->dst;
 
-	ICMP_INC_STATS_BH(IcmpInMsgs);
+	ICMP_INC_STATS_BH(ICMP_MIB_INMSGS);
 
 	switch (skb->ip_summed) {
 	case CHECKSUM_HW:
@@ -975,14 +974,14 @@ int icmp_rcv(struct sk_buff *skb)
   		}
 	}
 
-	ICMP_INC_STATS_BH_FIELD(icmp_pointers[icmph->type].input_off);
+	ICMP_INC_STATS_BH(icmp_pointers[icmph->type].input_entry);
 	icmp_pointers[icmph->type].handler(skb);
 
 drop:
 	kfree_skb(skb);
 	return 0;
 error:
-	ICMP_INC_STATS_BH(IcmpInErrors);
+	ICMP_INC_STATS_BH(ICMP_MIB_INERRORS);
 	goto drop;
 }
 
@@ -991,109 +990,109 @@ error:
  */
 static struct icmp_control icmp_pointers[NR_ICMP_TYPES + 1] = {
 	[ICMP_ECHOREPLY] = {
-		.output_off = offsetof(struct icmp_mib, IcmpOutEchoReps),
-		.input_off = offsetof(struct icmp_mib, IcmpInEchoReps),
+		.output_entry = ICMP_MIB_OUTECHOREPS,
+		.input_entry = ICMP_MIB_INECHOREPS,
 		.handler = icmp_discard,
 	},
 	[1] = {
-		.output_off = offsetof(struct icmp_mib, dummy),
-		.input_off = offsetof(struct icmp_mib,IcmpInErrors),
+		.output_entry = ICMP_MIB_DUMMY,
+		.input_entry = ICMP_MIB_INERRORS,
 		.handler = icmp_discard,
 		.error = 1,
 	},
 	[2] = {
-		.output_off = offsetof(struct icmp_mib, dummy),
-		.input_off = offsetof(struct icmp_mib,IcmpInErrors),
+		.output_entry = ICMP_MIB_DUMMY,
+		.input_entry = ICMP_MIB_INERRORS,
 		.handler = icmp_discard,
 		.error = 1,
 	},
 	[ICMP_DEST_UNREACH] = {
-		.output_off = offsetof(struct icmp_mib, IcmpOutDestUnreachs),
-		.input_off = offsetof(struct icmp_mib, IcmpInDestUnreachs),
+		.output_entry = ICMP_MIB_OUTDESTUNREACHS,
+		.input_entry = ICMP_MIB_INDESTUNREACHS,
 		.handler = icmp_unreach,
 		.error = 1,
 	},
 	[ICMP_SOURCE_QUENCH] = {
-		.output_off = offsetof(struct icmp_mib, IcmpOutSrcQuenchs),
-		.input_off = offsetof(struct icmp_mib, IcmpInSrcQuenchs),
+		.output_entry = ICMP_MIB_OUTSRCQUENCHS,
+		.input_entry = ICMP_MIB_INSRCQUENCHS,
 		.handler = icmp_unreach,
 		.error = 1,
 	},
 	[ICMP_REDIRECT] = {
-		.output_off = offsetof(struct icmp_mib, IcmpOutRedirects),
-		.input_off = offsetof(struct icmp_mib, IcmpInRedirects),
+		.output_entry = ICMP_MIB_OUTREDIRECTS,
+		.input_entry = ICMP_MIB_INREDIRECTS,
 		.handler = icmp_redirect,
 		.error = 1,
 	},
 	[6] = {
-		.output_off = offsetof(struct icmp_mib, dummy),
-		.input_off = offsetof(struct icmp_mib, IcmpInErrors),
+		.output_entry = ICMP_MIB_DUMMY,
+		.input_entry = ICMP_MIB_INERRORS,
 		.handler = icmp_discard,
 		.error = 1,
 	},
 	[7] = {
-		.output_off = offsetof(struct icmp_mib, dummy),
-		.input_off = offsetof(struct icmp_mib, IcmpInErrors),
+		.output_entry = ICMP_MIB_DUMMY,
+		.input_entry = ICMP_MIB_INERRORS,
 		.handler = icmp_discard,
 		.error = 1,
 	},
 	[ICMP_ECHO] = {
-		.output_off = offsetof(struct icmp_mib, IcmpOutEchos),
-		.input_off = offsetof(struct icmp_mib, IcmpInEchos),
+		.output_entry = ICMP_MIB_OUTECHOS,
+		.input_entry = ICMP_MIB_INECHOS,
 		.handler = icmp_echo,
 	},
 	[9] = {
-		.output_off = offsetof(struct icmp_mib, dummy),
-		.input_off = offsetof(struct icmp_mib, IcmpInErrors),
+		.output_entry = ICMP_MIB_DUMMY,
+		.input_entry = ICMP_MIB_INERRORS,
 		.handler = icmp_discard,
 		.error = 1,
 	},
 	[10] = {
-		.output_off = offsetof(struct icmp_mib, dummy),
-		.input_off = offsetof(struct icmp_mib, IcmpInErrors),
+		.output_entry = ICMP_MIB_DUMMY,
+		.input_entry = ICMP_MIB_INERRORS,
 		.handler = icmp_discard,
 		.error = 1,
 	},
 	[ICMP_TIME_EXCEEDED] = {
-		.output_off = offsetof(struct icmp_mib, IcmpOutTimeExcds),
-		.input_off = offsetof(struct icmp_mib,IcmpInTimeExcds),
+		.output_entry = ICMP_MIB_OUTTIMEEXCDS,
+		.input_entry = ICMP_MIB_INTIMEEXCDS,
 		.handler = icmp_unreach,
 		.error = 1,
 	},
 	[ICMP_PARAMETERPROB] = {
-		.output_off = offsetof(struct icmp_mib, IcmpOutParmProbs),
-		.input_off = offsetof(struct icmp_mib, IcmpInParmProbs),
+		.output_entry = ICMP_MIB_OUTPARMPROBS,
+		.input_entry = ICMP_MIB_INPARMPROBS,
 		.handler = icmp_unreach,
 		.error = 1,
 	},
 	[ICMP_TIMESTAMP] = {
-		.output_off = offsetof(struct icmp_mib, IcmpOutTimestamps),
-		.input_off = offsetof(struct icmp_mib, IcmpInTimestamps),
+		.output_entry = ICMP_MIB_OUTTIMESTAMPS,
+		.input_entry = ICMP_MIB_INTIMESTAMPS,
 		.handler = icmp_timestamp,
 	},
 	[ICMP_TIMESTAMPREPLY] = {
-		.output_off = offsetof(struct icmp_mib, IcmpOutTimestampReps),
-		.input_off = offsetof(struct icmp_mib, IcmpInTimestampReps),
+		.output_entry = ICMP_MIB_OUTTIMESTAMPREPS,
+		.input_entry = ICMP_MIB_INTIMESTAMPREPS,
 		.handler = icmp_discard,
 	},
 	[ICMP_INFO_REQUEST] = {
-		.output_off = offsetof(struct icmp_mib, dummy),
-		.input_off = offsetof(struct icmp_mib, dummy),
+		.output_entry = ICMP_MIB_DUMMY,
+		.input_entry = ICMP_MIB_DUMMY,
 		.handler = icmp_discard,
 	},
  	[ICMP_INFO_REPLY] = {
-		.output_off = offsetof(struct icmp_mib, dummy),
-		.input_off = offsetof(struct icmp_mib, dummy),
+		.output_entry = ICMP_MIB_DUMMY,
+		.input_entry = ICMP_MIB_DUMMY,
 		.handler = icmp_discard,
 	},
 	[ICMP_ADDRESS] = {
-		.output_off = offsetof(struct icmp_mib, IcmpOutAddrMasks),
-		.input_off = offsetof(struct icmp_mib, IcmpInAddrMasks),
+		.output_entry = ICMP_MIB_OUTADDRMASKS,
+		.input_entry = ICMP_MIB_INADDRMASKS,
 		.handler = icmp_address,
 	},
 	[ICMP_ADDRESSREPLY] = {
-		.output_off = offsetof(struct icmp_mib, IcmpOutAddrMaskReps),
-		.input_off = offsetof(struct icmp_mib, IcmpInAddrMaskReps),
+		.output_entry = ICMP_MIB_OUTADDRMASKREPS,
+		.input_entry = ICMP_MIB_INADDRMASKREPS,
 		.handler = icmp_address_reply,
 	},
 };
diff --git a/net/ipv4/igmp.c b/net/ipv4/igmp.c
index 149dc8627..01db76123 100644
--- a/net/ipv4/igmp.c
+++ b/net/ipv4/igmp.c
@@ -279,7 +279,7 @@ static struct sk_buff *igmpv3_newpack(struct net_device *dev, int size)
 
 	skb = alloc_skb(size + LL_RESERVED_SPACE(dev), GFP_ATOMIC);
 	if (skb == NULL)
-		return 0;
+		return NULL;
 
 	{
 		struct flowi fl = { .oif = dev->ifindex,
@@ -288,13 +288,13 @@ static struct sk_buff *igmpv3_newpack(struct net_device *dev, int size)
 				    .proto = IPPROTO_IGMP };
 		if (ip_route_output_key(&rt, &fl)) {
 			kfree_skb(skb);
-			return 0;
+			return NULL;
 		}
 	}
 	if (rt->rt_src == 0) {
 		kfree_skb(skb);
 		ip_rt_put(rt);
-		return 0;
+		return NULL;
 	}
 
 	skb->dst = &rt->u.dst;
@@ -361,7 +361,7 @@ static struct sk_buff *add_grhead(struct sk_buff *skb, struct ip_mc_list *pmc,
 	if (!skb)
 		skb = igmpv3_newpack(dev, dev->mtu);
 	if (!skb)
-		return 0;
+		return NULL;
 	pgr = (struct igmpv3_grec *)skb_put(skb, sizeof(struct igmpv3_grec));
 	pgr->grec_type = type;
 	pgr->grec_auxwords = 0;
@@ -381,7 +381,7 @@ static struct sk_buff *add_grec(struct sk_buff *skb, struct ip_mc_list *pmc,
 {
 	struct net_device *dev = pmc->interface->dev;
 	struct igmpv3_report *pih;
-	struct igmpv3_grec *pgr = 0;
+	struct igmpv3_grec *pgr = NULL;
 	struct ip_sf_list *psf, *psf_next, *psf_prev, **psf_list;
 	int scount, first, isquery, truncate;
 
@@ -406,13 +406,13 @@ static struct sk_buff *add_grec(struct sk_buff *skb, struct ip_mc_list *pmc,
 			if (skb && AVAILABLE(skb) < sizeof(struct igmpv3_grec)+
 			    sizeof(__u32)) {
 				igmpv3_sendpack(skb);
-				skb = 0; /* add_grhead will get a new one */
+				skb = NULL; /* add_grhead will get a new one */
 			}
 			skb = add_grhead(skb, pmc, type, &pgr);
 		}
 		return skb;
 	}
-	pih = skb ? (struct igmpv3_report *)skb->h.igmph : 0;
+	pih = skb ? (struct igmpv3_report *)skb->h.igmph : NULL;
 
 	/* EX and TO_EX get a fresh packet, if needed */
 	if (truncate) {
@@ -425,7 +425,7 @@ static struct sk_buff *add_grec(struct sk_buff *skb, struct ip_mc_list *pmc,
 	}
 	first = 1;
 	scount = 0;
-	psf_prev = 0;
+	psf_prev = NULL;
 	for (psf=*psf_list; psf; psf=psf_next) {
 		u32 *psrc;
 
@@ -483,7 +483,7 @@ static struct sk_buff *add_grec(struct sk_buff *skb, struct ip_mc_list *pmc,
 
 static int igmpv3_send_report(struct in_device *in_dev, struct ip_mc_list *pmc)
 {
-	struct sk_buff *skb = 0;
+	struct sk_buff *skb = NULL;
 	int type;
 
 	if (!pmc) {
@@ -521,7 +521,7 @@ static void igmpv3_clear_zeros(struct ip_sf_list **ppsf)
 {
 	struct ip_sf_list *psf_prev, *psf_next, *psf;
 
-	psf_prev = 0;
+	psf_prev = NULL;
 	for (psf=*ppsf; psf; psf = psf_next) {
 		psf_next = psf->sf_next;
 		if (psf->sf_crcount == 0) {
@@ -538,14 +538,14 @@ static void igmpv3_clear_zeros(struct ip_sf_list **ppsf)
 static void igmpv3_send_cr(struct in_device *in_dev)
 {
 	struct ip_mc_list *pmc, *pmc_prev, *pmc_next;
-	struct sk_buff *skb = 0;
+	struct sk_buff *skb = NULL;
 	int type, dtype;
 
 	read_lock(&in_dev->lock);
 	write_lock_bh(&in_dev->mc_lock);
 
 	/* deleted MCA's */
-	pmc_prev = 0;
+	pmc_prev = NULL;
 	for (pmc=in_dev->mc_tomb; pmc; pmc=pmc_next) {
 		pmc_next = pmc->next;
 		if (pmc->sfmode == MCAST_INCLUDE) {
@@ -681,7 +681,7 @@ static void igmp_gq_timer_expire(unsigned long data)
 	struct in_device *in_dev = (struct in_device *)data;
 
 	in_dev->mr_gq_running = 0;
-	igmpv3_send_report(in_dev, 0);
+	igmpv3_send_report(in_dev, NULL);
 	__in_dev_put(in_dev);
 }
 
@@ -976,7 +976,7 @@ static void igmpv3_add_delrec(struct in_device *in_dev, struct ip_mc_list *im)
 
 		pmc->tomb = im->tomb;
 		pmc->sources = im->sources;
-		im->tomb = im->sources = 0;
+		im->tomb = im->sources = NULL;
 		for (psf=pmc->sources; psf; psf=psf->sf_next)
 			psf->sf_crcount = pmc->crcount;
 	}
@@ -994,7 +994,7 @@ static void igmpv3_del_delrec(struct in_device *in_dev, __u32 multiaddr)
 	struct ip_sf_list *psf, *psf_next;
 
 	write_lock_bh(&in_dev->mc_lock);
-	pmc_prev = 0;
+	pmc_prev = NULL;
 	for (pmc=in_dev->mc_tomb; pmc; pmc=pmc->next) {
 		if (pmc->multiaddr == multiaddr)
 			break;
@@ -1023,7 +1023,7 @@ static void igmpv3_clear_delrec(struct in_device *in_dev)
 
 	write_lock_bh(&in_dev->mc_lock);
 	pmc = in_dev->mc_tomb;
-	in_dev->mc_tomb = 0;
+	in_dev->mc_tomb = NULL;
 	write_unlock_bh(&in_dev->mc_lock);
 
 	for (; pmc; pmc = nextpmc) {
@@ -1039,7 +1039,7 @@ static void igmpv3_clear_delrec(struct in_device *in_dev)
 
 		spin_lock_bh(&pmc->lock);
 		psf = pmc->tomb;
-		pmc->tomb = 0;
+		pmc->tomb = NULL;
 		spin_unlock_bh(&pmc->lock);
 		for (; psf; psf=psf_next) {
 			psf_next = psf->sf_next;
@@ -1135,7 +1135,7 @@ void ip_mc_inc_group(struct in_device *in_dev, u32 addr)
 	for (im=in_dev->mc_list; im; im=im->next) {
 		if (im->multiaddr == addr) {
 			im->users++;
-			ip_mc_add_src(in_dev, &addr, MCAST_EXCLUDE, 0, 0, 0);
+			ip_mc_add_src(in_dev, &addr, MCAST_EXCLUDE, 0, NULL, 0);
 			goto out;
 		}
 	}
@@ -1152,8 +1152,8 @@ void ip_mc_inc_group(struct in_device *in_dev, u32 addr)
 	im->sfmode = MCAST_EXCLUDE;
 	im->sfcount[MCAST_INCLUDE] = 0;
 	im->sfcount[MCAST_EXCLUDE] = 1;
-	im->sources = 0;
-	im->tomb = 0;
+	im->sources = NULL;
+	im->tomb = NULL;
 	im->crcount = 0;
 	atomic_set(&im->refcnt, 1);
 	spin_lock_init(&im->lock);
@@ -1238,7 +1238,7 @@ void ip_mc_init_dev(struct in_device *in_dev)
 {
 	ASSERT_RTNL();
 
-	in_dev->mc_tomb = 0;
+	in_dev->mc_tomb = NULL;
 #ifdef CONFIG_IP_MULTICAST
 	in_dev->mr_gq_running = 0;
 	init_timer(&in_dev->mr_gq_timer);
@@ -1339,7 +1339,7 @@ static int ip_mc_del1_src(struct ip_mc_list *pmc, int sfmode,
 	struct ip_sf_list *psf, *psf_prev;
 	int rv = 0;
 
-	psf_prev = 0;
+	psf_prev = NULL;
 	for (psf=pmc->sources; psf; psf=psf->sf_next) {
 		if (psf->sf_inaddr == *psfsrc)
 			break;
@@ -1453,7 +1453,7 @@ static int ip_mc_add1_src(struct ip_mc_list *pmc, int sfmode,
 {
 	struct ip_sf_list *psf, *psf_prev;
 
-	psf_prev = 0;
+	psf_prev = NULL;
 	for (psf=pmc->sources; psf; psf=psf->sf_next) {
 		if (psf->sf_inaddr == *psfsrc)
 			break;
@@ -1594,12 +1594,12 @@ static void ip_mc_clear_src(struct ip_mc_list *pmc)
 		nextpsf = psf->sf_next;
 		kfree(psf);
 	}
-	pmc->tomb = 0;
+	pmc->tomb = NULL;
 	for (psf=pmc->sources; psf; psf=nextpsf) {
 		nextpsf = psf->sf_next;
 		kfree(psf);
 	}
-	pmc->sources = 0;
+	pmc->sources = NULL;
 	pmc->sfmode = MCAST_EXCLUDE;
 	pmc->sfcount[MCAST_EXCLUDE] = 0;
 	pmc->sfcount[MCAST_EXCLUDE] = 1;
@@ -1673,13 +1673,13 @@ int ip_mc_leave_src(struct sock *sk, struct ip_mc_socklist *iml,
 	if (iml->sflist == 0) {
 		/* any-source empty exclude case */
 		return ip_mc_del_src(in_dev, &iml->multi.imr_multiaddr.s_addr,
-			iml->sfmode, 0, 0, 0);
+			iml->sfmode, 0, NULL, 0);
 	}
 	err = ip_mc_del_src(in_dev, &iml->multi.imr_multiaddr.s_addr,
 			iml->sfmode, iml->sflist->sl_count,
 			iml->sflist->sl_addr, 0);
 	sock_kfree_s(sk, iml->sflist, IP_SFLSIZE(iml->sflist->sl_max));
-	iml->sflist = 0;
+	iml->sflist = NULL;
 	return err;
 }
 
@@ -1731,7 +1731,7 @@ int ip_mc_source(int add, int omode, struct sock *sk, struct
 	struct ip_mreqn imr;
 	u32 addr = mreqs->imr_multiaddr;
 	struct ip_mc_socklist *pmc;
-	struct in_device *in_dev = 0;
+	struct in_device *in_dev = NULL;
 	struct inet_opt *inet = inet_sk(sk);
 	struct ip_sf_socklist *psl;
 	int i, j, rv;
@@ -1764,9 +1764,9 @@ int ip_mc_source(int add, int omode, struct sock *sk, struct
 			goto done;
 	} else if (pmc->sfmode != omode) {
 		/* allow mode switches for empty-set filters */
-		ip_mc_add_src(in_dev, &mreqs->imr_multiaddr, omode, 0, 0, 0);
+		ip_mc_add_src(in_dev, &mreqs->imr_multiaddr, omode, 0, NULL, 0);
 		ip_mc_del_src(in_dev, &mreqs->imr_multiaddr, pmc->sfmode, 0, 
-			0, 0);
+			NULL, 0);
 		pmc->sfmode = omode;
 	}
 
@@ -1896,7 +1896,7 @@ int ip_mc_msfilter(struct sock *sk, struct ip_msfilter *msf, int ifindex)
 			goto done;
 		}
 	} else
-		newpsl = 0;
+		newpsl = NULL;
 	psl = pmc->sflist;
 	if (psl) {
 		(void) ip_mc_del_src(in_dev, &msf->imsf_multiaddr, pmc->sfmode,
@@ -1904,7 +1904,7 @@ int ip_mc_msfilter(struct sock *sk, struct ip_msfilter *msf, int ifindex)
 		sock_kfree_s(sk, psl, IP_SFLSIZE(psl->sl_max));
 	} else
 		(void) ip_mc_del_src(in_dev, &msf->imsf_multiaddr, pmc->sfmode,
-			0, 0, 0);
+			0, NULL, 0);
 	pmc->sflist = newpsl;
 	pmc->sfmode = msf->imsf_fmode;
 done:
@@ -2217,8 +2217,8 @@ static void igmp_mc_seq_stop(struct seq_file *seq, void *v)
 static int igmp_mc_seq_show(struct seq_file *seq, void *v)
 {
 	if (v == SEQ_START_TOKEN)
-		seq_printf(seq, 
-			   "Idx\tDevice    : Count Querier\tGroup    Users Timer\tReporter\n");
+		seq_puts(seq, 
+			 "Idx\tDevice    : Count Querier\tGroup    Users Timer\tReporter\n");
 	else {
 		struct ip_mc_list *im = (struct ip_mc_list *)v;
 		struct igmp_mc_iter_state *state = igmp_mc_seq_private(seq);
diff --git a/net/ipv4/ip_forward.c b/net/ipv4/ip_forward.c
index be1e87c11..77094aac6 100644
--- a/net/ipv4/ip_forward.c
+++ b/net/ipv4/ip_forward.c
@@ -46,7 +46,7 @@ static inline int ip_forward_finish(struct sk_buff *skb)
 {
 	struct ip_options * opt	= &(IPCB(skb)->opt);
 
-	IP_INC_STATS_BH(OutForwDatagrams);
+	IP_INC_STATS_BH(IPSTATS_MIB_OUTFORWDATAGRAMS);
 
 	if (unlikely(opt->optlen))
 		ip_forward_options(skb);
diff --git a/net/ipv4/ip_fragment.c b/net/ipv4/ip_fragment.c
index 1f007c67b..6fd69feff 100644
--- a/net/ipv4/ip_fragment.c
+++ b/net/ipv4/ip_fragment.c
@@ -263,7 +263,7 @@ static void ip_evictor(void)
 		spin_unlock(&qp->lock);
 
 		ipq_put(qp);
-		IP_INC_STATS_BH(ReasmFails);
+		IP_INC_STATS_BH(IPSTATS_MIB_REASMFAILS);
 	}
 }
 
@@ -281,8 +281,8 @@ static void ip_expire(unsigned long arg)
 
 	ipq_kill(qp);
 
-	IP_INC_STATS_BH(ReasmTimeout);
-	IP_INC_STATS_BH(ReasmFails);
+	IP_INC_STATS_BH(IPSTATS_MIB_REASMTIMEOUT);
+	IP_INC_STATS_BH(IPSTATS_MIB_REASMFAILS);
 
 	if ((qp->last_in&FIRST_IN) && qp->fragments != NULL) {
 		struct sk_buff *head = qp->fragments;
@@ -609,7 +609,7 @@ static struct sk_buff *ip_frag_reasm(struct ipq *qp, struct net_device *dev)
 	iph = head->nh.iph;
 	iph->frag_off = 0;
 	iph->tot_len = htons(len);
-	IP_INC_STATS_BH(ReasmOKs);
+	IP_INC_STATS_BH(IPSTATS_MIB_REASMOKS);
 	qp->fragments = NULL;
 	return head;
 
@@ -625,7 +625,7 @@ out_oversize:
 			"Oversized IP packet from %d.%d.%d.%d.\n",
 			NIPQUAD(qp->saddr));
 out_fail:
-	IP_INC_STATS_BH(ReasmFails);
+	IP_INC_STATS_BH(IPSTATS_MIB_REASMFAILS);
 	return NULL;
 }
 
@@ -636,7 +636,7 @@ struct sk_buff *ip_defrag(struct sk_buff *skb)
 	struct ipq *qp;
 	struct net_device *dev;
 	
-	IP_INC_STATS_BH(ReasmReqds);
+	IP_INC_STATS_BH(IPSTATS_MIB_REASMREQDS);
 
 	/* Start by cleaning up the memory. */
 	if (atomic_read(&ip_frag_mem) > sysctl_ipfrag_high_thresh)
@@ -661,7 +661,7 @@ struct sk_buff *ip_defrag(struct sk_buff *skb)
 		return ret;
 	}
 
-	IP_INC_STATS_BH(ReasmFails);
+	IP_INC_STATS_BH(IPSTATS_MIB_REASMFAILS);
 	kfree_skb(skb);
 	return NULL;
 }
diff --git a/net/ipv4/ip_gre.c b/net/ipv4/ip_gre.c
index 4a227f51b..2a3a8fb7e 100644
--- a/net/ipv4/ip_gre.c
+++ b/net/ipv4/ip_gre.c
@@ -643,13 +643,7 @@ int ipgre_rcv(struct sk_buff *skb)
 		skb->dev = tunnel->dev;
 		dst_release(skb->dst);
 		skb->dst = NULL;
-#ifdef CONFIG_NETFILTER
-		nf_conntrack_put(skb->nfct);
-		skb->nfct = NULL;
-#ifdef CONFIG_NETFILTER_DEBUG
-		skb->nf_debug = 0;
-#endif
-#endif
+		nf_reset(skb);
 		ipgre_ecn_decapsulate(iph, skb);
 		netif_rx(skb);
 		read_unlock(&ipgre_lock);
@@ -877,13 +871,7 @@ static int ipgre_tunnel_xmit(struct sk_buff *skb, struct net_device *dev)
 		}
 	}
 
-#ifdef CONFIG_NETFILTER
-	nf_conntrack_put(skb->nfct);
-	skb->nfct = NULL;
-#ifdef CONFIG_NETFILTER_DEBUG
-	skb->nf_debug = 0;
-#endif
-#endif
+	nf_reset(skb);
 
 	IPTUNNEL_XMIT();
 	tunnel->recursion--;
@@ -1240,7 +1228,7 @@ int __init ipgre_fb_tunnel_init(struct net_device *dev)
 }
 
 
-static struct inet_protocol ipgre_protocol = {
+static struct net_protocol ipgre_protocol = {
 	.handler	=	ipgre_rcv,
 	.err_handler	=	ipgre_err,
 };
diff --git a/net/ipv4/ip_input.c b/net/ipv4/ip_input.c
index 2f71ed5cf..c7b3b6050 100644
--- a/net/ipv4/ip_input.c
+++ b/net/ipv4/ip_input.c
@@ -202,17 +202,13 @@ static inline int ip_local_deliver_finish(struct sk_buff *skb)
 
 #ifdef CONFIG_NETFILTER_DEBUG
 	nf_debug_ip_local_deliver(skb);
-	skb->nf_debug = 0;
 #endif /*CONFIG_NETFILTER_DEBUG*/
 
 	__skb_pull(skb, ihl);
 
-#ifdef CONFIG_NETFILTER
 	/* Free reference early: we don't need it any more, and it may
            hold ip_conntrack module loaded indefinitely. */
-	nf_conntrack_put(skb->nfct);
-	skb->nfct = NULL;
-#endif /*CONFIG_NETFILTER*/
+	nf_reset(skb);
 
         /* Point into the IP datagram, just past the header. */
         skb->h.raw = skb->data;
@@ -223,7 +219,7 @@ static inline int ip_local_deliver_finish(struct sk_buff *skb)
 		int protocol = skb->nh.iph->protocol;
 		int hash;
 		struct sock *raw_sk;
-		struct inet_protocol *ipprot;
+		struct net_protocol *ipprot;
 
 	resubmit:
 		hash = protocol & (MAX_INET_PROTOS - 1);
@@ -249,16 +245,16 @@ static inline int ip_local_deliver_finish(struct sk_buff *skb)
 				protocol = -ret;
 				goto resubmit;
 			}
-			IP_INC_STATS_BH(InDelivers);
+			IP_INC_STATS_BH(IPSTATS_MIB_INDELIVERS);
 		} else {
 			if (!raw_sk) {
 				if (xfrm4_policy_check(NULL, XFRM_POLICY_IN, skb)) {
-					IP_INC_STATS_BH(InUnknownProtos);
+					IP_INC_STATS_BH(IPSTATS_MIB_INUNKNOWNPROTOS);
 					icmp_send(skb, ICMP_DEST_UNREACH,
 						  ICMP_PROT_UNREACH, 0);
 				}
 			} else
-				IP_INC_STATS_BH(InDelivers);
+				IP_INC_STATS_BH(IPSTATS_MIB_INDELIVERS);
 			kfree_skb(skb);
 		}
 	}
@@ -324,7 +320,7 @@ static inline int ip_rcv_finish(struct sk_buff *skb)
 		*/
 
 		if (skb_cow(skb, skb_headroom(skb))) {
-			IP_INC_STATS_BH(InDiscards);
+			IP_INC_STATS_BH(IPSTATS_MIB_INDISCARDS);
 			goto drop;
 		}
 		iph = skb->nh.iph;
@@ -353,7 +349,7 @@ static inline int ip_rcv_finish(struct sk_buff *skb)
 	return dst_input(skb);
 
 inhdr_error:
-	IP_INC_STATS_BH(InHdrErrors);
+	IP_INC_STATS_BH(IPSTATS_MIB_INHDRERRORS);
 drop:
         kfree_skb(skb);
         return NET_RX_DROP;
@@ -372,10 +368,10 @@ int ip_rcv(struct sk_buff *skb, struct net_device *dev, struct packet_type *pt)
 	if (skb->pkt_type == PACKET_OTHERHOST)
 		goto drop;
 
-	IP_INC_STATS_BH(InReceives);
+	IP_INC_STATS_BH(IPSTATS_MIB_INRECEIVES);
 
 	if ((skb = skb_share_check(skb, GFP_ATOMIC)) == NULL) {
-		IP_INC_STATS_BH(InDiscards);
+		IP_INC_STATS_BH(IPSTATS_MIB_INDISCARDS);
 		goto out;
 	}
 
@@ -426,7 +422,7 @@ int ip_rcv(struct sk_buff *skb, struct net_device *dev, struct packet_type *pt)
 		       ip_rcv_finish);
 
 inhdr_error:
-	IP_INC_STATS_BH(InHdrErrors);
+	IP_INC_STATS_BH(IPSTATS_MIB_INHDRERRORS);
 drop:
         kfree_skb(skb);
 out:
diff --git a/net/ipv4/ip_output.c b/net/ipv4/ip_output.c
index 60fc5091c..5a853aac2 100644
--- a/net/ipv4/ip_output.c
+++ b/net/ipv4/ip_output.c
@@ -233,7 +233,7 @@ int ip_mc_output(struct sk_buff **pskb)
 	/*
 	 *	If the indicated interface is up and running, send the packet.
 	 */
-	IP_INC_STATS(OutRequests);
+	IP_INC_STATS(IPSTATS_MIB_OUTREQUESTS);
 
 	skb->dev = dev;
 	skb->protocol = htons(ETH_P_IP);
@@ -288,7 +288,7 @@ int ip_output(struct sk_buff **pskb)
 {
 	struct sk_buff *skb = *pskb;
 
-	IP_INC_STATS(OutRequests);
+	IP_INC_STATS(IPSTATS_MIB_OUTREQUESTS);
 
 	if ((skb->len > dst_pmtu(skb->dst) || skb_shinfo(skb)->frag_list) &&
 	    !skb_shinfo(skb)->tso_size)
@@ -393,7 +393,7 @@ packet_routed:
 		       dst_output);
 
 no_route:
-	IP_INC_STATS(OutNoRoutes);
+	IP_INC_STATS(IPSTATS_MIB_OUTNOROUTES);
 	kfree_skb(skb);
 	return -EHOSTUNREACH;
 }
@@ -498,10 +498,6 @@ int ip_fragment(struct sk_buff *skb, int (*output)(struct sk_buff*))
 			    skb_headroom(frag) < hlen)
 			    goto slow_path;
 
-			/* Correct socket ownership. */
-			if (frag->sk == NULL && skb->sk)
-				goto slow_path;
-
 			/* Partially cloned skb? */
 			if (skb_shared(frag))
 				goto slow_path;
@@ -512,7 +508,7 @@ int ip_fragment(struct sk_buff *skb, int (*output)(struct sk_buff*))
 		err = 0;
 		offset = 0;
 		frag = skb_shinfo(skb)->frag_list;
-		skb_shinfo(skb)->frag_list = 0;
+		skb_shinfo(skb)->frag_list = NULL;
 		skb->data_len = first_len - skb_headlen(skb);
 		skb->len = first_len;
 		iph->tot_len = htons(first_len);
@@ -550,7 +546,7 @@ int ip_fragment(struct sk_buff *skb, int (*output)(struct sk_buff*))
 		}
 
 		if (err == 0) {
-			IP_INC_STATS(FragOKs);
+			IP_INC_STATS(IPSTATS_MIB_FRAGOKS);
 			return 0;
 		}
 
@@ -559,7 +555,7 @@ int ip_fragment(struct sk_buff *skb, int (*output)(struct sk_buff*))
 			kfree_skb(frag);
 			frag = skb;
 		}
-		IP_INC_STATS(FragFails);
+		IP_INC_STATS(IPSTATS_MIB_FRAGFAILS);
 		return err;
 	}
 
@@ -665,7 +661,7 @@ slow_path:
 		 *	Put this fragment into the sending queue.
 		 */
 
-		IP_INC_STATS(FragCreates);
+		IP_INC_STATS(IPSTATS_MIB_FRAGCREATES);
 
 		iph->tot_len = htons(len + hlen);
 
@@ -676,12 +672,12 @@ slow_path:
 			goto fail;
 	}
 	kfree_skb(skb);
-	IP_INC_STATS(FragOKs);
+	IP_INC_STATS(IPSTATS_MIB_FRAGOKS);
 	return err;
 
 fail:
 	kfree_skb(skb); 
-	IP_INC_STATS(FragFails);
+	IP_INC_STATS(IPSTATS_MIB_FRAGFAILS);
 	return err;
 }
 
@@ -702,17 +698,6 @@ ip_generic_getfrag(void *from, char *to, int offset, int len, int odd, struct sk
 	return 0;
 }
 
-static inline int
-skb_can_coalesce(struct sk_buff *skb, int i, struct page *page, int off)
-{
-	if (i) {
-		skb_frag_t *frag = &skb_shinfo(skb)->frags[i-1];
-		return page == frag->page &&
-			off == frag->page_offset+frag->size;
-	}
-	return 0;
-}
-
 static inline unsigned int
 csum_page(struct page *page, int offset, int copy)
 {
@@ -777,8 +762,8 @@ int ip_append_data(struct sock *sk,
 		inet->cork.fragsize = mtu = dst_pmtu(&rt->u.dst);
 		inet->cork.rt = rt;
 		inet->cork.length = 0;
-		inet->sndmsg_page = NULL;
-		inet->sndmsg_off = 0;
+		sk->sk_sndmsg_page = NULL;
+		sk->sk_sndmsg_off = 0;
 		if ((exthdrlen = rt->u.dst.header_len) != 0) {
 			length += exthdrlen;
 			transhdrlen += exthdrlen;
@@ -926,8 +911,8 @@ alloc_new_skb:
 		} else {
 			int i = skb_shinfo(skb)->nr_frags;
 			skb_frag_t *frag = &skb_shinfo(skb)->frags[i-1];
-			struct page *page = inet->sndmsg_page;
-			int off = inet->sndmsg_off;
+			struct page *page = sk->sk_sndmsg_page;
+			int off = sk->sk_sndmsg_off;
 			unsigned int left;
 
 			if (page && (left = PAGE_SIZE - off) > 0) {
@@ -939,7 +924,7 @@ alloc_new_skb:
 						goto error;
 					}
 					get_page(page);
-	 				skb_fill_page_desc(skb, i, page, inet->sndmsg_off, 0);
+	 				skb_fill_page_desc(skb, i, page, sk->sk_sndmsg_off, 0);
 					frag = &skb_shinfo(skb)->frags[i];
 				}
 			} else if (i < MAX_SKB_FRAGS) {
@@ -950,8 +935,8 @@ alloc_new_skb:
 					err = -ENOMEM;
 					goto error;
 				}
-				inet->sndmsg_page = page;
-				inet->sndmsg_off = 0;
+				sk->sk_sndmsg_page = page;
+				sk->sk_sndmsg_off = 0;
 
 				skb_fill_page_desc(skb, i, page, 0, 0);
 				frag = &skb_shinfo(skb)->frags[i];
@@ -965,7 +950,7 @@ alloc_new_skb:
 				err = -EFAULT;
 				goto error;
 			}
-			inet->sndmsg_off += copy;
+			sk->sk_sndmsg_off += copy;
 			frag->size += copy;
 			skb->len += copy;
 			skb->data_len += copy;
@@ -978,7 +963,7 @@ alloc_new_skb:
 
 error:
 	inet->cork.length -= length;
-	IP_INC_STATS(OutDiscards);
+	IP_INC_STATS(IPSTATS_MIB_OUTDISCARDS);
 	return err; 
 }
 
@@ -1091,7 +1076,7 @@ ssize_t	ip_append_page(struct sock *sk, struct page *page,
 
 error:
 	inet->cork.length -= size;
-	IP_INC_STATS(OutDiscards);
+	IP_INC_STATS(IPSTATS_MIB_OUTDISCARDS);
 	return err;
 }
 
@@ -1124,12 +1109,10 @@ int ip_push_pending_frames(struct sock *sk)
 		tail_skb = &(tmp_skb->next);
 		skb->len += tmp_skb->len;
 		skb->data_len += tmp_skb->len;
-#if 0 /* Logically correct, but useless work, ip_fragment() will have to undo */
 		skb->truesize += tmp_skb->truesize;
 		__sock_put(tmp_skb->sk);
 		tmp_skb->destructor = NULL;
 		tmp_skb->sk = NULL;
-#endif
 	}
 
 	/* Unless user demanded real pmtu discovery (IP_PMTUDISC_DO), we allow
@@ -1201,7 +1184,7 @@ out:
 	return err;
 
 error:
-	IP_INC_STATS(OutDiscards);
+	IP_INC_STATS(IPSTATS_MIB_OUTDISCARDS);
 	goto out;
 }
 
diff --git a/net/ipv4/ip_sockglue.c b/net/ipv4/ip_sockglue.c
index 39e435a45..8bb874be1 100644
--- a/net/ipv4/ip_sockglue.c
+++ b/net/ipv4/ip_sockglue.c
@@ -759,6 +759,7 @@ int ip_setsockopt(struct sock *sk, int level, int optname, char __user *optval,
 				err = ip_mc_join_group(sk, &mreq);
 				if (err)
 					break;
+				greqs.gsr_interface = mreq.imr_ifindex;
 				omode = MCAST_INCLUDE;
 				add = 1;
 			} else /* MCAST_LEAVE_SOURCE_GROUP */ {
@@ -774,8 +775,8 @@ int ip_setsockopt(struct sock *sk, int level, int optname, char __user *optval,
 			extern int sysctl_optmem_max;
 			extern int sysctl_igmp_max_msf;
 			struct sockaddr_in *psin;
-			struct ip_msfilter *msf = 0;
-			struct group_filter *gsf = 0;
+			struct ip_msfilter *msf = NULL;
+			struct group_filter *gsf = NULL;
 			int msize, i, ifindex;
 
 			if (optlen < GROUP_FILTER_SIZE(0))
@@ -828,7 +829,7 @@ int ip_setsockopt(struct sock *sk, int level, int optname, char __user *optval,
 				msf->imsf_slist[i] = psin->sin_addr.s_addr;
 			}
 			kfree(gsf);
-			gsf = 0;
+			gsf = NULL;
 
 			err = ip_mc_msfilter(sk, msf, ifindex);
 mc_msf_out:
diff --git a/net/ipv4/ipcomp.c b/net/ipv4/ipcomp.c
index e20c7e43b..7ce7469a3 100644
--- a/net/ipv4/ipcomp.c
+++ b/net/ipv4/ipcomp.c
@@ -18,7 +18,6 @@
 #include <asm/scatterlist.h>
 #include <linux/crypto.h>
 #include <linux/pfkeyv2.h>
-#include <net/inet_ecn.h>
 #include <net/ip.h>
 #include <net/xfrm.h>
 #include <net/icmp.h>
@@ -114,78 +113,34 @@ static int ipcomp_compress(struct xfrm_state *x, struct sk_buff *skb)
 		goto out;
 	}
 	
-	memcpy(start, scratch, dlen);
-	pskb_trim(skb, ihlen + dlen);
+	memcpy(start + sizeof(struct ip_comp_hdr), scratch, dlen);
+	pskb_trim(skb, ihlen + dlen + sizeof(struct ip_comp_hdr));
 	
 out:	
 	return err;
 }
 
-static void ipcomp_tunnel_encap(struct xfrm_state *x, struct sk_buff *skb)
-{
-	struct dst_entry *dst = skb->dst;
-	struct iphdr *iph, *top_iph;
-
-	iph = skb->nh.iph;
-	top_iph = (struct iphdr *)skb_push(skb, sizeof(struct iphdr));
-	top_iph->ihl = 5;
-	top_iph->version = 4;
-	top_iph->tos = iph->tos;
-	top_iph->tot_len = htons(skb->len);
-	if (!(iph->frag_off&htons(IP_DF)))
-		__ip_select_ident(top_iph, dst, 0);
-	top_iph->ttl = iph->ttl;
-	top_iph->check = 0;
-	top_iph->saddr = x->props.saddr.a4;
-	top_iph->daddr = x->id.daddr.a4;
-	top_iph->frag_off = iph->frag_off&~htons(IP_MF|IP_OFFSET);
-	memset(&(IPCB(skb)->opt), 0, sizeof(struct ip_options));
-	skb->nh.raw = skb->data;
-}
-
 static int ipcomp_output(struct sk_buff **pskb)
 {
 	int err;
 	struct dst_entry *dst = (*pskb)->dst;
 	struct xfrm_state *x = dst->xfrm;
-	struct iphdr *iph, *top_iph;
+	struct iphdr *iph;
 	struct ip_comp_hdr *ipch;
 	struct ipcomp_data *ipcd = x->data;
-	union {
-		struct iphdr	iph;
-		char 		buf[60];
-	} tmp_iph;
 	int hdr_len = 0;
 
-	if ((*pskb)->ip_summed == CHECKSUM_HW) {
-		err = skb_checksum_help(pskb, 0);
-		if (err)
-			goto error_nolock;
-	}
-
-	spin_lock_bh(&x->lock);
-	err = xfrm_check_output(x, *pskb, AF_INET);
-	if (err)
-		goto error;
-
-	/* Don't bother compressing */
-	if (!x->props.mode) {
-		iph = (*pskb)->nh.iph;
-		hdr_len = iph->ihl * 4;
-	}
+	iph = (*pskb)->nh.iph;
+	iph->tot_len = htons((*pskb)->len);
+	hdr_len = iph->ihl * 4;
 	if (((*pskb)->len - hdr_len) < ipcd->threshold) {
+		/* Don't bother compressing */
 		if (x->props.mode) {
-			ipcomp_tunnel_encap(x, *pskb);
-			iph = (*pskb)->nh.iph;
-			iph->protocol = IPPROTO_IPIP;
 			ip_send_check(iph);
 		}
 		goto out_ok;
 	}
 
-	if (x->props.mode) 
-		ipcomp_tunnel_encap(x, *pskb);
-
 	if ((skb_is_nonlinear(*pskb) || skb_cloned(*pskb)) &&
 	    skb_linearize(*pskb, GFP_ATOMIC) != 0) {
 	    	err = -ENOMEM;
@@ -197,7 +152,6 @@ static int ipcomp_output(struct sk_buff **pskb)
 		if (err == -EMSGSIZE) {
 			if (x->props.mode) {
 				iph = (*pskb)->nh.iph;
-				iph->protocol = IPPROTO_IPIP;
 				ip_send_check(iph);
 			}
 			goto out_ok;
@@ -207,40 +161,19 @@ static int ipcomp_output(struct sk_buff **pskb)
 
 	/* Install ipcomp header, convert into ipcomp datagram. */
 	iph = (*pskb)->nh.iph;
-	memcpy(&tmp_iph, iph, iph->ihl * 4);
-	top_iph = (struct iphdr *)skb_push(*pskb, sizeof(struct ip_comp_hdr));
-	memcpy(top_iph, &tmp_iph, iph->ihl * 4);
-	iph = top_iph;
-	if (x->props.mode && (x->props.flags & XFRM_STATE_NOECN))
-		IP_ECN_clear(iph);
 	iph->tot_len = htons((*pskb)->len);
-	iph->protocol = IPPROTO_COMP;
-	iph->check = 0;
 	ipch = (struct ip_comp_hdr *)((char *)iph + iph->ihl * 4);
-	ipch->nexthdr = x->props.mode ? IPPROTO_IPIP : tmp_iph.iph.protocol;
+	ipch->nexthdr = iph->protocol;
 	ipch->flags = 0;
 	ipch->cpi = htons((u16 )ntohl(x->id.spi));
+	iph->protocol = IPPROTO_COMP;
 	ip_send_check(iph);
-	(*pskb)->nh.raw = (*pskb)->data;
 
 out_ok:
-	x->curlft.bytes += (*pskb)->len;
-	x->curlft.packets++;
-	spin_unlock_bh(&x->lock);
-	
-	if (((*pskb)->dst = dst_pop(dst)) == NULL) {
-		err = -EHOSTUNREACH;
-		goto error_nolock;
-	}
-	err = NET_XMIT_BYPASS;
+	err = 0;
 
-out_exit:
-	return err;
 error:
-	spin_unlock_bh(&x->lock);
-error_nolock:
-	kfree_skb(*pskb);
-	goto out_exit;
+	return err;
 }
 
 static void ipcomp4_err(struct sk_buff *skb, u32 info)
@@ -361,7 +294,7 @@ static int ipcomp_init_state(struct xfrm_state *x, void *args)
 		goto error;
 
 	memset(ipcd, 0, sizeof(*ipcd));
-	x->props.header_len = sizeof(struct ip_comp_hdr);
+	x->props.header_len = 0;
 	if (x->props.mode)
 		x->props.header_len += sizeof(struct iphdr);
 
@@ -405,7 +338,7 @@ static struct xfrm_type ipcomp_type = {
 	.output		= ipcomp_output
 };
 
-static struct inet_protocol ipcomp4_protocol = {
+static struct net_protocol ipcomp4_protocol = {
 	.handler	=	xfrm4_rcv,
 	.err_handler	=	ipcomp4_err,
 	.no_policy	=	1,
diff --git a/net/ipv4/ipconfig.c b/net/ipv4/ipconfig.c
index a5322adb2..92db76fe7 100644
--- a/net/ipv4/ipconfig.c
+++ b/net/ipv4/ipconfig.c
@@ -183,7 +183,14 @@ static int __init ic_open_devs(void)
 
 	last = &ic_first_dev;
 	rtnl_shlock();
+
+	/* bring loopback device up first */
+	if (dev_change_flags(&loopback_dev, loopback_dev.flags | IFF_UP) < 0)
+		printk(KERN_ERR "IP-Config: Failed to open %s\n", loopback_dev.name);
+
 	for (dev = dev_base; dev; dev = dev->next) {
+		if (dev == &loopback_dev)
+			continue;
 		if (user_dev_name[0] ? !strcmp(dev->name, user_dev_name) :
 		    (!(dev->flags & IFF_LOOPBACK) &&
 		     (dev->flags & (IFF_POINTOPOINT|IFF_BROADCAST)) &&
@@ -272,7 +279,7 @@ static int __init ic_dev_ioctl(unsigned int cmd, struct ifreq *arg)
 
 	mm_segment_t oldfs = get_fs();
 	set_fs(get_ds());
-	res = devinet_ioctl(cmd, arg);
+	res = devinet_ioctl(cmd, (struct ifreq __user *) arg);
 	set_fs(oldfs);
 	return res;
 }
@@ -283,7 +290,7 @@ static int __init ic_route_ioctl(unsigned int cmd, struct rtentry *arg)
 
 	mm_segment_t oldfs = get_fs();
 	set_fs(get_ds());
-	res = ip_rt_ioctl(cmd, arg);
+	res = ip_rt_ioctl(cmd, (void __user *) arg);
 	set_fs(oldfs);
 	return res;
 }
@@ -818,7 +825,7 @@ static int __init ic_bootp_recv(struct sk_buff *skb, struct net_device *dev, str
 	struct bootp_pkt *b;
 	struct iphdr *h;
 	struct ic_device *d;
-	int len;
+	int len, ext_len;
 
 	/* Perform verifications before taking the lock.  */
 	if (skb->pkt_type == PACKET_OTHERHOST)
@@ -859,7 +866,11 @@ static int __init ic_bootp_recv(struct sk_buff *skb, struct net_device *dev, str
 		goto drop;
 
 	len = ntohs(b->udph.len) - sizeof(struct udphdr);
-	if (len < 300)
+	ext_len = len - (sizeof(*b) -
+			 sizeof(struct iphdr) -
+			 sizeof(struct udphdr) -
+			 sizeof(b->exten));
+	if (ext_len < 0)
 		goto drop;
 
 	/* Ok the front looks good, make sure we can get at the rest.  */
@@ -894,7 +905,8 @@ static int __init ic_bootp_recv(struct sk_buff *skb, struct net_device *dev, str
 	}
 
 	/* Parse extensions */
-	if (!memcmp(b->exten, ic_bootp_cookie, 4)) { /* Check magic cookie */
+	if (ext_len >= 4 &&
+	    !memcmp(b->exten, ic_bootp_cookie, 4)) { /* Check magic cookie */
                 u8 *end = (u8 *) b + ntohs(b->iph.tot_len);
 		u8 *ext;
 
diff --git a/net/ipv4/ipip.c b/net/ipv4/ipip.c
index 757b1d3f6..98ba22404 100644
--- a/net/ipv4/ipip.c
+++ b/net/ipv4/ipip.c
@@ -497,13 +497,7 @@ static int ipip_rcv(struct sk_buff *skb)
 		skb->dev = tunnel->dev;
 		dst_release(skb->dst);
 		skb->dst = NULL;
-#ifdef CONFIG_NETFILTER
-		nf_conntrack_put(skb->nfct);
-		skb->nfct = NULL;
-#ifdef CONFIG_NETFILTER_DEBUG
-		skb->nf_debug = 0;
-#endif
-#endif
+		nf_reset(skb);
 		ipip_ecn_decapsulate(iph, skb);
 		netif_rx(skb);
 		read_unlock(&ipip_lock);
@@ -648,13 +642,7 @@ static int ipip_tunnel_xmit(struct sk_buff *skb, struct net_device *dev)
 	if ((iph->ttl = tiph->ttl) == 0)
 		iph->ttl	=	old_iph->ttl;
 
-#ifdef CONFIG_NETFILTER
-	nf_conntrack_put(skb->nfct);
-	skb->nfct = NULL;
-#ifdef CONFIG_NETFILTER_DEBUG
-	skb->nf_debug = 0;
-#endif
-#endif
+	nf_reset(skb);
 
 	IPTUNNEL_XMIT();
 	tunnel->recursion--;
diff --git a/net/ipv4/ipmr.c b/net/ipv4/ipmr.c
index a25e56077..9079766be 100644
--- a/net/ipv4/ipmr.c
+++ b/net/ipv4/ipmr.c
@@ -109,7 +109,9 @@ static int ip_mr_forward(struct sk_buff *skb, struct mfc_cache *cache, int local
 static int ipmr_cache_report(struct sk_buff *pkt, vifi_t vifi, int assert);
 static int ipmr_fill_mroute(struct sk_buff *skb, struct mfc_cache *c, struct rtmsg *rtm);
 
-static struct inet_protocol pim_protocol;
+#ifdef CONFIG_IP_PIMSM_V2
+static struct net_protocol pim_protocol;
+#endif
 
 static struct timer_list ipmr_expire_timer;
 
@@ -1105,17 +1107,14 @@ static void ip_encap(struct sk_buff *skb, u32 saddr, u32 daddr)
 	skb->h.ipiph = skb->nh.iph;
 	skb->nh.iph = iph;
 	memset(&(IPCB(skb)->opt), 0, sizeof(IPCB(skb)->opt));
-#ifdef CONFIG_NETFILTER
-	nf_conntrack_put(skb->nfct);
-	skb->nfct = NULL;
-#endif
+	nf_reset(skb);
 }
 
 static inline int ipmr_forward_finish(struct sk_buff *skb)
 {
 	struct ip_options * opt	= &(IPCB(skb)->opt);
 
-	IP_INC_STATS_BH(OutForwDatagrams);
+	IP_INC_STATS_BH(IPSTATS_MIB_OUTFORWDATAGRAMS);
 
 	if (unlikely(opt->optlen))
 		ip_forward_options(skb);
@@ -1178,7 +1177,7 @@ static void ipmr_queue_xmit(struct sk_buff *skb, struct mfc_cache *c, int vifi)
 		   to blackhole.
 		 */
 
-		IP_INC_STATS_BH(FragFails);
+		IP_INC_STATS_BH(IPSTATS_MIB_FRAGFAILS);
 		ip_rt_put(rt);
 		goto out_free;
 	}
@@ -1461,10 +1460,7 @@ int pim_rcv_v1(struct sk_buff * skb)
 	skb->dst = NULL;
 	((struct net_device_stats*)reg_dev->priv)->rx_bytes += skb->len;
 	((struct net_device_stats*)reg_dev->priv)->rx_packets++;
-#ifdef CONFIG_NETFILTER
-	nf_conntrack_put(skb->nfct);
-	skb->nfct = NULL;
-#endif
+	nf_reset(skb);
 	netif_rx(skb);
 	dev_put(reg_dev);
 	return 0;
@@ -1520,10 +1516,7 @@ static int pim_rcv(struct sk_buff * skb)
 	((struct net_device_stats*)reg_dev->priv)->rx_bytes += skb->len;
 	((struct net_device_stats*)reg_dev->priv)->rx_packets++;
 	skb->dst = NULL;
-#ifdef CONFIG_NETFILTER
-	nf_conntrack_put(skb->nfct);
-	skb->nfct = NULL;
-#endif
+	nf_reset(skb);
 	netif_rx(skb);
 	dev_put(reg_dev);
 	return 0;
@@ -1711,7 +1704,7 @@ static struct file_operations ipmr_vif_fops = {
 	.open    = ipmr_vif_open,
 	.read    = seq_read,
 	.llseek  = seq_lseek,
-	.release = seq_release,
+	.release = seq_release_private,
 };
 
 struct ipmr_mfc_iter {
@@ -1746,6 +1739,9 @@ static struct mfc_cache *ipmr_mfc_seq_idx(struct ipmr_mfc_iter *it, loff_t pos)
 
 static void *ipmr_mfc_seq_start(struct seq_file *seq, loff_t *pos)
 {
+	struct ipmr_mfc_iter *it = seq->private;
+	it->cache = NULL;
+	it->ct = 0;
 	return *pos ? ipmr_mfc_seq_idx(seq->private, *pos - 1) 
 		: SEQ_START_TOKEN;
 }
@@ -1855,7 +1851,6 @@ static int ipmr_mfc_open(struct inode *inode, struct file *file)
 	if (rc)
 		goto out_kfree;
 
-	memset(s, 0, sizeof(*s));
 	seq = file->private_data;
 	seq->private = s;
 out:
@@ -1871,12 +1866,12 @@ static struct file_operations ipmr_mfc_fops = {
 	.open    = ipmr_mfc_open,
 	.read    = seq_read,
 	.llseek  = seq_lseek,
-	.release = seq_release,
+	.release = seq_release_private,
 };
 #endif	
 
 #ifdef CONFIG_IP_PIMSM_V2
-static struct inet_protocol pim_protocol = {
+static struct net_protocol pim_protocol = {
 	.handler	=	pim_rcv,
 };
 #endif
diff --git a/net/ipv4/ipvs/ip_vs_ctl.c b/net/ipv4/ipvs/ip_vs_ctl.c
index 5df55ca9e..d90a79356 100644
--- a/net/ipv4/ipvs/ip_vs_ctl.c
+++ b/net/ipv4/ipvs/ip_vs_ctl.c
@@ -1347,13 +1347,13 @@ static int ip_vs_zero_all(void)
 
 static int
 proc_do_defense_mode(ctl_table *table, int write, struct file * filp,
-		     void __user *buffer, size_t *lenp)
+		     void __user *buffer, size_t *lenp, loff_t *ppos)
 {
 	int *valp = table->data;
 	int val = *valp;
 	int rc;
 
-	rc = proc_dointvec(table, write, filp, buffer, lenp);
+	rc = proc_dointvec(table, write, filp, buffer, lenp, ppos);
 	if (write && (*valp != val)) {
 		if ((*valp < 0) || (*valp > 3)) {
 			/* Restore the correct value */
@@ -1370,7 +1370,7 @@ proc_do_defense_mode(ctl_table *table, int write, struct file * filp,
 
 static int
 proc_do_sync_threshold(ctl_table *table, int write, struct file *filp,
-		       void __user *buffer, size_t *lenp)
+		       void __user *buffer, size_t *lenp, loff_t *ppos)
 {
 	int *valp = table->data;
 	int val[2];
@@ -1379,7 +1379,7 @@ proc_do_sync_threshold(ctl_table *table, int write, struct file *filp,
 	/* backup the value first */
 	memcpy(val, valp, sizeof(val));
 
-	rc = proc_dointvec(table, write, filp, buffer, lenp);
+	rc = proc_dointvec(table, write, filp, buffer, lenp, ppos);
 	if (write && (valp[0] < 0 || valp[1] < 0 || valp[0] >= valp[1])) {
 		/* Restore the correct value */
 		memcpy(valp, val, sizeof(val));
diff --git a/net/ipv4/ipvs/ip_vs_ftp.c b/net/ipv4/ipvs/ip_vs_ftp.c
index 124105878..0165cc6e3 100644
--- a/net/ipv4/ipvs/ip_vs_ftp.c
+++ b/net/ipv4/ipvs/ip_vs_ftp.c
@@ -25,6 +25,7 @@
  */
 
 #include <linux/module.h>
+#include <linux/moduleparam.h>
 #include <linux/kernel.h>
 #include <linux/skbuff.h>
 #include <linux/in.h>
@@ -44,16 +45,17 @@
  * First port is set to the default port.
  */
 static int ports[IP_VS_APP_MAX_PORTS] = {21, 0};
+static int ports_c;
+module_param_array(ports, int, ports_c, 0);
 
 /*
  *	Debug level
  */
 #ifdef CONFIG_IP_VS_DEBUG
 static int debug=0;
-MODULE_PARM(debug, "i");
+module_param(debug, int, 0);
 #endif
 
-MODULE_PARM(ports, "1-" __MODULE_STRING(IP_VS_APP_MAX_PORTS) "i");
 
 /*	Dummy variable */
 static int ip_vs_ftp_pasv;
@@ -279,7 +281,7 @@ static int ip_vs_ftp_in(struct ip_vs_app *app, struct ip_vs_conn *cp,
 	while (data <= data_limit - 6) {
 		if (strnicmp(data, "PASV\r\n", 6) == 0) {
 			/* Passive mode on */
-			IP_VS_DBG(1-debug, "got PASV at %d of %d\n",
+			IP_VS_DBG(1-debug, "got PASV at %zd of %zd\n",
 				  data - data_start,
 				  data_limit - data_start);
 			cp->app_data = &ip_vs_ftp_pasv;
diff --git a/net/ipv4/ipvs/ip_vs_proto_tcp.c b/net/ipv4/ipvs/ip_vs_proto_tcp.c
index 46c346e80..2f00e9142 100644
--- a/net/ipv4/ipvs/ip_vs_proto_tcp.c
+++ b/net/ipv4/ipvs/ip_vs_proto_tcp.c
@@ -158,7 +158,7 @@ tcp_snat_handler(struct sk_buff **pskb,
 						(*pskb)->len - tcphoff,
 						cp->protocol,
 						(*pskb)->csum);
-		IP_VS_DBG(11, "O-pkt: %s O-csum=%d (+%d)\n",
+		IP_VS_DBG(11, "O-pkt: %s O-csum=%d (+%zd)\n",
 			  pp->name, tcph->check,
 			  (char*)&(tcph->check) - (char*)tcph);
 	}
diff --git a/net/ipv4/ipvs/ip_vs_proto_udp.c b/net/ipv4/ipvs/ip_vs_proto_udp.c
index 740d8d92c..81501c938 100644
--- a/net/ipv4/ipvs/ip_vs_proto_udp.c
+++ b/net/ipv4/ipvs/ip_vs_proto_udp.c
@@ -166,7 +166,7 @@ udp_snat_handler(struct sk_buff **pskb,
 						(*pskb)->csum);
 		if (udph->check == 0)
 			udph->check = 0xFFFF;
-		IP_VS_DBG(11, "O-pkt: %s O-csum=%d (+%d)\n",
+		IP_VS_DBG(11, "O-pkt: %s O-csum=%d (+%zd)\n",
 			  pp->name, udph->check,
 			  (char*)&(udph->check) - (char*)udph);
 	}
diff --git a/net/ipv4/ipvs/ip_vs_sync.c b/net/ipv4/ipvs/ip_vs_sync.c
index 7b727a92b..80fdab71e 100644
--- a/net/ipv4/ipvs/ip_vs_sync.c
+++ b/net/ipv4/ipvs/ip_vs_sync.c
@@ -555,25 +555,15 @@ static struct socket * make_receive_sock(void)
 static int
 ip_vs_send_async(struct socket *sock, const char *buffer, const size_t length)
 {
-	struct msghdr	msg;
-	mm_segment_t	oldfs;
-	struct iovec	iov;
+	struct msghdr	msg = {.msg_flags = MSG_DONTWAIT|MSG_NOSIGNAL};
+	struct kvec	iov;
 	int		len;
 
 	EnterFunction(7);
 	iov.iov_base     = (void *)buffer;
 	iov.iov_len      = length;
-	msg.msg_name     = 0;
-	msg.msg_namelen  = 0;
-	msg.msg_iov	 = &iov;
-	msg.msg_iovlen   = 1;
-	msg.msg_control  = NULL;
-	msg.msg_controllen = 0;
-	msg.msg_flags    = MSG_DONTWAIT|MSG_NOSIGNAL;
-
-	oldfs = get_fs(); set_fs(KERNEL_DS);
-	len = sock_sendmsg(sock, &msg, (size_t)(length));
-	set_fs(oldfs);
+
+	len = kernel_sendmsg(sock, &msg, &iov, 1, (size_t)(length));
 
 	LeaveFunction(7);
 	return len;
@@ -583,27 +573,17 @@ ip_vs_send_async(struct socket *sock, const char *buffer, const size_t length)
 static int
 ip_vs_receive(struct socket *sock, char *buffer, const size_t buflen)
 {
-	struct msghdr		msg;
-	struct iovec		iov;
+	struct msghdr		msg = {NULL,};
+	struct kvec		iov;
 	int			len;
-	mm_segment_t		oldfs;
 
 	EnterFunction(7);
 
 	/* Receive a packet */
 	iov.iov_base     = buffer;
 	iov.iov_len      = (size_t)buflen;
-	msg.msg_name     = 0;
-	msg.msg_namelen  = 0;
-	msg.msg_iov	 = &iov;
-	msg.msg_iovlen   = 1;
-	msg.msg_control  = NULL;
-	msg.msg_controllen = 0;
-	msg.msg_flags    = 0;
-
-	oldfs = get_fs(); set_fs(KERNEL_DS);
-	len = sock_recvmsg(sock, &msg, buflen, 0);
-	set_fs(oldfs);
+
+	len = kernel_recvmsg(sock, &msg, &iov, 1, buflen, 0);
 
 	if (len < 0)
 		return -1;
diff --git a/net/ipv4/ipvs/ip_vs_xmit.c b/net/ipv4/ipvs/ip_vs_xmit.c
index 4d83f0013..204767be4 100644
--- a/net/ipv4/ipvs/ip_vs_xmit.c
+++ b/net/ipv4/ipvs/ip_vs_xmit.c
@@ -51,7 +51,7 @@ __ip_vs_dst_check(struct ip_vs_dest *dest, u32 rtos, u32 cookie)
 		return NULL;
 	if ((dst->obsolete || rtos != dest->dst_rtos) &&
 	    dst->ops->check(dst, cookie) == NULL) {
-		dest->dst_cache = 0;
+		dest->dst_cache = NULL;
 		return NULL;
 	}
 	dst_hold(dst);
diff --git a/net/ipv4/netfilter/Kconfig b/net/ipv4/netfilter/Kconfig
index f5a5110f9..b58141ead 100644
--- a/net/ipv4/netfilter/Kconfig
+++ b/net/ipv4/netfilter/Kconfig
@@ -582,6 +582,7 @@ config IP_NF_COMPAT_IPFWADM
 config IP_NF_TARGET_NOTRACK
 	tristate  'NOTRACK target support'
 	depends on IP_NF_RAW
+	depends on IP_NF_CONNTRACK
 	help
 	  The NOTRACK target allows a select rule to specify
 	  which packets *not* to enter the conntrack/NAT
@@ -603,5 +604,29 @@ config IP_NF_RAW
 	  <file:Documentation/modules.txt>.  If unsure, say `N'.
 	  help
 
+config IP_NF_MATCH_ADDRTYPE
+	tristate  'address type match support'
+	depends on IP_NF_IPTABLES
+	help
+	  This option allows you to match what routing thinks of an address,
+	  eg. UNICAST, LOCAL, BROADCAST, ...
+	
+	  If you want to compile it as a module, say M here and read
+	  Documentation/modules.txt.  If unsure, say `N'.
+
+config IP_NF_MATCH_REALM
+	tristate  'realm match support'
+	depends on IP_NF_IPTABLES
+	select NET_CLS_ROUTE
+	help
+	  This option adds a `realm' match, which allows you to use the realm
+	  key from the routing subsytem inside iptables.
+	
+	  This match pretty much resembles the CONFIG_NET_CLS_ROUTE4 option 
+	  in tc world.
+	
+	  If you want to compile it as a module, say M here and read
+	  Documentation/modules.txt.  If unsure, say `N'.
+
 endmenu
 
diff --git a/net/ipv4/netfilter/Makefile b/net/ipv4/netfilter/Makefile
index 52bedf2d7..bdb23fde1 100644
--- a/net/ipv4/netfilter/Makefile
+++ b/net/ipv4/netfilter/Makefile
@@ -64,6 +64,8 @@ obj-$(CONFIG_IP_NF_MATCH_TTL) += ipt_ttl.o
 obj-$(CONFIG_IP_NF_MATCH_STATE) += ipt_state.o
 obj-$(CONFIG_IP_NF_MATCH_CONNTRACK) += ipt_conntrack.o
 obj-$(CONFIG_IP_NF_MATCH_TCPMSS) += ipt_tcpmss.o
+obj-$(CONFIG_IP_NF_MATCH_REALM) += ipt_realm.o
+obj-$(CONFIG_IP_NF_MATCH_ADDRTYPE) += ipt_addrtype.o
 
 obj-$(CONFIG_IP_NF_MATCH_PHYSDEV) += ipt_physdev.o
 
diff --git a/net/ipv4/netfilter/ip_conntrack_amanda.c b/net/ipv4/netfilter/ip_conntrack_amanda.c
index ae1bc2509..4e8f4d83b 100644
--- a/net/ipv4/netfilter/ip_conntrack_amanda.c
+++ b/net/ipv4/netfilter/ip_conntrack_amanda.c
@@ -107,7 +107,7 @@ static int help(struct sk_buff *skb,
 		exp->mask.dst.u.tcp.port = 0xFFFF;
 
 		exp_amanda_info = &exp->help.exp_amanda_info;
-		exp_amanda_info->offset = data - amanda_buffer;
+		exp_amanda_info->offset = tmp - amanda_buffer;
 		exp_amanda_info->port   = port;
 		exp_amanda_info->len    = len;
 
diff --git a/net/ipv4/netfilter/ip_conntrack_core.c b/net/ipv4/netfilter/ip_conntrack_core.c
index 67c2fd2a5..00a89f4f8 100644
--- a/net/ipv4/netfilter/ip_conntrack_core.c
+++ b/net/ipv4/netfilter/ip_conntrack_core.c
@@ -28,6 +28,7 @@
 #include <linux/proc_fs.h>
 #include <linux/vmalloc.h>
 #include <net/checksum.h>
+#include <net/ip.h>
 #include <linux/stddef.h>
 #include <linux/sysctl.h>
 #include <linux/slab.h>
@@ -173,13 +174,12 @@ static void
 destroy_expect(struct ip_conntrack_expect *exp)
 {
 	DEBUGP("destroy_expect(%p) use=%d\n", exp, atomic_read(&exp->use));
-	IP_NF_ASSERT(atomic_read(&exp->use));
+	IP_NF_ASSERT(atomic_read(&exp->use) == 0);
 	IP_NF_ASSERT(!timer_pending(&exp->timeout));
 
 	kfree(exp);
 }
 
-
 inline void ip_conntrack_expect_put(struct ip_conntrack_expect *exp)
 {
 	IP_NF_ASSERT(exp);
@@ -715,7 +715,6 @@ init_conntrack(const struct ip_conntrack_tuple *tuple,
 		DEBUGP("conntrack: expectation arrives ct=%p exp=%p\n",
 			conntrack, expected);
 		/* Welcome, Mr. Bond.  We've been expecting you... */
-		IP_NF_ASSERT(master_ct(conntrack));
 		__set_bit(IPS_EXPECTED_BIT, &conntrack->status);
 		conntrack->master = expected;
 		expected->sibling = conntrack;
@@ -948,9 +947,8 @@ ip_conntrack_expect_insert(struct ip_conntrack_expect *new,
 	atomic_set(&new->use, 1);
 
 	/* add to expected list for this connection */
-	list_add(&new->expected_list, &related_to->sibling_list);
+	list_add_tail(&new->expected_list, &related_to->sibling_list);
 	/* add to global list of expectations */
-
 	list_prepend(&ip_conntrack_expect_list, &new->list);
 	/* add and start timer if required */
 	if (related_to->helper->timeout) {
@@ -1004,7 +1002,6 @@ int ip_conntrack_expect_related(struct ip_conntrack_expect *expect,
 
 	} else if (related_to->helper->max_expected && 
 		   related_to->expecting >= related_to->helper->max_expected) {
-		struct list_head *cur_item;
 		/* old == NULL */
 		if (!(related_to->helper->flags & 
 		      IP_CT_HELPER_F_REUSE_EXPECT)) {
@@ -1030,21 +1027,14 @@ int ip_conntrack_expect_related(struct ip_conntrack_expect *expect,
 		       NIPQUAD(related_to->tuplehash[IP_CT_DIR_ORIGINAL].tuple.dst.ip));
  
 		/* choose the the oldest expectation to evict */
-		list_for_each(cur_item, &related_to->sibling_list) { 
-			struct ip_conntrack_expect *cur;
-
-			cur = list_entry(cur_item, 
-					 struct ip_conntrack_expect,
-					 expected_list);
-			if (cur->sibling == NULL) {
-				old = cur;
+		list_for_each_entry(old, &related_to->sibling_list, 
+		                                      expected_list)
+			if (old->sibling == NULL)
 				break;
-			}
-		}
 
-		/* (!old) cannot happen, since related_to->expecting is the
-		 * number of unconfirmed expects */
-		IP_NF_ASSERT(old);
+		/* We cannot fail since related_to->expecting is the number
+		 * of unconfirmed expectations */
+		IP_NF_ASSERT(old && old->sibling == NULL);
 
 		/* newnat14 does not reuse the real allocated memory
 		 * structures but rather unexpects the old and
diff --git a/net/ipv4/netfilter/ip_conntrack_ftp.c b/net/ipv4/netfilter/ip_conntrack_ftp.c
index 14e54c960..b9c27d5e4 100644
--- a/net/ipv4/netfilter/ip_conntrack_ftp.c
+++ b/net/ipv4/netfilter/ip_conntrack_ftp.c
@@ -33,9 +33,7 @@ struct module *ip_conntrack_ftp = THIS_MODULE;
 #define MAX_PORTS 8
 static int ports[MAX_PORTS];
 static int ports_c;
-#ifdef MODULE_PARM
 MODULE_PARM(ports, "1-" __MODULE_STRING(MAX_PORTS) "i");
-#endif
 
 static int loose;
 MODULE_PARM(loose, "i");
diff --git a/net/ipv4/netfilter/ip_conntrack_irc.c b/net/ipv4/netfilter/ip_conntrack_irc.c
index 31ff05349..32b5daee8 100644
--- a/net/ipv4/netfilter/ip_conntrack_irc.c
+++ b/net/ipv4/netfilter/ip_conntrack_irc.c
@@ -44,14 +44,12 @@ static char irc_buffer[65536];
 MODULE_AUTHOR("Harald Welte <laforge@netfilter.org>");
 MODULE_DESCRIPTION("IRC (DCC) connection tracking helper");
 MODULE_LICENSE("GPL");
-#ifdef MODULE_PARM
 MODULE_PARM(ports, "1-" __MODULE_STRING(MAX_PORTS) "i");
 MODULE_PARM_DESC(ports, "port numbers of IRC servers");
 MODULE_PARM(max_dcc_channels, "i");
 MODULE_PARM_DESC(max_dcc_channels, "max number of expected DCC channels per IRC session");
 MODULE_PARM(dcc_timeout, "i");
 MODULE_PARM_DESC(dcc_timeout, "timeout on for unestablished DCC channels");
-#endif
 
 static char *dccprotos[] = { "SEND ", "CHAT ", "MOVE ", "TSEND ", "SCHAT " };
 #define MINMATCHLEN	5
diff --git a/net/ipv4/netfilter/ip_conntrack_proto_tcp.c b/net/ipv4/netfilter/ip_conntrack_proto_tcp.c
index 1cc796556..463cafa66 100644
--- a/net/ipv4/netfilter/ip_conntrack_proto_tcp.c
+++ b/net/ipv4/netfilter/ip_conntrack_proto_tcp.c
@@ -67,7 +67,7 @@ unsigned long ip_ct_tcp_timeout_time_wait =     2 MINS;
 unsigned long ip_ct_tcp_timeout_close =        10 SECS;
 
 static unsigned long * tcp_timeouts[]
-= { 0,                                 /*      TCP_CONNTRACK_NONE */
+= { NULL,                              /*      TCP_CONNTRACK_NONE */
     &ip_ct_tcp_timeout_established,    /*      TCP_CONNTRACK_ESTABLISHED,      */
     &ip_ct_tcp_timeout_syn_sent,       /*      TCP_CONNTRACK_SYN_SENT, */
     &ip_ct_tcp_timeout_syn_recv,       /*      TCP_CONNTRACK_SYN_RECV, */
@@ -76,7 +76,7 @@ static unsigned long * tcp_timeouts[]
     &ip_ct_tcp_timeout_close,          /*      TCP_CONNTRACK_CLOSE,    */
     &ip_ct_tcp_timeout_close_wait,     /*      TCP_CONNTRACK_CLOSE_WAIT,       */
     &ip_ct_tcp_timeout_last_ack,       /*      TCP_CONNTRACK_LAST_ACK, */
-    0,                                 /*      TCP_CONNTRACK_LISTEN */
+    NULL,                              /*      TCP_CONNTRACK_LISTEN */
  };
  
 #define sNO TCP_CONNTRACK_NONE
diff --git a/net/ipv4/netfilter/ip_conntrack_standalone.c b/net/ipv4/netfilter/ip_conntrack_standalone.c
index 4d378394a..80edac904 100644
--- a/net/ipv4/netfilter/ip_conntrack_standalone.c
+++ b/net/ipv4/netfilter/ip_conntrack_standalone.c
@@ -24,6 +24,7 @@
 #include <linux/sysctl.h>
 #endif
 #include <net/checksum.h>
+#include <net/ip.h>
 
 #define ASSERT_READ_LOCK(x) MUST_BE_READ_LOCKED(&ip_conntrack_lock)
 #define ASSERT_WRITE_LOCK(x) MUST_BE_WRITE_LOCKED(&ip_conntrack_lock)
@@ -502,7 +503,7 @@ static int init_or_cleanup(int init)
 	if (ret < 0)
 		goto cleanup_nothing;
 
-	proc = proc_net_create("ip_conntrack",0,list_conntracks);
+	proc = proc_net_create("ip_conntrack", 0440, list_conntracks);
 	if (!proc) goto cleanup_init;
 	proc->owner = THIS_MODULE;
 
diff --git a/net/ipv4/netfilter/ip_conntrack_tftp.c b/net/ipv4/netfilter/ip_conntrack_tftp.c
index 951597484..ddee73782 100644
--- a/net/ipv4/netfilter/ip_conntrack_tftp.c
+++ b/net/ipv4/netfilter/ip_conntrack_tftp.c
@@ -27,10 +27,8 @@ MODULE_LICENSE("GPL");
 #define MAX_PORTS 8
 static int ports[MAX_PORTS];
 static int ports_c;
-#ifdef MODULE_PARM
 MODULE_PARM(ports, "1-" __MODULE_STRING(MAX_PORTS) "i");
 MODULE_PARM_DESC(ports, "port numbers of tftp servers");
-#endif
 
 #if 0
 #define DEBUGP(format, args...) printk("%s:%s:" format, \
diff --git a/net/ipv4/netfilter/ip_fw_compat_masq.c b/net/ipv4/netfilter/ip_fw_compat_masq.c
index a6bc8be21..fbd8b9bfe 100644
--- a/net/ipv4/netfilter/ip_fw_compat_masq.c
+++ b/net/ipv4/netfilter/ip_fw_compat_masq.c
@@ -24,6 +24,7 @@
 #include <linux/proc_fs.h>
 #include <linux/module.h>
 #include <net/route.h>
+#include <net/ip.h>
 
 #define ASSERT_READ_LOCK(x) MUST_BE_READ_LOCKED(&ip_conntrack_lock)
 #define ASSERT_WRITE_LOCK(x) MUST_BE_WRITE_LOCKED(&ip_conntrack_lock)
diff --git a/net/ipv4/netfilter/ip_fw_compat_redir.c b/net/ipv4/netfilter/ip_fw_compat_redir.c
index 6a24a5cb1..7f68c1ed5 100644
--- a/net/ipv4/netfilter/ip_fw_compat_redir.c
+++ b/net/ipv4/netfilter/ip_fw_compat_redir.c
@@ -22,6 +22,7 @@
 #include <linux/udp.h>
 #include <linux/tcp.h>
 #include <net/checksum.h>
+#include <net/ip.h>
 #include <linux/timer.h>
 #include <linux/netdevice.h>
 #include <linux/if.h>
diff --git a/net/ipv4/netfilter/ip_nat_core.c b/net/ipv4/netfilter/ip_nat_core.c
index 3e5ca9754..1c6b78106 100644
--- a/net/ipv4/netfilter/ip_nat_core.c
+++ b/net/ipv4/netfilter/ip_nat_core.c
@@ -528,6 +528,7 @@ ip_nat_setup_info(struct ip_conntrack *conntrack,
 	MUST_BE_WRITE_LOCKED(&ip_nat_lock);
 	IP_NF_ASSERT(hooknum == NF_IP_PRE_ROUTING
 		     || hooknum == NF_IP_POST_ROUTING
+		     || hooknum == NF_IP_LOCAL_IN
 		     || hooknum == NF_IP_LOCAL_OUT);
 	IP_NF_ASSERT(info->num_manips < IP_NAT_MAX_MANIPS);
 	IP_NF_ASSERT(!(info->initialized & (1 << HOOK2MANIP(hooknum))));
@@ -816,7 +817,7 @@ do_bindings(struct ip_conntrack *ct,
 
 		/* Have to grab read lock before sibling_list traversal */
 		READ_LOCK(&ip_conntrack_lock);
-		list_for_each(cur_item, &ct->sibling_list) { 
+		list_for_each_prev(cur_item, &ct->sibling_list) { 
 			exp = list_entry(cur_item, struct ip_conntrack_expect, 
 					 expected_list);
 					 
@@ -899,10 +900,10 @@ icmp_reply_translation(struct sk_buff **pskb,
 
 	/* Must be RELATED */
 	IP_NF_ASSERT((*pskb)->nfct
-		     - (struct ip_conntrack *)(*pskb)->nfct->master
+		     - ((struct ip_conntrack *)(*pskb)->nfct->master)->infos
 		     == IP_CT_RELATED
 		     || (*pskb)->nfct
-		     - (struct ip_conntrack *)(*pskb)->nfct->master
+		     - ((struct ip_conntrack *)(*pskb)->nfct->master)->infos
 		     == IP_CT_RELATED+IP_CT_IS_REPLY);
 
 	/* Redirects on non-null nats must be dropped, else they'll
diff --git a/net/ipv4/netfilter/ip_nat_ftp.c b/net/ipv4/netfilter/ip_nat_ftp.c
index 68dc04fa5..946ca05bb 100644
--- a/net/ipv4/netfilter/ip_nat_ftp.c
+++ b/net/ipv4/netfilter/ip_nat_ftp.c
@@ -33,9 +33,7 @@ MODULE_DESCRIPTION("ftp NAT helper");
 static int ports[MAX_PORTS];
 static int ports_c;
 
-#ifdef MODULE_PARM
 MODULE_PARM(ports, "1-" __MODULE_STRING(MAX_PORTS) "i");
-#endif
 
 DECLARE_LOCK_EXTERN(ip_ftp_lock);
 
diff --git a/net/ipv4/netfilter/ip_nat_irc.c b/net/ipv4/netfilter/ip_nat_irc.c
index 52b2e5325..dc778dd4a 100644
--- a/net/ipv4/netfilter/ip_nat_irc.c
+++ b/net/ipv4/netfilter/ip_nat_irc.c
@@ -41,10 +41,8 @@ static int ports_c;
 MODULE_AUTHOR("Harald Welte <laforge@gnumonks.org>");
 MODULE_DESCRIPTION("IRC (DCC) NAT helper");
 MODULE_LICENSE("GPL");
-#ifdef MODULE_PARM
 MODULE_PARM(ports, "1-" __MODULE_STRING(MAX_PORTS) "i");
 MODULE_PARM_DESC(ports, "port numbers of IRC servers");
-#endif
 
 /* protects irc part of conntracks */
 DECLARE_LOCK_EXTERN(ip_irc_lock);
diff --git a/net/ipv4/netfilter/ip_nat_snmp_basic.c b/net/ipv4/netfilter/ip_nat_snmp_basic.c
index 00b4effb6..539ad18f8 100644
--- a/net/ipv4/netfilter/ip_nat_snmp_basic.c
+++ b/net/ipv4/netfilter/ip_nat_snmp_basic.c
@@ -252,7 +252,7 @@ static unsigned char asn1_header_decode(struct asn1_ctx *ctx,
 	if (def)
 		*eoc = ctx->pointer + len;
 	else
-		*eoc = 0;
+		*eoc = NULL;
 	return 1;
 }
 
@@ -862,6 +862,77 @@ static unsigned char snmp_request_decode(struct asn1_ctx *ctx,
 	return 1;
 }
 
+/* 
+ * Fast checksum update for possibly oddly-aligned UDP byte, from the
+ * code example in the draft.
+ */
+static void fast_csum(unsigned char *csum,
+                      const unsigned char *optr,
+                      const unsigned char *nptr,
+                      int odd)
+{
+	long x, old, new;
+	
+	x = csum[0] * 256 + csum[1];
+	
+	x =~ x & 0xFFFF;
+	
+	if (odd) old = optr[0] * 256;
+	else old = optr[0];
+	
+	x -= old & 0xFFFF;
+	if (x <= 0) {
+		x--;
+		x &= 0xFFFF;
+	}
+	
+	if (odd) new = nptr[0] * 256;
+	else new = nptr[0];
+	
+	x += new & 0xFFFF;
+	if (x & 0x10000) {
+		x++;
+		x &= 0xFFFF;
+	}
+	
+	x =~ x & 0xFFFF;
+	csum[0] = x / 256;
+	csum[1] = x & 0xFF;
+}
+
+/* 
+ * Mangle IP address.
+ * 	- begin points to the start of the snmp messgae
+ *      - addr points to the start of the address
+ */
+static inline void mangle_address(unsigned char *begin,
+                                  unsigned char *addr,
+                                  const struct oct1_map *map,
+                                  u_int16_t *check)
+{
+	if (map->from == NOCT1(*addr)) {
+		u_int32_t old;
+		
+		if (debug)
+			memcpy(&old, (unsigned char *)addr, sizeof(old));
+			
+		*addr = map->to;
+		
+		/* Update UDP checksum if being used */
+		if (*check) {
+			unsigned char odd = !((addr - begin) % 2);
+			
+			fast_csum((unsigned char *)check,
+			          &map->from, &map->to, odd);
+			          
+		}
+		
+		if (debug)
+			printk(KERN_DEBUG "bsalg: mapped %u.%u.%u.%u to "
+			       "%u.%u.%u.%u\n", NIPQUAD(old), NIPQUAD(*addr));
+	}
+}
+
 static unsigned char snmp_trap_decode(struct asn1_ctx *ctx,
                                       struct snmp_v1_trap *trap,
                                       const struct oct1_map *map,
@@ -952,77 +1023,6 @@ static void hex_dump(unsigned char *buf, size_t len)
 	printk("\n");
 }
 
-/* 
- * Fast checksum update for possibly oddly-aligned UDP byte, from the
- * code example in the draft.
- */
-static void fast_csum(unsigned char *csum,
-                      const unsigned char *optr,
-                      const unsigned char *nptr,
-                      int odd)
-{
-	long x, old, new;
-	
-	x = csum[0] * 256 + csum[1];
-	
-	x =~ x & 0xFFFF;
-	
-	if (odd) old = optr[0] * 256;
-	else old = optr[0];
-	
-	x -= old & 0xFFFF;
-	if (x <= 0) {
-		x--;
-		x &= 0xFFFF;
-	}
-	
-	if (odd) new = nptr[0] * 256;
-	else new = nptr[0];
-	
-	x += new & 0xFFFF;
-	if (x & 0x10000) {
-		x++;
-		x &= 0xFFFF;
-	}
-	
-	x =~ x & 0xFFFF;
-	csum[0] = x / 256;
-	csum[1] = x & 0xFF;
-}
-
-/* 
- * Mangle IP address.
- * 	- begin points to the start of the snmp messgae
- *      - addr points to the start of the address
- */
-static inline void mangle_address(unsigned char *begin,
-                                  unsigned char *addr,
-                                  const struct oct1_map *map,
-                                  u_int16_t *check)
-{
-	if (map->from == NOCT1(*addr)) {
-		u_int32_t old;
-		
-		if (debug)
-			memcpy(&old, (unsigned char *)addr, sizeof(old));
-			
-		*addr = map->to;
-		
-		/* Update UDP checksum if being used */
-		if (*check) {
-			unsigned char odd = !((addr - begin) % 2);
-			
-			fast_csum((unsigned char *)check,
-			          &map->from, &map->to, odd);
-			          
-		}
-		
-		if (debug)
-			printk(KERN_DEBUG "bsalg: mapped %u.%u.%u.%u to "
-			       "%u.%u.%u.%u\n", NIPQUAD(old), NIPQUAD(*addr));
-	}
-}
-
 /*
  * Parse and mangle SNMP message according to mapping.
  * (And this is the fucking 'basic' method).
diff --git a/net/ipv4/netfilter/ip_nat_standalone.c b/net/ipv4/netfilter/ip_nat_standalone.c
index a84453f89..9765fd2d5 100644
--- a/net/ipv4/netfilter/ip_nat_standalone.c
+++ b/net/ipv4/netfilter/ip_nat_standalone.c
@@ -27,6 +27,7 @@
 #include <linux/module.h>
 #include <linux/skbuff.h>
 #include <linux/proc_fs.h>
+#include <net/ip.h>
 #include <net/checksum.h>
 #include <linux/spinlock.h>
 
diff --git a/net/ipv4/netfilter/ip_nat_tftp.c b/net/ipv4/netfilter/ip_nat_tftp.c
index 4b557e20e..a2097bfbe 100644
--- a/net/ipv4/netfilter/ip_nat_tftp.c
+++ b/net/ipv4/netfilter/ip_nat_tftp.c
@@ -41,10 +41,8 @@ MODULE_LICENSE("GPL");
 
 static int ports[MAX_PORTS];
 static int ports_c = 0;
-#ifdef MODULE_PARM
 MODULE_PARM(ports,"1-" __MODULE_STRING(MAX_PORTS) "i");
 MODULE_PARM_DESC(ports, "port numbers of tftp servers");
-#endif
 
 #if 0
 #define DEBUGP(format, args...) printk("%s:%s:" format, \
diff --git a/net/ipv4/netfilter/ip_tables.c b/net/ipv4/netfilter/ip_tables.c
index 2d433b69d..f24f17b8e 100644
--- a/net/ipv4/netfilter/ip_tables.c
+++ b/net/ipv4/netfilter/ip_tables.c
@@ -1458,7 +1458,7 @@ tcp_find_option(u_int8_t option,
 		int *hotdrop)
 {
 	/* tcp.doff is only 4 bits, ie. max 15 * 4 bytes */
-	char opt[60 - sizeof(struct tcphdr)];
+	u_int8_t opt[60 - sizeof(struct tcphdr)];
 	unsigned int i;
 
 	duprintf("tcp_match: finding option\n");
@@ -1731,6 +1731,15 @@ static inline int print_name(const char *i,
 	return 0;
 }
 
+static inline int print_target(const struct ipt_target *t,
+                               off_t start_offset, char *buffer, int length,
+                               off_t *pos, unsigned int *count)
+{
+	if (t == &ipt_standard_target || t == &ipt_error_target)
+		return 0;
+	return print_name((char *)t, start_offset, buffer, length, pos, count);
+}
+
 static int ipt_get_tables(char *buffer, char **start, off_t offset, int length)
 {
 	off_t pos = 0;
@@ -1757,7 +1766,7 @@ static int ipt_get_targets(char *buffer, char **start, off_t offset, int length)
 	if (down_interruptible(&ipt_mutex) != 0)
 		return 0;
 
-	LIST_FIND(&ipt_target, print_name, void *,
+	LIST_FIND(&ipt_target, print_target, struct ipt_target *,
 		  offset, buffer, length, &pos, &count);
 	
 	up(&ipt_mutex);
diff --git a/net/ipv4/netfilter/ipt_CLASSIFY.c b/net/ipv4/netfilter/ipt_CLASSIFY.c
index e7b300465..9842e6e23 100644
--- a/net/ipv4/netfilter/ipt_CLASSIFY.c
+++ b/net/ipv4/netfilter/ipt_CLASSIFY.c
@@ -54,15 +54,17 @@ checkentry(const char *tablename,
 		return 0;
 	}
 	
-	if (hook_mask & ~(1 << NF_IP_POST_ROUTING)) {
-		printk(KERN_ERR "CLASSIFY: only valid in POST_ROUTING.\n");
+	if (hook_mask & ~((1 << NF_IP_LOCAL_OUT) | (1 << NF_IP_FORWARD) |
+	                  (1 << NF_IP_POST_ROUTING))) {
+		printk(KERN_ERR "CLASSIFY: only valid in LOCAL_OUT, FORWARD "
+		                "and POST_ROUTING.\n");
 		return 0;
 	}
 
 	if (strcmp(tablename, "mangle") != 0) {
-		printk(KERN_WARNING "CLASSIFY: can only be called from "
-		                    "\"mangle\" table, not \"%s\".\n",
-		                    tablename);
+		printk(KERN_ERR "CLASSIFY: can only be called from "
+		                "\"mangle\" table, not \"%s\".\n",
+		                tablename);
 		return 0;
 	}
 
diff --git a/net/ipv4/netfilter/ipt_LOG.c b/net/ipv4/netfilter/ipt_LOG.c
index 0f1b881da..b79962e22 100644
--- a/net/ipv4/netfilter/ipt_LOG.c
+++ b/net/ipv4/netfilter/ipt_LOG.c
@@ -76,7 +76,7 @@ static void dump_packet(const struct ipt_log_info *info,
 		printk("FRAG:%u ", ntohs(iph.frag_off) & IP_OFFSET);
 
 	if ((info->logflags & IPT_LOG_IPOPT)
-	    && iph.ihl * 4 != sizeof(struct iphdr)) {
+	    && iph.ihl * 4 > sizeof(struct iphdr)) {
 		unsigned char opt[4 * 15 - sizeof(struct iphdr)];
 		unsigned int i, optsize;
 
@@ -143,7 +143,7 @@ static void dump_packet(const struct ipt_log_info *info,
 		printk("URGP=%u ", ntohs(tcph.urg_ptr));
 
 		if ((info->logflags & IPT_LOG_TCPOPT)
-		    && tcph.doff * 4 != sizeof(struct tcphdr)) {
+		    && tcph.doff * 4 > sizeof(struct tcphdr)) {
 			unsigned char opt[4 * 15 - sizeof(struct tcphdr)];
 			unsigned int i, optsize;
 
diff --git a/net/ipv4/netfilter/ipt_MASQUERADE.c b/net/ipv4/netfilter/ipt_MASQUERADE.c
index fb499905f..54bc4684c 100644
--- a/net/ipv4/netfilter/ipt_MASQUERADE.c
+++ b/net/ipv4/netfilter/ipt_MASQUERADE.c
@@ -16,6 +16,7 @@
 #include <linux/module.h>
 #include <linux/netfilter.h>
 #include <net/protocol.h>
+#include <net/ip.h>
 #include <net/checksum.h>
 #include <linux/netfilter_ipv4.h>
 #include <linux/netfilter_ipv4/ip_nat_rule.h>
diff --git a/net/ipv4/netfilter/ipt_REJECT.c b/net/ipv4/netfilter/ipt_REJECT.c
index f6183f968..b8018cb02 100644
--- a/net/ipv4/netfilter/ipt_REJECT.c
+++ b/net/ipv4/netfilter/ipt_REJECT.c
@@ -142,12 +142,8 @@ static void send_reset(struct sk_buff *oldskb, int hook)
 	nskb->dst = &rt->u.dst;
 
 	/* This packet will not be the same as the other: clear nf fields */
-	nf_conntrack_put(nskb->nfct);
-	nskb->nfct = NULL;
+	nf_reset(nskb);
 	nskb->nfcache = 0;
-#ifdef CONFIG_NETFILTER_DEBUG
-	nskb->nf_debug = 0;
-#endif
 	nskb->nfmark = 0;
 #ifdef CONFIG_BRIDGE_NETFILTER
 	nf_bridge_put(nskb->nf_bridge);
diff --git a/net/ipv4/netfilter/ipt_ULOG.c b/net/ipv4/netfilter/ipt_ULOG.c
index b041d28e7..c352df54a 100644
--- a/net/ipv4/netfilter/ipt_ULOG.c
+++ b/net/ipv4/netfilter/ipt_ULOG.c
@@ -217,6 +217,10 @@ static void ipt_ulog_packet(unsigned int hooknum,
 
 	pm = NLMSG_DATA(nlh);
 
+	/* We might not have a timestamp, get one */
+	if (skb->stamp.tv_sec == 0)
+		do_gettimeofday((struct timeval *)&skb->stamp);
+
 	/* copy hook, prefix, timestamp, payload, etc. */
 	pm->data_len = copy_len;
 	pm->timestamp_sec = skb->stamp.tv_sec;
diff --git a/net/ipv4/netfilter/ipt_helper.c b/net/ipv4/netfilter/ipt_helper.c
index bed83c79e..ee9881ece 100644
--- a/net/ipv4/netfilter/ipt_helper.c
+++ b/net/ipv4/netfilter/ipt_helper.c
@@ -41,17 +41,17 @@ match(const struct sk_buff *skb,
 	struct ip_conntrack_expect *exp;
 	struct ip_conntrack *ct;
 	enum ip_conntrack_info ctinfo;
-	int ret = 0;
+	int ret = info->invert;
 	
 	ct = ip_conntrack_get((struct sk_buff *)skb, &ctinfo);
 	if (!ct) {
 		DEBUGP("ipt_helper: Eek! invalid conntrack?\n");
-		return 0;
+		return ret;
 	}
 
 	if (!ct->master) {
 		DEBUGP("ipt_helper: conntrack %p has no master\n", ct);
-		return 0;
+		return ret;
 	}
 
 	exp = ct->master;
@@ -71,8 +71,11 @@ match(const struct sk_buff *skb,
 	DEBUGP("master's name = %s , info->name = %s\n", 
 		exp->expectant->helper->name, info->name);
 
-	ret = !strncmp(exp->expectant->helper->name, info->name, 
-	               strlen(exp->expectant->helper->name)) ^ info->invert;
+	if (info->name[0] == '\0')
+		ret ^= 1;
+	else
+		ret ^= !strncmp(exp->expectant->helper->name, info->name, 
+		                strlen(exp->expectant->helper->name));
 out_unlock:
 	READ_UNLOCK(&ip_conntrack_lock);
 	return ret;
@@ -92,10 +95,6 @@ static int check(const char *tablename,
 	if (matchsize != IPT_ALIGN(sizeof(struct ipt_helper_info)))
 		return 0;
 
-	/* verify that we actually should match anything */
-	if ( strlen(info->name) == 0 )
-		return 0;
-	
 	return 1;
 }
 
@@ -108,7 +107,6 @@ static struct ipt_match helper_match = {
 
 static int __init init(void)
 {
-	need_ip_conntrack();
 	return ipt_register_match(&helper_match);
 }
 
diff --git a/net/ipv4/netfilter/ipt_owner.c b/net/ipv4/netfilter/ipt_owner.c
index 91c3fd3f1..3b9065e06 100644
--- a/net/ipv4/netfilter/ipt_owner.c
+++ b/net/ipv4/netfilter/ipt_owner.c
@@ -184,7 +184,15 @@ checkentry(const char *tablename,
 		       IPT_ALIGN(sizeof(struct ipt_owner_info)));
 		return 0;
 	}
-
+#ifdef CONFIG_SMP
+	/* files->file_lock can not be used in a BH */
+	if (((struct ipt_owner_info *)matchinfo)->match
+	    & (IPT_OWNER_PID|IPT_OWNER_SID|IPT_OWNER_COMM)) {
+		printk("ipt_owner: pid, sid and command matching is broken "
+		       "on SMP.\n");
+		return 0;
+	}
+#endif
 	return 1;
 }
 
diff --git a/net/ipv4/netfilter/iptable_mangle.c b/net/ipv4/netfilter/iptable_mangle.c
index 1c3d96b5f..b5b43b277 100644
--- a/net/ipv4/netfilter/iptable_mangle.c
+++ b/net/ipv4/netfilter/iptable_mangle.c
@@ -173,7 +173,9 @@ ipt_local_hook(unsigned int hook,
 	if (ret != NF_DROP && ret != NF_STOLEN && ret != NF_QUEUE
 	    && ((*pskb)->nh.iph->saddr != saddr
 		|| (*pskb)->nh.iph->daddr != daddr
+#ifdef CONFIG_IP_ROUTE_FWMARK
 		|| (*pskb)->nfmark != nfmark
+#endif
 		|| (*pskb)->nh.iph->tos != tos))
 		return ip_route_me_harder(pskb) == 0 ? ret : NF_DROP;
 
diff --git a/net/ipv4/netfilter/iptable_raw.c b/net/ipv4/netfilter/iptable_raw.c
index 4c2266d20..63c625460 100644
--- a/net/ipv4/netfilter/iptable_raw.c
+++ b/net/ipv4/netfilter/iptable_raw.c
@@ -32,43 +32,70 @@ static struct
 	struct ipt_replace repl;
 	struct ipt_standard entries[2];
 	struct ipt_error term;
-} initial_table __initdata
-= { { "raw", RAW_VALID_HOOKS, 3,
-      sizeof(struct ipt_standard) * 2 + sizeof(struct ipt_error),
-      { [NF_IP_PRE_ROUTING] 0,
-	[NF_IP_LOCAL_OUT] sizeof(struct ipt_standard) },
-      { [NF_IP_PRE_ROUTING] 0,
-	[NF_IP_LOCAL_OUT] sizeof(struct ipt_standard) },
-      0, NULL, { } },
-    {
-	    /* PRE_ROUTING */
-	    { { { { 0 }, { 0 }, { 0 }, { 0 }, "", "", { 0 }, { 0 }, 0, 0, 0 },
-		0,
-		sizeof(struct ipt_entry),
-		sizeof(struct ipt_standard),
-		0, { 0, 0 }, { } },
-	      { { { { IPT_ALIGN(sizeof(struct ipt_standard_target)), "" } }, { } },
-		-NF_ACCEPT - 1 } },
-	    /* LOCAL_OUT */
-	    { { { { 0 }, { 0 }, { 0 }, { 0 }, "", "", { 0 }, { 0 }, 0, 0, 0 },
-		0,
-		sizeof(struct ipt_entry),
-		sizeof(struct ipt_standard),
-		0, { 0, 0 }, { } },
-	      { { { { IPT_ALIGN(sizeof(struct ipt_standard_target)), "" } }, { } },
-		-NF_ACCEPT - 1 } }
-    },
-    /* ERROR */
-    { { { { 0 }, { 0 }, { 0 }, { 0 }, "", "", { 0 }, { 0 }, 0, 0, 0 },
-	0,
-	sizeof(struct ipt_entry),
-	sizeof(struct ipt_error),
-	0, { 0, 0 }, { } },
-      { { { { IPT_ALIGN(sizeof(struct ipt_error_target)), IPT_ERROR_TARGET } },
-	  { } },
-	"ERROR"
-      }
-    }
+} initial_table __initdata = {
+	.repl = {
+		.name = "raw", 
+		.valid_hooks = RAW_VALID_HOOKS, 
+		.num_entries = 3,
+		.size = sizeof(struct ipt_standard) * 2 + sizeof(struct ipt_error),
+		.hook_entry = { 
+			[NF_IP_PRE_ROUTING] = 0,
+			[NF_IP_LOCAL_OUT] = sizeof(struct ipt_standard) },
+		.underflow = { 
+			[NF_IP_PRE_ROUTING] = 0,
+			[NF_IP_LOCAL_OUT]  = sizeof(struct ipt_standard) },
+	},
+	.entries = {
+	     /* PRE_ROUTING */
+	     { 
+		     .entry = { 
+			     .target_offset = sizeof(struct ipt_entry),
+			     .next_offset = sizeof(struct ipt_standard),
+		     },
+		     .target = { 
+			  .target = { 
+				  .u = {
+					  .target_size = IPT_ALIGN(sizeof(struct ipt_standard_target)),
+				  },
+			  },
+			  .verdict = -NF_ACCEPT - 1,
+		     },
+	     },
+
+	     /* LOCAL_OUT */
+	     {
+		     .entry = {
+			     .target_offset = sizeof(struct ipt_entry),
+			     .next_offset = sizeof(struct ipt_standard),
+		     },
+		     .target = {
+			     .target = {
+				     .u = {
+					     .target_size = IPT_ALIGN(sizeof(struct ipt_standard_target)),
+				     },
+			     },
+			     .verdict = -NF_ACCEPT - 1,
+		     },
+	     },
+	},
+	/* ERROR */
+	.term = {
+		.entry = {
+			.target_offset = sizeof(struct ipt_entry),
+			.next_offset = sizeof(struct ipt_error),
+		},
+		.target = {
+			.target = {
+				.u = {
+					.user = {
+						.target_size = IPT_ALIGN(sizeof(struct ipt_error_target)), 
+						.name = IPT_ERROR_TARGET,
+					},
+				},
+			},
+			.errorname = "ERROR",
+		},
+	}
 };
 
 static struct ipt_table packet_raw = { 
diff --git a/net/ipv4/proc.c b/net/ipv4/proc.c
index be47cbec5..fca126a09 100644
--- a/net/ipv4/proc.c
+++ b/net/ipv4/proc.c
@@ -88,7 +88,7 @@ static struct file_operations sockstat_seq_fops = {
 };
 
 static unsigned long
-__fold_field(void *mib[], int offt)
+fold_field(void *mib[], int offt)
 {
 	unsigned long res = 0;
 	int i;
@@ -96,41 +96,157 @@ __fold_field(void *mib[], int offt)
 	for (i = 0; i < NR_CPUS; i++) {
 		if (!cpu_possible(i))
 			continue;
-		res +=
-		    *((unsigned long *) (((void *) per_cpu_ptr(mib[0], i)) +
-					 offt));
-		res +=
-		    *((unsigned long *) (((void *) per_cpu_ptr(mib[1], i)) +
-					 offt));
+		res += *(((unsigned long *) per_cpu_ptr(mib[0], i)) + offt);
+		res += *(((unsigned long *) per_cpu_ptr(mib[1], i)) + offt);
 	}
 	return res;
 }
 
-#define fold_field(_mib, _nr)	__fold_field(_mib, (sizeof(unsigned long) * (_nr)))
-
 /* snmp items */
-static struct snmp_item snmp4_ipstats_list[] = {
-#define __SNMP_GEN(x,y)	SNMP_ITEM(struct ipstats_mib, x, y)
-#define SNMP_GEN(x)	__SNMP_GEN(x, #x)
-	SNMP_GEN(InReceives),
-	SNMP_GEN(InHdrErrors),
-	SNMP_GEN(InAddrErrors),
-	__SNMP_GEN(OutForwDatagrams,"ForwDatagrams"),	/* for backward compatibility */
-	SNMP_GEN(InUnknownProtos),
-	SNMP_GEN(InDiscards),
-	SNMP_GEN(InDelivers),
-	SNMP_GEN(OutRequests),
-	SNMP_GEN(OutDiscards),
-	SNMP_GEN(OutNoRoutes),
-	SNMP_GEN(ReasmTimeout),
-	SNMP_GEN(ReasmReqds),
-	SNMP_GEN(ReasmOKs),
-	SNMP_GEN(ReasmFails),
-	SNMP_GEN(FragOKs),
-	SNMP_GEN(FragFails),
-	SNMP_GEN(FragCreates),
-	SNMP_ITEM_SENTINEL
-#undef SNMP_GEN
+static struct snmp_mib snmp4_ipstats_list[] = {
+	SNMP_MIB_ITEM("InReceives", IPSTATS_MIB_INRECEIVES),
+	SNMP_MIB_ITEM("InHdrErrors", IPSTATS_MIB_INHDRERRORS),
+	SNMP_MIB_ITEM("InAddrErrors", IPSTATS_MIB_INADDRERRORS),
+	SNMP_MIB_ITEM("ForwDatagrams", IPSTATS_MIB_OUTFORWDATAGRAMS),
+	SNMP_MIB_ITEM("InUnknownProtos", IPSTATS_MIB_INUNKNOWNPROTOS),
+	SNMP_MIB_ITEM("InDiscards", IPSTATS_MIB_INDISCARDS),
+	SNMP_MIB_ITEM("InDelivers", IPSTATS_MIB_INDELIVERS),
+	SNMP_MIB_ITEM("OutRequests", IPSTATS_MIB_OUTREQUESTS),
+	SNMP_MIB_ITEM("OutDiscards", IPSTATS_MIB_OUTDISCARDS),
+	SNMP_MIB_ITEM("OutNoRoutes", IPSTATS_MIB_OUTNOROUTES),
+	SNMP_MIB_ITEM("ReasmTimeout", IPSTATS_MIB_REASMTIMEOUT),
+	SNMP_MIB_ITEM("ReasmReqds", IPSTATS_MIB_REASMREQDS),
+	SNMP_MIB_ITEM("ReasmOKs", IPSTATS_MIB_REASMOKS),
+	SNMP_MIB_ITEM("ReasmFails", IPSTATS_MIB_REASMFAILS),
+	SNMP_MIB_ITEM("FragOKs", IPSTATS_MIB_FRAGOKS),
+	SNMP_MIB_ITEM("FragFails", IPSTATS_MIB_FRAGFAILS),
+	SNMP_MIB_ITEM("FragCreates", IPSTATS_MIB_FRAGCREATES),
+	SNMP_MIB_SENTINEL
+};
+
+static struct snmp_mib snmp4_icmp_list[] = {
+	SNMP_MIB_ITEM("InMsgs", ICMP_MIB_INMSGS),
+	SNMP_MIB_ITEM("InErrors", ICMP_MIB_INERRORS),
+	SNMP_MIB_ITEM("InDestUnreachs", ICMP_MIB_INDESTUNREACHS),
+	SNMP_MIB_ITEM("InTimeExcds", ICMP_MIB_INTIMEEXCDS),
+	SNMP_MIB_ITEM("InParmProbs", ICMP_MIB_INPARMPROBS),
+	SNMP_MIB_ITEM("InSrcQuenchs", ICMP_MIB_INSRCQUENCHS),
+	SNMP_MIB_ITEM("InRedirects", ICMP_MIB_INREDIRECTS),
+	SNMP_MIB_ITEM("InEchos", ICMP_MIB_INECHOS),
+	SNMP_MIB_ITEM("InEchoReps", ICMP_MIB_INECHOREPS),
+	SNMP_MIB_ITEM("InTimestamps", ICMP_MIB_INTIMESTAMPS),
+	SNMP_MIB_ITEM("InTimestampReps", ICMP_MIB_INTIMESTAMPREPS),
+	SNMP_MIB_ITEM("InAddrMasks", ICMP_MIB_INADDRMASKS),
+	SNMP_MIB_ITEM("InAddrMaskReps", ICMP_MIB_INADDRMASKREPS),
+	SNMP_MIB_ITEM("OutMsgs", ICMP_MIB_OUTMSGS),
+	SNMP_MIB_ITEM("OutErrors", ICMP_MIB_OUTERRORS),
+	SNMP_MIB_ITEM("OutDestUnreachs", ICMP_MIB_OUTDESTUNREACHS),
+	SNMP_MIB_ITEM("OutTimeExcds", ICMP_MIB_OUTTIMEEXCDS),
+	SNMP_MIB_ITEM("OutParmProbs", ICMP_MIB_OUTPARMPROBS),
+	SNMP_MIB_ITEM("OutSrcQuenchs", ICMP_MIB_OUTSRCQUENCHS),
+	SNMP_MIB_ITEM("OutRedirects", ICMP_MIB_OUTREDIRECTS),
+	SNMP_MIB_ITEM("OutEchos", ICMP_MIB_OUTECHOS),
+	SNMP_MIB_ITEM("OutEchoReps", ICMP_MIB_OUTECHOREPS),
+	SNMP_MIB_ITEM("OutTimestamps", ICMP_MIB_OUTTIMESTAMPS),
+	SNMP_MIB_ITEM("OutTimestampReps", ICMP_MIB_OUTTIMESTAMPREPS),
+	SNMP_MIB_ITEM("OutAddrMasks", ICMP_MIB_OUTADDRMASKS),
+	SNMP_MIB_ITEM("OutAddrMaskReps", ICMP_MIB_OUTADDRMASKREPS),
+	SNMP_MIB_SENTINEL
+};
+
+static struct snmp_mib snmp4_tcp_list[] = {
+	SNMP_MIB_ITEM("RtoAlgorithm", TCP_MIB_RTOALGORITHM),
+	SNMP_MIB_ITEM("RtoMin", TCP_MIB_RTOMIN),
+	SNMP_MIB_ITEM("RtoMax", TCP_MIB_RTOMAX),
+	SNMP_MIB_ITEM("MaxConn", TCP_MIB_MAXCONN),
+	SNMP_MIB_ITEM("ActiveOpens", TCP_MIB_ACTIVEOPENS),
+	SNMP_MIB_ITEM("PassiveOpens", TCP_MIB_PASSIVEOPENS),
+	SNMP_MIB_ITEM("AttemptFails", TCP_MIB_ATTEMPTFAILS),
+	SNMP_MIB_ITEM("EstabResets", TCP_MIB_ESTABRESETS),
+	SNMP_MIB_ITEM("CurrEstab", TCP_MIB_CURRESTAB),
+	SNMP_MIB_ITEM("InSegs", TCP_MIB_INSEGS),
+	SNMP_MIB_ITEM("OutSegs", TCP_MIB_OUTSEGS),
+	SNMP_MIB_ITEM("RetransSegs", TCP_MIB_RETRANSSEGS),
+	SNMP_MIB_ITEM("InErrs", TCP_MIB_INERRS),
+	SNMP_MIB_ITEM("OutRsts", TCP_MIB_OUTRSTS),
+	SNMP_MIB_SENTINEL
+};
+
+static struct snmp_mib snmp4_udp_list[] = {
+	SNMP_MIB_ITEM("InDatagrams", UDP_MIB_INDATAGRAMS),
+	SNMP_MIB_ITEM("NoPorts", UDP_MIB_NOPORTS),
+	SNMP_MIB_ITEM("InErrors", UDP_MIB_INERRORS),
+	SNMP_MIB_ITEM("OutDatagrams", UDP_MIB_OUTDATAGRAMS),
+	SNMP_MIB_SENTINEL
+};
+
+static struct snmp_mib snmp4_net_list[] = {
+	SNMP_MIB_ITEM("SyncookiesSent", LINUX_MIB_SYNCOOKIESSENT),
+	SNMP_MIB_ITEM("SyncookiesRecv", LINUX_MIB_SYNCOOKIESRECV),
+	SNMP_MIB_ITEM("SyncookiesFailed", LINUX_MIB_SYNCOOKIESFAILED),
+	SNMP_MIB_ITEM("EmbryonicRsts", LINUX_MIB_EMBRYONICRSTS),
+	SNMP_MIB_ITEM("PruneCalled", LINUX_MIB_PRUNECALLED),
+	SNMP_MIB_ITEM("RcvPruned", LINUX_MIB_RCVPRUNED),
+	SNMP_MIB_ITEM("OfoPruned", LINUX_MIB_OFOPRUNED),
+	SNMP_MIB_ITEM("OutOfWindowIcmps", LINUX_MIB_OUTOFWINDOWICMPS),
+	SNMP_MIB_ITEM("LockDroppedIcmps", LINUX_MIB_LOCKDROPPEDICMPS),
+	SNMP_MIB_ITEM("ArpFilter", LINUX_MIB_ARPFILTER),
+	SNMP_MIB_ITEM("TW", LINUX_MIB_TIMEWAITED),
+	SNMP_MIB_ITEM("TWRecycled", LINUX_MIB_TIMEWAITRECYCLED),
+	SNMP_MIB_ITEM("TWKilled", LINUX_MIB_TIMEWAITKILLED),
+	SNMP_MIB_ITEM("PAWSPassive", LINUX_MIB_PAWSPASSIVEREJECTED),
+	SNMP_MIB_ITEM("PAWSActive", LINUX_MIB_PAWSACTIVEREJECTED),
+	SNMP_MIB_ITEM("PAWSEstab", LINUX_MIB_PAWSESTABREJECTED),
+	SNMP_MIB_ITEM("DelayedACKs", LINUX_MIB_DELAYEDACKS),
+	SNMP_MIB_ITEM("DelayedACKLocked", LINUX_MIB_DELAYEDACKLOCKED),
+	SNMP_MIB_ITEM("DelayedACKLost", LINUX_MIB_DELAYEDACKLOST),
+	SNMP_MIB_ITEM("ListenOverflows", LINUX_MIB_LISTENOVERFLOWS),
+	SNMP_MIB_ITEM("ListenDrops", LINUX_MIB_LISTENDROPS),
+	SNMP_MIB_ITEM("TCPPrequeued", LINUX_MIB_TCPPREQUEUED),
+	SNMP_MIB_ITEM("TCPDirectCopyFromBacklog", LINUX_MIB_TCPDIRECTCOPYFROMBACKLOG),
+	SNMP_MIB_ITEM("TCPDirectCopyFromPrequeue", LINUX_MIB_TCPDIRECTCOPYFROMPREQUEUE),
+	SNMP_MIB_ITEM("TCPPrequeueDropped", LINUX_MIB_TCPPREQUEUEDROPPED),
+	SNMP_MIB_ITEM("TCPHPHits", LINUX_MIB_TCPHPHITS),
+	SNMP_MIB_ITEM("TCPHPHitsToUser", LINUX_MIB_TCPHPHITSTOUSER),
+	SNMP_MIB_ITEM("TCPPureAcks", LINUX_MIB_TCPPUREACKS),
+	SNMP_MIB_ITEM("TCPHPAcks", LINUX_MIB_TCPHPACKS),
+	SNMP_MIB_ITEM("TCPRenoRecovery", LINUX_MIB_TCPRENORECOVERY),
+	SNMP_MIB_ITEM("TCPSackRecovery", LINUX_MIB_TCPSACKRECOVERY),
+	SNMP_MIB_ITEM("TCPSACKReneging", LINUX_MIB_TCPSACKRENEGING),
+	SNMP_MIB_ITEM("TCPFACKReorder", LINUX_MIB_TCPFACKREORDER),
+	SNMP_MIB_ITEM("TCPSACKReorder", LINUX_MIB_TCPSACKREORDER),
+	SNMP_MIB_ITEM("TCPRenoReorder", LINUX_MIB_TCPRENOREORDER),
+	SNMP_MIB_ITEM("TCPTSReorder", LINUX_MIB_TCPTSREORDER),
+	SNMP_MIB_ITEM("TCPFullUndo", LINUX_MIB_TCPFULLUNDO),
+	SNMP_MIB_ITEM("TCPPartialUndo", LINUX_MIB_TCPPARTIALUNDO),
+	SNMP_MIB_ITEM("TCPDSACKUndo", LINUX_MIB_TCPDSACKUNDO),
+	SNMP_MIB_ITEM("TCPLossUndo", LINUX_MIB_TCPLOSSUNDO),
+	SNMP_MIB_ITEM("TCPLoss", LINUX_MIB_TCPLOSS),
+	SNMP_MIB_ITEM("TCPLostRetransmit", LINUX_MIB_TCPLOSTRETRANSMIT),
+	SNMP_MIB_ITEM("TCPRenoFailures", LINUX_MIB_TCPRENOFAILURES),
+	SNMP_MIB_ITEM("TCPSackFailures", LINUX_MIB_TCPSACKFAILURES),
+	SNMP_MIB_ITEM("TCPLossFailures", LINUX_MIB_TCPLOSSFAILURES),
+	SNMP_MIB_ITEM("TCPFastRetrans", LINUX_MIB_TCPFASTRETRANS),
+	SNMP_MIB_ITEM("TCPForwardRetrans", LINUX_MIB_TCPFORWARDRETRANS),
+	SNMP_MIB_ITEM("TCPSlowStartRetrans", LINUX_MIB_TCPSLOWSTARTRETRANS),
+	SNMP_MIB_ITEM("TCPTimeouts", LINUX_MIB_TCPTIMEOUTS),
+	SNMP_MIB_ITEM("TCPRenoRecoveryFail", LINUX_MIB_TCPRENORECOVERYFAIL),
+	SNMP_MIB_ITEM("TCPSackRecoveryFail", LINUX_MIB_TCPSACKRECOVERYFAIL),
+	SNMP_MIB_ITEM("TCPSchedulerFailed", LINUX_MIB_TCPSCHEDULERFAILED),
+	SNMP_MIB_ITEM("TCPRcvCollapsed", LINUX_MIB_TCPRCVCOLLAPSED),
+	SNMP_MIB_ITEM("TCPDSACKOldSent", LINUX_MIB_TCPDSACKOLDSENT),
+	SNMP_MIB_ITEM("TCPDSACKOfoSent", LINUX_MIB_TCPDSACKOFOSENT),
+	SNMP_MIB_ITEM("TCPDSACKRecv", LINUX_MIB_TCPDSACKRECV),
+	SNMP_MIB_ITEM("TCPDSACKOfoRecv", LINUX_MIB_TCPDSACKOFORECV),
+	SNMP_MIB_ITEM("TCPAbortOnSyn", LINUX_MIB_TCPABORTONSYN),
+	SNMP_MIB_ITEM("TCPAbortOnData", LINUX_MIB_TCPABORTONDATA),
+	SNMP_MIB_ITEM("TCPAbortOnClose", LINUX_MIB_TCPABORTONCLOSE),
+	SNMP_MIB_ITEM("TCPAbortOnMemory", LINUX_MIB_TCPABORTONMEMORY),
+	SNMP_MIB_ITEM("TCPAbortOnTimeout", LINUX_MIB_TCPABORTONTIMEOUT),
+	SNMP_MIB_ITEM("TCPAbortOnLinger", LINUX_MIB_TCPABORTONLINGER),
+	SNMP_MIB_ITEM("TCPAbortFailed", LINUX_MIB_TCPABORTFAILED),
+	SNMP_MIB_ITEM("TCPMemoryPressures", LINUX_MIB_TCPMEMORYPRESSURES),
+	SNMP_MIB_SENTINEL
 };
 
 /*
@@ -140,7 +256,7 @@ static int snmp_seq_show(struct seq_file *seq, void *v)
 {
 	int i;
 
-	seq_printf(seq, "Ip: Forwarding DefaultTTL");
+	seq_puts(seq, "Ip: Forwarding DefaultTTL");
 
 	for (i = 0; snmp4_ipstats_list[i].name != NULL; i++)
 		seq_printf(seq, " %s", snmp4_ipstats_list[i].name);
@@ -150,44 +266,45 @@ static int snmp_seq_show(struct seq_file *seq, void *v)
 
 	for (i = 0; snmp4_ipstats_list[i].name != NULL; i++)
 		seq_printf(seq, " %lu",
-			   __fold_field((void **) ip_statistics, 
-					snmp4_ipstats_list[i].offset));
-
-	seq_printf(seq, "\nIcmp: InMsgs InErrors InDestUnreachs InTimeExcds "
-			"InParmProbs InSrcQuenchs InRedirects InEchos "
-			"InEchoReps InTimestamps InTimestampReps InAddrMasks "
-			"InAddrMaskReps OutMsgs OutErrors OutDestUnreachs "
-			"OutTimeExcds OutParmProbs OutSrcQuenchs OutRedirects "
-			"OutEchos OutEchoReps OutTimestamps OutTimestampReps "
-			"OutAddrMasks OutAddrMaskReps\nIcmp:");
-
-	for (i = 0;
-	     i < offsetof(struct icmp_mib, dummy) / sizeof(unsigned long); i++)
+			   fold_field((void **) ip_statistics, 
+				      snmp4_ipstats_list[i].entry));
+
+	seq_puts(seq, "\nIcmp:");
+	for (i = 0; snmp4_icmp_list[i].name != NULL; i++)
+		seq_printf(seq, " %s", snmp4_icmp_list[i].name);
+
+	seq_puts(seq, "\nIcmp:");
+	for (i = 0; snmp4_icmp_list[i].name != NULL; i++)
 		seq_printf(seq, " %lu",
-			   fold_field((void **) icmp_statistics, i)); 
-
-	seq_printf(seq, "\nTcp: RtoAlgorithm RtoMin RtoMax MaxConn ActiveOpens "
-			"PassiveOpens AttemptFails EstabResets CurrEstab "
-			"InSegs OutSegs RetransSegs InErrs OutRsts\nTcp:");
-
-	for (i = 0;
-	     i < offsetof(struct tcp_mib, __pad) / sizeof(unsigned long); i++) {
-		if (i == (offsetof(struct tcp_mib, TcpMaxConn) / sizeof(unsigned long)))
-			/* MaxConn field is negative, RFC 2012 */
-			seq_printf(seq, " %ld", 
-				   fold_field((void **) tcp_statistics, i));
+			   fold_field((void **) icmp_statistics, 
+				      snmp4_icmp_list[i].entry));
+
+	seq_puts(seq, "\nTcp:");
+	for (i = 0; snmp4_tcp_list[i].name != NULL; i++)
+		seq_printf(seq, " %s", snmp4_tcp_list[i].name);
+
+	seq_puts(seq, "\nTcp:");
+	for (i = 0; snmp4_tcp_list[i].name != NULL; i++) {
+		/* MaxConn field is signed, RFC 2012 */
+		if (snmp4_tcp_list[i].entry == TCP_MIB_MAXCONN)
+			seq_printf(seq, " %ld",
+				   fold_field((void **) tcp_statistics, 
+					      snmp4_tcp_list[i].entry));
 		else
-			seq_printf(seq, " %lu", 
-				   fold_field((void **) tcp_statistics, i));
+			seq_printf(seq, " %lu",
+				   fold_field((void **) tcp_statistics,
+					      snmp4_tcp_list[i].entry));
 	}
 
-	seq_printf(seq, "\nUdp: InDatagrams NoPorts InErrors OutDatagrams\n"
-			"Udp:");
+	seq_puts(seq, "\nUdp:");
+	for (i = 0; snmp4_udp_list[i].name != NULL; i++)
+		seq_printf(seq, " %s", snmp4_udp_list[i].name);
 
-	for (i = 0;
-	     i < offsetof(struct udp_mib, __pad) / sizeof(unsigned long); i++)
-		seq_printf(seq, " %lu", 
-				fold_field((void **) udp_statistics, i));
+	seq_puts(seq, "\nUdp:");
+	for (i = 0; snmp4_udp_list[i].name != NULL; i++)
+		seq_printf(seq, " %lu",
+			   fold_field((void **) udp_statistics, 
+				      snmp4_udp_list[i].entry));
 
 	seq_putc(seq, '\n');
 	return 0;
@@ -213,39 +330,16 @@ static int netstat_seq_show(struct seq_file *seq, void *v)
 {
 	int i;
 
-	seq_puts(seq, "TcpExt: SyncookiesSent SyncookiesRecv SyncookiesFailed"
-		      " EmbryonicRsts PruneCalled RcvPruned OfoPruned"
-		      " OutOfWindowIcmps LockDroppedIcmps ArpFilter"
-		      " TW TWRecycled TWKilled"
-		      " PAWSPassive PAWSActive PAWSEstab"
-		      " DelayedACKs DelayedACKLocked DelayedACKLost"
-		      " ListenOverflows ListenDrops"
-		      " TCPPrequeued TCPDirectCopyFromBacklog"
-		      " TCPDirectCopyFromPrequeue TCPPrequeueDropped"
-		      " TCPHPHits TCPHPHitsToUser"
-		      " TCPPureAcks TCPHPAcks"
-		      " TCPRenoRecovery TCPSackRecovery"
-		      " TCPSACKReneging"
-		      " TCPFACKReorder TCPSACKReorder TCPRenoReorder"
-		      " TCPTSReorder"
-		      " TCPFullUndo TCPPartialUndo TCPDSACKUndo TCPLossUndo"
-		      " TCPLoss TCPLostRetransmit"
-		      " TCPRenoFailures TCPSackFailures TCPLossFailures"
-		      " TCPFastRetrans TCPForwardRetrans TCPSlowStartRetrans"
-		      " TCPTimeouts"
-		      " TCPRenoRecoveryFail TCPSackRecoveryFail"
-		      " TCPSchedulerFailed TCPRcvCollapsed"
-		      " TCPDSACKOldSent TCPDSACKOfoSent TCPDSACKRecv"
-		      " TCPDSACKOfoRecv"
-		      " TCPAbortOnSyn TCPAbortOnData TCPAbortOnClose"
-		      " TCPAbortOnMemory TCPAbortOnTimeout TCPAbortOnLinger"
-		      " TCPAbortFailed TCPMemoryPressures\n"
-		      "TcpExt:");
-	for (i = 0;
-	     i < offsetof(struct linux_mib, __pad) / sizeof(unsigned long); 
-	     i++)
-		seq_printf(seq, " %lu", 
-		 	   fold_field((void **) net_statistics, i)); 
+	seq_puts(seq, "\nTcpExt:");
+	for (i = 0; snmp4_net_list[i].name != NULL; i++)
+		seq_printf(seq, " %s", snmp4_net_list[i].name);
+
+	seq_puts(seq, "\nTcpExt:");
+	for (i = 0; snmp4_net_list[i].name != NULL; i++)
+		seq_printf(seq, " %lu",
+			   fold_field((void **) net_statistics, 
+				      snmp4_net_list[i].entry));
+
 	seq_putc(seq, '\n');
 	return 0;
 }
diff --git a/net/ipv4/protocol.c b/net/ipv4/protocol.c
index a98eb5250..a8b4bdc27 100644
--- a/net/ipv4/protocol.c
+++ b/net/ipv4/protocol.c
@@ -48,14 +48,14 @@
 #include <net/ipip.h>
 #include <linux/igmp.h>
 
-struct inet_protocol *inet_protos[MAX_INET_PROTOS];
+struct net_protocol *inet_protos[MAX_INET_PROTOS];
 static spinlock_t inet_proto_lock = SPIN_LOCK_UNLOCKED;
 
 /*
  *	Add a protocol handler to the hash tables
  */
 
-int inet_add_protocol(struct inet_protocol *prot, unsigned char protocol)
+int inet_add_protocol(struct net_protocol *prot, unsigned char protocol)
 {
 	int hash, ret;
 
@@ -77,7 +77,7 @@ int inet_add_protocol(struct inet_protocol *prot, unsigned char protocol)
  *	Remove a protocol from the hash tables.
  */
  
-int inet_del_protocol(struct inet_protocol *prot, unsigned char protocol)
+int inet_del_protocol(struct net_protocol *prot, unsigned char protocol)
 {
 	int hash, ret;
 
diff --git a/net/ipv4/raw.c b/net/ipv4/raw.c
index 655aeba92..e378ddcd8 100644
--- a/net/ipv4/raw.c
+++ b/net/ipv4/raw.c
@@ -338,6 +338,10 @@ static int raw_send_hdrinc(struct sock *sk, void *from, int length,
 
 		iph->check = ip_fast_csum((unsigned char *)iph, iph->ihl);
 	}
+	err = -EPERM;
+	if (!vx_check(0, VX_ADMIN) && !capable(CAP_NET_RAW)
+		&& (!raw_addr_in_list(0, 0, iph->saddr, sk->sk_nx_info)))
+		goto error;
 
 	err = NF_HOOK(PF_INET, NF_IP_LOCAL_OUT, skb, NULL, rt->u.dst.dev,
 		      dst_output);
@@ -352,7 +356,7 @@ error_fault:
 	err = -EFAULT;
 	kfree_skb(skb);
 error:
-	IP_INC_STATS(OutDiscards);
+	IP_INC_STATS(IPSTATS_MIB_OUTDISCARDS);
 	return err; 
 }
 
@@ -520,7 +524,7 @@ static void raw_close(struct sock *sk, long timeout)
 	 */
 	ip_ra_control(sk, 0, NULL);
 
-	inet_sock_release(sk);
+	sk_common_release(sk);
 }
 
 /* This gets rid of all the nasties in af_inet. -DaveM */
@@ -595,9 +599,11 @@ int raw_recvmsg(struct kiocb *iocb, struct sock *sk, struct msghdr *msg,
 	}
 	if (inet->cmsg_flags)
 		ip_cmsg_recv(msg, skb);
+	if (flags & MSG_TRUNC)
+		copied = skb->len;
 done:
 	skb_free_datagram(sk, skb);
-out:	return err ? : copied;
+out:	return err ? err : copied;
 }
 
 static int raw_init(struct sock *sk)
@@ -697,7 +703,7 @@ static int raw_ioctl(struct sock *sk, int cmd, unsigned long arg)
 struct proto raw_prot = {
 	.name =		"RAW",
 	.close =	raw_close,
-	.connect =	udp_connect,
+	.connect =	ip4_datagram_connect,
 	.disconnect =	udp_disconnect,
 	.ioctl =	raw_ioctl,
 	.init =		raw_init,
diff --git a/net/ipv4/route.c b/net/ipv4/route.c
index a570e709f..15d9eca53 100644
--- a/net/ipv4/route.c
+++ b/net/ipv4/route.c
@@ -432,20 +432,20 @@ static struct file_operations rt_cpu_seq_fops = {
 	.open	 = rt_cpu_seq_open,
 	.read	 = seq_read,
 	.llseek	 = seq_lseek,
-	.release = seq_release_private,
+	.release = seq_release,
 };
 
 #endif /* CONFIG_PROC_FS */
   
 static __inline__ void rt_free(struct rtable *rt)
 {
-	call_rcu(&rt->u.dst.rcu_head, (void (*)(void *))dst_free, &rt->u.dst);
+	call_rcu(&rt->u.dst.rcu_head, dst_rcu_free);
 }
 
 static __inline__ void rt_drop(struct rtable *rt)
 {
 	ip_rt_put(rt);
-	call_rcu(&rt->u.dst.rcu_head, (void (*)(void *))dst_free, &rt->u.dst);
+	call_rcu(&rt->u.dst.rcu_head, dst_rcu_free);
 }
 
 static __inline__ int rt_fast_clean(struct rtable *rth)
@@ -1729,17 +1729,6 @@ static int ip_route_input_slow(struct sk_buff *skb, u32 daddr, u32 saddr,
 
 	rth->rt_flags = flags;
 
-#ifdef CONFIG_NET_FASTROUTE
-	if (netdev_fastroute && !(flags&(RTCF_NAT|RTCF_MASQ|RTCF_DOREDIRECT))) {
-		struct net_device *odev = rth->u.dst.dev;
-		if (odev != dev &&
-		    dev->accept_fastpath &&
-		    odev->mtu >= dev->mtu &&
-		    dev->accept_fastpath(dev, &rth->u.dst) == 0)
-			rth->rt_flags |= RTCF_FAST;
-	}
-#endif
-
 intern:
 	err = rt_intern_hash(hash, rth, (struct rtable**)&skb->dst);
 done:
@@ -2509,10 +2498,10 @@ static int flush_delay;
 
 static int ipv4_sysctl_rtcache_flush(ctl_table *ctl, int write,
 					struct file *filp, void __user *buffer,
-					size_t *lenp)
+					size_t *lenp, loff_t *ppos)
 {
 	if (write) {
-		proc_dointvec(ctl, write, filp, buffer, lenp);
+		proc_dointvec(ctl, write, filp, buffer, lenp, ppos);
 		rt_cache_flush(flush_delay);
 		return 0;
 	} 
diff --git a/net/ipv4/syncookies.c b/net/ipv4/syncookies.c
index 2e6ab52bf..473813b3c 100644
--- a/net/ipv4/syncookies.c
+++ b/net/ipv4/syncookies.c
@@ -59,7 +59,7 @@ __u32 cookie_v4_init_sequence(struct sock *sk, struct sk_buff *skb, __u16 *mssp)
 		;
 	*mssp = msstab[mssind] + 1;
 
-	NET_INC_STATS_BH(SyncookiesSent);
+	NET_INC_STATS_BH(LINUX_MIB_SYNCOOKIESSENT);
 
 	return secure_tcp_syn_cookie(skb->nh.iph->saddr, skb->nh.iph->daddr,
 				     skb->h.th->source, skb->h.th->dest,
@@ -127,11 +127,11 @@ struct sock *cookie_v4_check(struct sock *sk, struct sk_buff *skb,
 
   	if (time_after(jiffies, tp->last_synq_overflow + TCP_TIMEOUT_INIT) ||
 	    (mss = cookie_check(skb, cookie)) == 0) {
-	 	NET_INC_STATS_BH(SyncookiesFailed);
+	 	NET_INC_STATS_BH(LINUX_MIB_SYNCOOKIESFAILED);
 		goto out;
 	}
 
-	NET_INC_STATS_BH(SyncookiesRecv);
+	NET_INC_STATS_BH(LINUX_MIB_SYNCOOKIESRECV);
 
 	req = tcp_openreq_alloc();
 	ret = NULL;
diff --git a/net/ipv4/sysctl_net_ipv4.c b/net/ipv4/sysctl_net_ipv4.c
index 6b0b74430..55cc26922 100644
--- a/net/ipv4/sysctl_net_ipv4.c
+++ b/net/ipv4/sysctl_net_ipv4.c
@@ -62,12 +62,12 @@ extern ctl_table ipv4_route_table[];
 
 static
 int ipv4_sysctl_forward(ctl_table *ctl, int write, struct file * filp,
-			void __user *buffer, size_t *lenp)
+			void __user *buffer, size_t *lenp, loff_t *ppos)
 {
 	int val = ipv4_devconf.forwarding;
 	int ret;
 
-	ret = proc_dointvec(ctl, write, filp, buffer, lenp);
+	ret = proc_dointvec(ctl, write, filp, buffer, lenp, ppos);
 
 	if (write && ipv4_devconf.forwarding != val)
 		inet_forward_change();
diff --git a/net/ipv4/tcp.c b/net/ipv4/tcp.c
index 260cb4032..90d85538f 100644
--- a/net/ipv4/tcp.c
+++ b/net/ipv4/tcp.c
@@ -276,97 +276,41 @@ kmem_cache_t *tcp_timewait_cachep;
 
 atomic_t tcp_orphan_count = ATOMIC_INIT(0);
 
-int sysctl_tcp_default_win_scale;
+int sysctl_tcp_default_win_scale = 7;
 
 int sysctl_tcp_mem[3];
 int sysctl_tcp_wmem[3] = { 4 * 1024, 16 * 1024, 128 * 1024 };
 int sysctl_tcp_rmem[3] = { 4 * 1024, 87380, 87380 * 2 };
 
+EXPORT_SYMBOL(sysctl_tcp_mem);
+EXPORT_SYMBOL(sysctl_tcp_rmem);
+EXPORT_SYMBOL(sysctl_tcp_wmem);
+
 atomic_t tcp_memory_allocated;	/* Current allocated memory. */
 atomic_t tcp_sockets_allocated;	/* Current number of TCP sockets. */
 
-/* Pressure flag: try to collapse.
+EXPORT_SYMBOL(tcp_memory_allocated);
+EXPORT_SYMBOL(tcp_sockets_allocated);
+
+/*
+ * Pressure flag: try to collapse.
  * Technical note: it is used by multiple contexts non atomically.
- * All the tcp_mem_schedule() is of this nature: accounting
- * is strict, actions are advisory and have some latency. */
+ * All the sk_stream_mem_schedule() is of this nature: accounting
+ * is strict, actions are advisory and have some latency.
+ */
 int tcp_memory_pressure;
 
-#define TCP_PAGES(amt) (((amt) + TCP_MEM_QUANTUM - 1) / TCP_MEM_QUANTUM)
-
-int tcp_mem_schedule(struct sock *sk, int size, int kind)
-{
-	int amt = TCP_PAGES(size);
-
-	sk->sk_forward_alloc += amt * TCP_MEM_QUANTUM;
-	atomic_add(amt, &tcp_memory_allocated);
-
-	/* Under limit. */
-	if (atomic_read(&tcp_memory_allocated) < sysctl_tcp_mem[0]) {
-		if (tcp_memory_pressure)
-			tcp_memory_pressure = 0;
-		return 1;
-	}
-
-	/* Over hard limit. */
-	if (atomic_read(&tcp_memory_allocated) > sysctl_tcp_mem[2]) {
-		tcp_enter_memory_pressure();
-		goto suppress_allocation;
-	}
-
-	/* Under pressure. */
-	if (atomic_read(&tcp_memory_allocated) > sysctl_tcp_mem[1])
-		tcp_enter_memory_pressure();
-
-	if (kind) {
-		if (atomic_read(&sk->sk_rmem_alloc) < sysctl_tcp_rmem[0])
-			return 1;
-	} else if (sk->sk_wmem_queued < sysctl_tcp_wmem[0])
-		return 1;
-
-	if (!tcp_memory_pressure ||
-	    sysctl_tcp_mem[2] > atomic_read(&tcp_sockets_allocated) *
-				TCP_PAGES(sk->sk_wmem_queued +
-					  atomic_read(&sk->sk_rmem_alloc) +
-					  sk->sk_forward_alloc))
-		return 1;
-
-suppress_allocation:
+EXPORT_SYMBOL(tcp_memory_pressure);
 
-	if (!kind) {
-		tcp_moderate_sndbuf(sk);
-
-		/* Fail only if socket is _under_ its sndbuf.
-		 * In this case we cannot block, so that we have to fail.
-		 */
-		if (sk->sk_wmem_queued + size >= sk->sk_sndbuf)
-			return 1;
-	}
-
-	/* Alas. Undo changes. */
-	sk->sk_forward_alloc -= amt * TCP_MEM_QUANTUM;
-	atomic_sub(amt, &tcp_memory_allocated);
-	return 0;
-}
-
-void __tcp_mem_reclaim(struct sock *sk)
+void tcp_enter_memory_pressure(void)
 {
-	if (sk->sk_forward_alloc >= TCP_MEM_QUANTUM) {
-		atomic_sub(sk->sk_forward_alloc / TCP_MEM_QUANTUM,
-			   &tcp_memory_allocated);
-		sk->sk_forward_alloc &= TCP_MEM_QUANTUM - 1;
-		if (tcp_memory_pressure &&
-		    atomic_read(&tcp_memory_allocated) < sysctl_tcp_mem[0])
-			tcp_memory_pressure = 0;
+	if (!tcp_memory_pressure) {
+		NET_INC_STATS(LINUX_MIB_TCPMEMORYPRESSURES);
+		tcp_memory_pressure = 1;
 	}
 }
 
-void tcp_rfree(struct sk_buff *skb)
-{
-	struct sock *sk = skb->sk;
-
-	atomic_sub(skb->truesize, &sk->sk_rmem_alloc);
-	sk->sk_forward_alloc += skb->truesize;
-}
+EXPORT_SYMBOL(tcp_enter_memory_pressure);
 
 /*
  * LISTEN is a special case for poll..
@@ -447,7 +391,7 @@ unsigned int tcp_poll(struct file *file, struct socket *sock, poll_table *wait)
 			mask |= POLLIN | POLLRDNORM;
 
 		if (!(sk->sk_shutdown & SEND_SHUTDOWN)) {
-			if (tcp_wspace(sk) >= tcp_min_write_space(sk)) {
+			if (sk_stream_wspace(sk) >= sk_stream_min_wspace(sk)) {
 				mask |= POLLOUT | POLLWRNORM;
 			} else {  /* send SIGIO later */
 				set_bit(SOCK_ASYNC_NOSPACE,
@@ -458,7 +402,7 @@ unsigned int tcp_poll(struct file *file, struct socket *sock, poll_table *wait)
 				 * wspace test but before the flags are set,
 				 * IO signal will be lost.
 				 */
-				if (tcp_wspace(sk) >= tcp_min_write_space(sk))
+				if (sk_stream_wspace(sk) >= sk_stream_min_wspace(sk))
 					mask |= POLLOUT | POLLWRNORM;
 			}
 		}
@@ -469,24 +413,6 @@ unsigned int tcp_poll(struct file *file, struct socket *sock, poll_table *wait)
 	return mask;
 }
 
-/*
- *	TCP socket write_space callback.
- */
-void tcp_write_space(struct sock *sk)
-{
-	struct socket *sock = sk->sk_socket;
-
-	if (tcp_wspace(sk) >= tcp_min_write_space(sk) && sock) {
-		clear_bit(SOCK_NOSPACE, &sock->flags);
-
-		if (sk->sk_sleep && waitqueue_active(sk->sk_sleep))
-			wake_up_interruptible(sk->sk_sleep);
-
-		if (sock->fasync_list && !(sk->sk_shutdown & SEND_SHUTDOWN))
-			sock_wake_async(sock, 2, POLL_OUT);
-	}
-}
-
 int tcp_ioctl(struct sock *sk, int cmd, unsigned long arg)
 {
 	struct tcp_opt *tp = tcp_sk(sk);
@@ -654,128 +580,6 @@ static void tcp_listen_stop (struct sock *sk)
 	BUG_TRAP(!sk->sk_ack_backlog);
 }
 
-/*
- *	Wait for a socket to get into the connected state
- *
- *	Note: Must be called with the socket locked.
- */
-static int wait_for_tcp_connect(struct sock *sk, int flags, long *timeo_p)
-{
-	struct tcp_opt *tp = tcp_sk(sk);
-	struct task_struct *tsk = current;
-	DEFINE_WAIT(wait);
-
-	while ((1 << sk->sk_state) & ~(TCPF_ESTABLISHED | TCPF_CLOSE_WAIT)) {
-		if (sk->sk_err)
-			return sock_error(sk);
-		if ((1 << sk->sk_state) & ~(TCPF_SYN_SENT | TCPF_SYN_RECV))
-			return -EPIPE;
-		if (!*timeo_p)
-			return -EAGAIN;
-		if (signal_pending(tsk))
-			return sock_intr_errno(*timeo_p);
-
-		prepare_to_wait(sk->sk_sleep, &wait, TASK_INTERRUPTIBLE);
-		tp->write_pending++;
-
-		release_sock(sk);
-		*timeo_p = schedule_timeout(*timeo_p);
-		lock_sock(sk);
-
-		finish_wait(sk->sk_sleep, &wait);
-		tp->write_pending--;
-	}
-	return 0;
-}
-
-static inline int tcp_memory_free(struct sock *sk)
-{
-	return sk->sk_wmem_queued < sk->sk_sndbuf;
-}
-
-/*
- *	Wait for more memory for a socket
- */
-static int wait_for_tcp_memory(struct sock *sk, long *timeo)
-{
-	struct tcp_opt *tp = tcp_sk(sk);
-	int err = 0;
-	long vm_wait = 0;
-	long current_timeo = *timeo;
-	DEFINE_WAIT(wait);
-
-	if (tcp_memory_free(sk))
-		current_timeo = vm_wait = (net_random() % (HZ / 5)) + 2;
-
-	for (;;) {
-		set_bit(SOCK_ASYNC_NOSPACE, &sk->sk_socket->flags);
-
-		prepare_to_wait(sk->sk_sleep, &wait, TASK_INTERRUPTIBLE);
-
-		if (sk->sk_err || (sk->sk_shutdown & SEND_SHUTDOWN))
-			goto do_error;
-		if (!*timeo)
-			goto do_nonblock;
-		if (signal_pending(current))
-			goto do_interrupted;
-		clear_bit(SOCK_ASYNC_NOSPACE, &sk->sk_socket->flags);
-		if (tcp_memory_free(sk) && !vm_wait)
-			break;
-
-		set_bit(SOCK_NOSPACE, &sk->sk_socket->flags);
-		tp->write_pending++;
-		release_sock(sk);
-		if (!tcp_memory_free(sk) || vm_wait)
-			current_timeo = schedule_timeout(current_timeo);
-		lock_sock(sk);
-		tp->write_pending--;
-
-		if (vm_wait) {
-			vm_wait -= current_timeo;
-			current_timeo = *timeo;
-			if (current_timeo != MAX_SCHEDULE_TIMEOUT &&
-			    (current_timeo -= vm_wait) < 0)
-				current_timeo = 0;
-			vm_wait = 0;
-		}
-		*timeo = current_timeo;
-	}
-out:
-	finish_wait(sk->sk_sleep, &wait);
-	return err;
-
-do_error:
-	err = -EPIPE;
-	goto out;
-do_nonblock:
-	err = -EAGAIN;
-	goto out;
-do_interrupted:
-	err = sock_intr_errno(*timeo);
-	goto out;
-}
-
-static inline int can_coalesce(struct sk_buff *skb, int i, struct page *page,
-			       int off)
-{
-	if (i) {
-		skb_frag_t *frag = &skb_shinfo(skb)->frags[i - 1];
-		return page == frag->page &&
-		       off == frag->page_offset + frag->size;
-	}
-	return 0;
-}
-
-static inline void fill_page_desc(struct sk_buff *skb, int i,
-				  struct page *page, int off, int size)
-{
-	skb_frag_t *frag = &skb_shinfo(skb)->frags[i];
-	frag->page = page;
-	frag->page_offset = off;
-	frag->size = size;
-	skb_shinfo(skb)->nr_frags = i + 1;
-}
-
 static inline void tcp_mark_push(struct tcp_opt *tp, struct sk_buff *skb)
 {
 	TCP_SKB_CB(skb)->flags |= TCPCB_FLAG_PSH;
@@ -796,9 +600,9 @@ static inline void skb_entail(struct sock *sk, struct tcp_opt *tp,
 	TCP_SKB_CB(skb)->flags = TCPCB_FLAG_ACK;
 	TCP_SKB_CB(skb)->sacked = 0;
 	__skb_queue_tail(&sk->sk_write_queue, skb);
-	tcp_charge_skb(sk, skb);
-	if (!tp->send_head)
-		tp->send_head = skb;
+	sk_charge_skb(sk, skb);
+	if (!sk->sk_send_head)
+		sk->sk_send_head = skb;
 	else if (tp->nonagle&TCP_NAGLE_PUSH)
 		tp->nonagle &= ~TCP_NAGLE_PUSH; 
 }
@@ -816,7 +620,7 @@ static inline void tcp_mark_urg(struct tcp_opt *tp, int flags,
 static inline void tcp_push(struct sock *sk, struct tcp_opt *tp, int flags,
 			    int mss_now, int nonagle)
 {
-	if (tp->send_head) {
+	if (sk->sk_send_head) {
 		struct sk_buff *skb = sk->sk_write_queue.prev;
 		if (!(flags & MSG_MORE) || forced_push(tp))
 			tcp_mark_push(tp, skb);
@@ -826,15 +630,6 @@ static inline void tcp_push(struct sock *sk, struct tcp_opt *tp, int flags,
 	}
 }
 
-static int tcp_error(struct sock *sk, int flags, int err)
-{
-	if (err == -EPIPE)
-		err = sock_error(sk) ? : -EPIPE;
-	if (err == -EPIPE && !(flags & MSG_NOSIGNAL))
-		send_sig(SIGPIPE, current, 0);
-	return err;
-}
-
 static ssize_t do_tcp_sendpages(struct sock *sk, struct page **pages, int poffset,
 			 size_t psize, int flags)
 {
@@ -846,7 +641,7 @@ static ssize_t do_tcp_sendpages(struct sock *sk, struct page **pages, int poffse
 
 	/* Wait for a connection to finish. */
 	if ((1 << sk->sk_state) & ~(TCPF_ESTABLISHED | TCPF_CLOSE_WAIT))
-		if ((err = wait_for_tcp_connect(sk, 0, &timeo)) != 0)
+		if ((err = sk_stream_wait_connect(sk, &timeo)) != 0)
 			goto out_err;
 
 	clear_bit(SOCK_ASYNC_NOSPACE, &sk->sk_socket->flags);
@@ -865,13 +660,13 @@ static ssize_t do_tcp_sendpages(struct sock *sk, struct page **pages, int poffse
 		int offset = poffset % PAGE_SIZE;
 		int size = min_t(size_t, psize, PAGE_SIZE - offset);
 
-		if (!tp->send_head || (copy = mss_now - skb->len) <= 0) {
+		if (!sk->sk_send_head || (copy = mss_now - skb->len) <= 0) {
 new_segment:
-			if (!tcp_memory_free(sk))
+			if (!sk_stream_memory_free(sk))
 				goto wait_for_sndbuf;
 
-			skb = tcp_alloc_pskb(sk, 0, tp->mss_cache,
-					     sk->sk_allocation);
+			skb = sk_stream_alloc_pskb(sk, 0, tp->mss_cache,
+						   sk->sk_allocation);
 			if (!skb)
 				goto wait_for_memory;
 
@@ -883,11 +678,11 @@ new_segment:
 			copy = size;
 
 		i = skb_shinfo(skb)->nr_frags;
-		if (can_coalesce(skb, i, page, offset)) {
+		if (skb_can_coalesce(skb, i, page, offset)) {
 			skb_shinfo(skb)->frags[i - 1].size += copy;
 		} else if (i < MAX_SKB_FRAGS) {
 			get_page(page);
-			fill_page_desc(skb, i, page, offset, copy);
+			skb_fill_page_desc(skb, i, page, offset, copy);
 		} else {
 			tcp_mark_push(tp, skb);
 			goto new_segment;
@@ -913,7 +708,7 @@ new_segment:
 		if (forced_push(tp)) {
 			tcp_mark_push(tp, skb);
 			__tcp_push_pending_frames(sk, tp, mss_now, TCP_NAGLE_PUSH);
-		} else if (skb == tp->send_head)
+		} else if (skb == sk->sk_send_head)
 			tcp_push_one(sk, mss_now);
 		continue;
 
@@ -923,7 +718,7 @@ wait_for_memory:
 		if (copied)
 			tcp_push(sk, tp, flags & ~MSG_MORE, mss_now, TCP_NAGLE_PUSH);
 
-		if ((err = wait_for_tcp_memory(sk, &timeo)) != 0)
+		if ((err = sk_stream_wait_memory(sk, &timeo)) != 0)
 			goto do_error;
 
 		mss_now = tcp_current_mss(sk, !(flags&MSG_OOB));
@@ -938,7 +733,7 @@ do_error:
 	if (copied)
 		goto out;
 out_err:
-	return tcp_error(sk, flags, err);
+	return sk_stream_error(sk, flags, err);
 }
 
 ssize_t tcp_sendpage(struct socket *sock, struct page *page, int offset,
@@ -963,55 +758,8 @@ ssize_t tcp_sendpage(struct socket *sock, struct page *page, int offset,
 	return res;
 }
 
-#define TCP_PAGE(sk)	(inet_sk(sk)->sndmsg_page)
-#define TCP_OFF(sk)	(inet_sk(sk)->sndmsg_off)
-
-static inline int tcp_copy_to_page(struct sock *sk, char __user *from,
-				   struct sk_buff *skb, struct page *page,
-				   int off, int copy)
-{
-	int err = 0;
-	unsigned int csum;
-
-	if (skb->ip_summed == CHECKSUM_NONE) {
-		csum = csum_and_copy_from_user(from, page_address(page) + off,
-				       copy, 0, &err);
-		if (err) return err;
-		skb->csum = csum_block_add(skb->csum, csum, skb->len);
-	} else {
-		if (copy_from_user(page_address(page) + off, from, copy))
-			return -EFAULT;
-	}
-
-	skb->len += copy;
-	skb->data_len += copy;
-	skb->truesize += copy;
-	sk->sk_wmem_queued += copy;
-	sk->sk_forward_alloc -= copy;
-	return 0;
-}
-
-static inline int skb_add_data(struct sk_buff *skb, char __user *from, int copy)
-{
-	int err = 0;
-	unsigned int csum;
-	int off = skb->len;
-
-	if (skb->ip_summed == CHECKSUM_NONE) {
-		csum = csum_and_copy_from_user(from, skb_put(skb, copy),
-				       copy, 0, &err);
-		if (!err) {
-			skb->csum = csum_block_add(skb->csum, csum, off);
-			return 0;
-		}
-	} else {
-		if (!copy_from_user(skb_put(skb, copy), from, copy))
-			return 0;
-	}
-
-	__skb_trim(skb, off);
-	return -EFAULT;
-}
+#define TCP_PAGE(sk)	(sk->sk_sndmsg_page)
+#define TCP_OFF(sk)	(sk->sk_sndmsg_off)
 
 static inline int select_size(struct sock *sk, struct tcp_opt *tp)
 {
@@ -1046,7 +794,7 @@ int tcp_sendmsg(struct kiocb *iocb, struct sock *sk, struct msghdr *msg,
 
 	/* Wait for a connection to finish. */
 	if ((1 << sk->sk_state) & ~(TCPF_ESTABLISHED | TCPF_CLOSE_WAIT))
-		if ((err = wait_for_tcp_connect(sk, flags, &timeo)) != 0)
+		if ((err = sk_stream_wait_connect(sk, &timeo)) != 0)
 			goto out_err;
 
 	/* This should be in poll */
@@ -1074,18 +822,18 @@ int tcp_sendmsg(struct kiocb *iocb, struct sock *sk, struct msghdr *msg,
 
 			skb = sk->sk_write_queue.prev;
 
-			if (!tp->send_head ||
+			if (!sk->sk_send_head ||
 			    (copy = mss_now - skb->len) <= 0) {
 
 new_segment:
 				/* Allocate new segment. If the interface is SG,
 				 * allocate skb fitting to single page.
 				 */
-				if (!tcp_memory_free(sk))
+				if (!sk_stream_memory_free(sk))
 					goto wait_for_sndbuf;
 
-				skb = tcp_alloc_pskb(sk, select_size(sk, tp),
-						     0, sk->sk_allocation);
+				skb = sk_stream_alloc_pskb(sk, select_size(sk, tp),
+							   0, sk->sk_allocation);
 				if (!skb)
 					goto wait_for_memory;
 
@@ -1118,7 +866,7 @@ new_segment:
 				struct page *page = TCP_PAGE(sk);
 				int off = TCP_OFF(sk);
 
-				if (can_coalesce(skb, i, page, off) &&
+				if (skb_can_coalesce(skb, i, page, off) &&
 				    off != PAGE_SIZE) {
 					/* We can extend the last page
 					 * fragment. */
@@ -1146,7 +894,7 @@ new_segment:
 
 				if (!page) {
 					/* Allocate new cache page. */
-					if (!(page = tcp_alloc_page(sk)))
+					if (!(page = sk_stream_alloc_page(sk)))
 						goto wait_for_memory;
 					off = 0;
 				}
@@ -1156,7 +904,7 @@ new_segment:
 
 				/* Time to copy data. We are close to
 				 * the end! */
-				err = tcp_copy_to_page(sk, from, skb, page,
+				err = skb_copy_to_page(sk, from, skb, page,
 						       off, copy);
 				if (err) {
 					/* If this page was new, give it to the
@@ -1174,7 +922,7 @@ new_segment:
 					skb_shinfo(skb)->frags[i - 1].size +=
 									copy;
 				} else {
-					fill_page_desc(skb, i, page, off, copy);
+					skb_fill_page_desc(skb, i, page, off, copy);
 					if (TCP_PAGE(sk)) {
 						get_page(page);
 					} else if (off + copy < PAGE_SIZE) {
@@ -1203,7 +951,7 @@ new_segment:
 			if (forced_push(tp)) {
 				tcp_mark_push(tp, skb);
 				__tcp_push_pending_frames(sk, tp, mss_now, TCP_NAGLE_PUSH);
-			} else if (skb == tp->send_head)
+			} else if (skb == sk->sk_send_head)
 				tcp_push_one(sk, mss_now);
 			continue;
 
@@ -1213,7 +961,7 @@ wait_for_memory:
 			if (copied)
 				tcp_push(sk, tp, flags & ~MSG_MORE, mss_now, TCP_NAGLE_PUSH);
 
-			if ((err = wait_for_tcp_memory(sk, &timeo)) != 0)
+			if ((err = sk_stream_wait_memory(sk, &timeo)) != 0)
 				goto do_error;
 
 			mss_now = tcp_current_mss(sk, !(flags&MSG_OOB));
@@ -1229,17 +977,17 @@ out:
 
 do_fault:
 	if (!skb->len) {
-		if (tp->send_head == skb)
-			tp->send_head = NULL;
+		if (sk->sk_send_head == skb)
+			sk->sk_send_head = NULL;
 		__skb_unlink(skb, skb->list);
-		tcp_free_skb(sk, skb);
+		sk_stream_free_skb(sk, skb);
 	}
 
 do_error:
 	if (copied)
 		goto out;
 out_err:
-	err = tcp_error(sk, flags, err);
+	err = sk_stream_error(sk, flags, err);
 	TCP_CHECK_TIMER(sk);
 	release_sock(sk);
 	return err;
@@ -1361,7 +1109,7 @@ static void tcp_prequeue_process(struct sock *sk)
 	struct sk_buff *skb;
 	struct tcp_opt *tp = tcp_sk(sk);
 
-	NET_ADD_STATS_USER(TCPPrequeued, skb_queue_len(&tp->ucopy.prequeue));
+	NET_ADD_STATS_USER(LINUX_MIB_TCPPREQUEUED, skb_queue_len(&tp->ucopy.prequeue));
 
 	/* RX process wants to run with disabled BHs, though it is not
 	 * necessary */
@@ -1644,7 +1392,7 @@ int tcp_recvmsg(struct kiocb *iocb, struct sock *sk, struct msghdr *msg,
 			/* __ Restore normal policy in scheduler __ */
 
 			if ((chunk = len - tp->ucopy.len) != 0) {
-				NET_ADD_STATS_USER(TCPDirectCopyFromBacklog, chunk);
+				NET_ADD_STATS_USER(LINUX_MIB_TCPDIRECTCOPYFROMBACKLOG, chunk);
 				len -= chunk;
 				copied += chunk;
 			}
@@ -1655,7 +1403,7 @@ do_prequeue:
 				tcp_prequeue_process(sk);
 
 				if ((chunk = len - tp->ucopy.len) != 0) {
-					NET_ADD_STATS_USER(TCPDirectCopyFromPrequeue, chunk);
+					NET_ADD_STATS_USER(LINUX_MIB_TCPDIRECTCOPYFROMPREQUEUE, chunk);
 					len -= chunk;
 					copied += chunk;
 				}
@@ -1740,7 +1488,7 @@ skip_copy:
 			tcp_prequeue_process(sk);
 
 			if (copied > 0 && (chunk = len - tp->ucopy.len) != 0) {
-				NET_ADD_STATS_USER(TCPDirectCopyFromPrequeue, chunk);
+				NET_ADD_STATS_USER(LINUX_MIB_TCPDIRECTCOPYFROMPREQUEUE, chunk);
 				len -= chunk;
 				copied += chunk;
 			}
@@ -1828,40 +1576,6 @@ void tcp_shutdown(struct sock *sk, int how)
 	}
 }
 
-
-/*
- *	Return 1 if we still have things to send in our buffers.
- */
-
-static inline int closing(struct sock *sk)
-{
-	return (1 << sk->sk_state) &
-	       (TCPF_FIN_WAIT1 | TCPF_CLOSING | TCPF_LAST_ACK);
-}
-
-static __inline__ void tcp_kill_sk_queues(struct sock *sk)
-{
-	/* First the read buffer. */
-	__skb_queue_purge(&sk->sk_receive_queue);
-
-	/* Next, the error queue. */
-	__skb_queue_purge(&sk->sk_error_queue);
-
-	/* Next, the write queue. */
-	BUG_TRAP(skb_queue_empty(&sk->sk_write_queue));
-
-	/* Account for returned memory. */
-	tcp_mem_reclaim(sk);
-
-	BUG_TRAP(!sk->sk_wmem_queued);
-	BUG_TRAP(!sk->sk_forward_alloc);
-
-	/* It is _impossible_ for the backlog to contain anything
-	 * when we get here.  All user references to this socket
-	 * have gone away, only the net layer knows can touch it.
-	 */
-}
-
 /*
  * At this point, there should be no process reference to this
  * socket, and thus no user references at all.  Therefore we
@@ -1889,7 +1603,7 @@ void tcp_destroy_sock(struct sock *sk)
 
 	sk->sk_prot->destroy(sk);
 
-	tcp_kill_sk_queues(sk);
+	sk_stream_kill_queues(sk);
 
 	xfrm_sk_free_policy(sk);
 
@@ -1932,7 +1646,7 @@ void tcp_close(struct sock *sk, long timeout)
 		__kfree_skb(skb);
 	}
 
-	tcp_mem_reclaim(sk);
+	sk_stream_mem_reclaim(sk);
 
 	/* As outlined in draft-ietf-tcpimpl-prob-03.txt, section
 	 * 3.10, we send a RST here because data was lost.  To
@@ -1945,13 +1659,13 @@ void tcp_close(struct sock *sk, long timeout)
 	 */
 	if (data_was_unread) {
 		/* Unread data was tossed, zap the connection. */
-		NET_INC_STATS_USER(TCPAbortOnClose);
+		NET_INC_STATS_USER(LINUX_MIB_TCPABORTONCLOSE);
 		tcp_set_state(sk, TCP_CLOSE);
 		tcp_send_active_reset(sk, GFP_KERNEL);
 	} else if (sock_flag(sk, SOCK_LINGER) && !sk->sk_lingertime) {
 		/* Check zero linger _after_ checking for unread data. */
 		sk->sk_prot->disconnect(sk, 0);
-		NET_INC_STATS_USER(TCPAbortOnData);
+		NET_INC_STATS_USER(LINUX_MIB_TCPABORTONDATA);
 	} else if (tcp_close_state(sk)) {
 		/* We FIN if the application ate all the data before
 		 * zapping the connection.
@@ -1981,22 +1695,7 @@ void tcp_close(struct sock *sk, long timeout)
 		tcp_send_fin(sk);
 	}
 
-	if (timeout) {
-		struct task_struct *tsk = current;
-		DEFINE_WAIT(wait);
-
-		do {
-			prepare_to_wait(sk->sk_sleep, &wait,
-					TASK_INTERRUPTIBLE);
-			if (!closing(sk))
-				break;
-			release_sock(sk);
-			timeout = schedule_timeout(timeout);
-			lock_sock(sk);
-		} while (!signal_pending(tsk) && timeout);
-
-		finish_wait(sk->sk_sleep, &wait);
-	}
+	sk_stream_wait_close(sk, timeout);
 
 adjudge_to_death:
 	/* It is the last release_sock in its life. It will remove backlog. */
@@ -2032,7 +1731,7 @@ adjudge_to_death:
 		if (tp->linger2 < 0) {
 			tcp_set_state(sk, TCP_CLOSE);
 			tcp_send_active_reset(sk, GFP_ATOMIC);
-			NET_INC_STATS_BH(TCPAbortOnLinger);
+			NET_INC_STATS_BH(LINUX_MIB_TCPABORTONLINGER);
 		} else {
 			int tmo = tcp_fin_time(tp);
 
@@ -2046,7 +1745,7 @@ adjudge_to_death:
 		}
 	}
 	if (sk->sk_state != TCP_CLOSE) {
-		tcp_mem_reclaim(sk);
+		sk_stream_mem_reclaim(sk);
 		if (atomic_read(&tcp_orphan_count) > sysctl_tcp_max_orphans ||
 		    (sk->sk_wmem_queued > SOCK_MIN_SNDBUF &&
 		     atomic_read(&tcp_memory_allocated) > sysctl_tcp_mem[2])) {
@@ -2055,7 +1754,7 @@ adjudge_to_death:
 				       "sockets\n");
 			tcp_set_state(sk, TCP_CLOSE);
 			tcp_send_active_reset(sk, GFP_ATOMIC);
-			NET_INC_STATS_BH(TCPAbortOnMemory);
+			NET_INC_STATS_BH(LINUX_MIB_TCPABORTONMEMORY);
 		}
 	}
 	atomic_inc(&tcp_orphan_count);
@@ -2105,7 +1804,7 @@ int tcp_disconnect(struct sock *sk, int flags)
 
 	tcp_clear_xmit_timers(sk);
 	__skb_queue_purge(&sk->sk_receive_queue);
-	tcp_writequeue_purge(sk);
+	sk_stream_writequeue_purge(sk);
 	__skb_queue_purge(&tp->out_of_order_queue);
 
 	inet->dport = 0;
@@ -2127,7 +1826,7 @@ int tcp_disconnect(struct sock *sk, int flags)
 	tcp_set_ca_state(tp, TCP_CA_Open);
 	tcp_clear_retrans(tp);
 	tcp_delack_init(tp);
-	tp->send_head = NULL;
+	sk->sk_send_head = NULL;
 	tp->saw_tstamp = 0;
 	tcp_sack_reset(tp);
 	__sk_dst_reset(sk);
@@ -2614,9 +2313,6 @@ void __init tcp_init(void)
 	tcpdiag_init();
 }
 
-EXPORT_SYMBOL(__tcp_mem_reclaim);
-EXPORT_SYMBOL(sysctl_tcp_rmem);
-EXPORT_SYMBOL(sysctl_tcp_wmem);
 EXPORT_SYMBOL(tcp_accept);
 EXPORT_SYMBOL(tcp_close);
 EXPORT_SYMBOL(tcp_close_state);
@@ -2632,7 +2328,5 @@ EXPORT_SYMBOL(tcp_sendmsg);
 EXPORT_SYMBOL(tcp_sendpage);
 EXPORT_SYMBOL(tcp_setsockopt);
 EXPORT_SYMBOL(tcp_shutdown);
-EXPORT_SYMBOL(tcp_sockets_allocated);
 EXPORT_SYMBOL(tcp_statistics);
 EXPORT_SYMBOL(tcp_timewait_cachep);
-EXPORT_SYMBOL(tcp_write_space);
diff --git a/net/ipv4/tcp_input.c b/net/ipv4/tcp_input.c
index c0a0b65f5..5e7f70f1c 100644
--- a/net/ipv4/tcp_input.c
+++ b/net/ipv4/tcp_input.c
@@ -90,7 +90,7 @@ int sysctl_tcp_nometrics_save;
 int sysctl_tcp_westwood;
 int sysctl_tcp_vegas_cong_avoid;
 
-int sysctl_tcp_moderate_rcvbuf;
+int sysctl_tcp_moderate_rcvbuf = 1;
 
 /* Default values of the Vegas variables, in fixed-point representation
  * with V_PARAM_SHIFT bits to the right of the binary point.
@@ -99,7 +99,7 @@ int sysctl_tcp_moderate_rcvbuf;
 int sysctl_tcp_vegas_alpha = 1<<V_PARAM_SHIFT;
 int sysctl_tcp_vegas_beta  = 3<<V_PARAM_SHIFT;
 int sysctl_tcp_vegas_gamma = 1<<V_PARAM_SHIFT;
-int sysctl_tcp_bic;
+int sysctl_tcp_bic = 1;
 int sysctl_tcp_bic_fast_convergence = 1;
 int sysctl_tcp_bic_low_window = 14;
 
@@ -330,6 +330,15 @@ static void tcp_init_buffer_space(struct sock *sk)
 	tp->snd_cwnd_stamp = tcp_time_stamp;
 }
 
+static void init_bictcp(struct tcp_opt *tp)
+{
+	tp->bictcp.cnt = 0;
+
+	tp->bictcp.last_max_cwnd = 0;
+	tp->bictcp.last_cwnd = 0;
+	tp->bictcp.last_stamp = 0;
+}
+
 /* 5. Recalculate window clamp after socket hit its memory bounds. */
 static void tcp_clamp_window(struct sock *sk, struct tcp_opt *tp)
 {
@@ -535,7 +544,7 @@ static void tcp_event_data_recv(struct sock *sk, struct tcp_opt *tp, struct sk_b
 			 * restart window, so that we send ACKs quickly.
 			 */
 			tcp_incr_quickack(tp);
-			tcp_mem_reclaim(sk);
+			sk_stream_mem_reclaim(sk);
 		}
 	}
 	tp->ack.lrcvtime = now;
@@ -876,13 +885,13 @@ static void tcp_update_reordering(struct tcp_opt *tp, int metric, int ts)
 
 		/* This exciting event is worth to be remembered. 8) */
 		if (ts)
-			NET_INC_STATS_BH(TCPTSReorder);
+			NET_INC_STATS_BH(LINUX_MIB_TCPTSREORDER);
 		else if (IsReno(tp))
-			NET_INC_STATS_BH(TCPRenoReorder);
+			NET_INC_STATS_BH(LINUX_MIB_TCPRENOREORDER);
 		else if (IsFack(tp))
-			NET_INC_STATS_BH(TCPFACKReorder);
+			NET_INC_STATS_BH(LINUX_MIB_TCPFACKREORDER);
 		else
-			NET_INC_STATS_BH(TCPSACKReorder);
+			NET_INC_STATS_BH(LINUX_MIB_TCPSACKREORDER);
 #if FASTRETRANS_DEBUG > 1
 		printk(KERN_DEBUG "Disorder%d %d %u f%u s%u rr%d\n",
 		       tp->sack_ok, tp->ca_state,
@@ -981,13 +990,13 @@ tcp_sacktag_write_queue(struct sock *sk, struct sk_buff *ack_skb, u32 prior_snd_
 			if (before(start_seq, ack)) {
 				dup_sack = 1;
 				tp->sack_ok |= 4;
-				NET_INC_STATS_BH(TCPDSACKRecv);
+				NET_INC_STATS_BH(LINUX_MIB_TCPDSACKRECV);
 			} else if (num_sacks > 1 &&
 				   !after(end_seq, ntohl(sp[1].end_seq)) &&
 				   !before(start_seq, ntohl(sp[1].start_seq))) {
 				dup_sack = 1;
 				tp->sack_ok |= 4;
-				NET_INC_STATS_BH(TCPDSACKOfoRecv);
+				NET_INC_STATS_BH(LINUX_MIB_TCPDSACKOFORECV);
 			}
 
 			/* D-SACK for already forgotten data...
@@ -1009,7 +1018,7 @@ tcp_sacktag_write_queue(struct sock *sk, struct sk_buff *ack_skb, u32 prior_snd_
 		if (after(end_seq, tp->high_seq))
 			flag |= FLAG_DATA_LOST;
 
-		for_retrans_queue(skb, sk, tp) {
+		sk_stream_for_retrans_queue(skb, sk) {
 			u8 sacked = TCP_SKB_CB(skb)->sacked;
 			int in_sack;
 
@@ -1113,7 +1122,7 @@ tcp_sacktag_write_queue(struct sock *sk, struct sk_buff *ack_skb, u32 prior_snd_
 	if (lost_retrans && tp->ca_state == TCP_CA_Recovery) {
 		struct sk_buff *skb;
 
-		for_retrans_queue(skb, sk, tp) {
+		sk_stream_for_retrans_queue(skb, sk) {
 			if (after(TCP_SKB_CB(skb)->seq, lost_retrans))
 				break;
 			if (!after(TCP_SKB_CB(skb)->end_seq, tp->snd_una))
@@ -1131,7 +1140,7 @@ tcp_sacktag_write_queue(struct sock *sk, struct sk_buff *ack_skb, u32 prior_snd_
 					tp->lost_out++;
 					TCP_SKB_CB(skb)->sacked |= TCPCB_LOST;
 					flag |= FLAG_DATA_SACKED;
-					NET_INC_STATS_BH(TCPLostRetransmit);
+					NET_INC_STATS_BH(LINUX_MIB_TCPLOSTRETRANSMIT);
 				}
 			}
 		}
@@ -1179,7 +1188,7 @@ void tcp_enter_frto(struct sock *sk)
 	tp->undo_marker = tp->snd_una;
 	tp->undo_retrans = 0;
 
-	for_retrans_queue(skb, sk, tp) {
+	sk_stream_for_retrans_queue(skb, sk) {
 		TCP_SKB_CB(skb)->sacked &= ~TCPCB_RETRANS;
 	}
 	tcp_sync_left_out(tp);
@@ -1202,7 +1211,7 @@ static void tcp_enter_frto_loss(struct sock *sk)
 	tp->lost_out = 0;
 	tp->fackets_out = 0;
 
-	for_retrans_queue(skb, sk, tp) {
+	sk_stream_for_retrans_queue(skb, sk) {
 		cnt++;
 		TCP_SKB_CB(skb)->sacked &= ~TCPCB_LOST;
 		if (!(TCP_SKB_CB(skb)->sacked&TCPCB_SACKED_ACKED)) {
@@ -1233,6 +1242,8 @@ static void tcp_enter_frto_loss(struct sock *sk)
 	tcp_set_ca_state(tp, TCP_CA_Loss);
 	tp->high_seq = tp->frto_highmark;
 	TCP_ECN_queue_cwr(tp);
+
+	init_bictcp(tp);
 }
 
 void tcp_clear_retrans(struct tcp_opt *tp)
@@ -1275,7 +1286,7 @@ void tcp_enter_loss(struct sock *sk, int how)
 	if (!how)
 		tp->undo_marker = tp->snd_una;
 
-	for_retrans_queue(skb, sk, tp) {
+	sk_stream_for_retrans_queue(skb, sk) {
 		cnt++;
 		if (TCP_SKB_CB(skb)->sacked&TCPCB_RETRANS)
 			tp->undo_marker = 0;
@@ -1310,7 +1321,7 @@ static int tcp_check_sack_reneging(struct sock *sk, struct tcp_opt *tp)
 	 */
 	if ((skb = skb_peek(&sk->sk_write_queue)) != NULL &&
 	    (TCP_SKB_CB(skb)->sacked & TCPCB_SACKED_ACKED)) {
-		NET_INC_STATS_BH(TCPSACKReneging);
+		NET_INC_STATS_BH(LINUX_MIB_TCPSACKRENEGING);
 
 		tcp_enter_loss(sk, 1);
 		tp->retransmits++;
@@ -1518,7 +1529,7 @@ tcp_mark_head_lost(struct sock *sk, struct tcp_opt *tp, int packets, u32 high_se
 
 	BUG_TRAP(cnt <= tp->packets_out);
 
-	for_retrans_queue(skb, sk, tp) {
+	sk_stream_for_retrans_queue(skb, sk) {
 		if (--cnt < 0 || after(TCP_SKB_CB(skb)->end_seq, high_seq))
 			break;
 		if (!(TCP_SKB_CB(skb)->sacked&TCPCB_TAGBITS)) {
@@ -1550,7 +1561,7 @@ static void tcp_update_scoreboard(struct sock *sk, struct tcp_opt *tp)
 	if (tcp_head_timedout(sk, tp)) {
 		struct sk_buff *skb;
 
-		for_retrans_queue(skb, sk, tp) {
+		sk_stream_for_retrans_queue(skb, sk) {
 			if (tcp_skb_timedout(tp, skb) &&
 			    !(TCP_SKB_CB(skb)->sacked&TCPCB_TAGBITS)) {
 				TCP_SKB_CB(skb)->sacked |= TCPCB_LOST;
@@ -1658,9 +1669,9 @@ static int tcp_try_undo_recovery(struct sock *sk, struct tcp_opt *tp)
 		DBGUNDO(sk, tp, tp->ca_state == TCP_CA_Loss ? "loss" : "retrans");
 		tcp_undo_cwr(tp, 1);
 		if (tp->ca_state == TCP_CA_Loss)
-			NET_INC_STATS_BH(TCPLossUndo);
+			NET_INC_STATS_BH(LINUX_MIB_TCPLOSSUNDO);
 		else
-			NET_INC_STATS_BH(TCPFullUndo);
+			NET_INC_STATS_BH(LINUX_MIB_TCPFULLUNDO);
 		tp->undo_marker = 0;
 	}
 	if (tp->snd_una == tp->high_seq && IsReno(tp)) {
@@ -1681,7 +1692,7 @@ static void tcp_try_undo_dsack(struct sock *sk, struct tcp_opt *tp)
 		DBGUNDO(sk, tp, "D-SACK");
 		tcp_undo_cwr(tp, 1);
 		tp->undo_marker = 0;
-		NET_INC_STATS_BH(TCPDSACKUndo);
+		NET_INC_STATS_BH(LINUX_MIB_TCPDSACKUNDO);
 	}
 }
 
@@ -1703,7 +1714,7 @@ static int tcp_try_undo_partial(struct sock *sk, struct tcp_opt *tp, int acked)
 
 		DBGUNDO(sk, tp, "Hoe");
 		tcp_undo_cwr(tp, 0);
-		NET_INC_STATS_BH(TCPPartialUndo);
+		NET_INC_STATS_BH(LINUX_MIB_TCPPARTIALUNDO);
 
 		/* So... Do not make Hoe's retransmit yet.
 		 * If the first packet was delayed, the rest
@@ -1719,14 +1730,14 @@ static int tcp_try_undo_loss(struct sock *sk, struct tcp_opt *tp)
 {
 	if (tcp_may_undo(tp)) {
 		struct sk_buff *skb;
-		for_retrans_queue(skb, sk, tp) {
+		sk_stream_for_retrans_queue(skb, sk) {
 			TCP_SKB_CB(skb)->sacked &= ~TCPCB_LOST;
 		}
 		DBGUNDO(sk, tp, "partial loss");
 		tp->lost_out = 0;
 		tp->left_out = tp->sacked_out;
 		tcp_undo_cwr(tp, 1);
-		NET_INC_STATS_BH(TCPLossUndo);
+		NET_INC_STATS_BH(LINUX_MIB_TCPLOSSUNDO);
 		tp->retransmits = 0;
 		tp->undo_marker = 0;
 		if (!IsReno(tp))
@@ -1814,7 +1825,7 @@ tcp_fastretrans_alert(struct sock *sk, u32 prior_snd_una,
 	    tp->ca_state != TCP_CA_Open &&
 	    tp->fackets_out > tp->reordering) {
 		tcp_mark_head_lost(sk, tp, tp->fackets_out-tp->reordering, tp->high_seq);
-		NET_INC_STATS_BH(TCPLoss);
+		NET_INC_STATS_BH(LINUX_MIB_TCPLOSS);
 	}
 
 	/* D. Synchronize left_out to current state. */
@@ -1907,9 +1918,9 @@ tcp_fastretrans_alert(struct sock *sk, u32 prior_snd_una,
 		/* Otherwise enter Recovery state */
 
 		if (IsReno(tp))
-			NET_INC_STATS_BH(TCPRenoRecovery);
+			NET_INC_STATS_BH(LINUX_MIB_TCPRENORECOVERY);
 		else
-			NET_INC_STATS_BH(TCPSackRecovery);
+			NET_INC_STATS_BH(LINUX_MIB_TCPSACKRECOVERY);
 
 		tp->high_seq = tp->snd_nxt;
 		tp->prior_ssthresh = 0;
@@ -2011,10 +2022,12 @@ static inline __u32 bictcp_cwnd(struct tcp_opt *tp)
 	if (!sysctl_tcp_bic)
 		return tp->snd_cwnd;
 
-	if (tp->bictcp.last_cwnd == tp->snd_cwnd)
-		return tp->bictcp.cnt; /*  same cwnd, no update */
-      
+	if (tp->bictcp.last_cwnd == tp->snd_cwnd &&
+	   (s32)(tcp_time_stamp - tp->bictcp.last_stamp) <= (HZ>>5))
+		return tp->bictcp.cnt;
+
 	tp->bictcp.last_cwnd = tp->snd_cwnd;
+	tp->bictcp.last_stamp = tcp_time_stamp;
       
 	/* start off normal */
 	if (tp->snd_cwnd <= sysctl_tcp_bic_low_window)
@@ -2328,7 +2341,7 @@ static int tcp_clean_rtx_queue(struct sock *sk, __s32 *seq_rtt_p)
 	int acked = 0;
 	__s32 seq_rtt = -1;
 
-	while ((skb = skb_peek(&sk->sk_write_queue)) && skb != tp->send_head) {
+	while ((skb = skb_peek(&sk->sk_write_queue)) && skb != sk->sk_send_head) {
 		struct tcp_skb_cb *scb = TCP_SKB_CB(skb); 
 		__u8 sacked = scb->sacked;
 
@@ -2376,7 +2389,7 @@ static int tcp_clean_rtx_queue(struct sock *sk, __s32 *seq_rtt_p)
 			tp->fackets_out--;
 		tp->packets_out--;
 		__skb_unlink(skb, skb->list);
-		tcp_free_skb(sk, skb);
+		sk_stream_free_skb(sk, skb);
 	}
 
 	if (acked&FLAG_ACKED) {
@@ -2416,7 +2429,7 @@ static void tcp_ack_probe(struct sock *sk)
 
 	/* Was it a usable window open? */
 
-	if (!after(TCP_SKB_CB(tp->send_head)->end_seq,
+	if (!after(TCP_SKB_CB(sk->sk_send_head)->end_seq,
 		   tp->snd_una + tp->snd_wnd)) {
 		tp->backoff = 0;
 		tcp_clear_xmit_timer(sk, TCP_TIME_PROBE0);
@@ -2797,12 +2810,12 @@ static int tcp_ack(struct sock *sk, struct sk_buff *skb, int flag)
 		tcp_westwood_fast_bw(sk, skb);
 		flag |= FLAG_WIN_UPDATE;
 
-		NET_INC_STATS_BH(TCPHPAcks);
+		NET_INC_STATS_BH(LINUX_MIB_TCPHPACKS);
 	} else {
 		if (ack_seq != TCP_SKB_CB(skb)->end_seq)
 			flag |= FLAG_DATA;
 		else
-			NET_INC_STATS_BH(TCPPureAcks);
+			NET_INC_STATS_BH(LINUX_MIB_TCPPUREACKS);
 
 		flag |= tcp_ack_update_window(sk, tp, skb, ack, ack_seq);
 
@@ -2857,7 +2870,7 @@ no_queue:
 	 * being used to time the probes, and is probably far higher than
 	 * it needs to be for normal retransmission.
 	 */
-	if (tp->send_head)
+	if (sk->sk_send_head)
 		tcp_ack_probe(sk);
 	return 1;
 
@@ -3166,7 +3179,7 @@ static void tcp_fin(struct sk_buff *skb, struct sock *sk, struct tcphdr *th)
 	__skb_queue_purge(&tp->out_of_order_queue);
 	if (tp->sack_ok)
 		tcp_sack_reset(tp);
-	tcp_mem_reclaim(sk);
+	sk_stream_mem_reclaim(sk);
 
 	if (!sock_flag(sk, SOCK_DEAD)) {
 		sk->sk_state_change(sk);
@@ -3197,9 +3210,9 @@ static __inline__ void tcp_dsack_set(struct tcp_opt *tp, u32 seq, u32 end_seq)
 {
 	if (tp->sack_ok && sysctl_tcp_dsack) {
 		if (before(seq, tp->rcv_nxt))
-			NET_INC_STATS_BH(TCPDSACKOldSent);
+			NET_INC_STATS_BH(LINUX_MIB_TCPDSACKOLDSENT);
 		else
-			NET_INC_STATS_BH(TCPDSACKOfoSent);
+			NET_INC_STATS_BH(LINUX_MIB_TCPDSACKOFOSENT);
 
 		tp->dsack = 1;
 		tp->duplicate_sack[0].start_seq = seq;
@@ -3222,7 +3235,7 @@ static void tcp_send_dupack(struct sock *sk, struct sk_buff *skb)
 
 	if (TCP_SKB_CB(skb)->end_seq != TCP_SKB_CB(skb)->seq &&
 	    before(TCP_SKB_CB(skb)->seq, tp->rcv_nxt)) {
-		NET_INC_STATS_BH(DelayedACKLost);
+		NET_INC_STATS_BH(LINUX_MIB_DELAYEDACKLOST);
 		tcp_enter_quickack_mode(tp);
 
 		if (tp->sack_ok && sysctl_tcp_dsack) {
@@ -3398,12 +3411,6 @@ static void tcp_ofo_queue(struct sock *sk)
 	}
 }
 
-static inline int tcp_rmem_schedule(struct sock *sk, struct sk_buff *skb)
-{
-	return (int)skb->truesize <= sk->sk_forward_alloc ||
-		tcp_mem_schedule(sk, skb->truesize, 1);
-}
-
 static int tcp_prune_queue(struct sock *sk);
 
 static void tcp_data_queue(struct sock *sk, struct sk_buff *skb)
@@ -3457,11 +3464,12 @@ static void tcp_data_queue(struct sock *sk, struct sk_buff *skb)
 queue_and_out:
 			if (eaten < 0 &&
 			    (atomic_read(&sk->sk_rmem_alloc) > sk->sk_rcvbuf ||
-			     !tcp_rmem_schedule(sk, skb))) {
-				if (tcp_prune_queue(sk) < 0 || !tcp_rmem_schedule(sk, skb))
+			     !sk_stream_rmem_schedule(sk, skb))) {
+				if (tcp_prune_queue(sk) < 0 ||
+				    !sk_stream_rmem_schedule(sk, skb))
 					goto drop;
 			}
-			tcp_set_owner_r(skb, sk);
+			sk_stream_set_owner_r(skb, sk);
 			__skb_queue_tail(&sk->sk_receive_queue, skb);
 		}
 		tp->rcv_nxt = TCP_SKB_CB(skb)->end_seq;
@@ -3494,7 +3502,7 @@ queue_and_out:
 
 	if (!after(TCP_SKB_CB(skb)->end_seq, tp->rcv_nxt)) {
 		/* A retransmit, 2nd most common case.  Force an immediate ack. */
-		NET_INC_STATS_BH(DelayedACKLost);
+		NET_INC_STATS_BH(LINUX_MIB_DELAYEDACKLOST);
 		tcp_dsack_set(tp, TCP_SKB_CB(skb)->seq, TCP_SKB_CB(skb)->end_seq);
 
 out_of_window:
@@ -3530,8 +3538,9 @@ drop:
 	TCP_ECN_check_ce(tp, skb);
 
 	if (atomic_read(&sk->sk_rmem_alloc) > sk->sk_rcvbuf ||
-	    !tcp_rmem_schedule(sk, skb)) {
-		if (tcp_prune_queue(sk) < 0 || !tcp_rmem_schedule(sk, skb))
+	    !sk_stream_rmem_schedule(sk, skb)) {
+		if (tcp_prune_queue(sk) < 0 ||
+		    !sk_stream_rmem_schedule(sk, skb))
 			goto drop;
 	}
 
@@ -3542,7 +3551,7 @@ drop:
 	SOCK_DEBUG(sk, "out of order segment: rcv_next %X seq %X - %X\n",
 		   tp->rcv_nxt, TCP_SKB_CB(skb)->seq, TCP_SKB_CB(skb)->end_seq);
 
-	tcp_set_owner_r(skb, sk);
+	sk_stream_set_owner_r(skb, sk);
 
 	if (!skb_peek(&tp->out_of_order_queue)) {
 		/* Initial out of order segment, build 1 SACK. */
@@ -3635,7 +3644,7 @@ tcp_collapse(struct sock *sk, struct sk_buff *head,
 			struct sk_buff *next = skb->next;
 			__skb_unlink(skb, skb->list);
 			__kfree_skb(skb);
-			NET_INC_STATS_BH(TCPRcvCollapsed);
+			NET_INC_STATS_BH(LINUX_MIB_TCPRCVCOLLAPSED);
 			skb = next;
 			continue;
 		}
@@ -3681,7 +3690,7 @@ tcp_collapse(struct sock *sk, struct sk_buff *head,
 		memcpy(nskb->cb, skb->cb, sizeof(skb->cb));
 		TCP_SKB_CB(nskb)->seq = TCP_SKB_CB(nskb)->end_seq = start;
 		__skb_insert(nskb, skb->prev, skb, skb->list);
-		tcp_set_owner_r(nskb, sk);
+		sk_stream_set_owner_r(nskb, sk);
 
 		/* Copy data, releasing collapsed skbs. */
 		while (copy > 0) {
@@ -3701,7 +3710,7 @@ tcp_collapse(struct sock *sk, struct sk_buff *head,
 				struct sk_buff *next = skb->next;
 				__skb_unlink(skb, skb->list);
 				__kfree_skb(skb);
-				NET_INC_STATS_BH(TCPRcvCollapsed);
+				NET_INC_STATS_BH(LINUX_MIB_TCPRCVCOLLAPSED);
 				skb = next;
 				if (skb == tail || skb->h.th->syn || skb->h.th->fin)
 					return;
@@ -3764,7 +3773,7 @@ static int tcp_prune_queue(struct sock *sk)
 
 	SOCK_DEBUG(sk, "prune_queue: c=%x\n", tp->copied_seq);
 
-	NET_INC_STATS_BH(PruneCalled);
+	NET_INC_STATS_BH(LINUX_MIB_PRUNECALLED);
 
 	if (atomic_read(&sk->sk_rmem_alloc) >= sk->sk_rcvbuf)
 		tcp_clamp_window(sk, tp);
@@ -3775,7 +3784,7 @@ static int tcp_prune_queue(struct sock *sk)
 	tcp_collapse(sk, sk->sk_receive_queue.next,
 		     (struct sk_buff*)&sk->sk_receive_queue,
 		     tp->copied_seq, tp->rcv_nxt);
-	tcp_mem_reclaim(sk);
+	sk_stream_mem_reclaim(sk);
 
 	if (atomic_read(&sk->sk_rmem_alloc) <= sk->sk_rcvbuf)
 		return 0;
@@ -3785,7 +3794,7 @@ static int tcp_prune_queue(struct sock *sk)
 
 	/* First, purge the out_of_order queue. */
 	if (skb_queue_len(&tp->out_of_order_queue)) {
-		NET_ADD_STATS_BH(OfoPruned,
+		NET_ADD_STATS_BH(LINUX_MIB_OFOPRUNED, 
 				 skb_queue_len(&tp->out_of_order_queue));
 		__skb_queue_purge(&tp->out_of_order_queue);
 
@@ -3796,7 +3805,7 @@ static int tcp_prune_queue(struct sock *sk)
 		 */
 		if (tp->sack_ok)
 			tcp_sack_reset(tp);
-		tcp_mem_reclaim(sk);
+		sk_stream_mem_reclaim(sk);
 	}
 
 	if (atomic_read(&sk->sk_rmem_alloc) <= sk->sk_rcvbuf)
@@ -3806,7 +3815,7 @@ static int tcp_prune_queue(struct sock *sk)
 	 * drop receive data on the floor.  It will get retransmitted
 	 * and hopefully then we'll have sufficient space.
 	 */
-	NET_INC_STATS_BH(RcvPruned);
+	NET_INC_STATS_BH(LINUX_MIB_RCVPRUNED);
 
 	/* Massive buffer overcommit. */
 	tp->pred_flags = 0;
@@ -3837,7 +3846,7 @@ void tcp_cwnd_application_limited(struct sock *sk)
 
 
 /* When incoming ACK allowed to free some skb from write_queue,
- * we remember this event in flag tp->queue_shrunk and wake up socket
+ * we remember this event in flag sk->sk_queue_shrunk and wake up socket
  * on the exit from tcp input handler.
  *
  * PROBLEM: sndbuf expansion does not work well with largesend.
@@ -3865,10 +3874,8 @@ static void tcp_new_space(struct sock *sk)
 
 static inline void tcp_check_space(struct sock *sk)
 {
-	struct tcp_opt *tp = tcp_sk(sk);
-
-	if (tp->queue_shrunk) {
-		tp->queue_shrunk = 0;
+	if (sk->sk_queue_shrunk) {
+		sk->sk_queue_shrunk = 0;
 		if (sk->sk_socket &&
 		    test_bit(SOCK_NOSPACE, &sk->sk_socket->flags))
 			tcp_new_space(sk);
@@ -3887,8 +3894,7 @@ static void __tcp_data_snd_check(struct sock *sk, struct sk_buff *skb)
 
 static __inline__ void tcp_data_snd_check(struct sock *sk)
 {
-	struct tcp_opt *tp = tcp_sk(sk);
-	struct sk_buff *skb = tp->send_head;
+	struct sk_buff *skb = sk->sk_send_head;
 
 	if (skb != NULL)
 		__tcp_data_snd_check(sk, skb);
@@ -4188,7 +4194,7 @@ int tcp_rcv_established(struct sock *sk, struct sk_buff *skb,
 				tcp_data_snd_check(sk);
 				return 0;
 			} else { /* Header too small */
-				TCP_INC_STATS_BH(TcpInErrs);
+				TCP_INC_STATS_BH(TCP_MIB_INERRS);
 				goto discard;
 			}
 		} else {
@@ -4215,7 +4221,7 @@ int tcp_rcv_established(struct sock *sk, struct sk_buff *skb,
 
 					__skb_pull(skb, tcp_header_len);
 					tp->rcv_nxt = TCP_SKB_CB(skb)->end_seq;
-					NET_INC_STATS_BH(TCPHPHitsToUser);
+					NET_INC_STATS_BH(LINUX_MIB_TCPHPHITSTOUSER);
 					eaten = 1;
 				}
 			}
@@ -4237,12 +4243,12 @@ int tcp_rcv_established(struct sock *sk, struct sk_buff *skb,
 				if ((int)skb->truesize > sk->sk_forward_alloc)
 					goto step5;
 
-				NET_INC_STATS_BH(TCPHPHits);
+				NET_INC_STATS_BH(LINUX_MIB_TCPHPHITS);
 
 				/* Bulk data transfer: receiver */
 				__skb_pull(skb,tcp_header_len);
 				__skb_queue_tail(&sk->sk_receive_queue, skb);
-				tcp_set_owner_r(skb, sk);
+				sk_stream_set_owner_r(skb, sk);
 				tp->rcv_nxt = TCP_SKB_CB(skb)->end_seq;
 			}
 
@@ -4285,7 +4291,7 @@ slow_path:
 	if (tcp_fast_parse_options(skb, th, tp) && tp->saw_tstamp &&
 	    tcp_paws_discard(tp, skb)) {
 		if (!th->rst) {
-			NET_INC_STATS_BH(PAWSEstabRejected);
+			NET_INC_STATS_BH(LINUX_MIB_PAWSESTABREJECTED);
 			tcp_send_dupack(sk, skb);
 			goto discard;
 		}
@@ -4320,8 +4326,8 @@ slow_path:
 	tcp_replace_ts_recent(tp, TCP_SKB_CB(skb)->seq);
 
 	if (th->syn && !before(TCP_SKB_CB(skb)->seq, tp->rcv_nxt)) {
-		TCP_INC_STATS_BH(TcpInErrs);
-		NET_INC_STATS_BH(TCPAbortOnSyn);
+		TCP_INC_STATS_BH(TCP_MIB_INERRS);
+		NET_INC_STATS_BH(LINUX_MIB_TCPABORTONSYN);
 		tcp_reset(sk);
 		return 1;
 	}
@@ -4343,7 +4349,7 @@ step5:
 	return 0;
 
 csum_error:
-	TCP_INC_STATS_BH(TcpInErrs);
+	TCP_INC_STATS_BH(TCP_MIB_INERRS);
 
 discard:
 	__kfree_skb(skb);
@@ -4376,7 +4382,7 @@ static int tcp_rcv_synsent_state_process(struct sock *sk, struct sk_buff *skb,
 		if (tp->saw_tstamp && tp->rcv_tsecr &&
 		    !between(tp->rcv_tsecr, tp->retrans_stamp,
 			     tcp_time_stamp)) {
-			NET_INC_STATS_BH(PAWSActiveRejected);
+			NET_INC_STATS_BH(LINUX_MIB_PAWSACTIVEREJECTED);
 			goto reset_and_undo;
 		}
 
@@ -4482,7 +4488,7 @@ static int tcp_rcv_synsent_state_process(struct sock *sk, struct sk_buff *skb,
 			sk_wake_async(sk, 0, POLL_OUT);
 		}
 
-		if (tp->write_pending || tp->defer_accept || tp->ack.pingpong) {
+		if (sk->sk_write_pending || tp->defer_accept || tp->ack.pingpong) {
 			/* Save one ACK. Data will be ready after
 			 * several ticks, if write_pending is set.
 			 *
@@ -4619,6 +4625,7 @@ int tcp_rcv_state_process(struct sock *sk, struct sk_buff *skb,
 				return 1;
 
 			init_westwood(sk);
+			init_bictcp(tp);
 
 			/* Now we have several options: In theory there is 
 			 * nothing else in the frame. KA9Q has an option to 
@@ -4642,6 +4649,7 @@ int tcp_rcv_state_process(struct sock *sk, struct sk_buff *skb,
 
 	case TCP_SYN_SENT:
 		init_westwood(sk);
+		init_bictcp(tp);
 
 		queued = tcp_rcv_synsent_state_process(sk, skb, th, len);
 		if (queued >= 0)
@@ -4657,7 +4665,7 @@ int tcp_rcv_state_process(struct sock *sk, struct sk_buff *skb,
 	if (tcp_fast_parse_options(skb, th, tp) && tp->saw_tstamp &&
 	    tcp_paws_discard(tp, skb)) {
 		if (!th->rst) {
-			NET_INC_STATS_BH(PAWSEstabRejected);
+			NET_INC_STATS_BH(LINUX_MIB_PAWSESTABREJECTED);
 			tcp_send_dupack(sk, skb);
 			goto discard;
 		}
@@ -4686,7 +4694,7 @@ int tcp_rcv_state_process(struct sock *sk, struct sk_buff *skb,
 	 *	Check for a SYN in window.
 	 */
 	if (th->syn && !before(TCP_SKB_CB(skb)->seq, tp->rcv_nxt)) {
-		NET_INC_STATS_BH(TCPAbortOnSyn);
+		NET_INC_STATS_BH(LINUX_MIB_TCPABORTONSYN);
 		tcp_reset(sk);
 		return 1;
 	}
@@ -4765,7 +4773,7 @@ int tcp_rcv_state_process(struct sock *sk, struct sk_buff *skb,
 					    (TCP_SKB_CB(skb)->end_seq != TCP_SKB_CB(skb)->seq &&
 					     after(TCP_SKB_CB(skb)->end_seq - th->fin, tp->rcv_nxt))) {
 						tcp_done(sk);
-						NET_INC_STATS_BH(TCPAbortOnData);
+						NET_INC_STATS_BH(LINUX_MIB_TCPABORTONDATA);
 						return 1;
 					}
 
@@ -4825,7 +4833,7 @@ int tcp_rcv_state_process(struct sock *sk, struct sk_buff *skb,
 		if (sk->sk_shutdown & RCV_SHUTDOWN) {
 			if (TCP_SKB_CB(skb)->end_seq != TCP_SKB_CB(skb)->seq &&
 			    after(TCP_SKB_CB(skb)->end_seq - th->fin, tp->rcv_nxt)) {
-				NET_INC_STATS_BH(TCPAbortOnData);
+				NET_INC_STATS_BH(LINUX_MIB_TCPABORTONDATA);
 				tcp_reset(sk);
 				return 1;
 			}
diff --git a/net/ipv4/tcp_ipv4.c b/net/ipv4/tcp_ipv4.c
index 6673cb5e3..514090ffa 100644
--- a/net/ipv4/tcp_ipv4.c
+++ b/net/ipv4/tcp_ipv4.c
@@ -74,6 +74,7 @@
 #include <linux/stddef.h>
 #include <linux/proc_fs.h>
 #include <linux/seq_file.h>
+#include <linux/vserver/debug.h>
 
 extern int sysctl_ip_dynaddr;
 int sysctl_tcp_tw_reuse;
@@ -187,7 +188,7 @@ static inline int tcp_in_list(struct sock *sk, u32 addr)
 {
 	struct nx_info *nxi = sk->sk_nx_info;
 
-	vxdprintk("tcp_in_list(%p) %p,%p;%lx\n",
+	vxdprintk(VXD_CBIT(net, 2), "tcp_in_list(%p) %p,%p;%lx",
 		sk, nxi, sk->sk_socket,
 		(sk->sk_socket?sk->sk_socket->flags:0));
 
@@ -210,7 +211,8 @@ static inline int tcp_in_list(struct sock *sk, u32 addr)
 int tcp_ipv4_addr_conflict(struct sock *sk1, struct sock *sk2)
 {
 	if (sk1 && sk2)
-	nxdprintk("inet_bind(%p,%p) %p,%p;%lx %p,%p;%lx\n",
+	vxdprintk(VXD_CBIT(net, 5),
+		"tcp_ipv4_addr_conflict(%p,%p) %p,%p;%lx %p,%p;%lx",
 		sk1, sk2,
 		sk1->sk_nx_info, sk1->sk_socket,
 		(sk1->sk_socket?sk1->sk_socket->flags:0),
@@ -697,11 +699,11 @@ unique:
 
 	if (twp) {
 		*twp = tw;
-		NET_INC_STATS_BH(TimeWaitRecycled);
+		NET_INC_STATS_BH(LINUX_MIB_TIMEWAITRECYCLED);
 	} else if (tw) {
 		/* Silly. Should hash-dance instead... */
 		tcp_tw_deschedule(tw);
-		NET_INC_STATS_BH(TimeWaitRecycled);
+		NET_INC_STATS_BH(LINUX_MIB_TIMEWAITRECYCLED);
 
 		tcp_tw_put(tw);
 	}
@@ -1077,14 +1079,14 @@ void tcp_v4_err(struct sk_buff *skb, u32 info)
 	int err;
 
 	if (skb->len < (iph->ihl << 2) + 8) {
-		ICMP_INC_STATS_BH(IcmpInErrors);
+		ICMP_INC_STATS_BH(ICMP_MIB_INERRORS);
 		return;
 	}
 
 	sk = tcp_v4_lookup(iph->daddr, th->dest, iph->saddr,
 			   th->source, tcp_v4_iif(skb));
 	if (!sk) {
-		ICMP_INC_STATS_BH(IcmpInErrors);
+		ICMP_INC_STATS_BH(ICMP_MIB_INERRORS);
 		return;
 	}
 	if (sk->sk_state == TCP_TIME_WAIT) {
@@ -1097,7 +1099,7 @@ void tcp_v4_err(struct sk_buff *skb, u32 info)
 	 * servers this needs to be solved differently.
 	 */
 	if (sock_owned_by_user(sk))
-		NET_INC_STATS_BH(LockDroppedIcmps);
+		NET_INC_STATS_BH(LINUX_MIB_LOCKDROPPEDICMPS);
 
 	if (sk->sk_state == TCP_CLOSE)
 		goto out;
@@ -1106,7 +1108,7 @@ void tcp_v4_err(struct sk_buff *skb, u32 info)
 	seq = ntohl(th->seq);
 	if (sk->sk_state != TCP_LISTEN &&
 	    !between(seq, tp->snd_una, tp->snd_nxt)) {
-		NET_INC_STATS(OutOfWindowIcmps);
+		NET_INC_STATS(LINUX_MIB_OUTOFWINDOWICMPS);
 		goto out;
 	}
 
@@ -1157,7 +1159,7 @@ void tcp_v4_err(struct sk_buff *skb, u32 info)
 		BUG_TRAP(!req->sk);
 
 		if (seq != req->snt_isn) {
-			NET_INC_STATS_BH(OutOfWindowIcmps);
+			NET_INC_STATS_BH(LINUX_MIB_OUTOFWINDOWICMPS);
 			goto out;
 		}
 
@@ -1175,7 +1177,7 @@ void tcp_v4_err(struct sk_buff *skb, u32 info)
 			       It can f.e. if SYNs crossed.
 			     */
 		if (!sock_owned_by_user(sk)) {
-			TCP_INC_STATS_BH(TcpAttemptFails);
+			TCP_INC_STATS_BH(TCP_MIB_ATTEMPTFAILS);
 			sk->sk_err = err;
 
 			sk->sk_error_report(sk);
@@ -1284,8 +1286,8 @@ static void tcp_v4_send_reset(struct sk_buff *skb)
 
 	ip_send_reply(tcp_socket->sk, skb, &arg, sizeof rth);
 
-	TCP_INC_STATS_BH(TcpOutSegs);
-	TCP_INC_STATS_BH(TcpOutRsts);
+	TCP_INC_STATS_BH(TCP_MIB_OUTSEGS);
+	TCP_INC_STATS_BH(TCP_MIB_OUTRSTS);
 }
 
 /* The code following below sending ACKs in SYN-RECV and TIME-WAIT states
@@ -1332,7 +1334,7 @@ static void tcp_v4_send_ack(struct sk_buff *skb, u32 seq, u32 ack,
 
 	ip_send_reply(tcp_socket->sk, skb, &arg, arg.iov[0].iov_len);
 
-	TCP_INC_STATS_BH(TcpOutSegs);
+	TCP_INC_STATS_BH(TCP_MIB_OUTSEGS);
 }
 
 static void tcp_v4_timewait_ack(struct sock *sk, struct sk_buff *skb)
@@ -1369,12 +1371,12 @@ static struct dst_entry* tcp_v4_route_req(struct sock *sk,
 					 .dport = req->rmt_port } } };
 
 	if (ip_route_output_flow(&rt, &fl, sk, 0)) {
-		IP_INC_STATS_BH(OutNoRoutes);
+		IP_INC_STATS_BH(IPSTATS_MIB_OUTNOROUTES);
 		return NULL;
 	}
 	if (opt && opt->is_strictroute && rt->rt_dst != rt->rt_gateway) {
 		ip_rt_put(rt);
-		IP_INC_STATS_BH(OutNoRoutes);
+		IP_INC_STATS_BH(IPSTATS_MIB_OUTNOROUTES);
 		return NULL;
 	}
 	return &rt->u.dst;
@@ -1584,7 +1586,7 @@ int tcp_v4_conn_request(struct sock *sk, struct sk_buff *skb)
 			if (xtime.tv_sec < peer->tcp_ts_stamp + TCP_PAWS_MSL &&
 			    (s32)(peer->tcp_ts - req->ts_recent) >
 							TCP_PAWS_WINDOW) {
-				NET_INC_STATS_BH(PAWSPassiveRejected);
+				NET_INC_STATS_BH(LINUX_MIB_PAWSPASSIVEREJECTED);
 				dst_release(dst);
 				goto drop_and_free;
 			}
@@ -1629,7 +1631,7 @@ int tcp_v4_conn_request(struct sock *sk, struct sk_buff *skb)
 drop_and_free:
 	tcp_openreq_free(req);
 drop:
-	TCP_INC_STATS_BH(TcpAttemptFails);
+	TCP_INC_STATS_BH(TCP_MIB_ATTEMPTFAILS);
 	return 0;
 }
 
@@ -1684,9 +1686,9 @@ struct sock *tcp_v4_syn_recv_sock(struct sock *sk, struct sk_buff *skb,
 	return newsk;
 
 exit_overflow:
-	NET_INC_STATS_BH(ListenOverflows);
+	NET_INC_STATS_BH(LINUX_MIB_LISTENOVERFLOWS);
 exit:
-	NET_INC_STATS_BH(ListenDrops);
+	NET_INC_STATS_BH(LINUX_MIB_LISTENDROPS);
 	dst_release(dst);
 	return NULL;
 }
@@ -1804,7 +1806,7 @@ discard:
 	return 0;
 
 csum_err:
-	TCP_INC_STATS_BH(TcpInErrs);
+	TCP_INC_STATS_BH(TCP_MIB_INERRS);
 	goto discard;
 }
 
@@ -1822,7 +1824,7 @@ int tcp_v4_rcv(struct sk_buff *skb)
 		goto discard_it;
 
 	/* Count it even if it's bad */
-	TCP_INC_STATS_BH(TcpInSegs);
+	TCP_INC_STATS_BH(TCP_MIB_INSEGS);
 
 	if (!pskb_may_pull(skb, sizeof(struct tcphdr)))
 		goto discard_it;
@@ -1889,7 +1891,7 @@ no_tcp_socket:
 
 	if (skb->len < (th->doff << 2) || tcp_checksum_complete(skb)) {
 bad_packet:
-		TCP_INC_STATS_BH(TcpInErrs);
+		TCP_INC_STATS_BH(TCP_MIB_INERRS);
 	} else {
 		tcp_v4_send_reset(skb);
 	}
@@ -1910,7 +1912,7 @@ do_time_wait:
 	}
 
 	if (skb->len < (th->doff << 2) || tcp_checksum_complete(skb)) {
-		TCP_INC_STATS_BH(TcpInErrs);
+		TCP_INC_STATS_BH(TCP_MIB_INERRS);
 		tcp_tw_put((struct tcp_tw_bucket *) sk);
 		goto discard_it;
 	}
@@ -2160,7 +2162,7 @@ static int tcp_v4_init_sock(struct sock *sk)
 
 	sk->sk_state = TCP_CLOSE;
 
-	sk->sk_write_space = tcp_write_space;
+	sk->sk_write_space = sk_stream_write_space;
 	sk->sk_use_write_queue = 1;
 
 	tp->af_specific = &ipv4_specific;
@@ -2173,14 +2175,14 @@ static int tcp_v4_init_sock(struct sock *sk)
 	return 0;
 }
 
-static int tcp_v4_destroy_sock(struct sock *sk)
+int tcp_v4_destroy_sock(struct sock *sk)
 {
 	struct tcp_opt *tp = tcp_sk(sk);
 
 	tcp_clear_xmit_timers(sk);
 
 	/* Cleanup up the write buffer. */
-  	tcp_writequeue_purge(sk);
+  	sk_stream_writequeue_purge(sk);
 
 	/* Cleans up our, hopefully empty, out_of_order_queue. */
   	__skb_queue_purge(&tp->out_of_order_queue);
@@ -2192,15 +2194,21 @@ static int tcp_v4_destroy_sock(struct sock *sk)
 	if (tp->bind_hash)
 		tcp_put_port(sk);
 
-	/* If sendmsg cached page exists, toss it. */
-	if (inet_sk(sk)->sndmsg_page)
-		__free_page(inet_sk(sk)->sndmsg_page);
+	/*
+	 * If sendmsg cached page exists, toss it.
+	 */
+	if (sk->sk_sndmsg_page) {
+		__free_page(sk->sk_sndmsg_page);
+		sk->sk_sndmsg_page = NULL;
+	}
 
 	atomic_dec(&tcp_sockets_allocated);
 
 	return 0;
 }
 
+EXPORT_SYMBOL(tcp_v4_destroy_sock);
+
 #ifdef CONFIG_PROC_FS
 /* Proc filesystem TCP sock list dumping. */
 
@@ -2238,7 +2246,8 @@ static void *listening_get_next(struct seq_file *seq, void *cur)
 		req = req->dl_next;
 		while (1) {
 			while (req) {
-				vxdprintk("skr: %p [#%d] (from %d)\n",
+				vxdprintk(VXD_CBIT(net, 6),
+					"sk,req: %p [#%d] (from %d)",
 					req->sk, req->sk->sk_xid, current->xid);
 				if (!vx_check(req->sk->sk_xid, VX_IDENT|VX_WATCH))
 					continue;
@@ -2260,7 +2269,7 @@ get_req:
 		sk = sk_next(sk);
 get_sk:
 	sk_for_each_from(sk, node) {
-		vxdprintk("sk: %p [#%d] (from %d)\n",
+		vxdprintk(VXD_CBIT(net, 6), "sk: %p [#%d] (from %d)",
 			sk, sk->sk_xid, current->xid);
 		if (!vx_check(sk->sk_xid, VX_IDENT|VX_WATCH))
 			continue;
@@ -2311,7 +2320,8 @@ static void *established_get_first(struct seq_file *seq)
 	       
 		read_lock(&tcp_ehash[st->bucket].lock);
 		sk_for_each(sk, node, &tcp_ehash[st->bucket].chain) {
-			vxdprintk("egf,sk: %p [#%d] (from %d)\n",
+			vxdprintk(VXD_CBIT(net, 6),
+				"sk,egf: %p [#%d] (from %d)",
 				sk, sk->sk_xid, current->xid);
 			if (!vx_check(sk->sk_xid, VX_IDENT|VX_WATCH))
 				continue;
@@ -2323,7 +2333,8 @@ static void *established_get_first(struct seq_file *seq)
 		st->state = TCP_SEQ_STATE_TIME_WAIT;
 		tw_for_each(tw, node,
 			    &tcp_ehash[st->bucket + tcp_ehash_size].chain) {
-			vxdprintk("tw: %p [#%d] (from %d)\n",
+			vxdprintk(VXD_CBIT(net, 6),
+				"tw: %p [#%d] (from %d)",
 				tw, tw->tw_xid, current->xid);
 			if (!vx_check(tw->tw_xid, VX_IDENT|VX_WATCH))
 				continue;
@@ -2352,8 +2363,8 @@ static void *established_get_next(struct seq_file *seq, void *cur)
 		tw = cur;
 		tw = tw_next(tw);
 get_tw:
-		while (tw && tw->tw_family != st->family &&
-			!vx_check(tw->tw_xid, VX_IDENT|VX_WATCH)) {
+		while (tw && (tw->tw_family != st->family ||
+			!vx_check(tw->tw_xid, VX_IDENT|VX_WATCH))) {
 			tw = tw_next(tw);
 		}
 		if (tw) {
@@ -2373,7 +2384,8 @@ get_tw:
 		sk = sk_next(sk);
 
 	sk_for_each_from(sk, node) {
-		vxdprintk("egn,sk: %p [#%d] (from %d)\n",
+		vxdprintk(VXD_CBIT(net, 6),
+			"sk,egn: %p [#%d] (from %d)",
 			sk, sk->sk_xid, current->xid);
 		if (!vx_check(sk->sk_xid, VX_IDENT|VX_WATCH))
 			continue;
@@ -2684,23 +2696,31 @@ void tcp4_proc_exit(void)
 #endif /* CONFIG_PROC_FS */
 
 struct proto tcp_prot = {
-	.name		=	"TCP",
-	.close		=	tcp_close,
-	.connect	=	tcp_v4_connect,
-	.disconnect	=	tcp_disconnect,
-	.accept		=	tcp_accept,
-	.ioctl		=	tcp_ioctl,
-	.init		=	tcp_v4_init_sock,
-	.destroy	=	tcp_v4_destroy_sock,
-	.shutdown	=	tcp_shutdown,
-	.setsockopt	=	tcp_setsockopt,
-	.getsockopt	=	tcp_getsockopt,
-	.sendmsg	=	tcp_sendmsg,
-	.recvmsg	=	tcp_recvmsg,
-	.backlog_rcv	=	tcp_v4_do_rcv,
-	.hash		=	tcp_v4_hash,
-	.unhash		=	tcp_unhash,
-	.get_port	=	tcp_v4_get_port,
+	.name			= "TCP",
+	.close			= tcp_close,
+	.connect		= tcp_v4_connect,
+	.disconnect		= tcp_disconnect,
+	.accept			= tcp_accept,
+	.ioctl			= tcp_ioctl,
+	.init			= tcp_v4_init_sock,
+	.destroy		= tcp_v4_destroy_sock,
+	.shutdown		= tcp_shutdown,
+	.setsockopt		= tcp_setsockopt,
+	.getsockopt		= tcp_getsockopt,
+	.sendmsg		= tcp_sendmsg,
+	.recvmsg		= tcp_recvmsg,
+	.backlog_rcv		= tcp_v4_do_rcv,
+	.hash			= tcp_v4_hash,
+	.unhash			= tcp_unhash,
+	.get_port		= tcp_v4_get_port,
+	.enter_memory_pressure	= tcp_enter_memory_pressure,
+	.sockets_allocated	= &tcp_sockets_allocated,
+	.memory_allocated	= &tcp_memory_allocated,
+	.memory_pressure	= &tcp_memory_pressure,
+	.sysctl_mem		= sysctl_tcp_mem,
+	.sysctl_wmem		= sysctl_tcp_wmem,
+	.sysctl_rmem		= sysctl_tcp_rmem,
+	.max_header		= MAX_TCP_HEADER,
 };
 
 
diff --git a/net/ipv4/tcp_minisocks.c b/net/ipv4/tcp_minisocks.c
index def53d83f..c2ef0d903 100644
--- a/net/ipv4/tcp_minisocks.c
+++ b/net/ipv4/tcp_minisocks.c
@@ -25,6 +25,7 @@
 #include <linux/module.h>
 #include <linux/sysctl.h>
 #include <linux/workqueue.h>
+#include <linux/vs_limit.h>
 #include <linux/vs_socket.h>
 #include <net/tcp.h>
 #include <net/inet_common.h>
@@ -267,7 +268,7 @@ kill:
 	}
 
 	if (paws_reject)
-		NET_INC_STATS_BH(PAWSEstabRejected);
+		NET_INC_STATS_BH(LINUX_MIB_PAWSESTABREJECTED);
 
 	if(!th->rst) {
 		/* In this case we must reset the TIMEWAIT timer.
@@ -468,7 +469,7 @@ rescan:
 	}
 
 	tcp_tw_count -= killed;
-	NET_ADD_STATS_BH(TimeWaited, killed);
+	NET_ADD_STATS_BH(LINUX_MIB_TIMEWAITED, killed);
 
 	return ret;
 }
@@ -678,7 +679,7 @@ void tcp_twcal_tick(unsigned long dummy)
 out:
 	if ((tcp_tw_count -= killed) == 0)
 		del_timer(&tcp_tw_timer);
-	NET_ADD_STATS_BH(TimeWaitKilled, killed);
+	NET_ADD_STATS_BH(LINUX_MIB_TIMEWAITKILLED, killed);
 	spin_unlock(&tw_death_lock);
 }
 
@@ -726,9 +727,10 @@ struct sock *tcp_create_openreq_child(struct sock *sk, struct open_request *req,
 		sock_reset_flag(newsk, SOCK_DONE);
 		newsk->sk_userlocks = sk->sk_userlocks & ~SOCK_BINDPORT_LOCK;
 		newsk->sk_backlog.head = newsk->sk_backlog.tail = NULL;
+		newsk->sk_send_head = NULL;
 		newsk->sk_callback_lock = RW_LOCK_UNLOCKED;
 		skb_queue_head_init(&newsk->sk_error_queue);
-		newsk->sk_write_space = tcp_write_space;
+		newsk->sk_write_space = sk_stream_write_space;
 
 		if ((filter = newsk->sk_filter) != NULL)
 			sk_filter_charge(newsk, filter);
@@ -774,16 +776,12 @@ struct sock *tcp_create_openreq_child(struct sock *sk, struct open_request *req,
 		newtp->snd_cwnd = 2;
 		newtp->snd_cwnd_cnt = 0;
 
-		newtp->bictcp.cnt = 0;
-		newtp->bictcp.last_max_cwnd = newtp->bictcp.last_cwnd = 0;
-
 		newtp->frto_counter = 0;
 		newtp->frto_highmark = 0;
 
 		tcp_set_ca_state(newtp, TCP_CA_Open);
 		tcp_init_xmit_timers(newsk);
 		skb_queue_head_init(&newtp->out_of_order_queue);
-		newtp->send_head = NULL;
 		newtp->rcv_wup = req->rcv_isn + 1;
 		newtp->write_seq = req->snt_isn + 1;
 		newtp->pushed_seq = newtp->write_seq;
@@ -809,6 +807,7 @@ struct sock *tcp_create_openreq_child(struct sock *sk, struct open_request *req,
 
 		set_vx_info(&newsk->sk_vx_info, sk->sk_vx_info);
 		newsk->sk_xid = sk->sk_xid;
+		vx_sock_inc(newsk);
 		set_nx_info(&newsk->sk_nx_info, sk->sk_nx_info);
 		newsk->sk_nid = sk->sk_nid;
 #ifdef INET_REFCNT_DEBUG
@@ -858,7 +857,7 @@ struct sock *tcp_create_openreq_child(struct sock *sk, struct open_request *req,
 			newsk->sk_no_largesend = 1;
 
 		tcp_vegas_init(newtp);
-		TCP_INC_STATS_BH(TcpPassiveOpens);
+		TCP_INC_STATS_BH(TCP_MIB_PASSIVEOPENS);
 	}
 	return newsk;
 }
@@ -989,7 +988,7 @@ struct sock *tcp_check_req(struct sock *sk,struct sk_buff *skb,
 		if (!(flg & TCP_FLAG_RST))
 			req->class->send_ack(skb, req);
 		if (paws_reject)
-			NET_INC_STATS_BH(PAWSEstabRejected);
+			NET_INC_STATS_BH(LINUX_MIB_PAWSESTABREJECTED);
 		return NULL;
 	}
 
@@ -1046,7 +1045,7 @@ listen_overflow:
 	}
 
 embryonic_reset:
-	NET_INC_STATS_BH(EmbryonicRsts);
+	NET_INC_STATS_BH(LINUX_MIB_EMBRYONICRSTS);
 	if (!(flg & TCP_FLAG_RST))
 		req->class->send_reset(skb);
 
diff --git a/net/ipv4/tcp_output.c b/net/ipv4/tcp_output.c
index bc5fba4a3..68ab99fc0 100644
--- a/net/ipv4/tcp_output.c
+++ b/net/ipv4/tcp_output.c
@@ -48,9 +48,9 @@ int sysctl_tcp_retrans_collapse = 1;
 static __inline__
 void update_send_head(struct sock *sk, struct tcp_opt *tp, struct sk_buff *skb)
 {
-	tp->send_head = skb->next;
-	if (tp->send_head == (struct sk_buff *)&sk->sk_write_queue)
-		tp->send_head = NULL;
+	sk->sk_send_head = skb->next;
+	if (sk->sk_send_head == (struct sk_buff *)&sk->sk_write_queue)
+		sk->sk_send_head = NULL;
 	tp->snd_nxt = TCP_SKB_CB(skb)->end_seq;
 	if (tp->packets_out++ == 0)
 		tcp_reset_xmit_timer(sk, TCP_TIME_RETRANS, tp->rto);
@@ -168,6 +168,14 @@ static __inline__ u16 tcp_select_window(struct sock *sk)
 	tp->rcv_wnd = new_win;
 	tp->rcv_wup = tp->rcv_nxt;
 
+	/* Make sure we do not exceed the maximum possible
+	 * scaled window.
+	 */
+	if (!tp->rcv_wscale)
+		new_win = min(new_win, MAX_TCP_WINDOW);
+	else
+		new_win = min(new_win, (65535U << tp->rcv_wscale));
+
 	/* RFC1323 scaling applied */
 	new_win >>= tp->rcv_wscale;
 
@@ -291,7 +299,7 @@ int tcp_transmit_skb(struct sock *sk, struct sk_buff *skb)
 		if (skb->len != tcp_header_size)
 			tcp_event_data_sent(tp, skb, sk);
 
-		TCP_INC_STATS(TcpOutSegs);
+		TCP_INC_STATS(TCP_MIB_OUTSEGS);
 
 		err = tp->af_specific->queue_xmit(skb, 0);
 		if (err <= 0)
@@ -326,11 +334,11 @@ static void tcp_queue_skb(struct sock *sk, struct sk_buff *skb)
 	/* Advance write_seq and place onto the write_queue. */
 	tp->write_seq = TCP_SKB_CB(skb)->end_seq;
 	__skb_queue_tail(&sk->sk_write_queue, skb);
-	tcp_charge_skb(sk, skb);
+	sk_charge_skb(sk, skb);
 
 	/* Queue it, remembering where we must start sending. */
-	if (tp->send_head == NULL)
-		tp->send_head = skb;
+	if (sk->sk_send_head == NULL)
+		sk->sk_send_head = skb;
 }
 
 /* Send _single_ skb sitting at the send head. This function requires
@@ -339,13 +347,13 @@ static void tcp_queue_skb(struct sock *sk, struct sk_buff *skb)
 void tcp_push_one(struct sock *sk, unsigned cur_mss)
 {
 	struct tcp_opt *tp = tcp_sk(sk);
-	struct sk_buff *skb = tp->send_head;
+	struct sk_buff *skb = sk->sk_send_head;
 
 	if (tcp_snd_test(tp, skb, cur_mss, TCP_NAGLE_PUSH)) {
 		/* Send it out now. */
 		TCP_SKB_CB(skb)->when = tcp_time_stamp;
 		if (!tcp_transmit_skb(sk, skb_clone(skb, sk->sk_allocation))) {
-			tp->send_head = NULL;
+			sk->sk_send_head = NULL;
 			tp->snd_nxt = TCP_SKB_CB(skb)->end_seq;
 			if (tp->packets_out++ == 0)
 				tcp_reset_xmit_timer(sk, TCP_TIME_RETRANS, tp->rto);
@@ -354,70 +362,6 @@ void tcp_push_one(struct sock *sk, unsigned cur_mss)
 	}
 }
 
-/* Split fragmented skb to two parts at length len. */
-
-static void skb_split(struct sk_buff *skb, struct sk_buff *skb1, u32 len)
-{
-	int i;
-	int pos = skb_headlen(skb);
-
-	if (len < pos) {
-		/* Split line is inside header. */
-		memcpy(skb_put(skb1, pos-len), skb->data + len, pos-len);
-
-		/* And move data appendix as is. */
-		for (i = 0; i < skb_shinfo(skb)->nr_frags; i++)
-			skb_shinfo(skb1)->frags[i] = skb_shinfo(skb)->frags[i];
-
-		skb_shinfo(skb1)->nr_frags = skb_shinfo(skb)->nr_frags;
-		skb_shinfo(skb)->nr_frags = 0;
-
-		skb1->data_len = skb->data_len;
-		skb1->len += skb1->data_len;
-		skb->data_len = 0;
-		skb->len = len;
-		skb->tail = skb->data+len;
-	} else {
-		int k = 0;
-		int nfrags = skb_shinfo(skb)->nr_frags;
-
-		/* Second chunk has no header, nothing to copy. */
-
-		skb_shinfo(skb)->nr_frags = 0;
-		skb1->len = skb1->data_len = skb->len - len;
-		skb->len = len;
-		skb->data_len = len - pos;
-
-		for (i=0; i<nfrags; i++) {
-			int size = skb_shinfo(skb)->frags[i].size;
-			if (pos + size > len) {
-				skb_shinfo(skb1)->frags[k] = skb_shinfo(skb)->frags[i];
-
-				if (pos < len) {
-					/* Split frag.
-					 * We have to variants in this case:
-					 * 1. Move all the frag to the second
-					 *    part, if it is possible. F.e.
-					 *    this approach is mandatory for TUX,
-					 *    where splitting is expensive.
-					 * 2. Split is accurately. We make this.
-					 */
-					get_page(skb_shinfo(skb)->frags[i].page);
-					skb_shinfo(skb1)->frags[0].page_offset += (len-pos);
-					skb_shinfo(skb1)->frags[0].size -= (len-pos);
-					skb_shinfo(skb)->frags[i].size = len-pos;
-					skb_shinfo(skb)->nr_frags++;
-				}
-				k++;
-			} else {
-				skb_shinfo(skb)->nr_frags++;
-			}
-			pos += size;
-		}
-		skb_shinfo(skb1)->nr_frags = k;
-	}
-}
-
 /* Function to create two new TCP segments.  Shrinks the given segment
  * to the specified size and appends a new segment with the rest of the
  * packet to the list.  This won't be called frequently, I hope. 
@@ -436,10 +380,10 @@ static int tcp_fragment(struct sock *sk, struct sk_buff *skb, u32 len)
 		return -ENOMEM;
 
 	/* Get a new skb... force flag on. */
-	buff = tcp_alloc_skb(sk, nsize, GFP_ATOMIC);
+	buff = sk_stream_alloc_skb(sk, nsize, GFP_ATOMIC);
 	if (buff == NULL)
 		return -ENOMEM; /* We'll just try again later. */
-	tcp_charge_skb(sk, buff);
+	sk_charge_skb(sk, buff);
 
 	/* Correct the sequence numbers. */
 	TCP_SKB_CB(buff)->seq = TCP_SKB_CB(skb)->seq + len;
@@ -636,8 +580,10 @@ int tcp_write_xmit(struct sock *sk, int nonagle)
 		 */
 		mss_now = tcp_current_mss(sk, 1);
 
-		while((skb = tp->send_head) &&
-		      tcp_snd_test(tp, skb, mss_now, tcp_skb_is_last(sk, skb) ? nonagle : TCP_NAGLE_PUSH)) {
+		while ((skb = sk->sk_send_head) &&
+		       tcp_snd_test(tp, skb, mss_now,
+			       	    tcp_skb_is_last(sk, skb) ? nonagle :
+				    			       TCP_NAGLE_PUSH)) {
 			if (skb->len > mss_now) {
 				if (tcp_fragment(sk, skb, mss_now))
 					break;
@@ -657,7 +603,7 @@ int tcp_write_xmit(struct sock *sk, int nonagle)
 			return 0;
 		}
 
-		return !tp->packets_out && tp->send_head;
+		return !tp->packets_out && sk->sk_send_head;
 	}
 	return 0;
 }
@@ -744,17 +690,32 @@ u32 __tcp_select_window(struct sock *sk)
 	if (free_space > tp->rcv_ssthresh)
 		free_space = tp->rcv_ssthresh;
 
-	/* Get the largest window that is a nice multiple of mss.
-	 * Window clamp already applied above.
-	 * If our current window offering is within 1 mss of the
-	 * free space we just keep it. This prevents the divide
-	 * and multiply from happening most of the time.
-	 * We also don't do any window rounding when the free space
-	 * is too small.
+	/* Don't do rounding if we are using window scaling, since the
+	 * scaled window will not line up with the MSS boundary anyway.
 	 */
 	window = tp->rcv_wnd;
-	if (window <= free_space - mss || window > free_space)
-		window = (free_space/mss)*mss;
+	if (tp->rcv_wscale) {
+		window = free_space;
+
+		/* Advertise enough space so that it won't get scaled away.
+		 * Import case: prevent zero window announcement if
+		 * 1<<rcv_wscale > mss.
+		 */
+		if (((window >> tp->rcv_wscale) << tp->rcv_wscale) != window)
+			window = (((window >> tp->rcv_wscale) + 1)
+				  << tp->rcv_wscale);
+	} else {
+		/* Get the largest window that is a nice multiple of mss.
+		 * Window clamp already applied above.
+		 * If our current window offering is within 1 mss of the
+		 * free space we just keep it. This prevents the divide
+		 * and multiply from happening most of the time.
+		 * We also don't do any window rounding when the free space
+		 * is too small.
+		 */
+		if (window <= free_space - mss || window > free_space)
+			window = (free_space/mss)*mss;
+	}
 
 	return window;
 }
@@ -827,7 +788,7 @@ static void tcp_retrans_try_collapse(struct sock *sk, struct sk_buff *skb, int m
 		 */
 		if (tp->fackets_out)
 			tp->fackets_out--;
-		tcp_free_skb(sk, next_skb);
+		sk_stream_free_skb(sk, next_skb);
 		tp->packets_out--;
 	}
 }
@@ -843,7 +804,7 @@ void tcp_simple_retransmit(struct sock *sk)
 	unsigned int mss = tcp_current_mss(sk, 0);
 	int lost = 0;
 
-	for_retrans_queue(skb, sk, tp) {
+	sk_stream_for_retrans_queue(skb, sk) {
 		if (skb->len > mss && 
 		    !(TCP_SKB_CB(skb)->sacked&TCPCB_SACKED_ACKED)) {
 			if (TCP_SKB_CB(skb)->sacked&TCPCB_SACKED_RETRANS) {
@@ -929,7 +890,7 @@ int tcp_retransmit_skb(struct sock *sk, struct sk_buff *skb)
 	/* Collapse two adjacent packets if worthwhile and we can. */
 	if(!(TCP_SKB_CB(skb)->flags & TCPCB_FLAG_SYN) &&
 	   (skb->len < (cur_mss >> 1)) &&
-	   (skb->next != tp->send_head) &&
+	   (skb->next != sk->sk_send_head) &&
 	   (skb->next != (struct sk_buff *)&sk->sk_write_queue) &&
 	   (skb_shinfo(skb)->nr_frags == 0 && skb_shinfo(skb->next)->nr_frags == 0) &&
 	   (sysctl_tcp_retrans_collapse != 0))
@@ -963,7 +924,7 @@ int tcp_retransmit_skb(struct sock *sk, struct sk_buff *skb)
 
 	if (err == 0) {
 		/* Update global TCP statistics. */
-		TCP_INC_STATS(TcpRetransSegs);
+		TCP_INC_STATS(TCP_MIB_RETRANSSEGS);
 
 #if FASTRETRANS_DEBUG > 0
 		if (TCP_SKB_CB(skb)->sacked&TCPCB_SACKED_RETRANS) {
@@ -1004,7 +965,7 @@ void tcp_xmit_retransmit_queue(struct sock *sk)
 
 	/* First pass: retransmit lost packets. */
 	if (packet_cnt) {
-		for_retrans_queue(skb, sk, tp) {
+		sk_stream_for_retrans_queue(skb, sk) {
 			__u8 sacked = TCP_SKB_CB(skb)->sacked;
 
 			if (tcp_packets_in_flight(tp) >= tp->snd_cwnd)
@@ -1015,9 +976,9 @@ void tcp_xmit_retransmit_queue(struct sock *sk)
 					if (tcp_retransmit_skb(sk, skb))
 						return;
 					if (tp->ca_state != TCP_CA_Loss)
-						NET_INC_STATS_BH(TCPFastRetrans);
+						NET_INC_STATS_BH(LINUX_MIB_TCPFASTRETRANS);
 					else
-						NET_INC_STATS_BH(TCPSlowStartRetrans);
+						NET_INC_STATS_BH(LINUX_MIB_TCPSLOWSTARTRETRANS);
 
 					if (skb ==
 					    skb_peek(&sk->sk_write_queue))
@@ -1052,7 +1013,7 @@ void tcp_xmit_retransmit_queue(struct sock *sk)
 
 	packet_cnt = 0;
 
-	for_retrans_queue(skb, sk, tp) {
+	sk_stream_for_retrans_queue(skb, sk) {
 		if(++packet_cnt > tp->fackets_out)
 			break;
 
@@ -1069,7 +1030,7 @@ void tcp_xmit_retransmit_queue(struct sock *sk)
 		if (skb == skb_peek(&sk->sk_write_queue))
 			tcp_reset_xmit_timer(sk, TCP_TIME_RETRANS, tp->rto);
 
-		NET_INC_STATS_BH(TCPForwardRetrans);
+		NET_INC_STATS_BH(LINUX_MIB_TCPFORWARDRETRANS);
 	}
 }
 
@@ -1089,7 +1050,7 @@ void tcp_send_fin(struct sock *sk)
 	 */
 	mss_now = tcp_current_mss(sk, 1); 
 
-	if(tp->send_head != NULL) {
+	if (sk->sk_send_head != NULL) {
 		TCP_SKB_CB(skb)->flags |= TCPCB_FLAG_FIN;
 		TCP_SKB_CB(skb)->end_seq++;
 		tp->write_seq++;
@@ -1129,7 +1090,7 @@ void tcp_send_active_reset(struct sock *sk, int priority)
 	/* NOTE: No TCP options attached and we never retransmit this. */
 	skb = alloc_skb(MAX_TCP_HEADER, priority);
 	if (!skb) {
-		NET_INC_STATS(TCPAbortFailed);
+		NET_INC_STATS(LINUX_MIB_TCPABORTFAILED);
 		return;
 	}
 
@@ -1144,7 +1105,7 @@ void tcp_send_active_reset(struct sock *sk, int priority)
 	TCP_SKB_CB(skb)->end_seq = TCP_SKB_CB(skb)->seq;
 	TCP_SKB_CB(skb)->when = tcp_time_stamp;
 	if (tcp_transmit_skb(sk, skb))
-		NET_INC_STATS(TCPAbortFailed);
+		NET_INC_STATS(LINUX_MIB_TCPABORTFAILED);
 }
 
 /* WARNING: This routine must only be called when we have already sent
@@ -1168,8 +1129,8 @@ int tcp_send_synack(struct sock *sk)
 				return -ENOMEM;
 			__skb_unlink(skb, &sk->sk_write_queue);
 			__skb_queue_head(&sk->sk_write_queue, nskb);
-			tcp_free_skb(sk, skb);
-			tcp_charge_skb(sk, nskb);
+			sk_stream_free_skb(sk, skb);
+			sk_charge_skb(sk, nskb);
 			skb = nskb;
 		}
 
@@ -1244,7 +1205,7 @@ struct sk_buff * tcp_make_synack(struct sock *sk, struct dst_entry *dst,
 
 	skb->csum = 0;
 	th->doff = (tcp_header_size >> 2);
-	TCP_INC_STATS(TcpOutSegs);
+	TCP_INC_STATS(TCP_MIB_OUTSEGS);
 	return skb;
 }
 
@@ -1329,10 +1290,10 @@ int tcp_connect(struct sock *sk)
 	TCP_SKB_CB(buff)->when = tcp_time_stamp;
 	tp->retrans_stamp = TCP_SKB_CB(buff)->when;
 	__skb_queue_tail(&sk->sk_write_queue, buff);
-	tcp_charge_skb(sk, buff);
+	sk_charge_skb(sk, buff);
 	tp->packets_out++;
 	tcp_transmit_skb(sk, skb_clone(buff, GFP_KERNEL));
-	TCP_INC_STATS(TcpActiveOpens);
+	TCP_INC_STATS(TCP_MIB_ACTIVEOPENS);
 
 	/* Timer for repeating the SYN until an answer. */
 	tcp_reset_xmit_timer(sk, TCP_TIME_RETRANS, tp->rto);
@@ -1468,7 +1429,7 @@ int tcp_write_wakeup(struct sock *sk)
 		struct tcp_opt *tp = tcp_sk(sk);
 		struct sk_buff *skb;
 
-		if ((skb = tp->send_head) != NULL &&
+		if ((skb = sk->sk_send_head) != NULL &&
 		    before(TCP_SKB_CB(skb)->seq, tp->snd_una+tp->snd_wnd)) {
 			int err;
 			int mss = tcp_current_mss(sk, 0);
@@ -1522,7 +1483,7 @@ void tcp_send_probe0(struct sock *sk)
 
 	err = tcp_write_wakeup(sk);
 
-	if (tp->packets_out || !tp->send_head) {
+	if (tp->packets_out || !sk->sk_send_head) {
 		/* Cancel probe timer, if it is not required. */
 		tp->probes_out = 0;
 		tp->backoff = 0;
diff --git a/net/ipv4/tcp_timer.c b/net/ipv4/tcp_timer.c
index cab2678b1..72a5a50b5 100644
--- a/net/ipv4/tcp_timer.c
+++ b/net/ipv4/tcp_timer.c
@@ -83,7 +83,7 @@ static void tcp_write_err(struct sock *sk)
 	sk->sk_error_report(sk);
 
 	tcp_done(sk);
-	NET_INC_STATS_BH(TCPAbortOnTimeout);
+	NET_INC_STATS_BH(LINUX_MIB_TCPABORTONTIMEOUT);
 }
 
 /* Do not allow orphaned sockets to eat all our resources.
@@ -126,7 +126,7 @@ static int tcp_out_of_resources(struct sock *sk, int do_reset)
 		if (do_reset)
 			tcp_send_active_reset(sk, GFP_ATOMIC);
 		tcp_done(sk);
-		NET_INC_STATS_BH(TCPAbortOnMemory);
+		NET_INC_STATS_BH(LINUX_MIB_TCPABORTONMEMORY);
 		return 1;
 	}
 	return 0;
@@ -212,12 +212,12 @@ static void tcp_delack_timer(unsigned long data)
 	if (sock_owned_by_user(sk)) {
 		/* Try again later. */
 		tp->ack.blocked = 1;
-		NET_INC_STATS_BH(DelayedACKLocked);
+		NET_INC_STATS_BH(LINUX_MIB_DELAYEDACKLOCKED);
 		sk_reset_timer(sk, &tp->delack_timer, jiffies + TCP_DELACK_MIN);
 		goto out_unlock;
 	}
 
-	tcp_mem_reclaim(sk);
+	sk_stream_mem_reclaim(sk);
 
 	if (sk->sk_state == TCP_CLOSE || !(tp->ack.pending & TCP_ACK_TIMER))
 		goto out;
@@ -231,8 +231,8 @@ static void tcp_delack_timer(unsigned long data)
 	if (skb_queue_len(&tp->ucopy.prequeue)) {
 		struct sk_buff *skb;
 
-		NET_ADD_STATS_BH(TCPSchedulerFailed,
-				  skb_queue_len(&tp->ucopy.prequeue));
+		NET_ADD_STATS_BH(LINUX_MIB_TCPSCHEDULERFAILED, 
+				 skb_queue_len(&tp->ucopy.prequeue));
 
 		while ((skb = __skb_dequeue(&tp->ucopy.prequeue)) != NULL)
 			sk->sk_backlog_rcv(sk, skb);
@@ -252,13 +252,13 @@ static void tcp_delack_timer(unsigned long data)
 			tp->ack.ato = TCP_ATO_MIN;
 		}
 		tcp_send_ack(sk);
-		NET_INC_STATS_BH(DelayedACKs);
+		NET_INC_STATS_BH(LINUX_MIB_DELAYEDACKS);
 	}
 	TCP_CHECK_TIMER(sk);
 
 out:
 	if (tcp_memory_pressure)
-		tcp_mem_reclaim(sk);
+		sk_stream_mem_reclaim(sk);
 out_unlock:
 	bh_unlock_sock(sk);
 	sock_put(sk);
@@ -269,7 +269,7 @@ static void tcp_probe_timer(struct sock *sk)
 	struct tcp_opt *tp = tcp_sk(sk);
 	int max_probes;
 
-	if (tp->packets_out || !tp->send_head) {
+	if (tp->packets_out || !sk->sk_send_head) {
 		tp->probes_out = 0;
 		return;
 	}
@@ -353,19 +353,19 @@ static void tcp_retransmit_timer(struct sock *sk)
 		if (tp->ca_state == TCP_CA_Disorder || tp->ca_state == TCP_CA_Recovery) {
 			if (tp->sack_ok) {
 				if (tp->ca_state == TCP_CA_Recovery)
-					NET_INC_STATS_BH(TCPSackRecoveryFail);
+					NET_INC_STATS_BH(LINUX_MIB_TCPSACKRECOVERYFAIL);
 				else
-					NET_INC_STATS_BH(TCPSackFailures);
+					NET_INC_STATS_BH(LINUX_MIB_TCPSACKFAILURES);
 			} else {
 				if (tp->ca_state == TCP_CA_Recovery)
-					NET_INC_STATS_BH(TCPRenoRecoveryFail);
+					NET_INC_STATS_BH(LINUX_MIB_TCPRENORECOVERYFAIL);
 				else
-					NET_INC_STATS_BH(TCPRenoFailures);
+					NET_INC_STATS_BH(LINUX_MIB_TCPRENOFAILURES);
 			}
 		} else if (tp->ca_state == TCP_CA_Loss) {
-			NET_INC_STATS_BH(TCPLossFailures);
+			NET_INC_STATS_BH(LINUX_MIB_TCPLOSSFAILURES);
 		} else {
-			NET_INC_STATS_BH(TCPTimeouts);
+			NET_INC_STATS_BH(LINUX_MIB_TCPTIMEOUTS);
 		}
 	}
 
@@ -448,7 +448,7 @@ static void tcp_write_timer(unsigned long data)
 	TCP_CHECK_TIMER(sk);
 
 out:
-	tcp_mem_reclaim(sk);
+	sk_stream_mem_reclaim(sk);
 out_unlock:
 	bh_unlock_sock(sk);
 	sock_put(sk);
@@ -606,7 +606,7 @@ static void tcp_keepalive_timer (unsigned long data)
 	elapsed = keepalive_time_when(tp);
 
 	/* It is alive without keepalive 8) */
-	if (tp->packets_out || tp->send_head)
+	if (tp->packets_out || sk->sk_send_head)
 		goto resched;
 
 	elapsed = tcp_time_stamp - tp->rcv_tstamp;
@@ -633,7 +633,7 @@ static void tcp_keepalive_timer (unsigned long data)
 	}
 
 	TCP_CHECK_TIMER(sk);
-	tcp_mem_reclaim(sk);
+	sk_stream_mem_reclaim(sk);
 
 resched:
 	tcp_reset_keepalive_timer (sk, elapsed);
diff --git a/net/ipv4/udp.c b/net/ipv4/udp.c
index 03559b37f..977286f30 100644
--- a/net/ipv4/udp.c
+++ b/net/ipv4/udp.c
@@ -344,7 +344,7 @@ void udp_err(struct sk_buff *skb, u32 info)
 
 	sk = udp_v4_lookup(iph->daddr, uh->dest, iph->saddr, uh->source, skb->dev->ifindex);
 	if (sk == NULL) {
-		ICMP_INC_STATS_BH(IcmpInErrors);
+		ICMP_INC_STATS_BH(ICMP_MIB_INERRORS);
     	  	return;	/* No socket for error */
 	}
 
@@ -680,7 +680,7 @@ out:
 	if (free)
 		kfree(ipc.opt);
 	if (!err) {
-		UDP_INC_STATS_USER(UdpOutDatagrams);
+		UDP_INC_STATS_USER(UDP_MIB_OUTDATAGRAMS);
 		return len;
 	}
 	return err;
@@ -854,7 +854,10 @@ try_again:
   	}
 	if (inet->cmsg_flags)
 		ip_cmsg_recv(msg, skb);
+
 	err = copied;
+	if (flags & MSG_TRUNC)
+		err = skb->len - sizeof(struct udphdr);
   
 out_free:
   	skb_free_datagram(sk, skb);
@@ -862,7 +865,7 @@ out:
   	return err;
 
 csum_copy_err:
-	UDP_INC_STATS_BH(UdpInErrors);
+	UDP_INC_STATS_BH(UDP_MIB_INERRORS);
 
 	/* Clear queue. */
 	if (flags&MSG_PEEK) {
@@ -884,54 +887,6 @@ csum_copy_err:
 	goto try_again;
 }
 
-int udp_connect(struct sock *sk, struct sockaddr *uaddr, int addr_len)
-{
-	struct inet_opt *inet = inet_sk(sk);
-	struct sockaddr_in *usin = (struct sockaddr_in *) uaddr;
-	struct rtable *rt;
-	u32 saddr;
-	int oif;
-	int err;
-
-	
-	if (addr_len < sizeof(*usin)) 
-	  	return -EINVAL;
-
-	if (usin->sin_family != AF_INET) 
-	  	return -EAFNOSUPPORT;
-
-	sk_dst_reset(sk);
-
-	oif = sk->sk_bound_dev_if;
-	saddr = inet->saddr;
-	if (MULTICAST(usin->sin_addr.s_addr)) {
-		if (!oif)
-			oif = inet->mc_index;
-		if (!saddr)
-			saddr = inet->mc_addr;
-	}
-	err = ip_route_connect(&rt, usin->sin_addr.s_addr, saddr,
-			       RT_CONN_FLAGS(sk), oif,
-			       IPPROTO_UDP,
-			       inet->sport, usin->sin_port, sk);
-	if (err)
-		return err;
-	if ((rt->rt_flags & RTCF_BROADCAST) && !sock_flag(sk, SOCK_BROADCAST)) {
-		ip_rt_put(rt);
-		return -EACCES;
-	}
-  	if (!inet->saddr)
-	  	inet->saddr = rt->rt_src;	/* Update source address */
-	if (!inet->rcv_saddr)
-		inet->rcv_saddr = rt->rt_src;
-	inet->daddr = rt->rt_dst;
-	inet->dport = usin->sin_port;
-	sk->sk_state = TCP_ESTABLISHED;
-	inet->id = jiffies;
-
-	sk_dst_set(sk, &rt->u.dst);
-	return(0);
-}
 
 int udp_disconnect(struct sock *sk, int flags)
 {
@@ -957,7 +912,7 @@ int udp_disconnect(struct sock *sk, int flags)
 
 static void udp_close(struct sock *sk, long timeout)
 {
-	inet_sock_release(sk);
+	sk_common_release(sk);
 }
 
 /* return:
@@ -990,6 +945,7 @@ static int udp_encap_rcv(struct sock * sk, struct sk_buff *skb)
 	len = skb->tail - udpdata;
 
 	switch (encap_type) {
+	default:
 	case UDP_ENCAP_ESPINUDP:
 		/* Check if this is a keepalive packet.  If so, eat it. */
 		if (len == 1 && udpdata[0] == 0xff) {
@@ -1000,35 +956,7 @@ static int udp_encap_rcv(struct sock * sk, struct sk_buff *skb)
 		} else
 			/* Must be an IKE packet.. pass it through */
 			return 1;
-
-	decaps:
-		/* At this point we are sure that this is an ESPinUDP packet,
-		 * so we need to remove 'len' bytes from the packet (the UDP
-		 * header and optional ESP marker bytes) and then modify the
-		 * protocol to ESP, and then call into the transform receiver.
-		 */
-
-		/* Now we can update and verify the packet length... */
-		iph = skb->nh.iph;
-		iphlen = iph->ihl << 2;
-		iph->tot_len = htons(ntohs(iph->tot_len) - len);
-		if (skb->len < iphlen + len) {
-			/* packet is too small!?! */
-			return 0;
-		}
-
-		/* pull the data buffer up to the ESP header and set the
-		 * transport header to point to ESP.  Keep UDP on the stack
-		 * for later.
-		 */
-		skb->h.raw = skb_pull(skb, len);
-
-		/* modify the protocol (it's ESP!) */
-		iph->protocol = IPPROTO_ESP;
-
-		/* and let the caller know to send this into the ESP processor... */
-		return -1;
-
+		break;
 	case UDP_ENCAP_ESPINUDP_NON_IKE:
 		/* Check if this is a keepalive packet.  If so, eat it. */
 		if (len == 1 && udpdata[0] == 0xff) {
@@ -1038,17 +966,38 @@ static int udp_encap_rcv(struct sock * sk, struct sk_buff *skb)
 			
 			/* ESP Packet with Non-IKE marker */
 			len = sizeof(struct udphdr) + 2 * sizeof(u32);
-			goto decaps;
 		} else
 			/* Must be an IKE packet.. pass it through */
 			return 1;
+		break;
+	}
 
-	default:
-		if (net_ratelimit())
-			printk(KERN_INFO "udp_encap_rcv(): Unhandled UDP encap type: %u\n",
-			       encap_type);
-		return 1;
+	/* At this point we are sure that this is an ESPinUDP packet,
+	 * so we need to remove 'len' bytes from the packet (the UDP
+	 * header and optional ESP marker bytes) and then modify the
+	 * protocol to ESP, and then call into the transform receiver.
+	 */
+
+	/* Now we can update and verify the packet length... */
+	iph = skb->nh.iph;
+	iphlen = iph->ihl << 2;
+	iph->tot_len = htons(ntohs(iph->tot_len) - len);
+	if (skb->len < iphlen + len) {
+		/* packet is too small!?! */
+		return 0;
 	}
+
+	/* pull the data buffer up to the ESP header and set the
+	 * transport header to point to ESP.  Keep UDP on the stack
+	 * for later.
+	 */
+	skb->h.raw = skb_pull(skb, len);
+
+	/* modify the protocol (it's ESP!) */
+	iph->protocol = IPPROTO_ESP;
+
+	/* and let the caller know to send this into the ESP processor... */
+	return -1;
 #endif
 }
 
@@ -1093,7 +1042,7 @@ static int udp_queue_rcv_skb(struct sock * sk, struct sk_buff *skb)
 		if (ret < 0) {
 			/* process the ESP packet */
 			ret = xfrm4_rcv_encap(skb, up->encap_type);
-			UDP_INC_STATS_BH(UdpInDatagrams);
+			UDP_INC_STATS_BH(UDP_MIB_INDATAGRAMS);
 			return -ret;
 		}
 		/* FALLTHROUGH -- it's a UDP Packet */
@@ -1101,7 +1050,7 @@ static int udp_queue_rcv_skb(struct sock * sk, struct sk_buff *skb)
 
 	if (sk->sk_filter && skb->ip_summed != CHECKSUM_UNNECESSARY) {
 		if (__udp_checksum_complete(skb)) {
-			UDP_INC_STATS_BH(UdpInErrors);
+			UDP_INC_STATS_BH(UDP_MIB_INERRORS);
 			kfree_skb(skb);
 			return -1;
 		}
@@ -1109,11 +1058,11 @@ static int udp_queue_rcv_skb(struct sock * sk, struct sk_buff *skb)
 	}
 
 	if (sock_queue_rcv_skb(sk,skb)<0) {
-		UDP_INC_STATS_BH(UdpInErrors);
+		UDP_INC_STATS_BH(UDP_MIB_INERRORS);
 		kfree_skb(skb);
 		return -1;
 	}
-	UDP_INC_STATS_BH(UdpInDatagrams);
+	UDP_INC_STATS_BH(UDP_MIB_INDATAGRAMS);
 	return 0;
 }
 
@@ -1241,7 +1190,7 @@ int udp_rcv(struct sk_buff *skb)
 	if (udp_checksum_complete(skb))
 		goto csum_error;
 
-	UDP_INC_STATS_BH(UdpNoPorts);
+	UDP_INC_STATS_BH(UDP_MIB_NOPORTS);
 	icmp_send(skb, ICMP_DEST_UNREACH, ICMP_PORT_UNREACH, 0);
 
 	/*
@@ -1261,7 +1210,7 @@ short_packet:
 			NIPQUAD(daddr),
 			ntohs(uh->dest)));
 no_header:
-	UDP_INC_STATS_BH(UdpInErrors);
+	UDP_INC_STATS_BH(UDP_MIB_INERRORS);
 	kfree_skb(skb);
 	return(0);
 
@@ -1278,7 +1227,7 @@ csum_error:
 			ntohs(uh->dest),
 			ulen));
 drop:
-	UDP_INC_STATS_BH(UdpInErrors);
+	UDP_INC_STATS_BH(UDP_MIB_INERRORS);
 	kfree_skb(skb);
 	return(0);
 }
@@ -1323,7 +1272,16 @@ static int udp_setsockopt(struct sock *sk, int level, int optname,
 		break;
 		
 	case UDP_ENCAP:
-		up->encap_type = val;
+		switch (val) {
+		case 0:
+		case UDP_ENCAP_ESPINUDP:
+		case UDP_ENCAP_ESPINUDP_NON_IKE:
+			up->encap_type = val;
+			break;
+		default:
+			err = -ENOPROTOOPT;
+			break;
+		}
 		break;
 
 	default:
@@ -1375,7 +1333,7 @@ static int udp_getsockopt(struct sock *sk, int level, int optname,
 struct proto udp_prot = {
  	.name =		"UDP",
 	.close =	udp_close,
-	.connect =	udp_connect,
+	.connect =	ip4_datagram_connect,
 	.disconnect =	udp_disconnect,
 	.ioctl =	udp_ioctl,
 	.destroy =	udp_destroy_sock,
@@ -1579,7 +1537,6 @@ void udp4_proc_exit(void)
 }
 #endif /* CONFIG_PROC_FS */
 
-EXPORT_SYMBOL(udp_connect);
 EXPORT_SYMBOL(udp_disconnect);
 EXPORT_SYMBOL(udp_hash);
 EXPORT_SYMBOL(udp_hash_lock);
diff --git a/net/ipv4/xfrm4_output.c b/net/ipv4/xfrm4_output.c
index f65ec865a..191cec718 100644
--- a/net/ipv4/xfrm4_output.c
+++ b/net/ipv4/xfrm4_output.c
@@ -13,6 +13,7 @@
 #include <net/inet_ecn.h>
 #include <net/ip.h>
 #include <net/xfrm.h>
+#include <net/icmp.h>
 
 /* Add encapsulation header.
  *
@@ -67,6 +68,30 @@ static void xfrm4_encap(struct sk_buff *skb)
 	memset(&(IPCB(skb)->opt), 0, sizeof(struct ip_options));
 }
 
+static int xfrm4_tunnel_check_size(struct sk_buff *skb)
+{
+	int mtu, ret = 0;
+	struct dst_entry *dst;
+	struct iphdr *iph = skb->nh.iph;
+
+	if (IPCB(skb)->flags & IPSKB_XFRM_TUNNEL_SIZE)
+		goto out;
+
+	IPCB(skb)->flags |= IPSKB_XFRM_TUNNEL_SIZE;
+	
+	if (!(iph->frag_off & htons(IP_DF)))
+		goto out;
+
+	dst = skb->dst;
+	mtu = dst_pmtu(dst) - dst->header_len - dst->trailer_len;
+	if (skb->len > mtu) {
+		icmp_send(skb, ICMP_DEST_UNREACH, ICMP_FRAG_NEEDED, htonl(mtu));
+		ret = -EMSGSIZE;
+	}
+out:
+	return ret;
+}
+
 int xfrm4_output(struct sk_buff **pskb)
 {
 	struct sk_buff *skb = *pskb;
diff --git a/net/ipv4/xfrm4_policy.c b/net/ipv4/xfrm4_policy.c
index a05bd39a7..3aacce604 100644
--- a/net/ipv4/xfrm4_policy.c
+++ b/net/ipv4/xfrm4_policy.c
@@ -139,7 +139,7 @@ __xfrm4_bundle_create(struct xfrm_policy *policy, struct xfrm_state **xfrm, int
 		/* Copy neighbout for reachability confirmation */
 		dst_prev->neighbour	= neigh_clone(rt->u.dst.neighbour);
 		dst_prev->input		= rt->u.dst.input;
-		dst_prev->output	= dst_prev->xfrm->type->output;
+		dst_prev->output	= xfrm4_output;
 		if (rt->peer)
 			atomic_inc(&rt->peer->refcnt);
 		x->u.rt.peer = rt->peer;
diff --git a/net/ipv4/xfrm4_state.c b/net/ipv4/xfrm4_state.c
index ed6dbef78..b28a38813 100644
--- a/net/ipv4/xfrm4_state.c
+++ b/net/ipv4/xfrm4_state.c
@@ -11,7 +11,7 @@
 #include <linux/pfkeyv2.h>
 #include <linux/ipsec.h>
 
-extern struct xfrm_state_afinfo xfrm4_state_afinfo;
+static struct xfrm_state_afinfo xfrm4_state_afinfo;
 
 static void
 __xfrm4_init_tempsel(struct xfrm_state *x, struct flowi *fl,
@@ -74,11 +74,8 @@ __xfrm4_find_acq(u8 mode, u32 reqid, u8 proto,
 		    proto == x->id.proto &&
 		    saddr->a4 == x->props.saddr.a4 &&
 		    reqid == x->props.reqid &&
-		    x->km.state == XFRM_STATE_ACQ) {
-			    if (!x0)
-				    x0 = x;
-			    if (x->id.spi)
-				    continue;
+		    x->km.state == XFRM_STATE_ACQ &&
+		    !x->id.spi) {
 			    x0 = x;
 			    break;
 		    }
diff --git a/net/ipv4/xfrm4_tunnel.c b/net/ipv4/xfrm4_tunnel.c
index 3c9d4aaa2..0d1a0b0c7 100644
--- a/net/ipv4/xfrm4_tunnel.c
+++ b/net/ipv4/xfrm4_tunnel.c
@@ -6,82 +6,18 @@
 #include <linux/skbuff.h>
 #include <net/xfrm.h>
 #include <net/ip.h>
-#include <net/icmp.h>
-#include <net/inet_ecn.h>
-
-int xfrm4_tunnel_check_size(struct sk_buff *skb)
-{
-	int mtu, ret = 0;
-	struct dst_entry *dst;
-	struct iphdr *iph = skb->nh.iph;
-
-	if (IPCB(skb)->flags & IPSKB_XFRM_TUNNEL_SIZE)
-		goto out;
-
-	IPCB(skb)->flags |= IPSKB_XFRM_TUNNEL_SIZE;
-	
-	if (!(iph->frag_off & htons(IP_DF)))
-		goto out;
-
-	dst = skb->dst;
-	mtu = dst_pmtu(dst) - dst->header_len - dst->trailer_len;
-	if (skb->len > mtu) {
-		icmp_send(skb, ICMP_DEST_UNREACH, ICMP_FRAG_NEEDED, htonl(mtu));
-		ret = -EMSGSIZE;
-	}
-out:
-	return ret;
-}
+#include <net/protocol.h>
 
 static int ipip_output(struct sk_buff **pskb)
 {
 	struct sk_buff *skb = *pskb;
-	struct dst_entry *dst = skb->dst;
-	struct xfrm_state *x = dst->xfrm;
-	struct iphdr *iph, *top_iph;
-	int tos, err;
-
-	if ((err = xfrm4_tunnel_check_size(skb)) != 0)
-		goto error_nolock;
-		
+	struct iphdr *iph;
+	
 	iph = skb->nh.iph;
+	iph->tot_len = htons(skb->len);
+	ip_send_check(iph);
 
-	spin_lock_bh(&x->lock);
-
-	tos = iph->tos;
-
-	top_iph = (struct iphdr *) skb_push(skb, x->props.header_len);
-	top_iph->ihl = 5;
-	top_iph->version = 4;
-	top_iph->tos = INET_ECN_encapsulate(tos, iph->tos);
-	top_iph->tot_len = htons(skb->len);
-	top_iph->frag_off = iph->frag_off & ~htons(IP_MF|IP_OFFSET);
-	if (!(iph->frag_off & htons(IP_DF)))
-		__ip_select_ident(top_iph, dst, 0);
-	top_iph->ttl = iph->ttl;
-	top_iph->protocol = IPPROTO_IPIP;
-	top_iph->check = 0;
-	top_iph->saddr = x->props.saddr.a4;
-	top_iph->daddr = x->id.daddr.a4;
-	memset(&(IPCB(skb)->opt), 0, sizeof(struct ip_options));
-	ip_send_check(top_iph);
-
-	skb->nh.raw = skb->data;
-	x->curlft.bytes += skb->len;
-	x->curlft.packets++;
-
-	spin_unlock_bh(&x->lock);
-
-	if ((skb->dst = dst_pop(dst)) == NULL) {
-		kfree_skb(skb);
-		err = -EHOSTUNREACH;
-		goto error_nolock;
-	}
-	return NET_XMIT_BYPASS;
-
-error_nolock:
-	kfree_skb(skb);
-	return err;
+	return 0;
 }
 
 static int ipip_xfrm_rcv(struct xfrm_state *x, struct xfrm_decap_state *decap, struct sk_buff *skb)
@@ -167,7 +103,7 @@ static struct xfrm_type ipip_type = {
 	.output		= ipip_output
 };
 
-static struct inet_protocol ipip_protocol = {
+static struct net_protocol ipip_protocol = {
 	.handler	=	ipip_rcv,
 	.err_handler	=	ipip_err,
 	.no_policy	=	1,
diff --git a/net/ipv6/Kconfig b/net/ipv6/Kconfig
index f5b568867..23c5759c0 100644
--- a/net/ipv6/Kconfig
+++ b/net/ipv6/Kconfig
@@ -4,8 +4,6 @@
 config IPV6_PRIVACY
 	bool "IPv6: Privacy Extensions (RFC 3041) support"
 	depends on IPV6
-	select CRYPTO
-	select CRYPTO_MD5
 	---help---
 	  Privacy Extensions for Stateless Address Autoconfiguration in IPv6
 	  support.  With this option, additional periodically-alter 
diff --git a/net/ipv6/Makefile b/net/ipv6/Makefile
index 26e292c9d..d9e309fe8 100644
--- a/net/ipv6/Makefile
+++ b/net/ipv6/Makefile
@@ -10,7 +10,8 @@ ipv6-objs :=	af_inet6.o anycast.o ip6_output.o ip6_input.o addrconf.o sit.o \
 		exthdrs.o sysctl_net_ipv6.o datagram.o proc.o \
 		ip6_flowlabel.o ipv6_syms.o
 
-ipv6-$(CONFIG_XFRM) += xfrm6_policy.o xfrm6_state.o xfrm6_input.o
+ipv6-$(CONFIG_XFRM) += xfrm6_policy.o xfrm6_state.o xfrm6_input.o \
+	xfrm6_tunnel.o xfrm6_output.o
 ipv6-objs += $(ipv6-y)
 
 obj-$(CONFIG_INET6_AH) += ah6.o
diff --git a/net/ipv6/addrconf.c b/net/ipv6/addrconf.c
index 065a11e6c..40ad73c5c 100644
--- a/net/ipv6/addrconf.c
+++ b/net/ipv6/addrconf.c
@@ -696,7 +696,7 @@ retry:
 	ift = !max_addresses ||
 	      ipv6_count_addresses(idev) < max_addresses ? 
 		ipv6_add_addr(idev, &addr, tmp_plen,
-			      ipv6_addr_type(&addr)&IPV6_ADDR_SCOPE_MASK, IFA_F_TEMPORARY) : 0;
+			      ipv6_addr_type(&addr)&IPV6_ADDR_SCOPE_MASK, IFA_F_TEMPORARY) : NULL;
 	if (!ift || IS_ERR(ift)) {
 		in6_dev_put(idev);
 		in6_ifa_put(ifp);
@@ -1544,7 +1544,7 @@ int addrconf_set_dstaddr(void __user *arg)
 		p.iph.ihl = 5;
 		p.iph.protocol = IPPROTO_IPV6;
 		p.iph.ttl = 64;
-		ifr.ifr_ifru.ifru_data = (void*)&p;
+		ifr.ifr_ifru.ifru_data = (void __user *)&p;
 
 		oldfs = get_fs(); set_fs(KERNEL_DS);
 		err = dev->do_ioctl(dev, &ifr, SIOCADDTUNNEL);
@@ -3003,13 +3003,13 @@ static void ipv6_ifa_notify(int event, struct inet6_ifaddr *ifp)
 
 static
 int addrconf_sysctl_forward(ctl_table *ctl, int write, struct file * filp,
-			   void __user *buffer, size_t *lenp)
+			   void __user *buffer, size_t *lenp, loff_t *ppos)
 {
 	int *valp = ctl->data;
 	int val = *valp;
 	int ret;
 
-	ret = proc_dointvec(ctl, write, filp, buffer, lenp);
+	ret = proc_dointvec(ctl, write, filp, buffer, lenp, ppos);
 
 	if (write && *valp != val && valp != &ipv6_devconf_dflt.forwarding) {
 		struct inet6_dev *idev = NULL;
diff --git a/net/ipv6/af_inet6.c b/net/ipv6/af_inet6.c
index 33e39d220..83e832e3e 100644
--- a/net/ipv6/af_inet6.c
+++ b/net/ipv6/af_inet6.c
@@ -250,7 +250,7 @@ static int inet6_create(struct socket *sock, int protocol)
 	if (sk->sk_prot->init) {
 		int err = sk->sk_prot->init(sk);
 		if (err != 0) {
-			inet_sock_release(sk);
+			sk_common_release(sk);
 			return err;
 		}
 	}
@@ -510,10 +510,10 @@ struct proto_ops inet6_stream_ops = {
 	.ioctl =	inet6_ioctl,			/* must change  */
 	.listen =	inet_listen,			/* ok		*/
 	.shutdown =	inet_shutdown,			/* ok		*/
-	.setsockopt =	inet_setsockopt,		/* ok		*/
-	.getsockopt =	inet_getsockopt,		/* ok		*/
+	.setsockopt =	sock_common_setsockopt,		/* ok		*/
+	.getsockopt =	sock_common_getsockopt,		/* ok		*/
 	.sendmsg =	inet_sendmsg,			/* ok		*/
-	.recvmsg =	inet_recvmsg,			/* ok		*/
+	.recvmsg =	sock_common_recvmsg,		/* ok		*/
 	.mmap =		sock_no_mmap,
 	.sendpage =	tcp_sendpage
 };
@@ -531,10 +531,10 @@ struct proto_ops inet6_dgram_ops = {
 	.ioctl =	inet6_ioctl,			/* must change  */
 	.listen =	sock_no_listen,			/* ok		*/
 	.shutdown =	inet_shutdown,			/* ok		*/
-	.setsockopt =	inet_setsockopt,		/* ok		*/
-	.getsockopt =	inet_getsockopt,		/* ok		*/
+	.setsockopt =	sock_common_setsockopt,		/* ok		*/
+	.getsockopt =	sock_common_getsockopt,		/* ok		*/
 	.sendmsg =	inet_sendmsg,			/* ok		*/
-	.recvmsg =	inet_recvmsg,			/* ok		*/
+	.recvmsg =	sock_common_recvmsg,		/* ok		*/
 	.mmap =		sock_no_mmap,
 	.sendpage =	sock_no_sendpage,
 };
@@ -560,8 +560,6 @@ static struct inet_protosw rawv6_protosw = {
 	.flags		= INET_PROTOSW_REUSE,
 };
 
-#define INETSW6_ARRAY_LEN (sizeof(inetsw6_array) / sizeof(struct inet_protosw))
-
 void
 inet6_register_protosw(struct inet_protosw *p)
 {
@@ -719,13 +717,13 @@ static int __init inet6_init(void)
 	/* allocate our sock slab caches */
         tcp6_sk_cachep = kmem_cache_create("tcp6_sock",
 					   sizeof(struct tcp6_sock), 0,
-                                           SLAB_HWCACHE_ALIGN, 0, 0);
+                                           SLAB_HWCACHE_ALIGN, NULL, NULL);
         udp6_sk_cachep = kmem_cache_create("udp6_sock",
 					   sizeof(struct udp6_sock), 0,
-                                           SLAB_HWCACHE_ALIGN, 0, 0);
+                                           SLAB_HWCACHE_ALIGN, NULL, NULL);
         raw6_sk_cachep = kmem_cache_create("raw6_sock",
 					   sizeof(struct raw6_sock), 0,
-                                           SLAB_HWCACHE_ALIGN, 0, 0);
+                                           SLAB_HWCACHE_ALIGN, NULL, NULL);
         if (!tcp6_sk_cachep || !udp6_sk_cachep || !raw6_sk_cachep)
                 printk(KERN_CRIT "%s: Can't create protocol sock SLAB "
 		       "caches!\n", __FUNCTION__);
diff --git a/net/ipv6/ah6.c b/net/ipv6/ah6.c
index 185092c0d..eda2737e5 100644
--- a/net/ipv6/ah6.c
+++ b/net/ipv6/ah6.c
@@ -26,11 +26,11 @@
 
 #include <linux/config.h>
 #include <linux/module.h>
-#include <net/inet_ecn.h>
 #include <net/ip.h>
 #include <net/ah.h>
 #include <linux/crypto.h>
 #include <linux/pfkeyv2.h>
+#include <linux/string.h>
 #include <net/icmp.h>
 #include <net/ipv6.h>
 #include <net/xfrm.h>
@@ -74,137 +74,138 @@ bad:
 	return 0;
 }
 
-static int ipv6_clear_mutable_options(struct sk_buff *skb, u16 *nh_offset, int dir)
+/**
+ *	ipv6_rearrange_rthdr - rearrange IPv6 routing header
+ *	@iph: IPv6 header
+ *	@rthdr: routing header
+ *
+ *	Rearrange the destination address in @iph and the addresses in @rthdr
+ *	so that they appear in the order they will at the final destination.
+ *	See Appendix A2 of RFC 2402 for details.
+ */
+static void ipv6_rearrange_rthdr(struct ipv6hdr *iph, struct ipv6_rt_hdr *rthdr)
 {
-	u16 offset = sizeof(struct ipv6hdr);
-	struct ipv6_opt_hdr *exthdr = (struct ipv6_opt_hdr*)(skb->nh.raw + offset);
-	unsigned int packet_len = skb->tail - skb->nh.raw;
-	u8 nexthdr = skb->nh.ipv6h->nexthdr;
-	u8 nextnexthdr = 0;
+	int segments, segments_left;
+	struct in6_addr *addrs;
+	struct in6_addr final_addr;
+
+	segments_left = rthdr->segments_left;
+	if (segments_left == 0)
+		return;
+	rthdr->segments_left = 0; 
+
+	/* The value of rthdr->hdrlen has been verified either by the system
+	 * call if it is locally generated, or by ipv6_rthdr_rcv() for incoming
+	 * packets.  So we can assume that it is even and that segments is
+	 * greater than or equal to segments_left.
+	 *
+	 * For the same reason we can assume that this option is of type 0.
+	 */
+	segments = rthdr->hdrlen >> 1;
 
-	*nh_offset = ((unsigned char *)&skb->nh.ipv6h->nexthdr) - skb->nh.raw;
+	addrs = ((struct rt0_hdr *)rthdr)->addr;
+	ipv6_addr_copy(&final_addr, addrs + segments - 1);
 
-	while (offset + 1 <= packet_len) {
+	addrs += segments - segments_left;
+	memmove(addrs + 1, addrs, (segments_left - 1) * sizeof(*addrs));
 
-		switch (nexthdr) {
+	ipv6_addr_copy(addrs, &iph->daddr);
+	ipv6_addr_copy(&iph->daddr, &final_addr);
+}
 
+static int ipv6_clear_mutable_options(struct ipv6hdr *iph, int len)
+{
+	union {
+		struct ipv6hdr *iph;
+		struct ipv6_opt_hdr *opth;
+		struct ipv6_rt_hdr *rth;
+		char *raw;
+	} exthdr = { .iph = iph };
+	char *end = exthdr.raw + len;
+	int nexthdr = iph->nexthdr;
+
+	exthdr.iph++;
+
+	while (exthdr.raw < end) {
+		switch (nexthdr) {
 		case NEXTHDR_HOP:
-			*nh_offset = offset;
-			offset += ipv6_optlen(exthdr);
-			if (!zero_out_mutable_opts(exthdr)) {
-				LIMIT_NETDEBUG(
-				printk(KERN_WARNING "overrun hopopts\n")); 
-				return 0;
+		case NEXTHDR_DEST:
+			if (!zero_out_mutable_opts(exthdr.opth)) {
+				LIMIT_NETDEBUG(printk(
+					KERN_WARNING "overrun %sopts\n",
+					nexthdr == NEXTHDR_HOP ?
+						"hop" : "dest"));
+				return -EINVAL;
 			}
-			nexthdr = exthdr->nexthdr;
-			exthdr = (struct ipv6_opt_hdr*)(skb->nh.raw + offset);
 			break;
 
 		case NEXTHDR_ROUTING:
-			*nh_offset = offset;
-			offset += ipv6_optlen(exthdr);
-			((struct ipv6_rt_hdr*)exthdr)->segments_left = 0; 
-			nexthdr = exthdr->nexthdr;
-			exthdr = (struct ipv6_opt_hdr*)(skb->nh.raw + offset);
+			ipv6_rearrange_rthdr(iph, exthdr.rth);
 			break;
 
-		case NEXTHDR_DEST:
-			*nh_offset = offset;
-			offset += ipv6_optlen(exthdr);
-			if (!zero_out_mutable_opts(exthdr))  {
-				LIMIT_NETDEBUG(
-					printk(KERN_WARNING "overrun destopt\n")); 
-				return 0;
-			}
-			nexthdr = exthdr->nexthdr;
-			exthdr = (struct ipv6_opt_hdr*)(skb->nh.raw + offset);
-			break;
-
-		case NEXTHDR_AUTH:
-			if (dir == XFRM_POLICY_OUT) {
-				memset(((struct ipv6_auth_hdr*)exthdr)->auth_data, 0, 
-				       (((struct ipv6_auth_hdr*)exthdr)->hdrlen - 1) << 2);
-			}
-			if (exthdr->nexthdr == NEXTHDR_DEST) {
-				offset += (((struct ipv6_auth_hdr*)exthdr)->hdrlen + 2) << 2;
-				exthdr = (struct ipv6_opt_hdr*)(skb->nh.raw + offset);
-				nextnexthdr = exthdr->nexthdr;
-				if (!zero_out_mutable_opts(exthdr)) {
-					LIMIT_NETDEBUG(
-						printk(KERN_WARNING "overrun destopt\n"));
-					return 0;
-				}
-			}
-			return nexthdr;
 		default :
-			return nexthdr;
+			return 0;
 		}
+
+		nexthdr = exthdr.opth->nexthdr;
+		exthdr.raw += ipv6_optlen(exthdr.opth);
 	}
 
-	return nexthdr;
+	return 0;
 }
 
 int ah6_output(struct sk_buff **pskb)
 {
 	int err;
-	int hdr_len = sizeof(struct ipv6hdr);
+	int extlen;
 	struct dst_entry *dst = (*pskb)->dst;
 	struct xfrm_state *x  = dst->xfrm;
-	struct ipv6hdr *iph = NULL;
+	struct ipv6hdr *top_iph;
 	struct ip_auth_hdr *ah;
 	struct ah_data *ahp;
-	u16 nh_offset = 0;
 	u8 nexthdr;
+	char tmp_base[8];
+	struct {
+		struct in6_addr daddr;
+		char hdrs[0];
+	} *tmp_ext;
 
-	if ((*pskb)->ip_summed == CHECKSUM_HW) {
-		err = skb_checksum_help(pskb, 0);
-		if (err)
-			goto error_nolock;
-	}
+	top_iph = (struct ipv6hdr *)(*pskb)->data;
+	top_iph->payload_len = htons((*pskb)->len - sizeof(*top_iph));
 
-	spin_lock_bh(&x->lock);
-	err = xfrm_check_output(x, *pskb, AF_INET6);
-	if (err)
-		goto error;
+	nexthdr = *(*pskb)->nh.raw;
+	*(*pskb)->nh.raw = IPPROTO_AH;
 
-	if (x->props.mode) {
-		iph = (*pskb)->nh.ipv6h;
-		(*pskb)->nh.ipv6h = (struct ipv6hdr*)skb_push(*pskb, x->props.header_len);
-		(*pskb)->nh.ipv6h->version = 6;
-		(*pskb)->nh.ipv6h->payload_len = htons((*pskb)->len - sizeof(struct ipv6hdr));
-		(*pskb)->nh.ipv6h->nexthdr = IPPROTO_AH;
-		ipv6_addr_copy(&(*pskb)->nh.ipv6h->saddr,
-			       (struct in6_addr *) &x->props.saddr);
-		ipv6_addr_copy(&(*pskb)->nh.ipv6h->daddr,
-			       (struct in6_addr *) &x->id.daddr);
-		ah = (struct ip_auth_hdr*)((*pskb)->nh.ipv6h+1);
-		ah->nexthdr = IPPROTO_IPV6;
-	} else {
-		hdr_len = (*pskb)->h.raw - (*pskb)->nh.raw;
-		iph = kmalloc(hdr_len, GFP_ATOMIC);
-		if (!iph) {
+	/* When there are no extension headers, we only need to save the first
+	 * 8 bytes of the base IP header.
+	 */
+	memcpy(tmp_base, top_iph, sizeof(tmp_base));
+
+	tmp_ext = NULL;
+	extlen = (*pskb)->h.raw - (unsigned char *)(top_iph + 1);
+	if (extlen) {
+		extlen += sizeof(*tmp_ext);
+		tmp_ext = kmalloc(extlen, GFP_ATOMIC);
+		if (!tmp_ext) {
 			err = -ENOMEM;
 			goto error;
 		}
-		memcpy(iph, (*pskb)->data, hdr_len);
-		(*pskb)->nh.ipv6h = (struct ipv6hdr*)skb_push(*pskb, x->props.header_len);
-		memcpy((*pskb)->nh.ipv6h, iph, hdr_len);
-		nexthdr = ipv6_clear_mutable_options(*pskb, &nh_offset, XFRM_POLICY_OUT);
-		if (nexthdr == 0)
+		memcpy(tmp_ext, &top_iph->daddr, extlen);
+		err = ipv6_clear_mutable_options(top_iph,
+						 extlen - sizeof(*tmp_ext) +
+						 sizeof(*top_iph));
+		if (err)
 			goto error_free_iph;
-
-		(*pskb)->nh.raw[nh_offset] = IPPROTO_AH;
-		(*pskb)->nh.ipv6h->payload_len = htons((*pskb)->len - sizeof(struct ipv6hdr));
-		ah = (struct ip_auth_hdr*)((*pskb)->nh.raw+hdr_len);
-		(*pskb)->h.raw = (unsigned char*) ah;
-		ah->nexthdr = nexthdr;
 	}
 
-	(*pskb)->nh.ipv6h->priority    = 0;
-	(*pskb)->nh.ipv6h->flow_lbl[0] = 0;
-	(*pskb)->nh.ipv6h->flow_lbl[1] = 0;
-	(*pskb)->nh.ipv6h->flow_lbl[2] = 0;
-	(*pskb)->nh.ipv6h->hop_limit    = 0;
+	ah = (struct ip_auth_hdr *)(*pskb)->h.raw;
+	ah->nexthdr = nexthdr;
+
+	top_iph->priority    = 0;
+	top_iph->flow_lbl[0] = 0;
+	top_iph->flow_lbl[1] = 0;
+	top_iph->flow_lbl[2] = 0;
+	top_iph->hop_limit   = 0;
 
 	ahp = x->data;
 	ah->hdrlen  = (XFRM_ALIGN8(sizeof(struct ipv6_auth_hdr) + 
@@ -215,37 +216,16 @@ int ah6_output(struct sk_buff **pskb)
 	ah->seq_no = htonl(++x->replay.oseq);
 	ahp->icv(ahp, *pskb, ah->auth_data);
 
-	if (x->props.mode) {
-		(*pskb)->nh.ipv6h->hop_limit   = iph->hop_limit;
-		(*pskb)->nh.ipv6h->priority    = iph->priority; 	
-		(*pskb)->nh.ipv6h->flow_lbl[0] = iph->flow_lbl[0];
-		(*pskb)->nh.ipv6h->flow_lbl[1] = iph->flow_lbl[1];
-		(*pskb)->nh.ipv6h->flow_lbl[2] = iph->flow_lbl[2];
-		if (x->props.flags & XFRM_STATE_NOECN)
-			IP6_ECN_clear((*pskb)->nh.ipv6h);
-	} else {
-		memcpy((*pskb)->nh.ipv6h, iph, hdr_len);
-		(*pskb)->nh.raw[nh_offset] = IPPROTO_AH;
-		(*pskb)->nh.ipv6h->payload_len = htons((*pskb)->len - sizeof(struct ipv6hdr));
-		kfree (iph);
-	}
-
-	(*pskb)->nh.raw = (*pskb)->data;
+	err = 0;
 
-	x->curlft.bytes += (*pskb)->len;
-	x->curlft.packets++;
-	spin_unlock_bh(&x->lock);
-	if (((*pskb)->dst = dst_pop(dst)) == NULL) {
-		err = -EHOSTUNREACH;
-		goto error_nolock;
-	}
-	return NET_XMIT_BYPASS;
+	memcpy(top_iph, tmp_base, sizeof(tmp_base));
+	if (tmp_ext) {
+		memcpy(&top_iph->daddr, tmp_ext, extlen);
 error_free_iph:
-	kfree(iph);
+		kfree(tmp_ext);
+	}
+
 error:
-	spin_unlock_bh(&x->lock);
-error_nolock:
-	kfree_skb(*pskb);
 	return err;
 }
 
@@ -255,7 +235,6 @@ int ah6_input(struct xfrm_state *x, struct xfrm_decap_state *decap, struct sk_bu
 	 * Before process AH
 	 * [IPv6][Ext1][Ext2][AH][Dest][Payload]
 	 * |<-------------->| hdr_len
-	 * |<------------------------>| cleared_hlen
 	 *
 	 * To erase AH:
 	 * Keeping copy of cleared headers. After AH processing,
@@ -272,10 +251,7 @@ int ah6_input(struct xfrm_state *x, struct xfrm_decap_state *decap, struct sk_bu
 	unsigned char *tmp_hdr = NULL;
 	u16 hdr_len;
 	u16 ah_hlen;
-	u16 cleared_hlen;
-	u16 nh_offset = 0;
-	u8 nexthdr = 0;
-	u8 *prevhdr;
+	int nexthdr;
 
 	if (!pskb_may_pull(skb, sizeof(struct ip_auth_hdr)))
 		goto out;
@@ -287,17 +263,10 @@ int ah6_input(struct xfrm_state *x, struct xfrm_decap_state *decap, struct sk_bu
 		goto out;
 
 	hdr_len = skb->data - skb->nh.raw;
-	cleared_hlen = hdr_len;
 	ah = (struct ipv6_auth_hdr*)skb->data;
 	ahp = x->data;
 	nexthdr = ah->nexthdr;
 	ah_hlen = (ah->hdrlen + 2) << 2;
-	cleared_hlen += ah_hlen;
-
-	if (nexthdr == NEXTHDR_DEST) {
-		struct ipv6_opt_hdr *dsthdr = (struct ipv6_opt_hdr*)(skb->data + ah_hlen);
-		cleared_hlen += ipv6_optlen(dsthdr);
-	}
 
         if (ah_hlen != XFRM_ALIGN8(sizeof(struct ipv6_auth_hdr) + ahp->icv_full_len) &&
             ah_hlen != XFRM_ALIGN8(sizeof(struct ipv6_auth_hdr) + ahp->icv_trunc_len))
@@ -306,11 +275,12 @@ int ah6_input(struct xfrm_state *x, struct xfrm_decap_state *decap, struct sk_bu
 	if (!pskb_may_pull(skb, ah_hlen))
 		goto out;
 
-	tmp_hdr = kmalloc(cleared_hlen, GFP_ATOMIC);
+	tmp_hdr = kmalloc(hdr_len, GFP_ATOMIC);
 	if (!tmp_hdr)
 		goto out;
-	memcpy(tmp_hdr, skb->nh.raw, cleared_hlen);
-	ipv6_clear_mutable_options(skb, &nh_offset, XFRM_POLICY_IN);
+	memcpy(tmp_hdr, skb->nh.raw, hdr_len);
+	if (ipv6_clear_mutable_options(skb->nh.ipv6h, hdr_len))
+		goto out;
 	skb->nh.ipv6h->priority    = 0;
 	skb->nh.ipv6h->flow_lbl[0] = 0;
 	skb->nh.ipv6h->flow_lbl[1] = 0;
@@ -334,13 +304,6 @@ int ah6_input(struct xfrm_state *x, struct xfrm_decap_state *decap, struct sk_bu
 
 	skb->nh.raw = skb_pull(skb, ah_hlen);
 	memcpy(skb->nh.raw, tmp_hdr, hdr_len);
-	if (nexthdr == NEXTHDR_DEST) {
-		memcpy(skb->nh.raw + hdr_len,
-		       tmp_hdr + hdr_len + ah_hlen,
-		       cleared_hlen - hdr_len - ah_hlen);
-	}
-	prevhdr = (u8*)(skb->nh.raw + nh_offset);
-	*prevhdr = nexthdr;
 	skb->nh.ipv6h->payload_len = htons(skb->len - sizeof(struct ipv6hdr));
 	skb_pull(skb, hdr_len);
 	skb->h.raw = skb->data;
diff --git a/net/ipv6/anycast.c b/net/ipv6/anycast.c
index c966d0628..5b1e4d959 100644
--- a/net/ipv6/anycast.c
+++ b/net/ipv6/anycast.c
@@ -202,7 +202,7 @@ int ipv6_sock_ac_drop(struct sock *sk, int ifindex, struct in6_addr *addr)
 	struct ipv6_ac_socklist *pac, *prev_pac;
 
 	write_lock_bh(&ipv6_sk_ac_lock);
-	prev_pac = 0;
+	prev_pac = NULL;
 	for (pac = np->ipv6_ac_list; pac; pac = pac->acl_next) {
 		if ((ifindex == 0 || pac->acl_ifindex == ifindex) &&
 		     ipv6_addr_cmp(&pac->acl_addr, addr) == 0)
@@ -232,13 +232,13 @@ int ipv6_sock_ac_drop(struct sock *sk, int ifindex, struct in6_addr *addr)
 void ipv6_sock_ac_close(struct sock *sk)
 {
 	struct ipv6_pinfo *np = inet6_sk(sk);
-	struct net_device *dev = 0;
+	struct net_device *dev = NULL;
 	struct ipv6_ac_socklist *pac;
 	int	prev_index;
 
 	write_lock_bh(&ipv6_sk_ac_lock);
 	pac = np->ipv6_ac_list;
-	np->ipv6_ac_list = 0;
+	np->ipv6_ac_list = NULL;
 	write_unlock_bh(&ipv6_sk_ac_lock);
 
 	prev_index = 0;
@@ -373,7 +373,7 @@ int ipv6_dev_ac_dec(struct net_device *dev, struct in6_addr *addr)
 		return -ENODEV;
 
 	write_lock_bh(&idev->lock);
-	prev_aca = 0;
+	prev_aca = NULL;
 	for (aca = idev->ac_list; aca; aca = aca->aca_next) {
 		if (ipv6_addr_cmp(&aca->aca_addr, addr) == 0)
 			break;
diff --git a/net/ipv6/datagram.c b/net/ipv6/datagram.c
index 8bd78996b..8b1cf3ea4 100644
--- a/net/ipv6/datagram.c
+++ b/net/ipv6/datagram.c
@@ -28,10 +28,166 @@
 #include <net/ndisc.h>
 #include <net/addrconf.h>
 #include <net/transp_v6.h>
+#include <net/ip6_route.h>
 
 #include <linux/errqueue.h>
 #include <asm/uaccess.h>
 
+int ip6_datagram_connect(struct sock *sk, struct sockaddr *uaddr, int addr_len)
+{
+	struct sockaddr_in6	*usin = (struct sockaddr_in6 *) uaddr;
+	struct inet_opt      	*inet = inet_sk(sk);
+	struct ipv6_pinfo      	*np = inet6_sk(sk);
+	struct in6_addr		*daddr;
+	struct dst_entry	*dst;
+	struct flowi		fl;
+	struct ip6_flowlabel	*flowlabel = NULL;
+	int			addr_type;
+	int			err;
+
+	if (usin->sin6_family == AF_INET) {
+		if (__ipv6_only_sock(sk))
+			return -EAFNOSUPPORT;
+		err = ip4_datagram_connect(sk, uaddr, addr_len);
+		goto ipv4_connected;
+	}
+
+	if (addr_len < SIN6_LEN_RFC2133)
+	  	return -EINVAL;
+
+	if (usin->sin6_family != AF_INET6) 
+	  	return -EAFNOSUPPORT;
+
+	memset(&fl, 0, sizeof(fl));
+	if (np->sndflow) {
+		fl.fl6_flowlabel = usin->sin6_flowinfo&IPV6_FLOWINFO_MASK;
+		if (fl.fl6_flowlabel&IPV6_FLOWLABEL_MASK) {
+			flowlabel = fl6_sock_lookup(sk, fl.fl6_flowlabel);
+			if (flowlabel == NULL)
+				return -EINVAL;
+			ipv6_addr_copy(&usin->sin6_addr, &flowlabel->dst);
+		}
+	}
+
+	addr_type = ipv6_addr_type(&usin->sin6_addr);
+
+	if (addr_type == IPV6_ADDR_ANY) {
+		/*
+		 *	connect to self
+		 */
+		usin->sin6_addr.s6_addr[15] = 0x01;
+	}
+
+	daddr = &usin->sin6_addr;
+
+	if (addr_type == IPV6_ADDR_MAPPED) {
+		struct sockaddr_in sin;
+
+		if (__ipv6_only_sock(sk)) {
+			err = -ENETUNREACH;
+			goto out;
+		}
+		sin.sin_family = AF_INET;
+		sin.sin_addr.s_addr = daddr->s6_addr32[3];
+		sin.sin_port = usin->sin6_port;
+
+		err = ip4_datagram_connect(sk, 
+					   (struct sockaddr*) &sin, 
+					   sizeof(sin));
+
+ipv4_connected:
+		if (err)
+			goto out;
+		
+		ipv6_addr_set(&np->daddr, 0, 0, htonl(0x0000ffff), inet->daddr);
+
+		if (ipv6_addr_any(&np->saddr)) {
+			ipv6_addr_set(&np->saddr, 0, 0, htonl(0x0000ffff),
+				      inet->saddr);
+		}
+
+		if (ipv6_addr_any(&np->rcv_saddr)) {
+			ipv6_addr_set(&np->rcv_saddr, 0, 0, htonl(0x0000ffff),
+				      inet->rcv_saddr);
+		}
+		goto out;
+	}
+
+	if (addr_type&IPV6_ADDR_LINKLOCAL) {
+		if (addr_len >= sizeof(struct sockaddr_in6) &&
+		    usin->sin6_scope_id) {
+			if (sk->sk_bound_dev_if &&
+			    sk->sk_bound_dev_if != usin->sin6_scope_id) {
+				err = -EINVAL;
+				goto out;
+			}
+			sk->sk_bound_dev_if = usin->sin6_scope_id;
+			if (!sk->sk_bound_dev_if &&
+			    (addr_type & IPV6_ADDR_MULTICAST))
+				fl.oif = np->mcast_oif;
+		}
+
+		/* Connect to link-local address requires an interface */
+		if (!sk->sk_bound_dev_if) {
+			err = -EINVAL;
+			goto out;
+		}
+	}
+
+	ipv6_addr_copy(&np->daddr, daddr);
+	np->flow_label = fl.fl6_flowlabel;
+
+	inet->dport = usin->sin6_port;
+
+	/*
+	 *	Check for a route to destination an obtain the
+	 *	destination cache for it.
+	 */
+
+	fl.proto = sk->sk_protocol;
+	ipv6_addr_copy(&fl.fl6_dst, &np->daddr);
+	ipv6_addr_copy(&fl.fl6_src, &np->saddr);
+	fl.oif = sk->sk_bound_dev_if;
+	fl.fl_ip_dport = inet->dport;
+	fl.fl_ip_sport = inet->sport;
+
+	if (!fl.oif && (addr_type&IPV6_ADDR_MULTICAST))
+		fl.oif = np->mcast_oif;
+
+	if (flowlabel) {
+		if (flowlabel->opt && flowlabel->opt->srcrt) {
+			struct rt0_hdr *rt0 = (struct rt0_hdr *) flowlabel->opt->srcrt;
+			ipv6_addr_copy(&fl.fl6_dst, rt0->addr);
+		}
+	} else if (np->opt && np->opt->srcrt) {
+		struct rt0_hdr *rt0 = (struct rt0_hdr *)np->opt->srcrt;
+		ipv6_addr_copy(&fl.fl6_dst, rt0->addr);
+	}
+
+	err = ip6_dst_lookup(sk, &dst, &fl);
+	if (err)
+		goto out;
+
+	/* source address lookup done in ip6_dst_lookup */
+
+	if (ipv6_addr_any(&np->saddr))
+		ipv6_addr_copy(&np->saddr, &fl.fl6_src);
+
+	if (ipv6_addr_any(&np->rcv_saddr)) {
+		ipv6_addr_copy(&np->rcv_saddr, &fl.fl6_src);
+		inet->rcv_saddr = LOOPBACK4_IPV6;
+	}
+
+	ip6_dst_store(sk, dst,
+		      !ipv6_addr_cmp(&fl.fl6_dst, &np->daddr) ?
+		      &np->daddr : NULL);
+
+	sk->sk_state = TCP_ESTABLISHED;
+out:
+	fl6_sock_release(flowlabel);
+	return err;
+}
+
 void ipv6_icmp_error(struct sock *sk, struct sk_buff *skb, int err, 
 		     u16 port, u32 info, u8 *payload)
 {
diff --git a/net/ipv6/esp6.c b/net/ipv6/esp6.c
index 8156942b1..497727195 100644
--- a/net/ipv6/esp6.c
+++ b/net/ipv6/esp6.c
@@ -26,7 +26,6 @@
 
 #include <linux/config.h>
 #include <linux/module.h>
-#include <net/inet_ecn.h>
 #include <net/ip.h>
 #include <net/xfrm.h>
 #include <net/esp.h>
@@ -38,15 +37,13 @@
 #include <net/ipv6.h>
 #include <linux/icmpv6.h>
 
-#define MAX_SG_ONSTACK 4
-
 int esp6_output(struct sk_buff **pskb)
 {
 	int err;
-	int hdr_len = 0;
+	int hdr_len;
 	struct dst_entry *dst = (*pskb)->dst;
 	struct xfrm_state *x  = dst->xfrm;
-	struct ipv6hdr *iph = NULL, *top_iph;
+	struct ipv6hdr *top_iph;
 	struct ipv6_esp_hdr *esph;
 	struct crypto_tfm *tfm;
 	struct esp_data *esp;
@@ -55,42 +52,20 @@ int esp6_output(struct sk_buff **pskb)
 	int clen;
 	int alen;
 	int nfrags;
-	u8 *prevhdr;
-	u8 nexthdr = 0;
-
-	if ((*pskb)->ip_summed == CHECKSUM_HW) {
-		err = skb_checksum_help(pskb, 0);
-		if (err)
-			goto error_nolock;
-	}
-
-	spin_lock_bh(&x->lock);
-	err = xfrm_check_output(x, *pskb, AF_INET6);
-	if (err)
-		goto error;
-	err = -ENOMEM;
 
-	/* Strip IP header in transport mode. Save it. */
+	esp = x->data;
+	hdr_len = (*pskb)->h.raw - (*pskb)->data +
+		  sizeof(*esph) + esp->conf.ivlen;
 
-	if (!x->props.mode) {
-		hdr_len = ip6_find_1stfragopt(*pskb, &prevhdr);
-		nexthdr = *prevhdr;
-		*prevhdr = IPPROTO_ESP;
-		iph = kmalloc(hdr_len, GFP_ATOMIC);
-		if (!iph) {
-			err = -ENOMEM;
-			goto error;
-		}
-		memcpy(iph, (*pskb)->nh.raw, hdr_len);
-		__skb_pull(*pskb, hdr_len);
-	}
+	/* Strip IP+ESP header. */
+	__skb_pull(*pskb, hdr_len);
 
 	/* Now skb is pure payload to encrypt */
+	err = -ENOMEM;
 
 	/* Round to block size */
 	clen = (*pskb)->len;
 
-	esp = x->data;
 	alen = esp->auth.icv_trunc_len;
 	tfm = esp->conf.tfm;
 	blksize = (crypto_tfm_alg_blocksize(tfm) + 3) & ~3;
@@ -99,7 +74,6 @@ int esp6_output(struct sk_buff **pskb)
 		clen = (clen + esp->conf.padlen-1)&~(esp->conf.padlen-1);
 
 	if ((nfrags = skb_cow_data(*pskb, clen-(*pskb)->len+alen, &trailer)) < 0) {
-		if (!x->props.mode && iph) kfree(iph);
 		goto error;
 	}
 
@@ -112,34 +86,11 @@ int esp6_output(struct sk_buff **pskb)
 	*(u8*)(trailer->tail + clen-(*pskb)->len - 2) = (clen - (*pskb)->len)-2;
 	pskb_put(*pskb, trailer, clen - (*pskb)->len);
 
-	if (x->props.mode) {
-		iph = (*pskb)->nh.ipv6h;
-		top_iph = (struct ipv6hdr*)skb_push(*pskb, x->props.header_len);
-		esph = (struct ipv6_esp_hdr*)(top_iph+1);
-		*(u8*)(trailer->tail - 1) = IPPROTO_IPV6;
-		top_iph->version = 6;
-		top_iph->priority = iph->priority;
-		top_iph->flow_lbl[0] = iph->flow_lbl[0];
-		top_iph->flow_lbl[1] = iph->flow_lbl[1];
-		top_iph->flow_lbl[2] = iph->flow_lbl[2];
-		if (x->props.flags & XFRM_STATE_NOECN)
-			IP6_ECN_clear(top_iph);
-		top_iph->nexthdr = IPPROTO_ESP;
-		top_iph->payload_len = htons((*pskb)->len + alen - sizeof(struct ipv6hdr));
-		top_iph->hop_limit = iph->hop_limit;
-		ipv6_addr_copy(&top_iph->saddr,
-			       (struct in6_addr *)&x->props.saddr);
-		ipv6_addr_copy(&top_iph->daddr,
-			       (struct in6_addr *)&x->id.daddr);
-	} else { 
-		esph = (struct ipv6_esp_hdr*)skb_push(*pskb, x->props.header_len);
-		(*pskb)->h.raw = (unsigned char*)esph;
-		top_iph = (struct ipv6hdr*)skb_push(*pskb, hdr_len);
-		memcpy(top_iph, iph, hdr_len);
-		kfree(iph);
-		top_iph->payload_len = htons((*pskb)->len + alen - sizeof(struct ipv6hdr));
-		*(u8*)(trailer->tail - 1) = nexthdr;
-	}
+	top_iph = (struct ipv6hdr *)__skb_push(*pskb, hdr_len);
+	esph = (struct ipv6_esp_hdr *)(*pskb)->h.raw;
+	top_iph->payload_len = htons((*pskb)->len + alen - sizeof(*top_iph));
+	*(u8*)(trailer->tail - 1) = *(*pskb)->nh.raw;
+	*(*pskb)->nh.raw = IPPROTO_ESP;
 
 	esph->spi = x->id.spi;
 	esph->seq_no = htonl(++x->replay.oseq);
@@ -148,17 +99,16 @@ int esp6_output(struct sk_buff **pskb)
 		crypto_cipher_set_iv(tfm, esp->conf.ivec, crypto_tfm_alg_ivsize(tfm));
 
 	do {
-		struct scatterlist sgbuf[nfrags>MAX_SG_ONSTACK ? 0 : nfrags];
-		struct scatterlist *sg = sgbuf;
+		struct scatterlist *sg = &esp->sgbuf[0];
 
-		if (unlikely(nfrags > MAX_SG_ONSTACK)) {
+		if (unlikely(nfrags > ESP_NUM_FAST_SG)) {
 			sg = kmalloc(sizeof(struct scatterlist)*nfrags, GFP_ATOMIC);
 			if (!sg)
 				goto error;
 		}
 		skb_to_sgvec(*pskb, sg, esph->enc_data+esp->conf.ivlen-(*pskb)->data, clen);
 		crypto_cipher_encrypt(tfm, sg, sg, clen);
-		if (unlikely(sg != sgbuf))
+		if (unlikely(sg != &esp->sgbuf[0]))
 			kfree(sg);
 	} while (0);
 
@@ -173,21 +123,9 @@ int esp6_output(struct sk_buff **pskb)
 		pskb_put(*pskb, trailer, alen);
 	}
 
-	(*pskb)->nh.raw = (*pskb)->data;
-
-	x->curlft.bytes += (*pskb)->len;
-	x->curlft.packets++;
-	spin_unlock_bh(&x->lock);
-	if (((*pskb)->dst = dst_pop(dst)) == NULL) {
-		err = -EHOSTUNREACH;
-		goto error_nolock;
-	}
-	return NET_XMIT_BYPASS;
+	err = 0;
 
 error:
-	spin_unlock_bh(&x->lock);
-error_nolock:
-	kfree_skb(*pskb);
 	return err;
 }
 
@@ -256,12 +194,10 @@ int esp6_input(struct xfrm_state *x, struct xfrm_decap_state *decap, struct sk_b
 
         {
 		u8 nexthdr[2];
-		struct scatterlist sgbuf[nfrags>MAX_SG_ONSTACK ? 0 : nfrags];
-		struct scatterlist *sg = sgbuf;
+		struct scatterlist *sg = &esp->sgbuf[0];
 		u8 padlen;
-		u8 *prevhdr;
 
-		if (unlikely(nfrags > MAX_SG_ONSTACK)) {
+		if (unlikely(nfrags > ESP_NUM_FAST_SG)) {
 			sg = kmalloc(sizeof(struct scatterlist)*nfrags, GFP_ATOMIC);
 			if (!sg) {
 				ret = -ENOMEM;
@@ -270,7 +206,7 @@ int esp6_input(struct xfrm_state *x, struct xfrm_decap_state *decap, struct sk_b
 		}
 		skb_to_sgvec(skb, sg, sizeof(struct ipv6_esp_hdr) + esp->conf.ivlen, elen);
 		crypto_cipher_decrypt(esp->conf.tfm, sg, sg, elen);
-		if (unlikely(sg != sgbuf))
+		if (unlikely(sg != &esp->sgbuf[0]))
 			kfree(sg);
 
 		if (skb_copy_bits(skb, skb->len-alen-2, nexthdr, 2))
@@ -290,8 +226,7 @@ int esp6_input(struct xfrm_state *x, struct xfrm_decap_state *decap, struct sk_b
 		skb->nh.raw += sizeof(struct ipv6_esp_hdr) + esp->conf.ivlen;
 		memcpy(skb->nh.raw, tmp_hdr, hdr_len);
 		skb->nh.ipv6h->payload_len = htons(skb->len - sizeof(struct ipv6hdr));
-		ip6_find_1stfragopt(skb, &prevhdr);
-		ret = *prevhdr = nexthdr[1];
+		ret = nexthdr[1];
 	}
 
 out:
diff --git a/net/ipv6/exthdrs.c b/net/ipv6/exthdrs.c
index ff12dcf3e..464a3f4d6 100644
--- a/net/ipv6/exthdrs.c
+++ b/net/ipv6/exthdrs.c
@@ -159,7 +159,7 @@ static int ipv6_destopt_rcv(struct sk_buff **skbp, unsigned int *nhoffp)
 
 	if (!pskb_may_pull(skb, (skb->h.raw-skb->data)+8) ||
 	    !pskb_may_pull(skb, (skb->h.raw-skb->data)+((skb->h.raw[1]+1)<<3))) {
-		IP6_INC_STATS_BH(InHdrErrors);
+		IP6_INC_STATS_BH(IPSTATS_MIB_INHDRERRORS);
 		kfree_skb(skb);
 		return -1;
 	}
@@ -172,7 +172,7 @@ static int ipv6_destopt_rcv(struct sk_buff **skbp, unsigned int *nhoffp)
 		return 1;
 	}
 
-	IP6_INC_STATS_BH(InHdrErrors);
+	IP6_INC_STATS_BH(IPSTATS_MIB_INHDRERRORS);
 	return -1;
 }
 
@@ -227,7 +227,7 @@ static int ipv6_rthdr_rcv(struct sk_buff **skbp, unsigned int *nhoffp)
 
 	if (!pskb_may_pull(skb, (skb->h.raw-skb->data)+8) ||
 	    !pskb_may_pull(skb, (skb->h.raw-skb->data)+((skb->h.raw[1]+1)<<3))) {
-		IP6_INC_STATS_BH(InHdrErrors);
+		IP6_INC_STATS_BH(IPSTATS_MIB_INHDRERRORS);
 		kfree_skb(skb);
 		return -1;
 	}
@@ -236,7 +236,7 @@ static int ipv6_rthdr_rcv(struct sk_buff **skbp, unsigned int *nhoffp)
 
 	if (ipv6_addr_is_multicast(&skb->nh.ipv6h->daddr) ||
 	    skb->pkt_type != PACKET_HOST) {
-		IP6_INC_STATS_BH(InAddrErrors);
+		IP6_INC_STATS_BH(IPSTATS_MIB_INADDRERRORS);
 		kfree_skb(skb);
 		return -1;
 	}
@@ -252,13 +252,13 @@ looped_back:
 	}
 
 	if (hdr->type != IPV6_SRCRT_TYPE_0) {
-		IP6_INC_STATS_BH(InHdrErrors);
+		IP6_INC_STATS_BH(IPSTATS_MIB_INHDRERRORS);
 		icmpv6_param_prob(skb, ICMPV6_HDR_FIELD, (&hdr->type) - skb->nh.raw);
 		return -1;
 	}
 	
 	if (hdr->hdrlen & 0x01) {
-		IP6_INC_STATS_BH(InHdrErrors);
+		IP6_INC_STATS_BH(IPSTATS_MIB_INHDRERRORS);
 		icmpv6_param_prob(skb, ICMPV6_HDR_FIELD, (&hdr->hdrlen) - skb->nh.raw);
 		return -1;
 	}
@@ -271,7 +271,7 @@ looped_back:
 	n = hdr->hdrlen >> 1;
 
 	if (hdr->segments_left > n) {
-		IP6_INC_STATS_BH(InHdrErrors);
+		IP6_INC_STATS_BH(IPSTATS_MIB_INHDRERRORS);
 		icmpv6_param_prob(skb, ICMPV6_HDR_FIELD, (&hdr->segments_left) - skb->nh.raw);
 		return -1;
 	}
@@ -284,7 +284,7 @@ looped_back:
 		kfree_skb(skb);
 		/* the copy is a forwarded packet */
 		if (skb2 == NULL) {
-			IP6_INC_STATS_BH(OutDiscards);	
+			IP6_INC_STATS_BH(IPSTATS_MIB_OUTDISCARDS);	
 			return -1;
 		}
 		*skbp = skb = skb2;
@@ -302,7 +302,7 @@ looped_back:
 	addr += i - 1;
 
 	if (ipv6_addr_is_multicast(addr)) {
-		IP6_INC_STATS_BH(InAddrErrors);
+		IP6_INC_STATS_BH(IPSTATS_MIB_INADDRERRORS);
 		kfree_skb(skb);
 		return -1;
 	}
@@ -319,7 +319,7 @@ looped_back:
 	}
 	if (skb->dst->dev->flags&IFF_LOOPBACK) {
 		if (skb->nh.ipv6h->hop_limit <= 1) {
-			IP6_INC_STATS_BH(InHdrErrors);
+			IP6_INC_STATS_BH(IPSTATS_MIB_INHDRERRORS);
 			icmpv6_send(skb, ICMPV6_TIME_EXCEED, ICMPV6_EXC_HOPLIMIT,
 				    0, skb->dev);
 			kfree_skb(skb);
@@ -436,24 +436,24 @@ static int ipv6_hop_jumbo(struct sk_buff *skb, int optoff)
 	if (skb->nh.raw[optoff+1] != 4 || (optoff&3) != 2) {
 		LIMIT_NETDEBUG(
 			 printk(KERN_DEBUG "ipv6_hop_jumbo: wrong jumbo opt length/alignment %d\n", skb->nh.raw[optoff+1]));
-		IP6_INC_STATS_BH(InHdrErrors);
+		IP6_INC_STATS_BH(IPSTATS_MIB_INHDRERRORS);
 		goto drop;
 	}
 
 	pkt_len = ntohl(*(u32*)(skb->nh.raw+optoff+2));
 	if (pkt_len <= IPV6_MAXPLEN) {
-		IP6_INC_STATS_BH(InHdrErrors);
+		IP6_INC_STATS_BH(IPSTATS_MIB_INHDRERRORS);
 		icmpv6_param_prob(skb, ICMPV6_HDR_FIELD, optoff+2);
 		return 0;
 	}
 	if (skb->nh.ipv6h->payload_len) {
-		IP6_INC_STATS_BH(InHdrErrors);
+		IP6_INC_STATS_BH(IPSTATS_MIB_INHDRERRORS);
 		icmpv6_param_prob(skb, ICMPV6_HDR_FIELD, optoff);
 		return 0;
 	}
 
 	if (pkt_len > skb->len - sizeof(struct ipv6hdr)) {
-		IP6_INC_STATS_BH(InTruncatedPkts);
+		IP6_INC_STATS_BH(IPSTATS_MIB_INTRUNCATEDPKTS);
 		goto drop;
 	}
 	if (pkt_len + sizeof(struct ipv6hdr) < skb->len) {
diff --git a/net/ipv6/icmp.c b/net/ipv6/icmp.c
index cfecd15d9..4faafff32 100644
--- a/net/ipv6/icmp.c
+++ b/net/ipv6/icmp.c
@@ -55,7 +55,7 @@
 #include <net/sock.h>
 
 #include <net/ipv6.h>
-#include <net/checksum.h>
+#include <net/ip6_checksum.h>
 #include <net/protocol.h>
 #include <net/raw.h>
 #include <net/rawv6.h>
@@ -174,7 +174,7 @@ static inline int icmpv6_xrlim_allow(struct sock *sk, int type,
 	 */
 	dst = ip6_route_output(sk, fl);
 	if (dst->error) {
-		IP6_INC_STATS(OutNoRoutes);
+		IP6_INC_STATS(IPSTATS_MIB_OUTNOROUTES);
 	} else if (dst->dev && (dst->dev->flags&IFF_LOOPBACK)) {
 		res = 1;
 	} else {
@@ -404,8 +404,8 @@ void icmpv6_send(struct sk_buff *skb, int type, int code, __u32 info,
 	err = icmpv6_push_pending_frames(sk, &fl, &tmp_hdr, len + sizeof(struct icmp6hdr));
 
 	if (type >= ICMPV6_DEST_UNREACH && type <= ICMPV6_PARAMPROB)
-		ICMP6_INC_STATS_OFFSET_BH(idev, Icmp6OutDestUnreachs, type - ICMPV6_DEST_UNREACH);
-	ICMP6_INC_STATS_BH(idev, Icmp6OutMsgs);
+		ICMP6_INC_STATS_OFFSET_BH(idev, ICMP6_MIB_OUTDESTUNREACHS, type - ICMPV6_DEST_UNREACH);
+	ICMP6_INC_STATS_BH(idev, ICMP6_MIB_OUTMSGS);
 
 out_put:
 	if (likely(idev != NULL))
@@ -480,8 +480,8 @@ static void icmpv6_echo_reply(struct sk_buff *skb)
 	}
 	err = icmpv6_push_pending_frames(sk, &fl, &tmp_hdr, skb->len + sizeof(struct icmp6hdr));
 
-        ICMP6_INC_STATS_BH(idev, Icmp6OutEchoReplies);
-        ICMP6_INC_STATS_BH(idev, Icmp6OutMsgs);
+        ICMP6_INC_STATS_BH(idev, ICMP6_MIB_OUTECHOREPLIES);
+        ICMP6_INC_STATS_BH(idev, ICMP6_MIB_OUTMSGS);
 
 out_put: 
 	if (likely(idev != NULL))
@@ -560,7 +560,7 @@ static int icmpv6_rcv(struct sk_buff **pskb, unsigned int *nhoffp)
 	struct icmp6hdr *hdr;
 	int type;
 
-	ICMP6_INC_STATS_BH(idev, Icmp6InMsgs);
+	ICMP6_INC_STATS_BH(idev, ICMP6_MIB_INMSGS);
 
 	saddr = &skb->nh.ipv6h->saddr;
 	daddr = &skb->nh.ipv6h->daddr;
@@ -593,9 +593,9 @@ static int icmpv6_rcv(struct sk_buff **pskb, unsigned int *nhoffp)
 	type = hdr->icmp6_type;
 
 	if (type >= ICMPV6_DEST_UNREACH && type <= ICMPV6_PARAMPROB)
-		ICMP6_INC_STATS_OFFSET_BH(idev, Icmp6InDestUnreachs, type - ICMPV6_DEST_UNREACH);
+		ICMP6_INC_STATS_OFFSET_BH(idev, ICMP6_MIB_INDESTUNREACHS, type - ICMPV6_DEST_UNREACH);
 	else if (type >= ICMPV6_ECHO_REQUEST && type <= NDISC_REDIRECT)
-		ICMP6_INC_STATS_OFFSET_BH(idev, Icmp6InEchos, type - ICMPV6_ECHO_REQUEST);
+		ICMP6_INC_STATS_OFFSET_BH(idev, ICMP6_MIB_INECHOS, type - ICMPV6_ECHO_REQUEST);
 
 	switch (type) {
 	case ICMPV6_ECHO_REQUEST:
@@ -646,7 +646,13 @@ static int icmpv6_rcv(struct sk_buff **pskb, unsigned int *nhoffp)
 		break;
 
 	case ICMPV6_MGM_REDUCTION:
+	case ICMPV6_NI_QUERY:
+	case ICMPV6_NI_REPLY:
 	case ICMPV6_MLD2_REPORT:
+	case ICMPV6_DHAAD_REQUEST:
+	case ICMPV6_DHAAD_REPLY:
+	case ICMPV6_MOBILE_PREFIX_SOL:
+	case ICMPV6_MOBILE_PREFIX_ADV:
 		break;
 
 	default:
@@ -668,7 +674,7 @@ static int icmpv6_rcv(struct sk_buff **pskb, unsigned int *nhoffp)
 	return 0;
 
 discard_it:
-	ICMP6_INC_STATS_BH(idev, Icmp6InErrors);
+	ICMP6_INC_STATS_BH(idev, ICMP6_MIB_INERRORS);
 	kfree_skb(skb);
 	return 0;
 }
diff --git a/net/ipv6/ip6_fib.c b/net/ipv6/ip6_fib.c
index 5d51e9706..65a137241 100644
--- a/net/ipv6/ip6_fib.c
+++ b/net/ipv6/ip6_fib.c
@@ -94,7 +94,7 @@ static __u32 rt_sernum;
 
 static struct timer_list ip6_fib_timer = TIMER_INITIALIZER(fib6_run_gc, 0, 0);
 
-static struct fib6_walker_t fib6_walker_list = {
+struct fib6_walker_t fib6_walker_list = {
 	.prev	= &fib6_walker_list,
 	.next	= &fib6_walker_list, 
 };
diff --git a/net/ipv6/ip6_flowlabel.c b/net/ipv6/ip6_flowlabel.c
index 5c885fa77..2c5aab089 100644
--- a/net/ipv6/ip6_flowlabel.c
+++ b/net/ipv6/ip6_flowlabel.c
@@ -645,8 +645,8 @@ static void ip6fl_fl_seq_show(struct seq_file *seq, struct ip6_flowlabel *fl)
 static int ip6fl_seq_show(struct seq_file *seq, void *v)
 {
 	if (v == SEQ_START_TOKEN)
-		seq_printf(seq, "Label S Owner  Users  Linger Expires  "
-				"Dst                              Opt\n");
+		seq_puts(seq, "Label S Owner  Users  Linger Expires  "
+			      "Dst                              Opt\n");
 	else
 		ip6fl_fl_seq_show(seq, v);
 	return 0;
diff --git a/net/ipv6/ip6_input.c b/net/ipv6/ip6_input.c
index 0be5945d3..9b9cee7c0 100644
--- a/net/ipv6/ip6_input.c
+++ b/net/ipv6/ip6_input.c
@@ -64,10 +64,10 @@ int ipv6_rcv(struct sk_buff *skb, struct net_device *dev, struct packet_type *pt
 	if (skb->pkt_type == PACKET_OTHERHOST)
 		goto drop;
 
-	IP6_INC_STATS_BH(InReceives);
+	IP6_INC_STATS_BH(IPSTATS_MIB_INRECEIVES);
 
 	if ((skb = skb_share_check(skb, GFP_ATOMIC)) == NULL) {
-		IP6_INC_STATS_BH(InDiscards);
+		IP6_INC_STATS_BH(IPSTATS_MIB_INDISCARDS);
 		goto out;
 	}
 
@@ -80,7 +80,7 @@ int ipv6_rcv(struct sk_buff *skb, struct net_device *dev, struct packet_type *pt
 		goto err;
 
 	if (!pskb_may_pull(skb, sizeof(struct ipv6hdr))) {
-		IP6_INC_STATS_BH(InHdrErrors);
+		IP6_INC_STATS_BH(IPSTATS_MIB_INHDRERRORS);
 		goto drop;
 	}
 
@@ -97,7 +97,7 @@ int ipv6_rcv(struct sk_buff *skb, struct net_device *dev, struct packet_type *pt
 			goto truncated;
 		if (pkt_len + sizeof(struct ipv6hdr) < skb->len) {
 			if (__pskb_trim(skb, pkt_len + sizeof(struct ipv6hdr))){
-				IP6_INC_STATS_BH(InHdrErrors);
+				IP6_INC_STATS_BH(IPSTATS_MIB_INHDRERRORS);
 				goto drop;
 			}
 			hdr = skb->nh.ipv6h;
@@ -109,7 +109,7 @@ int ipv6_rcv(struct sk_buff *skb, struct net_device *dev, struct packet_type *pt
 	if (hdr->nexthdr == NEXTHDR_HOP) {
 		skb->h.raw = (u8*)(hdr+1);
 		if (ipv6_parse_hopopts(skb, offsetof(struct ipv6hdr, nexthdr)) < 0) {
-			IP6_INC_STATS_BH(InHdrErrors);
+			IP6_INC_STATS_BH(IPSTATS_MIB_INHDRERRORS);
 			return 0;
 		}
 		hdr = skb->nh.ipv6h;
@@ -117,9 +117,9 @@ int ipv6_rcv(struct sk_buff *skb, struct net_device *dev, struct packet_type *pt
 
 	return NF_HOOK(PF_INET6,NF_IP6_PRE_ROUTING, skb, dev, NULL, ip6_rcv_finish);
 truncated:
-	IP6_INC_STATS_BH(InTruncatedPkts);
+	IP6_INC_STATS_BH(IPSTATS_MIB_INTRUNCATEDPKTS);
 err:
-	IP6_INC_STATS_BH(InHdrErrors);
+	IP6_INC_STATS_BH(IPSTATS_MIB_INHDRERRORS);
 drop:
 	kfree_skb(skb);
 out:
@@ -194,15 +194,15 @@ resubmit:
 		if (ret > 0)
 			goto resubmit;
 		else if (ret == 0)
-			IP6_INC_STATS_BH(InDelivers);
+			IP6_INC_STATS_BH(IPSTATS_MIB_INDELIVERS);
 	} else {
 		if (!raw_sk) {
 			if (xfrm6_policy_check(NULL, XFRM_POLICY_IN, skb)) {
-				IP6_INC_STATS_BH(InUnknownProtos);
+				IP6_INC_STATS_BH(IPSTATS_MIB_INUNKNOWNPROTOS);
 				icmpv6_param_prob(skb, ICMPV6_UNK_NEXTHDR, nhoff);
 			}
 		} else {
-			IP6_INC_STATS_BH(InDelivers);
+			IP6_INC_STATS_BH(IPSTATS_MIB_INDELIVERS);
 			kfree_skb(skb);
 		}
 	}
@@ -210,7 +210,7 @@ resubmit:
 	return 0;
 
 discard:
-	IP6_INC_STATS_BH(InDiscards);
+	IP6_INC_STATS_BH(IPSTATS_MIB_INDISCARDS);
 	rcu_read_unlock();
 	kfree_skb(skb);
 	return 0;
@@ -227,7 +227,7 @@ int ip6_mc_input(struct sk_buff *skb)
 	struct ipv6hdr *hdr;
 	int deliver;
 
-	IP6_INC_STATS_BH(InMcastPkts);
+	IP6_INC_STATS_BH(IPSTATS_MIB_INMCASTPKTS);
 
 	hdr = skb->nh.ipv6h;
 	deliver = likely(!(skb->dev->flags & (IFF_PROMISC|IFF_ALLMULTI))) ||
diff --git a/net/ipv6/ip6_output.c b/net/ipv6/ip6_output.c
index 0057672a3..81eed71dd 100644
--- a/net/ipv6/ip6_output.c
+++ b/net/ipv6/ip6_output.c
@@ -87,7 +87,7 @@ static inline int ip6_output_finish(struct sk_buff *skb)
 	} else if (dst->neighbour)
 		return dst->neighbour->output(skb);
 
-	IP6_INC_STATS_BH(OutNoRoutes);
+	IP6_INC_STATS_BH(IPSTATS_MIB_OUTNOROUTES);
 	kfree_skb(skb);
 	return -EINVAL;
 
@@ -133,13 +133,13 @@ static int ip6_output2(struct sk_buff **pskb)
 					ip6_dev_loopback_xmit);
 
 			if (skb->nh.ipv6h->hop_limit == 0) {
-				IP6_INC_STATS(OutDiscards);
+				IP6_INC_STATS(IPSTATS_MIB_OUTDISCARDS);
 				kfree_skb(skb);
 				return 0;
 			}
 		}
 
-		IP6_INC_STATS(OutMcastPkts);
+		IP6_INC_STATS(IPSTATS_MIB_OUTMCASTPKTS);
 	}
 
 	return NF_HOOK(PF_INET6, NF_IP6_POST_ROUTING, skb,NULL, skb->dev,ip6_output_finish);
@@ -172,7 +172,7 @@ int ip6_route_me_harder(struct sk_buff *skb)
 	dst = ip6_route_output(skb->sk, &fl);
 
 	if (dst->error) {
-		IP6_INC_STATS(OutNoRoutes);
+		IP6_INC_STATS(IPSTATS_MIB_OUTNOROUTES);
 		LIMIT_NETDEBUG(
 			printk(KERN_DEBUG "ip6_route_me_harder: No more route.\n"));
 		dst_release(dst);
@@ -231,7 +231,7 @@ int ip6_xmit(struct sock *sk, struct sk_buff *skb, struct flowi *fl,
 			kfree_skb(skb);
 			skb = skb2;
 			if (skb == NULL) {	
-				IP6_INC_STATS(OutDiscards);
+				IP6_INC_STATS(IPSTATS_MIB_OUTDISCARDS);
 				return -ENOBUFS;
 			}
 			if (sk)
@@ -265,7 +265,7 @@ int ip6_xmit(struct sock *sk, struct sk_buff *skb, struct flowi *fl,
 
 	mtu = dst_pmtu(dst);
 	if ((skb->len <= mtu) || ipfragok) {
-		IP6_INC_STATS(OutRequests);
+		IP6_INC_STATS(IPSTATS_MIB_OUTREQUESTS);
 		return NF_HOOK(PF_INET6, NF_IP6_LOCAL_OUT, skb, NULL, dst->dev, ip6_maybe_reroute);
 	}
 
@@ -273,7 +273,7 @@ int ip6_xmit(struct sock *sk, struct sk_buff *skb, struct flowi *fl,
 		printk(KERN_DEBUG "IPv6: sending pkt_too_big to self\n");
 	skb->dev = dst->dev;
 	icmpv6_send(skb, ICMPV6_PKT_TOOBIG, 0, mtu, skb->dev);
-	IP6_INC_STATS(FragFails);
+	IP6_INC_STATS(IPSTATS_MIB_FRAGFAILS);
 	kfree_skb(skb);
 	return -EMSGSIZE;
 }
@@ -355,7 +355,7 @@ int ip6_forward(struct sk_buff *skb)
 		goto error;
 
 	if (!xfrm6_policy_check(NULL, XFRM_POLICY_FWD, skb)) {
-		IP6_INC_STATS(InDiscards);
+		IP6_INC_STATS(IPSTATS_MIB_INDISCARDS);
 		goto drop;
 	}
 
@@ -394,7 +394,7 @@ int ip6_forward(struct sk_buff *skb)
 	}
 
 	if (!xfrm6_route_forward(skb)) {
-		IP6_INC_STATS(InDiscards);
+		IP6_INC_STATS(IPSTATS_MIB_INDISCARDS);
 		goto drop;
 	}
 
@@ -432,14 +432,14 @@ int ip6_forward(struct sk_buff *skb)
 		/* Again, force OUTPUT device used as source address */
 		skb->dev = dst->dev;
 		icmpv6_send(skb, ICMPV6_PKT_TOOBIG, 0, dst_pmtu(dst), skb->dev);
-		IP6_INC_STATS_BH(InTooBigErrors);
-		IP6_INC_STATS_BH(FragFails);
+		IP6_INC_STATS_BH(IPSTATS_MIB_INTOOBIGERRORS);
+		IP6_INC_STATS_BH(IPSTATS_MIB_FRAGFAILS);
 		kfree_skb(skb);
 		return -EMSGSIZE;
 	}
 
 	if (skb_cow(skb, dst->dev->hard_header_len)) {
-		IP6_INC_STATS(OutDiscards);
+		IP6_INC_STATS(IPSTATS_MIB_OUTDISCARDS);
 		goto drop;
 	}
 
@@ -449,11 +449,11 @@ int ip6_forward(struct sk_buff *skb)
  
 	hdr->hop_limit--;
 
-	IP6_INC_STATS_BH(OutForwDatagrams);
+	IP6_INC_STATS_BH(IPSTATS_MIB_OUTFORWDATAGRAMS);
 	return NF_HOOK(PF_INET6,NF_IP6_FORWARD, skb, skb->dev, dst->dev, ip6_forward_finish);
 
 error:
-	IP6_INC_STATS_BH(InAddrErrors);
+	IP6_INC_STATS_BH(IPSTATS_MIB_INADDRERRORS);
 drop:
 	kfree_skb(skb);
 	return -EINVAL;
@@ -561,12 +561,12 @@ static int ip6_fragment(struct sk_buff **pskb, int (*output)(struct sk_buff**))
 		err = 0;
 		offset = 0;
 		frag = skb_shinfo(skb)->frag_list;
-		skb_shinfo(skb)->frag_list = 0;
+		skb_shinfo(skb)->frag_list = NULL;
 		/* BUILD HEADER */
 
 		tmp_hdr = kmalloc(hlen, GFP_ATOMIC);
 		if (!tmp_hdr) {
-			IP6_INC_STATS(FragFails);
+			IP6_INC_STATS(IPSTATS_MIB_FRAGFAILS);
 			return -ENOMEM;
 		}
 
@@ -607,13 +607,11 @@ static int ip6_fragment(struct sk_buff **pskb, int (*output)(struct sk_buff**))
 				frag->nh.ipv6h->payload_len = htons(frag->len - sizeof(struct ipv6hdr));
 				ip6_copy_metadata(frag, skb);
 			}
-			err = output(pskb);
-			if (err || !frag) {
-				if (unlikely(skb != *pskb))
-					skb = *pskb;
-				break;
-			}
 			
+			err = output(&skb);
+			if (err || !frag)
+				break;
+
 			skb = frag;
 			frag = skb->next;
 			skb->next = NULL;
@@ -623,7 +621,7 @@ static int ip6_fragment(struct sk_buff **pskb, int (*output)(struct sk_buff**))
 			kfree(tmp_hdr);
 
 		if (err == 0) {
-			IP6_INC_STATS(FragOKs);
+			IP6_INC_STATS(IPSTATS_MIB_FRAGOKS);
 			return 0;
 		}
 
@@ -633,7 +631,7 @@ static int ip6_fragment(struct sk_buff **pskb, int (*output)(struct sk_buff**))
 			frag = skb;
 		}
 
-		IP6_INC_STATS(FragFails);
+		IP6_INC_STATS(IPSTATS_MIB_FRAGFAILS);
 		return err;
 	}
 
@@ -666,7 +664,7 @@ slow_path:
 
 		if ((frag = alloc_skb(len+hlen+sizeof(struct frag_hdr)+LL_RESERVED_SPACE(rt->u.dst.dev), GFP_ATOMIC)) == NULL) {
 			NETDEBUG(printk(KERN_INFO "IPv6: frag: no memory for new fragment!\n"));
-			IP6_INC_STATS(FragFails);
+			IP6_INC_STATS(IPSTATS_MIB_FRAGFAILS);
 			err = -ENOMEM;
 			goto fail;
 		}
@@ -724,19 +722,19 @@ slow_path:
 		 *	Put this fragment into the sending queue.
 		 */
 
-		IP6_INC_STATS(FragCreates);
+		IP6_INC_STATS(IPSTATS_MIB_FRAGCREATES);
 
 		err = output(&frag);
 		if (err)
 			goto fail;
 	}
 	kfree_skb(skb);
-	IP6_INC_STATS(FragOKs);
+	IP6_INC_STATS(IPSTATS_MIB_FRAGOKS);
 	return err;
 
 fail:
 	kfree_skb(skb); 
-	IP6_INC_STATS(FragFails);
+	IP6_INC_STATS(IPSTATS_MIB_FRAGFAILS);
 	return err;
 }
 
@@ -854,8 +852,8 @@ int ip6_append_data(struct sock *sk, int getfrag(void *from, char *to, int offse
 		np->cork.hop_limit = hlimit;
 		inet->cork.fragsize = mtu = dst_pmtu(&rt->u.dst);
 		inet->cork.length = 0;
-		inet->sndmsg_page = NULL;
-		inet->sndmsg_off = 0;
+		sk->sk_sndmsg_page = NULL;
+		sk->sk_sndmsg_off = 0;
 		exthdrlen = rt->u.dst.header_len + (opt ? opt->opt_flen : 0);
 		length += exthdrlen;
 		transhdrlen += exthdrlen;
@@ -971,8 +969,8 @@ alloc_new_skb:
 		} else {
 			int i = skb_shinfo(skb)->nr_frags;
 			skb_frag_t *frag = &skb_shinfo(skb)->frags[i-1];
-			struct page *page = inet->sndmsg_page;
-			int off = inet->sndmsg_off;
+			struct page *page = sk->sk_sndmsg_page;
+			int off = sk->sk_sndmsg_off;
 			unsigned int left;
 
 			if (page && (left = PAGE_SIZE - off) > 0) {
@@ -984,7 +982,7 @@ alloc_new_skb:
 						goto error;
 					}
 					get_page(page);
-					skb_fill_page_desc(skb, i, page, inet->sndmsg_off, 0);
+					skb_fill_page_desc(skb, i, page, sk->sk_sndmsg_off, 0);
 					frag = &skb_shinfo(skb)->frags[i];
 				}
 			} else if(i < MAX_SKB_FRAGS) {
@@ -995,8 +993,8 @@ alloc_new_skb:
 					err = -ENOMEM;
 					goto error;
 				}
-				inet->sndmsg_page = page;
-				inet->sndmsg_off = 0;
+				sk->sk_sndmsg_page = page;
+				sk->sk_sndmsg_off = 0;
 
 				skb_fill_page_desc(skb, i, page, 0, 0);
 				frag = &skb_shinfo(skb)->frags[i];
@@ -1010,7 +1008,7 @@ alloc_new_skb:
 				err = -EFAULT;
 				goto error;
 			}
-			inet->sndmsg_off += copy;
+			sk->sk_sndmsg_off += copy;
 			frag->size += copy;
 			skb->len += copy;
 			skb->data_len += copy;
@@ -1021,7 +1019,7 @@ alloc_new_skb:
 	return 0;
 error:
 	inet->cork.length -= length;
-	IP6_INC_STATS(OutDiscards);
+	IP6_INC_STATS(IPSTATS_MIB_OUTDISCARDS);
 	return err;
 }
 
@@ -1081,7 +1079,7 @@ int ip6_push_pending_frames(struct sock *sk)
 	ipv6_addr_copy(&hdr->daddr, final_dst);
 
 	skb->dst = dst_clone(&rt->u.dst);
-	IP6_INC_STATS(OutRequests);	
+	IP6_INC_STATS(IPSTATS_MIB_OUTREQUESTS);	
 	err = NF_HOOK(PF_INET6, NF_IP6_LOCAL_OUT, skb, NULL, skb->dst->dev, dst_output);
 	if (err) {
 		if (err > 0)
@@ -1113,7 +1111,7 @@ void ip6_flush_pending_frames(struct sock *sk)
 	struct sk_buff *skb;
 
 	while ((skb = __skb_dequeue_tail(&sk->sk_write_queue)) != NULL) {
-		IP6_INC_STATS(OutDiscards);
+		IP6_INC_STATS(IPSTATS_MIB_OUTDISCARDS);
 		kfree_skb(skb);
 	}
 
diff --git a/net/ipv6/ip6_tunnel.c b/net/ipv6/ip6_tunnel.c
index e8153808d..0c8db0391 100644
--- a/net/ipv6/ip6_tunnel.c
+++ b/net/ipv6/ip6_tunnel.c
@@ -123,7 +123,7 @@ static inline void ip6_tnl_dst_store(struct ip6_tnl *t, struct dst_entry *dst)
  *   else %NULL
  **/
 
-struct ip6_tnl *
+static struct ip6_tnl *
 ip6ip6_tnl_lookup(struct in6_addr *remote, struct in6_addr *local)
 {
 	unsigned h0 = HASH(remote);
@@ -387,8 +387,9 @@ parse_tlv_tnl_enc_lim(struct sk_buff *skb, __u8 * raw)
  *   to the specifications in RFC 2473.
  **/
 
-void ip6ip6_err(struct sk_buff *skb, struct inet6_skb_parm *opt,
-		   int type, int code, int offset, __u32 info)
+static void 
+ip6ip6_err(struct sk_buff *skb, struct inet6_skb_parm *opt,
+	   int type, int code, int offset, __u32 info)
 {
 	struct ipv6hdr *ipv6h = (struct ipv6hdr *) skb->data;
 	struct ip6_tnl *t;
@@ -496,7 +497,8 @@ out:
  * Return: 0
  **/
 
-int ip6ip6_rcv(struct sk_buff **pskb, unsigned int *nhoffp)
+static int 
+ip6ip6_rcv(struct sk_buff **pskb, unsigned int *nhoffp)
 {
 	struct sk_buff *skb = *pskb;
 	struct ipv6hdr *ipv6h;
@@ -510,6 +512,11 @@ int ip6ip6_rcv(struct sk_buff **pskb, unsigned int *nhoffp)
 	read_lock(&ip6ip6_lock);
 
 	if ((t = ip6ip6_tnl_lookup(&ipv6h->saddr, &ipv6h->daddr)) != NULL) {
+		if (!xfrm6_policy_check(NULL, XFRM_POLICY_IN, skb)) {
+			kfree_skb(skb);
+			return 0;
+		}
+
 		if (!(t->parms.flags & IP6_TNL_F_CAP_RCV)) {
 			t->stat.rx_dropped++;
 			read_unlock(&ip6ip6_lock);
@@ -533,8 +540,7 @@ int ip6ip6_rcv(struct sk_buff **pskb, unsigned int *nhoffp)
 	read_unlock(&ip6ip6_lock);
 	icmpv6_send(skb, ICMPV6_DEST_UNREACH, ICMPV6_ADDR_UNREACH, 0, skb->dev);
 discard:
-	kfree_skb(skb);
-	return 0;
+	return 1;
 }
 
 static inline struct ipv6_txoptions *create_tel(__u8 encap_limit)
@@ -598,7 +604,8 @@ ip6ip6_tnl_addr_conflict(struct ip6_tnl *t, struct ipv6hdr *hdr)
  *   0
  **/
 
-int ip6ip6_tnl_xmit(struct sk_buff *skb, struct net_device *dev)
+static int 
+ip6ip6_tnl_xmit(struct sk_buff *skb, struct net_device *dev)
 {
 	struct ip6_tnl *t = (struct ip6_tnl *) dev->priv;
 	struct net_device_stats *stats = &t->stat;
@@ -715,13 +722,7 @@ int ip6ip6_tnl_xmit(struct sk_buff *skb, struct net_device *dev)
 	ipv6h->nexthdr = proto;
 	ipv6_addr_copy(&ipv6h->saddr, &fl.fl6_src);
 	ipv6_addr_copy(&ipv6h->daddr, &fl.fl6_dst);
-#ifdef CONFIG_NETFILTER
-	nf_conntrack_put(skb->nfct);
-	skb->nfct = NULL;
-#ifdef CONFIG_NETFILTER_DEBUG
-	skb->nf_debug = 0;
-#endif
-#endif
+	nf_reset(skb);
 	pkt_len = skb->len;
 	err = NF_HOOK(PF_INET6, NF_IP6_LOCAL_OUT, skb, NULL, 
 		      skb->dst->dev, dst_output);
@@ -1079,7 +1080,8 @@ ip6ip6_tnl_dev_init(struct net_device *dev)
  * Return: 0
  **/
 
-int ip6ip6_fb_tnl_dev_init(struct net_device *dev)
+static int 
+ip6ip6_fb_tnl_dev_init(struct net_device *dev)
 {
 	struct ip6_tnl *t = dev->priv;
 	ip6ip6_tnl_dev_init_gen(dev);
@@ -1088,10 +1090,9 @@ int ip6ip6_fb_tnl_dev_init(struct net_device *dev)
 	return 0;
 }
 
-static struct inet6_protocol ip6ip6_protocol = {
+static struct xfrm6_tunnel ip6ip6_handler = {
 	.handler = ip6ip6_rcv,
 	.err_handler = ip6ip6_err,
-	.flags = INET6_PROTO_FINAL
 };
 
 /**
@@ -1104,9 +1105,9 @@ static int __init ip6_tunnel_init(void)
 {
 	int  err;
 
-	if ((err = inet6_add_protocol(&ip6ip6_protocol, IPPROTO_IPV6)) < 0) {
-		printk(KERN_ERR "Failed to register IPv6 protocol\n");
-		return err;
+	if (xfrm6_tunnel_register(&ip6ip6_handler) < 0) {
+		printk(KERN_ERR "ip6ip6 init: can't register tunnel\n");
+		return -EAGAIN;
 	}
 	ip6ip6_fb_tnl_dev = alloc_netdev(sizeof(struct ip6_tnl), "ip6tnl0",
 					 ip6ip6_tnl_dev_setup);
@@ -1123,7 +1124,7 @@ static int __init ip6_tunnel_init(void)
 	}
 	return 0;
 fail:
-	inet6_del_protocol(&ip6ip6_protocol, IPPROTO_IPV6);
+	xfrm6_tunnel_deregister(&ip6ip6_handler);
 	return err;
 }
 
@@ -1133,8 +1134,10 @@ fail:
 
 static void __exit ip6_tunnel_cleanup(void)
 {
+	if (xfrm6_tunnel_deregister(&ip6ip6_handler) < 0)
+		printk(KERN_INFO "ip6ip6 close: can't deregister tunnel\n");
+
 	unregister_netdev(ip6ip6_fb_tnl_dev);
-	inet6_del_protocol(&ip6ip6_protocol, IPPROTO_IPV6);
 }
 
 module_init(ip6_tunnel_init);
diff --git a/net/ipv6/ipcomp6.c b/net/ipv6/ipcomp6.c
index b357db4cc..04303769d 100644
--- a/net/ipv6/ipcomp6.c
+++ b/net/ipv6/ipcomp6.c
@@ -32,7 +32,6 @@
  */
 #include <linux/config.h>
 #include <linux/module.h>
-#include <net/inet_ecn.h>
 #include <net/ip.h>
 #include <net/xfrm.h>
 #include <net/ipcomp.h>
@@ -49,7 +48,6 @@ static int ipcomp6_input(struct xfrm_state *x, struct xfrm_decap_state *decap, s
 {
 	int err = 0;
 	u8 nexthdr = 0;
-	u8 *prevhdr;
 	int hdr_len = skb->h.raw - skb->nh.raw;
 	unsigned char *tmp_hdr = NULL;
 	struct ipv6hdr *iph;
@@ -106,8 +104,6 @@ static int ipcomp6_input(struct xfrm_state *x, struct xfrm_decap_state *decap, s
 	iph = skb->nh.ipv6h;
 	iph->payload_len = htons(skb->len);
 	
-	ip6_find_1stfragopt(skb, &prevhdr);
-	*prevhdr = nexthdr;
 out:
 	if (tmp_hdr)
 		kfree(tmp_hdr);
@@ -123,48 +119,14 @@ static int ipcomp6_output(struct sk_buff **pskb)
 	int err;
 	struct dst_entry *dst = (*pskb)->dst;
 	struct xfrm_state *x = dst->xfrm;
-	struct ipv6hdr *tmp_iph = NULL, *iph, *top_iph;
-	int hdr_len = 0;
+	struct ipv6hdr *top_iph;
+	int hdr_len;
 	struct ipv6_comp_hdr *ipch;
 	struct ipcomp_data *ipcd = x->data;
-	u8 *prevhdr;
-	u8 nexthdr = 0;
 	int plen, dlen;
 	u8 *start, *scratch = ipcd->scratch;
 
-	if ((*pskb)->ip_summed == CHECKSUM_HW) {
-		err = skb_checksum_help(pskb, 0);
-		if (err)
-			goto error_nolock;
-	}
-
-	spin_lock_bh(&x->lock);
-
-	err = xfrm_check_output(x, *pskb, AF_INET6);
-	if (err)
-		goto error;
-
-	if (x->props.mode) {
-		hdr_len = sizeof(struct ipv6hdr);
-		nexthdr = IPPROTO_IPV6;
-		iph = (*pskb)->nh.ipv6h;
-		top_iph = (struct ipv6hdr *)skb_push(*pskb, sizeof(struct ipv6hdr));
-		top_iph->version = 6;
-		top_iph->priority = iph->priority;
-		top_iph->flow_lbl[0] = iph->flow_lbl[0];
-		top_iph->flow_lbl[1] = iph->flow_lbl[1];
-		top_iph->flow_lbl[2] = iph->flow_lbl[2];
-		top_iph->nexthdr = IPPROTO_IPV6; /* initial */
-		top_iph->payload_len = htons((*pskb)->len - sizeof(struct ipv6hdr));
-		top_iph->hop_limit = iph->hop_limit;
-		memcpy(&top_iph->saddr, (struct in6_addr *)&x->props.saddr, sizeof(struct in6_addr));
-		memcpy(&top_iph->daddr, (struct in6_addr *)&x->id.daddr, sizeof(struct in6_addr));
-		(*pskb)->nh.raw = (*pskb)->data; /* == top_iph */
-		(*pskb)->h.raw = (*pskb)->nh.raw + hdr_len;
-	} else {
-		hdr_len = ip6_find_1stfragopt(*pskb, &prevhdr);
-		nexthdr = *prevhdr;
-	}
+	hdr_len = (*pskb)->h.raw - (*pskb)->data;
 
 	/* check whether datagram len is larger than threshold */
 	if (((*pskb)->len - hdr_len) < ipcd->threshold) {
@@ -180,7 +142,7 @@ static int ipcomp6_output(struct sk_buff **pskb)
 	/* compression */
 	plen = (*pskb)->len - hdr_len;
 	dlen = IPCOMP_SCRATCH_SIZE;
-	start = (*pskb)->data + hdr_len;
+	start = (*pskb)->h.raw;
 
 	err = crypto_comp_compress(ipcd->tfm, start, plen, scratch, &dlen);
 	if (err) {
@@ -189,51 +151,25 @@ static int ipcomp6_output(struct sk_buff **pskb)
 	if ((dlen + sizeof(struct ipv6_comp_hdr)) >= plen) {
 		goto out_ok;
 	}
-	memcpy(start, scratch, dlen);
-	pskb_trim(*pskb, hdr_len+dlen);
+	memcpy(start + sizeof(struct ip_comp_hdr), scratch, dlen);
+	pskb_trim(*pskb, hdr_len + dlen + sizeof(struct ip_comp_hdr));
 
 	/* insert ipcomp header and replace datagram */
-	tmp_iph = kmalloc(hdr_len, GFP_ATOMIC);
-	if (!tmp_iph) {
-		err = -ENOMEM;
-		goto error;
-	}
-	memcpy(tmp_iph, (*pskb)->nh.raw, hdr_len);
-	top_iph = (struct ipv6hdr*)skb_push(*pskb, sizeof(struct ipv6_comp_hdr));
-	memcpy(top_iph, tmp_iph, hdr_len);
-	kfree(tmp_iph);
+	top_iph = (struct ipv6hdr *)(*pskb)->data;
 
-	if (x->props.mode && (x->props.flags & XFRM_STATE_NOECN))
-		IP6_ECN_clear(top_iph);
 	top_iph->payload_len = htons((*pskb)->len - sizeof(struct ipv6hdr));
-	(*pskb)->nh.raw = (*pskb)->data; /* top_iph */
-	ip6_find_1stfragopt(*pskb, &prevhdr); 
-	*prevhdr = IPPROTO_COMP;
 
-	ipch = (struct ipv6_comp_hdr *)((unsigned char *)top_iph + hdr_len);
-	ipch->nexthdr = nexthdr;
+	ipch = (struct ipv6_comp_hdr *)start;
+	ipch->nexthdr = *(*pskb)->nh.raw;
 	ipch->flags = 0;
 	ipch->cpi = htons((u16 )ntohl(x->id.spi));
+	*(*pskb)->nh.raw = IPPROTO_COMP;
 
-	(*pskb)->h.raw = (unsigned char*)ipch;
 out_ok:
-	x->curlft.bytes += (*pskb)->len;
-	x->curlft.packets++;
-	spin_unlock_bh(&x->lock);
-
-	if (((*pskb)->dst = dst_pop(dst)) == NULL) {
-		err = -EHOSTUNREACH;
-		goto error_nolock;
-	}
-	err = NET_XMIT_BYPASS;
+	err = 0;
 
-out_exit:
-	return err;
 error:
-	spin_unlock_bh(&x->lock);
-error_nolock:
-	kfree_skb(*pskb);
-	goto out_exit;
+	return err;
 }
 
 static void ipcomp6_err(struct sk_buff *skb, struct inet6_skb_parm *opt,
@@ -244,7 +180,7 @@ static void ipcomp6_err(struct sk_buff *skb, struct inet6_skb_parm *opt,
 	struct ipv6_comp_hdr *ipcomph = (struct ipv6_comp_hdr*)(skb->data+offset);
 	struct xfrm_state *x;
 
-	if (type != ICMPV6_DEST_UNREACH || type != ICMPV6_PKT_TOOBIG)
+	if (type != ICMPV6_DEST_UNREACH && type != ICMPV6_PKT_TOOBIG)
 		return;
 
 	spi = ntohl(ntohs(ipcomph->cpi));
@@ -258,6 +194,66 @@ static void ipcomp6_err(struct sk_buff *skb, struct inet6_skb_parm *opt,
 	xfrm_state_put(x);
 }
 
+static struct xfrm_state *ipcomp6_tunnel_create(struct xfrm_state *x)
+{
+	struct xfrm_state *t = NULL;
+
+	t = xfrm_state_alloc();
+	if (!t)
+		goto out;
+
+	t->id.proto = IPPROTO_IPV6;
+	t->id.spi = xfrm6_tunnel_alloc_spi((xfrm_address_t *)&x->props.saddr);
+	memcpy(t->id.daddr.a6, x->id.daddr.a6, sizeof(struct in6_addr));
+	memcpy(&t->sel, &x->sel, sizeof(t->sel));
+	t->props.family = AF_INET6;
+	t->props.mode = 1;
+	memcpy(t->props.saddr.a6, x->props.saddr.a6, sizeof(struct in6_addr));
+
+	t->type = xfrm_get_type(IPPROTO_IPV6, t->props.family);
+	if (t->type == NULL)
+		goto error;
+
+	if (t->type->init_state(t, NULL))
+		goto error;
+
+	t->km.state = XFRM_STATE_VALID;
+	atomic_set(&t->tunnel_users, 1);
+
+out:
+	return t;
+
+error:
+	xfrm_state_put(t);
+	goto out;
+}
+
+static int ipcomp6_tunnel_attach(struct xfrm_state *x)
+{
+	int err = 0;
+	struct xfrm_state *t = NULL;
+	u32 spi;
+
+	spi = xfrm6_tunnel_spi_lookup((xfrm_address_t *)&x->props.saddr);
+	if (spi)
+		t = xfrm_state_lookup((xfrm_address_t *)&x->id.daddr,
+					      spi, IPPROTO_IPV6, AF_INET6);
+	if (!t) {
+		t = ipcomp6_tunnel_create(x);
+		if (!t) {
+			err = -EINVAL;
+			goto out;
+		}
+		xfrm_state_insert(t);
+		xfrm_state_hold(t);
+	}
+	x->tunnel = t;
+	atomic_inc(&t->tunnel_users);
+
+out:
+	return err;
+}
+
 static void ipcomp6_free_data(struct ipcomp_data *ipcd)
 {
 	if (ipcd->tfm)
@@ -271,8 +267,11 @@ static void ipcomp6_destroy(struct xfrm_state *x)
 	struct ipcomp_data *ipcd = x->data;
 	if (!ipcd)
 		return;
+	xfrm_state_delete_tunnel(x);
 	ipcomp6_free_data(ipcd);
 	kfree(ipcd);
+
+	xfrm6_tunnel_free_spi((xfrm_address_t *)&x->props.saddr);
 }
 
 static int ipcomp6_init_state(struct xfrm_state *x, void *args)
@@ -291,7 +290,7 @@ static int ipcomp6_init_state(struct xfrm_state *x, void *args)
 		goto error;
 
 	memset(ipcd, 0, sizeof(*ipcd));
-	x->props.header_len = sizeof(struct ipv6_comp_hdr);
+	x->props.header_len = 0;
 	if (x->props.mode)
 		x->props.header_len += sizeof(struct ipv6hdr);
 	
@@ -303,6 +302,12 @@ static int ipcomp6_init_state(struct xfrm_state *x, void *args)
 	if (!ipcd->tfm)
 		goto error;
 
+	if (x->props.mode) {
+		err = ipcomp6_tunnel_attach(x);
+		if (err)
+			goto error;
+	}
+
 	calg_desc = xfrm_calg_get_byname(x->calg->alg_name);
 	BUG_ON(!calg_desc);
 	ipcd->threshold = calg_desc->uinfo.comp.threshold;
diff --git a/net/ipv6/mcast.c b/net/ipv6/mcast.c
index b35114577..893fe4081 100644
--- a/net/ipv6/mcast.c
+++ b/net/ipv6/mcast.c
@@ -60,7 +60,7 @@
 #include <net/addrconf.h>
 #include <net/ip6_route.h>
 
-#include <net/checksum.h>
+#include <net/ip6_checksum.h>
 
 /* Set to 3 to get tracing... */
 #define MCAST_DEBUG 2
@@ -210,7 +210,7 @@ int ipv6_sock_mc_join(struct sock *sk, int ifindex, struct in6_addr *addr)
 
 	mc_lst->ifindex = dev->ifindex;
 	mc_lst->sfmode = MCAST_EXCLUDE;
-	mc_lst->sflist = 0;
+	mc_lst->sflist = NULL;
 
 	/*
 	 *	now add/increase the group membership on the device
@@ -272,8 +272,8 @@ int ipv6_sock_mc_drop(struct sock *sk, int ifindex, struct in6_addr *addr)
 
 struct inet6_dev *ip6_mc_find_dev(struct in6_addr *group, int ifindex)
 {
-	struct net_device *dev = 0;
-	struct inet6_dev *idev = 0;
+	struct net_device *dev = NULL;
+	struct inet6_dev *idev = NULL;
 
 	if (ifindex == 0) {
 		struct rt6_info *rt;
@@ -288,18 +288,18 @@ struct inet6_dev *ip6_mc_find_dev(struct in6_addr *group, int ifindex)
 		dev = dev_get_by_index(ifindex);
 
 	if (!dev)
-		return 0;
+		return NULL;
 	idev = in6_dev_get(dev);
 	if (!idev) {
 		dev_put(dev);
-		return 0;
+		return NULL;
 	}
 	read_lock_bh(&idev->lock);
 	if (idev->dead) {
 		read_unlock_bh(&idev->lock);
 		in6_dev_put(idev);
 		dev_put(dev);
-		return 0;
+		return NULL;
 	}
 	return idev;
 }
@@ -365,7 +365,7 @@ int ip6_mc_source(int add, int omode, struct sock *sk,
 	err = -EADDRNOTAVAIL;
 
 	for (pmc=inet6->ipv6_mc_list; pmc; pmc=pmc->next) {
-		if (pmc->ifindex != pgsr->gsr_interface)
+		if (pgsr->gsr_interface && pmc->ifindex != pgsr->gsr_interface)
 			continue;
 		if (ipv6_addr_cmp(&pmc->addr, group) == 0)
 			break;
@@ -378,8 +378,8 @@ int ip6_mc_source(int add, int omode, struct sock *sk,
 			goto done;
 	} else if (pmc->sfmode != omode) {
 		/* allow mode switches for empty-set filters */
-		ip6_mc_add_src(idev, group, omode, 0, 0, 0);
-		ip6_mc_del_src(idev, group, pmc->sfmode, 0, 0, 0);
+		ip6_mc_add_src(idev, group, omode, 0, NULL, 0);
+		ip6_mc_del_src(idev, group, pmc->sfmode, 0, NULL, 0);
 		pmc->sfmode = omode;
 	}
 
@@ -509,14 +509,14 @@ int ip6_mc_msfilter(struct sock *sk, struct group_filter *gsf)
 			goto done;
 		}
 	} else
-		newpsl = 0;
+		newpsl = NULL;
 	psl = pmc->sflist;
 	if (psl) {
 		(void) ip6_mc_del_src(idev, group, pmc->sfmode,
 			psl->sl_count, psl->sl_addr, 0);
 		sock_kfree_s(sk, psl, IP6_SFLSIZE(psl->sl_max));
 	} else
-		(void) ip6_mc_del_src(idev, group, pmc->sfmode, 0, 0, 0);
+		(void) ip6_mc_del_src(idev, group, pmc->sfmode, 0, NULL, 0);
 	pmc->sflist = newpsl;
 	pmc->sfmode = gsf->gf_fmode;
 done:
@@ -718,7 +718,7 @@ static void mld_add_delrec(struct inet6_dev *idev, struct ifmcaddr6 *im)
 
 		pmc->mca_tomb = im->mca_tomb;
 		pmc->mca_sources = im->mca_sources;
-		im->mca_tomb = im->mca_sources = 0;
+		im->mca_tomb = im->mca_sources = NULL;
 		for (psf=pmc->mca_sources; psf; psf=psf->sf_next)
 			psf->sf_crcount = pmc->mca_crcount;
 	}
@@ -736,7 +736,7 @@ static void mld_del_delrec(struct inet6_dev *idev, struct in6_addr *pmca)
 	struct ip6_sf_list *psf, *psf_next;
 
 	write_lock_bh(&idev->mc_lock);
-	pmc_prev = 0;
+	pmc_prev = NULL;
 	for (pmc=idev->mc_tomb; pmc; pmc=pmc->next) {
 		if (ipv6_addr_cmp(&pmc->mca_addr, pmca) == 0)
 			break;
@@ -765,7 +765,7 @@ static void mld_clear_delrec(struct inet6_dev *idev)
 
 	write_lock_bh(&idev->mc_lock);
 	pmc = idev->mc_tomb;
-	idev->mc_tomb = 0;
+	idev->mc_tomb = NULL;
 	write_unlock_bh(&idev->mc_lock);
 
 	for (; pmc; pmc = nextpmc) {
@@ -782,7 +782,7 @@ static void mld_clear_delrec(struct inet6_dev *idev)
 
 		spin_lock_bh(&pmc->mca_lock);
 		psf = pmc->mca_tomb;
-		pmc->mca_tomb = 0;
+		pmc->mca_tomb = NULL;
 		spin_unlock_bh(&pmc->mca_lock);
 		for (; psf; psf=psf_next) {
 			psf_next = psf->sf_next;
@@ -818,7 +818,7 @@ int ipv6_dev_mc_inc(struct net_device *dev, struct in6_addr *addr)
 			mc->mca_users++;
 			write_unlock_bh(&idev->lock);
 			ip6_mc_add_src(idev, &mc->mca_addr, MCAST_EXCLUDE, 0,
-				0, 0);
+				NULL, 0);
 			in6_dev_put(idev);
 			return 0;
 		}
@@ -1274,7 +1274,7 @@ static struct sk_buff *mld_newpack(struct net_device *dev, int size)
 	skb = sock_alloc_send_skb(sk, size + LL_RESERVED_SPACE(dev), 1, &err);
 
 	if (skb == 0)
-		return 0;
+		return NULL;
 
 	skb_reserve(skb, LL_RESERVED_SPACE(dev));
 	if (dev->hard_header) {
@@ -1283,7 +1283,7 @@ static struct sk_buff *mld_newpack(struct net_device *dev, int size)
 		ndisc_mc_map(&mld2_all_mcr, ha, dev, 1);
 		if (dev->hard_header(skb, dev, ETH_P_IPV6,ha,NULL,size) < 0) {
 			kfree_skb(skb);
-			return 0;
+			return NULL;
 		}
 	}
 
@@ -1317,7 +1317,7 @@ static void mld_sendpack(struct sk_buff *skb)
 	struct inet6_dev *idev = in6_dev_get(skb->dev);
 	int err;
 
-	IP6_INC_STATS(OutRequests);
+	IP6_INC_STATS(IPSTATS_MIB_OUTREQUESTS);
 	payload_len = skb->tail - (unsigned char *)skb->nh.ipv6h -
 		sizeof(struct ipv6hdr);
 	mldlen = skb->tail - skb->h.raw;
@@ -1328,10 +1328,10 @@ static void mld_sendpack(struct sk_buff *skb)
 	err = NF_HOOK(PF_INET6, NF_IP6_LOCAL_OUT, skb, NULL, skb->dev,
 		dev_queue_xmit);
 	if (!err) {
-		ICMP6_INC_STATS(idev,Icmp6OutMsgs);
-		IP6_INC_STATS(OutMcastPkts);
+		ICMP6_INC_STATS(idev,ICMP6_MIB_OUTMSGS);
+		IP6_INC_STATS(IPSTATS_MIB_OUTMCASTPKTS);
 	} else
-		IP6_INC_STATS(OutDiscards);
+		IP6_INC_STATS(IPSTATS_MIB_OUTDISCARDS);
 
 	if (likely(idev != NULL))
 		in6_dev_put(idev);
@@ -1352,7 +1352,7 @@ static struct sk_buff *add_grhead(struct sk_buff *skb, struct ifmcaddr6 *pmc,
 	if (!skb)
 		skb = mld_newpack(dev, dev->mtu);
 	if (!skb)
-		return 0;
+		return NULL;
 	pgr = (struct mld2_grec *)skb_put(skb, sizeof(struct mld2_grec));
 	pgr->grec_type = type;
 	pgr->grec_auxwords = 0;
@@ -1372,7 +1372,7 @@ static struct sk_buff *add_grec(struct sk_buff *skb, struct ifmcaddr6 *pmc,
 {
 	struct net_device *dev = pmc->idev->dev;
 	struct mld2_report *pmr;
-	struct mld2_grec *pgr = 0;
+	struct mld2_grec *pgr = NULL;
 	struct ip6_sf_list *psf, *psf_next, *psf_prev, **psf_list;
 	int scount, first, isquery, truncate;
 
@@ -1397,13 +1397,13 @@ static struct sk_buff *add_grec(struct sk_buff *skb, struct ifmcaddr6 *pmc,
 			if (skb && AVAILABLE(skb) < sizeof(struct mld2_grec)+
 			    sizeof(struct in6_addr)) {
 				mld_sendpack(skb);
-				skb = 0; /* add_grhead will get a new one */
+				skb = NULL; /* add_grhead will get a new one */
 			}
 			skb = add_grhead(skb, pmc, type, &pgr);
 		}
 		return skb;
 	}
-	pmr = skb ? (struct mld2_report *)skb->h.raw : 0;
+	pmr = skb ? (struct mld2_report *)skb->h.raw : NULL;
 
 	/* EX and TO_EX get a fresh packet, if needed */
 	if (truncate) {
@@ -1416,7 +1416,7 @@ static struct sk_buff *add_grec(struct sk_buff *skb, struct ifmcaddr6 *pmc,
 	}
 	first = 1;
 	scount = 0;
-	psf_prev = 0;
+	psf_prev = NULL;
 	for (psf=*psf_list; psf; psf=psf_next) {
 		struct in6_addr *psrc;
 
@@ -1474,7 +1474,7 @@ static struct sk_buff *add_grec(struct sk_buff *skb, struct ifmcaddr6 *pmc,
 
 static void mld_send_report(struct inet6_dev *idev, struct ifmcaddr6 *pmc)
 {
-	struct sk_buff *skb = 0;
+	struct sk_buff *skb = NULL;
 	int type;
 
 	if (!pmc) {
@@ -1511,7 +1511,7 @@ static void mld_clear_zeros(struct ip6_sf_list **ppsf)
 {
 	struct ip6_sf_list *psf_prev, *psf_next, *psf;
 
-	psf_prev = 0;
+	psf_prev = NULL;
 	for (psf=*ppsf; psf; psf = psf_next) {
 		psf_next = psf->sf_next;
 		if (psf->sf_crcount == 0) {
@@ -1528,14 +1528,14 @@ static void mld_clear_zeros(struct ip6_sf_list **ppsf)
 static void mld_send_cr(struct inet6_dev *idev)
 {
 	struct ifmcaddr6 *pmc, *pmc_prev, *pmc_next;
-	struct sk_buff *skb = 0;
+	struct sk_buff *skb = NULL;
 	int type, dtype;
 
 	read_lock_bh(&idev->lock);
 	write_lock_bh(&idev->mc_lock);
 
 	/* deleted MCA's */
-	pmc_prev = 0;
+	pmc_prev = NULL;
 	for (pmc=idev->mc_tomb; pmc; pmc=pmc_next) {
 		pmc_next = pmc->next;
 		if (pmc->mca_sfmode == MCAST_INCLUDE) {
@@ -1613,7 +1613,7 @@ static void igmp6_send(struct in6_addr *addr, struct net_device *dev, int type)
 		     IPV6_TLV_ROUTERALERT, 2, 0, 0,
 		     IPV6_TLV_PADN, 0 };
 
-	IP6_INC_STATS(OutRequests);
+	IP6_INC_STATS(IPSTATS_MIB_OUTREQUESTS);
 	snd_addr = addr;
 	if (type == ICMPV6_MGM_REDUCTION) {
 		snd_addr = &all_routers;
@@ -1627,7 +1627,7 @@ static void igmp6_send(struct in6_addr *addr, struct net_device *dev, int type)
 	skb = sock_alloc_send_skb(sk, LL_RESERVED_SPACE(dev) + full_len, 1, &err);
 
 	if (skb == NULL) {
-		IP6_INC_STATS(OutDiscards);
+		IP6_INC_STATS(IPSTATS_MIB_OUTDISCARDS);
 		return;
 	}
 
@@ -1668,20 +1668,20 @@ static void igmp6_send(struct in6_addr *addr, struct net_device *dev, int type)
 		dev_queue_xmit);
 	if (!err) {
 		if (type == ICMPV6_MGM_REDUCTION)
-			ICMP6_INC_STATS(idev, Icmp6OutGroupMembReductions);
+			ICMP6_INC_STATS(idev, ICMP6_MIB_OUTGROUPMEMBREDUCTIONS);
 		else
-			ICMP6_INC_STATS(idev, Icmp6OutGroupMembResponses);
-		ICMP6_INC_STATS(idev, Icmp6OutMsgs);
-		IP6_INC_STATS(OutMcastPkts);
+			ICMP6_INC_STATS(idev, ICMP6_MIB_OUTGROUPMEMBRESPONSES);
+		ICMP6_INC_STATS(idev, ICMP6_MIB_OUTMSGS);
+		IP6_INC_STATS(IPSTATS_MIB_OUTMCASTPKTS);
 	} else
-		IP6_INC_STATS(OutDiscards);
+		IP6_INC_STATS(IPSTATS_MIB_OUTDISCARDS);
 
 	if (likely(idev != NULL))
 		in6_dev_put(idev);
 	return;
 
 out:
-	IP6_INC_STATS(OutDiscards);
+	IP6_INC_STATS(IPSTATS_MIB_OUTDISCARDS);
 	kfree_skb(skb);
 }
 
@@ -1691,7 +1691,7 @@ static int ip6_mc_del1_src(struct ifmcaddr6 *pmc, int sfmode,
 	struct ip6_sf_list *psf, *psf_prev;
 	int rv = 0;
 
-	psf_prev = 0;
+	psf_prev = NULL;
 	for (psf=pmc->mca_sources; psf; psf=psf->sf_next) {
 		if (ipv6_addr_cmp(&psf->sf_addr, psfsrc) == 0)
 			break;
@@ -1786,7 +1786,7 @@ static int ip6_mc_add1_src(struct ifmcaddr6 *pmc, int sfmode,
 {
 	struct ip6_sf_list *psf, *psf_prev;
 
-	psf_prev = 0;
+	psf_prev = NULL;
 	for (psf=pmc->mca_sources; psf; psf=psf->sf_next) {
 		if (ipv6_addr_cmp(&psf->sf_addr, psfsrc) == 0)
 			break;
@@ -1914,12 +1914,12 @@ static void ip6_mc_clear_src(struct ifmcaddr6 *pmc)
 		nextpsf = psf->sf_next;
 		kfree(psf);
 	}
-	pmc->mca_tomb = 0;
+	pmc->mca_tomb = NULL;
 	for (psf=pmc->mca_sources; psf; psf=nextpsf) {
 		nextpsf = psf->sf_next;
 		kfree(psf);
 	}
-	pmc->mca_sources = 0;
+	pmc->mca_sources = NULL;
 	pmc->mca_sfmode = MCAST_EXCLUDE;
 	pmc->mca_sfcount[MCAST_EXCLUDE] = 0;
 	pmc->mca_sfcount[MCAST_EXCLUDE] = 1;
@@ -1956,12 +1956,12 @@ int ip6_mc_leave_src(struct sock *sk, struct ipv6_mc_socklist *iml,
 
 	if (iml->sflist == 0) {
 		/* any-source empty exclude case */
-		return ip6_mc_del_src(idev, &iml->addr, iml->sfmode, 0, 0, 0);
+		return ip6_mc_del_src(idev, &iml->addr, iml->sfmode, 0, NULL, 0);
 	}
 	err = ip6_mc_del_src(idev, &iml->addr, iml->sfmode,
 		iml->sflist->sl_count, iml->sflist->sl_addr, 0);
 	sock_kfree_s(sk, iml->sflist, IP6_SFLSIZE(iml->sflist->sl_max));
-	iml->sflist = 0;
+	iml->sflist = NULL;
 	return err;
 }
 
@@ -1982,7 +1982,7 @@ static void mld_gq_timer_expire(unsigned long data)
 	struct inet6_dev *idev = (struct inet6_dev *)data;
 
 	idev->mc_gq_running = 0;
-	mld_send_report(idev, 0);
+	mld_send_report(idev, NULL);
 	__in6_dev_put(idev);
 }
 
@@ -2074,7 +2074,7 @@ void ipv6_mc_init_dev(struct inet6_dev *idev)
 	init_timer(&idev->mc_gq_timer);
 	idev->mc_gq_timer.data = (unsigned long) idev;
 	idev->mc_gq_timer.function = &mld_gq_timer_expire;
-	idev->mc_tomb = 0;
+	idev->mc_tomb = NULL;
 	idev->mc_ifc_count = 0;
 	init_timer(&idev->mc_ifc_timer);
 	idev->mc_ifc_timer.data = (unsigned long) idev;
diff --git a/net/ipv6/ndisc.c b/net/ipv6/ndisc.c
index 245dac731..b278e5a04 100644
--- a/net/ipv6/ndisc.c
+++ b/net/ipv6/ndisc.c
@@ -77,7 +77,7 @@
 #include <net/icmp.h>
 
 #include <net/flow.h>
-#include <net/checksum.h>
+#include <net/ip6_checksum.h>
 #include <linux/proc_fs.h>
 
 #include <linux/netfilter.h>
@@ -452,11 +452,11 @@ static void ndisc_send_na(struct net_device *dev, struct neighbour *neigh,
 
 	skb->dst = dst;
 	idev = in6_dev_get(dst->dev);
-	IP6_INC_STATS(OutRequests);
+	IP6_INC_STATS(IPSTATS_MIB_OUTREQUESTS);
 	err = NF_HOOK(PF_INET6, NF_IP6_LOCAL_OUT, skb, NULL, dst->dev, dst_output);
 	if (!err) {
-		ICMP6_INC_STATS(idev, Icmp6OutNeighborAdvertisements);
-		ICMP6_INC_STATS(idev, Icmp6OutMsgs);
+		ICMP6_INC_STATS(idev, ICMP6_MIB_OUTNEIGHBORADVERTISEMENTS);
+		ICMP6_INC_STATS(idev, ICMP6_MIB_OUTMSGS);
 	}
 
 	if (likely(idev != NULL))
@@ -536,11 +536,11 @@ void ndisc_send_ns(struct net_device *dev, struct neighbour *neigh,
 	/* send it! */
 	skb->dst = dst;
 	idev = in6_dev_get(dst->dev);
-	IP6_INC_STATS(OutRequests);
+	IP6_INC_STATS(IPSTATS_MIB_OUTREQUESTS);
 	err = NF_HOOK(PF_INET6, NF_IP6_LOCAL_OUT, skb, NULL, dst->dev, dst_output);
 	if (!err) {
-		ICMP6_INC_STATS(idev, Icmp6OutNeighborSolicits);
-		ICMP6_INC_STATS(idev, Icmp6OutMsgs);
+		ICMP6_INC_STATS(idev, ICMP6_MIB_OUTNEIGHBORSOLICITS);
+		ICMP6_INC_STATS(idev, ICMP6_MIB_OUTMSGS);
 	}
 
 	if (likely(idev != NULL))
@@ -609,11 +609,11 @@ void ndisc_send_rs(struct net_device *dev, struct in6_addr *saddr,
 	/* send it! */
 	skb->dst = dst;
 	idev = in6_dev_get(dst->dev);
-	IP6_INC_STATS(OutRequests);	
+	IP6_INC_STATS(IPSTATS_MIB_OUTREQUESTS);	
 	err = NF_HOOK(PF_INET6, NF_IP6_LOCAL_OUT, skb, NULL, dst->dev, dst_output);
 	if (!err) {
-		ICMP6_INC_STATS(idev, Icmp6OutRouterSolicits);
-		ICMP6_INC_STATS(idev, Icmp6OutMsgs);
+		ICMP6_INC_STATS(idev, ICMP6_MIB_OUTROUTERSOLICITS);
+		ICMP6_INC_STATS(idev, ICMP6_MIB_OUTMSGS);
 	}
 
 	if (likely(idev != NULL))
@@ -1335,11 +1335,11 @@ void ndisc_send_redirect(struct sk_buff *skb, struct neighbour *neigh,
 
 	buff->dst = dst;
 	idev = in6_dev_get(dst->dev);
-	IP6_INC_STATS(OutRequests);
+	IP6_INC_STATS(IPSTATS_MIB_OUTREQUESTS);
 	err = NF_HOOK(PF_INET6, NF_IP6_LOCAL_OUT, buff, NULL, dst->dev, dst_output);
 	if (!err) {
-		ICMP6_INC_STATS(idev, Icmp6OutRedirects);
-		ICMP6_INC_STATS(idev, Icmp6OutMsgs);
+		ICMP6_INC_STATS(idev, ICMP6_MIB_OUTREDIRECTS);
+		ICMP6_INC_STATS(idev, ICMP6_MIB_OUTMSGS);
 	}
 
 	if (likely(idev != NULL))
@@ -1423,7 +1423,7 @@ static struct notifier_block ndisc_netdev_notifier = {
 };
 
 #ifdef CONFIG_SYSCTL
-int ndisc_ifinfo_sysctl_change(struct ctl_table *ctl, int write, struct file * filp, void __user *buffer, size_t *lenp)
+int ndisc_ifinfo_sysctl_change(struct ctl_table *ctl, int write, struct file * filp, void __user *buffer, size_t *lenp, loff_t *ppos)
 {
 	struct net_device *dev = ctl->extra1;
 	struct inet6_dev *idev;
@@ -1433,7 +1433,7 @@ int ndisc_ifinfo_sysctl_change(struct ctl_table *ctl, int write, struct file * f
 		inet6_ifinfo_notify(RTM_NEWLINK, idev);
 		in6_dev_put(idev);
 	}
-	return proc_dointvec(ctl, write, filp, buffer, lenp);
+	return proc_dointvec(ctl, write, filp, buffer, lenp, ppos);
 }
 #endif
 
diff --git a/net/ipv6/netfilter/ip6_tables.c b/net/ipv6/netfilter/ip6_tables.c
index 223212888..d2ce00d81 100644
--- a/net/ipv6/netfilter/ip6_tables.c
+++ b/net/ipv6/netfilter/ip6_tables.c
@@ -1845,6 +1845,15 @@ static inline int print_name(const char *i,
 	return 0;
 }
 
+static inline int print_target(const struct ip6t_target *t,
+                               off_t start_offset, char *buffer, int length,
+                               off_t *pos, unsigned int *count)
+{
+	if (t == &ip6t_standard_target || t == &ip6t_error_target)
+		return 0;
+	return print_name((char *)t, start_offset, buffer, length, pos, count);
+}
+
 static int ip6t_get_tables(char *buffer, char **start, off_t offset, int length)
 {
 	off_t pos = 0;
@@ -1871,7 +1880,7 @@ static int ip6t_get_targets(char *buffer, char **start, off_t offset, int length
 	if (down_interruptible(&ip6t_mutex) != 0)
 		return 0;
 
-	LIST_FIND(&ip6t_target, print_name, char *,
+	LIST_FIND(&ip6t_target, print_target, struct ip6t_target *,
 		  offset, buffer, length, &pos, &count);
 
 	up(&ip6t_mutex);
diff --git a/net/ipv6/netfilter/ip6t_LOG.c b/net/ipv6/netfilter/ip6t_LOG.c
index 97fe3a63d..bb8590bdd 100644
--- a/net/ipv6/netfilter/ip6t_LOG.c
+++ b/net/ipv6/netfilter/ip6t_LOG.c
@@ -48,10 +48,10 @@ static spinlock_t log_lock = SPIN_LOCK_UNLOCKED;
 
 /* takes in current header and pointer to the header */
 /* if another header exists, sets hdrptr to the next header
-   and returns the new header value, else returns 0 */
+   and returns the new header value, else returns IPPROTO_NONE */
 static u_int8_t ip6_nexthdr(u_int8_t currenthdr, u_int8_t **hdrptr)
 {
-	u_int8_t hdrlen, nexthdr = 0;
+	u_int8_t hdrlen, nexthdr = IPPROTO_NONE;
 
 	switch(currenthdr){
 		case IPPROTO_AH:
@@ -77,7 +77,6 @@ static u_int8_t ip6_nexthdr(u_int8_t currenthdr, u_int8_t **hdrptr)
 			break;
 	}	
 	return nexthdr;
-
 }
 
 /* One level of recursion won't kill us */
@@ -101,7 +100,7 @@ static void dump_packet(const struct ip6t_log_info *info,
 
 	fragment = 0;
 	hdrptr = (u_int8_t *)(ipv6h + 1);
-	while (currenthdr) {
+	while (currenthdr != IPPROTO_NONE) {
 		if ((currenthdr == IPPROTO_TCP) ||
 		    (currenthdr == IPPROTO_UDP) ||
 		    (currenthdr == IPPROTO_ICMPV6))
@@ -264,7 +263,7 @@ static void dump_packet(const struct ip6t_log_info *info,
 		}
 		break;
 	}
-	/* Max length: 10 "PROTO 255 " */
+	/* Max length: 10 "PROTO=255 " */
 	default:
 		printk("PROTO=%u ", currenthdr);
 	}
diff --git a/net/ipv6/netfilter/ip6t_owner.c b/net/ipv6/netfilter/ip6t_owner.c
index 0bb9c661b..272257b3b 100644
--- a/net/ipv6/netfilter/ip6t_owner.c
+++ b/net/ipv6/netfilter/ip6t_owner.c
@@ -143,7 +143,14 @@ checkentry(const char *tablename,
 
 	if (matchsize != IP6T_ALIGN(sizeof(struct ip6t_owner_info)))
 		return 0;
-
+#ifdef CONFIG_SMP
+	/* files->file_lock can not be used in a BH */
+	if (((struct ip6t_owner_info *)matchinfo)->match
+	    & (IP6T_OWNER_PID|IP6T_OWNER_SID)) {
+		printk("ip6t_owner: pid and sid matching is broken on SMP.\n");
+		return 0;
+	}
+#endif
 	return 1;
 }
 
diff --git a/net/ipv6/netfilter/ip6table_raw.c b/net/ipv6/netfilter/ip6table_raw.c
index 62ba3373d..b7077e9bf 100644
--- a/net/ipv6/netfilter/ip6table_raw.c
+++ b/net/ipv6/netfilter/ip6table_raw.c
@@ -38,43 +38,72 @@ static struct
 	struct ip6t_replace repl;
 	struct ip6t_standard entries[2];
 	struct ip6t_error term;
-} initial_table __initdata 
-= { { "raw", RAW_VALID_HOOKS, 3,
-      sizeof(struct ip6t_standard) * 2 + sizeof(struct ip6t_error),
-      { [NF_IP6_PRE_ROUTING] 	0,
-	[NF_IP6_LOCAL_OUT]	sizeof(struct ip6t_standard) },
-      { [NF_IP6_PRE_ROUTING] 	0,
-	[NF_IP6_LOCAL_OUT]	sizeof(struct ip6t_standard) },
-      0, NULL, { } },
-    {
-	    /* PRE_ROUTING */
-            { { { { { { 0 } } }, { { { 0 } } }, { { { 0 } } }, { { { 0 } } }, "", "", { 0 }, { 0 }, 0, 0, 0 },
-		0,
-		sizeof(struct ip6t_entry),
-		sizeof(struct ip6t_standard),
-		0, { 0, 0 }, { } },
-	      { { { { IP6T_ALIGN(sizeof(struct ip6t_standard_target)), "" } }, { } },
-		-NF_ACCEPT - 1 } },
-	    /* LOCAL_OUT */
-            { { { { { { 0 } } }, { { { 0 } } }, { { { 0 } } }, { { { 0 } } }, "", "", { 0 }, { 0 }, 0, 0, 0 },
-		0,
-		sizeof(struct ip6t_entry),
-		sizeof(struct ip6t_standard),
-		0, { 0, 0 }, { } },
-	      { { { { IP6T_ALIGN(sizeof(struct ip6t_standard_target)), "" } }, { } },
-		-NF_ACCEPT - 1 } },
-    },
-    /* ERROR */
-    { { { { { { 0 } } }, { { { 0 } } }, { { { 0 } } }, { { { 0 } } }, "", "", { 0 }, { 0 }, 0, 0, 0 },
-	0,
-	sizeof(struct ip6t_entry),
-	sizeof(struct ip6t_error),
-	0, { 0, 0 }, { } },
-      { { { { IP6T_ALIGN(sizeof(struct ip6t_error_target)), IP6T_ERROR_TARGET } },
-	  { } },
-	"ERROR"
-      }
-    }
+} initial_table __initdata = {
+	.repl = {
+		.name = "raw",
+		.valid_hooks = RAW_VALID_HOOKS,
+		.num_entries = 3,
+		.size = sizeof(struct ip6t_standard) * 2 + sizeof(struct ip6t_error),
+		.hook_entry = {
+			[NF_IP6_PRE_ROUTING] = 0,
+			[NF_IP6_LOCAL_OUT] = sizeof(struct ip6t_standard)
+		},
+		.underflow = {
+			[NF_IP6_PRE_ROUTING] = 0,
+			[NF_IP6_LOCAL_OUT] = sizeof(struct ip6t_standard)
+		},
+	},
+	.entries = {
+		/* PRE_ROUTING */
+		{
+			.entry = {
+				.target_offset = sizeof(struct ip6t_entry),
+				.next_offset = sizeof(struct ip6t_standard),
+			},
+			.target = {
+				.target = {
+					.u = {
+						.target_size = IP6T_ALIGN(sizeof(struct ip6t_standard_target)),
+					},
+				},
+				.verdict = -NF_ACCEPT - 1,
+			},
+		},
+
+		/* LOCAL_OUT */
+		{
+			.entry = {
+				.target_offset = sizeof(struct ip6t_entry),
+				.next_offset = sizeof(struct ip6t_standard),
+			},
+			.target = {
+				.target = {
+					.u = {
+						.target_size = IP6T_ALIGN(sizeof(struct ip6t_standard_target)),
+					},
+				},
+				.verdict = -NF_ACCEPT - 1,
+			},
+		},
+	},
+	/* ERROR */
+	.term = {
+		.entry = {
+			.target_offset = sizeof(struct ip6t_entry),
+			.next_offset = sizeof(struct ip6t_error),
+		},
+		.target = {
+			.target = {
+				.u = {
+					.user = {
+						.target_size = IP6T_ALIGN(sizeof(struct ip6t_error_target)),
+						.name = IP6T_ERROR_TARGET,
+					},
+				},
+			},
+			.errorname = "ERROR",
+		},
+	}
 };
 
 static struct ip6t_table packet_raw = { 
diff --git a/net/ipv6/proc.c b/net/ipv6/proc.c
index fda6285ef..3330ba6cf 100644
--- a/net/ipv6/proc.c
+++ b/net/ipv6/proc.c
@@ -57,36 +57,34 @@ static int sockstat6_seq_show(struct seq_file *seq, void *v)
 	return 0;
 }
 
-static struct snmp_item snmp6_ipstats_list[] = {
+static struct snmp_mib snmp6_ipstats_list[] = {
 /* ipv6 mib according to RFC 2465 */
-#define SNMP6_GEN(x)	SNMP_ITEM(struct ipstats_mib, x, "Ip6" #x)
-	SNMP6_GEN(InReceives),
-	SNMP6_GEN(InHdrErrors),
-	SNMP6_GEN(InTooBigErrors),
-	SNMP6_GEN(InNoRoutes),
-	SNMP6_GEN(InAddrErrors),
-	SNMP6_GEN(InUnknownProtos),
-	SNMP6_GEN(InTruncatedPkts),
-	SNMP6_GEN(InDiscards),
-	SNMP6_GEN(InDelivers),
-	SNMP6_GEN(OutForwDatagrams),
-	SNMP6_GEN(OutRequests),
-	SNMP6_GEN(OutDiscards),
-	SNMP6_GEN(OutNoRoutes),
-	SNMP6_GEN(ReasmTimeout),
-	SNMP6_GEN(ReasmReqds),
-	SNMP6_GEN(ReasmOKs),
-	SNMP6_GEN(ReasmFails),
-	SNMP6_GEN(FragOKs),
-	SNMP6_GEN(FragFails),
-	SNMP6_GEN(FragCreates),
-	SNMP6_GEN(InMcastPkts),
-	SNMP6_GEN(OutMcastPkts),
-#undef SNMP6_GEN
-	SNMP_ITEM_SENTINEL
+	SNMP_MIB_ITEM("Ip6InReceives", IPSTATS_MIB_INRECEIVES),
+	SNMP_MIB_ITEM("Ip6InHdrErrors", IPSTATS_MIB_INHDRERRORS),
+	SNMP_MIB_ITEM("Ip6InTooBigErrors", IPSTATS_MIB_INTOOBIGERRORS),
+	SNMP_MIB_ITEM("Ip6InNoRoutes", IPSTATS_MIB_INNOROUTES),
+	SNMP_MIB_ITEM("Ip6InAddrErrors", IPSTATS_MIB_INADDRERRORS),
+	SNMP_MIB_ITEM("Ip6InUnknownProtos", IPSTATS_MIB_INUNKNOWNPROTOS),
+	SNMP_MIB_ITEM("Ip6InTruncatedPkts", IPSTATS_MIB_INTRUNCATEDPKTS),
+	SNMP_MIB_ITEM("Ip6InDiscards", IPSTATS_MIB_INDISCARDS),
+	SNMP_MIB_ITEM("Ip6InDelivers", IPSTATS_MIB_INDELIVERS),
+	SNMP_MIB_ITEM("Ip6OutForwDatagrams", IPSTATS_MIB_OUTFORWDATAGRAMS),
+	SNMP_MIB_ITEM("Ip6OutRequests", IPSTATS_MIB_OUTREQUESTS),
+	SNMP_MIB_ITEM("Ip6OutDiscards", IPSTATS_MIB_OUTDISCARDS),
+	SNMP_MIB_ITEM("Ip6OutNoRoutes", IPSTATS_MIB_OUTNOROUTES),
+	SNMP_MIB_ITEM("Ip6ReasmTimeout", IPSTATS_MIB_REASMTIMEOUT),
+	SNMP_MIB_ITEM("Ip6ReasmReqds", IPSTATS_MIB_REASMREQDS),
+	SNMP_MIB_ITEM("Ip6ReasmOKs", IPSTATS_MIB_REASMOKS),
+	SNMP_MIB_ITEM("Ip6ReasmFails", IPSTATS_MIB_REASMFAILS),
+	SNMP_MIB_ITEM("Ip6FragOKs", IPSTATS_MIB_FRAGOKS),
+	SNMP_MIB_ITEM("Ip6FragFails", IPSTATS_MIB_FRAGFAILS),
+	SNMP_MIB_ITEM("Ip6FragCreates", IPSTATS_MIB_FRAGCREATES),
+	SNMP_MIB_ITEM("Ip6InMcastPkts", IPSTATS_MIB_INMCASTPKTS),
+	SNMP_MIB_ITEM("Ip6OutMcastPkts", IPSTATS_MIB_OUTMCASTPKTS),
+	SNMP_MIB_SENTINEL
 };
 
-static struct snmp_item snmp6_icmp6_list[] = {
+static struct snmp_mib snmp6_icmp6_list[] = {
 /* icmpv6 mib according to RFC 2466
 
    Exceptions:  {In|Out}AdminProhibs are removed, because I see
@@ -97,47 +95,43 @@ static struct snmp_item snmp6_icmp6_list[] = {
 		OutRouterAdvertisements too.
 		OutGroupMembQueries too.
  */
-#define SNMP6_GEN(x)	SNMP_ITEM(struct icmpv6_mib, x, #x)
-	SNMP6_GEN(Icmp6InMsgs),
-	SNMP6_GEN(Icmp6InErrors),
-	SNMP6_GEN(Icmp6InDestUnreachs),
-	SNMP6_GEN(Icmp6InPktTooBigs),
-	SNMP6_GEN(Icmp6InTimeExcds),
-	SNMP6_GEN(Icmp6InParmProblems),
-	SNMP6_GEN(Icmp6InEchos),
-	SNMP6_GEN(Icmp6InEchoReplies),
-	SNMP6_GEN(Icmp6InGroupMembQueries),
-	SNMP6_GEN(Icmp6InGroupMembResponses),
-	SNMP6_GEN(Icmp6InGroupMembReductions),
-	SNMP6_GEN(Icmp6InRouterSolicits),
-	SNMP6_GEN(Icmp6InRouterAdvertisements),
-	SNMP6_GEN(Icmp6InNeighborSolicits),
-	SNMP6_GEN(Icmp6InNeighborAdvertisements),
-	SNMP6_GEN(Icmp6InRedirects),
-	SNMP6_GEN(Icmp6OutMsgs),
-	SNMP6_GEN(Icmp6OutDestUnreachs),
-	SNMP6_GEN(Icmp6OutPktTooBigs),
-	SNMP6_GEN(Icmp6OutTimeExcds),
-	SNMP6_GEN(Icmp6OutParmProblems),
-	SNMP6_GEN(Icmp6OutEchoReplies),
-	SNMP6_GEN(Icmp6OutRouterSolicits),
-	SNMP6_GEN(Icmp6OutNeighborSolicits),
-	SNMP6_GEN(Icmp6OutNeighborAdvertisements),
-	SNMP6_GEN(Icmp6OutRedirects),
-	SNMP6_GEN(Icmp6OutGroupMembResponses),
-	SNMP6_GEN(Icmp6OutGroupMembReductions),
-#undef SNMP6_GEN
-	SNMP_ITEM_SENTINEL
+	SNMP_MIB_ITEM("Icmp6InMsgs", ICMP6_MIB_INMSGS),
+	SNMP_MIB_ITEM("Icmp6InErrors", ICMP6_MIB_INERRORS),
+	SNMP_MIB_ITEM("Icmp6InDestUnreachs", ICMP6_MIB_INDESTUNREACHS),
+	SNMP_MIB_ITEM("Icmp6InPktTooBigs", ICMP6_MIB_INPKTTOOBIGS),
+	SNMP_MIB_ITEM("Icmp6InTimeExcds", ICMP6_MIB_INTIMEEXCDS),
+	SNMP_MIB_ITEM("Icmp6InParmProblems", ICMP6_MIB_INPARMPROBLEMS),
+	SNMP_MIB_ITEM("Icmp6InEchos", ICMP6_MIB_INECHOS),
+	SNMP_MIB_ITEM("Icmp6InEchoReplies", ICMP6_MIB_INECHOREPLIES),
+	SNMP_MIB_ITEM("Icmp6InGroupMembQueries", ICMP6_MIB_INGROUPMEMBQUERIES),
+	SNMP_MIB_ITEM("Icmp6InGroupMembResponses", ICMP6_MIB_INGROUPMEMBRESPONSES),
+	SNMP_MIB_ITEM("Icmp6InGroupMembReductions", ICMP6_MIB_INGROUPMEMBREDUCTIONS),
+	SNMP_MIB_ITEM("Icmp6InRouterSolicits", ICMP6_MIB_INROUTERSOLICITS),
+	SNMP_MIB_ITEM("Icmp6InRouterAdvertisements", ICMP6_MIB_INROUTERADVERTISEMENTS),
+	SNMP_MIB_ITEM("Icmp6InNeighborSolicits", ICMP6_MIB_INNEIGHBORSOLICITS),
+	SNMP_MIB_ITEM("Icmp6InNeighborAdvertisements", ICMP6_MIB_INNEIGHBORADVERTISEMENTS),
+	SNMP_MIB_ITEM("Icmp6InRedirects", ICMP6_MIB_INREDIRECTS),
+	SNMP_MIB_ITEM("Icmp6OutMsgs", ICMP6_MIB_OUTMSGS),
+	SNMP_MIB_ITEM("Icmp6OutDestUnreachs", ICMP6_MIB_OUTDESTUNREACHS),
+	SNMP_MIB_ITEM("Icmp6OutPktTooBigs", ICMP6_MIB_OUTPKTTOOBIGS),
+	SNMP_MIB_ITEM("Icmp6OutTimeExcds", ICMP6_MIB_OUTTIMEEXCDS),
+	SNMP_MIB_ITEM("Icmp6OutParmProblems", ICMP6_MIB_OUTPARMPROBLEMS),
+	SNMP_MIB_ITEM("Icmp6OutEchoReplies", ICMP6_MIB_OUTECHOREPLIES),
+	SNMP_MIB_ITEM("Icmp6OutRouterSolicits", ICMP6_MIB_OUTROUTERSOLICITS),
+	SNMP_MIB_ITEM("Icmp6OutNeighborSolicits", ICMP6_MIB_OUTNEIGHBORSOLICITS),
+	SNMP_MIB_ITEM("Icmp6OutNeighborAdvertisements", ICMP6_MIB_OUTNEIGHBORADVERTISEMENTS),
+	SNMP_MIB_ITEM("Icmp6OutRedirects", ICMP6_MIB_OUTREDIRECTS),
+	SNMP_MIB_ITEM("Icmp6OutGroupMembResponses", ICMP6_MIB_OUTGROUPMEMBRESPONSES),
+	SNMP_MIB_ITEM("Icmp6OutGroupMembReductions", ICMP6_MIB_OUTGROUPMEMBREDUCTIONS),
+	SNMP_MIB_SENTINEL
 };
 
-static struct snmp_item snmp6_udp6_list[] = {
-#define SNMP6_GEN(x)	SNMP_ITEM(struct udp_mib, Udp##x, "Udp6" #x)
-	SNMP6_GEN(InDatagrams),
-	SNMP6_GEN(NoPorts),
-	SNMP6_GEN(InErrors),
-	SNMP6_GEN(OutDatagrams),
-#undef SNMP6_GEN
-	SNMP_ITEM_SENTINEL
+static struct snmp_mib snmp6_udp6_list[] = {
+	SNMP_MIB_ITEM("Udp6InDatagrams", UDP_MIB_INDATAGRAMS),
+	SNMP_MIB_ITEM("Udp6NoPorts", UDP_MIB_NOPORTS),
+	SNMP_MIB_ITEM("Udp6InErrors", UDP_MIB_INERRORS),
+	SNMP_MIB_ITEM("Udp6OutDatagrams", UDP_MIB_OUTDATAGRAMS),
+	SNMP_MIB_SENTINEL
 };
 
 static unsigned long
@@ -149,23 +143,19 @@ fold_field(void *mib[], int offt)
         for (i = 0; i < NR_CPUS; i++) {
                 if (!cpu_possible(i))
                         continue;
-                res +=
-                    *((unsigned long *) (((void *)per_cpu_ptr(mib[0], i)) +
-                                         offt));
-                res +=
-                    *((unsigned long *) (((void *)per_cpu_ptr(mib[1], i)) +
-                                         offt));
+                res += *(((unsigned long *)per_cpu_ptr(mib[0], i)) + offt);
+                res += *(((unsigned long *)per_cpu_ptr(mib[1], i)) + offt);
         }
         return res;
 }
 
 static inline void
-snmp6_seq_show_item(struct seq_file *seq, void **mib, struct snmp_item *itemlist)
+snmp6_seq_show_item(struct seq_file *seq, void **mib, struct snmp_mib *itemlist)
 {
 	int i;
 	for (i=0; itemlist[i].name; i++)
 		seq_printf(seq, "%-32s\t%lu\n", itemlist[i].name, 
-				fold_field(mib, itemlist[i].offset));
+				fold_field(mib, itemlist[i].entry));
 }
 
 static int snmp6_seq_show(struct seq_file *seq, void *v)
diff --git a/net/ipv6/raw.c b/net/ipv6/raw.c
index 0e1b275ad..031989611 100644
--- a/net/ipv6/raw.c
+++ b/net/ipv6/raw.c
@@ -35,6 +35,7 @@
 #include <asm/uaccess.h>
 #include <asm/ioctls.h>
 
+#include <net/ip.h>
 #include <net/sock.h>
 #include <net/snmp.h>
 
@@ -42,6 +43,7 @@
 #include <net/ndisc.h>
 #include <net/protocol.h>
 #include <net/ip6_route.h>
+#include <net/ip6_checksum.h>
 #include <net/addrconf.h>
 #include <net/transp_v6.h>
 #include <net/udp.h>
@@ -417,7 +419,10 @@ static int rawv6_recvmsg(struct kiocb *iocb, struct sock *sk,
 
 	if (np->rxopt.all)
 		datagram_recv_ctl(sk, msg, skb);
+
 	err = copied;
+	if (flags & MSG_TRUNC)
+		err = skb->len;
 
 out_free:
 	skb_free_datagram(sk, skb);
@@ -533,7 +538,7 @@ static int rawv6_send_hdrinc(struct sock *sk, void *from, int length,
 	if (err)
 		goto error_fault;
 
-	IP6_INC_STATS(OutRequests);		
+	IP6_INC_STATS(IPSTATS_MIB_OUTREQUESTS);		
 	err = NF_HOOK(PF_INET6, NF_IP6_LOCAL_OUT, skb, NULL, rt->u.dst.dev,
 		      dst_output);
 	if (err > 0)
@@ -547,7 +552,7 @@ error_fault:
 	err = -EFAULT;
 	kfree_skb(skb);
 error:
-	IP6_INC_STATS(OutDiscards);
+	IP6_INC_STATS(IPSTATS_MIB_OUTDISCARDS);
 	return err; 
 }
 static int rawv6_sendmsg(struct kiocb *iocb, struct sock *sk,
@@ -898,7 +903,7 @@ static void rawv6_close(struct sock *sk, long timeout)
 	if (inet_sk(sk)->num == IPPROTO_RAW)
 		ip6_ra_control(sk, -1, NULL);
 
-	inet_sock_release(sk);
+	sk_common_release(sk);
 }
 
 static int rawv6_init_sk(struct sock *sk)
@@ -914,7 +919,7 @@ static int rawv6_init_sk(struct sock *sk)
 struct proto rawv6_prot = {
 	.name =		"RAW",
 	.close =	rawv6_close,
-	.connect =	udpv6_connect,
+	.connect =	ip6_datagram_connect,
 	.disconnect =	udp_disconnect,
 	.ioctl =	rawv6_ioctl,
 	.init =		rawv6_init_sk,
diff --git a/net/ipv6/reassembly.c b/net/ipv6/reassembly.c
index ccee9877c..836d2ae84 100644
--- a/net/ipv6/reassembly.c
+++ b/net/ipv6/reassembly.c
@@ -284,7 +284,7 @@ static void ip6_evictor(void)
 		spin_unlock(&fq->lock);
 
 		fq_put(fq);
-		IP6_INC_STATS_BH(ReasmFails);
+		IP6_INC_STATS_BH(IPSTATS_MIB_REASMFAILS);
 	}
 }
 
@@ -299,8 +299,8 @@ static void ip6_frag_expire(unsigned long data)
 
 	fq_kill(fq);
 
-	IP6_INC_STATS_BH(ReasmTimeout);
-	IP6_INC_STATS_BH(ReasmFails);
+	IP6_INC_STATS_BH(IPSTATS_MIB_REASMTIMEOUT);
+	IP6_INC_STATS_BH(IPSTATS_MIB_REASMFAILS);
 
 	/* Send error only if the first segment arrived. */
 	if (fq->last_in&FIRST_IN && fq->fragments) {
@@ -386,7 +386,7 @@ ip6_frag_create(unsigned int hash, u32 id, struct in6_addr *src, struct in6_addr
 	return ip6_frag_intern(hash, fq);
 
 oom:
-	IP6_INC_STATS_BH(ReasmFails);
+	IP6_INC_STATS_BH(IPSTATS_MIB_REASMFAILS);
 	return NULL;
 }
 
@@ -426,7 +426,7 @@ static void ip6_frag_queue(struct frag_queue *fq, struct sk_buff *skb,
 			((u8 *) (fhdr + 1) - (u8 *) (skb->nh.ipv6h + 1)));
 
 	if ((unsigned int)end > IPV6_MAXPLEN) {
-		IP6_INC_STATS_BH(InHdrErrors);
+		IP6_INC_STATS_BH(IPSTATS_MIB_INHDRERRORS);
  		icmpv6_param_prob(skb,ICMPV6_HDR_FIELD, (u8*)&fhdr->frag_off - skb->nh.raw);
  		return;
 	}
@@ -453,7 +453,7 @@ static void ip6_frag_queue(struct frag_queue *fq, struct sk_buff *skb,
 			/* RFC2460 says always send parameter problem in
 			 * this case. -DaveM
 			 */
-			IP6_INC_STATS_BH(InHdrErrors);
+			IP6_INC_STATS_BH(IPSTATS_MIB_INHDRERRORS);
 			icmpv6_param_prob(skb, ICMPV6_HDR_FIELD, 
 					  offsetof(struct ipv6hdr, payload_len));
 			return;
@@ -572,7 +572,7 @@ static void ip6_frag_queue(struct frag_queue *fq, struct sk_buff *skb,
 	return;
 
 err:
-	IP6_INC_STATS(ReasmFails);
+	IP6_INC_STATS(IPSTATS_MIB_REASMFAILS);
 	kfree_skb(skb);
 }
 
@@ -666,7 +666,7 @@ static int ip6_frag_reasm(struct frag_queue *fq, struct sk_buff **skb_in,
 	if (head->ip_summed == CHECKSUM_HW)
 		head->csum = csum_partial(head->nh.raw, head->h.raw-head->nh.raw, head->csum);
 
-	IP6_INC_STATS_BH(ReasmOKs);
+	IP6_INC_STATS_BH(IPSTATS_MIB_REASMOKS);
 	fq->fragments = NULL;
 	*nhoffp = nhoff;
 	return 1;
@@ -679,7 +679,7 @@ out_oom:
 	if (net_ratelimit())
 		printk(KERN_DEBUG "ip6_frag_reasm: no memory for reassembly\n");
 out_fail:
-	IP6_INC_STATS_BH(ReasmFails);
+	IP6_INC_STATS_BH(IPSTATS_MIB_REASMFAILS);
 	return -1;
 }
 
@@ -693,16 +693,16 @@ static int ipv6_frag_rcv(struct sk_buff **skbp, unsigned int *nhoffp)
 
 	hdr = skb->nh.ipv6h;
 
-	IP6_INC_STATS_BH(ReasmReqds);
+	IP6_INC_STATS_BH(IPSTATS_MIB_REASMREQDS);
 
 	/* Jumbo payload inhibits frag. header */
 	if (hdr->payload_len==0) {
-		IP6_INC_STATS(InHdrErrors);
+		IP6_INC_STATS(IPSTATS_MIB_INHDRERRORS);
 		icmpv6_param_prob(skb, ICMPV6_HDR_FIELD, skb->h.raw-skb->nh.raw);
 		return -1;
 	}
 	if (!pskb_may_pull(skb, (skb->h.raw-skb->data)+sizeof(struct frag_hdr))) {
-		IP6_INC_STATS(InHdrErrors);
+		IP6_INC_STATS(IPSTATS_MIB_INHDRERRORS);
 		icmpv6_param_prob(skb, ICMPV6_HDR_FIELD, skb->h.raw-skb->nh.raw);
 		return -1;
 	}
@@ -713,7 +713,7 @@ static int ipv6_frag_rcv(struct sk_buff **skbp, unsigned int *nhoffp)
 	if (!(fhdr->frag_off & htons(0xFFF9))) {
 		/* It is not a fragmented frame */
 		skb->h.raw += sizeof(struct frag_hdr);
-		IP6_INC_STATS_BH(ReasmOKs);
+		IP6_INC_STATS_BH(IPSTATS_MIB_REASMOKS);
 
 		*nhoffp = (u8*)fhdr - skb->nh.raw;
 		return 1;
@@ -738,7 +738,7 @@ static int ipv6_frag_rcv(struct sk_buff **skbp, unsigned int *nhoffp)
 		return ret;
 	}
 
-	IP6_INC_STATS_BH(ReasmFails);
+	IP6_INC_STATS_BH(IPSTATS_MIB_REASMFAILS);
 	kfree_skb(skb);
 	return -1;
 }
diff --git a/net/ipv6/route.c b/net/ipv6/route.c
index 541f2434b..2017c69dc 100644
--- a/net/ipv6/route.c
+++ b/net/ipv6/route.c
@@ -584,7 +584,24 @@ static void ip6_rt_update_pmtu(struct dst_entry *dst, u32 mtu)
 /* Protected by rt6_lock.  */
 static struct dst_entry *ndisc_dst_gc_list;
 static int ipv6_get_mtu(struct net_device *dev);
-static inline unsigned int ipv6_advmss(unsigned int mtu);
+
+static inline unsigned int ipv6_advmss(unsigned int mtu)
+{
+	mtu -= sizeof(struct ipv6hdr) + sizeof(struct tcphdr);
+
+	if (mtu < ip6_rt_min_advmss)
+		mtu = ip6_rt_min_advmss;
+
+	/*
+	 * Maximal non-jumbo IPv6 payload is IPV6_MAXPLEN and 
+	 * corresponding MSS is IPV6_MAXPLEN - tcp_header_size. 
+	 * IPV6_MAXPLEN is also valid and means: "any MSS, 
+	 * rely only on pmtu discovery"
+	 */
+	if (mtu > IPV6_MAXPLEN - sizeof(struct tcphdr))
+		mtu = IPV6_MAXPLEN;
+	return mtu;
+}
 
 struct dst_entry *ndisc_dst_alloc(struct net_device *dev, 
 				  struct neighbour *neigh,
@@ -605,15 +622,20 @@ struct dst_entry *ndisc_dst_alloc(struct net_device *dev,
 	rt->rt6i_dev	  = dev;
 	rt->rt6i_idev     = in6_dev_get(dev);
 	rt->rt6i_nexthop  = neigh;
-	rt->rt6i_expires  = 0;
-	rt->rt6i_flags    = RTF_LOCAL;
-	rt->rt6i_metric   = 0;
 	atomic_set(&rt->u.dst.__refcnt, 1);
 	rt->u.dst.metrics[RTAX_HOPLIMIT-1] = 255;
 	rt->u.dst.metrics[RTAX_MTU-1] = ipv6_get_mtu(rt->rt6i_dev);
 	rt->u.dst.metrics[RTAX_ADVMSS-1] = ipv6_advmss(dst_pmtu(&rt->u.dst));
 	rt->u.dst.output  = output;
 
+#if 0	/* there's no chance to use these for ndisc */
+	rt->u.dst.flags   = ipv6_addr_type(addr) & IPV6_ADDR_UNICAST 
+				? DST_HOST 
+				: 0;
+	ipv6_addr_copy(&rt->rt6i_dst.addr, addr);
+	rt->rt6i_dst.plen = 128;
+#endif
+
 	write_lock_bh(&rt6_lock);
 	rt->u.dst.next = ndisc_dst_gc_list;
 	ndisc_dst_gc_list = &rt->u.dst;
@@ -687,24 +709,6 @@ static int ipv6_get_mtu(struct net_device *dev)
 	return mtu;
 }
 
-static inline unsigned int ipv6_advmss(unsigned int mtu)
-{
-	mtu -= sizeof(struct ipv6hdr) + sizeof(struct tcphdr);
-
-	if (mtu < ip6_rt_min_advmss)
-		mtu = ip6_rt_min_advmss;
-
-	/*
-	 * Maximal non-jumbo IPv6 payload is IPV6_MAXPLEN and 
-	 * corresponding MSS is IPV6_MAXPLEN - tcp_header_size. 
-	 * IPV6_MAXPLEN is also valid and means: "any MSS, 
-	 * rely only on pmtu discovery"
-	 */
-	if (mtu > IPV6_MAXPLEN - sizeof(struct tcphdr))
-		mtu = IPV6_MAXPLEN;
-	return mtu;
-}
-
 static int ipv6_get_hoplimit(struct net_device *dev)
 {
 	int hoplimit = ipv6_devconf.hop_limit;
@@ -1287,7 +1291,7 @@ int ipv6_route_ioctl(unsigned int cmd, void __user *arg)
 
 int ip6_pkt_discard(struct sk_buff *skb)
 {
-	IP6_INC_STATS(OutNoRoutes);
+	IP6_INC_STATS(IPSTATS_MIB_OUTNOROUTES);
 	icmpv6_send(skb, ICMPV6_DEST_UNREACH, ICMPV6_NOROUTE, 0, skb->dev);
 	kfree_skb(skb);
 	return 0;
@@ -1920,10 +1924,10 @@ static int flush_delay;
 
 static
 int ipv6_sysctl_rtcache_flush(ctl_table *ctl, int write, struct file * filp,
-			      void __user *buffer, size_t *lenp)
+			      void __user *buffer, size_t *lenp, loff_t *ppos)
 {
 	if (write) {
-		proc_dointvec(ctl, write, filp, buffer, lenp);
+		proc_dointvec(ctl, write, filp, buffer, lenp, ppos);
 		if (flush_delay < 0)
 			flush_delay = 0;
 		fib6_run_gc((unsigned long)flush_delay);
diff --git a/net/ipv6/sit.c b/net/ipv6/sit.c
index 2fac873fd..23482d1bd 100644
--- a/net/ipv6/sit.c
+++ b/net/ipv6/sit.c
@@ -388,13 +388,7 @@ static int ipip6_rcv(struct sk_buff *skb)
 		skb->dev = tunnel->dev;
 		dst_release(skb->dst);
 		skb->dst = NULL;
-#ifdef CONFIG_NETFILTER
-		nf_conntrack_put(skb->nfct);
-		skb->nfct = NULL;
-#ifdef CONFIG_NETFILTER_DEBUG
-		skb->nf_debug = 0;
-#endif
-#endif
+		nf_reset(skb);
 		ipip6_ecn_decapsulate(iph, skb);
 		netif_rx(skb);
 		read_unlock(&ipip6_lock);
@@ -580,13 +574,7 @@ static int ipip6_tunnel_xmit(struct sk_buff *skb, struct net_device *dev)
 	if ((iph->ttl = tiph->ttl) == 0)
 		iph->ttl	=	iph6->hop_limit;
 
-#ifdef CONFIG_NETFILTER
-	nf_conntrack_put(skb->nfct);
-	skb->nfct = NULL;
-#ifdef CONFIG_NETFILTER_DEBUG
-	skb->nf_debug = 0;
-#endif
-#endif
+	nf_reset(skb);
 
 	IPTUNNEL_XMIT();
 	tunnel->recursion--;
@@ -800,7 +788,7 @@ int __init ipip6_fb_tunnel_init(struct net_device *dev)
 	return 0;
 }
 
-static struct inet_protocol sit_protocol = {
+static struct net_protocol sit_protocol = {
 	.handler	=	ipip6_rcv,
 	.err_handler	=	ipip6_err,
 };
diff --git a/net/ipv6/tcp_ipv6.c b/net/ipv6/tcp_ipv6.c
index 2668fc87c..5a19b3d75 100644
--- a/net/ipv6/tcp_ipv6.c
+++ b/net/ipv6/tcp_ipv6.c
@@ -51,9 +51,12 @@
 #include <net/transp_v6.h>
 #include <net/addrconf.h>
 #include <net/ip6_route.h>
+#include <net/ip6_checksum.h>
 #include <net/inet_ecn.h>
 #include <net/protocol.h>
 #include <net/xfrm.h>
+#include <net/addrconf.h>
+#include <net/snmp.h>
 
 #include <asm/uaccess.h>
 
@@ -494,7 +497,7 @@ unique:
 		/* Silly. Should hash-dance instead... */
 		local_bh_disable();
 		tcp_tw_deschedule(tw);
-		NET_INC_STATS_BH(TimeWaitRecycled);
+		NET_INC_STATS_BH(LINUX_MIB_TIMEWAITRECYCLED);
 		local_bh_enable();
 
 		tcp_tw_put(tw);
@@ -733,7 +736,7 @@ static void tcp_v6_err(struct sk_buff *skb, struct inet6_skb_parm *opt,
 	sk = tcp_v6_lookup(&hdr->daddr, th->dest, &hdr->saddr, th->source, skb->dev->ifindex);
 
 	if (sk == NULL) {
-		ICMP6_INC_STATS_BH(__in6_dev_get(skb->dev), Icmp6InErrors);
+		ICMP6_INC_STATS_BH(__in6_dev_get(skb->dev), ICMP6_MIB_INERRORS);
 		return;
 	}
 
@@ -744,7 +747,7 @@ static void tcp_v6_err(struct sk_buff *skb, struct inet6_skb_parm *opt,
 
 	bh_lock_sock(sk);
 	if (sock_owned_by_user(sk))
-		NET_INC_STATS_BH(LockDroppedIcmps);
+		NET_INC_STATS_BH(LINUX_MIB_LOCKDROPPEDICMPS);
 
 	if (sk->sk_state == TCP_CLOSE)
 		goto out;
@@ -753,7 +756,7 @@ static void tcp_v6_err(struct sk_buff *skb, struct inet6_skb_parm *opt,
 	seq = ntohl(th->seq); 
 	if (sk->sk_state != TCP_LISTEN &&
 	    !between(seq, tp->snd_una, tp->snd_nxt)) {
-		NET_INC_STATS_BH(OutOfWindowIcmps);
+		NET_INC_STATS_BH(LINUX_MIB_OUTOFWINDOWICMPS);
 		goto out;
 	}
 
@@ -821,7 +824,7 @@ static void tcp_v6_err(struct sk_buff *skb, struct inet6_skb_parm *opt,
 		BUG_TRAP(req->sk == NULL);
 
 		if (seq != req->snt_isn) {
-			NET_INC_STATS_BH(OutOfWindowIcmps);
+			NET_INC_STATS_BH(LINUX_MIB_OUTOFWINDOWICMPS);
 			goto out;
 		}
 
@@ -832,7 +835,7 @@ static void tcp_v6_err(struct sk_buff *skb, struct inet6_skb_parm *opt,
 	case TCP_SYN_RECV:  /* Cannot happen.
 			       It can, it SYNs are crossed. --ANK */ 
 		if (!sock_owned_by_user(sk)) {
-			TCP_INC_STATS_BH(TcpAttemptFails);
+			TCP_INC_STATS_BH(TCP_MIB_ATTEMPTFAILS);
 			sk->sk_err = err;
 			sk->sk_error_report(sk);		/* Wake people up to see the error (see connect in sock.c) */
 
@@ -1019,8 +1022,8 @@ static void tcp_v6_send_reset(struct sk_buff *skb)
 	/* sk = NULL, but it is safe for now. RST socket required. */
 	if (!ip6_dst_lookup(NULL, &buff->dst, &fl)) {
 		ip6_xmit(NULL, buff, &fl, NULL, 0);
-		TCP_INC_STATS_BH(TcpOutSegs);
-		TCP_INC_STATS_BH(TcpOutRsts);
+		TCP_INC_STATS_BH(TCP_MIB_OUTSEGS);
+		TCP_INC_STATS_BH(TCP_MIB_OUTRSTS);
 		return;
 	}
 
@@ -1080,7 +1083,7 @@ static void tcp_v6_send_ack(struct sk_buff *skb, u32 seq, u32 ack, u32 win, u32
 
 	if (!ip6_dst_lookup(NULL, &buff->dst, &fl)) {
 		ip6_xmit(NULL, buff, &fl, NULL, 0);
-		TCP_INC_STATS_BH(TcpOutSegs);
+		TCP_INC_STATS_BH(TCP_MIB_OUTSEGS);
 		return;
 	}
 
@@ -1232,7 +1235,7 @@ drop:
 	if (req)
 		tcp_openreq_free(req);
 
-	TCP_INC_STATS_BH(TcpAttemptFails);
+	TCP_INC_STATS_BH(TCP_MIB_ATTEMPTFAILS);
 	return 0; /* don't send reset */
 }
 
@@ -1408,9 +1411,9 @@ static struct sock * tcp_v6_syn_recv_sock(struct sock *sk, struct sk_buff *skb,
 	return newsk;
 
 out_overflow:
-	NET_INC_STATS_BH(ListenOverflows);
+	NET_INC_STATS_BH(LINUX_MIB_LISTENOVERFLOWS);
 out:
-	NET_INC_STATS_BH(ListenDrops);
+	NET_INC_STATS_BH(LINUX_MIB_LISTENDROPS);
 	if (opt && opt != np->opt)
 		sock_kfree_s(sk, opt, opt->tot_len);
 	dst_release(dst);
@@ -1535,7 +1538,7 @@ discard:
 	kfree_skb(skb);
 	return 0;
 csum_err:
-	TCP_INC_STATS_BH(TcpInErrs);
+	TCP_INC_STATS_BH(TCP_MIB_INERRS);
 	goto discard;
 
 
@@ -1581,7 +1584,7 @@ static int tcp_v6_rcv(struct sk_buff **pskb, unsigned int *nhoffp)
 	/*
 	 *	Count it even if it's bad.
 	 */
-	TCP_INC_STATS_BH(TcpInSegs);
+	TCP_INC_STATS_BH(TCP_MIB_INSEGS);
 
 	if (!pskb_may_pull(skb, sizeof(struct tcphdr)))
 		goto discard_it;
@@ -1642,7 +1645,7 @@ no_tcp_socket:
 
 	if (skb->len < (th->doff<<2) || tcp_checksum_complete(skb)) {
 bad_packet:
-		TCP_INC_STATS_BH(TcpInErrs);
+		TCP_INC_STATS_BH(TCP_MIB_INERRS);
 	} else {
 		tcp_v6_send_reset(skb);
 	}
@@ -1667,7 +1670,7 @@ do_time_wait:
 	}
 
 	if (skb->len < (th->doff<<2) || tcp_checksum_complete(skb)) {
-		TCP_INC_STATS_BH(TcpInErrs);
+		TCP_INC_STATS_BH(TCP_MIB_INERRS);
 		tcp_tw_put((struct tcp_tw_bucket *) sk);
 		goto discard_it;
 	}
@@ -1878,7 +1881,7 @@ static int tcp_v6_init_sock(struct sock *sk)
 
 	tp->af_specific = &ipv6_specific;
 
-	sk->sk_write_space = tcp_write_space;
+	sk->sk_write_space = sk_stream_write_space;
 	sk->sk_use_write_queue = 1;
 
 	sk->sk_sndbuf = sysctl_tcp_wmem[1];
@@ -1891,30 +1894,9 @@ static int tcp_v6_init_sock(struct sock *sk)
 
 static int tcp_v6_destroy_sock(struct sock *sk)
 {
-	struct tcp_opt *tp = tcp_sk(sk);
-	struct inet_opt *inet = inet_sk(sk);
-
-	tcp_clear_xmit_timers(sk);
-
-	/* Cleanup up the write buffer. */
-  	tcp_writequeue_purge(sk);
-
-	/* Cleans up our, hopefully empty, out_of_order_queue. */
-  	__skb_queue_purge(&tp->out_of_order_queue);
-
-	/* Clean prequeue, it must be empty really */
-	__skb_queue_purge(&tp->ucopy.prequeue);
-
-	/* Clean up a referenced TCP bind bucket. */
-	if (tcp_sk(sk)->bind_hash)
-		tcp_put_port(sk);
-
-	/* If sendmsg cached page exists, toss it. */
-	if (inet->sndmsg_page != NULL)
-		__free_page(inet->sndmsg_page);
-
-	atomic_dec(&tcp_sockets_allocated);
+	extern int tcp_v4_destroy_sock(struct sock *sk);
 
+	tcp_v4_destroy_sock(sk);
 	return inet6_destroy_sock(sk);
 }
 
@@ -2035,12 +2017,12 @@ static int tcp6_seq_show(struct seq_file *seq, void *v)
 	struct tcp_iter_state *st;
 
 	if (v == SEQ_START_TOKEN) {
-		seq_printf(seq,
-			   "  sl  "
-			   "local_address                         "
-			   "remote_address                        "
-			   "st tx_queue rx_queue tr tm->when retrnsmt"
-			   "   uid  timeout inode\n");
+		seq_puts(seq,
+			 "  sl  "
+			 "local_address                         "
+			 "remote_address                        "
+			 "st tx_queue rx_queue tr tm->when retrnsmt"
+			 "   uid  timeout inode\n");
 		goto out;
 	}
 	st = seq->private;
@@ -2082,23 +2064,31 @@ void tcp6_proc_exit(void)
 #endif
 
 struct proto tcpv6_prot = {
-	.name		=	"TCPv6",
-	.close		=	tcp_close,
-	.connect	=	tcp_v6_connect,
-	.disconnect	=	tcp_disconnect,
-	.accept		=	tcp_accept,
-	.ioctl		=	tcp_ioctl,
-	.init		=	tcp_v6_init_sock,
-	.destroy	=	tcp_v6_destroy_sock,
-	.shutdown	=	tcp_shutdown,
-	.setsockopt	=	tcp_setsockopt,
-	.getsockopt	=	tcp_getsockopt,
-	.sendmsg	=	tcp_sendmsg,
-	.recvmsg	=	tcp_recvmsg,
-	.backlog_rcv	=	tcp_v6_do_rcv,
-	.hash		=	tcp_v6_hash,
-	.unhash		=	tcp_unhash,
-	.get_port	=	tcp_v6_get_port,
+	.name			= "TCPv6",
+	.close			= tcp_close,
+	.connect		= tcp_v6_connect,
+	.disconnect		= tcp_disconnect,
+	.accept			= tcp_accept,
+	.ioctl			= tcp_ioctl,
+	.init			= tcp_v6_init_sock,
+	.destroy		= tcp_v6_destroy_sock,
+	.shutdown		= tcp_shutdown,
+	.setsockopt		= tcp_setsockopt,
+	.getsockopt		= tcp_getsockopt,
+	.sendmsg		= tcp_sendmsg,
+	.recvmsg		= tcp_recvmsg,
+	.backlog_rcv		= tcp_v6_do_rcv,
+	.hash			= tcp_v6_hash,
+	.unhash			= tcp_unhash,
+	.get_port		= tcp_v6_get_port,
+	.enter_memory_pressure	= tcp_enter_memory_pressure,
+	.sockets_allocated	= &tcp_sockets_allocated,
+	.memory_allocated	= &tcp_memory_allocated,
+	.memory_pressure	= &tcp_memory_pressure,
+	.sysctl_mem		= sysctl_tcp_mem,
+	.sysctl_wmem		= sysctl_tcp_wmem,
+	.sysctl_rmem		= sysctl_tcp_rmem,
+	.max_header		= MAX_TCP_HEADER,
 };
 
 static struct inet6_protocol tcpv6_protocol = {
diff --git a/net/ipv6/udp.c b/net/ipv6/udp.c
index 0dc7f0ec1..7133801bd 100644
--- a/net/ipv6/udp.c
+++ b/net/ipv6/udp.c
@@ -49,9 +49,10 @@
 #include <net/addrconf.h>
 #include <net/ip.h>
 #include <net/udp.h>
+#include <net/raw.h>
 #include <net/inet_common.h>
 
-#include <net/checksum.h>
+#include <net/ip6_checksum.h>
 #include <net/xfrm.h>
 
 #include <linux/proc_fs.h>
@@ -203,162 +204,9 @@ static struct sock *udp_v6_lookup(struct in6_addr *saddr, u16 sport,
  *
  */
 
-int udpv6_connect(struct sock *sk, struct sockaddr *uaddr, int addr_len)
-{
-	struct sockaddr_in6	*usin = (struct sockaddr_in6 *) uaddr;
-	struct inet_opt      	*inet = inet_sk(sk);
-	struct ipv6_pinfo      	*np = inet6_sk(sk);
-	struct in6_addr		*daddr;
-	struct dst_entry	*dst;
-	struct flowi		fl;
-	struct ip6_flowlabel	*flowlabel = NULL;
-	int			addr_type;
-	int			err;
-
-	if (usin->sin6_family == AF_INET) {
-		if (__ipv6_only_sock(sk))
-			return -EAFNOSUPPORT;
-		err = udp_connect(sk, uaddr, addr_len);
-		goto ipv4_connected;
-	}
-
-	if (addr_len < SIN6_LEN_RFC2133)
-	  	return -EINVAL;
-
-	if (usin->sin6_family != AF_INET6) 
-	  	return -EAFNOSUPPORT;
-
-	memset(&fl, 0, sizeof(fl));
-	if (np->sndflow) {
-		fl.fl6_flowlabel = usin->sin6_flowinfo&IPV6_FLOWINFO_MASK;
-		if (fl.fl6_flowlabel&IPV6_FLOWLABEL_MASK) {
-			flowlabel = fl6_sock_lookup(sk, fl.fl6_flowlabel);
-			if (flowlabel == NULL)
-				return -EINVAL;
-			ipv6_addr_copy(&usin->sin6_addr, &flowlabel->dst);
-		}
-	}
-
-	addr_type = ipv6_addr_type(&usin->sin6_addr);
-
-	if (addr_type == IPV6_ADDR_ANY) {
-		/*
-		 *	connect to self
-		 */
-		usin->sin6_addr.s6_addr[15] = 0x01;
-	}
-
-	daddr = &usin->sin6_addr;
-
-	if (addr_type == IPV6_ADDR_MAPPED) {
-		struct sockaddr_in sin;
-
-		if (__ipv6_only_sock(sk)) {
-			err = -ENETUNREACH;
-			goto out;
-		}
-		sin.sin_family = AF_INET;
-		sin.sin_addr.s_addr = daddr->s6_addr32[3];
-		sin.sin_port = usin->sin6_port;
-
-		err = udp_connect(sk, (struct sockaddr*) &sin, sizeof(sin));
-
-ipv4_connected:
-		if (err)
-			goto out;
-		
-		ipv6_addr_set(&np->daddr, 0, 0, htonl(0x0000ffff), inet->daddr);
-
-		if (ipv6_addr_any(&np->saddr)) {
-			ipv6_addr_set(&np->saddr, 0, 0, htonl(0x0000ffff),
-				      inet->saddr);
-		}
-
-		if (ipv6_addr_any(&np->rcv_saddr)) {
-			ipv6_addr_set(&np->rcv_saddr, 0, 0, htonl(0x0000ffff),
-				      inet->rcv_saddr);
-		}
-		goto out;
-	}
-
-	if (addr_type&IPV6_ADDR_LINKLOCAL) {
-		if (addr_len >= sizeof(struct sockaddr_in6) &&
-		    usin->sin6_scope_id) {
-			if (sk->sk_bound_dev_if &&
-			    sk->sk_bound_dev_if != usin->sin6_scope_id) {
-				err = -EINVAL;
-				goto out;
-			}
-			sk->sk_bound_dev_if = usin->sin6_scope_id;
-			if (!sk->sk_bound_dev_if &&
-			    (addr_type & IPV6_ADDR_MULTICAST))
-				fl.oif = np->mcast_oif;
-		}
-
-		/* Connect to link-local address requires an interface */
-		if (!sk->sk_bound_dev_if) {
-			err = -EINVAL;
-			goto out;
-		}
-	}
-
-	ipv6_addr_copy(&np->daddr, daddr);
-	np->flow_label = fl.fl6_flowlabel;
-
-	inet->dport = usin->sin6_port;
-
-	/*
-	 *	Check for a route to destination an obtain the
-	 *	destination cache for it.
-	 */
-
-	fl.proto = IPPROTO_UDP;
-	ipv6_addr_copy(&fl.fl6_dst, &np->daddr);
-	ipv6_addr_copy(&fl.fl6_src, &np->saddr);
-	fl.oif = sk->sk_bound_dev_if;
-	fl.fl_ip_dport = inet->dport;
-	fl.fl_ip_sport = inet->sport;
-
-	if (!fl.oif && (addr_type&IPV6_ADDR_MULTICAST))
-		fl.oif = np->mcast_oif;
-
-	if (flowlabel) {
-		if (flowlabel->opt && flowlabel->opt->srcrt) {
-			struct rt0_hdr *rt0 = (struct rt0_hdr *) flowlabel->opt->srcrt;
-			ipv6_addr_copy(&fl.fl6_dst, rt0->addr);
-		}
-	} else if (np->opt && np->opt->srcrt) {
-		struct rt0_hdr *rt0 = (struct rt0_hdr *)np->opt->srcrt;
-		ipv6_addr_copy(&fl.fl6_dst, rt0->addr);
-	}
-
-	err = ip6_dst_lookup(sk, &dst, &fl);
-	if (err)
-		goto out;
-
-	/* source address lookup done in ip6_dst_lookup */
-
-	if (ipv6_addr_any(&np->saddr))
-		ipv6_addr_copy(&np->saddr, &fl.fl6_src);
-
-	if (ipv6_addr_any(&np->rcv_saddr)) {
-		ipv6_addr_copy(&np->rcv_saddr, &fl.fl6_src);
-		inet->rcv_saddr = LOOPBACK4_IPV6;
-	}
-
-	ip6_dst_store(sk, dst,
-		      !ipv6_addr_cmp(&fl.fl6_dst, &np->daddr) ?
-		      &np->daddr : NULL);
-
-	sk->sk_state = TCP_ESTABLISHED;
-out:
-	fl6_sock_release(flowlabel);
-	return err;
-}
-
 static void udpv6_close(struct sock *sk, long timeout)
 {
-	inet_sock_release(sk);
+	sk_common_release(sk);
 }
 
 /*
@@ -436,7 +284,10 @@ try_again:
 				sin6->sin6_scope_id = IP6CB(skb)->iif;
 		}
   	}
+
 	err = copied;
+	if (flags & MSG_TRUNC)
+		err = skb->len - sizeof(struct udphdr);
 
 out_free:
 	skb_free_datagram(sk, skb);
@@ -460,7 +311,7 @@ csum_copy_err:
 	skb_free_datagram(sk, skb);
 
 	if (flags & MSG_DONTWAIT) {
-		UDP6_INC_STATS_USER(UdpInErrors);
+		UDP6_INC_STATS_USER(UDP_MIB_INERRORS);
 		return -EAGAIN;
 	}
 	goto try_again;
@@ -507,9 +358,9 @@ static inline int udpv6_queue_rcv_skb(struct sock * sk, struct sk_buff *skb)
 		return -1;
 	}
 
-	if (sk->sk_filter && skb->ip_summed != CHECKSUM_UNNECESSARY) {
+	if (skb->ip_summed != CHECKSUM_UNNECESSARY) {
 		if ((unsigned short)csum_fold(skb_checksum(skb, 0, skb->len, skb->csum))) {
-			UDP6_INC_STATS_BH(UdpInErrors);
+			UDP6_INC_STATS_BH(UDP_MIB_INERRORS);
 			kfree_skb(skb);
 			return 0;
 		}
@@ -517,11 +368,11 @@ static inline int udpv6_queue_rcv_skb(struct sock * sk, struct sk_buff *skb)
 	}
 
 	if (sock_queue_rcv_skb(sk,skb)<0) {
-		UDP6_INC_STATS_BH(UdpInErrors);
+		UDP6_INC_STATS_BH(UDP_MIB_INERRORS);
 		kfree_skb(skb);
 		return 0;
 	}
-	UDP6_INC_STATS_BH(UdpInDatagrams);
+	UDP6_INC_STATS_BH(UDP_MIB_INDATAGRAMS);
 	return 0;
 }
 
@@ -670,7 +521,7 @@ static int udpv6_rcv(struct sk_buff **pskb, unsigned int *nhoffp)
 		if (skb->ip_summed != CHECKSUM_UNNECESSARY &&
 		    (unsigned short)csum_fold(skb_checksum(skb, 0, skb->len, skb->csum)))
 			goto discard;
-		UDP6_INC_STATS_BH(UdpNoPorts);
+		UDP6_INC_STATS_BH(UDP_MIB_NOPORTS);
 
 		icmpv6_send(skb, ICMPV6_DEST_UNREACH, ICMPV6_PORT_UNREACH, 0, dev);
 
@@ -689,7 +540,7 @@ short_packet:
 		printk(KERN_DEBUG "UDP: short packet: %d/%u\n", ulen, skb->len);
 
 discard:
-	UDP6_INC_STATS_BH(UdpInErrors);
+	UDP6_INC_STATS_BH(UDP_MIB_INERRORS);
 	kfree_skb(skb);
 	return(0);	
 }
@@ -988,7 +839,7 @@ do_append_data:
 out:
 	fl6_sock_release(flowlabel);
 	if (!err) {
-		UDP6_INC_STATS_USER(UdpOutDatagrams);
+		UDP6_INC_STATS_USER(UDP_MIB_OUTDATAGRAMS);
 		return len;
 	}
 	return err;
@@ -1044,7 +895,14 @@ static int udpv6_setsockopt(struct sock *sk, int level, int optname,
 		break;
 		
 	case UDP_ENCAP:
-		up->encap_type = val;
+		switch (val) {
+		case 0:
+			up->encap_type = val;
+			break;
+		default:
+			err = -ENOPROTOOPT;
+			break;
+		}
 		break;
 
 	default:
@@ -1167,7 +1025,7 @@ void udp6_proc_exit(void) {
 struct proto udpv6_prot = {
 	.name =		"UDP",
 	.close =	udpv6_close,
-	.connect =	udpv6_connect,
+	.connect =	ip6_datagram_connect,
 	.disconnect =	udp_disconnect,
 	.ioctl =	udp_ioctl,
 	.destroy =	udpv6_destroy_sock,
diff --git a/net/ipv6/xfrm6_input.c b/net/ipv6/xfrm6_input.c
index c679a3ce4..0791594f8 100644
--- a/net/ipv6/xfrm6_input.c
+++ b/net/ipv6/xfrm6_input.c
@@ -34,12 +34,11 @@ int xfrm6_rcv(struct sk_buff **pskb, unsigned int *nhoffp)
 	struct xfrm_state *x;
 	int xfrm_nr = 0;
 	int decaps = 0;
-	int nexthdr = 0;
-	u8 *prevhdr = NULL;
+	int nexthdr;
+	unsigned int nhoff;
 
-	ip6_find_1stfragopt(skb, &prevhdr);
-	nexthdr = *prevhdr;
-	*nhoffp = prevhdr - skb->nh.raw;
+	nhoff = *nhoffp;
+	nexthdr = skb->nh.raw[nhoff];
 
 	if ((err = xfrm_parse_spi(skb, nexthdr, &spi, &seq)) != 0)
 		goto drop;
@@ -67,6 +66,8 @@ int xfrm6_rcv(struct sk_buff **pskb, unsigned int *nhoffp)
 		if (nexthdr <= 0)
 			goto drop_unlock;
 
+		skb->nh.raw[nhoff] = nexthdr;
+
 		if (x->props.replay_window)
 			xfrm_replay_advance(x, seq);
 
diff --git a/net/ipv6/xfrm6_policy.c b/net/ipv6/xfrm6_policy.c
index 1041ef952..ab4e40b0a 100644
--- a/net/ipv6/xfrm6_policy.c
+++ b/net/ipv6/xfrm6_policy.c
@@ -157,7 +157,7 @@ __xfrm6_bundle_create(struct xfrm_policy *policy, struct xfrm_state **xfrm, int
 		/* Copy neighbour for reachability confirmation */
 		dst_prev->neighbour	= neigh_clone(rt->u.dst.neighbour);
 		dst_prev->input		= rt->u.dst.input;
-		dst_prev->output	= dst_prev->xfrm->type->output;
+		dst_prev->output	= xfrm6_output;
 		/* Sheit... I remember I did this right. Apparently,
 		 * it was magically lost, so this code needs audit */
 		x->u.rt6.rt6i_flags    = rt0->rt6i_flags&(RTCF_BROADCAST|RTCF_MULTICAST|RTCF_LOCAL);
@@ -277,10 +277,12 @@ void __init xfrm6_init(void)
 {
 	xfrm6_policy_init();
 	xfrm6_state_init();
+	xfrm6_tunnel_init();
 }
 
 void __exit xfrm6_fini(void)
 {
+	xfrm6_tunnel_fini();
 	//xfrm6_input_fini();
 	xfrm6_policy_fini();
 	xfrm6_state_fini();
diff --git a/net/ipv6/xfrm6_state.c b/net/ipv6/xfrm6_state.c
index c72cf83d4..d98b92d15 100644
--- a/net/ipv6/xfrm6_state.c
+++ b/net/ipv6/xfrm6_state.c
@@ -16,7 +16,7 @@
 #include <linux/ipsec.h>
 #include <net/ipv6.h>
 
-extern struct xfrm_state_afinfo xfrm6_state_afinfo;
+static struct xfrm_state_afinfo xfrm6_state_afinfo;
 
 static void
 __xfrm6_init_tempsel(struct xfrm_state *x, struct flowi *fl,
@@ -81,11 +81,8 @@ __xfrm6_find_acq(u8 mode, u32 reqid, u8 proto,
 		    proto == x->id.proto &&
 		    !ipv6_addr_cmp((struct in6_addr *)saddr, (struct in6_addr *)x->props.saddr.a6) &&
 		    reqid == x->props.reqid &&
-		    x->km.state == XFRM_STATE_ACQ) {
-			    if (!x0)
-				    x0 = x;
-			    if (x->id.spi)
-				    continue;
+		    x->km.state == XFRM_STATE_ACQ &&
+		    !x->id.spi) {
 			    x0 = x;
 			    break;
 		    }
diff --git a/net/ipv6/xfrm6_tunnel.c b/net/ipv6/xfrm6_tunnel.c
index f5a06546d..5766a1334 100644
--- a/net/ipv6/xfrm6_tunnel.c
+++ b/net/ipv6/xfrm6_tunnel.c
@@ -27,8 +27,8 @@
 #include <linux/list.h>
 #include <net/ip.h>
 #include <net/xfrm.h>
-#include <net/icmp.h>
 #include <net/ipv6.h>
+#include <net/protocol.h>
 #include <linux/ipv6.h>
 #include <linux/icmpv6.h>
 
@@ -343,68 +343,15 @@ void xfrm6_tunnel_free_spi(xfrm_address_t *saddr)
 
 EXPORT_SYMBOL(xfrm6_tunnel_free_spi);
 
-int xfrm6_tunnel_check_size(struct sk_buff *skb)
-{
-	int mtu, ret = 0;
-	struct dst_entry *dst = skb->dst;
-
-	mtu = dst_pmtu(dst) - sizeof(struct ipv6hdr);
-	if (mtu < IPV6_MIN_MTU)
-		mtu = IPV6_MIN_MTU;
-
-	if (skb->len > mtu) {
-		icmpv6_send(skb, ICMPV6_PKT_TOOBIG, 0, mtu, skb->dev);
-		ret = -EMSGSIZE;
-	}
-
-	return ret;
-}
-
-EXPORT_SYMBOL(xfrm6_tunnel_check_size);
-
 static int xfrm6_tunnel_output(struct sk_buff **pskb)
 {
 	struct sk_buff *skb = *pskb;
-	struct dst_entry *dst = skb->dst;
-	struct xfrm_state *x = dst->xfrm;
-	struct ipv6hdr *iph, *top_iph;
-	int err;
-
-	if ((err = xfrm6_tunnel_check_size(skb)) != 0)
-		goto error_nolock;
-
-	iph = skb->nh.ipv6h;
-
-	top_iph = (struct ipv6hdr *)skb_push(skb, x->props.header_len);
-	top_iph->version = 6;
-	top_iph->priority = iph->priority;
-	top_iph->flow_lbl[0] = iph->flow_lbl[0];
-	top_iph->flow_lbl[1] = iph->flow_lbl[1];
-	top_iph->flow_lbl[2] = iph->flow_lbl[2];
-	top_iph->nexthdr = IPPROTO_IPV6; 
-	top_iph->payload_len = htons(skb->len - sizeof(struct ipv6hdr));
-	top_iph->hop_limit = iph->hop_limit;
-	memcpy(&top_iph->saddr, (struct in6_addr *)&x->props.saddr, sizeof(struct in6_addr));
-	memcpy(&top_iph->daddr, (struct in6_addr *)&x->id.daddr, sizeof(struct in6_addr));
-	skb->nh.raw = skb->data;
-	skb->h.raw = skb->nh.raw + sizeof(struct ipv6hdr);
-
-	x->curlft.bytes += skb->len;
-	x->curlft.packets++;
+	struct ipv6hdr *top_iph;
 
-	spin_unlock_bh(&x->lock);
-
-	if ((skb->dst = dst_pop(dst)) == NULL) { 
-		kfree_skb(skb);
-		err = -EHOSTUNREACH;
-		goto error_nolock;
-	}
-
-	return NET_XMIT_BYPASS;
+	top_iph = (struct ipv6hdr *)skb->data;
+	top_iph->payload_len = htons(skb->len - sizeof(struct ipv6hdr));
 
-error_nolock:
-	kfree_skb(skb);
-	return err;
+	return 0;
 }
 
 static int xfrm6_tunnel_input(struct xfrm_state *x, struct xfrm_decap_state *decap, struct sk_buff *skb)
diff --git a/net/irda/Kconfig b/net/irda/Kconfig
index 5de911a34..9efb17ba4 100644
--- a/net/irda/Kconfig
+++ b/net/irda/Kconfig
@@ -5,6 +5,7 @@
 menuconfig IRDA
 	depends on NET
 	tristate "IrDA (infrared) subsystem support"
+	select CRC_CCITT
 	---help---
 	  Say Y here if you want to build support for the IrDA (TM) protocols.
 	  The Infrared Data Associations (tm) specifies standards for wireless
diff --git a/net/irda/Makefile b/net/irda/Makefile
index 29ad33455..d1366c2a3 100644
--- a/net/irda/Makefile
+++ b/net/irda/Makefile
@@ -9,7 +9,7 @@ obj-$(CONFIG_IRCOMM) += ircomm/
 
 irda-y := iriap.o iriap_event.o irlmp.o irlmp_event.o irlmp_frame.o \
           irlap.o irlap_event.o irlap_frame.o timer.o qos.o irqueue.o \
-          irttp.o irda_device.o irias_object.o crc.o wrapper.o af_irda.o \
+          irttp.o irda_device.o irias_object.o wrapper.o af_irda.o \
 	  discovery.o parameters.o irmod.o
 irda-$(CONFIG_PROC_FS) += irproc.o
 irda-$(CONFIG_SYSCTL) += irsysctl.o
diff --git a/net/irda/af_irda.c b/net/irda/af_irda.c
index c90c505ed..f415a4e06 100644
--- a/net/irda/af_irda.c
+++ b/net/irda/af_irda.c
@@ -1266,7 +1266,7 @@ static int irda_sendmsg(struct kiocb *iocb, struct socket *sock,
 	unsigned char *asmptr;
 	int err;
 
-	IRDA_DEBUG(4, "%s(), len=%d\n", __FUNCTION__, len);
+	IRDA_DEBUG(4, "%s(), len=%zd\n", __FUNCTION__, len);
 
 	/* Note : socket.c set MSG_EOR on SEQPACKET sockets */
 	if (msg->msg_flags & ~(MSG_DONTWAIT|MSG_EOR|MSG_CMSG_COMPAT))
@@ -1295,7 +1295,7 @@ static int irda_sendmsg(struct kiocb *iocb, struct socket *sock,
 
 	/* Check that we don't send out to big frames */
 	if (len > self->max_data_size) {
-		IRDA_DEBUG(2, "%s(), Chopping frame from %d to %d bytes!\n",
+		IRDA_DEBUG(2, "%s(), Chopping frame from %zd to %d bytes!\n",
 			   __FUNCTION__, len, self->max_data_size);
 		len = self->max_data_size;
 	}
@@ -1355,7 +1355,7 @@ static int irda_recvmsg_dgram(struct kiocb *iocb, struct socket *sock,
 	copied     = skb->len;
 
 	if (copied > size) {
-		IRDA_DEBUG(2, "%s(), Received truncated frame (%d < %d)!\n",
+		IRDA_DEBUG(2, "%s(), Received truncated frame (%zd < %zd)!\n",
 			   __FUNCTION__, copied, size);
 		copied = size;
 		msg->msg_flags |= MSG_TRUNC;
@@ -1519,7 +1519,7 @@ static int irda_sendmsg_dgram(struct kiocb *iocb, struct socket *sock,
 	unsigned char *asmptr;
 	int err;
 
-	IRDA_DEBUG(4, "%s(), len=%d\n", __FUNCTION__, len);
+	IRDA_DEBUG(4, "%s(), len=%zd\n", __FUNCTION__, len);
 
 	if (msg->msg_flags & ~(MSG_DONTWAIT|MSG_CMSG_COMPAT))
 		return -EINVAL;
@@ -1541,7 +1541,7 @@ static int irda_sendmsg_dgram(struct kiocb *iocb, struct socket *sock,
 	 */
 	if (len > self->max_data_size) {
 		IRDA_DEBUG(0, "%s(), Warning to much data! "
-			   "Chopping frame from %d to %d bytes!\n",
+			   "Chopping frame from %zd to %d bytes!\n",
 			   __FUNCTION__, len, self->max_data_size);
 		len = self->max_data_size;
 	}
@@ -1591,7 +1591,7 @@ static int irda_sendmsg_ultra(struct kiocb *iocb, struct socket *sock,
 	unsigned char *asmptr;
 	int err;
 
-	IRDA_DEBUG(4, "%s(), len=%d\n", __FUNCTION__, len);
+	IRDA_DEBUG(4, "%s(), len=%zd\n", __FUNCTION__, len);
 
 	if (msg->msg_flags & ~(MSG_DONTWAIT|MSG_CMSG_COMPAT))
 		return -EINVAL;
@@ -1637,7 +1637,7 @@ static int irda_sendmsg_ultra(struct kiocb *iocb, struct socket *sock,
 	 */
 	if (len > self->max_data_size) {
 		IRDA_DEBUG(0, "%s(), Warning to much data! "
-			   "Chopping frame from %d to %d bytes!\n",
+			   "Chopping frame from %zd to %d bytes!\n",
 			   __FUNCTION__, len, self->max_data_size);
 		len = self->max_data_size;
 	}
diff --git a/net/irda/discovery.c b/net/irda/discovery.c
index b549d02b6..645c86915 100644
--- a/net/irda/discovery.c
+++ b/net/irda/discovery.c
@@ -449,6 +449,6 @@ struct file_operations discovery_seq_fops = {
 	.open           = discovery_seq_open,
 	.read           = seq_read,
 	.llseek         = seq_lseek,
-	.release	= seq_release_private,
+	.release	= seq_release,
 };
 #endif
diff --git a/net/irda/ircomm/ircomm_core.c b/net/irda/ircomm/ircomm_core.c
index 361e8de97..010d2b576 100644
--- a/net/irda/ircomm/ircomm_core.c
+++ b/net/irda/ircomm/ircomm_core.c
@@ -62,7 +62,7 @@ static struct file_operations ircomm_proc_fops = {
 	.open           = ircomm_seq_open,
 	.read           = seq_read,
 	.llseek         = seq_lseek,
-	.release	= seq_release_private,
+	.release	= seq_release,
 };
 #endif /* CONFIG_PROC_FS */
 
diff --git a/net/irda/ircomm/ircomm_tty.c b/net/irda/ircomm/ircomm_tty.c
index f348c0caf..f0c93caf6 100644
--- a/net/irda/ircomm/ircomm_tty.c
+++ b/net/irda/ircomm/ircomm_tty.c
@@ -561,7 +561,7 @@ static void ircomm_tty_close(struct tty_struct *tty, struct file *filp)
 		tty->ldisc.flush_buffer(tty);
 
 	tty->closing = 0;
-	self->tty = 0;
+	self->tty = NULL;
 
 	if (self->blocked_open) {
 		if (self->close_delay) {
@@ -1045,7 +1045,7 @@ static void ircomm_tty_hangup(struct tty_struct *tty)
 	/* I guess we need to lock here - Jean II */
 	spin_lock_irqsave(&self->spinlock, flags);
 	self->flags &= ~ASYNC_NORMAL_ACTIVE;
-	self->tty = 0;
+	self->tty = NULL;
 	self->open_count = 0;
 	spin_unlock_irqrestore(&self->spinlock, flags);
 
diff --git a/net/irda/irda_device.c b/net/irda/irda_device.c
index 8e7493f00..80a6648a4 100644
--- a/net/irda/irda_device.c
+++ b/net/irda/irda_device.c
@@ -536,7 +536,7 @@ int irda_device_set_mode(struct net_device* dev, int mode)
  *    Setup the DMA channel. Commonly used by ISA FIR drivers
  *
  */
-void irda_setup_dma(int channel, char *buffer, int count, int mode)
+void irda_setup_dma(int channel, dma_addr_t buffer, int count, int mode)
 {
 	unsigned long flags;
 
@@ -545,7 +545,7 @@ void irda_setup_dma(int channel, char *buffer, int count, int mode)
 	disable_dma(channel);
 	clear_dma_ff(channel);
 	set_dma_mode(channel, mode);
-	set_dma_addr(channel, isa_virt_to_bus(buffer));
+	set_dma_addr(channel, buffer);
 	set_dma_count(channel, count);
 	enable_dma(channel);
 
diff --git a/net/irda/iriap.c b/net/irda/iriap.c
index aaa5b59be..7810c6da2 100644
--- a/net/irda/iriap.c
+++ b/net/irda/iriap.c
@@ -1093,7 +1093,7 @@ struct file_operations irias_seq_fops = {
 	.open           = irias_seq_open,
 	.read           = seq_read,
 	.llseek         = seq_lseek,
-	.release	= seq_release_private,
+	.release	= seq_release,
 };
 
 #endif /* PROC_FS */
diff --git a/net/irda/irlmp.c b/net/irda/irlmp.c
index d16ce9bb8..320940a5c 100644
--- a/net/irda/irlmp.c
+++ b/net/irda/irlmp.c
@@ -1491,7 +1491,7 @@ void *irlmp_register_service(__u16 hints)
 	service = kmalloc(sizeof(irlmp_service_t), GFP_ATOMIC);
 	if (!service) {
 		IRDA_DEBUG(1, "%s(), Unable to kmalloc!\n", __FUNCTION__);
-		return 0;
+		return NULL;
 	}
 	service->hints.word = hints;
 	hashbin_insert(irlmp->services, (irda_queue_t *) service,
@@ -1561,13 +1561,13 @@ void *irlmp_register_client(__u16 hint_mask, DISCOVERY_CALLBACK1 disco_clb,
 	irlmp_client_t *client;
 
 	IRDA_DEBUG(1, "%s()\n", __FUNCTION__);
-	ASSERT(irlmp != NULL, return 0;);
+	ASSERT(irlmp != NULL, return NULL;);
 
 	/* Make a new registration */
 	client = kmalloc(sizeof(irlmp_client_t), GFP_ATOMIC);
 	if (!client) {
 		IRDA_DEBUG( 1, "%s(), Unable to kmalloc!\n", __FUNCTION__);
-		return 0;
+		return NULL;
 	}
 
 	/* Register the details */
diff --git a/net/irda/irsysctl.c b/net/irda/irsysctl.c
index 995f4e15c..cdcb320b5 100644
--- a/net/irda/irsysctl.c
+++ b/net/irda/irsysctl.c
@@ -78,11 +78,11 @@ static int min_lap_keepalive_time = 100;	/* 100us */
  * us on that - Jean II */
 
 static int do_devname(ctl_table *table, int write, struct file *filp,
-		      void __user *buffer, size_t *lenp)
+		      void __user *buffer, size_t *lenp, loff_t *ppos)
 {
 	int ret;
 
-	ret = proc_dostring(table, write, filp, buffer, lenp);
+	ret = proc_dostring(table, write, filp, buffer, lenp, ppos);
 	if (ret == 0 && write) {
 		struct ias_value *val;
 
diff --git a/net/key/af_key.c b/net/key/af_key.c
index 645b42564..fdf75a1ba 100644
--- a/net/key/af_key.c
+++ b/net/key/af_key.c
@@ -1075,6 +1075,15 @@ static struct xfrm_state * pfkey_msg2xfrm_state(struct sadb_msg *hdr,
 		n_type = ext_hdrs[SADB_X_EXT_NAT_T_TYPE-1];
 		natt->encap_type = n_type->sadb_x_nat_t_type_type;
 
+		switch (natt->encap_type) {
+		case UDP_ENCAP_ESPINUDP:
+		case UDP_ENCAP_ESPINUDP_NON_IKE:
+			break;
+		default:
+			err = -ENOPROTOOPT;
+			goto out;
+		}
+
 		if (ext_hdrs[SADB_X_EXT_NAT_T_SPORT-1]) {
 			struct sadb_x_nat_t_port* n_port =
 				ext_hdrs[SADB_X_EXT_NAT_T_SPORT-1];
@@ -1173,10 +1182,10 @@ static int pfkey_getspi(struct sock *sk, struct sk_buff *skb, struct sadb_msg *h
 			min_spi = range->sadb_spirange_min;
 			max_spi = range->sadb_spirange_max;
 		} else {
-			min_spi = htonl(0x100);
-			max_spi = htonl(0x0fffffff);
+			min_spi = 0x100;
+			max_spi = 0x0fffffff;
 		}
-		xfrm_alloc_spi(x, min_spi, max_spi);
+		xfrm_alloc_spi(x, htonl(min_spi), htonl(max_spi));
 		if (x->id.spi)
 			resp_skb = pfkey_xfrm_state2msg(x, 0, 3);
 	}
@@ -2848,7 +2857,7 @@ static struct xfrm_mgr pfkeyv2_mgr =
 static void __exit ipsec_pfkey_exit(void)
 {
 	xfrm_unregister_km(&pfkeyv2_mgr);
-	remove_proc_entry("net/pfkey", 0);
+	remove_proc_entry("net/pfkey", NULL);
 	sock_unregister(PF_KEY);
 }
 
@@ -2856,7 +2865,7 @@ static int __init ipsec_pfkey_init(void)
 {
 	sock_register(&pfkey_family_ops);
 #ifdef CONFIG_PROC_FS
-	create_proc_read_entry("net/pfkey", 0, 0, pfkey_read_proc, NULL);
+	create_proc_read_entry("net/pfkey", 0, NULL, pfkey_read_proc, NULL);
 #endif
 	xfrm_register_km(&pfkeyv2_mgr);
 	return 0;
diff --git a/net/lapb/lapb_iface.c b/net/lapb/lapb_iface.c
index beca11e7a..fe50f633b 100644
--- a/net/lapb/lapb_iface.c
+++ b/net/lapb/lapb_iface.c
@@ -176,7 +176,7 @@ int lapb_unregister(struct net_device *dev)
 	struct lapb_cb *lapb;
 	int rc = LAPB_BADTOKEN;
 
-	write_unlock_bh(&lapb_list_lock);
+	write_lock_bh(&lapb_list_lock);
 	lapb = __lapb_devtostruct(dev);
 	if (!lapb)
 		goto out;
diff --git a/net/netlink/af_netlink.c b/net/netlink/af_netlink.c
index 4c9011348..69a81d08d 100644
--- a/net/netlink/af_netlink.c
+++ b/net/netlink/af_netlink.c
@@ -176,7 +176,7 @@ found:
 	return sk;
 }
 
-extern struct proto_ops netlink_ops;
+static struct proto_ops netlink_ops;
 
 static int netlink_insert(struct sock *sk, u32 pid)
 {
@@ -365,6 +365,7 @@ static int netlink_connect(struct socket *sock, struct sockaddr *addr,
 	struct sockaddr_nl *nladdr=(struct sockaddr_nl*)addr;
 
 	if (addr->sa_family == AF_UNSPEC) {
+		sk->sk_state	= NETLINK_UNCONNECTED;
 		nlk->dst_pid	= 0;
 		nlk->dst_groups = 0;
 		return 0;
@@ -380,11 +381,12 @@ static int netlink_connect(struct socket *sock, struct sockaddr *addr,
 		err = netlink_autobind(sock);
 
 	if (err == 0) {
+		sk->sk_state	= NETLINK_CONNECTED;
 		nlk->dst_pid 	= nladdr->nl_pid;
 		nlk->dst_groups = nladdr->nl_groups;
 	}
 
-	return 0;
+	return err;
 }
 
 static int netlink_getname(struct socket *sock, struct sockaddr *addr, int *addr_len, int peer)
@@ -427,7 +429,9 @@ struct sock *netlink_getsockbypid(struct sock *ssk, u32 pid)
 
 	/* Don't bother queuing skb if kernel socket has no input function */
 	nlk = nlk_sk(sock);
-	if (nlk->pid == 0 && !nlk->data_ready) {
+	if ((nlk->pid == 0 && !nlk->data_ready) ||
+	    (sock->sk_state == NETLINK_CONNECTED &&
+	     nlk->dst_pid != nlk_sk(ssk)->pid)) {
 		sock_put(sock);
 		return ERR_PTR(-ECONNREFUSED);
 	}
@@ -728,14 +732,14 @@ static int netlink_sendmsg(struct kiocb *kiocb, struct socket *sock,
 	   to corresponding kernel module.   --ANK (980802)
 	 */
 
-	err = security_netlink_send(skb);
-	if (err) {
+	err = -EFAULT;
+	if (memcpy_fromiovec(skb_put(skb,len), msg->msg_iov, len)) {
 		kfree_skb(skb);
 		goto out;
 	}
 
-	err = -EFAULT;
-	if (memcpy_fromiovec(skb_put(skb,len), msg->msg_iov, len)) {
+	err = security_netlink_send(sk, skb);
+	if (err) {
 		kfree_skb(skb);
 		goto out;
 	}
diff --git a/net/netrom/af_netrom.c b/net/netrom/af_netrom.c
index fbb97bf37..6774669bb 100644
--- a/net/netrom/af_netrom.c
+++ b/net/netrom/af_netrom.c
@@ -10,6 +10,7 @@
  */
 #include <linux/config.h>
 #include <linux/module.h>
+#include <linux/moduleparam.h>
 #include <linux/errno.h>
 #include <linux/types.h>
 #include <linux/socket.h>
@@ -1451,8 +1452,7 @@ static int __init nr_proto_init(void)
 
 module_init(nr_proto_init);
 
-
-MODULE_PARM(nr_ndevs, "i");
+module_param(nr_ndevs, int, 0);
 MODULE_PARM_DESC(nr_ndevs, "number of NET/ROM devices");
 
 MODULE_AUTHOR("Jonathan Naylor G4KLX <g4klx@g4klx.demon.co.uk>");
diff --git a/net/rose/af_rose.c b/net/rose/af_rose.c
index a5555c328..31c4ab77e 100644
--- a/net/rose/af_rose.c
+++ b/net/rose/af_rose.c
@@ -11,6 +11,7 @@
  */
 #include <linux/config.h>
 #include <linux/module.h>
+#include <linux/moduleparam.h>
 #include <linux/init.h>
 #include <linux/errno.h>
 #include <linux/types.h>
@@ -57,7 +58,7 @@ int sysctl_rose_link_fail_timeout       = ROSE_DEFAULT_FAIL_TIMEOUT;
 int sysctl_rose_maximum_vcs             = ROSE_DEFAULT_MAXVC;
 int sysctl_rose_window_size             = ROSE_DEFAULT_WINDOW_SIZE;
 
-HLIST_HEAD(rose_list);
+static HLIST_HEAD(rose_list);
 spinlock_t rose_list_lock = SPIN_LOCK_UNLOCKED;
 
 static struct proto_ops rose_proto_ops;
@@ -1550,7 +1551,7 @@ fail:
 }
 module_init(rose_proto_init);
 
-MODULE_PARM(rose_ndevs, "i");
+module_param(rose_ndevs, int, 0);
 MODULE_PARM_DESC(rose_ndevs, "number of ROSE devices");
 
 MODULE_AUTHOR("Jonathan Naylor G4KLX <g4klx@g4klx.demon.co.uk>");
diff --git a/net/rose/rose_route.c b/net/rose/rose_route.c
index 0cd8810f2..eb0de0c2d 100644
--- a/net/rose/rose_route.c
+++ b/net/rose/rose_route.c
@@ -206,7 +206,6 @@ static void rose_remove_node(struct rose_node *rose_node)
 {
 	struct rose_node *s;
 
-	spin_lock_bh(&rose_node_list_lock);
 	if ((s = rose_node_list) == rose_node) {
 		rose_node_list = rose_node->next;
 		kfree(rose_node);
diff --git a/net/rxrpc/call.c b/net/rxrpc/call.c
index f95617a59..6c87fcaec 100644
--- a/net/rxrpc/call.c
+++ b/net/rxrpc/call.c
@@ -471,7 +471,7 @@ static inline int __rxrpc_call_gen_normal_ACK(struct rxrpc_call *call,
 					      rxrpc_seq_t seq)
 {
 	struct rxrpc_message *msg;
-	struct iovec diov[3];
+	struct kvec diov[3];
 	unsigned aux[4];
 	int delta, ret;
 
@@ -717,7 +717,7 @@ static int rxrpc_call_generate_ACK(struct rxrpc_call *call,
 	/* send a special ACK if one is required */
 	if (special_ACK) {
 		struct rxrpc_ackpacket ack;
-		struct iovec diov[2];
+		struct kvec diov[2];
 		uint8_t acks[1] = { RXRPC_ACK_TYPE_ACK };
 
 		/* fill out the appropriate form */
@@ -838,7 +838,7 @@ static int __rxrpc_call_abort(struct rxrpc_call *call, int errno)
 {
 	struct rxrpc_connection *conn = call->conn;
 	struct rxrpc_message *msg;
-	struct iovec diov[1];
+	struct kvec diov[1];
 	int ret;
 	u32 _error;
 
@@ -1919,14 +1919,14 @@ int rxrpc_call_read_data(struct rxrpc_call *call,
  */
 int rxrpc_call_write_data(struct rxrpc_call *call,
 			  size_t sioc,
-			  struct iovec siov[],
+			  struct kvec *siov,
 			  u8 rxhdr_flags,
 			  int alloc_flags,
 			  int dup_data,
 			  size_t *size_sent)
 {
 	struct rxrpc_message *msg;
-	struct iovec *sptr;
+	struct kvec *sptr;
 	size_t space, size, chunk, tmp;
 	char *buf;
 	int ret;
diff --git a/net/rxrpc/connection.c b/net/rxrpc/connection.c
index a923806d6..929b82f48 100644
--- a/net/rxrpc/connection.c
+++ b/net/rxrpc/connection.c
@@ -518,7 +518,7 @@ int rxrpc_conn_newmsg(struct rxrpc_connection *conn,
 		      struct rxrpc_call *call,
 		      uint8_t type,
 		      int dcount,
-		      struct iovec diov[],
+		      struct kvec diov[],
 		      int alloc_flags,
 		      struct rxrpc_message **_msg)
 {
@@ -620,7 +620,6 @@ int rxrpc_conn_sendmsg(struct rxrpc_connection *conn,
 		       struct rxrpc_message *msg)
 {
 	struct msghdr msghdr;
-	mm_segment_t oldfs;
 	int ret;
 
 	_enter("%p{%d}", conn, ntohs(conn->addr.sin_port));
@@ -634,8 +633,6 @@ int rxrpc_conn_sendmsg(struct rxrpc_connection *conn,
 	/* set up the message to be transmitted */
 	msghdr.msg_name		= &conn->addr;
 	msghdr.msg_namelen	= sizeof(conn->addr);
-	msghdr.msg_iov		= msg->data;
-	msghdr.msg_iovlen	= msg->dcount;
 	msghdr.msg_control	= NULL;
 	msghdr.msg_controllen	= 0;
 	msghdr.msg_flags	= MSG_CONFIRM | MSG_DONTWAIT;
@@ -647,15 +644,11 @@ int rxrpc_conn_sendmsg(struct rxrpc_connection *conn,
 	     htons(conn->addr.sin_port));
 
 	/* send the message */
-	oldfs = get_fs();
-	set_fs(KERNEL_DS);
-	ret = sock_sendmsg(conn->trans->socket, &msghdr, msg->dsize);
-	set_fs(oldfs);
-
+	ret = kernel_sendmsg(conn->trans->socket, &msghdr,
+			     msg->data, msg->dcount, msg->dsize);
 	if (ret < 0) {
 		msg->state = RXRPC_MSG_ERROR;
-	}
-	else {
+	} else {
 		msg->state = RXRPC_MSG_SENT;
 		ret = 0;
 
diff --git a/net/rxrpc/transport.c b/net/rxrpc/transport.c
index 4454c5938..577001512 100644
--- a/net/rxrpc/transport.c
+++ b/net/rxrpc/transport.c
@@ -611,8 +611,7 @@ int rxrpc_trans_immediate_abort(struct rxrpc_transport *trans,
 	struct rxrpc_header ahdr;
 	struct sockaddr_in sin;
 	struct msghdr msghdr;
-	struct iovec iov[2];
-	mm_segment_t oldfs;
+	struct kvec iov[2];
 	uint32_t _error;
 	int len, ret;
 
@@ -649,8 +648,6 @@ int rxrpc_trans_immediate_abort(struct rxrpc_transport *trans,
 
 	msghdr.msg_name		= &sin;
 	msghdr.msg_namelen	= sizeof(sin);
-	msghdr.msg_iov		= iov;
-	msghdr.msg_iovlen	= 2;
 	msghdr.msg_control	= NULL;
 	msghdr.msg_controllen	= 0;
 	msghdr.msg_flags	= MSG_DONTWAIT;
@@ -662,10 +659,7 @@ int rxrpc_trans_immediate_abort(struct rxrpc_transport *trans,
 	     htons(sin.sin_port));
 
 	/* send the message */
-	oldfs = get_fs();
-	set_fs(KERNEL_DS);
-	ret = sock_sendmsg(trans->socket, &msghdr, len);
-	set_fs(oldfs);
+	ret = kernel_sendmsg(trans->socket, &msghdr, iov, 2, len);
 
 	_leave(" = %d", ret);
 	return ret;
@@ -684,7 +678,6 @@ static void rxrpc_trans_receive_error_report(struct rxrpc_transport *trans)
 	struct list_head connq, *_p;
 	struct errormsg emsg;
 	struct msghdr msg;
-	mm_segment_t oldfs;
 	uint16_t port;
 	int local, err;
 
@@ -696,17 +689,12 @@ static void rxrpc_trans_receive_error_report(struct rxrpc_transport *trans)
 		/* try and receive an error message */
 		msg.msg_name	= &sin;
 		msg.msg_namelen	= sizeof(sin);
-		msg.msg_iov	= NULL;
-		msg.msg_iovlen	= 0;
 		msg.msg_control	= &emsg;
 		msg.msg_controllen = sizeof(emsg);
 		msg.msg_flags	= 0;
 
-		oldfs = get_fs();
-		set_fs(KERNEL_DS);
-		err = sock_recvmsg(trans->socket, &msg, 0,
+		err = kernel_recvmsg(trans->socket, &msg, NULL, 0, 0,
 				   MSG_ERRQUEUE | MSG_DONTWAIT | MSG_TRUNC);
-		set_fs(oldfs);
 
 		if (err == -EAGAIN) {
 			_leave("");
diff --git a/net/sched/Kconfig b/net/sched/Kconfig
index 8931426e0..97a42d9ed 100644
--- a/net/sched/Kconfig
+++ b/net/sched/Kconfig
@@ -1,6 +1,61 @@
 #
 # Traffic control configuration.
 # 
+choice
+	prompt "Packet scheduler clock source"
+	depends on NET_SCHED
+	default NET_SCH_CLK_JIFFIES
+	help
+	  Packet schedulers need a monotonic clock that increments at a static
+	  rate. The kernel provides several suitable interfaces, each with
+	  different properties:
+	  
+	  - high resolution (us or better)
+	  - fast to read (minimal locking, no i/o access)
+	  - synchronized on all processors
+	  - handles cpu clock frequency changes
+
+	  but nothing provides all of the above.
+
+config NET_SCH_CLK_JIFFIES
+	bool "Timer interrupt"
+	help
+	  Say Y here if you want to use the timer interrupt (jiffies) as clock
+	  source. This clock source is fast, synchronized on all processors and
+	  handles cpu clock frequency changes, but its resolution is too low
+	  for accurate shaping except at very low speed.
+
+config NET_SCH_CLK_GETTIMEOFDAY
+	bool "gettimeofday"
+	help
+	  Say Y here if you want to use gettimeofday as clock source. This clock
+	  source has high resolution, is synchronized on all processors and
+	  handles cpu clock frequency changes, but it is slow.
+
+	  Choose this if you need a high resolution clock source but can't use
+	  the CPU's cycle counter.
+
+config NET_SCH_CLK_CPU
+	bool "CPU cycle counter"
+	depends on X86_TSC || X86_64 || ALPHA || SPARC64 || PPC64 || IA64
+	help
+	  Say Y here if you want to use the CPU's cycle counter as clock source.
+	  This is a cheap and high resolution clock source, but on some
+	  architectures it is not synchronized on all processors and doesn't
+	  handle cpu clock frequency changes.
+
+	  The useable cycle counters are:
+
+	  	x86/x86_64	- Timestamp Counter
+		alpha		- Cycle Counter
+		sparc64		- %ticks register
+		ppc64		- Time base
+		ia64		- Interval Time Counter
+
+	  Choose this if your CPU's cycle counter is working properly.
+
+endchoice
+
 config NET_SCH_CBQ
 	tristate "CBQ packet scheduler"
 	depends on NET_SCHED
@@ -49,21 +104,6 @@ config NET_SCH_HFSC
 	  To compile this code as a module, choose M here: the
 	  module will be called sch_hfsc.
 
-config NET_SCH_CSZ
-	tristate "CSZ packet scheduler"
-	depends on NET_SCHED
-	---help---
-	  Say Y here if you want to use the Clark-Shenker-Zhang (CSZ) packet
-	  scheduling algorithm for some of your network devices.  At the
-	  moment, this is the only algorithm that can guarantee service for
-	  real-time applications (see the top of <file:net/sched/sch_csz.c>
-	  for details and references about the algorithm).
-
-	  Note: this scheduler is currently broken.
-
-	  To compile this code as a module, choose M here: the
-	  module will be called sch_csz.
-
 #tristate '  H-PFQ packet scheduler' CONFIG_NET_SCH_HPFQ
 config NET_SCH_ATM
 	tristate "ATM pseudo-scheduler"
@@ -164,20 +204,22 @@ config NET_SCH_DSMARK
 	  To compile this code as a module, choose M here: the
 	  module will be called sch_dsmark.
 
-config NET_SCH_DELAY
-	tristate "Delay simulator"
+config NET_SCH_NETEM
+	tristate "Network emulator"
 	depends on NET_SCHED
 	help
-	  Say Y if you want to delay packets by a fixed amount of
-	  time. This is often useful to simulate network delay when
+	  Say Y if you want to emulate network delay, loss, and packet
+	  re-ordering. This is often useful to simulate networks when
 	  testing applications or protocols.
 
 	  To compile this driver as a module, choose M here: the module
-	  will be called sch_delay.
+	  will be called sch_netem.
+
+	  If unsure, say N.
 
 config NET_SCH_INGRESS
 	tristate "Ingress Qdisc"
-	depends on NET_SCHED && NETFILTER
+	depends on NET_SCHED 
 	help
 	  If you say Y here, you will be able to police incoming bandwidth
 	  and drop packets when this bandwidth exceeds your desired rate.
@@ -242,6 +284,7 @@ config NET_CLS_TCINDEX
 config NET_CLS_ROUTE4
 	tristate "Routing table based classifier"
 	depends on NET_CLS
+	select NET_CLS_ROUTE
 	help
 	  If you say Y here, you will be able to classify outgoing packets
 	  according to the route table entry they matched. If unsure, say Y.
@@ -251,8 +294,7 @@ config NET_CLS_ROUTE4
 
 config NET_CLS_ROUTE
 	bool
-	depends on NET_CLS_ROUTE4
-	default y
+	default n
 
 config NET_CLS_FW
 	tristate "Firewall based classifier"
@@ -274,6 +316,24 @@ config NET_CLS_U32
 	  To compile this code as a module, choose M here: the
 	  module will be called cls_u32.
 
+config CLS_U32_PERF
+	bool "     U32 classifier performance counters"
+	depends on NET_CLS_U32
+	help
+	  gathers stats that could be used to tune u32 classifier performance.
+	  Requires a new iproute2
+	  You MUST NOT turn this on if you dont have an update iproute2.
+
+config NET_CLS_IND
+	bool "classify input device (slows things u32/fw) "
+	depends on NET_CLS_U32 || NET_CLS_FW
+	help
+	  This option will be killed eventually when a 
+          metadata action appears because it slows things a little
+          Available only for u32 and fw classifiers.
+	  Requires a new iproute2
+	  You MUST NOT turn this on if you dont have an update iproute2.
+
 config NET_CLS_RSVP
 	tristate "Special RSVP classifier"
 	depends on NET_CLS && NET_QOS
@@ -303,9 +363,26 @@ config NET_CLS_RSVP6
 	  To compile this code as a module, choose M here: the
 	  module will be called cls_rsvp6.
 
+config NET_CLS_ACT
+	bool '  Packet ACTION ' 
+	depends on EXPERIMENTAL && NET_CLS && NET_QOS
+	---help---
+	This option requires you have a new iproute2. It enables
+	tc extensions which can be used with tc classifiers.
+	Only the u32 and fw classifiers are supported at the moment.
+	  You MUST NOT turn this on if you dont have an update iproute2.
+
+config NET_ACT_POLICE
+	tristate '      Policing Actions' 
+        depends on NET_CLS_ACT 
+        ---help---
+        If you are using a newer iproute2 select this one, otherwise use one
+	below to select a policer.
+	  You MUST NOT turn this on if you dont have an update iproute2.
+
 config NET_CLS_POLICE
 	bool "Traffic policing (needed for in/egress)"
-	depends on NET_CLS && NET_QOS
+	depends on NET_CLS && NET_QOS && NET_ACT_POLICE!=y && NET_ACT_POLICE!=m
 	help
 	  Say Y to support traffic policing (bandwidth limits).  Needed for
 	  ingress and egress rate limiting.
diff --git a/net/sched/Makefile b/net/sched/Makefile
index af4a4f284..daa437f85 100644
--- a/net/sched/Makefile
+++ b/net/sched/Makefile
@@ -7,10 +7,11 @@ obj-y	:= sch_generic.o
 obj-$(CONFIG_NET_SCHED)		+= sch_api.o sch_fifo.o
 obj-$(CONFIG_NET_ESTIMATOR)	+= estimator.o
 obj-$(CONFIG_NET_CLS)		+= cls_api.o
-obj-$(CONFIG_NET_CLS_POLICE)	+= police.o
+obj-$(CONFIG_NET_CLS_ACT)       += act_api.o
+obj-$(CONFIG_NET_ACT_POLICE)    += police.o
+obj-$(CONFIG_NET_CLS_POLICE)    += police.o
 obj-$(CONFIG_NET_SCH_CBQ)	+= sch_cbq.o
 obj-$(CONFIG_NET_SCH_HTB)	+= sch_htb.o
-obj-$(CONFIG_NET_SCH_CSZ)	+= sch_csz.o
 obj-$(CONFIG_NET_SCH_HPFQ)	+= sch_hpfq.o
 obj-$(CONFIG_NET_SCH_HFSC)	+= sch_hfsc.o
 obj-$(CONFIG_NET_SCH_RED)	+= sch_red.o
@@ -22,7 +23,7 @@ obj-$(CONFIG_NET_SCH_TBF)	+= sch_tbf.o
 obj-$(CONFIG_NET_SCH_TEQL)	+= sch_teql.o
 obj-$(CONFIG_NET_SCH_PRIO)	+= sch_prio.o
 obj-$(CONFIG_NET_SCH_ATM)	+= sch_atm.o
-obj-$(CONFIG_NET_SCH_DELAY)	+= sch_delay.o
+obj-$(CONFIG_NET_SCH_NETEM)	+= sch_netem.o
 obj-$(CONFIG_NET_CLS_U32)	+= cls_u32.o
 obj-$(CONFIG_NET_CLS_ROUTE4)	+= cls_route.o
 obj-$(CONFIG_NET_CLS_FW)	+= cls_fw.o
diff --git a/net/sched/cls_api.c b/net/sched/cls_api.c
index a48b75d54..e76951381 100644
--- a/net/sched/cls_api.c
+++ b/net/sched/cls_api.c
@@ -11,6 +11,7 @@
  * Changes:
  *
  * Eduardo J. Blanco <ejbs@netlabs.com.uy> :990222: kmod support
+ *
  */
 
 #include <asm/uaccess.h>
@@ -36,6 +37,12 @@
 #include <net/sock.h>
 #include <net/pkt_sched.h>
 
+#if 0 /* control */
+#define DPRINTK(format,args...) printk(KERN_DEBUG format,##args)
+#else
+#define DPRINTK(format,args...)
+#endif
+
 /* The list of all installed classifier types */
 
 static struct tcf_proto_ops *tcf_proto_base;
@@ -132,7 +139,7 @@ static int tc_ctl_tfilter(struct sk_buff *skb, struct nlmsghdr *n, void *arg)
 	struct tcf_proto_ops *tp_ops;
 	struct Qdisc_class_ops *cops;
 	unsigned long cl = 0;
-	unsigned long fh;
+	unsigned long fh, fh_s;
 	int err;
 
 	if (prio == 0) {
@@ -229,24 +236,24 @@ static int tc_ctl_tfilter(struct sk_buff *skb, struct nlmsghdr *n, void *arg)
 			kfree(tp);
 			goto errout;
 		}
-		write_lock(&qdisc_tree_lock);
-		spin_lock_bh(&dev->queue_lock);
+
+		qdisc_lock_tree(dev);
 		tp->next = *back;
 		*back = tp;
-		spin_unlock_bh(&dev->queue_lock);
-		write_unlock(&qdisc_tree_lock);
+		qdisc_unlock_tree(dev);
+
 	} else if (tca[TCA_KIND-1] && rtattr_strcmp(tca[TCA_KIND-1], tp->ops->kind))
 		goto errout;
 
-	fh = tp->ops->get(tp, t->tcm_handle);
+	fh_s = fh = tp->ops->get(tp, t->tcm_handle);
 
 	if (fh == 0) {
 		if (n->nlmsg_type == RTM_DELTFILTER && t->tcm_handle == 0) {
-			write_lock(&qdisc_tree_lock);
-			spin_lock_bh(&dev->queue_lock);
+			qdisc_lock_tree(dev);
 			*back = tp->next;
-			spin_unlock_bh(&dev->queue_lock);
-			write_unlock(&qdisc_tree_lock);
+			qdisc_unlock_tree(dev);
+
+			tfilter_notify(skb, n, tp, fh_s, RTM_DELTFILTER);
 			tcf_destroy(tp);
 			err = 0;
 			goto errout;
@@ -264,6 +271,8 @@ static int tc_ctl_tfilter(struct sk_buff *skb, struct nlmsghdr *n, void *arg)
 			break;
 		case RTM_DELTFILTER:
 			err = tp->ops->delete(tp, fh);
+			if (err == 0)
+				tfilter_notify(skb, n, tp, fh_s, RTM_DELTFILTER);
 			goto errout;
 		case RTM_GETTFILTER:
 			err = tfilter_notify(skb, n, tp, fh, RTM_NEWTFILTER);
@@ -284,6 +293,19 @@ errout:
 	return err;
 }
 
+unsigned long tcf_set_class(struct tcf_proto *tp, unsigned long *clp, 
+			    unsigned long cl)
+{
+	unsigned long old_cl;
+
+	tcf_tree_lock(tp);
+	old_cl = __cls_set_class(clp, cl);
+	tcf_tree_unlock(tp);
+
+	return old_cl;
+}
+
+
 static int
 tcf_fill_node(struct sk_buff *skb, struct tcf_proto *tp, unsigned long fh,
 	      u32 pid, u32 seq, unsigned flags, int event)
@@ -298,11 +320,14 @@ tcf_fill_node(struct sk_buff *skb, struct tcf_proto *tp, unsigned long fh,
 	tcm->tcm_family = AF_UNSPEC;
 	tcm->tcm_ifindex = tp->q->dev->ifindex;
 	tcm->tcm_parent = tp->classid;
-	tcm->tcm_handle = 0;
 	tcm->tcm_info = TC_H_MAKE(tp->prio, tp->protocol);
 	RTA_PUT(skb, TCA_KIND, IFNAMSIZ, tp->ops->kind);
-	if (tp->ops->dump && tp->ops->dump(tp, fh, skb, tcm) < 0)
-		goto rtattr_failure;
+	tcm->tcm_handle = fh;
+	if (RTM_DELTFILTER != event) {
+		tcm->tcm_handle = 0;
+		if (tp->ops->dump && tp->ops->dump(tp, fh, skb, tcm) < 0)
+			goto rtattr_failure;
+	}
 	nlh->nlmsg_len = skb->tail - b;
 	return skb->len;
 
@@ -362,7 +387,7 @@ static int tc_dump_tfilter(struct sk_buff *skb, struct netlink_callback *cb)
 	if ((dev = dev_get_by_index(tcm->tcm_ifindex)) == NULL)
 		return skb->len;
 
-	read_lock(&qdisc_tree_lock);
+	read_lock_bh(&qdisc_tree_lock);
 	if (!tcm->tcm_parent)
 		q = dev->qdisc_sleeping;
 	else
@@ -419,7 +444,7 @@ errout:
 	if (cl)
 		cops->put(q, cl);
 out:
-	read_unlock(&qdisc_tree_lock);
+	read_unlock_bh(&qdisc_tree_lock);
 	dev_put(dev);
 	return skb->len;
 }
@@ -446,3 +471,4 @@ subsys_initcall(tc_filter_init);
 
 EXPORT_SYMBOL(register_tcf_proto_ops);
 EXPORT_SYMBOL(unregister_tcf_proto_ops);
+EXPORT_SYMBOL(tcf_set_class);
diff --git a/net/sched/cls_fw.c b/net/sched/cls_fw.c
index 5b614b63a..7ce360d31 100644
--- a/net/sched/cls_fw.c
+++ b/net/sched/cls_fw.c
@@ -11,6 +11,11 @@
  * Changes:
  * Karlis Peisenieks <karlis@mt.lv> : 990415 : fw_walk off by one
  * Karlis Peisenieks <karlis@mt.lv> : 990415 : fw_delete killed all the filter (and kernel).
+ * Alex <alex@pilotsoft.com> : 2004xxyy: Added Action extension
+ *
+ * JHS: We should remove the CONFIG_NET_CLS_IND from here
+ * eventually when the meta match extension is made available
+ *
  */
 
 #include <linux/config.h>
@@ -50,9 +55,16 @@ struct fw_filter
 	struct fw_filter	*next;
 	u32			id;
 	struct tcf_result	res;
+#ifdef CONFIG_NET_CLS_ACT
+       struct tc_action        *action;
+#ifdef CONFIG_NET_CLS_IND
+       char			indev[IFNAMSIZ];
+#endif
+#else
 #ifdef CONFIG_NET_CLS_POLICE
 	struct tcf_police	*police;
 #endif
+#endif
 };
 
 static __inline__ int fw_hash(u32 handle)
@@ -77,9 +89,28 @@ static int fw_classify(struct sk_buff *skb, struct tcf_proto *tp,
 	for (f=head->ht[fw_hash(id)]; f; f=f->next) {
 		if (f->id == id) {
 			*res = f->res;
+#ifdef CONFIG_NET_CLS_ACT
+#ifdef CONFIG_NET_CLS_IND
+			if (0 != f->indev[0]) {
+				if  (NULL == skb->input_dev) {
+					continue;
+				} else {
+					if (0 != strcmp(f->indev, skb->input_dev->name)) {
+						continue;
+					}
+				}
+			}
+#endif
+                               if (f->action) {
+                                       int pol_res = tcf_action_exec(skb, f->action);
+                                       if (pol_res >= 0)
+                                               return pol_res;
+                               } else
+#else
 #ifdef CONFIG_NET_CLS_POLICE
 			if (f->police)
 				return tcf_police(skb, f->police);
+#endif
 #endif
 			return 0;
 		}
@@ -136,9 +167,16 @@ static void fw_destroy(struct tcf_proto *tp)
 
 			if ((cl = __cls_set_class(&f->res.class, 0)) != 0)
 				tp->q->ops->cl_ops->unbind_tcf(tp->q, cl);
+#ifdef CONFIG_NET_CLS_ACT
+       if (f->action) {
+               tcf_action_destroy(f->action,TCA_ACT_UNBIND);
+       }
+#else
 #ifdef CONFIG_NET_CLS_POLICE
-			tcf_police_release(f->police);
+			tcf_police_release(f->police,TCA_ACT_UNBIND);
+#endif
 #endif
+
 			kfree(f);
 		}
 	}
@@ -164,8 +202,14 @@ static int fw_delete(struct tcf_proto *tp, unsigned long arg)
 
 			if ((cl = cls_set_class(tp, &f->res.class, 0)) != 0)
 				tp->q->ops->cl_ops->unbind_tcf(tp->q, cl);
+#ifdef CONFIG_NET_CLS_ACT
+       if (f->action) {
+               tcf_action_destroy(f->action,TCA_ACT_UNBIND);
+       }
+#else
 #ifdef CONFIG_NET_CLS_POLICE
-			tcf_police_release(f->police);
+			tcf_police_release(f->police,TCA_ACT_UNBIND);
+#endif
 #endif
 			kfree(f);
 			return 0;
@@ -185,6 +229,11 @@ static int fw_change(struct tcf_proto *tp, unsigned long base,
 	struct rtattr *opt = tca[TCA_OPTIONS-1];
 	struct rtattr *tb[TCA_FW_MAX];
 	int err;
+#ifdef CONFIG_NET_CLS_ACT
+       struct tc_action *act = NULL;
+       int ret;
+#endif
+
 
 	if (!opt)
 		return handle ? -EINVAL : 0;
@@ -206,6 +255,58 @@ static int fw_change(struct tcf_proto *tp, unsigned long base,
 			if (cl)
 				tp->q->ops->cl_ops->unbind_tcf(tp->q, cl);
 		}
+#ifdef CONFIG_NET_CLS_ACT
+		if (tb[TCA_FW_POLICE-1]) {
+			act = kmalloc(sizeof(*act),GFP_KERNEL);
+			if (NULL == act)
+				return -ENOMEM;
+
+			memset(act,0,sizeof(*act));
+			ret = tcf_action_init_1(tb[TCA_FW_POLICE-1], tca[TCA_RATE-1] ,act,"police",TCA_ACT_NOREPLACE,TCA_ACT_BIND);
+			if (0 > ret){
+				tcf_action_destroy(act,TCA_ACT_UNBIND);
+				return ret;
+			}
+			act->type = TCA_OLD_COMPAT;
+
+			sch_tree_lock(tp->q);
+			act = xchg(&f->action, act);
+			sch_tree_unlock(tp->q);
+
+			tcf_action_destroy(act,TCA_ACT_UNBIND);
+
+		}
+
+		if(tb[TCA_FW_ACT-1]) {
+			act = kmalloc(sizeof(*act),GFP_KERNEL);
+			if (NULL == act)
+				return -ENOMEM;
+			memset(act,0,sizeof(*act));
+			ret = tcf_action_init(tb[TCA_FW_ACT-1], tca[TCA_RATE-1],act,NULL, TCA_ACT_NOREPLACE,TCA_ACT_BIND);
+			if (0 > ret) {
+				tcf_action_destroy(act,TCA_ACT_UNBIND);
+				return ret;
+			}
+
+			sch_tree_lock(tp->q);
+			act = xchg(&f->action, act);
+			sch_tree_unlock(tp->q);
+
+			tcf_action_destroy(act,TCA_ACT_UNBIND);
+		}
+#ifdef CONFIG_NET_CLS_IND
+		if(tb[TCA_FW_INDEV-1]) {
+			struct rtattr *idev = tb[TCA_FW_INDEV-1];
+			if (RTA_PAYLOAD(idev) >= IFNAMSIZ) {
+				printk("cls_fw: bad indev name %s\n",(char*)RTA_DATA(idev));
+				err = -EINVAL;
+				goto errout;
+			}
+			memset(f->indev,0,IFNAMSIZ);
+			sprintf(f->indev, "%s", (char*)RTA_DATA(idev));
+		}
+#endif
+#else /* only POLICE defined */
 #ifdef CONFIG_NET_CLS_POLICE
 		if (tb[TCA_FW_POLICE-1]) {
 			struct tcf_police *police = tcf_police_locate(tb[TCA_FW_POLICE-1], tca[TCA_RATE-1]);
@@ -214,8 +315,9 @@ static int fw_change(struct tcf_proto *tp, unsigned long base,
 			police = xchg(&f->police, police);
 			tcf_tree_unlock(tp);
 
-			tcf_police_release(police);
+			tcf_police_release(police,TCA_ACT_UNBIND);
 		}
+#endif
 #endif
 		return 0;
 	}
@@ -249,9 +351,36 @@ static int fw_change(struct tcf_proto *tp, unsigned long base,
 		cls_set_class(tp, &f->res.class, tp->q->ops->cl_ops->bind_tcf(tp->q, base, f->res.classid));
 	}
 
+#ifdef CONFIG_NET_CLS_ACT
+	if(tb[TCA_FW_ACT-1]) {
+		act = kmalloc(sizeof(*act),GFP_KERNEL);
+		if (NULL == act)
+			return -ENOMEM;
+		memset(act,0,sizeof(*act));
+		ret = tcf_action_init(tb[TCA_FW_ACT-1], tca[TCA_RATE-1],act,NULL,TCA_ACT_NOREPLACE,TCA_ACT_BIND);
+		if (0 > ret) {
+			tcf_action_destroy(act,TCA_ACT_UNBIND);
+			return ret;
+		}
+		f->action= act;
+	}
+#ifdef CONFIG_NET_CLS_IND
+		if(tb[TCA_FW_INDEV-1]) {
+			struct rtattr *idev = tb[TCA_FW_INDEV-1];
+			if (RTA_PAYLOAD(idev) >= IFNAMSIZ) {
+				printk("cls_fw: bad indev name %s\n",(char*)RTA_DATA(idev));
+				err = -EINVAL;
+				goto errout;
+			}
+			memset(f->indev,0,IFNAMSIZ);
+			sprintf(f->indev, "%s", (char*)RTA_DATA(idev));
+		}
+#endif
+#else
 #ifdef CONFIG_NET_CLS_POLICE
 	if (tb[TCA_FW_POLICE-1])
 		f->police = tcf_police_locate(tb[TCA_FW_POLICE-1], tca[TCA_RATE-1]);
+#endif
 #endif
 
 	f->next = head->ht[fw_hash(handle)];
@@ -309,8 +438,12 @@ static int fw_dump(struct tcf_proto *tp, unsigned long fh,
 	t->tcm_handle = f->id;
 
        if (!f->res.classid
+#ifdef CONFIG_NET_CLS_ACT
+           && !f->action
+#else
 #ifdef CONFIG_NET_CLS_POLICE
            && !f->police
+#endif
 #endif
            )
 		return skb->len;
@@ -320,6 +453,36 @@ static int fw_dump(struct tcf_proto *tp, unsigned long fh,
 
 	if (f->res.classid)
 		RTA_PUT(skb, TCA_FW_CLASSID, 4, &f->res.classid);
+#ifdef CONFIG_NET_CLS_ACT
+               /* again for backward compatible mode - we want
+               *  to work with both old and new modes of entering
+               *  tc data even if iproute2  was newer - jhs
+               */
+	if (f->action) {
+		struct rtattr * p_rta = (struct rtattr*)skb->tail;
+
+		if (f->action->type != TCA_OLD_COMPAT) {
+			RTA_PUT(skb, TCA_FW_ACT, 0, NULL);
+			if (tcf_action_dump(skb,f->action,0,0) < 0) {
+				goto rtattr_failure;
+			}
+		} else {
+			RTA_PUT(skb, TCA_FW_POLICE, 0, NULL);
+			if (tcf_action_dump_old(skb,f->action,0,0) < 0) {
+				goto rtattr_failure;
+			}
+		}
+
+		p_rta->rta_len = skb->tail - (u8*)p_rta;
+	}
+#ifdef CONFIG_NET_CLS_IND
+	if(strlen(f->indev)) {
+		struct rtattr * p_rta = (struct rtattr*)skb->tail;
+		RTA_PUT(skb, TCA_FW_INDEV, IFNAMSIZ, f->indev);
+		p_rta->rta_len = skb->tail - (u8*)p_rta;
+	}
+#endif
+#else
 #ifdef CONFIG_NET_CLS_POLICE
 	if (f->police) {
 		struct rtattr * p_rta = (struct rtattr*)skb->tail;
@@ -331,14 +494,23 @@ static int fw_dump(struct tcf_proto *tp, unsigned long fh,
 
 		p_rta->rta_len = skb->tail - (u8*)p_rta;
 	}
+#endif
 #endif
 
 	rta->rta_len = skb->tail - b;
+#ifdef CONFIG_NET_CLS_ACT
+       if (f->action && f->action->type == TCA_OLD_COMPAT) {
+               if (tcf_action_copy_stats(skb,f->action))
+                       goto rtattr_failure;
+       }
+#else
 #ifdef CONFIG_NET_CLS_POLICE
 	if (f->police) {
-		if (qdisc_copy_stats(skb, &f->police->stats))
+		if (qdisc_copy_stats(skb, &f->police->stats,
+				     f->police->stats_lock))
 			goto rtattr_failure;
 	}
+#endif
 #endif
 	return skb->len;
 
diff --git a/net/sched/cls_route.c b/net/sched/cls_route.c
index 4c09012ed..c2165492a 100644
--- a/net/sched/cls_route.c
+++ b/net/sched/cls_route.c
@@ -297,7 +297,7 @@ static void route4_destroy(struct tcf_proto *tp)
 					if ((cl = __cls_set_class(&f->res.class, 0)) != 0)
 						tp->q->ops->cl_ops->unbind_tcf(tp->q, cl);
 #ifdef CONFIG_NET_CLS_POLICE
-					tcf_police_release(f->police);
+					tcf_police_release(f->police,TCA_ACT_UNBIND);
 #endif
 					kfree(f);
 				}
@@ -336,7 +336,7 @@ static int route4_delete(struct tcf_proto *tp, unsigned long arg)
 				tp->q->ops->cl_ops->unbind_tcf(tp->q, cl);
 
 #ifdef CONFIG_NET_CLS_POLICE
-			tcf_police_release(f->police);
+			tcf_police_release(f->police,TCA_ACT_UNBIND);
 #endif
 			kfree(f);
 
@@ -398,7 +398,7 @@ static int route4_change(struct tcf_proto *tp, unsigned long base,
 			police = xchg(&f->police, police);
 			tcf_tree_unlock(tp);
 
-			tcf_police_release(police);
+			tcf_police_release(police,TCA_ACT_UNBIND);
 		}
 #endif
 		return 0;
@@ -591,7 +591,8 @@ static int route4_dump(struct tcf_proto *tp, unsigned long fh,
 	rta->rta_len = skb->tail - b;
 #ifdef CONFIG_NET_CLS_POLICE
 	if (f->police) {
-		if (qdisc_copy_stats(skb, &f->police->stats))
+		if (qdisc_copy_stats(skb, &f->police->stats,
+				     f->police->stats_lock))
 			goto rtattr_failure;
 	}
 #endif
diff --git a/net/sched/cls_rsvp.h b/net/sched/cls_rsvp.h
index 85e028d84..f70fad175 100644
--- a/net/sched/cls_rsvp.h
+++ b/net/sched/cls_rsvp.h
@@ -278,7 +278,7 @@ static void rsvp_destroy(struct tcf_proto *tp)
 					if ((cl = __cls_set_class(&f->res.class, 0)) != 0)
 						tp->q->ops->cl_ops->unbind_tcf(tp->q, cl);
 #ifdef CONFIG_NET_CLS_POLICE
-					tcf_police_release(f->police);
+					tcf_police_release(f->police,TCA_ACT_UNBIND);
 #endif
 					kfree(f);
 				}
@@ -310,7 +310,7 @@ static int rsvp_delete(struct tcf_proto *tp, unsigned long arg)
 				tp->q->ops->cl_ops->unbind_tcf(tp->q, cl);
 
 #ifdef CONFIG_NET_CLS_POLICE
-			tcf_police_release(f->police);
+			tcf_police_release(f->police,TCA_ACT_UNBIND);
 #endif
 
 			kfree(f);
@@ -452,7 +452,7 @@ static int rsvp_change(struct tcf_proto *tp, unsigned long base,
 			police = xchg(&f->police, police);
 			tcf_tree_unlock(tp);
 
-			tcf_police_release(police);
+			tcf_police_release(police,TCA_ACT_UNBIND);
 		}
 #endif
 		return 0;
@@ -656,7 +656,8 @@ static int rsvp_dump(struct tcf_proto *tp, unsigned long fh,
 	rta->rta_len = skb->tail - b;
 #ifdef CONFIG_NET_CLS_POLICE
 	if (f->police) {
-		if (qdisc_copy_stats(skb, &f->police->stats))
+		if (qdisc_copy_stats(skb, &f->police->stats,
+				     f->police->stats_lock))
 			goto rtattr_failure;
 	}
 #endif
diff --git a/net/sched/cls_tcindex.c b/net/sched/cls_tcindex.c
index adbc77dd2..c696fcf8f 100644
--- a/net/sched/cls_tcindex.c
+++ b/net/sched/cls_tcindex.c
@@ -190,7 +190,7 @@ found:
 	if (cl)
 		tp->q->ops->cl_ops->unbind_tcf(tp->q,cl);
 #ifdef CONFIG_NET_CLS_POLICE
-	tcf_police_release(r->police);
+	tcf_police_release(r->police, TCA_ACT_UNBIND);
 #endif
 	if (f)
 		kfree(f);
@@ -333,7 +333,7 @@ static int tcindex_change(struct tcf_proto *tp,unsigned long base,u32 handle,
 		tcf_tree_lock(tp);
 		police = xchg(&r->police,police);
 		tcf_tree_unlock(tp);
-		tcf_police_release(police);
+		tcf_police_release(police,TCA_ACT_UNBIND);
 	}
 #endif
 	if (r != &new_filter_result)
diff --git a/net/sched/cls_u32.c b/net/sched/cls_u32.c
index 938d88744..30d26d4fe 100644
--- a/net/sched/cls_u32.c
+++ b/net/sched/cls_u32.c
@@ -23,6 +23,10 @@
  *	It is especially useful for link sharing combined with QoS;
  *	pure RSVP doesn't need such a general approach and can use
  *	much simpler (and faster) schemes, sort of cls_rsvp.c.
+ *
+ *	JHS: We should remove the CONFIG_NET_CLS_IND from here
+ *	eventually when the meta match extension is made available
+ *
  */
 
 #include <asm/uaccess.h>
@@ -58,11 +62,22 @@ struct tc_u_knode
 	struct tc_u_knode	*next;
 	u32			handle;
 	struct tc_u_hnode	*ht_up;
+#ifdef CONFIG_NET_CLS_ACT
+	struct tc_action	*action;
+#else
 #ifdef CONFIG_NET_CLS_POLICE
 	struct tcf_police	*police;
 #endif
+#endif
+#ifdef CONFIG_NET_CLS_IND
+	char                     indev[IFNAMSIZ];
+#endif
+	u8			fshift;
 	struct tcf_result	res;
 	struct tc_u_hnode	*ht_down;
+#ifdef CONFIG_CLS_U32_PERF
+	struct tc_u32_pcnt	*pf;
+#endif
 	struct tc_u32_sel	sel;
 };
 
@@ -88,12 +103,10 @@ struct tc_u_common
 
 static struct tc_u_common *u32_list;
 
-static __inline__ unsigned u32_hash_fold(u32 key, struct tc_u32_sel *sel)
+static __inline__ unsigned u32_hash_fold(u32 key, struct tc_u32_sel *sel, u8 fshift)
 {
-	unsigned h = key & sel->hmask;
+	unsigned h = (key & sel->hmask)>>fshift;
 
-	h ^= h>>16;
-	h ^= h>>8;
 	return h;
 }
 
@@ -110,6 +123,9 @@ static int u32_classify(struct sk_buff *skb, struct tcf_proto *tp, struct tcf_re
 	int sdepth = 0;
 	int off2 = 0;
 	int sel = 0;
+#ifdef CONFIG_CLS_U32_PERF
+	int j;
+#endif
 	int i;
 
 next_ht:
@@ -119,22 +135,63 @@ next_knode:
 	if (n) {
 		struct tc_u32_key *key = n->sel.keys;
 
+#ifdef CONFIG_CLS_U32_PERF
+		n->pf->rcnt +=1;
+		j = 0;
+#endif
 		for (i = n->sel.nkeys; i>0; i--, key++) {
+
 			if ((*(u32*)(ptr+key->off+(off2&key->offmask))^key->val)&key->mask) {
 				n = n->next;
 				goto next_knode;
 			}
+#ifdef CONFIG_CLS_U32_PERF
+			n->pf->kcnts[j] +=1;
+			j++;
+#endif
 		}
 		if (n->ht_down == NULL) {
 check_terminal:
 			if (n->sel.flags&TC_U32_TERMINAL) {
+
 				*res = n->res;
+#ifdef CONFIG_NET_CLS_IND
+				/* yes, i know it sucks but the feature is 
+				** optional dammit! - JHS */
+				if (0 != n->indev[0]) {
+					if  (NULL == skb->input_dev) {
+						n = n->next;
+						goto next_knode;
+					} else {
+						if (0 != strcmp(n->indev, skb->input_dev->name)) {
+							n = n->next;
+							goto next_knode;
+						}
+					}
+				}
+#endif
+#ifdef CONFIG_CLS_U32_PERF
+				n->pf->rhit +=1;
+#endif
+#ifdef CONFIG_NET_CLS_ACT
+				if (n->action) {
+					int pol_res = tcf_action_exec(skb, n->action);
+					if (skb->tc_classid > 0) {
+						res->classid = skb->tc_classid;
+						skb->tc_classid = 0;
+					}
+
+					if (pol_res >= 0)
+						return pol_res;
+				} else
+#else
 #ifdef CONFIG_NET_CLS_POLICE
 				if (n->police) {
 					int pol_res = tcf_police(skb, n->police);
 					if (pol_res >= 0)
 						return pol_res;
 				} else
+#endif
 #endif
 					return 0;
 			}
@@ -152,7 +209,7 @@ check_terminal:
 		ht = n->ht_down;
 		sel = 0;
 		if (ht->divisor)
-			sel = ht->divisor&u32_hash_fold(*(u32*)(ptr+n->sel.hoff), &n->sel);
+			sel = ht->divisor&u32_hash_fold(*(u32*)(ptr+n->sel.hoff), &n->sel,n->fshift);
 
 		if (!(n->sel.flags&(TC_U32_VAROFFSET|TC_U32_OFFSET|TC_U32_EAT)))
 			goto next_ht;
@@ -298,11 +355,21 @@ static int u32_destroy_key(struct tcf_proto *tp, struct tc_u_knode *n)
 
 	if ((cl = __cls_set_class(&n->res.class, 0)) != 0)
 		tp->q->ops->cl_ops->unbind_tcf(tp->q, cl);
+#ifdef CONFIG_NET_CLS_ACT
+	if (n->action) {
+		tcf_action_destroy(n->action, TCA_ACT_UNBIND);
+	}
+#else
 #ifdef CONFIG_NET_CLS_POLICE
-	tcf_police_release(n->police);
+	tcf_police_release(n->police, TCA_ACT_UNBIND);
+#endif
 #endif
 	if (n->ht_down)
 		n->ht_down->refcnt--;
+#ifdef CONFIG_CLS_U32_PERF
+	if (n && (NULL != n->pf))
+		kfree(n->pf);
+#endif
 	kfree(n);
 	return 0;
 }
@@ -438,6 +505,10 @@ static int u32_set_parms(struct Qdisc *q, unsigned long base,
 			 struct tc_u_knode *n, struct rtattr **tb,
 			 struct rtattr *est)
 {
+#ifdef CONFIG_NET_CLS_ACT
+	struct tc_action *act = NULL;
+	int ret;
+#endif
 	if (tb[TCA_U32_LINK-1]) {
 		u32 handle = *(u32*)RTA_DATA(tb[TCA_U32_LINK-1]);
 		struct tc_u_hnode *ht_down = NULL;
@@ -470,17 +541,74 @@ static int u32_set_parms(struct Qdisc *q, unsigned long base,
 		if (cl)
 			q->ops->cl_ops->unbind_tcf(q, cl);
 	}
+#ifdef CONFIG_NET_CLS_ACT
+	/*backward compatibility */
+	if (tb[TCA_U32_POLICE-1])
+	{
+		act = kmalloc(sizeof(*act),GFP_KERNEL);
+		if (NULL == act)
+			return -ENOMEM;
+
+		memset(act,0,sizeof(*act));
+		ret = tcf_action_init_1(tb[TCA_U32_POLICE-1], est,act,"police", TCA_ACT_NOREPLACE, TCA_ACT_BIND);
+		if (0 > ret){
+			tcf_action_destroy(act, TCA_ACT_UNBIND);
+			return ret;
+		}
+		act->type = TCA_OLD_COMPAT;
+
+		sch_tree_lock(q);
+		act = xchg(&n->action, act);
+		sch_tree_unlock(q);
+
+		tcf_action_destroy(act, TCA_ACT_UNBIND);
+
+	}
+
+	if(tb[TCA_U32_ACT-1]) {
+		act = kmalloc(sizeof(*act),GFP_KERNEL);
+		if (NULL == act)
+			return -ENOMEM;
+		memset(act,0,sizeof(*act));
+		ret = tcf_action_init(tb[TCA_U32_ACT-1], est,act,NULL,TCA_ACT_NOREPLACE, TCA_ACT_BIND);
+		if (0 > ret) {
+			tcf_action_destroy(act, TCA_ACT_UNBIND);
+			return ret;
+		}
+
+		sch_tree_lock(q);
+		act = xchg(&n->action, act);
+		sch_tree_unlock(q);
+
+		tcf_action_destroy(act, TCA_ACT_UNBIND);
+	}
+
+
+#else
 #ifdef CONFIG_NET_CLS_POLICE
 	if (tb[TCA_U32_POLICE-1]) {
 		struct tcf_police *police = tcf_police_locate(tb[TCA_U32_POLICE-1], est);
-
 		sch_tree_lock(q);
 		police = xchg(&n->police, police);
 		sch_tree_unlock(q);
-
-		tcf_police_release(police);
+		tcf_police_release(police, TCA_ACT_UNBIND);
+	}
+#endif
+#endif
+#ifdef CONFIG_NET_CLS_IND
+	n->indev[0] = 0;
+	if(tb[TCA_U32_INDEV-1]) {
+		struct rtattr *input_dev = tb[TCA_U32_INDEV-1];
+		if (RTA_PAYLOAD(input_dev) >= IFNAMSIZ) {
+			printk("cls_u32: bad indev name %s\n",(char*)RTA_DATA(input_dev));
+			/* should we clear state first? */
+			return  -EINVAL;
+		}
+		sprintf(n->indev, "%s", (char*)RTA_DATA(input_dev));
+		printk("got IND %s\n",n->indev);
 	}
 #endif
+
 	return 0;
 }
 
@@ -566,13 +694,35 @@ static int u32_change(struct tcf_proto *tp, unsigned long base, u32 handle,
 		return -EINVAL;
 
 	s = RTA_DATA(tb[TCA_U32_SEL-1]);
+
 	n = kmalloc(sizeof(*n) + s->nkeys*sizeof(struct tc_u32_key), GFP_KERNEL);
 	if (n == NULL)
 		return -ENOBUFS;
+
 	memset(n, 0, sizeof(*n) + s->nkeys*sizeof(struct tc_u32_key));
+#ifdef CONFIG_CLS_U32_PERF
+	n->pf = kmalloc(sizeof(struct tc_u32_pcnt) + s->nkeys*sizeof(__u64), GFP_KERNEL);
+	if (n->pf == NULL) {
+		kfree(n);
+		return -ENOBUFS;
+	}
+	memset(n->pf, 0, sizeof(struct tc_u32_pcnt) + s->nkeys*sizeof(__u64));
+#endif
+
 	memcpy(&n->sel, s, sizeof(*s) + s->nkeys*sizeof(struct tc_u32_key));
 	n->ht_up = ht;
 	n->handle = handle;
+{
+	u8 i = 0;
+	u32 mask = s->hmask;
+	if (mask) {
+		while (!(mask & 1)) {
+			i++;
+			mask>>=1;
+		}
+	}
+	n->fshift = i;
+}
 	err = u32_set_parms(tp->q, base, ht, n, tb, tca[TCA_RATE-1]);
 	if (err == 0) {
 		struct tc_u_knode **ins;
@@ -587,6 +737,10 @@ static int u32_change(struct tcf_proto *tp, unsigned long base, u32 handle,
 		*arg = (unsigned long)n;
 		return 0;
 	}
+#ifdef CONFIG_CLS_U32_PERF
+	if (n && (NULL != n->pf))
+		kfree(n->pf);
+#endif
 	kfree(n);
 	return err;
 }
@@ -656,26 +810,74 @@ static int u32_dump(struct tcf_proto *tp, unsigned long fh,
 			RTA_PUT(skb, TCA_U32_CLASSID, 4, &n->res.classid);
 		if (n->ht_down)
 			RTA_PUT(skb, TCA_U32_LINK, 4, &n->ht_down->handle);
+#ifdef CONFIG_NET_CLS_ACT
+		/* again for backward compatible mode - we want
+		*  to work with both old and new modes of entering
+		*  tc data even if iproute2  was newer - jhs 
+		*/
+		if (n->action) {
+			struct rtattr * p_rta = (struct rtattr*)skb->tail;
+
+			if (n->action->type != TCA_OLD_COMPAT) {
+				RTA_PUT(skb, TCA_U32_ACT, 0, NULL);
+				if (tcf_action_dump(skb,n->action, 0, 0) < 0) {
+					goto rtattr_failure;
+				}
+			} else {
+				RTA_PUT(skb, TCA_U32_POLICE, 0, NULL);
+				if (tcf_action_dump_old(skb,n->action,0,0) < 0) {
+					goto rtattr_failure;
+				}
+			}
+
+			p_rta->rta_len = skb->tail - (u8*)p_rta;
+		}
+
+#else
 #ifdef CONFIG_NET_CLS_POLICE
 		if (n->police) {
 			struct rtattr * p_rta = (struct rtattr*)skb->tail;
-
 			RTA_PUT(skb, TCA_U32_POLICE, 0, NULL);
-
+	 
 			if (tcf_police_dump(skb, n->police) < 0)
 				goto rtattr_failure;
 
 			p_rta->rta_len = skb->tail - (u8*)p_rta;
+
+		}
+#endif
+#endif
+
+#ifdef CONFIG_NET_CLS_IND
+		if(strlen(n->indev)) {
+			struct rtattr * p_rta = (struct rtattr*)skb->tail;
+			RTA_PUT(skb, TCA_U32_INDEV, IFNAMSIZ, n->indev);
+			p_rta->rta_len = skb->tail - (u8*)p_rta;
 		}
+#endif
+#ifdef CONFIG_CLS_U32_PERF
+		RTA_PUT(skb, TCA_U32_PCNT, 
+		sizeof(struct tc_u32_pcnt) + n->sel.nkeys*sizeof(__u64),
+			n->pf);
 #endif
 	}
 
 	rta->rta_len = skb->tail - b;
+#ifdef CONFIG_NET_CLS_ACT
+	if (TC_U32_KEY(n->handle) != 0) {
+		if (TC_U32_KEY(n->handle) && n->action && n->action->type == TCA_OLD_COMPAT) {
+			if (tcf_action_copy_stats(skb,n->action))
+				goto rtattr_failure;
+		}
+	}
+#else
 #ifdef CONFIG_NET_CLS_POLICE
 	if (TC_U32_KEY(n->handle) && n->police) {
-		if (qdisc_copy_stats(skb, &n->police->stats))
+		if (qdisc_copy_stats(skb, &n->police->stats,
+				     n->police->stats_lock))
 			goto rtattr_failure;
 	}
+#endif
 #endif
 	return skb->len;
 
@@ -701,6 +903,19 @@ static struct tcf_proto_ops cls_u32_ops = {
 
 static int __init init_u32(void)
 {
+	printk("u32 classifier\n");
+#ifdef CONFIG_CLS_U32_PERF
+	printk("    Perfomance counters on\n");
+#endif
+#ifdef CONFIG_NET_CLS_POLICE
+	printk("    OLD policer on \n");
+#endif
+#ifdef CONFIG_NET_CLS_IND
+	printk("    input device check on \n");
+#endif
+#ifdef CONFIG_NET_CLS_ACT
+	printk("    Actions configured \n");
+#endif
 	return register_tcf_proto_ops(&cls_u32_ops);
 }
 
diff --git a/net/sched/estimator.c b/net/sched/estimator.c
index d0f0df64c..393496b2f 100644
--- a/net/sched/estimator.c
+++ b/net/sched/estimator.c
@@ -81,6 +81,7 @@ struct qdisc_estimator
 {
 	struct qdisc_estimator	*next;
 	struct tc_stats		*stats;
+	spinlock_t		*stats_lock;
 	unsigned		interval;
 	int			ewma_log;
 	u64			last_bytes;
@@ -112,7 +113,7 @@ static void est_timer(unsigned long arg)
 		u32 npackets;
 		u32 rate;
 
-		spin_lock(st->lock);
+		spin_lock(e->stats_lock);
 		nbytes = st->bytes;
 		npackets = st->packets;
 		rate = (nbytes - e->last_bytes)<<(7 - idx);
@@ -124,14 +125,14 @@ static void est_timer(unsigned long arg)
 		e->last_packets = npackets;
 		e->avpps += ((long)rate - (long)e->avpps) >> e->ewma_log;
 		e->stats->pps = (e->avpps+0x1FF)>>10;
-		spin_unlock(st->lock);
+		spin_unlock(e->stats_lock);
 	}
 
 	mod_timer(&elist[idx].timer, jiffies + ((HZ/4)<<idx));
 	read_unlock(&est_lock);
 }
 
-int qdisc_new_estimator(struct tc_stats *stats, struct rtattr *opt)
+int qdisc_new_estimator(struct tc_stats *stats, spinlock_t *stats_lock, struct rtattr *opt)
 {
 	struct qdisc_estimator *est;
 	struct tc_estimator *parm = RTA_DATA(opt);
@@ -149,6 +150,7 @@ int qdisc_new_estimator(struct tc_stats *stats, struct rtattr *opt)
 	memset(est, 0, sizeof(*est));
 	est->interval = parm->interval + 2;
 	est->stats = stats;
+	est->stats_lock = stats_lock;
 	est->ewma_log = parm->ewma_log;
 	est->last_bytes = stats->bytes;
 	est->avbps = stats->bps<<5;
diff --git a/net/sched/police.c b/net/sched/police.c
index e92a07620..12bd44006 100644
--- a/net/sched/police.c
+++ b/net/sched/police.c
@@ -7,6 +7,7 @@
  *		2 of the License, or (at your option) any later version.
  *
  * Authors:	Alexey Kuznetsov, <kuznet@ms2.inr.ac.ru>
+ * 		J Hadi Salim (action changes)
  */
 
 #include <asm/uaccess.h>
@@ -26,6 +27,7 @@
 #include <linux/interrupt.h>
 #include <linux/netdevice.h>
 #include <linux/skbuff.h>
+#include <linux/module.h>
 #include <linux/rtnetlink.h>
 #include <linux/init.h>
 #include <net/sock.h>
@@ -33,9 +35,13 @@
 
 #define L2T(p,L)   ((p)->R_tab->data[(L)>>(p)->R_tab->rate.cell_log])
 #define L2T_P(p,L) ((p)->P_tab->data[(L)>>(p)->P_tab->rate.cell_log])
+#define PRIV(a) ((struct tcf_police *) (a)->priv)
 
+/* use generic hash table */
+#define MY_TAB_SIZE     16
+#define MY_TAB_MASK     15
 static u32 idx_gen;
-static struct tcf_police *tcf_police_ht[16];
+static struct tcf_police *tcf_police_ht[MY_TAB_SIZE];
 /* Policer hash table lock */
 static rwlock_t police_lock = RW_LOCK_UNLOCKED;
 
@@ -59,6 +65,68 @@ static __inline__ struct tcf_police * tcf_police_lookup(u32 index)
 	return p;
 }
 
+#ifdef CONFIG_NET_CLS_ACT
+static __inline__ int tcf_generic_walker(struct sk_buff *skb, struct netlink_callback *cb, int type, struct tc_action *a)
+{
+	struct tcf_police *p;
+	int err =0, index =  -1,i= 0, s_i = 0, n_i = 0;
+	struct rtattr *r ;
+
+	read_lock(&police_lock);
+
+	s_i = cb->args[0];
+
+	for (i = 0; i < MY_TAB_SIZE; i++) {
+		p = tcf_police_ht[tcf_police_hash(i)];
+
+		for (; p; p = p->next) {
+			index++;
+			if (index < s_i)
+				continue;
+			a->priv = p;
+			a->order = index;
+			r = (struct rtattr*) skb->tail;
+			RTA_PUT(skb, a->order, 0, NULL);
+			if (type == RTM_DELACTION)
+				err = tcf_action_dump_1(skb, a, 0, 1);
+			else
+				err = tcf_action_dump_1(skb, a, 0, 0);
+			if (0 > err) {
+				index--;
+				skb_trim(skb, (u8*)r - skb->data);
+				goto done;
+			}
+			r->rta_len = skb->tail - (u8*)r;
+			n_i++;
+		}
+	}
+done:
+	read_unlock(&police_lock);
+	if (n_i)
+		cb->args[0] += n_i;
+	return n_i;
+
+rtattr_failure:
+	skb_trim(skb, (u8*)r - skb->data);
+	goto done;
+}
+
+static inline int
+tcf_hash_search(struct tc_action *a, u32 index)
+{
+	struct tcf_police *p = tcf_police_lookup(index);
+
+	if (p != NULL) {
+		a->priv = p;
+		return 1;
+	} else {
+		return 0;
+	}
+}
+
+
+#endif
+
 static __inline__ u32 tcf_police_new_index(void)
 {
 	do {
@@ -94,6 +162,269 @@ void tcf_police_destroy(struct tcf_police *p)
 	BUG_TRAP(0);
 }
 
+#ifdef CONFIG_NET_CLS_ACT
+int tcf_act_police_locate(struct rtattr *rta, struct rtattr *est,struct tc_action *a, int ovr, int bind)
+{
+	unsigned h;
+	int ret = 0;
+	struct rtattr *tb[TCA_POLICE_MAX];
+	struct tc_police *parm;
+	struct tcf_police *p;
+
+	if (NULL == a) {
+		if (net_ratelimit())
+			printk("BUG: tcf_police_locate called with NULL params\n");
+		return -1;  
+	}
+
+	if (rtattr_parse(tb, TCA_POLICE_MAX, RTA_DATA(rta), RTA_PAYLOAD(rta)) < 0)
+		return -1;
+
+	if (tb[TCA_POLICE_TBF-1] == NULL)
+		return -1;
+
+	parm = RTA_DATA(tb[TCA_POLICE_TBF-1]);
+
+	if (parm->index && (p = tcf_police_lookup(parm->index)) != NULL) {
+		a->priv = (void *)p;
+		spin_lock(&p->lock);
+		if (bind) {
+			p->bindcnt += 1;
+			p->refcnt += 1;
+		}
+		if (ovr) {
+			goto override;
+		}
+		spin_unlock(&p->lock);
+		return ret; 
+	}
+
+	p = kmalloc(sizeof(*p), GFP_KERNEL);
+	if (p == NULL)
+		return -1;
+
+	memset(p, 0, sizeof(*p));
+	ret = 1;
+	p->refcnt = 1;
+	spin_lock_init(&p->lock);
+	p->stats_lock = &p->lock;
+	if (bind)
+		p->bindcnt = 1;
+override:
+	if (parm->rate.rate) {
+		if ((p->R_tab = qdisc_get_rtab(&parm->rate, tb[TCA_POLICE_RATE-1])) == NULL) {
+			goto failure;
+		}
+		if (parm->peakrate.rate &&
+		    (p->P_tab = qdisc_get_rtab(&parm->peakrate, tb[TCA_POLICE_PEAKRATE-1])) == NULL) {
+			goto failure;
+		}
+	}
+	if (tb[TCA_POLICE_RESULT-1])
+		p->result = *(int*)RTA_DATA(tb[TCA_POLICE_RESULT-1]);
+#ifdef CONFIG_NET_ESTIMATOR
+	if (tb[TCA_POLICE_AVRATE-1])
+		p->ewma_rate = *(u32*)RTA_DATA(tb[TCA_POLICE_AVRATE-1]);
+#endif
+	p->toks = p->burst = parm->burst;
+	p->mtu = parm->mtu;
+	if (p->mtu == 0) {
+		p->mtu = ~0;
+		if (p->R_tab)
+			p->mtu = 255<<p->R_tab->rate.cell_log;
+	}
+	if (p->P_tab)
+		p->ptoks = L2T_P(p, p->mtu);
+	p->action = parm->action;
+
+	if (ovr) {
+		spin_unlock(&p->lock);
+		return ret;
+	}
+	PSCHED_GET_TIME(p->t_c);
+	p->index = parm->index ? : tcf_police_new_index();
+#ifdef CONFIG_NET_ESTIMATOR
+	if (est)
+		qdisc_new_estimator(&p->stats, p->stats_lock, est);
+#endif
+	h = tcf_police_hash(p->index);
+	write_lock_bh(&police_lock);
+	p->next = tcf_police_ht[h];
+	tcf_police_ht[h] = p;
+	write_unlock_bh(&police_lock);
+
+	a->priv = (void *)p;
+	return ret;  
+
+failure:
+	if (p->R_tab)
+		qdisc_put_rtab(p->R_tab);
+	if (ovr)
+		spin_unlock(&p->lock);
+	kfree(p);
+	return -1;
+}
+
+int tcf_act_police_cleanup(struct tc_action *a, int bind)
+{
+	struct tcf_police *p;
+	p = PRIV(a);
+	if (NULL != p) 
+		return tcf_police_release(p, bind);
+
+	return 0;
+}
+
+int tcf_act_police_stats(struct sk_buff *skb, struct tc_action *a)
+{
+	struct tcf_police *p;
+	p = PRIV(a);
+	if (NULL != p) 
+		return qdisc_copy_stats(skb, &p->stats, p->stats_lock);
+
+	return 1;
+}
+
+int tcf_act_police(struct sk_buff **pskb, struct tc_action *a)
+{
+	psched_time_t now;
+	struct sk_buff *skb = *pskb;
+	struct tcf_police *p;
+	long toks;
+	long ptoks = 0;
+
+	p = PRIV(a);
+
+	if (NULL == p) {
+		printk("BUG: tcf_police called with NULL params\n");
+		return -1;  
+	}
+
+	spin_lock(&p->lock);
+
+	p->stats.bytes += skb->len;
+	p->stats.packets++;
+
+#ifdef CONFIG_NET_ESTIMATOR
+	if (p->ewma_rate && p->stats.bps >= p->ewma_rate) {
+		p->stats.overlimits++;
+		spin_unlock(&p->lock);
+		return p->action;
+	}
+#endif
+
+	if (skb->len <= p->mtu) {
+		if (p->R_tab == NULL) {
+			spin_unlock(&p->lock);
+			return p->result;
+		}
+
+		PSCHED_GET_TIME(now);
+
+		toks = PSCHED_TDIFF_SAFE(now, p->t_c, p->burst);
+
+		if (p->P_tab) {
+			ptoks = toks + p->ptoks;
+			if (ptoks > (long)L2T_P(p, p->mtu))
+				ptoks = (long)L2T_P(p, p->mtu);
+			ptoks -= L2T_P(p, skb->len);
+		}
+		toks += p->toks;
+		if (toks > (long)p->burst)
+			toks = p->burst;
+		toks -= L2T(p, skb->len);
+
+		if ((toks|ptoks) >= 0) {
+			p->t_c = now;
+			p->toks = toks;
+			p->ptoks = ptoks;
+			spin_unlock(&p->lock);
+			return p->result;
+		}
+	}
+
+	p->stats.overlimits++;
+	spin_unlock(&p->lock);
+	return p->action;
+}
+
+int tcf_act_police_dump(struct sk_buff *skb, struct tc_action *a, int bind, int ref)
+{
+	unsigned char	 *b = skb->tail;
+	struct tc_police opt;
+	struct tcf_police *p;
+
+	p = PRIV(a);
+	if (NULL == p) {
+		printk("BUG: tcf_police_dump called with NULL params\n");
+		goto rtattr_failure;
+	}
+
+	opt.index = p->index;
+	opt.action = p->action;
+	opt.mtu = p->mtu;
+	opt.burst = p->burst;
+	opt.refcnt = p->refcnt - ref;
+	opt.bindcnt = p->bindcnt - bind;
+	if (p->R_tab)
+		opt.rate = p->R_tab->rate;
+	else
+		memset(&opt.rate, 0, sizeof(opt.rate));
+	if (p->P_tab)
+		opt.peakrate = p->P_tab->rate;
+	else
+		memset(&opt.peakrate, 0, sizeof(opt.peakrate));
+	RTA_PUT(skb, TCA_POLICE_TBF, sizeof(opt), &opt);
+	if (p->result)
+		RTA_PUT(skb, TCA_POLICE_RESULT, sizeof(int), &p->result);
+#ifdef CONFIG_NET_ESTIMATOR
+	if (p->ewma_rate)
+		RTA_PUT(skb, TCA_POLICE_AVRATE, 4, &p->ewma_rate);
+#endif
+	return skb->len;
+
+rtattr_failure:
+	skb_trim(skb, b - skb->data);
+	return -1;
+}
+
+MODULE_AUTHOR("Alexey Kuznetsov");
+MODULE_DESCRIPTION("Policing actions");
+MODULE_LICENSE("GPL");
+
+
+static struct tc_action_ops act_police_ops = {
+	.next		=	NULL,
+	.kind		=	"police",
+	.type		=	TCA_ID_POLICE, 
+	.capab		=	TCA_CAP_NONE, 
+	.owner		=	THIS_MODULE,
+	.act		=	tcf_act_police,
+	.get_stats	=	tcf_act_police_stats,
+	.dump		=	tcf_act_police_dump,
+	.cleanup	=	tcf_act_police_cleanup,
+	.lookup		=	tcf_hash_search,
+	.init		=	tcf_act_police_locate,
+	.walk		=	tcf_generic_walker
+};
+
+static int __init
+police_init_module(void)
+{
+	return tcf_register_action(&act_police_ops);
+}
+
+static void __exit
+police_cleanup_module(void)
+{
+	tcf_unregister_action(&act_police_ops);
+}
+
+module_init(police_init_module);
+module_exit(police_cleanup_module);
+
+#endif
+
 struct tcf_police * tcf_police_locate(struct rtattr *rta, struct rtattr *est)
 {
 	unsigned h;
@@ -121,7 +452,7 @@ struct tcf_police * tcf_police_locate(struct rtattr *rta, struct rtattr *est)
 	memset(p, 0, sizeof(*p));
 	p->refcnt = 1;
 	spin_lock_init(&p->lock);
-	p->stats.lock = &p->lock;
+	p->stats_lock = &p->lock;
 	if (parm->rate.rate) {
 		if ((p->R_tab = qdisc_get_rtab(&parm->rate, tb[TCA_POLICE_RATE-1])) == NULL)
 			goto failure;
@@ -149,7 +480,7 @@ struct tcf_police * tcf_police_locate(struct rtattr *rta, struct rtattr *est)
 	p->action = parm->action;
 #ifdef CONFIG_NET_ESTIMATOR
 	if (est)
-		qdisc_new_estimator(&p->stats, est);
+		qdisc_new_estimator(&p->stats, p->stats_lock, est);
 #endif
 	h = tcf_police_hash(p->index);
 	write_lock_bh(&police_lock);
@@ -192,7 +523,7 @@ int tcf_police(struct sk_buff *skb, struct tcf_police *p)
 
 		PSCHED_GET_TIME(now);
 
-		toks = PSCHED_TDIFF_SAFE(now, p->t_c, p->burst, 0);
+		toks = PSCHED_TDIFF_SAFE(now, p->t_c, p->burst);
 
 		if (p->P_tab) {
 			ptoks = toks + p->ptoks;
diff --git a/net/sched/sch_api.c b/net/sched/sch_api.c
index 432531dca..1f9bf9d08 100644
--- a/net/sched/sch_api.c
+++ b/net/sched/sch_api.c
@@ -34,6 +34,7 @@
 #include <linux/proc_fs.h>
 #include <linux/seq_file.h>
 #include <linux/kmod.h>
+#include <linux/list.h>
 
 #include <net/sock.h>
 #include <net/pkt_sched.h>
@@ -195,7 +196,7 @@ struct Qdisc *qdisc_lookup(struct net_device *dev, u32 handle)
 {
 	struct Qdisc *q;
 
-	for (q = dev->qdisc_list; q; q = q->next) {
+	list_for_each_entry(q, &dev->qdisc_list, list) {
 		if (q->handle == handle)
 			return q;
 	}
@@ -306,8 +307,7 @@ dev_graft_qdisc(struct net_device *dev, struct Qdisc *qdisc)
 	if (dev->flags & IFF_UP)
 		dev_deactivate(dev);
 
-	write_lock(&qdisc_tree_lock);
-	spin_lock_bh(&dev->queue_lock);
+	qdisc_lock_tree(dev);
 	if (qdisc && qdisc->flags&TCQ_F_INGRES) {
 		oqdisc = dev->qdisc_ingress;
 		/* Prune old scheduler */
@@ -334,8 +334,7 @@ dev_graft_qdisc(struct net_device *dev, struct Qdisc *qdisc)
 		dev->qdisc = &noop_qdisc;
 	}
 
-	spin_unlock_bh(&dev->queue_lock);
-	write_unlock(&qdisc_tree_lock);
+	qdisc_unlock_tree(dev);
 
 	if (dev->flags & IFF_UP)
 		dev_activate(dev);
@@ -423,6 +422,7 @@ qdisc_create(struct net_device *dev, u32 handle, struct rtattr **tca, int *errp)
 
 	memset(sch, 0, size);
 
+	INIT_LIST_HEAD(&sch->list);
 	skb_queue_head_init(&sch->q);
 
 	if (handle == TC_H_INGRESS)
@@ -432,8 +432,9 @@ qdisc_create(struct net_device *dev, u32 handle, struct rtattr **tca, int *errp)
 	sch->enqueue = ops->enqueue;
 	sch->dequeue = ops->dequeue;
 	sch->dev = dev;
+	dev_hold(dev);
 	atomic_set(&sch->refcnt, 1);
-	sch->stats.lock = &dev->queue_lock;
+	sch->stats_lock = &dev->queue_lock;
 	if (handle == 0) {
 		handle = qdisc_alloc_handle(dev);
 		err = -ENOMEM;
@@ -450,14 +451,18 @@ qdisc_create(struct net_device *dev, u32 handle, struct rtattr **tca, int *errp)
 	if (!try_module_get(ops->owner))
 		goto err_out;
 
+	/* enqueue is accessed locklessly - make sure it's visible
+	 * before we set a netdevice's qdisc pointer to sch */
+	smp_wmb();
 	if (!ops->init || (err = ops->init(sch, tca[TCA_OPTIONS-1])) == 0) {
-		write_lock(&qdisc_tree_lock);
-		sch->next = dev->qdisc_list;
-		dev->qdisc_list = sch;
-		write_unlock(&qdisc_tree_lock);
+		qdisc_lock_tree(dev);
+		list_add_tail(&sch->list, &dev->qdisc_list);
+		qdisc_unlock_tree(dev);
+
 #ifdef CONFIG_NET_ESTIMATOR
 		if (tca[TCA_RATE-1])
-			qdisc_new_estimator(&sch->stats, tca[TCA_RATE-1]);
+			qdisc_new_estimator(&sch->stats, sch->stats_lock,
+					    tca[TCA_RATE-1]);
 #endif
 		return sch;
 	}
@@ -484,7 +489,8 @@ static int qdisc_change(struct Qdisc *sch, struct rtattr **tca)
 #ifdef CONFIG_NET_ESTIMATOR
 	if (tca[TCA_RATE-1]) {
 		qdisc_kill_estimator(&sch->stats);
-		qdisc_new_estimator(&sch->stats, tca[TCA_RATE-1]);
+		qdisc_new_estimator(&sch->stats, sch->stats_lock,
+				    tca[TCA_RATE-1]);
 	}
 #endif
 	return 0;
@@ -723,15 +729,15 @@ graft:
 	return 0;
 }
 
-int qdisc_copy_stats(struct sk_buff *skb, struct tc_stats *st)
+int qdisc_copy_stats(struct sk_buff *skb, struct tc_stats *st, spinlock_t *lock)
 {
-	spin_lock_bh(st->lock);
-	RTA_PUT(skb, TCA_STATS, (char*)&st->lock - (char*)st, st);
-	spin_unlock_bh(st->lock);
+	spin_lock_bh(lock);
+	RTA_PUT(skb, TCA_STATS, sizeof(struct tc_stats), st);
+	spin_unlock_bh(lock);
 	return 0;
 
 rtattr_failure:
-	spin_unlock_bh(st->lock);
+	spin_unlock_bh(lock);
 	return -1;
 }
 
@@ -747,7 +753,7 @@ static int tc_fill_qdisc(struct sk_buff *skb, struct Qdisc *q, u32 clid,
 	nlh->nlmsg_flags = flags;
 	tcm = NLMSG_DATA(nlh);
 	tcm->tcm_family = AF_UNSPEC;
-	tcm->tcm_ifindex = q->dev ? q->dev->ifindex : 0;
+	tcm->tcm_ifindex = q->dev->ifindex;
 	tcm->tcm_parent = clid;
 	tcm->tcm_handle = q->handle;
 	tcm->tcm_info = atomic_read(&q->refcnt);
@@ -755,7 +761,7 @@ static int tc_fill_qdisc(struct sk_buff *skb, struct Qdisc *q, u32 clid,
 	if (q->ops->dump && q->ops->dump(q, skb) < 0)
 		goto rtattr_failure;
 	q->stats.qlen = q->q.qlen;
-	if (qdisc_copy_stats(skb, &q->stats))
+	if (qdisc_copy_stats(skb, &q->stats, q->stats_lock))
 		goto rtattr_failure;
 	nlh->nlmsg_len = skb->tail - b;
 	return skb->len;
@@ -808,18 +814,21 @@ static int tc_dump_qdisc(struct sk_buff *skb, struct netlink_callback *cb)
 			continue;
 		if (idx > s_idx)
 			s_q_idx = 0;
-		read_lock(&qdisc_tree_lock);
-		for (q = dev->qdisc_list, q_idx = 0; q;
-		     q = q->next, q_idx++) {
-			if (q_idx < s_q_idx)
+		read_lock_bh(&qdisc_tree_lock);
+		q_idx = 0;
+		list_for_each_entry(q, &dev->qdisc_list, list) {
+			if (q_idx < s_q_idx) {
+				q_idx++;
 				continue;
+			}
 			if (tc_fill_qdisc(skb, q, 0, NETLINK_CB(cb->skb).pid,
 					  cb->nlh->nlmsg_seq, NLM_F_MULTI, RTM_NEWQDISC) <= 0) {
-				read_unlock(&qdisc_tree_lock);
+				read_unlock_bh(&qdisc_tree_lock);
 				goto done;
 			}
+			q_idx++;
 		}
-		read_unlock(&qdisc_tree_lock);
+		read_unlock_bh(&qdisc_tree_lock);
 	}
 
 done:
@@ -964,7 +973,7 @@ static int tc_fill_tclass(struct sk_buff *skb, struct Qdisc *q,
 	nlh->nlmsg_flags = flags;
 	tcm = NLMSG_DATA(nlh);
 	tcm->tcm_family = AF_UNSPEC;
-	tcm->tcm_ifindex = q->dev ? q->dev->ifindex : 0;
+	tcm->tcm_ifindex = q->dev->ifindex;
 	tcm->tcm_parent = q->handle;
 	tcm->tcm_handle = q->handle;
 	tcm->tcm_info = 0;
@@ -1028,13 +1037,16 @@ static int tc_dump_tclass(struct sk_buff *skb, struct netlink_callback *cb)
 		return 0;
 
 	s_t = cb->args[0];
-
-	read_lock(&qdisc_tree_lock);
-	for (q=dev->qdisc_list, t=0; q; q = q->next, t++) {
-		if (t < s_t) continue;
-		if (!q->ops->cl_ops) continue;
-		if (tcm->tcm_parent && TC_H_MAJ(tcm->tcm_parent) != q->handle)
+	t = 0;
+
+	read_lock_bh(&qdisc_tree_lock);
+	list_for_each_entry(q, &dev->qdisc_list, list) {
+		if (t < s_t || !q->ops->cl_ops ||
+		    (tcm->tcm_parent &&
+		     TC_H_MAJ(tcm->tcm_parent) != q->handle)) {
+			t++;
 			continue;
+		}
 		if (t > s_t)
 			memset(&cb->args[1], 0, sizeof(cb->args)-sizeof(cb->args[0]));
 		arg.w.fn = qdisc_class_dump;
@@ -1047,8 +1059,9 @@ static int tc_dump_tclass(struct sk_buff *skb, struct netlink_callback *cb)
 		cb->args[1] = arg.w.count;
 		if (arg.w.stop)
 			break;
+		t++;
 	}
-	read_unlock(&qdisc_tree_lock);
+	read_unlock_bh(&qdisc_tree_lock);
 
 	cb->args[0] = t;
 
@@ -1083,7 +1096,7 @@ static struct file_operations psched_fops = {
 };	
 #endif
 
-#if PSCHED_CLOCK_SOURCE == PSCHED_GETTIMEOFDAY
+#ifdef CONFIG_NET_SCH_CLK_GETTIMEOFDAY
 int psched_tod_diff(int delta_sec, int bound)
 {
 	int delta;
@@ -1095,40 +1108,37 @@ int psched_tod_diff(int delta_sec, int bound)
 		delta = bound;
 	return delta;
 }
+EXPORT_SYMBOL(psched_tod_diff);
 #endif
 
-psched_time_t psched_time_base;
-
-#if PSCHED_CLOCK_SOURCE == PSCHED_CPU
+#ifdef CONFIG_NET_SCH_CLK_CPU
 psched_tdiff_t psched_clock_per_hz;
 int psched_clock_scale;
-#endif
+EXPORT_SYMBOL(psched_clock_per_hz);
+EXPORT_SYMBOL(psched_clock_scale);
 
-#ifdef PSCHED_WATCHER
-PSCHED_WATCHER psched_time_mark;
+psched_time_t psched_time_base;
+cycles_t psched_time_mark;
+EXPORT_SYMBOL(psched_time_mark);
+EXPORT_SYMBOL(psched_time_base);
 
+/*
+ * Periodically adjust psched_time_base to avoid overflow
+ * with 32-bit get_cycles(). Safe up to 4GHz CPU.
+ */
 static void psched_tick(unsigned long);
-
 static struct timer_list psched_timer = TIMER_INITIALIZER(psched_tick, 0, 0);
 
 static void psched_tick(unsigned long dummy)
 {
-#if PSCHED_CLOCK_SOURCE == PSCHED_CPU
-	psched_time_t dummy_stamp;
-	PSCHED_GET_TIME(dummy_stamp);
-	/* It is OK up to 4GHz cpu */
-	psched_timer.expires = jiffies + 1*HZ;
-#else
-	unsigned long now = jiffies;
-	psched_time_base += ((u64)(now-psched_time_mark))<<PSCHED_JSCALE;
-	psched_time_mark = now;
-	psched_timer.expires = now + 60*60*HZ;
-#endif
-	add_timer(&psched_timer);
+	if (sizeof(cycles_t) == sizeof(u32)) {
+		psched_time_t dummy_stamp;
+		PSCHED_GET_TIME(dummy_stamp);
+		psched_timer.expires = jiffies + 1*HZ;
+		add_timer(&psched_timer);
+	}
 }
-#endif
 
-#if PSCHED_CLOCK_SOURCE == PSCHED_CPU
 int __init psched_calibrate_clock(void)
 {
 	psched_time_t stamp, stamp1;
@@ -1137,9 +1147,7 @@ int __init psched_calibrate_clock(void)
 	long rdelay;
 	unsigned long stop;
 
-#ifdef PSCHED_WATCHER
 	psched_tick(0);
-#endif
 	stop = jiffies + HZ/10;
 	PSCHED_GET_TIME(stamp);
 	do_gettimeofday(&tv);
@@ -1169,15 +1177,12 @@ static int __init pktsched_init(void)
 {
 	struct rtnetlink_link *link_p;
 
-#if PSCHED_CLOCK_SOURCE == PSCHED_CPU
+#ifdef CONFIG_NET_SCH_CLK_CPU
 	if (psched_calibrate_clock() < 0)
 		return -1;
-#elif PSCHED_CLOCK_SOURCE == PSCHED_JIFFIES
+#elif defined(CONFIG_NET_SCH_CLK_JIFFIES)
 	psched_tick_per_us = HZ<<PSCHED_JSCALE;
 	psched_us_per_tick = 1000000;
-#ifdef PSCHED_WATCHER
-	psched_tick(0);
-#endif
 #endif
 
 	link_p = rtnetlink_links[PF_UNSPEC];
@@ -1211,4 +1216,3 @@ EXPORT_SYMBOL(qdisc_get_rtab);
 EXPORT_SYMBOL(qdisc_put_rtab);
 EXPORT_SYMBOL(register_qdisc);
 EXPORT_SYMBOL(unregister_qdisc);
-PSCHED_EXPORTLIST;
diff --git a/net/sched/sch_atm.c b/net/sched/sch_atm.c
index d81d11981..ca08449e7 100644
--- a/net/sched/sch_atm.c
+++ b/net/sched/sch_atm.c
@@ -56,7 +56,7 @@ extern struct socket *sockfd_lookup(int fd, int *err); /* @@@ fix this */
  */
 
 
-#define PRIV(sch) ((struct atm_qdisc_data *) (sch)->data)
+#define PRIV(sch) qdisc_priv(sch)
 #define VCC2FLOW(vcc) ((struct atm_flow_data *) ((vcc)->user_back))
 
 
@@ -70,6 +70,7 @@ struct atm_flow_data {
 	u32			classid;	/* x:y type ID */
 	int			ref;		/* reference count */
 	struct tc_stats		stats;
+	spinlock_t		*stats_lock;
 	struct atm_flow_data	*next;
 	struct atm_flow_data	*excess;	/* flow for excess traffic;
 						   NULL to set CLP instead */
@@ -103,9 +104,10 @@ static int find_flow(struct atm_qdisc_data *qdisc,struct atm_flow_data *flow)
 static __inline__ struct atm_flow_data *lookup_flow(struct Qdisc *sch,
     u32 classid)
 {
+	struct atm_qdisc_data *p = PRIV(sch);
 	struct atm_flow_data *flow;
 
-        for (flow = PRIV(sch)->flows; flow; flow = flow->next)
+        for (flow = p->flows; flow; flow = flow->next)
 		if (flow->classid == classid) break;
 	return flow;
 }
diff --git a/net/sched/sch_cbq.c b/net/sched/sch_cbq.c
index 04d05a2aa..01dfcb1ab 100644
--- a/net/sched/sch_cbq.c
+++ b/net/sched/sch_cbq.c
@@ -147,6 +147,7 @@ struct cbq_class
 	long			deficit;	/* Saved deficit for WRR */
 	unsigned long		penalized;
 	struct tc_stats		stats;
+	spinlock_t		*stats_lock;
 	struct tc_cbq_xstats	xstats;
 
 	struct tcf_proto	*filter_list;
@@ -238,9 +239,9 @@ cbq_reclassify(struct sk_buff *skb, struct cbq_class *this)
  */
 
 static struct cbq_class *
-cbq_classify(struct sk_buff *skb, struct Qdisc *sch)
+cbq_classify(struct sk_buff *skb, struct Qdisc *sch, int *qres)
 {
-	struct cbq_sched_data *q = (struct cbq_sched_data*)sch->data;
+	struct cbq_sched_data *q = qdisc_priv(sch);
 	struct cbq_class *head = &q->link;
 	struct cbq_class **defmap;
 	struct cbq_class *cl = NULL;
@@ -256,7 +257,9 @@ cbq_classify(struct sk_buff *skb, struct Qdisc *sch)
 
 	for (;;) {
 		int result = 0;
-
+#ifdef CONFIG_NET_CLS_ACT
+		int terminal = 0;
+#endif
 		defmap = head->defaults;
 
 		/*
@@ -275,6 +278,28 @@ cbq_classify(struct sk_buff *skb, struct Qdisc *sch)
 				goto fallback;
 		}
 
+#ifdef CONFIG_NET_CLS_ACT
+		switch (result) {
+		case TC_ACT_SHOT: /* Stop and kfree */
+			*qres = NET_XMIT_DROP;
+			terminal = 1;
+			break;
+		case TC_ACT_QUEUED:
+		case TC_ACT_STOLEN: 
+			terminal = 1;
+			break;
+		case TC_ACT_RECLASSIFY:  /* Things look good */
+		case TC_ACT_OK: 
+		case TC_ACT_UNSPEC:
+		default:
+			break;
+		}
+
+		if (terminal) {
+			kfree_skb(skb);
+			return NULL;
+		}
+#else
 #ifdef CONFIG_NET_CLS_POLICE
 		switch (result) {
 		case TC_POLICE_RECLASSIFY:
@@ -284,6 +309,7 @@ cbq_classify(struct sk_buff *skb, struct Qdisc *sch)
 		default:
 			break;
 		}
+#endif
 #endif
 		if (cl->level == 0)
 			return cl;
@@ -318,7 +344,7 @@ fallback:
 
 static __inline__ void cbq_activate_class(struct cbq_class *cl)
 {
-	struct cbq_sched_data *q = (struct cbq_sched_data*)cl->qdisc->data;
+	struct cbq_sched_data *q = qdisc_priv(cl->qdisc);
 	int prio = cl->cpriority;
 	struct cbq_class *cl_tail;
 
@@ -342,7 +368,7 @@ static __inline__ void cbq_activate_class(struct cbq_class *cl)
 
 static void cbq_deactivate_class(struct cbq_class *this)
 {
-	struct cbq_sched_data *q = (struct cbq_sched_data*)this->qdisc->data;
+	struct cbq_sched_data *q = qdisc_priv(this->qdisc);
 	int prio = this->cpriority;
 	struct cbq_class *cl;
 	struct cbq_class *cl_prev = q->active[prio];
@@ -393,10 +419,10 @@ cbq_mark_toplevel(struct cbq_sched_data *q, struct cbq_class *cl)
 static int
 cbq_enqueue(struct sk_buff *skb, struct Qdisc *sch)
 {
-	struct cbq_sched_data *q = (struct cbq_sched_data *)sch->data;
-	struct cbq_class *cl = cbq_classify(skb, sch);
+	struct cbq_sched_data *q = qdisc_priv(sch);
 	int len = skb->len;
-	int ret = NET_XMIT_POLICED;
+	int ret = NET_XMIT_SUCCESS;
+	struct cbq_class *cl = cbq_classify(skb, sch,&ret);
 
 #ifdef CONFIG_NET_CLS_POLICE
 	q->rx_class = cl;
@@ -405,17 +431,18 @@ cbq_enqueue(struct sk_buff *skb, struct Qdisc *sch)
 #ifdef CONFIG_NET_CLS_POLICE
 		cl->q->__parent = sch;
 #endif
-		if ((ret = cl->q->enqueue(skb, cl->q)) == 0) {
+		if ((ret = cl->q->enqueue(skb, cl->q)) == NET_XMIT_SUCCESS) {
 			sch->q.qlen++;
 			sch->stats.packets++;
 			sch->stats.bytes+=len;
 			cbq_mark_toplevel(q, cl);
 			if (!cl->next_alive)
 				cbq_activate_class(cl);
-			return 0;
+			return ret;
 		}
 	}
 
+#ifndef CONFIG_NET_CLS_ACT
 	sch->stats.drops++;
 	if (cl == NULL)
 		kfree_skb(skb);
@@ -423,13 +450,23 @@ cbq_enqueue(struct sk_buff *skb, struct Qdisc *sch)
 		cbq_mark_toplevel(q, cl);
 		cl->stats.drops++;
 	}
+#else
+	if ( NET_XMIT_DROP == ret) {
+		sch->stats.drops++;
+	}
+
+	if (cl != NULL) {
+		cbq_mark_toplevel(q, cl);
+		cl->stats.drops++;
+	}
+#endif
 	return ret;
 }
 
 static int
 cbq_requeue(struct sk_buff *skb, struct Qdisc *sch)
 {
-	struct cbq_sched_data *q = (struct cbq_sched_data *)sch->data;
+	struct cbq_sched_data *q = qdisc_priv(sch);
 	struct cbq_class *cl;
 	int ret;
 
@@ -463,7 +500,7 @@ cbq_requeue(struct sk_buff *skb, struct Qdisc *sch)
 
 static void cbq_ovl_classic(struct cbq_class *cl)
 {
-	struct cbq_sched_data *q = (struct cbq_sched_data *)cl->qdisc->data;
+	struct cbq_sched_data *q = qdisc_priv(cl->qdisc);
 	psched_tdiff_t delay = PSCHED_TDIFF(cl->undertime, q->now);
 
 	if (!cl->delayed) {
@@ -517,7 +554,7 @@ static void cbq_ovl_classic(struct cbq_class *cl)
 
 static void cbq_ovl_rclassic(struct cbq_class *cl)
 {
-	struct cbq_sched_data *q = (struct cbq_sched_data *)cl->qdisc->data;
+	struct cbq_sched_data *q = qdisc_priv(cl->qdisc);
 	struct cbq_class *this = cl;
 
 	do {
@@ -536,7 +573,7 @@ static void cbq_ovl_rclassic(struct cbq_class *cl)
 
 static void cbq_ovl_delay(struct cbq_class *cl)
 {
-	struct cbq_sched_data *q = (struct cbq_sched_data *)cl->qdisc->data;
+	struct cbq_sched_data *q = qdisc_priv(cl->qdisc);
 	psched_tdiff_t delay = PSCHED_TDIFF(cl->undertime, q->now);
 
 	if (!cl->delayed) {
@@ -572,7 +609,7 @@ static void cbq_ovl_delay(struct cbq_class *cl)
 
 static void cbq_ovl_lowprio(struct cbq_class *cl)
 {
-	struct cbq_sched_data *q = (struct cbq_sched_data*)cl->qdisc->data;
+	struct cbq_sched_data *q = qdisc_priv(cl->qdisc);
 
 	cl->penalized = jiffies + cl->penalty;
 
@@ -641,7 +678,7 @@ static unsigned long cbq_undelay_prio(struct cbq_sched_data *q, int prio)
 static void cbq_undelay(unsigned long arg)
 {
 	struct Qdisc *sch = (struct Qdisc*)arg;
-	struct cbq_sched_data *q = (struct cbq_sched_data*)sch->data;
+	struct cbq_sched_data *q = qdisc_priv(sch);
 	long delay = 0;
 	unsigned pmask;
 
@@ -678,7 +715,7 @@ static int cbq_reshape_fail(struct sk_buff *skb, struct Qdisc *child)
 {
 	int len = skb->len;
 	struct Qdisc *sch = child->__parent;
-	struct cbq_sched_data *q = (struct cbq_sched_data *)sch->data;
+	struct cbq_sched_data *q = qdisc_priv(sch);
 	struct cbq_class *cl = q->rx_class;
 
 	q->rx_class = NULL;
@@ -826,7 +863,7 @@ cbq_update(struct cbq_sched_data *q)
 static __inline__ struct cbq_class *
 cbq_under_limit(struct cbq_class *cl)
 {
-	struct cbq_sched_data *q = (struct cbq_sched_data*)cl->qdisc->data;
+	struct cbq_sched_data *q = qdisc_priv(cl->qdisc);
 	struct cbq_class *this_cl = cl;
 
 	if (cl->tparent == NULL)
@@ -866,7 +903,7 @@ cbq_under_limit(struct cbq_class *cl)
 static __inline__ struct sk_buff *
 cbq_dequeue_prio(struct Qdisc *sch, int prio)
 {
-	struct cbq_sched_data *q = (struct cbq_sched_data *)sch->data;
+	struct cbq_sched_data *q = qdisc_priv(sch);
 	struct cbq_class *cl_tail, *cl_prev, *cl;
 	struct sk_buff *skb;
 	int deficit;
@@ -969,7 +1006,7 @@ next_class:
 static __inline__ struct sk_buff *
 cbq_dequeue_1(struct Qdisc *sch)
 {
-	struct cbq_sched_data *q = (struct cbq_sched_data *)sch->data;
+	struct cbq_sched_data *q = qdisc_priv(sch);
 	struct sk_buff *skb;
 	unsigned activemask;
 
@@ -988,7 +1025,7 @@ static struct sk_buff *
 cbq_dequeue(struct Qdisc *sch)
 {
 	struct sk_buff *skb;
-	struct cbq_sched_data *q = (struct cbq_sched_data *)sch->data;
+	struct cbq_sched_data *q = qdisc_priv(sch);
 	psched_time_t now;
 	psched_tdiff_t incr;
 
@@ -1054,7 +1091,7 @@ cbq_dequeue(struct Qdisc *sch)
 
 	if (sch->q.qlen) {
 		sch->stats.overlimits++;
-		if (q->wd_expires && !netif_queue_stopped(sch->dev)) {
+		if (q->wd_expires) {
 			long delay = PSCHED_US2JIFFIE(q->wd_expires);
 			if (delay <= 0)
 				delay = 1;
@@ -1113,7 +1150,7 @@ static void cbq_normalize_quanta(struct cbq_sched_data *q, int prio)
 
 static void cbq_sync_defmap(struct cbq_class *cl)
 {
-	struct cbq_sched_data *q = (struct cbq_sched_data*)cl->qdisc->data;
+	struct cbq_sched_data *q = qdisc_priv(cl->qdisc);
 	struct cbq_class *split = cl->split;
 	unsigned h;
 	int i;
@@ -1179,7 +1216,7 @@ static void cbq_change_defmap(struct cbq_class *cl, u32 splitid, u32 def, u32 ma
 static void cbq_unlink_class(struct cbq_class *this)
 {
 	struct cbq_class *cl, **clp;
-	struct cbq_sched_data *q = (struct cbq_sched_data*)this->qdisc->data;
+	struct cbq_sched_data *q = qdisc_priv(this->qdisc);
 
 	for (clp = &q->classes[cbq_hash(this->classid)]; (cl = *clp) != NULL; clp = &cl->next) {
 		if (cl == this) {
@@ -1212,7 +1249,7 @@ static void cbq_unlink_class(struct cbq_class *this)
 
 static void cbq_link_class(struct cbq_class *this)
 {
-	struct cbq_sched_data *q = (struct cbq_sched_data*)this->qdisc->data;
+	struct cbq_sched_data *q = qdisc_priv(this->qdisc);
 	unsigned h = cbq_hash(this->classid);
 	struct cbq_class *parent = this->tparent;
 
@@ -1233,7 +1270,7 @@ static void cbq_link_class(struct cbq_class *this)
 
 static unsigned int cbq_drop(struct Qdisc* sch)
 {
-	struct cbq_sched_data *q = (struct cbq_sched_data *)sch->data;
+	struct cbq_sched_data *q = qdisc_priv(sch);
 	struct cbq_class *cl, *cl_head;
 	int prio;
 	unsigned int len;
@@ -1256,7 +1293,7 @@ static unsigned int cbq_drop(struct Qdisc* sch)
 static void
 cbq_reset(struct Qdisc* sch)
 {
-	struct cbq_sched_data *q = (struct cbq_sched_data *)sch->data;
+	struct cbq_sched_data *q = qdisc_priv(sch);
 	struct cbq_class *cl;
 	int prio;
 	unsigned h;
@@ -1326,7 +1363,7 @@ static void cbq_addprio(struct cbq_sched_data *q, struct cbq_class *cl)
 
 static int cbq_set_wrr(struct cbq_class *cl, struct tc_cbq_wrropt *wrr)
 {
-	struct cbq_sched_data *q = (struct cbq_sched_data *)cl->qdisc->data;
+	struct cbq_sched_data *q = qdisc_priv(cl->qdisc);
 
 	if (wrr->allot)
 		cl->allot = wrr->allot;
@@ -1395,7 +1432,7 @@ static int cbq_set_fopt(struct cbq_class *cl, struct tc_cbq_fopt *fopt)
 
 static int cbq_init(struct Qdisc *sch, struct rtattr *opt)
 {
-	struct cbq_sched_data *q = (struct cbq_sched_data*)sch->data;
+	struct cbq_sched_data *q = qdisc_priv(sch);
 	struct rtattr *tb[TCA_CBQ_MAX];
 	struct tc_ratespec *r;
 
@@ -1432,7 +1469,7 @@ static int cbq_init(struct Qdisc *sch, struct rtattr *opt)
 	q->link.ewma_log = TC_CBQ_DEF_EWMA;
 	q->link.avpkt = q->link.allot/2;
 	q->link.minidle = -0x7FFFFFFF;
-	q->link.stats.lock = &sch->dev->queue_lock;
+	q->link.stats_lock = &sch->dev->queue_lock;
 
 	init_timer(&q->wd_timer);
 	q->wd_timer.data = (unsigned long)sch;
@@ -1586,7 +1623,7 @@ rtattr_failure:
 
 static int cbq_dump(struct Qdisc *sch, struct sk_buff *skb)
 {
-	struct cbq_sched_data *q = (struct cbq_sched_data*)sch->data;
+	struct cbq_sched_data *q = qdisc_priv(sch);
 	unsigned char	 *b = skb->tail;
 	struct rtattr *rta;
 
@@ -1613,7 +1650,7 @@ static int
 cbq_dump_class(struct Qdisc *sch, unsigned long arg,
 	       struct sk_buff *skb, struct tcmsg *tcm)
 {
-	struct cbq_sched_data *q = (struct cbq_sched_data*)sch->data;
+	struct cbq_sched_data *q = qdisc_priv(sch);
 	struct cbq_class *cl = (struct cbq_class*)arg;
 	unsigned char	 *b = skb->tail;
 	struct rtattr *rta;
@@ -1631,7 +1668,7 @@ cbq_dump_class(struct Qdisc *sch, unsigned long arg,
 		goto rtattr_failure;
 	rta->rta_len = skb->tail - b;
 	cl->stats.qlen = cl->q->q.qlen;
-	if (qdisc_copy_stats(skb, &cl->stats))
+	if (qdisc_copy_stats(skb, &cl->stats, cl->stats_lock))
 		goto rtattr_failure;
 	spin_lock_bh(&sch->dev->queue_lock);
 	cl->xstats.avgidle = cl->avgidle;
@@ -1689,7 +1726,7 @@ cbq_leaf(struct Qdisc *sch, unsigned long arg)
 
 static unsigned long cbq_get(struct Qdisc *sch, u32 classid)
 {
-	struct cbq_sched_data *q = (struct cbq_sched_data *)sch->data;
+	struct cbq_sched_data *q = qdisc_priv(sch);
 	struct cbq_class *cl = cbq_class_lookup(q, classid);
 
 	if (cl) {
@@ -1723,7 +1760,7 @@ static void cbq_destroy_class(struct cbq_class *cl)
 static void
 cbq_destroy(struct Qdisc* sch)
 {
-	struct cbq_sched_data *q = (struct cbq_sched_data *)sch->data;
+	struct cbq_sched_data *q = qdisc_priv(sch);
 	struct cbq_class *cl;
 	unsigned h;
 
@@ -1754,7 +1791,7 @@ static void cbq_put(struct Qdisc *sch, unsigned long arg)
 
 	if (--cl->refcnt == 0) {
 #ifdef CONFIG_NET_CLS_POLICE
-		struct cbq_sched_data *q = (struct cbq_sched_data *)sch->data;
+		struct cbq_sched_data *q = qdisc_priv(sch);
 
 		spin_lock_bh(&sch->dev->queue_lock);
 		if (q->rx_class == cl)
@@ -1771,7 +1808,7 @@ cbq_change_class(struct Qdisc *sch, u32 classid, u32 parentid, struct rtattr **t
 		 unsigned long *arg)
 {
 	int err;
-	struct cbq_sched_data *q = (struct cbq_sched_data *)sch->data;
+	struct cbq_sched_data *q = qdisc_priv(sch);
 	struct cbq_class *cl = (struct cbq_class*)*arg;
 	struct rtattr *opt = tca[TCA_OPTIONS-1];
 	struct rtattr *tb[TCA_CBQ_MAX];
@@ -1861,7 +1898,8 @@ cbq_change_class(struct Qdisc *sch, u32 classid, u32 parentid, struct rtattr **t
 #ifdef CONFIG_NET_ESTIMATOR
 		if (tca[TCA_RATE-1]) {
 			qdisc_kill_estimator(&cl->stats);
-			qdisc_new_estimator(&cl->stats, tca[TCA_RATE-1]);
+			qdisc_new_estimator(&cl->stats, cl->stats_lock,
+					    tca[TCA_RATE-1]);
 		}
 #endif
 		return 0;
@@ -1922,7 +1960,7 @@ cbq_change_class(struct Qdisc *sch, u32 classid, u32 parentid, struct rtattr **t
 	cl->allot = parent->allot;
 	cl->quantum = cl->allot;
 	cl->weight = cl->R_tab->rate.rate;
-	cl->stats.lock = &sch->dev->queue_lock;
+	cl->stats_lock = &sch->dev->queue_lock;
 
 	sch_tree_lock(sch);
 	cbq_link_class(cl);
@@ -1952,7 +1990,8 @@ cbq_change_class(struct Qdisc *sch, u32 classid, u32 parentid, struct rtattr **t
 
 #ifdef CONFIG_NET_ESTIMATOR
 	if (tca[TCA_RATE-1])
-		qdisc_new_estimator(&cl->stats, tca[TCA_RATE-1]);
+		qdisc_new_estimator(&cl->stats, cl->stats_lock,
+				    tca[TCA_RATE-1]);
 #endif
 
 	*arg = (unsigned long)cl;
@@ -1965,7 +2004,7 @@ failure:
 
 static int cbq_delete(struct Qdisc *sch, unsigned long arg)
 {
-	struct cbq_sched_data *q = (struct cbq_sched_data *)sch->data;
+	struct cbq_sched_data *q = qdisc_priv(sch);
 	struct cbq_class *cl = (struct cbq_class*)arg;
 
 	if (cl->filters || cl->children || cl == &q->link)
@@ -2003,7 +2042,7 @@ static int cbq_delete(struct Qdisc *sch, unsigned long arg)
 
 static struct tcf_proto **cbq_find_tcf(struct Qdisc *sch, unsigned long arg)
 {
-	struct cbq_sched_data *q = (struct cbq_sched_data *)sch->data;
+	struct cbq_sched_data *q = qdisc_priv(sch);
 	struct cbq_class *cl = (struct cbq_class *)arg;
 
 	if (cl == NULL)
@@ -2015,7 +2054,7 @@ static struct tcf_proto **cbq_find_tcf(struct Qdisc *sch, unsigned long arg)
 static unsigned long cbq_bind_filter(struct Qdisc *sch, unsigned long parent,
 				     u32 classid)
 {
-	struct cbq_sched_data *q = (struct cbq_sched_data *)sch->data;
+	struct cbq_sched_data *q = qdisc_priv(sch);
 	struct cbq_class *p = (struct cbq_class*)parent;
 	struct cbq_class *cl = cbq_class_lookup(q, classid);
 
@@ -2037,7 +2076,7 @@ static void cbq_unbind_filter(struct Qdisc *sch, unsigned long arg)
 
 static void cbq_walk(struct Qdisc *sch, struct qdisc_walker *arg)
 {
-	struct cbq_sched_data *q = (struct cbq_sched_data *)sch->data;
+	struct cbq_sched_data *q = qdisc_priv(sch);
 	unsigned h;
 
 	if (arg->stop)
diff --git a/net/sched/sch_dsmark.c b/net/sched/sch_dsmark.c
index 92e9f335b..e0831a4a4 100644
--- a/net/sched/sch_dsmark.c
+++ b/net/sched/sch_dsmark.c
@@ -30,7 +30,7 @@
 #endif
 
 
-#define PRIV(sch) ((struct dsmark_qdisc_data *) (sch)->data)
+#define PRIV(sch) qdisc_priv(sch)
 
 
 /*
@@ -383,7 +383,6 @@ static void dsmark_destroy(struct Qdisc *sch)
 		tcf_destroy(tp);
 	}
 	qdisc_destroy(p->q);
-	p->q = &noop_qdisc;
 	kfree(p->mask);
 }
 
diff --git a/net/sched/sch_fifo.c b/net/sched/sch_fifo.c
index 132a5bc94..b08992417 100644
--- a/net/sched/sch_fifo.c
+++ b/net/sched/sch_fifo.c
@@ -45,7 +45,7 @@ struct fifo_sched_data
 static int
 bfifo_enqueue(struct sk_buff *skb, struct Qdisc* sch)
 {
-	struct fifo_sched_data *q = (struct fifo_sched_data *)sch->data;
+	struct fifo_sched_data *q = qdisc_priv(sch);
 
 	if (sch->stats.backlog + skb->len <= q->limit) {
 		__skb_queue_tail(&sch->q, skb);
@@ -106,7 +106,7 @@ fifo_reset(struct Qdisc* sch)
 static int
 pfifo_enqueue(struct sk_buff *skb, struct Qdisc* sch)
 {
-	struct fifo_sched_data *q = (struct fifo_sched_data *)sch->data;
+	struct fifo_sched_data *q = qdisc_priv(sch);
 
 	if (sch->q.qlen < q->limit) {
 		__skb_queue_tail(&sch->q, skb);
@@ -138,7 +138,7 @@ pfifo_dequeue(struct Qdisc* sch)
 
 static int fifo_init(struct Qdisc *sch, struct rtattr *opt)
 {
-	struct fifo_sched_data *q = (void*)sch->data;
+	struct fifo_sched_data *q = qdisc_priv(sch);
 
 	if (opt == NULL) {
 		unsigned int limit = sch->dev->tx_queue_len ? : 1;
@@ -158,7 +158,7 @@ static int fifo_init(struct Qdisc *sch, struct rtattr *opt)
 
 static int fifo_dump(struct Qdisc *sch, struct sk_buff *skb)
 {
-	struct fifo_sched_data *q = (void*)sch->data;
+	struct fifo_sched_data *q = qdisc_priv(sch);
 	unsigned char	 *b = skb->tail;
 	struct tc_fifo_qopt opt;
 
diff --git a/net/sched/sch_generic.c b/net/sched/sch_generic.c
index 97b56255c..82117f9ba 100644
--- a/net/sched/sch_generic.c
+++ b/net/sched/sch_generic.c
@@ -30,6 +30,8 @@
 #include <linux/skbuff.h>
 #include <linux/rtnetlink.h>
 #include <linux/init.h>
+#include <linux/rcupdate.h>
+#include <linux/list.h>
 #include <net/sock.h>
 #include <net/pkt_sched.h>
 
@@ -44,15 +46,28 @@
    The idea is the following:
    - enqueue, dequeue are serialized via top level device
      spinlock dev->queue_lock.
-   - tree walking is protected by read_lock(qdisc_tree_lock)
+   - tree walking is protected by read_lock_bh(qdisc_tree_lock)
      and this lock is used only in process context.
-   - updates to tree are made only under rtnl semaphore,
-     hence this lock may be made without local bh disabling.
+   - updates to tree are made under rtnl semaphore or
+     from softirq context (__qdisc_destroy rcu-callback)
+     hence this lock needs local bh disabling.
 
    qdisc_tree_lock must be grabbed BEFORE dev->queue_lock!
  */
 rwlock_t qdisc_tree_lock = RW_LOCK_UNLOCKED;
 
+void qdisc_lock_tree(struct net_device *dev)
+{
+	write_lock_bh(&qdisc_tree_lock);
+	spin_lock_bh(&dev->queue_lock);
+}
+
+void qdisc_unlock_tree(struct net_device *dev)
+{
+	spin_unlock_bh(&dev->queue_lock);
+	write_unlock_bh(&qdisc_tree_lock);
+}
+
 /* 
    dev->queue_lock serializes queue accesses for this device
    AND dev->qdisc pointer itself.
@@ -270,10 +285,9 @@ static const u8 prio2band[TC_PRIO_MAX+1] =
 static int
 pfifo_fast_enqueue(struct sk_buff *skb, struct Qdisc* qdisc)
 {
-	struct sk_buff_head *list;
+	struct sk_buff_head *list = qdisc_priv(qdisc);
 
-	list = ((struct sk_buff_head*)qdisc->data) +
-		prio2band[skb->priority&TC_PRIO_MAX];
+	list += prio2band[skb->priority&TC_PRIO_MAX];
 
 	if (list->qlen < qdisc->dev->tx_queue_len) {
 		__skb_queue_tail(list, skb);
@@ -291,7 +305,7 @@ static struct sk_buff *
 pfifo_fast_dequeue(struct Qdisc* qdisc)
 {
 	int prio;
-	struct sk_buff_head *list = ((struct sk_buff_head*)qdisc->data);
+	struct sk_buff_head *list = qdisc_priv(qdisc);
 	struct sk_buff *skb;
 
 	for (prio = 0; prio < 3; prio++, list++) {
@@ -307,10 +321,9 @@ pfifo_fast_dequeue(struct Qdisc* qdisc)
 static int
 pfifo_fast_requeue(struct sk_buff *skb, struct Qdisc* qdisc)
 {
-	struct sk_buff_head *list;
+	struct sk_buff_head *list = qdisc_priv(qdisc);
 
-	list = ((struct sk_buff_head*)qdisc->data) +
-		prio2band[skb->priority&TC_PRIO_MAX];
+	list += prio2band[skb->priority&TC_PRIO_MAX];
 
 	__skb_queue_head(list, skb);
 	qdisc->q.qlen++;
@@ -321,7 +334,7 @@ static void
 pfifo_fast_reset(struct Qdisc* qdisc)
 {
 	int prio;
-	struct sk_buff_head *list = ((struct sk_buff_head*)qdisc->data);
+	struct sk_buff_head *list = qdisc_priv(qdisc);
 
 	for (prio=0; prio < 3; prio++)
 		skb_queue_purge(list+prio);
@@ -346,9 +359,7 @@ rtattr_failure:
 static int pfifo_fast_init(struct Qdisc *qdisc, struct rtattr *opt)
 {
 	int i;
-	struct sk_buff_head *list;
-
-	list = ((struct sk_buff_head*)qdisc->data);
+	struct sk_buff_head *list = qdisc_priv(qdisc);
 
 	for (i=0; i<3; i++)
 		skb_queue_head_init(list+i);
@@ -372,25 +383,39 @@ static struct Qdisc_ops pfifo_fast_ops = {
 
 struct Qdisc * qdisc_create_dflt(struct net_device *dev, struct Qdisc_ops *ops)
 {
+	void *p;
 	struct Qdisc *sch;
-	int size = sizeof(*sch) + ops->priv_size;
+	int size;
 
-	sch = kmalloc(size, GFP_KERNEL);
-	if (!sch)
+	/* ensure that the Qdisc and the private data are 32-byte aligned */
+	size = ((sizeof(*sch) + QDISC_ALIGN_CONST) & ~QDISC_ALIGN_CONST);
+	size += ops->priv_size + QDISC_ALIGN_CONST;
+
+	p = kmalloc(size, GFP_KERNEL);
+	if (!p)
 		return NULL;
-	memset(sch, 0, size);
+	memset(p, 0, size);
+
+	sch = (struct Qdisc *)(((unsigned long)p + QDISC_ALIGN_CONST) 
+			       & ~QDISC_ALIGN_CONST);
+	sch->padded = (char *)sch - (char *)p;
 
+	INIT_LIST_HEAD(&sch->list);
 	skb_queue_head_init(&sch->q);
 	sch->ops = ops;
 	sch->enqueue = ops->enqueue;
 	sch->dequeue = ops->dequeue;
 	sch->dev = dev;
-	sch->stats.lock = &dev->queue_lock;
+	dev_hold(dev);
+	sch->stats_lock = &dev->queue_lock;
 	atomic_set(&sch->refcnt, 1);
+	/* enqueue is accessed locklessly - make sure it's visible
+	 * before we set a netdevice's qdisc pointer to sch */
+	smp_wmb();
 	if (!ops->init || ops->init(sch, NULL) == 0)
 		return sch;
 
-	kfree(sch);
+	kfree(p);
 	return NULL;
 }
 
@@ -404,39 +429,39 @@ void qdisc_reset(struct Qdisc *qdisc)
 		ops->reset(qdisc);
 }
 
-/* Under dev->queue_lock and BH! */
+/* this is the rcu callback function to clean up a qdisc when there 
+ * are no further references to it */
 
-void qdisc_destroy(struct Qdisc *qdisc)
+static void __qdisc_destroy(struct rcu_head *head)
 {
-	struct Qdisc_ops *ops = qdisc->ops;
-	struct net_device *dev;
-
-	if (!atomic_dec_and_test(&qdisc->refcnt))
-		return;
-
-	dev = qdisc->dev;
+	struct Qdisc *qdisc = container_of(head, struct Qdisc, q_rcu);
+	struct Qdisc_ops  *ops = qdisc->ops;
 
-	if (dev) {
-		struct Qdisc *q, **qp;
-		for (qp = &qdisc->dev->qdisc_list; (q=*qp) != NULL; qp = &q->next) {
-			if (q == qdisc) {
-				*qp = q->next;
-				break;
-			}
-		}
-	}
 #ifdef CONFIG_NET_ESTIMATOR
 	qdisc_kill_estimator(&qdisc->stats);
 #endif
+	write_lock(&qdisc_tree_lock);
 	if (ops->reset)
 		ops->reset(qdisc);
 	if (ops->destroy)
 		ops->destroy(qdisc);
+	write_unlock(&qdisc_tree_lock);
 	module_put(ops->owner);
+
+	dev_put(qdisc->dev);
 	if (!(qdisc->flags&TCQ_F_BUILTIN))
-		kfree(qdisc);
+		kfree((char *) qdisc - qdisc->padded);
 }
 
+/* Under dev->queue_lock and BH! */
+
+void qdisc_destroy(struct Qdisc *qdisc)
+{
+	if (!atomic_dec_and_test(&qdisc->refcnt))
+		return;
+	list_del(&qdisc->list);
+	call_rcu(&qdisc->q_rcu, __qdisc_destroy);
+}
 
 void dev_activate(struct net_device *dev)
 {
@@ -454,18 +479,15 @@ void dev_activate(struct net_device *dev)
 				printk(KERN_INFO "%s: activation failed\n", dev->name);
 				return;
 			}
-
-			write_lock(&qdisc_tree_lock);
-			qdisc->next = dev->qdisc_list;
-			dev->qdisc_list = qdisc;
-			write_unlock(&qdisc_tree_lock);
-
+			write_lock_bh(&qdisc_tree_lock);
+			list_add_tail(&qdisc->list, &dev->qdisc_list);
+			write_unlock_bh(&qdisc_tree_lock);
 		} else {
 			qdisc =  &noqueue_qdisc;
 		}
-		write_lock(&qdisc_tree_lock);
+		write_lock_bh(&qdisc_tree_lock);
 		dev->qdisc_sleeping = qdisc;
-		write_unlock(&qdisc_tree_lock);
+		write_unlock_bh(&qdisc_tree_lock);
 	}
 
 	spin_lock_bh(&dev->queue_lock);
@@ -498,13 +520,11 @@ void dev_deactivate(struct net_device *dev)
 
 void dev_init_scheduler(struct net_device *dev)
 {
-	write_lock(&qdisc_tree_lock);
-	spin_lock_bh(&dev->queue_lock);
+	qdisc_lock_tree(dev);
 	dev->qdisc = &noop_qdisc;
-	spin_unlock_bh(&dev->queue_lock);
 	dev->qdisc_sleeping = &noop_qdisc;
-	dev->qdisc_list = NULL;
-	write_unlock(&qdisc_tree_lock);
+	INIT_LIST_HEAD(&dev->qdisc_list);
+	qdisc_unlock_tree(dev);
 
 	dev_watchdog_init(dev);
 }
@@ -513,8 +533,7 @@ void dev_shutdown(struct net_device *dev)
 {
 	struct Qdisc *qdisc;
 
-	write_lock(&qdisc_tree_lock);
-	spin_lock_bh(&dev->queue_lock);
+	qdisc_lock_tree(dev);
 	qdisc = dev->qdisc_sleeping;
 	dev->qdisc = &noop_qdisc;
 	dev->qdisc_sleeping = &noop_qdisc;
@@ -525,11 +544,8 @@ void dev_shutdown(struct net_device *dev)
 		qdisc_destroy(qdisc);
         }
 #endif
-	BUG_TRAP(dev->qdisc_list == NULL);
 	BUG_TRAP(!timer_pending(&dev->watchdog_timer));
-	dev->qdisc_list = NULL;
-	spin_unlock_bh(&dev->queue_lock);
-	write_unlock(&qdisc_tree_lock);
+	qdisc_unlock_tree(dev);
 }
 
 EXPORT_SYMBOL(__netdev_watchdog_up);
@@ -539,4 +555,5 @@ EXPORT_SYMBOL(qdisc_create_dflt);
 EXPORT_SYMBOL(qdisc_destroy);
 EXPORT_SYMBOL(qdisc_reset);
 EXPORT_SYMBOL(qdisc_restart);
-EXPORT_SYMBOL(qdisc_tree_lock);
+EXPORT_SYMBOL(qdisc_lock_tree);
+EXPORT_SYMBOL(qdisc_unlock_tree);
diff --git a/net/sched/sch_gred.c b/net/sched/sch_gred.c
index f8a080062..375c6c2fb 100644
--- a/net/sched/sch_gred.c
+++ b/net/sched/sch_gred.c
@@ -106,7 +106,7 @@ gred_enqueue(struct sk_buff *skb, struct Qdisc* sch)
 {
 	psched_time_t now;
 	struct gred_sched_data *q=NULL;
-	struct gred_sched *t= (struct gred_sched *)sch->data;
+	struct gred_sched *t= qdisc_priv(sch);
 	unsigned long	qave=0;	
 	int i=0;
 
@@ -155,7 +155,7 @@ gred_enqueue(struct sk_buff *skb, struct Qdisc* sch)
 	if (!PSCHED_IS_PASTPERFECT(q->qidlestart)) {
 		long us_idle;
 		PSCHED_GET_TIME(now);
-		us_idle = PSCHED_TDIFF_SAFE(now, q->qidlestart, q->Scell_max, 0);
+		us_idle = PSCHED_TDIFF_SAFE(now, q->qidlestart, q->Scell_max);
 		PSCHED_SET_PASTPERFECT(q->qidlestart);
 
 		q->qave >>= q->Stab[(us_idle>>q->Scell_log)&0xFF];
@@ -215,7 +215,7 @@ static int
 gred_requeue(struct sk_buff *skb, struct Qdisc* sch)
 {
 	struct gred_sched_data *q;
-	struct gred_sched *t= (struct gred_sched *)sch->data;
+	struct gred_sched *t= qdisc_priv(sch);
 	q= t->tab[(skb->tc_index&0xf)];
 /* error checking here -- probably unnecessary */
 	PSCHED_SET_PASTPERFECT(q->qidlestart);
@@ -231,7 +231,7 @@ gred_dequeue(struct Qdisc* sch)
 {
 	struct sk_buff *skb;
 	struct gred_sched_data *q;
-	struct gred_sched *t= (struct gred_sched *)sch->data;
+	struct gred_sched *t= qdisc_priv(sch);
 
 	skb = __skb_dequeue(&sch->q);
 	if (skb) {
@@ -264,7 +264,7 @@ static unsigned int gred_drop(struct Qdisc* sch)
 	struct sk_buff *skb;
 
 	struct gred_sched_data *q;
-	struct gred_sched *t= (struct gred_sched *)sch->data;
+	struct gred_sched *t= qdisc_priv(sch);
 
 	skb = __skb_dequeue_tail(&sch->q);
 	if (skb) {
@@ -300,7 +300,7 @@ static void gred_reset(struct Qdisc* sch)
 {
 	int i;
 	struct gred_sched_data *q;
-	struct gred_sched *t= (struct gred_sched *)sch->data;
+	struct gred_sched *t= qdisc_priv(sch);
 
 	__skb_queue_purge(&sch->q);
 
@@ -323,7 +323,7 @@ static void gred_reset(struct Qdisc* sch)
 
 static int gred_change(struct Qdisc *sch, struct rtattr *opt)
 {
-	struct gred_sched *table = (struct gred_sched *)sch->data;
+	struct gred_sched *table = qdisc_priv(sch);
 	struct gred_sched_data *q;
 	struct tc_gred_qopt *ctl;
 	struct tc_gred_sopt *sopt;
@@ -469,7 +469,7 @@ static int gred_change(struct Qdisc *sch, struct rtattr *opt)
 
 static int gred_init(struct Qdisc *sch, struct rtattr *opt)
 {
-	struct gred_sched *table = (struct gred_sched *)sch->data;
+	struct gred_sched *table = qdisc_priv(sch);
 	struct tc_gred_sopt *sopt;
 	struct rtattr *tb[TCA_GRED_STAB];
 	struct rtattr *tb2[TCA_GRED_DPS];
@@ -502,7 +502,7 @@ static int gred_dump(struct Qdisc *sch, struct sk_buff *skb)
 	struct rtattr *rta;
 	struct tc_gred_qopt *opt = NULL ;
 	struct tc_gred_qopt *dst;
-	struct gred_sched *table = (struct gred_sched *)sch->data;
+	struct gred_sched *table = qdisc_priv(sch);
 	struct gred_sched_data *q;
 	int i;
 	unsigned char	 *b = skb->tail;
@@ -551,7 +551,7 @@ static int gred_dump(struct Qdisc *sch, struct sk_buff *skb)
 				long idle;
 				psched_time_t now;
 				PSCHED_GET_TIME(now);
-				idle = PSCHED_TDIFF_SAFE(now, q->qidlestart, q->Scell_max, 0);
+				idle = PSCHED_TDIFF_SAFE(now, q->qidlestart, q->Scell_max);
 				qave  = q->qave >> q->Stab[(idle>>q->Scell_log)&0xFF];
 				dst->qave = qave >> q->Wlog;
 
@@ -593,7 +593,7 @@ rtattr_failure:
 
 static void gred_destroy(struct Qdisc *sch)
 {
-	struct gred_sched *table = (struct gred_sched *)sch->data;
+	struct gred_sched *table = qdisc_priv(sch);
 	int i;
 
 	for (i = 0;i < table->DPs; i++) {
diff --git a/net/sched/sch_hfsc.c b/net/sched/sch_hfsc.c
index 151c841e6..84ef3ab6a 100644
--- a/net/sched/sch_hfsc.c
+++ b/net/sched/sch_hfsc.c
@@ -122,6 +122,7 @@ struct hfsc_class
 	unsigned int	refcnt;		/* usage count */
 
 	struct tc_stats	stats;		/* generic statistics */
+	spinlock_t	*stats_lock;
 	unsigned int	level;		/* class level in hierarchy */
 	struct tcf_proto *filter_list;	/* filter list */
 	unsigned int	filter_cnt;	/* filter count */
@@ -192,7 +193,7 @@ struct hfsc_sched
 /*
  * macros
  */
-#if PSCHED_CLOCK_SOURCE == PSCHED_GETTIMEOFDAY
+#ifdef CONFIG_NET_SCH_CLK_GETTIMEOFDAY
 #include <linux/time.h>
 #undef PSCHED_GET_TIME
 #define PSCHED_GET_TIME(stamp)						\
@@ -428,10 +429,10 @@ actlist_get_minvt(struct hfsc_class *cl, u64 cur_time)
  *	ism: (psched_us/byte) << ISM_SHIFT
  *	dx: psched_us
  *
- * Time source resolution
- *  PSCHED_JIFFIES: for 48<=HZ<=1534 resolution is between 0.63us and 1.27us.
- *  PSCHED_CPU: resolution is between 0.5us and 1us.
- *  PSCHED_GETTIMEOFDAY: resolution is exactly 1us.
+ * Clock source resolution (CONFIG_NET_SCH_CLK_*)
+ *  JIFFIES: for 48<=HZ<=1534 resolution is between 0.63us and 1.27us.
+ *  CPU: resolution is between 0.5us and 1us.
+ *  GETTIMEOFDAY: resolution is exactly 1us.
  *
  * sm and ism are scaled in order to keep effective digits.
  * SM_SHIFT and ISM_SHIFT are selected to keep at least 4 effective
@@ -1015,7 +1016,7 @@ hfsc_hash(u32 h)
 static inline struct hfsc_class *
 hfsc_find_class(u32 classid, struct Qdisc *sch)
 {
-	struct hfsc_sched *q = (struct hfsc_sched *)sch->data;
+	struct hfsc_sched *q = qdisc_priv(sch);
 	struct hfsc_class *cl;
 
 	list_for_each_entry(cl, &q->clhash[hfsc_hash(classid)], hlist) {
@@ -1060,7 +1061,7 @@ static int
 hfsc_change_class(struct Qdisc *sch, u32 classid, u32 parentid,
                   struct rtattr **tca, unsigned long *arg)
 {
-	struct hfsc_sched *q = (struct hfsc_sched *)sch->data;
+	struct hfsc_sched *q = qdisc_priv(sch);
 	struct hfsc_class *cl = (struct hfsc_class *)*arg;
 	struct hfsc_class *parent = NULL;
 	struct rtattr *opt = tca[TCA_OPTIONS-1];
@@ -1124,7 +1125,8 @@ hfsc_change_class(struct Qdisc *sch, u32 classid, u32 parentid,
 #ifdef CONFIG_NET_ESTIMATOR
 		if (tca[TCA_RATE-1]) {
 			qdisc_kill_estimator(&cl->stats);
-			qdisc_new_estimator(&cl->stats, tca[TCA_RATE-1]);
+			qdisc_new_estimator(&cl->stats, cl->stats_lock,
+					    tca[TCA_RATE-1]);
 		}
 #endif
 		return 0;
@@ -1167,7 +1169,7 @@ hfsc_change_class(struct Qdisc *sch, u32 classid, u32 parentid,
 	cl->qdisc = qdisc_create_dflt(sch->dev, &pfifo_qdisc_ops);
 	if (cl->qdisc == NULL)
 		cl->qdisc = &noop_qdisc;
-	cl->stats.lock = &sch->dev->queue_lock;
+	cl->stats_lock = &sch->dev->queue_lock;
 	INIT_LIST_HEAD(&cl->children);
 	INIT_LIST_HEAD(&cl->actlist);
 
@@ -1181,7 +1183,8 @@ hfsc_change_class(struct Qdisc *sch, u32 classid, u32 parentid,
 
 #ifdef CONFIG_NET_ESTIMATOR
 	if (tca[TCA_RATE-1])
-		qdisc_new_estimator(&cl->stats, tca[TCA_RATE-1]);
+		qdisc_new_estimator(&cl->stats, cl->stats_lock,
+				    tca[TCA_RATE-1]);
 #endif
 	*arg = (unsigned long)cl;
 	return 0;
@@ -1201,7 +1204,7 @@ hfsc_destroy_filters(struct tcf_proto **fl)
 static void
 hfsc_destroy_class(struct Qdisc *sch, struct hfsc_class *cl)
 {
-	struct hfsc_sched *q = (struct hfsc_sched *)sch->data;
+	struct hfsc_sched *q = qdisc_priv(sch);
 
 	hfsc_destroy_filters(&cl->filter_list);
 	qdisc_destroy(cl->qdisc);
@@ -1215,7 +1218,7 @@ hfsc_destroy_class(struct Qdisc *sch, struct hfsc_class *cl)
 static int
 hfsc_delete_class(struct Qdisc *sch, unsigned long arg)
 {
-	struct hfsc_sched *q = (struct hfsc_sched *)sch->data;
+	struct hfsc_sched *q = qdisc_priv(sch);
 	struct hfsc_class *cl = (struct hfsc_class *)arg;
 
 	if (cl->level > 0 || cl->filter_cnt > 0 || cl == &q->root)
@@ -1235,9 +1238,9 @@ hfsc_delete_class(struct Qdisc *sch, unsigned long arg)
 }
 
 static struct hfsc_class *
-hfsc_classify(struct sk_buff *skb, struct Qdisc *sch)
+hfsc_classify(struct sk_buff *skb, struct Qdisc *sch, int *qres)
 {
-	struct hfsc_sched *q = (struct hfsc_sched *)sch->data;
+	struct hfsc_sched *q = qdisc_priv(sch);
 	struct hfsc_class *cl;
 	struct tcf_result res;
 	struct tcf_proto *tcf;
@@ -1250,9 +1253,33 @@ hfsc_classify(struct sk_buff *skb, struct Qdisc *sch)
 
 	tcf = q->root.filter_list;
 	while (tcf && (result = tc_classify(skb, tcf, &res)) >= 0) {
+#ifdef CONFIG_NET_CLS_ACT
+		int terminal = 0;
+		switch (result) {
+		case TC_ACT_SHOT: 
+			*qres = NET_XMIT_DROP;
+			terminal = 1;
+			break;
+		case TC_ACT_QUEUED:
+		case TC_ACT_STOLEN: 
+			terminal = 1;
+			break;
+		case TC_ACT_RECLASSIFY: 
+		case TC_ACT_OK:
+		case TC_ACT_UNSPEC:
+		default:
+		break;
+		}
+
+		if (terminal) {
+			kfree_skb(skb);
+			return NULL;
+		}
+#else
 #ifdef CONFIG_NET_CLS_POLICE
 		if (result == TC_POLICE_SHOT)
 			return NULL;
+#endif
 #endif
 		if ((cl = (struct hfsc_class *)res.class) == NULL) {
 			if ((cl = hfsc_find_class(res.classid, sch)) == NULL)
@@ -1354,7 +1381,7 @@ hfsc_unbind_tcf(struct Qdisc *sch, unsigned long arg)
 static struct tcf_proto **
 hfsc_tcf_chain(struct Qdisc *sch, unsigned long arg)
 {
-	struct hfsc_sched *q = (struct hfsc_sched *)sch->data;
+	struct hfsc_sched *q = qdisc_priv(sch);
 	struct hfsc_class *cl = (struct hfsc_class *)arg;
 
 	if (cl == NULL)
@@ -1404,7 +1431,7 @@ static inline int
 hfsc_dump_stats(struct sk_buff *skb, struct hfsc_class *cl)
 {
 	cl->stats.qlen = cl->qdisc->q.qlen;
-	if (qdisc_copy_stats(skb, &cl->stats) < 0)
+	if (qdisc_copy_stats(skb, &cl->stats, cl->stats_lock) < 0)
 		goto rtattr_failure;
 
 	return skb->len;
@@ -1462,7 +1489,7 @@ hfsc_dump_class(struct Qdisc *sch, unsigned long arg, struct sk_buff *skb,
 static void
 hfsc_walk(struct Qdisc *sch, struct qdisc_walker *arg)
 {
-	struct hfsc_sched *q = (struct hfsc_sched *)sch->data;
+	struct hfsc_sched *q = qdisc_priv(sch);
 	struct hfsc_class *cl;
 	unsigned int i;
 
@@ -1496,7 +1523,7 @@ hfsc_watchdog(unsigned long arg)
 static void
 hfsc_schedule_watchdog(struct Qdisc *sch, u64 cur_time)
 {
-	struct hfsc_sched *q = (struct hfsc_sched *)sch->data;
+	struct hfsc_sched *q = qdisc_priv(sch);
 	struct hfsc_class *cl;
 	u64 next_time = 0;
 	long delay;
@@ -1518,7 +1545,7 @@ hfsc_schedule_watchdog(struct Qdisc *sch, u64 cur_time)
 static int
 hfsc_init_qdisc(struct Qdisc *sch, struct rtattr *opt)
 {
-	struct hfsc_sched *q = (struct hfsc_sched *)sch->data;
+	struct hfsc_sched *q = qdisc_priv(sch);
 	struct tc_hfsc_qopt *qopt;
 	unsigned int i;
 
@@ -1527,7 +1554,7 @@ hfsc_init_qdisc(struct Qdisc *sch, struct rtattr *opt)
 	qopt = RTA_DATA(opt);
 
 	memset(q, 0, sizeof(struct hfsc_sched));
-	sch->stats.lock = &sch->dev->queue_lock;
+	sch->stats_lock = &sch->dev->queue_lock;
 
 	q->defcls = qopt->defcls;
 	for (i = 0; i < HFSC_HSIZE; i++)
@@ -1542,7 +1569,7 @@ hfsc_init_qdisc(struct Qdisc *sch, struct rtattr *opt)
 	q->root.qdisc = qdisc_create_dflt(sch->dev, &pfifo_qdisc_ops);
 	if (q->root.qdisc == NULL)
 		q->root.qdisc = &noop_qdisc;
-	q->root.stats.lock = &sch->dev->queue_lock;
+	q->root.stats_lock = &sch->dev->queue_lock;
 	INIT_LIST_HEAD(&q->root.children);
 	INIT_LIST_HEAD(&q->root.actlist);
 
@@ -1558,7 +1585,7 @@ hfsc_init_qdisc(struct Qdisc *sch, struct rtattr *opt)
 static int
 hfsc_change_qdisc(struct Qdisc *sch, struct rtattr *opt)
 {
-	struct hfsc_sched *q = (struct hfsc_sched *)sch->data;
+	struct hfsc_sched *q = qdisc_priv(sch);
 	struct tc_hfsc_qopt *qopt;
 
 	if (opt == NULL || RTA_PAYLOAD(opt) < sizeof(*qopt))
@@ -1605,7 +1632,7 @@ hfsc_reset_class(struct hfsc_class *cl)
 static void
 hfsc_reset_qdisc(struct Qdisc *sch)
 {
-	struct hfsc_sched *q = (struct hfsc_sched *)sch->data;
+	struct hfsc_sched *q = qdisc_priv(sch);
 	struct hfsc_class *cl;
 	unsigned int i;
 
@@ -1624,7 +1651,7 @@ hfsc_reset_qdisc(struct Qdisc *sch)
 static void
 hfsc_destroy_qdisc(struct Qdisc *sch)
 {
-	struct hfsc_sched *q = (struct hfsc_sched *)sch->data;
+	struct hfsc_sched *q = qdisc_priv(sch);
 	struct hfsc_class *cl, *next;
 	unsigned int i;
 
@@ -1639,7 +1666,7 @@ hfsc_destroy_qdisc(struct Qdisc *sch)
 static int
 hfsc_dump_qdisc(struct Qdisc *sch, struct sk_buff *skb)
 {
-	struct hfsc_sched *q = (struct hfsc_sched *)sch->data;
+	struct hfsc_sched *q = qdisc_priv(sch);
 	unsigned char *b = skb->tail;
 	struct tc_hfsc_qopt qopt;
 
@@ -1647,7 +1674,7 @@ hfsc_dump_qdisc(struct Qdisc *sch, struct sk_buff *skb)
 	RTA_PUT(skb, TCA_OPTIONS, sizeof(qopt), &qopt);
 
 	sch->stats.qlen = sch->q.qlen;
-	if (qdisc_copy_stats(skb, &sch->stats) < 0)
+	if (qdisc_copy_stats(skb, &sch->stats, sch->stats_lock) < 0)
 		goto rtattr_failure;
 
 	return skb->len;
@@ -1660,15 +1687,26 @@ hfsc_dump_qdisc(struct Qdisc *sch, struct sk_buff *skb)
 static int
 hfsc_enqueue(struct sk_buff *skb, struct Qdisc *sch)
 {
-	struct hfsc_class *cl = hfsc_classify(skb, sch);
+	int ret = NET_XMIT_SUCCESS;
+	struct hfsc_class *cl = hfsc_classify(skb, sch, &ret);
 	unsigned int len = skb->len;
 	int err;
 
+
+#ifdef CONFIG_NET_CLS_ACT
+	if (cl == NULL) {
+		if (NET_XMIT_DROP == ret) {
+			sch->stats.drops++;
+		}
+		return ret;
+	}
+#else
 	if (cl == NULL) {
 		kfree_skb(skb);
 		sch->stats.drops++;
 		return NET_XMIT_DROP;
 	}
+#endif
 
 	err = cl->qdisc->enqueue(skb, cl->qdisc);
 	if (unlikely(err != NET_XMIT_SUCCESS)) {
@@ -1692,7 +1730,7 @@ hfsc_enqueue(struct sk_buff *skb, struct Qdisc *sch)
 static struct sk_buff *
 hfsc_dequeue(struct Qdisc *sch)
 {
-	struct hfsc_sched *q = (struct hfsc_sched *)sch->data;
+	struct hfsc_sched *q = qdisc_priv(sch);
 	struct hfsc_class *cl;
 	struct sk_buff *skb;
 	u64 cur_time;
@@ -1721,8 +1759,7 @@ hfsc_dequeue(struct Qdisc *sch)
 		cl = actlist_get_minvt(&q->root, cur_time);
 		if (cl == NULL) {
 			sch->stats.overlimits++;
-			if (!netif_queue_stopped(sch->dev))
-				hfsc_schedule_watchdog(sch, cur_time);
+			hfsc_schedule_watchdog(sch, cur_time);
 			return NULL;
 		}
 	}
@@ -1762,7 +1799,7 @@ hfsc_dequeue(struct Qdisc *sch)
 static int
 hfsc_requeue(struct sk_buff *skb, struct Qdisc *sch)
 {
-	struct hfsc_sched *q = (struct hfsc_sched *)sch->data;
+	struct hfsc_sched *q = qdisc_priv(sch);
 
 	__skb_queue_head(&q->requeue, skb);
 	sch->q.qlen++;
@@ -1772,7 +1809,7 @@ hfsc_requeue(struct sk_buff *skb, struct Qdisc *sch)
 static unsigned int
 hfsc_drop(struct Qdisc *sch)
 {
-	struct hfsc_sched *q = (struct hfsc_sched *)sch->data;
+	struct hfsc_sched *q = qdisc_priv(sch);
 	struct hfsc_class *cl;
 	unsigned int len;
 
diff --git a/net/sched/sch_htb.c b/net/sched/sch_htb.c
index a9e5c8c8b..d07dfd8b5 100644
--- a/net/sched/sch_htb.c
+++ b/net/sched/sch_htb.c
@@ -76,7 +76,7 @@
 #define HTB_HYSTERESIS 1/* whether to use mode hysteresis for speedup */
 #define HTB_QLOCK(S) spin_lock_bh(&(S)->dev->queue_lock)
 #define HTB_QUNLOCK(S) spin_unlock_bh(&(S)->dev->queue_lock)
-#define HTB_VER 0x30010	/* major must be matched with number suplied by TC as version */
+#define HTB_VER 0x30011	/* major must be matched with number suplied by TC as version */
 
 #if HTB_VER >> 16 != TC_HTB_PROTOVER
 #error "Mismatched sch_htb.c and pkt_sch.h"
@@ -143,6 +143,7 @@ struct htb_class
     /* general class parameters */
     u32 classid;
     struct tc_stats	stats;	/* generic stats */
+    spinlock_t		*stats_lock;
     struct tc_htb_xstats xstats;/* our special stats */
     int refcnt;			/* usage count of this class */
 
@@ -171,6 +172,11 @@ struct htb_class
 	    struct htb_class_inner {
 		    struct rb_root feed[TC_HTB_NUMPRIO]; /* feed trees */
 		    struct rb_node *ptr[TC_HTB_NUMPRIO]; /* current class ptr */
+            /* When class changes from state 1->2 and disconnects from 
+               parent's feed then we lost ptr value and start from the
+              first child again. Here we store classid of the
+              last valid ptr (used when ptr is NULL). */
+              u32 last_ptr_id[TC_HTB_NUMPRIO];
 	    } inner;
     } un;
     struct rb_node node[TC_HTB_NUMPRIO]; /* node for self or feed tree */
@@ -217,6 +223,7 @@ struct htb_sched
     struct rb_root row[TC_HTB_MAXDEPTH][TC_HTB_NUMPRIO];
     int row_mask[TC_HTB_MAXDEPTH];
     struct rb_node *ptr[TC_HTB_MAXDEPTH][TC_HTB_NUMPRIO];
+    u32 last_ptr_id[TC_HTB_MAXDEPTH][TC_HTB_NUMPRIO];
 
     /* self wait list - roots of wait PQs per row */
     struct rb_root wait_pq[TC_HTB_MAXDEPTH];
@@ -266,7 +273,7 @@ static __inline__ int htb_hash(u32 h)
 /* find class in global hash table using given handle */
 static __inline__ struct htb_class *htb_find(u32 handle, struct Qdisc *sch)
 {
-	struct htb_sched *q = (struct htb_sched *)sch->data;
+	struct htb_sched *q = qdisc_priv(sch);
 	struct list_head *p;
 	if (TC_H_MAJ(handle) != sch->handle) 
 		return NULL;
@@ -297,9 +304,9 @@ static inline u32 htb_classid(struct htb_class *cl)
 	return (cl && cl != HTB_DIRECT) ? cl->classid : TC_H_UNSPEC;
 }
 
-static struct htb_class *htb_classify(struct sk_buff *skb, struct Qdisc *sch)
+static struct htb_class *htb_classify(struct sk_buff *skb, struct Qdisc *sch, int *qres)
 {
-	struct htb_sched *q = (struct htb_sched *)sch->data;
+	struct htb_sched *q = qdisc_priv(sch);
 	struct htb_class *cl;
 	struct tcf_result res;
 	struct tcf_proto *tcf;
@@ -315,9 +322,33 @@ static struct htb_class *htb_classify(struct sk_buff *skb, struct Qdisc *sch)
 
 	tcf = q->filter_list;
 	while (tcf && (result = tc_classify(skb, tcf, &res)) >= 0) {
+#ifdef CONFIG_NET_CLS_ACT
+		int terminal = 0;
+		switch (result) {
+		case TC_ACT_SHOT: /* Stop and kfree */
+			*qres = NET_XMIT_DROP;
+			terminal = 1;
+			break;
+		case TC_ACT_QUEUED:
+		case TC_ACT_STOLEN: 
+			terminal = 1;
+			break;
+		case TC_ACT_RECLASSIFY:  /* Things look good */
+		case TC_ACT_OK:
+		case TC_ACT_UNSPEC:
+		default:
+		break;
+		}
+
+		if (terminal) {
+			kfree_skb(skb);
+			return NULL;
+		}
+#else
 #ifdef CONFIG_NET_CLS_POLICE
 		if (result == TC_POLICE_SHOT)
 			return NULL;
+#endif
 #endif
 		if ((cl = (void*)res.class) == NULL) {
 			if (res.classid == sch->handle)
@@ -367,7 +398,7 @@ static void htb_debug_dump (struct htb_sched *q)
 		struct list_head *l;
 		list_for_each (l,q->hash+i) {
 			struct htb_class *cl = list_entry(l,struct htb_class,hlist);
-			long diff = PSCHED_TDIFF_SAFE(q->now, cl->t_c, (u32)cl->mbuffer, 0);
+			long diff = PSCHED_TDIFF_SAFE(q->now, cl->t_c, (u32)cl->mbuffer);
 			printk(KERN_DEBUG "htb*c%x m=%d t=%ld c=%ld pq=%lu df=%ld ql=%d "
 					"pa=%x f:",
 				cl->classid,cl->cmode,cl->tokens,cl->ctokens,
@@ -567,8 +598,13 @@ static void htb_deactivate_prios(struct htb_sched *q, struct htb_class *cl)
 			int prio = ffz(~m);
 			m &= ~(1 << prio);
 			
-			if (p->un.inner.ptr[prio] == cl->node+prio)
-				htb_next_rb_node(p->un.inner.ptr + prio);
+			if (p->un.inner.ptr[prio] == cl->node+prio) {
+				/* we are removing child which is pointed to from
+				   parent feed - forget the pointer but remember
+				   classid */
+				p->un.inner.last_ptr_id[prio] = cl->classid;
+				p->un.inner.ptr[prio] = NULL;
+			}
 			
 			htb_safe_rb_erase(cl->node + prio,p->un.inner.feed + prio);
 			
@@ -686,9 +722,24 @@ htb_deactivate(struct htb_sched *q,struct htb_class *cl)
 
 static int htb_enqueue(struct sk_buff *skb, struct Qdisc *sch)
 {
-    struct htb_sched *q = (struct htb_sched *)sch->data;
-    struct htb_class *cl = htb_classify(skb,sch);
+    int ret = NET_XMIT_SUCCESS;
+    struct htb_sched *q = qdisc_priv(sch);
+    struct htb_class *cl = htb_classify(skb,sch,&ret);
+
 
+#ifdef CONFIG_NET_CLS_ACT
+    if (cl == HTB_DIRECT ) {
+	if (q->direct_queue.qlen < q->direct_qlen ) {
+	    __skb_queue_tail(&q->direct_queue, skb);
+	    q->direct_pkts++;
+	}
+    } else if (!cl) {
+	    if (NET_XMIT_DROP == ret) {
+		    sch->stats.drops++;
+	    }
+	    return ret;
+    }
+#else
     if (cl == HTB_DIRECT || !cl) {
 	/* enqueue to helper queue */
 	if (q->direct_queue.qlen < q->direct_qlen && cl) {
@@ -699,7 +750,9 @@ static int htb_enqueue(struct sk_buff *skb, struct Qdisc *sch)
 	    sch->stats.drops++;
 	    return NET_XMIT_DROP;
 	}
-    } else if (cl->un.leaf.q->enqueue(skb, cl->un.leaf.q) != NET_XMIT_SUCCESS) {
+    }
+#endif
+    else if (cl->un.leaf.q->enqueue(skb, cl->un.leaf.q) != NET_XMIT_SUCCESS) {
 	sch->stats.drops++;
 	cl->stats.drops++;
 	return NET_XMIT_DROP;
@@ -717,8 +770,9 @@ static int htb_enqueue(struct sk_buff *skb, struct Qdisc *sch)
 /* TODO: requeuing packet charges it to policers again !! */
 static int htb_requeue(struct sk_buff *skb, struct Qdisc *sch)
 {
-    struct htb_sched *q = (struct htb_sched *)sch->data;
-    struct htb_class *cl = htb_classify(skb,sch);
+    struct htb_sched *q = qdisc_priv(sch);
+    int ret =  NET_XMIT_SUCCESS;
+    struct htb_class *cl = htb_classify(skb,sch, &ret);
     struct sk_buff *tskb;
 
     if (cl == HTB_DIRECT || !cl) {
@@ -757,7 +811,7 @@ static void htb_timer(unsigned long arg)
 static void htb_rate_timer(unsigned long arg)
 {
 	struct Qdisc *sch = (struct Qdisc*)arg;
-	struct htb_sched *q = (struct htb_sched *)sch->data;
+	struct htb_sched *q = qdisc_priv(sch);
 	struct list_head *p;
 
 	/* lock queue so that we can muck with it */
@@ -807,14 +861,19 @@ static void htb_charge_class(struct htb_sched *q,struct htb_class *cl,
 
 	while (cl) {
 		HTB_CHCL(cl);
-		diff = PSCHED_TDIFF_SAFE(q->now, cl->t_c, (u32)cl->mbuffer, 0);
+		diff = PSCHED_TDIFF_SAFE(q->now, cl->t_c, (u32)cl->mbuffer);
 #ifdef HTB_DEBUG
 		if (diff > cl->mbuffer || diff < 0 || PSCHED_TLESS(q->now, cl->t_c)) {
 			if (net_ratelimit())
 				printk(KERN_ERR "HTB: bad diff in charge, cl=%X diff=%lX now=%Lu then=%Lu j=%lu\n",
 				       cl->classid, diff,
+#ifdef CONFIG_NET_SCH_CLK_GETTIMEOFDAY
+				       q->now.tv_sec * 1000000ULL + q->now.tv_usec,
+				       cl->t_c.tv_sec * 1000000ULL + cl->t_c.tv_usec,
+#else
 				       (unsigned long long) q->now,
 				       (unsigned long long) cl->t_c,
+#endif
 				       q->jiffies);
 			diff = 1000;
 		}
@@ -878,14 +937,19 @@ static long htb_do_events(struct htb_sched *q,int level)
 			return cl->pq_key - q->jiffies;
 		}
 		htb_safe_rb_erase(p,q->wait_pq+level);
-		diff = PSCHED_TDIFF_SAFE(q->now, cl->t_c, (u32)cl->mbuffer, 0);
+		diff = PSCHED_TDIFF_SAFE(q->now, cl->t_c, (u32)cl->mbuffer);
 #ifdef HTB_DEBUG
 		if (diff > cl->mbuffer || diff < 0 || PSCHED_TLESS(q->now, cl->t_c)) {
 			if (net_ratelimit())
 				printk(KERN_ERR "HTB: bad diff in events, cl=%X diff=%lX now=%Lu then=%Lu j=%lu\n",
 				       cl->classid, diff,
+#ifdef CONFIG_NET_SCH_CLK_GETTIMEOFDAY
+				       q->now.tv_sec * 1000000ULL + q->now.tv_usec,
+				       cl->t_c.tv_sec * 1000000ULL + cl->t_c.tv_usec,
+#else
 				       (unsigned long long) q->now,
 				       (unsigned long long) cl->t_c,
+#endif
 				       q->jiffies);
 			diff = 1000;
 		}
@@ -899,25 +963,56 @@ static long htb_do_events(struct htb_sched *q,int level)
 	return HZ/10;
 }
 
+/* Returns class->node+prio from id-tree where classe's id is >= id. NULL
+   is no such one exists. */
+static struct rb_node *
+htb_id_find_next_upper(int prio,struct rb_node *n,u32 id)
+{
+	struct rb_node *r = NULL;
+	while (n) {
+		struct htb_class *cl = rb_entry(n,struct htb_class,node[prio]);
+		if (id == cl->classid) return n;
+		
+		if (id > cl->classid) {
+			n = n->rb_right;
+		} else {
+			r = n;
+			n = n->rb_left;
+		}
+	}
+	return r;
+}
+
 /**
  * htb_lookup_leaf - returns next leaf class in DRR order
  *
  * Find leaf where current feed pointers points to.
  */
 static struct htb_class *
-htb_lookup_leaf(struct rb_root *tree,int prio,struct rb_node **pptr)
+htb_lookup_leaf(HTB_ARGQ struct rb_root *tree,int prio,struct rb_node **pptr,u32 *pid)
 {
 	int i;
 	struct {
 		struct rb_node *root;
 		struct rb_node **pptr;
+		u32 *pid;
 	} stk[TC_HTB_MAXDEPTH],*sp = stk;
 	
 	BUG_TRAP(tree->rb_node);
 	sp->root = tree->rb_node;
 	sp->pptr = pptr;
+	sp->pid = pid;
 
 	for (i = 0; i < 65535; i++) {
+		HTB_DBG(4,2,"htb_lleaf ptr=%p pid=%X\n",*sp->pptr,*sp->pid);
+		
+		if (!*sp->pptr && *sp->pid) { 
+			/* ptr was invalidated but id is valid - try to recover 
+			   the original or next ptr */
+			*sp->pptr = htb_id_find_next_upper(prio,sp->root,*sp->pid);
+		}
+		*sp->pid = 0; /* ptr is valid now so that remove this hint as it
+			         can become out of date quickly */
 		if (!*sp->pptr) { /* we are at right end; rewind & go up */
 			*sp->pptr = sp->root;
 			while ((*sp->pptr)->rb_left) 
@@ -935,6 +1030,7 @@ htb_lookup_leaf(struct rb_root *tree,int prio,struct rb_node **pptr)
 				return cl;
 			(++sp)->root = cl->un.inner.feed[prio].rb_node;
 			sp->pptr = cl->un.inner.ptr+prio;
+			sp->pid = cl->un.inner.last_ptr_id+prio;
 		}
 	}
 	BUG_TRAP(0);
@@ -949,7 +1045,8 @@ htb_dequeue_tree(struct htb_sched *q,int prio,int level)
 	struct sk_buff *skb = NULL;
 	struct htb_class *cl,*start;
 	/* look initial class up in the row */
-	start = cl = htb_lookup_leaf (q->row[level]+prio,prio,q->ptr[level]+prio);
+	start = cl = htb_lookup_leaf (HTB_PASSQ q->row[level]+prio,prio,
+			q->ptr[level]+prio,q->last_ptr_id[level]+prio);
 	
 	do {
 next:
@@ -970,8 +1067,9 @@ next:
 			if ((q->row_mask[level] & (1 << prio)) == 0)
 				return NULL; 
 			
-			next = htb_lookup_leaf (q->row[level]+prio,
-					prio,q->ptr[level]+prio);
+			next = htb_lookup_leaf (HTB_PASSQ q->row[level]+prio,
+					prio,q->ptr[level]+prio,q->last_ptr_id[level]+prio);
+
 			if (cl == start) /* fix start if we just deleted it */
 				start = next;
 			cl = next;
@@ -986,7 +1084,9 @@ next:
 		}
 		q->nwc_hit++;
 		htb_next_rb_node((level?cl->parent->un.inner.ptr:q->ptr[0])+prio);
-		cl = htb_lookup_leaf (q->row[level]+prio,prio,q->ptr[level]+prio);
+		cl = htb_lookup_leaf (HTB_PASSQ q->row[level]+prio,prio,q->ptr[level]+prio,
+				q->last_ptr_id[level]+prio);
+
 	} while (cl != start);
 
 	if (likely(skb != NULL)) {
@@ -1007,8 +1107,7 @@ next:
 
 static void htb_delay_by(struct Qdisc *sch,long delay)
 {
-	struct htb_sched *q = (struct htb_sched *)sch->data;
-	if (netif_queue_stopped(sch->dev)) return;
+	struct htb_sched *q = qdisc_priv(sch);
 	if (delay <= 0) delay = 1;
 	if (unlikely(delay > 5*HZ)) {
 		if (net_ratelimit())
@@ -1025,7 +1124,7 @@ static void htb_delay_by(struct Qdisc *sch,long delay)
 static struct sk_buff *htb_dequeue(struct Qdisc *sch)
 {
 	struct sk_buff *skb = NULL;
-	struct htb_sched *q = (struct htb_sched *)sch->data;
+	struct htb_sched *q = qdisc_priv(sch);
 	int level;
 	long min_delay;
 #ifdef HTB_DEBUG
@@ -1095,7 +1194,7 @@ fin:
 /* try to drop from each class (by prio) until one succeed */
 static unsigned int htb_drop(struct Qdisc* sch)
 {
-	struct htb_sched *q = (struct htb_sched *)sch->data;
+	struct htb_sched *q = qdisc_priv(sch);
 	int prio;
 
 	for (prio = TC_HTB_NUMPRIO - 1; prio >= 0; prio--) {
@@ -1120,7 +1219,7 @@ static unsigned int htb_drop(struct Qdisc* sch)
 /* always caled under BH & queue lock */
 static void htb_reset(struct Qdisc* sch)
 {
-	struct htb_sched *q = (struct htb_sched *)sch->data;
+	struct htb_sched *q = qdisc_priv(sch);
 	int i;
 	HTB_DBG(0,1,"htb_reset sch=%p, handle=%X\n",sch,sch->handle);
 
@@ -1158,7 +1257,7 @@ static void htb_reset(struct Qdisc* sch)
 
 static int htb_init(struct Qdisc *sch, struct rtattr *opt)
 {
-	struct htb_sched *q = (struct htb_sched*)sch->data;
+	struct htb_sched *q = qdisc_priv(sch);
 	struct rtattr *tb[TCA_HTB_INIT];
 	struct tc_htb_glob *gopt;
 	int i;
@@ -1213,7 +1312,7 @@ static int htb_init(struct Qdisc *sch, struct rtattr *opt)
 
 static int htb_dump(struct Qdisc *sch, struct sk_buff *skb)
 {
-	struct htb_sched *q = (struct htb_sched*)sch->data;
+	struct htb_sched *q = qdisc_priv(sch);
 	unsigned char	 *b = skb->tail;
 	struct rtattr *rta;
 	struct tc_htb_glob gopt;
@@ -1248,7 +1347,7 @@ static int htb_dump_class(struct Qdisc *sch, unsigned long arg,
 	struct sk_buff *skb, struct tcmsg *tcm)
 {
 #ifdef HTB_DEBUG
-	struct htb_sched *q = (struct htb_sched*)sch->data;
+	struct htb_sched *q = qdisc_priv(sch);
 #endif
 	struct htb_class *cl = (struct htb_class*)arg;
 	unsigned char	 *b = skb->tail;
@@ -1306,7 +1405,7 @@ static int htb_graft(struct Qdisc *sch, unsigned long arg, struct Qdisc *new,
 		sch_tree_lock(sch);
 		if ((*old = xchg(&cl->un.leaf.q, new)) != NULL) {
 			if (cl->prio_activity)
-				htb_deactivate ((struct htb_sched*)sch->data,cl);
+				htb_deactivate (qdisc_priv(sch),cl);
 
 			/* TODO: is it correct ? Why CBQ doesn't do it ? */
 			sch->q.qlen -= (*old)->q.qlen;	
@@ -1327,7 +1426,7 @@ static struct Qdisc * htb_leaf(struct Qdisc *sch, unsigned long arg)
 static unsigned long htb_get(struct Qdisc *sch, u32 classid)
 {
 #ifdef HTB_DEBUG
-	struct htb_sched *q = (struct htb_sched *)sch->data;
+	struct htb_sched *q = qdisc_priv(sch);
 #endif
 	struct htb_class *cl = htb_find(classid,sch);
 	HTB_DBG(0,1,"htb_get clid=%X q=%p cl=%p ref=%d\n",classid,q,cl,cl?cl->refcnt:0);
@@ -1348,7 +1447,7 @@ static void htb_destroy_filters(struct tcf_proto **fl)
 
 static void htb_destroy_class(struct Qdisc* sch,struct htb_class *cl)
 {
-	struct htb_sched *q = (struct htb_sched *)sch->data;
+	struct htb_sched *q = qdisc_priv(sch);
 	HTB_DBG(0,1,"htb_destrycls clid=%X ref=%d\n", cl?cl->classid:0,cl?cl->refcnt:0);
 	if (!cl->level) {
 		BUG_TRAP(cl->un.leaf.q);
@@ -1383,7 +1482,7 @@ static void htb_destroy_class(struct Qdisc* sch,struct htb_class *cl)
 /* always caled under BH & queue lock */
 static void htb_destroy(struct Qdisc* sch)
 {
-	struct htb_sched *q = (struct htb_sched *)sch->data;
+	struct htb_sched *q = qdisc_priv(sch);
 	HTB_DBG(0,1,"htb_destroy q=%p\n",q);
 
 	del_timer_sync (&q->timer);
@@ -1405,7 +1504,7 @@ static void htb_destroy(struct Qdisc* sch)
 
 static int htb_delete(struct Qdisc *sch, unsigned long arg)
 {
-	struct htb_sched *q = (struct htb_sched *)sch->data;
+	struct htb_sched *q = qdisc_priv(sch);
 	struct htb_class *cl = (struct htb_class*)arg;
 	HTB_DBG(0,1,"htb_delete q=%p cl=%X ref=%d\n",q,cl?cl->classid:0,cl?cl->refcnt:0);
 
@@ -1432,7 +1531,7 @@ static int htb_delete(struct Qdisc *sch, unsigned long arg)
 static void htb_put(struct Qdisc *sch, unsigned long arg)
 {
 #ifdef HTB_DEBUG
-	struct htb_sched *q = (struct htb_sched *)sch->data;
+	struct htb_sched *q = qdisc_priv(sch);
 #endif
 	struct htb_class *cl = (struct htb_class*)arg;
 	HTB_DBG(0,1,"htb_put q=%p cl=%X ref=%d\n",q,cl?cl->classid:0,cl?cl->refcnt:0);
@@ -1445,7 +1544,7 @@ static int htb_change_class(struct Qdisc *sch, u32 classid,
 		u32 parentid, struct rtattr **tca, unsigned long *arg)
 {
 	int err = -EINVAL;
-	struct htb_sched *q = (struct htb_sched *)sch->data;
+	struct htb_sched *q = qdisc_priv(sch);
 	struct htb_class *cl = (struct htb_class*)*arg,*parent;
 	struct rtattr *opt = tca[TCA_OPTIONS-1];
 	struct qdisc_rate_table *rtab = NULL, *ctab = NULL;
@@ -1571,7 +1670,7 @@ failure:
 
 static struct tcf_proto **htb_find_tcf(struct Qdisc *sch, unsigned long arg)
 {
-	struct htb_sched *q = (struct htb_sched *)sch->data;
+	struct htb_sched *q = qdisc_priv(sch);
 	struct htb_class *cl = (struct htb_class *)arg;
 	struct tcf_proto **fl = cl ? &cl->filter_list : &q->filter_list;
 	HTB_DBG(0,2,"htb_tcf q=%p clid=%X fref=%d fl=%p\n",q,cl?cl->classid:0,cl?cl->filter_cnt:q->filter_cnt,*fl);
@@ -1581,7 +1680,7 @@ static struct tcf_proto **htb_find_tcf(struct Qdisc *sch, unsigned long arg)
 static unsigned long htb_bind_filter(struct Qdisc *sch, unsigned long parent,
 	u32 classid)
 {
-	struct htb_sched *q = (struct htb_sched *)sch->data;
+	struct htb_sched *q = qdisc_priv(sch);
 	struct htb_class *cl = htb_find (classid,sch);
 	HTB_DBG(0,2,"htb_bind q=%p clid=%X cl=%p fref=%d\n",q,classid,cl,cl?cl->filter_cnt:q->filter_cnt);
 	/*if (cl && !cl->level) return 0;
@@ -1602,7 +1701,7 @@ static unsigned long htb_bind_filter(struct Qdisc *sch, unsigned long parent,
 
 static void htb_unbind_filter(struct Qdisc *sch, unsigned long arg)
 {
-	struct htb_sched *q = (struct htb_sched *)sch->data;
+	struct htb_sched *q = qdisc_priv(sch);
 	struct htb_class *cl = (struct htb_class *)arg;
 	HTB_DBG(0,2,"htb_unbind q=%p cl=%p fref=%d\n",q,cl,cl?cl->filter_cnt:q->filter_cnt);
 	if (cl) 
@@ -1613,7 +1712,7 @@ static void htb_unbind_filter(struct Qdisc *sch, unsigned long arg)
 
 static void htb_walk(struct Qdisc *sch, struct qdisc_walker *arg)
 {
-	struct htb_sched *q = (struct htb_sched *)sch->data;
+	struct htb_sched *q = qdisc_priv(sch);
 	int i;
 
 	if (arg->stop)
diff --git a/net/sched/sch_ingress.c b/net/sched/sch_ingress.c
index 37eb5df8f..30f2176b9 100644
--- a/net/sched/sch_ingress.c
+++ b/net/sched/sch_ingress.c
@@ -40,12 +40,16 @@
 #endif
 
 
-#define PRIV(sch) ((struct ingress_qdisc_data *) (sch)->data)
+#define PRIV(sch) qdisc_priv(sch)
 
 
 /* Thanks to Doron Oz for this hack
 */
+#ifndef CONFIG_NET_CLS_ACT
+#ifdef CONFIG_NETFILTER
 static int nf_registered; 
+#endif
+#endif
 
 struct ingress_qdisc_data {
 	struct Qdisc		*q;
@@ -146,27 +150,52 @@ static int ingress_enqueue(struct sk_buff *skb,struct Qdisc *sch)
 	 * Unlike normal "enqueue" functions, ingress_enqueue returns a
 	 * firewall FW_* code.
 	 */
-#ifdef CONFIG_NET_CLS_POLICE
+#ifdef CONFIG_NET_CLS_ACT
+	sch->stats.packets++;
+	sch->stats.bytes += skb->len;
 	switch (result) {
-		case TC_POLICE_SHOT:
-			result = NF_DROP;
+		case TC_ACT_SHOT:
+			result = TC_ACT_SHOT;
 			sch->stats.drops++;
 			break;
+		case TC_ACT_STOLEN:
+		case TC_ACT_QUEUED:
+			result = TC_ACT_STOLEN;
+			break;
+		case TC_ACT_RECLASSIFY: 
+		case TC_ACT_OK:
+		case TC_ACT_UNSPEC:
+		default:
+			skb->tc_index = TC_H_MIN(res.classid);
+			result = TC_ACT_OK;
+			break;
+	};
+/* backward compat */
+#else
+#ifdef	CONFIG_NET_CLS_POLICE  
+	switch (result) {
+		case TC_POLICE_SHOT:
+		result = NF_DROP;
+		sch->stats.drops++;
+		break;
 		case TC_POLICE_RECLASSIFY: /* DSCP remarking here ? */
 		case TC_POLICE_OK:
 		case TC_POLICE_UNSPEC:
 		default:
-			sch->stats.packets++;
-			sch->stats.bytes += skb->len;
-			result = NF_ACCEPT;
-			break;
+		sch->stats.packets++;
+		sch->stats.bytes += skb->len;
+		result = NF_ACCEPT;
+		break;
 	};
+
 #else
+	D2PRINTK("Overriding result to ACCEPT\n");
+	result = NF_ACCEPT;
 	sch->stats.packets++;
 	sch->stats.bytes += skb->len;
+#endif
 #endif
 
-	skb->tc_index = TC_H_MIN(res.classid);
 	return result;
 }
 
@@ -199,6 +228,8 @@ static unsigned int ingress_drop(struct Qdisc *sch)
 	return 0;
 }
 
+#ifndef CONFIG_NET_CLS_ACT
+#ifdef CONFIG_NETFILTER
 static unsigned int
 ing_hook(unsigned int hook, struct sk_buff **pskb,
                              const struct net_device *indev,
@@ -240,10 +271,29 @@ static struct nf_hook_ops ing_ops = {
 	.priority       = NF_IP_PRI_FILTER + 1,
 };
 
+#endif
+#endif
+
 int ingress_init(struct Qdisc *sch,struct rtattr *opt)
 {
 	struct ingress_qdisc_data *p = PRIV(sch);
 
+/* Make sure either netfilter or preferably CLS_ACT is
+* compiled in */
+#ifndef CONFIG_NET_CLS_ACT
+#ifndef CONFIG_NETFILTER
+	printk("You MUST compile classifier actions into the kernel\n");
+	goto error;
+#else
+	printk("Ingress scheduler: Classifier actions prefered over netfilter\n");
+#endif
+#endif
+                                                                                
+	if (NULL == p)
+		goto error;
+
+#ifndef CONFIG_NET_CLS_ACT
+#ifdef CONFIG_NETFILTER
 	if (!nf_registered) {
 		if (nf_register_hook(&ing_ops) < 0) {
 			printk("ingress qdisc registration error \n");
@@ -251,6 +301,8 @@ int ingress_init(struct Qdisc *sch,struct rtattr *opt)
 		}
 		nf_registered++;
 	}
+#endif
+#endif
 
 	DPRINTK("ingress_init(sch %p,[qdisc %p],opt %p)\n",sch,p,opt);
 	memset(p, 0, sizeof(*p));
@@ -364,8 +416,12 @@ static int __init ingress_module_init(void)
 static void __exit ingress_module_exit(void) 
 {
 	unregister_qdisc(&ingress_qdisc_ops);
+#ifndef CONFIG_NET_CLS_ACT
+#ifdef CONFIG_NETFILTER
 	if (nf_registered)
 		nf_unregister_hook(&ing_ops);
+#endif
+#endif
 }
 module_init(ingress_module_init)
 module_exit(ingress_module_exit)
diff --git a/net/sched/sch_netem.c b/net/sched/sch_netem.c
index 70a3e8ec8..4d91d697b 100644
--- a/net/sched/sch_netem.c
+++ b/net/sched/sch_netem.c
@@ -603,7 +603,7 @@ static inline int tabledist(int mu, int sigma)
  */
 static int netem_enqueue(struct sk_buff *skb, struct Qdisc *sch)
 {
-	struct netem_sched_data *q = (struct netem_sched_data *)sch->data;
+	struct netem_sched_data *q = qdisc_priv(sch);
 	struct netem_skb_cb *cb = (struct netem_skb_cb *)skb->cb;
 	psched_time_t now;
 	long delay;
@@ -643,17 +643,23 @@ static int netem_enqueue(struct sk_buff *skb, struct Qdisc *sch)
 	PSCHED_TADD2(now, delay, cb->time_to_send);
 	
 	/* Always queue at tail to keep packets in order */
-	__skb_queue_tail(&q->delayed, skb);
-	sch->q.qlen++;
-	sch->stats.bytes += skb->len;
-	sch->stats.packets++;
-	return 0;
+	if (likely(q->delayed.qlen < q->limit)) {
+		__skb_queue_tail(&q->delayed, skb);
+		sch->q.qlen++;
+		sch->stats.bytes += skb->len;
+		sch->stats.packets++;
+		return 0;
+	}
+
+	sch->stats.drops++;
+	kfree_skb(skb);
+	return NET_XMIT_DROP;
 }
 
 /* Requeue packets but don't change time stamp */
 static int netem_requeue(struct sk_buff *skb, struct Qdisc *sch)
 {
-	struct netem_sched_data *q = (struct netem_sched_data *)sch->data;
+	struct netem_sched_data *q = qdisc_priv(sch);
 	int ret;
 
 	if ((ret = q->qdisc->ops->requeue(skb, q->qdisc)) == 0)
@@ -664,7 +670,7 @@ static int netem_requeue(struct sk_buff *skb, struct Qdisc *sch)
 
 static unsigned int netem_drop(struct Qdisc* sch)
 {
-	struct netem_sched_data *q = (struct netem_sched_data *)sch->data;
+	struct netem_sched_data *q = qdisc_priv(sch);
 	unsigned int len;
 
 	if ((len = q->qdisc->ops->drop(q->qdisc)) != 0) {
@@ -680,7 +686,7 @@ static unsigned int netem_drop(struct Qdisc* sch)
  */
 static struct sk_buff *netem_dequeue(struct Qdisc *sch)
 {
-	struct netem_sched_data *q = (struct netem_sched_data *)sch->data;
+	struct netem_sched_data *q = qdisc_priv(sch);
 	struct sk_buff *skb;
 	psched_time_t now;
 
@@ -720,7 +726,7 @@ static void netem_watchdog(unsigned long arg)
 
 static void netem_reset(struct Qdisc *sch)
 {
-	struct netem_sched_data *q = (struct netem_sched_data *)sch->data;
+	struct netem_sched_data *q = qdisc_priv(sch);
 
 	qdisc_reset(q->qdisc);
 	skb_queue_purge(&q->delayed);
@@ -748,7 +754,7 @@ static int set_fifo_limit(struct Qdisc *q, int limit)
 
 static int netem_change(struct Qdisc *sch, struct rtattr *opt)
 {
-	struct netem_sched_data *q = (struct netem_sched_data *)sch->data;
+	struct netem_sched_data *q = qdisc_priv(sch);
 	struct tc_netem_qopt *qopt = RTA_DATA(opt);
 	struct Qdisc *child;
 	int ret;
@@ -785,7 +791,7 @@ static int netem_change(struct Qdisc *sch, struct rtattr *opt)
 
 static int netem_init(struct Qdisc *sch, struct rtattr *opt)
 {
-	struct netem_sched_data *q = (struct netem_sched_data *)sch->data;
+	struct netem_sched_data *q = qdisc_priv(sch);
 
 	if (!opt)
 		return -EINVAL;
@@ -803,20 +809,21 @@ static int netem_init(struct Qdisc *sch, struct rtattr *opt)
 
 static void netem_destroy(struct Qdisc *sch)
 {
-	struct netem_sched_data *q = (struct netem_sched_data *)sch->data;
+	struct netem_sched_data *q = qdisc_priv(sch);
 
 	del_timer_sync(&q->timer);
+	qdisc_destroy(q->qdisc);
 }
 
 static int netem_dump(struct Qdisc *sch, struct sk_buff *skb)
 {
-	struct netem_sched_data *q = (struct netem_sched_data *)sch->data;
+	struct netem_sched_data *q = qdisc_priv(sch);
 	unsigned char	 *b = skb->tail;
 	struct tc_netem_qopt qopt;
 
 	qopt.latency = q->latency;
 	qopt.jitter = q->jitter;
-	qopt.limit = sch->dev->tx_queue_len;
+	qopt.limit = q->limit;
 	qopt.loss = q->loss;
 	qopt.gap = q->gap;
 
@@ -829,8 +836,95 @@ rtattr_failure:
 	return -1;
 }
 
+static int netem_dump_class(struct Qdisc *sch, unsigned long cl,
+			  struct sk_buff *skb, struct tcmsg *tcm)
+{
+	struct netem_sched_data *q = qdisc_priv(sch);
+
+	if (cl != 1) 	/* only one class */
+		return -ENOENT;
+
+	tcm->tcm_handle |= TC_H_MIN(1);
+	tcm->tcm_info = q->qdisc->handle;
+
+	return 0;
+}
+
+static int netem_graft(struct Qdisc *sch, unsigned long arg, struct Qdisc *new,
+		     struct Qdisc **old)
+{
+	struct netem_sched_data *q = qdisc_priv(sch);
+
+	if (new == NULL)
+		new = &noop_qdisc;
+
+	sch_tree_lock(sch);
+	*old = xchg(&q->qdisc, new);
+	qdisc_reset(*old);
+	sch->q.qlen = 0;
+	sch_tree_unlock(sch);
+
+	return 0;
+}
+
+static struct Qdisc *netem_leaf(struct Qdisc *sch, unsigned long arg)
+{
+	struct netem_sched_data *q = qdisc_priv(sch);
+	return q->qdisc;
+}
+
+static unsigned long netem_get(struct Qdisc *sch, u32 classid)
+{
+	return 1;
+}
+
+static void netem_put(struct Qdisc *sch, unsigned long arg)
+{
+}
+
+static int netem_change_class(struct Qdisc *sch, u32 classid, u32 parentid, 
+			    struct rtattr **tca, unsigned long *arg)
+{
+	return -ENOSYS;
+}
+
+static int netem_delete(struct Qdisc *sch, unsigned long arg)
+{
+	return -ENOSYS;
+}
+
+static void netem_walk(struct Qdisc *sch, struct qdisc_walker *walker)
+{
+	if (!walker->stop) {
+		if (walker->count >= walker->skip)
+			if (walker->fn(sch, 1, walker) < 0) {
+				walker->stop = 1;
+				return;
+			}
+		walker->count++;
+	}
+}
+
+static struct tcf_proto **netem_find_tcf(struct Qdisc *sch, unsigned long cl)
+{
+	return NULL;
+}
+
+static struct Qdisc_class_ops netem_class_ops = {
+	.graft		=	netem_graft,
+	.leaf		=	netem_leaf,
+	.get		=	netem_get,
+	.put		=	netem_put,
+	.change		=	netem_change_class,
+	.delete		=	netem_delete,
+	.walk		=	netem_walk,
+	.tcf_chain	=	netem_find_tcf,
+	.dump		=	netem_dump_class,
+};
+
 static struct Qdisc_ops netem_qdisc_ops = {
 	.id		=	"netem",
+	.cl_ops		=	&netem_class_ops,
 	.priv_size	=	sizeof(struct netem_sched_data),
 	.enqueue	=	netem_enqueue,
 	.dequeue	=	netem_dequeue,
diff --git a/net/sched/sch_prio.c b/net/sched/sch_prio.c
index f8eafc507..6961f0811 100644
--- a/net/sched/sch_prio.c
+++ b/net/sched/sch_prio.c
@@ -47,60 +47,103 @@ struct prio_sched_data
 };
 
 
-static __inline__ unsigned prio_classify(struct sk_buff *skb, struct Qdisc *sch)
+struct Qdisc *prio_classify(struct sk_buff *skb, struct Qdisc *sch,int *r)
 {
-	struct prio_sched_data *q = (struct prio_sched_data *)sch->data;
+	struct prio_sched_data *q = qdisc_priv(sch);
+	u32 band = skb->priority;
 	struct tcf_result res;
-	u32 band;
 
-	band = skb->priority;
 	if (TC_H_MAJ(skb->priority) != sch->handle) {
+#ifdef CONFIG_NET_CLS_ACT
+		int result = 0, terminal = 0;
+		result = tc_classify(skb, q->filter_list, &res);
+
+		switch (result) {
+			case TC_ACT_SHOT:
+				*r = NET_XMIT_DROP;
+				terminal = 1;
+				break;
+			case TC_ACT_STOLEN:
+			case TC_ACT_QUEUED:
+				terminal = 1;
+				break;
+			case TC_ACT_RECLASSIFY:
+			case TC_ACT_OK:
+			case TC_ACT_UNSPEC:
+			default:
+			break;
+		};
+		if (terminal) {
+			kfree_skb(skb);
+			return NULL;
+		} 
+
+		if (!q->filter_list ) {
+#else
 		if (!q->filter_list || tc_classify(skb, q->filter_list, &res)) {
+#endif
 			if (TC_H_MAJ(band))
 				band = 0;
-			return q->prio2band[band&TC_PRIO_MAX];
+			return q->queues[q->prio2band[band&TC_PRIO_MAX]];
 		}
 		band = res.classid;
 	}
 	band = TC_H_MIN(band) - 1;
-	return band < q->bands ? band : q->prio2band[0];
+	if (band > q->bands)
+		return q->queues[q->prio2band[0]];
+
+	return q->queues[band];
 }
 
 static int
 prio_enqueue(struct sk_buff *skb, struct Qdisc* sch)
 {
-	struct prio_sched_data *q = (struct prio_sched_data *)sch->data;
 	struct Qdisc *qdisc;
-	int ret;
+	int ret = NET_XMIT_SUCCESS;
 
-	qdisc = q->queues[prio_classify(skb, sch)];
+	qdisc = prio_classify(skb, sch, &ret);
 
-	if ((ret = qdisc->enqueue(skb, qdisc)) == 0) {
+	if (NULL == qdisc)
+		goto dropped;
+
+	if ((ret = qdisc->enqueue(skb, qdisc)) == NET_XMIT_SUCCESS) {
 		sch->stats.bytes += skb->len;
 		sch->stats.packets++;
 		sch->q.qlen++;
-		return 0;
+		return NET_XMIT_SUCCESS;
 	}
-	sch->stats.drops++;
-	return ret;
+
+dropped:
+#ifdef CONFIG_NET_CLS_ACT
+	if (NET_XMIT_DROP == ret) {
+#endif
+		sch->stats.drops++;
+#ifdef CONFIG_NET_CLS_ACT
+	} else {
+		sch->stats.overlimits++; /* abuse, but noone uses it */
+	}
+#endif
+	return ret; 
 }
 
 
 static int
 prio_requeue(struct sk_buff *skb, struct Qdisc* sch)
 {
-	struct prio_sched_data *q = (struct prio_sched_data *)sch->data;
 	struct Qdisc *qdisc;
-	int ret;
+	int ret = NET_XMIT_DROP;
 
-	qdisc = q->queues[prio_classify(skb, sch)];
+	qdisc = prio_classify(skb, sch, &ret);
+	if (qdisc == NULL)
+		goto dropped;
 
 	if ((ret = qdisc->ops->requeue(skb, qdisc)) == 0) {
 		sch->q.qlen++;
 		return 0;
 	}
+dropped:
 	sch->stats.drops++;
-	return ret;
+	return NET_XMIT_DROP;
 }
 
 
@@ -108,7 +151,7 @@ static struct sk_buff *
 prio_dequeue(struct Qdisc* sch)
 {
 	struct sk_buff *skb;
-	struct prio_sched_data *q = (struct prio_sched_data *)sch->data;
+	struct prio_sched_data *q = qdisc_priv(sch);
 	int prio;
 	struct Qdisc *qdisc;
 
@@ -126,7 +169,7 @@ prio_dequeue(struct Qdisc* sch)
 
 static unsigned int prio_drop(struct Qdisc* sch)
 {
-	struct prio_sched_data *q = (struct prio_sched_data *)sch->data;
+	struct prio_sched_data *q = qdisc_priv(sch);
 	int prio;
 	unsigned int len;
 	struct Qdisc *qdisc;
@@ -146,7 +189,7 @@ static void
 prio_reset(struct Qdisc* sch)
 {
 	int prio;
-	struct prio_sched_data *q = (struct prio_sched_data *)sch->data;
+	struct prio_sched_data *q = qdisc_priv(sch);
 
 	for (prio=0; prio<q->bands; prio++)
 		qdisc_reset(q->queues[prio]);
@@ -157,7 +200,7 @@ static void
 prio_destroy(struct Qdisc* sch)
 {
 	int prio;
-	struct prio_sched_data *q = (struct prio_sched_data *)sch->data;
+	struct prio_sched_data *q = qdisc_priv(sch);
 	struct tcf_proto *tp;
 
 	while ((tp = q->filter_list) != NULL) {
@@ -165,15 +208,13 @@ prio_destroy(struct Qdisc* sch)
 		tcf_destroy(tp);
 	}
 
-	for (prio=0; prio<q->bands; prio++) {
+	for (prio=0; prio<q->bands; prio++)
 		qdisc_destroy(q->queues[prio]);
-		q->queues[prio] = &noop_qdisc;
-	}
 }
 
 static int prio_tune(struct Qdisc *sch, struct rtattr *opt)
 {
-	struct prio_sched_data *q = (struct prio_sched_data *)sch->data;
+	struct prio_sched_data *q = qdisc_priv(sch);
 	struct tc_prio_qopt *qopt = RTA_DATA(opt);
 	int i;
 
@@ -218,7 +259,7 @@ static int prio_tune(struct Qdisc *sch, struct rtattr *opt)
 
 static int prio_init(struct Qdisc *sch, struct rtattr *opt)
 {
-	struct prio_sched_data *q = (struct prio_sched_data *)sch->data;
+	struct prio_sched_data *q = qdisc_priv(sch);
 	int i;
 
 	for (i=0; i<TCQ_PRIO_BANDS; i++)
@@ -237,7 +278,7 @@ static int prio_init(struct Qdisc *sch, struct rtattr *opt)
 
 static int prio_dump(struct Qdisc *sch, struct sk_buff *skb)
 {
-	struct prio_sched_data *q = (struct prio_sched_data *)sch->data;
+	struct prio_sched_data *q = qdisc_priv(sch);
 	unsigned char	 *b = skb->tail;
 	struct tc_prio_qopt opt;
 
@@ -254,7 +295,7 @@ rtattr_failure:
 static int prio_graft(struct Qdisc *sch, unsigned long arg, struct Qdisc *new,
 		      struct Qdisc **old)
 {
-	struct prio_sched_data *q = (struct prio_sched_data *)sch->data;
+	struct prio_sched_data *q = qdisc_priv(sch);
 	unsigned long band = arg - 1;
 
 	if (band >= q->bands)
@@ -276,7 +317,7 @@ static int prio_graft(struct Qdisc *sch, unsigned long arg, struct Qdisc *new,
 static struct Qdisc *
 prio_leaf(struct Qdisc *sch, unsigned long arg)
 {
-	struct prio_sched_data *q = (struct prio_sched_data *)sch->data;
+	struct prio_sched_data *q = qdisc_priv(sch);
 	unsigned long band = arg - 1;
 
 	if (band >= q->bands)
@@ -287,7 +328,7 @@ prio_leaf(struct Qdisc *sch, unsigned long arg)
 
 static unsigned long prio_get(struct Qdisc *sch, u32 classid)
 {
-	struct prio_sched_data *q = (struct prio_sched_data *)sch->data;
+	struct prio_sched_data *q = qdisc_priv(sch);
 	unsigned long band = TC_H_MIN(classid);
 
 	if (band - 1 >= q->bands)
@@ -309,7 +350,7 @@ static void prio_put(struct Qdisc *q, unsigned long cl)
 static int prio_change(struct Qdisc *sch, u32 handle, u32 parent, struct rtattr **tca, unsigned long *arg)
 {
 	unsigned long cl = *arg;
-	struct prio_sched_data *q = (struct prio_sched_data *)sch->data;
+	struct prio_sched_data *q = qdisc_priv(sch);
 
 	if (cl - 1 > q->bands)
 		return -ENOENT;
@@ -318,7 +359,7 @@ static int prio_change(struct Qdisc *sch, u32 handle, u32 parent, struct rtattr
 
 static int prio_delete(struct Qdisc *sch, unsigned long cl)
 {
-	struct prio_sched_data *q = (struct prio_sched_data *)sch->data;
+	struct prio_sched_data *q = qdisc_priv(sch);
 	if (cl - 1 > q->bands)
 		return -ENOENT;
 	return 0;
@@ -328,7 +369,7 @@ static int prio_delete(struct Qdisc *sch, unsigned long cl)
 static int prio_dump_class(struct Qdisc *sch, unsigned long cl, struct sk_buff *skb,
 			   struct tcmsg *tcm)
 {
-	struct prio_sched_data *q = (struct prio_sched_data *)sch->data;
+	struct prio_sched_data *q = qdisc_priv(sch);
 
 	if (cl - 1 > q->bands)
 		return -ENOENT;
@@ -340,7 +381,7 @@ static int prio_dump_class(struct Qdisc *sch, unsigned long cl, struct sk_buff *
 
 static void prio_walk(struct Qdisc *sch, struct qdisc_walker *arg)
 {
-	struct prio_sched_data *q = (struct prio_sched_data *)sch->data;
+	struct prio_sched_data *q = qdisc_priv(sch);
 	int prio;
 
 	if (arg->stop)
@@ -361,7 +402,7 @@ static void prio_walk(struct Qdisc *sch, struct qdisc_walker *arg)
 
 static struct tcf_proto ** prio_find_tcf(struct Qdisc *sch, unsigned long cl)
 {
-	struct prio_sched_data *q = (struct prio_sched_data *)sch->data;
+	struct prio_sched_data *q = qdisc_priv(sch);
 
 	if (cl)
 		return NULL;
diff --git a/net/sched/sch_red.c b/net/sched/sch_red.c
index 96f7cd333..5630abb20 100644
--- a/net/sched/sch_red.c
+++ b/net/sched/sch_red.c
@@ -180,7 +180,7 @@ static int red_ecn_mark(struct sk_buff *skb)
 static int
 red_enqueue(struct sk_buff *skb, struct Qdisc* sch)
 {
-	struct red_sched_data *q = (struct red_sched_data *)sch->data;
+	struct red_sched_data *q = qdisc_priv(sch);
 
 	psched_time_t now;
 
@@ -189,7 +189,7 @@ red_enqueue(struct sk_buff *skb, struct Qdisc* sch)
 		int  shift;
 
 		PSCHED_GET_TIME(now);
-		us_idle = PSCHED_TDIFF_SAFE(now, q->qidlestart, q->Scell_max, 0);
+		us_idle = PSCHED_TDIFF_SAFE(now, q->qidlestart, q->Scell_max);
 		PSCHED_SET_PASTPERFECT(q->qidlestart);
 
 /*
@@ -303,7 +303,7 @@ drop:
 static int
 red_requeue(struct sk_buff *skb, struct Qdisc* sch)
 {
-	struct red_sched_data *q = (struct red_sched_data *)sch->data;
+	struct red_sched_data *q = qdisc_priv(sch);
 
 	PSCHED_SET_PASTPERFECT(q->qidlestart);
 
@@ -316,7 +316,7 @@ static struct sk_buff *
 red_dequeue(struct Qdisc* sch)
 {
 	struct sk_buff *skb;
-	struct red_sched_data *q = (struct red_sched_data *)sch->data;
+	struct red_sched_data *q = qdisc_priv(sch);
 
 	skb = __skb_dequeue(&sch->q);
 	if (skb) {
@@ -330,7 +330,7 @@ red_dequeue(struct Qdisc* sch)
 static unsigned int red_drop(struct Qdisc* sch)
 {
 	struct sk_buff *skb;
-	struct red_sched_data *q = (struct red_sched_data *)sch->data;
+	struct red_sched_data *q = qdisc_priv(sch);
 
 	skb = __skb_dequeue_tail(&sch->q);
 	if (skb) {
@@ -347,7 +347,7 @@ static unsigned int red_drop(struct Qdisc* sch)
 
 static void red_reset(struct Qdisc* sch)
 {
-	struct red_sched_data *q = (struct red_sched_data *)sch->data;
+	struct red_sched_data *q = qdisc_priv(sch);
 
 	__skb_queue_purge(&sch->q);
 	sch->stats.backlog = 0;
@@ -358,7 +358,7 @@ static void red_reset(struct Qdisc* sch)
 
 static int red_change(struct Qdisc *sch, struct rtattr *opt)
 {
-	struct red_sched_data *q = (struct red_sched_data *)sch->data;
+	struct red_sched_data *q = qdisc_priv(sch);
 	struct rtattr *tb[TCA_RED_STAB];
 	struct tc_red_qopt *ctl;
 
@@ -407,7 +407,7 @@ rtattr_failure:
 
 static int red_dump(struct Qdisc *sch, struct sk_buff *skb)
 {
-	struct red_sched_data *q = (struct red_sched_data *)sch->data;
+	struct red_sched_data *q = qdisc_priv(sch);
 	unsigned char	 *b = skb->tail;
 	struct rtattr *rta;
 	struct tc_red_qopt opt;
@@ -434,10 +434,6 @@ rtattr_failure:
 	return -1;
 }
 
-static void red_destroy(struct Qdisc *sch)
-{
-}
-
 static struct Qdisc_ops red_qdisc_ops = {
 	.next		=	NULL,
 	.cl_ops		=	NULL,
@@ -449,7 +445,6 @@ static struct Qdisc_ops red_qdisc_ops = {
 	.drop		=	red_drop,
 	.init		=	red_init,
 	.reset		=	red_reset,
-	.destroy	=	red_destroy,
 	.change		=	red_change,
 	.dump		=	red_dump,
 	.owner		=	THIS_MODULE,
diff --git a/net/sched/sch_sfq.c b/net/sched/sch_sfq.c
index acf2666ad..f37d9cdd0 100644
--- a/net/sched/sch_sfq.c
+++ b/net/sched/sch_sfq.c
@@ -211,7 +211,7 @@ static inline void sfq_inc(struct sfq_sched_data *q, sfq_index x)
 
 static unsigned int sfq_drop(struct Qdisc *sch)
 {
-	struct sfq_sched_data *q = (struct sfq_sched_data *)sch->data;
+	struct sfq_sched_data *q = qdisc_priv(sch);
 	sfq_index d = q->max_depth;
 	struct sk_buff *skb;
 	unsigned int len;
@@ -253,7 +253,7 @@ static unsigned int sfq_drop(struct Qdisc *sch)
 static int
 sfq_enqueue(struct sk_buff *skb, struct Qdisc* sch)
 {
-	struct sfq_sched_data *q = (struct sfq_sched_data *)sch->data;
+	struct sfq_sched_data *q = qdisc_priv(sch);
 	unsigned hash = sfq_hash(q, skb);
 	sfq_index x;
 
@@ -288,7 +288,7 @@ sfq_enqueue(struct sk_buff *skb, struct Qdisc* sch)
 static int
 sfq_requeue(struct sk_buff *skb, struct Qdisc* sch)
 {
-	struct sfq_sched_data *q = (struct sfq_sched_data *)sch->data;
+	struct sfq_sched_data *q = qdisc_priv(sch);
 	unsigned hash = sfq_hash(q, skb);
 	sfq_index x;
 
@@ -324,7 +324,7 @@ sfq_requeue(struct sk_buff *skb, struct Qdisc* sch)
 static struct sk_buff *
 sfq_dequeue(struct Qdisc* sch)
 {
-	struct sfq_sched_data *q = (struct sfq_sched_data *)sch->data;
+	struct sfq_sched_data *q = qdisc_priv(sch);
 	struct sk_buff *skb;
 	sfq_index a, old_a;
 
@@ -369,7 +369,7 @@ sfq_reset(struct Qdisc* sch)
 static void sfq_perturbation(unsigned long arg)
 {
 	struct Qdisc *sch = (struct Qdisc*)arg;
-	struct sfq_sched_data *q = (struct sfq_sched_data *)sch->data;
+	struct sfq_sched_data *q = qdisc_priv(sch);
 
 	q->perturbation = net_random()&0x1F;
 	q->perturb_timer.expires = jiffies + q->perturb_period;
@@ -382,7 +382,7 @@ static void sfq_perturbation(unsigned long arg)
 
 static int sfq_change(struct Qdisc *sch, struct rtattr *opt)
 {
-	struct sfq_sched_data *q = (struct sfq_sched_data *)sch->data;
+	struct sfq_sched_data *q = qdisc_priv(sch);
 	struct tc_sfq_qopt *ctl = RTA_DATA(opt);
 
 	if (opt->rta_len < RTA_LENGTH(sizeof(*ctl)))
@@ -408,7 +408,7 @@ static int sfq_change(struct Qdisc *sch, struct rtattr *opt)
 
 static int sfq_init(struct Qdisc *sch, struct rtattr *opt)
 {
-	struct sfq_sched_data *q = (struct sfq_sched_data *)sch->data;
+	struct sfq_sched_data *q = qdisc_priv(sch);
 	int i;
 
 	init_timer(&q->perturb_timer);
@@ -440,13 +440,13 @@ static int sfq_init(struct Qdisc *sch, struct rtattr *opt)
 
 static void sfq_destroy(struct Qdisc *sch)
 {
-	struct sfq_sched_data *q = (struct sfq_sched_data *)sch->data;
+	struct sfq_sched_data *q = qdisc_priv(sch);
 	del_timer(&q->perturb_timer);
 }
 
 static int sfq_dump(struct Qdisc *sch, struct sk_buff *skb)
 {
-	struct sfq_sched_data *q = (struct sfq_sched_data *)sch->data;
+	struct sfq_sched_data *q = qdisc_priv(sch);
 	unsigned char	 *b = skb->tail;
 	struct tc_sfq_qopt opt;
 
diff --git a/net/sched/sch_tbf.c b/net/sched/sch_tbf.c
index 785498056..a1df30471 100644
--- a/net/sched/sch_tbf.c
+++ b/net/sched/sch_tbf.c
@@ -137,7 +137,7 @@ struct tbf_sched_data
 
 static int tbf_enqueue(struct sk_buff *skb, struct Qdisc* sch)
 {
-	struct tbf_sched_data *q = (struct tbf_sched_data *)sch->data;
+	struct tbf_sched_data *q = qdisc_priv(sch);
 	int ret;
 
 	if (skb->len > q->max_size) {
@@ -163,7 +163,7 @@ static int tbf_enqueue(struct sk_buff *skb, struct Qdisc* sch)
 
 static int tbf_requeue(struct sk_buff *skb, struct Qdisc* sch)
 {
-	struct tbf_sched_data *q = (struct tbf_sched_data *)sch->data;
+	struct tbf_sched_data *q = qdisc_priv(sch);
 	int ret;
 
 	if ((ret = q->qdisc->ops->requeue(skb, q->qdisc)) == 0)
@@ -174,7 +174,7 @@ static int tbf_requeue(struct sk_buff *skb, struct Qdisc* sch)
 
 static unsigned int tbf_drop(struct Qdisc* sch)
 {
-	struct tbf_sched_data *q = (struct tbf_sched_data *)sch->data;
+	struct tbf_sched_data *q = qdisc_priv(sch);
 	unsigned int len;
 
 	if ((len = q->qdisc->ops->drop(q->qdisc)) != 0) {
@@ -194,20 +194,20 @@ static void tbf_watchdog(unsigned long arg)
 
 static struct sk_buff *tbf_dequeue(struct Qdisc* sch)
 {
-	struct tbf_sched_data *q = (struct tbf_sched_data *)sch->data;
+	struct tbf_sched_data *q = qdisc_priv(sch);
 	struct sk_buff *skb;
 
 	skb = q->qdisc->dequeue(q->qdisc);
 
 	if (skb) {
 		psched_time_t now;
-		long toks;
+		long toks, delay;
 		long ptoks = 0;
 		unsigned int len = skb->len;
 
 		PSCHED_GET_TIME(now);
 
-		toks = PSCHED_TDIFF_SAFE(now, q->t_c, q->buffer, 0);
+		toks = PSCHED_TDIFF_SAFE(now, q->t_c, q->buffer);
 
 		if (q->P_tab) {
 			ptoks = toks + q->ptokens;
@@ -229,14 +229,12 @@ static struct sk_buff *tbf_dequeue(struct Qdisc* sch)
 			return skb;
 		}
 
-		if (!netif_queue_stopped(sch->dev)) {
-			long delay = PSCHED_US2JIFFIE(max_t(long, -toks, -ptoks));
+		delay = PSCHED_US2JIFFIE(max_t(long, -toks, -ptoks));
 
-			if (delay == 0)
-				delay = 1;
+		if (delay == 0)
+			delay = 1;
 
-			mod_timer(&q->wd_timer, jiffies+delay);
-		}
+		mod_timer(&q->wd_timer, jiffies+delay);
 
 		/* Maybe we have a shorter packet in the queue,
 		   which can be sent now. It sounds cool,
@@ -263,7 +261,7 @@ static struct sk_buff *tbf_dequeue(struct Qdisc* sch)
 
 static void tbf_reset(struct Qdisc* sch)
 {
-	struct tbf_sched_data *q = (struct tbf_sched_data *)sch->data;
+	struct tbf_sched_data *q = qdisc_priv(sch);
 
 	qdisc_reset(q->qdisc);
 	sch->q.qlen = 0;
@@ -302,7 +300,7 @@ static struct Qdisc *tbf_create_dflt_qdisc(struct net_device *dev, u32 limit)
 static int tbf_change(struct Qdisc* sch, struct rtattr *opt)
 {
 	int err = -EINVAL;
-	struct tbf_sched_data *q = (struct tbf_sched_data *)sch->data;
+	struct tbf_sched_data *q = qdisc_priv(sch);
 	struct rtattr *tb[TCA_TBF_PTAB];
 	struct tc_tbf_qopt *qopt;
 	struct qdisc_rate_table *rtab = NULL;
@@ -368,7 +366,7 @@ done:
 
 static int tbf_init(struct Qdisc* sch, struct rtattr *opt)
 {
-	struct tbf_sched_data *q = (struct tbf_sched_data *)sch->data;
+	struct tbf_sched_data *q = qdisc_priv(sch);
 
 	if (opt == NULL)
 		return -EINVAL;
@@ -385,7 +383,7 @@ static int tbf_init(struct Qdisc* sch, struct rtattr *opt)
 
 static void tbf_destroy(struct Qdisc *sch)
 {
-	struct tbf_sched_data *q = (struct tbf_sched_data *)sch->data;
+	struct tbf_sched_data *q = qdisc_priv(sch);
 
 	del_timer(&q->wd_timer);
 
@@ -395,12 +393,11 @@ static void tbf_destroy(struct Qdisc *sch)
 		qdisc_put_rtab(q->R_tab);
 
 	qdisc_destroy(q->qdisc);
-	q->qdisc = &noop_qdisc;
 }
 
 static int tbf_dump(struct Qdisc *sch, struct sk_buff *skb)
 {
-	struct tbf_sched_data *q = (struct tbf_sched_data *)sch->data;
+	struct tbf_sched_data *q = qdisc_priv(sch);
 	unsigned char	 *b = skb->tail;
 	struct rtattr *rta;
 	struct tc_tbf_qopt opt;
@@ -429,7 +426,7 @@ rtattr_failure:
 static int tbf_dump_class(struct Qdisc *sch, unsigned long cl,
 			  struct sk_buff *skb, struct tcmsg *tcm)
 {
-	struct tbf_sched_data *q = (struct tbf_sched_data*)sch->data;
+	struct tbf_sched_data *q = qdisc_priv(sch);
 
 	if (cl != 1) 	/* only one class */
 		return -ENOENT;
@@ -443,7 +440,7 @@ static int tbf_dump_class(struct Qdisc *sch, unsigned long cl,
 static int tbf_graft(struct Qdisc *sch, unsigned long arg, struct Qdisc *new,
 		     struct Qdisc **old)
 {
-	struct tbf_sched_data *q = (struct tbf_sched_data *)sch->data;
+	struct tbf_sched_data *q = qdisc_priv(sch);
 
 	if (new == NULL)
 		new = &noop_qdisc;
@@ -459,7 +456,7 @@ static int tbf_graft(struct Qdisc *sch, unsigned long arg, struct Qdisc *new,
 
 static struct Qdisc *tbf_leaf(struct Qdisc *sch, unsigned long arg)
 {
-	struct tbf_sched_data *q = (struct tbf_sched_data *)sch->data;
+	struct tbf_sched_data *q = qdisc_priv(sch);
 	return q->qdisc;
 }
 
diff --git a/net/sched/sch_teql.c b/net/sched/sch_teql.c
index da5e89c22..963e87a5b 100644
--- a/net/sched/sch_teql.c
+++ b/net/sched/sch_teql.c
@@ -81,7 +81,7 @@ struct teql_sched_data
 	struct sk_buff_head q;
 };
 
-#define NEXT_SLAVE(q) (((struct teql_sched_data*)((q)->data))->next)
+#define NEXT_SLAVE(q) (((struct teql_sched_data*)qdisc_priv(q))->next)
 
 #define FMASK (IFF_BROADCAST|IFF_POINTOPOINT|IFF_BROADCAST)
 
@@ -91,7 +91,7 @@ static int
 teql_enqueue(struct sk_buff *skb, struct Qdisc* sch)
 {
 	struct net_device *dev = sch->dev;
-	struct teql_sched_data *q = (struct teql_sched_data *)sch->data;
+	struct teql_sched_data *q = qdisc_priv(sch);
 
 	__skb_queue_tail(&q->q, skb);
 	if (q->q.qlen <= dev->tx_queue_len) {
@@ -109,7 +109,7 @@ teql_enqueue(struct sk_buff *skb, struct Qdisc* sch)
 static int
 teql_requeue(struct sk_buff *skb, struct Qdisc* sch)
 {
-	struct teql_sched_data *q = (struct teql_sched_data *)sch->data;
+	struct teql_sched_data *q = qdisc_priv(sch);
 
 	__skb_queue_head(&q->q, skb);
 	return 0;
@@ -118,7 +118,7 @@ teql_requeue(struct sk_buff *skb, struct Qdisc* sch)
 static struct sk_buff *
 teql_dequeue(struct Qdisc* sch)
 {
-	struct teql_sched_data *dat = (struct teql_sched_data *)sch->data;
+	struct teql_sched_data *dat = qdisc_priv(sch);
 	struct sk_buff *skb;
 
 	skb = __skb_dequeue(&dat->q);
@@ -143,7 +143,7 @@ teql_neigh_release(struct neighbour *n)
 static void
 teql_reset(struct Qdisc* sch)
 {
-	struct teql_sched_data *dat = (struct teql_sched_data *)sch->data;
+	struct teql_sched_data *dat = qdisc_priv(sch);
 
 	skb_queue_purge(&dat->q);
 	sch->q.qlen = 0;
@@ -154,7 +154,7 @@ static void
 teql_destroy(struct Qdisc* sch)
 {
 	struct Qdisc *q, *prev;
-	struct teql_sched_data *dat = (struct teql_sched_data *)sch->data;
+	struct teql_sched_data *dat = qdisc_priv(sch);
 	struct teql_master *master = dat->m;
 
 	if ((prev = master->slaves) != NULL) {
@@ -184,7 +184,7 @@ static int teql_qdisc_init(struct Qdisc *sch, struct rtattr *opt)
 {
 	struct net_device *dev = sch->dev;
 	struct teql_master *m = (struct teql_master*)sch->ops;
-	struct teql_sched_data *q = (struct teql_sched_data *)sch->data;
+	struct teql_sched_data *q = qdisc_priv(sch);
 
 	if (dev->hard_header_len > m->dev->hard_header_len)
 		return -EINVAL;
@@ -229,7 +229,7 @@ static int teql_qdisc_init(struct Qdisc *sch, struct rtattr *opt)
 static int
 __teql_resolve(struct sk_buff *skb, struct sk_buff *skb_res, struct net_device *dev)
 {
-	struct teql_sched_data *q = (void*)dev->qdisc->data;
+	struct teql_sched_data *q = qdisc_priv(dev->qdisc);
 	struct neighbour *mn = skb->dst->neighbour;
 	struct neighbour *n = q->ncache;
 
diff --git a/net/sctp/Kconfig b/net/sctp/Kconfig
index d7757c951..9cba49e2a 100644
--- a/net/sctp/Kconfig
+++ b/net/sctp/Kconfig
@@ -8,6 +8,10 @@ menu "SCTP Configuration (EXPERIMENTAL)"
 config IP_SCTP
 	tristate "The SCTP Protocol (EXPERIMENTAL)"
 	depends on IPV6 || IPV6=n
+	select CRYPTO if SCTP_HMAC_SHA1 || SCTP_HMAC_MD5
+	select CRYPTO_HMAC if SCTP_HMAC_SHA1 || SCTP_HMAC_MD5
+	select CRYPTO_SHA1 if SCTP_HMAC_SHA1
+	select CRYPTO_MD5 if SCTP_HMAC_MD5
 	---help---
 	  Stream Control Transmission Protocol
 
@@ -71,18 +75,12 @@ config SCTP_HMAC_NONE
 
 config SCTP_HMAC_SHA1
 	bool "HMAC-SHA1"
-	select CRYPTO
-	select CRYPTO_HMAC
-	select CRYPTO_SHA1
 	help 
 	  Enable the use of HMAC-SHA1 during association establishment.  It 
 	  is advised to use either HMAC-MD5 or HMAC-SHA1.
 
 config SCTP_HMAC_MD5
 	bool "HMAC-MD5"
-	select CRYPTO
-	select CRYPTO_HMAC
-	select CRYPTO_MD5
 	help
 	  Enable the use of HMAC-MD5 during association establishment.  It is 
 	  advised to use either HMAC-MD5 or HMAC-SHA1.
diff --git a/net/sctp/associola.c b/net/sctp/associola.c
index 1a2ac8b4a..16b718fa5 100644
--- a/net/sctp/associola.c
+++ b/net/sctp/associola.c
@@ -879,7 +879,7 @@ static void sctp_assoc_bh_rcv(struct sctp_association *asoc)
 		if (sctp_chunk_is_data(chunk))
 			asoc->peer.last_data_from = chunk->transport;
 		else
-			SCTP_INC_STATS(SctpInCtrlChunks);
+			SCTP_INC_STATS(SCTP_MIB_INCTRLCHUNKS);
 
 		if (chunk->transport)
 			chunk->transport->last_time_heard = jiffies;
@@ -1093,6 +1093,7 @@ static inline int sctp_peer_needs_update(struct sctp_association *asoc)
 	case SCTP_STATE_ESTABLISHED:
 	case SCTP_STATE_SHUTDOWN_PENDING:
 	case SCTP_STATE_SHUTDOWN_RECEIVED:
+	case SCTP_STATE_SHUTDOWN_SENT:
 		if ((asoc->rwnd > asoc->a_rwnd) &&
 		    ((asoc->rwnd - asoc->a_rwnd) >=
 		     min_t(__u32, (asoc->base.sk->sk_rcvbuf >> 1), asoc->pmtu)))
diff --git a/net/sctp/chunk.c b/net/sctp/chunk.c
index 67f3afdf0..cdcd427e4 100644
--- a/net/sctp/chunk.c
+++ b/net/sctp/chunk.c
@@ -215,7 +215,7 @@ struct sctp_datamsg *sctp_datamsg_from_user(struct sctp_association *asoc,
 	offset = 0;
 
 	if ((whole > 1) || (whole && over))
-		SCTP_INC_STATS_USER(SctpFragUsrMsgs);
+		SCTP_INC_STATS_USER(SCTP_MIB_FRAGUSRMSGS);
 
 	/* Create chunks for all the full sized DATA chunks. */
 	for (i=0, len=first_len; i < whole; i++) {
diff --git a/net/sctp/endpointola.c b/net/sctp/endpointola.c
index 5f9a99c64..c0b773875 100644
--- a/net/sctp/endpointola.c
+++ b/net/sctp/endpointola.c
@@ -369,7 +369,7 @@ static void sctp_endpoint_bh_rcv(struct sctp_endpoint *ep)
 		if (asoc && sctp_chunk_is_data(chunk))
 			asoc->peer.last_data_from = chunk->transport;
 		else
-			SCTP_INC_STATS(SctpInCtrlChunks);
+			SCTP_INC_STATS(SCTP_MIB_INCTRLCHUNKS);
 
 		if (chunk->transport)
 			chunk->transport->last_time_heard = jiffies;
diff --git a/net/sctp/input.c b/net/sctp/input.c
index d761fddb3..0268f75c4 100644
--- a/net/sctp/input.c
+++ b/net/sctp/input.c
@@ -90,7 +90,7 @@ static inline int sctp_rcv_checksum(struct sk_buff *skb)
 
 	if (val != cmp) {
 		/* CRC failure, dump it. */
-		SCTP_INC_STATS_BH(SctpChecksumErrors);
+		SCTP_INC_STATS_BH(SCTP_MIB_CHECKSUMERRORS);
 		return -1;
 	}
 	return 0;
@@ -117,7 +117,7 @@ int sctp_rcv(struct sk_buff *skb)
 	if (skb->pkt_type!=PACKET_HOST)
 		goto discard_it;
 
-	SCTP_INC_STATS_BH(SctpInSCTPPacks);
+	SCTP_INC_STATS_BH(SCTP_MIB_INSCTPPACKS);
 
 	sh = (struct sctphdr *) skb->h.raw;
 
@@ -166,7 +166,7 @@ int sctp_rcv(struct sk_buff *skb)
 	if (!asoc) {
 		ep = __sctp_rcv_lookup_endpoint(&dest);
 		if (sctp_rcv_ootb(skb)) {
-			SCTP_INC_STATS_BH(SctpOutOfBlues);
+			SCTP_INC_STATS_BH(SCTP_MIB_OUTOFBLUES);
 			goto discard_release;
 		}
 	}
@@ -327,7 +327,7 @@ struct sock *sctp_err_lookup(int family, struct sk_buff *skb,
 
 	if (asoc) {
 		if (ntohl(sctphdr->vtag) != asoc->c.peer_vtag) {
-			ICMP_INC_STATS_BH(IcmpInErrors);
+			ICMP_INC_STATS_BH(ICMP_MIB_INERRORS);
 			goto out;
 		}
 		sk = asoc->base.sk;
@@ -340,7 +340,7 @@ struct sock *sctp_err_lookup(int family, struct sk_buff *skb,
 	 * servers this needs to be solved differently.
 	 */
 	if (sock_owned_by_user(sk))
-		NET_INC_STATS_BH(LockDroppedIcmps);
+		NET_INC_STATS_BH(LINUX_MIB_LOCKDROPPEDICMPS);
 
 	*epp = ep;
 	*app = asoc;
@@ -398,7 +398,7 @@ void sctp_v4_err(struct sk_buff *skb, __u32 info)
 	int err;
 
 	if (skb->len < ((iph->ihl << 2) + 8)) {
-		ICMP_INC_STATS_BH(IcmpInErrors);
+		ICMP_INC_STATS_BH(ICMP_MIB_INERRORS);
 		return;
 	}
 
@@ -412,7 +412,7 @@ void sctp_v4_err(struct sk_buff *skb, __u32 info)
 	skb->nh.raw = saveip;
 	skb->h.raw = savesctp;
 	if (!sk) {
-		ICMP_INC_STATS_BH(IcmpInErrors);
+		ICMP_INC_STATS_BH(ICMP_MIB_INERRORS);
 		return;
 	}
 	/* Warning:  The sock lock is held.  Remember to call
diff --git a/net/sctp/inqueue.c b/net/sctp/inqueue.c
index 9bb4de3d2..2e83405b8 100644
--- a/net/sctp/inqueue.c
+++ b/net/sctp/inqueue.c
@@ -78,7 +78,7 @@ void sctp_inq_free(struct sctp_inq *queue)
 	struct sctp_chunk *chunk;
 
 	/* Empty the queue.  */
-	while ((chunk = (struct sctp_chunk *) skb_dequeue(&queue->in)))
+	while ((chunk = (struct sctp_chunk *) skb_dequeue(&queue->in)) != NULL)
 		sctp_chunk_free(chunk);
 
 	/* If there is a packet which is currently being worked on,
diff --git a/net/sctp/ipv6.c b/net/sctp/ipv6.c
index af402f7d4..09e6df208 100644
--- a/net/sctp/ipv6.c
+++ b/net/sctp/ipv6.c
@@ -107,7 +107,7 @@ void sctp_v6_err(struct sk_buff *skb, struct inet6_skb_parm *opt,
 	skb->nh.raw = saveip;
 	skb->h.raw = savesctp;
 	if (!sk) {
-		ICMP6_INC_STATS_BH(idev, Icmp6InErrors);
+		ICMP6_INC_STATS_BH(idev, ICMP6_MIB_INERRORS);
 		goto out;
 	}
 
@@ -177,7 +177,7 @@ static int sctp_v6_xmit(struct sk_buff *skb, struct sctp_transport *transport,
 			  __FUNCTION__, skb, skb->len,
 			  NIP6(fl.fl6_src), NIP6(fl.fl6_dst));
 
-	SCTP_INC_STATS(SctpOutSCTPPacks);
+	SCTP_INC_STATS(SCTP_MIB_OUTSCTPPACKS);
 
 	return ip6_xmit(sk, skb, &fl, np->opt, ipfragok);
 }
@@ -641,7 +641,7 @@ struct sock *sctp_v6_create_accept_sk(struct sock *sk,
 #endif
 
 	if (newsk->sk_prot->init(newsk)) {
-		inet_sock_release(newsk);
+		sk_common_release(newsk);
 		newsk = NULL;
 	}
 
@@ -882,10 +882,10 @@ static struct proto_ops inet6_seqpacket_ops = {
 	.ioctl      = inet6_ioctl,
 	.listen     = sctp_inet_listen,
 	.shutdown   = inet_shutdown,
-	.setsockopt = inet_setsockopt,
-	.getsockopt = inet_getsockopt,
+	.setsockopt = sock_common_setsockopt,
+	.getsockopt = sock_common_getsockopt,
 	.sendmsg    = inet_sendmsg,
-	.recvmsg    = inet_recvmsg,
+	.recvmsg    = sock_common_recvmsg,
 	.mmap       = sock_no_mmap,
 };
 
diff --git a/net/sctp/output.c b/net/sctp/output.c
index d54f915ae..14009b01c 100644
--- a/net/sctp/output.c
+++ b/net/sctp/output.c
@@ -133,7 +133,7 @@ void sctp_packet_free(struct sctp_packet *packet)
 
 	SCTP_DEBUG_PRINTK("%s: packet:%p\n", __FUNCTION__, packet);
 
-        while ((chunk = (struct sctp_chunk *)__skb_dequeue(&packet->chunks)))
+        while ((chunk = (struct sctp_chunk *)__skb_dequeue(&packet->chunks)) != NULL)
 		sctp_chunk_free(chunk);
 
 	if (packet->malloced)
@@ -370,7 +370,7 @@ int sctp_packet_transmit(struct sctp_packet *packet)
 	 * [This whole comment explains WORD_ROUND() below.]
 	 */
 	SCTP_DEBUG_PRINTK("***sctp_transmit_packet***\n");
-	while ((chunk = (struct sctp_chunk *)__skb_dequeue(&packet->chunks))) {
+	while ((chunk = (struct sctp_chunk *)__skb_dequeue(&packet->chunks)) != NULL) {
 		if (sctp_chunk_is_data(chunk)) {
 
 			if (!chunk->has_tsn) {
@@ -496,7 +496,7 @@ out:
 	return err;
 no_route:
 	kfree_skb(nskb);
-	IP_INC_STATS_BH(OutNoRoutes);
+	IP_INC_STATS_BH(IPSTATS_MIB_OUTNOROUTES);
 
 	/* FIXME: Returning the 'err' will effect all the associations
 	 * associated with a socket, although only one of the paths of the
@@ -511,7 +511,7 @@ err:
 	 * will get resent or dropped later.
 	 */
 
-	while ((chunk = (struct sctp_chunk *)__skb_dequeue(&packet->chunks))) {
+	while ((chunk = (struct sctp_chunk *)__skb_dequeue(&packet->chunks)) != NULL) {
 		if (!sctp_chunk_is_data(chunk))
     			sctp_chunk_free(chunk);
 	}
diff --git a/net/sctp/outqueue.c b/net/sctp/outqueue.c
index 02272a71c..13fda7792 100644
--- a/net/sctp/outqueue.c
+++ b/net/sctp/outqueue.c
@@ -245,7 +245,7 @@ void sctp_outq_teardown(struct sctp_outq *q)
 	/* Throw away unacknowledged chunks. */
 	list_for_each(pos, &q->asoc->peer.transport_addr_list) {
 		transport = list_entry(pos, struct sctp_transport, transports);
-		while ((lchunk = sctp_list_dequeue(&transport->transmitted))) {
+		while ((lchunk = sctp_list_dequeue(&transport->transmitted)) != NULL) {
 			chunk = list_entry(lchunk, struct sctp_chunk,
 					   transmitted_list);
 			/* Mark as part of a failed message. */
@@ -282,7 +282,7 @@ void sctp_outq_teardown(struct sctp_outq *q)
 	}
 
 	/* Throw away any leftover data chunks. */
-	while ((chunk = sctp_outq_dequeue_data(q))) {
+	while ((chunk = sctp_outq_dequeue_data(q)) != NULL) {
 
 		/* Mark as send failure. */
 		sctp_chunk_fail(chunk, q->error);
@@ -292,7 +292,7 @@ void sctp_outq_teardown(struct sctp_outq *q)
 	q->error = 0;
 
 	/* Throw away any leftover control chunks. */
-	while ((chunk = (struct sctp_chunk *) skb_dequeue(&q->control)))
+	while ((chunk = (struct sctp_chunk *) skb_dequeue(&q->control)) != NULL)
 		sctp_chunk_free(chunk);
 }
 
@@ -349,15 +349,15 @@ int sctp_outq_tail(struct sctp_outq *q, struct sctp_chunk *chunk)
 
 			sctp_outq_tail_data(q, chunk);
 			if (chunk->chunk_hdr->flags & SCTP_DATA_UNORDERED)
-				SCTP_INC_STATS(SctpOutUnorderChunks);
+				SCTP_INC_STATS(SCTP_MIB_OUTUNORDERCHUNKS);
 			else
-				SCTP_INC_STATS(SctpOutOrderChunks);
+				SCTP_INC_STATS(SCTP_MIB_OUTORDERCHUNKS);
 			q->empty = 0;
 			break;
 		};
 	} else {
 		__skb_queue_tail(&q->control, (struct sk_buff *) chunk);
-		SCTP_INC_STATS(SctpOutCtrlChunks);
+		SCTP_INC_STATS(SCTP_MIB_OUTCTRLCHUNKS);
 	}
 
 	if (error < 0)
@@ -525,10 +525,10 @@ static int sctp_outq_flush_rtx(struct sctp_outq *q, struct sctp_packet *pkt,
 			       int rtx_timeout, int *start_timer)
 {
 	struct list_head *lqueue;
-	struct list_head *lchunk;
+	struct list_head *lchunk, *lchunk1;
 	struct sctp_transport *transport = pkt->transport;
 	sctp_xmit_t status;
-	struct sctp_chunk *chunk;
+	struct sctp_chunk *chunk, *chunk1;
 	struct sctp_association *asoc;
 	int error = 0;
 
@@ -615,6 +615,12 @@ static int sctp_outq_flush_rtx(struct sctp_outq *q, struct sctp_packet *pkt,
 			 * the transmitted list.
 			 */
 			list_add_tail(lchunk, &transport->transmitted);
+
+			/* Mark the chunk as ineligible for fast retransmit 
+			 * after it is retransmitted.
+			 */
+			chunk->fast_retransmit = 0;
+
 			*start_timer = 1;
 			q->empty = 0;
 
@@ -622,6 +628,18 @@ static int sctp_outq_flush_rtx(struct sctp_outq *q, struct sctp_packet *pkt,
 			lchunk = sctp_list_dequeue(lqueue);
 			break;
 		};
+
+		/* If we are here due to a retransmit timeout or a fast
+		 * retransmit and if there are any chunks left in the retransmit
+		 * queue that could not fit in the PMTU sized packet, they need			 * to be marked as ineligible for a subsequent fast retransmit.
+		 */
+		if (rtx_timeout && !lchunk) {
+			list_for_each(lchunk1, lqueue) {
+				chunk1 = list_entry(lchunk1, struct sctp_chunk,
+						    transmitted_list);
+				chunk1->fast_retransmit = 0;
+			}
+		}
 	}
 
 	return error;
@@ -681,7 +699,7 @@ int sctp_outq_flush(struct sctp_outq *q, int rtx_timeout)
 	 */
 
 	queue = &q->control;
-	while ((chunk = (struct sctp_chunk *)skb_dequeue(queue))) {
+	while ((chunk = (struct sctp_chunk *)skb_dequeue(queue)) != NULL) {
 		/* Pick the right transport to use. */
 		new_transport = chunk->transport;
 
@@ -812,7 +830,7 @@ int sctp_outq_flush(struct sctp_outq *q, int rtx_timeout)
 		start_timer = 0;
 		queue = &q->out;
 
-		while ((chunk = sctp_outq_dequeue_data(q))) {
+		while ((chunk = sctp_outq_dequeue_data(q)) != NULL) {
 			/* RFC 2960 6.5 Every DATA chunk MUST carry a valid
 			 * stream identifier.
 			 */
@@ -866,7 +884,7 @@ int sctp_outq_flush(struct sctp_outq *q, int rtx_timeout)
 			SCTP_DEBUG_PRINTK("TX TSN 0x%x skb->head "
 					"%p skb->users %d.\n",
 					ntohl(chunk->subh.data_hdr->tsn),
-					chunk->skb ?chunk->skb->head : 0,
+					chunk->skb ?chunk->skb->head : NULL,
 					chunk->skb ?
 					atomic_read(&chunk->skb->users) : -1);
 
@@ -1725,6 +1743,6 @@ static void sctp_generate_fwdtsn(struct sctp_outq *q, __u32 ctsn)
 
 	if (ftsn_chunk) {
 		__skb_queue_tail(&q->control, (struct sk_buff *)ftsn_chunk);
-		SCTP_INC_STATS(SctpOutCtrlChunks);
+		SCTP_INC_STATS(SCTP_MIB_OUTCTRLCHUNKS);
 	}
 }
diff --git a/net/sctp/proc.c b/net/sctp/proc.c
index 633569b59..9c7d2e9d8 100644
--- a/net/sctp/proc.c
+++ b/net/sctp/proc.c
@@ -39,26 +39,24 @@
 #include <linux/init.h>
 #include <net/sctp/sctp.h>
 
-static char *sctp_snmp_list[] = {
-#define SCTP_SNMP_ENTRY(x) #x 
-	SCTP_SNMP_ENTRY(SctpCurrEstab),
-	SCTP_SNMP_ENTRY(SctpActiveEstabs),
-	SCTP_SNMP_ENTRY(SctpPassiveEstabs),
-	SCTP_SNMP_ENTRY(SctpAborteds),
-	SCTP_SNMP_ENTRY(SctpShutdowns),
-	SCTP_SNMP_ENTRY(SctpOutOfBlues),
-	SCTP_SNMP_ENTRY(SctpChecksumErrors),
-	SCTP_SNMP_ENTRY(SctpOutCtrlChunks),
-	SCTP_SNMP_ENTRY(SctpOutOrderChunks),
-	SCTP_SNMP_ENTRY(SctpOutUnorderChunks),
-	SCTP_SNMP_ENTRY(SctpInCtrlChunks),
-	SCTP_SNMP_ENTRY(SctpInOrderChunks),
-	SCTP_SNMP_ENTRY(SctpInUnorderChunks),
-	SCTP_SNMP_ENTRY(SctpFragUsrMsgs),
-	SCTP_SNMP_ENTRY(SctpReasmUsrMsgs),
-	SCTP_SNMP_ENTRY(SctpOutSCTPPacks),
-	SCTP_SNMP_ENTRY(SctpInSCTPPacks),
-#undef SCTP_SNMP_ENTRY
+struct snmp_mib sctp_snmp_list[] = {
+	SNMP_MIB_ITEM("SctpCurrEstab", SCTP_MIB_CURRESTAB),
+	SNMP_MIB_ITEM("SctpActiveEstabs", SCTP_MIB_ACTIVEESTABS),
+	SNMP_MIB_ITEM("SctpPassiveEstabs", SCTP_MIB_PASSIVEESTABS),
+	SNMP_MIB_ITEM("SctpAborteds", SCTP_MIB_ABORTEDS),
+	SNMP_MIB_ITEM("SctpShutdowns", SCTP_MIB_SHUTDOWNS),
+	SNMP_MIB_ITEM("SctpOutOfBlues", SCTP_MIB_OUTOFBLUES),
+	SNMP_MIB_ITEM("SctpChecksumErrors", SCTP_MIB_CHECKSUMERRORS),
+	SNMP_MIB_ITEM("SctpOutCtrlChunks", SCTP_MIB_OUTCTRLCHUNKS),
+	SNMP_MIB_ITEM("SctpOutOrderChunks", SCTP_MIB_OUTORDERCHUNKS),
+	SNMP_MIB_ITEM("SctpOutUnorderChunks", SCTP_MIB_OUTUNORDERCHUNKS),
+	SNMP_MIB_ITEM("SctpInCtrlChunks", SCTP_MIB_INCTRLCHUNKS),
+	SNMP_MIB_ITEM("SctpInOrderChunks", SCTP_MIB_INORDERCHUNKS),
+	SNMP_MIB_ITEM("SctpInUnorderChunks", SCTP_MIB_INUNORDERCHUNKS),
+	SNMP_MIB_ITEM("SctpFragUsrMsgs", SCTP_MIB_FRAGUSRMSGS),
+	SNMP_MIB_ITEM("SctpReasmUsrMsgs", SCTP_MIB_REASMUSRMSGS),
+	SNMP_MIB_ITEM("SctpOutSCTPPacks", SCTP_MIB_OUTSCTPPACKS),
+	SNMP_MIB_ITEM("SctpInSCTPPacks", SCTP_MIB_INSCTPPACKS),
 };
 
 /* Return the current value of a particular entry in the mib by adding its
@@ -88,9 +86,10 @@ static int sctp_snmp_seq_show(struct seq_file *seq, void *v)
 {
 	int i;
 
-	for (i = 0; i < sizeof(sctp_snmp_list) / sizeof(char *); i++)
-		seq_printf(seq, "%-32s\t%ld\n", sctp_snmp_list[i],
-			   fold_field((void **)sctp_statistics, i));
+	for (i = 0; sctp_snmp_list[i].name != NULL; i++)
+		seq_printf(seq, "%-32s\t%ld\n", sctp_snmp_list[i].name,
+			   fold_field((void **)sctp_statistics, 
+				      sctp_snmp_list[i].entry));
 
 	return 0;
 }
diff --git a/net/sctp/protocol.c b/net/sctp/protocol.c
index fbc958a75..16a57cf9b 100644
--- a/net/sctp/protocol.c
+++ b/net/sctp/protocol.c
@@ -101,7 +101,7 @@ __init int sctp_proc_init(void)
 {
 	if (!proc_net_sctp) {
 		struct proc_dir_entry *ent;
-		ent = proc_mkdir("net/sctp", 0);
+		ent = proc_mkdir("net/sctp", NULL);
 		if (ent) {
 			ent->owner = THIS_MODULE;
 			proc_net_sctp = ent;
@@ -134,7 +134,7 @@ void sctp_proc_exit(void)
 
 	if (proc_net_sctp) {
 		proc_net_sctp = NULL;
-		remove_proc_entry("net/sctp", 0);
+		remove_proc_entry("net/sctp", NULL);
 	}
 }
 
@@ -603,7 +603,7 @@ struct sock *sctp_v4_create_accept_sk(struct sock *sk,
 #endif
 
 	if (newsk->sk_prot->init(newsk)) {
-		inet_sock_release(newsk);
+		sk_common_release(newsk);
 		newsk = NULL;
 	}
 
@@ -808,7 +808,7 @@ static inline int sctp_v4_xmit(struct sk_buff *skb,
 			  NIPQUAD(((struct rtable *)skb->dst)->rt_src),
 			  NIPQUAD(((struct rtable *)skb->dst)->rt_dst));
 
-	SCTP_INC_STATS(SctpOutSCTPPacks);
+	SCTP_INC_STATS(SCTP_MIB_OUTSCTPPACKS);
 	return ip_queue_xmit(skb, ipfragok);
 }
 
@@ -846,10 +846,10 @@ struct proto_ops inet_seqpacket_ops = {
 	.ioctl       = inet_ioctl,
 	.listen      = sctp_inet_listen,
 	.shutdown    = inet_shutdown,     /* Looks harmless.  */
-	.setsockopt  = inet_setsockopt,   /* IP_SOL IP_OPTION is a problem. */
-	.getsockopt  = inet_getsockopt,
+	.setsockopt  = sock_common_setsockopt,   /* IP_SOL IP_OPTION is a problem. */
+	.getsockopt  = sock_common_getsockopt,
 	.sendmsg     = inet_sendmsg,
-	.recvmsg     = inet_recvmsg,
+	.recvmsg     = sock_common_recvmsg,
 	.mmap        = sock_no_mmap,
 	.sendpage    = sock_no_sendpage,
 };
@@ -875,7 +875,7 @@ static struct inet_protosw sctp_stream_protosw = {
 };
 
 /* Register with IP layer.  */
-static struct inet_protocol sctp_protocol = {
+static struct net_protocol sctp_protocol = {
 	.handler     = sctp_rcv,
 	.err_handler = sctp_v4_err,
 	.no_policy   = 1,
diff --git a/net/sctp/sm_make_chunk.c b/net/sctp/sm_make_chunk.c
index b80ea903b..c2ca73259 100644
--- a/net/sctp/sm_make_chunk.c
+++ b/net/sctp/sm_make_chunk.c
@@ -1834,23 +1834,27 @@ int sctp_process_init(struct sctp_association *asoc, sctp_cid_t cid,
 	/* Allocate storage for the negotiated streams if it is not a temporary 	 * association.
 	 */
 	if (!asoc->temp) {
-		sctp_assoc_t assoc_id;
+		int assoc_id;
+		int error;
 
 		asoc->ssnmap = sctp_ssnmap_new(asoc->c.sinit_max_instreams,
 					       asoc->c.sinit_num_ostreams, gfp);
 		if (!asoc->ssnmap)
 			goto clean_up;
 
-		do {
-			if (unlikely(!idr_pre_get(&sctp_assocs_id, gfp)))
-				goto clean_up;
-			spin_lock_bh(&sctp_assocs_id_lock);
-			assoc_id = (sctp_assoc_t)idr_get_new(&sctp_assocs_id,
-							     (void *)asoc);
-			spin_unlock_bh(&sctp_assocs_id_lock);
-		} while (unlikely((int)assoc_id == -1));
+	retry:
+		if (unlikely(!idr_pre_get(&sctp_assocs_id, gfp)))
+			goto clean_up;
+		spin_lock_bh(&sctp_assocs_id_lock);
+		error = idr_get_new_above(&sctp_assocs_id, (void *)asoc, 1,
+					  &assoc_id);
+		spin_unlock_bh(&sctp_assocs_id_lock);
+		if (error == -EAGAIN)
+			goto retry;
+		else if (error)
+			goto clean_up;
 
-		asoc->assoc_id = assoc_id;
+		asoc->assoc_id = (sctp_assoc_t) assoc_id;
 	}
 
 	/* ADDIP Section 4.1 ASCONF Chunk Procedures
diff --git a/net/sctp/sm_sideeffect.c b/net/sctp/sm_sideeffect.c
index 83cee2acd..c9705de46 100644
--- a/net/sctp/sm_sideeffect.c
+++ b/net/sctp/sm_sideeffect.c
@@ -529,6 +529,23 @@ static void sctp_cmd_hb_timers_stop(sctp_cmd_seq_t *cmds,
 	}
 }
 
+/* Helper function to stop any pending T3-RTX timers */
+static void sctp_cmd_t3_rtx_timers_stop(sctp_cmd_seq_t *cmds,
+				        struct sctp_association *asoc)
+{
+	struct sctp_transport *t;
+	struct list_head *pos;
+
+	list_for_each(pos, &asoc->peer.transport_addr_list) {
+		t = list_entry(pos, struct sctp_transport, transports);
+		if (timer_pending(&t->T3_rtx_timer) &&
+		    del_timer(&t->T3_rtx_timer)) {
+			sctp_transport_put(t);
+		}
+	}
+}
+
+
 /* Helper function to update the heartbeat timer. */
 static void sctp_cmd_hb_timer_update(sctp_cmd_seq_t *cmds,
 				     struct sctp_association *asoc,
@@ -749,6 +766,26 @@ static void sctp_cmd_process_fwdtsn(struct sctp_ulpq *ulpq,
 	return;
 }
 
+/* Helper function to remove the association non-primary peer 
+ * transports.
+ */ 
+static void sctp_cmd_del_non_primary(struct sctp_association *asoc)
+{
+	struct sctp_transport *t;
+	struct list_head *pos;
+	struct list_head *temp;
+
+	list_for_each_safe(pos, temp, &asoc->peer.transport_addr_list) {
+		t = list_entry(pos, struct sctp_transport, transports);
+		if (!sctp_cmp_addr_exact(&t->ipaddr,
+		                         &asoc->peer.primary_addr)) {
+			sctp_assoc_del_peer(asoc, &t->ipaddr);
+		}
+	}
+
+	return;
+}
+
 /* These three macros allow us to pull the debugging code out of the
  * main flow of sctp_do_sm() to keep attention focused on the real
  * functionality there.
@@ -1048,6 +1085,27 @@ int sctp_cmd_interpreter(sctp_event_t event_type, sctp_subtype_t subtype,
 			if (cmd->obj.ptr)
 				sctp_add_cmd_sf(commands, SCTP_CMD_REPLY,
 						SCTP_CHUNK(cmd->obj.ptr));
+
+			/* FIXME - Eventually come up with a cleaner way to
+			 * enabling COOKIE-ECHO + DATA bundling during 
+			 * multihoming stale cookie scenarios, the following 
+			 * command plays with asoc->peer.retran_path to 
+			 * avoid the problem of sending the COOKIE-ECHO and 
+			 * DATA in different paths, which could result 
+			 * in the association being ABORTed if the DATA chunk 
+			 * is processed first by the server.  Checking the
+			 * init error counter simply causes this command
+			 * to be executed only during failed attempts of
+			 * association establishment.
+			 */
+			if ((asoc->peer.retran_path != 
+			     asoc->peer.primary_path) && 
+			    (asoc->counters[SCTP_COUNTER_INIT_ERROR] > 0)) {
+				sctp_add_cmd_sf(commands, 
+				                SCTP_CMD_FORCE_PRIM_RETRAN,
+						SCTP_NULL());
+			}
+
 			break;
 
 		case SCTP_CMD_GEN_SHUTDOWN:
@@ -1282,6 +1340,19 @@ int sctp_cmd_interpreter(sctp_event_t event_type, sctp_subtype_t subtype,
 		case SCTP_CMD_CLEAR_INIT_TAG:
 			asoc->peer.i.init_tag = 0;
 			break;
+		case SCTP_CMD_DEL_NON_PRIMARY:
+			sctp_cmd_del_non_primary(asoc);
+			break;
+		case SCTP_CMD_T3_RTX_TIMERS_STOP:
+			sctp_cmd_t3_rtx_timers_stop(commands, asoc);
+			break;
+		case SCTP_CMD_FORCE_PRIM_RETRAN:
+			t = asoc->peer.retran_path;
+			asoc->peer.retran_path = asoc->peer.primary_path;
+			error = sctp_outq_uncork(&asoc->outqueue);
+			local_cork = 0;
+			asoc->peer.retran_path = t;
+			break;
 		default:
 			printk(KERN_WARNING "Impossible command: %u, %p\n",
 			       cmd->verb, cmd->obj.ptr);
diff --git a/net/sctp/sm_statefuns.c b/net/sctp/sm_statefuns.c
index 30849b0e1..addb95d79 100644
--- a/net/sctp/sm_statefuns.c
+++ b/net/sctp/sm_statefuns.c
@@ -148,8 +148,8 @@ sctp_disposition_t sctp_sf_do_4_C(const struct sctp_endpoint *ep,
 	sctp_add_cmd_sf(commands, SCTP_CMD_NEW_STATE,
 			SCTP_STATE(SCTP_STATE_CLOSED));
 
-	SCTP_INC_STATS(SctpShutdowns);
-	SCTP_DEC_STATS(SctpCurrEstab);
+	SCTP_INC_STATS(SCTP_MIB_SHUTDOWNS);
+	SCTP_DEC_STATS(SCTP_MIB_CURRESTAB);
 
 	sctp_add_cmd_sf(commands, SCTP_CMD_DELETE_TCB, SCTP_NULL());
 
@@ -245,7 +245,7 @@ sctp_disposition_t sctp_sf_do_5_1B_init(const struct sctp_endpoint *ep,
 			if (packet) {
 				sctp_add_cmd_sf(commands, SCTP_CMD_SEND_PKT,
 						SCTP_PACKET(packet));
-				SCTP_INC_STATS(SctpOutCtrlChunks);
+				SCTP_INC_STATS(SCTP_MIB_OUTCTRLCHUNKS);
 				return SCTP_DISPOSITION_CONSUME;
 			} else {
 				return SCTP_DISPOSITION_NOMEM;
@@ -404,7 +404,7 @@ sctp_disposition_t sctp_sf_do_5_1C_ack(const struct sctp_endpoint *ep,
 		sctp_add_cmd_sf(commands, SCTP_CMD_REPLY, SCTP_CHUNK(reply));
 		sctp_add_cmd_sf(commands, SCTP_CMD_NEW_STATE,
 				SCTP_STATE(SCTP_STATE_CLOSED));
-		SCTP_INC_STATS(SctpAborteds);
+		SCTP_INC_STATS(SCTP_MIB_ABORTEDS);
 		sctp_add_cmd_sf(commands, SCTP_CMD_DELETE_TCB, SCTP_NULL());
 		return SCTP_DISPOSITION_DELETE_TCB;
 	}
@@ -415,7 +415,7 @@ sctp_disposition_t sctp_sf_do_5_1C_ack(const struct sctp_endpoint *ep,
 			      (sctp_init_chunk_t *)chunk->chunk_hdr, chunk,
 			      &err_chunk)) {
 
-		SCTP_INC_STATS(SctpAborteds);
+		SCTP_INC_STATS(SCTP_MIB_ABORTEDS);
 
 		/* This chunk contains fatal error. It is to be discarded.
 		 * Send an ABORT, with causes if there is any.
@@ -432,7 +432,7 @@ sctp_disposition_t sctp_sf_do_5_1C_ack(const struct sctp_endpoint *ep,
 			if (packet) {
 				sctp_add_cmd_sf(commands, SCTP_CMD_SEND_PKT,
 						SCTP_PACKET(packet));
-				SCTP_INC_STATS(SctpOutCtrlChunks);
+				SCTP_INC_STATS(SCTP_MIB_OUTCTRLCHUNKS);
 				sctp_add_cmd_sf(commands, SCTP_CMD_NEW_STATE,
 						SCTP_STATE(SCTP_STATE_CLOSED));
 				sctp_add_cmd_sf(commands, SCTP_CMD_DELETE_TCB,
@@ -472,8 +472,6 @@ sctp_disposition_t sctp_sf_do_5_1C_ack(const struct sctp_endpoint *ep,
 	 */
 	sctp_add_cmd_sf(commands, SCTP_CMD_TIMER_STOP,
 			SCTP_TO(SCTP_EVENT_TIMEOUT_T1_INIT));
-	sctp_add_cmd_sf(commands, SCTP_CMD_COUNTER_RESET,
-			SCTP_COUNTER(SCTP_COUNTER_INIT_ERROR));
 	sctp_add_cmd_sf(commands, SCTP_CMD_TIMER_START,
 			SCTP_TO(SCTP_EVENT_TIMEOUT_T1_COOKIE));
 	sctp_add_cmd_sf(commands, SCTP_CMD_NEW_STATE,
@@ -587,8 +585,8 @@ sctp_disposition_t sctp_sf_do_5_1D_ce(const struct sctp_endpoint *ep,
 	sctp_add_cmd_sf(commands, SCTP_CMD_NEW_ASOC, SCTP_ASOC(new_asoc));
 	sctp_add_cmd_sf(commands, SCTP_CMD_NEW_STATE,
 			SCTP_STATE(SCTP_STATE_ESTABLISHED));
-	SCTP_INC_STATS(SctpCurrEstab);
-	SCTP_INC_STATS(SctpPassiveEstabs);
+	SCTP_INC_STATS(SCTP_MIB_CURRESTAB);
+	SCTP_INC_STATS(SCTP_MIB_PASSIVEESTABS);
 	sctp_add_cmd_sf(commands, SCTP_CMD_HB_TIMERS_START, SCTP_NULL());
 
 	if (new_asoc->autoclose)
@@ -674,6 +672,15 @@ sctp_disposition_t sctp_sf_do_5_1E_ca(const struct sctp_endpoint *ep,
 	if (!sctp_vtag_verify(chunk, asoc))
 		return sctp_sf_pdiscard(ep, asoc, type, arg, commands);
 
+	/* Reset init error count upon receipt of COOKIE-ACK,
+	 * to avoid problems with the managemement of this
+	 * counter in stale cookie situations when a transition back
+	 * from the COOKIE-ECHOED state to the COOKIE-WAIT
+	 * state is performed.
+	 */
+	sctp_add_cmd_sf(commands, SCTP_CMD_COUNTER_RESET,
+	                SCTP_COUNTER(SCTP_COUNTER_INIT_ERROR));
+
 	/* RFC 2960 5.1 Normal Establishment of an Association
 	 *
 	 * E) Upon reception of the COOKIE ACK, endpoint "A" will move
@@ -684,8 +691,8 @@ sctp_disposition_t sctp_sf_do_5_1E_ca(const struct sctp_endpoint *ep,
 			SCTP_TO(SCTP_EVENT_TIMEOUT_T1_COOKIE));
 	sctp_add_cmd_sf(commands, SCTP_CMD_NEW_STATE,
 			SCTP_STATE(SCTP_STATE_ESTABLISHED));
-	SCTP_INC_STATS(SctpCurrEstab);
-	SCTP_INC_STATS(SctpActiveEstabs);
+	SCTP_INC_STATS(SCTP_MIB_CURRESTAB);
+	SCTP_INC_STATS(SCTP_MIB_ACTIVEESTABS);
 	sctp_add_cmd_sf(commands, SCTP_CMD_HB_TIMERS_START, SCTP_NULL());
 	if (asoc->autoclose)
 		sctp_add_cmd_sf(commands, SCTP_CMD_TIMER_START,
@@ -757,8 +764,8 @@ sctp_disposition_t sctp_sf_sendbeat_8_3(const struct sctp_endpoint *ep,
 		/* CMD_ASSOC_FAILED calls CMD_DELETE_TCB. */
 		sctp_add_cmd_sf(commands, SCTP_CMD_ASSOC_FAILED,
 				SCTP_U32(SCTP_ERROR_NO_ERROR));
-		SCTP_INC_STATS(SctpAborteds);
-		SCTP_DEC_STATS(SctpCurrEstab);
+		SCTP_INC_STATS(SCTP_MIB_ABORTEDS);
+		SCTP_DEC_STATS(SCTP_MIB_CURRESTAB);
 		return SCTP_DISPOSITION_DELETE_TCB;
 	}
 
@@ -960,7 +967,7 @@ static int sctp_sf_send_restart_abort(union sctp_addr *ssa,
 		goto out;
 	sctp_add_cmd_sf(commands, SCTP_CMD_SEND_PKT, SCTP_PACKET(pkt));
 
-	SCTP_INC_STATS(SctpOutCtrlChunks);
+	SCTP_INC_STATS(SCTP_MIB_OUTCTRLCHUNKS);
 
 	/* Discard the rest of the inbound packet. */
 	sctp_add_cmd_sf(commands, SCTP_CMD_DISCARD_PACKET, SCTP_NULL());
@@ -995,7 +1002,7 @@ static int sctp_sf_check_restart_addrs(const struct sctp_association *new_asoc,
 	/* Search through all current addresses and make sure
 	 * we aren't adding any new ones.
 	 */
-	new_addr = 0;
+	new_addr = NULL;
 	found = 0;
 
 	list_for_each(pos, &new_asoc->peer.transport_addr_list) {
@@ -1163,7 +1170,7 @@ static sctp_disposition_t sctp_sf_do_unexpected_init(
 			if (packet) {
 				sctp_add_cmd_sf(commands, SCTP_CMD_SEND_PKT,
 						SCTP_PACKET(packet));
-				SCTP_INC_STATS(SctpOutCtrlChunks);
+				SCTP_INC_STATS(SCTP_MIB_OUTCTRLCHUNKS);
 				retval = SCTP_DISPOSITION_CONSUME;
 			} else {
 				retval = SCTP_DISPOSITION_NOMEM;
@@ -1501,7 +1508,7 @@ static sctp_disposition_t sctp_sf_do_dupcook_b(const struct sctp_endpoint *ep,
 	sctp_add_cmd_sf(commands, SCTP_CMD_UPDATE_ASSOC, SCTP_ASOC(new_asoc));
 	sctp_add_cmd_sf(commands, SCTP_CMD_NEW_STATE,
 			SCTP_STATE(SCTP_STATE_ESTABLISHED));
-	SCTP_INC_STATS(SctpCurrEstab);
+	SCTP_INC_STATS(SCTP_MIB_CURRESTAB);
 	sctp_add_cmd_sf(commands, SCTP_CMD_HB_TIMERS_START, SCTP_NULL());
 
 	repl = sctp_make_cookie_ack(new_asoc, chunk);
@@ -1585,7 +1592,7 @@ static sctp_disposition_t sctp_sf_do_dupcook_d(const struct sctp_endpoint *ep,
 				SCTP_TO(SCTP_EVENT_TIMEOUT_T1_COOKIE));
 		sctp_add_cmd_sf(commands, SCTP_CMD_NEW_STATE,
 				SCTP_STATE(SCTP_STATE_ESTABLISHED));
-		SCTP_INC_STATS(SctpCurrEstab);
+		SCTP_INC_STATS(SCTP_MIB_CURRESTAB);
 		sctp_add_cmd_sf(commands, SCTP_CMD_HB_TIMERS_START,
 				SCTP_NULL());
 
@@ -1872,8 +1879,6 @@ sctp_disposition_t sctp_sf_do_5_2_6_stale(const struct sctp_endpoint *ep,
 	time_t stale;
 	sctp_cookie_preserve_param_t bht;
 	sctp_errhdr_t *err;
-	struct list_head *pos;
-	struct sctp_transport *t;
 	struct sctp_chunk *reply;
 	struct sctp_bind_addr *bp;
 	int attempts;
@@ -1920,20 +1925,27 @@ sctp_disposition_t sctp_sf_do_5_2_6_stale(const struct sctp_endpoint *ep,
 	/* Clear peer's init_tag cached in assoc as we are sending a new INIT */
 	sctp_add_cmd_sf(commands, SCTP_CMD_CLEAR_INIT_TAG, SCTP_NULL());
 
+	/* Stop pending T3-rtx and heartbeat timers */
+	sctp_add_cmd_sf(commands, SCTP_CMD_T3_RTX_TIMERS_STOP, SCTP_NULL());
+	sctp_add_cmd_sf(commands, SCTP_CMD_HB_TIMERS_STOP, SCTP_NULL());
+
+	/* Delete non-primary peer ip addresses since we are transitioning
+	 * back to the COOKIE-WAIT state
+	 */
+	sctp_add_cmd_sf(commands, SCTP_CMD_DEL_NON_PRIMARY, SCTP_NULL());
+
+	/* If we've sent any data bundled with COOKIE-ECHO we will need to 
+	 * resend 
+	 */
+	sctp_add_cmd_sf(commands, SCTP_CMD_RETRAN, 
+			SCTP_TRANSPORT(asoc->peer.primary_path));
+
 	/* Cast away the const modifier, as we want to just
 	 * rerun it through as a sideffect.
 	 */
 	sctp_add_cmd_sf(commands, SCTP_CMD_COUNTER_INC,
 			SCTP_COUNTER(SCTP_COUNTER_INIT_ERROR));
 
-	/* If we've sent any data bundled with COOKIE-ECHO we need to
-	 * resend.
-	 */
-	list_for_each(pos, &asoc->peer.transport_addr_list) {
-		t = list_entry(pos, struct sctp_transport, transports);
-		sctp_add_cmd_sf(commands, SCTP_CMD_RETRAN, SCTP_TRANSPORT(t));
-	}
-
 	sctp_add_cmd_sf(commands, SCTP_CMD_TIMER_STOP,
 			SCTP_TO(SCTP_EVENT_TIMEOUT_T1_COOKIE));
 	sctp_add_cmd_sf(commands, SCTP_CMD_NEW_STATE,
@@ -2001,8 +2013,8 @@ sctp_disposition_t sctp_sf_do_9_1_abort(const struct sctp_endpoint *ep,
 
  	/* ASSOC_FAILED will DELETE_TCB. */
 	sctp_add_cmd_sf(commands, SCTP_CMD_ASSOC_FAILED, SCTP_U32(error));
-	SCTP_INC_STATS(SctpAborteds);
-	SCTP_DEC_STATS(SctpCurrEstab);
+	SCTP_INC_STATS(SCTP_MIB_ABORTEDS);
+	SCTP_DEC_STATS(SCTP_MIB_CURRESTAB);
 
 	return SCTP_DISPOSITION_ABORT;
 }
@@ -2027,7 +2039,7 @@ sctp_disposition_t sctp_sf_cookie_wait_abort(const struct sctp_endpoint *ep,
 
 	sctp_add_cmd_sf(commands, SCTP_CMD_NEW_STATE,
 			SCTP_STATE(SCTP_STATE_CLOSED));
-	SCTP_INC_STATS(SctpAborteds);
+	SCTP_INC_STATS(SCTP_MIB_ABORTEDS);
 	sctp_add_cmd_sf(commands, SCTP_CMD_TIMER_STOP,
 			SCTP_TO(SCTP_EVENT_TIMEOUT_T1_INIT));
 
@@ -2321,12 +2333,7 @@ sctp_disposition_t sctp_sf_eat_data_6_2(const struct sctp_endpoint *ep,
 					sctp_cmd_seq_t *commands)
 {
 	struct sctp_chunk *chunk = arg;
-	sctp_datahdr_t *data_hdr;
-	struct sctp_chunk *err;
-	size_t datalen;
-	sctp_verb_t deliver;
-	int tmp;
-	__u32 tsn;
+	int error;
 
 	if (!sctp_vtag_verify(chunk, asoc)) {
 		sctp_add_cmd_sf(commands, SCTP_CMD_REPORT_BAD_TAG,
@@ -2334,158 +2341,22 @@ sctp_disposition_t sctp_sf_eat_data_6_2(const struct sctp_endpoint *ep,
 		return sctp_sf_pdiscard(ep, asoc, type, arg, commands);
         }
 
-	data_hdr = chunk->subh.data_hdr = (sctp_datahdr_t *)chunk->skb->data;
-	skb_pull(chunk->skb, sizeof(sctp_datahdr_t));
-
-	tsn = ntohl(data_hdr->tsn);
-	SCTP_DEBUG_PRINTK("eat_data: TSN 0x%x.\n", tsn);
-
-	/* ASSERT:  Now skb->data is really the user data.  */
-
-	/* Process ECN based congestion.
-	 *
-	 * Since the chunk structure is reused for all chunks within
-	 * a packet, we use ecn_ce_done to track if we've already
-	 * done CE processing for this packet.
-	 *
-	 * We need to do ECN processing even if we plan to discard the
-	 * chunk later.
-	 */
-
-	if (!chunk->ecn_ce_done) {
-		struct sctp_af *af;
-		chunk->ecn_ce_done = 1;
-
-		af = sctp_get_af_specific(
-			ipver2af(chunk->skb->nh.iph->version));
-
-		if (af && af->is_ce(chunk->skb) && asoc->peer.ecn_capable) {
-			/* Do real work as sideffect. */
-			sctp_add_cmd_sf(commands, SCTP_CMD_ECN_CE,
-					SCTP_U32(tsn));
-		}
-	}
-
-	tmp = sctp_tsnmap_check(&asoc->peer.tsn_map, tsn);
-	if (tmp < 0) {
-		/* The TSN is too high--silently discard the chunk and
-		 * count on it getting retransmitted later.
-		 */
+	error = sctp_eat_data(asoc, chunk, commands );
+	switch (error) {
+	case SCTP_IERROR_NO_ERROR:
+		break;
+	case SCTP_IERROR_HIGH_TSN:
+	case SCTP_IERROR_BAD_STREAM:
 		goto discard_noforce;
-	} else if (tmp > 0) {
-		/* This is a duplicate.  Record it.  */
-		sctp_add_cmd_sf(commands, SCTP_CMD_REPORT_DUP, SCTP_U32(tsn));
+	case SCTP_IERROR_DUP_TSN:
+	case SCTP_IERROR_IGNORE_TSN:
 		goto discard_force;
+	case SCTP_IERROR_NO_DATA:
+		goto consume;
+	default:
+		BUG();
 	}
 
-	/* This is a new TSN.  */
-
-	/* Discard if there is no room in the receive window.
-	 * Actually, allow a little bit of overflow (up to a MTU).
-	 */
-	datalen = ntohs(chunk->chunk_hdr->length);
-	datalen -= sizeof(sctp_data_chunk_t);
-
-	deliver = SCTP_CMD_CHUNK_ULP;
-
-	/* Think about partial delivery. */
-	if ((datalen >= asoc->rwnd) && (!asoc->ulpq.pd_mode)) {
-
-		/* Even if we don't accept this chunk there is
-		 * memory pressure.
-		 */
-		sctp_add_cmd_sf(commands, SCTP_CMD_PART_DELIVER, SCTP_NULL());
-	}
-
-        /* Spill over rwnd a little bit.  Note: While allowed, this spill over
-	 * seems a bit troublesome in that frag_point varies based on
-	 * PMTU.  In cases, such as loopback, this might be a rather
-	 * large spill over.
-	 */
-	if (!asoc->rwnd || asoc->rwnd_over ||
-	    (datalen > asoc->rwnd + asoc->frag_point)) {
-
-		/* If this is the next TSN, consider reneging to make
-		 * room.   Note: Playing nice with a confused sender.  A
-		 * malicious sender can still eat up all our buffer
-		 * space and in the future we may want to detect and
-		 * do more drastic reneging.
-		 */
-		if (sctp_tsnmap_has_gap(&asoc->peer.tsn_map) &&
-		    (sctp_tsnmap_get_ctsn(&asoc->peer.tsn_map) + 1) == tsn) {
-			SCTP_DEBUG_PRINTK("Reneging for tsn:%u\n", tsn);
-			deliver = SCTP_CMD_RENEGE;
-		} else {
-			SCTP_DEBUG_PRINTK("Discard tsn: %u len: %Zd, "
-					  "rwnd: %d\n", tsn, datalen,
-					  asoc->rwnd);
-			goto discard_force;
-		}
-	}
-
-	/*
-	 * Section 3.3.10.9 No User Data (9)
-	 *
-	 * Cause of error
-	 * ---------------
-	 * No User Data:  This error cause is returned to the originator of a
-	 * DATA chunk if a received DATA chunk has no user data.
-	 */
-	if (unlikely(0 == datalen)) {
-		err = sctp_make_abort_no_data(asoc, chunk, tsn);
-		if (err) {
-			sctp_add_cmd_sf(commands, SCTP_CMD_REPLY,
-					SCTP_CHUNK(err));
-		}
-		/* We are going to ABORT, so we might as well stop
-		 * processing the rest of the chunks in the packet.
-		 */
-		sctp_add_cmd_sf(commands, SCTP_CMD_DISCARD_PACKET,SCTP_NULL());
-		sctp_add_cmd_sf(commands, SCTP_CMD_ASSOC_FAILED,
-				SCTP_U32(SCTP_ERROR_NO_DATA));
-		SCTP_INC_STATS(SctpAborteds);
-		SCTP_DEC_STATS(SctpCurrEstab);
-		return SCTP_DISPOSITION_CONSUME;
-	}
-
-	/* If definately accepting the DATA chunk, record its TSN, otherwise
-	 * wait for renege processing.
-	 */
-	if (SCTP_CMD_CHUNK_ULP == deliver)
-		sctp_add_cmd_sf(commands, SCTP_CMD_REPORT_TSN, SCTP_U32(tsn));
-
-	/* Note: Some chunks may get overcounted (if we drop) or overcounted
-	 * if we renege and the chunk arrives again.
-	 */
-	if (chunk->chunk_hdr->flags & SCTP_DATA_UNORDERED)
-		SCTP_INC_STATS(SctpInUnorderChunks);
-	else
-		SCTP_INC_STATS(SctpInOrderChunks);
-
-	/* RFC 2960 6.5 Stream Identifier and Stream Sequence Number
-	 *
-	 * If an endpoint receive a DATA chunk with an invalid stream
-	 * identifier, it shall acknowledge the reception of the DATA chunk
-	 * following the normal procedure, immediately send an ERROR chunk
-	 * with cause set to "Invalid Stream Identifier" (See Section 3.3.10)
-	 * and discard the DATA chunk.
-	 */
-	if (ntohs(data_hdr->stream) >= asoc->c.sinit_max_instreams) {
-		err = sctp_make_op_error(asoc, chunk, SCTP_ERROR_INV_STRM,
-					 &data_hdr->stream,
-					 sizeof(data_hdr->stream));
-		if (err)
-			sctp_add_cmd_sf(commands, SCTP_CMD_REPLY,
-					SCTP_CHUNK(err));
-		goto discard_noforce;
-	}
-
-	/* Send the data up to the user.  Note:  Schedule  the
-	 * SCTP_CMD_CHUNK_ULP cmd before the SCTP_CMD_GEN_SACK, as the SACK
-	 * chunk needs the updated rwnd.
-	 */
-	sctp_add_cmd_sf(commands, deliver, SCTP_CHUNK(chunk));
-
 	if (asoc->autoclose) {
 		sctp_add_cmd_sf(commands, SCTP_CMD_TIMER_RESTART,
 				SCTP_TO(SCTP_EVENT_TIMEOUT_AUTOCLOSE));
@@ -2551,6 +2422,9 @@ discard_noforce:
 				SCTP_TO(SCTP_EVENT_TIMEOUT_SACK));
 	}
 	return SCTP_DISPOSITION_DISCARD;
+consume:
+	return SCTP_DISPOSITION_CONSUME;
+	
 }
 
 /*
@@ -2576,11 +2450,7 @@ sctp_disposition_t sctp_sf_eat_data_fast_4_4(const struct sctp_endpoint *ep,
 				     sctp_cmd_seq_t *commands)
 {
 	struct sctp_chunk *chunk = arg;
-	sctp_datahdr_t *data_hdr;
-	struct sctp_chunk *err;
-	size_t datalen;
-	int tmp;
-	__u32 tsn;
+	int error;
 
 	if (!sctp_vtag_verify(chunk, asoc)) {
 		sctp_add_cmd_sf(commands, SCTP_CMD_REPORT_BAD_TAG,
@@ -2588,110 +2458,22 @@ sctp_disposition_t sctp_sf_eat_data_fast_4_4(const struct sctp_endpoint *ep,
 		return sctp_sf_pdiscard(ep, asoc, type, arg, commands);
 	}
 
-	data_hdr = chunk->subh.data_hdr = (sctp_datahdr_t *) chunk->skb->data;
-	skb_pull(chunk->skb, sizeof(sctp_datahdr_t));
-
-	tsn = ntohl(data_hdr->tsn);
-
-	SCTP_DEBUG_PRINTK("eat_data: TSN 0x%x.\n", tsn);
-
-	/* ASSERT:  Now skb->data is really the user data.  */
-
-	/* Process ECN based congestion.
-	 *
-	 * Since the chunk structure is reused for all chunks within
-	 * a packet, we use ecn_ce_done to track if we've already
-	 * done CE processing for this packet.
-	 *
-	 * We need to do ECN processing even if we plan to discard the
-	 * chunk later.
-	 */
-	if (!chunk->ecn_ce_done) {
-		struct sctp_af *af;
-		chunk->ecn_ce_done = 1;
-
-		af = sctp_get_af_specific(
-			ipver2af(chunk->skb->nh.iph->version));
-
-		if (af && af->is_ce(chunk->skb) && asoc->peer.ecn_capable) {
-			/* Do real work as sideffect. */
-			sctp_add_cmd_sf(commands, SCTP_CMD_ECN_CE,
-					SCTP_U32(tsn));
-		}
-	}
-
-	tmp = sctp_tsnmap_check(&asoc->peer.tsn_map, tsn);
-	if (tmp < 0) {
-		/* The TSN is too high--silently discard the chunk and
-		 * count on it getting retransmitted later.
-		 */
-		goto gen_shutdown;
-	} else if (tmp > 0) {
-		/* This is a duplicate.  Record it.  */
-		sctp_add_cmd_sf(commands, SCTP_CMD_REPORT_DUP, SCTP_U32(tsn));
-		goto gen_shutdown;
-	}
-
-	/* This is a new TSN.  */
-
-	datalen = ntohs(chunk->chunk_hdr->length);
-	datalen -= sizeof(sctp_data_chunk_t);
-
-	/*
-	 * Section 3.3.10.9 No User Data (9)
-	 *
-	 * Cause of error
-	 * ---------------
-	 * No User Data:  This error cause is returned to the originator of a
-	 * DATA chunk if a received DATA chunk has no user data.
-	 */
-	if (unlikely(0 == datalen)) {
-		err = sctp_make_abort_no_data(asoc, chunk, tsn);
-		if (err) {
-			sctp_add_cmd_sf(commands, SCTP_CMD_REPLY,
-					SCTP_CHUNK(err));
-		}
-		/* We are going to ABORT, so we might as well stop
-		 * processing the rest of the chunks in the packet.
-		 */
-		sctp_add_cmd_sf(commands, SCTP_CMD_DISCARD_PACKET,SCTP_NULL());
-		sctp_add_cmd_sf(commands, SCTP_CMD_ASSOC_FAILED,
-				SCTP_U32(SCTP_ERROR_NO_DATA));
-		SCTP_INC_STATS(SctpAborteds);
-		SCTP_DEC_STATS(SctpCurrEstab);
-		return SCTP_DISPOSITION_CONSUME;
-	}
-
-	/* We are accepting this DATA chunk. */
-
-	/* Record the fact that we have received this TSN.  */
-	sctp_add_cmd_sf(commands, SCTP_CMD_REPORT_TSN, SCTP_U32(tsn));
-
-	if (chunk->chunk_hdr->flags & SCTP_DATA_UNORDERED)
-		SCTP_INC_STATS(SctpInUnorderChunks);
-	else
-		SCTP_INC_STATS(SctpInOrderChunks);
-
-	/* RFC 2960 6.5 Stream Identifier and Stream Sequence Number
-	 *
-	 * If an endpoint receive a DATA chunk with an invalid stream
-	 * identifier, it shall acknowledge the reception of the DATA chunk
-	 * following the normal procedure, immediately send an ERROR chunk
-	 * with cause set to "Invalid Stream Identifier" (See Section 3.3.10)
-	 * and discard the DATA chunk.
-	 */
-	if (ntohs(data_hdr->stream) >= asoc->c.sinit_max_instreams) {
-		err = sctp_make_op_error(asoc, chunk, SCTP_ERROR_INV_STRM,
-					 &data_hdr->stream,
-					 sizeof(data_hdr->stream));
-		if (err) {
-			sctp_add_cmd_sf(commands, SCTP_CMD_REPLY,
-					SCTP_CHUNK(err));
-		}
+	error = sctp_eat_data(asoc, chunk, commands );
+	switch (error) {
+	case SCTP_IERROR_NO_ERROR:
+	case SCTP_IERROR_HIGH_TSN:
+	case SCTP_IERROR_DUP_TSN:
+	case SCTP_IERROR_IGNORE_TSN:
+	case SCTP_IERROR_BAD_STREAM:
+		break;
+	case SCTP_IERROR_NO_DATA:
+		goto consume;
+	default:
+		BUG();
 	}
 
 	/* Go a head and force a SACK, since we are shutting down. */
-gen_shutdown:
+
 	/* Implementor's Guide.
 	 *
 	 * While in SHUTDOWN-SENT state, the SHUTDOWN sender MUST immediately
@@ -2707,6 +2489,8 @@ gen_shutdown:
 		sctp_add_cmd_sf(commands, SCTP_CMD_TIMER_RESTART,
 				SCTP_TO(SCTP_EVENT_TIMEOUT_T2_SHUTDOWN));
 	}
+
+consume:
 	return SCTP_DISPOSITION_CONSUME;
 }
 
@@ -2832,7 +2616,7 @@ sctp_disposition_t sctp_sf_tabort_8_4_8(const struct sctp_endpoint *ep,
 		sctp_add_cmd_sf(commands, SCTP_CMD_SEND_PKT,
 				SCTP_PACKET(packet));
 
-		SCTP_INC_STATS(SctpOutCtrlChunks);
+		SCTP_INC_STATS(SCTP_MIB_OUTCTRLCHUNKS);
 
 		return SCTP_DISPOSITION_CONSUME;
 	}
@@ -2929,8 +2713,8 @@ sctp_disposition_t sctp_sf_do_9_2_final(const struct sctp_endpoint *ep,
 
 	sctp_add_cmd_sf(commands, SCTP_CMD_NEW_STATE,
 			SCTP_STATE(SCTP_STATE_CLOSED));
-	SCTP_INC_STATS(SctpShutdowns);
-	SCTP_DEC_STATS(SctpCurrEstab);
+	SCTP_INC_STATS(SCTP_MIB_SHUTDOWNS);
+	SCTP_DEC_STATS(SCTP_MIB_CURRESTAB);
 	sctp_add_cmd_sf(commands, SCTP_CMD_REPLY, SCTP_CHUNK(reply));
 
 	/* ...and remove all record of the association. */
@@ -2971,7 +2755,7 @@ sctp_disposition_t sctp_sf_ootb(const struct sctp_endpoint *ep,
 	__u8 *ch_end;
 	int ootb_shut_ack = 0;
 
-	SCTP_INC_STATS(SctpOutOfBlues);
+	SCTP_INC_STATS(SCTP_MIB_OUTOFBLUES);
 
 	ch = (sctp_chunkhdr_t *) chunk->chunk_hdr;
 	do {
@@ -3040,7 +2824,7 @@ sctp_disposition_t sctp_sf_shut_8_4_5(const struct sctp_endpoint *ep,
 		sctp_add_cmd_sf(commands, SCTP_CMD_SEND_PKT,
 				SCTP_PACKET(packet));
 
-		SCTP_INC_STATS(SctpOutCtrlChunks);
+		SCTP_INC_STATS(SCTP_MIB_OUTCTRLCHUNKS);
 
 		return SCTP_DISPOSITION_CONSUME;
 	}
@@ -3176,8 +2960,8 @@ sctp_disposition_t sctp_sf_do_asconf_ack(const struct sctp_endpoint *ep,
 		sctp_add_cmd_sf(commands, SCTP_CMD_DISCARD_PACKET,SCTP_NULL());
 		sctp_add_cmd_sf(commands, SCTP_CMD_ASSOC_FAILED,
 				SCTP_U32(SCTP_ERROR_ASCONF_ACK));
-		SCTP_INC_STATS(SctpAborteds);
-		SCTP_DEC_STATS(SctpCurrEstab);
+		SCTP_INC_STATS(SCTP_MIB_ABORTEDS);
+		SCTP_DEC_STATS(SCTP_MIB_CURRESTAB);
 		return SCTP_DISPOSITION_ABORT;
 	}
 
@@ -3202,8 +2986,8 @@ sctp_disposition_t sctp_sf_do_asconf_ack(const struct sctp_endpoint *ep,
 		sctp_add_cmd_sf(commands, SCTP_CMD_DISCARD_PACKET,SCTP_NULL());
 		sctp_add_cmd_sf(commands, SCTP_CMD_ASSOC_FAILED,
 				SCTP_U32(SCTP_ERROR_ASCONF_ACK));
-		SCTP_INC_STATS(SctpAborteds);
-		SCTP_DEC_STATS(SctpCurrEstab);
+		SCTP_INC_STATS(SCTP_MIB_ABORTEDS);
+		SCTP_DEC_STATS(SCTP_MIB_CURRESTAB);
 		return SCTP_DISPOSITION_ABORT;
 	}
 
@@ -3797,8 +3581,8 @@ sctp_disposition_t sctp_sf_do_9_1_prm_abort(
 	sctp_add_cmd_sf(commands, SCTP_CMD_ASSOC_FAILED,
 			SCTP_U32(SCTP_ERROR_USER_ABORT));
 
-	SCTP_INC_STATS(SctpAborteds);
-	SCTP_DEC_STATS(SctpCurrEstab);
+	SCTP_INC_STATS(SCTP_MIB_ABORTEDS);
+	SCTP_DEC_STATS(SCTP_MIB_CURRESTAB);
 
 	return retval;
 }
@@ -3855,7 +3639,7 @@ sctp_disposition_t sctp_sf_cookie_wait_prm_shutdown(
 	sctp_add_cmd_sf(commands, SCTP_CMD_NEW_STATE,
 			SCTP_STATE(SCTP_STATE_CLOSED));
 
-	SCTP_INC_STATS(SctpShutdowns);
+	SCTP_INC_STATS(SCTP_MIB_SHUTDOWNS);
 
 	sctp_add_cmd_sf(commands, SCTP_CMD_DELETE_TCB, SCTP_NULL());
 
@@ -3928,7 +3712,7 @@ sctp_disposition_t sctp_sf_cookie_wait_prm_abort(
 	sctp_add_cmd_sf(commands, SCTP_CMD_NEW_STATE,
 			SCTP_STATE(SCTP_STATE_CLOSED));
 
-	SCTP_INC_STATS(SctpAborteds);
+	SCTP_INC_STATS(SCTP_MIB_ABORTEDS);
 
 	/* Even if we can't send the ABORT due to low memory delete the
 	 * TCB.  This is a departure from our typical NOMEM handling.
@@ -4288,8 +4072,8 @@ sctp_disposition_t sctp_sf_do_6_3_3_rtx(const struct sctp_endpoint *ep,
 		/* CMD_ASSOC_FAILED calls CMD_DELETE_TCB. */
 		sctp_add_cmd_sf(commands, SCTP_CMD_ASSOC_FAILED,
 				SCTP_U32(SCTP_ERROR_NO_ERROR));
-		SCTP_INC_STATS(SctpAborteds);
-		SCTP_DEC_STATS(SctpCurrEstab);
+		SCTP_INC_STATS(SCTP_MIB_ABORTEDS);
+		SCTP_DEC_STATS(SCTP_MIB_CURRESTAB);
 		return SCTP_DISPOSITION_DELETE_TCB;
 	}
 
@@ -4458,8 +4242,8 @@ sctp_disposition_t sctp_sf_t2_timer_expire(const struct sctp_endpoint *ep,
 		/* Note:  CMD_ASSOC_FAILED calls CMD_DELETE_TCB. */
 		sctp_add_cmd_sf(commands, SCTP_CMD_ASSOC_FAILED,
 				SCTP_U32(SCTP_ERROR_NO_ERROR));
-		SCTP_INC_STATS(SctpAborteds);
-		SCTP_DEC_STATS(SctpCurrEstab);
+		SCTP_INC_STATS(SCTP_MIB_ABORTEDS);
+		SCTP_DEC_STATS(SCTP_MIB_CURRESTAB);
 		return SCTP_DISPOSITION_DELETE_TCB;
 	}
 
@@ -4532,8 +4316,8 @@ sctp_disposition_t sctp_sf_t4_timer_expire(
 				SCTP_TO(SCTP_EVENT_TIMEOUT_T4_RTO));
 		sctp_add_cmd_sf(commands, SCTP_CMD_ASSOC_FAILED,
 				SCTP_U32(SCTP_ERROR_NO_ERROR));
-		SCTP_INC_STATS(SctpAborteds);
-		SCTP_INC_STATS(SctpCurrEstab);
+		SCTP_INC_STATS(SCTP_MIB_ABORTEDS);
+		SCTP_INC_STATS(SCTP_MIB_CURRESTAB);
 		return SCTP_DISPOSITION_ABORT;
 	}
 
@@ -4709,7 +4493,7 @@ struct sctp_sackhdr *sctp_sm_pull_sack(struct sctp_chunk *chunk)
 	num_blocks = ntohs(sack->num_gap_ack_blocks);
 	num_dup_tsns = ntohs(sack->num_dup_tsns);
 	len = sizeof(struct sctp_sackhdr);
-	len = (num_blocks + num_dup_tsns) * sizeof(__u32);
+	len += (num_blocks + num_dup_tsns) * sizeof(__u32);
 	if (len > chunk->skb->len)
 		return NULL;
 
@@ -4843,8 +4627,176 @@ void sctp_send_stale_cookie_err(const struct sctp_endpoint *ep,
 			sctp_packet_append_chunk(packet, err_chunk);
 			sctp_add_cmd_sf(commands, SCTP_CMD_SEND_PKT,
 					SCTP_PACKET(packet));
-			SCTP_INC_STATS(SctpOutCtrlChunks);
+			SCTP_INC_STATS(SCTP_MIB_OUTCTRLCHUNKS);
 		} else
 			sctp_chunk_free (err_chunk);
 	}
 }
+
+
+/* Process a data chunk */
+int sctp_eat_data(const struct sctp_association *asoc,
+		  struct sctp_chunk *chunk,
+		  sctp_cmd_seq_t *commands)
+{
+	sctp_datahdr_t *data_hdr;
+	struct sctp_chunk *err;
+	size_t datalen;
+	sctp_verb_t deliver;
+	int tmp;
+	__u32 tsn;
+
+	data_hdr = chunk->subh.data_hdr = (sctp_datahdr_t *)chunk->skb->data;
+	skb_pull(chunk->skb, sizeof(sctp_datahdr_t));
+
+	tsn = ntohl(data_hdr->tsn);
+	SCTP_DEBUG_PRINTK("eat_data: TSN 0x%x.\n", tsn);
+
+	/* ASSERT:  Now skb->data is really the user data.  */
+
+	/* Process ECN based congestion.
+	 *
+	 * Since the chunk structure is reused for all chunks within
+	 * a packet, we use ecn_ce_done to track if we've already
+	 * done CE processing for this packet.
+	 *
+	 * We need to do ECN processing even if we plan to discard the
+	 * chunk later.
+	 */
+
+	if (!chunk->ecn_ce_done) {
+		struct sctp_af *af;
+		chunk->ecn_ce_done = 1;
+
+		af = sctp_get_af_specific(
+			ipver2af(chunk->skb->nh.iph->version));
+
+		if (af && af->is_ce(chunk->skb) && asoc->peer.ecn_capable) {
+			/* Do real work as sideffect. */
+			sctp_add_cmd_sf(commands, SCTP_CMD_ECN_CE,
+					SCTP_U32(tsn));
+		}
+	}
+
+	tmp = sctp_tsnmap_check(&asoc->peer.tsn_map, tsn);
+	if (tmp < 0) {
+		/* The TSN is too high--silently discard the chunk and
+		 * count on it getting retransmitted later.
+		 */
+		return SCTP_IERROR_HIGH_TSN;
+	} else if (tmp > 0) {
+		/* This is a duplicate.  Record it.  */
+		sctp_add_cmd_sf(commands, SCTP_CMD_REPORT_DUP, SCTP_U32(tsn));
+		return SCTP_IERROR_DUP_TSN;
+	}
+
+	/* This is a new TSN.  */
+
+	/* Discard if there is no room in the receive window.
+	 * Actually, allow a little bit of overflow (up to a MTU).
+	 */
+	datalen = ntohs(chunk->chunk_hdr->length);
+	datalen -= sizeof(sctp_data_chunk_t);
+
+	deliver = SCTP_CMD_CHUNK_ULP;
+
+	/* Think about partial delivery. */
+	if ((datalen >= asoc->rwnd) && (!asoc->ulpq.pd_mode)) {
+
+		/* Even if we don't accept this chunk there is
+		 * memory pressure.
+		 */
+		sctp_add_cmd_sf(commands, SCTP_CMD_PART_DELIVER, SCTP_NULL());
+	}
+
+        /* Spill over rwnd a little bit.  Note: While allowed, this spill over
+	 * seems a bit troublesome in that frag_point varies based on
+	 * PMTU.  In cases, such as loopback, this might be a rather
+	 * large spill over.
+	 */
+	if (!asoc->rwnd || asoc->rwnd_over ||
+	    (datalen > asoc->rwnd + asoc->frag_point)) {
+
+		/* If this is the next TSN, consider reneging to make
+		 * room.   Note: Playing nice with a confused sender.  A
+		 * malicious sender can still eat up all our buffer
+		 * space and in the future we may want to detect and
+		 * do more drastic reneging.
+		 */
+		if (sctp_tsnmap_has_gap(&asoc->peer.tsn_map) &&
+		    (sctp_tsnmap_get_ctsn(&asoc->peer.tsn_map) + 1) == tsn) {
+			SCTP_DEBUG_PRINTK("Reneging for tsn:%u\n", tsn);
+			deliver = SCTP_CMD_RENEGE;
+		} else {
+			SCTP_DEBUG_PRINTK("Discard tsn: %u len: %Zd, "
+					  "rwnd: %d\n", tsn, datalen,
+					  asoc->rwnd);
+			return SCTP_IERROR_IGNORE_TSN;
+		}
+	}
+
+	/*
+	 * Section 3.3.10.9 No User Data (9)
+	 *
+	 * Cause of error
+	 * ---------------
+	 * No User Data:  This error cause is returned to the originator of a
+	 * DATA chunk if a received DATA chunk has no user data.
+	 */
+	if (unlikely(0 == datalen)) {
+		err = sctp_make_abort_no_data(asoc, chunk, tsn);
+		if (err) {
+			sctp_add_cmd_sf(commands, SCTP_CMD_REPLY,
+					SCTP_CHUNK(err));
+		}
+		/* We are going to ABORT, so we might as well stop
+		 * processing the rest of the chunks in the packet.
+		 */
+		sctp_add_cmd_sf(commands, SCTP_CMD_DISCARD_PACKET,SCTP_NULL());
+		sctp_add_cmd_sf(commands, SCTP_CMD_ASSOC_FAILED,
+				SCTP_U32(SCTP_ERROR_NO_DATA));
+		SCTP_INC_STATS(SCTP_MIB_ABORTEDS);
+		SCTP_DEC_STATS(SCTP_MIB_CURRESTAB);
+		return SCTP_IERROR_NO_DATA;
+	}
+
+	/* If definately accepting the DATA chunk, record its TSN, otherwise
+	 * wait for renege processing.
+	 */
+	if (SCTP_CMD_CHUNK_ULP == deliver)
+		sctp_add_cmd_sf(commands, SCTP_CMD_REPORT_TSN, SCTP_U32(tsn));
+
+	/* Note: Some chunks may get overcounted (if we drop) or overcounted
+	 * if we renege and the chunk arrives again.
+	 */
+	if (chunk->chunk_hdr->flags & SCTP_DATA_UNORDERED)
+		SCTP_INC_STATS(SCTP_MIB_INUNORDERCHUNKS);
+	else
+		SCTP_INC_STATS(SCTP_MIB_INORDERCHUNKS);
+
+	/* RFC 2960 6.5 Stream Identifier and Stream Sequence Number
+	 *
+	 * If an endpoint receive a DATA chunk with an invalid stream
+	 * identifier, it shall acknowledge the reception of the DATA chunk
+	 * following the normal procedure, immediately send an ERROR chunk
+	 * with cause set to "Invalid Stream Identifier" (See Section 3.3.10)
+	 * and discard the DATA chunk.
+	 */
+	if (ntohs(data_hdr->stream) >= asoc->c.sinit_max_instreams) {
+		err = sctp_make_op_error(asoc, chunk, SCTP_ERROR_INV_STRM,
+					 &data_hdr->stream,
+					 sizeof(data_hdr->stream));
+		if (err)
+			sctp_add_cmd_sf(commands, SCTP_CMD_REPLY,
+					SCTP_CHUNK(err));
+		return SCTP_IERROR_BAD_STREAM;
+	}
+
+	/* Send the data up to the user.  Note:  Schedule  the
+	 * SCTP_CMD_CHUNK_ULP cmd before the SCTP_CMD_GEN_SACK, as the SACK
+	 * chunk needs the updated rwnd.
+	 */
+	sctp_add_cmd_sf(commands, deliver, SCTP_CHUNK(chunk));
+
+	return SCTP_IERROR_NO_ERROR;
+}
diff --git a/net/sctp/socket.c b/net/sctp/socket.c
index 491b510b0..698a2c561 100644
--- a/net/sctp/socket.c
+++ b/net/sctp/socket.c
@@ -86,8 +86,6 @@
 
 /* Forward declarations for internal helper functions. */
 static int sctp_writeable(struct sock *sk);
-static inline int sctp_wspace(struct sctp_association *asoc);
-static inline void sctp_set_owner_w(struct sctp_chunk *chunk);
 static void sctp_wfree(struct sk_buff *skb);
 static int sctp_wait_for_sndbuf(struct sctp_association *, long *timeo_p,
 				size_t msg_len);
@@ -95,7 +93,8 @@ static int sctp_wait_for_packet(struct sock * sk, int *err, long *timeo_p);
 static int sctp_wait_for_connect(struct sctp_association *, long *timeo_p);
 static int sctp_wait_for_accept(struct sock *sk, long timeo);
 static void sctp_wait_for_close(struct sock *sk, long timeo);
-static inline int sctp_verify_addr(struct sock *, union sctp_addr *, int);
+static struct sctp_af *sctp_sockaddr_af(struct sctp_opt *opt,
+					union sctp_addr *addr, int len);
 static int sctp_bindx_add(struct sock *, struct sockaddr *, int);
 static int sctp_bindx_rem(struct sock *, struct sockaddr *, int);
 static int sctp_send_asconf_add_ip(struct sock *, struct sockaddr *, int);
@@ -111,6 +110,64 @@ static char *sctp_hmac_alg = SCTP_COOKIE_HMAC_ALG;
 extern kmem_cache_t *sctp_bucket_cachep;
 extern int sctp_assoc_valid(struct sock *sk, struct sctp_association *asoc);
 
+/* Get the sndbuf space available at the time on the association.  */
+static inline int sctp_wspace(struct sctp_association *asoc)
+{
+	struct sock *sk = asoc->base.sk;
+	int amt = 0;
+
+	amt = sk->sk_sndbuf - asoc->sndbuf_used;
+	if (amt < 0)
+		amt = 0;
+	return amt;
+}
+
+/* Increment the used sndbuf space count of the corresponding association by
+ * the size of the outgoing data chunk.
+ * Also, set the skb destructor for sndbuf accounting later.
+ *
+ * Since it is always 1-1 between chunk and skb, and also a new skb is always
+ * allocated for chunk bundling in sctp_packet_transmit(), we can use the
+ * destructor in the data chunk skb for the purpose of the sndbuf space
+ * tracking.
+ */
+static inline void sctp_set_owner_w(struct sctp_chunk *chunk)
+{
+	struct sctp_association *asoc = chunk->asoc;
+	struct sock *sk = asoc->base.sk;
+
+	/* The sndbuf space is tracked per association.  */
+	sctp_association_hold(asoc);
+
+	chunk->skb->destructor = sctp_wfree;
+	/* Save the chunk pointer in skb for sctp_wfree to use later.  */
+	*((struct sctp_chunk **)(chunk->skb->cb)) = chunk;
+
+	asoc->sndbuf_used += SCTP_DATA_SNDSIZE(chunk);
+	sk->sk_wmem_queued += SCTP_DATA_SNDSIZE(chunk);
+}
+
+/* Verify that this is a valid address. */
+static inline int sctp_verify_addr(struct sock *sk, union sctp_addr *addr,
+				   int len)
+{
+	struct sctp_af *af;
+
+	/* Verify basic sockaddr. */
+	af = sctp_sockaddr_af(sctp_sk(sk), addr, len);
+	if (!af)
+		return -EINVAL;
+
+	/* Is this a valid SCTP address?  */
+	if (!af->addr_valid(addr, sctp_sk(sk)))
+		return -EINVAL;
+
+	if (!sctp_sk(sk)->pf->send_verify(sctp_sk(sk), (addr)))
+		return -EINVAL;
+
+	return 0;
+}
+
 /* Look up the association by its id.  If this is not a UDP-style
  * socket, the ID field is always ignored.
  */
@@ -945,11 +1002,11 @@ SCTP_STATIC void sctp_close(struct sock *sk, long timeout)
 	sctp_local_bh_disable();
 	sctp_bh_lock_sock(sk);
 
-	/* Hold the sock, since inet_sock_release() will put sock_put()
+	/* Hold the sock, since sk_common_release() will put sock_put()
 	 * and we have just a little more cleanup.
 	 */
 	sock_hold(sk);
-	inet_sock_release(sk);
+	sk_common_release(sk);
 
 	sctp_bh_unlock_sock(sk);
 	sctp_local_bh_enable();
@@ -990,7 +1047,7 @@ static int sctp_error(struct sock *sk, int flags, int err)
  * Note:  This function could use a rewrite especially when explicit
  * connect support comes in.
  */
-/* BUG:  We do not implement the equivalent of wait_for_tcp_memory(). */
+/* BUG:  We do not implement the equivalent of sk_stream_wait_memory(). */
 
 SCTP_STATIC int sctp_msghdr_parse(const struct msghdr *, sctp_cmsgs_t *);
 
@@ -1008,7 +1065,7 @@ SCTP_STATIC int sctp_sendmsg(struct kiocb *iocb, struct sock *sk,
 	struct sctp_sndrcvinfo *sinfo;
 	struct sctp_initmsg *sinit;
 	sctp_assoc_t associd = NULL;
-	sctp_cmsgs_t cmsgs = { 0 };
+	sctp_cmsgs_t cmsgs = { NULL };
 	int err;
 	sctp_scope_t scope;
 	long timeo;
@@ -1640,6 +1697,32 @@ static int sctp_setsockopt_peer_addr_params(struct sock *sk,
 	if (copy_from_user(&params, optval, optlen))
 		return -EFAULT;
 
+	/*
+	 * API 7. Socket Options (setting the default value for the endpoint)
+	 * All options that support specific settings on an association by
+	 * filling in either an association id variable or a sockaddr_storage
+	 * SHOULD also support setting of the same value for the entire endpoint
+	 * (i.e. future associations). To accomplish this the following logic is
+	 * used when setting one of these options:
+
+	 * c) If neither the sockaddr_storage or association identification is
+	 *    set i.e. the sockaddr_storage is set to all 0's (INADDR_ANY) and
+	 *    the association identification is 0, the settings are a default
+	 *    and to be applied to the endpoint (all future associations).
+	 */
+
+	/* update default value for endpoint (all future associations) */
+	if (!params.spp_assoc_id && 
+	    sctp_is_any(( union sctp_addr *)&params.spp_address)) {
+		if (params.spp_hbinterval)
+			sctp_sk(sk)->paddrparam.spp_hbinterval =
+						params.spp_hbinterval;
+		if (sctp_max_retrans_path)
+			sctp_sk(sk)->paddrparam.spp_pathmaxrxt =
+						params.spp_pathmaxrxt;
+		return 0;
+	}
+
 	trans = sctp_addr_id2transport(sk, &params.spp_address,
 				       params.spp_assoc_id);
 	if (!trans)
@@ -2807,6 +2890,17 @@ static int sctp_getsockopt_peer_addr_params(struct sock *sk, int len,
 	if (copy_from_user(&params, optval, len))
 		return -EFAULT;
 
+	/* If no association id is specified retrieve the default value
+	 * for the endpoint that will be used for all future associations
+	 */
+	if (!params.spp_assoc_id &&
+	    sctp_is_any(( union sctp_addr *)&params.spp_address)) {
+		params.spp_hbinterval = sctp_sk(sk)->paddrparam.spp_hbinterval;
+		params.spp_pathmaxrxt = sctp_sk(sk)->paddrparam.spp_pathmaxrxt;
+
+		goto done;
+	}
+
 	trans = sctp_addr_id2transport(sk, &params.spp_address,
 				       params.spp_assoc_id);
 	if (!trans)
@@ -2826,6 +2920,7 @@ static int sctp_getsockopt_peer_addr_params(struct sock *sk, int len,
 	 */
 	params.spp_pathmaxrxt = trans->error_threshold;
 
+done:
 	if (copy_to_user(optval, &params, len))
 		return -EFAULT;
 
@@ -4144,64 +4239,6 @@ no_packet:
 	return NULL;
 }
 
-/* Verify that this is a valid address. */
-static inline int sctp_verify_addr(struct sock *sk, union sctp_addr *addr,
-				   int len)
-{
-	struct sctp_af *af;
-
-	/* Verify basic sockaddr. */
-	af = sctp_sockaddr_af(sctp_sk(sk), addr, len);
-	if (!af)
-		return -EINVAL;
-
-	/* Is this a valid SCTP address?  */
-	if (!af->addr_valid(addr, sctp_sk(sk)))
-		return -EINVAL;
-
-	if (!sctp_sk(sk)->pf->send_verify(sctp_sk(sk), (addr)))
-		return -EINVAL;
-
-	return 0;
-}
-
-/* Get the sndbuf space available at the time on the association.  */
-static inline int sctp_wspace(struct sctp_association *asoc)
-{
-	struct sock *sk = asoc->base.sk;
-	int amt = 0;
-
-	amt = sk->sk_sndbuf - asoc->sndbuf_used;
-	if (amt < 0)
-		amt = 0;
-	return amt;
-}
-
-/* Increment the used sndbuf space count of the corresponding association by
- * the size of the outgoing data chunk.
- * Also, set the skb destructor for sndbuf accounting later.
- *
- * Since it is always 1-1 between chunk and skb, and also a new skb is always
- * allocated for chunk bundling in sctp_packet_transmit(), we can use the
- * destructor in the data chunk skb for the purpose of the sndbuf space
- * tracking.
- */
-static inline void sctp_set_owner_w(struct sctp_chunk *chunk)
-{
-	struct sctp_association *asoc = chunk->asoc;
-	struct sock *sk = asoc->base.sk;
-
-	/* The sndbuf space is tracked per association.  */
-	sctp_association_hold(asoc);
-
-	chunk->skb->destructor = sctp_wfree;
-	/* Save the chunk pointer in skb for sctp_wfree to use later.  */
-	*((struct sctp_chunk **)(chunk->skb->cb)) = chunk;
-
-	asoc->sndbuf_used += SCTP_DATA_SNDSIZE(chunk);
-	sk->sk_wmem_queued += SCTP_DATA_SNDSIZE(chunk);
-}
-
 /* If sndbuf has changed, wake up per association sndbuf waiters.  */
 static void __sctp_write_space(struct sctp_association *asoc)
 {
diff --git a/net/sctp/ulpevent.c b/net/sctp/ulpevent.c
index d746321a7..e804d6ed8 100644
--- a/net/sctp/ulpevent.c
+++ b/net/sctp/ulpevent.c
@@ -48,13 +48,23 @@
 #include <net/sctp/sctp.h>
 #include <net/sctp/sm.h>
 
-static inline void sctp_ulpevent_set_owner(struct sctp_ulpevent *event,
-					   const struct sctp_association *asoc);
-static inline void sctp_ulpevent_release_owner(struct sctp_ulpevent *event);
 static void sctp_ulpevent_receive_data(struct sctp_ulpevent *event,
 				       struct sctp_association *asoc);
 static void sctp_ulpevent_release_data(struct sctp_ulpevent *event);
 
+/* Stub skb destructor.  */
+static void sctp_stub_rfree(struct sk_buff *skb)
+{
+/* WARNING:  This function is just a warning not to use the
+ * skb destructor.  If the skb is shared, we may get the destructor
+ * callback on some processor that does not own the sock_lock.  This
+ * was occuring with PACKET socket applications that were monitoring
+ * our skbs.   We can't take the sock_lock, because we can't risk
+ * recursing if we do really own the sock lock.  Instead, do all
+ * of our rwnd manipulation while we own the sock_lock outright.
+ */
+}
+
 /* Create a new sctp_ulpevent.  */
 struct sctp_ulpevent *sctp_ulpevent_new(int size, int msg_flags, int gfp)
 {
@@ -87,6 +97,30 @@ int sctp_ulpevent_is_notification(const struct sctp_ulpevent *event)
 	return MSG_NOTIFICATION == (event->msg_flags & MSG_NOTIFICATION);
 }
 
+/* Hold the association in case the msg_name needs read out of
+ * the association.
+ */
+static inline void sctp_ulpevent_set_owner(struct sctp_ulpevent *event,
+					   const struct sctp_association *asoc)
+{
+	struct sk_buff *skb;
+
+	/* Cast away the const, as we are just wanting to
+	 * bump the reference count.
+	 */
+	sctp_association_hold((struct sctp_association *)asoc);
+	skb = sctp_event2skb(event);
+	skb->sk = asoc->base.sk;
+	event->asoc = (struct sctp_association *)asoc;
+	skb->destructor = sctp_stub_rfree;
+}
+
+/* A simple destructor to give up the reference to the association. */
+static inline void sctp_ulpevent_release_owner(struct sctp_ulpevent *event)
+{
+	sctp_association_put(event->asoc);
+}
+
 /* Create and initialize an SCTP_ASSOC_CHANGE event.
  *
  * 5.3.1.1 SCTP_ASSOC_CHANGE
@@ -789,43 +823,6 @@ void sctp_ulpevent_read_sndrcvinfo(const struct sctp_ulpevent *event,
 		 sizeof(struct sctp_sndrcvinfo), (void *)&sinfo);
 }
 
-/* Stub skb destructor.  */
-static void sctp_stub_rfree(struct sk_buff *skb)
-{
-/* WARNING:  This function is just a warning not to use the
- * skb destructor.  If the skb is shared, we may get the destructor
- * callback on some processor that does not own the sock_lock.  This
- * was occuring with PACKET socket applications that were monitoring
- * our skbs.   We can't take the sock_lock, because we can't risk
- * recursing if we do really own the sock lock.  Instead, do all
- * of our rwnd manipulation while we own the sock_lock outright.
- */
-}
-
-/* Hold the association in case the msg_name needs read out of
- * the association.
- */
-static inline void sctp_ulpevent_set_owner(struct sctp_ulpevent *event,
-					   const struct sctp_association *asoc)
-{
-	struct sk_buff *skb;
-
-	/* Cast away the const, as we are just wanting to
-	 * bump the reference count.
-	 */
-	sctp_association_hold((struct sctp_association *)asoc);
-	skb = sctp_event2skb(event);
-	skb->sk = asoc->base.sk;
-	event->asoc = (struct sctp_association *)asoc;
-	skb->destructor = sctp_stub_rfree;
-}
-
-/* A simple destructor to give up the reference to the association. */
-static inline void sctp_ulpevent_release_owner(struct sctp_ulpevent *event)
-{
-	sctp_association_put(event->asoc);
-}
-
 /* Do accounting for bytes received and hold a reference to the association
  * for each skb.
  */
diff --git a/net/sctp/ulpqueue.c b/net/sctp/ulpqueue.c
index 0b912c87e..350a97ec7 100644
--- a/net/sctp/ulpqueue.c
+++ b/net/sctp/ulpqueue.c
@@ -49,10 +49,10 @@
 #include <net/sctp/sm.h>
 
 /* Forward declarations for internal helpers.  */
-static inline struct sctp_ulpevent * sctp_ulpq_reasm(struct sctp_ulpq *ulpq,
-						     struct sctp_ulpevent *);
-static inline struct sctp_ulpevent *sctp_ulpq_order(struct sctp_ulpq *,
-						    struct sctp_ulpevent *);
+static struct sctp_ulpevent * sctp_ulpq_reasm(struct sctp_ulpq *ulpq,
+						struct sctp_ulpevent *);
+static struct sctp_ulpevent * sctp_ulpq_order(struct sctp_ulpq *,
+						struct sctp_ulpevent *);
 
 /* 1st Level Abstractions */
 
@@ -97,12 +97,12 @@ void sctp_ulpq_flush(struct sctp_ulpq *ulpq)
 	struct sk_buff *skb;
 	struct sctp_ulpevent *event;
 
-	while ((skb = __skb_dequeue(&ulpq->lobby))) {
+	while ((skb = __skb_dequeue(&ulpq->lobby)) != NULL) {
 		event = sctp_skb2event(skb);
 		sctp_ulpevent_free(event);
 	}
 
-	while ((skb = __skb_dequeue(&ulpq->reasm))) {
+	while ((skb = __skb_dequeue(&ulpq->reasm)) != NULL) {
 		event = sctp_skb2event(skb);
 		sctp_ulpevent_free(event);
 	}
@@ -334,7 +334,7 @@ static struct sctp_ulpevent *sctp_make_reassembled_event(struct sk_buff *f_frag,
 	};
 
 	event = sctp_skb2event(f_frag);
-	SCTP_INC_STATS(SctpReasmUsrMsgs);
+	SCTP_INC_STATS(SCTP_MIB_REASMUSRMSGS);
 
 	return event;
 }
@@ -466,8 +466,8 @@ done:
 /* Helper function to reassemble chunks.  Hold chunks on the reasm queue that
  * need reassembling.
  */
-static inline struct sctp_ulpevent *sctp_ulpq_reasm(struct sctp_ulpq *ulpq,
-						   struct sctp_ulpevent *event)
+static struct sctp_ulpevent *sctp_ulpq_reasm(struct sctp_ulpq *ulpq,
+						struct sctp_ulpevent *event)
 {
 	struct sctp_ulpevent *retval = NULL;
 
@@ -645,8 +645,8 @@ static inline void sctp_ulpq_store_ordered(struct sctp_ulpq *ulpq,
 
 }
 
-static inline struct sctp_ulpevent *sctp_ulpq_order(struct sctp_ulpq *ulpq,
-					struct sctp_ulpevent *event)
+static struct sctp_ulpevent *sctp_ulpq_order(struct sctp_ulpq *ulpq,
+						struct sctp_ulpevent *event)
 {
 	__u16 sid, ssn;
 	struct sctp_stream *in;
@@ -756,7 +756,7 @@ static __u16 sctp_ulpq_renege_order(struct sctp_ulpq *ulpq, __u16 needed)
 
 	tsnmap = &ulpq->asoc->peer.tsn_map;
 
-	while ((skb = __skb_dequeue_tail(&ulpq->lobby))) {
+	while ((skb = __skb_dequeue_tail(&ulpq->lobby)) != NULL) {
 		freed += skb_headlen(skb);
 		event = sctp_skb2event(skb);
 		tsn = event->tsn;
@@ -782,7 +782,7 @@ static __u16 sctp_ulpq_renege_frags(struct sctp_ulpq *ulpq, __u16 needed)
 	tsnmap = &ulpq->asoc->peer.tsn_map;
 
 	/* Walk backwards through the list, reneges the newest tsns. */
-	while ((skb = __skb_dequeue_tail(&ulpq->reasm))) {
+	while ((skb = __skb_dequeue_tail(&ulpq->reasm)) != NULL) {
 		freed += skb_headlen(skb);
 		event = sctp_skb2event(skb);
 		tsn = event->tsn;
diff --git a/net/socket.c b/net/socket.c
index 57cbf98d3..2d8793a05 100644
--- a/net/socket.c
+++ b/net/socket.c
@@ -403,7 +403,7 @@ int sock_map_fd(struct socket *sock)
 
 		sock->file = file;
 		file->f_op = SOCK_INODE(sock)->i_fop = &socket_file_ops;
-		file->f_mode = 3;
+		file->f_mode = FMODE_READ | FMODE_WRITE;
 		file->f_flags = O_RDWR;
 		file->f_pos = 0;
 		fd_install(fd, file);
@@ -551,27 +551,47 @@ static inline int __sock_sendmsg(struct kiocb *iocb, struct socket *sock,
 		else
 			vx_sock_fail(sock->sk, size);
 	}
-	vxdprintk("__sock_sendmsg: %p[%p,%p,%p;%d]:%d/%d\n",
+	vxdprintk(VXD_CBIT(net, 7),
+		"__sock_sendmsg: %p[%p,%p,%p;%d]:%d/%d",
 		sock, sock->sk,
 		(sock->sk)?sock->sk->sk_nx_info:0,
 		(sock->sk)?sock->sk->sk_vx_info:0,
 		(sock->sk)?sock->sk->sk_xid:0,
-		size, len);
+		(unsigned int)size, len);
 	return len;
 }
 
 int sock_sendmsg(struct socket *sock, struct msghdr *msg, size_t size)
 {
 	struct kiocb iocb;
+	struct sock_iocb siocb;
 	int ret;
 
 	init_sync_kiocb(&iocb, NULL);
+	iocb.private = &siocb;
 	ret = __sock_sendmsg(&iocb, sock, msg, size);
 	if (-EIOCBQUEUED == ret)
 		ret = wait_on_sync_kiocb(&iocb);
 	return ret;
 }
 
+int kernel_sendmsg(struct socket *sock, struct msghdr *msg,
+		   struct kvec *vec, size_t num, size_t size)
+{
+	mm_segment_t oldfs = get_fs();
+	int result;
+
+	set_fs(KERNEL_DS);
+	/*
+	 * the following is safe, since for compiler definitions of kvec and
+	 * iovec are identical, yielding the same in-core layout and alignment
+	 */
+	msg->msg_iov = (struct iovec *)vec,
+	msg->msg_iovlen = num;
+	result = sock_sendmsg(sock, msg, size);
+	set_fs(oldfs);
+	return result;
+}
 
 static inline int __sock_recvmsg(struct kiocb *iocb, struct socket *sock, 
 				 struct msghdr *msg, size_t size, int flags)
@@ -592,12 +612,13 @@ static inline int __sock_recvmsg(struct kiocb *iocb, struct socket *sock,
 	len = sock->ops->recvmsg(iocb, sock, msg, size, flags);
 	if ((len >= 0) && sock->sk)
 		vx_sock_recv(sock->sk, len);
-	vxdprintk("__sock_recvmsg: %p[%p,%p,%p;%d]:%d/%d\n",
+	vxdprintk(VXD_CBIT(net, 7),
+		"__sock_recvmsg: %p[%p,%p,%p;%d]:%d/%d",
 		sock, sock->sk,
 		(sock->sk)?sock->sk->sk_nx_info:0,
 		(sock->sk)?sock->sk->sk_vx_info:0,
 		(sock->sk)?sock->sk->sk_xid:0,
-		size, len);
+		(unsigned int)size, len);
 	return len;
 }
 
@@ -605,15 +626,41 @@ int sock_recvmsg(struct socket *sock, struct msghdr *msg,
 		 size_t size, int flags)
 {
 	struct kiocb iocb;
+	struct sock_iocb siocb;
 	int ret;
 
         init_sync_kiocb(&iocb, NULL);
+	iocb.private = &siocb;
 	ret = __sock_recvmsg(&iocb, sock, msg, size, flags);
 	if (-EIOCBQUEUED == ret)
 		ret = wait_on_sync_kiocb(&iocb);
 	return ret;
 }
 
+int kernel_recvmsg(struct socket *sock, struct msghdr *msg, 
+		   struct kvec *vec, size_t num,
+		   size_t size, int flags)
+{
+	mm_segment_t oldfs = get_fs();
+	int result;
+
+	set_fs(KERNEL_DS);
+	/*
+	 * the following is safe, since for compiler definitions of kvec and
+	 * iovec are identical, yielding the same in-core layout and alignment
+	 */
+	msg->msg_iov = (struct iovec *)vec,
+	msg->msg_iovlen = num;
+	result = sock_recvmsg(sock, msg, size, flags);
+	set_fs(oldfs);
+	return result;
+}
+
+static void sock_aio_dtor(struct kiocb *iocb)
+{
+	kfree(iocb->private);
+}
+
 /*
  *	Read data from a socket. ubuf is a user mode pointer. We make sure the user
  *	area ubuf...ubuf+size-1 is writable before asking the protocol.
@@ -622,7 +669,7 @@ int sock_recvmsg(struct socket *sock, struct msghdr *msg,
 static ssize_t sock_aio_read(struct kiocb *iocb, char __user *ubuf,
 			 size_t size, loff_t pos)
 {
-	struct sock_iocb *x = kiocb_to_siocb(iocb);
+	struct sock_iocb *x, siocb;
 	struct socket *sock;
 	int flags;
 
@@ -631,6 +678,16 @@ static ssize_t sock_aio_read(struct kiocb *iocb, char __user *ubuf,
 	if (size==0)		/* Match SYS5 behaviour */
 		return 0;
 
+	if (is_sync_kiocb(iocb))
+		x = &siocb;
+	else {
+		x = kmalloc(sizeof(struct sock_iocb), GFP_KERNEL);
+		if (!x)
+			return -ENOMEM;
+		iocb->ki_dtor = sock_aio_dtor;
+	}
+	iocb->private = x;
+	x->kiocb = iocb;
 	sock = SOCKET_I(iocb->ki_filp->f_dentry->d_inode); 
 
 	x->async_msg.msg_name = NULL;
@@ -655,7 +712,7 @@ static ssize_t sock_aio_read(struct kiocb *iocb, char __user *ubuf,
 static ssize_t sock_aio_write(struct kiocb *iocb, const char __user *ubuf,
 			  size_t size, loff_t pos)
 {
-	struct sock_iocb *x = kiocb_to_siocb(iocb);
+	struct sock_iocb *x, siocb;
 	struct socket *sock;
 	
 	if (pos != 0)
@@ -663,6 +720,16 @@ static ssize_t sock_aio_write(struct kiocb *iocb, const char __user *ubuf,
 	if(size==0)		/* Match SYS5 behaviour */
 		return 0;
 
+	if (is_sync_kiocb(iocb))
+		x = &siocb;
+	else {
+		x = kmalloc(sizeof(struct sock_iocb), GFP_KERNEL);
+		if (!x)
+			return -ENOMEM;
+		iocb->ki_dtor = sock_aio_dtor;
+	}
+	iocb->private = x;
+	x->kiocb = iocb;
 	sock = SOCKET_I(iocb->ki_filp->f_dentry->d_inode); 
 
 	x->async_msg.msg_name = NULL;
@@ -686,9 +753,6 @@ ssize_t sock_sendpage(struct file *file, struct page *page,
 	struct socket *sock;
 	int flags;
 
-	if (ppos != &file->f_pos)
-		return -ESPIPE;
-
 	sock = SOCKET_I(file->f_dentry->d_inode);
 
 	flags = !(file->f_flags & O_NONBLOCK) ? 0 : MSG_DONTWAIT;
@@ -2071,3 +2135,5 @@ EXPORT_SYMBOL(sock_sendmsg);
 EXPORT_SYMBOL(sock_unregister);
 EXPORT_SYMBOL(sock_wake_async);
 EXPORT_SYMBOL(sockfd_lookup);
+EXPORT_SYMBOL(kernel_sendmsg);
+EXPORT_SYMBOL(kernel_recvmsg);
diff --git a/net/sunrpc/auth.c b/net/sunrpc/auth.c
index 694301a7e..2fd2975c8 100644
--- a/net/sunrpc/auth.c
+++ b/net/sunrpc/auth.c
@@ -260,8 +260,9 @@ rpcauth_lookupcred(struct rpc_auth *auth, int taskflags)
 	struct rpc_cred *ret;
 
 	get_group_info(current->group_info);
-	acred.uid = XIDINO_UID(current->fsuid, current->xid);
-	acred.gid = XIDINO_GID(current->fsgid, current->xid);
+	acred.uid = current->fsuid;
+	acred.gid = current->fsgid;
+	acred.xid = current->xid;
 	acred.group_info = current->group_info;
 
 	dprintk("RPC:     looking up %s cred\n",
@@ -279,8 +280,9 @@ rpcauth_bindcred(struct rpc_task *task)
 	struct rpc_cred *ret;
 
 	get_group_info(current->group_info);
-	acred.uid = XIDINO_UID(current->fsuid, current->xid);
-	acred.gid = XIDINO_GID(current->fsgid, current->xid);
+	acred.uid = current->fsuid;
+	acred.gid = current->fsgid;
+	acred.xid = current->xid;
 	acred.group_info = current->group_info;
 
 	dprintk("RPC: %4d looking up %s cred\n",
diff --git a/net/sunrpc/auth_gss/auth_gss.c b/net/sunrpc/auth_gss/auth_gss.c
index 60bca99bf..e32f2a709 100644
--- a/net/sunrpc/auth_gss/auth_gss.c
+++ b/net/sunrpc/auth_gss/auth_gss.c
@@ -417,7 +417,7 @@ out_sleep:
 
 static ssize_t
 gss_pipe_upcall(struct file *filp, struct rpc_pipe_msg *msg,
-		char *dst, size_t buflen)
+		char __user *dst, size_t buflen)
 {
 	char *data = (char *)msg->data + msg->copied;
 	ssize_t mlen = msg->len;
@@ -439,7 +439,7 @@ gss_pipe_upcall(struct file *filp, struct rpc_pipe_msg *msg,
 #define MSG_BUF_MAXSIZE 1024
 
 static ssize_t
-gss_pipe_downcall(struct file *filp, const char *src, size_t mlen)
+gss_pipe_downcall(struct file *filp, const char __user *src, size_t mlen)
 {
 	struct xdr_netobj obj = {
 		.len	= mlen,
@@ -697,7 +697,7 @@ gss_marshal(struct rpc_task *task, u32 *p, int ruid)
 	struct rpc_rqst *req = task->tk_rqstp;
 	u32             maj_stat = 0;
 	struct xdr_netobj mic;
-	struct iovec	iov;
+	struct kvec	iov;
 	struct xdr_buf	verf_buf;
 	u32		service;
 
@@ -774,7 +774,7 @@ gss_validate(struct rpc_task *task, u32 *p)
 						gc_base);
 	struct gss_cl_ctx *ctx = gss_cred_get_ctx(cred);
 	u32		seq, qop_state;
-	struct iovec	iov;
+	struct kvec	iov;
 	struct xdr_buf	verf_buf;
 	struct xdr_netobj mic;
 	u32		flav,len;
@@ -830,7 +830,7 @@ gss_wrap_req_integ(struct gss_cl_ctx *ctx,
 	u32             *integ_len = NULL;
 	struct xdr_netobj mic;
 	u32		offset, *q;
-	struct iovec	*iov;
+	struct kvec	*iov;
 	u32             maj_stat = 0;
 	int		status = -EIO;
 
diff --git a/net/sunrpc/auth_gss/svcauth_gss.c b/net/sunrpc/auth_gss/svcauth_gss.c
index 55b2fd104..5822ab211 100644
--- a/net/sunrpc/auth_gss/svcauth_gss.c
+++ b/net/sunrpc/auth_gss/svcauth_gss.c
@@ -503,7 +503,7 @@ static inline u32 round_up_to_quad(u32 i)
 }
 
 static inline int
-svc_safe_getnetobj(struct iovec *argv, struct xdr_netobj *o)
+svc_safe_getnetobj(struct kvec *argv, struct xdr_netobj *o)
 {
 	int l;
 
@@ -520,7 +520,7 @@ svc_safe_getnetobj(struct iovec *argv, struct xdr_netobj *o)
 }
 
 static inline int
-svc_safe_putnetobj(struct iovec *resv, struct xdr_netobj *o)
+svc_safe_putnetobj(struct kvec *resv, struct xdr_netobj *o)
 {
 	u32 *p;
 
@@ -548,8 +548,8 @@ gss_verify_header(struct svc_rqst *rqstp, struct rsc *rsci,
 	struct xdr_buf		rpchdr;
 	struct xdr_netobj	checksum;
 	u32			flavor = 0;
-	struct iovec		*argv = &rqstp->rq_arg.head[0];
-	struct iovec		iov;
+	struct kvec		*argv = &rqstp->rq_arg.head[0];
+	struct kvec		iov;
 
 	/* data to compute the checksum over: */
 	iov.iov_base = rpcstart;
@@ -595,7 +595,7 @@ gss_write_verf(struct svc_rqst *rqstp, struct gss_ctx *ctx_id, u32 seq)
 	struct xdr_buf		verf_data;
 	struct xdr_netobj	mic;
 	u32			*p;
-	struct iovec		iov;
+	struct kvec		iov;
 
 	svc_putu32(rqstp->rq_res.head, htonl(RPC_AUTH_GSS));
 	xdr_seq = htonl(seq);
@@ -743,8 +743,8 @@ struct gss_svc_data {
 static int
 svcauth_gss_accept(struct svc_rqst *rqstp, u32 *authp)
 {
-	struct iovec	*argv = &rqstp->rq_arg.head[0];
-	struct iovec	*resv = &rqstp->rq_res.head[0];
+	struct kvec	*argv = &rqstp->rq_arg.head[0];
+	struct kvec	*resv = &rqstp->rq_res.head[0];
 	u32		crlen;
 	struct xdr_netobj tmpobj;
 	struct gss_svc_data *svcdata = rqstp->rq_auth_data;
@@ -763,7 +763,7 @@ svcauth_gss_accept(struct svc_rqst *rqstp, u32 *authp)
 	if (!svcdata)
 		goto auth_err;
 	rqstp->rq_auth_data = svcdata;
-	svcdata->body_start = 0;
+	svcdata->body_start = NULL;
 	svcdata->rsci = NULL;
 	gc = &svcdata->clcred;
 
@@ -952,7 +952,7 @@ svcauth_gss_release(struct svc_rqst *rqstp)
 	struct xdr_buf *resbuf = &rqstp->rq_res;
 	struct xdr_buf integ_buf;
 	struct xdr_netobj mic;
-	struct iovec *resv;
+	struct kvec *resv;
 	u32 *p;
 	int integ_offset, integ_len;
 	int stat = -EINVAL;
@@ -970,7 +970,7 @@ svcauth_gss_release(struct svc_rqst *rqstp)
 		break;
 	case RPC_GSS_SVC_INTEGRITY:
 		p = gsd->body_start;
-		gsd->body_start = 0;
+		gsd->body_start = NULL;
 		/* move accept_stat to right place: */
 		memcpy(p, p + 2, 4);
 		/* don't wrap in failure case: */
diff --git a/net/sunrpc/auth_unix.c b/net/sunrpc/auth_unix.c
index 33741fc59..294875e44 100644
--- a/net/sunrpc/auth_unix.c
+++ b/net/sunrpc/auth_unix.c
@@ -20,8 +20,10 @@
 struct unx_cred {
 	struct rpc_cred		uc_base;
 	gid_t			uc_gid;
+	xid_t			uc_xid;
 	uid_t			uc_puid;		/* process uid */
 	gid_t			uc_pgid;		/* process gid */
+	xid_t			uc_pxid;		/* process xid */
 	gid_t			uc_gids[NFS_NGROUPS];
 };
 #define uc_uid			uc_base.cr_uid
@@ -81,6 +83,7 @@ unx_create_cred(struct rpc_auth *auth, struct auth_cred *acred, int flags)
 	if (flags & RPC_TASK_ROOTCREDS) {
 		cred->uc_uid = cred->uc_puid = 0;
 		cred->uc_gid = cred->uc_pgid = 0;
+		cred->uc_xid = cred->uc_pxid = current->xid;
 		cred->uc_gids[0] = NOGROUP;
 	} else {
 		int groups = acred->group_info->ngroups;
@@ -89,10 +92,10 @@ unx_create_cred(struct rpc_auth *auth, struct auth_cred *acred, int flags)
 
 		cred->uc_uid = acred->uid;
 		cred->uc_gid = acred->gid;
-//		cred->uc_puid = XIDINO_UID(current->uid, current->xid);
-//		cred->uc_pgid = XIDINO_GID(current->gid, current->xid);
+		cred->uc_xid = acred->xid;
 		cred->uc_puid = current->uid;
 		cred->uc_pgid = current->gid;
+		cred->uc_pxid = current->xid;
 		for (i = 0; i < groups; i++)
 			cred->uc_gids[i] = GROUP_AT(acred->group_info, i);
 		if (i < NFS_NGROUPS)
@@ -125,8 +128,10 @@ unx_match(struct auth_cred *acred, struct rpc_cred *rcred, int taskflags)
 
 		if (cred->uc_uid != acred->uid
 		 || cred->uc_gid != acred->gid
-		 || cred->uc_puid != XIDINO_UID(current->uid, current->xid)
-		 || cred->uc_pgid != XIDINO_GID(current->gid, current->xid))
+		 || cred->uc_xid != acred->xid
+		 || cred->uc_puid != current->uid
+		 || cred->uc_pgid != current->gid
+		 || cred->uc_pxid != current->xid)
 			return 0;
 
 		groups = acred->group_info->ngroups;
@@ -152,7 +157,7 @@ unx_marshal(struct rpc_task *task, u32 *p, int ruid)
 	struct rpc_clnt	*clnt = task->tk_client;
 	struct unx_cred	*cred = (struct unx_cred *) task->tk_msg.rpc_cred;
 	u32		*base, *hold;
-	int		i;
+	int		i, tagxid;
 
 	*p++ = htonl(RPC_AUTH_UNIX);
 	base = p++;
@@ -162,14 +167,19 @@ unx_marshal(struct rpc_task *task, u32 *p, int ruid)
 	 * Copy the UTS nodename captured when the client was created.
 	 */
 	p = xdr_encode_array(p, clnt->cl_nodename, clnt->cl_nodelen);
+	tagxid = task->tk_client->cl_tagxid;
 
 	/* Note: we don't use real uid if it involves raising privilege */
 	if (ruid && cred->uc_puid != 0 && cred->uc_pgid != 0) {
-		*p++ = htonl((u32) cred->uc_puid);
-		*p++ = htonl((u32) cred->uc_pgid);
+		*p++ = htonl((u32) XIDINO_UID(tagxid,
+			cred->uc_puid, cred->uc_pxid));
+		*p++ = htonl((u32) XIDINO_GID(tagxid,
+			cred->uc_pgid, cred->uc_pxid));
 	} else {
-		*p++ = htonl((u32) cred->uc_uid);
-		*p++ = htonl((u32) cred->uc_gid);
+		*p++ = htonl((u32) XIDINO_UID(tagxid,
+			cred->uc_uid, cred->uc_xid));
+		*p++ = htonl((u32) XIDINO_GID(tagxid,
+			cred->uc_gid, cred->uc_xid));
 	}
 	hold = p++;
 	for (i = 0; i < 16 && cred->uc_gids[i] != (gid_t) NOGROUP; i++)
diff --git a/net/sunrpc/cache.c b/net/sunrpc/cache.c
index e84acd07f..bb54be851 100644
--- a/net/sunrpc/cache.c
+++ b/net/sunrpc/cache.c
@@ -582,9 +582,6 @@ cache_read(struct file *filp, char __user *buf, size_t count, loff_t *ppos)
 	struct cache_detail *cd = PDE(filp->f_dentry->d_inode)->data;
 	int err;
 
-	if (ppos != &filp->f_pos)
-		return -ESPIPE;
-
 	if (count == 0)
 		return 0;
 
@@ -662,9 +659,6 @@ cache_write(struct file *filp, const char __user *buf, size_t count,
 	int err;
 	struct cache_detail *cd = PDE(filp->f_dentry->d_inode)->data;
 
-	if (ppos != &filp->f_pos)
-		return -ESPIPE;
-
 	if (count == 0)
 		return 0;
 	if (count >= sizeof(write_buf))
@@ -751,6 +745,7 @@ cache_open(struct inode *inode, struct file *filp)
 {
 	struct cache_reader *rp = NULL;
 
+	nonseekable_open(inode, filp);
 	if (filp->f_mode & FMODE_READ) {
 		struct cache_detail *cd = PDE(inode)->data;
 
@@ -1212,6 +1207,7 @@ static ssize_t write_flush(struct file * file, const char __user * buf,
 }
 
 static struct file_operations cache_flush_operations = {
+	.open		= nonseekable_open,
 	.read		= read_flush,
 	.write		= write_flush,
 };
diff --git a/net/sunrpc/pmap_clnt.c b/net/sunrpc/pmap_clnt.c
index 42c5ca84a..61bdc9754 100644
--- a/net/sunrpc/pmap_clnt.c
+++ b/net/sunrpc/pmap_clnt.c
@@ -58,7 +58,7 @@ rpc_getport(struct rpc_task *task, struct rpc_clnt *clnt)
 
 	spin_lock(&pmap_lock);
 	if (map->pm_binding) {
-		rpc_sleep_on(&map->pm_bindwait, task, NULL, 0);
+		rpc_sleep_on(&map->pm_bindwait, task, NULL, NULL);
 		spin_unlock(&pmap_lock);
 		return;
 	}
diff --git a/net/sunrpc/rpc_pipe.c b/net/sunrpc/rpc_pipe.c
index 8a8c4eb6c..95ce71682 100644
--- a/net/sunrpc/rpc_pipe.c
+++ b/net/sunrpc/rpc_pipe.c
@@ -433,6 +433,7 @@ rpc_lookup_parent(char *path, struct nameidata *nd)
 	nd->dentry = dget(rpc_mount->mnt_root);
 	nd->last_type = LAST_ROOT;
 	nd->flags = LOOKUP_PARENT;
+	nd->depth = 0;
 
 	if (path_walk(path, nd)) {
 		printk(KERN_WARNING "%s: %s failed to find path %s\n",
diff --git a/net/sunrpc/stats.c b/net/sunrpc/stats.c
index 9a95d858a..9b67dc199 100644
--- a/net/sunrpc/stats.c
+++ b/net/sunrpc/stats.c
@@ -169,7 +169,7 @@ rpc_proc_exit(void)
 	dprintk("RPC: unregistering /proc/net/rpc\n");
 	if (proc_net_rpc) {
 		proc_net_rpc = NULL;
-		remove_proc_entry("net/rpc", 0);
+		remove_proc_entry("net/rpc", NULL);
 	}
 }
 
diff --git a/net/sunrpc/svc.c b/net/sunrpc/svc.c
index 14c561dda..db65a24a1 100644
--- a/net/sunrpc/svc.c
+++ b/net/sunrpc/svc.c
@@ -257,8 +257,8 @@ svc_process(struct svc_serv *serv, struct svc_rqst *rqstp)
 	struct svc_program	*progp;
 	struct svc_version	*versp = NULL;	/* compiler food */
 	struct svc_procedure	*procp = NULL;
-	struct iovec *		argv = &rqstp->rq_arg.head[0];
-	struct iovec *		resv = &rqstp->rq_res.head[0];
+	struct kvec *		argv = &rqstp->rq_arg.head[0];
+	struct kvec *		resv = &rqstp->rq_res.head[0];
 	kxdrproc_t		xdr;
 	u32			*statp;
 	u32			dir, prog, vers, proc,
diff --git a/net/sunrpc/svcauth_unix.c b/net/sunrpc/svcauth_unix.c
index ab5164b6d..6d98c3bc6 100644
--- a/net/sunrpc/svcauth_unix.c
+++ b/net/sunrpc/svcauth_unix.c
@@ -338,8 +338,8 @@ void svcauth_unix_purge(void)
 static int
 svcauth_null_accept(struct svc_rqst *rqstp, u32 *authp)
 {
-	struct iovec	*argv = &rqstp->rq_arg.head[0];
-	struct iovec	*resv = &rqstp->rq_res.head[0];
+	struct kvec	*argv = &rqstp->rq_arg.head[0];
+	struct kvec	*resv = &rqstp->rq_res.head[0];
 	int		rv=0;
 	struct ip_map key, *ipm;
 
@@ -422,8 +422,8 @@ struct auth_ops svcauth_null = {
 int
 svcauth_unix_accept(struct svc_rqst *rqstp, u32 *authp)
 {
-	struct iovec	*argv = &rqstp->rq_arg.head[0];
-	struct iovec	*resv = &rqstp->rq_res.head[0];
+	struct kvec	*argv = &rqstp->rq_arg.head[0];
+	struct kvec	*resv = &rqstp->rq_res.head[0];
 	struct svc_cred	*cred = &rqstp->rq_cred;
 	u32		slen, i;
 	int		len   = argv->iov_len;
diff --git a/net/sunrpc/svcsock.c b/net/sunrpc/svcsock.c
index 024e768cd..d2d8e9b00 100644
--- a/net/sunrpc/svcsock.c
+++ b/net/sunrpc/svcsock.c
@@ -125,7 +125,7 @@ svc_sock_wspace(struct svc_sock *svsk)
 	int wspace;
 
 	if (svsk->sk_sock->type == SOCK_STREAM)
-		wspace = tcp_wspace(svsk->sk_sk);
+		wspace = sk_stream_wspace(svsk->sk_sk);
 	else
 		wspace = sock_wspace(svsk->sk_sk);
 
@@ -414,7 +414,6 @@ svc_sendto(struct svc_rqst *rqstp, struct xdr_buf *xdr)
 	}
 	/* send tail */
 	if (xdr->tail[0].iov_len) {
-		/* The tail *will* be in respages[0]; */
 		result = sock->ops->sendpage(sock, rqstp->rq_respages[rqstp->rq_restailpage], 
 					     ((unsigned long)xdr->tail[0].iov_base)& (PAGE_SIZE-1),
 					     xdr->tail[0].iov_len, 0);
@@ -451,9 +450,8 @@ svc_recv_available(struct svc_sock *svsk)
  * Generic recvfrom routine.
  */
 static int
-svc_recvfrom(struct svc_rqst *rqstp, struct iovec *iov, int nr, int buflen)
+svc_recvfrom(struct svc_rqst *rqstp, struct kvec *iov, int nr, int buflen)
 {
-	mm_segment_t	oldfs;
 	struct msghdr	msg;
 	struct socket	*sock;
 	int		len, alen;
@@ -463,16 +461,12 @@ svc_recvfrom(struct svc_rqst *rqstp, struct iovec *iov, int nr, int buflen)
 
 	msg.msg_name    = &rqstp->rq_addr;
 	msg.msg_namelen = sizeof(rqstp->rq_addr);
-	msg.msg_iov     = iov;
-	msg.msg_iovlen  = nr;
 	msg.msg_control = NULL;
 	msg.msg_controllen = 0;
 
 	msg.msg_flags	= MSG_DONTWAIT;
 
-	oldfs = get_fs(); set_fs(KERNEL_DS);
-	len = sock_recvmsg(sock, &msg, buflen, MSG_DONTWAIT);
-	set_fs(oldfs);
+	len = kernel_recvmsg(sock, &msg, iov, nr, buflen, MSG_DONTWAIT);
 
 	/* sock_recvmsg doesn't fill in the name/namelen, so we must..
 	 * possibly we should cache this in the svc_sock structure
@@ -899,7 +893,7 @@ svc_tcp_recvfrom(struct svc_rqst *rqstp)
 	struct svc_sock	*svsk = rqstp->rq_sock;
 	struct svc_serv	*serv = svsk->sk_server;
 	int		len;
-	struct iovec vec[RPCSVC_MAXPAGES];
+	struct kvec vec[RPCSVC_MAXPAGES];
 	int pnum, vlen;
 
 	dprintk("svc: tcp_recv %p data %d conn %d close %d\n",
@@ -943,7 +937,7 @@ svc_tcp_recvfrom(struct svc_rqst *rqstp)
 	 */
 	if (svsk->sk_tcplen < 4) {
 		unsigned long	want = 4 - svsk->sk_tcplen;
-		struct iovec	iov;
+		struct kvec	iov;
 
 		iov.iov_base = ((char *) &svsk->sk_reclen) + svsk->sk_tcplen;
 		iov.iov_len  = want;
@@ -1017,7 +1011,7 @@ svc_tcp_recvfrom(struct svc_rqst *rqstp)
 		rqstp->rq_arg.page_len = len - rqstp->rq_arg.head[0].iov_len;
 	}
 
-	rqstp->rq_skbuff      = 0;
+	rqstp->rq_skbuff      = NULL;
 	rqstp->rq_prot	      = IPPROTO_TCP;
 
 	/* Reset TCP read info */
@@ -1057,8 +1051,8 @@ svc_tcp_sendto(struct svc_rqst *rqstp)
 	int sent;
 	u32 reclen;
 
-	/* Set up the first element of the reply iovec.
-	 * Any other iovecs that may be in use have been taken
+	/* Set up the first element of the reply kvec.
+	 * Any other kvecs that may be in use have been taken
 	 * care of by the server implementation itself.
 	 */
 	reclen = htonl(0x80000000|((xbufp->len ) - 4));
diff --git a/net/sunrpc/sysctl.c b/net/sunrpc/sysctl.c
index e69a7fbb4..1b9616a12 100644
--- a/net/sunrpc/sysctl.c
+++ b/net/sunrpc/sysctl.c
@@ -58,14 +58,14 @@ rpc_unregister_sysctl(void)
 
 static int
 proc_dodebug(ctl_table *table, int write, struct file *file,
-				void __user *buffer, size_t *lenp)
+				void __user *buffer, size_t *lenp, loff_t *ppos)
 {
 	char		tmpbuf[20], c, *s;
 	char __user *p;
 	unsigned int	value;
 	size_t		left, len;
 
-	if ((file->f_pos && !write) || !*lenp) {
+	if ((*ppos && !write) || !*lenp) {
 		*lenp = 0;
 		return 0;
 	}
@@ -115,7 +115,7 @@ proc_dodebug(ctl_table *table, int write, struct file *file,
 
 done:
 	*lenp -= left;
-	file->f_pos += *lenp;
+	*ppos += *lenp;
 	return 0;
 }
 
diff --git a/net/sunrpc/xdr.c b/net/sunrpc/xdr.c
index c7d8bb459..a6630a1f2 100644
--- a/net/sunrpc/xdr.c
+++ b/net/sunrpc/xdr.c
@@ -141,7 +141,7 @@ void
 xdr_encode_pages(struct xdr_buf *xdr, struct page **pages, unsigned int base,
 		 unsigned int len)
 {
-	struct iovec *tail = xdr->tail;
+	struct kvec *tail = xdr->tail;
 	u32 *p;
 
 	xdr->pages = pages;
@@ -168,8 +168,8 @@ void
 xdr_inline_pages(struct xdr_buf *xdr, unsigned int offset,
 		 struct page **pages, unsigned int base, unsigned int len)
 {
-	struct iovec *head = xdr->head;
-	struct iovec *tail = xdr->tail;
+	struct kvec *head = xdr->head;
+	struct kvec *tail = xdr->tail;
 	char *buf = (char *)head->iov_base;
 	unsigned int buflen = head->iov_len;
 
@@ -186,19 +186,19 @@ xdr_inline_pages(struct xdr_buf *xdr, unsigned int offset,
 }
 
 /*
- * Realign the iovec if the server missed out some reply elements
+ * Realign the kvec if the server missed out some reply elements
  * (such as post-op attributes,...)
  * Note: This is a simple implementation that assumes that
  *            len <= iov->iov_len !!!
  *       The RPC header (assumed to be the 1st element in the iov array)
  *            is not shifted.
  */
-void xdr_shift_iovec(struct iovec *iov, int nr, size_t len)
+void xdr_shift_iovec(struct kvec *iov, int nr, size_t len)
 {
-	struct iovec *pvec;
+	struct kvec *pvec;
 
 	for (pvec = iov + nr - 1; nr > 1; nr--, pvec--) {
-		struct iovec *svec = pvec - 1;
+		struct kvec *svec = pvec - 1;
 
 		if (len > pvec->iov_len) {
 			printk(KERN_DEBUG "RPC: Urk! Large shift of short iovec.\n");
@@ -217,11 +217,11 @@ void xdr_shift_iovec(struct iovec *iov, int nr, size_t len)
 }
 
 /*
- * Map a struct xdr_buf into an iovec array.
+ * Map a struct xdr_buf into an kvec array.
  */
-int xdr_kmap(struct iovec *iov_base, struct xdr_buf *xdr, size_t base)
+int xdr_kmap(struct kvec *iov_base, struct xdr_buf *xdr, size_t base)
 {
-	struct iovec	*iov = iov_base;
+	struct kvec	*iov = iov_base;
 	struct page	**ppage = xdr->pages;
 	unsigned int	len, pglen = xdr->page_len;
 
@@ -371,11 +371,10 @@ xdr_sendpages(struct socket *sock, struct sockaddr *addr, int addrlen,
 	unsigned int len, pglen = xdr->page_len;
 	int err, ret = 0;
 	ssize_t (*sendpage)(struct socket *, struct page *, int, size_t, int);
-	mm_segment_t oldfs;
 
 	len = xdr->head[0].iov_len;
 	if (base < len || (addr != NULL && base == 0)) {
-		struct iovec iov = {
+		struct kvec iov = {
 			.iov_base = xdr->head[0].iov_base + base,
 			.iov_len  = len - base,
 		};
@@ -384,16 +383,13 @@ xdr_sendpages(struct socket *sock, struct sockaddr *addr, int addrlen,
 			.msg_namelen = addrlen,
 			.msg_flags   = msgflags,
 		};
-
-		if (iov.iov_len != 0) {
-			msg.msg_iov     = &iov;
-			msg.msg_iovlen  = 1;
-		}
 		if (xdr->len > len)
 			msg.msg_flags |= MSG_MORE;
-		oldfs = get_fs(); set_fs(get_ds());
-		err = sock_sendmsg(sock, &msg, iov.iov_len);
-		set_fs(oldfs);
+
+		if (iov.iov_len != 0)
+			err = kernel_sendmsg(sock, &msg, &iov, 1, iov.iov_len);
+		else
+			err = kernel_sendmsg(sock, &msg, NULL, 0, 0);
 		if (ret == 0)
 			ret = err;
 		else if (err > 0)
@@ -446,18 +442,14 @@ xdr_sendpages(struct socket *sock, struct sockaddr *addr, int addrlen,
 copy_tail:
 	len = xdr->tail[0].iov_len;
 	if (base < len) {
-		struct iovec iov = {
+		struct kvec iov = {
 			.iov_base = xdr->tail[0].iov_base + base,
 			.iov_len  = len - base,
 		};
 		struct msghdr msg = {
-			.msg_iov     = &iov,
-			.msg_iovlen  = 1,
 			.msg_flags   = msgflags,
 		};
-		oldfs = get_fs(); set_fs(get_ds());
-		err = sock_sendmsg(sock, &msg, iov.iov_len);
-		set_fs(oldfs);
+		err = kernel_sendmsg(sock, &msg, &iov, 1, iov.iov_len);
 		if (ret == 0)
 			ret = err;
 		else if (err > 0)
@@ -614,14 +606,14 @@ _copy_from_pages(char *p, struct page **pages, size_t pgbase, size_t len)
  * @buf: xdr_buf
  * @len: bytes to remove from buf->head[0]
  *
- * Shrinks XDR buffer's header iovec buf->head[0] by 
+ * Shrinks XDR buffer's header kvec buf->head[0] by 
  * 'len' bytes. The extra data is not lost, but is instead
  * moved into the inlined pages and/or the tail.
  */
 void
 xdr_shrink_bufhead(struct xdr_buf *buf, size_t len)
 {
-	struct iovec *head, *tail;
+	struct kvec *head, *tail;
 	size_t copy, offs;
 	unsigned int pglen = buf->page_len;
 
@@ -694,7 +686,7 @@ xdr_shrink_bufhead(struct xdr_buf *buf, size_t len)
 void
 xdr_shrink_pagelen(struct xdr_buf *buf, size_t len)
 {
-	struct iovec *tail;
+	struct kvec *tail;
 	size_t copy;
 	char *p;
 	unsigned int pglen = buf->page_len;
@@ -738,15 +730,15 @@ xdr_shift_buf(struct xdr_buf *buf, size_t len)
  * @p: current pointer inside XDR buffer
  *
  * Note: at the moment the RPC client only passes the length of our
- *	 scratch buffer in the xdr_buf's header iovec. Previously this
+ *	 scratch buffer in the xdr_buf's header kvec. Previously this
  *	 meant we needed to call xdr_adjust_iovec() after encoding the
  *	 data. With the new scheme, the xdr_stream manages the details
- *	 of the buffer length, and takes care of adjusting the iovec
+ *	 of the buffer length, and takes care of adjusting the kvec
  *	 length for us.
  */
 void xdr_init_encode(struct xdr_stream *xdr, struct xdr_buf *buf, uint32_t *p)
 {
-	struct iovec *iov = buf->head;
+	struct kvec *iov = buf->head;
 
 	xdr->buf = buf;
 	xdr->iov = iov;
@@ -763,7 +755,7 @@ EXPORT_SYMBOL(xdr_init_encode);
  *
  * Checks that we have enough buffer space to encode 'nbytes' more
  * bytes of data. If so, update the total xdr_buf length, and
- * adjust the length of the current iovec.
+ * adjust the length of the current kvec.
  */
 uint32_t * xdr_reserve_space(struct xdr_stream *xdr, size_t nbytes)
 {
@@ -795,7 +787,7 @@ void xdr_write_pages(struct xdr_stream *xdr, struct page **pages, unsigned int b
 		 unsigned int len)
 {
 	struct xdr_buf *buf = xdr->buf;
-	struct iovec *iov = buf->tail;
+	struct kvec *iov = buf->tail;
 	buf->pages = pages;
 	buf->page_base = base;
 	buf->page_len = len;
@@ -826,7 +818,7 @@ EXPORT_SYMBOL(xdr_write_pages);
  */
 void xdr_init_decode(struct xdr_stream *xdr, struct xdr_buf *buf, uint32_t *p)
 {
-	struct iovec *iov = buf->head;
+	struct kvec *iov = buf->head;
 	unsigned int len = iov->iov_len;
 
 	if (len > buf->len)
@@ -873,7 +865,7 @@ EXPORT_SYMBOL(xdr_inline_decode);
 void xdr_read_pages(struct xdr_stream *xdr, unsigned int len)
 {
 	struct xdr_buf *buf = xdr->buf;
-	struct iovec *iov;
+	struct kvec *iov;
 	ssize_t shift;
 	unsigned int end;
 	int padding;
@@ -905,10 +897,10 @@ void xdr_read_pages(struct xdr_stream *xdr, unsigned int len)
 }
 EXPORT_SYMBOL(xdr_read_pages);
 
-static struct iovec empty_iov = {.iov_base = NULL, .iov_len = 0};
+static struct kvec empty_iov = {.iov_base = NULL, .iov_len = 0};
 
 void
-xdr_buf_from_iov(struct iovec *iov, struct xdr_buf *buf)
+xdr_buf_from_iov(struct kvec *iov, struct xdr_buf *buf)
 {
 	buf->head[0] = *iov;
 	buf->tail[0] = empty_iov;
@@ -921,7 +913,7 @@ xdr_buf_from_iov(struct iovec *iov, struct xdr_buf *buf)
  * length of subiov to zero.  Decrements len by length of subiov, sets base
  * to zero (or decrements it by length of iov if subiov is empty). */
 static void
-iov_subsegment(struct iovec *iov, struct iovec *subiov, int *base, int *len)
+iov_subsegment(struct kvec *iov, struct kvec *subiov, int *base, int *len)
 {
 	if (*base > iov->iov_len) {
 		subiov->iov_base = NULL;
diff --git a/net/sunrpc/xprt.c b/net/sunrpc/xprt.c
index abfb21184..a7ab07fe5 100644
--- a/net/sunrpc/xprt.c
+++ b/net/sunrpc/xprt.c
@@ -973,7 +973,7 @@ static int
 tcp_data_recv(read_descriptor_t *rd_desc, struct sk_buff *skb,
 		unsigned int offset, size_t len)
 {
-	struct rpc_xprt *xprt = (struct rpc_xprt *)rd_desc->buf;
+	struct rpc_xprt *xprt = rd_desc->arg.data;
 	skb_reader_t desc = {
 		.skb	= skb,
 		.offset	= offset,
@@ -1021,7 +1021,7 @@ static void tcp_data_ready(struct sock *sk, int bytes)
 		goto out;
 
 	/* We use rd_desc to pass struct xprt to tcp_data_recv */
-	rd_desc.buf = (char *)xprt;
+	rd_desc.arg.data = xprt;
 	rd_desc.count = 65536;
 	tcp_read_sock(sk, &rd_desc, tcp_data_recv);
 out:
@@ -1086,8 +1086,8 @@ xprt_write_space(struct sock *sk)
 
 	/* Wait until we have enough socket memory */
 	if (xprt->stream) {
-		/* from net/ipv4/tcp.c:tcp_write_space */
-		if (tcp_wspace(sk) < tcp_min_write_space(sk))
+		/* from net/core/stream.c:sk_stream_write_space */
+		if (sk_stream_wspace(sk) < sk_stream_min_wspace(sk))
 			goto out;
 	} else {
 		/* from net/core/sock.c:sock_def_write_space */
@@ -1296,21 +1296,6 @@ xprt_transmit(struct rpc_task *task)
 /*
  * Reserve an RPC call slot.
  */
-void
-xprt_reserve(struct rpc_task *task)
-{
-	struct rpc_xprt	*xprt = task->tk_xprt;
-
-	task->tk_status = -EIO;
-	if (!xprt->shutdown) {
-		spin_lock(&xprt->xprt_lock);
-		do_xprt_reserve(task);
-		spin_unlock(&xprt->xprt_lock);
-		if (task->tk_rqstp)
-			del_timer_sync(&xprt->timer);
-	}
-}
-
 static inline void
 do_xprt_reserve(struct rpc_task *task)
 {
@@ -1332,6 +1317,21 @@ do_xprt_reserve(struct rpc_task *task)
 	rpc_sleep_on(&xprt->backlog, task, NULL, NULL);
 }
 
+void
+xprt_reserve(struct rpc_task *task)
+{
+	struct rpc_xprt	*xprt = task->tk_xprt;
+
+	task->tk_status = -EIO;
+	if (!xprt->shutdown) {
+		spin_lock(&xprt->xprt_lock);
+		do_xprt_reserve(task);
+		spin_unlock(&xprt->xprt_lock);
+		if (task->tk_rqstp)
+			del_timer_sync(&xprt->timer);
+	}
+}
+
 /*
  * Allocate a 'unique' XID
  */
diff --git a/net/unix/af_unix.c b/net/unix/af_unix.c
index 349343927..08432ceda 100644
--- a/net/unix/af_unix.c
+++ b/net/unix/af_unix.c
@@ -118,6 +118,9 @@
 #include <linux/mount.h>
 #include <net/checksum.h>
 #include <linux/security.h>
+#include <linux/vs_context.h>
+#include <linux/vs_network.h>
+#include <linux/vs_limit.h>
 
 int sysctl_unix_max_dgram_qlen = 10;
 
@@ -405,6 +408,7 @@ static int unix_release_sock (struct sock *sk, int embrion)
 		mntput(mnt);
 	}
 
+	vx_sock_dec(sk);
 	clr_vx_info(&sk->sk_vx_info);
 	clr_nx_info(&sk->sk_nx_info);
 	sock_put(sk);
@@ -562,8 +566,9 @@ static struct sock * unix_create1(struct socket *sock)
 	sk_set_owner(sk, THIS_MODULE);
 
 	set_vx_info(&sk->sk_vx_info, current->vx_info);
-	set_nx_info(&sk->sk_nx_info, current->nx_info);
 	sk->sk_xid = vx_current_xid();
+	vx_sock_inc(sk);
+	set_nx_info(&sk->sk_nx_info, current->nx_info);
 
 	sk->sk_write_space	= unix_write_space;
 	sk->sk_max_ack_backlog	= sysctl_unix_max_dgram_qlen;
@@ -2042,7 +2047,7 @@ static int __init af_unix_init(void)
         /* allocate our sock slab cache */
         unix_sk_cachep = kmem_cache_create("unix_sock",
 					   sizeof(struct unix_sock), 0,
-					   SLAB_HWCACHE_ALIGN, 0, 0);
+					   SLAB_HWCACHE_ALIGN, NULL, NULL);
         if (!unix_sk_cachep)
                 printk(KERN_CRIT
                         "af_unix_init: Cannot create unix_sock SLAB cache!\n");
diff --git a/net/xfrm/Makefile b/net/xfrm/Makefile
index 7cf00be13..12bf0f886 100644
--- a/net/xfrm/Makefile
+++ b/net/xfrm/Makefile
@@ -2,7 +2,7 @@
 # Makefile for the XFRM subsystem.
 #
 
-obj-$(CONFIG_XFRM) := xfrm_policy.o xfrm_state.o xfrm_input.o xfrm_algo.o xfrm_output.o \
+obj-$(CONFIG_XFRM) := xfrm_policy.o xfrm_state.o xfrm_input.o xfrm_algo.o \
 	xfrm_export.o
 obj-$(CONFIG_XFRM_USER) += xfrm_user.o
 
diff --git a/net/xfrm/xfrm_export.c b/net/xfrm/xfrm_export.c
index fdd4d0ee7..f72754953 100644
--- a/net/xfrm/xfrm_export.c
+++ b/net/xfrm/xfrm_export.c
@@ -18,6 +18,7 @@ EXPORT_SYMBOL(xfrm_state_add);
 EXPORT_SYMBOL(xfrm_state_update);
 EXPORT_SYMBOL(xfrm_state_check_expire);
 EXPORT_SYMBOL(xfrm_state_check_space);
+EXPORT_SYMBOL(xfrm_state_check);
 EXPORT_SYMBOL(xfrm_state_lookup);
 EXPORT_SYMBOL(xfrm_state_register_afinfo);
 EXPORT_SYMBOL(xfrm_state_unregister_afinfo);
@@ -27,7 +28,6 @@ EXPORT_SYMBOL(xfrm_state_delete_tunnel);
 EXPORT_SYMBOL(xfrm_replay_check);
 EXPORT_SYMBOL(xfrm_replay_advance);
 EXPORT_SYMBOL(xfrm_check_selectors);
-EXPORT_SYMBOL(xfrm_check_output);
 EXPORT_SYMBOL(__secpath_destroy);
 EXPORT_SYMBOL(secpath_dup);
 EXPORT_SYMBOL(xfrm_get_acqseq);
@@ -35,7 +35,6 @@ EXPORT_SYMBOL(xfrm_parse_spi);
 EXPORT_SYMBOL(xfrm4_rcv);
 EXPORT_SYMBOL(xfrm4_tunnel_register);
 EXPORT_SYMBOL(xfrm4_tunnel_deregister);
-EXPORT_SYMBOL(xfrm4_tunnel_check_size);
 EXPORT_SYMBOL(xfrm_register_type);
 EXPORT_SYMBOL(xfrm_unregister_type);
 EXPORT_SYMBOL(xfrm_get_type);
diff --git a/net/xfrm/xfrm_policy.c b/net/xfrm/xfrm_policy.c
index 2e60c843f..e7db9f8b7 100644
--- a/net/xfrm/xfrm_policy.c
+++ b/net/xfrm/xfrm_policy.c
@@ -204,6 +204,7 @@ out:
 	return;
 
 expired:
+	read_unlock(&xp->lock);
 	km_policy_expired(xp, dir, 1);
 	xfrm_policy_delete(xp, dir);
 	xfrm_pol_put(xp);
@@ -535,8 +536,11 @@ void xfrm_policy_delete(struct xfrm_policy *pol, int dir)
 	write_lock_bh(&xfrm_policy_lock);
 	pol = __xfrm_policy_unlink(pol, dir);
 	write_unlock_bh(&xfrm_policy_lock);
-	if (pol)
+	if (pol) {
+		if (dir < XFRM_POLICY_MAX)
+			atomic_inc(&flow_cache_genid);
 		xfrm_policy_kill(pol);
+	}
 }
 
 int xfrm_sk_policy_insert(struct sock *sk, int dir, struct xfrm_policy *pol)
diff --git a/net/xfrm/xfrm_state.c b/net/xfrm/xfrm_state.c
index 44cb5240f..f45fa55c2 100644
--- a/net/xfrm/xfrm_state.c
+++ b/net/xfrm/xfrm_state.c
@@ -65,7 +65,6 @@ static void xfrm_state_gc_destroy(struct xfrm_state *x)
 		xfrm_put_type(x->type);
 	}
 	kfree(x);
-	wake_up(&km_waitq);
 }
 
 static void xfrm_state_gc_task(void *data)
@@ -82,6 +81,7 @@ static void xfrm_state_gc_task(void *data)
 		x = list_entry(entry, struct xfrm_state, bydst);
 		xfrm_state_gc_destroy(x);
 	}
+	wake_up(&km_waitq);
 }
 
 static inline unsigned long make_jiffies(long secs)
@@ -400,23 +400,17 @@ int xfrm_state_add(struct xfrm_state *x)
 	spin_lock_bh(&xfrm_state_lock);
 
 	x1 = afinfo->state_lookup(&x->id.daddr, x->id.spi, x->id.proto);
-	if (!x1) {
-		x1 = afinfo->find_acq(
-			x->props.mode, x->props.reqid, x->id.proto,
-			&x->id.daddr, &x->props.saddr, 0);
-		if (x1 && x1->id.spi != x->id.spi && x1->id.spi) {
-			xfrm_state_put(x1);
-			x1 = NULL;
-		}
-	}
-
-	if (x1 && x1->id.spi) {
+	if (x1) {
 		xfrm_state_put(x1);
 		x1 = NULL;
 		err = -EEXIST;
 		goto out;
 	}
 
+	x1 = afinfo->find_acq(
+		x->props.mode, x->props.reqid, x->id.proto,
+		&x->id.daddr, &x->props.saddr, 0);
+
 	__xfrm_state_insert(x);
 	err = 0;
 
@@ -531,6 +525,16 @@ int xfrm_state_check_space(struct xfrm_state *x, struct sk_buff *skb)
 	return 0;
 }
 
+int xfrm_state_check(struct xfrm_state *x, struct sk_buff *skb)
+{
+	int err = xfrm_state_check_expire(x);
+	if (err < 0)
+		goto err;
+	err = xfrm_state_check_space(x, skb);
+err:
+	return err;
+}
+
 struct xfrm_state *
 xfrm_state_lookup(xfrm_address_t *daddr, u32 spi, u8 proto,
 		  unsigned short family)
@@ -620,11 +624,12 @@ xfrm_alloc_spi(struct xfrm_state *x, u32 minspi, u32 maxspi)
 		for (h=0; h<maxspi-minspi+1; h++) {
 			spi = minspi + net_random()%(maxspi-minspi+1);
 			x0 = xfrm_state_lookup(&x->id.daddr, htonl(spi), x->id.proto, x->props.family);
-			if (x0 == NULL)
+			if (x0 == NULL) {
+				x->id.spi = htonl(spi);
 				break;
+			}
 			xfrm_state_put(x0);
 		}
-		x->id.spi = htonl(spi);
 	}
 	if (x->id.spi) {
 		spin_lock_bh(&xfrm_state_lock);
diff --git a/net/xfrm/xfrm_user.c b/net/xfrm/xfrm_user.c
index 15bf2fd27..eccc0231f 100644
--- a/net/xfrm/xfrm_user.c
+++ b/net/xfrm/xfrm_user.c
@@ -78,6 +78,15 @@ static int verify_encap_tmpl(struct rtattr **xfrma)
 	if ((rt->rta_len - sizeof(*rt)) < sizeof(*encap))
 		return -EINVAL;
 
+	encap = RTA_DATA(rt);
+	switch (encap->encap_type) {
+	case UDP_ENCAP_ESPINUDP:
+	case UDP_ENCAP_ESPINUDP_NON_IKE:
+		break;
+	default:
+		return -ENOPROTOOPT;
+	}
+
 	return 0;
 }
 
@@ -258,6 +267,8 @@ static int xfrm_add_sa(struct sk_buff *skb, struct nlmsghdr *nlh, void **xfrma)
 	if (err)
 		return err;
 
+	xfrm_probe_algs();
+
 	x = xfrm_state_construct(p, (struct rtattr **) xfrma, &err);
 	if (!x)
 		return err;
@@ -805,6 +816,20 @@ static int xfrm_get_policy(struct sk_buff *skb, struct nlmsghdr *nlh, void **xfr
 	return err;
 }
 
+static int xfrm_flush_sa(struct sk_buff *skb, struct nlmsghdr *nlh, void **xfrma)
+{
+	struct xfrm_usersa_flush *p = NLMSG_DATA(nlh);
+
+	xfrm_state_flush(p->proto);
+	return 0;
+}
+
+static int xfrm_flush_policy(struct sk_buff *skb, struct nlmsghdr *nlh, void **xfrma)
+{
+	xfrm_policy_flush();
+	return 0;
+}
+
 static const int xfrm_msg_min[(XFRM_MSG_MAX + 1 - XFRM_MSG_BASE)] = {
 	NLMSG_LENGTH(sizeof(struct xfrm_usersa_info)),	/* NEW SA */
 	NLMSG_LENGTH(sizeof(struct xfrm_usersa_id)),	/* DEL SA */
@@ -817,6 +842,9 @@ static const int xfrm_msg_min[(XFRM_MSG_MAX + 1 - XFRM_MSG_BASE)] = {
 	NLMSG_LENGTH(sizeof(struct xfrm_user_expire)),	/* EXPIRE */
 	NLMSG_LENGTH(sizeof(struct xfrm_userpolicy_info)),/* UPD POLICY */
 	NLMSG_LENGTH(sizeof(struct xfrm_usersa_info)),	/* UPD SA */
+	NLMSG_LENGTH(sizeof(struct xfrm_user_polexpire)), /* POLEXPIRE */
+	NLMSG_LENGTH(sizeof(struct xfrm_usersa_flush)),	/* FLUSH SA */
+	NLMSG_LENGTH(0),				/* FLUSH POLICY */
 };
 
 static struct xfrm_link {
@@ -840,6 +868,9 @@ static struct xfrm_link {
 	{},
 	{	.doit	=	xfrm_add_policy 	},
 	{	.doit	=	xfrm_add_sa, 		},
+	{},
+	{	.doit	=	xfrm_flush_sa		},
+	{	.doit	=	xfrm_flush_policy	},
 };
 
 static int xfrm_done(struct netlink_callback *cb)
diff --git a/scripts/Makefile b/scripts/Makefile
index 8de642c6e..81c913c1e 100644
--- a/scripts/Makefile
+++ b/scripts/Makefile
@@ -5,24 +5,11 @@
 # docproc: 	 Preprocess .tmpl file in order to generate .sgml docs
 # conmakehash:	 Create arrays for initializing the kernel console tables
 
-host-progs	:= conmakehash kallsyms modpost mk_elfconfig pnmtologo bin2c
-always		:= $(host-progs) empty.o
-
-modpost-objs	:= modpost.o file2alias.o sumversion.o
+host-progs	:= conmakehash kallsyms pnmtologo bin2c
+always		:= $(host-progs)
 
 subdir-$(CONFIG_MODVERSIONS)	+= genksyms
+subdir-y	+= mod
 
 # Let clean descend into subdirs
-subdir-	+= basic lxdialog kconfig
-
-# dependencies on generated files need to be listed explicitly
-
-$(obj)/modpost.o $(obj)/file2alias.o $(obj)/sumversion.o: $(obj)/elfconfig.h
-
-quiet_cmd_elfconfig = MKELF   $@
-      cmd_elfconfig = $(obj)/mk_elfconfig $(ARCH) < $< > $@
-
-$(obj)/elfconfig.h: $(obj)/empty.o $(obj)/mk_elfconfig FORCE
-	$(call if_changed,elfconfig)
-
-targets += elfconfig.h
+subdir-	+= basic lxdialog kconfig package
diff --git a/scripts/Makefile.modinst b/scripts/Makefile.modinst
index 5431acb14..2f997b9b1 100644
--- a/scripts/Makefile.modinst
+++ b/scripts/Makefile.modinst
@@ -9,27 +9,17 @@ include scripts/Makefile.lib
 
 #
 
-__modules := $(shell head -q -n1 /dev/null $(wildcard $(MODVERDIR)/*.mod))
+__modules := $(sort $(shell head -q -n1 /dev/null $(wildcard $(MODVERDIR)/*.mod)))
 modules := $(patsubst %.o,%.ko,$(wildcard $(__modules:.ko=.o)))
 
 .PHONY: $(modules)
 __modinst: $(modules)
 	@:
 
-# Modules built within the kernel tree
-
 quiet_cmd_modules_install = INSTALL $@
-      cmd_modules_install = mkdir -p $(MODLIB)/kernel/$(@D); \
-			    cp $@ $(MODLIB)/kernel/$(@D)
-
-$(filter-out ../% /%,$(modules)):
-	$(call cmd,modules_install)
-
-# Modules built outside just go into extra
+      cmd_modules_install = mkdir -p $(2); cp $@ $(2)
 
-quiet_cmd_modules_install_extra = INSTALL $(obj-m:.o=.ko)
-      cmd_modules_install_extra = mkdir -p $(MODLIB)/extra; \
-			    	  cp $@ $(MODLIB)/extra
+modinst_dir = $(MODLIB)/$(if $(filter ../% /%,$@),extra/,kernel/$(@D))
 
-$(filter     ../% /%,$(modules)):
-	$(call cmd,modules_install_extra)
+$(modules):
+	$(call cmd,modules_install,$(modinst_dir))
diff --git a/scripts/Makefile.modpost b/scripts/Makefile.modpost
index f7efc18ff..19f534527 100644
--- a/scripts/Makefile.modpost
+++ b/scripts/Makefile.modpost
@@ -41,7 +41,7 @@ include scripts/Makefile.lib
 symverfile := $(objtree)/Module.symvers
 
 # Step 1), find all modules listed in $(MODVERDIR)/
-__modules := $(shell head -q -n1 /dev/null $(wildcard $(MODVERDIR)/*.mod))
+__modules := $(sort $(shell head -q -n1 /dev/null $(wildcard $(MODVERDIR)/*.mod)))
 modules   := $(patsubst %.o,%.ko, $(wildcard $(__modules:.ko=.o)))
 
 _modpost: $(modules)
@@ -50,7 +50,7 @@ _modpost: $(modules)
 # Step 2), invoke modpost
 #  Includes step 3,4
 quiet_cmd_modpost = MODPOST
-      cmd_modpost = scripts/modpost \
+      cmd_modpost = scripts/mod/modpost \
 	$(if $(KBUILD_EXTMOD),-i,-o) $(symverfile) \
 	$(filter-out FORCE,$^)
 
diff --git a/scripts/checkstack.pl b/scripts/checkstack.pl
index df85c66ca..7d33f0a42 100644
--- a/scripts/checkstack.pl
+++ b/scripts/checkstack.pl
@@ -10,9 +10,10 @@
 #	IA64 port via Andreas Dilger
 #	Arm port by Holger Schurig
 #	Random bits by Matt Mackall <mpm@selenic.com>
+#	M68k port by Geert Uytterhoeven and Andreas Schwab
 #
 #	Usage:
-#	objdump -d vmlinux | stackcheck_ppc.pl [arch]
+#	objdump -d vmlinux | stackcheck.pl [arch]
 #
 #	TODO :	Port to all architectures (one regex per arch)
 
@@ -23,6 +24,7 @@
 # $1 (first bracket) matches the size of the stack growth
 #
 # use anything else and feel the pain ;)
+my (@stack, $re, $x, $xs);
 {
 	my $arch = shift;
 	if ($arch eq "") {
@@ -31,25 +33,29 @@
 
 	$x	= "[0-9a-f]";	# hex character
 	$xs	= "[0-9a-f ]";	# hex character or space
-	if ($arch =~ /^arm$/) {
+	if ($arch eq 'arm') {
 		#c0008ffc:	e24dd064	sub	sp, sp, #100	; 0x64
 		$re = qr/.*sub.*sp, sp, #(([0-9]{2}|[3-9])[0-9]{2})/o;
 	} elsif ($arch =~ /^i[3456]86$/) {
 		#c0105234:       81 ec ac 05 00 00       sub    $0x5ac,%esp
 		$re = qr/^.*[as][du][db]    \$(0x$x{1,8}),\%esp$/o;
-	} elsif ($arch =~ /^ia64$/) {
+	} elsif ($arch eq 'ia64') {
 		#e0000000044011fc:       01 0f fc 8c     adds r12=-384,r12
 		$re = qr/.*adds.*r12=-(([0-9]{2}|[3-9])[0-9]{2}),r12/o;
-	} elsif ($arch =~ /^mips64$/) {
+	} elsif ($arch eq 'm68k') {
+		#    2b6c:       4e56 fb70       linkw %fp,#-1168
+		#  1df770:       defc ffe4       addaw #-28,%sp
+		$re = qr/.*(?:linkw %fp,|addaw )#-([0-9]{1,4})(?:,%sp)?$/o;
+	} elsif ($arch eq 'mips64') {
 		#8800402c:       67bdfff0        daddiu  sp,sp,-16
 		$re = qr/.*daddiu.*sp,sp,-(([0-9]{2}|[3-9])[0-9]{2})/o;
-	} elsif ($arch =~ /^mips$/) {
+	} elsif ($arch eq 'mips') {
 		#88003254:       27bdffe0        addiu   sp,sp,-32
 		$re = qr/.*addiu.*sp,sp,-(([0-9]{2}|[3-9])[0-9]{2})/o;
-	} elsif ($arch =~ /^ppc$/) {
+	} elsif ($arch eq 'ppc') {
 		#c00029f4:       94 21 ff 30     stwu    r1,-208(r1)
 		$re = qr/.*stwu.*r1,-($x{1,8})\(r1\)/o;
-	} elsif ($arch =~ /^ppc64$/) {
+	} elsif ($arch eq 'ppc64') {
 		#XXX
 		$re = qr/.*stdu.*r1,-($x{1,8})\(r1\)/o;
 	} elsif ($arch =~ /^s390x?$/) {
@@ -62,6 +68,7 @@
 }
 
 sub bysize($) {
+	my ($asize, $bsize);
 	($asize = $a) =~ s/.*	+(.*)$/$1/;
 	($bsize = $b) =~ s/.*	+(.*)$/$1/;
 	$bsize <=> $asize
@@ -70,8 +77,9 @@ sub bysize($) {
 #
 # main()
 #
-$funcre = qr/^$x* \<(.*)\>:$/;
-while ($line = <STDIN>) {
+my $funcre = qr/^$x* <(.*)>:$/;
+my $func;
+while (my $line = <STDIN>) {
 	if ($line =~ m/$funcre/) {
 		$func = $1;
 	}
@@ -85,7 +93,7 @@ while ($line = <STDIN>) {
 			$size += 0x80000000;
 		}
 
-		$line =~ m/^($xs*).*/;
+		next if $line !~ m/^($xs*)/;
 		my $addr = $1;
 		$addr =~ s/ /0/g;
 		$addr = "0x$addr";
@@ -97,12 +105,8 @@ while ($line = <STDIN>) {
 			$padlen -= 8;
 		}
 		next if ($size < 100);
-		$stack[@stack] = "$intro$size\n";
+		push @stack, "$intro$size\n";
 	}
 }
 
-@sortedstack = sort bysize @stack;
-
-foreach $i (@sortedstack) {
-	print("$i");
-}
+print sort bysize @stack;
diff --git a/scripts/extract-ikconfig b/scripts/extract-ikconfig
index 8e526d370..d9f9f34b2 100755
--- a/scripts/extract-ikconfig
+++ b/scripts/extract-ikconfig
@@ -1,9 +1,31 @@
-#! /bin/bash 
+#!/bin/sh
 # extracts .config info from a [b]zImage file
 # uses: binoffset (new), dd, zcat, strings, grep
 # $arg1 is [b]zImage filename
 
-TMPFILE=""
+binoffset="./scripts/binoffset"
+
+IKCFG_ST="0x49 0x4b 0x43 0x46 0x47 0x5f 0x53 0x54"
+IKCFG_ED="0x49 0x4b 0x43 0x46 0x47 0x5f 0x45 0x44"
+function dump_config {
+    typeset file="$1"
+
+    start=`$binoffset $file $IKCFG_ST 2>/dev/null`
+    [ "$?" != "0" ] && start="-1"
+    if [ "$start" -eq "-1" ]; then
+	return
+    fi
+    end=`$binoffset $file $IKCFG_ED 2>/dev/null`
+
+    let start="$start + 8"
+    let size="$end - $start"
+
+    head --bytes="$end" "$file" | tail --bytes="$size" | zcat
+
+    clean_up
+    exit 0
+}
+
 
 usage()
 {
@@ -12,8 +34,7 @@ usage()
 
 clean_up()
 {
-	if [ -z $ISCOMP ]
-	then
+	if [ "$TMPFILE" != "" ]; then
 		rm -f $TMPFILE
 	fi
 }
@@ -21,46 +42,36 @@ clean_up()
 if [ $# -lt 1 ]
 then
 	usage
-	exit
+	exit 1
 fi
 
-image=$1
+TMPFILE="/tmp/ikconfig-$$"
+image="$1"
 
-# There are two gzip headers, as well as arches which don't compress their
-# kernel.
-GZHDR="0x1f 0x8b 0x08 0x00"
-if [ `binoffset $image $GZHDR >/dev/null 2>&1 ; echo $?` -ne 0 ]
-then
-	GZHDR="0x1f 0x8b 0x08 0x08"
-	if [ `binoffset $image $GZHDR >/dev/null 2>&1 ; echo $?` -ne 0 ]
-	then
-		ISCOMP=0
-	fi
-fi
+# vmlinux: Attempt to dump the configuration from the file directly
+dump_config "$image"
 
-PID=$$
+GZHDR1="0x1f 0x8b 0x08 0x00"
+GZHDR2="0x1f 0x8b 0x08 0x08"
 
-# Extract and uncompress the kernel image if necessary
-if [ -z $ISCOMP ]
-then
-	TMPFILE="/tmp/`basename $image`.vmlin.$PID"
-	dd if=$image bs=1 skip=`binoffset $image $GZHDR` 2> /dev/null | zcat > $TMPFILE
-else
-	TMPFILE=$image
+# vmlinux.gz: Check for a compressed images
+off=`$binoffset "$image" $GZHDR1 2>/dev/null`
+[ "$?" != "0" ] && off="-1"
+if [ "$off" -eq "-1" ]; then
+	off=`$binoffset "$image" $GZHDR2 2>/dev/null`
+	[ "$?" != "0" ] && off="-1"
 fi
-
-# Look for strings.
-strings $TMPFILE | grep "CONFIG_BEGIN=n" > /dev/null
-if [ $? -eq 0 ]
-then
-	strings $TMPFILE | awk "/CONFIG_BEGIN=n/,/CONFIG_END=n/" > $image.oldconfig.$PID
-else
-	echo "ERROR: Unable to extract kernel configuration information."
-	echo "       This kernel image may not have the config info."
-	clean_up
-	exit 1
+if [ "$off" -eq "0" ]; then
+	zcat <"$image" >"$TMPFILE"
+	dump_config "$TMPFILE"
+elif [ "$off" -ne "-1" ]; then
+	(dd ibs="$off" skip=1 count=0 && dd bs=512k) <"$image" 2>/dev/null | \
+		zcat >"$TMPFILE"
+	dump_config "$TMPFILE"
 fi
 
-echo "Kernel configuration written to $image.oldconfig.$PID"
+echo "ERROR: Unable to extract kernel configuration information."
+echo "       This kernel image may not have the config info."
+
 clean_up
-exit 0
+exit 1
diff --git a/scripts/genksyms/parse.c_shipped b/scripts/genksyms/parse.c_shipped
index c0f7ed4d1..2c6b1286b 100644
--- a/scripts/genksyms/parse.c_shipped
+++ b/scripts/genksyms/parse.c_shipped
@@ -156,7 +156,7 @@ static const short yyrhs[] = {    53,
     71,    94,    92,    82,     0,     0,    62,     0,    63,     0,
     62,    63,     0,    64,     0,    65,     0,     5,     0,    16,
      0,    20,     0,    11,     0,    13,     0,    66,     0,    70,
-     0,    27,    46,    65,    47,     0,    21,    36,     0,    23,
+     0,    27,    46,    62,    47,     0,    21,    36,     0,    23,
     36,     0,    10,    36,     0,    21,    36,    84,     0,    23,
     36,    84,     0,    10,    36,    31,     0,    10,    31,     0,
     21,    84,     0,    23,    84,     0,     7,     0,    18,     0,
@@ -291,142 +291,150 @@ static const short yydefgoto[] = {     1,
 };
 
 static const short yypact[] = {-32768,
-    19,-32768,   175,-32768,    32,-32768,-32768,-32768,-32768,-32768,
+    15,-32768,   197,-32768,    23,-32768,-32768,-32768,-32768,-32768,
    -18,-32768,-32768,-32768,-32768,-32768,-32768,-32768,-32768,-32768,
--32768,   -30,-32768,   -26,-32768,-32768,-32768,   -32,   -10,    -2,
--32768,-32768,-32768,-32768,     2,   428,-32768,-32768,-32768,-32768,
--32768,-32768,-32768,-32768,-32768,-32768,-32768,    34,    12,    79,
--32768,   428,    12,-32768,   455,    33,-32768,-32768,    15,    14,
-    35,    29,-32768,     2,   -14,   -21,-32768,-32768,-32768,    67,
-    31,    37,   127,-32768,-32768,     2,-32768,    54,    60,    66,
-    69,-32768,    14,-32768,-32768,     2,-32768,-32768,-32768,    84,
--32768,   219,-32768,-32768,    70,-32768,    20,    91,    72,    84,
-   -20,    74,    81,-32768,-32768,-32768,    86,-32768,   102,-32768,
-   106,-32768,-32768,-32768,-32768,-32768,   109,   108,   348,   112,
-   126,   117,-32768,-32768,   118,-32768,   122,-32768,-32768,-32768,
--32768,   262,-32768,    31,-32768,   131,-32768,-32768,-32768,-32768,
--32768,     7,   120,-32768,    -9,-32768,-32768,   392,-32768,-32768,
-   125,   130,-32768,-32768,   132,-32768,   159,-32768,-32768,   305,
--32768,-32768,-32768,-32768,-32768,-32768,   160,   161,-32768,-32768,
-   174,-32768
+-32768,   -28,-32768,   -25,-32768,-32768,-32768,   -26,   -22,   -12,
+-32768,-32768,-32768,-32768,    49,   493,-32768,-32768,-32768,-32768,
+-32768,-32768,-32768,-32768,-32768,-32768,-32768,    27,    -8,   101,
+-32768,   493,    -8,-32768,   493,    10,-32768,-32768,    11,     9,
+    18,    26,-32768,    49,   -15,   -13,-32768,-32768,-32768,    25,
+    24,    48,   149,-32768,-32768,    49,-32768,   414,    39,    40,
+    47,-32768,     9,-32768,-32768,    49,-32768,-32768,-32768,    66,
+-32768,   241,-32768,-32768,    50,-32768,     5,    65,    42,    66,
+    17,    56,    55,-32768,-32768,-32768,    60,-32768,    75,-32768,
+    80,-32768,-32768,-32768,-32768,-32768,    81,    82,   370,    85,
+    98,    89,-32768,-32768,    88,-32768,    91,-32768,-32768,-32768,
+-32768,   284,-32768,    24,-32768,   103,-32768,-32768,-32768,-32768,
+-32768,     8,    43,-32768,    30,-32768,-32768,   457,-32768,-32768,
+    92,    93,-32768,-32768,    95,-32768,    96,-32768,-32768,   327,
+-32768,-32768,-32768,-32768,-32768,-32768,    99,   104,-32768,-32768,
+   148,-32768
 };
 
 static const short yypgoto[] = {-32768,
-   208,-32768,-32768,-32768,   158,-32768,-32768,   128,     0,   -90,
-   -36,-32768,   157,-32768,   -70,-32768,-32768,   -51,   -31,-32768,
-   -40,-32768,  -125,-32768,-32768,    65,   -97,-32768,-32768,-32768,
--32768,   -19,-32768,-32768,   143,-32768,-32768,    83,   124,   141,
+   152,-32768,-32768,-32768,   119,-32768,-32768,    94,     0,   -55,
+   -35,-32768,-32768,-32768,   -69,-32768,-32768,   -56,   -30,-32768,
+   -76,-32768,  -122,-32768,-32768,    29,   -62,-32768,-32768,-32768,
+-32768,   -17,-32768,-32768,   105,-32768,-32768,    52,    86,    83,
 -32768,-32768,-32768
 };
 
 
-#define	YYLAST		495
-
-
-static const short yytable[] = {    67,
-    99,   119,    35,    65,    54,    49,   152,   155,    84,    53,
-    91,   131,    47,    55,    88,    80,    89,    48,   171,    50,
-   125,     9,   159,    50,    92,   132,    99,    81,    99,    69,
-    18,   114,    87,    77,   168,    56,   160,    58,   -89,    27,
-    57,   119,   140,    31,   157,   158,   156,    59,   143,    60,
-    58,    76,   142,   -89,    60,   126,   127,   119,   129,    96,
-    59,    50,    60,    99,    68,    97,    95,    60,    79,   119,
-    96,   143,   143,    86,    45,    46,    97,    85,    60,    70,
-   106,    98,    67,     6,     7,     8,     9,    10,    11,    12,
-    13,    14,    15,    16,    17,    18,    19,    20,    21,    22,
-   110,    24,    25,    26,    27,    28,   111,   126,    31,    93,
-    94,    96,   112,   116,   -19,   113,   133,    97,    32,    60,
-    98,   -19,  -103,   128,   -19,   134,   -19,   107,    93,   -19,
-    88,     6,     7,     8,     9,    10,    11,    12,    13,    14,
-    15,    16,    17,    18,    19,    20,    21,    22,   135,    24,
-    25,    26,    27,    28,   139,   140,    31,   136,   146,   156,
-   147,   148,   -19,   154,   149,   142,    32,    60,   150,   -19,
-  -104,   163,   -19,   172,   -19,     5,   164,   -19,   165,     6,
-     7,     8,     9,    10,    11,    12,    13,    14,    15,    16,
-    17,    18,    19,    20,    21,    22,    23,    24,    25,    26,
-    27,    28,    29,    30,    31,   166,   169,   170,     4,    75,
-   -19,    78,   162,   115,    32,   108,   153,   -19,   124,   118,
-   -19,     0,   -19,     6,     7,     8,     9,    10,    11,    12,
+#define	YYLAST		533
+
+
+static const short yytable[] = {    78,
+    67,    99,    35,    84,    65,   125,    54,    49,   155,   152,
+    53,    80,    47,    88,   171,    89,     9,    48,    91,    55,
+   127,    50,   129,    56,    50,    18,   114,    99,    81,    99,
+    57,    69,    92,    87,    27,    77,   119,   168,    31,   -89,
+   126,    50,    67,   140,    96,    79,    58,   156,   131,   143,
+    97,    76,    60,   142,   -89,    60,    59,    68,    60,    95,
+    85,   159,   132,    96,    99,    45,    46,    93,    94,    97,
+    86,    60,   143,   143,    98,   160,   119,   126,   140,   157,
+   158,    96,   156,    67,    58,   111,   112,    97,   142,    60,
+    60,   106,   119,   113,    59,   116,    60,   128,   133,   134,
+    98,    70,    93,    88,   119,     6,     7,     8,     9,    10,
+    11,    12,    13,    14,    15,    16,    17,    18,    19,    20,
+    21,    22,   135,    24,    25,    26,    27,    28,   139,   136,
+    31,   146,   147,   148,   149,   154,   -19,   150,   163,   164,
+    32,   165,   166,   -19,  -103,   169,   -19,   172,   -19,   107,
+   170,   -19,     4,     6,     7,     8,     9,    10,    11,    12,
     13,    14,    15,    16,    17,    18,    19,    20,    21,    22,
-   130,    24,    25,    26,    27,    28,     0,     0,    31,     0,
-     0,     0,     0,   -82,     0,     0,     0,     0,    32,     0,
-     0,     0,   151,     0,     0,   -82,     6,     7,     8,     9,
-    10,    11,    12,    13,    14,    15,    16,    17,    18,    19,
-    20,    21,    22,     0,    24,    25,    26,    27,    28,     0,
-     0,    31,     0,     0,     0,     0,   -82,     0,     0,     0,
-     0,    32,     0,     0,     0,   167,     0,     0,   -82,     6,
-     7,     8,     9,    10,    11,    12,    13,    14,    15,    16,
-    17,    18,    19,    20,    21,    22,     0,    24,    25,    26,
-    27,    28,     0,     0,    31,     0,     0,     0,     0,   -82,
-     0,     0,     0,     0,    32,     0,     0,     0,     0,     0,
-     0,   -82,     6,     7,     8,     9,    10,    11,    12,    13,
-    14,    15,    16,    17,    18,    19,    20,    21,    22,     0,
-    24,    25,    26,    27,    28,     0,     0,    31,     0,     0,
-     0,     0,     0,   140,     0,     0,     0,   141,     0,     0,
-     0,     0,     0,   142,     0,    60,     6,     7,     8,     9,
-    10,    11,    12,    13,    14,    15,    16,    17,    18,    19,
-    20,    21,    22,     0,    24,    25,    26,    27,    28,     0,
-     0,    31,     0,     0,     0,     0,   161,     0,     0,     0,
-     0,    32,     6,     7,     8,     9,    10,    11,    12,    13,
-    14,    15,    16,    17,    18,    19,    20,    21,    22,     0,
-    24,    25,    26,    27,    28,     0,     0,    31,     0,     0,
-     7,     8,     9,    10,    11,     0,    13,    32,    15,    16,
-     0,    18,    19,    20,     0,    22,     0,    24,    25,    26,
-    27,    28,     0,     0,    31,     0,     0,     0,     0,     0,
-     0,     0,     0,     0,    32
+    75,    24,    25,    26,    27,    28,   162,   108,    31,   115,
+   124,     0,   130,     0,   -19,   153,     0,     0,    32,     0,
+     0,   -19,  -104,     0,   -19,     0,   -19,     5,     0,   -19,
+     0,     6,     7,     8,     9,    10,    11,    12,    13,    14,
+    15,    16,    17,    18,    19,    20,    21,    22,    23,    24,
+    25,    26,    27,    28,    29,    30,    31,     0,     0,     0,
+     0,     0,   -19,     0,     0,     0,    32,     0,     0,   -19,
+     0,   118,   -19,     0,   -19,     6,     7,     8,     9,    10,
+    11,    12,    13,    14,    15,    16,    17,    18,    19,    20,
+    21,    22,     0,    24,    25,    26,    27,    28,     0,     0,
+    31,     0,     0,     0,     0,   -82,     0,     0,     0,     0,
+    32,     0,     0,     0,   151,     0,     0,   -82,     6,     7,
+     8,     9,    10,    11,    12,    13,    14,    15,    16,    17,
+    18,    19,    20,    21,    22,     0,    24,    25,    26,    27,
+    28,     0,     0,    31,     0,     0,     0,     0,   -82,     0,
+     0,     0,     0,    32,     0,     0,     0,   167,     0,     0,
+   -82,     6,     7,     8,     9,    10,    11,    12,    13,    14,
+    15,    16,    17,    18,    19,    20,    21,    22,     0,    24,
+    25,    26,    27,    28,     0,     0,    31,     0,     0,     0,
+     0,   -82,     0,     0,     0,     0,    32,     0,     0,     0,
+     0,     0,     0,   -82,     6,     7,     8,     9,    10,    11,
+    12,    13,    14,    15,    16,    17,    18,    19,    20,    21,
+    22,     0,    24,    25,    26,    27,    28,     0,     0,    31,
+     0,     0,     0,     0,     0,   140,     0,     0,     0,   141,
+     0,     0,     0,     0,     0,   142,     0,    60,     6,     7,
+     8,     9,    10,    11,    12,    13,    14,    15,    16,    17,
+    18,    19,    20,    21,    22,     0,    24,    25,    26,    27,
+    28,     0,     0,    31,     0,     0,     0,     0,     0,     0,
+     0,     0,     0,    32,     0,     0,     0,     0,     0,     0,
+   110,     6,     7,     8,     9,    10,    11,    12,    13,    14,
+    15,    16,    17,    18,    19,    20,    21,    22,     0,    24,
+    25,    26,    27,    28,     0,     0,    31,     0,     0,     0,
+     0,   161,     0,     0,     0,     0,    32,     6,     7,     8,
+     9,    10,    11,    12,    13,    14,    15,    16,    17,    18,
+    19,    20,    21,    22,     0,    24,    25,    26,    27,    28,
+     0,     0,    31,     0,     0,     0,     0,     0,     0,     0,
+     0,     0,    32
 };
 
-static const short yycheck[] = {    36,
-    71,    92,     3,    35,    24,    36,   132,     1,    60,    36,
-    32,    32,    31,    46,    29,     1,    31,    36,     0,    50,
-     1,     8,    32,    50,    46,    46,    97,    59,    99,    49,
-    17,    83,    64,    53,   160,    46,    46,    36,    32,    26,
-    43,   132,    36,    30,   142,   143,    40,    46,   119,    48,
-    36,    52,    46,    47,    48,    36,    97,   148,    99,    40,
-    46,    50,    48,   134,    31,    46,    36,    48,    36,   160,
-    40,   142,   143,    45,    43,    44,    46,    43,    48,     1,
-    44,    51,   119,     5,     6,     7,     8,     9,    10,    11,
-    12,    13,    14,    15,    16,    17,    18,    19,    20,    21,
-    47,    23,    24,    25,    26,    27,    47,    36,    30,    43,
-    44,    40,    47,    30,    36,    47,    43,    46,    40,    48,
-    51,    43,    44,    33,    46,    45,    48,     1,    43,    51,
-    29,     5,     6,     7,     8,     9,    10,    11,    12,    13,
-    14,    15,    16,    17,    18,    19,    20,    21,    43,    23,
-    24,    25,    26,    27,    47,    36,    30,    49,    47,    40,
-    35,    45,    36,    33,    47,    46,    40,    48,    47,    43,
-    44,    47,    46,     0,    48,     1,    47,    51,    47,     5,
-     6,     7,     8,     9,    10,    11,    12,    13,    14,    15,
-    16,    17,    18,    19,    20,    21,    22,    23,    24,    25,
-    26,    27,    28,    29,    30,    47,    47,    47,     1,    52,
-    36,    55,   148,    86,    40,    73,   134,    43,    95,     1,
-    46,    -1,    48,     5,     6,     7,     8,     9,    10,    11,
+static const short yycheck[] = {    55,
+    36,    71,     3,    60,    35,     1,    24,    36,     1,   132,
+    36,     1,    31,    29,     0,    31,     8,    36,    32,    46,
+    97,    50,    99,    46,    50,    17,    83,    97,    59,    99,
+    43,    49,    46,    64,    26,    53,    92,   160,    30,    32,
+    36,    50,    78,    36,    40,    36,    36,    40,    32,   119,
+    46,    52,    48,    46,    47,    48,    46,    31,    48,    36,
+    43,    32,    46,    40,   134,    43,    44,    43,    44,    46,
+    45,    48,   142,   143,    51,    46,   132,    36,    36,   142,
+   143,    40,    40,   119,    36,    47,    47,    46,    46,    48,
+    48,    44,   148,    47,    46,    30,    48,    33,    43,    45,
+    51,     1,    43,    29,   160,     5,     6,     7,     8,     9,
+    10,    11,    12,    13,    14,    15,    16,    17,    18,    19,
+    20,    21,    43,    23,    24,    25,    26,    27,    47,    49,
+    30,    47,    35,    45,    47,    33,    36,    47,    47,    47,
+    40,    47,    47,    43,    44,    47,    46,     0,    48,     1,
+    47,    51,     1,     5,     6,     7,     8,     9,    10,    11,
     12,    13,    14,    15,    16,    17,    18,    19,    20,    21,
-   100,    23,    24,    25,    26,    27,    -1,    -1,    30,    -1,
-    -1,    -1,    -1,    35,    -1,    -1,    -1,    -1,    40,    -1,
-    -1,    -1,     1,    -1,    -1,    47,     5,     6,     7,     8,
-     9,    10,    11,    12,    13,    14,    15,    16,    17,    18,
-    19,    20,    21,    -1,    23,    24,    25,    26,    27,    -1,
-    -1,    30,    -1,    -1,    -1,    -1,    35,    -1,    -1,    -1,
-    -1,    40,    -1,    -1,    -1,     1,    -1,    -1,    47,     5,
-     6,     7,     8,     9,    10,    11,    12,    13,    14,    15,
-    16,    17,    18,    19,    20,    21,    -1,    23,    24,    25,
-    26,    27,    -1,    -1,    30,    -1,    -1,    -1,    -1,    35,
-    -1,    -1,    -1,    -1,    40,    -1,    -1,    -1,    -1,    -1,
-    -1,    47,     5,     6,     7,     8,     9,    10,    11,    12,
-    13,    14,    15,    16,    17,    18,    19,    20,    21,    -1,
-    23,    24,    25,    26,    27,    -1,    -1,    30,    -1,    -1,
-    -1,    -1,    -1,    36,    -1,    -1,    -1,    40,    -1,    -1,
-    -1,    -1,    -1,    46,    -1,    48,     5,     6,     7,     8,
-     9,    10,    11,    12,    13,    14,    15,    16,    17,    18,
-    19,    20,    21,    -1,    23,    24,    25,    26,    27,    -1,
-    -1,    30,    -1,    -1,    -1,    -1,    35,    -1,    -1,    -1,
-    -1,    40,     5,     6,     7,     8,     9,    10,    11,    12,
-    13,    14,    15,    16,    17,    18,    19,    20,    21,    -1,
-    23,    24,    25,    26,    27,    -1,    -1,    30,    -1,    -1,
-     6,     7,     8,     9,    10,    -1,    12,    40,    14,    15,
-    -1,    17,    18,    19,    -1,    21,    -1,    23,    24,    25,
-    26,    27,    -1,    -1,    30,    -1,    -1,    -1,    -1,    -1,
-    -1,    -1,    -1,    -1,    40
+    52,    23,    24,    25,    26,    27,   148,    73,    30,    86,
+    95,    -1,   100,    -1,    36,   134,    -1,    -1,    40,    -1,
+    -1,    43,    44,    -1,    46,    -1,    48,     1,    -1,    51,
+    -1,     5,     6,     7,     8,     9,    10,    11,    12,    13,
+    14,    15,    16,    17,    18,    19,    20,    21,    22,    23,
+    24,    25,    26,    27,    28,    29,    30,    -1,    -1,    -1,
+    -1,    -1,    36,    -1,    -1,    -1,    40,    -1,    -1,    43,
+    -1,     1,    46,    -1,    48,     5,     6,     7,     8,     9,
+    10,    11,    12,    13,    14,    15,    16,    17,    18,    19,
+    20,    21,    -1,    23,    24,    25,    26,    27,    -1,    -1,
+    30,    -1,    -1,    -1,    -1,    35,    -1,    -1,    -1,    -1,
+    40,    -1,    -1,    -1,     1,    -1,    -1,    47,     5,     6,
+     7,     8,     9,    10,    11,    12,    13,    14,    15,    16,
+    17,    18,    19,    20,    21,    -1,    23,    24,    25,    26,
+    27,    -1,    -1,    30,    -1,    -1,    -1,    -1,    35,    -1,
+    -1,    -1,    -1,    40,    -1,    -1,    -1,     1,    -1,    -1,
+    47,     5,     6,     7,     8,     9,    10,    11,    12,    13,
+    14,    15,    16,    17,    18,    19,    20,    21,    -1,    23,
+    24,    25,    26,    27,    -1,    -1,    30,    -1,    -1,    -1,
+    -1,    35,    -1,    -1,    -1,    -1,    40,    -1,    -1,    -1,
+    -1,    -1,    -1,    47,     5,     6,     7,     8,     9,    10,
+    11,    12,    13,    14,    15,    16,    17,    18,    19,    20,
+    21,    -1,    23,    24,    25,    26,    27,    -1,    -1,    30,
+    -1,    -1,    -1,    -1,    -1,    36,    -1,    -1,    -1,    40,
+    -1,    -1,    -1,    -1,    -1,    46,    -1,    48,     5,     6,
+     7,     8,     9,    10,    11,    12,    13,    14,    15,    16,
+    17,    18,    19,    20,    21,    -1,    23,    24,    25,    26,
+    27,    -1,    -1,    30,    -1,    -1,    -1,    -1,    -1,    -1,
+    -1,    -1,    -1,    40,    -1,    -1,    -1,    -1,    -1,    -1,
+    47,     5,     6,     7,     8,     9,    10,    11,    12,    13,
+    14,    15,    16,    17,    18,    19,    20,    21,    -1,    23,
+    24,    25,    26,    27,    -1,    -1,    30,    -1,    -1,    -1,
+    -1,    35,    -1,    -1,    -1,    -1,    40,     5,     6,     7,
+     8,     9,    10,    11,    12,    13,    14,    15,    16,    17,
+    18,    19,    20,    21,    -1,    23,    24,    25,    26,    27,
+    -1,    -1,    30,    -1,    -1,    -1,    -1,    -1,    -1,    -1,
+    -1,    -1,    40
 };
 /* -*-C-*-  Note some compilers choke on comments on `#line' lines.  */
 #line 3 "/usr/lib/bison.simple"
diff --git a/scripts/kallsyms.c b/scripts/kallsyms.c
index f4b328979..e21a5d1a2 100644
--- a/scripts/kallsyms.c
+++ b/scripts/kallsyms.c
@@ -72,7 +72,20 @@ symbol_valid(struct sym_entry *s)
 			return 0;
 	}
 
-	if (strstr(s->sym, "_compiled."))
+	/* Exclude symbols which vary between passes.  Passes 1 and 2 must have
+	 * identical symbol lists.  The kallsyms_* symbols below are only added
+	 * after pass 1, they would be included in pass 2 when --all-symbols is
+	 * specified so exclude them to get a stable symbol list.
+	 */
+	if (strstr(s->sym, "_compiled.") ||
+	    strcmp(s->sym, "kallsyms_addresses") == 0 ||
+	    strcmp(s->sym, "kallsyms_num_syms") == 0 ||
+	    strcmp(s->sym, "kallsyms_names") == 0)
+		return 0;
+
+	/* Exclude linker generated symbols which vary between passes */
+	if (strcmp(s->sym, "_SDA_BASE_") == 0 ||	/* ppc */
+	    strcmp(s->sym, "_SDA2_BASE_") == 0)		/* ppc */
 		return 0;
 
 	return 1;
diff --git a/scripts/kconfig/mconf.c b/scripts/kconfig/mconf.c
index b3c24cb98..6f8bf9904 100644
--- a/scripts/kconfig/mconf.c
+++ b/scripts/kconfig/mconf.c
@@ -87,7 +87,7 @@ static char filename[PATH_MAX+1] = ".config";
 static char *args[1024], **argptr = args;
 static int indent;
 static struct termios ios_org;
-static int rows, cols;
+static int rows = 0, cols = 0;
 static struct menu *current_menu;
 static int child_count;
 static int do_resize;
@@ -113,26 +113,24 @@ static void init_wsize(void)
 	struct winsize ws;
 	char *env;
 
-	if (ioctl(1, TIOCGWINSZ, &ws) == -1) {
-		rows = 24;
-		cols = 80;
-	} else {
+	if (!ioctl(STDIN_FILENO, TIOCGWINSZ, &ws)) {
 		rows = ws.ws_row;
 		cols = ws.ws_col;
-		if (!rows) {
-			env = getenv("LINES");
-			if (env)
-				rows = atoi(env);
-			if (!rows)
-				rows = 24;
-		}
-		if (!cols) {
-			env = getenv("COLUMNS");
-			if (env)
-				cols = atoi(env);
-			if (!cols)
-				cols = 80;
-		}
+	}
+
+	if (!rows) {
+		env = getenv("LINES");
+		if (env)
+			rows = atoi(env);
+		if (!rows)
+			rows = 24;
+	}
+	if (!cols) {
+		env = getenv("COLUMNS");
+		if (env)
+			cols = atoi(env);
+		if (!cols)
+			cols = 80;
 	}
 
 	if (rows < 19 || cols < 80) {
diff --git a/scripts/kernel-doc b/scripts/kernel-doc
index a331dfdb2..aa7ffee63 100755
--- a/scripts/kernel-doc
+++ b/scripts/kernel-doc
@@ -652,7 +652,7 @@ sub output_struct_sgml(%) {
 	$type = $args{'parametertypes'}{$parameter};
 	if ($type =~ m/([^\(]*\(\*)\s*\)\s*\(([^\)]*)\)/) {
 	    # pointer-to-function
-	    print "  $1 $parameter ($2);\n";
+	    print "  $1 $parameter) ($2);\n";
 	} elsif ($type =~ m/^(.*?)\s*(:.*)/) {
 	    print "  $1 $parameter$2;\n";
 	} else {
@@ -1206,7 +1206,7 @@ sub dump_struct($$) {
         my $members = $3;
 
 	# ignore embedded structs or unions
-	$members =~ s/{.*}//g;
+	$members =~ s/{.*?}//g;
 
 	create_parameterlist($members, ';', $file);
 
diff --git a/scripts/lxdialog/menubox.c b/scripts/lxdialog/menubox.c
index a234e9f3b..9544b3c1f 100644
--- a/scripts/lxdialog/menubox.c
+++ b/scripts/lxdialog/menubox.c
@@ -71,7 +71,7 @@ print_item (WINDOW * win, const char *item, int choice, int selected, int hotkey
 
     strncpy(menu_item, item, menu_width);
     menu_item[menu_width] = 0;
-    j = first_alpha(menu_item, "YyNnMm");
+    j = first_alpha(menu_item, "YyNnMmHh");
 
     /* Clear 'residue' of last item */
     wattrset (win, menubox_attr);
@@ -279,17 +279,17 @@ dialog_menu (const char *title, const char *prompt, int height, int width,
 
 	if (key < 256 && isalpha(key)) key = tolower(key);
 
-	if (strchr("ynm", key))
+	if (strchr("ynmh", key))
 		i = max_choice;
 	else {
         for (i = choice+1; i < max_choice; i++) {
-		j = first_alpha(items[(scroll+i)*2+1], "YyNnMm");
+		j = first_alpha(items[(scroll+i)*2+1], "YyNnMmHh");
 		if (key == tolower(items[(scroll+i)*2+1][j]))
                 	break;
 	}
 	if (i == max_choice)
        		for (i = 0; i < max_choice; i++) {
-			j = first_alpha(items[(scroll+i)*2+1], "YyNnMm");
+			j = first_alpha(items[(scroll+i)*2+1], "YyNnMmHh");
 			if (key == tolower(items[(scroll+i)*2+1][j]))
                 		break;
 		}
diff --git a/scripts/package/Makefile b/scripts/package/Makefile
index f3df4bc95..48f89e17a 100644
--- a/scripts/package/Makefile
+++ b/scripts/package/Makefile
@@ -31,9 +31,10 @@ KERNELPATH := kernel-$(subst -,,$(KERNELRELEASE))
 MKSPEC     := $(srctree)/scripts/package/mkspec
 PREV       := set -e; cd ..;
 
+# rpm-pkg
 .PHONY: rpm-pkg rpm
 
-$(objtree)/kernel.spec: $(MKSPEC)
+$(objtree)/kernel.spec: $(MKSPEC) $(srctree)/Makefile
 	$(CONFIG_SHELL) $(MKSPEC) > $@
 
 rpm-pkg rpm: $(objtree)/kernel.spec
@@ -52,6 +53,22 @@ rpm-pkg rpm: $(objtree)/kernel.spec
 
 clean-rule +=  rm -f $(objtree)/kernel.spec
 
+# binrpm-pkg
+.PHONY: binrpm-pkg
+$(objtree)/binkernel.spec: $(MKSPEC) $(srctree)/Makefile
+	$(CONFIG_SHELL) $(MKSPEC) prebuilt > $@
+	
+binrpm-pkg: $(objtree)/binkernel.spec
+	$(MAKE)
+	set -e; \
+	$(CONFIG_SHELL) $(srctree)/scripts/mkversion > $(objtree)/.tmp_version
+	set -e; \
+	mv -f $(objtree)/.tmp_version $(objtree)/.version
+
+	$(RPM) --define "_builddir $(srctree)" --target $(UTS_MACHINE) -bb $<
+
+clean-rule += rm -f $(objtree)/binkernel.spec
+
 # Deb target
 # ---------------------------------------------------------------------------
 #
@@ -67,5 +84,6 @@ clean-rule += && rm -rf $(objtree)/debian/
 # ---------------------------------------------------------------------------
 help:
 	@echo  '  rpm-pkg         - Build the kernel as an RPM package'
+	@echo  '  binrpm-pkg      - Build an rpm package containing the compiled kernel & modules'
 	@echo  '  deb-pkg         - Build the kernel as an deb package'
 
diff --git a/scripts/package/mkspec b/scripts/package/mkspec
index 3ecfc23e0..5d94e452a 100644
--- a/scripts/package/mkspec
+++ b/scripts/package/mkspec
@@ -9,6 +9,13 @@
 #	Patched for non-x86 by Opencon (L) 2002 <opencon@rio.skydome.net>
 #
 
+# how we were called determines which rpms we build and how we build them
+if [ "$1" = "prebuilt" ]; then
+	PREBUILT=true
+else
+	PREBUILT=false
+fi
+
 # starting to output the spec
 if [ "`grep CONFIG_DRM=y .config | cut -f2 -d\=`" = "y" ]; then
 	PROVIDES=kernel-drm
@@ -26,8 +33,12 @@ echo "License: GPL"
 echo "Group: System Environment/Kernel"
 echo "Vendor: The Linux Community"
 echo "URL: http://www.kernel.org"
+
+if ! $PREBUILT; then
 echo -n "Source: kernel-$VERSION.$PATCHLEVEL.$SUBLEVEL"
 echo "$EXTRAVERSION.tar.gz" | sed -e "s/-//g"
+fi
+
 echo "BuildRoot: /var/tmp/%{name}-%{PACKAGE_VERSION}-root"
 echo "Provides: $PROVIDES"
 echo "%define __spec_install_post /usr/lib/rpm/brp-compress || :"
@@ -36,12 +47,20 @@ echo ""
 echo "%description"
 echo "The Linux Kernel, the operating system core itself"
 echo ""
+
+if ! $PREBUILT; then
 echo "%prep"
 echo "%setup -q"
 echo ""
+fi
+
 echo "%build"
+
+if ! $PREBUILT; then
 echo "make clean && make"
 echo ""
+fi
+
 echo "%install"
 echo 'mkdir -p $RPM_BUILD_ROOT/boot $RPM_BUILD_ROOT/lib $RPM_BUILD_ROOT/lib/modules'
 
diff --git a/security/dummy.c b/security/dummy.c
index 3e768e050..05d988588 100644
--- a/security/dummy.c
+++ b/security/dummy.c
@@ -720,7 +720,7 @@ static int dummy_sem_semop (struct sem_array *sma,
 	return 0;
 }
 
-static int dummy_netlink_send (struct sk_buff *skb)
+static int dummy_netlink_send (struct sock *sk, struct sk_buff *skb)
 {
 	if (current->euid == 0)
 		cap_raise (NETLINK_CB (skb).eff_cap, CAP_NET_ADMIN);
diff --git a/security/root_plug.c b/security/root_plug.c
index ec8955dcb..07651def2 100644
--- a/security/root_plug.c
+++ b/security/root_plug.c
@@ -36,16 +36,16 @@ static int secondary;
 static int vendor_id = 0x0557;
 static int product_id = 0x2008;
 
-MODULE_PARM(vendor_id, "h");
+module_param(vendor_id, uint, 0400);
 MODULE_PARM_DESC(vendor_id, "USB Vendor ID of device to look for");
 
-MODULE_PARM(product_id, "h");
+module_param(product_id, uint, 0400);
 MODULE_PARM_DESC(product_id, "USB Product ID of device to look for");
 
 /* should we print out debug messages */
 static int debug = 0;
 
-MODULE_PARM(debug, "i");
+module_param(debug, bool, 0600);
 MODULE_PARM_DESC(debug, "Debug enabled or not");
 
 #if defined(CONFIG_SECURITY_ROOTPLUG_MODULE)
diff --git a/security/selinux/Makefile b/security/selinux/Makefile
index 890404ed2..b038cd0fa 100644
--- a/security/selinux/Makefile
+++ b/security/selinux/Makefile
@@ -4,7 +4,7 @@
 
 obj-$(CONFIG_SECURITY_SELINUX) := selinux.o ss/
 
-selinux-y := avc.o hooks.o selinuxfs.o netlink.o
+selinux-y := avc.o hooks.o selinuxfs.o netlink.o nlmsgtab.o
 
 selinux-$(CONFIG_SECURITY_NETWORK) += netif.o
 
diff --git a/security/selinux/avc.c b/security/selinux/avc.c
index ee5a4fb17..7afe09eed 100644
--- a/security/selinux/avc.c
+++ b/security/selinux/avc.c
@@ -71,16 +71,34 @@ struct avc_callback_node {
 };
 
 static spinlock_t avc_lock = SPIN_LOCK_UNLOCKED;
-static struct avc_node *avc_node_freelist = NULL;
+static struct avc_node *avc_node_freelist;
 static struct avc_cache avc_cache;
 static unsigned avc_cache_stats[AVC_NSTATS];
-static struct avc_callback_node *avc_callbacks = NULL;
+static struct avc_callback_node *avc_callbacks;
 
 static inline int avc_hash(u32 ssid, u32 tsid, u16 tclass)
 {
 	return (ssid ^ (tsid<<2) ^ (tclass<<4)) & (AVC_CACHE_SLOTS - 1);
 }
 
+#ifdef AVC_CACHE_STATS
+static inline void avc_cache_stats_incr(int type)
+{
+	avc_cache_stats[type]++;
+}
+
+static inline void avc_cache_stats_add(int type, unsigned val)
+{
+	avc_cache_stats[type] += val;
+}
+#else
+static inline void avc_cache_stats_incr(int type)
+{ }
+
+static inline void avc_cache_stats_add(int type, unsigned val)
+{ }
+#endif
+
 /**
  * avc_dump_av - Display an access vector in human-readable form.
  * @tclass: target security class
@@ -88,7 +106,7 @@ static inline int avc_hash(u32 ssid, u32 tsid, u16 tclass)
  */
 void avc_dump_av(struct audit_buffer *ab, u16 tclass, u32 av)
 {
-	char **common_pts = 0;
+	char **common_pts = NULL;
 	u32 common_base = 0;
 	int i, i2, perm;
 
@@ -173,15 +191,6 @@ void __init avc_init(void)
 	struct avc_node	*new;
 	int i;
 
-	for (i = 0; i < AVC_NSTATS; i++)
-		avc_cache_stats[i] = 0;
-
-	for (i = 0; i < AVC_CACHE_SLOTS; i++)
-		avc_cache.slots[i] = 0;
-	avc_cache.lru_hint = 0;
-	avc_cache.active_nodes = 0;
-	avc_cache.latest_notif = 0;
-
 	for (i = 0; i < AVC_CACHE_MAXNODES; i++) {
 		new = kmalloc(sizeof(*new), GFP_ATOMIC);
 		if (!new) {
@@ -725,7 +734,7 @@ static int avc_update_cache(u32 event, u32 ssid, u32 tsid,
 		}
 	} else {
 		/* apply to one node */
-		node = avc_search_node(ssid, tsid, tclass, 0);
+		node = avc_search_node(ssid, tsid, tclass, NULL);
 		if (node) {
 			avc_update_node(event,node,perms);
 		}
@@ -799,7 +808,7 @@ int avc_ss_grant(u32 ssid, u32 tsid, u16 tclass,
                  u32 perms, u32 seqno)
 {
 	return avc_control(AVC_CALLBACK_GRANT,
-			   ssid, tsid, tclass, perms, seqno, 0);
+			   ssid, tsid, tclass, perms, seqno, NULL);
 }
 
 /**
@@ -837,7 +846,7 @@ int avc_ss_revoke(u32 ssid, u32 tsid, u16 tclass,
                   u32 perms, u32 seqno)
 {
 	return avc_control(AVC_CALLBACK_REVOKE,
-			   ssid, tsid, tclass, perms, seqno, 0);
+			   ssid, tsid, tclass, perms, seqno, NULL);
 }
 
 /**
@@ -869,7 +878,7 @@ int avc_ss_reset(u32 seqno)
 			avc_node_freelist = tmp;
 			avc_cache.active_nodes--;
 		}
-		avc_cache.slots[i] = 0;
+		avc_cache.slots[i] = NULL;
 	}
 	avc_cache.lru_hint = 0;
 
@@ -881,7 +890,7 @@ int avc_ss_reset(u32 seqno)
 	for (c = avc_callbacks; c; c = c->next) {
 		if (c->events & AVC_CALLBACK_RESET) {
 			rc = c->callback(AVC_CALLBACK_RESET,
-					 0, 0, 0, 0, 0);
+					 0, 0, 0, 0, NULL);
 			if (rc)
 				goto out;
 		}
@@ -909,10 +918,10 @@ int avc_ss_set_auditallow(u32 ssid, u32 tsid, u16 tclass,
 {
 	if (enable)
 		return avc_control(AVC_CALLBACK_AUDITALLOW_ENABLE,
-				   ssid, tsid, tclass, perms, seqno, 0);
+				   ssid, tsid, tclass, perms, seqno, NULL);
 	else
 		return avc_control(AVC_CALLBACK_AUDITALLOW_DISABLE,
-				   ssid, tsid, tclass, perms, seqno, 0);
+				   ssid, tsid, tclass, perms, seqno, NULL);
 }
 
 /**
@@ -929,10 +938,10 @@ int avc_ss_set_auditdeny(u32 ssid, u32 tsid, u16 tclass,
 {
 	if (enable)
 		return avc_control(AVC_CALLBACK_AUDITDENY_ENABLE,
-				   ssid, tsid, tclass, perms, seqno, 0);
+				   ssid, tsid, tclass, perms, seqno, NULL);
 	else
 		return avc_control(AVC_CALLBACK_AUDITDENY_DISABLE,
-				   ssid, tsid, tclass, perms, seqno, 0);
+				   ssid, tsid, tclass, perms, seqno, NULL);
 }
 
 /**
@@ -984,7 +993,7 @@ int avc_has_perm_noaudit(u32 ssid, u32 tsid,
 			ae->used = 1;
 		} else {
 			avc_cache_stats_incr(AVC_ENTRY_DISCARDS);
-			ae = 0;
+			ae = NULL;
 		}
 	}
 
diff --git a/security/selinux/hooks.c b/security/selinux/hooks.c
index c447232c6..52fa3cfdf 100644
--- a/security/selinux/hooks.c
+++ b/security/selinux/hooks.c
@@ -63,6 +63,7 @@
 #include <net/ipv6.h>
 #include <linux/hugetlb.h>
 #include <linux/major.h>
+#include <linux/personality.h>
 
 #include "avc.h"
 #include "objsec.h"
@@ -71,6 +72,9 @@
 #define XATTR_SELINUX_SUFFIX "selinux"
 #define XATTR_NAME_SELINUX XATTR_SECURITY_PREFIX XATTR_SELINUX_SUFFIX
 
+extern int policydb_loaded_version;
+extern int selinux_nlmsg_lookup(u16 sclass, u16 nlmsg_type, u32 *perm);
+
 #ifdef CONFIG_SECURITY_SELINUX_DEVELOP
 int selinux_enforcing = 0;
 
@@ -627,7 +631,7 @@ static inline u16 inode_mode_to_security_class(umode_t mode)
 	return SECCLASS_FILE;
 }
 
-static inline u16 socket_type_to_security_class(int family, int type)
+static inline u16 socket_type_to_security_class(int family, int type, int protocol)
 {
 	switch (family) {
 	case PF_UNIX:
@@ -648,7 +652,28 @@ static inline u16 socket_type_to_security_class(int family, int type)
 			return SECCLASS_RAWIP_SOCKET;
 		}
 	case PF_NETLINK:
-		return SECCLASS_NETLINK_SOCKET;
+		switch (protocol) {
+		case NETLINK_ROUTE:
+			return SECCLASS_NETLINK_ROUTE_SOCKET;
+		case NETLINK_FIREWALL:
+			return SECCLASS_NETLINK_FIREWALL_SOCKET;
+		case NETLINK_TCPDIAG:
+			return SECCLASS_NETLINK_TCPDIAG_SOCKET;
+		case NETLINK_NFLOG:
+			return SECCLASS_NETLINK_NFLOG_SOCKET;
+		case NETLINK_XFRM:
+			return SECCLASS_NETLINK_XFRM_SOCKET;
+		case NETLINK_SELINUX:
+			return SECCLASS_NETLINK_SELINUX_SOCKET;
+		case NETLINK_AUDIT:
+			return SECCLASS_NETLINK_AUDIT_SOCKET;
+		case NETLINK_IP6_FW:
+			return SECCLASS_NETLINK_IP6FW_SOCKET;
+		case NETLINK_DNRTMSG:
+			return SECCLASS_NETLINK_DNRT_SOCKET;
+		default:
+			return SECCLASS_NETLINK_SOCKET;
+		}
 	case PF_PACKET:
 		return SECCLASS_PACKET_SOCKET;
 	case PF_KEY:
@@ -853,7 +878,8 @@ out:
 		struct socket *sock = SOCKET_I(inode);
 		if (sock->sk) {
 			isec->sclass = socket_type_to_security_class(sock->sk->sk_family,
-			                                             sock->sk->sk_type);
+			                                             sock->sk->sk_type,
+			                                             sock->sk->sk_protocol);
 		} else {
 			isec->sclass = SECCLASS_SOCKET;
 		}
@@ -1364,11 +1390,11 @@ static int selinux_capset_check(struct task_struct *target, kernel_cap_t *effect
 {
 	int error;
 
-	error = task_has_perm(current, target, PROCESS__SETCAP);
+	error = secondary_ops->capset_check(target, effective, inheritable, permitted);
 	if (error)
 		return error;
 
-	return secondary_ops->capset_check(target, effective, inheritable, permitted);
+	return task_has_perm(current, target, PROCESS__SETCAP);
 }
 
 static void selinux_capset_set(struct task_struct *target, kernel_cap_t *effective,
@@ -1402,6 +1428,10 @@ static int selinux_sysctl(ctl_table *table, int op)
 	u32 tsid;
 	int rc;
 
+	rc = secondary_ops->sysctl(table, op);
+	if (rc)
+		return rc;
+
 	tsec = current->security;
 
 	rc = selinux_proc_get_sid(table->de, (op == 001) ?
@@ -1567,22 +1597,6 @@ static int selinux_vm_enough_memory(long pages)
 	return -ENOMEM;
 }
 
-static int selinux_netlink_send(struct sk_buff *skb)
-{
-	if (capable(CAP_NET_ADMIN))
-		cap_raise (NETLINK_CB (skb).eff_cap, CAP_NET_ADMIN);
-	else
-		NETLINK_CB(skb).eff_cap = 0;
-	return 0;
-}
-
-static int selinux_netlink_recv(struct sk_buff *skb)
-{
-	if (!cap_raised(NETLINK_CB(skb).eff_cap, CAP_NET_ADMIN))
-		return -EPERM;
-	return 0;
-}
-
 /* binprm security operations */
 
 static int selinux_bprm_alloc_security(struct linux_binprm *bprm)
@@ -1671,6 +1685,9 @@ static int selinux_bprm_set_security(struct linux_binprm *bprm)
 		if (rc)
 			return rc;
 
+		/* Clear any possibly unsafe personality bits on exec: */
+		current->personality &= ~PER_CLEAR_ON_SETID;
+
 		/* Set the security field to the new SID. */
 		bsec->sid = newsid;
 	}
@@ -1681,7 +1698,7 @@ static int selinux_bprm_set_security(struct linux_binprm *bprm)
 
 static int selinux_bprm_check_security (struct linux_binprm *bprm)
 {
-	return 0;
+	return secondary_ops->bprm_check_security(bprm);
 }
 
 
@@ -1699,12 +1716,7 @@ static int selinux_bprm_secureexec (struct linux_binprm *bprm)
 					 PROCESS__NOATSECURE, NULL, NULL);
 	}
 
-	/* Note that we must include the legacy uid/gid test below
-	   to retain it, as the new userland will simply use the
-	   value passed by AT_SECURE to decide whether to enable
-	   secure mode. */
-	return ( atsecure || current->euid != current->uid ||
-		current->egid != current->gid);
+	return (atsecure || secondary_ops->bprm_secureexec(bprm));
 }
 
 static void selinux_bprm_free_security(struct linux_binprm *bprm)
@@ -1784,7 +1796,8 @@ static inline void flush_unauthorized_files(struct files_struct * files)
 
 	spin_lock(&files->file_lock);
 	for (;;) {
-		unsigned long set, i, fd;
+		unsigned long set, i;
+		int fd;
 
 		j++;
 		i = j * __NFDBITS;
@@ -2049,6 +2062,12 @@ static int selinux_mount(char * dev_name,
                          unsigned long flags,
                          void * data)
 {
+	int rc;
+
+	rc = secondary_ops->sb_mount(dev_name, nd, type, flags, data);
+	if (rc)
+		return rc;
+
 	if (flags & MS_REMOUNT)
 		return superblock_has_perm(current, nd->mnt->mnt_sb,
 		                           FILESYSTEM__REMOUNT, NULL);
@@ -2059,6 +2078,12 @@ static int selinux_mount(char * dev_name,
 
 static int selinux_umount(struct vfsmount *mnt, int flags)
 {
+	int rc;
+
+	rc = secondary_ops->sb_umount(mnt, flags);
+	if (rc)
+		return rc;
+
 	return superblock_has_perm(current,mnt->mnt_sb,
 	                           FILESYSTEM__UNMOUNT,NULL);
 }
@@ -2102,6 +2127,11 @@ static void selinux_inode_post_link(struct dentry *old_dentry, struct inode *ino
 
 static int selinux_inode_unlink(struct inode *dir, struct dentry *dentry)
 {
+	int rc;
+
+	rc = secondary_ops->inode_unlink(dir, dentry);
+	if (rc)
+		return rc;
 	return may_link(dir, dentry, MAY_UNLINK);
 }
 
@@ -2132,6 +2162,12 @@ static int selinux_inode_rmdir(struct inode *dir, struct dentry *dentry)
 
 static int selinux_inode_mknod(struct inode *dir, struct dentry *dentry, int mode, dev_t dev)
 {
+	int rc;
+
+	rc = secondary_ops->inode_mknod(dir, dentry, mode, dev);
+	if (rc)
+		return rc;
+
 	return may_create(dir, dentry, inode_mode_to_security_class(mode));
 }
 
@@ -2170,6 +2206,12 @@ static int selinux_inode_follow_link(struct dentry *dentry, struct nameidata *na
 static int selinux_inode_permission(struct inode *inode, int mask,
 				    struct nameidata *nd)
 {
+	int rc;
+
+	rc = secondary_ops->inode_permission(inode, mask, nd);
+	if (rc)
+		return rc;
+
 	if (!mask) {
 		/* No permission to check.  Existence test. */
 		return 0;
@@ -2181,6 +2223,12 @@ static int selinux_inode_permission(struct inode *inode, int mask,
 
 static int selinux_inode_setattr(struct dentry *dentry, struct iattr *iattr)
 {
+	int rc;
+
+	rc = secondary_ops->inode_setattr(dentry, iattr);
+	if (rc)
+		return rc;
+
 	if (iattr->ia_valid & (ATTR_MODE | ATTR_UID | ATTR_GID |
 			       ATTR_ATIME_SET | ATTR_MTIME_SET))
 		return dentry_has_perm(current, NULL, dentry, FILE__SETATTR);
@@ -2447,6 +2495,11 @@ static int selinux_file_ioctl(struct file *file, unsigned int cmd,
 static int selinux_file_mmap(struct file *file, unsigned long prot, unsigned long flags)
 {
 	u32 av;
+	int rc;
+
+	rc = secondary_ops->file_mmap(file, prot, flags);
+	if (rc)
+		return rc;
 
 	if (file) {
 		/* read access is always possible with a mapping */
@@ -2467,6 +2520,12 @@ static int selinux_file_mmap(struct file *file, unsigned long prot, unsigned lon
 static int selinux_file_mprotect(struct vm_area_struct *vma,
 				 unsigned long prot)
 {
+	int rc;
+
+	rc = secondary_ops->file_mprotect(vma, prot);
+	if (rc)
+		return rc;
+
 	return selinux_file_mmap(vma->vm_file, prot, vma->vm_flags);
 }
 
@@ -2564,6 +2623,12 @@ static int selinux_file_receive(struct file *file)
 
 static int selinux_task_create(unsigned long clone_flags)
 {
+	int rc;
+
+	rc = secondary_ops->task_create(clone_flags);
+	if (rc)
+		return rc;
+
 	return task_has_perm(current, current, PROCESS__FORK);
 }
 
@@ -2639,12 +2704,23 @@ static int selinux_task_setgroups(struct group_info *group_info)
 
 static int selinux_task_setnice(struct task_struct *p, int nice)
 {
+	int rc;
+
+	rc = secondary_ops->task_setnice(p, nice);
+	if (rc)
+		return rc;
+
 	return task_has_perm(current,p, PROCESS__SETSCHED);
 }
 
 static int selinux_task_setrlimit(unsigned int resource, struct rlimit *new_rlim)
 {
 	struct rlimit *old_rlim = current->rlim + resource;
+	int rc;
+
+	rc = secondary_ops->task_setrlimit(resource, new_rlim);
+	if (rc)
+		return rc;
 
 	/* Control the ability to change the hard limit (whether
 	   lowering or raising it), so that the hard limit can
@@ -2679,6 +2755,11 @@ static int selinux_task_getscheduler(struct task_struct *p)
 static int selinux_task_kill(struct task_struct *p, struct siginfo *info, int sig)
 {
 	u32 perm;
+	int rc;
+
+	rc = secondary_ops->task_kill(p, info, sig);
+	if (rc)
+		return rc;
 
 	if (info && ((unsigned long)info == 1 ||
 	             (unsigned long)info == 2 || SI_FROMKERNEL(info)))
@@ -2918,8 +2999,8 @@ static int selinux_socket_create(int family, int type,
 
 	tsec = current->security;
 	err = avc_has_perm(tsec->sid, tsec->sid,
-			   socket_type_to_security_class(family, type),
-			   SOCKET__CREATE, NULL, NULL);
+			   socket_type_to_security_class(family, type,
+			   protocol), SOCKET__CREATE, NULL, NULL);
 
 out:
 	return err;
@@ -2938,7 +3019,7 @@ static void selinux_socket_post_create(struct socket *sock, int family,
 	isec = SOCK_INODE(sock)->i_security;
 
 	tsec = current->security;
-	isec->sclass = socket_type_to_security_class(family, type);
+	isec->sclass = socket_type_to_security_class(family, type, protocol);
 	isec->sid = kern ? SECINITSID_KERNEL : tsec->sid;
 
 	return;
@@ -3120,6 +3201,10 @@ static int selinux_socket_unix_stream_connect(struct socket *sock,
 	struct avc_audit_data ad;
 	int err;
 
+	err = secondary_ops->unix_stream_connect(sock, other, newsk);
+	if (err)
+		return err;
+
 	isec = SOCK_INODE(sock)->i_security;
 	other_isec = SOCK_INODE(other)->i_security;
 
@@ -3174,12 +3259,12 @@ static int selinux_socket_sock_rcv_skb(struct sock *sk, struct sk_buff *skb)
 	char *addrp;
 	int len, err = 0;
 	u32 netif_perm, node_perm, node_sid, recv_perm = 0;
+	u32 sock_sid = 0;
+	u16 sock_class = 0;
 	struct socket *sock;
-	struct inode *inode;
 	struct net_device *dev;
 	struct sel_netif *netif;
 	struct netif_security_struct *nsec;
-	struct inode_security_struct *isec;
 	struct avc_audit_data ad;
 
 	family = sk->sk_family;
@@ -3190,15 +3275,21 @@ static int selinux_socket_sock_rcv_skb(struct sock *sk, struct sk_buff *skb)
 	if (family == PF_INET6 && skb->protocol == ntohs(ETH_P_IP))
 		family = PF_INET;
 
-	sock = sk->sk_socket;
-	
-	/* TCP control messages don't always have a socket. */
-	if (!sock)
-		goto out;
-
-	inode = SOCK_INODE(sock);
-	if (!inode)
-		goto out;
+ 	read_lock_bh(&sk->sk_callback_lock);
+ 	sock = sk->sk_socket;
+ 	if (sock) {
+ 		struct inode *inode;
+ 		inode = SOCK_INODE(sock);
+ 		if (inode) {
+ 			struct inode_security_struct *isec;
+ 			isec = inode->i_security;
+ 			sock_sid = isec->sid;
+ 			sock_class = isec->sclass;
+ 		}
+ 	}
+ 	read_unlock_bh(&sk->sk_callback_lock);
+ 	if (!sock_sid)
+  		goto out;
 
 	dev = skb->dev;
 	if (!dev)
@@ -3211,9 +3302,8 @@ static int selinux_socket_sock_rcv_skb(struct sock *sk, struct sk_buff *skb)
 	}
 	
 	nsec = &netif->nsec;
-	isec = inode->i_security;
 
-	switch (isec->sclass) {
+	switch (sock_class) {
 	case SECCLASS_UDP_SOCKET:
 		netif_perm = NETIF__UDP_RECV;
 		node_perm = NODE__UDP_RECV;
@@ -3242,7 +3332,7 @@ static int selinux_socket_sock_rcv_skb(struct sock *sk, struct sk_buff *skb)
 		goto out;
 	}
 
-	err = avc_has_perm(isec->sid, nsec->if_sid, SECCLASS_NETIF,
+	err = avc_has_perm(sock_sid, nsec->if_sid, SECCLASS_NETIF,
 	                   netif_perm, &nsec->avcr, &ad);
 	sel_netif_put(netif);
 	if (err)
@@ -3253,7 +3343,7 @@ static int selinux_socket_sock_rcv_skb(struct sock *sk, struct sk_buff *skb)
 	if (err)
 		goto out;
 	
-	err = avc_has_perm(isec->sid, node_sid, SECCLASS_NODE, node_perm, NULL, &ad);
+	err = avc_has_perm(sock_sid, node_sid, SECCLASS_NODE, node_perm, NULL, &ad);
 	if (err)
 		goto out;
 
@@ -3267,7 +3357,7 @@ static int selinux_socket_sock_rcv_skb(struct sock *sk, struct sk_buff *skb)
 		if (err)
 			goto out;
 
-		err = avc_has_perm(isec->sid, port_sid, isec->sclass,
+		err = avc_has_perm(sock_sid, port_sid, sock_class,
 		                   recv_perm, NULL, &ad);
 	}
 out:	
@@ -3322,6 +3412,33 @@ static void selinux_sk_free_security(struct sock *sk)
 	sk_free_security(sk);
 }
 
+static int selinux_nlmsg_perm(struct sock *sk, struct sk_buff *skb)
+{
+	int err = 0;
+	u32 perm;
+	struct nlmsghdr *nlh;
+	struct socket *sock = sk->sk_socket;
+	struct inode_security_struct *isec = SOCK_INODE(sock)->i_security;
+	
+	if (skb->len < NLMSG_SPACE(0)) {
+		err = -EINVAL;
+		goto out;
+	}
+	nlh = (struct nlmsghdr *)skb->data;
+	
+	err = selinux_nlmsg_lookup(isec->sclass, nlh->nlmsg_type, &perm);
+	if (err) {
+		/* Ignore */
+		if (err == -ENOENT)
+			err = 0;
+		goto out;
+	}
+
+	err = socket_has_perm(current, sock, perm);
+out:
+	return err;
+}
+
 #ifdef CONFIG_NETFILTER
 
 static unsigned int selinux_ip_postroute_last(unsigned int hooknum,
@@ -3457,8 +3574,37 @@ static unsigned int selinux_ipv6_postroute_last(unsigned int hooknum,
 
 #endif	/* CONFIG_NETFILTER */
 
+#else
+
+static inline int selinux_nlmsg_perm(struct sock *sk, struct sk_buff *skb)
+{
+	return 0;
+}
+
 #endif	/* CONFIG_SECURITY_NETWORK */
 
+static int selinux_netlink_send(struct sock *sk, struct sk_buff *skb)
+{
+	int err = 0;
+
+	if (capable(CAP_NET_ADMIN))
+		cap_raise (NETLINK_CB (skb).eff_cap, CAP_NET_ADMIN);
+	else
+		NETLINK_CB(skb).eff_cap = 0;
+
+	if (policydb_loaded_version >= POLICYDB_VERSION_NLCLASS)
+		err = selinux_nlmsg_perm(sk, skb);
+
+	return err;
+}
+
+static int selinux_netlink_recv(struct sk_buff *skb)
+{
+	if (!cap_raised(NETLINK_CB(skb).eff_cap, CAP_NET_ADMIN))
+		return -EPERM;
+	return 0;
+}
+
 static int ipc_alloc_security(struct task_struct *task,
 			      struct kern_ipc_perm *perm,
 			      u16 sclass)
@@ -3784,6 +3930,11 @@ static int selinux_shm_shmat(struct shmid_kernel *shp,
 			     char __user *shmaddr, int shmflg)
 {
 	u32 perms;
+	int rc;
+
+	rc = secondary_ops->shm_shmat(shp, shmaddr, shmflg);
+	if (rc)
+		return rc;
 
 	if (shmflg & SHM_RDONLY)
 		perms = SHM__READ;
diff --git a/security/selinux/include/av_inherit.h b/security/selinux/include/av_inherit.h
index eb3f4e141..c05e2ee6f 100644
--- a/security/selinux/include/av_inherit.h
+++ b/security/selinux/include/av_inherit.h
@@ -29,6 +29,15 @@ static struct av_inherit av_inherit[] = {
    { SECCLASS_SEM, common_ipc_perm_to_string, 0x00000200UL },
    { SECCLASS_MSGQ, common_ipc_perm_to_string, 0x00000200UL },
    { SECCLASS_SHM, common_ipc_perm_to_string, 0x00000200UL },
+   { SECCLASS_NETLINK_ROUTE_SOCKET, common_socket_perm_to_string, 0x00400000UL },
+   { SECCLASS_NETLINK_FIREWALL_SOCKET, common_socket_perm_to_string, 0x00400000UL },
+   { SECCLASS_NETLINK_TCPDIAG_SOCKET, common_socket_perm_to_string, 0x00400000UL },
+   { SECCLASS_NETLINK_NFLOG_SOCKET, common_socket_perm_to_string, 0x00400000UL },
+   { SECCLASS_NETLINK_XFRM_SOCKET, common_socket_perm_to_string, 0x00400000UL },
+   { SECCLASS_NETLINK_SELINUX_SOCKET, common_socket_perm_to_string, 0x00400000UL },
+   { SECCLASS_NETLINK_AUDIT_SOCKET, common_socket_perm_to_string, 0x00400000UL },
+   { SECCLASS_NETLINK_IP6FW_SOCKET, common_socket_perm_to_string, 0x00400000UL },
+   { SECCLASS_NETLINK_DNRT_SOCKET, common_socket_perm_to_string, 0x00400000UL },
 };
 
 
diff --git a/security/selinux/include/av_perm_to_string.h b/security/selinux/include/av_perm_to_string.h
index 6891745ec..e8e2a41cf 100644
--- a/security/selinux/include/av_perm_to_string.h
+++ b/security/selinux/include/av_perm_to_string.h
@@ -30,6 +30,9 @@ static struct av_perm_to_string av_perm_to_string[] = {
    { SECCLASS_TCP_SOCKET, TCP_SOCKET__CONNECTTO, "connectto" },
    { SECCLASS_TCP_SOCKET, TCP_SOCKET__NEWCONN, "newconn" },
    { SECCLASS_TCP_SOCKET, TCP_SOCKET__ACCEPTFROM, "acceptfrom" },
+   { SECCLASS_TCP_SOCKET, TCP_SOCKET__NODE_BIND, "node_bind" },
+   { SECCLASS_UDP_SOCKET, UDP_SOCKET__NODE_BIND, "node_bind" },
+   { SECCLASS_RAWIP_SOCKET, RAWIP_SOCKET__NODE_BIND, "node_bind" },
    { SECCLASS_NODE, NODE__TCP_RECV, "tcp_recv" },
    { SECCLASS_NODE, NODE__TCP_SEND, "tcp_send" },
    { SECCLASS_NODE, NODE__UDP_RECV, "udp_recv" },
@@ -46,9 +49,6 @@ static struct av_perm_to_string av_perm_to_string[] = {
    { SECCLASS_UNIX_STREAM_SOCKET, UNIX_STREAM_SOCKET__CONNECTTO, "connectto" },
    { SECCLASS_UNIX_STREAM_SOCKET, UNIX_STREAM_SOCKET__NEWCONN, "newconn" },
    { SECCLASS_UNIX_STREAM_SOCKET, UNIX_STREAM_SOCKET__ACCEPTFROM, "acceptfrom" },
-   { SECCLASS_TCP_SOCKET, TCP_SOCKET__NODE_BIND, "node_bind" },
-   { SECCLASS_UDP_SOCKET, UDP_SOCKET__NODE_BIND, "node_bind" },
-   { SECCLASS_RAWIP_SOCKET, RAWIP_SOCKET__NODE_BIND, "node_bind" },
    { SECCLASS_PROCESS, PROCESS__FORK, "fork" },
    { SECCLASS_PROCESS, PROCESS__TRANSITION, "transition" },
    { SECCLASS_PROCESS, PROCESS__SIGCHLD, "sigchld" },
@@ -121,6 +121,104 @@ static struct av_perm_to_string av_perm_to_string[] = {
    { SECCLASS_PASSWD, PASSWD__PASSWD, "passwd" },
    { SECCLASS_PASSWD, PASSWD__CHFN, "chfn" },
    { SECCLASS_PASSWD, PASSWD__CHSH, "chsh" },
+   { SECCLASS_PASSWD, PASSWD__ROOTOK, "rootok" },
+   { SECCLASS_DRAWABLE, DRAWABLE__CREATE, "create" },
+   { SECCLASS_DRAWABLE, DRAWABLE__DESTROY, "destroy" },
+   { SECCLASS_DRAWABLE, DRAWABLE__DRAW, "draw" },
+   { SECCLASS_DRAWABLE, DRAWABLE__COPY, "copy" },
+   { SECCLASS_DRAWABLE, DRAWABLE__GETATTR, "getattr" },
+   { SECCLASS_GC, GC__CREATE, "create" },
+   { SECCLASS_GC, GC__FREE, "free" },
+   { SECCLASS_GC, GC__GETATTR, "getattr" },
+   { SECCLASS_GC, GC__SETATTR, "setattr" },
+   { SECCLASS_WINDOW, WINDOW__ADDCHILD, "addchild" },
+   { SECCLASS_WINDOW, WINDOW__CREATE, "create" },
+   { SECCLASS_WINDOW, WINDOW__DESTROY, "destroy" },
+   { SECCLASS_WINDOW, WINDOW__MAP, "map" },
+   { SECCLASS_WINDOW, WINDOW__UNMAP, "unmap" },
+   { SECCLASS_WINDOW, WINDOW__CHSTACK, "chstack" },
+   { SECCLASS_WINDOW, WINDOW__CHPROPLIST, "chproplist" },
+   { SECCLASS_WINDOW, WINDOW__CHPROP, "chprop" },
+   { SECCLASS_WINDOW, WINDOW__LISTPROP, "listprop" },
+   { SECCLASS_WINDOW, WINDOW__GETATTR, "getattr" },
+   { SECCLASS_WINDOW, WINDOW__SETATTR, "setattr" },
+   { SECCLASS_WINDOW, WINDOW__SETFOCUS, "setfocus" },
+   { SECCLASS_WINDOW, WINDOW__MOVE, "move" },
+   { SECCLASS_WINDOW, WINDOW__CHSELECTION, "chselection" },
+   { SECCLASS_WINDOW, WINDOW__CHPARENT, "chparent" },
+   { SECCLASS_WINDOW, WINDOW__CTRLLIFE, "ctrllife" },
+   { SECCLASS_WINDOW, WINDOW__ENUMERATE, "enumerate" },
+   { SECCLASS_WINDOW, WINDOW__TRANSPARENT, "transparent" },
+   { SECCLASS_WINDOW, WINDOW__MOUSEMOTION, "mousemotion" },
+   { SECCLASS_WINDOW, WINDOW__CLIENTCOMEVENT, "clientcomevent" },
+   { SECCLASS_WINDOW, WINDOW__INPUTEVENT, "inputevent" },
+   { SECCLASS_WINDOW, WINDOW__DRAWEVENT, "drawevent" },
+   { SECCLASS_WINDOW, WINDOW__WINDOWCHANGEEVENT, "windowchangeevent" },
+   { SECCLASS_WINDOW, WINDOW__WINDOWCHANGEREQUEST, "windowchangerequest" },
+   { SECCLASS_WINDOW, WINDOW__SERVERCHANGEEVENT, "serverchangeevent" },
+   { SECCLASS_WINDOW, WINDOW__EXTENSIONEVENT, "extensionevent" },
+   { SECCLASS_FONT, FONT__LOAD, "load" },
+   { SECCLASS_FONT, FONT__FREE, "free" },
+   { SECCLASS_FONT, FONT__GETATTR, "getattr" },
+   { SECCLASS_FONT, FONT__USE, "use" },
+   { SECCLASS_COLORMAP, COLORMAP__CREATE, "create" },
+   { SECCLASS_COLORMAP, COLORMAP__FREE, "free" },
+   { SECCLASS_COLORMAP, COLORMAP__INSTALL, "install" },
+   { SECCLASS_COLORMAP, COLORMAP__UNINSTALL, "uninstall" },
+   { SECCLASS_COLORMAP, COLORMAP__LIST, "list" },
+   { SECCLASS_COLORMAP, COLORMAP__READ, "read" },
+   { SECCLASS_COLORMAP, COLORMAP__STORE, "store" },
+   { SECCLASS_COLORMAP, COLORMAP__GETATTR, "getattr" },
+   { SECCLASS_COLORMAP, COLORMAP__SETATTR, "setattr" },
+   { SECCLASS_PROPERTY, PROPERTY__CREATE, "create" },
+   { SECCLASS_PROPERTY, PROPERTY__FREE, "free" },
+   { SECCLASS_PROPERTY, PROPERTY__READ, "read" },
+   { SECCLASS_PROPERTY, PROPERTY__WRITE, "write" },
+   { SECCLASS_CURSOR, CURSOR__CREATE, "create" },
+   { SECCLASS_CURSOR, CURSOR__CREATEGLYPH, "createglyph" },
+   { SECCLASS_CURSOR, CURSOR__FREE, "free" },
+   { SECCLASS_CURSOR, CURSOR__ASSIGN, "assign" },
+   { SECCLASS_CURSOR, CURSOR__SETATTR, "setattr" },
+   { SECCLASS_XCLIENT, XCLIENT__KILL, "kill" },
+   { SECCLASS_XINPUT, XINPUT__LOOKUP, "lookup" },
+   { SECCLASS_XINPUT, XINPUT__GETATTR, "getattr" },
+   { SECCLASS_XINPUT, XINPUT__SETATTR, "setattr" },
+   { SECCLASS_XINPUT, XINPUT__SETFOCUS, "setfocus" },
+   { SECCLASS_XINPUT, XINPUT__WARPPOINTER, "warppointer" },
+   { SECCLASS_XINPUT, XINPUT__ACTIVEGRAB, "activegrab" },
+   { SECCLASS_XINPUT, XINPUT__PASSIVEGRAB, "passivegrab" },
+   { SECCLASS_XINPUT, XINPUT__UNGRAB, "ungrab" },
+   { SECCLASS_XINPUT, XINPUT__BELL, "bell" },
+   { SECCLASS_XINPUT, XINPUT__MOUSEMOTION, "mousemotion" },
+   { SECCLASS_XINPUT, XINPUT__RELABELINPUT, "relabelinput" },
+   { SECCLASS_XSERVER, XSERVER__SCREENSAVER, "screensaver" },
+   { SECCLASS_XSERVER, XSERVER__GETHOSTLIST, "gethostlist" },
+   { SECCLASS_XSERVER, XSERVER__SETHOSTLIST, "sethostlist" },
+   { SECCLASS_XSERVER, XSERVER__GETFONTPATH, "getfontpath" },
+   { SECCLASS_XSERVER, XSERVER__SETFONTPATH, "setfontpath" },
+   { SECCLASS_XSERVER, XSERVER__GETATTR, "getattr" },
+   { SECCLASS_XSERVER, XSERVER__GRAB, "grab" },
+   { SECCLASS_XSERVER, XSERVER__UNGRAB, "ungrab" },
+   { SECCLASS_XEXTENSION, XEXTENSION__QUERY, "query" },
+   { SECCLASS_XEXTENSION, XEXTENSION__USE, "use" },
+   { SECCLASS_PAX, PAX__PAGEEXEC, "pageexec" },
+   { SECCLASS_PAX, PAX__EMUTRAMP, "emutramp" },
+   { SECCLASS_PAX, PAX__MPROTECT, "mprotect" },
+   { SECCLASS_PAX, PAX__RANDMMAP, "randmmap" },
+   { SECCLASS_PAX, PAX__RANDEXEC, "randexec" },
+   { SECCLASS_PAX, PAX__SEGMEXEC, "segmexec" },
+   { SECCLASS_NETLINK_ROUTE_SOCKET, NETLINK_ROUTE_SOCKET__NLMSG_READ, "nlmsg_read" },
+   { SECCLASS_NETLINK_ROUTE_SOCKET, NETLINK_ROUTE_SOCKET__NLMSG_WRITE, "nlmsg_write" },
+   { SECCLASS_NETLINK_FIREWALL_SOCKET, NETLINK_FIREWALL_SOCKET__NLMSG_READ, "nlmsg_read" },
+   { SECCLASS_NETLINK_FIREWALL_SOCKET, NETLINK_FIREWALL_SOCKET__NLMSG_WRITE, "nlmsg_write" },
+   { SECCLASS_NETLINK_TCPDIAG_SOCKET, NETLINK_TCPDIAG_SOCKET__NLMSG_READ, "nlmsg_read" },
+   { SECCLASS_NETLINK_TCPDIAG_SOCKET, NETLINK_TCPDIAG_SOCKET__NLMSG_WRITE, "nlmsg_write" },
+   { SECCLASS_NETLINK_XFRM_SOCKET, NETLINK_XFRM_SOCKET__NLMSG_READ, "nlmsg_read" },
+   { SECCLASS_NETLINK_XFRM_SOCKET, NETLINK_XFRM_SOCKET__NLMSG_WRITE, "nlmsg_write" },
+   { SECCLASS_NETLINK_AUDIT_SOCKET, NETLINK_AUDIT_SOCKET__NLMSG_READ, "nlmsg_read" },
+   { SECCLASS_NETLINK_AUDIT_SOCKET, NETLINK_AUDIT_SOCKET__NLMSG_WRITE, "nlmsg_write" },
+   { SECCLASS_NETLINK_IP6FW_SOCKET, NETLINK_IP6FW_SOCKET__NLMSG_READ, "nlmsg_read" },
+   { SECCLASS_NETLINK_IP6FW_SOCKET, NETLINK_IP6FW_SOCKET__NLMSG_WRITE, "nlmsg_write" },
 };
 
 
diff --git a/security/selinux/include/av_permissions.h b/security/selinux/include/av_permissions.h
index 4d77e0c83..0a4c6e08f 100644
--- a/security/selinux/include/av_permissions.h
+++ b/security/selinux/include/av_permissions.h
@@ -63,23 +63,23 @@
 #define FILESYSTEM__QUOTAMOD                      0x00000100UL
 #define FILESYSTEM__QUOTAGET                      0x00000200UL
 
-#define DIR__EXECUTE                              0x00002000UL
-#define DIR__UNLINK                               0x00000400UL
+#define DIR__IOCTL                                0x00000001UL
+#define DIR__READ                                 0x00000002UL
+#define DIR__WRITE                                0x00000004UL
+#define DIR__CREATE                               0x00000008UL
+#define DIR__GETATTR                              0x00000010UL
 #define DIR__SETATTR                              0x00000020UL
-#define DIR__QUOTAON                              0x00008000UL
+#define DIR__LOCK                                 0x00000040UL
 #define DIR__RELABELFROM                          0x00000080UL
-#define DIR__LINK                                 0x00000800UL
-#define DIR__WRITE                                0x00000004UL
-#define DIR__IOCTL                                0x00000001UL
 #define DIR__RELABELTO                            0x00000100UL
-#define DIR__READ                                 0x00000002UL
-#define DIR__RENAME                               0x00001000UL
 #define DIR__APPEND                               0x00000200UL
-#define DIR__LOCK                                 0x00000040UL
+#define DIR__UNLINK                               0x00000400UL
+#define DIR__LINK                                 0x00000800UL
+#define DIR__RENAME                               0x00001000UL
+#define DIR__EXECUTE                              0x00002000UL
 #define DIR__SWAPON                               0x00004000UL
-#define DIR__GETATTR                              0x00000010UL
+#define DIR__QUOTAON                              0x00008000UL
 #define DIR__MOUNTON                              0x00010000UL
-#define DIR__CREATE                               0x00000008UL
 
 #define DIR__ADD_NAME                             0x00020000UL
 #define DIR__REMOVE_NAME                          0x00040000UL
@@ -87,216 +87,218 @@
 #define DIR__SEARCH                               0x00100000UL
 #define DIR__RMDIR                                0x00200000UL
 
-#define FILE__EXECUTE                             0x00002000UL
-#define FILE__UNLINK                              0x00000400UL
+#define FILE__IOCTL                               0x00000001UL
+#define FILE__READ                                0x00000002UL
+#define FILE__WRITE                               0x00000004UL
+#define FILE__CREATE                              0x00000008UL
+#define FILE__GETATTR                             0x00000010UL
 #define FILE__SETATTR                             0x00000020UL
-#define FILE__QUOTAON                             0x00008000UL
+#define FILE__LOCK                                0x00000040UL
 #define FILE__RELABELFROM                         0x00000080UL
-#define FILE__LINK                                0x00000800UL
-#define FILE__WRITE                               0x00000004UL
-#define FILE__IOCTL                               0x00000001UL
 #define FILE__RELABELTO                           0x00000100UL
-#define FILE__READ                                0x00000002UL
-#define FILE__RENAME                              0x00001000UL
 #define FILE__APPEND                              0x00000200UL
-#define FILE__LOCK                                0x00000040UL
+#define FILE__UNLINK                              0x00000400UL
+#define FILE__LINK                                0x00000800UL
+#define FILE__RENAME                              0x00001000UL
+#define FILE__EXECUTE                             0x00002000UL
 #define FILE__SWAPON                              0x00004000UL
-#define FILE__GETATTR                             0x00000010UL
+#define FILE__QUOTAON                             0x00008000UL
 #define FILE__MOUNTON                             0x00010000UL
-#define FILE__CREATE                              0x00000008UL
 
 #define FILE__EXECUTE_NO_TRANS                    0x00020000UL
 #define FILE__ENTRYPOINT                          0x00040000UL
 
-#define LNK_FILE__EXECUTE                         0x00002000UL
-#define LNK_FILE__UNLINK                          0x00000400UL
+#define LNK_FILE__IOCTL                           0x00000001UL
+#define LNK_FILE__READ                            0x00000002UL
+#define LNK_FILE__WRITE                           0x00000004UL
+#define LNK_FILE__CREATE                          0x00000008UL
+#define LNK_FILE__GETATTR                         0x00000010UL
 #define LNK_FILE__SETATTR                         0x00000020UL
-#define LNK_FILE__QUOTAON                         0x00008000UL
+#define LNK_FILE__LOCK                            0x00000040UL
 #define LNK_FILE__RELABELFROM                     0x00000080UL
-#define LNK_FILE__LINK                            0x00000800UL
-#define LNK_FILE__WRITE                           0x00000004UL
-#define LNK_FILE__IOCTL                           0x00000001UL
 #define LNK_FILE__RELABELTO                       0x00000100UL
-#define LNK_FILE__READ                            0x00000002UL
-#define LNK_FILE__RENAME                          0x00001000UL
 #define LNK_FILE__APPEND                          0x00000200UL
-#define LNK_FILE__LOCK                            0x00000040UL
+#define LNK_FILE__UNLINK                          0x00000400UL
+#define LNK_FILE__LINK                            0x00000800UL
+#define LNK_FILE__RENAME                          0x00001000UL
+#define LNK_FILE__EXECUTE                         0x00002000UL
 #define LNK_FILE__SWAPON                          0x00004000UL
-#define LNK_FILE__GETATTR                         0x00000010UL
+#define LNK_FILE__QUOTAON                         0x00008000UL
 #define LNK_FILE__MOUNTON                         0x00010000UL
-#define LNK_FILE__CREATE                          0x00000008UL
 
-#define CHR_FILE__EXECUTE                         0x00002000UL
-#define CHR_FILE__UNLINK                          0x00000400UL
+#define CHR_FILE__IOCTL                           0x00000001UL
+#define CHR_FILE__READ                            0x00000002UL
+#define CHR_FILE__WRITE                           0x00000004UL
+#define CHR_FILE__CREATE                          0x00000008UL
+#define CHR_FILE__GETATTR                         0x00000010UL
 #define CHR_FILE__SETATTR                         0x00000020UL
-#define CHR_FILE__QUOTAON                         0x00008000UL
+#define CHR_FILE__LOCK                            0x00000040UL
 #define CHR_FILE__RELABELFROM                     0x00000080UL
-#define CHR_FILE__LINK                            0x00000800UL
-#define CHR_FILE__WRITE                           0x00000004UL
-#define CHR_FILE__IOCTL                           0x00000001UL
 #define CHR_FILE__RELABELTO                       0x00000100UL
-#define CHR_FILE__READ                            0x00000002UL
-#define CHR_FILE__RENAME                          0x00001000UL
 #define CHR_FILE__APPEND                          0x00000200UL
-#define CHR_FILE__LOCK                            0x00000040UL
+#define CHR_FILE__UNLINK                          0x00000400UL
+#define CHR_FILE__LINK                            0x00000800UL
+#define CHR_FILE__RENAME                          0x00001000UL
+#define CHR_FILE__EXECUTE                         0x00002000UL
 #define CHR_FILE__SWAPON                          0x00004000UL
-#define CHR_FILE__GETATTR                         0x00000010UL
+#define CHR_FILE__QUOTAON                         0x00008000UL
 #define CHR_FILE__MOUNTON                         0x00010000UL
-#define CHR_FILE__CREATE                          0x00000008UL
 
-#define BLK_FILE__EXECUTE                         0x00002000UL
-#define BLK_FILE__UNLINK                          0x00000400UL
+#define BLK_FILE__IOCTL                           0x00000001UL
+#define BLK_FILE__READ                            0x00000002UL
+#define BLK_FILE__WRITE                           0x00000004UL
+#define BLK_FILE__CREATE                          0x00000008UL
+#define BLK_FILE__GETATTR                         0x00000010UL
 #define BLK_FILE__SETATTR                         0x00000020UL
-#define BLK_FILE__QUOTAON                         0x00008000UL
+#define BLK_FILE__LOCK                            0x00000040UL
 #define BLK_FILE__RELABELFROM                     0x00000080UL
-#define BLK_FILE__LINK                            0x00000800UL
-#define BLK_FILE__WRITE                           0x00000004UL
-#define BLK_FILE__IOCTL                           0x00000001UL
 #define BLK_FILE__RELABELTO                       0x00000100UL
-#define BLK_FILE__READ                            0x00000002UL
-#define BLK_FILE__RENAME                          0x00001000UL
 #define BLK_FILE__APPEND                          0x00000200UL
-#define BLK_FILE__LOCK                            0x00000040UL
+#define BLK_FILE__UNLINK                          0x00000400UL
+#define BLK_FILE__LINK                            0x00000800UL
+#define BLK_FILE__RENAME                          0x00001000UL
+#define BLK_FILE__EXECUTE                         0x00002000UL
 #define BLK_FILE__SWAPON                          0x00004000UL
-#define BLK_FILE__GETATTR                         0x00000010UL
+#define BLK_FILE__QUOTAON                         0x00008000UL
 #define BLK_FILE__MOUNTON                         0x00010000UL
-#define BLK_FILE__CREATE                          0x00000008UL
 
-#define SOCK_FILE__EXECUTE                        0x00002000UL
-#define SOCK_FILE__UNLINK                         0x00000400UL
+#define SOCK_FILE__IOCTL                          0x00000001UL
+#define SOCK_FILE__READ                           0x00000002UL
+#define SOCK_FILE__WRITE                          0x00000004UL
+#define SOCK_FILE__CREATE                         0x00000008UL
+#define SOCK_FILE__GETATTR                        0x00000010UL
 #define SOCK_FILE__SETATTR                        0x00000020UL
-#define SOCK_FILE__QUOTAON                        0x00008000UL
+#define SOCK_FILE__LOCK                           0x00000040UL
 #define SOCK_FILE__RELABELFROM                    0x00000080UL
-#define SOCK_FILE__LINK                           0x00000800UL
-#define SOCK_FILE__WRITE                          0x00000004UL
-#define SOCK_FILE__IOCTL                          0x00000001UL
 #define SOCK_FILE__RELABELTO                      0x00000100UL
-#define SOCK_FILE__READ                           0x00000002UL
-#define SOCK_FILE__RENAME                         0x00001000UL
 #define SOCK_FILE__APPEND                         0x00000200UL
-#define SOCK_FILE__LOCK                           0x00000040UL
+#define SOCK_FILE__UNLINK                         0x00000400UL
+#define SOCK_FILE__LINK                           0x00000800UL
+#define SOCK_FILE__RENAME                         0x00001000UL
+#define SOCK_FILE__EXECUTE                        0x00002000UL
 #define SOCK_FILE__SWAPON                         0x00004000UL
-#define SOCK_FILE__GETATTR                        0x00000010UL
+#define SOCK_FILE__QUOTAON                        0x00008000UL
 #define SOCK_FILE__MOUNTON                        0x00010000UL
-#define SOCK_FILE__CREATE                         0x00000008UL
 
-#define FIFO_FILE__EXECUTE                        0x00002000UL
-#define FIFO_FILE__UNLINK                         0x00000400UL
+#define FIFO_FILE__IOCTL                          0x00000001UL
+#define FIFO_FILE__READ                           0x00000002UL
+#define FIFO_FILE__WRITE                          0x00000004UL
+#define FIFO_FILE__CREATE                         0x00000008UL
+#define FIFO_FILE__GETATTR                        0x00000010UL
 #define FIFO_FILE__SETATTR                        0x00000020UL
-#define FIFO_FILE__QUOTAON                        0x00008000UL
+#define FIFO_FILE__LOCK                           0x00000040UL
 #define FIFO_FILE__RELABELFROM                    0x00000080UL
-#define FIFO_FILE__LINK                           0x00000800UL
-#define FIFO_FILE__WRITE                          0x00000004UL
-#define FIFO_FILE__IOCTL                          0x00000001UL
 #define FIFO_FILE__RELABELTO                      0x00000100UL
-#define FIFO_FILE__READ                           0x00000002UL
-#define FIFO_FILE__RENAME                         0x00001000UL
 #define FIFO_FILE__APPEND                         0x00000200UL
-#define FIFO_FILE__LOCK                           0x00000040UL
+#define FIFO_FILE__UNLINK                         0x00000400UL
+#define FIFO_FILE__LINK                           0x00000800UL
+#define FIFO_FILE__RENAME                         0x00001000UL
+#define FIFO_FILE__EXECUTE                        0x00002000UL
 #define FIFO_FILE__SWAPON                         0x00004000UL
-#define FIFO_FILE__GETATTR                        0x00000010UL
+#define FIFO_FILE__QUOTAON                        0x00008000UL
 #define FIFO_FILE__MOUNTON                        0x00010000UL
-#define FIFO_FILE__CREATE                         0x00000008UL
 
 #define FD__USE                                   0x00000001UL
 
-#define SOCKET__RELABELTO                         0x00000100UL
-#define SOCKET__RECV_MSG                          0x00080000UL
+#define SOCKET__IOCTL                             0x00000001UL
+#define SOCKET__READ                              0x00000002UL
+#define SOCKET__WRITE                             0x00000004UL
+#define SOCKET__CREATE                            0x00000008UL
+#define SOCKET__GETATTR                           0x00000010UL
+#define SOCKET__SETATTR                           0x00000020UL
+#define SOCKET__LOCK                              0x00000040UL
 #define SOCKET__RELABELFROM                       0x00000080UL
-#define SOCKET__SETOPT                            0x00008000UL
+#define SOCKET__RELABELTO                         0x00000100UL
 #define SOCKET__APPEND                            0x00000200UL
-#define SOCKET__SETATTR                           0x00000020UL
-#define SOCKET__SENDTO                            0x00040000UL
-#define SOCKET__GETOPT                            0x00004000UL
-#define SOCKET__READ                              0x00000002UL
-#define SOCKET__SHUTDOWN                          0x00010000UL
-#define SOCKET__LISTEN                            0x00001000UL
 #define SOCKET__BIND                              0x00000400UL
-#define SOCKET__WRITE                             0x00000004UL
-#define SOCKET__ACCEPT                            0x00002000UL
 #define SOCKET__CONNECT                           0x00000800UL
-#define SOCKET__LOCK                              0x00000040UL
-#define SOCKET__IOCTL                             0x00000001UL
-#define SOCKET__CREATE                            0x00000008UL
-#define SOCKET__NAME_BIND                         0x00200000UL
-#define SOCKET__SEND_MSG                          0x00100000UL
+#define SOCKET__LISTEN                            0x00001000UL
+#define SOCKET__ACCEPT                            0x00002000UL
+#define SOCKET__GETOPT                            0x00004000UL
+#define SOCKET__SETOPT                            0x00008000UL
+#define SOCKET__SHUTDOWN                          0x00010000UL
 #define SOCKET__RECVFROM                          0x00020000UL
-#define SOCKET__GETATTR                           0x00000010UL
+#define SOCKET__SENDTO                            0x00040000UL
+#define SOCKET__RECV_MSG                          0x00080000UL
+#define SOCKET__SEND_MSG                          0x00100000UL
+#define SOCKET__NAME_BIND                         0x00200000UL
 
-#define TCP_SOCKET__RELABELTO                     0x00000100UL
-#define TCP_SOCKET__RECV_MSG                      0x00080000UL
+#define TCP_SOCKET__IOCTL                         0x00000001UL
+#define TCP_SOCKET__READ                          0x00000002UL
+#define TCP_SOCKET__WRITE                         0x00000004UL
+#define TCP_SOCKET__CREATE                        0x00000008UL
+#define TCP_SOCKET__GETATTR                       0x00000010UL
+#define TCP_SOCKET__SETATTR                       0x00000020UL
+#define TCP_SOCKET__LOCK                          0x00000040UL
 #define TCP_SOCKET__RELABELFROM                   0x00000080UL
-#define TCP_SOCKET__SETOPT                        0x00008000UL
+#define TCP_SOCKET__RELABELTO                     0x00000100UL
 #define TCP_SOCKET__APPEND                        0x00000200UL
-#define TCP_SOCKET__SETATTR                       0x00000020UL
-#define TCP_SOCKET__SENDTO                        0x00040000UL
-#define TCP_SOCKET__GETOPT                        0x00004000UL
-#define TCP_SOCKET__READ                          0x00000002UL
-#define TCP_SOCKET__SHUTDOWN                      0x00010000UL
-#define TCP_SOCKET__LISTEN                        0x00001000UL
 #define TCP_SOCKET__BIND                          0x00000400UL
-#define TCP_SOCKET__WRITE                         0x00000004UL
-#define TCP_SOCKET__ACCEPT                        0x00002000UL
 #define TCP_SOCKET__CONNECT                       0x00000800UL
-#define TCP_SOCKET__LOCK                          0x00000040UL
-#define TCP_SOCKET__IOCTL                         0x00000001UL
-#define TCP_SOCKET__CREATE                        0x00000008UL
-#define TCP_SOCKET__NAME_BIND                     0x00200000UL
-#define TCP_SOCKET__SEND_MSG                      0x00100000UL
+#define TCP_SOCKET__LISTEN                        0x00001000UL
+#define TCP_SOCKET__ACCEPT                        0x00002000UL
+#define TCP_SOCKET__GETOPT                        0x00004000UL
+#define TCP_SOCKET__SETOPT                        0x00008000UL
+#define TCP_SOCKET__SHUTDOWN                      0x00010000UL
 #define TCP_SOCKET__RECVFROM                      0x00020000UL
-#define TCP_SOCKET__GETATTR                       0x00000010UL
+#define TCP_SOCKET__SENDTO                        0x00040000UL
+#define TCP_SOCKET__RECV_MSG                      0x00080000UL
+#define TCP_SOCKET__SEND_MSG                      0x00100000UL
+#define TCP_SOCKET__NAME_BIND                     0x00200000UL
 
 #define TCP_SOCKET__CONNECTTO                     0x00400000UL
 #define TCP_SOCKET__NEWCONN                       0x00800000UL
 #define TCP_SOCKET__ACCEPTFROM                    0x01000000UL
 #define TCP_SOCKET__NODE_BIND                     0x02000000UL
 
-#define UDP_SOCKET__RELABELTO                     0x00000100UL
-#define UDP_SOCKET__RECV_MSG                      0x00080000UL
+#define UDP_SOCKET__IOCTL                         0x00000001UL
+#define UDP_SOCKET__READ                          0x00000002UL
+#define UDP_SOCKET__WRITE                         0x00000004UL
+#define UDP_SOCKET__CREATE                        0x00000008UL
+#define UDP_SOCKET__GETATTR                       0x00000010UL
+#define UDP_SOCKET__SETATTR                       0x00000020UL
+#define UDP_SOCKET__LOCK                          0x00000040UL
 #define UDP_SOCKET__RELABELFROM                   0x00000080UL
-#define UDP_SOCKET__SETOPT                        0x00008000UL
+#define UDP_SOCKET__RELABELTO                     0x00000100UL
 #define UDP_SOCKET__APPEND                        0x00000200UL
-#define UDP_SOCKET__SETATTR                       0x00000020UL
-#define UDP_SOCKET__SENDTO                        0x00040000UL
-#define UDP_SOCKET__GETOPT                        0x00004000UL
-#define UDP_SOCKET__READ                          0x00000002UL
-#define UDP_SOCKET__SHUTDOWN                      0x00010000UL
-#define UDP_SOCKET__LISTEN                        0x00001000UL
 #define UDP_SOCKET__BIND                          0x00000400UL
-#define UDP_SOCKET__WRITE                         0x00000004UL
-#define UDP_SOCKET__ACCEPT                        0x00002000UL
 #define UDP_SOCKET__CONNECT                       0x00000800UL
-#define UDP_SOCKET__LOCK                          0x00000040UL
-#define UDP_SOCKET__IOCTL                         0x00000001UL
-#define UDP_SOCKET__CREATE                        0x00000008UL
-#define UDP_SOCKET__NAME_BIND                     0x00200000UL
-#define UDP_SOCKET__SEND_MSG                      0x00100000UL
+#define UDP_SOCKET__LISTEN                        0x00001000UL
+#define UDP_SOCKET__ACCEPT                        0x00002000UL
+#define UDP_SOCKET__GETOPT                        0x00004000UL
+#define UDP_SOCKET__SETOPT                        0x00008000UL
+#define UDP_SOCKET__SHUTDOWN                      0x00010000UL
 #define UDP_SOCKET__RECVFROM                      0x00020000UL
-#define UDP_SOCKET__GETATTR                       0x00000010UL
+#define UDP_SOCKET__SENDTO                        0x00040000UL
+#define UDP_SOCKET__RECV_MSG                      0x00080000UL
+#define UDP_SOCKET__SEND_MSG                      0x00100000UL
+#define UDP_SOCKET__NAME_BIND                     0x00200000UL
+
 #define UDP_SOCKET__NODE_BIND                     0x00400000UL
 
-#define RAWIP_SOCKET__RELABELTO                   0x00000100UL
-#define RAWIP_SOCKET__RECV_MSG                    0x00080000UL
+#define RAWIP_SOCKET__IOCTL                       0x00000001UL
+#define RAWIP_SOCKET__READ                        0x00000002UL
+#define RAWIP_SOCKET__WRITE                       0x00000004UL
+#define RAWIP_SOCKET__CREATE                      0x00000008UL
+#define RAWIP_SOCKET__GETATTR                     0x00000010UL
+#define RAWIP_SOCKET__SETATTR                     0x00000020UL
+#define RAWIP_SOCKET__LOCK                        0x00000040UL
 #define RAWIP_SOCKET__RELABELFROM                 0x00000080UL
-#define RAWIP_SOCKET__SETOPT                      0x00008000UL
+#define RAWIP_SOCKET__RELABELTO                   0x00000100UL
 #define RAWIP_SOCKET__APPEND                      0x00000200UL
-#define RAWIP_SOCKET__SETATTR                     0x00000020UL
-#define RAWIP_SOCKET__SENDTO                      0x00040000UL
-#define RAWIP_SOCKET__GETOPT                      0x00004000UL
-#define RAWIP_SOCKET__READ                        0x00000002UL
-#define RAWIP_SOCKET__SHUTDOWN                    0x00010000UL
-#define RAWIP_SOCKET__LISTEN                      0x00001000UL
 #define RAWIP_SOCKET__BIND                        0x00000400UL
-#define RAWIP_SOCKET__WRITE                       0x00000004UL
-#define RAWIP_SOCKET__ACCEPT                      0x00002000UL
 #define RAWIP_SOCKET__CONNECT                     0x00000800UL
-#define RAWIP_SOCKET__LOCK                        0x00000040UL
-#define RAWIP_SOCKET__IOCTL                       0x00000001UL
-#define RAWIP_SOCKET__CREATE                      0x00000008UL
-#define RAWIP_SOCKET__NAME_BIND                   0x00200000UL
-#define RAWIP_SOCKET__SEND_MSG                    0x00100000UL
+#define RAWIP_SOCKET__LISTEN                      0x00001000UL
+#define RAWIP_SOCKET__ACCEPT                      0x00002000UL
+#define RAWIP_SOCKET__GETOPT                      0x00004000UL
+#define RAWIP_SOCKET__SETOPT                      0x00008000UL
+#define RAWIP_SOCKET__SHUTDOWN                    0x00010000UL
 #define RAWIP_SOCKET__RECVFROM                    0x00020000UL
-#define RAWIP_SOCKET__GETATTR                     0x00000010UL
+#define RAWIP_SOCKET__SENDTO                      0x00040000UL
+#define RAWIP_SOCKET__RECV_MSG                    0x00080000UL
+#define RAWIP_SOCKET__SEND_MSG                    0x00100000UL
+#define RAWIP_SOCKET__NAME_BIND                   0x00200000UL
+
 #define RAWIP_SOCKET__NODE_BIND                   0x00400000UL
 
 #define NODE__TCP_RECV                            0x00000001UL
@@ -314,124 +316,124 @@
 #define NETIF__RAWIP_RECV                         0x00000010UL
 #define NETIF__RAWIP_SEND                         0x00000020UL
 
-#define NETLINK_SOCKET__RELABELTO                 0x00000100UL
-#define NETLINK_SOCKET__RECV_MSG                  0x00080000UL
+#define NETLINK_SOCKET__IOCTL                     0x00000001UL
+#define NETLINK_SOCKET__READ                      0x00000002UL
+#define NETLINK_SOCKET__WRITE                     0x00000004UL
+#define NETLINK_SOCKET__CREATE                    0x00000008UL
+#define NETLINK_SOCKET__GETATTR                   0x00000010UL
+#define NETLINK_SOCKET__SETATTR                   0x00000020UL
+#define NETLINK_SOCKET__LOCK                      0x00000040UL
 #define NETLINK_SOCKET__RELABELFROM               0x00000080UL
-#define NETLINK_SOCKET__SETOPT                    0x00008000UL
+#define NETLINK_SOCKET__RELABELTO                 0x00000100UL
 #define NETLINK_SOCKET__APPEND                    0x00000200UL
-#define NETLINK_SOCKET__SETATTR                   0x00000020UL
-#define NETLINK_SOCKET__SENDTO                    0x00040000UL
-#define NETLINK_SOCKET__GETOPT                    0x00004000UL
-#define NETLINK_SOCKET__READ                      0x00000002UL
-#define NETLINK_SOCKET__SHUTDOWN                  0x00010000UL
-#define NETLINK_SOCKET__LISTEN                    0x00001000UL
 #define NETLINK_SOCKET__BIND                      0x00000400UL
-#define NETLINK_SOCKET__WRITE                     0x00000004UL
-#define NETLINK_SOCKET__ACCEPT                    0x00002000UL
 #define NETLINK_SOCKET__CONNECT                   0x00000800UL
-#define NETLINK_SOCKET__LOCK                      0x00000040UL
-#define NETLINK_SOCKET__IOCTL                     0x00000001UL
-#define NETLINK_SOCKET__CREATE                    0x00000008UL
-#define NETLINK_SOCKET__NAME_BIND                 0x00200000UL
-#define NETLINK_SOCKET__SEND_MSG                  0x00100000UL
+#define NETLINK_SOCKET__LISTEN                    0x00001000UL
+#define NETLINK_SOCKET__ACCEPT                    0x00002000UL
+#define NETLINK_SOCKET__GETOPT                    0x00004000UL
+#define NETLINK_SOCKET__SETOPT                    0x00008000UL
+#define NETLINK_SOCKET__SHUTDOWN                  0x00010000UL
 #define NETLINK_SOCKET__RECVFROM                  0x00020000UL
-#define NETLINK_SOCKET__GETATTR                   0x00000010UL
+#define NETLINK_SOCKET__SENDTO                    0x00040000UL
+#define NETLINK_SOCKET__RECV_MSG                  0x00080000UL
+#define NETLINK_SOCKET__SEND_MSG                  0x00100000UL
+#define NETLINK_SOCKET__NAME_BIND                 0x00200000UL
 
-#define PACKET_SOCKET__RELABELTO                  0x00000100UL
-#define PACKET_SOCKET__RECV_MSG                   0x00080000UL
+#define PACKET_SOCKET__IOCTL                      0x00000001UL
+#define PACKET_SOCKET__READ                       0x00000002UL
+#define PACKET_SOCKET__WRITE                      0x00000004UL
+#define PACKET_SOCKET__CREATE                     0x00000008UL
+#define PACKET_SOCKET__GETATTR                    0x00000010UL
+#define PACKET_SOCKET__SETATTR                    0x00000020UL
+#define PACKET_SOCKET__LOCK                       0x00000040UL
 #define PACKET_SOCKET__RELABELFROM                0x00000080UL
-#define PACKET_SOCKET__SETOPT                     0x00008000UL
+#define PACKET_SOCKET__RELABELTO                  0x00000100UL
 #define PACKET_SOCKET__APPEND                     0x00000200UL
-#define PACKET_SOCKET__SETATTR                    0x00000020UL
-#define PACKET_SOCKET__SENDTO                     0x00040000UL
-#define PACKET_SOCKET__GETOPT                     0x00004000UL
-#define PACKET_SOCKET__READ                       0x00000002UL
-#define PACKET_SOCKET__SHUTDOWN                   0x00010000UL
-#define PACKET_SOCKET__LISTEN                     0x00001000UL
 #define PACKET_SOCKET__BIND                       0x00000400UL
-#define PACKET_SOCKET__WRITE                      0x00000004UL
-#define PACKET_SOCKET__ACCEPT                     0x00002000UL
 #define PACKET_SOCKET__CONNECT                    0x00000800UL
-#define PACKET_SOCKET__LOCK                       0x00000040UL
-#define PACKET_SOCKET__IOCTL                      0x00000001UL
-#define PACKET_SOCKET__CREATE                     0x00000008UL
-#define PACKET_SOCKET__NAME_BIND                  0x00200000UL
-#define PACKET_SOCKET__SEND_MSG                   0x00100000UL
+#define PACKET_SOCKET__LISTEN                     0x00001000UL
+#define PACKET_SOCKET__ACCEPT                     0x00002000UL
+#define PACKET_SOCKET__GETOPT                     0x00004000UL
+#define PACKET_SOCKET__SETOPT                     0x00008000UL
+#define PACKET_SOCKET__SHUTDOWN                   0x00010000UL
 #define PACKET_SOCKET__RECVFROM                   0x00020000UL
-#define PACKET_SOCKET__GETATTR                    0x00000010UL
+#define PACKET_SOCKET__SENDTO                     0x00040000UL
+#define PACKET_SOCKET__RECV_MSG                   0x00080000UL
+#define PACKET_SOCKET__SEND_MSG                   0x00100000UL
+#define PACKET_SOCKET__NAME_BIND                  0x00200000UL
 
-#define KEY_SOCKET__RELABELTO                     0x00000100UL
-#define KEY_SOCKET__RECV_MSG                      0x00080000UL
+#define KEY_SOCKET__IOCTL                         0x00000001UL
+#define KEY_SOCKET__READ                          0x00000002UL
+#define KEY_SOCKET__WRITE                         0x00000004UL
+#define KEY_SOCKET__CREATE                        0x00000008UL
+#define KEY_SOCKET__GETATTR                       0x00000010UL
+#define KEY_SOCKET__SETATTR                       0x00000020UL
+#define KEY_SOCKET__LOCK                          0x00000040UL
 #define KEY_SOCKET__RELABELFROM                   0x00000080UL
-#define KEY_SOCKET__SETOPT                        0x00008000UL
+#define KEY_SOCKET__RELABELTO                     0x00000100UL
 #define KEY_SOCKET__APPEND                        0x00000200UL
-#define KEY_SOCKET__SETATTR                       0x00000020UL
-#define KEY_SOCKET__SENDTO                        0x00040000UL
-#define KEY_SOCKET__GETOPT                        0x00004000UL
-#define KEY_SOCKET__READ                          0x00000002UL
-#define KEY_SOCKET__SHUTDOWN                      0x00010000UL
-#define KEY_SOCKET__LISTEN                        0x00001000UL
 #define KEY_SOCKET__BIND                          0x00000400UL
-#define KEY_SOCKET__WRITE                         0x00000004UL
-#define KEY_SOCKET__ACCEPT                        0x00002000UL
 #define KEY_SOCKET__CONNECT                       0x00000800UL
-#define KEY_SOCKET__LOCK                          0x00000040UL
-#define KEY_SOCKET__IOCTL                         0x00000001UL
-#define KEY_SOCKET__CREATE                        0x00000008UL
-#define KEY_SOCKET__NAME_BIND                     0x00200000UL
-#define KEY_SOCKET__SEND_MSG                      0x00100000UL
+#define KEY_SOCKET__LISTEN                        0x00001000UL
+#define KEY_SOCKET__ACCEPT                        0x00002000UL
+#define KEY_SOCKET__GETOPT                        0x00004000UL
+#define KEY_SOCKET__SETOPT                        0x00008000UL
+#define KEY_SOCKET__SHUTDOWN                      0x00010000UL
 #define KEY_SOCKET__RECVFROM                      0x00020000UL
-#define KEY_SOCKET__GETATTR                       0x00000010UL
+#define KEY_SOCKET__SENDTO                        0x00040000UL
+#define KEY_SOCKET__RECV_MSG                      0x00080000UL
+#define KEY_SOCKET__SEND_MSG                      0x00100000UL
+#define KEY_SOCKET__NAME_BIND                     0x00200000UL
 
-#define UNIX_STREAM_SOCKET__RELABELTO             0x00000100UL
-#define UNIX_STREAM_SOCKET__RECV_MSG              0x00080000UL
+#define UNIX_STREAM_SOCKET__IOCTL                 0x00000001UL
+#define UNIX_STREAM_SOCKET__READ                  0x00000002UL
+#define UNIX_STREAM_SOCKET__WRITE                 0x00000004UL
+#define UNIX_STREAM_SOCKET__CREATE                0x00000008UL
+#define UNIX_STREAM_SOCKET__GETATTR               0x00000010UL
+#define UNIX_STREAM_SOCKET__SETATTR               0x00000020UL
+#define UNIX_STREAM_SOCKET__LOCK                  0x00000040UL
 #define UNIX_STREAM_SOCKET__RELABELFROM           0x00000080UL
-#define UNIX_STREAM_SOCKET__SETOPT                0x00008000UL
+#define UNIX_STREAM_SOCKET__RELABELTO             0x00000100UL
 #define UNIX_STREAM_SOCKET__APPEND                0x00000200UL
-#define UNIX_STREAM_SOCKET__SETATTR               0x00000020UL
-#define UNIX_STREAM_SOCKET__SENDTO                0x00040000UL
-#define UNIX_STREAM_SOCKET__GETOPT                0x00004000UL
-#define UNIX_STREAM_SOCKET__READ                  0x00000002UL
-#define UNIX_STREAM_SOCKET__SHUTDOWN              0x00010000UL
-#define UNIX_STREAM_SOCKET__LISTEN                0x00001000UL
 #define UNIX_STREAM_SOCKET__BIND                  0x00000400UL
-#define UNIX_STREAM_SOCKET__WRITE                 0x00000004UL
-#define UNIX_STREAM_SOCKET__ACCEPT                0x00002000UL
 #define UNIX_STREAM_SOCKET__CONNECT               0x00000800UL
-#define UNIX_STREAM_SOCKET__LOCK                  0x00000040UL
-#define UNIX_STREAM_SOCKET__IOCTL                 0x00000001UL
-#define UNIX_STREAM_SOCKET__CREATE                0x00000008UL
-#define UNIX_STREAM_SOCKET__NAME_BIND             0x00200000UL
-#define UNIX_STREAM_SOCKET__SEND_MSG              0x00100000UL
+#define UNIX_STREAM_SOCKET__LISTEN                0x00001000UL
+#define UNIX_STREAM_SOCKET__ACCEPT                0x00002000UL
+#define UNIX_STREAM_SOCKET__GETOPT                0x00004000UL
+#define UNIX_STREAM_SOCKET__SETOPT                0x00008000UL
+#define UNIX_STREAM_SOCKET__SHUTDOWN              0x00010000UL
 #define UNIX_STREAM_SOCKET__RECVFROM              0x00020000UL
-#define UNIX_STREAM_SOCKET__GETATTR               0x00000010UL
+#define UNIX_STREAM_SOCKET__SENDTO                0x00040000UL
+#define UNIX_STREAM_SOCKET__RECV_MSG              0x00080000UL
+#define UNIX_STREAM_SOCKET__SEND_MSG              0x00100000UL
+#define UNIX_STREAM_SOCKET__NAME_BIND             0x00200000UL
 
 #define UNIX_STREAM_SOCKET__CONNECTTO             0x00400000UL
 #define UNIX_STREAM_SOCKET__NEWCONN               0x00800000UL
 #define UNIX_STREAM_SOCKET__ACCEPTFROM            0x01000000UL
 
-#define UNIX_DGRAM_SOCKET__RELABELTO              0x00000100UL
-#define UNIX_DGRAM_SOCKET__RECV_MSG               0x00080000UL
+#define UNIX_DGRAM_SOCKET__IOCTL                  0x00000001UL
+#define UNIX_DGRAM_SOCKET__READ                   0x00000002UL
+#define UNIX_DGRAM_SOCKET__WRITE                  0x00000004UL
+#define UNIX_DGRAM_SOCKET__CREATE                 0x00000008UL
+#define UNIX_DGRAM_SOCKET__GETATTR                0x00000010UL
+#define UNIX_DGRAM_SOCKET__SETATTR                0x00000020UL
+#define UNIX_DGRAM_SOCKET__LOCK                   0x00000040UL
 #define UNIX_DGRAM_SOCKET__RELABELFROM            0x00000080UL
-#define UNIX_DGRAM_SOCKET__SETOPT                 0x00008000UL
+#define UNIX_DGRAM_SOCKET__RELABELTO              0x00000100UL
 #define UNIX_DGRAM_SOCKET__APPEND                 0x00000200UL
-#define UNIX_DGRAM_SOCKET__SETATTR                0x00000020UL
-#define UNIX_DGRAM_SOCKET__SENDTO                 0x00040000UL
-#define UNIX_DGRAM_SOCKET__GETOPT                 0x00004000UL
-#define UNIX_DGRAM_SOCKET__READ                   0x00000002UL
-#define UNIX_DGRAM_SOCKET__SHUTDOWN               0x00010000UL
-#define UNIX_DGRAM_SOCKET__LISTEN                 0x00001000UL
 #define UNIX_DGRAM_SOCKET__BIND                   0x00000400UL
-#define UNIX_DGRAM_SOCKET__WRITE                  0x00000004UL
-#define UNIX_DGRAM_SOCKET__ACCEPT                 0x00002000UL
 #define UNIX_DGRAM_SOCKET__CONNECT                0x00000800UL
-#define UNIX_DGRAM_SOCKET__LOCK                   0x00000040UL
-#define UNIX_DGRAM_SOCKET__IOCTL                  0x00000001UL
-#define UNIX_DGRAM_SOCKET__CREATE                 0x00000008UL
-#define UNIX_DGRAM_SOCKET__NAME_BIND              0x00200000UL
-#define UNIX_DGRAM_SOCKET__SEND_MSG               0x00100000UL
+#define UNIX_DGRAM_SOCKET__LISTEN                 0x00001000UL
+#define UNIX_DGRAM_SOCKET__ACCEPT                 0x00002000UL
+#define UNIX_DGRAM_SOCKET__GETOPT                 0x00004000UL
+#define UNIX_DGRAM_SOCKET__SETOPT                 0x00008000UL
+#define UNIX_DGRAM_SOCKET__SHUTDOWN               0x00010000UL
 #define UNIX_DGRAM_SOCKET__RECVFROM               0x00020000UL
-#define UNIX_DGRAM_SOCKET__GETATTR                0x00000010UL
+#define UNIX_DGRAM_SOCKET__SENDTO                 0x00040000UL
+#define UNIX_DGRAM_SOCKET__RECV_MSG               0x00080000UL
+#define UNIX_DGRAM_SOCKET__SEND_MSG               0x00100000UL
+#define UNIX_DGRAM_SOCKET__NAME_BIND              0x00200000UL
 
 #define PROCESS__FORK                             0x00000001UL
 #define PROCESS__TRANSITION                       0x00000002UL
@@ -457,50 +459,50 @@
 #define PROCESS__SETRLIMIT                        0x00200000UL
 #define PROCESS__RLIMITINH                        0x00400000UL
 
+#define IPC__CREATE                               0x00000001UL
+#define IPC__DESTROY                              0x00000002UL
+#define IPC__GETATTR                              0x00000004UL
 #define IPC__SETATTR                              0x00000008UL
 #define IPC__READ                                 0x00000010UL
+#define IPC__WRITE                                0x00000020UL
 #define IPC__ASSOCIATE                            0x00000040UL
-#define IPC__DESTROY                              0x00000002UL
-#define IPC__UNIX_WRITE                           0x00000100UL
-#define IPC__CREATE                               0x00000001UL
 #define IPC__UNIX_READ                            0x00000080UL
-#define IPC__GETATTR                              0x00000004UL
-#define IPC__WRITE                                0x00000020UL
+#define IPC__UNIX_WRITE                           0x00000100UL
 
+#define SEM__CREATE                               0x00000001UL
+#define SEM__DESTROY                              0x00000002UL
+#define SEM__GETATTR                              0x00000004UL
 #define SEM__SETATTR                              0x00000008UL
 #define SEM__READ                                 0x00000010UL
+#define SEM__WRITE                                0x00000020UL
 #define SEM__ASSOCIATE                            0x00000040UL
-#define SEM__DESTROY                              0x00000002UL
-#define SEM__UNIX_WRITE                           0x00000100UL
-#define SEM__CREATE                               0x00000001UL
 #define SEM__UNIX_READ                            0x00000080UL
-#define SEM__GETATTR                              0x00000004UL
-#define SEM__WRITE                                0x00000020UL
+#define SEM__UNIX_WRITE                           0x00000100UL
 
+#define MSGQ__CREATE                              0x00000001UL
+#define MSGQ__DESTROY                             0x00000002UL
+#define MSGQ__GETATTR                             0x00000004UL
 #define MSGQ__SETATTR                             0x00000008UL
 #define MSGQ__READ                                0x00000010UL
+#define MSGQ__WRITE                               0x00000020UL
 #define MSGQ__ASSOCIATE                           0x00000040UL
-#define MSGQ__DESTROY                             0x00000002UL
-#define MSGQ__UNIX_WRITE                          0x00000100UL
-#define MSGQ__CREATE                              0x00000001UL
 #define MSGQ__UNIX_READ                           0x00000080UL
-#define MSGQ__GETATTR                             0x00000004UL
-#define MSGQ__WRITE                               0x00000020UL
+#define MSGQ__UNIX_WRITE                          0x00000100UL
 
 #define MSGQ__ENQUEUE                             0x00000200UL
 
 #define MSG__SEND                                 0x00000001UL
 #define MSG__RECEIVE                              0x00000002UL
 
+#define SHM__CREATE                               0x00000001UL
+#define SHM__DESTROY                              0x00000002UL
+#define SHM__GETATTR                              0x00000004UL
 #define SHM__SETATTR                              0x00000008UL
 #define SHM__READ                                 0x00000010UL
+#define SHM__WRITE                                0x00000020UL
 #define SHM__ASSOCIATE                            0x00000040UL
-#define SHM__DESTROY                              0x00000002UL
-#define SHM__UNIX_WRITE                           0x00000100UL
-#define SHM__CREATE                               0x00000001UL
 #define SHM__UNIX_READ                            0x00000080UL
-#define SHM__GETATTR                              0x00000004UL
-#define SHM__WRITE                                0x00000020UL
+#define SHM__UNIX_WRITE                           0x00000100UL
 
 #define SHM__LOCK                                 0x00000200UL
 
@@ -552,6 +554,327 @@
 #define PASSWD__PASSWD                            0x00000001UL
 #define PASSWD__CHFN                              0x00000002UL
 #define PASSWD__CHSH                              0x00000004UL
-
+#define PASSWD__ROOTOK                            0x00000008UL
+
+#define DRAWABLE__CREATE                          0x00000001UL
+#define DRAWABLE__DESTROY                         0x00000002UL
+#define DRAWABLE__DRAW                            0x00000004UL
+#define DRAWABLE__COPY                            0x00000008UL
+#define DRAWABLE__GETATTR                         0x00000010UL
+
+#define GC__CREATE                                0x00000001UL
+#define GC__FREE                                  0x00000002UL
+#define GC__GETATTR                               0x00000004UL
+#define GC__SETATTR                               0x00000008UL
+
+#define WINDOW__ADDCHILD                          0x00000001UL
+#define WINDOW__CREATE                            0x00000002UL
+#define WINDOW__DESTROY                           0x00000004UL
+#define WINDOW__MAP                               0x00000008UL
+#define WINDOW__UNMAP                             0x00000010UL
+#define WINDOW__CHSTACK                           0x00000020UL
+#define WINDOW__CHPROPLIST                        0x00000040UL
+#define WINDOW__CHPROP                            0x00000080UL
+#define WINDOW__LISTPROP                          0x00000100UL
+#define WINDOW__GETATTR                           0x00000200UL
+#define WINDOW__SETATTR                           0x00000400UL
+#define WINDOW__SETFOCUS                          0x00000800UL
+#define WINDOW__MOVE                              0x00001000UL
+#define WINDOW__CHSELECTION                       0x00002000UL
+#define WINDOW__CHPARENT                          0x00004000UL
+#define WINDOW__CTRLLIFE                          0x00008000UL
+#define WINDOW__ENUMERATE                         0x00010000UL
+#define WINDOW__TRANSPARENT                       0x00020000UL
+#define WINDOW__MOUSEMOTION                       0x00040000UL
+#define WINDOW__CLIENTCOMEVENT                    0x00080000UL
+#define WINDOW__INPUTEVENT                        0x00100000UL
+#define WINDOW__DRAWEVENT                         0x00200000UL
+#define WINDOW__WINDOWCHANGEEVENT                 0x00400000UL
+#define WINDOW__WINDOWCHANGEREQUEST               0x00800000UL
+#define WINDOW__SERVERCHANGEEVENT                 0x01000000UL
+#define WINDOW__EXTENSIONEVENT                    0x02000000UL
+
+#define FONT__LOAD                                0x00000001UL
+#define FONT__FREE                                0x00000002UL
+#define FONT__GETATTR                             0x00000004UL
+#define FONT__USE                                 0x00000008UL
+
+#define COLORMAP__CREATE                          0x00000001UL
+#define COLORMAP__FREE                            0x00000002UL
+#define COLORMAP__INSTALL                         0x00000004UL
+#define COLORMAP__UNINSTALL                       0x00000008UL
+#define COLORMAP__LIST                            0x00000010UL
+#define COLORMAP__READ                            0x00000020UL
+#define COLORMAP__STORE                           0x00000040UL
+#define COLORMAP__GETATTR                         0x00000080UL
+#define COLORMAP__SETATTR                         0x00000100UL
+
+#define PROPERTY__CREATE                          0x00000001UL
+#define PROPERTY__FREE                            0x00000002UL
+#define PROPERTY__READ                            0x00000004UL
+#define PROPERTY__WRITE                           0x00000008UL
+
+#define CURSOR__CREATE                            0x00000001UL
+#define CURSOR__CREATEGLYPH                       0x00000002UL
+#define CURSOR__FREE                              0x00000004UL
+#define CURSOR__ASSIGN                            0x00000008UL
+#define CURSOR__SETATTR                           0x00000010UL
+
+#define XCLIENT__KILL                             0x00000001UL
+
+#define XINPUT__LOOKUP                            0x00000001UL
+#define XINPUT__GETATTR                           0x00000002UL
+#define XINPUT__SETATTR                           0x00000004UL
+#define XINPUT__SETFOCUS                          0x00000008UL
+#define XINPUT__WARPPOINTER                       0x00000010UL
+#define XINPUT__ACTIVEGRAB                        0x00000020UL
+#define XINPUT__PASSIVEGRAB                       0x00000040UL
+#define XINPUT__UNGRAB                            0x00000080UL
+#define XINPUT__BELL                              0x00000100UL
+#define XINPUT__MOUSEMOTION                       0x00000200UL
+#define XINPUT__RELABELINPUT                      0x00000400UL
+
+#define XSERVER__SCREENSAVER                      0x00000001UL
+#define XSERVER__GETHOSTLIST                      0x00000002UL
+#define XSERVER__SETHOSTLIST                      0x00000004UL
+#define XSERVER__GETFONTPATH                      0x00000008UL
+#define XSERVER__SETFONTPATH                      0x00000010UL
+#define XSERVER__GETATTR                          0x00000020UL
+#define XSERVER__GRAB                             0x00000040UL
+#define XSERVER__UNGRAB                           0x00000080UL
+
+#define XEXTENSION__QUERY                         0x00000001UL
+#define XEXTENSION__USE                           0x00000002UL
+
+#define PAX__PAGEEXEC                             0x00000001UL
+#define PAX__EMUTRAMP                             0x00000002UL
+#define PAX__MPROTECT                             0x00000004UL
+#define PAX__RANDMMAP                             0x00000008UL
+#define PAX__RANDEXEC                             0x00000010UL
+#define PAX__SEGMEXEC                             0x00000020UL
+
+#define NETLINK_ROUTE_SOCKET__IOCTL               0x00000001UL
+#define NETLINK_ROUTE_SOCKET__READ                0x00000002UL
+#define NETLINK_ROUTE_SOCKET__WRITE               0x00000004UL
+#define NETLINK_ROUTE_SOCKET__CREATE              0x00000008UL
+#define NETLINK_ROUTE_SOCKET__GETATTR             0x00000010UL
+#define NETLINK_ROUTE_SOCKET__SETATTR             0x00000020UL
+#define NETLINK_ROUTE_SOCKET__LOCK                0x00000040UL
+#define NETLINK_ROUTE_SOCKET__RELABELFROM         0x00000080UL
+#define NETLINK_ROUTE_SOCKET__RELABELTO           0x00000100UL
+#define NETLINK_ROUTE_SOCKET__APPEND              0x00000200UL
+#define NETLINK_ROUTE_SOCKET__BIND                0x00000400UL
+#define NETLINK_ROUTE_SOCKET__CONNECT             0x00000800UL
+#define NETLINK_ROUTE_SOCKET__LISTEN              0x00001000UL
+#define NETLINK_ROUTE_SOCKET__ACCEPT              0x00002000UL
+#define NETLINK_ROUTE_SOCKET__GETOPT              0x00004000UL
+#define NETLINK_ROUTE_SOCKET__SETOPT              0x00008000UL
+#define NETLINK_ROUTE_SOCKET__SHUTDOWN            0x00010000UL
+#define NETLINK_ROUTE_SOCKET__RECVFROM            0x00020000UL
+#define NETLINK_ROUTE_SOCKET__SENDTO              0x00040000UL
+#define NETLINK_ROUTE_SOCKET__RECV_MSG            0x00080000UL
+#define NETLINK_ROUTE_SOCKET__SEND_MSG            0x00100000UL
+#define NETLINK_ROUTE_SOCKET__NAME_BIND           0x00200000UL
+
+#define NETLINK_ROUTE_SOCKET__NLMSG_READ          0x00400000UL
+#define NETLINK_ROUTE_SOCKET__NLMSG_WRITE         0x00800000UL
+
+#define NETLINK_FIREWALL_SOCKET__IOCTL            0x00000001UL
+#define NETLINK_FIREWALL_SOCKET__READ             0x00000002UL
+#define NETLINK_FIREWALL_SOCKET__WRITE            0x00000004UL
+#define NETLINK_FIREWALL_SOCKET__CREATE           0x00000008UL
+#define NETLINK_FIREWALL_SOCKET__GETATTR          0x00000010UL
+#define NETLINK_FIREWALL_SOCKET__SETATTR          0x00000020UL
+#define NETLINK_FIREWALL_SOCKET__LOCK             0x00000040UL
+#define NETLINK_FIREWALL_SOCKET__RELABELFROM      0x00000080UL
+#define NETLINK_FIREWALL_SOCKET__RELABELTO        0x00000100UL
+#define NETLINK_FIREWALL_SOCKET__APPEND           0x00000200UL
+#define NETLINK_FIREWALL_SOCKET__BIND             0x00000400UL
+#define NETLINK_FIREWALL_SOCKET__CONNECT          0x00000800UL
+#define NETLINK_FIREWALL_SOCKET__LISTEN           0x00001000UL
+#define NETLINK_FIREWALL_SOCKET__ACCEPT           0x00002000UL
+#define NETLINK_FIREWALL_SOCKET__GETOPT           0x00004000UL
+#define NETLINK_FIREWALL_SOCKET__SETOPT           0x00008000UL
+#define NETLINK_FIREWALL_SOCKET__SHUTDOWN         0x00010000UL
+#define NETLINK_FIREWALL_SOCKET__RECVFROM         0x00020000UL
+#define NETLINK_FIREWALL_SOCKET__SENDTO           0x00040000UL
+#define NETLINK_FIREWALL_SOCKET__RECV_MSG         0x00080000UL
+#define NETLINK_FIREWALL_SOCKET__SEND_MSG         0x00100000UL
+#define NETLINK_FIREWALL_SOCKET__NAME_BIND        0x00200000UL
+
+#define NETLINK_FIREWALL_SOCKET__NLMSG_READ       0x00400000UL
+#define NETLINK_FIREWALL_SOCKET__NLMSG_WRITE      0x00800000UL
+
+#define NETLINK_TCPDIAG_SOCKET__IOCTL             0x00000001UL
+#define NETLINK_TCPDIAG_SOCKET__READ              0x00000002UL
+#define NETLINK_TCPDIAG_SOCKET__WRITE             0x00000004UL
+#define NETLINK_TCPDIAG_SOCKET__CREATE            0x00000008UL
+#define NETLINK_TCPDIAG_SOCKET__GETATTR           0x00000010UL
+#define NETLINK_TCPDIAG_SOCKET__SETATTR           0x00000020UL
+#define NETLINK_TCPDIAG_SOCKET__LOCK              0x00000040UL
+#define NETLINK_TCPDIAG_SOCKET__RELABELFROM       0x00000080UL
+#define NETLINK_TCPDIAG_SOCKET__RELABELTO         0x00000100UL
+#define NETLINK_TCPDIAG_SOCKET__APPEND            0x00000200UL
+#define NETLINK_TCPDIAG_SOCKET__BIND              0x00000400UL
+#define NETLINK_TCPDIAG_SOCKET__CONNECT           0x00000800UL
+#define NETLINK_TCPDIAG_SOCKET__LISTEN            0x00001000UL
+#define NETLINK_TCPDIAG_SOCKET__ACCEPT            0x00002000UL
+#define NETLINK_TCPDIAG_SOCKET__GETOPT            0x00004000UL
+#define NETLINK_TCPDIAG_SOCKET__SETOPT            0x00008000UL
+#define NETLINK_TCPDIAG_SOCKET__SHUTDOWN          0x00010000UL
+#define NETLINK_TCPDIAG_SOCKET__RECVFROM          0x00020000UL
+#define NETLINK_TCPDIAG_SOCKET__SENDTO            0x00040000UL
+#define NETLINK_TCPDIAG_SOCKET__RECV_MSG          0x00080000UL
+#define NETLINK_TCPDIAG_SOCKET__SEND_MSG          0x00100000UL
+#define NETLINK_TCPDIAG_SOCKET__NAME_BIND         0x00200000UL
+
+#define NETLINK_TCPDIAG_SOCKET__NLMSG_READ        0x00400000UL
+#define NETLINK_TCPDIAG_SOCKET__NLMSG_WRITE       0x00800000UL
+
+#define NETLINK_NFLOG_SOCKET__IOCTL               0x00000001UL
+#define NETLINK_NFLOG_SOCKET__READ                0x00000002UL
+#define NETLINK_NFLOG_SOCKET__WRITE               0x00000004UL
+#define NETLINK_NFLOG_SOCKET__CREATE              0x00000008UL
+#define NETLINK_NFLOG_SOCKET__GETATTR             0x00000010UL
+#define NETLINK_NFLOG_SOCKET__SETATTR             0x00000020UL
+#define NETLINK_NFLOG_SOCKET__LOCK                0x00000040UL
+#define NETLINK_NFLOG_SOCKET__RELABELFROM         0x00000080UL
+#define NETLINK_NFLOG_SOCKET__RELABELTO           0x00000100UL
+#define NETLINK_NFLOG_SOCKET__APPEND              0x00000200UL
+#define NETLINK_NFLOG_SOCKET__BIND                0x00000400UL
+#define NETLINK_NFLOG_SOCKET__CONNECT             0x00000800UL
+#define NETLINK_NFLOG_SOCKET__LISTEN              0x00001000UL
+#define NETLINK_NFLOG_SOCKET__ACCEPT              0x00002000UL
+#define NETLINK_NFLOG_SOCKET__GETOPT              0x00004000UL
+#define NETLINK_NFLOG_SOCKET__SETOPT              0x00008000UL
+#define NETLINK_NFLOG_SOCKET__SHUTDOWN            0x00010000UL
+#define NETLINK_NFLOG_SOCKET__RECVFROM            0x00020000UL
+#define NETLINK_NFLOG_SOCKET__SENDTO              0x00040000UL
+#define NETLINK_NFLOG_SOCKET__RECV_MSG            0x00080000UL
+#define NETLINK_NFLOG_SOCKET__SEND_MSG            0x00100000UL
+#define NETLINK_NFLOG_SOCKET__NAME_BIND           0x00200000UL
+
+#define NETLINK_XFRM_SOCKET__IOCTL                0x00000001UL
+#define NETLINK_XFRM_SOCKET__READ                 0x00000002UL
+#define NETLINK_XFRM_SOCKET__WRITE                0x00000004UL
+#define NETLINK_XFRM_SOCKET__CREATE               0x00000008UL
+#define NETLINK_XFRM_SOCKET__GETATTR              0x00000010UL
+#define NETLINK_XFRM_SOCKET__SETATTR              0x00000020UL
+#define NETLINK_XFRM_SOCKET__LOCK                 0x00000040UL
+#define NETLINK_XFRM_SOCKET__RELABELFROM          0x00000080UL
+#define NETLINK_XFRM_SOCKET__RELABELTO            0x00000100UL
+#define NETLINK_XFRM_SOCKET__APPEND               0x00000200UL
+#define NETLINK_XFRM_SOCKET__BIND                 0x00000400UL
+#define NETLINK_XFRM_SOCKET__CONNECT              0x00000800UL
+#define NETLINK_XFRM_SOCKET__LISTEN               0x00001000UL
+#define NETLINK_XFRM_SOCKET__ACCEPT               0x00002000UL
+#define NETLINK_XFRM_SOCKET__GETOPT               0x00004000UL
+#define NETLINK_XFRM_SOCKET__SETOPT               0x00008000UL
+#define NETLINK_XFRM_SOCKET__SHUTDOWN             0x00010000UL
+#define NETLINK_XFRM_SOCKET__RECVFROM             0x00020000UL
+#define NETLINK_XFRM_SOCKET__SENDTO               0x00040000UL
+#define NETLINK_XFRM_SOCKET__RECV_MSG             0x00080000UL
+#define NETLINK_XFRM_SOCKET__SEND_MSG             0x00100000UL
+#define NETLINK_XFRM_SOCKET__NAME_BIND            0x00200000UL
+
+#define NETLINK_XFRM_SOCKET__NLMSG_READ           0x00400000UL
+#define NETLINK_XFRM_SOCKET__NLMSG_WRITE          0x00800000UL
+
+#define NETLINK_SELINUX_SOCKET__IOCTL             0x00000001UL
+#define NETLINK_SELINUX_SOCKET__READ              0x00000002UL
+#define NETLINK_SELINUX_SOCKET__WRITE             0x00000004UL
+#define NETLINK_SELINUX_SOCKET__CREATE            0x00000008UL
+#define NETLINK_SELINUX_SOCKET__GETATTR           0x00000010UL
+#define NETLINK_SELINUX_SOCKET__SETATTR           0x00000020UL
+#define NETLINK_SELINUX_SOCKET__LOCK              0x00000040UL
+#define NETLINK_SELINUX_SOCKET__RELABELFROM       0x00000080UL
+#define NETLINK_SELINUX_SOCKET__RELABELTO         0x00000100UL
+#define NETLINK_SELINUX_SOCKET__APPEND            0x00000200UL
+#define NETLINK_SELINUX_SOCKET__BIND              0x00000400UL
+#define NETLINK_SELINUX_SOCKET__CONNECT           0x00000800UL
+#define NETLINK_SELINUX_SOCKET__LISTEN            0x00001000UL
+#define NETLINK_SELINUX_SOCKET__ACCEPT            0x00002000UL
+#define NETLINK_SELINUX_SOCKET__GETOPT            0x00004000UL
+#define NETLINK_SELINUX_SOCKET__SETOPT            0x00008000UL
+#define NETLINK_SELINUX_SOCKET__SHUTDOWN          0x00010000UL
+#define NETLINK_SELINUX_SOCKET__RECVFROM          0x00020000UL
+#define NETLINK_SELINUX_SOCKET__SENDTO            0x00040000UL
+#define NETLINK_SELINUX_SOCKET__RECV_MSG          0x00080000UL
+#define NETLINK_SELINUX_SOCKET__SEND_MSG          0x00100000UL
+#define NETLINK_SELINUX_SOCKET__NAME_BIND         0x00200000UL
+
+#define NETLINK_AUDIT_SOCKET__IOCTL               0x00000001UL
+#define NETLINK_AUDIT_SOCKET__READ                0x00000002UL
+#define NETLINK_AUDIT_SOCKET__WRITE               0x00000004UL
+#define NETLINK_AUDIT_SOCKET__CREATE              0x00000008UL
+#define NETLINK_AUDIT_SOCKET__GETATTR             0x00000010UL
+#define NETLINK_AUDIT_SOCKET__SETATTR             0x00000020UL
+#define NETLINK_AUDIT_SOCKET__LOCK                0x00000040UL
+#define NETLINK_AUDIT_SOCKET__RELABELFROM         0x00000080UL
+#define NETLINK_AUDIT_SOCKET__RELABELTO           0x00000100UL
+#define NETLINK_AUDIT_SOCKET__APPEND              0x00000200UL
+#define NETLINK_AUDIT_SOCKET__BIND                0x00000400UL
+#define NETLINK_AUDIT_SOCKET__CONNECT             0x00000800UL
+#define NETLINK_AUDIT_SOCKET__LISTEN              0x00001000UL
+#define NETLINK_AUDIT_SOCKET__ACCEPT              0x00002000UL
+#define NETLINK_AUDIT_SOCKET__GETOPT              0x00004000UL
+#define NETLINK_AUDIT_SOCKET__SETOPT              0x00008000UL
+#define NETLINK_AUDIT_SOCKET__SHUTDOWN            0x00010000UL
+#define NETLINK_AUDIT_SOCKET__RECVFROM            0x00020000UL
+#define NETLINK_AUDIT_SOCKET__SENDTO              0x00040000UL
+#define NETLINK_AUDIT_SOCKET__RECV_MSG            0x00080000UL
+#define NETLINK_AUDIT_SOCKET__SEND_MSG            0x00100000UL
+#define NETLINK_AUDIT_SOCKET__NAME_BIND           0x00200000UL
+
+#define NETLINK_AUDIT_SOCKET__NLMSG_READ          0x00400000UL
+#define NETLINK_AUDIT_SOCKET__NLMSG_WRITE         0x00800000UL
+
+#define NETLINK_IP6FW_SOCKET__IOCTL               0x00000001UL
+#define NETLINK_IP6FW_SOCKET__READ                0x00000002UL
+#define NETLINK_IP6FW_SOCKET__WRITE               0x00000004UL
+#define NETLINK_IP6FW_SOCKET__CREATE              0x00000008UL
+#define NETLINK_IP6FW_SOCKET__GETATTR             0x00000010UL
+#define NETLINK_IP6FW_SOCKET__SETATTR             0x00000020UL
+#define NETLINK_IP6FW_SOCKET__LOCK                0x00000040UL
+#define NETLINK_IP6FW_SOCKET__RELABELFROM         0x00000080UL
+#define NETLINK_IP6FW_SOCKET__RELABELTO           0x00000100UL
+#define NETLINK_IP6FW_SOCKET__APPEND              0x00000200UL
+#define NETLINK_IP6FW_SOCKET__BIND                0x00000400UL
+#define NETLINK_IP6FW_SOCKET__CONNECT             0x00000800UL
+#define NETLINK_IP6FW_SOCKET__LISTEN              0x00001000UL
+#define NETLINK_IP6FW_SOCKET__ACCEPT              0x00002000UL
+#define NETLINK_IP6FW_SOCKET__GETOPT              0x00004000UL
+#define NETLINK_IP6FW_SOCKET__SETOPT              0x00008000UL
+#define NETLINK_IP6FW_SOCKET__SHUTDOWN            0x00010000UL
+#define NETLINK_IP6FW_SOCKET__RECVFROM            0x00020000UL
+#define NETLINK_IP6FW_SOCKET__SENDTO              0x00040000UL
+#define NETLINK_IP6FW_SOCKET__RECV_MSG            0x00080000UL
+#define NETLINK_IP6FW_SOCKET__SEND_MSG            0x00100000UL
+#define NETLINK_IP6FW_SOCKET__NAME_BIND           0x00200000UL
+
+#define NETLINK_IP6FW_SOCKET__NLMSG_READ          0x00400000UL
+#define NETLINK_IP6FW_SOCKET__NLMSG_WRITE         0x00800000UL
+
+#define NETLINK_DNRT_SOCKET__IOCTL                0x00000001UL
+#define NETLINK_DNRT_SOCKET__READ                 0x00000002UL
+#define NETLINK_DNRT_SOCKET__WRITE                0x00000004UL
+#define NETLINK_DNRT_SOCKET__CREATE               0x00000008UL
+#define NETLINK_DNRT_SOCKET__GETATTR              0x00000010UL
+#define NETLINK_DNRT_SOCKET__SETATTR              0x00000020UL
+#define NETLINK_DNRT_SOCKET__LOCK                 0x00000040UL
+#define NETLINK_DNRT_SOCKET__RELABELFROM          0x00000080UL
+#define NETLINK_DNRT_SOCKET__RELABELTO            0x00000100UL
+#define NETLINK_DNRT_SOCKET__APPEND               0x00000200UL
+#define NETLINK_DNRT_SOCKET__BIND                 0x00000400UL
+#define NETLINK_DNRT_SOCKET__CONNECT              0x00000800UL
+#define NETLINK_DNRT_SOCKET__LISTEN               0x00001000UL
+#define NETLINK_DNRT_SOCKET__ACCEPT               0x00002000UL
+#define NETLINK_DNRT_SOCKET__GETOPT               0x00004000UL
+#define NETLINK_DNRT_SOCKET__SETOPT               0x00008000UL
+#define NETLINK_DNRT_SOCKET__SHUTDOWN             0x00010000UL
+#define NETLINK_DNRT_SOCKET__RECVFROM             0x00020000UL
+#define NETLINK_DNRT_SOCKET__SENDTO               0x00040000UL
+#define NETLINK_DNRT_SOCKET__RECV_MSG             0x00080000UL
+#define NETLINK_DNRT_SOCKET__SEND_MSG             0x00100000UL
 
 /* FLASK */
diff --git a/security/selinux/include/avc.h b/security/selinux/include/avc.h
index 86bdeef58..42759196b 100644
--- a/security/selinux/include/avc.h
+++ b/security/selinux/include/avc.h
@@ -104,25 +104,6 @@ struct avc_audit_data {
 #define AVC_CAV_PROBES           6
 #define AVC_CAV_MISSES           7
 #define AVC_NSTATS               8
-extern unsigned avc_cache_stats[AVC_NSTATS];
-
-#ifdef AVC_CACHE_STATS
-static inline void avc_cache_stats_incr(int type)
-{
-	avc_cache_stats[type]++;
-}
-
-static inline void avc_cache_stats_add(int type, unsigned val)
-{
-	avc_cache_stats[type] += val;
-}
-#else
-static inline void avc_cache_stats_incr(int type)
-{ }
-
-static inline void avc_cache_stats_add(int type, unsigned val)
-{ }
-#endif
 
 /*
  * AVC display support
diff --git a/security/selinux/include/class_to_string.h b/security/selinux/include/class_to_string.h
index ce33ff3e6..a65e25eb6 100644
--- a/security/selinux/include/class_to_string.h
+++ b/security/selinux/include/class_to_string.h
@@ -35,5 +35,26 @@ static char *class_to_string[] =
     "shm",
     "ipc",
     "passwd",
+    "drawable",
+    "window",
+    "gc",
+    "font",
+    "colormap",
+    "property",
+    "cursor",
+    "xclient",
+    "xinput",
+    "xserver",
+    "xextension",
+    "pax",
+    "netlink_route_socket",
+    "netlink_firewall_socket",
+    "netlink_tcpdiag_socket",
+    "netlink_nflog_socket",
+    "netlink_xfrm_socket",
+    "netlink_selinux_socket",
+    "netlink_audit_socket",
+    "netlink_ip6fw_socket",
+    "netlink_dnrt_socket",
 };
 
diff --git a/security/selinux/include/flask.h b/security/selinux/include/flask.h
index 6425c7869..a392a3d06 100644
--- a/security/selinux/include/flask.h
+++ b/security/selinux/include/flask.h
@@ -35,6 +35,27 @@
 #define SECCLASS_SHM                                     28
 #define SECCLASS_IPC                                     29
 #define SECCLASS_PASSWD                                  30
+#define SECCLASS_DRAWABLE                                31
+#define SECCLASS_WINDOW                                  32
+#define SECCLASS_GC                                      33
+#define SECCLASS_FONT                                    34
+#define SECCLASS_COLORMAP                                35
+#define SECCLASS_PROPERTY                                36
+#define SECCLASS_CURSOR                                  37
+#define SECCLASS_XCLIENT                                 38
+#define SECCLASS_XINPUT                                  39
+#define SECCLASS_XSERVER                                 40
+#define SECCLASS_XEXTENSION                              41
+#define SECCLASS_PAX                                     42
+#define SECCLASS_NETLINK_ROUTE_SOCKET                    43
+#define SECCLASS_NETLINK_FIREWALL_SOCKET                 44
+#define SECCLASS_NETLINK_TCPDIAG_SOCKET                  45
+#define SECCLASS_NETLINK_NFLOG_SOCKET                    46
+#define SECCLASS_NETLINK_XFRM_SOCKET                     47
+#define SECCLASS_NETLINK_SELINUX_SOCKET                  48
+#define SECCLASS_NETLINK_AUDIT_SOCKET                    49
+#define SECCLASS_NETLINK_IP6FW_SOCKET                    50
+#define SECCLASS_NETLINK_DNRT_SOCKET                     51
 
 /*
  * Security identifier indices for initial entities
diff --git a/security/selinux/include/security.h b/security/selinux/include/security.h
index 0413683ac..5931e46d4 100644
--- a/security/selinux/include/security.h
+++ b/security/selinux/include/security.h
@@ -17,13 +17,14 @@
 #define SELINUX_MAGIC 0xf97cff8c
 
 /* Identify specific policy version changes */
-#define POLICYDB_VERSION_BASE  15
-#define POLICYDB_VERSION_BOOL  16
-#define POLICYDB_VERSION_IPV6  17
+#define POLICYDB_VERSION_BASE		15
+#define POLICYDB_VERSION_BOOL		16
+#define POLICYDB_VERSION_IPV6		17
+#define POLICYDB_VERSION_NLCLASS	18
 
 /* Range of policy versions we understand*/
 #define POLICYDB_VERSION_MIN   POLICYDB_VERSION_BASE
-#define POLICYDB_VERSION_MAX   POLICYDB_VERSION_IPV6
+#define POLICYDB_VERSION_MAX   POLICYDB_VERSION_NLCLASS
 
 #ifdef CONFIG_SECURITY_SELINUX_BOOTPARAM
 extern int selinux_enabled;
diff --git a/security/selinux/netif.c b/security/selinux/netif.c
index 4cbf8f259..d23bd7e63 100644
--- a/security/selinux/netif.c
+++ b/security/selinux/netif.c
@@ -134,9 +134,9 @@ out:
 	return netif;
 }
 
-static void sel_netif_free(void *p)
+static void sel_netif_free(struct rcu_head *p)
 {
-	struct sel_netif *netif = p;
+	struct sel_netif *netif = container_of(p, struct sel_netif, rcu_head);
 	
 	DEBUGP("%s: %s\n", __FUNCTION__, netif->nsec.dev->name);
 	kfree(netif);
@@ -151,7 +151,7 @@ static void sel_netif_destroy(struct sel_netif *netif)
 	sel_netif_total--;
 	spin_unlock_bh(&sel_netif_lock);
 
-	call_rcu(&netif->rcu_head, sel_netif_free, netif);
+	call_rcu(&netif->rcu_head, sel_netif_free);
 }
 
 void sel_netif_put(struct sel_netif *netif)
diff --git a/security/selinux/ss/conditional.c b/security/selinux/ss/conditional.c
index 6888546c4..f8958ba34 100644
--- a/security/selinux/ss/conditional.c
+++ b/security/selinux/ss/conditional.c
@@ -217,7 +217,7 @@ int bool_isvalid(struct cond_bool_datum *b)
 
 int cond_read_bool(struct policydb *p, struct hashtab *h, void *fp)
 {
-	char *key = 0;
+	char *key = NULL;
 	struct cond_bool_datum *booldatum;
 	__u32 *buf, len;
 
@@ -251,7 +251,7 @@ int cond_read_bool(struct policydb *p, struct hashtab *h, void *fp)
 
 	return 0;
 err:
-	cond_destroy_bool(key, booldatum, 0);
+	cond_destroy_bool(key, booldatum, NULL);
 	return -1;
 }
 
diff --git a/security/selinux/ss/ebitmap.c b/security/selinux/ss/ebitmap.c
index 98be57f33..0912af410 100644
--- a/security/selinux/ss/ebitmap.c
+++ b/security/selinux/ss/ebitmap.c
@@ -17,7 +17,7 @@ int ebitmap_or(struct ebitmap *dst, struct ebitmap *e1, struct ebitmap *e2)
 
 	n1 = e1->node;
 	n2 = e2->node;
-	prev = 0;
+	prev = NULL;
 	while (n1 || n2) {
 		new = kmalloc(sizeof(*new), GFP_ATOMIC);
 		if (!new) {
@@ -40,7 +40,7 @@ int ebitmap_or(struct ebitmap *dst, struct ebitmap *e1, struct ebitmap *e2)
 			n2 = n2->next;
 		}
 
-		new->next = 0;
+		new->next = NULL;
 		if (prev)
 			prev->next = new;
 		else
@@ -80,7 +80,7 @@ int ebitmap_cpy(struct ebitmap *dst, struct ebitmap *src)
 
 	ebitmap_init(dst);
 	n = src->node;
-	prev = 0;
+	prev = NULL;
 	while (n) {
 		new = kmalloc(sizeof(*new), GFP_ATOMIC);
 		if (!new) {
@@ -90,7 +90,7 @@ int ebitmap_cpy(struct ebitmap *dst, struct ebitmap *src)
 		memset(new, 0, sizeof(*new));
 		new->startbit = n->startbit;
 		new->map = n->map;
-		new->next = 0;
+		new->next = NULL;
 		if (prev)
 			prev->next = new;
 		else
@@ -155,7 +155,7 @@ int ebitmap_set_bit(struct ebitmap *e, unsigned long bit, int value)
 {
 	struct ebitmap_node *n, *prev, *new;
 
-	prev = 0;
+	prev = NULL;
 	n = e->node;
 	while (n && n->startbit <= bit) {
 		if ((n->startbit + MAPSIZE) > bit) {
@@ -231,7 +231,7 @@ void ebitmap_destroy(struct ebitmap *e)
 	}
 
 	e->highbit = 0;
-	e->node = 0;
+	e->node = NULL;
 	return;
 }
 
diff --git a/security/selinux/ss/mls.c b/security/selinux/ss/mls.c
index f54ad88d4..9f0614150 100644
--- a/security/selinux/ss/mls.c
+++ b/security/selinux/ss/mls.c
@@ -654,7 +654,7 @@ int cat_destroy(void *key, void *datum, void *p)
 
 int sens_read(struct policydb *p, struct hashtab *h, void *fp)
 {
-	char *key = 0;
+	char *key = NULL;
 	struct level_datum *levdatum;
 	int rc;
 	u32 *buf, len;
@@ -707,7 +707,7 @@ bad:
 
 int cat_read(struct policydb *p, struct hashtab *h, void *fp)
 {
-	char *key = 0;
+	char *key = NULL;
 	struct cat_datum *catdatum;
 	int rc;
 	u32 *buf, len;
diff --git a/security/selinux/ss/policydb.c b/security/selinux/ss/policydb.c
index d98bb8dfe..e10ed0e1e 100644
--- a/security/selinux/ss/policydb.c
+++ b/security/selinux/ss/policydb.c
@@ -38,6 +38,8 @@ static char *symtab_name[SYM_NUM] = {
 };
 #endif
 
+int policydb_loaded_version;
+
 static unsigned int symtab_sizes[SYM_NUM] = {
 	2,
 	32,
@@ -71,6 +73,11 @@ static struct policydb_compat_info policydb_compat[] = {
 		.sym_num        = SYM_NUM,
 		.ocon_num       = OCON_NUM,
 	},
+	{
+		.version        = POLICYDB_VERSION_NLCLASS,
+		.sym_num        = SYM_NUM,
+		.ocon_num       = OCON_NUM,
+	},
 };
 
 static struct policydb_compat_info *policydb_lookup_compat(int version)
@@ -92,7 +99,7 @@ static struct policydb_compat_info *policydb_lookup_compat(int version)
  */
 int roles_init(struct policydb *p)
 {
-	char *key = 0;
+	char *key = NULL;
 	int rc;
 	struct role_datum *role;
 
@@ -395,7 +402,7 @@ static int common_destroy(void *key, void *datum, void *p)
 
 	kfree(key);
 	comdatum = datum;
-	hashtab_map(comdatum->permissions.table, perm_destroy, 0);
+	hashtab_map(comdatum->permissions.table, perm_destroy, NULL);
 	hashtab_destroy(comdatum->permissions.table);
 	kfree(datum);
 	return 0;
@@ -409,7 +416,7 @@ static int class_destroy(void *key, void *datum, void *p)
 
 	kfree(key);
 	cladatum = datum;
-	hashtab_map(cladatum->permissions.table, perm_destroy, 0);
+	hashtab_map(cladatum->permissions.table, perm_destroy, NULL);
 	hashtab_destroy(cladatum->permissions.table);
 	constraint = cladatum->constraints;
 	while (constraint) {
@@ -491,7 +498,7 @@ void policydb_destroy(struct policydb *p)
 	int i;
 
 	for (i = 0; i < SYM_NUM; i++) {
-		hashtab_map(p->symtab[i].table, destroy_f[i], 0);
+		hashtab_map(p->symtab[i].table, destroy_f[i], NULL);
 		hashtab_destroy(p->symtab[i].table);
 	}
 
@@ -662,7 +669,7 @@ out:
 
 static int perm_read(struct policydb *p, struct hashtab *h, void *fp)
 {
-	char *key = 0;
+	char *key = NULL;
 	struct perm_datum *perdatum;
 	int rc;
 	u32 *buf, len;
@@ -711,7 +718,7 @@ bad:
 
 static int common_read(struct policydb *p, struct hashtab *h, void *fp)
 {
-	char *key = 0;
+	char *key = NULL;
 	struct common_datum *comdatum;
 	u32 *buf, len, nel;
 	int i, rc;
@@ -769,7 +776,7 @@ bad:
 
 static int class_read(struct policydb *p, struct hashtab *h, void *fp)
 {
-	char *key = 0;
+	char *key = NULL;
 	struct class_datum *cladatum;
 	struct constraint_node *c, *lc;
 	struct constraint_expr *e, *le;
@@ -936,7 +943,7 @@ bad:
 
 static int role_read(struct policydb *p, struct hashtab *h, void *fp)
 {
-	char *key = 0;
+	char *key = NULL;
 	struct role_datum *role;
 	int rc;
 	u32 *buf, len;
@@ -1001,7 +1008,7 @@ bad:
 
 static int type_read(struct policydb *p, struct hashtab *h, void *fp)
 {
-	char *key = 0;
+	char *key = NULL;
 	struct type_datum *typdatum;
 	int rc;
 	u32 *buf, len;
@@ -1048,7 +1055,7 @@ bad:
 
 static int user_read(struct policydb *p, struct hashtab *h, void *fp)
 {
-	char *key = 0;
+	char *key = NULL;
 	struct user_datum *usrdatum;
 	int rc;
 	u32 *buf, len;
@@ -1125,7 +1132,7 @@ int policydb_read(struct policydb *p, void *fp)
 	struct role_trans *tr, *ltr;
 	struct ocontext *l, *c, *newc;
 	struct genfs *genfs_p, *genfs, *newgenfs;
-	int i, j, rc, r_policyvers;
+	int i, j, rc, r_policyvers = 0;
 	u32 *buf, len, len2, config, nprim, nel, nel2;
 	char *policydb_str;
 	struct policydb_compat_info *info;
@@ -1546,6 +1553,7 @@ int policydb_read(struct policydb *p, void *fp)
 	if (rc)
 		goto bad;
 out:
+	policydb_loaded_version = r_policyvers;
 	return rc;
 bad_newc:
 	ocontext_destroy(newc,OCON_FSUSE);
diff --git a/security/selinux/ss/services.c b/security/selinux/ss/services.c
index 21ab4c975..8e4423b1c 100644
--- a/security/selinux/ss/services.c
+++ b/security/selinux/ss/services.c
@@ -40,6 +40,7 @@
 #include "mls.h"
 
 extern void selnl_notify_policyload(u32 seqno);
+extern int policydb_loaded_version;
 
 static rwlock_t policy_rwlock = RW_LOCK_UNLOCKED;
 #define POLICY_RDLOCK read_lock(&policy_rwlock)
@@ -203,6 +204,17 @@ static int context_struct_compute_av(struct context *scontext,
 	struct avtab_datum *avdatum;
 	struct class_datum *tclass_datum;
 
+	/*
+	 * Remap extended Netlink classes for old policy versions.
+	 * Do this here rather than socket_type_to_security_class()
+	 * in case a newer policy version is loaded, allowing sockets
+	 * to remain in the correct class.
+	 */
+	if (policydb_loaded_version < POLICYDB_VERSION_NLCLASS)
+		if (tclass >= SECCLASS_NETLINK_ROUTE_SOCKET &&
+		    tclass <= SECCLASS_NETLINK_DNRT_SOCKET)
+			tclass = SECCLASS_NETLINK_SOCKET;
+
 	if (!tclass || tclass > policydb.p_classes.nprim) {
 		printk(KERN_ERR "security_compute_av:  unrecognized class %d\n",
 		       tclass);
@@ -296,7 +308,7 @@ int security_compute_av(u32 ssid,
 			u32 requested,
 			struct av_decision *avd)
 {
-	struct context *scontext = 0, *tcontext = 0;
+	struct context *scontext = NULL, *tcontext = NULL;
 	int rc = 0;
 
 	if (!ss_initialized) {
@@ -343,7 +355,7 @@ int context_struct_to_string(struct context *context, char **scontext, u32 *scon
 {
 	char *scontextp;
 
-	*scontext = 0;
+	*scontext = NULL;
 	*scontext_len = 0;
 
 	/* Compute the size of the context. */
@@ -588,8 +600,8 @@ static int security_compute_sid(u32 ssid,
 				u32 specified,
 				u32 *out_sid)
 {
-	struct context *scontext = 0, *tcontext = 0, newcontext;
-	struct role_trans *roletr = 0;
+	struct context *scontext = NULL, *tcontext = NULL, newcontext;
+	struct role_trans *roletr = NULL;
 	struct avtab_key avkey;
 	struct avtab_datum *avdatum;
 	struct avtab_node *node;
diff --git a/sound/Kconfig b/sound/Kconfig
index bfd4b6ab2..56f5cc726 100644
--- a/sound/Kconfig
+++ b/sound/Kconfig
@@ -70,7 +70,7 @@ source "sound/parisc/Kconfig"
 endmenu
 
 menu "Open Sound System"
-	depends on SOUND!=n
+	depends on SOUND!=n && (BROKEN || !SPARC64)
 
 config SOUND_PRIME
 	tristate "Open Sound System (DEPRECATED)"
diff --git a/sound/core/control.c b/sound/core/control.c
index 7cc19394d..c39afa644 100644
--- a/sound/core/control.c
+++ b/sound/core/control.c
@@ -1137,15 +1137,16 @@ static ssize_t snd_ctl_read(struct file *file, char __user *buffer, size_t count
 		kfree(kev);
 		if (copy_to_user(buffer, &ev, sizeof(snd_ctl_event_t))) {
 			err = -EFAULT;
-			goto __end;
+			goto out;
 		}
 		spin_lock_irq(&ctl->read_lock);
 		buffer += sizeof(snd_ctl_event_t);
 		count -= sizeof(snd_ctl_event_t);
 		result += sizeof(snd_ctl_event_t);
 	}
-      __end:
+__end:
 	spin_unlock_irq(&ctl->read_lock);
+out:
       	return result > 0 ? result : err;
 }
 
diff --git a/sound/core/info.c b/sound/core/info.c
index 0b08203d5..1eb7d916a 100644
--- a/sound/core/info.c
+++ b/sound/core/info.c
@@ -181,30 +181,37 @@ static ssize_t snd_info_entry_read(struct file *file, char __user *buffer,
 	struct snd_info_entry *entry;
 	snd_info_buffer_t *buf;
 	size_t size = 0;
+	loff_t pos;
 
 	data = snd_magic_cast(snd_info_private_data_t, file->private_data, return -ENXIO);
 	snd_assert(data != NULL, return -ENXIO);
+	pos = *offset;
+	if (pos < 0 || (long) pos != pos || (ssize_t) count < 0)
+		return -EIO;
+	if ((unsigned long) pos + (unsigned long) count < (unsigned long) pos)
+		return -EIO;
 	entry = data->entry;
 	switch (entry->content) {
 	case SNDRV_INFO_CONTENT_TEXT:
 		buf = data->rbuffer;
 		if (buf == NULL)
 			return -EIO;
-		if (file->f_pos >= (long)buf->size)
+		if (pos >= buf->size)
 			return 0;
-		size = buf->size - file->f_pos;
+		size = buf->size - pos;
 		size = min(count, size);
-		if (copy_to_user(buffer, buf->buffer + file->f_pos, size))
+		if (copy_to_user(buffer, buf->buffer + pos, size))
 			return -EFAULT;
-		file->f_pos += size;
 		break;
 	case SNDRV_INFO_CONTENT_DATA:
 		if (entry->c.ops->read)
-			return entry->c.ops->read(entry,
+			size = entry->c.ops->read(entry,
 						  data->file_private_data,
-						  file, buffer, count);
+						  file, buffer, count, pos);
 		break;
 	}
+	if ((ssize_t) size > 0)
+		*offset = pos + size;
 	return size;
 }
 
@@ -215,34 +222,39 @@ static ssize_t snd_info_entry_write(struct file *file, const char __user *buffer
 	struct snd_info_entry *entry;
 	snd_info_buffer_t *buf;
 	size_t size = 0;
+	loff_t pos;
 
 	data = snd_magic_cast(snd_info_private_data_t, file->private_data, return -ENXIO);
 	snd_assert(data != NULL, return -ENXIO);
 	entry = data->entry;
+	pos = *offset;
+	if (pos < 0 || (long) pos != pos || (ssize_t) count < 0)
+		return -EIO;
+	if ((unsigned long) pos + (unsigned long) count < (unsigned long) pos)
+		return -EIO;
 	switch (entry->content) {
 	case SNDRV_INFO_CONTENT_TEXT:
 		buf = data->wbuffer;
 		if (buf == NULL)
 			return -EIO;
-		if (file->f_pos < 0)
-			return -EINVAL;
-		if (file->f_pos >= (long)buf->len)
+		if (pos >= buf->len)
 			return -ENOMEM;
-		size = buf->len - file->f_pos;
+		size = buf->len - pos;
 		size = min(count, size);
-		if (copy_from_user(buf->buffer + file->f_pos, buffer, size))
+		if (copy_from_user(buf->buffer + pos, buffer, size))
 			return -EFAULT;
-		if ((long)buf->size < file->f_pos + size)
-			buf->size = file->f_pos + size;
-		file->f_pos += size;
+		if ((long)buf->size < pos + size)
+			buf->size = pos + size;
 		break;
 	case SNDRV_INFO_CONTENT_DATA:
 		if (entry->c.ops->write)
-			return entry->c.ops->write(entry,
+			size = entry->c.ops->write(entry,
 						   data->file_private_data,
-						   file, buffer, count);
+						   file, buffer, count, pos);
 		break;
 	}
+	if ((ssize_t) size > 0)
+		*offset = pos + size;
 	return size;
 }
 
diff --git a/sound/core/ioctl32/hwdep32.c b/sound/core/ioctl32/hwdep32.c
index 3b67346e0..8682e8cab 100644
--- a/sound/core/ioctl32/hwdep32.c
+++ b/sound/core/ioctl32/hwdep32.c
@@ -37,16 +37,16 @@ struct sndrv_hwdep_dsp_image32 {
 static int _snd_ioctl32_hwdep_dsp_image(unsigned int fd, unsigned int cmd, unsigned long arg, struct file *file, unsigned int native_ctl)
 {
 	struct sndrv_hwdep_dsp_image data;
-	struct sndrv_hwdep_dsp_image data32;
+	struct sndrv_hwdep_dsp_image32 data32;
 	mm_segment_t oldseg;
 	int err;
 
-	if (copy_from_user(&data32, (void*)arg, sizeof(data32)))
+	if (copy_from_user(&data32, (void __user *)arg, sizeof(data32)))
 		return -EFAULT;
 	memset(&data, 0, sizeof(data));
 	data.index = data32.index;
 	memcpy(data.name, data32.name, sizeof(data.name));
-	data.image = A(data32.image);
+	data.image = compat_ptr(data32.image);
 	data.length = data32.length;
 	data.driver_data = data32.driver_data;
 	oldseg = get_fs();
diff --git a/sound/core/ioctl32/ioctl32.c b/sound/core/ioctl32/ioctl32.c
index b9e8a97c0..5c0d30c77 100644
--- a/sound/core/ioctl32/ioctl32.c
+++ b/sound/core/ioctl32/ioctl32.c
@@ -109,14 +109,14 @@ static int _snd_ioctl32_ctl_elem_list(unsigned int fd, unsigned int cmd, unsigne
 	mm_segment_t oldseg;
 	int err;
 
-	if (copy_from_user(&data32, (void*)arg, sizeof(data32)))
+	if (copy_from_user(&data32, (void __user *)arg, sizeof(data32)))
 		return -EFAULT;
 	memset(&data, 0, sizeof(data));
 	data.offset = data32.offset;
 	data.space = data32.space;
 	data.used = data32.used;
 	data.count = data32.count;
-	data.pids = A(data32.pids);
+	data.pids = compat_ptr(data32.pids);
 	oldseg = get_fs();
 	set_fs(KERNEL_DS);
 	err = file->f_op->ioctl(file->f_dentry->d_inode, file, native_ctl, (unsigned long)&data);
@@ -129,7 +129,7 @@ static int _snd_ioctl32_ctl_elem_list(unsigned int fd, unsigned int cmd, unsigne
 	data32.used = data.used;
 	data32.count = data.count;
 	//data.pids = data.pids;
-	if (copy_to_user((void*)arg, &data32, sizeof(data32)))
+	if (copy_to_user((void __user *)arg, &data32, sizeof(data32)))
 		return -EFAULT;
 	return 0;
 }
@@ -175,7 +175,7 @@ static int _snd_ioctl32_ctl_elem_info(unsigned int fd, unsigned int cmd, unsigne
 	int err;
 	mm_segment_t oldseg;
 
-	if (copy_from_user(&data32, (void*)arg, sizeof(data32)))
+	if (copy_from_user(&data32, (void __user *)arg, sizeof(data32)))
 		return -EFAULT;
 	memset(&data, 0, sizeof(data));
 	data.id = data32.id;
@@ -216,7 +216,7 @@ static int _snd_ioctl32_ctl_elem_info(unsigned int fd, unsigned int cmd, unsigne
 	default:
 		break;
 	}
-	if (copy_to_user((void*)arg, &data32, sizeof(data32)))
+	if (copy_to_user((void __user *)arg, &data32, sizeof(data32)))
 		return -EFAULT;
 	return 0;
 }
@@ -291,7 +291,7 @@ static int _snd_ioctl32_ctl_elem_value(unsigned int fd, unsigned int cmd, unsign
 		goto __end;
 	}
 
-	if (copy_from_user(data32, (void*)arg, sizeof(*data32))) {
+	if (copy_from_user(data32, (void __user *)arg, sizeof(*data32))) {
 		err = -EFAULT;
 		goto __end;
 	}
@@ -299,7 +299,7 @@ static int _snd_ioctl32_ctl_elem_value(unsigned int fd, unsigned int cmd, unsign
 	data->id = data32->id;
 	data->indirect = data32->indirect;
 	if (data->indirect) /* FIXME: this is not correct for long arrays */
-		data->value.integer.value_ptr = (void*)TO_PTR(data32->value.integer.value_ptr);
+		data->value.integer.value_ptr = compat_ptr(data32->value.integer.value_ptr);
 	type = get_ctl_type(file, &data->id);
 	if (type < 0) {
 		err = type;
@@ -367,7 +367,7 @@ static int _snd_ioctl32_ctl_elem_value(unsigned int fd, unsigned int cmd, unsign
 		}
 	}
 	err = 0;
-	if (copy_to_user((void*)arg, data32, sizeof(*data32)))
+	if (copy_to_user((void __user *)arg, data32, sizeof(*data32)))
 		err = -EFAULT;
       __end:
       	if (data32)
diff --git a/sound/core/ioctl32/ioctl32.h b/sound/core/ioctl32/ioctl32.h
index e59d38210..39887cc3b 100644
--- a/sound/core/ioctl32/ioctl32.h
+++ b/sound/core/ioctl32/ioctl32.h
@@ -26,19 +26,10 @@
 #ifndef __ALSA_IOCTL32_H
 #define __ALSA_IOCTL32_H
 
-#ifndef A
-#ifdef CONFIG_PPC64
-#include <asm/ppc32.h>
-#else
-/* x86-64, sparc64 */
-#define A(__x) ((void *)(unsigned long)(__x))
-#endif
-#endif
-
-#define TO_PTR(x)  A(x)
+#include <linux/compat.h>
 
 #define COPY(x)  (dst->x = src->x)
-#define CPTR(x)	 (dst->x = (typeof(dst->x))A(src->x))
+#define CPTR(x)	 (dst->x = compat_ptr(src->x))
 
 #define convert_from_32(type, dstp, srcp)\
 {\
@@ -62,7 +53,7 @@ static int _snd_ioctl32_##type(unsigned int fd, unsigned int cmd, unsigned long
 	struct sndrv_##type data;\
 	mm_segment_t oldseg;\
 	int err;\
-	if (copy_from_user(&data32, (void*)arg, sizeof(data32)))\
+	if (copy_from_user(&data32, (void __user *)arg, sizeof(data32)))\
 		return -EFAULT;\
 	memset(&data, 0, sizeof(data));\
 	convert_from_32(type, &data, &data32);\
@@ -74,7 +65,7 @@ static int _snd_ioctl32_##type(unsigned int fd, unsigned int cmd, unsigned long
 		return err;\
 	if (native_ctl & (_IOC_READ << _IOC_DIRSHIFT)) {\
 		convert_to_32(type, &data32, &data);\
-		if (copy_to_user((void*)arg, &data32, sizeof(data32)))\
+		if (copy_to_user((void __user *)arg, &data32, sizeof(data32)))\
 			return -EFAULT;\
 	}\
 	return 0;\
@@ -93,7 +84,7 @@ static int _snd_ioctl32_##type(unsigned int fd, unsigned int cmd, unsigned long
 		err = -ENOMEM; \
 		goto __end; \
 	}\
-	if (copy_from_user(data32, (void*)arg, sizeof(*data32))) { \
+	if (copy_from_user(data32, (void __user *)arg, sizeof(*data32))) { \
 		err = -EFAULT; \
 		goto __end; \
 	}\
@@ -108,7 +99,7 @@ static int _snd_ioctl32_##type(unsigned int fd, unsigned int cmd, unsigned long
 	err = 0;\
 	if (native_ctl & (_IOC_READ << _IOC_DIRSHIFT)) {\
 		convert_to_32(type, data32, data);\
-		if (copy_to_user((void*)arg, data32, sizeof(*data32)))\
+		if (copy_to_user((void __user *)arg, data32, sizeof(*data32)))\
 			err = -EFAULT;\
 	}\
       __end:\
diff --git a/sound/core/ioctl32/pcm32.c b/sound/core/ioctl32/pcm32.c
index e259f49cc..41ea1dabe 100644
--- a/sound/core/ioctl32/pcm32.c
+++ b/sound/core/ioctl32/pcm32.c
@@ -189,11 +189,11 @@ static int _snd_ioctl32_xferi(unsigned int fd, unsigned int cmd, unsigned long a
 	mm_segment_t oldseg;
 	int err;
 
-	if (copy_from_user(&data32, (void*)arg, sizeof(data32)))
+	if (copy_from_user(&data32, (void __user *)arg, sizeof(data32)))
 		return -EFAULT;
 	memset(&data, 0, sizeof(data));
 	data.result = data32.result;
-	data.buf = A(data32.buf);
+	data.buf = compat_ptr(data32.buf);
 	data.frames = data32.frames;
 	oldseg = get_fs();
 	set_fs(KERNEL_DS);
@@ -203,7 +203,7 @@ static int _snd_ioctl32_xferi(unsigned int fd, unsigned int cmd, unsigned long a
 		return err;
 	/* copy the result */
 	data32.result = data.result;
-	if (copy_to_user((void*)arg, &data32, sizeof(data32)))
+	if (copy_to_user((void __user *)arg, &data32, sizeof(data32)))
 		return -EFAULT;
 	return 0;
 }
@@ -226,10 +226,11 @@ static int _snd_ioctl32_xfern(unsigned int fd, unsigned int cmd, unsigned long a
 {
 	snd_pcm_file_t *pcm_file;
 	snd_pcm_substream_t *substream;
-	struct sndrv_xfern32 data32, *srcptr = (struct sndrv_xfern32*)arg;
-	void **bufs = NULL;
+	struct sndrv_xfern32 data32;
+	struct sndrv_xfern32 __user *srcptr = (void __user *)arg;
+	void __user **bufs = NULL;
 	int err = 0, ch, i;
-	u32 *bufptr;
+	u32 __user *bufptr;
 	mm_segment_t oldseg;
 
 	/* FIXME: need to check whether fop->ioctl is sane */
@@ -256,7 +257,7 @@ static int _snd_ioctl32_xfern(unsigned int fd, unsigned int cmd, unsigned long a
 	if (get_user(data32.frames, &srcptr->frames))
 		return -EFAULT;
 	__get_user(data32.bufs, &srcptr->bufs);
-	bufptr = (u32*)TO_PTR(data32.bufs);
+	bufptr = compat_ptr(data32.bufs);
 	bufs = kmalloc(sizeof(void *) * 128, GFP_KERNEL);
 	if (bufs == NULL)
 		return -ENOMEM;
@@ -264,7 +265,7 @@ static int _snd_ioctl32_xfern(unsigned int fd, unsigned int cmd, unsigned long a
 		u32 ptr;
 		if (get_user(ptr, bufptr))
 			return -EFAULT;
-		bufs[ch] = (void*)TO_PTR(ptr);
+		bufs[ch] = compat_ptr(ptr);
 		bufptr++;
 	}
 	oldseg = get_fs();
@@ -355,7 +356,7 @@ static int _snd_ioctl32_pcm_hw_params_old(unsigned int fd, unsigned int cmd, uns
 		err = -ENOMEM;
 		goto __end;
 	}
-	if (copy_from_user(data32, (void*)arg, sizeof(*data32))) {
+	if (copy_from_user(data32, (void __user *)arg, sizeof(*data32))) {
 		err = -EFAULT;
 		goto __end;
 	}
@@ -368,7 +369,7 @@ static int _snd_ioctl32_pcm_hw_params_old(unsigned int fd, unsigned int cmd, uns
 		goto __end;
 	snd_pcm_hw_convert_to_old_params(data32, data);
 	err = 0;
-	if (copy_to_user((void*)arg, data32, sizeof(*data32)))
+	if (copy_to_user((void __user *)arg, data32, sizeof(*data32)))
 		err = -EFAULT;
       __end:
       	if (data)
diff --git a/sound/core/memalloc.c b/sound/core/memalloc.c
index 3cf091774..bc1e344e3 100644
--- a/sound/core/memalloc.c
+++ b/sound/core/memalloc.c
@@ -807,7 +807,7 @@ static int snd_mem_proc_read(char *page, char **start, off_t off,
 static int __init snd_mem_init(void)
 {
 #ifdef CONFIG_PROC_FS
-	create_proc_read_entry("driver/snd-page-alloc", 0, 0, snd_mem_proc_read, NULL);
+	create_proc_read_entry("driver/snd-page-alloc", 0, NULL, snd_mem_proc_read, NULL);
 #endif
 	preallocate_cards();
 	return 0;
diff --git a/sound/core/oss/pcm_oss.c b/sound/core/oss/pcm_oss.c
index 65b5017e4..099d230f3 100644
--- a/sound/core/oss/pcm_oss.c
+++ b/sound/core/oss/pcm_oss.c
@@ -192,7 +192,7 @@ static int snd_pcm_oss_period_size(snd_pcm_substream_t *substream,
 			 params_channels(oss_params) / 8;
 
 	oss_buffer_size = snd_pcm_plug_client_size(substream,
-						   snd_pcm_hw_param_value_max(slave_params, SNDRV_PCM_HW_PARAM_BUFFER_SIZE, 0)) * oss_frame_size;
+						   snd_pcm_hw_param_value_max(slave_params, SNDRV_PCM_HW_PARAM_BUFFER_SIZE, NULL)) * oss_frame_size;
 	oss_buffer_size = 1 << ld2(oss_buffer_size);
 	if (atomic_read(&runtime->mmap_count)) {
 		if (oss_buffer_size > runtime->oss.mmap_bytes)
@@ -228,14 +228,14 @@ static int snd_pcm_oss_period_size(snd_pcm_substream_t *substream,
 	}
 
 	min_period_size = snd_pcm_plug_client_size(substream,
-						   snd_pcm_hw_param_value_min(slave_params, SNDRV_PCM_HW_PARAM_PERIOD_SIZE, 0));
+						   snd_pcm_hw_param_value_min(slave_params, SNDRV_PCM_HW_PARAM_PERIOD_SIZE, NULL));
 	min_period_size *= oss_frame_size;
 	min_period_size = 1 << (ld2(min_period_size - 1) + 1);
 	if (oss_period_size < min_period_size)
 		oss_period_size = min_period_size;
 
 	max_period_size = snd_pcm_plug_client_size(substream,
-						   snd_pcm_hw_param_value_max(slave_params, SNDRV_PCM_HW_PARAM_PERIOD_SIZE, 0));
+						   snd_pcm_hw_param_value_max(slave_params, SNDRV_PCM_HW_PARAM_PERIOD_SIZE, NULL));
 	max_period_size *= oss_frame_size;
 	max_period_size = 1 << ld2(max_period_size);
 	if (oss_period_size > max_period_size)
@@ -248,13 +248,13 @@ static int snd_pcm_oss_period_size(snd_pcm_substream_t *substream,
 			oss_periods = substream->oss.setup->periods;
 	}
 
-	s = snd_pcm_hw_param_value_max(slave_params, SNDRV_PCM_HW_PARAM_PERIODS, 0);
+	s = snd_pcm_hw_param_value_max(slave_params, SNDRV_PCM_HW_PARAM_PERIODS, NULL);
 	if (runtime->oss.maxfrags && s > runtime->oss.maxfrags)
 		s = runtime->oss.maxfrags;
 	if (oss_periods > s)
 		oss_periods = s;
 
-	s = snd_pcm_hw_param_value_min(slave_params, SNDRV_PCM_HW_PARAM_PERIODS, 0);
+	s = snd_pcm_hw_param_value_min(slave_params, SNDRV_PCM_HW_PARAM_PERIODS, NULL);
 	if (s < 2)
 		s = 2;
 	if (oss_periods < s)
@@ -307,7 +307,7 @@ static int choose_rate(snd_pcm_substream_t *substream,
 
 	/* not found, use the nearest rate */
 	kfree(save);
-	return snd_pcm_hw_param_near(substream, params, SNDRV_PCM_HW_PARAM_RATE, best_rate, 0);
+	return snd_pcm_hw_param_near(substream, params, SNDRV_PCM_HW_PARAM_RATE, best_rate, NULL);
 }
 
 static int snd_pcm_oss_change_params(snd_pcm_substream_t *substream)
@@ -357,7 +357,7 @@ static int snd_pcm_oss_change_params(snd_pcm_substream_t *substream)
 		goto failure;
 	}
 	choose_rate(substream, sparams, runtime->oss.rate);
-	snd_pcm_hw_param_near(substream, sparams, SNDRV_PCM_HW_PARAM_CHANNELS, runtime->oss.channels, 0);
+	snd_pcm_hw_param_near(substream, sparams, SNDRV_PCM_HW_PARAM_CHANNELS, runtime->oss.channels, NULL);
 
 	format = snd_pcm_oss_format_from(runtime->oss.format);
 
@@ -440,14 +440,14 @@ static int snd_pcm_oss_change_params(snd_pcm_substream_t *substream)
 		goto failure;
 
 	n = snd_pcm_plug_slave_size(substream, runtime->oss.period_bytes / oss_frame_size);
-	err = snd_pcm_hw_param_near(substream, sparams, SNDRV_PCM_HW_PARAM_PERIOD_SIZE, n, 0);
+	err = snd_pcm_hw_param_near(substream, sparams, SNDRV_PCM_HW_PARAM_PERIOD_SIZE, n, NULL);
 	snd_assert(err >= 0, goto failure);
 
 	err = snd_pcm_hw_param_near(substream, sparams, SNDRV_PCM_HW_PARAM_PERIODS,
-				     runtime->oss.periods, 0);
+				     runtime->oss.periods, NULL);
 	snd_assert(err >= 0, goto failure);
 
-	snd_pcm_kernel_ioctl(substream, SNDRV_PCM_IOCTL_DROP, 0);
+	snd_pcm_kernel_ioctl(substream, SNDRV_PCM_IOCTL_DROP, NULL);
 
 	if ((err = snd_pcm_kernel_ioctl(substream, SNDRV_PCM_IOCTL_HW_PARAMS, sparams)) < 0) {
 		snd_printd("HW_PARAMS failed: %i\n", err);
@@ -564,7 +564,7 @@ static int snd_pcm_oss_prepare(snd_pcm_substream_t *substream)
 	int err;
 	snd_pcm_runtime_t *runtime = substream->runtime;
 
-	err = snd_pcm_kernel_ioctl(substream, SNDRV_PCM_IOCTL_PREPARE, 0);
+	err = snd_pcm_kernel_ioctl(substream, SNDRV_PCM_IOCTL_PREPARE, NULL);
 	if (err < 0) {
 		snd_printd("snd_pcm_oss_prepare: SNDRV_PCM_IOCTL_PREPARE failed\n");
 		return err;
@@ -672,7 +672,7 @@ snd_pcm_sframes_t snd_pcm_oss_read3(snd_pcm_substream_t *substream, char *ptr, s
 			else
 				printk("pcm_oss: read: recovering from SUSPEND\n");
 #endif
-			ret = snd_pcm_kernel_ioctl(substream, SNDRV_PCM_IOCTL_DRAIN, 0);
+			ret = snd_pcm_kernel_ioctl(substream, SNDRV_PCM_IOCTL_DRAIN, NULL);
 			if (ret < 0)
 				break;
 		} else if (runtime->status->state == SNDRV_PCM_STATE_SETUP) {
@@ -693,7 +693,7 @@ snd_pcm_sframes_t snd_pcm_oss_read3(snd_pcm_substream_t *substream, char *ptr, s
 		}
 		if (ret == -EPIPE) {
 			if (runtime->status->state == SNDRV_PCM_STATE_DRAINING) {
-				ret = snd_pcm_kernel_ioctl(substream, SNDRV_PCM_IOCTL_DROP, 0);
+				ret = snd_pcm_kernel_ioctl(substream, SNDRV_PCM_IOCTL_DROP, NULL);
 				if (ret < 0)
 					break;
 			}
@@ -754,7 +754,7 @@ snd_pcm_sframes_t snd_pcm_oss_readv3(snd_pcm_substream_t *substream, void **bufs
 			else
 				printk("pcm_oss: readv: recovering from SUSPEND\n");
 #endif
-			ret = snd_pcm_kernel_ioctl(substream, SNDRV_PCM_IOCTL_DRAIN, 0);
+			ret = snd_pcm_kernel_ioctl(substream, SNDRV_PCM_IOCTL_DRAIN, NULL);
 			if (ret < 0)
 				break;
 		} else if (runtime->status->state == SNDRV_PCM_STATE_SETUP) {
@@ -932,12 +932,12 @@ static int snd_pcm_oss_reset(snd_pcm_oss_file_t *pcm_oss_file)
 
 	substream = pcm_oss_file->streams[SNDRV_PCM_STREAM_PLAYBACK];
 	if (substream != NULL) {
-		snd_pcm_kernel_playback_ioctl(substream, SNDRV_PCM_IOCTL_DROP, 0);
+		snd_pcm_kernel_playback_ioctl(substream, SNDRV_PCM_IOCTL_DROP, NULL);
 		substream->runtime->oss.prepare = 1;
 	}
 	substream = pcm_oss_file->streams[SNDRV_PCM_STREAM_CAPTURE];
 	if (substream != NULL) {
-		snd_pcm_kernel_capture_ioctl(substream, SNDRV_PCM_IOCTL_DROP, 0);
+		snd_pcm_kernel_capture_ioctl(substream, SNDRV_PCM_IOCTL_DROP, NULL);
 		substream->runtime->oss.prepare = 1;
 	}
 	return 0;
@@ -952,7 +952,7 @@ static int snd_pcm_oss_post(snd_pcm_oss_file_t *pcm_oss_file)
 	if (substream != NULL) {
 		if ((err = snd_pcm_oss_make_ready(substream)) < 0)
 			return err;
-		snd_pcm_kernel_playback_ioctl(substream, SNDRV_PCM_IOCTL_START, 0);
+		snd_pcm_kernel_playback_ioctl(substream, SNDRV_PCM_IOCTL_START, NULL);
 	}
 	/* note: all errors from the start action are ignored */
 	/* OSS apps do not know, how to handle them */
@@ -1078,7 +1078,7 @@ static int snd_pcm_oss_sync(snd_pcm_oss_file_t *pcm_oss_file)
 	      __direct:
 		saved_f_flags = substream->ffile->f_flags;
 		substream->ffile->f_flags &= ~O_NONBLOCK;
-		err = snd_pcm_kernel_playback_ioctl(substream, SNDRV_PCM_IOCTL_DRAIN, 0);
+		err = snd_pcm_kernel_playback_ioctl(substream, SNDRV_PCM_IOCTL_DRAIN, NULL);
 		substream->ffile->f_flags = saved_f_flags;
 		if (err < 0)
 			return err;
@@ -1090,7 +1090,7 @@ static int snd_pcm_oss_sync(snd_pcm_oss_file_t *pcm_oss_file)
 		if ((err = snd_pcm_oss_make_ready(substream)) < 0)
 			return err;
 		runtime = substream->runtime;
-		err = snd_pcm_kernel_capture_ioctl(substream, SNDRV_PCM_IOCTL_DROP, 0);
+		err = snd_pcm_kernel_capture_ioctl(substream, SNDRV_PCM_IOCTL_DROP, NULL);
 		if (err < 0)
 			return err;
 		runtime->oss.buffer_used = 0;
@@ -1402,7 +1402,7 @@ static int snd_pcm_oss_set_trigger(snd_pcm_oss_file_t *pcm_oss_file, int trigger
 			cmd = SNDRV_PCM_IOCTL_DROP;
 			runtime->oss.prepare = 1;
 		}
-		err = snd_pcm_kernel_playback_ioctl(psubstream, cmd, 0);
+		err = snd_pcm_kernel_playback_ioctl(psubstream, cmd, NULL);
 		if (err < 0)
 			return err;
 	}
@@ -1423,7 +1423,7 @@ static int snd_pcm_oss_set_trigger(snd_pcm_oss_file_t *pcm_oss_file, int trigger
 			cmd = SNDRV_PCM_IOCTL_DROP;
 			runtime->oss.prepare = 1;
 		}
-		err = snd_pcm_kernel_capture_ioctl(csubstream, cmd, 0);
+		err = snd_pcm_kernel_capture_ioctl(csubstream, cmd, NULL);
 		if (err < 0)
 			return err;
 	}
diff --git a/sound/core/oss/pcm_plugin.c b/sound/core/oss/pcm_plugin.c
index 958cc3fd5..6fd63ca66 100644
--- a/sound/core/oss/pcm_plugin.c
+++ b/sound/core/oss/pcm_plugin.c
@@ -797,7 +797,7 @@ snd_pcm_sframes_t snd_pcm_plug_write_transfer(snd_pcm_plug_t *plug, snd_pcm_plug
 					frames = plugin->src_frames(plugin, frames1);
 			}
 		} else
-			dst_channels = 0;
+			dst_channels = NULL;
 		pdprintf("write plugin: %s, %li\n", plugin->name, frames);
 		if ((frames = plugin->transfer(plugin, src_channels, dst_channels, frames)) < 0)
 			return frames;
@@ -818,7 +818,7 @@ snd_pcm_sframes_t snd_pcm_plug_read_transfer(snd_pcm_plug_t *plug, snd_pcm_plugi
 	if (frames < 0)
 		return frames;
 
-	src_channels = 0;
+	src_channels = NULL;
 	plugin = snd_pcm_plug_first(plug);
 	while (plugin && frames > 0) {
 		if ((next = plugin->next) != NULL) {
diff --git a/sound/core/oss/route.c b/sound/core/oss/route.c
index fadc265a0..a33764fd6 100644
--- a/sound/core/oss/route.c
+++ b/sound/core/oss/route.c
@@ -95,7 +95,7 @@ static void route_to_channel_from_one(snd_pcm_plugin_t *plugin,
 #undef CONV_LABELS
 	route_t *data = (route_t *)plugin->extra_data;
 	void *conv;
-	const snd_pcm_plugin_channel_t *src_channel = 0;
+	const snd_pcm_plugin_channel_t *src_channel = NULL;
 	unsigned int srcidx;
 	char *src, *dst;
 	int src_step, dst_step;
@@ -149,11 +149,11 @@ static void route_to_channel(snd_pcm_plugin_t *plugin,
 #endif
 	};
 	/* sum_type att shift */
-	static void *norm_labels[3 * 2 * 4] = { 0,
+	static void *norm_labels[3 * 2 * 4] = { NULL,
 					 &&norm_int32_8_noatt,
 					 &&norm_int32_16_noatt,
 					 &&norm_int32_24_noatt,
-					 0,
+					 NULL,
 					 &&norm_int32_8_att,
 					 &&norm_int32_16_att,
 					 &&norm_int32_24_att,
@@ -462,7 +462,7 @@ static int route_load_ttable(snd_pcm_plugin_t *plugin,
                         for(srcidx = 0; srcidx < nsrcs; srcidx++)
 				dptr->srcs[srcidx] = srcs[srcidx];
 		} else
-			dptr->srcs = 0;
+			dptr->srcs = NULL;
 		dptr++;
 	}
 	return 0;
diff --git a/sound/core/pcm.c b/sound/core/pcm.c
index 7f1bf94e0..8ee8fa709 100644
--- a/sound/core/pcm.c
+++ b/sound/core/pcm.c
@@ -202,37 +202,37 @@ char *snd_pcm_tstamp_mode_names[] = {
 
 const char *snd_pcm_stream_name(snd_pcm_stream_t stream)
 {
-	snd_assert(stream <= SNDRV_PCM_STREAM_LAST, return 0);
+	snd_assert(stream <= SNDRV_PCM_STREAM_LAST, return NULL);
 	return snd_pcm_stream_names[stream];
 }
 
 const char *snd_pcm_access_name(snd_pcm_access_t access)
 {
-	snd_assert(access <= SNDRV_PCM_ACCESS_LAST, return 0);
+	snd_assert(access <= SNDRV_PCM_ACCESS_LAST, return NULL);
 	return snd_pcm_access_names[access];
 }
 
 const char *snd_pcm_format_name(snd_pcm_format_t format)
 {
-	snd_assert(format <= SNDRV_PCM_FORMAT_LAST, return 0);
+	snd_assert(format <= SNDRV_PCM_FORMAT_LAST, return NULL);
 	return snd_pcm_format_names[format];
 }
 
 const char *snd_pcm_subformat_name(snd_pcm_subformat_t subformat)
 {
-	snd_assert(subformat <= SNDRV_PCM_SUBFORMAT_LAST, return 0);
+	snd_assert(subformat <= SNDRV_PCM_SUBFORMAT_LAST, return NULL);
 	return snd_pcm_subformat_names[subformat];
 }
 
 const char *snd_pcm_tstamp_mode_name(snd_pcm_tstamp_t mode)
 {
-	snd_assert(mode <= SNDRV_PCM_TSTAMP_LAST, return 0);
+	snd_assert(mode <= SNDRV_PCM_TSTAMP_LAST, return NULL);
 	return snd_pcm_tstamp_mode_names[mode];
 }
 
 const char *snd_pcm_state_name(snd_pcm_state_t state)
 {
-	snd_assert(state <= SNDRV_PCM_STATE_LAST, return 0);
+	snd_assert(state <= SNDRV_PCM_STATE_LAST, return NULL);
 	return snd_pcm_state_names[state];
 }
 
diff --git a/sound/core/pcm_lib.c b/sound/core/pcm_lib.c
index 61d1c38fb..b104d3815 100644
--- a/sound/core/pcm_lib.c
+++ b/sound/core/pcm_lib.c
@@ -1559,7 +1559,7 @@ int snd_pcm_hw_param_set(snd_pcm_t *pcm, snd_pcm_hw_params_t *params,
 		if (err < 0)
 			return err;
 	}
-	return snd_pcm_hw_param_value(params, var, 0);
+	return snd_pcm_hw_param_value(params, var, NULL);
 }
 
 int _snd_pcm_hw_param_mask(snd_pcm_hw_params_t *params,
@@ -1735,28 +1735,28 @@ int snd_pcm_hw_params_choose(snd_pcm_t *pcm, snd_pcm_hw_params_t *params)
 {
 	int err;
 
-	err = snd_pcm_hw_param_first(pcm, params, SNDRV_PCM_HW_PARAM_ACCESS, 0);
+	err = snd_pcm_hw_param_first(pcm, params, SNDRV_PCM_HW_PARAM_ACCESS, NULL);
 	assert(err >= 0);
 
-	err = snd_pcm_hw_param_first(pcm, params, SNDRV_PCM_HW_PARAM_FORMAT, 0);
+	err = snd_pcm_hw_param_first(pcm, params, SNDRV_PCM_HW_PARAM_FORMAT, NULL);
 	assert(err >= 0);
 
-	err = snd_pcm_hw_param_first(pcm, params, SNDRV_PCM_HW_PARAM_SUBFORMAT, 0);
+	err = snd_pcm_hw_param_first(pcm, params, SNDRV_PCM_HW_PARAM_SUBFORMAT, NULL);
 	assert(err >= 0);
 
-	err = snd_pcm_hw_param_first(pcm, params, SNDRV_PCM_HW_PARAM_CHANNELS, 0);
+	err = snd_pcm_hw_param_first(pcm, params, SNDRV_PCM_HW_PARAM_CHANNELS, NULL);
 	assert(err >= 0);
 
-	err = snd_pcm_hw_param_first(pcm, params, SNDRV_PCM_HW_PARAM_RATE, 0);
+	err = snd_pcm_hw_param_first(pcm, params, SNDRV_PCM_HW_PARAM_RATE, NULL);
 	assert(err >= 0);
 
-	err = snd_pcm_hw_param_first(pcm, params, SNDRV_PCM_HW_PARAM_PERIOD_TIME, 0);
+	err = snd_pcm_hw_param_first(pcm, params, SNDRV_PCM_HW_PARAM_PERIOD_TIME, NULL);
 	assert(err >= 0);
 
-	err = snd_pcm_hw_param_last(pcm, params, SNDRV_PCM_HW_PARAM_BUFFER_SIZE, 0);
+	err = snd_pcm_hw_param_last(pcm, params, SNDRV_PCM_HW_PARAM_BUFFER_SIZE, NULL);
 	assert(err >= 0);
 
-	err = snd_pcm_hw_param_first(pcm, params, SNDRV_PCM_HW_PARAM_TICK_TIME, 0);
+	err = snd_pcm_hw_param_first(pcm, params, SNDRV_PCM_HW_PARAM_TICK_TIME, NULL);
 	assert(err >= 0);
 
 	return 0;
diff --git a/sound/core/pcm_native.c b/sound/core/pcm_native.c
index 15ed2b9b3..6d5271f3f 100644
--- a/sound/core/pcm_native.c
+++ b/sound/core/pcm_native.c
@@ -1100,7 +1100,7 @@ static int snd_pcm_pre_reset(snd_pcm_substream_t * substream, int state)
 static int snd_pcm_do_reset(snd_pcm_substream_t * substream, int state)
 {
 	snd_pcm_runtime_t *runtime = substream->runtime;
-	int err = substream->ops->ioctl(substream, SNDRV_PCM_IOCTL1_RESET, 0);
+	int err = substream->ops->ioctl(substream, SNDRV_PCM_IOCTL1_RESET, NULL);
 	if (err < 0)
 		return err;
 	// snd_assert(runtime->status->hw_ptr < runtime->buffer_size, );
@@ -1475,18 +1475,18 @@ static struct file *snd_pcm_file_fd(int fd)
 	unsigned short minor;
 	file = fget(fd);
 	if (!file)
-		return 0;
+		return NULL;
 	inode = file->f_dentry->d_inode;
 	if (!S_ISCHR(inode->i_mode) ||
 	    imajor(inode) != snd_major) {
 		fput(file);
-		return 0;
+		return NULL;
 	}
 	minor = iminor(inode);
 	if (minor >= 256 || 
 	    minor % SNDRV_MINOR_DEVICES < SNDRV_MINOR_PCM_PLAYBACK) {
 		fput(file);
-		return 0;
+		return NULL;
 	}
 	return file;
 }
@@ -1701,23 +1701,23 @@ int snd_pcm_hw_constraints_init(snd_pcm_substream_t *substream)
 	snd_interval_setinteger(constrs_interval(constrs, SNDRV_PCM_HW_PARAM_FRAME_BITS));
 
 	err = snd_pcm_hw_rule_add(runtime, 0, SNDRV_PCM_HW_PARAM_FORMAT,
-				   snd_pcm_hw_rule_format, 0,
+				   snd_pcm_hw_rule_format, NULL,
 				   SNDRV_PCM_HW_PARAM_SAMPLE_BITS, -1);
 	if (err < 0)
 		return err;
 	err = snd_pcm_hw_rule_add(runtime, 0, SNDRV_PCM_HW_PARAM_SAMPLE_BITS, 
-				  snd_pcm_hw_rule_sample_bits, 0,
+				  snd_pcm_hw_rule_sample_bits, NULL,
 				  SNDRV_PCM_HW_PARAM_FORMAT, 
 				  SNDRV_PCM_HW_PARAM_SAMPLE_BITS, -1);
 	if (err < 0)
 		return err;
 	err = snd_pcm_hw_rule_add(runtime, 0, SNDRV_PCM_HW_PARAM_SAMPLE_BITS, 
-				  snd_pcm_hw_rule_div, 0,
+				  snd_pcm_hw_rule_div, NULL,
 				  SNDRV_PCM_HW_PARAM_FRAME_BITS, SNDRV_PCM_HW_PARAM_CHANNELS, -1);
 	if (err < 0)
 		return err;
 	err = snd_pcm_hw_rule_add(runtime, 0, SNDRV_PCM_HW_PARAM_FRAME_BITS, 
-				  snd_pcm_hw_rule_mul, 0,
+				  snd_pcm_hw_rule_mul, NULL,
 				  SNDRV_PCM_HW_PARAM_SAMPLE_BITS, SNDRV_PCM_HW_PARAM_CHANNELS, -1);
 	if (err < 0)
 		return err;
@@ -1732,7 +1732,7 @@ int snd_pcm_hw_constraints_init(snd_pcm_substream_t *substream)
 	if (err < 0)
 		return err;
 	err = snd_pcm_hw_rule_add(runtime, 0, SNDRV_PCM_HW_PARAM_CHANNELS, 
-				  snd_pcm_hw_rule_div, 0,
+				  snd_pcm_hw_rule_div, NULL,
 				  SNDRV_PCM_HW_PARAM_FRAME_BITS, SNDRV_PCM_HW_PARAM_SAMPLE_BITS, -1);
 	if (err < 0)
 		return err;
@@ -1747,12 +1747,12 @@ int snd_pcm_hw_constraints_init(snd_pcm_substream_t *substream)
 	if (err < 0)
 		return err;
 	err = snd_pcm_hw_rule_add(runtime, 0, SNDRV_PCM_HW_PARAM_PERIODS, 
-				  snd_pcm_hw_rule_div, 0,
+				  snd_pcm_hw_rule_div, NULL,
 				  SNDRV_PCM_HW_PARAM_BUFFER_SIZE, SNDRV_PCM_HW_PARAM_PERIOD_SIZE, -1);
 	if (err < 0)
 		return err;
 	err = snd_pcm_hw_rule_add(runtime, 0, SNDRV_PCM_HW_PARAM_PERIOD_SIZE, 
-				  snd_pcm_hw_rule_div, 0,
+				  snd_pcm_hw_rule_div, NULL,
 				  SNDRV_PCM_HW_PARAM_BUFFER_SIZE, SNDRV_PCM_HW_PARAM_PERIODS, -1);
 	if (err < 0)
 		return err;
@@ -1767,7 +1767,7 @@ int snd_pcm_hw_constraints_init(snd_pcm_substream_t *substream)
 	if (err < 0)
 		return err;
 	err = snd_pcm_hw_rule_add(runtime, 0, SNDRV_PCM_HW_PARAM_BUFFER_SIZE, 
-				  snd_pcm_hw_rule_mul, 0,
+				  snd_pcm_hw_rule_mul, NULL,
 				  SNDRV_PCM_HW_PARAM_PERIOD_SIZE, SNDRV_PCM_HW_PARAM_PERIODS, -1);
 	if (err < 0)
 		return err;
diff --git a/sound/core/seq/Makefile b/sound/core/seq/Makefile
index 1c4d10d47..e731cdc2e 100644
--- a/sound/core/seq/Makefile
+++ b/sound/core/seq/Makefile
@@ -51,7 +51,6 @@ obj-$(call sequencer,$(CONFIG_SND_AD1816A)) += $(RAWMIDI_OBJS) $(OPL3_OBJS)
 obj-$(call sequencer,$(CONFIG_SND_CS4231)) += $(RAWMIDI_OBJS)
 obj-$(call sequencer,$(CONFIG_SND_CS4232)) += $(RAWMIDI_OBJS) $(OPL3_OBJS)
 obj-$(call sequencer,$(CONFIG_SND_CS4236)) += $(RAWMIDI_OBJS) $(OPL3_OBJS)
-obj-$(call sequencer,$(CONFIG_SND_PC98_CS4232)) += $(RAWMIDI_OBJS) $(OPL3_OBJS)
 obj-$(call sequencer,$(CONFIG_SND_ES1688)) += $(RAWMIDI_OBJS) $(OPL3_OBJS)
 obj-$(call sequencer,$(CONFIG_SND_GUSCLASSIC)) += $(RAWMIDI_OBJS) $(OPL3_OBJS)
 obj-$(call sequencer,$(CONFIG_SND_GUSMAX)) += $(RAWMIDI_OBJS) $(OPL3_OBJS)
diff --git a/sound/core/seq/instr/Makefile b/sound/core/seq/instr/Makefile
index 8db86fe18..5ae3552af 100644
--- a/sound/core/seq/instr/Makefile
+++ b/sound/core/seq/instr/Makefile
@@ -26,7 +26,6 @@ obj-$(call sequencer,$(CONFIG_SND_OPL3SA2)) += snd-ainstr-fm.o
 obj-$(call sequencer,$(CONFIG_SND_AD1816A)) += snd-ainstr-fm.o
 obj-$(call sequencer,$(CONFIG_SND_CS4232)) += snd-ainstr-fm.o
 obj-$(call sequencer,$(CONFIG_SND_CS4236)) += snd-ainstr-fm.o
-obj-$(call sequencer,$(CONFIG_SND_PC98_CS4232)) += snd-ainstr-fm.o
 obj-$(call sequencer,$(CONFIG_SND_ES1688)) += snd-ainstr-fm.o
 obj-$(call sequencer,$(CONFIG_SND_GUSCLASSIC)) += snd-ainstr-iw.o snd-ainstr-gf1.o snd-ainstr-simple.o
 obj-$(call sequencer,$(CONFIG_SND_GUSMAX)) += snd-ainstr-iw.o snd-ainstr-gf1.o snd-ainstr-simple.o
diff --git a/sound/core/seq/seq_clientmgr.c b/sound/core/seq/seq_clientmgr.c
index 9e67d06da..eff36938f 100644
--- a/sound/core/seq/seq_clientmgr.c
+++ b/sound/core/seq/seq_clientmgr.c
@@ -1055,7 +1055,7 @@ static ssize_t snd_seq_write(struct file *file, const char __user *buf, size_t c
 		} else {
 #if defined(CONFIG_SND_BIT32_EMUL) || defined(CONFIG_SND_BIT32_EMUL_MODULE)
 			if (client->convert32 && snd_seq_ev_is_varusr(&event)) {
-				void *ptr = (void*)A(event.data.raw32.d[1]);
+				void *ptr = compat_ptr(event.data.raw32.d[1]);
 				event.data.ext.ptr = ptr;
 			}
 #endif
diff --git a/sound/drivers/mpu401/mpu401.c b/sound/drivers/mpu401/mpu401.c
index dac8fb1d7..4b0025030 100644
--- a/sound/drivers/mpu401/mpu401.c
+++ b/sound/drivers/mpu401/mpu401.c
@@ -52,9 +52,6 @@ static int acpipnp[SNDRV_CARDS] = { [0 ... (SNDRV_CARDS-1)] = 1 };
 #endif
 static long port[SNDRV_CARDS] = SNDRV_DEFAULT_PORT;	/* MPU-401 port number */
 static int irq[SNDRV_CARDS] = SNDRV_DEFAULT_IRQ;	/* MPU-401 IRQ */
-#ifdef CONFIG_X86_PC9800
-static int pc98ii[SNDRV_CARDS];				/* PC98-II dauther board */
-#endif
 static int boot_devs;
 
 module_param_array(index, int, boot_devs, 0444);
@@ -77,11 +74,6 @@ MODULE_PARM_SYNTAX(port, SNDRV_PORT12_DESC);
 module_param_array(irq, int, boot_devs, 0444);
 MODULE_PARM_DESC(irq, "IRQ # for MPU-401 device.");
 MODULE_PARM_SYNTAX(irq, SNDRV_IRQ_DESC);
-#ifdef CONFIG_X86_PC9800
-module_param_array(pc98ii, bool, boot_devs, 0444);
-MODULE_PARM_DESC(pc98ii, "Roland MPU-PC98II support.");
-MODULE_PARM_SYNTAX(pc98ii, SNDRV_BOOLEAN_FALSE_DESC);
-#endif
 
 #ifndef CONFIG_ACPI_BUS
 struct acpi_device;
@@ -188,9 +180,6 @@ static int __devinit snd_card_mpu401_probe(int dev, struct acpi_device *device)
 	}
 #endif
 	if (snd_mpu401_uart_new(card, 0,
-#ifdef CONFIG_X86_PC9800
-				pc98ii[dev] ? MPU401_HW_PC98II :
-#endif
 				MPU401_HW_MPU401,
 				port[dev], 0,
 				irq[dev], irq[dev] >= 0 ? SA_INTERRUPT : 0, NULL) < 0) {
diff --git a/sound/drivers/opl3/opl3_lib.c b/sound/drivers/opl3/opl3_lib.c
index e3fa31d4d..965ffd050 100644
--- a/sound/drivers/opl3/opl3_lib.c
+++ b/sound/drivers/opl3/opl3_lib.c
@@ -415,26 +415,6 @@ int snd_opl3_create(snd_card_t * card,
 	case OPL3_HW_OPL3_CS:
 	case OPL3_HW_OPL3_FM801:
 		opl3->command = &snd_opl3_command;
-		break;
-	case OPL3_HW_OPL3_PC98:
-		opl3->command = &snd_opl3_command;
-
-		/* Initialize? */
-		opl3->command(opl3, OPL3_RIGHT | 0x05, 0x05);
-		opl3->command(opl3, OPL3_RIGHT | 0x08, 0x04);
-		opl3->command(opl3, OPL3_RIGHT | 0x08, 0x00);
-		opl3->command(opl3, OPL3_LEFT | 0xf7, 0x00);
-		opl3->command(opl3, OPL3_LEFT | 0x04, 0x60);
-		opl3->command(opl3, OPL3_LEFT | 0x04, 0x80);
-		inb(opl3->l_port);
-		
-		opl3->command(opl3, OPL3_LEFT | 0x02, 0xff);
-		opl3->command(opl3, OPL3_LEFT | 0x04, 0x21);
-		inb(opl3->l_port);
-		
-		opl3->command(opl3, OPL3_LEFT | 0x04, 0x60);
-		opl3->command(opl3, OPL3_LEFT | 0x04, 0x80);
-
 		break;
 	case OPL3_HW_OPL3_CS4281:
 		opl3->command = &snd_opl3_cs4281_command;
diff --git a/sound/drivers/opl4/opl4_proc.c b/sound/drivers/opl4/opl4_proc.c
index f2f364d15..bbea9ab1c 100644
--- a/sound/drivers/opl4/opl4_proc.c
+++ b/sound/drivers/opl4/opl4_proc.c
@@ -50,41 +50,42 @@ static int snd_opl4_mem_proc_release(snd_info_entry_t *entry,
 }
 
 static long snd_opl4_mem_proc_read(snd_info_entry_t *entry, void *file_private_data,
-				   struct file *file, char __user *_buf, long count)
+				   struct file *file, char __user *_buf,
+				   unsigned long count, unsigned long pos)
 {
 	opl4_t *opl4 = snd_magic_cast(opl4_t, entry->private_data, return -ENXIO);
 	long size;
 	char* buf;
 
 	size = count;
-	if (file->f_pos + size > entry->size)
-		size = entry->size - file->f_pos;
+	if (pos + size > entry->size)
+		size = entry->size - pos;
 	if (size > 0) {
 		buf = vmalloc(size);
 		if (!buf)
 			return -ENOMEM;
-		snd_opl4_read_memory(opl4, buf, file->f_pos, size);
+		snd_opl4_read_memory(opl4, buf, pos, size);
 		if (copy_to_user(_buf, buf, size)) {
 			vfree(buf);
 			return -EFAULT;
 		}
 		vfree(buf);
-		file->f_pos += size;
 		return size;
 	}
 	return 0;
 }
 
 static long snd_opl4_mem_proc_write(snd_info_entry_t *entry, void *file_private_data,
-				    struct file *file, const char __user *_buf, long count)
+				    struct file *file, const char __user *_buf,
+				    unsigned long count, unsigned long pos)
 {
 	opl4_t *opl4 = snd_magic_cast(opl4_t, entry->private_data, return -ENXIO);
 	long size;
 	char *buf;
 
 	size = count;
-	if (file->f_pos + size > entry->size)
-		size = entry->size - file->f_pos;
+	if (pos + size > entry->size)
+		size = entry->size - pos;
 	if (size > 0) {
 		buf = vmalloc(size);
 		if (!buf)
@@ -93,9 +94,8 @@ static long snd_opl4_mem_proc_write(snd_info_entry_t *entry, void *file_private_
 			vfree(buf);
 			return -EFAULT;
 		}
-		snd_opl4_write_memory(opl4, buf, file->f_pos, size);
+		snd_opl4_write_memory(opl4, buf, pos, size);
 		vfree(buf);
-		file->f_pos += size;
 		return size;
 	}
 	return 0;
diff --git a/sound/drivers/serial-u16550.c b/sound/drivers/serial-u16550.c
index 1e639aeb9..2662f5c12 100644
--- a/sound/drivers/serial-u16550.c
+++ b/sound/drivers/serial-u16550.c
@@ -674,7 +674,7 @@ static void snd_uart16550_output_write(snd_rawmidi_substream_t * substream)
 				break;
 			if (snd_rawmidi_transmit(substream, &midi_byte, 1) != 1)
 				break;
-#if SNDRV_SERIAL_MS124W_MB_NOCOMBO
+#ifdef SNDRV_SERIAL_MS124W_MB_NOCOMBO
 			/* select exactly one of the four ports */
 			addr_byte = (1 << (substream->number + 4)) | 0x08;
 #else
diff --git a/sound/drivers/vx/vx_pcm.c b/sound/drivers/vx/vx_pcm.c
index 9ee1c80ef..2f7d85f64 100644
--- a/sound/drivers/vx/vx_pcm.c
+++ b/sound/drivers/vx/vx_pcm.c
@@ -465,7 +465,7 @@ static int vx_alloc_pipe(vx_core_t *chip, int capture,
 	struct vx_rmh rmh;
 	int data_mode;
 
-	*pipep = 0;
+	*pipep = NULL;
 	vx_init_rmh(&rmh, CMD_RES_PIPE);
 	vx_set_pipe_cmd_params(&rmh, capture, audioid, num_audio);
 #if 0	// NYI
@@ -581,7 +581,7 @@ static int vx_pcm_playback_open(snd_pcm_substream_t *subs)
 {
 	snd_pcm_runtime_t *runtime = subs->runtime;
 	vx_core_t *chip = snd_pcm_substream_chip(subs);
-	vx_pipe_t *pipe = 0;
+	vx_pipe_t *pipe = NULL;
 	unsigned int audio;
 	int err;
 
@@ -632,7 +632,7 @@ static int vx_pcm_playback_close(snd_pcm_substream_t *subs)
 	pipe = snd_magic_cast(vx_pipe_t, subs->runtime->private_data, return -EINVAL);
 
 	if (--pipe->references == 0) {
-		chip->playback_pipes[pipe->number] = 0;
+		chip->playback_pipes[pipe->number] = NULL;
 		vx_free_pipe(chip, pipe);
 	}
 
@@ -1038,7 +1038,7 @@ static int vx_pcm_capture_close(snd_pcm_substream_t *subs)
 	if (! subs->runtime->private_data)
 		return -EINVAL;
 	pipe = snd_magic_cast(vx_pipe_t, subs->runtime->private_data, return -EINVAL);
-	chip->capture_pipes[pipe->number] = 0;
+	chip->capture_pipes[pipe->number] = NULL;
 
 	pipe_out_monitoring = pipe->monitoring_pipe;
 
@@ -1049,8 +1049,8 @@ static int vx_pcm_capture_close(snd_pcm_substream_t *subs)
 	if (pipe_out_monitoring) {
 		if (--pipe_out_monitoring->references == 0) {
 			vx_free_pipe(chip, pipe_out_monitoring);
-			chip->playback_pipes[pipe->number] = 0;
-			pipe->monitoring_pipe = 0;
+			chip->playback_pipes[pipe->number] = NULL;
+			pipe->monitoring_pipe = NULL;
 		}
 	}
 	
@@ -1269,11 +1269,11 @@ static void snd_vx_pcm_free(snd_pcm_t *pcm)
 	chip->pcm[pcm->device] = NULL;
 	if (chip->playback_pipes) {
 		kfree(chip->playback_pipes);
-		chip->playback_pipes = 0;
+		chip->playback_pipes = NULL;
 	}
 	if (chip->capture_pipes) {
 		kfree(chip->capture_pipes);
-		chip->capture_pipes = 0;
+		chip->capture_pipes = NULL;
 	}
 }
 
diff --git a/sound/i2c/other/tea575x-tuner.c b/sound/i2c/other/tea575x-tuner.c
index 7b9f3ea76..38dbacf90 100644
--- a/sound/i2c/other/tea575x-tuner.c
+++ b/sound/i2c/other/tea575x-tuner.c
@@ -85,11 +85,12 @@ static void snd_tea575x_set_freq(tea575x_t *tea)
  * Linux Video interface
  */
 
-static int snd_tea575x_do_ioctl(struct inode *inode, struct file *file,
-			        unsigned int cmd, void *arg)
+static int snd_tea575x_ioctl(struct inode *inode, struct file *file,
+			     unsigned int cmd, unsigned long data)
 {
 	struct video_device *dev = video_devdata(file);
 	tea575x_t *tea = video_get_drvdata(dev);
+	void __user *arg = (void __user *)data;
 	
 	switch(cmd) {
 		case VIDIOCGCAP:
@@ -167,12 +168,6 @@ static int snd_tea575x_do_ioctl(struct inode *inode, struct file *file,
 	}
 }
 
-static int snd_tea575x_ioctl(struct inode *inode, struct file *file,
-			     unsigned int cmd, unsigned long arg)
-{
-	return video_usercopy(inode, file, cmd, arg, snd_tea575x_do_ioctl);
-}
-
 /*
  * initialize all the tea575x chips
  */
diff --git a/sound/isa/Kconfig b/sound/isa/Kconfig
index 1f954b67a..11b4240b1 100644
--- a/sound/isa/Kconfig
+++ b/sound/isa/Kconfig
@@ -51,16 +51,6 @@ config SND_CS4236
 	  Say 'Y' or 'M' to include support for CS4235,CS4236,CS4237B,CS4238B,CS4239
 	  chips from Cirrus Logic - Crystal Semiconductors.
 
-config SND_PC98_CS4232
-	tristate "NEC PC9800 CS4232 driver"
-	depends on SND && X86_PC9800
-	select SND_OPL3_LIB
-	select SND_MPU401_UART
-	select SND_PCM
-	help
-	  Say 'Y' or 'M' to include support for NEC PC-9801/PC-9821 on-board
-	  soundchip based on CS4232.
-
 config SND_ES968
 	tristate "Generic ESS ES968 driver"
 	depends on SND && ISAPNP
@@ -194,7 +184,7 @@ config SND_SBAWE
 
 config SND_SB16_CSP
 	bool "Sound Blaster 16/AWE CSP support"
-	depends on SND_SB16 || SND_SBAWE
+	depends on (SND_SB16 || SND_SBAWE) && (BROKEN || !PPC)
 	help
 	  Say 'Y' to include support for CSP core. This special coprocessor
 	  can do variable tasks like various compression and decompression
diff --git a/sound/isa/cs423x/Makefile b/sound/isa/cs423x/Makefile
index cfc32c602..d2afaea30 100644
--- a/sound/isa/cs423x/Makefile
+++ b/sound/isa/cs423x/Makefile
@@ -8,7 +8,6 @@ snd-cs4236-lib-objs := cs4236_lib.o
 snd-cs4231-objs := cs4231.o
 snd-cs4232-objs := cs4232.o
 snd-cs4236-objs := cs4236.o
-snd-pc98-cs4232-objs := pc98.o
 
 # Toplevel Module Dependency
 obj-$(CONFIG_SND_AZT2320) += snd-cs4231-lib.o
@@ -22,6 +21,5 @@ obj-$(CONFIG_SND_INTERWAVE_STB) += snd-cs4231-lib.o
 obj-$(CONFIG_SND_OPTI92X_CS4231) += snd-cs4231-lib.o
 obj-$(CONFIG_SND_WAVEFRONT) += snd-cs4231-lib.o
 obj-$(CONFIG_SND_SSCAPE) += snd-cs4231-lib.o
-obj-$(CONFIG_SND_PC98_CS4232) += snd-pc98-cs4232.o snd-cs4231-lib.o
 
 obj-m := $(sort $(obj-m))
diff --git a/sound/isa/gus/gus_mem.c b/sound/isa/gus/gus_mem.c
index b1f6487c4..783f5dd4f 100644
--- a/sound/isa/gus/gus_mem.c
+++ b/sound/isa/gus/gus_mem.c
@@ -59,7 +59,7 @@ snd_gf1_mem_block_t *snd_gf1_mem_xalloc(snd_gf1_mem_t * alloc,
 			else
 				nblock->prev->next = nblock;
 			up(&alloc->memory_mutex);
-			return 0;
+			return NULL;
 		}
 		pblock = pblock->next;
 	}
diff --git a/sound/isa/gus/gus_mem_proc.c b/sound/isa/gus/gus_mem_proc.c
index 95071a084..6ee2d76ee 100644
--- a/sound/isa/gus/gus_mem_proc.c
+++ b/sound/isa/gus/gus_mem_proc.c
@@ -33,7 +33,8 @@ typedef struct gus_proc_private {
 } gus_proc_private_t;
 
 static long snd_gf1_mem_proc_dump(snd_info_entry_t *entry, void *file_private_data,
-			          struct file *file, char __user *buf, long count)
+			          struct file *file, char __user *buf,
+			          unsigned long count, unsigned long pos)
 {
 	long size;
 	gus_proc_private_t *priv = snd_magic_cast(gus_proc_private_t, entry->private_data, return -ENXIO);
@@ -41,12 +42,11 @@ static long snd_gf1_mem_proc_dump(snd_info_entry_t *entry, void *file_private_da
 	int err;
 
 	size = count;
-	if (file->f_pos + size > priv->size)
-		size = (long)priv->size - file->f_pos;
+	if (pos + size > priv->size)
+		size = (long)priv->size - pos;
 	if (size > 0) {
-		if ((err = snd_gus_dram_read(gus, buf, file->f_pos, size, priv->rom)) < 0)
+		if ((err = snd_gus_dram_read(gus, buf, pos, size, priv->rom)) < 0)
 			return err;
-		file->f_pos += size;
 		return size;
 	}
 	return 0;
diff --git a/sound/isa/gus/interwave.c b/sound/isa/gus/interwave.c
index 74bdb4a22..b2c3544bf 100644
--- a/sound/isa/gus/interwave.c
+++ b/sound/isa/gus/interwave.c
@@ -84,9 +84,11 @@ MODULE_PARM_SYNTAX(id, SNDRV_ID_DESC);
 module_param_array(enable, bool, boot_devs, 0444);
 MODULE_PARM_DESC(enable, "Enable InterWave soundcard.");
 MODULE_PARM_SYNTAX(enable, SNDRV_ENABLE_DESC);
+#ifdef CONFIG_PNP
 module_param_array(isapnp, bool, boot_devs, 0444);
 MODULE_PARM_DESC(isapnp, "ISA PnP detection for specified soundcard.");
 MODULE_PARM_SYNTAX(isapnp, SNDRV_ISAPNP_DESC);
+#endif
 module_param_array(port, long, boot_devs, 0444);
 MODULE_PARM_DESC(port, "Port # for InterWave driver.");
 MODULE_PARM_SYNTAX(port, SNDRV_ENABLED ",allows:{{0x210,0x260,0x10}},dialog:list");
diff --git a/sound/isa/sb/emu8000_pcm.c b/sound/isa/sb/emu8000_pcm.c
index 4d84f2519..5c4def8d0 100644
--- a/sound/isa/sb/emu8000_pcm.c
+++ b/sound/isa/sb/emu8000_pcm.c
@@ -264,7 +264,7 @@ static int emu8k_pcm_close(snd_pcm_substream_t *subs)
 	emu8k_pcm_t *rec = subs->runtime->private_data;
 	if (rec)
 		kfree(rec);
-	subs->runtime->private_data = 0;
+	subs->runtime->private_data = NULL;
 	return 0;
 }
 
diff --git a/sound/isa/sb/sb8_main.c b/sound/isa/sb/sb8_main.c
index 25cdd024b..bac9f1610 100644
--- a/sound/isa/sb/sb8_main.c
+++ b/sound/isa/sb/sb8_main.c
@@ -452,11 +452,11 @@ int snd_sb8_open(snd_pcm_substream_t *substream)
 		runtime->hw.rate_max = 44100;
 		runtime->hw.channels_max = 2;
 		snd_pcm_hw_rule_add(runtime, 0, SNDRV_PCM_HW_PARAM_RATE,
-				    snd_sb8_hw_constraint_rate_channels, 0,
+				    snd_sb8_hw_constraint_rate_channels, NULL,
 				    SNDRV_PCM_HW_PARAM_CHANNELS,
 				    SNDRV_PCM_HW_PARAM_RATE, -1);
 		snd_pcm_hw_rule_add(runtime, 0, SNDRV_PCM_HW_PARAM_CHANNELS,
-				     snd_sb8_hw_constraint_channels_rate, 0,
+				     snd_sb8_hw_constraint_channels_rate, NULL,
 				     SNDRV_PCM_HW_PARAM_RATE, -1);
 		break;
 	case SB_HW_201:
diff --git a/sound/isa/wavefront/wavefront_fx.c b/sound/isa/wavefront/wavefront_fx.c
index 92d9c85a4..92aa782d6 100644
--- a/sound/isa/wavefront/wavefront_fx.c
+++ b/sound/isa/wavefront/wavefront_fx.c
@@ -23,7 +23,6 @@
 #include <linux/wait.h>
 #include <sound/core.h>
 #include <sound/snd_wavefront.h>
-#include <sound/yss225.h>
 #include <sound/initval.h>
 
 /* Control bits for the Load Control Register
@@ -33,114 +32,434 @@
 #define FX_MSB_TRANSFER 0x02    /* transfer after DSP MSB byte written */
 #define FX_AUTO_INCR    0x04    /* auto-increment DSP address after transfer */
 
-static int
-wavefront_fx_idle (snd_wavefront_t *dev) 
-    
-{
-	int i;
-	unsigned int x = 0x80;
-    
-	for (i = 0; i < 1000; i++) {
-		x = inb (dev->fx_status);
-		if ((x & 0x80) == 0) {
-			break;
-		}
-	}
-    
-	if (x & 0x80) {
-		snd_printk ("FX device never idle.\n");
-		return 0;
-	}
-    
-	return (1);
-}
-
-static void
-wavefront_fx_mute (snd_wavefront_t *dev, int onoff)
-    
-{
-	if (!wavefront_fx_idle(dev)) {
-		return;
-	}
-    
-	outb (onoff ? 0x02 : 0x00, dev->fx_op);
-}
-
-static int
-wavefront_fx_memset (snd_wavefront_t *dev, 
-		     int page,
-		     int addr, 
-		     int cnt, 
-		     unsigned short *data)
-{
-	if (page < 0 || page > 7) {
-		snd_printk ("FX memset: "
-			"page must be >= 0 and <= 7\n");
-		return -(EINVAL);
-	}
-
-	if (addr < 0 || addr > 0x7f) {
-		snd_printk ("FX memset: "
-			"addr must be >= 0 and <= 7f\n");
-		return -(EINVAL);
-	}
-
-	if (cnt == 1) {
-
-		outb (FX_LSB_TRANSFER, dev->fx_lcr);
-		outb (page, dev->fx_dsp_page);
-		outb (addr, dev->fx_dsp_addr);
-		outb ((data[0] >> 8), dev->fx_dsp_msb);
-		outb ((data[0] & 0xff), dev->fx_dsp_lsb);
+/* weird stuff, derived from port I/O tracing with dosemu */
 
-		snd_printk ("FX: addr %d:%x set to 0x%x\n",
-			page, addr, data[0]);
-	
-	} else {
-		int i;
+static unsigned char page_zero[] __initdata = {
+0x01, 0x7c, 0x00, 0x1e, 0x00, 0x00, 0x00, 0x00, 0x00, 0xf5, 0x00,
+0x11, 0x00, 0x20, 0x00, 0x32, 0x00, 0x40, 0x00, 0x13, 0x00, 0x00,
+0x00, 0x14, 0x02, 0x76, 0x00, 0x60, 0x00, 0x80, 0x02, 0x00, 0x00,
+0x00, 0x00, 0x00, 0x02, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x18, 0x00, 0x19,
+0x01, 0x1a, 0x01, 0x20, 0x01, 0x40, 0x01, 0x17, 0x00, 0x00, 0x01,
+0x80, 0x01, 0x20, 0x00, 0x10, 0x01, 0xa0, 0x03, 0xd1, 0x00, 0x00,
+0x01, 0xf2, 0x02, 0x00, 0x00, 0x13, 0x00, 0x00, 0x00, 0xf4, 0x02,
+0xe0, 0x00, 0x15, 0x00, 0x00, 0x00, 0x16, 0x00, 0x00, 0x00, 0x17,
+0x00, 0x20, 0x00, 0x00, 0x00, 0x20, 0x00, 0x50, 0x00, 0x00, 0x00,
+0x40, 0x00, 0x00, 0x00, 0x71, 0x02, 0x00, 0x00, 0x60, 0x00, 0x00,
+0x00, 0x92, 0x00, 0x00, 0x00, 0x80, 0x00, 0x00, 0x00, 0xb3, 0x02,
+0x00, 0x00, 0xa0, 0x00, 0x00, 0x00, 0xd4, 0x00, 0x00, 0x00, 0x40,
+0x00, 0x80, 0x00, 0xf5, 0x00, 0x20, 0x00, 0x70, 0x00, 0xa0, 0x02,
+0x11, 0x00, 0x16, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x20,
+0x02, 0x00, 0x00, 0x20, 0x00, 0x10, 0x00, 0x17, 0x00, 0x1b, 0x00,
+0x1d, 0x02, 0xdf
+};
 
-		outb (FX_AUTO_INCR|FX_LSB_TRANSFER, dev->fx_lcr);
-		outb (page, dev->fx_dsp_page);
-		outb (addr, dev->fx_dsp_addr);
+static unsigned char page_one[] __initdata = {
+0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x00, 0x00, 0x19, 0x00,
+0x1f, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x03, 0xd8, 0x00, 0x00,
+0x02, 0x20, 0x00, 0x19, 0x00, 0x00, 0x00, 0x00, 0x00, 0x18, 0x01,
+0xc0, 0x01, 0xfa, 0x00, 0x1a, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x40, 0x02, 0x60,
+0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xc0, 0x02, 0x80, 0x00,
+0x00, 0x02, 0xfb, 0x02, 0xa0, 0x00, 0x00, 0x00, 0x1b, 0x02, 0xd7,
+0x00, 0x00, 0x02, 0xf7, 0x03, 0x20, 0x03, 0x00, 0x00, 0x00, 0x00,
+0x1c, 0x03, 0x3c, 0x00, 0x00, 0x03, 0x3f, 0x00, 0x00, 0x03, 0xc0,
+0x00, 0x00, 0x03, 0xdf, 0x00, 0x00, 0x00, 0x00, 0x03, 0x5d, 0x00,
+0x00, 0x03, 0xc0, 0x00, 0x00, 0x03, 0x7d, 0x00, 0x00, 0x03, 0xc0,
+0x00, 0x00, 0x03, 0x9e, 0x00, 0x00, 0x03, 0xc0, 0x00, 0x00, 0x03,
+0xbe, 0x00, 0x00, 0x03, 0xc0, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+0x00, 0x00, 0x00, 0x1b, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02,
+0xdb, 0x00, 0x00, 0x02, 0xdb, 0x00, 0x00, 0x02, 0xe0, 0x00, 0x00,
+0x02, 0xfb, 0x00, 0x00, 0x02, 0xc0, 0x02, 0x40, 0x02, 0xfb, 0x02,
+0x60, 0x00, 0x1b
+};
 
-		for (i = 0; i < cnt; i++) {
-			outb ((data[i] >> 8), dev->fx_dsp_msb);
-			outb ((data[i] & 0xff), dev->fx_dsp_lsb);
-			if (!wavefront_fx_idle (dev)) {
-				break;
-			}
-		}
+static unsigned char page_two[] __initdata = {
+0xc4, 0x00, 0x44, 0x07, 0x44, 0x00, 0x40, 0x25, 0x01, 0x06, 0xc4,
+0x07, 0x40, 0x25, 0x01, 0x00, 0x46, 0x46, 0x00, 0x00, 0x00, 0x00,
+0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x46, 0x07,
+0x05, 0x05, 0x05, 0x04, 0x07, 0x05, 0x04, 0x07, 0x05, 0x44, 0x46,
+0x44, 0x46, 0x46, 0x07, 0x05, 0x44, 0x46, 0x05, 0x46, 0x05, 0x46,
+0x05, 0x46, 0x05, 0x44, 0x46, 0x05, 0x07, 0x44, 0x46, 0x05, 0x07,
+0x44, 0x46, 0x05, 0x07, 0x44, 0x46, 0x05, 0x07, 0x44, 0x05, 0x05,
+0x05, 0x44, 0x05, 0x05, 0x05, 0x46, 0x05, 0x46, 0x05, 0x46, 0x05,
+0x46, 0x05, 0x46, 0x07, 0x46, 0x07, 0x44
+};
 
-		if (i != cnt) {
-			snd_printk ("FX memset "
-				    "(0x%x, 0x%x, 0x%lx, %d) incomplete\n",
-				    page, addr, (unsigned long) data, cnt);
-			return -(EIO);
-		}
-	}
+static unsigned char page_three[] __initdata = {
+0x07, 0x40, 0x00, 0x00, 0x00, 0x47, 0x00, 0x40, 0x00, 0x40, 0x06,
+0x40, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x80, 0x80,
+0xc0, 0x00, 0x00, 0x40, 0x00, 0x00, 0x00, 0x40, 0x00, 0x40, 0x00,
+0x60, 0x00, 0x70, 0x00, 0x40, 0x00, 0x40, 0x00, 0x42, 0x00, 0x40,
+0x00, 0x02, 0x00, 0x40, 0x00, 0x00, 0x00, 0x40, 0x00, 0x00, 0x00,
+0x40, 0x00, 0x00, 0x00, 0x40, 0x00, 0x00, 0x00, 0x40, 0x00, 0x00,
+0x00, 0x42, 0x00, 0x40, 0x00, 0x42, 0x00, 0x02, 0x00, 0x02, 0x00,
+0x02, 0x00, 0x42, 0x00, 0xc0, 0x00, 0x40
+};
 
-	return 0;
-}
+static unsigned char page_four[] __initdata = {
+0x63, 0x03, 0x26, 0x02, 0x2c, 0x00, 0x24, 0x00, 0x2e, 0x02, 0x02,
+0x02, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x01,
+0x20, 0x00, 0x60, 0x00, 0x20, 0x00, 0x20, 0x00, 0x20, 0x00, 0x20,
+0x00, 0x20, 0x00, 0x20, 0x00, 0x20, 0x00, 0x20, 0x00, 0x60, 0x00,
+0x20, 0x00, 0x60, 0x00, 0x20, 0x00, 0x60, 0x00, 0x20, 0x00, 0x60,
+0x00, 0x20, 0x00, 0x60, 0x00, 0x20, 0x00, 0x60, 0x00, 0x20, 0x00,
+0x20, 0x00, 0x22, 0x02, 0x22, 0x02, 0x20, 0x00, 0x60, 0x00, 0x22,
+0x02, 0x62, 0x02, 0x20, 0x01, 0x21, 0x01
+};
 
-int 
-snd_wavefront_fx_detect (snd_wavefront_t *dev)
+static unsigned char page_six[] __initdata = {
+0x00, 0x00, 0x00, 0x02, 0x00, 0x00, 0x04, 0x00, 0x00, 0x06, 0x00,
+0x00, 0x08, 0x00, 0x00, 0x0a, 0x00, 0x00, 0x0c, 0x00, 0x00, 0x0e,
+0x00, 0x00, 0x10, 0x00, 0x00, 0x12, 0x00, 0x00, 0x14, 0x00, 0x00,
+0x16, 0x00, 0x00, 0x18, 0x00, 0x00, 0x1a, 0x00, 0x00, 0x1c, 0x00,
+0x00, 0x1e, 0x00, 0x00, 0x20, 0x00, 0x00, 0x22, 0x00, 0x00, 0x24,
+0x00, 0x00, 0x26, 0x00, 0x00, 0x28, 0x00, 0x00, 0x2a, 0x00, 0x00,
+0x2c, 0x00, 0x00, 0x2e, 0x00, 0x00, 0x30, 0x00, 0x00, 0x32, 0x00,
+0x00, 0x34, 0x00, 0x00, 0x36, 0x00, 0x00, 0x38, 0x00, 0x00, 0x3a,
+0x00, 0x00, 0x3c, 0x00, 0x00, 0x3e, 0x00, 0x00, 0x40, 0x00, 0x00,
+0x42, 0x03, 0x00, 0x44, 0x01, 0x00, 0x46, 0x0a, 0x21, 0x48, 0x0d,
+0x23, 0x4a, 0x23, 0x1b, 0x4c, 0x37, 0x8f, 0x4e, 0x45, 0x77, 0x50,
+0x52, 0xe2, 0x52, 0x1c, 0x92, 0x54, 0x1c, 0x52, 0x56, 0x07, 0x00,
+0x58, 0x2f, 0xc6, 0x5a, 0x0b, 0x00, 0x5c, 0x30, 0x06, 0x5e, 0x17,
+0x00, 0x60, 0x3d, 0xda, 0x62, 0x29, 0x00, 0x64, 0x3e, 0x41, 0x66,
+0x39, 0x00, 0x68, 0x4c, 0x48, 0x6a, 0x49, 0x00, 0x6c, 0x4c, 0x6c,
+0x6e, 0x11, 0xd2, 0x70, 0x16, 0x0c, 0x72, 0x00, 0x00, 0x74, 0x00,
+0x80, 0x76, 0x0f, 0x00, 0x78, 0x00, 0x80, 0x7a, 0x13, 0x00, 0x7c,
+0x80, 0x00, 0x7e, 0x80, 0x80
+};
 
-{
-	/* This is a crude check, but its the best one I have for now.
-	   Certainly on the Maui and the Tropez, wavefront_fx_idle() will
-	   report "never idle", which suggests that this test should
-	   work OK.
-	*/
+static unsigned char page_seven[] __initdata = {
+0x0f, 0xff, 0x00, 0x00, 0x08, 0x00, 0x08, 0x00, 0x02, 0x00, 0x00,
+0x00, 0x00, 0x00, 0x0f, 0xff, 0x00, 0x00, 0x00, 0x00, 0x08, 0x00,
+0x08, 0x00, 0x00, 0x00, 0x0f, 0xff, 0x00, 0x00, 0x00, 0x00, 0x0f,
+0xff, 0x0f, 0xff, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x0f, 0xff, 0x0f, 0xff,
+0x0f, 0xff, 0x0f, 0xff, 0x02, 0xe9, 0x06, 0x8c, 0x06, 0x8c, 0x0f,
+0xff, 0x1a, 0x75, 0x0d, 0x8b, 0x04, 0xe9, 0x0b, 0x16, 0x1a, 0x38,
+0x0d, 0xc8, 0x04, 0x6f, 0x0b, 0x91, 0x0f, 0xff, 0x06, 0x40, 0x06,
+0x40, 0x02, 0x8f, 0x0f, 0xff, 0x06, 0x62, 0x06, 0x62, 0x02, 0x7b,
+0x0f, 0xff, 0x06, 0x97, 0x06, 0x97, 0x02, 0x52, 0x0f, 0xff, 0x06,
+0xf6, 0x06, 0xf6, 0x02, 0x19, 0x05, 0x55, 0x05, 0x55, 0x05, 0x55,
+0x05, 0x55, 0x05, 0x55, 0x05, 0x55, 0x05, 0x55, 0x05, 0x55, 0x14,
+0xda, 0x0d, 0x93, 0x04, 0xda, 0x05, 0x93, 0x14, 0xda, 0x0d, 0x93,
+0x04, 0xda, 0x05, 0x93, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+0x00, 0x02, 0x00
+};
 
-	if (inb (dev->fx_status) & 0x80) {
-		snd_printk ("Hmm, probably a Maui or Tropez.\n");
-		return -1;
-	}
+static unsigned char page_zero_v2[] __initdata = {
+0x00, 0x00, 0x00, 0x00, 0x02, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00
+};
 
-	return 0;
-}	
+static unsigned char page_one_v2[] __initdata = {
+0x01, 0xc0, 0x01, 0xfa, 0x00, 0x1a, 0x00, 0x00, 0x00, 0x00, 0x00,
+0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00
+};
 
-int 
+static unsigned char page_two_v2[] __initdata = {
+0x46, 0x46, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+0x00, 0x00, 0x00, 0x00
+};
+static unsigned char page_three_v2[] __initdata = {
+0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+0x00, 0x00, 0x00, 0x00
+};
+static unsigned char page_four_v2[] __initdata = {
+0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+0x00, 0x00, 0x00, 0x00
+};
+
+static unsigned char page_seven_v2[] __initdata = {
+0x0f, 0xff, 0x0f, 0xff, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00
+};
+
+static unsigned char mod_v2[] __initdata = {
+0x01, 0x00, 0x02, 0x00, 0x01, 0x01, 0x02, 0x00, 0x01, 0x02, 0x02,
+0x00, 0x01, 0x03, 0x02, 0x00, 0x01, 0x04, 0x02, 0x00, 0x01, 0x05,
+0x02, 0x00, 0x01, 0x06, 0x02, 0x00, 0x01, 0x07, 0x02, 0x00, 0xb0,
+0x20, 0xb1, 0x20, 0xb2, 0x20, 0xb3, 0x20, 0xb4, 0x20, 0xb5, 0x20,
+0xb6, 0x20, 0xb7, 0x20, 0xf0, 0x20, 0xf1, 0x20, 0xf2, 0x20, 0xf3,
+0x20, 0xf4, 0x20, 0xf5, 0x20, 0xf6, 0x20, 0xf7, 0x20, 0x10, 0xff,
+0x11, 0xff, 0x12, 0xff, 0x13, 0xff, 0x14, 0xff, 0x15, 0xff, 0x16,
+0xff, 0x17, 0xff, 0x20, 0xff, 0x21, 0xff, 0x22, 0xff, 0x23, 0xff,
+0x24, 0xff, 0x25, 0xff, 0x26, 0xff, 0x27, 0xff, 0x30, 0x00, 0x31,
+0x00, 0x32, 0x00, 0x33, 0x00, 0x34, 0x00, 0x35, 0x00, 0x36, 0x00,
+0x37, 0x00, 0x40, 0x00, 0x41, 0x00, 0x42, 0x00, 0x43, 0x00, 0x44,
+0x00, 0x45, 0x00, 0x46, 0x00, 0x47, 0x00, 0x50, 0x00, 0x51, 0x00,
+0x52, 0x00, 0x53, 0x00, 0x54, 0x00, 0x55, 0x00, 0x56, 0x00, 0x57,
+0x00, 0x60, 0x00, 0x61, 0x00, 0x62, 0x00, 0x63, 0x00, 0x64, 0x00,
+0x65, 0x00, 0x66, 0x00, 0x67, 0x00, 0x70, 0xc0, 0x71, 0xc0, 0x72,
+0xc0, 0x73, 0xc0, 0x74, 0xc0, 0x75, 0xc0, 0x76, 0xc0, 0x77, 0xc0,
+0x80, 0x00, 0x81, 0x00, 0x82, 0x00, 0x83, 0x00, 0x84, 0x00, 0x85,
+0x00, 0x86, 0x00, 0x87, 0x00, 0x90, 0x00, 0x91, 0x00, 0x92, 0x00,
+0x93, 0x00, 0x94, 0x00, 0x95, 0x00, 0x96, 0x00, 0x97, 0x00, 0xa0,
+0x00, 0xa1, 0x00, 0xa2, 0x00, 0xa3, 0x00, 0xa4, 0x00, 0xa5, 0x00,
+0xa6, 0x00, 0xa7, 0x00, 0xc0, 0x00, 0xc1, 0x00, 0xc2, 0x00, 0xc3,
+0x00, 0xc4, 0x00, 0xc5, 0x00, 0xc6, 0x00, 0xc7, 0x00, 0xd0, 0x00,
+0xd1, 0x00, 0xd2, 0x00, 0xd3, 0x00, 0xd4, 0x00, 0xd5, 0x00, 0xd6,
+0x00, 0xd7, 0x00, 0xe0, 0x00, 0xe1, 0x00, 0xe2, 0x00, 0xe3, 0x00,
+0xe4, 0x00, 0xe5, 0x00, 0xe6, 0x00, 0xe7, 0x00, 0x01, 0x00, 0x02,
+0x01, 0x01, 0x01, 0x02, 0x01, 0x01, 0x02, 0x02, 0x01, 0x01, 0x03,
+0x02, 0x01, 0x01, 0x04, 0x02, 0x01, 0x01, 0x05, 0x02, 0x01, 0x01,
+0x06, 0x02, 0x01, 0x01, 0x07, 0x02, 0x01
+};
+static unsigned char coefficients[] __initdata = {
+0x07, 0x46, 0x00, 0x00, 0x07, 0x49, 0x00, 0x00, 0x00, 0x4b, 0x03,
+0x11, 0x00, 0x4d, 0x01, 0x32, 0x07, 0x46, 0x00, 0x00, 0x07, 0x49,
+0x00, 0x00, 0x07, 0x40, 0x00, 0x00, 0x07, 0x41, 0x00, 0x00, 0x01,
+0x40, 0x02, 0x40, 0x01, 0x41, 0x02, 0x60, 0x07, 0x40, 0x00, 0x00,
+0x07, 0x41, 0x00, 0x00, 0x07, 0x47, 0x00, 0x00, 0x07, 0x4a, 0x00,
+0x00, 0x00, 0x47, 0x01, 0x00, 0x00, 0x4a, 0x01, 0x20, 0x07, 0x47,
+0x00, 0x00, 0x07, 0x4a, 0x00, 0x00, 0x07, 0x7c, 0x00, 0x00, 0x07,
+0x7e, 0x00, 0x00, 0x00, 0x00, 0x01, 0x1c, 0x07, 0x7c, 0x00, 0x00,
+0x07, 0x7e, 0x00, 0x00, 0x07, 0x44, 0x00, 0x00, 0x00, 0x44, 0x01,
+0x00, 0x07, 0x44, 0x00, 0x00, 0x07, 0x42, 0x00, 0x00, 0x07, 0x43,
+0x00, 0x00, 0x00, 0x42, 0x01, 0x1a, 0x00, 0x43, 0x01, 0x20, 0x07,
+0x42, 0x00, 0x00, 0x07, 0x43, 0x00, 0x00, 0x07, 0x40, 0x00, 0x00,
+0x07, 0x41, 0x00, 0x00, 0x01, 0x40, 0x02, 0x40, 0x01, 0x41, 0x02,
+0x60, 0x07, 0x40, 0x00, 0x00, 0x07, 0x41, 0x00, 0x00, 0x07, 0x44,
+0x0f, 0xff, 0x07, 0x42, 0x00, 0x00, 0x07, 0x43, 0x00, 0x00, 0x07,
+0x40, 0x00, 0x00, 0x07, 0x41, 0x00, 0x00, 0x07, 0x51, 0x06, 0x40,
+0x07, 0x50, 0x06, 0x40, 0x07, 0x4f, 0x03, 0x81, 0x07, 0x53, 0x1a,
+0x76, 0x07, 0x54, 0x0d, 0x8b, 0x07, 0x55, 0x04, 0xe9, 0x07, 0x56,
+0x0b, 0x17, 0x07, 0x57, 0x1a, 0x38, 0x07, 0x58, 0x0d, 0xc9, 0x07,
+0x59, 0x04, 0x6f, 0x07, 0x5a, 0x0b, 0x91, 0x07, 0x73, 0x14, 0xda,
+0x07, 0x74, 0x0d, 0x93, 0x07, 0x75, 0x04, 0xd9, 0x07, 0x76, 0x05,
+0x93, 0x07, 0x77, 0x14, 0xda, 0x07, 0x78, 0x0d, 0x93, 0x07, 0x79,
+0x04, 0xd9, 0x07, 0x7a, 0x05, 0x93, 0x07, 0x5e, 0x03, 0x68, 0x07,
+0x5c, 0x04, 0x31, 0x07, 0x5d, 0x04, 0x31, 0x07, 0x62, 0x03, 0x52,
+0x07, 0x60, 0x04, 0x76, 0x07, 0x61, 0x04, 0x76, 0x07, 0x66, 0x03,
+0x2e, 0x07, 0x64, 0x04, 0xda, 0x07, 0x65, 0x04, 0xda, 0x07, 0x6a,
+0x02, 0xf6, 0x07, 0x68, 0x05, 0x62, 0x07, 0x69, 0x05, 0x62, 0x06,
+0x46, 0x0a, 0x22, 0x06, 0x48, 0x0d, 0x24, 0x06, 0x6e, 0x11, 0xd3,
+0x06, 0x70, 0x15, 0xcb, 0x06, 0x52, 0x20, 0x93, 0x06, 0x54, 0x20,
+0x54, 0x06, 0x4a, 0x27, 0x1d, 0x06, 0x58, 0x2f, 0xc8, 0x06, 0x5c,
+0x30, 0x07, 0x06, 0x4c, 0x37, 0x90, 0x06, 0x60, 0x3d, 0xdb, 0x06,
+0x64, 0x3e, 0x42, 0x06, 0x4e, 0x45, 0x78, 0x06, 0x68, 0x4c, 0x48,
+0x06, 0x6c, 0x4c, 0x6c, 0x06, 0x50, 0x52, 0xe2, 0x06, 0x42, 0x02,
+0xba
+};
+static unsigned char coefficients2[] __initdata = {
+0x07, 0x46, 0x00, 0x00, 0x07, 0x49, 0x00, 0x00, 0x07, 0x45, 0x0f,
+0xff, 0x07, 0x48, 0x0f, 0xff, 0x07, 0x7b, 0x04, 0xcc, 0x07, 0x7d,
+0x04, 0xcc, 0x07, 0x7c, 0x00, 0x00, 0x07, 0x7e, 0x00, 0x00, 0x07,
+0x46, 0x00, 0x00, 0x07, 0x49, 0x00, 0x00, 0x07, 0x47, 0x00, 0x00,
+0x07, 0x4a, 0x00, 0x00, 0x07, 0x4c, 0x00, 0x00, 0x07, 0x4e, 0x00, 0x00
+};
+static unsigned char coefficients3[] __initdata = {
+0x00, 0x00, 0x00, 0x00, 0x00, 0x28, 0x00, 0x28, 0x00, 0x51, 0x00,
+0x51, 0x00, 0x7a, 0x00, 0x7a, 0x00, 0xa3, 0x00, 0xa3, 0x00, 0xcc,
+0x00, 0xcc, 0x00, 0xf5, 0x00, 0xf5, 0x01, 0x1e, 0x01, 0x1e, 0x01,
+0x47, 0x01, 0x47, 0x01, 0x70, 0x01, 0x70, 0x01, 0x99, 0x01, 0x99,
+0x01, 0xc2, 0x01, 0xc2, 0x01, 0xeb, 0x01, 0xeb, 0x02, 0x14, 0x02,
+0x14, 0x02, 0x3d, 0x02, 0x3d, 0x02, 0x66, 0x02, 0x66, 0x02, 0x8f,
+0x02, 0x8f, 0x02, 0xb8, 0x02, 0xb8, 0x02, 0xe1, 0x02, 0xe1, 0x03,
+0x0a, 0x03, 0x0a, 0x03, 0x33, 0x03, 0x33, 0x03, 0x5c, 0x03, 0x5c,
+0x03, 0x85, 0x03, 0x85, 0x03, 0xae, 0x03, 0xae, 0x03, 0xd7, 0x03,
+0xd7, 0x04, 0x00, 0x04, 0x00, 0x04, 0x28, 0x04, 0x28, 0x04, 0x51,
+0x04, 0x51, 0x04, 0x7a, 0x04, 0x7a, 0x04, 0xa3, 0x04, 0xa3, 0x04,
+0xcc, 0x04, 0xcc, 0x04, 0xf5, 0x04, 0xf5, 0x05, 0x1e, 0x05, 0x1e,
+0x05, 0x47, 0x05, 0x47, 0x05, 0x70, 0x05, 0x70, 0x05, 0x99, 0x05,
+0x99, 0x05, 0xc2, 0x05, 0xc2, 0x05, 0xeb, 0x05, 0xeb, 0x06, 0x14,
+0x06, 0x14, 0x06, 0x3d, 0x06, 0x3d, 0x06, 0x66, 0x06, 0x66, 0x06,
+0x8f, 0x06, 0x8f, 0x06, 0xb8, 0x06, 0xb8, 0x06, 0xe1, 0x06, 0xe1,
+0x07, 0x0a, 0x07, 0x0a, 0x07, 0x33, 0x07, 0x33, 0x07, 0x5c, 0x07,
+0x5c, 0x07, 0x85, 0x07, 0x85, 0x07, 0xae, 0x07, 0xae, 0x07, 0xd7,
+0x07, 0xd7, 0x08, 0x00, 0x08, 0x00, 0x08, 0x28, 0x08, 0x28, 0x08,
+0x51, 0x08, 0x51, 0x08, 0x7a, 0x08, 0x7a, 0x08, 0xa3, 0x08, 0xa3,
+0x08, 0xcc, 0x08, 0xcc, 0x08, 0xf5, 0x08, 0xf5, 0x09, 0x1e, 0x09,
+0x1e, 0x09, 0x47, 0x09, 0x47, 0x09, 0x70, 0x09, 0x70, 0x09, 0x99,
+0x09, 0x99, 0x09, 0xc2, 0x09, 0xc2, 0x09, 0xeb, 0x09, 0xeb, 0x0a,
+0x14, 0x0a, 0x14, 0x0a, 0x3d, 0x0a, 0x3d, 0x0a, 0x66, 0x0a, 0x66,
+0x0a, 0x8f, 0x0a, 0x8f, 0x0a, 0xb8, 0x0a, 0xb8, 0x0a, 0xe1, 0x0a,
+0xe1, 0x0b, 0x0a, 0x0b, 0x0a, 0x0b, 0x33, 0x0b, 0x33, 0x0b, 0x5c,
+0x0b, 0x5c, 0x0b, 0x85, 0x0b, 0x85, 0x0b, 0xae, 0x0b, 0xae, 0x0b,
+0xd7, 0x0b, 0xd7, 0x0c, 0x00, 0x0c, 0x00, 0x0c, 0x28, 0x0c, 0x28,
+0x0c, 0x51, 0x0c, 0x51, 0x0c, 0x7a, 0x0c, 0x7a, 0x0c, 0xa3, 0x0c,
+0xa3, 0x0c, 0xcc, 0x0c, 0xcc, 0x0c, 0xf5, 0x0c, 0xf5, 0x0d, 0x1e,
+0x0d, 0x1e, 0x0d, 0x47, 0x0d, 0x47, 0x0d, 0x70, 0x0d, 0x70, 0x0d,
+0x99, 0x0d, 0x99, 0x0d, 0xc2, 0x0d, 0xc2, 0x0d, 0xeb, 0x0d, 0xeb,
+0x0e, 0x14, 0x0e, 0x14, 0x0e, 0x3d, 0x0e, 0x3d, 0x0e, 0x66, 0x0e,
+0x66, 0x0e, 0x8f, 0x0e, 0x8f, 0x0e, 0xb8, 0x0e, 0xb8, 0x0e, 0xe1,
+0x0e, 0xe1, 0x0f, 0x0a, 0x0f, 0x0a, 0x0f, 0x33, 0x0f, 0x33, 0x0f,
+0x5c, 0x0f, 0x5c, 0x0f, 0x85, 0x0f, 0x85, 0x0f, 0xae, 0x0f, 0xae,
+0x0f, 0xd7, 0x0f, 0xd7, 0x0f, 0xff, 0x0f, 0xff
+};
+
+static int
+wavefront_fx_idle (snd_wavefront_t *dev)
+
+{
+	int i;
+	unsigned int x = 0x80;
+
+	for (i = 0; i < 1000; i++) {
+		x = inb (dev->fx_status);
+		if ((x & 0x80) == 0) {
+			break;
+		}
+	}
+
+	if (x & 0x80) {
+		snd_printk ("FX device never idle.\n");
+		return 0;
+	}
+
+	return (1);
+}
+
+static void
+wavefront_fx_mute (snd_wavefront_t *dev, int onoff)
+
+{
+	if (!wavefront_fx_idle(dev)) {
+		return;
+	}
+
+	outb (onoff ? 0x02 : 0x00, dev->fx_op);
+}
+
+static int
+wavefront_fx_memset (snd_wavefront_t *dev,
+		     int page,
+		     int addr,
+		     int cnt,
+		     unsigned short *data)
+{
+	if (page < 0 || page > 7) {
+		snd_printk ("FX memset: "
+			"page must be >= 0 and <= 7\n");
+		return -(EINVAL);
+	}
+
+	if (addr < 0 || addr > 0x7f) {
+		snd_printk ("FX memset: "
+			"addr must be >= 0 and <= 7f\n");
+		return -(EINVAL);
+	}
+
+	if (cnt == 1) {
+
+		outb (FX_LSB_TRANSFER, dev->fx_lcr);
+		outb (page, dev->fx_dsp_page);
+		outb (addr, dev->fx_dsp_addr);
+		outb ((data[0] >> 8), dev->fx_dsp_msb);
+		outb ((data[0] & 0xff), dev->fx_dsp_lsb);
+
+		snd_printk ("FX: addr %d:%x set to 0x%x\n",
+			page, addr, data[0]);
+
+	} else {
+		int i;
+
+		outb (FX_AUTO_INCR|FX_LSB_TRANSFER, dev->fx_lcr);
+		outb (page, dev->fx_dsp_page);
+		outb (addr, dev->fx_dsp_addr);
+
+		for (i = 0; i < cnt; i++) {
+			outb ((data[i] >> 8), dev->fx_dsp_msb);
+			outb ((data[i] & 0xff), dev->fx_dsp_lsb);
+			if (!wavefront_fx_idle (dev)) {
+				break;
+			}
+		}
+
+		if (i != cnt) {
+			snd_printk ("FX memset "
+				    "(0x%x, 0x%x, 0x%lx, %d) incomplete\n",
+				    page, addr, (unsigned long) data, cnt);
+			return -(EIO);
+		}
+	}
+
+	return 0;
+}
+
+int
+snd_wavefront_fx_detect (snd_wavefront_t *dev)
+
+{
+	/* This is a crude check, but its the best one I have for now.
+	   Certainly on the Maui and the Tropez, wavefront_fx_idle() will
+	   report "never idle", which suggests that this test should
+	   work OK.
+	*/
+
+	if (inb (dev->fx_status) & 0x80) {
+		snd_printk ("Hmm, probably a Maui or Tropez.\n");
+		return -1;
+	}
+
+	return 0;
+}
+
+int
 snd_wavefront_fx_open (snd_hwdep_t *hw, struct file *file)
 
 {
@@ -691,324 +1010,3 @@ snd_wavefront_fx_start (snd_wavefront_t *dev)
 
 	return (0);
 }
-
-/* weird stuff, derived from port I/O tracing with dosemu */
-
-static unsigned char page_zero[] __initdata = {
-0x01, 0x7c, 0x00, 0x1e, 0x00, 0x00, 0x00, 0x00, 0x00, 0xf5, 0x00,
-0x11, 0x00, 0x20, 0x00, 0x32, 0x00, 0x40, 0x00, 0x13, 0x00, 0x00,
-0x00, 0x14, 0x02, 0x76, 0x00, 0x60, 0x00, 0x80, 0x02, 0x00, 0x00,
-0x00, 0x00, 0x00, 0x02, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
-0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
-0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
-0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
-0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
-0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
-0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
-0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
-0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x18, 0x00, 0x19,
-0x01, 0x1a, 0x01, 0x20, 0x01, 0x40, 0x01, 0x17, 0x00, 0x00, 0x01,
-0x80, 0x01, 0x20, 0x00, 0x10, 0x01, 0xa0, 0x03, 0xd1, 0x00, 0x00,
-0x01, 0xf2, 0x02, 0x00, 0x00, 0x13, 0x00, 0x00, 0x00, 0xf4, 0x02,
-0xe0, 0x00, 0x15, 0x00, 0x00, 0x00, 0x16, 0x00, 0x00, 0x00, 0x17,
-0x00, 0x20, 0x00, 0x00, 0x00, 0x20, 0x00, 0x50, 0x00, 0x00, 0x00,
-0x40, 0x00, 0x00, 0x00, 0x71, 0x02, 0x00, 0x00, 0x60, 0x00, 0x00,
-0x00, 0x92, 0x00, 0x00, 0x00, 0x80, 0x00, 0x00, 0x00, 0xb3, 0x02,
-0x00, 0x00, 0xa0, 0x00, 0x00, 0x00, 0xd4, 0x00, 0x00, 0x00, 0x40,
-0x00, 0x80, 0x00, 0xf5, 0x00, 0x20, 0x00, 0x70, 0x00, 0xa0, 0x02,
-0x11, 0x00, 0x16, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x20,
-0x02, 0x00, 0x00, 0x20, 0x00, 0x10, 0x00, 0x17, 0x00, 0x1b, 0x00,
-0x1d, 0x02, 0xdf
-};    
-
-static unsigned char page_one[] __initdata = {
-0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x00, 0x00, 0x19, 0x00,
-0x1f, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x03, 0xd8, 0x00, 0x00,
-0x02, 0x20, 0x00, 0x19, 0x00, 0x00, 0x00, 0x00, 0x00, 0x18, 0x01,
-0xc0, 0x01, 0xfa, 0x00, 0x1a, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
-0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
-0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
-0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
-0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
-0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
-0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
-0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
-0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x40, 0x02, 0x60,
-0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xc0, 0x02, 0x80, 0x00,
-0x00, 0x02, 0xfb, 0x02, 0xa0, 0x00, 0x00, 0x00, 0x1b, 0x02, 0xd7,
-0x00, 0x00, 0x02, 0xf7, 0x03, 0x20, 0x03, 0x00, 0x00, 0x00, 0x00,
-0x1c, 0x03, 0x3c, 0x00, 0x00, 0x03, 0x3f, 0x00, 0x00, 0x03, 0xc0,
-0x00, 0x00, 0x03, 0xdf, 0x00, 0x00, 0x00, 0x00, 0x03, 0x5d, 0x00,
-0x00, 0x03, 0xc0, 0x00, 0x00, 0x03, 0x7d, 0x00, 0x00, 0x03, 0xc0,
-0x00, 0x00, 0x03, 0x9e, 0x00, 0x00, 0x03, 0xc0, 0x00, 0x00, 0x03,
-0xbe, 0x00, 0x00, 0x03, 0xc0, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
-0x00, 0x00, 0x00, 0x1b, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02,
-0xdb, 0x00, 0x00, 0x02, 0xdb, 0x00, 0x00, 0x02, 0xe0, 0x00, 0x00,
-0x02, 0xfb, 0x00, 0x00, 0x02, 0xc0, 0x02, 0x40, 0x02, 0xfb, 0x02,
-0x60, 0x00, 0x1b
-};
-
-static unsigned char page_two[] __initdata = {
-0xc4, 0x00, 0x44, 0x07, 0x44, 0x00, 0x40, 0x25, 0x01, 0x06, 0xc4,
-0x07, 0x40, 0x25, 0x01, 0x00, 0x46, 0x46, 0x00, 0x00, 0x00, 0x00,
-0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
-0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
-0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
-0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x46, 0x07,
-0x05, 0x05, 0x05, 0x04, 0x07, 0x05, 0x04, 0x07, 0x05, 0x44, 0x46,
-0x44, 0x46, 0x46, 0x07, 0x05, 0x44, 0x46, 0x05, 0x46, 0x05, 0x46,
-0x05, 0x46, 0x05, 0x44, 0x46, 0x05, 0x07, 0x44, 0x46, 0x05, 0x07,
-0x44, 0x46, 0x05, 0x07, 0x44, 0x46, 0x05, 0x07, 0x44, 0x05, 0x05,
-0x05, 0x44, 0x05, 0x05, 0x05, 0x46, 0x05, 0x46, 0x05, 0x46, 0x05,
-0x46, 0x05, 0x46, 0x07, 0x46, 0x07, 0x44
-};
-
-static unsigned char page_three[] __initdata = {
-0x07, 0x40, 0x00, 0x00, 0x00, 0x47, 0x00, 0x40, 0x00, 0x40, 0x06,
-0x40, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
-0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
-0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
-0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
-0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x80, 0x80,
-0xc0, 0x00, 0x00, 0x40, 0x00, 0x00, 0x00, 0x40, 0x00, 0x40, 0x00,
-0x60, 0x00, 0x70, 0x00, 0x40, 0x00, 0x40, 0x00, 0x42, 0x00, 0x40,
-0x00, 0x02, 0x00, 0x40, 0x00, 0x00, 0x00, 0x40, 0x00, 0x00, 0x00,
-0x40, 0x00, 0x00, 0x00, 0x40, 0x00, 0x00, 0x00, 0x40, 0x00, 0x00,
-0x00, 0x42, 0x00, 0x40, 0x00, 0x42, 0x00, 0x02, 0x00, 0x02, 0x00,
-0x02, 0x00, 0x42, 0x00, 0xc0, 0x00, 0x40
-};
-
-static unsigned char page_four[] __initdata = {
-0x63, 0x03, 0x26, 0x02, 0x2c, 0x00, 0x24, 0x00, 0x2e, 0x02, 0x02,
-0x02, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
-0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
-0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
-0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
-0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x01,
-0x20, 0x00, 0x60, 0x00, 0x20, 0x00, 0x20, 0x00, 0x20, 0x00, 0x20,
-0x00, 0x20, 0x00, 0x20, 0x00, 0x20, 0x00, 0x20, 0x00, 0x60, 0x00,
-0x20, 0x00, 0x60, 0x00, 0x20, 0x00, 0x60, 0x00, 0x20, 0x00, 0x60,
-0x00, 0x20, 0x00, 0x60, 0x00, 0x20, 0x00, 0x60, 0x00, 0x20, 0x00,
-0x20, 0x00, 0x22, 0x02, 0x22, 0x02, 0x20, 0x00, 0x60, 0x00, 0x22,
-0x02, 0x62, 0x02, 0x20, 0x01, 0x21, 0x01
-};
-
-static unsigned char page_six[] __initdata = {
-0x00, 0x00, 0x00, 0x02, 0x00, 0x00, 0x04, 0x00, 0x00, 0x06, 0x00,
-0x00, 0x08, 0x00, 0x00, 0x0a, 0x00, 0x00, 0x0c, 0x00, 0x00, 0x0e,
-0x00, 0x00, 0x10, 0x00, 0x00, 0x12, 0x00, 0x00, 0x14, 0x00, 0x00,
-0x16, 0x00, 0x00, 0x18, 0x00, 0x00, 0x1a, 0x00, 0x00, 0x1c, 0x00,
-0x00, 0x1e, 0x00, 0x00, 0x20, 0x00, 0x00, 0x22, 0x00, 0x00, 0x24,
-0x00, 0x00, 0x26, 0x00, 0x00, 0x28, 0x00, 0x00, 0x2a, 0x00, 0x00,
-0x2c, 0x00, 0x00, 0x2e, 0x00, 0x00, 0x30, 0x00, 0x00, 0x32, 0x00,
-0x00, 0x34, 0x00, 0x00, 0x36, 0x00, 0x00, 0x38, 0x00, 0x00, 0x3a,
-0x00, 0x00, 0x3c, 0x00, 0x00, 0x3e, 0x00, 0x00, 0x40, 0x00, 0x00,
-0x42, 0x03, 0x00, 0x44, 0x01, 0x00, 0x46, 0x0a, 0x21, 0x48, 0x0d,
-0x23, 0x4a, 0x23, 0x1b, 0x4c, 0x37, 0x8f, 0x4e, 0x45, 0x77, 0x50,
-0x52, 0xe2, 0x52, 0x1c, 0x92, 0x54, 0x1c, 0x52, 0x56, 0x07, 0x00,
-0x58, 0x2f, 0xc6, 0x5a, 0x0b, 0x00, 0x5c, 0x30, 0x06, 0x5e, 0x17,
-0x00, 0x60, 0x3d, 0xda, 0x62, 0x29, 0x00, 0x64, 0x3e, 0x41, 0x66,
-0x39, 0x00, 0x68, 0x4c, 0x48, 0x6a, 0x49, 0x00, 0x6c, 0x4c, 0x6c,
-0x6e, 0x11, 0xd2, 0x70, 0x16, 0x0c, 0x72, 0x00, 0x00, 0x74, 0x00,
-0x80, 0x76, 0x0f, 0x00, 0x78, 0x00, 0x80, 0x7a, 0x13, 0x00, 0x7c,
-0x80, 0x00, 0x7e, 0x80, 0x80
-};
-
-static unsigned char page_seven[] __initdata = {
-0x0f, 0xff, 0x00, 0x00, 0x08, 0x00, 0x08, 0x00, 0x02, 0x00, 0x00,
-0x00, 0x00, 0x00, 0x0f, 0xff, 0x00, 0x00, 0x00, 0x00, 0x08, 0x00,
-0x08, 0x00, 0x00, 0x00, 0x0f, 0xff, 0x00, 0x00, 0x00, 0x00, 0x0f,
-0xff, 0x0f, 0xff, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
-0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
-0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
-0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
-0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
-0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
-0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
-0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
-0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
-0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
-0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x0f, 0xff, 0x0f, 0xff,
-0x0f, 0xff, 0x0f, 0xff, 0x02, 0xe9, 0x06, 0x8c, 0x06, 0x8c, 0x0f,
-0xff, 0x1a, 0x75, 0x0d, 0x8b, 0x04, 0xe9, 0x0b, 0x16, 0x1a, 0x38,
-0x0d, 0xc8, 0x04, 0x6f, 0x0b, 0x91, 0x0f, 0xff, 0x06, 0x40, 0x06,
-0x40, 0x02, 0x8f, 0x0f, 0xff, 0x06, 0x62, 0x06, 0x62, 0x02, 0x7b,
-0x0f, 0xff, 0x06, 0x97, 0x06, 0x97, 0x02, 0x52, 0x0f, 0xff, 0x06,
-0xf6, 0x06, 0xf6, 0x02, 0x19, 0x05, 0x55, 0x05, 0x55, 0x05, 0x55,
-0x05, 0x55, 0x05, 0x55, 0x05, 0x55, 0x05, 0x55, 0x05, 0x55, 0x14,
-0xda, 0x0d, 0x93, 0x04, 0xda, 0x05, 0x93, 0x14, 0xda, 0x0d, 0x93,
-0x04, 0xda, 0x05, 0x93, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
-0x00, 0x02, 0x00
-};
-
-static unsigned char page_zero_v2[] __initdata = {
-0x00, 0x00, 0x00, 0x00, 0x02, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
-0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
-0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
-0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
-0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
-0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
-0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
-0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
-0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00
-};
-
-static unsigned char page_one_v2[] __initdata = {
-0x01, 0xc0, 0x01, 0xfa, 0x00, 0x1a, 0x00, 0x00, 0x00, 0x00, 0x00,
-0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
-0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
-0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
-0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
-0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
-0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
-0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
-0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00
-};
-
-static unsigned char page_two_v2[] __initdata = {
-0x46, 0x46, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
-0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
-0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
-0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
-0x00, 0x00, 0x00, 0x00
-};
-static unsigned char page_three_v2[] __initdata = {
-0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
-0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
-0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
-0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
-0x00, 0x00, 0x00, 0x00
-};
-static unsigned char page_four_v2[] __initdata = {
-0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
-0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
-0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
-0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
-0x00, 0x00, 0x00, 0x00
-};
-
-static unsigned char page_seven_v2[] __initdata = {
-0x0f, 0xff, 0x0f, 0xff, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
-0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
-0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
-0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
-0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
-0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
-0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
-0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
-0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00
-};
-
-static unsigned char mod_v2[] __initdata = {
-0x01, 0x00, 0x02, 0x00, 0x01, 0x01, 0x02, 0x00, 0x01, 0x02, 0x02,
-0x00, 0x01, 0x03, 0x02, 0x00, 0x01, 0x04, 0x02, 0x00, 0x01, 0x05,
-0x02, 0x00, 0x01, 0x06, 0x02, 0x00, 0x01, 0x07, 0x02, 0x00, 0xb0,
-0x20, 0xb1, 0x20, 0xb2, 0x20, 0xb3, 0x20, 0xb4, 0x20, 0xb5, 0x20,
-0xb6, 0x20, 0xb7, 0x20, 0xf0, 0x20, 0xf1, 0x20, 0xf2, 0x20, 0xf3,
-0x20, 0xf4, 0x20, 0xf5, 0x20, 0xf6, 0x20, 0xf7, 0x20, 0x10, 0xff,
-0x11, 0xff, 0x12, 0xff, 0x13, 0xff, 0x14, 0xff, 0x15, 0xff, 0x16,
-0xff, 0x17, 0xff, 0x20, 0xff, 0x21, 0xff, 0x22, 0xff, 0x23, 0xff,
-0x24, 0xff, 0x25, 0xff, 0x26, 0xff, 0x27, 0xff, 0x30, 0x00, 0x31,
-0x00, 0x32, 0x00, 0x33, 0x00, 0x34, 0x00, 0x35, 0x00, 0x36, 0x00,
-0x37, 0x00, 0x40, 0x00, 0x41, 0x00, 0x42, 0x00, 0x43, 0x00, 0x44,
-0x00, 0x45, 0x00, 0x46, 0x00, 0x47, 0x00, 0x50, 0x00, 0x51, 0x00,
-0x52, 0x00, 0x53, 0x00, 0x54, 0x00, 0x55, 0x00, 0x56, 0x00, 0x57,
-0x00, 0x60, 0x00, 0x61, 0x00, 0x62, 0x00, 0x63, 0x00, 0x64, 0x00,
-0x65, 0x00, 0x66, 0x00, 0x67, 0x00, 0x70, 0xc0, 0x71, 0xc0, 0x72,
-0xc0, 0x73, 0xc0, 0x74, 0xc0, 0x75, 0xc0, 0x76, 0xc0, 0x77, 0xc0,
-0x80, 0x00, 0x81, 0x00, 0x82, 0x00, 0x83, 0x00, 0x84, 0x00, 0x85,
-0x00, 0x86, 0x00, 0x87, 0x00, 0x90, 0x00, 0x91, 0x00, 0x92, 0x00,
-0x93, 0x00, 0x94, 0x00, 0x95, 0x00, 0x96, 0x00, 0x97, 0x00, 0xa0,
-0x00, 0xa1, 0x00, 0xa2, 0x00, 0xa3, 0x00, 0xa4, 0x00, 0xa5, 0x00,
-0xa6, 0x00, 0xa7, 0x00, 0xc0, 0x00, 0xc1, 0x00, 0xc2, 0x00, 0xc3,
-0x00, 0xc4, 0x00, 0xc5, 0x00, 0xc6, 0x00, 0xc7, 0x00, 0xd0, 0x00,
-0xd1, 0x00, 0xd2, 0x00, 0xd3, 0x00, 0xd4, 0x00, 0xd5, 0x00, 0xd6,
-0x00, 0xd7, 0x00, 0xe0, 0x00, 0xe1, 0x00, 0xe2, 0x00, 0xe3, 0x00,
-0xe4, 0x00, 0xe5, 0x00, 0xe6, 0x00, 0xe7, 0x00, 0x01, 0x00, 0x02,
-0x01, 0x01, 0x01, 0x02, 0x01, 0x01, 0x02, 0x02, 0x01, 0x01, 0x03,
-0x02, 0x01, 0x01, 0x04, 0x02, 0x01, 0x01, 0x05, 0x02, 0x01, 0x01,
-0x06, 0x02, 0x01, 0x01, 0x07, 0x02, 0x01
-};
-static unsigned char coefficients[] __initdata = {
-0x07, 0x46, 0x00, 0x00, 0x07, 0x49, 0x00, 0x00, 0x00, 0x4b, 0x03,
-0x11, 0x00, 0x4d, 0x01, 0x32, 0x07, 0x46, 0x00, 0x00, 0x07, 0x49,
-0x00, 0x00, 0x07, 0x40, 0x00, 0x00, 0x07, 0x41, 0x00, 0x00, 0x01,
-0x40, 0x02, 0x40, 0x01, 0x41, 0x02, 0x60, 0x07, 0x40, 0x00, 0x00,
-0x07, 0x41, 0x00, 0x00, 0x07, 0x47, 0x00, 0x00, 0x07, 0x4a, 0x00,
-0x00, 0x00, 0x47, 0x01, 0x00, 0x00, 0x4a, 0x01, 0x20, 0x07, 0x47,
-0x00, 0x00, 0x07, 0x4a, 0x00, 0x00, 0x07, 0x7c, 0x00, 0x00, 0x07,
-0x7e, 0x00, 0x00, 0x00, 0x00, 0x01, 0x1c, 0x07, 0x7c, 0x00, 0x00,
-0x07, 0x7e, 0x00, 0x00, 0x07, 0x44, 0x00, 0x00, 0x00, 0x44, 0x01,
-0x00, 0x07, 0x44, 0x00, 0x00, 0x07, 0x42, 0x00, 0x00, 0x07, 0x43,
-0x00, 0x00, 0x00, 0x42, 0x01, 0x1a, 0x00, 0x43, 0x01, 0x20, 0x07,
-0x42, 0x00, 0x00, 0x07, 0x43, 0x00, 0x00, 0x07, 0x40, 0x00, 0x00,
-0x07, 0x41, 0x00, 0x00, 0x01, 0x40, 0x02, 0x40, 0x01, 0x41, 0x02,
-0x60, 0x07, 0x40, 0x00, 0x00, 0x07, 0x41, 0x00, 0x00, 0x07, 0x44,
-0x0f, 0xff, 0x07, 0x42, 0x00, 0x00, 0x07, 0x43, 0x00, 0x00, 0x07,
-0x40, 0x00, 0x00, 0x07, 0x41, 0x00, 0x00, 0x07, 0x51, 0x06, 0x40,
-0x07, 0x50, 0x06, 0x40, 0x07, 0x4f, 0x03, 0x81, 0x07, 0x53, 0x1a,
-0x76, 0x07, 0x54, 0x0d, 0x8b, 0x07, 0x55, 0x04, 0xe9, 0x07, 0x56,
-0x0b, 0x17, 0x07, 0x57, 0x1a, 0x38, 0x07, 0x58, 0x0d, 0xc9, 0x07,
-0x59, 0x04, 0x6f, 0x07, 0x5a, 0x0b, 0x91, 0x07, 0x73, 0x14, 0xda,
-0x07, 0x74, 0x0d, 0x93, 0x07, 0x75, 0x04, 0xd9, 0x07, 0x76, 0x05,
-0x93, 0x07, 0x77, 0x14, 0xda, 0x07, 0x78, 0x0d, 0x93, 0x07, 0x79,
-0x04, 0xd9, 0x07, 0x7a, 0x05, 0x93, 0x07, 0x5e, 0x03, 0x68, 0x07,
-0x5c, 0x04, 0x31, 0x07, 0x5d, 0x04, 0x31, 0x07, 0x62, 0x03, 0x52,
-0x07, 0x60, 0x04, 0x76, 0x07, 0x61, 0x04, 0x76, 0x07, 0x66, 0x03,
-0x2e, 0x07, 0x64, 0x04, 0xda, 0x07, 0x65, 0x04, 0xda, 0x07, 0x6a,
-0x02, 0xf6, 0x07, 0x68, 0x05, 0x62, 0x07, 0x69, 0x05, 0x62, 0x06,
-0x46, 0x0a, 0x22, 0x06, 0x48, 0x0d, 0x24, 0x06, 0x6e, 0x11, 0xd3,
-0x06, 0x70, 0x15, 0xcb, 0x06, 0x52, 0x20, 0x93, 0x06, 0x54, 0x20,
-0x54, 0x06, 0x4a, 0x27, 0x1d, 0x06, 0x58, 0x2f, 0xc8, 0x06, 0x5c,
-0x30, 0x07, 0x06, 0x4c, 0x37, 0x90, 0x06, 0x60, 0x3d, 0xdb, 0x06,
-0x64, 0x3e, 0x42, 0x06, 0x4e, 0x45, 0x78, 0x06, 0x68, 0x4c, 0x48,
-0x06, 0x6c, 0x4c, 0x6c, 0x06, 0x50, 0x52, 0xe2, 0x06, 0x42, 0x02,
-0xba
-};
-static unsigned char coefficients2[] __initdata = {
-0x07, 0x46, 0x00, 0x00, 0x07, 0x49, 0x00, 0x00, 0x07, 0x45, 0x0f,
-0xff, 0x07, 0x48, 0x0f, 0xff, 0x07, 0x7b, 0x04, 0xcc, 0x07, 0x7d,
-0x04, 0xcc, 0x07, 0x7c, 0x00, 0x00, 0x07, 0x7e, 0x00, 0x00, 0x07,
-0x46, 0x00, 0x00, 0x07, 0x49, 0x00, 0x00, 0x07, 0x47, 0x00, 0x00,
-0x07, 0x4a, 0x00, 0x00, 0x07, 0x4c, 0x00, 0x00, 0x07, 0x4e, 0x00, 0x00
-};
-static unsigned char coefficients3[] __initdata = { 
-0x00, 0x00, 0x00, 0x00, 0x00, 0x28, 0x00, 0x28, 0x00, 0x51, 0x00,
-0x51, 0x00, 0x7a, 0x00, 0x7a, 0x00, 0xa3, 0x00, 0xa3, 0x00, 0xcc,
-0x00, 0xcc, 0x00, 0xf5, 0x00, 0xf5, 0x01, 0x1e, 0x01, 0x1e, 0x01,
-0x47, 0x01, 0x47, 0x01, 0x70, 0x01, 0x70, 0x01, 0x99, 0x01, 0x99,
-0x01, 0xc2, 0x01, 0xc2, 0x01, 0xeb, 0x01, 0xeb, 0x02, 0x14, 0x02,
-0x14, 0x02, 0x3d, 0x02, 0x3d, 0x02, 0x66, 0x02, 0x66, 0x02, 0x8f,
-0x02, 0x8f, 0x02, 0xb8, 0x02, 0xb8, 0x02, 0xe1, 0x02, 0xe1, 0x03,
-0x0a, 0x03, 0x0a, 0x03, 0x33, 0x03, 0x33, 0x03, 0x5c, 0x03, 0x5c,
-0x03, 0x85, 0x03, 0x85, 0x03, 0xae, 0x03, 0xae, 0x03, 0xd7, 0x03,
-0xd7, 0x04, 0x00, 0x04, 0x00, 0x04, 0x28, 0x04, 0x28, 0x04, 0x51,
-0x04, 0x51, 0x04, 0x7a, 0x04, 0x7a, 0x04, 0xa3, 0x04, 0xa3, 0x04,
-0xcc, 0x04, 0xcc, 0x04, 0xf5, 0x04, 0xf5, 0x05, 0x1e, 0x05, 0x1e,
-0x05, 0x47, 0x05, 0x47, 0x05, 0x70, 0x05, 0x70, 0x05, 0x99, 0x05,
-0x99, 0x05, 0xc2, 0x05, 0xc2, 0x05, 0xeb, 0x05, 0xeb, 0x06, 0x14,
-0x06, 0x14, 0x06, 0x3d, 0x06, 0x3d, 0x06, 0x66, 0x06, 0x66, 0x06,
-0x8f, 0x06, 0x8f, 0x06, 0xb8, 0x06, 0xb8, 0x06, 0xe1, 0x06, 0xe1,
-0x07, 0x0a, 0x07, 0x0a, 0x07, 0x33, 0x07, 0x33, 0x07, 0x5c, 0x07,
-0x5c, 0x07, 0x85, 0x07, 0x85, 0x07, 0xae, 0x07, 0xae, 0x07, 0xd7,
-0x07, 0xd7, 0x08, 0x00, 0x08, 0x00, 0x08, 0x28, 0x08, 0x28, 0x08,
-0x51, 0x08, 0x51, 0x08, 0x7a, 0x08, 0x7a, 0x08, 0xa3, 0x08, 0xa3,
-0x08, 0xcc, 0x08, 0xcc, 0x08, 0xf5, 0x08, 0xf5, 0x09, 0x1e, 0x09,
-0x1e, 0x09, 0x47, 0x09, 0x47, 0x09, 0x70, 0x09, 0x70, 0x09, 0x99,
-0x09, 0x99, 0x09, 0xc2, 0x09, 0xc2, 0x09, 0xeb, 0x09, 0xeb, 0x0a,
-0x14, 0x0a, 0x14, 0x0a, 0x3d, 0x0a, 0x3d, 0x0a, 0x66, 0x0a, 0x66,
-0x0a, 0x8f, 0x0a, 0x8f, 0x0a, 0xb8, 0x0a, 0xb8, 0x0a, 0xe1, 0x0a,
-0xe1, 0x0b, 0x0a, 0x0b, 0x0a, 0x0b, 0x33, 0x0b, 0x33, 0x0b, 0x5c,
-0x0b, 0x5c, 0x0b, 0x85, 0x0b, 0x85, 0x0b, 0xae, 0x0b, 0xae, 0x0b,
-0xd7, 0x0b, 0xd7, 0x0c, 0x00, 0x0c, 0x00, 0x0c, 0x28, 0x0c, 0x28,
-0x0c, 0x51, 0x0c, 0x51, 0x0c, 0x7a, 0x0c, 0x7a, 0x0c, 0xa3, 0x0c,
-0xa3, 0x0c, 0xcc, 0x0c, 0xcc, 0x0c, 0xf5, 0x0c, 0xf5, 0x0d, 0x1e,
-0x0d, 0x1e, 0x0d, 0x47, 0x0d, 0x47, 0x0d, 0x70, 0x0d, 0x70, 0x0d,
-0x99, 0x0d, 0x99, 0x0d, 0xc2, 0x0d, 0xc2, 0x0d, 0xeb, 0x0d, 0xeb,
-0x0e, 0x14, 0x0e, 0x14, 0x0e, 0x3d, 0x0e, 0x3d, 0x0e, 0x66, 0x0e,
-0x66, 0x0e, 0x8f, 0x0e, 0x8f, 0x0e, 0xb8, 0x0e, 0xb8, 0x0e, 0xe1,
-0x0e, 0xe1, 0x0f, 0x0a, 0x0f, 0x0a, 0x0f, 0x33, 0x0f, 0x33, 0x0f,
-0x5c, 0x0f, 0x5c, 0x0f, 0x85, 0x0f, 0x85, 0x0f, 0xae, 0x0f, 0xae,
-0x0f, 0xd7, 0x0f, 0xd7, 0x0f, 0xff, 0x0f, 0xff
-};
-
diff --git a/sound/isa/wavefront/wavefront_synth.c b/sound/isa/wavefront/wavefront_synth.c
index 9b65db0b1..b4fab43e4 100644
--- a/sound/isa/wavefront/wavefront_synth.c
+++ b/sound/isa/wavefront/wavefront_synth.c
@@ -123,7 +123,7 @@ MODULE_PARM_DESC(osrun_time, "how many seconds to wait for the ICS2115 OS");
 #else
 #define DPRINT(cond, args...) \
        if ((dev->debug & (cond)) == (cond)) { \
-	     snd_printk (##args); \
+	     snd_printk (args); \
        }
 #endif
 #else
@@ -165,7 +165,7 @@ static struct {
 	{ 0x0E, "Bad MIDI channel number" },
 	{ 0x10, "Download Record Error" },
 	{ 0x80, "Success" },
-	{ 0x0, 0x0 }
+	{ 0x0 }
 };
 
 #define NEEDS_ACK 1
@@ -361,7 +361,7 @@ snd_wavefront_cmd (snd_wavefront_t *dev,
 
 	if (cmd == WFC_DOWNLOAD_MULTISAMPLE) {
 		wfcmd->write_cnt = (unsigned long) rbuf;
-		rbuf = 0;
+		rbuf = NULL;
 	}
 
 	DPRINT (WF_DEBUG_CMD, "0x%x [%s] (%d,%d,%d)\n",
@@ -612,7 +612,7 @@ wavefront_delete_sample (snd_wavefront_t *dev, int sample_num)
 	wbuf[0] = sample_num & 0x7f;
 	wbuf[1] = sample_num >> 7;
 
-	if ((x = snd_wavefront_cmd (dev, WFC_DELETE_SAMPLE, 0, wbuf)) == 0) {
+	if ((x = snd_wavefront_cmd (dev, WFC_DELETE_SAMPLE, NULL, wbuf)) == 0) {
 		dev->sample_status[sample_num] = WF_ST_EMPTY;
 	}
 
@@ -798,7 +798,7 @@ wavefront_send_patch (snd_wavefront_t *dev, wavefront_patch_info *header)
 	bptr = munge_int32 (header->number, buf, 2);
 	munge_buf ((unsigned char *)&header->hdr.p, bptr, WF_PATCH_BYTES);
     
-	if (snd_wavefront_cmd (dev, WFC_DOWNLOAD_PATCH, 0, buf)) {
+	if (snd_wavefront_cmd (dev, WFC_DOWNLOAD_PATCH, NULL, buf)) {
 		snd_printk ("download patch failed\n");
 		return -(EIO);
 	}
@@ -836,7 +836,7 @@ wavefront_send_program (snd_wavefront_t *dev, wavefront_patch_info *header)
 	buf[0] = header->number;
 	munge_buf ((unsigned char *)&header->hdr.pr, &buf[1], WF_PROGRAM_BYTES);
     
-	if (snd_wavefront_cmd (dev, WFC_DOWNLOAD_PROGRAM, 0, buf)) {
+	if (snd_wavefront_cmd (dev, WFC_DOWNLOAD_PROGRAM, NULL, buf)) {
 		snd_printk ("download patch failed\n");	
 		return -(EIO);
 	}
@@ -850,7 +850,7 @@ wavefront_freemem (snd_wavefront_t *dev)
 {
 	char rbuf[8];
 
-	if (snd_wavefront_cmd (dev, WFC_REPORT_FREE_MEMORY, rbuf, 0)) {
+	if (snd_wavefront_cmd (dev, WFC_REPORT_FREE_MEMORY, rbuf, NULL)) {
 		snd_printk ("can't get memory stats.\n");
 		return -1;
 	} else {
@@ -876,7 +876,7 @@ wavefront_send_sample (snd_wavefront_t *dev,
 
 	u16 sample_short;
 	u32 length;
-	u16 __user *data_end = 0;
+	u16 __user *data_end = NULL;
 	unsigned int i;
 	const unsigned int max_blksize = 4096/2;
 	unsigned int written;
@@ -1053,7 +1053,7 @@ wavefront_send_sample (snd_wavefront_t *dev,
 	if (snd_wavefront_cmd (dev, 
 			   header->size ?
 			   WFC_DOWNLOAD_SAMPLE : WFC_DOWNLOAD_SAMPLE_HEADER,
-			   0, sample_hdr)) {
+			   NULL, sample_hdr)) {
 		snd_printk ("sample %sdownload refused.\n",
 			    header->size ? "" : "header ");
 		return -(EIO);
@@ -1079,7 +1079,7 @@ wavefront_send_sample (snd_wavefront_t *dev,
 			blocksize = ((length-written+7)&~0x7);
 		}
 
-		if (snd_wavefront_cmd (dev, WFC_DOWNLOAD_BLOCK, 0, 0)) {
+		if (snd_wavefront_cmd (dev, WFC_DOWNLOAD_BLOCK, NULL, NULL)) {
 			snd_printk ("download block "
 				    "request refused.\n");
 			return -(EIO);
@@ -1186,7 +1186,7 @@ wavefront_send_alias (snd_wavefront_t *dev, wavefront_patch_info *header)
 	munge_int32 (header->hdr.a.FrequencyBias, &alias_hdr[20], 3);
 	munge_int32 (*(&header->hdr.a.FrequencyBias+1), &alias_hdr[23], 2);
 
-	if (snd_wavefront_cmd (dev, WFC_DOWNLOAD_SAMPLE_ALIAS, 0, alias_hdr)) {
+	if (snd_wavefront_cmd (dev, WFC_DOWNLOAD_SAMPLE_ALIAS, NULL, alias_hdr)) {
 		snd_printk ("download alias failed.\n");
 		return -(EIO);
 	}
@@ -1314,7 +1314,7 @@ wavefront_send_drum (snd_wavefront_t *dev, wavefront_patch_info *header)
 		munge_int32 (((unsigned char *)drum)[i], &drumbuf[1+(i*2)], 2);
 	}
 
-	if (snd_wavefront_cmd (dev, WFC_DOWNLOAD_EDRUM_PROGRAM, 0, drumbuf)) {
+	if (snd_wavefront_cmd (dev, WFC_DOWNLOAD_EDRUM_PROGRAM, NULL, drumbuf)) {
 		snd_printk ("download drum failed.\n");
 		return -(EIO);
 	}
@@ -2085,7 +2085,7 @@ wavefront_do_reset (snd_wavefront_t *dev)
 
 	voices[0] = 32;
 
-	if (snd_wavefront_cmd (dev, WFC_SET_NVOICES, 0, voices)) {
+	if (snd_wavefront_cmd (dev, WFC_SET_NVOICES, NULL, voices)) {
 		snd_printk ("cannot set number of voices to 32.\n");
 		goto gone_bad;
 	}
diff --git a/sound/oss/Kconfig b/sound/oss/Kconfig
index 648bccd40..05f6bc8ec 100644
--- a/sound/oss/Kconfig
+++ b/sound/oss/Kconfig
@@ -186,7 +186,10 @@ config SOUND_VWSND
 
 config SOUND_HAL2
 	tristate "SGI HAL2 sound (EXPERIMENTAL)"
-	depends on SGI_IP22 && SOUND && EXPERIMENTAL
+	depends on SOUND_PRIME!=n && SOUND && SGI_IP22 && EXPERIMENTAL
+	help
+	  Say Y or M if you have an SGI Indy system and want to be able to
+	  use it's on-board A2 audio system.
 
 config SOUND_VRC5477
 	tristate "NEC Vrc5477 AC97 sound"
diff --git a/sound/oss/aci.c b/sound/oss/aci.c
index ac3c481aa..7c3d391f6 100644
--- a/sound/oss/aci.c
+++ b/sound/oss/aci.c
@@ -99,7 +99,7 @@ MODULE_PARM(wss,"i");
 MODULE_PARM_DESC(wss,"change between ACI/WSS-mixer; use 0 and 1 - untested"
 		 " default: do nothing; for PCM1-pro only");
 
-#if DEBUG
+#ifdef DEBUG
 static void print_bits(unsigned char c)
 {
 	int j;
@@ -184,7 +184,7 @@ static int busy_wait(void)
 static inline int aci_rawwrite(unsigned char byte)
 {
 	if (busy_wait() >= 0) {
-#if DEBUG
+#ifdef DEBUG
 		printk(KERN_DEBUG "aci_rawwrite(%d)\n", byte);
 #endif
 		outb(byte, COMMAND_REGISTER);
@@ -199,7 +199,7 @@ static inline int aci_rawread(void)
 
 	if (busy_wait() >= 0) {
 		byte=inb(STATUS_REGISTER);
-#if DEBUG
+#ifdef DEBUG
 		printk(KERN_DEBUG "%d = aci_rawread()\n", byte);
 #endif
 		return byte;
diff --git a/sound/oss/ad1816.c b/sound/oss/ad1816.c
index c2abdddd7..442506444 100644
--- a/sound/oss/ad1816.c
+++ b/sound/oss/ad1816.c
@@ -1235,10 +1235,10 @@ static struct {
 } isapnp_ad1816_list[] __initdata = {
 	{	ISAPNP_ANY_ID, ISAPNP_ANY_ID,
 		ISAPNP_VENDOR('A','D','S'), ISAPNP_FUNCTION(0x7150), 
-		0 },
+		NULL },
 	{	ISAPNP_ANY_ID, ISAPNP_ANY_ID,
 		ISAPNP_VENDOR('A','D','S'), ISAPNP_FUNCTION(0x7180),
-		0 },
+		NULL },
 	{0}
 };
 
diff --git a/sound/oss/ad1848.c b/sound/oss/ad1848.c
index 7e9e30e5b..af1225d9f 100644
--- a/sound/oss/ad1848.c
+++ b/sound/oss/ad1848.c
@@ -2962,7 +2962,7 @@ static struct {
 		ISAPNP_VENDOR('G','R','V'), ISAPNP_DEVICE(0x0001),
 		ISAPNP_VENDOR('G','R','V'), ISAPNP_FUNCTION(0x0000),
 		0, 0, 0, 1, 0},
-	{0}
+	{NULL}
 };
 
 static struct isapnp_device_id id_table[] __devinitdata = {
diff --git a/sound/oss/ad1889.c b/sound/oss/ad1889.c
index 89543f3a3..2423b1f2d 100644
--- a/sound/oss/ad1889.c
+++ b/sound/oss/ad1889.c
@@ -338,7 +338,7 @@ int ad1889_read_proc (char *page, char **start, off_t off,
 		{ "AC97_3D_CONTROL", 0x100 + AC97_3D_CONTROL, 16 },
 		{ "AC97_MODEM_RATE", 0x100 + AC97_MODEM_RATE, 16 },
 		{ "AC97_POWER_CONTROL", 0x100 + AC97_POWER_CONTROL, 16 },
-		{ 0 }
+		{ NULL }
 	};
 
 	if (dev == NULL)
@@ -452,9 +452,6 @@ static ssize_t ad1889_write(struct file *file, const char __user *buffer, size_t
 	ssize_t ret = 0;
 	DECLARE_WAITQUEUE(wait, current);
 
-	if (ppos != &file->f_pos)
-		return -ESPIPE;
-
 	down(&state->sem);
 #if 0
 	if (dmabuf->mapped) {
@@ -764,7 +761,7 @@ static int ad1889_open(struct inode *inode, struct file *file)
 	ad1889_set_wav_rate(ad1889_dev, 44100);
 	ad1889_set_wav_fmt(ad1889_dev, AFMT_S16_LE);
 	AD1889_WRITEW(ad1889_dev, AD_DSWADA, 0x0404); /* attenuation */
-	return 0;
+	return nonseekable_open(inode, file);
 }
 
 static int ad1889_release(struct inode *inode, struct file *file)
@@ -851,7 +848,7 @@ static int ad1889_ac97_init(ad1889_dev_t *dev, int id)
 	}
 
 	eid = ad1889_codec_read(ac97, AC97_EXTENDED_ID);
-	if (eid == 0xffffff) {
+	if (eid == 0xffff) {
 		printk(KERN_WARNING DEVNAME ": no codec attached?\n");
 		goto out_free;
 	}
@@ -1017,7 +1014,7 @@ static int __devinit ad1889_probe(struct pci_dev *pcidev, const struct pci_devic
 	if ((err = ad1889_ac97_init(dev, 0)) != 0)
 		goto err_free_dsp;
 
-	if (((proc_root = proc_mkdir("driver/ad1889", 0)) == NULL) ||
+	if (((proc_root = proc_mkdir("driver/ad1889", NULL)) == NULL) ||
 	    create_proc_read_entry("ac97", S_IFREG|S_IRUGO, proc_root, ac97_read_proc, dev->ac97_codec) == NULL ||
 	    create_proc_read_entry("info", S_IFREG|S_IRUGO, proc_root, ad1889_read_proc, dev) == NULL) 
 		goto err_free_dsp;
@@ -1038,7 +1035,7 @@ err_free_irq:
 
 err_free_mem:
 	ad1889_free_dev(dev);
-	pci_set_drvdata(pcidev, 0);
+	pci_set_drvdata(pcidev, NULL);
 
 	return -ENODEV;
 }
diff --git a/sound/oss/ali5455.c b/sound/oss/ali5455.c
index 3f3a456b3..a7e2c3c0a 100644
--- a/sound/oss/ali5455.c
+++ b/sound/oss/ali5455.c
@@ -1583,7 +1583,7 @@ static ssize_t ali_read(struct file *file, char __user *buffer,
 			size_t count, loff_t * ppos)
 {
 	struct ali_state *state = (struct ali_state *) file->private_data;
-	struct ali_card *card = state ? state->card : 0;
+	struct ali_card *card = state ? state->card : NULL;
 	struct dmabuf *dmabuf = &state->dmabuf;
 	ssize_t ret;
 	unsigned long flags;
@@ -1593,8 +1593,6 @@ static ssize_t ali_read(struct file *file, char __user *buffer,
 #ifdef DEBUG2
 	printk("ali_audio: ali_read called, count = %d\n", count);
 #endif
-	if (ppos != &file->f_pos)
-		return -ESPIPE;
 	if (dmabuf->mapped)
 		return -ENXIO;
 	if (dmabuf->enable & DAC_RUNNING)
@@ -1724,7 +1722,7 @@ static ssize_t ali_write(struct file *file,
 			 const char __user *buffer, size_t count, loff_t * ppos)
 {
 	struct ali_state *state = (struct ali_state *) file->private_data;
-	struct ali_card *card = state ? state->card : 0;
+	struct ali_card *card = state ? state->card : NULL;
 	struct dmabuf *dmabuf = &state->dmabuf;
 	ssize_t ret;
 	unsigned long flags;
@@ -1734,8 +1732,6 @@ static ssize_t ali_write(struct file *file,
 #ifdef DEBUG2
 	printk("ali_audio: ali_write called, count = %d\n", count);
 #endif
-	if (ppos != &file->f_pos)
-		return -ESPIPE;
 	if (dmabuf->mapped)
 		return -ENXIO;
 	if (dmabuf->enable & ADC_RUNNING)
@@ -2890,7 +2886,7 @@ found_virt:
 	state->open_mode |= file->f_mode & (FMODE_READ | FMODE_WRITE);
 	outl(0x00000000, card->iobase + ALI_INTERRUPTCR);
 	outl(0x00000000, card->iobase + ALI_INTERRUPTSR);
-	return 0;
+	return nonseekable_open(inode, file);
 }
 
 static int ali_release(struct inode *inode, struct file *file)
@@ -3047,7 +3043,7 @@ static int ali_open_mixdev(struct inode *inode, struct file *file)
 			if (card->ac97_codec[i] != NULL
 			    && card->ac97_codec[i]->dev_mixer == minor) {
 				file->private_data = card->ac97_codec[i];
-				return 0;
+				return nonseekable_open(inode, file);
 			}
 	}
 	return -ENODEV;
diff --git a/sound/oss/au1000.c b/sound/oss/au1000.c
index 0ad69a2e7..ccfbad2dd 100644
--- a/sound/oss/au1000.c
+++ b/sound/oss/au1000.c
@@ -886,7 +886,7 @@ static loff_t au1000_llseek(struct file *file, loff_t offset, int origin)
 static int au1000_open_mixdev(struct inode *inode, struct file *file)
 {
 	file->private_data = &au1000_state;
-	return 0;
+	return nonseekable_open(inode, file);
 }
 
 static int au1000_release_mixdev(struct inode *inode, struct file *file)
@@ -1120,8 +1120,6 @@ static ssize_t au1000_read(struct file *file, char *buffer,
 	unsigned long   flags;
 	int             cnt, usercnt, avail;
 
-	if (ppos != &file->f_pos)
-		return -ESPIPE;
 	if (db->mapped)
 		return -ENXIO;
 	if (!access_ok(VERIFY_WRITE, buffer, count))
@@ -1204,8 +1202,6 @@ static ssize_t au1000_write(struct file *file, const char *buffer,
 	dbg("write: count=%d", count);
 #endif
 
-	if (ppos != &file->f_pos)
-		return -ESPIPE;
 	if (db->mapped)
 		return -ENXIO;
 	if (!access_ok(VERIFY_READ, buffer, count))
@@ -1907,7 +1903,7 @@ static int  au1000_open(struct inode *inode, struct file *file)
 	s->open_mode |= file->f_mode & (FMODE_READ | FMODE_WRITE);
 	up(&s->open_sem);
 	init_MUTEX(&s->sem);
-	return 0;
+	return nonseekable_open(inode, file);
 }
 
 static int au1000_release(struct inode *inode, struct file *file)
diff --git a/sound/oss/cmpci.c b/sound/oss/cmpci.c
index a7d067c2d..386107f47 100644
--- a/sound/oss/cmpci.c
+++ b/sound/oss/cmpci.c
@@ -1852,7 +1852,7 @@ static int cm_open_mixdev(struct inode *inode, struct file *file)
 	}
        	VALIDATE_STATE(s);
 	file->private_data = s;
-	return 0;
+	return nonseekable_open(inode, file);
 }
 
 static int cm_release_mixdev(struct inode *inode, struct file *file)
@@ -1926,8 +1926,6 @@ static ssize_t cm_read(struct file *file, char __user *buffer, size_t count, lof
 	int cnt;
 
 	VALIDATE_STATE(s);
-	if (ppos != &file->f_pos)
-		return -ESPIPE;
 	if (s->dma_adc.mapped)
 		return -ENXIO;
 	if (!s->dma_adc.ready && (ret = prog_dmabuf(s, 1)))
@@ -2028,8 +2026,6 @@ static ssize_t cm_write(struct file *file, const char __user *buffer, size_t cou
 	int cnt;
 
 	VALIDATE_STATE(s);
-	if (ppos != &file->f_pos)
-		return -ESPIPE;
 	if (s->dma_dac.mapped)
 		return -ENXIO;
 	if (!s->dma_dac.ready && (ret = prog_dmabuf(s, 0)))
@@ -2878,7 +2874,7 @@ static int cm_open(struct inode *inode, struct file *file)
 	set_fmt(s, fmtm, fmts);
 	s->open_mode |= file->f_mode & (FMODE_READ | FMODE_WRITE);
 	up(&s->open_sem);
-	return 0;
+	return nonseekable_open(inode, file);
 }
 
 static int cm_release(struct inode *inode, struct file *file)
@@ -3280,7 +3276,7 @@ MODULE_AUTHOR("ChenLi Tien, cltien@cmedia.com.tw");
 MODULE_DESCRIPTION("CM8x38 Audio Driver");
 MODULE_LICENSE("GPL");
 
-static void __devinit cm_remove(struct pci_dev *dev)
+static void __devexit cm_remove(struct pci_dev *dev)
 {
 	struct cm_state *s = pci_get_drvdata(dev);
 
@@ -3337,7 +3333,7 @@ static struct pci_driver cm_driver = {
        .name	 = "cmpci",
        .id_table = id_table,
        .probe	 = cm_probe,
-       .remove	 = cm_remove
+       .remove	 = __devexit_p(cm_remove)
 };
 
 static int __init init_cmpci(void)
diff --git a/sound/oss/cs4281/cs4281m.c b/sound/oss/cs4281/cs4281m.c
index c2b496e34..a6f09cc63 100644
--- a/sound/oss/cs4281/cs4281m.c
+++ b/sound/oss/cs4281/cs4281m.c
@@ -2592,7 +2592,7 @@ static int cs4281_open_mixdev(struct inode *inode, struct file *file)
 	CS_DBGOUT(CS_FUNCTION | CS_OPEN, 4,
 		  printk(KERN_INFO "cs4281: cs4281_open_mixdev()- 0\n"));
 
-	return 0;
+	return nonseekable_open(inode, file);
 }
 
 
@@ -2874,8 +2874,6 @@ static ssize_t cs4281_read(struct file *file, char __user *buffer, size_t count,
 		  printk(KERN_INFO "cs4281: cs4281_read()+ %Zu \n", count));
 
 	VALIDATE_STATE(s);
-	if (ppos != &file->f_pos)
-		return -ESPIPE;
 	if (s->dma_adc.mapped)
 		return -ENXIO;
 	if (!s->dma_adc.ready && (ret = prog_dmabuf_adc(s)))
@@ -2990,8 +2988,6 @@ static ssize_t cs4281_write(struct file *file, const char __user *buffer,
 			 count));
 	VALIDATE_STATE(s);
 
-	if (ppos != &file->f_pos)
-		return -ESPIPE;
 	if (s->dma_dac.mapped)
 		return -ENXIO;
 	if (!s->dma_dac.ready && (ret = prog_dmabuf_dac(s)))
@@ -3725,7 +3721,7 @@ static int cs4281_open(struct inode *inode, struct file *file)
 	}
 	CS_DBGOUT(CS_FUNCTION | CS_OPEN, 2,
 		  printk(KERN_INFO "cs4281: cs4281_open()- 0\n"));
-	return 0;
+	return nonseekable_open(inode, file);
 }
 
 
@@ -3842,8 +3838,6 @@ static ssize_t cs4281_midi_read(struct file *file, char __user *buffer,
 	int cnt;
 
 	VALIDATE_STATE(s);
-	if (ppos != &file->f_pos)
-		return -ESPIPE;
 	if (!access_ok(VERIFY_WRITE, buffer, count))
 		return -EFAULT;
 	ret = 0;
@@ -3890,8 +3884,6 @@ static ssize_t cs4281_midi_write(struct file *file, const char __user *buffer,
 	int cnt;
 
 	VALIDATE_STATE(s);
-	if (ppos != &file->f_pos)
-		return -ESPIPE;
 	if (!access_ok(VERIFY_READ, buffer, count))
 		return -EFAULT;
 	ret = 0;
@@ -4025,7 +4017,7 @@ static int cs4281_midi_open(struct inode *inode, struct file *file)
 	     f_mode << FMODE_MIDI_SHIFT) & (FMODE_MIDI_READ |
 					    FMODE_MIDI_WRITE);
 	up(&s->open_sem);
-	return 0;
+	return nonseekable_open(inode, file);
 }
 
 
diff --git a/sound/oss/cs46xx.c b/sound/oss/cs46xx.c
index 60fc6c69f..418f976c4 100644
--- a/sound/oss/cs46xx.c
+++ b/sound/oss/cs46xx.c
@@ -1144,9 +1144,9 @@ static void start_dac(struct cs_state *state)
 		tmp &= 0xFFFF;
 		tmp |= card->pctl;
 		CS_DBGOUT(CS_PARMS, 6, printk(
-		    "cs46xx: start_dac() poke card=0x%.08x tmp=0x%.08x addr=0x%.08x \n",
-		    (unsigned)card, (unsigned)tmp, 
-		    (unsigned)card->ba1.idx[(BA1_PCTL >> 16) & 3]+(BA1_PCTL&0xffff) ) );
+		    "cs46xx: start_dac() poke card=%p tmp=0x%.08x addr=%p \n",
+		    card, (unsigned)tmp, 
+		    card->ba1.idx[(BA1_PCTL >> 16) & 3]+(BA1_PCTL&0xffff) ) );
 		cs461x_poke(card, BA1_PCTL, tmp);
 	}
 	spin_unlock_irqrestore(&card->lock, flags);
@@ -1613,8 +1613,8 @@ static void cs_update_ptr(struct cs_card *card, int wake)
 					memset(dmabuf->rawbuf, 
 						(dmabuf->fmt & CS_FMT_16BIT) ? 0 : 0x80,
 						(unsigned)hwptr);
-					memset((void *)((unsigned)dmabuf->rawbuf + 
-							dmabuf->dmasize + hwptr - diff),
+					memset((char *)dmabuf->rawbuf + 
+							dmabuf->dmasize + hwptr - diff,
 						(dmabuf->fmt & CS_FMT_16BIT) ? 0 : 0x80, 
 						diff - hwptr); 
 				}
@@ -1725,8 +1725,6 @@ static ssize_t cs_midi_read(struct file *file, char __user *buffer, size_t count
         unsigned ptr;
         int cnt;
 
-        if (ppos != &file->f_pos)
-                return -ESPIPE;
         if (!access_ok(VERIFY_WRITE, buffer, count))
                 return -EFAULT;
         ret = 0;
@@ -1770,8 +1768,6 @@ static ssize_t cs_midi_write(struct file *file, const char __user *buffer, size_
         unsigned ptr;
         int cnt;
 
-        if (ppos != &file->f_pos)
-                return -ESPIPE;
         if (!access_ok(VERIFY_READ, buffer, count))
                 return -EFAULT;
         ret = 0;
@@ -1970,8 +1966,8 @@ static void CopySamples(char *dst, char *src, int count, unsigned fmt,
 
     CS_DBGOUT(CS_FUNCTION, 2, printk(KERN_INFO "cs46xx: CopySamples()+ ") );
     CS_DBGOUT(CS_WAVE_READ, 8, printk(KERN_INFO
-	" dst=0x%x src=0x%x count=%d fmt=0x%x\n",
-	(unsigned)dst,(unsigned)src,(unsigned)count,(unsigned)fmt) );
+	" dst=%p src=%p count=%d fmt=0x%x\n",
+	dst,src,count,fmt) );
 
     /*
      * See if the data should be output as 8-bit unsigned stereo.
@@ -2106,8 +2102,6 @@ static ssize_t cs_read(struct file *file, char __user *buffer, size_t count, lof
 		return -ENODEV;
 	dmabuf = &state->dmabuf;
 
-	if (ppos != &file->f_pos)
-		return -ESPIPE;
 	if (dmabuf->mapped)
 		return -ENXIO;
 	if (!access_ok(VERIFY_WRITE, buffer, count))
@@ -2169,7 +2163,7 @@ static ssize_t cs_read(struct file *file, char __user *buffer, size_t count, lof
 			dmabuf->dmasize,dmabuf->count,buffer,ret) );
 
                 if (cs_copy_to_user(state, buffer, 
-			(void *)((unsigned)dmabuf->rawbuf + swptr), cnt, &copied))
+			(char *)dmabuf->rawbuf + swptr, cnt, &copied))
 		{
 			if (!ret) ret = -EFAULT;
 			goto out;
@@ -2216,9 +2210,6 @@ static ssize_t cs_write(struct file *file, const char __user *buffer, size_t cou
 		return -EFAULT;
 	dmabuf = &state->dmabuf;
 
-	if (ppos != &file->f_pos)
-		return -ESPIPE;
-
 	down(&state->sem);
 	if (dmabuf->mapped)
 	{
@@ -2404,8 +2395,8 @@ static int cs_mmap(struct file *file, struct vm_area_struct *vma)
 	int ret = 0;
 	unsigned long size;
 
-	CS_DBGOUT(CS_FUNCTION | CS_PARMS, 2, printk("cs46xx: cs_mmap()+ file=0x%x %s %s\n", 
-		(unsigned)file, vma->vm_flags & VM_WRITE ? "VM_WRITE" : "",
+	CS_DBGOUT(CS_FUNCTION | CS_PARMS, 2, printk("cs46xx: cs_mmap()+ file=%p %s %s\n", 
+		file, vma->vm_flags & VM_WRITE ? "VM_WRITE" : "",
 		vma->vm_flags & VM_READ ? "VM_READ" : "") );
 
 	if (vma->vm_flags & VM_WRITE) {
@@ -2441,8 +2432,7 @@ static int cs_mmap(struct file *file, struct vm_area_struct *vma)
  * use the DAC only.
  */
 	state = card->states[1];  
-	if(!(unsigned)state)
-	{
+	if (!state) {
 		ret = -EINVAL;
 		goto out;
 	}
@@ -2481,7 +2471,7 @@ static int cs_ioctl(struct inode *inode, struct file *file, unsigned int cmd, un
 {
 	struct cs_card *card = (struct cs_card *)file->private_data;
 	struct cs_state *state;
-	struct dmabuf *dmabuf=0;
+	struct dmabuf *dmabuf=NULL;
 	unsigned long flags;
 	audio_buf_info abinfo;
 	count_info cinfo;
@@ -3204,8 +3194,8 @@ static int cs_open(struct inode *inode, struct file *file)
 	int ret=0;
 	unsigned int tmp;
 
-	CS_DBGOUT(CS_OPEN | CS_FUNCTION, 2, printk("cs46xx: cs_open()+ file=0x%x %s %s\n",
-		(unsigned)file, file->f_mode & FMODE_WRITE ? "FMODE_WRITE" : "",
+	CS_DBGOUT(CS_OPEN | CS_FUNCTION, 2, printk("cs46xx: cs_open()+ file=%p %s %s\n",
+		file, file->f_mode & FMODE_WRITE ? "FMODE_WRITE" : "",
 		file->f_mode & FMODE_READ ? "FMODE_READ" : "") );
 
 	list_for_each(entry, &cs46xx_devs)
@@ -3371,7 +3361,7 @@ static int cs_open(struct inode *inode, struct file *file)
 			return ret;
 	}
 	CS_DBGOUT(CS_OPEN | CS_FUNCTION, 2, printk("cs46xx: cs_open()- 0\n") );
-	return 0;
+	return nonseekable_open(inode, file);
 }
 
 static int cs_release(struct inode *inode, struct file *file)
@@ -3380,8 +3370,8 @@ static int cs_release(struct inode *inode, struct file *file)
 	struct dmabuf *dmabuf;
 	struct cs_state *state;
 	unsigned int tmp;
-	CS_DBGOUT(CS_RELEASE | CS_FUNCTION, 2, printk("cs46xx: cs_release()+ file=0x%x %s %s\n",
-		(unsigned)file, file->f_mode & FMODE_WRITE ? "FMODE_WRITE" : "",
+	CS_DBGOUT(CS_RELEASE | CS_FUNCTION, 2, printk("cs46xx: cs_release()+ file=%p %s %s\n",
+		file, file->f_mode & FMODE_WRITE ? "FMODE_WRITE" : "",
 		file->f_mode & FMODE_READ ? "FMODE_READ" : "") );
 
 	if (!(file->f_mode & (FMODE_WRITE | FMODE_READ)))
@@ -3675,8 +3665,8 @@ static int cs46xx_suspend(struct cs_card *card, u32 state)
 {
 	unsigned int tmp;
 	CS_DBGOUT(CS_PM | CS_FUNCTION, 4, 
-		printk("cs46xx: cs46xx_suspend()+ flags=0x%x s=0x%x\n",
-			(unsigned)card->pm.flags,(unsigned)card));
+		printk("cs46xx: cs46xx_suspend()+ flags=0x%x s=%p\n",
+			(unsigned)card->pm.flags,card));
 /*
 * check the current state, only suspend if IDLE
 */
@@ -4105,7 +4095,7 @@ static int cs_open_mixdev(struct inode *inode, struct file *file)
 	CS_INC_USE_COUNT(&card->mixer_use_cnt);
 	CS_DBGOUT(CS_FUNCTION | CS_OPEN, 4,
 		  printk(KERN_INFO "cs46xx: cs_open_mixdev()- 0\n"));
-	return 0;
+	return nonseekable_open(inode, file);
 }
 
 static int cs_release_mixdev(struct inode *inode, struct file *file)
@@ -4272,7 +4262,7 @@ static int __init cs_ac97_init(struct cs_card *card)
 			CS_DBGOUT(CS_FUNCTION | CS_INIT, 2, printk(KERN_INFO 
 				"cs46xx: cs_ac97_init()- codec number %d not found\n",
 					num_ac97) );
-			card->ac97_codec[num_ac97] = 0;
+			card->ac97_codec[num_ac97] = NULL;
 			break;
 		}
 		CS_DBGOUT(CS_FUNCTION | CS_INIT, 2, printk(KERN_INFO 
@@ -4297,9 +4287,9 @@ static int __init cs_ac97_init(struct cs_card *card)
 		card->ac97_codec[num_ac97] = codec;
 
 		CS_DBGOUT(CS_FUNCTION | CS_INIT, 2, printk(KERN_INFO 
-			"cs46xx: cs_ac97_init() ac97_codec[%d] set to 0x%x\n",
+			"cs46xx: cs_ac97_init() ac97_codec[%d] set to %p\n",
 				(unsigned int)num_ac97,
-				(unsigned int)codec));
+				codec));
 		/* if there is no secondary codec at all, don't probe any more */
 		if (!ready_2nd)
 		{
@@ -5489,13 +5479,13 @@ static int __devinit cs46xx_probe(struct pci_dev *pci_dev,
 	card->ba1.name.reg = ioremap_nocache(card->ba1_addr + BA1_SP_REG, CS461X_BA1_REG_SIZE);
 	
 	CS_DBGOUT(CS_INIT, 4, printk(KERN_INFO 
-		"cs46xx: card=0x%x card->ba0=0x%.08x\n",(unsigned)card,(unsigned)card->ba0) );
+		"cs46xx: card=%p card->ba0=%p\n",card,card->ba0) );
 	CS_DBGOUT(CS_INIT, 4, printk(KERN_INFO 
-		"cs46xx: card->ba1=0x%.08x 0x%.08x 0x%.08x 0x%.08x\n",
-			(unsigned)card->ba1.name.data0,
-			(unsigned)card->ba1.name.data1,
-			(unsigned)card->ba1.name.pmem,
-			(unsigned)card->ba1.name.reg) );
+		"cs46xx: card->ba1=%p %p %p %p\n",
+			card->ba1.name.data0,
+			card->ba1.name.data1,
+			card->ba1.name.pmem,
+			card->ba1.name.reg) );
 
 	if(card->ba0 == 0 || card->ba1.name.data0 == 0 ||
 		card->ba1.name.data1 == 0 || card->ba1.name.pmem == 0 ||
@@ -5566,20 +5556,20 @@ static int __devinit cs46xx_probe(struct pci_dev *pci_dev,
 	if (pmdev)
 	{
 		CS_DBGOUT(CS_INIT | CS_PM, 4, printk(KERN_INFO
-			 "cs46xx: probe() pm_register() succeeded (0x%x).\n",
-				(unsigned)pmdev));
+			 "cs46xx: probe() pm_register() succeeded (%p).\n",
+				pmdev));
 		pmdev->data = card;
 	}
 	else
 	{
 		CS_DBGOUT(CS_INIT | CS_PM | CS_ERROR, 2, printk(KERN_INFO
-			 "cs46xx: probe() pm_register() failed (0x%x).\n",
-				(unsigned)pmdev));
+			 "cs46xx: probe() pm_register() failed (%p).\n",
+				pmdev));
 		card->pm.flags |= CS46XX_PM_NOT_REGISTERED;
 	}
 
-	CS_DBGOUT(CS_PM, 9, printk(KERN_INFO "cs46xx: pm.flags=0x%x card=0x%x\n",
-		(unsigned)card->pm.flags,(unsigned)card));
+	CS_DBGOUT(CS_PM, 9, printk(KERN_INFO "cs46xx: pm.flags=0x%x card=%p\n",
+		(unsigned)card->pm.flags,card));
 
 	CS_DBGOUT(CS_INIT | CS_FUNCTION, 2, printk(KERN_INFO
 		"cs46xx: probe()- device allocated successfully\n"));
@@ -5772,8 +5762,8 @@ int cs46xx_pm_callback(struct pm_dev *dev, pm_request_t rqst, void *data)
 	struct cs_card *card;
 
 	CS_DBGOUT(CS_PM, 2, printk(KERN_INFO 
-		"cs46xx: cs46xx_pm_callback dev=0x%x rqst=0x%x card=%d\n",
-			(unsigned)dev,(unsigned)rqst,(unsigned)data));
+		"cs46xx: cs46xx_pm_callback dev=%p rqst=0x%x card=%p\n",
+			dev,(unsigned)rqst,data));
 	card = (struct cs_card *) dev->data;
 	if (card) {
 		switch(rqst) {
diff --git a/sound/oss/cs46xxpm-24.h b/sound/oss/cs46xxpm-24.h
index 9774add1d..f1aed86c7 100644
--- a/sound/oss/cs46xxpm-24.h
+++ b/sound/oss/cs46xxpm-24.h
@@ -38,7 +38,7 @@
 */
 static int cs46xx_suspend_tbl(struct pci_dev *pcidev, u32 state);
 static int cs46xx_resume_tbl(struct pci_dev *pcidev);
-#define cs_pm_register(a, b, c)  0
+#define cs_pm_register(a, b, c)  NULL
 #define cs_pm_unregister_all(a) 
 #define CS46XX_SUSPEND_TBL cs46xx_suspend_tbl
 #define CS46XX_RESUME_TBL cs46xx_resume_tbl
diff --git a/sound/oss/dmasound/dmasound.h b/sound/oss/dmasound/dmasound.h
index 1d65e18d7..9a2f50f0b 100644
--- a/sound/oss/dmasound/dmasound.h
+++ b/sound/oss/dmasound/dmasound.h
@@ -1,6 +1,6 @@
 #ifndef _dmasound_h_
 /*
- *  linux/drivers/sound/dmasound/dmasound.h
+ *  linux/sound/oss/dmasound/dmasound.h
  *
  *
  *  Minor numbers for the sound driver.
@@ -44,12 +44,12 @@
 #define le2be16dbl(x)	(((x)<<8 & 0xff00ff00) | ((x)>>8 & 0x00ff00ff))
 
 #define IOCTL_IN(arg, ret) \
-	do { int error = get_user(ret, (int *)(arg)); \
+	do { int error = get_user(ret, (int __user *)(arg)); \
 		if (error) return error; \
 	} while (0)
-#define IOCTL_OUT(arg, ret)	ioctl_return((int *)(arg), ret)
+#define IOCTL_OUT(arg, ret)	ioctl_return((int __user *)(arg), ret)
 
-static inline int ioctl_return(int *addr, int value)
+static inline int ioctl_return(int __user *addr, int value)
 {
 	return value < 0 ? value : put_user(value, addr);
 }
@@ -153,14 +153,14 @@ typedef struct {
      */
 
 typedef struct {
-    ssize_t (*ct_ulaw)(const u_char *, size_t, u_char *, ssize_t *, ssize_t);
-    ssize_t (*ct_alaw)(const u_char *, size_t, u_char *, ssize_t *, ssize_t);
-    ssize_t (*ct_s8)(const u_char *, size_t, u_char *, ssize_t *, ssize_t);
-    ssize_t (*ct_u8)(const u_char *, size_t, u_char *, ssize_t *, ssize_t);
-    ssize_t (*ct_s16be)(const u_char *, size_t, u_char *, ssize_t *, ssize_t);
-    ssize_t (*ct_u16be)(const u_char *, size_t, u_char *, ssize_t *, ssize_t);
-    ssize_t (*ct_s16le)(const u_char *, size_t, u_char *, ssize_t *, ssize_t);
-    ssize_t (*ct_u16le)(const u_char *, size_t, u_char *, ssize_t *, ssize_t);
+    ssize_t (*ct_ulaw)(const u_char __user *, size_t, u_char *, ssize_t *, ssize_t);
+    ssize_t (*ct_alaw)(const u_char __user *, size_t, u_char *, ssize_t *, ssize_t);
+    ssize_t (*ct_s8)(const u_char __user *, size_t, u_char *, ssize_t *, ssize_t);
+    ssize_t (*ct_u8)(const u_char __user *, size_t, u_char *, ssize_t *, ssize_t);
+    ssize_t (*ct_s16be)(const u_char __user *, size_t, u_char *, ssize_t *, ssize_t);
+    ssize_t (*ct_u16be)(const u_char __user *, size_t, u_char *, ssize_t *, ssize_t);
+    ssize_t (*ct_s16le)(const u_char __user *, size_t, u_char *, ssize_t *, ssize_t);
+    ssize_t (*ct_u16le)(const u_char __user *, size_t, u_char *, ssize_t *, ssize_t);
 } TRANS;
 
 struct sound_settings {
diff --git a/sound/oss/dmasound/dmasound_atari.c b/sound/oss/dmasound/dmasound_atari.c
index da681713e..8daaf8766 100644
--- a/sound/oss/dmasound/dmasound_atari.c
+++ b/sound/oss/dmasound/dmasound_atari.c
@@ -1,9 +1,9 @@
 /*
- *  linux/drivers/sound/dmasound/dmasound_atari.c
+ *  linux/sound/oss/dmasound/dmasound_atari.c
  *
  *  Atari TT and Falcon DMA Sound Driver
  *
- *  See linux/drivers/sound/dmasound/dmasound_core.c for copyright and credits
+ *  See linux/sound/oss/dmasound/dmasound_core.c for copyright and credits
  *  prior to 28/01/2001
  *
  *  28/01/2001 [0.1] Iain Sandoe
@@ -22,7 +22,6 @@
 #include <linux/spinlock.h>
 #include <linux/interrupt.h>
 
-#include <asm/pgalloc.h>
 #include <asm/uaccess.h>
 #include <asm/atariints.h>
 #include <asm/atari_stram.h>
diff --git a/sound/oss/dmasound/dmasound_awacs.c b/sound/oss/dmasound/dmasound_awacs.c
index a434e454e..2d7883455 100644
--- a/sound/oss/dmasound/dmasound_awacs.c
+++ b/sound/oss/dmasound/dmasound_awacs.c
@@ -1,10 +1,10 @@
 /*
- *  linux/drivers/sound/dmasound/dmasound_awacs.c
+ *  linux/sound/oss/dmasound/dmasound_awacs.c
  *
  *  PowerMac `AWACS' and `Burgundy' DMA Sound Driver
  *  with some limited support for DACA & Tumbler
  *
- *  See linux/drivers/sound/dmasound/dmasound_core.c for copyright and
+ *  See linux/sound/oss/dmasound/dmasound_core.c for copyright and
  *  history prior to 2001/01/26.
  *
  *	26/01/2001 ed 0.1 Iain Sandoe
@@ -326,12 +326,12 @@ extern int daca_leave_sleep(void);
 #undef IOCTL_OUT
 
 #define IOCTL_IN(arg, ret)	\
-	rc = get_user(ret, (int *)(arg)); \
+	rc = get_user(ret, (int __user *)(arg)); \
 	if (rc) break;
 #define IOCTL_OUT(arg, ret)	\
-	ioctl_return2((int *)(arg), ret)
+	ioctl_return2((int __user *)(arg), ret)
 
-static inline int ioctl_return2(int *addr, int value)
+static inline int ioctl_return2(int __user *addr, int value)
 {
 	return value < 0 ? value : put_user(value, addr);
 }
@@ -461,7 +461,7 @@ tas_dmasound_init(void)
 	write_audio_gpio(gpio_audio_reset, !gpio_audio_reset_pol);
 	msleep(100);
   	if (gpio_headphone_irq) {
-		if (request_irq(gpio_headphone_irq,headphone_intr,0,"Headphone detect",0) < 0) {
+		if (request_irq(gpio_headphone_irq,headphone_intr,0,"Headphone detect",NULL) < 0) {
     			printk(KERN_ERR "tumbler: Can't request headphone interrupt\n");
     			gpio_headphone_irq = 0;
     		} else {
@@ -470,7 +470,7 @@ tas_dmasound_init(void)
 			val = pmac_call_feature(PMAC_FTR_READ_GPIO, NULL, gpio_headphone_detect, 0);
 			pmac_call_feature(PMAC_FTR_WRITE_GPIO, NULL, gpio_headphone_detect, val | 0x80);
 			/* Trigger it */
-  			headphone_intr(0,0,0);
+  			headphone_intr(0,NULL,NULL);
   		}
   	}
   	if (!gpio_headphone_irq) {
@@ -487,7 +487,7 @@ static int
 tas_dmasound_cleanup(void)
 {
 	if (gpio_headphone_irq)
-		free_irq(gpio_headphone_irq, 0);
+		free_irq(gpio_headphone_irq, NULL);
 	return 0;
 }
 
@@ -514,6 +514,7 @@ tas_set_frame_rate(void)
 static int
 tas_mixer_ioctl(u_int cmd, u_long arg)
 {
+	int __user *argp = (int __user *)arg;
 	int data;
 	int rc;
 
@@ -524,16 +525,16 @@ tas_mixer_ioctl(u_int cmd, u_long arg)
 
         if ((cmd & ~0xff) == MIXER_WRITE(0) &&
             tas_supported_mixers() & (1<<(cmd & 0xff))) {
-		rc = get_user(data, (int *)(arg));
+		rc = get_user(data, argp);
                 if (rc<0) return rc;
 		tas_set_mixer_level(cmd & 0xff, data);
 		tas_get_mixer_level(cmd & 0xff, &data);
-		return ioctl_return2((int *)(arg), data);
+		return ioctl_return2(argp, data);
         }
         if ((cmd & ~0xff) == MIXER_READ(0) &&
             tas_supported_mixers() & (1<<(cmd & 0xff))) {
 		tas_get_mixer_level(cmd & 0xff, &data);
-		return ioctl_return2((int *)(arg), data);
+		return ioctl_return2(argp, data);
         }
 
 	switch(cmd) {
@@ -627,10 +628,10 @@ static void PMacFree(void *ptr, unsigned int size)
 static int __init PMacIrqInit(void)
 {
 	if (awacs)
-		if (request_irq(awacs_irq, pmac_awacs_intr, 0, "Built-in Sound misc", 0))
+		if (request_irq(awacs_irq, pmac_awacs_intr, 0, "Built-in Sound misc", NULL))
 			return 0;
-	if (request_irq(awacs_tx_irq, pmac_awacs_tx_intr, 0, "Built-in Sound out", 0)
-	    || request_irq(awacs_rx_irq, pmac_awacs_rx_intr, 0, "Built-in Sound in", 0))
+	if (request_irq(awacs_tx_irq, pmac_awacs_tx_intr, 0, "Built-in Sound out", NULL)
+	    || request_irq(awacs_rx_irq, pmac_awacs_rx_intr, 0, "Built-in Sound in", NULL))
 		return 0;
 	return 1;
 }
@@ -656,9 +657,9 @@ static void PMacIrqCleanup(void)
 		msleep(200);
 	}
 	if (awacs)
-		free_irq(awacs_irq, 0);
-	free_irq(awacs_tx_irq, 0);
-	free_irq(awacs_rx_irq, 0);
+		free_irq(awacs_irq, NULL);
+	free_irq(awacs_tx_irq, NULL);
+	free_irq(awacs_rx_irq, NULL);
 	
 	if (awacs)
 		iounmap((void *)awacs);
@@ -1504,7 +1505,7 @@ static int awacs_sleep_notify(struct pmu_sleep_notifier *self, int when)
 				write_audio_gpio(gpio_audio_reset, !gpio_audio_reset_pol);
 				msleep(150);
 				tas_leave_sleep(); /* Stub for now */
-				headphone_intr(0,0,0);
+				headphone_intr(0,NULL,NULL);
 				break;
 			case AWACS_DACA:
 				msleep(10); /* Check this !!! */
@@ -2969,7 +2970,7 @@ printk("dmasound_pmac: Awacs/Screamer Codec Mfct: %d Rev %d\n", mfg, rev);
 
 		sound_device_id = 0;
 		/* device ID appears post g3 b&w */
-		prop = (unsigned int *)get_property(info, "device-id", 0);
+		prop = (unsigned int *)get_property(info, "device-id", NULL);
 		if (prop != 0)
 			sound_device_id = *prop;
 
@@ -3080,7 +3081,7 @@ printk("dmasound_pmac: Awacs/Screamer Codec Mfct: %d Rev %d\n", mfg, rev);
 
 	} else if (is_pbook_g3) {
 		struct device_node* mio;
-		macio_base = 0;
+		macio_base = NULL;
 		for (mio = io->parent; mio; mio = mio->parent) {
 			if (strcmp(mio->name, "mac-io") == 0
 			    && mio->n_addrs > 0) {
diff --git a/sound/oss/dmasound/dmasound_core.c b/sound/oss/dmasound/dmasound_core.c
index 758ea0cd5..c9302a1e5 100644
--- a/sound/oss/dmasound/dmasound_core.c
+++ b/sound/oss/dmasound/dmasound_core.c
@@ -1,5 +1,5 @@
 /*
- *  linux/drivers/sound/dmasound/dmasound_core.c
+ *  linux/sound/oss/dmasound/dmasound_core.c
  *
  *
  *  OSS/Free compatible Atari TT/Falcon and Amiga DMA sound driver for
@@ -279,11 +279,11 @@ static int sound_set_stereo(int stereo)
 	return stereo;
 }
 
-static ssize_t sound_copy_translate(TRANS *trans, const u_char *userPtr,
+static ssize_t sound_copy_translate(TRANS *trans, const u_char __user *userPtr,
 				    size_t userCount, u_char frame[],
 				    ssize_t *frameUsed, ssize_t frameLeft)
 {
-	ssize_t (*ct_func)(const u_char *, size_t, u_char *, ssize_t *, ssize_t);
+	ssize_t (*ct_func)(const u_char __user *, size_t, u_char *, ssize_t *, ssize_t);
 
 	switch (dmasound.soft.format) {
 	    case AFMT_MU_LAW:
@@ -361,7 +361,7 @@ static int mixer_ioctl(struct inode *inode, struct file *file, u_int cmd,
 		    strlcpy(info.id, dmasound.mach.name2, sizeof(info.id));
 		    strlcpy(info.name, dmasound.mach.name2, sizeof(info.name));
 		    info.modify_counter = mixer.modify_counter;
-		    if (copy_to_user((int *)arg, &info, sizeof(info)))
+		    if (copy_to_user((void __user *)arg, &info, sizeof(info)))
 			    return -EFAULT;
 		    return 0;
 		}
@@ -425,7 +425,7 @@ static int sq_allocate_buffers(struct sound_queue *sq, int num, int size)
 			while (i--)
 				dmasound.mach.dma_free(sq->buffers[i], size);
 			kfree(sq->buffers);
-			sq->buffers = 0;
+			sq->buffers = NULL;
 			return -ENOMEM;
 		}
 	}
@@ -447,7 +447,7 @@ static void sq_release_buffers(struct sound_queue *sq)
 
 static int sq_setup(struct sound_queue *sq)
 {
-	int (*setup_func)(void) = 0;
+	int (*setup_func)(void) = NULL;
 	int hard_frame ;
 
 	if (sq->locked) { /* are we already set? - and not changeable */
@@ -546,7 +546,7 @@ static inline void sq_play(void)
 	dmasound.mach.play();
 }
 
-static ssize_t sq_write(struct file *file, const char *src, size_t uLeft,
+static ssize_t sq_write(struct file *file, const char __user *src, size_t uLeft,
 			loff_t *ppos)
 {
 	ssize_t uWritten = 0;
@@ -703,7 +703,7 @@ static unsigned int sq_poll(struct file *file, struct poll_table_struct *wait)
      *  it and restart the DMA.
      */
 
-static ssize_t sq_read(struct file *file, char *dst, size_t uLeft,
+static ssize_t sq_read(struct file *file, char __user *dst, size_t uLeft,
 		       loff_t *ppos)
 {
 
@@ -1321,7 +1321,7 @@ static int sq_ioctl(struct inode *inode, struct file *file, u_int cmd,
 			info.fragstotal = write_sq.max_active;
 			info.fragsize = write_sq.user_frag_size;
 			info.bytes = info.fragments * info.fragsize;
-			if (copy_to_user((void *)arg, &info, sizeof(info)))
+			if (copy_to_user((void __user *)arg, &info, sizeof(info)))
 				return -EFAULT;
 			return 0;
 		} else
@@ -1547,7 +1547,7 @@ static int state_release(struct inode *inode, struct file *file)
 	return 0;
 }
 
-static ssize_t state_read(struct file *file, char *buf, size_t count,
+static ssize_t state_read(struct file *file, char __user *buf, size_t count,
 			  loff_t *ppos)
 {
 	int n = state.len - state.ptr;
diff --git a/sound/oss/dmasound/dmasound_paula.c b/sound/oss/dmasound/dmasound_paula.c
index b24c42ea6..558db5311 100644
--- a/sound/oss/dmasound/dmasound_paula.c
+++ b/sound/oss/dmasound/dmasound_paula.c
@@ -1,9 +1,9 @@
 /*
- *  linux/drivers/sound/dmasound/dmasound_paula.c
+ *  linux/sound/oss/dmasound/dmasound_paula.c
  *
  *  Amiga `Paula' DMA Sound Driver
  *
- *  See linux/drivers/sound/dmasound/dmasound_core.c for copyright and credits
+ *  See linux/sound/oss/dmasound/dmasound_core.c for copyright and credits
  *  prior to 28/01/2001
  *
  *  28/01/2001 [0.1] Iain Sandoe
diff --git a/sound/oss/dmasound/dmasound_q40.c b/sound/oss/dmasound/dmasound_q40.c
index 82a5443de..92c25a017 100644
--- a/sound/oss/dmasound/dmasound_q40.c
+++ b/sound/oss/dmasound/dmasound_q40.c
@@ -1,9 +1,9 @@
 /*
- *  linux/drivers/sound/dmasound/dmasound_q40.c
+ *  linux/sound/oss/dmasound/dmasound_q40.c
  *
  *  Q40 DMA Sound Driver
  *
- *  See linux/drivers/sound/dmasound/dmasound_core.c for copyright and credits
+ *  See linux/sound/oss/dmasound/dmasound_core.c for copyright and credits
  *  prior to 28/01/2001
  *
  *  28/01/2001 [0.1] Iain Sandoe
diff --git a/sound/oss/dmasound/tas3001c.c b/sound/oss/dmasound/tas3001c.c
index f8ddd3e4d..f227c9f68 100644
--- a/sound/oss/dmasound/tas3001c.c
+++ b/sound/oss/dmasound/tas3001c.c
@@ -452,8 +452,9 @@ tas3001c_eq_rw(	struct tas3001c_data_t *self,
 {
 	int rc;
 	struct tas_biquad_ctrl_t biquad;
+	void __user *argp = (void __user *)arg;
 
-	if (copy_from_user((void *)&biquad, (const void *)arg, sizeof(struct tas_biquad_ctrl_t))) {
+	if (copy_from_user(&biquad, argp, sizeof(struct tas_biquad_ctrl_t))) {
 		return -EFAULT;
 	}
 
@@ -466,7 +467,7 @@ tas3001c_eq_rw(	struct tas3001c_data_t *self,
 		rc=tas3001c_read_biquad(self, biquad.channel, biquad.filter, &biquad.data);
 		if (rc != 0) return rc;
 
-		if (copy_to_user((void *)arg, (const void *)&biquad, sizeof(struct tas_biquad_ctrl_t))) {
+		if (copy_to_user(argp, &biquad, sizeof(struct tas_biquad_ctrl_t))) {
 			return -EFAULT;
 		}
 
@@ -485,27 +486,21 @@ tas3001c_eq_list_rw(	struct tas3001c_data_t *self,
 	int i,j;
 	char sync_required[2][6];
 	struct tas_biquad_ctrl_t biquad;
+	struct tas_biquad_ctrl_list_t __user *argp = (void __user *)arg;
 
 	memset(sync_required,0,sizeof(sync_required));
 
-	if (copy_from_user((void *)&filter_count,
-			   (const void *)arg + offsetof(struct tas_biquad_ctrl_list_t,filter_count),
-			   sizeof(int))) {
+	if (copy_from_user(&filter_count, &argp->filter_count, sizeof(int)))
 		return -EFAULT;
-	}
 
-	if (copy_from_user((void *)&flags,
-			   (const void *)arg + offsetof(struct tas_biquad_ctrl_list_t,flags),
-			   sizeof(int))) {
+	if (copy_from_user(&flags, &argp->flags, sizeof(int)))
 		return -EFAULT;
-	}
 
 	if (cmd & SIOC_IN) {
 	}
 
 	for (i=0; i < filter_count; i++) {
-		if (copy_from_user((void *)&biquad,
-				   (const void *)arg + offsetof(struct tas_biquad_ctrl_list_t, biquads[i]),
+		if (copy_from_user(&biquad, &argp->biquads[i],
 				   sizeof(struct tas_biquad_ctrl_t))) {
 			return -EFAULT;
 		}
@@ -520,8 +515,7 @@ tas3001c_eq_list_rw(	struct tas3001c_data_t *self,
 			rc=tas3001c_read_biquad(self, biquad.channel, biquad.filter, &biquad.data);
 			if (rc != 0) return rc;
 
-			if (copy_to_user((void *)arg + offsetof(struct tas_biquad_ctrl_list_t, biquads[i]),
-					 (const void *)&biquad,
+			if (copy_to_user(&argp->biquads[i], &biquad,
 					 sizeof(struct tas_biquad_ctrl_t))) {
 				return -EFAULT;
 			}
@@ -596,12 +590,10 @@ tas3001c_drce_rw(	struct tas3001c_data_t *self,
 {
 	int rc;
 	struct tas_drce_ctrl_t drce_ctrl;
+	void __user *argp = (void __user *)arg;
 
-	if (copy_from_user((void *)&drce_ctrl,
-			   (const void *)arg,
-			   sizeof(struct tas_drce_ctrl_t))) {
+	if (copy_from_user(&drce_ctrl, argp, sizeof(struct tas_drce_ctrl_t)))
 		return -EFAULT;
-	}
 
 #ifdef DEBUG_DRCE
 	printk("DRCE IOCTL: input [ FLAGS:%x ENABLE:%x THRESH:%x\n",
@@ -623,8 +615,7 @@ tas3001c_drce_rw(	struct tas3001c_data_t *self,
 		if (drce_ctrl.flags & TAS_DRCE_THRESHOLD)
 			drce_ctrl.data.threshold = self->drce_state.threshold;
 
-		if (copy_to_user((void *)arg,
-				 (const void *)&drce_ctrl,
+		if (copy_to_user(argp, &drce_ctrl,
 				 sizeof(struct tas_drce_ctrl_t))) {
 			return -EFAULT;
 		}
@@ -703,6 +694,7 @@ tas3001c_device_ioctl(	struct tas3001c_data_t *self,
 			u_int cmd,
 			u_long arg)
 {
+	uint __user *argp = (void __user *)arg;
 	switch (cmd) {
 	case TAS_READ_EQ:
 	case TAS_WRITE_EQ:
@@ -713,11 +705,11 @@ tas3001c_device_ioctl(	struct tas3001c_data_t *self,
 		return tas3001c_eq_list_rw(self, cmd, arg);
 
 	case TAS_READ_EQ_FILTER_COUNT:
-		put_user(TAS3001C_BIQUAD_FILTER_COUNT, (uint *)(arg));
+		put_user(TAS3001C_BIQUAD_FILTER_COUNT, argp);
 		return 0;
 
 	case TAS_READ_EQ_CHANNEL_COUNT:
-		put_user(TAS3001C_BIQUAD_CHANNEL_COUNT, (uint *)(arg));
+		put_user(TAS3001C_BIQUAD_CHANNEL_COUNT, argp);
 		return 0;
 
 	case TAS_READ_DRCE:
@@ -725,15 +717,14 @@ tas3001c_device_ioctl(	struct tas3001c_data_t *self,
 		return tas3001c_drce_rw(self, cmd, arg);
 
 	case TAS_READ_DRCE_CAPS:
-		put_user(TAS_DRCE_ENABLE | TAS_DRCE_THRESHOLD, (uint *)(arg));
+		put_user(TAS_DRCE_ENABLE | TAS_DRCE_THRESHOLD, argp);
 		return 0;
 
 	case TAS_READ_DRCE_MIN:
 	case TAS_READ_DRCE_MAX: {
 		struct tas_drce_ctrl_t drce_ctrl;
 
-		if (copy_from_user((void *)&drce_ctrl,
-				   (const void *)arg,
+		if (copy_from_user(&drce_ctrl, argp,
 				   sizeof(struct tas_drce_ctrl_t))) {
 			return -EFAULT;
 		}
@@ -746,8 +737,7 @@ tas3001c_device_ioctl(	struct tas3001c_data_t *self,
 			}
 		}
 
-		if (copy_to_user((void *)arg,
-				 (const void *)&drce_ctrl,
+		if (copy_to_user(argp, &drce_ctrl,
 				 sizeof(struct tas_drce_ctrl_t))) {
 			return -EFAULT;
 		}
diff --git a/sound/oss/dmasound/tas3001c_tables.c b/sound/oss/dmasound/tas3001c_tables.c
index a6e7735f4..1768fa95f 100644
--- a/sound/oss/dmasound/tas3001c_tables.c
+++ b/sound/oss/dmasound/tas3001c_tables.c
@@ -3,12 +3,12 @@
 
 static struct tas_drce_t eqp_0e_2_1_drce = {
   .enable     = 1,
-  .above      { .val = 3.0 * (1<<8), .expand = 0 },
-  .below      { .val = 1.0 * (1<<8), .expand = 0 },
-  .threshold  -15.33  * (1<<8),
-  .energy     2.4     * (1<<12),
-  .attack     0.013   * (1<<12),
-  .decay      0.212   * (1<<12),
+  .above      = { .val = 3.0 * (1<<8), .expand = 0 },
+  .below      = { .val = 1.0 * (1<<8), .expand = 0 },
+  .threshold  = -15.33  * (1<<8),
+  .energy     = 2.4     * (1<<12),
+  .attack     = 0.013   * (1<<12),
+  .decay      = 0.212   * (1<<12),
 };
 
 static struct tas_biquad_ctrl_t eqp_0e_2_1_biquads[]={
diff --git a/sound/oss/dmasound/tas3004.c b/sound/oss/dmasound/tas3004.c
index 933b46006..82eaaca2d 100644
--- a/sound/oss/dmasound/tas3004.c
+++ b/sound/oss/dmasound/tas3004.c
@@ -635,10 +635,11 @@ tas3004_eq_rw(	struct tas3004_data_t *self,
 		u_int cmd,
 		u_long arg)
 {
+	void __user *argp = (void __user *)arg;
 	int rc;
 	struct tas_biquad_ctrl_t biquad;
 
-	if (copy_from_user((void *)&biquad, (const void *)arg, sizeof(struct tas_biquad_ctrl_t))) {
+	if (copy_from_user((void *)&biquad, argp, sizeof(struct tas_biquad_ctrl_t))) {
 		return -EFAULT;
 	}
 
@@ -651,7 +652,7 @@ tas3004_eq_rw(	struct tas3004_data_t *self,
 		rc=tas3004_read_biquad(self, biquad.channel, biquad.filter, &biquad.data);
 		if (rc != 0) return rc;
 
-		if (copy_to_user((void *)arg, (const void *)&biquad, sizeof(struct tas_biquad_ctrl_t))) {
+		if (copy_to_user(argp, &biquad, sizeof(struct tas_biquad_ctrl_t))) {
 			return -EFAULT;
 		}
 
@@ -670,27 +671,21 @@ tas3004_eq_list_rw(	struct tas3004_data_t *self,
 	int i,j;
 	char sync_required[TAS3004_BIQUAD_CHANNEL_COUNT][TAS3004_BIQUAD_FILTER_COUNT];
 	struct tas_biquad_ctrl_t biquad;
+	struct tas_biquad_ctrl_list_t __user *argp = (void __user *)arg;
 
 	memset(sync_required,0,sizeof(sync_required));
 
-	if (copy_from_user((void *)&filter_count,
-			   (const void *)arg + offsetof(struct tas_biquad_ctrl_list_t,filter_count),
-			   sizeof(int))) {
+	if (copy_from_user(&filter_count, &argp->filter_count, sizeof(int)))
 		return -EFAULT;
-	}
 
-	if (copy_from_user((void *)&flags,
-			   (const void *)arg + offsetof(struct tas_biquad_ctrl_list_t,flags),
-			   sizeof(int))) {
+	if (copy_from_user(&flags, &argp->flags, sizeof(int)))
 		return -EFAULT;
-	}
 
 	if (cmd & SIOC_IN) {
 	}
 
 	for (i=0; i < filter_count; i++) {
-		if (copy_from_user((void *)&biquad,
-				   (const void *)arg + offsetof(struct tas_biquad_ctrl_list_t, biquads[i]),
+		if (copy_from_user(&biquad, &argp->biquads[i],
 				   sizeof(struct tas_biquad_ctrl_t))) {
 			return -EFAULT;
 		}
@@ -705,8 +700,7 @@ tas3004_eq_list_rw(	struct tas3004_data_t *self,
 			rc=tas3004_read_biquad(self, biquad.channel, biquad.filter, &biquad.data);
 			if (rc != 0) return rc;
 
-			if (copy_to_user((void *)arg + offsetof(struct tas_biquad_ctrl_list_t, biquads[i]),
-					 (const void *)&biquad,
+			if (copy_to_user(&argp->biquads[i], &biquad,
 					 sizeof(struct tas_biquad_ctrl_t))) {
 				return -EFAULT;
 			}
@@ -840,12 +834,10 @@ tas3004_drce_rw(	struct tas3004_data_t *self,
 {
 	int rc;
 	struct tas_drce_ctrl_t drce_ctrl;
+	void __user *argp = (void __user *)arg;
 
-	if (copy_from_user((void *)&drce_ctrl,
-			   (const void *)arg,
-			   sizeof(struct tas_drce_ctrl_t))) {
+	if (copy_from_user(&drce_ctrl, argp, sizeof(struct tas_drce_ctrl_t)))
 		return -EFAULT;
-	}
 
 #ifdef DEBUG_DRCE
 	printk("DRCE: input [ FLAGS:%x ENABLE:%x ABOVE:%x/%x BELOW:%x/%x THRESH:%x ENERGY:%x ATTACK:%x DECAY:%x\n",
@@ -880,8 +872,7 @@ tas3004_drce_rw(	struct tas3004_data_t *self,
 		if (drce_ctrl.flags & TAS_DRCE_DECAY)
 			drce_ctrl.data.decay = self->drce_state.decay;
 
-		if (copy_to_user((void *)arg,
-				 (const void *)&drce_ctrl,
+		if (copy_to_user(argp, &drce_ctrl,
 				 sizeof(struct tas_drce_ctrl_t))) {
 			return -EFAULT;
 		}
@@ -952,6 +943,7 @@ tas3004_device_ioctl(	struct tas3004_data_t *self,
 			u_int cmd,
 			u_long arg)
 {
+	uint __user *argp = (void __user *)arg;
 	switch (cmd) {
 	case TAS_READ_EQ:
 	case TAS_WRITE_EQ:
@@ -962,11 +954,11 @@ tas3004_device_ioctl(	struct tas3004_data_t *self,
 		return tas3004_eq_list_rw(self, cmd, arg);
 
 	case TAS_READ_EQ_FILTER_COUNT:
-		put_user(TAS3004_BIQUAD_FILTER_COUNT, (uint *)(arg));
+		put_user(TAS3004_BIQUAD_FILTER_COUNT, argp);
 		return 0;
 
 	case TAS_READ_EQ_CHANNEL_COUNT:
-		put_user(TAS3004_BIQUAD_CHANNEL_COUNT, (uint *)(arg));
+		put_user(TAS3004_BIQUAD_CHANNEL_COUNT, argp);
 		return 0;
 
 	case TAS_READ_DRCE:
@@ -981,7 +973,7 @@ tas3004_device_ioctl(	struct tas3004_data_t *self,
 			 TAS_DRCE_ENERGY         |
 			 TAS_DRCE_ATTACK         |
 			 TAS_DRCE_DECAY,
-			 (uint *)(arg));
+			 argp);
 		return 0;
 
 	case TAS_READ_DRCE_MIN:
@@ -989,8 +981,7 @@ tas3004_device_ioctl(	struct tas3004_data_t *self,
 		struct tas_drce_ctrl_t drce_ctrl;
 		const struct tas_drce_t *drce_copy;
 
-		if (copy_from_user((void *)&drce_ctrl,
-				   (const void *)arg,
+		if (copy_from_user(&drce_ctrl, argp,
 				   sizeof(struct tas_drce_ctrl_t))) {
 			return -EFAULT;
 		}
@@ -1020,8 +1011,7 @@ tas3004_device_ioctl(	struct tas3004_data_t *self,
 			drce_ctrl.data.decay=drce_copy->decay;
 		}
 
-		if (copy_to_user((void *)arg,
-				 (const void *)&drce_ctrl,
+		if (copy_to_user(argp, &drce_ctrl,
 				 sizeof(struct tas_drce_ctrl_t))) {
 			return -EFAULT;
 		}
diff --git a/sound/oss/dmasound/trans_16.c b/sound/oss/dmasound/trans_16.c
index 4559dec46..23562e947 100644
--- a/sound/oss/dmasound/trans_16.c
+++ b/sound/oss/dmasound/trans_16.c
@@ -1,9 +1,9 @@
 /*
- *  linux/drivers/sound/dmasound/trans_16.c
+ *  linux/sound/oss/dmasound/trans_16.c
  *
  *  16 bit translation routines.  Only used by Power mac at present.
  *
- *  See linux/drivers/sound/dmasound/dmasound_core.c for copyright and
+ *  See linux/sound/oss/dmasound/dmasound_core.c for copyright and
  *  history prior to 08/02/2001.
  *
  *  08/02/2001 Iain Sandoe
@@ -20,42 +20,42 @@
 static short dmasound_alaw2dma16[] ;
 static short dmasound_ulaw2dma16[] ;
 
-static ssize_t pmac_ct_law(const u_char *userPtr, size_t userCount,
+static ssize_t pmac_ct_law(const u_char __user *userPtr, size_t userCount,
 			   u_char frame[], ssize_t *frameUsed,
 			   ssize_t frameLeft);
-static ssize_t pmac_ct_s8(const u_char *userPtr, size_t userCount,
+static ssize_t pmac_ct_s8(const u_char __user *userPtr, size_t userCount,
 			  u_char frame[], ssize_t *frameUsed,
 			  ssize_t frameLeft);
-static ssize_t pmac_ct_u8(const u_char *userPtr, size_t userCount,
+static ssize_t pmac_ct_u8(const u_char __user *userPtr, size_t userCount,
 			  u_char frame[], ssize_t *frameUsed,
 			  ssize_t frameLeft);
-static ssize_t pmac_ct_s16(const u_char *userPtr, size_t userCount,
+static ssize_t pmac_ct_s16(const u_char __user *userPtr, size_t userCount,
 			   u_char frame[], ssize_t *frameUsed,
 			   ssize_t frameLeft);
-static ssize_t pmac_ct_u16(const u_char *userPtr, size_t userCount,
+static ssize_t pmac_ct_u16(const u_char __user *userPtr, size_t userCount,
 			   u_char frame[], ssize_t *frameUsed,
 			   ssize_t frameLeft);
 
-static ssize_t pmac_ctx_law(const u_char *userPtr, size_t userCount,
+static ssize_t pmac_ctx_law(const u_char __user *userPtr, size_t userCount,
 			    u_char frame[], ssize_t *frameUsed,
 			    ssize_t frameLeft);
-static ssize_t pmac_ctx_s8(const u_char *userPtr, size_t userCount,
+static ssize_t pmac_ctx_s8(const u_char __user *userPtr, size_t userCount,
 			   u_char frame[], ssize_t *frameUsed,
 			   ssize_t frameLeft);
-static ssize_t pmac_ctx_u8(const u_char *userPtr, size_t userCount,
+static ssize_t pmac_ctx_u8(const u_char __user *userPtr, size_t userCount,
 			   u_char frame[], ssize_t *frameUsed,
 			   ssize_t frameLeft);
-static ssize_t pmac_ctx_s16(const u_char *userPtr, size_t userCount,
+static ssize_t pmac_ctx_s16(const u_char __user *userPtr, size_t userCount,
 			    u_char frame[], ssize_t *frameUsed,
 			    ssize_t frameLeft);
-static ssize_t pmac_ctx_u16(const u_char *userPtr, size_t userCount,
+static ssize_t pmac_ctx_u16(const u_char __user *userPtr, size_t userCount,
 			    u_char frame[], ssize_t *frameUsed,
 			    ssize_t frameLeft);
 
-static ssize_t pmac_ct_s16_read(const u_char *userPtr, size_t userCount,
+static ssize_t pmac_ct_s16_read(const u_char __user *userPtr, size_t userCount,
 			   u_char frame[], ssize_t *frameUsed,
 			   ssize_t frameLeft);
-static ssize_t pmac_ct_u16_read(const u_char *userPtr, size_t userCount,
+static ssize_t pmac_ct_u16_read(const u_char __user *userPtr, size_t userCount,
 			   u_char frame[], ssize_t *frameUsed,
 			   ssize_t frameLeft);
 
@@ -63,7 +63,7 @@ static ssize_t pmac_ct_u16_read(const u_char *userPtr, size_t userCount,
 
 static int expand_data;	/* Data for expanding */
 
-static ssize_t pmac_ct_law(const u_char *userPtr, size_t userCount,
+static ssize_t pmac_ct_law(const u_char __user *userPtr, size_t userCount,
 			   u_char frame[], ssize_t *frameUsed,
 			   ssize_t frameLeft)
 {
@@ -96,7 +96,7 @@ static ssize_t pmac_ct_law(const u_char *userPtr, size_t userCount,
 }
 
 
-static ssize_t pmac_ct_s8(const u_char *userPtr, size_t userCount,
+static ssize_t pmac_ct_s8(const u_char __user *userPtr, size_t userCount,
 			  u_char frame[], ssize_t *frameUsed,
 			  ssize_t frameLeft)
 {
@@ -127,7 +127,7 @@ static ssize_t pmac_ct_s8(const u_char *userPtr, size_t userCount,
 }
 
 
-static ssize_t pmac_ct_u8(const u_char *userPtr, size_t userCount,
+static ssize_t pmac_ct_u8(const u_char __user *userPtr, size_t userCount,
 			  u_char frame[], ssize_t *frameUsed,
 			  ssize_t frameLeft)
 {
@@ -158,7 +158,7 @@ static ssize_t pmac_ct_u8(const u_char *userPtr, size_t userCount,
 }
 
 
-static ssize_t pmac_ct_s16(const u_char *userPtr, size_t userCount,
+static ssize_t pmac_ct_s16(const u_char __user *userPtr, size_t userCount,
 			   u_char frame[], ssize_t *frameUsed,
 			   ssize_t frameLeft)
 {
@@ -170,7 +170,7 @@ static ssize_t pmac_ct_s16(const u_char *userPtr, size_t userCount,
 	userCount >>= (stereo? 2: 1);
 	used = count = min_t(unsigned long, userCount, frameLeft);
 	if (!stereo) {
-		short *up = (short *) userPtr;
+		short __user *up = (short __user *) userPtr;
 		while (count > 0) {
 			short data;
 			if (get_user(data, up++))
@@ -187,7 +187,7 @@ static ssize_t pmac_ct_s16(const u_char *userPtr, size_t userCount,
 	return stereo? used * 4: used * 2;
 }
 
-static ssize_t pmac_ct_u16(const u_char *userPtr, size_t userCount,
+static ssize_t pmac_ct_u16(const u_char __user *userPtr, size_t userCount,
 			   u_char frame[], ssize_t *frameUsed,
 			   ssize_t frameLeft)
 {
@@ -195,7 +195,7 @@ static ssize_t pmac_ct_u16(const u_char *userPtr, size_t userCount,
 	int mask = (dmasound.soft.format == AFMT_U16_LE? 0x0080: 0x8000);
 	int stereo = dmasound.soft.stereo;
 	short *fp = (short *) &frame[*frameUsed];
-	short *up = (short *) userPtr;
+	short __user *up = (short __user *) userPtr;
 
 	frameLeft >>= 2;
 	userCount >>= (stereo? 2: 1);
@@ -219,7 +219,7 @@ static ssize_t pmac_ct_u16(const u_char *userPtr, size_t userCount,
 }
 
 
-static ssize_t pmac_ctx_law(const u_char *userPtr, size_t userCount,
+static ssize_t pmac_ctx_law(const u_char __user *userPtr, size_t userCount,
 			    u_char frame[], ssize_t *frameUsed,
 			    ssize_t frameLeft)
 {
@@ -266,7 +266,7 @@ static ssize_t pmac_ctx_law(const u_char *userPtr, size_t userCount,
 	return stereo? utotal * 2: utotal;
 }
 
-static ssize_t pmac_ctx_s8(const u_char *userPtr, size_t userCount,
+static ssize_t pmac_ctx_s8(const u_char __user *userPtr, size_t userCount,
 			   u_char frame[], ssize_t *frameUsed,
 			   ssize_t frameLeft)
 {
@@ -311,7 +311,7 @@ static ssize_t pmac_ctx_s8(const u_char *userPtr, size_t userCount,
 }
 
 
-static ssize_t pmac_ctx_u8(const u_char *userPtr, size_t userCount,
+static ssize_t pmac_ctx_u8(const u_char __user *userPtr, size_t userCount,
 			   u_char frame[], ssize_t *frameUsed,
 			   ssize_t frameLeft)
 {
@@ -356,13 +356,13 @@ static ssize_t pmac_ctx_u8(const u_char *userPtr, size_t userCount,
 }
 
 
-static ssize_t pmac_ctx_s16(const u_char *userPtr, size_t userCount,
+static ssize_t pmac_ctx_s16(const u_char __user *userPtr, size_t userCount,
 			    u_char frame[], ssize_t *frameUsed,
 			    ssize_t frameLeft)
 {
 	unsigned int *p = (unsigned int *) &frame[*frameUsed];
 	unsigned int data = expand_data;
-	unsigned short *up = (unsigned short *) userPtr;
+	unsigned short __user *up = (unsigned short __user *) userPtr;
 	int bal = expand_bal;
 	int hSpeed = dmasound.hard.speed, sSpeed = dmasound.soft.speed;
 	int stereo = dmasound.soft.stereo;
@@ -400,14 +400,14 @@ static ssize_t pmac_ctx_s16(const u_char *userPtr, size_t userCount,
 }
 
 
-static ssize_t pmac_ctx_u16(const u_char *userPtr, size_t userCount,
+static ssize_t pmac_ctx_u16(const u_char __user *userPtr, size_t userCount,
 			    u_char frame[], ssize_t *frameUsed,
 			    ssize_t frameLeft)
 {
 	int mask = (dmasound.soft.format == AFMT_U16_LE? 0x0080: 0x8000);
 	unsigned int *p = (unsigned int *) &frame[*frameUsed];
 	unsigned int data = expand_data;
-	unsigned short *up = (unsigned short *) userPtr;
+	unsigned short __user *up = (unsigned short __user *) userPtr;
 	int bal = expand_bal;
 	int hSpeed = dmasound.hard.speed, sSpeed = dmasound.soft.speed;
 	int stereo = dmasound.soft.stereo;
@@ -447,7 +447,7 @@ static ssize_t pmac_ctx_u16(const u_char *userPtr, size_t userCount,
 
 /* data in routines... */
 
-static ssize_t pmac_ct_s8_read(const u_char *userPtr, size_t userCount,
+static ssize_t pmac_ct_s8_read(const u_char __user *userPtr, size_t userCount,
 			  u_char frame[], ssize_t *frameUsed,
 			  ssize_t frameLeft)
 {
@@ -465,13 +465,13 @@ static ssize_t pmac_ct_s8_read(const u_char *userPtr, size_t userCount,
 		val = *p++;
 		val = (val * software_input_volume) >> 7;
 		data = val >> 8;
-		if (put_user(data, (u_char *)userPtr++))
+		if (put_user(data, (u_char __user *)userPtr++))
 			return -EFAULT;
 		if (stereo) {
 			val = *p;
 			val = (val * software_input_volume) >> 7;
 			data = val >> 8;
-			if (put_user(data, (u_char *)userPtr++))
+			if (put_user(data, (u_char __user *)userPtr++))
 				return -EFAULT;
 		}
 		p++;
@@ -482,7 +482,7 @@ static ssize_t pmac_ct_s8_read(const u_char *userPtr, size_t userCount,
 }
 
 
-static ssize_t pmac_ct_u8_read(const u_char *userPtr, size_t userCount,
+static ssize_t pmac_ct_u8_read(const u_char __user *userPtr, size_t userCount,
 			  u_char frame[], ssize_t *frameUsed,
 			  ssize_t frameLeft)
 {
@@ -500,13 +500,13 @@ static ssize_t pmac_ct_u8_read(const u_char *userPtr, size_t userCount,
 		val = *p++;
 		val = (val * software_input_volume) >> 7;
 		data = (val >> 8) ^ 0x80;
-		if (put_user(data, (u_char *)userPtr++))
+		if (put_user(data, (u_char __user *)userPtr++))
 			return -EFAULT;
 		if (stereo) {
 			val = *p;
 			val = (val * software_input_volume) >> 7;
 			data = (val >> 8) ^ 0x80;
-			if (put_user(data, (u_char *)userPtr++))
+			if (put_user(data, (u_char __user *)userPtr++))
 				return -EFAULT;
 		}
 		p++;
@@ -516,14 +516,14 @@ static ssize_t pmac_ct_u8_read(const u_char *userPtr, size_t userCount,
 	return stereo? used * 2: used;
 }
 
-static ssize_t pmac_ct_s16_read(const u_char *userPtr, size_t userCount,
+static ssize_t pmac_ct_s16_read(const u_char __user *userPtr, size_t userCount,
 			   u_char frame[], ssize_t *frameUsed,
 			   ssize_t frameLeft)
 {
 	ssize_t count, used;
 	int stereo = dmasound.soft.stereo;
 	short *fp = (short *) &frame[*frameUsed];
-	short *up = (short *) userPtr;
+	short __user *up = (short __user *) userPtr;
 
 	frameLeft >>= 2;
 	userCount >>= (stereo? 2: 1);
@@ -548,7 +548,7 @@ static ssize_t pmac_ct_s16_read(const u_char *userPtr, size_t userCount,
 	return stereo? used * 4: used * 2;
 }
 
-static ssize_t pmac_ct_u16_read(const u_char *userPtr, size_t userCount,
+static ssize_t pmac_ct_u16_read(const u_char __user *userPtr, size_t userCount,
 			   u_char frame[], ssize_t *frameUsed,
 			   ssize_t frameLeft)
 {
@@ -556,7 +556,7 @@ static ssize_t pmac_ct_u16_read(const u_char *userPtr, size_t userCount,
 	int mask = (dmasound.soft.format == AFMT_U16_LE? 0x0080: 0x8000);
 	int stereo = dmasound.soft.stereo;
 	short *fp = (short *) &frame[*frameUsed];
-	short *up = (short *) userPtr;
+	short __user *up = (short __user *) userPtr;
 
 	frameLeft >>= 2;
 	userCount >>= (stereo? 2: 1);
@@ -585,7 +585,7 @@ static ssize_t pmac_ct_u16_read(const u_char *userPtr, size_t userCount,
 
 /* data in routines (reducing speed)... */
 
-static ssize_t pmac_ctx_s8_read(const u_char *userPtr, size_t userCount,
+static ssize_t pmac_ctx_s8_read(const u_char __user *userPtr, size_t userCount,
 			  u_char frame[], ssize_t *frameUsed,
 			  ssize_t frameLeft)
 {
@@ -614,11 +614,11 @@ static ssize_t pmac_ctx_s8_read(const u_char *userPtr, size_t userCount,
 		p++;
 		if (bal < 0) {
 			data = vall >> 8;
-			if (put_user(data, (u_char *)userPtr++))
+			if (put_user(data, (u_char __user *)userPtr++))
 				return -EFAULT;
 			if (stereo) {
 				data = valr >> 8;
-				if (put_user(data, (u_char *)userPtr++))
+				if (put_user(data, (u_char __user *)userPtr++))
 					return -EFAULT;
 			}
 			userCount--;
@@ -634,7 +634,7 @@ static ssize_t pmac_ctx_s8_read(const u_char *userPtr, size_t userCount,
 }
 
 
-static ssize_t pmac_ctx_u8_read(const u_char *userPtr, size_t userCount,
+static ssize_t pmac_ctx_u8_read(const u_char __user *userPtr, size_t userCount,
 			  u_char frame[], ssize_t *frameUsed,
 			  ssize_t frameLeft)
 {
@@ -664,11 +664,11 @@ static ssize_t pmac_ctx_u8_read(const u_char *userPtr, size_t userCount,
 		p++;
 		if (bal < 0) {
 			data = (vall >> 8) ^ 0x80;
-			if (put_user(data, (u_char *)userPtr++))
+			if (put_user(data, (u_char __user *)userPtr++))
 				return -EFAULT;
 			if (stereo) {
 				data = (valr >> 8) ^ 0x80;
-				if (put_user(data, (u_char *)userPtr++))
+				if (put_user(data, (u_char __user *)userPtr++))
 					return -EFAULT;
 			}
 			userCount--;
@@ -683,13 +683,13 @@ static ssize_t pmac_ctx_u8_read(const u_char *userPtr, size_t userCount,
 	return stereo? utotal * 2: utotal;
 }
 
-static ssize_t pmac_ctx_s16_read(const u_char *userPtr, size_t userCount,
+static ssize_t pmac_ctx_s16_read(const u_char __user *userPtr, size_t userCount,
 			   u_char frame[], ssize_t *frameUsed,
 			   ssize_t frameLeft)
 {
 	int bal = expand_read_bal;
 	short *fp = (short *) &frame[*frameUsed];
-	short *up = (short *) userPtr;
+	short __user *up = (short __user *) userPtr;
 	int stereo = dmasound.soft.stereo;
 	int hSpeed = dmasound.hard.speed, sSpeed = dmasound.soft.speed;
 	int utotal, ftotal;
@@ -730,14 +730,14 @@ static ssize_t pmac_ctx_s16_read(const u_char *userPtr, size_t userCount,
 	return stereo? utotal * 4: utotal * 2;
 }
 
-static ssize_t pmac_ctx_u16_read(const u_char *userPtr, size_t userCount,
+static ssize_t pmac_ctx_u16_read(const u_char __user *userPtr, size_t userCount,
 			   u_char frame[], ssize_t *frameUsed,
 			   ssize_t frameLeft)
 {
 	int bal = expand_read_bal;
 	int mask = (dmasound.soft.format == AFMT_U16_LE? 0x0080: 0x8000);
 	short *fp = (short *) &frame[*frameUsed];
-	short *up = (short *) userPtr;
+	short __user *up = (short __user *) userPtr;
 	int stereo = dmasound.soft.stereo;
 	int hSpeed = dmasound.hard.speed, sSpeed = dmasound.soft.speed;
 	int utotal, ftotal;
diff --git a/sound/oss/emu10k1/audio.c b/sound/oss/emu10k1/audio.c
index 1aac3655d..9cf30ab2f 100644
--- a/sound/oss/emu10k1/audio.c
+++ b/sound/oss/emu10k1/audio.c
@@ -59,9 +59,6 @@ static ssize_t emu10k1_audio_read(struct file *file, char __user *buffer, size_t
 
 	DPD(3, "emu10k1_audio_read(), buffer=%p, count=%d\n", buffer, (u32) count);
 
-	if (ppos != &file->f_pos)
-		return -ESPIPE;
-
 	if (!access_ok(VERIFY_WRITE, buffer, count))
 		return -EFAULT;
 
@@ -146,9 +143,6 @@ static ssize_t emu10k1_audio_write(struct file *file, const char __user *buffer,
 
 	DPD(3, "emu10k1_audio_write(), buffer=%p, count=%d\n", buffer, (u32) count);
 
-	if (ppos != &file->f_pos)
-		return -ESPIPE;
-
 	if (!access_ok(VERIFY_READ, buffer, count))
 		return -EFAULT;
 
@@ -1249,7 +1243,7 @@ match:
 
 	file->private_data = (void *) wave_dev;
 
-	return 0;
+	return nonseekable_open(inode, file);
 }
 
 static int emu10k1_audio_release(struct inode *inode, struct file *file)
diff --git a/sound/oss/emu10k1/main.c b/sound/oss/emu10k1/main.c
index f899b8d07..8f6f2df00 100644
--- a/sound/oss/emu10k1/main.c
+++ b/sound/oss/emu10k1/main.c
@@ -342,26 +342,26 @@ static int __devinit emu10k1_proc_init(struct emu10k1_card *card)
 {
 	char s[48];
 
-	if (!proc_mkdir ("driver/emu10k1", 0)) {
+	if (!proc_mkdir ("driver/emu10k1", NULL)) {
 		printk(KERN_ERR "emu10k1: unable to create proc directory driver/emu10k1\n");
 		goto err_out;
 	}
 
 	sprintf(s, "driver/emu10k1/%s", pci_name(card->pci_dev));
-	if (!proc_mkdir (s, 0)) {
+	if (!proc_mkdir (s, NULL)) {
 		printk(KERN_ERR "emu10k1: unable to create proc directory %s\n", s);
 		goto err_emu10k1_proc;
 	}
 
 	sprintf(s, "driver/emu10k1/%s/info", pci_name(card->pci_dev));
-	if (!create_proc_read_entry (s, 0, 0, emu10k1_info_proc, card)) {
+	if (!create_proc_read_entry (s, 0, NULL, emu10k1_info_proc, card)) {
 		printk(KERN_ERR "emu10k1: unable to create proc entry %s\n", s);
 		goto err_dev_proc;
 	}
 
 	if (!card->is_aps) {
 		sprintf(s, "driver/emu10k1/%s/ac97", pci_name(card->pci_dev));
-		if (!create_proc_read_entry (s, 0, 0, ac97_read_proc, card->ac97)) {
+		if (!create_proc_read_entry (s, 0, NULL, ac97_read_proc, card->ac97)) {
 			printk(KERN_ERR "emu10k1: unable to create proc entry %s\n", s);
 			goto err_proc_ac97;
 		}
diff --git a/sound/oss/emu10k1/midi.c b/sound/oss/emu10k1/midi.c
index 1aa768f2e..ec2424db4 100644
--- a/sound/oss/emu10k1/midi.c
+++ b/sound/oss/emu10k1/midi.c
@@ -185,7 +185,7 @@ match:
 
 	up(&card->open_sem);
 
-	return 0;
+	return nonseekable_open(inode, file);
 }
 
 static int emu10k1_midi_release(struct inode *inode, struct file *file)
@@ -253,9 +253,6 @@ static ssize_t emu10k1_midi_read(struct file *file, char __user *buffer, size_t
 
 	DPD(4, "emu10k1_midi_read(), count %#x\n", (u32) count);
 
-	if (pos != &file->f_pos)
-		return -ESPIPE;
-
 	if (!access_ok(VERIFY_WRITE, buffer, count))
 		return -EFAULT;
 
@@ -328,9 +325,6 @@ static ssize_t emu10k1_midi_write(struct file *file, const char __user *buffer,
 
 	DPD(4, "emu10k1_midi_write(), count=%#x\n", (u32) count);
 
-	if (pos != &file->f_pos)
-		return -ESPIPE;
-
 	if (!access_ok(VERIFY_READ, buffer, count))
 		return -EFAULT;
 
@@ -532,7 +526,7 @@ void emu10k1_seq_midi_close(int dev)
 
 	if (card->seq_mididev) {
 		kfree(card->seq_mididev);
-		card->seq_mididev = 0;
+		card->seq_mididev = NULL;
 	}
 }
 
diff --git a/sound/oss/es1370.c b/sound/oss/es1370.c
index 68189853a..57f9bc147 100644
--- a/sound/oss/es1370.c
+++ b/sound/oss/es1370.c
@@ -1037,7 +1037,7 @@ static int es1370_open_mixdev(struct inode *inode, struct file *file)
 	}
        	VALIDATE_STATE(s);
 	file->private_data = s;
-	return 0;
+	return nonseekable_open(inode, file);
 }
 
 static int es1370_release_mixdev(struct inode *inode, struct file *file)
@@ -1147,8 +1147,6 @@ static ssize_t es1370_read(struct file *file, char __user *buffer, size_t count,
 	int cnt;
 
 	VALIDATE_STATE(s);
-	if (ppos != &file->f_pos)
-		return -ESPIPE;
 	if (s->dma_adc.mapped)
 		return -ENXIO;
 	if (!access_ok(VERIFY_WRITE, buffer, count))
@@ -1225,8 +1223,6 @@ static ssize_t es1370_write(struct file *file, const char __user *buffer, size_t
 	int cnt;
 
 	VALIDATE_STATE(s);
-	if (ppos != &file->f_pos)
-		return -ESPIPE;
 	if (s->dma_dac2.mapped)
 		return -ENXIO;
 	if (!access_ok(VERIFY_READ, buffer, count))
@@ -1789,7 +1785,7 @@ static int es1370_open(struct inode *inode, struct file *file)
 	s->open_mode |= file->f_mode & (FMODE_READ | FMODE_WRITE);
 	up(&s->open_sem);
 	init_MUTEX(&s->sem);
-	return 0;
+	return nonseekable_open(inode, file);
 }
 
 static int es1370_release(struct inode *inode, struct file *file)
@@ -1841,8 +1837,6 @@ static ssize_t es1370_write_dac(struct file *file, const char __user *buffer, si
 	int cnt;
 
 	VALIDATE_STATE(s);
-	if (ppos != &file->f_pos)
-		return -ESPIPE;
 	if (s->dma_dac1.mapped)
 		return -ENXIO;
 	if (!s->dma_dac1.ready && (ret = prog_dmabuf_dac1(s)))
@@ -2222,7 +2216,7 @@ static int es1370_open_dac(struct inode *inode, struct file *file)
 	spin_unlock_irqrestore(&s->lock, flags);
 	s->open_mode |= FMODE_DAC;
 	up(&s->open_sem);
-	return 0;
+	return nonseekable_open(inode, file);
 }
 
 static int es1370_release_dac(struct inode *inode, struct file *file)
@@ -2265,8 +2259,6 @@ static ssize_t es1370_midi_read(struct file *file, char __user *buffer, size_t c
 	int cnt;
 
 	VALIDATE_STATE(s);
-	if (ppos != &file->f_pos)
-		return -ESPIPE;
 	if (!access_ok(VERIFY_WRITE, buffer, count))
 		return -EFAULT;
 	if (count == 0)
@@ -2328,8 +2320,6 @@ static ssize_t es1370_midi_write(struct file *file, const char __user *buffer, s
 	int cnt;
 
 	VALIDATE_STATE(s);
-	if (ppos != &file->f_pos)
-		return -ESPIPE;
 	if (!access_ok(VERIFY_READ, buffer, count))
 		return -EFAULT;
 	if (count == 0)
@@ -2464,7 +2454,7 @@ static int es1370_midi_open(struct inode *inode, struct file *file)
 	spin_unlock_irqrestore(&s->lock, flags);
 	s->open_mode |= (file->f_mode << FMODE_MIDI_SHIFT) & (FMODE_MIDI_READ | FMODE_MIDI_WRITE);
 	up(&s->open_sem);
-	return 0;
+	return nonseekable_open(inode, file);
 }
 
 static int es1370_midi_release(struct inode *inode, struct file *file)
diff --git a/sound/oss/es1371.c b/sound/oss/es1371.c
index 7d1a108dd..d6b59fbe5 100644
--- a/sound/oss/es1371.c
+++ b/sound/oss/es1371.c
@@ -1223,7 +1223,7 @@ static int es1371_open_mixdev(struct inode *inode, struct file *file)
 	}
        	VALIDATE_STATE(s);
 	file->private_data = s;
-	return 0;
+	return nonseekable_open(inode, file);
 }
 
 static int es1371_release_mixdev(struct inode *inode, struct file *file)
@@ -1334,8 +1334,6 @@ static ssize_t es1371_read(struct file *file, char __user *buffer, size_t count,
 	int cnt;
 
 	VALIDATE_STATE(s);
-	if (ppos != &file->f_pos)
-		return -ESPIPE;
 	if (s->dma_adc.mapped)
 		return -ENXIO;
 	if (!access_ok(VERIFY_WRITE, buffer, count))
@@ -1413,8 +1411,6 @@ static ssize_t es1371_write(struct file *file, const char __user *buffer, size_t
 	int cnt;
 
 	VALIDATE_STATE(s);
-	if (ppos != &file->f_pos)
-		return -ESPIPE;
 	if (s->dma_dac2.mapped)
 		return -ENXIO;
 	if (!access_ok(VERIFY_READ, buffer, count))
@@ -1978,7 +1974,7 @@ static int es1371_open(struct inode *inode, struct file *file)
 	s->open_mode |= file->f_mode & (FMODE_READ | FMODE_WRITE);
 	up(&s->open_sem);
 	init_MUTEX(&s->sem);
-	return 0;
+	return nonseekable_open(inode, file);
 }
 
 static int es1371_release(struct inode *inode, struct file *file)
@@ -2029,8 +2025,6 @@ static ssize_t es1371_write_dac(struct file *file, const char __user *buffer, si
 	int cnt;
 
 	VALIDATE_STATE(s);
-	if (ppos != &file->f_pos)
-		return -ESPIPE;
 	if (s->dma_dac1.mapped)
 		return -ENXIO;
 	if (!s->dma_dac1.ready && (ret = prog_dmabuf_dac1(s)))
@@ -2400,7 +2394,7 @@ static int es1371_open_dac(struct inode *inode, struct file *file)
 	spin_unlock_irqrestore(&s->lock, flags);
 	s->open_mode |= FMODE_DAC;
 	up(&s->open_sem);
-	return 0;
+	return nonseekable_open(inode, file);
 }
 
 static int es1371_release_dac(struct inode *inode, struct file *file)
@@ -2443,8 +2437,6 @@ static ssize_t es1371_midi_read(struct file *file, char __user *buffer, size_t c
 	int cnt;
 
 	VALIDATE_STATE(s);
-	if (ppos != &file->f_pos)
-		return -ESPIPE;
 	if (!access_ok(VERIFY_WRITE, buffer, count))
 		return -EFAULT;
 	if (count == 0)
@@ -2506,8 +2498,6 @@ static ssize_t es1371_midi_write(struct file *file, const char __user *buffer, s
 	int cnt;
 
 	VALIDATE_STATE(s);
-	if (ppos != &file->f_pos)
-		return -ESPIPE;
 	if (!access_ok(VERIFY_READ, buffer, count))
 		return -EFAULT;
 	if (count == 0)
@@ -2642,7 +2632,7 @@ static int es1371_midi_open(struct inode *inode, struct file *file)
 	spin_unlock_irqrestore(&s->lock, flags);
 	s->open_mode |= (file->f_mode << FMODE_MIDI_SHIFT) & (FMODE_MIDI_READ | FMODE_MIDI_WRITE);
 	up(&s->open_sem);
-	return 0;
+	return nonseekable_open(inode, file);
 }
 
 static int es1371_midi_release(struct inode *inode, struct file *file)
diff --git a/sound/oss/esssolo1.c b/sound/oss/esssolo1.c
index b5096b5a4..3002cbe68 100644
--- a/sound/oss/esssolo1.c
+++ b/sound/oss/esssolo1.c
@@ -933,7 +933,7 @@ static int solo1_open_mixdev(struct inode *inode, struct file *file)
 		return -ENODEV;
        	VALIDATE_STATE(s);
 	file->private_data = s;
-	return 0;
+	return nonseekable_open(inode, file);
 }
 
 static int solo1_release_mixdev(struct inode *inode, struct file *file)
@@ -1010,8 +1010,6 @@ static ssize_t solo1_read(struct file *file, char __user *buffer, size_t count,
 	int cnt;
 
 	VALIDATE_STATE(s);
-	if (ppos != &file->f_pos)
-		return -ESPIPE;
 	if (s->dma_adc.mapped)
 		return -ENXIO;
 	if (!s->dma_adc.ready && (ret = prog_dmabuf_adc(s)))
@@ -1106,8 +1104,6 @@ static ssize_t solo1_write(struct file *file, const char __user *buffer, size_t
 	int cnt;
 
 	VALIDATE_STATE(s);
-	if (ppos != &file->f_pos)
-		return -ESPIPE;
 	if (s->dma_dac.mapped)
 		return -ENXIO;
 	if (!s->dma_dac.ready && (ret = prog_dmabuf_dac(s)))
@@ -1647,7 +1643,7 @@ static int solo1_open(struct inode *inode, struct file *file)
 	s->open_mode |= file->f_mode & (FMODE_READ | FMODE_WRITE);
 	up(&s->open_sem);
 	prog_codec(s);
-	return 0;
+	return nonseekable_open(inode, file);
 }
 
 static /*const*/ struct file_operations solo1_audio_fops = {
@@ -1740,8 +1736,6 @@ static ssize_t solo1_midi_read(struct file *file, char __user *buffer, size_t co
 	int cnt;
 
 	VALIDATE_STATE(s);
-	if (ppos != &file->f_pos)
-		return -ESPIPE;
 	if (!access_ok(VERIFY_WRITE, buffer, count))
 		return -EFAULT;
 	if (count == 0)
@@ -1803,8 +1797,6 @@ static ssize_t solo1_midi_write(struct file *file, const char __user *buffer, si
 	int cnt;
 
 	VALIDATE_STATE(s);
-	if (ppos != &file->f_pos)
-		return -ESPIPE;
 	if (!access_ok(VERIFY_READ, buffer, count))
 		return -EFAULT;
 	if (count == 0)
@@ -1951,7 +1943,7 @@ static int solo1_midi_open(struct inode *inode, struct file *file)
 	spin_unlock_irqrestore(&s->lock, flags);
 	s->open_mode |= (file->f_mode << FMODE_MIDI_SHIFT) & (FMODE_MIDI_READ | FMODE_MIDI_WRITE);
 	up(&s->open_sem);
-	return 0;
+	return nonseekable_open(inode, file);
 }
 
 static int solo1_midi_release(struct inode *inode, struct file *file)
@@ -2161,7 +2153,7 @@ static int solo1_dmfm_open(struct inode *inode, struct file *file)
 	outb(1, s->sbbase+3);  /* enable OPL3 */
 	s->open_mode |= FMODE_DMFM;
 	up(&s->open_sem);
-	return 0;
+	return nonseekable_open(inode, file);
 }
 
 static int solo1_dmfm_release(struct inode *inode, struct file *file)
diff --git a/sound/oss/forte.c b/sound/oss/forte.c
index c7e23fc3c..ac4badae5 100644
--- a/sound/oss/forte.c
+++ b/sound/oss/forte.c
@@ -1265,7 +1265,7 @@ forte_dsp_open (struct inode *inode, struct file *file)
 	if (file->f_mode & FMODE_READ)
 		forte_channel_init (forte, &forte->rec);
 
-	return 0;
+	return nonseekable_open(inode, file);
 }
 
 
@@ -1438,9 +1438,6 @@ forte_dsp_write (struct file *file, const char __user *buffer, size_t bytes,
 	unsigned int i = bytes, sz = 0;
 	unsigned long flags;
 
-	if (ppos != &file->f_pos)
-		return -ESPIPE;
-
 	if (!access_ok (VERIFY_READ, buffer, bytes))
 		return -EFAULT;
 
@@ -1546,9 +1543,6 @@ forte_dsp_read (struct file *file, char __user *buffer, size_t bytes,
 	unsigned int i = bytes, sz;
 	unsigned long flags;
 
-	if (ppos != &file->f_pos)
-		return -ESPIPE;
-
 	if (!access_ok (VERIFY_WRITE, buffer, bytes))
 		return -EFAULT;
 
@@ -1847,15 +1841,15 @@ forte_proc_read (char *page, char **start, off_t off, int count,
 static int __init 
 forte_proc_init (void)
 {
-	if (!proc_mkdir ("driver/forte", 0))
+	if (!proc_mkdir ("driver/forte", NULL))
 		return -EIO;
 
-	if (!create_proc_read_entry ("driver/forte/chip", 0, 0, forte_proc_read, forte)) {
+	if (!create_proc_read_entry ("driver/forte/chip", 0, NULL, forte_proc_read, forte)) {
 		remove_proc_entry ("driver/forte", NULL);
 		return -EIO;
 	}
 
-	if (!create_proc_read_entry("driver/forte/ac97", 0, 0, ac97_read_proc, forte->ac97)) {
+	if (!create_proc_read_entry("driver/forte/ac97", 0, NULL, ac97_read_proc, forte->ac97)) {
 		remove_proc_entry ("driver/forte/chip", NULL);
 		remove_proc_entry ("driver/forte", NULL);
 		return -EIO;
diff --git a/sound/oss/gus_card.c b/sound/oss/gus_card.c
index 84500431e..88f5ca1cf 100644
--- a/sound/oss/gus_card.c
+++ b/sound/oss/gus_card.c
@@ -41,9 +41,6 @@ static void __init attach_gus(struct address_info *hw_config)
 {
 	gus_wave_init(hw_config);
 
-	request_region(hw_config->io_base, 16, "GUS");
-	request_region(hw_config->io_base + 0x100, 12, "GUS");	/* 0x10c-> is MAX */
-
 	if (sound_alloc_dma(hw_config->dma, "GUS"))
 		printk(KERN_ERR "gus_card.c: Can't allocate DMA channel %d\n", hw_config->dma);
 	if (hw_config->dma2 != -1 && hw_config->dma2 != hw_config->dma)
@@ -73,11 +70,7 @@ static int __init probe_gus(struct address_info *hw_config)
 			  printk(KERN_ERR "GUS: Unsupported IRQ %d\n", irq);
 			  return 0;
 		  }
-	if (check_region(hw_config->io_base, 16))
-		printk(KERN_ERR "GUS: I/O range conflict (1)\n");
-	else if (check_region(hw_config->io_base + 0x100, 16))
-		printk(KERN_ERR "GUS: I/O range conflict (2)\n");
-	else if (gus_wave_detect(hw_config->io_base))
+	if (gus_wave_detect(hw_config->io_base))
 		return 1;
 
 #ifndef EXCLUDE_GUS_IODETECT
@@ -86,17 +79,14 @@ static int __init probe_gus(struct address_info *hw_config)
 	 * Look at the possible base addresses (0x2X0, X=1, 2, 3, 4, 5, 6)
 	 */
 
-	for (io_addr = 0x210; io_addr <= 0x260; io_addr += 0x10)
-		if (io_addr != hw_config->io_base)	/*
-							 * Already tested
-							 */
-			if (!check_region(io_addr, 16))
-				if (!check_region(io_addr + 0x100, 16))
-					if (gus_wave_detect(io_addr))
-					  {
-						  hw_config->io_base = io_addr;
-						  return 1;
-					  }
+	for (io_addr = 0x210; io_addr <= 0x260; io_addr += 0x10) {
+		if (io_addr == hw_config->io_base)	/* Already tested */
+			continue;
+		if (gus_wave_detect(io_addr)) {
+			hw_config->io_base = io_addr;
+			return 1;
+		}
+	}
 #endif
 
 	printk("NO GUS card found !\n");
diff --git a/sound/oss/gus_wave.c b/sound/oss/gus_wave.c
index 35ade6b85..ed7333ca2 100644
--- a/sound/oss/gus_wave.c
+++ b/sound/oss/gus_wave.c
@@ -978,6 +978,13 @@ int __init gus_wave_detect(int baseaddr)
 	unsigned long   loc;
 	unsigned char   val;
 
+	if (!request_region(baseaddr, 16, "GUS"))
+		return 0;
+	if (!request_region(baseaddr + 0x100, 12, "GUS")) { /* 0x10c-> is MAX */
+		release_region(baseaddr, 16);
+		return 0;
+	}
+
 	gus_base = baseaddr;
 
 	gus_write8(0x4c, 0);	/* Reset GF1 */
@@ -1015,8 +1022,11 @@ int __init gus_wave_detect(int baseaddr)
 
 	/* See if there is first block there.... */
 	gus_poke(0L, 0xaa);
-	if (gus_peek(0L) != 0xaa)
-		return (0);
+	if (gus_peek(0L) != 0xaa) {
+		release_region(baseaddr + 0x100, 12);
+		release_region(baseaddr, 16);
+		return 0;
+	}
 
 	/* Now zero it out so that I can check for mirroring .. */
 	gus_poke(0L, 0x00);
diff --git a/sound/oss/hal2.c b/sound/oss/hal2.c
index 6ad89aa8b..afe97c4ce 100644
--- a/sound/oss/hal2.c
+++ b/sound/oss/hal2.c
@@ -1,6 +1,6 @@
 /*
- *  Driver for HAL2 sound processors
- *  Copyright (c) 2001, 2002 Ladislav Michl <ladis@psi.cz>
+ *  Driver for A2 audio system used in SGI machines
+ *  Copyright (c) 2001, 2002, 2003 Ladislav Michl <ladis@linux-mips.org>
  *  
  *  Based on Ulf Carlsson's code.
  *
@@ -21,22 +21,21 @@
  *  /dev/dsp    standard dsp device, (mostly) OSS compatible
  *  /dev/mixer	standard mixer device, (mostly) OSS compatible
  *
- *  BUGS:
- *  + Driver currently supports indigo mode only.
- *  + Recording doesn't work. I guess that it is caused by PBUS channel
- *    misconfiguration, but until I get relevant info I'm unable to fix it.
  */
-
+#include <linux/kernel.h>
 #include <linux/module.h>
 #include <linux/sched.h>
 #include <linux/init.h>
 #include <linux/slab.h>
 #include <linux/poll.h>
+#include <linux/interrupt.h>
+#include <linux/dma-mapping.h>
 #include <linux/sound.h>
 #include <linux/soundcard.h>
+
 #include <asm/io.h>
-#include <asm/uaccess.h>
-#include <asm/sgi/sgint23.h>
+#include <asm/sgi/hpc3.h>
+#include <asm/sgi/ip22.h>
 
 #include "hal2.h"
 
@@ -52,61 +51,131 @@
 #define DEBUG_MIX(args...)
 #endif
 
+/*
+ * Before touching these look how it works. It is a bit unusual I know,
+ * but it helps to keep things simple. This driver is considered complete
+ * and I won't add any new features although hardware has many cool
+ * capabilities.
+ * (Historical note: HAL2 driver was first written by Ulf Carlsson - ALSA
+ * 0.3 running with 2.2.x kernel. Then ALSA changed completely and it
+ * seemed easier to me to write OSS driver from scratch - this one. Now
+ * when ALSA is official part of 2.6 kernel it's time to write ALSA driver
+ * using (hopefully) final version of ALSA interface)
+ */
+#define H2_BLOCK_SIZE	1024
+#define H2_ADC_BUFSIZE	8192
+#define H2_DAC_BUFSIZE	16834
+
+struct hal2_pbus {
+	struct hpc3_pbus_dmacregs *pbus;
+	int pbusnr;
+	unsigned int ctrl;		/* Current state of pbus->pbdma_ctrl */
+};
+
+struct hal2_desc {
+	struct hpc_dma_desc desc;
+	u32 cnt;			/* don't touch, it is also padding */
+};
+
+struct hal2_codec {
+	unsigned char *buffer;
+	struct hal2_desc *desc;
+	int desc_count;
+	int tail, head;			/* tail index, head index */
+	struct hal2_pbus pbus;
+	unsigned int format;		/* Audio data format */
+	int voices;			/* mono/stereo */
+	unsigned int sample_rate;
+	unsigned int master;		/* Master frequency */
+	unsigned short mod;		/* MOD value */
+	unsigned short inc;		/* INC value */
+
+	wait_queue_head_t dma_wait;
+	spinlock_t lock;
+	struct semaphore sem;
+
+	int usecount;			/* recording and playback are
+					 * independent */
+};
+
+#define H2_MIX_OUTPUT_ATT	0
+#define H2_MIX_INPUT_GAIN	1
+#define H2_MIXERS		2
+struct hal2_mixer {
+	int modcnt;
+	unsigned int master;
+	unsigned int volume[H2_MIXERS];
+};
+
+struct hal2_card {
+	int dev_dsp;			/* audio device */
+	int dev_mixer;			/* mixer device */
+	int dev_midi;			/* midi device */
+
+	struct hal2_ctl_regs *ctl_regs;	/* HAL2 ctl registers */
+	struct hal2_aes_regs *aes_regs;	/* HAL2 aes registers */
+	struct hal2_vol_regs *vol_regs;	/* HAL2 vol registers */
+	struct hal2_syn_regs *syn_regs;	/* HAL2 syn registers */
+
+	struct hal2_codec dac;
+	struct hal2_codec adc;
+	struct hal2_mixer mixer;
+};
+
 #define H2_INDIRECT_WAIT(regs)	while (regs->isr & H2_ISR_TSTATUS);
 
 #define H2_READ_ADDR(addr)	(addr | (1<<7))
 #define H2_WRITE_ADDR(addr)	(addr)
 
-static char *hal2str = "HAL2 audio";
-static int ibuffers = 32;
-static int obuffers = 32;
+static char *hal2str = "HAL2";
 
-/* I doubt anyone has a machine with two HAL2 cards. It's possible to
+/*
+ * I doubt anyone has a machine with two HAL2 cards. It's possible to
  * have two HPC's, so it is probably possible to have two HAL2 cards.
  * Try to deal with it, but note that it is not tested.
  */
 #define MAXCARDS	2
-static hal2_card_t* hal2_card[MAXCARDS];
+static struct hal2_card* hal2_card[MAXCARDS];
 
 static const struct {
 	unsigned char idx:4, avail:1;
 } mixtable[SOUND_MIXER_NRDEVICES] = {
-	[SOUND_MIXER_PCM] = { H2_MIX_OUTPUT_ATT, 1 },	/* voice */
-	[SOUND_MIXER_MIC] = { H2_MIX_INPUT_GAIN, 1 },	/* mic */
+	[SOUND_MIXER_PCM]	= { H2_MIX_OUTPUT_ATT, 1 },	/* voice */
+	[SOUND_MIXER_MIC]	= { H2_MIX_INPUT_GAIN, 1 },	/* mic */
 };
 
 #define H2_SUPPORTED_FORMATS	(AFMT_S16_LE | AFMT_S16_BE)
 
-static inline void hal2_isr_write(hal2_card_t *hal2, u32 val)
+static inline void hal2_isr_write(struct hal2_card *hal2, u16 val)
 {
 	hal2->ctl_regs->isr = val;
 }
 
-static inline u32 hal2_isr_look(hal2_card_t *hal2)
+static inline u16 hal2_isr_look(struct hal2_card *hal2)
 {
 	return hal2->ctl_regs->isr;
 }
 
-static inline u32 hal2_rev_look(hal2_card_t *hal2)
+static inline u16 hal2_rev_look(struct hal2_card *hal2)
 {
 	return hal2->ctl_regs->rev;
 }
 
-#if 0
-static u16 hal2_i_look16(hal2_card_t *hal2, u32 addr)
+#ifdef HAL2_DUMP_REGS
+static u16 hal2_i_look16(struct hal2_card *hal2, u16 addr)
 {
-	hal2_ctl_regs_t *regs = hal2->ctl_regs;
+	struct hal2_ctl_regs *regs = hal2->ctl_regs;
 
 	regs->iar = H2_READ_ADDR(addr);
 	H2_INDIRECT_WAIT(regs);
-	return (regs->idr0 & 0xffff);
+	return regs->idr0;
 }
 #endif
 
-static u32 hal2_i_look32(hal2_card_t *hal2, u32 addr)
+static u32 hal2_i_look32(struct hal2_card *hal2, u16 addr)
 {
 	u32 ret;
-	hal2_ctl_regs_t *regs = hal2->ctl_regs;
+	struct hal2_ctl_regs *regs = hal2->ctl_regs;
 
 	regs->iar = H2_READ_ADDR(addr);
 	H2_INDIRECT_WAIT(regs);
@@ -117,9 +186,9 @@ static u32 hal2_i_look32(hal2_card_t *hal2, u32 addr)
 	return ret;
 }
 
-static void hal2_i_write16(hal2_card_t *hal2, u32 addr, u16 val)
+static void hal2_i_write16(struct hal2_card *hal2, u16 addr, u16 val)
 {
-	hal2_ctl_regs_t *regs = hal2->ctl_regs;
+	struct hal2_ctl_regs *regs = hal2->ctl_regs;
 
 	regs->idr0 = val;
 	regs->idr1 = 0;
@@ -129,9 +198,9 @@ static void hal2_i_write16(hal2_card_t *hal2, u32 addr, u16 val)
 	H2_INDIRECT_WAIT(regs);
 }
 
-static void hal2_i_write32(hal2_card_t *hal2, u32 addr, u32 val)
+static void hal2_i_write32(struct hal2_card *hal2, u16 addr, u32 val)
 {
-	hal2_ctl_regs_t *regs = hal2->ctl_regs;
+	struct hal2_ctl_regs *regs = hal2->ctl_regs;
 
 	regs->idr0 = val & 0xffff;
 	regs->idr1 = val >> 16;
@@ -141,13 +210,13 @@ static void hal2_i_write32(hal2_card_t *hal2, u32 addr, u32 val)
 	H2_INDIRECT_WAIT(regs);
 }
 
-static void hal2_i_setbit16(hal2_card_t *hal2, u32 addr, u16 bit)
+static void hal2_i_setbit16(struct hal2_card *hal2, u16 addr, u16 bit)
 {
-	hal2_ctl_regs_t *regs = hal2->ctl_regs;
+	struct hal2_ctl_regs *regs = hal2->ctl_regs;
 
 	regs->iar = H2_READ_ADDR(addr);
 	H2_INDIRECT_WAIT(regs);
-	regs->idr0 = regs->idr0 | bit;
+	regs->idr0 = (regs->idr0 & 0xffff) | bit;
 	regs->idr1 = 0;
 	regs->idr2 = 0;
 	regs->idr3 = 0;
@@ -155,14 +224,14 @@ static void hal2_i_setbit16(hal2_card_t *hal2, u32 addr, u16 bit)
 	H2_INDIRECT_WAIT(regs);
 }
 
-static void hal2_i_setbit32(hal2_card_t *hal2, u32 addr, u32 bit)
+static void hal2_i_setbit32(struct hal2_card *hal2, u16 addr, u32 bit)
 {
 	u32 tmp;
-	hal2_ctl_regs_t *regs = hal2->ctl_regs;
+	struct hal2_ctl_regs *regs = hal2->ctl_regs;
 
 	regs->iar = H2_READ_ADDR(addr);
 	H2_INDIRECT_WAIT(regs);
-	tmp = regs->idr0 | (regs->idr1 << 16) | bit;
+	tmp = (regs->idr0 & 0xffff) | (regs->idr1 << 16) | bit;
 	regs->idr0 = tmp & 0xffff;
 	regs->idr1 = tmp >> 16;
 	regs->idr2 = 0;
@@ -171,13 +240,13 @@ static void hal2_i_setbit32(hal2_card_t *hal2, u32 addr, u32 bit)
 	H2_INDIRECT_WAIT(regs);
 }
 
-static void hal2_i_clearbit16(hal2_card_t *hal2, u32 addr, u16 bit)
+static void hal2_i_clearbit16(struct hal2_card *hal2, u16 addr, u16 bit)
 {
-	hal2_ctl_regs_t *regs = hal2->ctl_regs;
+	struct hal2_ctl_regs *regs = hal2->ctl_regs;
 
 	regs->iar = H2_READ_ADDR(addr);
 	H2_INDIRECT_WAIT(regs);
-	regs->idr0 = regs->idr0 & ~bit;
+	regs->idr0 = (regs->idr0 & 0xffff) & ~bit;
 	regs->idr1 = 0;
 	regs->idr2 = 0;
 	regs->idr3 = 0;
@@ -186,14 +255,14 @@ static void hal2_i_clearbit16(hal2_card_t *hal2, u32 addr, u16 bit)
 }
 
 #if 0
-static void hal2_i_clearbit32(hal2_card_t *hal2, u32 addr, u32 bit)
+static void hal2_i_clearbit32(struct hal2_card *hal2, u16 addr, u32 bit)
 {
 	u32 tmp;
 	hal2_ctl_regs_t *regs = hal2->ctl_regs;
 
 	regs->iar = H2_READ_ADDR(addr);
 	H2_INDIRECT_WAIT(regs);
-	tmp = (regs->idr0 | (regs->idr1 << 16)) & ~bit;
+	tmp = ((regs->idr0 & 0xffff) | (regs->idr1 << 16)) & ~bit;
 	regs->idr0 = tmp & 0xffff;
 	regs->idr1 = tmp >> 16;
 	regs->idr2 = 0;
@@ -203,33 +272,33 @@ static void hal2_i_clearbit32(hal2_card_t *hal2, u32 addr, u32 bit)
 }
 #endif
 
-#ifdef HAL2_DEBUG
-static void hal2_dump_regs(hal2_card_t *hal2)
+#ifdef HAL2_DUMP_REGS
+static void hal2_dump_regs(struct hal2_card *hal2)
 {
-	printk("isr: %08hx ", hal2_isr_look(hal2));
-	printk("rev: %08hx\n", hal2_rev_look(hal2));
-	printk("relay: %04hx\n", hal2_i_look16(hal2, H2I_RELAY_C));
-	printk("port en: %04hx ", hal2_i_look16(hal2, H2I_DMA_PORT_EN));
-	printk("dma end: %04hx ", hal2_i_look16(hal2, H2I_DMA_END));
-	printk("dma drv: %04hx\n", hal2_i_look16(hal2, H2I_DMA_DRV));
-	printk("syn ctl: %04hx ", hal2_i_look16(hal2, H2I_SYNTH_C));
-	printk("aesrx ctl: %04hx ", hal2_i_look16(hal2, H2I_AESRX_C));
-	printk("aestx ctl: %04hx ", hal2_i_look16(hal2, H2I_AESTX_C));
-	printk("dac ctl1: %04hx ", hal2_i_look16(hal2, H2I_ADC_C1));
-	printk("dac ctl2: %08lx ", hal2_i_look32(hal2, H2I_ADC_C2));
-	printk("adc ctl1: %04hx ", hal2_i_look16(hal2, H2I_DAC_C1));
-	printk("adc ctl2: %08lx ", hal2_i_look32(hal2, H2I_DAC_C2));
-	printk("syn map: %04hx\n", hal2_i_look16(hal2, H2I_SYNTH_MAP_C));
-	printk("bres1 ctl1: %04hx ", hal2_i_look16(hal2, H2I_BRES1_C1));
-	printk("bres1 ctl2: %04lx ", hal2_i_look32(hal2, H2I_BRES1_C2));
-	printk("bres2 ctl1: %04hx ", hal2_i_look16(hal2, H2I_BRES2_C1));
-	printk("bres2 ctl2: %04lx ", hal2_i_look32(hal2, H2I_BRES2_C2));
-	printk("bres3 ctl1: %04hx ", hal2_i_look16(hal2, H2I_BRES3_C1));
-	printk("bres3 ctl2: %04lx\n", hal2_i_look32(hal2, H2I_BRES3_C2));
+	DEBUG("isr: %08hx ", hal2_isr_look(hal2));
+	DEBUG("rev: %08hx\n", hal2_rev_look(hal2));
+	DEBUG("relay: %04hx\n", hal2_i_look16(hal2, H2I_RELAY_C));
+	DEBUG("port en: %04hx ", hal2_i_look16(hal2, H2I_DMA_PORT_EN));
+	DEBUG("dma end: %04hx ", hal2_i_look16(hal2, H2I_DMA_END));
+	DEBUG("dma drv: %04hx\n", hal2_i_look16(hal2, H2I_DMA_DRV));
+	DEBUG("syn ctl: %04hx ", hal2_i_look16(hal2, H2I_SYNTH_C));
+	DEBUG("aesrx ctl: %04hx ", hal2_i_look16(hal2, H2I_AESRX_C));
+	DEBUG("aestx ctl: %04hx ", hal2_i_look16(hal2, H2I_AESTX_C));
+	DEBUG("dac ctl1: %04hx ", hal2_i_look16(hal2, H2I_ADC_C1));
+	DEBUG("dac ctl2: %08x ", hal2_i_look32(hal2, H2I_ADC_C2));
+	DEBUG("adc ctl1: %04hx ", hal2_i_look16(hal2, H2I_DAC_C1));
+	DEBUG("adc ctl2: %08x ", hal2_i_look32(hal2, H2I_DAC_C2));
+	DEBUG("syn map: %04hx\n", hal2_i_look16(hal2, H2I_SYNTH_MAP_C));
+	DEBUG("bres1 ctl1: %04hx ", hal2_i_look16(hal2, H2I_BRES1_C1));
+	DEBUG("bres1 ctl2: %04x ", hal2_i_look32(hal2, H2I_BRES1_C2));
+	DEBUG("bres2 ctl1: %04hx ", hal2_i_look16(hal2, H2I_BRES2_C1));
+	DEBUG("bres2 ctl2: %04x ", hal2_i_look32(hal2, H2I_BRES2_C2));
+	DEBUG("bres3 ctl1: %04hx ", hal2_i_look16(hal2, H2I_BRES3_C1));
+	DEBUG("bres3 ctl2: %04x\n", hal2_i_look32(hal2, H2I_BRES3_C2));
 }
 #endif
 
-static hal2_card_t* hal2_dsp_find_card(int minor)
+static struct hal2_card* hal2_dsp_find_card(int minor)
 {
 	int i;
 
@@ -239,7 +308,7 @@ static hal2_card_t* hal2_dsp_find_card(int minor)
 	return NULL;
 }
 
-static hal2_card_t* hal2_mixer_find_card(int minor)
+static struct hal2_card* hal2_mixer_find_card(int minor)
 {
 	int i;
 
@@ -249,48 +318,51 @@ static hal2_card_t* hal2_mixer_find_card(int minor)
 	return NULL;
 }
 
+static void hal2_inc_head(struct hal2_codec *codec)
+{
+	codec->head++;
+	if (codec->head == codec->desc_count)
+		codec->head = 0;
+}
 
-static void hal2_dac_interrupt(hal2_codec_t *dac)
+static void hal2_inc_tail(struct hal2_codec *codec)
+{
+	codec->tail++;
+	if (codec->tail == codec->desc_count)
+		codec->tail = 0;
+}
+
+static void hal2_dac_interrupt(struct hal2_codec *dac)
 {
 	int running;
 
 	spin_lock(&dac->lock);
-	
 	/* if tail buffer contains zero samples DMA stream was already
 	 * stopped */
-	running = dac->tail->info.cnt;
-	dac->tail->info.cnt = 0;
-	dac->tail->info.desc.cntinfo = HPCDMA_XIE | HPCDMA_EOX;
-	dma_cache_wback_inv((unsigned long) dac->tail,
-			    sizeof(struct hpc_dma_desc));
+	running = dac->desc[dac->tail].cnt;
+	dac->desc[dac->tail].cnt = 0;
+	dac->desc[dac->tail].desc.cntinfo = HPCDMA_XIE | HPCDMA_EOX;
 	/* we just proccessed empty buffer, don't update tail pointer */
 	if (running)
-		dac->tail = dac->tail->info.next;
-
+		hal2_inc_tail(dac);
 	spin_unlock(&dac->lock);
 
 	wake_up(&dac->dma_wait);
 }
 
-static void hal2_adc_interrupt(hal2_codec_t *adc)
+static void hal2_adc_interrupt(struct hal2_codec *adc)
 {
 	int running;
-	
-	spin_lock(&adc->lock);
 
+	spin_lock(&adc->lock);
 	/* if head buffer contains nonzero samples DMA stream was already
 	 * stopped */
-	running = !adc->head->info.cnt;
-	adc->head->info.cnt = H2_BUFFER_SIZE;
-	adc->head->info.desc.cntinfo = HPCDMA_XIE | HPCDMA_EOX;
-	dma_cache_wback_inv((unsigned long) adc->head,
-			    sizeof(struct hpc_dma_desc));
+	running = !adc->desc[adc->head].cnt;
+	adc->desc[adc->head].cnt = H2_BLOCK_SIZE;
+	adc->desc[adc->head].desc.cntinfo = HPCDMA_XIE | HPCDMA_EOR;
 	/* we just proccessed empty buffer, don't update head pointer */
-	if (running) {
-		dma_cache_inv((unsigned long) adc->head->data, H2_BUFFER_SIZE);
-		adc->head = adc->head->info.next;
-	}
-
+	if (running)
+		hal2_inc_head(adc);
 	spin_unlock(&adc->lock);
 
 	wake_up(&adc->dma_wait);
@@ -298,60 +370,48 @@ static void hal2_adc_interrupt(hal2_codec_t *adc)
 
 static irqreturn_t hal2_interrupt(int irq, void *dev_id, struct pt_regs *regs)
 {
-	hal2_card_t *hal2 = (hal2_card_t*)dev_id;
+	struct hal2_card *hal2 = (struct hal2_card*)dev_id;
+	irqreturn_t ret = IRQ_NONE;
 
 	/* decide what caused this interrupt */
-	if (hal2->dac.pbus.pbus->pbdma_ctrl & HPC3_PDMACTRL_INT)
+	if (hal2->dac.pbus.pbus->pbdma_ctrl & HPC3_PDMACTRL_INT) {
 		hal2_dac_interrupt(&hal2->dac);
-	if (hal2->adc.pbus.pbus->pbdma_ctrl & HPC3_PDMACTRL_INT)
+		ret = IRQ_HANDLED;
+	}
+	if (hal2->adc.pbus.pbus->pbdma_ctrl & HPC3_PDMACTRL_INT) {
 		hal2_adc_interrupt(&hal2->adc);
-	return IRQ_HANDLED;
+		ret = IRQ_HANDLED;
+	}
+	return ret;
 }
 
-static int hal2_compute_rate(hal2_codec_t *codec, unsigned int rate)
+static int hal2_compute_rate(struct hal2_codec *codec, unsigned int rate)
 {
-	unsigned short inc;
+	unsigned short mod;
 	
-	/* We default to 44.1 kHz and if it isn't possible to fall back to
-	 * 48.0 kHz with the needed adjustments of real_rate.
-	 */
-
 	DEBUG("rate: %d\n", rate);
 	
-	/* Refer to CS4216 data sheet */
-	if (rate < 4000)
-		rate = 4000;
-	if (rate > 50000)
-		rate = 50000;
-
-	/* Note: This is NOT the way they set up the bresenham clock generators
-	 * in the specification. I've tried to implement that method but it
-	 * doesn't work. It's probably another silly bug in the spec.
-	 *
-	 * I accidently discovered this method while I was testing and it seems
-	 * to work very well with all frequencies, and thee shall follow rule #1
-	 * of programming :-)
-	 */
-	
-	if (44100 % rate == 0) {
-		inc = 44100 / rate;
-		if (inc < 1) inc = 1;
+	if (rate < 4000) rate = 4000;
+	else if (rate > 48000) rate = 48000;
+
+	if (44100 % rate < 48000 % rate) {
+		mod = 4 * 44100 / rate;
 		codec->master = 44100;
 	} else {
-		inc = 48000 / rate;
-		if (inc < 1) inc = 1;
-		rate = 48000 / inc;
+		mod = 4 * 48000 / rate;
 		codec->master = 48000;
 	}
-	codec->inc = inc;
-	codec->mod = 1;
-	
+
+	codec->inc = 4;
+	codec->mod = mod;
+	rate = 4 * codec->master / mod;
+
 	DEBUG("real_rate: %d\n", rate);
 
 	return rate;
 }
 
-static void hal2_set_dac_rate(hal2_card_t *hal2)
+static void hal2_set_dac_rate(struct hal2_card *hal2)
 {
 	unsigned int master = hal2->dac.master;
 	int inc = hal2->dac.inc;
@@ -360,10 +420,10 @@ static void hal2_set_dac_rate(hal2_card_t *hal2)
 	DEBUG("master: %d inc: %d mod: %d\n", master, inc, mod);
 	
 	hal2_i_write16(hal2, H2I_BRES1_C1, (master == 44100) ? 1 : 0);
-	hal2_i_write32(hal2, H2I_BRES1_C2, ((0xffff & (mod - inc - 1)) << 16) | 1);
+	hal2_i_write32(hal2, H2I_BRES1_C2, ((0xffff & (inc - mod - 1)) << 16) | inc);
 }
 
-static void hal2_set_adc_rate(hal2_card_t *hal2)
+static void hal2_set_adc_rate(struct hal2_card *hal2)
 {
 	unsigned int master = hal2->adc.master;
 	int inc = hal2->adc.inc;
@@ -372,13 +432,13 @@ static void hal2_set_adc_rate(hal2_card_t *hal2)
 	DEBUG("master: %d inc: %d mod: %d\n", master, inc, mod);
 	
 	hal2_i_write16(hal2, H2I_BRES2_C1, (master == 44100) ? 1 : 0);
-	hal2_i_write32(hal2, H2I_BRES2_C2, ((0xffff & (mod - inc - 1)) << 16) | 1);
+	hal2_i_write32(hal2, H2I_BRES2_C2, ((0xffff & (inc - mod - 1)) << 16) | inc);
 }
 
-static void hal2_setup_dac(hal2_card_t *hal2)
+static void hal2_setup_dac(struct hal2_card *hal2)
 {
 	unsigned int fifobeg, fifoend, highwater, sample_size;
-	hal2_pbus_t *pbus = &hal2->dac.pbus;
+	struct hal2_pbus *pbus = &hal2->dac.pbus;
 
 	DEBUG("hal2_setup_dac\n");
 	
@@ -388,230 +448,215 @@ static void hal2_setup_dac(hal2_card_t *hal2)
 	 * endian. The information is written later, on the start call.
 	 */
 	sample_size = 2 * hal2->dac.voices;
-
 	/* Fifo should be set to hold exactly four samples. Highwater mark
 	 * should be set to two samples. */
 	highwater = (sample_size * 2) >> 1;	/* halfwords */
 	fifobeg = 0;				/* playback is first */
 	fifoend = (sample_size * 4) >> 3;	/* doublewords */
 	pbus->ctrl = HPC3_PDMACTRL_RT | HPC3_PDMACTRL_LD |
-		     (highwater << 8) | (fifobeg << 16) | (fifoend << 24);
+		     (highwater << 8) | (fifobeg << 16) | (fifoend << 24) |
+		     (hal2->dac.format & AFMT_S16_LE ? HPC3_PDMACTRL_SEL : 0);
 	/* We disable everything before we do anything at all */
 	pbus->pbus->pbdma_ctrl = HPC3_PDMACTRL_LD;
 	hal2_i_clearbit16(hal2, H2I_DMA_PORT_EN, H2I_DMA_PORT_EN_CODECTX);
-	hal2_i_clearbit16(hal2, H2I_DMA_DRV, (1 << pbus->pbusnr));
 	/* Setup the HAL2 for playback */
 	hal2_set_dac_rate(hal2);
+	/* Set endianess */
+	if (hal2->dac.format & AFMT_S16_LE)
+		hal2_i_setbit16(hal2, H2I_DMA_END, H2I_DMA_END_CODECTX);
+	else
+		hal2_i_clearbit16(hal2, H2I_DMA_END, H2I_DMA_END_CODECTX);
+	/* Set DMA bus */
+	hal2_i_setbit16(hal2, H2I_DMA_DRV, (1 << pbus->pbusnr));
 	/* We are using 1st Bresenham clock generator for playback */
 	hal2_i_write16(hal2, H2I_DAC_C1, (pbus->pbusnr << H2I_C1_DMA_SHIFT)
 			| (1 << H2I_C1_CLKID_SHIFT)
 			| (hal2->dac.voices << H2I_C1_DATAT_SHIFT));
 }
 
-static void hal2_setup_adc(hal2_card_t *hal2)
+static void hal2_setup_adc(struct hal2_card *hal2)
 {
 	unsigned int fifobeg, fifoend, highwater, sample_size;
-	hal2_pbus_t *pbus = &hal2->adc.pbus;
+	struct hal2_pbus *pbus = &hal2->adc.pbus;
 
 	DEBUG("hal2_setup_adc\n");
-	
-	sample_size = 2 * hal2->adc.voices;
 
+	sample_size = 2 * hal2->adc.voices;
 	highwater = (sample_size * 2) >> 1;		/* halfwords */
 	fifobeg = (4 * 4) >> 3;				/* record is second */
 	fifoend = (4 * 4 + sample_size * 4) >> 3;	/* doublewords */
 	pbus->ctrl = HPC3_PDMACTRL_RT | HPC3_PDMACTRL_RCV | HPC3_PDMACTRL_LD | 
-		     (highwater << 8) | (fifobeg << 16) | (fifoend << 24);
+		     (highwater << 8) | (fifobeg << 16) | (fifoend << 24) |
+		     (hal2->adc.format & AFMT_S16_LE ? HPC3_PDMACTRL_SEL : 0);
 	pbus->pbus->pbdma_ctrl = HPC3_PDMACTRL_LD;
 	hal2_i_clearbit16(hal2, H2I_DMA_PORT_EN, H2I_DMA_PORT_EN_CODECR);
-	hal2_i_clearbit16(hal2, H2I_DMA_DRV, (1 << pbus->pbusnr));
 	/* Setup the HAL2 for record */
 	hal2_set_adc_rate(hal2);
+	/* Set endianess */
+	if (hal2->adc.format & AFMT_S16_LE)
+		hal2_i_setbit16(hal2, H2I_DMA_END, H2I_DMA_END_CODECR);
+	else
+		hal2_i_clearbit16(hal2, H2I_DMA_END, H2I_DMA_END_CODECR);
+	/* Set DMA bus */
+	hal2_i_setbit16(hal2, H2I_DMA_DRV, (1 << pbus->pbusnr));
 	/* We are using 2nd Bresenham clock generator for record */
 	hal2_i_write16(hal2, H2I_ADC_C1, (pbus->pbusnr << H2I_C1_DMA_SHIFT)
 			| (2 << H2I_C1_CLKID_SHIFT)
 			| (hal2->adc.voices << H2I_C1_DATAT_SHIFT));
 }
 
-static void hal2_start_dac(hal2_card_t *hal2)
+static dma_addr_t hal2_desc_addr(struct hal2_codec *codec, int i)
 {
-	hal2_pbus_t *pbus = &hal2->dac.pbus;
+	if (--i < 0)
+		i = codec->desc_count - 1;
+	return codec->desc[i].desc.pnext;
+}
 
-	DEBUG("hal2_start_dac\n");
-	
-	pbus->pbus->pbdma_dptr = PHYSADDR(hal2->dac.tail);
-	pbus->pbus->pbdma_ctrl = pbus->ctrl | HPC3_PDMACTRL_ACT;
+static void hal2_start_dac(struct hal2_card *hal2)
+{
+	struct hal2_codec *dac = &hal2->dac;
+	struct hal2_pbus *pbus = &dac->pbus;
 
-	/* set endianess */
-	if (hal2->dac.format & AFMT_S16_LE)
-		hal2_i_setbit16(hal2, H2I_DMA_END, H2I_DMA_END_CODECTX);
-	else
-		hal2_i_clearbit16(hal2, H2I_DMA_END, H2I_DMA_END_CODECTX);
-	/* set DMA bus */
-	hal2_i_setbit16(hal2, H2I_DMA_DRV, (1 << pbus->pbusnr));
+	pbus->pbus->pbdma_dptr = hal2_desc_addr(dac, dac->tail);
+	pbus->pbus->pbdma_ctrl = pbus->ctrl | HPC3_PDMACTRL_ACT;
 	/* enable DAC */
 	hal2_i_setbit16(hal2, H2I_DMA_PORT_EN, H2I_DMA_PORT_EN_CODECTX);
 }
 
-static void hal2_start_adc(hal2_card_t *hal2)
+static void hal2_start_adc(struct hal2_card *hal2)
 {
-	hal2_pbus_t *pbus = &hal2->adc.pbus;
+	struct hal2_codec *adc = &hal2->adc;
+	struct hal2_pbus *pbus = &adc->pbus;
 
-	DEBUG("hal2_start_adc\n");
-	
-	pbus->pbus->pbdma_dptr = PHYSADDR(hal2->adc.head);
+	pbus->pbus->pbdma_dptr = hal2_desc_addr(adc, adc->head);
 	pbus->pbus->pbdma_ctrl = pbus->ctrl | HPC3_PDMACTRL_ACT;
-	
-	/* set endianess */
-	if (hal2->adc.format & AFMT_S16_LE)
-		hal2_i_setbit16(hal2, H2I_DMA_END, H2I_DMA_END_CODECR);
-	else
-		hal2_i_clearbit16(hal2, H2I_DMA_END, H2I_DMA_END_CODECR);
-	/* set DMA bus */
-	hal2_i_setbit16(hal2, H2I_DMA_DRV, (1 << pbus->pbusnr));
 	/* enable ADC */
 	hal2_i_setbit16(hal2, H2I_DMA_PORT_EN, H2I_DMA_PORT_EN_CODECR);
 }
 
-static inline void hal2_stop_dac(hal2_card_t *hal2)
+static inline void hal2_stop_dac(struct hal2_card *hal2)
 {
-	DEBUG("hal2_stop_dac\n");
-	
 	hal2->dac.pbus.pbus->pbdma_ctrl = HPC3_PDMACTRL_LD;
 	/* The HAL2 itself may remain enabled safely */
 }
 
-static inline void hal2_stop_adc(hal2_card_t *hal2)
+static inline void hal2_stop_adc(struct hal2_card *hal2)
 {
-	DEBUG("hal2_stop_adc\n");
-	
 	hal2->adc.pbus.pbus->pbdma_ctrl = HPC3_PDMACTRL_LD;
 }
 
-#define hal2_alloc_dac_dmabuf(hal2)	hal2_alloc_dmabuf(hal2, 1)
-#define hal2_alloc_adc_dmabuf(hal2)	hal2_alloc_dmabuf(hal2, 0)
-static int hal2_alloc_dmabuf(hal2_card_t *hal2, int is_dac)
+static int hal2_alloc_dmabuf(struct hal2_codec *codec, int size,
+			     int count, int cntinfo, int dir)
 {
-	int buffers, cntinfo;
-	hal2_buf_t *buf, *prev;
-	hal2_codec_t *codec;
-
-	if (is_dac) {
-		codec = &hal2->dac;
-		buffers = obuffers;
-		cntinfo = HPCDMA_XIE | HPCDMA_EOX;
-	} else {
-		codec = &hal2->adc;
-		buffers = ibuffers;
-		cntinfo = HPCDMA_XIE | H2_BUFFER_SIZE;
-	}
-	
-	DEBUG("allocating %d DMA buffers.\n", buffers);
-	
-	buf = (hal2_buf_t*) get_zeroed_page(GFP_KERNEL);
-	if (!buf)
+	struct hal2_desc *desc, *dma_addr;
+	int i;
+
+	DEBUG("allocating %dk DMA buffer.\n", size / 1024);
+
+	codec->buffer = (unsigned char *)__get_free_pages(GFP_KERNEL | GFP_DMA,
+							  get_order(size));
+	if (!codec->buffer)
+		return -ENOMEM;
+	desc = dma_alloc_coherent(NULL, count * sizeof(struct hal2_desc),
+				  (dma_addr_t *)&dma_addr, GFP_KERNEL);
+	if (!desc) {
+		free_pages((unsigned long)codec->buffer, get_order(size));
 		return -ENOMEM;
-	codec->head = buf;
-	codec->tail = buf;
-	
-	while (--buffers) {
-		buf->info.desc.pbuf = PHYSADDR(&buf->data);
-		buf->info.desc.cntinfo = cntinfo;
-		buf->info.cnt = 0;
-		prev = buf;
-		buf = (hal2_buf_t*) get_zeroed_page(GFP_KERNEL);
-		if (!buf) {
-			printk("HAL2: Not enough memory for DMA buffer.\n");
-			buf = codec->head;
-			while (buf) {
-				prev = buf;
-				free_page((unsigned long) buf);
-				buf = prev->info.next;
-			}
-			return -ENOMEM;
-		}
-		prev->info.next = buf;
-		prev->info.desc.pnext = PHYSADDR(buf);
-		/* The PBUS can prolly not read this stuff when it's in
-		 * the cache so we have to flush it back to main memory
-		 */
-		dma_cache_wback_inv((unsigned long) prev, PAGE_SIZE);
 	}
-	buf->info.desc.pbuf = PHYSADDR(&buf->data);
-	buf->info.desc.cntinfo = cntinfo;
-	buf->info.cnt = 0;
-	buf->info.next = codec->head;
-	buf->info.desc.pnext = PHYSADDR(codec->head);
-	dma_cache_wback_inv((unsigned long) buf, PAGE_SIZE);
-	
+	codec->desc = desc;
+	for (i = 0; i < count; i++) {
+		desc->desc.pbuf = dma_map_single(NULL,
+			(void *)(codec->buffer + i * H2_BLOCK_SIZE),
+			H2_BLOCK_SIZE, dir);
+		desc->desc.cntinfo = cntinfo;
+		desc->desc.pnext = (i == count - 1) ?
+				   (u32)dma_addr : (u32)(dma_addr + i + 1);
+		desc->cnt = 0;
+		desc++;
+	}
+	codec->desc_count = count;
+	codec->head = codec->tail = 0;
 	return 0;
 }
 
-#define hal2_free_dac_dmabuf(hal2)	hal2_free_dmabuf(hal2, 1)
-#define hal2_free_adc_dmabuf(hal2)	hal2_free_dmabuf(hal2, 0)
-static void hal2_free_dmabuf(hal2_card_t *hal2, int is_dac)
+static int hal2_alloc_dac_dmabuf(struct hal2_codec *codec)
 {
-	hal2_buf_t *buf, *next;
-	hal2_codec_t *codec = (is_dac) ? &hal2->dac : &hal2->adc;
+	return hal2_alloc_dmabuf(codec, H2_DAC_BUFSIZE,
+				 H2_DAC_BUFSIZE / H2_BLOCK_SIZE,
+				 HPCDMA_XIE | HPCDMA_EOX,
+				 DMA_TO_DEVICE);
+}
 
-	if (!codec->head)
-		return;
-	
-	buf = codec->head->info.next;
-	codec->head->info.next = NULL;
-	while (buf) {
-		next = buf->info.next;
-		free_page((unsigned long) buf);
-		buf = next;
-	}
-	codec->head = codec->tail = NULL;
+static int hal2_alloc_adc_dmabuf(struct hal2_codec *codec)
+{
+	return hal2_alloc_dmabuf(codec, H2_ADC_BUFSIZE,
+				 H2_ADC_BUFSIZE / H2_BLOCK_SIZE,
+				 HPCDMA_XIE | H2_BLOCK_SIZE,
+				 DMA_TO_DEVICE);
+}
+
+static void hal2_free_dmabuf(struct hal2_codec *codec, int size, int dir)
+{
+	dma_addr_t dma_addr;
+	int i;
+
+	dma_addr = codec->desc[codec->desc_count - 1].desc.pnext;
+	for (i = 0; i < codec->desc_count; i++)
+		dma_unmap_single(NULL, codec->desc[i].desc.pbuf,
+				 H2_BLOCK_SIZE, dir);
+	dma_free_coherent(NULL, codec->desc_count * sizeof(struct hal2_desc),
+			  (void *)codec->desc, dma_addr);
+	free_pages((unsigned long)codec->buffer, get_order(size));
+}
+
+static void hal2_free_dac_dmabuf(struct hal2_codec *codec)
+{
+	return hal2_free_dmabuf(codec, H2_DAC_BUFSIZE, DMA_TO_DEVICE);
+}
+
+static void hal2_free_adc_dmabuf(struct hal2_codec *codec)
+{
+	return hal2_free_dmabuf(codec, H2_ADC_BUFSIZE, DMA_FROM_DEVICE);
 }
 
 /* 
  * Add 'count' bytes to 'buffer' from DMA ring buffers. Return number of
  * bytes added or -EFAULT if copy_from_user failed.
  */
-static int hal2_get_buffer(hal2_card_t *hal2, char *buffer, int count)
+static int hal2_get_buffer(struct hal2_card *hal2, char *buffer, int count)
 {
 	unsigned long flags;
 	int size, ret = 0;
-	hal2_codec_t *adc = &hal2->adc;
-	
-	spin_lock_irqsave(&adc->lock, flags);
-	
+	unsigned char *buf;
+	struct hal2_desc *tail;
+	struct hal2_codec *adc = &hal2->adc;
+
 	DEBUG("getting %d bytes ", count);
 
+	spin_lock_irqsave(&adc->lock, flags);
+	tail = &adc->desc[adc->tail];
 	/* enable DMA stream if there are no data */
-	if (!(adc->pbus.pbus->pbdma_ctrl & HPC3_PDMACTRL_ISACT) &&
-	    adc->tail->info.cnt == 0)
+	if (!tail->cnt && !(adc->pbus.pbus->pbdma_ctrl & HPC3_PDMACTRL_ISACT))
 		hal2_start_adc(hal2);
-
-	DEBUG("... ");
-
-	while (adc->tail->info.cnt > 0 && count > 0) {
-		size = min(adc->tail->info.cnt, count);
+	while (tail->cnt > 0 && count > 0) {
+		size = min((int)tail->cnt, count);
+		buf = &adc->buffer[(adc->tail + 1) * H2_BLOCK_SIZE - tail->cnt];
 		spin_unlock_irqrestore(&adc->lock, flags);
-
-		if (copy_to_user(buffer, &adc->tail->data[H2_BUFFER_SIZE-size],
-				 size)) {
+		dma_sync_single(NULL, tail->desc.pbuf, size, DMA_FROM_DEVICE);
+		if (copy_to_user(buffer, buf, size)) {
 			ret = -EFAULT;
 			goto out;
 		}
-
 		spin_lock_irqsave(&adc->lock, flags);
-		
-		adc->tail->info.cnt -= size;
+		tail->cnt -= size;
 		/* buffer is empty, update tail pointer */
-		if (adc->tail->info.cnt == 0) {
-			adc->tail->info.desc.cntinfo = HPCDMA_XIE |
-						       H2_BUFFER_SIZE;
-			dma_cache_wback_inv((unsigned long) adc->tail,
-					    sizeof(struct hpc_dma_desc));
-			adc->tail = adc->tail->info.next;
+		if (tail->cnt == 0) {
+			tail->desc.cntinfo = HPCDMA_XIE | H2_BLOCK_SIZE;
+			hal2_inc_tail(adc);
+			tail = &adc->desc[adc->tail];
 			/* enable DMA stream again if needed */
 			if (!(adc->pbus.pbus->pbdma_ctrl & HPC3_PDMACTRL_ISACT))
 				hal2_start_adc(hal2);
-
 		}
 		buffer += size;
 		ret += size;
@@ -620,9 +665,9 @@ static int hal2_get_buffer(hal2_card_t *hal2, char *buffer, int count)
 		DEBUG("(%d) ", size);
 	}
 	spin_unlock_irqrestore(&adc->lock, flags);
-out:	
+out:
 	DEBUG("\n");
-	
+
 	return ret;
 } 
 
@@ -630,86 +675,81 @@ out:
  * Add 'count' bytes from 'buffer' to DMA ring buffers. Return number of
  * bytes added or -EFAULT if copy_from_user failed.
  */
-static int hal2_add_buffer(hal2_card_t *hal2, char *buffer, int count)
+static int hal2_add_buffer(struct hal2_card *hal2, char *buffer, int count)
 {
 	unsigned long flags;
+	unsigned char *buf;
 	int size, ret = 0;
-	hal2_codec_t *dac = &hal2->dac;
-	
-	spin_lock_irqsave(&dac->lock, flags);
-	
+	struct hal2_desc *head;
+	struct hal2_codec *dac = &hal2->dac;
+
 	DEBUG("adding %d bytes ", count);
 
-	while (dac->head->info.cnt == 0 && count > 0) {
-		size = min((int)H2_BUFFER_SIZE, count);
+	spin_lock_irqsave(&dac->lock, flags);
+	head = &dac->desc[dac->head];
+	while (head->cnt == 0 && count > 0) {
+		size = min((int)H2_BLOCK_SIZE, count);
+		buf = &dac->buffer[dac->head * H2_BLOCK_SIZE];
 		spin_unlock_irqrestore(&dac->lock, flags);
-		
-		if (copy_from_user(dac->head->data, buffer, size)) {
+		if (copy_from_user(buf, buffer, size)) {
 			ret = -EFAULT;
 			goto out;
 		}
+		dma_sync_single(NULL, head->desc.pbuf, size, DMA_TO_DEVICE);
 		spin_lock_irqsave(&dac->lock, flags);
-
-		dac->head->info.desc.cntinfo = size | HPCDMA_XIE;
-		dac->head->info.cnt = size;
-		dma_cache_wback_inv((unsigned long) dac->head, 
-				    size + PAGE_SIZE - H2_BUFFER_SIZE);
+		head->desc.cntinfo = size | HPCDMA_XIE;
+		head->cnt = size;
 		buffer += size;
 		ret += size;
 		count -= size;
-		dac->head = dac->head->info.next;
+		hal2_inc_head(dac);
+		head = &dac->desc[dac->head];
 
 		DEBUG("(%d) ", size);
 	}
 	if (!(dac->pbus.pbus->pbdma_ctrl & HPC3_PDMACTRL_ISACT) && ret > 0)
 		hal2_start_dac(hal2);
-	
 	spin_unlock_irqrestore(&dac->lock, flags);
-out:	
+out:
 	DEBUG("\n");
-	
+
 	return ret;
 }
 
 #define hal2_reset_dac_pointer(hal2)	hal2_reset_pointer(hal2, 1)
 #define hal2_reset_adc_pointer(hal2)	hal2_reset_pointer(hal2, 0)
-static void hal2_reset_pointer(hal2_card_t *hal2, int is_dac)
+static void hal2_reset_pointer(struct hal2_card *hal2, int is_dac)
 {
-	hal2_codec_t *codec = (is_dac) ? &hal2->dac : &hal2->adc;
-	
+	int i;
+	struct hal2_codec *codec = (is_dac) ? &hal2->dac : &hal2->adc;
+
 	DEBUG("hal2_reset_pointer\n");
 
-	codec->tail = codec->head;
-	do {
-		codec->tail->info.desc.cntinfo = HPCDMA_XIE | (is_dac) ? 
-						 HPCDMA_EOX : H2_BUFFER_SIZE;
-		codec->tail->info.cnt = 0;
-		dma_cache_wback_inv((unsigned long) codec->tail, 
-				    sizeof(struct hpc_dma_desc));
-		codec->tail = codec->tail->info.next;
-	} while (codec->tail != codec->head);
+	for (i = 0; i < codec->desc_count; i++) {
+		codec->desc[i].cnt = 0;
+		codec->desc[i].desc.cntinfo = HPCDMA_XIE | (is_dac) ?
+					      HPCDMA_EOX : H2_BLOCK_SIZE;
+	}
+	codec->head = codec->tail = 0;
 }
 
-static int hal2_sync_dac(hal2_card_t *hal2)
+static int hal2_sync_dac(struct hal2_card *hal2)
 {
 	DECLARE_WAITQUEUE(wait, current);
-	hal2_codec_t *dac = &hal2->dac;
+	struct hal2_codec *dac = &hal2->dac;
 	int ret = 0;
-	signed long timeout = 1000 * H2_BUFFER_SIZE * 2 * dac->voices *
+	unsigned long flags;
+	signed long timeout = 1000 * H2_BLOCK_SIZE * 2 * dac->voices *
 			      HZ / dac->sample_rate / 900;
 
-	down(&dac->sem);
-	
 	while (dac->pbus.pbus->pbdma_ctrl & HPC3_PDMACTRL_ISACT) {
 		add_wait_queue(&dac->dma_wait, &wait);
 		set_current_state(TASK_INTERRUPTIBLE);
-		if (!schedule_timeout(timeout))
-			/* We may get bogus timeout when system is 
-			 * heavily loaded */
-			if (dac->tail->info.cnt) {
-				printk("HAL2: timeout...\n");
-				ret = -ETIME;
-			}
+		schedule_timeout(timeout);
+		spin_lock_irqsave(&dac->lock, flags);
+		if (dac->desc[dac->tail].cnt)
+			ret = -ETIME;
+		spin_unlock_irqrestore(&dac->lock, flags);
 		if (signal_pending(current))
 			ret = -ERESTARTSYS;
 		if (ret) {
@@ -719,17 +759,15 @@ static int hal2_sync_dac(hal2_card_t *hal2)
 		remove_wait_queue(&dac->dma_wait, &wait);
 	}
 
-	up(&dac->sem);
-	
 	return ret;
 }
 
-static int hal2_write_mixer(hal2_card_t *hal2, int index, int vol)
+static int hal2_write_mixer(struct hal2_card *hal2, int index, int vol)
 {
-	unsigned int l, r;
+	unsigned int l, r, tmp;
 
 	DEBUG_MIX("mixer %d write\n", index);
-	
+
 	if (index >= SOUND_MIXER_NRDEVICES || !mixtable[index].avail)
 		return -EINVAL;
 
@@ -739,23 +777,22 @@ static int hal2_write_mixer(hal2_card_t *hal2, int index, int vol)
 	l = vol & 0xff;
 	if (l > 100)
 		l = 100;
-	
+
 	hal2->mixer.volume[mixtable[index].idx] = l | (r << 8);
 
 	switch (mixtable[index].idx) {
-	case H2_MIX_OUTPUT_ATT: {
+	case H2_MIX_OUTPUT_ATT:
 
 		DEBUG_MIX("output attenuator %d,%d\n", l, r);
 
 		if (r | l) {
-			unsigned int tmp = hal2_i_look32(hal2, H2I_DAC_C2); 
-		
+			tmp = hal2_i_look32(hal2, H2I_DAC_C2);
 			tmp &= ~(H2I_C2_L_ATT_M | H2I_C2_R_ATT_M | H2I_C2_MUTE);
 
 			/* Attenuator has five bits */
-			l = (31 * (100 - l) / 99);
-			r = (31 * (100 - r) / 99);
-			
+			l = 31 * (100 - l) / 99;
+			r = 31 * (100 - r) / 99;
+
 			DEBUG_MIX("left: %d, right %d\n", l, r);
 
 			tmp |= (l << H2I_C2_L_ATT_SHIFT) & H2I_C2_L_ATT_M;
@@ -763,30 +800,80 @@ static int hal2_write_mixer(hal2_card_t *hal2, int index, int vol)
 			hal2_i_write32(hal2, H2I_DAC_C2, tmp);
 		} else 
 			hal2_i_setbit32(hal2, H2I_DAC_C2, H2I_C2_MUTE);
+		break;
+	case H2_MIX_INPUT_GAIN:
+
+		DEBUG_MIX("input gain %d,%d\n", l, r);
+
+		tmp = hal2_i_look32(hal2, H2I_ADC_C2);
+		tmp &= ~(H2I_C2_L_GAIN_M | H2I_C2_R_GAIN_M);
+
+		/* Gain control has four bits */
+		l = 16 * l / 100;
+		r = 16 * r / 100;
+
+		DEBUG_MIX("left: %d, right %d\n", l, r);
+
+		tmp |= (l << H2I_C2_L_GAIN_SHIFT) & H2I_C2_L_GAIN_M;
+		tmp |= (r << H2I_C2_R_GAIN_SHIFT) & H2I_C2_R_GAIN_M;
+		hal2_i_write32(hal2, H2I_ADC_C2, tmp);
+
+		break;
 	}
-	case H2_MIX_INPUT_GAIN: {
-		/* TODO */
-	}
-	}
+
 	return 0;
 }
 
-static void hal2_init_mixer(hal2_card_t *hal2)
+static void hal2_init_mixer(struct hal2_card *hal2)
 {
 	int i;
 
 	for (i = 0; i < SOUND_MIXER_NRDEVICES; i++)
-		hal2_write_mixer(hal2, i, 100 | (100 << 8));
-		
+		if (mixtable[i].avail)
+			hal2->mixer.volume[mixtable[i].idx] = 100 | (100 << 8);
+
+	/* disable attenuator */
+	hal2_i_write32(hal2, H2I_DAC_C2, 0);
+	/* set max input gain */
+	hal2_i_write32(hal2, H2I_ADC_C2, H2I_C2_MUTE |
+			(H2I_C2_L_GAIN_M << H2I_C2_L_GAIN_SHIFT) |
+			(H2I_C2_R_GAIN_M << H2I_C2_R_GAIN_SHIFT));
+	/* set max volume */
+	hal2->mixer.master = 0xff;
+	hal2->vol_regs->left = 0xff;
+	hal2->vol_regs->right = 0xff;
 }
 
-static int hal2_mixer_ioctl(hal2_card_t *hal2, unsigned int cmd, 
+/*
+ * XXX: later i'll implement mixer for main volume which will be disabled
+ * by default. enabling it users will be allowed to have master volume level
+ * control on panel in their favourite X desktop
+ */
+static void hal2_volume_control(int direction)
+{
+	unsigned int master = hal2_card[0]->mixer.master;
+	struct hal2_vol_regs *vol = hal2_card[0]->vol_regs;
+
+	/* volume up */
+	if (direction > 0 && master < 0xff)
+		master++;
+	/* volume down */
+	else if (direction < 0 && master > 0)
+		master--;
+	/* TODO: mute/unmute */
+	vol->left = master;
+	vol->right = master;
+	hal2_card[0]->mixer.master = master;
+}
+
+static int hal2_mixer_ioctl(struct hal2_card *hal2, unsigned int cmd,
 			    unsigned long arg)
 {
 	int val;
 
         if (cmd == SOUND_MIXER_INFO) {
 		mixer_info info;
+
 		memset(&info, 0, sizeof(info));
 		strlcpy(info.id, hal2str, sizeof(info.id));
 		strlcpy(info.name, hal2str, sizeof(info.name));
@@ -797,6 +884,7 @@ static int hal2_mixer_ioctl(hal2_card_t *hal2, unsigned int cmd,
 	}
 	if (cmd == SOUND_OLD_MIXER_INFO) {
 		_old_mixer_info info;
+
 		memset(&info, 0, sizeof(info));
 		strlcpy(info.id, hal2str, sizeof(info.id));
 		strlcpy(info.name, hal2str, sizeof(info.name));
@@ -820,7 +908,7 @@ static int hal2_mixer_ioctl(hal2_card_t *hal2, unsigned int cmd,
                 case SOUND_MIXER_DEVMASK:
                 case SOUND_MIXER_STEREODEVS: {
 			int i;
-			
+
 			for (val = i = 0; i < SOUND_MIXER_NRDEVICES; i++)
 				if (mixtable[i].avail)
 					val |= 1 << i;
@@ -836,7 +924,7 @@ static int hal2_mixer_ioctl(hal2_card_t *hal2, unsigned int cmd,
 		/* Read a specific mixer */
 		default: {
 			int i = _IOC_NR(cmd);
-			
+
 			if (i >= SOUND_MIXER_NRDEVICES || !mixtable[i].avail)
 				return -EINVAL;
 			val = hal2->mixer.volume[mixtable[i].idx];
@@ -845,10 +933,10 @@ static int hal2_mixer_ioctl(hal2_card_t *hal2, unsigned int cmd,
 		}
 		return put_user(val, (int *)arg);
 	}
-	
+
         if (_IOC_DIR(cmd) != (_IOC_WRITE|_IOC_READ))
 		return -EINVAL;
-	
+
 	hal2->mixer.modcnt++;
 
 	if (get_user(val, (int *)arg))
@@ -867,11 +955,11 @@ static int hal2_mixer_ioctl(hal2_card_t *hal2, unsigned int cmd,
 
 static int hal2_open_mixdev(struct inode *inode, struct file *file)
 {
-	hal2_card_t *hal2 = hal2_mixer_find_card(iminor(inode));
+	struct hal2_card *hal2 = hal2_mixer_find_card(iminor(inode));
 
 	if (hal2) {
 		file->private_data = hal2;
-		return 0;
+		return nonseekable_open(inode, file);
 	}
 	return -ENODEV;
 }
@@ -884,31 +972,30 @@ static int hal2_release_mixdev(struct inode *inode, struct file *file)
 static int hal2_ioctl_mixdev(struct inode *inode, struct file *file,
 			     unsigned int cmd, unsigned long arg)
 {
-	return hal2_mixer_ioctl((hal2_card_t *)file->private_data, cmd, arg);
+	return hal2_mixer_ioctl((struct hal2_card *)file->private_data, cmd, arg);
 }
 
-
 static int hal2_ioctl(struct inode *inode, struct file *file, 
 		      unsigned int cmd, unsigned long arg)
 {
 	int val;
-	hal2_card_t *hal2 = (hal2_card_t *) file->private_data;
+	struct hal2_card *hal2 = (struct hal2_card *) file->private_data;
 
 	switch (cmd) {
 	case OSS_GETVERSION:
 		return put_user(SOUND_VERSION, (int *)arg);
-		
+
 	case SNDCTL_DSP_SYNC:
 		if (file->f_mode & FMODE_WRITE)
 			return hal2_sync_dac(hal2);
 		return 0;
-		
+
 	case SNDCTL_DSP_SETDUPLEX:
 		return 0;
 
 	case SNDCTL_DSP_GETCAPS:
 		return put_user(DSP_CAP_DUPLEX | DSP_CAP_MULTI, (int *)arg);
-		
+
 	case SNDCTL_DSP_RESET:
 		if (file->f_mode & FMODE_READ) {
 			hal2_stop_adc(hal2);
@@ -936,7 +1023,7 @@ static int hal2_ioctl(struct inode *inode, struct file *file,
 			hal2_set_dac_rate(hal2);
 		}
 		return put_user(val, (int *)arg);
-		
+
 	case SNDCTL_DSP_STEREO:
 		if (get_user(val, (int *)arg))
 			return -EFAULT;
@@ -973,10 +1060,10 @@ static int hal2_ioctl(struct inode *inode, struct file *file,
 		if (file->f_mode & FMODE_WRITE)
 			val = hal2->dac.voices;
 		return put_user(val, (int *)arg);
-		
+
 	case SNDCTL_DSP_GETFMTS: /* Returns a mask */
                 return put_user(H2_SUPPORTED_FORMATS, (int *)arg);
-		
+
 	case SNDCTL_DSP_SETFMT: /* Selects ONE fmt*/
 		if (get_user(val, (int *)arg))
 			return -EFAULT;
@@ -1001,68 +1088,61 @@ static int hal2_ioctl(struct inode *inode, struct file *file,
 				val = hal2->dac.format;
 		}
 		return put_user(val, (int *)arg);
-		
+
 	case SNDCTL_DSP_POST:
 		return 0;
 
 	case SNDCTL_DSP_GETOSPACE: {
-		unsigned long flags;
 		audio_buf_info info;
-		hal2_buf_t *buf;
-		hal2_codec_t *dac = &hal2->dac;
-		
+		int i;
+		unsigned long flags;
+		struct hal2_codec *dac = &hal2->dac;
+
 		if (!(file->f_mode & FMODE_WRITE))
 			return -EINVAL;
-		
-		spin_lock_irqsave(&dac->lock, flags);
 		info.fragments = 0;
-		buf = dac->head;
-		while (buf->info.cnt == 0 && buf != dac->tail) {
-			info.fragments++;
-			buf = buf->info.next;
-		}
+		spin_lock_irqsave(&dac->lock, flags);
+		for (i = 0; i < dac->desc_count; i++)
+			if (dac->desc[i].cnt == 0)
+				info.fragments++;
 		spin_unlock_irqrestore(&dac->lock, flags);
-		
-		info.fragstotal = obuffers;
-		info.fragsize = H2_BUFFER_SIZE;
+		info.fragstotal = dac->desc_count;
+		info.fragsize = H2_BLOCK_SIZE;
                 info.bytes = info.fragsize * info.fragments;
 
 		return copy_to_user((void *)arg, &info, sizeof(info)) ? -EFAULT : 0;
 	}
-			   
+
 	case SNDCTL_DSP_GETISPACE: {
-		unsigned long flags;
 		audio_buf_info info;
-		hal2_buf_t *buf;
-		hal2_codec_t *adc = &hal2->adc;
-			
+		int i;
+		unsigned long flags;
+		struct hal2_codec *adc = &hal2->adc;
+
 		if (!(file->f_mode & FMODE_READ))
 			return -EINVAL;
-		
-		spin_lock_irqsave(&adc->lock, flags);
 		info.fragments = 0;
 		info.bytes = 0;
-		buf = adc->tail;
-		while (buf->info.cnt > 0 && buf != adc->head) {
-			info.fragments++;
-			info.bytes += buf->info.cnt;
-			buf = buf->info.next;
-		}
+		spin_lock_irqsave(&adc->lock, flags);
+		for (i = 0; i < adc->desc_count; i++)
+			if (adc->desc[i].cnt > 0) {
+				info.fragments++;
+				info.bytes += adc->desc[i].cnt;
+			}
 		spin_unlock_irqrestore(&adc->lock, flags);
+		info.fragstotal = adc->desc_count;
+		info.fragsize = H2_BLOCK_SIZE;
 
-		info.fragstotal = ibuffers;
-		info.fragsize = H2_BUFFER_SIZE;
-		
 		return copy_to_user((void *)arg, &info, sizeof(info)) ? -EFAULT : 0;
 	}
 
 	case SNDCTL_DSP_NONBLOCK:
 		file->f_flags |= O_NONBLOCK;
 		return 0;
-		
+
 	case SNDCTL_DSP_GETBLKSIZE:
-		return put_user(H2_BUFFER_SIZE, (int *)arg);
-	
+		return put_user(H2_BLOCK_SIZE, (int *)arg);
+
 	case SNDCTL_DSP_SETFRAGMENT:
 		return 0;
 
@@ -1083,10 +1163,9 @@ static int hal2_ioctl(struct inode *inode, struct file *file,
 		return put_user(val, (int *)arg);
 
 	case SOUND_PCM_READ_BITS:
-		val = 16;
-		return put_user(val, (int *)arg);
+		return put_user(16, (int *)arg);
 	}
-	
+
 	return hal2_mixer_ioctl(hal2, cmd, arg);
 }
 
@@ -1094,27 +1173,25 @@ static ssize_t hal2_read(struct file *file, char *buffer,
 			 size_t count, loff_t *ppos)
 {
 	ssize_t err;
-	hal2_card_t *hal2 = (hal2_card_t *) file->private_data;
-	hal2_codec_t *adc = &hal2->adc;
+	struct hal2_card *hal2 = (struct hal2_card *) file->private_data;
+	struct hal2_codec *adc = &hal2->adc;
 
-	if (count == 0)
+	if (!count)
 		return 0;
-	if (ppos != &file->f_pos)
-		return -ESPIPE;
-	
-	down(&adc->sem);
-	
+	if (down_interruptible(&adc->sem))
+		return -EINTR;
 	if (file->f_flags & O_NONBLOCK) {
 		err = hal2_get_buffer(hal2, buffer, count);
 		err = err == 0 ? -EAGAIN : err;
 	} else {
 		do {
 			/* ~10% longer */
-			signed long timeout = 1000 * H2_BUFFER_SIZE *
+			signed long timeout = 1000 * H2_BLOCK_SIZE *
 				2 * adc->voices * HZ / adc->sample_rate / 900;
+			unsigned long flags;
 			DECLARE_WAITQUEUE(wait, current);
 			ssize_t cnt = 0;
-			
+
 			err = hal2_get_buffer(hal2, buffer, count);
 			if (err > 0) {
 				count -= err;
@@ -1125,28 +1202,23 @@ static ssize_t hal2_read(struct file *file, char *buffer,
 			if (count > 0 && err >= 0) {
 				add_wait_queue(&adc->dma_wait, &wait);
 				set_current_state(TASK_INTERRUPTIBLE);
-				/* Well, it is possible, that interrupt already
-				 * arrived. Hmm, shit happens, we have one more
-				 * buffer filled ;) */
-				if (!schedule_timeout(timeout))
-					/* We may get bogus timeout when system
-					 * is heavily loaded */
-					if (!adc->tail->info.cnt) {
-						printk("HAL2: timeout...\n");
-						hal2_stop_adc(hal2);
-						hal2_reset_adc_pointer(hal2);
-						err = -EAGAIN;
-					}
+				schedule_timeout(timeout);
+				spin_lock_irqsave(&adc->lock, flags);
+				if (!adc->desc[adc->tail].cnt)
+					err = -EAGAIN;
+				spin_unlock_irqrestore(&adc->lock, flags);
 				if (signal_pending(current))
 					err = -ERESTARTSYS;
 				remove_wait_queue(&adc->dma_wait, &wait);
+				if (err < 0) {
+					hal2_stop_adc(hal2);
+					hal2_reset_adc_pointer(hal2);
+				}
 			}
 		} while (count > 0 && err >= 0);
-	
 	}
-	
 	up(&adc->sem);
-	
+
 	return err;
 }
 
@@ -1155,27 +1227,25 @@ static ssize_t hal2_write(struct file *file, const char *buffer,
 {
 	ssize_t err;
 	char *buf = (char*) buffer;
-	hal2_card_t *hal2 = (hal2_card_t *) file->private_data;
-	hal2_codec_t *dac = &hal2->dac;
+	struct hal2_card *hal2 = (struct hal2_card *) file->private_data;
+	struct hal2_codec *dac = &hal2->dac;
 
-	if (count == 0)
+	if (!count)
 		return 0;
-	if (ppos != &file->f_pos)
-		return -ESPIPE;
-
-	down(&dac->sem);
-
+	if (down_interruptible(&dac->sem))
+		return -EINTR;
 	if (file->f_flags & O_NONBLOCK) {
 		err = hal2_add_buffer(hal2, buf, count);
 		err = err == 0 ? -EAGAIN : err;
 	} else {
 		do {
 			/* ~10% longer */
-			signed long timeout = 1000 * H2_BUFFER_SIZE *
+			signed long timeout = 1000 * H2_BLOCK_SIZE *
 				2 * dac->voices * HZ / dac->sample_rate / 900;
+			unsigned long flags;
 			DECLARE_WAITQUEUE(wait, current);
 			ssize_t cnt = 0;
-			
+
 			err = hal2_add_buffer(hal2, buf, count);
 			if (err > 0) {
 				count -= err;
@@ -1186,25 +1256,21 @@ static ssize_t hal2_write(struct file *file, const char *buffer,
 			if (count > 0 && err >= 0) {
 				add_wait_queue(&dac->dma_wait, &wait);
 				set_current_state(TASK_INTERRUPTIBLE);
-				/* Well, it is possible, that interrupt already
-				 * arrived. Hmm, shit happens, we have one more
-				 * buffer free ;) */
-				if (!schedule_timeout(timeout))
-					/* We may get bogus timeout when system
-					 * is heavily loaded */
-					if (dac->head->info.cnt) {
-						printk("HAL2: timeout...\n");
-						hal2_stop_dac(hal2);
-						hal2_reset_dac_pointer(hal2);
-						err = -EAGAIN;
-					}
+				schedule_timeout(timeout);
+				spin_lock_irqsave(&dac->lock, flags);
+				if (dac->desc[dac->head].cnt)
+					err = -EAGAIN;
+				spin_unlock_irqrestore(&dac->lock, flags);
 				if (signal_pending(current))
 					err = -ERESTARTSYS;
 				remove_wait_queue(&dac->dma_wait, &wait);
+				if (err < 0) {
+					hal2_stop_dac(hal2);
+					hal2_reset_dac_pointer(hal2);
+				}
 			}
 		} while (count > 0 && err >= 0);
 	}
-	
 	up(&dac->sem);
 
 	return err;
@@ -1214,99 +1280,96 @@ static unsigned int hal2_poll(struct file *file, struct poll_table_struct *wait)
 {
 	unsigned long flags;
 	unsigned int mask = 0;
-	hal2_card_t *hal2 = (hal2_card_t *) file->private_data;
+	struct hal2_card *hal2 = (struct hal2_card *) file->private_data;
 
 	if (file->f_mode & FMODE_READ) {
-		hal2_codec_t *adc = &hal2->adc;
-		
-		poll_wait(file, &hal2->adc.dma_wait, wait);
+		struct hal2_codec *adc = &hal2->adc;
+
+		poll_wait(file, &adc->dma_wait, wait);
 		spin_lock_irqsave(&adc->lock, flags);
-		if (adc->tail->info.cnt > 0)
+		if (adc->desc[adc->tail].cnt > 0)
 			mask |= POLLIN;
 		spin_unlock_irqrestore(&adc->lock, flags);
 	}
-	
+
 	if (file->f_mode & FMODE_WRITE) {
-		hal2_codec_t *dac = &hal2->dac;
-		
+		struct hal2_codec *dac = &hal2->dac;
+
 		poll_wait(file, &dac->dma_wait, wait);
 		spin_lock_irqsave(&dac->lock, flags);
-		if (dac->head->info.cnt == 0)
+		if (dac->desc[dac->head].cnt == 0)
 			mask |= POLLOUT;
 		spin_unlock_irqrestore(&dac->lock, flags);
 	}
-	
+
 	return mask;
 }
 
 static int hal2_open(struct inode *inode, struct file *file)
 {
 	int err;
-	hal2_card_t *hal2 = hal2_dsp_find_card(iminor(inode));
+	struct hal2_card *hal2 = hal2_dsp_find_card(iminor(inode));
 
-	DEBUG("opening audio device.\n");
-
-	if (!hal2) {
-		printk("HAL2: Whee?! Open door and go away!\n");
+	if (!hal2)
 		return -ENODEV;
-	}
 	file->private_data = hal2;
-
 	if (file->f_mode & FMODE_READ) {
-		if (hal2->adc.usecount)
+		struct hal2_codec *adc = &hal2->adc;
+
+		if (adc->usecount)
 			return -EBUSY;
-		
 		/* OSS spec wanted us to use 8 bit, 8 kHz mono by default,
 		 * but HAL2 can't do 8bit audio */
-		hal2->adc.format = AFMT_S16_BE;
-		hal2->adc.voices = 1;
-		hal2->adc.sample_rate = hal2_compute_rate(&hal2->adc, 8000);
+		adc->format = AFMT_S16_BE;
+		adc->voices = 1;
+		adc->sample_rate = hal2_compute_rate(adc, 8000);
 		hal2_set_adc_rate(hal2);
-
-		/* alloc DMA buffers */
-		err = hal2_alloc_adc_dmabuf(hal2);
+		err = hal2_alloc_adc_dmabuf(adc);
 		if (err)
 			return err;
 		hal2_setup_adc(hal2);
-
-		hal2->adc.usecount++;
+		adc->usecount++;
 	}
-
 	if (file->f_mode & FMODE_WRITE) {
-		if (hal2->dac.usecount)
-			return -EBUSY;
+		struct hal2_codec *dac = &hal2->dac;
 
-		hal2->dac.format = AFMT_S16_BE;
-		hal2->dac.voices = 1;
-		hal2->dac.sample_rate = hal2_compute_rate(&hal2->dac, 8000);
+		if (dac->usecount)
+			return -EBUSY;
+		dac->format = AFMT_S16_BE;
+		dac->voices = 1;
+		dac->sample_rate = hal2_compute_rate(dac, 8000);
 		hal2_set_dac_rate(hal2);
-
-		/* alloc DMA buffers */
-		err = hal2_alloc_dac_dmabuf(hal2);
+		err = hal2_alloc_dac_dmabuf(dac);
 		if (err)
 			return err;
 		hal2_setup_dac(hal2);
-		
-		hal2->dac.usecount++;
+		dac->usecount++;
 	}
-	
-	return 0;
+
+	return nonseekable_open(inode, file);
 }
 
 static int hal2_release(struct inode *inode, struct file *file)
 {
-	hal2_card_t *hal2 = (hal2_card_t *) file->private_data;
+	struct hal2_card *hal2 = (struct hal2_card *) file->private_data;
 
 	if (file->f_mode & FMODE_READ) {
+		struct hal2_codec *adc = &hal2->adc;
+
+		down(&adc->sem);
 		hal2_stop_adc(hal2);
-		hal2_free_adc_dmabuf(hal2);
-		hal2->adc.usecount--;
+		hal2_free_adc_dmabuf(adc);
+		adc->usecount--;
+		up(&adc->sem);
 	}
-
 	if (file->f_mode & FMODE_WRITE) {
+		struct hal2_codec *dac = &hal2->dac;
+
+		down(&dac->sem);
 		hal2_sync_dac(hal2);
-		hal2_free_dac_dmabuf(hal2);
-		hal2->dac.usecount--;
+		hal2_free_dac_dmabuf(dac);
+		dac->usecount--;
+		up(&dac->sem);
 	}
 
 	return 0;
@@ -1331,159 +1394,155 @@ static struct file_operations hal2_mixer_fops = {
 	.release	= hal2_release_mixdev,
 };
 
-static int hal2_request_irq(hal2_card_t *hal2, int irq)
-{
-	unsigned long flags;
-	int ret = 0;
-
-	save_and_cli(flags);
-	if (request_irq(irq, hal2_interrupt, SA_SHIRQ, hal2str, hal2)) {
-		printk(KERN_ERR "HAL2: Can't get irq %d\n", irq);
-		ret = -EAGAIN;
-	}
-	restore_flags(flags);
-	return ret;
-}
-
-static int hal2_alloc_resources(hal2_card_t *hal2, struct hpc3_regs *hpc3)
-{
-	hal2_pbus_t *pbus;
-
-	pbus = &hal2->dac.pbus;
-	pbus->pbusnr = 0;
-	pbus->pbus = &hpc3->pbdma[pbus->pbusnr];
-	/* The spec says that we should write 0x08248844 but that's WRONG. HAL2
-	 * does 8 bit DMA, not 16 bit even if it generates 16 bit audio. */
-	hpc3->pbus_dmacfgs[pbus->pbusnr][0] = 0x08208844;	/* Magic :-) */
-
-	pbus = &hal2->adc.pbus;
-	pbus->pbusnr = 1;
-	pbus->pbus = &hpc3->pbdma[pbus->pbusnr];
-	hpc3->pbus_dmacfgs[pbus->pbusnr][0] = 0x08208844;	/* Magic :-) */
-
-	return hal2_request_irq(hal2, SGI_HPCDMA_IRQ);
-}
-
-static void hal2_init_codec(hal2_codec_t *codec)
+static void hal2_init_codec(struct hal2_codec *codec, struct hpc3_regs *hpc3,
+			    int index)
 {
+	codec->pbus.pbusnr = index;
+	codec->pbus.pbus = &hpc3->pbdma[index];
 	init_waitqueue_head(&codec->dma_wait);
 	init_MUTEX(&codec->sem);
 	spin_lock_init(&codec->lock);
 }
 
-static void hal2_free_resources(hal2_card_t *hal2)
-{
-	free_irq(SGI_HPCDMA_IRQ, hal2);
-}
-
-static int hal2_detect(hal2_card_t *hal2)
+static int hal2_detect(struct hal2_card *hal2)
 {
 	unsigned short board, major, minor;
 	unsigned short rev;
 
 	/* reset HAL2 */
 	hal2_isr_write(hal2, 0);
-
 	/* release reset */
 	hal2_isr_write(hal2, H2_ISR_GLOBAL_RESET_N | H2_ISR_CODEC_RESET_N);
 
 	hal2_i_write16(hal2, H2I_RELAY_C, H2I_RELAY_C_STATE); 
-
-	if ((rev = hal2_rev_look(hal2)) & H2_REV_AUDIO_PRESENT) {
-		DEBUG("HAL2: no device detected, rev: 0x%04hx\n", rev);
+	if ((rev = hal2_rev_look(hal2)) & H2_REV_AUDIO_PRESENT)
 		return -ENODEV;
-	}
 
 	board = (rev & H2_REV_BOARD_M) >> 12;
 	major = (rev & H2_REV_MAJOR_CHIP_M) >> 4;
 	minor = (rev & H2_REV_MINOR_CHIP_M);
 
-	printk("SGI HAL2 Processor revision %i.%i.%i detected\n",
+	printk(KERN_INFO "SGI HAL2 revision %i.%i.%i\n",
 	       board, major, minor);
 
-	if (board != 4 || major != 1 || minor != 0) 
-		printk( "Other revision than 4.1.0 detected. "
-			"Your card is probably unsupported\n");
-
 	return 0;
 }
 
-static int hal2_init_card(hal2_card_t **phal2, struct hpc3_regs *hpc3,
-			  unsigned long hpc3_base)
+static int hal2_init_card(struct hal2_card **phal2, struct hpc3_regs *hpc3)
 {
 	int ret = 0;
-	hal2_card_t *hal2;
-	
-	hal2 = (hal2_card_t *) kmalloc(sizeof(hal2_card_t), GFP_KERNEL);
+	struct hal2_card *hal2;
+
+	hal2 = (struct hal2_card *) kmalloc(sizeof(struct hal2_card), GFP_KERNEL);
 	if (!hal2)
 		return -ENOMEM;
-	memset(hal2, 0, sizeof(hal2_card_t));
+	memset(hal2, 0, sizeof(struct hal2_card));
 
-	hal2->ctl_regs = (hal2_ctl_regs_t *) KSEG1ADDR(hpc3_base + H2_CTL_PIO);
-	hal2->aes_regs = (hal2_aes_regs_t *) KSEG1ADDR(hpc3_base + H2_AES_PIO);
-	hal2->vol_regs = (hal2_vol_regs_t *) KSEG1ADDR(hpc3_base + H2_VOL_PIO);
-	hal2->syn_regs = (hal2_syn_regs_t *) KSEG1ADDR(hpc3_base + H2_SYN_PIO);
+	hal2->ctl_regs = (struct hal2_ctl_regs *)hpc3->pbus_extregs[0];
+	hal2->aes_regs = (struct hal2_aes_regs *)hpc3->pbus_extregs[1];
+	hal2->vol_regs = (struct hal2_vol_regs *)hpc3->pbus_extregs[2];
+	hal2->syn_regs = (struct hal2_syn_regs *)hpc3->pbus_extregs[3];
 
 	if (hal2_detect(hal2) < 0) {
-		printk("HAL2 audio processor not found\n");
 		ret = -ENODEV;
-		goto fail1;
+		goto free_card;
 	}
 
-	hal2_init_codec(&hal2->dac);
-	hal2_init_codec(&hal2->adc);
+	hal2_init_codec(&hal2->dac, hpc3, 0);
+	hal2_init_codec(&hal2->adc, hpc3, 1);
 
-	ret = hal2_alloc_resources(hal2, hpc3);
-	if (ret)
-		goto fail1;
-	
-	hal2_init_mixer(hal2);
+	/*
+	 * All DMA channel interfaces in HAL2 are designed to operate with
+	 * PBUS programmed for 2 cycles in D3, 2 cycles in D4 and 2 cycles
+	 * in D5. HAL2 is a 16-bit device which can accept both big and little
+	 * endian format. It assumes that even address bytes are on high
+	 * portion of PBUS (15:8) and assumes that HPC3 is programmed to
+	 * accept a live (unsynchronized) version of P_DREQ_N from HAL2.
+	 */
+#define HAL2_PBUS_DMACFG ((0 << HPC3_DMACFG_D3R_SHIFT) | \
+			  (2 << HPC3_DMACFG_D4R_SHIFT) | \
+			  (2 << HPC3_DMACFG_D5R_SHIFT) | \
+			  (0 << HPC3_DMACFG_D3W_SHIFT) | \
+			  (2 << HPC3_DMACFG_D4W_SHIFT) | \
+			  (2 << HPC3_DMACFG_D5W_SHIFT) | \
+				HPC3_DMACFG_DS16 | \
+				HPC3_DMACFG_EVENHI | \
+				HPC3_DMACFG_RTIME | \
+			  (8 << HPC3_DMACFG_BURST_SHIFT) | \
+				HPC3_DMACFG_DRQLIVE)
+	/*
+	 * Ignore what's mentioned in the specification and write value which
+	 * works in The Real World (TM)
+	 */
+	hpc3->pbus_dmacfg[hal2->dac.pbus.pbusnr][0] = 0x8208844;
+	hpc3->pbus_dmacfg[hal2->adc.pbus.pbusnr][0] = 0x8208844;
+
+	if (request_irq(SGI_HPCDMA_IRQ, hal2_interrupt, SA_SHIRQ,
+			hal2str, hal2)) {
+		printk(KERN_ERR "HAL2: Can't get irq %d\n", SGI_HPCDMA_IRQ);
+		ret = -EAGAIN;
+		goto free_card;
+	}
 
 	hal2->dev_dsp = register_sound_dsp(&hal2_audio_fops, -1);
 	if (hal2->dev_dsp < 0) {
 		ret = hal2->dev_dsp;
-		goto fail2;
+		goto free_irq;
 	}
 
 	hal2->dev_mixer = register_sound_mixer(&hal2_mixer_fops, -1);
 	if (hal2->dev_mixer < 0) {
 		ret = hal2->dev_mixer;
-		goto fail3;
+		goto unregister_dsp;
 	}
-	
+
+	hal2_init_mixer(hal2);
+
 	*phal2 = hal2;
 	return 0;
-fail3:
+unregister_dsp:
 	unregister_sound_dsp(hal2->dev_dsp);
-fail2:
-	hal2_free_resources(hal2);
-fail1:
+free_irq:
+	free_irq(SGI_HPCDMA_IRQ, hal2);
+free_card:
 	kfree(hal2);
-	
+
 	return ret;
 }
 
+extern void (*indy_volume_button)(int);
+
 /* 
- * We are assuming only one HAL2 card. If you ever meet machine with more than
- * one, tell immediately about it to someone. Preferably to me. --ladis
+ * Assuming only one HAL2 card. Mail me if you ever meet machine with
+ * more than one.
  */
 static int __init init_hal2(void)
 {
-	int i;
+	int i, error;
 
 	for (i = 0; i < MAXCARDS; i++)
 		hal2_card[i] = NULL;
 
-	return hal2_init_card(&hal2_card[0], hpc3c0, HPC3_CHIP0_PBASE);
+	error = hal2_init_card(&hal2_card[0], hpc3c0);
+
+	/* let Indy's volume buttons work */
+	if (!error && !ip22_is_fullhouse())
+		indy_volume_button = hal2_volume_control;
+
+	return error;
+
 }
 
 static void __exit exit_hal2(void)
 {
 	int i;
+
+	/* unregister volume butons callback function */
+	indy_volume_button = NULL;
 	
 	for (i = 0; i < MAXCARDS; i++)
 		if (hal2_card[i]) {
-			hal2_free_resources(hal2_card[i]);
+			free_irq(SGI_HPCDMA_IRQ, hal2_card[i]);
 			unregister_sound_dsp(hal2_card[i]->dev_dsp);
 			unregister_sound_mixer(hal2_card[i]->dev_mixer);
 			kfree(hal2_card[i]);
diff --git a/sound/oss/hal2.h b/sound/oss/hal2.h
index 256be453d..2bd3b52d8 100644
--- a/sound/oss/hal2.h
+++ b/sound/oss/hal2.h
@@ -4,7 +4,7 @@
 /*
  *  Driver for HAL2 sound processors
  *  Copyright (c) 1999 Ulf Carlsson <ulfc@bun.falkenberg.se>
- *  Copyright (c) 2001 Ladislav Michl <ladis@psi.cz>
+ *  Copyright (c) 2001, 2002, 2003 Ladislav Michl <ladis@linux-mips.org>
  *
  *  This program is free software; you can redistribute it and/or modify
  *  it under the terms of the GNU General Public License version 2 as 
@@ -22,16 +22,10 @@
  */
 
 #include <asm/addrspace.h>
-#include <asm/sgi/sgihpc.h>
+#include <asm/sgi/hpc3.h>
 #include <linux/spinlock.h>
 #include <linux/types.h>
 
-#define H2_HAL2_BASE		0x58000
-#define H2_CTL_PIO		(H2_HAL2_BASE + 0 * 0x400)
-#define H2_AES_PIO		(H2_HAL2_BASE + 1 * 0x400)
-#define H2_VOL_PIO		(H2_HAL2_BASE + 2 * 0x400)
-#define H2_SYN_PIO		(H2_HAL2_BASE + 3 * 0x400)
-
 /* Indirect status register */
 
 #define H2_ISR_TSTATUS		0x01	/* RO: transaction status 1=busy */
@@ -207,122 +201,48 @@
 #define H2I_UTIME_2_LD		0xffff		/* seconds, LSB's */
 #define H2I_UTIME_3_LD		0xffff		/* seconds, MSB's */
 
-typedef volatile u32 hal2_reg_t;
-
-typedef struct stru_hal2_ctl_regs hal2_ctl_regs_t;
-struct stru_hal2_ctl_regs {
-	hal2_reg_t _unused0[4];
-	hal2_reg_t isr;			/* 0x10 Status Register */
-	hal2_reg_t _unused1[3];
-	hal2_reg_t rev;			/* 0x20 Revision Register */
-	hal2_reg_t _unused2[3];
-	hal2_reg_t iar;			/* 0x30 Indirect Address Register */
-	hal2_reg_t _unused3[3];
-	hal2_reg_t idr0;		/* 0x40 Indirect Data Register 0 */
-	hal2_reg_t _unused4[3];
-	hal2_reg_t idr1;		/* 0x50 Indirect Data Register 1 */
-	hal2_reg_t _unused5[3];
-	hal2_reg_t idr2;		/* 0x60 Indirect Data Register 2 */
-	hal2_reg_t _unused6[3];
-	hal2_reg_t idr3;		/* 0x70 Indirect Data Register 3 */
+struct hal2_ctl_regs {
+	u32 _unused0[4];
+	volatile u32 isr;		/* 0x10 Status Register */
+	u32 _unused1[3];
+	volatile u32 rev;		/* 0x20 Revision Register */
+	u32 _unused2[3];
+	volatile u32 iar;		/* 0x30 Indirect Address Register */
+	u32 _unused3[3];
+	volatile u32 idr0;		/* 0x40 Indirect Data Register 0 */
+	u32 _unused4[3];
+	volatile u32 idr1;		/* 0x50 Indirect Data Register 1 */
+	u32 _unused5[3];
+	volatile u32 idr2;		/* 0x60 Indirect Data Register 2 */
+	u32 _unused6[3];
+	volatile u32 idr3;		/* 0x70 Indirect Data Register 3 */
 };
 
-typedef struct stru_hal2_aes_regs hal2_aes_regs_t;
-struct stru_hal2_aes_regs {
-	hal2_reg_t rx_stat[2];		/* Status registers */
-	hal2_reg_t rx_cr[2];		/* Control registers */
-	hal2_reg_t rx_ud[4];		/* User data window */
-	hal2_reg_t rx_st[24];		/* Channel status data */
+struct hal2_aes_regs {
+	volatile u32 rx_stat[2];	/* Status registers */
+	volatile u32 rx_cr[2];		/* Control registers */
+	volatile u32 rx_ud[4];		/* User data window */
+	volatile u32 rx_st[24];		/* Channel status data */
 	
-	hal2_reg_t tx_stat[1];		/* Status register */
-	hal2_reg_t tx_cr[3];		/* Control registers */
-	hal2_reg_t tx_ud[4];		/* User data window */
-	hal2_reg_t tx_st[24];		/* Channel status data */
-};
-
-typedef struct stru_hal2_vol_regs hal2_vol_regs_t;
-struct stru_hal2_vol_regs {
-	hal2_reg_t right;		/* 0x00 Right volume */
-	hal2_reg_t left;		/* 0x04 Left volume */
-};
-
-typedef struct stru_hal2_syn_regs hal2_syn_regs_t;
-struct stru_hal2_syn_regs {
-	hal2_reg_t _unused0[2];
-	hal2_reg_t page;		/* DOC Page register */
-	hal2_reg_t regsel;		/* DOC Register selection */
-	hal2_reg_t dlow;		/* DOC Data low */
-	hal2_reg_t dhigh;		/* DOC Data high */
-	hal2_reg_t irq;			/* IRQ Status */
-	hal2_reg_t dram;		/* DRAM Access */
-};
-
-/* HAL2 specific structures */
-
-typedef struct stru_hal2_pbus hal2_pbus_t;
-struct stru_hal2_pbus {
-	struct hpc3_pbus_dmacregs *pbus;
-	int pbusnr;
-	unsigned int ctrl;		/* Current state of pbus->pbdma_ctrl */
-};
-
-typedef struct stru_hal2_binfo hal2_binfo_t;
-typedef struct stru_hal2_buffer hal2_buf_t;
-struct stru_hal2_binfo {
-	volatile struct hpc_dma_desc desc;
-	hal2_buf_t *next;		/* pointer to next buffer */
-	int cnt;			/* bytes in buffer */
-};
-#define H2_BUFFER_SIZE	(PAGE_SIZE - \
-		((sizeof(hal2_binfo_t) - 1) / 8 + 1) * 8)
-struct stru_hal2_buffer {
-	hal2_binfo_t info;
-	char data[H2_BUFFER_SIZE] __attribute__((aligned(8)));
+	volatile u32 tx_stat[1];	/* Status register */
+	volatile u32 tx_cr[3];		/* Control registers */
+	volatile u32 tx_ud[4];		/* User data window */
+	volatile u32 tx_st[24];		/* Channel status data */
 };
 
-typedef struct stru_hal2_codec hal2_codec_t;
-struct stru_hal2_codec {
-	hal2_buf_t *head;
-	hal2_buf_t *tail; 
-	hal2_pbus_t pbus;
-	unsigned int format;		/* Audio data format */
-	int voices;			/* mono/stereo */
-	unsigned int sample_rate;
-	unsigned int master;		/* Master frequency */
-	unsigned short mod;		/* MOD value */
-	unsigned short inc;		/* INC value */
-
-	wait_queue_head_t dma_wait;
-	spinlock_t lock;
-	struct semaphore sem;
-
-	int usecount;			/* recording and playback are 
-					 * independent */
+struct hal2_vol_regs {
+	volatile u32 right;		/* Right volume */
+	volatile u32 left;		/* Left volume */
 };
 
-#define H2_MIX_OUTPUT_ATT	0
-#define H2_MIX_INPUT_GAIN	1
-#define H2_MIXERS		2
-typedef struct stru_hal2_mixer hal2_mixer_t;
-struct stru_hal2_mixer {
-	int modcnt;
-	unsigned int volume[H2_MIXERS];
-};
-
-typedef struct stru_hal2_card hal2_card_t;
-struct stru_hal2_card {
-	int dev_dsp;			/* audio device */
-	int dev_mixer;			/* mixer device */
-	int dev_midi;			/* midi device */
-	
-	hal2_ctl_regs_t *ctl_regs;	/* HAL2 ctl registers */
-	hal2_aes_regs_t *aes_regs;	/* HAL2 vol registers */
-	hal2_vol_regs_t *vol_regs;	/* HAL2 aes registers */
-	hal2_syn_regs_t *syn_regs;	/* HAL2 syn registers */
-
-	hal2_codec_t dac;
-	hal2_codec_t adc;
-	hal2_mixer_t mixer;
+struct hal2_syn_regs {
+	u32 _unused0[2];
+	volatile u32 page;		/* DOC Page register */
+	volatile u32 regsel;		/* DOC Register selection */
+	volatile u32 dlow;		/* DOC Data low */
+	volatile u32 dhigh;		/* DOC Data high */
+	volatile u32 irq;		/* IRQ Status */
+	volatile u32 dram;		/* DRAM Access */
 };
 
-#endif				/* __HAL2_H */
+#endif	/* __HAL2_H */
diff --git a/sound/oss/i810_audio.c b/sound/oss/i810_audio.c
index e4f8542b3..918c2a23b 100644
--- a/sound/oss/i810_audio.c
+++ b/sound/oss/i810_audio.c
@@ -450,12 +450,38 @@ struct i810_card {
 /* extract register offset from codec struct */
 #define IO_REG_OFF(codec) (((struct i810_card *) codec->private_data)->ac97_id_map[codec->id])
 
-#define GET_CIV(port) MODULOP2(inb((port) + OFF_CIV), SG_LEN)
-#define GET_LVI(port) MODULOP2(inb((port) + OFF_LVI), SG_LEN)
+#define I810_IOREAD(size, type, card, off)				\
+({									\
+	type val;							\
+	if (card->use_mmio)						\
+		val=read##size(card->iobase_mmio+off);			\
+	else								\
+		val=in##size(card->iobase+off);				\
+	val;								\
+})
+
+#define I810_IOREADL(card, off)		I810_IOREAD(l, u32, card, off)
+#define I810_IOREADW(card, off)		I810_IOREAD(w, u16, card, off)
+#define I810_IOREADB(card, off)		I810_IOREAD(b, u8,  card, off)
+
+#define I810_IOWRITE(size, val, card, off)				\
+({									\
+	if (card->use_mmio)						\
+		write##size(val, card->iobase_mmio+off);		\
+	else								\
+		out##size(val, card->iobase+off);			\
+})
+
+#define I810_IOWRITEL(val, card, off)	I810_IOWRITE(l, val, card, off)
+#define I810_IOWRITEW(val, card, off)	I810_IOWRITE(w, val, card, off)
+#define I810_IOWRITEB(val, card, off)	I810_IOWRITE(b, val, card, off)
+
+#define GET_CIV(card, port) MODULOP2(I810_IOREADB((card), (port) + OFF_CIV), SG_LEN)
+#define GET_LVI(card, port) MODULOP2(I810_IOREADB((card), (port) + OFF_LVI), SG_LEN)
 
 /* set LVI from CIV */
-#define CIV_TO_LVI(port, off) \
-	outb(MODULOP2(GET_CIV((port)) + (off), SG_LEN), (port) + OFF_LVI)
+#define CIV_TO_LVI(card, port, off) \
+	I810_IOWRITEB(MODULOP2(GET_CIV((card), (port)) + (off), SG_LEN), (card), (port) + OFF_LVI)
 
 static struct i810_card *devs = NULL;
 
@@ -714,9 +740,9 @@ static inline unsigned i810_get_dma_addr(struct i810_state *state, int rec)
 		return 0;
 
 	if (rec)
-		port = state->card->iobase + dmabuf->read_channel->port;
+		port = dmabuf->read_channel->port;
 	else
-		port = state->card->iobase + dmabuf->write_channel->port;
+		port = dmabuf->write_channel->port;
 
 	if(state->card->pci_id == PCI_DEVICE_ID_SI_7012) {
 		port_picb = port + OFF_SR;
@@ -725,8 +751,8 @@ static inline unsigned i810_get_dma_addr(struct i810_state *state, int rec)
 		port_picb = port + OFF_PICB;
 
 	do {
-		civ = GET_CIV(port);
-		offset = inw(port_picb);
+		civ = GET_CIV(state->card, port);
+		offset = I810_IOREADW(state->card, port_picb);
 		/* Must have a delay here! */ 
 		if(offset == 0)
 			udelay(1);
@@ -745,7 +771,7 @@ static inline unsigned i810_get_dma_addr(struct i810_state *state, int rec)
 		 * that we won't have to worry about the chip still being
 		 * out of sync with reality ;-)
 		 */
-	} while (civ != GET_CIV(port) || offset != inw(port_picb));
+	} while (civ != GET_CIV(state->card, port) || offset != I810_IOREADW(state->card, port_picb));
 		 
 	return (((civ + 1) * dmabuf->fragsize - (bytes * offset))
 		% dmabuf->dmasize);
@@ -758,15 +784,15 @@ static inline void __stop_adc(struct i810_state *state)
 	struct i810_card *card = state->card;
 
 	dmabuf->enable &= ~ADC_RUNNING;
-	outb(0, card->iobase + PI_CR);
+	I810_IOWRITEB(0, card, PI_CR);
 	// wait for the card to acknowledge shutdown
-	while( inb(card->iobase + PI_CR) != 0 ) ;
+	while( I810_IOREADB(card, PI_CR) != 0 ) ;
 	// now clear any latent interrupt bits (like the halt bit)
 	if(card->pci_id == PCI_DEVICE_ID_SI_7012)
-		outb( inb(card->iobase + PI_PICB), card->iobase + PI_PICB );
+		I810_IOWRITEB( I810_IOREADB(card, PI_PICB), card, PI_PICB );
 	else
-		outb( inb(card->iobase + PI_SR), card->iobase + PI_SR );
-	outl( inl(card->iobase + GLOB_STA) & INT_PI, card->iobase + GLOB_STA);
+		I810_IOWRITEB( I810_IOREADB(card, PI_SR), card, PI_SR );
+	I810_IOWRITEL( I810_IOREADL(card, GLOB_STA) & INT_PI, card, GLOB_STA);
 }
 
 static void stop_adc(struct i810_state *state)
@@ -787,7 +813,7 @@ static inline void __start_adc(struct i810_state *state)
 	    (dmabuf->trigger & PCM_ENABLE_INPUT)) {
 		dmabuf->enable |= ADC_RUNNING;
 		// Interrupt enable, LVI enable, DMA enable
-		outb(0x10 | 0x04 | 0x01, state->card->iobase + PI_CR);
+		I810_IOWRITEB(0x10 | 0x04 | 0x01, state->card, PI_CR);
 	}
 }
 
@@ -808,15 +834,15 @@ static inline void __stop_dac(struct i810_state *state)
 	struct i810_card *card = state->card;
 
 	dmabuf->enable &= ~DAC_RUNNING;
-	outb(0, card->iobase + PO_CR);
+	I810_IOWRITEB(0, card, PO_CR);
 	// wait for the card to acknowledge shutdown
-	while( inb(card->iobase + PO_CR) != 0 ) ;
+	while( I810_IOREADB(card, PO_CR) != 0 ) ;
 	// now clear any latent interrupt bits (like the halt bit)
 	if(card->pci_id == PCI_DEVICE_ID_SI_7012)
-		outb( inb(card->iobase + PO_PICB), card->iobase + PO_PICB );
+		I810_IOWRITEB( I810_IOREADB(card, PO_PICB), card, PO_PICB );
 	else
-		outb( inb(card->iobase + PO_SR), card->iobase + PO_SR );
-	outl( inl(card->iobase + GLOB_STA) & INT_PO, card->iobase + GLOB_STA);
+		I810_IOWRITEB( I810_IOREADB(card, PO_SR), card, PO_SR );
+	I810_IOWRITEL( I810_IOREADL(card, GLOB_STA) & INT_PO, card, GLOB_STA);
 }
 
 static void stop_dac(struct i810_state *state)
@@ -837,7 +863,7 @@ static inline void __start_dac(struct i810_state *state)
 	    (dmabuf->trigger & PCM_ENABLE_OUTPUT)) {
 		dmabuf->enable |= DAC_RUNNING;
 		// Interrupt enable, LVI enable, DMA enable
-		outb(0x10 | 0x04 | 0x01, state->card->iobase + PO_CR);
+		I810_IOWRITEB(0x10 | 0x04 | 0x01, state->card, PO_CR);
 	}
 }
 static void start_dac(struct i810_state *state)
@@ -1000,12 +1026,12 @@ static int prog_dmabuf(struct i810_state *state, unsigned rec)
 			sg++;
 		}
 		spin_lock_irqsave(&state->card->lock, flags);
-		outb(2, state->card->iobase+c->port+OFF_CR);   /* reset DMA machine */
-		while( inb(state->card->iobase+c->port+OFF_CR) & 0x02 ) ;
-		outl((u32)state->card->chandma +
+		I810_IOWRITEB(2, state->card, c->port+OFF_CR);   /* reset DMA machine */
+		while( I810_IOREADB(state->card, c->port+OFF_CR) & 0x02 ) ;
+		I810_IOWRITEL((u32)state->card->chandma +
 		    c->num*sizeof(struct i810_channel),
-		    state->card->iobase+c->port+OFF_BDBAR);
-		CIV_TO_LVI(state->card->iobase+c->port, 0);
+		    state->card, c->port+OFF_BDBAR);
+		CIV_TO_LVI(state->card, c->port, 0);
 
 		spin_unlock_irqrestore(&state->card->lock, flags);
 
@@ -1037,14 +1063,13 @@ static void __i810_update_lvi(struct i810_state *state, int rec)
 	void (*start)(struct i810_state *);
 
 	count = dmabuf->count;
-	port = state->card->iobase;
 	if (rec) {
-		port += dmabuf->read_channel->port;
+		port = dmabuf->read_channel->port;
 		trigger = PCM_ENABLE_INPUT;
 		start = __start_adc;
 		count = dmabuf->dmasize - count;
 	} else {
-		port += dmabuf->write_channel->port;
+		port = dmabuf->write_channel->port;
 		trigger = PCM_ENABLE_OUTPUT;
 		start = __start_dac;
 	}
@@ -1059,14 +1084,14 @@ static void __i810_update_lvi(struct i810_state *state, int rec)
 			return;
 
 		start(state);
-		while (!(inb(port + OFF_CR) & ((1<<4) | (1<<2))))
+		while (!(I810_IOREADB(state->card, port + OFF_CR) & ((1<<4) | (1<<2))))
 			;
 	}
 
 	/* MASKP2(swptr, fragsize) - 1 is the tail of our transfer */
 	x = MODULOP2(MASKP2(dmabuf->swptr, fragsize) - 1, dmabuf->dmasize);
 	x >>= dmabuf->fragshift;
-	outb(x, port + OFF_LVI);
+	I810_IOWRITEB(x, state->card, port + OFF_LVI);
 }
 
 static void i810_update_lvi(struct i810_state *state, int rec)
@@ -1108,8 +1133,8 @@ static void i810_update_ptr(struct i810_state *state)
 			/* this is normal for the end of a read */
 			/* only give an error if we went past the */
 			/* last valid sg entry */
-			if (GET_CIV(state->card->iobase + PI_BASE) !=
-			    GET_LVI(state->card->iobase + PI_BASE)) {
+			if (GET_CIV(state->card, PI_BASE) !=
+			    GET_LVI(state->card, PI_BASE)) {
 				printk(KERN_WARNING "i810_audio: DMA overrun on read\n");
 				dmabuf->error++;
 			}
@@ -1133,13 +1158,13 @@ static void i810_update_ptr(struct i810_state *state)
 			/* this is normal for the end of a write */
 			/* only give an error if we went past the */
 			/* last valid sg entry */
-			if (GET_CIV(state->card->iobase + PO_BASE) !=
-			    GET_LVI(state->card->iobase + PO_BASE)) {
+			if (GET_CIV(state->card, PO_BASE) !=
+			    GET_LVI(state->card, PO_BASE)) {
 				printk(KERN_WARNING "i810_audio: DMA overrun on write\n");
 				printk("i810_audio: CIV %d, LVI %d, hwptr %x, "
 					"count %d\n",
-					GET_CIV(state->card->iobase + PO_BASE),
-					GET_LVI(state->card->iobase + PO_BASE),
+					GET_CIV(state->card, PO_BASE),
+					GET_LVI(state->card, PO_BASE),
 					dmabuf->hwptr, dmabuf->count);
 				dmabuf->error++;
 			}
@@ -1287,7 +1312,7 @@ static void i810_channel_interrupt(struct i810_card *card)
 		struct i810_state *state = card->states[i];
 		struct i810_channel *c;
 		struct dmabuf *dmabuf;
-		unsigned long port = card->iobase;
+		unsigned long port;
 		u16 status;
 		
 		if(!state)
@@ -1302,12 +1327,12 @@ static void i810_channel_interrupt(struct i810_card *card)
 		} else	/* This can occur going from R/W to close */
 			continue;
 		
-		port+=c->port;
+		port = c->port;
 
 		if(card->pci_id == PCI_DEVICE_ID_SI_7012)
-			status = inw(port + OFF_PICB);
+			status = I810_IOREADW(card, port + OFF_PICB);
 		else
-			status = inw(port + OFF_SR);
+			status = I810_IOREADW(card, port + OFF_SR);
 
 #ifdef DEBUG_INTERRUPTS
 		printk("NUM %d PORT %X IRQ ( ST%d ", c->num, c->port, status);
@@ -1340,7 +1365,7 @@ static void i810_channel_interrupt(struct i810_card *card)
 			if(dmabuf->enable & ADC_RUNNING)
 				count = dmabuf->dmasize - count;
 			if (count >= (int)dmabuf->fragsize) {
-				outb(inb(port+OFF_CR) | 1, port+OFF_CR);
+				I810_IOWRITEB(I810_IOREADB(card, port+OFF_CR) | 1, card, port+OFF_CR);
 #ifdef DEBUG_INTERRUPTS
 				printk(" CONTINUE ");
 #endif
@@ -1356,9 +1381,9 @@ static void i810_channel_interrupt(struct i810_card *card)
 			}
 		}
 		if(card->pci_id == PCI_DEVICE_ID_SI_7012)
-			outw(status & DMA_INT_MASK, port + OFF_PICB);
+			I810_IOWRITEW(status & DMA_INT_MASK, card, port + OFF_PICB);
 		else
-			outw(status & DMA_INT_MASK, port + OFF_SR);
+			I810_IOWRITEW(status & DMA_INT_MASK, card, port + OFF_SR);
 	}
 #ifdef DEBUG_INTERRUPTS
 	printk(")\n");
@@ -1372,7 +1397,7 @@ static irqreturn_t i810_interrupt(int irq, void *dev_id, struct pt_regs *regs)
 
 	spin_lock(&card->lock);
 
-	status = inl(card->iobase + GLOB_STA);
+	status = I810_IOREADL(card, GLOB_STA);
 
 	if(!(status & INT_MASK)) 
 	{
@@ -1384,7 +1409,7 @@ static irqreturn_t i810_interrupt(int irq, void *dev_id, struct pt_regs *regs)
 		i810_channel_interrupt(card);
 
  	/* clear 'em */
-	outl(status & INT_MASK, card->iobase + GLOB_STA);
+	I810_IOWRITEL(status & INT_MASK, card, GLOB_STA);
 	spin_unlock(&card->lock);
 	return IRQ_HANDLED;
 }
@@ -1396,7 +1421,7 @@ static irqreturn_t i810_interrupt(int irq, void *dev_id, struct pt_regs *regs)
 static ssize_t i810_read(struct file *file, char __user *buffer, size_t count, loff_t *ppos)
 {
 	struct i810_state *state = (struct i810_state *)file->private_data;
-	struct i810_card *card=state ? state->card : 0;
+	struct i810_card *card=state ? state->card : NULL;
 	struct dmabuf *dmabuf = &state->dmabuf;
 	ssize_t ret;
 	unsigned long flags;
@@ -1409,8 +1434,6 @@ static ssize_t i810_read(struct file *file, char __user *buffer, size_t count, l
 	printk("i810_audio: i810_read called, count = %d\n", count);
 #endif
 
-	if (ppos != &file->f_pos)
-		return -ESPIPE;
 	if (dmabuf->mapped)
 		return -ENXIO;
 	if (dmabuf->enable & DAC_RUNNING)
@@ -1536,7 +1559,7 @@ static ssize_t i810_read(struct file *file, char __user *buffer, size_t count, l
 static ssize_t i810_write(struct file *file, const char __user *buffer, size_t count, loff_t *ppos)
 {
 	struct i810_state *state = (struct i810_state *)file->private_data;
-	struct i810_card *card=state ? state->card : 0;
+	struct i810_card *card=state ? state->card : NULL;
 	struct dmabuf *dmabuf = &state->dmabuf;
 	ssize_t ret;
 	unsigned long flags;
@@ -1549,8 +1572,6 @@ static ssize_t i810_write(struct file *file, const char __user *buffer, size_t c
 	printk("i810_audio: i810_write called, count = %d\n", count);
 #endif
 
-	if (ppos != &file->f_pos)
-		return -ESPIPE;
 	if (dmabuf->mapped)
 		return -ENXIO;
 	if (dmabuf->enable & ADC_RUNNING)
@@ -1784,13 +1805,13 @@ static int i810_ioctl(struct inode *inode, struct file *file, unsigned int cmd,
 			__stop_adc(state);
 		}
 		if (c != NULL) {
-			outb(2, state->card->iobase+c->port+OFF_CR);   /* reset DMA machine */
-			while ( inb(state->card->iobase+c->port+OFF_CR) & 2 )
+			I810_IOWRITEB(2, state->card, c->port+OFF_CR);   /* reset DMA machine */
+			while ( I810_IOREADB(state->card, c->port+OFF_CR) & 2 )
 				cpu_relax();
-			outl((u32)state->card->chandma +
+			I810_IOWRITEL((u32)state->card->chandma +
 			    c->num*sizeof(struct i810_channel),
-			    state->card->iobase+c->port+OFF_BDBAR);
-			CIV_TO_LVI(state->card->iobase+c->port, 0);
+			    state->card, c->port+OFF_BDBAR);
+			CIV_TO_LVI(state->card, c->port, 0);
 		}
 
 		spin_unlock_irqrestore(&state->card->lock, flags);
@@ -1920,7 +1941,7 @@ static int i810_ioctl(struct inode *inode, struct file *file, unsigned int cmd,
 		/* Global Status and Global Control register are now  */
 		/* used to indicate this.                             */
 
-                i_glob_cnt = inl(state->card->iobase + GLOB_CNT);
+                i_glob_cnt = I810_IOREADL(state->card, GLOB_CNT);
 
 		/* Current # of channels enabled */
 		if ( i_glob_cnt & 0x0100000 )
@@ -1932,14 +1953,14 @@ static int i810_ioctl(struct inode *inode, struct file *file, unsigned int cmd,
 
 		switch ( val ) {
 			case 2: /* 2 channels is always supported */
-				outl(i_glob_cnt & 0xffcfffff,
-				     state->card->iobase + GLOB_CNT);
+				I810_IOWRITEL(i_glob_cnt & 0xffcfffff,
+				     state->card, GLOB_CNT);
 				/* Do we need to change mixer settings????  */
 				break;
 			case 4: /* Supported on some chipsets, better check first */
 				if ( state->card->channels >= 4 ) {
-					outl((i_glob_cnt & 0xffcfffff) | 0x100000,
-					      state->card->iobase + GLOB_CNT);
+					I810_IOWRITEL((i_glob_cnt & 0xffcfffff) | 0x100000,
+					      state->card, GLOB_CNT);
 					/* Do we need to change mixer settings??? */
 				} else {
 					val = ret;
@@ -1947,8 +1968,8 @@ static int i810_ioctl(struct inode *inode, struct file *file, unsigned int cmd,
 				break;
 			case 6: /* Supported on some chipsets, better check first */
 				if ( state->card->channels >= 6 ) {
-					outl((i_glob_cnt & 0xffcfffff) | 0x200000,
-					      state->card->iobase + GLOB_CNT);
+					I810_IOWRITEL((i_glob_cnt & 0xffcfffff) | 0x200000,
+					      state->card, GLOB_CNT);
 					/* Do we need to change mixer settings??? */
 				} else {
 					val = ret;
@@ -2477,8 +2498,8 @@ found_virt:
 		} else {
 			i810_set_dac_rate(state, 8000);
 			/* Put the ACLink in 2 channel mode by default */
-			i = inl(card->iobase + GLOB_CNT);
-			outl(i & 0xffcfffff, card->iobase + GLOB_CNT);
+			i = I810_IOREADL(card, GLOB_CNT);
+			I810_IOWRITEL(i & 0xffcfffff, card, GLOB_CNT);
 		}
 	}
 		
@@ -2493,7 +2514,7 @@ found_virt:
 
 	state->open_mode |= file->f_mode & (FMODE_READ | FMODE_WRITE);
 
-	return 0;
+	return nonseekable_open(inode, file);
 }
 
 static int i810_release(struct inode *inode, struct file *file)
@@ -2569,7 +2590,7 @@ static u16 i810_ac97_get_io(struct ac97_codec *dev, u8 reg)
 	int count = 100;
 	u16 reg_set = IO_REG_OFF(dev) | (reg&0x7f);
 	
-	while(count-- && (inb(card->iobase + CAS) & 1)) 
+	while(count-- && (I810_IOREADB(card, CAS) & 1)) 
 		udelay(1);
 	
 	return inw(card->ac97base + reg_set);
@@ -2597,7 +2618,7 @@ static void i810_ac97_set_io(struct ac97_codec *dev, u8 reg, u16 data)
 	int count = 100;
 	u16 reg_set = IO_REG_OFF(dev) | (reg&0x7f);
 	
-	while(count-- && (inb(card->iobase + CAS) & 1)) 
+	while(count-- && (I810_IOREADB(card, CAS) & 1)) 
 		udelay(1);
 	
         outw(data, card->ac97base + reg_set);
@@ -2660,7 +2681,7 @@ static int i810_open_mixdev(struct inode *inode, struct file *file)
 			if (card->ac97_codec[i] != NULL &&
 			    card->ac97_codec[i]->dev_mixer == minor) {
 				file->private_data = card->ac97_codec[i];
-				return 0;
+				return nonseekable_open(inode, file);
 			}
 	}
 	return -ENODEV;
@@ -2686,7 +2707,7 @@ static /*const*/ struct file_operations i810_mixer_fops = {
 
 static inline int i810_ac97_exists(struct i810_card *card, int ac97_number)
 {
-	u32 reg = inl(card->iobase + GLOB_STA);
+	u32 reg = I810_IOREADL(card, GLOB_STA);
 	switch (ac97_number) {
 	case 0:
 		return reg & (1<<8);
@@ -2757,7 +2778,7 @@ static inline int ich_use_mmio(struct i810_card *card)
  
 static int i810_ac97_power_up_bus(struct i810_card *card)
 {	
-	u32 reg = inl(card->iobase + GLOB_CNT);
+	u32 reg = I810_IOREADL(card, GLOB_CNT);
 	int i;
 	int primary_codec_id = 0;
 
@@ -2769,14 +2790,14 @@ static int i810_ac97_power_up_bus(struct i810_card *card)
 	reg&=~8;	/* ACLink on */
 	
 	/* At this point we deassert AC_RESET # */
-	outl(reg , card->iobase + GLOB_CNT);
+	I810_IOWRITEL(reg , card, GLOB_CNT);
 
 	/* We must now allow time for the Codec initialisation.
 	   600mS is the specified time */
 	   	
 	for(i=0;i<10;i++)
 	{
-		if((inl(card->iobase+GLOB_CNT)&4)==0)
+		if((I810_IOREADL(card, GLOB_CNT)&4)==0)
 			break;
 
 		set_current_state(TASK_UNINTERRUPTIBLE);
@@ -2795,8 +2816,11 @@ static int i810_ac97_power_up_bus(struct i810_card *card)
 	 *	See if the primary codec comes ready. This must happen
 	 *	before we start doing DMA stuff
 	 */	
-	/* see i810_ac97_init for the next 7 lines (jsaw) */
-	inw(card->ac97base);
+	/* see i810_ac97_init for the next 10 lines (jsaw) */
+	if (card->use_mmio)
+		readw(card->ac97base_mmio);
+	else
+		inw(card->ac97base);
 	if (ich_use_mmio(card)) {
 		primary_codec_id = (int) readl(card->iobase_mmio + SDM) & 0x3;
 		printk(KERN_INFO "i810_audio: Primary codec has ID %d\n",
@@ -2814,7 +2838,10 @@ static int i810_ac97_power_up_bus(struct i810_card *card)
 		else 
 			printk("no response.\n");
 	}
-	inw(card->ac97base);
+	if (card->use_mmio)
+		readw(card->ac97base_mmio);
+	else
+		inw(card->ac97base);
 	return 1;
 }
 
@@ -2839,15 +2866,15 @@ static int __devinit i810_ac97_init(struct i810_card *card)
 	/* to check....                                         */
 
 	card->channels = 2;
-	reg = inl(card->iobase + GLOB_STA);
+	reg = I810_IOREADL(card, GLOB_STA);
 	if ( reg & 0x0200000 )
 		card->channels = 6;
 	else if ( reg & 0x0100000 )
 		card->channels = 4;
 	printk(KERN_INFO "i810_audio: Audio Controller supports %d channels.\n", card->channels);
 	printk(KERN_INFO "i810_audio: Defaulting to base 2 channel mode.\n");
-	reg = inl(card->iobase + GLOB_CNT);
-	outl(reg & 0xffcfffff, card->iobase + GLOB_CNT);
+	reg = I810_IOREADL(card, GLOB_CNT);
+	I810_IOWRITEL(reg & 0xffcfffff, card, GLOB_CNT);
 		
 	for (num_ac97 = 0; num_ac97 < NR_AC97; num_ac97++) 
 		card->ac97_codec[num_ac97] = NULL;
@@ -2858,8 +2885,10 @@ static int __devinit i810_ac97_init(struct i810_card *card)
 	for (num_ac97 = 0; num_ac97 < nr_ac97_max; num_ac97++) {
 		/* codec reset */
 		printk(KERN_INFO "i810_audio: Resetting connection %d\n", num_ac97);
-		if (card->use_mmio) readw(card->ac97base_mmio + 0x80*num_ac97);
-		else inw(card->ac97base + 0x80*num_ac97);
+		if (card->use_mmio)
+			readw(card->ac97base_mmio + 0x80*num_ac97);
+		else
+			inw(card->ac97base + 0x80*num_ac97);
 
 		/* If we have the SDATA_IN Map Register, as on ICH4, we
 		   do not loop thru all possible codec IDs but thru all 
@@ -3062,7 +3091,7 @@ static void __devinit i810_configure_clocking (void)
 			goto config_out;
 		}
 		dmabuf->count = dmabuf->dmasize;
-		CIV_TO_LVI(card->iobase+dmabuf->write_channel->port, -1);
+		CIV_TO_LVI(card, dmabuf->write_channel->port, -1);
 		local_irq_save(flags);
 		start_dac(state);
 		offset = i810_get_dma_addr(state, 0);
@@ -3106,13 +3135,6 @@ static int __devinit i810_probe(struct pci_dev *pci_dev, const struct pci_device
 		return -ENODEV;
 	}
 	
-	if( pci_resource_start(pci_dev, 1) == 0)
-	{
-		/* MMIO only ICH5 .. here be dragons .. */
-		printk(KERN_ERR "i810_audio: Pure MMIO interfaces not yet supported.\n");
-		return -ENODEV;
-	}
-
 	if ((card = kmalloc(sizeof(struct i810_card), GFP_KERNEL)) == NULL) {
 		printk(KERN_ERR "i810_audio: out of memory\n");
 		return -ENOMEM;
@@ -3125,6 +3147,11 @@ static int __devinit i810_probe(struct pci_dev *pci_dev, const struct pci_device
 	card->ac97base = pci_resource_start (pci_dev, 0);
 	card->iobase = pci_resource_start (pci_dev, 1);
 
+	if (!(card->ac97base) || !(card->iobase)) {
+		card->ac97base = 0;
+		card->iobase = 0;
+	}
+
 	/* if chipset could have mmio capability, check it */ 
 	if (card_cap[pci_id->driver_data].flags & CAP_MMIO) {
 		card->ac97base_mmio_phys = pci_resource_start (pci_dev, 2);
@@ -3139,6 +3166,11 @@ static int __devinit i810_probe(struct pci_dev *pci_dev, const struct pci_device
 		}
 	}
 
+	if (!(card->use_mmio) && (!(card->iobase) || !(card->ac97base))) {
+		printk(KERN_ERR "i810_audio: No I/O resources available.\n");
+		goto out_mem;
+	}
+
 	card->irq = pci_dev->irq;
 	card->next = devs;
 	card->magic = I810_CARD_MAGIC;
diff --git a/sound/oss/ite8172.c b/sound/oss/ite8172.c
index f62efd8a4..16e7d01ef 100644
--- a/sound/oss/ite8172.c
+++ b/sound/oss/ite8172.c
@@ -878,7 +878,7 @@ static int it8172_open_mixdev(struct inode *inode, struct file *file)
 			break;
 	}
 	file->private_data = s;
-	return 0;
+	return nonseekable_open(inode, file);
 }
 
 static int it8172_release_mixdev(struct inode *inode, struct file *file)
@@ -1093,8 +1093,6 @@ static ssize_t it8172_read(struct file *file, char *buffer,
 	unsigned long flags;
 	int cnt, remainder, avail;
 
-	if (ppos != &file->f_pos)
-		return -ESPIPE;
 	if (db->mapped)
 		return -ENXIO;
 	if (!access_ok(VERIFY_WRITE, buffer, count))
@@ -1176,8 +1174,6 @@ static ssize_t it8172_write(struct file *file, const char *buffer,
 	unsigned long flags;
 	int cnt, remainder, avail;
 
-	if (ppos != &file->f_pos)
-		return -ESPIPE;
 	if (db->mapped)
 		return -ENXIO;
 	if (!access_ok(VERIFY_READ, buffer, count))
@@ -1843,7 +1839,7 @@ static int it8172_open(struct inode *inode, struct file *file)
 
 	s->open_mode |= (file->f_mode & (FMODE_READ | FMODE_WRITE));
 	up(&s->open_sem);
-	return 0;
+	return nonseekable_open(inode, file);
 }
 
 static int it8172_release(struct inode *inode, struct file *file)
diff --git a/sound/oss/kahlua.c b/sound/oss/kahlua.c
index 2c0722525..0913d4969 100644
--- a/sound/oss/kahlua.c
+++ b/sound/oss/kahlua.c
@@ -28,6 +28,7 @@
  */
 
 #include <linux/config.h>
+#include <linux/delay.h>
 #include <linux/init.h>
 #include <linux/module.h>
 #include <linux/pci.h>
diff --git a/sound/oss/maestro.c b/sound/oss/maestro.c
index 4a670f4e4..66456dbb2 100644
--- a/sound/oss/maestro.c
+++ b/sound/oss/maestro.c
@@ -2158,7 +2158,7 @@ static int ess_open_mixdev(struct inode *inode, struct file *file)
 	if (!card)
 		return -ENODEV;
 	file->private_data = card;
-	return 0;
+	return nonseekable_open(inode, file);
 }
 
 static int ess_release_mixdev(struct inode *inode, struct file *file)
@@ -2274,8 +2274,6 @@ ess_read(struct file *file, char __user *buffer, size_t count, loff_t *ppos)
 	unsigned char *combbuf = NULL;
 	
 	VALIDATE_STATE(s);
-	if (ppos != &file->f_pos)
-		return -ESPIPE;
 	if (s->dma_adc.mapped)
 		return -ENXIO;
 	if (!s->dma_adc.ready && (ret = prog_dmabuf(s, 1)))
@@ -2372,8 +2370,6 @@ ess_write(struct file *file, const char __user *buffer, size_t count, loff_t *pp
 	int cnt;
 	
 	VALIDATE_STATE(s);
-	if (ppos != &file->f_pos)
-		return -ESPIPE;
 	if (s->dma_dac.mapped)
 		return -ENXIO;
 	if (!s->dma_dac.ready && (ret = prog_dmabuf(s, 0)))
@@ -3082,7 +3078,7 @@ ess_open(struct inode *inode, struct file *file)
 	s->open_mode |= file->f_mode & (FMODE_READ | FMODE_WRITE);
 
 	up(&s->open_sem);
-	return 0;
+	return nonseekable_open(inode, file);
 }
 
 static int 
diff --git a/sound/oss/maestro3.c b/sound/oss/maestro3.c
index 2830f7f1e..c27e88f47 100644
--- a/sound/oss/maestro3.c
+++ b/sound/oss/maestro3.c
@@ -1333,8 +1333,6 @@ static ssize_t m3_read(struct file *file, char __user *buffer, size_t count, lof
     int cnt;
     
     VALIDATE_STATE(s);
-    if (ppos != &file->f_pos)
-        return -ESPIPE;
     if (s->dma_adc.mapped)
         return -ENXIO;
     if (!s->dma_adc.ready && (ret = prog_dmabuf(s, 1)))
@@ -1414,8 +1412,6 @@ static ssize_t m3_write(struct file *file, const char __user *buffer, size_t cou
     int cnt;
     
     VALIDATE_STATE(s);
-    if (ppos != &file->f_pos)
-        return -ESPIPE;
     if (s->dma_dac.mapped)
         return -ENXIO;
     if (!s->dma_dac.ready && (ret = prog_dmabuf(s, 0)))
@@ -2051,7 +2047,7 @@ static int m3_open(struct inode *inode, struct file *file)
 
     up(&s->open_sem);
     spin_unlock_irqrestore(&c->lock, flags);
-    return 0;
+    return nonseekable_open(inode, file);
 }
 
 static int m3_release(struct inode *inode, struct file *file)
@@ -2165,7 +2161,7 @@ static int m3_open_mixdev(struct inode *inode, struct file *file)
 
     file->private_data = card->ac97;
 
-    return 0;
+    return nonseekable_open(inode, file);
 }
 
 static int m3_release_mixdev(struct inode *inode, struct file *file)
diff --git a/sound/oss/msnd_pinnacle.c b/sound/oss/msnd_pinnacle.c
index a130ba4c0..eb345b603 100644
--- a/sound/oss/msnd_pinnacle.c
+++ b/sound/oss/msnd_pinnacle.c
@@ -1145,11 +1145,10 @@ static int __init probe_multisound(void)
 	char *pinfiji = "Pinnacle/Fiji";
 #endif
 
-	if (check_region(dev.io, dev.numio)) {
+	if (!request_region(dev.io, dev.numio, "probing")) {
 		printk(KERN_ERR LOGNAME ": I/O port conflict\n");
 		return -ENODEV;
 	}
-	request_region(dev.io, dev.numio, "probing");
 
 	if (reset_dsp() < 0) {
 		release_region(dev.io, dev.numio);
@@ -1833,12 +1832,11 @@ static int __init msnd_init(void)
 		/* Joystick */
 		pinnacle_devs[3].io0 = joystick_io;
 
-		if (check_region(cfg, 2)) {
+		if (!request_region(cfg, 2, "Pinnacle/Fiji Config")) {
 			printk(KERN_ERR LOGNAME ": Config port 0x%x conflict\n", cfg);
 			return -EIO;
 		}
 
-		request_region(cfg, 2, "Pinnacle/Fiji Config");
 		if (msnd_pinnacle_cfg_devices(cfg, reset, pinnacle_devs)) {
 			printk(KERN_ERR LOGNAME ": Device configuration error\n");
 			release_region(cfg, 2);
diff --git a/sound/oss/nec_vrc5477.c b/sound/oss/nec_vrc5477.c
index 7ac712666..b40611b42 100644
--- a/sound/oss/nec_vrc5477.c
+++ b/sound/oss/nec_vrc5477.c
@@ -868,7 +868,7 @@ static int vrc5477_ac97_open_mixdev(struct inode *inode, struct file *file)
 			break;
 	}
 	file->private_data = s;
-	return 0;
+	return nonseekable_open(inode, file);
 }
 
 static int vrc5477_ac97_release_mixdev(struct inode *inode, struct file *file)
@@ -1043,8 +1043,6 @@ vrc5477_ac97_read(struct file *file,
 	int copyCount;
 	size_t avail;
 
-	if (ppos != &file->f_pos)
-		return -ESPIPE;
 	if (!access_ok(VERIFY_WRITE, buffer, count))
 		return -EFAULT;
 
@@ -1229,8 +1227,6 @@ static ssize_t vrc5477_ac97_write(struct file *file, const char *buffer,
 	unsigned long flags;
 	int copyCount, avail;
 
-	if (ppos != &file->f_pos)
-		return -ESPIPE;
 	if (!access_ok(VERIFY_READ, buffer, count))
 		return -EFAULT;
 	ret = 0;
@@ -1574,7 +1570,8 @@ static int vrc5477_ac97_open(struct inode *inode, struct file *file)
 	struct list_head *list;
 	struct vrc5477_ac97_state *s;
 	int ret=0;
-    
+
+	nonseekable_open(inode, file);    
 	for (list = devs.next; ; list = list->next) {
 		if (list == &devs)
 			return -ENODEV;
diff --git a/sound/oss/rme96xx.c b/sound/oss/rme96xx.c
index 404ba23b1..3df045dd5 100644
--- a/sound/oss/rme96xx.c
+++ b/sound/oss/rme96xx.c
@@ -1454,6 +1454,7 @@ static int rme96xx_open(struct inode *in, struct file *f)
 
 	DBG(printk("device num %d open\n",devnum));
 
+	nonseekable_open(in, f);
 	for (list = devs.next; ; list = list->next) {
 		if (list == &devs)
 			return -ENODEV;
@@ -1543,9 +1544,6 @@ static ssize_t rme96xx_write(struct file *file, const char __user *buffer, size_
 	if(dma == NULL || (dma->s) == NULL) 
 		return -ENXIO;
 
-	if (ppos != &file->f_pos)
-		return -ESPIPE;
-
 	if (dma->mmapped || !dma->opened)
 		return -ENXIO;
 
@@ -1611,9 +1609,6 @@ static ssize_t rme96xx_read(struct file *file, char __user *buffer, size_t count
 	if(dma == NULL || (dma->s) == NULL) 
 		return -ENXIO;
 
-	if (ppos != &file->f_pos)
-		return -ESPIPE;
-
 	if (dma->mmapped || !dma->opened)
 		return -ENXIO;
 
@@ -1775,6 +1770,7 @@ static int rme96xx_mixer_open(struct inode *inode, struct file *file)
 
 	COMM  ("mixer open");
 
+	nonseekable_open(inode, file);
 	for (list = devs.next; ; list = list->next) {
 		if (list == &devs)
 			return -ENODEV;
diff --git a/sound/oss/sb_audio.c b/sound/oss/sb_audio.c
index 40914dd0c..75e54f6f6 100644
--- a/sound/oss/sb_audio.c
+++ b/sound/oss/sb_audio.c
@@ -519,9 +519,11 @@ static int sbpro_audio_prepare_for_output(int dev, int bsize, int bcount)
 			sb_dsp_command(devc, 0xa0 | bits);	/* Mono output */
 		else
 			sb_dsp_command(devc, 0xa8 | bits);	/* Stereo output */
+		spin_unlock_irqrestore(&devc->lock, flags);
 	}
 	else
 	{
+		spin_unlock_irqrestore(&devc->lock, flags);
 		tmp = sb_getmixer(devc, 0x0e);
 		if (devc->channels == 1)
 			tmp &= ~0x02;
@@ -529,7 +531,6 @@ static int sbpro_audio_prepare_for_output(int dev, int bsize, int bcount)
 			tmp |= 0x02;
 		sb_setmixer(devc, 0x0e, tmp);
 	}
-	spin_unlock_irqrestore(&devc->lock, flags);
 	devc->trigger_bits = 0;
 	return 0;
 }
diff --git a/sound/oss/sb_card.c b/sound/oss/sb_card.c
index b5f5ecbf2..012f6d2d8 100644
--- a/sound/oss/sb_card.c
+++ b/sound/oss/sb_card.c
@@ -309,7 +309,13 @@ static int __init sb_init(void)
 
 	/* If either PnP or Legacy registered a card then return
 	 * success */
-	return (pres > 0 || lres > 0) ? 0 : -ENODEV;
+	if (pres <= 0 && lres <= 0) {
+#ifdef CONFIG_PNP
+		pnp_unregister_card_driver(&sb_pnp_driver);
+#endif
+		return -ENODEV;
+	}
+	return 0;
 }
 
 static void __exit sb_exit(void)
diff --git a/sound/oss/sb_common.c b/sound/oss/sb_common.c
index 249d69cbb..1ab1eb129 100644
--- a/sound/oss/sb_common.c
+++ b/sound/oss/sb_common.c
@@ -1206,7 +1206,7 @@ int probe_sbmpu(struct address_info *hw_config, struct module *owner)
 	if (last_devc == NULL)
 		return 0;
 
-	last_devc = 0;
+	last_devc = NULL;
 
 	if (hw_config->io_base <= 0)
 	{
diff --git a/sound/oss/sonicvibes.c b/sound/oss/sonicvibes.c
index e231cf0a7..8bb6deaad 100644
--- a/sound/oss/sonicvibes.c
+++ b/sound/oss/sonicvibes.c
@@ -1252,7 +1252,7 @@ static int sv_open_mixdev(struct inode *inode, struct file *file)
 	}
        	VALIDATE_STATE(s);
 	file->private_data = s;
-	return 0;
+	return nonseekable_open(inode, file);
 }
 
 static int sv_release_mixdev(struct inode *inode, struct file *file)
@@ -1325,8 +1325,6 @@ static ssize_t sv_read(struct file *file, char __user *buffer, size_t count, lof
 	int cnt;
 
 	VALIDATE_STATE(s);
-	if (ppos != &file->f_pos)
-		return -ESPIPE;
 	if (s->dma_adc.mapped)
 		return -ENXIO;
 	if (!s->dma_adc.ready && (ret = prog_dmabuf(s, 1)))
@@ -1410,8 +1408,6 @@ static ssize_t sv_write(struct file *file, const char __user *buffer, size_t cou
 	int cnt;
 
 	VALIDATE_STATE(s);
-	if (ppos != &file->f_pos)
-		return -ESPIPE;
 	if (s->dma_dac.mapped)
 		return -ENXIO;
 	if (!s->dma_dac.ready && (ret = prog_dmabuf(s, 0)))
@@ -1954,7 +1950,7 @@ static int sv_open(struct inode *inode, struct file *file)
 	set_fmt(s, fmtm, fmts);
 	s->open_mode |= file->f_mode & (FMODE_READ | FMODE_WRITE);
 	up(&s->open_sem);
-	return 0;
+	return nonseekable_open(inode, file);
 }
 
 static int sv_release(struct inode *inode, struct file *file)
@@ -2005,8 +2001,6 @@ static ssize_t sv_midi_read(struct file *file, char __user *buffer, size_t count
 	int cnt;
 
 	VALIDATE_STATE(s);
-	if (ppos != &file->f_pos)
-		return -ESPIPE;
 	if (!access_ok(VERIFY_WRITE, buffer, count))
 		return -EFAULT;
 	if (count == 0)
@@ -2068,8 +2062,6 @@ static ssize_t sv_midi_write(struct file *file, const char __user *buffer, size_
 	int cnt;
 
 	VALIDATE_STATE(s);
-	if (ppos != &file->f_pos)
-		return -ESPIPE;
 	if (!access_ok(VERIFY_READ, buffer, count))
 		return -EFAULT;
 	if (count == 0)
@@ -2212,7 +2204,7 @@ static int sv_midi_open(struct inode *inode, struct file *file)
 	spin_unlock_irqrestore(&s->lock, flags);
 	s->open_mode |= (file->f_mode << FMODE_MIDI_SHIFT) & (FMODE_MIDI_READ | FMODE_MIDI_WRITE);
 	up(&s->open_sem);
-	return 0;
+	return nonseekable_open(inode, file);
 }
 
 static int sv_midi_release(struct inode *inode, struct file *file)
@@ -2414,7 +2406,7 @@ static int sv_dmfm_open(struct inode *inode, struct file *file)
 	outb(1, s->iosynth+3);  /* enable OPL3 */
 	s->open_mode |= FMODE_DMFM;
 	up(&s->open_sem);
-	return 0;
+	return nonseekable_open(inode, file);
 }
 
 static int sv_dmfm_release(struct inode *inode, struct file *file)
diff --git a/sound/oss/sscape.c b/sound/oss/sscape.c
index 464b5696c..733bfc187 100644
--- a/sound/oss/sscape.c
+++ b/sound/oss/sscape.c
@@ -171,13 +171,18 @@ static unsigned char sscape_read(struct sscape_info *devc, int reg)
 	return val;
 }
 
+static void __sscape_write(int reg, int data)
+{
+	outb(reg, PORT(ODIE_ADDR));
+	outb(data, PORT(ODIE_DATA));
+}
+
 static void sscape_write(struct sscape_info *devc, int reg, int data)
 {
 	unsigned long flags;
 
 	spin_lock_irqsave(&devc->lock,flags);
-	outb(reg, PORT(ODIE_ADDR));
-	outb(data, PORT(ODIE_DATA));
+	__sscape_write(reg, data);
 	spin_unlock_irqrestore(&devc->lock,flags);
 }
 
@@ -386,7 +391,7 @@ static void sscape_coproc_close(void *dev_info, int sub_device)
 	spin_lock_irqsave(&devc->lock,flags);
 	if (devc->dma_allocated)
 	{
-		sscape_write(devc, GA_DMAA_REG, 0x20);	/* DMA channel disabled */
+		__sscape_write(GA_DMAA_REG, 0x20);	/* DMA channel disabled */
 		devc->dma_allocated = 0;
 	}
 	spin_unlock_irqrestore(&devc->lock,flags);
diff --git a/sound/oss/swarm_cs4297a.c b/sound/oss/swarm_cs4297a.c
index 0f58fa494..4846dc2cb 100644
--- a/sound/oss/swarm_cs4297a.c
+++ b/sound/oss/swarm_cs4297a.c
@@ -1524,14 +1524,6 @@ static int mixer_ioctl(struct cs4297a_state *s, unsigned int cmd,
 }
 
 
-// --------------------------------------------------------------------- 
-
-static loff_t cs4297a_llseek(struct file *file, loff_t offset, int origin)
-{
-	return -ESPIPE;
-}
-
-
 // --------------------------------------------------------------------- 
 
 static int cs4297a_open_mixdev(struct inode *inode, struct file *file)
@@ -1561,7 +1553,7 @@ static int cs4297a_open_mixdev(struct inode *inode, struct file *file)
 	CS_DBGOUT(CS_FUNCTION | CS_OPEN, 4,
 		  printk(KERN_INFO "cs4297a: cs4297a_open_mixdev()- 0\n"));
 
-	return 0;
+	return nonseekable_open(inode, file);
 }
 
 
@@ -1588,7 +1580,7 @@ static int cs4297a_ioctl_mixdev(struct inode *inode, struct file *file,
 // ******************************************************************************************
 static /*const */ struct file_operations cs4297a_mixer_fops = {
 	.owner		= THIS_MODULE,
-	.llseek		= cs4297a_llseek,
+	.llseek		= no_llseek,
 	.ioctl		= cs4297a_ioctl_mixdev,
 	.open		= cs4297a_open_mixdev,
 	.release	= cs4297a_release_mixdev,
@@ -1658,8 +1650,6 @@ static ssize_t cs4297a_read(struct file *file, char *buffer, size_t count,
 		  printk(KERN_INFO "cs4297a: cs4297a_read()+ %d \n", count));
 
 	VALIDATE_STATE(s);
-	if (ppos != &file->f_pos)
-		return -ESPIPE;
 	if (s->dma_adc.mapped)
 		return -ENXIO;
 	if (!s->dma_adc.ready && (ret = prog_dmabuf_adc(s)))
@@ -1784,8 +1774,6 @@ static ssize_t cs4297a_write(struct file *file, const char *buffer,
 			 count));
 	VALIDATE_STATE(s);
 
-	if (ppos != &file->f_pos)
-		return -ESPIPE;
 	if (s->dma_dac.mapped)
 		return -ENXIO;
 	if (!s->dma_dac.ready && (ret = prog_dmabuf_dac(s)))
@@ -2494,7 +2482,7 @@ static int cs4297a_open(struct inode *inode, struct file *file)
 	}
 	CS_DBGOUT(CS_FUNCTION | CS_OPEN, 2,
 		  printk(KERN_INFO "cs4297a: cs4297a_open()- 0\n"));
-	return 0;
+	return nonseekable_open(inode, file);
 }
 
 
@@ -2503,7 +2491,7 @@ static int cs4297a_open(struct inode *inode, struct file *file)
 // ******************************************************************************************
 static /*const */ struct file_operations cs4297a_audio_fops = {
 	.owner		= THIS_MODULE,
-	.llseek		= cs4297a_llseek,
+	.llseek		= no_llseek,
 	.read		= cs4297a_read,
 	.write		= cs4297a_write,
 	.poll		= cs4297a_poll,
diff --git a/sound/oss/trident.c b/sound/oss/trident.c
index ed04f4007..1beb4e9ff 100644
--- a/sound/oss/trident.c
+++ b/sound/oss/trident.c
@@ -1874,8 +1874,6 @@ trident_read(struct file *file, char __user *buffer, size_t count, loff_t * ppos
 	pr_debug("trident: trident_read called, count = %d\n", count);
 
 	VALIDATE_STATE(state);
-	if (ppos != &file->f_pos)
-		return -ESPIPE;
 
 	if (dmabuf->mapped)
 		return -ENXIO;
@@ -1992,8 +1990,6 @@ trident_write(struct file *file, const char __user *buffer, size_t count, loff_t
 	pr_debug("trident: trident_write called, count = %d\n", count);
 
 	VALIDATE_STATE(state);
-	if (ppos != &file->f_pos)
-		return -ESPIPE;
 
 	/*
 	 *      Guard against an mmap or ioctl while writing
@@ -2823,7 +2819,7 @@ trident_open(struct inode *inode, struct file *file)
 	pr_debug("trident: open virtual channel %d, hard channel %d\n",
 		 state->virt, dmabuf->channel->num);
 
-	return 0;
+	return nonseekable_open(inode, file);
 }
 
 static int
@@ -4079,7 +4075,7 @@ trident_open_mixdev(struct inode *inode, struct file *file)
       match:
 	file->private_data = card->ac97_codec[i];
 
-	return 0;
+	return nonseekable_open(inode, file);
 }
 
 static int
diff --git a/sound/oss/via82cxxx_audio.c b/sound/oss/via82cxxx_audio.c
index 2c83d03c1..dc1c25663 100644
--- a/sound/oss/via82cxxx_audio.c
+++ b/sound/oss/via82cxxx_audio.c
@@ -10,7 +10,7 @@
  * NO WARRANTY
  *
  * For a list of known bugs (errata) and documentation,
- * see via-audio.pdf in linux/Documentation/DocBook.
+ * see via-audio.pdf in Documentation/DocBook.
  * If this documentation does not exist, run "make pdfdocs".
  */
 
@@ -1580,7 +1580,7 @@ match:
 	file->private_data = card->ac97;
 
 	DPRINTK ("EXIT, returning 0\n");
-	return 0;
+	return nonseekable_open(inode, file);
 }
 
 static int via_mixer_ioctl (struct inode *inode, struct file *file, unsigned int cmd,
@@ -2401,11 +2401,6 @@ static ssize_t via_dsp_read(struct file *file, char __user *buffer, size_t count
 	card = file->private_data;
 	assert (card != NULL);
 
-	if (ppos != &file->f_pos) {
-		DPRINTK ("EXIT, returning -ESPIPE\n");
-		return -ESPIPE;
-	}
-
 	rc = via_syscall_down (card, nonblock);
 	if (rc) goto out;
 
@@ -2589,11 +2584,6 @@ static ssize_t via_dsp_write(struct file *file, const char __user *buffer, size_
 	card = file->private_data;
 	assert (card != NULL);
 
-	if (ppos != &file->f_pos) {
-		DPRINTK ("EXIT, returning -ESPIPE\n");
-		return -ESPIPE;
-	}
-
 	rc = via_syscall_down (card, nonblock);
 	if (rc) goto out;
 
@@ -3345,7 +3335,7 @@ match:
 	}
 
 	DPRINTK ("EXIT, returning 0\n");
-	return 0;
+	return nonseekable_open(inode, file);
 }
 
 
diff --git a/sound/oss/vwsnd.c b/sound/oss/vwsnd.c
index e438ba506..ce519a9a9 100644
--- a/sound/oss/vwsnd.c
+++ b/sound/oss/vwsnd.c
@@ -1,6 +1,6 @@
 /*
  * Sound driver for Silicon Graphics 320 and 540 Visual Workstations'
- * onboard audio.  See notes in ../../Documentation/sound/oss/vwsnd .
+ * onboard audio.  See notes in Documentation/sound/oss/vwsnd .
  *
  * Copyright 1999 Silicon Graphics, Inc.  All rights reserved.
  *
diff --git a/sound/oss/wavfront.c b/sound/oss/wavfront.c
index e7932229e..e0ecd44a3 100644
--- a/sound/oss/wavfront.c
+++ b/sound/oss/wavfront.c
@@ -312,7 +312,7 @@ static struct {
 	{ 0x0E, "Bad MIDI channel number" },
 	{ 0x10, "Download Record Error" },
 	{ 0x80, "Success" },
-	{ 0x0, 0x0 }
+	{ 0 }
 };
 
 #define NEEDS_ACK 1
@@ -493,7 +493,7 @@ wavefront_cmd (int cmd, unsigned char *rbuf, unsigned char *wbuf)
 
 	if (cmd == WFC_DOWNLOAD_MULTISAMPLE) {
 		wfcmd->write_cnt = (unsigned int) rbuf;
-		rbuf = 0;
+		rbuf = NULL;
 	}
 
 	DPRINT (WF_DEBUG_CMD, "0x%x [%s] (%d,%d,%d)\n",
@@ -745,7 +745,7 @@ wavefront_delete_sample (int sample_num)
 	wbuf[0] = sample_num & 0x7f;
 	wbuf[1] = sample_num >> 7;
 
-	if ((x = wavefront_cmd (WFC_DELETE_SAMPLE, 0, wbuf)) == 0) {
+	if ((x = wavefront_cmd (WFC_DELETE_SAMPLE, NULL, wbuf)) == 0) {
 		dev.sample_status[sample_num] = WF_ST_EMPTY;
 	}
 
@@ -934,7 +934,7 @@ wavefront_send_patch (wavefront_patch_info *header)
 	bptr = munge_int32 (header->number, buf, 2);
 	munge_buf ((unsigned char *)&header->hdr.p, bptr, WF_PATCH_BYTES);
     
-	if (wavefront_cmd (WFC_DOWNLOAD_PATCH, 0, buf)) {
+	if (wavefront_cmd (WFC_DOWNLOAD_PATCH, NULL, buf)) {
 		printk (KERN_ERR LOGNAME "download patch failed\n");
 		return -(EIO);
 	}
@@ -972,7 +972,7 @@ wavefront_send_program (wavefront_patch_info *header)
 	buf[0] = header->number;
 	munge_buf ((unsigned char *)&header->hdr.pr, &buf[1], WF_PROGRAM_BYTES);
     
-	if (wavefront_cmd (WFC_DOWNLOAD_PROGRAM, 0, buf)) {
+	if (wavefront_cmd (WFC_DOWNLOAD_PROGRAM, NULL, buf)) {
 		printk (KERN_WARNING LOGNAME "download patch failed\n");	
 		return -(EIO);
 	}
@@ -986,7 +986,7 @@ wavefront_freemem (void)
 {
 	char rbuf[8];
 
-	if (wavefront_cmd (WFC_REPORT_FREE_MEMORY, rbuf, 0)) {
+	if (wavefront_cmd (WFC_REPORT_FREE_MEMORY, rbuf, NULL)) {
 		printk (KERN_WARNING LOGNAME "can't get memory stats.\n");
 		return -1;
 	} else {
@@ -1011,7 +1011,7 @@ wavefront_send_sample (wavefront_patch_info *header,
 
 	UINT16 sample_short;
 	UINT32 length;
-	UINT16 __user *data_end = 0;
+	UINT16 __user *data_end = NULL;
 	unsigned int i;
 	const int max_blksize = 4096/2;
 	unsigned int written;
@@ -1188,7 +1188,7 @@ wavefront_send_sample (wavefront_patch_info *header,
 
 	if (wavefront_cmd (header->size ?
 			   WFC_DOWNLOAD_SAMPLE : WFC_DOWNLOAD_SAMPLE_HEADER,
-			   0, sample_hdr)) {
+			   NULL, sample_hdr)) {
 		printk (KERN_WARNING LOGNAME "sample %sdownload refused.\n",
 			header->size ? "" : "header ");
 		return -(EIO);
@@ -1214,7 +1214,7 @@ wavefront_send_sample (wavefront_patch_info *header,
 			blocksize = ((length-written+7)&~0x7);
 		}
 
-		if (wavefront_cmd (WFC_DOWNLOAD_BLOCK, 0, 0)) {
+		if (wavefront_cmd (WFC_DOWNLOAD_BLOCK, NULL, NULL)) {
 			printk (KERN_WARNING LOGNAME "download block "
 				"request refused.\n");
 			return -(EIO);
@@ -1321,7 +1321,7 @@ wavefront_send_alias (wavefront_patch_info *header)
 	munge_int32 (header->hdr.a.FrequencyBias, &alias_hdr[20], 3);
 	munge_int32 (*(&header->hdr.a.FrequencyBias+1), &alias_hdr[23], 2);
 
-	if (wavefront_cmd (WFC_DOWNLOAD_SAMPLE_ALIAS, 0, alias_hdr)) {
+	if (wavefront_cmd (WFC_DOWNLOAD_SAMPLE_ALIAS, NULL, alias_hdr)) {
 		printk (KERN_ERR LOGNAME "download alias failed.\n");
 		return -(EIO);
 	}
@@ -1445,7 +1445,7 @@ wavefront_send_drum (wavefront_patch_info *header)
 		munge_int32 (((unsigned char *)drum)[i], &drumbuf[1+(i*2)], 2);
 	}
 
-	if (wavefront_cmd (WFC_DOWNLOAD_EDRUM_PROGRAM, 0, drumbuf)) {
+	if (wavefront_cmd (WFC_DOWNLOAD_EDRUM_PROGRAM, NULL, drumbuf)) {
 		printk (KERN_ERR LOGNAME "download drum failed.\n");
 		return -(EIO);
 	}
@@ -2738,7 +2738,7 @@ static int __init wavefront_do_reset (int atboot)
 
 	voices[0] = 32;
 
-	if (wavefront_cmd (WFC_SET_NVOICES, 0, voices)) {
+	if (wavefront_cmd (WFC_SET_NVOICES, NULL, voices)) {
 		printk (KERN_WARNING LOGNAME
 			"cannot set number of voices to 32.\n");
 		goto gone_bad;
diff --git a/sound/oss/ymfpci.c b/sound/oss/ymfpci.c
index 7b3236fed..13bcc7621 100644
--- a/sound/oss/ymfpci.c
+++ b/sound/oss/ymfpci.c
@@ -1231,8 +1231,6 @@ ymf_read(struct file *file, char __user *buffer, size_t count, loff_t *ppos)
 	unsigned int swptr;
 	int cnt;			/* This many to go in this revolution */
 
-	if (ppos != &file->f_pos)
-		return -ESPIPE;
 	if (dmabuf->mapped)
 		return -ENXIO;
 	if (!dmabuf->ready && (ret = prog_dmabuf(state, 1)))
@@ -1350,8 +1348,6 @@ ymf_write(struct file *file, const char __user *buffer, size_t count, loff_t *pp
 
 	YMFDBGW("ymf_write: count %d\n", count);
 
-	if (ppos != &file->f_pos)
-		return -ESPIPE;
 	if (dmabuf->mapped)
 		return -ENXIO;
 	if (!dmabuf->ready && (ret = prog_dmabuf(state, 0)))
@@ -1965,7 +1961,7 @@ static int ymf_open(struct inode *inode, struct file *file)
 #endif
 	up(&unit->open_sem);
 
-	return 0;
+	return nonseekable_open(inode, file);
 
 out_nodma:
 	/*
@@ -2043,7 +2039,7 @@ static int ymf_open_mixdev(struct inode *inode, struct file *file)
  match:
 	file->private_data = unit->ac97_codec[i];
 
-	return 0;
+	return nonseekable_open(inode, file);
 }
 
 static int ymf_ioctl_mixdev(struct inode *inode, struct file *file,
@@ -2365,7 +2361,8 @@ static int ymfpci_memalloc(ymfpci_t *codec)
 	codec->dma_area_ba = pba;
 	codec->dma_area_size = size + 0xff;
 
-	if ((off = ((uint) ptr) & 0xff) != 0) {
+	off = (unsigned long)ptr & 0xff;
+	if (off) {
 		ptr += 0x100 - off;
 		pba += 0x100 - off;
 	}
diff --git a/sound/pci/au88x0/au88x0.h b/sound/pci/au88x0/au88x0.h
index 815de180c..bf6097d04 100644
--- a/sound/pci/au88x0/au88x0.h
+++ b/sound/pci/au88x0/au88x0.h
@@ -146,12 +146,12 @@ struct snd_vortex {
 #endif
 
 	/* Global resources */
-	char mixcapt[2];
-	char mixplayb[4];
+	s8 mixcapt[2];
+	s8 mixplayb[4];
 #ifndef CHIP_AU8820
-	char mixspdif[2];
-	char mixa3d[2];		/* mixers which collect all a3d streams. */
-	char mixxtlk[2];	/* crosstalk canceler mixer inputs. */
+	s8 mixspdif[2];
+	s8 mixa3d[2];	/* mixers which collect all a3d streams. */
+	s8 mixxtlk[2];	/* crosstalk canceler mixer inputs. */
 #endif
 	u32 fixed_res[5];
 
diff --git a/sound/pci/au88x0/au88x0_a3d.c b/sound/pci/au88x0/au88x0_a3d.c
index dd85d947b..8d4919ca2 100644
--- a/sound/pci/au88x0/au88x0_a3d.c
+++ b/sound/pci/au88x0/au88x0_a3d.c
@@ -765,7 +765,7 @@ snd_vortex_a3d_filter_info(snd_kcontrol_t *
 static int
 snd_vortex_a3d_get(snd_kcontrol_t * kcontrol, snd_ctl_elem_value_t * ucontrol)
 {
-	//a3dsrc_t *a = (a3dsrc_t*)(kcontrol->private_value);
+	//a3dsrc_t *a = kcontrol->private_data;
 	/* No read yet. Would this be really useable/needed ? */
 
 	return 0;
@@ -775,7 +775,7 @@ static int
 snd_vortex_a3d_hrtf_put(snd_kcontrol_t *
 			kcontrol, snd_ctl_elem_value_t * ucontrol)
 {
-	a3dsrc_t *a = (a3dsrc_t *) (kcontrol->private_value);
+	a3dsrc_t *a = kcontrol->private_data;
 	int changed = 1, i;
 	int coord[6];
 	for (i = 0; i < 6; i++)
@@ -792,7 +792,7 @@ static int
 snd_vortex_a3d_itd_put(snd_kcontrol_t *
 		       kcontrol, snd_ctl_elem_value_t * ucontrol)
 {
-	a3dsrc_t *a = (a3dsrc_t *) (kcontrol->private_value);
+	a3dsrc_t *a = kcontrol->private_data;
 	int coord[6];
 	int i, changed = 1;
 	for (i = 0; i < 6; i++)
@@ -811,7 +811,7 @@ static int
 snd_vortex_a3d_ild_put(snd_kcontrol_t *
 		       kcontrol, snd_ctl_elem_value_t * ucontrol)
 {
-	a3dsrc_t *a = (a3dsrc_t *) (kcontrol->private_value);
+	a3dsrc_t *a = kcontrol->private_data;
 	int changed = 1;
 	int l, r;
 	/* There may be some scale tranlation needed here. */
@@ -828,7 +828,7 @@ static int
 snd_vortex_a3d_filter_put(snd_kcontrol_t
 			  * kcontrol, snd_ctl_elem_value_t * ucontrol)
 {
-	a3dsrc_t *a = (a3dsrc_t *) (kcontrol->private_value);
+	a3dsrc_t *a = kcontrol->private_data;
 	int i, changed = 1;
 	int params[6];
 	for (i = 0; i < 6; i++)
@@ -846,12 +846,12 @@ snd_vortex_a3d_filter_put(snd_kcontrol_t
 }
 
 static snd_kcontrol_new_t vortex_a3d_kcontrol __devinitdata = {
-	.iface = SNDRV_CTL_ELEM_IFACE_PCM,.name =
-	    "Playback PCM advanced processing",.index =
-	    0,.access =
-	    SNDRV_CTL_ELEM_ACCESS_READWRITE,.private_value =
-	    0,.info = snd_vortex_a3d_hrtf_info,.get =
-	    snd_vortex_a3d_get,.put = snd_vortex_a3d_hrtf_put
+	.iface = SNDRV_CTL_ELEM_IFACE_PCM,
+	.name = "Playback PCM advanced processing",
+	.access = SNDRV_CTL_ELEM_ACCESS_READWRITE,
+	.info = snd_vortex_a3d_hrtf_info,
+	.get = snd_vortex_a3d_get,
+	.put = snd_vortex_a3d_hrtf_put,
 };
 
 /* Control (un)registration. */
@@ -864,7 +864,7 @@ static int vortex_a3d_register_controls(vortex_t * vortex)
 		if ((kcontrol =
 		     snd_ctl_new1(&vortex_a3d_kcontrol, vortex)) == NULL)
 			return -ENOMEM;
-		kcontrol->private_value = (int)&(vortex->a3d[i]);
+		kcontrol->private_data = &vortex->a3d[i];
 		kcontrol->id.numid = CTRLID_HRTF;
 		kcontrol->info = snd_vortex_a3d_hrtf_info;
 		kcontrol->put = snd_vortex_a3d_hrtf_put;
@@ -876,7 +876,7 @@ static int vortex_a3d_register_controls(vortex_t * vortex)
 		if ((kcontrol =
 		     snd_ctl_new1(&vortex_a3d_kcontrol, vortex)) == NULL)
 			return -ENOMEM;
-		kcontrol->private_value = (int)&(vortex->a3d[i]);
+		kcontrol->private_data = &vortex->a3d[i];
 		kcontrol->id.numid = CTRLID_ITD;
 		kcontrol->info = snd_vortex_a3d_itd_info;
 		kcontrol->put = snd_vortex_a3d_itd_put;
@@ -888,7 +888,7 @@ static int vortex_a3d_register_controls(vortex_t * vortex)
 		if ((kcontrol =
 		     snd_ctl_new1(&vortex_a3d_kcontrol, vortex)) == NULL)
 			return -ENOMEM;
-		kcontrol->private_value = (int)&(vortex->a3d[i]);
+		kcontrol->private_data = &vortex->a3d[i];
 		kcontrol->id.numid = CTRLID_GAINS;
 		kcontrol->info = snd_vortex_a3d_ild_info;
 		kcontrol->put = snd_vortex_a3d_ild_put;
@@ -900,7 +900,7 @@ static int vortex_a3d_register_controls(vortex_t * vortex)
 		if ((kcontrol =
 		     snd_ctl_new1(&vortex_a3d_kcontrol, vortex)) == NULL)
 			return -ENOMEM;
-		kcontrol->private_value = (int)&(vortex->a3d[i]);
+		kcontrol->private_data = &vortex->a3d[i];
 		kcontrol->id.numid = CTRLID_FILTER;
 		kcontrol->info = snd_vortex_a3d_filter_info;
 		kcontrol->put = snd_vortex_a3d_filter_put;
diff --git a/sound/pci/azt3328.c b/sound/pci/azt3328.c
index 9dc7de84d..313411a73 100644
--- a/sound/pci/azt3328.c
+++ b/sound/pci/azt3328.c
@@ -843,7 +843,7 @@ static int snd_azf3328_playback_trigger(snd_pcm_substream_t * substream, int cmd
 		snd_azf3328_setdmaa(chip, runtime->dma_addr, snd_pcm_lib_period_bytes(substream), snd_pcm_lib_buffer_bytes(substream), 0);
 
 		spin_lock_irqsave(&chip->reg_lock, flags);
-#if WIN9X
+#ifdef WIN9X
 		/* FIXME: enable playback/recording??? */
 		status1 |= DMA_PLAY_SOMETHING1 | DMA_PLAY_SOMETHING2;
 		outw(status1, chip->codec_port+IDX_IO_PLAY_FLAGS);
@@ -933,7 +933,7 @@ static int snd_azf3328_capture_trigger(snd_pcm_substream_t * substream, int cmd)
 		snd_azf3328_setdmaa(chip, runtime->dma_addr, snd_pcm_lib_period_bytes(substream), snd_pcm_lib_buffer_bytes(substream), 1);
 
 		spin_lock_irqsave(&chip->reg_lock, flags);
-#if WIN9X
+#ifdef WIN9X
 		/* FIXME: enable playback/recording??? */
 		status1 |= DMA_PLAY_SOMETHING1 | DMA_PLAY_SOMETHING2;
 		outw(status1, chip->codec_port+IDX_IO_REC_FLAGS);
@@ -993,7 +993,7 @@ static snd_pcm_uframes_t snd_azf3328_playback_pointer(snd_pcm_substream_t * subs
 	unsigned long flags;
 
 	spin_lock_irqsave(&chip->reg_lock, flags);
-#if QUERY_HARDWARE
+#ifdef QUERY_HARDWARE
 	bufptr = inl(chip->codec_port+IDX_IO_PLAY_DMA_START_1);
 #else
 	bufptr = substream->runtime->dma_addr;
@@ -1016,7 +1016,7 @@ static snd_pcm_uframes_t snd_azf3328_capture_pointer(snd_pcm_substream_t * subst
 	unsigned long flags;
 
 	spin_lock_irqsave(&chip->reg_lock, flags);
-#if QUERY_HARDWARE
+#ifdef QUERY_HARDWARE
 	bufptr = inl(chip->codec_port+IDX_IO_REC_DMA_START_1);
 #else
 	bufptr = substream->runtime->dma_addr;
diff --git a/sound/pci/cs4281.c b/sound/pci/cs4281.c
index 91a60417e..86430a0bc 100644
--- a/sound/pci/cs4281.c
+++ b/sound/pci/cs4281.c
@@ -1185,35 +1185,35 @@ static void snd_cs4281_proc_read(snd_info_entry_t *entry,
 }
 
 static long snd_cs4281_BA0_read(snd_info_entry_t *entry, void *file_private_data,
-				struct file *file, char __user *buf, long count)
+				struct file *file, char __user *buf,
+				unsigned long count, unsigned long pos)
 {
 	long size;
 	cs4281_t *chip = snd_magic_cast(cs4281_t, entry->private_data, return -ENXIO);
 	
 	size = count;
-	if (file->f_pos + size > CS4281_BA0_SIZE)
-		size = (long)CS4281_BA0_SIZE - file->f_pos;
+	if (pos + size > CS4281_BA0_SIZE)
+		size = (long)CS4281_BA0_SIZE - pos;
 	if (size > 0) {
-		if (copy_to_user_fromio(buf, chip->ba0 + file->f_pos, size))
+		if (copy_to_user_fromio(buf, chip->ba0 + pos, size))
 			return -EFAULT;
-		file->f_pos += size;
 	}
 	return size;
 }
 
 static long snd_cs4281_BA1_read(snd_info_entry_t *entry, void *file_private_data,
-				struct file *file, char __user *buf, long count)
+				struct file *file, char __user *buf,
+				unsigned long count, unsigned long pos)
 {
 	long size;
 	cs4281_t *chip = snd_magic_cast(cs4281_t, entry->private_data, return -ENXIO);
 	
 	size = count;
-	if (file->f_pos + size > CS4281_BA1_SIZE)
-		size = (long)CS4281_BA1_SIZE - file->f_pos;
+	if (pos + size > CS4281_BA1_SIZE)
+		size = (long)CS4281_BA1_SIZE - pos;
 	if (size > 0) {
-		if (copy_to_user_fromio(buf, chip->ba1 + file->f_pos, size))
+		if (copy_to_user_fromio(buf, chip->ba1 + pos, size))
 			return -EFAULT;
-		file->f_pos += size;
 	}
 	return size;
 }
diff --git a/sound/pci/cs46xx/cs46xx_lib.c b/sound/pci/cs46xx/cs46xx_lib.c
index 9a1758396..e9810d2ea 100644
--- a/sound/pci/cs46xx/cs46xx_lib.c
+++ b/sound/pci/cs46xx/cs46xx_lib.c
@@ -2866,18 +2866,18 @@ void __devinit snd_cs46xx_gameport(cs46xx_t *chip)
  */
 
 static long snd_cs46xx_io_read(snd_info_entry_t *entry, void *file_private_data,
-			       struct file *file, char __user *buf, long count)
+			       struct file *file, char __user *buf,
+			       unsigned long count, unsigned long pos)
 {
 	long size;
 	snd_cs46xx_region_t *region = (snd_cs46xx_region_t *)entry->private_data;
 	
 	size = count;
-	if (file->f_pos + (size_t)size > region->size)
-		size = region->size - file->f_pos;
+	if (pos + (size_t)size > region->size)
+		size = region->size - pos;
 	if (size > 0) {
-		if (copy_to_user_fromio(buf, region->remap_addr + file->f_pos, size))
+		if (copy_to_user_fromio(buf, region->remap_addr + pos, size))
 			return -EFAULT;
-		file->f_pos += size;
 	}
 	return size;
 }
diff --git a/sound/pci/cs46xx/dsp_spos_scb_lib.c b/sound/pci/cs46xx/dsp_spos_scb_lib.c
index 3100d003d..c02a9497c 100644
--- a/sound/pci/cs46xx/dsp_spos_scb_lib.c
+++ b/sound/pci/cs46xx/dsp_spos_scb_lib.c
@@ -246,6 +246,12 @@ void cs46xx_dsp_proc_register_scb_desc (cs46xx_t *chip,dsp_scb_descriptor_t * sc
 		if ((entry = snd_info_create_card_entry(ins->snd_card, scb->scb_name, 
 							ins->proc_dsp_dir)) != NULL) {
 			scb_info = kmalloc(sizeof(proc_scb_info_t), GFP_KERNEL);
+			if (!scb_info) {
+				snd_info_free_entry(entry);
+				entry = NULL;
+				goto out;
+			}
+
 			scb_info->chip = chip;
 			scb_info->scb_desc = scb;
       
@@ -262,7 +268,7 @@ void cs46xx_dsp_proc_register_scb_desc (cs46xx_t *chip,dsp_scb_descriptor_t * sc
 				entry = NULL;
 			}
 		}
-
+out:
 		scb->proc_info = entry;
 	}
 }
diff --git a/sound/pci/emu10k1/emuproc.c b/sound/pci/emu10k1/emuproc.c
index 39f5307e2..9582c3179 100644
--- a/sound/pci/emu10k1/emuproc.c
+++ b/sound/pci/emu10k1/emuproc.c
@@ -191,7 +191,8 @@ static void snd_emu10k1_proc_acode_read(snd_info_entry_t *entry,
 #define TOTAL_SIZE_CODE		(0x200*8)
 
 static long snd_emu10k1_fx8010_read(snd_info_entry_t *entry, void *file_private_data,
-				    struct file *file, char __user *buf, long count)
+				    struct file *file, char __user *buf,
+				    unsigned long count, unsigned long pos)
 {
 	long size;
 	emu10k1_t *emu = snd_magic_cast(emu10k1_t, entry->private_data, return -ENXIO);
@@ -209,21 +210,20 @@ static long snd_emu10k1_fx8010_read(snd_info_entry_t *entry, void *file_private_
 		offset = emu->audigy ? A_FXGPREGBASE : FXGPREGBASE;
 	}
 	size = count;
-	if (file->f_pos + size > entry->size)
-		size = (long)entry->size - file->f_pos;
+	if (pos + size > entry->size)
+		size = (long)entry->size - pos;
 	if (size > 0) {
 		unsigned int *tmp;
 		long res;
 		unsigned int idx;
 		if ((tmp = kmalloc(size + 8, GFP_KERNEL)) == NULL)
 			return -ENOMEM;
-		for (idx = 0; idx < ((file->f_pos & 3) + size + 3) >> 2; idx++)
-			tmp[idx] = snd_emu10k1_ptr_read(emu, offset + idx + (file->f_pos >> 2), 0);
-		if (copy_to_user(buf, ((char *)tmp) + (file->f_pos & 3), size))
+		for (idx = 0; idx < ((pos & 3) + size + 3) >> 2; idx++)
+			tmp[idx] = snd_emu10k1_ptr_read(emu, offset + idx + (pos >> 2), 0);
+		if (copy_to_user(buf, ((char *)tmp) + (pos & 3), size))
 			res = -EFAULT;
 		else {
 			res = size;
-			file->f_pos += size;
 		}
 		kfree(tmp);
 		return res;
diff --git a/sound/pci/es1968.c b/sound/pci/es1968.c
index f658de44c..437d13b42 100644
--- a/sound/pci/es1968.c
+++ b/sound/pci/es1968.c
@@ -1990,6 +1990,8 @@ static void es1968_update_hw_volume(unsigned long private_data)
 			if ((val & 0xff00) < 0x1f00)
 				val += 0x0100;
 		}
+		if (val == 0x1f1f)
+			val |= 0x8000;
 		snd_ac97_write_cache(chip->ac97, AC97_MASTER, val);
 		snd_ctl_notify(chip->card, SNDRV_CTL_EVENT_MASK_VALUE,
 			       &chip->master_volume->id);
diff --git a/sound/pci/ice1712/ice1712.c b/sound/pci/ice1712/ice1712.c
index 08b94db68..d1f1ec28a 100644
--- a/sound/pci/ice1712/ice1712.c
+++ b/sound/pci/ice1712/ice1712.c
@@ -2295,7 +2295,7 @@ static struct snd_ice1712_card_info *card_tables[] __devinitdata = {
 	snd_ice1712_hoontech_cards,
 	snd_ice1712_delta_cards,
 	snd_ice1712_ews_cards,
-	0,
+	NULL,
 };
 
 static unsigned char __devinit snd_ice1712_read_i2c(ice1712_t *ice,
diff --git a/sound/pci/ice1712/ice1724.c b/sound/pci/ice1712/ice1724.c
index a7a55a98b..60fb18980 100644
--- a/sound/pci/ice1712/ice1724.c
+++ b/sound/pci/ice1712/ice1724.c
@@ -1071,7 +1071,7 @@ static int snd_vt1724_playback_indep_open(snd_pcm_substream_t *substream)
 		return -EBUSY; /* FIXME: should handle blocking mode properly */
 	}
 	up(&ice->open_mutex);
-	runtime->private_data = (void*)(1 << (substream->number + 4));
+	runtime->private_data = (void*)(1UL << (substream->number + 4));
 	ice->playback_con_substream_ds[substream->number] = substream;
 	runtime->hw = snd_vt1724_2ch_stereo;
 	snd_pcm_set_sync(substream);
@@ -1815,7 +1815,7 @@ static struct snd_ice1712_card_info *card_tables[] __devinitdata = {
 	snd_vt1724_revo_cards,
 	snd_vt1724_amp_cards, 
 	snd_vt1724_aureon_cards,
-	0,
+	NULL,
 };
 
 
diff --git a/sound/pci/intel8x0.c b/sound/pci/intel8x0.c
index e6b14ad77..5493667dd 100644
--- a/sound/pci/intel8x0.c
+++ b/sound/pci/intel8x0.c
@@ -2617,7 +2617,7 @@ static struct shortname_table {
 	{ 0x746d, "AMD AMD8111" },
 	{ 0x7445, "AMD AMD768" },
 	{ 0x5455, "ALi M5455" },
-	{ 0, 0 },
+	{ 0, NULL },
 };
 
 static int __devinit snd_intel8x0_probe(struct pci_dev *pci,
diff --git a/sound/pci/intel8x0m.c b/sound/pci/intel8x0m.c
index 6046ac13a..b09b6f7f8 100644
--- a/sound/pci/intel8x0m.c
+++ b/sound/pci/intel8x0m.c
@@ -1328,7 +1328,7 @@ static struct shortname_table {
 	{ 0x5455, "ALi M5455" },
 	{ 0x746d, "AMD AMD8111" },
 #endif
-	{ 0, 0 },
+	{ 0 },
 };
 
 static int __devinit snd_intel8x0m_probe(struct pci_dev *pci,
diff --git a/sound/pci/maestro3.c b/sound/pci/maestro3.c
index 8c0bc7694..eabfcd30d 100644
--- a/sound/pci/maestro3.c
+++ b/sound/pci/maestro3.c
@@ -968,7 +968,7 @@ static struct m3_quirk m3_quirk_list[] = {
 		.amp_gpio = 0x03,
 	},
 	/* END */
-	{ 0 }
+	{ NULL }
 };
 
 
diff --git a/sound/pci/mixart/mixart.c b/sound/pci/mixart/mixart.c
index 2b918cc7f..7e312df0c 100644
--- a/sound/pci/mixart/mixart.c
+++ b/sound/pci/mixart/mixart.c
@@ -1154,18 +1154,18 @@ static long long snd_mixart_BA1_llseek(snd_info_entry_t *entry,
   mixart_BA0 proc interface for BAR 0 - read callback
  */
 static long snd_mixart_BA0_read(snd_info_entry_t *entry, void *file_private_data,
-				struct file *file, char __user *buf, long count)
+				struct file *file, char __user *buf,
+				unsigned long count, unsigned long pos)
 {
 	mixart_mgr_t *mgr = snd_magic_cast(mixart_mgr_t, entry->private_data, return -ENXIO);
 
 	count = count & ~3; /* make sure the read size is a multiple of 4 bytes */
 	if(count <= 0)
 		return 0;
-	if(file->f_pos + count > MIXART_BA0_SIZE)
-		count = (long)(MIXART_BA0_SIZE - file->f_pos);
-	if(copy_to_user_fromio(buf, MIXART_MEM( mgr, file->f_pos ), count))
+	if(pos + count > MIXART_BA0_SIZE)
+		count = (long)(MIXART_BA0_SIZE - pos);
+	if(copy_to_user_fromio(buf, MIXART_MEM( mgr, pos ), count))
 		return -EFAULT;
-	file->f_pos += count;
 	return count;
 }
 
@@ -1173,18 +1173,18 @@ static long snd_mixart_BA0_read(snd_info_entry_t *entry, void *file_private_data
   mixart_BA1 proc interface for BAR 1 - read callback
  */
 static long snd_mixart_BA1_read(snd_info_entry_t *entry, void *file_private_data,
-				struct file *file, char __user *buf, long count)
+				struct file *file, char __user *buf,
+				unsigned long count, unsigned long pos)
 {
 	mixart_mgr_t *mgr = snd_magic_cast(mixart_mgr_t, entry->private_data, return -ENXIO);
 
 	count = count & ~3; /* make sure the read size is a multiple of 4 bytes */
 	if(count <= 0)
 		return 0;
-	if(file->f_pos + count > MIXART_BA1_SIZE)
-		count = (long)(MIXART_BA1_SIZE - file->f_pos);
-	if(copy_to_user_fromio(buf, MIXART_REG( mgr, file->f_pos ), count))
+	if(pos + count > MIXART_BA1_SIZE)
+		count = (long)(MIXART_BA1_SIZE - pos);
+	if(copy_to_user_fromio(buf, MIXART_REG( mgr, pos ), count))
 		return -EFAULT;
-	file->f_pos += count;
 	return count;
 }
 
diff --git a/sound/pci/nm256/nm256.c b/sound/pci/nm256/nm256.c
index ee3b246bb..5637e0b79 100644
--- a/sound/pci/nm256/nm256.c
+++ b/sound/pci/nm256/nm256.c
@@ -703,7 +703,7 @@ static int
 snd_nm256_capture_copy(snd_pcm_substream_t *substream,
 		       int channel, /* not used (interleaved data) */
 		       snd_pcm_uframes_t pos,
-		       void *dst,
+		       void __user *dst,
 		       snd_pcm_uframes_t count)
 {
 	snd_pcm_runtime_t *runtime = substream->runtime;
@@ -1509,6 +1509,10 @@ snd_nm256_create(snd_card_t *card, struct pci_dev *pci,
 		/* this workaround will cause lock-up after suspend/resume on Sony PCG-F305 */
 		chip->latitude_workaround = 0;
 	}
+	if (subsystem_vendor == 0x1028 && subsystem_device == 0x0080) {
+		/* this workaround will cause lock-up after suspend/resume on a Dell laptop */
+		chip->latitude_workaround = 0;
+	}
 
 	snd_nm256_init_chip(chip);
 
diff --git a/sound/pci/rme9652/hdsp.c b/sound/pci/rme9652/hdsp.c
index c91602c12..628516c8b 100644
--- a/sound/pci/rme9652/hdsp.c
+++ b/sound/pci/rme9652/hdsp.c
@@ -4971,16 +4971,16 @@ static int __devinit snd_hdsp_create(snd_card_t *card,
 
 	hdsp->irq = -1;
 	hdsp->state = 0;
-	hdsp->midi[0].rmidi = 0;
-	hdsp->midi[1].rmidi = 0;
-	hdsp->midi[0].input = 0;
-	hdsp->midi[1].input = 0;
-	hdsp->midi[0].output = 0;
-	hdsp->midi[1].output = 0;
+	hdsp->midi[0].rmidi = NULL;
+	hdsp->midi[1].rmidi = NULL;
+	hdsp->midi[0].input = NULL;
+	hdsp->midi[1].input = NULL;
+	hdsp->midi[0].output = NULL;
+	hdsp->midi[1].output = NULL;
 	spin_lock_init(&hdsp->midi[0].lock);
 	spin_lock_init(&hdsp->midi[1].lock);
 	hdsp->iobase = 0;
-	hdsp->res_port = 0;
+	hdsp->res_port = NULL;
 	hdsp->control_register = 0;
 	hdsp->control2_register = 0;
 	hdsp->io_type = Undefined;
diff --git a/sound/pci/sonicvibes.c b/sound/pci/sonicvibes.c
index 5f9475d2a..af77bd803 100644
--- a/sound/pci/sonicvibes.c
+++ b/sound/pci/sonicvibes.c
@@ -805,7 +805,7 @@ static int snd_sonicvibes_playback_open(snd_pcm_substream_t * substream)
 	sonic->mode |= SV_MODE_PLAY;
 	sonic->playback_substream = substream;
 	runtime->hw = snd_sonicvibes_playback;
-	snd_pcm_hw_rule_add(runtime, 0, SNDRV_PCM_HW_PARAM_RATE, snd_sonicvibes_hw_constraint_dac_rate, 0, SNDRV_PCM_HW_PARAM_RATE, -1);
+	snd_pcm_hw_rule_add(runtime, 0, SNDRV_PCM_HW_PARAM_RATE, snd_sonicvibes_hw_constraint_dac_rate, NULL, SNDRV_PCM_HW_PARAM_RATE, -1);
 	return 0;
 }
 
diff --git a/sound/ppc/Kconfig b/sound/ppc/Kconfig
index 67c991c9b..1860cb95d 100644
--- a/sound/ppc/Kconfig
+++ b/sound/ppc/Kconfig
@@ -3,9 +3,12 @@
 menu "ALSA PowerMac devices"
 	depends on SND!=n && PPC
 
+comment "ALSA PowerMac requires I2C"
+	depends on SND && I2C=n
+
 config SND_POWERMAC
 	tristate "PowerMac (AWACS, DACA, Burgundy, Tumbler, Keywest)"
-	depends on SND
+	depends on SND && I2C
 	select SND_PCM
 
 endmenu
diff --git a/sound/ppc/pmac.c b/sound/ppc/pmac.c
index 95dfeef91..6b307b064 100644
--- a/sound/ppc/pmac.c
+++ b/sound/ppc/pmac.c
@@ -896,7 +896,7 @@ static int __init snd_pmac_detect(pmac_t *chip)
 		sound = sound->next;
 	if (! sound)
 		return -ENODEV;
-	prop = (unsigned int *) get_property(sound, "sub-frame", 0);
+	prop = (unsigned int *) get_property(sound, "sub-frame", NULL);
 	if (prop && *prop < 16)
 		chip->subframe = *prop;
 	/* This should be verified on older screamers */
@@ -931,7 +931,14 @@ static int __init snd_pmac_detect(pmac_t *chip)
 		chip->freq_table = tumbler_freqs;
 		chip->control_mask = MASK_IEPC | 0x11; /* disable IEE */
 	}
-	prop = (unsigned int *)get_property(sound, "device-id", 0);
+	if (device_is_compatible(sound, "AOAKeylargo")) {
+		/* Seems to support the stock AWACS frequencies, but has
+		   a snapper mixer */
+		chip->model = PMAC_SNAPPER;
+		// chip->can_byte_swap = 0; /* FIXME: check this */
+		chip->control_mask = MASK_IEPC | 0x11; /* disable IEE */
+	}
+	prop = (unsigned int *)get_property(sound, "device-id", NULL);
 	if (prop)
 		chip->device_id = *prop;
 	chip->has_iic = (find_devices("perch") != NULL);
diff --git a/sound/usb/usbaudio.c b/sound/usb/usbaudio.c
index 38f415e33..6d5197c93 100644
--- a/sound/usb/usbaudio.c
+++ b/sound/usb/usbaudio.c
@@ -898,11 +898,11 @@ static void release_urb_ctx(snd_urb_ctx_t *u)
 {
 	if (u->urb) {
 		usb_free_urb(u->urb);
-		u->urb = 0;
+		u->urb = NULL;
 	}
 	if (u->buf) {
 		kfree(u->buf);
-		u->buf = 0;
+		u->buf = NULL;
 	}
 }
 
@@ -923,7 +923,7 @@ static void release_substream_urbs(snd_usb_substream_t *subs, int force)
 		release_urb_ctx(&subs->syncurb[i]);
 	if (subs->tmpbuf) {
 		kfree(subs->tmpbuf);
-		subs->tmpbuf = 0;
+		subs->tmpbuf = NULL;
 	}
 	subs->nurbs = 0;
 }
diff --git a/sound/usb/usbmixer.c b/sound/usb/usbmixer.c
index a17d3f82d..13921f1f1 100644
--- a/sound/usb/usbmixer.c
+++ b/sound/usb/usbmixer.c
@@ -574,7 +574,7 @@ static void usb_mixer_elem_free(snd_kcontrol_t *kctl)
 {
 	if (kctl->private_data) {
 		snd_magic_kfree((void *)kctl->private_data);
-		kctl->private_data = 0;
+		kctl->private_data = NULL;
 	}
 }
 
@@ -1318,7 +1318,7 @@ static void usb_mixer_selector_elem_free(snd_kcontrol_t *kctl)
 		usb_mixer_elem_info_t *cval = snd_magic_cast(usb_mixer_elem_info_t, kctl->private_data,);
 		num_ins = cval->max;
 		snd_magic_kfree(cval);
-		kctl->private_data = 0;
+		kctl->private_data = NULL;
 	}
 	if (kctl->private_value) {
 		char **itemlist = (char **)kctl->private_value;
-- 
2.47.0